diff --git a/LICENSE b/LICENSE index 98608a6..7cef05a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2016 PayByPhone Technologies, Inc. +Copyright:: Copyright (c) 2017 Edward Wilde Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index 80dd9c6..013dd55 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,13 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) default: build test testacc test: fmtcheck - go test -v . ./plugin/providers/runscope + go test -v . ./runscope testacc: fmtcheck @test "${RUNSCOPE_ACCESS_TOKEN}" || (echo '$$RUNSCOPE_ACCESS_TOKEN required' && exit 1) @test "${RUNSCOPE_TEAM_ID}" || (echo '$$RUNSCOPE_TEAM_ID required' && exit 1) - go test -count=1 -v ./plugin/providers/runscope -run="TestAcc" -timeout 20m + go test -count=1 -v ./runscope -run="TestAcc" -timeout 20m build: fmtcheck vet testacc @go install diff --git a/README.md b/README.md index 6d700ba..0fbfb9b 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,27 @@ [![Build Status](https://travis-ci.org/ewilde/terraform-provider-runscope.svg?branch=master)](https://travis-ci.org/ewilde/terraform-provider-runscope) -Terraform Runscope Provider -=========================== +# Terraform Runscope Provider -This repository contains a plugin form of the Runscope provider that was proposed -and submitted in [Terraform PR #14221][1]. +- Website: https://www.terraform.io +- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby) +- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool) -The Runscope provider is used to create and manage Runscope tests using -the official [Runscope API][2] + -## Installing +The Runscope provider is used to create and manage Runscope tests using +the official [Runscope API](https://www.runscope.com/docs/api) -See the [Plugin Basics][4] page of the Terraform docs to see how to plunk this -into your config. Check the [releases page][5] of this repo to get releases for -Linux, OS X, and Windows. +## Requirements -## Releasing -Releases are automatically setup to go out from the master branch after a build is made on master with a tag. +- [Terraform](https://www.terraform.io/downloads.html) 0.10.x +- [Go](https://golang.org/doc/install) 1.9 (to build the provider plugin) -To perform a release simply create a tag: -` git tag -a v0.0.2 -m "Release message"` - -Then push your tag: -`git push origin v0.0.2` +## Installing -That's it, the build will now run and create a new release on [github](https://github.com/form3tech/ewilde/terraform-provider-runscope) : +See the [Plugin Basics][4] page of the Terraform docs to see how to plug this +into your config. Check the [releases page][5] of this repository to get releases for +Linux, OS X, and Windows. ## Usage @@ -194,8 +190,44 @@ The following attributes are exported: [4]: https://github.com/ewilde/terraform-provider-runscope/releases [5]: website/source/docs/providers/runscope -## Developing -### Running the integration tests +# Developing + +## Building The Provider + +Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-runscope` + +```sh +$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers +$ git clone git@github.com:terraform-providers/terraform-provider-runscope +``` + +Enter the provider directory and build the provider + +```sh +$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-runscope +$ make build +``` + +## Using the provider + +See [examples](examples/) + +See [runscope providers documentation](https://www.terraform.io/docs/providers/runscope/index.html) + +## Developing the Provider + +If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.9+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`. + +To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory. + +```sh +$ make build +... +$ $GOPATH/bin/terraform-provider-runscope +... +``` + +## Running the integration tests `make TF_ACC=1 RUNSCOPE_TEAM_ID=xxx RUNSCOPE_ACCESS_TOKEN=xxx RUNSCOPE_INTEGRATION_DESC="Slack: #test1 channel, send message on all test runs"` @@ -206,3 +238,15 @@ The following attributes are exported: | RUNSCOPE_TEAM_ID | Runscope [team uuid](https://www.runscope.com/docs/api/teams)| | RUNSCOPE_ACCESS_TOKEN | Runscope [access token](https://www.runscope.com/applications/create) | | RUNSCOPE_INTEGRATION_DESC | Description that matches a pre-existing runscope integration associated with your account | + +## Releasing +Releases are automatically setup to go out from the master branch after a build is made on master with a tag. + +To perform a release simply create a tag: +` git tag -a v0.0.2 -m "Release message"` + +Then push your tag: +`git push origin v0.0.2` + + +That's it, the build will now run and create a new release on [github](https://github.com/form3tech/ewilde/terraform-provider-runscope) : diff --git a/main.go b/main.go index ac460a4..5eb1178 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/ewilde/terraform-provider-runscope/plugin/providers/runscope" + "github.com/ewilde/terraform-provider-runscope/runscope" "github.com/hashicorp/terraform/plugin" ) diff --git a/main_test.go b/main_test.go deleted file mode 100644 index 4e7d1e0..0000000 --- a/main_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package main - -import ( - "testing" - - "github.com/hashicorp/terraform/plugin" -) - -// pluginVersionExpected provides the expected plugin version that this release -// of the plugin is built with. -const pluginVersionExpected = 4 - -// TestPluginVersion tests the plugin API version of the vendored Terraform -// libraries. -func TestPluginVersion(t *testing.T) { - if plugin.Handshake.ProtocolVersion != pluginVersionExpected { - t.Fatalf("Expected vendored plugin version to be %d, got %d", pluginVersionExpected, plugin.Handshake.ProtocolVersion) - } -} diff --git a/plugin/providers/runscope/config.go b/runscope/config.go similarity index 100% rename from plugin/providers/runscope/config.go rename to runscope/config.go diff --git a/plugin/providers/runscope/data_source_runscope_integration.go b/runscope/data_source_runscope_integration.go similarity index 100% rename from plugin/providers/runscope/data_source_runscope_integration.go rename to runscope/data_source_runscope_integration.go diff --git a/plugin/providers/runscope/data_source_runscope_integration_test.go b/runscope/data_source_runscope_integration_test.go similarity index 100% rename from plugin/providers/runscope/data_source_runscope_integration_test.go rename to runscope/data_source_runscope_integration_test.go diff --git a/plugin/providers/runscope/data_source_runscope_integrations.go b/runscope/data_source_runscope_integrations.go similarity index 100% rename from plugin/providers/runscope/data_source_runscope_integrations.go rename to runscope/data_source_runscope_integrations.go diff --git a/plugin/providers/runscope/data_source_runscope_integrations_test.go b/runscope/data_source_runscope_integrations_test.go similarity index 100% rename from plugin/providers/runscope/data_source_runscope_integrations_test.go rename to runscope/data_source_runscope_integrations_test.go diff --git a/plugin/providers/runscope/provider.go b/runscope/provider.go similarity index 100% rename from plugin/providers/runscope/provider.go rename to runscope/provider.go diff --git a/plugin/providers/runscope/provider_test.go b/runscope/provider_test.go similarity index 100% rename from plugin/providers/runscope/provider_test.go rename to runscope/provider_test.go diff --git a/plugin/providers/runscope/resource_runscope_bucket.go b/runscope/resource_runscope_bucket.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_bucket.go rename to runscope/resource_runscope_bucket.go diff --git a/plugin/providers/runscope/resource_runscope_bucket_test.go b/runscope/resource_runscope_bucket_test.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_bucket_test.go rename to runscope/resource_runscope_bucket_test.go diff --git a/plugin/providers/runscope/resource_runscope_environment.go b/runscope/resource_runscope_environment.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_environment.go rename to runscope/resource_runscope_environment.go diff --git a/plugin/providers/runscope/resource_runscope_environment_test.go b/runscope/resource_runscope_environment_test.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_environment_test.go rename to runscope/resource_runscope_environment_test.go diff --git a/plugin/providers/runscope/resource_runscope_schedule.go b/runscope/resource_runscope_schedule.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_schedule.go rename to runscope/resource_runscope_schedule.go diff --git a/plugin/providers/runscope/resource_runscope_schedule_test.go b/runscope/resource_runscope_schedule_test.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_schedule_test.go rename to runscope/resource_runscope_schedule_test.go diff --git a/plugin/providers/runscope/resource_runscope_step.go b/runscope/resource_runscope_step.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_step.go rename to runscope/resource_runscope_step.go diff --git a/plugin/providers/runscope/resource_runscope_step_test.go b/runscope/resource_runscope_step_test.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_step_test.go rename to runscope/resource_runscope_step_test.go diff --git a/plugin/providers/runscope/resource_runscope_step_token.go b/runscope/resource_runscope_step_token.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_step_token.go rename to runscope/resource_runscope_step_token.go diff --git a/plugin/providers/runscope/resource_runscope_step_token_test.go b/runscope/resource_runscope_step_token_test.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_step_token_test.go rename to runscope/resource_runscope_step_token_test.go diff --git a/plugin/providers/runscope/resource_runscope_test_item.go b/runscope/resource_runscope_test_item.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_test_item.go rename to runscope/resource_runscope_test_item.go diff --git a/plugin/providers/runscope/resource_runscope_test_item_test.go b/runscope/resource_runscope_test_item_test.go similarity index 100% rename from plugin/providers/runscope/resource_runscope_test_item_test.go rename to runscope/resource_runscope_test_item_test.go diff --git a/plugin/providers/runscope/schema.go b/runscope/schema.go similarity index 100% rename from plugin/providers/runscope/schema.go rename to runscope/schema.go diff --git a/plugin/providers/runscope/structure.go b/runscope/structure.go similarity index 100% rename from plugin/providers/runscope/structure.go rename to runscope/structure.go diff --git a/plugin/providers/runscope/structure_test.go b/runscope/structure_test.go similarity index 100% rename from plugin/providers/runscope/structure_test.go rename to runscope/structure_test.go diff --git a/scripts/changelog-links.sh b/scripts/changelog-links.sh index 8cd81b4..e9af88a 100755 --- a/scripts/changelog-links.sh +++ b/scripts/changelog-links.sh @@ -24,7 +24,7 @@ else SED="sed -i.bak -r -e" fi -PROVIDER_URL="https:\/\/github.com\/terraform-providers\/terraform-provider-aws\/issues" +PROVIDER_URL="https:\/\/github.com\/terraform-providers\/terraform-provider-runscope\/issues" $SED "s/GH-([0-9]+)/\[#\1\]\($PROVIDER_URL\/\1\)/g" -e 's/\[\[#(.+)([0-9])\)]$/(\[#\1\2))/g' CHANGELOG.md diff --git a/vendor/cloud.google.com/go/LICENSE b/vendor/cloud.google.com/go/LICENSE deleted file mode 100644 index a4c5efd..0000000 --- a/vendor/cloud.google.com/go/LICENSE +++ /dev/null @@ -1,202 +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: - - (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 2014 Google Inc. - - 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/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go deleted file mode 100644 index f9d2bef..0000000 --- a/vendor/cloud.google.com/go/compute/metadata/metadata.go +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright 2014 Google Inc. All Rights Reserved. -// -// 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 metadata provides access to Google Compute Engine (GCE) -// metadata and API service accounts. -// -// This package is a wrapper around the GCE metadata service, -// as documented at https://developers.google.com/compute/docs/metadata. -package metadata // import "cloud.google.com/go/compute/metadata" - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "runtime" - "strings" - "sync" - "time" - - "golang.org/x/net/context" - "golang.org/x/net/context/ctxhttp" - - "cloud.google.com/go/internal" -) - -const ( - // metadataIP is the documented metadata server IP address. - metadataIP = "169.254.169.254" - - // metadataHostEnv is the environment variable specifying the - // GCE metadata hostname. If empty, the default value of - // metadataIP ("169.254.169.254") is used instead. - // This is variable name is not defined by any spec, as far as - // I know; it was made up for the Go package. - metadataHostEnv = "GCE_METADATA_HOST" -) - -type cachedValue struct { - k string - trim bool - mu sync.Mutex - v string -} - -var ( - projID = &cachedValue{k: "project/project-id", trim: true} - projNum = &cachedValue{k: "project/numeric-project-id", trim: true} - instID = &cachedValue{k: "instance/id", trim: true} -) - -var ( - metaClient = &http.Client{ - Transport: &internal.Transport{ - Base: &http.Transport{ - Dial: (&net.Dialer{ - Timeout: 2 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - ResponseHeaderTimeout: 2 * time.Second, - }, - }, - } - subscribeClient = &http.Client{ - Transport: &internal.Transport{ - Base: &http.Transport{ - Dial: (&net.Dialer{ - Timeout: 2 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - }, - }, - } -) - -// NotDefinedError is returned when requested metadata is not defined. -// -// The underlying string is the suffix after "/computeMetadata/v1/". -// -// This error is not returned if the value is defined to be the empty -// string. -type NotDefinedError string - -func (suffix NotDefinedError) Error() string { - return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix)) -} - -// Get returns a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// -// If the GCE_METADATA_HOST environment variable is not defined, a default of -// 169.254.169.254 will be used instead. -// -// If the requested metadata is not defined, the returned error will -// be of type NotDefinedError. -func Get(suffix string) (string, error) { - val, _, err := getETag(metaClient, suffix) - return val, err -} - -// getETag returns a value from the metadata service as well as the associated -// ETag using the provided client. This func is otherwise equivalent to Get. -func getETag(client *http.Client, suffix string) (value, etag string, err error) { - // Using a fixed IP makes it very difficult to spoof the metadata service in - // a container, which is an important use-case for local testing of cloud - // deployments. To enable spoofing of the metadata service, the environment - // variable GCE_METADATA_HOST is first inspected to decide where metadata - // requests shall go. - host := os.Getenv(metadataHostEnv) - if host == "" { - // Using 169.254.169.254 instead of "metadata" here because Go - // binaries built with the "netgo" tag and without cgo won't - // know the search suffix for "metadata" is - // ".google.internal", and this IP address is documented as - // being stable anyway. - host = metadataIP - } - url := "http://" + host + "/computeMetadata/v1/" + suffix - req, _ := http.NewRequest("GET", url, nil) - req.Header.Set("Metadata-Flavor", "Google") - res, err := client.Do(req) - if err != nil { - return "", "", err - } - defer res.Body.Close() - if res.StatusCode == http.StatusNotFound { - return "", "", NotDefinedError(suffix) - } - if res.StatusCode != 200 { - return "", "", fmt.Errorf("status code %d trying to fetch %s", res.StatusCode, url) - } - all, err := ioutil.ReadAll(res.Body) - if err != nil { - return "", "", err - } - return string(all), res.Header.Get("Etag"), nil -} - -func getTrimmed(suffix string) (s string, err error) { - s, err = Get(suffix) - s = strings.TrimSpace(s) - return -} - -func (c *cachedValue) get() (v string, err error) { - defer c.mu.Unlock() - c.mu.Lock() - if c.v != "" { - return c.v, nil - } - if c.trim { - v, err = getTrimmed(c.k) - } else { - v, err = Get(c.k) - } - if err == nil { - c.v = v - } - return -} - -var ( - onGCEOnce sync.Once - onGCE bool -) - -// OnGCE reports whether this process is running on Google Compute Engine. -func OnGCE() bool { - onGCEOnce.Do(initOnGCE) - return onGCE -} - -func initOnGCE() { - onGCE = testOnGCE() -} - -func testOnGCE() bool { - // The user explicitly said they're on GCE, so trust them. - if os.Getenv(metadataHostEnv) != "" { - return true - } - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - resc := make(chan bool, 2) - - // Try two strategies in parallel. - // See https://github.com/GoogleCloudPlatform/google-cloud-go/issues/194 - go func() { - res, err := ctxhttp.Get(ctx, metaClient, "http://"+metadataIP) - if err != nil { - resc <- false - return - } - defer res.Body.Close() - resc <- res.Header.Get("Metadata-Flavor") == "Google" - }() - - go func() { - addrs, err := net.LookupHost("metadata.google.internal") - if err != nil || len(addrs) == 0 { - resc <- false - return - } - resc <- strsContains(addrs, metadataIP) - }() - - tryHarder := systemInfoSuggestsGCE() - if tryHarder { - res := <-resc - if res { - // The first strategy succeeded, so let's use it. - return true - } - // Wait for either the DNS or metadata server probe to - // contradict the other one and say we are running on - // GCE. Give it a lot of time to do so, since the system - // info already suggests we're running on a GCE BIOS. - timer := time.NewTimer(5 * time.Second) - defer timer.Stop() - select { - case res = <-resc: - return res - case <-timer.C: - // Too slow. Who knows what this system is. - return false - } - } - - // There's no hint from the system info that we're running on - // GCE, so use the first probe's result as truth, whether it's - // true or false. The goal here is to optimize for speed for - // users who are NOT running on GCE. We can't assume that - // either a DNS lookup or an HTTP request to a blackholed IP - // address is fast. Worst case this should return when the - // metaClient's Transport.ResponseHeaderTimeout or - // Transport.Dial.Timeout fires (in two seconds). - return <-resc -} - -// systemInfoSuggestsGCE reports whether the local system (without -// doing network requests) suggests that we're running on GCE. If this -// returns true, testOnGCE tries a bit harder to reach its metadata -// server. -func systemInfoSuggestsGCE() bool { - if runtime.GOOS != "linux" { - // We don't have any non-Linux clues available, at least yet. - return false - } - slurp, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name") - name := strings.TrimSpace(string(slurp)) - return name == "Google" || name == "Google Compute Engine" -} - -// Subscribe subscribes to a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// The suffix may contain query parameters. -// -// Subscribe calls fn with the latest metadata value indicated by the provided -// suffix. If the metadata value is deleted, fn is called with the empty string -// and ok false. Subscribe blocks until fn returns a non-nil error or the value -// is deleted. Subscribe returns the error value returned from the last call to -// fn, which may be nil when ok == false. -func Subscribe(suffix string, fn func(v string, ok bool) error) error { - const failedSubscribeSleep = time.Second * 5 - - // First check to see if the metadata value exists at all. - val, lastETag, err := getETag(subscribeClient, suffix) - if err != nil { - return err - } - - if err := fn(val, true); err != nil { - return err - } - - ok := true - if strings.ContainsRune(suffix, '?') { - suffix += "&wait_for_change=true&last_etag=" - } else { - suffix += "?wait_for_change=true&last_etag=" - } - for { - val, etag, err := getETag(subscribeClient, suffix+url.QueryEscape(lastETag)) - if err != nil { - if _, deleted := err.(NotDefinedError); !deleted { - time.Sleep(failedSubscribeSleep) - continue // Retry on other errors. - } - ok = false - } - lastETag = etag - - if err := fn(val, ok); err != nil || !ok { - return err - } - } -} - -// ProjectID returns the current instance's project ID string. -func ProjectID() (string, error) { return projID.get() } - -// NumericProjectID returns the current instance's numeric project ID. -func NumericProjectID() (string, error) { return projNum.get() } - -// InternalIP returns the instance's primary internal IP address. -func InternalIP() (string, error) { - return getTrimmed("instance/network-interfaces/0/ip") -} - -// ExternalIP returns the instance's primary external (public) IP address. -func ExternalIP() (string, error) { - return getTrimmed("instance/network-interfaces/0/access-configs/0/external-ip") -} - -// Hostname returns the instance's hostname. This will be of the form -// ".c..internal". -func Hostname() (string, error) { - return getTrimmed("instance/hostname") -} - -// InstanceTags returns the list of user-defined instance tags, -// assigned when initially creating a GCE instance. -func InstanceTags() ([]string, error) { - var s []string - j, err := Get("instance/tags") - if err != nil { - return nil, err - } - if err := json.NewDecoder(strings.NewReader(j)).Decode(&s); err != nil { - return nil, err - } - return s, nil -} - -// InstanceID returns the current VM's numeric instance ID. -func InstanceID() (string, error) { - return instID.get() -} - -// InstanceName returns the current VM's instance ID string. -func InstanceName() (string, error) { - host, err := Hostname() - if err != nil { - return "", err - } - return strings.Split(host, ".")[0], nil -} - -// Zone returns the current VM's zone, such as "us-central1-b". -func Zone() (string, error) { - zone, err := getTrimmed("instance/zone") - // zone is of the form "projects//zones/". - if err != nil { - return "", err - } - return zone[strings.LastIndex(zone, "/")+1:], nil -} - -// InstanceAttributes returns the list of user-defined attributes, -// assigned when initially creating a GCE VM instance. The value of an -// attribute can be obtained with InstanceAttributeValue. -func InstanceAttributes() ([]string, error) { return lines("instance/attributes/") } - -// ProjectAttributes returns the list of user-defined attributes -// applying to the project as a whole, not just this VM. The value of -// an attribute can be obtained with ProjectAttributeValue. -func ProjectAttributes() ([]string, error) { return lines("project/attributes/") } - -func lines(suffix string) ([]string, error) { - j, err := Get(suffix) - if err != nil { - return nil, err - } - s := strings.Split(strings.TrimSpace(j), "\n") - for i := range s { - s[i] = strings.TrimSpace(s[i]) - } - return s, nil -} - -// InstanceAttributeValue returns the value of the provided VM -// instance attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// InstanceAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func InstanceAttributeValue(attr string) (string, error) { - return Get("instance/attributes/" + attr) -} - -// ProjectAttributeValue returns the value of the provided -// project attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// ProjectAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func ProjectAttributeValue(attr string) (string, error) { - return Get("project/attributes/" + attr) -} - -// Scopes returns the service account scopes for the given account. -// The account may be empty or the string "default" to use the instance's -// main account. -func Scopes(serviceAccount string) ([]string, error) { - if serviceAccount == "" { - serviceAccount = "default" - } - return lines("instance/service-accounts/" + serviceAccount + "/scopes") -} - -func strsContains(ss []string, s string) bool { - for _, v := range ss { - if v == s { - return true - } - } - return false -} diff --git a/vendor/cloud.google.com/go/internal/cloud.go b/vendor/cloud.google.com/go/internal/cloud.go deleted file mode 100644 index 8e0c8f8..0000000 --- a/vendor/cloud.google.com/go/internal/cloud.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2014 Google Inc. All Rights Reserved. -// -// 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 internal provides support for the cloud packages. -// -// Users should not import this package directly. -package internal - -import ( - "fmt" - "net/http" -) - -const userAgent = "gcloud-golang/0.1" - -// Transport is an http.RoundTripper that appends Google Cloud client's -// user-agent to the original request's user-agent header. -type Transport struct { - // TODO(bradfitz): delete internal.Transport. It's too wrappy for what it does. - // Do User-Agent some other way. - - // Base is the actual http.RoundTripper - // requests will use. It must not be nil. - Base http.RoundTripper -} - -// RoundTrip appends a user-agent to the existing user-agent -// header and delegates the request to the base http.RoundTripper. -func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { - req = cloneRequest(req) - ua := req.Header.Get("User-Agent") - if ua == "" { - ua = userAgent - } else { - ua = fmt.Sprintf("%s %s", ua, userAgent) - } - req.Header.Set("User-Agent", ua) - return t.Base.RoundTrip(req) -} - -// cloneRequest returns a clone of the provided *http.Request. -// The clone is a shallow copy of the struct and its Header map. -func cloneRequest(r *http.Request) *http.Request { - // shallow copy of the struct - r2 := new(http.Request) - *r2 = *r - // deep copy of the Header - r2.Header = make(http.Header) - for k, s := range r.Header { - r2.Header[k] = s - } - return r2 -} diff --git a/vendor/cloud.google.com/go/internal/retry.go b/vendor/cloud.google.com/go/internal/retry.go deleted file mode 100644 index 79995be..0000000 --- a/vendor/cloud.google.com/go/internal/retry.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// 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 internal - -import ( - "fmt" - "time" - - gax "github.com/googleapis/gax-go" - - "golang.org/x/net/context" -) - -// Retry calls the supplied function f repeatedly according to the provided -// backoff parameters. It returns when one of the following occurs: -// When f's first return value is true, Retry immediately returns with f's second -// return value. -// When the provided context is done, Retry returns with ctx.Err(). -func Retry(ctx context.Context, bo gax.Backoff, f func() (stop bool, err error)) error { - return retry(ctx, bo, f, gax.Sleep) -} - -func retry(ctx context.Context, bo gax.Backoff, f func() (stop bool, err error), - sleep func(context.Context, time.Duration) error) error { - var lastErr error - for { - stop, err := f() - if stop { - return err - } - // Remember the last "real" error from f. - if err != nil && err != context.Canceled && err != context.DeadlineExceeded { - lastErr = err - } - p := bo.Pause() - if cerr := sleep(ctx, p); cerr != nil { - if lastErr != nil { - return fmt.Errorf("%v; last function err: %v", cerr, lastErr) - } - return cerr - } - } -} diff --git a/vendor/github.com/JamesClonk/vultr/LICENSE b/vendor/github.com/JamesClonk/vultr/LICENSE deleted file mode 100644 index be20a12..0000000 --- a/vendor/github.com/JamesClonk/vultr/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Fabio Berchtold - -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/JamesClonk/vultr/lib/account_info.go b/vendor/github.com/JamesClonk/vultr/lib/account_info.go deleted file mode 100644 index 8568461..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/account_info.go +++ /dev/null @@ -1,59 +0,0 @@ -package lib - -import ( - "encoding/json" - "fmt" - "strconv" -) - -// AccountInfo of Vultr account -type AccountInfo struct { - Balance float64 `json:"balance"` - PendingCharges float64 `json:"pending_charges"` - LastPaymentDate string `json:"last_payment_date"` - LastPaymentAmount float64 `json:"last_payment_amount"` -} - -// GetAccountInfo retrieves the Vultr account information about current balance, pending charges, etc.. -func (c *Client) GetAccountInfo() (info AccountInfo, err error) { - if err := c.get(`account/info`, &info); err != nil { - return AccountInfo{}, err - } - return -} - -// UnmarshalJSON implements json.Unmarshaller on AccountInfo. -// This is needed because the Vultr API is inconsistent in it's JSON responses for account info. -// Some fields can change type, from JSON number to JSON string and vice-versa. -func (a *AccountInfo) UnmarshalJSON(data []byte) (err error) { - if a == nil { - *a = AccountInfo{} - } - - var fields map[string]interface{} - if err := json.Unmarshal(data, &fields); err != nil { - return err - } - - b, err := strconv.ParseFloat(fmt.Sprintf("%v", fields["balance"]), 64) - if err != nil { - return err - } - a.Balance = b - - pc, err := strconv.ParseFloat(fmt.Sprintf("%v", fields["pending_charges"]), 64) - if err != nil { - return err - } - a.PendingCharges = pc - - lpa, err := strconv.ParseFloat(fmt.Sprintf("%v", fields["last_payment_amount"]), 64) - if err != nil { - return err - } - a.LastPaymentAmount = lpa - - a.LastPaymentDate = fmt.Sprintf("%v", fields["last_payment_date"]) - - return -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/block_storage.go b/vendor/github.com/JamesClonk/vultr/lib/block_storage.go deleted file mode 100644 index 58d4c37..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/block_storage.go +++ /dev/null @@ -1,188 +0,0 @@ -package lib - -import ( - "encoding/json" - "fmt" - "net/url" - "strconv" -) - -// BlockStorage on Vultr account -type BlockStorage struct { - ID string `json:"SUBID,string"` - Name string `json:"label"` - RegionID int `json:"DCID,string"` - SizeGB int `json:"size_gb,string"` - Created string `json:"date_created"` - Cost string `json:"cost_per_month"` - Status string `json:"status"` - AttachedTo string `json:"attached_to_SUBID"` -} - -// UnmarshalJSON implements json.Unmarshaller on BlockStorage. -// This is needed because the Vultr API is inconsistent in it's JSON responses. -// Some fields can change type, from JSON number to JSON string and vice-versa. -func (b *BlockStorage) UnmarshalJSON(data []byte) (err error) { - if b == nil { - *b = BlockStorage{} - } - - var fields map[string]interface{} - if err := json.Unmarshal(data, &fields); err != nil { - return err - } - - value := fmt.Sprintf("%v", fields["SUBID"]) - if len(value) == 0 || value == "" || value == "0" { - b.ID = "" - } else { - id, err := strconv.ParseFloat(value, 64) - if err != nil { - return err - } - b.ID = strconv.FormatFloat(id, 'f', -1, 64) - } - - value = fmt.Sprintf("%v", fields["DCID"]) - if len(value) == 0 || value == "" { - value = "0" - } - region, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - b.RegionID = int(region) - - value = fmt.Sprintf("%v", fields["size_gb"]) - if len(value) == 0 || value == "" { - value = "0" - } - size, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - b.SizeGB = int(size) - - value = fmt.Sprintf("%v", fields["attached_to_SUBID"]) - if len(value) == 0 || value == "" || value == "0" { - b.AttachedTo = "" - } else { - attached, err := strconv.ParseFloat(value, 64) - if err != nil { - return err - } - b.AttachedTo = strconv.FormatFloat(attached, 'f', -1, 64) - } - - b.Name = fmt.Sprintf("%v", fields["label"]) - b.Created = fmt.Sprintf("%v", fields["date_created"]) - b.Status = fmt.Sprintf("%v", fields["status"]) - b.Cost = fmt.Sprintf("%v", fields["cost_per_month"]) - - return -} - -// GetBlockStorages returns a list of all active block storages on Vultr account -func (c *Client) GetBlockStorages() (storages []BlockStorage, err error) { - if err := c.get(`block/list`, &storages); err != nil { - return nil, err - } - return storages, nil -} - -// GetBlockStorage returns block storage with given ID -func (c *Client) GetBlockStorage(id string) (BlockStorage, error) { - storages, err := c.GetBlockStorages() - if err != nil { - return BlockStorage{}, err - } - - for _, s := range storages { - if s.ID == id { - return s, nil - } - } - return BlockStorage{}, fmt.Errorf("BlockStorage with ID %v not found", id) -} - -// CreateBlockStorage creates a new block storage on Vultr account -func (c *Client) CreateBlockStorage(name string, regionID, size int) (BlockStorage, error) { - values := url.Values{ - "label": {name}, - "DCID": {fmt.Sprintf("%v", regionID)}, - "size_gb": {fmt.Sprintf("%v", size)}, - } - - var storage BlockStorage - if err := c.post(`block/create`, values, &storage); err != nil { - return BlockStorage{}, err - } - storage.RegionID = regionID - storage.Name = name - storage.SizeGB = size - - return storage, nil -} - -// ResizeBlockStorage resizes an existing block storage -func (c *Client) ResizeBlockStorage(id string, size int) error { - values := url.Values{ - "SUBID": {id}, - "size_gb": {fmt.Sprintf("%v", size)}, - } - - if err := c.post(`block/resize`, values, nil); err != nil { - return err - } - return nil -} - -// LabelBlockStorage changes the label on an existing block storage -func (c *Client) LabelBlockStorage(id, name string) error { - values := url.Values{ - "SUBID": {id}, - "label": {name}, - } - - if err := c.post(`block/label_set`, values, nil); err != nil { - return err - } - return nil -} - -// AttachBlockStorage attaches block storage to an existing virtual machine -func (c *Client) AttachBlockStorage(id, serverID string) error { - values := url.Values{ - "SUBID": {id}, - "attach_to_SUBID": {serverID}, - } - - if err := c.post(`block/attach`, values, nil); err != nil { - return err - } - return nil -} - -// DetachBlockStorage detaches block storage from virtual machine -func (c *Client) DetachBlockStorage(id string) error { - values := url.Values{ - "SUBID": {id}, - } - - if err := c.post(`block/detach`, values, nil); err != nil { - return err - } - return nil -} - -// DeleteBlockStorage deletes an existing block storage -func (c *Client) DeleteBlockStorage(id string) error { - values := url.Values{ - "SUBID": {id}, - } - - if err := c.post(`block/delete`, values, nil); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/client.go b/vendor/github.com/JamesClonk/vultr/lib/client.go deleted file mode 100644 index 7e2364b..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/client.go +++ /dev/null @@ -1,231 +0,0 @@ -package lib - -import ( - "crypto/tls" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "math/rand" - "net/http" - "net/url" - "strings" - "time" - - "github.com/juju/ratelimit" -) - -const ( - // Version of this libary - Version = "1.12.0" - - // APIVersion of Vultr - APIVersion = "v1" - - // DefaultEndpoint to be used - DefaultEndpoint = "https://api.vultr.com/" - - mediaType = "application/json" -) - -// retryableStatusCodes are API response status codes that indicate that -// the failed request can be retried without further actions. -var retryableStatusCodes = map[int]struct{}{ - 503: {}, // Rate limit hit - 500: {}, // Internal server error. Try again at a later time. -} - -// Client represents the Vultr API client -type Client struct { - // HTTP client for communication with the Vultr API - client *http.Client - - // User agent for HTTP client - UserAgent string - - // Endpoint URL for API requests - Endpoint *url.URL - - // API key for accessing the Vultr API - APIKey string - - // Max. number of request attempts - MaxAttempts int - - // Throttling struct - bucket *ratelimit.Bucket -} - -// Options represents optional settings and flags that can be passed to NewClient -type Options struct { - // HTTP client for communication with the Vultr API - HTTPClient *http.Client - - // User agent for HTTP client - UserAgent string - - // Endpoint URL for API requests - Endpoint string - - // API rate limitation, calls per duration - RateLimitation time.Duration - - // Max. number of times to retry API calls - MaxRetries int -} - -// NewClient creates new Vultr API client. Options are optional and can be nil. -func NewClient(apiKey string, options *Options) *Client { - userAgent := "vultr-go/" + Version - transport := &http.Transport{ - TLSNextProto: make(map[string]func(string, *tls.Conn) http.RoundTripper), - } - client := http.DefaultClient - client.Transport = transport - endpoint, _ := url.Parse(DefaultEndpoint) - rate := 505 * time.Millisecond - attempts := 1 - - if options != nil { - if options.HTTPClient != nil { - client = options.HTTPClient - } - if options.UserAgent != "" { - userAgent = options.UserAgent - } - if options.Endpoint != "" { - endpoint, _ = url.Parse(options.Endpoint) - } - if options.RateLimitation != 0 { - rate = options.RateLimitation - } - if options.MaxRetries != 0 { - attempts = options.MaxRetries + 1 - } - } - - return &Client{ - UserAgent: userAgent, - client: client, - Endpoint: endpoint, - APIKey: apiKey, - MaxAttempts: attempts, - bucket: ratelimit.NewBucket(rate, 1), - } -} - -func apiPath(path string) string { - return fmt.Sprintf("/%s/%s", APIVersion, path) -} - -func apiKeyPath(path, apiKey string) string { - if strings.Contains(path, "?") { - return path + "&api_key=" + apiKey - } - return path + "?api_key=" + apiKey -} - -func (c *Client) get(path string, data interface{}) error { - req, err := c.newRequest("GET", apiPath(path), nil) - if err != nil { - return err - } - return c.do(req, data) -} - -func (c *Client) post(path string, values url.Values, data interface{}) error { - req, err := c.newRequest("POST", apiPath(path), strings.NewReader(values.Encode())) - if err != nil { - return err - } - return c.do(req, data) -} - -func (c *Client) newRequest(method string, path string, body io.Reader) (*http.Request, error) { - relPath, err := url.Parse(apiKeyPath(path, c.APIKey)) - if err != nil { - return nil, err - } - - url := c.Endpoint.ResolveReference(relPath) - - req, err := http.NewRequest(method, url.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("User-Agent", c.UserAgent) - req.Header.Add("Accept", mediaType) - - if req.Method == "POST" { - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - } - return req, nil -} - -func (c *Client) do(req *http.Request, data interface{}) error { - // Throttle http requests to avoid hitting Vultr's API rate-limit - c.bucket.Wait(1) - - var apiError error - for tryCount := 1; tryCount <= c.MaxAttempts; tryCount++ { - resp, err := c.client.Do(req) - if err != nil { - return err - } - - body, err := ioutil.ReadAll(resp.Body) - resp.Body.Close() - if err != nil { - return err - } - - if resp.StatusCode == http.StatusOK { - if data != nil { - // avoid unmarshalling problem because Vultr API returns - // empty array instead of empty map when it shouldn't! - if string(body) == `[]` { - data = nil - } else { - if err := json.Unmarshal(body, data); err != nil { - return err - } - } - } - return nil - } - - apiError = errors.New(string(body)) - if !isCodeRetryable(resp.StatusCode) { - break - } - - delay := backoffDuration(tryCount) - time.Sleep(delay) - } - - return apiError -} - -// backoffDuration returns the duration to wait before retrying the request. -// Duration is an exponential function of the retry count with a jitter of ~0-30%. -func backoffDuration(retryCount int) time.Duration { - // Upper limit of delay at ~1 minute - if retryCount > 7 { - retryCount = 7 - } - - rand.Seed(time.Now().UnixNano()) - delay := (1 << uint(retryCount)) * (rand.Intn(150) + 500) - return time.Duration(delay) * time.Millisecond -} - -// isCodeRetryable returns true if the given status code means that we should retry. -func isCodeRetryable(statusCode int) bool { - if _, ok := retryableStatusCodes[statusCode]; ok { - return true - } - - return false -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/dns.go b/vendor/github.com/JamesClonk/vultr/lib/dns.go deleted file mode 100644 index beb68c1..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/dns.go +++ /dev/null @@ -1,119 +0,0 @@ -package lib - -import ( - "fmt" - "net/url" -) - -// DNSDomain represents a DNS domain on Vultr -type DNSDomain struct { - Domain string `json:"domain"` - Created string `json:"date_created"` -} - -// DNSRecord represents a DNS record on Vultr -type DNSRecord struct { - RecordID int `json:"RECORDID"` - Type string `json:"type"` - Name string `json:"name"` - Data string `json:"data"` - Priority int `json:"priority"` - TTL int `json:"ttl"` -} - -// GetDNSDomains returns a list of available domains on Vultr account -func (c *Client) GetDNSDomains() (dnsdomains []DNSDomain, err error) { - if err := c.get(`dns/list`, &dnsdomains); err != nil { - return nil, err - } - return dnsdomains, nil -} - -// GetDNSRecords returns a list of all DNS records of a particular domain -func (c *Client) GetDNSRecords(domain string) (dnsrecords []DNSRecord, err error) { - if err := c.get(`dns/records?domain=`+domain, &dnsrecords); err != nil { - return nil, err - } - return dnsrecords, nil -} - -// CreateDNSDomain creates a new DNS domain name on Vultr -func (c *Client) CreateDNSDomain(domain, serverIP string) error { - values := url.Values{ - "domain": {domain}, - "serverIP": {serverIP}, - } - - if err := c.post(`dns/create_domain`, values, nil); err != nil { - return err - } - return nil -} - -// DeleteDNSDomain deletes an existing DNS domain name -func (c *Client) DeleteDNSDomain(domain string) error { - values := url.Values{ - "domain": {domain}, - } - - if err := c.post(`dns/delete_domain`, values, nil); err != nil { - return err - } - return nil -} - -// CreateDNSRecord creates a new DNS record -func (c *Client) CreateDNSRecord(domain, name, rtype, data string, priority, ttl int) error { - values := url.Values{ - "domain": {domain}, - "name": {name}, - "type": {rtype}, - "data": {data}, - "priority": {fmt.Sprintf("%v", priority)}, - "ttl": {fmt.Sprintf("%v", ttl)}, - } - - if err := c.post(`dns/create_record`, values, nil); err != nil { - return err - } - return nil -} - -// UpdateDNSRecord updates an existing DNS record -func (c *Client) UpdateDNSRecord(domain string, dnsrecord DNSRecord) error { - values := url.Values{ - "domain": {domain}, - "RECORDID": {fmt.Sprintf("%v", dnsrecord.RecordID)}, - } - - if dnsrecord.Name != "" { - values.Add("name", dnsrecord.Name) - } - if dnsrecord.Data != "" { - values.Add("data", dnsrecord.Data) - } - if dnsrecord.Priority != 0 { - values.Add("priority", fmt.Sprintf("%v", dnsrecord.Priority)) - } - if dnsrecord.TTL != 0 { - values.Add("ttl", fmt.Sprintf("%v", dnsrecord.TTL)) - } - - if err := c.post(`dns/update_record`, values, nil); err != nil { - return err - } - return nil -} - -// DeleteDNSRecord deletes an existing DNS record -func (c *Client) DeleteDNSRecord(domain string, recordID int) error { - values := url.Values{ - "domain": {domain}, - "RECORDID": {fmt.Sprintf("%v", recordID)}, - } - - if err := c.post(`dns/delete_record`, values, nil); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/ip.go b/vendor/github.com/JamesClonk/vultr/lib/ip.go deleted file mode 100644 index 26d0787..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/ip.go +++ /dev/null @@ -1,125 +0,0 @@ -package lib - -import "net/url" - -// IPv4 information of a virtual machine -type IPv4 struct { - IP string `json:"ip"` - Netmask string `json:"netmask"` - Gateway string `json:"gateway"` - Type string `json:"type"` - ReverseDNS string `json:"reverse"` -} - -// IPv6 information of a virtual machine -type IPv6 struct { - IP string `json:"ip"` - Network string `json:"network"` - NetworkSize string `json:"network_size"` - Type string `json:"type"` -} - -// ReverseDNSIPv6 information of a virtual machine -type ReverseDNSIPv6 struct { - IP string `json:"ip"` - ReverseDNS string `json:"reverse"` -} - -// ListIPv4 lists the IPv4 information of a virtual machine -func (c *Client) ListIPv4(id string) (list []IPv4, err error) { - var ipMap map[string][]IPv4 - if err := c.get(`server/list_ipv4?SUBID=`+id, &ipMap); err != nil { - return nil, err - } - - for _, iplist := range ipMap { - for _, ip := range iplist { - list = append(list, ip) - } - } - return list, nil -} - -// ListIPv6 lists the IPv4 information of a virtual machine -func (c *Client) ListIPv6(id string) (list []IPv6, err error) { - var ipMap map[string][]IPv6 - if err := c.get(`server/list_ipv6?SUBID=`+id, &ipMap); err != nil { - return nil, err - } - - for _, iplist := range ipMap { - for _, ip := range iplist { - list = append(list, ip) - } - } - return list, nil -} - -// ListIPv6ReverseDNS lists the IPv6 reverse DNS entries of a virtual machine -func (c *Client) ListIPv6ReverseDNS(id string) (list []ReverseDNSIPv6, err error) { - var ipMap map[string][]ReverseDNSIPv6 - if err := c.get(`server/reverse_list_ipv6?SUBID=`+id, &ipMap); err != nil { - return nil, err - } - - for _, iplist := range ipMap { - for _, ip := range iplist { - list = append(list, ip) - } - } - return list, nil -} - -// DeleteIPv6ReverseDNS removes a reverse DNS entry for an IPv6 address of a virtual machine -func (c *Client) DeleteIPv6ReverseDNS(id string, ip string) error { - values := url.Values{ - "SUBID": {id}, - "ip": {ip}, - } - - if err := c.post(`server/reverse_delete_ipv6`, values, nil); err != nil { - return err - } - return nil -} - -// SetIPv6ReverseDNS sets a reverse DNS entry for an IPv6 address of a virtual machine -func (c *Client) SetIPv6ReverseDNS(id, ip, entry string) error { - values := url.Values{ - "SUBID": {id}, - "ip": {ip}, - "entry": {entry}, - } - - if err := c.post(`server/reverse_set_ipv6`, values, nil); err != nil { - return err - } - return nil -} - -// DefaultIPv4ReverseDNS sets a reverse DNS entry for an IPv4 address of a virtual machine to the original setting -func (c *Client) DefaultIPv4ReverseDNS(id, ip string) error { - values := url.Values{ - "SUBID": {id}, - "ip": {ip}, - } - - if err := c.post(`server/reverse_default_ipv4`, values, nil); err != nil { - return err - } - return nil -} - -// SetIPv4ReverseDNS sets a reverse DNS entry for an IPv4 address of a virtual machine -func (c *Client) SetIPv4ReverseDNS(id, ip, entry string) error { - values := url.Values{ - "SUBID": {id}, - "ip": {ip}, - "entry": {entry}, - } - - if err := c.post(`server/reverse_set_ipv4`, values, nil); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/iso.go b/vendor/github.com/JamesClonk/vultr/lib/iso.go deleted file mode 100644 index a975577..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/iso.go +++ /dev/null @@ -1,24 +0,0 @@ -package lib - -// ISO image on Vultr -type ISO struct { - ID int `json:"ISOID"` - Created string `json:"date_created"` - Filename string `json:"filename"` - Size int `json:"size"` - MD5sum string `json:"md5sum"` -} - -// GetISO returns a list of all ISO images on Vultr account -func (c *Client) GetISO() ([]ISO, error) { - var isoMap map[string]ISO - if err := c.get(`iso/list`, &isoMap); err != nil { - return nil, err - } - - var isoList []ISO - for _, iso := range isoMap { - isoList = append(isoList, iso) - } - return isoList, nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/os.go b/vendor/github.com/JamesClonk/vultr/lib/os.go deleted file mode 100644 index f8a93a4..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/os.go +++ /dev/null @@ -1,25 +0,0 @@ -package lib - -// OS image on Vultr -type OS struct { - ID int `json:"OSID"` - Name string `json:"name"` - Arch string `json:"arch"` - Family string `json:"family"` - Windows bool `json:"windows"` - Surcharge string `json:"surcharge"` -} - -// GetOS returns a list of all available operating systems on Vultr -func (c *Client) GetOS() ([]OS, error) { - var osMap map[string]OS - if err := c.get(`os/list`, &osMap); err != nil { - return nil, err - } - - var osList []OS - for _, os := range osMap { - osList = append(osList, os) - } - return osList, nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/plans.go b/vendor/github.com/JamesClonk/vultr/lib/plans.go deleted file mode 100644 index 4e6f7eb..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/plans.go +++ /dev/null @@ -1,37 +0,0 @@ -package lib - -import "fmt" - -// Plan on Vultr -type Plan struct { - ID int `json:"VPSPLANID,string"` - Name string `json:"name"` - VCpus int `json:"vcpu_count,string"` - RAM string `json:"ram"` - Disk string `json:"disk"` - Bandwidth string `json:"bandwidth"` - Price string `json:"price_per_month"` - Regions []int `json:"available_locations"` -} - -// GetPlans returns a list of all available plans on Vultr account -func (c *Client) GetPlans() ([]Plan, error) { - var planMap map[string]Plan - if err := c.get(`plans/list`, &planMap); err != nil { - return nil, err - } - - var planList []Plan - for _, plan := range planMap { - planList = append(planList, plan) - } - return planList, nil -} - -// GetAvailablePlansForRegion returns available plans for specified region -func (c *Client) GetAvailablePlansForRegion(id int) (planIDs []int, err error) { - if err := c.get(fmt.Sprintf(`regions/availability?DCID=%v`, id), &planIDs); err != nil { - return nil, err - } - return -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/regions.go b/vendor/github.com/JamesClonk/vultr/lib/regions.go deleted file mode 100644 index 0e4ed8e..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/regions.go +++ /dev/null @@ -1,27 +0,0 @@ -package lib - -// Region on Vultr -type Region struct { - ID int `json:"DCID,string"` - Name string `json:"name"` - Country string `json:"country"` - Continent string `json:"continent"` - State string `json:"state"` - Ddos bool `json:"ddos_protection"` - BlockStorage bool `json:"block_storage"` - Code string `json:"regioncode"` -} - -// GetRegions returns a list of all available Vultr regions -func (c *Client) GetRegions() ([]Region, error) { - var regionMap map[string]Region - if err := c.get(`regions/list`, ®ionMap); err != nil { - return nil, err - } - - var regionList []Region - for _, os := range regionMap { - regionList = append(regionList, os) - } - return regionList, nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/reservedip.go b/vendor/github.com/JamesClonk/vultr/lib/reservedip.go deleted file mode 100644 index 7132375..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/reservedip.go +++ /dev/null @@ -1,170 +0,0 @@ -package lib - -import ( - "encoding/json" - "fmt" - "net/url" - "strconv" -) - -// IP on Vultr -type IP struct { - ID string `json:"SUBID,string"` - RegionID int `json:"DCID,string"` - IPType string `json:"ip_type"` - Subnet string `json:"subnet"` - SubnetSize int `json:"subnet_size"` - Label string `json:"label"` - AttachedTo string `json:"attached_SUBID,string"` -} - -// UnmarshalJSON implements json.Unmarshaller on IP. -// This is needed because the Vultr API is inconsistent in it's JSON responses. -// Some fields can change type, from JSON number to JSON string and vice-versa. -func (i *IP) UnmarshalJSON(data []byte) (err error) { - if i == nil { - *i = IP{} - } - - var fields map[string]interface{} - if err := json.Unmarshal(data, &fields); err != nil { - return err - } - - value := fmt.Sprintf("%v", fields["SUBID"]) - if len(value) == 0 || value == "" || value == "0" { - i.ID = "" - } else { - id, err := strconv.ParseFloat(value, 64) - if err != nil { - return err - } - i.ID = strconv.FormatFloat(id, 'f', -1, 64) - } - - value = fmt.Sprintf("%v", fields["DCID"]) - if len(value) == 0 || value == "" { - value = "0" - } - region, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - i.RegionID = int(region) - - value = fmt.Sprintf("%v", fields["attached_SUBID"]) - if len(value) == 0 || value == "" || value == "0" || value == "false" { - i.AttachedTo = "" - } else { - attached, err := strconv.ParseFloat(value, 64) - if err != nil { - return err - } - i.AttachedTo = strconv.FormatFloat(attached, 'f', -1, 64) - } - - value = fmt.Sprintf("%v", fields["subnet_size"]) - if len(value) == 0 || value == "" { - value = "0" - } - size, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - i.SubnetSize = int(size) - - i.IPType = fmt.Sprintf("%v", fields["ip_type"]) - i.Subnet = fmt.Sprintf("%v", fields["subnet"]) - i.Label = fmt.Sprintf("%v", fields["label"]) - - return -} - -// ListReservedIP returns a list of all available reserved IPs on Vultr account -func (c *Client) ListReservedIP() ([]IP, error) { - var ipMap map[string]IP - - err := c.get(`reservedip/list`, &ipMap) - if err != nil { - return nil, err - } - - ips := make([]IP, 0) - for _, ip := range ipMap { - ips = append(ips, ip) - } - return ips, nil -} - -// GetReservedIP returns reserved IP with given ID -func (c *Client) GetReservedIP(id string) (IP, error) { - var ipMap map[string]IP - - err := c.get(`reservedip/list`, &ipMap) - if err != nil { - return IP{}, err - } - if ip, ok := ipMap[id]; ok { - return ip, nil - } - return IP{}, fmt.Errorf("IP with ID %v not found", id) -} - -// CreateReservedIP creates a new reserved IP on Vultr account -func (c *Client) CreateReservedIP(regionID int, ipType string, label string) (string, error) { - values := url.Values{ - "DCID": {fmt.Sprintf("%v", regionID)}, - "ip_type": {ipType}, - } - if len(label) > 0 { - values.Add("label", label) - } - - result := IP{} - err := c.post(`reservedip/create`, values, &result) - if err != nil { - return "", err - } - return result.ID, nil -} - -// DestroyReservedIP deletes an existing reserved IP -func (c *Client) DestroyReservedIP(id string) error { - values := url.Values{ - "SUBID": {id}, - } - return c.post(`reservedip/destroy`, values, nil) -} - -// AttachReservedIP attaches a reserved IP to a virtual machine -func (c *Client) AttachReservedIP(ip string, serverID string) error { - values := url.Values{ - "ip_address": {ip}, - "attach_SUBID": {serverID}, - } - return c.post(`reservedip/attach`, values, nil) -} - -// DetachReservedIP detaches a reserved IP from an existing virtual machine -func (c *Client) DetachReservedIP(serverID string, ip string) error { - values := url.Values{ - "ip_address": {ip}, - "detach_SUBID": {serverID}, - } - return c.post(`reservedip/detach`, values, nil) -} - -// ConvertReservedIP converts an existing virtual machines IP to a reserved IP -func (c *Client) ConvertReservedIP(serverID string, ip string) (string, error) { - values := url.Values{ - "SUBID": {serverID}, - "ip_address": {ip}, - } - - result := IP{} - err := c.post(`reservedip/convert`, values, &result) - if err != nil { - return "", err - } - return result.ID, err -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/scripts.go b/vendor/github.com/JamesClonk/vultr/lib/scripts.go deleted file mode 100644 index 24c89fb..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/scripts.go +++ /dev/null @@ -1,115 +0,0 @@ -package lib - -import ( - "encoding/json" - "fmt" - "net/url" -) - -// StartupScript on Vultr account -type StartupScript struct { - ID string `json:"SCRIPTID"` - Name string `json:"name"` - Type string `json:"type"` - Content string `json:"script"` -} - -// UnmarshalJSON implements json.Unmarshaller on StartupScript. -// Necessary because the SCRIPTID field has inconsistent types. -func (s *StartupScript) UnmarshalJSON(data []byte) (err error) { - if s == nil { - *s = StartupScript{} - } - - var fields map[string]interface{} - if err := json.Unmarshal(data, &fields); err != nil { - return err - } - - s.ID = fmt.Sprintf("%v", fields["SCRIPTID"]) - s.Name = fmt.Sprintf("%v", fields["name"]) - s.Type = fmt.Sprintf("%v", fields["type"]) - s.Content = fmt.Sprintf("%v", fields["script"]) - - return -} - -// GetStartupScripts returns a list of all startup scripts on the current Vultr account -func (c *Client) GetStartupScripts() (scripts []StartupScript, err error) { - var scriptMap map[string]StartupScript - if err := c.get(`startupscript/list`, &scriptMap); err != nil { - return nil, err - } - - for _, script := range scriptMap { - if script.Type == "" { - script.Type = "boot" // set default script type - } - scripts = append(scripts, script) - } - return scripts, nil -} - -// GetStartupScript returns the startup script with the given ID -func (c *Client) GetStartupScript(id string) (StartupScript, error) { - scripts, err := c.GetStartupScripts() - if err != nil { - return StartupScript{}, err - } - - for _, s := range scripts { - if s.ID == id { - return s, nil - } - } - return StartupScript{}, nil -} - -// CreateStartupScript creates a new startup script -func (c *Client) CreateStartupScript(name, content, scriptType string) (StartupScript, error) { - values := url.Values{ - "name": {name}, - "script": {content}, - "type": {scriptType}, - } - - var script StartupScript - if err := c.post(`startupscript/create`, values, &script); err != nil { - return StartupScript{}, err - } - script.Name = name - script.Content = content - script.Type = scriptType - - return script, nil -} - -// UpdateStartupScript updates an existing startup script -func (c *Client) UpdateStartupScript(script StartupScript) error { - values := url.Values{ - "SCRIPTID": {script.ID}, - } - if script.Name != "" { - values.Add("name", script.Name) - } - if script.Content != "" { - values.Add("script", script.Content) - } - - if err := c.post(`startupscript/update`, values, nil); err != nil { - return err - } - return nil -} - -// DeleteStartupScript deletes an existing startup script from Vultr account -func (c *Client) DeleteStartupScript(id string) error { - values := url.Values{ - "SCRIPTID": {id}, - } - - if err := c.post(`startupscript/destroy`, values, nil); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/servers.go b/vendor/github.com/JamesClonk/vultr/lib/servers.go deleted file mode 100644 index 9d1e5d3..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/servers.go +++ /dev/null @@ -1,448 +0,0 @@ -package lib - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "net/url" - "strconv" -) - -// Server (virtual machine) on Vultr account -type Server struct { - ID string `json:"SUBID"` - Name string `json:"label"` - OS string `json:"os"` - RAM string `json:"ram"` - Disk string `json:"disk"` - MainIP string `json:"main_ip"` - VCpus int `json:"vcpu_count,string"` - Location string `json:"location"` - RegionID int `json:"DCID,string"` - DefaultPassword string `json:"default_password"` - Created string `json:"date_created"` - PendingCharges float64 `json:"pending_charges"` - Status string `json:"status"` - Cost string `json:"cost_per_month"` - CurrentBandwidth float64 `json:"current_bandwidth_gb"` - AllowedBandwidth float64 `json:"allowed_bandwidth_gb,string"` - NetmaskV4 string `json:"netmask_v4"` - GatewayV4 string `json:"gateway_v4"` - PowerStatus string `json:"power_status"` - ServerState string `json:"server_state"` - PlanID int `json:"VPSPLANID,string"` - V6Networks []V6Network `json:"v6_networks"` - InternalIP string `json:"internal_ip"` - KVMUrl string `json:"kvm_url"` - AutoBackups string `json:"auto_backups"` - Tag string `json:"tag"` -} - -// ServerOptions are optional parameters to be used during server creation -type ServerOptions struct { - IPXEChainURL string - ISO int - Script int - UserData string - Snapshot string - SSHKey string - IPV6 bool - PrivateNetworking bool - AutoBackups bool - DontNotifyOnActivate bool - Hostname string - Tag string -} - -// V6Network represents a IPv6 network of a Vultr server -type V6Network struct { - Network string `json:"v6_network"` - MainIP string `json:"v6_main_ip"` - NetworkSize string `json:"v6_network_size"` -} - -// ISOStatus represents an ISO image attached to a Vultr server -type ISOStatus struct { - State string `json:"state"` - ISOID string `json:"ISOID"` -} - -// UnmarshalJSON implements json.Unmarshaller on Server. -// This is needed because the Vultr API is inconsistent in it's JSON responses for servers. -// Some fields can change type, from JSON number to JSON string and vice-versa. -func (s *Server) UnmarshalJSON(data []byte) (err error) { - if s == nil { - *s = Server{} - } - - var fields map[string]interface{} - if err := json.Unmarshal(data, &fields); err != nil { - return err - } - - value := fmt.Sprintf("%v", fields["vcpu_count"]) - if len(value) == 0 || value == "" { - value = "0" - } - vcpu, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - s.VCpus = int(vcpu) - - value = fmt.Sprintf("%v", fields["DCID"]) - if len(value) == 0 || value == "" { - value = "0" - } - region, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - s.RegionID = int(region) - - value = fmt.Sprintf("%v", fields["VPSPLANID"]) - if len(value) == 0 || value == "" { - value = "0" - } - plan, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - s.PlanID = int(plan) - - value = fmt.Sprintf("%v", fields["pending_charges"]) - if len(value) == 0 || value == "" { - value = "0" - } - pc, err := strconv.ParseFloat(value, 64) - if err != nil { - return err - } - s.PendingCharges = pc - - value = fmt.Sprintf("%v", fields["current_bandwidth_gb"]) - if len(value) == 0 || value == "" { - value = "0" - } - cb, err := strconv.ParseFloat(value, 64) - if err != nil { - return err - } - s.CurrentBandwidth = cb - - value = fmt.Sprintf("%v", fields["allowed_bandwidth_gb"]) - if len(value) == 0 || value == "" { - value = "0" - } - ab, err := strconv.ParseFloat(value, 64) - if err != nil { - return err - } - s.AllowedBandwidth = ab - - s.ID = fmt.Sprintf("%v", fields["SUBID"]) - s.Name = fmt.Sprintf("%v", fields["label"]) - s.OS = fmt.Sprintf("%v", fields["os"]) - s.RAM = fmt.Sprintf("%v", fields["ram"]) - s.Disk = fmt.Sprintf("%v", fields["disk"]) - s.MainIP = fmt.Sprintf("%v", fields["main_ip"]) - s.Location = fmt.Sprintf("%v", fields["location"]) - s.DefaultPassword = fmt.Sprintf("%v", fields["default_password"]) - s.Created = fmt.Sprintf("%v", fields["date_created"]) - s.Status = fmt.Sprintf("%v", fields["status"]) - s.Cost = fmt.Sprintf("%v", fields["cost_per_month"]) - s.NetmaskV4 = fmt.Sprintf("%v", fields["netmask_v4"]) - s.GatewayV4 = fmt.Sprintf("%v", fields["gateway_v4"]) - s.PowerStatus = fmt.Sprintf("%v", fields["power_status"]) - s.ServerState = fmt.Sprintf("%v", fields["server_state"]) - - v6networks := make([]V6Network, 0) - if networks, ok := fields["v6_networks"].([]interface{}); ok { - for _, network := range networks { - if network, ok := network.(map[string]interface{}); ok { - v6network := V6Network{ - Network: fmt.Sprintf("%v", network["v6_network"]), - MainIP: fmt.Sprintf("%v", network["v6_main_ip"]), - NetworkSize: fmt.Sprintf("%v", network["v6_network_size"]), - } - v6networks = append(v6networks, v6network) - } - } - s.V6Networks = v6networks - } - - s.InternalIP = fmt.Sprintf("%v", fields["internal_ip"]) - s.KVMUrl = fmt.Sprintf("%v", fields["kvm_url"]) - s.AutoBackups = fmt.Sprintf("%v", fields["auto_backups"]) - s.Tag = fmt.Sprintf("%v", fields["tag"]) - - return -} - -// GetServers returns a list of current virtual machines on Vultr account -func (c *Client) GetServers() (servers []Server, err error) { - var serverMap map[string]Server - if err := c.get(`server/list`, &serverMap); err != nil { - return nil, err - } - - for _, server := range serverMap { - servers = append(servers, server) - } - return servers, nil -} - -// GetServersByTag returns a list of all virtual machines matching by tag -func (c *Client) GetServersByTag(tag string) (servers []Server, err error) { - var serverMap map[string]Server - if err := c.get(`server/list?tag=`+tag, &serverMap); err != nil { - return nil, err - } - - for _, server := range serverMap { - servers = append(servers, server) - } - return servers, nil -} - -// GetServer returns the virtual machine with the given ID -func (c *Client) GetServer(id string) (server Server, err error) { - if err := c.get(`server/list?SUBID=`+id, &server); err != nil { - return Server{}, err - } - return server, nil -} - -// CreateServer creates a new virtual machine on Vultr. ServerOptions are optional settings. -func (c *Client) CreateServer(name string, regionID, planID, osID int, options *ServerOptions) (Server, error) { - values := url.Values{ - "label": {name}, - "DCID": {fmt.Sprintf("%v", regionID)}, - "VPSPLANID": {fmt.Sprintf("%v", planID)}, - "OSID": {fmt.Sprintf("%v", osID)}, - } - - if options != nil { - if options.IPXEChainURL != "" { - values.Add("ipxe_chain_url", options.IPXEChainURL) - } - - if options.ISO != 0 { - values.Add("ISOID", fmt.Sprintf("%v", options.ISO)) - } - - if options.Script != 0 { - values.Add("SCRIPTID", fmt.Sprintf("%v", options.Script)) - } - - if options.UserData != "" { - values.Add("userdata", base64.StdEncoding.EncodeToString([]byte(options.UserData))) - } - - if options.Snapshot != "" { - values.Add("SNAPSHOTID", options.Snapshot) - } - - if options.SSHKey != "" { - values.Add("SSHKEYID", options.SSHKey) - } - - values.Add("enable_ipv6", "no") - if options.IPV6 { - values.Set("enable_ipv6", "yes") - } - - values.Add("enable_private_network", "no") - if options.PrivateNetworking { - values.Set("enable_private_network", "yes") - } - - values.Add("auto_backups", "no") - if options.AutoBackups { - values.Set("auto_backups", "yes") - } - - values.Add("notify_activate", "yes") - if options.DontNotifyOnActivate { - values.Set("notify_activate", "no") - } - - if options.Hostname != "" { - values.Add("hostname", options.Hostname) - } - - if options.Tag != "" { - values.Add("tag", options.Tag) - } - } - - var server Server - if err := c.post(`server/create`, values, &server); err != nil { - return Server{}, err - } - server.Name = name - server.RegionID = regionID - server.PlanID = planID - - return server, nil -} - -// RenameServer renames an existing virtual machine -func (c *Client) RenameServer(id, name string) error { - values := url.Values{ - "SUBID": {id}, - "label": {name}, - } - - if err := c.post(`server/label_set`, values, nil); err != nil { - return err - } - return nil -} - -// StartServer starts an existing virtual machine -func (c *Client) StartServer(id string) error { - values := url.Values{ - "SUBID": {id}, - } - - if err := c.post(`server/start`, values, nil); err != nil { - return err - } - return nil -} - -// HaltServer stops an existing virtual machine -func (c *Client) HaltServer(id string) error { - values := url.Values{ - "SUBID": {id}, - } - - if err := c.post(`server/halt`, values, nil); err != nil { - return err - } - return nil -} - -// RebootServer reboots an existing virtual machine -func (c *Client) RebootServer(id string) error { - values := url.Values{ - "SUBID": {id}, - } - - if err := c.post(`server/reboot`, values, nil); err != nil { - return err - } - return nil -} - -// ReinstallServer reinstalls the operating system on an existing virtual machine -func (c *Client) ReinstallServer(id string) error { - values := url.Values{ - "SUBID": {id}, - } - - if err := c.post(`server/reinstall`, values, nil); err != nil { - return err - } - return nil -} - -// ChangeOSofServer changes the virtual machine to a different operating system -func (c *Client) ChangeOSofServer(id string, osID int) error { - values := url.Values{ - "SUBID": {id}, - "OSID": {fmt.Sprintf("%v", osID)}, - } - - if err := c.post(`server/os_change`, values, nil); err != nil { - return err - } - return nil -} - -// ListOSforServer lists all available operating systems to which an existing virtual machine can be changed -func (c *Client) ListOSforServer(id string) (os []OS, err error) { - var osMap map[string]OS - if err := c.get(`server/os_change_list?SUBID=`+id, &osMap); err != nil { - return nil, err - } - - for _, o := range osMap { - os = append(os, o) - } - return os, nil -} - -// AttachISOtoServer attaches an ISO image to an existing virtual machine and reboots it -func (c *Client) AttachISOtoServer(id string, isoID int) error { - values := url.Values{ - "SUBID": {id}, - "ISOID": {fmt.Sprintf("%v", isoID)}, - } - - if err := c.post(`server/iso_attach`, values, nil); err != nil { - return err - } - return nil -} - -// DetachISOfromServer detaches the currently mounted ISO image from the virtual machine and reboots it -func (c *Client) DetachISOfromServer(id string) error { - values := url.Values{ - "SUBID": {id}, - } - - if err := c.post(`server/iso_detach`, values, nil); err != nil { - return err - } - return nil -} - -// GetISOStatusofServer retrieves the current ISO image state of an existing virtual machine -func (c *Client) GetISOStatusofServer(id string) (isoStatus ISOStatus, err error) { - if err := c.get(`server/iso_status?SUBID=`+id, &isoStatus); err != nil { - return ISOStatus{}, err - } - return isoStatus, nil -} - -// DeleteServer deletes an existing virtual machine -func (c *Client) DeleteServer(id string) error { - values := url.Values{ - "SUBID": {id}, - } - - if err := c.post(`server/destroy`, values, nil); err != nil { - return err - } - return nil -} - -// BandwidthOfServer retrieves the bandwidth used by a virtual machine -func (c *Client) BandwidthOfServer(id string) (bandwidth []map[string]string, err error) { - var bandwidthMap map[string][][]string - if err := c.get(`server/bandwidth?SUBID=`+id, &bandwidthMap); err != nil { - return nil, err - } - - // parse incoming bytes - for _, b := range bandwidthMap["incoming_bytes"] { - bMap := make(map[string]string) - bMap["date"] = b[0] - bMap["incoming"] = b[1] - bandwidth = append(bandwidth, bMap) - } - - // parse outgoing bytes (we'll assume that incoming and outgoing dates are always a match) - for _, b := range bandwidthMap["outgoing_bytes"] { - for i := range bandwidth { - if bandwidth[i]["date"] == b[0] { - bandwidth[i]["outgoing"] = b[1] - break - } - } - } - - return bandwidth, nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/snapshots.go b/vendor/github.com/JamesClonk/vultr/lib/snapshots.go deleted file mode 100644 index e95cdbf..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/snapshots.go +++ /dev/null @@ -1,53 +0,0 @@ -package lib - -import "net/url" - -// Snapshot of a virtual machine on Vultr account -type Snapshot struct { - ID string `json:"SNAPSHOTID"` - Description string `json:"description"` - Size string `json:"size"` - Status string `json:"status"` - Created string `json:"date_created"` -} - -// GetSnapshots retrieves a list of all snapshots on Vultr account -func (c *Client) GetSnapshots() (snapshots []Snapshot, err error) { - var snapshotMap map[string]Snapshot - if err := c.get(`snapshot/list`, &snapshotMap); err != nil { - return nil, err - } - - for _, snapshot := range snapshotMap { - snapshots = append(snapshots, snapshot) - } - return snapshots, nil -} - -// CreateSnapshot creates a new virtual machine snapshot -func (c *Client) CreateSnapshot(id, description string) (Snapshot, error) { - values := url.Values{ - "SUBID": {id}, - "description": {description}, - } - - var snapshot Snapshot - if err := c.post(`snapshot/create`, values, &snapshot); err != nil { - return Snapshot{}, err - } - snapshot.Description = description - - return snapshot, nil -} - -// DeleteSnapshot deletes an existing virtual machine snapshot -func (c *Client) DeleteSnapshot(id string) error { - values := url.Values{ - "SNAPSHOTID": {id}, - } - - if err := c.post(`snapshot/destroy`, values, nil); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/JamesClonk/vultr/lib/sshkeys.go b/vendor/github.com/JamesClonk/vultr/lib/sshkeys.go deleted file mode 100644 index 309c089..0000000 --- a/vendor/github.com/JamesClonk/vultr/lib/sshkeys.go +++ /dev/null @@ -1,71 +0,0 @@ -package lib - -import "net/url" - -// SSHKey on Vultr account -type SSHKey struct { - ID string `json:"SSHKEYID"` - Name string `json:"name"` - Key string `json:"ssh_key"` - Created string `json:"date_created"` -} - -// GetSSHKeys returns a list of SSHKeys from Vultr account -func (c *Client) GetSSHKeys() (keys []SSHKey, err error) { - var keyMap map[string]SSHKey - if err := c.get(`sshkey/list`, &keyMap); err != nil { - return nil, err - } - - for _, key := range keyMap { - keys = append(keys, key) - } - return keys, nil -} - -// CreateSSHKey creates new SSHKey on Vultr -func (c *Client) CreateSSHKey(name, key string) (SSHKey, error) { - values := url.Values{ - "name": {name}, - "ssh_key": {key}, - } - - var sshKey SSHKey - if err := c.post(`sshkey/create`, values, &sshKey); err != nil { - return SSHKey{}, err - } - sshKey.Name = name - sshKey.Key = key - - return sshKey, nil -} - -// UpdateSSHKey updates an existing SSHKey entry -func (c *Client) UpdateSSHKey(key SSHKey) error { - values := url.Values{ - "SSHKEYID": {key.ID}, - } - if key.Name != "" { - values.Add("name", key.Name) - } - if key.Key != "" { - values.Add("ssh_key", key.Key) - } - - if err := c.post(`sshkey/update`, values, nil); err != nil { - return err - } - return nil -} - -// DeleteSSHKey deletes an existing SSHKey from Vultr account -func (c *Client) DeleteSSHKey(id string) error { - values := url.Values{ - "SSHKEYID": {id}, - } - - if err := c.post(`sshkey/destroy`, values, nil); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/agl/ed25519/LICENSE b/vendor/github.com/agl/ed25519/LICENSE deleted file mode 100644 index 7448756..0000000 --- a/vendor/github.com/agl/ed25519/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/agl/ed25519/ed25519.go b/vendor/github.com/agl/ed25519/ed25519.go deleted file mode 100644 index e5f873f..0000000 --- a/vendor/github.com/agl/ed25519/ed25519.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ed25519 implements the Ed25519 signature algorithm. See -// http://ed25519.cr.yp.to/. -package ed25519 - -// This code is a port of the public domain, "ref10" implementation of ed25519 -// from SUPERCOP. - -import ( - "crypto/sha512" - "crypto/subtle" - "io" - - "github.com/agl/ed25519/edwards25519" -) - -const ( - PublicKeySize = 32 - PrivateKeySize = 64 - SignatureSize = 64 -) - -// GenerateKey generates a public/private key pair using randomness from rand. -func GenerateKey(rand io.Reader) (publicKey *[PublicKeySize]byte, privateKey *[PrivateKeySize]byte, err error) { - privateKey = new([64]byte) - publicKey = new([32]byte) - _, err = io.ReadFull(rand, privateKey[:32]) - if err != nil { - return nil, nil, err - } - - h := sha512.New() - h.Write(privateKey[:32]) - digest := h.Sum(nil) - - digest[0] &= 248 - digest[31] &= 127 - digest[31] |= 64 - - var A edwards25519.ExtendedGroupElement - var hBytes [32]byte - copy(hBytes[:], digest) - edwards25519.GeScalarMultBase(&A, &hBytes) - A.ToBytes(publicKey) - - copy(privateKey[32:], publicKey[:]) - return -} - -// Sign signs the message with privateKey and returns a signature. -func Sign(privateKey *[PrivateKeySize]byte, message []byte) *[SignatureSize]byte { - h := sha512.New() - h.Write(privateKey[:32]) - - var digest1, messageDigest, hramDigest [64]byte - var expandedSecretKey [32]byte - h.Sum(digest1[:0]) - copy(expandedSecretKey[:], digest1[:]) - expandedSecretKey[0] &= 248 - expandedSecretKey[31] &= 63 - expandedSecretKey[31] |= 64 - - h.Reset() - h.Write(digest1[32:]) - h.Write(message) - h.Sum(messageDigest[:0]) - - var messageDigestReduced [32]byte - edwards25519.ScReduce(&messageDigestReduced, &messageDigest) - var R edwards25519.ExtendedGroupElement - edwards25519.GeScalarMultBase(&R, &messageDigestReduced) - - var encodedR [32]byte - R.ToBytes(&encodedR) - - h.Reset() - h.Write(encodedR[:]) - h.Write(privateKey[32:]) - h.Write(message) - h.Sum(hramDigest[:0]) - var hramDigestReduced [32]byte - edwards25519.ScReduce(&hramDigestReduced, &hramDigest) - - var s [32]byte - edwards25519.ScMulAdd(&s, &hramDigestReduced, &expandedSecretKey, &messageDigestReduced) - - signature := new([64]byte) - copy(signature[:], encodedR[:]) - copy(signature[32:], s[:]) - return signature -} - -// Verify returns true iff sig is a valid signature of message by publicKey. -func Verify(publicKey *[PublicKeySize]byte, message []byte, sig *[SignatureSize]byte) bool { - if sig[63]&224 != 0 { - return false - } - - var A edwards25519.ExtendedGroupElement - if !A.FromBytes(publicKey) { - return false - } - edwards25519.FeNeg(&A.X, &A.X) - edwards25519.FeNeg(&A.T, &A.T) - - h := sha512.New() - h.Write(sig[:32]) - h.Write(publicKey[:]) - h.Write(message) - var digest [64]byte - h.Sum(digest[:0]) - - var hReduced [32]byte - edwards25519.ScReduce(&hReduced, &digest) - - var R edwards25519.ProjectiveGroupElement - var b [32]byte - copy(b[:], sig[32:]) - edwards25519.GeDoubleScalarMultVartime(&R, &hReduced, &A, &b) - - var checkR [32]byte - R.ToBytes(&checkR) - return subtle.ConstantTimeCompare(sig[:32], checkR[:]) == 1 -} diff --git a/vendor/github.com/agl/ed25519/edwards25519/const.go b/vendor/github.com/agl/ed25519/edwards25519/const.go deleted file mode 100644 index ea5b77a..0000000 --- a/vendor/github.com/agl/ed25519/edwards25519/const.go +++ /dev/null @@ -1,1411 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package edwards25519 - -var d = FieldElement{ - -10913610, 13857413, -15372611, 6949391, 114729, -8787816, -6275908, -3247719, -18696448, -12055116, -} - -var d2 = FieldElement{ - -21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199, -} - -var SqrtM1 = FieldElement{ - -32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482, -} - -var A = FieldElement{ - 486662, 0, 0, 0, 0, 0, 0, 0, 0, 0, -} - -var bi = [8]PreComputedGroupElement{ - { - FieldElement{25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605}, - FieldElement{-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378}, - FieldElement{-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546}, - }, - { - FieldElement{15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024}, - FieldElement{16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574}, - FieldElement{30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357}, - }, - { - FieldElement{10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380}, - FieldElement{4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306}, - FieldElement{19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942}, - }, - { - FieldElement{5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766}, - FieldElement{-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701}, - FieldElement{28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300}, - }, - { - FieldElement{-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877}, - FieldElement{-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951}, - FieldElement{4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784}, - }, - { - FieldElement{-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436}, - FieldElement{25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918}, - FieldElement{23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877}, - }, - { - FieldElement{-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800}, - FieldElement{-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305}, - FieldElement{-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300}, - }, - { - FieldElement{-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876}, - FieldElement{-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619}, - FieldElement{-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683}, - }, -} - -var base = [32][8]PreComputedGroupElement{ - { - { - FieldElement{25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605}, - FieldElement{-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378}, - FieldElement{-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546}, - }, - { - FieldElement{-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303}, - FieldElement{-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081}, - FieldElement{26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697}, - }, - { - FieldElement{15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024}, - FieldElement{16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574}, - FieldElement{30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357}, - }, - { - FieldElement{-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540}, - FieldElement{23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397}, - FieldElement{7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325}, - }, - { - FieldElement{10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380}, - FieldElement{4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306}, - FieldElement{19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942}, - }, - { - FieldElement{-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777}, - FieldElement{-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737}, - FieldElement{-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652}, - }, - { - FieldElement{5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766}, - FieldElement{-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701}, - FieldElement{28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300}, - }, - { - FieldElement{14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726}, - FieldElement{-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955}, - FieldElement{27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425}, - }, - }, - { - { - FieldElement{-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171}, - FieldElement{27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510}, - FieldElement{17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660}, - }, - { - FieldElement{-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639}, - FieldElement{29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963}, - FieldElement{5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950}, - }, - { - FieldElement{-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568}, - FieldElement{12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335}, - FieldElement{25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628}, - }, - { - FieldElement{-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007}, - FieldElement{-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772}, - FieldElement{-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653}, - }, - { - FieldElement{2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567}, - FieldElement{13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686}, - FieldElement{21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372}, - }, - { - FieldElement{-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887}, - FieldElement{-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954}, - FieldElement{-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953}, - }, - { - FieldElement{24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833}, - FieldElement{-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532}, - FieldElement{-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876}, - }, - { - FieldElement{2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268}, - FieldElement{33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214}, - FieldElement{1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038}, - }, - }, - { - { - FieldElement{6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800}, - FieldElement{4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645}, - FieldElement{-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664}, - }, - { - FieldElement{1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933}, - FieldElement{-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182}, - FieldElement{-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222}, - }, - { - FieldElement{-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991}, - FieldElement{20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880}, - FieldElement{9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092}, - }, - { - FieldElement{-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295}, - FieldElement{19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788}, - FieldElement{8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553}, - }, - { - FieldElement{-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026}, - FieldElement{11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347}, - FieldElement{-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033}, - }, - { - FieldElement{-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395}, - FieldElement{-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278}, - FieldElement{1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890}, - }, - { - FieldElement{32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995}, - FieldElement{-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596}, - FieldElement{-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891}, - }, - { - FieldElement{31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060}, - FieldElement{11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608}, - FieldElement{-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606}, - }, - }, - { - { - FieldElement{7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389}, - FieldElement{-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016}, - FieldElement{-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341}, - }, - { - FieldElement{-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505}, - FieldElement{14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553}, - FieldElement{-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655}, - }, - { - FieldElement{15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220}, - FieldElement{12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631}, - FieldElement{-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099}, - }, - { - FieldElement{26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556}, - FieldElement{14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749}, - FieldElement{236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930}, - }, - { - FieldElement{1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391}, - FieldElement{5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253}, - FieldElement{20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066}, - }, - { - FieldElement{24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958}, - FieldElement{-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082}, - FieldElement{-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383}, - }, - { - FieldElement{-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521}, - FieldElement{-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807}, - FieldElement{23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948}, - }, - { - FieldElement{9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134}, - FieldElement{-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455}, - FieldElement{27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629}, - }, - }, - { - { - FieldElement{-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069}, - FieldElement{-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746}, - FieldElement{24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919}, - }, - { - FieldElement{11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837}, - FieldElement{8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906}, - FieldElement{-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771}, - }, - { - FieldElement{-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817}, - FieldElement{10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098}, - FieldElement{10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409}, - }, - { - FieldElement{-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504}, - FieldElement{-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727}, - FieldElement{28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420}, - }, - { - FieldElement{-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003}, - FieldElement{-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605}, - FieldElement{-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384}, - }, - { - FieldElement{-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701}, - FieldElement{-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683}, - FieldElement{29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708}, - }, - { - FieldElement{-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563}, - FieldElement{-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260}, - FieldElement{-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387}, - }, - { - FieldElement{-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672}, - FieldElement{23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686}, - FieldElement{-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665}, - }, - }, - { - { - FieldElement{11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182}, - FieldElement{-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277}, - FieldElement{14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628}, - }, - { - FieldElement{-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474}, - FieldElement{-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539}, - FieldElement{-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822}, - }, - { - FieldElement{-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970}, - FieldElement{19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756}, - FieldElement{-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508}, - }, - { - FieldElement{-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683}, - FieldElement{-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655}, - FieldElement{-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158}, - }, - { - FieldElement{-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125}, - FieldElement{-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839}, - FieldElement{-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664}, - }, - { - FieldElement{27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294}, - FieldElement{-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899}, - FieldElement{-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070}, - }, - { - FieldElement{3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294}, - FieldElement{-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949}, - FieldElement{-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083}, - }, - { - FieldElement{31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420}, - FieldElement{-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940}, - FieldElement{29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396}, - }, - }, - { - { - FieldElement{-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567}, - FieldElement{20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127}, - FieldElement{-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294}, - }, - { - FieldElement{-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887}, - FieldElement{22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964}, - FieldElement{16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195}, - }, - { - FieldElement{9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244}, - FieldElement{24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999}, - FieldElement{-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762}, - }, - { - FieldElement{-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274}, - FieldElement{-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236}, - FieldElement{-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605}, - }, - { - FieldElement{-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761}, - FieldElement{-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884}, - FieldElement{-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482}, - }, - { - FieldElement{-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638}, - FieldElement{-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490}, - FieldElement{-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170}, - }, - { - FieldElement{5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736}, - FieldElement{10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124}, - FieldElement{-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392}, - }, - { - FieldElement{8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029}, - FieldElement{6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048}, - FieldElement{28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958}, - }, - }, - { - { - FieldElement{24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593}, - FieldElement{26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071}, - FieldElement{-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692}, - }, - { - FieldElement{11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687}, - FieldElement{-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441}, - FieldElement{-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001}, - }, - { - FieldElement{-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460}, - FieldElement{-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007}, - FieldElement{-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762}, - }, - { - FieldElement{15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005}, - FieldElement{-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674}, - FieldElement{4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035}, - }, - { - FieldElement{7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590}, - FieldElement{-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957}, - FieldElement{-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812}, - }, - { - FieldElement{33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740}, - FieldElement{-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122}, - FieldElement{-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158}, - }, - { - FieldElement{8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885}, - FieldElement{26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140}, - FieldElement{19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857}, - }, - { - FieldElement{801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155}, - FieldElement{19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260}, - FieldElement{19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483}, - }, - }, - { - { - FieldElement{-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677}, - FieldElement{32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815}, - FieldElement{22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751}, - }, - { - FieldElement{-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203}, - FieldElement{-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208}, - FieldElement{1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230}, - }, - { - FieldElement{16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850}, - FieldElement{-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389}, - FieldElement{-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968}, - }, - { - FieldElement{-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689}, - FieldElement{14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880}, - FieldElement{5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304}, - }, - { - FieldElement{30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632}, - FieldElement{-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412}, - FieldElement{20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566}, - }, - { - FieldElement{-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038}, - FieldElement{-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232}, - FieldElement{-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943}, - }, - { - FieldElement{17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856}, - FieldElement{23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738}, - FieldElement{15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971}, - }, - { - FieldElement{-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718}, - FieldElement{-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697}, - FieldElement{-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883}, - }, - }, - { - { - FieldElement{5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912}, - FieldElement{-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358}, - FieldElement{3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849}, - }, - { - FieldElement{29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307}, - FieldElement{-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977}, - FieldElement{-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335}, - }, - { - FieldElement{-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644}, - FieldElement{-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616}, - FieldElement{-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735}, - }, - { - FieldElement{-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099}, - FieldElement{29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341}, - FieldElement{-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336}, - }, - { - FieldElement{-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646}, - FieldElement{31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425}, - FieldElement{-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388}, - }, - { - FieldElement{-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743}, - FieldElement{-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822}, - FieldElement{-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462}, - }, - { - FieldElement{18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985}, - FieldElement{9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702}, - FieldElement{-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797}, - }, - { - FieldElement{21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293}, - FieldElement{27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100}, - FieldElement{19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688}, - }, - }, - { - { - FieldElement{12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186}, - FieldElement{2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610}, - FieldElement{-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707}, - }, - { - FieldElement{7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220}, - FieldElement{915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025}, - FieldElement{32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044}, - }, - { - FieldElement{32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992}, - FieldElement{-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027}, - FieldElement{21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197}, - }, - { - FieldElement{8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901}, - FieldElement{31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952}, - FieldElement{19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878}, - }, - { - FieldElement{-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390}, - FieldElement{32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730}, - FieldElement{2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730}, - }, - { - FieldElement{-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180}, - FieldElement{-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272}, - FieldElement{-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715}, - }, - { - FieldElement{-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970}, - FieldElement{-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772}, - FieldElement{-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865}, - }, - { - FieldElement{15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750}, - FieldElement{20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373}, - FieldElement{32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348}, - }, - }, - { - { - FieldElement{9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144}, - FieldElement{-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195}, - FieldElement{5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086}, - }, - { - FieldElement{-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684}, - FieldElement{-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518}, - FieldElement{-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233}, - }, - { - FieldElement{-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793}, - FieldElement{-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794}, - FieldElement{580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435}, - }, - { - FieldElement{23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921}, - FieldElement{13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518}, - FieldElement{2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563}, - }, - { - FieldElement{14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278}, - FieldElement{-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024}, - FieldElement{4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030}, - }, - { - FieldElement{10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783}, - FieldElement{27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717}, - FieldElement{6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844}, - }, - { - FieldElement{14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333}, - FieldElement{16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048}, - FieldElement{22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760}, - }, - { - FieldElement{-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760}, - FieldElement{-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757}, - FieldElement{-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112}, - }, - }, - { - { - FieldElement{-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468}, - FieldElement{3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184}, - FieldElement{10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289}, - }, - { - FieldElement{15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066}, - FieldElement{24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882}, - FieldElement{13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226}, - }, - { - FieldElement{16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101}, - FieldElement{29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279}, - FieldElement{-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811}, - }, - { - FieldElement{27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709}, - FieldElement{20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714}, - FieldElement{-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121}, - }, - { - FieldElement{9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464}, - FieldElement{12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847}, - FieldElement{13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400}, - }, - { - FieldElement{4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414}, - FieldElement{-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158}, - FieldElement{17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045}, - }, - { - FieldElement{-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415}, - FieldElement{-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459}, - FieldElement{-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079}, - }, - { - FieldElement{21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412}, - FieldElement{-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743}, - FieldElement{-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836}, - }, - }, - { - { - FieldElement{12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022}, - FieldElement{18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429}, - FieldElement{-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065}, - }, - { - FieldElement{30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861}, - FieldElement{10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000}, - FieldElement{-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101}, - }, - { - FieldElement{32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815}, - FieldElement{29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642}, - FieldElement{10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966}, - }, - { - FieldElement{25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574}, - FieldElement{-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742}, - FieldElement{-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689}, - }, - { - FieldElement{12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020}, - FieldElement{-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772}, - FieldElement{3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982}, - }, - { - FieldElement{-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953}, - FieldElement{-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218}, - FieldElement{-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265}, - }, - { - FieldElement{29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073}, - FieldElement{-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325}, - FieldElement{-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798}, - }, - { - FieldElement{-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870}, - FieldElement{-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863}, - FieldElement{-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927}, - }, - }, - { - { - FieldElement{-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267}, - FieldElement{-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663}, - FieldElement{22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862}, - }, - { - FieldElement{-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673}, - FieldElement{15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943}, - FieldElement{15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020}, - }, - { - FieldElement{-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238}, - FieldElement{11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064}, - FieldElement{14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795}, - }, - { - FieldElement{15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052}, - FieldElement{-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904}, - FieldElement{29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531}, - }, - { - FieldElement{-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979}, - FieldElement{-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841}, - FieldElement{10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431}, - }, - { - FieldElement{10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324}, - FieldElement{-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940}, - FieldElement{10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320}, - }, - { - FieldElement{-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184}, - FieldElement{14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114}, - FieldElement{30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878}, - }, - { - FieldElement{12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784}, - FieldElement{-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091}, - FieldElement{-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585}, - }, - }, - { - { - FieldElement{-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208}, - FieldElement{10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864}, - FieldElement{17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661}, - }, - { - FieldElement{7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233}, - FieldElement{26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212}, - FieldElement{-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525}, - }, - { - FieldElement{-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068}, - FieldElement{9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397}, - FieldElement{-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988}, - }, - { - FieldElement{5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889}, - FieldElement{32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038}, - FieldElement{14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697}, - }, - { - FieldElement{20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875}, - FieldElement{-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905}, - FieldElement{-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656}, - }, - { - FieldElement{11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818}, - FieldElement{27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714}, - FieldElement{10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203}, - }, - { - FieldElement{20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931}, - FieldElement{-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024}, - FieldElement{-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084}, - }, - { - FieldElement{-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204}, - FieldElement{20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817}, - FieldElement{27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667}, - }, - }, - { - { - FieldElement{11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504}, - FieldElement{-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768}, - FieldElement{-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255}, - }, - { - FieldElement{6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790}, - FieldElement{1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438}, - FieldElement{-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333}, - }, - { - FieldElement{17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971}, - FieldElement{31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905}, - FieldElement{29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409}, - }, - { - FieldElement{12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409}, - FieldElement{6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499}, - FieldElement{-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363}, - }, - { - FieldElement{28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664}, - FieldElement{-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324}, - FieldElement{-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940}, - }, - { - FieldElement{13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990}, - FieldElement{-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914}, - FieldElement{-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290}, - }, - { - FieldElement{24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257}, - FieldElement{-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433}, - FieldElement{-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236}, - }, - { - FieldElement{-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045}, - FieldElement{11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093}, - FieldElement{-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347}, - }, - }, - { - { - FieldElement{-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191}, - FieldElement{-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507}, - FieldElement{-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906}, - }, - { - FieldElement{3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018}, - FieldElement{-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109}, - FieldElement{-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926}, - }, - { - FieldElement{-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528}, - FieldElement{8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625}, - FieldElement{-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286}, - }, - { - FieldElement{2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033}, - FieldElement{27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866}, - FieldElement{21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896}, - }, - { - FieldElement{30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075}, - FieldElement{26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347}, - FieldElement{-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437}, - }, - { - FieldElement{-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165}, - FieldElement{-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588}, - FieldElement{-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193}, - }, - { - FieldElement{-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017}, - FieldElement{-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883}, - FieldElement{21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961}, - }, - { - FieldElement{8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043}, - FieldElement{29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663}, - FieldElement{-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362}, - }, - }, - { - { - FieldElement{-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860}, - FieldElement{2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466}, - FieldElement{-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063}, - }, - { - FieldElement{-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997}, - FieldElement{-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295}, - FieldElement{-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369}, - }, - { - FieldElement{9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385}, - FieldElement{18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109}, - FieldElement{2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906}, - }, - { - FieldElement{4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424}, - FieldElement{-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185}, - FieldElement{7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962}, - }, - { - FieldElement{-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325}, - FieldElement{10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593}, - FieldElement{696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404}, - }, - { - FieldElement{-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644}, - FieldElement{17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801}, - FieldElement{26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804}, - }, - { - FieldElement{-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884}, - FieldElement{-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577}, - FieldElement{-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849}, - }, - { - FieldElement{32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473}, - FieldElement{-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644}, - FieldElement{-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319}, - }, - }, - { - { - FieldElement{-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599}, - FieldElement{-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768}, - FieldElement{-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084}, - }, - { - FieldElement{-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328}, - FieldElement{-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369}, - FieldElement{20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920}, - }, - { - FieldElement{12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815}, - FieldElement{-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025}, - FieldElement{-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397}, - }, - { - FieldElement{-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448}, - FieldElement{6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981}, - FieldElement{30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165}, - }, - { - FieldElement{32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501}, - FieldElement{17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073}, - FieldElement{-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861}, - }, - { - FieldElement{14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845}, - FieldElement{-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211}, - FieldElement{18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870}, - }, - { - FieldElement{10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096}, - FieldElement{33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803}, - FieldElement{-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168}, - }, - { - FieldElement{30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965}, - FieldElement{-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505}, - FieldElement{18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598}, - }, - }, - { - { - FieldElement{5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782}, - FieldElement{5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900}, - FieldElement{-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479}, - }, - { - FieldElement{-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208}, - FieldElement{8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232}, - FieldElement{17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719}, - }, - { - FieldElement{16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271}, - FieldElement{-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326}, - FieldElement{-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132}, - }, - { - FieldElement{14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300}, - FieldElement{8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570}, - FieldElement{15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670}, - }, - { - FieldElement{-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994}, - FieldElement{-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913}, - FieldElement{31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317}, - }, - { - FieldElement{-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730}, - FieldElement{842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096}, - FieldElement{-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078}, - }, - { - FieldElement{-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411}, - FieldElement{-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905}, - FieldElement{-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654}, - }, - { - FieldElement{-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870}, - FieldElement{-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498}, - FieldElement{12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579}, - }, - }, - { - { - FieldElement{14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677}, - FieldElement{10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647}, - FieldElement{-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743}, - }, - { - FieldElement{-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468}, - FieldElement{21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375}, - FieldElement{-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155}, - }, - { - FieldElement{6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725}, - FieldElement{-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612}, - FieldElement{-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943}, - }, - { - FieldElement{-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944}, - FieldElement{30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928}, - FieldElement{9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406}, - }, - { - FieldElement{22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139}, - FieldElement{-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963}, - FieldElement{-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693}, - }, - { - FieldElement{1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734}, - FieldElement{-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680}, - FieldElement{-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410}, - }, - { - FieldElement{-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931}, - FieldElement{-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654}, - FieldElement{22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710}, - }, - { - FieldElement{29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180}, - FieldElement{-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684}, - FieldElement{-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895}, - }, - }, - { - { - FieldElement{22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501}, - FieldElement{-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413}, - FieldElement{6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880}, - }, - { - FieldElement{-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874}, - FieldElement{22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962}, - FieldElement{-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899}, - }, - { - FieldElement{21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152}, - FieldElement{9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063}, - FieldElement{7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080}, - }, - { - FieldElement{-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146}, - FieldElement{-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183}, - FieldElement{-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133}, - }, - { - FieldElement{-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421}, - FieldElement{-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622}, - FieldElement{-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197}, - }, - { - FieldElement{2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663}, - FieldElement{31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753}, - FieldElement{4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755}, - }, - { - FieldElement{-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862}, - FieldElement{-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118}, - FieldElement{26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171}, - }, - { - FieldElement{15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380}, - FieldElement{16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824}, - FieldElement{28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270}, - }, - }, - { - { - FieldElement{-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438}, - FieldElement{-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584}, - FieldElement{-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562}, - }, - { - FieldElement{30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471}, - FieldElement{18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610}, - FieldElement{19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269}, - }, - { - FieldElement{-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650}, - FieldElement{14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369}, - FieldElement{19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461}, - }, - { - FieldElement{30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462}, - FieldElement{-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793}, - FieldElement{-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218}, - }, - { - FieldElement{-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226}, - FieldElement{18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019}, - FieldElement{-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037}, - }, - { - FieldElement{31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171}, - FieldElement{-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132}, - FieldElement{-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841}, - }, - { - FieldElement{21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181}, - FieldElement{-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210}, - FieldElement{-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040}, - }, - { - FieldElement{3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935}, - FieldElement{24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105}, - FieldElement{-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814}, - }, - }, - { - { - FieldElement{793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852}, - FieldElement{5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581}, - FieldElement{-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646}, - }, - { - FieldElement{10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844}, - FieldElement{10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025}, - FieldElement{27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453}, - }, - { - FieldElement{-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068}, - FieldElement{4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192}, - FieldElement{-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921}, - }, - { - FieldElement{-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259}, - FieldElement{-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426}, - FieldElement{-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072}, - }, - { - FieldElement{-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305}, - FieldElement{13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832}, - FieldElement{28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943}, - }, - { - FieldElement{-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011}, - FieldElement{24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447}, - FieldElement{17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494}, - }, - { - FieldElement{-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245}, - FieldElement{-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859}, - FieldElement{28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915}, - }, - { - FieldElement{16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707}, - FieldElement{10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848}, - FieldElement{-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224}, - }, - }, - { - { - FieldElement{-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391}, - FieldElement{15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215}, - FieldElement{-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101}, - }, - { - FieldElement{23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713}, - FieldElement{21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849}, - FieldElement{-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930}, - }, - { - FieldElement{-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940}, - FieldElement{-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031}, - FieldElement{-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404}, - }, - { - FieldElement{-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243}, - FieldElement{-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116}, - FieldElement{-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525}, - }, - { - FieldElement{-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509}, - FieldElement{-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883}, - FieldElement{15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865}, - }, - { - FieldElement{-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660}, - FieldElement{4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273}, - FieldElement{-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138}, - }, - { - FieldElement{-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560}, - FieldElement{-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135}, - FieldElement{2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941}, - }, - { - FieldElement{-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739}, - FieldElement{18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756}, - FieldElement{-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819}, - }, - }, - { - { - FieldElement{-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347}, - FieldElement{-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028}, - FieldElement{21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075}, - }, - { - FieldElement{16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799}, - FieldElement{-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609}, - FieldElement{-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817}, - }, - { - FieldElement{-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989}, - FieldElement{-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523}, - FieldElement{4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278}, - }, - { - FieldElement{31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045}, - FieldElement{19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377}, - FieldElement{24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480}, - }, - { - FieldElement{17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016}, - FieldElement{510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426}, - FieldElement{18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525}, - }, - { - FieldElement{13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396}, - FieldElement{9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080}, - FieldElement{12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892}, - }, - { - FieldElement{15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275}, - FieldElement{11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074}, - FieldElement{20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140}, - }, - { - FieldElement{-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717}, - FieldElement{-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101}, - FieldElement{24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127}, - }, - }, - { - { - FieldElement{-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632}, - FieldElement{-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415}, - FieldElement{-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160}, - }, - { - FieldElement{31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876}, - FieldElement{22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625}, - FieldElement{-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478}, - }, - { - FieldElement{27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164}, - FieldElement{26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595}, - FieldElement{-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248}, - }, - { - FieldElement{-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858}, - FieldElement{15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193}, - FieldElement{8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184}, - }, - { - FieldElement{-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942}, - FieldElement{-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635}, - FieldElement{21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948}, - }, - { - FieldElement{11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935}, - FieldElement{-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415}, - FieldElement{-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416}, - }, - { - FieldElement{-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018}, - FieldElement{4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778}, - FieldElement{366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659}, - }, - { - FieldElement{-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385}, - FieldElement{18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503}, - FieldElement{476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329}, - }, - }, - { - { - FieldElement{20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056}, - FieldElement{-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838}, - FieldElement{24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948}, - }, - { - FieldElement{-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691}, - FieldElement{-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118}, - FieldElement{-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517}, - }, - { - FieldElement{-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269}, - FieldElement{-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904}, - FieldElement{-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589}, - }, - { - FieldElement{-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193}, - FieldElement{-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910}, - FieldElement{-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930}, - }, - { - FieldElement{-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667}, - FieldElement{25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481}, - FieldElement{-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876}, - }, - { - FieldElement{22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640}, - FieldElement{-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278}, - FieldElement{-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112}, - }, - { - FieldElement{26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272}, - FieldElement{17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012}, - FieldElement{-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221}, - }, - { - FieldElement{30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046}, - FieldElement{13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345}, - FieldElement{-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310}, - }, - }, - { - { - FieldElement{19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937}, - FieldElement{31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636}, - FieldElement{-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008}, - }, - { - FieldElement{-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429}, - FieldElement{-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576}, - FieldElement{31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066}, - }, - { - FieldElement{-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490}, - FieldElement{-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104}, - FieldElement{33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053}, - }, - { - FieldElement{31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275}, - FieldElement{-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511}, - FieldElement{22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095}, - }, - { - FieldElement{-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439}, - FieldElement{23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939}, - FieldElement{-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424}, - }, - { - FieldElement{2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310}, - FieldElement{3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608}, - FieldElement{-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079}, - }, - { - FieldElement{-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101}, - FieldElement{21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418}, - FieldElement{18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576}, - }, - { - FieldElement{30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356}, - FieldElement{9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996}, - FieldElement{-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099}, - }, - }, - { - { - FieldElement{-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728}, - FieldElement{-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658}, - FieldElement{-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242}, - }, - { - FieldElement{-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001}, - FieldElement{-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766}, - FieldElement{18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373}, - }, - { - FieldElement{26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458}, - FieldElement{-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628}, - FieldElement{-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657}, - }, - { - FieldElement{-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062}, - FieldElement{25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616}, - FieldElement{31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014}, - }, - { - FieldElement{24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383}, - FieldElement{-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814}, - FieldElement{-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718}, - }, - { - FieldElement{30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417}, - FieldElement{2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222}, - FieldElement{33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444}, - }, - { - FieldElement{-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597}, - FieldElement{23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970}, - FieldElement{1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799}, - }, - { - FieldElement{-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647}, - FieldElement{13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511}, - FieldElement{-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032}, - }, - }, - { - { - FieldElement{9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834}, - FieldElement{-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461}, - FieldElement{29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062}, - }, - { - FieldElement{-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516}, - FieldElement{-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547}, - FieldElement{-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240}, - }, - { - FieldElement{-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038}, - FieldElement{-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741}, - FieldElement{16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103}, - }, - { - FieldElement{-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747}, - FieldElement{-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323}, - FieldElement{31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016}, - }, - { - FieldElement{-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373}, - FieldElement{15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228}, - FieldElement{-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141}, - }, - { - FieldElement{16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399}, - FieldElement{11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831}, - FieldElement{-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376}, - }, - { - FieldElement{-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313}, - FieldElement{-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958}, - FieldElement{-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577}, - }, - { - FieldElement{-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743}, - FieldElement{29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684}, - FieldElement{-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476}, - }, - }, -} diff --git a/vendor/github.com/agl/ed25519/edwards25519/edwards25519.go b/vendor/github.com/agl/ed25519/edwards25519/edwards25519.go deleted file mode 100644 index 9079818..0000000 --- a/vendor/github.com/agl/ed25519/edwards25519/edwards25519.go +++ /dev/null @@ -1,1773 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package edwards25519 implements operations in GF(2**255-19) and on an -// Edwards curve that is isomorphic to curve25519. See -// http://ed25519.cr.yp.to/. -package edwards25519 - -// This code is a port of the public domain, "ref10" implementation of ed25519 -// from SUPERCOP. - -// FieldElement represents an element of the field GF(2^255 - 19). An element -// t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 -// t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on -// context. -type FieldElement [10]int32 - -var zero FieldElement - -func FeZero(fe *FieldElement) { - copy(fe[:], zero[:]) -} - -func FeOne(fe *FieldElement) { - FeZero(fe) - fe[0] = 1 -} - -func FeAdd(dst, a, b *FieldElement) { - dst[0] = a[0] + b[0] - dst[1] = a[1] + b[1] - dst[2] = a[2] + b[2] - dst[3] = a[3] + b[3] - dst[4] = a[4] + b[4] - dst[5] = a[5] + b[5] - dst[6] = a[6] + b[6] - dst[7] = a[7] + b[7] - dst[8] = a[8] + b[8] - dst[9] = a[9] + b[9] -} - -func FeSub(dst, a, b *FieldElement) { - dst[0] = a[0] - b[0] - dst[1] = a[1] - b[1] - dst[2] = a[2] - b[2] - dst[3] = a[3] - b[3] - dst[4] = a[4] - b[4] - dst[5] = a[5] - b[5] - dst[6] = a[6] - b[6] - dst[7] = a[7] - b[7] - dst[8] = a[8] - b[8] - dst[9] = a[9] - b[9] -} - -func FeCopy(dst, src *FieldElement) { - copy(dst[:], src[:]) -} - -// Replace (f,g) with (g,g) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -func FeCMove(f, g *FieldElement, b int32) { - b = -b - f[0] ^= b & (f[0] ^ g[0]) - f[1] ^= b & (f[1] ^ g[1]) - f[2] ^= b & (f[2] ^ g[2]) - f[3] ^= b & (f[3] ^ g[3]) - f[4] ^= b & (f[4] ^ g[4]) - f[5] ^= b & (f[5] ^ g[5]) - f[6] ^= b & (f[6] ^ g[6]) - f[7] ^= b & (f[7] ^ g[7]) - f[8] ^= b & (f[8] ^ g[8]) - f[9] ^= b & (f[9] ^ g[9]) -} - -func load3(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - return r -} - -func load4(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - r |= int64(in[3]) << 24 - return r -} - -func FeFromBytes(dst *FieldElement, src *[32]byte) { - h0 := load4(src[:]) - h1 := load3(src[4:]) << 6 - h2 := load3(src[7:]) << 5 - h3 := load3(src[10:]) << 3 - h4 := load3(src[13:]) << 2 - h5 := load4(src[16:]) - h6 := load3(src[20:]) << 7 - h7 := load3(src[23:]) << 5 - h8 := load3(src[26:]) << 4 - h9 := (load3(src[29:]) & 8388607) << 2 - - FeCombine(dst, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -// FeToBytes marshals h to s. -// Preconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Write p=2^255-19; q=floor(h/p). -// Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). -// -// Proof: -// Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. -// Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4. -// -// Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). -// Then 0> 25 - q = (h[0] + q) >> 26 - q = (h[1] + q) >> 25 - q = (h[2] + q) >> 26 - q = (h[3] + q) >> 25 - q = (h[4] + q) >> 26 - q = (h[5] + q) >> 25 - q = (h[6] + q) >> 26 - q = (h[7] + q) >> 25 - q = (h[8] + q) >> 26 - q = (h[9] + q) >> 25 - - // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. - h[0] += 19 * q - // Goal: Output h-2^255 q, which is between 0 and 2^255-20. - - carry[0] = h[0] >> 26 - h[1] += carry[0] - h[0] -= carry[0] << 26 - carry[1] = h[1] >> 25 - h[2] += carry[1] - h[1] -= carry[1] << 25 - carry[2] = h[2] >> 26 - h[3] += carry[2] - h[2] -= carry[2] << 26 - carry[3] = h[3] >> 25 - h[4] += carry[3] - h[3] -= carry[3] << 25 - carry[4] = h[4] >> 26 - h[5] += carry[4] - h[4] -= carry[4] << 26 - carry[5] = h[5] >> 25 - h[6] += carry[5] - h[5] -= carry[5] << 25 - carry[6] = h[6] >> 26 - h[7] += carry[6] - h[6] -= carry[6] << 26 - carry[7] = h[7] >> 25 - h[8] += carry[7] - h[7] -= carry[7] << 25 - carry[8] = h[8] >> 26 - h[9] += carry[8] - h[8] -= carry[8] << 26 - carry[9] = h[9] >> 25 - h[9] -= carry[9] << 25 - // h10 = carry9 - - // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. - // Have h[0]+...+2^230 h[9] between 0 and 2^255-1; - // evidently 2^255 h10-2^255 q = 0. - // Goal: Output h[0]+...+2^230 h[9]. - - s[0] = byte(h[0] >> 0) - s[1] = byte(h[0] >> 8) - s[2] = byte(h[0] >> 16) - s[3] = byte((h[0] >> 24) | (h[1] << 2)) - s[4] = byte(h[1] >> 6) - s[5] = byte(h[1] >> 14) - s[6] = byte((h[1] >> 22) | (h[2] << 3)) - s[7] = byte(h[2] >> 5) - s[8] = byte(h[2] >> 13) - s[9] = byte((h[2] >> 21) | (h[3] << 5)) - s[10] = byte(h[3] >> 3) - s[11] = byte(h[3] >> 11) - s[12] = byte((h[3] >> 19) | (h[4] << 6)) - s[13] = byte(h[4] >> 2) - s[14] = byte(h[4] >> 10) - s[15] = byte(h[4] >> 18) - s[16] = byte(h[5] >> 0) - s[17] = byte(h[5] >> 8) - s[18] = byte(h[5] >> 16) - s[19] = byte((h[5] >> 24) | (h[6] << 1)) - s[20] = byte(h[6] >> 7) - s[21] = byte(h[6] >> 15) - s[22] = byte((h[6] >> 23) | (h[7] << 3)) - s[23] = byte(h[7] >> 5) - s[24] = byte(h[7] >> 13) - s[25] = byte((h[7] >> 21) | (h[8] << 4)) - s[26] = byte(h[8] >> 4) - s[27] = byte(h[8] >> 12) - s[28] = byte((h[8] >> 20) | (h[9] << 6)) - s[29] = byte(h[9] >> 2) - s[30] = byte(h[9] >> 10) - s[31] = byte(h[9] >> 18) -} - -func FeIsNegative(f *FieldElement) byte { - var s [32]byte - FeToBytes(&s, f) - return s[0] & 1 -} - -func FeIsNonZero(f *FieldElement) int32 { - var s [32]byte - FeToBytes(&s, f) - var x uint8 - for _, b := range s { - x |= b - } - x |= x >> 4 - x |= x >> 2 - x |= x >> 1 - return int32(x & 1) -} - -// FeNeg sets h = -f -// -// Preconditions: -// |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func FeNeg(h, f *FieldElement) { - h[0] = -f[0] - h[1] = -f[1] - h[2] = -f[2] - h[3] = -f[3] - h[4] = -f[4] - h[5] = -f[5] - h[6] = -f[6] - h[7] = -f[7] - h[8] = -f[8] - h[9] = -f[9] -} - -func FeCombine(h *FieldElement, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { - var c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 int64 - - /* - |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38)) - i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8 - |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19)) - i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9 - */ - - c0 = (h0 + (1 << 25)) >> 26 - h1 += c0 - h0 -= c0 << 26 - c4 = (h4 + (1 << 25)) >> 26 - h5 += c4 - h4 -= c4 << 26 - /* |h0| <= 2^25 */ - /* |h4| <= 2^25 */ - /* |h1| <= 1.51*2^58 */ - /* |h5| <= 1.51*2^58 */ - - c1 = (h1 + (1 << 24)) >> 25 - h2 += c1 - h1 -= c1 << 25 - c5 = (h5 + (1 << 24)) >> 25 - h6 += c5 - h5 -= c5 << 25 - /* |h1| <= 2^24; from now on fits into int32 */ - /* |h5| <= 2^24; from now on fits into int32 */ - /* |h2| <= 1.21*2^59 */ - /* |h6| <= 1.21*2^59 */ - - c2 = (h2 + (1 << 25)) >> 26 - h3 += c2 - h2 -= c2 << 26 - c6 = (h6 + (1 << 25)) >> 26 - h7 += c6 - h6 -= c6 << 26 - /* |h2| <= 2^25; from now on fits into int32 unchanged */ - /* |h6| <= 2^25; from now on fits into int32 unchanged */ - /* |h3| <= 1.51*2^58 */ - /* |h7| <= 1.51*2^58 */ - - c3 = (h3 + (1 << 24)) >> 25 - h4 += c3 - h3 -= c3 << 25 - c7 = (h7 + (1 << 24)) >> 25 - h8 += c7 - h7 -= c7 << 25 - /* |h3| <= 2^24; from now on fits into int32 unchanged */ - /* |h7| <= 2^24; from now on fits into int32 unchanged */ - /* |h4| <= 1.52*2^33 */ - /* |h8| <= 1.52*2^33 */ - - c4 = (h4 + (1 << 25)) >> 26 - h5 += c4 - h4 -= c4 << 26 - c8 = (h8 + (1 << 25)) >> 26 - h9 += c8 - h8 -= c8 << 26 - /* |h4| <= 2^25; from now on fits into int32 unchanged */ - /* |h8| <= 2^25; from now on fits into int32 unchanged */ - /* |h5| <= 1.01*2^24 */ - /* |h9| <= 1.51*2^58 */ - - c9 = (h9 + (1 << 24)) >> 25 - h0 += c9 * 19 - h9 -= c9 << 25 - /* |h9| <= 2^24; from now on fits into int32 unchanged */ - /* |h0| <= 1.8*2^37 */ - - c0 = (h0 + (1 << 25)) >> 26 - h1 += c0 - h0 -= c0 << 26 - /* |h0| <= 2^25; from now on fits into int32 unchanged */ - /* |h1| <= 1.01*2^24 */ - - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) -} - -// FeMul calculates h = f * g -// Can overlap h with f or g. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Notes on implementation strategy: -// -// Using schoolbook multiplication. -// Karatsuba would save a little in some cost models. -// -// Most multiplications by 2 and 19 are 32-bit precomputations; -// cheaper than 64-bit postcomputations. -// -// There is one remaining multiplication by 19 in the carry chain; -// one *19 precomputation can be merged into this, -// but the resulting data flow is considerably less clean. -// -// There are 12 carries below. -// 10 of them are 2-way parallelizable and vectorizable. -// Can get away with 11 carries, but then data flow is much deeper. -// -// With tighter constraints on inputs can squeeze carries into int32. -func FeMul(h, f, g *FieldElement) { - f0 := int64(f[0]) - f1 := int64(f[1]) - f2 := int64(f[2]) - f3 := int64(f[3]) - f4 := int64(f[4]) - f5 := int64(f[5]) - f6 := int64(f[6]) - f7 := int64(f[7]) - f8 := int64(f[8]) - f9 := int64(f[9]) - - f1_2 := int64(2 * f[1]) - f3_2 := int64(2 * f[3]) - f5_2 := int64(2 * f[5]) - f7_2 := int64(2 * f[7]) - f9_2 := int64(2 * f[9]) - - g0 := int64(g[0]) - g1 := int64(g[1]) - g2 := int64(g[2]) - g3 := int64(g[3]) - g4 := int64(g[4]) - g5 := int64(g[5]) - g6 := int64(g[6]) - g7 := int64(g[7]) - g8 := int64(g[8]) - g9 := int64(g[9]) - - g1_19 := int64(19 * g[1]) /* 1.4*2^29 */ - g2_19 := int64(19 * g[2]) /* 1.4*2^30; still ok */ - g3_19 := int64(19 * g[3]) - g4_19 := int64(19 * g[4]) - g5_19 := int64(19 * g[5]) - g6_19 := int64(19 * g[6]) - g7_19 := int64(19 * g[7]) - g8_19 := int64(19 * g[8]) - g9_19 := int64(19 * g[9]) - - h0 := f0*g0 + f1_2*g9_19 + f2*g8_19 + f3_2*g7_19 + f4*g6_19 + f5_2*g5_19 + f6*g4_19 + f7_2*g3_19 + f8*g2_19 + f9_2*g1_19 - h1 := f0*g1 + f1*g0 + f2*g9_19 + f3*g8_19 + f4*g7_19 + f5*g6_19 + f6*g5_19 + f7*g4_19 + f8*g3_19 + f9*g2_19 - h2 := f0*g2 + f1_2*g1 + f2*g0 + f3_2*g9_19 + f4*g8_19 + f5_2*g7_19 + f6*g6_19 + f7_2*g5_19 + f8*g4_19 + f9_2*g3_19 - h3 := f0*g3 + f1*g2 + f2*g1 + f3*g0 + f4*g9_19 + f5*g8_19 + f6*g7_19 + f7*g6_19 + f8*g5_19 + f9*g4_19 - h4 := f0*g4 + f1_2*g3 + f2*g2 + f3_2*g1 + f4*g0 + f5_2*g9_19 + f6*g8_19 + f7_2*g7_19 + f8*g6_19 + f9_2*g5_19 - h5 := f0*g5 + f1*g4 + f2*g3 + f3*g2 + f4*g1 + f5*g0 + f6*g9_19 + f7*g8_19 + f8*g7_19 + f9*g6_19 - h6 := f0*g6 + f1_2*g5 + f2*g4 + f3_2*g3 + f4*g2 + f5_2*g1 + f6*g0 + f7_2*g9_19 + f8*g8_19 + f9_2*g7_19 - h7 := f0*g7 + f1*g6 + f2*g5 + f3*g4 + f4*g3 + f5*g2 + f6*g1 + f7*g0 + f8*g9_19 + f9*g8_19 - h8 := f0*g8 + f1_2*g7 + f2*g6 + f3_2*g5 + f4*g4 + f5_2*g3 + f6*g2 + f7_2*g1 + f8*g0 + f9_2*g9_19 - h9 := f0*g9 + f1*g8 + f2*g7 + f3*g6 + f4*g5 + f5*g4 + f6*g3 + f7*g2 + f8*g1 + f9*g0 - - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -func feSquare(f *FieldElement) (h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { - f0 := int64(f[0]) - f1 := int64(f[1]) - f2 := int64(f[2]) - f3 := int64(f[3]) - f4 := int64(f[4]) - f5 := int64(f[5]) - f6 := int64(f[6]) - f7 := int64(f[7]) - f8 := int64(f[8]) - f9 := int64(f[9]) - f0_2 := int64(2 * f[0]) - f1_2 := int64(2 * f[1]) - f2_2 := int64(2 * f[2]) - f3_2 := int64(2 * f[3]) - f4_2 := int64(2 * f[4]) - f5_2 := int64(2 * f[5]) - f6_2 := int64(2 * f[6]) - f7_2 := int64(2 * f[7]) - f5_38 := 38 * f5 // 1.31*2^30 - f6_19 := 19 * f6 // 1.31*2^30 - f7_38 := 38 * f7 // 1.31*2^30 - f8_19 := 19 * f8 // 1.31*2^30 - f9_38 := 38 * f9 // 1.31*2^30 - - h0 = f0*f0 + f1_2*f9_38 + f2_2*f8_19 + f3_2*f7_38 + f4_2*f6_19 + f5*f5_38 - h1 = f0_2*f1 + f2*f9_38 + f3_2*f8_19 + f4*f7_38 + f5_2*f6_19 - h2 = f0_2*f2 + f1_2*f1 + f3_2*f9_38 + f4_2*f8_19 + f5_2*f7_38 + f6*f6_19 - h3 = f0_2*f3 + f1_2*f2 + f4*f9_38 + f5_2*f8_19 + f6*f7_38 - h4 = f0_2*f4 + f1_2*f3_2 + f2*f2 + f5_2*f9_38 + f6_2*f8_19 + f7*f7_38 - h5 = f0_2*f5 + f1_2*f4 + f2_2*f3 + f6*f9_38 + f7_2*f8_19 - h6 = f0_2*f6 + f1_2*f5_2 + f2_2*f4 + f3_2*f3 + f7_2*f9_38 + f8*f8_19 - h7 = f0_2*f7 + f1_2*f6 + f2_2*f5 + f3_2*f4 + f8*f9_38 - h8 = f0_2*f8 + f1_2*f7_2 + f2_2*f6 + f3_2*f5_2 + f4*f4 + f9*f9_38 - h9 = f0_2*f9 + f1_2*f8 + f2_2*f7 + f3_2*f6 + f4_2*f5 - - return -} - -// FeSquare calculates h = f*f. Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func FeSquare(h, f *FieldElement) { - h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 := feSquare(f) - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -// FeSquare2 sets h = 2 * f * f -// -// Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc. -// See fe_mul.c for discussion of implementation strategy. -func FeSquare2(h, f *FieldElement) { - h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 := feSquare(f) - - h0 += h0 - h1 += h1 - h2 += h2 - h3 += h3 - h4 += h4 - h5 += h5 - h6 += h6 - h7 += h7 - h8 += h8 - h9 += h9 - - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -func FeInvert(out, z *FieldElement) { - var t0, t1, t2, t3 FieldElement - var i int - - FeSquare(&t0, z) // 2^1 - FeSquare(&t1, &t0) // 2^2 - for i = 1; i < 2; i++ { // 2^3 - FeSquare(&t1, &t1) - } - FeMul(&t1, z, &t1) // 2^3 + 2^0 - FeMul(&t0, &t0, &t1) // 2^3 + 2^1 + 2^0 - FeSquare(&t2, &t0) // 2^4 + 2^2 + 2^1 - FeMul(&t1, &t1, &t2) // 2^4 + 2^3 + 2^2 + 2^1 + 2^0 - FeSquare(&t2, &t1) // 5,4,3,2,1 - for i = 1; i < 5; i++ { // 9,8,7,6,5 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 9,8,7,6,5,4,3,2,1,0 - FeSquare(&t2, &t1) // 10..1 - for i = 1; i < 10; i++ { // 19..10 - FeSquare(&t2, &t2) - } - FeMul(&t2, &t2, &t1) // 19..0 - FeSquare(&t3, &t2) // 20..1 - for i = 1; i < 20; i++ { // 39..20 - FeSquare(&t3, &t3) - } - FeMul(&t2, &t3, &t2) // 39..0 - FeSquare(&t2, &t2) // 40..1 - for i = 1; i < 10; i++ { // 49..10 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 49..0 - FeSquare(&t2, &t1) // 50..1 - for i = 1; i < 50; i++ { // 99..50 - FeSquare(&t2, &t2) - } - FeMul(&t2, &t2, &t1) // 99..0 - FeSquare(&t3, &t2) // 100..1 - for i = 1; i < 100; i++ { // 199..100 - FeSquare(&t3, &t3) - } - FeMul(&t2, &t3, &t2) // 199..0 - FeSquare(&t2, &t2) // 200..1 - for i = 1; i < 50; i++ { // 249..50 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 249..0 - FeSquare(&t1, &t1) // 250..1 - for i = 1; i < 5; i++ { // 254..5 - FeSquare(&t1, &t1) - } - FeMul(out, &t1, &t0) // 254..5,3,1,0 -} - -func fePow22523(out, z *FieldElement) { - var t0, t1, t2 FieldElement - var i int - - FeSquare(&t0, z) - for i = 1; i < 1; i++ { - FeSquare(&t0, &t0) - } - FeSquare(&t1, &t0) - for i = 1; i < 2; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, z, &t1) - FeMul(&t0, &t0, &t1) - FeSquare(&t0, &t0) - for i = 1; i < 1; i++ { - FeSquare(&t0, &t0) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 5; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 10; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, &t1, &t0) - FeSquare(&t2, &t1) - for i = 1; i < 20; i++ { - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) - FeSquare(&t1, &t1) - for i = 1; i < 10; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 50; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, &t1, &t0) - FeSquare(&t2, &t1) - for i = 1; i < 100; i++ { - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) - FeSquare(&t1, &t1) - for i = 1; i < 50; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t0, &t0) - for i = 1; i < 2; i++ { - FeSquare(&t0, &t0) - } - FeMul(out, &t0, z) -} - -// Group elements are members of the elliptic curve -x^2 + y^2 = 1 + d * x^2 * -// y^2 where d = -121665/121666. -// -// Several representations are used: -// ProjectiveGroupElement: (X:Y:Z) satisfying x=X/Z, y=Y/Z -// ExtendedGroupElement: (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT -// CompletedGroupElement: ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T -// PreComputedGroupElement: (y+x,y-x,2dxy) - -type ProjectiveGroupElement struct { - X, Y, Z FieldElement -} - -type ExtendedGroupElement struct { - X, Y, Z, T FieldElement -} - -type CompletedGroupElement struct { - X, Y, Z, T FieldElement -} - -type PreComputedGroupElement struct { - yPlusX, yMinusX, xy2d FieldElement -} - -type CachedGroupElement struct { - yPlusX, yMinusX, Z, T2d FieldElement -} - -func (p *ProjectiveGroupElement) Zero() { - FeZero(&p.X) - FeOne(&p.Y) - FeOne(&p.Z) -} - -func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) { - var t0 FieldElement - - FeSquare(&r.X, &p.X) - FeSquare(&r.Z, &p.Y) - FeSquare2(&r.T, &p.Z) - FeAdd(&r.Y, &p.X, &p.Y) - FeSquare(&t0, &r.Y) - FeAdd(&r.Y, &r.Z, &r.X) - FeSub(&r.Z, &r.Z, &r.X) - FeSub(&r.X, &t0, &r.Y) - FeSub(&r.T, &r.T, &r.Z) -} - -func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) { - var recip, x, y FieldElement - - FeInvert(&recip, &p.Z) - FeMul(&x, &p.X, &recip) - FeMul(&y, &p.Y, &recip) - FeToBytes(s, &y) - s[31] ^= FeIsNegative(&x) << 7 -} - -func (p *ExtendedGroupElement) Zero() { - FeZero(&p.X) - FeOne(&p.Y) - FeOne(&p.Z) - FeZero(&p.T) -} - -func (p *ExtendedGroupElement) Double(r *CompletedGroupElement) { - var q ProjectiveGroupElement - p.ToProjective(&q) - q.Double(r) -} - -func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) { - FeAdd(&r.yPlusX, &p.Y, &p.X) - FeSub(&r.yMinusX, &p.Y, &p.X) - FeCopy(&r.Z, &p.Z) - FeMul(&r.T2d, &p.T, &d2) -} - -func (p *ExtendedGroupElement) ToProjective(r *ProjectiveGroupElement) { - FeCopy(&r.X, &p.X) - FeCopy(&r.Y, &p.Y) - FeCopy(&r.Z, &p.Z) -} - -func (p *ExtendedGroupElement) ToBytes(s *[32]byte) { - var recip, x, y FieldElement - - FeInvert(&recip, &p.Z) - FeMul(&x, &p.X, &recip) - FeMul(&y, &p.Y, &recip) - FeToBytes(s, &y) - s[31] ^= FeIsNegative(&x) << 7 -} - -func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool { - var u, v, v3, vxx, check FieldElement - - FeFromBytes(&p.Y, s) - FeOne(&p.Z) - FeSquare(&u, &p.Y) - FeMul(&v, &u, &d) - FeSub(&u, &u, &p.Z) // y = y^2-1 - FeAdd(&v, &v, &p.Z) // v = dy^2+1 - - FeSquare(&v3, &v) - FeMul(&v3, &v3, &v) // v3 = v^3 - FeSquare(&p.X, &v3) - FeMul(&p.X, &p.X, &v) - FeMul(&p.X, &p.X, &u) // x = uv^7 - - fePow22523(&p.X, &p.X) // x = (uv^7)^((q-5)/8) - FeMul(&p.X, &p.X, &v3) - FeMul(&p.X, &p.X, &u) // x = uv^3(uv^7)^((q-5)/8) - - var tmpX, tmp2 [32]byte - - FeSquare(&vxx, &p.X) - FeMul(&vxx, &vxx, &v) - FeSub(&check, &vxx, &u) // vx^2-u - if FeIsNonZero(&check) == 1 { - FeAdd(&check, &vxx, &u) // vx^2+u - if FeIsNonZero(&check) == 1 { - return false - } - FeMul(&p.X, &p.X, &SqrtM1) - - FeToBytes(&tmpX, &p.X) - for i, v := range tmpX { - tmp2[31-i] = v - } - } - - if FeIsNegative(&p.X) != (s[31] >> 7) { - FeNeg(&p.X, &p.X) - } - - FeMul(&p.T, &p.X, &p.Y) - return true -} - -func (p *CompletedGroupElement) ToProjective(r *ProjectiveGroupElement) { - FeMul(&r.X, &p.X, &p.T) - FeMul(&r.Y, &p.Y, &p.Z) - FeMul(&r.Z, &p.Z, &p.T) -} - -func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) { - FeMul(&r.X, &p.X, &p.T) - FeMul(&r.Y, &p.Y, &p.Z) - FeMul(&r.Z, &p.Z, &p.T) - FeMul(&r.T, &p.X, &p.Y) -} - -func (p *PreComputedGroupElement) Zero() { - FeOne(&p.yPlusX) - FeOne(&p.yMinusX) - FeZero(&p.xy2d) -} - -func geAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yPlusX) - FeMul(&r.Y, &r.Y, &q.yMinusX) - FeMul(&r.T, &q.T2d, &p.T) - FeMul(&r.X, &p.Z, &q.Z) - FeAdd(&t0, &r.X, &r.X) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeAdd(&r.Z, &t0, &r.T) - FeSub(&r.T, &t0, &r.T) -} - -func geSub(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yMinusX) - FeMul(&r.Y, &r.Y, &q.yPlusX) - FeMul(&r.T, &q.T2d, &p.T) - FeMul(&r.X, &p.Z, &q.Z) - FeAdd(&t0, &r.X, &r.X) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeSub(&r.Z, &t0, &r.T) - FeAdd(&r.T, &t0, &r.T) -} - -func geMixedAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *PreComputedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yPlusX) - FeMul(&r.Y, &r.Y, &q.yMinusX) - FeMul(&r.T, &q.xy2d, &p.T) - FeAdd(&t0, &p.Z, &p.Z) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeAdd(&r.Z, &t0, &r.T) - FeSub(&r.T, &t0, &r.T) -} - -func geMixedSub(r *CompletedGroupElement, p *ExtendedGroupElement, q *PreComputedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yMinusX) - FeMul(&r.Y, &r.Y, &q.yPlusX) - FeMul(&r.T, &q.xy2d, &p.T) - FeAdd(&t0, &p.Z, &p.Z) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeSub(&r.Z, &t0, &r.T) - FeAdd(&r.T, &t0, &r.T) -} - -func slide(r *[256]int8, a *[32]byte) { - for i := range r { - r[i] = int8(1 & (a[i>>3] >> uint(i&7))) - } - - for i := range r { - if r[i] != 0 { - for b := 1; b <= 6 && i+b < 256; b++ { - if r[i+b] != 0 { - if r[i]+(r[i+b]<= -15 { - r[i] -= r[i+b] << uint(b) - for k := i + b; k < 256; k++ { - if r[k] == 0 { - r[k] = 1 - break - } - r[k] = 0 - } - } else { - break - } - } - } - } - } -} - -// GeDoubleScalarMultVartime sets r = a*A + b*B -// where a = a[0]+256*a[1]+...+256^31 a[31]. -// and b = b[0]+256*b[1]+...+256^31 b[31]. -// B is the Ed25519 base point (x,4/5) with x positive. -func GeDoubleScalarMultVartime(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement, b *[32]byte) { - var aSlide, bSlide [256]int8 - var Ai [8]CachedGroupElement // A,3A,5A,7A,9A,11A,13A,15A - var t CompletedGroupElement - var u, A2 ExtendedGroupElement - var i int - - slide(&aSlide, a) - slide(&bSlide, b) - - A.ToCached(&Ai[0]) - A.Double(&t) - t.ToExtended(&A2) - - for i := 0; i < 7; i++ { - geAdd(&t, &A2, &Ai[i]) - t.ToExtended(&u) - u.ToCached(&Ai[i+1]) - } - - r.Zero() - - for i = 255; i >= 0; i-- { - if aSlide[i] != 0 || bSlide[i] != 0 { - break - } - } - - for ; i >= 0; i-- { - r.Double(&t) - - if aSlide[i] > 0 { - t.ToExtended(&u) - geAdd(&t, &u, &Ai[aSlide[i]/2]) - } else if aSlide[i] < 0 { - t.ToExtended(&u) - geSub(&t, &u, &Ai[(-aSlide[i])/2]) - } - - if bSlide[i] > 0 { - t.ToExtended(&u) - geMixedAdd(&t, &u, &bi[bSlide[i]/2]) - } else if bSlide[i] < 0 { - t.ToExtended(&u) - geMixedSub(&t, &u, &bi[(-bSlide[i])/2]) - } - - t.ToProjective(r) - } -} - -// equal returns 1 if b == c and 0 otherwise. -func equal(b, c int32) int32 { - x := uint32(b ^ c) - x-- - return int32(x >> 31) -} - -// negative returns 1 if b < 0 and 0 otherwise. -func negative(b int32) int32 { - return (b >> 31) & 1 -} - -func PreComputedGroupElementCMove(t, u *PreComputedGroupElement, b int32) { - FeCMove(&t.yPlusX, &u.yPlusX, b) - FeCMove(&t.yMinusX, &u.yMinusX, b) - FeCMove(&t.xy2d, &u.xy2d, b) -} - -func selectPoint(t *PreComputedGroupElement, pos int32, b int32) { - var minusT PreComputedGroupElement - bNegative := negative(b) - bAbs := b - (((-bNegative) & b) << 1) - - t.Zero() - for i := int32(0); i < 8; i++ { - PreComputedGroupElementCMove(t, &base[pos][i], equal(bAbs, i+1)) - } - FeCopy(&minusT.yPlusX, &t.yMinusX) - FeCopy(&minusT.yMinusX, &t.yPlusX) - FeNeg(&minusT.xy2d, &t.xy2d) - PreComputedGroupElementCMove(t, &minusT, bNegative) -} - -// GeScalarMultBase computes h = a*B, where -// a = a[0]+256*a[1]+...+256^31 a[31] -// B is the Ed25519 base point (x,4/5) with x positive. -// -// Preconditions: -// a[31] <= 127 -func GeScalarMultBase(h *ExtendedGroupElement, a *[32]byte) { - var e [64]int8 - - for i, v := range a { - e[2*i] = int8(v & 15) - e[2*i+1] = int8((v >> 4) & 15) - } - - // each e[i] is between 0 and 15 and e[63] is between 0 and 7. - - carry := int8(0) - for i := 0; i < 63; i++ { - e[i] += carry - carry = (e[i] + 8) >> 4 - e[i] -= carry << 4 - } - e[63] += carry - // each e[i] is between -8 and 8. - - h.Zero() - var t PreComputedGroupElement - var r CompletedGroupElement - for i := int32(1); i < 64; i += 2 { - selectPoint(&t, i/2, int32(e[i])) - geMixedAdd(&r, h, &t) - r.ToExtended(h) - } - - var s ProjectiveGroupElement - - h.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToExtended(h) - - for i := int32(0); i < 64; i += 2 { - selectPoint(&t, i/2, int32(e[i])) - geMixedAdd(&r, h, &t) - r.ToExtended(h) - } -} - -// The scalars are GF(2^252 + 27742317777372353535851937790883648493). - -// Input: -// a[0]+256*a[1]+...+256^31*a[31] = a -// b[0]+256*b[1]+...+256^31*b[31] = b -// c[0]+256*c[1]+...+256^31*c[31] = c -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -func ScMulAdd(s, a, b, c *[32]byte) { - a0 := 2097151 & load3(a[:]) - a1 := 2097151 & (load4(a[2:]) >> 5) - a2 := 2097151 & (load3(a[5:]) >> 2) - a3 := 2097151 & (load4(a[7:]) >> 7) - a4 := 2097151 & (load4(a[10:]) >> 4) - a5 := 2097151 & (load3(a[13:]) >> 1) - a6 := 2097151 & (load4(a[15:]) >> 6) - a7 := 2097151 & (load3(a[18:]) >> 3) - a8 := 2097151 & load3(a[21:]) - a9 := 2097151 & (load4(a[23:]) >> 5) - a10 := 2097151 & (load3(a[26:]) >> 2) - a11 := (load4(a[28:]) >> 7) - b0 := 2097151 & load3(b[:]) - b1 := 2097151 & (load4(b[2:]) >> 5) - b2 := 2097151 & (load3(b[5:]) >> 2) - b3 := 2097151 & (load4(b[7:]) >> 7) - b4 := 2097151 & (load4(b[10:]) >> 4) - b5 := 2097151 & (load3(b[13:]) >> 1) - b6 := 2097151 & (load4(b[15:]) >> 6) - b7 := 2097151 & (load3(b[18:]) >> 3) - b8 := 2097151 & load3(b[21:]) - b9 := 2097151 & (load4(b[23:]) >> 5) - b10 := 2097151 & (load3(b[26:]) >> 2) - b11 := (load4(b[28:]) >> 7) - c0 := 2097151 & load3(c[:]) - c1 := 2097151 & (load4(c[2:]) >> 5) - c2 := 2097151 & (load3(c[5:]) >> 2) - c3 := 2097151 & (load4(c[7:]) >> 7) - c4 := 2097151 & (load4(c[10:]) >> 4) - c5 := 2097151 & (load3(c[13:]) >> 1) - c6 := 2097151 & (load4(c[15:]) >> 6) - c7 := 2097151 & (load3(c[18:]) >> 3) - c8 := 2097151 & load3(c[21:]) - c9 := 2097151 & (load4(c[23:]) >> 5) - c10 := 2097151 & (load3(c[26:]) >> 2) - c11 := (load4(c[28:]) >> 7) - var carry [23]int64 - - s0 := c0 + a0*b0 - s1 := c1 + a0*b1 + a1*b0 - s2 := c2 + a0*b2 + a1*b1 + a2*b0 - s3 := c3 + a0*b3 + a1*b2 + a2*b1 + a3*b0 - s4 := c4 + a0*b4 + a1*b3 + a2*b2 + a3*b1 + a4*b0 - s5 := c5 + a0*b5 + a1*b4 + a2*b3 + a3*b2 + a4*b1 + a5*b0 - s6 := c6 + a0*b6 + a1*b5 + a2*b4 + a3*b3 + a4*b2 + a5*b1 + a6*b0 - s7 := c7 + a0*b7 + a1*b6 + a2*b5 + a3*b4 + a4*b3 + a5*b2 + a6*b1 + a7*b0 - s8 := c8 + a0*b8 + a1*b7 + a2*b6 + a3*b5 + a4*b4 + a5*b3 + a6*b2 + a7*b1 + a8*b0 - s9 := c9 + a0*b9 + a1*b8 + a2*b7 + a3*b6 + a4*b5 + a5*b4 + a6*b3 + a7*b2 + a8*b1 + a9*b0 - s10 := c10 + a0*b10 + a1*b9 + a2*b8 + a3*b7 + a4*b6 + a5*b5 + a6*b4 + a7*b3 + a8*b2 + a9*b1 + a10*b0 - s11 := c11 + a0*b11 + a1*b10 + a2*b9 + a3*b8 + a4*b7 + a5*b6 + a6*b5 + a7*b4 + a8*b3 + a9*b2 + a10*b1 + a11*b0 - s12 := a1*b11 + a2*b10 + a3*b9 + a4*b8 + a5*b7 + a6*b6 + a7*b5 + a8*b4 + a9*b3 + a10*b2 + a11*b1 - s13 := a2*b11 + a3*b10 + a4*b9 + a5*b8 + a6*b7 + a7*b6 + a8*b5 + a9*b4 + a10*b3 + a11*b2 - s14 := a3*b11 + a4*b10 + a5*b9 + a6*b8 + a7*b7 + a8*b6 + a9*b5 + a10*b4 + a11*b3 - s15 := a4*b11 + a5*b10 + a6*b9 + a7*b8 + a8*b7 + a9*b6 + a10*b5 + a11*b4 - s16 := a5*b11 + a6*b10 + a7*b9 + a8*b8 + a9*b7 + a10*b6 + a11*b5 - s17 := a6*b11 + a7*b10 + a8*b9 + a9*b8 + a10*b7 + a11*b6 - s18 := a7*b11 + a8*b10 + a9*b9 + a10*b8 + a11*b7 - s19 := a8*b11 + a9*b10 + a10*b9 + a11*b8 - s20 := a9*b11 + a10*b10 + a11*b9 - s21 := a10*b11 + a11*b10 - s22 := a11 * b11 - s23 := int64(0) - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - carry[18] = (s18 + (1 << 20)) >> 21 - s19 += carry[18] - s18 -= carry[18] << 21 - carry[20] = (s20 + (1 << 20)) >> 21 - s21 += carry[20] - s20 -= carry[20] << 21 - carry[22] = (s22 + (1 << 20)) >> 21 - s23 += carry[22] - s22 -= carry[22] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - carry[17] = (s17 + (1 << 20)) >> 21 - s18 += carry[17] - s17 -= carry[17] << 21 - carry[19] = (s19 + (1 << 20)) >> 21 - s20 += carry[19] - s19 -= carry[19] << 21 - carry[21] = (s21 + (1 << 20)) >> 21 - s22 += carry[21] - s21 -= carry[21] << 21 - - s11 += s23 * 666643 - s12 += s23 * 470296 - s13 += s23 * 654183 - s14 -= s23 * 997805 - s15 += s23 * 136657 - s16 -= s23 * 683901 - s23 = 0 - - s10 += s22 * 666643 - s11 += s22 * 470296 - s12 += s22 * 654183 - s13 -= s22 * 997805 - s14 += s22 * 136657 - s15 -= s22 * 683901 - s22 = 0 - - s9 += s21 * 666643 - s10 += s21 * 470296 - s11 += s21 * 654183 - s12 -= s21 * 997805 - s13 += s21 * 136657 - s14 -= s21 * 683901 - s21 = 0 - - s8 += s20 * 666643 - s9 += s20 * 470296 - s10 += s20 * 654183 - s11 -= s20 * 997805 - s12 += s20 * 136657 - s13 -= s20 * 683901 - s20 = 0 - - s7 += s19 * 666643 - s8 += s19 * 470296 - s9 += s19 * 654183 - s10 -= s19 * 997805 - s11 += s19 * 136657 - s12 -= s19 * 683901 - s19 = 0 - - s6 += s18 * 666643 - s7 += s18 * 470296 - s8 += s18 * 654183 - s9 -= s18 * 997805 - s10 += s18 * 136657 - s11 -= s18 * 683901 - s18 = 0 - - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - - s5 += s17 * 666643 - s6 += s17 * 470296 - s7 += s17 * 654183 - s8 -= s17 * 997805 - s9 += s17 * 136657 - s10 -= s17 * 683901 - s17 = 0 - - s4 += s16 * 666643 - s5 += s16 * 470296 - s6 += s16 * 654183 - s7 -= s16 * 997805 - s8 += s16 * 136657 - s9 -= s16 * 683901 - s16 = 0 - - s3 += s15 * 666643 - s4 += s15 * 470296 - s5 += s15 * 654183 - s6 -= s15 * 997805 - s7 += s15 * 136657 - s8 -= s15 * 683901 - s15 = 0 - - s2 += s14 * 666643 - s3 += s14 * 470296 - s4 += s14 * 654183 - s5 -= s14 * 997805 - s6 += s14 * 136657 - s7 -= s14 * 683901 - s14 = 0 - - s1 += s13 * 666643 - s2 += s13 * 470296 - s3 += s13 * 654183 - s4 -= s13 * 997805 - s5 += s13 * 136657 - s6 -= s13 * 683901 - s13 = 0 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[11] = s11 >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - s[0] = byte(s0 >> 0) - s[1] = byte(s0 >> 8) - s[2] = byte((s0 >> 16) | (s1 << 5)) - s[3] = byte(s1 >> 3) - s[4] = byte(s1 >> 11) - s[5] = byte((s1 >> 19) | (s2 << 2)) - s[6] = byte(s2 >> 6) - s[7] = byte((s2 >> 14) | (s3 << 7)) - s[8] = byte(s3 >> 1) - s[9] = byte(s3 >> 9) - s[10] = byte((s3 >> 17) | (s4 << 4)) - s[11] = byte(s4 >> 4) - s[12] = byte(s4 >> 12) - s[13] = byte((s4 >> 20) | (s5 << 1)) - s[14] = byte(s5 >> 7) - s[15] = byte((s5 >> 15) | (s6 << 6)) - s[16] = byte(s6 >> 2) - s[17] = byte(s6 >> 10) - s[18] = byte((s6 >> 18) | (s7 << 3)) - s[19] = byte(s7 >> 5) - s[20] = byte(s7 >> 13) - s[21] = byte(s8 >> 0) - s[22] = byte(s8 >> 8) - s[23] = byte((s8 >> 16) | (s9 << 5)) - s[24] = byte(s9 >> 3) - s[25] = byte(s9 >> 11) - s[26] = byte((s9 >> 19) | (s10 << 2)) - s[27] = byte(s10 >> 6) - s[28] = byte((s10 >> 14) | (s11 << 7)) - s[29] = byte(s11 >> 1) - s[30] = byte(s11 >> 9) - s[31] = byte(s11 >> 17) -} - -// Input: -// s[0]+256*s[1]+...+256^63*s[63] = s -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = s mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -func ScReduce(out *[32]byte, s *[64]byte) { - s0 := 2097151 & load3(s[:]) - s1 := 2097151 & (load4(s[2:]) >> 5) - s2 := 2097151 & (load3(s[5:]) >> 2) - s3 := 2097151 & (load4(s[7:]) >> 7) - s4 := 2097151 & (load4(s[10:]) >> 4) - s5 := 2097151 & (load3(s[13:]) >> 1) - s6 := 2097151 & (load4(s[15:]) >> 6) - s7 := 2097151 & (load3(s[18:]) >> 3) - s8 := 2097151 & load3(s[21:]) - s9 := 2097151 & (load4(s[23:]) >> 5) - s10 := 2097151 & (load3(s[26:]) >> 2) - s11 := 2097151 & (load4(s[28:]) >> 7) - s12 := 2097151 & (load4(s[31:]) >> 4) - s13 := 2097151 & (load3(s[34:]) >> 1) - s14 := 2097151 & (load4(s[36:]) >> 6) - s15 := 2097151 & (load3(s[39:]) >> 3) - s16 := 2097151 & load3(s[42:]) - s17 := 2097151 & (load4(s[44:]) >> 5) - s18 := 2097151 & (load3(s[47:]) >> 2) - s19 := 2097151 & (load4(s[49:]) >> 7) - s20 := 2097151 & (load4(s[52:]) >> 4) - s21 := 2097151 & (load3(s[55:]) >> 1) - s22 := 2097151 & (load4(s[57:]) >> 6) - s23 := (load4(s[60:]) >> 3) - - s11 += s23 * 666643 - s12 += s23 * 470296 - s13 += s23 * 654183 - s14 -= s23 * 997805 - s15 += s23 * 136657 - s16 -= s23 * 683901 - s23 = 0 - - s10 += s22 * 666643 - s11 += s22 * 470296 - s12 += s22 * 654183 - s13 -= s22 * 997805 - s14 += s22 * 136657 - s15 -= s22 * 683901 - s22 = 0 - - s9 += s21 * 666643 - s10 += s21 * 470296 - s11 += s21 * 654183 - s12 -= s21 * 997805 - s13 += s21 * 136657 - s14 -= s21 * 683901 - s21 = 0 - - s8 += s20 * 666643 - s9 += s20 * 470296 - s10 += s20 * 654183 - s11 -= s20 * 997805 - s12 += s20 * 136657 - s13 -= s20 * 683901 - s20 = 0 - - s7 += s19 * 666643 - s8 += s19 * 470296 - s9 += s19 * 654183 - s10 -= s19 * 997805 - s11 += s19 * 136657 - s12 -= s19 * 683901 - s19 = 0 - - s6 += s18 * 666643 - s7 += s18 * 470296 - s8 += s18 * 654183 - s9 -= s18 * 997805 - s10 += s18 * 136657 - s11 -= s18 * 683901 - s18 = 0 - - var carry [17]int64 - - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - - s5 += s17 * 666643 - s6 += s17 * 470296 - s7 += s17 * 654183 - s8 -= s17 * 997805 - s9 += s17 * 136657 - s10 -= s17 * 683901 - s17 = 0 - - s4 += s16 * 666643 - s5 += s16 * 470296 - s6 += s16 * 654183 - s7 -= s16 * 997805 - s8 += s16 * 136657 - s9 -= s16 * 683901 - s16 = 0 - - s3 += s15 * 666643 - s4 += s15 * 470296 - s5 += s15 * 654183 - s6 -= s15 * 997805 - s7 += s15 * 136657 - s8 -= s15 * 683901 - s15 = 0 - - s2 += s14 * 666643 - s3 += s14 * 470296 - s4 += s14 * 654183 - s5 -= s14 * 997805 - s6 += s14 * 136657 - s7 -= s14 * 683901 - s14 = 0 - - s1 += s13 * 666643 - s2 += s13 * 470296 - s3 += s13 * 654183 - s4 -= s13 * 997805 - s5 += s13 * 136657 - s6 -= s13 * 683901 - s13 = 0 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[11] = s11 >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - out[0] = byte(s0 >> 0) - out[1] = byte(s0 >> 8) - out[2] = byte((s0 >> 16) | (s1 << 5)) - out[3] = byte(s1 >> 3) - out[4] = byte(s1 >> 11) - out[5] = byte((s1 >> 19) | (s2 << 2)) - out[6] = byte(s2 >> 6) - out[7] = byte((s2 >> 14) | (s3 << 7)) - out[8] = byte(s3 >> 1) - out[9] = byte(s3 >> 9) - out[10] = byte((s3 >> 17) | (s4 << 4)) - out[11] = byte(s4 >> 4) - out[12] = byte(s4 >> 12) - out[13] = byte((s4 >> 20) | (s5 << 1)) - out[14] = byte(s5 >> 7) - out[15] = byte((s5 >> 15) | (s6 << 6)) - out[16] = byte(s6 >> 2) - out[17] = byte(s6 >> 10) - out[18] = byte((s6 >> 18) | (s7 << 3)) - out[19] = byte(s7 >> 5) - out[20] = byte(s7 >> 13) - out[21] = byte(s8 >> 0) - out[22] = byte(s8 >> 8) - out[23] = byte((s8 >> 16) | (s9 << 5)) - out[24] = byte(s9 >> 3) - out[25] = byte(s9 >> 11) - out[26] = byte((s9 >> 19) | (s10 << 2)) - out[27] = byte(s10 >> 6) - out[28] = byte((s10 >> 14) | (s11 << 7)) - out[29] = byte(s11 >> 1) - out[30] = byte(s11 >> 9) - out[31] = byte(s11 >> 17) -} diff --git a/vendor/github.com/apparentlymart/go-cidr/cidr/cidr.go b/vendor/github.com/apparentlymart/go-cidr/cidr/cidr.go index 1583d63..7534473 100644 --- a/vendor/github.com/apparentlymart/go-cidr/cidr/cidr.go +++ b/vendor/github.com/apparentlymart/go-cidr/cidr/cidr.go @@ -61,11 +61,23 @@ func Host(base *net.IPNet, num int) (net.IP, error) { hostLen := addrLen - parentLen maxHostNum := uint64(1< maxHostNum { - return nil, fmt.Errorf("prefix of %d does not accommodate a host numbered %d", parentLen, num) + + numUint64 := uint64(num) + if num < 0 { + numUint64 = uint64(-num) - 1 + num = int(maxHostNum - numUint64) } - return insertNumIntoIP(ip, num, 32), nil + if numUint64 > maxHostNum { + return nil, fmt.Errorf("prefix of %d does not accommodate a host numbered %d", parentLen, num) + } + var bitlength int + if ip.To4() != nil { + bitlength = 32 + } else { + bitlength = 128 + } + return insertNumIntoIP(ip, num, bitlength), nil } // AddressRange returns the first and last addresses in the given CIDR range. @@ -103,3 +115,96 @@ func AddressCount(network *net.IPNet) uint64 { prefixLen, bits := network.Mask.Size() return 1 << (uint64(bits) - uint64(prefixLen)) } + +//VerifyNoOverlap takes a list subnets and supernet (CIDRBlock) and verifies +//none of the subnets overlap and all subnets are in the supernet +//it returns an error if any of those conditions are not satisfied +func VerifyNoOverlap(subnets []*net.IPNet, CIDRBlock *net.IPNet) error { + firstLastIP := make([][]net.IP, len(subnets)) + for i, s := range subnets { + first, last := AddressRange(s) + firstLastIP[i] = []net.IP{first, last} + } + for i, s := range subnets { + if !CIDRBlock.Contains(firstLastIP[i][0]) || !CIDRBlock.Contains(firstLastIP[i][1]) { + return fmt.Errorf("%s does not fully contain %s", CIDRBlock.String(), s.String()) + } + for j := i + 1; j < len(subnets); j++ { + first := firstLastIP[j][0] + last := firstLastIP[j][1] + if s.Contains(first) || s.Contains(last) { + return fmt.Errorf("%s overlaps with %s", subnets[j].String(), s.String()) + } + } + } + return nil +} + +// PreviousSubnet returns the subnet of the desired mask in the IP space +// just lower than the start of IPNet provided. If the IP space rolls over +// then the second return value is true +func PreviousSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) { + startIP := checkIPv4(network.IP) + previousIP := make(net.IP, len(startIP)) + copy(previousIP, startIP) + cMask := net.CIDRMask(prefixLen, 8*len(previousIP)) + previousIP = Dec(previousIP) + previous := &net.IPNet{IP: previousIP.Mask(cMask), Mask: cMask} + if startIP.Equal(net.IPv4zero) || startIP.Equal(net.IPv6zero) { + return previous, true + } + return previous, false +} + +// NextSubnet returns the next available subnet of the desired mask size +// starting for the maximum IP of the offset subnet +// If the IP exceeds the maxium IP then the second return value is true +func NextSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) { + _, currentLast := AddressRange(network) + mask := net.CIDRMask(prefixLen, 8*len(currentLast)) + currentSubnet := &net.IPNet{IP: currentLast.Mask(mask), Mask: mask} + _, last := AddressRange(currentSubnet) + last = Inc(last) + next := &net.IPNet{IP: last.Mask(mask), Mask: mask} + if last.Equal(net.IPv4zero) || last.Equal(net.IPv6zero) { + return next, true + } + return next, false +} + +//Inc increases the IP by one this returns a new []byte for the IP +func Inc(IP net.IP) net.IP { + IP = checkIPv4(IP) + incIP := make([]byte, len(IP)) + copy(incIP, IP) + for j := len(incIP) - 1; j >= 0; j-- { + incIP[j]++ + if incIP[j] > 0 { + break + } + } + return incIP +} + +//Dec decreases the IP by one this returns a new []byte for the IP +func Dec(IP net.IP) net.IP { + IP = checkIPv4(IP) + decIP := make([]byte, len(IP)) + copy(decIP, IP) + decIP = checkIPv4(decIP) + for j := len(decIP) - 1; j >= 0; j-- { + decIP[j]-- + if decIP[j] < 255 { + break + } + } + return decIP +} + +func checkIPv4(ip net.IP) net.IP { + // Go for some reason allocs IPv6len for IPv4 so we have to correct it + if v4 := ip.To4(); v4 != nil { + return v4 + } + return ip +} diff --git a/vendor/github.com/armon/go-radix/LICENSE b/vendor/github.com/armon/go-radix/LICENSE new file mode 100644 index 0000000..a5df10e --- /dev/null +++ b/vendor/github.com/armon/go-radix/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Armon Dadgar + +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/armon/go-radix/README.md b/vendor/github.com/armon/go-radix/README.md new file mode 100644 index 0000000..26f42a2 --- /dev/null +++ b/vendor/github.com/armon/go-radix/README.md @@ -0,0 +1,38 @@ +go-radix [![Build Status](https://travis-ci.org/armon/go-radix.png)](https://travis-ci.org/armon/go-radix) +========= + +Provides the `radix` package that implements a [radix tree](http://en.wikipedia.org/wiki/Radix_tree). +The package only provides a single `Tree` implementation, optimized for sparse nodes. + +As a radix tree, it provides the following: + * O(k) operations. In many cases, this can be faster than a hash table since + the hash function is an O(k) operation, and hash tables have very poor cache locality. + * Minimum / Maximum value lookups + * Ordered iteration + +For an immutable variant, see [go-immutable-radix](https://github.com/hashicorp/go-immutable-radix). + +Documentation +============= + +The full documentation is available on [Godoc](http://godoc.org/github.com/armon/go-radix). + +Example +======= + +Below is a simple example of usage + +```go +// Create a tree +r := radix.New() +r.Insert("foo", 1) +r.Insert("bar", 2) +r.Insert("foobar", 2) + +// Find the longest prefix match +m, _, _ := r.LongestPrefix("foozip") +if m != "foo" { + panic("should be foo") +} +``` + diff --git a/vendor/github.com/armon/go-radix/radix.go b/vendor/github.com/armon/go-radix/radix.go new file mode 100644 index 0000000..f9655a1 --- /dev/null +++ b/vendor/github.com/armon/go-radix/radix.go @@ -0,0 +1,543 @@ +package radix + +import ( + "sort" + "strings" +) + +// WalkFn is used when walking the tree. Takes a +// key and value, returning if iteration should +// be terminated. +type WalkFn func(s string, v interface{}) bool + +// leafNode is used to represent a value +type leafNode struct { + key string + val interface{} +} + +// edge is used to represent an edge node +type edge struct { + label byte + node *node +} + +type node struct { + // leaf is used to store possible leaf + leaf *leafNode + + // prefix is the common prefix we ignore + prefix string + + // Edges should be stored in-order for iteration. + // We avoid a fully materialized slice to save memory, + // since in most cases we expect to be sparse + edges edges +} + +func (n *node) isLeaf() bool { + return n.leaf != nil +} + +func (n *node) addEdge(e edge) { + n.edges = append(n.edges, e) + n.edges.Sort() +} + +func (n *node) replaceEdge(e edge) { + num := len(n.edges) + idx := sort.Search(num, func(i int) bool { + return n.edges[i].label >= e.label + }) + if idx < num && n.edges[idx].label == e.label { + n.edges[idx].node = e.node + return + } + panic("replacing missing edge") +} + +func (n *node) getEdge(label byte) *node { + num := len(n.edges) + idx := sort.Search(num, func(i int) bool { + return n.edges[i].label >= label + }) + if idx < num && n.edges[idx].label == label { + return n.edges[idx].node + } + return nil +} + +func (n *node) delEdge(label byte) { + num := len(n.edges) + idx := sort.Search(num, func(i int) bool { + return n.edges[i].label >= label + }) + if idx < num && n.edges[idx].label == label { + copy(n.edges[idx:], n.edges[idx+1:]) + n.edges[len(n.edges)-1] = edge{} + n.edges = n.edges[:len(n.edges)-1] + } +} + +type edges []edge + +func (e edges) Len() int { + return len(e) +} + +func (e edges) Less(i, j int) bool { + return e[i].label < e[j].label +} + +func (e edges) Swap(i, j int) { + e[i], e[j] = e[j], e[i] +} + +func (e edges) Sort() { + sort.Sort(e) +} + +// Tree implements a radix tree. This can be treated as a +// Dictionary abstract data type. The main advantage over +// a standard hash map is prefix-based lookups and +// ordered iteration, +type Tree struct { + root *node + size int +} + +// New returns an empty Tree +func New() *Tree { + return NewFromMap(nil) +} + +// NewFromMap returns a new tree containing the keys +// from an existing map +func NewFromMap(m map[string]interface{}) *Tree { + t := &Tree{root: &node{}} + for k, v := range m { + t.Insert(k, v) + } + return t +} + +// Len is used to return the number of elements in the tree +func (t *Tree) Len() int { + return t.size +} + +// longestPrefix finds the length of the shared prefix +// of two strings +func longestPrefix(k1, k2 string) int { + max := len(k1) + if l := len(k2); l < max { + max = l + } + var i int + for i = 0; i < max; i++ { + if k1[i] != k2[i] { + break + } + } + return i +} + +// Insert is used to add a newentry or update +// an existing entry. Returns if updated. +func (t *Tree) Insert(s string, v interface{}) (interface{}, bool) { + var parent *node + n := t.root + search := s + for { + // Handle key exhaution + if len(search) == 0 { + if n.isLeaf() { + old := n.leaf.val + n.leaf.val = v + return old, true + } + + n.leaf = &leafNode{ + key: s, + val: v, + } + t.size++ + return nil, false + } + + // Look for the edge + parent = n + n = n.getEdge(search[0]) + + // No edge, create one + if n == nil { + e := edge{ + label: search[0], + node: &node{ + leaf: &leafNode{ + key: s, + val: v, + }, + prefix: search, + }, + } + parent.addEdge(e) + t.size++ + return nil, false + } + + // Determine longest prefix of the search key on match + commonPrefix := longestPrefix(search, n.prefix) + if commonPrefix == len(n.prefix) { + search = search[commonPrefix:] + continue + } + + // Split the node + t.size++ + child := &node{ + prefix: search[:commonPrefix], + } + parent.replaceEdge(edge{ + label: search[0], + node: child, + }) + + // Restore the existing node + child.addEdge(edge{ + label: n.prefix[commonPrefix], + node: n, + }) + n.prefix = n.prefix[commonPrefix:] + + // Create a new leaf node + leaf := &leafNode{ + key: s, + val: v, + } + + // If the new key is a subset, add to to this node + search = search[commonPrefix:] + if len(search) == 0 { + child.leaf = leaf + return nil, false + } + + // Create a new edge for the node + child.addEdge(edge{ + label: search[0], + node: &node{ + leaf: leaf, + prefix: search, + }, + }) + return nil, false + } +} + +// Delete is used to delete a key, returning the previous +// value and if it was deleted +func (t *Tree) Delete(s string) (interface{}, bool) { + var parent *node + var label byte + n := t.root + search := s + for { + // Check for key exhaution + if len(search) == 0 { + if !n.isLeaf() { + break + } + goto DELETE + } + + // Look for an edge + parent = n + label = search[0] + n = n.getEdge(label) + if n == nil { + break + } + + // Consume the search prefix + if strings.HasPrefix(search, n.prefix) { + search = search[len(n.prefix):] + } else { + break + } + } + return nil, false + +DELETE: + // Delete the leaf + leaf := n.leaf + n.leaf = nil + t.size-- + + // Check if we should delete this node from the parent + if parent != nil && len(n.edges) == 0 { + parent.delEdge(label) + } + + // Check if we should merge this node + if n != t.root && len(n.edges) == 1 { + n.mergeChild() + } + + // Check if we should merge the parent's other child + if parent != nil && parent != t.root && len(parent.edges) == 1 && !parent.isLeaf() { + parent.mergeChild() + } + + return leaf.val, true +} + +// DeletePrefix is used to delete the subtree under a prefix +// Returns how many nodes were deleted +// Use this to delete large subtrees efficiently +func (t *Tree) DeletePrefix(s string) int { + return t.deletePrefix(nil, t.root, s) +} + +// delete does a recursive deletion +func (t *Tree) deletePrefix(parent, n *node, prefix string) int { + // Check for key exhaustion + if len(prefix) == 0 { + // Remove the leaf node + subTreeSize := 0 + //recursively walk from all edges of the node to be deleted + recursiveWalk(n, func(s string, v interface{}) bool { + subTreeSize++ + return false + }) + if n.isLeaf() { + n.leaf = nil + } + n.edges = nil // deletes the entire subtree + + // Check if we should merge the parent's other child + if parent != nil && parent != t.root && len(parent.edges) == 1 && !parent.isLeaf() { + parent.mergeChild() + } + t.size -= subTreeSize + return subTreeSize + } + + // Look for an edge + label := prefix[0] + child := n.getEdge(label) + if child == nil || (!strings.HasPrefix(child.prefix, prefix) && !strings.HasPrefix(prefix, child.prefix)) { + return 0 + } + + // Consume the search prefix + if len(child.prefix) > len(prefix) { + prefix = prefix[len(prefix):] + } else { + prefix = prefix[len(child.prefix):] + } + return t.deletePrefix(n, child, prefix) +} + +func (n *node) mergeChild() { + e := n.edges[0] + child := e.node + n.prefix = n.prefix + child.prefix + n.leaf = child.leaf + n.edges = child.edges +} + +// Get is used to lookup a specific key, returning +// the value and if it was found +func (t *Tree) Get(s string) (interface{}, bool) { + n := t.root + search := s + for { + // Check for key exhaution + if len(search) == 0 { + if n.isLeaf() { + return n.leaf.val, true + } + break + } + + // Look for an edge + n = n.getEdge(search[0]) + if n == nil { + break + } + + // Consume the search prefix + if strings.HasPrefix(search, n.prefix) { + search = search[len(n.prefix):] + } else { + break + } + } + return nil, false +} + +// LongestPrefix is like Get, but instead of an +// exact match, it will return the longest prefix match. +func (t *Tree) LongestPrefix(s string) (string, interface{}, bool) { + var last *leafNode + n := t.root + search := s + for { + // Look for a leaf node + if n.isLeaf() { + last = n.leaf + } + + // Check for key exhaution + if len(search) == 0 { + break + } + + // Look for an edge + n = n.getEdge(search[0]) + if n == nil { + break + } + + // Consume the search prefix + if strings.HasPrefix(search, n.prefix) { + search = search[len(n.prefix):] + } else { + break + } + } + if last != nil { + return last.key, last.val, true + } + return "", nil, false +} + +// Minimum is used to return the minimum value in the tree +func (t *Tree) Minimum() (string, interface{}, bool) { + n := t.root + for { + if n.isLeaf() { + return n.leaf.key, n.leaf.val, true + } + if len(n.edges) > 0 { + n = n.edges[0].node + } else { + break + } + } + return "", nil, false +} + +// Maximum is used to return the maximum value in the tree +func (t *Tree) Maximum() (string, interface{}, bool) { + n := t.root + for { + if num := len(n.edges); num > 0 { + n = n.edges[num-1].node + continue + } + if n.isLeaf() { + return n.leaf.key, n.leaf.val, true + } + break + } + return "", nil, false +} + +// Walk is used to walk the tree +func (t *Tree) Walk(fn WalkFn) { + recursiveWalk(t.root, fn) +} + +// WalkPrefix is used to walk the tree under a prefix +func (t *Tree) WalkPrefix(prefix string, fn WalkFn) { + n := t.root + search := prefix + for { + // Check for key exhaution + if len(search) == 0 { + recursiveWalk(n, fn) + return + } + + // Look for an edge + n = n.getEdge(search[0]) + if n == nil { + break + } + + // Consume the search prefix + if strings.HasPrefix(search, n.prefix) { + search = search[len(n.prefix):] + + } else if strings.HasPrefix(n.prefix, search) { + // Child may be under our search prefix + recursiveWalk(n, fn) + return + } else { + break + } + } + +} + +// WalkPath is used to walk the tree, but only visiting nodes +// from the root down to a given leaf. Where WalkPrefix walks +// all the entries *under* the given prefix, this walks the +// entries *above* the given prefix. +func (t *Tree) WalkPath(path string, fn WalkFn) { + n := t.root + search := path + for { + // Visit the leaf values if any + if n.leaf != nil && fn(n.leaf.key, n.leaf.val) { + return + } + + // Check for key exhaution + if len(search) == 0 { + return + } + + // Look for an edge + n = n.getEdge(search[0]) + if n == nil { + return + } + + // Consume the search prefix + if strings.HasPrefix(search, n.prefix) { + search = search[len(n.prefix):] + } else { + break + } + } +} + +// recursiveWalk is used to do a pre-order walk of a node +// recursively. Returns true if the walk should be aborted +func recursiveWalk(n *node, fn WalkFn) bool { + // Visit the leaf values if any + if n.leaf != nil && fn(n.leaf.key, n.leaf.val) { + return true + } + + // Recurse on the children + for _, e := range n.edges { + if recursiveWalk(e.node, fn) { + return true + } + } + return false +} + +// ToMap is used to walk the tree and convert it into a map +func (t *Tree) ToMap() map[string]interface{} { + out := make(map[string]interface{}, t.size) + t.Walk(func(k string, v interface{}) bool { + out[k] = v + return false + }) + return out +} diff --git a/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md new file mode 100644 index 0000000..a404db8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md @@ -0,0 +1,1917 @@ +Release v1.12.0 (2017-09-26) +=== + +### SDK Bugs +* `API Marshaler`: Revert REST JSON and XML protocol marshaler improvements + * Bug [#1550](https://github.com/aws/aws-sdk-go/issues/1550) identified a missed condition in the Amazon Route 53 RESTXML protocol marshaling causing requests to that service to fail. Reverting the marshaler improvements until the bug can be fixed. + +Release v1.11.0 (2017-09-26) +=== + +### Service Client Updates +* `service/cloudformation`: Updates service API and documentation + * You can now prevent a stack from being accidentally deleted by enabling termination protection on the stack. If you attempt to delete a stack with termination protection enabled, the deletion fails and the stack, including its status, remains unchanged. You can enable termination protection on a stack when you create it. Termination protection on stacks is disabled by default. After creation, you can set termination protection on a stack whose status is CREATE_COMPLETE, UPDATE_COMPLETE, or UPDATE_ROLLBACK_COMPLETE. + +### SDK Features +* Add dep Go dependency management metadata files (#1544) + * Adds the Go `dep` dependency management metadata files to the SDK. + * Fixes [#1451](https://github.com/aws/aws-sdk-go/issues/1451) + * Fixes [#634](https://github.com/aws/aws-sdk-go/issues/634) +* `service/dynamodb/expression`: Add expression building utility for DynamoDB ([#1527](https://github.com/aws/aws-sdk-go/pull/1527)) + * Adds a new package, expression, to the SDK providing builder utilities to create DynamoDB expressions safely taking advantage of type safety. +* `API Marshaler`: Add generated marshalers for RESTXML protocol ([#1409](https://github.com/aws/aws-sdk-go/pull/1409)) + * Updates the RESTXML protocol marshaler to use generated code instead of reflection for REST XML based services. +* `API Marshaler`: Add generated marshalers for RESTJSON protocol ([#1547](https://github.com/aws/aws-sdk-go/pull/1547)) + * Updates the RESTJSON protocol marshaler to use generated code instead of reflection for REST JSON based services. + +### SDK Enhancements +* `private/protocol`: Update format of REST JSON and XMl benchmarks ([#1546](https://github.com/aws/aws-sdk-go/pull/1546)) + * Updates the format of the REST JSON and XML benchmarks to be readable. RESTJSON benchmarks were updated to more accurately bench building of the protocol. + +Release v1.10.51 (2017-09-22) +=== + +### Service Client Updates +* `service/config`: Updates service API and documentation +* `service/ecs`: Updates service API and documentation + * Amazon ECS users can now add and drop Linux capabilities to their containers through the use of docker's cap-add and cap-drop features. Customers can specify the capabilities they wish to add or drop for each container in their task definition. +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/rds`: Updates service documentation + * Documentation updates for rds + +Release v1.10.50 (2017-09-21) +=== + +### Service Client Updates +* `service/budgets`: Updates service API + * Including "DuplicateRecordException" in UpdateNotification and UpdateSubscriber. +* `service/ec2`: Updates service API and documentation + * Add EC2 APIs to copy Amazon FPGA Images (AFIs) within the same region and across multiple regions, delete AFIs, and modify AFI attributes. AFI attributes include name, description and granting/denying other AWS accounts to load the AFI. +* `service/logs`: Updates service API and documentation + * Adds support for associating LogGroups with KMS Keys. + +### SDK Bugs +* Fix greengrass service model being duplicated with different casing. ([#1541](https://github.com/aws/aws-sdk-go/pull/1541)) + * Fixes [#1540](https://github.com/aws/aws-sdk-go/issues/1540) + * Fixes [#1539](https://github.com/aws/aws-sdk-go/issues/1539) +Release v1.10.49 (2017-09-20) +=== + +### Service Client Updates +* `service/Greengrass`: Adds new service +* `service/appstream`: Updates service API and documentation + * API updates for supporting On-Demand fleets. +* `service/codepipeline`: Updates service API and documentation + * This change includes a PipelineMetadata object that is part of the output from the GetPipeline API that includes the Pipeline ARN, created, and updated timestamp. +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/rds`: Updates service API and documentation + * Introduces the --option-group-name parameter to the ModifyDBSnapshot CLI command. You can specify this parameter when you upgrade an Oracle DB snapshot. The same option group considerations apply when upgrading a DB snapshot as when upgrading a DB instance. For more information, see http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Oracle.html#USER_UpgradeDBInstance.Oracle.OGPG.OG +* `service/runtime.lex`: Updates service API and documentation + +Release v1.10.48 (2017-09-19) +=== + +### Service Client Updates +* `service/ec2`: Updates service API + * Fixed bug in EC2 clients preventing ElasticGpuSet from being set. + +### SDK Enhancements +* `aws/credentials`: Add EnvProviderName constant. ([#1531](https://github.com/aws/aws-sdk-go/issues/1531)) + * Adds the "EnvConfigCredentials" string literal as EnvProviderName constant. + * Fixes [#1444](https://github.com/aws/aws-sdk-go/issues/1444) + +Release v1.10.47 (2017-09-18) +=== + +### Service Client Updates +* `service/ec2`: Updates service API and documentation + * Amazon EC2 now lets you opt for Spot instances to be stopped in the event of an interruption instead of being terminated. Your Spot request can be fulfilled again by restarting instances from a previously stopped state, subject to availability of capacity at or below your preferred price. When you submit a persistent Spot request, you can choose from "terminate" or "stop" as the instance interruption behavior. Choosing "stop" will shutdown your Spot instances so you can continue from this stopped state later on. This feature is only available for instances with Amazon EBS volume as their root device. +* `service/email`: Updates service API and documentation + * Amazon Simple Email Service (Amazon SES) now lets you customize the domains used for tracking open and click events. Previously, open and click tracking links referred to destinations hosted on domains operated by Amazon SES. With this feature, you can use your own branded domains for capturing open and click events. +* `service/iam`: Updates service API and documentation + * A new API, DeleteServiceLinkedRole, submits a service-linked role deletion request and returns a DeletionTaskId, which you can use to check the status of the deletion. + +Release v1.10.46 (2017-09-15) +=== + +### Service Client Updates +* `service/apigateway`: Updates service API and documentation + * Add a new enum "REQUEST" to '--type ' field in the current create-authorizer API, and make "identitySource" optional. + +Release v1.10.45 (2017-09-14) +=== + +### Service Client Updates +* `service/codebuild`: Updates service API and documentation + * Supporting Parameter Store in environment variables for AWS CodeBuild +* `service/organizations`: Updates service documentation + * Documentation updates for AWS Organizations +* `service/servicecatalog`: Updates service API, documentation, and paginators + * This release of Service Catalog adds API support to copy products. + +Release v1.10.44 (2017-09-13) +=== + +### Service Client Updates +* `service/autoscaling`: Updates service API and documentation + * Customers can create Life Cycle Hooks at the time of creating Auto Scaling Groups through the CreateAutoScalingGroup API +* `service/batch`: Updates service documentation and examples + * Documentation updates for batch +* `service/ec2`: Updates service API + * You are now able to create and launch EC2 x1e.32xlarge instance, a new EC2 instance in the X1 family, in us-east-1, us-west-2, eu-west-1, and ap-northeast-1. x1e.32xlarge offers 128 vCPUs, 3,904 GiB of DDR4 instance memory, high memory bandwidth, large L3 caches, and leading reliability capabilities to boost the performance and reliability of in-memory applications. +* `service/events`: Updates service API and documentation + * Exposes ConcurrentModificationException as one of the valid exceptions for PutPermission and RemovePermission operation. + +### SDK Enhancements +* `service/autoscaling`: Fix documentation for PutScalingPolicy.AutoScalingGroupName [#1522](https://github.com/aws/aws-sdk-go/pull/1522) +* `service/s3/s3manager`: Clarify S3 Upload manager Concurrency config [#1521](https://github.com/aws/aws-sdk-go/pull/1521) + * Fixes [#1458](https://github.com/aws/aws-sdk-go/issues/1458) +* `service/dynamodb/dynamodbattribute`: Add support for time alias. [#1520](https://github.com/aws/aws-sdk-go/pull/1520) + * Related to [#1505](https://github.com/aws/aws-sdk-go/pull/1505) + +Release v1.10.43 (2017-09-12) +=== + +### Service Client Updates +* `service/ec2`: Updates service API + * Fixed bug in EC2 clients preventing HostOfferingSet from being set +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.10.42 (2017-09-12) +=== + +### Service Client Updates +* `service/devicefarm`: Updates service API and documentation + * DeviceFarm has added support for two features - RemoteDebugging and Customer Artifacts. Customers can now do remote Debugging on their Private Devices and can now retrieve custom files generated by their tests on the device and the device host (execution environment) on both public and private devices. + +Release v1.10.41 (2017-09-08) +=== + +### Service Client Updates +* `service/logs`: Updates service API and documentation + * Adds support for the PutResourcePolicy, DescribeResourcePolicy and DeleteResourcePolicy APIs. + +Release v1.10.40 (2017-09-07) +=== + +### Service Client Updates +* `service/application-autoscaling`: Updates service documentation +* `service/ec2`: Updates service API and documentation + * With Tagging support, you can add Key and Value metadata to search, filter and organize your NAT Gateways according to your organization's needs. +* `service/elasticloadbalancingv2`: Updates service API and documentation +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/lex-models`: Updates service API and documentation +* `service/route53`: Updates service API and documentation + * You can configure Amazon Route 53 to log information about the DNS queries that Amazon Route 53 receives for your domains and subdomains. When you configure query logging, Amazon Route 53 starts to send logs to CloudWatch Logs. You can use various tools, including the AWS console, to access the query logs. + +Release v1.10.39 (2017-09-06) +=== + +### Service Client Updates +* `service/budgets`: Updates service API and documentation + * Add an optional "thresholdType" to notifications to support percentage or absolute value thresholds. + +Release v1.10.38 (2017-09-05) +=== + +### Service Client Updates +* `service/codestar`: Updates service API and documentation + * Added support to tag CodeStar projects. Tags can be used to organize and find CodeStar projects on key-value pairs that you can choose. For example, you could add a tag with a key of "Release" and a value of "Beta" to projects your organization is working on for an upcoming beta release. +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.10.37 (2017-09-01) +=== + +### Service Client Updates +* `service/MobileHub`: Adds new service +* `service/gamelift`: Updates service API and documentation + * GameLift VPC resources can be peered with any other AWS VPC. R4 memory-optimized instances now available to deploy. +* `service/ssm`: Updates service API and documentation + * Adding KMS encryption support to SSM Inventory Resource Data Sync. Exposes the ClientToken parameter on SSM StartAutomationExecution to provide idempotent execution requests. + +Release v1.10.36 (2017-08-31) +=== + +### Service Client Updates +* `service/codebuild`: Updates service API, documentation, and examples + * The AWS CodeBuild HTTP API now provides the BatchDeleteBuilds operation, which enables you to delete existing builds. +* `service/ec2`: Updates service API and documentation + * Descriptions for Security Group Rules enables customers to be able to define a description for ingress and egress security group rules . The Descriptions for Security Group Rules feature supports one description field per Security Group rule for both ingress and egress rules . Descriptions for Security Group Rules provides a simple way to describe the purpose or function of a Security Group Rule allowing for easier customer identification of configuration elements . Prior to the release of Descriptions for Security Group Rules , customers had to maintain a separate system outside of AWS if they wanted to track Security Group Rule mapping and their purpose for being implemented. If a security group rule has already been created and you would like to update or change your description for that security group rule you can use the UpdateSecurityGroupRuleDescription API. +* `service/elasticloadbalancingv2`: Updates service API and documentation +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/lex-models`: Updates service API and documentation + +### SDK Bugs +* `aws/signer/v4`: Revert [#1491](https://github.com/aws/aws-sdk-go/issues/1491) as change conflicts with an undocumented AWS v4 signature test case. + * Related to: [#1495](https://github.com/aws/aws-sdk-go/issues/1495). +Release v1.10.35 (2017-08-30) +=== + +### Service Client Updates +* `service/application-autoscaling`: Updates service API and documentation +* `service/organizations`: Updates service API and documentation + * The exception ConstraintViolationException now contains a new reason subcode MASTERACCOUNT_MISSING_CONTACT_INFO to make it easier to understand why attempting to remove an account from an Organization can fail. We also improved several other of the text descriptions and examples. + +Release v1.10.34 (2017-08-29) +=== + +### Service Client Updates +* `service/config`: Updates service API and documentation +* `service/ec2`: Updates service API and documentation + * Provides capability to add secondary CIDR blocks to a VPC. + +### SDK Bugs +* `aws/signer/v4`: Fix Signing Unordered Multi Value Query Parameters ([#1491](https://github.com/aws/aws-sdk-go/pull/1491)) + * Removes sorting of query string values when calculating v4 signing as this is not part of the spec. The spec only requires the keys, not values, to be sorted which is achieved by Query.Encode(). +Release v1.10.33 (2017-08-25) +=== + +### Service Client Updates +* `service/cloudformation`: Updates service API and documentation + * Rollback triggers enable you to have AWS CloudFormation monitor the state of your application during stack creation and updating, and to roll back that operation if the application breaches the threshold of any of the alarms you've specified. +* `service/gamelift`: Updates service API + * Update spelling of MatchmakingTicket status values for internal consistency. +* `service/rds`: Updates service API and documentation + * Option group options now contain additional properties that identify requirements for certain options. Check these properties to determine if your DB instance must be in a VPC or have auto minor upgrade turned on before you can use an option. Check to see if you can downgrade the version of an option after you have installed it. + +### SDK Enhancements +* `example/service/ec2`: Add EC2 list instances example ([#1492](https://github.com/aws/aws-sdk-go/pull/1492)) + +Release v1.10.32 (2017-08-25) +=== + +### Service Client Updates +* `service/rekognition`: Updates service API, documentation, and examples + * Update the enum value of LandmarkType and GenderType to be consistent with service response + +Release v1.10.31 (2017-08-23) +=== + +### Service Client Updates +* `service/appstream`: Updates service documentation + * Documentation updates for appstream +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.10.30 (2017-08-22) +=== + +### Service Client Updates +* `service/ssm`: Updates service API and documentation + * Changes to associations in Systems Manager State Manager can now be recorded. Previously, when you edited associations, you could not go back and review older association settings. Now, associations are versioned, and can be named using human-readable strings, allowing you to see a trail of association changes. You can also perform rate-based scheduling, which allows you to schedule associations more granularly. + +Release v1.10.29 (2017-08-21) +=== + +### Service Client Updates +* `service/firehose`: Updates service API, documentation, and paginators + * This change will allow customers to attach a Firehose delivery stream to an existing Kinesis stream directly. You no longer need a forwarder to move data from a Kinesis stream to a Firehose delivery stream. You can now run your streaming applications on your Kinesis stream and easily attach a Firehose delivery stream to it for data delivery to S3, Redshift, or Elasticsearch concurrently. +* `service/route53`: Updates service API and documentation + * Amazon Route 53 now supports CAA resource record type. A CAA record controls which certificate authorities are allowed to issue certificates for the domain or subdomain. + +Release v1.10.28 (2017-08-18) +=== + +### Service Client Updates +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.10.27 (2017-08-16) +=== + +### Service Client Updates +* `service/gamelift`: Updates service API and documentation + * The Matchmaking Grouping Service is a new feature that groups player match requests for a given game together into game sessions based on developer configured rules. + +### SDK Enhancements +* `aws/arn`: aws/arn: Package for parsing and producing ARNs ([#1463](https://github.com/aws/aws-sdk-go/pull/1463)) + * Adds the `arn` package for AWS ARN parsing and building. Use this package to build AWS ARNs for services such as outlined in the [documentation](http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + +### SDK Bugs +* `aws/signer/v4`: Correct V4 presign signature to include content sha25 in URL ([#1469](https://github.com/aws/aws-sdk-go/pull/1469)) + * Updates the V4 signer so that when a Presign is generated the `X-Amz-Content-Sha256` header is added to the query string instead of being required to be in the header. This allows you to generate presigned URLs for GET requests, e.g S3.GetObject that do not require additional headers to be set by the downstream users of the presigned URL. + * Related To: [#1467](https://github.com/aws/aws-sdk-go/issues/1467) + +Release v1.10.26 (2017-08-15) +=== + +### Service Client Updates +* `service/ec2`: Updates service API + * Fixed bug in EC2 clients preventing HostReservation from being set +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.10.25 (2017-08-14) +=== + +### Service Client Updates +* `service/AWS Glue`: Adds new service +* `service/batch`: Updates service API and documentation + * This release enhances the DescribeJobs API to include the CloudWatch logStreamName attribute in ContainerDetail and ContainerDetailAttempt +* `service/cloudhsmv2`: Adds new service + * CloudHSM provides hardware security modules for protecting sensitive data and cryptographic keys within an EC2 VPC, and enable the customer to maintain control over key access and use. This is a second-generation of the service that will improve security, lower cost and provide better customer usability. +* `service/elasticfilesystem`: Updates service API, documentation, and paginators + * Customers can create encrypted EFS file systems and specify a KMS master key to encrypt it with. +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/mgh`: Adds new service + * AWS Migration Hub provides a single location to track migrations across multiple AWS and partner solutions. Using Migration Hub allows you to choose the AWS and partner migration tools that best fit your needs, while providing visibility into the status of your entire migration portfolio. Migration Hub also provides key metrics and progress for individual applications, regardless of which tools are being used to migrate them. For example, you might use AWS Database Migration Service, AWS Server Migration Service, and partner migration tools to migrate an application comprised of a database, virtualized web servers, and a bare metal server. Using Migration Hub will provide you with a single screen that shows the migration progress of all the resources in the application. This allows you to quickly get progress updates across all of your migrations, easily identify and troubleshoot any issues, and reduce the overall time and effort spent on your migration projects. Migration Hub is available to all AWS customers at no additional charge. You only pay for the cost of the migration tools you use, and any resources being consumed on AWS. +* `service/ssm`: Updates service API and documentation + * Systems Manager Maintenance Windows include the following changes or enhancements: New task options using Systems Manager Automation, AWS Lambda, and AWS Step Functions; enhanced ability to edit the targets of a Maintenance Window, including specifying a target name and description, and ability to edit the owner field; enhanced ability to edits tasks; enhanced support for Run Command parameters; and you can now use a --safe flag when attempting to deregister a target. If this flag is enabled when you attempt to deregister a target, the system returns an error if the target is referenced by any task. Also, Systems Manager now includes Configuration Compliance to scan your fleet of managed instances for patch compliance and configuration inconsistencies. You can collect and aggregate data from multiple AWS accounts and Regions, and then drill down into specific resources that aren't compliant. +* `service/storagegateway`: Updates service API and documentation + * Add optional field ForceDelete to DeleteFileShare api. + +Release v1.10.24 (2017-08-11) +=== + +### Service Client Updates +* `service/codedeploy`: Updates service API and documentation + * Adds support for specifying Application Load Balancers in deployment groups, for both in-place and blue/green deployments. +* `service/cognito-idp`: Updates service API and documentation +* `service/ec2`: Updates service API and documentation + * Provides customers an opportunity to recover an EIP that was released + +Release v1.10.23 (2017-08-10) +=== + +### Service Client Updates +* `service/clouddirectory`: Updates service API and documentation + * Enable BatchDetachPolicy +* `service/codebuild`: Updates service API + * Supporting Bitbucket as source type in AWS CodeBuild. + +Release v1.10.22 (2017-08-09) +=== + +### Service Client Updates +* `service/rds`: Updates service documentation + * Documentation updates for RDS. + +Release v1.10.21 (2017-08-09) +=== + +### Service Client Updates +* `service/elasticbeanstalk`: Updates service API and documentation + * Add support for paginating the result of DescribeEnvironments Include the ARN of described environments in DescribeEnvironments output + +### SDK Enhancements +* `aws`: Add pointer conversion utilities to transform int64 to time.Time [#1433](https://github.com/aws/aws-sdk-go/pull/1433) + * Adds `SecondsTimeValue` and `MillisecondsTimeValue` utilities. + +Release v1.10.20 (2017-08-01) +=== + +### Service Client Updates +* `service/codedeploy`: Updates service API and documentation + * AWS CodeDeploy now supports the use of multiple tag groups in a single deployment group (an intersection of tags) to identify the instances for a deployment. When you create or update a deployment group, use the new ec2TagSet and onPremisesTagSet structures to specify up to three groups of tags. Only instances that are identified by at least one tag in each of the tag groups are included in the deployment group. +* `service/config`: Updates service API and documentation +* `service/ec2`: Updates service waiters + * Ec2 SpotInstanceRequestFulfilled waiter update +* `service/elasticloadbalancingv2`: Updates service waiters +* `service/email`: Updates service API, documentation, paginators, and examples + * This update adds information about publishing email open and click events. This update also adds information about publishing email events to Amazon Simple Notification Service (Amazon SNS). +* `service/pinpoint`: Updates service API and documentation + * This release of the Pinpoint SDK enables App management - create, delete, update operations, Raw Content delivery for APNs and GCM campaign messages and From Address override. + +Release v1.10.19 (2017-08-01) +=== + +### Service Client Updates +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/inspector`: Updates service API, documentation, and paginators + * Inspector's StopAssessmentRun API has been updated with a new input option - stopAction. This request parameter can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION (the default value, and the previous behavior) stops the AWS agent data collection and begins the results evaluation for findings generation based on the data collected so far. SKIP_EVALUATION cancels the assessment run immediately, after which no findings are generated. +* `service/ssm`: Updates service API and documentation + * Adds a SendAutomationSignal API to SSM Service. This API is used to send a signal to an automation execution to change the current behavior or status of the execution. + +Release v1.10.18 (2017-07-27) +=== + +### Service Client Updates +* `service/ec2`: Updates service API and documentation + * The CreateDefaultVPC API enables you to create a new default VPC . You no longer need to contact AWS support, if your default VPC has been deleted. +* `service/kinesisanalytics`: Updates service API and documentation + * Added additional exception types and clarified documentation. + +Release v1.10.17 (2017-07-27) +=== + +### Service Client Updates +* `service/dynamodb`: Updates service documentation and examples + * Corrected a typo. +* `service/ec2`: Updates service API and documentation + * Amazon EC2 Elastic GPUs allow you to easily attach low-cost graphics acceleration to current generation EC2 instances. With Amazon EC2 Elastic GPUs, you can configure the right amount of graphics acceleration to your particular workload without being constrained by fixed hardware configurations and limited GPU selection. +* `service/monitoring`: Updates service documentation + * This release adds high resolution features to CloudWatch, with support for Custom Metrics down to 1 second and Alarms down to 10 seconds. + +Release v1.10.16 (2017-07-26) +=== + +### Service Client Updates +* `service/clouddirectory`: Updates service API and documentation + * Cloud Directory adds support for additional batch operations. +* `service/cloudformation`: Updates service API and documentation + * AWS CloudFormation StackSets enables you to manage stacks across multiple accounts and regions. + +### SDK Enhancements +* `aws/signer/v4`: Optimize V4 signer's header duplicate space stripping. [#1417](https://github.com/aws/aws-sdk-go/pull/1417) + +Release v1.10.15 (2017-07-24) +=== + +### Service Client Updates +* `service/appstream`: Updates service API, documentation, and waiters + * Amazon AppStream 2.0 image builders and fleets can now access applications and network resources that rely on Microsoft Active Directory (AD) for authentication and permissions. This new feature allows you to join your streaming instances to your AD, so you can use your existing AD user management tools. +* `service/ec2`: Updates service API and documentation + * Spot Fleet tagging capability allows customers to automatically tag instances launched by Spot Fleet. You can use this feature to label or distinguish instances created by distinct Spot Fleets. Tagging your EC2 instances also enables you to see instance cost allocation by tag in your AWS bill. + +### SDK Bugs +* `aws/signer/v4`: Fix out of bounds panic in stripExcessSpaces [#1412](https://github.com/aws/aws-sdk-go/pull/1412) + * Fixes the out of bands panic in stripExcessSpaces caused by an incorrect calculation of the stripToIdx value. Simplified to code also. + * Fixes [#1411](https://github.com/aws/aws-sdk-go/issues/1411) +Release v1.10.14 (2017-07-20) +=== + +### Service Client Updates +* `service/elasticmapreduce`: Updates service API and documentation + * Amazon EMR now includes the ability to use a custom Amazon Linux AMI and adjustable root volume size when launching a cluster. + +Release v1.10.13 (2017-07-19) +=== + +### Service Client Updates +* `service/budgets`: Updates service API and documentation + * Update budget Management API's to list/create/update RI_UTILIZATION type budget. Update budget Management API's to support DAILY timeUnit for RI_UTILIZATION type budget. + +### SDK Enhancements +* `service/s3`: Use interfaces assertions instead of ValuesAtPath for S3 field lookups. [#1401](https://github.com/aws/aws-sdk-go/pull/1401) + * Improves the performance across the board for all S3 API calls by removing the usage of `ValuesAtPath` being used for every S3 API call. + +### SDK Bugs +* `aws/request`: waiter test bug + * waiters_test.go file would sometimes fail due to travis hiccups. This occurs because a test would sometimes fail the cancel check and succeed the timeout. However, the timeout check should never occur in that test. This fix introduces a new field that dictates how waiters will sleep. +Release v1.10.12 (2017-07-17) +=== + +### Service Client Updates +* `service/cognito-idp`: Updates service API and documentation +* `service/lambda`: Updates service API and documentation + * Lambda@Edge lets you run code closer to your end users without provisioning or managing servers. With Lambda@Edge, your code runs in AWS edge locations, allowing you to respond to your end users at the lowest latency. Your code is triggered by Amazon CloudFront events, such as requests to and from origin servers and viewers, and it is ready to execute at every AWS edge location whenever a request for content is received. You just upload your Node.js code to AWS Lambda and Lambda takes care of everything required to run and scale your code with high availability. You only pay for the compute time you consume - there is no charge when your code is not running. + +Release v1.10.11 (2017-07-14) +=== + +### Service Client Updates +* `service/discovery`: Updates service API and documentation + * Adding feature to the Export API for Discovery Service to allow filters for the export task to allow export based on per agent id. +* `service/ec2`: Updates service API + * New EC2 GPU Graphics instance +* `service/marketplacecommerceanalytics`: Updates service documentation + * Update to Documentation Model For New Report Cadence / Reformat of Docs + +Release v1.10.10 (2017-07-13) +=== + +### Service Client Updates +* `service/apigateway`: Updates service API and documentation + * Adds support for management of gateway responses. +* `service/ec2`: Updates service API and documentation + * X-ENI (or Cross-Account ENI) is a new feature that allows the attachment or association of Elastic Network Interfaces (ENI) between VPCs in different AWS accounts located in the same availability zone. With this new capability, service providers and partners can deliver managed solutions in a variety of new architectural patterns where the provider and consumer of the service are in different AWS accounts. +* `service/lex-models`: Updates service documentation + +Release v1.10.9 (2017-07-12) +=== + +### Service Client Updates +* `service/autoscaling`: Updates service API and documentation + * Auto Scaling now supports a new type of scaling policy called target tracking scaling policies that you can use to set up dynamic scaling for your application. +* `service/swf`: Updates service API, documentation, paginators, and examples + * Added support for attaching control data to Lambda tasks. Control data lets you attach arbitrary strings to your decisions and history events. + +Release v1.10.8 (2017-07-06) +=== + +### Service Client Updates +* `service/ds`: Updates service API, documentation, and paginators + * You can now improve the resilience and performance of your Microsoft AD directory by deploying additional domain controllers. Added UpdateNumberofDomainControllers API that allows you to update the number of domain controllers you want for your directory, and DescribeDomainControllers API that allows you to describe the detailed information of each domain controller of your directory. Also added the 'DesiredNumberOfDomainControllers' field to the DescribeDirectories API output for Microsoft AD. +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/kinesis`: Updates service API and documentation + * You can now encrypt your data at rest within an Amazon Kinesis Stream using server-side encryption. Server-side encryption via AWS KMS makes it easy for customers to meet strict data management requirements by encrypting their data at rest within the Amazon Kinesis Streams, a fully managed real-time data processing service. +* `service/kms`: Updates service API and documentation + * This release of AWS Key Management Service introduces the ability to determine whether a key is AWS managed or customer managed. +* `service/ssm`: Updates service API and documentation + * Amazon EC2 Systems Manager now expands Patching support to Amazon Linux, Red Hat and Ubuntu in addition to the already supported Windows Server. + +Release v1.10.7 (2017-07-05) +=== + +### Service Client Updates +* `service/monitoring`: Updates service API and documentation + * We are excited to announce the availability of APIs and CloudFormation support for CloudWatch Dashboards. You can use the new dashboard APIs or CloudFormation templates to dynamically build and maintain dashboards to monitor your infrastructure and applications. There are four new dashboard APIs - PutDashboard, GetDashboard, DeleteDashboards, and ListDashboards APIs. PutDashboard is used to create a new dashboard or modify an existing one whereas GetDashboard is the API to get the details of a specific dashboard. ListDashboards and DeleteDashboards are used to get the names or delete multiple dashboards respectively. Getting started with dashboard APIs is similar to any other AWS APIs. The APIs can be accessed through AWS SDK or through CLI tools. +* `service/route53`: Updates service API and documentation + * Bug fix for InvalidChangeBatch exception. + +### SDK Enhancements +* `service/s3/s3manager`: adding cleanup function to batch objects [#1375](https://github.com/aws/aws-sdk-go/issues/1375) + * This enhancement will add an After field that will be called after each iteration of the batch operation. + +Release v1.10.6 (2017-06-30) +=== + +### Service Client Updates +* `service/marketplacecommerceanalytics`: Updates service documentation + * Documentation updates for AWS Marketplace Commerce Analytics. +* `service/s3`: Updates service API and documentation + * API Update for S3: Adding Object Tagging Header to MultipartUpload Initialization + +Release v1.10.5 (2017-06-29) +=== + +### Service Client Updates +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/events`: Updates service API and documentation + * CloudWatch Events now allows different AWS accounts to share events with each other through a new resource called event bus. Event buses accept events from AWS services, other AWS accounts and PutEvents API calls. Currently all AWS accounts have one default event bus. To send events to another account, customers simply write rules to match the events of interest and attach an event bus in the receiving account as the target to the rule. The PutTargets API has been updated to allow adding cross account event buses as targets. In addition, we have released two new APIs - PutPermission and RemovePermission - that enables customers to add/remove permissions to their default event bus. +* `service/gamelift`: Updates service API and documentation + * Allow developers to download GameLift fleet creation logs to assist with debugging. +* `service/ssm`: Updates service API and documentation + * Adding Resource Data Sync support to SSM Inventory. New APIs: * CreateResourceDataSync - creates a new resource data sync configuration, * ListResourceDataSync - lists existing resource data sync configurations, * DeleteResourceDataSync - deletes an existing resource data sync configuration. + +Release v1.10.4 (2017-06-27) +=== + +### Service Client Updates +* `service/servicecatalog`: Updates service API, documentation, and paginators + * Proper tagging of resources is critical to post-launch operations such as billing, cost allocation, and resource management. By using Service Catalog's TagOption Library, administrators can define a library of re-usable TagOptions that conform to company standards, and associate these with Service Catalog portfolios and products. Learn how to move your current tags to the new library, create new TagOptions, and view and associate your library items with portfolios and products. Understand how to ensure that the right tags are created on products launched through Service Catalog and how to provide users with defined selectable tags. + +### SDK Bugs +* `aws/signer/v4`: checking length on `stripExcessSpaces` [#1372](https://github.com/aws/aws-sdk-go/issues/1372) + * Fixes a bug where `stripExcessSpaces` did not check length against the slice. + * Fixes: [#1371](https://github.com/aws/aws-sdk-go/issues/1371) +Release v1.10.3 (2017-06-23) +=== + +### Service Client Updates +* `service/lambda`: Updates service API and documentation + * The Lambda Invoke API will now throw new exception InvalidRuntimeException (status code 502) for invokes with deprecated runtimes. + +Release v1.10.2 (2017-06-22) +=== + +### Service Client Updates +* `service/codepipeline`: Updates service API, documentation, and paginators + * A new API, ListPipelineExecutions, enables you to retrieve summary information about the most recent executions in a pipeline, including pipeline execution ID, status, start time, and last updated time. You can request information for a maximum of 100 executions. Pipeline execution data is available for the most recent 12 months of activity. +* `service/dms`: Updates service API and documentation + * Added tagging for DMS certificates. +* `service/elasticloadbalancing`: Updates service waiters +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/lightsail`: Updates service API and documentation + * This release adds a new nextPageToken property to the result of the GetOperationsForResource API. Developers can now get the next set of items in a list by making subsequent calls to GetOperationsForResource API with the token from the previous call. This release also deprecates the nextPageCount property, which previously returned null (use the nextPageToken property instead). This release also deprecates the customImageName property on the CreateInstancesRequest class, which was previously ignored by the API. +* `service/route53`: Updates service API and documentation + * This release reintroduces the HealthCheckInUse exception. + +Release v1.10.1 (2017-06-21) +=== + +### Service Client Updates +* `service/dax`: Adds new service + * Amazon DynamoDB Accelerator (DAX) is a fully managed, highly available, in-memory cache for DynamoDB that delivers up to a 10x performance improvement - from milliseconds to microseconds - even at millions of requests per second. DAX does all the heavy lifting required to add in-memory acceleration to your DynamoDB tables, without requiring developers to manage cache invalidation, data population, or cluster management. +* `service/route53`: Updates service API and documentation + * Amazon Route 53 now supports multivalue answers in response to DNS queries, which lets you route traffic approximately randomly to multiple resources, such as web servers. Create one multivalue answer record for each resource and, optionally, associate an Amazon Route 53 health check with each record, and Amazon Route 53 responds to DNS queries with up to eight healthy records. +* `service/ssm`: Updates service API, documentation, and paginators + * Adding hierarchy support to the SSM Parameter Store API. Added support tor tagging. New APIs: GetParameter - retrieves one parameter, DeleteParameters - deletes multiple parameters (max number 10), GetParametersByPath - retrieves parameters located in the hierarchy. Updated APIs: PutParameter - added ability to enforce parameter value by applying regex (AllowedPattern), DescribeParameters - modified to support Tag filtering. +* `service/waf`: Updates service API and documentation + * You can now create, edit, update, and delete a new type of WAF rule with a rate tracking component. +* `service/waf-regional`: Updates service API and documentation + +Release v1.10.0 (2017-06-20) +=== + +### Service Client Updates +* `service/workdocs`: Updates service API and documentation + * This release provides a new API to retrieve the activities performed by WorkDocs users. + +### SDK Features +* `aws/credentials/plugincreds`: Add support for Go plugin for credentials [#1320](https://github.com/aws/aws-sdk-go/pull/1320) + * Adds support for using plugins to retrieve credentials for API requests. This change adds a new package plugincreds under aws/credentials. See the `example/aws/credentials/plugincreds` folder in the SDK for example usage. + +Release v1.9.00 (2017-06-19) +=== + +### Service Client Updates +* `service/organizations`: Updates service API and documentation + * Improvements to Exception Modeling + +### SDK Features +* `service/s3/s3manager`: Adds batch operations to s3manager [#1333](https://github.com/aws/aws-sdk-go/pull/1333) + * Allows for batch upload, download, and delete of objects. Also adds the interface pattern to allow for easy traversal of objects. E.G `DownloadWithIterator`, `UploadWithIterator`, and `BatchDelete`. `BatchDelete` also contains a utility iterator using the `ListObjects` API to easily delete a list of objects. + +Release v1.8.44 (2017-06-16) +=== + +### Service Client Updates +* `service/xray`: Updates service API, documentation, and paginators + * Add a response time histogram to the services in response of GetServiceGraph API. + +Release v1.8.43 (2017-06-15) +=== + +### Service Client Updates +* `service/ec2`: Updates service API and documentation + * Adds API to describe Amazon FPGA Images (AFIs) available to customers, which includes public AFIs, private AFIs that you own, and AFIs owned by other AWS accounts for which you have load permissions. +* `service/ecs`: Updates service API and documentation + * Added support for cpu, memory, and memory reservation container overrides on the RunTask and StartTask APIs. +* `service/iot`: Updates service API and documentation + * Revert the last release: remove CertificatePem from DescribeCertificate API. +* `service/servicecatalog`: Updates service API, documentation, and paginators + * Added ProvisioningArtifactSummaries to DescribeProductAsAdmin's output to show the provisioning artifacts belong to the product. Allow filtering by SourceProductId in SearchProductsAsAdmin for AWS Marketplace products. Added a verbose option to DescribeProvisioningArtifact to display the CloudFormation template used to create the provisioning artifact.Added DescribeProvisionedProduct API. Changed the type of ProvisionedProduct's Status to be distinct from Record's Status. New ProvisionedProduct's Status are AVAILABLE, UNDER_CHANGE, TAINTED, ERROR. Changed Record's Status set of values to CREATED, IN_PROGRESS, IN_PROGRESS_IN_ERROR, SUCCEEDED, FAILED. + +### SDK Bugs +* `private/model/api`: Fix RESTXML support for XML Namespace [#1343](https://github.com/aws/aws-sdk-go/pull/1343) + * Fixes a bug with the SDK's generation of services using the REST XML protocol not annotating shape references with the XML Namespace attribute. + * Fixes [#1334](https://github.com/aws/aws-sdk-go/pull/1334) +Release v1.8.42 (2017-06-14) +=== + +### Service Client Updates +* `service/applicationautoscaling`: Updates service API and documentation +* `service/clouddirectory`: Updates service documentation + * Documentation update for Cloud Directory + +Release v1.8.41 (2017-06-13) +=== + +### Service Client Updates +* `service/configservice`: Updates service API + +Release v1.8.40 (2017-06-13) +=== + +### Service Client Updates +* `service/rds`: Updates service API and documentation + * API Update for RDS: this update enables copy-on-write, a new Aurora MySQL Compatible Edition feature that allows users to restore their database, and support copy of TDE enabled snapshot cross region. + +### SDK Bugs +* `aws/request`: Fix NewErrParamMinLen to use correct ParamMinLenErrCode [#1336](https://github.com/aws/aws-sdk-go/issues/1336) + * Fixes the `NewErrParamMinLen` function returning the wrong error code. `ParamMinLenErrCode` should be returned not `ParamMinValueErrCode`. + * Fixes [#1335](https://github.com/aws/aws-sdk-go/issues/1335) +Release v1.8.39 (2017-06-09) +=== + +### Service Client Updates +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/opsworks`: Updates service API and documentation + * Tagging Support for AWS OpsWorks Stacks + +Release v1.8.38 (2017-06-08) +=== + +### Service Client Updates +* `service/iot`: Updates service API and documentation + * In addition to using certificate ID, AWS IoT customers can now obtain the description of a certificate with the certificate PEM. +* `service/pinpoint`: Updates service API and documentation + * Starting today Amazon Pinpoint adds SMS Text and Email Messaging support in addition to Mobile Push Notifications, providing developers, product managers and marketers with multi-channel messaging capabilities to drive user engagement in their applications. Pinpoint also enables backend services and applications to message users directly and provides advanced user and app analytics to understand user behavior and messaging performance. +* `service/rekognition`: Updates service API and documentation + * API Update for AmazonRekognition: Adding RecognizeCelebrities API + +Release v1.8.37 (2017-06-07) +=== + +### Service Client Updates +* `service/codebuild`: Updates service API and documentation + * Add support to APIs for privileged containers. This change would allow performing privileged operations like starting the Docker daemon inside builds possible in custom docker images. +* `service/greengrass`: Adds new service + * AWS Greengrass is software that lets you run local compute, messaging, and device state synchronization for connected devices in a secure way. With AWS Greengrass, connected devices can run AWS Lambda functions, keep device data in sync, and communicate with other devices securely even when not connected to the Internet. Using AWS Lambda, Greengrass ensures your IoT devices can respond quickly to local events, operate with intermittent connections, and minimize the cost of transmitting IoT data to the cloud. + +Release v1.8.36 (2017-06-06) +=== + +### Service Client Updates +* `service/acm`: Updates service documentation + * Documentation update for AWS Certificate Manager. +* `service/cloudfront`: Updates service documentation + * Doc update to fix incorrect prefix in S3OriginConfig +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/iot`: Updates service API + * Update client side validation for SalesForce action. + +Release v1.8.35 (2017-06-05) +=== + +### Service Client Updates +* `service/appstream`: Updates service API and documentation + * AppStream 2.0 Custom Security Groups allows you to easily control what network resources your streaming instances and images have access to. You can assign up to 5 security groups per Fleet to control the inbound and outbound network access to your streaming instances to specific IP ranges, network protocols, or ports. +* `service/iot`: Updates service API, documentation, paginators, and examples + * Added Salesforce action to IoT Rules Engine. + +Release v1.8.34 (2017-06-02) +=== + +### Service Client Updates +* `service/kinesisanalytics`: Updates service API, documentation, and paginators + * Kinesis Analytics publishes error messages CloudWatch logs in case of application misconfigurations +* `service/workdocs`: Updates service API and documentation + * This release includes new APIs to manage tags and custom metadata on resources and also new APIs to add and retrieve comments at the document level. + +Release v1.8.33 (2017-06-01) +=== + +### Service Client Updates +* `service/codedeploy`: Updates service API and documentation + * AWS CodeDeploy has improved how it manages connections to GitHub accounts and repositories. You can now create and store up to 25 connections to GitHub accounts in order to associate AWS CodeDeploy applications with GitHub repositories. Each connection can support multiple repositories. You can create connections to up to 25 different GitHub accounts, or create more than one connection to a single account. The ListGitHubAccountTokenNames command has been introduced to retrieve the names of stored connections to GitHub accounts that you have created. The name of the connection to GitHub used for an AWS CodeDeploy application is also included in the ApplicationInfo structure. Two new fields, lastAttemptedDeployment and lastSuccessfulDeployment, have been added to DeploymentGroupInfo to improve the handling of deployment group information in the AWS CodeDeploy console. Information about these latest deployments can also be retrieved using the GetDeploymentGroup and BatchGetDeployment group requests. Also includes a region update (us-gov-west-1). +* `service/cognitoidentityprovider`: Updates service API, documentation, and paginators +* `service/elbv2`: Updates service API and documentation +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/lexmodelbuildingservice`: Updates service documentation and examples + +### SDK Enhancements +* `aws/defaults`: Exports shared credentials and config default filenames used by the SDK. [#1308](https://github.com/aws/aws-sdk-go/pull/1308) + * Adds SharedCredentialsFilename and SharedConfigFilename functions to defaults package. + +### SDK Bugs +* `aws/credentials`: Fixes shared credential provider's default filename on Windows. [#1308](https://github.com/aws/aws-sdk-go/pull/1308) + * The shared credentials provider would attempt to use the wrong filename on Windows if the `HOME` environment variable was defined. +* `service/s3/s3manager`: service/s3/s3manager: Fix Downloader ignoring Range get parameter [#1311](https://github.com/aws/aws-sdk-go/pull/1311) + * Fixes the S3 Download Manager ignoring the GetObjectInput's Range parameter. If this parameter is provided it will force the downloader to fallback to a single GetObject request disabling concurrency and automatic part size gets. + * Fixes [#1296](https://github.com/aws/aws-sdk-go/issues/1296) +Release v1.8.32 (2017-05-31) +=== + +### Service Client Updates +* `service/rds`: Updates service API and documentation + * Amazon RDS customers can now easily and quickly stop and start their DB instances. + +Release v1.8.31 (2017-05-30) +=== + +### Service Client Updates +* `service/clouddirectory`: Updates service API, documentation, and paginators + * Cloud Directory has launched support for Typed Links, enabling customers to create object-to-object relationships that are not hierarchical in nature. Typed Links enable customers to quickly query for data along these relationships. Customers can also enforce referential integrity using Typed Links, ensuring data in use is not inadvertently deleted. +* `service/s3`: Updates service paginators and examples + * New example snippets for Amazon S3. + +Release v1.8.30 (2017-05-25) +=== + +### Service Client Updates +* `service/appstream`: Updates service API and documentation + * Support added for persistent user storage, backed by S3. +* `service/rekognition`: Updates service API and documentation + * Updated the CompareFaces API response to include orientation information, unmatched faces, landmarks, pose, and quality of the compared faces. + +Release v1.8.29 (2017-05-24) +=== + +### Service Client Updates +* `service/iam`: Updates service API + * The unique ID and access key lengths were extended from 32 to 128 +* `service/storagegateway`: Updates service API and documentation + * Two Storage Gateway data types, Tape and TapeArchive, each have a new response element, TapeUsedInBytes. This element helps you manage your virtual tapes. By using TapeUsedInBytes, you can see the amount of data written to each virtual tape. +* `service/sts`: Updates service API, documentation, and paginators + * The unique ID and access key lengths were extended from 32 to 128. + +Release v1.8.28 (2017-05-23) +=== + +### Service Client Updates +* `service/databasemigrationservice`: Updates service API, documentation, paginators, and examples + * This release adds support for using Amazon S3 and Amazon DynamoDB as targets for database migration, and using MongoDB as a source for database migration. For more information, see the AWS Database Migration Service documentation. + +Release v1.8.27 (2017-05-22) +=== + +### Service Client Updates +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/resourcegroupstaggingapi`: Updates service API, documentation, and paginators + * You can now specify the number of resources returned per page in GetResources operation, as an optional parameter, to easily manage the list of resources returned by your queries. + +### SDK Bugs +* `aws/request`: Add support for PUT temporary redirects (307) [#1283](https://github.com/aws/aws-sdk-go/issues/1283) + * Adds support for Go 1.8's GetBody function allowing the SDK's http request using PUT and POST methods to be redirected with temporary redirects with 307 status code. + * Fixes: [#1267](https://github.com/aws/aws-sdk-go/issues/1267) +* `aws/request`: Add handling for retrying temporary errors during unmarshal [#1289](https://github.com/aws/aws-sdk-go/issues/1289) + * Adds support for retrying temporary errors that occur during unmarshaling of a request's response body. + * Fixes: [#1275](https://github.com/aws/aws-sdk-go/issues/1275) +Release v1.8.26 (2017-05-18) +=== + +### Service Client Updates +* `service/athena`: Adds new service + * This release adds support for Amazon Athena. Amazon Athena is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL. Athena is serverless, so there is no infrastructure to manage, and you pay only for the queries that you run. +* `service/lightsail`: Updates service API, documentation, and paginators + * This release adds new APIs that make it easier to set network port configurations on Lightsail instances. Developers can now make a single request to both open and close public ports on an instance using the PutInstancePublicPorts operation. + +### SDK Bugs +* `aws/request`: Fix logging from reporting wrong retry request errors #1281 + * Fixes the SDK's retry request logging to report the the actual error that occurred, not a stubbed Unknown error message. + * Fixes the SDK's response logger to not output the response log multiple times per retry. +Release v1.8.25 (2017-05-17) +=== + +### Service Client Updates +* `service/autoscaling`: Updates service documentation, paginators, and examples + * Various Auto Scaling documentation updates +* `service/cloudwatchevents`: Updates service documentation + * Various CloudWatch Events documentation updates. +* `service/cloudwatchlogs`: Updates service documentation and paginators + * Various CloudWatch Logs documentation updates. +* `service/polly`: Updates service API + * Amazon Polly adds new German voice "Vicki" + +Release v1.8.24 (2017-05-16) +=== + +### Service Client Updates +* `service/codedeploy`: Updates service API and documentation + * This release introduces the previousRevision field in the responses to the GetDeployment and BatchGetDeployments actions. previousRevision provides information about the application revision that was deployed to the deployment group before the most recent successful deployment. Also, the fileExistsBehavior parameter has been added for CreateDeployment action requests. In the past, if the AWS CodeDeploy agent detected files in a target location that weren't part of the application revision from the most recent successful deployment, it would fail the current deployment by default. This new parameter provides options for how the agent handles these files: fail the deployment, retain the content, or overwrite the content. +* `service/gamelift`: Updates service API and documentation + * Allow developers to specify how metrics are grouped in CloudWatch for their GameLift fleets. Developers can also specify how many concurrent game sessions activate on a per-instance basis. +* `service/inspector`: Updates service API, documentation, paginators, and examples + * Adds ability to produce an assessment report that includes detailed and comprehensive results of a specified assessment run. +* `service/kms`: Updates service documentation + * Update documentation for KMS. + +Release v1.8.23 (2017-05-15) +=== + +### Service Client Updates +* `service/ssm`: Updates service API and documentation + * UpdateAssociation API now supports updating document name and targets of an association. GetAutomationExecution API can return FailureDetails as an optional field to the StepExecution Object, which contains failure type, failure stage as well as other failure related information for a failed step. + +### SDK Enhancements +* `aws/session`: SDK should be able to load multiple custom shared config files. [#1258](https://github.com/aws/aws-sdk-go/issues/1258) + * This change adds a `SharedConfigFiles` field to the `session.Options` type that allows you to specify the files, and their order, the SDK will use for loading shared configuration and credentials from when the `Session` is created. Use the `NewSessionWithOptions` Session constructor to specify these options. You'll also most likely want to enable support for the shared configuration file's additional attributes by setting `session.Option`'s `SharedConfigState` to `session.SharedConfigEnabled`. + +Release v1.8.22 (2017-05-11) +=== + +### Service Client Updates +* `service/elb`: Updates service API, documentation, and paginators +* `service/elbv2`: Updates service API and documentation +* `service/lexmodelbuildingservice`: Updates service API and documentation +* `service/organizations`: Updates service API, documentation, paginators, and examples + * AWS Organizations APIs that return an Account object now include the email address associated with the account’s root user. + +Release v1.8.21 (2017-05-09) +=== + +### Service Client Updates +* `service/codestar`: Updates service documentation + * Updated documentation for AWS CodeStar. +* `service/workspaces`: Updates service API, documentation, and paginators + * Doc-only Update for WorkSpaces + +Release v1.8.20 (2017-05-04) +=== + +### Service Client Updates +* `service/ecs`: Updates service API, documentation, and paginators + * Exposes container instance registration time in ECS:DescribeContainerInstances. +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/marketplaceentitlementservice`: Adds new service +* `service/lambda`: Updates service API and documentation + * Support for UpdateFunctionCode DryRun option + +Release v1.8.19 (2017-04-28) +=== + +### Service Client Updates +* `service/cloudformation`: Updates service waiters and paginators + * Adding back the removed waiters and paginators. + +Release v1.8.18 (2017-04-28) +=== + +### Service Client Updates +* `service/cloudformation`: Updates service API, documentation, waiters, paginators, and examples + * API update for CloudFormation: New optional parameter ClientRequestToken which can be used as an idempotency token to safely retry certain operations as well as tagging StackEvents. +* `service/rds`: Updates service API, documentation, and examples + * The DescribeDBClusterSnapshots API now returns a SourceDBClusterSnapshotArn field which identifies the source DB cluster snapshot of a copied snapshot. +* `service/rekognition`: Updates service API + * Fix for missing file type check +* `service/snowball`: Updates service API, documentation, and paginators + * The Snowball API has a new exception that can be thrown for list operation requests. +* `service/sqs`: Updates service API, documentation, and paginators + * Adding server-side encryption (SSE) support to SQS by integrating with AWS KMS; adding new queue attributes to SQS CreateQueue, SetQueueAttributes and GetQueueAttributes APIs to support SSE. + +Release v1.8.17 (2017-04-26) +=== + +### Service Client Updates +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/rds`: Updates service API and documentation + * With Amazon Relational Database Service (Amazon RDS) running MySQL or Amazon Aurora, you can now authenticate to your DB instance using IAM database authentication. + +Release v1.8.16 (2017-04-21) +=== + +### Service Client Updates +* `service/appstream`: Updates service API, documentation, and paginators + * The new feature named "Default Internet Access" will enable Internet access from AppStream 2.0 instances - image builders and fleet instances. Admins will check a flag either through AWS management console for AppStream 2.0 or through API while creating an image builder or while creating/updating a fleet. +* `service/kinesis`: Updates service API, documentation, waiters, and paginators + * Adds a new waiter, StreamNotExists, to Kinesis. + +### SDK Enhancements +* `aws/endpoints`: Add utilities improving endpoints lookup (#1218) + * Adds several utilities to the endpoints packages to make looking up partitions, regions, and services easier. + * Fixes #994 + +### SDK Bugs +* `private/protocol/xml/xmlutil`: Fix unmarshaling dropping errors (#1219) + * The XML unmarshaler would drop any serialization or body read error that occurred on the floor effectively hiding any errors that would occur. + * Fixes #1205 +Release v1.8.15 (2017-04-20) +=== + +### Service Client Updates +* `service/devicefarm`: Updates service API and documentation + * API Update for AWS Device Farm: Support for Deals and Promotions +* `service/directconnect`: Updates service documentation + * Documentation updates for AWS Direct Connect. +* `service/elbv2`: Updates service waiters +* `service/kms`: Updates service documentation and examples + * Doc-only update for Key Management Service (KMS): Update docs for GrantConstraints and GenerateRandom +* `service/route53`: Updates service documentation + * Release notes: SDK documentation now includes examples for ChangeResourceRecordSets for all types of resource record set, such as weighted, alias, and failover. +* `service/route53domains`: Updates service API, documentation, and paginators + * Adding examples and other documentation updates. + +### SDK Enhancements +* `service/s3`: Add utilities to make getting a bucket's region easier (#1207) + * Adds two features which make it easier to get a bucket's region, `s3.NormalizeBucketLocation` and `s3manager.GetBucketRegion`. + +### SDK Bugs +* `service/s3`: Fix HeadObject's incorrect documented error codes (#1213) + * The HeadObject's model incorrectly states that the operation can return the NoSuchKey error code. + * Fixes #1208 + +Release v1.8.14 (2017-04-19) +=== + +### Service Client Updates +* `service/apigateway`: Updates service API and documentation + * Add support for "embed" property. +* `service/codestar`: Adds new service + * AWS CodeStar is a cloud-based service for creating, managing, and working with software development projects on AWS. An AWS CodeStar project creates and integrates AWS services for your project development toolchain. AWS CodeStar also manages the permissions required for project users. +* `service/ec2`: Updates service API and documentation + * Adds support for creating an Amazon FPGA Image (AFI) from a specified design checkpoint (DCP). +* `service/iam`: Updates service API and documentation + * This changes introduces a new IAM role type, Service Linked Role, which works like a normal role but must be managed via services' control. +* `service/lambda`: Updates service API and documentation + * Lambda integration with CloudDebugger service to enable customers to enable tracing for the Lambda functions and send trace information to the CloudDebugger service. +* `service/lexmodelbuildingservice`: Adds new service +* `service/polly`: Updates service API, documentation, and paginators + * API Update for Amazon Polly: Add support for speech marks +* `service/rekognition`: Updates service API and documentation + * Given an image, the API detects explicit or suggestive adult content in the image and returns a list of corresponding labels with confidence scores, as well as a taxonomy (parent-child relation) for each label. + +Release v1.8.13 (2017-04-18) +=== + +### Service Client Updates +* `service/lambda`: Updates service API and documentation + * You can use tags to group and filter your Lambda functions, making it easier to analyze them for billing allocation purposes. For more information, see Tagging Lambda Functions. You can now write or upgrade your Lambda functions using Python version 3.6. For more information, see Programming Model for Authoring Lambda Functions in Python. Note: Features will be rolled out in the US regions on 4/19. + +### SDK Enhancements +* `aws/request`: add support for appengine's custom standard library (#1190) + * Remove syscall error checking on appengine platforms. + +Release v1.8.12 (2017-04-11) +=== + +### Service Client Updates +* `service/apigateway`: Updates service API and documentation + * API Gateway request validators +* `service/batch`: Updates service API and documentation + * API Update for AWS Batch: Customer provided AMI for MANAGED Compute Environment +* `service/gamelift`: Updates service API and documentation + * Allows developers to utilize an improved workflow when calling our Queues API and introduces a new feature that allows developers to specify a maximum allowable latency per Queue. +* `service/opsworks`: Updates service API, documentation, and paginators + * Cloudwatch Logs agent configuration can now be attached to OpsWorks Layers using CreateLayer and UpdateLayer. OpsWorks will then automatically install and manage the CloudWatch Logs agent on the instances part of the OpsWorks Layer. + +### SDK Bugs +* `aws/client`: Fix clients polluting handler list (#1197) + * Fixes the clients potentially polluting the passed in handler list with the client's customizations. This change ensures every client always works with a clean copy of the request handlers and it cannot pollute the handlers back upstream. + * Fixes #1184 +* `aws/request`: Fix waiter error match condition (#1195) + * Fixes the waiters's matching overwriting the request's err, effectively ignoring the error condition. This broke waiters with the FailureWaiterState matcher state. +Release v1.8.11 (2017-04-07) +=== + +### Service Client Updates +* `service/redshift`: Updates service API, documentation, and paginators + * This update adds the GetClusterCredentials API which is used to get temporary login credentials to the cluster. AccountWithRestoreAccess now has a new member AccountAlias, this is the identifier of the AWS support account authorized to restore the specified snapshot. This is added to support the feature where the customer can share their snapshot with the Amazon Redshift Support Account without having to manually specify the AWS Redshift Service account ID on the AWS Console/API. + +Release v1.8.10 (2017-04-06) +=== + +### Service Client Updates +* `service/elbv2`: Updates service documentation + +Release v1.8.9 (2017-04-05) +=== + +### Service Client Updates +* `service/elasticache`: Updates service API, documentation, paginators, and examples + * ElastiCache added support for testing the Elasticache Multi-AZ feature with Automatic Failover. + +Release v1.8.8 (2017-04-04) +=== + +### Service Client Updates +* `service/cloudwatch`: Updates service API, documentation, and paginators + * Amazon Web Services announced the immediate availability of two additional alarm configuration rules for Amazon CloudWatch Alarms. The first rule is for configuring missing data treatment. Customers have the options to treat missing data as alarm threshold breached, alarm threshold not breached, maintain alarm state and the current default treatment. The second rule is for alarms based on percentiles metrics that can trigger unnecassarily if the percentile is calculated from a small number of samples. The new rule can treat percentiles with low sample counts as same as missing data. If the first rule is enabled, the same treatment will be applied when an alarm encounters a percentile with low sample counts. + +Release v1.8.7 (2017-04-03) +=== + +### Service Client Updates +* `service/lexruntimeservice`: Updates service API and documentation + * Adds support to PostContent for speech input + +### SDK Enhancements +* `aws/request`: Improve handler copy, push back, push front performance (#1171) + * Minor optimization to the handler list's handling of copying and pushing request handlers to the handler list. +* Update codegen header to use Go std wording (#1172) + * Go recently accepted the proposal for standard generated file header wording in, https://golang.org/s/generatedcode. + +### SDK Bugs +* `service/dynamodb`: Fix DynamoDB using custom retryer (#1170) + * Fixes (#1139) the DynamoDB service client clobbering any custom retryer that was passed into the service client or Session's config. +Release v1.8.6 (2017-04-01) +=== + +### Service Client Updates +* `service/clouddirectory`: Updates service API and documentation + * ListObjectAttributes now supports filtering by facet. +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.8.5 (2017-03-30) +=== + +### Service Client Updates +* `service/cloudformation`: Updates service waiters and paginators + * Adding paginators for ListExports and ListImports +* `service/cloudfront`: Adds new service + * Amazon CloudFront now supports user configurable HTTP Read and Keep-Alive Idle Timeouts for your Custom Origin Servers +* `service/configservice`: Updates service documentation +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/resourcegroupstaggingapi`: Adds new service +* `service/storagegateway`: Updates service API and documentation + * File gateway mode in AWS Storage gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. Once a file share is created, any changes made externally to the S3 bucket will not be reflected by the gateway. Using the cache refresh feature in this update, the customer can trigger an on-demand scan of the keys in their S3 bucket and refresh the file namespace cached on the gateway. It takes as an input the fileShare ARN and refreshes the cache for only that file share. Additionally there is new functionality on file gateway that allows you configure what squash options they would like on their file share, this allows a customer to configure their gateway to not squash root permissions. This can be done by setting options in NfsOptions for CreateNfsFileShare and UpdateNfsFileShare APIs. + +Release v1.8.4 (2017-03-28) +=== + +### Service Client Updates +* `service/batch`: Updates service API, documentation, and paginators + * Customers can now provide a retryStrategy as part of the RegisterJobDefinition and SubmitJob API calls. The retryStrategy object has a number value for attempts. This is the number of non successful executions before a job is considered FAILED. In addition, the JobDetail object now has an attempts field and shows all execution attempts. +* `service/ec2`: Updates service API and documentation + * Customers can now tag their Amazon EC2 Instances and Amazon EBS Volumes at + the time of their creation. You can do this from the EC2 Instance launch + wizard or through the RunInstances or CreateVolume APIs. By tagging + resources at the time of creation, you can eliminate the need to run custom + tagging scripts after resource creation. In addition, you can now set + resource-level permissions on the CreateVolume, CreateTags, DeleteTags, and + the RunInstances APIs. This allows you to implement stronger security + policies by giving you more granular control over which users and groups + have access to these APIs. You can also enforce the use of tagging and + control what tag keys and values are set on your resources. When you combine + tag usage and resource-level IAM policies together, you can ensure your + instances and volumes are properly secured upon creation and achieve more + accurate cost allocation reporting. These new features are provided at no + additional cost. + +### SDK Enhancements +* `aws/request`: Add retry support for RequestTimeoutException (#1158) + * Adds support for retrying RequestTimeoutException error code that is returned by some services. + +### SDK Bugs +* `private/model/api`: Fix Waiter and Paginators panic on nil param inputs (#1157) + * Corrects the code generation for Paginators and waiters that caused a panic if nil input parameters were used with the operations. +Release v1.8.3 (2017-03-27) +=== + +## Service Client Updates +* `service/ssm`: Updates service API, documentation, and paginators + * Updated validation rules for SendCommand and RegisterTaskWithMaintenanceWindow APIs. +Release v1.8.2 (2017-03-24) +=== + +Service Client Updates +--- +* `service/applicationautoscaling`: Updates service API, documentation, and paginators + * Application AutoScaling is launching support for a new target resource (AppStream 2.0 Fleets) as a scalable target. +* `service/cloudtrail`: Updates service API and documentation + * Doc-only Update for CloudTrail: Add required parameters for GetEventSelectors and PutEventSelectors + +Release v1.8.1 (2017-03-23) +=== + +Service Client Updates +--- +* `service/applicationdiscoveryservice`: Updates service API, documentation, and paginators + * Adds export configuration options to the AWS Discovery Service API. +* `service/elbv2`: Updates waiters +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/lambda`: Updates service API and paginators + * Adds support for new runtime Node.js v6.10 for AWS Lambda service + +Release v1.8.0 (2017-03-22) +=== + +Service Client Updates +--- +* `service/codebuild`: Updates service documentation +* `service/directconnect`: Updates service API + * Deprecated DescribeConnectionLoa, DescribeInterconnectLoa, AllocateConnectionOnInterconnect and DescribeConnectionsOnInterconnect operations in favor of DescribeLoa, DescribeLoa, AllocateHostedConnection and DescribeHostedConnections respectively. +* `service/marketplacecommerceanalytics`: Updates service API, documentation, and paginators + * This update adds a new data set, us_sales_and_use_tax_records, which enables AWS Marketplace sellers to programmatically access to their U.S. Sales and Use Tax report data. +* `service/pinpoint`: Updates service API and documentation + * Amazon Pinpoint User Segmentation + * Added ability to segment endpoints by user attributes in addition to endpoint attributes. Amazon Pinpoint Event Stream Preview + * Added functionality to publish raw app analytics and campaign events data as events streams to Kinesis and Kinesis Firehose + * The feature provides developers with increased flexibility of exporting raw events to S3, Redshift, Elasticsearch using a Kinesis Firehose stream or enable real time event processing use cases using a Kinesis stream +* `service/rekognition`: Updates service documentation. + +SDK Features +--- +* `aws/request`: Add support for context.Context to SDK API operation requests (#1132) + * Adds support for context.Context to the SDK by adding `WithContext` methods for each API operation, Paginators and Waiters. e.g `PutObjectWithContext`. This change also adds the ability to provide request functional options to the method calls instead of requiring you to use the `Request` API operation method (e.g `PutObjectRequest`). + * Adds a `Complete` Request handler list that will be called ever time a request is completed. This includes both success and failure. Complete will only be called once per API operation request. + * `private/waiter` package moved from the private group to `aws/request/waiter` and made publicly available. + * Adds Context support to all API operations, Waiters(WaitUntil) and Paginators(Pages) methods. + * Adds Context support for s3manager and s3crypto clients. + +SDK Enhancements +--- +* `aws/signer/v4`: Adds support for unsigned payload signer config (#1130) + * Adds configuration option to the v4.Signer to specify the request's body should not be signed. This will only correclty function on services that support unsigned payload. e.g. S3, Glacier. + +SDK Bug Fixes +--- +* `service/s3`: Fix S3 HostID to be available in S3 request error message (#1131) + * Adds a new type s3.RequestFailure which exposes the S3 HostID value from a S3 API operation response. This is helpful when you have an error with S3, and need to contact support. Both RequestID and HostID are needed. +* `private/model/api`: Do not return a link if uid is empty (#1133) + * Fixes SDK's doc generation to not generate API reference doc links if the SDK us unable to create a valid link. +* `aws/request`: Optimization to handler list copy to prevent multiple alloc calls. (#1134) +Release v1.7.9 (2017-03-13) +=== + +Service Client Updates +--- +* `service/devicefarm`: Updates service API, documentation, paginators, and examples + * Network shaping allows users to simulate network connections and conditions while testing their Android, iOS, and web apps with AWS Device Farm. +* `service/cloudwatchevents`: Updates service API, documentation, and examples + +SDK Enhancement +=== +* `aws/session`: Add support for side loaded CA bundles (#1117) + * Adds supports for side loading Certificate Authority bundle files to the SDK using AWS_CA_BUNDLE environment variable or CustomCABundle session option. +* `service/s3/s3crypto`: Add support for AES/CBC/PKCS5Padding (#1124) + +SDK Bug +=== +* `service/rds`: Fixing issue when not providing `SourceRegion` on cross +region operations (#1127) +* `service/rds`: Enables cross region for `CopyDBClusterSnapshot` and +`CreateDBCluster` (#1128) + +Release v1.7.8 (2017-03-10) +=== + +Service Client Updates +--- +* `service/codedeploy`: Updates service paginators + * Add paginators for Codedeploy +* `service/emr`: Updates service API, documentation, and paginators + * This release includes support for instance fleets in Amazon EMR. + +Release v1.7.7 (2017-03-09) +=== + +Service Client Updates +--- +* `service/apigateway`: Updates service API, documentation, and paginators + * API Gateway has added support for ACM certificates on custom domain names. Both Amazon-issued certificates and uploaded third-part certificates are supported. +* `service/clouddirectory`: Updates service API, documentation, and paginators + * Introduces a new Cloud Directory API that enables you to retrieve all available parent paths for any type of object (a node, leaf node, policy node, and index node) in a hierarchy. + +Release v1.7.6 (2017-03-09) +=== + +Service Client Updates +--- +* `service/organizations`: Updates service documentation and examples + * Doc-only Update for Organizations: Add SDK Code Snippets +* `service/workdocs`: Adds new service + * The Administrative SDKs for Amazon WorkDocs provides full administrator level access to WorkDocs site resources, allowing developers to integrate their applications to manage WorkDocs users, content and permissions programmatically + +Release v1.7.5 (2017-03-08) +=== + +Service Client Updates +--- +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/rds`: Updates service API and documentation + * Add support to using encrypted clusters as cross-region replication masters. Update CopyDBClusterSnapshot API to support encrypted cross region copy of Aurora cluster snapshots. + +Release v1.7.4 (2017-03-06) +=== + +Service Client Updates +--- +* `service/budgets`: Updates service API and paginators + * When creating or editing a budget via the AWS Budgets API you can define notifications that are sent to subscribers when the actual or forecasted value for cost or usage exceeds the notificationThreshold associated with the budget notification object. Starting today, the maximum allowed value for the notificationThreshold was raised from 100 to 300. This change was made to give you more flexibility when setting budget notifications. +* `service/cloudtrail`: Updates service documentation and paginators + * Doc-only update for AWSCloudTrail: Updated links/descriptions +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/opsworkscm`: Updates service API, documentation, and paginators + * OpsWorks for Chef Automate has added a new field "AssociatePublicIpAddress" to the CreateServer request, "CloudFormationStackArn" to the Server model and "TERMINATED" server state. + + +Release v1.7.3 (2017-02-28) +=== + +Service Client Updates +--- +* `service/mturk`: Renaming service + * service/mechanicalturkrequesterservice was renamed to service/mturk. Be sure to change any references of the old client to the new. + +Release v1.7.2 (2017-02-28) +=== + +Service Client Updates +--- +* `service/dynamodb`: Updates service API and documentation + * Release notes: Time to Live (TTL) is a feature that allows you to define when items in a table expire and can be purged from the database, so that you don't have to track expired data and delete it manually. With TTL enabled on a DynamoDB table, you can set a timestamp for deletion on a per-item basis, allowing you to limit storage usage to only those records that are relevant. +* `service/iam`: Updates service API, documentation, and paginators + * This release adds support for AWS Organizations service control policies (SCPs) to SimulatePrincipalPolicy operation. If there are SCPs associated with the simulated user's account, their effect on the result is captured in the OrganizationDecisionDetail element in the EvaluationResult. +* `service/mechanicalturkrequesterservice`: Adds new service + * Amazon Mechanical Turk is a web service that provides an on-demand, scalable, human workforce to complete jobs that humans can do better than computers, for example, recognizing objects in photos. +* `service/organizations`: Adds new service + * AWS Organizations is a web service that enables you to consolidate your multiple AWS accounts into an organization and centrally manage your accounts and their resources. +* `service/dynamodbstreams`: Updates service API, documentation, and paginators +* `service/waf`: Updates service API, documentation, and paginators + * Aws WAF - For GetSampledRequests action, changed max number of samples from 100 to 500. +* `service/wafregional`: Updates service API, documentation, and paginators + +Release v1.7.1 (2017-02-24) +=== + +Service Client Updates +--- +* `service/elasticsearchservice`: Updates service API, documentation, paginators, and examples + * Added three new API calls to existing Amazon Elasticsearch service to expose Amazon Elasticsearch imposed limits to customers. + +Release v1.7.0 (2017-02-23) +=== + +Service Client Updates +--- +* `service/ec2`: Updates service API + * New EC2 I3 instance type + +SDK Bug +--- +* `service/s3/s3manager`: Adding support for SSE (#1097) + * Fixes SSE fields not being applied to a part during multi part upload. + +SDK Feature +--- +* `aws/session`: Add support for AssumeRoles with MFA (#1088) + * Adds support for assuming IAM roles with MFA enabled. A TokenProvider func was added to stscreds.AssumeRoleProvider that will be called each time the role's credentials need to be refreshed. A basic token provider that sources the MFA token from stdin as stscreds.StdinTokenProvider. +* `aws/session`: Update SDK examples and docs to use session.Must (#1099) + * Updates the SDK's example and docs to use session.Must where possible to highlight its usage as apposed to session error checking that is most cases errors will be terminal to the application anyways. +Release v1.6.27 (2017-02-22) +=== + +Service Client Updates +--- +* `service/clouddirectory`: Updates service documentation + * ListObjectAttributes documentation updated based on forum feedback +* `service/elasticbeanstalk`: Updates service API, documentation, and paginators + * Elastic Beanstalk adds support for creating and managing custom platform. +* `service/gamelift`: Updates service API, documentation, and paginators + * Allow developers to configure global queues for creating GameSessions. Allow PlayerData on PlayerSessions to store player-specific data. +* `service/route53`: Updates service API, documentation, and examples + * Added support for operations CreateVPCAssociationAuthorization and DeleteVPCAssociationAuthorization to throw a ConcurrentModification error when a conflicting modification occurs in parallel to the authorizations in place for a given hosted zone. + +Release v1.6.26 (2017-02-21) +=== + +Service Client Updates +--- +* `service/ec2`: Updates service API and documentation + * Added the billingProduct parameter to the RegisterImage API. + +Release v1.6.25 (2017-02-17) +=== + +Service Client Updates +--- +* `service/directconnect`: Updates service API, documentation, and paginators + * This update will introduce the ability for Direct Connect customers to take advantage of Link Aggregation (LAG). This allows you to bundle many individual physical interfaces into a single logical interface, referred to as a LAG. This makes administration much simpler as the majority of configuration is done on the LAG while you are free to add or remove physical interfaces from the bundle as bandwidth demand increases or decreases. A concrete example of the simplification added by LAG is that customers need only a single BGP session as opposed to one session per physical connection. + +Release v1.6.24 (2017-02-16) +=== + +Service Client Updates +--- +* `service/cognitoidentity`: Updates service API, documentation, and paginators + * Allow createIdentityPool and updateIdentityPool API to set server side token check value on identity pool +* `service/configservice`: Updates service API and documentation + * AWS Config now supports a new test mode for the PutEvaluations API. Set the TestMode parameter to true in your custom rule to verify whether your AWS Lambda function will deliver evaluation results to AWS Config. No updates occur to your existing evaluations, and evaluation results are not sent to AWS Config. + +Release v1.6.23 (2017-02-15) +=== + +Service Client Updates +--- +* `service/kms`: Updates service API, documentation, paginators, and examples + * his release of AWS Key Management Service introduces the ability to tag keys. Tagging keys can help you organize your keys and track your KMS costs in the cost allocation report. This release also increases the maximum length of a key ID to accommodate ARNs that include a long key alias. + +Release v1.6.22 (2017-02-14) +=== + +Service Client Updates +--- +* `service/ec2`: Updates service API, documentation, and paginators + * Adds support for the new Modify Volumes apis. + +Release v1.6.21 (2017-02-11) +=== + +Service Client Updates +--- +* `service/storagegateway`: Updates service API, documentation, and paginators + * File gateway mode in AWS Storage gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. This is done by creating Nfs file shares using existing APIs CreateNfsFileShare. Using the feature in this update, the customer can restrict the clients that have read/write access to the gateway by specifying the list of clients as a list of IP addresses or CIDR blocks. This list can be specified using the API CreateNfsFileShare while creating new file shares, or UpdateNfsFileShare while update existing file shares. To find out the list of clients that have access, the existing API DescribeNfsFileShare will now output the list of clients that have access. + +Release v1.6.20 (2017-02-09) +=== + +Service Client Updates +--- +* `service/ec2`: Updates service API and documentation + * This feature allows customers to associate an IAM profile to running instances that do not have any. +* `service/rekognition`: Updates service API and documentation + * DetectFaces and IndexFaces operations now return an estimate of the age of the face as an age range. + +SDK Features +--- +* `aws/endpoints`: Add option to resolve unknown endpoints (#1074) +Release v1.6.19 (2017-02-08) +=== + +Service Client Updates +--- +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/glacier`: Updates service examples + * Doc Update +* `service/lexruntimeservice`: Adds new service + * Preview release + +SDK Bug Fixes +--- +* `private/protocol/json`: Fixes json to throw an error if a float number is (+/-)Inf and NaN (#1068) +* `private/model/api`: Fix documentation error listing (#1067) + +SDK Features +--- +* `private/model`: Add service response error code generation (#1061) + +Release v1.6.18 (2017-01-27) +=== + +Service Client Updates +--- +* `service/clouddirectory`: Adds new service + * Amazon Cloud Directory is a highly scalable, high performance, multi-tenant directory service in the cloud. Its web-based directories make it easy for you to organize and manage application resources such as users, groups, locations, devices, policies, and the rich relationships between them. +* `service/codedeploy`: Updates service API, documentation, and paginators + * This release of AWS CodeDeploy introduces support for blue/green deployments. In a blue/green deployment, the current set of instances in a deployment group is replaced by new instances that have the latest application revision installed on them. After traffic is rerouted behind a load balancer to the replacement instances, the original instances can be terminated automatically or kept running for other uses. +* `service/ec2`: Updates service API and documentation + * Adds instance health check functionality to replace unhealthy EC2 Spot fleet instances with fresh ones. +* `service/rds`: Updates service API and documentation + * Snapshot Engine Version Upgrade + +Release v1.6.17 (2017-01-25) +=== + +Service Client Updates +--- +* `service/elbv2`: Updates service API, documentation, and paginators + * Application Load Balancers now support native Internet Protocol version 6 (IPv6) in an Amazon Virtual Private Cloud (VPC). With this ability, clients can now connect to the Application Load Balancer in a dual-stack mode via either IPv4 or IPv6. +* `service/rds`: Updates service API and documentation + * Cross Region Read Replica Copying (CreateDBInstanceReadReplica) + +Release v1.6.16 (2017-01-24) +=== + +Service Client Updates +--- +* `service/codebuild`: Updates service documentation and paginators + * Documentation updates +* `service/codecommit`: Updates service API, documentation, and paginators + * AWS CodeCommit now includes the option to view the differences between a commit and its parent commit from within the console. You can view the differences inline (Unified view) or side by side (Split view). To view information about the differences between a commit and something other than its parent, you can use the AWS CLI and the get-differences and get-blob commands, or you can use the GetDifferences and GetBlob APIs. +* `service/ecs`: Updates service API and documentation + * Amazon ECS now supports a state for container instances that can be used to drain a container instance in preparation for maintenance or cluster scale down. + +Release v1.6.15 (2017-01-20) +=== + +Service Client Updates +--- +* `service/acm`: Updates service API, documentation, and paginators + * Update for AWS Certificate Manager: Updated response elements for DescribeCertificate API in support of managed renewal +* `service/health`: Updates service documentation + +Release v1.6.14 (2017-01-19) +=== + +Service Client Updates +--- +* `service/ec2`: Updates service API, documentation, and paginators + * Amazon EC2 Spot instances now support dedicated tenancy, providing the ability to run Spot instances single-tenant manner on physically isolated hardware within a VPC to satisfy security, privacy, or other compliance requirements. Dedicated Spot instances can be requested using RequestSpotInstances and RequestSpotFleet. + +Release v1.6.13 (2017-01-18) +=== + +Service Client Updates +--- +* `service/rds`: Updates service API, documentation, and paginators + +Release v1.6.12 (2017-01-17) +=== + +Service Client Updates +--- +* `service/dynamodb`: Updates service API, documentation, and paginators + * Tagging Support for Amazon DynamoDB Tables and Indexes +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/glacier`: Updates service API, paginators, and examples + * Doc-only Update for Glacier: Added code snippets +* `service/polly`: Updates service documentation and examples + * Doc-only update for Amazon Polly -- added snippets +* `service/rekognition`: Updates service documentation and paginators + * Added code samples to Rekognition reference topics. +* `service/route53`: Updates service API and paginators + * Add ca-central-1 and eu-west-2 enum values to CloudWatchRegion enum + +Release v1.6.11 (2017-01-16) +=== + +Service Client Updates +--- +* `service/configservice`: Updates service API, documentation, and paginators +* `service/costandusagereportservice`: Adds new service + * The AWS Cost and Usage Report Service API allows you to enable and disable the Cost & Usage report, as well as modify the report name, the data granularity, and the delivery preferences. +* `service/dynamodb`: Updates service API, documentation, and examples + * Snippets for the DynamoDB API. +* `service/elasticache`: Updates service API, documentation, and examples + * Adds new code examples. +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.6.10 (2017-01-04) +=== + +Service Client Updates +--- +* `service/configservice`: Updates service API and documentation + * AWSConfig is planning to add support for OversizedConfigurationItemChangeNotification message type in putConfigRule. After this release customers can use/write rules based on OversizedConfigurationItemChangeNotification mesage type. +* `service/efs`: Updates service API, documentation, and examples + * Doc-only Update for EFS: Added code snippets +* `service/iam`: Updates service documentation and examples +* `service/lambda`: Updates service documentation and examples + * Doc only updates for Lambda: Added code snippets +* `service/marketplacecommerceanalytics`: Updates service API and documentation + * Added support for data set disbursed_amount_by_instance_hours, with historical data available starting 2012-09-04. New data is published to this data set every 30 days. +* `service/rds`: Updates service documentation + * Updated documentation for CopyDBSnapshot. +* `service/rekognition`: Updates service documentation and examples + * Doc-only Update for Rekognition: Added code snippets +* `service/snowball`: Updates service examples +* `service/dynamodbstreams`: Updates service API and examples + * Doc-only Update for DynamoDB Streams: Added code snippets + +SDK Feature +--- +* `private/model/api`: Increasing the readability of code generated files. (#1024) +Release v1.6.9 (2016-12-30) +=== + +Service Client Updates +--- +* `service/codedeploy`: Updates service API and documentation + * CodeDeploy will support Iam Session Arns in addition to Iam User Arns for on premise host authentication. +* `service/ecs`: Updates service API and documentation + * Amazon EC2 Container Service (ECS) now supports the ability to customize the placement of tasks on container instances. +* `aws/endpoints`: Updated Regions and Endpoints metadata. + +Release v1.6.8 (2016-12-22) +=== + +Service Client Updates +--- +* `service/apigateway`: Updates service API and documentation + * Amazon API Gateway is adding support for generating SDKs in more languages. This update introduces two new operations used to dynamically discover these SDK types and what configuration each type accepts. +* `service/directoryservice`: Updates service documentation + * Added code snippets for the DS SDKs +* `service/elasticbeanstalk`: Updates service API and documentation +* `service/iam`: Updates service API and documentation + * Adds service-specific credentials to IAM service to make it easier to onboard CodeCommit customers. These are username/password credentials that work with a single service. +* `service/kms`: Updates service API, documentation, and examples + * Update docs and add SDK examples + +Release v1.6.7 (2016-12-22) +=== + +Service Client Updates +--- +* `service/ecr`: Updates service API and documentation +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/rds`: Updates service API and documentation + * Cross Region Encrypted Snapshot Copying (CopyDBSnapshot) + +Release v1.6.6 (2016-12-20) +=== + +Service Client Updates +--- +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/firehose`: Updates service API, documentation, and examples + * Processing feature enables users to process and modify records before Amazon Firehose delivers them to destinations. +* `service/route53`: Updates service API and documentation + * Enum updates for eu-west-2 and ca-central-1 +* `service/storagegateway`: Updates service API, documentation, and examples + * File gateway is a new mode in the AWS Storage Gateway that support a file interface into S3, alongside the current block-based volume and VTL storage. File gateway combines a service and virtual software appliance, enabling you to store and retrieve objects in Amazon S3 using industry standard file protocols such as NFS. The software appliance, or gateway, is deployed into your on-premises environment as a virtual machine (VM) running on VMware ESXi. The gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. + +Release v1.6.5 (2016-12-19) +=== + +Service Client Updates +--- +* `service/cloudformation`: Updates service documentation + * Minor doc update for CloudFormation. +* `service/cloudtrail`: Updates service paginators +* `service/cognitoidentity`: Updates service API and documentation + * We are adding Groups to Cognito user pools. Developers can perform CRUD operations on groups, add and remove users from groups, list users in groups, etc. We are adding fine-grained role-based access control for Cognito identity pools. Developers can configure an identity pool to get the IAM role from an authenticated user's token, or they can configure rules that will map a user to a different role +* `service/applicationdiscoveryservice`: Updates service API and documentation + * Adds new APIs to group discovered servers into Applications with get summary and neighbors. Includes additional filters for ListConfigurations and DescribeAgents API. +* `service/inspector`: Updates service API, documentation, and examples + * Doc-only Update for Inspector: Adding SDK code snippets for Inspector +* `service/sqs`: Updates service documentation + +SDK Bug Fixes +--- +* `aws/request`: Add PriorRequestNotComplete to throttle retry codes (#1011) + * Fixes: Not retrying when PriorRequestNotComplete #1009 + +SDK Feature +--- +* `private/model/api`: Adds crosslinking to service documentation (#1010) + +Release v1.6.4 (2016-12-15) +=== + +Service Client Updates +--- +* `service/cognitoidentityprovider`: Updates service API and documentation +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/ssm`: Updates service API and documentation + * This will provide customers with access to the Patch Baseline and Patch Compliance APIs. + +SDK Bug Fixes +--- +* `service/route53`: Fix URL path cleaning for Route53 API requests (#1006) + * Fixes: SerializationError when using Route53 ChangeResourceRecordSets #1005 +* `aws/request`: Add PriorRequestNotComplete to throttle retry codes (#1002) + * Fixes: Not retrying when PriorRequestNotComplete #1001 + +Release v1.6.3 (2016-12-14) +=== + +Service Client Updates +--- +* `service/batch`: Adds new service + * AWS Batch is a batch computing service that lets customers define queues and compute environments and then submit work as batch jobs. +* `service/databasemigrationservice`: Updates service API and documentation + * Adds support for SSL enabled Oracle endpoints and task modification. +* `service/elasticbeanstalk`: Updates service documentation +* `aws/endpoints`: Updated Regions and Endpoints metadata. +* `service/cloudwatchlogs`: Updates service API and documentation + * Add support for associating LogGroups with AWSTagris tags +* `service/marketplacecommerceanalytics`: Updates service API and documentation + * Add new enum to DataSetType: sales_compensation_billed_revenue +* `service/rds`: Updates service documentation + * Doc-only Update for RDS: New versions available in CreateDBInstance +* `service/sts`: Updates service documentation + * Adding Code Snippet Examples for SDKs for STS + +SDK Bug Fixes +--- +* `aws/request`: Fix retrying timeout requests (#981) + * Fixes: Requests Retrying is broken if the error was caused due to a client timeout #947 +* `aws/request`: Fix for Go 1.8 request incorrectly sent with body (#991) + * Fixes: service/route53: ListHostedZones hangs and then fails with go1.8 #984 +* private/protocol/rest: Use RawPath instead of Opaque (#993) + * Fixes: HTTP2 request failing with REST protocol services, e.g AWS X-Ray +* private/model/api: Generate REST-JSON JSONVersion correctly (#998) + * Fixes: REST-JSON protocol service code missing JSONVersion metadata. + +Release v1.6.2 (2016-12-08) +=== + +Service Client Updates +--- +* `service/cloudfront`: Add lambda function associations to cache behaviors +* `service/codepipeline`: This is a doc-only update request to incorporate some recent minor revisions to the doc content. +* `service/rds`: Updates service API and documentation +* `service/wafregional`: With this new feature, customers can use AWS WAF directly on Application Load Balancers in a VPC within available regions to protect their websites and web services from malicious attacks such as SQL injection, Cross Site Scripting, bad bots, etc. + +Release v1.6.1 (2016-12-07) +=== + +Service Client Updates +--- +* `service/config`: Updates service API +* `service/s3`: Updates service API +* `service/sqs`: Updates service API and documentation + +Release v1.6.0 (2016-12-06) +=== + +Service Client Updates +--- +* `service/config`: Updates service API and documentation +* `service/ec2`: Updates service API +* `service/sts`: Updates service API, documentation, and examples + +SDK Bug Fixes +--- +* private/protocol/xml/xmlutil: Fix SDK XML unmarshaler #975 + * Fixes GetBucketACL Grantee required type always nil. #916 + +SDK Feature +--- +* aws/endpoints: Add endpoint metadata to SDK #961 + * Adds Region and Endpoint metadata to the SDK. This allows you to enumerate regions and endpoint metadata based on a defined model embedded in the SDK. + +Release v1.5.13 (2016-12-01) +=== + +Service Client Updates +--- +* `service/apigateway`: Updates service API and documentation +* `service/appstream`: Adds new service +* `service/codebuild`: Adds new service +* `service/directconnect`: Updates service API and documentation +* `service/ec2`: Adds new service +* `service/elasticbeanstalk`: Updates service API and documentation +* `service/health`: Adds new service +* `service/lambda`: Updates service API and documentation +* `service/opsworkscm`: Adds new service +* `service/pinpoint`: Adds new service +* `service/shield`: Adds new service +* `service/ssm`: Updates service API and documentation +* `service/states`: Adds new service +* `service/xray`: Adds new service + +Release v1.5.12 (2016-11-30) +=== + +Service Client Updates +--- +* `service/lightsail`: Adds new service +* `service/polly`: Adds new service +* `service/rekognition`: Adds new service +* `service/snowball`: Updates service API and documentation + +Release v1.5.11 (2016-11-29) +=== + +Service Client Updates +--- +`service/s3`: Updates service API and documentation + +Release v1.5.10 (2016-11-22) +=== + +Service Client Updates +--- +* `service/cloudformation`: Updates service API and documentation +* `service/glacier`: Updates service API, documentation, and examples +* `service/route53`: Updates service API and documentation +* `service/s3`: Updates service API and documentation + +SDK Bug Fixes +--- +* `private/protocol/xml/xmlutil`: Fixes xml marshaler to unmarshal properly +into tagged fields +[#916](https://github.com/aws/aws-sdk-go/issues/916) + +Release v1.5.9 (2016-11-22) +=== + +Service Client Updates +--- +* `service/cloudtrail`: Updates service API and documentation +* `service/ecs`: Updates service API and documentation + +Release v1.5.8 (2016-11-18) +=== + +Service Client Updates +--- +* `service/application-autoscaling`: Updates service API and documentation +* `service/elasticmapreduce`: Updates service API and documentation +* `service/elastictranscoder`: Updates service API, documentation, and examples +* `service/gamelift`: Updates service API and documentation +* `service/lambda`: Updates service API and documentation + +Release v1.5.7 (2016-11-18) +=== + +Service Client Updates +--- +* `service/apigateway`: Updates service API and documentation +* `service/meteringmarketplace`: Updates service API and documentation +* `service/monitoring`: Updates service API and documentation +* `service/sqs`: Updates service API, documentation, and examples + +Release v1.5.6 (2016-11-16) +=== + +Service Client Updates +--- +`service/route53`: Updates service API and documentation +`service/servicecatalog`: Updates service API and documentation + +Release v1.5.5 (2016-11-15) +=== + +Service Client Updates +--- +* `service/ds`: Updates service API and documentation +* `service/elasticache`: Updates service API and documentation +* `service/kinesis`: Updates service API and documentation + +Release v1.5.4 (2016-11-15) +=== + +Service Client Updates +--- +* `service/cognito-idp`: Updates service API and documentation + +Release v1.5.3 (2016-11-11) +=== + +Service Client Updates +--- +* `service/cloudformation`: Updates service documentation and examples +* `service/logs`: Updates service API and documentation + +Release v1.5.2 (2016-11-03) +=== + +Service Client Updates +--- +* `service/directconnect`: Updates service API and documentation + +Release v1.5.1 (2016-11-02) +=== + +Service Client Updates +--- +* `service/email`: Updates service API and documentation + +Release v1.5.0 (2016-11-01) +=== + +Service Client Updates +--- +* `service/cloudformation`: Updates service API and documentation +* `service/ecr`: Updates service paginators + +SDK Feature Updates +--- +* `private/model/api`: Add generated setters for API parameters (#918) + * Adds setters to the SDK's API parameter types, and are a convenience method that reduce the need to use `aws.String` and like utility. + +Release v1.4.22 (2016-10-25) +=== + +Service Client Updates +--- +* `service/elasticloadbalancingv2`: Updates service documentation. +* `service/autoscaling`: Updates service documentation. + +Release v1.4.21 (2016-10-24) +=== + +Service Client Updates +--- +* `service/sms`: AWS Server Migration Service (SMS) is an agentless service which makes it easier and faster for you to migrate thousands of on-premises workloads to AWS. AWS SMS allows you to automate, schedule, and track incremental replications of live server volumes, making it easier for you to coordinate large-scale server migrations. +* `service/ecs`: Updates documentation. + +SDK Feature Updates +--- +* `private/models/api`: Improve code generation of documentation. + +Release v1.4.20 (2016-10-20) +=== + +Service Client Updates +--- +* `service/budgets`: Adds new service, AWS Budgets. +* `service/waf`: Updates service documentation. + +Release v1.4.19 (2016-10-18) +=== + +Service Client Updates +--- +* `service/cloudfront`: Updates service API and documentation. + * Ability to use Amazon CloudFront to deliver your content both via IPv6 and IPv4 using HTTP/HTTPS. +* `service/configservice`: Update service API and documentation. +* `service/iot`: Updates service API and documentation. +* `service/kinesisanalytics`: Updates service API and documentation. + * Whenever Amazon Kinesis Analytics is not able to detect schema for the given streaming source on DiscoverInputSchema API, we would return the raw records that was sampled to detect the schema. +* `service/rds`: Updates service API and documentation. + * Amazon Aurora integrates with other AWS services to allow you to extend your Aurora DB cluster to utilize other capabilities in the AWS cloud. Permission to access other AWS services is granted by creating an IAM role with the necessary permissions, and then associating the role with your DB cluster. + +SDK Feature Updates +--- +* `service/dynamodb/dynamodbattribute`: Add UnmarshalListOfMaps #897 + * Adds support for unmarshaling a list of maps. This is useful for unmarshaling the DynamoDB AttributeValue list of maps returned by APIs like Query and Scan. + +Release v1.4.18 (2016-10-17) +=== + +Service Model Updates +--- +* `service/route53`: Updates service API and documentation. + +Release v1.4.17 +=== + +Service Model Updates +--- +* `service/acm`: Update service API, and documentation. + * This change allows users to import third-party SSL/TLS certificates into ACM. +* `service/elasticbeanstalk`: Update service API, documentation, and pagination. + * Elastic Beanstalk DescribeApplicationVersions API is being updated to support pagination. +* `service/gamelift`: Update service API, and documentation. + * New APIs to protect game developer resource (builds, alias, fleets, instances, game sessions and player sessions) against abuse. + +SDK Features +--- +* `service/s3`: Add support for accelerate with dualstack [#887](https://github.com/aws/aws-sdk-go/issues/887) + +Release v1.4.16 (2016-10-13) +=== + +Service Model Updates +--- +* `service/ecr`: Update Amazon EC2 Container Registry service model + * DescribeImages is a new api used to expose image metadata which today includes image size and image creation timestamp. +* `service/elasticache`: Update Amazon ElastiCache service model + * Elasticache is launching a new major engine release of Redis, 3.2 (providing stability updates and new command sets over 2.8), as well as ElasticSupport for enabling Redis Cluster in 3.2, which provides support for multiple node groups to horizontally scale data, as well as superior engine failover capabilities + +SDK Bug Fixes +--- +* `aws/session`: Skip shared config on read errors [#883](https://github.com/aws/aws-sdk-go/issues/883) +* `aws/signer/v4`: Add support for URL.EscapedPath to signer [#885](https://github.com/aws/aws-sdk-go/issues/885) + +SDK Features +--- +* `private/model/api`: Add docs for errors to API operations [#881](https://github.com/aws/aws-sdk-go/issues/881) +* `private/model/api`: Improve field and waiter doc strings [#879](https://github.com/aws/aws-sdk-go/issues/879) +* `service/dynamodb/dynamodbattribute`: Allow multiple struct tag elements [#886](https://github.com/aws/aws-sdk-go/issues/886) +* Add build tags to internal SDK tools [#880](https://github.com/aws/aws-sdk-go/issues/880) + +Release v1.4.15 (2016-10-06) +=== + +Service Model Updates +--- +* `service/cognitoidentityprovider`: Update Amazon Cognito Identity Provider service model +* `service/devicefarm`: Update AWS Device Farm documentation +* `service/opsworks`: Update AWS OpsWorks service model +* `service/s3`: Update Amazon Simple Storage Service model +* `service/waf`: Update AWS WAF service model + +SDK Bug Fixes +--- +* `aws/request`: Fix HTTP Request Body race condition [#874](https://github.com/aws/aws-sdk-go/issues/874) + +SDK Feature Updates +--- +* `aws/ec2metadata`: Add support for EC2 User Data [#872](https://github.com/aws/aws-sdk-go/issues/872) +* `aws/signer/v4`: Remove logic determining if request needs to be resigned [#876](https://github.com/aws/aws-sdk-go/issues/876) + +Release v1.4.14 (2016-09-29) +=== +* `service/ec2`: api, documentation, and paginators updates. +* `service/s3`: api and documentation updates. + +Release v1.4.13 (2016-09-27) +=== +* `service/codepipeline`: documentation updates. +* `service/cloudformation`: api and documentation updates. +* `service/kms`: documentation updates. +* `service/elasticfilesystem`: documentation updates. +* `service/snowball`: documentation updates. diff --git a/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md b/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md new file mode 100644 index 0000000..8a1927a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md @@ -0,0 +1,5 @@ +### 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 new file mode 100644 index 0000000..7c0186f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md @@ -0,0 +1,127 @@ +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/Gopkg.lock b/vendor/github.com/aws/aws-sdk-go/Gopkg.lock new file mode 100644 index 0000000..854c94f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/Gopkg.lock @@ -0,0 +1,20 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/go-ini/ini" + packages = ["."] + revision = "300e940a926eb277d3901b20bdfcc54928ad3642" + version = "v1.25.4" + +[[projects]] + name = "github.com/jmespath/go-jmespath" + packages = ["."] + revision = "0b12d6b5" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "51a86a867df617990082dec6b868e4efe2fdb2ed0e02a3daa93cd30f962b5085" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/aws/aws-sdk-go/Gopkg.toml b/vendor/github.com/aws/aws-sdk-go/Gopkg.toml new file mode 100644 index 0000000..664fc59 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/Gopkg.toml @@ -0,0 +1,48 @@ + +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" + +ignored = [ + # Testing/Example/Codegen dependencies + "github.com/stretchr/testify", + "github.com/stretchr/testify/assert", + "github.com/stretchr/testify/require", + "github.com/go-sql-driver/mysql", + "github.com/gucumber/gucumber", + "github.com/pkg/errors", + "golang.org/x/net", + "golang.org/x/net/html", + "golang.org/x/net/http2", + "golang.org/x/text", + "golang.org/x/text/html", + "golang.org/x/tools", + "golang.org/x/tools/go/loader", +] + + +[[constraint]] + name = "github.com/go-ini/ini" + version = "1.25.4" + +[[constraint]] + name = "github.com/jmespath/go-jmespath" + revision = "0b12d6b5" + #version = "0.2.2" diff --git a/vendor/github.com/aws/aws-sdk-go/Makefile b/vendor/github.com/aws/aws-sdk-go/Makefile new file mode 100644 index 0000000..83ccc1e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/Makefile @@ -0,0 +1,187 @@ +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' +LINTIGNOREPKGCOMMENT='service/[^/]+/doc_custom.go:.+package comment should be of the form' +UNIT_TEST_TAGS="example codegen awsinclude" + +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/... + +cleanup-integ: + go run -tags "integration" ./awstesting/cmd/bucket_cleanup/main.go "aws-sdk-go-integration" + +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-go19 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-go19: + docker build -f ./awstesting/sandbox/Dockerfile.test.go1.8 -t "aws-sdk-go-1.9" . +sandbox-go19: sandbox-build-go19 + docker run -i -t aws-sdk-go-1.9 bash +sandbox-test-go19: sandbox-build-go19 + docker run -t aws-sdk-go-1.9 + +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} -e ${LINTIGNOREPKGCOMMENT}`; \ + 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 + go get golang.org/x/net/http2 + +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/README.md b/vendor/github.com/aws/aws-sdk-go/README.md new file mode 100644 index 0000000..d5e048a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/README.md @@ -0,0 +1,449 @@ +[![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 for Go + +aws-sdk-go is the official AWS SDK for the Go programming language. + +Checkout our [release notes](https://github.com/aws/aws-sdk-go/releases) for information about the latest bug fixes, updates, and features added to the SDK. + +## 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 have found a bug, please open an [issue](https://github.com/aws/aws-sdk-go/issues/new). + +## Opening Issues + +If you encounter a bug with the AWS SDK for Go we would like to hear about it. Search the [existing issues](https://github.com/aws/aws-sdk-go/issues) and see if others are also experiencing the issue before opening a new issue. Please include the version of AWS SDK for Go, Go language, and OS you’re using. Please also include 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. + +## Overview of SDK's Packages + +The SDK is composed of two main components, SDK core, and service clients. +The SDK core packages are all available under the aws package at the root of +the SDK. Each client for a supported AWS service is available within its own +package under the service folder at the root of the SDK. + + * aws - SDK core, provides common shared types such as Config, Logger, + and utilities to make working with API parameters easier. + + * awserr - Provides the error interface that the SDK will use for all + errors that occur in the SDK's processing. This includes service API + response errors as well. The Error type is made up of a code and message. + Cast the SDK's returned error type to awserr.Error and call the Code + method to compare returned error to specific error codes. See the package's + documentation for additional values that can be extracted such as RequestID. + + * credentials - Provides the types and built in credentials providers + the SDK will use to retrieve AWS credentials to make API requests with. + Nested under this folder are also additional credentials providers such as + stscreds for assuming IAM roles, and ec2rolecreds for EC2 Instance roles. + + * endpoints - Provides the AWS Regions and Endpoints metadata for the SDK. + Use this to lookup AWS service endpoint information such as which services + are in a region, and what regions a service is in. Constants are also provided + for all region identifiers, e.g UsWest2RegionID for "us-west-2". + + * session - Provides initial default configuration, and load + configuration from external sources such as environment and shared + credentials file. + + * request - Provides the API request sending, and retry logic for the SDK. + This package also includes utilities for defining your own request + retryer, and configuring how the SDK processes the request. + + * service - Clients for AWS services. All services supported by the SDK are + available under this folder. + +## How to Use the SDK's AWS Service Clients + +The SDK includes the Go types and utilities you can use to make requests to +AWS service APIs. Within the service folder at the root of the SDK you'll find +a package for each AWS service the SDK supports. All service clients follows +a common pattern of creation and usage. + +When creating a client for an AWS service you'll first need to have a Session +value constructed. The Session provides shared configuration that can be shared +between your service clients. When service clients are created you can pass +in additional configuration via the aws.Config type to override configuration +provided by in the Session to create service client instances with custom +configuration. + +Once the service's client is created you can use it to make API requests the +AWS service. These clients are safe to use concurrently. + +## Configuring the SDK + +In the AWS SDK for Go, you can configure settings for service clients, such +as the log level and maximum number of retries. Most settings are optional; +however, for each service client, you must specify a region and your credentials. +The SDK uses these values to send requests to the correct AWS region and sign +requests with the correct credentials. You can specify these values as part +of a session or as environment variables. + +See the SDK's [configuration guide][config_guide] for more information. + +See the [session][session_pkg] package documentation for more information on how to use Session +with the SDK. + +See the [Config][config_typ] type in the [aws][aws_pkg] package for more information on configuration +options. + +[config_guide]: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html +[session_pkg]: https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ +[config_typ]: https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config +[aws_pkg]: https://docs.aws.amazon.com/sdk-for-go/api/aws/ + +### Configuring Credentials + +When using the SDK you'll generally need your AWS credentials to authenticate +with AWS services. The SDK supports multiple methods of supporting these +credentials. By default the SDK will source credentials automatically from +its default credential chain. See the session package for more information +on this chain, and how to configure it. The common items in the credential +chain are the following: + + * Environment Credentials - Set of environment variables that are useful + when sub processes are created for specific roles. + + * Shared Credentials file (~/.aws/credentials) - This file stores your + credentials based on a profile name and is useful for local development. + + * EC2 Instance Role Credentials - Use EC2 Instance Role to assign credentials + to application running on an EC2 instance. This removes the need to manage + credential files in production. + +Credentials can be configured in code as well by setting the Config's Credentials +value to a custom provider or using one of the providers included with the +SDK to bypass the default credential chain and use a custom one. This is +helpful when you want to instruct the SDK to only use a specific set of +credentials or providers. + +This example creates a credential provider for assuming an IAM role, "myRoleARN" +and configures the S3 service client to use that role for API requests. + +```go + // Initial credentials loaded from SDK's default credential chain. Such as + // the environment, shared credentials (~/.aws/credentials), or EC2 Instance + // Role. These credentials will be used to to make the STS Assume Role API. + sess := session.Must(session.NewSession()) + + // Create the credentials from AssumeRoleProvider to assume the role + // referenced by the "myRoleARN" ARN. + creds := stscreds.NewCredentials(sess, "myRoleArn") + + // Create service client value configured for credentials + // from assumed role. + svc := s3.New(sess, &aws.Config{Credentials: creds}) +``` + +See the [credentials][credentials_pkg] package documentation for more information on credential +providers included with the SDK, and how to customize the SDK's usage of +credentials. + +The SDK has support for the shared configuration file (~/.aws/config). This +support can be enabled by setting the environment variable, "AWS_SDK_LOAD_CONFIG=1", +or enabling the feature in code when creating a Session via the +Option's SharedConfigState parameter. + +```go + sess := session.Must(session.NewSessionWithOptions(session.Options{ + SharedConfigState: session.SharedConfigEnable, + })) +``` + +[credentials_pkg]: ttps://docs.aws.amazon.com/sdk-for-go/api/aws/credentials + +### Configuring AWS Region + +In addition to the credentials you'll need to specify the region the SDK +will use to make AWS API requests to. In the SDK you can specify the region +either with an environment variable, or directly in code when a Session or +service client is created. The last value specified in code wins if the region +is specified multiple ways. + +To set the region via the environment variable set the "AWS_REGION" to the +region you want to the SDK to use. Using this method to set the region will +allow you to run your application in multiple regions without needing additional +code in the application to select the region. + + AWS_REGION=us-west-2 + +The endpoints package includes constants for all regions the SDK knows. The +values are all suffixed with RegionID. These values are helpful, because they +reduce the need to type the region string manually. + +To set the region on a Session use the aws package's Config struct parameter +Region to the AWS region you want the service clients created from the session to +use. This is helpful when you want to create multiple service clients, and +all of the clients make API requests to the same region. + +```go + sess := session.Must(session.NewSession(&aws.Config{ + Region: aws.String(endpoints.UsWest2RegionID), + })) +``` + +See the [endpoints][endpoints_pkg] package for the AWS Regions and Endpoints metadata. + +In addition to setting the region when creating a Session you can also set +the region on a per service client bases. This overrides the region of a +Session. This is helpful when you want to create service clients in specific +regions different from the Session's region. + +```go + svc := s3.New(sess, &aws.Config{ + Region: aws.String(endpoints.UsWest2RegionID), + }) +``` + +See the [Config][config_typ] type in the [aws][aws_pkg] package for more information and additional +options such as setting the Endpoint, and other service client configuration options. + +[endpoints_pkg]: https://docs.aws.amazon.com/sdk-for-go/api/aws/endpoints/ + +## Making API Requests + +Once the client is created you can make an API request to the service. +Each API method takes a input parameter, and returns the service response +and an error. The SDK provides methods for making the API call in multiple ways. + +In this list we'll use the S3 ListObjects API as an example for the different +ways of making API requests. + + * ListObjects - Base API operation that will make the API request to the service. + + * ListObjectsRequest - API methods suffixed with Request will construct the + API request, but not send it. This is also helpful when you want to get a + presigned URL for a request, and share the presigned URL instead of your + application making the request directly. + + * ListObjectsPages - Same as the base API operation, but uses a callback to + automatically handle pagination of the API's response. + + * ListObjectsWithContext - Same as base API operation, but adds support for + the Context pattern. This is helpful for controlling the canceling of in + flight requests. See the Go standard library context package for more + information. This method also takes request package's Option functional + options as the variadic argument for modifying how the request will be + made, or extracting information from the raw HTTP response. + + * ListObjectsPagesWithContext - same as ListObjectsPages, but adds support for + the Context pattern. Similar to ListObjectsWithContext this method also + takes the request package's Option function option types as the variadic + argument. + +In addition to the API operations the SDK also includes several higher level +methods that abstract checking for and waiting for an AWS resource to be in +a desired state. In this list we'll use WaitUntilBucketExists to demonstrate +the different forms of waiters. + + * WaitUntilBucketExists. - Method to make API request to query an AWS service for + a resource's state. Will return successfully when that state is accomplished. + + * WaitUntilBucketExistsWithContext - Same as WaitUntilBucketExists, but adds + support for the Context pattern. In addition these methods take request + package's WaiterOptions to configure the waiter, and how underlying request + will be made by the SDK. + +The API method will document which error codes the service might return for +the operation. These errors will also be available as const strings prefixed +with "ErrCode" in the service client's package. If there are no errors listed +in the API's SDK documentation you'll need to consult the AWS service's API +documentation for the errors that could be returned. + +```go + ctx := context.Background() + + result, err := svc.GetObjectWithContext(ctx, &s3.GetObjectInput{ + Bucket: aws.String("my-bucket"), + Key: aws.String("my-key"), + }) + if err != nil { + // Cast err to awserr.Error to handle specific error codes. + aerr, ok := err.(awserr.Error) + if ok && aerr.Code() == s3.ErrCodeNoSuchKey { + // Specific error code handling + } + return err + } + + // Make sure to close the body when done with it for S3 GetObject APIs or + // will leak connections. + defer result.Body.Close() + + fmt.Println("Object Size:", aws.StringValue(result.ContentLength)) +``` + +### API Request Pagination and Resource Waiters + +Pagination helper methods are suffixed with "Pages", and provide the +functionality needed to round trip API page requests. Pagination methods +take a callback function that will be called for each page of the API's response. + +```go + objects := []string{} + err := svc.ListObjectsPagesWithContext(ctx, &s3.ListObjectsInput{ + Bucket: aws.String(myBucket), + }, func(p *s3.ListObjectsOutput, lastPage bool) bool { + for _, o := range p.Contents { + objects = append(objects, aws.StringValue(o.Key)) + } + return true // continue paging + }) + if err != nil { + panic(fmt.Sprintf("failed to list objects for bucket, %s, %v", myBucket, err)) + } + + fmt.Println("Objects in bucket:", objects) +``` + +Waiter helper methods provide the functionality to wait for an AWS resource +state. These methods abstract the logic needed to to check the state of an +AWS resource, and wait until that resource is in a desired state. The waiter +will block until the resource is in the state that is desired, an error occurs, +or the waiter times out. If a resource times out the error code returned will +be request.WaiterResourceNotReadyErrorCode. + +```go + err := svc.WaitUntilBucketExistsWithContext(ctx, &s3.HeadBucketInput{ + Bucket: aws.String(myBucket), + }) + if err != nil { + aerr, ok := err.(awserr.Error) + if ok && aerr.Code() == request.WaiterResourceNotReadyErrorCode { + fmt.Fprintf(os.Stderr, "timed out while waiting for bucket to exist") + } + panic(fmt.Errorf("failed to wait for bucket to exist, %v", err)) + } + fmt.Println("Bucket", myBucket, "exists") +``` + +## Complete SDK Example + +This example shows a complete working Go file which will upload a file to S3 +and use the Context pattern to implement timeout logic that will cancel the +request if it takes too long. This example highlights how to use sessions, +create a service client, make a request, handle the error, and process the +response. + +```go + package main + + import ( + "context" + "flag" + "fmt" + "os" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/s3" + ) + + // Uploads a file to S3 given a bucket and object key. Also takes a duration + // value to terminate the update if it doesn't complete within that time. + // + // The AWS Region needs to be provided in the AWS shared config or on the + // environment variable as `AWS_REGION`. Credentials also must be provided + // Will default to shared config file, but can load from environment if provided. + // + // Usage: + // # Upload myfile.txt to myBucket/myKey. Must complete within 10 minutes or will fail + // go run withContext.go -b mybucket -k myKey -d 10m < myfile.txt + func main() { + var bucket, key string + var timeout time.Duration + + flag.StringVar(&bucket, "b", "", "Bucket name.") + flag.StringVar(&key, "k", "", "Object key name.") + flag.DurationVar(&timeout, "d", 0, "Upload timeout.") + flag.Parse() + + // All clients require a Session. The Session provides the client with + // shared configuration such as region, endpoint, and credentials. A + // Session should be shared where possible to take advantage of + // configuration and credential caching. See the session package for + // more information. + sess := session.Must(session.NewSession()) + + // Create a new instance of the service's client with a Session. + // Optional aws.Config values can also be provided as variadic arguments + // to the New function. This option allows you to provide service + // specific configuration. + svc := s3.New(sess) + + // Create a context with a timeout that will abort the upload if it takes + // more than the passed in timeout. + ctx := context.Background() + var cancelFn func() + if timeout > 0 { + ctx, cancelFn = context.WithTimeout(ctx, timeout) + } + // Ensure the context is canceled to prevent leaking. + // See context package for more information, https://golang.org/pkg/context/ + defer cancelFn() + + // Uploads the object to S3. The Context will interrupt the request if the + // timeout expires. + _, err := svc.PutObjectWithContext(ctx, &s3.PutObjectInput{ + Bucket: aws.String(bucket), + Key: aws.String(key), + Body: os.Stdin, + }) + if err != nil { + if aerr, ok := err.(awserr.Error); ok && aerr.Code() == request.CanceledErrorCode { + // If the SDK can determine the request or retry delay was canceled + // by a context the CanceledErrorCode error code will be returned. + fmt.Fprintf(os.Stderr, "upload canceled due to timeout, %v\n", err) + } else { + fmt.Fprintf(os.Stderr, "failed to upload object, %v\n", err) + } + os.Exit(1) + } + + fmt.Printf("successfully uploaded file to %s/%s\n", bucket, key) + } +``` + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE.txt and NOTICE.txt for more information. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go index 17fc76a..788fe6e 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" @@ -46,7 +45,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); { @@ -86,61 +85,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(request.NamedHandler{Name: "awssdk.client.LogRequest", Fn: logRequest}) + c.Handlers.Send.PushBackNamed(request.NamedHandler{Name: "awssdk.client.LogResponse", Fn: logResponse}) } 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..e25a460 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 @@ -15,11 +15,11 @@ import ( // the MaxRetries method: // // type retryer struct { -// service.DefaultRetryer +// client.DefaultRetryer // } // // // This implementation always has 100 max retries -// func (d retryer) MaxRetries() uint { return 100 } +// func (d retryer) MaxRetries() int { return 100 } type DefaultRetryer struct { NumMaxRetries int } @@ -54,6 +54,12 @@ func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { // ShouldRetry returns true if the request should be retried. func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { + // 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 + } + if r.HTTPResponse.StatusCode >= 500 { 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..1f39c91 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go @@ -0,0 +1,108 @@ +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() +} + +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) { + lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)} + r.HTTPResponse.Body = &teeReaderCloser{ + Reader: io.TeeReader(r.HTTPResponse.Body, lw), + Source: r.HTTPResponse.Body, + } + + handlerFn := func(req *request.Request) { + body, err := httputil.DumpResponse(req.HTTPResponse, false) + if err != nil { + lw.Logger.Log(fmt.Sprintf(logRespErrMsg, req.ClientInfo.ServiceName, req.Operation.Name, err)) + return + } + + 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(fmt.Sprintf(logRespMsg, req.ClientInfo.ServiceName, req.Operation.Name, string(body))) + if req.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) { + 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, + }) +} 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 f5a7c37..ae3a286 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -53,6 +53,13 @@ type Config struct { // 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" @@ -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. @@ -187,6 +194,10 @@ type Config struct { // request delays. This value should only be used for testing. To adjust // the delay of a request see the aws/client.DefaultRetryer and // aws/request.Retryer. + // + // SleepDelay will prevent any Context from being used for canceling retry + // delay of an API operation. It is recommended to not use SleepDelay at all + // and specify a Retryer instead. SleepDelay func(time.Duration) // DisableRestProtocolURICleaning will not clean the URL path when making rest protocol requests. @@ -439,6 +450,10 @@ func mergeInConfig(dst *Config, other *Config) { if other.DisableRestProtocolURICleaning != nil { dst.DisableRestProtocolURICleaning = other.DisableRestProtocolURICleaning } + + if other.EnforceShouldRetryCheck != nil { + dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck + } } // Copy will return a shallow copy of the Config object. If any additional diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context.go b/vendor/github.com/aws/aws-sdk-go/aws/context.go new file mode 100644 index 0000000..79f4268 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context.go @@ -0,0 +1,71 @@ +package aws + +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" +// API methods with Go v1.6 and a Context type such as golang.org/x/net/context. +// +// See https://golang.org/pkg/context on how to use contexts. +type Context interface { + // Deadline returns the time when work done on behalf of this context + // should be canceled. Deadline returns ok==false when no deadline is + // set. Successive calls to Deadline return the same results. + Deadline() (deadline time.Time, ok bool) + + // Done returns a channel that's closed when work done on behalf of this + // context should be canceled. Done may return nil if this context can + // never be canceled. Successive calls to Done return the same value. + Done() <-chan struct{} + + // Err returns a non-nil error value after Done is closed. Err returns + // Canceled if the context was canceled or DeadlineExceeded if the + // context's deadline passed. No other values for Err are defined. + // After Done is closed, successive calls to Err return the same value. + Err() error + + // Value returns the value associated with this context for key, or nil + // if no value is associated with key. Successive calls to Value with + // the same key returns the same result. + // + // Use context values only for request-scoped data that transits + // processes and API boundaries, not for passing optional parameters to + // 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 new file mode 100644 index 0000000..8fdda53 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go @@ -0,0 +1,41 @@ +// +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) +) 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 new file mode 100644 index 0000000..064f75c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go @@ -0,0 +1,9 @@ +// +build go1.7 + +package aws + +import "context" + +var ( + backgroundCtx = context.Background() +) 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..ff5d58e 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 @@ -311,6 +311,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/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index 8a7bafc..495e3ef 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 @@ -27,7 +27,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) { @@ -71,8 +71,8 @@ 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) { @@ -98,44 +98,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 + }() } - if r.HTTPResponse == nil { - // Add a dummy request response object to ensure the HTTPResponse - // value is consistent. + + var err error + r.HTTPResponse, err = sender(r) + if err != nil { + handleSendError(r, err) + } + }, +} + +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 } -}} + 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 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: + } +} // ValidateResponseHandler is a request handler to validate service response. var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) { @@ -150,13 +201,22 @@ var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseH 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 { + if r.Retryable == nil || aws.BoolValue(r.Config.EnforceShouldRetryCheck) { r.Retryable = aws.Bool(r.ShouldRetry(r)) } if r.WillRetry() { r.RetryDelay = r.RetryRules(r) - r.Config.SleepDelay(r.RetryDelay) + + 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 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..f298d65 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 @@ -13,7 +13,7 @@ var ( // // @readonly 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 +39,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/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go index 7b8ebf5..42416fc 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,7 +43,7 @@ // func (m *MyProvider) Retrieve() (Value, error) {...} // func (m *MyProvider) IsExpired() bool {...} // -// creds := NewCredentials(&MyProvider{}) +// creds := credentials.NewCredentials(&MyProvider{}) // credValue, err := creds.Get() // package credentials @@ -60,7 +60,9 @@ 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 @@ -88,7 +90,7 @@ type Value struct { // The Provider should not need to implement its own mutexes, because // that will be managed by Credentials. type Provider interface { - // Refresh returns nil if it successfully retrieved the value. + // Retrieve returns nil if it successfully retrieved the value. // Error is returned if the value were not obtainable, or empty. Retrieve() (Value, error) @@ -97,6 +99,27 @@ type Provider interface { IsExpired() bool } +// 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. // 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..c14231a 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 @@ -29,6 +29,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/shared_credentials_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go index 7fb7cbf..51e21e0 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,11 @@ 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/shareddefaults" ) // SharedCredsProviderName provides a name of SharedCreds provider @@ -15,8 +15,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) ) @@ -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/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go index b840623..4108e43 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 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 0ef5504..07afe3b 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 @@ -10,10 +10,12 @@ package defaults import ( "fmt" "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" @@ -56,7 +58,6 @@ func Config() *aws.Config { WithMaxRetries(aws.UseServiceDefaultRetries). WithLogger(aws.NewDefaultLogger()). WithLogLevel(aws.LogOff). - WithSleepDelay(time.Sleep). WithEndpointResolver(endpoints.DefaultResolver()) } @@ -97,23 +98,51 @@ func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credenti }) } -// RemoteCredProvider returns a credenitials provider for the default remote +const ( + httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI" + ecsCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_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(ecsCredsProviderEnvVar); len(uri) > 0 { + u := fmt.Sprintf("http://169.254.170.2%s", 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` +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 if host := aws.URLHostname(parsed); !(host == "localhost" || host == "127.0.0.1") { + errMsg = fmt.Sprintf("invalid host address, %q, only localhost and 127.0.0.1 are valid.", 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 }, 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/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 5f0f6dd..644bd9b 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 @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. package endpoints @@ -47,6 +47,7 @@ const ( ApigatewayServiceID = "apigateway" // Apigateway. ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling. Appstream2ServiceID = "appstream2" // Appstream2. + AthenaServiceID = "athena" // Athena. AutoscalingServiceID = "autoscaling" // Autoscaling. BatchServiceID = "batch" // Batch. BudgetsServiceID = "budgets" // Budgets. @@ -54,12 +55,14 @@ const ( 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. @@ -83,11 +86,14 @@ const ( ElasticmapreduceServiceID = "elasticmapreduce" // Elasticmapreduce. ElastictranscoderServiceID = "elastictranscoder" // Elastictranscoder. EmailServiceID = "email" // Email. + EntitlementMarketplaceServiceID = "entitlement.marketplace" // EntitlementMarketplace. EsServiceID = "es" // Es. EventsServiceID = "events" // Events. FirehoseServiceID = "firehose" // Firehose. GameliftServiceID = "gamelift" // Gamelift. GlacierServiceID = "glacier" // Glacier. + GlueServiceID = "glue" // Glue. + GreengrassServiceID = "greengrass" // Greengrass. HealthServiceID = "health" // Health. IamServiceID = "iam" // Iam. ImportexportServiceID = "importexport" // Importexport. @@ -102,7 +108,9 @@ const ( MachinelearningServiceID = "machinelearning" // Machinelearning. MarketplacecommerceanalyticsServiceID = "marketplacecommerceanalytics" // Marketplacecommerceanalytics. MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace. + MghServiceID = "mgh" // Mgh. MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics. + ModelsLexServiceID = "models.lex" // ModelsLex. MonitoringServiceID = "monitoring" // Monitoring. MturkRequesterServiceID = "mturk-requester" // MturkRequester. OpsworksServiceID = "opsworks" // Opsworks. @@ -131,6 +139,7 @@ const ( StsServiceID = "sts" // Sts. SupportServiceID = "support" // Support. SwfServiceID = "swf" // Swf. + TaggingServiceID = "tagging" // Tagging. WafServiceID = "waf" // Waf. WafRegionalServiceID = "waf-regional" // WafRegional. WorkdocsServiceID = "workdocs" // Workdocs. @@ -141,17 +150,20 @@ const ( // DefaultResolver returns an Endpoint resolver that will be able // to resolve endpoints for: AWS Standard, AWS China, and AWS GovCloud (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, and AWS GovCloud (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{ @@ -249,11 +261,14 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -299,6 +314,17 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "athena": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -323,7 +349,15 @@ var awsPartition = partition{ "batch": service{ Endpoints: endpoints{ - "us-east-1": endpoint{}, + "ap-northeast-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{}, }, }, "budgets": service{ @@ -345,6 +379,7 @@ var awsPartition = partition{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -398,6 +433,15 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "cloudhsmv2": service{ + + Endpoints: endpoints{ + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "cloudsearch": service{ Endpoints: endpoints{ @@ -435,19 +479,36 @@ var awsPartition = partition{ "codebuild": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "ap-northeast-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{}, }, }, "codecommit": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": 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{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "codedeploy": service{ @@ -473,13 +534,32 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-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{}, + }, + }, + "codestar": service{ + + Endpoints: endpoints{ + "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{}, }, }, @@ -488,6 +568,8 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, @@ -502,6 +584,8 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, @@ -516,6 +600,8 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, @@ -614,11 +700,16 @@ var awsPartition = partition{ 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-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -755,10 +846,12 @@ var awsPartition = partition{ "elasticfilesystem": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": 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{}, }, }, "elasticloadbalancing": service{ @@ -829,6 +922,16 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "entitlement.marketplace": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "aws-marketplace", + }, + }, + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, "es": service{ Endpoints: endpoints{ @@ -837,8 +940,10 @@ 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{}, @@ -880,10 +985,15 @@ var awsPartition = partition{ "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{}, }, }, @@ -906,6 +1016,24 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "glue": service{ + + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, + "greengrass": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "health": service{ Endpoints: endpoints{ @@ -949,6 +1077,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -1022,11 +1151,14 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -1036,7 +1168,16 @@ var awsPartition = partition{ "lightsail": service{ Endpoints: endpoints{ - "us-east-1": endpoint{}, + "ap-northeast-1": 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{}, }, }, "logs": service{ @@ -1094,12 +1235,28 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "mgh": service{ + + Endpoints: endpoints{ + "us-west-2": endpoint{}, + }, + }, "mobileanalytics": service{ Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, + "models.lex": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "lex", + }, + }, + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, "monitoring": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -1346,6 +1503,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, @@ -1370,9 +1528,15 @@ var awsPartition = partition{ "sms": service{ Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-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{}, }, }, "snowball": service{ @@ -1380,10 +1544,10 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-south-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{}, @@ -1440,10 +1604,13 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1455,8 +1622,10 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-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{}, @@ -1467,6 +1636,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, @@ -1482,7 +1652,7 @@ var awsPartition = partition{ }, "streams.dynamodb": service{ Defaults: endpoint{ - Protocols: []string{"http", "http", "https", "https"}, + Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "dynamodb", }, @@ -1537,9 +1707,33 @@ var awsPartition = partition{ "eu-west-2": 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: "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{ @@ -1567,6 +1761,25 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "tagging": 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{}, + }, + }, "waf": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, @@ -1586,6 +1799,7 @@ var awsPartition = partition{ "ap-northeast-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -1620,8 +1834,10 @@ 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{}, @@ -1658,6 +1874,18 @@ var awscnPartition = partition{ }, }, Services: services{ + "application-autoscaling": service{ + Defaults: endpoint{ + Hostname: "autoscaling.{region}.amazonaws.com", + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "application-autoscaling", + }, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, "autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -1678,6 +1906,12 @@ var awscnPartition = partition{ "cn-north-1": endpoint{}, }, }, + "codedeploy": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ @@ -1717,6 +1951,18 @@ var awscnPartition = partition{ }, }, }, + "ecr": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "ecs": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, "elasticache": service{ Endpoints: endpoints{ @@ -1772,6 +2018,16 @@ var awscnPartition = partition{ }, }, }, + "iot": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "execute-api", + }, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, "kinesis": service{ Endpoints: endpoints{ @@ -1830,6 +2086,12 @@ var awscnPartition = partition{ "cn-north-1": endpoint{}, }, }, + "ssm": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, "storagegateway": service{ Endpoints: endpoints{ @@ -1838,7 +2100,7 @@ var awscnPartition = partition{ }, "streams.dynamodb": service{ Defaults: endpoint{ - Protocols: []string{"http", "http", "https", "https"}, + Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "dynamodb", }, @@ -1855,6 +2117,12 @@ var awscnPartition = partition{ }, "swf": service{ + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "tagging": service{ + Endpoints: endpoints{ "cn-north-1": endpoint{}, }, @@ -1888,6 +2156,18 @@ var awsusgovPartition = partition{ }, }, Services: services{ + "acm": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "apigateway": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "autoscaling": service{ Endpoints: endpoints{ @@ -1914,6 +2194,12 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "codedeploy": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ @@ -1971,6 +2257,12 @@ var awsusgovPartition = partition{ }, }, }, + "events": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "glacier": service{ Endpoints: endpoints{ @@ -2004,6 +2296,12 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "lambda": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "logs": service{ Endpoints: endpoints{ @@ -2028,6 +2326,12 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "rekognition": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "s3": service{ Defaults: endpoint{ SignatureVersions: []string{"s3", "s3v4"}, @@ -2045,6 +2349,12 @@ var awsusgovPartition = partition{ }, }, }, + "sms": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "snowball": service{ Endpoints: endpoints{ @@ -2068,6 +2378,12 @@ var awsusgovPartition = partition{ }, }, }, + "ssm": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "streams.dynamodb": service{ Defaults: endpoint{ CredentialScope: credentialScope{ 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..9c3eedb 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 @@ -124,6 +124,49 @@ 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 { @@ -132,7 +175,7 @@ type Partition struct { } // 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. @@ -155,13 +198,13 @@ func (p *Partition) ID() string { return p.id } // 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 { +func (p Partition) Regions() map[string]Region { rs := map[string]Region{} for id := range p.p.Regions { rs[id] = Region{ @@ -175,7 +218,7 @@ func (p *Partition) Regions() map[string]Region { // Services returns a map of Service indexed by their ID. This is useful for // enumerating over the services in a partition. -func (p *Partition) Services() map[string]Service { +func (p Partition) Services() map[string]Service { ss := map[string]Service{} for id := range p.p.Services { ss[id] = Service{ @@ -195,16 +238,16 @@ 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 } // 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,17 +269,38 @@ 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 _, ok := s.p.Regions[id]; ok { + rs[id] = Region{ + id: id, + 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 { +// +// A region is the AWS region the service exists in. Whereas a Endpoint is +// an URL that can be resolved to a instance of a service. +func (s Service) Endpoints() map[string]Endpoint { es := map[string]Endpoint{} for id := range s.p.Services[s.id].Endpoints { es[id] = Endpoint{ @@ -259,15 +323,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...) } @@ -300,28 +364,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/v3model_codegen.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go index 1e7369d..05e92df 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 @@ -158,7 +158,7 @@ var funcMap = template.FuncMap{ const v3Tmpl = ` {{ define "defaults" -}} -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. package endpoints @@ -209,17 +209,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/jsonvalue.go b/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go new file mode 100644 index 0000000..91a6f27 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go @@ -0,0 +1,12 @@ +package aws + +// JSONValue is a representation of a grab bag type that will be marshaled +// into a json string. This type can be used just like any other map. +// +// Example: +// +// values := aws.JSONValue{ +// "Foo": "Bar", +// } +// values["Baz"] = "Qux" +type JSONValue map[string]interface{} 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..3babb5a 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() 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..271da43 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go @@ -0,0 +1,19 @@ +// +build !appengine,!plan9 + +package request + +import ( + "net" + "os" + "syscall" +) + +func isErrConnectionReset(err error) bool { + if opErr, ok := err.(*net.OpError); ok { + if sysErr, ok := opErr.Err.(*os.SyscallError); ok { + return sysErr.Err == syscall.ECONNRESET + } + } + + return false +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go new file mode 100644 index 0000000..daf9eca --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go @@ -0,0 +1,11 @@ +// +build appengine plan9 + +package request + +import ( + "strings" +) + +func isErrConnectionReset(err error) bool { + return strings.Contains(err.Error(), "connection reset") +} 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 5279c19..802ac88 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 @@ -18,6 +18,7 @@ type Handlers struct { UnmarshalError HandlerList Retry HandlerList AfterRetry HandlerList + Complete HandlerList } // Copy returns of this handler's lists. @@ -33,6 +34,7 @@ func (h *Handlers) Copy() Handlers { UnmarshalMeta: h.UnmarshalMeta.copy(), Retry: h.Retry.copy(), AfterRetry: h.AfterRetry.copy(), + Complete: h.Complete.copy(), } } @@ -48,6 +50,7 @@ func (h *Handlers) Clear() { h.ValidateResponse.Clear() h.Retry.Clear() h.AfterRetry.Clear() + h.Complete.Clear() } // A HandlerListRunItem represents an entry in the HandlerList which @@ -85,13 +88,17 @@ func (l *HandlerList) copy() HandlerList { n := HandlerList{ AfterEachFn: l.AfterEachFn, } - n.list = append([]NamedHandler{}, l.list...) + if len(l.list) == 0 { + return n + } + + n.list = append(make([]NamedHandler, 0, len(l.list)), l.list...) return n } // Clear clears the handler list. func (l *HandlerList) Clear() { - l.list = []NamedHandler{} + l.list = l.list[0:0] } // Len returns the number of handlers in the list. @@ -101,33 +108,85 @@ func (l *HandlerList) Len() int { // PushBack pushes handler f to the back of the handler list. func (l *HandlerList) PushBack(f func(*Request)) { - l.list = append(l.list, NamedHandler{"__anonymous", f}) -} - -// PushFront pushes handler f to the front of the handler list. -func (l *HandlerList) PushFront(f func(*Request)) { - l.list = append([]NamedHandler{{"__anonymous", f}}, l.list...) + l.PushBackNamed(NamedHandler{"__anonymous", f}) } // PushBackNamed pushes named handler f to the back of the handler list. func (l *HandlerList) PushBackNamed(n NamedHandler) { + if cap(l.list) == 0 { + l.list = make([]NamedHandler, 0, 5) + } l.list = append(l.list, n) } +// PushFront pushes handler f to the front of the handler list. +func (l *HandlerList) PushFront(f func(*Request)) { + l.PushFrontNamed(NamedHandler{"__anonymous", f}) +} + // PushFrontNamed pushes named handler f to the front of the handler list. func (l *HandlerList) PushFrontNamed(n NamedHandler) { - l.list = append([]NamedHandler{n}, l.list...) + if cap(l.list) == len(l.list) { + // Allocating new list required + l.list = append([]NamedHandler{n}, l.list...) + } else { + // Enough room to prepend into list. + l.list = append(l.list, NamedHandler{}) + copy(l.list[1:], l.list) + l.list[0] = n + } } // Remove removes a NamedHandler n func (l *HandlerList) Remove(n NamedHandler) { - newlist := []NamedHandler{} - for _, m := range l.list { - if m.Name != n.Name { - newlist = append(newlist, m) + 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 == name { + // Shift array preventing creating new arrays + copy(l.list[i:], l.list[i+1:]) + l.list[len(l.list)-1] = NamedHandler{} + l.list = l.list[:len(l.list)-1] + + // decrement list so next check to length is correct + i-- } } - l.list = newlist +} + +// 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 +} + +// 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. @@ -163,6 +222,16 @@ func HandlerListStopOnError(item HandlerListRunItem) bool { return item.Request.Error == nil } +// WithAppendUserAgent will add a string to the user agent prefixed with a +// single white space. +func WithAppendUserAgent(s string) Option { + return func(r *Request) { + r.Handlers.Build.PushBack(func(r2 *Request) { + AddToUserAgent(r, s) + }) + } +} + // MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request // header. If the extra parameters are provided they will be added as metadata to the // name/version pair resulting in the following format. 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 77312bb..911c058 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 @@ -16,6 +16,24 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" ) +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" + + // 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 { Config aws.Config @@ -23,30 +41,33 @@ 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 + 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 + DisableFollowRedirects bool + + context aws.Context built bool - // Need to persist an intermideant body betweend the input Body and HTTP + // Need to persist an intermediate body between the input Body and HTTP // request body because the HTTP Client's transport can maintain a reference // to the HTTP request's body after the client has returned. This value is - // safe to use concurrently and rewraps the input Body for each HTTP request. + // safe to use concurrently and wrap the input Body for each HTTP request. safeBody *offsetReader } @@ -60,14 +81,6 @@ type Operation struct { BeforePresignFn func(r *Request) error } -// Paginator keeps track of pagination configuration for an API operation. -type Paginator struct { - InputTokens []string - OutputTokens []string - LimitToken string - TruncationToken string -} - // New returns a new Request pointer for the service API // operation and parameters. // @@ -111,6 +124,94 @@ func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, return r } +// A Option is a functional option that can augment or modify a request when +// using a WithContext API operation method. +type Option func(*Request) + +// WithGetResponseHeader builds a request Option which will retrieve a single +// header value from the HTTP Response. If there are multiple values for the +// header key use WithGetResponseHeaders instead to access the http.Header +// map directly. The passed in val pointer must be non-nil. +// +// This Option can be used multiple times with a single API operation. +// +// var id2, versionID string +// svc.PutObjectWithContext(ctx, params, +// request.WithGetResponseHeader("x-amz-id-2", &id2), +// request.WithGetResponseHeader("x-amz-version-id", &versionID), +// ) +func WithGetResponseHeader(key string, val *string) Option { + return func(r *Request) { + r.Handlers.Complete.PushBack(func(req *Request) { + *val = req.HTTPResponse.Header.Get(key) + }) + } +} + +// WithGetResponseHeaders builds a request Option which will retrieve the +// headers from the HTTP response and assign them to the passed in headers +// variable. The passed in headers pointer must be non-nil. +// +// var headers http.Header +// svc.PutObjectWithContext(ctx, params, request.WithGetResponseHeaders(&headers)) +func WithGetResponseHeaders(headers *http.Header) Option { + return func(r *Request) { + r.Handlers.Complete.PushBack(func(req *Request) { + *headers = req.HTTPResponse.Header + }) + } +} + +// WithLogLevel is a request option that will set the request to use a specific +// log level when the request is made. +// +// svc.PutObjectWithContext(ctx, params, request.WithLogLevel(aws.LogDebugWithHTTPBody) +func WithLogLevel(l aws.LogLevelType) Option { + return func(r *Request) { + r.Config.LogLevel = aws.LogLevel(l) + } +} + +// ApplyOptions will apply each option to the request calling them in the order +// the were provided. +func (r *Request) ApplyOptions(opts ...Option) { + for _, opt := range opts { + opt(r) + } +} + +// Context will always returns a non-nil context. If Request does not have a +// context aws.BackgroundContext will be returned. +func (r *Request) Context() aws.Context { + if r.context != nil { + return r.context + } + return aws.BackgroundContext() +} + +// SetContext adds a Context to the current request that can be used to cancel +// a in-flight request. The Context value must not be nil, or this method will +// panic. +// +// Unlike http.Request.WithContext, SetContext does not return a copy of the +// Request. It is not safe to use use a single Request value for multiple +// requests. A new Request should be created for each API operation request. +// +// Go 1.6 and below: +// The http.Request's Cancel field will be set to the Done() value of +// the context. This will overwrite the Cancel field's value. +// +// Go 1.7 and above: +// The http.Request.WithContext will be used to set the context on the underlying +// http.Request. This will create a shallow copy of the http.Request. The SDK +// may create sub contexts in the future for nested requests such as retries. +func (r *Request) SetContext(ctx aws.Context) { + if ctx == nil { + panic("context cannot be nil") + } + setRequestContext(r, ctx) +} + // WillRetry returns if the request's can be retried. func (r *Request) WillRetry() bool { return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() @@ -168,11 +269,17 @@ func (r *Request) Presign(expireTime time.Duration) (string, error) { 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 +// PresignRequest behaves just like presign, with the addition of returning a +// set of headers that were signed. +// +// 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(expireTime time.Duration) (string, http.Header, error) { r.ExpireTime = expireTime - r.NotHoist = true r.Sign() if r.Error != nil { return "", nil, r.Error @@ -237,10 +344,7 @@ 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() (io.ReadCloser, error) { if r.safeBody != nil { r.safeBody.Close() } @@ -262,14 +366,14 @@ func (r *Request) ResetBody() { // Related golang/go#18257 l, err := computeBodyLength(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) } + var body io.ReadCloser 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 @@ -281,11 +385,13 @@ func (r *Request) ResetBody() { // a io.Reader that was not also an io.Seeker. switch r.Operation.HTTPMethod { case "GET", "HEAD", "DELETE": - r.HTTPRequest.Body = noBodyReader + body = NoBody default: - r.HTTPRequest.Body = r.safeBody + body = r.safeBody } } + + return body, nil } // Attempts to compute the length of the body of the reader using the @@ -344,6 +450,12 @@ func (r *Request) GetBody() io.ReadSeeker { // // Send will not close the request.Request's body. func (r *Request) Send() error { + defer func() { + // Regardless of success or failure of the request trigger the Complete + // request handlers. + r.Handlers.Complete.Run(r) + }() + for { if aws.BoolValue(r.Retryable) { if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { @@ -381,7 +493,7 @@ func (r *Request) Send() error { r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { - debugLogReqError(r, "Send Request", false, r.Error) + debugLogReqError(r, "Send Request", false, err) return r.Error } debugLogReqError(r, "Send Request", true, err) @@ -390,12 +502,13 @@ func (r *Request) Send() error { r.Handlers.UnmarshalMeta.Run(r) r.Handlers.ValidateResponse.Run(r) if r.Error != nil { - err := r.Error r.Handlers.UnmarshalError.Run(r) + err := r.Error + r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { - debugLogReqError(r, "Validate Response", false, r.Error) + debugLogReqError(r, "Validate Response", false, err) return r.Error } debugLogReqError(r, "Validate Response", true, err) @@ -408,7 +521,7 @@ func (r *Request) Send() error { r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { - debugLogReqError(r, "Unmarshal Response", false, r.Error) + debugLogReqError(r, "Unmarshal Response", false, err) return r.Error } debugLogReqError(r, "Unmarshal Response", true, err) @@ -446,6 +559,9 @@ func shouldRetryCancel(r *Request) bool { 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() 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..869b97a 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 +// 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. +// +// 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_8.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go index 8b963f4..c32fc69 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,32 @@ package request -import "net/http" +import ( + "net/http" +) -// Is a http.NoBody reader instructing Go HTTP client to not include +// 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 +// 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. +// +// 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 = err + return + } + + r.HTTPRequest.Body = body + r.HTTPRequest.GetBody = r.getNextRequestBody +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go new file mode 100644 index 0000000..a7365cd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go @@ -0,0 +1,14 @@ +// +build go1.7 + +package request + +import "github.com/aws/aws-sdk-go/aws" + +// setContext updates the Request to use the passed in context for cancellation. +// Context will also be used for request retry delay. +// +// Creates shallow copy of the http.Request with the WithContext method. +func setRequestContext(r *Request, ctx aws.Context) { + r.context = ctx + r.HTTPRequest = r.HTTPRequest.WithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go new file mode 100644 index 0000000..307fa07 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go @@ -0,0 +1,14 @@ +// +build !go1.7 + +package request + +import "github.com/aws/aws-sdk-go/aws" + +// setContext updates the Request to use the passed in context for cancellation. +// Context will also be used for request retry delay. +// +// Creates shallow copy of the http.Request with the WithContext method. +func setRequestContext(r *Request, ctx aws.Context) { + r.context = ctx + r.HTTPRequest.Cancel = ctx.Done() +} 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 2939ec4..59de673 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 @@ -2,29 +2,125 @@ package request import ( "reflect" + "sync/atomic" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" ) -//type Paginater interface { -// HasNextPage() bool -// NextPage() *Request -// EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error -//} +// A Pagination provides paginating of SDK API operations which are paginatable. +// Generally you should not use this type directly, but use the "Pages" API +// operations method to automatically perform pagination for you. Such as, +// "S3.ListObjectsPages", and "S3.ListObjectsPagesWithContext" methods. +// +// Pagination differs from a Paginator type in that pagination is the type that +// does the pagination between API operations, and Paginator defines the +// configuration that will be used per page request. +// +// cont := true +// for p.Next() && cont { +// data := p.Page().(*s3.ListObjectsOutput) +// // process the page's data +// } +// return p.Err() +// +// See service client API operation Pages methods for examples how the SDK will +// use the Pagination type. +type Pagination struct { + // Function to return a Request value for each pagination request. + // Any configuration or handlers that need to be applied to the request + // prior to getting the next page should be done here before the request + // returned. + // + // 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) -// HasNextPage returns true if this request has more pages of data available. -func (r *Request) HasNextPage() bool { - return len(r.nextPageTokens()) > 0 + started bool + nextTokens []interface{} + + err error + curPage interface{} } -// nextPageTokens returns the tokens to use when asking for the next page of -// data. +// HasNextPage will return true if Pagination is able to determine that the API +// operation has additional pages. False will be returned if there are no more +// pages remaining. +// +// Will always return true if Next has not been called yet. +func (p *Pagination) HasNextPage() bool { + return !(p.started && len(p.nextTokens) == 0) +} + +// Err returns the error Pagination encountered when retrieving the next page. +func (p *Pagination) Err() error { + return p.err +} + +// Page returns the current page. Page should only be called after a successful +// call to Next. It is undefined what Page will return if Page is called after +// Next returns false. +func (p *Pagination) Page() interface{} { + return p.curPage +} + +// Next will attempt to retrieve the next page for the API operation. When a page +// is retrieved true will be returned. If the page cannot be retrieved, or there +// are no more pages false will be returned. +// +// Use the Page method to retrieve the current page data. The data will need +// to be cast to the API operation's output type. +// +// Use the Err method to determine if an error occurred if Page returns false. +func (p *Pagination) Next() bool { + if !p.HasNextPage() { + return false + } + + req, err := p.NewRequest() + if err != nil { + p.err = err + return false + } + + if p.started { + for i, intok := range req.Operation.InputTokens { + awsutil.SetValueAtPath(req.Params, intok, p.nextTokens[i]) + } + } + p.started = true + + err = req.Send() + if err != nil { + p.err = err + return false + } + + p.nextTokens = req.nextPageTokens() + p.curPage = req.Data + + return true +} + +// A Paginator is the configuration data that defines how an API operation +// should be paginated. This type is used by the API service models to define +// the generated pagination config for service APIs. +// +// The Pagination type is what provides iterating between pages of an API. It +// is only used to store the token metadata the SDK should use for performing +// pagination. +type Paginator struct { + InputTokens []string + OutputTokens []string + LimitToken string + TruncationToken string +} + +// nextPageTokens returns the tokens to use when asking for the next page of data. func (r *Request) nextPageTokens() []interface{} { if r.Operation.Paginator == nil { return nil } - if r.Operation.TruncationToken != "" { tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken) if len(tr) == 0 { @@ -61,9 +157,40 @@ func (r *Request) nextPageTokens() []interface{} { return tokens } +// Ensure a deprecated item is only logged once instead of each time its used. +func logDeprecatedf(logger aws.Logger, flag *int32, msg string) { + if logger == nil { + return + } + if atomic.CompareAndSwapInt32(flag, 0, 1) { + logger.Log(msg) + } +} + +var ( + logDeprecatedHasNextPage int32 + logDeprecatedNextPage int32 + logDeprecatedEachPage int32 +) + +// HasNextPage returns true if this request has more pages of data available. +// +// Deprecated Use Pagination type for configurable pagination of API operations +func (r *Request) HasNextPage() bool { + logDeprecatedf(r.Config.Logger, &logDeprecatedHasNextPage, + "Request.HasNextPage deprecated. Use Pagination type for configurable pagination of API operations") + + return len(r.nextPageTokens()) > 0 +} + // NextPage returns a new Request that can be executed to return the next // page of result data. Call .Send() on this request to execute it. +// +// Deprecated Use Pagination type for configurable pagination of API operations func (r *Request) NextPage() *Request { + logDeprecatedf(r.Config.Logger, &logDeprecatedNextPage, + "Request.NextPage deprecated. Use Pagination type for configurable pagination of API operations") + tokens := r.nextPageTokens() if len(tokens) == 0 { return nil @@ -90,7 +217,12 @@ func (r *Request) NextPage() *Request { // as the structure "T". The lastPage value represents whether the page is // the last page of data or not. The return value of this function should // return true to keep iterating or false to stop. +// +// Deprecated Use Pagination type for configurable pagination of API operations func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error { + logDeprecatedf(r.Config.Logger, &logDeprecatedEachPage, + "Request.EachPage deprecated. Use Pagination type for configurable pagination of API operations") + for page := r; page != nil; page = page.NextPage() { if err := page.Send(); err != nil { return err 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 ebd60cc..f35fef2 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 @@ -8,7 +8,7 @@ import ( ) // Retryer is an interface to control retry logic for a given service. -// The default implementation used by most services is the service.DefaultRetryer +// The default implementation used by most services is the client.DefaultRetryer // structure, which contains basic retry logic using exponential backoff. type Retryer interface { RetryRules(*Request) time.Duration @@ -26,8 +26,10 @@ func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { // retryableCodes is a collection of service response codes which are retry-able // without any further action. var retryableCodes = map[string]struct{}{ - "RequestError": {}, - "RequestTimeout": {}, + "RequestError": {}, + "RequestTimeout": {}, + ErrCodeResponseTimeout: {}, + "RequestTimeoutException": {}, // Glacier's flavor of RequestTimeout } var throttleCodes = map[string]struct{}{ @@ -36,7 +38,6 @@ var throttleCodes = map[string]struct{}{ "ThrottlingException": {}, "RequestLimitExceeded": {}, "RequestThrottled": {}, - "LimitExceededException": {}, // Deleting 10+ DynamoDb tables at once "TooManyRequestsException": {}, // Lambda functions "PriorRequestNotComplete": {}, // Route53 } @@ -68,35 +69,93 @@ func isCodeExpiredCreds(code string) bool { return ok } +var validParentCodes = map[string]struct{}{ + ErrCodeSerialization: {}, + ErrCodeRead: {}, +} + +type temporaryError interface { + Temporary() bool +} + +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.(temporaryError); ok { + return t.Temporary() + } + + return isErrConnectionReset(err) +} + // IsErrorRetryable returns whether the error is retryable, based on its Code. -// Returns false if the request has no Error set. -func (r *Request) IsErrorRetryable() bool { - if r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - return isCodeRetryable(err.Code()) +// Returns false if error is nil. +func IsErrorRetryable(err error) bool { + if err != nil { + if aerr, ok := err.(awserr.Error); ok { + return isCodeRetryable(aerr.Code()) || isNestedErrorRetryable(aerr) } } return false } // IsErrorThrottle returns whether the error is to be throttled based on its code. -// Returns false if the request has no Error set -func (r *Request) IsErrorThrottle() bool { - if r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - return isCodeThrottle(err.Code()) +// Returns false if error is nil. +func IsErrorThrottle(err error) bool { + if err != nil { + if aerr, ok := err.(awserr.Error); ok { + return isCodeThrottle(aerr.Code()) } } return false } -// IsErrorExpired returns whether the error code is a credential expiry error. -// Returns false if the request has no Error set. -func (r *Request) IsErrorExpired() bool { - if r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - return isCodeExpiredCreds(err.Code()) +// IsErrorExpiredCreds returns whether the error code is a credential expiry error. +// Returns false if error is nil. +func IsErrorExpiredCreds(err error) bool { + if err != nil { + if aerr, ok := err.(awserr.Error); ok { + 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 { + 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 +// +// Alias for the utility function IsErrorThrottle +func (r *Request) IsErrorThrottle() bool { + return IsErrorThrottle(r.Error) +} + +// 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 { + return IsErrorExpiredCreds(r.Error) +} 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..4012462 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 @@ -220,7 +220,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), }, 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 new file mode 100644 index 0000000..4601f88 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go @@ -0,0 +1,295 @@ +package request + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" +) + +// WaiterResourceNotReadyErrorCode is the error code returned by a waiter when +// the waiter's max attempts have been exhausted. +const WaiterResourceNotReadyErrorCode = "ResourceNotReady" + +// A WaiterOption is a function that will update the Waiter value's fields to +// configure the waiter. +type WaiterOption func(*Waiter) + +// WithWaiterMaxAttempts returns the maximum number of times the waiter should +// attempt to check the resource for the target state. +func WithWaiterMaxAttempts(max int) WaiterOption { + return func(w *Waiter) { + w.MaxAttempts = max + } +} + +// WaiterDelay will return a delay the waiter should pause between attempts to +// check the resource state. The passed in attempt is the number of times the +// Waiter has checked the resource state. +// +// Attempt is the number of attempts the Waiter has made checking the resource +// state. +type WaiterDelay func(attempt int) time.Duration + +// ConstantWaiterDelay returns a WaiterDelay that will always return a constant +// delay the waiter should use between attempts. It ignores the number of +// attempts made. +func ConstantWaiterDelay(delay time.Duration) WaiterDelay { + return func(attempt int) time.Duration { + return delay + } +} + +// WithWaiterDelay will set the Waiter to use the WaiterDelay passed in. +func WithWaiterDelay(delayer WaiterDelay) WaiterOption { + return func(w *Waiter) { + w.Delay = delayer + } +} + +// WithWaiterLogger returns a waiter option to set the logger a waiter +// should use to log warnings and errors to. +func WithWaiterLogger(logger aws.Logger) WaiterOption { + return func(w *Waiter) { + w.Logger = logger + } +} + +// WithWaiterRequestOptions returns a waiter option setting the request +// options for each request the waiter makes. Appends to waiter's request +// options already set. +func WithWaiterRequestOptions(opts ...Option) WaiterOption { + return func(w *Waiter) { + w.RequestOptions = append(w.RequestOptions, opts...) + } +} + +// 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. +type Waiter struct { + Name string + Acceptors []WaiterAcceptor + Logger aws.Logger + + MaxAttempts int + Delay WaiterDelay + + 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. +func (w *Waiter) ApplyOptions(opts ...WaiterOption) { + for _, fn := range opts { + fn(w) + } +} + +// WaiterState are states the waiter uses based on WaiterAcceptor definitions +// to identify if the resource state the waiter is waiting on has occurred. +type WaiterState int + +// String returns the string representation of the waiter state. +func (s WaiterState) String() string { + switch s { + case SuccessWaiterState: + return "success" + case FailureWaiterState: + return "failure" + case RetryWaiterState: + return "retry" + default: + return "unknown waiter state" + } +} + +// States the waiter acceptors will use to identify target resource states. +const ( + SuccessWaiterState WaiterState = iota // waiter successful + FailureWaiterState // waiter failed + RetryWaiterState // waiter needs to be retried +) + +// WaiterMatchMode is the mode that the waiter will use to match the WaiterAcceptor +// definition's Expected attribute. +type WaiterMatchMode int + +// Modes the waiter will use when inspecting API response to identify target +// resource states. +const ( + PathAllWaiterMatch WaiterMatchMode = iota // match on all paths + PathWaiterMatch // match on specific path + PathAnyWaiterMatch // match on any path + PathListWaiterMatch // match on list of paths + StatusWaiterMatch // match on status code + ErrorWaiterMatch // match on error +) + +// String returns the string representation of the waiter match mode. +func (m WaiterMatchMode) String() string { + switch m { + case PathAllWaiterMatch: + return "pathAll" + case PathWaiterMatch: + return "path" + case PathAnyWaiterMatch: + return "pathAny" + case PathListWaiterMatch: + return "pathList" + case StatusWaiterMatch: + return "status" + case ErrorWaiterMatch: + return "error" + default: + return "unknown waiter match mode" + } +} + +// WaitWithContext will make requests for the API operation using NewRequest to +// build API requests. The request's response will be compared against the +// Waiter's Acceptors to determine the successful state of the resource the +// waiter is inspecting. +// +// The passed in context must not be nil. If it is nil a panic will occur. The +// Context will be used to cancel the waiter's pending requests and retry delays. +// Use aws.BackgroundContext if no context is available. +// +// The waiter will continue until the target state defined by the Acceptors, +// or the max attempts expires. +// +// Will return the WaiterResourceNotReadyErrorCode error code if the waiter's +// retryer ShouldRetry returns false. This normally will happen when the max +// wait attempts expires. +func (w Waiter) WaitWithContext(ctx aws.Context) error { + + for attempt := 1; ; attempt++ { + req, err := w.NewRequest(w.RequestOptions) + if err != nil { + waiterLogf(w.Logger, "unable to create request %v", err) + return err + } + req.Handlers.Build.PushBack(MakeAddToUserAgentFreeFormHandler("Waiter")) + err = req.Send() + + // See if any of the acceptors match the request's response, or error + for _, a := range w.Acceptors { + if matched, matchErr := a.match(w.Name, w.Logger, req, err); matched { + return matchErr + } + } + + // The Waiter should only check the resource state MaxAttempts times + // This is here instead of in the for loop above to prevent delaying + // unnecessary when the waiter will not retry. + if attempt == w.MaxAttempts { + break + } + + // Delay to wait before inspecting the resource again + delay := w.Delay(attempt) + if sleepFn := req.Config.SleepDelay; sleepFn != nil { + // Support SleepDelay for backwards compatibility and testing + sleepFn(delay) + } 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) + } + } + } + + return awserr.New(WaiterResourceNotReadyErrorCode, "exceeded wait attempts", nil) +} + +// A WaiterAcceptor provides the information needed to wait for an API operation +// to complete. +type WaiterAcceptor struct { + State WaiterState + Matcher WaiterMatchMode + Argument string + Expected interface{} +} + +// match returns if the acceptor found a match with the passed in request +// or error. True is returned if the acceptor made a match, error is returned +// if there was an error attempting to perform the match. +func (a *WaiterAcceptor) match(name string, l aws.Logger, req *Request, err error) (bool, error) { + result := false + var vals []interface{} + + switch a.Matcher { + case PathAllWaiterMatch, PathWaiterMatch: + // Require all matches to be equal for result to match + vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) + if len(vals) == 0 { + break + } + result = true + for _, val := range vals { + if !awsutil.DeepEqual(val, a.Expected) { + result = false + break + } + } + case PathAnyWaiterMatch: + // Only a single match needs to equal for the result to match + vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) + for _, val := range vals { + if awsutil.DeepEqual(val, a.Expected) { + result = true + break + } + } + case PathListWaiterMatch: + // ignored matcher + case StatusWaiterMatch: + s := a.Expected.(int) + result = s == req.HTTPResponse.StatusCode + case ErrorWaiterMatch: + if aerr, ok := err.(awserr.Error); ok { + result = aerr.Code() == a.Expected.(string) + } + default: + waiterLogf(l, "WARNING: Waiter %s encountered unexpected matcher: %s", + name, a.Matcher) + } + + if !result { + // If there was no matching result found there is nothing more to do + // for this response, retry the request. + return false, nil + } + + switch a.State { + case SuccessWaiterState: + // waiter completed + return true, nil + case FailureWaiterState: + // Waiter failure state triggered + return true, awserr.New(WaiterResourceNotReadyErrorCode, + "failed waiting for successful resource state", err) + case RetryWaiterState: + // clear the error and retry the operation + return false, nil + default: + waiterLogf(l, "WARNING: Waiter %s encountered unexpected state: %s", + name, a.State) + return false, nil + } +} + +func waiterLogf(logger aws.Logger, msg string, args ...interface{}) { + if logger != nil { + logger.Log(fmt.Sprintf(msg, args...)) + } +} 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..ea7b886 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 @@ -23,7 +23,7 @@ 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 +SharedConfigEnable will create the session as if the AWS_SDK_LOAD_CONFIG environment variable was set. Creating Sessions @@ -84,7 +84,7 @@ override the shared config state (AWS_SDK_LOAD_CONFIG). // Force enable Shared Config support sess := session.Must(session.NewSessionWithOptions(session.Options{ - SharedConfigState: SharedConfigEnable, + SharedConfigState: session.SharedConfigEnable, })) Adding Handlers @@ -124,9 +124,8 @@ 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 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..4b102f8 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 @@ -2,7 +2,6 @@ package session import ( "os" - "path/filepath" "strconv" "github.com/aws/aws-sdk-go/aws/credentials" @@ -77,7 +76,7 @@ type envConfig struct { 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. + // 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. // @@ -116,6 +115,12 @@ 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", + } ) // loadEnvConfig retrieves the SDK's environment configuration. @@ -165,8 +170,8 @@ func envConfigLoad(enableSharedConfig bool) envConfig { setFromEnvVal(&cfg.Region, regionKeys) setFromEnvVal(&cfg.Profile, profileKeys) - cfg.SharedCredentialsFile = sharedCredentialsFilename() - cfg.SharedConfigFile = sharedConfigFilename() + setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey) + setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey) cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE") @@ -181,28 +186,3 @@ func setFromEnvVal(dst *string, keys []string) { } } } - -func sharedCredentialsFilename() string { - if name := os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); len(name) > 0 { - return name - } - - return filepath.Join(userHomeDir(), ".aws", "credentials") -} - -func sharedConfigFilename() string { - if name := os.Getenv("AWS_CONFIG_FILE"); len(name) > 0 { - return name - } - - return filepath.Join(userHomeDir(), ".aws", "config") -} - -func userHomeDir() string { - homeDir := os.Getenv("HOME") // *nix - if len(homeDir) == 0 { // windows - homeDir = os.Getenv("USERPROFILE") - } - - return homeDir -} 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..9f75d5a 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 @@ -155,6 +155,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 @@ -218,7 +222,7 @@ 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 @@ -239,6 +243,13 @@ func NewSessionWithOptions(opts Options) (*Session, error) { envCfg.EnableSharedConfig = true } + if len(envCfg.SharedCredentialsFile) == 0 { + envCfg.SharedCredentialsFile = defaults.SharedCredentialsFilename() + } + if len(envCfg.SharedConfigFile) == 0 { + envCfg.SharedConfigFile = defaults.SharedConfigFilename() + } + // Only use AWS_CA_BUNDLE if session option is not provided. if len(envCfg.CustomCABundle) != 0 && opts.CustomCABundle == nil { f, err := os.Open(envCfg.CustomCABundle) @@ -304,13 +315,18 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, userCfg := &aws.Config{} userCfg.MergeIn(cfgs...) - // 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) 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..09c8e5b 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 @@ -113,7 +113,7 @@ func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { f, err := ini.Load(b) if err != nil { - return nil, SharedConfigLoadError{Filename: filename} + return nil, SharedConfigLoadError{Filename: filename, Err: err} } files = append(files, sharedConfigFile{ diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go new file mode 100644 index 0000000..6aa2ed2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go @@ -0,0 +1,7 @@ +package v4 + +// WithUnsignedPayload will enable and set the UnsignedPayload field to +// true of the signer. +func WithUnsignedPayload(v4 *Signer) { + v4.UnsignedPayload = true +} 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 98bfe74..15da572 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" @@ -194,6 +193,10 @@ type Signer struct { // This value should only be used for testing. If it is nil the default // time.Now will be used. currentTimeFn func() time.Time + + // UnsignedPayload will prevent signing of the payload. This will only + // work for services that have support for this. + UnsignedPayload bool } // NewSigner returns a Signer pointer configured with the credentials and optional @@ -227,6 +230,7 @@ type signingCtx struct { isPresign bool formattedTime string formattedShortTime string + unsignedPayload bool bodyDigest string signedHeaders string @@ -317,6 +321,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi ServiceName: service, Region: region, DisableURIPathEscaping: v4.DisableURIPathEscaping, + unsignedPayload: v4.UnsignedPayload, } for key := range ctx.Query { @@ -396,7 +401,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 @@ -409,7 +414,18 @@ var SignRequestHandler = request.NamedHandler{ func SignSDKRequest(req *request.Request) { signSDKRequestWithCurrTime(req, time.Now) } -func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time) { + +// BuildNamedHandler will build a generic handler for signing. +func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler { + return request.NamedHandler{ + Name: name, + Fn: func(req *request.Request) { + signSDKRequestWithCurrTime(req, time.Now, opts...) + }, + } +} + +func signSDKRequestWithCurrTime(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 { @@ -441,6 +457,10 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time v4.DisableRequestBodyOverwrite = true }) + for _, opt := range opts { + opt(v4) + } + signingTime := req.Time if !req.LastSignedAt.IsZero() { signingTime = req.LastSignedAt @@ -482,6 +502,8 @@ func (ctx *signingCtx) build(disableHeaderHoisting bool) { ctx.buildTime() // no depends ctx.buildCredentialString() // no depends + ctx.buildBodyDigest() + unsignedHeaders := ctx.Request.Header if ctx.isPresign { if !disableHeaderHoisting { @@ -493,7 +515,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 @@ -583,14 +604,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() { @@ -634,14 +659,14 @@ func (ctx *signingCtx) buildSignature() { func (ctx *signingCtx) buildBodyDigest() { hash := ctx.Request.Header.Get("X-Amz-Content-Sha256") if hash == "" { - if ctx.isPresign && ctx.ServiceName == "s3" { + if ctx.unsignedPayload || (ctx.isPresign && ctx.ServiceName == "s3") { hash = "UNSIGNED-PAYLOAD" } else if ctx.Body == nil { hash = emptyStringSHA256 } else { hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) } - if ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" { + if ctx.unsignedPayload || ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" { ctx.Request.Header.Set("X-Amz-Content-Sha256", hash) } } @@ -692,49 +717,46 @@ func makeSha256Reader(reader io.ReadSeeker) []byte { return hash.Sum(nil) } -const doubleSpaces = " " - -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 muliple 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/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 438506b..deb4b14 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.7.9" +const SDKVersion = "1.10.36" diff --git a/vendor/github.com/aws/aws-sdk-go/doc.go b/vendor/github.com/aws/aws-sdk-go/doc.go new file mode 100644 index 0000000..3e077e5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/doc.go @@ -0,0 +1,405 @@ +// Package sdk is the official AWS SDK for the Go programming language. +// +// The AWS SDK for Go provides APIs and utilities that developers can use to +// build Go applications that use AWS services, such as Amazon Elastic Compute +// Cloud (Amazon EC2) and Amazon Simple Storage Service (Amazon S3). +// +// The SDK removes the complexity of coding directly against a web service +// interface. It hides a lot of the lower-level plumbing, such as authentication, +// request retries, and error handling. +// +// The SDK also includes helpful utilities on top of the AWS APIs that add additional +// capabilities and functionality. For example, the Amazon S3 Download and Upload +// Manager will automatically split up large objects into multiple parts and +// transfer them concurrently. +// +// See the s3manager package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/ +// +// Getting More Information +// +// Checkout the Getting Started Guide and API Reference Docs detailed the SDK's +// components and details on each AWS client the SDK supports. +// +// The Getting Started Guide provides examples and detailed description of how +// to get setup with the SDK. +// https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/welcome.html +// +// The API Reference Docs include a detailed breakdown of the SDK's components +// such as utilities and AWS clients. Use this as a reference of the Go types +// included with the SDK, such as AWS clients, API operations, and API parameters. +// https://docs.aws.amazon.com/sdk-for-go/api/ +// +// Overview of SDK's Packages +// +// The SDK is composed of two main components, SDK core, and service clients. +// The SDK core packages are all available under the aws package at the root of +// the SDK. Each client for a supported AWS service is available within its own +// package under the service folder at the root of the SDK. +// +// * aws - SDK core, provides common shared types such as Config, Logger, +// and utilities to make working with API parameters easier. +// +// * awserr - Provides the error interface that the SDK will use for all +// errors that occur in the SDK's processing. This includes service API +// response errors as well. The Error type is made up of a code and message. +// Cast the SDK's returned error type to awserr.Error and call the Code +// method to compare returned error to specific error codes. See the package's +// documentation for additional values that can be extracted such as RequestId. +// +// * credentials - Provides the types and built in credentials providers +// the SDK will use to retrieve AWS credentials to make API requests with. +// Nested under this folder are also additional credentials providers such as +// stscreds for assuming IAM roles, and ec2rolecreds for EC2 Instance roles. +// +// * endpoints - Provides the AWS Regions and Endpoints metadata for the SDK. +// Use this to lookup AWS service endpoint information such as which services +// are in a region, and what regions a service is in. Constants are also provided +// for all region identifiers, e.g UsWest2RegionID for "us-west-2". +// +// * session - Provides initial default configuration, and load +// configuration from external sources such as environment and shared +// credentials file. +// +// * request - Provides the API request sending, and retry logic for the SDK. +// This package also includes utilities for defining your own request +// retryer, and configuring how the SDK processes the request. +// +// * service - Clients for AWS services. All services supported by the SDK are +// available under this folder. +// +// How to Use the SDK's AWS Service Clients +// +// The SDK includes the Go types and utilities you can use to make requests to +// AWS service APIs. Within the service folder at the root of the SDK you'll find +// a package for each AWS service the SDK supports. All service clients follows +// a common pattern of creation and usage. +// +// When creating a client for an AWS service you'll first need to have a Session +// value constructed. The Session provides shared configuration that can be shared +// between your service clients. When service clients are created you can pass +// in additional configuration via the aws.Config type to override configuration +// provided by in the Session to create service client instances with custom +// configuration. +// +// Once the service's client is created you can use it to make API requests the +// AWS service. These clients are safe to use concurrently. +// +// Configuring the SDK +// +// In the AWS SDK for Go, you can configure settings for service clients, such +// as the log level and maximum number of retries. Most settings are optional; +// however, for each service client, you must specify a region and your credentials. +// The SDK uses these values to send requests to the correct AWS region and sign +// requests with the correct credentials. You can specify these values as part +// of a session or as environment variables. +// +// See the SDK's configuration guide for more information. +// https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html +// +// See the session package documentation for more information on how to use Session +// with the SDK. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ +// +// See the Config type in the aws package for more information on configuration +// options. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config +// +// Configuring Credentials +// +// When using the SDK you'll generally need your AWS credentials to authenticate +// with AWS services. The SDK supports multiple methods of supporting these +// credentials. By default the SDK will source credentials automatically from +// its default credential chain. See the session package for more information +// on this chain, and how to configure it. The common items in the credential +// chain are the following: +// +// * Environment Credentials - Set of environment variables that are useful +// when sub processes are created for specific roles. +// +// * Shared Credentials file (~/.aws/credentials) - This file stores your +// credentials based on a profile name and is useful for local development. +// +// * EC2 Instance Role Credentials - Use EC2 Instance Role to assign credentials +// to application running on an EC2 instance. This removes the need to manage +// credential files in production. +// +// Credentials can be configured in code as well by setting the Config's Credentials +// value to a custom provider or using one of the providers included with the +// SDK to bypass the default credential chain and use a custom one. This is +// helpful when you want to instruct the SDK to only use a specific set of +// credentials or providers. +// +// This example creates a credential provider for assuming an IAM role, "myRoleARN" +// and configures the S3 service client to use that role for API requests. +// +// // Initial credentials loaded from SDK's default credential chain. Such as +// // the environment, shared credentials (~/.aws/credentials), or EC2 Instance +// // Role. These credentials will be used to to make the STS Assume Role API. +// sess := session.Must(session.NewSession()) +// +// // Create the credentials from AssumeRoleProvider to assume the role +// // referenced by the "myRoleARN" ARN. +// creds := stscreds.NewCredentials(sess, "myRoleArn") +// +// // Create service client value configured for credentials +// // from assumed role. +// svc := s3.New(sess, &aws.Config{Credentials: creds})/ +// +// See the credentials package documentation for more information on credential +// providers included with the SDK, and how to customize the SDK's usage of +// credentials. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/credentials +// +// The SDK has support for the shared configuration file (~/.aws/config). This +// support can be enabled by setting the environment variable, "AWS_SDK_LOAD_CONFIG=1", +// or enabling the feature in code when creating a Session via the +// Option's SharedConfigState parameter. +// +// sess := session.Must(session.NewSessionWithOptions(session.Options{ +// SharedConfigState: session.SharedConfigEnable, +// })) +// +// Configuring AWS Region +// +// In addition to the credentials you'll need to specify the region the SDK +// will use to make AWS API requests to. In the SDK you can specify the region +// either with an environment variable, or directly in code when a Session or +// service client is created. The last value specified in code wins if the region +// is specified multiple ways. +// +// To set the region via the environment variable set the "AWS_REGION" to the +// region you want to the SDK to use. Using this method to set the region will +// allow you to run your application in multiple regions without needing additional +// code in the application to select the region. +// +// AWS_REGION=us-west-2 +// +// The endpoints package includes constants for all regions the SDK knows. The +// values are all suffixed with RegionID. These values are helpful, because they +// reduce the need to type the region string manually. +// +// To set the region on a Session use the aws package's Config struct parameter +// Region to the AWS region you want the service clients created from the session to +// use. This is helpful when you want to create multiple service clients, and +// all of the clients make API requests to the same region. +// +// sess := session.Must(session.NewSession(&aws.Config{ +// Region: aws.String(endpoints.UsWest2RegionID), +// })) +// +// See the endpoints package for the AWS Regions and Endpoints metadata. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/endpoints/ +// +// In addition to setting the region when creating a Session you can also set +// the region on a per service client bases. This overrides the region of a +// Session. This is helpful when you want to create service clients in specific +// regions different from the Session's region. +// +// svc := s3.New(sess, &aws.Config{ +// Region: aws.String(ednpoints.UsWest2RegionID), +// }) +// +// See the Config type in the aws package for more information and additional +// options such as setting the Endpoint, and other service client configuration options. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config +// +// Making API Requests +// +// Once the client is created you can make an API request to the service. +// Each API method takes a input parameter, and returns the service response +// and an error. The SDK provides methods for making the API call in multiple ways. +// +// In this list we'll use the S3 ListObjects API as an example for the different +// ways of making API requests. +// +// * ListObjects - Base API operation that will make the API request to the service. +// +// * ListObjectsRequest - API methods suffixed with Request will construct the +// API request, but not send it. This is also helpful when you want to get a +// presigned URL for a request, and share the presigned URL instead of your +// application making the request directly. +// +// * ListObjectsPages - Same as the base API operation, but uses a callback to +// automatically handle pagination of the API's response. +// +// * ListObjectsWithContext - Same as base API operation, but adds support for +// the Context pattern. This is helpful for controlling the canceling of in +// flight requests. See the Go standard library context package for more +// information. This method also takes request package's Option functional +// options as the variadic argument for modifying how the request will be +// made, or extracting information from the raw HTTP response. +// +// * ListObjectsPagesWithContext - same as ListObjectsPages, but adds support for +// the Context pattern. Similar to ListObjectsWithContext this method also +// takes the request package's Option function option types as the variadic +// argument. +// +// In addition to the API operations the SDK also includes several higher level +// methods that abstract checking for and waiting for an AWS resource to be in +// a desired state. In this list we'll use WaitUntilBucketExists to demonstrate +// the different forms of waiters. +// +// * WaitUntilBucketExists. - Method to make API request to query an AWS service for +// a resource's state. Will return successfully when that state is accomplished. +// +// * WaitUntilBucketExistsWithContext - Same as WaitUntilBucketExists, but adds +// support for the Context pattern. In addition these methods take request +// package's WaiterOptions to configure the waiter, and how underlying request +// will be made by the SDK. +// +// The API method will document which error codes the service might return for +// the operation. These errors will also be available as const strings prefixed +// with "ErrCode" in the service client's package. If there are no errors listed +// in the API's SDK documentation you'll need to consult the AWS service's API +// documentation for the errors that could be returned. +// +// ctx := context.Background() +// +// result, err := svc.GetObjectWithContext(ctx, &s3.GetObjectInput{ +// Bucket: aws.String("my-bucket"), +// Key: aws.String("my-key"), +// }) +// if err != nil { +// // Cast err to awserr.Error to handle specific error codes. +// aerr, ok := err.(awserr.Error) +// if ok && aerr.Code() == s3.ErrCodeNoSuchKey { +// // Specific error code handling +// } +// return err +// } +// +// // Make sure to close the body when done with it for S3 GetObject APIs or +// // will leak connections. +// defer result.Body.Close() +// +// fmt.Println("Object Size:", aws.StringValue(result.ContentLength)) +// +// API Request Pagination and Resource Waiters +// +// Pagination helper methods are suffixed with "Pages", and provide the +// functionality needed to round trip API page requests. Pagination methods +// take a callback function that will be called for each page of the API's response. +// +// objects := []string{} +// err := svc.ListObjectsPagesWithContext(ctx, &s3.ListObjectsInput{ +// Bucket: aws.String(myBucket), +// }, func(p *s3.ListObjectsOutput, lastPage bool) bool { +// for _, o := range p.Contents { +// objects = append(objects, aws.StringValue(o.Key)) +// } +// return true // continue paging +// }) +// if err != nil { +// panic(fmt.Sprintf("failed to list objects for bucket, %s, %v", myBucket, err)) +// } +// +// fmt.Println("Objects in bucket:", objects) +// +// Waiter helper methods provide the functionality to wait for an AWS resource +// state. These methods abstract the logic needed to to check the state of an +// AWS resource, and wait until that resource is in a desired state. The waiter +// will block until the resource is in the state that is desired, an error occurs, +// or the waiter times out. If a resource times out the error code returned will +// be request.WaiterResourceNotReadyErrorCode. +// +// err := svc.WaitUntilBucketExistsWithContext(ctx, &s3.HeadBucketInput{ +// Bucket: aws.String(myBucket), +// }) +// if err != nil { +// aerr, ok := err.(awserr.Error) +// if ok && aerr.Code() == request.WaiterResourceNotReadyErrorCode { +// fmt.Fprintf(os.Stderr, "timed out while waiting for bucket to exist") +// } +// panic(fmt.Errorf("failed to wait for bucket to exist, %v", err)) +// } +// fmt.Println("Bucket", myBucket, "exists") +// +// Complete SDK Example +// +// This example shows a complete working Go file which will upload a file to S3 +// and use the Context pattern to implement timeout logic that will cancel the +// request if it takes too long. This example highlights how to use sessions, +// create a service client, make a request, handle the error, and process the +// response. +// +// package main +// +// import ( +// "context" +// "flag" +// "fmt" +// "os" +// "time" +// +// "github.com/aws/aws-sdk-go/aws" +// "github.com/aws/aws-sdk-go/aws/awserr" +// "github.com/aws/aws-sdk-go/aws/request" +// "github.com/aws/aws-sdk-go/aws/session" +// "github.com/aws/aws-sdk-go/service/s3" +// ) +// +// // Uploads a file to S3 given a bucket and object key. Also takes a duration +// // value to terminate the update if it doesn't complete within that time. +// // +// // The AWS Region needs to be provided in the AWS shared config or on the +// // environment variable as `AWS_REGION`. Credentials also must be provided +// // Will default to shared config file, but can load from environment if provided. +// // +// // Usage: +// // # Upload myfile.txt to myBucket/myKey. Must complete within 10 minutes or will fail +// // go run withContext.go -b mybucket -k myKey -d 10m < myfile.txt +// func main() { +// var bucket, key string +// var timeout time.Duration +// +// flag.StringVar(&bucket, "b", "", "Bucket name.") +// flag.StringVar(&key, "k", "", "Object key name.") +// flag.DurationVar(&timeout, "d", 0, "Upload timeout.") +// flag.Parse() +// +// // All clients require a Session. The Session provides the client with +// // shared configuration such as region, endpoint, and credentials. A +// // Session should be shared where possible to take advantage of +// // configuration and credential caching. See the session package for +// // more information. +// sess := session.Must(session.NewSession()) +// +// // Create a new instance of the service's client with a Session. +// // Optional aws.Config values can also be provided as variadic arguments +// // to the New function. This option allows you to provide service +// // specific configuration. +// svc := s3.New(sess) +// +// // Create a context with a timeout that will abort the upload if it takes +// // more than the passed in timeout. +// ctx := context.Background() +// var cancelFn func() +// if timeout > 0 { +// ctx, cancelFn = context.WithTimeout(ctx, timeout) +// } +// // Ensure the context is canceled to prevent leaking. +// // See context package for more information, https://golang.org/pkg/context/ +// defer cancelFn() +// +// // Uploads the object to S3. The Context will interrupt the request if the +// // timeout expires. +// _, err := svc.PutObjectWithContext(ctx, &s3.PutObjectInput{ +// Bucket: aws.String(bucket), +// Key: aws.String(key), +// Body: os.Stdin, +// }) +// if err != nil { +// if aerr, ok := err.(awserr.Error); ok && aerr.Code() == request.CanceledErrorCode { +// // If the SDK can determine the request or retry delay was canceled +// // by a context the CanceledErrorCode error code will be returned. +// fmt.Fprintf(os.Stderr, "upload canceled due to timeout, %v\n", err) +// } else { +// fmt.Fprintf(os.Stderr, "failed to upload object, %v\n", err) +// } +// os.Exit(1) +// } +// +// fmt.Printf("successfully uploaded file to %s/%s\n", bucket, key) +// } +package sdk diff --git a/vendor/github.com/aws/aws-sdk-go/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/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/json/jsonutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go deleted file mode 100644 index 6efe43d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go +++ /dev/null @@ -1,279 +0,0 @@ -// Package jsonutil provides JSON serialization of AWS requests and responses. -package jsonutil - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "math" - "reflect" - "sort" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/private/protocol" -) - -var timeType = reflect.ValueOf(time.Time{}).Type() -var byteSliceType = reflect.ValueOf([]byte{}).Type() - -// BuildJSON builds a JSON string for a given object v. -func BuildJSON(v interface{}) ([]byte, error) { - var buf bytes.Buffer - - err := buildAny(reflect.ValueOf(v), &buf, "") - return buf.Bytes(), err -} - -func buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - origVal := value - value = reflect.Indirect(value) - if !value.IsValid() { - return nil - } - - vtype := value.Type() - - t := tag.Get("type") - if t == "" { - switch vtype.Kind() { - case reflect.Struct: - // also it can't be a time object - if value.Type() != timeType { - t = "structure" - } - case reflect.Slice: - // also it can't be a byte slice - if _, ok := value.Interface().([]byte); !ok { - t = "list" - } - case reflect.Map: - t = "map" - } - } - - switch t { - case "structure": - if field, ok := vtype.FieldByName("_"); ok { - tag = field.Tag - } - return buildStruct(value, buf, tag) - case "list": - return buildList(value, buf, tag) - case "map": - return buildMap(value, buf, tag) - default: - return buildScalar(origVal, buf, tag) - } -} - -func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - if !value.IsValid() { - return nil - } - - // unwrap payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := value.Type().FieldByName(payload) - tag = field.Tag - value = elemOf(value.FieldByName(payload)) - - if !value.IsValid() { - return nil - } - } - - buf.WriteByte('{') - - t := value.Type() - first := true - for i := 0; i < t.NumField(); i++ { - member := value.Field(i) - - // This allocates the most memory. - // Additionally, we cannot skip nil fields due to - // idempotency auto filling. - field := t.Field(i) - - if field.PkgPath != "" { - continue // ignore unexported fields - } - if field.Tag.Get("json") == "-" { - continue - } - if field.Tag.Get("location") != "" { - continue // ignore non-body elements - } - if field.Tag.Get("ignore") != "" { - continue - } - - if protocol.CanSetIdempotencyToken(member, field) { - token := protocol.GetIdempotencyToken() - member = reflect.ValueOf(&token) - } - - if (member.Kind() == reflect.Ptr || member.Kind() == reflect.Slice || member.Kind() == reflect.Map) && member.IsNil() { - continue // ignore unset fields - } - - if first { - first = false - } else { - buf.WriteByte(',') - } - - // figure out what this field is called - name := field.Name - if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - - writeString(name, buf) - buf.WriteString(`:`) - - err := buildAny(member, buf, field.Tag) - if err != nil { - return err - } - - } - - buf.WriteString("}") - - return nil -} - -func buildList(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - buf.WriteString("[") - - for i := 0; i < value.Len(); i++ { - buildAny(value.Index(i), buf, "") - - if i < value.Len()-1 { - buf.WriteString(",") - } - } - - buf.WriteString("]") - - return nil -} - -type sortedValues []reflect.Value - -func (sv sortedValues) Len() int { return len(sv) } -func (sv sortedValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv sortedValues) Less(i, j int) bool { return sv[i].String() < sv[j].String() } - -func buildMap(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - buf.WriteString("{") - - sv := sortedValues(value.MapKeys()) - sort.Sort(sv) - - for i, k := range sv { - if i > 0 { - buf.WriteByte(',') - } - - writeString(k.String(), buf) - buf.WriteString(`:`) - - buildAny(value.MapIndex(k), buf, "") - } - - buf.WriteString("}") - - return nil -} - -func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - // prevents allocation on the heap. - scratch := [64]byte{} - switch value := reflect.Indirect(v); value.Kind() { - case reflect.String: - writeString(value.String(), buf) - case reflect.Bool: - if value.Bool() { - buf.WriteString("true") - } else { - buf.WriteString("false") - } - case reflect.Int64: - buf.Write(strconv.AppendInt(scratch[:0], value.Int(), 10)) - case reflect.Float64: - f := value.Float() - if math.IsInf(f, 0) || math.IsNaN(f) { - return &json.UnsupportedValueError{Value: v, Str: strconv.FormatFloat(f, 'f', -1, 64)} - } - buf.Write(strconv.AppendFloat(scratch[:0], f, 'f', -1, 64)) - default: - switch value.Type() { - case timeType: - converted := v.Interface().(*time.Time) - - buf.Write(strconv.AppendInt(scratch[:0], converted.UTC().Unix(), 10)) - case byteSliceType: - if !value.IsNil() { - converted := value.Interface().([]byte) - buf.WriteByte('"') - if len(converted) < 1024 { - // for small buffers, using Encode directly is much faster. - dst := make([]byte, base64.StdEncoding.EncodedLen(len(converted))) - base64.StdEncoding.Encode(dst, converted) - buf.Write(dst) - } else { - // for large buffers, avoid unnecessary extra temporary - // buffer space. - enc := base64.NewEncoder(base64.StdEncoding, buf) - enc.Write(converted) - enc.Close() - } - buf.WriteByte('"') - } - default: - return fmt.Errorf("unsupported JSON value %v (%s)", value.Interface(), value.Type()) - } - } - return nil -} - -var hex = "0123456789abcdef" - -func writeString(s string, buf *bytes.Buffer) { - buf.WriteByte('"') - for i := 0; i < len(s); i++ { - if s[i] == '"' { - buf.WriteString(`\"`) - } else if s[i] == '\\' { - buf.WriteString(`\\`) - } else if s[i] == '\b' { - buf.WriteString(`\b`) - } else if s[i] == '\f' { - buf.WriteString(`\f`) - } else if s[i] == '\r' { - buf.WriteString(`\r`) - } else if s[i] == '\t' { - buf.WriteString(`\t`) - } else if s[i] == '\n' { - buf.WriteString(`\n`) - } else if s[i] < 32 { - buf.WriteString("\\u00") - buf.WriteByte(hex[s[i]>>4]) - buf.WriteByte(hex[s[i]&0xF]) - } else { - buf.WriteByte(s[i]) - } - } - buf.WriteByte('"') -} - -// Returns the reflection element of a value, if it is a pointer. -func elemOf(value reflect.Value) reflect.Value { - for value.Kind() == reflect.Ptr { - value = value.Elem() - } - return value -} 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 deleted file mode 100644 index fea5356..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go +++ /dev/null @@ -1,213 +0,0 @@ -package jsonutil - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "reflect" - "time" -) - -// UnmarshalJSON reads a stream and unmarshals the results in object v. -func UnmarshalJSON(v interface{}, stream io.Reader) error { - var out interface{} - - b, err := ioutil.ReadAll(stream) - if err != nil { - return err - } - - if len(b) == 0 { - return nil - } - - if err := json.Unmarshal(b, &out); err != nil { - return err - } - - return unmarshalAny(reflect.ValueOf(v), out, "") -} - -func unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag) error { - vtype := value.Type() - if vtype.Kind() == reflect.Ptr { - vtype = vtype.Elem() // check kind of actual element type - } - - t := tag.Get("type") - if t == "" { - switch vtype.Kind() { - case reflect.Struct: - // also it can't be a time object - if _, ok := value.Interface().(*time.Time); !ok { - t = "structure" - } - case reflect.Slice: - // also it can't be a byte slice - if _, ok := value.Interface().([]byte); !ok { - t = "list" - } - case reflect.Map: - t = "map" - } - } - - switch t { - case "structure": - if field, ok := vtype.FieldByName("_"); ok { - tag = field.Tag - } - return unmarshalStruct(value, data, tag) - case "list": - return unmarshalList(value, data, tag) - case "map": - return unmarshalMap(value, data, tag) - default: - return unmarshalScalar(value, data, tag) - } -} - -func unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - mapData, ok := data.(map[string]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a structure (%#v)", data) - } - - t := value.Type() - if value.Kind() == reflect.Ptr { - if value.IsNil() { // create the structure if it's nil - s := reflect.New(value.Type().Elem()) - value.Set(s) - value = s - } - - value = value.Elem() - t = t.Elem() - } - - // unwrap any payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := t.FieldByName(payload) - return unmarshalAny(value.FieldByName(payload), data, field.Tag) - } - - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - if field.PkgPath != "" { - continue // ignore unexported fields - } - - // figure out what this field is called - name := field.Name - if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - - member := value.FieldByIndex(field.Index) - err := unmarshalAny(member, mapData[name], field.Tag) - if err != nil { - return err - } - } - return nil -} - -func unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - listData, ok := data.([]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a list (%#v)", data) - } - - if value.IsNil() { - l := len(listData) - value.Set(reflect.MakeSlice(value.Type(), l, l)) - } - - for i, c := range listData { - err := unmarshalAny(value.Index(i), c, "") - if err != nil { - return err - } - } - - return nil -} - -func unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - mapData, ok := data.(map[string]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a map (%#v)", data) - } - - if value.IsNil() { - value.Set(reflect.MakeMap(value.Type())) - } - - for k, v := range mapData { - kvalue := reflect.ValueOf(k) - vvalue := reflect.New(value.Type().Elem()).Elem() - - unmarshalAny(vvalue, v, "") - value.SetMapIndex(kvalue, vvalue) - } - - return nil -} - -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: - return nil // nothing to do here - case string: - switch value.Interface().(type) { - case *string: - value.Set(reflect.ValueOf(&d)) - case []byte: - b, err := base64.StdEncoding.DecodeString(d) - if err != nil { - return err - } - value.Set(reflect.ValueOf(b)) - default: - return errf() - } - case float64: - switch value.Interface().(type) { - case *int64: - di := int64(d) - value.Set(reflect.ValueOf(&di)) - case *float64: - value.Set(reflect.ValueOf(&d)) - case *time.Time: - t := time.Unix(int64(d), 0).UTC() - value.Set(reflect.ValueOf(&t)) - default: - return errf() - } - case bool: - switch value.Interface().(type) { - case *bool: - value.Set(reflect.ValueOf(&d)) - default: - return errf() - } - default: - return fmt.Errorf("unsupported JSON value (%v)", data) - } - return nil -} 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/rest/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go index 20a41d4..7161835 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,6 +4,7 @@ package rest import ( "bytes" "encoding/base64" + "encoding/json" "fmt" "io" "net/http" @@ -82,8 +83,12 @@ func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bo if name == "" { name = field.Name } - if m.Kind() == reflect.Ptr { + if kind := m.Kind(); kind == reflect.Ptr { m = m.Elem() + } else if kind == reflect.Interface { + if !m.Elem().IsValid() { + continue + } } if !m.IsValid() { continue @@ -95,16 +100,16 @@ func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bo var err error switch field.Tag.Get("location") { case "headers": // header maps - err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag.Get("locationName")) + err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag) case "header": - err = buildHeader(&r.HTTPRequest.Header, m, name) + err = buildHeader(&r.HTTPRequest.Header, m, name, field.Tag) case "uri": - err = buildURI(r.HTTPRequest.URL, m, name) + err = buildURI(r.HTTPRequest.URL, m, name, field.Tag) case "querystring": - err = buildQueryString(query, m, name) + err = buildQueryString(query, m, name, field.Tag) default: if buildGETQuery { - err = buildQueryString(query, m, name) + err = buildQueryString(query, m, name, field.Tag) } } r.Error = err @@ -145,8 +150,8 @@ func buildBody(r *request.Request, v reflect.Value) { } } -func buildHeader(header *http.Header, v reflect.Value, name string) error { - str, err := convertType(v) +func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect.StructTag) error { + str, err := convertType(v, tag) if err == errValueNotSet { return nil } else if err != nil { @@ -158,9 +163,10 @@ func buildHeader(header *http.Header, v reflect.Value, name string) error { return nil } -func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error { +func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) error { + prefix := tag.Get("locationName") for _, key := range v.MapKeys() { - str, err := convertType(v.MapIndex(key)) + str, err := convertType(v.MapIndex(key), tag) if err == errValueNotSet { continue } else if err != nil { @@ -173,8 +179,8 @@ func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error { return nil } -func buildURI(u *url.URL, v reflect.Value, name string) error { - value, err := convertType(v) +func buildURI(u *url.URL, v reflect.Value, name string, tag reflect.StructTag) error { + value, err := convertType(v, tag) if err == errValueNotSet { return nil } else if err != nil { @@ -190,7 +196,7 @@ func buildURI(u *url.URL, v reflect.Value, name string) error { return nil } -func buildQueryString(query url.Values, v reflect.Value, name string) error { +func buildQueryString(query url.Values, v reflect.Value, name string, tag reflect.StructTag) error { switch value := v.Interface().(type) { case []*string: for _, item := range value { @@ -207,7 +213,7 @@ func buildQueryString(query url.Values, v reflect.Value, name string) error { } } default: - str, err := convertType(v) + str, err := convertType(v, tag) if err == errValueNotSet { return nil } else if err != nil { @@ -246,7 +252,7 @@ func EscapePath(path string, encodeSep bool) string { return buf.String() } -func convertType(v reflect.Value) (string, error) { +func convertType(v reflect.Value, tag reflect.StructTag) (string, error) { v = reflect.Indirect(v) if !v.IsValid() { return "", errValueNotSet @@ -266,6 +272,16 @@ func convertType(v reflect.Value) (string, error) { str = strconv.FormatFloat(value, 'f', -1, 64) case time.Time: str = value.UTC().Format(RFC822) + case aws.JSONValue: + b, err := json.Marshal(value) + if err != nil { + return "", err + } + if tag.Get("location") == "header" { + str = base64.StdEncoding.EncodeToString(b) + } else { + str = string(b) + } default: err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) return "", err 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 9c00921..7a779ee 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,6 +3,7 @@ package rest import ( "bytes" "encoding/base64" + "encoding/json" "fmt" "io" "io/ioutil" @@ -12,6 +13,7 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" ) @@ -111,7 +113,7 @@ func unmarshalLocationElements(r *request.Request, v reflect.Value) { case "statusCode": unmarshalStatusCode(m, r.HTTPResponse.StatusCode) case "header": - err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name)) + err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name), field.Tag) if err != nil { r.Error = awserr.New("SerializationError", "failed to decode REST response", err) break @@ -158,8 +160,13 @@ func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) err return nil } -func unmarshalHeader(v reflect.Value, header string) error { - if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { +func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error { + isJSONValue := tag.Get("type") == "jsonvalue" + if isJSONValue { + if len(header) == 0 { + return nil + } + } else if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { return nil } @@ -196,6 +203,22 @@ func unmarshalHeader(v reflect.Value, header string) error { return err } v.Set(reflect.ValueOf(&t)) + case aws.JSONValue: + b := []byte(header) + var err error + if tag.Get("location") == "header" { + b, err = base64.StdEncoding.DecodeString(header) + if err != nil { + return err + } + } + + m := aws.JSONValue{} + err = json.Unmarshal(b, &m) + if err != nil { + return err + } + v.Set(reflect.ValueOf(m)) default: err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) return err 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/xml/xmlutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go index c74c191..7091b45 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 @@ -131,7 +131,6 @@ func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag refl continue } - mTag := field.Tag if mTag.Get("location") != "" { // skip non-body members continue 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..8758462 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 @@ -15,7 +15,10 @@ import ( // 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 +26,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 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..3e970b6 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 @@ -40,11 +40,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) { diff --git a/vendor/github.com/aws/aws-sdk-go/private/signer/v2/v2.go b/vendor/github.com/aws/aws-sdk-go/private/signer/v2/v2.go deleted file mode 100644 index 88c3a2f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/signer/v2/v2.go +++ /dev/null @@ -1,180 +0,0 @@ -package v2 - -import ( - "crypto/hmac" - "crypto/sha256" - "encoding/base64" - "errors" - "fmt" - "net/http" - "net/url" - "sort" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" -) - -var ( - errInvalidMethod = errors.New("v2 signer only handles HTTP POST") -) - -const ( - signatureVersion = "2" - signatureMethod = "HmacSHA256" - timeFormat = "2006-01-02T15:04:05Z" -) - -type signer struct { - // Values that must be populated from the request - Request *http.Request - Time time.Time - Credentials *credentials.Credentials - Debug aws.LogLevelType - Logger aws.Logger - - Query url.Values - stringToSign string - signature string -} - -// SignRequestHandler is a named request handler the SDK will use to sign -// service client request with using the V4 signature. -var SignRequestHandler = request.NamedHandler{ - Name: "v2.SignRequestHandler", Fn: SignSDKRequest, -} - -// SignSDKRequest requests with signature version 2. -// -// Will sign the requests with the service config's Credentials object -// Signing is skipped if the credentials is the credentials.AnonymousCredentials -// object. -func SignSDKRequest(req *request.Request) { - // 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 { - return - } - - if req.HTTPRequest.Method != "POST" && req.HTTPRequest.Method != "GET" { - // The V2 signer only supports GET and POST - req.Error = errInvalidMethod - return - } - - v2 := signer{ - Request: req.HTTPRequest, - Time: req.Time, - Credentials: req.Config.Credentials, - Debug: req.Config.LogLevel.Value(), - Logger: req.Config.Logger, - } - - req.Error = v2.Sign() - - if req.Error != nil { - return - } - - if req.HTTPRequest.Method == "POST" { - // Set the body of the request based on the modified query parameters - req.SetStringBody(v2.Query.Encode()) - - // Now that the body has changed, remove any Content-Length header, - // because it will be incorrect - req.HTTPRequest.ContentLength = 0 - req.HTTPRequest.Header.Del("Content-Length") - } else { - req.HTTPRequest.URL.RawQuery = v2.Query.Encode() - } -} - -func (v2 *signer) Sign() error { - credValue, err := v2.Credentials.Get() - if err != nil { - return err - } - - if v2.Request.Method == "POST" { - // Parse the HTTP request to obtain the query parameters that will - // be used to build the string to sign. Note that because the HTTP - // request will need to be modified, the PostForm and Form properties - // are reset to nil after parsing. - v2.Request.ParseForm() - v2.Query = v2.Request.PostForm - v2.Request.PostForm = nil - v2.Request.Form = nil - } else { - v2.Query = v2.Request.URL.Query() - } - - // Set new query parameters - v2.Query.Set("AWSAccessKeyId", credValue.AccessKeyID) - v2.Query.Set("SignatureVersion", signatureVersion) - v2.Query.Set("SignatureMethod", signatureMethod) - v2.Query.Set("Timestamp", v2.Time.UTC().Format(timeFormat)) - if credValue.SessionToken != "" { - v2.Query.Set("SecurityToken", credValue.SessionToken) - } - - // in case this is a retry, ensure no signature present - v2.Query.Del("Signature") - - method := v2.Request.Method - host := v2.Request.URL.Host - path := v2.Request.URL.Path - if path == "" { - path = "/" - } - - // obtain all of the query keys and sort them - queryKeys := make([]string, 0, len(v2.Query)) - for key := range v2.Query { - queryKeys = append(queryKeys, key) - } - sort.Strings(queryKeys) - - // build URL-encoded query keys and values - queryKeysAndValues := make([]string, len(queryKeys)) - for i, key := range queryKeys { - k := strings.Replace(url.QueryEscape(key), "+", "%20", -1) - v := strings.Replace(url.QueryEscape(v2.Query.Get(key)), "+", "%20", -1) - queryKeysAndValues[i] = k + "=" + v - } - - // join into one query string - query := strings.Join(queryKeysAndValues, "&") - - // build the canonical string for the V2 signature - v2.stringToSign = strings.Join([]string{ - method, - host, - path, - query, - }, "\n") - - hash := hmac.New(sha256.New, []byte(credValue.SecretAccessKey)) - hash.Write([]byte(v2.stringToSign)) - v2.signature = base64.StdEncoding.EncodeToString(hash.Sum(nil)) - v2.Query.Set("Signature", v2.signature) - - if v2.Debug.Matches(aws.LogDebugWithSigning) { - v2.logSigningInfo() - } - - return nil -} - -const logSignInfoMsg = `DEBUG: Request Signature: ----[ STRING TO SIGN ]-------------------------------- -%s ----[ SIGNATURE ]------------------------------------- -%s ------------------------------------------------------` - -func (v2 *signer) logSigningInfo() { - msg := fmt.Sprintf(logSignInfoMsg, v2.stringToSign, v2.Query.Get("Signature")) - v2.Logger.Log(msg) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go b/vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go deleted file mode 100644 index b51e944..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go +++ /dev/null @@ -1,134 +0,0 @@ -package waiter - -import ( - "fmt" - "reflect" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -// A Config provides a collection of configuration values to setup a generated -// waiter code with. -type Config struct { - Name string - Delay int - MaxAttempts int - Operation string - Acceptors []WaitAcceptor -} - -// A WaitAcceptor provides the information needed to wait for an API operation -// to complete. -type WaitAcceptor struct { - Expected interface{} - Matcher string - State string - Argument string -} - -// A Waiter provides waiting for an operation to complete. -type Waiter struct { - Config - Client interface{} - Input interface{} -} - -// Wait waits for an operation to complete, expire max attempts, or fail. Error -// is returned if the operation fails. -func (w *Waiter) Wait() error { - client := reflect.ValueOf(w.Client) - in := reflect.ValueOf(w.Input) - method := client.MethodByName(w.Config.Operation + "Request") - - for i := 0; i < w.MaxAttempts; i++ { - res := method.Call([]reflect.Value{in}) - req := res[0].Interface().(*request.Request) - req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Waiter")) - - err := req.Send() - for _, a := range w.Acceptors { - result := false - var vals []interface{} - switch a.Matcher { - case "pathAll", "path": - // Require all matches to be equal for result to match - vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) - if len(vals) == 0 { - break - } - result = true - for _, val := range vals { - if !awsutil.DeepEqual(val, a.Expected) { - result = false - break - } - } - case "pathAny": - // Only a single match needs to equal for the result to match - vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) - for _, val := range vals { - if awsutil.DeepEqual(val, a.Expected) { - result = true - break - } - } - case "status": - s := a.Expected.(int) - result = s == req.HTTPResponse.StatusCode - case "error": - if aerr, ok := err.(awserr.Error); ok { - result = aerr.Code() == a.Expected.(string) - } - case "pathList": - // ignored matcher - default: - logf(client, "WARNING: Waiter for %s encountered unexpected matcher: %s", - w.Config.Operation, a.Matcher) - } - - if !result { - // If there was no matching result found there is nothing more to do - // for this response, retry the request. - continue - } - - switch a.State { - case "success": - // waiter completed - return nil - case "failure": - // Waiter failure state triggered - return awserr.New("ResourceNotReady", - fmt.Sprintf("failed waiting for successful resource state"), err) - case "retry": - // clear the error and retry the operation - err = nil - default: - logf(client, "WARNING: Waiter for %s encountered unexpected state: %s", - w.Config.Operation, a.State) - } - } - if err != nil { - return err - } - - time.Sleep(time.Second * time.Duration(w.Delay)) - } - - return awserr.New("ResourceNotReady", - fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil) -} - -func logf(client reflect.Value, msg string, args ...interface{}) { - cfgVal := client.FieldByName("Config") - if !cfgVal.IsValid() { - return - } - if cfg, ok := cfgVal.Interface().(*aws.Config); ok && cfg.Logger != nil { - cfg.Logger.Log(fmt.Sprintf(msg, args...)) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/acm/api.go b/vendor/github.com/aws/aws-sdk-go/service/acm/api.go deleted file mode 100644 index d17990d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/api.go +++ /dev/null @@ -1,2407 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package acm provides a client for AWS Certificate Manager. -package acm - -import ( - "fmt" - "time" - - "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 opAddTagsToCertificate = "AddTagsToCertificate" - -// AddTagsToCertificateRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToCertificateRequest method. -// req, resp := client.AddTagsToCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/AddTagsToCertificate -func (c *ACM) AddTagsToCertificateRequest(input *AddTagsToCertificateInput) (req *request.Request, output *AddTagsToCertificateOutput) { - op := &request.Operation{ - Name: opAddTagsToCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsToCertificateInput{} - } - - output = &AddTagsToCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddTagsToCertificate API operation for AWS Certificate Manager. -// -// Adds one or more tags to an ACM Certificate. Tags are labels that you can -// use to identify and organize your AWS resources. Each tag consists of a key -// and an optional value. You specify the certificate on input by its Amazon -// Resource Name (ARN). You specify the tag by using a key-value pair. -// -// You can apply a tag to just one certificate if you want to identify a specific -// characteristic of that certificate, or you can apply the same tag to multiple -// certificates if you want to filter for a common relationship among those -// certificates. Similarly, you can apply the same tag to multiple resources -// if you want to specify a relationship among those resources. For example, -// you can add the same tag to an ACM Certificate and an Elastic Load Balancing -// load balancer to indicate that they are both used by the same website. For -// more information, see Tagging ACM Certificates (http://docs.aws.amazon.com/acm/latest/userguide/tags.html). -// -// To remove one or more tags, use the RemoveTagsFromCertificate action. To -// view all of the tags that have been applied to the certificate, use the ListTagsForCertificate -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Certificate Manager's -// API operation AddTagsToCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified certificate cannot be found in the caller's account, or the -// caller's account cannot be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// * ErrCodeInvalidTagException "InvalidTagException" -// One or both of the values that make up the key-value pair is not valid. For -// example, you cannot specify a tag value that begins with aws:. -// -// * ErrCodeTooManyTagsException "TooManyTagsException" -// The request contains too many tags. Try the request again with fewer tags. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/AddTagsToCertificate -func (c *ACM) AddTagsToCertificate(input *AddTagsToCertificateInput) (*AddTagsToCertificateOutput, error) { - req, out := c.AddTagsToCertificateRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCertificate = "DeleteCertificate" - -// DeleteCertificateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCertificateRequest method. -// req, resp := client.DeleteCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DeleteCertificate -func (c *ACM) DeleteCertificateRequest(input *DeleteCertificateInput) (req *request.Request, output *DeleteCertificateOutput) { - op := &request.Operation{ - Name: opDeleteCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCertificateInput{} - } - - output = &DeleteCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCertificate API operation for AWS Certificate Manager. -// -// Deletes an ACM Certificate and its associated private key. If this action -// succeeds, the certificate no longer appears in the list of ACM Certificates -// that can be displayed by calling the ListCertificates action or be retrieved -// by calling the GetCertificate action. The certificate will not be available -// for use by other AWS services. -// -// You cannot delete an ACM Certificate that is being used by another AWS service. -// To delete a certificate that is in use, the certificate association must -// first be removed. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Certificate Manager's -// API operation DeleteCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified certificate cannot be found in the caller's account, or the -// caller's account cannot be found. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The certificate is in use by another AWS service in the caller's account. -// Remove the association and try again. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DeleteCertificate -func (c *ACM) DeleteCertificate(input *DeleteCertificateInput) (*DeleteCertificateOutput, error) { - req, out := c.DeleteCertificateRequest(input) - err := req.Send() - return out, err -} - -const opDescribeCertificate = "DescribeCertificate" - -// DescribeCertificateRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCertificateRequest method. -// req, resp := client.DescribeCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DescribeCertificate -func (c *ACM) DescribeCertificateRequest(input *DescribeCertificateInput) (req *request.Request, output *DescribeCertificateOutput) { - op := &request.Operation{ - Name: opDescribeCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeCertificateInput{} - } - - output = &DescribeCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCertificate API operation for AWS Certificate Manager. -// -// Returns detailed metadata about the specified ACM Certificate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Certificate Manager's -// API operation DescribeCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified certificate cannot be found in the caller's account, or the -// caller's account cannot be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DescribeCertificate -func (c *ACM) DescribeCertificate(input *DescribeCertificateInput) (*DescribeCertificateOutput, error) { - req, out := c.DescribeCertificateRequest(input) - err := req.Send() - return out, err -} - -const opGetCertificate = "GetCertificate" - -// GetCertificateRequest generates a "aws/request.Request" representing the -// client's request for the GetCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetCertificateRequest method. -// req, resp := client.GetCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/GetCertificate -func (c *ACM) GetCertificateRequest(input *GetCertificateInput) (req *request.Request, output *GetCertificateOutput) { - op := &request.Operation{ - Name: opGetCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCertificateInput{} - } - - output = &GetCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCertificate API operation for AWS Certificate Manager. -// -// Retrieves an ACM Certificate and certificate chain for the certificate specified -// by an ARN. The chain is an ordered list of certificates that contains the -// root certificate, intermediate certificates of subordinate CAs, and the ACM -// Certificate. The certificate and certificate chain are base64 encoded. If -// you want to decode the certificate chain to see the individual certificate -// fields, you can use OpenSSL. -// -// Currently, ACM Certificates can be used only with Elastic Load Balancing -// and Amazon CloudFront. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Certificate Manager's -// API operation GetCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified certificate cannot be found in the caller's account, or the -// caller's account cannot be found. -// -// * ErrCodeRequestInProgressException "RequestInProgressException" -// The certificate request is in process and the certificate in your account -// has not yet been issued. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/GetCertificate -func (c *ACM) GetCertificate(input *GetCertificateInput) (*GetCertificateOutput, error) { - req, out := c.GetCertificateRequest(input) - err := req.Send() - return out, err -} - -const opImportCertificate = "ImportCertificate" - -// ImportCertificateRequest generates a "aws/request.Request" representing the -// client's request for the ImportCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportCertificateRequest method. -// req, resp := client.ImportCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ImportCertificate -func (c *ACM) ImportCertificateRequest(input *ImportCertificateInput) (req *request.Request, output *ImportCertificateOutput) { - op := &request.Operation{ - Name: opImportCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportCertificateInput{} - } - - output = &ImportCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportCertificate API operation for AWS Certificate Manager. -// -// Imports an SSL/TLS certificate into AWS Certificate Manager (ACM) to use -// with ACM's integrated AWS services (http://docs.aws.amazon.com/acm/latest/userguide/acm-services.html). -// -// ACM does not provide managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html) -// for certificates that you import. -// -// For more information about importing certificates into ACM, including the -// differences between certificates that you import and those that ACM provides, -// see Importing Certificates (http://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html) -// in the AWS Certificate Manager User Guide. -// -// To import a certificate, you must provide the certificate and the matching -// private key. When the certificate is not self-signed, you must also provide -// a certificate chain. You can omit the certificate chain when importing a -// self-signed certificate. -// -// The certificate, private key, and certificate chain must be PEM-encoded. -// For more information about converting these items to PEM format, see Importing -// Certificates Troubleshooting (http://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html#import-certificate-troubleshooting) -// in the AWS Certificate Manager User Guide. -// -// To import a new certificate, omit the CertificateArn field. Include this -// field only when you want to replace a previously imported certificate. -// -// This operation returns the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) -// of the imported certificate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Certificate Manager's -// API operation ImportCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified certificate cannot be found in the caller's account, or the -// caller's account cannot be found. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// An ACM limit has been exceeded. For example, you may have input more domains -// than are allowed or you've requested too many certificates for your account. -// See the exception message returned by ACM to determine which limit you have -// violated. For more information about ACM limits, see the Limits (http://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html) -// topic. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ImportCertificate -func (c *ACM) ImportCertificate(input *ImportCertificateInput) (*ImportCertificateOutput, error) { - req, out := c.ImportCertificateRequest(input) - err := req.Send() - return out, err -} - -const opListCertificates = "ListCertificates" - -// ListCertificatesRequest generates a "aws/request.Request" representing the -// client's request for the ListCertificates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListCertificates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListCertificates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListCertificatesRequest method. -// req, resp := client.ListCertificatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListCertificates -func (c *ACM) ListCertificatesRequest(input *ListCertificatesInput) (req *request.Request, output *ListCertificatesOutput) { - op := &request.Operation{ - Name: opListCertificates, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxItems", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCertificatesInput{} - } - - output = &ListCertificatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCertificates API operation for AWS Certificate Manager. -// -// Retrieves a list of ACM Certificates and the domain name for each. You can -// optionally filter the list to return only the certificates that match the -// specified 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 AWS Certificate Manager's -// API operation ListCertificates for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListCertificates -func (c *ACM) ListCertificates(input *ListCertificatesInput) (*ListCertificatesOutput, error) { - req, out := c.ListCertificatesRequest(input) - err := req.Send() - return out, err -} - -// ListCertificatesPages iterates over the pages of a ListCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCertificates 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 ListCertificates operation. -// pageNum := 0 -// err := client.ListCertificatesPages(params, -// func(page *ListCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ACM) ListCertificatesPages(input *ListCertificatesInput, fn func(p *ListCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListCertificatesOutput), lastPage) - }) -} - -const opListTagsForCertificate = "ListTagsForCertificate" - -// ListTagsForCertificateRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTagsForCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTagsForCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsForCertificateRequest method. -// req, resp := client.ListTagsForCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListTagsForCertificate -func (c *ACM) ListTagsForCertificateRequest(input *ListTagsForCertificateInput) (req *request.Request, output *ListTagsForCertificateOutput) { - op := &request.Operation{ - Name: opListTagsForCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForCertificateInput{} - } - - output = &ListTagsForCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForCertificate API operation for AWS Certificate Manager. -// -// Lists the tags that have been applied to the ACM Certificate. Use the certificate's -// Amazon Resource Name (ARN) to specify the certificate. To add a tag to an -// ACM Certificate, use the AddTagsToCertificate action. To delete a tag, use -// the RemoveTagsFromCertificate action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Certificate Manager's -// API operation ListTagsForCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified certificate cannot be found in the caller's account, or the -// caller's account cannot be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListTagsForCertificate -func (c *ACM) ListTagsForCertificate(input *ListTagsForCertificateInput) (*ListTagsForCertificateOutput, error) { - req, out := c.ListTagsForCertificateRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTagsFromCertificate = "RemoveTagsFromCertificate" - -// RemoveTagsFromCertificateRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromCertificateRequest method. -// req, resp := client.RemoveTagsFromCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RemoveTagsFromCertificate -func (c *ACM) RemoveTagsFromCertificateRequest(input *RemoveTagsFromCertificateInput) (req *request.Request, output *RemoveTagsFromCertificateOutput) { - op := &request.Operation{ - Name: opRemoveTagsFromCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsFromCertificateInput{} - } - - output = &RemoveTagsFromCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveTagsFromCertificate API operation for AWS Certificate Manager. -// -// Remove one or more tags from an ACM Certificate. A tag consists of a key-value -// pair. If you do not specify the value portion of the tag when calling this -// function, the tag will be removed regardless of value. If you specify a value, -// the tag is removed only if it is associated with the specified value. -// -// To add tags to a certificate, use the AddTagsToCertificate action. To view -// all of the tags that have been applied to a specific ACM Certificate, use -// the ListTagsForCertificate action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Certificate Manager's -// API operation RemoveTagsFromCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified certificate cannot be found in the caller's account, or the -// caller's account cannot be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// * ErrCodeInvalidTagException "InvalidTagException" -// One or both of the values that make up the key-value pair is not valid. For -// example, you cannot specify a tag value that begins with aws:. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RemoveTagsFromCertificate -func (c *ACM) RemoveTagsFromCertificate(input *RemoveTagsFromCertificateInput) (*RemoveTagsFromCertificateOutput, error) { - req, out := c.RemoveTagsFromCertificateRequest(input) - err := req.Send() - return out, err -} - -const opRequestCertificate = "RequestCertificate" - -// RequestCertificateRequest generates a "aws/request.Request" representing the -// client's request for the RequestCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RequestCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RequestCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RequestCertificateRequest method. -// req, resp := client.RequestCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RequestCertificate -func (c *ACM) RequestCertificateRequest(input *RequestCertificateInput) (req *request.Request, output *RequestCertificateOutput) { - op := &request.Operation{ - Name: opRequestCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RequestCertificateInput{} - } - - output = &RequestCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// RequestCertificate API operation for AWS Certificate Manager. -// -// Requests an ACM Certificate for use with other AWS services. To request an -// ACM Certificate, you must specify the fully qualified domain name (FQDN) -// for your site. You can also specify additional FQDNs if users can reach your -// site by using other names. For each domain name you specify, email is sent -// to the domain owner to request approval to issue the certificate. After receiving -// approval from the domain owner, the ACM Certificate is issued. For more information, -// see the AWS Certificate Manager User Guide (http://docs.aws.amazon.com/acm/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 AWS Certificate Manager's -// API operation RequestCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// An ACM limit has been exceeded. For example, you may have input more domains -// than are allowed or you've requested too many certificates for your account. -// See the exception message returned by ACM to determine which limit you have -// violated. For more information about ACM limits, see the Limits (http://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html) -// topic. -// -// * ErrCodeInvalidDomainValidationOptionsException "InvalidDomainValidationOptionsException" -// One or more values in the DomainValidationOption structure is incorrect. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RequestCertificate -func (c *ACM) RequestCertificate(input *RequestCertificateInput) (*RequestCertificateOutput, error) { - req, out := c.RequestCertificateRequest(input) - err := req.Send() - return out, err -} - -const opResendValidationEmail = "ResendValidationEmail" - -// ResendValidationEmailRequest generates a "aws/request.Request" representing the -// client's request for the ResendValidationEmail operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResendValidationEmail for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResendValidationEmail method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResendValidationEmailRequest method. -// req, resp := client.ResendValidationEmailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ResendValidationEmail -func (c *ACM) ResendValidationEmailRequest(input *ResendValidationEmailInput) (req *request.Request, output *ResendValidationEmailOutput) { - op := &request.Operation{ - Name: opResendValidationEmail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResendValidationEmailInput{} - } - - output = &ResendValidationEmailOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResendValidationEmail API operation for AWS Certificate Manager. -// -// Resends the email that requests domain ownership validation. The domain owner -// or an authorized representative must approve the ACM Certificate before it -// can be issued. The certificate can be approved by clicking a link in the -// mail to navigate to the Amazon certificate approval website and then clicking -// I Approve. However, the validation email can be blocked by spam filters. -// Therefore, if you do not receive the original mail, you can request that -// the mail be resent within 72 hours of requesting the ACM Certificate. If -// more than 72 hours have elapsed since your original request or since your -// last attempt to resend validation mail, you must request a new certificate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Certificate Manager's -// API operation ResendValidationEmail for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified certificate cannot be found in the caller's account, or the -// caller's account cannot be found. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// Processing has reached an invalid state. For example, this exception can -// occur if the specified domain is not using email validation, or the current -// certificate status does not permit the requested operation. See the exception -// message returned by ACM to determine which state is not valid. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// * ErrCodeInvalidDomainValidationOptionsException "InvalidDomainValidationOptionsException" -// One or more values in the DomainValidationOption structure is incorrect. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ResendValidationEmail -func (c *ACM) ResendValidationEmail(input *ResendValidationEmailInput) (*ResendValidationEmailOutput, error) { - req, out := c.ResendValidationEmailRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/AddTagsToCertificateRequest -type AddTagsToCertificateInput struct { - _ struct{} `type:"structure"` - - // String that contains the ARN of the ACM Certificate to which the tag is to - // be applied. This must be of the form: - // - // arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012 - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // CertificateArn is a required field - CertificateArn *string `min:"20" type:"string" required:"true"` - - // The key-value pair that defines the tag. The tag value is optional. - // - // Tags is a required field - Tags []*Tag `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsToCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToCertificateInput"} - if s.CertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateArn")) - } - if s.CertificateArn != nil && len(*s.CertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CertificateArn", 20)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - 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 -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *AddTagsToCertificateInput) SetCertificateArn(v string) *AddTagsToCertificateInput { - s.CertificateArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToCertificateInput) SetTags(v []*Tag) *AddTagsToCertificateInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/AddTagsToCertificateOutput -type AddTagsToCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsToCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToCertificateOutput) GoString() string { - return s.String() -} - -// Contains metadata about an ACM certificate. This structure is returned in -// the response to a DescribeCertificate request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/CertificateDetail -type CertificateDetail struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the certificate. For more information about - // ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - CertificateArn *string `min:"20" type:"string"` - - // The time at which the certificate was requested. This value exists only when - // the certificate type is AMAZON_ISSUED. - CreatedAt *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The fully qualified domain name for the certificate, such as www.example.com - // or example.com. - DomainName *string `min:"1" type:"string"` - - // Contains information about the initial validation of each domain name that - // occurs as a result of the RequestCertificate request. This field exists only - // when the certificate type is AMAZON_ISSUED. - DomainValidationOptions []*DomainValidation `min:"1" type:"list"` - - // The reason the certificate request failed. This value exists only when the - // certificate status is FAILED. For more information, see Certificate Request - // Failed (http://docs.aws.amazon.com/acm/latest/userguide/troubleshooting.html#troubleshooting-failed) - // in the AWS Certificate Manager User Guide. - FailureReason *string `type:"string" enum:"FailureReason"` - - // The date and time at which the certificate was imported. This value exists - // only when the certificate type is IMPORTED. - ImportedAt *time.Time `type:"timestamp" timestampFormat:"unix"` - - // A list of ARNs for the AWS resources that are using the certificate. A certificate - // can be used by multiple AWS resources. - InUseBy []*string `type:"list"` - - // The time at which the certificate was issued. This value exists only when - // the certificate type is AMAZON_ISSUED. - IssuedAt *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the certificate authority that issued and signed the certificate. - Issuer *string `type:"string"` - - // The algorithm that was used to generate the key pair (the public and private - // key). - KeyAlgorithm *string `type:"string" enum:"KeyAlgorithm"` - - // The time after which the certificate is not valid. - NotAfter *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time before which the certificate is not valid. - NotBefore *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Contains information about the status of ACM's managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html) - // for the certificate. This field exists only when the certificate type is - // AMAZON_ISSUED. - RenewalSummary *RenewalSummary `type:"structure"` - - // The reason the certificate was revoked. This value exists only when the certificate - // status is REVOKED. - RevocationReason *string `type:"string" enum:"RevocationReason"` - - // The time at which the certificate was revoked. This value exists only when - // the certificate status is REVOKED. - RevokedAt *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The serial number of the certificate. - Serial *string `type:"string"` - - // The algorithm that was used to sign the certificate. - SignatureAlgorithm *string `type:"string"` - - // The status of the certificate. - Status *string `type:"string" enum:"CertificateStatus"` - - // The name of the entity that is associated with the public key contained in - // the certificate. - Subject *string `type:"string"` - - // One or more domain names (subject alternative names) included in the certificate. - // This list contains the domain names that are bound to the public key that - // is contained in the certificate. The subject alternative names include the - // canonical domain name (CN) of the certificate and additional domain names - // that can be used to connect to the website. - SubjectAlternativeNames []*string `min:"1" type:"list"` - - // The source of the certificate. For certificates provided by ACM, this value - // is AMAZON_ISSUED. For certificates that you imported with ImportCertificate, - // this value is IMPORTED. ACM does not provide managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html) - // for imported certificates. For more information about the differences between - // certificates that you import and those that ACM provides, see Importing Certificates - // (http://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html) - // in the AWS Certificate Manager User Guide. - Type *string `type:"string" enum:"CertificateType"` -} - -// String returns the string representation -func (s CertificateDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CertificateDetail) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *CertificateDetail) SetCertificateArn(v string) *CertificateDetail { - s.CertificateArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CertificateDetail) SetCreatedAt(v time.Time) *CertificateDetail { - s.CreatedAt = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *CertificateDetail) SetDomainName(v string) *CertificateDetail { - s.DomainName = &v - return s -} - -// SetDomainValidationOptions sets the DomainValidationOptions field's value. -func (s *CertificateDetail) SetDomainValidationOptions(v []*DomainValidation) *CertificateDetail { - s.DomainValidationOptions = v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *CertificateDetail) SetFailureReason(v string) *CertificateDetail { - s.FailureReason = &v - return s -} - -// SetImportedAt sets the ImportedAt field's value. -func (s *CertificateDetail) SetImportedAt(v time.Time) *CertificateDetail { - s.ImportedAt = &v - return s -} - -// SetInUseBy sets the InUseBy field's value. -func (s *CertificateDetail) SetInUseBy(v []*string) *CertificateDetail { - s.InUseBy = v - return s -} - -// SetIssuedAt sets the IssuedAt field's value. -func (s *CertificateDetail) SetIssuedAt(v time.Time) *CertificateDetail { - s.IssuedAt = &v - return s -} - -// SetIssuer sets the Issuer field's value. -func (s *CertificateDetail) SetIssuer(v string) *CertificateDetail { - s.Issuer = &v - return s -} - -// SetKeyAlgorithm sets the KeyAlgorithm field's value. -func (s *CertificateDetail) SetKeyAlgorithm(v string) *CertificateDetail { - s.KeyAlgorithm = &v - return s -} - -// SetNotAfter sets the NotAfter field's value. -func (s *CertificateDetail) SetNotAfter(v time.Time) *CertificateDetail { - s.NotAfter = &v - return s -} - -// SetNotBefore sets the NotBefore field's value. -func (s *CertificateDetail) SetNotBefore(v time.Time) *CertificateDetail { - s.NotBefore = &v - return s -} - -// SetRenewalSummary sets the RenewalSummary field's value. -func (s *CertificateDetail) SetRenewalSummary(v *RenewalSummary) *CertificateDetail { - s.RenewalSummary = v - return s -} - -// SetRevocationReason sets the RevocationReason field's value. -func (s *CertificateDetail) SetRevocationReason(v string) *CertificateDetail { - s.RevocationReason = &v - return s -} - -// SetRevokedAt sets the RevokedAt field's value. -func (s *CertificateDetail) SetRevokedAt(v time.Time) *CertificateDetail { - s.RevokedAt = &v - return s -} - -// SetSerial sets the Serial field's value. -func (s *CertificateDetail) SetSerial(v string) *CertificateDetail { - s.Serial = &v - return s -} - -// SetSignatureAlgorithm sets the SignatureAlgorithm field's value. -func (s *CertificateDetail) SetSignatureAlgorithm(v string) *CertificateDetail { - s.SignatureAlgorithm = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CertificateDetail) SetStatus(v string) *CertificateDetail { - s.Status = &v - return s -} - -// SetSubject sets the Subject field's value. -func (s *CertificateDetail) SetSubject(v string) *CertificateDetail { - s.Subject = &v - return s -} - -// SetSubjectAlternativeNames sets the SubjectAlternativeNames field's value. -func (s *CertificateDetail) SetSubjectAlternativeNames(v []*string) *CertificateDetail { - s.SubjectAlternativeNames = v - return s -} - -// SetType sets the Type field's value. -func (s *CertificateDetail) SetType(v string) *CertificateDetail { - s.Type = &v - return s -} - -// This structure is returned in the response object of ListCertificates action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/CertificateSummary -type CertificateSummary struct { - _ struct{} `type:"structure"` - - // Amazon Resource Name (ARN) of the certificate. This is of the form: - // - // arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012 - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - CertificateArn *string `min:"20" type:"string"` - - // Fully qualified domain name (FQDN), such as www.example.com or example.com, - // for the certificate. - DomainName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CertificateSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CertificateSummary) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *CertificateSummary) SetCertificateArn(v string) *CertificateSummary { - s.CertificateArn = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *CertificateSummary) SetDomainName(v string) *CertificateSummary { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DeleteCertificateRequest -type DeleteCertificateInput struct { - _ struct{} `type:"structure"` - - // String that contains the ARN of the ACM Certificate to be deleted. This must - // be of the form: - // - // arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012 - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // CertificateArn is a required field - CertificateArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCertificateInput"} - if s.CertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateArn")) - } - if s.CertificateArn != nil && len(*s.CertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CertificateArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *DeleteCertificateInput) SetCertificateArn(v string) *DeleteCertificateInput { - s.CertificateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DeleteCertificateOutput -type DeleteCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCertificateOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DescribeCertificateRequest -type DescribeCertificateInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the ACM Certificate. The ARN must have - // the following form: - // - // arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012 - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // CertificateArn is a required field - CertificateArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCertificateInput"} - if s.CertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateArn")) - } - if s.CertificateArn != nil && len(*s.CertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CertificateArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *DescribeCertificateInput) SetCertificateArn(v string) *DescribeCertificateInput { - s.CertificateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DescribeCertificateResponse -type DescribeCertificateOutput struct { - _ struct{} `type:"structure"` - - // Metadata about an ACM certificate. - Certificate *CertificateDetail `type:"structure"` -} - -// String returns the string representation -func (s DescribeCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCertificateOutput) GoString() string { - return s.String() -} - -// SetCertificate sets the Certificate field's value. -func (s *DescribeCertificateOutput) SetCertificate(v *CertificateDetail) *DescribeCertificateOutput { - s.Certificate = v - return s -} - -// Contains information about the validation of each domain name in the certificate. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DomainValidation -type DomainValidation struct { - _ struct{} `type:"structure"` - - // A fully qualified domain name (FQDN) in the certificate. For example, www.example.com - // or example.com. - // - // DomainName is a required field - DomainName *string `min:"1" type:"string" required:"true"` - - // The domain name that ACM used to send domain validation emails. - ValidationDomain *string `min:"1" type:"string"` - - // A list of email addresses that ACM used to send domain validation emails. - ValidationEmails []*string `type:"list"` - - // The validation status of the domain name. - ValidationStatus *string `type:"string" enum:"DomainStatus"` -} - -// String returns the string representation -func (s DomainValidation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DomainValidation) GoString() string { - return s.String() -} - -// SetDomainName sets the DomainName field's value. -func (s *DomainValidation) SetDomainName(v string) *DomainValidation { - s.DomainName = &v - return s -} - -// SetValidationDomain sets the ValidationDomain field's value. -func (s *DomainValidation) SetValidationDomain(v string) *DomainValidation { - s.ValidationDomain = &v - return s -} - -// SetValidationEmails sets the ValidationEmails field's value. -func (s *DomainValidation) SetValidationEmails(v []*string) *DomainValidation { - s.ValidationEmails = v - return s -} - -// SetValidationStatus sets the ValidationStatus field's value. -func (s *DomainValidation) SetValidationStatus(v string) *DomainValidation { - s.ValidationStatus = &v - return s -} - -// Contains information about the domain names that you want ACM to use to send -// you emails to validate your ownership of the domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DomainValidationOption -type DomainValidationOption struct { - _ struct{} `type:"structure"` - - // A fully qualified domain name (FQDN) in the certificate request. - // - // DomainName is a required field - DomainName *string `min:"1" type:"string" required:"true"` - - // The domain name that you want ACM to use to send you validation emails. This - // domain name is the suffix of the email addresses that you want ACM to use. - // This must be the same as the DomainName value or a superdomain of the DomainName - // value. For example, if you request a certificate for testing.example.com, - // you can specify example.com for this value. In that case, ACM sends domain - // validation emails to the following five addresses: - // - // * admin@example.com - // - // * administrator@example.com - // - // * hostmaster@example.com - // - // * postmaster@example.com - // - // * webmaster@example.com - // - // ValidationDomain is a required field - ValidationDomain *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DomainValidationOption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DomainValidationOption) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DomainValidationOption) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DomainValidationOption"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.DomainName != nil && len(*s.DomainName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 1)) - } - if s.ValidationDomain == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationDomain")) - } - if s.ValidationDomain != nil && len(*s.ValidationDomain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ValidationDomain", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DomainValidationOption) SetDomainName(v string) *DomainValidationOption { - s.DomainName = &v - return s -} - -// SetValidationDomain sets the ValidationDomain field's value. -func (s *DomainValidationOption) SetValidationDomain(v string) *DomainValidationOption { - s.ValidationDomain = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/GetCertificateRequest -type GetCertificateInput struct { - _ struct{} `type:"structure"` - - // String that contains a certificate ARN in the following format: - // - // arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012 - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // CertificateArn is a required field - CertificateArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCertificateInput"} - if s.CertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateArn")) - } - if s.CertificateArn != nil && len(*s.CertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CertificateArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *GetCertificateInput) SetCertificateArn(v string) *GetCertificateInput { - s.CertificateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/GetCertificateResponse -type GetCertificateOutput struct { - _ struct{} `type:"structure"` - - // String that contains the ACM Certificate represented by the ARN specified - // at input. - Certificate *string `min:"1" type:"string"` - - // The certificate chain that contains the root certificate issued by the certificate - // authority (CA). - CertificateChain *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCertificateOutput) GoString() string { - return s.String() -} - -// SetCertificate sets the Certificate field's value. -func (s *GetCertificateOutput) SetCertificate(v string) *GetCertificateOutput { - s.Certificate = &v - return s -} - -// SetCertificateChain sets the CertificateChain field's value. -func (s *GetCertificateOutput) SetCertificateChain(v string) *GetCertificateOutput { - s.CertificateChain = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ImportCertificateRequest -type ImportCertificateInput struct { - _ struct{} `type:"structure"` - - // The certificate to import. It must meet the following requirements: - // - // * Must be PEM-encoded. - // - // * Must contain a 1024-bit or 2048-bit RSA public key. - // - // * Must be valid at the time of import. You cannot import a certificate - // before its validity period begins (the certificate's NotBefore date) or - // after it expires (the certificate's NotAfter date). - // - // Certificate is automatically base64 encoded/decoded by the SDK. - // - // Certificate is a required field - Certificate []byte `min:"1" type:"blob" required:"true"` - - // The Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of an imported certificate to replace. To import a new certificate, omit - // this field. - CertificateArn *string `min:"20" type:"string"` - - // The certificate chain. It must be PEM-encoded. - // - // CertificateChain is automatically base64 encoded/decoded by the SDK. - CertificateChain []byte `min:"1" type:"blob"` - - // The private key that matches the public key in the certificate. It must meet - // the following requirements: - // - // * Must be PEM-encoded. - // - // * Must be unencrypted. You cannot import a private key that is protected - // by a password or passphrase. - // - // PrivateKey is automatically base64 encoded/decoded by the SDK. - // - // PrivateKey is a required field - PrivateKey []byte `min:"1" type:"blob" required:"true"` -} - -// String returns the string representation -func (s ImportCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportCertificateInput"} - if s.Certificate == nil { - invalidParams.Add(request.NewErrParamRequired("Certificate")) - } - if s.Certificate != nil && len(s.Certificate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Certificate", 1)) - } - if s.CertificateArn != nil && len(*s.CertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CertificateArn", 20)) - } - if s.CertificateChain != nil && len(s.CertificateChain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CertificateChain", 1)) - } - if s.PrivateKey == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKey")) - } - if s.PrivateKey != nil && len(s.PrivateKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PrivateKey", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificate sets the Certificate field's value. -func (s *ImportCertificateInput) SetCertificate(v []byte) *ImportCertificateInput { - s.Certificate = v - return s -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *ImportCertificateInput) SetCertificateArn(v string) *ImportCertificateInput { - s.CertificateArn = &v - return s -} - -// SetCertificateChain sets the CertificateChain field's value. -func (s *ImportCertificateInput) SetCertificateChain(v []byte) *ImportCertificateInput { - s.CertificateChain = v - return s -} - -// SetPrivateKey sets the PrivateKey field's value. -func (s *ImportCertificateInput) SetPrivateKey(v []byte) *ImportCertificateInput { - s.PrivateKey = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ImportCertificateResponse -type ImportCertificateOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the imported certificate. - CertificateArn *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s ImportCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportCertificateOutput) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *ImportCertificateOutput) SetCertificateArn(v string) *ImportCertificateOutput { - s.CertificateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListCertificatesRequest -type ListCertificatesInput struct { - _ struct{} `type:"structure"` - - // The status or statuses on which to filter the list of ACM Certificates. - CertificateStatuses []*string `type:"list"` - - // Use this parameter when paginating results to specify the maximum number - // of items to return in the response. If additional items exist beyond the - // number you specify, the NextToken element is sent in the response. Use this - // NextToken value in a subsequent request to retrieve additional items. - MaxItems *int64 `min:"1" type:"integer"` - - // Use this parameter only when paginating results and only in a subsequent - // request after you receive a response with truncated results. Set it to the - // value of NextToken from the response you just received. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListCertificatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCertificatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCertificatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCertificatesInput"} - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateStatuses sets the CertificateStatuses field's value. -func (s *ListCertificatesInput) SetCertificateStatuses(v []*string) *ListCertificatesInput { - s.CertificateStatuses = v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListCertificatesInput) SetMaxItems(v int64) *ListCertificatesInput { - s.MaxItems = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCertificatesInput) SetNextToken(v string) *ListCertificatesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListCertificatesResponse -type ListCertificatesOutput struct { - _ struct{} `type:"structure"` - - // A list of ACM Certificates. - CertificateSummaryList []*CertificateSummary `type:"list"` - - // When the list is truncated, this value is present and contains the value - // to use for the NextToken parameter in a subsequent pagination request. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListCertificatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCertificatesOutput) GoString() string { - return s.String() -} - -// SetCertificateSummaryList sets the CertificateSummaryList field's value. -func (s *ListCertificatesOutput) SetCertificateSummaryList(v []*CertificateSummary) *ListCertificatesOutput { - s.CertificateSummaryList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCertificatesOutput) SetNextToken(v string) *ListCertificatesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListTagsForCertificateRequest -type ListTagsForCertificateInput struct { - _ struct{} `type:"structure"` - - // String that contains the ARN of the ACM Certificate for which you want to - // list the tags. This has the following form: - // - // arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012 - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // CertificateArn is a required field - CertificateArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTagsForCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForCertificateInput"} - if s.CertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateArn")) - } - if s.CertificateArn != nil && len(*s.CertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CertificateArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *ListTagsForCertificateInput) SetCertificateArn(v string) *ListTagsForCertificateInput { - s.CertificateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListTagsForCertificateResponse -type ListTagsForCertificateOutput struct { - _ struct{} `type:"structure"` - - // The key-value pairs that define the applied tags. - Tags []*Tag `min:"1" type:"list"` -} - -// String returns the string representation -func (s ListTagsForCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForCertificateOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForCertificateOutput) SetTags(v []*Tag) *ListTagsForCertificateOutput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RemoveTagsFromCertificateRequest -type RemoveTagsFromCertificateInput struct { - _ struct{} `type:"structure"` - - // String that contains the ARN of the ACM Certificate with one or more tags - // that you want to remove. This must be of the form: - // - // arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012 - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // CertificateArn is a required field - CertificateArn *string `min:"20" type:"string" required:"true"` - - // The key-value pair that defines the tag to remove. - // - // Tags is a required field - Tags []*Tag `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromCertificateInput"} - if s.CertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateArn")) - } - if s.CertificateArn != nil && len(*s.CertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CertificateArn", 20)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - 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 -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *RemoveTagsFromCertificateInput) SetCertificateArn(v string) *RemoveTagsFromCertificateInput { - s.CertificateArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *RemoveTagsFromCertificateInput) SetTags(v []*Tag) *RemoveTagsFromCertificateInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RemoveTagsFromCertificateOutput -type RemoveTagsFromCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsFromCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromCertificateOutput) GoString() string { - return s.String() -} - -// Contains information about the status of ACM's managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html) -// for the certificate. This structure exists only when the certificate type -// is AMAZON_ISSUED. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RenewalSummary -type RenewalSummary struct { - _ struct{} `type:"structure"` - - // Contains information about the validation of each domain name in the certificate, - // as it pertains to ACM's managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html). - // This is different from the initial validation that occurs as a result of - // the RequestCertificate request. This field exists only when the certificate - // type is AMAZON_ISSUED. - // - // DomainValidationOptions is a required field - DomainValidationOptions []*DomainValidation `min:"1" type:"list" required:"true"` - - // The status of ACM's managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html) - // of the certificate. - // - // RenewalStatus is a required field - RenewalStatus *string `type:"string" required:"true" enum:"RenewalStatus"` -} - -// String returns the string representation -func (s RenewalSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RenewalSummary) GoString() string { - return s.String() -} - -// SetDomainValidationOptions sets the DomainValidationOptions field's value. -func (s *RenewalSummary) SetDomainValidationOptions(v []*DomainValidation) *RenewalSummary { - s.DomainValidationOptions = v - return s -} - -// SetRenewalStatus sets the RenewalStatus field's value. -func (s *RenewalSummary) SetRenewalStatus(v string) *RenewalSummary { - s.RenewalStatus = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RequestCertificateRequest -type RequestCertificateInput struct { - _ struct{} `type:"structure"` - - // Fully qualified domain name (FQDN), such as www.example.com, of the site - // that you want to secure with an ACM Certificate. Use an asterisk (*) to create - // a wildcard certificate that protects several sites in the same domain. For - // example, *.example.com protects www.example.com, site.example.com, and images.example.com. - // - // DomainName is a required field - DomainName *string `min:"1" type:"string" required:"true"` - - // The domain name that you want ACM to use to send you emails to validate your - // ownership of the domain. - DomainValidationOptions []*DomainValidationOption `min:"1" type:"list"` - - // Customer chosen string that can be used to distinguish between calls to RequestCertificate. - // Idempotency tokens time out after one hour. Therefore, if you call RequestCertificate - // multiple times with the same idempotency token within one hour, ACM recognizes - // that you are requesting only one certificate and will issue only one. If - // you change the idempotency token for each call, ACM recognizes that you are - // requesting multiple certificates. - IdempotencyToken *string `min:"1" type:"string"` - - // Additional FQDNs to be included in the Subject Alternative Name extension - // of the ACM Certificate. For example, add the name www.example.net to a certificate - // for which the DomainName field is www.example.com if users can reach your - // site by using either name. - SubjectAlternativeNames []*string `min:"1" type:"list"` -} - -// String returns the string representation -func (s RequestCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestCertificateInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.DomainName != nil && len(*s.DomainName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 1)) - } - if s.DomainValidationOptions != nil && len(s.DomainValidationOptions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainValidationOptions", 1)) - } - if s.IdempotencyToken != nil && len(*s.IdempotencyToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IdempotencyToken", 1)) - } - if s.SubjectAlternativeNames != nil && len(s.SubjectAlternativeNames) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubjectAlternativeNames", 1)) - } - if s.DomainValidationOptions != nil { - for i, v := range s.DomainValidationOptions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DomainValidationOptions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *RequestCertificateInput) SetDomainName(v string) *RequestCertificateInput { - s.DomainName = &v - return s -} - -// SetDomainValidationOptions sets the DomainValidationOptions field's value. -func (s *RequestCertificateInput) SetDomainValidationOptions(v []*DomainValidationOption) *RequestCertificateInput { - s.DomainValidationOptions = v - return s -} - -// SetIdempotencyToken sets the IdempotencyToken field's value. -func (s *RequestCertificateInput) SetIdempotencyToken(v string) *RequestCertificateInput { - s.IdempotencyToken = &v - return s -} - -// SetSubjectAlternativeNames sets the SubjectAlternativeNames field's value. -func (s *RequestCertificateInput) SetSubjectAlternativeNames(v []*string) *RequestCertificateInput { - s.SubjectAlternativeNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RequestCertificateResponse -type RequestCertificateOutput struct { - _ struct{} `type:"structure"` - - // String that contains the ARN of the issued certificate. This must be of the - // form: - // - // arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012 - CertificateArn *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s RequestCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestCertificateOutput) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *RequestCertificateOutput) SetCertificateArn(v string) *RequestCertificateOutput { - s.CertificateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ResendValidationEmailRequest -type ResendValidationEmailInput struct { - _ struct{} `type:"structure"` - - // String that contains the ARN of the requested certificate. The certificate - // ARN is generated and returned by the RequestCertificate action as soon as - // the request is made. By default, using this parameter causes email to be - // sent to all top-level domains you specified in the certificate request. - // - // The ARN must be of the form: - // - // arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012 - // - // CertificateArn is a required field - CertificateArn *string `min:"20" type:"string" required:"true"` - - // The fully qualified domain name (FQDN) of the certificate that needs to be - // validated. - // - // Domain is a required field - Domain *string `min:"1" type:"string" required:"true"` - - // The base validation domain that will act as the suffix of the email addresses - // that are used to send the emails. This must be the same as the Domain value - // or a superdomain of the Domain value. For example, if you requested a certificate - // for site.subdomain.example.com and specify a ValidationDomain of subdomain.example.com, - // ACM sends email to the domain registrant, technical contact, and administrative - // contact in WHOIS and the following five addresses: - // - // * admin@subdomain.example.com - // - // * administrator@subdomain.example.com - // - // * hostmaster@subdomain.example.com - // - // * postmaster@subdomain.example.com - // - // * webmaster@subdomain.example.com - // - // ValidationDomain is a required field - ValidationDomain *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ResendValidationEmailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResendValidationEmailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResendValidationEmailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResendValidationEmailInput"} - if s.CertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateArn")) - } - if s.CertificateArn != nil && len(*s.CertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CertificateArn", 20)) - } - if s.Domain == nil { - invalidParams.Add(request.NewErrParamRequired("Domain")) - } - if s.Domain != nil && len(*s.Domain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Domain", 1)) - } - if s.ValidationDomain == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationDomain")) - } - if s.ValidationDomain != nil && len(*s.ValidationDomain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ValidationDomain", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *ResendValidationEmailInput) SetCertificateArn(v string) *ResendValidationEmailInput { - s.CertificateArn = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *ResendValidationEmailInput) SetDomain(v string) *ResendValidationEmailInput { - s.Domain = &v - return s -} - -// SetValidationDomain sets the ValidationDomain field's value. -func (s *ResendValidationEmailInput) SetValidationDomain(v string) *ResendValidationEmailInput { - s.ValidationDomain = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ResendValidationEmailOutput -type ResendValidationEmailOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResendValidationEmailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResendValidationEmailOutput) GoString() string { - return s.String() -} - -// A key-value pair that identifies or specifies metadata about an ACM resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value of 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() -} - -// 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 -} - -const ( - // CertificateStatusPendingValidation is a CertificateStatus enum value - CertificateStatusPendingValidation = "PENDING_VALIDATION" - - // CertificateStatusIssued is a CertificateStatus enum value - CertificateStatusIssued = "ISSUED" - - // CertificateStatusInactive is a CertificateStatus enum value - CertificateStatusInactive = "INACTIVE" - - // CertificateStatusExpired is a CertificateStatus enum value - CertificateStatusExpired = "EXPIRED" - - // CertificateStatusValidationTimedOut is a CertificateStatus enum value - CertificateStatusValidationTimedOut = "VALIDATION_TIMED_OUT" - - // CertificateStatusRevoked is a CertificateStatus enum value - CertificateStatusRevoked = "REVOKED" - - // CertificateStatusFailed is a CertificateStatus enum value - CertificateStatusFailed = "FAILED" -) - -const ( - // CertificateTypeImported is a CertificateType enum value - CertificateTypeImported = "IMPORTED" - - // CertificateTypeAmazonIssued is a CertificateType enum value - CertificateTypeAmazonIssued = "AMAZON_ISSUED" -) - -const ( - // DomainStatusPendingValidation is a DomainStatus enum value - DomainStatusPendingValidation = "PENDING_VALIDATION" - - // DomainStatusSuccess is a DomainStatus enum value - DomainStatusSuccess = "SUCCESS" - - // DomainStatusFailed is a DomainStatus enum value - DomainStatusFailed = "FAILED" -) - -const ( - // FailureReasonNoAvailableContacts is a FailureReason enum value - FailureReasonNoAvailableContacts = "NO_AVAILABLE_CONTACTS" - - // FailureReasonAdditionalVerificationRequired is a FailureReason enum value - FailureReasonAdditionalVerificationRequired = "ADDITIONAL_VERIFICATION_REQUIRED" - - // FailureReasonDomainNotAllowed is a FailureReason enum value - FailureReasonDomainNotAllowed = "DOMAIN_NOT_ALLOWED" - - // FailureReasonInvalidPublicDomain is a FailureReason enum value - FailureReasonInvalidPublicDomain = "INVALID_PUBLIC_DOMAIN" - - // FailureReasonOther is a FailureReason enum value - FailureReasonOther = "OTHER" -) - -const ( - // KeyAlgorithmRsa2048 is a KeyAlgorithm enum value - KeyAlgorithmRsa2048 = "RSA_2048" - - // KeyAlgorithmRsa1024 is a KeyAlgorithm enum value - KeyAlgorithmRsa1024 = "RSA_1024" - - // KeyAlgorithmEcPrime256v1 is a KeyAlgorithm enum value - KeyAlgorithmEcPrime256v1 = "EC_prime256v1" -) - -const ( - // RenewalStatusPendingAutoRenewal is a RenewalStatus enum value - RenewalStatusPendingAutoRenewal = "PENDING_AUTO_RENEWAL" - - // RenewalStatusPendingValidation is a RenewalStatus enum value - RenewalStatusPendingValidation = "PENDING_VALIDATION" - - // RenewalStatusSuccess is a RenewalStatus enum value - RenewalStatusSuccess = "SUCCESS" - - // RenewalStatusFailed is a RenewalStatus enum value - RenewalStatusFailed = "FAILED" -) - -const ( - // RevocationReasonUnspecified is a RevocationReason enum value - RevocationReasonUnspecified = "UNSPECIFIED" - - // RevocationReasonKeyCompromise is a RevocationReason enum value - RevocationReasonKeyCompromise = "KEY_COMPROMISE" - - // RevocationReasonCaCompromise is a RevocationReason enum value - RevocationReasonCaCompromise = "CA_COMPROMISE" - - // RevocationReasonAffiliationChanged is a RevocationReason enum value - RevocationReasonAffiliationChanged = "AFFILIATION_CHANGED" - - // RevocationReasonSuperceded is a RevocationReason enum value - RevocationReasonSuperceded = "SUPERCEDED" - - // RevocationReasonCessationOfOperation is a RevocationReason enum value - RevocationReasonCessationOfOperation = "CESSATION_OF_OPERATION" - - // RevocationReasonCertificateHold is a RevocationReason enum value - RevocationReasonCertificateHold = "CERTIFICATE_HOLD" - - // RevocationReasonRemoveFromCrl is a RevocationReason enum value - RevocationReasonRemoveFromCrl = "REMOVE_FROM_CRL" - - // RevocationReasonPrivilegeWithdrawn is a RevocationReason enum value - RevocationReasonPrivilegeWithdrawn = "PRIVILEGE_WITHDRAWN" - - // RevocationReasonAACompromise is a RevocationReason enum value - RevocationReasonAACompromise = "A_A_COMPROMISE" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go b/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go deleted file mode 100644 index 73093d1..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go +++ /dev/null @@ -1,71 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package acm - -const ( - - // ErrCodeInvalidArnException for service response error code - // "InvalidArnException". - // - // The requested Amazon Resource Name (ARN) does not refer to an existing resource. - ErrCodeInvalidArnException = "InvalidArnException" - - // ErrCodeInvalidDomainValidationOptionsException for service response error code - // "InvalidDomainValidationOptionsException". - // - // One or more values in the DomainValidationOption structure is incorrect. - ErrCodeInvalidDomainValidationOptionsException = "InvalidDomainValidationOptionsException" - - // ErrCodeInvalidStateException for service response error code - // "InvalidStateException". - // - // Processing has reached an invalid state. For example, this exception can - // occur if the specified domain is not using email validation, or the current - // certificate status does not permit the requested operation. See the exception - // message returned by ACM to determine which state is not valid. - ErrCodeInvalidStateException = "InvalidStateException" - - // ErrCodeInvalidTagException for service response error code - // "InvalidTagException". - // - // One or both of the values that make up the key-value pair is not valid. For - // example, you cannot specify a tag value that begins with aws:. - ErrCodeInvalidTagException = "InvalidTagException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // An ACM limit has been exceeded. For example, you may have input more domains - // than are allowed or you've requested too many certificates for your account. - // See the exception message returned by ACM to determine which limit you have - // violated. For more information about ACM limits, see the Limits (http://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html) - // topic. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeRequestInProgressException for service response error code - // "RequestInProgressException". - // - // The certificate request is in process and the certificate in your account - // has not yet been issued. - ErrCodeRequestInProgressException = "RequestInProgressException" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUseException". - // - // The certificate is in use by another AWS service in the caller's account. - // Remove the association and try again. - ErrCodeResourceInUseException = "ResourceInUseException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified certificate cannot be found in the caller's account, or the - // caller's account cannot be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTagsException". - // - // The request contains too many tags. Try the request again with fewer tags. - ErrCodeTooManyTagsException = "TooManyTagsException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/acm/service.go b/vendor/github.com/aws/aws-sdk-go/service/acm/service.go deleted file mode 100644 index 0c1d69a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/service.go +++ /dev/null @@ -1,97 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package acm - -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" -) - -// Welcome to the AWS Certificate Manager (ACM) API documentation. -// -// You can use ACM to manage SSL/TLS certificates for your AWS-based websites -// and applications. For general information about using ACM, see the AWS Certificate -// Manager User Guide (http://docs.aws.amazon.com/acm/latest/userguide/). -// 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/acm-2015-12-08 -type ACM 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 = "acm" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ACM 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 ACM client from just a session. -// svc := acm.New(mySession) -// -// // Create a ACM client with additional configuration -// svc := acm.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ACM { - 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) *ACM { - svc := &ACM{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-12-08", - JSONVersion: "1.1", - TargetPrefix: "CertificateManager", - }, - 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 ACM operation and runs any -// custom request initialization. -func (c *ACM) 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/apigateway/api.go b/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go deleted file mode 100644 index e0af386..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go +++ /dev/null @@ -1,17752 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package apigateway provides a client for Amazon API Gateway. -package apigateway - -import ( - "time" - - "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/restjson" -) - -const opCreateApiKey = "CreateApiKey" - -// CreateApiKeyRequest generates a "aws/request.Request" representing the -// client's request for the CreateApiKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateApiKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateApiKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateApiKeyRequest method. -// req, resp := client.CreateApiKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateApiKeyRequest(input *CreateApiKeyInput) (req *request.Request, output *ApiKey) { - op := &request.Operation{ - Name: opCreateApiKey, - HTTPMethod: "POST", - HTTPPath: "/apikeys", - } - - if input == nil { - input = &CreateApiKeyInput{} - } - - output = &ApiKey{} - req = c.newRequest(op, input, output) - return -} - -// CreateApiKey API operation for Amazon API Gateway. -// -// Create an ApiKey resource. -// -// AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/create-api-key.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 API Gateway's -// API operation CreateApiKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) CreateApiKey(input *CreateApiKeyInput) (*ApiKey, error) { - req, out := c.CreateApiKeyRequest(input) - err := req.Send() - return out, err -} - -const opCreateAuthorizer = "CreateAuthorizer" - -// CreateAuthorizerRequest generates a "aws/request.Request" representing the -// client's request for the CreateAuthorizer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAuthorizer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAuthorizer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAuthorizerRequest method. -// req, resp := client.CreateAuthorizerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateAuthorizerRequest(input *CreateAuthorizerInput) (req *request.Request, output *Authorizer) { - op := &request.Operation{ - Name: opCreateAuthorizer, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/authorizers", - } - - if input == nil { - input = &CreateAuthorizerInput{} - } - - output = &Authorizer{} - req = c.newRequest(op, input, output) - return -} - -// CreateAuthorizer API operation for Amazon API Gateway. -// -// Adds a new Authorizer resource to an existing RestApi resource. -// -// AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/create-authorizer.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 API Gateway's -// API operation CreateAuthorizer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateAuthorizer(input *CreateAuthorizerInput) (*Authorizer, error) { - req, out := c.CreateAuthorizerRequest(input) - err := req.Send() - return out, err -} - -const opCreateBasePathMapping = "CreateBasePathMapping" - -// CreateBasePathMappingRequest generates a "aws/request.Request" representing the -// client's request for the CreateBasePathMapping operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateBasePathMapping for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateBasePathMapping method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateBasePathMappingRequest method. -// req, resp := client.CreateBasePathMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateBasePathMappingRequest(input *CreateBasePathMappingInput) (req *request.Request, output *BasePathMapping) { - op := &request.Operation{ - Name: opCreateBasePathMapping, - HTTPMethod: "POST", - HTTPPath: "/domainnames/{domain_name}/basepathmappings", - } - - if input == nil { - input = &CreateBasePathMappingInput{} - } - - output = &BasePathMapping{} - req = c.newRequest(op, input, output) - return -} - -// CreateBasePathMapping API operation for Amazon API Gateway. -// -// Creates a new BasePathMapping 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 API Gateway's -// API operation CreateBasePathMapping for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateBasePathMapping(input *CreateBasePathMappingInput) (*BasePathMapping, error) { - req, out := c.CreateBasePathMappingRequest(input) - err := req.Send() - return out, err -} - -const opCreateDeployment = "CreateDeployment" - -// CreateDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the CreateDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDeploymentRequest method. -// req, resp := client.CreateDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateDeploymentRequest(input *CreateDeploymentInput) (req *request.Request, output *Deployment) { - op := &request.Operation{ - Name: opCreateDeployment, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/deployments", - } - - if input == nil { - input = &CreateDeploymentInput{} - } - - output = &Deployment{} - req = c.newRequest(op, input, output) - return -} - -// CreateDeployment API operation for Amazon API Gateway. -// -// Creates a Deployment resource, which makes a specified RestApi callable over -// the internet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation CreateDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// -func (c *APIGateway) CreateDeployment(input *CreateDeploymentInput) (*Deployment, error) { - req, out := c.CreateDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opCreateDocumentationPart = "CreateDocumentationPart" - -// CreateDocumentationPartRequest generates a "aws/request.Request" representing the -// client's request for the CreateDocumentationPart operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDocumentationPart for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDocumentationPart method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDocumentationPartRequest method. -// req, resp := client.CreateDocumentationPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateDocumentationPartRequest(input *CreateDocumentationPartInput) (req *request.Request, output *DocumentationPart) { - op := &request.Operation{ - Name: opCreateDocumentationPart, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/documentation/parts", - } - - if input == nil { - input = &CreateDocumentationPartInput{} - } - - output = &DocumentationPart{} - req = c.newRequest(op, input, output) - return -} - -// CreateDocumentationPart API operation for Amazon API 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 API Gateway's -// API operation CreateDocumentationPart for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateDocumentationPart(input *CreateDocumentationPartInput) (*DocumentationPart, error) { - req, out := c.CreateDocumentationPartRequest(input) - err := req.Send() - return out, err -} - -const opCreateDocumentationVersion = "CreateDocumentationVersion" - -// CreateDocumentationVersionRequest generates a "aws/request.Request" representing the -// client's request for the CreateDocumentationVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDocumentationVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDocumentationVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDocumentationVersionRequest method. -// req, resp := client.CreateDocumentationVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateDocumentationVersionRequest(input *CreateDocumentationVersionInput) (req *request.Request, output *DocumentationVersion) { - op := &request.Operation{ - Name: opCreateDocumentationVersion, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/documentation/versions", - } - - if input == nil { - input = &CreateDocumentationVersionInput{} - } - - output = &DocumentationVersion{} - req = c.newRequest(op, input, output) - return -} - -// CreateDocumentationVersion API operation for Amazon API 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 API Gateway's -// API operation CreateDocumentationVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateDocumentationVersion(input *CreateDocumentationVersionInput) (*DocumentationVersion, error) { - req, out := c.CreateDocumentationVersionRequest(input) - err := req.Send() - return out, err -} - -const opCreateDomainName = "CreateDomainName" - -// CreateDomainNameRequest generates a "aws/request.Request" representing the -// client's request for the CreateDomainName operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDomainName for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDomainName method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDomainNameRequest method. -// req, resp := client.CreateDomainNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateDomainNameRequest(input *CreateDomainNameInput) (req *request.Request, output *DomainName) { - op := &request.Operation{ - Name: opCreateDomainName, - HTTPMethod: "POST", - HTTPPath: "/domainnames", - } - - if input == nil { - input = &CreateDomainNameInput{} - } - - output = &DomainName{} - req = c.newRequest(op, input, output) - return -} - -// CreateDomainName API operation for Amazon API Gateway. -// -// Creates a new domain 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 API Gateway's -// API operation CreateDomainName for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateDomainName(input *CreateDomainNameInput) (*DomainName, error) { - req, out := c.CreateDomainNameRequest(input) - err := req.Send() - return out, err -} - -const opCreateModel = "CreateModel" - -// CreateModelRequest generates a "aws/request.Request" representing the -// client's request for the CreateModel operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateModel for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateModel method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateModelRequest method. -// req, resp := client.CreateModelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateModelRequest(input *CreateModelInput) (req *request.Request, output *Model) { - op := &request.Operation{ - Name: opCreateModel, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/models", - } - - if input == nil { - input = &CreateModelInput{} - } - - output = &Model{} - req = c.newRequest(op, input, output) - return -} - -// CreateModel API operation for Amazon API Gateway. -// -// Adds a new Model resource to an existing RestApi 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 API Gateway's -// API operation CreateModel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateModel(input *CreateModelInput) (*Model, error) { - req, out := c.CreateModelRequest(input) - err := req.Send() - return out, err -} - -const opCreateResource = "CreateResource" - -// CreateResourceRequest generates a "aws/request.Request" representing the -// client's request for the CreateResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateResourceRequest method. -// req, resp := client.CreateResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateResourceRequest(input *CreateResourceInput) (req *request.Request, output *Resource) { - op := &request.Operation{ - Name: opCreateResource, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/resources/{parent_id}", - } - - if input == nil { - input = &CreateResourceInput{} - } - - output = &Resource{} - req = c.newRequest(op, input, output) - return -} - -// CreateResource API operation for Amazon API Gateway. -// -// Creates a Resource 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 API Gateway's -// API operation CreateResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateResource(input *CreateResourceInput) (*Resource, error) { - req, out := c.CreateResourceRequest(input) - err := req.Send() - return out, err -} - -const opCreateRestApi = "CreateRestApi" - -// CreateRestApiRequest generates a "aws/request.Request" representing the -// client's request for the CreateRestApi operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateRestApi for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateRestApi method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateRestApiRequest method. -// req, resp := client.CreateRestApiRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateRestApiRequest(input *CreateRestApiInput) (req *request.Request, output *RestApi) { - op := &request.Operation{ - Name: opCreateRestApi, - HTTPMethod: "POST", - HTTPPath: "/restapis", - } - - if input == nil { - input = &CreateRestApiInput{} - } - - output = &RestApi{} - req = c.newRequest(op, input, output) - return -} - -// CreateRestApi API operation for Amazon API Gateway. -// -// Creates a new RestApi 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 API Gateway's -// API operation CreateRestApi for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateRestApi(input *CreateRestApiInput) (*RestApi, error) { - req, out := c.CreateRestApiRequest(input) - err := req.Send() - return out, err -} - -const opCreateStage = "CreateStage" - -// CreateStageRequest generates a "aws/request.Request" representing the -// client's request for the CreateStage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateStage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateStage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateStageRequest method. -// req, resp := client.CreateStageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateStageRequest(input *CreateStageInput) (req *request.Request, output *Stage) { - op := &request.Operation{ - Name: opCreateStage, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/stages", - } - - if input == nil { - input = &CreateStageInput{} - } - - output = &Stage{} - req = c.newRequest(op, input, output) - return -} - -// CreateStage API operation for Amazon API Gateway. -// -// Creates a new Stage resource that references a pre-existing Deployment for -// the 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 API Gateway's -// API operation CreateStage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateStage(input *CreateStageInput) (*Stage, error) { - req, out := c.CreateStageRequest(input) - err := req.Send() - return out, err -} - -const opCreateUsagePlan = "CreateUsagePlan" - -// CreateUsagePlanRequest generates a "aws/request.Request" representing the -// client's request for the CreateUsagePlan operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateUsagePlan for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateUsagePlan method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateUsagePlanRequest method. -// req, resp := client.CreateUsagePlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateUsagePlanRequest(input *CreateUsagePlanInput) (req *request.Request, output *UsagePlan) { - op := &request.Operation{ - Name: opCreateUsagePlan, - HTTPMethod: "POST", - HTTPPath: "/usageplans", - } - - if input == nil { - input = &CreateUsagePlanInput{} - } - - output = &UsagePlan{} - req = c.newRequest(op, input, output) - return -} - -// CreateUsagePlan API operation for Amazon API Gateway. -// -// Creates a usage plan with the throttle and quota limits, as well as the associated -// API stages, specified in the payload. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation CreateUsagePlan for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -func (c *APIGateway) CreateUsagePlan(input *CreateUsagePlanInput) (*UsagePlan, error) { - req, out := c.CreateUsagePlanRequest(input) - err := req.Send() - return out, err -} - -const opCreateUsagePlanKey = "CreateUsagePlanKey" - -// CreateUsagePlanKeyRequest generates a "aws/request.Request" representing the -// client's request for the CreateUsagePlanKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateUsagePlanKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateUsagePlanKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateUsagePlanKeyRequest method. -// req, resp := client.CreateUsagePlanKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) CreateUsagePlanKeyRequest(input *CreateUsagePlanKeyInput) (req *request.Request, output *UsagePlanKey) { - op := &request.Operation{ - Name: opCreateUsagePlanKey, - HTTPMethod: "POST", - HTTPPath: "/usageplans/{usageplanId}/keys", - } - - if input == nil { - input = &CreateUsagePlanKeyInput{} - } - - output = &UsagePlanKey{} - req = c.newRequest(op, input, output) - return -} - -// CreateUsagePlanKey API operation for Amazon API Gateway. -// -// Creates a usage plan key for adding an existing API key to a usage plan. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation CreateUsagePlanKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) CreateUsagePlanKey(input *CreateUsagePlanKeyInput) (*UsagePlanKey, error) { - req, out := c.CreateUsagePlanKeyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteApiKey = "DeleteApiKey" - -// DeleteApiKeyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApiKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteApiKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteApiKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteApiKeyRequest method. -// req, resp := client.DeleteApiKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteApiKeyRequest(input *DeleteApiKeyInput) (req *request.Request, output *DeleteApiKeyOutput) { - op := &request.Operation{ - Name: opDeleteApiKey, - HTTPMethod: "DELETE", - HTTPPath: "/apikeys/{api_Key}", - } - - if input == nil { - input = &DeleteApiKeyInput{} - } - - output = &DeleteApiKeyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApiKey API operation for Amazon API Gateway. -// -// Deletes the ApiKey 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 API Gateway's -// API operation DeleteApiKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) DeleteApiKey(input *DeleteApiKeyInput) (*DeleteApiKeyOutput, error) { - req, out := c.DeleteApiKeyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAuthorizer = "DeleteAuthorizer" - -// DeleteAuthorizerRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAuthorizer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAuthorizer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAuthorizer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAuthorizerRequest method. -// req, resp := client.DeleteAuthorizerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteAuthorizerRequest(input *DeleteAuthorizerInput) (req *request.Request, output *DeleteAuthorizerOutput) { - op := &request.Operation{ - Name: opDeleteAuthorizer, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/authorizers/{authorizer_id}", - } - - if input == nil { - input = &DeleteAuthorizerInput{} - } - - output = &DeleteAuthorizerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAuthorizer API operation for Amazon API Gateway. -// -// Deletes an existing Authorizer resource. -// -// AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/delete-authorizer.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 API Gateway's -// API operation DeleteAuthorizer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) DeleteAuthorizer(input *DeleteAuthorizerInput) (*DeleteAuthorizerOutput, error) { - req, out := c.DeleteAuthorizerRequest(input) - err := req.Send() - return out, err -} - -const opDeleteBasePathMapping = "DeleteBasePathMapping" - -// DeleteBasePathMappingRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBasePathMapping operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBasePathMapping for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBasePathMapping method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBasePathMappingRequest method. -// req, resp := client.DeleteBasePathMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteBasePathMappingRequest(input *DeleteBasePathMappingInput) (req *request.Request, output *DeleteBasePathMappingOutput) { - op := &request.Operation{ - Name: opDeleteBasePathMapping, - HTTPMethod: "DELETE", - HTTPPath: "/domainnames/{domain_name}/basepathmappings/{base_path}", - } - - if input == nil { - input = &DeleteBasePathMappingInput{} - } - - output = &DeleteBasePathMappingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBasePathMapping API operation for Amazon API Gateway. -// -// Deletes the BasePathMapping 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 API Gateway's -// API operation DeleteBasePathMapping for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) DeleteBasePathMapping(input *DeleteBasePathMappingInput) (*DeleteBasePathMappingOutput, error) { - req, out := c.DeleteBasePathMappingRequest(input) - err := req.Send() - return out, err -} - -const opDeleteClientCertificate = "DeleteClientCertificate" - -// DeleteClientCertificateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteClientCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteClientCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteClientCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteClientCertificateRequest method. -// req, resp := client.DeleteClientCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteClientCertificateRequest(input *DeleteClientCertificateInput) (req *request.Request, output *DeleteClientCertificateOutput) { - op := &request.Operation{ - Name: opDeleteClientCertificate, - HTTPMethod: "DELETE", - HTTPPath: "/clientcertificates/{clientcertificate_id}", - } - - if input == nil { - input = &DeleteClientCertificateInput{} - } - - output = &DeleteClientCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteClientCertificate API operation for Amazon API Gateway. -// -// Deletes the ClientCertificate 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 API Gateway's -// API operation DeleteClientCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -func (c *APIGateway) DeleteClientCertificate(input *DeleteClientCertificateInput) (*DeleteClientCertificateOutput, error) { - req, out := c.DeleteClientCertificateRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDeployment = "DeleteDeployment" - -// DeleteDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDeploymentRequest method. -// req, resp := client.DeleteDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteDeploymentRequest(input *DeleteDeploymentInput) (req *request.Request, output *DeleteDeploymentOutput) { - op := &request.Operation{ - Name: opDeleteDeployment, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/deployments/{deployment_id}", - } - - if input == nil { - input = &DeleteDeploymentInput{} - } - - output = &DeleteDeploymentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDeployment API operation for Amazon API Gateway. -// -// Deletes a Deployment resource. Deleting a deployment will only succeed if -// there are no Stage resources associated with 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 API Gateway's -// API operation DeleteDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) DeleteDeployment(input *DeleteDeploymentInput) (*DeleteDeploymentOutput, error) { - req, out := c.DeleteDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDocumentationPart = "DeleteDocumentationPart" - -// DeleteDocumentationPartRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDocumentationPart operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDocumentationPart for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDocumentationPart method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDocumentationPartRequest method. -// req, resp := client.DeleteDocumentationPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteDocumentationPartRequest(input *DeleteDocumentationPartInput) (req *request.Request, output *DeleteDocumentationPartOutput) { - op := &request.Operation{ - Name: opDeleteDocumentationPart, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/documentation/parts/{part_id}", - } - - if input == nil { - input = &DeleteDocumentationPartInput{} - } - - output = &DeleteDocumentationPartOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDocumentationPart API operation for Amazon API 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 API Gateway's -// API operation DeleteDocumentationPart for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -func (c *APIGateway) DeleteDocumentationPart(input *DeleteDocumentationPartInput) (*DeleteDocumentationPartOutput, error) { - req, out := c.DeleteDocumentationPartRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDocumentationVersion = "DeleteDocumentationVersion" - -// DeleteDocumentationVersionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDocumentationVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDocumentationVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDocumentationVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDocumentationVersionRequest method. -// req, resp := client.DeleteDocumentationVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteDocumentationVersionRequest(input *DeleteDocumentationVersionInput) (req *request.Request, output *DeleteDocumentationVersionOutput) { - op := &request.Operation{ - Name: opDeleteDocumentationVersion, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/documentation/versions/{doc_version}", - } - - if input == nil { - input = &DeleteDocumentationVersionInput{} - } - - output = &DeleteDocumentationVersionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDocumentationVersion API operation for Amazon API 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 API Gateway's -// API operation DeleteDocumentationVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) DeleteDocumentationVersion(input *DeleteDocumentationVersionInput) (*DeleteDocumentationVersionOutput, error) { - req, out := c.DeleteDocumentationVersionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDomainName = "DeleteDomainName" - -// DeleteDomainNameRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDomainName operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDomainName for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDomainName method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDomainNameRequest method. -// req, resp := client.DeleteDomainNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteDomainNameRequest(input *DeleteDomainNameInput) (req *request.Request, output *DeleteDomainNameOutput) { - op := &request.Operation{ - Name: opDeleteDomainName, - HTTPMethod: "DELETE", - HTTPPath: "/domainnames/{domain_name}", - } - - if input == nil { - input = &DeleteDomainNameInput{} - } - - output = &DeleteDomainNameOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDomainName API operation for Amazon API Gateway. -// -// Deletes the DomainName 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 API Gateway's -// API operation DeleteDomainName for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) DeleteDomainName(input *DeleteDomainNameInput) (*DeleteDomainNameOutput, error) { - req, out := c.DeleteDomainNameRequest(input) - err := req.Send() - return out, err -} - -const opDeleteIntegration = "DeleteIntegration" - -// DeleteIntegrationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIntegration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteIntegration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteIntegration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteIntegrationRequest method. -// req, resp := client.DeleteIntegrationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteIntegrationRequest(input *DeleteIntegrationInput) (req *request.Request, output *DeleteIntegrationOutput) { - op := &request.Operation{ - Name: opDeleteIntegration, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration", - } - - if input == nil { - input = &DeleteIntegrationInput{} - } - - output = &DeleteIntegrationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteIntegration API operation for Amazon API Gateway. -// -// Represents a delete integration. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation DeleteIntegration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) DeleteIntegration(input *DeleteIntegrationInput) (*DeleteIntegrationOutput, error) { - req, out := c.DeleteIntegrationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteIntegrationResponse = "DeleteIntegrationResponse" - -// DeleteIntegrationResponseRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIntegrationResponse operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteIntegrationResponse for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteIntegrationResponse method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteIntegrationResponseRequest method. -// req, resp := client.DeleteIntegrationResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteIntegrationResponseRequest(input *DeleteIntegrationResponseInput) (req *request.Request, output *DeleteIntegrationResponseOutput) { - op := &request.Operation{ - Name: opDeleteIntegrationResponse, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration/responses/{status_code}", - } - - if input == nil { - input = &DeleteIntegrationResponseInput{} - } - - output = &DeleteIntegrationResponseOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteIntegrationResponse API operation for Amazon API Gateway. -// -// Represents a delete integration 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 API Gateway's -// API operation DeleteIntegrationResponse for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) DeleteIntegrationResponse(input *DeleteIntegrationResponseInput) (*DeleteIntegrationResponseOutput, error) { - req, out := c.DeleteIntegrationResponseRequest(input) - err := req.Send() - return out, err -} - -const opDeleteMethod = "DeleteMethod" - -// DeleteMethodRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMethod operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteMethod for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteMethod method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteMethodRequest method. -// req, resp := client.DeleteMethodRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteMethodRequest(input *DeleteMethodInput) (req *request.Request, output *DeleteMethodOutput) { - op := &request.Operation{ - Name: opDeleteMethod, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}", - } - - if input == nil { - input = &DeleteMethodInput{} - } - - output = &DeleteMethodOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteMethod API operation for Amazon API Gateway. -// -// Deletes an existing Method 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 API Gateway's -// API operation DeleteMethod for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) DeleteMethod(input *DeleteMethodInput) (*DeleteMethodOutput, error) { - req, out := c.DeleteMethodRequest(input) - err := req.Send() - return out, err -} - -const opDeleteMethodResponse = "DeleteMethodResponse" - -// DeleteMethodResponseRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMethodResponse operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteMethodResponse for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteMethodResponse method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteMethodResponseRequest method. -// req, resp := client.DeleteMethodResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteMethodResponseRequest(input *DeleteMethodResponseInput) (req *request.Request, output *DeleteMethodResponseOutput) { - op := &request.Operation{ - Name: opDeleteMethodResponse, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/responses/{status_code}", - } - - if input == nil { - input = &DeleteMethodResponseInput{} - } - - output = &DeleteMethodResponseOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteMethodResponse API operation for Amazon API Gateway. -// -// Deletes an existing MethodResponse 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 API Gateway's -// API operation DeleteMethodResponse for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) DeleteMethodResponse(input *DeleteMethodResponseInput) (*DeleteMethodResponseOutput, error) { - req, out := c.DeleteMethodResponseRequest(input) - err := req.Send() - return out, err -} - -const opDeleteModel = "DeleteModel" - -// DeleteModelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteModel operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteModel for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteModel method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteModelRequest method. -// req, resp := client.DeleteModelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteModelRequest(input *DeleteModelInput) (req *request.Request, output *DeleteModelOutput) { - op := &request.Operation{ - Name: opDeleteModel, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/models/{model_name}", - } - - if input == nil { - input = &DeleteModelInput{} - } - - output = &DeleteModelOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteModel API operation for Amazon API Gateway. -// -// Deletes a model. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation DeleteModel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) DeleteModel(input *DeleteModelInput) (*DeleteModelOutput, error) { - req, out := c.DeleteModelRequest(input) - err := req.Send() - return out, err -} - -const opDeleteResource = "DeleteResource" - -// DeleteResourceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteResourceRequest method. -// req, resp := client.DeleteResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteResourceRequest(input *DeleteResourceInput) (req *request.Request, output *DeleteResourceOutput) { - op := &request.Operation{ - Name: opDeleteResource, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}", - } - - if input == nil { - input = &DeleteResourceInput{} - } - - output = &DeleteResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteResource API operation for Amazon API Gateway. -// -// Deletes a Resource 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 API Gateway's -// API operation DeleteResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) DeleteResource(input *DeleteResourceInput) (*DeleteResourceOutput, error) { - req, out := c.DeleteResourceRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRestApi = "DeleteRestApi" - -// DeleteRestApiRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRestApi operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRestApi for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRestApi method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRestApiRequest method. -// req, resp := client.DeleteRestApiRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteRestApiRequest(input *DeleteRestApiInput) (req *request.Request, output *DeleteRestApiOutput) { - op := &request.Operation{ - Name: opDeleteRestApi, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}", - } - - if input == nil { - input = &DeleteRestApiInput{} - } - - output = &DeleteRestApiOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRestApi API operation for Amazon API Gateway. -// -// Deletes the specified 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 API Gateway's -// API operation DeleteRestApi for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -func (c *APIGateway) DeleteRestApi(input *DeleteRestApiInput) (*DeleteRestApiOutput, error) { - req, out := c.DeleteRestApiRequest(input) - err := req.Send() - return out, err -} - -const opDeleteStage = "DeleteStage" - -// DeleteStageRequest generates a "aws/request.Request" representing the -// client's request for the DeleteStage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteStage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteStage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteStageRequest method. -// req, resp := client.DeleteStageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteStageRequest(input *DeleteStageInput) (req *request.Request, output *DeleteStageOutput) { - op := &request.Operation{ - Name: opDeleteStage, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/stages/{stage_name}", - } - - if input == nil { - input = &DeleteStageInput{} - } - - output = &DeleteStageOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteStage API operation for Amazon API Gateway. -// -// Deletes a Stage 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 API Gateway's -// API operation DeleteStage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -func (c *APIGateway) DeleteStage(input *DeleteStageInput) (*DeleteStageOutput, error) { - req, out := c.DeleteStageRequest(input) - err := req.Send() - return out, err -} - -const opDeleteUsagePlan = "DeleteUsagePlan" - -// DeleteUsagePlanRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUsagePlan operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteUsagePlan for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteUsagePlan method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteUsagePlanRequest method. -// req, resp := client.DeleteUsagePlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteUsagePlanRequest(input *DeleteUsagePlanInput) (req *request.Request, output *DeleteUsagePlanOutput) { - op := &request.Operation{ - Name: opDeleteUsagePlan, - HTTPMethod: "DELETE", - HTTPPath: "/usageplans/{usageplanId}", - } - - if input == nil { - input = &DeleteUsagePlanInput{} - } - - output = &DeleteUsagePlanOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteUsagePlan API operation for Amazon API Gateway. -// -// Deletes a usage plan of a given plan 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 API Gateway's -// API operation DeleteUsagePlan for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -func (c *APIGateway) DeleteUsagePlan(input *DeleteUsagePlanInput) (*DeleteUsagePlanOutput, error) { - req, out := c.DeleteUsagePlanRequest(input) - err := req.Send() - return out, err -} - -const opDeleteUsagePlanKey = "DeleteUsagePlanKey" - -// DeleteUsagePlanKeyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUsagePlanKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteUsagePlanKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteUsagePlanKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteUsagePlanKeyRequest method. -// req, resp := client.DeleteUsagePlanKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) DeleteUsagePlanKeyRequest(input *DeleteUsagePlanKeyInput) (req *request.Request, output *DeleteUsagePlanKeyOutput) { - op := &request.Operation{ - Name: opDeleteUsagePlanKey, - HTTPMethod: "DELETE", - HTTPPath: "/usageplans/{usageplanId}/keys/{keyId}", - } - - if input == nil { - input = &DeleteUsagePlanKeyInput{} - } - - output = &DeleteUsagePlanKeyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteUsagePlanKey API operation for Amazon API Gateway. -// -// Deletes a usage plan key and remove the underlying API key from the associated -// usage plan. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation DeleteUsagePlanKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) DeleteUsagePlanKey(input *DeleteUsagePlanKeyInput) (*DeleteUsagePlanKeyOutput, error) { - req, out := c.DeleteUsagePlanKeyRequest(input) - err := req.Send() - return out, err -} - -const opFlushStageAuthorizersCache = "FlushStageAuthorizersCache" - -// FlushStageAuthorizersCacheRequest generates a "aws/request.Request" representing the -// client's request for the FlushStageAuthorizersCache operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See FlushStageAuthorizersCache for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the FlushStageAuthorizersCache method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the FlushStageAuthorizersCacheRequest method. -// req, resp := client.FlushStageAuthorizersCacheRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) FlushStageAuthorizersCacheRequest(input *FlushStageAuthorizersCacheInput) (req *request.Request, output *FlushStageAuthorizersCacheOutput) { - op := &request.Operation{ - Name: opFlushStageAuthorizersCache, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/stages/{stage_name}/cache/authorizers", - } - - if input == nil { - input = &FlushStageAuthorizersCacheInput{} - } - - output = &FlushStageAuthorizersCacheOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// FlushStageAuthorizersCache API operation for Amazon API Gateway. -// -// Flushes all authorizer cache entries on a stage. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation FlushStageAuthorizersCache for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) FlushStageAuthorizersCache(input *FlushStageAuthorizersCacheInput) (*FlushStageAuthorizersCacheOutput, error) { - req, out := c.FlushStageAuthorizersCacheRequest(input) - err := req.Send() - return out, err -} - -const opFlushStageCache = "FlushStageCache" - -// FlushStageCacheRequest generates a "aws/request.Request" representing the -// client's request for the FlushStageCache operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See FlushStageCache for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the FlushStageCache method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the FlushStageCacheRequest method. -// req, resp := client.FlushStageCacheRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) FlushStageCacheRequest(input *FlushStageCacheInput) (req *request.Request, output *FlushStageCacheOutput) { - op := &request.Operation{ - Name: opFlushStageCache, - HTTPMethod: "DELETE", - HTTPPath: "/restapis/{restapi_id}/stages/{stage_name}/cache/data", - } - - if input == nil { - input = &FlushStageCacheInput{} - } - - output = &FlushStageCacheOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// FlushStageCache API operation for Amazon API Gateway. -// -// Flushes a stage's cache. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation FlushStageCache for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) FlushStageCache(input *FlushStageCacheInput) (*FlushStageCacheOutput, error) { - req, out := c.FlushStageCacheRequest(input) - err := req.Send() - return out, err -} - -const opGenerateClientCertificate = "GenerateClientCertificate" - -// GenerateClientCertificateRequest generates a "aws/request.Request" representing the -// client's request for the GenerateClientCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GenerateClientCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GenerateClientCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GenerateClientCertificateRequest method. -// req, resp := client.GenerateClientCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GenerateClientCertificateRequest(input *GenerateClientCertificateInput) (req *request.Request, output *ClientCertificate) { - op := &request.Operation{ - Name: opGenerateClientCertificate, - HTTPMethod: "POST", - HTTPPath: "/clientcertificates", - } - - if input == nil { - input = &GenerateClientCertificateInput{} - } - - output = &ClientCertificate{} - req = c.newRequest(op, input, output) - return -} - -// GenerateClientCertificate API operation for Amazon API Gateway. -// -// Generates a ClientCertificate 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 API Gateway's -// API operation GenerateClientCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -func (c *APIGateway) GenerateClientCertificate(input *GenerateClientCertificateInput) (*ClientCertificate, error) { - req, out := c.GenerateClientCertificateRequest(input) - err := req.Send() - return out, err -} - -const opGetAccount = "GetAccount" - -// GetAccountRequest generates a "aws/request.Request" representing the -// client's request for the GetAccount operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAccount for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAccount method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAccountRequest method. -// req, resp := client.GetAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetAccountRequest(input *GetAccountInput) (req *request.Request, output *Account) { - op := &request.Operation{ - Name: opGetAccount, - HTTPMethod: "GET", - HTTPPath: "/account", - } - - if input == nil { - input = &GetAccountInput{} - } - - output = &Account{} - req = c.newRequest(op, input, output) - return -} - -// GetAccount API operation for Amazon API Gateway. -// -// Gets information about the current Account 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 API Gateway's -// API operation GetAccount for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetAccount(input *GetAccountInput) (*Account, error) { - req, out := c.GetAccountRequest(input) - err := req.Send() - return out, err -} - -const opGetApiKey = "GetApiKey" - -// GetApiKeyRequest generates a "aws/request.Request" representing the -// client's request for the GetApiKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetApiKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetApiKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetApiKeyRequest method. -// req, resp := client.GetApiKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetApiKeyRequest(input *GetApiKeyInput) (req *request.Request, output *ApiKey) { - op := &request.Operation{ - Name: opGetApiKey, - HTTPMethod: "GET", - HTTPPath: "/apikeys/{api_Key}", - } - - if input == nil { - input = &GetApiKeyInput{} - } - - output = &ApiKey{} - req = c.newRequest(op, input, output) - return -} - -// GetApiKey API operation for Amazon API Gateway. -// -// Gets information about the current ApiKey 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 API Gateway's -// API operation GetApiKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetApiKey(input *GetApiKeyInput) (*ApiKey, error) { - req, out := c.GetApiKeyRequest(input) - err := req.Send() - return out, err -} - -const opGetApiKeys = "GetApiKeys" - -// GetApiKeysRequest generates a "aws/request.Request" representing the -// client's request for the GetApiKeys operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetApiKeys for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetApiKeys method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetApiKeysRequest method. -// req, resp := client.GetApiKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetApiKeysRequest(input *GetApiKeysInput) (req *request.Request, output *GetApiKeysOutput) { - op := &request.Operation{ - Name: opGetApiKeys, - HTTPMethod: "GET", - HTTPPath: "/apikeys", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetApiKeysInput{} - } - - output = &GetApiKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetApiKeys API operation for Amazon API Gateway. -// -// Gets information about the current ApiKeys 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 API Gateway's -// API operation GetApiKeys for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetApiKeys(input *GetApiKeysInput) (*GetApiKeysOutput, error) { - req, out := c.GetApiKeysRequest(input) - err := req.Send() - return out, err -} - -// GetApiKeysPages iterates over the pages of a GetApiKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetApiKeys 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 GetApiKeys operation. -// pageNum := 0 -// err := client.GetApiKeysPages(params, -// func(page *GetApiKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetApiKeysPages(input *GetApiKeysInput, fn func(p *GetApiKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetApiKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetApiKeysOutput), lastPage) - }) -} - -const opGetAuthorizer = "GetAuthorizer" - -// GetAuthorizerRequest generates a "aws/request.Request" representing the -// client's request for the GetAuthorizer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAuthorizer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAuthorizer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAuthorizerRequest method. -// req, resp := client.GetAuthorizerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetAuthorizerRequest(input *GetAuthorizerInput) (req *request.Request, output *Authorizer) { - op := &request.Operation{ - Name: opGetAuthorizer, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/authorizers/{authorizer_id}", - } - - if input == nil { - input = &GetAuthorizerInput{} - } - - output = &Authorizer{} - req = c.newRequest(op, input, output) - return -} - -// GetAuthorizer API operation for Amazon API Gateway. -// -// Describe an existing Authorizer resource. -// -// AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/get-authorizer.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 API Gateway's -// API operation GetAuthorizer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetAuthorizer(input *GetAuthorizerInput) (*Authorizer, error) { - req, out := c.GetAuthorizerRequest(input) - err := req.Send() - return out, err -} - -const opGetAuthorizers = "GetAuthorizers" - -// GetAuthorizersRequest generates a "aws/request.Request" representing the -// client's request for the GetAuthorizers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAuthorizers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAuthorizers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAuthorizersRequest method. -// req, resp := client.GetAuthorizersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetAuthorizersRequest(input *GetAuthorizersInput) (req *request.Request, output *GetAuthorizersOutput) { - op := &request.Operation{ - Name: opGetAuthorizers, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/authorizers", - } - - if input == nil { - input = &GetAuthorizersInput{} - } - - output = &GetAuthorizersOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAuthorizers API operation for Amazon API Gateway. -// -// Describe an existing Authorizers resource. -// -// AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/get-authorizers.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 API Gateway's -// API operation GetAuthorizers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetAuthorizers(input *GetAuthorizersInput) (*GetAuthorizersOutput, error) { - req, out := c.GetAuthorizersRequest(input) - err := req.Send() - return out, err -} - -const opGetBasePathMapping = "GetBasePathMapping" - -// GetBasePathMappingRequest generates a "aws/request.Request" representing the -// client's request for the GetBasePathMapping operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBasePathMapping for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBasePathMapping method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBasePathMappingRequest method. -// req, resp := client.GetBasePathMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetBasePathMappingRequest(input *GetBasePathMappingInput) (req *request.Request, output *BasePathMapping) { - op := &request.Operation{ - Name: opGetBasePathMapping, - HTTPMethod: "GET", - HTTPPath: "/domainnames/{domain_name}/basepathmappings/{base_path}", - } - - if input == nil { - input = &GetBasePathMappingInput{} - } - - output = &BasePathMapping{} - req = c.newRequest(op, input, output) - return -} - -// GetBasePathMapping API operation for Amazon API Gateway. -// -// Describe a BasePathMapping 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 API Gateway's -// API operation GetBasePathMapping for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetBasePathMapping(input *GetBasePathMappingInput) (*BasePathMapping, error) { - req, out := c.GetBasePathMappingRequest(input) - err := req.Send() - return out, err -} - -const opGetBasePathMappings = "GetBasePathMappings" - -// GetBasePathMappingsRequest generates a "aws/request.Request" representing the -// client's request for the GetBasePathMappings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBasePathMappings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBasePathMappings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBasePathMappingsRequest method. -// req, resp := client.GetBasePathMappingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetBasePathMappingsRequest(input *GetBasePathMappingsInput) (req *request.Request, output *GetBasePathMappingsOutput) { - op := &request.Operation{ - Name: opGetBasePathMappings, - HTTPMethod: "GET", - HTTPPath: "/domainnames/{domain_name}/basepathmappings", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetBasePathMappingsInput{} - } - - output = &GetBasePathMappingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBasePathMappings API operation for Amazon API Gateway. -// -// Represents a collection of BasePathMapping 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 API Gateway's -// API operation GetBasePathMappings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetBasePathMappings(input *GetBasePathMappingsInput) (*GetBasePathMappingsOutput, error) { - req, out := c.GetBasePathMappingsRequest(input) - err := req.Send() - return out, err -} - -// GetBasePathMappingsPages iterates over the pages of a GetBasePathMappings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetBasePathMappings 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 GetBasePathMappings operation. -// pageNum := 0 -// err := client.GetBasePathMappingsPages(params, -// func(page *GetBasePathMappingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetBasePathMappingsPages(input *GetBasePathMappingsInput, fn func(p *GetBasePathMappingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetBasePathMappingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetBasePathMappingsOutput), lastPage) - }) -} - -const opGetClientCertificate = "GetClientCertificate" - -// GetClientCertificateRequest generates a "aws/request.Request" representing the -// client's request for the GetClientCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetClientCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetClientCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetClientCertificateRequest method. -// req, resp := client.GetClientCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetClientCertificateRequest(input *GetClientCertificateInput) (req *request.Request, output *ClientCertificate) { - op := &request.Operation{ - Name: opGetClientCertificate, - HTTPMethod: "GET", - HTTPPath: "/clientcertificates/{clientcertificate_id}", - } - - if input == nil { - input = &GetClientCertificateInput{} - } - - output = &ClientCertificate{} - req = c.newRequest(op, input, output) - return -} - -// GetClientCertificate API operation for Amazon API Gateway. -// -// Gets information about the current ClientCertificate 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 API Gateway's -// API operation GetClientCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetClientCertificate(input *GetClientCertificateInput) (*ClientCertificate, error) { - req, out := c.GetClientCertificateRequest(input) - err := req.Send() - return out, err -} - -const opGetClientCertificates = "GetClientCertificates" - -// GetClientCertificatesRequest generates a "aws/request.Request" representing the -// client's request for the GetClientCertificates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetClientCertificates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetClientCertificates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetClientCertificatesRequest method. -// req, resp := client.GetClientCertificatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetClientCertificatesRequest(input *GetClientCertificatesInput) (req *request.Request, output *GetClientCertificatesOutput) { - op := &request.Operation{ - Name: opGetClientCertificates, - HTTPMethod: "GET", - HTTPPath: "/clientcertificates", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetClientCertificatesInput{} - } - - output = &GetClientCertificatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetClientCertificates API operation for Amazon API Gateway. -// -// Gets a collection of ClientCertificate 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 API Gateway's -// API operation GetClientCertificates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetClientCertificates(input *GetClientCertificatesInput) (*GetClientCertificatesOutput, error) { - req, out := c.GetClientCertificatesRequest(input) - err := req.Send() - return out, err -} - -// GetClientCertificatesPages iterates over the pages of a GetClientCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetClientCertificates 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 GetClientCertificates operation. -// pageNum := 0 -// err := client.GetClientCertificatesPages(params, -// func(page *GetClientCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetClientCertificatesPages(input *GetClientCertificatesInput, fn func(p *GetClientCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetClientCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetClientCertificatesOutput), lastPage) - }) -} - -const opGetDeployment = "GetDeployment" - -// GetDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the GetDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDeploymentRequest method. -// req, resp := client.GetDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetDeploymentRequest(input *GetDeploymentInput) (req *request.Request, output *Deployment) { - op := &request.Operation{ - Name: opGetDeployment, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/deployments/{deployment_id}", - } - - if input == nil { - input = &GetDeploymentInput{} - } - - output = &Deployment{} - req = c.newRequest(op, input, output) - return -} - -// GetDeployment API operation for Amazon API Gateway. -// -// Gets information about a Deployment 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 API Gateway's -// API operation GetDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// -func (c *APIGateway) GetDeployment(input *GetDeploymentInput) (*Deployment, error) { - req, out := c.GetDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opGetDeployments = "GetDeployments" - -// GetDeploymentsRequest generates a "aws/request.Request" representing the -// client's request for the GetDeployments operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDeployments for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDeployments method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDeploymentsRequest method. -// req, resp := client.GetDeploymentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetDeploymentsRequest(input *GetDeploymentsInput) (req *request.Request, output *GetDeploymentsOutput) { - op := &request.Operation{ - Name: opGetDeployments, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/deployments", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetDeploymentsInput{} - } - - output = &GetDeploymentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeployments API operation for Amazon API Gateway. -// -// Gets information about a Deployments collection. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetDeployments for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// -func (c *APIGateway) GetDeployments(input *GetDeploymentsInput) (*GetDeploymentsOutput, error) { - req, out := c.GetDeploymentsRequest(input) - err := req.Send() - return out, err -} - -// GetDeploymentsPages iterates over the pages of a GetDeployments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDeployments 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 GetDeployments operation. -// pageNum := 0 -// err := client.GetDeploymentsPages(params, -// func(page *GetDeploymentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetDeploymentsPages(input *GetDeploymentsInput, fn func(p *GetDeploymentsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetDeploymentsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetDeploymentsOutput), lastPage) - }) -} - -const opGetDocumentationPart = "GetDocumentationPart" - -// GetDocumentationPartRequest generates a "aws/request.Request" representing the -// client's request for the GetDocumentationPart operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDocumentationPart for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDocumentationPart method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDocumentationPartRequest method. -// req, resp := client.GetDocumentationPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetDocumentationPartRequest(input *GetDocumentationPartInput) (req *request.Request, output *DocumentationPart) { - op := &request.Operation{ - Name: opGetDocumentationPart, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/documentation/parts/{part_id}", - } - - if input == nil { - input = &GetDocumentationPartInput{} - } - - output = &DocumentationPart{} - req = c.newRequest(op, input, output) - return -} - -// GetDocumentationPart API operation for Amazon API 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 API Gateway's -// API operation GetDocumentationPart for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetDocumentationPart(input *GetDocumentationPartInput) (*DocumentationPart, error) { - req, out := c.GetDocumentationPartRequest(input) - err := req.Send() - return out, err -} - -const opGetDocumentationParts = "GetDocumentationParts" - -// GetDocumentationPartsRequest generates a "aws/request.Request" representing the -// client's request for the GetDocumentationParts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDocumentationParts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDocumentationParts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDocumentationPartsRequest method. -// req, resp := client.GetDocumentationPartsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetDocumentationPartsRequest(input *GetDocumentationPartsInput) (req *request.Request, output *GetDocumentationPartsOutput) { - op := &request.Operation{ - Name: opGetDocumentationParts, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/documentation/parts", - } - - if input == nil { - input = &GetDocumentationPartsInput{} - } - - output = &GetDocumentationPartsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDocumentationParts API operation for Amazon API 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 API Gateway's -// API operation GetDocumentationParts for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetDocumentationParts(input *GetDocumentationPartsInput) (*GetDocumentationPartsOutput, error) { - req, out := c.GetDocumentationPartsRequest(input) - err := req.Send() - return out, err -} - -const opGetDocumentationVersion = "GetDocumentationVersion" - -// GetDocumentationVersionRequest generates a "aws/request.Request" representing the -// client's request for the GetDocumentationVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDocumentationVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDocumentationVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDocumentationVersionRequest method. -// req, resp := client.GetDocumentationVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetDocumentationVersionRequest(input *GetDocumentationVersionInput) (req *request.Request, output *DocumentationVersion) { - op := &request.Operation{ - Name: opGetDocumentationVersion, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/documentation/versions/{doc_version}", - } - - if input == nil { - input = &GetDocumentationVersionInput{} - } - - output = &DocumentationVersion{} - req = c.newRequest(op, input, output) - return -} - -// GetDocumentationVersion API operation for Amazon API 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 API Gateway's -// API operation GetDocumentationVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetDocumentationVersion(input *GetDocumentationVersionInput) (*DocumentationVersion, error) { - req, out := c.GetDocumentationVersionRequest(input) - err := req.Send() - return out, err -} - -const opGetDocumentationVersions = "GetDocumentationVersions" - -// GetDocumentationVersionsRequest generates a "aws/request.Request" representing the -// client's request for the GetDocumentationVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDocumentationVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDocumentationVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDocumentationVersionsRequest method. -// req, resp := client.GetDocumentationVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetDocumentationVersionsRequest(input *GetDocumentationVersionsInput) (req *request.Request, output *GetDocumentationVersionsOutput) { - op := &request.Operation{ - Name: opGetDocumentationVersions, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/documentation/versions", - } - - if input == nil { - input = &GetDocumentationVersionsInput{} - } - - output = &GetDocumentationVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDocumentationVersions API operation for Amazon API 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 API Gateway's -// API operation GetDocumentationVersions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetDocumentationVersions(input *GetDocumentationVersionsInput) (*GetDocumentationVersionsOutput, error) { - req, out := c.GetDocumentationVersionsRequest(input) - err := req.Send() - return out, err -} - -const opGetDomainName = "GetDomainName" - -// GetDomainNameRequest generates a "aws/request.Request" representing the -// client's request for the GetDomainName operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDomainName for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDomainName method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDomainNameRequest method. -// req, resp := client.GetDomainNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetDomainNameRequest(input *GetDomainNameInput) (req *request.Request, output *DomainName) { - op := &request.Operation{ - Name: opGetDomainName, - HTTPMethod: "GET", - HTTPPath: "/domainnames/{domain_name}", - } - - if input == nil { - input = &GetDomainNameInput{} - } - - output = &DomainName{} - req = c.newRequest(op, input, output) - return -} - -// GetDomainName API operation for Amazon API Gateway. -// -// Represents a domain name that is contained in a simpler, more intuitive URL -// that can be called. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetDomainName for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetDomainName(input *GetDomainNameInput) (*DomainName, error) { - req, out := c.GetDomainNameRequest(input) - err := req.Send() - return out, err -} - -const opGetDomainNames = "GetDomainNames" - -// GetDomainNamesRequest generates a "aws/request.Request" representing the -// client's request for the GetDomainNames operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDomainNames for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDomainNames method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDomainNamesRequest method. -// req, resp := client.GetDomainNamesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetDomainNamesRequest(input *GetDomainNamesInput) (req *request.Request, output *GetDomainNamesOutput) { - op := &request.Operation{ - Name: opGetDomainNames, - HTTPMethod: "GET", - HTTPPath: "/domainnames", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetDomainNamesInput{} - } - - output = &GetDomainNamesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDomainNames API operation for Amazon API Gateway. -// -// Represents a collection of DomainName 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 API Gateway's -// API operation GetDomainNames for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetDomainNames(input *GetDomainNamesInput) (*GetDomainNamesOutput, error) { - req, out := c.GetDomainNamesRequest(input) - err := req.Send() - return out, err -} - -// GetDomainNamesPages iterates over the pages of a GetDomainNames operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDomainNames 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 GetDomainNames operation. -// pageNum := 0 -// err := client.GetDomainNamesPages(params, -// func(page *GetDomainNamesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetDomainNamesPages(input *GetDomainNamesInput, fn func(p *GetDomainNamesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetDomainNamesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetDomainNamesOutput), lastPage) - }) -} - -const opGetExport = "GetExport" - -// GetExportRequest generates a "aws/request.Request" representing the -// client's request for the GetExport operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetExport for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetExport method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetExportRequest method. -// req, resp := client.GetExportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetExportRequest(input *GetExportInput) (req *request.Request, output *GetExportOutput) { - op := &request.Operation{ - Name: opGetExport, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/stages/{stage_name}/exports/{export_type}", - } - - if input == nil { - input = &GetExportInput{} - } - - output = &GetExportOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetExport API operation for Amazon API Gateway. -// -// Exports a deployed version of a RestApi in a specified format. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetExport for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetExport(input *GetExportInput) (*GetExportOutput, error) { - req, out := c.GetExportRequest(input) - err := req.Send() - return out, err -} - -const opGetIntegration = "GetIntegration" - -// GetIntegrationRequest generates a "aws/request.Request" representing the -// client's request for the GetIntegration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetIntegration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetIntegration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetIntegrationRequest method. -// req, resp := client.GetIntegrationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetIntegrationRequest(input *GetIntegrationInput) (req *request.Request, output *Integration) { - op := &request.Operation{ - Name: opGetIntegration, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration", - } - - if input == nil { - input = &GetIntegrationInput{} - } - - output = &Integration{} - req = c.newRequest(op, input, output) - return -} - -// GetIntegration API operation for Amazon API Gateway. -// -// Represents a get integration. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetIntegration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetIntegration(input *GetIntegrationInput) (*Integration, error) { - req, out := c.GetIntegrationRequest(input) - err := req.Send() - return out, err -} - -const opGetIntegrationResponse = "GetIntegrationResponse" - -// GetIntegrationResponseRequest generates a "aws/request.Request" representing the -// client's request for the GetIntegrationResponse operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetIntegrationResponse for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetIntegrationResponse method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetIntegrationResponseRequest method. -// req, resp := client.GetIntegrationResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetIntegrationResponseRequest(input *GetIntegrationResponseInput) (req *request.Request, output *IntegrationResponse) { - op := &request.Operation{ - Name: opGetIntegrationResponse, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration/responses/{status_code}", - } - - if input == nil { - input = &GetIntegrationResponseInput{} - } - - output = &IntegrationResponse{} - req = c.newRequest(op, input, output) - return -} - -// GetIntegrationResponse API operation for Amazon API Gateway. -// -// Represents a get integration 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 API Gateway's -// API operation GetIntegrationResponse for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetIntegrationResponse(input *GetIntegrationResponseInput) (*IntegrationResponse, error) { - req, out := c.GetIntegrationResponseRequest(input) - err := req.Send() - return out, err -} - -const opGetMethod = "GetMethod" - -// GetMethodRequest generates a "aws/request.Request" representing the -// client's request for the GetMethod operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetMethod for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetMethod method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetMethodRequest method. -// req, resp := client.GetMethodRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetMethodRequest(input *GetMethodInput) (req *request.Request, output *Method) { - op := &request.Operation{ - Name: opGetMethod, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}", - } - - if input == nil { - input = &GetMethodInput{} - } - - output = &Method{} - req = c.newRequest(op, input, output) - return -} - -// GetMethod API operation for Amazon API Gateway. -// -// Describe an existing Method 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 API Gateway's -// API operation GetMethod for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetMethod(input *GetMethodInput) (*Method, error) { - req, out := c.GetMethodRequest(input) - err := req.Send() - return out, err -} - -const opGetMethodResponse = "GetMethodResponse" - -// GetMethodResponseRequest generates a "aws/request.Request" representing the -// client's request for the GetMethodResponse operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetMethodResponse for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetMethodResponse method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetMethodResponseRequest method. -// req, resp := client.GetMethodResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetMethodResponseRequest(input *GetMethodResponseInput) (req *request.Request, output *MethodResponse) { - op := &request.Operation{ - Name: opGetMethodResponse, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/responses/{status_code}", - } - - if input == nil { - input = &GetMethodResponseInput{} - } - - output = &MethodResponse{} - req = c.newRequest(op, input, output) - return -} - -// GetMethodResponse API operation for Amazon API Gateway. -// -// Describes a MethodResponse 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 API Gateway's -// API operation GetMethodResponse for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetMethodResponse(input *GetMethodResponseInput) (*MethodResponse, error) { - req, out := c.GetMethodResponseRequest(input) - err := req.Send() - return out, err -} - -const opGetModel = "GetModel" - -// GetModelRequest generates a "aws/request.Request" representing the -// client's request for the GetModel operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetModel for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetModel method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetModelRequest method. -// req, resp := client.GetModelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetModelRequest(input *GetModelInput) (req *request.Request, output *Model) { - op := &request.Operation{ - Name: opGetModel, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/models/{model_name}", - } - - if input == nil { - input = &GetModelInput{} - } - - output = &Model{} - req = c.newRequest(op, input, output) - return -} - -// GetModel API operation for Amazon API Gateway. -// -// Describes an existing model defined for a RestApi 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 API Gateway's -// API operation GetModel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetModel(input *GetModelInput) (*Model, error) { - req, out := c.GetModelRequest(input) - err := req.Send() - return out, err -} - -const opGetModelTemplate = "GetModelTemplate" - -// GetModelTemplateRequest generates a "aws/request.Request" representing the -// client's request for the GetModelTemplate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetModelTemplate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetModelTemplate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetModelTemplateRequest method. -// req, resp := client.GetModelTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetModelTemplateRequest(input *GetModelTemplateInput) (req *request.Request, output *GetModelTemplateOutput) { - op := &request.Operation{ - Name: opGetModelTemplate, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/models/{model_name}/default_template", - } - - if input == nil { - input = &GetModelTemplateInput{} - } - - output = &GetModelTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetModelTemplate API operation for Amazon API Gateway. -// -// Generates a sample mapping template that can be used to transform a payload -// into the structure of a model. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetModelTemplate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetModelTemplate(input *GetModelTemplateInput) (*GetModelTemplateOutput, error) { - req, out := c.GetModelTemplateRequest(input) - err := req.Send() - return out, err -} - -const opGetModels = "GetModels" - -// GetModelsRequest generates a "aws/request.Request" representing the -// client's request for the GetModels operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetModels for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetModels method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetModelsRequest method. -// req, resp := client.GetModelsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetModelsRequest(input *GetModelsInput) (req *request.Request, output *GetModelsOutput) { - op := &request.Operation{ - Name: opGetModels, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/models", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetModelsInput{} - } - - output = &GetModelsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetModels API operation for Amazon API Gateway. -// -// Describes existing Models defined for a RestApi 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 API Gateway's -// API operation GetModels for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetModels(input *GetModelsInput) (*GetModelsOutput, error) { - req, out := c.GetModelsRequest(input) - err := req.Send() - return out, err -} - -// GetModelsPages iterates over the pages of a GetModels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetModels 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 GetModels operation. -// pageNum := 0 -// err := client.GetModelsPages(params, -// func(page *GetModelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetModelsPages(input *GetModelsInput, fn func(p *GetModelsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetModelsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetModelsOutput), lastPage) - }) -} - -const opGetResource = "GetResource" - -// GetResourceRequest generates a "aws/request.Request" representing the -// client's request for the GetResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetResourceRequest method. -// req, resp := client.GetResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetResourceRequest(input *GetResourceInput) (req *request.Request, output *Resource) { - op := &request.Operation{ - Name: opGetResource, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}", - } - - if input == nil { - input = &GetResourceInput{} - } - - output = &Resource{} - req = c.newRequest(op, input, output) - return -} - -// GetResource API operation for Amazon API Gateway. -// -// Lists information about a 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 API Gateway's -// API operation GetResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetResource(input *GetResourceInput) (*Resource, error) { - req, out := c.GetResourceRequest(input) - err := req.Send() - return out, err -} - -const opGetResources = "GetResources" - -// GetResourcesRequest generates a "aws/request.Request" representing the -// client's request for the GetResources operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetResources for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetResources method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetResourcesRequest method. -// req, resp := client.GetResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetResourcesRequest(input *GetResourcesInput) (req *request.Request, output *GetResourcesOutput) { - op := &request.Operation{ - Name: opGetResources, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/resources", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetResourcesInput{} - } - - output = &GetResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetResources API operation for Amazon API Gateway. -// -// Lists information about a collection of Resource 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 API Gateway's -// API operation GetResources for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetResources(input *GetResourcesInput) (*GetResourcesOutput, error) { - req, out := c.GetResourcesRequest(input) - err := req.Send() - return out, err -} - -// GetResourcesPages iterates over the pages of a GetResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetResources 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 GetResources operation. -// pageNum := 0 -// err := client.GetResourcesPages(params, -// func(page *GetResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetResourcesPages(input *GetResourcesInput, fn func(p *GetResourcesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetResourcesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetResourcesOutput), lastPage) - }) -} - -const opGetRestApi = "GetRestApi" - -// GetRestApiRequest generates a "aws/request.Request" representing the -// client's request for the GetRestApi operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRestApi for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRestApi method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRestApiRequest method. -// req, resp := client.GetRestApiRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetRestApiRequest(input *GetRestApiInput) (req *request.Request, output *RestApi) { - op := &request.Operation{ - Name: opGetRestApi, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}", - } - - if input == nil { - input = &GetRestApiInput{} - } - - output = &RestApi{} - req = c.newRequest(op, input, output) - return -} - -// GetRestApi API operation for Amazon API Gateway. -// -// Lists the RestApi resource in the collection. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetRestApi for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetRestApi(input *GetRestApiInput) (*RestApi, error) { - req, out := c.GetRestApiRequest(input) - err := req.Send() - return out, err -} - -const opGetRestApis = "GetRestApis" - -// GetRestApisRequest generates a "aws/request.Request" representing the -// client's request for the GetRestApis operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRestApis for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRestApis method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRestApisRequest method. -// req, resp := client.GetRestApisRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetRestApisRequest(input *GetRestApisInput) (req *request.Request, output *GetRestApisOutput) { - op := &request.Operation{ - Name: opGetRestApis, - HTTPMethod: "GET", - HTTPPath: "/restapis", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetRestApisInput{} - } - - output = &GetRestApisOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRestApis API operation for Amazon API Gateway. -// -// Lists the RestApis resources for your collection. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetRestApis for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetRestApis(input *GetRestApisInput) (*GetRestApisOutput, error) { - req, out := c.GetRestApisRequest(input) - err := req.Send() - return out, err -} - -// GetRestApisPages iterates over the pages of a GetRestApis operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetRestApis 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 GetRestApis operation. -// pageNum := 0 -// err := client.GetRestApisPages(params, -// func(page *GetRestApisOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetRestApisPages(input *GetRestApisInput, fn func(p *GetRestApisOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetRestApisRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetRestApisOutput), lastPage) - }) -} - -const opGetSdk = "GetSdk" - -// GetSdkRequest generates a "aws/request.Request" representing the -// client's request for the GetSdk operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSdk for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSdk method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSdkRequest method. -// req, resp := client.GetSdkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetSdkRequest(input *GetSdkInput) (req *request.Request, output *GetSdkOutput) { - op := &request.Operation{ - Name: opGetSdk, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/stages/{stage_name}/sdks/{sdk_type}", - } - - if input == nil { - input = &GetSdkInput{} - } - - output = &GetSdkOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSdk API operation for Amazon API Gateway. -// -// Generates a client SDK for a RestApi and Stage. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetSdk for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetSdk(input *GetSdkInput) (*GetSdkOutput, error) { - req, out := c.GetSdkRequest(input) - err := req.Send() - return out, err -} - -const opGetSdkType = "GetSdkType" - -// GetSdkTypeRequest generates a "aws/request.Request" representing the -// client's request for the GetSdkType operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSdkType for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSdkType method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSdkTypeRequest method. -// req, resp := client.GetSdkTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetSdkTypeRequest(input *GetSdkTypeInput) (req *request.Request, output *SdkType) { - op := &request.Operation{ - Name: opGetSdkType, - HTTPMethod: "GET", - HTTPPath: "/sdktypes/{sdktype_id}", - } - - if input == nil { - input = &GetSdkTypeInput{} - } - - output = &SdkType{} - req = c.newRequest(op, input, output) - return -} - -// GetSdkType API operation for Amazon API 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 API Gateway's -// API operation GetSdkType for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetSdkType(input *GetSdkTypeInput) (*SdkType, error) { - req, out := c.GetSdkTypeRequest(input) - err := req.Send() - return out, err -} - -const opGetSdkTypes = "GetSdkTypes" - -// GetSdkTypesRequest generates a "aws/request.Request" representing the -// client's request for the GetSdkTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSdkTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSdkTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSdkTypesRequest method. -// req, resp := client.GetSdkTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetSdkTypesRequest(input *GetSdkTypesInput) (req *request.Request, output *GetSdkTypesOutput) { - op := &request.Operation{ - Name: opGetSdkTypes, - HTTPMethod: "GET", - HTTPPath: "/sdktypes", - } - - if input == nil { - input = &GetSdkTypesInput{} - } - - output = &GetSdkTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSdkTypes API operation for Amazon API 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 API Gateway's -// API operation GetSdkTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetSdkTypes(input *GetSdkTypesInput) (*GetSdkTypesOutput, error) { - req, out := c.GetSdkTypesRequest(input) - err := req.Send() - return out, err -} - -const opGetStage = "GetStage" - -// GetStageRequest generates a "aws/request.Request" representing the -// client's request for the GetStage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetStage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetStage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetStageRequest method. -// req, resp := client.GetStageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetStageRequest(input *GetStageInput) (req *request.Request, output *Stage) { - op := &request.Operation{ - Name: opGetStage, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/stages/{stage_name}", - } - - if input == nil { - input = &GetStageInput{} - } - - output = &Stage{} - req = c.newRequest(op, input, output) - return -} - -// GetStage API operation for Amazon API Gateway. -// -// Gets information about a Stage 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 API Gateway's -// API operation GetStage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetStage(input *GetStageInput) (*Stage, error) { - req, out := c.GetStageRequest(input) - err := req.Send() - return out, err -} - -const opGetStages = "GetStages" - -// GetStagesRequest generates a "aws/request.Request" representing the -// client's request for the GetStages operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetStages for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetStages method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetStagesRequest method. -// req, resp := client.GetStagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetStagesRequest(input *GetStagesInput) (req *request.Request, output *GetStagesOutput) { - op := &request.Operation{ - Name: opGetStages, - HTTPMethod: "GET", - HTTPPath: "/restapis/{restapi_id}/stages", - } - - if input == nil { - input = &GetStagesInput{} - } - - output = &GetStagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStages API operation for Amazon API Gateway. -// -// Gets information about one or more Stage 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 API Gateway's -// API operation GetStages for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetStages(input *GetStagesInput) (*GetStagesOutput, error) { - req, out := c.GetStagesRequest(input) - err := req.Send() - return out, err -} - -const opGetUsage = "GetUsage" - -// GetUsageRequest generates a "aws/request.Request" representing the -// client's request for the GetUsage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetUsage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetUsage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetUsageRequest method. -// req, resp := client.GetUsageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetUsageRequest(input *GetUsageInput) (req *request.Request, output *Usage) { - op := &request.Operation{ - Name: opGetUsage, - HTTPMethod: "GET", - HTTPPath: "/usageplans/{usageplanId}/usage", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetUsageInput{} - } - - output = &Usage{} - req = c.newRequest(op, input, output) - return -} - -// GetUsage API operation for Amazon API Gateway. -// -// Gets the usage data of a usage plan in a specified time interval. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetUsage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetUsage(input *GetUsageInput) (*Usage, error) { - req, out := c.GetUsageRequest(input) - err := req.Send() - return out, err -} - -// GetUsagePages iterates over the pages of a GetUsage operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetUsage 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 GetUsage operation. -// pageNum := 0 -// err := client.GetUsagePages(params, -// func(page *Usage, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetUsagePages(input *GetUsageInput, fn func(p *Usage, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetUsageRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*Usage), lastPage) - }) -} - -const opGetUsagePlan = "GetUsagePlan" - -// GetUsagePlanRequest generates a "aws/request.Request" representing the -// client's request for the GetUsagePlan operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetUsagePlan for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetUsagePlan method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetUsagePlanRequest method. -// req, resp := client.GetUsagePlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetUsagePlanRequest(input *GetUsagePlanInput) (req *request.Request, output *UsagePlan) { - op := &request.Operation{ - Name: opGetUsagePlan, - HTTPMethod: "GET", - HTTPPath: "/usageplans/{usageplanId}", - } - - if input == nil { - input = &GetUsagePlanInput{} - } - - output = &UsagePlan{} - req = c.newRequest(op, input, output) - return -} - -// GetUsagePlan API operation for Amazon API Gateway. -// -// Gets a usage plan of a given plan identifier. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetUsagePlan for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetUsagePlan(input *GetUsagePlanInput) (*UsagePlan, error) { - req, out := c.GetUsagePlanRequest(input) - err := req.Send() - return out, err -} - -const opGetUsagePlanKey = "GetUsagePlanKey" - -// GetUsagePlanKeyRequest generates a "aws/request.Request" representing the -// client's request for the GetUsagePlanKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetUsagePlanKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetUsagePlanKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetUsagePlanKeyRequest method. -// req, resp := client.GetUsagePlanKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetUsagePlanKeyRequest(input *GetUsagePlanKeyInput) (req *request.Request, output *UsagePlanKey) { - op := &request.Operation{ - Name: opGetUsagePlanKey, - HTTPMethod: "GET", - HTTPPath: "/usageplans/{usageplanId}/keys/{keyId}", - } - - if input == nil { - input = &GetUsagePlanKeyInput{} - } - - output = &UsagePlanKey{} - req = c.newRequest(op, input, output) - return -} - -// GetUsagePlanKey API operation for Amazon API Gateway. -// -// Gets a usage plan key of a given key identifier. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetUsagePlanKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetUsagePlanKey(input *GetUsagePlanKeyInput) (*UsagePlanKey, error) { - req, out := c.GetUsagePlanKeyRequest(input) - err := req.Send() - return out, err -} - -const opGetUsagePlanKeys = "GetUsagePlanKeys" - -// GetUsagePlanKeysRequest generates a "aws/request.Request" representing the -// client's request for the GetUsagePlanKeys operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetUsagePlanKeys for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetUsagePlanKeys method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetUsagePlanKeysRequest method. -// req, resp := client.GetUsagePlanKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetUsagePlanKeysRequest(input *GetUsagePlanKeysInput) (req *request.Request, output *GetUsagePlanKeysOutput) { - op := &request.Operation{ - Name: opGetUsagePlanKeys, - HTTPMethod: "GET", - HTTPPath: "/usageplans/{usageplanId}/keys", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetUsagePlanKeysInput{} - } - - output = &GetUsagePlanKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetUsagePlanKeys API operation for Amazon API Gateway. -// -// Gets all the usage plan keys representing the API keys added to a specified -// usage plan. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation GetUsagePlanKeys for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) GetUsagePlanKeys(input *GetUsagePlanKeysInput) (*GetUsagePlanKeysOutput, error) { - req, out := c.GetUsagePlanKeysRequest(input) - err := req.Send() - return out, err -} - -// GetUsagePlanKeysPages iterates over the pages of a GetUsagePlanKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetUsagePlanKeys 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 GetUsagePlanKeys operation. -// pageNum := 0 -// err := client.GetUsagePlanKeysPages(params, -// func(page *GetUsagePlanKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetUsagePlanKeysPages(input *GetUsagePlanKeysInput, fn func(p *GetUsagePlanKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetUsagePlanKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetUsagePlanKeysOutput), lastPage) - }) -} - -const opGetUsagePlans = "GetUsagePlans" - -// GetUsagePlansRequest generates a "aws/request.Request" representing the -// client's request for the GetUsagePlans operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetUsagePlans for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetUsagePlans method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetUsagePlansRequest method. -// req, resp := client.GetUsagePlansRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) GetUsagePlansRequest(input *GetUsagePlansInput) (req *request.Request, output *GetUsagePlansOutput) { - op := &request.Operation{ - Name: opGetUsagePlans, - HTTPMethod: "GET", - HTTPPath: "/usageplans", - Paginator: &request.Paginator{ - InputTokens: []string{"position"}, - OutputTokens: []string{"position"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetUsagePlansInput{} - } - - output = &GetUsagePlansOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetUsagePlans API operation for Amazon API Gateway. -// -// Gets all the usage plans of the caller's 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 API Gateway's -// API operation GetUsagePlans for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -func (c *APIGateway) GetUsagePlans(input *GetUsagePlansInput) (*GetUsagePlansOutput, error) { - req, out := c.GetUsagePlansRequest(input) - err := req.Send() - return out, err -} - -// GetUsagePlansPages iterates over the pages of a GetUsagePlans operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetUsagePlans 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 GetUsagePlans operation. -// pageNum := 0 -// err := client.GetUsagePlansPages(params, -// func(page *GetUsagePlansOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *APIGateway) GetUsagePlansPages(input *GetUsagePlansInput, fn func(p *GetUsagePlansOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetUsagePlansRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetUsagePlansOutput), lastPage) - }) -} - -const opImportApiKeys = "ImportApiKeys" - -// ImportApiKeysRequest generates a "aws/request.Request" representing the -// client's request for the ImportApiKeys operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportApiKeys for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportApiKeys method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportApiKeysRequest method. -// req, resp := client.ImportApiKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) ImportApiKeysRequest(input *ImportApiKeysInput) (req *request.Request, output *ImportApiKeysOutput) { - op := &request.Operation{ - Name: opImportApiKeys, - HTTPMethod: "POST", - HTTPPath: "/apikeys?mode=import", - } - - if input == nil { - input = &ImportApiKeysInput{} - } - - output = &ImportApiKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportApiKeys API operation for Amazon API Gateway. -// -// Import API keys from an external source, such as a CSV-formatted file. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation ImportApiKeys for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) ImportApiKeys(input *ImportApiKeysInput) (*ImportApiKeysOutput, error) { - req, out := c.ImportApiKeysRequest(input) - err := req.Send() - return out, err -} - -const opImportDocumentationParts = "ImportDocumentationParts" - -// ImportDocumentationPartsRequest generates a "aws/request.Request" representing the -// client's request for the ImportDocumentationParts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportDocumentationParts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportDocumentationParts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportDocumentationPartsRequest method. -// req, resp := client.ImportDocumentationPartsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) ImportDocumentationPartsRequest(input *ImportDocumentationPartsInput) (req *request.Request, output *ImportDocumentationPartsOutput) { - op := &request.Operation{ - Name: opImportDocumentationParts, - HTTPMethod: "PUT", - HTTPPath: "/restapis/{restapi_id}/documentation/parts", - } - - if input == nil { - input = &ImportDocumentationPartsInput{} - } - - output = &ImportDocumentationPartsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportDocumentationParts API operation for Amazon API 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 API Gateway's -// API operation ImportDocumentationParts for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) ImportDocumentationParts(input *ImportDocumentationPartsInput) (*ImportDocumentationPartsOutput, error) { - req, out := c.ImportDocumentationPartsRequest(input) - err := req.Send() - return out, err -} - -const opImportRestApi = "ImportRestApi" - -// ImportRestApiRequest generates a "aws/request.Request" representing the -// client's request for the ImportRestApi operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportRestApi for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportRestApi method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportRestApiRequest method. -// req, resp := client.ImportRestApiRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) ImportRestApiRequest(input *ImportRestApiInput) (req *request.Request, output *RestApi) { - op := &request.Operation{ - Name: opImportRestApi, - HTTPMethod: "POST", - HTTPPath: "/restapis?mode=import", - } - - if input == nil { - input = &ImportRestApiInput{} - } - - output = &RestApi{} - req = c.newRequest(op, input, output) - return -} - -// ImportRestApi API operation for Amazon API Gateway. -// -// A feature of the Amazon API Gateway control service for creating a new API -// from an external API definition file. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation ImportRestApi for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) ImportRestApi(input *ImportRestApiInput) (*RestApi, error) { - req, out := c.ImportRestApiRequest(input) - err := req.Send() - return out, err -} - -const opPutIntegration = "PutIntegration" - -// PutIntegrationRequest generates a "aws/request.Request" representing the -// client's request for the PutIntegration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutIntegration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutIntegration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutIntegrationRequest method. -// req, resp := client.PutIntegrationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) PutIntegrationRequest(input *PutIntegrationInput) (req *request.Request, output *Integration) { - op := &request.Operation{ - Name: opPutIntegration, - HTTPMethod: "PUT", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration", - } - - if input == nil { - input = &PutIntegrationInput{} - } - - output = &Integration{} - req = c.newRequest(op, input, output) - return -} - -// PutIntegration API operation for Amazon API Gateway. -// -// Represents a put integration. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation PutIntegration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) PutIntegration(input *PutIntegrationInput) (*Integration, error) { - req, out := c.PutIntegrationRequest(input) - err := req.Send() - return out, err -} - -const opPutIntegrationResponse = "PutIntegrationResponse" - -// PutIntegrationResponseRequest generates a "aws/request.Request" representing the -// client's request for the PutIntegrationResponse operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutIntegrationResponse for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutIntegrationResponse method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutIntegrationResponseRequest method. -// req, resp := client.PutIntegrationResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) PutIntegrationResponseRequest(input *PutIntegrationResponseInput) (req *request.Request, output *IntegrationResponse) { - op := &request.Operation{ - Name: opPutIntegrationResponse, - HTTPMethod: "PUT", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration/responses/{status_code}", - } - - if input == nil { - input = &PutIntegrationResponseInput{} - } - - output = &IntegrationResponse{} - req = c.newRequest(op, input, output) - return -} - -// PutIntegrationResponse API operation for Amazon API Gateway. -// -// Represents a put integration. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation PutIntegrationResponse for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) PutIntegrationResponse(input *PutIntegrationResponseInput) (*IntegrationResponse, error) { - req, out := c.PutIntegrationResponseRequest(input) - err := req.Send() - return out, err -} - -const opPutMethod = "PutMethod" - -// PutMethodRequest generates a "aws/request.Request" representing the -// client's request for the PutMethod operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutMethod for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutMethod method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutMethodRequest method. -// req, resp := client.PutMethodRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) PutMethodRequest(input *PutMethodInput) (req *request.Request, output *Method) { - op := &request.Operation{ - Name: opPutMethod, - HTTPMethod: "PUT", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}", - } - - if input == nil { - input = &PutMethodInput{} - } - - output = &Method{} - req = c.newRequest(op, input, output) - return -} - -// PutMethod API operation for Amazon API Gateway. -// -// Add a method to an existing Resource 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 API Gateway's -// API operation PutMethod for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) PutMethod(input *PutMethodInput) (*Method, error) { - req, out := c.PutMethodRequest(input) - err := req.Send() - return out, err -} - -const opPutMethodResponse = "PutMethodResponse" - -// PutMethodResponseRequest generates a "aws/request.Request" representing the -// client's request for the PutMethodResponse operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutMethodResponse for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutMethodResponse method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutMethodResponseRequest method. -// req, resp := client.PutMethodResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) PutMethodResponseRequest(input *PutMethodResponseInput) (req *request.Request, output *MethodResponse) { - op := &request.Operation{ - Name: opPutMethodResponse, - HTTPMethod: "PUT", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/responses/{status_code}", - } - - if input == nil { - input = &PutMethodResponseInput{} - } - - output = &MethodResponse{} - req = c.newRequest(op, input, output) - return -} - -// PutMethodResponse API operation for Amazon API Gateway. -// -// Adds a MethodResponse to an existing Method 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 API Gateway's -// API operation PutMethodResponse for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) PutMethodResponse(input *PutMethodResponseInput) (*MethodResponse, error) { - req, out := c.PutMethodResponseRequest(input) - err := req.Send() - return out, err -} - -const opPutRestApi = "PutRestApi" - -// PutRestApiRequest generates a "aws/request.Request" representing the -// client's request for the PutRestApi operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutRestApi for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutRestApi method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutRestApiRequest method. -// req, resp := client.PutRestApiRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) PutRestApiRequest(input *PutRestApiInput) (req *request.Request, output *RestApi) { - op := &request.Operation{ - Name: opPutRestApi, - HTTPMethod: "PUT", - HTTPPath: "/restapis/{restapi_id}", - } - - if input == nil { - input = &PutRestApiInput{} - } - - output = &RestApi{} - req = c.newRequest(op, input, output) - return -} - -// PutRestApi API operation for Amazon API Gateway. -// -// A feature of the Amazon API Gateway control service for updating an existing -// API with an input of external API definitions. The update can take the form -// of merging the supplied definition into the existing API or overwriting the -// existing 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 API Gateway's -// API operation PutRestApi for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) PutRestApi(input *PutRestApiInput) (*RestApi, error) { - req, out := c.PutRestApiRequest(input) - err := req.Send() - return out, err -} - -const opTestInvokeAuthorizer = "TestInvokeAuthorizer" - -// TestInvokeAuthorizerRequest generates a "aws/request.Request" representing the -// client's request for the TestInvokeAuthorizer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TestInvokeAuthorizer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TestInvokeAuthorizer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TestInvokeAuthorizerRequest method. -// req, resp := client.TestInvokeAuthorizerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) TestInvokeAuthorizerRequest(input *TestInvokeAuthorizerInput) (req *request.Request, output *TestInvokeAuthorizerOutput) { - op := &request.Operation{ - Name: opTestInvokeAuthorizer, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/authorizers/{authorizer_id}", - } - - if input == nil { - input = &TestInvokeAuthorizerInput{} - } - - output = &TestInvokeAuthorizerOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestInvokeAuthorizer API operation for Amazon API Gateway. -// -// Simulate the execution of an Authorizer in your RestApi with headers, parameters, -// and an incoming request body. -// -// Enable custom authorizers (http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.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 API Gateway's -// API operation TestInvokeAuthorizer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) TestInvokeAuthorizer(input *TestInvokeAuthorizerInput) (*TestInvokeAuthorizerOutput, error) { - req, out := c.TestInvokeAuthorizerRequest(input) - err := req.Send() - return out, err -} - -const opTestInvokeMethod = "TestInvokeMethod" - -// TestInvokeMethodRequest generates a "aws/request.Request" representing the -// client's request for the TestInvokeMethod operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TestInvokeMethod for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TestInvokeMethod method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TestInvokeMethodRequest method. -// req, resp := client.TestInvokeMethodRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) TestInvokeMethodRequest(input *TestInvokeMethodInput) (req *request.Request, output *TestInvokeMethodOutput) { - op := &request.Operation{ - Name: opTestInvokeMethod, - HTTPMethod: "POST", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}", - } - - if input == nil { - input = &TestInvokeMethodInput{} - } - - output = &TestInvokeMethodOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestInvokeMethod API operation for Amazon API Gateway. -// -// Simulate the execution of a Method in your RestApi with headers, parameters, -// and an incoming request body. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation TestInvokeMethod for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) TestInvokeMethod(input *TestInvokeMethodInput) (*TestInvokeMethodOutput, error) { - req, out := c.TestInvokeMethodRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAccount = "UpdateAccount" - -// UpdateAccountRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAccount operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAccount for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAccount method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAccountRequest method. -// req, resp := client.UpdateAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateAccountRequest(input *UpdateAccountInput) (req *request.Request, output *Account) { - op := &request.Operation{ - Name: opUpdateAccount, - HTTPMethod: "PATCH", - HTTPPath: "/account", - } - - if input == nil { - input = &UpdateAccountInput{} - } - - output = &Account{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAccount API operation for Amazon API Gateway. -// -// Changes information about the current Account 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 API Gateway's -// API operation UpdateAccount for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateAccount(input *UpdateAccountInput) (*Account, error) { - req, out := c.UpdateAccountRequest(input) - err := req.Send() - return out, err -} - -const opUpdateApiKey = "UpdateApiKey" - -// UpdateApiKeyRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApiKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateApiKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateApiKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateApiKeyRequest method. -// req, resp := client.UpdateApiKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateApiKeyRequest(input *UpdateApiKeyInput) (req *request.Request, output *ApiKey) { - op := &request.Operation{ - Name: opUpdateApiKey, - HTTPMethod: "PATCH", - HTTPPath: "/apikeys/{api_Key}", - } - - if input == nil { - input = &UpdateApiKeyInput{} - } - - output = &ApiKey{} - req = c.newRequest(op, input, output) - return -} - -// UpdateApiKey API operation for Amazon API Gateway. -// -// Changes information about an ApiKey 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 API Gateway's -// API operation UpdateApiKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) UpdateApiKey(input *UpdateApiKeyInput) (*ApiKey, error) { - req, out := c.UpdateApiKeyRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAuthorizer = "UpdateAuthorizer" - -// UpdateAuthorizerRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAuthorizer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAuthorizer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAuthorizer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAuthorizerRequest method. -// req, resp := client.UpdateAuthorizerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateAuthorizerRequest(input *UpdateAuthorizerInput) (req *request.Request, output *Authorizer) { - op := &request.Operation{ - Name: opUpdateAuthorizer, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/authorizers/{authorizer_id}", - } - - if input == nil { - input = &UpdateAuthorizerInput{} - } - - output = &Authorizer{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAuthorizer API operation for Amazon API Gateway. -// -// Updates an existing Authorizer resource. -// -// AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/update-authorizer.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 API Gateway's -// API operation UpdateAuthorizer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateAuthorizer(input *UpdateAuthorizerInput) (*Authorizer, error) { - req, out := c.UpdateAuthorizerRequest(input) - err := req.Send() - return out, err -} - -const opUpdateBasePathMapping = "UpdateBasePathMapping" - -// UpdateBasePathMappingRequest generates a "aws/request.Request" representing the -// client's request for the UpdateBasePathMapping operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateBasePathMapping for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateBasePathMapping method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateBasePathMappingRequest method. -// req, resp := client.UpdateBasePathMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateBasePathMappingRequest(input *UpdateBasePathMappingInput) (req *request.Request, output *BasePathMapping) { - op := &request.Operation{ - Name: opUpdateBasePathMapping, - HTTPMethod: "PATCH", - HTTPPath: "/domainnames/{domain_name}/basepathmappings/{base_path}", - } - - if input == nil { - input = &UpdateBasePathMappingInput{} - } - - output = &BasePathMapping{} - req = c.newRequest(op, input, output) - return -} - -// UpdateBasePathMapping API operation for Amazon API Gateway. -// -// Changes information about the BasePathMapping 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 API Gateway's -// API operation UpdateBasePathMapping for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateBasePathMapping(input *UpdateBasePathMappingInput) (*BasePathMapping, error) { - req, out := c.UpdateBasePathMappingRequest(input) - err := req.Send() - return out, err -} - -const opUpdateClientCertificate = "UpdateClientCertificate" - -// UpdateClientCertificateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateClientCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateClientCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateClientCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateClientCertificateRequest method. -// req, resp := client.UpdateClientCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateClientCertificateRequest(input *UpdateClientCertificateInput) (req *request.Request, output *ClientCertificate) { - op := &request.Operation{ - Name: opUpdateClientCertificate, - HTTPMethod: "PATCH", - HTTPPath: "/clientcertificates/{clientcertificate_id}", - } - - if input == nil { - input = &UpdateClientCertificateInput{} - } - - output = &ClientCertificate{} - req = c.newRequest(op, input, output) - return -} - -// UpdateClientCertificate API operation for Amazon API Gateway. -// -// Changes information about an ClientCertificate 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 API Gateway's -// API operation UpdateClientCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -func (c *APIGateway) UpdateClientCertificate(input *UpdateClientCertificateInput) (*ClientCertificate, error) { - req, out := c.UpdateClientCertificateRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDeployment = "UpdateDeployment" - -// UpdateDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDeploymentRequest method. -// req, resp := client.UpdateDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateDeploymentRequest(input *UpdateDeploymentInput) (req *request.Request, output *Deployment) { - op := &request.Operation{ - Name: opUpdateDeployment, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/deployments/{deployment_id}", - } - - if input == nil { - input = &UpdateDeploymentInput{} - } - - output = &Deployment{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDeployment API operation for Amazon API Gateway. -// -// Changes information about a Deployment 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 API Gateway's -// API operation UpdateDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// -func (c *APIGateway) UpdateDeployment(input *UpdateDeploymentInput) (*Deployment, error) { - req, out := c.UpdateDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDocumentationPart = "UpdateDocumentationPart" - -// UpdateDocumentationPartRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDocumentationPart operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDocumentationPart for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDocumentationPart method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDocumentationPartRequest method. -// req, resp := client.UpdateDocumentationPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateDocumentationPartRequest(input *UpdateDocumentationPartInput) (req *request.Request, output *DocumentationPart) { - op := &request.Operation{ - Name: opUpdateDocumentationPart, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/documentation/parts/{part_id}", - } - - if input == nil { - input = &UpdateDocumentationPartInput{} - } - - output = &DocumentationPart{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDocumentationPart API operation for Amazon API 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 API Gateway's -// API operation UpdateDocumentationPart for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateDocumentationPart(input *UpdateDocumentationPartInput) (*DocumentationPart, error) { - req, out := c.UpdateDocumentationPartRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDocumentationVersion = "UpdateDocumentationVersion" - -// UpdateDocumentationVersionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDocumentationVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDocumentationVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDocumentationVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDocumentationVersionRequest method. -// req, resp := client.UpdateDocumentationVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateDocumentationVersionRequest(input *UpdateDocumentationVersionInput) (req *request.Request, output *DocumentationVersion) { - op := &request.Operation{ - Name: opUpdateDocumentationVersion, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/documentation/versions/{doc_version}", - } - - if input == nil { - input = &UpdateDocumentationVersionInput{} - } - - output = &DocumentationVersion{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDocumentationVersion API operation for Amazon API 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 API Gateway's -// API operation UpdateDocumentationVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateDocumentationVersion(input *UpdateDocumentationVersionInput) (*DocumentationVersion, error) { - req, out := c.UpdateDocumentationVersionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDomainName = "UpdateDomainName" - -// UpdateDomainNameRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDomainName operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDomainName for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDomainName method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDomainNameRequest method. -// req, resp := client.UpdateDomainNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateDomainNameRequest(input *UpdateDomainNameInput) (req *request.Request, output *DomainName) { - op := &request.Operation{ - Name: opUpdateDomainName, - HTTPMethod: "PATCH", - HTTPPath: "/domainnames/{domain_name}", - } - - if input == nil { - input = &UpdateDomainNameInput{} - } - - output = &DomainName{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDomainName API operation for Amazon API Gateway. -// -// Changes information about the DomainName 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 API Gateway's -// API operation UpdateDomainName for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateDomainName(input *UpdateDomainNameInput) (*DomainName, error) { - req, out := c.UpdateDomainNameRequest(input) - err := req.Send() - return out, err -} - -const opUpdateIntegration = "UpdateIntegration" - -// UpdateIntegrationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIntegration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateIntegration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateIntegration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateIntegrationRequest method. -// req, resp := client.UpdateIntegrationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateIntegrationRequest(input *UpdateIntegrationInput) (req *request.Request, output *Integration) { - op := &request.Operation{ - Name: opUpdateIntegration, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration", - } - - if input == nil { - input = &UpdateIntegrationInput{} - } - - output = &Integration{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIntegration API operation for Amazon API Gateway. -// -// Represents an update integration. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation UpdateIntegration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) UpdateIntegration(input *UpdateIntegrationInput) (*Integration, error) { - req, out := c.UpdateIntegrationRequest(input) - err := req.Send() - return out, err -} - -const opUpdateIntegrationResponse = "UpdateIntegrationResponse" - -// UpdateIntegrationResponseRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIntegrationResponse operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateIntegrationResponse for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateIntegrationResponse method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateIntegrationResponseRequest method. -// req, resp := client.UpdateIntegrationResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateIntegrationResponseRequest(input *UpdateIntegrationResponseInput) (req *request.Request, output *IntegrationResponse) { - op := &request.Operation{ - Name: opUpdateIntegrationResponse, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration/responses/{status_code}", - } - - if input == nil { - input = &UpdateIntegrationResponseInput{} - } - - output = &IntegrationResponse{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIntegrationResponse API operation for Amazon API Gateway. -// -// Represents an update integration 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 API Gateway's -// API operation UpdateIntegrationResponse for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateIntegrationResponse(input *UpdateIntegrationResponseInput) (*IntegrationResponse, error) { - req, out := c.UpdateIntegrationResponseRequest(input) - err := req.Send() - return out, err -} - -const opUpdateMethod = "UpdateMethod" - -// UpdateMethodRequest generates a "aws/request.Request" representing the -// client's request for the UpdateMethod operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateMethod for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateMethod method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateMethodRequest method. -// req, resp := client.UpdateMethodRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateMethodRequest(input *UpdateMethodInput) (req *request.Request, output *Method) { - op := &request.Operation{ - Name: opUpdateMethod, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}", - } - - if input == nil { - input = &UpdateMethodInput{} - } - - output = &Method{} - req = c.newRequest(op, input, output) - return -} - -// UpdateMethod API operation for Amazon API Gateway. -// -// Updates an existing Method 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 API Gateway's -// API operation UpdateMethod for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateMethod(input *UpdateMethodInput) (*Method, error) { - req, out := c.UpdateMethodRequest(input) - err := req.Send() - return out, err -} - -const opUpdateMethodResponse = "UpdateMethodResponse" - -// UpdateMethodResponseRequest generates a "aws/request.Request" representing the -// client's request for the UpdateMethodResponse operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateMethodResponse for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateMethodResponse method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateMethodResponseRequest method. -// req, resp := client.UpdateMethodResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateMethodResponseRequest(input *UpdateMethodResponseInput) (req *request.Request, output *MethodResponse) { - op := &request.Operation{ - Name: opUpdateMethodResponse, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/responses/{status_code}", - } - - if input == nil { - input = &UpdateMethodResponseInput{} - } - - output = &MethodResponse{} - req = c.newRequest(op, input, output) - return -} - -// UpdateMethodResponse API operation for Amazon API Gateway. -// -// Updates an existing MethodResponse 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 API Gateway's -// API operation UpdateMethodResponse for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeLimitExceededException "LimitExceededException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateMethodResponse(input *UpdateMethodResponseInput) (*MethodResponse, error) { - req, out := c.UpdateMethodResponseRequest(input) - err := req.Send() - return out, err -} - -const opUpdateModel = "UpdateModel" - -// UpdateModelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateModel operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateModel for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateModel method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateModelRequest method. -// req, resp := client.UpdateModelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateModelRequest(input *UpdateModelInput) (req *request.Request, output *Model) { - op := &request.Operation{ - Name: opUpdateModel, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/models/{model_name}", - } - - if input == nil { - input = &UpdateModelInput{} - } - - output = &Model{} - req = c.newRequest(op, input, output) - return -} - -// UpdateModel API operation for Amazon API Gateway. -// -// Changes information about a model. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation UpdateModel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateModel(input *UpdateModelInput) (*Model, error) { - req, out := c.UpdateModelRequest(input) - err := req.Send() - return out, err -} - -const opUpdateResource = "UpdateResource" - -// UpdateResourceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateResourceRequest method. -// req, resp := client.UpdateResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateResourceRequest(input *UpdateResourceInput) (req *request.Request, output *Resource) { - op := &request.Operation{ - Name: opUpdateResource, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/resources/{resource_id}", - } - - if input == nil { - input = &UpdateResourceInput{} - } - - output = &Resource{} - req = c.newRequest(op, input, output) - return -} - -// UpdateResource API operation for Amazon API Gateway. -// -// Changes information about a Resource 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 API Gateway's -// API operation UpdateResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateResource(input *UpdateResourceInput) (*Resource, error) { - req, out := c.UpdateResourceRequest(input) - err := req.Send() - return out, err -} - -const opUpdateRestApi = "UpdateRestApi" - -// UpdateRestApiRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRestApi operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateRestApi for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateRestApi method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateRestApiRequest method. -// req, resp := client.UpdateRestApiRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateRestApiRequest(input *UpdateRestApiInput) (req *request.Request, output *RestApi) { - op := &request.Operation{ - Name: opUpdateRestApi, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}", - } - - if input == nil { - input = &UpdateRestApiInput{} - } - - output = &RestApi{} - req = c.newRequest(op, input, output) - return -} - -// UpdateRestApi API operation for Amazon API Gateway. -// -// Changes information about the specified 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 API Gateway's -// API operation UpdateRestApi for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateRestApi(input *UpdateRestApiInput) (*RestApi, error) { - req, out := c.UpdateRestApiRequest(input) - err := req.Send() - return out, err -} - -const opUpdateStage = "UpdateStage" - -// UpdateStageRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateStage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateStage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateStageRequest method. -// req, resp := client.UpdateStageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateStageRequest(input *UpdateStageInput) (req *request.Request, output *Stage) { - op := &request.Operation{ - Name: opUpdateStage, - HTTPMethod: "PATCH", - HTTPPath: "/restapis/{restapi_id}/stages/{stage_name}", - } - - if input == nil { - input = &UpdateStageInput{} - } - - output = &Stage{} - req = c.newRequest(op, input, output) - return -} - -// UpdateStage API operation for Amazon API Gateway. -// -// Changes information about a Stage 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 API Gateway's -// API operation UpdateStage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *APIGateway) UpdateStage(input *UpdateStageInput) (*Stage, error) { - req, out := c.UpdateStageRequest(input) - err := req.Send() - return out, err -} - -const opUpdateUsage = "UpdateUsage" - -// UpdateUsageRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUsage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateUsage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateUsage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateUsageRequest method. -// req, resp := client.UpdateUsageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateUsageRequest(input *UpdateUsageInput) (req *request.Request, output *Usage) { - op := &request.Operation{ - Name: opUpdateUsage, - HTTPMethod: "PATCH", - HTTPPath: "/usageplans/{usageplanId}/keys/{keyId}/usage", - } - - if input == nil { - input = &UpdateUsageInput{} - } - - output = &Usage{} - req = c.newRequest(op, input, output) - return -} - -// UpdateUsage API operation for Amazon API Gateway. -// -// Grants a temporary extension to the reamining quota of a usage plan associated -// with a specified API key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon API Gateway's -// API operation UpdateUsage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -func (c *APIGateway) UpdateUsage(input *UpdateUsageInput) (*Usage, error) { - req, out := c.UpdateUsageRequest(input) - err := req.Send() - return out, err -} - -const opUpdateUsagePlan = "UpdateUsagePlan" - -// UpdateUsagePlanRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUsagePlan operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateUsagePlan for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateUsagePlan method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateUsagePlanRequest method. -// req, resp := client.UpdateUsagePlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *APIGateway) UpdateUsagePlanRequest(input *UpdateUsagePlanInput) (req *request.Request, output *UsagePlan) { - op := &request.Operation{ - Name: opUpdateUsagePlan, - HTTPMethod: "PATCH", - HTTPPath: "/usageplans/{usageplanId}", - } - - if input == nil { - input = &UpdateUsagePlanInput{} - } - - output = &UsagePlan{} - req = c.newRequest(op, input, output) - return -} - -// UpdateUsagePlan API operation for Amazon API Gateway. -// -// Updates a usage plan of a given plan 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 API Gateway's -// API operation UpdateUsagePlan for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeConflictException "ConflictException" -// -func (c *APIGateway) UpdateUsagePlan(input *UpdateUsagePlanInput) (*UsagePlan, error) { - req, out := c.UpdateUsagePlanRequest(input) - err := req.Send() - return out, err -} - -// Represents an AWS account that is associated with Amazon API Gateway. -// -// To view the account info, call GET on this resource. -// -// Error Codes -// -// The following exception may be thrown when the request fails. -// -// UnauthorizedException -// NotFoundException -// TooManyRequestsException -// For detailed error code information, including the corresponding HTTP Status -// Codes, see API Gateway Error Codes (http://docs.aws.amazon.com/apigateway/api-reference/handling-errors/#api-error-codes) -// -// Example: Get the information about an account. -// -// Request -// -// GET /account HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com -// X-Amz-Date: 20160531T184618Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/us-east-1/apigateway/aws4_request, -// SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} -// Response -// -// The successful response returns a 200 OK status code and a payload similar -// to the following: -// -// { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/account-apigateway-{rel}.html", -// "name": "account", "templated": true }, "self": { "href": "/account" }, "account:update": -// { "href": "/account" } }, "cloudwatchRoleArn": "arn:aws:iam::123456789012:role/apigAwsProxyRole", -// "throttleSettings": { "rateLimit": 500, "burstLimit": 1000 } } -// In addition to making the REST API call directly, you can use the AWS CLI -// and an AWS SDK to access this resource. -// -// API Gateway Limits (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-limits.html)Developer -// Guide (http://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html), -// AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/get-account.html) -type Account struct { - _ struct{} `type:"structure"` - - // The version of the API keys used for the account. - ApiKeyVersion *string `locationName:"apiKeyVersion" type:"string"` - - // The ARN of an Amazon CloudWatch role for the current Account. - CloudwatchRoleArn *string `locationName:"cloudwatchRoleArn" type:"string"` - - // A list of features supported for the account. When usage plans are enabled, - // the features list will include an entry of "UsagePlans". - Features []*string `locationName:"features" type:"list"` - - // Specifies the API request limits configured for the current Account. - ThrottleSettings *ThrottleSettings `locationName:"throttleSettings" type:"structure"` -} - -// String returns the string representation -func (s Account) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Account) GoString() string { - return s.String() -} - -// SetApiKeyVersion sets the ApiKeyVersion field's value. -func (s *Account) SetApiKeyVersion(v string) *Account { - s.ApiKeyVersion = &v - return s -} - -// SetCloudwatchRoleArn sets the CloudwatchRoleArn field's value. -func (s *Account) SetCloudwatchRoleArn(v string) *Account { - s.CloudwatchRoleArn = &v - return s -} - -// SetFeatures sets the Features field's value. -func (s *Account) SetFeatures(v []*string) *Account { - s.Features = v - return s -} - -// SetThrottleSettings sets the ThrottleSettings field's value. -func (s *Account) SetThrottleSettings(v *ThrottleSettings) *Account { - s.ThrottleSettings = v - return s -} - -// A resource that can be distributed to callers for executing Method resources -// that require an API key. API keys can be mapped to any Stage on any RestApi, -// which indicates that the callers with the API key can make requests to that -// stage. -// -// Use API Keys (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-api-keys.html) -type ApiKey struct { - _ struct{} `type:"structure"` - - // The timestamp when the API Key was created. - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"` - - // An AWS Marketplace customer identifier , when integrating with the AWS SaaS - // Marketplace. - CustomerId *string `locationName:"customerId" type:"string"` - - // The description of the API Key. - Description *string `locationName:"description" type:"string"` - - // Specifies whether the API Key can be used by callers. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The identifier of the API Key. - Id *string `locationName:"id" type:"string"` - - // The timestamp when the API Key was last updated. - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"unix"` - - // The name of the API Key. - Name *string `locationName:"name" type:"string"` - - // A list of Stage resources that are associated with the ApiKey resource. - StageKeys []*string `locationName:"stageKeys" type:"list"` - - // The value of the API Key. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s ApiKey) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApiKey) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *ApiKey) SetCreatedDate(v time.Time) *ApiKey { - s.CreatedDate = &v - return s -} - -// SetCustomerId sets the CustomerId field's value. -func (s *ApiKey) SetCustomerId(v string) *ApiKey { - s.CustomerId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ApiKey) SetDescription(v string) *ApiKey { - s.Description = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *ApiKey) SetEnabled(v bool) *ApiKey { - s.Enabled = &v - return s -} - -// SetId sets the Id field's value. -func (s *ApiKey) SetId(v string) *ApiKey { - s.Id = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *ApiKey) SetLastUpdatedDate(v time.Time) *ApiKey { - s.LastUpdatedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *ApiKey) SetName(v string) *ApiKey { - s.Name = &v - return s -} - -// SetStageKeys sets the StageKeys field's value. -func (s *ApiKey) SetStageKeys(v []*string) *ApiKey { - s.StageKeys = v - return s -} - -// SetValue sets the Value field's value. -func (s *ApiKey) SetValue(v string) *ApiKey { - s.Value = &v - return s -} - -// API stage name of the associated API stage in a usage plan. -type ApiStage struct { - _ struct{} `type:"structure"` - - // API Id of the associated API stage in a usage plan. - ApiId *string `locationName:"apiId" type:"string"` - - // API stage name of the associated API stage in a usage plan. - Stage *string `locationName:"stage" type:"string"` -} - -// String returns the string representation -func (s ApiStage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApiStage) GoString() string { - return s.String() -} - -// SetApiId sets the ApiId field's value. -func (s *ApiStage) SetApiId(v string) *ApiStage { - s.ApiId = &v - return s -} - -// SetStage sets the Stage field's value. -func (s *ApiStage) SetStage(v string) *ApiStage { - s.Stage = &v - return s -} - -// Represents an authorization layer for methods. If enabled on a method, API -// Gateway will activate the authorizer when a client calls the method. -// -// Enable custom authorization (http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html) -type Authorizer struct { - _ struct{} `type:"structure"` - - // Optional customer-defined field, used in Swagger imports/exports. Has no - // functional impact. - AuthType *string `locationName:"authType" type:"string"` - - // Specifies the credentials required for the authorizer, if any. Two options - // are available. To specify an IAM role for Amazon API Gateway to assume, use - // the role's Amazon Resource Name (ARN). To use resource-based permissions - // on the Lambda function, specify null. - AuthorizerCredentials *string `locationName:"authorizerCredentials" type:"string"` - - // The TTL in seconds of cached authorizer results. If greater than 0, API Gateway - // will cache authorizer responses. If this field is not set, the default value - // is 300. The maximum value is 3600, or 1 hour. - AuthorizerResultTtlInSeconds *int64 `locationName:"authorizerResultTtlInSeconds" type:"integer"` - - // [Required] Specifies the authorizer's Uniform Resource Identifier (URI). - // For TOKEN authorizers, this must be a well-formed Lambda function URI, for - // example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. - // In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}, - // where {region} is the same as the region hosting the Lambda function, path - // indicates that the remaining substring in the URI should be treated as the - // path to the resource, including the initial /. For Lambda functions, this - // is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. - AuthorizerUri *string `locationName:"authorizerUri" type:"string"` - - // The identifier for the authorizer resource. - Id *string `locationName:"id" type:"string"` - - // [Required] The source of the identity in an incoming request. For a TOKEN - // authorizer, this value is a mapping expression with the same syntax as integration - // parameter mappings. The only valid source for tokens is 'header', so the - // expression should match 'method.request.header.[headerName]'. The value of - // the header '[headerName]' will be interpreted as the incoming token. For - // COGNITO_USER_POOLS authorizers, this property is used. - IdentitySource *string `locationName:"identitySource" type:"string"` - - // A validation expression for the incoming identity. For TOKEN authorizers, - // this value should be a regular expression. The incoming token from the client - // is matched against this expression, and will proceed if the token matches. - // If the token doesn't match, the client receives a 401 Unauthorized response. - IdentityValidationExpression *string `locationName:"identityValidationExpression" type:"string"` - - // [Required] The name of the authorizer. - Name *string `locationName:"name" type:"string"` - - // A list of the provider ARNs of the authorizer. For an TOKEN authorizer, this - // is not defined. For authorizers of the COGNITO_USER_POOLS type, each element - // corresponds to a user pool ARN of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}. - ProviderARNs []*string `locationName:"providerARNs" type:"list"` - - // [Required] The type of the authorizer. Currently, the valid type is TOKEN - // for a Lambda function or COGNITO_USER_POOLS for an Amazon Cognito user pool. - Type *string `locationName:"type" type:"string" enum:"AuthorizerType"` -} - -// String returns the string representation -func (s Authorizer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Authorizer) GoString() string { - return s.String() -} - -// SetAuthType sets the AuthType field's value. -func (s *Authorizer) SetAuthType(v string) *Authorizer { - s.AuthType = &v - return s -} - -// SetAuthorizerCredentials sets the AuthorizerCredentials field's value. -func (s *Authorizer) SetAuthorizerCredentials(v string) *Authorizer { - s.AuthorizerCredentials = &v - return s -} - -// SetAuthorizerResultTtlInSeconds sets the AuthorizerResultTtlInSeconds field's value. -func (s *Authorizer) SetAuthorizerResultTtlInSeconds(v int64) *Authorizer { - s.AuthorizerResultTtlInSeconds = &v - return s -} - -// SetAuthorizerUri sets the AuthorizerUri field's value. -func (s *Authorizer) SetAuthorizerUri(v string) *Authorizer { - s.AuthorizerUri = &v - return s -} - -// SetId sets the Id field's value. -func (s *Authorizer) SetId(v string) *Authorizer { - s.Id = &v - return s -} - -// SetIdentitySource sets the IdentitySource field's value. -func (s *Authorizer) SetIdentitySource(v string) *Authorizer { - s.IdentitySource = &v - return s -} - -// SetIdentityValidationExpression sets the IdentityValidationExpression field's value. -func (s *Authorizer) SetIdentityValidationExpression(v string) *Authorizer { - s.IdentityValidationExpression = &v - return s -} - -// SetName sets the Name field's value. -func (s *Authorizer) SetName(v string) *Authorizer { - s.Name = &v - return s -} - -// SetProviderARNs sets the ProviderARNs field's value. -func (s *Authorizer) SetProviderARNs(v []*string) *Authorizer { - s.ProviderARNs = v - return s -} - -// SetType sets the Type field's value. -func (s *Authorizer) SetType(v string) *Authorizer { - s.Type = &v - return s -} - -// Represents the base path that callers of the API must provide as part of -// the URL after the domain name. -// -// A custom domain name plus a BasePathMapping specification identifies a deployed -// RestApi in a given stage of the owner Account. -// Use Custom Domain Names (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html) -type BasePathMapping struct { - _ struct{} `type:"structure"` - - // The base path name that callers of the API must provide as part of the URL - // after the domain name. - BasePath *string `locationName:"basePath" type:"string"` - - // The name of the API. - RestApiId *string `locationName:"restApiId" type:"string"` - - // The name of the API's stage. - Stage *string `locationName:"stage" type:"string"` -} - -// String returns the string representation -func (s BasePathMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BasePathMapping) GoString() string { - return s.String() -} - -// SetBasePath sets the BasePath field's value. -func (s *BasePathMapping) SetBasePath(v string) *BasePathMapping { - s.BasePath = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *BasePathMapping) SetRestApiId(v string) *BasePathMapping { - s.RestApiId = &v - return s -} - -// SetStage sets the Stage field's value. -func (s *BasePathMapping) SetStage(v string) *BasePathMapping { - s.Stage = &v - return s -} - -// Represents a client certificate used to configure client-side SSL authentication -// while sending requests to the integration endpoint. -// -// Client certificates are used authenticate an API by the back-end server. -// To authenticate an API client (or user), use a custom Authorizer. -// Use Client-Side Certificate (http://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-client-side-ssl-authentication.html) -type ClientCertificate struct { - _ struct{} `type:"structure"` - - // The identifier of the client certificate. - ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` - - // The timestamp when the client certificate was created. - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"` - - // The description of the client certificate. - Description *string `locationName:"description" type:"string"` - - // The timestamp when the client certificate will expire. - ExpirationDate *time.Time `locationName:"expirationDate" type:"timestamp" timestampFormat:"unix"` - - // The PEM-encoded public key of the client certificate, which can be used to - // configure certificate authentication in the integration endpoint . - PemEncodedCertificate *string `locationName:"pemEncodedCertificate" type:"string"` -} - -// String returns the string representation -func (s ClientCertificate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClientCertificate) GoString() string { - return s.String() -} - -// SetClientCertificateId sets the ClientCertificateId field's value. -func (s *ClientCertificate) SetClientCertificateId(v string) *ClientCertificate { - s.ClientCertificateId = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *ClientCertificate) SetCreatedDate(v time.Time) *ClientCertificate { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ClientCertificate) SetDescription(v string) *ClientCertificate { - s.Description = &v - return s -} - -// SetExpirationDate sets the ExpirationDate field's value. -func (s *ClientCertificate) SetExpirationDate(v time.Time) *ClientCertificate { - s.ExpirationDate = &v - return s -} - -// SetPemEncodedCertificate sets the PemEncodedCertificate field's value. -func (s *ClientCertificate) SetPemEncodedCertificate(v string) *ClientCertificate { - s.PemEncodedCertificate = &v - return s -} - -// Request to create an ApiKey resource. -type CreateApiKeyInput struct { - _ struct{} `type:"structure"` - - // An AWS Marketplace customer identifier , when integrating with the AWS SaaS - // Marketplace. - CustomerId *string `locationName:"customerId" type:"string"` - - // The description of the ApiKey. - Description *string `locationName:"description" type:"string"` - - // Specifies whether the ApiKey can be used by callers. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // Specifies whether (true) or not (false) the key identifier is distinct from - // the created API key value. - GenerateDistinctId *bool `locationName:"generateDistinctId" type:"boolean"` - - // The name of the ApiKey. - Name *string `locationName:"name" type:"string"` - - // DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key. - StageKeys []*StageKey `locationName:"stageKeys" type:"list"` - - // Specifies a value of the API key. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s CreateApiKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateApiKeyInput) GoString() string { - return s.String() -} - -// SetCustomerId sets the CustomerId field's value. -func (s *CreateApiKeyInput) SetCustomerId(v string) *CreateApiKeyInput { - s.CustomerId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateApiKeyInput) SetDescription(v string) *CreateApiKeyInput { - s.Description = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *CreateApiKeyInput) SetEnabled(v bool) *CreateApiKeyInput { - s.Enabled = &v - return s -} - -// SetGenerateDistinctId sets the GenerateDistinctId field's value. -func (s *CreateApiKeyInput) SetGenerateDistinctId(v bool) *CreateApiKeyInput { - s.GenerateDistinctId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateApiKeyInput) SetName(v string) *CreateApiKeyInput { - s.Name = &v - return s -} - -// SetStageKeys sets the StageKeys field's value. -func (s *CreateApiKeyInput) SetStageKeys(v []*StageKey) *CreateApiKeyInput { - s.StageKeys = v - return s -} - -// SetValue sets the Value field's value. -func (s *CreateApiKeyInput) SetValue(v string) *CreateApiKeyInput { - s.Value = &v - return s -} - -// Request to add a new Authorizer to an existing RestApi resource. -type CreateAuthorizerInput struct { - _ struct{} `type:"structure"` - - // Optional customer-defined field, used in Swagger imports/exports. Has no - // functional impact. - AuthType *string `locationName:"authType" type:"string"` - - // Specifies the credentials required for the authorizer, if any. - AuthorizerCredentials *string `locationName:"authorizerCredentials" type:"string"` - - // The TTL of cached authorizer results. - AuthorizerResultTtlInSeconds *int64 `locationName:"authorizerResultTtlInSeconds" type:"integer"` - - // [Required] Specifies the authorizer's Uniform Resource Identifier (URI). - AuthorizerUri *string `locationName:"authorizerUri" type:"string"` - - // [Required] The source of the identity in an incoming request. - // - // IdentitySource is a required field - IdentitySource *string `locationName:"identitySource" type:"string" required:"true"` - - // A validation expression for the incoming identity. - IdentityValidationExpression *string `locationName:"identityValidationExpression" type:"string"` - - // [Required] The name of the authorizer. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // A list of the Cognito Your User Pool authorizer's provider ARNs. - ProviderARNs []*string `locationName:"providerARNs" type:"list"` - - // The RestApi identifier under which the Authorizer will be created. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // [Required] The type of the authorizer. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AuthorizerType"` -} - -// String returns the string representation -func (s CreateAuthorizerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAuthorizerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAuthorizerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAuthorizerInput"} - if s.IdentitySource == nil { - invalidParams.Add(request.NewErrParamRequired("IdentitySource")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthType sets the AuthType field's value. -func (s *CreateAuthorizerInput) SetAuthType(v string) *CreateAuthorizerInput { - s.AuthType = &v - return s -} - -// SetAuthorizerCredentials sets the AuthorizerCredentials field's value. -func (s *CreateAuthorizerInput) SetAuthorizerCredentials(v string) *CreateAuthorizerInput { - s.AuthorizerCredentials = &v - return s -} - -// SetAuthorizerResultTtlInSeconds sets the AuthorizerResultTtlInSeconds field's value. -func (s *CreateAuthorizerInput) SetAuthorizerResultTtlInSeconds(v int64) *CreateAuthorizerInput { - s.AuthorizerResultTtlInSeconds = &v - return s -} - -// SetAuthorizerUri sets the AuthorizerUri field's value. -func (s *CreateAuthorizerInput) SetAuthorizerUri(v string) *CreateAuthorizerInput { - s.AuthorizerUri = &v - return s -} - -// SetIdentitySource sets the IdentitySource field's value. -func (s *CreateAuthorizerInput) SetIdentitySource(v string) *CreateAuthorizerInput { - s.IdentitySource = &v - return s -} - -// SetIdentityValidationExpression sets the IdentityValidationExpression field's value. -func (s *CreateAuthorizerInput) SetIdentityValidationExpression(v string) *CreateAuthorizerInput { - s.IdentityValidationExpression = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAuthorizerInput) SetName(v string) *CreateAuthorizerInput { - s.Name = &v - return s -} - -// SetProviderARNs sets the ProviderARNs field's value. -func (s *CreateAuthorizerInput) SetProviderARNs(v []*string) *CreateAuthorizerInput { - s.ProviderARNs = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *CreateAuthorizerInput) SetRestApiId(v string) *CreateAuthorizerInput { - s.RestApiId = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateAuthorizerInput) SetType(v string) *CreateAuthorizerInput { - s.Type = &v - return s -} - -// Requests Amazon API Gateway to create a new BasePathMapping resource. -type CreateBasePathMappingInput struct { - _ struct{} `type:"structure"` - - // The base path name that callers of the API must provide as part of the URL - // after the domain name. This value must be unique for all of the mappings - // across a single API. Leave this blank if you do not want callers to specify - // a base path name after the domain name. - BasePath *string `locationName:"basePath" type:"string"` - - // The domain name of the BasePathMapping resource to create. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"domain_name" type:"string" required:"true"` - - // The name of the API that you want to apply this mapping to. - // - // RestApiId is a required field - RestApiId *string `locationName:"restApiId" type:"string" required:"true"` - - // The name of the API's stage that you want to use for this mapping. Leave - // this blank if you do not want callers to explicitly specify the stage name - // after any base path name. - Stage *string `locationName:"stage" type:"string"` -} - -// String returns the string representation -func (s CreateBasePathMappingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateBasePathMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateBasePathMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateBasePathMappingInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasePath sets the BasePath field's value. -func (s *CreateBasePathMappingInput) SetBasePath(v string) *CreateBasePathMappingInput { - s.BasePath = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *CreateBasePathMappingInput) SetDomainName(v string) *CreateBasePathMappingInput { - s.DomainName = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *CreateBasePathMappingInput) SetRestApiId(v string) *CreateBasePathMappingInput { - s.RestApiId = &v - return s -} - -// SetStage sets the Stage field's value. -func (s *CreateBasePathMappingInput) SetStage(v string) *CreateBasePathMappingInput { - s.Stage = &v - return s -} - -// Requests Amazon API Gateway to create a Deployment resource. -type CreateDeploymentInput struct { - _ struct{} `type:"structure"` - - // Enables a cache cluster for the Stage resource specified in the input. - CacheClusterEnabled *bool `locationName:"cacheClusterEnabled" type:"boolean"` - - // Specifies the cache cluster size for the Stage resource specified in the - // input, if a cache cluster is enabled. - CacheClusterSize *string `locationName:"cacheClusterSize" type:"string" enum:"CacheClusterSize"` - - // The description for the Deployment resource to create. - Description *string `locationName:"description" type:"string"` - - // The RestApi resource identifier for the Deployment resource to create. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The description of the Stage resource for the Deployment resource to create. - StageDescription *string `locationName:"stageDescription" type:"string"` - - // The name of the Stage resource for the Deployment resource to create. - StageName *string `locationName:"stageName" type:"string"` - - // A map that defines the stage variables for the Stage resource that is associated - // with the new deployment. Variable names can have alphanumeric and underscore - // characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+. - Variables map[string]*string `locationName:"variables" type:"map"` -} - -// String returns the string representation -func (s CreateDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheClusterEnabled sets the CacheClusterEnabled field's value. -func (s *CreateDeploymentInput) SetCacheClusterEnabled(v bool) *CreateDeploymentInput { - s.CacheClusterEnabled = &v - return s -} - -// SetCacheClusterSize sets the CacheClusterSize field's value. -func (s *CreateDeploymentInput) SetCacheClusterSize(v string) *CreateDeploymentInput { - s.CacheClusterSize = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDeploymentInput) SetDescription(v string) *CreateDeploymentInput { - s.Description = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *CreateDeploymentInput) SetRestApiId(v string) *CreateDeploymentInput { - s.RestApiId = &v - return s -} - -// SetStageDescription sets the StageDescription field's value. -func (s *CreateDeploymentInput) SetStageDescription(v string) *CreateDeploymentInput { - s.StageDescription = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *CreateDeploymentInput) SetStageName(v string) *CreateDeploymentInput { - s.StageName = &v - return s -} - -// SetVariables sets the Variables field's value. -func (s *CreateDeploymentInput) SetVariables(v map[string]*string) *CreateDeploymentInput { - s.Variables = v - return s -} - -// Creates a new documentation part of a given API. -type CreateDocumentationPartInput struct { - _ struct{} `type:"structure"` - - // [Required] The location of the targeted API entity of the to-be-created documentation - // part. - // - // Location is a required field - Location *DocumentationPartLocation `locationName:"location" type:"structure" required:"true"` - - // [Required] The new documentation content map of the targeted API entity. - // Enclosed key-value pairs are API-specific, but only Swagger-compliant key-value - // pairs can be exported and, hence, published. - // - // Properties is a required field - Properties *string `locationName:"properties" type:"string" required:"true"` - - // [Required] The identifier of an API of the to-be-created documentation part. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateDocumentationPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDocumentationPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDocumentationPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDocumentationPartInput"} - if s.Location == nil { - invalidParams.Add(request.NewErrParamRequired("Location")) - } - if s.Properties == nil { - invalidParams.Add(request.NewErrParamRequired("Properties")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.Location != nil { - if err := s.Location.Validate(); err != nil { - invalidParams.AddNested("Location", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLocation sets the Location field's value. -func (s *CreateDocumentationPartInput) SetLocation(v *DocumentationPartLocation) *CreateDocumentationPartInput { - s.Location = v - return s -} - -// SetProperties sets the Properties field's value. -func (s *CreateDocumentationPartInput) SetProperties(v string) *CreateDocumentationPartInput { - s.Properties = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *CreateDocumentationPartInput) SetRestApiId(v string) *CreateDocumentationPartInput { - s.RestApiId = &v - return s -} - -// Creates a new documentation version of a given API. -type CreateDocumentationVersionInput struct { - _ struct{} `type:"structure"` - - // A description about the new documentation snapshot. - Description *string `locationName:"description" type:"string"` - - // [Required] The version identifier of the new snapshot. - // - // DocumentationVersion is a required field - DocumentationVersion *string `locationName:"documentationVersion" type:"string" required:"true"` - - // [Required] Specifies the API identifier of the to-be-created documentation - // version. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The stage name to be associated with the new documentation snapshot. - StageName *string `locationName:"stageName" type:"string"` -} - -// String returns the string representation -func (s CreateDocumentationVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDocumentationVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDocumentationVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDocumentationVersionInput"} - if s.DocumentationVersion == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentationVersion")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateDocumentationVersionInput) SetDescription(v string) *CreateDocumentationVersionInput { - s.Description = &v - return s -} - -// SetDocumentationVersion sets the DocumentationVersion field's value. -func (s *CreateDocumentationVersionInput) SetDocumentationVersion(v string) *CreateDocumentationVersionInput { - s.DocumentationVersion = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *CreateDocumentationVersionInput) SetRestApiId(v string) *CreateDocumentationVersionInput { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *CreateDocumentationVersionInput) SetStageName(v string) *CreateDocumentationVersionInput { - s.StageName = &v - return s -} - -// A request to create a new domain name. -type CreateDomainNameInput struct { - _ struct{} `type:"structure"` - - // The reference to an AWS-managed certificate. AWS Certificate Manager is the - // only supported source. - CertificateArn *string `locationName:"certificateArn" type:"string"` - - // [Deprecated] The body of the server certificate provided by your certificate - // authority. - CertificateBody *string `locationName:"certificateBody" type:"string"` - - // [Deprecated] The intermediate certificates and optionally the root certificate, - // one after the other without any blank lines. If you include the root certificate, - // your certificate chain must start with intermediate certificates and end - // with the root certificate. Use the intermediate certificates that were provided - // by your certificate authority. Do not include any intermediaries that are - // not in the chain of trust path. - CertificateChain *string `locationName:"certificateChain" type:"string"` - - // The user-friendly name of the certificate. - CertificateName *string `locationName:"certificateName" type:"string"` - - // [Deprecated] Your certificate's private key. - CertificatePrivateKey *string `locationName:"certificatePrivateKey" type:"string"` - - // (Required) The name of the DomainName resource. - // - // DomainName is a required field - DomainName *string `locationName:"domainName" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateDomainNameInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDomainNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDomainNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDomainNameInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *CreateDomainNameInput) SetCertificateArn(v string) *CreateDomainNameInput { - s.CertificateArn = &v - return s -} - -// SetCertificateBody sets the CertificateBody field's value. -func (s *CreateDomainNameInput) SetCertificateBody(v string) *CreateDomainNameInput { - s.CertificateBody = &v - return s -} - -// SetCertificateChain sets the CertificateChain field's value. -func (s *CreateDomainNameInput) SetCertificateChain(v string) *CreateDomainNameInput { - s.CertificateChain = &v - return s -} - -// SetCertificateName sets the CertificateName field's value. -func (s *CreateDomainNameInput) SetCertificateName(v string) *CreateDomainNameInput { - s.CertificateName = &v - return s -} - -// SetCertificatePrivateKey sets the CertificatePrivateKey field's value. -func (s *CreateDomainNameInput) SetCertificatePrivateKey(v string) *CreateDomainNameInput { - s.CertificatePrivateKey = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *CreateDomainNameInput) SetDomainName(v string) *CreateDomainNameInput { - s.DomainName = &v - return s -} - -// Request to add a new Model to an existing RestApi resource. -type CreateModelInput struct { - _ struct{} `type:"structure"` - - // The content-type for the model. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true"` - - // The description of the model. - Description *string `locationName:"description" type:"string"` - - // The name of the model. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The RestApi identifier under which the Model will be created. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The schema for the model. For application/json models, this should be JSON-schema - // draft v4 (http://json-schema.org/documentation.html) model. - Schema *string `locationName:"schema" type:"string"` -} - -// String returns the string representation -func (s CreateModelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateModelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateModelInput"} - if s.ContentType == nil { - invalidParams.Add(request.NewErrParamRequired("ContentType")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentType sets the ContentType field's value. -func (s *CreateModelInput) SetContentType(v string) *CreateModelInput { - s.ContentType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateModelInput) SetDescription(v string) *CreateModelInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateModelInput) SetName(v string) *CreateModelInput { - s.Name = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *CreateModelInput) SetRestApiId(v string) *CreateModelInput { - s.RestApiId = &v - return s -} - -// SetSchema sets the Schema field's value. -func (s *CreateModelInput) SetSchema(v string) *CreateModelInput { - s.Schema = &v - return s -} - -// Requests Amazon API Gateway to create a Resource resource. -type CreateResourceInput struct { - _ struct{} `type:"structure"` - - // The parent resource's identifier. - // - // ParentId is a required field - ParentId *string `location:"uri" locationName:"parent_id" type:"string" required:"true"` - - // The last path segment for this resource. - // - // PathPart is a required field - PathPart *string `locationName:"pathPart" type:"string" required:"true"` - - // The identifier of the RestApi for the resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateResourceInput"} - if s.ParentId == nil { - invalidParams.Add(request.NewErrParamRequired("ParentId")) - } - if s.PathPart == nil { - invalidParams.Add(request.NewErrParamRequired("PathPart")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParentId sets the ParentId field's value. -func (s *CreateResourceInput) SetParentId(v string) *CreateResourceInput { - s.ParentId = &v - return s -} - -// SetPathPart sets the PathPart field's value. -func (s *CreateResourceInput) SetPathPart(v string) *CreateResourceInput { - s.PathPart = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *CreateResourceInput) SetRestApiId(v string) *CreateResourceInput { - s.RestApiId = &v - return s -} - -// The POST Request to add a new RestApi resource to your collection. -type CreateRestApiInput struct { - _ struct{} `type:"structure"` - - // The list of binary media types supported by the RestApi. By default, the - // RestApi supports only UTF-8-encoded text payloads. - BinaryMediaTypes []*string `locationName:"binaryMediaTypes" type:"list"` - - // The ID of the RestApi that you want to clone from. - CloneFrom *string `locationName:"cloneFrom" type:"string"` - - // The description of the RestApi. - Description *string `locationName:"description" type:"string"` - - // The name of the RestApi. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // A version identifier for the API. - Version *string `locationName:"version" type:"string"` -} - -// String returns the string representation -func (s CreateRestApiInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRestApiInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRestApiInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRestApiInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBinaryMediaTypes sets the BinaryMediaTypes field's value. -func (s *CreateRestApiInput) SetBinaryMediaTypes(v []*string) *CreateRestApiInput { - s.BinaryMediaTypes = v - return s -} - -// SetCloneFrom sets the CloneFrom field's value. -func (s *CreateRestApiInput) SetCloneFrom(v string) *CreateRestApiInput { - s.CloneFrom = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateRestApiInput) SetDescription(v string) *CreateRestApiInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateRestApiInput) SetName(v string) *CreateRestApiInput { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *CreateRestApiInput) SetVersion(v string) *CreateRestApiInput { - s.Version = &v - return s -} - -// Requests Amazon API Gateway to create a Stage resource. -type CreateStageInput struct { - _ struct{} `type:"structure"` - - // Whether cache clustering is enabled for the stage. - CacheClusterEnabled *bool `locationName:"cacheClusterEnabled" type:"boolean"` - - // The stage's cache cluster size. - CacheClusterSize *string `locationName:"cacheClusterSize" type:"string" enum:"CacheClusterSize"` - - // The identifier of the Deployment resource for the Stage resource. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` - - // The description of the Stage resource. - Description *string `locationName:"description" type:"string"` - - // The version of the associated API documentation. - DocumentationVersion *string `locationName:"documentationVersion" type:"string"` - - // The identifier of the RestApi resource for the Stage resource to create. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The name for the Stage resource. - // - // StageName is a required field - StageName *string `locationName:"stageName" type:"string" required:"true"` - - // A map that defines the stage variables for the new Stage resource. Variable - // names can have alphanumeric and underscore characters, and the values must - // match [A-Za-z0-9-._~:/?#&=,]+. - Variables map[string]*string `locationName:"variables" type:"map"` -} - -// String returns the string representation -func (s CreateStageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStageInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheClusterEnabled sets the CacheClusterEnabled field's value. -func (s *CreateStageInput) SetCacheClusterEnabled(v bool) *CreateStageInput { - s.CacheClusterEnabled = &v - return s -} - -// SetCacheClusterSize sets the CacheClusterSize field's value. -func (s *CreateStageInput) SetCacheClusterSize(v string) *CreateStageInput { - s.CacheClusterSize = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *CreateStageInput) SetDeploymentId(v string) *CreateStageInput { - s.DeploymentId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateStageInput) SetDescription(v string) *CreateStageInput { - s.Description = &v - return s -} - -// SetDocumentationVersion sets the DocumentationVersion field's value. -func (s *CreateStageInput) SetDocumentationVersion(v string) *CreateStageInput { - s.DocumentationVersion = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *CreateStageInput) SetRestApiId(v string) *CreateStageInput { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *CreateStageInput) SetStageName(v string) *CreateStageInput { - s.StageName = &v - return s -} - -// SetVariables sets the Variables field's value. -func (s *CreateStageInput) SetVariables(v map[string]*string) *CreateStageInput { - s.Variables = v - return s -} - -// The POST request to create a usage plan with the name, description, throttle -// limits and quota limits, as well as the associated API stages, specified -// in the payload. -type CreateUsagePlanInput struct { - _ struct{} `type:"structure"` - - // The associated API stages of the usage plan. - ApiStages []*ApiStage `locationName:"apiStages" type:"list"` - - // The description of the usage plan. - Description *string `locationName:"description" type:"string"` - - // The name of the usage plan. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The quota of the usage plan. - Quota *QuotaSettings `locationName:"quota" type:"structure"` - - // The throttling limits of the usage plan. - Throttle *ThrottleSettings `locationName:"throttle" type:"structure"` -} - -// String returns the string representation -func (s CreateUsagePlanInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateUsagePlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUsagePlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUsagePlanInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApiStages sets the ApiStages field's value. -func (s *CreateUsagePlanInput) SetApiStages(v []*ApiStage) *CreateUsagePlanInput { - s.ApiStages = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateUsagePlanInput) SetDescription(v string) *CreateUsagePlanInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateUsagePlanInput) SetName(v string) *CreateUsagePlanInput { - s.Name = &v - return s -} - -// SetQuota sets the Quota field's value. -func (s *CreateUsagePlanInput) SetQuota(v *QuotaSettings) *CreateUsagePlanInput { - s.Quota = v - return s -} - -// SetThrottle sets the Throttle field's value. -func (s *CreateUsagePlanInput) SetThrottle(v *ThrottleSettings) *CreateUsagePlanInput { - s.Throttle = v - return s -} - -// The POST request to create a usage plan key for adding an existing API key -// to a usage plan. -type CreateUsagePlanKeyInput struct { - _ struct{} `type:"structure"` - - // The identifier of a UsagePlanKey resource for a plan customer. - // - // KeyId is a required field - KeyId *string `locationName:"keyId" type:"string" required:"true"` - - // The type of a UsagePlanKey resource for a plan customer. - // - // KeyType is a required field - KeyType *string `locationName:"keyType" type:"string" required:"true"` - - // The Id of the UsagePlan resource representing the usage plan containing the - // to-be-created UsagePlanKey resource representing a plan customer. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateUsagePlanKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateUsagePlanKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUsagePlanKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUsagePlanKeyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyType == nil { - invalidParams.Add(request.NewErrParamRequired("KeyType")) - } - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *CreateUsagePlanKeyInput) SetKeyId(v string) *CreateUsagePlanKeyInput { - s.KeyId = &v - return s -} - -// SetKeyType sets the KeyType field's value. -func (s *CreateUsagePlanKeyInput) SetKeyType(v string) *CreateUsagePlanKeyInput { - s.KeyType = &v - return s -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *CreateUsagePlanKeyInput) SetUsagePlanId(v string) *CreateUsagePlanKeyInput { - s.UsagePlanId = &v - return s -} - -// A request to delete the ApiKey resource. -type DeleteApiKeyInput struct { - _ struct{} `type:"structure"` - - // The identifier of the ApiKey resource to be deleted. - // - // ApiKey is a required field - ApiKey *string `location:"uri" locationName:"api_Key" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteApiKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteApiKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApiKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApiKeyInput"} - if s.ApiKey == nil { - invalidParams.Add(request.NewErrParamRequired("ApiKey")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApiKey sets the ApiKey field's value. -func (s *DeleteApiKeyInput) SetApiKey(v string) *DeleteApiKeyInput { - s.ApiKey = &v - return s -} - -type DeleteApiKeyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteApiKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteApiKeyOutput) GoString() string { - return s.String() -} - -// Request to delete an existing Authorizer resource. -type DeleteAuthorizerInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Authorizer resource. - // - // AuthorizerId is a required field - AuthorizerId *string `location:"uri" locationName:"authorizer_id" type:"string" required:"true"` - - // The RestApi identifier for the Authorizer resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAuthorizerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAuthorizerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAuthorizerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAuthorizerInput"} - if s.AuthorizerId == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizerId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthorizerId sets the AuthorizerId field's value. -func (s *DeleteAuthorizerInput) SetAuthorizerId(v string) *DeleteAuthorizerInput { - s.AuthorizerId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteAuthorizerInput) SetRestApiId(v string) *DeleteAuthorizerInput { - s.RestApiId = &v - return s -} - -type DeleteAuthorizerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAuthorizerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAuthorizerOutput) GoString() string { - return s.String() -} - -// A request to delete the BasePathMapping resource. -type DeleteBasePathMappingInput struct { - _ struct{} `type:"structure"` - - // The base path name of the BasePathMapping resource to delete. - // - // BasePath is a required field - BasePath *string `location:"uri" locationName:"base_path" type:"string" required:"true"` - - // The domain name of the BasePathMapping resource to delete. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"domain_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBasePathMappingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBasePathMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBasePathMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBasePathMappingInput"} - if s.BasePath == nil { - invalidParams.Add(request.NewErrParamRequired("BasePath")) - } - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasePath sets the BasePath field's value. -func (s *DeleteBasePathMappingInput) SetBasePath(v string) *DeleteBasePathMappingInput { - s.BasePath = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *DeleteBasePathMappingInput) SetDomainName(v string) *DeleteBasePathMappingInput { - s.DomainName = &v - return s -} - -type DeleteBasePathMappingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBasePathMappingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBasePathMappingOutput) GoString() string { - return s.String() -} - -// A request to delete the ClientCertificate resource. -type DeleteClientCertificateInput struct { - _ struct{} `type:"structure"` - - // The identifier of the ClientCertificate resource to be deleted. - // - // ClientCertificateId is a required field - ClientCertificateId *string `location:"uri" locationName:"clientcertificate_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteClientCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClientCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClientCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClientCertificateInput"} - if s.ClientCertificateId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientCertificateId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientCertificateId sets the ClientCertificateId field's value. -func (s *DeleteClientCertificateInput) SetClientCertificateId(v string) *DeleteClientCertificateInput { - s.ClientCertificateId = &v - return s -} - -type DeleteClientCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteClientCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClientCertificateOutput) GoString() string { - return s.String() -} - -// Requests Amazon API Gateway to delete a Deployment resource. -type DeleteDeploymentInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Deployment resource to delete. - // - // DeploymentId is a required field - DeploymentId *string `location:"uri" locationName:"deployment_id" type:"string" required:"true"` - - // The identifier of the RestApi resource for the Deployment resource to delete. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDeploymentInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *DeleteDeploymentInput) SetDeploymentId(v string) *DeleteDeploymentInput { - s.DeploymentId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteDeploymentInput) SetRestApiId(v string) *DeleteDeploymentInput { - s.RestApiId = &v - return s -} - -type DeleteDeploymentOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDeploymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeploymentOutput) GoString() string { - return s.String() -} - -// Deletes an existing documentation part of an API. -type DeleteDocumentationPartInput struct { - _ struct{} `type:"structure"` - - // [Required] The identifier of the to-be-deleted documentation part. - // - // DocumentationPartId is a required field - DocumentationPartId *string `location:"uri" locationName:"part_id" type:"string" required:"true"` - - // [Required] Specifies the identifier of an API of the to-be-deleted documentation - // part. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDocumentationPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDocumentationPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDocumentationPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDocumentationPartInput"} - if s.DocumentationPartId == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentationPartId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentationPartId sets the DocumentationPartId field's value. -func (s *DeleteDocumentationPartInput) SetDocumentationPartId(v string) *DeleteDocumentationPartInput { - s.DocumentationPartId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteDocumentationPartInput) SetRestApiId(v string) *DeleteDocumentationPartInput { - s.RestApiId = &v - return s -} - -type DeleteDocumentationPartOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDocumentationPartOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDocumentationPartOutput) GoString() string { - return s.String() -} - -// Deletes an existing documentation version of an API. -type DeleteDocumentationVersionInput struct { - _ struct{} `type:"structure"` - - // [Required] The version identifier of a to-be-deleted documentation snapshot. - // - // DocumentationVersion is a required field - DocumentationVersion *string `location:"uri" locationName:"doc_version" type:"string" required:"true"` - - // [Required] The identifier of an API of a to-be-deleted documentation snapshot. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDocumentationVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDocumentationVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDocumentationVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDocumentationVersionInput"} - if s.DocumentationVersion == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentationVersion")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentationVersion sets the DocumentationVersion field's value. -func (s *DeleteDocumentationVersionInput) SetDocumentationVersion(v string) *DeleteDocumentationVersionInput { - s.DocumentationVersion = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteDocumentationVersionInput) SetRestApiId(v string) *DeleteDocumentationVersionInput { - s.RestApiId = &v - return s -} - -type DeleteDocumentationVersionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDocumentationVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDocumentationVersionOutput) GoString() string { - return s.String() -} - -// A request to delete the DomainName resource. -type DeleteDomainNameInput struct { - _ struct{} `type:"structure"` - - // The name of the DomainName resource to be deleted. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"domain_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDomainNameInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDomainNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDomainNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDomainNameInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DeleteDomainNameInput) SetDomainName(v string) *DeleteDomainNameInput { - s.DomainName = &v - return s -} - -type DeleteDomainNameOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDomainNameOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDomainNameOutput) GoString() string { - return s.String() -} - -// Represents a delete integration request. -type DeleteIntegrationInput struct { - _ struct{} `type:"structure"` - - // Specifies a delete integration request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // Specifies a delete integration request's resource identifier. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Specifies a delete integration request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteIntegrationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIntegrationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIntegrationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIntegrationInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *DeleteIntegrationInput) SetHttpMethod(v string) *DeleteIntegrationInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DeleteIntegrationInput) SetResourceId(v string) *DeleteIntegrationInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteIntegrationInput) SetRestApiId(v string) *DeleteIntegrationInput { - s.RestApiId = &v - return s -} - -type DeleteIntegrationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteIntegrationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIntegrationOutput) GoString() string { - return s.String() -} - -// Represents a delete integration response request. -type DeleteIntegrationResponseInput struct { - _ struct{} `type:"structure"` - - // Specifies a delete integration response request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // Specifies a delete integration response request's resource identifier. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Specifies a delete integration response request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // Specifies a delete integration response request's status code. - // - // StatusCode is a required field - StatusCode *string `location:"uri" locationName:"status_code" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteIntegrationResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIntegrationResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIntegrationResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIntegrationResponseInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *DeleteIntegrationResponseInput) SetHttpMethod(v string) *DeleteIntegrationResponseInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DeleteIntegrationResponseInput) SetResourceId(v string) *DeleteIntegrationResponseInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteIntegrationResponseInput) SetRestApiId(v string) *DeleteIntegrationResponseInput { - s.RestApiId = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *DeleteIntegrationResponseInput) SetStatusCode(v string) *DeleteIntegrationResponseInput { - s.StatusCode = &v - return s -} - -type DeleteIntegrationResponseOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteIntegrationResponseOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIntegrationResponseOutput) GoString() string { - return s.String() -} - -// Request to delete an existing Method resource. -type DeleteMethodInput struct { - _ struct{} `type:"structure"` - - // The HTTP verb of the Method resource. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // The Resource identifier for the Method resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the Method resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMethodInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMethodInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMethodInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMethodInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *DeleteMethodInput) SetHttpMethod(v string) *DeleteMethodInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DeleteMethodInput) SetResourceId(v string) *DeleteMethodInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteMethodInput) SetRestApiId(v string) *DeleteMethodInput { - s.RestApiId = &v - return s -} - -type DeleteMethodOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteMethodOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMethodOutput) GoString() string { - return s.String() -} - -// A request to delete an existing MethodResponse resource. -type DeleteMethodResponseInput struct { - _ struct{} `type:"structure"` - - // The HTTP verb of the Method resource. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // The Resource identifier for the MethodResponse resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the MethodResponse resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The status code identifier for the MethodResponse resource. - // - // StatusCode is a required field - StatusCode *string `location:"uri" locationName:"status_code" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMethodResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMethodResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMethodResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMethodResponseInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *DeleteMethodResponseInput) SetHttpMethod(v string) *DeleteMethodResponseInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DeleteMethodResponseInput) SetResourceId(v string) *DeleteMethodResponseInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteMethodResponseInput) SetRestApiId(v string) *DeleteMethodResponseInput { - s.RestApiId = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *DeleteMethodResponseInput) SetStatusCode(v string) *DeleteMethodResponseInput { - s.StatusCode = &v - return s -} - -type DeleteMethodResponseOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteMethodResponseOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMethodResponseOutput) GoString() string { - return s.String() -} - -// Request to delete an existing model in an existing RestApi resource. -type DeleteModelInput struct { - _ struct{} `type:"structure"` - - // The name of the model to delete. - // - // ModelName is a required field - ModelName *string `location:"uri" locationName:"model_name" type:"string" required:"true"` - - // The RestApi under which the model will be deleted. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteModelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteModelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteModelInput"} - if s.ModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelName")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetModelName sets the ModelName field's value. -func (s *DeleteModelInput) SetModelName(v string) *DeleteModelInput { - s.ModelName = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteModelInput) SetRestApiId(v string) *DeleteModelInput { - s.RestApiId = &v - return s -} - -type DeleteModelOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteModelOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteModelOutput) GoString() string { - return s.String() -} - -// Request to delete a Resource. -type DeleteResourceInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Resource resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the Resource resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *DeleteResourceInput) SetResourceId(v string) *DeleteResourceInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteResourceInput) SetRestApiId(v string) *DeleteResourceInput { - s.RestApiId = &v - return s -} - -type DeleteResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteResourceOutput) GoString() string { - return s.String() -} - -// Request to delete the specified API from your collection. -type DeleteRestApiInput struct { - _ struct{} `type:"structure"` - - // The ID of the RestApi you want to delete. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRestApiInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRestApiInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRestApiInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRestApiInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteRestApiInput) SetRestApiId(v string) *DeleteRestApiInput { - s.RestApiId = &v - return s -} - -type DeleteRestApiOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRestApiOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRestApiOutput) GoString() string { - return s.String() -} - -// Requests Amazon API Gateway to delete a Stage resource. -type DeleteStageInput struct { - _ struct{} `type:"structure"` - - // The identifier of the RestApi resource for the Stage resource to delete. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The name of the Stage resource to delete. - // - // StageName is a required field - StageName *string `location:"uri" locationName:"stage_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteStageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStageInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRestApiId sets the RestApiId field's value. -func (s *DeleteStageInput) SetRestApiId(v string) *DeleteStageInput { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *DeleteStageInput) SetStageName(v string) *DeleteStageInput { - s.StageName = &v - return s -} - -type DeleteStageOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteStageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStageOutput) GoString() string { - return s.String() -} - -// The DELETE request to delete a uasge plan of a given plan Id. -type DeleteUsagePlanInput struct { - _ struct{} `type:"structure"` - - // The Id of the to-be-deleted usage plan. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteUsagePlanInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUsagePlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUsagePlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUsagePlanInput"} - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *DeleteUsagePlanInput) SetUsagePlanId(v string) *DeleteUsagePlanInput { - s.UsagePlanId = &v - return s -} - -// The DELETE request to delete a usage plan key and remove the underlying API -// key from the associated usage plan. -type DeleteUsagePlanKeyInput struct { - _ struct{} `type:"structure"` - - // The Id of the UsagePlanKey resource to be deleted. - // - // KeyId is a required field - KeyId *string `location:"uri" locationName:"keyId" type:"string" required:"true"` - - // The Id of the UsagePlan resource representing the usage plan containing the - // to-be-deleted UsagePlanKey resource representing a plan customer. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteUsagePlanKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUsagePlanKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUsagePlanKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUsagePlanKeyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *DeleteUsagePlanKeyInput) SetKeyId(v string) *DeleteUsagePlanKeyInput { - s.KeyId = &v - return s -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *DeleteUsagePlanKeyInput) SetUsagePlanId(v string) *DeleteUsagePlanKeyInput { - s.UsagePlanId = &v - return s -} - -type DeleteUsagePlanKeyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteUsagePlanKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUsagePlanKeyOutput) GoString() string { - return s.String() -} - -type DeleteUsagePlanOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteUsagePlanOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUsagePlanOutput) GoString() string { - return s.String() -} - -// An immutable representation of a RestApi resource that can be called by users -// using Stages. A deployment must be associated with a Stage for it to be callable -// over the Internet. -// -// To create a deployment, call POST on the Deployments resource of a RestApi. -// To view, update, or delete a deployment, call GET, PATCH, or DELETE on the -// specified deployment resource (/restapis/{restapi_id}/deployments/{deployment_id}). -// -// RestApi, Deployments, Stage, AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/get-deployment.html), -// AWS SDKs (https://aws.amazon.com/tools/) -type Deployment struct { - _ struct{} `type:"structure"` - - // A summary of the RestApi at the date and time that the deployment resource - // was created. - ApiSummary map[string]map[string]*MethodSnapshot `locationName:"apiSummary" type:"map"` - - // The date and time that the deployment resource was created. - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"` - - // The description for the deployment resource. - Description *string `locationName:"description" type:"string"` - - // The identifier for the deployment resource. - Id *string `locationName:"id" type:"string"` -} - -// String returns the string representation -func (s Deployment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Deployment) GoString() string { - return s.String() -} - -// SetApiSummary sets the ApiSummary field's value. -func (s *Deployment) SetApiSummary(v map[string]map[string]*MethodSnapshot) *Deployment { - s.ApiSummary = v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *Deployment) SetCreatedDate(v time.Time) *Deployment { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Deployment) SetDescription(v string) *Deployment { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *Deployment) SetId(v string) *Deployment { - s.Id = &v - return s -} - -// A documentation part for a targeted API entity. -// -// A documentation part consists of a content map (properties) and a target -// (location). The target specifies an API entity to which the documentation -// content applies. The supported API entity types are API, AUTHORIZER, MODEL, -// RESOURCE, METHOD, PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, -// RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. Valid location fields depend -// on the API entity type. All valid fields are not required. -// -// The content map is a JSON string of API-specific key-value pairs. Although -// an API can use any shape for the content map, only the Swagger-compliant -// documentation fields will be injected into the associated API entity definition -// in the exported Swagger definition file. -// -// Documenting an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-documenting-api.html), -// DocumentationParts -type DocumentationPart struct { - _ struct{} `type:"structure"` - - // The DocumentationPart identifier, generated by Amazon API Gateway when the - // DocumentationPart is created. - Id *string `locationName:"id" type:"string"` - - // The location of the API entity to which the documentation applies. Valid - // fields depend on the targeted API entity type. All the valid location fields - // are not required. If not explicitly specified, a valid location field is - // treated as a wildcard and associated documentation content may be inherited - // by matching entities, unless overridden. - Location *DocumentationPartLocation `locationName:"location" type:"structure"` - - // A content map of API-specific key-value pairs describing the targeted API - // entity. The map must be encoded as a JSON string, e.g., "{ \"description\": - // \"The API does ...\" }". Only Swagger-compliant documentation-related fields - // from the properties map are exported and, hence, published as part of the - // API entity definitions, while the original documentation parts are exported - // in a Swagger extension of x-amazon-apigateway-documentation. - Properties *string `locationName:"properties" type:"string"` -} - -// String returns the string representation -func (s DocumentationPart) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentationPart) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *DocumentationPart) SetId(v string) *DocumentationPart { - s.Id = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *DocumentationPart) SetLocation(v *DocumentationPartLocation) *DocumentationPart { - s.Location = v - return s -} - -// SetProperties sets the Properties field's value. -func (s *DocumentationPart) SetProperties(v string) *DocumentationPart { - s.Properties = &v - return s -} - -// Specifies the target API entity to which the documentation applies. -type DocumentationPartLocation struct { - _ struct{} `type:"structure"` - - // The HTTP verb of a method. It is a valid field for the API entity types of - // METHOD, PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, - // RESPONSE_HEADER, and RESPONSE_BODY. The default value is * for any method. - // When an applicable child entity inherits the content of an entity of the - // same type with more general specifications of the other location attributes, - // the child entity's method attribute must match that of the parent entity - // exactly. - Method *string `locationName:"method" type:"string"` - - // The name of the targeted API entity. It is a valid and required field for - // the API entity types of AUTHORIZER, MODEL, PATH_PARAMETER, QUERY_PARAMETER, - // REQUEST_HEADER, REQUEST_BODY and RESPONSE_HEADER. It is an invalid field - // for any other entity type. - Name *string `locationName:"name" type:"string"` - - // The URL path of the target. It is a valid field for the API entity types - // of RESOURCE, METHOD, PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, - // RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. The default value is / for - // the root resource. When an applicable child entity inherits the content of - // another entity of the same type with more general specifications of the other - // location attributes, the child entity's path attribute must match that of - // the parent entity as a prefix. - Path *string `locationName:"path" type:"string"` - - // The HTTP status code of a response. It is a valid field for the API entity - // types of RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. The default value - // is * for any status code. When an applicable child entity inherits the content - // of an entity of the same type with more general specifications of the other - // location attributes, the child entity's statusCode attribute must match that - // of the parent entity exactly. - StatusCode *string `locationName:"statusCode" type:"string"` - - // The type of API entity to which the documentation content applies. It is - // a valid and required field for API entity types of API, AUTHORIZER, MODEL, - // RESOURCE, METHOD, PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, - // RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. Content inheritance does not - // apply to any entity of the API, AUTHROZER, METHOD, MODEL, REQUEST_BODY, or - // RESOURCE type. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"DocumentationPartType"` -} - -// String returns the string representation -func (s DocumentationPartLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentationPartLocation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DocumentationPartLocation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DocumentationPartLocation"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMethod sets the Method field's value. -func (s *DocumentationPartLocation) SetMethod(v string) *DocumentationPartLocation { - s.Method = &v - return s -} - -// SetName sets the Name field's value. -func (s *DocumentationPartLocation) SetName(v string) *DocumentationPartLocation { - s.Name = &v - return s -} - -// SetPath sets the Path field's value. -func (s *DocumentationPartLocation) SetPath(v string) *DocumentationPartLocation { - s.Path = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *DocumentationPartLocation) SetStatusCode(v string) *DocumentationPartLocation { - s.StatusCode = &v - return s -} - -// SetType sets the Type field's value. -func (s *DocumentationPartLocation) SetType(v string) *DocumentationPartLocation { - s.Type = &v - return s -} - -// A snapshot of the documentation of an API. -// -// Publishing API documentation involves creating a documentation version associated -// with an API stage and exporting the versioned documentation to an external -// (e.g., Swagger) file. -// -// Documenting an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-documenting-api.html), -// DocumentationPart, DocumentationVersions -type DocumentationVersion struct { - _ struct{} `type:"structure"` - - // The date when the API documentation snapshot is created. - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"` - - // The description of the API documentation snapshot. - Description *string `locationName:"description" type:"string"` - - // The version identifier of the API documentation snapshot. - Version *string `locationName:"version" type:"string"` -} - -// String returns the string representation -func (s DocumentationVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentationVersion) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *DocumentationVersion) SetCreatedDate(v time.Time) *DocumentationVersion { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DocumentationVersion) SetDescription(v string) *DocumentationVersion { - s.Description = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *DocumentationVersion) SetVersion(v string) *DocumentationVersion { - s.Version = &v - return s -} - -// Represents a domain name that is contained in a simpler, more intuitive URL -// that can be called. -// -// Use Client-Side Certificate (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html) -type DomainName struct { - _ struct{} `type:"structure"` - - // The reference to an AWS-managed certificate. AWS Certificate Manager is the - // only supported source. - CertificateArn *string `locationName:"certificateArn" type:"string"` - - // The name of the certificate. - CertificateName *string `locationName:"certificateName" type:"string"` - - // The timestamp when the certificate was uploaded. - CertificateUploadDate *time.Time `locationName:"certificateUploadDate" type:"timestamp" timestampFormat:"unix"` - - // The domain name of the Amazon CloudFront distribution. For more information, - // see the Amazon CloudFront documentation (http://aws.amazon.com/documentation/cloudfront/). - DistributionDomainName *string `locationName:"distributionDomainName" type:"string"` - - // The name of the DomainName resource. - DomainName *string `locationName:"domainName" type:"string"` -} - -// String returns the string representation -func (s DomainName) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DomainName) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *DomainName) SetCertificateArn(v string) *DomainName { - s.CertificateArn = &v - return s -} - -// SetCertificateName sets the CertificateName field's value. -func (s *DomainName) SetCertificateName(v string) *DomainName { - s.CertificateName = &v - return s -} - -// SetCertificateUploadDate sets the CertificateUploadDate field's value. -func (s *DomainName) SetCertificateUploadDate(v time.Time) *DomainName { - s.CertificateUploadDate = &v - return s -} - -// SetDistributionDomainName sets the DistributionDomainName field's value. -func (s *DomainName) SetDistributionDomainName(v string) *DomainName { - s.DistributionDomainName = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *DomainName) SetDomainName(v string) *DomainName { - s.DomainName = &v - return s -} - -// Request to flush authorizer cache entries on a specified stage. -type FlushStageAuthorizersCacheInput struct { - _ struct{} `type:"structure"` - - // The API identifier of the stage to flush. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The name of the stage to flush. - // - // StageName is a required field - StageName *string `location:"uri" locationName:"stage_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s FlushStageAuthorizersCacheInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FlushStageAuthorizersCacheInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FlushStageAuthorizersCacheInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FlushStageAuthorizersCacheInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRestApiId sets the RestApiId field's value. -func (s *FlushStageAuthorizersCacheInput) SetRestApiId(v string) *FlushStageAuthorizersCacheInput { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *FlushStageAuthorizersCacheInput) SetStageName(v string) *FlushStageAuthorizersCacheInput { - s.StageName = &v - return s -} - -type FlushStageAuthorizersCacheOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s FlushStageAuthorizersCacheOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FlushStageAuthorizersCacheOutput) GoString() string { - return s.String() -} - -// Requests Amazon API Gateway to flush a stage's cache. -type FlushStageCacheInput struct { - _ struct{} `type:"structure"` - - // The API identifier of the stage to flush its cache. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The name of the stage to flush its cache. - // - // StageName is a required field - StageName *string `location:"uri" locationName:"stage_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s FlushStageCacheInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FlushStageCacheInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FlushStageCacheInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FlushStageCacheInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRestApiId sets the RestApiId field's value. -func (s *FlushStageCacheInput) SetRestApiId(v string) *FlushStageCacheInput { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *FlushStageCacheInput) SetStageName(v string) *FlushStageCacheInput { - s.StageName = &v - return s -} - -type FlushStageCacheOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s FlushStageCacheOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FlushStageCacheOutput) GoString() string { - return s.String() -} - -// A request to generate a ClientCertificate resource. -type GenerateClientCertificateInput struct { - _ struct{} `type:"structure"` - - // The description of the ClientCertificate. - Description *string `locationName:"description" type:"string"` -} - -// String returns the string representation -func (s GenerateClientCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateClientCertificateInput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *GenerateClientCertificateInput) SetDescription(v string) *GenerateClientCertificateInput { - s.Description = &v - return s -} - -// Requests Amazon API Gateway to get information about the current Account -// resource. -type GetAccountInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountInput) GoString() string { - return s.String() -} - -// A request to get information about the current ApiKey resource. -type GetApiKeyInput struct { - _ struct{} `type:"structure"` - - // The identifier of the ApiKey resource. - // - // ApiKey is a required field - ApiKey *string `location:"uri" locationName:"api_Key" type:"string" required:"true"` - - // A boolean flag to specify whether (true) or not (false) the result contains - // the key value. - IncludeValue *bool `location:"querystring" locationName:"includeValue" type:"boolean"` -} - -// String returns the string representation -func (s GetApiKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetApiKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetApiKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApiKeyInput"} - if s.ApiKey == nil { - invalidParams.Add(request.NewErrParamRequired("ApiKey")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApiKey sets the ApiKey field's value. -func (s *GetApiKeyInput) SetApiKey(v string) *GetApiKeyInput { - s.ApiKey = &v - return s -} - -// SetIncludeValue sets the IncludeValue field's value. -func (s *GetApiKeyInput) SetIncludeValue(v bool) *GetApiKeyInput { - s.IncludeValue = &v - return s -} - -// A request to get information about the current ApiKeys resource. -type GetApiKeysInput struct { - _ struct{} `type:"structure"` - - // The identifier of a customer in AWS Marketplace or an external system, such - // as a developer portal. - CustomerId *string `location:"querystring" locationName:"customerId" type:"string"` - - // A boolean flag to specify whether (true) or not (false) the result contains - // key values. - IncludeValues *bool `location:"querystring" locationName:"includeValues" type:"boolean"` - - // The maximum number of ApiKeys to get information about. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The name of queried API keys. - NameQuery *string `location:"querystring" locationName:"name" type:"string"` - - // The position of the current ApiKeys resource to get information about. - Position *string `location:"querystring" locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetApiKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetApiKeysInput) GoString() string { - return s.String() -} - -// SetCustomerId sets the CustomerId field's value. -func (s *GetApiKeysInput) SetCustomerId(v string) *GetApiKeysInput { - s.CustomerId = &v - return s -} - -// SetIncludeValues sets the IncludeValues field's value. -func (s *GetApiKeysInput) SetIncludeValues(v bool) *GetApiKeysInput { - s.IncludeValues = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *GetApiKeysInput) SetLimit(v int64) *GetApiKeysInput { - s.Limit = &v - return s -} - -// SetNameQuery sets the NameQuery field's value. -func (s *GetApiKeysInput) SetNameQuery(v string) *GetApiKeysInput { - s.NameQuery = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetApiKeysInput) SetPosition(v string) *GetApiKeysInput { - s.Position = &v - return s -} - -// Represents a collection of API keys as represented by an ApiKeys resource. -// -// Use API Keys (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-api-keys.html) -type GetApiKeysOutput struct { - _ struct{} `type:"structure"` - - // The current page of any ApiKey resources in the collection of ApiKey resources. - Items []*ApiKey `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` - - // A list of warning messages logged during the import of API keys when the - // failOnWarnings option is set to true. - Warnings []*string `locationName:"warnings" type:"list"` -} - -// String returns the string representation -func (s GetApiKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetApiKeysOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetApiKeysOutput) SetItems(v []*ApiKey) *GetApiKeysOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetApiKeysOutput) SetPosition(v string) *GetApiKeysOutput { - s.Position = &v - return s -} - -// SetWarnings sets the Warnings field's value. -func (s *GetApiKeysOutput) SetWarnings(v []*string) *GetApiKeysOutput { - s.Warnings = v - return s -} - -// Request to describe an existing Authorizer resource. -type GetAuthorizerInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Authorizer resource. - // - // AuthorizerId is a required field - AuthorizerId *string `location:"uri" locationName:"authorizer_id" type:"string" required:"true"` - - // The RestApi identifier for the Authorizer resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetAuthorizerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAuthorizerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAuthorizerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAuthorizerInput"} - if s.AuthorizerId == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizerId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthorizerId sets the AuthorizerId field's value. -func (s *GetAuthorizerInput) SetAuthorizerId(v string) *GetAuthorizerInput { - s.AuthorizerId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetAuthorizerInput) SetRestApiId(v string) *GetAuthorizerInput { - s.RestApiId = &v - return s -} - -// Request to describe an existing Authorizers resource. -type GetAuthorizersInput struct { - _ struct{} `type:"structure"` - - // Limit the number of Authorizer resources in the response. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // If not all Authorizer resources in the response were present, the position - // will specify where to start the next page of results. - Position *string `location:"querystring" locationName:"position" type:"string"` - - // The RestApi identifier for the Authorizers resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetAuthorizersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAuthorizersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAuthorizersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAuthorizersInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *GetAuthorizersInput) SetLimit(v int64) *GetAuthorizersInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetAuthorizersInput) SetPosition(v string) *GetAuthorizersInput { - s.Position = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetAuthorizersInput) SetRestApiId(v string) *GetAuthorizersInput { - s.RestApiId = &v - return s -} - -// Represents a collection of Authorizer resources. -// -// Enable custom authorization (http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html) -type GetAuthorizersOutput struct { - _ struct{} `type:"structure"` - - // Gets the current list of Authorizer resources in the collection. - Items []*Authorizer `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetAuthorizersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAuthorizersOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetAuthorizersOutput) SetItems(v []*Authorizer) *GetAuthorizersOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetAuthorizersOutput) SetPosition(v string) *GetAuthorizersOutput { - s.Position = &v - return s -} - -// Request to describe a BasePathMapping resource. -type GetBasePathMappingInput struct { - _ struct{} `type:"structure"` - - // The base path name that callers of the API must provide as part of the URL - // after the domain name. This value must be unique for all of the mappings - // across a single API. Leave this blank if you do not want callers to specify - // any base path name after the domain name. - // - // BasePath is a required field - BasePath *string `location:"uri" locationName:"base_path" type:"string" required:"true"` - - // The domain name of the BasePathMapping resource to be described. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"domain_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBasePathMappingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBasePathMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBasePathMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBasePathMappingInput"} - if s.BasePath == nil { - invalidParams.Add(request.NewErrParamRequired("BasePath")) - } - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasePath sets the BasePath field's value. -func (s *GetBasePathMappingInput) SetBasePath(v string) *GetBasePathMappingInput { - s.BasePath = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *GetBasePathMappingInput) SetDomainName(v string) *GetBasePathMappingInput { - s.DomainName = &v - return s -} - -// A request to get information about a collection of BasePathMapping resources. -type GetBasePathMappingsInput struct { - _ struct{} `type:"structure"` - - // The domain name of a BasePathMapping resource. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"domain_name" type:"string" required:"true"` - - // The maximum number of BasePathMapping resources in the collection to get - // information about. The default limit is 25. It should be an integer between - // 1 - 500. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the current BasePathMapping resource in the collection to - // get information about. - Position *string `location:"querystring" locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetBasePathMappingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBasePathMappingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBasePathMappingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBasePathMappingsInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *GetBasePathMappingsInput) SetDomainName(v string) *GetBasePathMappingsInput { - s.DomainName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *GetBasePathMappingsInput) SetLimit(v int64) *GetBasePathMappingsInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetBasePathMappingsInput) SetPosition(v string) *GetBasePathMappingsInput { - s.Position = &v - return s -} - -// Represents a collection of BasePathMapping resources. -// -// Use Custom Domain Names (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html) -type GetBasePathMappingsOutput struct { - _ struct{} `type:"structure"` - - // The current page of any BasePathMapping resources in the collection of base - // path mapping resources. - Items []*BasePathMapping `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetBasePathMappingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBasePathMappingsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetBasePathMappingsOutput) SetItems(v []*BasePathMapping) *GetBasePathMappingsOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetBasePathMappingsOutput) SetPosition(v string) *GetBasePathMappingsOutput { - s.Position = &v - return s -} - -// A request to get information about the current ClientCertificate resource. -type GetClientCertificateInput struct { - _ struct{} `type:"structure"` - - // The identifier of the ClientCertificate resource to be described. - // - // ClientCertificateId is a required field - ClientCertificateId *string `location:"uri" locationName:"clientcertificate_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetClientCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetClientCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetClientCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetClientCertificateInput"} - if s.ClientCertificateId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientCertificateId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientCertificateId sets the ClientCertificateId field's value. -func (s *GetClientCertificateInput) SetClientCertificateId(v string) *GetClientCertificateInput { - s.ClientCertificateId = &v - return s -} - -// A request to get information about a collection of ClientCertificate resources. -type GetClientCertificatesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of ClientCertificate resources in the collection to get - // information about. The default limit is 25. It should be an integer between - // 1 - 500. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the current ClientCertificate resource in the collection - // to get information about. - Position *string `location:"querystring" locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetClientCertificatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetClientCertificatesInput) GoString() string { - return s.String() -} - -// SetLimit sets the Limit field's value. -func (s *GetClientCertificatesInput) SetLimit(v int64) *GetClientCertificatesInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetClientCertificatesInput) SetPosition(v string) *GetClientCertificatesInput { - s.Position = &v - return s -} - -// Represents a collection of ClientCertificate resources. -// -// Use Client-Side Certificate (http://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-client-side-ssl-authentication.html) -type GetClientCertificatesOutput struct { - _ struct{} `type:"structure"` - - // The current page of any ClientCertificate resources in the collection of - // ClientCertificate resources. - Items []*ClientCertificate `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetClientCertificatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetClientCertificatesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetClientCertificatesOutput) SetItems(v []*ClientCertificate) *GetClientCertificatesOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetClientCertificatesOutput) SetPosition(v string) *GetClientCertificatesOutput { - s.Position = &v - return s -} - -// Requests Amazon API Gateway to get information about a Deployment resource. -type GetDeploymentInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Deployment resource to get information about. - // - // DeploymentId is a required field - DeploymentId *string `location:"uri" locationName:"deployment_id" type:"string" required:"true"` - - // The identifier of the RestApi resource for the Deployment resource to get - // information about. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeploymentInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentInput) SetDeploymentId(v string) *GetDeploymentInput { - s.DeploymentId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetDeploymentInput) SetRestApiId(v string) *GetDeploymentInput { - s.RestApiId = &v - return s -} - -// Requests Amazon API Gateway to get information about a Deployments collection. -type GetDeploymentsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of Deployment resources in the collection to get information - // about. The default limit is 25. It should be an integer between 1 - 500. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the current Deployment resource in the collection to get - // information about. - Position *string `location:"querystring" locationName:"position" type:"string"` - - // The identifier of the RestApi resource for the collection of Deployment resources - // to get information about. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDeploymentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeploymentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeploymentsInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *GetDeploymentsInput) SetLimit(v int64) *GetDeploymentsInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetDeploymentsInput) SetPosition(v string) *GetDeploymentsInput { - s.Position = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetDeploymentsInput) SetRestApiId(v string) *GetDeploymentsInput { - s.RestApiId = &v - return s -} - -// Represents a collection resource that contains zero or more references to -// your existing deployments, and links that guide you on how to interact with -// your collection. The collection offers a paginated view of the contained -// deployments. -// -// To create a new deployment of a RestApi, make a POST request against this -// resource. To view, update, or delete an existing deployment, make a GET, -// PATCH, or DELETE request, respectively, on a specified Deployment resource. -// -// Deploying an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-deploy-api.html), -// AWS CLI (http://docs.aws.amazon.com/cli/latest/reference/apigateway/get-deployment.html), -// AWS SDKs (https://aws.amazon.com/tools/) -type GetDeploymentsOutput struct { - _ struct{} `type:"structure"` - - // The current page of any Deployment resources in the collection of deployment - // resources. - Items []*Deployment `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetDeploymentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetDeploymentsOutput) SetItems(v []*Deployment) *GetDeploymentsOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetDeploymentsOutput) SetPosition(v string) *GetDeploymentsOutput { - s.Position = &v - return s -} - -// Gets a specified documentation part of a given API. -type GetDocumentationPartInput struct { - _ struct{} `type:"structure"` - - // [Required] The identifier of the to-be-retrieved documentation part. - // - // DocumentationPartId is a required field - DocumentationPartId *string `location:"uri" locationName:"part_id" type:"string" required:"true"` - - // [Required] The identifier of an API of the to-be-retrieved documentation - // part. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDocumentationPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDocumentationPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDocumentationPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDocumentationPartInput"} - if s.DocumentationPartId == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentationPartId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentationPartId sets the DocumentationPartId field's value. -func (s *GetDocumentationPartInput) SetDocumentationPartId(v string) *GetDocumentationPartInput { - s.DocumentationPartId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetDocumentationPartInput) SetRestApiId(v string) *GetDocumentationPartInput { - s.RestApiId = &v - return s -} - -// Gets the documentation parts of an API. The result may be filtered by the -// type, name, or path of API entities (targets). -type GetDocumentationPartsInput struct { - _ struct{} `type:"structure"` - - // The size of the paged results. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The name of API entities of the to-be-retrieved documentation parts. - NameQuery *string `location:"querystring" locationName:"name" type:"string"` - - // The path of API entities of the to-be-retrieved documentation parts. - Path *string `location:"querystring" locationName:"path" type:"string"` - - // The position of the to-be-retrieved documentation part in the DocumentationParts - // collection. - Position *string `location:"querystring" locationName:"position" type:"string"` - - // [Required] The identifier of the API of the to-be-retrieved documentation - // parts. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The type of API entities of the to-be-retrieved documentation parts. - Type *string `location:"querystring" locationName:"type" type:"string" enum:"DocumentationPartType"` -} - -// String returns the string representation -func (s GetDocumentationPartsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDocumentationPartsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDocumentationPartsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDocumentationPartsInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *GetDocumentationPartsInput) SetLimit(v int64) *GetDocumentationPartsInput { - s.Limit = &v - return s -} - -// SetNameQuery sets the NameQuery field's value. -func (s *GetDocumentationPartsInput) SetNameQuery(v string) *GetDocumentationPartsInput { - s.NameQuery = &v - return s -} - -// SetPath sets the Path field's value. -func (s *GetDocumentationPartsInput) SetPath(v string) *GetDocumentationPartsInput { - s.Path = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetDocumentationPartsInput) SetPosition(v string) *GetDocumentationPartsInput { - s.Position = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetDocumentationPartsInput) SetRestApiId(v string) *GetDocumentationPartsInput { - s.RestApiId = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetDocumentationPartsInput) SetType(v string) *GetDocumentationPartsInput { - s.Type = &v - return s -} - -// The collection of documentation parts of an API. -// -// Documenting an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-documenting-api.html), DocumentationPart -type GetDocumentationPartsOutput struct { - _ struct{} `type:"structure"` - - // The current page of DocumentationPart resources in the DocumentationParts - // collection. - Items []*DocumentationPart `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetDocumentationPartsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDocumentationPartsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetDocumentationPartsOutput) SetItems(v []*DocumentationPart) *GetDocumentationPartsOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetDocumentationPartsOutput) SetPosition(v string) *GetDocumentationPartsOutput { - s.Position = &v - return s -} - -// Gets a documentation snapshot of an API. -type GetDocumentationVersionInput struct { - _ struct{} `type:"structure"` - - // [Required] The version identifier of the to-be-retrieved documentation snapshot. - // - // DocumentationVersion is a required field - DocumentationVersion *string `location:"uri" locationName:"doc_version" type:"string" required:"true"` - - // [Required] The identifier of the API of the to-be-retrieved documentation - // snapshot. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDocumentationVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDocumentationVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDocumentationVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDocumentationVersionInput"} - if s.DocumentationVersion == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentationVersion")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentationVersion sets the DocumentationVersion field's value. -func (s *GetDocumentationVersionInput) SetDocumentationVersion(v string) *GetDocumentationVersionInput { - s.DocumentationVersion = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetDocumentationVersionInput) SetRestApiId(v string) *GetDocumentationVersionInput { - s.RestApiId = &v - return s -} - -// Gets the documentation versions of an API. -type GetDocumentationVersionsInput struct { - _ struct{} `type:"structure"` - - // The page size of the returned documentation versions. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the returned DocumentationVersion in the DocumentationVersions - // collection. - Position *string `location:"querystring" locationName:"position" type:"string"` - - // [Required] The identifier of an API of the to-be-retrieved documentation - // versions. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDocumentationVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDocumentationVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDocumentationVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDocumentationVersionsInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *GetDocumentationVersionsInput) SetLimit(v int64) *GetDocumentationVersionsInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetDocumentationVersionsInput) SetPosition(v string) *GetDocumentationVersionsInput { - s.Position = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetDocumentationVersionsInput) SetRestApiId(v string) *GetDocumentationVersionsInput { - s.RestApiId = &v - return s -} - -// The collection of documentation snapshots of an API. -// -// Use the DocumentationVersions to manage documentation snapshots associated -// with various API stages. -// -// Documenting an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-documenting-api.html), -// DocumentationPart, DocumentationVersion -type GetDocumentationVersionsOutput struct { - _ struct{} `type:"structure"` - - // The current page of DocumentationVersion items from the DocumentationVersions - // collection of an API. - Items []*DocumentationVersion `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetDocumentationVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDocumentationVersionsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetDocumentationVersionsOutput) SetItems(v []*DocumentationVersion) *GetDocumentationVersionsOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetDocumentationVersionsOutput) SetPosition(v string) *GetDocumentationVersionsOutput { - s.Position = &v - return s -} - -// Request to get the name of a DomainName resource. -type GetDomainNameInput struct { - _ struct{} `type:"structure"` - - // The name of the DomainName resource. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"domain_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDomainNameInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDomainNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDomainNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDomainNameInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *GetDomainNameInput) SetDomainName(v string) *GetDomainNameInput { - s.DomainName = &v - return s -} - -// Request to describe a collection of DomainName resources. -type GetDomainNamesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of DomainName resources in the collection to get information - // about. The default limit is 25. It should be an integer between 1 - 500. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the current domain names to get information about. - Position *string `location:"querystring" locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetDomainNamesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDomainNamesInput) GoString() string { - return s.String() -} - -// SetLimit sets the Limit field's value. -func (s *GetDomainNamesInput) SetLimit(v int64) *GetDomainNamesInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetDomainNamesInput) SetPosition(v string) *GetDomainNamesInput { - s.Position = &v - return s -} - -// Represents a collection of DomainName resources. -// -// Use Client-Side Certificate (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html) -type GetDomainNamesOutput struct { - _ struct{} `type:"structure"` - - // The current page of any DomainName resources in the collection of DomainName - // resources. - Items []*DomainName `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetDomainNamesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDomainNamesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetDomainNamesOutput) SetItems(v []*DomainName) *GetDomainNamesOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetDomainNamesOutput) SetPosition(v string) *GetDomainNamesOutput { - s.Position = &v - return s -} - -// Request a new export of a RestApi for a particular Stage. -type GetExportInput struct { - _ struct{} `type:"structure"` - - // The content-type of the export, for example application/json. Currently application/json - // and application/yaml are supported for exportType of swagger. This should - // be specified in the Accept header for direct API requests. - Accepts *string `location:"header" locationName:"Accept" type:"string"` - - // The type of export. Currently only 'swagger' is supported. - // - // ExportType is a required field - ExportType *string `location:"uri" locationName:"export_type" type:"string" required:"true"` - - // A key-value map of query string parameters that specify properties of the - // export, depending on the requested exportType. For exportTypeswagger, any - // combination of the following parameters are supported: integrations will - // export the API with x-amazon-apigateway-integration extensions. authorizers - // will export the API with x-amazon-apigateway-authorizer extensions. postman - // will export the API with Postman extensions, allowing for import to the Postman - // tool - Parameters map[string]*string `location:"querystring" locationName:"parameters" type:"map"` - - // The identifier of the RestApi to be exported. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The name of the Stage that will be exported. - // - // StageName is a required field - StageName *string `location:"uri" locationName:"stage_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetExportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetExportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetExportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetExportInput"} - if s.ExportType == nil { - invalidParams.Add(request.NewErrParamRequired("ExportType")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccepts sets the Accepts field's value. -func (s *GetExportInput) SetAccepts(v string) *GetExportInput { - s.Accepts = &v - return s -} - -// SetExportType sets the ExportType field's value. -func (s *GetExportInput) SetExportType(v string) *GetExportInput { - s.ExportType = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *GetExportInput) SetParameters(v map[string]*string) *GetExportInput { - s.Parameters = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetExportInput) SetRestApiId(v string) *GetExportInput { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *GetExportInput) SetStageName(v string) *GetExportInput { - s.StageName = &v - return s -} - -// The binary blob response to GetExport, which contains the generated SDK. -type GetExportOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The binary blob response to GetExport, which contains the export. - Body []byte `locationName:"body" type:"blob"` - - // The content-disposition header value in the HTTP response. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // The content-type header value in the HTTP response. This will correspond - // to a valid 'accept' type in the request. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` -} - -// String returns the string representation -func (s GetExportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetExportOutput) GoString() string { - return s.String() -} - -// SetBody sets the Body field's value. -func (s *GetExportOutput) SetBody(v []byte) *GetExportOutput { - s.Body = v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *GetExportOutput) SetContentDisposition(v string) *GetExportOutput { - s.ContentDisposition = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *GetExportOutput) SetContentType(v string) *GetExportOutput { - s.ContentType = &v - return s -} - -// Represents a get integration request. -type GetIntegrationInput struct { - _ struct{} `type:"structure"` - - // Specifies a get integration request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // Specifies a get integration request's resource identifier - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Specifies a get integration request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetIntegrationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIntegrationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIntegrationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIntegrationInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *GetIntegrationInput) SetHttpMethod(v string) *GetIntegrationInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetIntegrationInput) SetResourceId(v string) *GetIntegrationInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetIntegrationInput) SetRestApiId(v string) *GetIntegrationInput { - s.RestApiId = &v - return s -} - -// Represents a get integration response request. -type GetIntegrationResponseInput struct { - _ struct{} `type:"structure"` - - // Specifies a get integration response request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // Specifies a get integration response request's resource identifier. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Specifies a get integration response request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // Specifies a get integration response request's status code. - // - // StatusCode is a required field - StatusCode *string `location:"uri" locationName:"status_code" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetIntegrationResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIntegrationResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIntegrationResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIntegrationResponseInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *GetIntegrationResponseInput) SetHttpMethod(v string) *GetIntegrationResponseInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetIntegrationResponseInput) SetResourceId(v string) *GetIntegrationResponseInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetIntegrationResponseInput) SetRestApiId(v string) *GetIntegrationResponseInput { - s.RestApiId = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *GetIntegrationResponseInput) SetStatusCode(v string) *GetIntegrationResponseInput { - s.StatusCode = &v - return s -} - -// Request to describe an existing Method resource. -type GetMethodInput struct { - _ struct{} `type:"structure"` - - // Specifies the method request's HTTP method type. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // The Resource identifier for the Method resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the Method resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetMethodInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMethodInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMethodInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMethodInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *GetMethodInput) SetHttpMethod(v string) *GetMethodInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetMethodInput) SetResourceId(v string) *GetMethodInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetMethodInput) SetRestApiId(v string) *GetMethodInput { - s.RestApiId = &v - return s -} - -// Request to describe a MethodResponse resource. -type GetMethodResponseInput struct { - _ struct{} `type:"structure"` - - // The HTTP verb of the Method resource. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // The Resource identifier for the MethodResponse resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the MethodResponse resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The status code for the MethodResponse resource. - // - // StatusCode is a required field - StatusCode *string `location:"uri" locationName:"status_code" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetMethodResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMethodResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMethodResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMethodResponseInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *GetMethodResponseInput) SetHttpMethod(v string) *GetMethodResponseInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetMethodResponseInput) SetResourceId(v string) *GetMethodResponseInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetMethodResponseInput) SetRestApiId(v string) *GetMethodResponseInput { - s.RestApiId = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *GetMethodResponseInput) SetStatusCode(v string) *GetMethodResponseInput { - s.StatusCode = &v - return s -} - -// Request to list information about a model in an existing RestApi resource. -type GetModelInput struct { - _ struct{} `type:"structure"` - - // A query parameter of a Boolean value to resolve (true) all external model - // references and returns a flattened model schema or not (false) The default - // is false. - Flatten *bool `location:"querystring" locationName:"flatten" type:"boolean"` - - // The name of the model as an identifier. - // - // ModelName is a required field - ModelName *string `location:"uri" locationName:"model_name" type:"string" required:"true"` - - // The RestApi identifier under which the Model exists. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetModelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetModelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetModelInput"} - if s.ModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelName")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFlatten sets the Flatten field's value. -func (s *GetModelInput) SetFlatten(v bool) *GetModelInput { - s.Flatten = &v - return s -} - -// SetModelName sets the ModelName field's value. -func (s *GetModelInput) SetModelName(v string) *GetModelInput { - s.ModelName = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetModelInput) SetRestApiId(v string) *GetModelInput { - s.RestApiId = &v - return s -} - -// Request to generate a sample mapping template used to transform the payload. -type GetModelTemplateInput struct { - _ struct{} `type:"structure"` - - // The name of the model for which to generate a template. - // - // ModelName is a required field - ModelName *string `location:"uri" locationName:"model_name" type:"string" required:"true"` - - // The ID of the RestApi under which the model exists. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetModelTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetModelTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetModelTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetModelTemplateInput"} - if s.ModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelName")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetModelName sets the ModelName field's value. -func (s *GetModelTemplateInput) SetModelName(v string) *GetModelTemplateInput { - s.ModelName = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetModelTemplateInput) SetRestApiId(v string) *GetModelTemplateInput { - s.RestApiId = &v - return s -} - -// Represents a mapping template used to transform a payload. -// -// Mapping Templates (http://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html#models-mappings-mappings) -type GetModelTemplateOutput struct { - _ struct{} `type:"structure"` - - // The Apache Velocity Template Language (VTL) (http://velocity.apache.org/engine/devel/vtl-reference-guide.html) - // template content used for the template resource. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s GetModelTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetModelTemplateOutput) GoString() string { - return s.String() -} - -// SetValue sets the Value field's value. -func (s *GetModelTemplateOutput) SetValue(v string) *GetModelTemplateOutput { - s.Value = &v - return s -} - -// Request to list existing Models defined for a RestApi resource. -type GetModelsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of models in the collection to get information about. - // The default limit is 25. It should be an integer between 1 - 500. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the next set of results in the Models resource to get information - // about. - Position *string `location:"querystring" locationName:"position" type:"string"` - - // The RestApi identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetModelsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetModelsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetModelsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetModelsInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *GetModelsInput) SetLimit(v int64) *GetModelsInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetModelsInput) SetPosition(v string) *GetModelsInput { - s.Position = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetModelsInput) SetRestApiId(v string) *GetModelsInput { - s.RestApiId = &v - return s -} - -// Represents a collection of Model resources. -// -// Method, MethodResponse, Models and Mappings (http://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html) -type GetModelsOutput struct { - _ struct{} `type:"structure"` - - // Gets the current Model resource in the collection. - Items []*Model `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetModelsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetModelsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetModelsOutput) SetItems(v []*Model) *GetModelsOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetModelsOutput) SetPosition(v string) *GetModelsOutput { - s.Position = &v - return s -} - -// Request to list information about a resource. -type GetResourceInput struct { - _ struct{} `type:"structure"` - - // The identifier for the Resource resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetResourceInput) SetResourceId(v string) *GetResourceInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetResourceInput) SetRestApiId(v string) *GetResourceInput { - s.RestApiId = &v - return s -} - -// Request to list information about a collection of resources. -type GetResourcesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of Resource resources in the collection to get information - // about. The default limit is 25. It should be an integer between 1 - 500. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the next set of results in the current Resources resource - // to get information about. - Position *string `location:"querystring" locationName:"position" type:"string"` - - // The RestApi identifier for the Resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetResourcesInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *GetResourcesInput) SetLimit(v int64) *GetResourcesInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetResourcesInput) SetPosition(v string) *GetResourcesInput { - s.Position = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetResourcesInput) SetRestApiId(v string) *GetResourcesInput { - s.RestApiId = &v - return s -} - -// Represents a collection of Resource resources. -// -// Create an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html) -type GetResourcesOutput struct { - _ struct{} `type:"structure"` - - // Gets the current Resource resource in the collection. - Items []*Resource `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetResourcesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetResourcesOutput) SetItems(v []*Resource) *GetResourcesOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetResourcesOutput) SetPosition(v string) *GetResourcesOutput { - s.Position = &v - return s -} - -// The GET request to list an existing RestApi defined for your collection. -type GetRestApiInput struct { - _ struct{} `type:"structure"` - - // The identifier of the RestApi resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRestApiInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRestApiInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRestApiInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRestApiInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetRestApiInput) SetRestApiId(v string) *GetRestApiInput { - s.RestApiId = &v - return s -} - -// The GET request to list existing RestApis defined for your collection. -type GetRestApisInput struct { - _ struct{} `type:"structure"` - - // The maximum number of RestApi resources in the collection to get information - // about. The default limit is 25. It should be an integer between 1 - 500. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the current RestApis resource in the collection to get information - // about. - Position *string `location:"querystring" locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetRestApisInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRestApisInput) GoString() string { - return s.String() -} - -// SetLimit sets the Limit field's value. -func (s *GetRestApisInput) SetLimit(v int64) *GetRestApisInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetRestApisInput) SetPosition(v string) *GetRestApisInput { - s.Position = &v - return s -} - -// Contains references to your APIs and links that guide you in how to interact -// with your collection. A collection offers a paginated view of your APIs. -// -// Create an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html) -type GetRestApisOutput struct { - _ struct{} `type:"structure"` - - // An array of links to the current page of RestApi resources. - Items []*RestApi `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetRestApisOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRestApisOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetRestApisOutput) SetItems(v []*RestApi) *GetRestApisOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetRestApisOutput) SetPosition(v string) *GetRestApisOutput { - s.Position = &v - return s -} - -// Request a new generated client SDK for a RestApi and Stage. -type GetSdkInput struct { - _ struct{} `type:"structure"` - - // A key-value map of query string parameters that specify properties of the - // SDK, depending on the requested sdkType. For sdkType of objectivec, a parameter - // named classPrefix is required. For sdkType of android, parameters named groupId, - // artifactId, artifactVersion, and invokerPackage are required. - Parameters map[string]*string `location:"querystring" locationName:"parameters" type:"map"` - - // The identifier of the RestApi that the SDK will use. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The language for the generated SDK. Currently javascript, android, and objectivec - // (for iOS) are supported. - // - // SdkType is a required field - SdkType *string `location:"uri" locationName:"sdk_type" type:"string" required:"true"` - - // The name of the Stage that the SDK will use. - // - // StageName is a required field - StageName *string `location:"uri" locationName:"stage_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSdkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSdkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSdkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSdkInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.SdkType == nil { - invalidParams.Add(request.NewErrParamRequired("SdkType")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParameters sets the Parameters field's value. -func (s *GetSdkInput) SetParameters(v map[string]*string) *GetSdkInput { - s.Parameters = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetSdkInput) SetRestApiId(v string) *GetSdkInput { - s.RestApiId = &v - return s -} - -// SetSdkType sets the SdkType field's value. -func (s *GetSdkInput) SetSdkType(v string) *GetSdkInput { - s.SdkType = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *GetSdkInput) SetStageName(v string) *GetSdkInput { - s.StageName = &v - return s -} - -// The binary blob response to GetSdk, which contains the generated SDK. -type GetSdkOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The binary blob response to GetSdk, which contains the generated SDK. - Body []byte `locationName:"body" type:"blob"` - - // The content-disposition header value in the HTTP response. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // The content-type header value in the HTTP response. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` -} - -// String returns the string representation -func (s GetSdkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSdkOutput) GoString() string { - return s.String() -} - -// SetBody sets the Body field's value. -func (s *GetSdkOutput) SetBody(v []byte) *GetSdkOutput { - s.Body = v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *GetSdkOutput) SetContentDisposition(v string) *GetSdkOutput { - s.ContentDisposition = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *GetSdkOutput) SetContentType(v string) *GetSdkOutput { - s.ContentType = &v - return s -} - -// Get an SdkType instance. -type GetSdkTypeInput struct { - _ struct{} `type:"structure"` - - // The identifier of the queried SdkType instance. - // - // Id is a required field - Id *string `location:"uri" locationName:"sdktype_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSdkTypeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSdkTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSdkTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSdkTypeInput"} - 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 *GetSdkTypeInput) SetId(v string) *GetSdkTypeInput { - s.Id = &v - return s -} - -// Get the SdkTypes collection. -type GetSdkTypesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of SdkType instances to be returned. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The position of the last fetched element in the SdkTypes collection. - Position *string `location:"querystring" locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetSdkTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSdkTypesInput) GoString() string { - return s.String() -} - -// SetLimit sets the Limit field's value. -func (s *GetSdkTypesInput) SetLimit(v int64) *GetSdkTypesInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetSdkTypesInput) SetPosition(v string) *GetSdkTypesInput { - s.Position = &v - return s -} - -// The collection of SdkType instances. -type GetSdkTypesOutput struct { - _ struct{} `type:"structure"` - - // The set of SdkType items that comprise this view of the SdkTypes collection. - Items []*SdkType `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetSdkTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSdkTypesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetSdkTypesOutput) SetItems(v []*SdkType) *GetSdkTypesOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetSdkTypesOutput) SetPosition(v string) *GetSdkTypesOutput { - s.Position = &v - return s -} - -// Requests Amazon API Gateway to get information about a Stage resource. -type GetStageInput struct { - _ struct{} `type:"structure"` - - // The identifier of the RestApi resource for the Stage resource to get information - // about. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The name of the Stage resource to get information about. - // - // StageName is a required field - StageName *string `location:"uri" locationName:"stage_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetStageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStageInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetStageInput) SetRestApiId(v string) *GetStageInput { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *GetStageInput) SetStageName(v string) *GetStageInput { - s.StageName = &v - return s -} - -// Requests Amazon API Gateway to get information about one or more Stage resources. -type GetStagesInput struct { - _ struct{} `type:"structure"` - - // The stages' deployment identifiers. - DeploymentId *string `location:"querystring" locationName:"deploymentId" type:"string"` - - // The stages' API identifiers. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetStagesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStagesInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetStagesInput) SetDeploymentId(v string) *GetStagesInput { - s.DeploymentId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *GetStagesInput) SetRestApiId(v string) *GetStagesInput { - s.RestApiId = &v - return s -} - -// A list of Stage resources that are associated with the ApiKey resource. -// -// Deploying API in Stages (http://docs.aws.amazon.com/apigateway/latest/developerguide/stages.html) -type GetStagesOutput struct { - _ struct{} `type:"structure"` - - // An individual Stage resource. - Item []*Stage `locationName:"item" type:"list"` -} - -// String returns the string representation -func (s GetStagesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStagesOutput) GoString() string { - return s.String() -} - -// SetItem sets the Item field's value. -func (s *GetStagesOutput) SetItem(v []*Stage) *GetStagesOutput { - s.Item = v - return s -} - -// The GET request to get the usage data of a usage plan in a specified time -// interval. -type GetUsageInput struct { - _ struct{} `type:"structure"` - - // The ending date (e.g., 2016-12-31) of the usage data. - // - // EndDate is a required field - EndDate *string `location:"querystring" locationName:"endDate" type:"string" required:"true"` - - // The Id of the API key associated with the resultant usage data. - KeyId *string `location:"querystring" locationName:"keyId" type:"string"` - - // The maximum number of results to be returned. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // Position - Position *string `location:"querystring" locationName:"position" type:"string"` - - // The starting date (e.g., 2016-01-01) of the usage data. - // - // StartDate is a required field - StartDate *string `location:"querystring" locationName:"startDate" type:"string" required:"true"` - - // The Id of the usage plan associated with the usage data. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetUsageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUsageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUsageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUsageInput"} - if s.EndDate == nil { - invalidParams.Add(request.NewErrParamRequired("EndDate")) - } - if s.StartDate == nil { - invalidParams.Add(request.NewErrParamRequired("StartDate")) - } - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndDate sets the EndDate field's value. -func (s *GetUsageInput) SetEndDate(v string) *GetUsageInput { - s.EndDate = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *GetUsageInput) SetKeyId(v string) *GetUsageInput { - s.KeyId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *GetUsageInput) SetLimit(v int64) *GetUsageInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetUsageInput) SetPosition(v string) *GetUsageInput { - s.Position = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *GetUsageInput) SetStartDate(v string) *GetUsageInput { - s.StartDate = &v - return s -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *GetUsageInput) SetUsagePlanId(v string) *GetUsageInput { - s.UsagePlanId = &v - return s -} - -// The GET request to get a usage plan of a given plan identifier. -type GetUsagePlanInput struct { - _ struct{} `type:"structure"` - - // The identifier of the UsagePlan resource to be retrieved. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetUsagePlanInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUsagePlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUsagePlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUsagePlanInput"} - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *GetUsagePlanInput) SetUsagePlanId(v string) *GetUsagePlanInput { - s.UsagePlanId = &v - return s -} - -// The GET request to get a usage plan key of a given key identifier. -type GetUsagePlanKeyInput struct { - _ struct{} `type:"structure"` - - // The key Id of the to-be-retrieved UsagePlanKey resource representing a plan - // customer. - // - // KeyId is a required field - KeyId *string `location:"uri" locationName:"keyId" type:"string" required:"true"` - - // The Id of the UsagePlan resource representing the usage plan containing the - // to-be-retrieved UsagePlanKey resource representing a plan customer. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetUsagePlanKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUsagePlanKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUsagePlanKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUsagePlanKeyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *GetUsagePlanKeyInput) SetKeyId(v string) *GetUsagePlanKeyInput { - s.KeyId = &v - return s -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *GetUsagePlanKeyInput) SetUsagePlanId(v string) *GetUsagePlanKeyInput { - s.UsagePlanId = &v - return s -} - -// The GET request to get all the usage plan keys representing the API keys -// added to a specified usage plan. -type GetUsagePlanKeysInput struct { - _ struct{} `type:"structure"` - - // A query parameter specifying the maximum number usage plan keys returned - // by the GET request. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // A query parameter specifying the name of the to-be-returned usage plan keys. - NameQuery *string `location:"querystring" locationName:"name" type:"string"` - - // A query parameter specifying the zero-based index specifying the position - // of a usage plan key. - Position *string `location:"querystring" locationName:"position" type:"string"` - - // The Id of the UsagePlan resource representing the usage plan containing the - // to-be-retrieved UsagePlanKey resource representing a plan customer. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetUsagePlanKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUsagePlanKeysInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUsagePlanKeysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUsagePlanKeysInput"} - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *GetUsagePlanKeysInput) SetLimit(v int64) *GetUsagePlanKeysInput { - s.Limit = &v - return s -} - -// SetNameQuery sets the NameQuery field's value. -func (s *GetUsagePlanKeysInput) SetNameQuery(v string) *GetUsagePlanKeysInput { - s.NameQuery = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetUsagePlanKeysInput) SetPosition(v string) *GetUsagePlanKeysInput { - s.Position = &v - return s -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *GetUsagePlanKeysInput) SetUsagePlanId(v string) *GetUsagePlanKeysInput { - s.UsagePlanId = &v - return s -} - -// Represents the collection of usage plan keys added to usage plans for the -// associated API keys and, possibly, other types of keys. -// -// Create and Use Usage Plans (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) -type GetUsagePlanKeysOutput struct { - _ struct{} `type:"structure"` - - // Gets the current item of the usage plan keys collection. - Items []*UsagePlanKey `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetUsagePlanKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUsagePlanKeysOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetUsagePlanKeysOutput) SetItems(v []*UsagePlanKey) *GetUsagePlanKeysOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetUsagePlanKeysOutput) SetPosition(v string) *GetUsagePlanKeysOutput { - s.Position = &v - return s -} - -// The GET request to get all the usage plans of the caller's account. -type GetUsagePlansInput struct { - _ struct{} `type:"structure"` - - // The identifier of the API key associated with the usage plans. - KeyId *string `location:"querystring" locationName:"keyId" type:"string"` - - // The number of UsagePlan resources to be returned as the result. - Limit *int64 `location:"querystring" locationName:"limit" type:"integer"` - - // The zero-based array index specifying the position of the to-be-retrieved - // UsagePlan resource. - Position *string `location:"querystring" locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetUsagePlansInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUsagePlansInput) GoString() string { - return s.String() -} - -// SetKeyId sets the KeyId field's value. -func (s *GetUsagePlansInput) SetKeyId(v string) *GetUsagePlansInput { - s.KeyId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *GetUsagePlansInput) SetLimit(v int64) *GetUsagePlansInput { - s.Limit = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetUsagePlansInput) SetPosition(v string) *GetUsagePlansInput { - s.Position = &v - return s -} - -// Represents a collection of usage plans for an AWS account. -// -// Create and Use Usage Plans (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) -type GetUsagePlansOutput struct { - _ struct{} `type:"structure"` - - // Gets the current item when enumerating the collection of UsagePlan. - Items []*UsagePlan `locationName:"item" type:"list"` - - Position *string `locationName:"position" type:"string"` -} - -// String returns the string representation -func (s GetUsagePlansOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUsagePlansOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *GetUsagePlansOutput) SetItems(v []*UsagePlan) *GetUsagePlansOutput { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetUsagePlansOutput) SetPosition(v string) *GetUsagePlansOutput { - s.Position = &v - return s -} - -// The POST request to import API keys from an external source, such as a CSV-formatted -// file. -type ImportApiKeysInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The payload of the POST request to import API keys. For the payload format, - // see API Key File Format (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-key-file-format.html). - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true"` - - // A query parameter to indicate whether to rollback ApiKey importation (true) - // or not (false) when error is encountered. - FailOnWarnings *bool `location:"querystring" locationName:"failonwarnings" type:"boolean"` - - // A query parameter to specify the input format to imported API keys. Currently, - // only the csv format is supported. - // - // Format is a required field - Format *string `location:"querystring" locationName:"format" type:"string" required:"true" enum:"ApiKeysFormat"` -} - -// String returns the string representation -func (s ImportApiKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportApiKeysInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportApiKeysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportApiKeysInput"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *ImportApiKeysInput) SetBody(v []byte) *ImportApiKeysInput { - s.Body = v - return s -} - -// SetFailOnWarnings sets the FailOnWarnings field's value. -func (s *ImportApiKeysInput) SetFailOnWarnings(v bool) *ImportApiKeysInput { - s.FailOnWarnings = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *ImportApiKeysInput) SetFormat(v string) *ImportApiKeysInput { - s.Format = &v - return s -} - -// The identifier of an ApiKey used in a UsagePlan. -type ImportApiKeysOutput struct { - _ struct{} `type:"structure"` - - // A list of all the ApiKey identifiers. - Ids []*string `locationName:"ids" type:"list"` - - // A list of warning messages. - Warnings []*string `locationName:"warnings" type:"list"` -} - -// String returns the string representation -func (s ImportApiKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportApiKeysOutput) GoString() string { - return s.String() -} - -// SetIds sets the Ids field's value. -func (s *ImportApiKeysOutput) SetIds(v []*string) *ImportApiKeysOutput { - s.Ids = v - return s -} - -// SetWarnings sets the Warnings field's value. -func (s *ImportApiKeysOutput) SetWarnings(v []*string) *ImportApiKeysOutput { - s.Warnings = v - return s -} - -// Import documentation parts from an external (e.g., Swagger) definition file. -type ImportDocumentationPartsInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // [Required] Raw byte array representing the to-be-imported documentation parts. - // To import from a Swagger file, this is a JSON object. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true"` - - // A query parameter to specify whether to rollback the documentation importation - // (true) or not (false) when a warning is encountered. The default value is - // false. - FailOnWarnings *bool `location:"querystring" locationName:"failonwarnings" type:"boolean"` - - // A query parameter to indicate whether to overwrite (OVERWRITE) any existing - // DocumentationParts definition or to merge (MERGE) the new definition into - // the existing one. The default value is MERGE. - Mode *string `location:"querystring" locationName:"mode" type:"string" enum:"PutMode"` - - // [Required] The identifier of an API of the to-be-imported documentation parts. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s ImportDocumentationPartsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportDocumentationPartsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportDocumentationPartsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportDocumentationPartsInput"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *ImportDocumentationPartsInput) SetBody(v []byte) *ImportDocumentationPartsInput { - s.Body = v - return s -} - -// SetFailOnWarnings sets the FailOnWarnings field's value. -func (s *ImportDocumentationPartsInput) SetFailOnWarnings(v bool) *ImportDocumentationPartsInput { - s.FailOnWarnings = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *ImportDocumentationPartsInput) SetMode(v string) *ImportDocumentationPartsInput { - s.Mode = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *ImportDocumentationPartsInput) SetRestApiId(v string) *ImportDocumentationPartsInput { - s.RestApiId = &v - return s -} - -// A collection of the imported DocumentationPart identifiers. -// -// This is used to return the result when documentation parts in an external -// (e.g., Swagger) file are imported into Amazon API Gateway -// Documenting an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-documenting-api.html), -// documentationpart:import (http://docs.aws.amazon.com/apigateway/api-reference/link-relation/documentationpart-import/), -// DocumentationPart -type ImportDocumentationPartsOutput struct { - _ struct{} `type:"structure"` - - // A list of the returned documentation part identifiers. - Ids []*string `locationName:"ids" type:"list"` - - // A list of warning messages reported during import of documentation parts. - Warnings []*string `locationName:"warnings" type:"list"` -} - -// String returns the string representation -func (s ImportDocumentationPartsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportDocumentationPartsOutput) GoString() string { - return s.String() -} - -// SetIds sets the Ids field's value. -func (s *ImportDocumentationPartsOutput) SetIds(v []*string) *ImportDocumentationPartsOutput { - s.Ids = v - return s -} - -// SetWarnings sets the Warnings field's value. -func (s *ImportDocumentationPartsOutput) SetWarnings(v []*string) *ImportDocumentationPartsOutput { - s.Warnings = v - return s -} - -// A POST request to import an API to Amazon API Gateway using an input of an -// API definition file. -type ImportRestApiInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The POST request body containing external API definitions. Currently, only - // Swagger definition JSON files are supported. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true"` - - // A query parameter to indicate whether to rollback the API creation (true) - // or not (false) when a warning is encountered. The default value is false. - FailOnWarnings *bool `location:"querystring" locationName:"failonwarnings" type:"boolean"` - - // Custom header parameters as part of the request. - Parameters map[string]*string `location:"querystring" locationName:"parameters" type:"map"` -} - -// String returns the string representation -func (s ImportRestApiInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportRestApiInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportRestApiInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportRestApiInput"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *ImportRestApiInput) SetBody(v []byte) *ImportRestApiInput { - s.Body = v - return s -} - -// SetFailOnWarnings sets the FailOnWarnings field's value. -func (s *ImportRestApiInput) SetFailOnWarnings(v bool) *ImportRestApiInput { - s.FailOnWarnings = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ImportRestApiInput) SetParameters(v map[string]*string) *ImportRestApiInput { - s.Parameters = v - return s -} - -// Represents an HTTP, HTTP_PROXY, AWS, AWS_PROXY, or Mock integration. -// -// In the API Gateway console, the built-in Lambda integration is an AWS integration. -// -// Creating an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html) -type Integration struct { - _ struct{} `type:"structure"` - - // Specifies the integration's cache key parameters. - CacheKeyParameters []*string `locationName:"cacheKeyParameters" type:"list"` - - // Specifies the integration's cache namespace. - CacheNamespace *string `locationName:"cacheNamespace" type:"string"` - - // Specifies how to handle request payload content type conversions. Supported - // values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors: - // - // * CONVERT_TO_BINARY: Converts a request payload from a Base64-encoded - // string to the corresponding binary blob. - // - // * CONVERT_TO_TEXT: Converts a request payload from a binary blob to a - // Base64-encoded string. - // - // If this property is not defined, the request payload will be passed through - // from the method request to integration request without modification, provided - // that the passthroughBehaviors is configured to support payload pass-through. - ContentHandling *string `locationName:"contentHandling" type:"string" enum:"ContentHandlingStrategy"` - - // Specifies the credentials required for the integration, if any. For AWS integrations, - // three options are available. To specify an IAM Role for Amazon API Gateway - // to assume, use the role's Amazon Resource Name (ARN). To require that the - // caller's identity be passed through from the request, specify the string - // arn:aws:iam::\*:user/\*. To use resource-based permissions on supported AWS - // services, specify null. - Credentials *string `locationName:"credentials" type:"string"` - - // Specifies the integration's HTTP method type. - HttpMethod *string `locationName:"httpMethod" type:"string"` - - // Specifies the integration's responses. - // - // Example: Get integration responses of a method - // - // Request - // - // GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 - // HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com - // X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, - // SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} - // Response - // - // The successful response returns 200 OKstatus and a payload as follows: - // - // { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", - // "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", - // "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" - // }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" - // } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" - // }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream - // in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" - // }, "statusCode": "200" } - IntegrationResponses map[string]*IntegrationResponse `locationName:"integrationResponses" type:"map"` - - // Specifies how the method request body of an unmapped content type will be - // passed through the integration request to the back end without transformation. - // A content type is unmapped if no mapping template is defined in the integration - // or the content type does not match any of the mapped content types, as specified - // in requestTemplates. There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, - // and NEVER. - // - // WHEN_NO_MATCH passes the method request body through the integration request - // to the back end without transformation when the method request content type - // does not match any content type associated with the mapping templates defined - // in the integration request. - // WHEN_NO_TEMPLATES passes the method request body through the integration - // request to the back end without transformation when no mapping template is - // defined in the integration request. If a template is defined when this option - // is selected, the method request of an unmapped content-type will be rejected - // with an HTTP 415 Unsupported Media Type response. - // NEVER rejects the method request with an HTTP 415 Unsupported Media Type - // response when either the method request content type does not match any content - // type associated with the mapping templates defined in the integration request - // or no mapping template is defined in the integration request. - PassthroughBehavior *string `locationName:"passthroughBehavior" type:"string"` - - // A key-value map specifying request parameters that are passed from the method - // request to the back end. The key is an integration request parameter name - // and the associated value is a method request parameter value or static value - // that must be enclosed within single quotes and pre-encoded as required by - // the back end. The method request parameter value must match the pattern of - // method.request.{location}.{name}, where location is querystring, path, or - // header and name must be a valid and unique method request parameter name. - RequestParameters map[string]*string `locationName:"requestParameters" type:"map"` - - // Represents a map of Velocity templates that are applied on the request payload - // based on the value of the Content-Type header sent by the client. The content - // type value is the key in this map, and the template (as a String) is the - // value. - RequestTemplates map[string]*string `locationName:"requestTemplates" type:"map"` - - // Specifies the integration's type. The valid value is HTTP for integrating - // with an HTTP back end, AWS for any AWS service endpoints, MOCK for testing - // without actually invoking the back end, HTTP_PROXY for integrating with the - // HTTP proxy integration, or AWS_PROXY for integrating with the Lambda proxy - // integration type. - Type *string `locationName:"type" type:"string" enum:"IntegrationType"` - - // Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, - // the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 - // specification (https://en.wikipedia.org/wiki/Uniform_Resource_Identifier). - // For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. - // Region, subdomain and service are used to determine the right endpoint. For - // AWS services that use the Action= query string parameter, service_api should - // be a valid action for the desired service. For RESTful AWS service APIs, - // path is used to indicate that the remaining substring in the URI should be - // treated as the path to the resource, including the initial /. - Uri *string `locationName:"uri" type:"string"` -} - -// String returns the string representation -func (s Integration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Integration) GoString() string { - return s.String() -} - -// SetCacheKeyParameters sets the CacheKeyParameters field's value. -func (s *Integration) SetCacheKeyParameters(v []*string) *Integration { - s.CacheKeyParameters = v - return s -} - -// SetCacheNamespace sets the CacheNamespace field's value. -func (s *Integration) SetCacheNamespace(v string) *Integration { - s.CacheNamespace = &v - return s -} - -// SetContentHandling sets the ContentHandling field's value. -func (s *Integration) SetContentHandling(v string) *Integration { - s.ContentHandling = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *Integration) SetCredentials(v string) *Integration { - s.Credentials = &v - return s -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *Integration) SetHttpMethod(v string) *Integration { - s.HttpMethod = &v - return s -} - -// SetIntegrationResponses sets the IntegrationResponses field's value. -func (s *Integration) SetIntegrationResponses(v map[string]*IntegrationResponse) *Integration { - s.IntegrationResponses = v - return s -} - -// SetPassthroughBehavior sets the PassthroughBehavior field's value. -func (s *Integration) SetPassthroughBehavior(v string) *Integration { - s.PassthroughBehavior = &v - return s -} - -// SetRequestParameters sets the RequestParameters field's value. -func (s *Integration) SetRequestParameters(v map[string]*string) *Integration { - s.RequestParameters = v - return s -} - -// SetRequestTemplates sets the RequestTemplates field's value. -func (s *Integration) SetRequestTemplates(v map[string]*string) *Integration { - s.RequestTemplates = v - return s -} - -// SetType sets the Type field's value. -func (s *Integration) SetType(v string) *Integration { - s.Type = &v - return s -} - -// SetUri sets the Uri field's value. -func (s *Integration) SetUri(v string) *Integration { - s.Uri = &v - return s -} - -// Represents an integration response. The status code must map to an existing -// MethodResponse, and parameters and templates can be used to transform the -// back-end response. -// -// Creating an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html) -type IntegrationResponse struct { - _ struct{} `type:"structure"` - - // Specifies how to handle response payload content type conversions. Supported - // values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors: - // - // * CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded - // string to the corresponding binary blob. - // - // * CONVERT_TO_TEXT: Converts a response payload from a binary blob to a - // Base64-encoded string. - // - // If this property is not defined, the response payload will be passed through - // from the integration response to the method response without modification. - ContentHandling *string `locationName:"contentHandling" type:"string" enum:"ContentHandlingStrategy"` - - // A key-value map specifying response parameters that are passed to the method - // response from the back end. The key is a method response header parameter - // name and the mapped value is an integration response header value, a static - // value enclosed within a pair of single quotes, or a JSON expression from - // the integration response body. The mapping key must match the pattern of - // method.response.header.{name}, where name is a valid and unique header name. - // The mapped non-static value must match the pattern of integration.response.header.{name} - // or integration.response.body.{JSON-expression}, where name is a valid and - // unique response header name and JSON-expression is a valid JSON expression - // without the $ prefix. - ResponseParameters map[string]*string `locationName:"responseParameters" type:"map"` - - // Specifies the templates used to transform the integration response body. - // Response templates are represented as a key/value map, with a content-type - // as the key and a template as the value. - ResponseTemplates map[string]*string `locationName:"responseTemplates" type:"map"` - - // Specifies the regular expression (regex) pattern used to choose an integration - // response based on the response from the back end. For example, if the success - // response returns nothing and the error response returns some string, you - // could use the .+ regex to match error response. However, make sure that the - // error response does not contain any newline (\n) character in such cases. - // If the back end is an AWS Lambda function, the AWS Lambda function error - // header is matched. For all other HTTP and AWS back ends, the HTTP status - // code is matched. - SelectionPattern *string `locationName:"selectionPattern" type:"string"` - - // Specifies the status code that is used to map the integration response to - // an existing MethodResponse. - StatusCode *string `locationName:"statusCode" type:"string"` -} - -// String returns the string representation -func (s IntegrationResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IntegrationResponse) GoString() string { - return s.String() -} - -// SetContentHandling sets the ContentHandling field's value. -func (s *IntegrationResponse) SetContentHandling(v string) *IntegrationResponse { - s.ContentHandling = &v - return s -} - -// SetResponseParameters sets the ResponseParameters field's value. -func (s *IntegrationResponse) SetResponseParameters(v map[string]*string) *IntegrationResponse { - s.ResponseParameters = v - return s -} - -// SetResponseTemplates sets the ResponseTemplates field's value. -func (s *IntegrationResponse) SetResponseTemplates(v map[string]*string) *IntegrationResponse { - s.ResponseTemplates = v - return s -} - -// SetSelectionPattern sets the SelectionPattern field's value. -func (s *IntegrationResponse) SetSelectionPattern(v string) *IntegrationResponse { - s.SelectionPattern = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *IntegrationResponse) SetStatusCode(v string) *IntegrationResponse { - s.StatusCode = &v - return s -} - -// Represents a client-facing interface by which the client calls the API to -// access back-end resources. A Method resource is integrated with an Integration -// resource. Both consist of a request and one or more responses. The method -// request takes the client input that is passed to the back end through the -// integration request. A method response returns the output from the back end -// to the client through an integration response. A method request is embodied -// in a Method resource, whereas an integration request is embodied in an Integration -// resource. On the other hand, a method response is represented by a MethodResponse -// resource, whereas an integration response is represented by an IntegrationResponse -// resource. -// -// Example: Retrive the GET method on a specified resource -// -// Request -// -// The following example request retrieves the information about the GET method -// on an API resource (3kzxbg5sa2) of an API (fugvjdxtri). -// -// GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET HTTP/1.1 Content-Type: -// application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: -// 20160603T210259Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160603/us-east-1/apigateway/aws4_request, -// SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} -// Response -// -// The successful response returns a 200 OK status code and a payload similar -// to the following: -// -// { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", -// "name": "integration", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", -// "name": "integrationresponse", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-{rel}.html", -// "name": "method", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", -// "name": "methodresponse", "templated": true } ], "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET", -// "name": "GET", "title": "GET" }, "integration:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" -// }, "method:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" -// }, "method:integration": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" -// }, "method:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", -// "name": "200", "title": "200" }, "method:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" -// }, "methodresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/{status_code}", -// "templated": true } }, "apiKeyRequired": true, "authorizationType": "NONE", -// "httpMethod": "GET", "_embedded": { "method:integration": { "_links": -// { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" -// }, "integration:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" -// }, "integration:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", -// "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" -// }, "integrationresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/{status_code}", -// "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "3kzxbg5sa2", -// "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": -// "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestParameters": { -// "integration.request.header.Content-Type": "'application/x-amz-json-1.1'" -// }, "requestTemplates": { "application/json": "{\n}" }, "type": "AWS", -// "uri": "arn:aws:apigateway:us-east-1:kinesis:action/ListStreams", "_embedded": -// { "integration:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", -// "name": "200", "title": "200" }, "integrationresponse:delete": { "href": -// "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" -// }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" -// } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" -// }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E%23foreach(%24stream%20in%20%24input.path(%27%24.StreamNames%27))%3Cstream%3E%3Cname%3E%24stream%3C%2Fname%3E%3C%2Fstream%3E%23end%3C%2FkinesisStreams%3E\")" -// }, "statusCode": "200" } } }, "method:responses": { "_links": { "self": -// { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", -// "name": "200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" -// }, "methodresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" -// } }, "responseModels": { "application/json": "Empty" }, "responseParameters": -// { "method.response.header.Content-Type": false }, "statusCode": "200" -// } } } -// In the example above, the response template for the 200 OK response maps -// the JSON output from the ListStreams action in the back end to an XML output. -// The mapping template is URL-encoded as %3CkinesisStreams%3E%23foreach(%24stream%20in%20%24input.path(%27%24.StreamNames%27))%3Cstream%3E%3Cname%3E%24stream%3C%2Fname%3E%3C%2Fstream%3E%23end%3C%2FkinesisStreams%3E -// and the output is decoded using the $util.urlDecode() (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#util-templat-reference) -// helper function. -// -// MethodResponse, Integration, IntegrationResponse, Resource, Set up an API's method (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-method-settings.html) -type Method struct { - _ struct{} `type:"structure"` - - // A boolean flag specifying whether a valid ApiKey is required to invoke this - // method. - ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` - - // The method's authorization type. - AuthorizationType *string `locationName:"authorizationType" type:"string"` - - // The identifier of an Authorizer to use on this method. The authorizationType - // must be CUSTOM. - AuthorizerId *string `locationName:"authorizerId" type:"string"` - - // The method's HTTP verb. - HttpMethod *string `locationName:"httpMethod" type:"string"` - - // Gets the method's integration responsible for passing the client-submitted - // request to the back end and performing necessary transformations to make - // the request compliant with the back end. - // - // Example: - // - // Request - // - // GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 - // Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: - // 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, - // SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} - // Response - // - // The successful response returns a 200 OKstatus code and a payload similar to the following: - // - // { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", - // "name": "integration", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", - // "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" - // }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" - // }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", - // "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" - // }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", - // "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", - // "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": - // "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": - // "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", - // \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", - // "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", - // "name": "200", "title": "200" }, "integrationresponse:delete": { "href": - // "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" - // }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" - // } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", - // "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": - // "integration.response.body.a" }, "responseTemplates": { "application/json": - // "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op - // => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n - // \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } - // } - MethodIntegration *Integration `locationName:"methodIntegration" type:"structure"` - - // Gets a method response associated with a given HTTP status code. - // - // The collection of method responses are encapsulated in a key-value map, where - // the key is a response's HTTP status code and the value is a MethodResponse - // resource that specifies the response returned to the caller from the back - // end through the integration response. - // - // Example: Get a 200 OK response of a GET method - // - // Request - // - // GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 - // Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com - // Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 - // Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, - // SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} - // Response - // - // The successful response returns a 200 OK status code and a payload similar - // to the following: - // - // { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", - // "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", - // "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" - // }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" - // } }, "responseModels": { "application/json": "Empty" }, "responseParameters": - // { "method.response.header.operator": false, "method.response.header.operand_2": - // false, "method.response.header.operand_1": false }, "statusCode": "200" - // } - MethodResponses map[string]*MethodResponse `locationName:"methodResponses" type:"map"` - - // A human-friendly operation identifier for the method. For example, you can - // assign the operationName of ListPets for the GET /pets method in PetStore - // (http://petstore-demo-endpoint.execute-api.com/petstore/pets) example. - OperationName *string `locationName:"operationName" type:"string"` - - // A key-value map specifying data schemas, represented by Model resources, - // (as the mapped value) of the request payloads of given content types (as - // the mapping key). - RequestModels map[string]*string `locationName:"requestModels" type:"map"` - - // A key-value map defining required or optional method request parameters that - // can be accepted by Amazon API Gateway. A key is a method request parameter - // name matching the pattern of method.request.{location}.{name}, where location - // is querystring, path, or header and name is a valid and unique parameter - // name. The value associated with the key is a Boolean flag indicating whether - // the parameter is required (true) or optional (false). The method request - // parameter names defined here are available in Integration to be mapped to - // integration request parameters or templates. - RequestParameters map[string]*bool `locationName:"requestParameters" type:"map"` -} - -// String returns the string representation -func (s Method) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Method) GoString() string { - return s.String() -} - -// SetApiKeyRequired sets the ApiKeyRequired field's value. -func (s *Method) SetApiKeyRequired(v bool) *Method { - s.ApiKeyRequired = &v - return s -} - -// SetAuthorizationType sets the AuthorizationType field's value. -func (s *Method) SetAuthorizationType(v string) *Method { - s.AuthorizationType = &v - return s -} - -// SetAuthorizerId sets the AuthorizerId field's value. -func (s *Method) SetAuthorizerId(v string) *Method { - s.AuthorizerId = &v - return s -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *Method) SetHttpMethod(v string) *Method { - s.HttpMethod = &v - return s -} - -// SetMethodIntegration sets the MethodIntegration field's value. -func (s *Method) SetMethodIntegration(v *Integration) *Method { - s.MethodIntegration = v - return s -} - -// SetMethodResponses sets the MethodResponses field's value. -func (s *Method) SetMethodResponses(v map[string]*MethodResponse) *Method { - s.MethodResponses = v - return s -} - -// SetOperationName sets the OperationName field's value. -func (s *Method) SetOperationName(v string) *Method { - s.OperationName = &v - return s -} - -// SetRequestModels sets the RequestModels field's value. -func (s *Method) SetRequestModels(v map[string]*string) *Method { - s.RequestModels = v - return s -} - -// SetRequestParameters sets the RequestParameters field's value. -func (s *Method) SetRequestParameters(v map[string]*bool) *Method { - s.RequestParameters = v - return s -} - -// Represents a method response of a given HTTP status code returned to the -// client. The method response is passed from the back end through the associated -// integration response that can be transformed using a mapping template. -// -// Example: A MethodResponse instance of an API -// -// Request -// -// The example request retrieves a MethodResponse of the 200 status code. -// -// GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200 -// HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com -// X-Amz-Date: 20160603T222952Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160603/us-east-1/apigateway/aws4_request, -// SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} -// Response -// -// The successful response returns 200 OK status and a payload as follows: -// -// { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", -// "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", -// "title": "200" }, "methodresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" -// }, "methodresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" -// } }, "responseModels": { "application/json": "Empty" }, "responseParameters": -// { "method.response.header.Content-Type": false }, "statusCode": "200" -// } -type MethodResponse struct { - _ struct{} `type:"structure"` - - // Specifies the Model resources used for the response's content-type. Response - // models are represented as a key/value map, with a content-type as the key - // and a Model name as the value. - ResponseModels map[string]*string `locationName:"responseModels" type:"map"` - - // A key-value map specifying required or optional response parameters that - // Amazon API Gateway can send back to the caller. A key defines a method response - // header and the value specifies whether the associated method response header - // is required or not. The expression of the key must match the pattern method.response.header.{name}, - // where name is a valid and unique header name. Amazon API Gateway passes certain - // integration response data to the method response headers specified here according - // to the mapping you prescribe in the API's IntegrationResponse. The integration - // response data that can be mapped include an integration response header expressed - // in integration.response.header.{name}, a static value enclosed within a pair - // of single quotes (e.g., 'application/json'), or a JSON expression from the - // back-end response payload in the form of integration.response.body.{JSON-expression}, - // where JSON-expression is a valid JSON expression without the $ prefix.) - ResponseParameters map[string]*bool `locationName:"responseParameters" type:"map"` - - // The method response's status code. - StatusCode *string `locationName:"statusCode" type:"string"` -} - -// String returns the string representation -func (s MethodResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MethodResponse) GoString() string { - return s.String() -} - -// SetResponseModels sets the ResponseModels field's value. -func (s *MethodResponse) SetResponseModels(v map[string]*string) *MethodResponse { - s.ResponseModels = v - return s -} - -// SetResponseParameters sets the ResponseParameters field's value. -func (s *MethodResponse) SetResponseParameters(v map[string]*bool) *MethodResponse { - s.ResponseParameters = v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *MethodResponse) SetStatusCode(v string) *MethodResponse { - s.StatusCode = &v - return s -} - -// Specifies the method setting properties. -type MethodSetting struct { - _ struct{} `type:"structure"` - - // Specifies whether the cached responses are encrypted. The PATCH path for - // this setting is /{method_setting_key}/caching/dataEncrypted, and the value - // is a Boolean. - CacheDataEncrypted *bool `locationName:"cacheDataEncrypted" type:"boolean"` - - // Specifies the time to live (TTL), in seconds, for cached responses. The higher - // the TTL, the longer the response will be cached. The PATCH path for this - // setting is /{method_setting_key}/caching/ttlInSeconds, and the value is an - // integer. - CacheTtlInSeconds *int64 `locationName:"cacheTtlInSeconds" type:"integer"` - - // Specifies whether responses should be cached and returned for requests. A - // cache cluster must be enabled on the stage for responses to be cached. The - // PATCH path for this setting is /{method_setting_key}/caching/enabled, and - // the value is a Boolean. - CachingEnabled *bool `locationName:"cachingEnabled" type:"boolean"` - - // Specifies whether data trace logging is enabled for this method, which effects - // the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this - // setting is /{method_setting_key}/logging/dataTrace, and the value is a Boolean. - DataTraceEnabled *bool `locationName:"dataTraceEnabled" type:"boolean"` - - // Specifies the logging level for this method, which effects the log entries - // pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/loglevel, - // and the available levels are OFF, ERROR, and INFO. - LoggingLevel *string `locationName:"loggingLevel" type:"string"` - - // Specifies whether Amazon CloudWatch metrics are enabled for this method. - // The PATCH path for this setting is /{method_setting_key}/metrics/enabled, - // and the value is a Boolean. - MetricsEnabled *bool `locationName:"metricsEnabled" type:"boolean"` - - // Specifies whether authorization is required for a cache invalidation request. - // The PATCH path for this setting is /{method_setting_key}/caching/requireAuthorizationForCacheControl, - // and the value is a Boolean. - RequireAuthorizationForCacheControl *bool `locationName:"requireAuthorizationForCacheControl" type:"boolean"` - - // Specifies the throttling burst limit. The PATCH path for this setting is - // /{method_setting_key}/throttling/burstLimit, and the value is an integer. - ThrottlingBurstLimit *int64 `locationName:"throttlingBurstLimit" type:"integer"` - - // Specifies the throttling rate limit. The PATCH path for this setting is /{method_setting_key}/throttling/rateLimit, - // and the value is a double. - ThrottlingRateLimit *float64 `locationName:"throttlingRateLimit" type:"double"` - - // Specifies how to handle unauthorized requests for cache invalidation. The - // PATCH path for this setting is /{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy, - // and the available values are FAIL_WITH_403, SUCCEED_WITH_RESPONSE_HEADER, - // SUCCEED_WITHOUT_RESPONSE_HEADER. - UnauthorizedCacheControlHeaderStrategy *string `locationName:"unauthorizedCacheControlHeaderStrategy" type:"string" enum:"UnauthorizedCacheControlHeaderStrategy"` -} - -// String returns the string representation -func (s MethodSetting) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MethodSetting) GoString() string { - return s.String() -} - -// SetCacheDataEncrypted sets the CacheDataEncrypted field's value. -func (s *MethodSetting) SetCacheDataEncrypted(v bool) *MethodSetting { - s.CacheDataEncrypted = &v - return s -} - -// SetCacheTtlInSeconds sets the CacheTtlInSeconds field's value. -func (s *MethodSetting) SetCacheTtlInSeconds(v int64) *MethodSetting { - s.CacheTtlInSeconds = &v - return s -} - -// SetCachingEnabled sets the CachingEnabled field's value. -func (s *MethodSetting) SetCachingEnabled(v bool) *MethodSetting { - s.CachingEnabled = &v - return s -} - -// SetDataTraceEnabled sets the DataTraceEnabled field's value. -func (s *MethodSetting) SetDataTraceEnabled(v bool) *MethodSetting { - s.DataTraceEnabled = &v - return s -} - -// SetLoggingLevel sets the LoggingLevel field's value. -func (s *MethodSetting) SetLoggingLevel(v string) *MethodSetting { - s.LoggingLevel = &v - return s -} - -// SetMetricsEnabled sets the MetricsEnabled field's value. -func (s *MethodSetting) SetMetricsEnabled(v bool) *MethodSetting { - s.MetricsEnabled = &v - return s -} - -// SetRequireAuthorizationForCacheControl sets the RequireAuthorizationForCacheControl field's value. -func (s *MethodSetting) SetRequireAuthorizationForCacheControl(v bool) *MethodSetting { - s.RequireAuthorizationForCacheControl = &v - return s -} - -// SetThrottlingBurstLimit sets the ThrottlingBurstLimit field's value. -func (s *MethodSetting) SetThrottlingBurstLimit(v int64) *MethodSetting { - s.ThrottlingBurstLimit = &v - return s -} - -// SetThrottlingRateLimit sets the ThrottlingRateLimit field's value. -func (s *MethodSetting) SetThrottlingRateLimit(v float64) *MethodSetting { - s.ThrottlingRateLimit = &v - return s -} - -// SetUnauthorizedCacheControlHeaderStrategy sets the UnauthorizedCacheControlHeaderStrategy field's value. -func (s *MethodSetting) SetUnauthorizedCacheControlHeaderStrategy(v string) *MethodSetting { - s.UnauthorizedCacheControlHeaderStrategy = &v - return s -} - -// Represents a summary of a Method resource, given a particular date and time. -type MethodSnapshot struct { - _ struct{} `type:"structure"` - - // Specifies whether the method requires a valid ApiKey. - ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` - - // Specifies the type of authorization used for the method. - AuthorizationType *string `locationName:"authorizationType" type:"string"` -} - -// String returns the string representation -func (s MethodSnapshot) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MethodSnapshot) GoString() string { - return s.String() -} - -// SetApiKeyRequired sets the ApiKeyRequired field's value. -func (s *MethodSnapshot) SetApiKeyRequired(v bool) *MethodSnapshot { - s.ApiKeyRequired = &v - return s -} - -// SetAuthorizationType sets the AuthorizationType field's value. -func (s *MethodSnapshot) SetAuthorizationType(v string) *MethodSnapshot { - s.AuthorizationType = &v - return s -} - -// Represents the data structure of a method's request or response payload. -// -// A request model defines the data structure of the client-supplied request -// payload. A response model defines the data structure of the response payload -// returned by the back end. Although not required, models are useful for mapping -// payloads between the front end and back end. -// -// A model is used for generating an API's SDK, validating the input request -// body, and creating a skeletal mapping template. -// -// Method, MethodResponse, Models and Mappings (http://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html) -type Model struct { - _ struct{} `type:"structure"` - - // The content-type for the model. - ContentType *string `locationName:"contentType" type:"string"` - - // The description of the model. - Description *string `locationName:"description" type:"string"` - - // The identifier for the model resource. - Id *string `locationName:"id" type:"string"` - - // The name of the model. - Name *string `locationName:"name" type:"string"` - - // The schema for the model. For application/json models, this should be JSON-schema - // draft v4 (http://json-schema.org/documentation.html) model. Do not include - // "\*/" characters in the description of any properties because such "\*/" - // characters may be interpreted as the closing marker for comments in some - // languages, such as Java or JavaScript, causing the installation of your API's - // SDK generated by API Gateway to fail. - Schema *string `locationName:"schema" type:"string"` -} - -// String returns the string representation -func (s Model) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Model) GoString() string { - return s.String() -} - -// SetContentType sets the ContentType field's value. -func (s *Model) SetContentType(v string) *Model { - s.ContentType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Model) SetDescription(v string) *Model { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *Model) SetId(v string) *Model { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *Model) SetName(v string) *Model { - s.Name = &v - return s -} - -// SetSchema sets the Schema field's value. -func (s *Model) SetSchema(v string) *Model { - s.Schema = &v - return s -} - -// A single patch operation to apply to the specified resource. Please refer -// to http://tools.ietf.org/html/rfc6902#section-4 for an explanation of how -// each operation is used. -type PatchOperation struct { - _ struct{} `type:"structure"` - - // Not supported. - From *string `locationName:"from" type:"string"` - - // An update operation to be performed with this PATCH request. The valid value - // can be "add", "remove", or "replace". Not all valid operations are supported - // for a given resource. Support of the operations depends on specific operational - // contexts. Attempts to apply an unsupported operation on a resource will return - // an error message. - Op *string `locationName:"op" type:"string" enum:"Op"` - - // The op operation's target, as identified by a JSON Pointer (https://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08) - // value that references a location within the targeted resource. For example, - // if the target resource has an updateable property of {"name":"value"}, the - // path for this property is /name. If the name property value is a JSON object - // (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name - // property will be /name/child~1name. Any slash ("/") character appearing in - // path names must be escaped with "~1", as shown in the example above. Each - // op operation can have only one path associated with it. - Path *string `locationName:"path" type:"string"` - - // The new target value of the update operation. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s PatchOperation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchOperation) GoString() string { - return s.String() -} - -// SetFrom sets the From field's value. -func (s *PatchOperation) SetFrom(v string) *PatchOperation { - s.From = &v - return s -} - -// SetOp sets the Op field's value. -func (s *PatchOperation) SetOp(v string) *PatchOperation { - s.Op = &v - return s -} - -// SetPath sets the Path field's value. -func (s *PatchOperation) SetPath(v string) *PatchOperation { - s.Path = &v - return s -} - -// SetValue sets the Value field's value. -func (s *PatchOperation) SetValue(v string) *PatchOperation { - s.Value = &v - return s -} - -// Represents a put integration request. -type PutIntegrationInput struct { - _ struct{} `type:"structure"` - - // Specifies a put integration input's cache key parameters. - CacheKeyParameters []*string `locationName:"cacheKeyParameters" type:"list"` - - // Specifies a put integration input's cache namespace. - CacheNamespace *string `locationName:"cacheNamespace" type:"string"` - - // Specifies how to handle request payload content type conversions. Supported - // values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors: - // - // * CONVERT_TO_BINARY: Converts a request payload from a Base64-encoded - // string to the corresponding binary blob. - // - // * CONVERT_TO_TEXT: Converts a request payload from a binary blob to a - // Base64-encoded string. - // - // If this property is not defined, the request payload will be passed through - // from the method request to integration request without modification, provided - // that the passthroughBehaviors is configured to support payload pass-through. - ContentHandling *string `locationName:"contentHandling" type:"string" enum:"ContentHandlingStrategy"` - - // Specifies whether credentials are required for a put integration. - Credentials *string `locationName:"credentials" type:"string"` - - // Specifies a put integration request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // Specifies a put integration HTTP method. When the integration type is HTTP - // or AWS, this field is required. - IntegrationHttpMethod *string `locationName:"httpMethod" type:"string"` - - // Specifies the pass-through behavior for incoming requests based on the Content-Type - // header in the request, and the available mapping templates specified as the - // requestTemplates property on the Integration resource. There are three valid - // values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER. - // - // * WHEN_NO_MATCH passes the request body for unmapped content types through - // to the integration back end without transformation. - // - // * NEVER rejects unmapped content types with an HTTP 415 'Unsupported Media - // Type' response. - // - // * WHEN_NO_TEMPLATES allows pass-through when the integration has NO content - // types mapped to templates. However if there is at least one content type - // defined, unmapped content types will be rejected with the same 415 response. - PassthroughBehavior *string `locationName:"passthroughBehavior" type:"string"` - - // A key-value map specifying request parameters that are passed from the method - // request to the back end. The key is an integration request parameter name - // and the associated value is a method request parameter value or static value - // that must be enclosed within single quotes and pre-encoded as required by - // the back end. The method request parameter value must match the pattern of - // method.request.{location}.{name}, where location is querystring, path, or - // header and name must be a valid and unique method request parameter name. - RequestParameters map[string]*string `locationName:"requestParameters" type:"map"` - - // Represents a map of Velocity templates that are applied on the request payload - // based on the value of the Content-Type header sent by the client. The content - // type value is the key in this map, and the template (as a String) is the - // value. - RequestTemplates map[string]*string `locationName:"requestTemplates" type:"map"` - - // Specifies a put integration request's resource ID. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Specifies a put integration request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // Specifies a put integration input's type. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"IntegrationType"` - - // Specifies a put integration input's Uniform Resource Identifier (URI). When - // the integration type is HTTP or AWS, this field is required. For integration - // with Lambda as an AWS service proxy, this value is of the 'arn:aws:apigateway::lambda:path/2015-03-31/functions//invocations' - // format. - Uri *string `locationName:"uri" type:"string"` -} - -// String returns the string representation -func (s PutIntegrationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutIntegrationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutIntegrationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutIntegrationInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheKeyParameters sets the CacheKeyParameters field's value. -func (s *PutIntegrationInput) SetCacheKeyParameters(v []*string) *PutIntegrationInput { - s.CacheKeyParameters = v - return s -} - -// SetCacheNamespace sets the CacheNamespace field's value. -func (s *PutIntegrationInput) SetCacheNamespace(v string) *PutIntegrationInput { - s.CacheNamespace = &v - return s -} - -// SetContentHandling sets the ContentHandling field's value. -func (s *PutIntegrationInput) SetContentHandling(v string) *PutIntegrationInput { - s.ContentHandling = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *PutIntegrationInput) SetCredentials(v string) *PutIntegrationInput { - s.Credentials = &v - return s -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *PutIntegrationInput) SetHttpMethod(v string) *PutIntegrationInput { - s.HttpMethod = &v - return s -} - -// SetIntegrationHttpMethod sets the IntegrationHttpMethod field's value. -func (s *PutIntegrationInput) SetIntegrationHttpMethod(v string) *PutIntegrationInput { - s.IntegrationHttpMethod = &v - return s -} - -// SetPassthroughBehavior sets the PassthroughBehavior field's value. -func (s *PutIntegrationInput) SetPassthroughBehavior(v string) *PutIntegrationInput { - s.PassthroughBehavior = &v - return s -} - -// SetRequestParameters sets the RequestParameters field's value. -func (s *PutIntegrationInput) SetRequestParameters(v map[string]*string) *PutIntegrationInput { - s.RequestParameters = v - return s -} - -// SetRequestTemplates sets the RequestTemplates field's value. -func (s *PutIntegrationInput) SetRequestTemplates(v map[string]*string) *PutIntegrationInput { - s.RequestTemplates = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *PutIntegrationInput) SetResourceId(v string) *PutIntegrationInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *PutIntegrationInput) SetRestApiId(v string) *PutIntegrationInput { - s.RestApiId = &v - return s -} - -// SetType sets the Type field's value. -func (s *PutIntegrationInput) SetType(v string) *PutIntegrationInput { - s.Type = &v - return s -} - -// SetUri sets the Uri field's value. -func (s *PutIntegrationInput) SetUri(v string) *PutIntegrationInput { - s.Uri = &v - return s -} - -// Represents a put integration response request. -type PutIntegrationResponseInput struct { - _ struct{} `type:"structure"` - - // Specifies how to handle response payload content type conversions. Supported - // values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors: - // - // * CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded - // string to the corresponding binary blob. - // - // * CONVERT_TO_TEXT: Converts a response payload from a binary blob to a - // Base64-encoded string. - // - // If this property is not defined, the response payload will be passed through - // from the integration response to the method response without modification. - ContentHandling *string `locationName:"contentHandling" type:"string" enum:"ContentHandlingStrategy"` - - // Specifies a put integration response request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // Specifies a put integration response request's resource identifier. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // A key-value map specifying response parameters that are passed to the method - // response from the back end. The key is a method response header parameter - // name and the mapped value is an integration response header value, a static - // value enclosed within a pair of single quotes, or a JSON expression from - // the integration response body. The mapping key must match the pattern of - // method.response.header.{name}, where name is a valid and unique header name. - // The mapped non-static value must match the pattern of integration.response.header.{name} - // or integration.response.body.{JSON-expression}, where name must be a valid - // and unique response header name and JSON-expression a valid JSON expression - // without the $ prefix. - ResponseParameters map[string]*string `locationName:"responseParameters" type:"map"` - - // Specifies a put integration response's templates. - ResponseTemplates map[string]*string `locationName:"responseTemplates" type:"map"` - - // Specifies a put integration response request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // Specifies the selection pattern of a put integration response. - SelectionPattern *string `locationName:"selectionPattern" type:"string"` - - // Specifies the status code that is used to map the integration response to - // an existing MethodResponse. - // - // StatusCode is a required field - StatusCode *string `location:"uri" locationName:"status_code" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutIntegrationResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutIntegrationResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutIntegrationResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutIntegrationResponseInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentHandling sets the ContentHandling field's value. -func (s *PutIntegrationResponseInput) SetContentHandling(v string) *PutIntegrationResponseInput { - s.ContentHandling = &v - return s -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *PutIntegrationResponseInput) SetHttpMethod(v string) *PutIntegrationResponseInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *PutIntegrationResponseInput) SetResourceId(v string) *PutIntegrationResponseInput { - s.ResourceId = &v - return s -} - -// SetResponseParameters sets the ResponseParameters field's value. -func (s *PutIntegrationResponseInput) SetResponseParameters(v map[string]*string) *PutIntegrationResponseInput { - s.ResponseParameters = v - return s -} - -// SetResponseTemplates sets the ResponseTemplates field's value. -func (s *PutIntegrationResponseInput) SetResponseTemplates(v map[string]*string) *PutIntegrationResponseInput { - s.ResponseTemplates = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *PutIntegrationResponseInput) SetRestApiId(v string) *PutIntegrationResponseInput { - s.RestApiId = &v - return s -} - -// SetSelectionPattern sets the SelectionPattern field's value. -func (s *PutIntegrationResponseInput) SetSelectionPattern(v string) *PutIntegrationResponseInput { - s.SelectionPattern = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *PutIntegrationResponseInput) SetStatusCode(v string) *PutIntegrationResponseInput { - s.StatusCode = &v - return s -} - -// Request to add a method to an existing Resource resource. -type PutMethodInput struct { - _ struct{} `type:"structure"` - - // Specifies whether the method required a valid ApiKey. - ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` - - // Specifies the type of authorization used for the method. - // - // AuthorizationType is a required field - AuthorizationType *string `locationName:"authorizationType" type:"string" required:"true"` - - // Specifies the identifier of an Authorizer to use on this Method, if the type - // is CUSTOM. - AuthorizerId *string `locationName:"authorizerId" type:"string"` - - // Specifies the method request's HTTP method type. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // A human-friendly operation identifier for the method. For example, you can - // assign the operationName of ListPets for the GET /pets method in PetStore - // (http://petstore-demo-endpoint.execute-api.com/petstore/pets) example. - OperationName *string `locationName:"operationName" type:"string"` - - // Specifies the Model resources used for the request's content type. Request - // models are represented as a key/value map, with a content type as the key - // and a Model name as the value. - RequestModels map[string]*string `locationName:"requestModels" type:"map"` - - // A key-value map defining required or optional method request parameters that - // can be accepted by Amazon API Gateway. A key defines a method request parameter - // name matching the pattern of method.request.{location}.{name}, where location - // is querystring, path, or header and name is a valid and unique parameter - // name. The value associated with the key is a Boolean flag indicating whether - // the parameter is required (true) or optional (false). The method request - // parameter names defined here are available in Integration to be mapped to - // integration request parameters or body-mapping templates. - RequestParameters map[string]*bool `locationName:"requestParameters" type:"map"` - - // The Resource identifier for the new Method resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the new Method resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutMethodInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutMethodInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutMethodInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutMethodInput"} - if s.AuthorizationType == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizationType")) - } - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApiKeyRequired sets the ApiKeyRequired field's value. -func (s *PutMethodInput) SetApiKeyRequired(v bool) *PutMethodInput { - s.ApiKeyRequired = &v - return s -} - -// SetAuthorizationType sets the AuthorizationType field's value. -func (s *PutMethodInput) SetAuthorizationType(v string) *PutMethodInput { - s.AuthorizationType = &v - return s -} - -// SetAuthorizerId sets the AuthorizerId field's value. -func (s *PutMethodInput) SetAuthorizerId(v string) *PutMethodInput { - s.AuthorizerId = &v - return s -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *PutMethodInput) SetHttpMethod(v string) *PutMethodInput { - s.HttpMethod = &v - return s -} - -// SetOperationName sets the OperationName field's value. -func (s *PutMethodInput) SetOperationName(v string) *PutMethodInput { - s.OperationName = &v - return s -} - -// SetRequestModels sets the RequestModels field's value. -func (s *PutMethodInput) SetRequestModels(v map[string]*string) *PutMethodInput { - s.RequestModels = v - return s -} - -// SetRequestParameters sets the RequestParameters field's value. -func (s *PutMethodInput) SetRequestParameters(v map[string]*bool) *PutMethodInput { - s.RequestParameters = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *PutMethodInput) SetResourceId(v string) *PutMethodInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *PutMethodInput) SetRestApiId(v string) *PutMethodInput { - s.RestApiId = &v - return s -} - -// Request to add a MethodResponse to an existing Method resource. -type PutMethodResponseInput struct { - _ struct{} `type:"structure"` - - // The HTTP verb of the Method resource. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // The Resource identifier for the Method resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Specifies the Model resources used for the response's content type. Response - // models are represented as a key/value map, with a content type as the key - // and a Model name as the value. - ResponseModels map[string]*string `locationName:"responseModels" type:"map"` - - // A key-value map specifying required or optional response parameters that - // Amazon API Gateway can send back to the caller. A key defines a method response - // header name and the associated value is a Boolean flag indicating whether - // the method response parameter is required or not. The method response header - // names must match the pattern of method.response.header.{name}, where name - // is a valid and unique header name. The response parameter names defined here - // are available in the integration response to be mapped from an integration - // response header expressed in integration.response.header.{name}, a static - // value enclosed within a pair of single quotes (e.g., 'application/json'), - // or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}, - // where JSON-expression is a valid JSON expression without the $ prefix.) - ResponseParameters map[string]*bool `locationName:"responseParameters" type:"map"` - - // The RestApi identifier for the Method resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The method response's status code. - // - // StatusCode is a required field - StatusCode *string `location:"uri" locationName:"status_code" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutMethodResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutMethodResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutMethodResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutMethodResponseInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *PutMethodResponseInput) SetHttpMethod(v string) *PutMethodResponseInput { - s.HttpMethod = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *PutMethodResponseInput) SetResourceId(v string) *PutMethodResponseInput { - s.ResourceId = &v - return s -} - -// SetResponseModels sets the ResponseModels field's value. -func (s *PutMethodResponseInput) SetResponseModels(v map[string]*string) *PutMethodResponseInput { - s.ResponseModels = v - return s -} - -// SetResponseParameters sets the ResponseParameters field's value. -func (s *PutMethodResponseInput) SetResponseParameters(v map[string]*bool) *PutMethodResponseInput { - s.ResponseParameters = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *PutMethodResponseInput) SetRestApiId(v string) *PutMethodResponseInput { - s.RestApiId = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *PutMethodResponseInput) SetStatusCode(v string) *PutMethodResponseInput { - s.StatusCode = &v - return s -} - -// A PUT request to update an existing API, with external API definitions specified -// as the request body. -type PutRestApiInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The PUT request body containing external API definitions. Currently, only - // Swagger definition JSON files are supported. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true"` - - // A query parameter to indicate whether to rollback the API update (true) or - // not (false) when a warning is encountered. The default value is false. - FailOnWarnings *bool `location:"querystring" locationName:"failonwarnings" type:"boolean"` - - // The mode query parameter to specify the update mode. Valid values are "merge" - // and "overwrite". By default, the update mode is "merge". - Mode *string `location:"querystring" locationName:"mode" type:"string" enum:"PutMode"` - - // Custom headers supplied as part of the request. - Parameters map[string]*string `location:"querystring" locationName:"parameters" type:"map"` - - // The identifier of the RestApi to be updated. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutRestApiInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRestApiInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRestApiInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRestApiInput"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *PutRestApiInput) SetBody(v []byte) *PutRestApiInput { - s.Body = v - return s -} - -// SetFailOnWarnings sets the FailOnWarnings field's value. -func (s *PutRestApiInput) SetFailOnWarnings(v bool) *PutRestApiInput { - s.FailOnWarnings = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *PutRestApiInput) SetMode(v string) *PutRestApiInput { - s.Mode = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *PutRestApiInput) SetParameters(v map[string]*string) *PutRestApiInput { - s.Parameters = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *PutRestApiInput) SetRestApiId(v string) *PutRestApiInput { - s.RestApiId = &v - return s -} - -// Quotas configured for a usage plan. -type QuotaSettings struct { - _ struct{} `type:"structure"` - - // The maximum number of requests that can be made in a given time period. - Limit *int64 `locationName:"limit" type:"integer"` - - // The number of requests subtracted from the given limit in the initial time - // period. - Offset *int64 `locationName:"offset" type:"integer"` - - // The time period in which the limit applies. Valid values are "DAY", "WEEK" - // or "MONTH". - Period *string `locationName:"period" type:"string" enum:"QuotaPeriodType"` -} - -// String returns the string representation -func (s QuotaSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s QuotaSettings) GoString() string { - return s.String() -} - -// SetLimit sets the Limit field's value. -func (s *QuotaSettings) SetLimit(v int64) *QuotaSettings { - s.Limit = &v - return s -} - -// SetOffset sets the Offset field's value. -func (s *QuotaSettings) SetOffset(v int64) *QuotaSettings { - s.Offset = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *QuotaSettings) SetPeriod(v string) *QuotaSettings { - s.Period = &v - return s -} - -// Represents an API resource. -// -// Create an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html) -type Resource struct { - _ struct{} `type:"structure"` - - // The resource's identifier. - Id *string `locationName:"id" type:"string"` - - // The parent resource's identifier. - ParentId *string `locationName:"parentId" type:"string"` - - // The full path for this resource. - Path *string `locationName:"path" type:"string"` - - // The last path segment for this resource. - PathPart *string `locationName:"pathPart" type:"string"` - - // Gets an API resource's method of a given HTTP verb. - // - // The resource methods are a map of methods indexed by methods' HTTP verbs - // enabled on the resource. This method map is included in the 200 OK response - // of the GET /restapis/{restapi_id}/resources/{resource_id} or GET /restapis/{restapi_id}/resources/{resource_id}?embed=methods - // request. - // - // Example: Get the GET method of an API resource - // - // Request - // - // GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET HTTP/1.1 Content-Type: - // application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160608T031827Z - // Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160608/us-east-1/apigateway/aws4_request, - // SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} - // Response - // - // { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", - // "name": "integration", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", - // "name": "integrationresponse", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-{rel}.html", - // "name": "method", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", - // "name": "methodresponse", "templated": true } ], "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET", - // "name": "GET", "title": "GET" }, "integration:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" - // }, "method:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" - // }, "method:integration": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" - // }, "method:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", - // "name": "200", "title": "200" }, "method:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" - // }, "methodresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/{status_code}", - // "templated": true } }, "apiKeyRequired": false, "authorizationType": "NONE", - // "httpMethod": "GET", "_embedded": { "method:integration": { "_links": { "self": - // { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" - // }, "integration:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" - // }, "integration:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", - // "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" - // }, "integrationresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/{status_code}", - // "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "3kzxbg5sa2", - // "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": - // "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestParameters": { "integration.request.header.Content-Type": - // "'application/x-amz-json-1.1'" }, "requestTemplates": { "application/json": - // "{\n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-east-1:kinesis:action/ListStreams", - // "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", - // "name": "200", "title": "200" }, "integrationresponse:delete": { "href": - // "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" - // }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" - // } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" - // }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream - // in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" - // }, "statusCode": "200" } } }, "method:responses": { "_links": { "self": { - // "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", - // "name": "200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" - // }, "methodresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" - // } }, "responseModels": { "application/json": "Empty" }, "responseParameters": - // { "method.response.header.Content-Type": false }, "statusCode": "200" } } - // } - // If the OPTIONS is enabled on the resource, you can follow the example here - // to get that method. Just replace the GET of the last path segment in the - // request URL with OPTIONS. - ResourceMethods map[string]*Method `locationName:"resourceMethods" type:"map"` -} - -// String returns the string representation -func (s Resource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Resource) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *Resource) SetId(v string) *Resource { - s.Id = &v - return s -} - -// SetParentId sets the ParentId field's value. -func (s *Resource) SetParentId(v string) *Resource { - s.ParentId = &v - return s -} - -// SetPath sets the Path field's value. -func (s *Resource) SetPath(v string) *Resource { - s.Path = &v - return s -} - -// SetPathPart sets the PathPart field's value. -func (s *Resource) SetPathPart(v string) *Resource { - s.PathPart = &v - return s -} - -// SetResourceMethods sets the ResourceMethods field's value. -func (s *Resource) SetResourceMethods(v map[string]*Method) *Resource { - s.ResourceMethods = v - return s -} - -// Represents a REST API. -// -// Create an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html) -type RestApi struct { - _ struct{} `type:"structure"` - - // The list of binary media types supported by the RestApi. By default, the - // RestApi supports only UTF-8-encoded text payloads. - BinaryMediaTypes []*string `locationName:"binaryMediaTypes" type:"list"` - - // The timestamp when the API was created. - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"` - - // The API's description. - Description *string `locationName:"description" type:"string"` - - // The API's identifier. This identifier is unique across all of your APIs in - // Amazon API Gateway. - Id *string `locationName:"id" type:"string"` - - // The API's name. - Name *string `locationName:"name" type:"string"` - - // A version identifier for the API. - Version *string `locationName:"version" type:"string"` - - // The warning messages reported when failonwarnings is turned on during API - // import. - Warnings []*string `locationName:"warnings" type:"list"` -} - -// String returns the string representation -func (s RestApi) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestApi) GoString() string { - return s.String() -} - -// SetBinaryMediaTypes sets the BinaryMediaTypes field's value. -func (s *RestApi) SetBinaryMediaTypes(v []*string) *RestApi { - s.BinaryMediaTypes = v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *RestApi) SetCreatedDate(v time.Time) *RestApi { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *RestApi) SetDescription(v string) *RestApi { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *RestApi) SetId(v string) *RestApi { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *RestApi) SetName(v string) *RestApi { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *RestApi) SetVersion(v string) *RestApi { - s.Version = &v - return s -} - -// SetWarnings sets the Warnings field's value. -func (s *RestApi) SetWarnings(v []*string) *RestApi { - s.Warnings = v - return s -} - -// A configuration property of an SDK type. -type SdkConfigurationProperty struct { - _ struct{} `type:"structure"` - - // The default value of an SdkType configuration property. - DefaultValue *string `locationName:"defaultValue" type:"string"` - - // The description of an SdkType configuration property. - Description *string `locationName:"description" type:"string"` - - // The user-friendly name of an SdkType configuration property. - FriendlyName *string `locationName:"friendlyName" type:"string"` - - // The name of a an SdkType configuration property. - Name *string `locationName:"name" type:"string"` - - // A boolean flag of an SdkType configuration property to indicate if the associated - // SDK configuration property is required (true) or not (false). - Required *bool `locationName:"required" type:"boolean"` -} - -// String returns the string representation -func (s SdkConfigurationProperty) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SdkConfigurationProperty) GoString() string { - return s.String() -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *SdkConfigurationProperty) SetDefaultValue(v string) *SdkConfigurationProperty { - s.DefaultValue = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *SdkConfigurationProperty) SetDescription(v string) *SdkConfigurationProperty { - s.Description = &v - return s -} - -// SetFriendlyName sets the FriendlyName field's value. -func (s *SdkConfigurationProperty) SetFriendlyName(v string) *SdkConfigurationProperty { - s.FriendlyName = &v - return s -} - -// SetName sets the Name field's value. -func (s *SdkConfigurationProperty) SetName(v string) *SdkConfigurationProperty { - s.Name = &v - return s -} - -// SetRequired sets the Required field's value. -func (s *SdkConfigurationProperty) SetRequired(v bool) *SdkConfigurationProperty { - s.Required = &v - return s -} - -// A type of SDK that API Gateway can generate. -type SdkType struct { - _ struct{} `type:"structure"` - - // A list of configuration properties of an SdkType. - ConfigurationProperties []*SdkConfigurationProperty `locationName:"configurationProperties" type:"list"` - - // The description of an SdkType. - Description *string `locationName:"description" type:"string"` - - // The user-friendly name of an SdkType instance. - FriendlyName *string `locationName:"friendlyName" type:"string"` - - // The identifier of an SdkType instance. - Id *string `locationName:"id" type:"string"` -} - -// String returns the string representation -func (s SdkType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SdkType) GoString() string { - return s.String() -} - -// SetConfigurationProperties sets the ConfigurationProperties field's value. -func (s *SdkType) SetConfigurationProperties(v []*SdkConfigurationProperty) *SdkType { - s.ConfigurationProperties = v - return s -} - -// SetDescription sets the Description field's value. -func (s *SdkType) SetDescription(v string) *SdkType { - s.Description = &v - return s -} - -// SetFriendlyName sets the FriendlyName field's value. -func (s *SdkType) SetFriendlyName(v string) *SdkType { - s.FriendlyName = &v - return s -} - -// SetId sets the Id field's value. -func (s *SdkType) SetId(v string) *SdkType { - s.Id = &v - return s -} - -// Represents a unique identifier for a version of a deployed RestApi that is -// callable by users. -// -// Deploy an API (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-deploy-api.html) -type Stage struct { - _ struct{} `type:"structure"` - - // Specifies whether a cache cluster is enabled for the stage. - CacheClusterEnabled *bool `locationName:"cacheClusterEnabled" type:"boolean"` - - // The size of the cache cluster for the stage, if enabled. - CacheClusterSize *string `locationName:"cacheClusterSize" type:"string" enum:"CacheClusterSize"` - - // The status of the cache cluster for the stage, if enabled. - CacheClusterStatus *string `locationName:"cacheClusterStatus" type:"string" enum:"CacheClusterStatus"` - - // The identifier of a client certificate for an API stage. - ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` - - // The timestamp when the stage was created. - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"` - - // The identifier of the Deployment that the stage points to. - DeploymentId *string `locationName:"deploymentId" type:"string"` - - // The stage's description. - Description *string `locationName:"description" type:"string"` - - // The version of the associated API documentation. - DocumentationVersion *string `locationName:"documentationVersion" type:"string"` - - // The timestamp when the stage last updated. - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"unix"` - - // A map that defines the method settings for a Stage resource. Keys (designated - // as /{method_setting_key below) are method paths defined as {resource_path}/{http_method} - // for an individual method override, or /\*/\* for overriding all methods in - // the stage. - MethodSettings map[string]*MethodSetting `locationName:"methodSettings" type:"map"` - - // The name of the stage is the first path segment in the Uniform Resource Identifier - // (URI) of a call to Amazon API Gateway. - StageName *string `locationName:"stageName" type:"string"` - - // A map that defines the stage variables for a Stage resource. Variable names - // can have alphanumeric and underscore characters, and the values must match - // [A-Za-z0-9-._~:/?#&=,]+. - Variables map[string]*string `locationName:"variables" type:"map"` -} - -// String returns the string representation -func (s Stage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Stage) GoString() string { - return s.String() -} - -// SetCacheClusterEnabled sets the CacheClusterEnabled field's value. -func (s *Stage) SetCacheClusterEnabled(v bool) *Stage { - s.CacheClusterEnabled = &v - return s -} - -// SetCacheClusterSize sets the CacheClusterSize field's value. -func (s *Stage) SetCacheClusterSize(v string) *Stage { - s.CacheClusterSize = &v - return s -} - -// SetCacheClusterStatus sets the CacheClusterStatus field's value. -func (s *Stage) SetCacheClusterStatus(v string) *Stage { - s.CacheClusterStatus = &v - return s -} - -// SetClientCertificateId sets the ClientCertificateId field's value. -func (s *Stage) SetClientCertificateId(v string) *Stage { - s.ClientCertificateId = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *Stage) SetCreatedDate(v time.Time) *Stage { - s.CreatedDate = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *Stage) SetDeploymentId(v string) *Stage { - s.DeploymentId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Stage) SetDescription(v string) *Stage { - s.Description = &v - return s -} - -// SetDocumentationVersion sets the DocumentationVersion field's value. -func (s *Stage) SetDocumentationVersion(v string) *Stage { - s.DocumentationVersion = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *Stage) SetLastUpdatedDate(v time.Time) *Stage { - s.LastUpdatedDate = &v - return s -} - -// SetMethodSettings sets the MethodSettings field's value. -func (s *Stage) SetMethodSettings(v map[string]*MethodSetting) *Stage { - s.MethodSettings = v - return s -} - -// SetStageName sets the StageName field's value. -func (s *Stage) SetStageName(v string) *Stage { - s.StageName = &v - return s -} - -// SetVariables sets the Variables field's value. -func (s *Stage) SetVariables(v map[string]*string) *Stage { - s.Variables = v - return s -} - -// A reference to a unique stage identified in the format {restApiId}/{stage}. -type StageKey struct { - _ struct{} `type:"structure"` - - // A list of Stage resources that are associated with the ApiKey resource. - RestApiId *string `locationName:"restApiId" type:"string"` - - // The stage name in the RestApi that the stage key references. - StageName *string `locationName:"stageName" type:"string"` -} - -// String returns the string representation -func (s StageKey) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StageKey) GoString() string { - return s.String() -} - -// SetRestApiId sets the RestApiId field's value. -func (s *StageKey) SetRestApiId(v string) *StageKey { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *StageKey) SetStageName(v string) *StageKey { - s.StageName = &v - return s -} - -// Make a request to simulate the execution of an Authorizer. -type TestInvokeAuthorizerInput struct { - _ struct{} `type:"structure"` - - // [Optional] A key-value map of additional context variables. - AdditionalContext map[string]*string `locationName:"additionalContext" type:"map"` - - // Specifies a test invoke authorizer request's Authorizer ID. - // - // AuthorizerId is a required field - AuthorizerId *string `location:"uri" locationName:"authorizer_id" type:"string" required:"true"` - - // [Optional] The simulated request body of an incoming invocation request. - Body *string `locationName:"body" type:"string"` - - // [Required] A key-value map of headers to simulate an incoming invocation - // request. This is where the incoming authorization token, or identity source, - // should be specified. - Headers map[string]*string `locationName:"headers" type:"map"` - - // [Optional] The URI path, including query string, of the simulated invocation - // request. Use this to specify path parameters and query string parameters. - PathWithQueryString *string `locationName:"pathWithQueryString" type:"string"` - - // Specifies a test invoke authorizer request's RestApi identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // A key-value map of stage variables to simulate an invocation on a deployed - // Stage. - StageVariables map[string]*string `locationName:"stageVariables" type:"map"` -} - -// String returns the string representation -func (s TestInvokeAuthorizerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestInvokeAuthorizerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestInvokeAuthorizerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestInvokeAuthorizerInput"} - if s.AuthorizerId == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizerId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalContext sets the AdditionalContext field's value. -func (s *TestInvokeAuthorizerInput) SetAdditionalContext(v map[string]*string) *TestInvokeAuthorizerInput { - s.AdditionalContext = v - return s -} - -// SetAuthorizerId sets the AuthorizerId field's value. -func (s *TestInvokeAuthorizerInput) SetAuthorizerId(v string) *TestInvokeAuthorizerInput { - s.AuthorizerId = &v - return s -} - -// SetBody sets the Body field's value. -func (s *TestInvokeAuthorizerInput) SetBody(v string) *TestInvokeAuthorizerInput { - s.Body = &v - return s -} - -// SetHeaders sets the Headers field's value. -func (s *TestInvokeAuthorizerInput) SetHeaders(v map[string]*string) *TestInvokeAuthorizerInput { - s.Headers = v - return s -} - -// SetPathWithQueryString sets the PathWithQueryString field's value. -func (s *TestInvokeAuthorizerInput) SetPathWithQueryString(v string) *TestInvokeAuthorizerInput { - s.PathWithQueryString = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *TestInvokeAuthorizerInput) SetRestApiId(v string) *TestInvokeAuthorizerInput { - s.RestApiId = &v - return s -} - -// SetStageVariables sets the StageVariables field's value. -func (s *TestInvokeAuthorizerInput) SetStageVariables(v map[string]*string) *TestInvokeAuthorizerInput { - s.StageVariables = v - return s -} - -// Represents the response of the test invoke request for a custom Authorizer -type TestInvokeAuthorizerOutput struct { - _ struct{} `type:"structure"` - - Authorization map[string][]*string `locationName:"authorization" type:"map"` - - // The open identity claims (http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims), - // with any supported custom attributes, returned from the Cognito Your User - // Pool configured for the API. - Claims map[string]*string `locationName:"claims" type:"map"` - - // The HTTP status code that the client would have received. Value is 0 if the - // authorizer succeeded. - ClientStatus *int64 `locationName:"clientStatus" type:"integer"` - - // The execution latency of the test authorizer request. - Latency *int64 `locationName:"latency" type:"long"` - - // The Amazon API Gateway execution log for the test authorizer request. - Log *string `locationName:"log" type:"string"` - - // The JSON policy document returned by the Authorizer - Policy *string `locationName:"policy" type:"string"` - - // The principal identity returned by the Authorizer - PrincipalId *string `locationName:"principalId" type:"string"` -} - -// String returns the string representation -func (s TestInvokeAuthorizerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestInvokeAuthorizerOutput) GoString() string { - return s.String() -} - -// SetAuthorization sets the Authorization field's value. -func (s *TestInvokeAuthorizerOutput) SetAuthorization(v map[string][]*string) *TestInvokeAuthorizerOutput { - s.Authorization = v - return s -} - -// SetClaims sets the Claims field's value. -func (s *TestInvokeAuthorizerOutput) SetClaims(v map[string]*string) *TestInvokeAuthorizerOutput { - s.Claims = v - return s -} - -// SetClientStatus sets the ClientStatus field's value. -func (s *TestInvokeAuthorizerOutput) SetClientStatus(v int64) *TestInvokeAuthorizerOutput { - s.ClientStatus = &v - return s -} - -// SetLatency sets the Latency field's value. -func (s *TestInvokeAuthorizerOutput) SetLatency(v int64) *TestInvokeAuthorizerOutput { - s.Latency = &v - return s -} - -// SetLog sets the Log field's value. -func (s *TestInvokeAuthorizerOutput) SetLog(v string) *TestInvokeAuthorizerOutput { - s.Log = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *TestInvokeAuthorizerOutput) SetPolicy(v string) *TestInvokeAuthorizerOutput { - s.Policy = &v - return s -} - -// SetPrincipalId sets the PrincipalId field's value. -func (s *TestInvokeAuthorizerOutput) SetPrincipalId(v string) *TestInvokeAuthorizerOutput { - s.PrincipalId = &v - return s -} - -// Make a request to simulate the execution of a Method. -type TestInvokeMethodInput struct { - _ struct{} `type:"structure"` - - // The simulated request body of an incoming invocation request. - Body *string `locationName:"body" type:"string"` - - // A ClientCertificate identifier to use in the test invocation. API Gateway - // will use the certificate when making the HTTPS request to the defined back-end - // endpoint. - ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` - - // A key-value map of headers to simulate an incoming invocation request. - Headers map[string]*string `locationName:"headers" type:"map"` - - // Specifies a test invoke method request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // The URI path, including query string, of the simulated invocation request. - // Use this to specify path parameters and query string parameters. - PathWithQueryString *string `locationName:"pathWithQueryString" type:"string"` - - // Specifies a test invoke method request's resource ID. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Specifies a test invoke method request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // A key-value map of stage variables to simulate an invocation on a deployed - // Stage. - StageVariables map[string]*string `locationName:"stageVariables" type:"map"` -} - -// String returns the string representation -func (s TestInvokeMethodInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestInvokeMethodInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestInvokeMethodInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestInvokeMethodInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *TestInvokeMethodInput) SetBody(v string) *TestInvokeMethodInput { - s.Body = &v - return s -} - -// SetClientCertificateId sets the ClientCertificateId field's value. -func (s *TestInvokeMethodInput) SetClientCertificateId(v string) *TestInvokeMethodInput { - s.ClientCertificateId = &v - return s -} - -// SetHeaders sets the Headers field's value. -func (s *TestInvokeMethodInput) SetHeaders(v map[string]*string) *TestInvokeMethodInput { - s.Headers = v - return s -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *TestInvokeMethodInput) SetHttpMethod(v string) *TestInvokeMethodInput { - s.HttpMethod = &v - return s -} - -// SetPathWithQueryString sets the PathWithQueryString field's value. -func (s *TestInvokeMethodInput) SetPathWithQueryString(v string) *TestInvokeMethodInput { - s.PathWithQueryString = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *TestInvokeMethodInput) SetResourceId(v string) *TestInvokeMethodInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *TestInvokeMethodInput) SetRestApiId(v string) *TestInvokeMethodInput { - s.RestApiId = &v - return s -} - -// SetStageVariables sets the StageVariables field's value. -func (s *TestInvokeMethodInput) SetStageVariables(v map[string]*string) *TestInvokeMethodInput { - s.StageVariables = v - return s -} - -// Represents the response of the test invoke request in the HTTP method. -// -// Test API using the API Gateway console (http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-test-method.html#how-to-test-method-console) -type TestInvokeMethodOutput struct { - _ struct{} `type:"structure"` - - // The body of the HTTP response. - Body *string `locationName:"body" type:"string"` - - // The headers of the HTTP response. - Headers map[string]*string `locationName:"headers" type:"map"` - - // The execution latency of the test invoke request. - Latency *int64 `locationName:"latency" type:"long"` - - // The Amazon API Gateway execution log for the test invoke request. - Log *string `locationName:"log" type:"string"` - - // The HTTP status code. - Status *int64 `locationName:"status" type:"integer"` -} - -// String returns the string representation -func (s TestInvokeMethodOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestInvokeMethodOutput) GoString() string { - return s.String() -} - -// SetBody sets the Body field's value. -func (s *TestInvokeMethodOutput) SetBody(v string) *TestInvokeMethodOutput { - s.Body = &v - return s -} - -// SetHeaders sets the Headers field's value. -func (s *TestInvokeMethodOutput) SetHeaders(v map[string]*string) *TestInvokeMethodOutput { - s.Headers = v - return s -} - -// SetLatency sets the Latency field's value. -func (s *TestInvokeMethodOutput) SetLatency(v int64) *TestInvokeMethodOutput { - s.Latency = &v - return s -} - -// SetLog sets the Log field's value. -func (s *TestInvokeMethodOutput) SetLog(v string) *TestInvokeMethodOutput { - s.Log = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TestInvokeMethodOutput) SetStatus(v int64) *TestInvokeMethodOutput { - s.Status = &v - return s -} - -// The API request rate limits. -type ThrottleSettings struct { - _ struct{} `type:"structure"` - - // The API request burst limit, the maximum rate limit over a time ranging from - // one to a few seconds, depending upon whether the underlying token bucket - // is at its full capacity. - BurstLimit *int64 `locationName:"burstLimit" type:"integer"` - - // The API request steady-state rate limit. - RateLimit *float64 `locationName:"rateLimit" type:"double"` -} - -// String returns the string representation -func (s ThrottleSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ThrottleSettings) GoString() string { - return s.String() -} - -// SetBurstLimit sets the BurstLimit field's value. -func (s *ThrottleSettings) SetBurstLimit(v int64) *ThrottleSettings { - s.BurstLimit = &v - return s -} - -// SetRateLimit sets the RateLimit field's value. -func (s *ThrottleSettings) SetRateLimit(v float64) *ThrottleSettings { - s.RateLimit = &v - return s -} - -// Requests Amazon API Gateway to change information about the current Account -// resource. -type UpdateAccountInput struct { - _ struct{} `type:"structure"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` -} - -// String returns the string representation -func (s UpdateAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAccountInput) GoString() string { - return s.String() -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateAccountInput) SetPatchOperations(v []*PatchOperation) *UpdateAccountInput { - s.PatchOperations = v - return s -} - -// A request to change information about an ApiKey resource. -type UpdateApiKeyInput struct { - _ struct{} `type:"structure"` - - // The identifier of the ApiKey resource to be updated. - // - // ApiKey is a required field - ApiKey *string `location:"uri" locationName:"api_Key" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` -} - -// String returns the string representation -func (s UpdateApiKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateApiKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApiKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApiKeyInput"} - if s.ApiKey == nil { - invalidParams.Add(request.NewErrParamRequired("ApiKey")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApiKey sets the ApiKey field's value. -func (s *UpdateApiKeyInput) SetApiKey(v string) *UpdateApiKeyInput { - s.ApiKey = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateApiKeyInput) SetPatchOperations(v []*PatchOperation) *UpdateApiKeyInput { - s.PatchOperations = v - return s -} - -// Request to update an existing Authorizer resource. -type UpdateAuthorizerInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Authorizer resource. - // - // AuthorizerId is a required field - AuthorizerId *string `location:"uri" locationName:"authorizer_id" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The RestApi identifier for the Authorizer resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateAuthorizerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAuthorizerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAuthorizerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAuthorizerInput"} - if s.AuthorizerId == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizerId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthorizerId sets the AuthorizerId field's value. -func (s *UpdateAuthorizerInput) SetAuthorizerId(v string) *UpdateAuthorizerInput { - s.AuthorizerId = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateAuthorizerInput) SetPatchOperations(v []*PatchOperation) *UpdateAuthorizerInput { - s.PatchOperations = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateAuthorizerInput) SetRestApiId(v string) *UpdateAuthorizerInput { - s.RestApiId = &v - return s -} - -// A request to change information about the BasePathMapping resource. -type UpdateBasePathMappingInput struct { - _ struct{} `type:"structure"` - - // The base path of the BasePathMapping resource to change. - // - // BasePath is a required field - BasePath *string `location:"uri" locationName:"base_path" type:"string" required:"true"` - - // The domain name of the BasePathMapping resource to change. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"domain_name" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` -} - -// String returns the string representation -func (s UpdateBasePathMappingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateBasePathMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateBasePathMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateBasePathMappingInput"} - if s.BasePath == nil { - invalidParams.Add(request.NewErrParamRequired("BasePath")) - } - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasePath sets the BasePath field's value. -func (s *UpdateBasePathMappingInput) SetBasePath(v string) *UpdateBasePathMappingInput { - s.BasePath = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *UpdateBasePathMappingInput) SetDomainName(v string) *UpdateBasePathMappingInput { - s.DomainName = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateBasePathMappingInput) SetPatchOperations(v []*PatchOperation) *UpdateBasePathMappingInput { - s.PatchOperations = v - return s -} - -// A request to change information about an ClientCertificate resource. -type UpdateClientCertificateInput struct { - _ struct{} `type:"structure"` - - // The identifier of the ClientCertificate resource to be updated. - // - // ClientCertificateId is a required field - ClientCertificateId *string `location:"uri" locationName:"clientcertificate_id" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` -} - -// String returns the string representation -func (s UpdateClientCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateClientCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateClientCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateClientCertificateInput"} - if s.ClientCertificateId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientCertificateId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientCertificateId sets the ClientCertificateId field's value. -func (s *UpdateClientCertificateInput) SetClientCertificateId(v string) *UpdateClientCertificateInput { - s.ClientCertificateId = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateClientCertificateInput) SetPatchOperations(v []*PatchOperation) *UpdateClientCertificateInput { - s.PatchOperations = v - return s -} - -// Requests Amazon API Gateway to change information about a Deployment resource. -type UpdateDeploymentInput struct { - _ struct{} `type:"structure"` - - // The replacement identifier for the Deployment resource to change information - // about. - // - // DeploymentId is a required field - DeploymentId *string `location:"uri" locationName:"deployment_id" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The replacement identifier of the RestApi resource for the Deployment resource - // to change information about. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDeploymentInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *UpdateDeploymentInput) SetDeploymentId(v string) *UpdateDeploymentInput { - s.DeploymentId = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateDeploymentInput) SetPatchOperations(v []*PatchOperation) *UpdateDeploymentInput { - s.PatchOperations = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateDeploymentInput) SetRestApiId(v string) *UpdateDeploymentInput { - s.RestApiId = &v - return s -} - -// Updates an existing documentation part of a given API. -type UpdateDocumentationPartInput struct { - _ struct{} `type:"structure"` - - // [Required] The identifier of the to-be-updated documentation part. - // - // DocumentationPartId is a required field - DocumentationPartId *string `location:"uri" locationName:"part_id" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // [Required] The identifier of an API of the to-be-updated documentation part. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateDocumentationPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDocumentationPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDocumentationPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDocumentationPartInput"} - if s.DocumentationPartId == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentationPartId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentationPartId sets the DocumentationPartId field's value. -func (s *UpdateDocumentationPartInput) SetDocumentationPartId(v string) *UpdateDocumentationPartInput { - s.DocumentationPartId = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateDocumentationPartInput) SetPatchOperations(v []*PatchOperation) *UpdateDocumentationPartInput { - s.PatchOperations = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateDocumentationPartInput) SetRestApiId(v string) *UpdateDocumentationPartInput { - s.RestApiId = &v - return s -} - -// Updates an existing documentation version of an API. -type UpdateDocumentationVersionInput struct { - _ struct{} `type:"structure"` - - // [Required] The version identifier of the to-be-updated documentation version. - // - // DocumentationVersion is a required field - DocumentationVersion *string `location:"uri" locationName:"doc_version" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // [Required] The identifier of an API of the to-be-updated documentation version. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateDocumentationVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDocumentationVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDocumentationVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDocumentationVersionInput"} - if s.DocumentationVersion == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentationVersion")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentationVersion sets the DocumentationVersion field's value. -func (s *UpdateDocumentationVersionInput) SetDocumentationVersion(v string) *UpdateDocumentationVersionInput { - s.DocumentationVersion = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateDocumentationVersionInput) SetPatchOperations(v []*PatchOperation) *UpdateDocumentationVersionInput { - s.PatchOperations = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateDocumentationVersionInput) SetRestApiId(v string) *UpdateDocumentationVersionInput { - s.RestApiId = &v - return s -} - -// A request to change information about the DomainName resource. -type UpdateDomainNameInput struct { - _ struct{} `type:"structure"` - - // The name of the DomainName resource to be changed. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"domain_name" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` -} - -// String returns the string representation -func (s UpdateDomainNameInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDomainNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDomainNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDomainNameInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *UpdateDomainNameInput) SetDomainName(v string) *UpdateDomainNameInput { - s.DomainName = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateDomainNameInput) SetPatchOperations(v []*PatchOperation) *UpdateDomainNameInput { - s.PatchOperations = v - return s -} - -// Represents an update integration request. -type UpdateIntegrationInput struct { - _ struct{} `type:"structure"` - - // Represents an update integration request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // Represents an update integration request's resource identifier. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Represents an update integration request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateIntegrationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateIntegrationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIntegrationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIntegrationInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *UpdateIntegrationInput) SetHttpMethod(v string) *UpdateIntegrationInput { - s.HttpMethod = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateIntegrationInput) SetPatchOperations(v []*PatchOperation) *UpdateIntegrationInput { - s.PatchOperations = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *UpdateIntegrationInput) SetResourceId(v string) *UpdateIntegrationInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateIntegrationInput) SetRestApiId(v string) *UpdateIntegrationInput { - s.RestApiId = &v - return s -} - -// Represents an update integration response request. -type UpdateIntegrationResponseInput struct { - _ struct{} `type:"structure"` - - // Specifies an update integration response request's HTTP method. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // Specifies an update integration response request's resource identifier. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // Specifies an update integration response request's API identifier. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // Specifies an update integration response request's status code. - // - // StatusCode is a required field - StatusCode *string `location:"uri" locationName:"status_code" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateIntegrationResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateIntegrationResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIntegrationResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIntegrationResponseInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *UpdateIntegrationResponseInput) SetHttpMethod(v string) *UpdateIntegrationResponseInput { - s.HttpMethod = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateIntegrationResponseInput) SetPatchOperations(v []*PatchOperation) *UpdateIntegrationResponseInput { - s.PatchOperations = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *UpdateIntegrationResponseInput) SetResourceId(v string) *UpdateIntegrationResponseInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateIntegrationResponseInput) SetRestApiId(v string) *UpdateIntegrationResponseInput { - s.RestApiId = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *UpdateIntegrationResponseInput) SetStatusCode(v string) *UpdateIntegrationResponseInput { - s.StatusCode = &v - return s -} - -// Request to update an existing Method resource. -type UpdateMethodInput struct { - _ struct{} `type:"structure"` - - // The HTTP verb of the Method resource. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The Resource identifier for the Method resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the Method resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateMethodInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateMethodInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateMethodInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateMethodInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *UpdateMethodInput) SetHttpMethod(v string) *UpdateMethodInput { - s.HttpMethod = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateMethodInput) SetPatchOperations(v []*PatchOperation) *UpdateMethodInput { - s.PatchOperations = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *UpdateMethodInput) SetResourceId(v string) *UpdateMethodInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateMethodInput) SetRestApiId(v string) *UpdateMethodInput { - s.RestApiId = &v - return s -} - -// A request to update an existing MethodResponse resource. -type UpdateMethodResponseInput struct { - _ struct{} `type:"structure"` - - // The HTTP verb of the Method resource. - // - // HttpMethod is a required field - HttpMethod *string `location:"uri" locationName:"http_method" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The Resource identifier for the MethodResponse resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the MethodResponse resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The status code for the MethodResponse resource. - // - // StatusCode is a required field - StatusCode *string `location:"uri" locationName:"status_code" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateMethodResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateMethodResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateMethodResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateMethodResponseInput"} - if s.HttpMethod == nil { - invalidParams.Add(request.NewErrParamRequired("HttpMethod")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *UpdateMethodResponseInput) SetHttpMethod(v string) *UpdateMethodResponseInput { - s.HttpMethod = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateMethodResponseInput) SetPatchOperations(v []*PatchOperation) *UpdateMethodResponseInput { - s.PatchOperations = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *UpdateMethodResponseInput) SetResourceId(v string) *UpdateMethodResponseInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateMethodResponseInput) SetRestApiId(v string) *UpdateMethodResponseInput { - s.RestApiId = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *UpdateMethodResponseInput) SetStatusCode(v string) *UpdateMethodResponseInput { - s.StatusCode = &v - return s -} - -// Request to update an existing model in an existing RestApi resource. -type UpdateModelInput struct { - _ struct{} `type:"structure"` - - // The name of the model to update. - // - // ModelName is a required field - ModelName *string `location:"uri" locationName:"model_name" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The RestApi identifier under which the model exists. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateModelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateModelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateModelInput"} - if s.ModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelName")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetModelName sets the ModelName field's value. -func (s *UpdateModelInput) SetModelName(v string) *UpdateModelInput { - s.ModelName = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateModelInput) SetPatchOperations(v []*PatchOperation) *UpdateModelInput { - s.PatchOperations = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateModelInput) SetRestApiId(v string) *UpdateModelInput { - s.RestApiId = &v - return s -} - -// Request to change information about a Resource resource. -type UpdateResourceInput struct { - _ struct{} `type:"structure"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The identifier of the Resource resource. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"resource_id" type:"string" required:"true"` - - // The RestApi identifier for the Resource resource. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateResourceInput) SetPatchOperations(v []*PatchOperation) *UpdateResourceInput { - s.PatchOperations = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *UpdateResourceInput) SetResourceId(v string) *UpdateResourceInput { - s.ResourceId = &v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateResourceInput) SetRestApiId(v string) *UpdateResourceInput { - s.RestApiId = &v - return s -} - -// Request to update an existing RestApi resource in your collection. -type UpdateRestApiInput struct { - _ struct{} `type:"structure"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The ID of the RestApi you want to update. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateRestApiInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRestApiInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRestApiInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRestApiInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateRestApiInput) SetPatchOperations(v []*PatchOperation) *UpdateRestApiInput { - s.PatchOperations = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateRestApiInput) SetRestApiId(v string) *UpdateRestApiInput { - s.RestApiId = &v - return s -} - -// Requests Amazon API Gateway to change information about a Stage resource. -type UpdateStageInput struct { - _ struct{} `type:"structure"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The identifier of the RestApi resource for the Stage resource to change information - // about. - // - // RestApiId is a required field - RestApiId *string `location:"uri" locationName:"restapi_id" type:"string" required:"true"` - - // The name of the Stage resource to change information about. - // - // StageName is a required field - StageName *string `location:"uri" locationName:"stage_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateStageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateStageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateStageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateStageInput"} - if s.RestApiId == nil { - invalidParams.Add(request.NewErrParamRequired("RestApiId")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateStageInput) SetPatchOperations(v []*PatchOperation) *UpdateStageInput { - s.PatchOperations = v - return s -} - -// SetRestApiId sets the RestApiId field's value. -func (s *UpdateStageInput) SetRestApiId(v string) *UpdateStageInput { - s.RestApiId = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *UpdateStageInput) SetStageName(v string) *UpdateStageInput { - s.StageName = &v - return s -} - -// The PATCH request to grant a temporary extension to the reamining quota of -// a usage plan associated with a specified API key. -type UpdateUsageInput struct { - _ struct{} `type:"structure"` - - // The identifier of the API key associated with the usage plan in which a temporary - // extension is granted to the remaining quota. - // - // KeyId is a required field - KeyId *string `location:"uri" locationName:"keyId" type:"string" required:"true"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The Id of the usage plan associated with the usage data. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateUsageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateUsageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateUsageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateUsageInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *UpdateUsageInput) SetKeyId(v string) *UpdateUsageInput { - s.KeyId = &v - return s -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateUsageInput) SetPatchOperations(v []*PatchOperation) *UpdateUsageInput { - s.PatchOperations = v - return s -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *UpdateUsageInput) SetUsagePlanId(v string) *UpdateUsageInput { - s.UsagePlanId = &v - return s -} - -// The PATCH request to update a usage plan of a given plan Id. -type UpdateUsagePlanInput struct { - _ struct{} `type:"structure"` - - // A list of update operations to be applied to the specified resource and in - // the order specified in this list. - PatchOperations []*PatchOperation `locationName:"patchOperations" type:"list"` - - // The Id of the to-be-updated usage plan. - // - // UsagePlanId is a required field - UsagePlanId *string `location:"uri" locationName:"usageplanId" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateUsagePlanInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateUsagePlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateUsagePlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateUsagePlanInput"} - if s.UsagePlanId == nil { - invalidParams.Add(request.NewErrParamRequired("UsagePlanId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPatchOperations sets the PatchOperations field's value. -func (s *UpdateUsagePlanInput) SetPatchOperations(v []*PatchOperation) *UpdateUsagePlanInput { - s.PatchOperations = v - return s -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *UpdateUsagePlanInput) SetUsagePlanId(v string) *UpdateUsagePlanInput { - s.UsagePlanId = &v - return s -} - -// Represents the usage data of a usage plan. -// -// Create and Use Usage Plans (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html), Manage Usage in a Usage Plan (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-usage-plans-with-console.html#api-gateway-usage-plan-manage-usage) -type Usage struct { - _ struct{} `type:"structure"` - - // The ending date of the usage data. - EndDate *string `locationName:"endDate" type:"string"` - - // The usage data, as daily logs of used and remaining quotas, over the specified - // time interval indexed over the API keys in a usage plan. For example, {..., - // "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}, where {api_key} - // stands for an API key value and the daily log entry is of the format [used - // quota, remaining quota]. - Items map[string][][]*int64 `locationName:"values" type:"map"` - - Position *string `locationName:"position" type:"string"` - - // The starting date of the usage data. - StartDate *string `locationName:"startDate" type:"string"` - - // The plan Id associated with this usage data. - UsagePlanId *string `locationName:"usagePlanId" type:"string"` -} - -// String returns the string representation -func (s Usage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Usage) GoString() string { - return s.String() -} - -// SetEndDate sets the EndDate field's value. -func (s *Usage) SetEndDate(v string) *Usage { - s.EndDate = &v - return s -} - -// SetItems sets the Items field's value. -func (s *Usage) SetItems(v map[string][][]*int64) *Usage { - s.Items = v - return s -} - -// SetPosition sets the Position field's value. -func (s *Usage) SetPosition(v string) *Usage { - s.Position = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *Usage) SetStartDate(v string) *Usage { - s.StartDate = &v - return s -} - -// SetUsagePlanId sets the UsagePlanId field's value. -func (s *Usage) SetUsagePlanId(v string) *Usage { - s.UsagePlanId = &v - return s -} - -// Represents a usage plan than can specify who can assess associated API stages -// with specified request limits and quotas. -// -// In a usage plan, you associate an API by specifying the API's Id and a stage -// name of the specified API. You add plan customers by adding API keys to the -// plan. -// -// Create and Use Usage Plans (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) -type UsagePlan struct { - _ struct{} `type:"structure"` - - // The associated API stages of a usage plan. - ApiStages []*ApiStage `locationName:"apiStages" type:"list"` - - // The description of a usage plan. - Description *string `locationName:"description" type:"string"` - - // The identifier of a UsagePlan resource. - Id *string `locationName:"id" type:"string"` - - // The name of a usage plan. - Name *string `locationName:"name" type:"string"` - - // The AWS Markeplace product identifier to associate with the usage plan as - // a SaaS product on AWS Marketplace. - ProductCode *string `locationName:"productCode" type:"string"` - - // The maximum number of permitted requests per a given unit time interval. - Quota *QuotaSettings `locationName:"quota" type:"structure"` - - // The request throttle limits of a usage plan. - Throttle *ThrottleSettings `locationName:"throttle" type:"structure"` -} - -// String returns the string representation -func (s UsagePlan) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UsagePlan) GoString() string { - return s.String() -} - -// SetApiStages sets the ApiStages field's value. -func (s *UsagePlan) SetApiStages(v []*ApiStage) *UsagePlan { - s.ApiStages = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UsagePlan) SetDescription(v string) *UsagePlan { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UsagePlan) SetId(v string) *UsagePlan { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UsagePlan) SetName(v string) *UsagePlan { - s.Name = &v - return s -} - -// SetProductCode sets the ProductCode field's value. -func (s *UsagePlan) SetProductCode(v string) *UsagePlan { - s.ProductCode = &v - return s -} - -// SetQuota sets the Quota field's value. -func (s *UsagePlan) SetQuota(v *QuotaSettings) *UsagePlan { - s.Quota = v - return s -} - -// SetThrottle sets the Throttle field's value. -func (s *UsagePlan) SetThrottle(v *ThrottleSettings) *UsagePlan { - s.Throttle = v - return s -} - -// Represents a usage plan key to identify a plan customer. -// -// To associate an API stage with a selected API key in a usage plan, you must -// create a UsagePlanKey resource to represent the selected ApiKey. -// -// " Create and Use Usage Plans (http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) -type UsagePlanKey struct { - _ struct{} `type:"structure"` - - // The Id of a usage plan key. - Id *string `locationName:"id" type:"string"` - - // The name of a usage plan key. - Name *string `locationName:"name" type:"string"` - - // The type of a usage plan key. Currently, the valid key type is API_KEY. - Type *string `locationName:"type" type:"string"` - - // The value of a usage plan key. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s UsagePlanKey) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UsagePlanKey) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *UsagePlanKey) SetId(v string) *UsagePlanKey { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UsagePlanKey) SetName(v string) *UsagePlanKey { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *UsagePlanKey) SetType(v string) *UsagePlanKey { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *UsagePlanKey) SetValue(v string) *UsagePlanKey { - s.Value = &v - return s -} - -const ( - // ApiKeysFormatCsv is a ApiKeysFormat enum value - ApiKeysFormatCsv = "csv" -) - -// The authorizer type. the current value is TOKEN for a Lambda function or -// COGNITO_USER_POOLS for an Amazon Cognito Your User Pool. -const ( - // AuthorizerTypeToken is a AuthorizerType enum value - AuthorizerTypeToken = "TOKEN" - - // AuthorizerTypeCognitoUserPools is a AuthorizerType enum value - AuthorizerTypeCognitoUserPools = "COGNITO_USER_POOLS" -) - -// Returns the size of the CacheCluster. -const ( - // CacheClusterSize05 is a CacheClusterSize enum value - CacheClusterSize05 = "0.5" - - // CacheClusterSize16 is a CacheClusterSize enum value - CacheClusterSize16 = "1.6" - - // CacheClusterSize61 is a CacheClusterSize enum value - CacheClusterSize61 = "6.1" - - // CacheClusterSize135 is a CacheClusterSize enum value - CacheClusterSize135 = "13.5" - - // CacheClusterSize284 is a CacheClusterSize enum value - CacheClusterSize284 = "28.4" - - // CacheClusterSize582 is a CacheClusterSize enum value - CacheClusterSize582 = "58.2" - - // CacheClusterSize118 is a CacheClusterSize enum value - CacheClusterSize118 = "118" - - // CacheClusterSize237 is a CacheClusterSize enum value - CacheClusterSize237 = "237" -) - -// Returns the status of the CacheCluster. -const ( - // CacheClusterStatusCreateInProgress is a CacheClusterStatus enum value - CacheClusterStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // CacheClusterStatusAvailable is a CacheClusterStatus enum value - CacheClusterStatusAvailable = "AVAILABLE" - - // CacheClusterStatusDeleteInProgress is a CacheClusterStatus enum value - CacheClusterStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // CacheClusterStatusNotAvailable is a CacheClusterStatus enum value - CacheClusterStatusNotAvailable = "NOT_AVAILABLE" - - // CacheClusterStatusFlushInProgress is a CacheClusterStatus enum value - CacheClusterStatusFlushInProgress = "FLUSH_IN_PROGRESS" -) - -const ( - // ContentHandlingStrategyConvertToBinary is a ContentHandlingStrategy enum value - ContentHandlingStrategyConvertToBinary = "CONVERT_TO_BINARY" - - // ContentHandlingStrategyConvertToText is a ContentHandlingStrategy enum value - ContentHandlingStrategyConvertToText = "CONVERT_TO_TEXT" -) - -const ( - // DocumentationPartTypeApi is a DocumentationPartType enum value - DocumentationPartTypeApi = "API" - - // DocumentationPartTypeAuthorizer is a DocumentationPartType enum value - DocumentationPartTypeAuthorizer = "AUTHORIZER" - - // DocumentationPartTypeModel is a DocumentationPartType enum value - DocumentationPartTypeModel = "MODEL" - - // DocumentationPartTypeResource is a DocumentationPartType enum value - DocumentationPartTypeResource = "RESOURCE" - - // DocumentationPartTypeMethod is a DocumentationPartType enum value - DocumentationPartTypeMethod = "METHOD" - - // DocumentationPartTypePathParameter is a DocumentationPartType enum value - DocumentationPartTypePathParameter = "PATH_PARAMETER" - - // DocumentationPartTypeQueryParameter is a DocumentationPartType enum value - DocumentationPartTypeQueryParameter = "QUERY_PARAMETER" - - // DocumentationPartTypeRequestHeader is a DocumentationPartType enum value - DocumentationPartTypeRequestHeader = "REQUEST_HEADER" - - // DocumentationPartTypeRequestBody is a DocumentationPartType enum value - DocumentationPartTypeRequestBody = "REQUEST_BODY" - - // DocumentationPartTypeResponse is a DocumentationPartType enum value - DocumentationPartTypeResponse = "RESPONSE" - - // DocumentationPartTypeResponseHeader is a DocumentationPartType enum value - DocumentationPartTypeResponseHeader = "RESPONSE_HEADER" - - // DocumentationPartTypeResponseBody is a DocumentationPartType enum value - DocumentationPartTypeResponseBody = "RESPONSE_BODY" -) - -// The integration type. The valid value is HTTP for integrating with an HTTP -// back end, AWS for any AWS service endpoints, MOCK for testing without actually -// invoking the back end, HTTP_PROXY for integrating with the HTTP proxy integration, -// or AWS_PROXY for integrating with the Lambda proxy integration type. -const ( - // IntegrationTypeHttp is a IntegrationType enum value - IntegrationTypeHttp = "HTTP" - - // IntegrationTypeAws is a IntegrationType enum value - IntegrationTypeAws = "AWS" - - // IntegrationTypeMock is a IntegrationType enum value - IntegrationTypeMock = "MOCK" - - // IntegrationTypeHttpProxy is a IntegrationType enum value - IntegrationTypeHttpProxy = "HTTP_PROXY" - - // IntegrationTypeAwsProxy is a IntegrationType enum value - IntegrationTypeAwsProxy = "AWS_PROXY" -) - -const ( - // OpAdd is a Op enum value - OpAdd = "add" - - // OpRemove is a Op enum value - OpRemove = "remove" - - // OpReplace is a Op enum value - OpReplace = "replace" - - // OpMove is a Op enum value - OpMove = "move" - - // OpCopy is a Op enum value - OpCopy = "copy" - - // OpTest is a Op enum value - OpTest = "test" -) - -const ( - // PutModeMerge is a PutMode enum value - PutModeMerge = "merge" - - // PutModeOverwrite is a PutMode enum value - PutModeOverwrite = "overwrite" -) - -const ( - // QuotaPeriodTypeDay is a QuotaPeriodType enum value - QuotaPeriodTypeDay = "DAY" - - // QuotaPeriodTypeWeek is a QuotaPeriodType enum value - QuotaPeriodTypeWeek = "WEEK" - - // QuotaPeriodTypeMonth is a QuotaPeriodType enum value - QuotaPeriodTypeMonth = "MONTH" -) - -const ( - // UnauthorizedCacheControlHeaderStrategyFailWith403 is a UnauthorizedCacheControlHeaderStrategy enum value - UnauthorizedCacheControlHeaderStrategyFailWith403 = "FAIL_WITH_403" - - // UnauthorizedCacheControlHeaderStrategySucceedWithResponseHeader is a UnauthorizedCacheControlHeaderStrategy enum value - UnauthorizedCacheControlHeaderStrategySucceedWithResponseHeader = "SUCCEED_WITH_RESPONSE_HEADER" - - // UnauthorizedCacheControlHeaderStrategySucceedWithoutResponseHeader is a UnauthorizedCacheControlHeaderStrategy enum value - UnauthorizedCacheControlHeaderStrategySucceedWithoutResponseHeader = "SUCCEED_WITHOUT_RESPONSE_HEADER" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigateway/customization.go b/vendor/github.com/aws/aws-sdk-go/service/apigateway/customization.go deleted file mode 100644 index 2dc4a7c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/customization.go +++ /dev/null @@ -1,14 +0,0 @@ -package apigateway - -import ( - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/request" -) - -func init() { - initClient = func(c *client.Client) { - c.Handlers.Build.PushBack(func(r *request.Request) { - r.HTTPRequest.Header.Add("Accept", "application/json") - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go b/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go deleted file mode 100644 index b06644b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go +++ /dev/null @@ -1,34 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package apigateway - -const ( - - // ErrCodeBadRequestException for service response error code - // "BadRequestException". - ErrCodeBadRequestException = "BadRequestException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - ErrCodeConflictException = "ConflictException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeNotFoundException for service response error code - // "NotFoundException". - ErrCodeNotFoundException = "NotFoundException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - ErrCodeServiceUnavailableException = "ServiceUnavailableException" - - // ErrCodeTooManyRequestsException for service response error code - // "TooManyRequestsException". - ErrCodeTooManyRequestsException = "TooManyRequestsException" - - // ErrCodeUnauthorizedException for service response error code - // "UnauthorizedException". - ErrCodeUnauthorizedException = "UnauthorizedException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go b/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go deleted file mode 100644 index 052f84a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go +++ /dev/null @@ -1,94 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package apigateway - -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" -) - -// Amazon API Gateway helps developers deliver robust, secure, and scalable -// mobile and web application back ends. Amazon API Gateway allows developers -// to securely connect mobile and web applications to APIs that run on AWS Lambda, -// Amazon EC2, or other publicly addressable web services that are hosted outside -// of AWS. -// 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 APIGateway 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 = "apigateway" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the APIGateway 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 APIGateway client from just a session. -// svc := apigateway.New(mySession) -// -// // Create a APIGateway client with additional configuration -// svc := apigateway.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *APIGateway { - 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) *APIGateway { - svc := &APIGateway{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-07-09", - }, - 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 APIGateway operation and runs any -// custom request initialization. -func (c *APIGateway) 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/applicationautoscaling/api.go b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/api.go deleted file mode 100644 index ba6abe5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/api.go +++ /dev/null @@ -1,2392 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package applicationautoscaling provides a client for Application Auto Scaling. -package applicationautoscaling - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opDeleteScalingPolicy = "DeleteScalingPolicy" - -// DeleteScalingPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteScalingPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteScalingPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteScalingPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteScalingPolicyRequest method. -// req, resp := client.DeleteScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicy -func (c *ApplicationAutoScaling) DeleteScalingPolicyRequest(input *DeleteScalingPolicyInput) (req *request.Request, output *DeleteScalingPolicyOutput) { - op := &request.Operation{ - Name: opDeleteScalingPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteScalingPolicyInput{} - } - - output = &DeleteScalingPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteScalingPolicy API operation for Application Auto Scaling. -// -// Deletes the specified Application Auto Scaling scaling policy. -// -// Deleting a policy deletes the underlying alarm action, but does not delete -// the CloudWatch alarm associated with the scaling policy, even if it no longer -// has an associated action. -// -// To create a scaling policy or update an existing one, see PutScalingPolicy. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Application Auto Scaling's -// API operation DeleteScalingPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// An exception was thrown for a validation issue. Review the available parameters -// for the API request. -// -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" -// The specified object could not be found. For any Put or Register API operation, -// which depends on the existence of a scalable target, this exception is thrown -// if the scalable target with the specified service namespace, resource ID, -// and scalable dimension does not exist. For any Delete or Deregister API operation, -// this exception is thrown if the resource that is to be deleted or deregistered -// cannot be found. -// -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" -// Concurrent updates caused an exception, for example, if you request an update -// to an Application Auto Scaling resource that already has a pending update. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// The service encountered an internal error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicy -func (c *ApplicationAutoScaling) DeleteScalingPolicy(input *DeleteScalingPolicyInput) (*DeleteScalingPolicyOutput, error) { - req, out := c.DeleteScalingPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterScalableTarget = "DeregisterScalableTarget" - -// DeregisterScalableTargetRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterScalableTarget operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterScalableTarget for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterScalableTarget method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterScalableTargetRequest method. -// req, resp := client.DeregisterScalableTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeregisterScalableTarget -func (c *ApplicationAutoScaling) DeregisterScalableTargetRequest(input *DeregisterScalableTargetInput) (req *request.Request, output *DeregisterScalableTargetOutput) { - op := &request.Operation{ - Name: opDeregisterScalableTarget, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterScalableTargetInput{} - } - - output = &DeregisterScalableTargetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterScalableTarget API operation for Application Auto Scaling. -// -// Deregisters a scalable target. -// -// Deregistering a scalable target deletes the scaling policies that are associated -// with it. -// -// To create a scalable target or update an existing one, see RegisterScalableTarget. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Application Auto Scaling's -// API operation DeregisterScalableTarget for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// An exception was thrown for a validation issue. Review the available parameters -// for the API request. -// -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" -// The specified object could not be found. For any Put or Register API operation, -// which depends on the existence of a scalable target, this exception is thrown -// if the scalable target with the specified service namespace, resource ID, -// and scalable dimension does not exist. For any Delete or Deregister API operation, -// this exception is thrown if the resource that is to be deleted or deregistered -// cannot be found. -// -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" -// Concurrent updates caused an exception, for example, if you request an update -// to an Application Auto Scaling resource that already has a pending update. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// The service encountered an internal error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeregisterScalableTarget -func (c *ApplicationAutoScaling) DeregisterScalableTarget(input *DeregisterScalableTargetInput) (*DeregisterScalableTargetOutput, error) { - req, out := c.DeregisterScalableTargetRequest(input) - err := req.Send() - return out, err -} - -const opDescribeScalableTargets = "DescribeScalableTargets" - -// DescribeScalableTargetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScalableTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeScalableTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeScalableTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeScalableTargetsRequest method. -// req, resp := client.DescribeScalableTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalableTargets -func (c *ApplicationAutoScaling) DescribeScalableTargetsRequest(input *DescribeScalableTargetsInput) (req *request.Request, output *DescribeScalableTargetsOutput) { - op := &request.Operation{ - Name: opDescribeScalableTargets, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeScalableTargetsInput{} - } - - output = &DescribeScalableTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScalableTargets API operation for Application Auto Scaling. -// -// Provides descriptive information about the scalable targets in the specified -// namespace. -// -// You can filter the results using the ResourceIds and ScalableDimension parameters. -// -// To create a scalable target or update an existing one, see RegisterScalableTarget. -// If you are no longer using a scalable target, you can deregister it using -// DeregisterScalableTarget. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Application Auto Scaling's -// API operation DescribeScalableTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// An exception was thrown for a validation issue. Review the available parameters -// for the API request. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token supplied was invalid. -// -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" -// Concurrent updates caused an exception, for example, if you request an update -// to an Application Auto Scaling resource that already has a pending update. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// The service encountered an internal error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalableTargets -func (c *ApplicationAutoScaling) DescribeScalableTargets(input *DescribeScalableTargetsInput) (*DescribeScalableTargetsOutput, error) { - req, out := c.DescribeScalableTargetsRequest(input) - err := req.Send() - return out, err -} - -// DescribeScalableTargetsPages iterates over the pages of a DescribeScalableTargets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScalableTargets 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 DescribeScalableTargets operation. -// pageNum := 0 -// err := client.DescribeScalableTargetsPages(params, -// func(page *DescribeScalableTargetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ApplicationAutoScaling) DescribeScalableTargetsPages(input *DescribeScalableTargetsInput, fn func(p *DescribeScalableTargetsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScalableTargetsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScalableTargetsOutput), lastPage) - }) -} - -const opDescribeScalingActivities = "DescribeScalingActivities" - -// DescribeScalingActivitiesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScalingActivities operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeScalingActivities for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeScalingActivities method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeScalingActivitiesRequest method. -// req, resp := client.DescribeScalingActivitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingActivities -func (c *ApplicationAutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingActivitiesInput) (req *request.Request, output *DescribeScalingActivitiesOutput) { - op := &request.Operation{ - Name: opDescribeScalingActivities, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeScalingActivitiesInput{} - } - - output = &DescribeScalingActivitiesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScalingActivities API operation for Application Auto Scaling. -// -// Provides descriptive information about the scaling activities in the specified -// namespace from the previous six weeks. -// -// You can filter the results using the ResourceId and ScalableDimension parameters. -// -// Scaling activities are triggered by CloudWatch alarms that are associated -// with scaling policies. To view the scaling policies for a service namespace, -// see DescribeScalingPolicies. To create a scaling policy or update an existing -// one, see PutScalingPolicy. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Application Auto Scaling's -// API operation DescribeScalingActivities for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// An exception was thrown for a validation issue. Review the available parameters -// for the API request. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token supplied was invalid. -// -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" -// Concurrent updates caused an exception, for example, if you request an update -// to an Application Auto Scaling resource that already has a pending update. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// The service encountered an internal error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingActivities -func (c *ApplicationAutoScaling) DescribeScalingActivities(input *DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) { - req, out := c.DescribeScalingActivitiesRequest(input) - err := req.Send() - return out, err -} - -// DescribeScalingActivitiesPages iterates over the pages of a DescribeScalingActivities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScalingActivities 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 DescribeScalingActivities operation. -// pageNum := 0 -// err := client.DescribeScalingActivitiesPages(params, -// func(page *DescribeScalingActivitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ApplicationAutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(p *DescribeScalingActivitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScalingActivitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScalingActivitiesOutput), lastPage) - }) -} - -const opDescribeScalingPolicies = "DescribeScalingPolicies" - -// DescribeScalingPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScalingPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeScalingPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeScalingPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeScalingPoliciesRequest method. -// req, resp := client.DescribeScalingPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingPolicies -func (c *ApplicationAutoScaling) DescribeScalingPoliciesRequest(input *DescribeScalingPoliciesInput) (req *request.Request, output *DescribeScalingPoliciesOutput) { - op := &request.Operation{ - Name: opDescribeScalingPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeScalingPoliciesInput{} - } - - output = &DescribeScalingPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScalingPolicies API operation for Application Auto Scaling. -// -// Provides descriptive information about the scaling policies in the specified -// namespace. -// -// You can filter the results using the ResourceId, ScalableDimension, and PolicyNames -// parameters. -// -// To create a scaling policy or update an existing one, see PutScalingPolicy. -// If you are no longer using a scaling policy, you can delete it using DeleteScalingPolicy. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Application Auto Scaling's -// API operation DescribeScalingPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// An exception was thrown for a validation issue. Review the available parameters -// for the API request. -// -// * ErrCodeFailedResourceAccessException "FailedResourceAccessException" -// Failed access to resources caused an exception. This exception currently -// only applies to DescribeScalingPolicies. It is thrown when Application Auto -// Scaling is unable to retrieve the alarms associated with a scaling policy -// due to a client error, for example, if the role ARN specified for a scalable -// target does not have the proper permissions to call the CloudWatch DescribeAlarms -// (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html) -// API operation on behalf of your account. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token supplied was invalid. -// -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" -// Concurrent updates caused an exception, for example, if you request an update -// to an Application Auto Scaling resource that already has a pending update. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// The service encountered an internal error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingPolicies -func (c *ApplicationAutoScaling) DescribeScalingPolicies(input *DescribeScalingPoliciesInput) (*DescribeScalingPoliciesOutput, error) { - req, out := c.DescribeScalingPoliciesRequest(input) - err := req.Send() - return out, err -} - -// DescribeScalingPoliciesPages iterates over the pages of a DescribeScalingPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScalingPolicies 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 DescribeScalingPolicies operation. -// pageNum := 0 -// err := client.DescribeScalingPoliciesPages(params, -// func(page *DescribeScalingPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ApplicationAutoScaling) DescribeScalingPoliciesPages(input *DescribeScalingPoliciesInput, fn func(p *DescribeScalingPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScalingPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScalingPoliciesOutput), lastPage) - }) -} - -const opPutScalingPolicy = "PutScalingPolicy" - -// PutScalingPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutScalingPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutScalingPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutScalingPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutScalingPolicyRequest method. -// req, resp := client.PutScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicy -func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req *request.Request, output *PutScalingPolicyOutput) { - op := &request.Operation{ - Name: opPutScalingPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutScalingPolicyInput{} - } - - output = &PutScalingPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutScalingPolicy API operation for Application Auto Scaling. -// -// Creates or updates a policy for an Application Auto Scaling scalable target. -// -// Each scalable target is identified by a service namespace, resource ID, and -// scalable dimension. A scaling policy applies to the scalable target identified -// by those three attributes. You cannot create a scaling policy without first -// registering a scalable target using RegisterScalableTarget. -// -// To update a policy, specify its policy name and the parameters that you want -// to change. Any parameters that you don't specify are not changed by this -// update request. -// -// You can view the scaling policies for a service namespace using DescribeScalingPolicies. -// If you are no longer using a scaling policy, you can delete it using DeleteScalingPolicy. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Application Auto Scaling's -// API operation PutScalingPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// An exception was thrown for a validation issue. Review the available parameters -// for the API request. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Your account exceeded a limit. This exception is thrown when a per-account -// resource limit is exceeded. For more information, see Application Auto Scaling -// Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_as-app). -// -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" -// The specified object could not be found. For any Put or Register API operation, -// which depends on the existence of a scalable target, this exception is thrown -// if the scalable target with the specified service namespace, resource ID, -// and scalable dimension does not exist. For any Delete or Deregister API operation, -// this exception is thrown if the resource that is to be deleted or deregistered -// cannot be found. -// -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" -// Concurrent updates caused an exception, for example, if you request an update -// to an Application Auto Scaling resource that already has a pending update. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// The service encountered an internal error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicy -func (c *ApplicationAutoScaling) PutScalingPolicy(input *PutScalingPolicyInput) (*PutScalingPolicyOutput, error) { - req, out := c.PutScalingPolicyRequest(input) - err := req.Send() - return out, err -} - -const opRegisterScalableTarget = "RegisterScalableTarget" - -// RegisterScalableTargetRequest generates a "aws/request.Request" representing the -// client's request for the RegisterScalableTarget operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterScalableTarget for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterScalableTarget method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterScalableTargetRequest method. -// req, resp := client.RegisterScalableTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/RegisterScalableTarget -func (c *ApplicationAutoScaling) RegisterScalableTargetRequest(input *RegisterScalableTargetInput) (req *request.Request, output *RegisterScalableTargetOutput) { - op := &request.Operation{ - Name: opRegisterScalableTarget, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterScalableTargetInput{} - } - - output = &RegisterScalableTargetOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterScalableTarget API operation for Application Auto Scaling. -// -// Registers or updates a scalable target. A scalable target is a resource that -// Application Auto Scaling can scale out or scale in. After you have registered -// a scalable target, you can use this operation to update the minimum and maximum -// values for your scalable dimension. -// -// After you register a scalable target, you can create and apply scaling policies -// using PutScalingPolicy. You can view the scaling policies for a service namespace -// using DescribeScalableTargets. If you are no longer using a scalable target, -// you can deregister it using DeregisterScalableTarget. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Application Auto Scaling's -// API operation RegisterScalableTarget for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// An exception was thrown for a validation issue. Review the available parameters -// for the API request. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Your account exceeded a limit. This exception is thrown when a per-account -// resource limit is exceeded. For more information, see Application Auto Scaling -// Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_as-app). -// -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" -// Concurrent updates caused an exception, for example, if you request an update -// to an Application Auto Scaling resource that already has a pending update. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// The service encountered an internal error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/RegisterScalableTarget -func (c *ApplicationAutoScaling) RegisterScalableTarget(input *RegisterScalableTargetInput) (*RegisterScalableTargetOutput, error) { - req, out := c.RegisterScalableTargetRequest(input) - err := req.Send() - return out, err -} - -// Represents a CloudWatch alarm associated with a scaling policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/Alarm -type Alarm struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the alarm. - // - // AlarmARN is a required field - AlarmARN *string `type:"string" required:"true"` - - // The name of the alarm. - // - // AlarmName is a required field - AlarmName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Alarm) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Alarm) GoString() string { - return s.String() -} - -// SetAlarmARN sets the AlarmARN field's value. -func (s *Alarm) SetAlarmARN(v string) *Alarm { - s.AlarmARN = &v - return s -} - -// SetAlarmName sets the AlarmName field's value. -func (s *Alarm) SetAlarmName(v string) *Alarm { - s.AlarmName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicyRequest -type DeleteScalingPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the scaling policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The identifier of the resource associated with the scalable target. This - // string consists of the resource type and unique identifier. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The scalable dimension. This string consists of the service namespace, resource - // type, and scaling property. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - // - // ScalableDimension is a required field - ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` -} - -// String returns the string representation -func (s DeleteScalingPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScalingPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteScalingPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteScalingPolicyInput"} - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.ScalableDimension == nil { - invalidParams.Add(request.NewErrParamRequired("ScalableDimension")) - } - if s.ServiceNamespace == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNamespace")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyName sets the PolicyName field's value. -func (s *DeleteScalingPolicyInput) SetPolicyName(v string) *DeleteScalingPolicyInput { - s.PolicyName = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DeleteScalingPolicyInput) SetResourceId(v string) *DeleteScalingPolicyInput { - s.ResourceId = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *DeleteScalingPolicyInput) SetScalableDimension(v string) *DeleteScalingPolicyInput { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *DeleteScalingPolicyInput) SetServiceNamespace(v string) *DeleteScalingPolicyInput { - s.ServiceNamespace = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicyResponse -type DeleteScalingPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteScalingPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScalingPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeregisterScalableTargetRequest -type DeregisterScalableTargetInput struct { - _ struct{} `type:"structure"` - - // The identifier of the resource associated with the scalable target. This - // string consists of the resource type and unique identifier. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The scalable dimension associated with the scalable target. This string consists - // of the service namespace, resource type, and scaling property. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - // - // ScalableDimension is a required field - ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` -} - -// String returns the string representation -func (s DeregisterScalableTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterScalableTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterScalableTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterScalableTargetInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.ScalableDimension == nil { - invalidParams.Add(request.NewErrParamRequired("ScalableDimension")) - } - if s.ServiceNamespace == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNamespace")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *DeregisterScalableTargetInput) SetResourceId(v string) *DeregisterScalableTargetInput { - s.ResourceId = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *DeregisterScalableTargetInput) SetScalableDimension(v string) *DeregisterScalableTargetInput { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *DeregisterScalableTargetInput) SetServiceNamespace(v string) *DeregisterScalableTargetInput { - s.ServiceNamespace = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeregisterScalableTargetResponse -type DeregisterScalableTargetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterScalableTargetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterScalableTargetOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalableTargetsRequest -type DescribeScalableTargetsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of scalable target results. This value can be between - // 1 and 50. The default value is 50. - // - // If this parameter is used, the operation returns up to MaxResults results - // at a time, along with a NextToken value. To get the next set of results, - // include the NextToken value in a subsequent call. If this parameter is not - // used, the operation returns up to 50 results and a NextToken value, if applicable. - MaxResults *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` - - // The identifier of the resource associated with the scalable target. This - // string consists of the resource type and unique identifier. If you specify - // a scalable dimension, you must also specify a resource ID. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - ResourceIds []*string `type:"list"` - - // The scalable dimension associated with the scalable target. This string consists - // of the service namespace, resource type, and scaling property. If you specify - // a scalable dimension, you must also specify a resource ID. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - ScalableDimension *string `type:"string" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` -} - -// String returns the string representation -func (s DescribeScalableTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalableTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeScalableTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeScalableTargetsInput"} - if s.ServiceNamespace == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNamespace")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeScalableTargetsInput) SetMaxResults(v int64) *DescribeScalableTargetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScalableTargetsInput) SetNextToken(v string) *DescribeScalableTargetsInput { - s.NextToken = &v - return s -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *DescribeScalableTargetsInput) SetResourceIds(v []*string) *DescribeScalableTargetsInput { - s.ResourceIds = v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *DescribeScalableTargetsInput) SetScalableDimension(v string) *DescribeScalableTargetsInput { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *DescribeScalableTargetsInput) SetServiceNamespace(v string) *DescribeScalableTargetsInput { - s.ServiceNamespace = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalableTargetsResponse -type DescribeScalableTargetsOutput struct { - _ struct{} `type:"structure"` - - // The token required to get the next set of results. This value is null if - // there are no more results to return. - NextToken *string `type:"string"` - - // The list of scalable targets that matches the request parameters. - ScalableTargets []*ScalableTarget `type:"list"` -} - -// String returns the string representation -func (s DescribeScalableTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalableTargetsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScalableTargetsOutput) SetNextToken(v string) *DescribeScalableTargetsOutput { - s.NextToken = &v - return s -} - -// SetScalableTargets sets the ScalableTargets field's value. -func (s *DescribeScalableTargetsOutput) SetScalableTargets(v []*ScalableTarget) *DescribeScalableTargetsOutput { - s.ScalableTargets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingActivitiesRequest -type DescribeScalingActivitiesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of scalable target results. This value can be between - // 1 and 50. The default value is 50. - // - // If this parameter is used, the operation returns up to MaxResults results - // at a time, along with a NextToken value. To get the next set of results, - // include the NextToken value in a subsequent call. If this parameter is not - // used, the operation returns up to 50 results and a NextToken value, if applicable. - MaxResults *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` - - // The identifier of the resource associated with the scaling activity. This - // string consists of the resource type and unique identifier. If you specify - // a scalable dimension, you must also specify a resource ID. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - ResourceId *string `min:"1" type:"string"` - - // The scalable dimension. This string consists of the service namespace, resource - // type, and scaling property. If you specify a scalable dimension, you must - // also specify a resource ID. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - ScalableDimension *string `type:"string" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` -} - -// String returns the string representation -func (s DescribeScalingActivitiesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingActivitiesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeScalingActivitiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeScalingActivitiesInput"} - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.ServiceNamespace == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNamespace")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeScalingActivitiesInput) SetMaxResults(v int64) *DescribeScalingActivitiesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScalingActivitiesInput) SetNextToken(v string) *DescribeScalingActivitiesInput { - s.NextToken = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DescribeScalingActivitiesInput) SetResourceId(v string) *DescribeScalingActivitiesInput { - s.ResourceId = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *DescribeScalingActivitiesInput) SetScalableDimension(v string) *DescribeScalingActivitiesInput { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *DescribeScalingActivitiesInput) SetServiceNamespace(v string) *DescribeScalingActivitiesInput { - s.ServiceNamespace = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingActivitiesResponse -type DescribeScalingActivitiesOutput struct { - _ struct{} `type:"structure"` - - // The token required to get the next set of results. This value is null if - // there are no more results to return. - NextToken *string `type:"string"` - - // A list of scaling activity objects. - ScalingActivities []*ScalingActivity `type:"list"` -} - -// String returns the string representation -func (s DescribeScalingActivitiesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingActivitiesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScalingActivitiesOutput) SetNextToken(v string) *DescribeScalingActivitiesOutput { - s.NextToken = &v - return s -} - -// SetScalingActivities sets the ScalingActivities field's value. -func (s *DescribeScalingActivitiesOutput) SetScalingActivities(v []*ScalingActivity) *DescribeScalingActivitiesOutput { - s.ScalingActivities = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingPoliciesRequest -type DescribeScalingPoliciesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of scalable target results. This value can be between - // 1 and 50. The default value is 50. - // - // If this parameter is used, the operation returns up to MaxResults results - // at a time, along with a NextToken value. To get the next set of results, - // include the NextToken value in a subsequent call. If this parameter is not - // used, the operation returns up to 50 results and a NextToken value, if applicable. - MaxResults *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` - - // The names of the scaling policies to describe. - PolicyNames []*string `type:"list"` - - // The identifier of the resource associated with the scaling policy. This string - // consists of the resource type and unique identifier. If you specify a scalable - // dimension, you must also specify a resource ID. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - ResourceId *string `min:"1" type:"string"` - - // The scalable dimension. This string consists of the service namespace, resource - // type, and scaling property. If you specify a scalable dimension, you must - // also specify a resource ID. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - ScalableDimension *string `type:"string" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` -} - -// String returns the string representation -func (s DescribeScalingPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeScalingPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeScalingPoliciesInput"} - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.ServiceNamespace == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNamespace")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeScalingPoliciesInput) SetMaxResults(v int64) *DescribeScalingPoliciesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScalingPoliciesInput) SetNextToken(v string) *DescribeScalingPoliciesInput { - s.NextToken = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *DescribeScalingPoliciesInput) SetPolicyNames(v []*string) *DescribeScalingPoliciesInput { - s.PolicyNames = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DescribeScalingPoliciesInput) SetResourceId(v string) *DescribeScalingPoliciesInput { - s.ResourceId = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *DescribeScalingPoliciesInput) SetScalableDimension(v string) *DescribeScalingPoliciesInput { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *DescribeScalingPoliciesInput) SetServiceNamespace(v string) *DescribeScalingPoliciesInput { - s.ServiceNamespace = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingPoliciesResponse -type DescribeScalingPoliciesOutput struct { - _ struct{} `type:"structure"` - - // The token required to get the next set of results. This value is null if - // there are no more results to return. - NextToken *string `type:"string"` - - // A list of scaling policy objects. - ScalingPolicies []*ScalingPolicy `type:"list"` -} - -// String returns the string representation -func (s DescribeScalingPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingPoliciesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScalingPoliciesOutput) SetNextToken(v string) *DescribeScalingPoliciesOutput { - s.NextToken = &v - return s -} - -// SetScalingPolicies sets the ScalingPolicies field's value. -func (s *DescribeScalingPoliciesOutput) SetScalingPolicies(v []*ScalingPolicy) *DescribeScalingPoliciesOutput { - s.ScalingPolicies = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicyRequest -type PutScalingPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the scaling policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The policy type. If you are creating a new policy, this parameter is required. - // If you are updating a policy, this parameter is not required. - PolicyType *string `type:"string" enum:"PolicyType"` - - // The identifier of the resource associated with the scaling policy. This string - // consists of the resource type and unique identifier. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The scalable dimension. This string consists of the service namespace, resource - // type, and scaling property. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - // - // ScalableDimension is a required field - ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` - - // The configuration for the step scaling policy. If you are creating a new - // policy, this parameter is required. If you are updating a policy, this parameter - // is not required. For more information, see StepScalingPolicyConfiguration - // and StepAdjustment. - StepScalingPolicyConfiguration *StepScalingPolicyConfiguration `type:"structure"` -} - -// String returns the string representation -func (s PutScalingPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutScalingPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutScalingPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutScalingPolicyInput"} - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.ScalableDimension == nil { - invalidParams.Add(request.NewErrParamRequired("ScalableDimension")) - } - if s.ServiceNamespace == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNamespace")) - } - if s.StepScalingPolicyConfiguration != nil { - if err := s.StepScalingPolicyConfiguration.Validate(); err != nil { - invalidParams.AddNested("StepScalingPolicyConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PutScalingPolicyInput) SetPolicyName(v string) *PutScalingPolicyInput { - s.PolicyName = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *PutScalingPolicyInput) SetPolicyType(v string) *PutScalingPolicyInput { - s.PolicyType = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *PutScalingPolicyInput) SetResourceId(v string) *PutScalingPolicyInput { - s.ResourceId = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *PutScalingPolicyInput) SetScalableDimension(v string) *PutScalingPolicyInput { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *PutScalingPolicyInput) SetServiceNamespace(v string) *PutScalingPolicyInput { - s.ServiceNamespace = &v - return s -} - -// SetStepScalingPolicyConfiguration sets the StepScalingPolicyConfiguration field's value. -func (s *PutScalingPolicyInput) SetStepScalingPolicyConfiguration(v *StepScalingPolicyConfiguration) *PutScalingPolicyInput { - s.StepScalingPolicyConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicyResponse -type PutScalingPolicyOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resulting scaling policy. - // - // PolicyARN is a required field - PolicyARN *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutScalingPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutScalingPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicyARN sets the PolicyARN field's value. -func (s *PutScalingPolicyOutput) SetPolicyARN(v string) *PutScalingPolicyOutput { - s.PolicyARN = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/RegisterScalableTargetRequest -type RegisterScalableTargetInput struct { - _ struct{} `type:"structure"` - - // The maximum value to scale to in response to a scale out event. This parameter - // is required if you are registering a scalable target and optional if you - // are updating one. - MaxCapacity *int64 `type:"integer"` - - // The minimum value to scale to in response to a scale in event. This parameter - // is required if you are registering a scalable target and optional if you - // are updating one. - MinCapacity *int64 `type:"integer"` - - // The identifier of the resource associated with the scalable target. This - // string consists of the resource type and unique identifier. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The ARN of an IAM role that allows Application Auto Scaling to modify the - // scalable target on your behalf. This parameter is required when you register - // a scalable target and optional when you update one. - RoleARN *string `min:"1" type:"string"` - - // The scalable dimension associated with the scalable target. This string consists - // of the service namespace, resource type, and scaling property. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - // - // ScalableDimension is a required field - ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` -} - -// String returns the string representation -func (s RegisterScalableTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterScalableTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterScalableTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterScalableTargetInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.ScalableDimension == nil { - invalidParams.Add(request.NewErrParamRequired("ScalableDimension")) - } - if s.ServiceNamespace == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNamespace")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxCapacity sets the MaxCapacity field's value. -func (s *RegisterScalableTargetInput) SetMaxCapacity(v int64) *RegisterScalableTargetInput { - s.MaxCapacity = &v - return s -} - -// SetMinCapacity sets the MinCapacity field's value. -func (s *RegisterScalableTargetInput) SetMinCapacity(v int64) *RegisterScalableTargetInput { - s.MinCapacity = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *RegisterScalableTargetInput) SetResourceId(v string) *RegisterScalableTargetInput { - s.ResourceId = &v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *RegisterScalableTargetInput) SetRoleARN(v string) *RegisterScalableTargetInput { - s.RoleARN = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *RegisterScalableTargetInput) SetScalableDimension(v string) *RegisterScalableTargetInput { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *RegisterScalableTargetInput) SetServiceNamespace(v string) *RegisterScalableTargetInput { - s.ServiceNamespace = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/RegisterScalableTargetResponse -type RegisterScalableTargetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RegisterScalableTargetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterScalableTargetOutput) GoString() string { - return s.String() -} - -// Represents a scalable target. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/ScalableTarget -type ScalableTarget struct { - _ struct{} `type:"structure"` - - // The Unix timestamp for when the scalable target was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The maximum value to scale to in response to a scale out event. - // - // MaxCapacity is a required field - MaxCapacity *int64 `type:"integer" required:"true"` - - // The minimum value to scale to in response to a scale in event. - // - // MinCapacity is a required field - MinCapacity *int64 `type:"integer" required:"true"` - - // The identifier of the resource associated with the scalable target. This - // string consists of the resource type and unique identifier. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The ARN of an IAM role that allows Application Auto Scaling to modify the - // scalable target on your behalf. - // - // RoleARN is a required field - RoleARN *string `min:"1" type:"string" required:"true"` - - // The scalable dimension associated with the scalable target. This string consists - // of the service namespace, resource type, and scaling property. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - // - // ScalableDimension is a required field - ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` -} - -// String returns the string representation -func (s ScalableTarget) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalableTarget) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ScalableTarget) SetCreationTime(v time.Time) *ScalableTarget { - s.CreationTime = &v - return s -} - -// SetMaxCapacity sets the MaxCapacity field's value. -func (s *ScalableTarget) SetMaxCapacity(v int64) *ScalableTarget { - s.MaxCapacity = &v - return s -} - -// SetMinCapacity sets the MinCapacity field's value. -func (s *ScalableTarget) SetMinCapacity(v int64) *ScalableTarget { - s.MinCapacity = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ScalableTarget) SetResourceId(v string) *ScalableTarget { - s.ResourceId = &v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ScalableTarget) SetRoleARN(v string) *ScalableTarget { - s.RoleARN = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *ScalableTarget) SetScalableDimension(v string) *ScalableTarget { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *ScalableTarget) SetServiceNamespace(v string) *ScalableTarget { - s.ServiceNamespace = &v - return s -} - -// Represents a scaling activity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/ScalingActivity -type ScalingActivity struct { - _ struct{} `type:"structure"` - - // The unique identifier of the scaling activity. - // - // ActivityId is a required field - ActivityId *string `type:"string" required:"true"` - - // A simple description of what caused the scaling activity to happen. - // - // Cause is a required field - Cause *string `type:"string" required:"true"` - - // A simple description of what action the scaling activity intends to accomplish. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // The details about the scaling activity. - Details *string `type:"string"` - - // The Unix timestamp for when the scaling activity ended. - EndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The identifier of the resource associated with the scaling activity. This - // string consists of the resource type and unique identifier. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The scalable dimension. This string consists of the service namespace, resource - // type, and scaling property. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - // - // ScalableDimension is a required field - ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` - - // The Unix timestamp for when the scaling activity began. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // Indicates the status of the scaling activity. - // - // StatusCode is a required field - StatusCode *string `type:"string" required:"true" enum:"ScalingActivityStatusCode"` - - // A simple message about the current status of the scaling activity. - StatusMessage *string `type:"string"` -} - -// String returns the string representation -func (s ScalingActivity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingActivity) GoString() string { - return s.String() -} - -// SetActivityId sets the ActivityId field's value. -func (s *ScalingActivity) SetActivityId(v string) *ScalingActivity { - s.ActivityId = &v - return s -} - -// SetCause sets the Cause field's value. -func (s *ScalingActivity) SetCause(v string) *ScalingActivity { - s.Cause = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ScalingActivity) SetDescription(v string) *ScalingActivity { - s.Description = &v - return s -} - -// SetDetails sets the Details field's value. -func (s *ScalingActivity) SetDetails(v string) *ScalingActivity { - s.Details = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *ScalingActivity) SetEndTime(v time.Time) *ScalingActivity { - s.EndTime = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ScalingActivity) SetResourceId(v string) *ScalingActivity { - s.ResourceId = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *ScalingActivity) SetScalableDimension(v string) *ScalingActivity { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *ScalingActivity) SetServiceNamespace(v string) *ScalingActivity { - s.ServiceNamespace = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ScalingActivity) SetStartTime(v time.Time) *ScalingActivity { - s.StartTime = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *ScalingActivity) SetStatusCode(v string) *ScalingActivity { - s.StatusCode = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ScalingActivity) SetStatusMessage(v string) *ScalingActivity { - s.StatusMessage = &v - return s -} - -// Represents a scaling policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/ScalingPolicy -type ScalingPolicy struct { - _ struct{} `type:"structure"` - - // The CloudWatch alarms associated with the scaling policy. - Alarms []*Alarm `type:"list"` - - // The Unix timestamp for when the scaling policy was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The Amazon Resource Name (ARN) of the scaling policy. - // - // PolicyARN is a required field - PolicyARN *string `min:"1" type:"string" required:"true"` - - // The name of the scaling policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The scaling policy type. - // - // PolicyType is a required field - PolicyType *string `type:"string" required:"true" enum:"PolicyType"` - - // The identifier of the resource associated with the scaling policy. This string - // consists of the resource type and unique identifier. - // - // * ECS service - The resource type is service and the unique identifier - // is the cluster name and service name. Example: service/default/sample-webapp. - // - // * Spot fleet request - The resource type is spot-fleet-request and the - // unique identifier is the Spot fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE. - // - // * EMR cluster - The resource type is instancegroup and the unique identifier - // is the cluster ID and instance group ID. Example: instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The scalable dimension. This string consists of the service namespace, resource - // type, and scaling property. - // - // * ecs:service:DesiredCount - The desired task count of an ECS service. - // - // * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot - // fleet request. - // - // * elasticmapreduce:instancegroup:InstanceCount - The instance count of - // an EMR Instance Group. - // - // ScalableDimension is a required field - ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` - - // The namespace of the AWS service. For more information, see AWS Service Namespaces - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) - // in the Amazon Web Services General Reference. - // - // ServiceNamespace is a required field - ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"` - - // The configuration for the step scaling policy. - StepScalingPolicyConfiguration *StepScalingPolicyConfiguration `type:"structure"` -} - -// String returns the string representation -func (s ScalingPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingPolicy) GoString() string { - return s.String() -} - -// SetAlarms sets the Alarms field's value. -func (s *ScalingPolicy) SetAlarms(v []*Alarm) *ScalingPolicy { - s.Alarms = v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ScalingPolicy) SetCreationTime(v time.Time) *ScalingPolicy { - s.CreationTime = &v - return s -} - -// SetPolicyARN sets the PolicyARN field's value. -func (s *ScalingPolicy) SetPolicyARN(v string) *ScalingPolicy { - s.PolicyARN = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *ScalingPolicy) SetPolicyName(v string) *ScalingPolicy { - s.PolicyName = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *ScalingPolicy) SetPolicyType(v string) *ScalingPolicy { - s.PolicyType = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ScalingPolicy) SetResourceId(v string) *ScalingPolicy { - s.ResourceId = &v - return s -} - -// SetScalableDimension sets the ScalableDimension field's value. -func (s *ScalingPolicy) SetScalableDimension(v string) *ScalingPolicy { - s.ScalableDimension = &v - return s -} - -// SetServiceNamespace sets the ServiceNamespace field's value. -func (s *ScalingPolicy) SetServiceNamespace(v string) *ScalingPolicy { - s.ServiceNamespace = &v - return s -} - -// SetStepScalingPolicyConfiguration sets the StepScalingPolicyConfiguration field's value. -func (s *ScalingPolicy) SetStepScalingPolicyConfiguration(v *StepScalingPolicyConfiguration) *ScalingPolicy { - s.StepScalingPolicyConfiguration = v - return s -} - -// Represents a step adjustment for a StepScalingPolicyConfiguration. Describes -// an adjustment based on the difference between the value of the aggregated -// CloudWatch metric and the breach threshold that you've defined for the alarm. -// -// For the following examples, suppose that you have an alarm with a breach -// threshold of 50: -// -// * To trigger the adjustment when the metric is greater than or equal to -// 50 and less than 60, specify a lower bound of 0 and an upper bound of -// 10. -// -// * To trigger the adjustment when the metric is greater than 40 and less -// than or equal to 50, specify a lower bound of -10 and an upper bound of -// 0. -// -// There are a few rules for the step adjustments for your step policy: -// -// * The ranges of your step adjustments can't overlap or have a gap. -// -// * At most one step adjustment can have a null lower bound. If one step -// adjustment has a negative lower bound, then there must be a step adjustment -// with a null lower bound. -// -// * At most one step adjustment can have a null upper bound. If one step -// adjustment has a positive upper bound, then there must be a step adjustment -// with a null upper bound. -// -// * The upper and lower bound can't be null in the same step adjustment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/StepAdjustment -type StepAdjustment struct { - _ struct{} `type:"structure"` - - // The lower bound for the difference between the alarm threshold and the CloudWatch - // metric. If the metric value is above the breach threshold, the lower bound - // is inclusive (the metric must be greater than or equal to the threshold plus - // the lower bound). Otherwise, it is exclusive (the metric must be greater - // than the threshold plus the lower bound). A null value indicates negative - // infinity. - MetricIntervalLowerBound *float64 `type:"double"` - - // The upper bound for the difference between the alarm threshold and the CloudWatch - // metric. If the metric value is above the breach threshold, the upper bound - // is exclusive (the metric must be less than the threshold plus the upper bound). - // Otherwise, it is inclusive (the metric must be less than or equal to the - // threshold plus the upper bound). A null value indicates positive infinity. - // - // The upper bound must be greater than the lower bound. - MetricIntervalUpperBound *float64 `type:"double"` - - // The amount by which to scale, based on the specified adjustment type. A positive - // value adds to the current scalable dimension while a negative number removes - // from the current scalable dimension. - // - // ScalingAdjustment is a required field - ScalingAdjustment *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s StepAdjustment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepAdjustment) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StepAdjustment) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StepAdjustment"} - if s.ScalingAdjustment == nil { - invalidParams.Add(request.NewErrParamRequired("ScalingAdjustment")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetricIntervalLowerBound sets the MetricIntervalLowerBound field's value. -func (s *StepAdjustment) SetMetricIntervalLowerBound(v float64) *StepAdjustment { - s.MetricIntervalLowerBound = &v - return s -} - -// SetMetricIntervalUpperBound sets the MetricIntervalUpperBound field's value. -func (s *StepAdjustment) SetMetricIntervalUpperBound(v float64) *StepAdjustment { - s.MetricIntervalUpperBound = &v - return s -} - -// SetScalingAdjustment sets the ScalingAdjustment field's value. -func (s *StepAdjustment) SetScalingAdjustment(v int64) *StepAdjustment { - s.ScalingAdjustment = &v - return s -} - -// Represents a step scaling policy configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/StepScalingPolicyConfiguration -type StepScalingPolicyConfiguration struct { - _ struct{} `type:"structure"` - - // The adjustment type, which specifies how the ScalingAdjustment parameter - // in a StepAdjustment is interpreted. - AdjustmentType *string `type:"string" enum:"AdjustmentType"` - - // The amount of time, in seconds, after a scaling activity completes where - // previous trigger-related scaling activities can influence future scaling - // events. - // - // For scale out policies, while Cooldown is in effect, the capacity that has - // been added by the previous scale out event that initiated the Cooldown is - // calculated as part of the desired capacity for the next scale out. The intention - // is to continuously (but not excessively) scale out. For example, an alarm - // triggers a step scaling policy to scale out an Amazon ECS service by 2 tasks, - // the scaling activity completes successfully, and a Cooldown period of 5 minutes - // starts. During the Cooldown period, if the alarm triggers the same policy - // again but at a more aggressive step adjustment to scale out the service by - // 3 tasks, the 2 tasks that were added in the previous scale out event are - // considered part of that capacity and only 1 additional task is added to the - // desired count. - // - // For scale in policies, the Cooldown period is used to block subsequent scale - // in requests until it has expired. The intention is to scale in conservatively - // to protect your application's availability. However, if another alarm triggers - // a scale out policy during the Cooldown period after a scale-in, Application - // Auto Scaling scales out your scalable target immediately. - Cooldown *int64 `type:"integer"` - - // The aggregation type for the CloudWatch metrics. Valid values are Minimum, - // Maximum, and Average. - MetricAggregationType *string `type:"string" enum:"MetricAggregationType"` - - // The minimum number to adjust your scalable dimension as a result of a scaling - // activity. If the adjustment type is PercentChangeInCapacity, the scaling - // policy changes the scalable dimension of the scalable target by this amount. - MinAdjustmentMagnitude *int64 `type:"integer"` - - // A set of adjustments that enable you to scale based on the size of the alarm - // breach. - StepAdjustments []*StepAdjustment `type:"list"` -} - -// String returns the string representation -func (s StepScalingPolicyConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepScalingPolicyConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StepScalingPolicyConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StepScalingPolicyConfiguration"} - if s.StepAdjustments != nil { - for i, v := range s.StepAdjustments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StepAdjustments", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdjustmentType sets the AdjustmentType field's value. -func (s *StepScalingPolicyConfiguration) SetAdjustmentType(v string) *StepScalingPolicyConfiguration { - s.AdjustmentType = &v - return s -} - -// SetCooldown sets the Cooldown field's value. -func (s *StepScalingPolicyConfiguration) SetCooldown(v int64) *StepScalingPolicyConfiguration { - s.Cooldown = &v - return s -} - -// SetMetricAggregationType sets the MetricAggregationType field's value. -func (s *StepScalingPolicyConfiguration) SetMetricAggregationType(v string) *StepScalingPolicyConfiguration { - s.MetricAggregationType = &v - return s -} - -// SetMinAdjustmentMagnitude sets the MinAdjustmentMagnitude field's value. -func (s *StepScalingPolicyConfiguration) SetMinAdjustmentMagnitude(v int64) *StepScalingPolicyConfiguration { - s.MinAdjustmentMagnitude = &v - return s -} - -// SetStepAdjustments sets the StepAdjustments field's value. -func (s *StepScalingPolicyConfiguration) SetStepAdjustments(v []*StepAdjustment) *StepScalingPolicyConfiguration { - s.StepAdjustments = v - return s -} - -const ( - // AdjustmentTypeChangeInCapacity is a AdjustmentType enum value - AdjustmentTypeChangeInCapacity = "ChangeInCapacity" - - // AdjustmentTypePercentChangeInCapacity is a AdjustmentType enum value - AdjustmentTypePercentChangeInCapacity = "PercentChangeInCapacity" - - // AdjustmentTypeExactCapacity is a AdjustmentType enum value - AdjustmentTypeExactCapacity = "ExactCapacity" -) - -const ( - // MetricAggregationTypeAverage is a MetricAggregationType enum value - MetricAggregationTypeAverage = "Average" - - // MetricAggregationTypeMinimum is a MetricAggregationType enum value - MetricAggregationTypeMinimum = "Minimum" - - // MetricAggregationTypeMaximum is a MetricAggregationType enum value - MetricAggregationTypeMaximum = "Maximum" -) - -const ( - // PolicyTypeStepScaling is a PolicyType enum value - PolicyTypeStepScaling = "StepScaling" -) - -const ( - // ScalableDimensionEcsServiceDesiredCount is a ScalableDimension enum value - ScalableDimensionEcsServiceDesiredCount = "ecs:service:DesiredCount" - - // ScalableDimensionEc2SpotFleetRequestTargetCapacity is a ScalableDimension enum value - ScalableDimensionEc2SpotFleetRequestTargetCapacity = "ec2:spot-fleet-request:TargetCapacity" - - // ScalableDimensionElasticmapreduceInstancegroupInstanceCount is a ScalableDimension enum value - ScalableDimensionElasticmapreduceInstancegroupInstanceCount = "elasticmapreduce:instancegroup:InstanceCount" -) - -const ( - // ScalingActivityStatusCodePending is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodePending = "Pending" - - // ScalingActivityStatusCodeInProgress is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeInProgress = "InProgress" - - // ScalingActivityStatusCodeSuccessful is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeSuccessful = "Successful" - - // ScalingActivityStatusCodeOverridden is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeOverridden = "Overridden" - - // ScalingActivityStatusCodeUnfulfilled is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeUnfulfilled = "Unfulfilled" - - // ScalingActivityStatusCodeFailed is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeFailed = "Failed" -) - -const ( - // ServiceNamespaceEcs is a ServiceNamespace enum value - ServiceNamespaceEcs = "ecs" - - // ServiceNamespaceElasticmapreduce is a ServiceNamespace enum value - ServiceNamespaceElasticmapreduce = "elasticmapreduce" - - // ServiceNamespaceEc2 is a ServiceNamespace enum value - ServiceNamespaceEc2 = "ec2" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go deleted file mode 100644 index 019a4bf..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go +++ /dev/null @@ -1,63 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package applicationautoscaling - -const ( - - // ErrCodeConcurrentUpdateException for service response error code - // "ConcurrentUpdateException". - // - // Concurrent updates caused an exception, for example, if you request an update - // to an Application Auto Scaling resource that already has a pending update. - ErrCodeConcurrentUpdateException = "ConcurrentUpdateException" - - // ErrCodeFailedResourceAccessException for service response error code - // "FailedResourceAccessException". - // - // Failed access to resources caused an exception. This exception currently - // only applies to DescribeScalingPolicies. It is thrown when Application Auto - // Scaling is unable to retrieve the alarms associated with a scaling policy - // due to a client error, for example, if the role ARN specified for a scalable - // target does not have the proper permissions to call the CloudWatch DescribeAlarms - // (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html) - // API operation on behalf of your account. - ErrCodeFailedResourceAccessException = "FailedResourceAccessException" - - // ErrCodeInternalServiceException for service response error code - // "InternalServiceException". - // - // The service encountered an internal error. - ErrCodeInternalServiceException = "InternalServiceException" - - // ErrCodeInvalidNextTokenException for service response error code - // "InvalidNextTokenException". - // - // The next token supplied was invalid. - ErrCodeInvalidNextTokenException = "InvalidNextTokenException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // Your account exceeded a limit. This exception is thrown when a per-account - // resource limit is exceeded. For more information, see Application Auto Scaling - // Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_as-app). - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeObjectNotFoundException for service response error code - // "ObjectNotFoundException". - // - // The specified object could not be found. For any Put or Register API operation, - // which depends on the existence of a scalable target, this exception is thrown - // if the scalable target with the specified service namespace, resource ID, - // and scalable dimension does not exist. For any Delete or Deregister API operation, - // this exception is thrown if the resource that is to be deleted or deregistered - // cannot be found. - ErrCodeObjectNotFoundException = "ObjectNotFoundException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // An exception was thrown for a validation issue. Review the available parameters - // for the API request. - ErrCodeValidationException = "ValidationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go deleted file mode 100644 index 80a7498..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go +++ /dev/null @@ -1,122 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package applicationautoscaling - -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" -) - -// With Application Auto Scaling, you can automatically scale your AWS resources. -// The experience similar to that of Auto Scaling (https://aws.amazon.com/autoscaling/). -// You can use Application Auto Scaling to accomplish the following tasks: -// -// * Define scaling policies to automatically scale your AWS resources -// -// * Scale your resources in response to CloudWatch alarms -// -// * View the history of your scaling events -// -// Application Auto Scaling can scale the following AWS resources: -// -// * Amazon ECS services. For more information, see Service Auto Scaling -// (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html) -// in the Amazon EC2 Container Service Developer Guide. -// -// * Amazon EC2 Spot fleets. For more information, see Automatic Scaling -// for Spot Fleet (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/fleet-auto-scaling.html) -// in the Amazon EC2 User Guide. -// -// * Amazon EMR clusters. For more information, see Using Automatic Scaling -// in Amazon EMR (http://docs.aws.amazon.com/ElasticMapReduce/latest/ManagementGuide/emr-automatic-scaling.html) -// in the Amazon EMR Management Guide. -// -// For a list of supported regions, see AWS Regions and Endpoints: Application -// Auto Scaling (http://docs.aws.amazon.com/general/latest/gr/rande.html#as-app_region) -// in the AWS General Reference. -// 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/application-autoscaling-2016-02-06 -type ApplicationAutoScaling 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 = "autoscaling" // Service endpoint prefix API calls made to. - EndpointsID = "application-autoscaling" // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ApplicationAutoScaling 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 ApplicationAutoScaling client from just a session. -// svc := applicationautoscaling.New(mySession) -// -// // Create a ApplicationAutoScaling client with additional configuration -// svc := applicationautoscaling.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ApplicationAutoScaling { - 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) *ApplicationAutoScaling { - if len(signingName) == 0 { - signingName = "application-autoscaling" - } - svc := &ApplicationAutoScaling{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-02-06", - JSONVersion: "1.1", - TargetPrefix: "AnyScaleFrontendService", - }, - 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 ApplicationAutoScaling operation and runs any -// custom request initialization. -func (c *ApplicationAutoScaling) 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/autoscaling/api.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go deleted file mode 100644 index 64bb601..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go +++ /dev/null @@ -1,11199 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package autoscaling provides a client for Auto Scaling. -package autoscaling - -import ( - "fmt" - "time" - - "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 opAttachInstances = "AttachInstances" - -// AttachInstancesRequest generates a "aws/request.Request" representing the -// client's request for the AttachInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachInstancesRequest method. -// req, resp := client.AttachInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachInstances -func (c *AutoScaling) AttachInstancesRequest(input *AttachInstancesInput) (req *request.Request, output *AttachInstancesOutput) { - op := &request.Operation{ - Name: opAttachInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachInstancesInput{} - } - - output = &AttachInstancesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AttachInstances API operation for Auto Scaling. -// -// Attaches one or more EC2 instances to the specified Auto Scaling group. -// -// When you attach instances, Auto Scaling increases the desired capacity of -// the group by the number of instances being attached. If the number of instances -// being attached plus the desired capacity of the group exceeds the maximum -// size of the group, the operation fails. -// -// If there is a Classic load balancer attached to your Auto Scaling group, -// the instances are also registered with the load balancer. If there are target -// groups attached to your Auto Scaling group, the instances are also registered -// with the target groups. -// -// For more information, see Attach EC2 Instances to Your Auto Scaling Group -// (http://docs.aws.amazon.com/autoscaling/latest/userguide/attach-instance-asg.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation AttachInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachInstances -func (c *AutoScaling) AttachInstances(input *AttachInstancesInput) (*AttachInstancesOutput, error) { - req, out := c.AttachInstancesRequest(input) - err := req.Send() - return out, err -} - -const opAttachLoadBalancerTargetGroups = "AttachLoadBalancerTargetGroups" - -// AttachLoadBalancerTargetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the AttachLoadBalancerTargetGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachLoadBalancerTargetGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachLoadBalancerTargetGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachLoadBalancerTargetGroupsRequest method. -// req, resp := client.AttachLoadBalancerTargetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancerTargetGroups -func (c *AutoScaling) AttachLoadBalancerTargetGroupsRequest(input *AttachLoadBalancerTargetGroupsInput) (req *request.Request, output *AttachLoadBalancerTargetGroupsOutput) { - op := &request.Operation{ - Name: opAttachLoadBalancerTargetGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachLoadBalancerTargetGroupsInput{} - } - - output = &AttachLoadBalancerTargetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachLoadBalancerTargetGroups API operation for Auto Scaling. -// -// Attaches one or more target groups to the specified Auto Scaling group. -// -// To describe the target groups for an Auto Scaling group, use DescribeLoadBalancerTargetGroups. -// To detach the target group from the Auto Scaling group, use DetachLoadBalancerTargetGroups. -// -// For more information, see Attach a Load Balancer to Your Auto Scaling Group -// (http://docs.aws.amazon.com/autoscaling/latest/userguide/attach-load-balancer-asg.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation AttachLoadBalancerTargetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancerTargetGroups -func (c *AutoScaling) AttachLoadBalancerTargetGroups(input *AttachLoadBalancerTargetGroupsInput) (*AttachLoadBalancerTargetGroupsOutput, error) { - req, out := c.AttachLoadBalancerTargetGroupsRequest(input) - err := req.Send() - return out, err -} - -const opAttachLoadBalancers = "AttachLoadBalancers" - -// AttachLoadBalancersRequest generates a "aws/request.Request" representing the -// client's request for the AttachLoadBalancers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachLoadBalancers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachLoadBalancers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachLoadBalancersRequest method. -// req, resp := client.AttachLoadBalancersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancers -func (c *AutoScaling) AttachLoadBalancersRequest(input *AttachLoadBalancersInput) (req *request.Request, output *AttachLoadBalancersOutput) { - op := &request.Operation{ - Name: opAttachLoadBalancers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachLoadBalancersInput{} - } - - output = &AttachLoadBalancersOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachLoadBalancers API operation for Auto Scaling. -// -// Attaches one or more Classic load balancers to the specified Auto Scaling -// group. -// -// To attach an Application load balancer instead, see AttachLoadBalancerTargetGroups. -// -// To describe the load balancers for an Auto Scaling group, use DescribeLoadBalancers. -// To detach the load balancer from the Auto Scaling group, use DetachLoadBalancers. -// -// For more information, see Attach a Load Balancer to Your Auto Scaling Group -// (http://docs.aws.amazon.com/autoscaling/latest/userguide/attach-load-balancer-asg.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation AttachLoadBalancers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancers -func (c *AutoScaling) AttachLoadBalancers(input *AttachLoadBalancersInput) (*AttachLoadBalancersOutput, error) { - req, out := c.AttachLoadBalancersRequest(input) - err := req.Send() - return out, err -} - -const opCompleteLifecycleAction = "CompleteLifecycleAction" - -// CompleteLifecycleActionRequest generates a "aws/request.Request" representing the -// client's request for the CompleteLifecycleAction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CompleteLifecycleAction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CompleteLifecycleAction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CompleteLifecycleActionRequest method. -// req, resp := client.CompleteLifecycleActionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CompleteLifecycleAction -func (c *AutoScaling) CompleteLifecycleActionRequest(input *CompleteLifecycleActionInput) (req *request.Request, output *CompleteLifecycleActionOutput) { - op := &request.Operation{ - Name: opCompleteLifecycleAction, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CompleteLifecycleActionInput{} - } - - output = &CompleteLifecycleActionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CompleteLifecycleAction API operation for Auto Scaling. -// -// Completes the lifecycle action for the specified token or instance with the -// specified result. -// -// This step is a part of the procedure for adding a lifecycle hook to an Auto -// Scaling group: -// -// (Optional) Create a Lambda function and a rule that allows CloudWatch Events -// to invoke your Lambda function when Auto Scaling launches or terminates instances. -// -// (Optional) Create a notification target and an IAM role. The target can be -// either an Amazon SQS queue or an Amazon SNS topic. The role allows Auto Scaling -// to publish lifecycle notifications to the target. -// -// Create the lifecycle hook. Specify whether the hook is used when the instances -// launch or terminate. -// -// If you need more time, record the lifecycle action heartbeat to keep the -// instance in a pending state. -// -// If you finish before the timeout period ends, complete the lifecycle action. -// -// For more information, see Auto Scaling Lifecycle (http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation CompleteLifecycleAction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CompleteLifecycleAction -func (c *AutoScaling) CompleteLifecycleAction(input *CompleteLifecycleActionInput) (*CompleteLifecycleActionOutput, error) { - req, out := c.CompleteLifecycleActionRequest(input) - err := req.Send() - return out, err -} - -const opCreateAutoScalingGroup = "CreateAutoScalingGroup" - -// CreateAutoScalingGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateAutoScalingGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAutoScalingGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAutoScalingGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAutoScalingGroupRequest method. -// req, resp := client.CreateAutoScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateAutoScalingGroup -func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGroupInput) (req *request.Request, output *CreateAutoScalingGroupOutput) { - op := &request.Operation{ - Name: opCreateAutoScalingGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAutoScalingGroupInput{} - } - - output = &CreateAutoScalingGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateAutoScalingGroup API operation for Auto Scaling. -// -// Creates an Auto Scaling group with the specified name and attributes. -// -// If you exceed your maximum limit of Auto Scaling groups, which by default -// is 20 per region, the call fails. For information about viewing and updating -// this limit, see DescribeAccountLimits. -// -// For more information, see Auto Scaling Groups (http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroup.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation CreateAutoScalingGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAlreadyExistsFault "AlreadyExists" -// You already have an Auto Scaling group or launch configuration with this -// name. -// -// * ErrCodeLimitExceededFault "LimitExceeded" -// You have already reached a limit for your Auto Scaling resources (for example, -// groups, launch configurations, or lifecycle hooks). For more information, -// see DescribeAccountLimits. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateAutoScalingGroup -func (c *AutoScaling) CreateAutoScalingGroup(input *CreateAutoScalingGroupInput) (*CreateAutoScalingGroupOutput, error) { - req, out := c.CreateAutoScalingGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateLaunchConfiguration = "CreateLaunchConfiguration" - -// CreateLaunchConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the CreateLaunchConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLaunchConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLaunchConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLaunchConfigurationRequest method. -// req, resp := client.CreateLaunchConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateLaunchConfiguration -func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfigurationInput) (req *request.Request, output *CreateLaunchConfigurationOutput) { - op := &request.Operation{ - Name: opCreateLaunchConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLaunchConfigurationInput{} - } - - output = &CreateLaunchConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateLaunchConfiguration API operation for Auto Scaling. -// -// Creates a launch configuration. -// -// If you exceed your maximum limit of launch configurations, which by default -// is 100 per region, the call fails. For information about viewing and updating -// this limit, see DescribeAccountLimits. -// -// For more information, see Launch Configurations (http://docs.aws.amazon.com/autoscaling/latest/userguide/LaunchConfiguration.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation CreateLaunchConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAlreadyExistsFault "AlreadyExists" -// You already have an Auto Scaling group or launch configuration with this -// name. -// -// * ErrCodeLimitExceededFault "LimitExceeded" -// You have already reached a limit for your Auto Scaling resources (for example, -// groups, launch configurations, or lifecycle hooks). For more information, -// see DescribeAccountLimits. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateLaunchConfiguration -func (c *AutoScaling) CreateLaunchConfiguration(input *CreateLaunchConfigurationInput) (*CreateLaunchConfigurationOutput, error) { - req, out := c.CreateLaunchConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opCreateOrUpdateTags = "CreateOrUpdateTags" - -// CreateOrUpdateTagsRequest generates a "aws/request.Request" representing the -// client's request for the CreateOrUpdateTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateOrUpdateTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateOrUpdateTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateOrUpdateTagsRequest method. -// req, resp := client.CreateOrUpdateTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags -func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) (req *request.Request, output *CreateOrUpdateTagsOutput) { - op := &request.Operation{ - Name: opCreateOrUpdateTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateOrUpdateTagsInput{} - } - - output = &CreateOrUpdateTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateOrUpdateTags API operation for Auto Scaling. -// -// Creates or updates tags for the specified Auto Scaling group. -// -// When you specify a tag with a key that already exists, the operation overwrites -// the previous tag definition, and you do not get an error message. -// -// For more information, see Tagging Auto Scaling Groups and Instances (http://docs.aws.amazon.com/autoscaling/latest/userguide/autoscaling-tagging.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation CreateOrUpdateTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededFault "LimitExceeded" -// You have already reached a limit for your Auto Scaling resources (for example, -// groups, launch configurations, or lifecycle hooks). For more information, -// see DescribeAccountLimits. -// -// * ErrCodeAlreadyExistsFault "AlreadyExists" -// You already have an Auto Scaling group or launch configuration with this -// name. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags -func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) { - req, out := c.CreateOrUpdateTagsRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAutoScalingGroup = "DeleteAutoScalingGroup" - -// DeleteAutoScalingGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAutoScalingGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAutoScalingGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAutoScalingGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAutoScalingGroupRequest method. -// req, resp := client.DeleteAutoScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteAutoScalingGroup -func (c *AutoScaling) DeleteAutoScalingGroupRequest(input *DeleteAutoScalingGroupInput) (req *request.Request, output *DeleteAutoScalingGroupOutput) { - op := &request.Operation{ - Name: opDeleteAutoScalingGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAutoScalingGroupInput{} - } - - output = &DeleteAutoScalingGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAutoScalingGroup API operation for Auto Scaling. -// -// Deletes the specified Auto Scaling group. -// -// If the group has instances or scaling activities in progress, you must specify -// the option to force the deletion in order for it to succeed. -// -// If the group has policies, deleting the group deletes the policies, the underlying -// alarm actions, and any alarm that no longer has an associated action. -// -// To remove instances from the Auto Scaling group before deleting it, call -// DetachInstances with the list of instances and the option to decrement the -// desired capacity so that Auto Scaling does not launch replacement instances. -// -// To terminate all instances before deleting the Auto Scaling group, call UpdateAutoScalingGroup -// and set the minimum size and desired capacity of the Auto Scaling group to -// zero. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DeleteAutoScalingGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" -// The operation can't be performed because there are scaling activities in -// progress. -// -// * ErrCodeResourceInUseFault "ResourceInUse" -// The operation can't be performed because the resource is in use. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteAutoScalingGroup -func (c *AutoScaling) DeleteAutoScalingGroup(input *DeleteAutoScalingGroupInput) (*DeleteAutoScalingGroupOutput, error) { - req, out := c.DeleteAutoScalingGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLaunchConfiguration = "DeleteLaunchConfiguration" - -// DeleteLaunchConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLaunchConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLaunchConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLaunchConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLaunchConfigurationRequest method. -// req, resp := client.DeleteLaunchConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLaunchConfiguration -func (c *AutoScaling) DeleteLaunchConfigurationRequest(input *DeleteLaunchConfigurationInput) (req *request.Request, output *DeleteLaunchConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteLaunchConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLaunchConfigurationInput{} - } - - output = &DeleteLaunchConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteLaunchConfiguration API operation for Auto Scaling. -// -// Deletes the specified launch configuration. -// -// The launch configuration must not be attached to an Auto Scaling group. When -// this call completes, the launch configuration is no longer available for -// use. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DeleteLaunchConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseFault "ResourceInUse" -// The operation can't be performed because the resource is in use. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLaunchConfiguration -func (c *AutoScaling) DeleteLaunchConfiguration(input *DeleteLaunchConfigurationInput) (*DeleteLaunchConfigurationOutput, error) { - req, out := c.DeleteLaunchConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLifecycleHook = "DeleteLifecycleHook" - -// DeleteLifecycleHookRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLifecycleHook operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLifecycleHook for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLifecycleHook method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLifecycleHookRequest method. -// req, resp := client.DeleteLifecycleHookRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLifecycleHook -func (c *AutoScaling) DeleteLifecycleHookRequest(input *DeleteLifecycleHookInput) (req *request.Request, output *DeleteLifecycleHookOutput) { - op := &request.Operation{ - Name: opDeleteLifecycleHook, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLifecycleHookInput{} - } - - output = &DeleteLifecycleHookOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteLifecycleHook API operation for Auto Scaling. -// -// Deletes the specified lifecycle hook. -// -// If there are any outstanding lifecycle actions, they are completed first -// (ABANDON for launching instances, CONTINUE for terminating 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 Auto Scaling's -// API operation DeleteLifecycleHook for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLifecycleHook -func (c *AutoScaling) DeleteLifecycleHook(input *DeleteLifecycleHookInput) (*DeleteLifecycleHookOutput, error) { - req, out := c.DeleteLifecycleHookRequest(input) - err := req.Send() - return out, err -} - -const opDeleteNotificationConfiguration = "DeleteNotificationConfiguration" - -// DeleteNotificationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNotificationConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteNotificationConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteNotificationConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteNotificationConfigurationRequest method. -// req, resp := client.DeleteNotificationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteNotificationConfiguration -func (c *AutoScaling) DeleteNotificationConfigurationRequest(input *DeleteNotificationConfigurationInput) (req *request.Request, output *DeleteNotificationConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteNotificationConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNotificationConfigurationInput{} - } - - output = &DeleteNotificationConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteNotificationConfiguration API operation for Auto Scaling. -// -// Deletes the specified notification. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DeleteNotificationConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteNotificationConfiguration -func (c *AutoScaling) DeleteNotificationConfiguration(input *DeleteNotificationConfigurationInput) (*DeleteNotificationConfigurationOutput, error) { - req, out := c.DeleteNotificationConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opDeletePolicy = "DeletePolicy" - -// DeletePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeletePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePolicyRequest method. -// req, resp := client.DeletePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeletePolicy -func (c *AutoScaling) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput) { - op := &request.Operation{ - Name: opDeletePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePolicyInput{} - } - - output = &DeletePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePolicy API operation for Auto Scaling. -// -// Deletes the specified Auto Scaling policy. -// -// Deleting a policy deletes the underlying alarm action, but does not delete -// the alarm, even if it no longer has an associated action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DeletePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeletePolicy -func (c *AutoScaling) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { - req, out := c.DeletePolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteScheduledAction = "DeleteScheduledAction" - -// DeleteScheduledActionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteScheduledAction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteScheduledAction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteScheduledAction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteScheduledActionRequest method. -// req, resp := client.DeleteScheduledActionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteScheduledAction -func (c *AutoScaling) DeleteScheduledActionRequest(input *DeleteScheduledActionInput) (req *request.Request, output *DeleteScheduledActionOutput) { - op := &request.Operation{ - Name: opDeleteScheduledAction, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteScheduledActionInput{} - } - - output = &DeleteScheduledActionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteScheduledAction API operation for Auto Scaling. -// -// Deletes the specified scheduled action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DeleteScheduledAction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteScheduledAction -func (c *AutoScaling) DeleteScheduledAction(input *DeleteScheduledActionInput) (*DeleteScheduledActionOutput, error) { - req, out := c.DeleteScheduledActionRequest(input) - err := req.Send() - return out, err -} - -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/autoscaling-2011-01-01/DeleteTags -func (c *AutoScaling) 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(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTags API operation for Auto Scaling. -// -// Deletes the specified 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 Auto Scaling's -// API operation DeleteTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteTags -func (c *AutoScaling) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAccountLimits = "DescribeAccountLimits" - -// DescribeAccountLimitsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAccountLimits operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAccountLimits for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAccountLimits method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAccountLimitsRequest method. -// req, resp := client.DescribeAccountLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAccountLimits -func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) (req *request.Request, output *DescribeAccountLimitsOutput) { - op := &request.Operation{ - Name: opDescribeAccountLimits, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAccountLimitsInput{} - } - - output = &DescribeAccountLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAccountLimits API operation for Auto Scaling. -// -// Describes the current Auto Scaling resource limits for your AWS account. -// -// For information about requesting an increase in these limits, see AWS Service -// Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) -// in the Amazon Web Services General Reference. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeAccountLimits for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAccountLimits -func (c *AutoScaling) DescribeAccountLimits(input *DescribeAccountLimitsInput) (*DescribeAccountLimitsOutput, error) { - req, out := c.DescribeAccountLimitsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAdjustmentTypes = "DescribeAdjustmentTypes" - -// DescribeAdjustmentTypesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAdjustmentTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAdjustmentTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAdjustmentTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAdjustmentTypesRequest method. -// req, resp := client.DescribeAdjustmentTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAdjustmentTypes -func (c *AutoScaling) DescribeAdjustmentTypesRequest(input *DescribeAdjustmentTypesInput) (req *request.Request, output *DescribeAdjustmentTypesOutput) { - op := &request.Operation{ - Name: opDescribeAdjustmentTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAdjustmentTypesInput{} - } - - output = &DescribeAdjustmentTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAdjustmentTypes API operation for Auto Scaling. -// -// Describes the policy adjustment types for use with PutScalingPolicy. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeAdjustmentTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAdjustmentTypes -func (c *AutoScaling) DescribeAdjustmentTypes(input *DescribeAdjustmentTypesInput) (*DescribeAdjustmentTypesOutput, error) { - req, out := c.DescribeAdjustmentTypesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAutoScalingGroups = "DescribeAutoScalingGroups" - -// DescribeAutoScalingGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAutoScalingGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAutoScalingGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAutoScalingGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAutoScalingGroupsRequest method. -// req, resp := client.DescribeAutoScalingGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingGroups -func (c *AutoScaling) DescribeAutoScalingGroupsRequest(input *DescribeAutoScalingGroupsInput) (req *request.Request, output *DescribeAutoScalingGroupsOutput) { - op := &request.Operation{ - Name: opDescribeAutoScalingGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeAutoScalingGroupsInput{} - } - - output = &DescribeAutoScalingGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAutoScalingGroups API operation for Auto Scaling. -// -// Describes one or more Auto Scaling groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeAutoScalingGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The NextToken value is not valid. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingGroups -func (c *AutoScaling) DescribeAutoScalingGroups(input *DescribeAutoScalingGroupsInput) (*DescribeAutoScalingGroupsOutput, error) { - req, out := c.DescribeAutoScalingGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeAutoScalingGroupsPages iterates over the pages of a DescribeAutoScalingGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAutoScalingGroups 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 DescribeAutoScalingGroups operation. -// pageNum := 0 -// err := client.DescribeAutoScalingGroupsPages(params, -// func(page *DescribeAutoScalingGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeAutoScalingGroupsPages(input *DescribeAutoScalingGroupsInput, fn func(p *DescribeAutoScalingGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeAutoScalingGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeAutoScalingGroupsOutput), lastPage) - }) -} - -const opDescribeAutoScalingInstances = "DescribeAutoScalingInstances" - -// DescribeAutoScalingInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAutoScalingInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAutoScalingInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAutoScalingInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAutoScalingInstancesRequest method. -// req, resp := client.DescribeAutoScalingInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingInstances -func (c *AutoScaling) DescribeAutoScalingInstancesRequest(input *DescribeAutoScalingInstancesInput) (req *request.Request, output *DescribeAutoScalingInstancesOutput) { - op := &request.Operation{ - Name: opDescribeAutoScalingInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeAutoScalingInstancesInput{} - } - - output = &DescribeAutoScalingInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAutoScalingInstances API operation for Auto Scaling. -// -// Describes one or more Auto Scaling 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 Auto Scaling's -// API operation DescribeAutoScalingInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The NextToken value is not valid. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingInstances -func (c *AutoScaling) DescribeAutoScalingInstances(input *DescribeAutoScalingInstancesInput) (*DescribeAutoScalingInstancesOutput, error) { - req, out := c.DescribeAutoScalingInstancesRequest(input) - err := req.Send() - return out, err -} - -// DescribeAutoScalingInstancesPages iterates over the pages of a DescribeAutoScalingInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAutoScalingInstances 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 DescribeAutoScalingInstances operation. -// pageNum := 0 -// err := client.DescribeAutoScalingInstancesPages(params, -// func(page *DescribeAutoScalingInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeAutoScalingInstancesPages(input *DescribeAutoScalingInstancesInput, fn func(p *DescribeAutoScalingInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeAutoScalingInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeAutoScalingInstancesOutput), lastPage) - }) -} - -const opDescribeAutoScalingNotificationTypes = "DescribeAutoScalingNotificationTypes" - -// DescribeAutoScalingNotificationTypesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAutoScalingNotificationTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAutoScalingNotificationTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAutoScalingNotificationTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAutoScalingNotificationTypesRequest method. -// req, resp := client.DescribeAutoScalingNotificationTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingNotificationTypes -func (c *AutoScaling) DescribeAutoScalingNotificationTypesRequest(input *DescribeAutoScalingNotificationTypesInput) (req *request.Request, output *DescribeAutoScalingNotificationTypesOutput) { - op := &request.Operation{ - Name: opDescribeAutoScalingNotificationTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAutoScalingNotificationTypesInput{} - } - - output = &DescribeAutoScalingNotificationTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAutoScalingNotificationTypes API operation for Auto Scaling. -// -// Describes the notification types that are supported by Auto Scaling. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeAutoScalingNotificationTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingNotificationTypes -func (c *AutoScaling) DescribeAutoScalingNotificationTypes(input *DescribeAutoScalingNotificationTypesInput) (*DescribeAutoScalingNotificationTypesOutput, error) { - req, out := c.DescribeAutoScalingNotificationTypesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLaunchConfigurations = "DescribeLaunchConfigurations" - -// DescribeLaunchConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLaunchConfigurations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLaunchConfigurations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLaunchConfigurations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLaunchConfigurationsRequest method. -// req, resp := client.DescribeLaunchConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLaunchConfigurations -func (c *AutoScaling) DescribeLaunchConfigurationsRequest(input *DescribeLaunchConfigurationsInput) (req *request.Request, output *DescribeLaunchConfigurationsOutput) { - op := &request.Operation{ - Name: opDescribeLaunchConfigurations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeLaunchConfigurationsInput{} - } - - output = &DescribeLaunchConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLaunchConfigurations API operation for Auto Scaling. -// -// Describes one or more launch configurations. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeLaunchConfigurations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The NextToken value is not valid. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLaunchConfigurations -func (c *AutoScaling) DescribeLaunchConfigurations(input *DescribeLaunchConfigurationsInput) (*DescribeLaunchConfigurationsOutput, error) { - req, out := c.DescribeLaunchConfigurationsRequest(input) - err := req.Send() - return out, err -} - -// DescribeLaunchConfigurationsPages iterates over the pages of a DescribeLaunchConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLaunchConfigurations 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 DescribeLaunchConfigurations operation. -// pageNum := 0 -// err := client.DescribeLaunchConfigurationsPages(params, -// func(page *DescribeLaunchConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeLaunchConfigurationsPages(input *DescribeLaunchConfigurationsInput, fn func(p *DescribeLaunchConfigurationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLaunchConfigurationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLaunchConfigurationsOutput), lastPage) - }) -} - -const opDescribeLifecycleHookTypes = "DescribeLifecycleHookTypes" - -// DescribeLifecycleHookTypesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLifecycleHookTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLifecycleHookTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLifecycleHookTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLifecycleHookTypesRequest method. -// req, resp := client.DescribeLifecycleHookTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHookTypes -func (c *AutoScaling) DescribeLifecycleHookTypesRequest(input *DescribeLifecycleHookTypesInput) (req *request.Request, output *DescribeLifecycleHookTypesOutput) { - op := &request.Operation{ - Name: opDescribeLifecycleHookTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLifecycleHookTypesInput{} - } - - output = &DescribeLifecycleHookTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLifecycleHookTypes API operation for Auto Scaling. -// -// Describes the available types of lifecycle hooks. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeLifecycleHookTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHookTypes -func (c *AutoScaling) DescribeLifecycleHookTypes(input *DescribeLifecycleHookTypesInput) (*DescribeLifecycleHookTypesOutput, error) { - req, out := c.DescribeLifecycleHookTypesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLifecycleHooks = "DescribeLifecycleHooks" - -// DescribeLifecycleHooksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLifecycleHooks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLifecycleHooks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLifecycleHooks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLifecycleHooksRequest method. -// req, resp := client.DescribeLifecycleHooksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHooks -func (c *AutoScaling) DescribeLifecycleHooksRequest(input *DescribeLifecycleHooksInput) (req *request.Request, output *DescribeLifecycleHooksOutput) { - op := &request.Operation{ - Name: opDescribeLifecycleHooks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLifecycleHooksInput{} - } - - output = &DescribeLifecycleHooksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLifecycleHooks API operation for Auto Scaling. -// -// Describes the lifecycle hooks for the specified Auto Scaling group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeLifecycleHooks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHooks -func (c *AutoScaling) DescribeLifecycleHooks(input *DescribeLifecycleHooksInput) (*DescribeLifecycleHooksOutput, error) { - req, out := c.DescribeLifecycleHooksRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLoadBalancerTargetGroups = "DescribeLoadBalancerTargetGroups" - -// DescribeLoadBalancerTargetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBalancerTargetGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBalancerTargetGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBalancerTargetGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBalancerTargetGroupsRequest method. -// req, resp := client.DescribeLoadBalancerTargetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancerTargetGroups -func (c *AutoScaling) DescribeLoadBalancerTargetGroupsRequest(input *DescribeLoadBalancerTargetGroupsInput) (req *request.Request, output *DescribeLoadBalancerTargetGroupsOutput) { - op := &request.Operation{ - Name: opDescribeLoadBalancerTargetGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLoadBalancerTargetGroupsInput{} - } - - output = &DescribeLoadBalancerTargetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBalancerTargetGroups API operation for Auto Scaling. -// -// Describes the target groups for the specified Auto Scaling group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeLoadBalancerTargetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancerTargetGroups -func (c *AutoScaling) DescribeLoadBalancerTargetGroups(input *DescribeLoadBalancerTargetGroupsInput) (*DescribeLoadBalancerTargetGroupsOutput, error) { - req, out := c.DescribeLoadBalancerTargetGroupsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLoadBalancers = "DescribeLoadBalancers" - -// DescribeLoadBalancersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBalancers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBalancers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBalancers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBalancersRequest method. -// req, resp := client.DescribeLoadBalancersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancers -func (c *AutoScaling) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *request.Request, output *DescribeLoadBalancersOutput) { - op := &request.Operation{ - Name: opDescribeLoadBalancers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLoadBalancersInput{} - } - - output = &DescribeLoadBalancersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBalancers API operation for Auto Scaling. -// -// Describes the load balancers for the specified Auto Scaling group. -// -// Note that this operation describes only Classic load balancers. If you have -// Application load balancers, use DescribeLoadBalancerTargetGroups instead. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeLoadBalancers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancers -func (c *AutoScaling) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { - req, out := c.DescribeLoadBalancersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMetricCollectionTypes = "DescribeMetricCollectionTypes" - -// DescribeMetricCollectionTypesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMetricCollectionTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMetricCollectionTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMetricCollectionTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMetricCollectionTypesRequest method. -// req, resp := client.DescribeMetricCollectionTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeMetricCollectionTypes -func (c *AutoScaling) DescribeMetricCollectionTypesRequest(input *DescribeMetricCollectionTypesInput) (req *request.Request, output *DescribeMetricCollectionTypesOutput) { - op := &request.Operation{ - Name: opDescribeMetricCollectionTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMetricCollectionTypesInput{} - } - - output = &DescribeMetricCollectionTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMetricCollectionTypes API operation for Auto Scaling. -// -// Describes the available CloudWatch metrics for Auto Scaling. -// -// Note that the GroupStandbyInstances metric is not returned by default. You -// must explicitly request this metric when calling EnableMetricsCollection. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeMetricCollectionTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeMetricCollectionTypes -func (c *AutoScaling) DescribeMetricCollectionTypes(input *DescribeMetricCollectionTypesInput) (*DescribeMetricCollectionTypesOutput, error) { - req, out := c.DescribeMetricCollectionTypesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeNotificationConfigurations = "DescribeNotificationConfigurations" - -// DescribeNotificationConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNotificationConfigurations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeNotificationConfigurations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeNotificationConfigurations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeNotificationConfigurationsRequest method. -// req, resp := client.DescribeNotificationConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeNotificationConfigurations -func (c *AutoScaling) DescribeNotificationConfigurationsRequest(input *DescribeNotificationConfigurationsInput) (req *request.Request, output *DescribeNotificationConfigurationsOutput) { - op := &request.Operation{ - Name: opDescribeNotificationConfigurations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeNotificationConfigurationsInput{} - } - - output = &DescribeNotificationConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNotificationConfigurations API operation for Auto Scaling. -// -// Describes the notification actions associated with the specified Auto Scaling -// group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeNotificationConfigurations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The NextToken value is not valid. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeNotificationConfigurations -func (c *AutoScaling) DescribeNotificationConfigurations(input *DescribeNotificationConfigurationsInput) (*DescribeNotificationConfigurationsOutput, error) { - req, out := c.DescribeNotificationConfigurationsRequest(input) - err := req.Send() - return out, err -} - -// DescribeNotificationConfigurationsPages iterates over the pages of a DescribeNotificationConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeNotificationConfigurations 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 DescribeNotificationConfigurations operation. -// pageNum := 0 -// err := client.DescribeNotificationConfigurationsPages(params, -// func(page *DescribeNotificationConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeNotificationConfigurationsPages(input *DescribeNotificationConfigurationsInput, fn func(p *DescribeNotificationConfigurationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeNotificationConfigurationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeNotificationConfigurationsOutput), lastPage) - }) -} - -const opDescribePolicies = "DescribePolicies" - -// DescribePoliciesRequest generates a "aws/request.Request" representing the -// client's request for the DescribePolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePoliciesRequest method. -// req, resp := client.DescribePoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribePolicies -func (c *AutoScaling) DescribePoliciesRequest(input *DescribePoliciesInput) (req *request.Request, output *DescribePoliciesOutput) { - op := &request.Operation{ - Name: opDescribePolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribePoliciesInput{} - } - - output = &DescribePoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePolicies API operation for Auto Scaling. -// -// Describes the policies for the specified Auto Scaling group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribePolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The NextToken value is not valid. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribePolicies -func (c *AutoScaling) DescribePolicies(input *DescribePoliciesInput) (*DescribePoliciesOutput, error) { - req, out := c.DescribePoliciesRequest(input) - err := req.Send() - return out, err -} - -// DescribePoliciesPages iterates over the pages of a DescribePolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribePolicies 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 DescribePolicies operation. -// pageNum := 0 -// err := client.DescribePoliciesPages(params, -// func(page *DescribePoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribePoliciesPages(input *DescribePoliciesInput, fn func(p *DescribePoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribePoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribePoliciesOutput), lastPage) - }) -} - -const opDescribeScalingActivities = "DescribeScalingActivities" - -// DescribeScalingActivitiesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScalingActivities operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeScalingActivities for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeScalingActivities method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeScalingActivitiesRequest method. -// req, resp := client.DescribeScalingActivitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingActivities -func (c *AutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingActivitiesInput) (req *request.Request, output *DescribeScalingActivitiesOutput) { - op := &request.Operation{ - Name: opDescribeScalingActivities, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeScalingActivitiesInput{} - } - - output = &DescribeScalingActivitiesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScalingActivities API operation for Auto Scaling. -// -// Describes one or more scaling activities for the specified Auto Scaling group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeScalingActivities for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The NextToken value is not valid. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingActivities -func (c *AutoScaling) DescribeScalingActivities(input *DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) { - req, out := c.DescribeScalingActivitiesRequest(input) - err := req.Send() - return out, err -} - -// DescribeScalingActivitiesPages iterates over the pages of a DescribeScalingActivities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScalingActivities 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 DescribeScalingActivities operation. -// pageNum := 0 -// err := client.DescribeScalingActivitiesPages(params, -// func(page *DescribeScalingActivitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(p *DescribeScalingActivitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScalingActivitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScalingActivitiesOutput), lastPage) - }) -} - -const opDescribeScalingProcessTypes = "DescribeScalingProcessTypes" - -// DescribeScalingProcessTypesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScalingProcessTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeScalingProcessTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeScalingProcessTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeScalingProcessTypesRequest method. -// req, resp := client.DescribeScalingProcessTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingProcessTypes -func (c *AutoScaling) DescribeScalingProcessTypesRequest(input *DescribeScalingProcessTypesInput) (req *request.Request, output *DescribeScalingProcessTypesOutput) { - op := &request.Operation{ - Name: opDescribeScalingProcessTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScalingProcessTypesInput{} - } - - output = &DescribeScalingProcessTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScalingProcessTypes API operation for Auto Scaling. -// -// Describes the scaling process types for use with ResumeProcesses and SuspendProcesses. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeScalingProcessTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingProcessTypes -func (c *AutoScaling) DescribeScalingProcessTypes(input *DescribeScalingProcessTypesInput) (*DescribeScalingProcessTypesOutput, error) { - req, out := c.DescribeScalingProcessTypesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeScheduledActions = "DescribeScheduledActions" - -// DescribeScheduledActionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScheduledActions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeScheduledActions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeScheduledActions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeScheduledActionsRequest method. -// req, resp := client.DescribeScheduledActionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScheduledActions -func (c *AutoScaling) DescribeScheduledActionsRequest(input *DescribeScheduledActionsInput) (req *request.Request, output *DescribeScheduledActionsOutput) { - op := &request.Operation{ - Name: opDescribeScheduledActions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeScheduledActionsInput{} - } - - output = &DescribeScheduledActionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScheduledActions API operation for Auto Scaling. -// -// Describes the actions scheduled for your Auto Scaling group that haven't -// run. To describe the actions that have already run, use DescribeScalingActivities. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeScheduledActions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The NextToken value is not valid. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScheduledActions -func (c *AutoScaling) DescribeScheduledActions(input *DescribeScheduledActionsInput) (*DescribeScheduledActionsOutput, error) { - req, out := c.DescribeScheduledActionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeScheduledActionsPages iterates over the pages of a DescribeScheduledActions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScheduledActions 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 DescribeScheduledActions operation. -// pageNum := 0 -// err := client.DescribeScheduledActionsPages(params, -// func(page *DescribeScheduledActionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *AutoScaling) DescribeScheduledActionsPages(input *DescribeScheduledActionsInput, fn func(p *DescribeScheduledActionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeScheduledActionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeScheduledActionsOutput), lastPage) - }) -} - -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/autoscaling-2011-01-01/DescribeTags -func (c *AutoScaling) 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: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeTagsInput{} - } - - output = &DescribeTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTags API operation for Auto Scaling. -// -// Describes the specified tags. -// -// You can use filters to limit the results. For example, you can query for -// the tags for a specific Auto Scaling group. You can specify multiple values -// for a filter. A tag must match at least one of the specified values for it -// to be included in the results. -// -// You can also specify multiple filters. The result includes information for -// a particular tag only if it matches all the filters. If there's no match, -// no special message is 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 Auto Scaling's -// API operation DescribeTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The NextToken value is not valid. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTags -func (c *AutoScaling) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err -} - -// 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 *AutoScaling) DescribeTagsPages(input *DescribeTagsInput, fn func(p *DescribeTagsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeTagsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeTagsOutput), lastPage) - }) -} - -const opDescribeTerminationPolicyTypes = "DescribeTerminationPolicyTypes" - -// DescribeTerminationPolicyTypesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTerminationPolicyTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTerminationPolicyTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTerminationPolicyTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTerminationPolicyTypesRequest method. -// req, resp := client.DescribeTerminationPolicyTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTerminationPolicyTypes -func (c *AutoScaling) DescribeTerminationPolicyTypesRequest(input *DescribeTerminationPolicyTypesInput) (req *request.Request, output *DescribeTerminationPolicyTypesOutput) { - op := &request.Operation{ - Name: opDescribeTerminationPolicyTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTerminationPolicyTypesInput{} - } - - output = &DescribeTerminationPolicyTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTerminationPolicyTypes API operation for Auto Scaling. -// -// Describes the termination policies supported by Auto Scaling. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DescribeTerminationPolicyTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTerminationPolicyTypes -func (c *AutoScaling) DescribeTerminationPolicyTypes(input *DescribeTerminationPolicyTypesInput) (*DescribeTerminationPolicyTypesOutput, error) { - req, out := c.DescribeTerminationPolicyTypesRequest(input) - err := req.Send() - return out, err -} - -const opDetachInstances = "DetachInstances" - -// DetachInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DetachInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachInstancesRequest method. -// req, resp := client.DetachInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachInstances -func (c *AutoScaling) DetachInstancesRequest(input *DetachInstancesInput) (req *request.Request, output *DetachInstancesOutput) { - op := &request.Operation{ - Name: opDetachInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachInstancesInput{} - } - - output = &DetachInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DetachInstances API operation for Auto Scaling. -// -// Removes one or more instances from the specified Auto Scaling group. -// -// After the instances are detached, you can manage them independently from -// the rest of the Auto Scaling group. -// -// If you do not specify the option to decrement the desired capacity, Auto -// Scaling launches instances to replace the ones that are detached. -// -// If there is a Classic load balancer attached to the Auto Scaling group, the -// instances are deregistered from the load balancer. If there are target groups -// attached to the Auto Scaling group, the instances are deregistered from the -// target groups. -// -// For more information, see Detach EC2 Instances from Your Auto Scaling Group -// (http://docs.aws.amazon.com/autoscaling/latest/userguide/detach-instance-asg.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation DetachInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachInstances -func (c *AutoScaling) DetachInstances(input *DetachInstancesInput) (*DetachInstancesOutput, error) { - req, out := c.DetachInstancesRequest(input) - err := req.Send() - return out, err -} - -const opDetachLoadBalancerTargetGroups = "DetachLoadBalancerTargetGroups" - -// DetachLoadBalancerTargetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DetachLoadBalancerTargetGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachLoadBalancerTargetGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachLoadBalancerTargetGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachLoadBalancerTargetGroupsRequest method. -// req, resp := client.DetachLoadBalancerTargetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancerTargetGroups -func (c *AutoScaling) DetachLoadBalancerTargetGroupsRequest(input *DetachLoadBalancerTargetGroupsInput) (req *request.Request, output *DetachLoadBalancerTargetGroupsOutput) { - op := &request.Operation{ - Name: opDetachLoadBalancerTargetGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachLoadBalancerTargetGroupsInput{} - } - - output = &DetachLoadBalancerTargetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DetachLoadBalancerTargetGroups API operation for Auto Scaling. -// -// Detaches one or more target groups from the specified Auto Scaling group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DetachLoadBalancerTargetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancerTargetGroups -func (c *AutoScaling) DetachLoadBalancerTargetGroups(input *DetachLoadBalancerTargetGroupsInput) (*DetachLoadBalancerTargetGroupsOutput, error) { - req, out := c.DetachLoadBalancerTargetGroupsRequest(input) - err := req.Send() - return out, err -} - -const opDetachLoadBalancers = "DetachLoadBalancers" - -// DetachLoadBalancersRequest generates a "aws/request.Request" representing the -// client's request for the DetachLoadBalancers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachLoadBalancers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachLoadBalancers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachLoadBalancersRequest method. -// req, resp := client.DetachLoadBalancersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancers -func (c *AutoScaling) DetachLoadBalancersRequest(input *DetachLoadBalancersInput) (req *request.Request, output *DetachLoadBalancersOutput) { - op := &request.Operation{ - Name: opDetachLoadBalancers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachLoadBalancersInput{} - } - - output = &DetachLoadBalancersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DetachLoadBalancers API operation for Auto Scaling. -// -// Detaches one or more Classic load balancers from the specified Auto Scaling -// group. -// -// Note that this operation detaches only Classic load balancers. If you have -// Application load balancers, use DetachLoadBalancerTargetGroups instead. -// -// When you detach a load balancer, it enters the Removing state while deregistering -// the instances in the group. When all instances are deregistered, then you -// can no longer describe the load balancer using DescribeLoadBalancers. Note -// that the instances remain running. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DetachLoadBalancers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancers -func (c *AutoScaling) DetachLoadBalancers(input *DetachLoadBalancersInput) (*DetachLoadBalancersOutput, error) { - req, out := c.DetachLoadBalancersRequest(input) - err := req.Send() - return out, err -} - -const opDisableMetricsCollection = "DisableMetricsCollection" - -// DisableMetricsCollectionRequest generates a "aws/request.Request" representing the -// client's request for the DisableMetricsCollection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableMetricsCollection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableMetricsCollection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableMetricsCollectionRequest method. -// req, resp := client.DisableMetricsCollectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DisableMetricsCollection -func (c *AutoScaling) DisableMetricsCollectionRequest(input *DisableMetricsCollectionInput) (req *request.Request, output *DisableMetricsCollectionOutput) { - op := &request.Operation{ - Name: opDisableMetricsCollection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableMetricsCollectionInput{} - } - - output = &DisableMetricsCollectionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableMetricsCollection API operation for Auto Scaling. -// -// Disables group metrics for the specified Auto Scaling group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation DisableMetricsCollection for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DisableMetricsCollection -func (c *AutoScaling) DisableMetricsCollection(input *DisableMetricsCollectionInput) (*DisableMetricsCollectionOutput, error) { - req, out := c.DisableMetricsCollectionRequest(input) - err := req.Send() - return out, err -} - -const opEnableMetricsCollection = "EnableMetricsCollection" - -// EnableMetricsCollectionRequest generates a "aws/request.Request" representing the -// client's request for the EnableMetricsCollection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableMetricsCollection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableMetricsCollection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableMetricsCollectionRequest method. -// req, resp := client.EnableMetricsCollectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnableMetricsCollection -func (c *AutoScaling) EnableMetricsCollectionRequest(input *EnableMetricsCollectionInput) (req *request.Request, output *EnableMetricsCollectionOutput) { - op := &request.Operation{ - Name: opEnableMetricsCollection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableMetricsCollectionInput{} - } - - output = &EnableMetricsCollectionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableMetricsCollection API operation for Auto Scaling. -// -// Enables group metrics for the specified Auto Scaling group. For more information, -// see Monitoring Your Auto Scaling Groups and Instances (http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-monitoring.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation EnableMetricsCollection for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnableMetricsCollection -func (c *AutoScaling) EnableMetricsCollection(input *EnableMetricsCollectionInput) (*EnableMetricsCollectionOutput, error) { - req, out := c.EnableMetricsCollectionRequest(input) - err := req.Send() - return out, err -} - -const opEnterStandby = "EnterStandby" - -// EnterStandbyRequest generates a "aws/request.Request" representing the -// client's request for the EnterStandby operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnterStandby for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnterStandby method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnterStandbyRequest method. -// req, resp := client.EnterStandbyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnterStandby -func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) (req *request.Request, output *EnterStandbyOutput) { - op := &request.Operation{ - Name: opEnterStandby, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnterStandbyInput{} - } - - output = &EnterStandbyOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnterStandby API operation for Auto Scaling. -// -// Moves the specified instances into Standby mode. -// -// For more information, see Auto Scaling Lifecycle (http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation EnterStandby for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnterStandby -func (c *AutoScaling) EnterStandby(input *EnterStandbyInput) (*EnterStandbyOutput, error) { - req, out := c.EnterStandbyRequest(input) - err := req.Send() - return out, err -} - -const opExecutePolicy = "ExecutePolicy" - -// ExecutePolicyRequest generates a "aws/request.Request" representing the -// client's request for the ExecutePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ExecutePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ExecutePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ExecutePolicyRequest method. -// req, resp := client.ExecutePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExecutePolicy -func (c *AutoScaling) ExecutePolicyRequest(input *ExecutePolicyInput) (req *request.Request, output *ExecutePolicyOutput) { - op := &request.Operation{ - Name: opExecutePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ExecutePolicyInput{} - } - - output = &ExecutePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ExecutePolicy API operation for Auto Scaling. -// -// Executes the specified 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 Auto Scaling's -// API operation ExecutePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" -// The operation can't be performed because there are scaling activities in -// progress. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExecutePolicy -func (c *AutoScaling) ExecutePolicy(input *ExecutePolicyInput) (*ExecutePolicyOutput, error) { - req, out := c.ExecutePolicyRequest(input) - err := req.Send() - return out, err -} - -const opExitStandby = "ExitStandby" - -// ExitStandbyRequest generates a "aws/request.Request" representing the -// client's request for the ExitStandby operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ExitStandby for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ExitStandby method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ExitStandbyRequest method. -// req, resp := client.ExitStandbyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExitStandby -func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) (req *request.Request, output *ExitStandbyOutput) { - op := &request.Operation{ - Name: opExitStandby, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ExitStandbyInput{} - } - - output = &ExitStandbyOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExitStandby API operation for Auto Scaling. -// -// Moves the specified instances out of Standby mode. -// -// For more information, see Auto Scaling Lifecycle (http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation ExitStandby for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExitStandby -func (c *AutoScaling) ExitStandby(input *ExitStandbyInput) (*ExitStandbyOutput, error) { - req, out := c.ExitStandbyRequest(input) - err := req.Send() - return out, err -} - -const opPutLifecycleHook = "PutLifecycleHook" - -// PutLifecycleHookRequest generates a "aws/request.Request" representing the -// client's request for the PutLifecycleHook operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutLifecycleHook for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutLifecycleHook method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutLifecycleHookRequest method. -// req, resp := client.PutLifecycleHookRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutLifecycleHook -func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) (req *request.Request, output *PutLifecycleHookOutput) { - op := &request.Operation{ - Name: opPutLifecycleHook, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutLifecycleHookInput{} - } - - output = &PutLifecycleHookOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutLifecycleHook API operation for Auto Scaling. -// -// Creates or updates a lifecycle hook for the specified Auto Scaling Group. -// -// A lifecycle hook tells Auto Scaling that you want to perform an action on -// an instance that is not actively in service; for example, either when the -// instance launches or before the instance terminates. -// -// This step is a part of the procedure for adding a lifecycle hook to an Auto -// Scaling group: -// -// (Optional) Create a Lambda function and a rule that allows CloudWatch Events -// to invoke your Lambda function when Auto Scaling launches or terminates instances. -// -// (Optional) Create a notification target and an IAM role. The target can be -// either an Amazon SQS queue or an Amazon SNS topic. The role allows Auto Scaling -// to publish lifecycle notifications to the target. -// -// Create the lifecycle hook. Specify whether the hook is used when the instances -// launch or terminate. -// -// If you need more time, record the lifecycle action heartbeat to keep the -// instance in a pending state. -// -// If you finish before the timeout period ends, complete the lifecycle action. -// -// For more information, see Auto Scaling Lifecycle Hooks (http://docs.aws.amazon.com/autoscaling/latest/userguide/lifecycle-hooks.html) -// in the Auto Scaling User Guide. -// -// If you exceed your maximum limit of lifecycle hooks, which by default is -// 50 per Auto Scaling group, the call fails. For information about updating -// this limit, see AWS Service Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) -// in the Amazon Web Services General Reference. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation PutLifecycleHook for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededFault "LimitExceeded" -// You have already reached a limit for your Auto Scaling resources (for example, -// groups, launch configurations, or lifecycle hooks). For more information, -// see DescribeAccountLimits. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutLifecycleHook -func (c *AutoScaling) PutLifecycleHook(input *PutLifecycleHookInput) (*PutLifecycleHookOutput, error) { - req, out := c.PutLifecycleHookRequest(input) - err := req.Send() - return out, err -} - -const opPutNotificationConfiguration = "PutNotificationConfiguration" - -// PutNotificationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutNotificationConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutNotificationConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutNotificationConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutNotificationConfigurationRequest method. -// req, resp := client.PutNotificationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutNotificationConfiguration -func (c *AutoScaling) PutNotificationConfigurationRequest(input *PutNotificationConfigurationInput) (req *request.Request, output *PutNotificationConfigurationOutput) { - op := &request.Operation{ - Name: opPutNotificationConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutNotificationConfigurationInput{} - } - - output = &PutNotificationConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutNotificationConfiguration API operation for Auto Scaling. -// -// Configures an Auto Scaling group to send notifications when specified events -// take place. Subscribers to the specified topic can have messages delivered -// to an endpoint such as a web server or an email address. -// -// This configuration overwrites any existing configuration. -// -// For more information see Getting SNS Notifications When Your Auto Scaling -// Group Scales (http://docs.aws.amazon.com/autoscaling/latest/userguide/ASGettingNotifications.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation PutNotificationConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededFault "LimitExceeded" -// You have already reached a limit for your Auto Scaling resources (for example, -// groups, launch configurations, or lifecycle hooks). For more information, -// see DescribeAccountLimits. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutNotificationConfiguration -func (c *AutoScaling) PutNotificationConfiguration(input *PutNotificationConfigurationInput) (*PutNotificationConfigurationOutput, error) { - req, out := c.PutNotificationConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opPutScalingPolicy = "PutScalingPolicy" - -// PutScalingPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutScalingPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutScalingPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutScalingPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutScalingPolicyRequest method. -// req, resp := client.PutScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScalingPolicy -func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req *request.Request, output *PutScalingPolicyOutput) { - op := &request.Operation{ - Name: opPutScalingPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutScalingPolicyInput{} - } - - output = &PutScalingPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutScalingPolicy API operation for Auto Scaling. -// -// Creates or updates a policy for an Auto Scaling group. To update an existing -// policy, use the existing policy name and set the parameters you want to change. -// Any existing parameter not changed in an update to an existing policy is -// not changed in this update request. -// -// If you exceed your maximum limit of step adjustments, which by default is -// 20 per region, the call fails. For information about updating this limit, -// see AWS Service Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) -// in the Amazon Web Services General Reference. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation PutScalingPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededFault "LimitExceeded" -// You have already reached a limit for your Auto Scaling resources (for example, -// groups, launch configurations, or lifecycle hooks). For more information, -// see DescribeAccountLimits. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScalingPolicy -func (c *AutoScaling) PutScalingPolicy(input *PutScalingPolicyInput) (*PutScalingPolicyOutput, error) { - req, out := c.PutScalingPolicyRequest(input) - err := req.Send() - return out, err -} - -const opPutScheduledUpdateGroupAction = "PutScheduledUpdateGroupAction" - -// PutScheduledUpdateGroupActionRequest generates a "aws/request.Request" representing the -// client's request for the PutScheduledUpdateGroupAction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutScheduledUpdateGroupAction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutScheduledUpdateGroupAction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutScheduledUpdateGroupActionRequest method. -// req, resp := client.PutScheduledUpdateGroupActionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScheduledUpdateGroupAction -func (c *AutoScaling) PutScheduledUpdateGroupActionRequest(input *PutScheduledUpdateGroupActionInput) (req *request.Request, output *PutScheduledUpdateGroupActionOutput) { - op := &request.Operation{ - Name: opPutScheduledUpdateGroupAction, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutScheduledUpdateGroupActionInput{} - } - - output = &PutScheduledUpdateGroupActionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutScheduledUpdateGroupAction API operation for Auto Scaling. -// -// Creates or updates a scheduled scaling action for an Auto Scaling group. -// When updating a scheduled scaling action, if you leave a parameter unspecified, -// the corresponding value remains unchanged. -// -// For more information, see Scheduled Scaling (http://docs.aws.amazon.com/autoscaling/latest/userguide/schedule_time.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation PutScheduledUpdateGroupAction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAlreadyExistsFault "AlreadyExists" -// You already have an Auto Scaling group or launch configuration with this -// name. -// -// * ErrCodeLimitExceededFault "LimitExceeded" -// You have already reached a limit for your Auto Scaling resources (for example, -// groups, launch configurations, or lifecycle hooks). For more information, -// see DescribeAccountLimits. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScheduledUpdateGroupAction -func (c *AutoScaling) PutScheduledUpdateGroupAction(input *PutScheduledUpdateGroupActionInput) (*PutScheduledUpdateGroupActionOutput, error) { - req, out := c.PutScheduledUpdateGroupActionRequest(input) - err := req.Send() - return out, err -} - -const opRecordLifecycleActionHeartbeat = "RecordLifecycleActionHeartbeat" - -// RecordLifecycleActionHeartbeatRequest generates a "aws/request.Request" representing the -// client's request for the RecordLifecycleActionHeartbeat operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RecordLifecycleActionHeartbeat for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RecordLifecycleActionHeartbeat method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RecordLifecycleActionHeartbeatRequest method. -// req, resp := client.RecordLifecycleActionHeartbeatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeat -func (c *AutoScaling) RecordLifecycleActionHeartbeatRequest(input *RecordLifecycleActionHeartbeatInput) (req *request.Request, output *RecordLifecycleActionHeartbeatOutput) { - op := &request.Operation{ - Name: opRecordLifecycleActionHeartbeat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RecordLifecycleActionHeartbeatInput{} - } - - output = &RecordLifecycleActionHeartbeatOutput{} - req = c.newRequest(op, input, output) - return -} - -// RecordLifecycleActionHeartbeat API operation for Auto Scaling. -// -// Records a heartbeat for the lifecycle action associated with the specified -// token or instance. This extends the timeout by the length of time defined -// using PutLifecycleHook. -// -// This step is a part of the procedure for adding a lifecycle hook to an Auto -// Scaling group: -// -// (Optional) Create a Lambda function and a rule that allows CloudWatch Events -// to invoke your Lambda function when Auto Scaling launches or terminates instances. -// -// (Optional) Create a notification target and an IAM role. The target can be -// either an Amazon SQS queue or an Amazon SNS topic. The role allows Auto Scaling -// to publish lifecycle notifications to the target. -// -// Create the lifecycle hook. Specify whether the hook is used when the instances -// launch or terminate. -// -// If you need more time, record the lifecycle action heartbeat to keep the -// instance in a pending state. -// -// If you finish before the timeout period ends, complete the lifecycle action. -// -// For more information, see Auto Scaling Lifecycle (http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation RecordLifecycleActionHeartbeat for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeat -func (c *AutoScaling) RecordLifecycleActionHeartbeat(input *RecordLifecycleActionHeartbeatInput) (*RecordLifecycleActionHeartbeatOutput, error) { - req, out := c.RecordLifecycleActionHeartbeatRequest(input) - err := req.Send() - return out, err -} - -const opResumeProcesses = "ResumeProcesses" - -// ResumeProcessesRequest generates a "aws/request.Request" representing the -// client's request for the ResumeProcesses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResumeProcesses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResumeProcesses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResumeProcessesRequest method. -// req, resp := client.ResumeProcessesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ResumeProcesses -func (c *AutoScaling) ResumeProcessesRequest(input *ScalingProcessQuery) (req *request.Request, output *ResumeProcessesOutput) { - op := &request.Operation{ - Name: opResumeProcesses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ScalingProcessQuery{} - } - - output = &ResumeProcessesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResumeProcesses API operation for Auto Scaling. -// -// Resumes the specified suspended Auto Scaling processes, or all suspended -// process, for the specified Auto Scaling group. -// -// For more information, see Suspending and Resuming Auto Scaling Processes -// (http://docs.aws.amazon.com/autoscaling/latest/userguide/as-suspend-resume-processes.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation ResumeProcesses for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseFault "ResourceInUse" -// The operation can't be performed because the resource is in use. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ResumeProcesses -func (c *AutoScaling) ResumeProcesses(input *ScalingProcessQuery) (*ResumeProcessesOutput, error) { - req, out := c.ResumeProcessesRequest(input) - err := req.Send() - return out, err -} - -const opSetDesiredCapacity = "SetDesiredCapacity" - -// SetDesiredCapacityRequest generates a "aws/request.Request" representing the -// client's request for the SetDesiredCapacity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetDesiredCapacity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetDesiredCapacity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetDesiredCapacityRequest method. -// req, resp := client.SetDesiredCapacityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetDesiredCapacity -func (c *AutoScaling) SetDesiredCapacityRequest(input *SetDesiredCapacityInput) (req *request.Request, output *SetDesiredCapacityOutput) { - op := &request.Operation{ - Name: opSetDesiredCapacity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetDesiredCapacityInput{} - } - - output = &SetDesiredCapacityOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetDesiredCapacity API operation for Auto Scaling. -// -// Sets the size of the specified Auto Scaling group. -// -// For more information about desired capacity, see What Is Auto Scaling? (http://docs.aws.amazon.com/autoscaling/latest/userguide/WhatIsAutoScaling.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation SetDesiredCapacity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" -// The operation can't be performed because there are scaling activities in -// progress. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetDesiredCapacity -func (c *AutoScaling) SetDesiredCapacity(input *SetDesiredCapacityInput) (*SetDesiredCapacityOutput, error) { - req, out := c.SetDesiredCapacityRequest(input) - err := req.Send() - return out, err -} - -const opSetInstanceHealth = "SetInstanceHealth" - -// SetInstanceHealthRequest generates a "aws/request.Request" representing the -// client's request for the SetInstanceHealth operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetInstanceHealth for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetInstanceHealth method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetInstanceHealthRequest method. -// req, resp := client.SetInstanceHealthRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceHealth -func (c *AutoScaling) SetInstanceHealthRequest(input *SetInstanceHealthInput) (req *request.Request, output *SetInstanceHealthOutput) { - op := &request.Operation{ - Name: opSetInstanceHealth, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetInstanceHealthInput{} - } - - output = &SetInstanceHealthOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetInstanceHealth API operation for Auto Scaling. -// -// Sets the health status of the specified instance. -// -// For more information, see Health Checks (http://docs.aws.amazon.com/autoscaling/latest/userguide/healthcheck.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation SetInstanceHealth for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceHealth -func (c *AutoScaling) SetInstanceHealth(input *SetInstanceHealthInput) (*SetInstanceHealthOutput, error) { - req, out := c.SetInstanceHealthRequest(input) - err := req.Send() - return out, err -} - -const opSetInstanceProtection = "SetInstanceProtection" - -// SetInstanceProtectionRequest generates a "aws/request.Request" representing the -// client's request for the SetInstanceProtection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetInstanceProtection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetInstanceProtection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetInstanceProtectionRequest method. -// req, resp := client.SetInstanceProtectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceProtection -func (c *AutoScaling) SetInstanceProtectionRequest(input *SetInstanceProtectionInput) (req *request.Request, output *SetInstanceProtectionOutput) { - op := &request.Operation{ - Name: opSetInstanceProtection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetInstanceProtectionInput{} - } - - output = &SetInstanceProtectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetInstanceProtection API operation for Auto Scaling. -// -// Updates the instance protection settings of the specified instances. -// -// For more information, see Instance Protection (http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html#instance-protection) -// in the Auto Scaling 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 Auto Scaling's -// API operation SetInstanceProtection for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededFault "LimitExceeded" -// You have already reached a limit for your Auto Scaling resources (for example, -// groups, launch configurations, or lifecycle hooks). For more information, -// see DescribeAccountLimits. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceProtection -func (c *AutoScaling) SetInstanceProtection(input *SetInstanceProtectionInput) (*SetInstanceProtectionOutput, error) { - req, out := c.SetInstanceProtectionRequest(input) - err := req.Send() - return out, err -} - -const opSuspendProcesses = "SuspendProcesses" - -// SuspendProcessesRequest generates a "aws/request.Request" representing the -// client's request for the SuspendProcesses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SuspendProcesses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SuspendProcesses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SuspendProcessesRequest method. -// req, resp := client.SuspendProcessesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SuspendProcesses -func (c *AutoScaling) SuspendProcessesRequest(input *ScalingProcessQuery) (req *request.Request, output *SuspendProcessesOutput) { - op := &request.Operation{ - Name: opSuspendProcesses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ScalingProcessQuery{} - } - - output = &SuspendProcessesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SuspendProcesses API operation for Auto Scaling. -// -// Suspends the specified Auto Scaling processes, or all processes, for the -// specified Auto Scaling group. -// -// Note that if you suspend either the Launch or Terminate process types, it -// can prevent other process types from functioning properly. -// -// To resume processes that have been suspended, use ResumeProcesses. -// -// For more information, see Suspending and Resuming Auto Scaling Processes -// (http://docs.aws.amazon.com/autoscaling/latest/userguide/as-suspend-resume-processes.html) -// in the Auto Scaling 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 Auto Scaling's -// API operation SuspendProcesses for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseFault "ResourceInUse" -// The operation can't be performed because the resource is in use. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SuspendProcesses -func (c *AutoScaling) SuspendProcesses(input *ScalingProcessQuery) (*SuspendProcessesOutput, error) { - req, out := c.SuspendProcessesRequest(input) - err := req.Send() - return out, err -} - -const opTerminateInstanceInAutoScalingGroup = "TerminateInstanceInAutoScalingGroup" - -// TerminateInstanceInAutoScalingGroupRequest generates a "aws/request.Request" representing the -// client's request for the TerminateInstanceInAutoScalingGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TerminateInstanceInAutoScalingGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TerminateInstanceInAutoScalingGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TerminateInstanceInAutoScalingGroupRequest method. -// req, resp := client.TerminateInstanceInAutoScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/TerminateInstanceInAutoScalingGroup -func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *TerminateInstanceInAutoScalingGroupInput) (req *request.Request, output *TerminateInstanceInAutoScalingGroupOutput) { - op := &request.Operation{ - Name: opTerminateInstanceInAutoScalingGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TerminateInstanceInAutoScalingGroupInput{} - } - - output = &TerminateInstanceInAutoScalingGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// TerminateInstanceInAutoScalingGroup API operation for Auto Scaling. -// -// Terminates the specified instance and optionally adjusts the desired group -// size. -// -// This call simply makes a termination request. The instance is not terminated -// immediately. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Auto Scaling's -// API operation TerminateInstanceInAutoScalingGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" -// The operation can't be performed because there are scaling activities in -// progress. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/TerminateInstanceInAutoScalingGroup -func (c *AutoScaling) TerminateInstanceInAutoScalingGroup(input *TerminateInstanceInAutoScalingGroupInput) (*TerminateInstanceInAutoScalingGroupOutput, error) { - req, out := c.TerminateInstanceInAutoScalingGroupRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAutoScalingGroup = "UpdateAutoScalingGroup" - -// UpdateAutoScalingGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAutoScalingGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAutoScalingGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAutoScalingGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAutoScalingGroupRequest method. -// req, resp := client.UpdateAutoScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/UpdateAutoScalingGroup -func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGroupInput) (req *request.Request, output *UpdateAutoScalingGroupOutput) { - op := &request.Operation{ - Name: opUpdateAutoScalingGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAutoScalingGroupInput{} - } - - output = &UpdateAutoScalingGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateAutoScalingGroup API operation for Auto Scaling. -// -// Updates the configuration for the specified Auto Scaling group. -// -// To update an Auto Scaling group with a launch configuration with InstanceMonitoring -// set to False, you must first disable the collection of group metrics. Otherwise, -// you will get an error. If you have previously enabled the collection of group -// metrics, you can disable it using DisableMetricsCollection. -// -// The new settings are registered upon the completion of this call. Any launch -// configuration settings take effect on any triggers after this call returns. -// Scaling activities that are currently in progress aren't affected. -// -// Note the following: -// -// * If you specify a new value for MinSize without specifying a value for -// DesiredCapacity, and the new MinSize is larger than the current size of -// the group, we implicitly call SetDesiredCapacity to set the size of the -// group to the new value of MinSize. -// -// * If you specify a new value for MaxSize without specifying a value for -// DesiredCapacity, and the new MaxSize is smaller than the current size -// of the group, we implicitly call SetDesiredCapacity to set the size of -// the group to the new value of MaxSize. -// -// * All other optional parameters are left unchanged if not 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 Auto Scaling's -// API operation UpdateAutoScalingGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" -// The operation can't be performed because there are scaling activities in -// progress. -// -// * ErrCodeResourceContentionFault "ResourceContention" -// You already have a pending update to an Auto Scaling resource (for example, -// a group, instance, or load balancer). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/UpdateAutoScalingGroup -func (c *AutoScaling) UpdateAutoScalingGroup(input *UpdateAutoScalingGroupInput) (*UpdateAutoScalingGroupOutput, error) { - req, out := c.UpdateAutoScalingGroupRequest(input) - err := req.Send() - return out, err -} - -// Describes scaling activity, which is a long-running process that represents -// a change to your Auto Scaling group, such as changing its size or replacing -// an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/Activity -type Activity struct { - _ struct{} `type:"structure"` - - // The ID of the activity. - // - // ActivityId is a required field - ActivityId *string `type:"string" required:"true"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The reason the activity began. - // - // Cause is a required field - Cause *string `min:"1" type:"string" required:"true"` - - // A friendly, more verbose description of the activity. - Description *string `type:"string"` - - // The details about the activity. - Details *string `type:"string"` - - // The end time of the activity. - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A value between 0 and 100 that indicates the progress of the activity. - Progress *int64 `type:"integer"` - - // The start time of the activity. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The current status of the activity. - // - // StatusCode is a required field - StatusCode *string `type:"string" required:"true" enum:"ScalingActivityStatusCode"` - - // A friendly, more verbose description of the activity status. - StatusMessage *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s Activity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Activity) GoString() string { - return s.String() -} - -// SetActivityId sets the ActivityId field's value. -func (s *Activity) SetActivityId(v string) *Activity { - s.ActivityId = &v - return s -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *Activity) SetAutoScalingGroupName(v string) *Activity { - s.AutoScalingGroupName = &v - return s -} - -// SetCause sets the Cause field's value. -func (s *Activity) SetCause(v string) *Activity { - s.Cause = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Activity) SetDescription(v string) *Activity { - s.Description = &v - return s -} - -// SetDetails sets the Details field's value. -func (s *Activity) SetDetails(v string) *Activity { - s.Details = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *Activity) SetEndTime(v time.Time) *Activity { - s.EndTime = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *Activity) SetProgress(v int64) *Activity { - s.Progress = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Activity) SetStartTime(v time.Time) *Activity { - s.StartTime = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *Activity) SetStatusCode(v string) *Activity { - s.StatusCode = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *Activity) SetStatusMessage(v string) *Activity { - s.StatusMessage = &v - return s -} - -// Describes a policy adjustment type. -// -// For more information, see Dynamic Scaling (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html) -// in the Auto Scaling User Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AdjustmentType -type AdjustmentType struct { - _ struct{} `type:"structure"` - - // The policy adjustment type. The valid values are ChangeInCapacity, ExactCapacity, - // and PercentChangeInCapacity. - AdjustmentType *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s AdjustmentType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AdjustmentType) GoString() string { - return s.String() -} - -// SetAdjustmentType sets the AdjustmentType field's value. -func (s *AdjustmentType) SetAdjustmentType(v string) *AdjustmentType { - s.AdjustmentType = &v - return s -} - -// Describes an alarm. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/Alarm -type Alarm struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the alarm. - AlarmARN *string `min:"1" type:"string"` - - // The name of the alarm. - AlarmName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s Alarm) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Alarm) GoString() string { - return s.String() -} - -// SetAlarmARN sets the AlarmARN field's value. -func (s *Alarm) SetAlarmARN(v string) *Alarm { - s.AlarmARN = &v - return s -} - -// SetAlarmName sets the AlarmName field's value. -func (s *Alarm) SetAlarmName(v string) *Alarm { - s.AlarmName = &v - return s -} - -// Contains the parameters for AttachInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachInstancesQuery -type AttachInstancesInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more instance IDs. - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s AttachInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachInstancesInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *AttachInstancesInput) SetAutoScalingGroupName(v string) *AttachInstancesInput { - s.AutoScalingGroupName = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *AttachInstancesInput) SetInstanceIds(v []*string) *AttachInstancesInput { - s.InstanceIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachInstancesOutput -type AttachInstancesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachInstancesOutput) GoString() string { - return s.String() -} - -// Contains the parameters for AttachLoadBalancerTargetGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancerTargetGroupsType -type AttachLoadBalancerTargetGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Names (ARN) of the target groups. - // - // TargetGroupARNs is a required field - TargetGroupARNs []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s AttachLoadBalancerTargetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachLoadBalancerTargetGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachLoadBalancerTargetGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachLoadBalancerTargetGroupsInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.TargetGroupARNs == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupARNs")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *AttachLoadBalancerTargetGroupsInput) SetAutoScalingGroupName(v string) *AttachLoadBalancerTargetGroupsInput { - s.AutoScalingGroupName = &v - return s -} - -// SetTargetGroupARNs sets the TargetGroupARNs field's value. -func (s *AttachLoadBalancerTargetGroupsInput) SetTargetGroupARNs(v []*string) *AttachLoadBalancerTargetGroupsInput { - s.TargetGroupARNs = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancerTargetGroupsResultType -type AttachLoadBalancerTargetGroupsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachLoadBalancerTargetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachLoadBalancerTargetGroupsOutput) GoString() string { - return s.String() -} - -// Contains the parameters for AttachLoadBalancers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancersType -type AttachLoadBalancersInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more load balancer names. - // - // LoadBalancerNames is a required field - LoadBalancerNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s AttachLoadBalancersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachLoadBalancersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachLoadBalancersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachLoadBalancersInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.LoadBalancerNames == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *AttachLoadBalancersInput) SetAutoScalingGroupName(v string) *AttachLoadBalancersInput { - s.AutoScalingGroupName = &v - return s -} - -// SetLoadBalancerNames sets the LoadBalancerNames field's value. -func (s *AttachLoadBalancersInput) SetLoadBalancerNames(v []*string) *AttachLoadBalancersInput { - s.LoadBalancerNames = v - return s -} - -// Contains the output of AttachLoadBalancers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancersResultType -type AttachLoadBalancersOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachLoadBalancersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachLoadBalancersOutput) GoString() string { - return s.String() -} - -// Describes a block device mapping. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/BlockDeviceMapping -type BlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh). - // - // DeviceName is a required field - DeviceName *string `min:"1" type:"string" required:"true"` - - // The information about the Amazon EBS volume. - Ebs *Ebs `type:"structure"` - - // Suppresses a device mapping. - // - // If this parameter is true for the root device, the instance might fail the - // EC2 health check. Auto Scaling launches a replacement instance if the instance - // fails the health check. - NoDevice *bool `type:"boolean"` - - // The name of the virtual device (for example, ephemeral0). - VirtualName *string `min:"1" 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BlockDeviceMapping) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BlockDeviceMapping"} - if s.DeviceName == nil { - invalidParams.Add(request.NewErrParamRequired("DeviceName")) - } - if s.DeviceName != nil && len(*s.DeviceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeviceName", 1)) - } - if s.VirtualName != nil && len(*s.VirtualName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VirtualName", 1)) - } - if s.Ebs != nil { - if err := s.Ebs.Validate(); err != nil { - invalidParams.AddNested("Ebs", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// 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 *Ebs) *BlockDeviceMapping { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *BlockDeviceMapping) SetNoDevice(v bool) *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 CompleteLifecycleAction. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CompleteLifecycleActionType -type CompleteLifecycleActionInput struct { - _ struct{} `type:"structure"` - - // The name of the group for the lifecycle hook. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The ID of the instance. - InstanceId *string `min:"1" type:"string"` - - // The action for the group to take. This parameter can be either CONTINUE or - // ABANDON. - // - // LifecycleActionResult is a required field - LifecycleActionResult *string `type:"string" required:"true"` - - // A universally unique identifier (UUID) that identifies a specific lifecycle - // action associated with an instance. Auto Scaling sends this token to the - // notification target you specified when you created the lifecycle hook. - LifecycleActionToken *string `min:"36" type:"string"` - - // The name of the lifecycle hook. - // - // LifecycleHookName is a required field - LifecycleHookName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CompleteLifecycleActionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteLifecycleActionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CompleteLifecycleActionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CompleteLifecycleActionInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.InstanceId != nil && len(*s.InstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) - } - if s.LifecycleActionResult == nil { - invalidParams.Add(request.NewErrParamRequired("LifecycleActionResult")) - } - if s.LifecycleActionToken != nil && len(*s.LifecycleActionToken) < 36 { - invalidParams.Add(request.NewErrParamMinLen("LifecycleActionToken", 36)) - } - if s.LifecycleHookName == nil { - invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) - } - if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *CompleteLifecycleActionInput) SetAutoScalingGroupName(v string) *CompleteLifecycleActionInput { - s.AutoScalingGroupName = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CompleteLifecycleActionInput) SetInstanceId(v string) *CompleteLifecycleActionInput { - s.InstanceId = &v - return s -} - -// SetLifecycleActionResult sets the LifecycleActionResult field's value. -func (s *CompleteLifecycleActionInput) SetLifecycleActionResult(v string) *CompleteLifecycleActionInput { - s.LifecycleActionResult = &v - return s -} - -// SetLifecycleActionToken sets the LifecycleActionToken field's value. -func (s *CompleteLifecycleActionInput) SetLifecycleActionToken(v string) *CompleteLifecycleActionInput { - s.LifecycleActionToken = &v - return s -} - -// SetLifecycleHookName sets the LifecycleHookName field's value. -func (s *CompleteLifecycleActionInput) SetLifecycleHookName(v string) *CompleteLifecycleActionInput { - s.LifecycleHookName = &v - return s -} - -// Contains the output of CompleteLifecycleAction. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CompleteLifecycleActionAnswer -type CompleteLifecycleActionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CompleteLifecycleActionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteLifecycleActionOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateAutoScalingGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateAutoScalingGroupType -type CreateAutoScalingGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the group. This name must be unique within the scope of your - // AWS account. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more Availability Zones for the group. This parameter is optional - // if you specify one or more subnets. - AvailabilityZones []*string `min:"1" type:"list"` - - // The amount of time, in seconds, after a scaling activity completes before - // another scaling activity can start. The default is 300. - // - // For more information, see Auto Scaling Cooldowns (http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html) - // in the Auto Scaling User Guide. - DefaultCooldown *int64 `type:"integer"` - - // The number of EC2 instances that should be running in the group. This number - // must be greater than or equal to the minimum size of the group and less than - // or equal to the maximum size of the group. - DesiredCapacity *int64 `type:"integer"` - - // The amount of time, in seconds, that Auto Scaling waits before checking the - // health status of an EC2 instance that has come into service. During this - // time, any health check failures for the instance are ignored. The default - // is 0. - // - // This parameter is required if you are adding an ELB health check. - // - // For more information, see Health Checks (http://docs.aws.amazon.com/autoscaling/latest/userguide/healthcheck.html) - // in the Auto Scaling User Guide. - HealthCheckGracePeriod *int64 `type:"integer"` - - // The service to use for the health checks. The valid values are EC2 and ELB. - // - // By default, health checks use Amazon EC2 instance status checks to determine - // the health of an instance. For more information, see Health Checks (http://docs.aws.amazon.com/autoscaling/latest/userguide/healthcheck.html) - // in the Auto Scaling User Guide. - HealthCheckType *string `min:"1" type:"string"` - - // The ID of the instance used to create a launch configuration for the group. - // Alternatively, specify a launch configuration instead of an EC2 instance. - // - // When you specify an ID of an instance, Auto Scaling creates a new launch - // configuration and associates it with the group. This launch configuration - // derives its attributes from the specified instance, with the exception of - // the block device mapping. - // - // For more information, see Create an Auto Scaling Group Using an EC2 Instance - // (http://docs.aws.amazon.com/autoscaling/latest/userguide/create-asg-from-instance.html) - // in the Auto Scaling User Guide. - InstanceId *string `min:"1" type:"string"` - - // The name of the launch configuration. Alternatively, specify an EC2 instance - // instead of a launch configuration. - LaunchConfigurationName *string `min:"1" type:"string"` - - // One or more Classic load balancers. To specify an Application load balancer, - // use TargetGroupARNs instead. - // - // For more information, see Using a Load Balancer With an Auto Scaling Group - // (http://docs.aws.amazon.com/autoscaling/latest/userguide/create-asg-from-instance.html) - // in the Auto Scaling User Guide. - LoadBalancerNames []*string `type:"list"` - - // The maximum size of the group. - // - // MaxSize is a required field - MaxSize *int64 `type:"integer" required:"true"` - - // The minimum size of the group. - // - // MinSize is a required field - MinSize *int64 `type:"integer" required:"true"` - - // Indicates whether newly launched instances are protected from termination - // by Auto Scaling when scaling in. - NewInstancesProtectedFromScaleIn *bool `type:"boolean"` - - // The name of the placement group into which you'll launch your instances, - // if any. For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) - // in the Amazon Elastic Compute Cloud User Guide. - PlacementGroup *string `min:"1" type:"string"` - - // One or more tags. - // - // For more information, see Tagging Auto Scaling Groups and Instances (http://docs.aws.amazon.com/autoscaling/latest/userguide/autoscaling-tagging.html) - // in the Auto Scaling User Guide. - Tags []*Tag `type:"list"` - - // The Amazon Resource Names (ARN) of the target groups. - TargetGroupARNs []*string `type:"list"` - - // One or more termination policies used to select the instance to terminate. - // These policies are executed in the order that they are listed. - // - // For more information, see Controlling Which Instances Auto Scaling Terminates - // During Scale In (http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html) - // in the Auto Scaling User Guide. - TerminationPolicies []*string `type:"list"` - - // A comma-separated list of subnet identifiers for your virtual private cloud - // (VPC). - // - // If you specify subnets and Availability Zones with this call, ensure that - // the subnets' Availability Zones match the Availability Zones specified. - // - // For more information, see Launching Auto Scaling Instances in a VPC (http://docs.aws.amazon.com/autoscaling/latest/userguide/asg-in-vpc.html) - // in the Auto Scaling User Guide. - VPCZoneIdentifier *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateAutoScalingGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAutoScalingGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAutoScalingGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAutoScalingGroupInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.AvailabilityZones != nil && len(s.AvailabilityZones) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AvailabilityZones", 1)) - } - if s.HealthCheckType != nil && len(*s.HealthCheckType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HealthCheckType", 1)) - } - if s.InstanceId != nil && len(*s.InstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) - } - if s.LaunchConfigurationName != nil && len(*s.LaunchConfigurationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LaunchConfigurationName", 1)) - } - if s.MaxSize == nil { - invalidParams.Add(request.NewErrParamRequired("MaxSize")) - } - if s.MinSize == nil { - invalidParams.Add(request.NewErrParamRequired("MinSize")) - } - if s.PlacementGroup != nil && len(*s.PlacementGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PlacementGroup", 1)) - } - if s.VPCZoneIdentifier != nil && len(*s.VPCZoneIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VPCZoneIdentifier", 1)) - } - 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 -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *CreateAutoScalingGroupInput) SetAutoScalingGroupName(v string) *CreateAutoScalingGroupInput { - s.AutoScalingGroupName = &v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *CreateAutoScalingGroupInput) SetAvailabilityZones(v []*string) *CreateAutoScalingGroupInput { - s.AvailabilityZones = v - return s -} - -// SetDefaultCooldown sets the DefaultCooldown field's value. -func (s *CreateAutoScalingGroupInput) SetDefaultCooldown(v int64) *CreateAutoScalingGroupInput { - s.DefaultCooldown = &v - return s -} - -// SetDesiredCapacity sets the DesiredCapacity field's value. -func (s *CreateAutoScalingGroupInput) SetDesiredCapacity(v int64) *CreateAutoScalingGroupInput { - s.DesiredCapacity = &v - return s -} - -// SetHealthCheckGracePeriod sets the HealthCheckGracePeriod field's value. -func (s *CreateAutoScalingGroupInput) SetHealthCheckGracePeriod(v int64) *CreateAutoScalingGroupInput { - s.HealthCheckGracePeriod = &v - return s -} - -// SetHealthCheckType sets the HealthCheckType field's value. -func (s *CreateAutoScalingGroupInput) SetHealthCheckType(v string) *CreateAutoScalingGroupInput { - s.HealthCheckType = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateAutoScalingGroupInput) SetInstanceId(v string) *CreateAutoScalingGroupInput { - s.InstanceId = &v - return s -} - -// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. -func (s *CreateAutoScalingGroupInput) SetLaunchConfigurationName(v string) *CreateAutoScalingGroupInput { - s.LaunchConfigurationName = &v - return s -} - -// SetLoadBalancerNames sets the LoadBalancerNames field's value. -func (s *CreateAutoScalingGroupInput) SetLoadBalancerNames(v []*string) *CreateAutoScalingGroupInput { - s.LoadBalancerNames = v - return s -} - -// SetMaxSize sets the MaxSize field's value. -func (s *CreateAutoScalingGroupInput) SetMaxSize(v int64) *CreateAutoScalingGroupInput { - s.MaxSize = &v - return s -} - -// SetMinSize sets the MinSize field's value. -func (s *CreateAutoScalingGroupInput) SetMinSize(v int64) *CreateAutoScalingGroupInput { - s.MinSize = &v - return s -} - -// SetNewInstancesProtectedFromScaleIn sets the NewInstancesProtectedFromScaleIn field's value. -func (s *CreateAutoScalingGroupInput) SetNewInstancesProtectedFromScaleIn(v bool) *CreateAutoScalingGroupInput { - s.NewInstancesProtectedFromScaleIn = &v - return s -} - -// SetPlacementGroup sets the PlacementGroup field's value. -func (s *CreateAutoScalingGroupInput) SetPlacementGroup(v string) *CreateAutoScalingGroupInput { - s.PlacementGroup = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAutoScalingGroupInput) SetTags(v []*Tag) *CreateAutoScalingGroupInput { - s.Tags = v - return s -} - -// SetTargetGroupARNs sets the TargetGroupARNs field's value. -func (s *CreateAutoScalingGroupInput) SetTargetGroupARNs(v []*string) *CreateAutoScalingGroupInput { - s.TargetGroupARNs = v - return s -} - -// SetTerminationPolicies sets the TerminationPolicies field's value. -func (s *CreateAutoScalingGroupInput) SetTerminationPolicies(v []*string) *CreateAutoScalingGroupInput { - s.TerminationPolicies = v - return s -} - -// SetVPCZoneIdentifier sets the VPCZoneIdentifier field's value. -func (s *CreateAutoScalingGroupInput) SetVPCZoneIdentifier(v string) *CreateAutoScalingGroupInput { - s.VPCZoneIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateAutoScalingGroupOutput -type CreateAutoScalingGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateAutoScalingGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAutoScalingGroupOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateLaunchConfiguration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateLaunchConfigurationType -type CreateLaunchConfigurationInput struct { - _ struct{} `type:"structure"` - - // Used for groups that launch instances into a virtual private cloud (VPC). - // Specifies whether to assign a public IP address to each instance. For more - // information, see Launching Auto Scaling Instances in a VPC (http://docs.aws.amazon.com/autoscaling/latest/userguide/asg-in-vpc.html) - // in the Auto Scaling User Guide. - // - // If you specify this parameter, be sure to specify at least one subnet when - // you create your group. - // - // Default: If the instance is launched into a default subnet, the default is - // true. If the instance is launched into a nondefault subnet, the default is - // false. For more information, see Supported Platforms (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html) - // in the Amazon Elastic Compute Cloud User Guide. - AssociatePublicIpAddress *bool `type:"boolean"` - - // One or more mappings that specify how block devices are exposed to the instance. - // For more information, see Block Device Mapping (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) - // in the Amazon Elastic Compute Cloud User Guide. - BlockDeviceMappings []*BlockDeviceMapping `type:"list"` - - // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. - // This parameter is supported only if you are launching EC2-Classic instances. - // For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClassicLinkVPCId *string `min:"1" type:"string"` - - // The IDs of one or more security groups for the specified ClassicLink-enabled - // VPC. This parameter is required if you specify a ClassicLink-enabled VPC, - // and is not supported otherwise. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClassicLinkVPCSecurityGroups []*string `type:"list"` - - // Indicates whether the instance is optimized for Amazon EBS I/O. By default, - // the instance is not optimized for EBS I/O. The optimization provides dedicated - // throughput to Amazon EBS and an optimized configuration stack to provide - // optimal I/O performance. This optimization is not available with all instance - // types. Additional usage charges apply. For more information, see Amazon EBS-Optimized - // Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) - // in the Amazon Elastic Compute Cloud User Guide. - EbsOptimized *bool `type:"boolean"` - - // The name or the Amazon Resource Name (ARN) of the instance profile associated - // with the IAM role for the instance. - // - // EC2 instances launched with an IAM role will automatically have AWS security - // credentials available. You can use IAM roles with Auto Scaling to automatically - // enable applications running on your EC2 instances to securely access other - // AWS resources. For more information, see Launch Auto Scaling Instances with - // an IAM Role (http://docs.aws.amazon.com/autoscaling/latest/userguide/us-iam-role.html) - // in the Auto Scaling User Guide. - IamInstanceProfile *string `min:"1" type:"string"` - - // The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. - // For more information, see Finding an AMI (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html) - // in the Amazon Elastic Compute Cloud User Guide. - ImageId *string `min:"1" type:"string"` - - // The ID of the instance to use to create the launch configuration. - // - // The new launch configuration derives attributes from the instance, with the - // exception of the block device mapping. - // - // To create a launch configuration with a block device mapping or override - // any other instance attributes, specify them as part of the same request. - // - // For more information, see Create a Launch Configuration Using an EC2 Instance - // (http://docs.aws.amazon.com/autoscaling/latest/userguide/create-lc-with-instanceID.html) - // in the Auto Scaling User Guide. - InstanceId *string `min:"1" type:"string"` - - // Enables detailed monitoring (true) or basic monitoring (false) for the Auto - // Scaling instances. - InstanceMonitoring *InstanceMonitoring `type:"structure"` - - // The instance type of the EC2 instance. For information about available instance - // types, see Available Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) - // in the Amazon Elastic Compute Cloud User Guide. - InstanceType *string `min:"1" type:"string"` - - // The ID of the kernel associated with the AMI. - KernelId *string `min:"1" type:"string"` - - // The name of the key pair. For more information, see Amazon EC2 Key Pairs - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) in - // the Amazon Elastic Compute Cloud User Guide. - KeyName *string `min:"1" type:"string"` - - // The name of the launch configuration. This name must be unique within the - // scope of your AWS account. - // - // LaunchConfigurationName is a required field - LaunchConfigurationName *string `min:"1" type:"string" required:"true"` - - // The tenancy of the instance. An instance with a tenancy of dedicated runs - // on single-tenant hardware and can only be launched into a VPC. - // - // You must set the value of this parameter to dedicated if want to launch Dedicated - // Instances into a shared tenancy VPC (VPC with instance placement tenancy - // attribute set to default). - // - // If you specify this parameter, be sure to specify at least one subnet when - // you create your group. - // - // For more information, see Launching Auto Scaling Instances in a VPC (http://docs.aws.amazon.com/autoscaling/latest/userguide/asg-in-vpc.html) - // in the Auto Scaling User Guide. - // - // Valid values: default | dedicated - PlacementTenancy *string `min:"1" type:"string"` - - // The ID of the RAM disk associated with the AMI. - RamdiskId *string `min:"1" type:"string"` - - // One or more security groups with which to associate the instances. - // - // If your instances are launched in EC2-Classic, you can either specify security - // group names or the security group IDs. For more information about security - // groups for EC2-Classic, 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. - // - // If your instances are launched into a VPC, specify security group IDs. 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. - SecurityGroups []*string `type:"list"` - - // The maximum hourly price to be paid for any Spot Instance launched to fulfill - // the request. Spot Instances are launched when the price you specify exceeds - // the current Spot market price. For more information, see Launching Spot Instances - // in Your Auto Scaling Group (http://docs.aws.amazon.com/autoscaling/latest/userguide/US-SpotInstances.html) - // in the Auto Scaling User Guide. - SpotPrice *string `min:"1" type:"string"` - - // The user data to make available to the launched EC2 instances. For more information, - // see Instance Metadata and User Data (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) - // in the Amazon Elastic Compute Cloud User Guide. - UserData *string `type:"string"` -} - -// String returns the string representation -func (s CreateLaunchConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLaunchConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLaunchConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLaunchConfigurationInput"} - if s.ClassicLinkVPCId != nil && len(*s.ClassicLinkVPCId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClassicLinkVPCId", 1)) - } - if s.IamInstanceProfile != nil && len(*s.IamInstanceProfile) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IamInstanceProfile", 1)) - } - if s.ImageId != nil && len(*s.ImageId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageId", 1)) - } - if s.InstanceId != nil && len(*s.InstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) - } - if s.InstanceType != nil && len(*s.InstanceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceType", 1)) - } - if s.KernelId != nil && len(*s.KernelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KernelId", 1)) - } - if s.KeyName != nil && len(*s.KeyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyName", 1)) - } - if s.LaunchConfigurationName == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchConfigurationName")) - } - if s.LaunchConfigurationName != nil && len(*s.LaunchConfigurationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LaunchConfigurationName", 1)) - } - if s.PlacementTenancy != nil && len(*s.PlacementTenancy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PlacementTenancy", 1)) - } - if s.RamdiskId != nil && len(*s.RamdiskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RamdiskId", 1)) - } - if s.SpotPrice != nil && len(*s.SpotPrice) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpotPrice", 1)) - } - if s.BlockDeviceMappings != nil { - for i, v := range s.BlockDeviceMappings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "BlockDeviceMappings", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. -func (s *CreateLaunchConfigurationInput) SetAssociatePublicIpAddress(v bool) *CreateLaunchConfigurationInput { - s.AssociatePublicIpAddress = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *CreateLaunchConfigurationInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *CreateLaunchConfigurationInput { - s.BlockDeviceMappings = v - return s -} - -// SetClassicLinkVPCId sets the ClassicLinkVPCId field's value. -func (s *CreateLaunchConfigurationInput) SetClassicLinkVPCId(v string) *CreateLaunchConfigurationInput { - s.ClassicLinkVPCId = &v - return s -} - -// SetClassicLinkVPCSecurityGroups sets the ClassicLinkVPCSecurityGroups field's value. -func (s *CreateLaunchConfigurationInput) SetClassicLinkVPCSecurityGroups(v []*string) *CreateLaunchConfigurationInput { - s.ClassicLinkVPCSecurityGroups = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *CreateLaunchConfigurationInput) SetEbsOptimized(v bool) *CreateLaunchConfigurationInput { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *CreateLaunchConfigurationInput) SetIamInstanceProfile(v string) *CreateLaunchConfigurationInput { - s.IamInstanceProfile = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *CreateLaunchConfigurationInput) SetImageId(v string) *CreateLaunchConfigurationInput { - s.ImageId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateLaunchConfigurationInput) SetInstanceId(v string) *CreateLaunchConfigurationInput { - s.InstanceId = &v - return s -} - -// SetInstanceMonitoring sets the InstanceMonitoring field's value. -func (s *CreateLaunchConfigurationInput) SetInstanceMonitoring(v *InstanceMonitoring) *CreateLaunchConfigurationInput { - s.InstanceMonitoring = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *CreateLaunchConfigurationInput) SetInstanceType(v string) *CreateLaunchConfigurationInput { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *CreateLaunchConfigurationInput) SetKernelId(v string) *CreateLaunchConfigurationInput { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *CreateLaunchConfigurationInput) SetKeyName(v string) *CreateLaunchConfigurationInput { - s.KeyName = &v - return s -} - -// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. -func (s *CreateLaunchConfigurationInput) SetLaunchConfigurationName(v string) *CreateLaunchConfigurationInput { - s.LaunchConfigurationName = &v - return s -} - -// SetPlacementTenancy sets the PlacementTenancy field's value. -func (s *CreateLaunchConfigurationInput) SetPlacementTenancy(v string) *CreateLaunchConfigurationInput { - s.PlacementTenancy = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *CreateLaunchConfigurationInput) SetRamdiskId(v string) *CreateLaunchConfigurationInput { - s.RamdiskId = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *CreateLaunchConfigurationInput) SetSecurityGroups(v []*string) *CreateLaunchConfigurationInput { - s.SecurityGroups = v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *CreateLaunchConfigurationInput) SetSpotPrice(v string) *CreateLaunchConfigurationInput { - s.SpotPrice = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *CreateLaunchConfigurationInput) SetUserData(v string) *CreateLaunchConfigurationInput { - s.UserData = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateLaunchConfigurationOutput -type CreateLaunchConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateLaunchConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLaunchConfigurationOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateOrUpdateTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTagsType -type CreateOrUpdateTagsInput struct { - _ struct{} `type:"structure"` - - // One or more tags. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// String returns the string representation -func (s CreateOrUpdateTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateOrUpdateTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateOrUpdateTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateOrUpdateTagsInput"} - 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 -} - -// SetTags sets the Tags field's value. -func (s *CreateOrUpdateTagsInput) SetTags(v []*Tag) *CreateOrUpdateTagsInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTagsOutput -type CreateOrUpdateTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateOrUpdateTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateOrUpdateTagsOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteAutoScalingGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteAutoScalingGroupType -type DeleteAutoScalingGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the group to delete. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // Specifies that the group will be deleted along with all instances associated - // with the group, without waiting for all instances to be terminated. This - // parameter also deletes any lifecycle actions associated with the group. - ForceDelete *bool `type:"boolean"` -} - -// String returns the string representation -func (s DeleteAutoScalingGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAutoScalingGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAutoScalingGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAutoScalingGroupInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DeleteAutoScalingGroupInput) SetAutoScalingGroupName(v string) *DeleteAutoScalingGroupInput { - s.AutoScalingGroupName = &v - return s -} - -// SetForceDelete sets the ForceDelete field's value. -func (s *DeleteAutoScalingGroupInput) SetForceDelete(v bool) *DeleteAutoScalingGroupInput { - s.ForceDelete = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteAutoScalingGroupOutput -type DeleteAutoScalingGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAutoScalingGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAutoScalingGroupOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteLaunchConfiguration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/LaunchConfigurationNameType -type DeleteLaunchConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the launch configuration. - // - // LaunchConfigurationName is a required field - LaunchConfigurationName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLaunchConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLaunchConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLaunchConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLaunchConfigurationInput"} - if s.LaunchConfigurationName == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchConfigurationName")) - } - if s.LaunchConfigurationName != nil && len(*s.LaunchConfigurationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LaunchConfigurationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. -func (s *DeleteLaunchConfigurationInput) SetLaunchConfigurationName(v string) *DeleteLaunchConfigurationInput { - s.LaunchConfigurationName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLaunchConfigurationOutput -type DeleteLaunchConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLaunchConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLaunchConfigurationOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteLifecycleHook. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLifecycleHookType -type DeleteLifecycleHookInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group for the lifecycle hook. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The name of the lifecycle hook. - // - // LifecycleHookName is a required field - LifecycleHookName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLifecycleHookInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLifecycleHookInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLifecycleHookInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLifecycleHookInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.LifecycleHookName == nil { - invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) - } - if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DeleteLifecycleHookInput) SetAutoScalingGroupName(v string) *DeleteLifecycleHookInput { - s.AutoScalingGroupName = &v - return s -} - -// SetLifecycleHookName sets the LifecycleHookName field's value. -func (s *DeleteLifecycleHookInput) SetLifecycleHookName(v string) *DeleteLifecycleHookInput { - s.LifecycleHookName = &v - return s -} - -// Contains the output of DeleteLifecycleHook. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLifecycleHookAnswer -type DeleteLifecycleHookOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLifecycleHookOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLifecycleHookOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteNotificationConfiguration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteNotificationConfigurationType -type DeleteNotificationConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service - // (SNS) topic. - // - // TopicARN is a required field - TopicARN *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteNotificationConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNotificationConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNotificationConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNotificationConfigurationInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.TopicARN == nil { - invalidParams.Add(request.NewErrParamRequired("TopicARN")) - } - if s.TopicARN != nil && len(*s.TopicARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DeleteNotificationConfigurationInput) SetAutoScalingGroupName(v string) *DeleteNotificationConfigurationInput { - s.AutoScalingGroupName = &v - return s -} - -// SetTopicARN sets the TopicARN field's value. -func (s *DeleteNotificationConfigurationInput) SetTopicARN(v string) *DeleteNotificationConfigurationInput { - s.TopicARN = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteNotificationConfigurationOutput -type DeleteNotificationConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteNotificationConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNotificationConfigurationOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeletePolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeletePolicyType -type DeletePolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - AutoScalingGroupName *string `min:"1" type:"string"` - - // The name or Amazon Resource Name (ARN) of the policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePolicyInput"} - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DeletePolicyInput) SetAutoScalingGroupName(v string) *DeletePolicyInput { - s.AutoScalingGroupName = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *DeletePolicyInput) SetPolicyName(v string) *DeletePolicyInput { - s.PolicyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeletePolicyOutput -type DeletePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeletePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePolicyOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteScheduledAction. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteScheduledActionType -type DeleteScheduledActionInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The name of the action to delete. - // - // ScheduledActionName is a required field - ScheduledActionName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteScheduledActionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScheduledActionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteScheduledActionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteScheduledActionInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.ScheduledActionName == nil { - invalidParams.Add(request.NewErrParamRequired("ScheduledActionName")) - } - if s.ScheduledActionName != nil && len(*s.ScheduledActionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduledActionName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DeleteScheduledActionInput) SetAutoScalingGroupName(v string) *DeleteScheduledActionInput { - s.AutoScalingGroupName = &v - return s -} - -// SetScheduledActionName sets the ScheduledActionName field's value. -func (s *DeleteScheduledActionInput) SetScheduledActionName(v string) *DeleteScheduledActionInput { - s.ScheduledActionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteScheduledActionOutput -type DeleteScheduledActionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteScheduledActionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScheduledActionOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteTagsType -type DeleteTagsInput struct { - _ struct{} `type:"structure"` - - // One or more tags. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// 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.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 -} - -// 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/autoscaling-2011-01-01/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() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAccountLimitsInput -type DescribeAccountLimitsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeAccountLimitsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAccountLimitsInput) GoString() string { - return s.String() -} - -// Contains the parameters for DescribeAccountLimits. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAccountLimitsAnswer -type DescribeAccountLimitsOutput struct { - _ struct{} `type:"structure"` - - // The maximum number of groups allowed for your AWS account. The default limit - // is 20 per region. - MaxNumberOfAutoScalingGroups *int64 `type:"integer"` - - // The maximum number of launch configurations allowed for your AWS account. - // The default limit is 100 per region. - MaxNumberOfLaunchConfigurations *int64 `type:"integer"` - - // The current number of groups for your AWS account. - NumberOfAutoScalingGroups *int64 `type:"integer"` - - // The current number of launch configurations for your AWS account. - NumberOfLaunchConfigurations *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeAccountLimitsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAccountLimitsOutput) GoString() string { - return s.String() -} - -// SetMaxNumberOfAutoScalingGroups sets the MaxNumberOfAutoScalingGroups field's value. -func (s *DescribeAccountLimitsOutput) SetMaxNumberOfAutoScalingGroups(v int64) *DescribeAccountLimitsOutput { - s.MaxNumberOfAutoScalingGroups = &v - return s -} - -// SetMaxNumberOfLaunchConfigurations sets the MaxNumberOfLaunchConfigurations field's value. -func (s *DescribeAccountLimitsOutput) SetMaxNumberOfLaunchConfigurations(v int64) *DescribeAccountLimitsOutput { - s.MaxNumberOfLaunchConfigurations = &v - return s -} - -// SetNumberOfAutoScalingGroups sets the NumberOfAutoScalingGroups field's value. -func (s *DescribeAccountLimitsOutput) SetNumberOfAutoScalingGroups(v int64) *DescribeAccountLimitsOutput { - s.NumberOfAutoScalingGroups = &v - return s -} - -// SetNumberOfLaunchConfigurations sets the NumberOfLaunchConfigurations field's value. -func (s *DescribeAccountLimitsOutput) SetNumberOfLaunchConfigurations(v int64) *DescribeAccountLimitsOutput { - s.NumberOfLaunchConfigurations = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAdjustmentTypesInput -type DescribeAdjustmentTypesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeAdjustmentTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAdjustmentTypesInput) GoString() string { - return s.String() -} - -// Contains the parameters for DescribeAdjustmentTypes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAdjustmentTypesAnswer -type DescribeAdjustmentTypesOutput struct { - _ struct{} `type:"structure"` - - // The policy adjustment types. - AdjustmentTypes []*AdjustmentType `type:"list"` -} - -// String returns the string representation -func (s DescribeAdjustmentTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAdjustmentTypesOutput) GoString() string { - return s.String() -} - -// SetAdjustmentTypes sets the AdjustmentTypes field's value. -func (s *DescribeAdjustmentTypesOutput) SetAdjustmentTypes(v []*AdjustmentType) *DescribeAdjustmentTypesOutput { - s.AdjustmentTypes = v - return s -} - -// Contains the parameters for DescribeAutoScalingGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/GroupNamesType -type DescribeAutoScalingGroupsInput struct { - _ struct{} `type:"structure"` - - // The group names. If you omit this parameter, all Auto Scaling groups are - // described. - AutoScalingGroupNames []*string `type:"list"` - - // The maximum number of items to return with this call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAutoScalingGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAutoScalingGroupsInput) GoString() string { - return s.String() -} - -// SetAutoScalingGroupNames sets the AutoScalingGroupNames field's value. -func (s *DescribeAutoScalingGroupsInput) SetAutoScalingGroupNames(v []*string) *DescribeAutoScalingGroupsInput { - s.AutoScalingGroupNames = v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeAutoScalingGroupsInput) SetMaxRecords(v int64) *DescribeAutoScalingGroupsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAutoScalingGroupsInput) SetNextToken(v string) *DescribeAutoScalingGroupsInput { - s.NextToken = &v - return s -} - -// Contains the output for DescribeAutoScalingGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/GroupsType -type DescribeAutoScalingGroupsOutput struct { - _ struct{} `type:"structure"` - - // The groups. - // - // AutoScalingGroups is a required field - AutoScalingGroups []*Group `type:"list" required:"true"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeAutoScalingGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAutoScalingGroupsOutput) GoString() string { - return s.String() -} - -// SetAutoScalingGroups sets the AutoScalingGroups field's value. -func (s *DescribeAutoScalingGroupsOutput) SetAutoScalingGroups(v []*Group) *DescribeAutoScalingGroupsOutput { - s.AutoScalingGroups = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAutoScalingGroupsOutput) SetNextToken(v string) *DescribeAutoScalingGroupsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeAutoScalingInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingInstancesType -type DescribeAutoScalingInstancesInput struct { - _ struct{} `type:"structure"` - - // The instances to describe; up to 50 instance IDs. If you omit this parameter, - // all Auto Scaling instances are described. If you specify an ID that does - // not exist, it is ignored with no error. - InstanceIds []*string `type:"list"` - - // The maximum number of items to return with this call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAutoScalingInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAutoScalingInstancesInput) GoString() string { - return s.String() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeAutoScalingInstancesInput) SetInstanceIds(v []*string) *DescribeAutoScalingInstancesInput { - s.InstanceIds = v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeAutoScalingInstancesInput) SetMaxRecords(v int64) *DescribeAutoScalingInstancesInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAutoScalingInstancesInput) SetNextToken(v string) *DescribeAutoScalingInstancesInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeAutoScalingInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/InstancesType -type DescribeAutoScalingInstancesOutput struct { - _ struct{} `type:"structure"` - - // The instances. - AutoScalingInstances []*InstanceDetails `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeAutoScalingInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAutoScalingInstancesOutput) GoString() string { - return s.String() -} - -// SetAutoScalingInstances sets the AutoScalingInstances field's value. -func (s *DescribeAutoScalingInstancesOutput) SetAutoScalingInstances(v []*InstanceDetails) *DescribeAutoScalingInstancesOutput { - s.AutoScalingInstances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAutoScalingInstancesOutput) SetNextToken(v string) *DescribeAutoScalingInstancesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingNotificationTypesInput -type DescribeAutoScalingNotificationTypesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeAutoScalingNotificationTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAutoScalingNotificationTypesInput) GoString() string { - return s.String() -} - -// Contains the output of DescribeAutoScalingNotificationTypes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingNotificationTypesAnswer -type DescribeAutoScalingNotificationTypesOutput struct { - _ struct{} `type:"structure"` - - // The notification types. - AutoScalingNotificationTypes []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeAutoScalingNotificationTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAutoScalingNotificationTypesOutput) GoString() string { - return s.String() -} - -// SetAutoScalingNotificationTypes sets the AutoScalingNotificationTypes field's value. -func (s *DescribeAutoScalingNotificationTypesOutput) SetAutoScalingNotificationTypes(v []*string) *DescribeAutoScalingNotificationTypesOutput { - s.AutoScalingNotificationTypes = v - return s -} - -// Contains the parameters for DescribeLaunchConfigurations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/LaunchConfigurationNamesType -type DescribeLaunchConfigurationsInput struct { - _ struct{} `type:"structure"` - - // The launch configuration names. If you omit this parameter, all launch configurations - // are described. - LaunchConfigurationNames []*string `type:"list"` - - // The maximum number of items to return with this call. The default is 100. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLaunchConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLaunchConfigurationsInput) GoString() string { - return s.String() -} - -// SetLaunchConfigurationNames sets the LaunchConfigurationNames field's value. -func (s *DescribeLaunchConfigurationsInput) SetLaunchConfigurationNames(v []*string) *DescribeLaunchConfigurationsInput { - s.LaunchConfigurationNames = v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeLaunchConfigurationsInput) SetMaxRecords(v int64) *DescribeLaunchConfigurationsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchConfigurationsInput) SetNextToken(v string) *DescribeLaunchConfigurationsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeLaunchConfigurations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/LaunchConfigurationsType -type DescribeLaunchConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The launch configurations. - // - // LaunchConfigurations is a required field - LaunchConfigurations []*LaunchConfiguration `type:"list" required:"true"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeLaunchConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLaunchConfigurationsOutput) GoString() string { - return s.String() -} - -// SetLaunchConfigurations sets the LaunchConfigurations field's value. -func (s *DescribeLaunchConfigurationsOutput) SetLaunchConfigurations(v []*LaunchConfiguration) *DescribeLaunchConfigurationsOutput { - s.LaunchConfigurations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchConfigurationsOutput) SetNextToken(v string) *DescribeLaunchConfigurationsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHookTypesInput -type DescribeLifecycleHookTypesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeLifecycleHookTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLifecycleHookTypesInput) GoString() string { - return s.String() -} - -// Contains the output of DescribeLifecycleHookTypes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHookTypesAnswer -type DescribeLifecycleHookTypesOutput struct { - _ struct{} `type:"structure"` - - // The lifecycle hook types. - LifecycleHookTypes []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeLifecycleHookTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLifecycleHookTypesOutput) GoString() string { - return s.String() -} - -// SetLifecycleHookTypes sets the LifecycleHookTypes field's value. -func (s *DescribeLifecycleHookTypesOutput) SetLifecycleHookTypes(v []*string) *DescribeLifecycleHookTypesOutput { - s.LifecycleHookTypes = v - return s -} - -// Contains the parameters for DescribeLifecycleHooks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHooksType -type DescribeLifecycleHooksInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The names of one or more lifecycle hooks. If you omit this parameter, all - // lifecycle hooks are described. - LifecycleHookNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeLifecycleHooksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLifecycleHooksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLifecycleHooksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLifecycleHooksInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DescribeLifecycleHooksInput) SetAutoScalingGroupName(v string) *DescribeLifecycleHooksInput { - s.AutoScalingGroupName = &v - return s -} - -// SetLifecycleHookNames sets the LifecycleHookNames field's value. -func (s *DescribeLifecycleHooksInput) SetLifecycleHookNames(v []*string) *DescribeLifecycleHooksInput { - s.LifecycleHookNames = v - return s -} - -// Contains the output of DescribeLifecycleHooks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHooksAnswer -type DescribeLifecycleHooksOutput struct { - _ struct{} `type:"structure"` - - // The lifecycle hooks for the specified group. - LifecycleHooks []*LifecycleHook `type:"list"` -} - -// String returns the string representation -func (s DescribeLifecycleHooksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLifecycleHooksOutput) GoString() string { - return s.String() -} - -// SetLifecycleHooks sets the LifecycleHooks field's value. -func (s *DescribeLifecycleHooksOutput) SetLifecycleHooks(v []*LifecycleHook) *DescribeLifecycleHooksOutput { - s.LifecycleHooks = v - return s -} - -// Contains the parameters for DescribeLoadBalancerTargetGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancerTargetGroupsRequest -type DescribeLoadBalancerTargetGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The maximum number of items to return with this call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLoadBalancerTargetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerTargetGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLoadBalancerTargetGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancerTargetGroupsInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DescribeLoadBalancerTargetGroupsInput) SetAutoScalingGroupName(v string) *DescribeLoadBalancerTargetGroupsInput { - s.AutoScalingGroupName = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeLoadBalancerTargetGroupsInput) SetMaxRecords(v int64) *DescribeLoadBalancerTargetGroupsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLoadBalancerTargetGroupsInput) SetNextToken(v string) *DescribeLoadBalancerTargetGroupsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeLoadBalancerTargetGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancerTargetGroupsResponse -type DescribeLoadBalancerTargetGroupsOutput struct { - _ struct{} `type:"structure"` - - // Information about the target groups. - LoadBalancerTargetGroups []*LoadBalancerTargetGroupState `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeLoadBalancerTargetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerTargetGroupsOutput) GoString() string { - return s.String() -} - -// SetLoadBalancerTargetGroups sets the LoadBalancerTargetGroups field's value. -func (s *DescribeLoadBalancerTargetGroupsOutput) SetLoadBalancerTargetGroups(v []*LoadBalancerTargetGroupState) *DescribeLoadBalancerTargetGroupsOutput { - s.LoadBalancerTargetGroups = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLoadBalancerTargetGroupsOutput) SetNextToken(v string) *DescribeLoadBalancerTargetGroupsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeLoadBalancers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancersRequest -type DescribeLoadBalancersInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The maximum number of items to return with this call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLoadBalancersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLoadBalancersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancersInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DescribeLoadBalancersInput) SetAutoScalingGroupName(v string) *DescribeLoadBalancersInput { - s.AutoScalingGroupName = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeLoadBalancersInput) SetMaxRecords(v int64) *DescribeLoadBalancersInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLoadBalancersInput) SetNextToken(v string) *DescribeLoadBalancersInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeLoadBalancers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancersResponse -type DescribeLoadBalancersOutput struct { - _ struct{} `type:"structure"` - - // The load balancers. - LoadBalancers []*LoadBalancerState `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeLoadBalancersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancersOutput) GoString() string { - return s.String() -} - -// SetLoadBalancers sets the LoadBalancers field's value. -func (s *DescribeLoadBalancersOutput) SetLoadBalancers(v []*LoadBalancerState) *DescribeLoadBalancersOutput { - s.LoadBalancers = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLoadBalancersOutput) SetNextToken(v string) *DescribeLoadBalancersOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeMetricCollectionTypesInput -type DescribeMetricCollectionTypesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeMetricCollectionTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMetricCollectionTypesInput) GoString() string { - return s.String() -} - -// Contains the output of DescribeMetricsCollectionTypes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeMetricCollectionTypesAnswer -type DescribeMetricCollectionTypesOutput struct { - _ struct{} `type:"structure"` - - // The granularities for the metrics. - Granularities []*MetricGranularityType `type:"list"` - - // One or more metrics. - Metrics []*MetricCollectionType `type:"list"` -} - -// String returns the string representation -func (s DescribeMetricCollectionTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMetricCollectionTypesOutput) GoString() string { - return s.String() -} - -// SetGranularities sets the Granularities field's value. -func (s *DescribeMetricCollectionTypesOutput) SetGranularities(v []*MetricGranularityType) *DescribeMetricCollectionTypesOutput { - s.Granularities = v - return s -} - -// SetMetrics sets the Metrics field's value. -func (s *DescribeMetricCollectionTypesOutput) SetMetrics(v []*MetricCollectionType) *DescribeMetricCollectionTypesOutput { - s.Metrics = v - return s -} - -// Contains the parameters for DescribeNotificationConfigurations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeNotificationConfigurationsType -type DescribeNotificationConfigurationsInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - AutoScalingGroupNames []*string `type:"list"` - - // The maximum number of items to return with this call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeNotificationConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNotificationConfigurationsInput) GoString() string { - return s.String() -} - -// SetAutoScalingGroupNames sets the AutoScalingGroupNames field's value. -func (s *DescribeNotificationConfigurationsInput) SetAutoScalingGroupNames(v []*string) *DescribeNotificationConfigurationsInput { - s.AutoScalingGroupNames = v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeNotificationConfigurationsInput) SetMaxRecords(v int64) *DescribeNotificationConfigurationsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeNotificationConfigurationsInput) SetNextToken(v string) *DescribeNotificationConfigurationsInput { - s.NextToken = &v - return s -} - -// Contains the output from DescribeNotificationConfigurations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeNotificationConfigurationsAnswer -type DescribeNotificationConfigurationsOutput 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 `type:"string"` - - // The notification configurations. - // - // NotificationConfigurations is a required field - NotificationConfigurations []*NotificationConfiguration `type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeNotificationConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNotificationConfigurationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeNotificationConfigurationsOutput) SetNextToken(v string) *DescribeNotificationConfigurationsOutput { - s.NextToken = &v - return s -} - -// SetNotificationConfigurations sets the NotificationConfigurations field's value. -func (s *DescribeNotificationConfigurationsOutput) SetNotificationConfigurations(v []*NotificationConfiguration) *DescribeNotificationConfigurationsOutput { - s.NotificationConfigurations = v - return s -} - -// Contains the parameters for DescribePolicies. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribePoliciesType -type DescribePoliciesInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - AutoScalingGroupName *string `min:"1" type:"string"` - - // The maximum number of items to be returned with each call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // One or more policy names or policy ARNs to be described. If you omit this - // parameter, all policy names are described. If an group name is provided, - // the results are limited to that group. This list is limited to 50 items. - // If you specify an unknown policy name, it is ignored with no error. - PolicyNames []*string `type:"list"` - - // One or more policy types. Valid values are SimpleScaling and StepScaling. - PolicyTypes []*string `type:"list"` -} - -// String returns the string representation -func (s DescribePoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribePoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribePoliciesInput"} - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DescribePoliciesInput) SetAutoScalingGroupName(v string) *DescribePoliciesInput { - s.AutoScalingGroupName = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribePoliciesInput) SetMaxRecords(v int64) *DescribePoliciesInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePoliciesInput) SetNextToken(v string) *DescribePoliciesInput { - s.NextToken = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *DescribePoliciesInput) SetPolicyNames(v []*string) *DescribePoliciesInput { - s.PolicyNames = v - return s -} - -// SetPolicyTypes sets the PolicyTypes field's value. -func (s *DescribePoliciesInput) SetPolicyTypes(v []*string) *DescribePoliciesInput { - s.PolicyTypes = v - return s -} - -// Contains the output of DescribePolicies. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PoliciesType -type DescribePoliciesOutput 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 `type:"string"` - - // The scaling policies. - ScalingPolicies []*ScalingPolicy `type:"list"` -} - -// String returns the string representation -func (s DescribePoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePoliciesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePoliciesOutput) SetNextToken(v string) *DescribePoliciesOutput { - s.NextToken = &v - return s -} - -// SetScalingPolicies sets the ScalingPolicies field's value. -func (s *DescribePoliciesOutput) SetScalingPolicies(v []*ScalingPolicy) *DescribePoliciesOutput { - s.ScalingPolicies = v - return s -} - -// Contains the parameters for DescribeScalingActivities. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingActivitiesType -type DescribeScalingActivitiesInput struct { - _ struct{} `type:"structure"` - - // The activity IDs of the desired scaling activities. If you omit this parameter, - // all activities for the past six weeks are described. If you specify an Auto - // Scaling group, the results are limited to that group. The list of requested - // activities cannot contain more than 50 items. If unknown activities are requested, - // they are ignored with no error. - ActivityIds []*string `type:"list"` - - // The name of the group. - AutoScalingGroupName *string `min:"1" type:"string"` - - // The maximum number of items to return with this call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeScalingActivitiesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingActivitiesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeScalingActivitiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeScalingActivitiesInput"} - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActivityIds sets the ActivityIds field's value. -func (s *DescribeScalingActivitiesInput) SetActivityIds(v []*string) *DescribeScalingActivitiesInput { - s.ActivityIds = v - return s -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DescribeScalingActivitiesInput) SetAutoScalingGroupName(v string) *DescribeScalingActivitiesInput { - s.AutoScalingGroupName = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeScalingActivitiesInput) SetMaxRecords(v int64) *DescribeScalingActivitiesInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScalingActivitiesInput) SetNextToken(v string) *DescribeScalingActivitiesInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeScalingActivities. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ActivitiesType -type DescribeScalingActivitiesOutput struct { - _ struct{} `type:"structure"` - - // The scaling activities. Activities are sorted by start time. Activities still - // in progress are described first. - // - // Activities is a required field - Activities []*Activity `type:"list" required:"true"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeScalingActivitiesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingActivitiesOutput) GoString() string { - return s.String() -} - -// SetActivities sets the Activities field's value. -func (s *DescribeScalingActivitiesOutput) SetActivities(v []*Activity) *DescribeScalingActivitiesOutput { - s.Activities = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScalingActivitiesOutput) SetNextToken(v string) *DescribeScalingActivitiesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingProcessTypesInput -type DescribeScalingProcessTypesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeScalingProcessTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingProcessTypesInput) GoString() string { - return s.String() -} - -// Contains the output of DescribeScalingProcessTypes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ProcessesType -type DescribeScalingProcessTypesOutput struct { - _ struct{} `type:"structure"` - - // The names of the process types. - Processes []*ProcessType `type:"list"` -} - -// String returns the string representation -func (s DescribeScalingProcessTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingProcessTypesOutput) GoString() string { - return s.String() -} - -// SetProcesses sets the Processes field's value. -func (s *DescribeScalingProcessTypesOutput) SetProcesses(v []*ProcessType) *DescribeScalingProcessTypesOutput { - s.Processes = v - return s -} - -// Contains the parameters for DescribeScheduledActions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScheduledActionsType -type DescribeScheduledActionsInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - AutoScalingGroupName *string `min:"1" type:"string"` - - // The latest scheduled start time to return. If scheduled action names are - // provided, this parameter is ignored. - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The maximum number of items to return with this call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // Describes one or more scheduled actions. If you omit this parameter, all - // scheduled actions are described. If you specify an unknown scheduled action, - // it is ignored with no error. - // - // You can describe up to a maximum of 50 instances with a single call. If there - // are more items to return, the call returns a token. To get the next set of - // items, repeat the call with the returned token. - ScheduledActionNames []*string `type:"list"` - - // The earliest scheduled start time to return. If scheduled action names are - // provided, this parameter is ignored. - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeScheduledActionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledActionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeScheduledActionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeScheduledActionsInput"} - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DescribeScheduledActionsInput) SetAutoScalingGroupName(v string) *DescribeScheduledActionsInput { - s.AutoScalingGroupName = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeScheduledActionsInput) SetEndTime(v time.Time) *DescribeScheduledActionsInput { - s.EndTime = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeScheduledActionsInput) SetMaxRecords(v int64) *DescribeScheduledActionsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledActionsInput) SetNextToken(v string) *DescribeScheduledActionsInput { - s.NextToken = &v - return s -} - -// SetScheduledActionNames sets the ScheduledActionNames field's value. -func (s *DescribeScheduledActionsInput) SetScheduledActionNames(v []*string) *DescribeScheduledActionsInput { - s.ScheduledActionNames = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeScheduledActionsInput) SetStartTime(v time.Time) *DescribeScheduledActionsInput { - s.StartTime = &v - return s -} - -// Contains the output of DescribeScheduledActions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ScheduledActionsType -type DescribeScheduledActionsOutput 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 `type:"string"` - - // The scheduled actions. - ScheduledUpdateGroupActions []*ScheduledUpdateGroupAction `type:"list"` -} - -// String returns the string representation -func (s DescribeScheduledActionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledActionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledActionsOutput) SetNextToken(v string) *DescribeScheduledActionsOutput { - s.NextToken = &v - return s -} - -// SetScheduledUpdateGroupActions sets the ScheduledUpdateGroupActions field's value. -func (s *DescribeScheduledActionsOutput) SetScheduledUpdateGroupActions(v []*ScheduledUpdateGroupAction) *DescribeScheduledActionsOutput { - s.ScheduledUpdateGroupActions = v - return s -} - -// Contains the parameters for DescribeTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTagsType -type DescribeTagsInput struct { - _ struct{} `type:"structure"` - - // A filter used to scope the tags to return. - Filters []*Filter `type:"list"` - - // The maximum number of items to return with this call. - MaxRecords *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `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() -} - -// SetFilters sets the Filters field's value. -func (s *DescribeTagsInput) SetFilters(v []*Filter) *DescribeTagsInput { - s.Filters = v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeTagsInput) SetMaxRecords(v int64) *DescribeTagsInput { - s.MaxRecords = &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/autoscaling-2011-01-01/TagsType -type DescribeTagsOutput 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 `type:"string"` - - // One or more tags. - Tags []*TagDescription `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 -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTerminationPolicyTypesInput -type DescribeTerminationPolicyTypesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeTerminationPolicyTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTerminationPolicyTypesInput) GoString() string { - return s.String() -} - -// Contains the output of DescribeTerminationPolicyTypes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTerminationPolicyTypesAnswer -type DescribeTerminationPolicyTypesOutput struct { - _ struct{} `type:"structure"` - - // The termination policies supported by Auto Scaling (OldestInstance, OldestLaunchConfiguration, - // NewestInstance, ClosestToNextInstanceHour, and Default). - TerminationPolicyTypes []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeTerminationPolicyTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTerminationPolicyTypesOutput) GoString() string { - return s.String() -} - -// SetTerminationPolicyTypes sets the TerminationPolicyTypes field's value. -func (s *DescribeTerminationPolicyTypesOutput) SetTerminationPolicyTypes(v []*string) *DescribeTerminationPolicyTypesOutput { - s.TerminationPolicyTypes = v - return s -} - -// Contains the parameters for DetachInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachInstancesQuery -type DetachInstancesInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more instance IDs. - InstanceIds []*string `type:"list"` - - // If True, the Auto Scaling group decrements the desired capacity value by - // the number of instances detached. - // - // ShouldDecrementDesiredCapacity is a required field - ShouldDecrementDesiredCapacity *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s DetachInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachInstancesInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.ShouldDecrementDesiredCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("ShouldDecrementDesiredCapacity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DetachInstancesInput) SetAutoScalingGroupName(v string) *DetachInstancesInput { - s.AutoScalingGroupName = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DetachInstancesInput) SetInstanceIds(v []*string) *DetachInstancesInput { - s.InstanceIds = v - return s -} - -// SetShouldDecrementDesiredCapacity sets the ShouldDecrementDesiredCapacity field's value. -func (s *DetachInstancesInput) SetShouldDecrementDesiredCapacity(v bool) *DetachInstancesInput { - s.ShouldDecrementDesiredCapacity = &v - return s -} - -// Contains the output of DetachInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachInstancesAnswer -type DetachInstancesOutput struct { - _ struct{} `type:"structure"` - - // The activities related to detaching the instances from the Auto Scaling group. - Activities []*Activity `type:"list"` -} - -// String returns the string representation -func (s DetachInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachInstancesOutput) GoString() string { - return s.String() -} - -// SetActivities sets the Activities field's value. -func (s *DetachInstancesOutput) SetActivities(v []*Activity) *DetachInstancesOutput { - s.Activities = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancerTargetGroupsType -type DetachLoadBalancerTargetGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Names (ARN) of the target groups. - // - // TargetGroupARNs is a required field - TargetGroupARNs []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DetachLoadBalancerTargetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachLoadBalancerTargetGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachLoadBalancerTargetGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachLoadBalancerTargetGroupsInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.TargetGroupARNs == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupARNs")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DetachLoadBalancerTargetGroupsInput) SetAutoScalingGroupName(v string) *DetachLoadBalancerTargetGroupsInput { - s.AutoScalingGroupName = &v - return s -} - -// SetTargetGroupARNs sets the TargetGroupARNs field's value. -func (s *DetachLoadBalancerTargetGroupsInput) SetTargetGroupARNs(v []*string) *DetachLoadBalancerTargetGroupsInput { - s.TargetGroupARNs = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancerTargetGroupsResultType -type DetachLoadBalancerTargetGroupsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachLoadBalancerTargetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachLoadBalancerTargetGroupsOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DetachLoadBalancers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancersType -type DetachLoadBalancersInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more load balancer names. - // - // LoadBalancerNames is a required field - LoadBalancerNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DetachLoadBalancersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachLoadBalancersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachLoadBalancersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachLoadBalancersInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.LoadBalancerNames == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DetachLoadBalancersInput) SetAutoScalingGroupName(v string) *DetachLoadBalancersInput { - s.AutoScalingGroupName = &v - return s -} - -// SetLoadBalancerNames sets the LoadBalancerNames field's value. -func (s *DetachLoadBalancersInput) SetLoadBalancerNames(v []*string) *DetachLoadBalancersInput { - s.LoadBalancerNames = v - return s -} - -// Contains the output for DetachLoadBalancers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancersResultType -type DetachLoadBalancersOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachLoadBalancersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachLoadBalancersOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DisableMetricsCollection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DisableMetricsCollectionQuery -type DisableMetricsCollectionInput struct { - _ struct{} `type:"structure"` - - // The name or Amazon Resource Name (ARN) of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more of the following metrics. If you omit this parameter, all metrics - // are disabled. - // - // * GroupMinSize - // - // * GroupMaxSize - // - // * GroupDesiredCapacity - // - // * GroupInServiceInstances - // - // * GroupPendingInstances - // - // * GroupStandbyInstances - // - // * GroupTerminatingInstances - // - // * GroupTotalInstances - Metrics []*string `type:"list"` -} - -// String returns the string representation -func (s DisableMetricsCollectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableMetricsCollectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableMetricsCollectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableMetricsCollectionInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DisableMetricsCollectionInput) SetAutoScalingGroupName(v string) *DisableMetricsCollectionInput { - s.AutoScalingGroupName = &v - return s -} - -// SetMetrics sets the Metrics field's value. -func (s *DisableMetricsCollectionInput) SetMetrics(v []*string) *DisableMetricsCollectionInput { - s.Metrics = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DisableMetricsCollectionOutput -type DisableMetricsCollectionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableMetricsCollectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableMetricsCollectionOutput) GoString() string { - return s.String() -} - -// Describes an Amazon EBS volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/Ebs -type Ebs struct { - _ struct{} `type:"structure"` - - // Indicates whether the volume is deleted on instance termination. - // - // Default: true - DeleteOnTermination *bool `type:"boolean"` - - // Indicates whether the volume should be encrypted. Encrypted EBS volumes must - // 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 an unencrypted - // volume from an encrypted snapshot. 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 `type:"boolean"` - - // The number of I/O operations per second (IOPS) to provision for the volume. - // - // Constraint: Required when the volume type is io1. - Iops *int64 `min:"100" type:"integer"` - - // The ID of the snapshot. - SnapshotId *string `min:"1" type:"string"` - - // The volume size, in GiB. For standard volumes, specify a value from 1 to - // 1,024. For io1 volumes, specify a value from 4 to 16,384. For gp2 volumes, - // specify a value from 1 to 16,384. If you specify a snapshot, the volume size - // must be equal to or larger than the snapshot size. - // - // Default: If you create a volume from a snapshot and you don't specify a volume - // size, the default is the snapshot size. - VolumeSize *int64 `min:"1" type:"integer"` - - // The volume type. For more information, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Valid values: standard | io1 | gp2 - // - // Default: standard - VolumeType *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s Ebs) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Ebs) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Ebs) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ebs"} - if s.Iops != nil && *s.Iops < 100 { - invalidParams.Add(request.NewErrParamMinValue("Iops", 100)) - } - if s.SnapshotId != nil && len(*s.SnapshotId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SnapshotId", 1)) - } - if s.VolumeSize != nil && *s.VolumeSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("VolumeSize", 1)) - } - if s.VolumeType != nil && len(*s.VolumeType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VolumeType", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *Ebs) SetDeleteOnTermination(v bool) *Ebs { - s.DeleteOnTermination = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *Ebs) SetEncrypted(v bool) *Ebs { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *Ebs) SetIops(v int64) *Ebs { - s.Iops = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *Ebs) SetSnapshotId(v string) *Ebs { - s.SnapshotId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *Ebs) SetVolumeSize(v int64) *Ebs { - s.VolumeSize = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *Ebs) SetVolumeType(v string) *Ebs { - s.VolumeType = &v - return s -} - -// Contains the parameters for EnableMetricsCollection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnableMetricsCollectionQuery -type EnableMetricsCollectionInput struct { - _ struct{} `type:"structure"` - - // The name or ARN of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The granularity to associate with the metrics to collect. The only valid - // value is 1Minute. - // - // Granularity is a required field - Granularity *string `min:"1" type:"string" required:"true"` - - // One or more of the following metrics. If you omit this parameter, all metrics - // are enabled. - // - // * GroupMinSize - // - // * GroupMaxSize - // - // * GroupDesiredCapacity - // - // * GroupInServiceInstances - // - // * GroupPendingInstances - // - // * GroupStandbyInstances - // - // * GroupTerminatingInstances - // - // * GroupTotalInstances - Metrics []*string `type:"list"` -} - -// String returns the string representation -func (s EnableMetricsCollectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableMetricsCollectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableMetricsCollectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableMetricsCollectionInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.Granularity == nil { - invalidParams.Add(request.NewErrParamRequired("Granularity")) - } - if s.Granularity != nil && len(*s.Granularity) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Granularity", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *EnableMetricsCollectionInput) SetAutoScalingGroupName(v string) *EnableMetricsCollectionInput { - s.AutoScalingGroupName = &v - return s -} - -// SetGranularity sets the Granularity field's value. -func (s *EnableMetricsCollectionInput) SetGranularity(v string) *EnableMetricsCollectionInput { - s.Granularity = &v - return s -} - -// SetMetrics sets the Metrics field's value. -func (s *EnableMetricsCollectionInput) SetMetrics(v []*string) *EnableMetricsCollectionInput { - s.Metrics = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnableMetricsCollectionOutput -type EnableMetricsCollectionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableMetricsCollectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableMetricsCollectionOutput) GoString() string { - return s.String() -} - -// Describes an enabled metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnabledMetric -type EnabledMetric struct { - _ struct{} `type:"structure"` - - // The granularity of the metric. The only valid value is 1Minute. - Granularity *string `min:"1" type:"string"` - - // One of the following metrics: - // - // * GroupMinSize - // - // * GroupMaxSize - // - // * GroupDesiredCapacity - // - // * GroupInServiceInstances - // - // * GroupPendingInstances - // - // * GroupStandbyInstances - // - // * GroupTerminatingInstances - // - // * GroupTotalInstances - Metric *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EnabledMetric) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnabledMetric) GoString() string { - return s.String() -} - -// SetGranularity sets the Granularity field's value. -func (s *EnabledMetric) SetGranularity(v string) *EnabledMetric { - s.Granularity = &v - return s -} - -// SetMetric sets the Metric field's value. -func (s *EnabledMetric) SetMetric(v string) *EnabledMetric { - s.Metric = &v - return s -} - -// Contains the parameters for EnteStandby. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnterStandbyQuery -type EnterStandbyInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more instances to move into Standby mode. You must specify at least - // one instance ID. - InstanceIds []*string `type:"list"` - - // Specifies whether the instances moved to Standby mode count as part of the - // Auto Scaling group's desired capacity. If set, the desired capacity for the - // Auto Scaling group decrements by the number of instances moved to Standby - // mode. - // - // ShouldDecrementDesiredCapacity is a required field - ShouldDecrementDesiredCapacity *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s EnterStandbyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnterStandbyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnterStandbyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnterStandbyInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.ShouldDecrementDesiredCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("ShouldDecrementDesiredCapacity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *EnterStandbyInput) SetAutoScalingGroupName(v string) *EnterStandbyInput { - s.AutoScalingGroupName = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *EnterStandbyInput) SetInstanceIds(v []*string) *EnterStandbyInput { - s.InstanceIds = v - return s -} - -// SetShouldDecrementDesiredCapacity sets the ShouldDecrementDesiredCapacity field's value. -func (s *EnterStandbyInput) SetShouldDecrementDesiredCapacity(v bool) *EnterStandbyInput { - s.ShouldDecrementDesiredCapacity = &v - return s -} - -// Contains the output of EnterStandby. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnterStandbyAnswer -type EnterStandbyOutput struct { - _ struct{} `type:"structure"` - - // The activities related to moving instances into Standby mode. - Activities []*Activity `type:"list"` -} - -// String returns the string representation -func (s EnterStandbyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnterStandbyOutput) GoString() string { - return s.String() -} - -// SetActivities sets the Activities field's value. -func (s *EnterStandbyOutput) SetActivities(v []*Activity) *EnterStandbyOutput { - s.Activities = v - return s -} - -// Contains the parameters for ExecutePolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExecutePolicyType -type ExecutePolicyInput struct { - _ struct{} `type:"structure"` - - // The name or Amazon Resource Name (ARN) of the Auto Scaling group. - AutoScalingGroupName *string `min:"1" type:"string"` - - // The breach threshold for the alarm. - // - // This parameter is required if the policy type is StepScaling and not supported - // otherwise. - BreachThreshold *float64 `type:"double"` - - // If this parameter is true, Auto Scaling waits for the cooldown period to - // complete before executing the policy. Otherwise, Auto Scaling executes the - // policy without waiting for the cooldown period to complete. - // - // This parameter is not supported if the policy type is StepScaling. - // - // For more information, see Auto Scaling Cooldowns (http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html) - // in the Auto Scaling User Guide. - HonorCooldown *bool `type:"boolean"` - - // The metric value to compare to BreachThreshold. This enables you to execute - // a policy of type StepScaling and determine which step adjustment to use. - // For example, if the breach threshold is 50 and you want to use a step adjustment - // with a lower bound of 0 and an upper bound of 10, you can set the metric - // value to 59. - // - // If you specify a metric value that doesn't correspond to a step adjustment - // for the policy, the call returns an error. - // - // This parameter is required if the policy type is StepScaling and not supported - // otherwise. - MetricValue *float64 `type:"double"` - - // The name or ARN of the policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ExecutePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecutePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecutePolicyInput"} - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *ExecutePolicyInput) SetAutoScalingGroupName(v string) *ExecutePolicyInput { - s.AutoScalingGroupName = &v - return s -} - -// SetBreachThreshold sets the BreachThreshold field's value. -func (s *ExecutePolicyInput) SetBreachThreshold(v float64) *ExecutePolicyInput { - s.BreachThreshold = &v - return s -} - -// SetHonorCooldown sets the HonorCooldown field's value. -func (s *ExecutePolicyInput) SetHonorCooldown(v bool) *ExecutePolicyInput { - s.HonorCooldown = &v - return s -} - -// SetMetricValue sets the MetricValue field's value. -func (s *ExecutePolicyInput) SetMetricValue(v float64) *ExecutePolicyInput { - s.MetricValue = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *ExecutePolicyInput) SetPolicyName(v string) *ExecutePolicyInput { - s.PolicyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExecutePolicyOutput -type ExecutePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ExecutePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutePolicyOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ExitStandby. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExitStandbyQuery -type ExitStandbyInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more instance IDs. You must specify at least one instance ID. - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s ExitStandbyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExitStandbyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExitStandbyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExitStandbyInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *ExitStandbyInput) SetAutoScalingGroupName(v string) *ExitStandbyInput { - s.AutoScalingGroupName = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *ExitStandbyInput) SetInstanceIds(v []*string) *ExitStandbyInput { - s.InstanceIds = v - return s -} - -// Contains the parameters for ExitStandby. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExitStandbyAnswer -type ExitStandbyOutput struct { - _ struct{} `type:"structure"` - - // The activities related to moving instances out of Standby mode. - Activities []*Activity `type:"list"` -} - -// String returns the string representation -func (s ExitStandbyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExitStandbyOutput) GoString() string { - return s.String() -} - -// SetActivities sets the Activities field's value. -func (s *ExitStandbyOutput) SetActivities(v []*Activity) *ExitStandbyOutput { - s.Activities = v - return s -} - -// Describes a filter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/Filter -type Filter struct { - _ struct{} `type:"structure"` - - // The name of the filter. The valid values are: "auto-scaling-group", "key", - // "value", and "propagate-at-launch". - Name *string `type:"string"` - - // The value of the filter. - Values []*string `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 an Auto Scaling group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AutoScalingGroup -type Group struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the group. - AutoScalingGroupARN *string `min:"1" type:"string"` - - // The name of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more Availability Zones for the group. - // - // AvailabilityZones is a required field - AvailabilityZones []*string `min:"1" type:"list" required:"true"` - - // The date and time the group was created. - // - // CreatedTime is a required field - CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The amount of time, in seconds, after a scaling activity completes before - // another scaling activity can start. - // - // DefaultCooldown is a required field - DefaultCooldown *int64 `type:"integer" required:"true"` - - // The desired size of the group. - // - // DesiredCapacity is a required field - DesiredCapacity *int64 `type:"integer" required:"true"` - - // The metrics enabled for the group. - EnabledMetrics []*EnabledMetric `type:"list"` - - // The amount of time, in seconds, that Auto Scaling waits before checking the - // health status of an EC2 instance that has come into service. - HealthCheckGracePeriod *int64 `type:"integer"` - - // The service to use for the health checks. The valid values are EC2 and ELB. - // - // HealthCheckType is a required field - HealthCheckType *string `min:"1" type:"string" required:"true"` - - // The EC2 instances associated with the group. - Instances []*Instance `type:"list"` - - // The name of the associated launch configuration. - LaunchConfigurationName *string `min:"1" type:"string"` - - // One or more load balancers associated with the group. - LoadBalancerNames []*string `type:"list"` - - // The maximum size of the group. - // - // MaxSize is a required field - MaxSize *int64 `type:"integer" required:"true"` - - // The minimum size of the group. - // - // MinSize is a required field - MinSize *int64 `type:"integer" required:"true"` - - // Indicates whether newly launched instances are protected from termination - // by Auto Scaling when scaling in. - NewInstancesProtectedFromScaleIn *bool `type:"boolean"` - - // The name of the placement group into which you'll launch your instances, - // if any. For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) - // in the Amazon Elastic Compute Cloud User Guide. - PlacementGroup *string `min:"1" type:"string"` - - // The current state of the group when DeleteAutoScalingGroup is in progress. - Status *string `min:"1" type:"string"` - - // The suspended processes associated with the group. - SuspendedProcesses []*SuspendedProcess `type:"list"` - - // The tags for the group. - Tags []*TagDescription `type:"list"` - - // The Amazon Resource Names (ARN) of the target groups for your load balancer. - TargetGroupARNs []*string `type:"list"` - - // The termination policies for the group. - TerminationPolicies []*string `type:"list"` - - // One or more subnet IDs, if applicable, separated by commas. - // - // If you specify VPCZoneIdentifier and AvailabilityZones, ensure that the Availability - // Zones of the subnets match the values for AvailabilityZones. - VPCZoneIdentifier *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s Group) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Group) GoString() string { - return s.String() -} - -// SetAutoScalingGroupARN sets the AutoScalingGroupARN field's value. -func (s *Group) SetAutoScalingGroupARN(v string) *Group { - s.AutoScalingGroupARN = &v - return s -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *Group) SetAutoScalingGroupName(v string) *Group { - s.AutoScalingGroupName = &v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *Group) SetAvailabilityZones(v []*string) *Group { - s.AvailabilityZones = v - return s -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *Group) SetCreatedTime(v time.Time) *Group { - s.CreatedTime = &v - return s -} - -// SetDefaultCooldown sets the DefaultCooldown field's value. -func (s *Group) SetDefaultCooldown(v int64) *Group { - s.DefaultCooldown = &v - return s -} - -// SetDesiredCapacity sets the DesiredCapacity field's value. -func (s *Group) SetDesiredCapacity(v int64) *Group { - s.DesiredCapacity = &v - return s -} - -// SetEnabledMetrics sets the EnabledMetrics field's value. -func (s *Group) SetEnabledMetrics(v []*EnabledMetric) *Group { - s.EnabledMetrics = v - return s -} - -// SetHealthCheckGracePeriod sets the HealthCheckGracePeriod field's value. -func (s *Group) SetHealthCheckGracePeriod(v int64) *Group { - s.HealthCheckGracePeriod = &v - return s -} - -// SetHealthCheckType sets the HealthCheckType field's value. -func (s *Group) SetHealthCheckType(v string) *Group { - s.HealthCheckType = &v - return s -} - -// SetInstances sets the Instances field's value. -func (s *Group) SetInstances(v []*Instance) *Group { - s.Instances = v - return s -} - -// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. -func (s *Group) SetLaunchConfigurationName(v string) *Group { - s.LaunchConfigurationName = &v - return s -} - -// SetLoadBalancerNames sets the LoadBalancerNames field's value. -func (s *Group) SetLoadBalancerNames(v []*string) *Group { - s.LoadBalancerNames = v - return s -} - -// SetMaxSize sets the MaxSize field's value. -func (s *Group) SetMaxSize(v int64) *Group { - s.MaxSize = &v - return s -} - -// SetMinSize sets the MinSize field's value. -func (s *Group) SetMinSize(v int64) *Group { - s.MinSize = &v - return s -} - -// SetNewInstancesProtectedFromScaleIn sets the NewInstancesProtectedFromScaleIn field's value. -func (s *Group) SetNewInstancesProtectedFromScaleIn(v bool) *Group { - s.NewInstancesProtectedFromScaleIn = &v - return s -} - -// SetPlacementGroup sets the PlacementGroup field's value. -func (s *Group) SetPlacementGroup(v string) *Group { - s.PlacementGroup = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Group) SetStatus(v string) *Group { - s.Status = &v - return s -} - -// SetSuspendedProcesses sets the SuspendedProcesses field's value. -func (s *Group) SetSuspendedProcesses(v []*SuspendedProcess) *Group { - s.SuspendedProcesses = v - return s -} - -// SetTags sets the Tags field's value. -func (s *Group) SetTags(v []*TagDescription) *Group { - s.Tags = v - return s -} - -// SetTargetGroupARNs sets the TargetGroupARNs field's value. -func (s *Group) SetTargetGroupARNs(v []*string) *Group { - s.TargetGroupARNs = v - return s -} - -// SetTerminationPolicies sets the TerminationPolicies field's value. -func (s *Group) SetTerminationPolicies(v []*string) *Group { - s.TerminationPolicies = v - return s -} - -// SetVPCZoneIdentifier sets the VPCZoneIdentifier field's value. -func (s *Group) SetVPCZoneIdentifier(v string) *Group { - s.VPCZoneIdentifier = &v - return s -} - -// Describes an EC2 instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/Instance -type Instance struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which the instance is running. - // - // AvailabilityZone is a required field - AvailabilityZone *string `min:"1" type:"string" required:"true"` - - // The last reported health status of the instance. "Healthy" means that the - // instance is healthy and should remain in service. "Unhealthy" means that - // the instance is unhealthy and Auto Scaling should terminate and replace it. - // - // HealthStatus is a required field - HealthStatus *string `min:"1" type:"string" required:"true"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `min:"1" type:"string" required:"true"` - - // The launch configuration associated with the instance. - // - // LaunchConfigurationName is a required field - LaunchConfigurationName *string `min:"1" type:"string" required:"true"` - - // A description of the current lifecycle state. Note that the Quarantined state - // is not used. - // - // LifecycleState is a required field - LifecycleState *string `type:"string" required:"true" enum:"LifecycleState"` - - // Indicates whether the instance is protected from termination by Auto Scaling - // when scaling in. - // - // ProtectedFromScaleIn is a required field - ProtectedFromScaleIn *bool `type:"boolean" required:"true"` -} - -// 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() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Instance) SetAvailabilityZone(v string) *Instance { - s.AvailabilityZone = &v - return s -} - -// SetHealthStatus sets the HealthStatus field's value. -func (s *Instance) SetHealthStatus(v string) *Instance { - s.HealthStatus = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Instance) SetInstanceId(v string) *Instance { - s.InstanceId = &v - return s -} - -// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. -func (s *Instance) SetLaunchConfigurationName(v string) *Instance { - s.LaunchConfigurationName = &v - return s -} - -// SetLifecycleState sets the LifecycleState field's value. -func (s *Instance) SetLifecycleState(v string) *Instance { - s.LifecycleState = &v - return s -} - -// SetProtectedFromScaleIn sets the ProtectedFromScaleIn field's value. -func (s *Instance) SetProtectedFromScaleIn(v bool) *Instance { - s.ProtectedFromScaleIn = &v - return s -} - -// Describes an EC2 instance associated with an Auto Scaling group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AutoScalingInstanceDetails -type InstanceDetails struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group associated with the instance. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The Availability Zone for the instance. - // - // AvailabilityZone is a required field - AvailabilityZone *string `min:"1" type:"string" required:"true"` - - // The last reported health status of this instance. "Healthy" means that the - // instance is healthy and should remain in service. "Unhealthy" means that - // the instance is unhealthy and Auto Scaling should terminate and replace it. - // - // HealthStatus is a required field - HealthStatus *string `min:"1" type:"string" required:"true"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `min:"1" type:"string" required:"true"` - - // The launch configuration associated with the instance. - // - // LaunchConfigurationName is a required field - LaunchConfigurationName *string `min:"1" type:"string" required:"true"` - - // The lifecycle state for the instance. For more information, see Auto Scaling - // Lifecycle (http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.html) - // in the Auto Scaling User Guide. - // - // LifecycleState is a required field - LifecycleState *string `min:"1" type:"string" required:"true"` - - // Indicates whether the instance is protected from termination by Auto Scaling - // when scaling in. - // - // ProtectedFromScaleIn is a required field - ProtectedFromScaleIn *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s InstanceDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceDetails) GoString() string { - return s.String() -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *InstanceDetails) SetAutoScalingGroupName(v string) *InstanceDetails { - s.AutoScalingGroupName = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *InstanceDetails) SetAvailabilityZone(v string) *InstanceDetails { - s.AvailabilityZone = &v - return s -} - -// SetHealthStatus sets the HealthStatus field's value. -func (s *InstanceDetails) SetHealthStatus(v string) *InstanceDetails { - s.HealthStatus = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceDetails) SetInstanceId(v string) *InstanceDetails { - s.InstanceId = &v - return s -} - -// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. -func (s *InstanceDetails) SetLaunchConfigurationName(v string) *InstanceDetails { - s.LaunchConfigurationName = &v - return s -} - -// SetLifecycleState sets the LifecycleState field's value. -func (s *InstanceDetails) SetLifecycleState(v string) *InstanceDetails { - s.LifecycleState = &v - return s -} - -// SetProtectedFromScaleIn sets the ProtectedFromScaleIn field's value. -func (s *InstanceDetails) SetProtectedFromScaleIn(v bool) *InstanceDetails { - s.ProtectedFromScaleIn = &v - return s -} - -// Describes whether instance monitoring is enabled. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/InstanceMonitoring -type InstanceMonitoring struct { - _ struct{} `type:"structure"` - - // If True, instance monitoring is enabled. - Enabled *bool `type:"boolean"` -} - -// 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() -} - -// SetEnabled sets the Enabled field's value. -func (s *InstanceMonitoring) SetEnabled(v bool) *InstanceMonitoring { - s.Enabled = &v - return s -} - -// Describes a launch configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/LaunchConfiguration -type LaunchConfiguration struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] Indicates whether to assign a public IP address to each instance. - AssociatePublicIpAddress *bool `type:"boolean"` - - // A block device mapping, which specifies the block devices for the instance. - BlockDeviceMappings []*BlockDeviceMapping `type:"list"` - - // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. - // This parameter can only be used if you are launching EC2-Classic instances. - // For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClassicLinkVPCId *string `min:"1" type:"string"` - - // The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. - // This parameter is required if you specify a ClassicLink-enabled VPC, and - // cannot be used otherwise. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClassicLinkVPCSecurityGroups []*string `type:"list"` - - // The creation date and time for the launch configuration. - // - // CreatedTime is a required field - CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Controls whether the instance is optimized for EBS I/O (true) or not (false). - EbsOptimized *bool `type:"boolean"` - - // The name or Amazon Resource Name (ARN) of the instance profile associated - // with the IAM role for the instance. - IamInstanceProfile *string `min:"1" type:"string"` - - // The ID of the Amazon Machine Image (AMI). - // - // ImageId is a required field - ImageId *string `min:"1" type:"string" required:"true"` - - // Controls whether instances in this group are launched with detailed (true) - // or basic (false) monitoring. - InstanceMonitoring *InstanceMonitoring `type:"structure"` - - // The instance type for the instances. - // - // InstanceType is a required field - InstanceType *string `min:"1" type:"string" required:"true"` - - // The ID of the kernel associated with the AMI. - KernelId *string `min:"1" type:"string"` - - // The name of the key pair. - KeyName *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the launch configuration. - LaunchConfigurationARN *string `min:"1" type:"string"` - - // The name of the launch configuration. - // - // LaunchConfigurationName is a required field - LaunchConfigurationName *string `min:"1" type:"string" required:"true"` - - // The tenancy of the instance, either default or dedicated. An instance with - // dedicated tenancy runs in an isolated, single-tenant hardware and can only - // be launched into a VPC. - PlacementTenancy *string `min:"1" type:"string"` - - // The ID of the RAM disk associated with the AMI. - RamdiskId *string `min:"1" type:"string"` - - // The security groups to associate with the instances. - SecurityGroups []*string `type:"list"` - - // The price to bid when launching Spot Instances. - SpotPrice *string `min:"1" type:"string"` - - // The user data available to the instances. - UserData *string `type:"string"` -} - -// String returns the string representation -func (s LaunchConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchConfiguration) GoString() string { - return s.String() -} - -// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. -func (s *LaunchConfiguration) SetAssociatePublicIpAddress(v bool) *LaunchConfiguration { - s.AssociatePublicIpAddress = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *LaunchConfiguration) SetBlockDeviceMappings(v []*BlockDeviceMapping) *LaunchConfiguration { - s.BlockDeviceMappings = v - return s -} - -// SetClassicLinkVPCId sets the ClassicLinkVPCId field's value. -func (s *LaunchConfiguration) SetClassicLinkVPCId(v string) *LaunchConfiguration { - s.ClassicLinkVPCId = &v - return s -} - -// SetClassicLinkVPCSecurityGroups sets the ClassicLinkVPCSecurityGroups field's value. -func (s *LaunchConfiguration) SetClassicLinkVPCSecurityGroups(v []*string) *LaunchConfiguration { - s.ClassicLinkVPCSecurityGroups = v - return s -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *LaunchConfiguration) SetCreatedTime(v time.Time) *LaunchConfiguration { - s.CreatedTime = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *LaunchConfiguration) SetEbsOptimized(v bool) *LaunchConfiguration { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *LaunchConfiguration) SetIamInstanceProfile(v string) *LaunchConfiguration { - s.IamInstanceProfile = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *LaunchConfiguration) SetImageId(v string) *LaunchConfiguration { - s.ImageId = &v - return s -} - -// SetInstanceMonitoring sets the InstanceMonitoring field's value. -func (s *LaunchConfiguration) SetInstanceMonitoring(v *InstanceMonitoring) *LaunchConfiguration { - s.InstanceMonitoring = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *LaunchConfiguration) SetInstanceType(v string) *LaunchConfiguration { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *LaunchConfiguration) SetKernelId(v string) *LaunchConfiguration { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *LaunchConfiguration) SetKeyName(v string) *LaunchConfiguration { - s.KeyName = &v - return s -} - -// SetLaunchConfigurationARN sets the LaunchConfigurationARN field's value. -func (s *LaunchConfiguration) SetLaunchConfigurationARN(v string) *LaunchConfiguration { - s.LaunchConfigurationARN = &v - return s -} - -// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. -func (s *LaunchConfiguration) SetLaunchConfigurationName(v string) *LaunchConfiguration { - s.LaunchConfigurationName = &v - return s -} - -// SetPlacementTenancy sets the PlacementTenancy field's value. -func (s *LaunchConfiguration) SetPlacementTenancy(v string) *LaunchConfiguration { - s.PlacementTenancy = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *LaunchConfiguration) SetRamdiskId(v string) *LaunchConfiguration { - s.RamdiskId = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *LaunchConfiguration) SetSecurityGroups(v []*string) *LaunchConfiguration { - s.SecurityGroups = v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *LaunchConfiguration) SetSpotPrice(v string) *LaunchConfiguration { - s.SpotPrice = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *LaunchConfiguration) SetUserData(v string) *LaunchConfiguration { - s.UserData = &v - return s -} - -// Describes a lifecycle hook, which tells Auto Scaling that you want to perform -// an action when an instance launches or terminates. When you have a lifecycle -// hook in place, the Auto Scaling group will either: -// -// * Pause the instance after it launches, but before it is put into service -// -// * Pause the instance as it terminates, but before it is fully terminated -// -// For more information, see Auto Scaling Lifecycle (http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.html) -// in the Auto Scaling User Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/LifecycleHook -type LifecycleHook struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group for the lifecycle hook. - AutoScalingGroupName *string `min:"1" type:"string"` - - // Defines the action the Auto Scaling group should take when the lifecycle - // hook timeout elapses or if an unexpected failure occurs. The valid values - // are CONTINUE and ABANDON. The default value is CONTINUE. - DefaultResult *string `type:"string"` - - // The maximum time, in seconds, that an instance can remain in a Pending:Wait - // or Terminating:Wait state. The maximum is 172800 seconds (48 hours) or 100 - // times HeartbeatTimeout, whichever is smaller. - GlobalTimeout *int64 `type:"integer"` - - // The maximum time, in seconds, that can elapse before the lifecycle hook times - // out. The default is 3600 seconds (1 hour). When the lifecycle hook times - // out, Auto Scaling performs the default action. You can prevent the lifecycle - // hook from timing out by calling RecordLifecycleActionHeartbeat. - HeartbeatTimeout *int64 `type:"integer"` - - // The name of the lifecycle hook. - LifecycleHookName *string `min:"1" type:"string"` - - // The state of the EC2 instance to which you want to attach the lifecycle hook. - // For a list of lifecycle hook types, see DescribeLifecycleHookTypes. - LifecycleTransition *string `type:"string"` - - // Additional information that you want to include any time Auto Scaling sends - // a message to the notification target. - NotificationMetadata *string `min:"1" type:"string"` - - // The ARN of the notification target that Auto Scaling uses to notify you when - // an instance is in the transition state for the lifecycle hook. This ARN target - // can be either an SQS queue or an SNS topic. The notification message sent - // to the target includes the following: - // - // * Lifecycle action token - // - // * User account ID - // - // * Name of the Auto Scaling group - // - // * Lifecycle hook name - // - // * EC2 instance ID - // - // * Lifecycle transition - // - // * Notification metadata - NotificationTargetARN *string `min:"1" type:"string"` - - // The ARN of the IAM role that allows the Auto Scaling group to publish to - // the specified notification target. - RoleARN *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s LifecycleHook) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleHook) GoString() string { - return s.String() -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *LifecycleHook) SetAutoScalingGroupName(v string) *LifecycleHook { - s.AutoScalingGroupName = &v - return s -} - -// SetDefaultResult sets the DefaultResult field's value. -func (s *LifecycleHook) SetDefaultResult(v string) *LifecycleHook { - s.DefaultResult = &v - return s -} - -// SetGlobalTimeout sets the GlobalTimeout field's value. -func (s *LifecycleHook) SetGlobalTimeout(v int64) *LifecycleHook { - s.GlobalTimeout = &v - return s -} - -// SetHeartbeatTimeout sets the HeartbeatTimeout field's value. -func (s *LifecycleHook) SetHeartbeatTimeout(v int64) *LifecycleHook { - s.HeartbeatTimeout = &v - return s -} - -// SetLifecycleHookName sets the LifecycleHookName field's value. -func (s *LifecycleHook) SetLifecycleHookName(v string) *LifecycleHook { - s.LifecycleHookName = &v - return s -} - -// SetLifecycleTransition sets the LifecycleTransition field's value. -func (s *LifecycleHook) SetLifecycleTransition(v string) *LifecycleHook { - s.LifecycleTransition = &v - return s -} - -// SetNotificationMetadata sets the NotificationMetadata field's value. -func (s *LifecycleHook) SetNotificationMetadata(v string) *LifecycleHook { - s.NotificationMetadata = &v - return s -} - -// SetNotificationTargetARN sets the NotificationTargetARN field's value. -func (s *LifecycleHook) SetNotificationTargetARN(v string) *LifecycleHook { - s.NotificationTargetARN = &v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *LifecycleHook) SetRoleARN(v string) *LifecycleHook { - s.RoleARN = &v - return s -} - -// Describes the state of a Classic load balancer. -// -// If you specify a load balancer when creating the Auto Scaling group, the -// state of the load balancer is InService. -// -// If you attach a load balancer to an existing Auto Scaling group, the initial -// state is Adding. The state transitions to Added after all instances in the -// group are registered with the load balancer. If ELB health checks are enabled -// for the load balancer, the state transitions to InService after at least -// one instance in the group passes the health check. If EC2 health checks are -// enabled instead, the load balancer remains in the Added state. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/LoadBalancerState -type LoadBalancerState struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - LoadBalancerName *string `min:"1" type:"string"` - - // One of the following load balancer states: - // - // * Adding - The instances in the group are being registered with the load - // balancer. - // - // * Added - All instances in the group are registered with the load balancer. - // - // * InService - At least one instance in the group passed an ELB health - // check. - // - // * Removing - The instances in the group are being deregistered from the - // load balancer. If connection draining is enabled, Elastic Load Balancing - // waits for in-flight requests to complete before deregistering the instances. - // - // * Removed - All instances in the group are deregistered from the load - // balancer. - State *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s LoadBalancerState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancerState) GoString() string { - return s.String() -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *LoadBalancerState) SetLoadBalancerName(v string) *LoadBalancerState { - s.LoadBalancerName = &v - return s -} - -// SetState sets the State field's value. -func (s *LoadBalancerState) SetState(v string) *LoadBalancerState { - s.State = &v - return s -} - -// Describes the state of a target group. -// -// If you attach a target group to an existing Auto Scaling group, the initial -// state is Adding. The state transitions to Added after all Auto Scaling instances -// are registered with the target group. If ELB health checks are enabled, the -// state transitions to InService after at least one Auto Scaling instance passes -// the health check. If EC2 health checks are enabled instead, the target group -// remains in the Added state. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/LoadBalancerTargetGroupState -type LoadBalancerTargetGroupState struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - LoadBalancerTargetGroupARN *string `min:"1" type:"string"` - - // The state of the target group. - // - // * Adding - The Auto Scaling instances are being registered with the target - // group. - // - // * Added - All Auto Scaling instances are registered with the target group. - // - // * InService - At least one Auto Scaling instance passed an ELB health - // check. - // - // * Removing - The Auto Scaling instances are being deregistered from the - // target group. If connection draining is enabled, Elastic Load Balancing - // waits for in-flight requests to complete before deregistering the instances. - // - // * Removed - All Auto Scaling instances are deregistered from the target - // group. - State *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s LoadBalancerTargetGroupState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancerTargetGroupState) GoString() string { - return s.String() -} - -// SetLoadBalancerTargetGroupARN sets the LoadBalancerTargetGroupARN field's value. -func (s *LoadBalancerTargetGroupState) SetLoadBalancerTargetGroupARN(v string) *LoadBalancerTargetGroupState { - s.LoadBalancerTargetGroupARN = &v - return s -} - -// SetState sets the State field's value. -func (s *LoadBalancerTargetGroupState) SetState(v string) *LoadBalancerTargetGroupState { - s.State = &v - return s -} - -// Describes a metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/MetricCollectionType -type MetricCollectionType struct { - _ struct{} `type:"structure"` - - // One of the following metrics: - // - // * GroupMinSize - // - // * GroupMaxSize - // - // * GroupDesiredCapacity - // - // * GroupInServiceInstances - // - // * GroupPendingInstances - // - // * GroupStandbyInstances - // - // * GroupTerminatingInstances - // - // * GroupTotalInstances - Metric *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s MetricCollectionType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricCollectionType) GoString() string { - return s.String() -} - -// SetMetric sets the Metric field's value. -func (s *MetricCollectionType) SetMetric(v string) *MetricCollectionType { - s.Metric = &v - return s -} - -// Describes a granularity of a metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/MetricGranularityType -type MetricGranularityType struct { - _ struct{} `type:"structure"` - - // The granularity. The only valid value is 1Minute. - Granularity *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s MetricGranularityType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricGranularityType) GoString() string { - return s.String() -} - -// SetGranularity sets the Granularity field's value. -func (s *MetricGranularityType) SetGranularity(v string) *MetricGranularityType { - s.Granularity = &v - return s -} - -// Describes a notification. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/NotificationConfiguration -type NotificationConfiguration struct { - _ struct{} `type:"structure"` - - // The name of the group. - AutoScalingGroupName *string `min:"1" type:"string"` - - // One of the following event notification types: - // - // * autoscaling:EC2_INSTANCE_LAUNCH - // - // * autoscaling:EC2_INSTANCE_LAUNCH_ERROR - // - // * autoscaling:EC2_INSTANCE_TERMINATE - // - // * autoscaling:EC2_INSTANCE_TERMINATE_ERROR - // - // * autoscaling:TEST_NOTIFICATION - NotificationType *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service - // (SNS) topic. - TopicARN *string `min:"1" type:"string"` -} - -// 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() -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *NotificationConfiguration) SetAutoScalingGroupName(v string) *NotificationConfiguration { - s.AutoScalingGroupName = &v - return s -} - -// SetNotificationType sets the NotificationType field's value. -func (s *NotificationConfiguration) SetNotificationType(v string) *NotificationConfiguration { - s.NotificationType = &v - return s -} - -// SetTopicARN sets the TopicARN field's value. -func (s *NotificationConfiguration) SetTopicARN(v string) *NotificationConfiguration { - s.TopicARN = &v - return s -} - -// Describes a process type. -// -// For more information, see Auto Scaling Processes (http://docs.aws.amazon.com/autoscaling/latest/userguide/as-suspend-resume-processes.html#process-types) -// in the Auto Scaling User Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ProcessType -type ProcessType struct { - _ struct{} `type:"structure"` - - // One of the following processes: - // - // * Launch - // - // * Terminate - // - // * AddToLoadBalancer - // - // * AlarmNotification - // - // * AZRebalance - // - // * HealthCheck - // - // * ReplaceUnhealthy - // - // * ScheduledActions - // - // ProcessName is a required field - ProcessName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ProcessType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProcessType) GoString() string { - return s.String() -} - -// SetProcessName sets the ProcessName field's value. -func (s *ProcessType) SetProcessName(v string) *ProcessType { - s.ProcessName = &v - return s -} - -// Contains the parameters for PutLifecycleHook. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutLifecycleHookType -type PutLifecycleHookInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group to which you want to assign the lifecycle - // hook. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // Defines the action the Auto Scaling group should take when the lifecycle - // hook timeout elapses or if an unexpected failure occurs. This parameter can - // be either CONTINUE or ABANDON. The default value is ABANDON. - DefaultResult *string `type:"string"` - - // The amount of time, in seconds, that can elapse before the lifecycle hook - // times out. When the lifecycle hook times out, Auto Scaling performs the default - // action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. - // The default is 3600 seconds (1 hour). - HeartbeatTimeout *int64 `type:"integer"` - - // The name of the lifecycle hook. - // - // LifecycleHookName is a required field - LifecycleHookName *string `min:"1" type:"string" required:"true"` - - // The instance state to which you want to attach the lifecycle hook. For a - // list of lifecycle hook types, see DescribeLifecycleHookTypes. - // - // This parameter is required for new lifecycle hooks, but optional when updating - // existing hooks. - LifecycleTransition *string `type:"string"` - - // Contains additional information that you want to include any time Auto Scaling - // sends a message to the notification target. - NotificationMetadata *string `min:"1" type:"string"` - - // The ARN of the notification target that Auto Scaling will use to notify you - // when an instance is in the transition state for the lifecycle hook. This - // target can be either an SQS queue or an SNS topic. If you specify an empty - // string, this overrides the current ARN. - // - // This operation uses the JSON format when sending notifications to an Amazon - // SQS queue, and an email key/value pair format when sending notifications - // to an Amazon SNS topic. - // - // When you specify a notification target, Auto Scaling sends it a test message. - // Test messages contains the following additional key/value pair: "Event": - // "autoscaling:TEST_NOTIFICATION". - NotificationTargetARN *string `type:"string"` - - // The ARN of the IAM role that allows the Auto Scaling group to publish to - // the specified notification target. - // - // This parameter is required for new lifecycle hooks, but optional when updating - // existing hooks. - RoleARN *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PutLifecycleHookInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutLifecycleHookInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutLifecycleHookInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutLifecycleHookInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.LifecycleHookName == nil { - invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) - } - if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) - } - if s.NotificationMetadata != nil && len(*s.NotificationMetadata) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NotificationMetadata", 1)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *PutLifecycleHookInput) SetAutoScalingGroupName(v string) *PutLifecycleHookInput { - s.AutoScalingGroupName = &v - return s -} - -// SetDefaultResult sets the DefaultResult field's value. -func (s *PutLifecycleHookInput) SetDefaultResult(v string) *PutLifecycleHookInput { - s.DefaultResult = &v - return s -} - -// SetHeartbeatTimeout sets the HeartbeatTimeout field's value. -func (s *PutLifecycleHookInput) SetHeartbeatTimeout(v int64) *PutLifecycleHookInput { - s.HeartbeatTimeout = &v - return s -} - -// SetLifecycleHookName sets the LifecycleHookName field's value. -func (s *PutLifecycleHookInput) SetLifecycleHookName(v string) *PutLifecycleHookInput { - s.LifecycleHookName = &v - return s -} - -// SetLifecycleTransition sets the LifecycleTransition field's value. -func (s *PutLifecycleHookInput) SetLifecycleTransition(v string) *PutLifecycleHookInput { - s.LifecycleTransition = &v - return s -} - -// SetNotificationMetadata sets the NotificationMetadata field's value. -func (s *PutLifecycleHookInput) SetNotificationMetadata(v string) *PutLifecycleHookInput { - s.NotificationMetadata = &v - return s -} - -// SetNotificationTargetARN sets the NotificationTargetARN field's value. -func (s *PutLifecycleHookInput) SetNotificationTargetARN(v string) *PutLifecycleHookInput { - s.NotificationTargetARN = &v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *PutLifecycleHookInput) SetRoleARN(v string) *PutLifecycleHookInput { - s.RoleARN = &v - return s -} - -// Contains the output of PutLifecycleHook. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutLifecycleHookAnswer -type PutLifecycleHookOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutLifecycleHookOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutLifecycleHookOutput) GoString() string { - return s.String() -} - -// Contains the parameters for PutNotificationConfiguration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutNotificationConfigurationType -type PutNotificationConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The type of event that will cause the notification to be sent. For details - // about notification types supported by Auto Scaling, see DescribeAutoScalingNotificationTypes. - // - // NotificationTypes is a required field - NotificationTypes []*string `type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service - // (SNS) topic. - // - // TopicARN is a required field - TopicARN *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutNotificationConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutNotificationConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutNotificationConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutNotificationConfigurationInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.NotificationTypes == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationTypes")) - } - if s.TopicARN == nil { - invalidParams.Add(request.NewErrParamRequired("TopicARN")) - } - if s.TopicARN != nil && len(*s.TopicARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *PutNotificationConfigurationInput) SetAutoScalingGroupName(v string) *PutNotificationConfigurationInput { - s.AutoScalingGroupName = &v - return s -} - -// SetNotificationTypes sets the NotificationTypes field's value. -func (s *PutNotificationConfigurationInput) SetNotificationTypes(v []*string) *PutNotificationConfigurationInput { - s.NotificationTypes = v - return s -} - -// SetTopicARN sets the TopicARN field's value. -func (s *PutNotificationConfigurationInput) SetTopicARN(v string) *PutNotificationConfigurationInput { - s.TopicARN = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutNotificationConfigurationOutput -type PutNotificationConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutNotificationConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutNotificationConfigurationOutput) GoString() string { - return s.String() -} - -// Contains the parameters for PutScalingPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScalingPolicyType -type PutScalingPolicyInput struct { - _ struct{} `type:"structure"` - - // The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and - // PercentChangeInCapacity. - // - // For more information, see Dynamic Scaling (http://docs.aws.amazon.com/autoscaling/latest/userguide/as-scale-based-on-demand.html) - // in the Auto Scaling User Guide. - // - // AdjustmentType is a required field - AdjustmentType *string `min:"1" type:"string" required:"true"` - - // The name or ARN of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The amount of time, in seconds, after a scaling activity completes and before - // the next scaling activity can start. If this parameter is not specified, - // the default cooldown period for the group applies. - // - // This parameter is not supported unless the policy type is SimpleScaling. - // - // For more information, see Auto Scaling Cooldowns (http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html) - // in the Auto Scaling User Guide. - Cooldown *int64 `type:"integer"` - - // The estimated time, in seconds, until a newly launched instance can contribute - // to the CloudWatch metrics. The default is to use the value specified for - // the default cooldown period for the group. - // - // This parameter is not supported if the policy type is SimpleScaling. - EstimatedInstanceWarmup *int64 `type:"integer"` - - // The aggregation type for the CloudWatch metrics. Valid values are Minimum, - // Maximum, and Average. If the aggregation type is null, the value is treated - // as Average. - // - // This parameter is not supported if the policy type is SimpleScaling. - MetricAggregationType *string `min:"1" type:"string"` - - // The minimum number of instances to scale. If the value of AdjustmentType - // is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity - // of the Auto Scaling group by at least this many instances. Otherwise, the - // error is ValidationError. - MinAdjustmentMagnitude *int64 `type:"integer"` - - // Available for backward compatibility. Use MinAdjustmentMagnitude instead. - MinAdjustmentStep *int64 `deprecated:"true" type:"integer"` - - // The name of the policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The policy type. Valid values are SimpleScaling and StepScaling. If the policy - // type is null, the value is treated as SimpleScaling. - PolicyType *string `min:"1" type:"string"` - - // The amount by which to scale, based on the specified adjustment type. A positive - // value adds to the current capacity while a negative number removes from the - // current capacity. - // - // This parameter is required if the policy type is SimpleScaling and not supported - // otherwise. - ScalingAdjustment *int64 `type:"integer"` - - // A set of adjustments that enable you to scale based on the size of the alarm - // breach. - // - // This parameter is required if the policy type is StepScaling and not supported - // otherwise. - StepAdjustments []*StepAdjustment `type:"list"` -} - -// String returns the string representation -func (s PutScalingPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutScalingPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutScalingPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutScalingPolicyInput"} - if s.AdjustmentType == nil { - invalidParams.Add(request.NewErrParamRequired("AdjustmentType")) - } - if s.AdjustmentType != nil && len(*s.AdjustmentType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdjustmentType", 1)) - } - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.MetricAggregationType != nil && len(*s.MetricAggregationType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricAggregationType", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.PolicyType != nil && len(*s.PolicyType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyType", 1)) - } - if s.StepAdjustments != nil { - for i, v := range s.StepAdjustments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StepAdjustments", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdjustmentType sets the AdjustmentType field's value. -func (s *PutScalingPolicyInput) SetAdjustmentType(v string) *PutScalingPolicyInput { - s.AdjustmentType = &v - return s -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *PutScalingPolicyInput) SetAutoScalingGroupName(v string) *PutScalingPolicyInput { - s.AutoScalingGroupName = &v - return s -} - -// SetCooldown sets the Cooldown field's value. -func (s *PutScalingPolicyInput) SetCooldown(v int64) *PutScalingPolicyInput { - s.Cooldown = &v - return s -} - -// SetEstimatedInstanceWarmup sets the EstimatedInstanceWarmup field's value. -func (s *PutScalingPolicyInput) SetEstimatedInstanceWarmup(v int64) *PutScalingPolicyInput { - s.EstimatedInstanceWarmup = &v - return s -} - -// SetMetricAggregationType sets the MetricAggregationType field's value. -func (s *PutScalingPolicyInput) SetMetricAggregationType(v string) *PutScalingPolicyInput { - s.MetricAggregationType = &v - return s -} - -// SetMinAdjustmentMagnitude sets the MinAdjustmentMagnitude field's value. -func (s *PutScalingPolicyInput) SetMinAdjustmentMagnitude(v int64) *PutScalingPolicyInput { - s.MinAdjustmentMagnitude = &v - return s -} - -// SetMinAdjustmentStep sets the MinAdjustmentStep field's value. -func (s *PutScalingPolicyInput) SetMinAdjustmentStep(v int64) *PutScalingPolicyInput { - s.MinAdjustmentStep = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PutScalingPolicyInput) SetPolicyName(v string) *PutScalingPolicyInput { - s.PolicyName = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *PutScalingPolicyInput) SetPolicyType(v string) *PutScalingPolicyInput { - s.PolicyType = &v - return s -} - -// SetScalingAdjustment sets the ScalingAdjustment field's value. -func (s *PutScalingPolicyInput) SetScalingAdjustment(v int64) *PutScalingPolicyInput { - s.ScalingAdjustment = &v - return s -} - -// SetStepAdjustments sets the StepAdjustments field's value. -func (s *PutScalingPolicyInput) SetStepAdjustments(v []*StepAdjustment) *PutScalingPolicyInput { - s.StepAdjustments = v - return s -} - -// Contains the output of PutScalingPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PolicyARNType -type PutScalingPolicyOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the policy. - PolicyARN *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PutScalingPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutScalingPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicyARN sets the PolicyARN field's value. -func (s *PutScalingPolicyOutput) SetPolicyARN(v string) *PutScalingPolicyOutput { - s.PolicyARN = &v - return s -} - -// Contains the parameters for PutScheduledUpdateGroupAction. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScheduledUpdateGroupActionType -type PutScheduledUpdateGroupActionInput struct { - _ struct{} `type:"structure"` - - // The name or Amazon Resource Name (ARN) of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The number of EC2 instances that should be running in the group. - DesiredCapacity *int64 `type:"integer"` - - // The time for the recurring schedule to end. Auto Scaling does not perform - // the action after this time. - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The maximum size for the Auto Scaling group. - MaxSize *int64 `type:"integer"` - - // The minimum size for the Auto Scaling group. - MinSize *int64 `type:"integer"` - - // The recurring schedule for this action, in Unix cron syntax format. For more - // information, see Cron (http://en.wikipedia.org/wiki/Cron) in Wikipedia. - Recurrence *string `min:"1" type:"string"` - - // The name of this scaling action. - // - // ScheduledActionName is a required field - ScheduledActionName *string `min:"1" type:"string" required:"true"` - - // The time for this action to start, in "YYYY-MM-DDThh:mm:ssZ" format in UTC/GMT - // only (for example, 2014-06-01T00:00:00Z). - // - // If you specify Recurrence and StartTime, Auto Scaling performs the action - // at this time, and then performs the action based on the specified recurrence. - // - // If you try to schedule your action in the past, Auto Scaling returns an error - // message. - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // This parameter is deprecated. - Time *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s PutScheduledUpdateGroupActionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutScheduledUpdateGroupActionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutScheduledUpdateGroupActionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutScheduledUpdateGroupActionInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.Recurrence != nil && len(*s.Recurrence) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Recurrence", 1)) - } - if s.ScheduledActionName == nil { - invalidParams.Add(request.NewErrParamRequired("ScheduledActionName")) - } - if s.ScheduledActionName != nil && len(*s.ScheduledActionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduledActionName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *PutScheduledUpdateGroupActionInput) SetAutoScalingGroupName(v string) *PutScheduledUpdateGroupActionInput { - s.AutoScalingGroupName = &v - return s -} - -// SetDesiredCapacity sets the DesiredCapacity field's value. -func (s *PutScheduledUpdateGroupActionInput) SetDesiredCapacity(v int64) *PutScheduledUpdateGroupActionInput { - s.DesiredCapacity = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *PutScheduledUpdateGroupActionInput) SetEndTime(v time.Time) *PutScheduledUpdateGroupActionInput { - s.EndTime = &v - return s -} - -// SetMaxSize sets the MaxSize field's value. -func (s *PutScheduledUpdateGroupActionInput) SetMaxSize(v int64) *PutScheduledUpdateGroupActionInput { - s.MaxSize = &v - return s -} - -// SetMinSize sets the MinSize field's value. -func (s *PutScheduledUpdateGroupActionInput) SetMinSize(v int64) *PutScheduledUpdateGroupActionInput { - s.MinSize = &v - return s -} - -// SetRecurrence sets the Recurrence field's value. -func (s *PutScheduledUpdateGroupActionInput) SetRecurrence(v string) *PutScheduledUpdateGroupActionInput { - s.Recurrence = &v - return s -} - -// SetScheduledActionName sets the ScheduledActionName field's value. -func (s *PutScheduledUpdateGroupActionInput) SetScheduledActionName(v string) *PutScheduledUpdateGroupActionInput { - s.ScheduledActionName = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *PutScheduledUpdateGroupActionInput) SetStartTime(v time.Time) *PutScheduledUpdateGroupActionInput { - s.StartTime = &v - return s -} - -// SetTime sets the Time field's value. -func (s *PutScheduledUpdateGroupActionInput) SetTime(v time.Time) *PutScheduledUpdateGroupActionInput { - s.Time = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScheduledUpdateGroupActionOutput -type PutScheduledUpdateGroupActionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutScheduledUpdateGroupActionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutScheduledUpdateGroupActionOutput) GoString() string { - return s.String() -} - -// Contains the parameters for RecordLifecycleActionHeartbeat. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeatType -type RecordLifecycleActionHeartbeatInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group for the hook. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The ID of the instance. - InstanceId *string `min:"1" type:"string"` - - // A token that uniquely identifies a specific lifecycle action associated with - // an instance. Auto Scaling sends this token to the notification target you - // specified when you created the lifecycle hook. - LifecycleActionToken *string `min:"36" type:"string"` - - // The name of the lifecycle hook. - // - // LifecycleHookName is a required field - LifecycleHookName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RecordLifecycleActionHeartbeatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RecordLifecycleActionHeartbeatInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RecordLifecycleActionHeartbeatInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RecordLifecycleActionHeartbeatInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.InstanceId != nil && len(*s.InstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) - } - if s.LifecycleActionToken != nil && len(*s.LifecycleActionToken) < 36 { - invalidParams.Add(request.NewErrParamMinLen("LifecycleActionToken", 36)) - } - if s.LifecycleHookName == nil { - invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) - } - if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *RecordLifecycleActionHeartbeatInput) SetAutoScalingGroupName(v string) *RecordLifecycleActionHeartbeatInput { - s.AutoScalingGroupName = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *RecordLifecycleActionHeartbeatInput) SetInstanceId(v string) *RecordLifecycleActionHeartbeatInput { - s.InstanceId = &v - return s -} - -// SetLifecycleActionToken sets the LifecycleActionToken field's value. -func (s *RecordLifecycleActionHeartbeatInput) SetLifecycleActionToken(v string) *RecordLifecycleActionHeartbeatInput { - s.LifecycleActionToken = &v - return s -} - -// SetLifecycleHookName sets the LifecycleHookName field's value. -func (s *RecordLifecycleActionHeartbeatInput) SetLifecycleHookName(v string) *RecordLifecycleActionHeartbeatInput { - s.LifecycleHookName = &v - return s -} - -// Contains the output of RecordLifecycleActionHeartBeat. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeatAnswer -type RecordLifecycleActionHeartbeatOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RecordLifecycleActionHeartbeatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RecordLifecycleActionHeartbeatOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ResumeProcessesOutput -type ResumeProcessesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResumeProcessesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResumeProcessesOutput) GoString() string { - return s.String() -} - -// Describes a scaling policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ScalingPolicy -type ScalingPolicy struct { - _ struct{} `type:"structure"` - - // The adjustment type, which specifies how ScalingAdjustment is interpreted. - // Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity. - AdjustmentType *string `min:"1" type:"string"` - - // The CloudWatch alarms related to the policy. - Alarms []*Alarm `type:"list"` - - // The name of the Auto Scaling group associated with this scaling policy. - AutoScalingGroupName *string `min:"1" type:"string"` - - // The amount of time, in seconds, after a scaling activity completes before - // any further trigger-related scaling activities can start. - Cooldown *int64 `type:"integer"` - - // The estimated time, in seconds, until a newly launched instance can contribute - // to the CloudWatch metrics. - EstimatedInstanceWarmup *int64 `type:"integer"` - - // The aggregation type for the CloudWatch metrics. Valid values are Minimum, - // Maximum, and Average. - MetricAggregationType *string `min:"1" type:"string"` - - // The minimum number of instances to scale. If the value of AdjustmentType - // is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity - // of the Auto Scaling group by at least this many instances. Otherwise, the - // error is ValidationError. - MinAdjustmentMagnitude *int64 `type:"integer"` - - // Available for backward compatibility. Use MinAdjustmentMagnitude instead. - MinAdjustmentStep *int64 `deprecated:"true" type:"integer"` - - // The Amazon Resource Name (ARN) of the policy. - PolicyARN *string `min:"1" type:"string"` - - // The name of the scaling policy. - PolicyName *string `min:"1" type:"string"` - - // The policy type. Valid values are SimpleScaling and StepScaling. - PolicyType *string `min:"1" type:"string"` - - // The amount by which to scale, based on the specified adjustment type. A positive - // value adds to the current capacity while a negative number removes from the - // current capacity. - ScalingAdjustment *int64 `type:"integer"` - - // A set of adjustments that enable you to scale based on the size of the alarm - // breach. - StepAdjustments []*StepAdjustment `type:"list"` -} - -// String returns the string representation -func (s ScalingPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingPolicy) GoString() string { - return s.String() -} - -// SetAdjustmentType sets the AdjustmentType field's value. -func (s *ScalingPolicy) SetAdjustmentType(v string) *ScalingPolicy { - s.AdjustmentType = &v - return s -} - -// SetAlarms sets the Alarms field's value. -func (s *ScalingPolicy) SetAlarms(v []*Alarm) *ScalingPolicy { - s.Alarms = v - return s -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *ScalingPolicy) SetAutoScalingGroupName(v string) *ScalingPolicy { - s.AutoScalingGroupName = &v - return s -} - -// SetCooldown sets the Cooldown field's value. -func (s *ScalingPolicy) SetCooldown(v int64) *ScalingPolicy { - s.Cooldown = &v - return s -} - -// SetEstimatedInstanceWarmup sets the EstimatedInstanceWarmup field's value. -func (s *ScalingPolicy) SetEstimatedInstanceWarmup(v int64) *ScalingPolicy { - s.EstimatedInstanceWarmup = &v - return s -} - -// SetMetricAggregationType sets the MetricAggregationType field's value. -func (s *ScalingPolicy) SetMetricAggregationType(v string) *ScalingPolicy { - s.MetricAggregationType = &v - return s -} - -// SetMinAdjustmentMagnitude sets the MinAdjustmentMagnitude field's value. -func (s *ScalingPolicy) SetMinAdjustmentMagnitude(v int64) *ScalingPolicy { - s.MinAdjustmentMagnitude = &v - return s -} - -// SetMinAdjustmentStep sets the MinAdjustmentStep field's value. -func (s *ScalingPolicy) SetMinAdjustmentStep(v int64) *ScalingPolicy { - s.MinAdjustmentStep = &v - return s -} - -// SetPolicyARN sets the PolicyARN field's value. -func (s *ScalingPolicy) SetPolicyARN(v string) *ScalingPolicy { - s.PolicyARN = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *ScalingPolicy) SetPolicyName(v string) *ScalingPolicy { - s.PolicyName = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *ScalingPolicy) SetPolicyType(v string) *ScalingPolicy { - s.PolicyType = &v - return s -} - -// SetScalingAdjustment sets the ScalingAdjustment field's value. -func (s *ScalingPolicy) SetScalingAdjustment(v int64) *ScalingPolicy { - s.ScalingAdjustment = &v - return s -} - -// SetStepAdjustments sets the StepAdjustments field's value. -func (s *ScalingPolicy) SetStepAdjustments(v []*StepAdjustment) *ScalingPolicy { - s.StepAdjustments = v - return s -} - -// Contains the parameters for SuspendProcesses and ResumeProcesses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ScalingProcessQuery -type ScalingProcessQuery struct { - _ struct{} `type:"structure"` - - // The name or Amazon Resource Name (ARN) of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more of the following processes. If you omit this parameter, all processes - // are specified. - // - // * Launch - // - // * Terminate - // - // * HealthCheck - // - // * ReplaceUnhealthy - // - // * AZRebalance - // - // * AlarmNotification - // - // * ScheduledActions - // - // * AddToLoadBalancer - ScalingProcesses []*string `type:"list"` -} - -// String returns the string representation -func (s ScalingProcessQuery) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingProcessQuery) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScalingProcessQuery) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScalingProcessQuery"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *ScalingProcessQuery) SetAutoScalingGroupName(v string) *ScalingProcessQuery { - s.AutoScalingGroupName = &v - return s -} - -// SetScalingProcesses sets the ScalingProcesses field's value. -func (s *ScalingProcessQuery) SetScalingProcesses(v []*string) *ScalingProcessQuery { - s.ScalingProcesses = v - return s -} - -// Describes a scheduled update to an Auto Scaling group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ScheduledUpdateGroupAction -type ScheduledUpdateGroupAction struct { - _ struct{} `type:"structure"` - - // The name of the group. - AutoScalingGroupName *string `min:"1" type:"string"` - - // The number of instances you prefer to maintain in the group. - DesiredCapacity *int64 `type:"integer"` - - // The date and time that the action is scheduled to end. This date and time - // can be up to one month in the future. - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The maximum size of the group. - MaxSize *int64 `type:"integer"` - - // The minimum size of the group. - MinSize *int64 `type:"integer"` - - // The recurring schedule for the action. - Recurrence *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the scheduled action. - ScheduledActionARN *string `min:"1" type:"string"` - - // The name of the scheduled action. - ScheduledActionName *string `min:"1" type:"string"` - - // The date and time that the action is scheduled to begin. This date and time - // can be up to one month in the future. - // - // When StartTime and EndTime are specified with Recurrence, they form the boundaries - // of when the recurring action will start and stop. - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // This parameter is deprecated. - Time *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ScheduledUpdateGroupAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledUpdateGroupAction) GoString() string { - return s.String() -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *ScheduledUpdateGroupAction) SetAutoScalingGroupName(v string) *ScheduledUpdateGroupAction { - s.AutoScalingGroupName = &v - return s -} - -// SetDesiredCapacity sets the DesiredCapacity field's value. -func (s *ScheduledUpdateGroupAction) SetDesiredCapacity(v int64) *ScheduledUpdateGroupAction { - s.DesiredCapacity = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *ScheduledUpdateGroupAction) SetEndTime(v time.Time) *ScheduledUpdateGroupAction { - s.EndTime = &v - return s -} - -// SetMaxSize sets the MaxSize field's value. -func (s *ScheduledUpdateGroupAction) SetMaxSize(v int64) *ScheduledUpdateGroupAction { - s.MaxSize = &v - return s -} - -// SetMinSize sets the MinSize field's value. -func (s *ScheduledUpdateGroupAction) SetMinSize(v int64) *ScheduledUpdateGroupAction { - s.MinSize = &v - return s -} - -// SetRecurrence sets the Recurrence field's value. -func (s *ScheduledUpdateGroupAction) SetRecurrence(v string) *ScheduledUpdateGroupAction { - s.Recurrence = &v - return s -} - -// SetScheduledActionARN sets the ScheduledActionARN field's value. -func (s *ScheduledUpdateGroupAction) SetScheduledActionARN(v string) *ScheduledUpdateGroupAction { - s.ScheduledActionARN = &v - return s -} - -// SetScheduledActionName sets the ScheduledActionName field's value. -func (s *ScheduledUpdateGroupAction) SetScheduledActionName(v string) *ScheduledUpdateGroupAction { - s.ScheduledActionName = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ScheduledUpdateGroupAction) SetStartTime(v time.Time) *ScheduledUpdateGroupAction { - s.StartTime = &v - return s -} - -// SetTime sets the Time field's value. -func (s *ScheduledUpdateGroupAction) SetTime(v time.Time) *ScheduledUpdateGroupAction { - s.Time = &v - return s -} - -// Contains the parameters for SetDesiredCapacity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetDesiredCapacityType -type SetDesiredCapacityInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // The number of EC2 instances that should be running in the Auto Scaling group. - // - // DesiredCapacity is a required field - DesiredCapacity *int64 `type:"integer" required:"true"` - - // By default, SetDesiredCapacity overrides any cooldown period associated with - // the Auto Scaling group. Specify True to make Auto Scaling to wait for the - // cool-down period associated with the Auto Scaling group to complete before - // initiating a scaling activity to set your Auto Scaling group to its new capacity. - HonorCooldown *bool `type:"boolean"` -} - -// String returns the string representation -func (s SetDesiredCapacityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetDesiredCapacityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetDesiredCapacityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetDesiredCapacityInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.DesiredCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("DesiredCapacity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *SetDesiredCapacityInput) SetAutoScalingGroupName(v string) *SetDesiredCapacityInput { - s.AutoScalingGroupName = &v - return s -} - -// SetDesiredCapacity sets the DesiredCapacity field's value. -func (s *SetDesiredCapacityInput) SetDesiredCapacity(v int64) *SetDesiredCapacityInput { - s.DesiredCapacity = &v - return s -} - -// SetHonorCooldown sets the HonorCooldown field's value. -func (s *SetDesiredCapacityInput) SetHonorCooldown(v bool) *SetDesiredCapacityInput { - s.HonorCooldown = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetDesiredCapacityOutput -type SetDesiredCapacityOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetDesiredCapacityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetDesiredCapacityOutput) GoString() string { - return s.String() -} - -// Contains the parameters for SetInstanceHealth. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceHealthQuery -type SetInstanceHealthInput struct { - _ struct{} `type:"structure"` - - // The health status of the instance. Set to Healthy if you want the instance - // to remain in service. Set to Unhealthy if you want the instance to be out - // of service. Auto Scaling will terminate and replace the unhealthy instance. - // - // HealthStatus is a required field - HealthStatus *string `min:"1" type:"string" required:"true"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `min:"1" type:"string" required:"true"` - - // If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod - // specified for the group, by default, this call will respect the grace period. - // Set this to False, if you do not want the call to respect the grace period - // associated with the group. - // - // For more information, see the description of the health check grace period - // for CreateAutoScalingGroup. - ShouldRespectGracePeriod *bool `type:"boolean"` -} - -// String returns the string representation -func (s SetInstanceHealthInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetInstanceHealthInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetInstanceHealthInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetInstanceHealthInput"} - if s.HealthStatus == nil { - invalidParams.Add(request.NewErrParamRequired("HealthStatus")) - } - if s.HealthStatus != nil && len(*s.HealthStatus) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HealthStatus", 1)) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.InstanceId != nil && len(*s.InstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthStatus sets the HealthStatus field's value. -func (s *SetInstanceHealthInput) SetHealthStatus(v string) *SetInstanceHealthInput { - s.HealthStatus = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *SetInstanceHealthInput) SetInstanceId(v string) *SetInstanceHealthInput { - s.InstanceId = &v - return s -} - -// SetShouldRespectGracePeriod sets the ShouldRespectGracePeriod field's value. -func (s *SetInstanceHealthInput) SetShouldRespectGracePeriod(v bool) *SetInstanceHealthInput { - s.ShouldRespectGracePeriod = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceHealthOutput -type SetInstanceHealthOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetInstanceHealthOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetInstanceHealthOutput) GoString() string { - return s.String() -} - -// Contains the parameters for SetInstanceProtection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceProtectionQuery -type SetInstanceProtectionInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `type:"list" required:"true"` - - // Indicates whether the instance is protected from termination by Auto Scaling - // when scaling in. - // - // ProtectedFromScaleIn is a required field - ProtectedFromScaleIn *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s SetInstanceProtectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetInstanceProtectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetInstanceProtectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetInstanceProtectionInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - if s.ProtectedFromScaleIn == nil { - invalidParams.Add(request.NewErrParamRequired("ProtectedFromScaleIn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *SetInstanceProtectionInput) SetAutoScalingGroupName(v string) *SetInstanceProtectionInput { - s.AutoScalingGroupName = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *SetInstanceProtectionInput) SetInstanceIds(v []*string) *SetInstanceProtectionInput { - s.InstanceIds = v - return s -} - -// SetProtectedFromScaleIn sets the ProtectedFromScaleIn field's value. -func (s *SetInstanceProtectionInput) SetProtectedFromScaleIn(v bool) *SetInstanceProtectionInput { - s.ProtectedFromScaleIn = &v - return s -} - -// Contains the output of SetInstanceProtection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceProtectionAnswer -type SetInstanceProtectionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetInstanceProtectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetInstanceProtectionOutput) GoString() string { - return s.String() -} - -// Describes an adjustment based on the difference between the value of the -// aggregated CloudWatch metric and the breach threshold that you've defined -// for the alarm. -// -// For the following examples, suppose that you have an alarm with a breach -// threshold of 50: -// -// * If you want the adjustment to be triggered when the metric is greater -// than or equal to 50 and less than 60, specify a lower bound of 0 and an -// upper bound of 10. -// -// * If you want the adjustment to be triggered when the metric is greater -// than 40 and less than or equal to 50, specify a lower bound of -10 and -// an upper bound of 0. -// -// There are a few rules for the step adjustments for your step policy: -// -// * The ranges of your step adjustments can't overlap or have a gap. -// -// * At most one step adjustment can have a null lower bound. If one step -// adjustment has a negative lower bound, then there must be a step adjustment -// with a null lower bound. -// -// * At most one step adjustment can have a null upper bound. If one step -// adjustment has a positive upper bound, then there must be a step adjustment -// with a null upper bound. -// -// * The upper and lower bound can't be null in the same step adjustment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/StepAdjustment -type StepAdjustment struct { - _ struct{} `type:"structure"` - - // The lower bound for the difference between the alarm threshold and the CloudWatch - // metric. If the metric value is above the breach threshold, the lower bound - // is inclusive (the metric must be greater than or equal to the threshold plus - // the lower bound). Otherwise, it is exclusive (the metric must be greater - // than the threshold plus the lower bound). A null value indicates negative - // infinity. - MetricIntervalLowerBound *float64 `type:"double"` - - // The upper bound for the difference between the alarm threshold and the CloudWatch - // metric. If the metric value is above the breach threshold, the upper bound - // is exclusive (the metric must be less than the threshold plus the upper bound). - // Otherwise, it is inclusive (the metric must be less than or equal to the - // threshold plus the upper bound). A null value indicates positive infinity. - // - // The upper bound must be greater than the lower bound. - MetricIntervalUpperBound *float64 `type:"double"` - - // The amount by which to scale, based on the specified adjustment type. A positive - // value adds to the current capacity while a negative number removes from the - // current capacity. - // - // ScalingAdjustment is a required field - ScalingAdjustment *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s StepAdjustment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepAdjustment) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StepAdjustment) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StepAdjustment"} - if s.ScalingAdjustment == nil { - invalidParams.Add(request.NewErrParamRequired("ScalingAdjustment")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetricIntervalLowerBound sets the MetricIntervalLowerBound field's value. -func (s *StepAdjustment) SetMetricIntervalLowerBound(v float64) *StepAdjustment { - s.MetricIntervalLowerBound = &v - return s -} - -// SetMetricIntervalUpperBound sets the MetricIntervalUpperBound field's value. -func (s *StepAdjustment) SetMetricIntervalUpperBound(v float64) *StepAdjustment { - s.MetricIntervalUpperBound = &v - return s -} - -// SetScalingAdjustment sets the ScalingAdjustment field's value. -func (s *StepAdjustment) SetScalingAdjustment(v int64) *StepAdjustment { - s.ScalingAdjustment = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SuspendProcessesOutput -type SuspendProcessesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SuspendProcessesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SuspendProcessesOutput) GoString() string { - return s.String() -} - -// Describes an Auto Scaling process that has been suspended. For more information, -// see ProcessType. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SuspendedProcess -type SuspendedProcess struct { - _ struct{} `type:"structure"` - - // The name of the suspended process. - ProcessName *string `min:"1" type:"string"` - - // The reason that the process was suspended. - SuspensionReason *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s SuspendedProcess) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SuspendedProcess) GoString() string { - return s.String() -} - -// SetProcessName sets the ProcessName field's value. -func (s *SuspendedProcess) SetProcessName(v string) *SuspendedProcess { - s.ProcessName = &v - return s -} - -// SetSuspensionReason sets the SuspensionReason field's value. -func (s *SuspendedProcess) SetSuspensionReason(v string) *SuspendedProcess { - s.SuspensionReason = &v - return s -} - -// Describes a tag for an Auto Scaling group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The tag key. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // Determines whether the tag is added to new instances as they are launched - // in the group. - PropagateAtLaunch *bool `type:"boolean"` - - // The name of the group. - ResourceId *string `type:"string"` - - // The type of resource. The only supported value is auto-scaling-group. - ResourceType *string `type:"string"` - - // The tag value. - 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 -} - -// SetPropagateAtLaunch sets the PropagateAtLaunch field's value. -func (s *Tag) SetPropagateAtLaunch(v bool) *Tag { - s.PropagateAtLaunch = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *Tag) SetResourceId(v string) *Tag { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Tag) SetResourceType(v string) *Tag { - s.ResourceType = &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 for an Auto Scaling group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/TagDescription -type TagDescription struct { - _ struct{} `type:"structure"` - - // The tag key. - Key *string `min:"1" type:"string"` - - // Determines whether the tag is added to new instances as they are launched - // in the group. - PropagateAtLaunch *bool `type:"boolean"` - - // The name of the group. - ResourceId *string `type:"string"` - - // The type of resource. The only supported value is auto-scaling-group. - ResourceType *string `type:"string"` - - // The tag value. - Value *string `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 -} - -// SetPropagateAtLaunch sets the PropagateAtLaunch field's value. -func (s *TagDescription) SetPropagateAtLaunch(v bool) *TagDescription { - s.PropagateAtLaunch = &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 -} - -// Contains the parameters for TerminateInstanceInAutoScalingGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/TerminateInstanceInAutoScalingGroupType -type TerminateInstanceInAutoScalingGroupInput struct { - _ struct{} `type:"structure"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `min:"1" type:"string" required:"true"` - - // If true, terminating the instance also decrements the size of the Auto Scaling - // group. - // - // ShouldDecrementDesiredCapacity is a required field - ShouldDecrementDesiredCapacity *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s TerminateInstanceInAutoScalingGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateInstanceInAutoScalingGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TerminateInstanceInAutoScalingGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TerminateInstanceInAutoScalingGroupInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.InstanceId != nil && len(*s.InstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) - } - if s.ShouldDecrementDesiredCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("ShouldDecrementDesiredCapacity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *TerminateInstanceInAutoScalingGroupInput) SetInstanceId(v string) *TerminateInstanceInAutoScalingGroupInput { - s.InstanceId = &v - return s -} - -// SetShouldDecrementDesiredCapacity sets the ShouldDecrementDesiredCapacity field's value. -func (s *TerminateInstanceInAutoScalingGroupInput) SetShouldDecrementDesiredCapacity(v bool) *TerminateInstanceInAutoScalingGroupInput { - s.ShouldDecrementDesiredCapacity = &v - return s -} - -// Contains the output of TerminateInstancesInAutoScalingGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ActivityType -type TerminateInstanceInAutoScalingGroupOutput struct { - _ struct{} `type:"structure"` - - // A scaling activity. - Activity *Activity `type:"structure"` -} - -// String returns the string representation -func (s TerminateInstanceInAutoScalingGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateInstanceInAutoScalingGroupOutput) GoString() string { - return s.String() -} - -// SetActivity sets the Activity field's value. -func (s *TerminateInstanceInAutoScalingGroupOutput) SetActivity(v *Activity) *TerminateInstanceInAutoScalingGroupOutput { - s.Activity = v - return s -} - -// Contains the parameters for UpdateAutoScalingGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/UpdateAutoScalingGroupType -type UpdateAutoScalingGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the Auto Scaling group. - // - // AutoScalingGroupName is a required field - AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - - // One or more Availability Zones for the group. - AvailabilityZones []*string `min:"1" type:"list"` - - // The amount of time, in seconds, after a scaling activity completes before - // another scaling activity can start. The default is 300. - // - // For more information, see Auto Scaling Cooldowns (http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html) - // in the Auto Scaling User Guide. - DefaultCooldown *int64 `type:"integer"` - - // The number of EC2 instances that should be running in the Auto Scaling group. - // This number must be greater than or equal to the minimum size of the group - // and less than or equal to the maximum size of the group. - DesiredCapacity *int64 `type:"integer"` - - // The amount of time, in seconds, that Auto Scaling waits before checking the - // health status of an EC2 instance that has come into service. The default - // is 0. - // - // For more information, see Health Checks (http://docs.aws.amazon.com/autoscaling/latest/userguide/healthcheck.html) - // in the Auto Scaling User Guide. - HealthCheckGracePeriod *int64 `type:"integer"` - - // The service to use for the health checks. The valid values are EC2 and ELB. - HealthCheckType *string `min:"1" type:"string"` - - // The name of the launch configuration. - LaunchConfigurationName *string `min:"1" type:"string"` - - // The maximum size of the Auto Scaling group. - MaxSize *int64 `type:"integer"` - - // The minimum size of the Auto Scaling group. - MinSize *int64 `type:"integer"` - - // Indicates whether newly launched instances are protected from termination - // by Auto Scaling when scaling in. - NewInstancesProtectedFromScaleIn *bool `type:"boolean"` - - // The name of the placement group into which you'll launch your instances, - // if any. For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) - // in the Amazon Elastic Compute Cloud User Guide. - PlacementGroup *string `min:"1" type:"string"` - - // A standalone termination policy or a list of termination policies used to - // select the instance to terminate. The policies are executed in the order - // that they are listed. - // - // For more information, see Controlling Which Instances Auto Scaling Terminates - // During Scale In (http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html) - // in the Auto Scaling User Guide. - TerminationPolicies []*string `type:"list"` - - // The ID of the subnet, if you are launching into a VPC. You can specify several - // subnets in a comma-separated list. - // - // When you specify VPCZoneIdentifier with AvailabilityZones, ensure that the - // subnets' Availability Zones match the values you specify for AvailabilityZones. - // - // For more information, see Launching Auto Scaling Instances in a VPC (http://docs.aws.amazon.com/autoscaling/latest/userguide/asg-in-vpc.html) - // in the Auto Scaling User Guide. - VPCZoneIdentifier *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateAutoScalingGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAutoScalingGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAutoScalingGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAutoScalingGroupInput"} - if s.AutoScalingGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) - } - if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) - } - if s.AvailabilityZones != nil && len(s.AvailabilityZones) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AvailabilityZones", 1)) - } - if s.HealthCheckType != nil && len(*s.HealthCheckType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HealthCheckType", 1)) - } - if s.LaunchConfigurationName != nil && len(*s.LaunchConfigurationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LaunchConfigurationName", 1)) - } - if s.PlacementGroup != nil && len(*s.PlacementGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PlacementGroup", 1)) - } - if s.VPCZoneIdentifier != nil && len(*s.VPCZoneIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VPCZoneIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *UpdateAutoScalingGroupInput) SetAutoScalingGroupName(v string) *UpdateAutoScalingGroupInput { - s.AutoScalingGroupName = &v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *UpdateAutoScalingGroupInput) SetAvailabilityZones(v []*string) *UpdateAutoScalingGroupInput { - s.AvailabilityZones = v - return s -} - -// SetDefaultCooldown sets the DefaultCooldown field's value. -func (s *UpdateAutoScalingGroupInput) SetDefaultCooldown(v int64) *UpdateAutoScalingGroupInput { - s.DefaultCooldown = &v - return s -} - -// SetDesiredCapacity sets the DesiredCapacity field's value. -func (s *UpdateAutoScalingGroupInput) SetDesiredCapacity(v int64) *UpdateAutoScalingGroupInput { - s.DesiredCapacity = &v - return s -} - -// SetHealthCheckGracePeriod sets the HealthCheckGracePeriod field's value. -func (s *UpdateAutoScalingGroupInput) SetHealthCheckGracePeriod(v int64) *UpdateAutoScalingGroupInput { - s.HealthCheckGracePeriod = &v - return s -} - -// SetHealthCheckType sets the HealthCheckType field's value. -func (s *UpdateAutoScalingGroupInput) SetHealthCheckType(v string) *UpdateAutoScalingGroupInput { - s.HealthCheckType = &v - return s -} - -// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. -func (s *UpdateAutoScalingGroupInput) SetLaunchConfigurationName(v string) *UpdateAutoScalingGroupInput { - s.LaunchConfigurationName = &v - return s -} - -// SetMaxSize sets the MaxSize field's value. -func (s *UpdateAutoScalingGroupInput) SetMaxSize(v int64) *UpdateAutoScalingGroupInput { - s.MaxSize = &v - return s -} - -// SetMinSize sets the MinSize field's value. -func (s *UpdateAutoScalingGroupInput) SetMinSize(v int64) *UpdateAutoScalingGroupInput { - s.MinSize = &v - return s -} - -// SetNewInstancesProtectedFromScaleIn sets the NewInstancesProtectedFromScaleIn field's value. -func (s *UpdateAutoScalingGroupInput) SetNewInstancesProtectedFromScaleIn(v bool) *UpdateAutoScalingGroupInput { - s.NewInstancesProtectedFromScaleIn = &v - return s -} - -// SetPlacementGroup sets the PlacementGroup field's value. -func (s *UpdateAutoScalingGroupInput) SetPlacementGroup(v string) *UpdateAutoScalingGroupInput { - s.PlacementGroup = &v - return s -} - -// SetTerminationPolicies sets the TerminationPolicies field's value. -func (s *UpdateAutoScalingGroupInput) SetTerminationPolicies(v []*string) *UpdateAutoScalingGroupInput { - s.TerminationPolicies = v - return s -} - -// SetVPCZoneIdentifier sets the VPCZoneIdentifier field's value. -func (s *UpdateAutoScalingGroupInput) SetVPCZoneIdentifier(v string) *UpdateAutoScalingGroupInput { - s.VPCZoneIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/UpdateAutoScalingGroupOutput -type UpdateAutoScalingGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateAutoScalingGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAutoScalingGroupOutput) GoString() string { - return s.String() -} - -const ( - // LifecycleStatePending is a LifecycleState enum value - LifecycleStatePending = "Pending" - - // LifecycleStatePendingWait is a LifecycleState enum value - LifecycleStatePendingWait = "Pending:Wait" - - // LifecycleStatePendingProceed is a LifecycleState enum value - LifecycleStatePendingProceed = "Pending:Proceed" - - // LifecycleStateQuarantined is a LifecycleState enum value - LifecycleStateQuarantined = "Quarantined" - - // LifecycleStateInService is a LifecycleState enum value - LifecycleStateInService = "InService" - - // LifecycleStateTerminating is a LifecycleState enum value - LifecycleStateTerminating = "Terminating" - - // LifecycleStateTerminatingWait is a LifecycleState enum value - LifecycleStateTerminatingWait = "Terminating:Wait" - - // LifecycleStateTerminatingProceed is a LifecycleState enum value - LifecycleStateTerminatingProceed = "Terminating:Proceed" - - // LifecycleStateTerminated is a LifecycleState enum value - LifecycleStateTerminated = "Terminated" - - // LifecycleStateDetaching is a LifecycleState enum value - LifecycleStateDetaching = "Detaching" - - // LifecycleStateDetached is a LifecycleState enum value - LifecycleStateDetached = "Detached" - - // LifecycleStateEnteringStandby is a LifecycleState enum value - LifecycleStateEnteringStandby = "EnteringStandby" - - // LifecycleStateStandby is a LifecycleState enum value - LifecycleStateStandby = "Standby" -) - -const ( - // ScalingActivityStatusCodePendingSpotBidPlacement is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodePendingSpotBidPlacement = "PendingSpotBidPlacement" - - // ScalingActivityStatusCodeWaitingForSpotInstanceRequestId is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeWaitingForSpotInstanceRequestId = "WaitingForSpotInstanceRequestId" - - // ScalingActivityStatusCodeWaitingForSpotInstanceId is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeWaitingForSpotInstanceId = "WaitingForSpotInstanceId" - - // ScalingActivityStatusCodeWaitingForInstanceId is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeWaitingForInstanceId = "WaitingForInstanceId" - - // ScalingActivityStatusCodePreInService is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodePreInService = "PreInService" - - // ScalingActivityStatusCodeInProgress is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeInProgress = "InProgress" - - // ScalingActivityStatusCodeWaitingForElbconnectionDraining is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeWaitingForElbconnectionDraining = "WaitingForELBConnectionDraining" - - // ScalingActivityStatusCodeMidLifecycleAction is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeMidLifecycleAction = "MidLifecycleAction" - - // ScalingActivityStatusCodeWaitingForInstanceWarmup is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeWaitingForInstanceWarmup = "WaitingForInstanceWarmup" - - // ScalingActivityStatusCodeSuccessful is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeSuccessful = "Successful" - - // ScalingActivityStatusCodeFailed is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeFailed = "Failed" - - // ScalingActivityStatusCodeCancelled is a ScalingActivityStatusCode enum value - ScalingActivityStatusCodeCancelled = "Cancelled" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go deleted file mode 100644 index 227e6b3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go +++ /dev/null @@ -1,47 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package autoscaling - -const ( - - // ErrCodeAlreadyExistsFault for service response error code - // "AlreadyExists". - // - // You already have an Auto Scaling group or launch configuration with this - // name. - ErrCodeAlreadyExistsFault = "AlreadyExists" - - // ErrCodeInvalidNextToken for service response error code - // "InvalidNextToken". - // - // The NextToken value is not valid. - ErrCodeInvalidNextToken = "InvalidNextToken" - - // ErrCodeLimitExceededFault for service response error code - // "LimitExceeded". - // - // You have already reached a limit for your Auto Scaling resources (for example, - // groups, launch configurations, or lifecycle hooks). For more information, - // see DescribeAccountLimits. - ErrCodeLimitExceededFault = "LimitExceeded" - - // ErrCodeResourceContentionFault for service response error code - // "ResourceContention". - // - // You already have a pending update to an Auto Scaling resource (for example, - // a group, instance, or load balancer). - ErrCodeResourceContentionFault = "ResourceContention" - - // ErrCodeResourceInUseFault for service response error code - // "ResourceInUse". - // - // The operation can't be performed because the resource is in use. - ErrCodeResourceInUseFault = "ResourceInUse" - - // ErrCodeScalingActivityInProgressFault for service response error code - // "ScalingActivityInProgress". - // - // The operation can't be performed because there are scaling activities in - // progress. - ErrCodeScalingActivityInProgressFault = "ScalingActivityInProgress" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go deleted file mode 100644 index 98e1bb4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go +++ /dev/null @@ -1,93 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package autoscaling - -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" -) - -// Auto Scaling is designed to automatically launch or terminate EC2 instances -// based on user-defined policies, schedules, and health checks. Use this service -// in conjunction with the Amazon CloudWatch and Elastic Load Balancing services. -// 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/autoscaling-2011-01-01 -type AutoScaling 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 = "autoscaling" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the AutoScaling 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 AutoScaling client from just a session. -// svc := autoscaling.New(mySession) -// -// // Create a AutoScaling client with additional configuration -// svc := autoscaling.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *AutoScaling { - 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) *AutoScaling { - svc := &AutoScaling{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2011-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a AutoScaling operation and runs any -// custom request initialization. -func (c *AutoScaling) 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/autoscaling/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go deleted file mode 100644 index 15a9fd8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go +++ /dev/null @@ -1,106 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package autoscaling - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilGroupExists uses the Auto Scaling API operation -// DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeAutoScalingGroups", - Delay: 5, - MaxAttempts: 10, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(AutoScalingGroups) > `0`", - Expected: true, - }, - { - State: "retry", - Matcher: "path", - Argument: "length(AutoScalingGroups) > `0`", - Expected: false, - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilGroupInService uses the Auto Scaling API operation -// DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupInService(input *DescribeAutoScalingGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeAutoScalingGroups", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)", - Expected: false, - }, - { - State: "retry", - Matcher: "path", - Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)", - Expected: true, - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilGroupNotExists uses the Auto Scaling API operation -// DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupNotExists(input *DescribeAutoScalingGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeAutoScalingGroups", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(AutoScalingGroups) > `0`", - Expected: false, - }, - { - State: "retry", - Matcher: "path", - Argument: "length(AutoScalingGroups) > `0`", - Expected: true, - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go deleted file mode 100644 index be60e85..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go +++ /dev/null @@ -1,6752 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudformation provides a client for AWS CloudFormation. -package cloudformation - -import ( - "time" - - "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 opCancelUpdateStack = "CancelUpdateStack" - -// CancelUpdateStackRequest generates a "aws/request.Request" representing the -// client's request for the CancelUpdateStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelUpdateStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelUpdateStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelUpdateStackRequest method. -// req, resp := client.CancelUpdateStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CancelUpdateStack -func (c *CloudFormation) CancelUpdateStackRequest(input *CancelUpdateStackInput) (req *request.Request, output *CancelUpdateStackOutput) { - op := &request.Operation{ - Name: opCancelUpdateStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelUpdateStackInput{} - } - - output = &CancelUpdateStackOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CancelUpdateStack API operation for AWS CloudFormation. -// -// Cancels an update on the specified stack. If the call completes successfully, -// the stack rolls back the update and reverts to the previous stack configuration. -// -// You can cancel only stacks that are in the UPDATE_IN_PROGRESS 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 AWS CloudFormation's -// API operation CancelUpdateStack for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CancelUpdateStack -func (c *CloudFormation) CancelUpdateStack(input *CancelUpdateStackInput) (*CancelUpdateStackOutput, error) { - req, out := c.CancelUpdateStackRequest(input) - err := req.Send() - return out, err -} - -const opContinueUpdateRollback = "ContinueUpdateRollback" - -// ContinueUpdateRollbackRequest generates a "aws/request.Request" representing the -// client's request for the ContinueUpdateRollback operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ContinueUpdateRollback for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ContinueUpdateRollback method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ContinueUpdateRollbackRequest method. -// req, resp := client.ContinueUpdateRollbackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ContinueUpdateRollback -func (c *CloudFormation) ContinueUpdateRollbackRequest(input *ContinueUpdateRollbackInput) (req *request.Request, output *ContinueUpdateRollbackOutput) { - op := &request.Operation{ - Name: opContinueUpdateRollback, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ContinueUpdateRollbackInput{} - } - - output = &ContinueUpdateRollbackOutput{} - req = c.newRequest(op, input, output) - return -} - -// ContinueUpdateRollback API operation for AWS CloudFormation. -// -// For a specified stack that is in the UPDATE_ROLLBACK_FAILED state, continues -// rolling it back to the UPDATE_ROLLBACK_COMPLETE state. Depending on the cause -// of the failure, you can manually fix the error (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed) -// and continue the rollback. By continuing the rollback, you can return your -// stack to a working state (the UPDATE_ROLLBACK_COMPLETE state), and then try -// to update the stack again. -// -// A stack goes into the UPDATE_ROLLBACK_FAILED state when AWS CloudFormation -// cannot roll back all changes after a failed stack update. For example, you -// might have a stack that is rolling back to an old database instance that -// was deleted outside of AWS CloudFormation. Because AWS CloudFormation doesn't -// know the database was deleted, it assumes that the database instance still -// exists and attempts to roll back to it, causing the update rollback to fail. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudFormation's -// API operation ContinueUpdateRollback for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ContinueUpdateRollback -func (c *CloudFormation) ContinueUpdateRollback(input *ContinueUpdateRollbackInput) (*ContinueUpdateRollbackOutput, error) { - req, out := c.ContinueUpdateRollbackRequest(input) - err := req.Send() - return out, err -} - -const opCreateChangeSet = "CreateChangeSet" - -// CreateChangeSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateChangeSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateChangeSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateChangeSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateChangeSetRequest method. -// req, resp := client.CreateChangeSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet -func (c *CloudFormation) CreateChangeSetRequest(input *CreateChangeSetInput) (req *request.Request, output *CreateChangeSetOutput) { - op := &request.Operation{ - Name: opCreateChangeSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateChangeSetInput{} - } - - output = &CreateChangeSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateChangeSet API operation for AWS CloudFormation. -// -// Creates a list of changes for a stack. AWS CloudFormation generates the change -// set by comparing the template's information with the information that you -// submit. A change set can help you understand which resources AWS CloudFormation -// will change, and how it will change them, before you update your stack. Change -// sets allow you to check before making a change to avoid deleting or replacing -// critical resources. -// -// AWS CloudFormation doesn't make any changes to the stack when you create -// a change set. To make the specified changes, you must execute the change -// set by using the ExecuteChangeSet action. -// -// After the call successfully completes, AWS CloudFormation starts creating -// the change set. To check the status of the change set, use the DescribeChangeSet -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudFormation's -// API operation CreateChangeSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" -// Resource with the name requested already exists. -// -// * ErrCodeInsufficientCapabilitiesException "InsufficientCapabilitiesException" -// The template contains resources with capabilities that were not specified -// in the Capabilities parameter. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Quota for the resource has already been reached. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet -func (c *CloudFormation) CreateChangeSet(input *CreateChangeSetInput) (*CreateChangeSetOutput, error) { - req, out := c.CreateChangeSetRequest(input) - err := req.Send() - return out, err -} - -const opCreateStack = "CreateStack" - -// CreateStackRequest generates a "aws/request.Request" representing the -// client's request for the CreateStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateStackRequest method. -// req, resp := client.CreateStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStack -func (c *CloudFormation) CreateStackRequest(input *CreateStackInput) (req *request.Request, output *CreateStackOutput) { - op := &request.Operation{ - Name: opCreateStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateStackInput{} - } - - output = &CreateStackOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateStack API operation for AWS CloudFormation. -// -// Creates a stack as specified in the template. After the call completes successfully, -// the stack creation starts. You can check the status of the stack via the -// DescribeStacks 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 AWS CloudFormation's -// API operation CreateStack for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// Quota for the resource has already been reached. -// -// * ErrCodeAlreadyExistsException "AlreadyExistsException" -// Resource with the name requested already exists. -// -// * ErrCodeInsufficientCapabilitiesException "InsufficientCapabilitiesException" -// The template contains resources with capabilities that were not specified -// in the Capabilities parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStack -func (c *CloudFormation) CreateStack(input *CreateStackInput) (*CreateStackOutput, error) { - req, out := c.CreateStackRequest(input) - err := req.Send() - return out, err -} - -const opDeleteChangeSet = "DeleteChangeSet" - -// DeleteChangeSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteChangeSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteChangeSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteChangeSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteChangeSetRequest method. -// req, resp := client.DeleteChangeSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteChangeSet -func (c *CloudFormation) DeleteChangeSetRequest(input *DeleteChangeSetInput) (req *request.Request, output *DeleteChangeSetOutput) { - op := &request.Operation{ - Name: opDeleteChangeSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteChangeSetInput{} - } - - output = &DeleteChangeSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteChangeSet API operation for AWS CloudFormation. -// -// Deletes the specified change set. Deleting change sets ensures that no one -// executes the wrong change set. -// -// If the call successfully completes, AWS CloudFormation successfully deleted -// the change set. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudFormation's -// API operation DeleteChangeSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidChangeSetStatusException "InvalidChangeSetStatus" -// The specified change set cannot be used to update the stack. For example, -// the change set status might be CREATE_IN_PROGRESS or the stack status might -// be UPDATE_IN_PROGRESS. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteChangeSet -func (c *CloudFormation) DeleteChangeSet(input *DeleteChangeSetInput) (*DeleteChangeSetOutput, error) { - req, out := c.DeleteChangeSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteStack = "DeleteStack" - -// DeleteStackRequest generates a "aws/request.Request" representing the -// client's request for the DeleteStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteStackRequest method. -// req, resp := client.DeleteStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStack -func (c *CloudFormation) DeleteStackRequest(input *DeleteStackInput) (req *request.Request, output *DeleteStackOutput) { - op := &request.Operation{ - Name: opDeleteStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteStackInput{} - } - - output = &DeleteStackOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteStack API operation for AWS CloudFormation. -// -// Deletes a specified stack. Once the call completes successfully, stack deletion -// starts. Deleted stacks do not show up in the DescribeStacks API if the deletion -// has been completed successfully. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudFormation's -// API operation DeleteStack for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStack -func (c *CloudFormation) DeleteStack(input *DeleteStackInput) (*DeleteStackOutput, error) { - req, out := c.DeleteStackRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAccountLimits = "DescribeAccountLimits" - -// DescribeAccountLimitsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAccountLimits operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAccountLimits for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAccountLimits method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAccountLimitsRequest method. -// req, resp := client.DescribeAccountLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeAccountLimits -func (c *CloudFormation) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) (req *request.Request, output *DescribeAccountLimitsOutput) { - op := &request.Operation{ - Name: opDescribeAccountLimits, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAccountLimitsInput{} - } - - output = &DescribeAccountLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAccountLimits API operation for AWS CloudFormation. -// -// Retrieves your account's AWS CloudFormation limits, such as the maximum number -// of stacks that you can create 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 AWS CloudFormation's -// API operation DescribeAccountLimits for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeAccountLimits -func (c *CloudFormation) DescribeAccountLimits(input *DescribeAccountLimitsInput) (*DescribeAccountLimitsOutput, error) { - req, out := c.DescribeAccountLimitsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeChangeSet = "DescribeChangeSet" - -// DescribeChangeSetRequest generates a "aws/request.Request" representing the -// client's request for the DescribeChangeSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeChangeSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeChangeSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeChangeSetRequest method. -// req, resp := client.DescribeChangeSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeChangeSet -func (c *CloudFormation) DescribeChangeSetRequest(input *DescribeChangeSetInput) (req *request.Request, output *DescribeChangeSetOutput) { - op := &request.Operation{ - Name: opDescribeChangeSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeChangeSetInput{} - } - - output = &DescribeChangeSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeChangeSet API operation for AWS CloudFormation. -// -// Returns the inputs for the change set and a list of changes that AWS CloudFormation -// will make if you execute the change set. For more information, see Updating -// Stacks Using Change Sets (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html) -// in the AWS CloudFormation 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 AWS CloudFormation's -// API operation DescribeChangeSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeChangeSetNotFoundException "ChangeSetNotFound" -// The specified change set name or ID doesn't exit. To view valid change sets -// for a stack, use the ListChangeSets action. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeChangeSet -func (c *CloudFormation) DescribeChangeSet(input *DescribeChangeSetInput) (*DescribeChangeSetOutput, error) { - req, out := c.DescribeChangeSetRequest(input) - err := req.Send() - return out, err -} - -const opDescribeStackEvents = "DescribeStackEvents" - -// DescribeStackEventsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStackEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStackEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStackEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStackEventsRequest method. -// req, resp := client.DescribeStackEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackEvents -func (c *CloudFormation) DescribeStackEventsRequest(input *DescribeStackEventsInput) (req *request.Request, output *DescribeStackEventsOutput) { - op := &request.Operation{ - Name: opDescribeStackEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeStackEventsInput{} - } - - output = &DescribeStackEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStackEvents API operation for AWS CloudFormation. -// -// Returns all stack related events for a specified stack in reverse chronological -// order. For more information about a stack's event history, go to Stacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/concept-stack.html) -// in the AWS CloudFormation User Guide. -// -// You can list events for stacks that have failed to create or have been deleted -// by specifying the unique stack identifier (stack 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 AWS CloudFormation's -// API operation DescribeStackEvents for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackEvents -func (c *CloudFormation) DescribeStackEvents(input *DescribeStackEventsInput) (*DescribeStackEventsOutput, error) { - req, out := c.DescribeStackEventsRequest(input) - err := req.Send() - return out, err -} - -// DescribeStackEventsPages iterates over the pages of a DescribeStackEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeStackEvents 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 DescribeStackEvents operation. -// pageNum := 0 -// err := client.DescribeStackEventsPages(params, -// func(page *DescribeStackEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) DescribeStackEventsPages(input *DescribeStackEventsInput, fn func(p *DescribeStackEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeStackEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeStackEventsOutput), lastPage) - }) -} - -const opDescribeStackResource = "DescribeStackResource" - -// DescribeStackResourceRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStackResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStackResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStackResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStackResourceRequest method. -// req, resp := client.DescribeStackResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResource -func (c *CloudFormation) DescribeStackResourceRequest(input *DescribeStackResourceInput) (req *request.Request, output *DescribeStackResourceOutput) { - op := &request.Operation{ - Name: opDescribeStackResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStackResourceInput{} - } - - output = &DescribeStackResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStackResource API operation for AWS CloudFormation. -// -// Returns a description of the specified resource in the specified stack. -// -// For deleted stacks, DescribeStackResource returns resource information for -// up to 90 days after the stack 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 AWS CloudFormation's -// API operation DescribeStackResource for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResource -func (c *CloudFormation) DescribeStackResource(input *DescribeStackResourceInput) (*DescribeStackResourceOutput, error) { - req, out := c.DescribeStackResourceRequest(input) - err := req.Send() - return out, err -} - -const opDescribeStackResources = "DescribeStackResources" - -// DescribeStackResourcesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStackResources operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStackResources for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStackResources method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStackResourcesRequest method. -// req, resp := client.DescribeStackResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResources -func (c *CloudFormation) DescribeStackResourcesRequest(input *DescribeStackResourcesInput) (req *request.Request, output *DescribeStackResourcesOutput) { - op := &request.Operation{ - Name: opDescribeStackResources, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStackResourcesInput{} - } - - output = &DescribeStackResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStackResources API operation for AWS CloudFormation. -// -// Returns AWS resource descriptions for running and deleted stacks. If StackName -// is specified, all the associated resources that are part of the stack are -// returned. If PhysicalResourceId is specified, the associated resources of -// the stack that the resource belongs to are returned. -// -// Only the first 100 resources will be returned. If your stack has more resources -// than this, you should use ListStackResources instead. -// -// For deleted stacks, DescribeStackResources returns resource information for -// up to 90 days after the stack has been deleted. -// -// You must specify either StackName or PhysicalResourceId, but not both. In -// addition, you can specify LogicalResourceId to filter the returned result. -// For more information about resources, the LogicalResourceId and PhysicalResourceId, -// go to the AWS CloudFormation User Guide (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/). -// -// A ValidationError is returned if you specify both StackName and PhysicalResourceId -// in the same 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 AWS CloudFormation's -// API operation DescribeStackResources for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResources -func (c *CloudFormation) DescribeStackResources(input *DescribeStackResourcesInput) (*DescribeStackResourcesOutput, error) { - req, out := c.DescribeStackResourcesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeStacks = "DescribeStacks" - -// DescribeStacksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStacks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStacks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStacks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStacksRequest method. -// req, resp := client.DescribeStacksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks -func (c *CloudFormation) DescribeStacksRequest(input *DescribeStacksInput) (req *request.Request, output *DescribeStacksOutput) { - op := &request.Operation{ - Name: opDescribeStacks, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeStacksInput{} - } - - output = &DescribeStacksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStacks API operation for AWS CloudFormation. -// -// Returns the description for the specified stack; if no stack name was specified, -// then it returns the description for all the stacks created. -// -// If the stack does not exist, an AmazonCloudFormationException is 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 AWS CloudFormation's -// API operation DescribeStacks for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks -func (c *CloudFormation) DescribeStacks(input *DescribeStacksInput) (*DescribeStacksOutput, error) { - req, out := c.DescribeStacksRequest(input) - err := req.Send() - return out, err -} - -// DescribeStacksPages iterates over the pages of a DescribeStacks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeStacks 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 DescribeStacks operation. -// pageNum := 0 -// err := client.DescribeStacksPages(params, -// func(page *DescribeStacksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) DescribeStacksPages(input *DescribeStacksInput, fn func(p *DescribeStacksOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeStacksRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeStacksOutput), lastPage) - }) -} - -const opEstimateTemplateCost = "EstimateTemplateCost" - -// EstimateTemplateCostRequest generates a "aws/request.Request" representing the -// client's request for the EstimateTemplateCost operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EstimateTemplateCost for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EstimateTemplateCost method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EstimateTemplateCostRequest method. -// req, resp := client.EstimateTemplateCostRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/EstimateTemplateCost -func (c *CloudFormation) EstimateTemplateCostRequest(input *EstimateTemplateCostInput) (req *request.Request, output *EstimateTemplateCostOutput) { - op := &request.Operation{ - Name: opEstimateTemplateCost, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EstimateTemplateCostInput{} - } - - output = &EstimateTemplateCostOutput{} - req = c.newRequest(op, input, output) - return -} - -// EstimateTemplateCost API operation for AWS CloudFormation. -// -// Returns the estimated monthly cost of a template. The return value is an -// AWS Simple Monthly Calculator URL with a query string that describes the -// resources required to run the template. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudFormation's -// API operation EstimateTemplateCost for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/EstimateTemplateCost -func (c *CloudFormation) EstimateTemplateCost(input *EstimateTemplateCostInput) (*EstimateTemplateCostOutput, error) { - req, out := c.EstimateTemplateCostRequest(input) - err := req.Send() - return out, err -} - -const opExecuteChangeSet = "ExecuteChangeSet" - -// ExecuteChangeSetRequest generates a "aws/request.Request" representing the -// client's request for the ExecuteChangeSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ExecuteChangeSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ExecuteChangeSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ExecuteChangeSetRequest method. -// req, resp := client.ExecuteChangeSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ExecuteChangeSet -func (c *CloudFormation) ExecuteChangeSetRequest(input *ExecuteChangeSetInput) (req *request.Request, output *ExecuteChangeSetOutput) { - op := &request.Operation{ - Name: opExecuteChangeSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ExecuteChangeSetInput{} - } - - output = &ExecuteChangeSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExecuteChangeSet API operation for AWS CloudFormation. -// -// Updates a stack using the input information that was provided when the specified -// change set was created. After the call successfully completes, AWS CloudFormation -// starts updating the stack. Use the DescribeStacks action to view the status -// of the update. -// -// When you execute a change set, AWS CloudFormation deletes all other change -// sets associated with the stack because they aren't valid for the updated -// stack. -// -// If a stack policy is associated with the stack, AWS CloudFormation enforces -// the policy during the update. You can't specify a temporary stack policy -// that overrides the current 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 AWS CloudFormation's -// API operation ExecuteChangeSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidChangeSetStatusException "InvalidChangeSetStatus" -// The specified change set cannot be used to update the stack. For example, -// the change set status might be CREATE_IN_PROGRESS or the stack status might -// be UPDATE_IN_PROGRESS. -// -// * ErrCodeChangeSetNotFoundException "ChangeSetNotFound" -// The specified change set name or ID doesn't exit. To view valid change sets -// for a stack, use the ListChangeSets action. -// -// * ErrCodeInsufficientCapabilitiesException "InsufficientCapabilitiesException" -// The template contains resources with capabilities that were not specified -// in the Capabilities parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ExecuteChangeSet -func (c *CloudFormation) ExecuteChangeSet(input *ExecuteChangeSetInput) (*ExecuteChangeSetOutput, error) { - req, out := c.ExecuteChangeSetRequest(input) - err := req.Send() - return out, err -} - -const opGetStackPolicy = "GetStackPolicy" - -// GetStackPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetStackPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetStackPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetStackPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetStackPolicyRequest method. -// req, resp := client.GetStackPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetStackPolicy -func (c *CloudFormation) GetStackPolicyRequest(input *GetStackPolicyInput) (req *request.Request, output *GetStackPolicyOutput) { - op := &request.Operation{ - Name: opGetStackPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetStackPolicyInput{} - } - - output = &GetStackPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStackPolicy API operation for AWS CloudFormation. -// -// Returns the stack policy for a specified stack. If a stack doesn't have a -// policy, a null value is 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 AWS CloudFormation's -// API operation GetStackPolicy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetStackPolicy -func (c *CloudFormation) GetStackPolicy(input *GetStackPolicyInput) (*GetStackPolicyOutput, error) { - req, out := c.GetStackPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetTemplate = "GetTemplate" - -// GetTemplateRequest generates a "aws/request.Request" representing the -// client's request for the GetTemplate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetTemplate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetTemplate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetTemplateRequest method. -// req, resp := client.GetTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplate -func (c *CloudFormation) GetTemplateRequest(input *GetTemplateInput) (req *request.Request, output *GetTemplateOutput) { - op := &request.Operation{ - Name: opGetTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTemplateInput{} - } - - output = &GetTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTemplate API operation for AWS CloudFormation. -// -// Returns the template body for a specified stack. You can get the template -// for running or deleted stacks. -// -// For deleted stacks, GetTemplate returns the template for up to 90 days after -// the stack has been deleted. -// -// If the template does not exist, a ValidationError is 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 AWS CloudFormation's -// API operation GetTemplate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeChangeSetNotFoundException "ChangeSetNotFound" -// The specified change set name or ID doesn't exit. To view valid change sets -// for a stack, use the ListChangeSets action. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplate -func (c *CloudFormation) GetTemplate(input *GetTemplateInput) (*GetTemplateOutput, error) { - req, out := c.GetTemplateRequest(input) - err := req.Send() - return out, err -} - -const opGetTemplateSummary = "GetTemplateSummary" - -// GetTemplateSummaryRequest generates a "aws/request.Request" representing the -// client's request for the GetTemplateSummary operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetTemplateSummary for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetTemplateSummary method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetTemplateSummaryRequest method. -// req, resp := client.GetTemplateSummaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplateSummary -func (c *CloudFormation) GetTemplateSummaryRequest(input *GetTemplateSummaryInput) (req *request.Request, output *GetTemplateSummaryOutput) { - op := &request.Operation{ - Name: opGetTemplateSummary, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTemplateSummaryInput{} - } - - output = &GetTemplateSummaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTemplateSummary API operation for AWS CloudFormation. -// -// Returns information about a new or existing template. The GetTemplateSummary -// action is useful for viewing parameter information, such as default parameter -// values and parameter types, before you create or update a stack. -// -// You can use the GetTemplateSummary action when you submit a template, or -// you can get template information for a running or deleted stack. -// -// For deleted stacks, GetTemplateSummary returns the template information for -// up to 90 days after the stack has been deleted. If the template does not -// exist, a ValidationError is 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 AWS CloudFormation's -// API operation GetTemplateSummary for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplateSummary -func (c *CloudFormation) GetTemplateSummary(input *GetTemplateSummaryInput) (*GetTemplateSummaryOutput, error) { - req, out := c.GetTemplateSummaryRequest(input) - err := req.Send() - return out, err -} - -const opListChangeSets = "ListChangeSets" - -// ListChangeSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListChangeSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListChangeSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListChangeSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListChangeSetsRequest method. -// req, resp := client.ListChangeSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListChangeSets -func (c *CloudFormation) ListChangeSetsRequest(input *ListChangeSetsInput) (req *request.Request, output *ListChangeSetsOutput) { - op := &request.Operation{ - Name: opListChangeSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListChangeSetsInput{} - } - - output = &ListChangeSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListChangeSets API operation for AWS CloudFormation. -// -// Returns the ID and status of each active change set for a stack. For example, -// AWS CloudFormation lists change sets that are in the CREATE_IN_PROGRESS or -// CREATE_PENDING 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 AWS CloudFormation's -// API operation ListChangeSets for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListChangeSets -func (c *CloudFormation) ListChangeSets(input *ListChangeSetsInput) (*ListChangeSetsOutput, error) { - req, out := c.ListChangeSetsRequest(input) - err := req.Send() - return out, err -} - -const opListExports = "ListExports" - -// ListExportsRequest generates a "aws/request.Request" representing the -// client's request for the ListExports operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListExports for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListExports method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListExportsRequest method. -// req, resp := client.ListExportsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListExports -func (c *CloudFormation) ListExportsRequest(input *ListExportsInput) (req *request.Request, output *ListExportsOutput) { - op := &request.Operation{ - Name: opListExports, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListExportsInput{} - } - - output = &ListExportsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListExports API operation for AWS CloudFormation. -// -// Lists all exported output values in the account and region in which you call -// this action. Use this action to see the exported output values that you can -// import into other stacks. To import values, use the Fn::ImportValue (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html) -// function. -// -// For more information, see AWS CloudFormation Export Stack Output Values -// (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-exports.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 AWS CloudFormation's -// API operation ListExports for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListExports -func (c *CloudFormation) ListExports(input *ListExportsInput) (*ListExportsOutput, error) { - req, out := c.ListExportsRequest(input) - err := req.Send() - return out, err -} - -const opListImports = "ListImports" - -// ListImportsRequest generates a "aws/request.Request" representing the -// client's request for the ListImports operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListImports for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListImports method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListImportsRequest method. -// req, resp := client.ListImportsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListImports -func (c *CloudFormation) ListImportsRequest(input *ListImportsInput) (req *request.Request, output *ListImportsOutput) { - op := &request.Operation{ - Name: opListImports, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListImportsInput{} - } - - output = &ListImportsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListImports API operation for AWS CloudFormation. -// -// Lists all stacks that are importing an exported output value. To modify or -// remove an exported output value, first use this action to see which stacks -// are using it. To see the exported output values in your account, see ListExports. -// -// For more information about importing an exported output value, see the Fn::ImportValue -// (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html) -// function. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudFormation's -// API operation ListImports for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListImports -func (c *CloudFormation) ListImports(input *ListImportsInput) (*ListImportsOutput, error) { - req, out := c.ListImportsRequest(input) - err := req.Send() - return out, err -} - -const opListStackResources = "ListStackResources" - -// ListStackResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListStackResources operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListStackResources for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListStackResources method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListStackResourcesRequest method. -// req, resp := client.ListStackResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackResources -func (c *CloudFormation) ListStackResourcesRequest(input *ListStackResourcesInput) (req *request.Request, output *ListStackResourcesOutput) { - op := &request.Operation{ - Name: opListStackResources, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListStackResourcesInput{} - } - - output = &ListStackResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListStackResources API operation for AWS CloudFormation. -// -// Returns descriptions of all resources of the specified stack. -// -// For deleted stacks, ListStackResources returns resource information for up -// to 90 days after the stack 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 AWS CloudFormation's -// API operation ListStackResources for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackResources -func (c *CloudFormation) ListStackResources(input *ListStackResourcesInput) (*ListStackResourcesOutput, error) { - req, out := c.ListStackResourcesRequest(input) - err := req.Send() - return out, err -} - -// ListStackResourcesPages iterates over the pages of a ListStackResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStackResources 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 ListStackResources operation. -// pageNum := 0 -// err := client.ListStackResourcesPages(params, -// func(page *ListStackResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) ListStackResourcesPages(input *ListStackResourcesInput, fn func(p *ListStackResourcesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStackResourcesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStackResourcesOutput), lastPage) - }) -} - -const opListStacks = "ListStacks" - -// ListStacksRequest generates a "aws/request.Request" representing the -// client's request for the ListStacks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListStacks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListStacks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListStacksRequest method. -// req, resp := client.ListStacksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStacks -func (c *CloudFormation) ListStacksRequest(input *ListStacksInput) (req *request.Request, output *ListStacksOutput) { - op := &request.Operation{ - Name: opListStacks, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListStacksInput{} - } - - output = &ListStacksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListStacks API operation for AWS CloudFormation. -// -// Returns the summary information for stacks whose status matches the specified -// StackStatusFilter. Summary information for stacks that have been deleted -// is kept for 90 days after the stack is deleted. If no StackStatusFilter is -// specified, summary information for all stacks is returned (including existing -// stacks and stacks that have 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 AWS CloudFormation's -// API operation ListStacks for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStacks -func (c *CloudFormation) ListStacks(input *ListStacksInput) (*ListStacksOutput, error) { - req, out := c.ListStacksRequest(input) - err := req.Send() - return out, err -} - -// ListStacksPages iterates over the pages of a ListStacks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStacks 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 ListStacks operation. -// pageNum := 0 -// err := client.ListStacksPages(params, -// func(page *ListStacksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFormation) ListStacksPages(input *ListStacksInput, fn func(p *ListStacksOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStacksRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStacksOutput), lastPage) - }) -} - -const opSetStackPolicy = "SetStackPolicy" - -// SetStackPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SetStackPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetStackPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetStackPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetStackPolicyRequest method. -// req, resp := client.SetStackPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy -func (c *CloudFormation) SetStackPolicyRequest(input *SetStackPolicyInput) (req *request.Request, output *SetStackPolicyOutput) { - op := &request.Operation{ - Name: opSetStackPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetStackPolicyInput{} - } - - output = &SetStackPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetStackPolicy API operation for AWS CloudFormation. -// -// Sets a stack policy for a specified stack. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudFormation's -// API operation SetStackPolicy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy -func (c *CloudFormation) SetStackPolicy(input *SetStackPolicyInput) (*SetStackPolicyOutput, error) { - req, out := c.SetStackPolicyRequest(input) - err := req.Send() - return out, err -} - -const opSignalResource = "SignalResource" - -// SignalResourceRequest generates a "aws/request.Request" representing the -// client's request for the SignalResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SignalResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SignalResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SignalResourceRequest method. -// req, resp := client.SignalResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource -func (c *CloudFormation) SignalResourceRequest(input *SignalResourceInput) (req *request.Request, output *SignalResourceOutput) { - op := &request.Operation{ - Name: opSignalResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SignalResourceInput{} - } - - output = &SignalResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SignalResource API operation for AWS CloudFormation. -// -// Sends a signal to the specified resource with a success or failure status. -// You can use the SignalResource API in conjunction with a creation policy -// or update policy. AWS CloudFormation doesn't proceed with a stack creation -// or update until resources receive the required number of signals or the timeout -// period is exceeded. The SignalResource API is useful in cases where you want -// to send signals from anywhere other than an Amazon EC2 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 AWS CloudFormation's -// API operation SignalResource for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource -func (c *CloudFormation) SignalResource(input *SignalResourceInput) (*SignalResourceOutput, error) { - req, out := c.SignalResourceRequest(input) - err := req.Send() - return out, err -} - -const opUpdateStack = "UpdateStack" - -// UpdateStackRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateStackRequest method. -// req, resp := client.UpdateStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack -func (c *CloudFormation) UpdateStackRequest(input *UpdateStackInput) (req *request.Request, output *UpdateStackOutput) { - op := &request.Operation{ - Name: opUpdateStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateStackInput{} - } - - output = &UpdateStackOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateStack API operation for AWS CloudFormation. -// -// Updates a stack as specified in the template. After the call completes successfully, -// the stack update starts. You can check the status of the stack via the DescribeStacks -// action. -// -// To get a copy of the template for an existing stack, you can use the GetTemplate -// action. -// -// For more information about creating an update template, updating a stack, -// and monitoring the progress of the update, see Updating a Stack (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.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 AWS CloudFormation's -// API operation UpdateStack for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientCapabilitiesException "InsufficientCapabilitiesException" -// The template contains resources with capabilities that were not specified -// in the Capabilities parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack -func (c *CloudFormation) UpdateStack(input *UpdateStackInput) (*UpdateStackOutput, error) { - req, out := c.UpdateStackRequest(input) - err := req.Send() - return out, err -} - -const opValidateTemplate = "ValidateTemplate" - -// ValidateTemplateRequest generates a "aws/request.Request" representing the -// client's request for the ValidateTemplate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ValidateTemplate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ValidateTemplate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ValidateTemplateRequest method. -// req, resp := client.ValidateTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate -func (c *CloudFormation) ValidateTemplateRequest(input *ValidateTemplateInput) (req *request.Request, output *ValidateTemplateOutput) { - op := &request.Operation{ - Name: opValidateTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ValidateTemplateInput{} - } - - output = &ValidateTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// ValidateTemplate API operation for AWS CloudFormation. -// -// Validates a specified template. AWS CloudFormation first checks if the template -// is valid JSON. If it isn't, AWS CloudFormation checks if the template is -// valid YAML. If both these checks fail, AWS CloudFormation returns a template -// validation 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 AWS CloudFormation's -// API operation ValidateTemplate for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate -func (c *CloudFormation) ValidateTemplate(input *ValidateTemplateInput) (*ValidateTemplateOutput, error) { - req, out := c.ValidateTemplateRequest(input) - err := req.Send() - return out, err -} - -// The AccountLimit data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/AccountLimit -type AccountLimit struct { - _ struct{} `type:"structure"` - - // The name of the account limit. Currently, the only account limit is StackLimit. - Name *string `type:"string"` - - // The value that is associated with the account limit name. - Value *int64 `type:"integer"` -} - -// String returns the string representation -func (s AccountLimit) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountLimit) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *AccountLimit) SetName(v string) *AccountLimit { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *AccountLimit) SetValue(v int64) *AccountLimit { - s.Value = &v - return s -} - -// The input for the CancelUpdateStack action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CancelUpdateStackInput -type CancelUpdateStackInput struct { - _ struct{} `type:"structure"` - - // The name or the unique stack ID that is associated with the stack. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelUpdateStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelUpdateStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelUpdateStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelUpdateStackInput"} - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackName sets the StackName field's value. -func (s *CancelUpdateStackInput) SetStackName(v string) *CancelUpdateStackInput { - s.StackName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CancelUpdateStackOutput -type CancelUpdateStackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CancelUpdateStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelUpdateStackOutput) GoString() string { - return s.String() -} - -// The Change structure describes the changes AWS CloudFormation will perform -// if you execute the change set. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Change -type Change struct { - _ struct{} `type:"structure"` - - // A ResourceChange structure that describes the resource and action that AWS - // CloudFormation will perform. - ResourceChange *ResourceChange `type:"structure"` - - // The type of entity that AWS CloudFormation changes. Currently, the only entity - // type is Resource. - Type *string `type:"string" enum:"ChangeType"` -} - -// 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() -} - -// SetResourceChange sets the ResourceChange field's value. -func (s *Change) SetResourceChange(v *ResourceChange) *Change { - s.ResourceChange = v - return s -} - -// SetType sets the Type field's value. -func (s *Change) SetType(v string) *Change { - s.Type = &v - return s -} - -// The ChangeSetSummary structure describes a change set, its status, and the -// stack with which it's associated. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ChangeSetSummary -type ChangeSetSummary struct { - _ struct{} `type:"structure"` - - // The ID of the change set. - ChangeSetId *string `min:"1" type:"string"` - - // The name of the change set. - ChangeSetName *string `min:"1" type:"string"` - - // The start time when the change set was created, in UTC. - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Descriptive information about the change set. - Description *string `min:"1" type:"string"` - - // If the change set execution status is AVAILABLE, you can execute the change - // set. If you can’t execute the change set, the status indicates why. For example, - // a change set might be in an UNAVAILABLE state because AWS CloudFormation - // is still creating it or in an OBSOLETE state because the stack was already - // updated. - ExecutionStatus *string `type:"string" enum:"ExecutionStatus"` - - // The ID of the stack with which the change set is associated. - StackId *string `type:"string"` - - // The name of the stack with which the change set is associated. - StackName *string `type:"string"` - - // The state of the change set, such as CREATE_IN_PROGRESS, CREATE_COMPLETE, - // or FAILED. - Status *string `type:"string" enum:"ChangeSetStatus"` - - // A description of the change set's status. For example, if your change set - // is in the FAILED state, AWS CloudFormation shows the error message. - StatusReason *string `type:"string"` -} - -// String returns the string representation -func (s ChangeSetSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeSetSummary) GoString() string { - return s.String() -} - -// SetChangeSetId sets the ChangeSetId field's value. -func (s *ChangeSetSummary) SetChangeSetId(v string) *ChangeSetSummary { - s.ChangeSetId = &v - return s -} - -// SetChangeSetName sets the ChangeSetName field's value. -func (s *ChangeSetSummary) SetChangeSetName(v string) *ChangeSetSummary { - s.ChangeSetName = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ChangeSetSummary) SetCreationTime(v time.Time) *ChangeSetSummary { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ChangeSetSummary) SetDescription(v string) *ChangeSetSummary { - s.Description = &v - return s -} - -// SetExecutionStatus sets the ExecutionStatus field's value. -func (s *ChangeSetSummary) SetExecutionStatus(v string) *ChangeSetSummary { - s.ExecutionStatus = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *ChangeSetSummary) SetStackId(v string) *ChangeSetSummary { - s.StackId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *ChangeSetSummary) SetStackName(v string) *ChangeSetSummary { - s.StackName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ChangeSetSummary) SetStatus(v string) *ChangeSetSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *ChangeSetSummary) SetStatusReason(v string) *ChangeSetSummary { - s.StatusReason = &v - return s -} - -// The input for the ContinueUpdateRollback action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ContinueUpdateRollbackInput -type ContinueUpdateRollbackInput struct { - _ struct{} `type:"structure"` - - // A list of the logical IDs of the resources that AWS CloudFormation skips - // during the continue update rollback operation. You can specify only resources - // that are in the UPDATE_FAILED state because a rollback failed. You can't - // specify resources that are in the UPDATE_FAILED state for other reasons, - // for example, because an update was canceled. To check why a resource update - // failed, use the DescribeStackResources action, and view the resource status - // reason. - // - // Specify this property to skip rolling back resources that AWS CloudFormation - // can't successfully roll back. We recommend that you troubleshoot (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed) - // resources before skipping them. AWS CloudFormation sets the status of the - // specified resources to UPDATE_COMPLETE and continues to roll back the stack. - // After the rollback is complete, the state of the skipped resources will be - // inconsistent with the state of the resources in the stack template. Before - // performing another stack update, you must update the stack or resources to - // be consistent with each other. If you don't, subsequent stack updates might - // fail, and the stack will become unrecoverable. - // - // Specify the minimum number of resources required to successfully roll back - // your stack. For example, a failed resource update might cause dependent resources - // to fail. In this case, it might not be necessary to skip the dependent resources. - // - // To specify resources in a nested stack, use the following format: NestedStackName.ResourceLogicalID. - // You can specify a nested stack resource (the logical ID of an AWS::CloudFormation::Stack - // resource) only if it's in one of the following states: DELETE_IN_PROGRESS, - // DELETE_COMPLETE, or DELETE_FAILED. - ResourcesToSkip []*string `type:"list"` - - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes to roll back the stack. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. AWS CloudFormation - // always uses this role for all future operations on the stack. As long as - // users have permission to operate on the stack, AWS CloudFormation uses this - // role even if the users don't have permission to pass it. Ensure that the - // role grants least privilege. - // - // If you don't specify a value, AWS CloudFormation uses the role that was previously - // associated with the stack. If no role is available, AWS CloudFormation uses - // a temporary session that is generated from your user credentials. - RoleARN *string `min:"20" type:"string"` - - // The name or the unique ID of the stack that you want to continue rolling - // back. - // - // Don't specify the name of a nested stack (a stack that was created by using - // the AWS::CloudFormation::Stack resource). Instead, use this operation on - // the parent stack (the stack that contains the AWS::CloudFormation::Stack - // resource). - // - // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ContinueUpdateRollbackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContinueUpdateRollbackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContinueUpdateRollbackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContinueUpdateRollbackInput"} - if s.RoleARN != nil && len(*s.RoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourcesToSkip sets the ResourcesToSkip field's value. -func (s *ContinueUpdateRollbackInput) SetResourcesToSkip(v []*string) *ContinueUpdateRollbackInput { - s.ResourcesToSkip = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ContinueUpdateRollbackInput) SetRoleARN(v string) *ContinueUpdateRollbackInput { - s.RoleARN = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *ContinueUpdateRollbackInput) SetStackName(v string) *ContinueUpdateRollbackInput { - s.StackName = &v - return s -} - -// The output for a ContinueUpdateRollback action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ContinueUpdateRollbackOutput -type ContinueUpdateRollbackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ContinueUpdateRollbackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContinueUpdateRollbackOutput) GoString() string { - return s.String() -} - -// The input for the CreateChangeSet action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSetInput -type CreateChangeSetInput struct { - _ struct{} `type:"structure"` - - // A list of values that you must specify before AWS CloudFormation can update - // certain stacks. Some stack templates might include resources that can affect - // permissions in your AWS account, for example, by creating new AWS Identity - // and Access Management (IAM) users. For those stacks, you must explicitly - // acknowledge their capabilities by specifying this parameter. - // - // The only valid values are CAPABILITY_IAM and CAPABILITY_NAMED_IAM. The following - // resources require you to specify this parameter: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), - // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html), - // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html), - // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html), - // AWS::IAM::Role (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html), - // AWS::IAM::User (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html), - // and AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html). - // If your stack template contains these resources, we recommend that you review - // all permissions associated with them and edit their permissions if necessary. - // - // If you have IAM resources, you can specify either capability. If you have - // IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM. If - // you don't specify this parameter, this action returns an InsufficientCapabilities - // error. - // - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). - Capabilities []*string `type:"list"` - - // The name of the change set. The name must be unique among all change sets - // that are associated with the specified stack. - // - // A change set name can contain only alphanumeric, case sensitive characters - // and hyphens. It must start with an alphabetic character and cannot exceed - // 128 characters. - // - // ChangeSetName is a required field - ChangeSetName *string `min:"1" type:"string" required:"true"` - - // The type of change set operation. To create a change set for a new stack, - // specify CREATE. To create a change set for an existing stack, specify UPDATE. - // - // If you create a change set for a new stack, AWS Cloudformation creates a - // stack with a unique stack ID, but no template or resources. The stack will - // be in the REVIEW_IN_PROGRESS (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html#d0e11995) - // state until you execute the change set. - // - // By default, AWS CloudFormation specifies UPDATE. You can't use the UPDATE - // type to create a change set for a new stack or the CREATE type to create - // a change set for an existing stack. - ChangeSetType *string `type:"string" enum:"ChangeSetType"` - - // A unique identifier for this CreateChangeSet request. Specify this token - // if you plan to retry requests so that AWS CloudFormation knows that you're - // not attempting to create another change set with the same name. You might - // retry CreateChangeSet requests to ensure that AWS CloudFormation successfully - // received them. - ClientToken *string `min:"1" type:"string"` - - // A description to help you identify this change set. - Description *string `min:"1" type:"string"` - - // The Amazon Resource Names (ARNs) of Amazon Simple Notification Service (Amazon - // SNS) topics that AWS CloudFormation associates with the stack. To remove - // all associated notification topics, specify an empty list. - NotificationARNs []*string `type:"list"` - - // A list of Parameter structures that specify input parameters for the change - // set. For more information, see the Parameter (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) - // data type. - Parameters []*Parameter `type:"list"` - - // The template resource types that you have permissions to work with if you - // execute this change set, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance. - // - // If the list of resource types doesn't include a resource type that you're - // updating, the stack update fails. By default, AWS CloudFormation grants permissions - // to all resource types. AWS Identity and Access Management (IAM) uses this - // parameter for condition keys in IAM policies for AWS CloudFormation. For - // more information, see Controlling Access with AWS Identity and Access Management - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) - // in the AWS CloudFormation User Guide. - ResourceTypes []*string `type:"list"` - - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes when executing the change set. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. AWS CloudFormation - // uses this role for all future operations on the stack. As long as users have - // permission to operate on the stack, AWS CloudFormation uses this role even - // if the users don't have permission to pass it. Ensure that the role grants - // least privilege. - // - // If you don't specify a value, AWS CloudFormation uses the role that was previously - // associated with the stack. If no role is available, AWS CloudFormation uses - // a temporary session that is generated from your user credentials. - RoleARN *string `min:"20" type:"string"` - - // The name or the unique ID of the stack for which you are creating a change - // set. AWS CloudFormation generates the change set by comparing this stack's - // information with the information that you submit, such as a modified template - // or different parameter input values. - // - // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` - - // Key-value pairs to associate with this stack. AWS CloudFormation also propagates - // these tags to resources in the stack. You can specify a maximum of 10 tags. - Tags []*Tag `type:"list"` - - // A structure that contains the body of the revised template, with a minimum - // length of 1 byte and a maximum length of 51,200 bytes. AWS CloudFormation - // generates the change set by comparing this template with the template of - // the stack that you specified. - // - // Conditional: You must specify only TemplateBody or TemplateURL. - TemplateBody *string `min:"1" type:"string"` - - // The location of the file that contains the revised template. The URL must - // point to a template (max size: 460,800 bytes) that is located in an S3 bucket. - // AWS CloudFormation generates the change set by comparing this template with - // the stack that you specified. - // - // Conditional: You must specify only TemplateBody or TemplateURL. - TemplateURL *string `min:"1" type:"string"` - - // Whether to reuse the template that is associated with the stack to create - // the change set. - UsePreviousTemplate *bool `type:"boolean"` -} - -// String returns the string representation -func (s CreateChangeSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateChangeSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateChangeSetInput"} - if s.ChangeSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) - } - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilities sets the Capabilities field's value. -func (s *CreateChangeSetInput) SetCapabilities(v []*string) *CreateChangeSetInput { - s.Capabilities = v - return s -} - -// SetChangeSetName sets the ChangeSetName field's value. -func (s *CreateChangeSetInput) SetChangeSetName(v string) *CreateChangeSetInput { - s.ChangeSetName = &v - return s -} - -// SetChangeSetType sets the ChangeSetType field's value. -func (s *CreateChangeSetInput) SetChangeSetType(v string) *CreateChangeSetInput { - s.ChangeSetType = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateChangeSetInput) SetClientToken(v string) *CreateChangeSetInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateChangeSetInput) SetDescription(v string) *CreateChangeSetInput { - s.Description = &v - return s -} - -// SetNotificationARNs sets the NotificationARNs field's value. -func (s *CreateChangeSetInput) SetNotificationARNs(v []*string) *CreateChangeSetInput { - s.NotificationARNs = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *CreateChangeSetInput) SetParameters(v []*Parameter) *CreateChangeSetInput { - s.Parameters = v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *CreateChangeSetInput) SetResourceTypes(v []*string) *CreateChangeSetInput { - s.ResourceTypes = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *CreateChangeSetInput) SetRoleARN(v string) *CreateChangeSetInput { - s.RoleARN = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *CreateChangeSetInput) SetStackName(v string) *CreateChangeSetInput { - s.StackName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateChangeSetInput) SetTags(v []*Tag) *CreateChangeSetInput { - s.Tags = v - return s -} - -// SetTemplateBody sets the TemplateBody field's value. -func (s *CreateChangeSetInput) SetTemplateBody(v string) *CreateChangeSetInput { - s.TemplateBody = &v - return s -} - -// SetTemplateURL sets the TemplateURL field's value. -func (s *CreateChangeSetInput) SetTemplateURL(v string) *CreateChangeSetInput { - s.TemplateURL = &v - return s -} - -// SetUsePreviousTemplate sets the UsePreviousTemplate field's value. -func (s *CreateChangeSetInput) SetUsePreviousTemplate(v bool) *CreateChangeSetInput { - s.UsePreviousTemplate = &v - return s -} - -// The output for the CreateChangeSet action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSetOutput -type CreateChangeSetOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the change set. - Id *string `min:"1" type:"string"` - - // The unique ID of the stack. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s CreateChangeSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateChangeSetOutput) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *CreateChangeSetOutput) SetId(v string) *CreateChangeSetOutput { - s.Id = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *CreateChangeSetOutput) SetStackId(v string) *CreateChangeSetOutput { - s.StackId = &v - return s -} - -// The input for CreateStack action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStackInput -type CreateStackInput struct { - _ struct{} `type:"structure"` - - // A list of values that you must specify before AWS CloudFormation can create - // certain stacks. Some stack templates might include resources that can affect - // permissions in your AWS account, for example, by creating new AWS Identity - // and Access Management (IAM) users. For those stacks, you must explicitly - // acknowledge their capabilities by specifying this parameter. - // - // The only valid values are CAPABILITY_IAM and CAPABILITY_NAMED_IAM. The following - // resources require you to specify this parameter: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), - // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html), - // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html), - // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html), - // AWS::IAM::Role (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html), - // AWS::IAM::User (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html), - // and AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html). - // If your stack template contains these resources, we recommend that you review - // all permissions associated with them and edit their permissions if necessary. - // - // If you have IAM resources, you can specify either capability. If you have - // IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM. If - // you don't specify this parameter, this action returns an InsufficientCapabilities - // error. - // - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). - Capabilities []*string `type:"list"` - - // Set to true to disable rollback of the stack if stack creation failed. You - // can specify either DisableRollback or OnFailure, but not both. - // - // Default: false - DisableRollback *bool `type:"boolean"` - - // The Simple Notification Service (SNS) topic ARNs to publish stack related - // events. You can find your SNS topic ARNs using the SNS console (https://console.aws.amazon.com/sns) - // or your Command Line Interface (CLI). - NotificationARNs []*string `type:"list"` - - // Determines what action will be taken if stack creation fails. This must be - // one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure - // or DisableRollback, but not both. - // - // Default: ROLLBACK - OnFailure *string `type:"string" enum:"OnFailure"` - - // A list of Parameter structures that specify input parameters for the stack. - // For more information, see the Parameter (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) - // data type. - Parameters []*Parameter `type:"list"` - - // The template resource types that you have permissions to work with for this - // create stack action, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance. - // Use the following syntax to describe template resource types: AWS::* (for - // all AWS resource), Custom::* (for all custom resources), Custom::logical_ID - // (for a specific custom resource), AWS::service_name::* (for all resources - // of a particular AWS service), and AWS::service_name::resource_logical_ID - // (for a specific AWS resource). - // - // If the list of resource types doesn't include a resource that you're creating, - // the stack creation fails. By default, AWS CloudFormation grants permissions - // to all resource types. AWS Identity and Access Management (IAM) uses this - // parameter for AWS CloudFormation-specific condition keys in IAM policies. - // For more information, see Controlling Access with AWS Identity and Access - // Management (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html). - ResourceTypes []*string `type:"list"` - - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes to create the stack. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. AWS CloudFormation - // always uses this role for all future operations on the stack. As long as - // users have permission to operate on the stack, AWS CloudFormation uses this - // role even if the users don't have permission to pass it. Ensure that the - // role grants least privilege. - // - // If you don't specify a value, AWS CloudFormation uses the role that was previously - // associated with the stack. If no role is available, AWS CloudFormation uses - // a temporary session that is generated from your user credentials. - RoleARN *string `min:"20" type:"string"` - - // The name that is associated with the stack. The name must be unique in the - // region in which you are creating the stack. - // - // A stack name can contain only alphanumeric characters (case sensitive) and - // hyphens. It must start with an alphabetic character and cannot be longer - // than 128 characters. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` - - // Structure containing the stack policy body. For more information, go to - // Prevent Updates to Stack Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) - // in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody - // or the StackPolicyURL parameter, but not both. - StackPolicyBody *string `min:"1" type:"string"` - - // Location of a file containing the stack policy. The URL must point to a policy - // (maximum size: 16 KB) located in an S3 bucket in the same region as the stack. - // You can specify either the StackPolicyBody or the StackPolicyURL parameter, - // but not both. - StackPolicyURL *string `min:"1" type:"string"` - - // Key-value pairs to associate with this stack. AWS CloudFormation also propagates - // these tags to the resources created in the stack. A maximum number of 10 - // tags can be specified. - Tags []*Tag `type:"list"` - - // Structure containing the template body with a minimum length of 1 byte and - // a maximum length of 51,200 bytes. For more information, go to Template Anatomy - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must specify either the TemplateBody or the TemplateURL - // parameter, but not both. - TemplateBody *string `min:"1" type:"string"` - - // Location of file containing the template body. The URL must point to a template - // (max size: 460,800 bytes) that is located in an Amazon S3 bucket. For more - // information, go to the Template Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must specify either the TemplateBody or the TemplateURL - // parameter, but not both. - TemplateURL *string `min:"1" type:"string"` - - // The amount of time that can pass before the stack status becomes CREATE_FAILED; - // if DisableRollback is not set or is set to false, the stack will be rolled - // back. - TimeoutInMinutes *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s CreateStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStackInput"} - if s.RoleARN != nil && len(*s.RoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackPolicyBody != nil && len(*s.StackPolicyBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyBody", 1)) - } - if s.StackPolicyURL != nil && len(*s.StackPolicyURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyURL", 1)) - } - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 1 { - invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilities sets the Capabilities field's value. -func (s *CreateStackInput) SetCapabilities(v []*string) *CreateStackInput { - s.Capabilities = v - return s -} - -// SetDisableRollback sets the DisableRollback field's value. -func (s *CreateStackInput) SetDisableRollback(v bool) *CreateStackInput { - s.DisableRollback = &v - return s -} - -// SetNotificationARNs sets the NotificationARNs field's value. -func (s *CreateStackInput) SetNotificationARNs(v []*string) *CreateStackInput { - s.NotificationARNs = v - return s -} - -// SetOnFailure sets the OnFailure field's value. -func (s *CreateStackInput) SetOnFailure(v string) *CreateStackInput { - s.OnFailure = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *CreateStackInput) SetParameters(v []*Parameter) *CreateStackInput { - s.Parameters = v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *CreateStackInput) SetResourceTypes(v []*string) *CreateStackInput { - s.ResourceTypes = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *CreateStackInput) SetRoleARN(v string) *CreateStackInput { - s.RoleARN = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *CreateStackInput) SetStackName(v string) *CreateStackInput { - s.StackName = &v - return s -} - -// SetStackPolicyBody sets the StackPolicyBody field's value. -func (s *CreateStackInput) SetStackPolicyBody(v string) *CreateStackInput { - s.StackPolicyBody = &v - return s -} - -// SetStackPolicyURL sets the StackPolicyURL field's value. -func (s *CreateStackInput) SetStackPolicyURL(v string) *CreateStackInput { - s.StackPolicyURL = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateStackInput) SetTags(v []*Tag) *CreateStackInput { - s.Tags = v - return s -} - -// SetTemplateBody sets the TemplateBody field's value. -func (s *CreateStackInput) SetTemplateBody(v string) *CreateStackInput { - s.TemplateBody = &v - return s -} - -// SetTemplateURL sets the TemplateURL field's value. -func (s *CreateStackInput) SetTemplateURL(v string) *CreateStackInput { - s.TemplateURL = &v - return s -} - -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *CreateStackInput) SetTimeoutInMinutes(v int64) *CreateStackInput { - s.TimeoutInMinutes = &v - return s -} - -// The output for a CreateStack action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStackOutput -type CreateStackOutput struct { - _ struct{} `type:"structure"` - - // Unique identifier of the stack. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s CreateStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStackOutput) GoString() string { - return s.String() -} - -// SetStackId sets the StackId field's value. -func (s *CreateStackOutput) SetStackId(v string) *CreateStackOutput { - s.StackId = &v - return s -} - -// The input for the DeleteChangeSet action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteChangeSetInput -type DeleteChangeSetInput struct { - _ struct{} `type:"structure"` - - // The name or Amazon Resource Name (ARN) of the change set that you want to - // delete. - // - // ChangeSetName is a required field - ChangeSetName *string `min:"1" type:"string" required:"true"` - - // If you specified the name of a change set to delete, specify the stack name - // or ID (ARN) that is associated with it. - StackName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteChangeSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteChangeSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteChangeSetInput"} - if s.ChangeSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) - } - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeSetName sets the ChangeSetName field's value. -func (s *DeleteChangeSetInput) SetChangeSetName(v string) *DeleteChangeSetInput { - s.ChangeSetName = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DeleteChangeSetInput) SetStackName(v string) *DeleteChangeSetInput { - s.StackName = &v - return s -} - -// The output for the DeleteChangeSet action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteChangeSetOutput -type DeleteChangeSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteChangeSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteChangeSetOutput) GoString() string { - return s.String() -} - -// The input for DeleteStack action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStackInput -type DeleteStackInput struct { - _ struct{} `type:"structure"` - - // For stacks in the DELETE_FAILED state, a list of resource logical IDs that - // are associated with the resources you want to retain. During deletion, AWS - // CloudFormation deletes the stack but does not delete the retained resources. - // - // Retaining resources is useful when you cannot delete a resource, such as - // a non-empty S3 bucket, but you want to delete the stack. - RetainResources []*string `type:"list"` - - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes to delete the stack. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. - // - // If you don't specify a value, AWS CloudFormation uses the role that was previously - // associated with the stack. If no role is available, AWS CloudFormation uses - // a temporary session that is generated from your user credentials. - RoleARN *string `min:"20" type:"string"` - - // The name or the unique stack ID that is associated with the stack. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStackInput"} - if s.RoleARN != nil && len(*s.RoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRetainResources sets the RetainResources field's value. -func (s *DeleteStackInput) SetRetainResources(v []*string) *DeleteStackInput { - s.RetainResources = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *DeleteStackInput) SetRoleARN(v string) *DeleteStackInput { - s.RoleARN = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DeleteStackInput) SetStackName(v string) *DeleteStackInput { - s.StackName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStackOutput -type DeleteStackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStackOutput) GoString() string { - return s.String() -} - -// The input for the DescribeAccountLimits action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeAccountLimitsInput -type DescribeAccountLimitsInput struct { - _ struct{} `type:"structure"` - - // A string that identifies the next page of limits that you want to retrieve. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeAccountLimitsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAccountLimitsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAccountLimitsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAccountLimitsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAccountLimitsInput) SetNextToken(v string) *DescribeAccountLimitsInput { - s.NextToken = &v - return s -} - -// The output for the DescribeAccountLimits action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeAccountLimitsOutput -type DescribeAccountLimitsOutput struct { - _ struct{} `type:"structure"` - - // An account limit structure that contain a list of AWS CloudFormation account - // limits and their values. - AccountLimits []*AccountLimit `type:"list"` - - // If the output exceeds 1 MB in size, a string that identifies the next page - // of limits. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeAccountLimitsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAccountLimitsOutput) GoString() string { - return s.String() -} - -// SetAccountLimits sets the AccountLimits field's value. -func (s *DescribeAccountLimitsOutput) SetAccountLimits(v []*AccountLimit) *DescribeAccountLimitsOutput { - s.AccountLimits = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAccountLimitsOutput) SetNextToken(v string) *DescribeAccountLimitsOutput { - s.NextToken = &v - return s -} - -// The input for the DescribeChangeSet action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeChangeSetInput -type DescribeChangeSetInput struct { - _ struct{} `type:"structure"` - - // The name or Amazon Resource Name (ARN) of the change set that you want to - // describe. - // - // ChangeSetName is a required field - ChangeSetName *string `min:"1" type:"string" required:"true"` - - // A string (provided by the DescribeChangeSet response output) that identifies - // the next page of information that you want to retrieve. - NextToken *string `min:"1" type:"string"` - - // If you specified the name of a change set, specify the stack name or ID (ARN) - // of the change set you want to describe. - StackName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeChangeSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeChangeSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeChangeSetInput"} - if s.ChangeSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) - } - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeSetName sets the ChangeSetName field's value. -func (s *DescribeChangeSetInput) SetChangeSetName(v string) *DescribeChangeSetInput { - s.ChangeSetName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeChangeSetInput) SetNextToken(v string) *DescribeChangeSetInput { - s.NextToken = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DescribeChangeSetInput) SetStackName(v string) *DescribeChangeSetInput { - s.StackName = &v - return s -} - -// The output for the DescribeChangeSet action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeChangeSetOutput -type DescribeChangeSetOutput struct { - _ struct{} `type:"structure"` - - // If you execute the change set, the list of capabilities that were explicitly - // acknowledged when the change set was created. - Capabilities []*string `type:"list"` - - // The ARN of the change set. - ChangeSetId *string `min:"1" type:"string"` - - // The name of the change set. - ChangeSetName *string `min:"1" type:"string"` - - // A list of Change structures that describes the resources AWS CloudFormation - // changes if you execute the change set. - Changes []*Change `type:"list"` - - // The start time when the change set was created, in UTC. - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Information about the change set. - Description *string `min:"1" type:"string"` - - // If the change set execution status is AVAILABLE, you can execute the change - // set. If you can’t execute the change set, the status indicates why. For example, - // a change set might be in an UNAVAILABLE state because AWS CloudFormation - // is still creating it or in an OBSOLETE state because the stack was already - // updated. - ExecutionStatus *string `type:"string" enum:"ExecutionStatus"` - - // If the output exceeds 1 MB, a string that identifies the next page of changes. - // If there is no additional page, this value is null. - NextToken *string `min:"1" type:"string"` - - // The ARNs of the Amazon Simple Notification Service (Amazon SNS) topics that - // will be associated with the stack if you execute the change set. - NotificationARNs []*string `type:"list"` - - // A list of Parameter structures that describes the input parameters and their - // values used to create the change set. For more information, see the Parameter - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) - // data type. - Parameters []*Parameter `type:"list"` - - // The ARN of the stack that is associated with the change set. - StackId *string `type:"string"` - - // The name of the stack that is associated with the change set. - StackName *string `type:"string"` - - // The current status of the change set, such as CREATE_IN_PROGRESS, CREATE_COMPLETE, - // or FAILED. - Status *string `type:"string" enum:"ChangeSetStatus"` - - // A description of the change set's status. For example, if your attempt to - // create a change set failed, AWS CloudFormation shows the error message. - StatusReason *string `type:"string"` - - // If you execute the change set, the tags that will be associated with the - // stack. - Tags []*Tag `type:"list"` -} - -// String returns the string representation -func (s DescribeChangeSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeChangeSetOutput) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *DescribeChangeSetOutput) SetCapabilities(v []*string) *DescribeChangeSetOutput { - s.Capabilities = v - return s -} - -// SetChangeSetId sets the ChangeSetId field's value. -func (s *DescribeChangeSetOutput) SetChangeSetId(v string) *DescribeChangeSetOutput { - s.ChangeSetId = &v - return s -} - -// SetChangeSetName sets the ChangeSetName field's value. -func (s *DescribeChangeSetOutput) SetChangeSetName(v string) *DescribeChangeSetOutput { - s.ChangeSetName = &v - return s -} - -// SetChanges sets the Changes field's value. -func (s *DescribeChangeSetOutput) SetChanges(v []*Change) *DescribeChangeSetOutput { - s.Changes = v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeChangeSetOutput) SetCreationTime(v time.Time) *DescribeChangeSetOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribeChangeSetOutput) SetDescription(v string) *DescribeChangeSetOutput { - s.Description = &v - return s -} - -// SetExecutionStatus sets the ExecutionStatus field's value. -func (s *DescribeChangeSetOutput) SetExecutionStatus(v string) *DescribeChangeSetOutput { - s.ExecutionStatus = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeChangeSetOutput) SetNextToken(v string) *DescribeChangeSetOutput { - s.NextToken = &v - return s -} - -// SetNotificationARNs sets the NotificationARNs field's value. -func (s *DescribeChangeSetOutput) SetNotificationARNs(v []*string) *DescribeChangeSetOutput { - s.NotificationARNs = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DescribeChangeSetOutput) SetParameters(v []*Parameter) *DescribeChangeSetOutput { - s.Parameters = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeChangeSetOutput) SetStackId(v string) *DescribeChangeSetOutput { - s.StackId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DescribeChangeSetOutput) SetStackName(v string) *DescribeChangeSetOutput { - s.StackName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeChangeSetOutput) SetStatus(v string) *DescribeChangeSetOutput { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *DescribeChangeSetOutput) SetStatusReason(v string) *DescribeChangeSetOutput { - s.StatusReason = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DescribeChangeSetOutput) SetTags(v []*Tag) *DescribeChangeSetOutput { - s.Tags = v - return s -} - -// The input for DescribeStackEvents action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackEventsInput -type DescribeStackEventsInput struct { - _ struct{} `type:"structure"` - - // A string that identifies the next page of events that you want to retrieve. - NextToken *string `min:"1" type:"string"` - - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. - StackName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeStackEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackEventsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStackEventsInput) SetNextToken(v string) *DescribeStackEventsInput { - s.NextToken = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DescribeStackEventsInput) SetStackName(v string) *DescribeStackEventsInput { - s.StackName = &v - return s -} - -// The output for a DescribeStackEvents action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackEventsOutput -type DescribeStackEventsOutput struct { - _ struct{} `type:"structure"` - - // If the output exceeds 1 MB in size, a string that identifies the next page - // of events. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` - - // A list of StackEvents structures. - StackEvents []*StackEvent `type:"list"` -} - -// String returns the string representation -func (s DescribeStackEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackEventsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStackEventsOutput) SetNextToken(v string) *DescribeStackEventsOutput { - s.NextToken = &v - return s -} - -// SetStackEvents sets the StackEvents field's value. -func (s *DescribeStackEventsOutput) SetStackEvents(v []*StackEvent) *DescribeStackEventsOutput { - s.StackEvents = v - return s -} - -// The input for DescribeStackResource action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResourceInput -type DescribeStackResourceInput struct { - _ struct{} `type:"structure"` - - // The logical name of the resource as specified in the template. - // - // Default: There is no default value. - // - // LogicalResourceId is a required field - LogicalResourceId *string `type:"string" required:"true"` - - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeStackResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackResourceInput"} - if s.LogicalResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("LogicalResourceId")) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *DescribeStackResourceInput) SetLogicalResourceId(v string) *DescribeStackResourceInput { - s.LogicalResourceId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DescribeStackResourceInput) SetStackName(v string) *DescribeStackResourceInput { - s.StackName = &v - return s -} - -// The output for a DescribeStackResource action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResourceOutput -type DescribeStackResourceOutput struct { - _ struct{} `type:"structure"` - - // A StackResourceDetail structure containing the description of the specified - // resource in the specified stack. - StackResourceDetail *StackResourceDetail `type:"structure"` -} - -// String returns the string representation -func (s DescribeStackResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackResourceOutput) GoString() string { - return s.String() -} - -// SetStackResourceDetail sets the StackResourceDetail field's value. -func (s *DescribeStackResourceOutput) SetStackResourceDetail(v *StackResourceDetail) *DescribeStackResourceOutput { - s.StackResourceDetail = v - return s -} - -// The input for DescribeStackResources action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResourcesInput -type DescribeStackResourcesInput struct { - _ struct{} `type:"structure"` - - // The logical name of the resource as specified in the template. - // - // Default: There is no default value. - LogicalResourceId *string `type:"string"` - - // The name or unique identifier that corresponds to a physical instance ID - // of a resource supported by AWS CloudFormation. - // - // For example, for an Amazon Elastic Compute Cloud (EC2) instance, PhysicalResourceId - // corresponds to the InstanceId. You can pass the EC2 InstanceId to DescribeStackResources - // to find which stack the instance belongs to and what other resources are - // part of the stack. - // - // Required: Conditional. If you do not specify PhysicalResourceId, you must - // specify StackName. - // - // Default: There is no default value. - PhysicalResourceId *string `type:"string"` - - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. - // - // Required: Conditional. If you do not specify StackName, you must specify - // PhysicalResourceId. - StackName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeStackResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackResourcesInput) GoString() string { - return s.String() -} - -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *DescribeStackResourcesInput) SetLogicalResourceId(v string) *DescribeStackResourcesInput { - s.LogicalResourceId = &v - return s -} - -// SetPhysicalResourceId sets the PhysicalResourceId field's value. -func (s *DescribeStackResourcesInput) SetPhysicalResourceId(v string) *DescribeStackResourcesInput { - s.PhysicalResourceId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DescribeStackResourcesInput) SetStackName(v string) *DescribeStackResourcesInput { - s.StackName = &v - return s -} - -// The output for a DescribeStackResources action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResourcesOutput -type DescribeStackResourcesOutput struct { - _ struct{} `type:"structure"` - - // A list of StackResource structures. - StackResources []*StackResource `type:"list"` -} - -// String returns the string representation -func (s DescribeStackResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackResourcesOutput) GoString() string { - return s.String() -} - -// SetStackResources sets the StackResources field's value. -func (s *DescribeStackResourcesOutput) SetStackResources(v []*StackResource) *DescribeStackResourcesOutput { - s.StackResources = v - return s -} - -// The input for DescribeStacks action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacksInput -type DescribeStacksInput struct { - _ struct{} `type:"structure"` - - // A string that identifies the next page of stacks that you want to retrieve. - NextToken *string `min:"1" type:"string"` - - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. - StackName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeStacksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStacksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStacksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStacksInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStacksInput) SetNextToken(v string) *DescribeStacksInput { - s.NextToken = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DescribeStacksInput) SetStackName(v string) *DescribeStacksInput { - s.StackName = &v - return s -} - -// The output for a DescribeStacks action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacksOutput -type DescribeStacksOutput struct { - _ struct{} `type:"structure"` - - // If the output exceeds 1 MB in size, a string that identifies the next page - // of stacks. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` - - // A list of stack structures. - Stacks []*Stack `type:"list"` -} - -// String returns the string representation -func (s DescribeStacksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStacksOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStacksOutput) SetNextToken(v string) *DescribeStacksOutput { - s.NextToken = &v - return s -} - -// SetStacks sets the Stacks field's value. -func (s *DescribeStacksOutput) SetStacks(v []*Stack) *DescribeStacksOutput { - s.Stacks = v - return s -} - -// The input for an EstimateTemplateCost action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/EstimateTemplateCostInput -type EstimateTemplateCostInput struct { - _ struct{} `type:"structure"` - - // A list of Parameter structures that specify input parameters. - Parameters []*Parameter `type:"list"` - - // Structure containing the template body with a minimum length of 1 byte and - // a maximum length of 51,200 bytes. (For more information, go to Template Anatomy - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide.) - // - // Conditional: You must pass TemplateBody or TemplateURL. If both are passed, - // only TemplateBody is used. - TemplateBody *string `min:"1" type:"string"` - - // Location of file containing the template body. The URL must point to a template - // that is located in an Amazon S3 bucket. For more information, go to Template - // Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must pass TemplateURL or TemplateBody. If both are passed, - // only TemplateBody is used. - TemplateURL *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EstimateTemplateCostInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EstimateTemplateCostInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EstimateTemplateCostInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EstimateTemplateCostInput"} - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParameters sets the Parameters field's value. -func (s *EstimateTemplateCostInput) SetParameters(v []*Parameter) *EstimateTemplateCostInput { - s.Parameters = v - return s -} - -// SetTemplateBody sets the TemplateBody field's value. -func (s *EstimateTemplateCostInput) SetTemplateBody(v string) *EstimateTemplateCostInput { - s.TemplateBody = &v - return s -} - -// SetTemplateURL sets the TemplateURL field's value. -func (s *EstimateTemplateCostInput) SetTemplateURL(v string) *EstimateTemplateCostInput { - s.TemplateURL = &v - return s -} - -// The output for a EstimateTemplateCost action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/EstimateTemplateCostOutput -type EstimateTemplateCostOutput struct { - _ struct{} `type:"structure"` - - // An AWS Simple Monthly Calculator URL with a query string that describes the - // resources required to run the template. - Url *string `type:"string"` -} - -// String returns the string representation -func (s EstimateTemplateCostOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EstimateTemplateCostOutput) GoString() string { - return s.String() -} - -// SetUrl sets the Url field's value. -func (s *EstimateTemplateCostOutput) SetUrl(v string) *EstimateTemplateCostOutput { - s.Url = &v - return s -} - -// The input for the ExecuteChangeSet action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ExecuteChangeSetInput -type ExecuteChangeSetInput struct { - _ struct{} `type:"structure"` - - // The name or ARN of the change set that you want use to update the specified - // stack. - // - // ChangeSetName is a required field - ChangeSetName *string `min:"1" type:"string" required:"true"` - - // If you specified the name of a change set, specify the stack name or ID (ARN) - // that is associated with the change set you want to execute. - StackName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ExecuteChangeSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecuteChangeSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecuteChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecuteChangeSetInput"} - if s.ChangeSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) - } - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeSetName sets the ChangeSetName field's value. -func (s *ExecuteChangeSetInput) SetChangeSetName(v string) *ExecuteChangeSetInput { - s.ChangeSetName = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *ExecuteChangeSetInput) SetStackName(v string) *ExecuteChangeSetInput { - s.StackName = &v - return s -} - -// The output for the ExecuteChangeSet action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ExecuteChangeSetOutput -type ExecuteChangeSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ExecuteChangeSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecuteChangeSetOutput) GoString() string { - return s.String() -} - -// The Export structure describes the exported output values for a stack. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Export -type Export struct { - _ struct{} `type:"structure"` - - // The stack that contains the exported output name and value. - ExportingStackId *string `type:"string"` - - // The name of exported output value. Use this name and the Fn::ImportValue - // function to import the associated value into other stacks. The name is defined - // in the Export field in the associated stack's Outputs section. - Name *string `type:"string"` - - // The value of the exported output, such as a resource physical ID. This value - // is defined in the Export field in the associated stack's Outputs section. - Value *string `type:"string"` -} - -// String returns the string representation -func (s Export) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Export) GoString() string { - return s.String() -} - -// SetExportingStackId sets the ExportingStackId field's value. -func (s *Export) SetExportingStackId(v string) *Export { - s.ExportingStackId = &v - return s -} - -// SetName sets the Name field's value. -func (s *Export) SetName(v string) *Export { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Export) SetValue(v string) *Export { - s.Value = &v - return s -} - -// The input for the GetStackPolicy action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetStackPolicyInput -type GetStackPolicyInput struct { - _ struct{} `type:"structure"` - - // The name or unique stack ID that is associated with the stack whose policy - // you want to get. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetStackPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStackPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStackPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStackPolicyInput"} - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackName sets the StackName field's value. -func (s *GetStackPolicyInput) SetStackName(v string) *GetStackPolicyInput { - s.StackName = &v - return s -} - -// The output for the GetStackPolicy action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetStackPolicyOutput -type GetStackPolicyOutput struct { - _ struct{} `type:"structure"` - - // Structure containing the stack policy body. (For more information, go to - // Prevent Updates to Stack Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) - // in the AWS CloudFormation User Guide.) - StackPolicyBody *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetStackPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStackPolicyOutput) GoString() string { - return s.String() -} - -// SetStackPolicyBody sets the StackPolicyBody field's value. -func (s *GetStackPolicyOutput) SetStackPolicyBody(v string) *GetStackPolicyOutput { - s.StackPolicyBody = &v - return s -} - -// The input for a GetTemplate action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplateInput -type GetTemplateInput struct { - _ struct{} `type:"structure"` - - // The name or Amazon Resource Name (ARN) of a change set for which AWS CloudFormation - // returns the associated template. If you specify a name, you must also specify - // the StackName. - ChangeSetName *string `min:"1" type:"string"` - - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. - StackName *string `type:"string"` - - // For templates that include transforms, the stage of the template that AWS - // CloudFormation returns. To get the user-submitted template, specify Original. - // To get the template after AWS CloudFormation has processed all transforms, - // specify Processed. - // - // If the template doesn't include transforms, Original and Processed return - // the same template. By default, AWS CloudFormation specifies Original. - TemplateStage *string `type:"string" enum:"TemplateStage"` -} - -// String returns the string representation -func (s GetTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateInput"} - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeSetName sets the ChangeSetName field's value. -func (s *GetTemplateInput) SetChangeSetName(v string) *GetTemplateInput { - s.ChangeSetName = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *GetTemplateInput) SetStackName(v string) *GetTemplateInput { - s.StackName = &v - return s -} - -// SetTemplateStage sets the TemplateStage field's value. -func (s *GetTemplateInput) SetTemplateStage(v string) *GetTemplateInput { - s.TemplateStage = &v - return s -} - -// The output for GetTemplate action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplateOutput -type GetTemplateOutput struct { - _ struct{} `type:"structure"` - - // The stage of the template that you can retrieve. For stacks, the Original - // and Processed templates are always available. For change sets, the Original - // template is always available. After AWS CloudFormation finishes creating - // the change set, the Processed template becomes available. - StagesAvailable []*string `type:"list"` - - // Structure containing the template body. (For more information, go to Template - // Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide.) - // - // AWS CloudFormation returns the same template that was used when the stack - // was created. - TemplateBody *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTemplateOutput) GoString() string { - return s.String() -} - -// SetStagesAvailable sets the StagesAvailable field's value. -func (s *GetTemplateOutput) SetStagesAvailable(v []*string) *GetTemplateOutput { - s.StagesAvailable = v - return s -} - -// SetTemplateBody sets the TemplateBody field's value. -func (s *GetTemplateOutput) SetTemplateBody(v string) *GetTemplateOutput { - s.TemplateBody = &v - return s -} - -// The input for the GetTemplateSummary action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplateSummaryInput -type GetTemplateSummaryInput struct { - _ struct{} `type:"structure"` - - // The name or the stack ID that is associated with the stack, which are not - // always interchangeable. For running stacks, you can specify either the stack's - // name or its unique stack ID. For deleted stack, you must specify the unique - // stack ID. - // - // Conditional: You must specify only one of the following parameters: StackName, - // TemplateBody, or TemplateURL. - StackName *string `min:"1" type:"string"` - - // Structure containing the template body with a minimum length of 1 byte and - // a maximum length of 51,200 bytes. For more information about templates, see - // Template Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must specify only one of the following parameters: StackName, - // TemplateBody, or TemplateURL. - TemplateBody *string `min:"1" type:"string"` - - // Location of file containing the template body. The URL must point to a template - // (max size: 460,800 bytes) that is located in an Amazon S3 bucket. For more - // information about templates, see Template Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must specify only one of the following parameters: StackName, - // TemplateBody, or TemplateURL. - TemplateURL *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetTemplateSummaryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTemplateSummaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateSummaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateSummaryInput"} - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackName sets the StackName field's value. -func (s *GetTemplateSummaryInput) SetStackName(v string) *GetTemplateSummaryInput { - s.StackName = &v - return s -} - -// SetTemplateBody sets the TemplateBody field's value. -func (s *GetTemplateSummaryInput) SetTemplateBody(v string) *GetTemplateSummaryInput { - s.TemplateBody = &v - return s -} - -// SetTemplateURL sets the TemplateURL field's value. -func (s *GetTemplateSummaryInput) SetTemplateURL(v string) *GetTemplateSummaryInput { - s.TemplateURL = &v - return s -} - -// The output for the GetTemplateSummary action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplateSummaryOutput -type GetTemplateSummaryOutput struct { - _ struct{} `type:"structure"` - - // The capabilities found within the template. If your template contains IAM - // resources, you must specify the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value - // for this parameter when you use the CreateStack or UpdateStack actions with - // your template; otherwise, those actions return an InsufficientCapabilities - // error. - // - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). - Capabilities []*string `type:"list"` - - // The list of resources that generated the values in the Capabilities response - // element. - CapabilitiesReason *string `type:"string"` - - // A list of the transforms that are declared in the template. - DeclaredTransforms []*string `type:"list"` - - // The value that is defined in the Description property of the template. - Description *string `min:"1" type:"string"` - - // The value that is defined for the Metadata property of the template. - Metadata *string `type:"string"` - - // A list of parameter declarations that describe various properties for each - // parameter. - Parameters []*ParameterDeclaration `type:"list"` - - // A list of all the template resource types that are defined in the template, - // such as AWS::EC2::Instance, AWS::Dynamo::Table, and Custom::MyCustomInstance. - ResourceTypes []*string `type:"list"` - - // The AWS template format version, which identifies the capabilities of the - // template. - Version *string `type:"string"` -} - -// String returns the string representation -func (s GetTemplateSummaryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTemplateSummaryOutput) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *GetTemplateSummaryOutput) SetCapabilities(v []*string) *GetTemplateSummaryOutput { - s.Capabilities = v - return s -} - -// SetCapabilitiesReason sets the CapabilitiesReason field's value. -func (s *GetTemplateSummaryOutput) SetCapabilitiesReason(v string) *GetTemplateSummaryOutput { - s.CapabilitiesReason = &v - return s -} - -// SetDeclaredTransforms sets the DeclaredTransforms field's value. -func (s *GetTemplateSummaryOutput) SetDeclaredTransforms(v []*string) *GetTemplateSummaryOutput { - s.DeclaredTransforms = v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetTemplateSummaryOutput) SetDescription(v string) *GetTemplateSummaryOutput { - s.Description = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetTemplateSummaryOutput) SetMetadata(v string) *GetTemplateSummaryOutput { - s.Metadata = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *GetTemplateSummaryOutput) SetParameters(v []*ParameterDeclaration) *GetTemplateSummaryOutput { - s.Parameters = v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *GetTemplateSummaryOutput) SetResourceTypes(v []*string) *GetTemplateSummaryOutput { - s.ResourceTypes = v - return s -} - -// SetVersion sets the Version field's value. -func (s *GetTemplateSummaryOutput) SetVersion(v string) *GetTemplateSummaryOutput { - s.Version = &v - return s -} - -// The input for the ListChangeSets action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListChangeSetsInput -type ListChangeSetsInput struct { - _ struct{} `type:"structure"` - - // A string (provided by the ListChangeSets response output) that identifies - // the next page of change sets that you want to retrieve. - NextToken *string `min:"1" type:"string"` - - // The name or the Amazon Resource Name (ARN) of the stack for which you want - // to list change sets. - // - // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListChangeSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListChangeSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListChangeSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChangeSetsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChangeSetsInput) SetNextToken(v string) *ListChangeSetsInput { - s.NextToken = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *ListChangeSetsInput) SetStackName(v string) *ListChangeSetsInput { - s.StackName = &v - return s -} - -// The output for the ListChangeSets action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListChangeSetsOutput -type ListChangeSetsOutput struct { - _ struct{} `type:"structure"` - - // If the output exceeds 1 MB, a string that identifies the next page of change - // sets. If there is no additional page, this value is null. - NextToken *string `min:"1" type:"string"` - - // A list of ChangeSetSummary structures that provides the ID and status of - // each change set for the specified stack. - Summaries []*ChangeSetSummary `type:"list"` -} - -// String returns the string representation -func (s ListChangeSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListChangeSetsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChangeSetsOutput) SetNextToken(v string) *ListChangeSetsOutput { - s.NextToken = &v - return s -} - -// SetSummaries sets the Summaries field's value. -func (s *ListChangeSetsOutput) SetSummaries(v []*ChangeSetSummary) *ListChangeSetsOutput { - s.Summaries = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListExportsInput -type ListExportsInput struct { - _ struct{} `type:"structure"` - - // A string (provided by the ListExports response output) that identifies the - // next page of exported output values that you asked to retrieve. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListExportsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListExportsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListExportsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListExportsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListExportsInput) SetNextToken(v string) *ListExportsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListExportsOutput -type ListExportsOutput struct { - _ struct{} `type:"structure"` - - // The output for the ListExports action. - Exports []*Export `type:"list"` - - // If the output exceeds 100 exported output values, a string that identifies - // the next page of exports. If there is no additional page, this value is null. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListExportsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListExportsOutput) GoString() string { - return s.String() -} - -// SetExports sets the Exports field's value. -func (s *ListExportsOutput) SetExports(v []*Export) *ListExportsOutput { - s.Exports = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListExportsOutput) SetNextToken(v string) *ListExportsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListImportsInput -type ListImportsInput struct { - _ struct{} `type:"structure"` - - // The name of the exported output value. AWS CloudFormation returns the stack - // names that are importing this value. - // - // ExportName is a required field - ExportName *string `type:"string" required:"true"` - - // A string (provided by the ListImports response output) that identifies the - // next page of stacks that are importing the specified exported output value. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListImportsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListImportsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListImportsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListImportsInput"} - if s.ExportName == nil { - invalidParams.Add(request.NewErrParamRequired("ExportName")) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExportName sets the ExportName field's value. -func (s *ListImportsInput) SetExportName(v string) *ListImportsInput { - s.ExportName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImportsInput) SetNextToken(v string) *ListImportsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListImportsOutput -type ListImportsOutput struct { - _ struct{} `type:"structure"` - - // A list of stack names that are importing the specified exported output value. - Imports []*string `type:"list"` - - // A string that identifies the next page of exports. If there is no additional - // page, this value is null. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListImportsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListImportsOutput) GoString() string { - return s.String() -} - -// SetImports sets the Imports field's value. -func (s *ListImportsOutput) SetImports(v []*string) *ListImportsOutput { - s.Imports = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImportsOutput) SetNextToken(v string) *ListImportsOutput { - s.NextToken = &v - return s -} - -// The input for the ListStackResource action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackResourcesInput -type ListStackResourcesInput struct { - _ struct{} `type:"structure"` - - // A string that identifies the next page of stack resources that you want to - // retrieve. - NextToken *string `min:"1" type:"string"` - - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ListStackResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStackResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackResourcesInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStackResourcesInput) SetNextToken(v string) *ListStackResourcesInput { - s.NextToken = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *ListStackResourcesInput) SetStackName(v string) *ListStackResourcesInput { - s.StackName = &v - return s -} - -// The output for a ListStackResources action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackResourcesOutput -type ListStackResourcesOutput struct { - _ struct{} `type:"structure"` - - // If the output exceeds 1 MB, a string that identifies the next page of stack - // resources. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` - - // A list of StackResourceSummary structures. - StackResourceSummaries []*StackResourceSummary `type:"list"` -} - -// String returns the string representation -func (s ListStackResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStackResourcesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStackResourcesOutput) SetNextToken(v string) *ListStackResourcesOutput { - s.NextToken = &v - return s -} - -// SetStackResourceSummaries sets the StackResourceSummaries field's value. -func (s *ListStackResourcesOutput) SetStackResourceSummaries(v []*StackResourceSummary) *ListStackResourcesOutput { - s.StackResourceSummaries = v - return s -} - -// The input for ListStacks action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStacksInput -type ListStacksInput struct { - _ struct{} `type:"structure"` - - // A string that identifies the next page of stacks that you want to retrieve. - NextToken *string `min:"1" type:"string"` - - // Stack status to use as a filter. Specify one or more stack status codes to - // list only stacks with the specified status codes. For a complete list of - // stack status codes, see the StackStatus parameter of the Stack data type. - StackStatusFilter []*string `type:"list"` -} - -// String returns the string representation -func (s ListStacksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStacksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListStacksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStacksInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStacksInput) SetNextToken(v string) *ListStacksInput { - s.NextToken = &v - return s -} - -// SetStackStatusFilter sets the StackStatusFilter field's value. -func (s *ListStacksInput) SetStackStatusFilter(v []*string) *ListStacksInput { - s.StackStatusFilter = v - return s -} - -// The output for ListStacks action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStacksOutput -type ListStacksOutput struct { - _ struct{} `type:"structure"` - - // If the output exceeds 1 MB in size, a string that identifies the next page - // of stacks. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` - - // A list of StackSummary structures containing information about the specified - // stacks. - StackSummaries []*StackSummary `type:"list"` -} - -// String returns the string representation -func (s ListStacksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStacksOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStacksOutput) SetNextToken(v string) *ListStacksOutput { - s.NextToken = &v - return s -} - -// SetStackSummaries sets the StackSummaries field's value. -func (s *ListStacksOutput) SetStackSummaries(v []*StackSummary) *ListStacksOutput { - s.StackSummaries = v - return s -} - -// The Output data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Output -type Output struct { - _ struct{} `type:"structure"` - - // User defined description associated with the output. - Description *string `min:"1" type:"string"` - - // The key associated with the output. - OutputKey *string `type:"string"` - - // The value associated with the output. - OutputValue *string `type:"string"` -} - -// String returns the string representation -func (s Output) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Output) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *Output) SetDescription(v string) *Output { - s.Description = &v - return s -} - -// SetOutputKey sets the OutputKey field's value. -func (s *Output) SetOutputKey(v string) *Output { - s.OutputKey = &v - return s -} - -// SetOutputValue sets the OutputValue field's value. -func (s *Output) SetOutputValue(v string) *Output { - s.OutputValue = &v - return s -} - -// The Parameter data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Parameter -type Parameter struct { - _ struct{} `type:"structure"` - - // The key associated with the parameter. If you don't specify a key and value - // for a particular parameter, AWS CloudFormation uses the default value that - // is specified in your template. - ParameterKey *string `type:"string"` - - // The value associated with the parameter. - ParameterValue *string `type:"string"` - - // During a stack update, use the existing parameter value that the stack is - // using for a given parameter key. If you specify true, do not specify a parameter - // value. - UsePreviousValue *bool `type:"boolean"` -} - -// String returns the string representation -func (s Parameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Parameter) GoString() string { - return s.String() -} - -// SetParameterKey sets the ParameterKey field's value. -func (s *Parameter) SetParameterKey(v string) *Parameter { - s.ParameterKey = &v - return s -} - -// SetParameterValue sets the ParameterValue field's value. -func (s *Parameter) SetParameterValue(v string) *Parameter { - s.ParameterValue = &v - return s -} - -// SetUsePreviousValue sets the UsePreviousValue field's value. -func (s *Parameter) SetUsePreviousValue(v bool) *Parameter { - s.UsePreviousValue = &v - return s -} - -// A set of criteria that AWS CloudFormation uses to validate parameter values. -// Although other constraints might be defined in the stack template, AWS CloudFormation -// returns only the AllowedValues property. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ParameterConstraints -type ParameterConstraints struct { - _ struct{} `type:"structure"` - - // A list of values that are permitted for a parameter. - AllowedValues []*string `type:"list"` -} - -// String returns the string representation -func (s ParameterConstraints) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ParameterConstraints) GoString() string { - return s.String() -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *ParameterConstraints) SetAllowedValues(v []*string) *ParameterConstraints { - s.AllowedValues = v - return s -} - -// The ParameterDeclaration data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ParameterDeclaration -type ParameterDeclaration struct { - _ struct{} `type:"structure"` - - // The default value of the parameter. - DefaultValue *string `type:"string"` - - // The description that is associate with the parameter. - Description *string `min:"1" type:"string"` - - // Flag that indicates whether the parameter value is shown as plain text in - // logs and in the AWS Management Console. - NoEcho *bool `type:"boolean"` - - // The criteria that AWS CloudFormation uses to validate parameter values. - ParameterConstraints *ParameterConstraints `type:"structure"` - - // The name that is associated with the parameter. - ParameterKey *string `type:"string"` - - // The type of parameter. - ParameterType *string `type:"string"` -} - -// String returns the string representation -func (s ParameterDeclaration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ParameterDeclaration) GoString() string { - return s.String() -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *ParameterDeclaration) SetDefaultValue(v string) *ParameterDeclaration { - s.DefaultValue = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ParameterDeclaration) SetDescription(v string) *ParameterDeclaration { - s.Description = &v - return s -} - -// SetNoEcho sets the NoEcho field's value. -func (s *ParameterDeclaration) SetNoEcho(v bool) *ParameterDeclaration { - s.NoEcho = &v - return s -} - -// SetParameterConstraints sets the ParameterConstraints field's value. -func (s *ParameterDeclaration) SetParameterConstraints(v *ParameterConstraints) *ParameterDeclaration { - s.ParameterConstraints = v - return s -} - -// SetParameterKey sets the ParameterKey field's value. -func (s *ParameterDeclaration) SetParameterKey(v string) *ParameterDeclaration { - s.ParameterKey = &v - return s -} - -// SetParameterType sets the ParameterType field's value. -func (s *ParameterDeclaration) SetParameterType(v string) *ParameterDeclaration { - s.ParameterType = &v - return s -} - -// The ResourceChange structure describes the resource and the action that AWS -// CloudFormation will perform on it if you execute this change set. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ResourceChange -type ResourceChange struct { - _ struct{} `type:"structure"` - - // The action that AWS CloudFormation takes on the resource, such as Add (adds - // a new resource), Modify (changes a resource), or Remove (deletes a resource). - Action *string `type:"string" enum:"ChangeAction"` - - // For the Modify action, a list of ResourceChangeDetail structures that describes - // the changes that AWS CloudFormation will make to the resource. - Details []*ResourceChangeDetail `type:"list"` - - // The resource's logical ID, which is defined in the stack's template. - LogicalResourceId *string `type:"string"` - - // The resource's physical ID (resource name). Resources that you are adding - // don't have physical IDs because they haven't been created. - PhysicalResourceId *string `type:"string"` - - // For the Modify action, indicates whether AWS CloudFormation will replace - // the resource by creating a new one and deleting the old one. This value depends - // on the value of the RequiresRecreation property in the ResourceTargetDefinition - // structure. For example, if the RequiresRecreation field is Always and the - // Evaluation field is Static, Replacement is True. If the RequiresRecreation - // field is Always and the Evaluation field is Dynamic, Replacement is Conditionally. - // - // If you have multiple changes with different RequiresRecreation values, the - // Replacement value depends on the change with the most impact. A RequiresRecreation - // value of Always has the most impact, followed by Conditionally, and then - // Never. - Replacement *string `type:"string" enum:"Replacement"` - - // The type of AWS CloudFormation resource, such as AWS::S3::Bucket. - ResourceType *string `min:"1" type:"string"` - - // For the Modify action, indicates which resource attribute is triggering this - // update, such as a change in the resource attribute's Metadata, Properties, - // or Tags. - Scope []*string `type:"list"` -} - -// String returns the string representation -func (s ResourceChange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceChange) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *ResourceChange) SetAction(v string) *ResourceChange { - s.Action = &v - return s -} - -// SetDetails sets the Details field's value. -func (s *ResourceChange) SetDetails(v []*ResourceChangeDetail) *ResourceChange { - s.Details = v - return s -} - -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *ResourceChange) SetLogicalResourceId(v string) *ResourceChange { - s.LogicalResourceId = &v - return s -} - -// SetPhysicalResourceId sets the PhysicalResourceId field's value. -func (s *ResourceChange) SetPhysicalResourceId(v string) *ResourceChange { - s.PhysicalResourceId = &v - return s -} - -// SetReplacement sets the Replacement field's value. -func (s *ResourceChange) SetReplacement(v string) *ResourceChange { - s.Replacement = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ResourceChange) SetResourceType(v string) *ResourceChange { - s.ResourceType = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ResourceChange) SetScope(v []*string) *ResourceChange { - s.Scope = v - return s -} - -// For a resource with Modify as the action, the ResourceChange structure describes -// the changes AWS CloudFormation will make to that resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ResourceChangeDetail -type ResourceChangeDetail struct { - _ struct{} `type:"structure"` - - // The identity of the entity that triggered this change. This entity is a member - // of the group that is specified by the ChangeSource field. For example, if - // you modified the value of the KeyPairName parameter, the CausingEntity is - // the name of the parameter (KeyPairName). - // - // If the ChangeSource value is DirectModification, no value is given for CausingEntity. - CausingEntity *string `type:"string"` - - // The group to which the CausingEntity value belongs. There are five entity - // groups: - // - // * ResourceReference entities are Ref intrinsic functions that refer to - // resources in the template, such as { "Ref" : "MyEC2InstanceResource" }. - // - // * ParameterReference entities are Ref intrinsic functions that get template - // parameter values, such as { "Ref" : "MyPasswordParameter" }. - // - // * ResourceAttribute entities are Fn::GetAtt intrinsic functions that get - // resource attribute values, such as { "Fn::GetAtt" : [ "MyEC2InstanceResource", - // "PublicDnsName" ] }. - // - // * DirectModification entities are changes that are made directly to the - // template. - // - // * Automatic entities are AWS::CloudFormation::Stack resource types, which - // are also known as nested stacks. If you made no changes to the AWS::CloudFormation::Stack - // resource, AWS CloudFormation sets the ChangeSource to Automatic because - // the nested stack's template might have changed. Changes to a nested stack's - // template aren't visible to AWS CloudFormation until you run an update - // on the parent stack. - ChangeSource *string `type:"string" enum:"ChangeSource"` - - // Indicates whether AWS CloudFormation can determine the target value, and - // whether the target value will change before you execute a change set. - // - // For Static evaluations, AWS CloudFormation can determine that the target - // value will change, and its value. For example, if you directly modify the - // InstanceType property of an EC2 instance, AWS CloudFormation knows that this - // property value will change, and its value, so this is a Static evaluation. - // - // For Dynamic evaluations, cannot determine the target value because it depends - // on the result of an intrinsic function, such as a Ref or Fn::GetAtt intrinsic - // function, when the stack is updated. For example, if your template includes - // a reference to a resource that is conditionally recreated, the value of the - // reference (the physical ID of the resource) might change, depending on if - // the resource is recreated. If the resource is recreated, it will have a new - // physical ID, so all references to that resource will also be updated. - Evaluation *string `type:"string" enum:"EvaluationType"` - - // A ResourceTargetDefinition structure that describes the field that AWS CloudFormation - // will change and whether the resource will be recreated. - Target *ResourceTargetDefinition `type:"structure"` -} - -// String returns the string representation -func (s ResourceChangeDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceChangeDetail) GoString() string { - return s.String() -} - -// SetCausingEntity sets the CausingEntity field's value. -func (s *ResourceChangeDetail) SetCausingEntity(v string) *ResourceChangeDetail { - s.CausingEntity = &v - return s -} - -// SetChangeSource sets the ChangeSource field's value. -func (s *ResourceChangeDetail) SetChangeSource(v string) *ResourceChangeDetail { - s.ChangeSource = &v - return s -} - -// SetEvaluation sets the Evaluation field's value. -func (s *ResourceChangeDetail) SetEvaluation(v string) *ResourceChangeDetail { - s.Evaluation = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *ResourceChangeDetail) SetTarget(v *ResourceTargetDefinition) *ResourceChangeDetail { - s.Target = v - return s -} - -// The field that AWS CloudFormation will change, such as the name of a resource's -// property, and whether the resource will be recreated. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ResourceTargetDefinition -type ResourceTargetDefinition struct { - _ struct{} `type:"structure"` - - // Indicates which resource attribute is triggering this update, such as a change - // in the resource attribute's Metadata, Properties, or Tags. - Attribute *string `type:"string" enum:"ResourceAttribute"` - - // If the Attribute value is Properties, the name of the property. For all other - // attributes, the value is null. - Name *string `type:"string"` - - // If the Attribute value is Properties, indicates whether a change to this - // property causes the resource to be recreated. The value can be Never, Always, - // or Conditionally. To determine the conditions for a Conditionally recreation, - // see the update behavior for that property (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) - // in the AWS CloudFormation User Guide. - RequiresRecreation *string `type:"string" enum:"RequiresRecreation"` -} - -// String returns the string representation -func (s ResourceTargetDefinition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceTargetDefinition) GoString() string { - return s.String() -} - -// SetAttribute sets the Attribute field's value. -func (s *ResourceTargetDefinition) SetAttribute(v string) *ResourceTargetDefinition { - s.Attribute = &v - return s -} - -// SetName sets the Name field's value. -func (s *ResourceTargetDefinition) SetName(v string) *ResourceTargetDefinition { - s.Name = &v - return s -} - -// SetRequiresRecreation sets the RequiresRecreation field's value. -func (s *ResourceTargetDefinition) SetRequiresRecreation(v string) *ResourceTargetDefinition { - s.RequiresRecreation = &v - return s -} - -// The input for the SetStackPolicy action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicyInput -type SetStackPolicyInput struct { - _ struct{} `type:"structure"` - - // The name or unique stack ID that you want to associate a policy with. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` - - // Structure containing the stack policy body. For more information, go to - // Prevent Updates to Stack Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) - // in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody - // or the StackPolicyURL parameter, but not both. - StackPolicyBody *string `min:"1" type:"string"` - - // Location of a file containing the stack policy. The URL must point to a policy - // (maximum size: 16 KB) located in an S3 bucket in the same region as the stack. - // You can specify either the StackPolicyBody or the StackPolicyURL parameter, - // but not both. - StackPolicyURL *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s SetStackPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetStackPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetStackPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetStackPolicyInput"} - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackPolicyBody != nil && len(*s.StackPolicyBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyBody", 1)) - } - if s.StackPolicyURL != nil && len(*s.StackPolicyURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyURL", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackName sets the StackName field's value. -func (s *SetStackPolicyInput) SetStackName(v string) *SetStackPolicyInput { - s.StackName = &v - return s -} - -// SetStackPolicyBody sets the StackPolicyBody field's value. -func (s *SetStackPolicyInput) SetStackPolicyBody(v string) *SetStackPolicyInput { - s.StackPolicyBody = &v - return s -} - -// SetStackPolicyURL sets the StackPolicyURL field's value. -func (s *SetStackPolicyInput) SetStackPolicyURL(v string) *SetStackPolicyInput { - s.StackPolicyURL = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicyOutput -type SetStackPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetStackPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetStackPolicyOutput) GoString() string { - return s.String() -} - -// The input for the SignalResource action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResourceInput -type SignalResourceInput struct { - _ struct{} `type:"structure"` - - // The logical ID of the resource that you want to signal. The logical ID is - // the name of the resource that given in the template. - // - // LogicalResourceId is a required field - LogicalResourceId *string `type:"string" required:"true"` - - // The stack name or unique stack ID that includes the resource that you want - // to signal. - // - // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` - - // The status of the signal, which is either success or failure. A failure signal - // causes AWS CloudFormation to immediately fail the stack creation or update. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ResourceSignalStatus"` - - // A unique ID of the signal. When you signal Amazon EC2 instances or Auto Scaling - // groups, specify the instance ID that you are signaling as the unique ID. - // If you send multiple signals to a single resource (such as signaling a wait - // condition), each signal requires a different unique ID. - // - // UniqueId is a required field - UniqueId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SignalResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SignalResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SignalResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SignalResourceInput"} - if s.LogicalResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("LogicalResourceId")) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.UniqueId == nil { - invalidParams.Add(request.NewErrParamRequired("UniqueId")) - } - if s.UniqueId != nil && len(*s.UniqueId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UniqueId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *SignalResourceInput) SetLogicalResourceId(v string) *SignalResourceInput { - s.LogicalResourceId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *SignalResourceInput) SetStackName(v string) *SignalResourceInput { - s.StackName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SignalResourceInput) SetStatus(v string) *SignalResourceInput { - s.Status = &v - return s -} - -// SetUniqueId sets the UniqueId field's value. -func (s *SignalResourceInput) SetUniqueId(v string) *SignalResourceInput { - s.UniqueId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResourceOutput -type SignalResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SignalResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SignalResourceOutput) GoString() string { - return s.String() -} - -// The Stack data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Stack -type Stack struct { - _ struct{} `type:"structure"` - - // The capabilities allowed in the stack. - Capabilities []*string `type:"list"` - - // The unique ID of the change set. - ChangeSetId *string `min:"1" type:"string"` - - // The time at which the stack was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // A user-defined description associated with the stack. - Description *string `min:"1" type:"string"` - - // Boolean to enable or disable rollback on stack creation failures: - // - // * true: disable rollback - // - // * false: enable rollback - DisableRollback *bool `type:"boolean"` - - // The time the stack was last updated. This field will only be returned if - // the stack has been updated at least once. - LastUpdatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // SNS topic ARNs to which stack related events are published. - NotificationARNs []*string `type:"list"` - - // A list of output structures. - Outputs []*Output `type:"list"` - - // A list of Parameter structures. - Parameters []*Parameter `type:"list"` - - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that is associated with the stack. During a stack operation, AWS CloudFormation - // uses this role's credentials to make calls on your behalf. - RoleARN *string `min:"20" type:"string"` - - // Unique identifier of the stack. - StackId *string `type:"string"` - - // The name associated with the stack. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` - - // Current status of the stack. - // - // StackStatus is a required field - StackStatus *string `type:"string" required:"true" enum:"StackStatus"` - - // Success/failure message associated with the stack status. - StackStatusReason *string `type:"string"` - - // A list of Tags that specify information about the stack. - Tags []*Tag `type:"list"` - - // The amount of time within which stack creation should complete. - TimeoutInMinutes *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s Stack) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Stack) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *Stack) SetCapabilities(v []*string) *Stack { - s.Capabilities = v - return s -} - -// SetChangeSetId sets the ChangeSetId field's value. -func (s *Stack) SetChangeSetId(v string) *Stack { - s.ChangeSetId = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *Stack) SetCreationTime(v time.Time) *Stack { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Stack) SetDescription(v string) *Stack { - s.Description = &v - return s -} - -// SetDisableRollback sets the DisableRollback field's value. -func (s *Stack) SetDisableRollback(v bool) *Stack { - s.DisableRollback = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *Stack) SetLastUpdatedTime(v time.Time) *Stack { - s.LastUpdatedTime = &v - return s -} - -// SetNotificationARNs sets the NotificationARNs field's value. -func (s *Stack) SetNotificationARNs(v []*string) *Stack { - s.NotificationARNs = v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *Stack) SetOutputs(v []*Output) *Stack { - s.Outputs = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *Stack) SetParameters(v []*Parameter) *Stack { - s.Parameters = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *Stack) SetRoleARN(v string) *Stack { - s.RoleARN = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *Stack) SetStackId(v string) *Stack { - s.StackId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *Stack) SetStackName(v string) *Stack { - s.StackName = &v - return s -} - -// SetStackStatus sets the StackStatus field's value. -func (s *Stack) SetStackStatus(v string) *Stack { - s.StackStatus = &v - return s -} - -// SetStackStatusReason sets the StackStatusReason field's value. -func (s *Stack) SetStackStatusReason(v string) *Stack { - s.StackStatusReason = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Stack) SetTags(v []*Tag) *Stack { - s.Tags = v - return s -} - -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *Stack) SetTimeoutInMinutes(v int64) *Stack { - s.TimeoutInMinutes = &v - return s -} - -// The StackEvent data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StackEvent -type StackEvent struct { - _ struct{} `type:"structure"` - - // The unique ID of this event. - // - // EventId is a required field - EventId *string `type:"string" required:"true"` - - // The logical name of the resource specified in the template. - LogicalResourceId *string `type:"string"` - - // The name or unique identifier associated with the physical instance of the - // resource. - PhysicalResourceId *string `type:"string"` - - // BLOB of the properties used to create the resource. - ResourceProperties *string `type:"string"` - - // Current status of the resource. - ResourceStatus *string `type:"string" enum:"ResourceStatus"` - - // Success/failure message associated with the resource. - ResourceStatusReason *string `type:"string"` - - // Type of resource. (For more information, go to AWS Resource Types Reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) - // in the AWS CloudFormation User Guide.) - ResourceType *string `min:"1" type:"string"` - - // The unique ID name of the instance of the stack. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` - - // The name associated with a stack. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` - - // Time the status was updated. - // - // Timestamp is a required field - Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s StackEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StackEvent) GoString() string { - return s.String() -} - -// SetEventId sets the EventId field's value. -func (s *StackEvent) SetEventId(v string) *StackEvent { - s.EventId = &v - return s -} - -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *StackEvent) SetLogicalResourceId(v string) *StackEvent { - s.LogicalResourceId = &v - return s -} - -// SetPhysicalResourceId sets the PhysicalResourceId field's value. -func (s *StackEvent) SetPhysicalResourceId(v string) *StackEvent { - s.PhysicalResourceId = &v - return s -} - -// SetResourceProperties sets the ResourceProperties field's value. -func (s *StackEvent) SetResourceProperties(v string) *StackEvent { - s.ResourceProperties = &v - return s -} - -// SetResourceStatus sets the ResourceStatus field's value. -func (s *StackEvent) SetResourceStatus(v string) *StackEvent { - s.ResourceStatus = &v - return s -} - -// SetResourceStatusReason sets the ResourceStatusReason field's value. -func (s *StackEvent) SetResourceStatusReason(v string) *StackEvent { - s.ResourceStatusReason = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *StackEvent) SetResourceType(v string) *StackEvent { - s.ResourceType = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *StackEvent) SetStackId(v string) *StackEvent { - s.StackId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *StackEvent) SetStackName(v string) *StackEvent { - s.StackName = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *StackEvent) SetTimestamp(v time.Time) *StackEvent { - s.Timestamp = &v - return s -} - -// The StackResource data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StackResource -type StackResource struct { - _ struct{} `type:"structure"` - - // User defined description associated with the resource. - Description *string `min:"1" type:"string"` - - // The logical name of the resource specified in the template. - // - // LogicalResourceId is a required field - LogicalResourceId *string `type:"string" required:"true"` - - // The name or unique identifier that corresponds to a physical instance ID - // of a resource supported by AWS CloudFormation. - PhysicalResourceId *string `type:"string"` - - // Current status of the resource. - // - // ResourceStatus is a required field - ResourceStatus *string `type:"string" required:"true" enum:"ResourceStatus"` - - // Success/failure message associated with the resource. - ResourceStatusReason *string `type:"string"` - - // Type of resource. (For more information, go to AWS Resource Types Reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) - // in the AWS CloudFormation User Guide.) - // - // ResourceType is a required field - ResourceType *string `min:"1" type:"string" required:"true"` - - // Unique identifier of the stack. - StackId *string `type:"string"` - - // The name associated with the stack. - StackName *string `type:"string"` - - // Time the status was updated. - // - // Timestamp is a required field - Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s StackResource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StackResource) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *StackResource) SetDescription(v string) *StackResource { - s.Description = &v - return s -} - -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *StackResource) SetLogicalResourceId(v string) *StackResource { - s.LogicalResourceId = &v - return s -} - -// SetPhysicalResourceId sets the PhysicalResourceId field's value. -func (s *StackResource) SetPhysicalResourceId(v string) *StackResource { - s.PhysicalResourceId = &v - return s -} - -// SetResourceStatus sets the ResourceStatus field's value. -func (s *StackResource) SetResourceStatus(v string) *StackResource { - s.ResourceStatus = &v - return s -} - -// SetResourceStatusReason sets the ResourceStatusReason field's value. -func (s *StackResource) SetResourceStatusReason(v string) *StackResource { - s.ResourceStatusReason = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *StackResource) SetResourceType(v string) *StackResource { - s.ResourceType = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *StackResource) SetStackId(v string) *StackResource { - s.StackId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *StackResource) SetStackName(v string) *StackResource { - s.StackName = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *StackResource) SetTimestamp(v time.Time) *StackResource { - s.Timestamp = &v - return s -} - -// Contains detailed information about the specified stack resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StackResourceDetail -type StackResourceDetail struct { - _ struct{} `type:"structure"` - - // User defined description associated with the resource. - Description *string `min:"1" type:"string"` - - // Time the status was updated. - // - // LastUpdatedTimestamp is a required field - LastUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The logical name of the resource specified in the template. - // - // LogicalResourceId is a required field - LogicalResourceId *string `type:"string" required:"true"` - - // The content of the Metadata attribute declared for the resource. For more - // information, see Metadata Attribute (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html) - // in the AWS CloudFormation User Guide. - Metadata *string `type:"string"` - - // The name or unique identifier that corresponds to a physical instance ID - // of a resource supported by AWS CloudFormation. - PhysicalResourceId *string `type:"string"` - - // Current status of the resource. - // - // ResourceStatus is a required field - ResourceStatus *string `type:"string" required:"true" enum:"ResourceStatus"` - - // Success/failure message associated with the resource. - ResourceStatusReason *string `type:"string"` - - // Type of resource. ((For more information, go to AWS Resource Types Reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) - // in the AWS CloudFormation User Guide.) - // - // ResourceType is a required field - ResourceType *string `min:"1" type:"string" required:"true"` - - // Unique identifier of the stack. - StackId *string `type:"string"` - - // The name associated with the stack. - StackName *string `type:"string"` -} - -// String returns the string representation -func (s StackResourceDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StackResourceDetail) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *StackResourceDetail) SetDescription(v string) *StackResourceDetail { - s.Description = &v - return s -} - -// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. -func (s *StackResourceDetail) SetLastUpdatedTimestamp(v time.Time) *StackResourceDetail { - s.LastUpdatedTimestamp = &v - return s -} - -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *StackResourceDetail) SetLogicalResourceId(v string) *StackResourceDetail { - s.LogicalResourceId = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *StackResourceDetail) SetMetadata(v string) *StackResourceDetail { - s.Metadata = &v - return s -} - -// SetPhysicalResourceId sets the PhysicalResourceId field's value. -func (s *StackResourceDetail) SetPhysicalResourceId(v string) *StackResourceDetail { - s.PhysicalResourceId = &v - return s -} - -// SetResourceStatus sets the ResourceStatus field's value. -func (s *StackResourceDetail) SetResourceStatus(v string) *StackResourceDetail { - s.ResourceStatus = &v - return s -} - -// SetResourceStatusReason sets the ResourceStatusReason field's value. -func (s *StackResourceDetail) SetResourceStatusReason(v string) *StackResourceDetail { - s.ResourceStatusReason = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *StackResourceDetail) SetResourceType(v string) *StackResourceDetail { - s.ResourceType = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *StackResourceDetail) SetStackId(v string) *StackResourceDetail { - s.StackId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *StackResourceDetail) SetStackName(v string) *StackResourceDetail { - s.StackName = &v - return s -} - -// Contains high-level information about the specified stack resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StackResourceSummary -type StackResourceSummary struct { - _ struct{} `type:"structure"` - - // Time the status was updated. - // - // LastUpdatedTimestamp is a required field - LastUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The logical name of the resource specified in the template. - // - // LogicalResourceId is a required field - LogicalResourceId *string `type:"string" required:"true"` - - // The name or unique identifier that corresponds to a physical instance ID - // of the resource. - PhysicalResourceId *string `type:"string"` - - // Current status of the resource. - // - // ResourceStatus is a required field - ResourceStatus *string `type:"string" required:"true" enum:"ResourceStatus"` - - // Success/failure message associated with the resource. - ResourceStatusReason *string `type:"string"` - - // Type of resource. (For more information, go to AWS Resource Types Reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) - // in the AWS CloudFormation User Guide.) - // - // ResourceType is a required field - ResourceType *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StackResourceSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StackResourceSummary) GoString() string { - return s.String() -} - -// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. -func (s *StackResourceSummary) SetLastUpdatedTimestamp(v time.Time) *StackResourceSummary { - s.LastUpdatedTimestamp = &v - return s -} - -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *StackResourceSummary) SetLogicalResourceId(v string) *StackResourceSummary { - s.LogicalResourceId = &v - return s -} - -// SetPhysicalResourceId sets the PhysicalResourceId field's value. -func (s *StackResourceSummary) SetPhysicalResourceId(v string) *StackResourceSummary { - s.PhysicalResourceId = &v - return s -} - -// SetResourceStatus sets the ResourceStatus field's value. -func (s *StackResourceSummary) SetResourceStatus(v string) *StackResourceSummary { - s.ResourceStatus = &v - return s -} - -// SetResourceStatusReason sets the ResourceStatusReason field's value. -func (s *StackResourceSummary) SetResourceStatusReason(v string) *StackResourceSummary { - s.ResourceStatusReason = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *StackResourceSummary) SetResourceType(v string) *StackResourceSummary { - s.ResourceType = &v - return s -} - -// The StackSummary Data Type -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StackSummary -type StackSummary struct { - _ struct{} `type:"structure"` - - // The time the stack was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The time the stack was deleted. - DeletionTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time the stack was last updated. This field will only be returned if - // the stack has been updated at least once. - LastUpdatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Unique stack identifier. - StackId *string `type:"string"` - - // The name associated with the stack. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` - - // The current status of the stack. - // - // StackStatus is a required field - StackStatus *string `type:"string" required:"true" enum:"StackStatus"` - - // Success/Failure message associated with the stack status. - StackStatusReason *string `type:"string"` - - // The template description of the template used to create the stack. - TemplateDescription *string `type:"string"` -} - -// String returns the string representation -func (s StackSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StackSummary) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StackSummary) SetCreationTime(v time.Time) *StackSummary { - s.CreationTime = &v - return s -} - -// SetDeletionTime sets the DeletionTime field's value. -func (s *StackSummary) SetDeletionTime(v time.Time) *StackSummary { - s.DeletionTime = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *StackSummary) SetLastUpdatedTime(v time.Time) *StackSummary { - s.LastUpdatedTime = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *StackSummary) SetStackId(v string) *StackSummary { - s.StackId = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *StackSummary) SetStackName(v string) *StackSummary { - s.StackName = &v - return s -} - -// SetStackStatus sets the StackStatus field's value. -func (s *StackSummary) SetStackStatus(v string) *StackSummary { - s.StackStatus = &v - return s -} - -// SetStackStatusReason sets the StackStatusReason field's value. -func (s *StackSummary) SetStackStatusReason(v string) *StackSummary { - s.StackStatusReason = &v - return s -} - -// SetTemplateDescription sets the TemplateDescription field's value. -func (s *StackSummary) SetTemplateDescription(v string) *StackSummary { - s.TemplateDescription = &v - return s -} - -// The Tag type enables you to specify a key-value pair that can be used to -// store information about an AWS CloudFormation stack. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // Required. A string used to identify this tag. You can specify a maximum of - // 128 characters for a tag key. Tags owned by Amazon Web Services (AWS) have - // the reserved prefix: aws:. - Key *string `type:"string"` - - // Required. A string containing the value for this tag. You can specify a maximum - // of 256 characters for a tag value. - 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 -} - -// The TemplateParameter data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/TemplateParameter -type TemplateParameter struct { - _ struct{} `type:"structure"` - - // The default value associated with the parameter. - DefaultValue *string `type:"string"` - - // User defined description associated with the parameter. - Description *string `min:"1" type:"string"` - - // Flag indicating whether the parameter should be displayed as plain text in - // logs and UIs. - NoEcho *bool `type:"boolean"` - - // The name associated with the parameter. - ParameterKey *string `type:"string"` -} - -// String returns the string representation -func (s TemplateParameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TemplateParameter) GoString() string { - return s.String() -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *TemplateParameter) SetDefaultValue(v string) *TemplateParameter { - s.DefaultValue = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *TemplateParameter) SetDescription(v string) *TemplateParameter { - s.Description = &v - return s -} - -// SetNoEcho sets the NoEcho field's value. -func (s *TemplateParameter) SetNoEcho(v bool) *TemplateParameter { - s.NoEcho = &v - return s -} - -// SetParameterKey sets the ParameterKey field's value. -func (s *TemplateParameter) SetParameterKey(v string) *TemplateParameter { - s.ParameterKey = &v - return s -} - -// The input for an UpdateStack action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInput -type UpdateStackInput struct { - _ struct{} `type:"structure"` - - // A list of values that you must specify before AWS CloudFormation can update - // certain stacks. Some stack templates might include resources that can affect - // permissions in your AWS account, for example, by creating new AWS Identity - // and Access Management (IAM) users. For those stacks, you must explicitly - // acknowledge their capabilities by specifying this parameter. - // - // The only valid values are CAPABILITY_IAM and CAPABILITY_NAMED_IAM. The following - // resources require you to specify this parameter: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), - // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html), - // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html), - // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html), - // AWS::IAM::Role (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html), - // AWS::IAM::User (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html), - // and AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html). - // If your stack template contains these resources, we recommend that you review - // all permissions associated with them and edit their permissions if necessary. - // - // If you have IAM resources, you can specify either capability. If you have - // IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM. If - // you don't specify this parameter, this action returns an InsufficientCapabilities - // error. - // - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). - Capabilities []*string `type:"list"` - - // Amazon Simple Notification Service topic Amazon Resource Names (ARNs) that - // AWS CloudFormation associates with the stack. Specify an empty list to remove - // all notification topics. - NotificationARNs []*string `type:"list"` - - // A list of Parameter structures that specify input parameters for the stack. - // For more information, see the Parameter (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) - // data type. - Parameters []*Parameter `type:"list"` - - // The template resource types that you have permissions to work with for this - // update stack action, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance. - // - // If the list of resource types doesn't include a resource that you're updating, - // the stack update fails. By default, AWS CloudFormation grants permissions - // to all resource types. AWS Identity and Access Management (IAM) uses this - // parameter for AWS CloudFormation-specific condition keys in IAM policies. - // For more information, see Controlling Access with AWS Identity and Access - // Management (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html). - ResourceTypes []*string `type:"list"` - - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes to update the stack. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. AWS CloudFormation - // always uses this role for all future operations on the stack. As long as - // users have permission to operate on the stack, AWS CloudFormation uses this - // role even if the users don't have permission to pass it. Ensure that the - // role grants least privilege. - // - // If you don't specify a value, AWS CloudFormation uses the role that was previously - // associated with the stack. If no role is available, AWS CloudFormation uses - // a temporary session that is generated from your user credentials. - RoleARN *string `min:"20" type:"string"` - - // The name or unique stack ID of the stack to update. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` - - // Structure containing a new stack policy body. You can specify either the - // StackPolicyBody or the StackPolicyURL parameter, but not both. - // - // You might update the stack policy, for example, in order to protect a new - // resource that you created during a stack update. If you do not specify a - // stack policy, the current policy that is associated with the stack is unchanged. - StackPolicyBody *string `min:"1" type:"string"` - - // Structure containing the temporary overriding stack policy body. You can - // specify either the StackPolicyDuringUpdateBody or the StackPolicyDuringUpdateURL - // parameter, but not both. - // - // If you want to update protected resources, specify a temporary overriding - // stack policy during this update. If you do not specify a stack policy, the - // current policy that is associated with the stack will be used. - StackPolicyDuringUpdateBody *string `min:"1" type:"string"` - - // Location of a file containing the temporary overriding stack policy. The - // URL must point to a policy (max size: 16KB) located in an S3 bucket in the - // same region as the stack. You can specify either the StackPolicyDuringUpdateBody - // or the StackPolicyDuringUpdateURL parameter, but not both. - // - // If you want to update protected resources, specify a temporary overriding - // stack policy during this update. If you do not specify a stack policy, the - // current policy that is associated with the stack will be used. - StackPolicyDuringUpdateURL *string `min:"1" type:"string"` - - // Location of a file containing the updated stack policy. The URL must point - // to a policy (max size: 16KB) located in an S3 bucket in the same region as - // the stack. You can specify either the StackPolicyBody or the StackPolicyURL - // parameter, but not both. - // - // You might update the stack policy, for example, in order to protect a new - // resource that you created during a stack update. If you do not specify a - // stack policy, the current policy that is associated with the stack is unchanged. - StackPolicyURL *string `min:"1" type:"string"` - - // Key-value pairs to associate with this stack. AWS CloudFormation also propagates - // these tags to supported resources in the stack. You can specify a maximum - // number of 10 tags. - // - // If you don't specify this parameter, AWS CloudFormation doesn't modify the - // stack's tags. If you specify an empty value, AWS CloudFormation removes all - // associated tags. - Tags []*Tag `type:"list"` - - // Structure containing the template body with a minimum length of 1 byte and - // a maximum length of 51,200 bytes. (For more information, go to Template Anatomy - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide.) - // - // Conditional: You must specify either the TemplateBody or the TemplateURL - // parameter, but not both. - TemplateBody *string `min:"1" type:"string"` - - // Location of file containing the template body. The URL must point to a template - // that is located in an Amazon S3 bucket. For more information, go to Template - // Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must specify either the TemplateBody or the TemplateURL - // parameter, but not both. - TemplateURL *string `min:"1" type:"string"` - - // Reuse the existing template that is associated with the stack that you are - // updating. - UsePreviousTemplate *bool `type:"boolean"` -} - -// String returns the string representation -func (s UpdateStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateStackInput"} - if s.RoleARN != nil && len(*s.RoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackPolicyBody != nil && len(*s.StackPolicyBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyBody", 1)) - } - if s.StackPolicyDuringUpdateBody != nil && len(*s.StackPolicyDuringUpdateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyDuringUpdateBody", 1)) - } - if s.StackPolicyDuringUpdateURL != nil && len(*s.StackPolicyDuringUpdateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyDuringUpdateURL", 1)) - } - if s.StackPolicyURL != nil && len(*s.StackPolicyURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyURL", 1)) - } - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilities sets the Capabilities field's value. -func (s *UpdateStackInput) SetCapabilities(v []*string) *UpdateStackInput { - s.Capabilities = v - return s -} - -// SetNotificationARNs sets the NotificationARNs field's value. -func (s *UpdateStackInput) SetNotificationARNs(v []*string) *UpdateStackInput { - s.NotificationARNs = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *UpdateStackInput) SetParameters(v []*Parameter) *UpdateStackInput { - s.Parameters = v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *UpdateStackInput) SetResourceTypes(v []*string) *UpdateStackInput { - s.ResourceTypes = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *UpdateStackInput) SetRoleARN(v string) *UpdateStackInput { - s.RoleARN = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *UpdateStackInput) SetStackName(v string) *UpdateStackInput { - s.StackName = &v - return s -} - -// SetStackPolicyBody sets the StackPolicyBody field's value. -func (s *UpdateStackInput) SetStackPolicyBody(v string) *UpdateStackInput { - s.StackPolicyBody = &v - return s -} - -// SetStackPolicyDuringUpdateBody sets the StackPolicyDuringUpdateBody field's value. -func (s *UpdateStackInput) SetStackPolicyDuringUpdateBody(v string) *UpdateStackInput { - s.StackPolicyDuringUpdateBody = &v - return s -} - -// SetStackPolicyDuringUpdateURL sets the StackPolicyDuringUpdateURL field's value. -func (s *UpdateStackInput) SetStackPolicyDuringUpdateURL(v string) *UpdateStackInput { - s.StackPolicyDuringUpdateURL = &v - return s -} - -// SetStackPolicyURL sets the StackPolicyURL field's value. -func (s *UpdateStackInput) SetStackPolicyURL(v string) *UpdateStackInput { - s.StackPolicyURL = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateStackInput) SetTags(v []*Tag) *UpdateStackInput { - s.Tags = v - return s -} - -// SetTemplateBody sets the TemplateBody field's value. -func (s *UpdateStackInput) SetTemplateBody(v string) *UpdateStackInput { - s.TemplateBody = &v - return s -} - -// SetTemplateURL sets the TemplateURL field's value. -func (s *UpdateStackInput) SetTemplateURL(v string) *UpdateStackInput { - s.TemplateURL = &v - return s -} - -// SetUsePreviousTemplate sets the UsePreviousTemplate field's value. -func (s *UpdateStackInput) SetUsePreviousTemplate(v bool) *UpdateStackInput { - s.UsePreviousTemplate = &v - return s -} - -// The output for an UpdateStack action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackOutput -type UpdateStackOutput struct { - _ struct{} `type:"structure"` - - // Unique identifier of the stack. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s UpdateStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateStackOutput) GoString() string { - return s.String() -} - -// SetStackId sets the StackId field's value. -func (s *UpdateStackOutput) SetStackId(v string) *UpdateStackOutput { - s.StackId = &v - return s -} - -// The input for ValidateTemplate action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplateInput -type ValidateTemplateInput struct { - _ struct{} `type:"structure"` - - // Structure containing the template body with a minimum length of 1 byte and - // a maximum length of 51,200 bytes. For more information, go to Template Anatomy - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must pass TemplateURL or TemplateBody. If both are passed, - // only TemplateBody is used. - TemplateBody *string `min:"1" type:"string"` - - // Location of file containing the template body. The URL must point to a template - // (max size: 460,800 bytes) that is located in an Amazon S3 bucket. For more - // information, go to Template Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must pass TemplateURL or TemplateBody. If both are passed, - // only TemplateBody is used. - TemplateURL *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ValidateTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ValidateTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidateTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidateTemplateInput"} - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTemplateBody sets the TemplateBody field's value. -func (s *ValidateTemplateInput) SetTemplateBody(v string) *ValidateTemplateInput { - s.TemplateBody = &v - return s -} - -// SetTemplateURL sets the TemplateURL field's value. -func (s *ValidateTemplateInput) SetTemplateURL(v string) *ValidateTemplateInput { - s.TemplateURL = &v - return s -} - -// The output for ValidateTemplate action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplateOutput -type ValidateTemplateOutput struct { - _ struct{} `type:"structure"` - - // The capabilities found within the template. If your template contains IAM - // resources, you must specify the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value - // for this parameter when you use the CreateStack or UpdateStack actions with - // your template; otherwise, those actions return an InsufficientCapabilities - // error. - // - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). - Capabilities []*string `type:"list"` - - // The list of resources that generated the values in the Capabilities response - // element. - CapabilitiesReason *string `type:"string"` - - // A list of the transforms that are declared in the template. - DeclaredTransforms []*string `type:"list"` - - // The description found within the template. - Description *string `min:"1" type:"string"` - - // A list of TemplateParameter structures. - Parameters []*TemplateParameter `type:"list"` -} - -// String returns the string representation -func (s ValidateTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ValidateTemplateOutput) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *ValidateTemplateOutput) SetCapabilities(v []*string) *ValidateTemplateOutput { - s.Capabilities = v - return s -} - -// SetCapabilitiesReason sets the CapabilitiesReason field's value. -func (s *ValidateTemplateOutput) SetCapabilitiesReason(v string) *ValidateTemplateOutput { - s.CapabilitiesReason = &v - return s -} - -// SetDeclaredTransforms sets the DeclaredTransforms field's value. -func (s *ValidateTemplateOutput) SetDeclaredTransforms(v []*string) *ValidateTemplateOutput { - s.DeclaredTransforms = v - return s -} - -// SetDescription sets the Description field's value. -func (s *ValidateTemplateOutput) SetDescription(v string) *ValidateTemplateOutput { - s.Description = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ValidateTemplateOutput) SetParameters(v []*TemplateParameter) *ValidateTemplateOutput { - s.Parameters = v - return s -} - -const ( - // CapabilityCapabilityIam is a Capability enum value - CapabilityCapabilityIam = "CAPABILITY_IAM" - - // CapabilityCapabilityNamedIam is a Capability enum value - CapabilityCapabilityNamedIam = "CAPABILITY_NAMED_IAM" -) - -const ( - // ChangeActionAdd is a ChangeAction enum value - ChangeActionAdd = "Add" - - // ChangeActionModify is a ChangeAction enum value - ChangeActionModify = "Modify" - - // ChangeActionRemove is a ChangeAction enum value - ChangeActionRemove = "Remove" -) - -const ( - // ChangeSetStatusCreatePending is a ChangeSetStatus enum value - ChangeSetStatusCreatePending = "CREATE_PENDING" - - // ChangeSetStatusCreateInProgress is a ChangeSetStatus enum value - ChangeSetStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // ChangeSetStatusCreateComplete is a ChangeSetStatus enum value - ChangeSetStatusCreateComplete = "CREATE_COMPLETE" - - // ChangeSetStatusDeleteComplete is a ChangeSetStatus enum value - ChangeSetStatusDeleteComplete = "DELETE_COMPLETE" - - // ChangeSetStatusFailed is a ChangeSetStatus enum value - ChangeSetStatusFailed = "FAILED" -) - -const ( - // ChangeSetTypeCreate is a ChangeSetType enum value - ChangeSetTypeCreate = "CREATE" - - // ChangeSetTypeUpdate is a ChangeSetType enum value - ChangeSetTypeUpdate = "UPDATE" -) - -const ( - // ChangeSourceResourceReference is a ChangeSource enum value - ChangeSourceResourceReference = "ResourceReference" - - // ChangeSourceParameterReference is a ChangeSource enum value - ChangeSourceParameterReference = "ParameterReference" - - // ChangeSourceResourceAttribute is a ChangeSource enum value - ChangeSourceResourceAttribute = "ResourceAttribute" - - // ChangeSourceDirectModification is a ChangeSource enum value - ChangeSourceDirectModification = "DirectModification" - - // ChangeSourceAutomatic is a ChangeSource enum value - ChangeSourceAutomatic = "Automatic" -) - -const ( - // ChangeTypeResource is a ChangeType enum value - ChangeTypeResource = "Resource" -) - -const ( - // EvaluationTypeStatic is a EvaluationType enum value - EvaluationTypeStatic = "Static" - - // EvaluationTypeDynamic is a EvaluationType enum value - EvaluationTypeDynamic = "Dynamic" -) - -const ( - // ExecutionStatusUnavailable is a ExecutionStatus enum value - ExecutionStatusUnavailable = "UNAVAILABLE" - - // ExecutionStatusAvailable is a ExecutionStatus enum value - ExecutionStatusAvailable = "AVAILABLE" - - // ExecutionStatusExecuteInProgress is a ExecutionStatus enum value - ExecutionStatusExecuteInProgress = "EXECUTE_IN_PROGRESS" - - // ExecutionStatusExecuteComplete is a ExecutionStatus enum value - ExecutionStatusExecuteComplete = "EXECUTE_COMPLETE" - - // ExecutionStatusExecuteFailed is a ExecutionStatus enum value - ExecutionStatusExecuteFailed = "EXECUTE_FAILED" - - // ExecutionStatusObsolete is a ExecutionStatus enum value - ExecutionStatusObsolete = "OBSOLETE" -) - -const ( - // OnFailureDoNothing is a OnFailure enum value - OnFailureDoNothing = "DO_NOTHING" - - // OnFailureRollback is a OnFailure enum value - OnFailureRollback = "ROLLBACK" - - // OnFailureDelete is a OnFailure enum value - OnFailureDelete = "DELETE" -) - -const ( - // ReplacementTrue is a Replacement enum value - ReplacementTrue = "True" - - // ReplacementFalse is a Replacement enum value - ReplacementFalse = "False" - - // ReplacementConditional is a Replacement enum value - ReplacementConditional = "Conditional" -) - -const ( - // RequiresRecreationNever is a RequiresRecreation enum value - RequiresRecreationNever = "Never" - - // RequiresRecreationConditionally is a RequiresRecreation enum value - RequiresRecreationConditionally = "Conditionally" - - // RequiresRecreationAlways is a RequiresRecreation enum value - RequiresRecreationAlways = "Always" -) - -const ( - // ResourceAttributeProperties is a ResourceAttribute enum value - ResourceAttributeProperties = "Properties" - - // ResourceAttributeMetadata is a ResourceAttribute enum value - ResourceAttributeMetadata = "Metadata" - - // ResourceAttributeCreationPolicy is a ResourceAttribute enum value - ResourceAttributeCreationPolicy = "CreationPolicy" - - // ResourceAttributeUpdatePolicy is a ResourceAttribute enum value - ResourceAttributeUpdatePolicy = "UpdatePolicy" - - // ResourceAttributeDeletionPolicy is a ResourceAttribute enum value - ResourceAttributeDeletionPolicy = "DeletionPolicy" - - // ResourceAttributeTags is a ResourceAttribute enum value - ResourceAttributeTags = "Tags" -) - -const ( - // ResourceSignalStatusSuccess is a ResourceSignalStatus enum value - ResourceSignalStatusSuccess = "SUCCESS" - - // ResourceSignalStatusFailure is a ResourceSignalStatus enum value - ResourceSignalStatusFailure = "FAILURE" -) - -const ( - // ResourceStatusCreateInProgress is a ResourceStatus enum value - ResourceStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // ResourceStatusCreateFailed is a ResourceStatus enum value - ResourceStatusCreateFailed = "CREATE_FAILED" - - // ResourceStatusCreateComplete is a ResourceStatus enum value - ResourceStatusCreateComplete = "CREATE_COMPLETE" - - // ResourceStatusDeleteInProgress is a ResourceStatus enum value - ResourceStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // ResourceStatusDeleteFailed is a ResourceStatus enum value - ResourceStatusDeleteFailed = "DELETE_FAILED" - - // ResourceStatusDeleteComplete is a ResourceStatus enum value - ResourceStatusDeleteComplete = "DELETE_COMPLETE" - - // ResourceStatusDeleteSkipped is a ResourceStatus enum value - ResourceStatusDeleteSkipped = "DELETE_SKIPPED" - - // ResourceStatusUpdateInProgress is a ResourceStatus enum value - ResourceStatusUpdateInProgress = "UPDATE_IN_PROGRESS" - - // ResourceStatusUpdateFailed is a ResourceStatus enum value - ResourceStatusUpdateFailed = "UPDATE_FAILED" - - // ResourceStatusUpdateComplete is a ResourceStatus enum value - ResourceStatusUpdateComplete = "UPDATE_COMPLETE" -) - -const ( - // StackStatusCreateInProgress is a StackStatus enum value - StackStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // StackStatusCreateFailed is a StackStatus enum value - StackStatusCreateFailed = "CREATE_FAILED" - - // StackStatusCreateComplete is a StackStatus enum value - StackStatusCreateComplete = "CREATE_COMPLETE" - - // StackStatusRollbackInProgress is a StackStatus enum value - StackStatusRollbackInProgress = "ROLLBACK_IN_PROGRESS" - - // StackStatusRollbackFailed is a StackStatus enum value - StackStatusRollbackFailed = "ROLLBACK_FAILED" - - // StackStatusRollbackComplete is a StackStatus enum value - StackStatusRollbackComplete = "ROLLBACK_COMPLETE" - - // StackStatusDeleteInProgress is a StackStatus enum value - StackStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // StackStatusDeleteFailed is a StackStatus enum value - StackStatusDeleteFailed = "DELETE_FAILED" - - // StackStatusDeleteComplete is a StackStatus enum value - StackStatusDeleteComplete = "DELETE_COMPLETE" - - // StackStatusUpdateInProgress is a StackStatus enum value - StackStatusUpdateInProgress = "UPDATE_IN_PROGRESS" - - // StackStatusUpdateCompleteCleanupInProgress is a StackStatus enum value - StackStatusUpdateCompleteCleanupInProgress = "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS" - - // StackStatusUpdateComplete is a StackStatus enum value - StackStatusUpdateComplete = "UPDATE_COMPLETE" - - // StackStatusUpdateRollbackInProgress is a StackStatus enum value - StackStatusUpdateRollbackInProgress = "UPDATE_ROLLBACK_IN_PROGRESS" - - // StackStatusUpdateRollbackFailed is a StackStatus enum value - StackStatusUpdateRollbackFailed = "UPDATE_ROLLBACK_FAILED" - - // StackStatusUpdateRollbackCompleteCleanupInProgress is a StackStatus enum value - StackStatusUpdateRollbackCompleteCleanupInProgress = "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS" - - // StackStatusUpdateRollbackComplete is a StackStatus enum value - StackStatusUpdateRollbackComplete = "UPDATE_ROLLBACK_COMPLETE" - - // StackStatusReviewInProgress is a StackStatus enum value - StackStatusReviewInProgress = "REVIEW_IN_PROGRESS" -) - -const ( - // TemplateStageOriginal is a TemplateStage enum value - TemplateStageOriginal = "Original" - - // TemplateStageProcessed is a TemplateStage enum value - TemplateStageProcessed = "Processed" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go deleted file mode 100644 index 29fae92..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go +++ /dev/null @@ -1,40 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudformation - -const ( - - // ErrCodeAlreadyExistsException for service response error code - // "AlreadyExistsException". - // - // Resource with the name requested already exists. - ErrCodeAlreadyExistsException = "AlreadyExistsException" - - // ErrCodeChangeSetNotFoundException for service response error code - // "ChangeSetNotFound". - // - // The specified change set name or ID doesn't exit. To view valid change sets - // for a stack, use the ListChangeSets action. - ErrCodeChangeSetNotFoundException = "ChangeSetNotFound" - - // ErrCodeInsufficientCapabilitiesException for service response error code - // "InsufficientCapabilitiesException". - // - // The template contains resources with capabilities that were not specified - // in the Capabilities parameter. - ErrCodeInsufficientCapabilitiesException = "InsufficientCapabilitiesException" - - // ErrCodeInvalidChangeSetStatusException for service response error code - // "InvalidChangeSetStatus". - // - // The specified change set cannot be used to update the stack. For example, - // the change set status might be CREATE_IN_PROGRESS or the stack status might - // be UPDATE_IN_PROGRESS. - ErrCodeInvalidChangeSetStatusException = "InvalidChangeSetStatus" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // Quota for the resource has already been reached. - ErrCodeLimitExceededException = "LimitExceededException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go deleted file mode 100644 index 0591a32..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go +++ /dev/null @@ -1,109 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudformation - -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" -) - -// AWS CloudFormation allows you to create and manage AWS infrastructure deployments -// predictably and repeatedly. You can use AWS CloudFormation to leverage AWS -// products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store, -// Amazon Simple Notification Service, Elastic Load Balancing, and Auto Scaling -// to build highly-reliable, highly scalable, cost-effective applications without -// creating or configuring the underlying AWS infrastructure. -// -// With AWS CloudFormation, you declare all of your resources and dependencies -// in a template file. The template defines a collection of resources as a single -// unit called a stack. AWS CloudFormation creates and deletes all member resources -// of the stack together and manages all dependencies between the resources -// for you. -// -// For more information about AWS CloudFormation, see the AWS CloudFormation -// Product Page (http://aws.amazon.com/cloudformation/). -// -// Amazon CloudFormation makes use of other AWS products. For additional technical -// information about a specific AWS product, see its technical documentation -// (http://docs.aws.amazon.com/). -// 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/cloudformation-2010-05-15 -type CloudFormation 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 = "cloudformation" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CloudFormation 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 CloudFormation client from just a session. -// svc := cloudformation.New(mySession) -// -// // Create a CloudFormation client with additional configuration -// svc := cloudformation.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudFormation { - 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) *CloudFormation { - svc := &CloudFormation{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2010-05-15", - }, - 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 CloudFormation operation and runs any -// custom request initialization. -func (c *CloudFormation) 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/cloudformation/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go deleted file mode 100644 index 5960e94..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go +++ /dev/null @@ -1,217 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudformation - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilStackCreateComplete uses the AWS CloudFormation API operation -// DescribeStacks 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 *CloudFormation) WaitUntilStackCreateComplete(input *DescribeStacksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStacks", - Delay: 30, - MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Stacks[].StackStatus", - Expected: "CREATE_COMPLETE", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "CREATE_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "DELETE_COMPLETE", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "DELETE_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "ROLLBACK_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "ROLLBACK_COMPLETE", - }, - { - State: "failure", - Matcher: "error", - Argument: "", - Expected: "ValidationError", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilStackDeleteComplete uses the AWS CloudFormation API operation -// DescribeStacks 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 *CloudFormation) WaitUntilStackDeleteComplete(input *DescribeStacksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStacks", - Delay: 30, - MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Stacks[].StackStatus", - Expected: "DELETE_COMPLETE", - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "ValidationError", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "DELETE_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "CREATE_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "ROLLBACK_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "UPDATE_ROLLBACK_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "UPDATE_ROLLBACK_IN_PROGRESS", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilStackExists uses the AWS CloudFormation API operation -// DescribeStacks 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 *CloudFormation) WaitUntilStackExists(input *DescribeStacksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStacks", - Delay: 5, - MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "status", - Argument: "", - Expected: 200, - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "ValidationError", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilStackUpdateComplete uses the AWS CloudFormation API operation -// DescribeStacks 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 *CloudFormation) WaitUntilStackUpdateComplete(input *DescribeStacksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStacks", - Delay: 30, - MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Stacks[].StackStatus", - Expected: "UPDATE_COMPLETE", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "UPDATE_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "UPDATE_ROLLBACK_FAILED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Stacks[].StackStatus", - Expected: "UPDATE_ROLLBACK_COMPLETE", - }, - { - State: "failure", - Matcher: "error", - Argument: "", - Expected: "ValidationError", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} 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 17a7eb5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go +++ /dev/null @@ -1,9899 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudfront provides a client for Amazon CloudFront. -package cloudfront - -import ( - "fmt" - "time" - - "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 = "CreateCloudFrontOriginAccessIdentity2016_11_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-2016-11-25/CreateCloudFrontOriginAccessIdentity -func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *CreateCloudFrontOriginAccessIdentityOutput) { - op := &request.Operation{ - Name: opCreateCloudFrontOriginAccessIdentity, - HTTPMethod: "POST", - HTTPPath: "/2016-11-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-2016-11-25/CreateCloudFrontOriginAccessIdentity -func (c *CloudFront) CreateCloudFrontOriginAccessIdentity(input *CreateCloudFrontOriginAccessIdentityInput) (*CreateCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.CreateCloudFrontOriginAccessIdentityRequest(input) - err := req.Send() - return out, err -} - -const opCreateDistribution = "CreateDistribution2016_11_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-2016-11-25/CreateDistribution -func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) (req *request.Request, output *CreateDistributionOutput) { - op := &request.Operation{ - Name: opCreateDistribution, - HTTPMethod: "POST", - HTTPPath: "/2016-11-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 GET 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. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistribution -func (c *CloudFront) CreateDistribution(input *CreateDistributionInput) (*CreateDistributionOutput, error) { - req, out := c.CreateDistributionRequest(input) - err := req.Send() - return out, err -} - -const opCreateDistributionWithTags = "CreateDistributionWithTags2016_11_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-2016-11-25/CreateDistributionWithTags -func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistributionWithTagsInput) (req *request.Request, output *CreateDistributionWithTagsOutput) { - op := &request.Operation{ - Name: opCreateDistributionWithTags, - HTTPMethod: "POST", - HTTPPath: "/2016-11-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. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/CreateDistributionWithTags -func (c *CloudFront) CreateDistributionWithTags(input *CreateDistributionWithTagsInput) (*CreateDistributionWithTagsOutput, error) { - req, out := c.CreateDistributionWithTagsRequest(input) - err := req.Send() - return out, err -} - -const opCreateInvalidation = "CreateInvalidation2016_11_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-2016-11-25/CreateInvalidation -func (c *CloudFront) CreateInvalidationRequest(input *CreateInvalidationInput) (req *request.Request, output *CreateInvalidationOutput) { - op := &request.Operation{ - Name: opCreateInvalidation, - HTTPMethod: "POST", - HTTPPath: "/2016-11-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-2016-11-25/CreateInvalidation -func (c *CloudFront) CreateInvalidation(input *CreateInvalidationInput) (*CreateInvalidationOutput, error) { - req, out := c.CreateInvalidationRequest(input) - err := req.Send() - return out, err -} - -const opCreateStreamingDistribution = "CreateStreamingDistribution2016_11_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-2016-11-25/CreateStreamingDistribution -func (c *CloudFront) CreateStreamingDistributionRequest(input *CreateStreamingDistributionInput) (req *request.Request, output *CreateStreamingDistributionOutput) { - op := &request.Operation{ - Name: opCreateStreamingDistribution, - HTTPMethod: "POST", - HTTPPath: "/2016-11-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-2016-11-25/CreateStreamingDistribution -func (c *CloudFront) CreateStreamingDistribution(input *CreateStreamingDistributionInput) (*CreateStreamingDistributionOutput, error) { - req, out := c.CreateStreamingDistributionRequest(input) - err := req.Send() - return out, err -} - -const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTags2016_11_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-2016-11-25/CreateStreamingDistributionWithTags -func (c *CloudFront) CreateStreamingDistributionWithTagsRequest(input *CreateStreamingDistributionWithTagsInput) (req *request.Request, output *CreateStreamingDistributionWithTagsOutput) { - op := &request.Operation{ - Name: opCreateStreamingDistributionWithTags, - HTTPMethod: "POST", - HTTPPath: "/2016-11-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-2016-11-25/CreateStreamingDistributionWithTags -func (c *CloudFront) CreateStreamingDistributionWithTags(input *CreateStreamingDistributionWithTagsInput) (*CreateStreamingDistributionWithTagsOutput, error) { - req, out := c.CreateStreamingDistributionWithTagsRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2016_11_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-2016-11-25/DeleteCloudFrontOriginAccessIdentity -func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCloudFrontOriginAccessIdentityInput) (req *request.Request, output *DeleteCloudFrontOriginAccessIdentityOutput) { - op := &request.Operation{ - Name: opDeleteCloudFrontOriginAccessIdentity, - HTTPMethod: "DELETE", - HTTPPath: "/2016-11-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-2016-11-25/DeleteCloudFrontOriginAccessIdentity -func (c *CloudFront) DeleteCloudFrontOriginAccessIdentity(input *DeleteCloudFrontOriginAccessIdentityInput) (*DeleteCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.DeleteCloudFrontOriginAccessIdentityRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDistribution = "DeleteDistribution2016_11_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-2016-11-25/DeleteDistribution -func (c *CloudFront) DeleteDistributionRequest(input *DeleteDistributionInput) (req *request.Request, output *DeleteDistributionOutput) { - op := &request.Operation{ - Name: opDeleteDistribution, - HTTPMethod: "DELETE", - HTTPPath: "/2016-11-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-2016-11-25/DeleteDistribution -func (c *CloudFront) DeleteDistribution(input *DeleteDistributionInput) (*DeleteDistributionOutput, error) { - req, out := c.DeleteDistributionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteStreamingDistribution = "DeleteStreamingDistribution2016_11_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-2016-11-25/DeleteStreamingDistribution -func (c *CloudFront) DeleteStreamingDistributionRequest(input *DeleteStreamingDistributionInput) (req *request.Request, output *DeleteStreamingDistributionOutput) { - op := &request.Operation{ - Name: opDeleteStreamingDistribution, - HTTPMethod: "DELETE", - HTTPPath: "/2016-11-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-2016-11-25/DeleteStreamingDistribution -func (c *CloudFront) DeleteStreamingDistribution(input *DeleteStreamingDistributionInput) (*DeleteStreamingDistributionOutput, error) { - req, out := c.DeleteStreamingDistributionRequest(input) - err := req.Send() - return out, err -} - -const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity2016_11_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-2016-11-25/GetCloudFrontOriginAccessIdentity -func (c *CloudFront) GetCloudFrontOriginAccessIdentityRequest(input *GetCloudFrontOriginAccessIdentityInput) (req *request.Request, output *GetCloudFrontOriginAccessIdentityOutput) { - op := &request.Operation{ - Name: opGetCloudFrontOriginAccessIdentity, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/GetCloudFrontOriginAccessIdentity -func (c *CloudFront) GetCloudFrontOriginAccessIdentity(input *GetCloudFrontOriginAccessIdentityInput) (*GetCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.GetCloudFrontOriginAccessIdentityRequest(input) - err := req.Send() - return out, err -} - -const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIdentityConfig2016_11_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-2016-11-25/GetCloudFrontOriginAccessIdentityConfig -func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfigRequest(input *GetCloudFrontOriginAccessIdentityConfigInput) (req *request.Request, output *GetCloudFrontOriginAccessIdentityConfigOutput) { - op := &request.Operation{ - Name: opGetCloudFrontOriginAccessIdentityConfig, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/GetCloudFrontOriginAccessIdentityConfig -func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfig(input *GetCloudFrontOriginAccessIdentityConfigInput) (*GetCloudFrontOriginAccessIdentityConfigOutput, error) { - req, out := c.GetCloudFrontOriginAccessIdentityConfigRequest(input) - err := req.Send() - return out, err -} - -const opGetDistribution = "GetDistribution2016_11_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-2016-11-25/GetDistribution -func (c *CloudFront) GetDistributionRequest(input *GetDistributionInput) (req *request.Request, output *GetDistributionOutput) { - op := &request.Operation{ - Name: opGetDistribution, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/GetDistribution -func (c *CloudFront) GetDistribution(input *GetDistributionInput) (*GetDistributionOutput, error) { - req, out := c.GetDistributionRequest(input) - err := req.Send() - return out, err -} - -const opGetDistributionConfig = "GetDistributionConfig2016_11_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-2016-11-25/GetDistributionConfig -func (c *CloudFront) GetDistributionConfigRequest(input *GetDistributionConfigInput) (req *request.Request, output *GetDistributionConfigOutput) { - op := &request.Operation{ - Name: opGetDistributionConfig, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/GetDistributionConfig -func (c *CloudFront) GetDistributionConfig(input *GetDistributionConfigInput) (*GetDistributionConfigOutput, error) { - req, out := c.GetDistributionConfigRequest(input) - err := req.Send() - return out, err -} - -const opGetInvalidation = "GetInvalidation2016_11_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-2016-11-25/GetInvalidation -func (c *CloudFront) GetInvalidationRequest(input *GetInvalidationInput) (req *request.Request, output *GetInvalidationOutput) { - op := &request.Operation{ - Name: opGetInvalidation, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/GetInvalidation -func (c *CloudFront) GetInvalidation(input *GetInvalidationInput) (*GetInvalidationOutput, error) { - req, out := c.GetInvalidationRequest(input) - err := req.Send() - return out, err -} - -const opGetStreamingDistribution = "GetStreamingDistribution2016_11_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-2016-11-25/GetStreamingDistribution -func (c *CloudFront) GetStreamingDistributionRequest(input *GetStreamingDistributionInput) (req *request.Request, output *GetStreamingDistributionOutput) { - op := &request.Operation{ - Name: opGetStreamingDistribution, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/GetStreamingDistribution -func (c *CloudFront) GetStreamingDistribution(input *GetStreamingDistributionInput) (*GetStreamingDistributionOutput, error) { - req, out := c.GetStreamingDistributionRequest(input) - err := req.Send() - return out, err -} - -const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2016_11_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-2016-11-25/GetStreamingDistributionConfig -func (c *CloudFront) GetStreamingDistributionConfigRequest(input *GetStreamingDistributionConfigInput) (req *request.Request, output *GetStreamingDistributionConfigOutput) { - op := &request.Operation{ - Name: opGetStreamingDistributionConfig, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/GetStreamingDistributionConfig -func (c *CloudFront) GetStreamingDistributionConfig(input *GetStreamingDistributionConfigInput) (*GetStreamingDistributionConfigOutput, error) { - req, out := c.GetStreamingDistributionConfigRequest(input) - err := req.Send() - return out, err -} - -const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdentities2016_11_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-2016-11-25/ListCloudFrontOriginAccessIdentities -func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesRequest(input *ListCloudFrontOriginAccessIdentitiesInput) (req *request.Request, output *ListCloudFrontOriginAccessIdentitiesOutput) { - op := &request.Operation{ - Name: opListCloudFrontOriginAccessIdentities, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/ListCloudFrontOriginAccessIdentities -func (c *CloudFront) ListCloudFrontOriginAccessIdentities(input *ListCloudFrontOriginAccessIdentitiesInput) (*ListCloudFrontOriginAccessIdentitiesOutput, error) { - req, out := c.ListCloudFrontOriginAccessIdentitiesRequest(input) - err := req.Send() - return out, err -} - -// 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(p *ListCloudFrontOriginAccessIdentitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListCloudFrontOriginAccessIdentitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListCloudFrontOriginAccessIdentitiesOutput), lastPage) - }) -} - -const opListDistributions = "ListDistributions2016_11_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-2016-11-25/ListDistributions -func (c *CloudFront) ListDistributionsRequest(input *ListDistributionsInput) (req *request.Request, output *ListDistributionsOutput) { - op := &request.Operation{ - Name: opListDistributions, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/ListDistributions -func (c *CloudFront) ListDistributions(input *ListDistributionsInput) (*ListDistributionsOutput, error) { - req, out := c.ListDistributionsRequest(input) - err := req.Send() - return out, err -} - -// 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(p *ListDistributionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDistributionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDistributionsOutput), lastPage) - }) -} - -const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2016_11_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-2016-11-25/ListDistributionsByWebACLId -func (c *CloudFront) ListDistributionsByWebACLIdRequest(input *ListDistributionsByWebACLIdInput) (req *request.Request, output *ListDistributionsByWebACLIdOutput) { - op := &request.Operation{ - Name: opListDistributionsByWebACLId, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/ListDistributionsByWebACLId -func (c *CloudFront) ListDistributionsByWebACLId(input *ListDistributionsByWebACLIdInput) (*ListDistributionsByWebACLIdOutput, error) { - req, out := c.ListDistributionsByWebACLIdRequest(input) - err := req.Send() - return out, err -} - -const opListInvalidations = "ListInvalidations2016_11_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-2016-11-25/ListInvalidations -func (c *CloudFront) ListInvalidationsRequest(input *ListInvalidationsInput) (req *request.Request, output *ListInvalidationsOutput) { - op := &request.Operation{ - Name: opListInvalidations, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/ListInvalidations -func (c *CloudFront) ListInvalidations(input *ListInvalidationsInput) (*ListInvalidationsOutput, error) { - req, out := c.ListInvalidationsRequest(input) - err := req.Send() - return out, err -} - -// 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(p *ListInvalidationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInvalidationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInvalidationsOutput), lastPage) - }) -} - -const opListStreamingDistributions = "ListStreamingDistributions2016_11_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-2016-11-25/ListStreamingDistributions -func (c *CloudFront) ListStreamingDistributionsRequest(input *ListStreamingDistributionsInput) (req *request.Request, output *ListStreamingDistributionsOutput) { - op := &request.Operation{ - Name: opListStreamingDistributions, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/ListStreamingDistributions -func (c *CloudFront) ListStreamingDistributions(input *ListStreamingDistributionsInput) (*ListStreamingDistributionsOutput, error) { - req, out := c.ListStreamingDistributionsRequest(input) - err := req.Send() - return out, err -} - -// 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(p *ListStreamingDistributionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStreamingDistributionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStreamingDistributionsOutput), lastPage) - }) -} - -const opListTagsForResource = "ListTagsForResource2016_11_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-2016-11-25/ListTagsForResource -func (c *CloudFront) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/2016-11-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-2016-11-25/ListTagsForResource -func (c *CloudFront) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opTagResource = "TagResource2016_11_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-2016-11-25/TagResource -func (c *CloudFront) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/2016-11-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-2016-11-25/TagResource -func (c *CloudFront) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - err := req.Send() - return out, err -} - -const opUntagResource = "UntagResource2016_11_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-2016-11-25/UntagResource -func (c *CloudFront) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/2016-11-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-2016-11-25/UntagResource -func (c *CloudFront) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - err := req.Send() - return out, err -} - -const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIdentity2016_11_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-2016-11-25/UpdateCloudFrontOriginAccessIdentity -func (c *CloudFront) UpdateCloudFrontOriginAccessIdentityRequest(input *UpdateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *UpdateCloudFrontOriginAccessIdentityOutput) { - op := &request.Operation{ - Name: opUpdateCloudFrontOriginAccessIdentity, - HTTPMethod: "PUT", - HTTPPath: "/2016-11-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-2016-11-25/UpdateCloudFrontOriginAccessIdentity -func (c *CloudFront) UpdateCloudFrontOriginAccessIdentity(input *UpdateCloudFrontOriginAccessIdentityInput) (*UpdateCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.UpdateCloudFrontOriginAccessIdentityRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDistribution = "UpdateDistribution2016_11_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-2016-11-25/UpdateDistribution -func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) (req *request.Request, output *UpdateDistributionOutput) { - op := &request.Operation{ - Name: opUpdateDistribution, - HTTPMethod: "PUT", - HTTPPath: "/2016-11-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. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2016-11-25/UpdateDistribution -func (c *CloudFront) UpdateDistribution(input *UpdateDistributionInput) (*UpdateDistributionOutput, error) { - req, out := c.UpdateDistributionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateStreamingDistribution = "UpdateStreamingDistribution2016_11_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-2016-11-25/UpdateStreamingDistribution -func (c *CloudFront) UpdateStreamingDistributionRequest(input *UpdateStreamingDistributionInput) (req *request.Request, output *UpdateStreamingDistributionOutput) { - op := &request.Operation{ - Name: opUpdateStreamingDistribution, - HTTPMethod: "PUT", - HTTPPath: "/2016-11-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-2016-11-25/UpdateStreamingDistribution -func (c *CloudFront) UpdateStreamingDistribution(input *UpdateStreamingDistributionInput) (*UpdateStreamingDistributionOutput, error) { - req, out := c.UpdateStreamingDistributionRequest(input) - err := req.Send() - return out, err -} - -// 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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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"` - - // The origin protocol policy to apply to your origin. - // - // OriginProtocolPolicy is a required field - OriginProtocolPolicy *string `type:"string" required:"true" enum:"OriginProtocolPolicy"` - - // 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 -} - -// SetOriginProtocolPolicy sets the OriginProtocolPolicy field's value. -func (s *CustomOriginConfig) SetOriginProtocolPolicy(v string) *CustomOriginConfig { - s.OriginProtocolPolicy = &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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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"` - - // 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 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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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-2016-11-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 must request permission - // to use this feature, and you 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 072359c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go +++ /dev/null @@ -1,325 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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" - - // 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/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go deleted file mode 100644 index b815814..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go +++ /dev/null @@ -1,94 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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-2016-11-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: "2016-11-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 c14e9d1..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go +++ /dev/null @@ -1,88 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudfront - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// 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 { - waiterCfg := waiter.Config{ - Operation: "GetDistribution", - Delay: 60, - MaxAttempts: 25, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "Distribution.Status", - Expected: "Deployed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "GetInvalidation", - Delay: 20, - MaxAttempts: 30, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "Invalidation.Status", - Expected: "Completed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "GetStreamingDistribution", - Delay: 60, - MaxAttempts: 25, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "StreamingDistribution.Status", - Expected: "Deployed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go deleted file mode 100644 index f3ada2c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go +++ /dev/null @@ -1,3850 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudtrail provides a client for AWS CloudTrail. -package cloudtrail - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAddTags = "AddTags" - -// AddTagsRequest generates a "aws/request.Request" representing the -// client's request for the AddTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsRequest method. -// req, resp := client.AddTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags -func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { - op := &request.Operation{ - Name: opAddTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsInput{} - } - - output = &AddTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddTags API operation for AWS CloudTrail. -// -// Adds one or more tags to a trail, up to a limit of 50. Tags must be unique -// per trail. Overwrites an existing tag's value when a new value is specified -// for an existing tag key. If you specify a key without a value, the tag will -// be created with the specified key and a value of null. You can tag a trail -// that applies to all regions only from the region in which the trail was created -// (that is, from its home 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 AWS CloudTrail's -// API operation AddTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// This exception is thrown when the specified resource is not found. -// -// * ErrCodeARNInvalidException "ARNInvalidException" -// This exception is thrown when an operation is called with an invalid trail -// ARN. The format of a trail ARN is: -// -// arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail -// -// * ErrCodeResourceTypeNotSupportedException "ResourceTypeNotSupportedException" -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// * ErrCodeTagsLimitExceededException "TagsLimitExceededException" -// The number of tags per trail has exceeded the permitted amount. Currently, -// the limit is 50. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeInvalidTagParameterException "InvalidTagParameterException" -// This exception is thrown when the key or value specified for the tag does -// not match the regular expression ^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags -func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { - req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err -} - -const opCreateTrail = "CreateTrail" - -// CreateTrailRequest generates a "aws/request.Request" representing the -// client's request for the CreateTrail operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTrail for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTrail method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTrailRequest method. -// req, resp := client.CreateTrailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail -func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.Request, output *CreateTrailOutput) { - op := &request.Operation{ - Name: opCreateTrail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTrailInput{} - } - - output = &CreateTrailOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTrail API operation for AWS CloudTrail. -// -// Creates a trail that specifies the settings for delivery of log data to an -// Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective -// of the region in which they were 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 AWS CloudTrail's -// API operation CreateTrail for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMaximumNumberOfTrailsExceededException "MaximumNumberOfTrailsExceededException" -// This exception is thrown when the maximum number of trails is reached. -// -// * ErrCodeTrailAlreadyExistsException "TrailAlreadyExistsException" -// This exception is thrown when the specified trail already exists. -// -// * ErrCodeS3BucketDoesNotExistException "S3BucketDoesNotExistException" -// This exception is thrown when the specified S3 bucket does not exist. -// -// * ErrCodeInsufficientS3BucketPolicyException "InsufficientS3BucketPolicyException" -// This exception is thrown when the policy on the S3 bucket is not sufficient. -// -// * ErrCodeInsufficientSnsTopicPolicyException "InsufficientSnsTopicPolicyException" -// This exception is thrown when the policy on the SNS topic is not sufficient. -// -// * ErrCodeInsufficientEncryptionPolicyException "InsufficientEncryptionPolicyException" -// This exception is thrown when the policy on the S3 bucket or KMS key is not -// sufficient. -// -// * ErrCodeInvalidS3BucketNameException "InvalidS3BucketNameException" -// This exception is thrown when the provided S3 bucket name is not valid. -// -// * ErrCodeInvalidS3PrefixException "InvalidS3PrefixException" -// This exception is thrown when the provided S3 prefix is not valid. -// -// * ErrCodeInvalidSnsTopicNameException "InvalidSnsTopicNameException" -// This exception is thrown when the provided SNS topic name is not valid. -// -// * ErrCodeInvalidKmsKeyIdException "InvalidKmsKeyIdException" -// This exception is thrown when the KMS key ARN is invalid. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeTrailNotProvidedException "TrailNotProvidedException" -// This exception is deprecated. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" -// This exception is thrown when the combination of parameters provided is not -// valid. -// -// * ErrCodeKmsKeyNotFoundException "KmsKeyNotFoundException" -// This exception is thrown when the KMS key does not exist, or when the S3 -// bucket and the KMS key are not in the same region. -// -// * ErrCodeKmsKeyDisabledException "KmsKeyDisabledException" -// This exception is deprecated. -// -// * ErrCodeKmsException "KmsException" -// This exception is thrown when there is an issue with the specified KMS key -// and the trail can’t be updated. -// -// * ErrCodeInvalidCloudWatchLogsLogGroupArnException "InvalidCloudWatchLogsLogGroupArnException" -// This exception is thrown when the provided CloudWatch log group is not valid. -// -// * ErrCodeInvalidCloudWatchLogsRoleArnException "InvalidCloudWatchLogsRoleArnException" -// This exception is thrown when the provided role is not valid. -// -// * ErrCodeCloudWatchLogsDeliveryUnavailableException "CloudWatchLogsDeliveryUnavailableException" -// Cannot set a CloudWatch Logs delivery for this region. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail -func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) { - req, out := c.CreateTrailRequest(input) - err := req.Send() - return out, err -} - -const opDeleteTrail = "DeleteTrail" - -// DeleteTrailRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTrail operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteTrail for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteTrail method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteTrailRequest method. -// req, resp := client.DeleteTrailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail -func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.Request, output *DeleteTrailOutput) { - op := &request.Operation{ - Name: opDeleteTrail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTrailInput{} - } - - output = &DeleteTrailOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTrail API operation for AWS CloudTrail. -// -// Deletes a trail. This operation must be called from the region in which the -// trail was created. DeleteTrail cannot be called on the shadow trails (replicated -// trails in other regions) of a trail that is enabled in all regions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudTrail's -// API operation DeleteTrail for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" -// This exception is thrown when the trail with the given name is not found. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException" -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail -func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) { - req, out := c.DeleteTrailRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTrails = "DescribeTrails" - -// DescribeTrailsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTrails operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTrails for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTrails method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTrailsRequest method. -// req, resp := client.DescribeTrailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails -func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *request.Request, output *DescribeTrailsOutput) { - op := &request.Operation{ - Name: opDescribeTrails, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTrailsInput{} - } - - output = &DescribeTrailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTrails API operation for AWS CloudTrail. -// -// Retrieves settings for the trail associated with the current region for 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 AWS CloudTrail's -// API operation DescribeTrails for usage and error information. -// -// Returned Error Codes: -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails -func (c *CloudTrail) DescribeTrails(input *DescribeTrailsInput) (*DescribeTrailsOutput, error) { - req, out := c.DescribeTrailsRequest(input) - err := req.Send() - return out, err -} - -const opGetEventSelectors = "GetEventSelectors" - -// GetEventSelectorsRequest generates a "aws/request.Request" representing the -// client's request for the GetEventSelectors operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetEventSelectors for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetEventSelectors method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetEventSelectorsRequest method. -// req, resp := client.GetEventSelectorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors -func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) (req *request.Request, output *GetEventSelectorsOutput) { - op := &request.Operation{ - Name: opGetEventSelectors, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetEventSelectorsInput{} - } - - output = &GetEventSelectorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEventSelectors API operation for AWS CloudTrail. -// -// Describes the settings for the event selectors that you configured for your -// trail. The information returned for your event selectors includes the following: -// -// * The S3 objects that you are logging for data events. -// -// * If your event selector includes management events. -// -// * If your event selector includes read-only events, write-only events, -// or all. -// -// For more information, see Logging Data and Management Events for Trails -// (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html) -// in the AWS CloudTrail 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 AWS CloudTrail's -// API operation GetEventSelectors for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" -// This exception is thrown when the trail with the given name is not found. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors -func (c *CloudTrail) GetEventSelectors(input *GetEventSelectorsInput) (*GetEventSelectorsOutput, error) { - req, out := c.GetEventSelectorsRequest(input) - err := req.Send() - return out, err -} - -const opGetTrailStatus = "GetTrailStatus" - -// GetTrailStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetTrailStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetTrailStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetTrailStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetTrailStatusRequest method. -// req, resp := client.GetTrailStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus -func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *request.Request, output *GetTrailStatusOutput) { - op := &request.Operation{ - Name: opGetTrailStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTrailStatusInput{} - } - - output = &GetTrailStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTrailStatus API operation for AWS CloudTrail. -// -// Returns a JSON-formatted list of information about the specified trail. Fields -// include information on delivery errors, Amazon SNS and Amazon S3 errors, -// and start and stop logging times for each trail. This operation returns trail -// status from a single region. To return trail status from all regions, you -// must call the operation on each 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 AWS CloudTrail's -// API operation GetTrailStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" -// This exception is thrown when the trail with the given name is not found. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus -func (c *CloudTrail) GetTrailStatus(input *GetTrailStatusInput) (*GetTrailStatusOutput, error) { - req, out := c.GetTrailStatusRequest(input) - err := req.Send() - return out, err -} - -const opListPublicKeys = "ListPublicKeys" - -// ListPublicKeysRequest generates a "aws/request.Request" representing the -// client's request for the ListPublicKeys operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListPublicKeys for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListPublicKeys method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPublicKeysRequest method. -// req, resp := client.ListPublicKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys -func (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) (req *request.Request, output *ListPublicKeysOutput) { - op := &request.Operation{ - Name: opListPublicKeys, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListPublicKeysInput{} - } - - output = &ListPublicKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPublicKeys API operation for AWS CloudTrail. -// -// Returns all public keys whose private keys were used to sign the digest files -// within the specified time range. The public key is needed to validate digest -// files that were signed with its corresponding private key. -// -// CloudTrail uses different private/public key pairs per region. Each digest -// file is signed with a private key unique to its region. Therefore, when you -// validate a digest file from a particular region, you must look in the same -// region for its corresponding public key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudTrail's -// API operation ListPublicKeys for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidTimeRangeException "InvalidTimeRangeException" -// Occurs if the timestamp values are invalid. Either the start time occurs -// after the end time or the time range is outside the range of possible values. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// * ErrCodeInvalidTokenException "InvalidTokenException" -// Reserved for future use. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys -func (c *CloudTrail) ListPublicKeys(input *ListPublicKeysInput) (*ListPublicKeysOutput, error) { - req, out := c.ListPublicKeysRequest(input) - err := req.Send() - return out, err -} - -const opListTags = "ListTags" - -// ListTagsRequest generates a "aws/request.Request" representing the -// client's request for the ListTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsRequest method. -// req, resp := client.ListTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags -func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { - op := &request.Operation{ - Name: opListTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsInput{} - } - - output = &ListTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTags API operation for AWS CloudTrail. -// -// Lists the tags for the trail in the current 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 AWS CloudTrail's -// API operation ListTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// This exception is thrown when the specified resource is not found. -// -// * ErrCodeARNInvalidException "ARNInvalidException" -// This exception is thrown when an operation is called with an invalid trail -// ARN. The format of a trail ARN is: -// -// arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail -// -// * ErrCodeResourceTypeNotSupportedException "ResourceTypeNotSupportedException" -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// * ErrCodeInvalidTokenException "InvalidTokenException" -// Reserved for future use. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags -func (c *CloudTrail) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) - err := req.Send() - return out, err -} - -const opLookupEvents = "LookupEvents" - -// LookupEventsRequest generates a "aws/request.Request" representing the -// client's request for the LookupEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See LookupEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the LookupEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the LookupEventsRequest method. -// req, resp := client.LookupEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents -func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request.Request, output *LookupEventsOutput) { - op := &request.Operation{ - Name: opLookupEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &LookupEventsInput{} - } - - output = &LookupEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// LookupEvents API operation for AWS CloudTrail. -// -// Looks up API activity events captured by CloudTrail that create, update, -// or delete resources in your account. Events for a region can be looked up -// for the times in which you had CloudTrail turned on in that region during -// the last seven days. Lookup supports the following attributes: -// -// * Event ID -// -// * Event name -// -// * Event source -// -// * Resource name -// -// * Resource type -// -// * User name -// -// All attributes are optional. The default number of results returned is 10, -// with a maximum of 50 possible. The response includes a token that you can -// use to get the next page of results. -// -// The rate of lookup requests is limited to one per second per account. If -// this limit is exceeded, a throttling error occurs. -// -// Events that occurred during the selected time range will not be available -// for lookup if CloudTrail logging was not enabled when the events occurred. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudTrail's -// API operation LookupEvents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidLookupAttributesException "InvalidLookupAttributesException" -// Occurs when an invalid lookup attribute is specified. -// -// * ErrCodeInvalidTimeRangeException "InvalidTimeRangeException" -// Occurs if the timestamp values are invalid. Either the start time occurs -// after the end time or the time range is outside the range of possible values. -// -// * ErrCodeInvalidMaxResultsException "InvalidMaxResultsException" -// This exception is thrown if the limit specified is invalid. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// Invalid token or token that was previously used in a request with different -// parameters. This exception is thrown if the token is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents -func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput, error) { - req, out := c.LookupEventsRequest(input) - err := req.Send() - return out, err -} - -// LookupEventsPages iterates over the pages of a LookupEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See LookupEvents 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 LookupEvents operation. -// pageNum := 0 -// err := client.LookupEventsPages(params, -// func(page *LookupEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudTrail) LookupEventsPages(input *LookupEventsInput, fn func(p *LookupEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.LookupEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*LookupEventsOutput), lastPage) - }) -} - -const opPutEventSelectors = "PutEventSelectors" - -// PutEventSelectorsRequest generates a "aws/request.Request" representing the -// client's request for the PutEventSelectors operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutEventSelectors for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutEventSelectors method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutEventSelectorsRequest method. -// req, resp := client.PutEventSelectorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors -func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (req *request.Request, output *PutEventSelectorsOutput) { - op := &request.Operation{ - Name: opPutEventSelectors, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutEventSelectorsInput{} - } - - output = &PutEventSelectorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutEventSelectors API operation for AWS CloudTrail. -// -// Configures an event selector for your trail. Use event selectors to specify -// whether you want your trail to log management and/or data events. When an -// event occurs in your account, CloudTrail evaluates the event selectors in -// all trails. For each trail, if the event matches any event selector, the -// trail processes and logs the event. If the event doesn't match any event -// selector, the trail doesn't log the event. -// -// Example -// -// You create an event selector for a trail and specify that you want write-only -// events. -// -// The EC2 GetConsoleOutput and RunInstances API operations occur in your account. -// -// CloudTrail evaluates whether the events match your event selectors. -// -// The RunInstances is a write-only event and it matches your event selector. -// The trail logs the event. -// -// The GetConsoleOutput is a read-only event but it doesn't match your event -// selector. The trail doesn't log the event. -// -// The PutEventSelectors operation must be called from the region in which the -// trail was created; otherwise, an InvalidHomeRegionException is thrown. -// -// You can configure up to five event selectors for each trail. For more information, -// see Logging Data and Management Events for Trails (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html) -// in the AWS CloudTrail 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 AWS CloudTrail's -// API operation PutEventSelectors for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" -// This exception is thrown when the trail with the given name is not found. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException" -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// * ErrCodeInvalidEventSelectorsException "InvalidEventSelectorsException" -// This exception is thrown when the PutEventSelectors operation is called with -// an invalid number of event selectors, data resources, or an invalid value -// for a parameter: -// -// * Specify a valid number of event selectors (1 to 5) for a trail. -// -// * Specify a valid number of data resources (1 to 250) for an event selector. -// -// * Specify a valid value for a parameter. For example, specifying the ReadWriteType -// parameter with a value of read-only is invalid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors -func (c *CloudTrail) PutEventSelectors(input *PutEventSelectorsInput) (*PutEventSelectorsOutput, error) { - req, out := c.PutEventSelectorsRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTags = "RemoveTags" - -// RemoveTagsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsRequest method. -// req, resp := client.RemoveTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags -func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { - op := &request.Operation{ - Name: opRemoveTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsInput{} - } - - output = &RemoveTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTags API operation for AWS CloudTrail. -// -// Removes the specified tags from a trail. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudTrail's -// API operation RemoveTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// This exception is thrown when the specified resource is not found. -// -// * ErrCodeARNInvalidException "ARNInvalidException" -// This exception is thrown when an operation is called with an invalid trail -// ARN. The format of a trail ARN is: -// -// arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail -// -// * ErrCodeResourceTypeNotSupportedException "ResourceTypeNotSupportedException" -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeInvalidTagParameterException "InvalidTagParameterException" -// This exception is thrown when the key or value specified for the tag does -// not match the regular expression ^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags -func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { - req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err -} - -const opStartLogging = "StartLogging" - -// StartLoggingRequest generates a "aws/request.Request" representing the -// client's request for the StartLogging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartLogging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartLogging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartLoggingRequest method. -// req, resp := client.StartLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging -func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request.Request, output *StartLoggingOutput) { - op := &request.Operation{ - Name: opStartLogging, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartLoggingInput{} - } - - output = &StartLoggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartLogging API operation for AWS CloudTrail. -// -// Starts the recording of AWS API calls and log file delivery for a trail. -// For a trail that is enabled in all regions, this operation must be called -// from the region in which the trail was created. This operation cannot be -// called on the shadow trails (replicated trails in other regions) of a trail -// that is enabled in all regions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudTrail's -// API operation StartLogging for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" -// This exception is thrown when the trail with the given name is not found. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException" -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging -func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) { - req, out := c.StartLoggingRequest(input) - err := req.Send() - return out, err -} - -const opStopLogging = "StopLogging" - -// StopLoggingRequest generates a "aws/request.Request" representing the -// client's request for the StopLogging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopLogging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopLogging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopLoggingRequest method. -// req, resp := client.StopLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging -func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.Request, output *StopLoggingOutput) { - op := &request.Operation{ - Name: opStopLogging, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopLoggingInput{} - } - - output = &StopLoggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopLogging API operation for AWS CloudTrail. -// -// Suspends the recording of AWS API calls and log file delivery for the specified -// trail. Under most circumstances, there is no need to use this action. You -// can update a trail without stopping it first. This action is the only way -// to stop recording. For a trail enabled in all regions, this operation must -// be called from the region in which the trail was created, or an InvalidHomeRegionException -// will occur. This operation cannot be called on the shadow trails (replicated -// trails in other regions) of a trail enabled in all regions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudTrail's -// API operation StopLogging for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" -// This exception is thrown when the trail with the given name is not found. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException" -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging -func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) { - req, out := c.StopLoggingRequest(input) - err := req.Send() - return out, err -} - -const opUpdateTrail = "UpdateTrail" - -// UpdateTrailRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTrail operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateTrail for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateTrail method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateTrailRequest method. -// req, resp := client.UpdateTrailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail -func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.Request, output *UpdateTrailOutput) { - op := &request.Operation{ - Name: opUpdateTrail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateTrailInput{} - } - - output = &UpdateTrailOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTrail API operation for AWS CloudTrail. -// -// Updates the settings that specify delivery of log files. Changes to a trail -// do not require stopping the CloudTrail service. Use this action to designate -// an existing bucket for log delivery. If the existing bucket has previously -// been a target for CloudTrail log files, an IAM policy exists for the bucket. -// UpdateTrail must be called from the region in which the trail was created; -// otherwise, an InvalidHomeRegionException is thrown. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CloudTrail's -// API operation UpdateTrail for usage and error information. -// -// Returned Error Codes: -// * ErrCodeS3BucketDoesNotExistException "S3BucketDoesNotExistException" -// This exception is thrown when the specified S3 bucket does not exist. -// -// * ErrCodeInsufficientS3BucketPolicyException "InsufficientS3BucketPolicyException" -// This exception is thrown when the policy on the S3 bucket is not sufficient. -// -// * ErrCodeInsufficientSnsTopicPolicyException "InsufficientSnsTopicPolicyException" -// This exception is thrown when the policy on the SNS topic is not sufficient. -// -// * ErrCodeInsufficientEncryptionPolicyException "InsufficientEncryptionPolicyException" -// This exception is thrown when the policy on the S3 bucket or KMS key is not -// sufficient. -// -// * ErrCodeTrailNotFoundException "TrailNotFoundException" -// This exception is thrown when the trail with the given name is not found. -// -// * ErrCodeInvalidS3BucketNameException "InvalidS3BucketNameException" -// This exception is thrown when the provided S3 bucket name is not valid. -// -// * ErrCodeInvalidS3PrefixException "InvalidS3PrefixException" -// This exception is thrown when the provided S3 prefix is not valid. -// -// * ErrCodeInvalidSnsTopicNameException "InvalidSnsTopicNameException" -// This exception is thrown when the provided SNS topic name is not valid. -// -// * ErrCodeInvalidKmsKeyIdException "InvalidKmsKeyIdException" -// This exception is thrown when the KMS key ARN is invalid. -// -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// * Start with a letter or number, and end with a letter or number -// -// * Be between 3 and 128 characters -// -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. -// -// * Not be in IP address format (for example, 192.168.5.4) -// -// * ErrCodeTrailNotProvidedException "TrailNotProvidedException" -// This exception is deprecated. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" -// This exception is thrown when the combination of parameters provided is not -// valid. -// -// * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException" -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// * ErrCodeKmsKeyNotFoundException "KmsKeyNotFoundException" -// This exception is thrown when the KMS key does not exist, or when the S3 -// bucket and the KMS key are not in the same region. -// -// * ErrCodeKmsKeyDisabledException "KmsKeyDisabledException" -// This exception is deprecated. -// -// * ErrCodeKmsException "KmsException" -// This exception is thrown when there is an issue with the specified KMS key -// and the trail can’t be updated. -// -// * ErrCodeInvalidCloudWatchLogsLogGroupArnException "InvalidCloudWatchLogsLogGroupArnException" -// This exception is thrown when the provided CloudWatch log group is not valid. -// -// * ErrCodeInvalidCloudWatchLogsRoleArnException "InvalidCloudWatchLogsRoleArnException" -// This exception is thrown when the provided role is not valid. -// -// * ErrCodeCloudWatchLogsDeliveryUnavailableException "CloudWatchLogsDeliveryUnavailableException" -// Cannot set a CloudWatch Logs delivery for this region. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// This exception is thrown when the requested operation is not supported. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" -// This exception is thrown when the requested operation is not permitted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail -func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) { - req, out := c.UpdateTrailRequest(input) - err := req.Send() - return out, err -} - -// Specifies the tags to add to a trail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTagsRequest -type AddTagsInput struct { - _ struct{} `type:"structure"` - - // Specifies the ARN of the trail to which one or more tags will be added. The - // format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // Contains a list of CloudTrail tags, up to a limit of 50 - TagsList []*Tag `type:"list"` -} - -// String returns the string representation -func (s AddTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.TagsList != nil { - for i, v := range s.TagsList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *AddTagsInput) SetResourceId(v string) *AddTagsInput { - s.ResourceId = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *AddTagsInput) SetTagsList(v []*Tag) *AddTagsInput { - s.TagsList = v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTagsResponse -type AddTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsOutput) GoString() string { - return s.String() -} - -// Specifies the settings for each trail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrailRequest -type CreateTrailInput struct { - _ struct{} `type:"structure"` - - // Specifies a log group name using an Amazon Resource Name (ARN), a unique - // identifier that represents the log group to which CloudTrail logs will be - // delivered. Not required unless you specify CloudWatchLogsRoleArn. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies whether log file integrity validation is enabled. The default is - // false. - // - // When you disable log file integrity validation, the chain of digest files - // is broken after one hour. CloudTrail will not create digest files for log - // files that were delivered during a period in which log file integrity validation - // was disabled. For example, if you enable log file integrity validation at - // noon on January 1, disable it at noon on January 2, and re-enable it at noon - // on January 10, digest files will not be created for the log files delivered - // from noon on January 2 to noon on January 10. The same applies whenever you - // stop CloudTrail logging or delete a trail. - EnableLogFileValidation *bool `type:"boolean"` - - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail is created in the current region or in all regions. - // The default is false. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. - // The value can be an alias name prefixed by "alias/", a fully specified ARN - // to an alias, a fully specified ARN to a key, or a globally unique identifier. - // - // Examples: - // - // * alias/MyAliasName - // - // * arn:aws:kms:us-east-1:123456789012:alias/MyAliasName - // - // * arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * 12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies the name of the trail. The name must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are invalid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). - // - // S3BucketName is a required field - S3BucketName *string `type:"string" required:"true"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - // The maximum length is 200 characters. - S3KeyPrefix *string `type:"string"` - - // Specifies the name of the Amazon SNS topic defined for notification of log - // file delivery. The maximum length is 256 characters. - SnsTopicName *string `type:"string"` -} - -// String returns the string representation -func (s CreateTrailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrailInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.S3BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *CreateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailInput { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *CreateTrailInput) SetCloudWatchLogsRoleArn(v string) *CreateTrailInput { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetEnableLogFileValidation sets the EnableLogFileValidation field's value. -func (s *CreateTrailInput) SetEnableLogFileValidation(v bool) *CreateTrailInput { - s.EnableLogFileValidation = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *CreateTrailInput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailInput { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *CreateTrailInput) SetIsMultiRegionTrail(v bool) *CreateTrailInput { - s.IsMultiRegionTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateTrailInput) SetKmsKeyId(v string) *CreateTrailInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTrailInput) SetName(v string) *CreateTrailInput { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *CreateTrailInput) SetS3BucketName(v string) *CreateTrailInput { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *CreateTrailInput) SetS3KeyPrefix(v string) *CreateTrailInput { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *CreateTrailInput) SetSnsTopicName(v string) *CreateTrailInput { - s.SnsTopicName = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrailResponse -type CreateTrailOutput struct { - _ struct{} `type:"structure"` - - // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail - // logs will be delivered. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail exists in one region or in all regions. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the format: - // - // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies whether log file integrity validation is enabled. - LogFileValidationEnabled *bool `type:"boolean"` - - // Specifies the name of the trail. - Name *string `type:"string"` - - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. - S3BucketName *string `type:"string"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - S3KeyPrefix *string `type:"string"` - - // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications - // when log files are delivered. The format of a topic ARN is: - // - // arn:aws:sns:us-east-1:123456789012:MyTopic - SnsTopicARN *string `type:"string"` - - // This field is deprecated. Use SnsTopicARN. - SnsTopicName *string `deprecated:"true" type:"string"` - - // Specifies the ARN of the trail that was created. The format of a trail ARN - // is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - TrailARN *string `type:"string"` -} - -// String returns the string representation -func (s CreateTrailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrailOutput) GoString() string { - return s.String() -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *CreateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailOutput { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *CreateTrailOutput) SetCloudWatchLogsRoleArn(v string) *CreateTrailOutput { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *CreateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailOutput { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *CreateTrailOutput) SetIsMultiRegionTrail(v bool) *CreateTrailOutput { - s.IsMultiRegionTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateTrailOutput) SetKmsKeyId(v string) *CreateTrailOutput { - s.KmsKeyId = &v - return s -} - -// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. -func (s *CreateTrailOutput) SetLogFileValidationEnabled(v bool) *CreateTrailOutput { - s.LogFileValidationEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTrailOutput) SetName(v string) *CreateTrailOutput { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *CreateTrailOutput) SetS3BucketName(v string) *CreateTrailOutput { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *CreateTrailOutput) SetS3KeyPrefix(v string) *CreateTrailOutput { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *CreateTrailOutput) SetSnsTopicARN(v string) *CreateTrailOutput { - s.SnsTopicARN = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *CreateTrailOutput) SetSnsTopicName(v string) *CreateTrailOutput { - s.SnsTopicName = &v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *CreateTrailOutput) SetTrailARN(v string) *CreateTrailOutput { - s.TrailARN = &v - return s -} - -// The Amazon S3 objects that you specify in your event selectors for your trail -// to log data events. Data events are object-level API operations that access -// S3 objects, such as GetObject, DeleteObject, and PutObject. You can specify -// up to 250 S3 buckets and object prefixes for a trail. -// -// Example -// -// You create an event selector for a trail and specify an S3 bucket and an -// empty prefix, such as arn:aws:s3:::bucket-1/. -// -// You upload an image file to bucket-1. -// -// The PutObject API operation occurs on an object in the S3 bucket that you -// specified in the event selector. The trail processes and logs the event. -// -// You upload another image file to a different S3 bucket named arn:aws:s3:::bucket-2. -// -// The event occurs on an object in an S3 bucket that you didn't specify in -// the event selector. The trail doesn’t log the event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DataResource -type DataResource struct { - _ struct{} `type:"structure"` - - // The resource type in which you want to log data events. You can specify only - // the following value: AWS::S3::Object. - Type *string `type:"string"` - - // A list of ARN-like strings for the specified S3 objects. - // - // To log data events for all objects in an S3 bucket, specify the bucket and - // an empty object prefix such as arn:aws:s3:::bucket-1/. The trail logs data - // events for all objects in this S3 bucket. - // - // To log data events for specific objects, specify the S3 bucket and object - // prefix such as arn:aws:s3:::bucket-1/example-images. The trail logs data - // events for objects in this S3 bucket that match the prefix. - Values []*string `type:"list"` -} - -// String returns the string representation -func (s DataResource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DataResource) GoString() string { - return s.String() -} - -// SetType sets the Type field's value. -func (s *DataResource) SetType(v string) *DataResource { - s.Type = &v - return s -} - -// SetValues sets the Values field's value. -func (s *DataResource) SetValues(v []*string) *DataResource { - s.Values = v - return s -} - -// The request that specifies the name of a trail to delete. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrailRequest -type DeleteTrailInput struct { - _ struct{} `type:"structure"` - - // Specifies the name or the CloudTrail ARN of the trail to be deleted. The - // format of a trail ARN is: arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteTrailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTrailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrailInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteTrailInput) SetName(v string) *DeleteTrailInput { - s.Name = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrailResponse -type DeleteTrailOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteTrailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTrailOutput) GoString() string { - return s.String() -} - -// Returns information about the trail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrailsRequest -type DescribeTrailsInput struct { - _ struct{} `type:"structure"` - - // Specifies whether to include shadow trails in the response. A shadow trail - // is the replication in a region of a trail that was created in a different - // region. The default is true. - IncludeShadowTrails *bool `locationName:"includeShadowTrails" type:"boolean"` - - // Specifies a list of trail names, trail ARNs, or both, of the trails to describe. - // The format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // If an empty list is specified, information for the trail in the current region - // is returned. - // - // * If an empty list is specified and IncludeShadowTrails is false, then - // information for all trails in the current region is returned. - // - // * If an empty list is specified and IncludeShadowTrails is null or true, - // then information for all trails in the current region and any associated - // shadow trails in other regions is returned. - // - // If one or more trail names are specified, information is returned only if - // the names match the names of trails belonging only to the current region. - // To return information about a trail in another region, you must specify its - // trail ARN. - TrailNameList []*string `locationName:"trailNameList" type:"list"` -} - -// String returns the string representation -func (s DescribeTrailsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTrailsInput) GoString() string { - return s.String() -} - -// SetIncludeShadowTrails sets the IncludeShadowTrails field's value. -func (s *DescribeTrailsInput) SetIncludeShadowTrails(v bool) *DescribeTrailsInput { - s.IncludeShadowTrails = &v - return s -} - -// SetTrailNameList sets the TrailNameList field's value. -func (s *DescribeTrailsInput) SetTrailNameList(v []*string) *DescribeTrailsInput { - s.TrailNameList = v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrailsResponse -type DescribeTrailsOutput struct { - _ struct{} `type:"structure"` - - // The list of trail objects. - TrailList []*Trail `locationName:"trailList" type:"list"` -} - -// String returns the string representation -func (s DescribeTrailsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTrailsOutput) GoString() string { - return s.String() -} - -// SetTrailList sets the TrailList field's value. -func (s *DescribeTrailsOutput) SetTrailList(v []*Trail) *DescribeTrailsOutput { - s.TrailList = v - return s -} - -// Contains information about an event that was returned by a lookup request. -// The result includes a representation of a CloudTrail event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/Event -type Event struct { - _ struct{} `type:"structure"` - - // A JSON string that contains a representation of the event returned. - CloudTrailEvent *string `type:"string"` - - // The CloudTrail ID of the event returned. - EventId *string `type:"string"` - - // The name of the event returned. - EventName *string `type:"string"` - - // The AWS service that the request was made to. - EventSource *string `type:"string"` - - // The date and time of the event returned. - EventTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // A list of resources referenced by the event returned. - Resources []*Resource `type:"list"` - - // A user name or role name of the requester that called the API in the event - // returned. - Username *string `type:"string"` -} - -// String returns the string representation -func (s Event) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Event) GoString() string { - return s.String() -} - -// SetCloudTrailEvent sets the CloudTrailEvent field's value. -func (s *Event) SetCloudTrailEvent(v string) *Event { - s.CloudTrailEvent = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *Event) SetEventId(v string) *Event { - s.EventId = &v - return s -} - -// SetEventName sets the EventName field's value. -func (s *Event) SetEventName(v string) *Event { - s.EventName = &v - return s -} - -// SetEventSource sets the EventSource field's value. -func (s *Event) SetEventSource(v string) *Event { - s.EventSource = &v - return s -} - -// SetEventTime sets the EventTime field's value. -func (s *Event) SetEventTime(v time.Time) *Event { - s.EventTime = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *Event) SetResources(v []*Resource) *Event { - s.Resources = v - return s -} - -// SetUsername sets the Username field's value. -func (s *Event) SetUsername(v string) *Event { - s.Username = &v - return s -} - -// Use event selectors to specify whether you want your trail to log management -// and/or data events. When an event occurs in your account, CloudTrail evaluates -// the event selector for all trails. For each trail, if the event matches any -// event selector, the trail processes and logs the event. If the event doesn't -// match any event selector, the trail doesn't log the event. -// -// You can configure up to five event selectors for a trail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/EventSelector -type EventSelector struct { - _ struct{} `type:"structure"` - - // CloudTrail supports logging only data events for S3 objects. You can specify - // up to 250 S3 buckets and object prefixes for a trail. - // - // For more information, see Data Events (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html#logging-data-events) - // in the AWS CloudTrail User Guide. - DataResources []*DataResource `type:"list"` - - // Specify if you want your event selector to include management events for - // your trail. - // - // For more information, see Management Events (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html#logging-management-events) - // in the AWS CloudTrail User Guide. - // - // By default, the value is true. - IncludeManagementEvents *bool `type:"boolean"` - - // Specify if you want your trail to log read-only events, write-only events, - // or all. For example, the EC2 GetConsoleOutput is a read-only API operation - // and RunInstances is a write-only API operation. - // - // By default, the value is All. - ReadWriteType *string `type:"string" enum:"ReadWriteType"` -} - -// String returns the string representation -func (s EventSelector) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventSelector) GoString() string { - return s.String() -} - -// SetDataResources sets the DataResources field's value. -func (s *EventSelector) SetDataResources(v []*DataResource) *EventSelector { - s.DataResources = v - return s -} - -// SetIncludeManagementEvents sets the IncludeManagementEvents field's value. -func (s *EventSelector) SetIncludeManagementEvents(v bool) *EventSelector { - s.IncludeManagementEvents = &v - return s -} - -// SetReadWriteType sets the ReadWriteType field's value. -func (s *EventSelector) SetReadWriteType(v string) *EventSelector { - s.ReadWriteType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectorsRequest -type GetEventSelectorsInput struct { - _ struct{} `type:"structure"` - - // Specifies the name of the trail or trail ARN. If you specify a trail name, - // the string must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are invalid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // If you specify a trail ARN, it must be in the format: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - TrailName *string `type:"string"` -} - -// String returns the string representation -func (s GetEventSelectorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetEventSelectorsInput) GoString() string { - return s.String() -} - -// SetTrailName sets the TrailName field's value. -func (s *GetEventSelectorsInput) SetTrailName(v string) *GetEventSelectorsInput { - s.TrailName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectorsResponse -type GetEventSelectorsOutput struct { - _ struct{} `type:"structure"` - - // The event selectors that are configured for the trail. - EventSelectors []*EventSelector `type:"list"` - - // The specified trail ARN that has the event selectors. - TrailARN *string `type:"string"` -} - -// String returns the string representation -func (s GetEventSelectorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetEventSelectorsOutput) GoString() string { - return s.String() -} - -// SetEventSelectors sets the EventSelectors field's value. -func (s *GetEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *GetEventSelectorsOutput { - s.EventSelectors = v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *GetEventSelectorsOutput) SetTrailARN(v string) *GetEventSelectorsOutput { - s.TrailARN = &v - return s -} - -// The name of a trail about which you want the current status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatusRequest -type GetTrailStatusInput struct { - _ struct{} `type:"structure"` - - // Specifies the name or the CloudTrail ARN of the trail for which you are requesting - // status. To get the status of a shadow trail (a replication of the trail in - // another region), you must specify its ARN. The format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetTrailStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTrailStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTrailStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTrailStatusInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetTrailStatusInput) SetName(v string) *GetTrailStatusInput { - s.Name = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatusResponse -type GetTrailStatusOutput struct { - _ struct{} `type:"structure"` - - // Whether the CloudTrail is currently logging AWS API calls. - IsLogging *bool `type:"boolean"` - - // Displays any CloudWatch Logs error that CloudTrail encountered when attempting - // to deliver logs to CloudWatch Logs. - LatestCloudWatchLogsDeliveryError *string `type:"string"` - - // Displays the most recent date and time when CloudTrail delivered logs to - // CloudWatch Logs. - LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // This field is deprecated. - LatestDeliveryAttemptSucceeded *string `type:"string"` - - // This field is deprecated. - LatestDeliveryAttemptTime *string `type:"string"` - - // Displays any Amazon S3 error that CloudTrail encountered when attempting - // to deliver log files to the designated bucket. For more information see the - // topic Error Responses (http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) - // in the Amazon S3 API Reference. - // - // This error occurs only when there is a problem with the destination S3 bucket - // and will not occur for timeouts. To resolve the issue, create a new bucket - // and call UpdateTrail to specify the new bucket, or fix the existing objects - // so that CloudTrail can again write to the bucket. - LatestDeliveryError *string `type:"string"` - - // Specifies the date and time that CloudTrail last delivered log files to an - // account's Amazon S3 bucket. - LatestDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Displays any Amazon S3 error that CloudTrail encountered when attempting - // to deliver a digest file to the designated bucket. For more information see - // the topic Error Responses (http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) - // in the Amazon S3 API Reference. - // - // This error occurs only when there is a problem with the destination S3 bucket - // and will not occur for timeouts. To resolve the issue, create a new bucket - // and call UpdateTrail to specify the new bucket, or fix the existing objects - // so that CloudTrail can again write to the bucket. - LatestDigestDeliveryError *string `type:"string"` - - // Specifies the date and time that CloudTrail last delivered a digest file - // to an account's Amazon S3 bucket. - LatestDigestDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // This field is deprecated. - LatestNotificationAttemptSucceeded *string `type:"string"` - - // This field is deprecated. - LatestNotificationAttemptTime *string `type:"string"` - - // Displays any Amazon SNS error that CloudTrail encountered when attempting - // to send a notification. For more information about Amazon SNS errors, see - // the Amazon SNS Developer Guide (http://docs.aws.amazon.com/sns/latest/dg/welcome.html). - LatestNotificationError *string `type:"string"` - - // Specifies the date and time of the most recent Amazon SNS notification that - // CloudTrail has written a new log file to an account's Amazon S3 bucket. - LatestNotificationTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Specifies the most recent date and time when CloudTrail started recording - // API calls for an AWS account. - StartLoggingTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Specifies the most recent date and time when CloudTrail stopped recording - // API calls for an AWS account. - StopLoggingTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // This field is deprecated. - TimeLoggingStarted *string `type:"string"` - - // This field is deprecated. - TimeLoggingStopped *string `type:"string"` -} - -// String returns the string representation -func (s GetTrailStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTrailStatusOutput) GoString() string { - return s.String() -} - -// SetIsLogging sets the IsLogging field's value. -func (s *GetTrailStatusOutput) SetIsLogging(v bool) *GetTrailStatusOutput { - s.IsLogging = &v - return s -} - -// SetLatestCloudWatchLogsDeliveryError sets the LatestCloudWatchLogsDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryError(v string) *GetTrailStatusOutput { - s.LatestCloudWatchLogsDeliveryError = &v - return s -} - -// SetLatestCloudWatchLogsDeliveryTime sets the LatestCloudWatchLogsDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestCloudWatchLogsDeliveryTime = &v - return s -} - -// SetLatestDeliveryAttemptSucceeded sets the LatestDeliveryAttemptSucceeded field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptSucceeded(v string) *GetTrailStatusOutput { - s.LatestDeliveryAttemptSucceeded = &v - return s -} - -// SetLatestDeliveryAttemptTime sets the LatestDeliveryAttemptTime field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptTime(v string) *GetTrailStatusOutput { - s.LatestDeliveryAttemptTime = &v - return s -} - -// SetLatestDeliveryError sets the LatestDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryError(v string) *GetTrailStatusOutput { - s.LatestDeliveryError = &v - return s -} - -// SetLatestDeliveryTime sets the LatestDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestDeliveryTime = &v - return s -} - -// SetLatestDigestDeliveryError sets the LatestDigestDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestDigestDeliveryError(v string) *GetTrailStatusOutput { - s.LatestDigestDeliveryError = &v - return s -} - -// SetLatestDigestDeliveryTime sets the LatestDigestDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestDigestDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestDigestDeliveryTime = &v - return s -} - -// SetLatestNotificationAttemptSucceeded sets the LatestNotificationAttemptSucceeded field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationAttemptSucceeded(v string) *GetTrailStatusOutput { - s.LatestNotificationAttemptSucceeded = &v - return s -} - -// SetLatestNotificationAttemptTime sets the LatestNotificationAttemptTime field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationAttemptTime(v string) *GetTrailStatusOutput { - s.LatestNotificationAttemptTime = &v - return s -} - -// SetLatestNotificationError sets the LatestNotificationError field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationError(v string) *GetTrailStatusOutput { - s.LatestNotificationError = &v - return s -} - -// SetLatestNotificationTime sets the LatestNotificationTime field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationTime(v time.Time) *GetTrailStatusOutput { - s.LatestNotificationTime = &v - return s -} - -// SetStartLoggingTime sets the StartLoggingTime field's value. -func (s *GetTrailStatusOutput) SetStartLoggingTime(v time.Time) *GetTrailStatusOutput { - s.StartLoggingTime = &v - return s -} - -// SetStopLoggingTime sets the StopLoggingTime field's value. -func (s *GetTrailStatusOutput) SetStopLoggingTime(v time.Time) *GetTrailStatusOutput { - s.StopLoggingTime = &v - return s -} - -// SetTimeLoggingStarted sets the TimeLoggingStarted field's value. -func (s *GetTrailStatusOutput) SetTimeLoggingStarted(v string) *GetTrailStatusOutput { - s.TimeLoggingStarted = &v - return s -} - -// SetTimeLoggingStopped sets the TimeLoggingStopped field's value. -func (s *GetTrailStatusOutput) SetTimeLoggingStopped(v string) *GetTrailStatusOutput { - s.TimeLoggingStopped = &v - return s -} - -// Requests the public keys for a specified time range. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeysRequest -type ListPublicKeysInput struct { - _ struct{} `type:"structure"` - - // Optionally specifies, in UTC, the end of the time range to look up public - // keys for CloudTrail digest files. If not specified, the current time is used. - EndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // Optionally specifies, in UTC, the start of the time range to look up public - // keys for CloudTrail digest files. If not specified, the current time is used, - // and the current public key is returned. - StartTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s ListPublicKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPublicKeysInput) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *ListPublicKeysInput) SetEndTime(v time.Time) *ListPublicKeysInput { - s.EndTime = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPublicKeysInput) SetNextToken(v string) *ListPublicKeysInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ListPublicKeysInput) SetStartTime(v time.Time) *ListPublicKeysInput { - s.StartTime = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeysResponse -type ListPublicKeysOutput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // Contains an array of PublicKey objects. - // - // The returned public keys may have validity time ranges that overlap. - PublicKeyList []*PublicKey `type:"list"` -} - -// String returns the string representation -func (s ListPublicKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPublicKeysOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPublicKeysOutput) SetNextToken(v string) *ListPublicKeysOutput { - s.NextToken = &v - return s -} - -// SetPublicKeyList sets the PublicKeyList field's value. -func (s *ListPublicKeysOutput) SetPublicKeyList(v []*PublicKey) *ListPublicKeysOutput { - s.PublicKeyList = v - return s -} - -// Specifies a list of trail tags to return. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTagsRequest -type ListTagsInput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // Specifies a list of trail ARNs whose tags will be listed. The list has a - // limit of 20 ARNs. The format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // ResourceIdList is a required field - ResourceIdList []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"} - if s.ResourceIdList == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdList")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput { - s.NextToken = &v - return s -} - -// SetResourceIdList sets the ResourceIdList field's value. -func (s *ListTagsInput) SetResourceIdList(v []*string) *ListTagsInput { - s.ResourceIdList = v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTagsResponse -type ListTagsOutput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // A list of resource tags. - ResourceTagList []*ResourceTag `type:"list"` -} - -// String returns the string representation -func (s ListTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput { - s.NextToken = &v - return s -} - -// SetResourceTagList sets the ResourceTagList field's value. -func (s *ListTagsOutput) SetResourceTagList(v []*ResourceTag) *ListTagsOutput { - s.ResourceTagList = v - return s -} - -// Specifies an attribute and value that filter the events returned. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupAttribute -type LookupAttribute struct { - _ struct{} `type:"structure"` - - // Specifies an attribute on which to filter the events returned. - // - // AttributeKey is a required field - AttributeKey *string `type:"string" required:"true" enum:"LookupAttributeKey"` - - // Specifies a value for the specified AttributeKey. - // - // AttributeValue is a required field - AttributeValue *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s LookupAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LookupAttribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LookupAttribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LookupAttribute"} - if s.AttributeKey == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeKey")) - } - if s.AttributeValue == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeValue")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeKey sets the AttributeKey field's value. -func (s *LookupAttribute) SetAttributeKey(v string) *LookupAttribute { - s.AttributeKey = &v - return s -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *LookupAttribute) SetAttributeValue(v string) *LookupAttribute { - s.AttributeValue = &v - return s -} - -// Contains a request for LookupEvents. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEventsRequest -type LookupEventsInput struct { - _ struct{} `type:"structure"` - - // Specifies that only events that occur before or at the specified time are - // returned. If the specified end time is before the specified start time, an - // error is returned. - EndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Contains a list of lookup attributes. Currently the list can contain only - // one item. - LookupAttributes []*LookupAttribute `type:"list"` - - // The number of events to return. Possible values are 1 through 50. The default - // is 10. - MaxResults *int64 `min:"1" type:"integer"` - - // The token to use to get the next page of results after a previous API call. - // This token must be passed in with the same parameters that were specified - // in the the original call. For example, if the original call specified an - // AttributeKey of 'Username' with a value of 'root', the call with NextToken - // should include those same parameters. - NextToken *string `type:"string"` - - // Specifies that only events that occur after or at the specified time are - // returned. If the specified start time is after the specified end time, an - // error is returned. - StartTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s LookupEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LookupEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LookupEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LookupEventsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.LookupAttributes != nil { - for i, v := range s.LookupAttributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LookupAttributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *LookupEventsInput) SetEndTime(v time.Time) *LookupEventsInput { - s.EndTime = &v - return s -} - -// SetLookupAttributes sets the LookupAttributes field's value. -func (s *LookupEventsInput) SetLookupAttributes(v []*LookupAttribute) *LookupEventsInput { - s.LookupAttributes = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *LookupEventsInput) SetMaxResults(v int64) *LookupEventsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *LookupEventsInput) SetNextToken(v string) *LookupEventsInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *LookupEventsInput) SetStartTime(v time.Time) *LookupEventsInput { - s.StartTime = &v - return s -} - -// Contains a response to a LookupEvents action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEventsResponse -type LookupEventsOutput struct { - _ struct{} `type:"structure"` - - // A list of events returned based on the lookup attributes specified and the - // CloudTrail event. The events list is sorted by time. The most recent event - // is listed first. - Events []*Event `type:"list"` - - // The token to use to get the next page of results after a previous API call. - // If the token does not appear, there are no more results to return. The token - // must be passed in with the same parameters as the previous call. For example, - // if the original call specified an AttributeKey of 'Username' with a value - // of 'root', the call with NextToken should include those same parameters. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s LookupEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LookupEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *LookupEventsOutput) SetEvents(v []*Event) *LookupEventsOutput { - s.Events = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *LookupEventsOutput) SetNextToken(v string) *LookupEventsOutput { - s.NextToken = &v - return s -} - -// Contains information about a returned public key. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PublicKey -type PublicKey struct { - _ struct{} `type:"structure"` - - // The fingerprint of the public key. - Fingerprint *string `type:"string"` - - // The ending time of validity of the public key. - ValidityEndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The starting time of validity of the public key. - ValidityStartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The DER encoded public key value in PKCS#1 format. - // - // Value is automatically base64 encoded/decoded by the SDK. - Value []byte `type:"blob"` -} - -// String returns the string representation -func (s PublicKey) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PublicKey) GoString() string { - return s.String() -} - -// SetFingerprint sets the Fingerprint field's value. -func (s *PublicKey) SetFingerprint(v string) *PublicKey { - s.Fingerprint = &v - return s -} - -// SetValidityEndTime sets the ValidityEndTime field's value. -func (s *PublicKey) SetValidityEndTime(v time.Time) *PublicKey { - s.ValidityEndTime = &v - return s -} - -// SetValidityStartTime sets the ValidityStartTime field's value. -func (s *PublicKey) SetValidityStartTime(v time.Time) *PublicKey { - s.ValidityStartTime = &v - return s -} - -// SetValue sets the Value field's value. -func (s *PublicKey) SetValue(v []byte) *PublicKey { - s.Value = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectorsRequest -type PutEventSelectorsInput struct { - _ struct{} `type:"structure"` - - // Specifies the settings for your event selectors. You can configure up to - // five event selectors for a trail. - EventSelectors []*EventSelector `type:"list"` - - // Specifies the name of the trail or trail ARN. If you specify a trail name, - // the string must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are invalid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // If you specify a trail ARN, it must be in the format: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - TrailName *string `type:"string"` -} - -// String returns the string representation -func (s PutEventSelectorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEventSelectorsInput) GoString() string { - return s.String() -} - -// SetEventSelectors sets the EventSelectors field's value. -func (s *PutEventSelectorsInput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsInput { - s.EventSelectors = v - return s -} - -// SetTrailName sets the TrailName field's value. -func (s *PutEventSelectorsInput) SetTrailName(v string) *PutEventSelectorsInput { - s.TrailName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectorsResponse -type PutEventSelectorsOutput struct { - _ struct{} `type:"structure"` - - // Specifies the event selectors configured for your trail. - EventSelectors []*EventSelector `type:"list"` - - // Specifies the ARN of the trail that was updated with event selectors. The - // format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - TrailARN *string `type:"string"` -} - -// String returns the string representation -func (s PutEventSelectorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEventSelectorsOutput) GoString() string { - return s.String() -} - -// SetEventSelectors sets the EventSelectors field's value. -func (s *PutEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsOutput { - s.EventSelectors = v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *PutEventSelectorsOutput) SetTrailARN(v string) *PutEventSelectorsOutput { - s.TrailARN = &v - return s -} - -// Specifies the tags to remove from a trail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTagsRequest -type RemoveTagsInput struct { - _ struct{} `type:"structure"` - - // Specifies the ARN of the trail from which tags should be removed. The format - // of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // Specifies a list of tags to be removed. - TagsList []*Tag `type:"list"` -} - -// String returns the string representation -func (s RemoveTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.TagsList != nil { - for i, v := range s.TagsList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *RemoveTagsInput) SetResourceId(v string) *RemoveTagsInput { - s.ResourceId = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *RemoveTagsInput) SetTagsList(v []*Tag) *RemoveTagsInput { - s.TagsList = v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTagsResponse -type RemoveTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsOutput) GoString() string { - return s.String() -} - -// Specifies the type and name of a resource referenced by an event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/Resource -type Resource struct { - _ struct{} `type:"structure"` - - // The name of the resource referenced by the event returned. These are user-created - // names whose values will depend on the environment. For example, the resource - // name might be "auto-scaling-test-group" for an Auto Scaling Group or "i-1234567" - // for an EC2 Instance. - ResourceName *string `type:"string"` - - // The type of a resource referenced by the event returned. When the resource - // type cannot be determined, null is returned. Some examples of resource types - // are: Instance for EC2, Trail for CloudTrail, DBInstance for RDS, and AccessKey - // for IAM. For a list of resource types supported for event lookup, see Resource - // Types Supported for Event Lookup (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/lookup_supported_resourcetypes.html). - ResourceType *string `type:"string"` -} - -// String returns the string representation -func (s Resource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Resource) GoString() string { - return s.String() -} - -// SetResourceName sets the ResourceName field's value. -func (s *Resource) SetResourceName(v string) *Resource { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Resource) SetResourceType(v string) *Resource { - s.ResourceType = &v - return s -} - -// A resource tag. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ResourceTag -type ResourceTag struct { - _ struct{} `type:"structure"` - - // Specifies the ARN of the resource. - ResourceId *string `type:"string"` - - // A list of tags. - TagsList []*Tag `type:"list"` -} - -// String returns the string representation -func (s ResourceTag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceTag) GoString() string { - return s.String() -} - -// SetResourceId sets the ResourceId field's value. -func (s *ResourceTag) SetResourceId(v string) *ResourceTag { - s.ResourceId = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *ResourceTag) SetTagsList(v []*Tag) *ResourceTag { - s.TagsList = v - return s -} - -// The request to CloudTrail to start logging AWS API calls for an account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLoggingRequest -type StartLoggingInput struct { - _ struct{} `type:"structure"` - - // Specifies the name or the CloudTrail ARN of the trail for which CloudTrail - // logs AWS API calls. The format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StartLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartLoggingInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *StartLoggingInput) SetName(v string) *StartLoggingInput { - s.Name = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLoggingResponse -type StartLoggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StartLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartLoggingOutput) GoString() string { - return s.String() -} - -// Passes the request to CloudTrail to stop logging AWS API calls for the specified -// account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLoggingRequest -type StopLoggingInput struct { - _ struct{} `type:"structure"` - - // Specifies the name or the CloudTrail ARN of the trail for which CloudTrail - // will stop logging AWS API calls. The format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StopLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopLoggingInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *StopLoggingInput) SetName(v string) *StopLoggingInput { - s.Name = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLoggingResponse -type StopLoggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StopLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopLoggingOutput) GoString() string { - return s.String() -} - -// A custom key-value pair associated with a resource such as a CloudTrail trail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key in a key-value pair. The key must be must be no longer than 128 Unicode - // characters. The key must be unique for the resource to which it applies. - // - // Key is a required field - Key *string `type:"string" required:"true"` - - // The value in a key-value pair of a tag. The value must be no longer than - // 256 Unicode 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 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 -} - -// The settings for a trail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/Trail -type Trail struct { - _ struct{} `type:"structure"` - - // Specifies an Amazon Resource Name (ARN), a unique identifier that represents - // the log group to which CloudTrail logs will be delivered. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies if the trail has custom event selectors. - HasCustomEventSelectors *bool `type:"boolean"` - - // The region in which the trail was created. - HomeRegion *string `type:"string"` - - // Set to True to include AWS API calls from AWS global services such as IAM. - // Otherwise, False. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail belongs only to one region or exists in all regions. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the format: - // - // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies whether log file validation is enabled. - LogFileValidationEnabled *bool `type:"boolean"` - - // Name of the trail set by calling CreateTrail. The maximum length is 128 characters. - Name *string `type:"string"` - - // Name of the Amazon S3 bucket into which CloudTrail delivers your trail files. - // See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). - S3BucketName *string `type:"string"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).The - // maximum length is 200 characters. - S3KeyPrefix *string `type:"string"` - - // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications - // when log files are delivered. The format of a topic ARN is: - // - // arn:aws:sns:us-east-1:123456789012:MyTopic - SnsTopicARN *string `type:"string"` - - // This field is deprecated. Use SnsTopicARN. - SnsTopicName *string `deprecated:"true" type:"string"` - - // Specifies the ARN of the trail. The format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - TrailARN *string `type:"string"` -} - -// String returns the string representation -func (s Trail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Trail) GoString() string { - return s.String() -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *Trail) SetCloudWatchLogsLogGroupArn(v string) *Trail { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *Trail) SetCloudWatchLogsRoleArn(v string) *Trail { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetHasCustomEventSelectors sets the HasCustomEventSelectors field's value. -func (s *Trail) SetHasCustomEventSelectors(v bool) *Trail { - s.HasCustomEventSelectors = &v - return s -} - -// SetHomeRegion sets the HomeRegion field's value. -func (s *Trail) SetHomeRegion(v string) *Trail { - s.HomeRegion = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *Trail) SetIncludeGlobalServiceEvents(v bool) *Trail { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *Trail) SetIsMultiRegionTrail(v bool) *Trail { - s.IsMultiRegionTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Trail) SetKmsKeyId(v string) *Trail { - s.KmsKeyId = &v - return s -} - -// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. -func (s *Trail) SetLogFileValidationEnabled(v bool) *Trail { - s.LogFileValidationEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *Trail) SetName(v string) *Trail { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *Trail) SetS3BucketName(v string) *Trail { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *Trail) SetS3KeyPrefix(v string) *Trail { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *Trail) SetSnsTopicARN(v string) *Trail { - s.SnsTopicARN = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *Trail) SetSnsTopicName(v string) *Trail { - s.SnsTopicName = &v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *Trail) SetTrailARN(v string) *Trail { - s.TrailARN = &v - return s -} - -// Specifies settings to update for the trail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrailRequest -type UpdateTrailInput struct { - _ struct{} `type:"structure"` - - // Specifies a log group name using an Amazon Resource Name (ARN), a unique - // identifier that represents the log group to which CloudTrail logs will be - // delivered. Not required unless you specify CloudWatchLogsRoleArn. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies whether log file validation is enabled. The default is false. - // - // When you disable log file integrity validation, the chain of digest files - // is broken after one hour. CloudTrail will not create digest files for log - // files that were delivered during a period in which log file integrity validation - // was disabled. For example, if you enable log file integrity validation at - // noon on January 1, disable it at noon on January 2, and re-enable it at noon - // on January 10, digest files will not be created for the log files delivered - // from noon on January 2 to noon on January 10. The same applies whenever you - // stop CloudTrail logging or delete a trail. - EnableLogFileValidation *bool `type:"boolean"` - - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail applies only to the current region or to all - // regions. The default is false. If the trail exists only in the current region - // and this value is set to true, shadow trails (replications of the trail) - // will be created in the other regions. If the trail exists in all regions - // and this value is set to false, the trail will remain in the region where - // it was created, and its shadow trails in other regions will be deleted. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. - // The value can be an alias name prefixed by "alias/", a fully specified ARN - // to an alias, a fully specified ARN to a key, or a globally unique identifier. - // - // Examples: - // - // * alias/MyAliasName - // - // * arn:aws:kms:us-east-1:123456789012:alias/MyAliasName - // - // * arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * 12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies the name of the trail or trail ARN. If Name is a trail name, the - // string must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are invalid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // If Name is a trail ARN, it must be in the format: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). - S3BucketName *string `type:"string"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - // The maximum length is 200 characters. - S3KeyPrefix *string `type:"string"` - - // Specifies the name of the Amazon SNS topic defined for notification of log - // file delivery. The maximum length is 256 characters. - SnsTopicName *string `type:"string"` -} - -// String returns the string representation -func (s UpdateTrailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTrailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTrailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTrailInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *UpdateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *UpdateTrailInput { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *UpdateTrailInput) SetCloudWatchLogsRoleArn(v string) *UpdateTrailInput { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetEnableLogFileValidation sets the EnableLogFileValidation field's value. -func (s *UpdateTrailInput) SetEnableLogFileValidation(v bool) *UpdateTrailInput { - s.EnableLogFileValidation = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *UpdateTrailInput) SetIncludeGlobalServiceEvents(v bool) *UpdateTrailInput { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *UpdateTrailInput) SetIsMultiRegionTrail(v bool) *UpdateTrailInput { - s.IsMultiRegionTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *UpdateTrailInput) SetKmsKeyId(v string) *UpdateTrailInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateTrailInput) SetName(v string) *UpdateTrailInput { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *UpdateTrailInput) SetS3BucketName(v string) *UpdateTrailInput { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *UpdateTrailInput) SetS3KeyPrefix(v string) *UpdateTrailInput { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *UpdateTrailInput) SetSnsTopicName(v string) *UpdateTrailInput { - s.SnsTopicName = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrailResponse -type UpdateTrailOutput struct { - _ struct{} `type:"structure"` - - // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail - // logs will be delivered. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail exists in one region or in all regions. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the format: - // - // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies whether log file integrity validation is enabled. - LogFileValidationEnabled *bool `type:"boolean"` - - // Specifies the name of the trail. - Name *string `type:"string"` - - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. - S3BucketName *string `type:"string"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - S3KeyPrefix *string `type:"string"` - - // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications - // when log files are delivered. The format of a topic ARN is: - // - // arn:aws:sns:us-east-1:123456789012:MyTopic - SnsTopicARN *string `type:"string"` - - // This field is deprecated. Use SnsTopicARN. - SnsTopicName *string `deprecated:"true" type:"string"` - - // Specifies the ARN of the trail that was updated. The format of a trail ARN - // is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - TrailARN *string `type:"string"` -} - -// String returns the string representation -func (s UpdateTrailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTrailOutput) GoString() string { - return s.String() -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *UpdateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *UpdateTrailOutput { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *UpdateTrailOutput) SetCloudWatchLogsRoleArn(v string) *UpdateTrailOutput { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *UpdateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *UpdateTrailOutput { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *UpdateTrailOutput) SetIsMultiRegionTrail(v bool) *UpdateTrailOutput { - s.IsMultiRegionTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *UpdateTrailOutput) SetKmsKeyId(v string) *UpdateTrailOutput { - s.KmsKeyId = &v - return s -} - -// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. -func (s *UpdateTrailOutput) SetLogFileValidationEnabled(v bool) *UpdateTrailOutput { - s.LogFileValidationEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateTrailOutput) SetName(v string) *UpdateTrailOutput { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *UpdateTrailOutput) SetS3BucketName(v string) *UpdateTrailOutput { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *UpdateTrailOutput) SetS3KeyPrefix(v string) *UpdateTrailOutput { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *UpdateTrailOutput) SetSnsTopicARN(v string) *UpdateTrailOutput { - s.SnsTopicARN = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *UpdateTrailOutput) SetSnsTopicName(v string) *UpdateTrailOutput { - s.SnsTopicName = &v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *UpdateTrailOutput) SetTrailARN(v string) *UpdateTrailOutput { - s.TrailARN = &v - return s -} - -const ( - // LookupAttributeKeyEventId is a LookupAttributeKey enum value - LookupAttributeKeyEventId = "EventId" - - // LookupAttributeKeyEventName is a LookupAttributeKey enum value - LookupAttributeKeyEventName = "EventName" - - // LookupAttributeKeyUsername is a LookupAttributeKey enum value - LookupAttributeKeyUsername = "Username" - - // LookupAttributeKeyResourceType is a LookupAttributeKey enum value - LookupAttributeKeyResourceType = "ResourceType" - - // LookupAttributeKeyResourceName is a LookupAttributeKey enum value - LookupAttributeKeyResourceName = "ResourceName" - - // LookupAttributeKeyEventSource is a LookupAttributeKey enum value - LookupAttributeKeyEventSource = "EventSource" -) - -const ( - // ReadWriteTypeReadOnly is a ReadWriteType enum value - ReadWriteTypeReadOnly = "ReadOnly" - - // ReadWriteTypeWriteOnly is a ReadWriteType enum value - ReadWriteTypeWriteOnly = "WriteOnly" - - // ReadWriteTypeAll is a ReadWriteType enum value - ReadWriteTypeAll = "All" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go deleted file mode 100644 index 14e12f4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go +++ /dev/null @@ -1,245 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudtrail - -const ( - - // ErrCodeARNInvalidException for service response error code - // "ARNInvalidException". - // - // This exception is thrown when an operation is called with an invalid trail - // ARN. The format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail - ErrCodeARNInvalidException = "ARNInvalidException" - - // ErrCodeCloudWatchLogsDeliveryUnavailableException for service response error code - // "CloudWatchLogsDeliveryUnavailableException". - // - // Cannot set a CloudWatch Logs delivery for this region. - ErrCodeCloudWatchLogsDeliveryUnavailableException = "CloudWatchLogsDeliveryUnavailableException" - - // ErrCodeInsufficientEncryptionPolicyException for service response error code - // "InsufficientEncryptionPolicyException". - // - // This exception is thrown when the policy on the S3 bucket or KMS key is not - // sufficient. - ErrCodeInsufficientEncryptionPolicyException = "InsufficientEncryptionPolicyException" - - // ErrCodeInsufficientS3BucketPolicyException for service response error code - // "InsufficientS3BucketPolicyException". - // - // This exception is thrown when the policy on the S3 bucket is not sufficient. - ErrCodeInsufficientS3BucketPolicyException = "InsufficientS3BucketPolicyException" - - // ErrCodeInsufficientSnsTopicPolicyException for service response error code - // "InsufficientSnsTopicPolicyException". - // - // This exception is thrown when the policy on the SNS topic is not sufficient. - ErrCodeInsufficientSnsTopicPolicyException = "InsufficientSnsTopicPolicyException" - - // ErrCodeInvalidCloudWatchLogsLogGroupArnException for service response error code - // "InvalidCloudWatchLogsLogGroupArnException". - // - // This exception is thrown when the provided CloudWatch log group is not valid. - ErrCodeInvalidCloudWatchLogsLogGroupArnException = "InvalidCloudWatchLogsLogGroupArnException" - - // ErrCodeInvalidCloudWatchLogsRoleArnException for service response error code - // "InvalidCloudWatchLogsRoleArnException". - // - // This exception is thrown when the provided role is not valid. - ErrCodeInvalidCloudWatchLogsRoleArnException = "InvalidCloudWatchLogsRoleArnException" - - // ErrCodeInvalidEventSelectorsException for service response error code - // "InvalidEventSelectorsException". - // - // This exception is thrown when the PutEventSelectors operation is called with - // an invalid number of event selectors, data resources, or an invalid value - // for a parameter: - // - // * Specify a valid number of event selectors (1 to 5) for a trail. - // - // * Specify a valid number of data resources (1 to 250) for an event selector. - // - // * Specify a valid value for a parameter. For example, specifying the ReadWriteType - // parameter with a value of read-only is invalid. - ErrCodeInvalidEventSelectorsException = "InvalidEventSelectorsException" - - // ErrCodeInvalidHomeRegionException for service response error code - // "InvalidHomeRegionException". - // - // This exception is thrown when an operation is called on a trail from a region - // other than the region in which the trail was created. - ErrCodeInvalidHomeRegionException = "InvalidHomeRegionException" - - // ErrCodeInvalidKmsKeyIdException for service response error code - // "InvalidKmsKeyIdException". - // - // This exception is thrown when the KMS key ARN is invalid. - ErrCodeInvalidKmsKeyIdException = "InvalidKmsKeyIdException" - - // ErrCodeInvalidLookupAttributesException for service response error code - // "InvalidLookupAttributesException". - // - // Occurs when an invalid lookup attribute is specified. - ErrCodeInvalidLookupAttributesException = "InvalidLookupAttributesException" - - // ErrCodeInvalidMaxResultsException for service response error code - // "InvalidMaxResultsException". - // - // This exception is thrown if the limit specified is invalid. - ErrCodeInvalidMaxResultsException = "InvalidMaxResultsException" - - // ErrCodeInvalidNextTokenException for service response error code - // "InvalidNextTokenException". - // - // Invalid token or token that was previously used in a request with different - // parameters. This exception is thrown if the token is invalid. - ErrCodeInvalidNextTokenException = "InvalidNextTokenException" - - // ErrCodeInvalidParameterCombinationException for service response error code - // "InvalidParameterCombinationException". - // - // This exception is thrown when the combination of parameters provided is not - // valid. - ErrCodeInvalidParameterCombinationException = "InvalidParameterCombinationException" - - // ErrCodeInvalidS3BucketNameException for service response error code - // "InvalidS3BucketNameException". - // - // This exception is thrown when the provided S3 bucket name is not valid. - ErrCodeInvalidS3BucketNameException = "InvalidS3BucketNameException" - - // ErrCodeInvalidS3PrefixException for service response error code - // "InvalidS3PrefixException". - // - // This exception is thrown when the provided S3 prefix is not valid. - ErrCodeInvalidS3PrefixException = "InvalidS3PrefixException" - - // ErrCodeInvalidSnsTopicNameException for service response error code - // "InvalidSnsTopicNameException". - // - // This exception is thrown when the provided SNS topic name is not valid. - ErrCodeInvalidSnsTopicNameException = "InvalidSnsTopicNameException" - - // ErrCodeInvalidTagParameterException for service response error code - // "InvalidTagParameterException". - // - // This exception is thrown when the key or value specified for the tag does - // not match the regular expression ^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$. - ErrCodeInvalidTagParameterException = "InvalidTagParameterException" - - // ErrCodeInvalidTimeRangeException for service response error code - // "InvalidTimeRangeException". - // - // Occurs if the timestamp values are invalid. Either the start time occurs - // after the end time or the time range is outside the range of possible values. - ErrCodeInvalidTimeRangeException = "InvalidTimeRangeException" - - // ErrCodeInvalidTokenException for service response error code - // "InvalidTokenException". - // - // Reserved for future use. - ErrCodeInvalidTokenException = "InvalidTokenException" - - // ErrCodeInvalidTrailNameException for service response error code - // "InvalidTrailNameException". - // - // This exception is thrown when the provided trail name is not valid. Trail - // names must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are invalid. - // - // * Not be in IP address format (for example, 192.168.5.4) - ErrCodeInvalidTrailNameException = "InvalidTrailNameException" - - // ErrCodeKmsException for service response error code - // "KmsException". - // - // This exception is thrown when there is an issue with the specified KMS key - // and the trail can’t be updated. - ErrCodeKmsException = "KmsException" - - // ErrCodeKmsKeyDisabledException for service response error code - // "KmsKeyDisabledException". - // - // This exception is deprecated. - ErrCodeKmsKeyDisabledException = "KmsKeyDisabledException" - - // ErrCodeKmsKeyNotFoundException for service response error code - // "KmsKeyNotFoundException". - // - // This exception is thrown when the KMS key does not exist, or when the S3 - // bucket and the KMS key are not in the same region. - ErrCodeKmsKeyNotFoundException = "KmsKeyNotFoundException" - - // ErrCodeMaximumNumberOfTrailsExceededException for service response error code - // "MaximumNumberOfTrailsExceededException". - // - // This exception is thrown when the maximum number of trails is reached. - ErrCodeMaximumNumberOfTrailsExceededException = "MaximumNumberOfTrailsExceededException" - - // ErrCodeOperationNotPermittedException for service response error code - // "OperationNotPermittedException". - // - // This exception is thrown when the requested operation is not permitted. - ErrCodeOperationNotPermittedException = "OperationNotPermittedException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // This exception is thrown when the specified resource is not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeResourceTypeNotSupportedException for service response error code - // "ResourceTypeNotSupportedException". - // - // This exception is thrown when the specified resource type is not supported - // by CloudTrail. - ErrCodeResourceTypeNotSupportedException = "ResourceTypeNotSupportedException" - - // ErrCodeS3BucketDoesNotExistException for service response error code - // "S3BucketDoesNotExistException". - // - // This exception is thrown when the specified S3 bucket does not exist. - ErrCodeS3BucketDoesNotExistException = "S3BucketDoesNotExistException" - - // ErrCodeTagsLimitExceededException for service response error code - // "TagsLimitExceededException". - // - // The number of tags per trail has exceeded the permitted amount. Currently, - // the limit is 50. - ErrCodeTagsLimitExceededException = "TagsLimitExceededException" - - // ErrCodeTrailAlreadyExistsException for service response error code - // "TrailAlreadyExistsException". - // - // This exception is thrown when the specified trail already exists. - ErrCodeTrailAlreadyExistsException = "TrailAlreadyExistsException" - - // ErrCodeTrailNotFoundException for service response error code - // "TrailNotFoundException". - // - // This exception is thrown when the trail with the given name is not found. - ErrCodeTrailNotFoundException = "TrailNotFoundException" - - // ErrCodeTrailNotProvidedException for service response error code - // "TrailNotProvidedException". - // - // This exception is deprecated. - ErrCodeTrailNotProvidedException = "TrailNotProvidedException" - - // ErrCodeUnsupportedOperationException for service response error code - // "UnsupportedOperationException". - // - // This exception is thrown when the requested operation is not supported. - ErrCodeUnsupportedOperationException = "UnsupportedOperationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go deleted file mode 100644 index f5fcb38..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go +++ /dev/null @@ -1,113 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudtrail - -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" -) - -// This is the CloudTrail API Reference. It provides descriptions of actions, -// data types, common parameters, and common errors for CloudTrail. -// -// CloudTrail is a web service that records AWS API calls for your AWS account -// and delivers log files to an Amazon S3 bucket. The recorded information includes -// the identity of the user, the start time of the AWS API call, the source -// IP address, the request parameters, and the response elements returned by -// the service. -// -// As an alternative to 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 AWSCloudTrail. 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/). -// -// See the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html) -// for information about the data that is included with each AWS API call listed -// in the log files. -// 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/cloudtrail-2013-11-01 -type CloudTrail 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 = "cloudtrail" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CloudTrail 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 CloudTrail client from just a session. -// svc := cloudtrail.New(mySession) -// -// // Create a CloudTrail client with additional configuration -// svc := cloudtrail.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudTrail { - 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) *CloudTrail { - svc := &CloudTrail{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2013-11-01", - JSONVersion: "1.1", - TargetPrefix: "com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101", - }, - 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 CloudTrail operation and runs any -// custom request initialization. -func (c *CloudTrail) 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/cloudwatch/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go deleted file mode 100644 index 3abedb2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go +++ /dev/null @@ -1,3165 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudwatch provides a client for Amazon CloudWatch. -package cloudwatch - -import ( - "fmt" - "time" - - "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 opDeleteAlarms = "DeleteAlarms" - -// DeleteAlarmsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAlarms operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAlarms for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAlarms method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAlarmsRequest method. -// req, resp := client.DeleteAlarmsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms -func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) (req *request.Request, output *DeleteAlarmsOutput) { - op := &request.Operation{ - Name: opDeleteAlarms, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAlarmsInput{} - } - - output = &DeleteAlarmsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAlarms API operation for Amazon CloudWatch. -// -// Deletes the specified alarms. In the event of an error, no alarms are 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 CloudWatch's -// API operation DeleteAlarms for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// The named resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms -func (c *CloudWatch) DeleteAlarms(input *DeleteAlarmsInput) (*DeleteAlarmsOutput, error) { - req, out := c.DeleteAlarmsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAlarmHistory = "DescribeAlarmHistory" - -// DescribeAlarmHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAlarmHistory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAlarmHistory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAlarmHistory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAlarmHistoryRequest method. -// req, resp := client.DescribeAlarmHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistory -func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInput) (req *request.Request, output *DescribeAlarmHistoryOutput) { - op := &request.Operation{ - Name: opDescribeAlarmHistory, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeAlarmHistoryInput{} - } - - output = &DescribeAlarmHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAlarmHistory API operation for Amazon CloudWatch. -// -// Retrieves the history for the specified alarm. You can filter the results -// by date range or item type. If an alarm name is not specified, the histories -// for all alarms are returned. -// -// Note that Amazon CloudWatch retains the history of an alarm even if you delete -// the alarm. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch's -// API operation DescribeAlarmHistory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The next token specified is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistory -func (c *CloudWatch) DescribeAlarmHistory(input *DescribeAlarmHistoryInput) (*DescribeAlarmHistoryOutput, error) { - req, out := c.DescribeAlarmHistoryRequest(input) - err := req.Send() - return out, err -} - -// DescribeAlarmHistoryPages iterates over the pages of a DescribeAlarmHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAlarmHistory 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 DescribeAlarmHistory operation. -// pageNum := 0 -// err := client.DescribeAlarmHistoryPages(params, -// func(page *DescribeAlarmHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, fn func(p *DescribeAlarmHistoryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeAlarmHistoryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeAlarmHistoryOutput), lastPage) - }) -} - -const opDescribeAlarms = "DescribeAlarms" - -// DescribeAlarmsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAlarms operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAlarms for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAlarms method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAlarmsRequest method. -// req, resp := client.DescribeAlarmsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms -func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) (req *request.Request, output *DescribeAlarmsOutput) { - op := &request.Operation{ - Name: opDescribeAlarms, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeAlarmsInput{} - } - - output = &DescribeAlarmsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAlarms API operation for Amazon CloudWatch. -// -// Retrieves the specified alarms. If no alarms are specified, all alarms are -// returned. Alarms can be retrieved by using only a prefix for the alarm name, -// the alarm state, or a prefix for any action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch's -// API operation DescribeAlarms for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The next token specified is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms -func (c *CloudWatch) DescribeAlarms(input *DescribeAlarmsInput) (*DescribeAlarmsOutput, error) { - req, out := c.DescribeAlarmsRequest(input) - err := req.Send() - return out, err -} - -// DescribeAlarmsPages iterates over the pages of a DescribeAlarms operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeAlarms 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 DescribeAlarms operation. -// pageNum := 0 -// err := client.DescribeAlarmsPages(params, -// func(page *DescribeAlarmsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(p *DescribeAlarmsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeAlarmsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeAlarmsOutput), lastPage) - }) -} - -const opDescribeAlarmsForMetric = "DescribeAlarmsForMetric" - -// DescribeAlarmsForMetricRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAlarmsForMetric operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAlarmsForMetric for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAlarmsForMetric method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAlarmsForMetricRequest method. -// req, resp := client.DescribeAlarmsForMetricRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetric -func (c *CloudWatch) DescribeAlarmsForMetricRequest(input *DescribeAlarmsForMetricInput) (req *request.Request, output *DescribeAlarmsForMetricOutput) { - op := &request.Operation{ - Name: opDescribeAlarmsForMetric, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAlarmsForMetricInput{} - } - - output = &DescribeAlarmsForMetricOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAlarmsForMetric API operation for Amazon CloudWatch. -// -// Retrieves the alarms for the specified metric. Specify a statistic, period, -// or unit to filter the results. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch's -// API operation DescribeAlarmsForMetric for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetric -func (c *CloudWatch) DescribeAlarmsForMetric(input *DescribeAlarmsForMetricInput) (*DescribeAlarmsForMetricOutput, error) { - req, out := c.DescribeAlarmsForMetricRequest(input) - err := req.Send() - return out, err -} - -const opDisableAlarmActions = "DisableAlarmActions" - -// DisableAlarmActionsRequest generates a "aws/request.Request" representing the -// client's request for the DisableAlarmActions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableAlarmActions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableAlarmActions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableAlarmActionsRequest method. -// req, resp := client.DisableAlarmActionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActions -func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) (req *request.Request, output *DisableAlarmActionsOutput) { - op := &request.Operation{ - Name: opDisableAlarmActions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableAlarmActionsInput{} - } - - output = &DisableAlarmActionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableAlarmActions API operation for Amazon CloudWatch. -// -// Disables the actions for the specified alarms. When an alarm's actions are -// disabled, the alarm actions do not execute when the alarm state 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 CloudWatch's -// API operation DisableAlarmActions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActions -func (c *CloudWatch) DisableAlarmActions(input *DisableAlarmActionsInput) (*DisableAlarmActionsOutput, error) { - req, out := c.DisableAlarmActionsRequest(input) - err := req.Send() - return out, err -} - -const opEnableAlarmActions = "EnableAlarmActions" - -// EnableAlarmActionsRequest generates a "aws/request.Request" representing the -// client's request for the EnableAlarmActions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableAlarmActions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableAlarmActions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableAlarmActionsRequest method. -// req, resp := client.EnableAlarmActionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActions -func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) (req *request.Request, output *EnableAlarmActionsOutput) { - op := &request.Operation{ - Name: opEnableAlarmActions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableAlarmActionsInput{} - } - - output = &EnableAlarmActionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableAlarmActions API operation for Amazon CloudWatch. -// -// Enables the actions for the specified alarms. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch's -// API operation EnableAlarmActions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActions -func (c *CloudWatch) EnableAlarmActions(input *EnableAlarmActionsInput) (*EnableAlarmActionsOutput, error) { - req, out := c.EnableAlarmActionsRequest(input) - err := req.Send() - return out, err -} - -const opGetMetricStatistics = "GetMetricStatistics" - -// GetMetricStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the GetMetricStatistics operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetMetricStatistics for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetMetricStatistics method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetMetricStatisticsRequest method. -// req, resp := client.GetMetricStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatistics -func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) (req *request.Request, output *GetMetricStatisticsOutput) { - op := &request.Operation{ - Name: opGetMetricStatistics, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetMetricStatisticsInput{} - } - - output = &GetMetricStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMetricStatistics API operation for Amazon CloudWatch. -// -// Gets statistics for the specified metric. -// -// Amazon CloudWatch retains metric data as follows: -// -// * Data points with a period of 60 seconds (1 minute) are available for -// 15 days -// -// * Data points with a period of 300 seconds (5 minute) are available for -// 63 days -// -// * Data points with a period of 3600 seconds (1 hour) are available for -// 455 days (15 months) -// -// Note that CloudWatch started retaining 5-minute and 1-hour metric data as -// of 9 July 2016. -// -// The maximum number of data points returned from a single call is 1,440. If -// you request more than 1,440 data points, Amazon CloudWatch returns an error. -// To reduce the number of data points, you can narrow the specified time range -// and make multiple requests across adjacent time ranges, or you can increase -// the specified period. A period can be as short as one minute (60 seconds). -// Note that data points are not returned in chronological order. -// -// Amazon CloudWatch aggregates data points based on the length of the period -// that you specify. For example, if you request statistics with a one-hour -// period, Amazon CloudWatch aggregates all data points with time stamps that -// fall within each one-hour period. Therefore, the number of values aggregated -// by CloudWatch is larger than the number of data points returned. -// -// For a list of metrics and dimensions supported by AWS services, see the Amazon -// CloudWatch Metrics and Dimensions Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html) -// in the Amazon CloudWatch 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 CloudWatch's -// API operation GetMetricStatistics for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value of an input parameter is bad or out-of-range. -// -// * ErrCodeMissingRequiredParameterException "MissingParameter" -// An input parameter that is required is missing. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Parameters that cannot be used together were used together. -// -// * ErrCodeInternalServiceFault "InternalServiceError" -// Request processing has failed due to some unknown error, exception, or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatistics -func (c *CloudWatch) GetMetricStatistics(input *GetMetricStatisticsInput) (*GetMetricStatisticsOutput, error) { - req, out := c.GetMetricStatisticsRequest(input) - err := req.Send() - return out, err -} - -const opListMetrics = "ListMetrics" - -// ListMetricsRequest generates a "aws/request.Request" representing the -// client's request for the ListMetrics operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListMetrics for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListMetrics method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListMetricsRequest method. -// req, resp := client.ListMetricsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetrics -func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) (req *request.Request, output *ListMetricsOutput) { - op := &request.Operation{ - Name: opListMetrics, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMetricsInput{} - } - - output = &ListMetricsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMetrics API operation for Amazon CloudWatch. -// -// List the specified metrics. You can use the returned metrics with GetMetricStatistics -// to obtain statistical data. -// -// Up to 500 results are returned for any one call. To retrieve additional results, -// use the returned token with subsequent calls. -// -// After you create a metric, allow up to fifteen minutes before the metric -// appears. Statistics about the metric, however, are available sooner using -// GetMetricStatistics. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch's -// API operation ListMetrics for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServiceFault "InternalServiceError" -// Request processing has failed due to some unknown error, exception, or failure. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value of an input parameter is bad or out-of-range. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetrics -func (c *CloudWatch) ListMetrics(input *ListMetricsInput) (*ListMetricsOutput, error) { - req, out := c.ListMetricsRequest(input) - err := req.Send() - return out, err -} - -// ListMetricsPages iterates over the pages of a ListMetrics operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMetrics 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 ListMetrics operation. -// pageNum := 0 -// err := client.ListMetricsPages(params, -// func(page *ListMetricsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(p *ListMetricsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListMetricsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListMetricsOutput), lastPage) - }) -} - -const opPutMetricAlarm = "PutMetricAlarm" - -// PutMetricAlarmRequest generates a "aws/request.Request" representing the -// client's request for the PutMetricAlarm operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutMetricAlarm for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutMetricAlarm method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutMetricAlarmRequest method. -// req, resp := client.PutMetricAlarmRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarm -func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *request.Request, output *PutMetricAlarmOutput) { - op := &request.Operation{ - Name: opPutMetricAlarm, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutMetricAlarmInput{} - } - - output = &PutMetricAlarmOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutMetricAlarm API operation for Amazon CloudWatch. -// -// Creates or updates an alarm and associates it with the specified metric. -// Optionally, this operation can associate one or more Amazon SNS resources -// with the alarm. -// -// When this operation creates an alarm, the alarm state is immediately set -// to INSUFFICIENT_DATA. The alarm is evaluated and its state is set appropriately. -// Any actions associated with the state are then executed. -// -// When you update an existing alarm, its state is left unchanged, but the update -// completely overwrites the previous configuration of the alarm. -// -// If you are an AWS Identity and Access Management (IAM) user, you must have -// Amazon EC2 permissions for some operations: -// -// * ec2:DescribeInstanceStatus and ec2:DescribeInstances for all alarms -// on EC2 instance status metrics -// -// * ec2:StopInstances for alarms with stop actions -// -// * ec2:TerminateInstances for alarms with terminate actions -// -// * ec2:DescribeInstanceRecoveryAttribute and ec2:RecoverInstances for alarms -// with recover actions -// -// If you have read/write permissions for Amazon CloudWatch but not for Amazon -// EC2, you can still create an alarm, but the stop or terminate actions won't -// be performed. However, if you are later granted the required permissions, -// the alarm actions that you created earlier will be performed. -// -// If you are using an IAM role (for example, an Amazon EC2 instance profile), -// you cannot stop or terminate the instance using alarm actions. However, you -// can still see the alarm state and perform any other actions such as Amazon -// SNS notifications or Auto Scaling policies. -// -// If you are using temporary security credentials granted using the AWS Security -// Token Service (AWS STS), you cannot stop or terminate an Amazon EC2 instance -// using alarm actions. -// -// Note that you must create at least one stop, terminate, or reboot alarm using -// the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role. -// After this IAM role is created, you can create stop, terminate, or reboot -// alarms using a command-line interface or an 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 CloudWatch's -// API operation PutMetricAlarm for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededFault "LimitExceeded" -// The quota for alarms for this customer has already been reached. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarm -func (c *CloudWatch) PutMetricAlarm(input *PutMetricAlarmInput) (*PutMetricAlarmOutput, error) { - req, out := c.PutMetricAlarmRequest(input) - err := req.Send() - return out, err -} - -const opPutMetricData = "PutMetricData" - -// PutMetricDataRequest generates a "aws/request.Request" representing the -// client's request for the PutMetricData operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutMetricData for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutMetricData method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutMetricDataRequest method. -// req, resp := client.PutMetricDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricData -func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *request.Request, output *PutMetricDataOutput) { - op := &request.Operation{ - Name: opPutMetricData, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutMetricDataInput{} - } - - output = &PutMetricDataOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutMetricData API operation for Amazon CloudWatch. -// -// Publishes metric data points to Amazon CloudWatch. Amazon CloudWatch associates -// the data points with the specified metric. If the specified metric does not -// exist, Amazon CloudWatch creates the metric. When Amazon CloudWatch creates -// a metric, it can take up to fifteen minutes for the metric to appear in calls -// to ListMetrics. -// -// Each PutMetricData request is limited to 8 KB in size for HTTP GET requests -// and is limited to 40 KB in size for HTTP POST requests. -// -// Although the Value parameter accepts numbers of type Double, Amazon CloudWatch -// rejects values that are either too small or too large. Values must be in -// the range of 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 -// (Base 2). In addition, special values (e.g., NaN, +Infinity, -Infinity) are -// not supported. -// -// Data points with time stamps from 24 hours ago or longer can take at least -// 48 hours to become available for GetMetricStatistics from the time they are -// submitted. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch's -// API operation PutMetricData for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value of an input parameter is bad or out-of-range. -// -// * ErrCodeMissingRequiredParameterException "MissingParameter" -// An input parameter that is required is missing. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Parameters that cannot be used together were used together. -// -// * ErrCodeInternalServiceFault "InternalServiceError" -// Request processing has failed due to some unknown error, exception, or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricData -func (c *CloudWatch) PutMetricData(input *PutMetricDataInput) (*PutMetricDataOutput, error) { - req, out := c.PutMetricDataRequest(input) - err := req.Send() - return out, err -} - -const opSetAlarmState = "SetAlarmState" - -// SetAlarmStateRequest generates a "aws/request.Request" representing the -// client's request for the SetAlarmState operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetAlarmState for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetAlarmState method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetAlarmStateRequest method. -// req, resp := client.SetAlarmStateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmState -func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *request.Request, output *SetAlarmStateOutput) { - op := &request.Operation{ - Name: opSetAlarmState, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetAlarmStateInput{} - } - - output = &SetAlarmStateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetAlarmState API operation for Amazon CloudWatch. -// -// Temporarily sets the state of an alarm for testing purposes. When the updated -// state differs from the previous value, the action configured for the appropriate -// state is invoked. For example, if your alarm is configured to send an Amazon -// SNS message when an alarm is triggered, temporarily changing the alarm state -// to ALARM sends an Amazon SNS message. The alarm returns to its actual state -// (often within seconds). Because the alarm state change happens very quickly, -// it is typically only visible in the alarm's History tab in the Amazon CloudWatch -// console or through DescribeAlarmHistory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch's -// API operation SetAlarmState for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// The named resource does not exist. -// -// * ErrCodeInvalidFormatFault "InvalidFormat" -// Data was not syntactically valid JSON. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmState -func (c *CloudWatch) SetAlarmState(input *SetAlarmStateInput) (*SetAlarmStateOutput, error) { - req, out := c.SetAlarmStateRequest(input) - err := req.Send() - return out, err -} - -// Represents the history of a specific alarm. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/AlarmHistoryItem -type AlarmHistoryItem struct { - _ struct{} `type:"structure"` - - // The descriptive name for the alarm. - AlarmName *string `min:"1" type:"string"` - - // Data about the alarm, in JSON format. - HistoryData *string `min:"1" type:"string"` - - // The type of alarm history item. - HistoryItemType *string `type:"string" enum:"HistoryItemType"` - - // A summary of the alarm history, in text format. - HistorySummary *string `min:"1" type:"string"` - - // The time stamp for the alarm history item. - Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s AlarmHistoryItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AlarmHistoryItem) GoString() string { - return s.String() -} - -// SetAlarmName sets the AlarmName field's value. -func (s *AlarmHistoryItem) SetAlarmName(v string) *AlarmHistoryItem { - s.AlarmName = &v - return s -} - -// SetHistoryData sets the HistoryData field's value. -func (s *AlarmHistoryItem) SetHistoryData(v string) *AlarmHistoryItem { - s.HistoryData = &v - return s -} - -// SetHistoryItemType sets the HistoryItemType field's value. -func (s *AlarmHistoryItem) SetHistoryItemType(v string) *AlarmHistoryItem { - s.HistoryItemType = &v - return s -} - -// SetHistorySummary sets the HistorySummary field's value. -func (s *AlarmHistoryItem) SetHistorySummary(v string) *AlarmHistoryItem { - s.HistorySummary = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *AlarmHistoryItem) SetTimestamp(v time.Time) *AlarmHistoryItem { - s.Timestamp = &v - return s -} - -// Encapsulates the statistical data that Amazon CloudWatch computes from metric -// data. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Datapoint -type Datapoint struct { - _ struct{} `type:"structure"` - - // The average of the metric values that correspond to the data point. - Average *float64 `type:"double"` - - // The percentile statistic for the data point. - ExtendedStatistics map[string]*float64 `type:"map"` - - // The maximum metric value for the data point. - Maximum *float64 `type:"double"` - - // The minimum metric value for the data point. - Minimum *float64 `type:"double"` - - // The number of metric values that contributed to the aggregate value of this - // data point. - SampleCount *float64 `type:"double"` - - // The sum of the metric values for the data point. - Sum *float64 `type:"double"` - - // The time stamp used for the data point. - Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The standard unit for the data point. - Unit *string `type:"string" enum:"StandardUnit"` -} - -// String returns the string representation -func (s Datapoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Datapoint) GoString() string { - return s.String() -} - -// SetAverage sets the Average field's value. -func (s *Datapoint) SetAverage(v float64) *Datapoint { - s.Average = &v - return s -} - -// SetExtendedStatistics sets the ExtendedStatistics field's value. -func (s *Datapoint) SetExtendedStatistics(v map[string]*float64) *Datapoint { - s.ExtendedStatistics = v - return s -} - -// SetMaximum sets the Maximum field's value. -func (s *Datapoint) SetMaximum(v float64) *Datapoint { - s.Maximum = &v - return s -} - -// SetMinimum sets the Minimum field's value. -func (s *Datapoint) SetMinimum(v float64) *Datapoint { - s.Minimum = &v - return s -} - -// SetSampleCount sets the SampleCount field's value. -func (s *Datapoint) SetSampleCount(v float64) *Datapoint { - s.SampleCount = &v - return s -} - -// SetSum sets the Sum field's value. -func (s *Datapoint) SetSum(v float64) *Datapoint { - s.Sum = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *Datapoint) SetTimestamp(v time.Time) *Datapoint { - s.Timestamp = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *Datapoint) SetUnit(v string) *Datapoint { - s.Unit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarmsInput -type DeleteAlarmsInput struct { - _ struct{} `type:"structure"` - - // The alarms to be deleted. - // - // AlarmNames is a required field - AlarmNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DeleteAlarmsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAlarmsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAlarmsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAlarmsInput"} - if s.AlarmNames == nil { - invalidParams.Add(request.NewErrParamRequired("AlarmNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmNames sets the AlarmNames field's value. -func (s *DeleteAlarmsInput) SetAlarmNames(v []*string) *DeleteAlarmsInput { - s.AlarmNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarmsOutput -type DeleteAlarmsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAlarmsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAlarmsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistoryInput -type DescribeAlarmHistoryInput struct { - _ struct{} `type:"structure"` - - // The name of the alarm. - AlarmName *string `min:"1" type:"string"` - - // The ending date to retrieve alarm history. - EndDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The type of alarm histories to retrieve. - HistoryItemType *string `type:"string" enum:"HistoryItemType"` - - // The maximum number of alarm history records to retrieve. - MaxRecords *int64 `min:"1" type:"integer"` - - // The token returned by a previous call to indicate that there is more data - // available. - NextToken *string `type:"string"` - - // The starting date to retrieve alarm history. - StartDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeAlarmHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAlarmHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAlarmHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmHistoryInput"} - if s.AlarmName != nil && len(*s.AlarmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1)) - } - if s.MaxRecords != nil && *s.MaxRecords < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmName sets the AlarmName field's value. -func (s *DescribeAlarmHistoryInput) SetAlarmName(v string) *DescribeAlarmHistoryInput { - s.AlarmName = &v - return s -} - -// SetEndDate sets the EndDate field's value. -func (s *DescribeAlarmHistoryInput) SetEndDate(v time.Time) *DescribeAlarmHistoryInput { - s.EndDate = &v - return s -} - -// SetHistoryItemType sets the HistoryItemType field's value. -func (s *DescribeAlarmHistoryInput) SetHistoryItemType(v string) *DescribeAlarmHistoryInput { - s.HistoryItemType = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeAlarmHistoryInput) SetMaxRecords(v int64) *DescribeAlarmHistoryInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAlarmHistoryInput) SetNextToken(v string) *DescribeAlarmHistoryInput { - s.NextToken = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *DescribeAlarmHistoryInput) SetStartDate(v time.Time) *DescribeAlarmHistoryInput { - s.StartDate = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistoryOutput -type DescribeAlarmHistoryOutput struct { - _ struct{} `type:"structure"` - - // The alarm histories, in JSON format. - AlarmHistoryItems []*AlarmHistoryItem `type:"list"` - - // The token that marks the start of the next batch of returned results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAlarmHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAlarmHistoryOutput) GoString() string { - return s.String() -} - -// SetAlarmHistoryItems sets the AlarmHistoryItems field's value. -func (s *DescribeAlarmHistoryOutput) SetAlarmHistoryItems(v []*AlarmHistoryItem) *DescribeAlarmHistoryOutput { - s.AlarmHistoryItems = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAlarmHistoryOutput) SetNextToken(v string) *DescribeAlarmHistoryOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetricInput -type DescribeAlarmsForMetricInput struct { - _ struct{} `type:"structure"` - - // The dimensions associated with the metric. If the metric has any associated - // dimensions, you must specify them in order for the call to succeed. - Dimensions []*Dimension `type:"list"` - - // The percentile statistic for the metric. Specify a value between p0.0 and - // p100. - ExtendedStatistic *string `type:"string"` - - // The name of the metric. - // - // MetricName is a required field - MetricName *string `min:"1" type:"string" required:"true"` - - // The namespace of the metric. - // - // Namespace is a required field - Namespace *string `min:"1" type:"string" required:"true"` - - // The period, in seconds, over which the statistic is applied. - Period *int64 `min:"60" type:"integer"` - - // The statistic for the metric, other than percentiles. For percentile statistics, - // use ExtendedStatistics. - Statistic *string `type:"string" enum:"Statistic"` - - // The unit for the metric. - Unit *string `type:"string" enum:"StandardUnit"` -} - -// String returns the string representation -func (s DescribeAlarmsForMetricInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAlarmsForMetricInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAlarmsForMetricInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsForMetricInput"} - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.MetricName != nil && len(*s.MetricName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) - } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) - } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) - } - if s.Period != nil && *s.Period < 60 { - invalidParams.Add(request.NewErrParamMinValue("Period", 60)) - } - if s.Dimensions != nil { - for i, v := range s.Dimensions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDimensions sets the Dimensions field's value. -func (s *DescribeAlarmsForMetricInput) SetDimensions(v []*Dimension) *DescribeAlarmsForMetricInput { - s.Dimensions = v - return s -} - -// SetExtendedStatistic sets the ExtendedStatistic field's value. -func (s *DescribeAlarmsForMetricInput) SetExtendedStatistic(v string) *DescribeAlarmsForMetricInput { - s.ExtendedStatistic = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *DescribeAlarmsForMetricInput) SetMetricName(v string) *DescribeAlarmsForMetricInput { - s.MetricName = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *DescribeAlarmsForMetricInput) SetNamespace(v string) *DescribeAlarmsForMetricInput { - s.Namespace = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *DescribeAlarmsForMetricInput) SetPeriod(v int64) *DescribeAlarmsForMetricInput { - s.Period = &v - return s -} - -// SetStatistic sets the Statistic field's value. -func (s *DescribeAlarmsForMetricInput) SetStatistic(v string) *DescribeAlarmsForMetricInput { - s.Statistic = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *DescribeAlarmsForMetricInput) SetUnit(v string) *DescribeAlarmsForMetricInput { - s.Unit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetricOutput -type DescribeAlarmsForMetricOutput struct { - _ struct{} `type:"structure"` - - // The information for each alarm with the specified metric. - MetricAlarms []*MetricAlarm `type:"list"` -} - -// String returns the string representation -func (s DescribeAlarmsForMetricOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAlarmsForMetricOutput) GoString() string { - return s.String() -} - -// SetMetricAlarms sets the MetricAlarms field's value. -func (s *DescribeAlarmsForMetricOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsForMetricOutput { - s.MetricAlarms = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsInput -type DescribeAlarmsInput struct { - _ struct{} `type:"structure"` - - // The action name prefix. - ActionPrefix *string `min:"1" type:"string"` - - // The alarm name prefix. You cannot specify AlarmNames if this parameter is - // specified. - AlarmNamePrefix *string `min:"1" type:"string"` - - // The names of the alarms. - AlarmNames []*string `type:"list"` - - // The maximum number of alarm descriptions to retrieve. - MaxRecords *int64 `min:"1" type:"integer"` - - // The token returned by a previous call to indicate that there is more data - // available. - NextToken *string `type:"string"` - - // The state value to be used in matching alarms. - StateValue *string `type:"string" enum:"StateValue"` -} - -// String returns the string representation -func (s DescribeAlarmsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAlarmsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAlarmsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsInput"} - if s.ActionPrefix != nil && len(*s.ActionPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionPrefix", 1)) - } - if s.AlarmNamePrefix != nil && len(*s.AlarmNamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlarmNamePrefix", 1)) - } - if s.MaxRecords != nil && *s.MaxRecords < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionPrefix sets the ActionPrefix field's value. -func (s *DescribeAlarmsInput) SetActionPrefix(v string) *DescribeAlarmsInput { - s.ActionPrefix = &v - return s -} - -// SetAlarmNamePrefix sets the AlarmNamePrefix field's value. -func (s *DescribeAlarmsInput) SetAlarmNamePrefix(v string) *DescribeAlarmsInput { - s.AlarmNamePrefix = &v - return s -} - -// SetAlarmNames sets the AlarmNames field's value. -func (s *DescribeAlarmsInput) SetAlarmNames(v []*string) *DescribeAlarmsInput { - s.AlarmNames = v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeAlarmsInput) SetMaxRecords(v int64) *DescribeAlarmsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAlarmsInput) SetNextToken(v string) *DescribeAlarmsInput { - s.NextToken = &v - return s -} - -// SetStateValue sets the StateValue field's value. -func (s *DescribeAlarmsInput) SetStateValue(v string) *DescribeAlarmsInput { - s.StateValue = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsOutput -type DescribeAlarmsOutput struct { - _ struct{} `type:"structure"` - - // The information for the specified alarms. - MetricAlarms []*MetricAlarm `type:"list"` - - // The token that marks the start of the next batch of returned results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAlarmsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAlarmsOutput) GoString() string { - return s.String() -} - -// SetMetricAlarms sets the MetricAlarms field's value. -func (s *DescribeAlarmsOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsOutput { - s.MetricAlarms = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAlarmsOutput) SetNextToken(v string) *DescribeAlarmsOutput { - s.NextToken = &v - return s -} - -// Expands the identity of a metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Dimension -type Dimension struct { - _ struct{} `type:"structure"` - - // The name of the dimension. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The value representing the dimension measurement. - // - // 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Dimension) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Dimension"} - 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.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// 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 -} - -// Represents filters for a dimension. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DimensionFilter -type DimensionFilter struct { - _ struct{} `type:"structure"` - - // The dimension name to be matched. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The value of the dimension to be matched. - Value *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DimensionFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DimensionFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DimensionFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DimensionFilter"} - 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.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DimensionFilter) SetName(v string) *DimensionFilter { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *DimensionFilter) SetValue(v string) *DimensionFilter { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActionsInput -type DisableAlarmActionsInput struct { - _ struct{} `type:"structure"` - - // The names of the alarms. - // - // AlarmNames is a required field - AlarmNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DisableAlarmActionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableAlarmActionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableAlarmActionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableAlarmActionsInput"} - if s.AlarmNames == nil { - invalidParams.Add(request.NewErrParamRequired("AlarmNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmNames sets the AlarmNames field's value. -func (s *DisableAlarmActionsInput) SetAlarmNames(v []*string) *DisableAlarmActionsInput { - s.AlarmNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActionsOutput -type DisableAlarmActionsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableAlarmActionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableAlarmActionsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActionsInput -type EnableAlarmActionsInput struct { - _ struct{} `type:"structure"` - - // The names of the alarms. - // - // AlarmNames is a required field - AlarmNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s EnableAlarmActionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableAlarmActionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableAlarmActionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableAlarmActionsInput"} - if s.AlarmNames == nil { - invalidParams.Add(request.NewErrParamRequired("AlarmNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmNames sets the AlarmNames field's value. -func (s *EnableAlarmActionsInput) SetAlarmNames(v []*string) *EnableAlarmActionsInput { - s.AlarmNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActionsOutput -type EnableAlarmActionsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableAlarmActionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableAlarmActionsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatisticsInput -type GetMetricStatisticsInput struct { - _ struct{} `type:"structure"` - - // The dimensions. CloudWatch treats each unique combination of dimensions as - // a separate metric. You can't retrieve statistics using combinations of dimensions - // that were not specially published. You must specify the same dimensions that - // were used when the metrics were created. For an example, see Dimension Combinations - // (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations) - // in the Amazon CloudWatch User Guide. - Dimensions []*Dimension `type:"list"` - - // The time stamp that determines the last data point to return. - // - // The value specified is exclusive; results will include data points up to - // the specified time stamp. The time stamp must be in ISO 8601 UTC format (for - // example, 2016-10-10T23:00:00Z). - // - // EndTime is a required field - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The percentile statistics. Specify values between p0.0 and p100. - ExtendedStatistics []*string `min:"1" type:"list"` - - // The name of the metric, with or without spaces. - // - // MetricName is a required field - MetricName *string `min:"1" type:"string" required:"true"` - - // The namespace of the metric, with or without spaces. - // - // Namespace is a required field - Namespace *string `min:"1" type:"string" required:"true"` - - // The granularity, in seconds, of the returned data points. A period can be - // as short as one minute (60 seconds) and must be a multiple of 60. The default - // value is 60. - // - // If the StartTime parameter specifies a time stamp that is greater than 15 - // days ago, you must specify the period as follows or no data points in that - // time range is returned: - // - // * Start time between 15 and 63 days ago - Use a multiple of 300 seconds - // (5 minutes). - // - // * Start time greater than 63 days ago - Use a multiple of 3600 seconds - // (1 hour). - // - // Period is a required field - Period *int64 `min:"60" type:"integer" required:"true"` - - // The time stamp that determines the first data point to return. Note that - // start times are evaluated relative to the time that CloudWatch receives the - // request. - // - // The value specified is inclusive; results include data points with the specified - // time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z). - // - // CloudWatch rounds the specified time stamp as follows: - // - // * Start time less than 15 days ago - Round down to the nearest whole minute. - // For example, 12:32:34 is rounded down to 12:32:00. - // - // * Start time between 15 and 63 days ago - Round down to the nearest 5-minute - // clock interval. For example, 12:32:34 is rounded down to 12:30:00. - // - // * Start time greater than 63 days ago - Round down to the nearest 1-hour - // clock interval. For example, 12:32:34 is rounded down to 12:00:00. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The metric statistics, other than percentile. For percentile statistics, - // use ExtendedStatistic. - Statistics []*string `min:"1" type:"list"` - - // The unit for a given metric. Metrics may be reported in multiple units. Not - // supplying a unit results in all units being returned. If the metric only - // ever reports one unit, specifying a unit has no effect. - Unit *string `type:"string" enum:"StandardUnit"` -} - -// String returns the string representation -func (s GetMetricStatisticsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMetricStatisticsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMetricStatisticsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMetricStatisticsInput"} - if s.EndTime == nil { - invalidParams.Add(request.NewErrParamRequired("EndTime")) - } - if s.ExtendedStatistics != nil && len(s.ExtendedStatistics) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExtendedStatistics", 1)) - } - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.MetricName != nil && len(*s.MetricName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) - } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) - } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) - } - if s.Period == nil { - invalidParams.Add(request.NewErrParamRequired("Period")) - } - if s.Period != nil && *s.Period < 60 { - invalidParams.Add(request.NewErrParamMinValue("Period", 60)) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - if s.Statistics != nil && len(s.Statistics) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Statistics", 1)) - } - if s.Dimensions != nil { - for i, v := range s.Dimensions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDimensions sets the Dimensions field's value. -func (s *GetMetricStatisticsInput) SetDimensions(v []*Dimension) *GetMetricStatisticsInput { - s.Dimensions = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *GetMetricStatisticsInput) SetEndTime(v time.Time) *GetMetricStatisticsInput { - s.EndTime = &v - return s -} - -// SetExtendedStatistics sets the ExtendedStatistics field's value. -func (s *GetMetricStatisticsInput) SetExtendedStatistics(v []*string) *GetMetricStatisticsInput { - s.ExtendedStatistics = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *GetMetricStatisticsInput) SetMetricName(v string) *GetMetricStatisticsInput { - s.MetricName = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *GetMetricStatisticsInput) SetNamespace(v string) *GetMetricStatisticsInput { - s.Namespace = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *GetMetricStatisticsInput) SetPeriod(v int64) *GetMetricStatisticsInput { - s.Period = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetMetricStatisticsInput) SetStartTime(v time.Time) *GetMetricStatisticsInput { - s.StartTime = &v - return s -} - -// SetStatistics sets the Statistics field's value. -func (s *GetMetricStatisticsInput) SetStatistics(v []*string) *GetMetricStatisticsInput { - s.Statistics = v - return s -} - -// SetUnit sets the Unit field's value. -func (s *GetMetricStatisticsInput) SetUnit(v string) *GetMetricStatisticsInput { - s.Unit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatisticsOutput -type GetMetricStatisticsOutput struct { - _ struct{} `type:"structure"` - - // The data points for the specified metric. - Datapoints []*Datapoint `type:"list"` - - // A label for the specified metric. - Label *string `type:"string"` -} - -// String returns the string representation -func (s GetMetricStatisticsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMetricStatisticsOutput) GoString() string { - return s.String() -} - -// SetDatapoints sets the Datapoints field's value. -func (s *GetMetricStatisticsOutput) SetDatapoints(v []*Datapoint) *GetMetricStatisticsOutput { - s.Datapoints = v - return s -} - -// SetLabel sets the Label field's value. -func (s *GetMetricStatisticsOutput) SetLabel(v string) *GetMetricStatisticsOutput { - s.Label = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetricsInput -type ListMetricsInput struct { - _ struct{} `type:"structure"` - - // The dimensions to filter against. - Dimensions []*DimensionFilter `type:"list"` - - // The name of the metric to filter against. - MetricName *string `min:"1" type:"string"` - - // The namespace to filter against. - Namespace *string `min:"1" type:"string"` - - // The token returned by a previous call to indicate that there is more data - // available. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListMetricsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListMetricsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMetricsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMetricsInput"} - if s.MetricName != nil && len(*s.MetricName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) - } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) - } - if s.Dimensions != nil { - for i, v := range s.Dimensions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDimensions sets the Dimensions field's value. -func (s *ListMetricsInput) SetDimensions(v []*DimensionFilter) *ListMetricsInput { - s.Dimensions = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *ListMetricsInput) SetMetricName(v string) *ListMetricsInput { - s.MetricName = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *ListMetricsInput) SetNamespace(v string) *ListMetricsInput { - s.Namespace = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMetricsInput) SetNextToken(v string) *ListMetricsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetricsOutput -type ListMetricsOutput struct { - _ struct{} `type:"structure"` - - // The metrics. - Metrics []*Metric `type:"list"` - - // The token that marks the start of the next batch of returned results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListMetricsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListMetricsOutput) GoString() string { - return s.String() -} - -// SetMetrics sets the Metrics field's value. -func (s *ListMetricsOutput) SetMetrics(v []*Metric) *ListMetricsOutput { - s.Metrics = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMetricsOutput) SetNextToken(v string) *ListMetricsOutput { - s.NextToken = &v - return s -} - -// Represents a specific metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Metric -type Metric struct { - _ struct{} `type:"structure"` - - // The dimensions for the metric. - Dimensions []*Dimension `type:"list"` - - // The name of the metric. - MetricName *string `min:"1" type:"string"` - - // The namespace of the metric. - Namespace *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s Metric) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Metric) GoString() string { - return s.String() -} - -// SetDimensions sets the Dimensions field's value. -func (s *Metric) SetDimensions(v []*Dimension) *Metric { - s.Dimensions = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *Metric) SetMetricName(v string) *Metric { - s.MetricName = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *Metric) SetNamespace(v string) *Metric { - s.Namespace = &v - return s -} - -// Represents an alarm. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricAlarm -type MetricAlarm struct { - _ struct{} `type:"structure"` - - // Indicates whether actions should be executed during any changes to the alarm - // state. - ActionsEnabled *bool `type:"boolean"` - - // The actions to execute when this alarm transitions to the ALARM state from - // any other state. Each action is specified as an Amazon Resource Name (ARN). - AlarmActions []*string `type:"list"` - - // The Amazon Resource Name (ARN) of the alarm. - AlarmArn *string `min:"1" type:"string"` - - // The time stamp of the last update to the alarm configuration. - AlarmConfigurationUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The description of the alarm. - AlarmDescription *string `type:"string"` - - // The name of the alarm. - AlarmName *string `min:"1" type:"string"` - - // The arithmetic operation to use when comparing the specified statistic and - // threshold. The specified statistic value is used as the first operand. - ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` - - // The dimensions for the metric associated with the alarm. - Dimensions []*Dimension `type:"list"` - - // The number of periods over which data is compared to the specified threshold. - EvaluationPeriods *int64 `min:"1" type:"integer"` - - // The percentile statistic for the metric associated with the alarm. Specify - // a value between p0.0 and p100. - ExtendedStatistic *string `type:"string"` - - // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA - // state from any other state. Each action is specified as an Amazon Resource - // Name (ARN). - InsufficientDataActions []*string `type:"list"` - - // The name of the metric associated with the alarm. - MetricName *string `min:"1" type:"string"` - - // The namespace of the metric associated with the alarm. - Namespace *string `min:"1" type:"string"` - - // The actions to execute when this alarm transitions to the OK state from any - // other state. Each action is specified as an Amazon Resource Name (ARN). - OKActions []*string `type:"list"` - - // The period, in seconds, over which the statistic is applied. - Period *int64 `min:"60" type:"integer"` - - // An explanation for the alarm state, in text format. - StateReason *string `type:"string"` - - // An explanation for the alarm state, in JSON format. - StateReasonData *string `type:"string"` - - // The time stamp of the last update to the alarm state. - StateUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The state value for the alarm. - StateValue *string `type:"string" enum:"StateValue"` - - // The statistic for the metric associated with the alarm, other than percentile. - // For percentile statistics, use ExtendedStatistic. - Statistic *string `type:"string" enum:"Statistic"` - - // The value to compare with the specified statistic. - Threshold *float64 `type:"double"` - - // The unit of the metric associated with the alarm. - Unit *string `type:"string" enum:"StandardUnit"` -} - -// String returns the string representation -func (s MetricAlarm) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricAlarm) GoString() string { - return s.String() -} - -// SetActionsEnabled sets the ActionsEnabled field's value. -func (s *MetricAlarm) SetActionsEnabled(v bool) *MetricAlarm { - s.ActionsEnabled = &v - return s -} - -// SetAlarmActions sets the AlarmActions field's value. -func (s *MetricAlarm) SetAlarmActions(v []*string) *MetricAlarm { - s.AlarmActions = v - return s -} - -// SetAlarmArn sets the AlarmArn field's value. -func (s *MetricAlarm) SetAlarmArn(v string) *MetricAlarm { - s.AlarmArn = &v - return s -} - -// SetAlarmConfigurationUpdatedTimestamp sets the AlarmConfigurationUpdatedTimestamp field's value. -func (s *MetricAlarm) SetAlarmConfigurationUpdatedTimestamp(v time.Time) *MetricAlarm { - s.AlarmConfigurationUpdatedTimestamp = &v - return s -} - -// SetAlarmDescription sets the AlarmDescription field's value. -func (s *MetricAlarm) SetAlarmDescription(v string) *MetricAlarm { - s.AlarmDescription = &v - return s -} - -// SetAlarmName sets the AlarmName field's value. -func (s *MetricAlarm) SetAlarmName(v string) *MetricAlarm { - s.AlarmName = &v - return s -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *MetricAlarm) SetComparisonOperator(v string) *MetricAlarm { - s.ComparisonOperator = &v - return s -} - -// SetDimensions sets the Dimensions field's value. -func (s *MetricAlarm) SetDimensions(v []*Dimension) *MetricAlarm { - s.Dimensions = v - return s -} - -// SetEvaluationPeriods sets the EvaluationPeriods field's value. -func (s *MetricAlarm) SetEvaluationPeriods(v int64) *MetricAlarm { - s.EvaluationPeriods = &v - return s -} - -// SetExtendedStatistic sets the ExtendedStatistic field's value. -func (s *MetricAlarm) SetExtendedStatistic(v string) *MetricAlarm { - s.ExtendedStatistic = &v - return s -} - -// SetInsufficientDataActions sets the InsufficientDataActions field's value. -func (s *MetricAlarm) SetInsufficientDataActions(v []*string) *MetricAlarm { - s.InsufficientDataActions = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *MetricAlarm) SetMetricName(v string) *MetricAlarm { - s.MetricName = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *MetricAlarm) SetNamespace(v string) *MetricAlarm { - s.Namespace = &v - return s -} - -// SetOKActions sets the OKActions field's value. -func (s *MetricAlarm) SetOKActions(v []*string) *MetricAlarm { - s.OKActions = v - return s -} - -// SetPeriod sets the Period field's value. -func (s *MetricAlarm) SetPeriod(v int64) *MetricAlarm { - s.Period = &v - return s -} - -// SetStateReason sets the StateReason field's value. -func (s *MetricAlarm) SetStateReason(v string) *MetricAlarm { - s.StateReason = &v - return s -} - -// SetStateReasonData sets the StateReasonData field's value. -func (s *MetricAlarm) SetStateReasonData(v string) *MetricAlarm { - s.StateReasonData = &v - return s -} - -// SetStateUpdatedTimestamp sets the StateUpdatedTimestamp field's value. -func (s *MetricAlarm) SetStateUpdatedTimestamp(v time.Time) *MetricAlarm { - s.StateUpdatedTimestamp = &v - return s -} - -// SetStateValue sets the StateValue field's value. -func (s *MetricAlarm) SetStateValue(v string) *MetricAlarm { - s.StateValue = &v - return s -} - -// SetStatistic sets the Statistic field's value. -func (s *MetricAlarm) SetStatistic(v string) *MetricAlarm { - s.Statistic = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *MetricAlarm) SetThreshold(v float64) *MetricAlarm { - s.Threshold = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *MetricAlarm) SetUnit(v string) *MetricAlarm { - s.Unit = &v - return s -} - -// Encapsulates the information sent to either create a metric or add new values -// to be aggregated into an existing metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricDatum -type MetricDatum struct { - _ struct{} `type:"structure"` - - // The dimensions associated with the metric. - Dimensions []*Dimension `type:"list"` - - // The name of the metric. - // - // MetricName is a required field - MetricName *string `min:"1" type:"string" required:"true"` - - // The statistical values for the metric. - StatisticValues *StatisticSet `type:"structure"` - - // The time the metric data was received, expressed as the number of milliseconds - // since Jan 1, 1970 00:00:00 UTC. - Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The unit of the metric. - Unit *string `type:"string" enum:"StandardUnit"` - - // The value for the metric. - // - // Although the parameter accepts numbers of type Double, Amazon CloudWatch - // rejects values that are either too small or too large. Values must be in - // the range of 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 - // (Base 2). In addition, special values (for example, NaN, +Infinity, -Infinity) - // are not supported. - Value *float64 `type:"double"` -} - -// String returns the string representation -func (s MetricDatum) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricDatum) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricDatum) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricDatum"} - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.MetricName != nil && len(*s.MetricName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) - } - if s.Dimensions != nil { - for i, v := range s.Dimensions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.StatisticValues != nil { - if err := s.StatisticValues.Validate(); err != nil { - invalidParams.AddNested("StatisticValues", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDimensions sets the Dimensions field's value. -func (s *MetricDatum) SetDimensions(v []*Dimension) *MetricDatum { - s.Dimensions = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *MetricDatum) SetMetricName(v string) *MetricDatum { - s.MetricName = &v - return s -} - -// SetStatisticValues sets the StatisticValues field's value. -func (s *MetricDatum) SetStatisticValues(v *StatisticSet) *MetricDatum { - s.StatisticValues = v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *MetricDatum) SetTimestamp(v time.Time) *MetricDatum { - s.Timestamp = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *MetricDatum) SetUnit(v string) *MetricDatum { - s.Unit = &v - return s -} - -// SetValue sets the Value field's value. -func (s *MetricDatum) SetValue(v float64) *MetricDatum { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarmInput -type PutMetricAlarmInput struct { - _ struct{} `type:"structure"` - - // Indicates whether actions should be executed during any changes to the alarm - // state. - ActionsEnabled *bool `type:"boolean"` - - // The actions to execute when this alarm transitions to the ALARM state from - // any other state. Each action is specified as an Amazon Resource Name (ARN). - // - // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate - // | arn:aws:automate:region:ec2:recover - // - // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 - // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0 - // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0 - AlarmActions []*string `type:"list"` - - // The description for the alarm. - AlarmDescription *string `type:"string"` - - // The name for the alarm. This name must be unique within the AWS account. - // - // AlarmName is a required field - AlarmName *string `min:"1" type:"string" required:"true"` - - // The arithmetic operation to use when comparing the specified statistic and - // threshold. The specified statistic value is used as the first operand. - // - // ComparisonOperator is a required field - ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` - - // The dimensions for the metric associated with the alarm. - Dimensions []*Dimension `type:"list"` - - // The number of periods over which data is compared to the specified threshold. - // - // EvaluationPeriods is a required field - EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"` - - // The percentile statistic for the metric associated with the alarm. Specify - // a value between p0.0 and p100. - ExtendedStatistic *string `type:"string"` - - // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA - // state from any other state. Each action is specified as an Amazon Resource - // Name (ARN). - // - // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate - // | arn:aws:automate:region:ec2:recover - // - // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 - // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0 - // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0 - InsufficientDataActions []*string `type:"list"` - - // The name for the metric associated with the alarm. - // - // MetricName is a required field - MetricName *string `min:"1" type:"string" required:"true"` - - // The namespace for the metric associated with the alarm. - // - // Namespace is a required field - Namespace *string `min:"1" type:"string" required:"true"` - - // The actions to execute when this alarm transitions to an OK state from any - // other state. Each action is specified as an Amazon Resource Name (ARN). - // - // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate - // | arn:aws:automate:region:ec2:recover - // - // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 - // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0 - // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0 - OKActions []*string `type:"list"` - - // The period, in seconds, over which the specified statistic is applied. - // - // Period is a required field - Period *int64 `min:"60" type:"integer" required:"true"` - - // The statistic for the metric associated with the alarm, other than percentile. - // For percentile statistics, use ExtendedStatistic. - Statistic *string `type:"string" enum:"Statistic"` - - // The value against which the specified statistic is compared. - // - // Threshold is a required field - Threshold *float64 `type:"double" required:"true"` - - // The unit of measure for the statistic. For example, the units for the Amazon - // EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes - // that an instance receives on all network interfaces. You can also specify - // a unit when you create a custom metric. Units help provide conceptual meaning - // to your data. Metric data points that specify a unit of measure, such as - // Percent, are aggregated separately. - // - // If you specify a unit, you must use a unit that is appropriate for the metric. - // Otherwise, the Amazon CloudWatch alarm can get stuck in the INSUFFICIENT - // DATA state. - Unit *string `type:"string" enum:"StandardUnit"` -} - -// String returns the string representation -func (s PutMetricAlarmInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutMetricAlarmInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutMetricAlarmInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutMetricAlarmInput"} - if s.AlarmName == nil { - invalidParams.Add(request.NewErrParamRequired("AlarmName")) - } - if s.AlarmName != nil && len(*s.AlarmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1)) - } - if s.ComparisonOperator == nil { - invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) - } - if s.EvaluationPeriods == nil { - invalidParams.Add(request.NewErrParamRequired("EvaluationPeriods")) - } - if s.EvaluationPeriods != nil && *s.EvaluationPeriods < 1 { - invalidParams.Add(request.NewErrParamMinValue("EvaluationPeriods", 1)) - } - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.MetricName != nil && len(*s.MetricName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) - } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) - } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) - } - if s.Period == nil { - invalidParams.Add(request.NewErrParamRequired("Period")) - } - if s.Period != nil && *s.Period < 60 { - invalidParams.Add(request.NewErrParamMinValue("Period", 60)) - } - if s.Threshold == nil { - invalidParams.Add(request.NewErrParamRequired("Threshold")) - } - if s.Dimensions != nil { - for i, v := range s.Dimensions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionsEnabled sets the ActionsEnabled field's value. -func (s *PutMetricAlarmInput) SetActionsEnabled(v bool) *PutMetricAlarmInput { - s.ActionsEnabled = &v - return s -} - -// SetAlarmActions sets the AlarmActions field's value. -func (s *PutMetricAlarmInput) SetAlarmActions(v []*string) *PutMetricAlarmInput { - s.AlarmActions = v - return s -} - -// SetAlarmDescription sets the AlarmDescription field's value. -func (s *PutMetricAlarmInput) SetAlarmDescription(v string) *PutMetricAlarmInput { - s.AlarmDescription = &v - return s -} - -// SetAlarmName sets the AlarmName field's value. -func (s *PutMetricAlarmInput) SetAlarmName(v string) *PutMetricAlarmInput { - s.AlarmName = &v - return s -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *PutMetricAlarmInput) SetComparisonOperator(v string) *PutMetricAlarmInput { - s.ComparisonOperator = &v - return s -} - -// SetDimensions sets the Dimensions field's value. -func (s *PutMetricAlarmInput) SetDimensions(v []*Dimension) *PutMetricAlarmInput { - s.Dimensions = v - return s -} - -// SetEvaluationPeriods sets the EvaluationPeriods field's value. -func (s *PutMetricAlarmInput) SetEvaluationPeriods(v int64) *PutMetricAlarmInput { - s.EvaluationPeriods = &v - return s -} - -// SetExtendedStatistic sets the ExtendedStatistic field's value. -func (s *PutMetricAlarmInput) SetExtendedStatistic(v string) *PutMetricAlarmInput { - s.ExtendedStatistic = &v - return s -} - -// SetInsufficientDataActions sets the InsufficientDataActions field's value. -func (s *PutMetricAlarmInput) SetInsufficientDataActions(v []*string) *PutMetricAlarmInput { - s.InsufficientDataActions = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *PutMetricAlarmInput) SetMetricName(v string) *PutMetricAlarmInput { - s.MetricName = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *PutMetricAlarmInput) SetNamespace(v string) *PutMetricAlarmInput { - s.Namespace = &v - return s -} - -// SetOKActions sets the OKActions field's value. -func (s *PutMetricAlarmInput) SetOKActions(v []*string) *PutMetricAlarmInput { - s.OKActions = v - return s -} - -// SetPeriod sets the Period field's value. -func (s *PutMetricAlarmInput) SetPeriod(v int64) *PutMetricAlarmInput { - s.Period = &v - return s -} - -// SetStatistic sets the Statistic field's value. -func (s *PutMetricAlarmInput) SetStatistic(v string) *PutMetricAlarmInput { - s.Statistic = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *PutMetricAlarmInput) SetThreshold(v float64) *PutMetricAlarmInput { - s.Threshold = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *PutMetricAlarmInput) SetUnit(v string) *PutMetricAlarmInput { - s.Unit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarmOutput -type PutMetricAlarmOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutMetricAlarmOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutMetricAlarmOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricDataInput -type PutMetricDataInput struct { - _ struct{} `type:"structure"` - - // The data for the metric. - // - // MetricData is a required field - MetricData []*MetricDatum `type:"list" required:"true"` - - // The namespace for the metric data. - // - // You cannot specify a namespace that begins with "AWS/". Namespaces that begin - // with "AWS/" are reserved for use by Amazon Web Services products. - // - // Namespace is a required field - Namespace *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutMetricDataInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutMetricDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutMetricDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutMetricDataInput"} - if s.MetricData == nil { - invalidParams.Add(request.NewErrParamRequired("MetricData")) - } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) - } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) - } - if s.MetricData != nil { - for i, v := range s.MetricData { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricData", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetricData sets the MetricData field's value. -func (s *PutMetricDataInput) SetMetricData(v []*MetricDatum) *PutMetricDataInput { - s.MetricData = v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *PutMetricDataInput) SetNamespace(v string) *PutMetricDataInput { - s.Namespace = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricDataOutput -type PutMetricDataOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutMetricDataOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutMetricDataOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmStateInput -type SetAlarmStateInput struct { - _ struct{} `type:"structure"` - - // The name for the alarm. This name must be unique within the AWS account. - // The maximum length is 255 characters. - // - // AlarmName is a required field - AlarmName *string `min:"1" type:"string" required:"true"` - - // The reason that this alarm is set to this specific state, in text format. - // - // StateReason is a required field - StateReason *string `type:"string" required:"true"` - - // The reason that this alarm is set to this specific state, in JSON format. - StateReasonData *string `type:"string"` - - // The value of the state. - // - // StateValue is a required field - StateValue *string `type:"string" required:"true" enum:"StateValue"` -} - -// String returns the string representation -func (s SetAlarmStateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetAlarmStateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetAlarmStateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetAlarmStateInput"} - if s.AlarmName == nil { - invalidParams.Add(request.NewErrParamRequired("AlarmName")) - } - if s.AlarmName != nil && len(*s.AlarmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1)) - } - if s.StateReason == nil { - invalidParams.Add(request.NewErrParamRequired("StateReason")) - } - if s.StateValue == nil { - invalidParams.Add(request.NewErrParamRequired("StateValue")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmName sets the AlarmName field's value. -func (s *SetAlarmStateInput) SetAlarmName(v string) *SetAlarmStateInput { - s.AlarmName = &v - return s -} - -// SetStateReason sets the StateReason field's value. -func (s *SetAlarmStateInput) SetStateReason(v string) *SetAlarmStateInput { - s.StateReason = &v - return s -} - -// SetStateReasonData sets the StateReasonData field's value. -func (s *SetAlarmStateInput) SetStateReasonData(v string) *SetAlarmStateInput { - s.StateReasonData = &v - return s -} - -// SetStateValue sets the StateValue field's value. -func (s *SetAlarmStateInput) SetStateValue(v string) *SetAlarmStateInput { - s.StateValue = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmStateOutput -type SetAlarmStateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetAlarmStateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetAlarmStateOutput) GoString() string { - return s.String() -} - -// Represents a set of statistics that describes a specific metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/StatisticSet -type StatisticSet struct { - _ struct{} `type:"structure"` - - // The maximum value of the sample set. - // - // Maximum is a required field - Maximum *float64 `type:"double" required:"true"` - - // The minimum value of the sample set. - // - // Minimum is a required field - Minimum *float64 `type:"double" required:"true"` - - // The number of samples used for the statistic set. - // - // SampleCount is a required field - SampleCount *float64 `type:"double" required:"true"` - - // The sum of values for the sample set. - // - // Sum is a required field - Sum *float64 `type:"double" required:"true"` -} - -// String returns the string representation -func (s StatisticSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StatisticSet) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StatisticSet) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StatisticSet"} - if s.Maximum == nil { - invalidParams.Add(request.NewErrParamRequired("Maximum")) - } - if s.Minimum == nil { - invalidParams.Add(request.NewErrParamRequired("Minimum")) - } - if s.SampleCount == nil { - invalidParams.Add(request.NewErrParamRequired("SampleCount")) - } - if s.Sum == nil { - invalidParams.Add(request.NewErrParamRequired("Sum")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaximum sets the Maximum field's value. -func (s *StatisticSet) SetMaximum(v float64) *StatisticSet { - s.Maximum = &v - return s -} - -// SetMinimum sets the Minimum field's value. -func (s *StatisticSet) SetMinimum(v float64) *StatisticSet { - s.Minimum = &v - return s -} - -// SetSampleCount sets the SampleCount field's value. -func (s *StatisticSet) SetSampleCount(v float64) *StatisticSet { - s.SampleCount = &v - return s -} - -// SetSum sets the Sum field's value. -func (s *StatisticSet) SetSum(v float64) *StatisticSet { - s.Sum = &v - return s -} - -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 ( - // HistoryItemTypeConfigurationUpdate is a HistoryItemType enum value - HistoryItemTypeConfigurationUpdate = "ConfigurationUpdate" - - // HistoryItemTypeStateUpdate is a HistoryItemType enum value - HistoryItemTypeStateUpdate = "StateUpdate" - - // HistoryItemTypeAction is a HistoryItemType enum value - HistoryItemTypeAction = "Action" -) - -const ( - // StandardUnitSeconds is a StandardUnit enum value - StandardUnitSeconds = "Seconds" - - // StandardUnitMicroseconds is a StandardUnit enum value - StandardUnitMicroseconds = "Microseconds" - - // StandardUnitMilliseconds is a StandardUnit enum value - StandardUnitMilliseconds = "Milliseconds" - - // StandardUnitBytes is a StandardUnit enum value - StandardUnitBytes = "Bytes" - - // StandardUnitKilobytes is a StandardUnit enum value - StandardUnitKilobytes = "Kilobytes" - - // StandardUnitMegabytes is a StandardUnit enum value - StandardUnitMegabytes = "Megabytes" - - // StandardUnitGigabytes is a StandardUnit enum value - StandardUnitGigabytes = "Gigabytes" - - // StandardUnitTerabytes is a StandardUnit enum value - StandardUnitTerabytes = "Terabytes" - - // StandardUnitBits is a StandardUnit enum value - StandardUnitBits = "Bits" - - // StandardUnitKilobits is a StandardUnit enum value - StandardUnitKilobits = "Kilobits" - - // StandardUnitMegabits is a StandardUnit enum value - StandardUnitMegabits = "Megabits" - - // StandardUnitGigabits is a StandardUnit enum value - StandardUnitGigabits = "Gigabits" - - // StandardUnitTerabits is a StandardUnit enum value - StandardUnitTerabits = "Terabits" - - // StandardUnitPercent is a StandardUnit enum value - StandardUnitPercent = "Percent" - - // StandardUnitCount is a StandardUnit enum value - StandardUnitCount = "Count" - - // StandardUnitBytesSecond is a StandardUnit enum value - StandardUnitBytesSecond = "Bytes/Second" - - // StandardUnitKilobytesSecond is a StandardUnit enum value - StandardUnitKilobytesSecond = "Kilobytes/Second" - - // StandardUnitMegabytesSecond is a StandardUnit enum value - StandardUnitMegabytesSecond = "Megabytes/Second" - - // StandardUnitGigabytesSecond is a StandardUnit enum value - StandardUnitGigabytesSecond = "Gigabytes/Second" - - // StandardUnitTerabytesSecond is a StandardUnit enum value - StandardUnitTerabytesSecond = "Terabytes/Second" - - // StandardUnitBitsSecond is a StandardUnit enum value - StandardUnitBitsSecond = "Bits/Second" - - // StandardUnitKilobitsSecond is a StandardUnit enum value - StandardUnitKilobitsSecond = "Kilobits/Second" - - // StandardUnitMegabitsSecond is a StandardUnit enum value - StandardUnitMegabitsSecond = "Megabits/Second" - - // StandardUnitGigabitsSecond is a StandardUnit enum value - StandardUnitGigabitsSecond = "Gigabits/Second" - - // StandardUnitTerabitsSecond is a StandardUnit enum value - StandardUnitTerabitsSecond = "Terabits/Second" - - // StandardUnitCountSecond is a StandardUnit enum value - StandardUnitCountSecond = "Count/Second" - - // StandardUnitNone is a StandardUnit enum value - StandardUnitNone = "None" -) - -const ( - // StateValueOk is a StateValue enum value - StateValueOk = "OK" - - // StateValueAlarm is a StateValue enum value - StateValueAlarm = "ALARM" - - // StateValueInsufficientData is a StateValue enum value - StateValueInsufficientData = "INSUFFICIENT_DATA" -) - -const ( - // StatisticSampleCount is a Statistic enum value - StatisticSampleCount = "SampleCount" - - // StatisticAverage is a Statistic enum value - StatisticAverage = "Average" - - // StatisticSum is a Statistic enum value - StatisticSum = "Sum" - - // StatisticMinimum is a Statistic enum value - StatisticMinimum = "Minimum" - - // StatisticMaximum is a Statistic enum value - StatisticMaximum = "Maximum" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go deleted file mode 100644 index 60bced5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go +++ /dev/null @@ -1,54 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudwatch - -const ( - - // ErrCodeInternalServiceFault for service response error code - // "InternalServiceError". - // - // Request processing has failed due to some unknown error, exception, or failure. - ErrCodeInternalServiceFault = "InternalServiceError" - - // ErrCodeInvalidFormatFault for service response error code - // "InvalidFormat". - // - // Data was not syntactically valid JSON. - ErrCodeInvalidFormatFault = "InvalidFormat" - - // ErrCodeInvalidNextToken for service response error code - // "InvalidNextToken". - // - // The next token specified is invalid. - ErrCodeInvalidNextToken = "InvalidNextToken" - - // ErrCodeInvalidParameterCombinationException for service response error code - // "InvalidParameterCombination". - // - // Parameters that cannot be used together were used together. - ErrCodeInvalidParameterCombinationException = "InvalidParameterCombination" - - // ErrCodeInvalidParameterValueException for service response error code - // "InvalidParameterValue". - // - // The value of an input parameter is bad or out-of-range. - ErrCodeInvalidParameterValueException = "InvalidParameterValue" - - // ErrCodeLimitExceededFault for service response error code - // "LimitExceeded". - // - // The quota for alarms for this customer has already been reached. - ErrCodeLimitExceededFault = "LimitExceeded" - - // ErrCodeMissingRequiredParameterException for service response error code - // "MissingParameter". - // - // An input parameter that is required is missing. - ErrCodeMissingRequiredParameterException = "MissingParameter" - - // ErrCodeResourceNotFound for service response error code - // "ResourceNotFound". - // - // The named resource does not exist. - ErrCodeResourceNotFound = "ResourceNotFound" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go deleted file mode 100644 index 4a992be..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go +++ /dev/null @@ -1,105 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudwatch - -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" -) - -// Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the -// applications you run on AWS in real-time. You can use CloudWatch to collect -// and track metrics, which are the variables you want to measure for your resources -// and applications. -// -// CloudWatch alarms send notifications or automatically make changes to the -// resources you are monitoring based on rules that you define. For example, -// you can monitor the CPU usage and disk reads and writes of your Amazon Elastic -// Compute Cloud (Amazon EC2) instances and then use this data to determine -// whether you should launch additional instances to handle increased load. -// You can also use this data to stop under-used instances to save money. -// -// In addition to monitoring the built-in metrics that come with AWS, you can -// monitor your own custom metrics. With CloudWatch, you gain system-wide visibility -// into resource utilization, application performance, and operational health. -// 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/monitoring-2010-08-01 -type CloudWatch 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 = "monitoring" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CloudWatch 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 CloudWatch client from just a session. -// svc := cloudwatch.New(mySession) -// -// // Create a CloudWatch client with additional configuration -// svc := cloudwatch.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatch { - 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) *CloudWatch { - svc := &CloudWatch{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2010-08-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a CloudWatch operation and runs any -// custom request initialization. -func (c *CloudWatch) 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/cloudwatch/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go deleted file mode 100644 index 1184650..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go +++ /dev/null @@ -1,34 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudwatch - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilAlarmExists uses the CloudWatch API operation -// DescribeAlarms 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 *CloudWatch) WaitUntilAlarmExists(input *DescribeAlarmsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeAlarms", - Delay: 5, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(MetricAlarms[]) > `0`", - Expected: true, - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go deleted file mode 100644 index d626b35..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go +++ /dev/null @@ -1,2702 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudwatchevents provides a client for Amazon CloudWatch Events. -package cloudwatchevents - -import ( - "fmt" - "time" - - "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 opDeleteRule = "DeleteRule" - -// DeleteRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRuleRequest method. -// req, resp := client.DeleteRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule -func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, output *DeleteRuleOutput) { - op := &request.Operation{ - Name: opDeleteRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRuleInput{} - } - - output = &DeleteRuleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRule API operation for Amazon CloudWatch Events. -// -// Deletes the specified rule. -// -// You must remove all targets from a rule using RemoveTargets before you can -// delete the rule. -// -// When you delete a rule, incoming events might continue to match to the deleted -// rule. Please allow a short period of time for changes to take effect. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation DeleteRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a rule or target. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule -func (c *CloudWatchEvents) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { - req, out := c.DeleteRuleRequest(input) - err := req.Send() - return out, err -} - -const opDescribeRule = "DescribeRule" - -// DescribeRuleRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRuleRequest method. -// req, resp := client.DescribeRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule -func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) (req *request.Request, output *DescribeRuleOutput) { - op := &request.Operation{ - Name: opDescribeRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRuleInput{} - } - - output = &DescribeRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRule API operation for Amazon CloudWatch Events. -// -// Describes the specified rule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation DescribeRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The rule does not exist. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule -func (c *CloudWatchEvents) DescribeRule(input *DescribeRuleInput) (*DescribeRuleOutput, error) { - req, out := c.DescribeRuleRequest(input) - err := req.Send() - return out, err -} - -const opDisableRule = "DisableRule" - -// DisableRuleRequest generates a "aws/request.Request" representing the -// client's request for the DisableRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableRuleRequest method. -// req, resp := client.DisableRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule -func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *request.Request, output *DisableRuleOutput) { - op := &request.Operation{ - Name: opDisableRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableRuleInput{} - } - - output = &DisableRuleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableRule API operation for Amazon CloudWatch Events. -// -// Disables the specified rule. A disabled rule won't match any events, and -// won't self-trigger if it has a schedule expression. -// -// When you disable a rule, incoming events might continue to match to the disabled -// rule. Please allow a short period of time for changes to take effect. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation DisableRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The rule does not exist. -// -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a rule or target. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule -func (c *CloudWatchEvents) DisableRule(input *DisableRuleInput) (*DisableRuleOutput, error) { - req, out := c.DisableRuleRequest(input) - err := req.Send() - return out, err -} - -const opEnableRule = "EnableRule" - -// EnableRuleRequest generates a "aws/request.Request" representing the -// client's request for the EnableRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableRuleRequest method. -// req, resp := client.EnableRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule -func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *request.Request, output *EnableRuleOutput) { - op := &request.Operation{ - Name: opEnableRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableRuleInput{} - } - - output = &EnableRuleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableRule API operation for Amazon CloudWatch Events. -// -// Enables the specified rule. If the rule does not exist, the operation fails. -// -// When you enable a rule, incoming events might not immediately start matching -// to a newly enabled rule. Please allow a short period of time for changes -// to take effect. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation EnableRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The rule does not exist. -// -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a rule or target. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule -func (c *CloudWatchEvents) EnableRule(input *EnableRuleInput) (*EnableRuleOutput, error) { - req, out := c.EnableRuleRequest(input) - err := req.Send() - return out, err -} - -const opListRuleNamesByTarget = "ListRuleNamesByTarget" - -// ListRuleNamesByTargetRequest generates a "aws/request.Request" representing the -// client's request for the ListRuleNamesByTarget operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListRuleNamesByTarget for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListRuleNamesByTarget method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListRuleNamesByTargetRequest method. -// req, resp := client.ListRuleNamesByTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget -func (c *CloudWatchEvents) ListRuleNamesByTargetRequest(input *ListRuleNamesByTargetInput) (req *request.Request, output *ListRuleNamesByTargetOutput) { - op := &request.Operation{ - Name: opListRuleNamesByTarget, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListRuleNamesByTargetInput{} - } - - output = &ListRuleNamesByTargetOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRuleNamesByTarget API operation for Amazon CloudWatch Events. -// -// Lists the rules for the specified target. You can see which of the rules -// in Amazon CloudWatch Events can invoke a specific target 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 CloudWatch Events's -// API operation ListRuleNamesByTarget for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget -func (c *CloudWatchEvents) ListRuleNamesByTarget(input *ListRuleNamesByTargetInput) (*ListRuleNamesByTargetOutput, error) { - req, out := c.ListRuleNamesByTargetRequest(input) - err := req.Send() - return out, err -} - -const opListRules = "ListRules" - -// ListRulesRequest generates a "aws/request.Request" representing the -// client's request for the ListRules operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListRules for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListRules method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListRulesRequest method. -// req, resp := client.ListRulesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules -func (c *CloudWatchEvents) ListRulesRequest(input *ListRulesInput) (req *request.Request, output *ListRulesOutput) { - op := &request.Operation{ - Name: opListRules, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListRulesInput{} - } - - output = &ListRulesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRules API operation for Amazon CloudWatch Events. -// -// Lists your Amazon CloudWatch Events rules. You can either list all the rules -// or you can provide a prefix to match to the rule 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 CloudWatch Events's -// API operation ListRules for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules -func (c *CloudWatchEvents) ListRules(input *ListRulesInput) (*ListRulesOutput, error) { - req, out := c.ListRulesRequest(input) - err := req.Send() - return out, err -} - -const opListTargetsByRule = "ListTargetsByRule" - -// ListTargetsByRuleRequest generates a "aws/request.Request" representing the -// client's request for the ListTargetsByRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTargetsByRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTargetsByRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTargetsByRuleRequest method. -// req, resp := client.ListTargetsByRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule -func (c *CloudWatchEvents) ListTargetsByRuleRequest(input *ListTargetsByRuleInput) (req *request.Request, output *ListTargetsByRuleOutput) { - op := &request.Operation{ - Name: opListTargetsByRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTargetsByRuleInput{} - } - - output = &ListTargetsByRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTargetsByRule API operation for Amazon CloudWatch Events. -// -// Lists the targets assigned to the specified rule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation ListTargetsByRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The rule does not exist. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule -func (c *CloudWatchEvents) ListTargetsByRule(input *ListTargetsByRuleInput) (*ListTargetsByRuleOutput, error) { - req, out := c.ListTargetsByRuleRequest(input) - err := req.Send() - return out, err -} - -const opPutEvents = "PutEvents" - -// PutEventsRequest generates a "aws/request.Request" representing the -// client's request for the PutEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutEventsRequest method. -// req, resp := client.PutEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents -func (c *CloudWatchEvents) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput) { - op := &request.Operation{ - Name: opPutEvents, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutEventsInput{} - } - - output = &PutEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutEvents API operation for Amazon CloudWatch Events. -// -// Sends custom events to Amazon CloudWatch Events so that they can be matched -// to rules. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation PutEvents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents -func (c *CloudWatchEvents) PutEvents(input *PutEventsInput) (*PutEventsOutput, error) { - req, out := c.PutEventsRequest(input) - err := req.Send() - return out, err -} - -const opPutRule = "PutRule" - -// PutRuleRequest generates a "aws/request.Request" representing the -// client's request for the PutRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutRuleRequest method. -// req, resp := client.PutRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule -func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Request, output *PutRuleOutput) { - op := &request.Operation{ - Name: opPutRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutRuleInput{} - } - - output = &PutRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutRule API operation for Amazon CloudWatch Events. -// -// Creates or updates the specified rule. Rules are enabled by default, or based -// on value of the state. You can disable a rule using DisableRule. -// -// When you create or update a rule, incoming events might not immediately start -// matching to new or updated rules. Please allow a short period of time for -// changes to take effect. -// -// A rule must contain at least an EventPattern or ScheduleExpression. Rules -// with EventPatterns are triggered when a matching event is observed. Rules -// with ScheduleExpressions self-trigger based on the given schedule. A rule -// can have both an EventPattern and a ScheduleExpression, in which case the -// rule triggers on matching events as well as on a schedule. -// -// Most services in AWS treat : or / as the same character in Amazon Resource -// Names (ARNs). However, CloudWatch Events uses an exact match in event patterns -// and rules. Be sure to use the correct ARN characters when creating event -// patterns so that they match the ARN syntax in the event you want to match. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation PutRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidEventPatternException "InvalidEventPatternException" -// The event pattern is not valid. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// You tried to create more rules or add more targets to a rule than is allowed. -// -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a rule or target. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule -func (c *CloudWatchEvents) PutRule(input *PutRuleInput) (*PutRuleOutput, error) { - req, out := c.PutRuleRequest(input) - err := req.Send() - return out, err -} - -const opPutTargets = "PutTargets" - -// PutTargetsRequest generates a "aws/request.Request" representing the -// client's request for the PutTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutTargetsRequest method. -// req, resp := client.PutTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets -func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *request.Request, output *PutTargetsOutput) { - op := &request.Operation{ - Name: opPutTargets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutTargetsInput{} - } - - output = &PutTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutTargets API operation for Amazon CloudWatch Events. -// -// Adds the specified targets to the specified rule, or updates the targets -// if they are already associated with the rule. -// -// Targets are the resources that are invoked when a rule is triggered. Example -// targets include EC2 instances, AWS Lambda functions, Amazon Kinesis streams, -// Amazon ECS tasks, AWS Step Functions state machines, and built-in targets. -// Note that creating rules with built-in targets is supported only in the AWS -// Management Console. -// -// For some target types, PutTargets provides target-specific parameters. If -// the target is an Amazon Kinesis stream, you can optionally specify which -// shard the event goes to by using the KinesisParameters argument. To invoke -// a command on multiple EC2 instances with one rule, you can use the RunCommandParameters -// field. -// -// To be able to make API calls against the resources that you own, Amazon CloudWatch -// Events needs the appropriate permissions. For AWS Lambda and Amazon SNS resources, -// CloudWatch Events relies on resource-based policies. For EC2 instances, Amazon -// Kinesis streams, and AWS Step Functions state machines, CloudWatch Events -// relies on IAM roles that you specify in the RoleARN argument in PutTarget. -// For more information, see Authentication and Access Control (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/auth-and-access-control-cwe.html) -// in the Amazon CloudWatch Events User Guide. -// -// Input, InputPath and InputTransformer are mutually exclusive and optional -// parameters of a target. When a rule is triggered due to a matched event: -// -// * If none of the following arguments are specified for a target, then -// the entire event is passed to the target in JSON form (unless the target -// is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from -// the event is passed to the target). -// -// * If Input is specified in the form of valid JSON, then the matched event -// is overridden with this constant. -// -// * If InputPath is specified in the form of JSONPath (for example, $.detail), -// then only the part of the event specified in the path is passed to the -// target (for example, only the detail part of the event is passed). -// -// * If InputTransformer is specified, then one or more specified JSONPaths -// are extracted from the event and used as values in a template that you -// specify as the input to the target. -// -// When you add targets to a rule and the associated rule triggers soon after, -// new or updated targets might not be immediately invoked. Please allow a short -// period of time for changes to take effect. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation PutTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The rule does not exist. -// -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a rule or target. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// You tried to create more rules or add more targets to a rule than is allowed. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets -func (c *CloudWatchEvents) PutTargets(input *PutTargetsInput) (*PutTargetsOutput, error) { - req, out := c.PutTargetsRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTargets = "RemoveTargets" - -// RemoveTargetsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTargetsRequest method. -// req, resp := client.RemoveTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets -func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) (req *request.Request, output *RemoveTargetsOutput) { - op := &request.Operation{ - Name: opRemoveTargets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTargetsInput{} - } - - output = &RemoveTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTargets API operation for Amazon CloudWatch Events. -// -// Removes the specified targets from the specified rule. When the rule is triggered, -// those targets are no longer be invoked. -// -// When you remove a target, when the associated rule triggers, removed targets -// might continue to be invoked. Please allow a short period of time for changes -// to take effect. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation RemoveTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The rule does not exist. -// -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a rule or target. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets -func (c *CloudWatchEvents) RemoveTargets(input *RemoveTargetsInput) (*RemoveTargetsOutput, error) { - req, out := c.RemoveTargetsRequest(input) - err := req.Send() - return out, err -} - -const opTestEventPattern = "TestEventPattern" - -// TestEventPatternRequest generates a "aws/request.Request" representing the -// client's request for the TestEventPattern operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TestEventPattern for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TestEventPattern method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TestEventPatternRequest method. -// req, resp := client.TestEventPatternRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern -func (c *CloudWatchEvents) TestEventPatternRequest(input *TestEventPatternInput) (req *request.Request, output *TestEventPatternOutput) { - op := &request.Operation{ - Name: opTestEventPattern, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TestEventPatternInput{} - } - - output = &TestEventPatternOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestEventPattern API operation for Amazon CloudWatch Events. -// -// Tests whether the specified event pattern matches the provided event. -// -// Most services in AWS treat : or / as the same character in Amazon Resource -// Names (ARNs). However, CloudWatch Events uses an exact match in event patterns -// and rules. Be sure to use the correct ARN characters when creating event -// patterns so that they match the ARN syntax in the event you want to match. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Events's -// API operation TestEventPattern for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidEventPatternException "InvalidEventPatternException" -// The event pattern is not valid. -// -// * ErrCodeInternalException "InternalException" -// This exception occurs due to unexpected causes. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern -func (c *CloudWatchEvents) TestEventPattern(input *TestEventPatternInput) (*TestEventPatternOutput, error) { - req, out := c.TestEventPatternRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRuleRequest -type DeleteRuleInput struct { - _ struct{} `type:"structure"` - - // The name of the rule. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRuleInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteRuleInput) SetName(v string) *DeleteRuleInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRuleOutput -type DeleteRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRuleOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRuleRequest -type DescribeRuleInput struct { - _ struct{} `type:"structure"` - - // The name of the rule. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRuleInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DescribeRuleInput) SetName(v string) *DescribeRuleInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRuleResponse -type DescribeRuleOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rule. - Arn *string `min:"1" type:"string"` - - // The description of the rule. - Description *string `type:"string"` - - // The event pattern. - EventPattern *string `type:"string"` - - // The name of the rule. - Name *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role associated with the rule. - RoleArn *string `min:"1" type:"string"` - - // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". - ScheduleExpression *string `type:"string"` - - // Specifies whether the rule is enabled or disabled. - State *string `type:"string" enum:"RuleState"` -} - -// String returns the string representation -func (s DescribeRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRuleOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DescribeRuleOutput) SetArn(v string) *DescribeRuleOutput { - s.Arn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribeRuleOutput) SetDescription(v string) *DescribeRuleOutput { - s.Description = &v - return s -} - -// SetEventPattern sets the EventPattern field's value. -func (s *DescribeRuleOutput) SetEventPattern(v string) *DescribeRuleOutput { - s.EventPattern = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeRuleOutput) SetName(v string) *DescribeRuleOutput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeRuleOutput) SetRoleArn(v string) *DescribeRuleOutput { - s.RoleArn = &v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *DescribeRuleOutput) SetScheduleExpression(v string) *DescribeRuleOutput { - s.ScheduleExpression = &v - return s -} - -// SetState sets the State field's value. -func (s *DescribeRuleOutput) SetState(v string) *DescribeRuleOutput { - s.State = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRuleRequest -type DisableRuleInput struct { - _ struct{} `type:"structure"` - - // The name of the rule. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableRuleInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DisableRuleInput) SetName(v string) *DisableRuleInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRuleOutput -type DisableRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableRuleOutput) GoString() string { - return s.String() -} - -// The custom parameters to be used when the target is an Amazon ECS cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EcsParameters -type EcsParameters struct { - _ struct{} `type:"structure"` - - // The number of tasks to create based on the TaskDefinition. The default is - // one. - TaskCount *int64 `min:"1" type:"integer"` - - // The ARN of the task definition to use if the event target is an Amazon ECS - // cluster. - // - // TaskDefinitionArn is a required field - TaskDefinitionArn *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s EcsParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EcsParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EcsParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EcsParameters"} - if s.TaskCount != nil && *s.TaskCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("TaskCount", 1)) - } - if s.TaskDefinitionArn == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinitionArn")) - } - if s.TaskDefinitionArn != nil && len(*s.TaskDefinitionArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskDefinitionArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTaskCount sets the TaskCount field's value. -func (s *EcsParameters) SetTaskCount(v int64) *EcsParameters { - s.TaskCount = &v - return s -} - -// SetTaskDefinitionArn sets the TaskDefinitionArn field's value. -func (s *EcsParameters) SetTaskDefinitionArn(v string) *EcsParameters { - s.TaskDefinitionArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRuleRequest -type EnableRuleInput struct { - _ struct{} `type:"structure"` - - // The name of the rule. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableRuleInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *EnableRuleInput) SetName(v string) *EnableRuleInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRuleOutput -type EnableRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableRuleOutput) GoString() string { - return s.String() -} - -// Contains the parameters needed for you to provide custom input to a target -// based on one or more pieces of data extracted from the event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/InputTransformer -type InputTransformer struct { - _ struct{} `type:"structure"` - - // Map of JSON paths to be extracted from the event. These are key-value pairs, - // where each value is a JSON path. - InputPathsMap map[string]*string `type:"map"` - - // Input template where you can use the values of the keys from InputPathsMap - // to customize the data sent to the target. - // - // InputTemplate is a required field - InputTemplate *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s InputTransformer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InputTransformer) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputTransformer) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputTransformer"} - if s.InputTemplate == nil { - invalidParams.Add(request.NewErrParamRequired("InputTemplate")) - } - if s.InputTemplate != nil && len(*s.InputTemplate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputTemplate", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInputPathsMap sets the InputPathsMap field's value. -func (s *InputTransformer) SetInputPathsMap(v map[string]*string) *InputTransformer { - s.InputPathsMap = v - return s -} - -// SetInputTemplate sets the InputTemplate field's value. -func (s *InputTransformer) SetInputTemplate(v string) *InputTransformer { - s.InputTemplate = &v - return s -} - -// This object enables you to specify a JSON path to extract from the event -// and use as the partition key for the Amazon Kinesis stream, so that you can -// control the shard to which the event goes. If you do not include this parameter, -// the default is to use the eventId as the partition key. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/KinesisParameters -type KinesisParameters struct { - _ struct{} `type:"structure"` - - // The JSON path to be extracted from the event and used as the partition key. - // For more information, see Amazon Kinesis Streams Key Concepts (http://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) - // in the Amazon Kinesis Streams Developer Guide. - // - // PartitionKeyPath is a required field - PartitionKeyPath *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s KinesisParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KinesisParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KinesisParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KinesisParameters"} - if s.PartitionKeyPath == nil { - invalidParams.Add(request.NewErrParamRequired("PartitionKeyPath")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPartitionKeyPath sets the PartitionKeyPath field's value. -func (s *KinesisParameters) SetPartitionKeyPath(v string) *KinesisParameters { - s.PartitionKeyPath = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTargetRequest -type ListRuleNamesByTargetInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results to return. - Limit *int64 `min:"1" type:"integer"` - - // The token returned by a previous call to retrieve the next set of results. - NextToken *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the target resource. - // - // TargetArn is a required field - TargetArn *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListRuleNamesByTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRuleNamesByTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRuleNamesByTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRuleNamesByTargetInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.TargetArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetArn")) - } - if s.TargetArn != nil && len(*s.TargetArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListRuleNamesByTargetInput) SetLimit(v int64) *ListRuleNamesByTargetInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRuleNamesByTargetInput) SetNextToken(v string) *ListRuleNamesByTargetInput { - s.NextToken = &v - return s -} - -// SetTargetArn sets the TargetArn field's value. -func (s *ListRuleNamesByTargetInput) SetTargetArn(v string) *ListRuleNamesByTargetInput { - s.TargetArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTargetResponse -type ListRuleNamesByTargetOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether there are additional results to retrieve. If there are - // no more results, the value is null. - NextToken *string `min:"1" type:"string"` - - // The names of the rules that can invoke the given target. - RuleNames []*string `type:"list"` -} - -// String returns the string representation -func (s ListRuleNamesByTargetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRuleNamesByTargetOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRuleNamesByTargetOutput) SetNextToken(v string) *ListRuleNamesByTargetOutput { - s.NextToken = &v - return s -} - -// SetRuleNames sets the RuleNames field's value. -func (s *ListRuleNamesByTargetOutput) SetRuleNames(v []*string) *ListRuleNamesByTargetOutput { - s.RuleNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRulesRequest -type ListRulesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results to return. - Limit *int64 `min:"1" type:"integer"` - - // The prefix matching the rule name. - NamePrefix *string `min:"1" type:"string"` - - // The token returned by a previous call to retrieve the next set of results. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListRulesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRulesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRulesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRulesInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListRulesInput) SetLimit(v int64) *ListRulesInput { - s.Limit = &v - return s -} - -// SetNamePrefix sets the NamePrefix field's value. -func (s *ListRulesInput) SetNamePrefix(v string) *ListRulesInput { - s.NamePrefix = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRulesInput) SetNextToken(v string) *ListRulesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRulesResponse -type ListRulesOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether there are additional results to retrieve. If there are - // no more results, the value is null. - NextToken *string `min:"1" type:"string"` - - // The rules that match the specified criteria. - Rules []*Rule `type:"list"` -} - -// String returns the string representation -func (s ListRulesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRulesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRulesOutput) SetNextToken(v string) *ListRulesOutput { - s.NextToken = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *ListRulesOutput) SetRules(v []*Rule) *ListRulesOutput { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRuleRequest -type ListTargetsByRuleInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results to return. - Limit *int64 `min:"1" type:"integer"` - - // The token returned by a previous call to retrieve the next set of results. - NextToken *string `min:"1" type:"string"` - - // The name of the rule. - // - // Rule is a required field - Rule *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTargetsByRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTargetsByRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTargetsByRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTargetsByRuleInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Rule == nil { - invalidParams.Add(request.NewErrParamRequired("Rule")) - } - if s.Rule != nil && len(*s.Rule) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Rule", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListTargetsByRuleInput) SetLimit(v int64) *ListTargetsByRuleInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTargetsByRuleInput) SetNextToken(v string) *ListTargetsByRuleInput { - s.NextToken = &v - return s -} - -// SetRule sets the Rule field's value. -func (s *ListTargetsByRuleInput) SetRule(v string) *ListTargetsByRuleInput { - s.Rule = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRuleResponse -type ListTargetsByRuleOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether there are additional results to retrieve. If there are - // no more results, the value is null. - NextToken *string `min:"1" type:"string"` - - // The targets assigned to the rule. - Targets []*Target `min:"1" type:"list"` -} - -// String returns the string representation -func (s ListTargetsByRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTargetsByRuleOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTargetsByRuleOutput) SetNextToken(v string) *ListTargetsByRuleOutput { - s.NextToken = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *ListTargetsByRuleOutput) SetTargets(v []*Target) *ListTargetsByRuleOutput { - s.Targets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEventsRequest -type PutEventsInput struct { - _ struct{} `type:"structure"` - - // The entry that defines an event in your system. You can specify several parameters - // for the entry such as the source and type of the event, resources associated - // with the event, and so on. - // - // Entries is a required field - Entries []*PutEventsRequestEntry `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PutEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutEventsInput"} - if s.Entries == nil { - invalidParams.Add(request.NewErrParamRequired("Entries")) - } - if s.Entries != nil && len(s.Entries) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Entries", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntries sets the Entries field's value. -func (s *PutEventsInput) SetEntries(v []*PutEventsRequestEntry) *PutEventsInput { - s.Entries = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEventsResponse -type PutEventsOutput struct { - _ struct{} `type:"structure"` - - // The successfully and unsuccessfully ingested events results. If the ingestion - // was successful, the entry has the event ID in it. Otherwise, you can use - // the error code and error message to identify the problem with the entry. - Entries []*PutEventsResultEntry `type:"list"` - - // The number of failed entries. - FailedEntryCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s PutEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEventsOutput) GoString() string { - return s.String() -} - -// SetEntries sets the Entries field's value. -func (s *PutEventsOutput) SetEntries(v []*PutEventsResultEntry) *PutEventsOutput { - s.Entries = v - return s -} - -// SetFailedEntryCount sets the FailedEntryCount field's value. -func (s *PutEventsOutput) SetFailedEntryCount(v int64) *PutEventsOutput { - s.FailedEntryCount = &v - return s -} - -// Represents an event to be submitted. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEventsRequestEntry -type PutEventsRequestEntry struct { - _ struct{} `type:"structure"` - - // In the JSON sense, an object containing fields, which may also contain nested - // subobjects. No constraints are imposed on its contents. - Detail *string `type:"string"` - - // Free-form string used to decide what fields to expect in the event detail. - DetailType *string `type:"string"` - - // AWS resources, identified by Amazon Resource Name (ARN), which the event - // primarily concerns. Any number, including zero, may be present. - Resources []*string `type:"list"` - - // The source of the event. - Source *string `type:"string"` - - // The timestamp of the event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt). - // If no timestamp is provided, the timestamp of the PutEvents call is used. - Time *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s PutEventsRequestEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEventsRequestEntry) GoString() string { - return s.String() -} - -// SetDetail sets the Detail field's value. -func (s *PutEventsRequestEntry) SetDetail(v string) *PutEventsRequestEntry { - s.Detail = &v - return s -} - -// SetDetailType sets the DetailType field's value. -func (s *PutEventsRequestEntry) SetDetailType(v string) *PutEventsRequestEntry { - s.DetailType = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *PutEventsRequestEntry) SetResources(v []*string) *PutEventsRequestEntry { - s.Resources = v - return s -} - -// SetSource sets the Source field's value. -func (s *PutEventsRequestEntry) SetSource(v string) *PutEventsRequestEntry { - s.Source = &v - return s -} - -// SetTime sets the Time field's value. -func (s *PutEventsRequestEntry) SetTime(v time.Time) *PutEventsRequestEntry { - s.Time = &v - return s -} - -// Represents an event that failed to be submitted. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEventsResultEntry -type PutEventsResultEntry struct { - _ struct{} `type:"structure"` - - // The error code that indicates why the event submission failed. - ErrorCode *string `type:"string"` - - // The error message that explains why the event submission failed. - ErrorMessage *string `type:"string"` - - // The ID of the event. - EventId *string `type:"string"` -} - -// String returns the string representation -func (s PutEventsResultEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEventsResultEntry) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *PutEventsResultEntry) SetErrorCode(v string) *PutEventsResultEntry { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *PutEventsResultEntry) SetErrorMessage(v string) *PutEventsResultEntry { - s.ErrorMessage = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *PutEventsResultEntry) SetEventId(v string) *PutEventsResultEntry { - s.EventId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRuleRequest -type PutRuleInput struct { - _ struct{} `type:"structure"` - - // A description of the rule. - Description *string `type:"string"` - - // The event pattern. - EventPattern *string `type:"string"` - - // The name of the rule that you are creating or updating. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role associated with the rule. - RoleArn *string `min:"1" type:"string"` - - // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". - ScheduleExpression *string `type:"string"` - - // Indicates whether the rule is enabled or disabled. - State *string `type:"string" enum:"RuleState"` -} - -// String returns the string representation -func (s PutRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRuleInput"} - 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.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *PutRuleInput) SetDescription(v string) *PutRuleInput { - s.Description = &v - return s -} - -// SetEventPattern sets the EventPattern field's value. -func (s *PutRuleInput) SetEventPattern(v string) *PutRuleInput { - s.EventPattern = &v - return s -} - -// SetName sets the Name field's value. -func (s *PutRuleInput) SetName(v string) *PutRuleInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *PutRuleInput) SetRoleArn(v string) *PutRuleInput { - s.RoleArn = &v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *PutRuleInput) SetScheduleExpression(v string) *PutRuleInput { - s.ScheduleExpression = &v - return s -} - -// SetState sets the State field's value. -func (s *PutRuleInput) SetState(v string) *PutRuleInput { - s.State = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRuleResponse -type PutRuleOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rule. - RuleArn *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PutRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRuleOutput) GoString() string { - return s.String() -} - -// SetRuleArn sets the RuleArn field's value. -func (s *PutRuleOutput) SetRuleArn(v string) *PutRuleOutput { - s.RuleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargetsRequest -type PutTargetsInput struct { - _ struct{} `type:"structure"` - - // The name of the rule. - // - // Rule is a required field - Rule *string `min:"1" type:"string" required:"true"` - - // The targets to update or add to the rule. - // - // Targets is a required field - Targets []*Target `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PutTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutTargetsInput"} - if s.Rule == nil { - invalidParams.Add(request.NewErrParamRequired("Rule")) - } - if s.Rule != nil && len(*s.Rule) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Rule", 1)) - } - if s.Targets == nil { - invalidParams.Add(request.NewErrParamRequired("Targets")) - } - if s.Targets != nil && len(s.Targets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Targets", 1)) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRule sets the Rule field's value. -func (s *PutTargetsInput) SetRule(v string) *PutTargetsInput { - s.Rule = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *PutTargetsInput) SetTargets(v []*Target) *PutTargetsInput { - s.Targets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargetsResponse -type PutTargetsOutput struct { - _ struct{} `type:"structure"` - - // The failed target entries. - FailedEntries []*PutTargetsResultEntry `type:"list"` - - // The number of failed entries. - FailedEntryCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s PutTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutTargetsOutput) GoString() string { - return s.String() -} - -// SetFailedEntries sets the FailedEntries field's value. -func (s *PutTargetsOutput) SetFailedEntries(v []*PutTargetsResultEntry) *PutTargetsOutput { - s.FailedEntries = v - return s -} - -// SetFailedEntryCount sets the FailedEntryCount field's value. -func (s *PutTargetsOutput) SetFailedEntryCount(v int64) *PutTargetsOutput { - s.FailedEntryCount = &v - return s -} - -// Represents a target that failed to be added to a rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargetsResultEntry -type PutTargetsResultEntry struct { - _ struct{} `type:"structure"` - - // The error code that indicates why the target addition failed. - ErrorCode *string `type:"string"` - - // The error message that explains why the target addition failed. - ErrorMessage *string `type:"string"` - - // The ID of the target. - TargetId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PutTargetsResultEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutTargetsResultEntry) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *PutTargetsResultEntry) SetErrorCode(v string) *PutTargetsResultEntry { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *PutTargetsResultEntry) SetErrorMessage(v string) *PutTargetsResultEntry { - s.ErrorMessage = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *PutTargetsResultEntry) SetTargetId(v string) *PutTargetsResultEntry { - s.TargetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargetsRequest -type RemoveTargetsInput struct { - _ struct{} `type:"structure"` - - // The IDs of the targets to remove from the rule. - // - // Ids is a required field - Ids []*string `min:"1" type:"list" required:"true"` - - // The name of the rule. - // - // Rule is a required field - Rule *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTargetsInput"} - if s.Ids == nil { - invalidParams.Add(request.NewErrParamRequired("Ids")) - } - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - if s.Rule == nil { - invalidParams.Add(request.NewErrParamRequired("Rule")) - } - if s.Rule != nil && len(*s.Rule) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Rule", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIds sets the Ids field's value. -func (s *RemoveTargetsInput) SetIds(v []*string) *RemoveTargetsInput { - s.Ids = v - return s -} - -// SetRule sets the Rule field's value. -func (s *RemoveTargetsInput) SetRule(v string) *RemoveTargetsInput { - s.Rule = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargetsResponse -type RemoveTargetsOutput struct { - _ struct{} `type:"structure"` - - // The failed target entries. - FailedEntries []*RemoveTargetsResultEntry `type:"list"` - - // The number of failed entries. - FailedEntryCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s RemoveTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTargetsOutput) GoString() string { - return s.String() -} - -// SetFailedEntries sets the FailedEntries field's value. -func (s *RemoveTargetsOutput) SetFailedEntries(v []*RemoveTargetsResultEntry) *RemoveTargetsOutput { - s.FailedEntries = v - return s -} - -// SetFailedEntryCount sets the FailedEntryCount field's value. -func (s *RemoveTargetsOutput) SetFailedEntryCount(v int64) *RemoveTargetsOutput { - s.FailedEntryCount = &v - return s -} - -// Represents a target that failed to be removed from a rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargetsResultEntry -type RemoveTargetsResultEntry struct { - _ struct{} `type:"structure"` - - // The error code that indicates why the target removal failed. - ErrorCode *string `type:"string"` - - // The error message that explains why the target removal failed. - ErrorMessage *string `type:"string"` - - // The ID of the target. - TargetId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s RemoveTargetsResultEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTargetsResultEntry) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *RemoveTargetsResultEntry) SetErrorCode(v string) *RemoveTargetsResultEntry { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *RemoveTargetsResultEntry) SetErrorMessage(v string) *RemoveTargetsResultEntry { - s.ErrorMessage = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *RemoveTargetsResultEntry) SetTargetId(v string) *RemoveTargetsResultEntry { - s.TargetId = &v - return s -} - -// Contains information about a rule in Amazon CloudWatch Events. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/Rule -type Rule struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rule. - Arn *string `min:"1" type:"string"` - - // The description of the rule. - Description *string `type:"string"` - - // The event pattern of the rule. - EventPattern *string `type:"string"` - - // The name of the rule. - Name *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the role that is used for target invocation. - RoleArn *string `min:"1" type:"string"` - - // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". - ScheduleExpression *string `type:"string"` - - // The state of the rule. - State *string `type:"string" enum:"RuleState"` -} - -// 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() -} - -// SetArn sets the Arn field's value. -func (s *Rule) SetArn(v string) *Rule { - s.Arn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Rule) SetDescription(v string) *Rule { - s.Description = &v - return s -} - -// SetEventPattern sets the EventPattern field's value. -func (s *Rule) SetEventPattern(v string) *Rule { - s.EventPattern = &v - return s -} - -// SetName sets the Name field's value. -func (s *Rule) SetName(v string) *Rule { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *Rule) SetRoleArn(v string) *Rule { - s.RoleArn = &v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *Rule) SetScheduleExpression(v string) *Rule { - s.ScheduleExpression = &v - return s -} - -// SetState sets the State field's value. -func (s *Rule) SetState(v string) *Rule { - s.State = &v - return s -} - -// This parameter contains the criteria (either InstanceIds or a tag) used to -// specify which EC2 instances are to be sent the command. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RunCommandParameters -type RunCommandParameters struct { - _ struct{} `type:"structure"` - - // Currently, we support including only one RunCommandTarget block, which specifies - // either an array of InstanceIds or a tag. - // - // RunCommandTargets is a required field - RunCommandTargets []*RunCommandTarget `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s RunCommandParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunCommandParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunCommandParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunCommandParameters"} - if s.RunCommandTargets == nil { - invalidParams.Add(request.NewErrParamRequired("RunCommandTargets")) - } - if s.RunCommandTargets != nil && len(s.RunCommandTargets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RunCommandTargets", 1)) - } - if s.RunCommandTargets != nil { - for i, v := range s.RunCommandTargets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RunCommandTargets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRunCommandTargets sets the RunCommandTargets field's value. -func (s *RunCommandParameters) SetRunCommandTargets(v []*RunCommandTarget) *RunCommandParameters { - s.RunCommandTargets = v - return s -} - -// Information about the EC2 instances that are to be sent the command, specified -// as key-value pairs. Each RunCommandTarget block can include only one key, -// but this key may specify multiple values. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RunCommandTarget -type RunCommandTarget struct { - _ struct{} `type:"structure"` - - // Can be either tag:tag-key or InstanceIds. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // If Key is tag:tag-key, Values is a list of tag values. If Key is InstanceIds, - // Values is a list of Amazon EC2 instance IDs. - // - // Values is a required field - Values []*string `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s RunCommandTarget) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunCommandTarget) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunCommandTarget) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunCommandTarget"} - 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.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *RunCommandTarget) SetKey(v string) *RunCommandTarget { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *RunCommandTarget) SetValues(v []*string) *RunCommandTarget { - s.Values = v - return s -} - -// Targets are the resources to be invoked when a rule is triggered. Target -// types include EC2 instances, AWS Lambda functions, Amazon Kinesis streams, -// Amazon ECS tasks, AWS Step Functions state machines, Run Command, and built-in -// targets. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/Target -type Target struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target. - // - // Arn is a required field - Arn *string `min:"1" type:"string" required:"true"` - - // Contains the Amazon ECS task definition and task count to be used, if the - // event target is an Amazon ECS task. For more information about Amazon ECS - // tasks, see Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) - // in the Amazon EC2 Container Service Developer Guide. - EcsParameters *EcsParameters `type:"structure"` - - // The ID of the target. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // Valid JSON text passed to the target. In this case, nothing from the event - // itself is passed to the target. For more information, see The JavaScript - // Object Notation (JSON) Data Interchange Format (http://www.rfc-editor.org/rfc/rfc7159.txt). - Input *string `type:"string"` - - // The value of the JSONPath that is used for extracting part of the matched - // event when passing it to the target. For more information about JSON paths, - // see JSONPath (http://goessner.net/articles/JsonPath/). - InputPath *string `type:"string"` - - // Settings to enable you to provide custom input to a target based on certain - // event data. You can extract one or more key-value pairs from the event and - // then use that data to send customized input to the target. - InputTransformer *InputTransformer `type:"structure"` - - // The custom parameter you can use to control shard assignment, when the target - // is an Amazon Kinesis stream. If you do not include this parameter, the default - // is to use the eventId as the partition key. - KinesisParameters *KinesisParameters `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM role to be used for this target - // when the rule is triggered. If one rule triggers multiple targets, you can - // use a different IAM role for each target. - RoleArn *string `min:"1" type:"string"` - - // Parameters used when you are using the rule to invoke Amazon EC2 Run Command. - RunCommandParameters *RunCommandParameters `type:"structure"` -} - -// String returns the string representation -func (s Target) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Target) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Target) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Target"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - 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.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - if s.EcsParameters != nil { - if err := s.EcsParameters.Validate(); err != nil { - invalidParams.AddNested("EcsParameters", err.(request.ErrInvalidParams)) - } - } - if s.InputTransformer != nil { - if err := s.InputTransformer.Validate(); err != nil { - invalidParams.AddNested("InputTransformer", err.(request.ErrInvalidParams)) - } - } - if s.KinesisParameters != nil { - if err := s.KinesisParameters.Validate(); err != nil { - invalidParams.AddNested("KinesisParameters", err.(request.ErrInvalidParams)) - } - } - if s.RunCommandParameters != nil { - if err := s.RunCommandParameters.Validate(); err != nil { - invalidParams.AddNested("RunCommandParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *Target) SetArn(v string) *Target { - s.Arn = &v - return s -} - -// SetEcsParameters sets the EcsParameters field's value. -func (s *Target) SetEcsParameters(v *EcsParameters) *Target { - s.EcsParameters = v - return s -} - -// SetId sets the Id field's value. -func (s *Target) SetId(v string) *Target { - s.Id = &v - return s -} - -// SetInput sets the Input field's value. -func (s *Target) SetInput(v string) *Target { - s.Input = &v - return s -} - -// SetInputPath sets the InputPath field's value. -func (s *Target) SetInputPath(v string) *Target { - s.InputPath = &v - return s -} - -// SetInputTransformer sets the InputTransformer field's value. -func (s *Target) SetInputTransformer(v *InputTransformer) *Target { - s.InputTransformer = v - return s -} - -// SetKinesisParameters sets the KinesisParameters field's value. -func (s *Target) SetKinesisParameters(v *KinesisParameters) *Target { - s.KinesisParameters = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *Target) SetRoleArn(v string) *Target { - s.RoleArn = &v - return s -} - -// SetRunCommandParameters sets the RunCommandParameters field's value. -func (s *Target) SetRunCommandParameters(v *RunCommandParameters) *Target { - s.RunCommandParameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPatternRequest -type TestEventPatternInput struct { - _ struct{} `type:"structure"` - - // The event, in JSON format, to test against the event pattern. - // - // Event is a required field - Event *string `type:"string" required:"true"` - - // The event pattern. - // - // EventPattern is a required field - EventPattern *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s TestEventPatternInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestEventPatternInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestEventPatternInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestEventPatternInput"} - if s.Event == nil { - invalidParams.Add(request.NewErrParamRequired("Event")) - } - if s.EventPattern == nil { - invalidParams.Add(request.NewErrParamRequired("EventPattern")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvent sets the Event field's value. -func (s *TestEventPatternInput) SetEvent(v string) *TestEventPatternInput { - s.Event = &v - return s -} - -// SetEventPattern sets the EventPattern field's value. -func (s *TestEventPatternInput) SetEventPattern(v string) *TestEventPatternInput { - s.EventPattern = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPatternResponse -type TestEventPatternOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the event matches the event pattern. - Result *bool `type:"boolean"` -} - -// String returns the string representation -func (s TestEventPatternOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestEventPatternOutput) GoString() string { - return s.String() -} - -// SetResult sets the Result field's value. -func (s *TestEventPatternOutput) SetResult(v bool) *TestEventPatternOutput { - s.Result = &v - return s -} - -const ( - // RuleStateEnabled is a RuleState enum value - RuleStateEnabled = "ENABLED" - - // RuleStateDisabled is a RuleState enum value - RuleStateDisabled = "DISABLED" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go deleted file mode 100644 index fe9ecb8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go +++ /dev/null @@ -1,36 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudwatchevents - -const ( - - // ErrCodeConcurrentModificationException for service response error code - // "ConcurrentModificationException". - // - // There is concurrent modification on a rule or target. - ErrCodeConcurrentModificationException = "ConcurrentModificationException" - - // ErrCodeInternalException for service response error code - // "InternalException". - // - // This exception occurs due to unexpected causes. - ErrCodeInternalException = "InternalException" - - // ErrCodeInvalidEventPatternException for service response error code - // "InvalidEventPatternException". - // - // The event pattern is not valid. - ErrCodeInvalidEventPatternException = "InvalidEventPatternException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // You tried to create more rules or add more targets to a rule than is allowed. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The rule does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go deleted file mode 100644 index 569d91e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go +++ /dev/null @@ -1,110 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudwatchevents - -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 CloudWatch Events helps you to respond to state changes in your AWS -// resources. When your resources change state, they automatically send events -// into an event stream. You can create rules that match selected events in -// the stream and route them to targets to take action. You can also use rules -// to take action on a pre-determined schedule. For example, you can configure -// rules to: -// -// * Automatically invoke an AWS Lambda function to update DNS entries when -// an event notifies you that Amazon EC2 instance enters the running state. -// -// * Direct specific API records from CloudTrail to an Amazon Kinesis stream -// for detailed analysis of potential security or availability risks. -// -// * Periodically invoke a built-in target to create a snapshot of an Amazon -// EBS volume. -// -// For more information about the features of Amazon CloudWatch Events, see -// the Amazon CloudWatch Events User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events). -// 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/events-2015-10-07 -type CloudWatchEvents 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 = "events" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CloudWatchEvents 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 CloudWatchEvents client from just a session. -// svc := cloudwatchevents.New(mySession) -// -// // Create a CloudWatchEvents client with additional configuration -// svc := cloudwatchevents.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatchEvents { - 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) *CloudWatchEvents { - svc := &CloudWatchEvents{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-10-07", - JSONVersion: "1.1", - TargetPrefix: "AWSEvents", - }, - 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 CloudWatchEvents operation and runs any -// custom request initialization. -func (c *CloudWatchEvents) 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/cloudwatchlogs/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go deleted file mode 100644 index 38fee5b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go +++ /dev/null @@ -1,6073 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudwatchlogs provides a client for Amazon CloudWatch Logs. -package cloudwatchlogs - -import ( - "fmt" - - "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 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/logs-2014-03-28/CancelExportTask -func (c *CloudWatchLogs) 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(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CancelExportTask API operation for Amazon CloudWatch Logs. -// -// Cancels the specified export task. -// -// The task must be in the PENDING or RUNNING 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 CloudWatch Logs's -// API operation CancelExportTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The operation is not valid on the specified resource. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CancelExportTask -func (c *CloudWatchLogs) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) { - req, out := c.CancelExportTaskRequest(input) - err := req.Send() - return out, err -} - -const opCreateExportTask = "CreateExportTask" - -// CreateExportTaskRequest generates a "aws/request.Request" representing the -// client's request for the CreateExportTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateExportTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateExportTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateExportTaskRequest method. -// req, resp := client.CreateExportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateExportTask -func (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) (req *request.Request, output *CreateExportTaskOutput) { - op := &request.Operation{ - Name: opCreateExportTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateExportTaskInput{} - } - - output = &CreateExportTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateExportTask API operation for Amazon CloudWatch Logs. -// -// Creates an export task, which allows you to efficiently export data from -// a log group to an Amazon S3 bucket. -// -// This is an asynchronous call. If all the required information is provided, -// this operation initiates an export task and responds with the ID of the task. -// After the task has started, you can use DescribeExportTasks to get the status -// of the export task. Each account can only have one active (RUNNING or PENDING) -// export task at a time. To cancel an export task, use CancelExportTask. -// -// You can export logs from multiple log groups or multiple time ranges to the -// same S3 bucket. To separate out log data for each export task, you can specify -// a prefix that will be used as the Amazon S3 key prefix for all exported 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 CloudWatch Logs's -// API operation CreateExportTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// You have reached the maximum number of resources that can be created. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// The specified resource already exists. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateExportTask -func (c *CloudWatchLogs) CreateExportTask(input *CreateExportTaskInput) (*CreateExportTaskOutput, error) { - req, out := c.CreateExportTaskRequest(input) - err := req.Send() - return out, err -} - -const opCreateLogGroup = "CreateLogGroup" - -// CreateLogGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateLogGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLogGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLogGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLogGroupRequest method. -// req, resp := client.CreateLogGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogGroup -func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req *request.Request, output *CreateLogGroupOutput) { - op := &request.Operation{ - Name: opCreateLogGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLogGroupInput{} - } - - output = &CreateLogGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateLogGroup API operation for Amazon CloudWatch Logs. -// -// Creates a log group with the specified name. -// -// You can create up to 5000 log groups per account. -// -// You must use the following guidelines when naming a log group: -// -// * Log group names must be unique within a region for an AWS account. -// -// * Log group names can be between 1 and 512 characters long. -// -// * Log group names consist of the following characters: a-z, A-Z, 0-9, -// '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation CreateLogGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// The specified resource already exists. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// You have reached the maximum number of resources that can be created. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogGroup -func (c *CloudWatchLogs) CreateLogGroup(input *CreateLogGroupInput) (*CreateLogGroupOutput, error) { - req, out := c.CreateLogGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateLogStream = "CreateLogStream" - -// CreateLogStreamRequest generates a "aws/request.Request" representing the -// client's request for the CreateLogStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLogStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLogStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLogStreamRequest method. -// req, resp := client.CreateLogStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogStream -func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (req *request.Request, output *CreateLogStreamOutput) { - op := &request.Operation{ - Name: opCreateLogStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLogStreamInput{} - } - - output = &CreateLogStreamOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateLogStream API operation for Amazon CloudWatch Logs. -// -// Creates a log stream for the specified log group. -// -// There is no limit on the number of log streams that you can create for a -// log group. -// -// You must use the following guidelines when naming a log stream: -// -// * Log stream names must be unique within the log group. -// -// * Log stream names can be between 1 and 512 characters long. -// -// * The ':' (colon) and '*' (asterisk) characters are not allowed. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation CreateLogStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// The specified resource already exists. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogStream -func (c *CloudWatchLogs) CreateLogStream(input *CreateLogStreamInput) (*CreateLogStreamOutput, error) { - req, out := c.CreateLogStreamRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDestination = "DeleteDestination" - -// DeleteDestinationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDestination operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDestination for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDestination method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDestinationRequest method. -// req, resp := client.DeleteDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteDestination -func (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) (req *request.Request, output *DeleteDestinationOutput) { - op := &request.Operation{ - Name: opDeleteDestination, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDestinationInput{} - } - - output = &DeleteDestinationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDestination API operation for Amazon CloudWatch Logs. -// -// Deletes the specified destination, and eventually disables all the subscription -// filters that publish to it. This operation does not delete the physical resource -// encapsulated by the destination. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation DeleteDestination for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteDestination -func (c *CloudWatchLogs) DeleteDestination(input *DeleteDestinationInput) (*DeleteDestinationOutput, error) { - req, out := c.DeleteDestinationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLogGroup = "DeleteLogGroup" - -// DeleteLogGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLogGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLogGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLogGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLogGroupRequest method. -// req, resp := client.DeleteLogGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogGroup -func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req *request.Request, output *DeleteLogGroupOutput) { - op := &request.Operation{ - Name: opDeleteLogGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLogGroupInput{} - } - - output = &DeleteLogGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteLogGroup API operation for Amazon CloudWatch Logs. -// -// Deletes the specified log group and permanently deletes all the archived -// log events associated with the log group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation DeleteLogGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogGroup -func (c *CloudWatchLogs) DeleteLogGroup(input *DeleteLogGroupInput) (*DeleteLogGroupOutput, error) { - req, out := c.DeleteLogGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLogStream = "DeleteLogStream" - -// DeleteLogStreamRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLogStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLogStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLogStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLogStreamRequest method. -// req, resp := client.DeleteLogStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogStream -func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (req *request.Request, output *DeleteLogStreamOutput) { - op := &request.Operation{ - Name: opDeleteLogStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLogStreamInput{} - } - - output = &DeleteLogStreamOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteLogStream API operation for Amazon CloudWatch Logs. -// -// Deletes the specified log stream and permanently deletes all the archived -// log events associated with the log 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 CloudWatch Logs's -// API operation DeleteLogStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogStream -func (c *CloudWatchLogs) DeleteLogStream(input *DeleteLogStreamInput) (*DeleteLogStreamOutput, error) { - req, out := c.DeleteLogStreamRequest(input) - err := req.Send() - return out, err -} - -const opDeleteMetricFilter = "DeleteMetricFilter" - -// DeleteMetricFilterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMetricFilter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteMetricFilter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteMetricFilter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteMetricFilterRequest method. -// req, resp := client.DeleteMetricFilterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteMetricFilter -func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInput) (req *request.Request, output *DeleteMetricFilterOutput) { - op := &request.Operation{ - Name: opDeleteMetricFilter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteMetricFilterInput{} - } - - output = &DeleteMetricFilterOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteMetricFilter API operation for Amazon CloudWatch Logs. -// -// Deletes the specified metric filter. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation DeleteMetricFilter for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteMetricFilter -func (c *CloudWatchLogs) DeleteMetricFilter(input *DeleteMetricFilterInput) (*DeleteMetricFilterOutput, error) { - req, out := c.DeleteMetricFilterRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRetentionPolicy = "DeleteRetentionPolicy" - -// DeleteRetentionPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRetentionPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRetentionPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRetentionPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRetentionPolicyRequest method. -// req, resp := client.DeleteRetentionPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteRetentionPolicy -func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPolicyInput) (req *request.Request, output *DeleteRetentionPolicyOutput) { - op := &request.Operation{ - Name: opDeleteRetentionPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRetentionPolicyInput{} - } - - output = &DeleteRetentionPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRetentionPolicy API operation for Amazon CloudWatch Logs. -// -// Deletes the specified retention policy. -// -// Log events do not expire if they belong to log groups without a retention -// 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 CloudWatch Logs's -// API operation DeleteRetentionPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteRetentionPolicy -func (c *CloudWatchLogs) DeleteRetentionPolicy(input *DeleteRetentionPolicyInput) (*DeleteRetentionPolicyOutput, error) { - req, out := c.DeleteRetentionPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteSubscriptionFilter = "DeleteSubscriptionFilter" - -// DeleteSubscriptionFilterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSubscriptionFilter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSubscriptionFilter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSubscriptionFilter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSubscriptionFilterRequest method. -// req, resp := client.DeleteSubscriptionFilterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteSubscriptionFilter -func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscriptionFilterInput) (req *request.Request, output *DeleteSubscriptionFilterOutput) { - op := &request.Operation{ - Name: opDeleteSubscriptionFilter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSubscriptionFilterInput{} - } - - output = &DeleteSubscriptionFilterOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSubscriptionFilter API operation for Amazon CloudWatch Logs. -// -// Deletes the specified subscription filter. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation DeleteSubscriptionFilter for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteSubscriptionFilter -func (c *CloudWatchLogs) DeleteSubscriptionFilter(input *DeleteSubscriptionFilterInput) (*DeleteSubscriptionFilterOutput, error) { - req, out := c.DeleteSubscriptionFilterRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDestinations = "DescribeDestinations" - -// DescribeDestinationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDestinations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDestinations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDestinations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDestinationsRequest method. -// req, resp := client.DescribeDestinationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeDestinations -func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinationsInput) (req *request.Request, output *DescribeDestinationsOutput) { - op := &request.Operation{ - Name: opDescribeDestinations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDestinationsInput{} - } - - output = &DescribeDestinationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDestinations API operation for Amazon CloudWatch Logs. -// -// Lists all your destinations. The results are ASCII-sorted by destination -// 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 CloudWatch Logs's -// API operation DescribeDestinations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeDestinations -func (c *CloudWatchLogs) DescribeDestinations(input *DescribeDestinationsInput) (*DescribeDestinationsOutput, error) { - req, out := c.DescribeDestinationsRequest(input) - err := req.Send() - return out, err -} - -// DescribeDestinationsPages iterates over the pages of a DescribeDestinations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDestinations 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 DescribeDestinations operation. -// pageNum := 0 -// err := client.DescribeDestinationsPages(params, -// func(page *DescribeDestinationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeDestinationsPages(input *DescribeDestinationsInput, fn func(p *DescribeDestinationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDestinationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDestinationsOutput), lastPage) - }) -} - -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/logs-2014-03-28/DescribeExportTasks -func (c *CloudWatchLogs) 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 CloudWatch Logs. -// -// Lists the specified export tasks. You can list all your export tasks or filter -// the results based on task ID or task 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 CloudWatch Logs's -// API operation DescribeExportTasks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeExportTasks -func (c *CloudWatchLogs) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) { - req, out := c.DescribeExportTasksRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLogGroups = "DescribeLogGroups" - -// DescribeLogGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLogGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLogGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLogGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLogGroupsRequest method. -// req, resp := client.DescribeLogGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogGroups -func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) (req *request.Request, output *DescribeLogGroupsOutput) { - op := &request.Operation{ - Name: opDescribeLogGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeLogGroupsInput{} - } - - output = &DescribeLogGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLogGroups API operation for Amazon CloudWatch Logs. -// -// Lists the specified log groups. You can list all your log groups or filter -// the results by prefix. The results are ASCII-sorted by log group 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 CloudWatch Logs's -// API operation DescribeLogGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogGroups -func (c *CloudWatchLogs) DescribeLogGroups(input *DescribeLogGroupsInput) (*DescribeLogGroupsOutput, error) { - req, out := c.DescribeLogGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeLogGroupsPages iterates over the pages of a DescribeLogGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLogGroups 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 DescribeLogGroups operation. -// pageNum := 0 -// err := client.DescribeLogGroupsPages(params, -// func(page *DescribeLogGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeLogGroupsPages(input *DescribeLogGroupsInput, fn func(p *DescribeLogGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLogGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLogGroupsOutput), lastPage) - }) -} - -const opDescribeLogStreams = "DescribeLogStreams" - -// DescribeLogStreamsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLogStreams operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLogStreams for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLogStreams method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLogStreamsRequest method. -// req, resp := client.DescribeLogStreamsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogStreams -func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInput) (req *request.Request, output *DescribeLogStreamsOutput) { - op := &request.Operation{ - Name: opDescribeLogStreams, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeLogStreamsInput{} - } - - output = &DescribeLogStreamsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLogStreams API operation for Amazon CloudWatch Logs. -// -// Lists the log streams for the specified log group. You can list all the log -// streams or filter the results by prefix. You can also control how the results -// are ordered. -// -// This operation has a limit of five transactions per second, after which transactions -// are throttled. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation DescribeLogStreams for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogStreams -func (c *CloudWatchLogs) DescribeLogStreams(input *DescribeLogStreamsInput) (*DescribeLogStreamsOutput, error) { - req, out := c.DescribeLogStreamsRequest(input) - err := req.Send() - return out, err -} - -// DescribeLogStreamsPages iterates over the pages of a DescribeLogStreams operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLogStreams 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 DescribeLogStreams operation. -// pageNum := 0 -// err := client.DescribeLogStreamsPages(params, -// func(page *DescribeLogStreamsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeLogStreamsPages(input *DescribeLogStreamsInput, fn func(p *DescribeLogStreamsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLogStreamsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLogStreamsOutput), lastPage) - }) -} - -const opDescribeMetricFilters = "DescribeMetricFilters" - -// DescribeMetricFiltersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMetricFilters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMetricFilters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMetricFilters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMetricFiltersRequest method. -// req, resp := client.DescribeMetricFiltersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeMetricFilters -func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFiltersInput) (req *request.Request, output *DescribeMetricFiltersOutput) { - op := &request.Operation{ - Name: opDescribeMetricFilters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeMetricFiltersInput{} - } - - output = &DescribeMetricFiltersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMetricFilters API operation for Amazon CloudWatch Logs. -// -// Lists the specified metric filters. You can list all the metric filters or -// filter the results by log name, prefix, metric name, and metric namespace. -// The results are ASCII-sorted by filter 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 CloudWatch Logs's -// API operation DescribeMetricFilters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeMetricFilters -func (c *CloudWatchLogs) DescribeMetricFilters(input *DescribeMetricFiltersInput) (*DescribeMetricFiltersOutput, error) { - req, out := c.DescribeMetricFiltersRequest(input) - err := req.Send() - return out, err -} - -// DescribeMetricFiltersPages iterates over the pages of a DescribeMetricFilters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeMetricFilters 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 DescribeMetricFilters operation. -// pageNum := 0 -// err := client.DescribeMetricFiltersPages(params, -// func(page *DescribeMetricFiltersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeMetricFiltersPages(input *DescribeMetricFiltersInput, fn func(p *DescribeMetricFiltersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeMetricFiltersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeMetricFiltersOutput), lastPage) - }) -} - -const opDescribeSubscriptionFilters = "DescribeSubscriptionFilters" - -// DescribeSubscriptionFiltersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSubscriptionFilters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSubscriptionFilters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSubscriptionFilters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSubscriptionFiltersRequest method. -// req, resp := client.DescribeSubscriptionFiltersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeSubscriptionFilters -func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubscriptionFiltersInput) (req *request.Request, output *DescribeSubscriptionFiltersOutput) { - op := &request.Operation{ - Name: opDescribeSubscriptionFilters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeSubscriptionFiltersInput{} - } - - output = &DescribeSubscriptionFiltersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSubscriptionFilters API operation for Amazon CloudWatch Logs. -// -// Lists the subscription filters for the specified log group. You can list -// all the subscription filters or filter the results by prefix. The results -// are ASCII-sorted by filter 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 CloudWatch Logs's -// API operation DescribeSubscriptionFilters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeSubscriptionFilters -func (c *CloudWatchLogs) DescribeSubscriptionFilters(input *DescribeSubscriptionFiltersInput) (*DescribeSubscriptionFiltersOutput, error) { - req, out := c.DescribeSubscriptionFiltersRequest(input) - err := req.Send() - return out, err -} - -// DescribeSubscriptionFiltersPages iterates over the pages of a DescribeSubscriptionFilters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSubscriptionFilters 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 DescribeSubscriptionFilters operation. -// pageNum := 0 -// err := client.DescribeSubscriptionFiltersPages(params, -// func(page *DescribeSubscriptionFiltersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) DescribeSubscriptionFiltersPages(input *DescribeSubscriptionFiltersInput, fn func(p *DescribeSubscriptionFiltersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSubscriptionFiltersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSubscriptionFiltersOutput), lastPage) - }) -} - -const opFilterLogEvents = "FilterLogEvents" - -// FilterLogEventsRequest generates a "aws/request.Request" representing the -// client's request for the FilterLogEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See FilterLogEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the FilterLogEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the FilterLogEventsRequest method. -// req, resp := client.FilterLogEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/FilterLogEvents -func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (req *request.Request, output *FilterLogEventsOutput) { - op := &request.Operation{ - Name: opFilterLogEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &FilterLogEventsInput{} - } - - output = &FilterLogEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// FilterLogEvents API operation for Amazon CloudWatch Logs. -// -// Lists log events from the specified log group. You can list all the log events -// or filter the results using a filter pattern, a time range, and the name -// of the log stream. -// -// By default, this operation returns as many log events as can fit in 1MB (up -// to 10,000 log events), or all the events found within the time range that -// you specify. If the results include a token, then there are more log events -// available, and you can get additional results by specifying the token in -// a subsequent 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 CloudWatch Logs's -// API operation FilterLogEvents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/FilterLogEvents -func (c *CloudWatchLogs) FilterLogEvents(input *FilterLogEventsInput) (*FilterLogEventsOutput, error) { - req, out := c.FilterLogEventsRequest(input) - err := req.Send() - return out, err -} - -// FilterLogEventsPages iterates over the pages of a FilterLogEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See FilterLogEvents 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 FilterLogEvents operation. -// pageNum := 0 -// err := client.FilterLogEventsPages(params, -// func(page *FilterLogEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) FilterLogEventsPages(input *FilterLogEventsInput, fn func(p *FilterLogEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.FilterLogEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*FilterLogEventsOutput), lastPage) - }) -} - -const opGetLogEvents = "GetLogEvents" - -// GetLogEventsRequest generates a "aws/request.Request" representing the -// client's request for the GetLogEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetLogEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetLogEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetLogEventsRequest method. -// req, resp := client.GetLogEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogEvents -func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *request.Request, output *GetLogEventsOutput) { - op := &request.Operation{ - Name: opGetLogEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextForwardToken"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetLogEventsInput{} - } - - output = &GetLogEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetLogEvents API operation for Amazon CloudWatch Logs. -// -// Lists log events from the specified log stream. You can list all the log -// events or filter using a time range. -// -// By default, this operation returns as many log events as can fit in a response -// size of 1MB (up to 10,000 log events). If the results include tokens, there -// are more log events available. You can get additional log events by specifying -// one of the tokens in a subsequent 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 CloudWatch Logs's -// API operation GetLogEvents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogEvents -func (c *CloudWatchLogs) GetLogEvents(input *GetLogEventsInput) (*GetLogEventsOutput, error) { - req, out := c.GetLogEventsRequest(input) - err := req.Send() - return out, err -} - -// GetLogEventsPages iterates over the pages of a GetLogEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetLogEvents 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 GetLogEvents operation. -// pageNum := 0 -// err := client.GetLogEventsPages(params, -// func(page *GetLogEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudWatchLogs) GetLogEventsPages(input *GetLogEventsInput, fn func(p *GetLogEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetLogEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetLogEventsOutput), lastPage) - }) -} - -const opListTagsLogGroup = "ListTagsLogGroup" - -// ListTagsLogGroupRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsLogGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTagsLogGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTagsLogGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsLogGroupRequest method. -// req, resp := client.ListTagsLogGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ListTagsLogGroup -func (c *CloudWatchLogs) ListTagsLogGroupRequest(input *ListTagsLogGroupInput) (req *request.Request, output *ListTagsLogGroupOutput) { - op := &request.Operation{ - Name: opListTagsLogGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsLogGroupInput{} - } - - output = &ListTagsLogGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsLogGroup API operation for Amazon CloudWatch Logs. -// -// Lists the tags for the specified log group. -// -// To add tags, use TagLogGroup. To remove tags, use UntagLogGroup. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation ListTagsLogGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ListTagsLogGroup -func (c *CloudWatchLogs) ListTagsLogGroup(input *ListTagsLogGroupInput) (*ListTagsLogGroupOutput, error) { - req, out := c.ListTagsLogGroupRequest(input) - err := req.Send() - return out, err -} - -const opPutDestination = "PutDestination" - -// PutDestinationRequest generates a "aws/request.Request" representing the -// client's request for the PutDestination operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutDestination for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutDestination method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutDestinationRequest method. -// req, resp := client.PutDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestination -func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req *request.Request, output *PutDestinationOutput) { - op := &request.Operation{ - Name: opPutDestination, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutDestinationInput{} - } - - output = &PutDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutDestination API operation for Amazon CloudWatch Logs. -// -// Creates or updates a destination. A destination encapsulates a physical resource -// (such as a Kinesis stream) and enables you to subscribe to a real-time stream -// of log events of a different account, ingested using PutLogEvents. Currently, -// the only supported physical resource is a Amazon Kinesis stream belonging -// to the same account as the destination. -// -// A destination controls what is written to its Amazon Kinesis stream through -// an access policy. By default, PutDestination does not set any access policy -// with the destination, which means a cross-account user cannot call PutSubscriptionFilter -// against this destination. To enable this, the destination owner must call -// PutDestinationPolicy after PutDestination. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation PutDestination for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestination -func (c *CloudWatchLogs) PutDestination(input *PutDestinationInput) (*PutDestinationOutput, error) { - req, out := c.PutDestinationRequest(input) - err := req.Send() - return out, err -} - -const opPutDestinationPolicy = "PutDestinationPolicy" - -// PutDestinationPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutDestinationPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutDestinationPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutDestinationPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutDestinationPolicyRequest method. -// req, resp := client.PutDestinationPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestinationPolicy -func (c *CloudWatchLogs) PutDestinationPolicyRequest(input *PutDestinationPolicyInput) (req *request.Request, output *PutDestinationPolicyOutput) { - op := &request.Operation{ - Name: opPutDestinationPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutDestinationPolicyInput{} - } - - output = &PutDestinationPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutDestinationPolicy API operation for Amazon CloudWatch Logs. -// -// Creates or updates an access policy associated with an existing destination. -// An access policy is an IAM policy document (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.html) -// that is used to authorize claims to register a subscription filter against -// a given destination. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation PutDestinationPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestinationPolicy -func (c *CloudWatchLogs) PutDestinationPolicy(input *PutDestinationPolicyInput) (*PutDestinationPolicyOutput, error) { - req, out := c.PutDestinationPolicyRequest(input) - err := req.Send() - return out, err -} - -const opPutLogEvents = "PutLogEvents" - -// PutLogEventsRequest generates a "aws/request.Request" representing the -// client's request for the PutLogEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutLogEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutLogEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutLogEventsRequest method. -// req, resp := client.PutLogEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutLogEvents -func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *request.Request, output *PutLogEventsOutput) { - op := &request.Operation{ - Name: opPutLogEvents, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutLogEventsInput{} - } - - output = &PutLogEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutLogEvents API operation for Amazon CloudWatch Logs. -// -// Uploads a batch of log events to the specified log stream. -// -// You must include the sequence token obtained from the response of the previous -// call. An upload in a newly created log stream does not require a sequence -// token. You can also get the sequence token using DescribeLogStreams. -// -// The batch of events must satisfy the following constraints: -// -// * The maximum batch size is 1,048,576 bytes, and this size is calculated -// as the sum of all event messages in UTF-8, plus 26 bytes for each log -// event. -// -// * None of the log events in the batch can be more than 2 hours in the -// future. -// -// * None of the log events in the batch can be older than 14 days or the -// retention period of the log group. -// -// * The log events in the batch must be in chronological ordered by their -// timestamp (the time the event occurred, expressed as the number of milliseconds -// since Jan 1, 1970 00:00:00 UTC). -// -// * The maximum number of log events in a batch is 10,000. -// -// * A batch of log events in a single request cannot span more than 24 hours. -// Otherwise, the operation fails. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation PutLogEvents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeInvalidSequenceTokenException "InvalidSequenceTokenException" -// The sequence token is not valid. -// -// * ErrCodeDataAlreadyAcceptedException "DataAlreadyAcceptedException" -// The event was already logged. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutLogEvents -func (c *CloudWatchLogs) PutLogEvents(input *PutLogEventsInput) (*PutLogEventsOutput, error) { - req, out := c.PutLogEventsRequest(input) - err := req.Send() - return out, err -} - -const opPutMetricFilter = "PutMetricFilter" - -// PutMetricFilterRequest generates a "aws/request.Request" representing the -// client's request for the PutMetricFilter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutMetricFilter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutMetricFilter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutMetricFilterRequest method. -// req, resp := client.PutMetricFilterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutMetricFilter -func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (req *request.Request, output *PutMetricFilterOutput) { - op := &request.Operation{ - Name: opPutMetricFilter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutMetricFilterInput{} - } - - output = &PutMetricFilterOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutMetricFilter API operation for Amazon CloudWatch Logs. -// -// Creates or updates a metric filter and associates it with the specified log -// group. Metric filters allow you to configure rules to extract metric data -// from log events ingested through PutLogEvents. -// -// The maximum number of metric filters that can be associated with a log group -// is 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 CloudWatch Logs's -// API operation PutMetricFilter for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// You have reached the maximum number of resources that can be created. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutMetricFilter -func (c *CloudWatchLogs) PutMetricFilter(input *PutMetricFilterInput) (*PutMetricFilterOutput, error) { - req, out := c.PutMetricFilterRequest(input) - err := req.Send() - return out, err -} - -const opPutRetentionPolicy = "PutRetentionPolicy" - -// PutRetentionPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutRetentionPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutRetentionPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutRetentionPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutRetentionPolicyRequest method. -// req, resp := client.PutRetentionPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutRetentionPolicy -func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInput) (req *request.Request, output *PutRetentionPolicyOutput) { - op := &request.Operation{ - Name: opPutRetentionPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutRetentionPolicyInput{} - } - - output = &PutRetentionPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutRetentionPolicy API operation for Amazon CloudWatch Logs. -// -// Sets the retention of the specified log group. A retention policy allows -// you to configure the number of days you want to retain log events in the -// specified log group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation PutRetentionPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutRetentionPolicy -func (c *CloudWatchLogs) PutRetentionPolicy(input *PutRetentionPolicyInput) (*PutRetentionPolicyOutput, error) { - req, out := c.PutRetentionPolicyRequest(input) - err := req.Send() - return out, err -} - -const opPutSubscriptionFilter = "PutSubscriptionFilter" - -// PutSubscriptionFilterRequest generates a "aws/request.Request" representing the -// client's request for the PutSubscriptionFilter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutSubscriptionFilter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutSubscriptionFilter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutSubscriptionFilterRequest method. -// req, resp := client.PutSubscriptionFilterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutSubscriptionFilter -func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilterInput) (req *request.Request, output *PutSubscriptionFilterOutput) { - op := &request.Operation{ - Name: opPutSubscriptionFilter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutSubscriptionFilterInput{} - } - - output = &PutSubscriptionFilterOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutSubscriptionFilter API operation for Amazon CloudWatch Logs. -// -// Creates or updates a subscription filter and associates it with the specified -// log group. Subscription filters allow you to subscribe to a real-time stream -// of log events ingested through PutLogEvents and have them delivered to a -// specific destination. Currently, the supported destinations are: -// -// * An Amazon Kinesis stream belonging to the same account as the subscription -// filter, for same-account delivery. -// -// * A logical destination that belongs to a different account, for cross-account -// delivery. -// -// * An Amazon Kinesis Firehose stream that belongs to the same account as -// the subscription filter, for same-account delivery. -// -// * An AWS Lambda function that belongs to the same account as the subscription -// filter, for same-account delivery. -// -// There can only be one subscription filter associated with a log group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation PutSubscriptionFilter for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeOperationAbortedException "OperationAbortedException" -// Multiple requests to update the same resource were in conflict. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// You have reached the maximum number of resources that can be created. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutSubscriptionFilter -func (c *CloudWatchLogs) PutSubscriptionFilter(input *PutSubscriptionFilterInput) (*PutSubscriptionFilterOutput, error) { - req, out := c.PutSubscriptionFilterRequest(input) - err := req.Send() - return out, err -} - -const opTagLogGroup = "TagLogGroup" - -// TagLogGroupRequest generates a "aws/request.Request" representing the -// client's request for the TagLogGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TagLogGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TagLogGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TagLogGroupRequest method. -// req, resp := client.TagLogGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TagLogGroup -func (c *CloudWatchLogs) TagLogGroupRequest(input *TagLogGroupInput) (req *request.Request, output *TagLogGroupOutput) { - op := &request.Operation{ - Name: opTagLogGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagLogGroupInput{} - } - - output = &TagLogGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagLogGroup API operation for Amazon CloudWatch Logs. -// -// Adds or updates the specified tags for the specified log group. -// -// To list the tags for a log group, use ListTagsLogGroup. To remove tags, use -// UntagLogGroup. -// -// For more information about tags, see Tag Log Groups in Amazon CloudWatch -// Logs (http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/log-group-tagging.html) -// in the Amazon CloudWatch Logs 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 CloudWatch Logs's -// API operation TagLogGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TagLogGroup -func (c *CloudWatchLogs) TagLogGroup(input *TagLogGroupInput) (*TagLogGroupOutput, error) { - req, out := c.TagLogGroupRequest(input) - err := req.Send() - return out, err -} - -const opTestMetricFilter = "TestMetricFilter" - -// TestMetricFilterRequest generates a "aws/request.Request" representing the -// client's request for the TestMetricFilter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TestMetricFilter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TestMetricFilter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TestMetricFilterRequest method. -// req, resp := client.TestMetricFilterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TestMetricFilter -func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) (req *request.Request, output *TestMetricFilterOutput) { - op := &request.Operation{ - Name: opTestMetricFilter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TestMetricFilterInput{} - } - - output = &TestMetricFilterOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestMetricFilter API operation for Amazon CloudWatch Logs. -// -// Tests the filter pattern of a metric filter against a sample of log event -// messages. You can use this operation to validate the correctness of a metric -// filter pattern. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation TestMetricFilter for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is specified incorrectly. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service cannot complete the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TestMetricFilter -func (c *CloudWatchLogs) TestMetricFilter(input *TestMetricFilterInput) (*TestMetricFilterOutput, error) { - req, out := c.TestMetricFilterRequest(input) - err := req.Send() - return out, err -} - -const opUntagLogGroup = "UntagLogGroup" - -// UntagLogGroupRequest generates a "aws/request.Request" representing the -// client's request for the UntagLogGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UntagLogGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UntagLogGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UntagLogGroupRequest method. -// req, resp := client.UntagLogGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/UntagLogGroup -func (c *CloudWatchLogs) UntagLogGroupRequest(input *UntagLogGroupInput) (req *request.Request, output *UntagLogGroupOutput) { - op := &request.Operation{ - Name: opUntagLogGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagLogGroupInput{} - } - - output = &UntagLogGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagLogGroup API operation for Amazon CloudWatch Logs. -// -// Removes the specified tags from the specified log group. -// -// To list the tags for a log group, use ListTagsLogGroup. To add tags, use -// UntagLogGroup. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon CloudWatch Logs's -// API operation UntagLogGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/UntagLogGroup -func (c *CloudWatchLogs) UntagLogGroup(input *UntagLogGroupInput) (*UntagLogGroupOutput, error) { - req, out := c.UntagLogGroupRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CancelExportTaskRequest -type CancelExportTaskInput struct { - _ struct{} `type:"structure"` - - // The ID of the export task. - // - // TaskId is a required field - TaskId *string `locationName:"taskId" min:"1" 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.TaskId == nil { - invalidParams.Add(request.NewErrParamRequired("TaskId")) - } - if s.TaskId != nil && len(*s.TaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTaskId sets the TaskId field's value. -func (s *CancelExportTaskInput) SetTaskId(v string) *CancelExportTaskInput { - s.TaskId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/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() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateExportTaskRequest -type CreateExportTaskInput struct { - _ struct{} `type:"structure"` - - // The name of S3 bucket for the exported log data. The bucket must be in the - // same AWS region. - // - // Destination is a required field - Destination *string `locationName:"destination" min:"1" type:"string" required:"true"` - - // The prefix used as the start of the key for every object exported. If you - // don't specify a value, the default is exportedlogs. - DestinationPrefix *string `locationName:"destinationPrefix" type:"string"` - - // The start time of the range for the request, expressed as the number of milliseconds - // since Jan 1, 1970 00:00:00 UTC. Events with a timestamp earlier than this - // time are not exported. - // - // From is a required field - From *int64 `locationName:"from" type:"long" required:"true"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // Export only log streams that match the provided prefix. If you don't specify - // a value, no prefix filter is applied. - LogStreamNamePrefix *string `locationName:"logStreamNamePrefix" min:"1" type:"string"` - - // The name of the export task. - TaskName *string `locationName:"taskName" min:"1" type:"string"` - - // The end time of the range for the request, expressed as the number of milliseconds - // since Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time - // are not exported. - // - // To is a required field - To *int64 `locationName:"to" type:"long" required:"true"` -} - -// String returns the string representation -func (s CreateExportTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateExportTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateExportTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateExportTaskInput"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.Destination != nil && len(*s.Destination) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Destination", 1)) - } - if s.From == nil { - invalidParams.Add(request.NewErrParamRequired("From")) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.LogStreamNamePrefix != nil && len(*s.LogStreamNamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogStreamNamePrefix", 1)) - } - if s.TaskName != nil && len(*s.TaskName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskName", 1)) - } - if s.To == nil { - invalidParams.Add(request.NewErrParamRequired("To")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *CreateExportTaskInput) SetDestination(v string) *CreateExportTaskInput { - s.Destination = &v - return s -} - -// SetDestinationPrefix sets the DestinationPrefix field's value. -func (s *CreateExportTaskInput) SetDestinationPrefix(v string) *CreateExportTaskInput { - s.DestinationPrefix = &v - return s -} - -// SetFrom sets the From field's value. -func (s *CreateExportTaskInput) SetFrom(v int64) *CreateExportTaskInput { - s.From = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CreateExportTaskInput) SetLogGroupName(v string) *CreateExportTaskInput { - s.LogGroupName = &v - return s -} - -// SetLogStreamNamePrefix sets the LogStreamNamePrefix field's value. -func (s *CreateExportTaskInput) SetLogStreamNamePrefix(v string) *CreateExportTaskInput { - s.LogStreamNamePrefix = &v - return s -} - -// SetTaskName sets the TaskName field's value. -func (s *CreateExportTaskInput) SetTaskName(v string) *CreateExportTaskInput { - s.TaskName = &v - return s -} - -// SetTo sets the To field's value. -func (s *CreateExportTaskInput) SetTo(v int64) *CreateExportTaskInput { - s.To = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateExportTaskResponse -type CreateExportTaskOutput struct { - _ struct{} `type:"structure"` - - // The ID of the export task. - TaskId *string `locationName:"taskId" min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateExportTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateExportTaskOutput) GoString() string { - return s.String() -} - -// SetTaskId sets the TaskId field's value. -func (s *CreateExportTaskOutput) SetTaskId(v string) *CreateExportTaskOutput { - s.TaskId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogGroupRequest -type CreateLogGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The key-value pairs to use for the tags. - Tags map[string]*string `locationName:"tags" min:"1" type:"map"` -} - -// String returns the string representation -func (s CreateLogGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLogGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLogGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLogGroupInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CreateLogGroupInput) SetLogGroupName(v string) *CreateLogGroupInput { - s.LogGroupName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateLogGroupInput) SetTags(v map[string]*string) *CreateLogGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogGroupOutput -type CreateLogGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateLogGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLogGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogStreamRequest -type CreateLogStreamInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The name of the log stream. - // - // LogStreamName is a required field - LogStreamName *string `locationName:"logStreamName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateLogStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLogStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLogStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLogStreamInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.LogStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("LogStreamName")) - } - if s.LogStreamName != nil && len(*s.LogStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CreateLogStreamInput) SetLogGroupName(v string) *CreateLogStreamInput { - s.LogGroupName = &v - return s -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *CreateLogStreamInput) SetLogStreamName(v string) *CreateLogStreamInput { - s.LogStreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogStreamOutput -type CreateLogStreamOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateLogStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLogStreamOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteDestinationRequest -type DeleteDestinationInput struct { - _ struct{} `type:"structure"` - - // The name of the destination. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDestinationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDestinationInput"} - if s.DestinationName == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationName")) - } - if s.DestinationName != nil && len(*s.DestinationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationName sets the DestinationName field's value. -func (s *DeleteDestinationInput) SetDestinationName(v string) *DeleteDestinationInput { - s.DestinationName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteDestinationOutput -type DeleteDestinationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDestinationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDestinationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogGroupRequest -type DeleteLogGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLogGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLogGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLogGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLogGroupInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *DeleteLogGroupInput) SetLogGroupName(v string) *DeleteLogGroupInput { - s.LogGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogGroupOutput -type DeleteLogGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLogGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLogGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogStreamRequest -type DeleteLogStreamInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The name of the log stream. - // - // LogStreamName is a required field - LogStreamName *string `locationName:"logStreamName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLogStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLogStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLogStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLogStreamInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.LogStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("LogStreamName")) - } - if s.LogStreamName != nil && len(*s.LogStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *DeleteLogStreamInput) SetLogGroupName(v string) *DeleteLogStreamInput { - s.LogGroupName = &v - return s -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *DeleteLogStreamInput) SetLogStreamName(v string) *DeleteLogStreamInput { - s.LogStreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogStreamOutput -type DeleteLogStreamOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLogStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLogStreamOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteMetricFilterRequest -type DeleteMetricFilterInput struct { - _ struct{} `type:"structure"` - - // The name of the metric filter. - // - // FilterName is a required field - FilterName *string `locationName:"filterName" min:"1" type:"string" required:"true"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMetricFilterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMetricFilterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMetricFilterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMetricFilterInput"} - if s.FilterName == nil { - invalidParams.Add(request.NewErrParamRequired("FilterName")) - } - if s.FilterName != nil && len(*s.FilterName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterName", 1)) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterName sets the FilterName field's value. -func (s *DeleteMetricFilterInput) SetFilterName(v string) *DeleteMetricFilterInput { - s.FilterName = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *DeleteMetricFilterInput) SetLogGroupName(v string) *DeleteMetricFilterInput { - s.LogGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteMetricFilterOutput -type DeleteMetricFilterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteMetricFilterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMetricFilterOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteRetentionPolicyRequest -type DeleteRetentionPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRetentionPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRetentionPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRetentionPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRetentionPolicyInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *DeleteRetentionPolicyInput) SetLogGroupName(v string) *DeleteRetentionPolicyInput { - s.LogGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteRetentionPolicyOutput -type DeleteRetentionPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRetentionPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRetentionPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteSubscriptionFilterRequest -type DeleteSubscriptionFilterInput struct { - _ struct{} `type:"structure"` - - // The name of the subscription filter. - // - // FilterName is a required field - FilterName *string `locationName:"filterName" min:"1" type:"string" required:"true"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSubscriptionFilterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSubscriptionFilterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSubscriptionFilterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriptionFilterInput"} - if s.FilterName == nil { - invalidParams.Add(request.NewErrParamRequired("FilterName")) - } - if s.FilterName != nil && len(*s.FilterName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterName", 1)) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterName sets the FilterName field's value. -func (s *DeleteSubscriptionFilterInput) SetFilterName(v string) *DeleteSubscriptionFilterInput { - s.FilterName = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *DeleteSubscriptionFilterInput) SetLogGroupName(v string) *DeleteSubscriptionFilterInput { - s.LogGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteSubscriptionFilterOutput -type DeleteSubscriptionFilterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSubscriptionFilterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSubscriptionFilterOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeDestinationsRequest -type DescribeDestinationsInput struct { - _ struct{} `type:"structure"` - - // The prefix to match. If you don't specify a value, no prefix filter is applied. - DestinationNamePrefix *string `min:"1" type:"string"` - - // The maximum number of items returned. If you don't specify a value, the default - // is up to 50 items. - Limit *int64 `locationName:"limit" min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeDestinationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDestinationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDestinationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDestinationsInput"} - if s.DestinationNamePrefix != nil && len(*s.DestinationNamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DestinationNamePrefix", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationNamePrefix sets the DestinationNamePrefix field's value. -func (s *DescribeDestinationsInput) SetDestinationNamePrefix(v string) *DescribeDestinationsInput { - s.DestinationNamePrefix = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeDestinationsInput) SetLimit(v int64) *DescribeDestinationsInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDestinationsInput) SetNextToken(v string) *DescribeDestinationsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeDestinationsResponse -type DescribeDestinationsOutput struct { - _ struct{} `type:"structure"` - - // The destinations. - Destinations []*Destination `locationName:"destinations" type:"list"` - - // The token for the next set of items to return. The token expires after 24 - // hours. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeDestinationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDestinationsOutput) GoString() string { - return s.String() -} - -// SetDestinations sets the Destinations field's value. -func (s *DescribeDestinationsOutput) SetDestinations(v []*Destination) *DescribeDestinationsOutput { - s.Destinations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDestinationsOutput) SetNextToken(v string) *DescribeDestinationsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeExportTasksRequest -type DescribeExportTasksInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items returned. If you don't specify a value, the default - // is up to 50 items. - Limit *int64 `locationName:"limit" min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The status code of the export task. Specifying a status code filters the - // results to zero or more export tasks. - StatusCode *string `locationName:"statusCode" type:"string" enum:"ExportTaskStatusCode"` - - // The ID of the export task. Specifying a task ID filters the results to zero - // or one export tasks. - TaskId *string `locationName:"taskId" min:"1" type:"string"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeExportTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeExportTasksInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.TaskId != nil && len(*s.TaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *DescribeExportTasksInput) SetLimit(v int64) *DescribeExportTasksInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeExportTasksInput) SetNextToken(v string) *DescribeExportTasksInput { - s.NextToken = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *DescribeExportTasksInput) SetStatusCode(v string) *DescribeExportTasksInput { - s.StatusCode = &v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *DescribeExportTasksInput) SetTaskId(v string) *DescribeExportTasksInput { - s.TaskId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeExportTasksResponse -type DescribeExportTasksOutput struct { - _ struct{} `type:"structure"` - - // The export tasks. - ExportTasks []*ExportTask `locationName:"exportTasks" type:"list"` - - // The token for the next set of items to return. The token expires after 24 - // hours. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// 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 -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeExportTasksOutput) SetNextToken(v string) *DescribeExportTasksOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogGroupsRequest -type DescribeLogGroupsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items returned. If you don't specify a value, the default - // is up to 50 items. - Limit *int64 `locationName:"limit" min:"1" type:"integer"` - - // The prefix to match. - LogGroupNamePrefix *string `locationName:"logGroupNamePrefix" min:"1" type:"string"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeLogGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLogGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLogGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLogGroupsInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.LogGroupNamePrefix != nil && len(*s.LogGroupNamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupNamePrefix", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *DescribeLogGroupsInput) SetLimit(v int64) *DescribeLogGroupsInput { - s.Limit = &v - return s -} - -// SetLogGroupNamePrefix sets the LogGroupNamePrefix field's value. -func (s *DescribeLogGroupsInput) SetLogGroupNamePrefix(v string) *DescribeLogGroupsInput { - s.LogGroupNamePrefix = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLogGroupsInput) SetNextToken(v string) *DescribeLogGroupsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogGroupsResponse -type DescribeLogGroupsOutput struct { - _ struct{} `type:"structure"` - - // The log groups. - LogGroups []*LogGroup `locationName:"logGroups" type:"list"` - - // The token for the next set of items to return. The token expires after 24 - // hours. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeLogGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLogGroupsOutput) GoString() string { - return s.String() -} - -// SetLogGroups sets the LogGroups field's value. -func (s *DescribeLogGroupsOutput) SetLogGroups(v []*LogGroup) *DescribeLogGroupsOutput { - s.LogGroups = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLogGroupsOutput) SetNextToken(v string) *DescribeLogGroupsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogStreamsRequest -type DescribeLogStreamsInput struct { - _ struct{} `type:"structure"` - - // If the value is true, results are returned in descending order. If the value - // is to false, results are returned in ascending order. The default value is - // false. - Descending *bool `locationName:"descending" type:"boolean"` - - // The maximum number of items returned. If you don't specify a value, the default - // is up to 50 items. - Limit *int64 `locationName:"limit" min:"1" type:"integer"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The prefix to match. - // - // You cannot specify this parameter if orderBy is LastEventTime. - LogStreamNamePrefix *string `locationName:"logStreamNamePrefix" min:"1" type:"string"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // If the value is LogStreamName, the results are ordered by log stream name. - // If the value is LastEventTime, the results are ordered by the event time. - // The default value is LogStreamName. - // - // If you order the results by event time, you cannot specify the logStreamNamePrefix - // parameter. - OrderBy *string `locationName:"orderBy" type:"string" enum:"OrderBy"` -} - -// String returns the string representation -func (s DescribeLogStreamsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLogStreamsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLogStreamsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLogStreamsInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.LogStreamNamePrefix != nil && len(*s.LogStreamNamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogStreamNamePrefix", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescending sets the Descending field's value. -func (s *DescribeLogStreamsInput) SetDescending(v bool) *DescribeLogStreamsInput { - s.Descending = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeLogStreamsInput) SetLimit(v int64) *DescribeLogStreamsInput { - s.Limit = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *DescribeLogStreamsInput) SetLogGroupName(v string) *DescribeLogStreamsInput { - s.LogGroupName = &v - return s -} - -// SetLogStreamNamePrefix sets the LogStreamNamePrefix field's value. -func (s *DescribeLogStreamsInput) SetLogStreamNamePrefix(v string) *DescribeLogStreamsInput { - s.LogStreamNamePrefix = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLogStreamsInput) SetNextToken(v string) *DescribeLogStreamsInput { - s.NextToken = &v - return s -} - -// SetOrderBy sets the OrderBy field's value. -func (s *DescribeLogStreamsInput) SetOrderBy(v string) *DescribeLogStreamsInput { - s.OrderBy = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogStreamsResponse -type DescribeLogStreamsOutput struct { - _ struct{} `type:"structure"` - - // The log streams. - LogStreams []*LogStream `locationName:"logStreams" type:"list"` - - // The token for the next set of items to return. The token expires after 24 - // hours. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeLogStreamsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLogStreamsOutput) GoString() string { - return s.String() -} - -// SetLogStreams sets the LogStreams field's value. -func (s *DescribeLogStreamsOutput) SetLogStreams(v []*LogStream) *DescribeLogStreamsOutput { - s.LogStreams = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLogStreamsOutput) SetNextToken(v string) *DescribeLogStreamsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeMetricFiltersRequest -type DescribeMetricFiltersInput struct { - _ struct{} `type:"structure"` - - // The prefix to match. - FilterNamePrefix *string `locationName:"filterNamePrefix" min:"1" type:"string"` - - // The maximum number of items returned. If you don't specify a value, the default - // is up to 50 items. - Limit *int64 `locationName:"limit" min:"1" type:"integer"` - - // The name of the log group. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // The name of the CloudWatch metric. - MetricName *string `locationName:"metricName" type:"string"` - - // The namespace of the CloudWatch metric. - MetricNamespace *string `locationName:"metricNamespace" type:"string"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeMetricFiltersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMetricFiltersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMetricFiltersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMetricFiltersInput"} - if s.FilterNamePrefix != nil && len(*s.FilterNamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterNamePrefix", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterNamePrefix sets the FilterNamePrefix field's value. -func (s *DescribeMetricFiltersInput) SetFilterNamePrefix(v string) *DescribeMetricFiltersInput { - s.FilterNamePrefix = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeMetricFiltersInput) SetLimit(v int64) *DescribeMetricFiltersInput { - s.Limit = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *DescribeMetricFiltersInput) SetLogGroupName(v string) *DescribeMetricFiltersInput { - s.LogGroupName = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *DescribeMetricFiltersInput) SetMetricName(v string) *DescribeMetricFiltersInput { - s.MetricName = &v - return s -} - -// SetMetricNamespace sets the MetricNamespace field's value. -func (s *DescribeMetricFiltersInput) SetMetricNamespace(v string) *DescribeMetricFiltersInput { - s.MetricNamespace = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMetricFiltersInput) SetNextToken(v string) *DescribeMetricFiltersInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeMetricFiltersResponse -type DescribeMetricFiltersOutput struct { - _ struct{} `type:"structure"` - - // The metric filters. - MetricFilters []*MetricFilter `locationName:"metricFilters" type:"list"` - - // The token for the next set of items to return. The token expires after 24 - // hours. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeMetricFiltersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMetricFiltersOutput) GoString() string { - return s.String() -} - -// SetMetricFilters sets the MetricFilters field's value. -func (s *DescribeMetricFiltersOutput) SetMetricFilters(v []*MetricFilter) *DescribeMetricFiltersOutput { - s.MetricFilters = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMetricFiltersOutput) SetNextToken(v string) *DescribeMetricFiltersOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeSubscriptionFiltersRequest -type DescribeSubscriptionFiltersInput struct { - _ struct{} `type:"structure"` - - // The prefix to match. If you don't specify a value, no prefix filter is applied. - FilterNamePrefix *string `locationName:"filterNamePrefix" min:"1" type:"string"` - - // The maximum number of items returned. If you don't specify a value, the default - // is up to 50 items. - Limit *int64 `locationName:"limit" min:"1" type:"integer"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeSubscriptionFiltersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSubscriptionFiltersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSubscriptionFiltersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSubscriptionFiltersInput"} - if s.FilterNamePrefix != nil && len(*s.FilterNamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterNamePrefix", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterNamePrefix sets the FilterNamePrefix field's value. -func (s *DescribeSubscriptionFiltersInput) SetFilterNamePrefix(v string) *DescribeSubscriptionFiltersInput { - s.FilterNamePrefix = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeSubscriptionFiltersInput) SetLimit(v int64) *DescribeSubscriptionFiltersInput { - s.Limit = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *DescribeSubscriptionFiltersInput) SetLogGroupName(v string) *DescribeSubscriptionFiltersInput { - s.LogGroupName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSubscriptionFiltersInput) SetNextToken(v string) *DescribeSubscriptionFiltersInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeSubscriptionFiltersResponse -type DescribeSubscriptionFiltersOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of items to return. The token expires after 24 - // hours. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The subscription filters. - SubscriptionFilters []*SubscriptionFilter `locationName:"subscriptionFilters" type:"list"` -} - -// String returns the string representation -func (s DescribeSubscriptionFiltersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSubscriptionFiltersOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSubscriptionFiltersOutput) SetNextToken(v string) *DescribeSubscriptionFiltersOutput { - s.NextToken = &v - return s -} - -// SetSubscriptionFilters sets the SubscriptionFilters field's value. -func (s *DescribeSubscriptionFiltersOutput) SetSubscriptionFilters(v []*SubscriptionFilter) *DescribeSubscriptionFiltersOutput { - s.SubscriptionFilters = v - return s -} - -// Represents a cross-account destination that receives subscription log events. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/Destination -type Destination struct { - _ struct{} `type:"structure"` - - // An IAM policy document that governs which AWS accounts can create subscription - // filters against this destination. - AccessPolicy *string `locationName:"accessPolicy" min:"1" type:"string"` - - // The ARN of this destination. - Arn *string `locationName:"arn" type:"string"` - - // The creation time of the destination. - CreationTime *int64 `locationName:"creationTime" type:"long"` - - // The name of the destination. - DestinationName *string `locationName:"destinationName" min:"1" type:"string"` - - // A role for impersonation, used when delivering log events to the target. - RoleArn *string `locationName:"roleArn" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the physical target where the log events - // will be delivered (for example, a Kinesis stream). - TargetArn *string `locationName:"targetArn" min:"1" type:"string"` -} - -// 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() -} - -// SetAccessPolicy sets the AccessPolicy field's value. -func (s *Destination) SetAccessPolicy(v string) *Destination { - s.AccessPolicy = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Destination) SetArn(v string) *Destination { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *Destination) SetCreationTime(v int64) *Destination { - s.CreationTime = &v - return s -} - -// SetDestinationName sets the DestinationName field's value. -func (s *Destination) SetDestinationName(v string) *Destination { - s.DestinationName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *Destination) SetRoleArn(v string) *Destination { - s.RoleArn = &v - return s -} - -// SetTargetArn sets the TargetArn field's value. -func (s *Destination) SetTargetArn(v string) *Destination { - s.TargetArn = &v - return s -} - -// Represents an export task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ExportTask -type ExportTask struct { - _ struct{} `type:"structure"` - - // The name of Amazon S3 bucket to which the log data was exported. - Destination *string `locationName:"destination" min:"1" type:"string"` - - // The prefix that was used as the start of Amazon S3 key for every object exported. - DestinationPrefix *string `locationName:"destinationPrefix" type:"string"` - - // Execution info about the export task. - ExecutionInfo *ExportTaskExecutionInfo `locationName:"executionInfo" type:"structure"` - - // The start time, expressed as the number of milliseconds since Jan 1, 1970 - // 00:00:00 UTC. Events with a timestamp prior to this time are not exported. - From *int64 `locationName:"from" type:"long"` - - // The name of the log group from which logs data was exported. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // The status of the export task. - Status *ExportTaskStatus `locationName:"status" type:"structure"` - - // The ID of the export task. - TaskId *string `locationName:"taskId" min:"1" type:"string"` - - // The name of the export task. - TaskName *string `locationName:"taskName" min:"1" type:"string"` - - // The end time, expressed as the number of milliseconds since Jan 1, 1970 00:00:00 - // UTC. Events with a timestamp later than this time are not exported. - To *int64 `locationName:"to" type:"long"` -} - -// 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() -} - -// SetDestination sets the Destination field's value. -func (s *ExportTask) SetDestination(v string) *ExportTask { - s.Destination = &v - return s -} - -// SetDestinationPrefix sets the DestinationPrefix field's value. -func (s *ExportTask) SetDestinationPrefix(v string) *ExportTask { - s.DestinationPrefix = &v - return s -} - -// SetExecutionInfo sets the ExecutionInfo field's value. -func (s *ExportTask) SetExecutionInfo(v *ExportTaskExecutionInfo) *ExportTask { - s.ExecutionInfo = v - return s -} - -// SetFrom sets the From field's value. -func (s *ExportTask) SetFrom(v int64) *ExportTask { - s.From = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *ExportTask) SetLogGroupName(v string) *ExportTask { - s.LogGroupName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ExportTask) SetStatus(v *ExportTaskStatus) *ExportTask { - s.Status = v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *ExportTask) SetTaskId(v string) *ExportTask { - s.TaskId = &v - return s -} - -// SetTaskName sets the TaskName field's value. -func (s *ExportTask) SetTaskName(v string) *ExportTask { - s.TaskName = &v - return s -} - -// SetTo sets the To field's value. -func (s *ExportTask) SetTo(v int64) *ExportTask { - s.To = &v - return s -} - -// Represents the status of an export task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ExportTaskExecutionInfo -type ExportTaskExecutionInfo struct { - _ struct{} `type:"structure"` - - // The completion time of the export task. - CompletionTime *int64 `locationName:"completionTime" type:"long"` - - // The creation time of the export task. - CreationTime *int64 `locationName:"creationTime" type:"long"` -} - -// String returns the string representation -func (s ExportTaskExecutionInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportTaskExecutionInfo) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *ExportTaskExecutionInfo) SetCompletionTime(v int64) *ExportTaskExecutionInfo { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ExportTaskExecutionInfo) SetCreationTime(v int64) *ExportTaskExecutionInfo { - s.CreationTime = &v - return s -} - -// Represents the status of an export task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ExportTaskStatus -type ExportTaskStatus struct { - _ struct{} `type:"structure"` - - // The status code of the export task. - Code *string `locationName:"code" type:"string" enum:"ExportTaskStatusCode"` - - // The status message related to the status code. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s ExportTaskStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportTaskStatus) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ExportTaskStatus) SetCode(v string) *ExportTaskStatus { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ExportTaskStatus) SetMessage(v string) *ExportTaskStatus { - s.Message = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/FilterLogEventsRequest -type FilterLogEventsInput struct { - _ struct{} `type:"structure"` - - // The end of the time range, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are - // not returned. - EndTime *int64 `locationName:"endTime" type:"long"` - - // The filter pattern to use. If not provided, all the events are matched. - FilterPattern *string `locationName:"filterPattern" type:"string"` - - // If the value is true, the operation makes a best effort to provide responses - // that contain events from multiple log streams within the log group interleaved - // in a single response. If the value is false all the matched log events in - // the first log stream are searched first, then those in the next log stream, - // and so on. The default is false. - Interleaved *bool `locationName:"interleaved" type:"boolean"` - - // The maximum number of events to return. The default is 10,000 events. - Limit *int64 `locationName:"limit" min:"1" type:"integer"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // Optional list of log stream names. - LogStreamNames []*string `locationName:"logStreamNames" min:"1" type:"list"` - - // The token for the next set of events to return. (You received this token - // from a previous call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The start of the time range, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. Events with a timestamp prior to this time are - // not returned. - StartTime *int64 `locationName:"startTime" type:"long"` -} - -// String returns the string representation -func (s FilterLogEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FilterLogEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FilterLogEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FilterLogEventsInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.LogStreamNames != nil && len(s.LogStreamNames) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogStreamNames", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *FilterLogEventsInput) SetEndTime(v int64) *FilterLogEventsInput { - s.EndTime = &v - return s -} - -// SetFilterPattern sets the FilterPattern field's value. -func (s *FilterLogEventsInput) SetFilterPattern(v string) *FilterLogEventsInput { - s.FilterPattern = &v - return s -} - -// SetInterleaved sets the Interleaved field's value. -func (s *FilterLogEventsInput) SetInterleaved(v bool) *FilterLogEventsInput { - s.Interleaved = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *FilterLogEventsInput) SetLimit(v int64) *FilterLogEventsInput { - s.Limit = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *FilterLogEventsInput) SetLogGroupName(v string) *FilterLogEventsInput { - s.LogGroupName = &v - return s -} - -// SetLogStreamNames sets the LogStreamNames field's value. -func (s *FilterLogEventsInput) SetLogStreamNames(v []*string) *FilterLogEventsInput { - s.LogStreamNames = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *FilterLogEventsInput) SetNextToken(v string) *FilterLogEventsInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *FilterLogEventsInput) SetStartTime(v int64) *FilterLogEventsInput { - s.StartTime = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/FilterLogEventsResponse -type FilterLogEventsOutput struct { - _ struct{} `type:"structure"` - - // The matched events. - Events []*FilteredLogEvent `locationName:"events" type:"list"` - - // The token to use when requesting the next set of items. The token expires - // after 24 hours. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Indicates which log streams have been searched and whether each has been - // searched completely. - SearchedLogStreams []*SearchedLogStream `locationName:"searchedLogStreams" type:"list"` -} - -// String returns the string representation -func (s FilterLogEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FilterLogEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *FilterLogEventsOutput) SetEvents(v []*FilteredLogEvent) *FilterLogEventsOutput { - s.Events = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *FilterLogEventsOutput) SetNextToken(v string) *FilterLogEventsOutput { - s.NextToken = &v - return s -} - -// SetSearchedLogStreams sets the SearchedLogStreams field's value. -func (s *FilterLogEventsOutput) SetSearchedLogStreams(v []*SearchedLogStream) *FilterLogEventsOutput { - s.SearchedLogStreams = v - return s -} - -// Represents a matched event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/FilteredLogEvent -type FilteredLogEvent struct { - _ struct{} `type:"structure"` - - // The ID of the event. - EventId *string `locationName:"eventId" type:"string"` - - // The time the event was ingested. - IngestionTime *int64 `locationName:"ingestionTime" type:"long"` - - // The name of the log stream this event belongs to. - LogStreamName *string `locationName:"logStreamName" min:"1" type:"string"` - - // The data contained in the log event. - Message *string `locationName:"message" min:"1" type:"string"` - - // The time the event occurred, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. - Timestamp *int64 `locationName:"timestamp" type:"long"` -} - -// String returns the string representation -func (s FilteredLogEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FilteredLogEvent) GoString() string { - return s.String() -} - -// SetEventId sets the EventId field's value. -func (s *FilteredLogEvent) SetEventId(v string) *FilteredLogEvent { - s.EventId = &v - return s -} - -// SetIngestionTime sets the IngestionTime field's value. -func (s *FilteredLogEvent) SetIngestionTime(v int64) *FilteredLogEvent { - s.IngestionTime = &v - return s -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *FilteredLogEvent) SetLogStreamName(v string) *FilteredLogEvent { - s.LogStreamName = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *FilteredLogEvent) SetMessage(v string) *FilteredLogEvent { - s.Message = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *FilteredLogEvent) SetTimestamp(v int64) *FilteredLogEvent { - s.Timestamp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogEventsRequest -type GetLogEventsInput struct { - _ struct{} `type:"structure"` - - // The end of the time range, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are - // not included. - EndTime *int64 `locationName:"endTime" type:"long"` - - // The maximum number of log events returned. If you don't specify a value, - // the maximum is as many log events as can fit in a response size of 1MB, up - // to 10,000 log events. - Limit *int64 `locationName:"limit" min:"1" type:"integer"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The name of the log stream. - // - // LogStreamName is a required field - LogStreamName *string `locationName:"logStreamName" min:"1" type:"string" required:"true"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // If the value is true, the earliest log events are returned first. If the - // value is false, the latest log events are returned first. The default value - // is false. - StartFromHead *bool `locationName:"startFromHead" type:"boolean"` - - // The start of the time range, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. Events with a timestamp earlier than this time - // are not included. - StartTime *int64 `locationName:"startTime" type:"long"` -} - -// String returns the string representation -func (s GetLogEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetLogEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetLogEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetLogEventsInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.LogStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("LogStreamName")) - } - if s.LogStreamName != nil && len(*s.LogStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *GetLogEventsInput) SetEndTime(v int64) *GetLogEventsInput { - s.EndTime = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *GetLogEventsInput) SetLimit(v int64) *GetLogEventsInput { - s.Limit = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *GetLogEventsInput) SetLogGroupName(v string) *GetLogEventsInput { - s.LogGroupName = &v - return s -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *GetLogEventsInput) SetLogStreamName(v string) *GetLogEventsInput { - s.LogStreamName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetLogEventsInput) SetNextToken(v string) *GetLogEventsInput { - s.NextToken = &v - return s -} - -// SetStartFromHead sets the StartFromHead field's value. -func (s *GetLogEventsInput) SetStartFromHead(v bool) *GetLogEventsInput { - s.StartFromHead = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetLogEventsInput) SetStartTime(v int64) *GetLogEventsInput { - s.StartTime = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogEventsResponse -type GetLogEventsOutput struct { - _ struct{} `type:"structure"` - - // The events. - Events []*OutputLogEvent `locationName:"events" type:"list"` - - // The token for the next set of items in the backward direction. The token - // expires after 24 hours. - NextBackwardToken *string `locationName:"nextBackwardToken" min:"1" type:"string"` - - // The token for the next set of items in the forward direction. The token expires - // after 24 hours. - NextForwardToken *string `locationName:"nextForwardToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetLogEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetLogEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *GetLogEventsOutput) SetEvents(v []*OutputLogEvent) *GetLogEventsOutput { - s.Events = v - return s -} - -// SetNextBackwardToken sets the NextBackwardToken field's value. -func (s *GetLogEventsOutput) SetNextBackwardToken(v string) *GetLogEventsOutput { - s.NextBackwardToken = &v - return s -} - -// SetNextForwardToken sets the NextForwardToken field's value. -func (s *GetLogEventsOutput) SetNextForwardToken(v string) *GetLogEventsOutput { - s.NextForwardToken = &v - return s -} - -// Represents a log event, which is a record of activity that was recorded by -// the application or resource being monitored. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/InputLogEvent -type InputLogEvent struct { - _ struct{} `type:"structure"` - - // The raw event message. - // - // Message is a required field - Message *string `locationName:"message" min:"1" type:"string" required:"true"` - - // The time the event occurred, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. - // - // Timestamp is a required field - Timestamp *int64 `locationName:"timestamp" type:"long" required:"true"` -} - -// String returns the string representation -func (s InputLogEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InputLogEvent) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputLogEvent) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputLogEvent"} - if s.Message == nil { - invalidParams.Add(request.NewErrParamRequired("Message")) - } - if s.Message != nil && len(*s.Message) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Message", 1)) - } - if s.Timestamp == nil { - invalidParams.Add(request.NewErrParamRequired("Timestamp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMessage sets the Message field's value. -func (s *InputLogEvent) SetMessage(v string) *InputLogEvent { - s.Message = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *InputLogEvent) SetTimestamp(v int64) *InputLogEvent { - s.Timestamp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ListTagsLogGroupRequest -type ListTagsLogGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTagsLogGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsLogGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsLogGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsLogGroupInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *ListTagsLogGroupInput) SetLogGroupName(v string) *ListTagsLogGroupInput { - s.LogGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ListTagsLogGroupResponse -type ListTagsLogGroupOutput struct { - _ struct{} `type:"structure"` - - // The tags. - Tags map[string]*string `locationName:"tags" min:"1" type:"map"` -} - -// String returns the string representation -func (s ListTagsLogGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsLogGroupOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsLogGroupOutput) SetTags(v map[string]*string) *ListTagsLogGroupOutput { - s.Tags = v - return s -} - -// Represents a log group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/LogGroup -type LogGroup struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the log group. - Arn *string `locationName:"arn" type:"string"` - - // The creation time of the log group. - CreationTime *int64 `locationName:"creationTime" type:"long"` - - // The name of the log group. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // The number of metric filters. - MetricFilterCount *int64 `locationName:"metricFilterCount" type:"integer"` - - // The number of days to retain the log events in the specified log group. Possible - // values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, - // 1827, and 3653. - RetentionInDays *int64 `locationName:"retentionInDays" type:"integer"` - - // The number of bytes stored. - StoredBytes *int64 `locationName:"storedBytes" type:"long"` -} - -// String returns the string representation -func (s LogGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LogGroup) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *LogGroup) SetArn(v string) *LogGroup { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *LogGroup) SetCreationTime(v int64) *LogGroup { - s.CreationTime = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *LogGroup) SetLogGroupName(v string) *LogGroup { - s.LogGroupName = &v - return s -} - -// SetMetricFilterCount sets the MetricFilterCount field's value. -func (s *LogGroup) SetMetricFilterCount(v int64) *LogGroup { - s.MetricFilterCount = &v - return s -} - -// SetRetentionInDays sets the RetentionInDays field's value. -func (s *LogGroup) SetRetentionInDays(v int64) *LogGroup { - s.RetentionInDays = &v - return s -} - -// SetStoredBytes sets the StoredBytes field's value. -func (s *LogGroup) SetStoredBytes(v int64) *LogGroup { - s.StoredBytes = &v - return s -} - -// Represents a log stream, which is a sequence of log events from a single -// emitter of logs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/LogStream -type LogStream struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the log stream. - Arn *string `locationName:"arn" type:"string"` - - // The creation time of the stream. - CreationTime *int64 `locationName:"creationTime" type:"long"` - - // The time of the first event, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. - FirstEventTimestamp *int64 `locationName:"firstEventTimestamp" type:"long"` - - // The time of the last event, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. - LastEventTimestamp *int64 `locationName:"lastEventTimestamp" type:"long"` - - // The ingestion time. - LastIngestionTime *int64 `locationName:"lastIngestionTime" type:"long"` - - // The name of the log stream. - LogStreamName *string `locationName:"logStreamName" min:"1" type:"string"` - - // The number of bytes stored. - StoredBytes *int64 `locationName:"storedBytes" type:"long"` - - // The sequence token. - UploadSequenceToken *string `locationName:"uploadSequenceToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s LogStream) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LogStream) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *LogStream) SetArn(v string) *LogStream { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *LogStream) SetCreationTime(v int64) *LogStream { - s.CreationTime = &v - return s -} - -// SetFirstEventTimestamp sets the FirstEventTimestamp field's value. -func (s *LogStream) SetFirstEventTimestamp(v int64) *LogStream { - s.FirstEventTimestamp = &v - return s -} - -// SetLastEventTimestamp sets the LastEventTimestamp field's value. -func (s *LogStream) SetLastEventTimestamp(v int64) *LogStream { - s.LastEventTimestamp = &v - return s -} - -// SetLastIngestionTime sets the LastIngestionTime field's value. -func (s *LogStream) SetLastIngestionTime(v int64) *LogStream { - s.LastIngestionTime = &v - return s -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *LogStream) SetLogStreamName(v string) *LogStream { - s.LogStreamName = &v - return s -} - -// SetStoredBytes sets the StoredBytes field's value. -func (s *LogStream) SetStoredBytes(v int64) *LogStream { - s.StoredBytes = &v - return s -} - -// SetUploadSequenceToken sets the UploadSequenceToken field's value. -func (s *LogStream) SetUploadSequenceToken(v string) *LogStream { - s.UploadSequenceToken = &v - return s -} - -// Metric filters express how CloudWatch Logs would extract metric observations -// from ingested log events and transform them into metric data in a CloudWatch -// metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/MetricFilter -type MetricFilter struct { - _ struct{} `type:"structure"` - - // The creation time of the metric filter. - CreationTime *int64 `locationName:"creationTime" type:"long"` - - // The name of the metric filter. - FilterName *string `locationName:"filterName" min:"1" type:"string"` - - // A symbolic description of how CloudWatch Logs should interpret the data in - // each log event. For example, a log event may contain timestamps, IP addresses, - // strings, and so on. You use the filter pattern to specify what to look for - // in the log event message. - FilterPattern *string `locationName:"filterPattern" type:"string"` - - // The name of the log group. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // The metric transformations. - MetricTransformations []*MetricTransformation `locationName:"metricTransformations" min:"1" type:"list"` -} - -// String returns the string representation -func (s MetricFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricFilter) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *MetricFilter) SetCreationTime(v int64) *MetricFilter { - s.CreationTime = &v - return s -} - -// SetFilterName sets the FilterName field's value. -func (s *MetricFilter) SetFilterName(v string) *MetricFilter { - s.FilterName = &v - return s -} - -// SetFilterPattern sets the FilterPattern field's value. -func (s *MetricFilter) SetFilterPattern(v string) *MetricFilter { - s.FilterPattern = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *MetricFilter) SetLogGroupName(v string) *MetricFilter { - s.LogGroupName = &v - return s -} - -// SetMetricTransformations sets the MetricTransformations field's value. -func (s *MetricFilter) SetMetricTransformations(v []*MetricTransformation) *MetricFilter { - s.MetricTransformations = v - return s -} - -// Represents a matched event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/MetricFilterMatchRecord -type MetricFilterMatchRecord struct { - _ struct{} `type:"structure"` - - // The raw event data. - EventMessage *string `locationName:"eventMessage" min:"1" type:"string"` - - // The event number. - EventNumber *int64 `locationName:"eventNumber" type:"long"` - - // The values extracted from the event data by the filter. - ExtractedValues map[string]*string `locationName:"extractedValues" type:"map"` -} - -// String returns the string representation -func (s MetricFilterMatchRecord) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricFilterMatchRecord) GoString() string { - return s.String() -} - -// SetEventMessage sets the EventMessage field's value. -func (s *MetricFilterMatchRecord) SetEventMessage(v string) *MetricFilterMatchRecord { - s.EventMessage = &v - return s -} - -// SetEventNumber sets the EventNumber field's value. -func (s *MetricFilterMatchRecord) SetEventNumber(v int64) *MetricFilterMatchRecord { - s.EventNumber = &v - return s -} - -// SetExtractedValues sets the ExtractedValues field's value. -func (s *MetricFilterMatchRecord) SetExtractedValues(v map[string]*string) *MetricFilterMatchRecord { - s.ExtractedValues = v - return s -} - -// Indicates how to transform ingested log events into metric data in a CloudWatch -// metric. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/MetricTransformation -type MetricTransformation struct { - _ struct{} `type:"structure"` - - // (Optional) The value to emit when a filter pattern does not match a log event. - // This value can be null. - DefaultValue *float64 `locationName:"defaultValue" type:"double"` - - // The name of the CloudWatch metric. - // - // MetricName is a required field - MetricName *string `locationName:"metricName" type:"string" required:"true"` - - // The namespace of the CloudWatch metric. - // - // MetricNamespace is a required field - MetricNamespace *string `locationName:"metricNamespace" type:"string" required:"true"` - - // The value to publish to the CloudWatch metric when a filter pattern matches - // a log event. - // - // MetricValue is a required field - MetricValue *string `locationName:"metricValue" type:"string" required:"true"` -} - -// String returns the string representation -func (s MetricTransformation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricTransformation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricTransformation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricTransformation"} - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.MetricNamespace == nil { - invalidParams.Add(request.NewErrParamRequired("MetricNamespace")) - } - if s.MetricValue == nil { - invalidParams.Add(request.NewErrParamRequired("MetricValue")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *MetricTransformation) SetDefaultValue(v float64) *MetricTransformation { - s.DefaultValue = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *MetricTransformation) SetMetricName(v string) *MetricTransformation { - s.MetricName = &v - return s -} - -// SetMetricNamespace sets the MetricNamespace field's value. -func (s *MetricTransformation) SetMetricNamespace(v string) *MetricTransformation { - s.MetricNamespace = &v - return s -} - -// SetMetricValue sets the MetricValue field's value. -func (s *MetricTransformation) SetMetricValue(v string) *MetricTransformation { - s.MetricValue = &v - return s -} - -// Represents a log event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/OutputLogEvent -type OutputLogEvent struct { - _ struct{} `type:"structure"` - - // The time the event was ingested. - IngestionTime *int64 `locationName:"ingestionTime" type:"long"` - - // The data contained in the log event. - Message *string `locationName:"message" min:"1" type:"string"` - - // The time the event occurred, expressed as the number of milliseconds since - // Jan 1, 1970 00:00:00 UTC. - Timestamp *int64 `locationName:"timestamp" type:"long"` -} - -// String returns the string representation -func (s OutputLogEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OutputLogEvent) GoString() string { - return s.String() -} - -// SetIngestionTime sets the IngestionTime field's value. -func (s *OutputLogEvent) SetIngestionTime(v int64) *OutputLogEvent { - s.IngestionTime = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *OutputLogEvent) SetMessage(v string) *OutputLogEvent { - s.Message = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *OutputLogEvent) SetTimestamp(v int64) *OutputLogEvent { - s.Timestamp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestinationRequest -type PutDestinationInput struct { - _ struct{} `type:"structure"` - - // A name for the destination. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" min:"1" type:"string" required:"true"` - - // The ARN of an IAM role that grants CloudWatch Logs permissions to call Amazon - // Kinesis PutRecord on the destination stream. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"1" type:"string" required:"true"` - - // The ARN of an Amazon Kinesis stream to deliver matching log events to. - // - // TargetArn is a required field - TargetArn *string `locationName:"targetArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutDestinationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutDestinationInput"} - if s.DestinationName == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationName")) - } - if s.DestinationName != nil && len(*s.DestinationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - if s.TargetArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetArn")) - } - if s.TargetArn != nil && len(*s.TargetArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationName sets the DestinationName field's value. -func (s *PutDestinationInput) SetDestinationName(v string) *PutDestinationInput { - s.DestinationName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *PutDestinationInput) SetRoleArn(v string) *PutDestinationInput { - s.RoleArn = &v - return s -} - -// SetTargetArn sets the TargetArn field's value. -func (s *PutDestinationInput) SetTargetArn(v string) *PutDestinationInput { - s.TargetArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestinationResponse -type PutDestinationOutput struct { - _ struct{} `type:"structure"` - - // The destination. - Destination *Destination `locationName:"destination" type:"structure"` -} - -// String returns the string representation -func (s PutDestinationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutDestinationOutput) GoString() string { - return s.String() -} - -// SetDestination sets the Destination field's value. -func (s *PutDestinationOutput) SetDestination(v *Destination) *PutDestinationOutput { - s.Destination = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestinationPolicyRequest -type PutDestinationPolicyInput struct { - _ struct{} `type:"structure"` - - // An IAM policy document that authorizes cross-account users to deliver their - // log events to the associated destination. - // - // AccessPolicy is a required field - AccessPolicy *string `locationName:"accessPolicy" min:"1" type:"string" required:"true"` - - // A name for an existing destination. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutDestinationPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutDestinationPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutDestinationPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutDestinationPolicyInput"} - if s.AccessPolicy == nil { - invalidParams.Add(request.NewErrParamRequired("AccessPolicy")) - } - if s.AccessPolicy != nil && len(*s.AccessPolicy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AccessPolicy", 1)) - } - if s.DestinationName == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationName")) - } - if s.DestinationName != nil && len(*s.DestinationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessPolicy sets the AccessPolicy field's value. -func (s *PutDestinationPolicyInput) SetAccessPolicy(v string) *PutDestinationPolicyInput { - s.AccessPolicy = &v - return s -} - -// SetDestinationName sets the DestinationName field's value. -func (s *PutDestinationPolicyInput) SetDestinationName(v string) *PutDestinationPolicyInput { - s.DestinationName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestinationPolicyOutput -type PutDestinationPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutDestinationPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutDestinationPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutLogEventsRequest -type PutLogEventsInput struct { - _ struct{} `type:"structure"` - - // The log events. - // - // LogEvents is a required field - LogEvents []*InputLogEvent `locationName:"logEvents" min:"1" type:"list" required:"true"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The name of the log stream. - // - // LogStreamName is a required field - LogStreamName *string `locationName:"logStreamName" min:"1" type:"string" required:"true"` - - // The sequence token. - SequenceToken *string `locationName:"sequenceToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s PutLogEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutLogEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutLogEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutLogEventsInput"} - if s.LogEvents == nil { - invalidParams.Add(request.NewErrParamRequired("LogEvents")) - } - if s.LogEvents != nil && len(s.LogEvents) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogEvents", 1)) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.LogStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("LogStreamName")) - } - if s.LogStreamName != nil && len(*s.LogStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1)) - } - if s.SequenceToken != nil && len(*s.SequenceToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SequenceToken", 1)) - } - if s.LogEvents != nil { - for i, v := range s.LogEvents { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LogEvents", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogEvents sets the LogEvents field's value. -func (s *PutLogEventsInput) SetLogEvents(v []*InputLogEvent) *PutLogEventsInput { - s.LogEvents = v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *PutLogEventsInput) SetLogGroupName(v string) *PutLogEventsInput { - s.LogGroupName = &v - return s -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *PutLogEventsInput) SetLogStreamName(v string) *PutLogEventsInput { - s.LogStreamName = &v - return s -} - -// SetSequenceToken sets the SequenceToken field's value. -func (s *PutLogEventsInput) SetSequenceToken(v string) *PutLogEventsInput { - s.SequenceToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutLogEventsResponse -type PutLogEventsOutput struct { - _ struct{} `type:"structure"` - - // The next sequence token. - NextSequenceToken *string `locationName:"nextSequenceToken" min:"1" type:"string"` - - // The rejected events. - RejectedLogEventsInfo *RejectedLogEventsInfo `locationName:"rejectedLogEventsInfo" type:"structure"` -} - -// String returns the string representation -func (s PutLogEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutLogEventsOutput) GoString() string { - return s.String() -} - -// SetNextSequenceToken sets the NextSequenceToken field's value. -func (s *PutLogEventsOutput) SetNextSequenceToken(v string) *PutLogEventsOutput { - s.NextSequenceToken = &v - return s -} - -// SetRejectedLogEventsInfo sets the RejectedLogEventsInfo field's value. -func (s *PutLogEventsOutput) SetRejectedLogEventsInfo(v *RejectedLogEventsInfo) *PutLogEventsOutput { - s.RejectedLogEventsInfo = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutMetricFilterRequest -type PutMetricFilterInput struct { - _ struct{} `type:"structure"` - - // A name for the metric filter. - // - // FilterName is a required field - FilterName *string `locationName:"filterName" min:"1" type:"string" required:"true"` - - // A filter pattern for extracting metric data out of ingested log events. - // - // FilterPattern is a required field - FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // A collection of information needed to define how metric data gets emitted. - // - // MetricTransformations is a required field - MetricTransformations []*MetricTransformation `locationName:"metricTransformations" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PutMetricFilterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutMetricFilterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutMetricFilterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutMetricFilterInput"} - if s.FilterName == nil { - invalidParams.Add(request.NewErrParamRequired("FilterName")) - } - if s.FilterName != nil && len(*s.FilterName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterName", 1)) - } - if s.FilterPattern == nil { - invalidParams.Add(request.NewErrParamRequired("FilterPattern")) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.MetricTransformations == nil { - invalidParams.Add(request.NewErrParamRequired("MetricTransformations")) - } - if s.MetricTransformations != nil && len(s.MetricTransformations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricTransformations", 1)) - } - if s.MetricTransformations != nil { - for i, v := range s.MetricTransformations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricTransformations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterName sets the FilterName field's value. -func (s *PutMetricFilterInput) SetFilterName(v string) *PutMetricFilterInput { - s.FilterName = &v - return s -} - -// SetFilterPattern sets the FilterPattern field's value. -func (s *PutMetricFilterInput) SetFilterPattern(v string) *PutMetricFilterInput { - s.FilterPattern = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *PutMetricFilterInput) SetLogGroupName(v string) *PutMetricFilterInput { - s.LogGroupName = &v - return s -} - -// SetMetricTransformations sets the MetricTransformations field's value. -func (s *PutMetricFilterInput) SetMetricTransformations(v []*MetricTransformation) *PutMetricFilterInput { - s.MetricTransformations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutMetricFilterOutput -type PutMetricFilterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutMetricFilterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutMetricFilterOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutRetentionPolicyRequest -type PutRetentionPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The number of days to retain the log events in the specified log group. Possible - // values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, - // 1827, and 3653. - // - // RetentionInDays is a required field - RetentionInDays *int64 `locationName:"retentionInDays" type:"integer" required:"true"` -} - -// String returns the string representation -func (s PutRetentionPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRetentionPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRetentionPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRetentionPolicyInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.RetentionInDays == nil { - invalidParams.Add(request.NewErrParamRequired("RetentionInDays")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *PutRetentionPolicyInput) SetLogGroupName(v string) *PutRetentionPolicyInput { - s.LogGroupName = &v - return s -} - -// SetRetentionInDays sets the RetentionInDays field's value. -func (s *PutRetentionPolicyInput) SetRetentionInDays(v int64) *PutRetentionPolicyInput { - s.RetentionInDays = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutRetentionPolicyOutput -type PutRetentionPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutRetentionPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRetentionPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutSubscriptionFilterRequest -type PutSubscriptionFilterInput struct { - _ struct{} `type:"structure"` - - // The ARN of the destination to deliver matching log events to. Currently, - // the supported destinations are: - // - // * An Amazon Kinesis stream belonging to the same account as the subscription - // filter, for same-account delivery. - // - // * A logical destination (specified using an ARN) belonging to a different - // account, for cross-account delivery. - // - // * An Amazon Kinesis Firehose stream belonging to the same account as the - // subscription filter, for same-account delivery. - // - // * An AWS Lambda function belonging to the same account as the subscription - // filter, for same-account delivery. - // - // DestinationArn is a required field - DestinationArn *string `locationName:"destinationArn" min:"1" type:"string" required:"true"` - - // The method used to distribute log data to the destination, when the destination - // is an Amazon Kinesis stream. By default, log data is grouped by log stream. - // For a more even distribution, you can group log data randomly. - Distribution *string `locationName:"distribution" type:"string" enum:"Distribution"` - - // A name for the subscription filter. - // - // FilterName is a required field - FilterName *string `locationName:"filterName" min:"1" type:"string" required:"true"` - - // A filter pattern for subscribing to a filtered stream of log events. - // - // FilterPattern is a required field - FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The ARN of an IAM role that grants CloudWatch Logs permissions to deliver - // ingested log events to the destination stream. You don't need to provide - // the ARN when you are working with a logical destination for cross-account - // delivery. - RoleArn *string `locationName:"roleArn" min:"1" type:"string"` -} - -// String returns the string representation -func (s PutSubscriptionFilterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutSubscriptionFilterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutSubscriptionFilterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutSubscriptionFilterInput"} - if s.DestinationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationArn")) - } - if s.DestinationArn != nil && len(*s.DestinationArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DestinationArn", 1)) - } - if s.FilterName == nil { - invalidParams.Add(request.NewErrParamRequired("FilterName")) - } - if s.FilterName != nil && len(*s.FilterName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterName", 1)) - } - if s.FilterPattern == nil { - invalidParams.Add(request.NewErrParamRequired("FilterPattern")) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *PutSubscriptionFilterInput) SetDestinationArn(v string) *PutSubscriptionFilterInput { - s.DestinationArn = &v - return s -} - -// SetDistribution sets the Distribution field's value. -func (s *PutSubscriptionFilterInput) SetDistribution(v string) *PutSubscriptionFilterInput { - s.Distribution = &v - return s -} - -// SetFilterName sets the FilterName field's value. -func (s *PutSubscriptionFilterInput) SetFilterName(v string) *PutSubscriptionFilterInput { - s.FilterName = &v - return s -} - -// SetFilterPattern sets the FilterPattern field's value. -func (s *PutSubscriptionFilterInput) SetFilterPattern(v string) *PutSubscriptionFilterInput { - s.FilterPattern = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *PutSubscriptionFilterInput) SetLogGroupName(v string) *PutSubscriptionFilterInput { - s.LogGroupName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *PutSubscriptionFilterInput) SetRoleArn(v string) *PutSubscriptionFilterInput { - s.RoleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutSubscriptionFilterOutput -type PutSubscriptionFilterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutSubscriptionFilterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutSubscriptionFilterOutput) GoString() string { - return s.String() -} - -// Represents the rejected events. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/RejectedLogEventsInfo -type RejectedLogEventsInfo struct { - _ struct{} `type:"structure"` - - // The expired log events. - ExpiredLogEventEndIndex *int64 `locationName:"expiredLogEventEndIndex" type:"integer"` - - // The log events that are too new. - TooNewLogEventStartIndex *int64 `locationName:"tooNewLogEventStartIndex" type:"integer"` - - // The log events that are too old. - TooOldLogEventEndIndex *int64 `locationName:"tooOldLogEventEndIndex" type:"integer"` -} - -// String returns the string representation -func (s RejectedLogEventsInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RejectedLogEventsInfo) GoString() string { - return s.String() -} - -// SetExpiredLogEventEndIndex sets the ExpiredLogEventEndIndex field's value. -func (s *RejectedLogEventsInfo) SetExpiredLogEventEndIndex(v int64) *RejectedLogEventsInfo { - s.ExpiredLogEventEndIndex = &v - return s -} - -// SetTooNewLogEventStartIndex sets the TooNewLogEventStartIndex field's value. -func (s *RejectedLogEventsInfo) SetTooNewLogEventStartIndex(v int64) *RejectedLogEventsInfo { - s.TooNewLogEventStartIndex = &v - return s -} - -// SetTooOldLogEventEndIndex sets the TooOldLogEventEndIndex field's value. -func (s *RejectedLogEventsInfo) SetTooOldLogEventEndIndex(v int64) *RejectedLogEventsInfo { - s.TooOldLogEventEndIndex = &v - return s -} - -// Represents the search status of a log stream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/SearchedLogStream -type SearchedLogStream struct { - _ struct{} `type:"structure"` - - // The name of the log stream. - LogStreamName *string `locationName:"logStreamName" min:"1" type:"string"` - - // Indicates whether all the events in this log stream were searched. - SearchedCompletely *bool `locationName:"searchedCompletely" type:"boolean"` -} - -// String returns the string representation -func (s SearchedLogStream) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SearchedLogStream) GoString() string { - return s.String() -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *SearchedLogStream) SetLogStreamName(v string) *SearchedLogStream { - s.LogStreamName = &v - return s -} - -// SetSearchedCompletely sets the SearchedCompletely field's value. -func (s *SearchedLogStream) SetSearchedCompletely(v bool) *SearchedLogStream { - s.SearchedCompletely = &v - return s -} - -// Represents a subscription filter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/SubscriptionFilter -type SubscriptionFilter struct { - _ struct{} `type:"structure"` - - // The creation time of the subscription filter. - CreationTime *int64 `locationName:"creationTime" type:"long"` - - // The Amazon Resource Name (ARN) of the destination. - DestinationArn *string `locationName:"destinationArn" min:"1" type:"string"` - - // The method used to distribute log data to the destination, when the destination - // is an Amazon Kinesis stream. - Distribution *string `locationName:"distribution" type:"string" enum:"Distribution"` - - // The name of the subscription filter. - FilterName *string `locationName:"filterName" min:"1" type:"string"` - - // A symbolic description of how CloudWatch Logs should interpret the data in - // each log event. For example, a log event may contain timestamps, IP addresses, - // strings, and so on. You use the filter pattern to specify what to look for - // in the log event message. - FilterPattern *string `locationName:"filterPattern" type:"string"` - - // The name of the log group. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - RoleArn *string `locationName:"roleArn" min:"1" type:"string"` -} - -// String returns the string representation -func (s SubscriptionFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubscriptionFilter) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *SubscriptionFilter) SetCreationTime(v int64) *SubscriptionFilter { - s.CreationTime = &v - return s -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *SubscriptionFilter) SetDestinationArn(v string) *SubscriptionFilter { - s.DestinationArn = &v - return s -} - -// SetDistribution sets the Distribution field's value. -func (s *SubscriptionFilter) SetDistribution(v string) *SubscriptionFilter { - s.Distribution = &v - return s -} - -// SetFilterName sets the FilterName field's value. -func (s *SubscriptionFilter) SetFilterName(v string) *SubscriptionFilter { - s.FilterName = &v - return s -} - -// SetFilterPattern sets the FilterPattern field's value. -func (s *SubscriptionFilter) SetFilterPattern(v string) *SubscriptionFilter { - s.FilterPattern = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *SubscriptionFilter) SetLogGroupName(v string) *SubscriptionFilter { - s.LogGroupName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *SubscriptionFilter) SetRoleArn(v string) *SubscriptionFilter { - s.RoleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TagLogGroupRequest -type TagLogGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The key-value pairs to use for the tags. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" min:"1" type:"map" required:"true"` -} - -// String returns the string representation -func (s TagLogGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagLogGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagLogGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagLogGroupInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 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 -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *TagLogGroupInput) SetLogGroupName(v string) *TagLogGroupInput { - s.LogGroupName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagLogGroupInput) SetTags(v map[string]*string) *TagLogGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TagLogGroupOutput -type TagLogGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s TagLogGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagLogGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TestMetricFilterRequest -type TestMetricFilterInput struct { - _ struct{} `type:"structure"` - - // A symbolic description of how CloudWatch Logs should interpret the data in - // each log event. For example, a log event may contain timestamps, IP addresses, - // strings, and so on. You use the filter pattern to specify what to look for - // in the log event message. - // - // FilterPattern is a required field - FilterPattern *string `locationName:"filterPattern" type:"string" required:"true"` - - // The log event messages to test. - // - // LogEventMessages is a required field - LogEventMessages []*string `locationName:"logEventMessages" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s TestMetricFilterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestMetricFilterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestMetricFilterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestMetricFilterInput"} - if s.FilterPattern == nil { - invalidParams.Add(request.NewErrParamRequired("FilterPattern")) - } - if s.LogEventMessages == nil { - invalidParams.Add(request.NewErrParamRequired("LogEventMessages")) - } - if s.LogEventMessages != nil && len(s.LogEventMessages) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogEventMessages", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterPattern sets the FilterPattern field's value. -func (s *TestMetricFilterInput) SetFilterPattern(v string) *TestMetricFilterInput { - s.FilterPattern = &v - return s -} - -// SetLogEventMessages sets the LogEventMessages field's value. -func (s *TestMetricFilterInput) SetLogEventMessages(v []*string) *TestMetricFilterInput { - s.LogEventMessages = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TestMetricFilterResponse -type TestMetricFilterOutput struct { - _ struct{} `type:"structure"` - - // The matched events. - Matches []*MetricFilterMatchRecord `locationName:"matches" type:"list"` -} - -// String returns the string representation -func (s TestMetricFilterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestMetricFilterOutput) GoString() string { - return s.String() -} - -// SetMatches sets the Matches field's value. -func (s *TestMetricFilterOutput) SetMatches(v []*MetricFilterMatchRecord) *TestMetricFilterOutput { - s.Matches = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/UntagLogGroupRequest -type UntagLogGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The tag keys. The corresponding tags are removed from the log group. - // - // Tags is a required field - Tags []*string `locationName:"tags" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s UntagLogGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UntagLogGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagLogGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagLogGroupInput"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 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 -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *UntagLogGroupInput) SetLogGroupName(v string) *UntagLogGroupInput { - s.LogGroupName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *UntagLogGroupInput) SetTags(v []*string) *UntagLogGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/UntagLogGroupOutput -type UntagLogGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UntagLogGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UntagLogGroupOutput) GoString() string { - return s.String() -} - -const ( - // DistributionRandom is a Distribution enum value - DistributionRandom = "Random" - - // DistributionByLogStream is a Distribution enum value - DistributionByLogStream = "ByLogStream" -) - -const ( - // ExportTaskStatusCodeCancelled is a ExportTaskStatusCode enum value - ExportTaskStatusCodeCancelled = "CANCELLED" - - // ExportTaskStatusCodeCompleted is a ExportTaskStatusCode enum value - ExportTaskStatusCodeCompleted = "COMPLETED" - - // ExportTaskStatusCodeFailed is a ExportTaskStatusCode enum value - ExportTaskStatusCodeFailed = "FAILED" - - // ExportTaskStatusCodePending is a ExportTaskStatusCode enum value - ExportTaskStatusCodePending = "PENDING" - - // ExportTaskStatusCodePendingCancel is a ExportTaskStatusCode enum value - ExportTaskStatusCodePendingCancel = "PENDING_CANCEL" - - // ExportTaskStatusCodeRunning is a ExportTaskStatusCode enum value - ExportTaskStatusCodeRunning = "RUNNING" -) - -const ( - // OrderByLogStreamName is a OrderBy enum value - OrderByLogStreamName = "LogStreamName" - - // OrderByLastEventTime is a OrderBy enum value - OrderByLastEventTime = "LastEventTime" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go deleted file mode 100644 index de1b3fd..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go +++ /dev/null @@ -1,60 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudwatchlogs - -const ( - - // ErrCodeDataAlreadyAcceptedException for service response error code - // "DataAlreadyAcceptedException". - // - // The event was already logged. - ErrCodeDataAlreadyAcceptedException = "DataAlreadyAcceptedException" - - // ErrCodeInvalidOperationException for service response error code - // "InvalidOperationException". - // - // The operation is not valid on the specified resource. - ErrCodeInvalidOperationException = "InvalidOperationException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // A parameter is specified incorrectly. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeInvalidSequenceTokenException for service response error code - // "InvalidSequenceTokenException". - // - // The sequence token is not valid. - ErrCodeInvalidSequenceTokenException = "InvalidSequenceTokenException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // You have reached the maximum number of resources that can be created. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeOperationAbortedException for service response error code - // "OperationAbortedException". - // - // Multiple requests to update the same resource were in conflict. - ErrCodeOperationAbortedException = "OperationAbortedException" - - // ErrCodeResourceAlreadyExistsException for service response error code - // "ResourceAlreadyExistsException". - // - // The specified resource already exists. - ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - // - // The service cannot complete the request. - ErrCodeServiceUnavailableException = "ServiceUnavailableException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go deleted file mode 100644 index e161f96..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go +++ /dev/null @@ -1,122 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudwatchlogs - -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" -) - -// You can use Amazon CloudWatch Logs to monitor, store, and access your log -// files from EC2 instances, Amazon CloudTrail, or other sources. You can then -// retrieve the associated log data from CloudWatch Logs using the Amazon CloudWatch -// console, the CloudWatch Logs commands in the AWS CLI, the CloudWatch Logs -// API, or the CloudWatch Logs SDK. -// -// You can use CloudWatch Logs to: -// -// * Monitor Logs from Amazon EC2 Instances in Real-time: You can use CloudWatch -// Logs to monitor applications and systems using log data. For example, -// CloudWatch Logs can track the number of errors that occur in your application -// logs and send you a notification whenever the rate of errors exceeds a -// threshold you specify. CloudWatch Logs uses your log data for monitoring; -// so, no code changes are required. For example, you can monitor application -// logs for specific literal terms (such as "NullReferenceException") or -// count the number of occurrences of a literal term at a particular position -// in log data (such as "404" status codes in an Apache access log). When -// the term you are searching for is found, CloudWatch Logs reports the data -// to a Amazon CloudWatch metric that you specify. -// -// * Monitor Amazon CloudTrail Logged Events: You can create alarms in Amazon -// CloudWatch and receive notifications of particular API activity as captured -// by CloudTrail and use the notification to perform troubleshooting. -// -// * Archive Log Data: You can use CloudWatch Logs to store your log data -// in highly durable storage. You can change the log retention setting so -// that any log events older than this setting are automatically deleted. -// The CloudWatch Logs agent makes it easy to quickly send both rotated and -// non-rotated log data off of a host and into the log service. You can then -// access the raw log data when you need it. -// 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/logs-2014-03-28 -type CloudWatchLogs 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 = "logs" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CloudWatchLogs 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 CloudWatchLogs client from just a session. -// svc := cloudwatchlogs.New(mySession) -// -// // Create a CloudWatchLogs client with additional configuration -// svc := cloudwatchlogs.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatchLogs { - 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) *CloudWatchLogs { - svc := &CloudWatchLogs{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-03-28", - JSONVersion: "1.1", - TargetPrefix: "Logs_20140328", - }, - 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 CloudWatchLogs operation and runs any -// custom request initialization. -func (c *CloudWatchLogs) 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/codebuild/api.go b/vendor/github.com/aws/aws-sdk-go/service/codebuild/api.go deleted file mode 100644 index ebef335..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/api.go +++ /dev/null @@ -1,3253 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package codebuild provides a client for AWS CodeBuild. -package codebuild - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opBatchGetBuilds = "BatchGetBuilds" - -// BatchGetBuildsRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetBuilds operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetBuilds for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetBuilds method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetBuildsRequest method. -// req, resp := client.BatchGetBuildsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetBuilds -func (c *CodeBuild) BatchGetBuildsRequest(input *BatchGetBuildsInput) (req *request.Request, output *BatchGetBuildsOutput) { - op := &request.Operation{ - Name: opBatchGetBuilds, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetBuildsInput{} - } - - output = &BatchGetBuildsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetBuilds API operation for AWS CodeBuild. -// -// Gets information about builds. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation BatchGetBuilds for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetBuilds -func (c *CodeBuild) BatchGetBuilds(input *BatchGetBuildsInput) (*BatchGetBuildsOutput, error) { - req, out := c.BatchGetBuildsRequest(input) - err := req.Send() - return out, err -} - -const opBatchGetProjects = "BatchGetProjects" - -// BatchGetProjectsRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetProjects operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetProjects for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetProjects method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetProjectsRequest method. -// req, resp := client.BatchGetProjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetProjects -func (c *CodeBuild) BatchGetProjectsRequest(input *BatchGetProjectsInput) (req *request.Request, output *BatchGetProjectsOutput) { - op := &request.Operation{ - Name: opBatchGetProjects, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetProjectsInput{} - } - - output = &BatchGetProjectsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetProjects API operation for AWS CodeBuild. -// -// Gets information about build projects. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation BatchGetProjects for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetProjects -func (c *CodeBuild) BatchGetProjects(input *BatchGetProjectsInput) (*BatchGetProjectsOutput, error) { - req, out := c.BatchGetProjectsRequest(input) - err := req.Send() - return out, err -} - -const opCreateProject = "CreateProject" - -// CreateProjectRequest generates a "aws/request.Request" representing the -// client's request for the CreateProject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateProject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateProject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateProjectRequest method. -// req, resp := client.CreateProjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateProject -func (c *CodeBuild) CreateProjectRequest(input *CreateProjectInput) (req *request.Request, output *CreateProjectOutput) { - op := &request.Operation{ - Name: opCreateProject, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateProjectInput{} - } - - output = &CreateProjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateProject API operation for AWS CodeBuild. -// -// Creates a build project. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation CreateProject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// The specified AWS resource cannot be created, because an AWS resource with -// the same settings already exists. -// -// * ErrCodeAccountLimitExceededException "AccountLimitExceededException" -// An AWS service limit was exceeded for the calling AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateProject -func (c *CodeBuild) CreateProject(input *CreateProjectInput) (*CreateProjectOutput, error) { - req, out := c.CreateProjectRequest(input) - err := req.Send() - return out, err -} - -const opDeleteProject = "DeleteProject" - -// DeleteProjectRequest generates a "aws/request.Request" representing the -// client's request for the DeleteProject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteProject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteProject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteProjectRequest method. -// req, resp := client.DeleteProjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteProject -func (c *CodeBuild) DeleteProjectRequest(input *DeleteProjectInput) (req *request.Request, output *DeleteProjectOutput) { - op := &request.Operation{ - Name: opDeleteProject, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteProjectInput{} - } - - output = &DeleteProjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteProject API operation for AWS CodeBuild. -// -// Deletes a build project. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation DeleteProject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteProject -func (c *CodeBuild) DeleteProject(input *DeleteProjectInput) (*DeleteProjectOutput, error) { - req, out := c.DeleteProjectRequest(input) - err := req.Send() - return out, err -} - -const opListBuilds = "ListBuilds" - -// ListBuildsRequest generates a "aws/request.Request" representing the -// client's request for the ListBuilds operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListBuilds for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListBuilds method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListBuildsRequest method. -// req, resp := client.ListBuildsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuilds -func (c *CodeBuild) ListBuildsRequest(input *ListBuildsInput) (req *request.Request, output *ListBuildsOutput) { - op := &request.Operation{ - Name: opListBuilds, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListBuildsInput{} - } - - output = &ListBuildsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBuilds API operation for AWS CodeBuild. -// -// Gets a list of build IDs, with each build ID representing a single build. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation ListBuilds for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuilds -func (c *CodeBuild) ListBuilds(input *ListBuildsInput) (*ListBuildsOutput, error) { - req, out := c.ListBuildsRequest(input) - err := req.Send() - return out, err -} - -const opListBuildsForProject = "ListBuildsForProject" - -// ListBuildsForProjectRequest generates a "aws/request.Request" representing the -// client's request for the ListBuildsForProject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListBuildsForProject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListBuildsForProject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListBuildsForProjectRequest method. -// req, resp := client.ListBuildsForProjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuildsForProject -func (c *CodeBuild) ListBuildsForProjectRequest(input *ListBuildsForProjectInput) (req *request.Request, output *ListBuildsForProjectOutput) { - op := &request.Operation{ - Name: opListBuildsForProject, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListBuildsForProjectInput{} - } - - output = &ListBuildsForProjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBuildsForProject API operation for AWS CodeBuild. -// -// Gets a list of build IDs for the specified build project, with each build -// ID representing a single build. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation ListBuildsForProject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified AWS resource cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuildsForProject -func (c *CodeBuild) ListBuildsForProject(input *ListBuildsForProjectInput) (*ListBuildsForProjectOutput, error) { - req, out := c.ListBuildsForProjectRequest(input) - err := req.Send() - return out, err -} - -const opListCuratedEnvironmentImages = "ListCuratedEnvironmentImages" - -// ListCuratedEnvironmentImagesRequest generates a "aws/request.Request" representing the -// client's request for the ListCuratedEnvironmentImages operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListCuratedEnvironmentImages for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListCuratedEnvironmentImages method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListCuratedEnvironmentImagesRequest method. -// req, resp := client.ListCuratedEnvironmentImagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListCuratedEnvironmentImages -func (c *CodeBuild) ListCuratedEnvironmentImagesRequest(input *ListCuratedEnvironmentImagesInput) (req *request.Request, output *ListCuratedEnvironmentImagesOutput) { - op := &request.Operation{ - Name: opListCuratedEnvironmentImages, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListCuratedEnvironmentImagesInput{} - } - - output = &ListCuratedEnvironmentImagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCuratedEnvironmentImages API operation for AWS CodeBuild. -// -// Gets information about Docker images that are managed by AWS CodeBuild. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation ListCuratedEnvironmentImages for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListCuratedEnvironmentImages -func (c *CodeBuild) ListCuratedEnvironmentImages(input *ListCuratedEnvironmentImagesInput) (*ListCuratedEnvironmentImagesOutput, error) { - req, out := c.ListCuratedEnvironmentImagesRequest(input) - err := req.Send() - return out, err -} - -const opListProjects = "ListProjects" - -// ListProjectsRequest generates a "aws/request.Request" representing the -// client's request for the ListProjects operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListProjects for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListProjects method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListProjectsRequest method. -// req, resp := client.ListProjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListProjects -func (c *CodeBuild) ListProjectsRequest(input *ListProjectsInput) (req *request.Request, output *ListProjectsOutput) { - op := &request.Operation{ - Name: opListProjects, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListProjectsInput{} - } - - output = &ListProjectsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProjects API operation for AWS CodeBuild. -// -// Gets a list of build project names, with each build project name representing -// a single build project. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation ListProjects for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListProjects -func (c *CodeBuild) ListProjects(input *ListProjectsInput) (*ListProjectsOutput, error) { - req, out := c.ListProjectsRequest(input) - err := req.Send() - return out, err -} - -const opStartBuild = "StartBuild" - -// StartBuildRequest generates a "aws/request.Request" representing the -// client's request for the StartBuild operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartBuild for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartBuild method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartBuildRequest method. -// req, resp := client.StartBuildRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StartBuild -func (c *CodeBuild) StartBuildRequest(input *StartBuildInput) (req *request.Request, output *StartBuildOutput) { - op := &request.Operation{ - Name: opStartBuild, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartBuildInput{} - } - - output = &StartBuildOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartBuild API operation for AWS CodeBuild. -// -// Starts running a build. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation StartBuild for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified AWS resource cannot be found. -// -// * ErrCodeAccountLimitExceededException "AccountLimitExceededException" -// An AWS service limit was exceeded for the calling AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StartBuild -func (c *CodeBuild) StartBuild(input *StartBuildInput) (*StartBuildOutput, error) { - req, out := c.StartBuildRequest(input) - err := req.Send() - return out, err -} - -const opStopBuild = "StopBuild" - -// StopBuildRequest generates a "aws/request.Request" representing the -// client's request for the StopBuild operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopBuild for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopBuild method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopBuildRequest method. -// req, resp := client.StopBuildRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StopBuild -func (c *CodeBuild) StopBuildRequest(input *StopBuildInput) (req *request.Request, output *StopBuildOutput) { - op := &request.Operation{ - Name: opStopBuild, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopBuildInput{} - } - - output = &StopBuildOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopBuild API operation for AWS CodeBuild. -// -// Attempts to stop running a build. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation StopBuild for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified AWS resource cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StopBuild -func (c *CodeBuild) StopBuild(input *StopBuildInput) (*StopBuildOutput, error) { - req, out := c.StopBuildRequest(input) - err := req.Send() - return out, err -} - -const opUpdateProject = "UpdateProject" - -// UpdateProjectRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateProject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateProject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateProjectRequest method. -// req, resp := client.UpdateProjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateProject -func (c *CodeBuild) UpdateProjectRequest(input *UpdateProjectInput) (req *request.Request, output *UpdateProjectOutput) { - op := &request.Operation{ - Name: opUpdateProject, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateProjectInput{} - } - - output = &UpdateProjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateProject API operation for AWS CodeBuild. -// -// Changes the settings of a build project. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeBuild's -// API operation UpdateProject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" -// The input value that was provided is not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified AWS resource cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateProject -func (c *CodeBuild) UpdateProject(input *UpdateProjectInput) (*UpdateProjectOutput, error) { - req, out := c.UpdateProjectRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetBuildsInput -type BatchGetBuildsInput struct { - _ struct{} `type:"structure"` - - // The IDs of the builds. - // - // Ids is a required field - Ids []*string `locationName:"ids" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s BatchGetBuildsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetBuildsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetBuildsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetBuildsInput"} - if s.Ids == nil { - invalidParams.Add(request.NewErrParamRequired("Ids")) - } - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIds sets the Ids field's value. -func (s *BatchGetBuildsInput) SetIds(v []*string) *BatchGetBuildsInput { - s.Ids = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetBuildsOutput -type BatchGetBuildsOutput struct { - _ struct{} `type:"structure"` - - // Information about the requested builds. - Builds []*Build `locationName:"builds" type:"list"` - - // The IDs of builds for which information could not be found. - BuildsNotFound []*string `locationName:"buildsNotFound" min:"1" type:"list"` -} - -// String returns the string representation -func (s BatchGetBuildsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetBuildsOutput) GoString() string { - return s.String() -} - -// SetBuilds sets the Builds field's value. -func (s *BatchGetBuildsOutput) SetBuilds(v []*Build) *BatchGetBuildsOutput { - s.Builds = v - return s -} - -// SetBuildsNotFound sets the BuildsNotFound field's value. -func (s *BatchGetBuildsOutput) SetBuildsNotFound(v []*string) *BatchGetBuildsOutput { - s.BuildsNotFound = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetProjectsInput -type BatchGetProjectsInput struct { - _ struct{} `type:"structure"` - - // The names of the build projects. - // - // Names is a required field - Names []*string `locationName:"names" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s BatchGetProjectsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetProjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetProjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetProjectsInput"} - if s.Names == nil { - invalidParams.Add(request.NewErrParamRequired("Names")) - } - if s.Names != nil && len(s.Names) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Names", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNames sets the Names field's value. -func (s *BatchGetProjectsInput) SetNames(v []*string) *BatchGetProjectsInput { - s.Names = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetProjectsOutput -type BatchGetProjectsOutput struct { - _ struct{} `type:"structure"` - - // Information about the requested build projects. - Projects []*Project `locationName:"projects" type:"list"` - - // The names of build projects for which information could not be found. - ProjectsNotFound []*string `locationName:"projectsNotFound" min:"1" type:"list"` -} - -// String returns the string representation -func (s BatchGetProjectsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetProjectsOutput) GoString() string { - return s.String() -} - -// SetProjects sets the Projects field's value. -func (s *BatchGetProjectsOutput) SetProjects(v []*Project) *BatchGetProjectsOutput { - s.Projects = v - return s -} - -// SetProjectsNotFound sets the ProjectsNotFound field's value. -func (s *BatchGetProjectsOutput) SetProjectsNotFound(v []*string) *BatchGetProjectsOutput { - s.ProjectsNotFound = v - return s -} - -// Information about a build. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/Build -type Build struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the build. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // Information about the output artifacts for the build. - Artifacts *BuildArtifacts `locationName:"artifacts" type:"structure"` - - // Whether the build has finished. True if completed; otherwise, false. - BuildComplete *bool `locationName:"buildComplete" type:"boolean"` - - // The current status of the build. Valid values include: - // - // * FAILED: The build failed. - // - // * FAULT: The build faulted. - // - // * IN_PROGRESS: The build is still in progress. - // - // * STOPPED: The build stopped. - // - // * SUCCEEDED: The build succeeded. - // - // * TIMED_OUT: The build timed out. - BuildStatus *string `locationName:"buildStatus" type:"string" enum:"StatusType"` - - // The current build phase. - CurrentPhase *string `locationName:"currentPhase" type:"string"` - - // When the build process ended, expressed in Unix time format. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix"` - - // Information about the build environment for this build. - Environment *ProjectEnvironment `locationName:"environment" type:"structure"` - - // The unique ID for the build. - Id *string `locationName:"id" min:"1" type:"string"` - - // The entity that started the build. Valid values include: - // - // * If AWS CodePipeline started the build, the pipeline's name (for example, - // codepipeline/my-demo-pipeline). - // - // * If an AWS Identity and Access Management (IAM) user started the build, - // the user's name (for example MyUserName). - // - // * If the Jenkins plugin for AWS CodeBuild started the build, the string - // CodeBuild-Jenkins-Plugin. - Initiator *string `locationName:"initiator" type:"string"` - - // Information about the build's logs in Amazon CloudWatch Logs. - Logs *LogsLocation `locationName:"logs" type:"structure"` - - // Information about all previous build phases that are completed and information - // about any current build phase that is not yet complete. - Phases []*BuildPhase `locationName:"phases" type:"list"` - - // The name of the build project. - ProjectName *string `locationName:"projectName" min:"1" type:"string"` - - // Information about the source code to be built. - Source *ProjectSource `locationName:"source" type:"structure"` - - // Any version identifier for the version of the source code to be built. - SourceVersion *string `locationName:"sourceVersion" min:"1" type:"string"` - - // When the build process started, expressed in Unix time format. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"` - - // How long, in minutes, for AWS CodeBuild to wait before timing out this build - // if it does not get marked as completed. - TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" type:"integer"` -} - -// String returns the string representation -func (s Build) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Build) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Build) SetArn(v string) *Build { - s.Arn = &v - return s -} - -// SetArtifacts sets the Artifacts field's value. -func (s *Build) SetArtifacts(v *BuildArtifacts) *Build { - s.Artifacts = v - return s -} - -// SetBuildComplete sets the BuildComplete field's value. -func (s *Build) SetBuildComplete(v bool) *Build { - s.BuildComplete = &v - return s -} - -// SetBuildStatus sets the BuildStatus field's value. -func (s *Build) SetBuildStatus(v string) *Build { - s.BuildStatus = &v - return s -} - -// SetCurrentPhase sets the CurrentPhase field's value. -func (s *Build) SetCurrentPhase(v string) *Build { - s.CurrentPhase = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *Build) SetEndTime(v time.Time) *Build { - s.EndTime = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *Build) SetEnvironment(v *ProjectEnvironment) *Build { - s.Environment = v - return s -} - -// SetId sets the Id field's value. -func (s *Build) SetId(v string) *Build { - s.Id = &v - return s -} - -// SetInitiator sets the Initiator field's value. -func (s *Build) SetInitiator(v string) *Build { - s.Initiator = &v - return s -} - -// SetLogs sets the Logs field's value. -func (s *Build) SetLogs(v *LogsLocation) *Build { - s.Logs = v - return s -} - -// SetPhases sets the Phases field's value. -func (s *Build) SetPhases(v []*BuildPhase) *Build { - s.Phases = v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *Build) SetProjectName(v string) *Build { - s.ProjectName = &v - return s -} - -// SetSource sets the Source field's value. -func (s *Build) SetSource(v *ProjectSource) *Build { - s.Source = v - return s -} - -// SetSourceVersion sets the SourceVersion field's value. -func (s *Build) SetSourceVersion(v string) *Build { - s.SourceVersion = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Build) SetStartTime(v time.Time) *Build { - s.StartTime = &v - return s -} - -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *Build) SetTimeoutInMinutes(v int64) *Build { - s.TimeoutInMinutes = &v - return s -} - -// Information about build output artifacts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BuildArtifacts -type BuildArtifacts struct { - _ struct{} `type:"structure"` - - // Information about the location of the build artifacts. - Location *string `locationName:"location" type:"string"` - - // The MD5 hash of the build artifact. - // - // You can use this hash along with a checksum tool to confirm both file integrity - // and authenticity. - // - // This value is available only if the build project's packaging value is set - // to ZIP. - Md5sum *string `locationName:"md5sum" type:"string"` - - // The SHA-256 hash of the build artifact. - // - // You can use this hash along with a checksum tool to confirm both file integrity - // and authenticity. - // - // This value is available only if the build project's packaging value is set - // to ZIP. - Sha256sum *string `locationName:"sha256sum" type:"string"` -} - -// String returns the string representation -func (s BuildArtifacts) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BuildArtifacts) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *BuildArtifacts) SetLocation(v string) *BuildArtifacts { - s.Location = &v - return s -} - -// SetMd5sum sets the Md5sum field's value. -func (s *BuildArtifacts) SetMd5sum(v string) *BuildArtifacts { - s.Md5sum = &v - return s -} - -// SetSha256sum sets the Sha256sum field's value. -func (s *BuildArtifacts) SetSha256sum(v string) *BuildArtifacts { - s.Sha256sum = &v - return s -} - -// Information about a stage for a build. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BuildPhase -type BuildPhase struct { - _ struct{} `type:"structure"` - - // Additional information about a build phase, especially to help troubleshoot - // a failed build. - Contexts []*PhaseContext `locationName:"contexts" type:"list"` - - // How long, in seconds, between the starting and ending times of the build's - // phase. - DurationInSeconds *int64 `locationName:"durationInSeconds" type:"long"` - - // When the build phase ended, expressed in Unix time format. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix"` - - // The current status of the build phase. Valid values include: - // - // * FAILED: The build phase failed. - // - // * FAULT: The build phase faulted. - // - // * IN_PROGRESS: The build phase is still in progress. - // - // * STOPPED: The build phase stopped. - // - // * SUCCEEDED: The build phase succeeded. - // - // * TIMED_OUT: The build phase timed out. - PhaseStatus *string `locationName:"phaseStatus" type:"string" enum:"StatusType"` - - // The name of the build phase. Valid values include: - // - // * BUILD: Core build activities typically occur in this build phase. - // - // * COMPLETED: The build has been completed. - // - // * DOWNLOAD_SOURCE: Source code is being downloaded in this build phase. - // - // * FINALIZING: The build process is completing in this build phase. - // - // * INSTALL: Installation activities typically occur in this build phase. - // - // * POST_BUILD: Post-build activities typically occur in this build phase. - // - // * PRE_BUILD: Pre-build activities typically occur in this build phase. - // - // * PROVISIONING: The build environment is being set up. - // - // * SUBMITTED: The build has been submitted. - // - // * UPLOAD_ARTIFACTS: Build output artifacts are being uploaded to the output - // location. - PhaseType *string `locationName:"phaseType" type:"string" enum:"BuildPhaseType"` - - // When the build phase started, expressed in Unix time format. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s BuildPhase) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BuildPhase) GoString() string { - return s.String() -} - -// SetContexts sets the Contexts field's value. -func (s *BuildPhase) SetContexts(v []*PhaseContext) *BuildPhase { - s.Contexts = v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *BuildPhase) SetDurationInSeconds(v int64) *BuildPhase { - s.DurationInSeconds = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *BuildPhase) SetEndTime(v time.Time) *BuildPhase { - s.EndTime = &v - return s -} - -// SetPhaseStatus sets the PhaseStatus field's value. -func (s *BuildPhase) SetPhaseStatus(v string) *BuildPhase { - s.PhaseStatus = &v - return s -} - -// SetPhaseType sets the PhaseType field's value. -func (s *BuildPhase) SetPhaseType(v string) *BuildPhase { - s.PhaseType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *BuildPhase) SetStartTime(v time.Time) *BuildPhase { - s.StartTime = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateProjectInput -type CreateProjectInput struct { - _ struct{} `type:"structure"` - - // Information about the build output artifacts for the build project. - // - // Artifacts is a required field - Artifacts *ProjectArtifacts `locationName:"artifacts" type:"structure" required:"true"` - - // A description that makes the build project easy to identify. - Description *string `locationName:"description" type:"string"` - - // The AWS Key Management Service (AWS KMS) customer master key (CMK) to be - // used for encrypting the build output artifacts. - // - // You can specify either the CMK's Amazon Resource Name (ARN) or, if available, - // the CMK's alias (using the format alias/alias-name). - EncryptionKey *string `locationName:"encryptionKey" min:"1" type:"string"` - - // Information about the build environment for the build project. - // - // Environment is a required field - Environment *ProjectEnvironment `locationName:"environment" type:"structure" required:"true"` - - // The name of the build project. - // - // Name is a required field - Name *string `locationName:"name" min:"2" type:"string" required:"true"` - - // The ARN of the AWS Identity and Access Management (IAM) role that enables - // AWS CodeBuild to interact with dependent AWS services on behalf of the AWS - // account. - ServiceRole *string `locationName:"serviceRole" min:"1" type:"string"` - - // Information about the build input source code for the build project. - // - // Source is a required field - Source *ProjectSource `locationName:"source" type:"structure" required:"true"` - - // A set of tags for this build project. - // - // These tags are available for use by AWS services that support AWS CodeBuild - // build project tags. - Tags []*Tag `locationName:"tags" type:"list"` - - // How long, in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait - // until timing out any build that has not been marked as completed. The default - // is 60 minutes. - TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"1" type:"integer"` -} - -// String returns the string representation -func (s CreateProjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateProjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateProjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateProjectInput"} - if s.Artifacts == nil { - invalidParams.Add(request.NewErrParamRequired("Artifacts")) - } - if s.EncryptionKey != nil && len(*s.EncryptionKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EncryptionKey", 1)) - } - if s.Environment == nil { - invalidParams.Add(request.NewErrParamRequired("Environment")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 2 { - invalidParams.Add(request.NewErrParamMinLen("Name", 2)) - } - if s.ServiceRole != nil && len(*s.ServiceRole) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServiceRole", 1)) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 1 { - invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 1)) - } - if s.Artifacts != nil { - if err := s.Artifacts.Validate(); err != nil { - invalidParams.AddNested("Artifacts", err.(request.ErrInvalidParams)) - } - } - if s.Environment != nil { - if err := s.Environment.Validate(); err != nil { - invalidParams.AddNested("Environment", err.(request.ErrInvalidParams)) - } - } - if s.Source != nil { - if err := s.Source.Validate(); err != nil { - invalidParams.AddNested("Source", 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 - } - return nil -} - -// SetArtifacts sets the Artifacts field's value. -func (s *CreateProjectInput) SetArtifacts(v *ProjectArtifacts) *CreateProjectInput { - s.Artifacts = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateProjectInput) SetDescription(v string) *CreateProjectInput { - s.Description = &v - return s -} - -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *CreateProjectInput) SetEncryptionKey(v string) *CreateProjectInput { - s.EncryptionKey = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *CreateProjectInput) SetEnvironment(v *ProjectEnvironment) *CreateProjectInput { - s.Environment = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateProjectInput) SetName(v string) *CreateProjectInput { - s.Name = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *CreateProjectInput) SetServiceRole(v string) *CreateProjectInput { - s.ServiceRole = &v - return s -} - -// SetSource sets the Source field's value. -func (s *CreateProjectInput) SetSource(v *ProjectSource) *CreateProjectInput { - s.Source = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateProjectInput) SetTags(v []*Tag) *CreateProjectInput { - s.Tags = v - return s -} - -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *CreateProjectInput) SetTimeoutInMinutes(v int64) *CreateProjectInput { - s.TimeoutInMinutes = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateProjectOutput -type CreateProjectOutput struct { - _ struct{} `type:"structure"` - - // Information about the build project that was created. - Project *Project `locationName:"project" type:"structure"` -} - -// String returns the string representation -func (s CreateProjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateProjectOutput) GoString() string { - return s.String() -} - -// SetProject sets the Project field's value. -func (s *CreateProjectOutput) SetProject(v *Project) *CreateProjectOutput { - s.Project = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteProjectInput -type DeleteProjectInput struct { - _ struct{} `type:"structure"` - - // The name of the build project. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteProjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteProjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteProjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteProjectInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteProjectInput) SetName(v string) *DeleteProjectInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteProjectOutput -type DeleteProjectOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteProjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteProjectOutput) GoString() string { - return s.String() -} - -// Information about a Docker image that is managed by AWS CodeBuild. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/EnvironmentImage -type EnvironmentImage struct { - _ struct{} `type:"structure"` - - // The description of the Docker image. - Description *string `locationName:"description" type:"string"` - - // The name of the Docker image. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s EnvironmentImage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentImage) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *EnvironmentImage) SetDescription(v string) *EnvironmentImage { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *EnvironmentImage) SetName(v string) *EnvironmentImage { - s.Name = &v - return s -} - -// A set of Docker images that are related by programming language and are managed -// by AWS CodeBuild. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/EnvironmentLanguage -type EnvironmentLanguage struct { - _ struct{} `type:"structure"` - - // The list of Docker images that are related by the specified programming language. - Images []*EnvironmentImage `locationName:"images" type:"list"` - - // The programming language for the Docker images. - Language *string `locationName:"language" type:"string" enum:"LanguageType"` -} - -// String returns the string representation -func (s EnvironmentLanguage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentLanguage) GoString() string { - return s.String() -} - -// SetImages sets the Images field's value. -func (s *EnvironmentLanguage) SetImages(v []*EnvironmentImage) *EnvironmentLanguage { - s.Images = v - return s -} - -// SetLanguage sets the Language field's value. -func (s *EnvironmentLanguage) SetLanguage(v string) *EnvironmentLanguage { - s.Language = &v - return s -} - -// A set of Docker images that are related by platform and are managed by AWS -// CodeBuild. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/EnvironmentPlatform -type EnvironmentPlatform struct { - _ struct{} `type:"structure"` - - // The list of programming languages that are available for the specified platform. - Languages []*EnvironmentLanguage `locationName:"languages" type:"list"` - - // The platform's name. - Platform *string `locationName:"platform" type:"string" enum:"PlatformType"` -} - -// String returns the string representation -func (s EnvironmentPlatform) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentPlatform) GoString() string { - return s.String() -} - -// SetLanguages sets the Languages field's value. -func (s *EnvironmentPlatform) SetLanguages(v []*EnvironmentLanguage) *EnvironmentPlatform { - s.Languages = v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *EnvironmentPlatform) SetPlatform(v string) *EnvironmentPlatform { - s.Platform = &v - return s -} - -// Information about an environment variable for a build project or a build. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/EnvironmentVariable -type EnvironmentVariable struct { - _ struct{} `type:"structure"` - - // The name or key of the environment variable. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The value of the environment variable. - // - // Value is a required field - Value *string `locationName:"value" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnvironmentVariable) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentVariable) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnvironmentVariable) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnvironmentVariable"} - 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.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *EnvironmentVariable) SetName(v string) *EnvironmentVariable { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *EnvironmentVariable) SetValue(v string) *EnvironmentVariable { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuildsForProjectInput -type ListBuildsForProjectInput struct { - _ struct{} `type:"structure"` - - // During a previous call, if there are more than 100 items in the list, only - // the first 100 items are returned, along with a unique string called a next - // token. To get the next batch of items in the list, call this operation again, - // adding the next token to the call. To get all of the items in the list, keep - // calling this operation with each subsequent next token that is returned, - // until no more next tokens are returned. - NextToken *string `locationName:"nextToken" type:"string"` - - // The name of the build project. - // - // ProjectName is a required field - ProjectName *string `locationName:"projectName" min:"1" type:"string" required:"true"` - - // The order to list build IDs. Valid values include: - // - // * ASCENDING: List the build IDs in ascending order by build ID. - // - // * DESCENDING: List the build IDs in descending order by build ID. - SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` -} - -// String returns the string representation -func (s ListBuildsForProjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBuildsForProjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBuildsForProjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBuildsForProjectInput"} - if s.ProjectName == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectName")) - } - if s.ProjectName != nil && len(*s.ProjectName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProjectName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBuildsForProjectInput) SetNextToken(v string) *ListBuildsForProjectInput { - s.NextToken = &v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *ListBuildsForProjectInput) SetProjectName(v string) *ListBuildsForProjectInput { - s.ProjectName = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListBuildsForProjectInput) SetSortOrder(v string) *ListBuildsForProjectInput { - s.SortOrder = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuildsForProjectOutput -type ListBuildsForProjectOutput struct { - _ struct{} `type:"structure"` - - // A list of build IDs for the specified build project, with each build ID representing - // a single build. - Ids []*string `locationName:"ids" min:"1" type:"list"` - - // If there are more than 100 items in the list, only the first 100 items are - // returned, along with a unique string called a next token. To get the next - // batch of items in the list, call this operation again, adding the next token - // to the call. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListBuildsForProjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBuildsForProjectOutput) GoString() string { - return s.String() -} - -// SetIds sets the Ids field's value. -func (s *ListBuildsForProjectOutput) SetIds(v []*string) *ListBuildsForProjectOutput { - s.Ids = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBuildsForProjectOutput) SetNextToken(v string) *ListBuildsForProjectOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuildsInput -type ListBuildsInput struct { - _ struct{} `type:"structure"` - - // During a previous call, if there are more than 100 items in the list, only - // the first 100 items are returned, along with a unique string called a next - // token. To get the next batch of items in the list, call this operation again, - // adding the next token to the call. To get all of the items in the list, keep - // calling this operation with each subsequent next token that is returned, - // until no more next tokens are returned. - NextToken *string `locationName:"nextToken" type:"string"` - - // The order to list build IDs. Valid values include: - // - // * ASCENDING: List the build IDs in ascending order by build ID. - // - // * DESCENDING: List the build IDs in descending order by build ID. - SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` -} - -// String returns the string representation -func (s ListBuildsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBuildsInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBuildsInput) SetNextToken(v string) *ListBuildsInput { - s.NextToken = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListBuildsInput) SetSortOrder(v string) *ListBuildsInput { - s.SortOrder = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuildsOutput -type ListBuildsOutput struct { - _ struct{} `type:"structure"` - - // A list of build IDs, with each build ID representing a single build. - Ids []*string `locationName:"ids" min:"1" type:"list"` - - // If there are more than 100 items in the list, only the first 100 items are - // returned, along with a unique string called a next token. To get the next - // batch of items in the list, call this operation again, adding the next token - // to the call. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListBuildsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBuildsOutput) GoString() string { - return s.String() -} - -// SetIds sets the Ids field's value. -func (s *ListBuildsOutput) SetIds(v []*string) *ListBuildsOutput { - s.Ids = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBuildsOutput) SetNextToken(v string) *ListBuildsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListCuratedEnvironmentImagesInput -type ListCuratedEnvironmentImagesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ListCuratedEnvironmentImagesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCuratedEnvironmentImagesInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListCuratedEnvironmentImagesOutput -type ListCuratedEnvironmentImagesOutput struct { - _ struct{} `type:"structure"` - - // Information about supported platforms for Docker images that are managed - // by AWS CodeBuild. - Platforms []*EnvironmentPlatform `locationName:"platforms" type:"list"` -} - -// String returns the string representation -func (s ListCuratedEnvironmentImagesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCuratedEnvironmentImagesOutput) GoString() string { - return s.String() -} - -// SetPlatforms sets the Platforms field's value. -func (s *ListCuratedEnvironmentImagesOutput) SetPlatforms(v []*EnvironmentPlatform) *ListCuratedEnvironmentImagesOutput { - s.Platforms = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListProjectsInput -type ListProjectsInput struct { - _ struct{} `type:"structure"` - - // During a previous call, if there are more than 100 items in the list, only - // the first 100 items are returned, along with a unique string called a next - // token. To get the next batch of items in the list, call this operation again, - // adding the next token to the call. To get all of the items in the list, keep - // calling this operation with each subsequent next token that is returned, - // until no more next tokens are returned. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The criterion to be used to list build project names. Valid values include: - // - // * CREATED_TIME: List the build project names based on when each build - // project was created. - // - // * LAST_MODIFIED_TIME: List the build project names based on when information - // about each build project was last changed. - // - // * NAME: List the build project names based on each build project's name. - // - // Use sortOrder to specify in what order to list the build project names based - // on the preceding criteria. - SortBy *string `locationName:"sortBy" type:"string" enum:"ProjectSortByType"` - - // The order in which to list build projects. Valid values include: - // - // * ASCENDING: List the build project names in ascending order. - // - // * DESCENDING: List the build project names in descending order. - // - // Use sortBy to specify the criterion to be used to list build project names. - SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` -} - -// String returns the string representation -func (s ListProjectsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListProjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProjectsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProjectsInput) SetNextToken(v string) *ListProjectsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListProjectsInput) SetSortBy(v string) *ListProjectsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListProjectsInput) SetSortOrder(v string) *ListProjectsInput { - s.SortOrder = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListProjectsOutput -type ListProjectsOutput struct { - _ struct{} `type:"structure"` - - // If there are more than 100 items in the list, only the first 100 items are - // returned, along with a unique string called a next token. To get the next - // batch of items in the list, call this operation again, adding the next token - // to the call. - NextToken *string `locationName:"nextToken" type:"string"` - - // The list of build project names, with each build project name representing - // a single build project. - Projects []*string `locationName:"projects" min:"1" type:"list"` -} - -// String returns the string representation -func (s ListProjectsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListProjectsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProjectsOutput) SetNextToken(v string) *ListProjectsOutput { - s.NextToken = &v - return s -} - -// SetProjects sets the Projects field's value. -func (s *ListProjectsOutput) SetProjects(v []*string) *ListProjectsOutput { - s.Projects = v - return s -} - -// Information about build logs in Amazon CloudWatch Logs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/LogsLocation -type LogsLocation struct { - _ struct{} `type:"structure"` - - // The URL to an individual build log in Amazon CloudWatch Logs. - DeepLink *string `locationName:"deepLink" type:"string"` - - // The name of the Amazon CloudWatch Logs group for the build logs. - GroupName *string `locationName:"groupName" type:"string"` - - // The name of the Amazon CloudWatch Logs stream for the build logs. - StreamName *string `locationName:"streamName" type:"string"` -} - -// String returns the string representation -func (s LogsLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LogsLocation) GoString() string { - return s.String() -} - -// SetDeepLink sets the DeepLink field's value. -func (s *LogsLocation) SetDeepLink(v string) *LogsLocation { - s.DeepLink = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *LogsLocation) SetGroupName(v string) *LogsLocation { - s.GroupName = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *LogsLocation) SetStreamName(v string) *LogsLocation { - s.StreamName = &v - return s -} - -// Additional information about a build phase that has an error. You can use -// this information to help troubleshoot a failed build. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/PhaseContext -type PhaseContext struct { - _ struct{} `type:"structure"` - - // An explanation of the build phase's context. This explanation might include - // a command ID and an exit code. - Message *string `locationName:"message" type:"string"` - - // The status code for the context of the build phase. - StatusCode *string `locationName:"statusCode" type:"string"` -} - -// String returns the string representation -func (s PhaseContext) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PhaseContext) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *PhaseContext) SetMessage(v string) *PhaseContext { - s.Message = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *PhaseContext) SetStatusCode(v string) *PhaseContext { - s.StatusCode = &v - return s -} - -// Information about a build project. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/Project -type Project struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the build project. - Arn *string `locationName:"arn" type:"string"` - - // Information about the build output artifacts for the build project. - Artifacts *ProjectArtifacts `locationName:"artifacts" type:"structure"` - - // When the build project was created, expressed in Unix time format. - Created *time.Time `locationName:"created" type:"timestamp" timestampFormat:"unix"` - - // A description that makes the build project easy to identify. - Description *string `locationName:"description" type:"string"` - - // The AWS Key Management Service (AWS KMS) customer master key (CMK) to be - // used for encrypting the build output artifacts. - // - // This is expressed either as the CMK's Amazon Resource Name (ARN) or, if specified, - // the CMK's alias (using the format alias/alias-name). - EncryptionKey *string `locationName:"encryptionKey" min:"1" type:"string"` - - // Information about the build environment for this build project. - Environment *ProjectEnvironment `locationName:"environment" type:"structure"` - - // When the build project's settings were last modified, expressed in Unix time - // format. - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"unix"` - - // The name of the build project. - Name *string `locationName:"name" min:"2" type:"string"` - - // The ARN of the AWS Identity and Access Management (IAM) role that enables - // AWS CodeBuild to interact with dependent AWS services on behalf of the AWS - // account. - ServiceRole *string `locationName:"serviceRole" min:"1" type:"string"` - - // Information about the build input source code for this build project. - Source *ProjectSource `locationName:"source" type:"structure"` - - // The tags for this build project. - // - // These tags are available for use by AWS services that support AWS CodeBuild - // build project tags. - Tags []*Tag `locationName:"tags" type:"list"` - - // How long, in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait - // before timing out any related build that did not get marked as completed. - // The default is 60 minutes. - TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"1" type:"integer"` -} - -// String returns the string representation -func (s Project) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Project) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Project) SetArn(v string) *Project { - s.Arn = &v - return s -} - -// SetArtifacts sets the Artifacts field's value. -func (s *Project) SetArtifacts(v *ProjectArtifacts) *Project { - s.Artifacts = v - return s -} - -// SetCreated sets the Created field's value. -func (s *Project) SetCreated(v time.Time) *Project { - s.Created = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Project) SetDescription(v string) *Project { - s.Description = &v - return s -} - -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *Project) SetEncryptionKey(v string) *Project { - s.EncryptionKey = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *Project) SetEnvironment(v *ProjectEnvironment) *Project { - s.Environment = v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *Project) SetLastModified(v time.Time) *Project { - s.LastModified = &v - return s -} - -// SetName sets the Name field's value. -func (s *Project) SetName(v string) *Project { - s.Name = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *Project) SetServiceRole(v string) *Project { - s.ServiceRole = &v - return s -} - -// SetSource sets the Source field's value. -func (s *Project) SetSource(v *ProjectSource) *Project { - s.Source = v - return s -} - -// SetTags sets the Tags field's value. -func (s *Project) SetTags(v []*Tag) *Project { - s.Tags = v - return s -} - -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *Project) SetTimeoutInMinutes(v int64) *Project { - s.TimeoutInMinutes = &v - return s -} - -// Information about the build output artifacts for the build project. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ProjectArtifacts -type ProjectArtifacts struct { - _ struct{} `type:"structure"` - - // Information about the build output artifact location, as follows: - // - // * If type is set to CODEPIPELINE, then AWS CodePipeline will ignore this - // value if specified. This is because AWS CodePipeline manages its build - // output locations instead of AWS CodeBuild. - // - // * If type is set to NO_ARTIFACTS, then this value will be ignored if specified, - // because no build output will be produced. - // - // * If type is set to S3, this is the name of the output bucket. - Location *string `locationName:"location" type:"string"` - - // Along with path and namespaceType, the pattern that AWS CodeBuild will use - // to name and store the output artifact, as follows: - // - // * If type is set to CODEPIPELINE, then AWS CodePipeline will ignore this - // value if specified. This is because AWS CodePipeline manages its build - // output names instead of AWS CodeBuild. - // - // * If type is set to NO_ARTIFACTS, then this value will be ignored if specified, - // because no build output will be produced. - // - // * If type is set to S3, this is the name of the output artifact object. - // - // For example, if path is set to MyArtifacts, namespaceType is set to BUILD_ID, - // and name is set to MyArtifact.zip, then the output artifact would be stored - // in MyArtifacts/build-ID/MyArtifact.zip. - Name *string `locationName:"name" type:"string"` - - // Along with path and name, the pattern that AWS CodeBuild will use to determine - // the name and location to store the output artifact, as follows: - // - // * If type is set to CODEPIPELINE, then AWS CodePipeline will ignore this - // value if specified. This is because AWS CodePipeline manages its build - // output names instead of AWS CodeBuild. - // - // * If type is set to NO_ARTIFACTS, then this value will be ignored if specified, - // because no build output will be produced. - // - // * If type is set to S3, then valid values include: - // - // BUILD_ID: Include the build ID in the location of the build output artifact. - // - // NONE: Do not include the build ID. This is the default if namespaceType is - // not specified. - // - // For example, if path is set to MyArtifacts, namespaceType is set to BUILD_ID, - // and name is set to MyArtifact.zip, then the output artifact would be stored - // in MyArtifacts/build-ID/MyArtifact.zip. - NamespaceType *string `locationName:"namespaceType" type:"string" enum:"ArtifactNamespace"` - - // The type of build output artifact to create, as follows: - // - // * If type is set to CODEPIPELINE, then AWS CodePipeline will ignore this - // value if specified. This is because AWS CodePipeline manages its build - // output artifacts instead of AWS CodeBuild. - // - // * If type is set to NO_ARTIFACTS, then this value will be ignored if specified, - // because no build output will be produced. - // - // * If type is set to S3, valid values include: - // - // NONE: AWS CodeBuild will create in the output bucket a folder containing - // the build output. This is the default if packaging is not specified. - // - // ZIP: AWS CodeBuild will create in the output bucket a ZIP file containing - // the build output. - Packaging *string `locationName:"packaging" type:"string" enum:"ArtifactPackaging"` - - // Along with namespaceType and name, the pattern that AWS CodeBuild will use - // to name and store the output artifact, as follows: - // - // * If type is set to CODEPIPELINE, then AWS CodePipeline will ignore this - // value if specified. This is because AWS CodePipeline manages its build - // output names instead of AWS CodeBuild. - // - // * If type is set to NO_ARTIFACTS, then this value will be ignored if specified, - // because no build output will be produced. - // - // * If type is set to S3, this is the path to the output artifact. If path - // is not specified, then path will not be used. - // - // For example, if path is set to MyArtifacts, namespaceType is set to NONE, - // and name is set to MyArtifact.zip, then the output artifact would be stored - // in the output bucket at MyArtifacts/MyArtifact.zip. - Path *string `locationName:"path" type:"string"` - - // The type of build output artifact. Valid values include: - // - // * CODEPIPELINE: The build project will have build output generated through - // AWS CodePipeline. - // - // * NO_ARTIFACTS: The build project will not produce any build output. - // - // * S3: The build project will store build output in Amazon Simple Storage - // Service (Amazon S3). - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"ArtifactsType"` -} - -// String returns the string representation -func (s ProjectArtifacts) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProjectArtifacts) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProjectArtifacts) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProjectArtifacts"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLocation sets the Location field's value. -func (s *ProjectArtifacts) SetLocation(v string) *ProjectArtifacts { - s.Location = &v - return s -} - -// SetName sets the Name field's value. -func (s *ProjectArtifacts) SetName(v string) *ProjectArtifacts { - s.Name = &v - return s -} - -// SetNamespaceType sets the NamespaceType field's value. -func (s *ProjectArtifacts) SetNamespaceType(v string) *ProjectArtifacts { - s.NamespaceType = &v - return s -} - -// SetPackaging sets the Packaging field's value. -func (s *ProjectArtifacts) SetPackaging(v string) *ProjectArtifacts { - s.Packaging = &v - return s -} - -// SetPath sets the Path field's value. -func (s *ProjectArtifacts) SetPath(v string) *ProjectArtifacts { - s.Path = &v - return s -} - -// SetType sets the Type field's value. -func (s *ProjectArtifacts) SetType(v string) *ProjectArtifacts { - s.Type = &v - return s -} - -// Information about the build environment of the build project. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ProjectEnvironment -type ProjectEnvironment struct { - _ struct{} `type:"structure"` - - // Information about the compute resources the build project will use. Available - // values include: - // - // * BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds. - // - // * BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds. - // - // * BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds. - // - // ComputeType is a required field - ComputeType *string `locationName:"computeType" type:"string" required:"true" enum:"ComputeType"` - - // A set of environment variables to make available to builds for this build - // project. - EnvironmentVariables []*EnvironmentVariable `locationName:"environmentVariables" type:"list"` - - // The ID of the Docker image to use for this build project. - // - // Image is a required field - Image *string `locationName:"image" min:"1" type:"string" required:"true"` - - // The type of build environment to use for related builds. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"EnvironmentType"` -} - -// String returns the string representation -func (s ProjectEnvironment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProjectEnvironment) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProjectEnvironment) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProjectEnvironment"} - if s.ComputeType == nil { - invalidParams.Add(request.NewErrParamRequired("ComputeType")) - } - if s.Image == nil { - invalidParams.Add(request.NewErrParamRequired("Image")) - } - if s.Image != nil && len(*s.Image) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Image", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.EnvironmentVariables != nil { - for i, v := range s.EnvironmentVariables { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "EnvironmentVariables", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComputeType sets the ComputeType field's value. -func (s *ProjectEnvironment) SetComputeType(v string) *ProjectEnvironment { - s.ComputeType = &v - return s -} - -// SetEnvironmentVariables sets the EnvironmentVariables field's value. -func (s *ProjectEnvironment) SetEnvironmentVariables(v []*EnvironmentVariable) *ProjectEnvironment { - s.EnvironmentVariables = v - return s -} - -// SetImage sets the Image field's value. -func (s *ProjectEnvironment) SetImage(v string) *ProjectEnvironment { - s.Image = &v - return s -} - -// SetType sets the Type field's value. -func (s *ProjectEnvironment) SetType(v string) *ProjectEnvironment { - s.Type = &v - return s -} - -// Information about the build input source code for the build project. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ProjectSource -type ProjectSource struct { - _ struct{} `type:"structure"` - - // Information about the authorization settings for AWS CodeBuild to access - // the source code to be built. - // - // This information is for the AWS CodeBuild console's use only. Your code should - // not get or set this information directly (unless the build project's source - // type value is GITHUB). - Auth *SourceAuth `locationName:"auth" type:"structure"` - - // The build spec declaration to use for the builds in this build project. - // - // If this value is not specified, a build spec must be included along with - // the source code to be built. - Buildspec *string `locationName:"buildspec" type:"string"` - - // Information about the location of the source code to be built. Valid values - // include: - // - // * For source code settings that are specified in the source action of - // a pipeline in AWS CodePipeline, location should not be specified. If it - // is specified, AWS CodePipeline will ignore it. This is because AWS CodePipeline - // uses the settings in a pipeline's source action instead of this value. - // - // * For source code in an AWS CodeCommit repository, the HTTPS clone URL - // to the repository that contains the source code and the build spec (for - // example, https://git-codecommit.region-ID.amazonaws.com/v1/repos/repo-name). - // - // * For source code in an Amazon Simple Storage Service (Amazon S3) input - // bucket, the path to the ZIP file that contains the source code (for example, - // bucket-name/path/to/object-name.zip) - // - // * For source code in a GitHub repository, instead of specifying a value - // here, you connect your AWS account to your GitHub account. To do this, - // use the AWS CodeBuild console to begin creating a build project, and follow - // the on-screen instructions to complete the connection. (After you have - // connected to your GitHub account, you do not need to finish creating the - // build project, and you may then leave the AWS CodeBuild console.) To instruct - // AWS CodeBuild to then use this connection, in the source object, set the - // auth object's type value to OAUTH. - Location *string `locationName:"location" type:"string"` - - // The type of repository that contains the source code to be built. Valid values - // include: - // - // * CODECOMMIT: The source code is in an AWS CodeCommit repository. - // - // * CODEPIPELINE: The source code settings are specified in the source action - // of a pipeline in AWS CodePipeline. - // - // * GITHUB: The source code is in a GitHub repository. - // - // * S3: The source code is in an Amazon Simple Storage Service (Amazon S3) - // input bucket. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SourceType"` -} - -// String returns the string representation -func (s ProjectSource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProjectSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProjectSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProjectSource"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Auth != nil { - if err := s.Auth.Validate(); err != nil { - invalidParams.AddNested("Auth", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuth sets the Auth field's value. -func (s *ProjectSource) SetAuth(v *SourceAuth) *ProjectSource { - s.Auth = v - return s -} - -// SetBuildspec sets the Buildspec field's value. -func (s *ProjectSource) SetBuildspec(v string) *ProjectSource { - s.Buildspec = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *ProjectSource) SetLocation(v string) *ProjectSource { - s.Location = &v - return s -} - -// SetType sets the Type field's value. -func (s *ProjectSource) SetType(v string) *ProjectSource { - s.Type = &v - return s -} - -// Information about the authorization settings for AWS CodeBuild to access -// the source code to be built. -// -// This information is for the AWS CodeBuild console's use only. Your code should -// not get or set this information directly (unless the build project's source -// type value is GITHUB). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/SourceAuth -type SourceAuth struct { - _ struct{} `type:"structure"` - - // The resource value that applies to the specified authorization type. - Resource *string `locationName:"resource" type:"string"` - - // The authorization type to use. The only valid value is OAUTH, which represents - // the OAuth authorization type. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SourceAuthType"` -} - -// String returns the string representation -func (s SourceAuth) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceAuth) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceAuth) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceAuth"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResource sets the Resource field's value. -func (s *SourceAuth) SetResource(v string) *SourceAuth { - s.Resource = &v - return s -} - -// SetType sets the Type field's value. -func (s *SourceAuth) SetType(v string) *SourceAuth { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StartBuildInput -type StartBuildInput struct { - _ struct{} `type:"structure"` - - // Build output artifact settings that override, for this build only, the latest - // ones already defined in the build project. - ArtifactsOverride *ProjectArtifacts `locationName:"artifactsOverride" type:"structure"` - - // A build spec declaration that overrides, for this build only, the latest - // one already defined in the build project. - BuildspecOverride *string `locationName:"buildspecOverride" type:"string"` - - // A set of environment variables that overrides, for this build only, the latest - // ones already defined in the build project. - EnvironmentVariablesOverride []*EnvironmentVariable `locationName:"environmentVariablesOverride" type:"list"` - - // The name of the build project to start running a build. - // - // ProjectName is a required field - ProjectName *string `locationName:"projectName" min:"1" type:"string" required:"true"` - - // A version of the build input to be built, for this build only. If not specified, - // the latest version will be used. If specified, must be one of: - // - // * For AWS CodeCommit or GitHub: the commit ID to use. - // - // * For Amazon Simple Storage Service (Amazon S3): the version ID of the - // object representing the build input ZIP file to use. - SourceVersion *string `locationName:"sourceVersion" type:"string"` - - // The number of build timeout minutes, from 5 to 480 (8 hours), that overrides, - // for this build only, the latest setting already defined in the build project. - TimeoutInMinutesOverride *int64 `locationName:"timeoutInMinutesOverride" min:"1" type:"integer"` -} - -// String returns the string representation -func (s StartBuildInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartBuildInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartBuildInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartBuildInput"} - if s.ProjectName == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectName")) - } - if s.ProjectName != nil && len(*s.ProjectName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProjectName", 1)) - } - if s.TimeoutInMinutesOverride != nil && *s.TimeoutInMinutesOverride < 1 { - invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutesOverride", 1)) - } - if s.ArtifactsOverride != nil { - if err := s.ArtifactsOverride.Validate(); err != nil { - invalidParams.AddNested("ArtifactsOverride", err.(request.ErrInvalidParams)) - } - } - if s.EnvironmentVariablesOverride != nil { - for i, v := range s.EnvironmentVariablesOverride { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "EnvironmentVariablesOverride", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArtifactsOverride sets the ArtifactsOverride field's value. -func (s *StartBuildInput) SetArtifactsOverride(v *ProjectArtifacts) *StartBuildInput { - s.ArtifactsOverride = v - return s -} - -// SetBuildspecOverride sets the BuildspecOverride field's value. -func (s *StartBuildInput) SetBuildspecOverride(v string) *StartBuildInput { - s.BuildspecOverride = &v - return s -} - -// SetEnvironmentVariablesOverride sets the EnvironmentVariablesOverride field's value. -func (s *StartBuildInput) SetEnvironmentVariablesOverride(v []*EnvironmentVariable) *StartBuildInput { - s.EnvironmentVariablesOverride = v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *StartBuildInput) SetProjectName(v string) *StartBuildInput { - s.ProjectName = &v - return s -} - -// SetSourceVersion sets the SourceVersion field's value. -func (s *StartBuildInput) SetSourceVersion(v string) *StartBuildInput { - s.SourceVersion = &v - return s -} - -// SetTimeoutInMinutesOverride sets the TimeoutInMinutesOverride field's value. -func (s *StartBuildInput) SetTimeoutInMinutesOverride(v int64) *StartBuildInput { - s.TimeoutInMinutesOverride = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StartBuildOutput -type StartBuildOutput struct { - _ struct{} `type:"structure"` - - // Information about the build to be run. - Build *Build `locationName:"build" type:"structure"` -} - -// String returns the string representation -func (s StartBuildOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartBuildOutput) GoString() string { - return s.String() -} - -// SetBuild sets the Build field's value. -func (s *StartBuildOutput) SetBuild(v *Build) *StartBuildOutput { - s.Build = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StopBuildInput -type StopBuildInput struct { - _ struct{} `type:"structure"` - - // The ID of the build. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopBuildInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopBuildInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopBuildInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopBuildInput"} - 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 *StopBuildInput) SetId(v string) *StopBuildInput { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StopBuildOutput -type StopBuildOutput struct { - _ struct{} `type:"structure"` - - // Information about the build. - Build *Build `locationName:"build" type:"structure"` -} - -// String returns the string representation -func (s StopBuildOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopBuildOutput) GoString() string { - return s.String() -} - -// SetBuild sets the Build field's value. -func (s *StopBuildOutput) SetBuild(v *Build) *StopBuildOutput { - s.Build = v - return s -} - -// A tag, consisting of a key and a value. -// -// This tag is available for use by AWS services that support tags in AWS CodeBuild. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The tag's key. - Key *string `locationName:"key" min:"1" type:"string"` - - // The tag's value. - Value *string `locationName:"value" min:"1" 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 && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 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 -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateProjectInput -type UpdateProjectInput struct { - _ struct{} `type:"structure"` - - // Information to be changed about the build output artifacts for the build - // project. - Artifacts *ProjectArtifacts `locationName:"artifacts" type:"structure"` - - // A new or replacement description of the build project. - Description *string `locationName:"description" type:"string"` - - // The replacement AWS Key Management Service (AWS KMS) customer master key - // (CMK) to be used for encrypting the build output artifacts. - // - // You can specify either the CMK's Amazon Resource Name (ARN) or, if available, - // the CMK's alias (using the format alias/alias-name). - EncryptionKey *string `locationName:"encryptionKey" min:"1" type:"string"` - - // Information to be changed about the build environment for the build project. - Environment *ProjectEnvironment `locationName:"environment" type:"structure"` - - // The name of the build project. - // - // You cannot change a build project's name. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The replacement ARN of the AWS Identity and Access Management (IAM) role - // that enables AWS CodeBuild to interact with dependent AWS services on behalf - // of the AWS account. - ServiceRole *string `locationName:"serviceRole" min:"1" type:"string"` - - // Information to be changed about the build input source code for the build - // project. - Source *ProjectSource `locationName:"source" type:"structure"` - - // The replacement set of tags for this build project. - // - // These tags are available for use by AWS services that support AWS CodeBuild - // build project tags. - Tags []*Tag `locationName:"tags" type:"list"` - - // The replacement value in minutes, from 5 to 480 (8 hours), for AWS CodeBuild - // to wait before timing out any related build that did not get marked as completed. - TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"1" type:"integer"` -} - -// String returns the string representation -func (s UpdateProjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateProjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateProjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateProjectInput"} - if s.EncryptionKey != nil && len(*s.EncryptionKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EncryptionKey", 1)) - } - 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.ServiceRole != nil && len(*s.ServiceRole) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServiceRole", 1)) - } - if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 1 { - invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 1)) - } - if s.Artifacts != nil { - if err := s.Artifacts.Validate(); err != nil { - invalidParams.AddNested("Artifacts", err.(request.ErrInvalidParams)) - } - } - if s.Environment != nil { - if err := s.Environment.Validate(); err != nil { - invalidParams.AddNested("Environment", err.(request.ErrInvalidParams)) - } - } - if s.Source != nil { - if err := s.Source.Validate(); err != nil { - invalidParams.AddNested("Source", 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 - } - return nil -} - -// SetArtifacts sets the Artifacts field's value. -func (s *UpdateProjectInput) SetArtifacts(v *ProjectArtifacts) *UpdateProjectInput { - s.Artifacts = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateProjectInput) SetDescription(v string) *UpdateProjectInput { - s.Description = &v - return s -} - -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *UpdateProjectInput) SetEncryptionKey(v string) *UpdateProjectInput { - s.EncryptionKey = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *UpdateProjectInput) SetEnvironment(v *ProjectEnvironment) *UpdateProjectInput { - s.Environment = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateProjectInput) SetName(v string) *UpdateProjectInput { - s.Name = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *UpdateProjectInput) SetServiceRole(v string) *UpdateProjectInput { - s.ServiceRole = &v - return s -} - -// SetSource sets the Source field's value. -func (s *UpdateProjectInput) SetSource(v *ProjectSource) *UpdateProjectInput { - s.Source = v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateProjectInput) SetTags(v []*Tag) *UpdateProjectInput { - s.Tags = v - return s -} - -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *UpdateProjectInput) SetTimeoutInMinutes(v int64) *UpdateProjectInput { - s.TimeoutInMinutes = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateProjectOutput -type UpdateProjectOutput struct { - _ struct{} `type:"structure"` - - // Information about the build project that was changed. - Project *Project `locationName:"project" type:"structure"` -} - -// String returns the string representation -func (s UpdateProjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateProjectOutput) GoString() string { - return s.String() -} - -// SetProject sets the Project field's value. -func (s *UpdateProjectOutput) SetProject(v *Project) *UpdateProjectOutput { - s.Project = v - return s -} - -const ( - // ArtifactNamespaceNone is a ArtifactNamespace enum value - ArtifactNamespaceNone = "NONE" - - // ArtifactNamespaceBuildId is a ArtifactNamespace enum value - ArtifactNamespaceBuildId = "BUILD_ID" -) - -const ( - // ArtifactPackagingNone is a ArtifactPackaging enum value - ArtifactPackagingNone = "NONE" - - // ArtifactPackagingZip is a ArtifactPackaging enum value - ArtifactPackagingZip = "ZIP" -) - -const ( - // ArtifactsTypeCodepipeline is a ArtifactsType enum value - ArtifactsTypeCodepipeline = "CODEPIPELINE" - - // ArtifactsTypeS3 is a ArtifactsType enum value - ArtifactsTypeS3 = "S3" - - // ArtifactsTypeNoArtifacts is a ArtifactsType enum value - ArtifactsTypeNoArtifacts = "NO_ARTIFACTS" -) - -const ( - // BuildPhaseTypeSubmitted is a BuildPhaseType enum value - BuildPhaseTypeSubmitted = "SUBMITTED" - - // BuildPhaseTypeProvisioning is a BuildPhaseType enum value - BuildPhaseTypeProvisioning = "PROVISIONING" - - // BuildPhaseTypeDownloadSource is a BuildPhaseType enum value - BuildPhaseTypeDownloadSource = "DOWNLOAD_SOURCE" - - // BuildPhaseTypeInstall is a BuildPhaseType enum value - BuildPhaseTypeInstall = "INSTALL" - - // BuildPhaseTypePreBuild is a BuildPhaseType enum value - BuildPhaseTypePreBuild = "PRE_BUILD" - - // BuildPhaseTypeBuild is a BuildPhaseType enum value - BuildPhaseTypeBuild = "BUILD" - - // BuildPhaseTypePostBuild is a BuildPhaseType enum value - BuildPhaseTypePostBuild = "POST_BUILD" - - // BuildPhaseTypeUploadArtifacts is a BuildPhaseType enum value - BuildPhaseTypeUploadArtifacts = "UPLOAD_ARTIFACTS" - - // BuildPhaseTypeFinalizing is a BuildPhaseType enum value - BuildPhaseTypeFinalizing = "FINALIZING" - - // BuildPhaseTypeCompleted is a BuildPhaseType enum value - BuildPhaseTypeCompleted = "COMPLETED" -) - -const ( - // ComputeTypeBuildGeneral1Small is a ComputeType enum value - ComputeTypeBuildGeneral1Small = "BUILD_GENERAL1_SMALL" - - // ComputeTypeBuildGeneral1Medium is a ComputeType enum value - ComputeTypeBuildGeneral1Medium = "BUILD_GENERAL1_MEDIUM" - - // ComputeTypeBuildGeneral1Large is a ComputeType enum value - ComputeTypeBuildGeneral1Large = "BUILD_GENERAL1_LARGE" -) - -const ( - // EnvironmentTypeLinuxContainer is a EnvironmentType enum value - EnvironmentTypeLinuxContainer = "LINUX_CONTAINER" -) - -const ( - // LanguageTypeJava is a LanguageType enum value - LanguageTypeJava = "JAVA" - - // LanguageTypePython is a LanguageType enum value - LanguageTypePython = "PYTHON" - - // LanguageTypeNodeJs is a LanguageType enum value - LanguageTypeNodeJs = "NODE_JS" - - // LanguageTypeRuby is a LanguageType enum value - LanguageTypeRuby = "RUBY" - - // LanguageTypeGolang is a LanguageType enum value - LanguageTypeGolang = "GOLANG" - - // LanguageTypeDocker is a LanguageType enum value - LanguageTypeDocker = "DOCKER" - - // LanguageTypeAndroid is a LanguageType enum value - LanguageTypeAndroid = "ANDROID" - - // LanguageTypeBase is a LanguageType enum value - LanguageTypeBase = "BASE" -) - -const ( - // PlatformTypeDebian is a PlatformType enum value - PlatformTypeDebian = "DEBIAN" - - // PlatformTypeAmazonLinux is a PlatformType enum value - PlatformTypeAmazonLinux = "AMAZON_LINUX" - - // PlatformTypeUbuntu is a PlatformType enum value - PlatformTypeUbuntu = "UBUNTU" -) - -const ( - // ProjectSortByTypeName is a ProjectSortByType enum value - ProjectSortByTypeName = "NAME" - - // ProjectSortByTypeCreatedTime is a ProjectSortByType enum value - ProjectSortByTypeCreatedTime = "CREATED_TIME" - - // ProjectSortByTypeLastModifiedTime is a ProjectSortByType enum value - ProjectSortByTypeLastModifiedTime = "LAST_MODIFIED_TIME" -) - -const ( - // SortOrderTypeAscending is a SortOrderType enum value - SortOrderTypeAscending = "ASCENDING" - - // SortOrderTypeDescending is a SortOrderType enum value - SortOrderTypeDescending = "DESCENDING" -) - -const ( - // SourceAuthTypeOauth is a SourceAuthType enum value - SourceAuthTypeOauth = "OAUTH" -) - -const ( - // SourceTypeCodecommit is a SourceType enum value - SourceTypeCodecommit = "CODECOMMIT" - - // SourceTypeCodepipeline is a SourceType enum value - SourceTypeCodepipeline = "CODEPIPELINE" - - // SourceTypeGithub is a SourceType enum value - SourceTypeGithub = "GITHUB" - - // SourceTypeS3 is a SourceType enum value - SourceTypeS3 = "S3" -) - -const ( - // StatusTypeSucceeded is a StatusType enum value - StatusTypeSucceeded = "SUCCEEDED" - - // StatusTypeFailed is a StatusType enum value - StatusTypeFailed = "FAILED" - - // StatusTypeFault is a StatusType enum value - StatusTypeFault = "FAULT" - - // StatusTypeTimedOut is a StatusType enum value - StatusTypeTimedOut = "TIMED_OUT" - - // StatusTypeInProgress is a StatusType enum value - StatusTypeInProgress = "IN_PROGRESS" - - // StatusTypeStopped is a StatusType enum value - StatusTypeStopped = "STOPPED" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go deleted file mode 100644 index 88cfe77..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go +++ /dev/null @@ -1,31 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codebuild - -const ( - - // ErrCodeAccountLimitExceededException for service response error code - // "AccountLimitExceededException". - // - // An AWS service limit was exceeded for the calling AWS account. - ErrCodeAccountLimitExceededException = "AccountLimitExceededException" - - // ErrCodeInvalidInputException for service response error code - // "InvalidInputException". - // - // The input value that was provided is not valid. - ErrCodeInvalidInputException = "InvalidInputException" - - // ErrCodeResourceAlreadyExistsException for service response error code - // "ResourceAlreadyExistsException". - // - // The specified AWS resource cannot be created, because an AWS resource with - // the same settings already exists. - ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified AWS resource cannot be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go b/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go deleted file mode 100644 index 41d6dd7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go +++ /dev/null @@ -1,136 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codebuild - -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" -) - -// AWS CodeBuild is a fully managed build service in the cloud. AWS CodeBuild -// compiles your source code, runs unit tests, and produces artifacts that are -// ready to deploy. AWS CodeBuild eliminates the need to provision, manage, -// and scale your own build servers. It provides prepackaged build environments -// for the most popular programming languages and build tools, such as Apach -// Maven, Gradle, and more. You can also fully customize build environments -// in AWS CodeBuild to use your own build tools. AWS CodeBuild scales automatically -// to meet peak build requests, and you pay only for the build time you consume. -// For more information about AWS CodeBuild, see the AWS CodeBuild User Guide. -// -// AWS CodeBuild supports these operations: -// -// * BatchGetProjects: Gets information about one or more build projects. -// A build project defines how AWS CodeBuild will run a build. This includes -// information such as where to get the source code to build, the build environment -// to use, the build commands to run, and where to store the build output. -// A build environment represents a combination of operating system, programming -// language runtime, and tools that AWS CodeBuild will use to run a build. -// Also, you can add tags to build projects to help manage your resources -// and costs. -// -// * CreateProject: Creates a build project. -// -// * DeleteProject: Deletes a build project. -// -// * ListProjects: Gets a list of build project names, with each build project -// name representing a single build project. -// -// * UpdateProject: Changes the settings of an existing build project. -// -// * BatchGetBuilds: Gets information about one or more builds. -// -// * ListBuilds: Gets a list of build IDs, with each build ID representing -// a single build. -// -// * ListBuildsForProject: Gets a list of build IDs for the specified build -// project, with each build ID representing a single build. -// -// * StartBuild: Starts running a build. -// -// * StopBuild: Attempts to stop running a build. -// -// * ListCuratedEnvironmentImages: Gets information about Docker images that -// are managed by AWS CodeBuild. -// 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/codebuild-2016-10-06 -type CodeBuild 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 = "codebuild" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CodeBuild 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 CodeBuild client from just a session. -// svc := codebuild.New(mySession) -// -// // Create a CodeBuild client with additional configuration -// svc := codebuild.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeBuild { - 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) *CodeBuild { - svc := &CodeBuild{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-10-06", - JSONVersion: "1.1", - TargetPrefix: "CodeBuild_20161006", - }, - 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 CodeBuild operation and runs any -// custom request initialization. -func (c *CodeBuild) 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/codecommit/api.go b/vendor/github.com/aws/aws-sdk-go/service/codecommit/api.go deleted file mode 100644 index 47ab5ea..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/api.go +++ /dev/null @@ -1,3843 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package codecommit provides a client for AWS CodeCommit. -package codecommit - -import ( - "fmt" - "time" - - "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 opBatchGetRepositories = "BatchGetRepositories" - -// BatchGetRepositoriesRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetRepositories operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetRepositories for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetRepositories method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetRepositoriesRequest method. -// req, resp := client.BatchGetRepositoriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetRepositories -func (c *CodeCommit) BatchGetRepositoriesRequest(input *BatchGetRepositoriesInput) (req *request.Request, output *BatchGetRepositoriesOutput) { - op := &request.Operation{ - Name: opBatchGetRepositories, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetRepositoriesInput{} - } - - output = &BatchGetRepositoriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetRepositories API operation for AWS CodeCommit. -// -// Returns information about one or more repositories. -// -// The description field for a repository accepts all HTML characters and all -// valid Unicode characters. Applications that do not HTML-encode the description -// and display it in a web page could expose users to potentially malicious -// code. Make sure that you HTML-encode the description field in any application -// that uses this API to display the repository description on a web page. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation BatchGetRepositories for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNamesRequiredException "RepositoryNamesRequiredException" -// A repository names object is required but was not specified. -// -// * ErrCodeMaximumRepositoryNamesExceededException "MaximumRepositoryNamesExceededException" -// The maximum number of allowed repository names was exceeded. Currently, this -// number is 25. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetRepositories -func (c *CodeCommit) BatchGetRepositories(input *BatchGetRepositoriesInput) (*BatchGetRepositoriesOutput, error) { - req, out := c.BatchGetRepositoriesRequest(input) - err := req.Send() - return out, err -} - -const opCreateBranch = "CreateBranch" - -// CreateBranchRequest generates a "aws/request.Request" representing the -// client's request for the CreateBranch operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateBranch for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateBranch method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateBranchRequest method. -// req, resp := client.CreateBranchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranch -func (c *CodeCommit) CreateBranchRequest(input *CreateBranchInput) (req *request.Request, output *CreateBranchOutput) { - op := &request.Operation{ - Name: opCreateBranch, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateBranchInput{} - } - - output = &CreateBranchOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateBranch API operation for AWS CodeCommit. -// -// Creates a new branch in a repository and points the branch to a commit. -// -// Calling the create branch operation does not set a repository's default branch. -// To do this, call the update default branch 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 AWS CodeCommit's -// API operation CreateBranch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. -// -// * ErrCodeBranchNameExistsException "BranchNameExistsException" -// The specified branch name already exists. -// -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified branch name is not valid. -// -// * ErrCodeCommitIdRequiredException "CommitIdRequiredException" -// A commit ID was not specified. -// -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" -// The specified commit does not exist or no commit was specified, and the specified -// repository has no default branch. -// -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranch -func (c *CodeCommit) CreateBranch(input *CreateBranchInput) (*CreateBranchOutput, error) { - req, out := c.CreateBranchRequest(input) - err := req.Send() - return out, err -} - -const opCreateRepository = "CreateRepository" - -// CreateRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the CreateRepository operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateRepository for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateRepository method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateRepositoryRequest method. -// req, resp := client.CreateRepositoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateRepository -func (c *CodeCommit) CreateRepositoryRequest(input *CreateRepositoryInput) (req *request.Request, output *CreateRepositoryOutput) { - op := &request.Operation{ - Name: opCreateRepository, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRepositoryInput{} - } - - output = &CreateRepositoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRepository API operation for AWS CodeCommit. -// -// Creates a new, empty repository. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation CreateRepository for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameExistsException "RepositoryNameExistsException" -// The specified repository name already exists. -// -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeInvalidRepositoryDescriptionException "InvalidRepositoryDescriptionException" -// The specified repository description is not valid. -// -// * ErrCodeRepositoryLimitExceededException "RepositoryLimitExceededException" -// A repository resource limit was exceeded. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateRepository -func (c *CodeCommit) CreateRepository(input *CreateRepositoryInput) (*CreateRepositoryOutput, error) { - req, out := c.CreateRepositoryRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRepository = "DeleteRepository" - -// DeleteRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRepository operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRepository for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRepository method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRepositoryRequest method. -// req, resp := client.DeleteRepositoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepository -func (c *CodeCommit) DeleteRepositoryRequest(input *DeleteRepositoryInput) (req *request.Request, output *DeleteRepositoryOutput) { - op := &request.Operation{ - Name: opDeleteRepository, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRepositoryInput{} - } - - output = &DeleteRepositoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteRepository API operation for AWS CodeCommit. -// -// Deletes a repository. If a specified repository was already deleted, a null -// repository ID will be returned. -// -// Deleting a repository also deletes all associated objects and metadata. After -// a repository is deleted, all future push calls to the deleted repository -// will fail. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation DeleteRepository for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepository -func (c *CodeCommit) DeleteRepository(input *DeleteRepositoryInput) (*DeleteRepositoryOutput, error) { - req, out := c.DeleteRepositoryRequest(input) - err := req.Send() - return out, err -} - -const opGetBlob = "GetBlob" - -// GetBlobRequest generates a "aws/request.Request" representing the -// client's request for the GetBlob operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBlob for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBlob method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBlobRequest method. -// req, resp := client.GetBlobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBlob -func (c *CodeCommit) GetBlobRequest(input *GetBlobInput) (req *request.Request, output *GetBlobOutput) { - op := &request.Operation{ - Name: opGetBlob, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetBlobInput{} - } - - output = &GetBlobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBlob API operation for AWS CodeCommit. -// -// Returns the base-64 encoded content of an individual blob within a repository. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation GetBlob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeBlobIdRequiredException "BlobIdRequiredException" -// A blob ID is required but was not specified. -// -// * ErrCodeInvalidBlobIdException "InvalidBlobIdException" -// The specified blob is not valid. -// -// * ErrCodeBlobIdDoesNotExistException "BlobIdDoesNotExistException" -// The specified blob does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// * ErrCodeFileTooLargeException "FileTooLargeException" -// The specified file exceeds the file size limit for AWS CodeCommit. For more -// information about limits in AWS CodeCommit, see AWS CodeCommit User Guide -// (http://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBlob -func (c *CodeCommit) GetBlob(input *GetBlobInput) (*GetBlobOutput, error) { - req, out := c.GetBlobRequest(input) - err := req.Send() - return out, err -} - -const opGetBranch = "GetBranch" - -// GetBranchRequest generates a "aws/request.Request" representing the -// client's request for the GetBranch operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBranch for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBranch method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBranchRequest method. -// req, resp := client.GetBranchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBranch -func (c *CodeCommit) GetBranchRequest(input *GetBranchInput) (req *request.Request, output *GetBranchOutput) { - op := &request.Operation{ - Name: opGetBranch, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetBranchInput{} - } - - output = &GetBranchOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBranch API operation for AWS CodeCommit. -// -// Returns information about a repository branch, including its name and the -// last commit 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 AWS CodeCommit's -// API operation GetBranch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. -// -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified branch name is not valid. -// -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" -// The specified branch does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBranch -func (c *CodeCommit) GetBranch(input *GetBranchInput) (*GetBranchOutput, error) { - req, out := c.GetBranchRequest(input) - err := req.Send() - return out, err -} - -const opGetCommit = "GetCommit" - -// GetCommitRequest generates a "aws/request.Request" representing the -// client's request for the GetCommit operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetCommit for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetCommit method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetCommitRequest method. -// req, resp := client.GetCommitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommit -func (c *CodeCommit) GetCommitRequest(input *GetCommitInput) (req *request.Request, output *GetCommitOutput) { - op := &request.Operation{ - Name: opGetCommit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCommitInput{} - } - - output = &GetCommitOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCommit API operation for AWS CodeCommit. -// -// Returns information about a commit, including commit message and committer -// information. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation GetCommit for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeCommitIdRequiredException "CommitIdRequiredException" -// A commit ID was not specified. -// -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. -// -// * ErrCodeCommitIdDoesNotExistException "CommitIdDoesNotExistException" -// The specified commit ID does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommit -func (c *CodeCommit) GetCommit(input *GetCommitInput) (*GetCommitOutput, error) { - req, out := c.GetCommitRequest(input) - err := req.Send() - return out, err -} - -const opGetDifferences = "GetDifferences" - -// GetDifferencesRequest generates a "aws/request.Request" representing the -// client's request for the GetDifferences operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDifferences for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDifferences method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDifferencesRequest method. -// req, resp := client.GetDifferencesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetDifferences -func (c *CodeCommit) GetDifferencesRequest(input *GetDifferencesInput) (req *request.Request, output *GetDifferencesOutput) { - op := &request.Operation{ - Name: opGetDifferences, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetDifferencesInput{} - } - - output = &GetDifferencesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDifferences API operation for AWS CodeCommit. -// -// Returns information about the differences in a valid commit specifier (such -// as a branch, tag, HEAD, commit ID or other fully qualified reference). Results -// can be limited to a specified path. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation GetDifferences for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. -// -// * ErrCodeInvalidMaxResultsException "InvalidMaxResultsException" -// The specified number of maximum results is not valid. -// -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. -// -// * ErrCodeCommitRequiredException "CommitRequiredException" -// A commit was not specified. -// -// * ErrCodeInvalidCommitException "InvalidCommitException" -// The specified commit is not valid. -// -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" -// The specified commit does not exist or no commit was specified, and the specified -// repository has no default branch. -// -// * ErrCodeInvalidPathException "InvalidPathException" -// The specified path is not valid. -// -// * ErrCodePathDoesNotExistException "PathDoesNotExistException" -// The specified path does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetDifferences -func (c *CodeCommit) GetDifferences(input *GetDifferencesInput) (*GetDifferencesOutput, error) { - req, out := c.GetDifferencesRequest(input) - err := req.Send() - return out, err -} - -// GetDifferencesPages iterates over the pages of a GetDifferences operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDifferences 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 GetDifferences operation. -// pageNum := 0 -// err := client.GetDifferencesPages(params, -// func(page *GetDifferencesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) GetDifferencesPages(input *GetDifferencesInput, fn func(p *GetDifferencesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetDifferencesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetDifferencesOutput), lastPage) - }) -} - -const opGetRepository = "GetRepository" - -// GetRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the GetRepository operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRepository for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRepository method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRepositoryRequest method. -// req, resp := client.GetRepositoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepository -func (c *CodeCommit) GetRepositoryRequest(input *GetRepositoryInput) (req *request.Request, output *GetRepositoryOutput) { - op := &request.Operation{ - Name: opGetRepository, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRepositoryInput{} - } - - output = &GetRepositoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRepository API operation for AWS CodeCommit. -// -// Returns information about a repository. -// -// The description field for a repository accepts all HTML characters and all -// valid Unicode characters. Applications that do not HTML-encode the description -// and display it in a web page could expose users to potentially malicious -// code. Make sure that you HTML-encode the description field in any application -// that uses this API to display the repository description on a web page. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation GetRepository for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepository -func (c *CodeCommit) GetRepository(input *GetRepositoryInput) (*GetRepositoryOutput, error) { - req, out := c.GetRepositoryRequest(input) - err := req.Send() - return out, err -} - -const opGetRepositoryTriggers = "GetRepositoryTriggers" - -// GetRepositoryTriggersRequest generates a "aws/request.Request" representing the -// client's request for the GetRepositoryTriggers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRepositoryTriggers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRepositoryTriggers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRepositoryTriggersRequest method. -// req, resp := client.GetRepositoryTriggersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryTriggers -func (c *CodeCommit) GetRepositoryTriggersRequest(input *GetRepositoryTriggersInput) (req *request.Request, output *GetRepositoryTriggersOutput) { - op := &request.Operation{ - Name: opGetRepositoryTriggers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRepositoryTriggersInput{} - } - - output = &GetRepositoryTriggersOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRepositoryTriggers API operation for AWS CodeCommit. -// -// Gets information about triggers configured for a repository. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation GetRepositoryTriggers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryTriggers -func (c *CodeCommit) GetRepositoryTriggers(input *GetRepositoryTriggersInput) (*GetRepositoryTriggersOutput, error) { - req, out := c.GetRepositoryTriggersRequest(input) - err := req.Send() - return out, err -} - -const opListBranches = "ListBranches" - -// ListBranchesRequest generates a "aws/request.Request" representing the -// client's request for the ListBranches operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListBranches for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListBranches method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListBranchesRequest method. -// req, resp := client.ListBranchesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListBranches -func (c *CodeCommit) ListBranchesRequest(input *ListBranchesInput) (req *request.Request, output *ListBranchesOutput) { - op := &request.Operation{ - Name: opListBranches, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListBranchesInput{} - } - - output = &ListBranchesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBranches API operation for AWS CodeCommit. -// -// Gets information about one or more branches in a repository. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation ListBranches for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListBranches -func (c *CodeCommit) ListBranches(input *ListBranchesInput) (*ListBranchesOutput, error) { - req, out := c.ListBranchesRequest(input) - err := req.Send() - return out, err -} - -// ListBranchesPages iterates over the pages of a ListBranches operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListBranches 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 ListBranches operation. -// pageNum := 0 -// err := client.ListBranchesPages(params, -// func(page *ListBranchesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) ListBranchesPages(input *ListBranchesInput, fn func(p *ListBranchesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListBranchesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListBranchesOutput), lastPage) - }) -} - -const opListRepositories = "ListRepositories" - -// ListRepositoriesRequest generates a "aws/request.Request" representing the -// client's request for the ListRepositories operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListRepositories for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListRepositories method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListRepositoriesRequest method. -// req, resp := client.ListRepositoriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositories -func (c *CodeCommit) ListRepositoriesRequest(input *ListRepositoriesInput) (req *request.Request, output *ListRepositoriesOutput) { - op := &request.Operation{ - Name: opListRepositories, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRepositoriesInput{} - } - - output = &ListRepositoriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRepositories API operation for AWS CodeCommit. -// -// Gets information about one or more repositories. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation ListRepositories for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidSortByException "InvalidSortByException" -// The specified sort by value is not valid. -// -// * ErrCodeInvalidOrderException "InvalidOrderException" -// The specified sort order is not valid. -// -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositories -func (c *CodeCommit) ListRepositories(input *ListRepositoriesInput) (*ListRepositoriesOutput, error) { - req, out := c.ListRepositoriesRequest(input) - err := req.Send() - return out, err -} - -// ListRepositoriesPages iterates over the pages of a ListRepositories operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRepositories 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 ListRepositories operation. -// pageNum := 0 -// err := client.ListRepositoriesPages(params, -// func(page *ListRepositoriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) ListRepositoriesPages(input *ListRepositoriesInput, fn func(p *ListRepositoriesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListRepositoriesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListRepositoriesOutput), lastPage) - }) -} - -const opPutRepositoryTriggers = "PutRepositoryTriggers" - -// PutRepositoryTriggersRequest generates a "aws/request.Request" representing the -// client's request for the PutRepositoryTriggers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutRepositoryTriggers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutRepositoryTriggers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutRepositoryTriggersRequest method. -// req, resp := client.PutRepositoryTriggersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggers -func (c *CodeCommit) PutRepositoryTriggersRequest(input *PutRepositoryTriggersInput) (req *request.Request, output *PutRepositoryTriggersOutput) { - op := &request.Operation{ - Name: opPutRepositoryTriggers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutRepositoryTriggersInput{} - } - - output = &PutRepositoryTriggersOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutRepositoryTriggers API operation for AWS CodeCommit. -// -// Replaces all triggers for a repository. This can be used to create or delete -// triggers. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation PutRepositoryTriggers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeRepositoryTriggersListRequiredException "RepositoryTriggersListRequiredException" -// The list of triggers for the repository is required but was not specified. -// -// * ErrCodeMaximumRepositoryTriggersExceededException "MaximumRepositoryTriggersExceededException" -// The number of triggers allowed for the repository was exceeded. -// -// * ErrCodeInvalidRepositoryTriggerNameException "InvalidRepositoryTriggerNameException" -// The name of the trigger is not valid. -// -// * ErrCodeInvalidRepositoryTriggerDestinationArnException "InvalidRepositoryTriggerDestinationArnException" -// The Amazon Resource Name (ARN) for the trigger is not valid for the specified -// destination. The most common reason for this error is that the ARN does not -// meet the requirements for the service type. -// -// * ErrCodeInvalidRepositoryTriggerRegionException "InvalidRepositoryTriggerRegionException" -// The region for the trigger target does not match the region for the repository. -// Triggers must be created in the same region as the target for the trigger. -// -// * ErrCodeInvalidRepositoryTriggerCustomDataException "InvalidRepositoryTriggerCustomDataException" -// The custom data provided for the trigger is not valid. -// -// * ErrCodeMaximumBranchesExceededException "MaximumBranchesExceededException" -// The number of branches for the trigger was exceeded. -// -// * ErrCodeInvalidRepositoryTriggerBranchNameException "InvalidRepositoryTriggerBranchNameException" -// One or more branch names specified for the trigger is not valid. -// -// * ErrCodeInvalidRepositoryTriggerEventsException "InvalidRepositoryTriggerEventsException" -// One or more events specified for the trigger is not valid. Check to make -// sure that all events specified match the requirements for allowed events. -// -// * ErrCodeRepositoryTriggerNameRequiredException "RepositoryTriggerNameRequiredException" -// A name for the trigger is required but was not specified. -// -// * ErrCodeRepositoryTriggerDestinationArnRequiredException "RepositoryTriggerDestinationArnRequiredException" -// A destination ARN for the target service for the trigger is required but -// was not specified. -// -// * ErrCodeRepositoryTriggerBranchNameListRequiredException "RepositoryTriggerBranchNameListRequiredException" -// At least one branch name is required but was not specified in the trigger -// configuration. -// -// * ErrCodeRepositoryTriggerEventsListRequiredException "RepositoryTriggerEventsListRequiredException" -// At least one event for the trigger is required but was not specified. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggers -func (c *CodeCommit) PutRepositoryTriggers(input *PutRepositoryTriggersInput) (*PutRepositoryTriggersOutput, error) { - req, out := c.PutRepositoryTriggersRequest(input) - err := req.Send() - return out, err -} - -const opTestRepositoryTriggers = "TestRepositoryTriggers" - -// TestRepositoryTriggersRequest generates a "aws/request.Request" representing the -// client's request for the TestRepositoryTriggers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TestRepositoryTriggers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TestRepositoryTriggers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TestRepositoryTriggersRequest method. -// req, resp := client.TestRepositoryTriggersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TestRepositoryTriggers -func (c *CodeCommit) TestRepositoryTriggersRequest(input *TestRepositoryTriggersInput) (req *request.Request, output *TestRepositoryTriggersOutput) { - op := &request.Operation{ - Name: opTestRepositoryTriggers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TestRepositoryTriggersInput{} - } - - output = &TestRepositoryTriggersOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestRepositoryTriggers API operation for AWS CodeCommit. -// -// Tests the functionality of repository triggers by sending information to -// the trigger target. If real data is available in the repository, the test -// will send data from the last commit. If no data is available, sample data -// will be generated. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation TestRepositoryTriggers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeRepositoryTriggersListRequiredException "RepositoryTriggersListRequiredException" -// The list of triggers for the repository is required but was not specified. -// -// * ErrCodeMaximumRepositoryTriggersExceededException "MaximumRepositoryTriggersExceededException" -// The number of triggers allowed for the repository was exceeded. -// -// * ErrCodeInvalidRepositoryTriggerNameException "InvalidRepositoryTriggerNameException" -// The name of the trigger is not valid. -// -// * ErrCodeInvalidRepositoryTriggerDestinationArnException "InvalidRepositoryTriggerDestinationArnException" -// The Amazon Resource Name (ARN) for the trigger is not valid for the specified -// destination. The most common reason for this error is that the ARN does not -// meet the requirements for the service type. -// -// * ErrCodeInvalidRepositoryTriggerRegionException "InvalidRepositoryTriggerRegionException" -// The region for the trigger target does not match the region for the repository. -// Triggers must be created in the same region as the target for the trigger. -// -// * ErrCodeInvalidRepositoryTriggerCustomDataException "InvalidRepositoryTriggerCustomDataException" -// The custom data provided for the trigger is not valid. -// -// * ErrCodeMaximumBranchesExceededException "MaximumBranchesExceededException" -// The number of branches for the trigger was exceeded. -// -// * ErrCodeInvalidRepositoryTriggerBranchNameException "InvalidRepositoryTriggerBranchNameException" -// One or more branch names specified for the trigger is not valid. -// -// * ErrCodeInvalidRepositoryTriggerEventsException "InvalidRepositoryTriggerEventsException" -// One or more events specified for the trigger is not valid. Check to make -// sure that all events specified match the requirements for allowed events. -// -// * ErrCodeRepositoryTriggerNameRequiredException "RepositoryTriggerNameRequiredException" -// A name for the trigger is required but was not specified. -// -// * ErrCodeRepositoryTriggerDestinationArnRequiredException "RepositoryTriggerDestinationArnRequiredException" -// A destination ARN for the target service for the trigger is required but -// was not specified. -// -// * ErrCodeRepositoryTriggerBranchNameListRequiredException "RepositoryTriggerBranchNameListRequiredException" -// At least one branch name is required but was not specified in the trigger -// configuration. -// -// * ErrCodeRepositoryTriggerEventsListRequiredException "RepositoryTriggerEventsListRequiredException" -// At least one event for the trigger is required but was not specified. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TestRepositoryTriggers -func (c *CodeCommit) TestRepositoryTriggers(input *TestRepositoryTriggersInput) (*TestRepositoryTriggersOutput, error) { - req, out := c.TestRepositoryTriggersRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDefaultBranch = "UpdateDefaultBranch" - -// UpdateDefaultBranchRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDefaultBranch operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDefaultBranch for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDefaultBranch method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDefaultBranchRequest method. -// req, resp := client.UpdateDefaultBranchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranch -func (c *CodeCommit) UpdateDefaultBranchRequest(input *UpdateDefaultBranchInput) (req *request.Request, output *UpdateDefaultBranchOutput) { - op := &request.Operation{ - Name: opUpdateDefaultBranch, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateDefaultBranchInput{} - } - - output = &UpdateDefaultBranchOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateDefaultBranch API operation for AWS CodeCommit. -// -// Sets or changes the default branch name for the specified repository. -// -// If you use this operation to change the default branch name to the current -// default branch name, a success message is returned even though the default -// branch did not change. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation UpdateDefaultBranch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. -// -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified branch name is not valid. -// -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" -// The specified branch does not exist. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranch -func (c *CodeCommit) UpdateDefaultBranch(input *UpdateDefaultBranchInput) (*UpdateDefaultBranchOutput, error) { - req, out := c.UpdateDefaultBranchRequest(input) - err := req.Send() - return out, err -} - -const opUpdateRepositoryDescription = "UpdateRepositoryDescription" - -// UpdateRepositoryDescriptionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRepositoryDescription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateRepositoryDescription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateRepositoryDescription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateRepositoryDescriptionRequest method. -// req, resp := client.UpdateRepositoryDescriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryDescription -func (c *CodeCommit) UpdateRepositoryDescriptionRequest(input *UpdateRepositoryDescriptionInput) (req *request.Request, output *UpdateRepositoryDescriptionOutput) { - op := &request.Operation{ - Name: opUpdateRepositoryDescription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateRepositoryDescriptionInput{} - } - - output = &UpdateRepositoryDescriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateRepositoryDescription API operation for AWS CodeCommit. -// -// Sets or changes the comment or description for a repository. -// -// The description field for a repository accepts all HTML characters and all -// valid Unicode characters. Applications that do not HTML-encode the description -// and display it in a web page could expose users to potentially malicious -// code. Make sure that you HTML-encode the description field in any application -// that uses this API to display the repository description on a web page. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeCommit's -// API operation UpdateRepositoryDescription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// * ErrCodeInvalidRepositoryDescriptionException "InvalidRepositoryDescriptionException" -// The specified repository description is not valid. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. -// -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. -// -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. -// -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. -// -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryDescription -func (c *CodeCommit) UpdateRepositoryDescription(input *UpdateRepositoryDescriptionInput) (*UpdateRepositoryDescriptionOutput, error) { - req, out := c.UpdateRepositoryDescriptionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateRepositoryName = "UpdateRepositoryName" - -// UpdateRepositoryNameRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRepositoryName operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateRepositoryName for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateRepositoryName method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateRepositoryNameRequest method. -// req, resp := client.UpdateRepositoryNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryName -func (c *CodeCommit) UpdateRepositoryNameRequest(input *UpdateRepositoryNameInput) (req *request.Request, output *UpdateRepositoryNameOutput) { - op := &request.Operation{ - Name: opUpdateRepositoryName, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateRepositoryNameInput{} - } - - output = &UpdateRepositoryNameOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateRepositoryName API operation for AWS CodeCommit. -// -// Renames a repository. The repository name must be unique across the calling -// AWS account. In addition, repository names are limited to 100 alphanumeric, -// dash, and underscore characters, and cannot include certain characters. The -// suffix ".git" is prohibited. For a full description of the limits on repository -// names, see Limits (http://docs.aws.amazon.com/codecommit/latest/userguide/limits.html) -// in the AWS CodeCommit 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 AWS CodeCommit's -// API operation UpdateRepositoryName for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. -// -// * ErrCodeRepositoryNameExistsException "RepositoryNameExistsException" -// The specified repository name already exists. -// -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. -// -// This exception only occurs when a specified repository name is not valid. -// Other exceptions occur when a required repository parameter is missing, or -// when a specified repository does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryName -func (c *CodeCommit) UpdateRepositoryName(input *UpdateRepositoryNameInput) (*UpdateRepositoryNameOutput, error) { - req, out := c.UpdateRepositoryNameRequest(input) - err := req.Send() - return out, err -} - -// Represents the input of a batch get repositories operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetRepositoriesInput -type BatchGetRepositoriesInput struct { - _ struct{} `type:"structure"` - - // The names of the repositories to get information about. - // - // RepositoryNames is a required field - RepositoryNames []*string `locationName:"repositoryNames" type:"list" required:"true"` -} - -// String returns the string representation -func (s BatchGetRepositoriesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetRepositoriesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetRepositoriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetRepositoriesInput"} - if s.RepositoryNames == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryNames sets the RepositoryNames field's value. -func (s *BatchGetRepositoriesInput) SetRepositoryNames(v []*string) *BatchGetRepositoriesInput { - s.RepositoryNames = v - return s -} - -// Represents the output of a batch get repositories operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetRepositoriesOutput -type BatchGetRepositoriesOutput struct { - _ struct{} `type:"structure"` - - // A list of repositories returned by the batch get repositories operation. - Repositories []*RepositoryMetadata `locationName:"repositories" type:"list"` - - // Returns a list of repository names for which information could not be found. - RepositoriesNotFound []*string `locationName:"repositoriesNotFound" type:"list"` -} - -// String returns the string representation -func (s BatchGetRepositoriesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetRepositoriesOutput) GoString() string { - return s.String() -} - -// SetRepositories sets the Repositories field's value. -func (s *BatchGetRepositoriesOutput) SetRepositories(v []*RepositoryMetadata) *BatchGetRepositoriesOutput { - s.Repositories = v - return s -} - -// SetRepositoriesNotFound sets the RepositoriesNotFound field's value. -func (s *BatchGetRepositoriesOutput) SetRepositoriesNotFound(v []*string) *BatchGetRepositoriesOutput { - s.RepositoriesNotFound = v - return s -} - -// Returns information about a specific Git blob object. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BlobMetadata -type BlobMetadata struct { - _ struct{} `type:"structure"` - - // The full ID of the blob. - BlobId *string `locationName:"blobId" type:"string"` - - // The file mode permissions of the blob. File mode permission codes include: - // - // * 100644 indicates read/write - // - // * 100755 indicates read/write/execute - // - // * 160000 indicates a submodule - // - // * 120000 indicates a symlink - Mode *string `locationName:"mode" type:"string"` - - // The path to the blob and any associated file name, if any. - Path *string `locationName:"path" type:"string"` -} - -// String returns the string representation -func (s BlobMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BlobMetadata) GoString() string { - return s.String() -} - -// SetBlobId sets the BlobId field's value. -func (s *BlobMetadata) SetBlobId(v string) *BlobMetadata { - s.BlobId = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *BlobMetadata) SetMode(v string) *BlobMetadata { - s.Mode = &v - return s -} - -// SetPath sets the Path field's value. -func (s *BlobMetadata) SetPath(v string) *BlobMetadata { - s.Path = &v - return s -} - -// Returns information about a branch. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BranchInfo -type BranchInfo struct { - _ struct{} `type:"structure"` - - // The name of the branch. - BranchName *string `locationName:"branchName" min:"1" type:"string"` - - // The ID of the last commit made to the branch. - CommitId *string `locationName:"commitId" type:"string"` -} - -// String returns the string representation -func (s BranchInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BranchInfo) GoString() string { - return s.String() -} - -// SetBranchName sets the BranchName field's value. -func (s *BranchInfo) SetBranchName(v string) *BranchInfo { - s.BranchName = &v - return s -} - -// SetCommitId sets the CommitId field's value. -func (s *BranchInfo) SetCommitId(v string) *BranchInfo { - s.CommitId = &v - return s -} - -// Returns information about a specific commit. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/Commit -type Commit struct { - _ struct{} `type:"structure"` - - // Any additional data associated with the specified commit. - AdditionalData *string `locationName:"additionalData" type:"string"` - - // Information about the author of the specified commit. Information includes - // the date in timestamp format with GMT offset, the name of the author, and - // the email address for the author, as configured in Git. - Author *UserInfo `locationName:"author" type:"structure"` - - // Information about the person who committed the specified commit, also known - // as the committer. Information includes the date in timestamp format with - // GMT offset, the name of the committer, and the email address for the committer, - // as configured in Git. - // - // For more information about the difference between an author and a committer - // in Git, see Viewing the Commit History (http://git-scm.com/book/ch2-3.html) - // in Pro Git by Scott Chacon and Ben Straub. - Committer *UserInfo `locationName:"committer" type:"structure"` - - // The commit message associated with the specified commit. - Message *string `locationName:"message" type:"string"` - - // The parent list for the specified commit. - Parents []*string `locationName:"parents" type:"list"` - - // Tree information for the specified commit. - TreeId *string `locationName:"treeId" type:"string"` -} - -// String returns the string representation -func (s Commit) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Commit) GoString() string { - return s.String() -} - -// SetAdditionalData sets the AdditionalData field's value. -func (s *Commit) SetAdditionalData(v string) *Commit { - s.AdditionalData = &v - return s -} - -// SetAuthor sets the Author field's value. -func (s *Commit) SetAuthor(v *UserInfo) *Commit { - s.Author = v - return s -} - -// SetCommitter sets the Committer field's value. -func (s *Commit) SetCommitter(v *UserInfo) *Commit { - s.Committer = v - return s -} - -// SetMessage sets the Message field's value. -func (s *Commit) SetMessage(v string) *Commit { - s.Message = &v - return s -} - -// SetParents sets the Parents field's value. -func (s *Commit) SetParents(v []*string) *Commit { - s.Parents = v - return s -} - -// SetTreeId sets the TreeId field's value. -func (s *Commit) SetTreeId(v string) *Commit { - s.TreeId = &v - return s -} - -// Represents the input of a create branch operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranchInput -type CreateBranchInput struct { - _ struct{} `type:"structure"` - - // The name of the new branch to create. - // - // BranchName is a required field - BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` - - // The ID of the commit to point the new branch to. - // - // CommitId is a required field - CommitId *string `locationName:"commitId" type:"string" required:"true"` - - // The name of the repository in which you want to create the new branch. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateBranchInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateBranchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateBranchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateBranchInput"} - if s.BranchName == nil { - invalidParams.Add(request.NewErrParamRequired("BranchName")) - } - if s.BranchName != nil && len(*s.BranchName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BranchName", 1)) - } - if s.CommitId == nil { - invalidParams.Add(request.NewErrParamRequired("CommitId")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBranchName sets the BranchName field's value. -func (s *CreateBranchInput) SetBranchName(v string) *CreateBranchInput { - s.BranchName = &v - return s -} - -// SetCommitId sets the CommitId field's value. -func (s *CreateBranchInput) SetCommitId(v string) *CreateBranchInput { - s.CommitId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *CreateBranchInput) SetRepositoryName(v string) *CreateBranchInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranchOutput -type CreateBranchOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateBranchOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateBranchOutput) GoString() string { - return s.String() -} - -// Represents the input of a create repository operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateRepositoryInput -type CreateRepositoryInput struct { - _ struct{} `type:"structure"` - - // A comment or description about the new repository. - // - // The description field for a repository accepts all HTML characters and all - // valid Unicode characters. Applications that do not HTML-encode the description - // and display it in a web page could expose users to potentially malicious - // code. Make sure that you HTML-encode the description field in any application - // that uses this API to display the repository description on a web page. - RepositoryDescription *string `locationName:"repositoryDescription" type:"string"` - - // The name of the new repository to be created. - // - // The repository name must be unique across the calling AWS account. In addition, - // repository names are limited to 100 alphanumeric, dash, and underscore characters, - // and cannot include certain characters. For a full description of the limits - // on repository names, see Limits (http://docs.aws.amazon.com/codecommit/latest/userguide/limits.html) - // in the AWS CodeCommit User Guide. The suffix ".git" is prohibited. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateRepositoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRepositoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRepositoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRepositoryInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryDescription sets the RepositoryDescription field's value. -func (s *CreateRepositoryInput) SetRepositoryDescription(v string) *CreateRepositoryInput { - s.RepositoryDescription = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *CreateRepositoryInput) SetRepositoryName(v string) *CreateRepositoryInput { - s.RepositoryName = &v - return s -} - -// Represents the output of a create repository operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateRepositoryOutput -type CreateRepositoryOutput struct { - _ struct{} `type:"structure"` - - // Information about the newly created repository. - RepositoryMetadata *RepositoryMetadata `locationName:"repositoryMetadata" type:"structure"` -} - -// String returns the string representation -func (s CreateRepositoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRepositoryOutput) GoString() string { - return s.String() -} - -// SetRepositoryMetadata sets the RepositoryMetadata field's value. -func (s *CreateRepositoryOutput) SetRepositoryMetadata(v *RepositoryMetadata) *CreateRepositoryOutput { - s.RepositoryMetadata = v - return s -} - -// Represents the input of a delete repository operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepositoryInput -type DeleteRepositoryInput struct { - _ struct{} `type:"structure"` - - // The name of the repository to delete. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRepositoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRepositoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRepositoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRepositoryInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *DeleteRepositoryInput) SetRepositoryName(v string) *DeleteRepositoryInput { - s.RepositoryName = &v - return s -} - -// Represents the output of a delete repository operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepositoryOutput -type DeleteRepositoryOutput struct { - _ struct{} `type:"structure"` - - // The ID of the repository that was deleted. - RepositoryId *string `locationName:"repositoryId" type:"string"` -} - -// String returns the string representation -func (s DeleteRepositoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRepositoryOutput) GoString() string { - return s.String() -} - -// SetRepositoryId sets the RepositoryId field's value. -func (s *DeleteRepositoryOutput) SetRepositoryId(v string) *DeleteRepositoryOutput { - s.RepositoryId = &v - return s -} - -// Returns information about a set of differences for a commit specifier. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/Difference -type Difference struct { - _ struct{} `type:"structure"` - - // Information about an afterBlob data type object, including the ID, the file - // mode permission code, and the path. - AfterBlob *BlobMetadata `locationName:"afterBlob" type:"structure"` - - // Information about a beforeBlob data type object, including the ID, the file - // mode permission code, and the path. - BeforeBlob *BlobMetadata `locationName:"beforeBlob" type:"structure"` - - // Whether the change type of the difference is an addition (A), deletion (D), - // or modification (M). - ChangeType *string `locationName:"changeType" type:"string" enum:"ChangeTypeEnum"` -} - -// String returns the string representation -func (s Difference) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Difference) GoString() string { - return s.String() -} - -// SetAfterBlob sets the AfterBlob field's value. -func (s *Difference) SetAfterBlob(v *BlobMetadata) *Difference { - s.AfterBlob = v - return s -} - -// SetBeforeBlob sets the BeforeBlob field's value. -func (s *Difference) SetBeforeBlob(v *BlobMetadata) *Difference { - s.BeforeBlob = v - return s -} - -// SetChangeType sets the ChangeType field's value. -func (s *Difference) SetChangeType(v string) *Difference { - s.ChangeType = &v - return s -} - -// Represents the input of a get blob operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBlobInput -type GetBlobInput struct { - _ struct{} `type:"structure"` - - // The ID of the blob, which is its SHA-1 pointer. - // - // BlobId is a required field - BlobId *string `locationName:"blobId" type:"string" required:"true"` - - // The name of the repository that contains the blob. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBlobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBlobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBlobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBlobInput"} - if s.BlobId == nil { - invalidParams.Add(request.NewErrParamRequired("BlobId")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlobId sets the BlobId field's value. -func (s *GetBlobInput) SetBlobId(v string) *GetBlobInput { - s.BlobId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetBlobInput) SetRepositoryName(v string) *GetBlobInput { - s.RepositoryName = &v - return s -} - -// Represents the output of a get blob operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBlobOutput -type GetBlobOutput struct { - _ struct{} `type:"structure"` - - // The content of the blob, usually a file. - // - // Content is automatically base64 encoded/decoded by the SDK. - // - // Content is a required field - Content []byte `locationName:"content" type:"blob" required:"true"` -} - -// String returns the string representation -func (s GetBlobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBlobOutput) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *GetBlobOutput) SetContent(v []byte) *GetBlobOutput { - s.Content = v - return s -} - -// Represents the input of a get branch operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBranchInput -type GetBranchInput struct { - _ struct{} `type:"structure"` - - // The name of the branch for which you want to retrieve information. - BranchName *string `locationName:"branchName" min:"1" type:"string"` - - // The name of the repository that contains the branch for which you want to - // retrieve information. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetBranchInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBranchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBranchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBranchInput"} - if s.BranchName != nil && len(*s.BranchName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BranchName", 1)) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBranchName sets the BranchName field's value. -func (s *GetBranchInput) SetBranchName(v string) *GetBranchInput { - s.BranchName = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetBranchInput) SetRepositoryName(v string) *GetBranchInput { - s.RepositoryName = &v - return s -} - -// Represents the output of a get branch operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBranchOutput -type GetBranchOutput struct { - _ struct{} `type:"structure"` - - // The name of the branch. - Branch *BranchInfo `locationName:"branch" type:"structure"` -} - -// String returns the string representation -func (s GetBranchOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBranchOutput) GoString() string { - return s.String() -} - -// SetBranch sets the Branch field's value. -func (s *GetBranchOutput) SetBranch(v *BranchInfo) *GetBranchOutput { - s.Branch = v - return s -} - -// Represents the input of a get commit operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommitInput -type GetCommitInput struct { - _ struct{} `type:"structure"` - - // The commit ID. - // - // CommitId is a required field - CommitId *string `locationName:"commitId" type:"string" required:"true"` - - // The name of the repository to which the commit was made. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetCommitInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCommitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCommitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCommitInput"} - if s.CommitId == nil { - invalidParams.Add(request.NewErrParamRequired("CommitId")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommitId sets the CommitId field's value. -func (s *GetCommitInput) SetCommitId(v string) *GetCommitInput { - s.CommitId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetCommitInput) SetRepositoryName(v string) *GetCommitInput { - s.RepositoryName = &v - return s -} - -// Represents the output of a get commit operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommitOutput -type GetCommitOutput struct { - _ struct{} `type:"structure"` - - // A commit data type object that contains information about the specified commit. - // - // Commit is a required field - Commit *Commit `locationName:"commit" type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetCommitOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCommitOutput) GoString() string { - return s.String() -} - -// SetCommit sets the Commit field's value. -func (s *GetCommitOutput) SetCommit(v *Commit) *GetCommitOutput { - s.Commit = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetDifferencesInput -type GetDifferencesInput struct { - _ struct{} `type:"structure"` - - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. - // - // AfterCommitSpecifier is a required field - AfterCommitSpecifier *string `locationName:"afterCommitSpecifier" type:"string" required:"true"` - - // The file path in which to check differences. Limits the results to this path. - // Can also be used to specify the changed name of a directory or folder, if - // it has changed. If not specified, differences will be shown for all paths. - AfterPath *string `locationName:"afterPath" type:"string"` - - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, the full commit ID. Optional. If not specified, all - // changes prior to the afterCommitSpecifier value will be shown. If you do - // not use beforeCommitSpecifier in your request, consider limiting the results - // with maxResults. - BeforeCommitSpecifier *string `locationName:"beforeCommitSpecifier" type:"string"` - - // The file path in which to check for differences. Limits the results to this - // path. Can also be used to specify the previous name of a directory or folder. - // If beforePath and afterPath are not specified, differences will be shown - // for all paths. - BeforePath *string `locationName:"beforePath" type:"string"` - - // A non-negative integer used to limit the number of returned results. - MaxResults *int64 `type:"integer"` - - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `type:"string"` - - // The name of the repository where you want to get differences. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDifferencesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDifferencesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDifferencesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDifferencesInput"} - if s.AfterCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("AfterCommitSpecifier")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAfterCommitSpecifier sets the AfterCommitSpecifier field's value. -func (s *GetDifferencesInput) SetAfterCommitSpecifier(v string) *GetDifferencesInput { - s.AfterCommitSpecifier = &v - return s -} - -// SetAfterPath sets the AfterPath field's value. -func (s *GetDifferencesInput) SetAfterPath(v string) *GetDifferencesInput { - s.AfterPath = &v - return s -} - -// SetBeforeCommitSpecifier sets the BeforeCommitSpecifier field's value. -func (s *GetDifferencesInput) SetBeforeCommitSpecifier(v string) *GetDifferencesInput { - s.BeforeCommitSpecifier = &v - return s -} - -// SetBeforePath sets the BeforePath field's value. -func (s *GetDifferencesInput) SetBeforePath(v string) *GetDifferencesInput { - s.BeforePath = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetDifferencesInput) SetMaxResults(v int64) *GetDifferencesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetDifferencesInput) SetNextToken(v string) *GetDifferencesInput { - s.NextToken = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetDifferencesInput) SetRepositoryName(v string) *GetDifferencesInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetDifferencesOutput -type GetDifferencesOutput struct { - _ struct{} `type:"structure"` - - // A differences data type object that contains information about the differences, - // including whether the difference is added, modified, or deleted (A, D, M). - Differences []*Difference `locationName:"differences" type:"list"` - - // An enumeration token that can be used in a request to return the next batch - // of the results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s GetDifferencesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDifferencesOutput) GoString() string { - return s.String() -} - -// SetDifferences sets the Differences field's value. -func (s *GetDifferencesOutput) SetDifferences(v []*Difference) *GetDifferencesOutput { - s.Differences = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetDifferencesOutput) SetNextToken(v string) *GetDifferencesOutput { - s.NextToken = &v - return s -} - -// Represents the input of a get repository operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryInput -type GetRepositoryInput struct { - _ struct{} `type:"structure"` - - // The name of the repository to get information about. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRepositoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRepositoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRepositoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRepositoryInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetRepositoryInput) SetRepositoryName(v string) *GetRepositoryInput { - s.RepositoryName = &v - return s -} - -// Represents the output of a get repository operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryOutput -type GetRepositoryOutput struct { - _ struct{} `type:"structure"` - - // Information about the repository. - RepositoryMetadata *RepositoryMetadata `locationName:"repositoryMetadata" type:"structure"` -} - -// String returns the string representation -func (s GetRepositoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRepositoryOutput) GoString() string { - return s.String() -} - -// SetRepositoryMetadata sets the RepositoryMetadata field's value. -func (s *GetRepositoryOutput) SetRepositoryMetadata(v *RepositoryMetadata) *GetRepositoryOutput { - s.RepositoryMetadata = v - return s -} - -// Represents the input of a get repository triggers operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryTriggersInput -type GetRepositoryTriggersInput struct { - _ struct{} `type:"structure"` - - // The name of the repository for which the trigger is configured. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRepositoryTriggersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRepositoryTriggersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRepositoryTriggersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRepositoryTriggersInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetRepositoryTriggersInput) SetRepositoryName(v string) *GetRepositoryTriggersInput { - s.RepositoryName = &v - return s -} - -// Represents the output of a get repository triggers operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryTriggersOutput -type GetRepositoryTriggersOutput struct { - _ struct{} `type:"structure"` - - // The system-generated unique ID for the trigger. - ConfigurationId *string `locationName:"configurationId" type:"string"` - - // The JSON block of configuration information for each trigger. - Triggers []*RepositoryTrigger `locationName:"triggers" type:"list"` -} - -// String returns the string representation -func (s GetRepositoryTriggersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRepositoryTriggersOutput) GoString() string { - return s.String() -} - -// SetConfigurationId sets the ConfigurationId field's value. -func (s *GetRepositoryTriggersOutput) SetConfigurationId(v string) *GetRepositoryTriggersOutput { - s.ConfigurationId = &v - return s -} - -// SetTriggers sets the Triggers field's value. -func (s *GetRepositoryTriggersOutput) SetTriggers(v []*RepositoryTrigger) *GetRepositoryTriggersOutput { - s.Triggers = v - return s -} - -// Represents the input of a list branches operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListBranchesInput -type ListBranchesInput struct { - _ struct{} `type:"structure"` - - // An enumeration token that allows the operation to batch the results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The name of the repository that contains the branches. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListBranchesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBranchesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBranchesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBranchesInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBranchesInput) SetNextToken(v string) *ListBranchesInput { - s.NextToken = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *ListBranchesInput) SetRepositoryName(v string) *ListBranchesInput { - s.RepositoryName = &v - return s -} - -// Represents the output of a list branches operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListBranchesOutput -type ListBranchesOutput struct { - _ struct{} `type:"structure"` - - // The list of branch names. - Branches []*string `locationName:"branches" type:"list"` - - // An enumeration token that returns the batch of the results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListBranchesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBranchesOutput) GoString() string { - return s.String() -} - -// SetBranches sets the Branches field's value. -func (s *ListBranchesOutput) SetBranches(v []*string) *ListBranchesOutput { - s.Branches = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBranchesOutput) SetNextToken(v string) *ListBranchesOutput { - s.NextToken = &v - return s -} - -// Represents the input of a list repositories operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositoriesInput -type ListRepositoriesInput struct { - _ struct{} `type:"structure"` - - // An enumeration token that allows the operation to batch the results of the - // operation. Batch sizes are 1,000 for list repository operations. When the - // client sends the token back to AWS CodeCommit, another page of 1,000 records - // is retrieved. - NextToken *string `locationName:"nextToken" type:"string"` - - // The order in which to sort the results of a list repositories operation. - Order *string `locationName:"order" type:"string" enum:"OrderEnum"` - - // The criteria used to sort the results of a list repositories operation. - SortBy *string `locationName:"sortBy" type:"string" enum:"SortByEnum"` -} - -// String returns the string representation -func (s ListRepositoriesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRepositoriesInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRepositoriesInput) SetNextToken(v string) *ListRepositoriesInput { - s.NextToken = &v - return s -} - -// SetOrder sets the Order field's value. -func (s *ListRepositoriesInput) SetOrder(v string) *ListRepositoriesInput { - s.Order = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListRepositoriesInput) SetSortBy(v string) *ListRepositoriesInput { - s.SortBy = &v - return s -} - -// Represents the output of a list repositories operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositoriesOutput -type ListRepositoriesOutput struct { - _ struct{} `type:"structure"` - - // An enumeration token that allows the operation to batch the results of the - // operation. Batch sizes are 1,000 for list repository operations. When the - // client sends the token back to AWS CodeCommit, another page of 1,000 records - // is retrieved. - NextToken *string `locationName:"nextToken" type:"string"` - - // Lists the repositories called by the list repositories operation. - Repositories []*RepositoryNameIdPair `locationName:"repositories" type:"list"` -} - -// String returns the string representation -func (s ListRepositoriesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRepositoriesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRepositoriesOutput) SetNextToken(v string) *ListRepositoriesOutput { - s.NextToken = &v - return s -} - -// SetRepositories sets the Repositories field's value. -func (s *ListRepositoriesOutput) SetRepositories(v []*RepositoryNameIdPair) *ListRepositoriesOutput { - s.Repositories = v - return s -} - -// Represents the input ofa put repository triggers operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggersInput -type PutRepositoryTriggersInput struct { - _ struct{} `type:"structure"` - - // The name of the repository where you want to create or update the trigger. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` - - // The JSON block of configuration information for each trigger. - // - // Triggers is a required field - Triggers []*RepositoryTrigger `locationName:"triggers" type:"list" required:"true"` -} - -// String returns the string representation -func (s PutRepositoryTriggersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRepositoryTriggersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRepositoryTriggersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRepositoryTriggersInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - if s.Triggers == nil { - invalidParams.Add(request.NewErrParamRequired("Triggers")) - } - if s.Triggers != nil { - for i, v := range s.Triggers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Triggers", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *PutRepositoryTriggersInput) SetRepositoryName(v string) *PutRepositoryTriggersInput { - s.RepositoryName = &v - return s -} - -// SetTriggers sets the Triggers field's value. -func (s *PutRepositoryTriggersInput) SetTriggers(v []*RepositoryTrigger) *PutRepositoryTriggersInput { - s.Triggers = v - return s -} - -// Represents the output of a put repository triggers operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggersOutput -type PutRepositoryTriggersOutput struct { - _ struct{} `type:"structure"` - - // The system-generated unique ID for the create or update operation. - ConfigurationId *string `locationName:"configurationId" type:"string"` -} - -// String returns the string representation -func (s PutRepositoryTriggersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRepositoryTriggersOutput) GoString() string { - return s.String() -} - -// SetConfigurationId sets the ConfigurationId field's value. -func (s *PutRepositoryTriggersOutput) SetConfigurationId(v string) *PutRepositoryTriggersOutput { - s.ConfigurationId = &v - return s -} - -// Information about a repository. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/RepositoryMetadata -type RepositoryMetadata struct { - _ struct{} `type:"structure"` - - // The ID of the AWS account associated with the repository. - AccountId *string `locationName:"accountId" type:"string"` - - // The Amazon Resource Name (ARN) of the repository. - Arn *string `type:"string"` - - // The URL to use for cloning the repository over HTTPS. - CloneUrlHttp *string `locationName:"cloneUrlHttp" type:"string"` - - // The URL to use for cloning the repository over SSH. - CloneUrlSsh *string `locationName:"cloneUrlSsh" type:"string"` - - // The date and time the repository was created, in timestamp format. - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix"` - - // The repository's default branch name. - DefaultBranch *string `locationName:"defaultBranch" min:"1" type:"string"` - - // The date and time the repository was last modified, in timestamp format. - LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp" timestampFormat:"unix"` - - // A comment or description about the repository. - RepositoryDescription *string `locationName:"repositoryDescription" type:"string"` - - // The ID of the repository. - RepositoryId *string `locationName:"repositoryId" type:"string"` - - // The repository's name. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` -} - -// String returns the string representation -func (s RepositoryMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RepositoryMetadata) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *RepositoryMetadata) SetAccountId(v string) *RepositoryMetadata { - s.AccountId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *RepositoryMetadata) SetArn(v string) *RepositoryMetadata { - s.Arn = &v - return s -} - -// SetCloneUrlHttp sets the CloneUrlHttp field's value. -func (s *RepositoryMetadata) SetCloneUrlHttp(v string) *RepositoryMetadata { - s.CloneUrlHttp = &v - return s -} - -// SetCloneUrlSsh sets the CloneUrlSsh field's value. -func (s *RepositoryMetadata) SetCloneUrlSsh(v string) *RepositoryMetadata { - s.CloneUrlSsh = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *RepositoryMetadata) SetCreationDate(v time.Time) *RepositoryMetadata { - s.CreationDate = &v - return s -} - -// SetDefaultBranch sets the DefaultBranch field's value. -func (s *RepositoryMetadata) SetDefaultBranch(v string) *RepositoryMetadata { - s.DefaultBranch = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *RepositoryMetadata) SetLastModifiedDate(v time.Time) *RepositoryMetadata { - s.LastModifiedDate = &v - return s -} - -// SetRepositoryDescription sets the RepositoryDescription field's value. -func (s *RepositoryMetadata) SetRepositoryDescription(v string) *RepositoryMetadata { - s.RepositoryDescription = &v - return s -} - -// SetRepositoryId sets the RepositoryId field's value. -func (s *RepositoryMetadata) SetRepositoryId(v string) *RepositoryMetadata { - s.RepositoryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *RepositoryMetadata) SetRepositoryName(v string) *RepositoryMetadata { - s.RepositoryName = &v - return s -} - -// Information about a repository name and ID. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/RepositoryNameIdPair -type RepositoryNameIdPair struct { - _ struct{} `type:"structure"` - - // The ID associated with the repository. - RepositoryId *string `locationName:"repositoryId" type:"string"` - - // The name associated with the repository. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` -} - -// String returns the string representation -func (s RepositoryNameIdPair) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RepositoryNameIdPair) GoString() string { - return s.String() -} - -// SetRepositoryId sets the RepositoryId field's value. -func (s *RepositoryNameIdPair) SetRepositoryId(v string) *RepositoryNameIdPair { - s.RepositoryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *RepositoryNameIdPair) SetRepositoryName(v string) *RepositoryNameIdPair { - s.RepositoryName = &v - return s -} - -// Information about a trigger for a repository. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/RepositoryTrigger -type RepositoryTrigger struct { - _ struct{} `type:"structure"` - - // The branches that will be included in the trigger configuration. If no branches - // are specified, the trigger will apply to all branches. - Branches []*string `locationName:"branches" type:"list"` - - // Any custom data associated with the trigger that will be included in the - // information sent to the target of the trigger. - CustomData *string `locationName:"customData" type:"string"` - - // The ARN of the resource that is the target for a trigger. For example, the - // ARN of a topic in Amazon Simple Notification Service (SNS). - // - // DestinationArn is a required field - DestinationArn *string `locationName:"destinationArn" type:"string" required:"true"` - - // The repository events that will cause the trigger to run actions in another - // service, such as sending a notification through Amazon Simple Notification - // Service (SNS). - // - // The valid value "all" cannot be used with any other values. - // - // Events is a required field - Events []*string `locationName:"events" type:"list" required:"true"` - - // The name of the trigger. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` -} - -// String returns the string representation -func (s RepositoryTrigger) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RepositoryTrigger) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RepositoryTrigger) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RepositoryTrigger"} - if s.DestinationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationArn")) - } - if s.Events == nil { - invalidParams.Add(request.NewErrParamRequired("Events")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBranches sets the Branches field's value. -func (s *RepositoryTrigger) SetBranches(v []*string) *RepositoryTrigger { - s.Branches = v - return s -} - -// SetCustomData sets the CustomData field's value. -func (s *RepositoryTrigger) SetCustomData(v string) *RepositoryTrigger { - s.CustomData = &v - return s -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *RepositoryTrigger) SetDestinationArn(v string) *RepositoryTrigger { - s.DestinationArn = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *RepositoryTrigger) SetEvents(v []*string) *RepositoryTrigger { - s.Events = v - return s -} - -// SetName sets the Name field's value. -func (s *RepositoryTrigger) SetName(v string) *RepositoryTrigger { - s.Name = &v - return s -} - -// A trigger failed to run. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/RepositoryTriggerExecutionFailure -type RepositoryTriggerExecutionFailure struct { - _ struct{} `type:"structure"` - - // Additional message information about the trigger that did not run. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // The name of the trigger that did not run. - Trigger *string `locationName:"trigger" type:"string"` -} - -// String returns the string representation -func (s RepositoryTriggerExecutionFailure) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RepositoryTriggerExecutionFailure) GoString() string { - return s.String() -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *RepositoryTriggerExecutionFailure) SetFailureMessage(v string) *RepositoryTriggerExecutionFailure { - s.FailureMessage = &v - return s -} - -// SetTrigger sets the Trigger field's value. -func (s *RepositoryTriggerExecutionFailure) SetTrigger(v string) *RepositoryTriggerExecutionFailure { - s.Trigger = &v - return s -} - -// Represents the input of a test repository triggers operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TestRepositoryTriggersInput -type TestRepositoryTriggersInput struct { - _ struct{} `type:"structure"` - - // The name of the repository in which to test the triggers. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` - - // The list of triggers to test. - // - // Triggers is a required field - Triggers []*RepositoryTrigger `locationName:"triggers" type:"list" required:"true"` -} - -// String returns the string representation -func (s TestRepositoryTriggersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestRepositoryTriggersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestRepositoryTriggersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestRepositoryTriggersInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - if s.Triggers == nil { - invalidParams.Add(request.NewErrParamRequired("Triggers")) - } - if s.Triggers != nil { - for i, v := range s.Triggers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Triggers", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *TestRepositoryTriggersInput) SetRepositoryName(v string) *TestRepositoryTriggersInput { - s.RepositoryName = &v - return s -} - -// SetTriggers sets the Triggers field's value. -func (s *TestRepositoryTriggersInput) SetTriggers(v []*RepositoryTrigger) *TestRepositoryTriggersInput { - s.Triggers = v - return s -} - -// Represents the output of a test repository triggers operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TestRepositoryTriggersOutput -type TestRepositoryTriggersOutput struct { - _ struct{} `type:"structure"` - - // The list of triggers that were not able to be tested. This list provides - // the names of the triggers that could not be tested, separated by commas. - FailedExecutions []*RepositoryTriggerExecutionFailure `locationName:"failedExecutions" type:"list"` - - // The list of triggers that were successfully tested. This list provides the - // names of the triggers that were successfully tested, separated by commas. - SuccessfulExecutions []*string `locationName:"successfulExecutions" type:"list"` -} - -// String returns the string representation -func (s TestRepositoryTriggersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestRepositoryTriggersOutput) GoString() string { - return s.String() -} - -// SetFailedExecutions sets the FailedExecutions field's value. -func (s *TestRepositoryTriggersOutput) SetFailedExecutions(v []*RepositoryTriggerExecutionFailure) *TestRepositoryTriggersOutput { - s.FailedExecutions = v - return s -} - -// SetSuccessfulExecutions sets the SuccessfulExecutions field's value. -func (s *TestRepositoryTriggersOutput) SetSuccessfulExecutions(v []*string) *TestRepositoryTriggersOutput { - s.SuccessfulExecutions = v - return s -} - -// Represents the input of an update default branch operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranchInput -type UpdateDefaultBranchInput struct { - _ struct{} `type:"structure"` - - // The name of the branch to set as the default. - // - // DefaultBranchName is a required field - DefaultBranchName *string `locationName:"defaultBranchName" min:"1" type:"string" required:"true"` - - // The name of the repository to set or change the default branch for. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateDefaultBranchInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDefaultBranchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDefaultBranchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDefaultBranchInput"} - if s.DefaultBranchName == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultBranchName")) - } - if s.DefaultBranchName != nil && len(*s.DefaultBranchName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DefaultBranchName", 1)) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultBranchName sets the DefaultBranchName field's value. -func (s *UpdateDefaultBranchInput) SetDefaultBranchName(v string) *UpdateDefaultBranchInput { - s.DefaultBranchName = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *UpdateDefaultBranchInput) SetRepositoryName(v string) *UpdateDefaultBranchInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranchOutput -type UpdateDefaultBranchOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateDefaultBranchOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDefaultBranchOutput) GoString() string { - return s.String() -} - -// Represents the input of an update repository description operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryDescriptionInput -type UpdateRepositoryDescriptionInput struct { - _ struct{} `type:"structure"` - - // The new comment or description for the specified repository. Repository descriptions - // are limited to 1,000 characters. - RepositoryDescription *string `locationName:"repositoryDescription" type:"string"` - - // The name of the repository to set or change the comment or description for. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateRepositoryDescriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRepositoryDescriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRepositoryDescriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRepositoryDescriptionInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryDescription sets the RepositoryDescription field's value. -func (s *UpdateRepositoryDescriptionInput) SetRepositoryDescription(v string) *UpdateRepositoryDescriptionInput { - s.RepositoryDescription = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *UpdateRepositoryDescriptionInput) SetRepositoryName(v string) *UpdateRepositoryDescriptionInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryDescriptionOutput -type UpdateRepositoryDescriptionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateRepositoryDescriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRepositoryDescriptionOutput) GoString() string { - return s.String() -} - -// Represents the input of an update repository description operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryNameInput -type UpdateRepositoryNameInput struct { - _ struct{} `type:"structure"` - - // The new name for the repository. - // - // NewName is a required field - NewName *string `locationName:"newName" min:"1" type:"string" required:"true"` - - // The existing name of the repository. - // - // OldName is a required field - OldName *string `locationName:"oldName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateRepositoryNameInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRepositoryNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRepositoryNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRepositoryNameInput"} - if s.NewName == nil { - invalidParams.Add(request.NewErrParamRequired("NewName")) - } - if s.NewName != nil && len(*s.NewName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewName", 1)) - } - if s.OldName == nil { - invalidParams.Add(request.NewErrParamRequired("OldName")) - } - if s.OldName != nil && len(*s.OldName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OldName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNewName sets the NewName field's value. -func (s *UpdateRepositoryNameInput) SetNewName(v string) *UpdateRepositoryNameInput { - s.NewName = &v - return s -} - -// SetOldName sets the OldName field's value. -func (s *UpdateRepositoryNameInput) SetOldName(v string) *UpdateRepositoryNameInput { - s.OldName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryNameOutput -type UpdateRepositoryNameOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateRepositoryNameOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRepositoryNameOutput) GoString() string { - return s.String() -} - -// Information about the user who made a specified commit. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UserInfo -type UserInfo struct { - _ struct{} `type:"structure"` - - // The date when the specified commit was pushed to the repository. - Date *string `locationName:"date" type:"string"` - - // The email address associated with the user who made the commit, if any. - Email *string `locationName:"email" type:"string"` - - // The name of the user who made the specified commit. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s UserInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserInfo) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *UserInfo) SetDate(v string) *UserInfo { - s.Date = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *UserInfo) SetEmail(v string) *UserInfo { - s.Email = &v - return s -} - -// SetName sets the Name field's value. -func (s *UserInfo) SetName(v string) *UserInfo { - s.Name = &v - return s -} - -const ( - // ChangeTypeEnumA is a ChangeTypeEnum enum value - ChangeTypeEnumA = "A" - - // ChangeTypeEnumM is a ChangeTypeEnum enum value - ChangeTypeEnumM = "M" - - // ChangeTypeEnumD is a ChangeTypeEnum enum value - ChangeTypeEnumD = "D" -) - -const ( - // OrderEnumAscending is a OrderEnum enum value - OrderEnumAscending = "ascending" - - // OrderEnumDescending is a OrderEnum enum value - OrderEnumDescending = "descending" -) - -const ( - // RepositoryTriggerEventEnumAll is a RepositoryTriggerEventEnum enum value - RepositoryTriggerEventEnumAll = "all" - - // RepositoryTriggerEventEnumUpdateReference is a RepositoryTriggerEventEnum enum value - RepositoryTriggerEventEnumUpdateReference = "updateReference" - - // RepositoryTriggerEventEnumCreateReference is a RepositoryTriggerEventEnum enum value - RepositoryTriggerEventEnumCreateReference = "createReference" - - // RepositoryTriggerEventEnumDeleteReference is a RepositoryTriggerEventEnum enum value - RepositoryTriggerEventEnumDeleteReference = "deleteReference" -) - -const ( - // SortByEnumRepositoryName is a SortByEnum enum value - SortByEnumRepositoryName = "repositoryName" - - // SortByEnumLastModifiedDate is a SortByEnum enum value - SortByEnumLastModifiedDate = "lastModifiedDate" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go deleted file mode 100644 index 718d09d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go +++ /dev/null @@ -1,296 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codecommit - -const ( - - // ErrCodeBlobIdDoesNotExistException for service response error code - // "BlobIdDoesNotExistException". - // - // The specified blob does not exist. - ErrCodeBlobIdDoesNotExistException = "BlobIdDoesNotExistException" - - // ErrCodeBlobIdRequiredException for service response error code - // "BlobIdRequiredException". - // - // A blob ID is required but was not specified. - ErrCodeBlobIdRequiredException = "BlobIdRequiredException" - - // ErrCodeBranchDoesNotExistException for service response error code - // "BranchDoesNotExistException". - // - // The specified branch does not exist. - ErrCodeBranchDoesNotExistException = "BranchDoesNotExistException" - - // ErrCodeBranchNameExistsException for service response error code - // "BranchNameExistsException". - // - // The specified branch name already exists. - ErrCodeBranchNameExistsException = "BranchNameExistsException" - - // ErrCodeBranchNameRequiredException for service response error code - // "BranchNameRequiredException". - // - // A branch name is required but was not specified. - ErrCodeBranchNameRequiredException = "BranchNameRequiredException" - - // ErrCodeCommitDoesNotExistException for service response error code - // "CommitDoesNotExistException". - // - // The specified commit does not exist or no commit was specified, and the specified - // repository has no default branch. - ErrCodeCommitDoesNotExistException = "CommitDoesNotExistException" - - // ErrCodeCommitIdDoesNotExistException for service response error code - // "CommitIdDoesNotExistException". - // - // The specified commit ID does not exist. - ErrCodeCommitIdDoesNotExistException = "CommitIdDoesNotExistException" - - // ErrCodeCommitIdRequiredException for service response error code - // "CommitIdRequiredException". - // - // A commit ID was not specified. - ErrCodeCommitIdRequiredException = "CommitIdRequiredException" - - // ErrCodeCommitRequiredException for service response error code - // "CommitRequiredException". - // - // A commit was not specified. - ErrCodeCommitRequiredException = "CommitRequiredException" - - // ErrCodeEncryptionIntegrityChecksFailedException for service response error code - // "EncryptionIntegrityChecksFailedException". - // - // An encryption integrity check failed. - ErrCodeEncryptionIntegrityChecksFailedException = "EncryptionIntegrityChecksFailedException" - - // ErrCodeEncryptionKeyAccessDeniedException for service response error code - // "EncryptionKeyAccessDeniedException". - // - // An encryption key could not be accessed. - ErrCodeEncryptionKeyAccessDeniedException = "EncryptionKeyAccessDeniedException" - - // ErrCodeEncryptionKeyDisabledException for service response error code - // "EncryptionKeyDisabledException". - // - // The encryption key is disabled. - ErrCodeEncryptionKeyDisabledException = "EncryptionKeyDisabledException" - - // ErrCodeEncryptionKeyNotFoundException for service response error code - // "EncryptionKeyNotFoundException". - // - // No encryption key was found. - ErrCodeEncryptionKeyNotFoundException = "EncryptionKeyNotFoundException" - - // ErrCodeEncryptionKeyUnavailableException for service response error code - // "EncryptionKeyUnavailableException". - // - // The encryption key is not available. - ErrCodeEncryptionKeyUnavailableException = "EncryptionKeyUnavailableException" - - // ErrCodeFileTooLargeException for service response error code - // "FileTooLargeException". - // - // The specified file exceeds the file size limit for AWS CodeCommit. For more - // information about limits in AWS CodeCommit, see AWS CodeCommit User Guide - // (http://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). - ErrCodeFileTooLargeException = "FileTooLargeException" - - // ErrCodeInvalidBlobIdException for service response error code - // "InvalidBlobIdException". - // - // The specified blob is not valid. - ErrCodeInvalidBlobIdException = "InvalidBlobIdException" - - // ErrCodeInvalidBranchNameException for service response error code - // "InvalidBranchNameException". - // - // The specified branch name is not valid. - ErrCodeInvalidBranchNameException = "InvalidBranchNameException" - - // ErrCodeInvalidCommitException for service response error code - // "InvalidCommitException". - // - // The specified commit is not valid. - ErrCodeInvalidCommitException = "InvalidCommitException" - - // ErrCodeInvalidCommitIdException for service response error code - // "InvalidCommitIdException". - // - // The specified commit ID is not valid. - ErrCodeInvalidCommitIdException = "InvalidCommitIdException" - - // ErrCodeInvalidContinuationTokenException for service response error code - // "InvalidContinuationTokenException". - // - // The specified continuation token is not valid. - ErrCodeInvalidContinuationTokenException = "InvalidContinuationTokenException" - - // ErrCodeInvalidMaxResultsException for service response error code - // "InvalidMaxResultsException". - // - // The specified number of maximum results is not valid. - ErrCodeInvalidMaxResultsException = "InvalidMaxResultsException" - - // ErrCodeInvalidOrderException for service response error code - // "InvalidOrderException". - // - // The specified sort order is not valid. - ErrCodeInvalidOrderException = "InvalidOrderException" - - // ErrCodeInvalidPathException for service response error code - // "InvalidPathException". - // - // The specified path is not valid. - ErrCodeInvalidPathException = "InvalidPathException" - - // ErrCodeInvalidRepositoryDescriptionException for service response error code - // "InvalidRepositoryDescriptionException". - // - // The specified repository description is not valid. - ErrCodeInvalidRepositoryDescriptionException = "InvalidRepositoryDescriptionException" - - // ErrCodeInvalidRepositoryNameException for service response error code - // "InvalidRepositoryNameException". - // - // At least one specified repository name is not valid. - // - // This exception only occurs when a specified repository name is not valid. - // Other exceptions occur when a required repository parameter is missing, or - // when a specified repository does not exist. - ErrCodeInvalidRepositoryNameException = "InvalidRepositoryNameException" - - // ErrCodeInvalidRepositoryTriggerBranchNameException for service response error code - // "InvalidRepositoryTriggerBranchNameException". - // - // One or more branch names specified for the trigger is not valid. - ErrCodeInvalidRepositoryTriggerBranchNameException = "InvalidRepositoryTriggerBranchNameException" - - // ErrCodeInvalidRepositoryTriggerCustomDataException for service response error code - // "InvalidRepositoryTriggerCustomDataException". - // - // The custom data provided for the trigger is not valid. - ErrCodeInvalidRepositoryTriggerCustomDataException = "InvalidRepositoryTriggerCustomDataException" - - // ErrCodeInvalidRepositoryTriggerDestinationArnException for service response error code - // "InvalidRepositoryTriggerDestinationArnException". - // - // The Amazon Resource Name (ARN) for the trigger is not valid for the specified - // destination. The most common reason for this error is that the ARN does not - // meet the requirements for the service type. - ErrCodeInvalidRepositoryTriggerDestinationArnException = "InvalidRepositoryTriggerDestinationArnException" - - // ErrCodeInvalidRepositoryTriggerEventsException for service response error code - // "InvalidRepositoryTriggerEventsException". - // - // One or more events specified for the trigger is not valid. Check to make - // sure that all events specified match the requirements for allowed events. - ErrCodeInvalidRepositoryTriggerEventsException = "InvalidRepositoryTriggerEventsException" - - // ErrCodeInvalidRepositoryTriggerNameException for service response error code - // "InvalidRepositoryTriggerNameException". - // - // The name of the trigger is not valid. - ErrCodeInvalidRepositoryTriggerNameException = "InvalidRepositoryTriggerNameException" - - // ErrCodeInvalidRepositoryTriggerRegionException for service response error code - // "InvalidRepositoryTriggerRegionException". - // - // The region for the trigger target does not match the region for the repository. - // Triggers must be created in the same region as the target for the trigger. - ErrCodeInvalidRepositoryTriggerRegionException = "InvalidRepositoryTriggerRegionException" - - // ErrCodeInvalidSortByException for service response error code - // "InvalidSortByException". - // - // The specified sort by value is not valid. - ErrCodeInvalidSortByException = "InvalidSortByException" - - // ErrCodeMaximumBranchesExceededException for service response error code - // "MaximumBranchesExceededException". - // - // The number of branches for the trigger was exceeded. - ErrCodeMaximumBranchesExceededException = "MaximumBranchesExceededException" - - // ErrCodeMaximumRepositoryNamesExceededException for service response error code - // "MaximumRepositoryNamesExceededException". - // - // The maximum number of allowed repository names was exceeded. Currently, this - // number is 25. - ErrCodeMaximumRepositoryNamesExceededException = "MaximumRepositoryNamesExceededException" - - // ErrCodeMaximumRepositoryTriggersExceededException for service response error code - // "MaximumRepositoryTriggersExceededException". - // - // The number of triggers allowed for the repository was exceeded. - ErrCodeMaximumRepositoryTriggersExceededException = "MaximumRepositoryTriggersExceededException" - - // ErrCodePathDoesNotExistException for service response error code - // "PathDoesNotExistException". - // - // The specified path does not exist. - ErrCodePathDoesNotExistException = "PathDoesNotExistException" - - // ErrCodeRepositoryDoesNotExistException for service response error code - // "RepositoryDoesNotExistException". - // - // The specified repository does not exist. - ErrCodeRepositoryDoesNotExistException = "RepositoryDoesNotExistException" - - // ErrCodeRepositoryLimitExceededException for service response error code - // "RepositoryLimitExceededException". - // - // A repository resource limit was exceeded. - ErrCodeRepositoryLimitExceededException = "RepositoryLimitExceededException" - - // ErrCodeRepositoryNameExistsException for service response error code - // "RepositoryNameExistsException". - // - // The specified repository name already exists. - ErrCodeRepositoryNameExistsException = "RepositoryNameExistsException" - - // ErrCodeRepositoryNameRequiredException for service response error code - // "RepositoryNameRequiredException". - // - // A repository name is required but was not specified. - ErrCodeRepositoryNameRequiredException = "RepositoryNameRequiredException" - - // ErrCodeRepositoryNamesRequiredException for service response error code - // "RepositoryNamesRequiredException". - // - // A repository names object is required but was not specified. - ErrCodeRepositoryNamesRequiredException = "RepositoryNamesRequiredException" - - // ErrCodeRepositoryTriggerBranchNameListRequiredException for service response error code - // "RepositoryTriggerBranchNameListRequiredException". - // - // At least one branch name is required but was not specified in the trigger - // configuration. - ErrCodeRepositoryTriggerBranchNameListRequiredException = "RepositoryTriggerBranchNameListRequiredException" - - // ErrCodeRepositoryTriggerDestinationArnRequiredException for service response error code - // "RepositoryTriggerDestinationArnRequiredException". - // - // A destination ARN for the target service for the trigger is required but - // was not specified. - ErrCodeRepositoryTriggerDestinationArnRequiredException = "RepositoryTriggerDestinationArnRequiredException" - - // ErrCodeRepositoryTriggerEventsListRequiredException for service response error code - // "RepositoryTriggerEventsListRequiredException". - // - // At least one event for the trigger is required but was not specified. - ErrCodeRepositoryTriggerEventsListRequiredException = "RepositoryTriggerEventsListRequiredException" - - // ErrCodeRepositoryTriggerNameRequiredException for service response error code - // "RepositoryTriggerNameRequiredException". - // - // A name for the trigger is required but was not specified. - ErrCodeRepositoryTriggerNameRequiredException = "RepositoryTriggerNameRequiredException" - - // ErrCodeRepositoryTriggersListRequiredException for service response error code - // "RepositoryTriggersListRequiredException". - // - // The list of triggers for the repository is required but was not specified. - ErrCodeRepositoryTriggersListRequiredException = "RepositoryTriggersListRequiredException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go b/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go deleted file mode 100644 index dd0b666..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go +++ /dev/null @@ -1,154 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codecommit - -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" -) - -// This is the AWS CodeCommit API Reference. This reference provides descriptions -// of the operations and data types for AWS CodeCommit API along with usage -// examples. -// -// You can use the AWS CodeCommit API to work with the following objects: -// -// Repositories, by calling the following: -// -// * BatchGetRepositories, which returns information about one or more repositories -// associated with your AWS account -// -// * CreateRepository, which creates an AWS CodeCommit repository -// -// * DeleteRepository, which deletes an AWS CodeCommit repository -// -// * GetRepository, which returns information about a specified repository -// -// * ListRepositories, which lists all AWS CodeCommit repositories associated -// with your AWS account -// -// * UpdateRepositoryDescription, which sets or updates the description of -// the repository -// -// * UpdateRepositoryName, which changes the name of the repository. If you -// change the name of a repository, no other users of that repository will -// be able to access it until you send them the new HTTPS or SSH URL to use. -// -// Branches, by calling the following: -// -// * CreateBranch, which creates a new branch in a specified repository -// -// * GetBranch, which returns information about a specified branch -// -// * ListBranches, which lists all branches for a specified repository -// -// * UpdateDefaultBranch, which changes the default branch for a repository -// -// Information about committed code in a repository, by calling the following: -// -// * GetBlob, which returns the base-64 encoded content of an individual -// Git blob object within a repository -// -// * GetCommit, which returns information about a commit, including commit -// messages and author and committer information -// -// * GetDifferences, which returns information about the differences in a -// valid commit specifier (such as a branch, tag, HEAD, commit ID or other -// fully qualified reference) -// -// Triggers, by calling the following: -// -// * GetRepositoryTriggers, which returns information about triggers configured -// for a repository -// -// * PutRepositoryTriggers, which replaces all triggers for a repository -// and can be used to create or delete triggers -// -// * TestRepositoryTriggers, which tests the functionality of a repository -// trigger by sending data to the trigger target -// -// For information about how to use AWS CodeCommit, see the AWS CodeCommit User -// Guide (http://docs.aws.amazon.com/codecommit/latest/userguide/welcome.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/codecommit-2015-04-13 -type CodeCommit 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 = "codecommit" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CodeCommit 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 CodeCommit client from just a session. -// svc := codecommit.New(mySession) -// -// // Create a CodeCommit client with additional configuration -// svc := codecommit.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeCommit { - 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) *CodeCommit { - svc := &CodeCommit{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-04-13", - JSONVersion: "1.1", - TargetPrefix: "CodeCommit_20150413", - }, - 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 CodeCommit operation and runs any -// custom request initialization. -func (c *CodeCommit) 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/codedeploy/api.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/api.go deleted file mode 100644 index 1004323..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/api.go +++ /dev/null @@ -1,8824 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package codedeploy provides a client for AWS CodeDeploy. -package codedeploy - -import ( - "time" - - "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 opAddTagsToOnPremisesInstances = "AddTagsToOnPremisesInstances" - -// AddTagsToOnPremisesInstancesRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToOnPremisesInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToOnPremisesInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToOnPremisesInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToOnPremisesInstancesRequest method. -// req, resp := client.AddTagsToOnPremisesInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AddTagsToOnPremisesInstances -func (c *CodeDeploy) AddTagsToOnPremisesInstancesRequest(input *AddTagsToOnPremisesInstancesInput) (req *request.Request, output *AddTagsToOnPremisesInstancesOutput) { - op := &request.Operation{ - Name: opAddTagsToOnPremisesInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsToOnPremisesInstancesInput{} - } - - output = &AddTagsToOnPremisesInstancesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddTagsToOnPremisesInstances API operation for AWS CodeDeploy. -// -// Adds tags to on-premises 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 AWS CodeDeploy's -// API operation AddTagsToOnPremisesInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" -// An on-premises instance name was not specified. -// -// * ErrCodeTagRequiredException "TagRequiredException" -// A tag was not specified. -// -// * ErrCodeInvalidTagException "InvalidTagException" -// The specified tag was specified in an invalid format. -// -// * ErrCodeTagLimitExceededException "TagLimitExceededException" -// The maximum allowed number of tags was exceeded. -// -// * ErrCodeInstanceLimitExceededException "InstanceLimitExceededException" -// The maximum number of allowed on-premises instances in a single call was -// exceeded. -// -// * ErrCodeInstanceNotRegisteredException "InstanceNotRegisteredException" -// The specified on-premises instance is not registered. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AddTagsToOnPremisesInstances -func (c *CodeDeploy) AddTagsToOnPremisesInstances(input *AddTagsToOnPremisesInstancesInput) (*AddTagsToOnPremisesInstancesOutput, error) { - req, out := c.AddTagsToOnPremisesInstancesRequest(input) - err := req.Send() - return out, err -} - -const opBatchGetApplicationRevisions = "BatchGetApplicationRevisions" - -// BatchGetApplicationRevisionsRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetApplicationRevisions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetApplicationRevisions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetApplicationRevisions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetApplicationRevisionsRequest method. -// req, resp := client.BatchGetApplicationRevisionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplicationRevisions -func (c *CodeDeploy) BatchGetApplicationRevisionsRequest(input *BatchGetApplicationRevisionsInput) (req *request.Request, output *BatchGetApplicationRevisionsOutput) { - op := &request.Operation{ - Name: opBatchGetApplicationRevisions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetApplicationRevisionsInput{} - } - - output = &BatchGetApplicationRevisionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetApplicationRevisions API operation for AWS CodeDeploy. -// -// Gets information about one or more application revisions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation BatchGetApplicationRevisions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeRevisionRequiredException "RevisionRequiredException" -// The revision ID was not specified. -// -// * ErrCodeInvalidRevisionException "InvalidRevisionException" -// The revision was specified in an invalid format. -// -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" -// The maximum number of names or IDs allowed for this request (100) was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplicationRevisions -func (c *CodeDeploy) BatchGetApplicationRevisions(input *BatchGetApplicationRevisionsInput) (*BatchGetApplicationRevisionsOutput, error) { - req, out := c.BatchGetApplicationRevisionsRequest(input) - err := req.Send() - return out, err -} - -const opBatchGetApplications = "BatchGetApplications" - -// BatchGetApplicationsRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetApplications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetApplications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetApplications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetApplicationsRequest method. -// req, resp := client.BatchGetApplicationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplications -func (c *CodeDeploy) BatchGetApplicationsRequest(input *BatchGetApplicationsInput) (req *request.Request, output *BatchGetApplicationsOutput) { - op := &request.Operation{ - Name: opBatchGetApplications, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetApplicationsInput{} - } - - output = &BatchGetApplicationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetApplications API operation for AWS CodeDeploy. -// -// Gets information about one or more 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 AWS CodeDeploy's -// API operation BatchGetApplications for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" -// The maximum number of names or IDs allowed for this request (100) was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplications -func (c *CodeDeploy) BatchGetApplications(input *BatchGetApplicationsInput) (*BatchGetApplicationsOutput, error) { - req, out := c.BatchGetApplicationsRequest(input) - err := req.Send() - return out, err -} - -const opBatchGetDeploymentGroups = "BatchGetDeploymentGroups" - -// BatchGetDeploymentGroupsRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetDeploymentGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetDeploymentGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetDeploymentGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetDeploymentGroupsRequest method. -// req, resp := client.BatchGetDeploymentGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentGroups -func (c *CodeDeploy) BatchGetDeploymentGroupsRequest(input *BatchGetDeploymentGroupsInput) (req *request.Request, output *BatchGetDeploymentGroupsOutput) { - op := &request.Operation{ - Name: opBatchGetDeploymentGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetDeploymentGroupsInput{} - } - - output = &BatchGetDeploymentGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetDeploymentGroups API operation for AWS CodeDeploy. -// -// Gets information about one or more deployment groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation BatchGetDeploymentGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" -// The deployment group name was not specified. -// -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" -// The deployment group name was specified in an invalid format. -// -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" -// The maximum number of names or IDs allowed for this request (100) was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentGroups -func (c *CodeDeploy) BatchGetDeploymentGroups(input *BatchGetDeploymentGroupsInput) (*BatchGetDeploymentGroupsOutput, error) { - req, out := c.BatchGetDeploymentGroupsRequest(input) - err := req.Send() - return out, err -} - -const opBatchGetDeploymentInstances = "BatchGetDeploymentInstances" - -// BatchGetDeploymentInstancesRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetDeploymentInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetDeploymentInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetDeploymentInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetDeploymentInstancesRequest method. -// req, resp := client.BatchGetDeploymentInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentInstances -func (c *CodeDeploy) BatchGetDeploymentInstancesRequest(input *BatchGetDeploymentInstancesInput) (req *request.Request, output *BatchGetDeploymentInstancesOutput) { - op := &request.Operation{ - Name: opBatchGetDeploymentInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetDeploymentInstancesInput{} - } - - output = &BatchGetDeploymentInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetDeploymentInstances API operation for AWS CodeDeploy. -// -// Gets information about one or more instance that are part of a deployment -// group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation BatchGetDeploymentInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" -// At least one deployment ID must be specified. -// -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" -// The deployment does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeInstanceIdRequiredException "InstanceIdRequiredException" -// The instance ID was not specified. -// -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" -// At least one of the deployment IDs was specified in an invalid format. -// -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" -// The specified on-premises instance name was specified in an invalid format. -// -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" -// The maximum number of names or IDs allowed for this request (100) was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentInstances -func (c *CodeDeploy) BatchGetDeploymentInstances(input *BatchGetDeploymentInstancesInput) (*BatchGetDeploymentInstancesOutput, error) { - req, out := c.BatchGetDeploymentInstancesRequest(input) - err := req.Send() - return out, err -} - -const opBatchGetDeployments = "BatchGetDeployments" - -// BatchGetDeploymentsRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetDeployments operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetDeployments for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetDeployments method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetDeploymentsRequest method. -// req, resp := client.BatchGetDeploymentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeployments -func (c *CodeDeploy) BatchGetDeploymentsRequest(input *BatchGetDeploymentsInput) (req *request.Request, output *BatchGetDeploymentsOutput) { - op := &request.Operation{ - Name: opBatchGetDeployments, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetDeploymentsInput{} - } - - output = &BatchGetDeploymentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetDeployments API operation for AWS CodeDeploy. -// -// Gets information about one or more deployments. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation BatchGetDeployments for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" -// At least one deployment ID must be specified. -// -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" -// At least one of the deployment IDs was specified in an invalid format. -// -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" -// The maximum number of names or IDs allowed for this request (100) was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeployments -func (c *CodeDeploy) BatchGetDeployments(input *BatchGetDeploymentsInput) (*BatchGetDeploymentsOutput, error) { - req, out := c.BatchGetDeploymentsRequest(input) - err := req.Send() - return out, err -} - -const opBatchGetOnPremisesInstances = "BatchGetOnPremisesInstances" - -// BatchGetOnPremisesInstancesRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetOnPremisesInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetOnPremisesInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetOnPremisesInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetOnPremisesInstancesRequest method. -// req, resp := client.BatchGetOnPremisesInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetOnPremisesInstances -func (c *CodeDeploy) BatchGetOnPremisesInstancesRequest(input *BatchGetOnPremisesInstancesInput) (req *request.Request, output *BatchGetOnPremisesInstancesOutput) { - op := &request.Operation{ - Name: opBatchGetOnPremisesInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetOnPremisesInstancesInput{} - } - - output = &BatchGetOnPremisesInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetOnPremisesInstances API operation for AWS CodeDeploy. -// -// Gets information about one or more on-premises 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 AWS CodeDeploy's -// API operation BatchGetOnPremisesInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" -// An on-premises instance name was not specified. -// -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" -// The specified on-premises instance name was specified in an invalid format. -// -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" -// The maximum number of names or IDs allowed for this request (100) was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetOnPremisesInstances -func (c *CodeDeploy) BatchGetOnPremisesInstances(input *BatchGetOnPremisesInstancesInput) (*BatchGetOnPremisesInstancesOutput, error) { - req, out := c.BatchGetOnPremisesInstancesRequest(input) - err := req.Send() - return out, err -} - -const opContinueDeployment = "ContinueDeployment" - -// ContinueDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the ContinueDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ContinueDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ContinueDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ContinueDeploymentRequest method. -// req, resp := client.ContinueDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ContinueDeployment -func (c *CodeDeploy) ContinueDeploymentRequest(input *ContinueDeploymentInput) (req *request.Request, output *ContinueDeploymentOutput) { - op := &request.Operation{ - Name: opContinueDeployment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ContinueDeploymentInput{} - } - - output = &ContinueDeploymentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ContinueDeployment API operation for AWS CodeDeploy. -// -// Starts the process of rerouting traffic from instances in the original environment -// to instances in thereplacement environment without waiting for a specified -// wait time to elapse. (Traffic rerouting, which is achieved by registering -// instances in the replacement environment with the load balancer, can start -// as soon as all instances have a status of Ready.) -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation ContinueDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" -// At least one deployment ID must be specified. -// -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" -// The deployment does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeDeploymentAlreadyCompletedException "DeploymentAlreadyCompletedException" -// The deployment is already complete. -// -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" -// At least one of the deployment IDs was specified in an invalid format. -// -// * ErrCodeDeploymentIsNotInReadyStateException "DeploymentIsNotInReadyStateException" -// The deployment does not have a status of Ready and can't continue yet. -// -// * ErrCodeUnsupportedActionForDeploymentTypeException "UnsupportedActionForDeploymentTypeException" -// A call was submitted that is not supported for the specified deployment type. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ContinueDeployment -func (c *CodeDeploy) ContinueDeployment(input *ContinueDeploymentInput) (*ContinueDeploymentOutput, error) { - req, out := c.ContinueDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opCreateApplication = "CreateApplication" - -// CreateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the CreateApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateApplicationRequest method. -// req, resp := client.CreateApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateApplication -func (c *CodeDeploy) CreateApplicationRequest(input *CreateApplicationInput) (req *request.Request, output *CreateApplicationOutput) { - op := &request.Operation{ - Name: opCreateApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateApplicationInput{} - } - - output = &CreateApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateApplication API operation for AWS CodeDeploy. -// -// Creates an application. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation CreateApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationAlreadyExistsException "ApplicationAlreadyExistsException" -// An application with the specified name already exists with the applicable -// IAM user or AWS account. -// -// * ErrCodeApplicationLimitExceededException "ApplicationLimitExceededException" -// More applications were attempted to be created than are allowed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateApplication -func (c *CodeDeploy) CreateApplication(input *CreateApplicationInput) (*CreateApplicationOutput, error) { - req, out := c.CreateApplicationRequest(input) - err := req.Send() - return out, err -} - -const opCreateDeployment = "CreateDeployment" - -// CreateDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the CreateDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDeploymentRequest method. -// req, resp := client.CreateDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeployment -func (c *CodeDeploy) CreateDeploymentRequest(input *CreateDeploymentInput) (req *request.Request, output *CreateDeploymentOutput) { - op := &request.Operation{ - Name: opCreateDeployment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDeploymentInput{} - } - - output = &CreateDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDeployment API operation for AWS CodeDeploy. -// -// Deploys an application revision through the specified deployment group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation CreateDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" -// The deployment group name was not specified. -// -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" -// The deployment group name was specified in an invalid format. -// -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" -// The named deployment group does not exist with the applicable IAM user or -// AWS account. -// -// * ErrCodeRevisionRequiredException "RevisionRequiredException" -// The revision ID was not specified. -// -// * ErrCodeRevisionDoesNotExistException "RevisionDoesNotExistException" -// The named revision does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeInvalidRevisionException "InvalidRevisionException" -// The revision was specified in an invalid format. -// -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" -// The deployment configuration name was specified in an invalid format. -// -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" -// The deployment configuration does not exist with the applicable IAM user -// or AWS account. -// -// * ErrCodeDescriptionTooLongException "DescriptionTooLongException" -// The description is too long. -// -// * ErrCodeDeploymentLimitExceededException "DeploymentLimitExceededException" -// The number of allowed deployments was exceeded. -// -// * ErrCodeInvalidTargetInstancesException "InvalidTargetInstancesException" -// The target instance configuration is invalid. Possible causes include: -// -// * Configuration data for target instances was entered for an in-place -// deployment. -// -// * The limit of 10 tags for a tag type was exceeded. -// -// * The combined length of the tag names exceeded the limit. -// -// * A specified tag is not currently applied to any instances. -// -// * ErrCodeInvalidAutoRollbackConfigException "InvalidAutoRollbackConfigException" -// The automatic rollback configuration was specified in an invalid format. -// For example, automatic rollback is enabled but an invalid triggering event -// type or no event types were listed. -// -// * ErrCodeInvalidLoadBalancerInfoException "InvalidLoadBalancerInfoException" -// An invalid load balancer name, or no load balancer name, was specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeployment -func (c *CodeDeploy) CreateDeployment(input *CreateDeploymentInput) (*CreateDeploymentOutput, error) { - req, out := c.CreateDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opCreateDeploymentConfig = "CreateDeploymentConfig" - -// CreateDeploymentConfigRequest generates a "aws/request.Request" representing the -// client's request for the CreateDeploymentConfig operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDeploymentConfig for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDeploymentConfig method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDeploymentConfigRequest method. -// req, resp := client.CreateDeploymentConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentConfig -func (c *CodeDeploy) CreateDeploymentConfigRequest(input *CreateDeploymentConfigInput) (req *request.Request, output *CreateDeploymentConfigOutput) { - op := &request.Operation{ - Name: opCreateDeploymentConfig, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDeploymentConfigInput{} - } - - output = &CreateDeploymentConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDeploymentConfig API operation for AWS CodeDeploy. -// -// Creates a deployment 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 AWS CodeDeploy's -// API operation CreateDeploymentConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" -// The deployment configuration name was specified in an invalid format. -// -// * ErrCodeDeploymentConfigNameRequiredException "DeploymentConfigNameRequiredException" -// The deployment configuration name was not specified. -// -// * ErrCodeDeploymentConfigAlreadyExistsException "DeploymentConfigAlreadyExistsException" -// A deployment configuration with the specified name already exists with the -// applicable IAM user or AWS account. -// -// * ErrCodeInvalidMinimumHealthyHostValueException "InvalidMinimumHealthyHostValueException" -// The minimum healthy instance value was specified in an invalid format. -// -// * ErrCodeDeploymentConfigLimitExceededException "DeploymentConfigLimitExceededException" -// The deployment configurations limit was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentConfig -func (c *CodeDeploy) CreateDeploymentConfig(input *CreateDeploymentConfigInput) (*CreateDeploymentConfigOutput, error) { - req, out := c.CreateDeploymentConfigRequest(input) - err := req.Send() - return out, err -} - -const opCreateDeploymentGroup = "CreateDeploymentGroup" - -// CreateDeploymentGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateDeploymentGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDeploymentGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDeploymentGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDeploymentGroupRequest method. -// req, resp := client.CreateDeploymentGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentGroup -func (c *CodeDeploy) CreateDeploymentGroupRequest(input *CreateDeploymentGroupInput) (req *request.Request, output *CreateDeploymentGroupOutput) { - op := &request.Operation{ - Name: opCreateDeploymentGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDeploymentGroupInput{} - } - - output = &CreateDeploymentGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDeploymentGroup API operation for AWS CodeDeploy. -// -// Creates a deployment group to which application revisions will be deployed. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation CreateDeploymentGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" -// The deployment group name was not specified. -// -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" -// The deployment group name was specified in an invalid format. -// -// * ErrCodeDeploymentGroupAlreadyExistsException "DeploymentGroupAlreadyExistsException" -// A deployment group with the specified name already exists with the applicable -// IAM user or AWS account. -// -// * ErrCodeInvalidEC2TagException "InvalidEC2TagException" -// The tag was specified in an invalid format. -// -// * ErrCodeInvalidTagException "InvalidTagException" -// The specified tag was specified in an invalid format. -// -// * ErrCodeInvalidAutoScalingGroupException "InvalidAutoScalingGroupException" -// The Auto Scaling group was specified in an invalid format or does not exist. -// -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" -// The deployment configuration name was specified in an invalid format. -// -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" -// The deployment configuration does not exist with the applicable IAM user -// or AWS account. -// -// * ErrCodeRoleRequiredException "RoleRequiredException" -// The role ID was not specified. -// -// * ErrCodeInvalidRoleException "InvalidRoleException" -// The service role ARN was specified in an invalid format. Or, if an Auto Scaling -// group was specified, the specified service role does not grant the appropriate -// permissions to Auto Scaling. -// -// * ErrCodeDeploymentGroupLimitExceededException "DeploymentGroupLimitExceededException" -// The deployment groups limit was exceeded. -// -// * ErrCodeLifecycleHookLimitExceededException "LifecycleHookLimitExceededException" -// The limit for lifecycle hooks was exceeded. -// -// * ErrCodeInvalidTriggerConfigException "InvalidTriggerConfigException" -// The trigger was specified in an invalid format. -// -// * ErrCodeTriggerTargetsLimitExceededException "TriggerTargetsLimitExceededException" -// The maximum allowed number of triggers was exceeded. -// -// * ErrCodeInvalidAlarmConfigException "InvalidAlarmConfigException" -// The format of the alarm configuration is invalid. Possible causes include: -// -// * The alarm list is null. -// -// * The alarm object is null. -// -// * The alarm name is empty or null or exceeds the 255 character limit. -// -// * Two alarms with the same name have been specified. -// -// * The alarm configuration is enabled but the alarm list is empty. -// -// * ErrCodeAlarmsLimitExceededException "AlarmsLimitExceededException" -// The maximum number of alarms for a deployment group (10) was exceeded. -// -// * ErrCodeInvalidAutoRollbackConfigException "InvalidAutoRollbackConfigException" -// The automatic rollback configuration was specified in an invalid format. -// For example, automatic rollback is enabled but an invalid triggering event -// type or no event types were listed. -// -// * ErrCodeInvalidLoadBalancerInfoException "InvalidLoadBalancerInfoException" -// An invalid load balancer name, or no load balancer name, was specified. -// -// * ErrCodeInvalidDeploymentStyleException "InvalidDeploymentStyleException" -// An invalid deployment style was specified. Valid deployment types include -// "IN_PLACE" and "BLUE_GREEN". Valid deployment options for blue/green deployments -// include "WITH_TRAFFIC_CONTROL" and "WITHOUT_TRAFFIC_CONTROL". -// -// * ErrCodeInvalidBlueGreenDeploymentConfigurationException "InvalidBlueGreenDeploymentConfigurationException" -// The configuration for the blue/green deployment group was provided in an -// invalid format. For information about deployment configuration format, see -// CreateDeploymentConfig. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentGroup -func (c *CodeDeploy) CreateDeploymentGroup(input *CreateDeploymentGroupInput) (*CreateDeploymentGroupOutput, error) { - req, out := c.CreateDeploymentGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteApplication = "DeleteApplication" - -// DeleteApplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteApplicationRequest method. -// req, resp := client.DeleteApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteApplication -func (c *CodeDeploy) DeleteApplicationRequest(input *DeleteApplicationInput) (req *request.Request, output *DeleteApplicationOutput) { - op := &request.Operation{ - Name: opDeleteApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteApplicationInput{} - } - - output = &DeleteApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApplication API operation for AWS CodeDeploy. -// -// Deletes an application. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation DeleteApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteApplication -func (c *CodeDeploy) DeleteApplication(input *DeleteApplicationInput) (*DeleteApplicationOutput, error) { - req, out := c.DeleteApplicationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDeploymentConfig = "DeleteDeploymentConfig" - -// DeleteDeploymentConfigRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDeploymentConfig operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDeploymentConfig for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDeploymentConfig method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDeploymentConfigRequest method. -// req, resp := client.DeleteDeploymentConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentConfig -func (c *CodeDeploy) DeleteDeploymentConfigRequest(input *DeleteDeploymentConfigInput) (req *request.Request, output *DeleteDeploymentConfigOutput) { - op := &request.Operation{ - Name: opDeleteDeploymentConfig, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDeploymentConfigInput{} - } - - output = &DeleteDeploymentConfigOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDeploymentConfig API operation for AWS CodeDeploy. -// -// Deletes a deployment configuration. -// -// A deployment configuration cannot be deleted if it is currently in use. Predefined -// configurations cannot 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 AWS CodeDeploy's -// API operation DeleteDeploymentConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" -// The deployment configuration name was specified in an invalid format. -// -// * ErrCodeDeploymentConfigNameRequiredException "DeploymentConfigNameRequiredException" -// The deployment configuration name was not specified. -// -// * ErrCodeDeploymentConfigInUseException "DeploymentConfigInUseException" -// The deployment configuration is still in use. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// An invalid operation was detected. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentConfig -func (c *CodeDeploy) DeleteDeploymentConfig(input *DeleteDeploymentConfigInput) (*DeleteDeploymentConfigOutput, error) { - req, out := c.DeleteDeploymentConfigRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDeploymentGroup = "DeleteDeploymentGroup" - -// DeleteDeploymentGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDeploymentGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDeploymentGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDeploymentGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDeploymentGroupRequest method. -// req, resp := client.DeleteDeploymentGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentGroup -func (c *CodeDeploy) DeleteDeploymentGroupRequest(input *DeleteDeploymentGroupInput) (req *request.Request, output *DeleteDeploymentGroupOutput) { - op := &request.Operation{ - Name: opDeleteDeploymentGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDeploymentGroupInput{} - } - - output = &DeleteDeploymentGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDeploymentGroup API operation for AWS CodeDeploy. -// -// Deletes a deployment group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation DeleteDeploymentGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" -// The deployment group name was not specified. -// -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" -// The deployment group name was specified in an invalid format. -// -// * ErrCodeInvalidRoleException "InvalidRoleException" -// The service role ARN was specified in an invalid format. Or, if an Auto Scaling -// group was specified, the specified service role does not grant the appropriate -// permissions to Auto Scaling. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentGroup -func (c *CodeDeploy) DeleteDeploymentGroup(input *DeleteDeploymentGroupInput) (*DeleteDeploymentGroupOutput, error) { - req, out := c.DeleteDeploymentGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterOnPremisesInstance = "DeregisterOnPremisesInstance" - -// DeregisterOnPremisesInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterOnPremisesInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterOnPremisesInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterOnPremisesInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterOnPremisesInstanceRequest method. -// req, resp := client.DeregisterOnPremisesInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeregisterOnPremisesInstance -func (c *CodeDeploy) DeregisterOnPremisesInstanceRequest(input *DeregisterOnPremisesInstanceInput) (req *request.Request, output *DeregisterOnPremisesInstanceOutput) { - op := &request.Operation{ - Name: opDeregisterOnPremisesInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterOnPremisesInstanceInput{} - } - - output = &DeregisterOnPremisesInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterOnPremisesInstance API operation for AWS CodeDeploy. -// -// Deregisters an on-premises 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 AWS CodeDeploy's -// API operation DeregisterOnPremisesInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" -// An on-premises instance name was not specified. -// -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" -// The specified on-premises instance name was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeregisterOnPremisesInstance -func (c *CodeDeploy) DeregisterOnPremisesInstance(input *DeregisterOnPremisesInstanceInput) (*DeregisterOnPremisesInstanceOutput, error) { - req, out := c.DeregisterOnPremisesInstanceRequest(input) - err := req.Send() - return out, err -} - -const opGetApplication = "GetApplication" - -// GetApplicationRequest generates a "aws/request.Request" representing the -// client's request for the GetApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetApplicationRequest method. -// req, resp := client.GetApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplication -func (c *CodeDeploy) GetApplicationRequest(input *GetApplicationInput) (req *request.Request, output *GetApplicationOutput) { - op := &request.Operation{ - Name: opGetApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetApplicationInput{} - } - - output = &GetApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetApplication API operation for AWS CodeDeploy. -// -// Gets information about an application. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation GetApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplication -func (c *CodeDeploy) GetApplication(input *GetApplicationInput) (*GetApplicationOutput, error) { - req, out := c.GetApplicationRequest(input) - err := req.Send() - return out, err -} - -const opGetApplicationRevision = "GetApplicationRevision" - -// GetApplicationRevisionRequest generates a "aws/request.Request" representing the -// client's request for the GetApplicationRevision operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetApplicationRevision for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetApplicationRevision method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetApplicationRevisionRequest method. -// req, resp := client.GetApplicationRevisionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplicationRevision -func (c *CodeDeploy) GetApplicationRevisionRequest(input *GetApplicationRevisionInput) (req *request.Request, output *GetApplicationRevisionOutput) { - op := &request.Operation{ - Name: opGetApplicationRevision, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetApplicationRevisionInput{} - } - - output = &GetApplicationRevisionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetApplicationRevision API operation for AWS CodeDeploy. -// -// Gets information about an application revision. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation GetApplicationRevision for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeRevisionDoesNotExistException "RevisionDoesNotExistException" -// The named revision does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeRevisionRequiredException "RevisionRequiredException" -// The revision ID was not specified. -// -// * ErrCodeInvalidRevisionException "InvalidRevisionException" -// The revision was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplicationRevision -func (c *CodeDeploy) GetApplicationRevision(input *GetApplicationRevisionInput) (*GetApplicationRevisionOutput, error) { - req, out := c.GetApplicationRevisionRequest(input) - err := req.Send() - return out, err -} - -const opGetDeployment = "GetDeployment" - -// GetDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the GetDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDeploymentRequest method. -// req, resp := client.GetDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeployment -func (c *CodeDeploy) GetDeploymentRequest(input *GetDeploymentInput) (req *request.Request, output *GetDeploymentOutput) { - op := &request.Operation{ - Name: opGetDeployment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDeploymentInput{} - } - - output = &GetDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeployment API operation for AWS CodeDeploy. -// -// Gets information about a deployment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation GetDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" -// At least one deployment ID must be specified. -// -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" -// At least one of the deployment IDs was specified in an invalid format. -// -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" -// The deployment does not exist with the applicable IAM user or AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeployment -func (c *CodeDeploy) GetDeployment(input *GetDeploymentInput) (*GetDeploymentOutput, error) { - req, out := c.GetDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opGetDeploymentConfig = "GetDeploymentConfig" - -// GetDeploymentConfigRequest generates a "aws/request.Request" representing the -// client's request for the GetDeploymentConfig operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDeploymentConfig for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDeploymentConfig method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDeploymentConfigRequest method. -// req, resp := client.GetDeploymentConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentConfig -func (c *CodeDeploy) GetDeploymentConfigRequest(input *GetDeploymentConfigInput) (req *request.Request, output *GetDeploymentConfigOutput) { - op := &request.Operation{ - Name: opGetDeploymentConfig, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDeploymentConfigInput{} - } - - output = &GetDeploymentConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeploymentConfig API operation for AWS CodeDeploy. -// -// Gets information about a deployment 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 AWS CodeDeploy's -// API operation GetDeploymentConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" -// The deployment configuration name was specified in an invalid format. -// -// * ErrCodeDeploymentConfigNameRequiredException "DeploymentConfigNameRequiredException" -// The deployment configuration name was not specified. -// -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" -// The deployment configuration does not exist with the applicable IAM user -// or AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentConfig -func (c *CodeDeploy) GetDeploymentConfig(input *GetDeploymentConfigInput) (*GetDeploymentConfigOutput, error) { - req, out := c.GetDeploymentConfigRequest(input) - err := req.Send() - return out, err -} - -const opGetDeploymentGroup = "GetDeploymentGroup" - -// GetDeploymentGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetDeploymentGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDeploymentGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDeploymentGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDeploymentGroupRequest method. -// req, resp := client.GetDeploymentGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentGroup -func (c *CodeDeploy) GetDeploymentGroupRequest(input *GetDeploymentGroupInput) (req *request.Request, output *GetDeploymentGroupOutput) { - op := &request.Operation{ - Name: opGetDeploymentGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDeploymentGroupInput{} - } - - output = &GetDeploymentGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeploymentGroup API operation for AWS CodeDeploy. -// -// Gets information about a deployment group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation GetDeploymentGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" -// The deployment group name was not specified. -// -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" -// The deployment group name was specified in an invalid format. -// -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" -// The named deployment group does not exist with the applicable IAM user or -// AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentGroup -func (c *CodeDeploy) GetDeploymentGroup(input *GetDeploymentGroupInput) (*GetDeploymentGroupOutput, error) { - req, out := c.GetDeploymentGroupRequest(input) - err := req.Send() - return out, err -} - -const opGetDeploymentInstance = "GetDeploymentInstance" - -// GetDeploymentInstanceRequest generates a "aws/request.Request" representing the -// client's request for the GetDeploymentInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDeploymentInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDeploymentInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDeploymentInstanceRequest method. -// req, resp := client.GetDeploymentInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentInstance -func (c *CodeDeploy) GetDeploymentInstanceRequest(input *GetDeploymentInstanceInput) (req *request.Request, output *GetDeploymentInstanceOutput) { - op := &request.Operation{ - Name: opGetDeploymentInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDeploymentInstanceInput{} - } - - output = &GetDeploymentInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeploymentInstance API operation for AWS CodeDeploy. -// -// Gets information about an instance as part of a deployment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation GetDeploymentInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" -// At least one deployment ID must be specified. -// -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" -// The deployment does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeInstanceIdRequiredException "InstanceIdRequiredException" -// The instance ID was not specified. -// -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" -// At least one of the deployment IDs was specified in an invalid format. -// -// * ErrCodeInstanceDoesNotExistException "InstanceDoesNotExistException" -// The specified instance does not exist in the deployment group. -// -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" -// The specified on-premises instance name was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentInstance -func (c *CodeDeploy) GetDeploymentInstance(input *GetDeploymentInstanceInput) (*GetDeploymentInstanceOutput, error) { - req, out := c.GetDeploymentInstanceRequest(input) - err := req.Send() - return out, err -} - -const opGetOnPremisesInstance = "GetOnPremisesInstance" - -// GetOnPremisesInstanceRequest generates a "aws/request.Request" representing the -// client's request for the GetOnPremisesInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetOnPremisesInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetOnPremisesInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetOnPremisesInstanceRequest method. -// req, resp := client.GetOnPremisesInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetOnPremisesInstance -func (c *CodeDeploy) GetOnPremisesInstanceRequest(input *GetOnPremisesInstanceInput) (req *request.Request, output *GetOnPremisesInstanceOutput) { - op := &request.Operation{ - Name: opGetOnPremisesInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetOnPremisesInstanceInput{} - } - - output = &GetOnPremisesInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOnPremisesInstance API operation for AWS CodeDeploy. -// -// Gets information about an on-premises 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 AWS CodeDeploy's -// API operation GetOnPremisesInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" -// An on-premises instance name was not specified. -// -// * ErrCodeInstanceNotRegisteredException "InstanceNotRegisteredException" -// The specified on-premises instance is not registered. -// -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" -// The specified on-premises instance name was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetOnPremisesInstance -func (c *CodeDeploy) GetOnPremisesInstance(input *GetOnPremisesInstanceInput) (*GetOnPremisesInstanceOutput, error) { - req, out := c.GetOnPremisesInstanceRequest(input) - err := req.Send() - return out, err -} - -const opListApplicationRevisions = "ListApplicationRevisions" - -// ListApplicationRevisionsRequest generates a "aws/request.Request" representing the -// client's request for the ListApplicationRevisions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListApplicationRevisions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListApplicationRevisions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListApplicationRevisionsRequest method. -// req, resp := client.ListApplicationRevisionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplicationRevisions -func (c *CodeDeploy) ListApplicationRevisionsRequest(input *ListApplicationRevisionsInput) (req *request.Request, output *ListApplicationRevisionsOutput) { - op := &request.Operation{ - Name: opListApplicationRevisions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListApplicationRevisionsInput{} - } - - output = &ListApplicationRevisionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListApplicationRevisions API operation for AWS CodeDeploy. -// -// Lists information about revisions for an application. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation ListApplicationRevisions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeInvalidSortByException "InvalidSortByException" -// The column name to sort by is either not present or was specified in an invalid -// format. -// -// * ErrCodeInvalidSortOrderException "InvalidSortOrderException" -// The sort order was specified in an invalid format. -// -// * ErrCodeInvalidBucketNameFilterException "InvalidBucketNameFilterException" -// The bucket name either doesn't exist or was specified in an invalid format. -// -// * ErrCodeInvalidKeyPrefixFilterException "InvalidKeyPrefixFilterException" -// The specified key prefix filter was specified in an invalid format. -// -// * ErrCodeBucketNameFilterRequiredException "BucketNameFilterRequiredException" -// A bucket name is required, but was not provided. -// -// * ErrCodeInvalidDeployedStateFilterException "InvalidDeployedStateFilterException" -// The deployed state filter was specified in an invalid format. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplicationRevisions -func (c *CodeDeploy) ListApplicationRevisions(input *ListApplicationRevisionsInput) (*ListApplicationRevisionsOutput, error) { - req, out := c.ListApplicationRevisionsRequest(input) - err := req.Send() - return out, err -} - -// ListApplicationRevisionsPages iterates over the pages of a ListApplicationRevisions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApplicationRevisions 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 ListApplicationRevisions operation. -// pageNum := 0 -// err := client.ListApplicationRevisionsPages(params, -// func(page *ListApplicationRevisionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListApplicationRevisionsPages(input *ListApplicationRevisionsInput, fn func(p *ListApplicationRevisionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListApplicationRevisionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListApplicationRevisionsOutput), lastPage) - }) -} - -const opListApplications = "ListApplications" - -// ListApplicationsRequest generates a "aws/request.Request" representing the -// client's request for the ListApplications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListApplications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListApplications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListApplicationsRequest method. -// req, resp := client.ListApplicationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplications -func (c *CodeDeploy) ListApplicationsRequest(input *ListApplicationsInput) (req *request.Request, output *ListApplicationsOutput) { - op := &request.Operation{ - Name: opListApplications, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListApplicationsInput{} - } - - output = &ListApplicationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListApplications API operation for AWS CodeDeploy. -// -// Lists the applications registered with the applicable IAM user or 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 AWS CodeDeploy's -// API operation ListApplications for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplications -func (c *CodeDeploy) ListApplications(input *ListApplicationsInput) (*ListApplicationsOutput, error) { - req, out := c.ListApplicationsRequest(input) - err := req.Send() - return out, err -} - -// ListApplicationsPages iterates over the pages of a ListApplications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApplications 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 ListApplications operation. -// pageNum := 0 -// err := client.ListApplicationsPages(params, -// func(page *ListApplicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListApplicationsPages(input *ListApplicationsInput, fn func(p *ListApplicationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListApplicationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListApplicationsOutput), lastPage) - }) -} - -const opListDeploymentConfigs = "ListDeploymentConfigs" - -// ListDeploymentConfigsRequest generates a "aws/request.Request" representing the -// client's request for the ListDeploymentConfigs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDeploymentConfigs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDeploymentConfigs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDeploymentConfigsRequest method. -// req, resp := client.ListDeploymentConfigsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentConfigs -func (c *CodeDeploy) ListDeploymentConfigsRequest(input *ListDeploymentConfigsInput) (req *request.Request, output *ListDeploymentConfigsOutput) { - op := &request.Operation{ - Name: opListDeploymentConfigs, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDeploymentConfigsInput{} - } - - output = &ListDeploymentConfigsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeploymentConfigs API operation for AWS CodeDeploy. -// -// Lists the deployment configurations with the applicable IAM user or 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 AWS CodeDeploy's -// API operation ListDeploymentConfigs for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentConfigs -func (c *CodeDeploy) ListDeploymentConfigs(input *ListDeploymentConfigsInput) (*ListDeploymentConfigsOutput, error) { - req, out := c.ListDeploymentConfigsRequest(input) - err := req.Send() - return out, err -} - -// ListDeploymentConfigsPages iterates over the pages of a ListDeploymentConfigs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeploymentConfigs 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 ListDeploymentConfigs operation. -// pageNum := 0 -// err := client.ListDeploymentConfigsPages(params, -// func(page *ListDeploymentConfigsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListDeploymentConfigsPages(input *ListDeploymentConfigsInput, fn func(p *ListDeploymentConfigsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDeploymentConfigsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDeploymentConfigsOutput), lastPage) - }) -} - -const opListDeploymentGroups = "ListDeploymentGroups" - -// ListDeploymentGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListDeploymentGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDeploymentGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDeploymentGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDeploymentGroupsRequest method. -// req, resp := client.ListDeploymentGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentGroups -func (c *CodeDeploy) ListDeploymentGroupsRequest(input *ListDeploymentGroupsInput) (req *request.Request, output *ListDeploymentGroupsOutput) { - op := &request.Operation{ - Name: opListDeploymentGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDeploymentGroupsInput{} - } - - output = &ListDeploymentGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeploymentGroups API operation for AWS CodeDeploy. -// -// Lists the deployment groups for an application registered with the applicable -// IAM user or 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 AWS CodeDeploy's -// API operation ListDeploymentGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentGroups -func (c *CodeDeploy) ListDeploymentGroups(input *ListDeploymentGroupsInput) (*ListDeploymentGroupsOutput, error) { - req, out := c.ListDeploymentGroupsRequest(input) - err := req.Send() - return out, err -} - -// ListDeploymentGroupsPages iterates over the pages of a ListDeploymentGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeploymentGroups 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 ListDeploymentGroups operation. -// pageNum := 0 -// err := client.ListDeploymentGroupsPages(params, -// func(page *ListDeploymentGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListDeploymentGroupsPages(input *ListDeploymentGroupsInput, fn func(p *ListDeploymentGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDeploymentGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDeploymentGroupsOutput), lastPage) - }) -} - -const opListDeploymentInstances = "ListDeploymentInstances" - -// ListDeploymentInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListDeploymentInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDeploymentInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDeploymentInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDeploymentInstancesRequest method. -// req, resp := client.ListDeploymentInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentInstances -func (c *CodeDeploy) ListDeploymentInstancesRequest(input *ListDeploymentInstancesInput) (req *request.Request, output *ListDeploymentInstancesOutput) { - op := &request.Operation{ - Name: opListDeploymentInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDeploymentInstancesInput{} - } - - output = &ListDeploymentInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeploymentInstances API operation for AWS CodeDeploy. -// -// Lists the instance for a deployment associated with the applicable IAM user -// or 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 AWS CodeDeploy's -// API operation ListDeploymentInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" -// At least one deployment ID must be specified. -// -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" -// The deployment does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeDeploymentNotStartedException "DeploymentNotStartedException" -// The specified deployment has not started. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. -// -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" -// At least one of the deployment IDs was specified in an invalid format. -// -// * ErrCodeInvalidInstanceStatusException "InvalidInstanceStatusException" -// The specified instance status does not exist. -// -// * ErrCodeInvalidInstanceTypeException "InvalidInstanceTypeException" -// An invalid instance type was specified for instances in a blue/green deployment. -// Valid values include "Blue" for an original environment and "Green" for a -// replacement environment. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentInstances -func (c *CodeDeploy) ListDeploymentInstances(input *ListDeploymentInstancesInput) (*ListDeploymentInstancesOutput, error) { - req, out := c.ListDeploymentInstancesRequest(input) - err := req.Send() - return out, err -} - -// ListDeploymentInstancesPages iterates over the pages of a ListDeploymentInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeploymentInstances 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 ListDeploymentInstances operation. -// pageNum := 0 -// err := client.ListDeploymentInstancesPages(params, -// func(page *ListDeploymentInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListDeploymentInstancesPages(input *ListDeploymentInstancesInput, fn func(p *ListDeploymentInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDeploymentInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDeploymentInstancesOutput), lastPage) - }) -} - -const opListDeployments = "ListDeployments" - -// ListDeploymentsRequest generates a "aws/request.Request" representing the -// client's request for the ListDeployments operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDeployments for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDeployments method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDeploymentsRequest method. -// req, resp := client.ListDeploymentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeployments -func (c *CodeDeploy) ListDeploymentsRequest(input *ListDeploymentsInput) (req *request.Request, output *ListDeploymentsOutput) { - op := &request.Operation{ - Name: opListDeployments, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDeploymentsInput{} - } - - output = &ListDeploymentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeployments API operation for AWS CodeDeploy. -// -// Lists the deployments in a deployment group for an application registered -// with the applicable IAM user or 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 AWS CodeDeploy's -// API operation ListDeployments for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" -// The deployment group name was specified in an invalid format. -// -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" -// The named deployment group does not exist with the applicable IAM user or -// AWS account. -// -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" -// The deployment group name was not specified. -// -// * ErrCodeInvalidTimeRangeException "InvalidTimeRangeException" -// The specified time range was specified in an invalid format. -// -// * ErrCodeInvalidDeploymentStatusException "InvalidDeploymentStatusException" -// The specified deployment status doesn't exist or cannot be determined. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeployments -func (c *CodeDeploy) ListDeployments(input *ListDeploymentsInput) (*ListDeploymentsOutput, error) { - req, out := c.ListDeploymentsRequest(input) - err := req.Send() - return out, err -} - -// ListDeploymentsPages iterates over the pages of a ListDeployments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeployments 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 ListDeployments operation. -// pageNum := 0 -// err := client.ListDeploymentsPages(params, -// func(page *ListDeploymentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeDeploy) ListDeploymentsPages(input *ListDeploymentsInput, fn func(p *ListDeploymentsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDeploymentsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDeploymentsOutput), lastPage) - }) -} - -const opListOnPremisesInstances = "ListOnPremisesInstances" - -// ListOnPremisesInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListOnPremisesInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListOnPremisesInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListOnPremisesInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListOnPremisesInstancesRequest method. -// req, resp := client.ListOnPremisesInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListOnPremisesInstances -func (c *CodeDeploy) ListOnPremisesInstancesRequest(input *ListOnPremisesInstancesInput) (req *request.Request, output *ListOnPremisesInstancesOutput) { - op := &request.Operation{ - Name: opListOnPremisesInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListOnPremisesInstancesInput{} - } - - output = &ListOnPremisesInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOnPremisesInstances API operation for AWS CodeDeploy. -// -// Gets a list of names for one or more on-premises instances. -// -// Unless otherwise specified, both registered and deregistered on-premises -// instance names will be listed. To list only registered or deregistered on-premises -// instance names, use the registration status 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 AWS CodeDeploy's -// API operation ListOnPremisesInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRegistrationStatusException "InvalidRegistrationStatusException" -// The registration status was specified in an invalid format. -// -// * ErrCodeInvalidTagFilterException "InvalidTagFilterException" -// The specified tag filter was specified in an invalid format. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListOnPremisesInstances -func (c *CodeDeploy) ListOnPremisesInstances(input *ListOnPremisesInstancesInput) (*ListOnPremisesInstancesOutput, error) { - req, out := c.ListOnPremisesInstancesRequest(input) - err := req.Send() - return out, err -} - -const opRegisterApplicationRevision = "RegisterApplicationRevision" - -// RegisterApplicationRevisionRequest generates a "aws/request.Request" representing the -// client's request for the RegisterApplicationRevision operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterApplicationRevision for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterApplicationRevision method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterApplicationRevisionRequest method. -// req, resp := client.RegisterApplicationRevisionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterApplicationRevision -func (c *CodeDeploy) RegisterApplicationRevisionRequest(input *RegisterApplicationRevisionInput) (req *request.Request, output *RegisterApplicationRevisionOutput) { - op := &request.Operation{ - Name: opRegisterApplicationRevision, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterApplicationRevisionInput{} - } - - output = &RegisterApplicationRevisionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RegisterApplicationRevision API operation for AWS CodeDeploy. -// -// Registers with AWS CodeDeploy a revision for the specified application. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation RegisterApplicationRevision for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeDescriptionTooLongException "DescriptionTooLongException" -// The description is too long. -// -// * ErrCodeRevisionRequiredException "RevisionRequiredException" -// The revision ID was not specified. -// -// * ErrCodeInvalidRevisionException "InvalidRevisionException" -// The revision was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterApplicationRevision -func (c *CodeDeploy) RegisterApplicationRevision(input *RegisterApplicationRevisionInput) (*RegisterApplicationRevisionOutput, error) { - req, out := c.RegisterApplicationRevisionRequest(input) - err := req.Send() - return out, err -} - -const opRegisterOnPremisesInstance = "RegisterOnPremisesInstance" - -// RegisterOnPremisesInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RegisterOnPremisesInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterOnPremisesInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterOnPremisesInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterOnPremisesInstanceRequest method. -// req, resp := client.RegisterOnPremisesInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterOnPremisesInstance -func (c *CodeDeploy) RegisterOnPremisesInstanceRequest(input *RegisterOnPremisesInstanceInput) (req *request.Request, output *RegisterOnPremisesInstanceOutput) { - op := &request.Operation{ - Name: opRegisterOnPremisesInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterOnPremisesInstanceInput{} - } - - output = &RegisterOnPremisesInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RegisterOnPremisesInstance API operation for AWS CodeDeploy. -// -// Registers an on-premises instance. -// -// Only one IAM ARN (an IAM session ARN or IAM user ARN) is supported in the -// request. You cannot use both. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation RegisterOnPremisesInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInstanceNameAlreadyRegisteredException "InstanceNameAlreadyRegisteredException" -// The specified on-premises instance name is already registered. -// -// * ErrCodeIamArnRequiredException "IamArnRequiredException" -// No IAM ARN was included in the request. You must use an IAM session ARN or -// IAM user ARN in the request. -// -// * ErrCodeIamSessionArnAlreadyRegisteredException "IamSessionArnAlreadyRegisteredException" -// The request included an IAM session ARN that has already been used to register -// a different instance. -// -// * ErrCodeIamUserArnAlreadyRegisteredException "IamUserArnAlreadyRegisteredException" -// The specified IAM user ARN is already registered with an on-premises instance. -// -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" -// An on-premises instance name was not specified. -// -// * ErrCodeIamUserArnRequiredException "IamUserArnRequiredException" -// An IAM user ARN was not specified. -// -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" -// The specified on-premises instance name was specified in an invalid format. -// -// * ErrCodeInvalidIamSessionArnException "InvalidIamSessionArnException" -// The IAM session ARN was specified in an invalid format. -// -// * ErrCodeInvalidIamUserArnException "InvalidIamUserArnException" -// The IAM user ARN was specified in an invalid format. -// -// * ErrCodeMultipleIamArnsProvidedException "MultipleIamArnsProvidedException" -// Both an IAM user ARN and an IAM session ARN were included in the request. -// Use only one ARN type. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterOnPremisesInstance -func (c *CodeDeploy) RegisterOnPremisesInstance(input *RegisterOnPremisesInstanceInput) (*RegisterOnPremisesInstanceOutput, error) { - req, out := c.RegisterOnPremisesInstanceRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTagsFromOnPremisesInstances = "RemoveTagsFromOnPremisesInstances" - -// RemoveTagsFromOnPremisesInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromOnPremisesInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromOnPremisesInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromOnPremisesInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromOnPremisesInstancesRequest method. -// req, resp := client.RemoveTagsFromOnPremisesInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RemoveTagsFromOnPremisesInstances -func (c *CodeDeploy) RemoveTagsFromOnPremisesInstancesRequest(input *RemoveTagsFromOnPremisesInstancesInput) (req *request.Request, output *RemoveTagsFromOnPremisesInstancesOutput) { - op := &request.Operation{ - Name: opRemoveTagsFromOnPremisesInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsFromOnPremisesInstancesInput{} - } - - output = &RemoveTagsFromOnPremisesInstancesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveTagsFromOnPremisesInstances API operation for AWS CodeDeploy. -// -// Removes one or more tags from one or more on-premises 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 AWS CodeDeploy's -// API operation RemoveTagsFromOnPremisesInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" -// An on-premises instance name was not specified. -// -// * ErrCodeTagRequiredException "TagRequiredException" -// A tag was not specified. -// -// * ErrCodeInvalidTagException "InvalidTagException" -// The specified tag was specified in an invalid format. -// -// * ErrCodeTagLimitExceededException "TagLimitExceededException" -// The maximum allowed number of tags was exceeded. -// -// * ErrCodeInstanceLimitExceededException "InstanceLimitExceededException" -// The maximum number of allowed on-premises instances in a single call was -// exceeded. -// -// * ErrCodeInstanceNotRegisteredException "InstanceNotRegisteredException" -// The specified on-premises instance is not registered. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RemoveTagsFromOnPremisesInstances -func (c *CodeDeploy) RemoveTagsFromOnPremisesInstances(input *RemoveTagsFromOnPremisesInstancesInput) (*RemoveTagsFromOnPremisesInstancesOutput, error) { - req, out := c.RemoveTagsFromOnPremisesInstancesRequest(input) - err := req.Send() - return out, err -} - -const opSkipWaitTimeForInstanceTermination = "SkipWaitTimeForInstanceTermination" - -// SkipWaitTimeForInstanceTerminationRequest generates a "aws/request.Request" representing the -// client's request for the SkipWaitTimeForInstanceTermination operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SkipWaitTimeForInstanceTermination for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SkipWaitTimeForInstanceTermination method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SkipWaitTimeForInstanceTerminationRequest method. -// req, resp := client.SkipWaitTimeForInstanceTerminationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/SkipWaitTimeForInstanceTermination -func (c *CodeDeploy) SkipWaitTimeForInstanceTerminationRequest(input *SkipWaitTimeForInstanceTerminationInput) (req *request.Request, output *SkipWaitTimeForInstanceTerminationOutput) { - op := &request.Operation{ - Name: opSkipWaitTimeForInstanceTermination, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SkipWaitTimeForInstanceTerminationInput{} - } - - output = &SkipWaitTimeForInstanceTerminationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SkipWaitTimeForInstanceTermination API operation for AWS CodeDeploy. -// -// In a blue/green deployment, overrides any specified wait time and starts -// terminating instances immediately after the traffic routing is completed. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation SkipWaitTimeForInstanceTermination for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" -// At least one deployment ID must be specified. -// -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" -// The deployment does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeDeploymentAlreadyCompletedException "DeploymentAlreadyCompletedException" -// The deployment is already complete. -// -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" -// At least one of the deployment IDs was specified in an invalid format. -// -// * ErrCodeDeploymentNotStartedException "DeploymentNotStartedException" -// The specified deployment has not started. -// -// * ErrCodeUnsupportedActionForDeploymentTypeException "UnsupportedActionForDeploymentTypeException" -// A call was submitted that is not supported for the specified deployment type. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/SkipWaitTimeForInstanceTermination -func (c *CodeDeploy) SkipWaitTimeForInstanceTermination(input *SkipWaitTimeForInstanceTerminationInput) (*SkipWaitTimeForInstanceTerminationOutput, error) { - req, out := c.SkipWaitTimeForInstanceTerminationRequest(input) - err := req.Send() - return out, err -} - -const opStopDeployment = "StopDeployment" - -// StopDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the StopDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopDeploymentRequest method. -// req, resp := client.StopDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/StopDeployment -func (c *CodeDeploy) StopDeploymentRequest(input *StopDeploymentInput) (req *request.Request, output *StopDeploymentOutput) { - op := &request.Operation{ - Name: opStopDeployment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopDeploymentInput{} - } - - output = &StopDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopDeployment API operation for AWS CodeDeploy. -// -// Attempts to stop an ongoing deployment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation StopDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" -// At least one deployment ID must be specified. -// -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" -// The deployment does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeDeploymentAlreadyCompletedException "DeploymentAlreadyCompletedException" -// The deployment is already complete. -// -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" -// At least one of the deployment IDs was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/StopDeployment -func (c *CodeDeploy) StopDeployment(input *StopDeploymentInput) (*StopDeploymentOutput, error) { - req, out := c.StopDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opUpdateApplication = "UpdateApplication" - -// UpdateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateApplicationRequest method. -// req, resp := client.UpdateApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateApplication -func (c *CodeDeploy) UpdateApplicationRequest(input *UpdateApplicationInput) (req *request.Request, output *UpdateApplicationOutput) { - op := &request.Operation{ - Name: opUpdateApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateApplicationInput{} - } - - output = &UpdateApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateApplication API operation for AWS CodeDeploy. -// -// Changes the name of an application. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation UpdateApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationAlreadyExistsException "ApplicationAlreadyExistsException" -// An application with the specified name already exists with the applicable -// IAM user or AWS account. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateApplication -func (c *CodeDeploy) UpdateApplication(input *UpdateApplicationInput) (*UpdateApplicationOutput, error) { - req, out := c.UpdateApplicationRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDeploymentGroup = "UpdateDeploymentGroup" - -// UpdateDeploymentGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDeploymentGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDeploymentGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDeploymentGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDeploymentGroupRequest method. -// req, resp := client.UpdateDeploymentGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateDeploymentGroup -func (c *CodeDeploy) UpdateDeploymentGroupRequest(input *UpdateDeploymentGroupInput) (req *request.Request, output *UpdateDeploymentGroupOutput) { - op := &request.Operation{ - Name: opUpdateDeploymentGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateDeploymentGroupInput{} - } - - output = &UpdateDeploymentGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDeploymentGroup API operation for AWS CodeDeploy. -// -// Changes information about a deployment group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodeDeploy's -// API operation UpdateDeploymentGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" -// The minimum number of required application names was not specified. -// -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" -// The application name was specified in an invalid format. -// -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" -// The application does not exist with the applicable IAM user or AWS account. -// -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" -// The deployment group name was specified in an invalid format. -// -// * ErrCodeDeploymentGroupAlreadyExistsException "DeploymentGroupAlreadyExistsException" -// A deployment group with the specified name already exists with the applicable -// IAM user or AWS account. -// -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" -// The deployment group name was not specified. -// -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" -// The named deployment group does not exist with the applicable IAM user or -// AWS account. -// -// * ErrCodeInvalidEC2TagException "InvalidEC2TagException" -// The tag was specified in an invalid format. -// -// * ErrCodeInvalidTagException "InvalidTagException" -// The specified tag was specified in an invalid format. -// -// * ErrCodeInvalidAutoScalingGroupException "InvalidAutoScalingGroupException" -// The Auto Scaling group was specified in an invalid format or does not exist. -// -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" -// The deployment configuration name was specified in an invalid format. -// -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" -// The deployment configuration does not exist with the applicable IAM user -// or AWS account. -// -// * ErrCodeInvalidRoleException "InvalidRoleException" -// The service role ARN was specified in an invalid format. Or, if an Auto Scaling -// group was specified, the specified service role does not grant the appropriate -// permissions to Auto Scaling. -// -// * ErrCodeLifecycleHookLimitExceededException "LifecycleHookLimitExceededException" -// The limit for lifecycle hooks was exceeded. -// -// * ErrCodeInvalidTriggerConfigException "InvalidTriggerConfigException" -// The trigger was specified in an invalid format. -// -// * ErrCodeTriggerTargetsLimitExceededException "TriggerTargetsLimitExceededException" -// The maximum allowed number of triggers was exceeded. -// -// * ErrCodeInvalidAlarmConfigException "InvalidAlarmConfigException" -// The format of the alarm configuration is invalid. Possible causes include: -// -// * The alarm list is null. -// -// * The alarm object is null. -// -// * The alarm name is empty or null or exceeds the 255 character limit. -// -// * Two alarms with the same name have been specified. -// -// * The alarm configuration is enabled but the alarm list is empty. -// -// * ErrCodeAlarmsLimitExceededException "AlarmsLimitExceededException" -// The maximum number of alarms for a deployment group (10) was exceeded. -// -// * ErrCodeInvalidAutoRollbackConfigException "InvalidAutoRollbackConfigException" -// The automatic rollback configuration was specified in an invalid format. -// For example, automatic rollback is enabled but an invalid triggering event -// type or no event types were listed. -// -// * ErrCodeInvalidLoadBalancerInfoException "InvalidLoadBalancerInfoException" -// An invalid load balancer name, or no load balancer name, was specified. -// -// * ErrCodeInvalidDeploymentStyleException "InvalidDeploymentStyleException" -// An invalid deployment style was specified. Valid deployment types include -// "IN_PLACE" and "BLUE_GREEN". Valid deployment options for blue/green deployments -// include "WITH_TRAFFIC_CONTROL" and "WITHOUT_TRAFFIC_CONTROL". -// -// * ErrCodeInvalidBlueGreenDeploymentConfigurationException "InvalidBlueGreenDeploymentConfigurationException" -// The configuration for the blue/green deployment group was provided in an -// invalid format. For information about deployment configuration format, see -// CreateDeploymentConfig. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateDeploymentGroup -func (c *CodeDeploy) UpdateDeploymentGroup(input *UpdateDeploymentGroupInput) (*UpdateDeploymentGroupOutput, error) { - req, out := c.UpdateDeploymentGroupRequest(input) - err := req.Send() - return out, err -} - -// Represents the input of, and adds tags to, an on-premises instance operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AddTagsToOnPremisesInstancesInput -type AddTagsToOnPremisesInstancesInput struct { - _ struct{} `type:"structure"` - - // The names of the on-premises instances to which to add tags. - // - // InstanceNames is a required field - InstanceNames []*string `locationName:"instanceNames" type:"list" required:"true"` - - // The tag key-value pairs to add to the on-premises instances. - // - // Keys and values are both required. Keys cannot be null or empty strings. - // Value-only tags are not allowed. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsToOnPremisesInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToOnPremisesInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToOnPremisesInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToOnPremisesInstancesInput"} - if s.InstanceNames == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceNames")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceNames sets the InstanceNames field's value. -func (s *AddTagsToOnPremisesInstancesInput) SetInstanceNames(v []*string) *AddTagsToOnPremisesInstancesInput { - s.InstanceNames = v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToOnPremisesInstancesInput) SetTags(v []*Tag) *AddTagsToOnPremisesInstancesInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AddTagsToOnPremisesInstancesOutput -type AddTagsToOnPremisesInstancesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsToOnPremisesInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToOnPremisesInstancesOutput) GoString() string { - return s.String() -} - -// Information about an alarm. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/Alarm -type Alarm struct { - _ struct{} `type:"structure"` - - // The name of the alarm. Maximum length is 255 characters. Each alarm name - // can be used only once in a list of alarms. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s Alarm) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Alarm) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Alarm) SetName(v string) *Alarm { - s.Name = &v - return s -} - -// Information about alarms associated with the deployment group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AlarmConfiguration -type AlarmConfiguration struct { - _ struct{} `type:"structure"` - - // A list of alarms configured for the deployment group. A maximum of 10 alarms - // can be added to a deployment group. - Alarms []*Alarm `locationName:"alarms" type:"list"` - - // Indicates whether the alarm configuration is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // Indicates whether a deployment should continue if information about the current - // state of alarms cannot be retrieved from Amazon CloudWatch. The default value - // is false. - // - // * true: The deployment will proceed even if alarm status information can't - // be retrieved from Amazon CloudWatch. - // - // * false: The deployment will stop if alarm status information can't be - // retrieved from Amazon CloudWatch. - IgnorePollAlarmFailure *bool `locationName:"ignorePollAlarmFailure" type:"boolean"` -} - -// String returns the string representation -func (s AlarmConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AlarmConfiguration) GoString() string { - return s.String() -} - -// SetAlarms sets the Alarms field's value. -func (s *AlarmConfiguration) SetAlarms(v []*Alarm) *AlarmConfiguration { - s.Alarms = v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *AlarmConfiguration) SetEnabled(v bool) *AlarmConfiguration { - s.Enabled = &v - return s -} - -// SetIgnorePollAlarmFailure sets the IgnorePollAlarmFailure field's value. -func (s *AlarmConfiguration) SetIgnorePollAlarmFailure(v bool) *AlarmConfiguration { - s.IgnorePollAlarmFailure = &v - return s -} - -// Information about an application. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ApplicationInfo -type ApplicationInfo struct { - _ struct{} `type:"structure"` - - // The application ID. - ApplicationId *string `locationName:"applicationId" type:"string"` - - // The application name. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` - - // The time at which the application was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"unix"` - - // True if the user has authenticated with GitHub for the specified application; - // otherwise, false. - LinkedToGitHub *bool `locationName:"linkedToGitHub" type:"boolean"` -} - -// String returns the string representation -func (s ApplicationInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplicationInfo) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ApplicationInfo) SetApplicationId(v string) *ApplicationInfo { - s.ApplicationId = &v - return s -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ApplicationInfo) SetApplicationName(v string) *ApplicationInfo { - s.ApplicationName = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *ApplicationInfo) SetCreateTime(v time.Time) *ApplicationInfo { - s.CreateTime = &v - return s -} - -// SetLinkedToGitHub sets the LinkedToGitHub field's value. -func (s *ApplicationInfo) SetLinkedToGitHub(v bool) *ApplicationInfo { - s.LinkedToGitHub = &v - return s -} - -// Information about a configuration for automatically rolling back to a previous -// version of an application revision when a deployment doesn't complete successfully. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AutoRollbackConfiguration -type AutoRollbackConfiguration struct { - _ struct{} `type:"structure"` - - // Indicates whether a defined automatic rollback configuration is currently - // enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The event type or types that trigger a rollback. - Events []*string `locationName:"events" type:"list"` -} - -// String returns the string representation -func (s AutoRollbackConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutoRollbackConfiguration) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *AutoRollbackConfiguration) SetEnabled(v bool) *AutoRollbackConfiguration { - s.Enabled = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *AutoRollbackConfiguration) SetEvents(v []*string) *AutoRollbackConfiguration { - s.Events = v - return s -} - -// Information about an Auto Scaling group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AutoScalingGroup -type AutoScalingGroup struct { - _ struct{} `type:"structure"` - - // An Auto Scaling lifecycle event hook name. - Hook *string `locationName:"hook" type:"string"` - - // The Auto Scaling group name. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s AutoScalingGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutoScalingGroup) GoString() string { - return s.String() -} - -// SetHook sets the Hook field's value. -func (s *AutoScalingGroup) SetHook(v string) *AutoScalingGroup { - s.Hook = &v - return s -} - -// SetName sets the Name field's value. -func (s *AutoScalingGroup) SetName(v string) *AutoScalingGroup { - s.Name = &v - return s -} - -// Represents the input of a batch get application revisions operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplicationRevisionsInput -type BatchGetApplicationRevisionsInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application about which to get revision information. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // Information to get about the application revisions, including type and location. - // - // Revisions is a required field - Revisions []*RevisionLocation `locationName:"revisions" type:"list" required:"true"` -} - -// String returns the string representation -func (s BatchGetApplicationRevisionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetApplicationRevisionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetApplicationRevisionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetApplicationRevisionsInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.Revisions == nil { - invalidParams.Add(request.NewErrParamRequired("Revisions")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *BatchGetApplicationRevisionsInput) SetApplicationName(v string) *BatchGetApplicationRevisionsInput { - s.ApplicationName = &v - return s -} - -// SetRevisions sets the Revisions field's value. -func (s *BatchGetApplicationRevisionsInput) SetRevisions(v []*RevisionLocation) *BatchGetApplicationRevisionsInput { - s.Revisions = v - return s -} - -// Represents the output of a batch get application revisions operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplicationRevisionsOutput -type BatchGetApplicationRevisionsOutput struct { - _ struct{} `type:"structure"` - - // The name of the application that corresponds to the revisions. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` - - // Information about errors that may have occurred during the API call. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // Additional information about the revisions, including the type and location. - Revisions []*RevisionInfo `locationName:"revisions" type:"list"` -} - -// String returns the string representation -func (s BatchGetApplicationRevisionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetApplicationRevisionsOutput) GoString() string { - return s.String() -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *BatchGetApplicationRevisionsOutput) SetApplicationName(v string) *BatchGetApplicationRevisionsOutput { - s.ApplicationName = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *BatchGetApplicationRevisionsOutput) SetErrorMessage(v string) *BatchGetApplicationRevisionsOutput { - s.ErrorMessage = &v - return s -} - -// SetRevisions sets the Revisions field's value. -func (s *BatchGetApplicationRevisionsOutput) SetRevisions(v []*RevisionInfo) *BatchGetApplicationRevisionsOutput { - s.Revisions = v - return s -} - -// Represents the input of a batch get applications operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplicationsInput -type BatchGetApplicationsInput struct { - _ struct{} `type:"structure"` - - // A list of application names separated by spaces. - ApplicationNames []*string `locationName:"applicationNames" type:"list"` -} - -// String returns the string representation -func (s BatchGetApplicationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetApplicationsInput) GoString() string { - return s.String() -} - -// SetApplicationNames sets the ApplicationNames field's value. -func (s *BatchGetApplicationsInput) SetApplicationNames(v []*string) *BatchGetApplicationsInput { - s.ApplicationNames = v - return s -} - -// Represents the output of a batch get applications operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplicationsOutput -type BatchGetApplicationsOutput struct { - _ struct{} `type:"structure"` - - // Information about the applications. - ApplicationsInfo []*ApplicationInfo `locationName:"applicationsInfo" type:"list"` -} - -// String returns the string representation -func (s BatchGetApplicationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetApplicationsOutput) GoString() string { - return s.String() -} - -// SetApplicationsInfo sets the ApplicationsInfo field's value. -func (s *BatchGetApplicationsOutput) SetApplicationsInfo(v []*ApplicationInfo) *BatchGetApplicationsOutput { - s.ApplicationsInfo = v - return s -} - -// Represents the input of a batch get deployment groups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentGroupsInput -type BatchGetDeploymentGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // The deployment groups' names. - // - // DeploymentGroupNames is a required field - DeploymentGroupNames []*string `locationName:"deploymentGroupNames" type:"list" required:"true"` -} - -// String returns the string representation -func (s BatchGetDeploymentGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetDeploymentGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetDeploymentGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetDeploymentGroupsInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.DeploymentGroupNames == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentGroupNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *BatchGetDeploymentGroupsInput) SetApplicationName(v string) *BatchGetDeploymentGroupsInput { - s.ApplicationName = &v - return s -} - -// SetDeploymentGroupNames sets the DeploymentGroupNames field's value. -func (s *BatchGetDeploymentGroupsInput) SetDeploymentGroupNames(v []*string) *BatchGetDeploymentGroupsInput { - s.DeploymentGroupNames = v - return s -} - -// Represents the output of a batch get deployment groups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentGroupsOutput -type BatchGetDeploymentGroupsOutput struct { - _ struct{} `type:"structure"` - - // Information about the deployment groups. - DeploymentGroupsInfo []*DeploymentGroupInfo `locationName:"deploymentGroupsInfo" type:"list"` - - // Information about errors that may have occurred during the API call. - ErrorMessage *string `locationName:"errorMessage" type:"string"` -} - -// String returns the string representation -func (s BatchGetDeploymentGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetDeploymentGroupsOutput) GoString() string { - return s.String() -} - -// SetDeploymentGroupsInfo sets the DeploymentGroupsInfo field's value. -func (s *BatchGetDeploymentGroupsOutput) SetDeploymentGroupsInfo(v []*DeploymentGroupInfo) *BatchGetDeploymentGroupsOutput { - s.DeploymentGroupsInfo = v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *BatchGetDeploymentGroupsOutput) SetErrorMessage(v string) *BatchGetDeploymentGroupsOutput { - s.ErrorMessage = &v - return s -} - -// Represents the input of a batch get deployment instances operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentInstancesInput -type BatchGetDeploymentInstancesInput struct { - _ struct{} `type:"structure"` - - // The unique ID of a deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` - - // The unique IDs of instances in the deployment group. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"instanceIds" type:"list" required:"true"` -} - -// String returns the string representation -func (s BatchGetDeploymentInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetDeploymentInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetDeploymentInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetDeploymentInstancesInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *BatchGetDeploymentInstancesInput) SetDeploymentId(v string) *BatchGetDeploymentInstancesInput { - s.DeploymentId = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *BatchGetDeploymentInstancesInput) SetInstanceIds(v []*string) *BatchGetDeploymentInstancesInput { - s.InstanceIds = v - return s -} - -// Represents the output of a batch get deployment instance operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentInstancesOutput -type BatchGetDeploymentInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about errors that may have occurred during the API call. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // Information about the instance. - InstancesSummary []*InstanceSummary `locationName:"instancesSummary" type:"list"` -} - -// String returns the string representation -func (s BatchGetDeploymentInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetDeploymentInstancesOutput) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *BatchGetDeploymentInstancesOutput) SetErrorMessage(v string) *BatchGetDeploymentInstancesOutput { - s.ErrorMessage = &v - return s -} - -// SetInstancesSummary sets the InstancesSummary field's value. -func (s *BatchGetDeploymentInstancesOutput) SetInstancesSummary(v []*InstanceSummary) *BatchGetDeploymentInstancesOutput { - s.InstancesSummary = v - return s -} - -// Represents the input of a batch get deployments operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentsInput -type BatchGetDeploymentsInput struct { - _ struct{} `type:"structure"` - - // A list of deployment IDs, separated by spaces. - DeploymentIds []*string `locationName:"deploymentIds" type:"list"` -} - -// String returns the string representation -func (s BatchGetDeploymentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetDeploymentsInput) GoString() string { - return s.String() -} - -// SetDeploymentIds sets the DeploymentIds field's value. -func (s *BatchGetDeploymentsInput) SetDeploymentIds(v []*string) *BatchGetDeploymentsInput { - s.DeploymentIds = v - return s -} - -// Represents the output of a batch get deployments operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentsOutput -type BatchGetDeploymentsOutput struct { - _ struct{} `type:"structure"` - - // Information about the deployments. - DeploymentsInfo []*DeploymentInfo `locationName:"deploymentsInfo" type:"list"` -} - -// String returns the string representation -func (s BatchGetDeploymentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetDeploymentsOutput) GoString() string { - return s.String() -} - -// SetDeploymentsInfo sets the DeploymentsInfo field's value. -func (s *BatchGetDeploymentsOutput) SetDeploymentsInfo(v []*DeploymentInfo) *BatchGetDeploymentsOutput { - s.DeploymentsInfo = v - return s -} - -// Represents the input of a batch get on-premises instances operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetOnPremisesInstancesInput -type BatchGetOnPremisesInstancesInput struct { - _ struct{} `type:"structure"` - - // The names of the on-premises instances about which to get information. - InstanceNames []*string `locationName:"instanceNames" type:"list"` -} - -// String returns the string representation -func (s BatchGetOnPremisesInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetOnPremisesInstancesInput) GoString() string { - return s.String() -} - -// SetInstanceNames sets the InstanceNames field's value. -func (s *BatchGetOnPremisesInstancesInput) SetInstanceNames(v []*string) *BatchGetOnPremisesInstancesInput { - s.InstanceNames = v - return s -} - -// Represents the output of a batch get on-premises instances operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetOnPremisesInstancesOutput -type BatchGetOnPremisesInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about the on-premises instances. - InstanceInfos []*InstanceInfo `locationName:"instanceInfos" type:"list"` -} - -// String returns the string representation -func (s BatchGetOnPremisesInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetOnPremisesInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceInfos sets the InstanceInfos field's value. -func (s *BatchGetOnPremisesInstancesOutput) SetInstanceInfos(v []*InstanceInfo) *BatchGetOnPremisesInstancesOutput { - s.InstanceInfos = v - return s -} - -// Information about blue/green deployment options for a deployment group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BlueGreenDeploymentConfiguration -type BlueGreenDeploymentConfiguration struct { - _ struct{} `type:"structure"` - - // Information about the action to take when newly provisioned instances are - // ready to receive traffic in a blue/green deployment. - DeploymentReadyOption *DeploymentReadyOption `locationName:"deploymentReadyOption" type:"structure"` - - // Information about how instances are provisioned for a replacement environment - // in a blue/green deployment. - GreenFleetProvisioningOption *GreenFleetProvisioningOption `locationName:"greenFleetProvisioningOption" type:"structure"` - - // Information about whether to terminate instances in the original fleet during - // a blue/green deployment. - TerminateBlueInstancesOnDeploymentSuccess *BlueInstanceTerminationOption `locationName:"terminateBlueInstancesOnDeploymentSuccess" type:"structure"` -} - -// String returns the string representation -func (s BlueGreenDeploymentConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BlueGreenDeploymentConfiguration) GoString() string { - return s.String() -} - -// SetDeploymentReadyOption sets the DeploymentReadyOption field's value. -func (s *BlueGreenDeploymentConfiguration) SetDeploymentReadyOption(v *DeploymentReadyOption) *BlueGreenDeploymentConfiguration { - s.DeploymentReadyOption = v - return s -} - -// SetGreenFleetProvisioningOption sets the GreenFleetProvisioningOption field's value. -func (s *BlueGreenDeploymentConfiguration) SetGreenFleetProvisioningOption(v *GreenFleetProvisioningOption) *BlueGreenDeploymentConfiguration { - s.GreenFleetProvisioningOption = v - return s -} - -// SetTerminateBlueInstancesOnDeploymentSuccess sets the TerminateBlueInstancesOnDeploymentSuccess field's value. -func (s *BlueGreenDeploymentConfiguration) SetTerminateBlueInstancesOnDeploymentSuccess(v *BlueInstanceTerminationOption) *BlueGreenDeploymentConfiguration { - s.TerminateBlueInstancesOnDeploymentSuccess = v - return s -} - -// Information about whether instances in the original environment are terminated -// when a blue/green deployment is successful. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BlueInstanceTerminationOption -type BlueInstanceTerminationOption struct { - _ struct{} `type:"structure"` - - // The action to take on instances in the original environment after a successful - // blue/green deployment. - // - // * TERMINATE: Instances are terminated after a specified wait time. - // - // * KEEP_ALIVE: Instances are left running after they are deregistered from - // the load balancer and removed from the deployment group. - Action *string `locationName:"action" type:"string" enum:"InstanceAction"` - - // The number of minutes to wait after a successful blue/green deployment before - // terminating instances from the original environment. - TerminationWaitTimeInMinutes *int64 `locationName:"terminationWaitTimeInMinutes" type:"integer"` -} - -// String returns the string representation -func (s BlueInstanceTerminationOption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BlueInstanceTerminationOption) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *BlueInstanceTerminationOption) SetAction(v string) *BlueInstanceTerminationOption { - s.Action = &v - return s -} - -// SetTerminationWaitTimeInMinutes sets the TerminationWaitTimeInMinutes field's value. -func (s *BlueInstanceTerminationOption) SetTerminationWaitTimeInMinutes(v int64) *BlueInstanceTerminationOption { - s.TerminationWaitTimeInMinutes = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ContinueDeploymentInput -type ContinueDeploymentInput struct { - _ struct{} `type:"structure"` - - // The deployment ID of the blue/green deployment for which you want to start - // rerouting traffic to the replacement environment. - DeploymentId *string `locationName:"deploymentId" type:"string"` -} - -// String returns the string representation -func (s ContinueDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContinueDeploymentInput) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *ContinueDeploymentInput) SetDeploymentId(v string) *ContinueDeploymentInput { - s.DeploymentId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ContinueDeploymentOutput -type ContinueDeploymentOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ContinueDeploymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContinueDeploymentOutput) GoString() string { - return s.String() -} - -// Represents the input of a create application operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateApplicationInput -type CreateApplicationInput struct { - _ struct{} `type:"structure"` - - // The name of the application. This name must be unique with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateApplicationInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *CreateApplicationInput) SetApplicationName(v string) *CreateApplicationInput { - s.ApplicationName = &v - return s -} - -// Represents the output of a create application operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateApplicationOutput -type CreateApplicationOutput struct { - _ struct{} `type:"structure"` - - // A unique application ID. - ApplicationId *string `locationName:"applicationId" type:"string"` -} - -// String returns the string representation -func (s CreateApplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateApplicationOutput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateApplicationOutput) SetApplicationId(v string) *CreateApplicationOutput { - s.ApplicationId = &v - return s -} - -// Represents the input of a create deployment configuration operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentConfigInput -type CreateDeploymentConfigInput struct { - _ struct{} `type:"structure"` - - // The name of the deployment configuration to create. - // - // DeploymentConfigName is a required field - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string" required:"true"` - - // The minimum number of healthy instances that should be available at any time - // during the deployment. There are two parameters expected in the input: type - // and value. - // - // The type parameter takes either of the following values: - // - // * HOST_COUNT: The value parameter represents the minimum number of healthy - // instances as an absolute value. - // - // * FLEET_PERCENT: The value parameter represents the minimum number of - // healthy instances as a percentage of the total number of instances in - // the deployment. If you specify FLEET_PERCENT, at the start of the deployment, - // AWS CodeDeploy converts the percentage to the equivalent number of instance - // and rounds up fractional instances. - // - // The value parameter takes an integer. - // - // For example, to set a minimum of 95% healthy instance, specify a type of - // FLEET_PERCENT and a value of 95. - MinimumHealthyHosts *MinimumHealthyHosts `locationName:"minimumHealthyHosts" type:"structure"` -} - -// String returns the string representation -func (s CreateDeploymentConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDeploymentConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentConfigInput"} - if s.DeploymentConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentConfigName")) - } - if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *CreateDeploymentConfigInput) SetDeploymentConfigName(v string) *CreateDeploymentConfigInput { - s.DeploymentConfigName = &v - return s -} - -// SetMinimumHealthyHosts sets the MinimumHealthyHosts field's value. -func (s *CreateDeploymentConfigInput) SetMinimumHealthyHosts(v *MinimumHealthyHosts) *CreateDeploymentConfigInput { - s.MinimumHealthyHosts = v - return s -} - -// Represents the output of a create deployment configuration operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentConfigOutput -type CreateDeploymentConfigOutput struct { - _ struct{} `type:"structure"` - - // A unique deployment configuration ID. - DeploymentConfigId *string `locationName:"deploymentConfigId" type:"string"` -} - -// String returns the string representation -func (s CreateDeploymentConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentConfigOutput) GoString() string { - return s.String() -} - -// SetDeploymentConfigId sets the DeploymentConfigId field's value. -func (s *CreateDeploymentConfigOutput) SetDeploymentConfigId(v string) *CreateDeploymentConfigOutput { - s.DeploymentConfigId = &v - return s -} - -// Represents the input of a create deployment group operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentGroupInput -type CreateDeploymentGroupInput struct { - _ struct{} `type:"structure"` - - // Information to add about Amazon CloudWatch alarms when the deployment group - // is created. - AlarmConfiguration *AlarmConfiguration `locationName:"alarmConfiguration" type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // Configuration information for an automatic rollback that is added when a - // deployment group is created. - AutoRollbackConfiguration *AutoRollbackConfiguration `locationName:"autoRollbackConfiguration" type:"structure"` - - // A list of associated Auto Scaling groups. - AutoScalingGroups []*string `locationName:"autoScalingGroups" type:"list"` - - // Information about blue/green deployment options for a deployment group. - BlueGreenDeploymentConfiguration *BlueGreenDeploymentConfiguration `locationName:"blueGreenDeploymentConfiguration" type:"structure"` - - // If specified, the deployment configuration name can be either one of the - // predefined configurations provided with AWS CodeDeploy or a custom deployment - // configuration that you create by calling the create deployment configuration - // operation. - // - // CodeDeployDefault.OneAtATime is the default deployment configuration. It - // is used if a configuration isn't specified for the deployment or the deployment - // group. - // - // For more information about the predefined deployment configurations in AWS - // CodeDeploy, see see Working with Deployment Groups in AWS CodeDeploy (http://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-configurations.html) - // in the AWS CodeDeploy User Guide. - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string"` - - // The name of a new deployment group for the specified application. - // - // DeploymentGroupName is a required field - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string" required:"true"` - - // Information about the type of deployment, standard or blue/green, that you - // want to run and whether to route deployment traffic behind a load balancer. - DeploymentStyle *DeploymentStyle `locationName:"deploymentStyle" type:"structure"` - - // The Amazon EC2 tags on which to filter. - Ec2TagFilters []*EC2TagFilter `locationName:"ec2TagFilters" type:"list"` - - // Information about the load balancer used in a blue/green deployment. - LoadBalancerInfo *LoadBalancerInfo `locationName:"loadBalancerInfo" type:"structure"` - - // The on-premises instance tags on which to filter. - OnPremisesInstanceTagFilters []*TagFilter `locationName:"onPremisesInstanceTagFilters" type:"list"` - - // A service role ARN that allows AWS CodeDeploy to act on the user's behalf - // when interacting with AWS services. - // - // ServiceRoleArn is a required field - ServiceRoleArn *string `locationName:"serviceRoleArn" type:"string" required:"true"` - - // Information about triggers to create when the deployment group is created. - // For examples, see Create a Trigger for an AWS CodeDeploy Event (http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-notify-sns.html) - // in the AWS CodeDeploy User Guide. - TriggerConfigurations []*TriggerConfig `locationName:"triggerConfigurations" type:"list"` -} - -// String returns the string representation -func (s CreateDeploymentGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDeploymentGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentGroupInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1)) - } - if s.DeploymentGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentGroupName")) - } - if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1)) - } - if s.ServiceRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceRoleArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmConfiguration sets the AlarmConfiguration field's value. -func (s *CreateDeploymentGroupInput) SetAlarmConfiguration(v *AlarmConfiguration) *CreateDeploymentGroupInput { - s.AlarmConfiguration = v - return s -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *CreateDeploymentGroupInput) SetApplicationName(v string) *CreateDeploymentGroupInput { - s.ApplicationName = &v - return s -} - -// SetAutoRollbackConfiguration sets the AutoRollbackConfiguration field's value. -func (s *CreateDeploymentGroupInput) SetAutoRollbackConfiguration(v *AutoRollbackConfiguration) *CreateDeploymentGroupInput { - s.AutoRollbackConfiguration = v - return s -} - -// SetAutoScalingGroups sets the AutoScalingGroups field's value. -func (s *CreateDeploymentGroupInput) SetAutoScalingGroups(v []*string) *CreateDeploymentGroupInput { - s.AutoScalingGroups = v - return s -} - -// SetBlueGreenDeploymentConfiguration sets the BlueGreenDeploymentConfiguration field's value. -func (s *CreateDeploymentGroupInput) SetBlueGreenDeploymentConfiguration(v *BlueGreenDeploymentConfiguration) *CreateDeploymentGroupInput { - s.BlueGreenDeploymentConfiguration = v - return s -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *CreateDeploymentGroupInput) SetDeploymentConfigName(v string) *CreateDeploymentGroupInput { - s.DeploymentConfigName = &v - return s -} - -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *CreateDeploymentGroupInput) SetDeploymentGroupName(v string) *CreateDeploymentGroupInput { - s.DeploymentGroupName = &v - return s -} - -// SetDeploymentStyle sets the DeploymentStyle field's value. -func (s *CreateDeploymentGroupInput) SetDeploymentStyle(v *DeploymentStyle) *CreateDeploymentGroupInput { - s.DeploymentStyle = v - return s -} - -// SetEc2TagFilters sets the Ec2TagFilters field's value. -func (s *CreateDeploymentGroupInput) SetEc2TagFilters(v []*EC2TagFilter) *CreateDeploymentGroupInput { - s.Ec2TagFilters = v - return s -} - -// SetLoadBalancerInfo sets the LoadBalancerInfo field's value. -func (s *CreateDeploymentGroupInput) SetLoadBalancerInfo(v *LoadBalancerInfo) *CreateDeploymentGroupInput { - s.LoadBalancerInfo = v - return s -} - -// SetOnPremisesInstanceTagFilters sets the OnPremisesInstanceTagFilters field's value. -func (s *CreateDeploymentGroupInput) SetOnPremisesInstanceTagFilters(v []*TagFilter) *CreateDeploymentGroupInput { - s.OnPremisesInstanceTagFilters = v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *CreateDeploymentGroupInput) SetServiceRoleArn(v string) *CreateDeploymentGroupInput { - s.ServiceRoleArn = &v - return s -} - -// SetTriggerConfigurations sets the TriggerConfigurations field's value. -func (s *CreateDeploymentGroupInput) SetTriggerConfigurations(v []*TriggerConfig) *CreateDeploymentGroupInput { - s.TriggerConfigurations = v - return s -} - -// Represents the output of a create deployment group operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentGroupOutput -type CreateDeploymentGroupOutput struct { - _ struct{} `type:"structure"` - - // A unique deployment group ID. - DeploymentGroupId *string `locationName:"deploymentGroupId" type:"string"` -} - -// String returns the string representation -func (s CreateDeploymentGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentGroupOutput) GoString() string { - return s.String() -} - -// SetDeploymentGroupId sets the DeploymentGroupId field's value. -func (s *CreateDeploymentGroupOutput) SetDeploymentGroupId(v string) *CreateDeploymentGroupOutput { - s.DeploymentGroupId = &v - return s -} - -// Represents the input of a create deployment operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentInput -type CreateDeploymentInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // Configuration information for an automatic rollback that is added when a - // deployment is created. - AutoRollbackConfiguration *AutoRollbackConfiguration `locationName:"autoRollbackConfiguration" type:"structure"` - - // The name of a deployment configuration associated with the applicable IAM - // user or AWS account. - // - // If not specified, the value configured in the deployment group will be used - // as the default. If the deployment group does not have a deployment configuration - // associated with it, then CodeDeployDefault.OneAtATime will be used by default. - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string"` - - // The name of the deployment group. - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string"` - - // A comment about the deployment. - Description *string `locationName:"description" type:"string"` - - // If set to true, then if the deployment causes the ApplicationStop deployment - // lifecycle event to an instance to fail, the deployment to that instance will - // not be considered to have failed at that point and will continue on to the - // BeforeInstall deployment lifecycle event. - // - // If set to false or not specified, then if the deployment causes the ApplicationStop - // deployment lifecycle event to fail to an instance, the deployment to that - // instance will stop, and the deployment to that instance will be considered - // to have failed. - IgnoreApplicationStopFailures *bool `locationName:"ignoreApplicationStopFailures" type:"boolean"` - - // The type and location of the revision to deploy. - Revision *RevisionLocation `locationName:"revision" type:"structure"` - - // Information about the instances that will belong to the replacement environment - // in a blue/green deployment. - TargetInstances *TargetInstances `locationName:"targetInstances" type:"structure"` - - // Indicates whether to deploy to all instances or only to instances that are - // not running the latest application revision. - UpdateOutdatedInstancesOnly *bool `locationName:"updateOutdatedInstancesOnly" type:"boolean"` -} - -// String returns the string representation -func (s CreateDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1)) - } - if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *CreateDeploymentInput) SetApplicationName(v string) *CreateDeploymentInput { - s.ApplicationName = &v - return s -} - -// SetAutoRollbackConfiguration sets the AutoRollbackConfiguration field's value. -func (s *CreateDeploymentInput) SetAutoRollbackConfiguration(v *AutoRollbackConfiguration) *CreateDeploymentInput { - s.AutoRollbackConfiguration = v - return s -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *CreateDeploymentInput) SetDeploymentConfigName(v string) *CreateDeploymentInput { - s.DeploymentConfigName = &v - return s -} - -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *CreateDeploymentInput) SetDeploymentGroupName(v string) *CreateDeploymentInput { - s.DeploymentGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDeploymentInput) SetDescription(v string) *CreateDeploymentInput { - s.Description = &v - return s -} - -// SetIgnoreApplicationStopFailures sets the IgnoreApplicationStopFailures field's value. -func (s *CreateDeploymentInput) SetIgnoreApplicationStopFailures(v bool) *CreateDeploymentInput { - s.IgnoreApplicationStopFailures = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *CreateDeploymentInput) SetRevision(v *RevisionLocation) *CreateDeploymentInput { - s.Revision = v - return s -} - -// SetTargetInstances sets the TargetInstances field's value. -func (s *CreateDeploymentInput) SetTargetInstances(v *TargetInstances) *CreateDeploymentInput { - s.TargetInstances = v - return s -} - -// SetUpdateOutdatedInstancesOnly sets the UpdateOutdatedInstancesOnly field's value. -func (s *CreateDeploymentInput) SetUpdateOutdatedInstancesOnly(v bool) *CreateDeploymentInput { - s.UpdateOutdatedInstancesOnly = &v - return s -} - -// Represents the output of a create deployment operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentOutput -type CreateDeploymentOutput struct { - _ struct{} `type:"structure"` - - // A unique deployment ID. - DeploymentId *string `locationName:"deploymentId" type:"string"` -} - -// String returns the string representation -func (s CreateDeploymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentOutput) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *CreateDeploymentOutput) SetDeploymentId(v string) *CreateDeploymentOutput { - s.DeploymentId = &v - return s -} - -// Represents the input of a delete application operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteApplicationInput -type DeleteApplicationInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApplicationInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DeleteApplicationInput) SetApplicationName(v string) *DeleteApplicationInput { - s.ApplicationName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteApplicationOutput -type DeleteApplicationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteApplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteApplicationOutput) GoString() string { - return s.String() -} - -// Represents the input of a delete deployment configuration operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentConfigInput -type DeleteDeploymentConfigInput struct { - _ struct{} `type:"structure"` - - // The name of a deployment configuration associated with the applicable IAM - // user or AWS account. - // - // DeploymentConfigName is a required field - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDeploymentConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeploymentConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDeploymentConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDeploymentConfigInput"} - if s.DeploymentConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentConfigName")) - } - if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *DeleteDeploymentConfigInput) SetDeploymentConfigName(v string) *DeleteDeploymentConfigInput { - s.DeploymentConfigName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentConfigOutput -type DeleteDeploymentConfigOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDeploymentConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeploymentConfigOutput) GoString() string { - return s.String() -} - -// Represents the input of a delete deployment group operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentGroupInput -type DeleteDeploymentGroupInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // The name of an existing deployment group for the specified application. - // - // DeploymentGroupName is a required field - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDeploymentGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeploymentGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDeploymentGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDeploymentGroupInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.DeploymentGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentGroupName")) - } - if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DeleteDeploymentGroupInput) SetApplicationName(v string) *DeleteDeploymentGroupInput { - s.ApplicationName = &v - return s -} - -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *DeleteDeploymentGroupInput) SetDeploymentGroupName(v string) *DeleteDeploymentGroupInput { - s.DeploymentGroupName = &v - return s -} - -// Represents the output of a delete deployment group operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentGroupOutput -type DeleteDeploymentGroupOutput struct { - _ struct{} `type:"structure"` - - // If the output contains no data, and the corresponding deployment group contained - // at least one Auto Scaling group, AWS CodeDeploy successfully removed all - // corresponding Auto Scaling lifecycle event hooks from the Amazon EC2 instances - // in the Auto Scaling group. If the output contains data, AWS CodeDeploy could - // not remove some Auto Scaling lifecycle event hooks from the Amazon EC2 instances - // in the Auto Scaling group. - HooksNotCleanedUp []*AutoScalingGroup `locationName:"hooksNotCleanedUp" type:"list"` -} - -// String returns the string representation -func (s DeleteDeploymentGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeploymentGroupOutput) GoString() string { - return s.String() -} - -// SetHooksNotCleanedUp sets the HooksNotCleanedUp field's value. -func (s *DeleteDeploymentGroupOutput) SetHooksNotCleanedUp(v []*AutoScalingGroup) *DeleteDeploymentGroupOutput { - s.HooksNotCleanedUp = v - return s -} - -// Information about a deployment configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeploymentConfigInfo -type DeploymentConfigInfo struct { - _ struct{} `type:"structure"` - - // The time at which the deployment configuration was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"unix"` - - // The deployment configuration ID. - DeploymentConfigId *string `locationName:"deploymentConfigId" type:"string"` - - // The deployment configuration name. - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string"` - - // Information about the number or percentage of minimum healthy instance. - MinimumHealthyHosts *MinimumHealthyHosts `locationName:"minimumHealthyHosts" type:"structure"` -} - -// String returns the string representation -func (s DeploymentConfigInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentConfigInfo) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *DeploymentConfigInfo) SetCreateTime(v time.Time) *DeploymentConfigInfo { - s.CreateTime = &v - return s -} - -// SetDeploymentConfigId sets the DeploymentConfigId field's value. -func (s *DeploymentConfigInfo) SetDeploymentConfigId(v string) *DeploymentConfigInfo { - s.DeploymentConfigId = &v - return s -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *DeploymentConfigInfo) SetDeploymentConfigName(v string) *DeploymentConfigInfo { - s.DeploymentConfigName = &v - return s -} - -// SetMinimumHealthyHosts sets the MinimumHealthyHosts field's value. -func (s *DeploymentConfigInfo) SetMinimumHealthyHosts(v *MinimumHealthyHosts) *DeploymentConfigInfo { - s.MinimumHealthyHosts = v - return s -} - -// Information about a deployment group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeploymentGroupInfo -type DeploymentGroupInfo struct { - _ struct{} `type:"structure"` - - // A list of alarms associated with the deployment group. - AlarmConfiguration *AlarmConfiguration `locationName:"alarmConfiguration" type:"structure"` - - // The application name. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` - - // Information about the automatic rollback configuration associated with the - // deployment group. - AutoRollbackConfiguration *AutoRollbackConfiguration `locationName:"autoRollbackConfiguration" type:"structure"` - - // A list of associated Auto Scaling groups. - AutoScalingGroups []*AutoScalingGroup `locationName:"autoScalingGroups" type:"list"` - - // Information about blue/green deployment options for a deployment group. - BlueGreenDeploymentConfiguration *BlueGreenDeploymentConfiguration `locationName:"blueGreenDeploymentConfiguration" type:"structure"` - - // The deployment configuration name. - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string"` - - // The deployment group ID. - DeploymentGroupId *string `locationName:"deploymentGroupId" type:"string"` - - // The deployment group name. - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string"` - - // Information about the type of deployment, either standard or blue/green, - // you want to run and whether to route deployment traffic behind a load balancer. - DeploymentStyle *DeploymentStyle `locationName:"deploymentStyle" type:"structure"` - - // The Amazon EC2 tags on which to filter. - Ec2TagFilters []*EC2TagFilter `locationName:"ec2TagFilters" type:"list"` - - // Information about the load balancer to use in a blue/green deployment. - LoadBalancerInfo *LoadBalancerInfo `locationName:"loadBalancerInfo" type:"structure"` - - // The on-premises instance tags on which to filter. - OnPremisesInstanceTagFilters []*TagFilter `locationName:"onPremisesInstanceTagFilters" type:"list"` - - // A service role ARN. - ServiceRoleArn *string `locationName:"serviceRoleArn" type:"string"` - - // Information about the deployment group's target revision, including type - // and location. - TargetRevision *RevisionLocation `locationName:"targetRevision" type:"structure"` - - // Information about triggers associated with the deployment group. - TriggerConfigurations []*TriggerConfig `locationName:"triggerConfigurations" type:"list"` -} - -// String returns the string representation -func (s DeploymentGroupInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentGroupInfo) GoString() string { - return s.String() -} - -// SetAlarmConfiguration sets the AlarmConfiguration field's value. -func (s *DeploymentGroupInfo) SetAlarmConfiguration(v *AlarmConfiguration) *DeploymentGroupInfo { - s.AlarmConfiguration = v - return s -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DeploymentGroupInfo) SetApplicationName(v string) *DeploymentGroupInfo { - s.ApplicationName = &v - return s -} - -// SetAutoRollbackConfiguration sets the AutoRollbackConfiguration field's value. -func (s *DeploymentGroupInfo) SetAutoRollbackConfiguration(v *AutoRollbackConfiguration) *DeploymentGroupInfo { - s.AutoRollbackConfiguration = v - return s -} - -// SetAutoScalingGroups sets the AutoScalingGroups field's value. -func (s *DeploymentGroupInfo) SetAutoScalingGroups(v []*AutoScalingGroup) *DeploymentGroupInfo { - s.AutoScalingGroups = v - return s -} - -// SetBlueGreenDeploymentConfiguration sets the BlueGreenDeploymentConfiguration field's value. -func (s *DeploymentGroupInfo) SetBlueGreenDeploymentConfiguration(v *BlueGreenDeploymentConfiguration) *DeploymentGroupInfo { - s.BlueGreenDeploymentConfiguration = v - return s -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *DeploymentGroupInfo) SetDeploymentConfigName(v string) *DeploymentGroupInfo { - s.DeploymentConfigName = &v - return s -} - -// SetDeploymentGroupId sets the DeploymentGroupId field's value. -func (s *DeploymentGroupInfo) SetDeploymentGroupId(v string) *DeploymentGroupInfo { - s.DeploymentGroupId = &v - return s -} - -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *DeploymentGroupInfo) SetDeploymentGroupName(v string) *DeploymentGroupInfo { - s.DeploymentGroupName = &v - return s -} - -// SetDeploymentStyle sets the DeploymentStyle field's value. -func (s *DeploymentGroupInfo) SetDeploymentStyle(v *DeploymentStyle) *DeploymentGroupInfo { - s.DeploymentStyle = v - return s -} - -// SetEc2TagFilters sets the Ec2TagFilters field's value. -func (s *DeploymentGroupInfo) SetEc2TagFilters(v []*EC2TagFilter) *DeploymentGroupInfo { - s.Ec2TagFilters = v - return s -} - -// SetLoadBalancerInfo sets the LoadBalancerInfo field's value. -func (s *DeploymentGroupInfo) SetLoadBalancerInfo(v *LoadBalancerInfo) *DeploymentGroupInfo { - s.LoadBalancerInfo = v - return s -} - -// SetOnPremisesInstanceTagFilters sets the OnPremisesInstanceTagFilters field's value. -func (s *DeploymentGroupInfo) SetOnPremisesInstanceTagFilters(v []*TagFilter) *DeploymentGroupInfo { - s.OnPremisesInstanceTagFilters = v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *DeploymentGroupInfo) SetServiceRoleArn(v string) *DeploymentGroupInfo { - s.ServiceRoleArn = &v - return s -} - -// SetTargetRevision sets the TargetRevision field's value. -func (s *DeploymentGroupInfo) SetTargetRevision(v *RevisionLocation) *DeploymentGroupInfo { - s.TargetRevision = v - return s -} - -// SetTriggerConfigurations sets the TriggerConfigurations field's value. -func (s *DeploymentGroupInfo) SetTriggerConfigurations(v []*TriggerConfig) *DeploymentGroupInfo { - s.TriggerConfigurations = v - return s -} - -// Information about a deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeploymentInfo -type DeploymentInfo struct { - _ struct{} `type:"structure"` - - // Provides information about the results of a deployment, such as whether instances - // in the original environment in a blue/green deployment were not terminated. - AdditionalDeploymentStatusInfo *string `locationName:"additionalDeploymentStatusInfo" type:"string"` - - // The application name. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` - - // Information about the automatic rollback configuration associated with the - // deployment. - AutoRollbackConfiguration *AutoRollbackConfiguration `locationName:"autoRollbackConfiguration" type:"structure"` - - // Information about blue/green deployment options for this deployment. - BlueGreenDeploymentConfiguration *BlueGreenDeploymentConfiguration `locationName:"blueGreenDeploymentConfiguration" type:"structure"` - - // A timestamp indicating when the deployment was complete. - CompleteTime *time.Time `locationName:"completeTime" type:"timestamp" timestampFormat:"unix"` - - // A timestamp indicating when the deployment was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"unix"` - - // The means by which the deployment was created: - // - // * user: A user created the deployment. - // - // * autoscaling: Auto Scaling created the deployment. - // - // * codeDeployRollback: A rollback process created the deployment. - Creator *string `locationName:"creator" type:"string" enum:"DeploymentCreator"` - - // The deployment configuration name. - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string"` - - // The deployment group name. - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string"` - - // The deployment ID. - DeploymentId *string `locationName:"deploymentId" type:"string"` - - // A summary of the deployment status of the instances in the deployment. - DeploymentOverview *DeploymentOverview `locationName:"deploymentOverview" type:"structure"` - - // Information about the type of deployment, either standard or blue/green, - // you want to run and whether to route deployment traffic behind a load balancer. - DeploymentStyle *DeploymentStyle `locationName:"deploymentStyle" type:"structure"` - - // A comment about the deployment. - Description *string `locationName:"description" type:"string"` - - // Information about any error associated with this deployment. - ErrorInformation *ErrorInformation `locationName:"errorInformation" type:"structure"` - - // If true, then if the deployment causes the ApplicationStop deployment lifecycle - // event to an instance to fail, the deployment to that instance will not be - // considered to have failed at that point and will continue on to the BeforeInstall - // deployment lifecycle event. - // - // If false or not specified, then if the deployment causes the ApplicationStop - // deployment lifecycle event to an instance to fail, the deployment to that - // instance will stop, and the deployment to that instance will be considered - // to have failed. - IgnoreApplicationStopFailures *bool `locationName:"ignoreApplicationStopFailures" type:"boolean"` - - // Indicates whether the wait period set for the termination of instances in - // the original environment has started. Status is 'false' if the KEEP_ALIVE - // option is specified; otherwise, 'true' as soon as the termination wait period - // starts. - InstanceTerminationWaitTimeStarted *bool `locationName:"instanceTerminationWaitTimeStarted" type:"boolean"` - - // Information about the load balancer used in this blue/green deployment. - LoadBalancerInfo *LoadBalancerInfo `locationName:"loadBalancerInfo" type:"structure"` - - // Information about the location of stored application artifacts and the service - // from which to retrieve them. - Revision *RevisionLocation `locationName:"revision" type:"structure"` - - // Information about a deployment rollback. - RollbackInfo *RollbackInfo `locationName:"rollbackInfo" type:"structure"` - - // A timestamp indicating when the deployment was deployed to the deployment - // group. - // - // In some cases, the reported value of the start time may be later than the - // complete time. This is due to differences in the clock settings of back-end - // servers that participate in the deployment process. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"` - - // The current state of the deployment as a whole. - Status *string `locationName:"status" type:"string" enum:"DeploymentStatus"` - - // Information about the instances that belong to the replacement environment - // in a blue/green deployment. - TargetInstances *TargetInstances `locationName:"targetInstances" type:"structure"` - - // Indicates whether only instances that are not running the latest application - // revision are to be deployed to. - UpdateOutdatedInstancesOnly *bool `locationName:"updateOutdatedInstancesOnly" type:"boolean"` -} - -// String returns the string representation -func (s DeploymentInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentInfo) GoString() string { - return s.String() -} - -// SetAdditionalDeploymentStatusInfo sets the AdditionalDeploymentStatusInfo field's value. -func (s *DeploymentInfo) SetAdditionalDeploymentStatusInfo(v string) *DeploymentInfo { - s.AdditionalDeploymentStatusInfo = &v - return s -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DeploymentInfo) SetApplicationName(v string) *DeploymentInfo { - s.ApplicationName = &v - return s -} - -// SetAutoRollbackConfiguration sets the AutoRollbackConfiguration field's value. -func (s *DeploymentInfo) SetAutoRollbackConfiguration(v *AutoRollbackConfiguration) *DeploymentInfo { - s.AutoRollbackConfiguration = v - return s -} - -// SetBlueGreenDeploymentConfiguration sets the BlueGreenDeploymentConfiguration field's value. -func (s *DeploymentInfo) SetBlueGreenDeploymentConfiguration(v *BlueGreenDeploymentConfiguration) *DeploymentInfo { - s.BlueGreenDeploymentConfiguration = v - return s -} - -// SetCompleteTime sets the CompleteTime field's value. -func (s *DeploymentInfo) SetCompleteTime(v time.Time) *DeploymentInfo { - s.CompleteTime = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *DeploymentInfo) SetCreateTime(v time.Time) *DeploymentInfo { - s.CreateTime = &v - return s -} - -// SetCreator sets the Creator field's value. -func (s *DeploymentInfo) SetCreator(v string) *DeploymentInfo { - s.Creator = &v - return s -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *DeploymentInfo) SetDeploymentConfigName(v string) *DeploymentInfo { - s.DeploymentConfigName = &v - return s -} - -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *DeploymentInfo) SetDeploymentGroupName(v string) *DeploymentInfo { - s.DeploymentGroupName = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *DeploymentInfo) SetDeploymentId(v string) *DeploymentInfo { - s.DeploymentId = &v - return s -} - -// SetDeploymentOverview sets the DeploymentOverview field's value. -func (s *DeploymentInfo) SetDeploymentOverview(v *DeploymentOverview) *DeploymentInfo { - s.DeploymentOverview = v - return s -} - -// SetDeploymentStyle sets the DeploymentStyle field's value. -func (s *DeploymentInfo) SetDeploymentStyle(v *DeploymentStyle) *DeploymentInfo { - s.DeploymentStyle = v - return s -} - -// SetDescription sets the Description field's value. -func (s *DeploymentInfo) SetDescription(v string) *DeploymentInfo { - s.Description = &v - return s -} - -// SetErrorInformation sets the ErrorInformation field's value. -func (s *DeploymentInfo) SetErrorInformation(v *ErrorInformation) *DeploymentInfo { - s.ErrorInformation = v - return s -} - -// SetIgnoreApplicationStopFailures sets the IgnoreApplicationStopFailures field's value. -func (s *DeploymentInfo) SetIgnoreApplicationStopFailures(v bool) *DeploymentInfo { - s.IgnoreApplicationStopFailures = &v - return s -} - -// SetInstanceTerminationWaitTimeStarted sets the InstanceTerminationWaitTimeStarted field's value. -func (s *DeploymentInfo) SetInstanceTerminationWaitTimeStarted(v bool) *DeploymentInfo { - s.InstanceTerminationWaitTimeStarted = &v - return s -} - -// SetLoadBalancerInfo sets the LoadBalancerInfo field's value. -func (s *DeploymentInfo) SetLoadBalancerInfo(v *LoadBalancerInfo) *DeploymentInfo { - s.LoadBalancerInfo = v - return s -} - -// SetRevision sets the Revision field's value. -func (s *DeploymentInfo) SetRevision(v *RevisionLocation) *DeploymentInfo { - s.Revision = v - return s -} - -// SetRollbackInfo sets the RollbackInfo field's value. -func (s *DeploymentInfo) SetRollbackInfo(v *RollbackInfo) *DeploymentInfo { - s.RollbackInfo = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DeploymentInfo) SetStartTime(v time.Time) *DeploymentInfo { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeploymentInfo) SetStatus(v string) *DeploymentInfo { - s.Status = &v - return s -} - -// SetTargetInstances sets the TargetInstances field's value. -func (s *DeploymentInfo) SetTargetInstances(v *TargetInstances) *DeploymentInfo { - s.TargetInstances = v - return s -} - -// SetUpdateOutdatedInstancesOnly sets the UpdateOutdatedInstancesOnly field's value. -func (s *DeploymentInfo) SetUpdateOutdatedInstancesOnly(v bool) *DeploymentInfo { - s.UpdateOutdatedInstancesOnly = &v - return s -} - -// Information about the deployment status of the instances in the deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeploymentOverview -type DeploymentOverview struct { - _ struct{} `type:"structure"` - - // The number of instances in the deployment in a failed state. - Failed *int64 `type:"long"` - - // The number of instances in which the deployment is in progress. - InProgress *int64 `type:"long"` - - // The number of instances in the deployment in a pending state. - Pending *int64 `type:"long"` - - // The number of instances in a replacement environment ready to receive traffic - // in a blue/green deployment. - Ready *int64 `type:"long"` - - // The number of instances in the deployment in a skipped state. - Skipped *int64 `type:"long"` - - // The number of instances in the deployment to which revisions have been successfully - // deployed. - Succeeded *int64 `type:"long"` -} - -// String returns the string representation -func (s DeploymentOverview) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentOverview) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *DeploymentOverview) SetFailed(v int64) *DeploymentOverview { - s.Failed = &v - return s -} - -// SetInProgress sets the InProgress field's value. -func (s *DeploymentOverview) SetInProgress(v int64) *DeploymentOverview { - s.InProgress = &v - return s -} - -// SetPending sets the Pending field's value. -func (s *DeploymentOverview) SetPending(v int64) *DeploymentOverview { - s.Pending = &v - return s -} - -// SetReady sets the Ready field's value. -func (s *DeploymentOverview) SetReady(v int64) *DeploymentOverview { - s.Ready = &v - return s -} - -// SetSkipped sets the Skipped field's value. -func (s *DeploymentOverview) SetSkipped(v int64) *DeploymentOverview { - s.Skipped = &v - return s -} - -// SetSucceeded sets the Succeeded field's value. -func (s *DeploymentOverview) SetSucceeded(v int64) *DeploymentOverview { - s.Succeeded = &v - return s -} - -// Information about how traffic is rerouted to instances in a replacement environment -// in a blue/green deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeploymentReadyOption -type DeploymentReadyOption struct { - _ struct{} `type:"structure"` - - // Information about when to reroute traffic from an original environment to - // a replacement environment in a blue/green deployment. - // - // * CONTINUE_DEPLOYMENT: Register new instances with the load balancer immediately - // after the new application revision is installed on the instances in the - // replacement environment. - // - // * STOP_DEPLOYMENT: Do not register new instances with load balancer unless - // traffic is rerouted manually. If traffic is not rerouted manually before - // the end of the specified wait period, the deployment status is changed - // to Stopped. - ActionOnTimeout *string `locationName:"actionOnTimeout" type:"string" enum:"DeploymentReadyAction"` - - // The number of minutes to wait before the status of a blue/green deployment - // changed to Stopped if rerouting is not started manually. Applies only to - // the STOP_DEPLOYMENT option for actionOnTimeout - WaitTimeInMinutes *int64 `locationName:"waitTimeInMinutes" type:"integer"` -} - -// String returns the string representation -func (s DeploymentReadyOption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentReadyOption) GoString() string { - return s.String() -} - -// SetActionOnTimeout sets the ActionOnTimeout field's value. -func (s *DeploymentReadyOption) SetActionOnTimeout(v string) *DeploymentReadyOption { - s.ActionOnTimeout = &v - return s -} - -// SetWaitTimeInMinutes sets the WaitTimeInMinutes field's value. -func (s *DeploymentReadyOption) SetWaitTimeInMinutes(v int64) *DeploymentReadyOption { - s.WaitTimeInMinutes = &v - return s -} - -// Information about the type of deployment, either standard or blue/green, -// you want to run and whether to route deployment traffic behind a load balancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeploymentStyle -type DeploymentStyle struct { - _ struct{} `type:"structure"` - - // Indicates whether to route deployment traffic behind a load balancer. - DeploymentOption *string `locationName:"deploymentOption" type:"string" enum:"DeploymentOption"` - - // Indicates whether to run a standard deployment or a blue/green deployment. - DeploymentType *string `locationName:"deploymentType" type:"string" enum:"DeploymentType"` -} - -// String returns the string representation -func (s DeploymentStyle) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentStyle) GoString() string { - return s.String() -} - -// SetDeploymentOption sets the DeploymentOption field's value. -func (s *DeploymentStyle) SetDeploymentOption(v string) *DeploymentStyle { - s.DeploymentOption = &v - return s -} - -// SetDeploymentType sets the DeploymentType field's value. -func (s *DeploymentStyle) SetDeploymentType(v string) *DeploymentStyle { - s.DeploymentType = &v - return s -} - -// Represents the input of a deregister on-premises instance operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeregisterOnPremisesInstanceInput -type DeregisterOnPremisesInstanceInput struct { - _ struct{} `type:"structure"` - - // The name of the on-premises instance to deregister. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterOnPremisesInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterOnPremisesInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterOnPremisesInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterOnPremisesInstanceInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *DeregisterOnPremisesInstanceInput) SetInstanceName(v string) *DeregisterOnPremisesInstanceInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeregisterOnPremisesInstanceOutput -type DeregisterOnPremisesInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterOnPremisesInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterOnPremisesInstanceOutput) GoString() string { - return s.String() -} - -// Diagnostic information about executable scripts that are part of a deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/Diagnostics -type Diagnostics struct { - _ struct{} `type:"structure"` - - // The associated error code: - // - // * Success: The specified script ran. - // - // * ScriptMissing: The specified script was not found in the specified location. - // - // * ScriptNotExecutable: The specified script is not a recognized executable - // file type. - // - // * ScriptTimedOut: The specified script did not finish running in the specified - // time period. - // - // * ScriptFailed: The specified script failed to run as expected. - // - // * UnknownError: The specified script did not run for an unknown reason. - ErrorCode *string `locationName:"errorCode" type:"string" enum:"LifecycleErrorCode"` - - // The last portion of the diagnostic log. - // - // If available, AWS CodeDeploy returns up to the last 4 KB of the diagnostic - // log. - LogTail *string `locationName:"logTail" type:"string"` - - // The message associated with the error. - Message *string `locationName:"message" type:"string"` - - // The name of the script. - ScriptName *string `locationName:"scriptName" type:"string"` -} - -// String returns the string representation -func (s Diagnostics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Diagnostics) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *Diagnostics) SetErrorCode(v string) *Diagnostics { - s.ErrorCode = &v - return s -} - -// SetLogTail sets the LogTail field's value. -func (s *Diagnostics) SetLogTail(v string) *Diagnostics { - s.LogTail = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *Diagnostics) SetMessage(v string) *Diagnostics { - s.Message = &v - return s -} - -// SetScriptName sets the ScriptName field's value. -func (s *Diagnostics) SetScriptName(v string) *Diagnostics { - s.ScriptName = &v - return s -} - -// Information about a tag filter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/EC2TagFilter -type EC2TagFilter struct { - _ struct{} `type:"structure"` - - // The tag filter key. - Key *string `type:"string"` - - // The tag filter type: - // - // * KEY_ONLY: Key only. - // - // * VALUE_ONLY: Value only. - // - // * KEY_AND_VALUE: Key and value. - Type *string `type:"string" enum:"EC2TagFilterType"` - - // The tag filter value. - Value *string `type:"string"` -} - -// String returns the string representation -func (s EC2TagFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EC2TagFilter) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *EC2TagFilter) SetKey(v string) *EC2TagFilter { - s.Key = &v - return s -} - -// SetType sets the Type field's value. -func (s *EC2TagFilter) SetType(v string) *EC2TagFilter { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *EC2TagFilter) SetValue(v string) *EC2TagFilter { - s.Value = &v - return s -} - -// Information about a load balancer in Elastic Load Balancing to use in a blue/green -// deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ELBInfo -type ELBInfo struct { - _ struct{} `type:"structure"` - - // The name of the load balancer that will be used to route traffic from original - // instances to replacement instances in a blue/green deployment. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s ELBInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ELBInfo) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *ELBInfo) SetName(v string) *ELBInfo { - s.Name = &v - return s -} - -// Information about a deployment error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ErrorInformation -type ErrorInformation struct { - _ struct{} `type:"structure"` - - // For information about additional error codes, see Error Codes for AWS CodeDeploy - // (http://docs.aws.amazon.com/codedeploy/latest/userguide/error-codes.html) - // in the AWS CodeDeploy User Guide (http://docs.aws.amazon.com/codedeploy/latest/userguide). - // - // The error code: - // - // * APPLICATION_MISSING: The application was missing. This error code will - // most likely be raised if the application is deleted after the deployment - // is created but before it is started. - // - // * DEPLOYMENT_GROUP_MISSING: The deployment group was missing. This error - // code will most likely be raised if the deployment group is deleted after - // the deployment is created but before it is started. - // - // * HEALTH_CONSTRAINTS: The deployment failed on too many instances to be - // successfully deployed within the instance health constraints specified. - // - // * HEALTH_CONSTRAINTS_INVALID: The revision cannot be successfully deployed - // within the instance health constraints specified. - // - // * IAM_ROLE_MISSING: The service role cannot be accessed. - // - // * IAM_ROLE_PERMISSIONS: The service role does not have the correct permissions. - // - // * INTERNAL_ERROR: There was an internal error. - // - // * NO_EC2_SUBSCRIPTION: The calling account is not subscribed to the Amazon - // EC2 service. - // - // * NO_INSTANCES: No instance were specified, or no instance can be found. - // - // * OVER_MAX_INSTANCES: The maximum number of instance was exceeded. - // - // * THROTTLED: The operation was throttled because the calling account exceeded - // the throttling limits of one or more AWS services. - // - // * TIMEOUT: The deployment has timed out. - // - // * REVISION_MISSING: The revision ID was missing. This error code will - // most likely be raised if the revision is deleted after the deployment - // is created but before it is started. - Code *string `locationName:"code" type:"string" enum:"ErrorCode"` - - // An accompanying error message. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s ErrorInformation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorInformation) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorInformation) SetCode(v string) *ErrorInformation { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorInformation) SetMessage(v string) *ErrorInformation { - s.Message = &v - return s -} - -// Information about an application revision. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GenericRevisionInfo -type GenericRevisionInfo struct { - _ struct{} `type:"structure"` - - // The deployment groups for which this is the current target revision. - DeploymentGroups []*string `locationName:"deploymentGroups" type:"list"` - - // A comment about the revision. - Description *string `locationName:"description" type:"string"` - - // When the revision was first used by AWS CodeDeploy. - FirstUsedTime *time.Time `locationName:"firstUsedTime" type:"timestamp" timestampFormat:"unix"` - - // When the revision was last used by AWS CodeDeploy. - LastUsedTime *time.Time `locationName:"lastUsedTime" type:"timestamp" timestampFormat:"unix"` - - // When the revision was registered with AWS CodeDeploy. - RegisterTime *time.Time `locationName:"registerTime" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s GenericRevisionInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenericRevisionInfo) GoString() string { - return s.String() -} - -// SetDeploymentGroups sets the DeploymentGroups field's value. -func (s *GenericRevisionInfo) SetDeploymentGroups(v []*string) *GenericRevisionInfo { - s.DeploymentGroups = v - return s -} - -// SetDescription sets the Description field's value. -func (s *GenericRevisionInfo) SetDescription(v string) *GenericRevisionInfo { - s.Description = &v - return s -} - -// SetFirstUsedTime sets the FirstUsedTime field's value. -func (s *GenericRevisionInfo) SetFirstUsedTime(v time.Time) *GenericRevisionInfo { - s.FirstUsedTime = &v - return s -} - -// SetLastUsedTime sets the LastUsedTime field's value. -func (s *GenericRevisionInfo) SetLastUsedTime(v time.Time) *GenericRevisionInfo { - s.LastUsedTime = &v - return s -} - -// SetRegisterTime sets the RegisterTime field's value. -func (s *GenericRevisionInfo) SetRegisterTime(v time.Time) *GenericRevisionInfo { - s.RegisterTime = &v - return s -} - -// Represents the input of a get application operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplicationInput -type GetApplicationInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApplicationInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *GetApplicationInput) SetApplicationName(v string) *GetApplicationInput { - s.ApplicationName = &v - return s -} - -// Represents the output of a get application operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplicationOutput -type GetApplicationOutput struct { - _ struct{} `type:"structure"` - - // Information about the application. - Application *ApplicationInfo `locationName:"application" type:"structure"` -} - -// String returns the string representation -func (s GetApplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetApplicationOutput) GoString() string { - return s.String() -} - -// SetApplication sets the Application field's value. -func (s *GetApplicationOutput) SetApplication(v *ApplicationInfo) *GetApplicationOutput { - s.Application = v - return s -} - -// Represents the input of a get application revision operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplicationRevisionInput -type GetApplicationRevisionInput struct { - _ struct{} `type:"structure"` - - // The name of the application that corresponds to the revision. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // Information about the application revision to get, including type and location. - // - // Revision is a required field - Revision *RevisionLocation `locationName:"revision" type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetApplicationRevisionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetApplicationRevisionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetApplicationRevisionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApplicationRevisionInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.Revision == nil { - invalidParams.Add(request.NewErrParamRequired("Revision")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *GetApplicationRevisionInput) SetApplicationName(v string) *GetApplicationRevisionInput { - s.ApplicationName = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *GetApplicationRevisionInput) SetRevision(v *RevisionLocation) *GetApplicationRevisionInput { - s.Revision = v - return s -} - -// Represents the output of a get application revision operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplicationRevisionOutput -type GetApplicationRevisionOutput struct { - _ struct{} `type:"structure"` - - // The name of the application that corresponds to the revision. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` - - // Additional information about the revision, including type and location. - Revision *RevisionLocation `locationName:"revision" type:"structure"` - - // General information about the revision. - RevisionInfo *GenericRevisionInfo `locationName:"revisionInfo" type:"structure"` -} - -// String returns the string representation -func (s GetApplicationRevisionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetApplicationRevisionOutput) GoString() string { - return s.String() -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *GetApplicationRevisionOutput) SetApplicationName(v string) *GetApplicationRevisionOutput { - s.ApplicationName = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *GetApplicationRevisionOutput) SetRevision(v *RevisionLocation) *GetApplicationRevisionOutput { - s.Revision = v - return s -} - -// SetRevisionInfo sets the RevisionInfo field's value. -func (s *GetApplicationRevisionOutput) SetRevisionInfo(v *GenericRevisionInfo) *GetApplicationRevisionOutput { - s.RevisionInfo = v - return s -} - -// Represents the input of a get deployment configuration operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentConfigInput -type GetDeploymentConfigInput struct { - _ struct{} `type:"structure"` - - // The name of a deployment configuration associated with the applicable IAM - // user or AWS account. - // - // DeploymentConfigName is a required field - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDeploymentConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeploymentConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeploymentConfigInput"} - if s.DeploymentConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentConfigName")) - } - if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *GetDeploymentConfigInput) SetDeploymentConfigName(v string) *GetDeploymentConfigInput { - s.DeploymentConfigName = &v - return s -} - -// Represents the output of a get deployment configuration operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentConfigOutput -type GetDeploymentConfigOutput struct { - _ struct{} `type:"structure"` - - // Information about the deployment configuration. - DeploymentConfigInfo *DeploymentConfigInfo `locationName:"deploymentConfigInfo" type:"structure"` -} - -// String returns the string representation -func (s GetDeploymentConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentConfigOutput) GoString() string { - return s.String() -} - -// SetDeploymentConfigInfo sets the DeploymentConfigInfo field's value. -func (s *GetDeploymentConfigOutput) SetDeploymentConfigInfo(v *DeploymentConfigInfo) *GetDeploymentConfigOutput { - s.DeploymentConfigInfo = v - return s -} - -// Represents the input of a get deployment group operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentGroupInput -type GetDeploymentGroupInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // The name of an existing deployment group for the specified application. - // - // DeploymentGroupName is a required field - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDeploymentGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeploymentGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeploymentGroupInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.DeploymentGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentGroupName")) - } - if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *GetDeploymentGroupInput) SetApplicationName(v string) *GetDeploymentGroupInput { - s.ApplicationName = &v - return s -} - -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *GetDeploymentGroupInput) SetDeploymentGroupName(v string) *GetDeploymentGroupInput { - s.DeploymentGroupName = &v - return s -} - -// Represents the output of a get deployment group operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentGroupOutput -type GetDeploymentGroupOutput struct { - _ struct{} `type:"structure"` - - // Information about the deployment group. - DeploymentGroupInfo *DeploymentGroupInfo `locationName:"deploymentGroupInfo" type:"structure"` -} - -// String returns the string representation -func (s GetDeploymentGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentGroupOutput) GoString() string { - return s.String() -} - -// SetDeploymentGroupInfo sets the DeploymentGroupInfo field's value. -func (s *GetDeploymentGroupOutput) SetDeploymentGroupInfo(v *DeploymentGroupInfo) *GetDeploymentGroupOutput { - s.DeploymentGroupInfo = v - return s -} - -// Represents the input of a get deployment operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentInput -type GetDeploymentInput struct { - _ struct{} `type:"structure"` - - // A deployment ID associated with the applicable IAM user or AWS account. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeploymentInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentInput) SetDeploymentId(v string) *GetDeploymentInput { - s.DeploymentId = &v - return s -} - -// Represents the input of a get deployment instance operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentInstanceInput -type GetDeploymentInstanceInput struct { - _ struct{} `type:"structure"` - - // The unique ID of a deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` - - // The unique ID of an instance in the deployment group. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDeploymentInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeploymentInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeploymentInstanceInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentInstanceInput) SetDeploymentId(v string) *GetDeploymentInstanceInput { - s.DeploymentId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetDeploymentInstanceInput) SetInstanceId(v string) *GetDeploymentInstanceInput { - s.InstanceId = &v - return s -} - -// Represents the output of a get deployment instance operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentInstanceOutput -type GetDeploymentInstanceOutput struct { - _ struct{} `type:"structure"` - - // Information about the instance. - InstanceSummary *InstanceSummary `locationName:"instanceSummary" type:"structure"` -} - -// String returns the string representation -func (s GetDeploymentInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentInstanceOutput) GoString() string { - return s.String() -} - -// SetInstanceSummary sets the InstanceSummary field's value. -func (s *GetDeploymentInstanceOutput) SetInstanceSummary(v *InstanceSummary) *GetDeploymentInstanceOutput { - s.InstanceSummary = v - return s -} - -// Represents the output of a get deployment operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentOutput -type GetDeploymentOutput struct { - _ struct{} `type:"structure"` - - // Information about the deployment. - DeploymentInfo *DeploymentInfo `locationName:"deploymentInfo" type:"structure"` -} - -// String returns the string representation -func (s GetDeploymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeploymentOutput) GoString() string { - return s.String() -} - -// SetDeploymentInfo sets the DeploymentInfo field's value. -func (s *GetDeploymentOutput) SetDeploymentInfo(v *DeploymentInfo) *GetDeploymentOutput { - s.DeploymentInfo = v - return s -} - -// Represents the input of a get on-premises instance operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetOnPremisesInstanceInput -type GetOnPremisesInstanceInput struct { - _ struct{} `type:"structure"` - - // The name of the on-premises instance about which to get information. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetOnPremisesInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOnPremisesInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOnPremisesInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOnPremisesInstanceInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *GetOnPremisesInstanceInput) SetInstanceName(v string) *GetOnPremisesInstanceInput { - s.InstanceName = &v - return s -} - -// Represents the output of a get on-premises instance operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetOnPremisesInstanceOutput -type GetOnPremisesInstanceOutput struct { - _ struct{} `type:"structure"` - - // Information about the on-premises instance. - InstanceInfo *InstanceInfo `locationName:"instanceInfo" type:"structure"` -} - -// String returns the string representation -func (s GetOnPremisesInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOnPremisesInstanceOutput) GoString() string { - return s.String() -} - -// SetInstanceInfo sets the InstanceInfo field's value. -func (s *GetOnPremisesInstanceOutput) SetInstanceInfo(v *InstanceInfo) *GetOnPremisesInstanceOutput { - s.InstanceInfo = v - return s -} - -// Information about the location of application artifacts stored in GitHub. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GitHubLocation -type GitHubLocation struct { - _ struct{} `type:"structure"` - - // The SHA1 commit ID of the GitHub commit that represents the bundled artifacts - // for the application revision. - CommitId *string `locationName:"commitId" type:"string"` - - // The GitHub account and repository pair that stores a reference to the commit - // that represents the bundled artifacts for the application revision. - // - // Specified as account/repository. - Repository *string `locationName:"repository" type:"string"` -} - -// String returns the string representation -func (s GitHubLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GitHubLocation) GoString() string { - return s.String() -} - -// SetCommitId sets the CommitId field's value. -func (s *GitHubLocation) SetCommitId(v string) *GitHubLocation { - s.CommitId = &v - return s -} - -// SetRepository sets the Repository field's value. -func (s *GitHubLocation) SetRepository(v string) *GitHubLocation { - s.Repository = &v - return s -} - -// Information about the instances that belong to the replacement environment -// in a blue/green deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GreenFleetProvisioningOption -type GreenFleetProvisioningOption struct { - _ struct{} `type:"structure"` - - // The method used to add instances to a replacement environment. - // - // * DISCOVER_EXISTING: Use instances that already exist or will be created - // manually. - // - // * COPY_AUTO_SCALING_GROUP: Use settings from a specified Auto Scaling - // group to define and create instances in a new Auto Scaling group. - Action *string `locationName:"action" type:"string" enum:"GreenFleetProvisioningAction"` -} - -// String returns the string representation -func (s GreenFleetProvisioningOption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GreenFleetProvisioningOption) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *GreenFleetProvisioningOption) SetAction(v string) *GreenFleetProvisioningOption { - s.Action = &v - return s -} - -// Information about an on-premises instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/InstanceInfo -type InstanceInfo struct { - _ struct{} `type:"structure"` - - // If the on-premises instance was deregistered, the time at which the on-premises - // instance was deregistered. - DeregisterTime *time.Time `locationName:"deregisterTime" type:"timestamp" timestampFormat:"unix"` - - // The ARN of the IAM session associated with the on-premises instance. - IamSessionArn *string `locationName:"iamSessionArn" type:"string"` - - // The IAM user ARN associated with the on-premises instance. - IamUserArn *string `locationName:"iamUserArn" type:"string"` - - // The ARN of the on-premises instance. - InstanceArn *string `locationName:"instanceArn" type:"string"` - - // The name of the on-premises instance. - InstanceName *string `locationName:"instanceName" type:"string"` - - // The time at which the on-premises instance was registered. - RegisterTime *time.Time `locationName:"registerTime" type:"timestamp" timestampFormat:"unix"` - - // The tags currently associated with the on-premises instance. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// String returns the string representation -func (s InstanceInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceInfo) GoString() string { - return s.String() -} - -// SetDeregisterTime sets the DeregisterTime field's value. -func (s *InstanceInfo) SetDeregisterTime(v time.Time) *InstanceInfo { - s.DeregisterTime = &v - return s -} - -// SetIamSessionArn sets the IamSessionArn field's value. -func (s *InstanceInfo) SetIamSessionArn(v string) *InstanceInfo { - s.IamSessionArn = &v - return s -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *InstanceInfo) SetIamUserArn(v string) *InstanceInfo { - s.IamUserArn = &v - return s -} - -// SetInstanceArn sets the InstanceArn field's value. -func (s *InstanceInfo) SetInstanceArn(v string) *InstanceInfo { - s.InstanceArn = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *InstanceInfo) SetInstanceName(v string) *InstanceInfo { - s.InstanceName = &v - return s -} - -// SetRegisterTime sets the RegisterTime field's value. -func (s *InstanceInfo) SetRegisterTime(v time.Time) *InstanceInfo { - s.RegisterTime = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *InstanceInfo) SetTags(v []*Tag) *InstanceInfo { - s.Tags = v - return s -} - -// Information about an instance in a deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/InstanceSummary -type InstanceSummary struct { - _ struct{} `type:"structure"` - - // The deployment ID. - DeploymentId *string `locationName:"deploymentId" type:"string"` - - // The instance ID. - InstanceId *string `locationName:"instanceId" type:"string"` - - // Information about which environment an instance belongs to in a blue/green - // deployment. - // - // * BLUE: The instance is part of the original environment. - // - // * GREEN: The instance is part of the replacement environment. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // A timestamp indicating when the instance information was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"unix"` - - // A list of lifecycle events for this instance. - LifecycleEvents []*LifecycleEvent `locationName:"lifecycleEvents" type:"list"` - - // The deployment status for this instance: - // - // * Pending: The deployment is pending for this instance. - // - // * In Progress: The deployment is in progress for this instance. - // - // * Succeeded: The deployment has succeeded for this instance. - // - // * Failed: The deployment has failed for this instance. - // - // * Skipped: The deployment has been skipped for this instance. - // - // * Unknown: The deployment status is unknown for this instance. - Status *string `locationName:"status" type:"string" enum:"InstanceStatus"` -} - -// String returns the string representation -func (s InstanceSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceSummary) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *InstanceSummary) SetDeploymentId(v string) *InstanceSummary { - s.DeploymentId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceSummary) SetInstanceId(v string) *InstanceSummary { - s.InstanceId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceSummary) SetInstanceType(v string) *InstanceSummary { - s.InstanceType = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *InstanceSummary) SetLastUpdatedAt(v time.Time) *InstanceSummary { - s.LastUpdatedAt = &v - return s -} - -// SetLifecycleEvents sets the LifecycleEvents field's value. -func (s *InstanceSummary) SetLifecycleEvents(v []*LifecycleEvent) *InstanceSummary { - s.LifecycleEvents = v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceSummary) SetStatus(v string) *InstanceSummary { - s.Status = &v - return s -} - -// Information about a deployment lifecycle event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/LifecycleEvent -type LifecycleEvent struct { - _ struct{} `type:"structure"` - - // Diagnostic information about the deployment lifecycle event. - Diagnostics *Diagnostics `locationName:"diagnostics" type:"structure"` - - // A timestamp indicating when the deployment lifecycle event ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix"` - - // The deployment lifecycle event name, such as ApplicationStop, BeforeInstall, - // AfterInstall, ApplicationStart, or ValidateService. - LifecycleEventName *string `locationName:"lifecycleEventName" type:"string"` - - // A timestamp indicating when the deployment lifecycle event started. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"` - - // The deployment lifecycle event status: - // - // * Pending: The deployment lifecycle event is pending. - // - // * InProgress: The deployment lifecycle event is in progress. - // - // * Succeeded: The deployment lifecycle event ran successfully. - // - // * Failed: The deployment lifecycle event has failed. - // - // * Skipped: The deployment lifecycle event has been skipped. - // - // * Unknown: The deployment lifecycle event is unknown. - Status *string `locationName:"status" type:"string" enum:"LifecycleEventStatus"` -} - -// String returns the string representation -func (s LifecycleEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleEvent) GoString() string { - return s.String() -} - -// SetDiagnostics sets the Diagnostics field's value. -func (s *LifecycleEvent) SetDiagnostics(v *Diagnostics) *LifecycleEvent { - s.Diagnostics = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *LifecycleEvent) SetEndTime(v time.Time) *LifecycleEvent { - s.EndTime = &v - return s -} - -// SetLifecycleEventName sets the LifecycleEventName field's value. -func (s *LifecycleEvent) SetLifecycleEventName(v string) *LifecycleEvent { - s.LifecycleEventName = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *LifecycleEvent) SetStartTime(v time.Time) *LifecycleEvent { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *LifecycleEvent) SetStatus(v string) *LifecycleEvent { - s.Status = &v - return s -} - -// Represents the input of a list application revisions operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplicationRevisionsInput -type ListApplicationRevisionsInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // Whether to list revisions based on whether the revision is the target revision - // of an deployment group: - // - // * include: List revisions that are target revisions of a deployment group. - // - // * exclude: Do not list revisions that are target revisions of a deployment - // group. - // - // * ignore: List all revisions. - Deployed *string `locationName:"deployed" type:"string" enum:"ListStateFilterAction"` - - // An identifier returned from the previous list application revisions call. - // It can be used to return the next set of applications in the list. - NextToken *string `locationName:"nextToken" type:"string"` - - // An Amazon S3 bucket name to limit the search for revisions. - // - // If set to null, all of the user's buckets will be searched. - S3Bucket *string `locationName:"s3Bucket" type:"string"` - - // A key prefix for the set of Amazon S3 objects to limit the search for revisions. - S3KeyPrefix *string `locationName:"s3KeyPrefix" type:"string"` - - // The column name to use to sort the list results: - // - // * registerTime: Sort by the time the revisions were registered with AWS - // CodeDeploy. - // - // * firstUsedTime: Sort by the time the revisions were first used in a deployment. - // - // * lastUsedTime: Sort by the time the revisions were last used in a deployment. - // - // If not specified or set to null, the results will be returned in an arbitrary - // order. - SortBy *string `locationName:"sortBy" type:"string" enum:"ApplicationRevisionSortBy"` - - // The order in which to sort the list results: - // - // * ascending: ascending order. - // - // * descending: descending order. - // - // If not specified, the results will be sorted in ascending order. - // - // If set to null, the results will be sorted in an arbitrary order. - SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrder"` -} - -// String returns the string representation -func (s ListApplicationRevisionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListApplicationRevisionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListApplicationRevisionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListApplicationRevisionsInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ListApplicationRevisionsInput) SetApplicationName(v string) *ListApplicationRevisionsInput { - s.ApplicationName = &v - return s -} - -// SetDeployed sets the Deployed field's value. -func (s *ListApplicationRevisionsInput) SetDeployed(v string) *ListApplicationRevisionsInput { - s.Deployed = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationRevisionsInput) SetNextToken(v string) *ListApplicationRevisionsInput { - s.NextToken = &v - return s -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *ListApplicationRevisionsInput) SetS3Bucket(v string) *ListApplicationRevisionsInput { - s.S3Bucket = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *ListApplicationRevisionsInput) SetS3KeyPrefix(v string) *ListApplicationRevisionsInput { - s.S3KeyPrefix = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListApplicationRevisionsInput) SetSortBy(v string) *ListApplicationRevisionsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListApplicationRevisionsInput) SetSortOrder(v string) *ListApplicationRevisionsInput { - s.SortOrder = &v - return s -} - -// Represents the output of a list application revisions operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplicationRevisionsOutput -type ListApplicationRevisionsOutput struct { - _ struct{} `type:"structure"` - - // If a large amount of information is returned, an identifier will also be - // returned. It can be used in a subsequent list application revisions call - // to return the next set of application revisions in the list. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of locations that contain the matching revisions. - Revisions []*RevisionLocation `locationName:"revisions" type:"list"` -} - -// String returns the string representation -func (s ListApplicationRevisionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListApplicationRevisionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationRevisionsOutput) SetNextToken(v string) *ListApplicationRevisionsOutput { - s.NextToken = &v - return s -} - -// SetRevisions sets the Revisions field's value. -func (s *ListApplicationRevisionsOutput) SetRevisions(v []*RevisionLocation) *ListApplicationRevisionsOutput { - s.Revisions = v - return s -} - -// Represents the input of a list applications operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplicationsInput -type ListApplicationsInput struct { - _ struct{} `type:"structure"` - - // An identifier returned from the previous list applications call. It can be - // used to return the next set of applications in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListApplicationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListApplicationsInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsInput) SetNextToken(v string) *ListApplicationsInput { - s.NextToken = &v - return s -} - -// Represents the output of a list applications operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplicationsOutput -type ListApplicationsOutput struct { - _ struct{} `type:"structure"` - - // A list of application names. - Applications []*string `locationName:"applications" type:"list"` - - // If a large amount of information is returned, an identifier is also returned. - // It can be used in a subsequent list applications call to return the next - // set of applications, will also be returned. in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListApplicationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListApplicationsOutput) GoString() string { - return s.String() -} - -// SetApplications sets the Applications field's value. -func (s *ListApplicationsOutput) SetApplications(v []*string) *ListApplicationsOutput { - s.Applications = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsOutput) SetNextToken(v string) *ListApplicationsOutput { - s.NextToken = &v - return s -} - -// Represents the input of a list deployment configurations operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentConfigsInput -type ListDeploymentConfigsInput struct { - _ struct{} `type:"structure"` - - // An identifier returned from the previous list deployment configurations call. - // It can be used to return the next set of deployment configurations in the - // list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListDeploymentConfigsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeploymentConfigsInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentConfigsInput) SetNextToken(v string) *ListDeploymentConfigsInput { - s.NextToken = &v - return s -} - -// Represents the output of a list deployment configurations operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentConfigsOutput -type ListDeploymentConfigsOutput struct { - _ struct{} `type:"structure"` - - // A list of deployment configurations, including built-in configurations such - // as CodeDeployDefault.OneAtATime. - DeploymentConfigsList []*string `locationName:"deploymentConfigsList" type:"list"` - - // If a large amount of information is returned, an identifier is also returned. - // It can be used in a subsequent list deployment configurations call to return - // the next set of deployment configurations in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListDeploymentConfigsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeploymentConfigsOutput) GoString() string { - return s.String() -} - -// SetDeploymentConfigsList sets the DeploymentConfigsList field's value. -func (s *ListDeploymentConfigsOutput) SetDeploymentConfigsList(v []*string) *ListDeploymentConfigsOutput { - s.DeploymentConfigsList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentConfigsOutput) SetNextToken(v string) *ListDeploymentConfigsOutput { - s.NextToken = &v - return s -} - -// Represents the input of a list deployment groups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentGroupsInput -type ListDeploymentGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // An identifier returned from the previous list deployment groups call. It - // can be used to return the next set of deployment groups in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListDeploymentGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeploymentGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeploymentGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeploymentGroupsInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ListDeploymentGroupsInput) SetApplicationName(v string) *ListDeploymentGroupsInput { - s.ApplicationName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentGroupsInput) SetNextToken(v string) *ListDeploymentGroupsInput { - s.NextToken = &v - return s -} - -// Represents the output of a list deployment groups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentGroupsOutput -type ListDeploymentGroupsOutput struct { - _ struct{} `type:"structure"` - - // The application name. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` - - // A list of corresponding deployment group names. - DeploymentGroups []*string `locationName:"deploymentGroups" type:"list"` - - // If a large amount of information is returned, an identifier is also returned. - // It can be used in a subsequent list deployment groups call to return the - // next set of deployment groups in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListDeploymentGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeploymentGroupsOutput) GoString() string { - return s.String() -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ListDeploymentGroupsOutput) SetApplicationName(v string) *ListDeploymentGroupsOutput { - s.ApplicationName = &v - return s -} - -// SetDeploymentGroups sets the DeploymentGroups field's value. -func (s *ListDeploymentGroupsOutput) SetDeploymentGroups(v []*string) *ListDeploymentGroupsOutput { - s.DeploymentGroups = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentGroupsOutput) SetNextToken(v string) *ListDeploymentGroupsOutput { - s.NextToken = &v - return s -} - -// Represents the input of a list deployment instances operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentInstancesInput -type ListDeploymentInstancesInput struct { - _ struct{} `type:"structure"` - - // The unique ID of a deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` - - // A subset of instances to list by status: - // - // * Pending: Include those instance with pending deployments. - // - // * InProgress: Include those instance where deployments are still in progress. - // - // * Succeeded: Include those instances with successful deployments. - // - // * Failed: Include those instance with failed deployments. - // - // * Skipped: Include those instance with skipped deployments. - // - // * Unknown: Include those instance with deployments in an unknown state. - InstanceStatusFilter []*string `locationName:"instanceStatusFilter" type:"list"` - - // The set of instances in a blue/green deployment, either those in the original - // environment ("BLUE") or those in the replacement environment ("GREEN"), for - // which you want to view instance information. - InstanceTypeFilter []*string `locationName:"instanceTypeFilter" type:"list"` - - // An identifier returned from the previous list deployment instances call. - // It can be used to return the next set of deployment instances in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListDeploymentInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeploymentInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeploymentInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeploymentInstancesInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *ListDeploymentInstancesInput) SetDeploymentId(v string) *ListDeploymentInstancesInput { - s.DeploymentId = &v - return s -} - -// SetInstanceStatusFilter sets the InstanceStatusFilter field's value. -func (s *ListDeploymentInstancesInput) SetInstanceStatusFilter(v []*string) *ListDeploymentInstancesInput { - s.InstanceStatusFilter = v - return s -} - -// SetInstanceTypeFilter sets the InstanceTypeFilter field's value. -func (s *ListDeploymentInstancesInput) SetInstanceTypeFilter(v []*string) *ListDeploymentInstancesInput { - s.InstanceTypeFilter = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentInstancesInput) SetNextToken(v string) *ListDeploymentInstancesInput { - s.NextToken = &v - return s -} - -// Represents the output of a list deployment instances operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentInstancesOutput -type ListDeploymentInstancesOutput struct { - _ struct{} `type:"structure"` - - // A list of instance IDs. - InstancesList []*string `locationName:"instancesList" type:"list"` - - // If a large amount of information is returned, an identifier is also returned. - // It can be used in a subsequent list deployment instances call to return the - // next set of deployment instances in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListDeploymentInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeploymentInstancesOutput) GoString() string { - return s.String() -} - -// SetInstancesList sets the InstancesList field's value. -func (s *ListDeploymentInstancesOutput) SetInstancesList(v []*string) *ListDeploymentInstancesOutput { - s.InstancesList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentInstancesOutput) SetNextToken(v string) *ListDeploymentInstancesOutput { - s.NextToken = &v - return s -} - -// Represents the input of a list deployments operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentsInput -type ListDeploymentsInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` - - // A time range (start and end) for returning a subset of the list of deployments. - CreateTimeRange *TimeRange `locationName:"createTimeRange" type:"structure"` - - // The name of an existing deployment group for the specified application. - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string"` - - // A subset of deployments to list by status: - // - // * Created: Include created deployments in the resulting list. - // - // * Queued: Include queued deployments in the resulting list. - // - // * In Progress: Include in-progress deployments in the resulting list. - // - // * Succeeded: Include successful deployments in the resulting list. - // - // * Failed: Include failed deployments in the resulting list. - // - // * Stopped: Include stopped deployments in the resulting list. - IncludeOnlyStatuses []*string `locationName:"includeOnlyStatuses" type:"list"` - - // An identifier returned from the previous list deployments call. It can be - // used to return the next set of deployments in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListDeploymentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeploymentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeploymentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeploymentsInput"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ListDeploymentsInput) SetApplicationName(v string) *ListDeploymentsInput { - s.ApplicationName = &v - return s -} - -// SetCreateTimeRange sets the CreateTimeRange field's value. -func (s *ListDeploymentsInput) SetCreateTimeRange(v *TimeRange) *ListDeploymentsInput { - s.CreateTimeRange = v - return s -} - -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *ListDeploymentsInput) SetDeploymentGroupName(v string) *ListDeploymentsInput { - s.DeploymentGroupName = &v - return s -} - -// SetIncludeOnlyStatuses sets the IncludeOnlyStatuses field's value. -func (s *ListDeploymentsInput) SetIncludeOnlyStatuses(v []*string) *ListDeploymentsInput { - s.IncludeOnlyStatuses = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentsInput) SetNextToken(v string) *ListDeploymentsInput { - s.NextToken = &v - return s -} - -// Represents the output of a list deployments operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentsOutput -type ListDeploymentsOutput struct { - _ struct{} `type:"structure"` - - // A list of deployment IDs. - Deployments []*string `locationName:"deployments" type:"list"` - - // If a large amount of information is returned, an identifier is also returned. - // It can be used in a subsequent list deployments call to return the next set - // of deployments in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListDeploymentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeploymentsOutput) GoString() string { - return s.String() -} - -// SetDeployments sets the Deployments field's value. -func (s *ListDeploymentsOutput) SetDeployments(v []*string) *ListDeploymentsOutput { - s.Deployments = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentsOutput) SetNextToken(v string) *ListDeploymentsOutput { - s.NextToken = &v - return s -} - -// Represents the input of a list on-premises instances operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListOnPremisesInstancesInput -type ListOnPremisesInstancesInput struct { - _ struct{} `type:"structure"` - - // An identifier returned from the previous list on-premises instances call. - // It can be used to return the next set of on-premises instances in the list. - NextToken *string `locationName:"nextToken" type:"string"` - - // The registration status of the on-premises instances: - // - // * Deregistered: Include deregistered on-premises instances in the resulting - // list. - // - // * Registered: Include registered on-premises instances in the resulting - // list. - RegistrationStatus *string `locationName:"registrationStatus" type:"string" enum:"RegistrationStatus"` - - // The on-premises instance tags that will be used to restrict the corresponding - // on-premises instance names returned. - TagFilters []*TagFilter `locationName:"tagFilters" type:"list"` -} - -// String returns the string representation -func (s ListOnPremisesInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListOnPremisesInstancesInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOnPremisesInstancesInput) SetNextToken(v string) *ListOnPremisesInstancesInput { - s.NextToken = &v - return s -} - -// SetRegistrationStatus sets the RegistrationStatus field's value. -func (s *ListOnPremisesInstancesInput) SetRegistrationStatus(v string) *ListOnPremisesInstancesInput { - s.RegistrationStatus = &v - return s -} - -// SetTagFilters sets the TagFilters field's value. -func (s *ListOnPremisesInstancesInput) SetTagFilters(v []*TagFilter) *ListOnPremisesInstancesInput { - s.TagFilters = v - return s -} - -// Represents the output of list on-premises instances operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListOnPremisesInstancesOutput -type ListOnPremisesInstancesOutput struct { - _ struct{} `type:"structure"` - - // The list of matching on-premises instance names. - InstanceNames []*string `locationName:"instanceNames" type:"list"` - - // If a large amount of information is returned, an identifier is also returned. - // It can be used in a subsequent list on-premises instances call to return - // the next set of on-premises instances in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListOnPremisesInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListOnPremisesInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceNames sets the InstanceNames field's value. -func (s *ListOnPremisesInstancesOutput) SetInstanceNames(v []*string) *ListOnPremisesInstancesOutput { - s.InstanceNames = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOnPremisesInstancesOutput) SetNextToken(v string) *ListOnPremisesInstancesOutput { - s.NextToken = &v - return s -} - -// Information about the load balancer used in a blue/green deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/LoadBalancerInfo -type LoadBalancerInfo struct { - _ struct{} `type:"structure"` - - // An array containing information about the load balancer in Elastic Load Balancing - // to use in a blue/green deployment. - ElbInfoList []*ELBInfo `locationName:"elbInfoList" type:"list"` -} - -// String returns the string representation -func (s LoadBalancerInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancerInfo) GoString() string { - return s.String() -} - -// SetElbInfoList sets the ElbInfoList field's value. -func (s *LoadBalancerInfo) SetElbInfoList(v []*ELBInfo) *LoadBalancerInfo { - s.ElbInfoList = v - return s -} - -// Information about minimum healthy instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/MinimumHealthyHosts -type MinimumHealthyHosts struct { - _ struct{} `type:"structure"` - - // The minimum healthy instance type: - // - // * HOST_COUNT: The minimum number of healthy instance as an absolute value. - // - // * FLEET_PERCENT: The minimum number of healthy instance as a percentage - // of the total number of instance in the deployment. - // - // In an example of nine instance, if a HOST_COUNT of six is specified, deploy - // to up to three instances at a time. The deployment will be successful if - // six or more instances are deployed to successfully; otherwise, the deployment - // fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instance - // at a time. The deployment will be successful if four or more instance are - // deployed to successfully; otherwise, the deployment fails. - // - // In a call to the get deployment configuration operation, CodeDeployDefault.OneAtATime - // will return a minimum healthy instance type of MOST_CONCURRENCY and a value - // of 1. This means a deployment to only one instance at a time. (You cannot - // set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In - // addition, with CodeDeployDefault.OneAtATime, AWS CodeDeploy will try to ensure - // that all instances but one are kept in a healthy state during the deployment. - // Although this allows one instance at a time to be taken offline for a new - // deployment, it also means that if the deployment to the last instance fails, - // the overall deployment still succeeds. - Type *string `locationName:"type" type:"string" enum:"MinimumHealthyHostsType"` - - // The minimum healthy instance value. - Value *int64 `locationName:"value" type:"integer"` -} - -// String returns the string representation -func (s MinimumHealthyHosts) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MinimumHealthyHosts) GoString() string { - return s.String() -} - -// SetType sets the Type field's value. -func (s *MinimumHealthyHosts) SetType(v string) *MinimumHealthyHosts { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *MinimumHealthyHosts) SetValue(v int64) *MinimumHealthyHosts { - s.Value = &v - return s -} - -// Represents the input of a register application revision operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterApplicationRevisionInput -type RegisterApplicationRevisionInput struct { - _ struct{} `type:"structure"` - - // The name of an AWS CodeDeploy application associated with the applicable - // IAM user or AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // A comment about the revision. - Description *string `locationName:"description" type:"string"` - - // Information about the application revision to register, including type and - // location. - // - // Revision is a required field - Revision *RevisionLocation `locationName:"revision" type:"structure" required:"true"` -} - -// String returns the string representation -func (s RegisterApplicationRevisionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterApplicationRevisionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterApplicationRevisionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterApplicationRevisionInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.Revision == nil { - invalidParams.Add(request.NewErrParamRequired("Revision")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *RegisterApplicationRevisionInput) SetApplicationName(v string) *RegisterApplicationRevisionInput { - s.ApplicationName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *RegisterApplicationRevisionInput) SetDescription(v string) *RegisterApplicationRevisionInput { - s.Description = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *RegisterApplicationRevisionInput) SetRevision(v *RevisionLocation) *RegisterApplicationRevisionInput { - s.Revision = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterApplicationRevisionOutput -type RegisterApplicationRevisionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RegisterApplicationRevisionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterApplicationRevisionOutput) GoString() string { - return s.String() -} - -// Represents the input of the register on-premises instance operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterOnPremisesInstanceInput -type RegisterOnPremisesInstanceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the IAM session to associate with the on-premises instance. - IamSessionArn *string `locationName:"iamSessionArn" type:"string"` - - // The ARN of the IAM user to associate with the on-premises instance. - IamUserArn *string `locationName:"iamUserArn" type:"string"` - - // The name of the on-premises instance to register. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterOnPremisesInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterOnPremisesInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterOnPremisesInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterOnPremisesInstanceInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIamSessionArn sets the IamSessionArn field's value. -func (s *RegisterOnPremisesInstanceInput) SetIamSessionArn(v string) *RegisterOnPremisesInstanceInput { - s.IamSessionArn = &v - return s -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *RegisterOnPremisesInstanceInput) SetIamUserArn(v string) *RegisterOnPremisesInstanceInput { - s.IamUserArn = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *RegisterOnPremisesInstanceInput) SetInstanceName(v string) *RegisterOnPremisesInstanceInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterOnPremisesInstanceOutput -type RegisterOnPremisesInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RegisterOnPremisesInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterOnPremisesInstanceOutput) GoString() string { - return s.String() -} - -// Represents the input of a remove tags from on-premises instances operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RemoveTagsFromOnPremisesInstancesInput -type RemoveTagsFromOnPremisesInstancesInput struct { - _ struct{} `type:"structure"` - - // The names of the on-premises instances from which to remove tags. - // - // InstanceNames is a required field - InstanceNames []*string `locationName:"instanceNames" type:"list" required:"true"` - - // The tag key-value pairs to remove from the on-premises instances. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromOnPremisesInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromOnPremisesInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromOnPremisesInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromOnPremisesInstancesInput"} - if s.InstanceNames == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceNames")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceNames sets the InstanceNames field's value. -func (s *RemoveTagsFromOnPremisesInstancesInput) SetInstanceNames(v []*string) *RemoveTagsFromOnPremisesInstancesInput { - s.InstanceNames = v - return s -} - -// SetTags sets the Tags field's value. -func (s *RemoveTagsFromOnPremisesInstancesInput) SetTags(v []*Tag) *RemoveTagsFromOnPremisesInstancesInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RemoveTagsFromOnPremisesInstancesOutput -type RemoveTagsFromOnPremisesInstancesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsFromOnPremisesInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromOnPremisesInstancesOutput) GoString() string { - return s.String() -} - -// Information about an application revision. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RevisionInfo -type RevisionInfo struct { - _ struct{} `type:"structure"` - - // Information about an application revision, including usage details and associated - // deployment groups. - GenericRevisionInfo *GenericRevisionInfo `locationName:"genericRevisionInfo" type:"structure"` - - // Information about the location and type of an application revision. - RevisionLocation *RevisionLocation `locationName:"revisionLocation" type:"structure"` -} - -// String returns the string representation -func (s RevisionInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevisionInfo) GoString() string { - return s.String() -} - -// SetGenericRevisionInfo sets the GenericRevisionInfo field's value. -func (s *RevisionInfo) SetGenericRevisionInfo(v *GenericRevisionInfo) *RevisionInfo { - s.GenericRevisionInfo = v - return s -} - -// SetRevisionLocation sets the RevisionLocation field's value. -func (s *RevisionInfo) SetRevisionLocation(v *RevisionLocation) *RevisionInfo { - s.RevisionLocation = v - return s -} - -// Information about the location of an application revision. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RevisionLocation -type RevisionLocation struct { - _ struct{} `type:"structure"` - - // Information about the location of application artifacts stored in GitHub. - GitHubLocation *GitHubLocation `locationName:"gitHubLocation" type:"structure"` - - // The type of application revision: - // - // * S3: An application revision stored in Amazon S3. - // - // * GitHub: An application revision stored in GitHub. - RevisionType *string `locationName:"revisionType" type:"string" enum:"RevisionLocationType"` - - // Information about the location of application artifacts stored in Amazon - // S3. - S3Location *S3Location `locationName:"s3Location" type:"structure"` -} - -// String returns the string representation -func (s RevisionLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevisionLocation) GoString() string { - return s.String() -} - -// SetGitHubLocation sets the GitHubLocation field's value. -func (s *RevisionLocation) SetGitHubLocation(v *GitHubLocation) *RevisionLocation { - s.GitHubLocation = v - return s -} - -// SetRevisionType sets the RevisionType field's value. -func (s *RevisionLocation) SetRevisionType(v string) *RevisionLocation { - s.RevisionType = &v - return s -} - -// SetS3Location sets the S3Location field's value. -func (s *RevisionLocation) SetS3Location(v *S3Location) *RevisionLocation { - s.S3Location = v - return s -} - -// Information about a deployment rollback. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RollbackInfo -type RollbackInfo struct { - _ struct{} `type:"structure"` - - // The ID of the deployment rollback. - RollbackDeploymentId *string `locationName:"rollbackDeploymentId" type:"string"` - - // Information describing the status of a deployment rollback; for example, - // whether the deployment can't be rolled back, is in progress, failed, or succeeded. - RollbackMessage *string `locationName:"rollbackMessage" type:"string"` - - // The deployment ID of the deployment that was underway and triggered a rollback - // deployment because it failed or was stopped. - RollbackTriggeringDeploymentId *string `locationName:"rollbackTriggeringDeploymentId" type:"string"` -} - -// String returns the string representation -func (s RollbackInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RollbackInfo) GoString() string { - return s.String() -} - -// SetRollbackDeploymentId sets the RollbackDeploymentId field's value. -func (s *RollbackInfo) SetRollbackDeploymentId(v string) *RollbackInfo { - s.RollbackDeploymentId = &v - return s -} - -// SetRollbackMessage sets the RollbackMessage field's value. -func (s *RollbackInfo) SetRollbackMessage(v string) *RollbackInfo { - s.RollbackMessage = &v - return s -} - -// SetRollbackTriggeringDeploymentId sets the RollbackTriggeringDeploymentId field's value. -func (s *RollbackInfo) SetRollbackTriggeringDeploymentId(v string) *RollbackInfo { - s.RollbackTriggeringDeploymentId = &v - return s -} - -// Information about the location of application artifacts stored in Amazon -// S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/S3Location -type S3Location struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket where the application revision is stored. - Bucket *string `locationName:"bucket" type:"string"` - - // The file type of the application revision. Must be one of the following: - // - // * tar: A tar archive file. - // - // * tgz: A compressed tar archive file. - // - // * zip: A zip archive file. - BundleType *string `locationName:"bundleType" type:"string" enum:"BundleType"` - - // The ETag of the Amazon S3 object that represents the bundled artifacts for - // the application revision. - // - // If the ETag is not specified as an input parameter, ETag validation of the - // object will be skipped. - ETag *string `locationName:"eTag" type:"string"` - - // The name of the Amazon S3 object that represents the bundled artifacts for - // the application revision. - Key *string `locationName:"key" type:"string"` - - // A specific version of the Amazon S3 object that represents the bundled artifacts - // for the application revision. - // - // If the version is not specified, the system will use the most recent version - // by default. - Version *string `locationName:"version" type:"string"` -} - -// String returns the string representation -func (s S3Location) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3Location) GoString() string { - return s.String() -} - -// SetBucket sets the Bucket field's value. -func (s *S3Location) SetBucket(v string) *S3Location { - s.Bucket = &v - return s -} - -// SetBundleType sets the BundleType field's value. -func (s *S3Location) SetBundleType(v string) *S3Location { - s.BundleType = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *S3Location) SetETag(v string) *S3Location { - s.ETag = &v - return s -} - -// SetKey sets the Key field's value. -func (s *S3Location) SetKey(v string) *S3Location { - s.Key = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *S3Location) SetVersion(v string) *S3Location { - s.Version = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/SkipWaitTimeForInstanceTerminationInput -type SkipWaitTimeForInstanceTerminationInput struct { - _ struct{} `type:"structure"` - - // The ID of the blue/green deployment for which you want to skip the instance - // termination wait time. - DeploymentId *string `locationName:"deploymentId" type:"string"` -} - -// String returns the string representation -func (s SkipWaitTimeForInstanceTerminationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SkipWaitTimeForInstanceTerminationInput) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *SkipWaitTimeForInstanceTerminationInput) SetDeploymentId(v string) *SkipWaitTimeForInstanceTerminationInput { - s.DeploymentId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/SkipWaitTimeForInstanceTerminationOutput -type SkipWaitTimeForInstanceTerminationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SkipWaitTimeForInstanceTerminationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SkipWaitTimeForInstanceTerminationOutput) GoString() string { - return s.String() -} - -// Represents the input of a stop deployment operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/StopDeploymentInput -type StopDeploymentInput struct { - _ struct{} `type:"structure"` - - // Indicates, when a deployment is stopped, whether instances that have been - // updated should be rolled back to the previous version of the application - // revision. - AutoRollbackEnabled *bool `locationName:"autoRollbackEnabled" type:"boolean"` - - // The unique ID of a deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopDeploymentInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoRollbackEnabled sets the AutoRollbackEnabled field's value. -func (s *StopDeploymentInput) SetAutoRollbackEnabled(v bool) *StopDeploymentInput { - s.AutoRollbackEnabled = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *StopDeploymentInput) SetDeploymentId(v string) *StopDeploymentInput { - s.DeploymentId = &v - return s -} - -// Represents the output of a stop deployment operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/StopDeploymentOutput -type StopDeploymentOutput struct { - _ struct{} `type:"structure"` - - // The status of the stop deployment operation: - // - // * Pending: The stop operation is pending. - // - // * Succeeded: The stop operation was successful. - Status *string `locationName:"status" type:"string" enum:"StopStatus"` - - // An accompanying status message. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s StopDeploymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopDeploymentOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *StopDeploymentOutput) SetStatus(v string) *StopDeploymentOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *StopDeploymentOutput) SetStatusMessage(v string) *StopDeploymentOutput { - s.StatusMessage = &v - return s -} - -// Information about a tag. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The tag's key. - Key *string `type:"string"` - - // The tag's value. - 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 -} - -// Information about an on-premises instance tag filter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/TagFilter -type TagFilter struct { - _ struct{} `type:"structure"` - - // The on-premises instance tag filter key. - Key *string `type:"string"` - - // The on-premises instance tag filter type: - // - // * KEY_ONLY: Key only. - // - // * VALUE_ONLY: Value only. - // - // * KEY_AND_VALUE: Key and value. - Type *string `type:"string" enum:"TagFilterType"` - - // The on-premises instance tag filter value. - Value *string `type:"string"` -} - -// String returns the string representation -func (s TagFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagFilter) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TagFilter) SetKey(v string) *TagFilter { - s.Key = &v - return s -} - -// SetType sets the Type field's value. -func (s *TagFilter) SetType(v string) *TagFilter { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *TagFilter) SetValue(v string) *TagFilter { - s.Value = &v - return s -} - -// Information about the instances to be used in the replacement environment -// in a blue/green deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/TargetInstances -type TargetInstances struct { - _ struct{} `type:"structure"` - - // The names of one or more Auto Scaling groups to identify a replacement environment - // for a blue/green deployment. - AutoScalingGroups []*string `locationName:"autoScalingGroups" type:"list"` - - // The tag filter key, type, and value used to identify Amazon EC2 instances - // in a replacement environment for a blue/green deployment. - TagFilters []*EC2TagFilter `locationName:"tagFilters" type:"list"` -} - -// String returns the string representation -func (s TargetInstances) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetInstances) GoString() string { - return s.String() -} - -// SetAutoScalingGroups sets the AutoScalingGroups field's value. -func (s *TargetInstances) SetAutoScalingGroups(v []*string) *TargetInstances { - s.AutoScalingGroups = v - return s -} - -// SetTagFilters sets the TagFilters field's value. -func (s *TargetInstances) SetTagFilters(v []*EC2TagFilter) *TargetInstances { - s.TagFilters = v - return s -} - -// Information about a time range. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/TimeRange -type TimeRange struct { - _ struct{} `type:"structure"` - - // The end time of the time range. - // - // Specify null to leave the end time open-ended. - End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"unix"` - - // The start time of the time range. - // - // Specify null to leave the start time open-ended. - Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s TimeRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimeRange) GoString() string { - return s.String() -} - -// SetEnd sets the End field's value. -func (s *TimeRange) SetEnd(v time.Time) *TimeRange { - s.End = &v - return s -} - -// SetStart sets the Start field's value. -func (s *TimeRange) SetStart(v time.Time) *TimeRange { - s.Start = &v - return s -} - -// Information about notification triggers for the deployment group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/TriggerConfig -type TriggerConfig struct { - _ struct{} `type:"structure"` - - // The event type or types for which notifications are triggered. - TriggerEvents []*string `locationName:"triggerEvents" type:"list"` - - // The name of the notification trigger. - TriggerName *string `locationName:"triggerName" type:"string"` - - // The ARN of the Amazon Simple Notification Service topic through which notifications - // about deployment or instance events are sent. - TriggerTargetArn *string `locationName:"triggerTargetArn" type:"string"` -} - -// String returns the string representation -func (s TriggerConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TriggerConfig) GoString() string { - return s.String() -} - -// SetTriggerEvents sets the TriggerEvents field's value. -func (s *TriggerConfig) SetTriggerEvents(v []*string) *TriggerConfig { - s.TriggerEvents = v - return s -} - -// SetTriggerName sets the TriggerName field's value. -func (s *TriggerConfig) SetTriggerName(v string) *TriggerConfig { - s.TriggerName = &v - return s -} - -// SetTriggerTargetArn sets the TriggerTargetArn field's value. -func (s *TriggerConfig) SetTriggerTargetArn(v string) *TriggerConfig { - s.TriggerTargetArn = &v - return s -} - -// Represents the input of an update application operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateApplicationInput -type UpdateApplicationInput struct { - _ struct{} `type:"structure"` - - // The current name of the application you want to change. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` - - // The new name to give the application. - NewApplicationName *string `locationName:"newApplicationName" min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationInput"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.NewApplicationName != nil && len(*s.NewApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewApplicationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *UpdateApplicationInput) SetApplicationName(v string) *UpdateApplicationInput { - s.ApplicationName = &v - return s -} - -// SetNewApplicationName sets the NewApplicationName field's value. -func (s *UpdateApplicationInput) SetNewApplicationName(v string) *UpdateApplicationInput { - s.NewApplicationName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateApplicationOutput -type UpdateApplicationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateApplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateApplicationOutput) GoString() string { - return s.String() -} - -// Represents the input of an update deployment group operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateDeploymentGroupInput -type UpdateDeploymentGroupInput struct { - _ struct{} `type:"structure"` - - // Information to add or change about Amazon CloudWatch alarms when the deployment - // group is updated. - AlarmConfiguration *AlarmConfiguration `locationName:"alarmConfiguration" type:"structure"` - - // The application name corresponding to the deployment group to update. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` - - // Information for an automatic rollback configuration that is added or changed - // when a deployment group is updated. - AutoRollbackConfiguration *AutoRollbackConfiguration `locationName:"autoRollbackConfiguration" type:"structure"` - - // The replacement list of Auto Scaling groups to be included in the deployment - // group, if you want to change them. To keep the Auto Scaling groups, enter - // their names. To remove Auto Scaling groups, do not enter any Auto Scaling - // group names. - AutoScalingGroups []*string `locationName:"autoScalingGroups" type:"list"` - - // Information about blue/green deployment options for a deployment group. - BlueGreenDeploymentConfiguration *BlueGreenDeploymentConfiguration `locationName:"blueGreenDeploymentConfiguration" type:"structure"` - - // The current name of the deployment group. - // - // CurrentDeploymentGroupName is a required field - CurrentDeploymentGroupName *string `locationName:"currentDeploymentGroupName" min:"1" type:"string" required:"true"` - - // The replacement deployment configuration name to use, if you want to change - // it. - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string"` - - // Information about the type of deployment, either standard or blue/green, - // you want to run and whether to route deployment traffic behind a load balancer. - DeploymentStyle *DeploymentStyle `locationName:"deploymentStyle" type:"structure"` - - // The replacement set of Amazon EC2 tags on which to filter, if you want to - // change them. To keep the existing tags, enter their names. To remove tags, - // do not enter any tag names. - Ec2TagFilters []*EC2TagFilter `locationName:"ec2TagFilters" type:"list"` - - // Information about the load balancer used in a blue/green deployment. - LoadBalancerInfo *LoadBalancerInfo `locationName:"loadBalancerInfo" type:"structure"` - - // The new name of the deployment group, if you want to change it. - NewDeploymentGroupName *string `locationName:"newDeploymentGroupName" min:"1" type:"string"` - - // The replacement set of on-premises instance tags on which to filter, if you - // want to change them. To keep the existing tags, enter their names. To remove - // tags, do not enter any tag names. - OnPremisesInstanceTagFilters []*TagFilter `locationName:"onPremisesInstanceTagFilters" type:"list"` - - // A replacement ARN for the service role, if you want to change it. - ServiceRoleArn *string `locationName:"serviceRoleArn" type:"string"` - - // Information about triggers to change when the deployment group is updated. - // For examples, see Modify Triggers in an AWS CodeDeploy Deployment Group (http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-notify-edit.html) - // in the AWS CodeDeploy User Guide. - TriggerConfigurations []*TriggerConfig `locationName:"triggerConfigurations" type:"list"` -} - -// String returns the string representation -func (s UpdateDeploymentGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDeploymentGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDeploymentGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDeploymentGroupInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.CurrentDeploymentGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CurrentDeploymentGroupName")) - } - if s.CurrentDeploymentGroupName != nil && len(*s.CurrentDeploymentGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CurrentDeploymentGroupName", 1)) - } - if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1)) - } - if s.NewDeploymentGroupName != nil && len(*s.NewDeploymentGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewDeploymentGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmConfiguration sets the AlarmConfiguration field's value. -func (s *UpdateDeploymentGroupInput) SetAlarmConfiguration(v *AlarmConfiguration) *UpdateDeploymentGroupInput { - s.AlarmConfiguration = v - return s -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *UpdateDeploymentGroupInput) SetApplicationName(v string) *UpdateDeploymentGroupInput { - s.ApplicationName = &v - return s -} - -// SetAutoRollbackConfiguration sets the AutoRollbackConfiguration field's value. -func (s *UpdateDeploymentGroupInput) SetAutoRollbackConfiguration(v *AutoRollbackConfiguration) *UpdateDeploymentGroupInput { - s.AutoRollbackConfiguration = v - return s -} - -// SetAutoScalingGroups sets the AutoScalingGroups field's value. -func (s *UpdateDeploymentGroupInput) SetAutoScalingGroups(v []*string) *UpdateDeploymentGroupInput { - s.AutoScalingGroups = v - return s -} - -// SetBlueGreenDeploymentConfiguration sets the BlueGreenDeploymentConfiguration field's value. -func (s *UpdateDeploymentGroupInput) SetBlueGreenDeploymentConfiguration(v *BlueGreenDeploymentConfiguration) *UpdateDeploymentGroupInput { - s.BlueGreenDeploymentConfiguration = v - return s -} - -// SetCurrentDeploymentGroupName sets the CurrentDeploymentGroupName field's value. -func (s *UpdateDeploymentGroupInput) SetCurrentDeploymentGroupName(v string) *UpdateDeploymentGroupInput { - s.CurrentDeploymentGroupName = &v - return s -} - -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *UpdateDeploymentGroupInput) SetDeploymentConfigName(v string) *UpdateDeploymentGroupInput { - s.DeploymentConfigName = &v - return s -} - -// SetDeploymentStyle sets the DeploymentStyle field's value. -func (s *UpdateDeploymentGroupInput) SetDeploymentStyle(v *DeploymentStyle) *UpdateDeploymentGroupInput { - s.DeploymentStyle = v - return s -} - -// SetEc2TagFilters sets the Ec2TagFilters field's value. -func (s *UpdateDeploymentGroupInput) SetEc2TagFilters(v []*EC2TagFilter) *UpdateDeploymentGroupInput { - s.Ec2TagFilters = v - return s -} - -// SetLoadBalancerInfo sets the LoadBalancerInfo field's value. -func (s *UpdateDeploymentGroupInput) SetLoadBalancerInfo(v *LoadBalancerInfo) *UpdateDeploymentGroupInput { - s.LoadBalancerInfo = v - return s -} - -// SetNewDeploymentGroupName sets the NewDeploymentGroupName field's value. -func (s *UpdateDeploymentGroupInput) SetNewDeploymentGroupName(v string) *UpdateDeploymentGroupInput { - s.NewDeploymentGroupName = &v - return s -} - -// SetOnPremisesInstanceTagFilters sets the OnPremisesInstanceTagFilters field's value. -func (s *UpdateDeploymentGroupInput) SetOnPremisesInstanceTagFilters(v []*TagFilter) *UpdateDeploymentGroupInput { - s.OnPremisesInstanceTagFilters = v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *UpdateDeploymentGroupInput) SetServiceRoleArn(v string) *UpdateDeploymentGroupInput { - s.ServiceRoleArn = &v - return s -} - -// SetTriggerConfigurations sets the TriggerConfigurations field's value. -func (s *UpdateDeploymentGroupInput) SetTriggerConfigurations(v []*TriggerConfig) *UpdateDeploymentGroupInput { - s.TriggerConfigurations = v - return s -} - -// Represents the output of an update deployment group operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateDeploymentGroupOutput -type UpdateDeploymentGroupOutput struct { - _ struct{} `type:"structure"` - - // If the output contains no data, and the corresponding deployment group contained - // at least one Auto Scaling group, AWS CodeDeploy successfully removed all - // corresponding Auto Scaling lifecycle event hooks from the AWS account. If - // the output contains data, AWS CodeDeploy could not remove some Auto Scaling - // lifecycle event hooks from the AWS account. - HooksNotCleanedUp []*AutoScalingGroup `locationName:"hooksNotCleanedUp" type:"list"` -} - -// String returns the string representation -func (s UpdateDeploymentGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDeploymentGroupOutput) GoString() string { - return s.String() -} - -// SetHooksNotCleanedUp sets the HooksNotCleanedUp field's value. -func (s *UpdateDeploymentGroupOutput) SetHooksNotCleanedUp(v []*AutoScalingGroup) *UpdateDeploymentGroupOutput { - s.HooksNotCleanedUp = v - return s -} - -const ( - // ApplicationRevisionSortByRegisterTime is a ApplicationRevisionSortBy enum value - ApplicationRevisionSortByRegisterTime = "registerTime" - - // ApplicationRevisionSortByFirstUsedTime is a ApplicationRevisionSortBy enum value - ApplicationRevisionSortByFirstUsedTime = "firstUsedTime" - - // ApplicationRevisionSortByLastUsedTime is a ApplicationRevisionSortBy enum value - ApplicationRevisionSortByLastUsedTime = "lastUsedTime" -) - -const ( - // AutoRollbackEventDeploymentFailure is a AutoRollbackEvent enum value - AutoRollbackEventDeploymentFailure = "DEPLOYMENT_FAILURE" - - // AutoRollbackEventDeploymentStopOnAlarm is a AutoRollbackEvent enum value - AutoRollbackEventDeploymentStopOnAlarm = "DEPLOYMENT_STOP_ON_ALARM" - - // AutoRollbackEventDeploymentStopOnRequest is a AutoRollbackEvent enum value - AutoRollbackEventDeploymentStopOnRequest = "DEPLOYMENT_STOP_ON_REQUEST" -) - -const ( - // BundleTypeTar is a BundleType enum value - BundleTypeTar = "tar" - - // BundleTypeTgz is a BundleType enum value - BundleTypeTgz = "tgz" - - // BundleTypeZip is a BundleType enum value - BundleTypeZip = "zip" -) - -const ( - // DeploymentCreatorUser is a DeploymentCreator enum value - DeploymentCreatorUser = "user" - - // DeploymentCreatorAutoscaling is a DeploymentCreator enum value - DeploymentCreatorAutoscaling = "autoscaling" - - // DeploymentCreatorCodeDeployRollback is a DeploymentCreator enum value - DeploymentCreatorCodeDeployRollback = "codeDeployRollback" -) - -const ( - // DeploymentOptionWithTrafficControl is a DeploymentOption enum value - DeploymentOptionWithTrafficControl = "WITH_TRAFFIC_CONTROL" - - // DeploymentOptionWithoutTrafficControl is a DeploymentOption enum value - DeploymentOptionWithoutTrafficControl = "WITHOUT_TRAFFIC_CONTROL" -) - -const ( - // DeploymentReadyActionContinueDeployment is a DeploymentReadyAction enum value - DeploymentReadyActionContinueDeployment = "CONTINUE_DEPLOYMENT" - - // DeploymentReadyActionStopDeployment is a DeploymentReadyAction enum value - DeploymentReadyActionStopDeployment = "STOP_DEPLOYMENT" -) - -const ( - // DeploymentStatusCreated is a DeploymentStatus enum value - DeploymentStatusCreated = "Created" - - // DeploymentStatusQueued is a DeploymentStatus enum value - DeploymentStatusQueued = "Queued" - - // DeploymentStatusInProgress is a DeploymentStatus enum value - DeploymentStatusInProgress = "InProgress" - - // DeploymentStatusSucceeded is a DeploymentStatus enum value - DeploymentStatusSucceeded = "Succeeded" - - // DeploymentStatusFailed is a DeploymentStatus enum value - DeploymentStatusFailed = "Failed" - - // DeploymentStatusStopped is a DeploymentStatus enum value - DeploymentStatusStopped = "Stopped" - - // DeploymentStatusReady is a DeploymentStatus enum value - DeploymentStatusReady = "Ready" -) - -const ( - // DeploymentTypeInPlace is a DeploymentType enum value - DeploymentTypeInPlace = "IN_PLACE" - - // DeploymentTypeBlueGreen is a DeploymentType enum value - DeploymentTypeBlueGreen = "BLUE_GREEN" -) - -const ( - // EC2TagFilterTypeKeyOnly is a EC2TagFilterType enum value - EC2TagFilterTypeKeyOnly = "KEY_ONLY" - - // EC2TagFilterTypeValueOnly is a EC2TagFilterType enum value - EC2TagFilterTypeValueOnly = "VALUE_ONLY" - - // EC2TagFilterTypeKeyAndValue is a EC2TagFilterType enum value - EC2TagFilterTypeKeyAndValue = "KEY_AND_VALUE" -) - -const ( - // ErrorCodeDeploymentGroupMissing is a ErrorCode enum value - ErrorCodeDeploymentGroupMissing = "DEPLOYMENT_GROUP_MISSING" - - // ErrorCodeApplicationMissing is a ErrorCode enum value - ErrorCodeApplicationMissing = "APPLICATION_MISSING" - - // ErrorCodeRevisionMissing is a ErrorCode enum value - ErrorCodeRevisionMissing = "REVISION_MISSING" - - // ErrorCodeIamRoleMissing is a ErrorCode enum value - ErrorCodeIamRoleMissing = "IAM_ROLE_MISSING" - - // ErrorCodeIamRolePermissions is a ErrorCode enum value - ErrorCodeIamRolePermissions = "IAM_ROLE_PERMISSIONS" - - // ErrorCodeNoEc2Subscription is a ErrorCode enum value - ErrorCodeNoEc2Subscription = "NO_EC2_SUBSCRIPTION" - - // ErrorCodeOverMaxInstances is a ErrorCode enum value - ErrorCodeOverMaxInstances = "OVER_MAX_INSTANCES" - - // ErrorCodeNoInstances is a ErrorCode enum value - ErrorCodeNoInstances = "NO_INSTANCES" - - // ErrorCodeTimeout is a ErrorCode enum value - ErrorCodeTimeout = "TIMEOUT" - - // ErrorCodeHealthConstraintsInvalid is a ErrorCode enum value - ErrorCodeHealthConstraintsInvalid = "HEALTH_CONSTRAINTS_INVALID" - - // ErrorCodeHealthConstraints is a ErrorCode enum value - ErrorCodeHealthConstraints = "HEALTH_CONSTRAINTS" - - // ErrorCodeInternalError is a ErrorCode enum value - ErrorCodeInternalError = "INTERNAL_ERROR" - - // ErrorCodeThrottled is a ErrorCode enum value - ErrorCodeThrottled = "THROTTLED" - - // ErrorCodeAlarmActive is a ErrorCode enum value - ErrorCodeAlarmActive = "ALARM_ACTIVE" - - // ErrorCodeAgentIssue is a ErrorCode enum value - ErrorCodeAgentIssue = "AGENT_ISSUE" - - // ErrorCodeAutoScalingIamRolePermissions is a ErrorCode enum value - ErrorCodeAutoScalingIamRolePermissions = "AUTO_SCALING_IAM_ROLE_PERMISSIONS" - - // ErrorCodeAutoScalingConfiguration is a ErrorCode enum value - ErrorCodeAutoScalingConfiguration = "AUTO_SCALING_CONFIGURATION" - - // ErrorCodeManualStop is a ErrorCode enum value - ErrorCodeManualStop = "MANUAL_STOP" -) - -const ( - // GreenFleetProvisioningActionDiscoverExisting is a GreenFleetProvisioningAction enum value - GreenFleetProvisioningActionDiscoverExisting = "DISCOVER_EXISTING" - - // GreenFleetProvisioningActionCopyAutoScalingGroup is a GreenFleetProvisioningAction enum value - GreenFleetProvisioningActionCopyAutoScalingGroup = "COPY_AUTO_SCALING_GROUP" -) - -const ( - // InstanceActionTerminate is a InstanceAction enum value - InstanceActionTerminate = "TERMINATE" - - // InstanceActionKeepAlive is a InstanceAction enum value - InstanceActionKeepAlive = "KEEP_ALIVE" -) - -const ( - // InstanceStatusPending is a InstanceStatus enum value - InstanceStatusPending = "Pending" - - // InstanceStatusInProgress is a InstanceStatus enum value - InstanceStatusInProgress = "InProgress" - - // InstanceStatusSucceeded is a InstanceStatus enum value - InstanceStatusSucceeded = "Succeeded" - - // InstanceStatusFailed is a InstanceStatus enum value - InstanceStatusFailed = "Failed" - - // InstanceStatusSkipped is a InstanceStatus enum value - InstanceStatusSkipped = "Skipped" - - // InstanceStatusUnknown is a InstanceStatus enum value - InstanceStatusUnknown = "Unknown" - - // InstanceStatusReady is a InstanceStatus enum value - InstanceStatusReady = "Ready" -) - -const ( - // InstanceTypeBlue is a InstanceType enum value - InstanceTypeBlue = "Blue" - - // InstanceTypeGreen is a InstanceType enum value - InstanceTypeGreen = "Green" -) - -const ( - // LifecycleErrorCodeSuccess is a LifecycleErrorCode enum value - LifecycleErrorCodeSuccess = "Success" - - // LifecycleErrorCodeScriptMissing is a LifecycleErrorCode enum value - LifecycleErrorCodeScriptMissing = "ScriptMissing" - - // LifecycleErrorCodeScriptNotExecutable is a LifecycleErrorCode enum value - LifecycleErrorCodeScriptNotExecutable = "ScriptNotExecutable" - - // LifecycleErrorCodeScriptTimedOut is a LifecycleErrorCode enum value - LifecycleErrorCodeScriptTimedOut = "ScriptTimedOut" - - // LifecycleErrorCodeScriptFailed is a LifecycleErrorCode enum value - LifecycleErrorCodeScriptFailed = "ScriptFailed" - - // LifecycleErrorCodeUnknownError is a LifecycleErrorCode enum value - LifecycleErrorCodeUnknownError = "UnknownError" -) - -const ( - // LifecycleEventStatusPending is a LifecycleEventStatus enum value - LifecycleEventStatusPending = "Pending" - - // LifecycleEventStatusInProgress is a LifecycleEventStatus enum value - LifecycleEventStatusInProgress = "InProgress" - - // LifecycleEventStatusSucceeded is a LifecycleEventStatus enum value - LifecycleEventStatusSucceeded = "Succeeded" - - // LifecycleEventStatusFailed is a LifecycleEventStatus enum value - LifecycleEventStatusFailed = "Failed" - - // LifecycleEventStatusSkipped is a LifecycleEventStatus enum value - LifecycleEventStatusSkipped = "Skipped" - - // LifecycleEventStatusUnknown is a LifecycleEventStatus enum value - LifecycleEventStatusUnknown = "Unknown" -) - -const ( - // ListStateFilterActionInclude is a ListStateFilterAction enum value - ListStateFilterActionInclude = "include" - - // ListStateFilterActionExclude is a ListStateFilterAction enum value - ListStateFilterActionExclude = "exclude" - - // ListStateFilterActionIgnore is a ListStateFilterAction enum value - ListStateFilterActionIgnore = "ignore" -) - -const ( - // MinimumHealthyHostsTypeHostCount is a MinimumHealthyHostsType enum value - MinimumHealthyHostsTypeHostCount = "HOST_COUNT" - - // MinimumHealthyHostsTypeFleetPercent is a MinimumHealthyHostsType enum value - MinimumHealthyHostsTypeFleetPercent = "FLEET_PERCENT" -) - -const ( - // RegistrationStatusRegistered is a RegistrationStatus enum value - RegistrationStatusRegistered = "Registered" - - // RegistrationStatusDeregistered is a RegistrationStatus enum value - RegistrationStatusDeregistered = "Deregistered" -) - -const ( - // RevisionLocationTypeS3 is a RevisionLocationType enum value - RevisionLocationTypeS3 = "S3" - - // RevisionLocationTypeGitHub is a RevisionLocationType enum value - RevisionLocationTypeGitHub = "GitHub" -) - -const ( - // SortOrderAscending is a SortOrder enum value - SortOrderAscending = "ascending" - - // SortOrderDescending is a SortOrder enum value - SortOrderDescending = "descending" -) - -const ( - // StopStatusPending is a StopStatus enum value - StopStatusPending = "Pending" - - // StopStatusSucceeded is a StopStatus enum value - StopStatusSucceeded = "Succeeded" -) - -const ( - // TagFilterTypeKeyOnly is a TagFilterType enum value - TagFilterTypeKeyOnly = "KEY_ONLY" - - // TagFilterTypeValueOnly is a TagFilterType enum value - TagFilterTypeValueOnly = "VALUE_ONLY" - - // TagFilterTypeKeyAndValue is a TagFilterType enum value - TagFilterTypeKeyAndValue = "KEY_AND_VALUE" -) - -const ( - // TriggerEventTypeDeploymentStart is a TriggerEventType enum value - TriggerEventTypeDeploymentStart = "DeploymentStart" - - // TriggerEventTypeDeploymentSuccess is a TriggerEventType enum value - TriggerEventTypeDeploymentSuccess = "DeploymentSuccess" - - // TriggerEventTypeDeploymentFailure is a TriggerEventType enum value - TriggerEventTypeDeploymentFailure = "DeploymentFailure" - - // TriggerEventTypeDeploymentStop is a TriggerEventType enum value - TriggerEventTypeDeploymentStop = "DeploymentStop" - - // TriggerEventTypeDeploymentRollback is a TriggerEventType enum value - TriggerEventTypeDeploymentRollback = "DeploymentRollback" - - // TriggerEventTypeDeploymentReady is a TriggerEventType enum value - TriggerEventTypeDeploymentReady = "DeploymentReady" - - // TriggerEventTypeInstanceStart is a TriggerEventType enum value - TriggerEventTypeInstanceStart = "InstanceStart" - - // TriggerEventTypeInstanceSuccess is a TriggerEventType enum value - TriggerEventTypeInstanceSuccess = "InstanceSuccess" - - // TriggerEventTypeInstanceFailure is a TriggerEventType enum value - TriggerEventTypeInstanceFailure = "InstanceFailure" - - // TriggerEventTypeInstanceReady is a TriggerEventType enum value - TriggerEventTypeInstanceReady = "InstanceReady" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go deleted file mode 100644 index 6eebf73..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go +++ /dev/null @@ -1,495 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codedeploy - -const ( - - // ErrCodeAlarmsLimitExceededException for service response error code - // "AlarmsLimitExceededException". - // - // The maximum number of alarms for a deployment group (10) was exceeded. - ErrCodeAlarmsLimitExceededException = "AlarmsLimitExceededException" - - // ErrCodeApplicationAlreadyExistsException for service response error code - // "ApplicationAlreadyExistsException". - // - // An application with the specified name already exists with the applicable - // IAM user or AWS account. - ErrCodeApplicationAlreadyExistsException = "ApplicationAlreadyExistsException" - - // ErrCodeApplicationDoesNotExistException for service response error code - // "ApplicationDoesNotExistException". - // - // The application does not exist with the applicable IAM user or AWS account. - ErrCodeApplicationDoesNotExistException = "ApplicationDoesNotExistException" - - // ErrCodeApplicationLimitExceededException for service response error code - // "ApplicationLimitExceededException". - // - // More applications were attempted to be created than are allowed. - ErrCodeApplicationLimitExceededException = "ApplicationLimitExceededException" - - // ErrCodeApplicationNameRequiredException for service response error code - // "ApplicationNameRequiredException". - // - // The minimum number of required application names was not specified. - ErrCodeApplicationNameRequiredException = "ApplicationNameRequiredException" - - // ErrCodeBatchLimitExceededException for service response error code - // "BatchLimitExceededException". - // - // The maximum number of names or IDs allowed for this request (100) was exceeded. - ErrCodeBatchLimitExceededException = "BatchLimitExceededException" - - // ErrCodeBucketNameFilterRequiredException for service response error code - // "BucketNameFilterRequiredException". - // - // A bucket name is required, but was not provided. - ErrCodeBucketNameFilterRequiredException = "BucketNameFilterRequiredException" - - // ErrCodeDeploymentAlreadyCompletedException for service response error code - // "DeploymentAlreadyCompletedException". - // - // The deployment is already complete. - ErrCodeDeploymentAlreadyCompletedException = "DeploymentAlreadyCompletedException" - - // ErrCodeDeploymentConfigAlreadyExistsException for service response error code - // "DeploymentConfigAlreadyExistsException". - // - // A deployment configuration with the specified name already exists with the - // applicable IAM user or AWS account. - ErrCodeDeploymentConfigAlreadyExistsException = "DeploymentConfigAlreadyExistsException" - - // ErrCodeDeploymentConfigDoesNotExistException for service response error code - // "DeploymentConfigDoesNotExistException". - // - // The deployment configuration does not exist with the applicable IAM user - // or AWS account. - ErrCodeDeploymentConfigDoesNotExistException = "DeploymentConfigDoesNotExistException" - - // ErrCodeDeploymentConfigInUseException for service response error code - // "DeploymentConfigInUseException". - // - // The deployment configuration is still in use. - ErrCodeDeploymentConfigInUseException = "DeploymentConfigInUseException" - - // ErrCodeDeploymentConfigLimitExceededException for service response error code - // "DeploymentConfigLimitExceededException". - // - // The deployment configurations limit was exceeded. - ErrCodeDeploymentConfigLimitExceededException = "DeploymentConfigLimitExceededException" - - // ErrCodeDeploymentConfigNameRequiredException for service response error code - // "DeploymentConfigNameRequiredException". - // - // The deployment configuration name was not specified. - ErrCodeDeploymentConfigNameRequiredException = "DeploymentConfigNameRequiredException" - - // ErrCodeDeploymentDoesNotExistException for service response error code - // "DeploymentDoesNotExistException". - // - // The deployment does not exist with the applicable IAM user or AWS account. - ErrCodeDeploymentDoesNotExistException = "DeploymentDoesNotExistException" - - // ErrCodeDeploymentGroupAlreadyExistsException for service response error code - // "DeploymentGroupAlreadyExistsException". - // - // A deployment group with the specified name already exists with the applicable - // IAM user or AWS account. - ErrCodeDeploymentGroupAlreadyExistsException = "DeploymentGroupAlreadyExistsException" - - // ErrCodeDeploymentGroupDoesNotExistException for service response error code - // "DeploymentGroupDoesNotExistException". - // - // The named deployment group does not exist with the applicable IAM user or - // AWS account. - ErrCodeDeploymentGroupDoesNotExistException = "DeploymentGroupDoesNotExistException" - - // ErrCodeDeploymentGroupLimitExceededException for service response error code - // "DeploymentGroupLimitExceededException". - // - // The deployment groups limit was exceeded. - ErrCodeDeploymentGroupLimitExceededException = "DeploymentGroupLimitExceededException" - - // ErrCodeDeploymentGroupNameRequiredException for service response error code - // "DeploymentGroupNameRequiredException". - // - // The deployment group name was not specified. - ErrCodeDeploymentGroupNameRequiredException = "DeploymentGroupNameRequiredException" - - // ErrCodeDeploymentIdRequiredException for service response error code - // "DeploymentIdRequiredException". - // - // At least one deployment ID must be specified. - ErrCodeDeploymentIdRequiredException = "DeploymentIdRequiredException" - - // ErrCodeDeploymentIsNotInReadyStateException for service response error code - // "DeploymentIsNotInReadyStateException". - // - // The deployment does not have a status of Ready and can't continue yet. - ErrCodeDeploymentIsNotInReadyStateException = "DeploymentIsNotInReadyStateException" - - // ErrCodeDeploymentLimitExceededException for service response error code - // "DeploymentLimitExceededException". - // - // The number of allowed deployments was exceeded. - ErrCodeDeploymentLimitExceededException = "DeploymentLimitExceededException" - - // ErrCodeDeploymentNotStartedException for service response error code - // "DeploymentNotStartedException". - // - // The specified deployment has not started. - ErrCodeDeploymentNotStartedException = "DeploymentNotStartedException" - - // ErrCodeDescriptionTooLongException for service response error code - // "DescriptionTooLongException". - // - // The description is too long. - ErrCodeDescriptionTooLongException = "DescriptionTooLongException" - - // ErrCodeIamArnRequiredException for service response error code - // "IamArnRequiredException". - // - // No IAM ARN was included in the request. You must use an IAM session ARN or - // IAM user ARN in the request. - ErrCodeIamArnRequiredException = "IamArnRequiredException" - - // ErrCodeIamSessionArnAlreadyRegisteredException for service response error code - // "IamSessionArnAlreadyRegisteredException". - // - // The request included an IAM session ARN that has already been used to register - // a different instance. - ErrCodeIamSessionArnAlreadyRegisteredException = "IamSessionArnAlreadyRegisteredException" - - // ErrCodeIamUserArnAlreadyRegisteredException for service response error code - // "IamUserArnAlreadyRegisteredException". - // - // The specified IAM user ARN is already registered with an on-premises instance. - ErrCodeIamUserArnAlreadyRegisteredException = "IamUserArnAlreadyRegisteredException" - - // ErrCodeIamUserArnRequiredException for service response error code - // "IamUserArnRequiredException". - // - // An IAM user ARN was not specified. - ErrCodeIamUserArnRequiredException = "IamUserArnRequiredException" - - // ErrCodeInstanceDoesNotExistException for service response error code - // "InstanceDoesNotExistException". - // - // The specified instance does not exist in the deployment group. - ErrCodeInstanceDoesNotExistException = "InstanceDoesNotExistException" - - // ErrCodeInstanceIdRequiredException for service response error code - // "InstanceIdRequiredException". - // - // The instance ID was not specified. - ErrCodeInstanceIdRequiredException = "InstanceIdRequiredException" - - // ErrCodeInstanceLimitExceededException for service response error code - // "InstanceLimitExceededException". - // - // The maximum number of allowed on-premises instances in a single call was - // exceeded. - ErrCodeInstanceLimitExceededException = "InstanceLimitExceededException" - - // ErrCodeInstanceNameAlreadyRegisteredException for service response error code - // "InstanceNameAlreadyRegisteredException". - // - // The specified on-premises instance name is already registered. - ErrCodeInstanceNameAlreadyRegisteredException = "InstanceNameAlreadyRegisteredException" - - // ErrCodeInstanceNameRequiredException for service response error code - // "InstanceNameRequiredException". - // - // An on-premises instance name was not specified. - ErrCodeInstanceNameRequiredException = "InstanceNameRequiredException" - - // ErrCodeInstanceNotRegisteredException for service response error code - // "InstanceNotRegisteredException". - // - // The specified on-premises instance is not registered. - ErrCodeInstanceNotRegisteredException = "InstanceNotRegisteredException" - - // ErrCodeInvalidAlarmConfigException for service response error code - // "InvalidAlarmConfigException". - // - // The format of the alarm configuration is invalid. Possible causes include: - // - // * The alarm list is null. - // - // * The alarm object is null. - // - // * The alarm name is empty or null or exceeds the 255 character limit. - // - // * Two alarms with the same name have been specified. - // - // * The alarm configuration is enabled but the alarm list is empty. - ErrCodeInvalidAlarmConfigException = "InvalidAlarmConfigException" - - // ErrCodeInvalidApplicationNameException for service response error code - // "InvalidApplicationNameException". - // - // The application name was specified in an invalid format. - ErrCodeInvalidApplicationNameException = "InvalidApplicationNameException" - - // ErrCodeInvalidAutoRollbackConfigException for service response error code - // "InvalidAutoRollbackConfigException". - // - // The automatic rollback configuration was specified in an invalid format. - // For example, automatic rollback is enabled but an invalid triggering event - // type or no event types were listed. - ErrCodeInvalidAutoRollbackConfigException = "InvalidAutoRollbackConfigException" - - // ErrCodeInvalidAutoScalingGroupException for service response error code - // "InvalidAutoScalingGroupException". - // - // The Auto Scaling group was specified in an invalid format or does not exist. - ErrCodeInvalidAutoScalingGroupException = "InvalidAutoScalingGroupException" - - // ErrCodeInvalidBlueGreenDeploymentConfigurationException for service response error code - // "InvalidBlueGreenDeploymentConfigurationException". - // - // The configuration for the blue/green deployment group was provided in an - // invalid format. For information about deployment configuration format, see - // CreateDeploymentConfig. - ErrCodeInvalidBlueGreenDeploymentConfigurationException = "InvalidBlueGreenDeploymentConfigurationException" - - // ErrCodeInvalidBucketNameFilterException for service response error code - // "InvalidBucketNameFilterException". - // - // The bucket name either doesn't exist or was specified in an invalid format. - ErrCodeInvalidBucketNameFilterException = "InvalidBucketNameFilterException" - - // ErrCodeInvalidDeployedStateFilterException for service response error code - // "InvalidDeployedStateFilterException". - // - // The deployed state filter was specified in an invalid format. - ErrCodeInvalidDeployedStateFilterException = "InvalidDeployedStateFilterException" - - // ErrCodeInvalidDeploymentConfigNameException for service response error code - // "InvalidDeploymentConfigNameException". - // - // The deployment configuration name was specified in an invalid format. - ErrCodeInvalidDeploymentConfigNameException = "InvalidDeploymentConfigNameException" - - // ErrCodeInvalidDeploymentGroupNameException for service response error code - // "InvalidDeploymentGroupNameException". - // - // The deployment group name was specified in an invalid format. - ErrCodeInvalidDeploymentGroupNameException = "InvalidDeploymentGroupNameException" - - // ErrCodeInvalidDeploymentIdException for service response error code - // "InvalidDeploymentIdException". - // - // At least one of the deployment IDs was specified in an invalid format. - ErrCodeInvalidDeploymentIdException = "InvalidDeploymentIdException" - - // ErrCodeInvalidDeploymentStatusException for service response error code - // "InvalidDeploymentStatusException". - // - // The specified deployment status doesn't exist or cannot be determined. - ErrCodeInvalidDeploymentStatusException = "InvalidDeploymentStatusException" - - // ErrCodeInvalidDeploymentStyleException for service response error code - // "InvalidDeploymentStyleException". - // - // An invalid deployment style was specified. Valid deployment types include - // "IN_PLACE" and "BLUE_GREEN". Valid deployment options for blue/green deployments - // include "WITH_TRAFFIC_CONTROL" and "WITHOUT_TRAFFIC_CONTROL". - ErrCodeInvalidDeploymentStyleException = "InvalidDeploymentStyleException" - - // ErrCodeInvalidEC2TagException for service response error code - // "InvalidEC2TagException". - // - // The tag was specified in an invalid format. - ErrCodeInvalidEC2TagException = "InvalidEC2TagException" - - // ErrCodeInvalidIamSessionArnException for service response error code - // "InvalidIamSessionArnException". - // - // The IAM session ARN was specified in an invalid format. - ErrCodeInvalidIamSessionArnException = "InvalidIamSessionArnException" - - // ErrCodeInvalidIamUserArnException for service response error code - // "InvalidIamUserArnException". - // - // The IAM user ARN was specified in an invalid format. - ErrCodeInvalidIamUserArnException = "InvalidIamUserArnException" - - // ErrCodeInvalidInstanceNameException for service response error code - // "InvalidInstanceNameException". - // - // The specified on-premises instance name was specified in an invalid format. - ErrCodeInvalidInstanceNameException = "InvalidInstanceNameException" - - // ErrCodeInvalidInstanceStatusException for service response error code - // "InvalidInstanceStatusException". - // - // The specified instance status does not exist. - ErrCodeInvalidInstanceStatusException = "InvalidInstanceStatusException" - - // ErrCodeInvalidInstanceTypeException for service response error code - // "InvalidInstanceTypeException". - // - // An invalid instance type was specified for instances in a blue/green deployment. - // Valid values include "Blue" for an original environment and "Green" for a - // replacement environment. - ErrCodeInvalidInstanceTypeException = "InvalidInstanceTypeException" - - // ErrCodeInvalidKeyPrefixFilterException for service response error code - // "InvalidKeyPrefixFilterException". - // - // The specified key prefix filter was specified in an invalid format. - ErrCodeInvalidKeyPrefixFilterException = "InvalidKeyPrefixFilterException" - - // ErrCodeInvalidLoadBalancerInfoException for service response error code - // "InvalidLoadBalancerInfoException". - // - // An invalid load balancer name, or no load balancer name, was specified. - ErrCodeInvalidLoadBalancerInfoException = "InvalidLoadBalancerInfoException" - - // ErrCodeInvalidMinimumHealthyHostValueException for service response error code - // "InvalidMinimumHealthyHostValueException". - // - // The minimum healthy instance value was specified in an invalid format. - ErrCodeInvalidMinimumHealthyHostValueException = "InvalidMinimumHealthyHostValueException" - - // ErrCodeInvalidNextTokenException for service response error code - // "InvalidNextTokenException". - // - // The next token was specified in an invalid format. - ErrCodeInvalidNextTokenException = "InvalidNextTokenException" - - // ErrCodeInvalidOperationException for service response error code - // "InvalidOperationException". - // - // An invalid operation was detected. - ErrCodeInvalidOperationException = "InvalidOperationException" - - // ErrCodeInvalidRegistrationStatusException for service response error code - // "InvalidRegistrationStatusException". - // - // The registration status was specified in an invalid format. - ErrCodeInvalidRegistrationStatusException = "InvalidRegistrationStatusException" - - // ErrCodeInvalidRevisionException for service response error code - // "InvalidRevisionException". - // - // The revision was specified in an invalid format. - ErrCodeInvalidRevisionException = "InvalidRevisionException" - - // ErrCodeInvalidRoleException for service response error code - // "InvalidRoleException". - // - // The service role ARN was specified in an invalid format. Or, if an Auto Scaling - // group was specified, the specified service role does not grant the appropriate - // permissions to Auto Scaling. - ErrCodeInvalidRoleException = "InvalidRoleException" - - // ErrCodeInvalidSortByException for service response error code - // "InvalidSortByException". - // - // The column name to sort by is either not present or was specified in an invalid - // format. - ErrCodeInvalidSortByException = "InvalidSortByException" - - // ErrCodeInvalidSortOrderException for service response error code - // "InvalidSortOrderException". - // - // The sort order was specified in an invalid format. - ErrCodeInvalidSortOrderException = "InvalidSortOrderException" - - // ErrCodeInvalidTagException for service response error code - // "InvalidTagException". - // - // The specified tag was specified in an invalid format. - ErrCodeInvalidTagException = "InvalidTagException" - - // ErrCodeInvalidTagFilterException for service response error code - // "InvalidTagFilterException". - // - // The specified tag filter was specified in an invalid format. - ErrCodeInvalidTagFilterException = "InvalidTagFilterException" - - // ErrCodeInvalidTargetInstancesException for service response error code - // "InvalidTargetInstancesException". - // - // The target instance configuration is invalid. Possible causes include: - // - // * Configuration data for target instances was entered for an in-place - // deployment. - // - // * The limit of 10 tags for a tag type was exceeded. - // - // * The combined length of the tag names exceeded the limit. - // - // * A specified tag is not currently applied to any instances. - ErrCodeInvalidTargetInstancesException = "InvalidTargetInstancesException" - - // ErrCodeInvalidTimeRangeException for service response error code - // "InvalidTimeRangeException". - // - // The specified time range was specified in an invalid format. - ErrCodeInvalidTimeRangeException = "InvalidTimeRangeException" - - // ErrCodeInvalidTriggerConfigException for service response error code - // "InvalidTriggerConfigException". - // - // The trigger was specified in an invalid format. - ErrCodeInvalidTriggerConfigException = "InvalidTriggerConfigException" - - // ErrCodeLifecycleHookLimitExceededException for service response error code - // "LifecycleHookLimitExceededException". - // - // The limit for lifecycle hooks was exceeded. - ErrCodeLifecycleHookLimitExceededException = "LifecycleHookLimitExceededException" - - // ErrCodeMultipleIamArnsProvidedException for service response error code - // "MultipleIamArnsProvidedException". - // - // Both an IAM user ARN and an IAM session ARN were included in the request. - // Use only one ARN type. - ErrCodeMultipleIamArnsProvidedException = "MultipleIamArnsProvidedException" - - // ErrCodeRevisionDoesNotExistException for service response error code - // "RevisionDoesNotExistException". - // - // The named revision does not exist with the applicable IAM user or AWS account. - ErrCodeRevisionDoesNotExistException = "RevisionDoesNotExistException" - - // ErrCodeRevisionRequiredException for service response error code - // "RevisionRequiredException". - // - // The revision ID was not specified. - ErrCodeRevisionRequiredException = "RevisionRequiredException" - - // ErrCodeRoleRequiredException for service response error code - // "RoleRequiredException". - // - // The role ID was not specified. - ErrCodeRoleRequiredException = "RoleRequiredException" - - // ErrCodeTagLimitExceededException for service response error code - // "TagLimitExceededException". - // - // The maximum allowed number of tags was exceeded. - ErrCodeTagLimitExceededException = "TagLimitExceededException" - - // ErrCodeTagRequiredException for service response error code - // "TagRequiredException". - // - // A tag was not specified. - ErrCodeTagRequiredException = "TagRequiredException" - - // ErrCodeTriggerTargetsLimitExceededException for service response error code - // "TriggerTargetsLimitExceededException". - // - // The maximum allowed number of triggers was exceeded. - ErrCodeTriggerTargetsLimitExceededException = "TriggerTargetsLimitExceededException" - - // ErrCodeUnsupportedActionForDeploymentTypeException for service response error code - // "UnsupportedActionForDeploymentTypeException". - // - // A call was submitted that is not supported for the specified deployment type. - ErrCodeUnsupportedActionForDeploymentTypeException = "UnsupportedActionForDeploymentTypeException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go deleted file mode 100644 index 5b20f2a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go +++ /dev/null @@ -1,145 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codedeploy - -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" -) - -// Overview -// -// This reference guide provides descriptions of the AWS CodeDeploy APIs. For -// more information about AWS CodeDeploy, see the AWS CodeDeploy User Guide -// (http://docs.aws.amazon.com/codedeploy/latest/userguide). -// -// Using the APIs -// -// You can use the AWS CodeDeploy APIs to work with the following: -// -// * Applications are unique identifiers used by AWS CodeDeploy to ensure -// the correct combinations of revisions, deployment configurations, and -// deployment groups are being referenced during deployments. -// -// You can use the AWS CodeDeploy APIs to create, delete, get, list, and update -// applications. -// -// * Deployment configurations are sets of deployment rules and success and -// failure conditions used by AWS CodeDeploy during deployments. -// -// You can use the AWS CodeDeploy APIs to create, delete, get, and list deployment -// configurations. -// -// * Deployment groups are groups of instances to which application revisions -// can be deployed. -// -// You can use the AWS CodeDeploy APIs to create, delete, get, list, and update -// deployment groups. -// -// * Instances represent Amazon EC2 instances to which application revisions -// are deployed. Instances are identified by their Amazon EC2 tags or Auto -// Scaling group names. Instances belong to deployment groups. -// -// You can use the AWS CodeDeploy APIs to get and list instance. -// -// * Deployments represent the process of deploying revisions to instances. -// -// You can use the AWS CodeDeploy APIs to create, get, list, and stop deployments. -// -// * Application revisions are archive files stored in Amazon S3 buckets -// or GitHub repositories. These revisions contain source content (such as -// source code, web pages, executable files, and deployment scripts) along -// with an application specification (AppSpec) file. (The AppSpec file is -// unique to AWS CodeDeploy; it defines the deployment actions you want AWS -// CodeDeploy to execute.) For application revisions stored in Amazon S3 -// buckets, an application revision is uniquely identified by its Amazon -// S3 object key and its ETag, version, or both. For application revisions -// stored in GitHub repositories, an application revision is uniquely identified -// by its repository name and commit ID. Application revisions are deployed -// through deployment groups. -// -// You can use the AWS CodeDeploy APIs to get, list, and register application -// revisions. -// 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/codedeploy-2014-10-06 -type CodeDeploy 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 = "codedeploy" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CodeDeploy 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 CodeDeploy client from just a session. -// svc := codedeploy.New(mySession) -// -// // Create a CodeDeploy client with additional configuration -// svc := codedeploy.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeDeploy { - 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) *CodeDeploy { - svc := &CodeDeploy{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-10-06", - JSONVersion: "1.1", - TargetPrefix: "CodeDeploy_20141006", - }, - 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 CodeDeploy operation and runs any -// custom request initialization. -func (c *CodeDeploy) 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/codedeploy/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/waiters.go deleted file mode 100644 index 3d605b1..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/waiters.go +++ /dev/null @@ -1,46 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codedeploy - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilDeploymentSuccessful uses the CodeDeploy API operation -// GetDeployment 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 *CodeDeploy) WaitUntilDeploymentSuccessful(input *GetDeploymentInput) error { - waiterCfg := waiter.Config{ - Operation: "GetDeployment", - Delay: 15, - MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "deploymentInfo.status", - Expected: "Succeeded", - }, - { - State: "failure", - Matcher: "path", - Argument: "deploymentInfo.status", - Expected: "Failed", - }, - { - State: "failure", - Matcher: "path", - Argument: "deploymentInfo.status", - Expected: "Stopped", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go deleted file mode 100644 index 0320007..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go +++ /dev/null @@ -1,7130 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package codepipeline provides a client for AWS CodePipeline. -package codepipeline - -import ( - "fmt" - "time" - - "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 opAcknowledgeJob = "AcknowledgeJob" - -// AcknowledgeJobRequest generates a "aws/request.Request" representing the -// client's request for the AcknowledgeJob operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AcknowledgeJob for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AcknowledgeJob method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AcknowledgeJobRequest method. -// req, resp := client.AcknowledgeJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeJob -func (c *CodePipeline) AcknowledgeJobRequest(input *AcknowledgeJobInput) (req *request.Request, output *AcknowledgeJobOutput) { - op := &request.Operation{ - Name: opAcknowledgeJob, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AcknowledgeJobInput{} - } - - output = &AcknowledgeJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcknowledgeJob API operation for AWS CodePipeline. -// -// Returns information about a specified job and whether that job has been received -// by the job worker. Only used for custom actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation AcknowledgeJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeInvalidNonceException "InvalidNonceException" -// The specified nonce was specified in an invalid format. -// -// * ErrCodeJobNotFoundException "JobNotFoundException" -// The specified job was specified in an invalid format or cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeJob -func (c *CodePipeline) AcknowledgeJob(input *AcknowledgeJobInput) (*AcknowledgeJobOutput, error) { - req, out := c.AcknowledgeJobRequest(input) - err := req.Send() - return out, err -} - -const opAcknowledgeThirdPartyJob = "AcknowledgeThirdPartyJob" - -// AcknowledgeThirdPartyJobRequest generates a "aws/request.Request" representing the -// client's request for the AcknowledgeThirdPartyJob operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AcknowledgeThirdPartyJob for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AcknowledgeThirdPartyJob method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AcknowledgeThirdPartyJobRequest method. -// req, resp := client.AcknowledgeThirdPartyJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeThirdPartyJob -func (c *CodePipeline) AcknowledgeThirdPartyJobRequest(input *AcknowledgeThirdPartyJobInput) (req *request.Request, output *AcknowledgeThirdPartyJobOutput) { - op := &request.Operation{ - Name: opAcknowledgeThirdPartyJob, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AcknowledgeThirdPartyJobInput{} - } - - output = &AcknowledgeThirdPartyJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcknowledgeThirdPartyJob API operation for AWS CodePipeline. -// -// Confirms a job worker has received the specified job. Only used for partner -// actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation AcknowledgeThirdPartyJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeInvalidNonceException "InvalidNonceException" -// The specified nonce was specified in an invalid format. -// -// * ErrCodeJobNotFoundException "JobNotFoundException" -// The specified job was specified in an invalid format or cannot be found. -// -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" -// The client token was specified in an invalid format -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeThirdPartyJob -func (c *CodePipeline) AcknowledgeThirdPartyJob(input *AcknowledgeThirdPartyJobInput) (*AcknowledgeThirdPartyJobOutput, error) { - req, out := c.AcknowledgeThirdPartyJobRequest(input) - err := req.Send() - return out, err -} - -const opCreateCustomActionType = "CreateCustomActionType" - -// CreateCustomActionTypeRequest generates a "aws/request.Request" representing the -// client's request for the CreateCustomActionType operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCustomActionType for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCustomActionType method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateCustomActionTypeRequest method. -// req, resp := client.CreateCustomActionTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreateCustomActionType -func (c *CodePipeline) CreateCustomActionTypeRequest(input *CreateCustomActionTypeInput) (req *request.Request, output *CreateCustomActionTypeOutput) { - op := &request.Operation{ - Name: opCreateCustomActionType, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCustomActionTypeInput{} - } - - output = &CreateCustomActionTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCustomActionType API operation for AWS CodePipeline. -// -// Creates a new custom action that can be used in all pipelines associated -// with the AWS account. Only used for custom actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation CreateCustomActionType for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The number of pipelines associated with the AWS account has exceeded the -// limit allowed for the account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreateCustomActionType -func (c *CodePipeline) CreateCustomActionType(input *CreateCustomActionTypeInput) (*CreateCustomActionTypeOutput, error) { - req, out := c.CreateCustomActionTypeRequest(input) - err := req.Send() - return out, err -} - -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) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreatePipeline -func (c *CodePipeline) CreatePipelineRequest(input *CreatePipelineInput) (req *request.Request, output *CreatePipelineOutput) { - op := &request.Operation{ - Name: opCreatePipeline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePipelineInput{} - } - - output = &CreatePipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePipeline API operation for AWS CodePipeline. -// -// Creates 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 AWS CodePipeline's -// API operation CreatePipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodePipelineNameInUseException "PipelineNameInUseException" -// The specified pipeline name is already in use. -// -// * ErrCodeInvalidStageDeclarationException "InvalidStageDeclarationException" -// The specified stage declaration was specified in an invalid format. -// -// * ErrCodeInvalidActionDeclarationException "InvalidActionDeclarationException" -// The specified action declaration was specified in an invalid format. -// -// * ErrCodeInvalidBlockerDeclarationException "InvalidBlockerDeclarationException" -// Reserved for future use. -// -// * ErrCodeInvalidStructureException "InvalidStructureException" -// The specified structure was specified in an invalid format. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The number of pipelines associated with the AWS account has exceeded the -// limit allowed for the account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreatePipeline -func (c *CodePipeline) CreatePipeline(input *CreatePipelineInput) (*CreatePipelineOutput, error) { - req, out := c.CreatePipelineRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCustomActionType = "DeleteCustomActionType" - -// DeleteCustomActionTypeRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCustomActionType operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCustomActionType for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCustomActionType method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCustomActionTypeRequest method. -// req, resp := client.DeleteCustomActionTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeleteCustomActionType -func (c *CodePipeline) DeleteCustomActionTypeRequest(input *DeleteCustomActionTypeInput) (req *request.Request, output *DeleteCustomActionTypeOutput) { - op := &request.Operation{ - Name: opDeleteCustomActionType, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCustomActionTypeInput{} - } - - output = &DeleteCustomActionTypeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCustomActionType API operation for AWS CodePipeline. -// -// Marks a custom action as deleted. PollForJobs for the custom action will -// fail after the action is marked for deletion. Only used for custom actions. -// -// You cannot recreate a custom action after it has been deleted unless you -// increase the version number of the action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation DeleteCustomActionType for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeleteCustomActionType -func (c *CodePipeline) DeleteCustomActionType(input *DeleteCustomActionTypeInput) (*DeleteCustomActionTypeOutput, error) { - req, out := c.DeleteCustomActionTypeRequest(input) - err := req.Send() - return out, err -} - -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) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeletePipeline -func (c *CodePipeline) DeletePipelineRequest(input *DeletePipelineInput) (req *request.Request, output *DeletePipelineOutput) { - op := &request.Operation{ - Name: opDeletePipeline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePipelineInput{} - } - - output = &DeletePipelineOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePipeline API operation for AWS CodePipeline. -// -// Deletes the specified 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 AWS CodePipeline's -// API operation DeletePipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeletePipeline -func (c *CodePipeline) DeletePipeline(input *DeletePipelineInput) (*DeletePipelineOutput, error) { - req, out := c.DeletePipelineRequest(input) - err := req.Send() - return out, err -} - -const opDisableStageTransition = "DisableStageTransition" - -// DisableStageTransitionRequest generates a "aws/request.Request" representing the -// client's request for the DisableStageTransition operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableStageTransition for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableStageTransition method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableStageTransitionRequest method. -// req, resp := client.DisableStageTransitionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DisableStageTransition -func (c *CodePipeline) DisableStageTransitionRequest(input *DisableStageTransitionInput) (req *request.Request, output *DisableStageTransitionOutput) { - op := &request.Operation{ - Name: opDisableStageTransition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableStageTransitionInput{} - } - - output = &DisableStageTransitionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableStageTransition API operation for AWS CodePipeline. -// -// Prevents artifacts in a pipeline from transitioning to the next stage in -// 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 AWS CodePipeline's -// API operation DisableStageTransition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// * ErrCodeStageNotFoundException "StageNotFoundException" -// The specified stage was specified in an invalid format or cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DisableStageTransition -func (c *CodePipeline) DisableStageTransition(input *DisableStageTransitionInput) (*DisableStageTransitionOutput, error) { - req, out := c.DisableStageTransitionRequest(input) - err := req.Send() - return out, err -} - -const opEnableStageTransition = "EnableStageTransition" - -// EnableStageTransitionRequest generates a "aws/request.Request" representing the -// client's request for the EnableStageTransition operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableStageTransition for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableStageTransition method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableStageTransitionRequest method. -// req, resp := client.EnableStageTransitionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/EnableStageTransition -func (c *CodePipeline) EnableStageTransitionRequest(input *EnableStageTransitionInput) (req *request.Request, output *EnableStageTransitionOutput) { - op := &request.Operation{ - Name: opEnableStageTransition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableStageTransitionInput{} - } - - output = &EnableStageTransitionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableStageTransition API operation for AWS CodePipeline. -// -// Enables artifacts in a pipeline to transition to a stage in 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 AWS CodePipeline's -// API operation EnableStageTransition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// * ErrCodeStageNotFoundException "StageNotFoundException" -// The specified stage was specified in an invalid format or cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/EnableStageTransition -func (c *CodePipeline) EnableStageTransition(input *EnableStageTransitionInput) (*EnableStageTransitionOutput, error) { - req, out := c.EnableStageTransitionRequest(input) - err := req.Send() - return out, err -} - -const opGetJobDetails = "GetJobDetails" - -// GetJobDetailsRequest generates a "aws/request.Request" representing the -// client's request for the GetJobDetails operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetJobDetails for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetJobDetails method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetJobDetailsRequest method. -// req, resp := client.GetJobDetailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetJobDetails -func (c *CodePipeline) GetJobDetailsRequest(input *GetJobDetailsInput) (req *request.Request, output *GetJobDetailsOutput) { - op := &request.Operation{ - Name: opGetJobDetails, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetJobDetailsInput{} - } - - output = &GetJobDetailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetJobDetails API operation for AWS CodePipeline. -// -// Returns information about a job. Only used for custom actions. -// -// When this API is called, AWS CodePipeline returns temporary credentials for -// the Amazon S3 bucket used to store artifacts for the pipeline, if the action -// requires access to that Amazon S3 bucket for input or output artifacts. Additionally, -// this API returns any secret values defined for the action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation GetJobDetails for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeJobNotFoundException "JobNotFoundException" -// The specified job was specified in an invalid format or cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetJobDetails -func (c *CodePipeline) GetJobDetails(input *GetJobDetailsInput) (*GetJobDetailsOutput, error) { - req, out := c.GetJobDetailsRequest(input) - err := req.Send() - return out, err -} - -const opGetPipeline = "GetPipeline" - -// GetPipelineRequest generates a "aws/request.Request" representing the -// client's request for the GetPipeline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPipeline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPipeline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPipelineRequest method. -// req, resp := client.GetPipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipeline -func (c *CodePipeline) GetPipelineRequest(input *GetPipelineInput) (req *request.Request, output *GetPipelineOutput) { - op := &request.Operation{ - Name: opGetPipeline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPipelineInput{} - } - - output = &GetPipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPipeline API operation for AWS CodePipeline. -// -// Returns the metadata, structure, stages, and actions of a pipeline. Can be -// used to return the entire structure of a pipeline in JSON format, which can -// then be modified and used to update the pipeline structure with UpdatePipeline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation GetPipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// * ErrCodePipelineVersionNotFoundException "PipelineVersionNotFoundException" -// The specified pipeline version was specified in an invalid format or cannot -// be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipeline -func (c *CodePipeline) GetPipeline(input *GetPipelineInput) (*GetPipelineOutput, error) { - req, out := c.GetPipelineRequest(input) - err := req.Send() - return out, err -} - -const opGetPipelineExecution = "GetPipelineExecution" - -// GetPipelineExecutionRequest generates a "aws/request.Request" representing the -// client's request for the GetPipelineExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPipelineExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPipelineExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPipelineExecutionRequest method. -// req, resp := client.GetPipelineExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineExecution -func (c *CodePipeline) GetPipelineExecutionRequest(input *GetPipelineExecutionInput) (req *request.Request, output *GetPipelineExecutionOutput) { - op := &request.Operation{ - Name: opGetPipelineExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPipelineExecutionInput{} - } - - output = &GetPipelineExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPipelineExecution API operation for AWS CodePipeline. -// -// Returns information about an execution of a pipeline, including details about -// artifacts, the pipeline execution ID, and the name, version, and status of -// 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 AWS CodePipeline's -// API operation GetPipelineExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// * ErrCodePipelineExecutionNotFoundException "PipelineExecutionNotFoundException" -// The pipeline execution was specified in an invalid format or cannot be found, -// or an execution ID does not belong to the specified pipeline. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineExecution -func (c *CodePipeline) GetPipelineExecution(input *GetPipelineExecutionInput) (*GetPipelineExecutionOutput, error) { - req, out := c.GetPipelineExecutionRequest(input) - err := req.Send() - return out, err -} - -const opGetPipelineState = "GetPipelineState" - -// GetPipelineStateRequest generates a "aws/request.Request" representing the -// client's request for the GetPipelineState operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPipelineState for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPipelineState method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPipelineStateRequest method. -// req, resp := client.GetPipelineStateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineState -func (c *CodePipeline) GetPipelineStateRequest(input *GetPipelineStateInput) (req *request.Request, output *GetPipelineStateOutput) { - op := &request.Operation{ - Name: opGetPipelineState, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPipelineStateInput{} - } - - output = &GetPipelineStateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPipelineState API operation for AWS CodePipeline. -// -// Returns information about the state of a pipeline, including the stages and -// actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation GetPipelineState for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineState -func (c *CodePipeline) GetPipelineState(input *GetPipelineStateInput) (*GetPipelineStateOutput, error) { - req, out := c.GetPipelineStateRequest(input) - err := req.Send() - return out, err -} - -const opGetThirdPartyJobDetails = "GetThirdPartyJobDetails" - -// GetThirdPartyJobDetailsRequest generates a "aws/request.Request" representing the -// client's request for the GetThirdPartyJobDetails operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetThirdPartyJobDetails for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetThirdPartyJobDetails method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetThirdPartyJobDetailsRequest method. -// req, resp := client.GetThirdPartyJobDetailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetThirdPartyJobDetails -func (c *CodePipeline) GetThirdPartyJobDetailsRequest(input *GetThirdPartyJobDetailsInput) (req *request.Request, output *GetThirdPartyJobDetailsOutput) { - op := &request.Operation{ - Name: opGetThirdPartyJobDetails, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetThirdPartyJobDetailsInput{} - } - - output = &GetThirdPartyJobDetailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetThirdPartyJobDetails API operation for AWS CodePipeline. -// -// Requests the details of a job for a third party action. Only used for partner -// actions. -// -// When this API is called, AWS CodePipeline returns temporary credentials for -// the Amazon S3 bucket used to store artifacts for the pipeline, if the action -// requires access to that Amazon S3 bucket for input or output artifacts. Additionally, -// this API returns any secret values defined for the action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation GetThirdPartyJobDetails for usage and error information. -// -// Returned Error Codes: -// * ErrCodeJobNotFoundException "JobNotFoundException" -// The specified job was specified in an invalid format or cannot be found. -// -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" -// The client token was specified in an invalid format -// -// * ErrCodeInvalidJobException "InvalidJobException" -// The specified job was specified in an invalid format or cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetThirdPartyJobDetails -func (c *CodePipeline) GetThirdPartyJobDetails(input *GetThirdPartyJobDetailsInput) (*GetThirdPartyJobDetailsOutput, error) { - req, out := c.GetThirdPartyJobDetailsRequest(input) - err := req.Send() - return out, err -} - -const opListActionTypes = "ListActionTypes" - -// ListActionTypesRequest generates a "aws/request.Request" representing the -// client's request for the ListActionTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListActionTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListActionTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListActionTypesRequest method. -// req, resp := client.ListActionTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListActionTypes -func (c *CodePipeline) ListActionTypesRequest(input *ListActionTypesInput) (req *request.Request, output *ListActionTypesOutput) { - op := &request.Operation{ - Name: opListActionTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListActionTypesInput{} - } - - output = &ListActionTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListActionTypes API operation for AWS CodePipeline. -// -// Gets a summary of all AWS CodePipeline action types associated with 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 AWS CodePipeline's -// API operation ListActionTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. Make sure that the next -// token you provided is the token returned by a previous call. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListActionTypes -func (c *CodePipeline) ListActionTypes(input *ListActionTypesInput) (*ListActionTypesOutput, error) { - req, out := c.ListActionTypesRequest(input) - err := req.Send() - return out, 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) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelines -func (c *CodePipeline) ListPipelinesRequest(input *ListPipelinesInput) (req *request.Request, output *ListPipelinesOutput) { - op := &request.Operation{ - Name: opListPipelines, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListPipelinesInput{} - } - - output = &ListPipelinesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPipelines API operation for AWS CodePipeline. -// -// Gets a summary of all of the pipelines associated with 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 AWS CodePipeline's -// API operation ListPipelines for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The next token was specified in an invalid format. Make sure that the next -// token you provided is the token returned by a previous call. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelines -func (c *CodePipeline) ListPipelines(input *ListPipelinesInput) (*ListPipelinesOutput, error) { - req, out := c.ListPipelinesRequest(input) - err := req.Send() - return out, err -} - -const opPollForJobs = "PollForJobs" - -// PollForJobsRequest generates a "aws/request.Request" representing the -// client's request for the PollForJobs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PollForJobs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PollForJobs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PollForJobsRequest method. -// req, resp := client.PollForJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForJobs -func (c *CodePipeline) PollForJobsRequest(input *PollForJobsInput) (req *request.Request, output *PollForJobsOutput) { - op := &request.Operation{ - Name: opPollForJobs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PollForJobsInput{} - } - - output = &PollForJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PollForJobs API operation for AWS CodePipeline. -// -// Returns information about any jobs for AWS CodePipeline to act upon. -// -// When this API is called, AWS CodePipeline returns temporary credentials for -// the Amazon S3 bucket used to store artifacts for the pipeline, if the action -// requires access to that Amazon S3 bucket for input or output artifacts. Additionally, -// this API returns any secret values defined for the action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation PollForJobs for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeActionTypeNotFoundException "ActionTypeNotFoundException" -// The specified action type cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForJobs -func (c *CodePipeline) PollForJobs(input *PollForJobsInput) (*PollForJobsOutput, error) { - req, out := c.PollForJobsRequest(input) - err := req.Send() - return out, err -} - -const opPollForThirdPartyJobs = "PollForThirdPartyJobs" - -// PollForThirdPartyJobsRequest generates a "aws/request.Request" representing the -// client's request for the PollForThirdPartyJobs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PollForThirdPartyJobs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PollForThirdPartyJobs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PollForThirdPartyJobsRequest method. -// req, resp := client.PollForThirdPartyJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForThirdPartyJobs -func (c *CodePipeline) PollForThirdPartyJobsRequest(input *PollForThirdPartyJobsInput) (req *request.Request, output *PollForThirdPartyJobsOutput) { - op := &request.Operation{ - Name: opPollForThirdPartyJobs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PollForThirdPartyJobsInput{} - } - - output = &PollForThirdPartyJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PollForThirdPartyJobs API operation for AWS CodePipeline. -// -// Determines whether there are any third party jobs for a job worker to act -// on. Only used for partner actions. -// -// When this API is called, AWS CodePipeline returns temporary credentials for -// the Amazon S3 bucket used to store artifacts for the pipeline, if the action -// requires access to that Amazon S3 bucket for input or output artifacts. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation PollForThirdPartyJobs for usage and error information. -// -// Returned Error Codes: -// * ErrCodeActionTypeNotFoundException "ActionTypeNotFoundException" -// The specified action type cannot be found. -// -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForThirdPartyJobs -func (c *CodePipeline) PollForThirdPartyJobs(input *PollForThirdPartyJobsInput) (*PollForThirdPartyJobsOutput, error) { - req, out := c.PollForThirdPartyJobsRequest(input) - err := req.Send() - return out, err -} - -const opPutActionRevision = "PutActionRevision" - -// PutActionRevisionRequest generates a "aws/request.Request" representing the -// client's request for the PutActionRevision operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutActionRevision for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutActionRevision method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutActionRevisionRequest method. -// req, resp := client.PutActionRevisionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutActionRevision -func (c *CodePipeline) PutActionRevisionRequest(input *PutActionRevisionInput) (req *request.Request, output *PutActionRevisionOutput) { - op := &request.Operation{ - Name: opPutActionRevision, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutActionRevisionInput{} - } - - output = &PutActionRevisionOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutActionRevision API operation for AWS CodePipeline. -// -// Provides information to AWS CodePipeline about new revisions to a 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 AWS CodePipeline's -// API operation PutActionRevision for usage and error information. -// -// Returned Error Codes: -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// * ErrCodeStageNotFoundException "StageNotFoundException" -// The specified stage was specified in an invalid format or cannot be found. -// -// * ErrCodeActionNotFoundException "ActionNotFoundException" -// The specified action cannot be found. -// -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutActionRevision -func (c *CodePipeline) PutActionRevision(input *PutActionRevisionInput) (*PutActionRevisionOutput, error) { - req, out := c.PutActionRevisionRequest(input) - err := req.Send() - return out, err -} - -const opPutApprovalResult = "PutApprovalResult" - -// PutApprovalResultRequest generates a "aws/request.Request" representing the -// client's request for the PutApprovalResult operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutApprovalResult for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutApprovalResult method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutApprovalResultRequest method. -// req, resp := client.PutApprovalResultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutApprovalResult -func (c *CodePipeline) PutApprovalResultRequest(input *PutApprovalResultInput) (req *request.Request, output *PutApprovalResultOutput) { - op := &request.Operation{ - Name: opPutApprovalResult, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutApprovalResultInput{} - } - - output = &PutApprovalResultOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutApprovalResult API operation for AWS CodePipeline. -// -// Provides the response to a manual approval request to AWS CodePipeline. Valid -// responses include Approved and 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 AWS CodePipeline's -// API operation PutApprovalResult for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidApprovalTokenException "InvalidApprovalTokenException" -// The approval request already received a response or has expired. -// -// * ErrCodeApprovalAlreadyCompletedException "ApprovalAlreadyCompletedException" -// The approval action has already been approved or rejected. -// -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// * ErrCodeStageNotFoundException "StageNotFoundException" -// The specified stage was specified in an invalid format or cannot be found. -// -// * ErrCodeActionNotFoundException "ActionNotFoundException" -// The specified action cannot be found. -// -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutApprovalResult -func (c *CodePipeline) PutApprovalResult(input *PutApprovalResultInput) (*PutApprovalResultOutput, error) { - req, out := c.PutApprovalResultRequest(input) - err := req.Send() - return out, err -} - -const opPutJobFailureResult = "PutJobFailureResult" - -// PutJobFailureResultRequest generates a "aws/request.Request" representing the -// client's request for the PutJobFailureResult operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutJobFailureResult for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutJobFailureResult method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutJobFailureResultRequest method. -// req, resp := client.PutJobFailureResultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobFailureResult -func (c *CodePipeline) PutJobFailureResultRequest(input *PutJobFailureResultInput) (req *request.Request, output *PutJobFailureResultOutput) { - op := &request.Operation{ - Name: opPutJobFailureResult, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutJobFailureResultInput{} - } - - output = &PutJobFailureResultOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutJobFailureResult API operation for AWS CodePipeline. -// -// Represents the failure of a job as returned to the pipeline by a job worker. -// Only used for custom actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation PutJobFailureResult for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeJobNotFoundException "JobNotFoundException" -// The specified job was specified in an invalid format or cannot be found. -// -// * ErrCodeInvalidJobStateException "InvalidJobStateException" -// The specified job state was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobFailureResult -func (c *CodePipeline) PutJobFailureResult(input *PutJobFailureResultInput) (*PutJobFailureResultOutput, error) { - req, out := c.PutJobFailureResultRequest(input) - err := req.Send() - return out, err -} - -const opPutJobSuccessResult = "PutJobSuccessResult" - -// PutJobSuccessResultRequest generates a "aws/request.Request" representing the -// client's request for the PutJobSuccessResult operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutJobSuccessResult for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutJobSuccessResult method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutJobSuccessResultRequest method. -// req, resp := client.PutJobSuccessResultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobSuccessResult -func (c *CodePipeline) PutJobSuccessResultRequest(input *PutJobSuccessResultInput) (req *request.Request, output *PutJobSuccessResultOutput) { - op := &request.Operation{ - Name: opPutJobSuccessResult, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutJobSuccessResultInput{} - } - - output = &PutJobSuccessResultOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutJobSuccessResult API operation for AWS CodePipeline. -// -// Represents the success of a job as returned to the pipeline by a job worker. -// Only used for custom actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation PutJobSuccessResult for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeJobNotFoundException "JobNotFoundException" -// The specified job was specified in an invalid format or cannot be found. -// -// * ErrCodeInvalidJobStateException "InvalidJobStateException" -// The specified job state was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobSuccessResult -func (c *CodePipeline) PutJobSuccessResult(input *PutJobSuccessResultInput) (*PutJobSuccessResultOutput, error) { - req, out := c.PutJobSuccessResultRequest(input) - err := req.Send() - return out, err -} - -const opPutThirdPartyJobFailureResult = "PutThirdPartyJobFailureResult" - -// PutThirdPartyJobFailureResultRequest generates a "aws/request.Request" representing the -// client's request for the PutThirdPartyJobFailureResult operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutThirdPartyJobFailureResult for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutThirdPartyJobFailureResult method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutThirdPartyJobFailureResultRequest method. -// req, resp := client.PutThirdPartyJobFailureResultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobFailureResult -func (c *CodePipeline) PutThirdPartyJobFailureResultRequest(input *PutThirdPartyJobFailureResultInput) (req *request.Request, output *PutThirdPartyJobFailureResultOutput) { - op := &request.Operation{ - Name: opPutThirdPartyJobFailureResult, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutThirdPartyJobFailureResultInput{} - } - - output = &PutThirdPartyJobFailureResultOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutThirdPartyJobFailureResult API operation for AWS CodePipeline. -// -// Represents the failure of a third party job as returned to the pipeline by -// a job worker. Only used for partner actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation PutThirdPartyJobFailureResult for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeJobNotFoundException "JobNotFoundException" -// The specified job was specified in an invalid format or cannot be found. -// -// * ErrCodeInvalidJobStateException "InvalidJobStateException" -// The specified job state was specified in an invalid format. -// -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" -// The client token was specified in an invalid format -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobFailureResult -func (c *CodePipeline) PutThirdPartyJobFailureResult(input *PutThirdPartyJobFailureResultInput) (*PutThirdPartyJobFailureResultOutput, error) { - req, out := c.PutThirdPartyJobFailureResultRequest(input) - err := req.Send() - return out, err -} - -const opPutThirdPartyJobSuccessResult = "PutThirdPartyJobSuccessResult" - -// PutThirdPartyJobSuccessResultRequest generates a "aws/request.Request" representing the -// client's request for the PutThirdPartyJobSuccessResult operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutThirdPartyJobSuccessResult for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutThirdPartyJobSuccessResult method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutThirdPartyJobSuccessResultRequest method. -// req, resp := client.PutThirdPartyJobSuccessResultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobSuccessResult -func (c *CodePipeline) PutThirdPartyJobSuccessResultRequest(input *PutThirdPartyJobSuccessResultInput) (req *request.Request, output *PutThirdPartyJobSuccessResultOutput) { - op := &request.Operation{ - Name: opPutThirdPartyJobSuccessResult, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutThirdPartyJobSuccessResultInput{} - } - - output = &PutThirdPartyJobSuccessResultOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutThirdPartyJobSuccessResult API operation for AWS CodePipeline. -// -// Represents the success of a third party job as returned to the pipeline by -// a job worker. Only used for partner actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation PutThirdPartyJobSuccessResult for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeJobNotFoundException "JobNotFoundException" -// The specified job was specified in an invalid format or cannot be found. -// -// * ErrCodeInvalidJobStateException "InvalidJobStateException" -// The specified job state was specified in an invalid format. -// -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" -// The client token was specified in an invalid format -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobSuccessResult -func (c *CodePipeline) PutThirdPartyJobSuccessResult(input *PutThirdPartyJobSuccessResultInput) (*PutThirdPartyJobSuccessResultOutput, error) { - req, out := c.PutThirdPartyJobSuccessResultRequest(input) - err := req.Send() - return out, err -} - -const opRetryStageExecution = "RetryStageExecution" - -// RetryStageExecutionRequest generates a "aws/request.Request" representing the -// client's request for the RetryStageExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RetryStageExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RetryStageExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RetryStageExecutionRequest method. -// req, resp := client.RetryStageExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/RetryStageExecution -func (c *CodePipeline) RetryStageExecutionRequest(input *RetryStageExecutionInput) (req *request.Request, output *RetryStageExecutionOutput) { - op := &request.Operation{ - Name: opRetryStageExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RetryStageExecutionInput{} - } - - output = &RetryStageExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// RetryStageExecution API operation for AWS CodePipeline. -// -// Resumes the pipeline execution by retrying the last failed actions in a stage. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation RetryStageExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// * ErrCodeStageNotFoundException "StageNotFoundException" -// The specified stage was specified in an invalid format or cannot be found. -// -// * ErrCodeStageNotRetryableException "StageNotRetryableException" -// The specified stage can't be retried because the pipeline structure or stage -// state changed after the stage was not completed; the stage contains no failed -// actions; one or more actions are still in progress; or another retry attempt -// is already in progress. -// -// * ErrCodeNotLatestPipelineExecutionException "NotLatestPipelineExecutionException" -// The stage has failed in a later run of the pipeline and the pipelineExecutionId -// associated with the request is out of date. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/RetryStageExecution -func (c *CodePipeline) RetryStageExecution(input *RetryStageExecutionInput) (*RetryStageExecutionOutput, error) { - req, out := c.RetryStageExecutionRequest(input) - err := req.Send() - return out, err -} - -const opStartPipelineExecution = "StartPipelineExecution" - -// StartPipelineExecutionRequest generates a "aws/request.Request" representing the -// client's request for the StartPipelineExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartPipelineExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartPipelineExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartPipelineExecutionRequest method. -// req, resp := client.StartPipelineExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StartPipelineExecution -func (c *CodePipeline) StartPipelineExecutionRequest(input *StartPipelineExecutionInput) (req *request.Request, output *StartPipelineExecutionOutput) { - op := &request.Operation{ - Name: opStartPipelineExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartPipelineExecutionInput{} - } - - output = &StartPipelineExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartPipelineExecution API operation for AWS CodePipeline. -// -// Starts the specified pipeline. Specifically, it begins processing the latest -// commit to the source location specified as part of 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 AWS CodePipeline's -// API operation StartPipelineExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" -// The specified pipeline was specified in an invalid format or cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StartPipelineExecution -func (c *CodePipeline) StartPipelineExecution(input *StartPipelineExecutionInput) (*StartPipelineExecutionOutput, error) { - req, out := c.StartPipelineExecutionRequest(input) - err := req.Send() - return out, err -} - -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) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/UpdatePipeline -func (c *CodePipeline) UpdatePipelineRequest(input *UpdatePipelineInput) (req *request.Request, output *UpdatePipelineOutput) { - op := &request.Operation{ - Name: opUpdatePipeline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdatePipelineInput{} - } - - output = &UpdatePipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePipeline API operation for AWS CodePipeline. -// -// Updates a specified pipeline with edits or changes to its structure. Use -// a JSON file with the pipeline structure in conjunction with UpdatePipeline -// to provide the full structure of the pipeline. Updating the pipeline increases -// the version number of the pipeline by 1. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 CodePipeline's -// API operation UpdatePipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The validation was specified in an invalid format. -// -// * ErrCodeInvalidStageDeclarationException "InvalidStageDeclarationException" -// The specified stage declaration was specified in an invalid format. -// -// * ErrCodeInvalidActionDeclarationException "InvalidActionDeclarationException" -// The specified action declaration was specified in an invalid format. -// -// * ErrCodeInvalidBlockerDeclarationException "InvalidBlockerDeclarationException" -// Reserved for future use. -// -// * ErrCodeInvalidStructureException "InvalidStructureException" -// The specified structure was specified in an invalid format. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/UpdatePipeline -func (c *CodePipeline) UpdatePipeline(input *UpdatePipelineInput) (*UpdatePipelineOutput, error) { - req, out := c.UpdatePipelineRequest(input) - err := req.Send() - return out, err -} - -// Represents an AWS session credentials object. These credentials are temporary -// credentials that are issued by AWS Secure Token Service (STS). They can be -// used to access input and output artifacts in the Amazon S3 bucket used to -// store artifact for the pipeline in AWS CodePipeline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AWSSessionCredentials -type AWSSessionCredentials struct { - _ struct{} `type:"structure"` - - // The access key for the session. - // - // AccessKeyId is a required field - AccessKeyId *string `locationName:"accessKeyId" type:"string" required:"true"` - - // The secret access key for the session. - // - // SecretAccessKey is a required field - SecretAccessKey *string `locationName:"secretAccessKey" type:"string" required:"true"` - - // The token for the session. - // - // SessionToken is a required field - SessionToken *string `locationName:"sessionToken" type:"string" required:"true"` -} - -// String returns the string representation -func (s AWSSessionCredentials) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AWSSessionCredentials) GoString() string { - return s.String() -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *AWSSessionCredentials) SetAccessKeyId(v string) *AWSSessionCredentials { - s.AccessKeyId = &v - return s -} - -// SetSecretAccessKey sets the SecretAccessKey field's value. -func (s *AWSSessionCredentials) SetSecretAccessKey(v string) *AWSSessionCredentials { - s.SecretAccessKey = &v - return s -} - -// SetSessionToken sets the SessionToken field's value. -func (s *AWSSessionCredentials) SetSessionToken(v string) *AWSSessionCredentials { - s.SessionToken = &v - return s -} - -// Represents the input of an acknowledge job action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeJobInput -type AcknowledgeJobInput struct { - _ struct{} `type:"structure"` - - // The unique system-generated ID of the job for which you want to confirm receipt. - // - // JobId is a required field - JobId *string `locationName:"jobId" type:"string" required:"true"` - - // A system-generated random number that AWS CodePipeline uses to ensure that - // the job is being worked on by only one job worker. Get this number from the - // response of the PollForJobs request that returned this job. - // - // Nonce is a required field - Nonce *string `locationName:"nonce" type:"string" required:"true"` -} - -// String returns the string representation -func (s AcknowledgeJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcknowledgeJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcknowledgeJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcknowledgeJobInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.Nonce == nil { - invalidParams.Add(request.NewErrParamRequired("Nonce")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobId sets the JobId field's value. -func (s *AcknowledgeJobInput) SetJobId(v string) *AcknowledgeJobInput { - s.JobId = &v - return s -} - -// SetNonce sets the Nonce field's value. -func (s *AcknowledgeJobInput) SetNonce(v string) *AcknowledgeJobInput { - s.Nonce = &v - return s -} - -// Represents the output of an acknowledge job action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeJobOutput -type AcknowledgeJobOutput struct { - _ struct{} `type:"structure"` - - // Whether the job worker has received the specified job. - Status *string `locationName:"status" type:"string" enum:"JobStatus"` -} - -// String returns the string representation -func (s AcknowledgeJobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcknowledgeJobOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *AcknowledgeJobOutput) SetStatus(v string) *AcknowledgeJobOutput { - s.Status = &v - return s -} - -// Represents the input of an acknowledge third party job action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeThirdPartyJobInput -type AcknowledgeThirdPartyJobInput struct { - _ struct{} `type:"structure"` - - // The clientToken portion of the clientId and clientToken pair used to verify - // that the calling entity is allowed access to the job and its details. - // - // ClientToken is a required field - ClientToken *string `locationName:"clientToken" type:"string" required:"true"` - - // The unique system-generated ID of the job. - // - // JobId is a required field - JobId *string `locationName:"jobId" min:"1" type:"string" required:"true"` - - // A system-generated random number that AWS CodePipeline uses to ensure that - // the job is being worked on by only one job worker. Get this number from the - // response to a GetThirdPartyJobDetails request. - // - // Nonce is a required field - Nonce *string `locationName:"nonce" type:"string" required:"true"` -} - -// String returns the string representation -func (s AcknowledgeThirdPartyJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcknowledgeThirdPartyJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcknowledgeThirdPartyJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcknowledgeThirdPartyJobInput"} - if s.ClientToken == nil { - invalidParams.Add(request.NewErrParamRequired("ClientToken")) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - if s.Nonce == nil { - invalidParams.Add(request.NewErrParamRequired("Nonce")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *AcknowledgeThirdPartyJobInput) SetClientToken(v string) *AcknowledgeThirdPartyJobInput { - s.ClientToken = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *AcknowledgeThirdPartyJobInput) SetJobId(v string) *AcknowledgeThirdPartyJobInput { - s.JobId = &v - return s -} - -// SetNonce sets the Nonce field's value. -func (s *AcknowledgeThirdPartyJobInput) SetNonce(v string) *AcknowledgeThirdPartyJobInput { - s.Nonce = &v - return s -} - -// Represents the output of an acknowledge third party job action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeThirdPartyJobOutput -type AcknowledgeThirdPartyJobOutput struct { - _ struct{} `type:"structure"` - - // The status information for the third party job, if any. - Status *string `locationName:"status" type:"string" enum:"JobStatus"` -} - -// String returns the string representation -func (s AcknowledgeThirdPartyJobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcknowledgeThirdPartyJobOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *AcknowledgeThirdPartyJobOutput) SetStatus(v string) *AcknowledgeThirdPartyJobOutput { - s.Status = &v - return s -} - -// Represents information about an action configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionConfiguration -type ActionConfiguration struct { - _ struct{} `type:"structure"` - - // The configuration data for the action. - Configuration map[string]*string `locationName:"configuration" type:"map"` -} - -// String returns the string representation -func (s ActionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionConfiguration) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *ActionConfiguration) SetConfiguration(v map[string]*string) *ActionConfiguration { - s.Configuration = v - return s -} - -// Represents information about an action configuration property. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionConfigurationProperty -type ActionConfigurationProperty struct { - _ struct{} `type:"structure"` - - // The description of the action configuration property that will be displayed - // to users. - Description *string `locationName:"description" min:"1" type:"string"` - - // Whether the configuration property is a key. - // - // Key is a required field - Key *bool `locationName:"key" type:"boolean" required:"true"` - - // The name of the action configuration property. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Indicates that the proprety will be used in conjunction with PollForJobs. - // When creating a custom action, an action can have up to one queryable property. - // If it has one, that property must be both required and not secret. - // - // If you create a pipeline with a custom action type, and that custom action - // contains a queryable property, the value for that configuration property - // is subject to additional restrictions. The value must be less than or equal - // to twenty (20) characters. The value can contain only alphanumeric characters, - // underscores, and hyphens. - Queryable *bool `locationName:"queryable" type:"boolean"` - - // Whether the configuration property is a required value. - // - // Required is a required field - Required *bool `locationName:"required" type:"boolean" required:"true"` - - // Whether the configuration property is secret. Secrets are hidden from all - // calls except for GetJobDetails, GetThirdPartyJobDetails, PollForJobs, and - // PollForThirdPartyJobs. - // - // When updating a pipeline, passing * * * * * without changing any other values - // of the action will preserve the prior value of the secret. - // - // Secret is a required field - Secret *bool `locationName:"secret" type:"boolean" required:"true"` - - // The type of the configuration property. - Type *string `locationName:"type" type:"string" enum:"ActionConfigurationPropertyType"` -} - -// String returns the string representation -func (s ActionConfigurationProperty) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionConfigurationProperty) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActionConfigurationProperty) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActionConfigurationProperty"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - 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.Required == nil { - invalidParams.Add(request.NewErrParamRequired("Required")) - } - if s.Secret == nil { - invalidParams.Add(request.NewErrParamRequired("Secret")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *ActionConfigurationProperty) SetDescription(v string) *ActionConfigurationProperty { - s.Description = &v - return s -} - -// SetKey sets the Key field's value. -func (s *ActionConfigurationProperty) SetKey(v bool) *ActionConfigurationProperty { - s.Key = &v - return s -} - -// SetName sets the Name field's value. -func (s *ActionConfigurationProperty) SetName(v string) *ActionConfigurationProperty { - s.Name = &v - return s -} - -// SetQueryable sets the Queryable field's value. -func (s *ActionConfigurationProperty) SetQueryable(v bool) *ActionConfigurationProperty { - s.Queryable = &v - return s -} - -// SetRequired sets the Required field's value. -func (s *ActionConfigurationProperty) SetRequired(v bool) *ActionConfigurationProperty { - s.Required = &v - return s -} - -// SetSecret sets the Secret field's value. -func (s *ActionConfigurationProperty) SetSecret(v bool) *ActionConfigurationProperty { - s.Secret = &v - return s -} - -// SetType sets the Type field's value. -func (s *ActionConfigurationProperty) SetType(v string) *ActionConfigurationProperty { - s.Type = &v - return s -} - -// Represents the context of an action within the stage of a pipeline to a job -// worker. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionContext -type ActionContext struct { - _ struct{} `type:"structure"` - - // The name of the action within the context of a job. - Name *string `locationName:"name" min:"1" type:"string"` -} - -// String returns the string representation -func (s ActionContext) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionContext) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *ActionContext) SetName(v string) *ActionContext { - s.Name = &v - return s -} - -// Represents information about an action declaration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionDeclaration -type ActionDeclaration struct { - _ struct{} `type:"structure"` - - // The configuration information for the action type. - // - // ActionTypeId is a required field - ActionTypeId *ActionTypeId `locationName:"actionTypeId" type:"structure" required:"true"` - - // The action declaration's configuration. - Configuration map[string]*string `locationName:"configuration" type:"map"` - - // The name or ID of the artifact consumed by the action, such as a test or - // build artifact. - InputArtifacts []*InputArtifact `locationName:"inputArtifacts" type:"list"` - - // The action declaration's name. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The name or ID of the result of the action declaration, such as a test or - // build artifact. - OutputArtifacts []*OutputArtifact `locationName:"outputArtifacts" type:"list"` - - // The ARN of the IAM service role that will perform the declared action. This - // is assumed through the roleArn for the pipeline. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The order in which actions are run. - RunOrder *int64 `locationName:"runOrder" min:"1" type:"integer"` -} - -// String returns the string representation -func (s ActionDeclaration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionDeclaration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActionDeclaration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActionDeclaration"} - if s.ActionTypeId == nil { - invalidParams.Add(request.NewErrParamRequired("ActionTypeId")) - } - 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.RunOrder != nil && *s.RunOrder < 1 { - invalidParams.Add(request.NewErrParamMinValue("RunOrder", 1)) - } - if s.ActionTypeId != nil { - if err := s.ActionTypeId.Validate(); err != nil { - invalidParams.AddNested("ActionTypeId", err.(request.ErrInvalidParams)) - } - } - if s.InputArtifacts != nil { - for i, v := range s.InputArtifacts { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputArtifacts", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputArtifacts != nil { - for i, v := range s.OutputArtifacts { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OutputArtifacts", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionTypeId sets the ActionTypeId field's value. -func (s *ActionDeclaration) SetActionTypeId(v *ActionTypeId) *ActionDeclaration { - s.ActionTypeId = v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *ActionDeclaration) SetConfiguration(v map[string]*string) *ActionDeclaration { - s.Configuration = v - return s -} - -// SetInputArtifacts sets the InputArtifacts field's value. -func (s *ActionDeclaration) SetInputArtifacts(v []*InputArtifact) *ActionDeclaration { - s.InputArtifacts = v - return s -} - -// SetName sets the Name field's value. -func (s *ActionDeclaration) SetName(v string) *ActionDeclaration { - s.Name = &v - return s -} - -// SetOutputArtifacts sets the OutputArtifacts field's value. -func (s *ActionDeclaration) SetOutputArtifacts(v []*OutputArtifact) *ActionDeclaration { - s.OutputArtifacts = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *ActionDeclaration) SetRoleArn(v string) *ActionDeclaration { - s.RoleArn = &v - return s -} - -// SetRunOrder sets the RunOrder field's value. -func (s *ActionDeclaration) SetRunOrder(v int64) *ActionDeclaration { - s.RunOrder = &v - return s -} - -// Represents information about the run of an action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionExecution -type ActionExecution struct { - _ struct{} `type:"structure"` - - // The details of an error returned by a URL external to AWS. - ErrorDetails *ErrorDetails `locationName:"errorDetails" type:"structure"` - - // The external ID of the run of the action. - ExternalExecutionId *string `locationName:"externalExecutionId" min:"1" type:"string"` - - // The URL of a resource external to AWS that will be used when running the - // action, for example an external repository URL. - ExternalExecutionUrl *string `locationName:"externalExecutionUrl" min:"1" type:"string"` - - // The last status change of the action. - LastStatusChange *time.Time `locationName:"lastStatusChange" type:"timestamp" timestampFormat:"unix"` - - // The ARN of the user who last changed the pipeline. - LastUpdatedBy *string `locationName:"lastUpdatedBy" type:"string"` - - // A percentage of completeness of the action as it runs. - PercentComplete *int64 `locationName:"percentComplete" type:"integer"` - - // The status of the action, or for a completed action, the last status of the - // action. - Status *string `locationName:"status" type:"string" enum:"ActionExecutionStatus"` - - // A summary of the run of the action. - Summary *string `locationName:"summary" type:"string"` - - // The system-generated token used to identify a unique approval request. The - // token for each open approval request can be obtained using the GetPipelineState - // command and is used to validate that the approval request corresponding to - // this token is still valid. - Token *string `locationName:"token" type:"string"` -} - -// String returns the string representation -func (s ActionExecution) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionExecution) GoString() string { - return s.String() -} - -// SetErrorDetails sets the ErrorDetails field's value. -func (s *ActionExecution) SetErrorDetails(v *ErrorDetails) *ActionExecution { - s.ErrorDetails = v - return s -} - -// SetExternalExecutionId sets the ExternalExecutionId field's value. -func (s *ActionExecution) SetExternalExecutionId(v string) *ActionExecution { - s.ExternalExecutionId = &v - return s -} - -// SetExternalExecutionUrl sets the ExternalExecutionUrl field's value. -func (s *ActionExecution) SetExternalExecutionUrl(v string) *ActionExecution { - s.ExternalExecutionUrl = &v - return s -} - -// SetLastStatusChange sets the LastStatusChange field's value. -func (s *ActionExecution) SetLastStatusChange(v time.Time) *ActionExecution { - s.LastStatusChange = &v - return s -} - -// SetLastUpdatedBy sets the LastUpdatedBy field's value. -func (s *ActionExecution) SetLastUpdatedBy(v string) *ActionExecution { - s.LastUpdatedBy = &v - return s -} - -// SetPercentComplete sets the PercentComplete field's value. -func (s *ActionExecution) SetPercentComplete(v int64) *ActionExecution { - s.PercentComplete = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ActionExecution) SetStatus(v string) *ActionExecution { - s.Status = &v - return s -} - -// SetSummary sets the Summary field's value. -func (s *ActionExecution) SetSummary(v string) *ActionExecution { - s.Summary = &v - return s -} - -// SetToken sets the Token field's value. -func (s *ActionExecution) SetToken(v string) *ActionExecution { - s.Token = &v - return s -} - -// Represents information about the version (or revision) of an action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionRevision -type ActionRevision struct { - _ struct{} `type:"structure"` - - // The date and time when the most recent version of the action was created, - // in timestamp format. - // - // Created is a required field - Created *time.Time `locationName:"created" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The unique identifier of the change that set the state to this revision, - // for example a deployment ID or timestamp. - // - // RevisionChangeId is a required field - RevisionChangeId *string `locationName:"revisionChangeId" min:"1" type:"string" required:"true"` - - // The system-generated unique ID that identifies the revision number of the - // action. - // - // RevisionId is a required field - RevisionId *string `locationName:"revisionId" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ActionRevision) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionRevision) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActionRevision) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActionRevision"} - if s.Created == nil { - invalidParams.Add(request.NewErrParamRequired("Created")) - } - if s.RevisionChangeId == nil { - invalidParams.Add(request.NewErrParamRequired("RevisionChangeId")) - } - if s.RevisionChangeId != nil && len(*s.RevisionChangeId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RevisionChangeId", 1)) - } - if s.RevisionId == nil { - invalidParams.Add(request.NewErrParamRequired("RevisionId")) - } - if s.RevisionId != nil && len(*s.RevisionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RevisionId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreated sets the Created field's value. -func (s *ActionRevision) SetCreated(v time.Time) *ActionRevision { - s.Created = &v - return s -} - -// SetRevisionChangeId sets the RevisionChangeId field's value. -func (s *ActionRevision) SetRevisionChangeId(v string) *ActionRevision { - s.RevisionChangeId = &v - return s -} - -// SetRevisionId sets the RevisionId field's value. -func (s *ActionRevision) SetRevisionId(v string) *ActionRevision { - s.RevisionId = &v - return s -} - -// Represents information about the state of an action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionState -type ActionState struct { - _ struct{} `type:"structure"` - - // The name of the action. - ActionName *string `locationName:"actionName" min:"1" type:"string"` - - // Represents information about the version (or revision) of an action. - CurrentRevision *ActionRevision `locationName:"currentRevision" type:"structure"` - - // A URL link for more information about the state of the action, such as a - // deployment group details page. - EntityUrl *string `locationName:"entityUrl" min:"1" type:"string"` - - // Represents information about the run of an action. - LatestExecution *ActionExecution `locationName:"latestExecution" type:"structure"` - - // A URL link for more information about the revision, such as a commit details - // page. - RevisionUrl *string `locationName:"revisionUrl" min:"1" type:"string"` -} - -// String returns the string representation -func (s ActionState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionState) GoString() string { - return s.String() -} - -// SetActionName sets the ActionName field's value. -func (s *ActionState) SetActionName(v string) *ActionState { - s.ActionName = &v - return s -} - -// SetCurrentRevision sets the CurrentRevision field's value. -func (s *ActionState) SetCurrentRevision(v *ActionRevision) *ActionState { - s.CurrentRevision = v - return s -} - -// SetEntityUrl sets the EntityUrl field's value. -func (s *ActionState) SetEntityUrl(v string) *ActionState { - s.EntityUrl = &v - return s -} - -// SetLatestExecution sets the LatestExecution field's value. -func (s *ActionState) SetLatestExecution(v *ActionExecution) *ActionState { - s.LatestExecution = v - return s -} - -// SetRevisionUrl sets the RevisionUrl field's value. -func (s *ActionState) SetRevisionUrl(v string) *ActionState { - s.RevisionUrl = &v - return s -} - -// Returns information about the details of an action type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionType -type ActionType struct { - _ struct{} `type:"structure"` - - // The configuration properties for the action type. - ActionConfigurationProperties []*ActionConfigurationProperty `locationName:"actionConfigurationProperties" type:"list"` - - // Represents information about an action type. - // - // Id is a required field - Id *ActionTypeId `locationName:"id" type:"structure" required:"true"` - - // The details of the input artifact for the action, such as its commit ID. - // - // InputArtifactDetails is a required field - InputArtifactDetails *ArtifactDetails `locationName:"inputArtifactDetails" type:"structure" required:"true"` - - // The details of the output artifact of the action, such as its commit ID. - // - // OutputArtifactDetails is a required field - OutputArtifactDetails *ArtifactDetails `locationName:"outputArtifactDetails" type:"structure" required:"true"` - - // The settings for the action type. - Settings *ActionTypeSettings `locationName:"settings" type:"structure"` -} - -// String returns the string representation -func (s ActionType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionType) GoString() string { - return s.String() -} - -// SetActionConfigurationProperties sets the ActionConfigurationProperties field's value. -func (s *ActionType) SetActionConfigurationProperties(v []*ActionConfigurationProperty) *ActionType { - s.ActionConfigurationProperties = v - return s -} - -// SetId sets the Id field's value. -func (s *ActionType) SetId(v *ActionTypeId) *ActionType { - s.Id = v - return s -} - -// SetInputArtifactDetails sets the InputArtifactDetails field's value. -func (s *ActionType) SetInputArtifactDetails(v *ArtifactDetails) *ActionType { - s.InputArtifactDetails = v - return s -} - -// SetOutputArtifactDetails sets the OutputArtifactDetails field's value. -func (s *ActionType) SetOutputArtifactDetails(v *ArtifactDetails) *ActionType { - s.OutputArtifactDetails = v - return s -} - -// SetSettings sets the Settings field's value. -func (s *ActionType) SetSettings(v *ActionTypeSettings) *ActionType { - s.Settings = v - return s -} - -// Represents information about an action type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionTypeId -type ActionTypeId struct { - _ struct{} `type:"structure"` - - // A category defines what kind of action can be taken in the stage, and constrains - // the provider type for the action. Valid categories are limited to one of - // the values below. - // - // Category is a required field - Category *string `locationName:"category" type:"string" required:"true" enum:"ActionCategory"` - - // The creator of the action being called. - // - // Owner is a required field - Owner *string `locationName:"owner" type:"string" required:"true" enum:"ActionOwner"` - - // The provider of the service being called by the action. Valid providers are - // determined by the action category. For example, an action in the Deploy category - // type might have a provider of AWS CodeDeploy, which would be specified as - // CodeDeploy. - // - // Provider is a required field - Provider *string `locationName:"provider" min:"1" type:"string" required:"true"` - - // A string that identifies the action type. - // - // Version is a required field - Version *string `locationName:"version" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ActionTypeId) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionTypeId) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActionTypeId) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActionTypeId"} - if s.Category == nil { - invalidParams.Add(request.NewErrParamRequired("Category")) - } - if s.Owner == nil { - invalidParams.Add(request.NewErrParamRequired("Owner")) - } - if s.Provider == nil { - invalidParams.Add(request.NewErrParamRequired("Provider")) - } - if s.Provider != nil && len(*s.Provider) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Provider", 1)) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && len(*s.Version) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Version", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCategory sets the Category field's value. -func (s *ActionTypeId) SetCategory(v string) *ActionTypeId { - s.Category = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *ActionTypeId) SetOwner(v string) *ActionTypeId { - s.Owner = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *ActionTypeId) SetProvider(v string) *ActionTypeId { - s.Provider = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *ActionTypeId) SetVersion(v string) *ActionTypeId { - s.Version = &v - return s -} - -// Returns information about the settings for an action type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ActionTypeSettings -type ActionTypeSettings struct { - _ struct{} `type:"structure"` - - // The URL returned to the AWS CodePipeline console that provides a deep link - // to the resources of the external system, such as the configuration page for - // an AWS CodeDeploy deployment group. This link is provided as part of the - // action display within the pipeline. - EntityUrlTemplate *string `locationName:"entityUrlTemplate" min:"1" type:"string"` - - // The URL returned to the AWS CodePipeline console that contains a link to - // the top-level landing page for the external system, such as console page - // for AWS CodeDeploy. This link is shown on the pipeline view page in the AWS - // CodePipeline console and provides a link to the execution entity of the external - // action. - ExecutionUrlTemplate *string `locationName:"executionUrlTemplate" min:"1" type:"string"` - - // The URL returned to the AWS CodePipeline console that contains a link to - // the page where customers can update or change the configuration of the external - // action. - RevisionUrlTemplate *string `locationName:"revisionUrlTemplate" min:"1" type:"string"` - - // The URL of a sign-up page where users can sign up for an external service - // and perform initial configuration of the action provided by that service. - ThirdPartyConfigurationUrl *string `locationName:"thirdPartyConfigurationUrl" min:"1" type:"string"` -} - -// String returns the string representation -func (s ActionTypeSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActionTypeSettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActionTypeSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActionTypeSettings"} - if s.EntityUrlTemplate != nil && len(*s.EntityUrlTemplate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EntityUrlTemplate", 1)) - } - if s.ExecutionUrlTemplate != nil && len(*s.ExecutionUrlTemplate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionUrlTemplate", 1)) - } - if s.RevisionUrlTemplate != nil && len(*s.RevisionUrlTemplate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RevisionUrlTemplate", 1)) - } - if s.ThirdPartyConfigurationUrl != nil && len(*s.ThirdPartyConfigurationUrl) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ThirdPartyConfigurationUrl", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntityUrlTemplate sets the EntityUrlTemplate field's value. -func (s *ActionTypeSettings) SetEntityUrlTemplate(v string) *ActionTypeSettings { - s.EntityUrlTemplate = &v - return s -} - -// SetExecutionUrlTemplate sets the ExecutionUrlTemplate field's value. -func (s *ActionTypeSettings) SetExecutionUrlTemplate(v string) *ActionTypeSettings { - s.ExecutionUrlTemplate = &v - return s -} - -// SetRevisionUrlTemplate sets the RevisionUrlTemplate field's value. -func (s *ActionTypeSettings) SetRevisionUrlTemplate(v string) *ActionTypeSettings { - s.RevisionUrlTemplate = &v - return s -} - -// SetThirdPartyConfigurationUrl sets the ThirdPartyConfigurationUrl field's value. -func (s *ActionTypeSettings) SetThirdPartyConfigurationUrl(v string) *ActionTypeSettings { - s.ThirdPartyConfigurationUrl = &v - return s -} - -// Represents information about the result of an approval request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ApprovalResult -type ApprovalResult struct { - _ struct{} `type:"structure"` - - // The response submitted by a reviewer assigned to an approval action request. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ApprovalStatus"` - - // The summary of the current status of the approval request. - // - // Summary is a required field - Summary *string `locationName:"summary" type:"string" required:"true"` -} - -// String returns the string representation -func (s ApprovalResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApprovalResult) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApprovalResult) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApprovalResult"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.Summary == nil { - invalidParams.Add(request.NewErrParamRequired("Summary")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatus sets the Status field's value. -func (s *ApprovalResult) SetStatus(v string) *ApprovalResult { - s.Status = &v - return s -} - -// SetSummary sets the Summary field's value. -func (s *ApprovalResult) SetSummary(v string) *ApprovalResult { - s.Summary = &v - return s -} - -// Represents information about an artifact that will be worked upon by actions -// in the pipeline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/Artifact -type Artifact struct { - _ struct{} `type:"structure"` - - // The location of an artifact. - Location *ArtifactLocation `locationName:"location" type:"structure"` - - // The artifact's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The artifact's revision ID. Depending on the type of object, this could be - // a commit ID (GitHub) or a revision ID (Amazon S3). - Revision *string `locationName:"revision" min:"1" type:"string"` -} - -// String returns the string representation -func (s Artifact) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Artifact) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *Artifact) SetLocation(v *ArtifactLocation) *Artifact { - s.Location = v - return s -} - -// SetName sets the Name field's value. -func (s *Artifact) SetName(v string) *Artifact { - s.Name = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *Artifact) SetRevision(v string) *Artifact { - s.Revision = &v - return s -} - -// Returns information about the details of an artifact. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ArtifactDetails -type ArtifactDetails struct { - _ struct{} `type:"structure"` - - // The maximum number of artifacts allowed for the action type. - // - // MaximumCount is a required field - MaximumCount *int64 `locationName:"maximumCount" type:"integer" required:"true"` - - // The minimum number of artifacts allowed for the action type. - // - // MinimumCount is a required field - MinimumCount *int64 `locationName:"minimumCount" type:"integer" required:"true"` -} - -// String returns the string representation -func (s ArtifactDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ArtifactDetails) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ArtifactDetails) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ArtifactDetails"} - if s.MaximumCount == nil { - invalidParams.Add(request.NewErrParamRequired("MaximumCount")) - } - if s.MinimumCount == nil { - invalidParams.Add(request.NewErrParamRequired("MinimumCount")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaximumCount sets the MaximumCount field's value. -func (s *ArtifactDetails) SetMaximumCount(v int64) *ArtifactDetails { - s.MaximumCount = &v - return s -} - -// SetMinimumCount sets the MinimumCount field's value. -func (s *ArtifactDetails) SetMinimumCount(v int64) *ArtifactDetails { - s.MinimumCount = &v - return s -} - -// Represents information about the location of an artifact. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ArtifactLocation -type ArtifactLocation struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket that contains the artifact. - S3Location *S3ArtifactLocation `locationName:"s3Location" type:"structure"` - - // The type of artifact in the location. - Type *string `locationName:"type" type:"string" enum:"ArtifactLocationType"` -} - -// String returns the string representation -func (s ArtifactLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ArtifactLocation) GoString() string { - return s.String() -} - -// SetS3Location sets the S3Location field's value. -func (s *ArtifactLocation) SetS3Location(v *S3ArtifactLocation) *ArtifactLocation { - s.S3Location = v - return s -} - -// SetType sets the Type field's value. -func (s *ArtifactLocation) SetType(v string) *ArtifactLocation { - s.Type = &v - return s -} - -// Represents revision details of an artifact. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ArtifactRevision -type ArtifactRevision struct { - _ struct{} `type:"structure"` - - // The date and time when the most recent revision of the artifact was created, - // in timestamp format. - Created *time.Time `locationName:"created" type:"timestamp" timestampFormat:"unix"` - - // The name of an artifact. This name might be system-generated, such as "MyApp", - // or might be defined by the user when an action is created. - Name *string `locationName:"name" min:"1" type:"string"` - - // An additional identifier for a revision, such as a commit date or, for artifacts - // stored in Amazon S3 buckets, the ETag value. - RevisionChangeIdentifier *string `locationName:"revisionChangeIdentifier" min:"1" type:"string"` - - // The revision ID of the artifact. - RevisionId *string `locationName:"revisionId" min:"1" type:"string"` - - // Summary information about the most recent revision of the artifact. For GitHub - // and AWS CodeCommit repositories, the commit message. For Amazon S3 buckets - // or actions, the user-provided content of a codepipeline-artifact-revision-summary - // key specified in the object metadata. - RevisionSummary *string `locationName:"revisionSummary" min:"1" type:"string"` - - // The commit ID for the artifact revision. For artifacts stored in GitHub or - // AWS CodeCommit repositories, the commit ID is linked to a commit details - // page. - RevisionUrl *string `locationName:"revisionUrl" min:"1" type:"string"` -} - -// String returns the string representation -func (s ArtifactRevision) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ArtifactRevision) GoString() string { - return s.String() -} - -// SetCreated sets the Created field's value. -func (s *ArtifactRevision) SetCreated(v time.Time) *ArtifactRevision { - s.Created = &v - return s -} - -// SetName sets the Name field's value. -func (s *ArtifactRevision) SetName(v string) *ArtifactRevision { - s.Name = &v - return s -} - -// SetRevisionChangeIdentifier sets the RevisionChangeIdentifier field's value. -func (s *ArtifactRevision) SetRevisionChangeIdentifier(v string) *ArtifactRevision { - s.RevisionChangeIdentifier = &v - return s -} - -// SetRevisionId sets the RevisionId field's value. -func (s *ArtifactRevision) SetRevisionId(v string) *ArtifactRevision { - s.RevisionId = &v - return s -} - -// SetRevisionSummary sets the RevisionSummary field's value. -func (s *ArtifactRevision) SetRevisionSummary(v string) *ArtifactRevision { - s.RevisionSummary = &v - return s -} - -// SetRevisionUrl sets the RevisionUrl field's value. -func (s *ArtifactRevision) SetRevisionUrl(v string) *ArtifactRevision { - s.RevisionUrl = &v - return s -} - -// The Amazon S3 location where artifacts are stored for the pipeline. If this -// Amazon S3 bucket is created manually, it must meet the requirements for AWS -// CodePipeline. For more information, see the Concepts (http://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#CPS3Bucket). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ArtifactStore -type ArtifactStore struct { - _ struct{} `type:"structure"` - - // The encryption key used to encrypt the data in the artifact store, such as - // an AWS Key Management Service (AWS KMS) key. If this is undefined, the default - // key for Amazon S3 is used. - EncryptionKey *EncryptionKey `locationName:"encryptionKey" type:"structure"` - - // The location for storing the artifacts for a pipeline, such as an S3 bucket - // or folder. - // - // Location is a required field - Location *string `locationName:"location" min:"3" type:"string" required:"true"` - - // The type of the artifact store, such as S3. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"ArtifactStoreType"` -} - -// String returns the string representation -func (s ArtifactStore) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ArtifactStore) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ArtifactStore) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ArtifactStore"} - if s.Location == nil { - invalidParams.Add(request.NewErrParamRequired("Location")) - } - if s.Location != nil && len(*s.Location) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Location", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.EncryptionKey != nil { - if err := s.EncryptionKey.Validate(); err != nil { - invalidParams.AddNested("EncryptionKey", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *ArtifactStore) SetEncryptionKey(v *EncryptionKey) *ArtifactStore { - s.EncryptionKey = v - return s -} - -// SetLocation sets the Location field's value. -func (s *ArtifactStore) SetLocation(v string) *ArtifactStore { - s.Location = &v - return s -} - -// SetType sets the Type field's value. -func (s *ArtifactStore) SetType(v string) *ArtifactStore { - s.Type = &v - return s -} - -// Reserved for future use. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/BlockerDeclaration -type BlockerDeclaration struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Reserved for future use. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"BlockerType"` -} - -// String returns the string representation -func (s BlockerDeclaration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BlockerDeclaration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BlockerDeclaration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BlockerDeclaration"} - 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.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *BlockerDeclaration) SetName(v string) *BlockerDeclaration { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *BlockerDeclaration) SetType(v string) *BlockerDeclaration { - s.Type = &v - return s -} - -// Represents the input of a create custom action operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreateCustomActionTypeInput -type CreateCustomActionTypeInput struct { - _ struct{} `type:"structure"` - - // The category of the custom action, such as a build action or a test action. - // - // Although Source and Approval are listed as valid values, they are not currently - // functional. These values are reserved for future use. - // - // Category is a required field - Category *string `locationName:"category" type:"string" required:"true" enum:"ActionCategory"` - - // The configuration properties for the custom action. - // - // You can refer to a name in the configuration properties of the custom action - // within the URL templates by following the format of {Config:name}, as long - // as the configuration property is both required and not secret. For more information, - // see Create a Custom Action for a Pipeline (http://docs.aws.amazon.com/codepipeline/latest/userguide/how-to-create-custom-action.html). - ConfigurationProperties []*ActionConfigurationProperty `locationName:"configurationProperties" type:"list"` - - // Returns information about the details of an artifact. - // - // InputArtifactDetails is a required field - InputArtifactDetails *ArtifactDetails `locationName:"inputArtifactDetails" type:"structure" required:"true"` - - // Returns information about the details of an artifact. - // - // OutputArtifactDetails is a required field - OutputArtifactDetails *ArtifactDetails `locationName:"outputArtifactDetails" type:"structure" required:"true"` - - // The provider of the service used in the custom action, such as AWS CodeDeploy. - // - // Provider is a required field - Provider *string `locationName:"provider" min:"1" type:"string" required:"true"` - - // Returns information about the settings for an action type. - Settings *ActionTypeSettings `locationName:"settings" type:"structure"` - - // The version identifier of the custom action. - // - // Version is a required field - Version *string `locationName:"version" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateCustomActionTypeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCustomActionTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCustomActionTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCustomActionTypeInput"} - if s.Category == nil { - invalidParams.Add(request.NewErrParamRequired("Category")) - } - if s.InputArtifactDetails == nil { - invalidParams.Add(request.NewErrParamRequired("InputArtifactDetails")) - } - if s.OutputArtifactDetails == nil { - invalidParams.Add(request.NewErrParamRequired("OutputArtifactDetails")) - } - if s.Provider == nil { - invalidParams.Add(request.NewErrParamRequired("Provider")) - } - if s.Provider != nil && len(*s.Provider) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Provider", 1)) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && len(*s.Version) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Version", 1)) - } - if s.ConfigurationProperties != nil { - for i, v := range s.ConfigurationProperties { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ConfigurationProperties", i), err.(request.ErrInvalidParams)) - } - } - } - if s.InputArtifactDetails != nil { - if err := s.InputArtifactDetails.Validate(); err != nil { - invalidParams.AddNested("InputArtifactDetails", err.(request.ErrInvalidParams)) - } - } - if s.OutputArtifactDetails != nil { - if err := s.OutputArtifactDetails.Validate(); err != nil { - invalidParams.AddNested("OutputArtifactDetails", err.(request.ErrInvalidParams)) - } - } - if s.Settings != nil { - if err := s.Settings.Validate(); err != nil { - invalidParams.AddNested("Settings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCategory sets the Category field's value. -func (s *CreateCustomActionTypeInput) SetCategory(v string) *CreateCustomActionTypeInput { - s.Category = &v - return s -} - -// SetConfigurationProperties sets the ConfigurationProperties field's value. -func (s *CreateCustomActionTypeInput) SetConfigurationProperties(v []*ActionConfigurationProperty) *CreateCustomActionTypeInput { - s.ConfigurationProperties = v - return s -} - -// SetInputArtifactDetails sets the InputArtifactDetails field's value. -func (s *CreateCustomActionTypeInput) SetInputArtifactDetails(v *ArtifactDetails) *CreateCustomActionTypeInput { - s.InputArtifactDetails = v - return s -} - -// SetOutputArtifactDetails sets the OutputArtifactDetails field's value. -func (s *CreateCustomActionTypeInput) SetOutputArtifactDetails(v *ArtifactDetails) *CreateCustomActionTypeInput { - s.OutputArtifactDetails = v - return s -} - -// SetProvider sets the Provider field's value. -func (s *CreateCustomActionTypeInput) SetProvider(v string) *CreateCustomActionTypeInput { - s.Provider = &v - return s -} - -// SetSettings sets the Settings field's value. -func (s *CreateCustomActionTypeInput) SetSettings(v *ActionTypeSettings) *CreateCustomActionTypeInput { - s.Settings = v - return s -} - -// SetVersion sets the Version field's value. -func (s *CreateCustomActionTypeInput) SetVersion(v string) *CreateCustomActionTypeInput { - s.Version = &v - return s -} - -// Represents the output of a create custom action operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreateCustomActionTypeOutput -type CreateCustomActionTypeOutput struct { - _ struct{} `type:"structure"` - - // Returns information about the details of an action type. - // - // ActionType is a required field - ActionType *ActionType `locationName:"actionType" type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateCustomActionTypeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCustomActionTypeOutput) GoString() string { - return s.String() -} - -// SetActionType sets the ActionType field's value. -func (s *CreateCustomActionTypeOutput) SetActionType(v *ActionType) *CreateCustomActionTypeOutput { - s.ActionType = v - return s -} - -// Represents the input of a create pipeline action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreatePipelineInput -type CreatePipelineInput struct { - _ struct{} `type:"structure"` - - // Represents the structure of actions and stages to be performed in the pipeline. - // - // Pipeline is a required field - Pipeline *PipelineDeclaration `locationName:"pipeline" type:"structure" required:"true"` -} - -// 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.Pipeline == nil { - invalidParams.Add(request.NewErrParamRequired("Pipeline")) - } - if s.Pipeline != nil { - if err := s.Pipeline.Validate(); err != nil { - invalidParams.AddNested("Pipeline", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipeline sets the Pipeline field's value. -func (s *CreatePipelineInput) SetPipeline(v *PipelineDeclaration) *CreatePipelineInput { - s.Pipeline = v - return s -} - -// Represents the output of a create pipeline action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreatePipelineOutput -type CreatePipelineOutput struct { - _ struct{} `type:"structure"` - - // Represents the structure of actions and stages to be performed in the pipeline. - Pipeline *PipelineDeclaration `locationName:"pipeline" type:"structure"` -} - -// 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 *PipelineDeclaration) *CreatePipelineOutput { - s.Pipeline = v - return s -} - -// Represents information about a current revision. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CurrentRevision -type CurrentRevision struct { - _ struct{} `type:"structure"` - - // The change identifier for the current revision. - // - // ChangeIdentifier is a required field - ChangeIdentifier *string `locationName:"changeIdentifier" min:"1" type:"string" required:"true"` - - // The date and time when the most recent revision of the artifact was created, - // in timestamp format. - Created *time.Time `locationName:"created" type:"timestamp" timestampFormat:"unix"` - - // The revision ID of the current version of an artifact. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The summary of the most recent revision of the artifact. - RevisionSummary *string `locationName:"revisionSummary" min:"1" type:"string"` -} - -// String returns the string representation -func (s CurrentRevision) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CurrentRevision) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CurrentRevision) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CurrentRevision"} - if s.ChangeIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeIdentifier")) - } - if s.ChangeIdentifier != nil && len(*s.ChangeIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeIdentifier", 1)) - } - if s.Revision == nil { - invalidParams.Add(request.NewErrParamRequired("Revision")) - } - if s.Revision != nil && len(*s.Revision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Revision", 1)) - } - if s.RevisionSummary != nil && len(*s.RevisionSummary) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RevisionSummary", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeIdentifier sets the ChangeIdentifier field's value. -func (s *CurrentRevision) SetChangeIdentifier(v string) *CurrentRevision { - s.ChangeIdentifier = &v - return s -} - -// SetCreated sets the Created field's value. -func (s *CurrentRevision) SetCreated(v time.Time) *CurrentRevision { - s.Created = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *CurrentRevision) SetRevision(v string) *CurrentRevision { - s.Revision = &v - return s -} - -// SetRevisionSummary sets the RevisionSummary field's value. -func (s *CurrentRevision) SetRevisionSummary(v string) *CurrentRevision { - s.RevisionSummary = &v - return s -} - -// Represents the input of a delete custom action operation. The custom action -// will be marked as deleted. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeleteCustomActionTypeInput -type DeleteCustomActionTypeInput struct { - _ struct{} `type:"structure"` - - // The category of the custom action that you want to delete, such as source - // or deploy. - // - // Category is a required field - Category *string `locationName:"category" type:"string" required:"true" enum:"ActionCategory"` - - // The provider of the service used in the custom action, such as AWS CodeDeploy. - // - // Provider is a required field - Provider *string `locationName:"provider" min:"1" type:"string" required:"true"` - - // The version of the custom action to delete. - // - // Version is a required field - Version *string `locationName:"version" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteCustomActionTypeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCustomActionTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCustomActionTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCustomActionTypeInput"} - if s.Category == nil { - invalidParams.Add(request.NewErrParamRequired("Category")) - } - if s.Provider == nil { - invalidParams.Add(request.NewErrParamRequired("Provider")) - } - if s.Provider != nil && len(*s.Provider) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Provider", 1)) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && len(*s.Version) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Version", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCategory sets the Category field's value. -func (s *DeleteCustomActionTypeInput) SetCategory(v string) *DeleteCustomActionTypeInput { - s.Category = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *DeleteCustomActionTypeInput) SetProvider(v string) *DeleteCustomActionTypeInput { - s.Provider = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *DeleteCustomActionTypeInput) SetVersion(v string) *DeleteCustomActionTypeInput { - s.Version = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeleteCustomActionTypeOutput -type DeleteCustomActionTypeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteCustomActionTypeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCustomActionTypeOutput) GoString() string { - return s.String() -} - -// Represents the input of a delete pipeline action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeletePipelineInput -type DeletePipelineInput struct { - _ struct{} `type:"structure"` - - // The name of the pipeline to be deleted. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeletePipelineInput) SetName(v string) *DeletePipelineInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeletePipelineOutput -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() -} - -// Represents the input of a disable stage transition input action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DisableStageTransitionInput -type DisableStageTransitionInput struct { - _ struct{} `type:"structure"` - - // The name of the pipeline in which you want to disable the flow of artifacts - // from one stage to another. - // - // PipelineName is a required field - PipelineName *string `locationName:"pipelineName" min:"1" type:"string" required:"true"` - - // The reason given to the user why a stage is disabled, such as waiting for - // manual approval or manual tests. This message is displayed in the pipeline - // console UI. - // - // Reason is a required field - Reason *string `locationName:"reason" min:"1" type:"string" required:"true"` - - // The name of the stage where you want to disable the inbound or outbound transition - // of artifacts. - // - // StageName is a required field - StageName *string `locationName:"stageName" min:"1" type:"string" required:"true"` - - // Specifies whether artifacts will be prevented from transitioning into the - // stage and being processed by the actions in that stage (inbound), or prevented - // from transitioning from the stage after they have been processed by the actions - // in that stage (outbound). - // - // TransitionType is a required field - TransitionType *string `locationName:"transitionType" type:"string" required:"true" enum:"StageTransitionType"` -} - -// String returns the string representation -func (s DisableStageTransitionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableStageTransitionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableStageTransitionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableStageTransitionInput"} - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 1)) - } - if s.Reason == nil { - invalidParams.Add(request.NewErrParamRequired("Reason")) - } - if s.Reason != nil && len(*s.Reason) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Reason", 1)) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - if s.StageName != nil && len(*s.StageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageName", 1)) - } - if s.TransitionType == nil { - invalidParams.Add(request.NewErrParamRequired("TransitionType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineName sets the PipelineName field's value. -func (s *DisableStageTransitionInput) SetPipelineName(v string) *DisableStageTransitionInput { - s.PipelineName = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *DisableStageTransitionInput) SetReason(v string) *DisableStageTransitionInput { - s.Reason = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *DisableStageTransitionInput) SetStageName(v string) *DisableStageTransitionInput { - s.StageName = &v - return s -} - -// SetTransitionType sets the TransitionType field's value. -func (s *DisableStageTransitionInput) SetTransitionType(v string) *DisableStageTransitionInput { - s.TransitionType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DisableStageTransitionOutput -type DisableStageTransitionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableStageTransitionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableStageTransitionOutput) GoString() string { - return s.String() -} - -// Represents the input of an enable stage transition action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/EnableStageTransitionInput -type EnableStageTransitionInput struct { - _ struct{} `type:"structure"` - - // The name of the pipeline in which you want to enable the flow of artifacts - // from one stage to another. - // - // PipelineName is a required field - PipelineName *string `locationName:"pipelineName" min:"1" type:"string" required:"true"` - - // The name of the stage where you want to enable the transition of artifacts, - // either into the stage (inbound) or from that stage to the next stage (outbound). - // - // StageName is a required field - StageName *string `locationName:"stageName" min:"1" type:"string" required:"true"` - - // Specifies whether artifacts will be allowed to enter the stage and be processed - // by the actions in that stage (inbound) or whether already-processed artifacts - // will be allowed to transition to the next stage (outbound). - // - // TransitionType is a required field - TransitionType *string `locationName:"transitionType" type:"string" required:"true" enum:"StageTransitionType"` -} - -// String returns the string representation -func (s EnableStageTransitionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableStageTransitionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableStageTransitionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableStageTransitionInput"} - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 1)) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - if s.StageName != nil && len(*s.StageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageName", 1)) - } - if s.TransitionType == nil { - invalidParams.Add(request.NewErrParamRequired("TransitionType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineName sets the PipelineName field's value. -func (s *EnableStageTransitionInput) SetPipelineName(v string) *EnableStageTransitionInput { - s.PipelineName = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *EnableStageTransitionInput) SetStageName(v string) *EnableStageTransitionInput { - s.StageName = &v - return s -} - -// SetTransitionType sets the TransitionType field's value. -func (s *EnableStageTransitionInput) SetTransitionType(v string) *EnableStageTransitionInput { - s.TransitionType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/EnableStageTransitionOutput -type EnableStageTransitionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableStageTransitionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableStageTransitionOutput) GoString() string { - return s.String() -} - -// Represents information about the key used to encrypt data in the artifact -// store, such as an AWS Key Management Service (AWS KMS) key. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/EncryptionKey -type EncryptionKey struct { - _ struct{} `type:"structure"` - - // The ID used to identify the key. For an AWS KMS key, this is the key ID or - // key ARN. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // The type of encryption key, such as an AWS Key Management Service (AWS KMS) - // key. When creating or updating a pipeline, the value must be set to 'KMS'. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"EncryptionKeyType"` -} - -// String returns the string representation -func (s EncryptionKey) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EncryptionKey) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptionKey) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptionKey"} - 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.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *EncryptionKey) SetId(v string) *EncryptionKey { - s.Id = &v - return s -} - -// SetType sets the Type field's value. -func (s *EncryptionKey) SetType(v string) *EncryptionKey { - s.Type = &v - return s -} - -// Represents information about an error in AWS CodePipeline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ErrorDetails -type ErrorDetails struct { - _ struct{} `type:"structure"` - - // The system ID or error number code of the error. - Code *string `locationName:"code" type:"string"` - - // The text of the error message. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s ErrorDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorDetails) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorDetails) SetCode(v string) *ErrorDetails { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorDetails) SetMessage(v string) *ErrorDetails { - s.Message = &v - return s -} - -// The details of the actions taken and results produced on an artifact as it -// passes through stages in the pipeline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ExecutionDetails -type ExecutionDetails struct { - _ struct{} `type:"structure"` - - // The system-generated unique ID of this action used to identify this job worker - // in any external systems, such as AWS CodeDeploy. - ExternalExecutionId *string `locationName:"externalExecutionId" min:"1" type:"string"` - - // The percentage of work completed on the action, represented on a scale of - // zero to one hundred percent. - PercentComplete *int64 `locationName:"percentComplete" type:"integer"` - - // The summary of the current status of the actions. - Summary *string `locationName:"summary" type:"string"` -} - -// String returns the string representation -func (s ExecutionDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutionDetails) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecutionDetails) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecutionDetails"} - if s.ExternalExecutionId != nil && len(*s.ExternalExecutionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExternalExecutionId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExternalExecutionId sets the ExternalExecutionId field's value. -func (s *ExecutionDetails) SetExternalExecutionId(v string) *ExecutionDetails { - s.ExternalExecutionId = &v - return s -} - -// SetPercentComplete sets the PercentComplete field's value. -func (s *ExecutionDetails) SetPercentComplete(v int64) *ExecutionDetails { - s.PercentComplete = &v - return s -} - -// SetSummary sets the Summary field's value. -func (s *ExecutionDetails) SetSummary(v string) *ExecutionDetails { - s.Summary = &v - return s -} - -// Represents information about failure details. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/FailureDetails -type FailureDetails struct { - _ struct{} `type:"structure"` - - // The external ID of the run of the action that failed. - ExternalExecutionId *string `locationName:"externalExecutionId" min:"1" type:"string"` - - // The message about the failure. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The type of the failure. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"FailureType"` -} - -// String returns the string representation -func (s FailureDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FailureDetails) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FailureDetails) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FailureDetails"} - if s.ExternalExecutionId != nil && len(*s.ExternalExecutionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExternalExecutionId", 1)) - } - if s.Message == nil { - invalidParams.Add(request.NewErrParamRequired("Message")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExternalExecutionId sets the ExternalExecutionId field's value. -func (s *FailureDetails) SetExternalExecutionId(v string) *FailureDetails { - s.ExternalExecutionId = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *FailureDetails) SetMessage(v string) *FailureDetails { - s.Message = &v - return s -} - -// SetType sets the Type field's value. -func (s *FailureDetails) SetType(v string) *FailureDetails { - s.Type = &v - return s -} - -// Represents the input of a get job details action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetJobDetailsInput -type GetJobDetailsInput struct { - _ struct{} `type:"structure"` - - // The unique system-generated ID for the job. - // - // JobId is a required field - JobId *string `locationName:"jobId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetJobDetailsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetJobDetailsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetJobDetailsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetJobDetailsInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobId sets the JobId field's value. -func (s *GetJobDetailsInput) SetJobId(v string) *GetJobDetailsInput { - s.JobId = &v - return s -} - -// Represents the output of a get job details action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetJobDetailsOutput -type GetJobDetailsOutput struct { - _ struct{} `type:"structure"` - - // The details of the job. - // - // If AWSSessionCredentials is used, a long-running job can call GetJobDetails - // again to obtain new credentials. - JobDetails *JobDetails `locationName:"jobDetails" type:"structure"` -} - -// String returns the string representation -func (s GetJobDetailsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetJobDetailsOutput) GoString() string { - return s.String() -} - -// SetJobDetails sets the JobDetails field's value. -func (s *GetJobDetailsOutput) SetJobDetails(v *JobDetails) *GetJobDetailsOutput { - s.JobDetails = v - return s -} - -// Represents the input of a get pipeline execution action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineExecutionInput -type GetPipelineExecutionInput struct { - _ struct{} `type:"structure"` - - // The ID of the pipeline execution about which you want to get execution details. - // - // PipelineExecutionId is a required field - PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string" required:"true"` - - // The name of the pipeline about which you want to get execution details. - // - // PipelineName is a required field - PipelineName *string `locationName:"pipelineName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPipelineExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPipelineExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPipelineExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPipelineExecutionInput"} - if s.PipelineExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineExecutionId")) - } - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineExecutionId sets the PipelineExecutionId field's value. -func (s *GetPipelineExecutionInput) SetPipelineExecutionId(v string) *GetPipelineExecutionInput { - s.PipelineExecutionId = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *GetPipelineExecutionInput) SetPipelineName(v string) *GetPipelineExecutionInput { - s.PipelineName = &v - return s -} - -// Represents the output of a get pipeline execution action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineExecutionOutput -type GetPipelineExecutionOutput struct { - _ struct{} `type:"structure"` - - // Represents information about the execution of a pipeline. - PipelineExecution *PipelineExecution `locationName:"pipelineExecution" type:"structure"` -} - -// String returns the string representation -func (s GetPipelineExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPipelineExecutionOutput) GoString() string { - return s.String() -} - -// SetPipelineExecution sets the PipelineExecution field's value. -func (s *GetPipelineExecutionOutput) SetPipelineExecution(v *PipelineExecution) *GetPipelineExecutionOutput { - s.PipelineExecution = v - return s -} - -// Represents the input of a get pipeline action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineInput -type GetPipelineInput struct { - _ struct{} `type:"structure"` - - // The name of the pipeline for which you want to get information. Pipeline - // names must be unique under an Amazon Web Services (AWS) user account. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The version number of the pipeline. If you do not specify a version, defaults - // to the most current version. - Version *int64 `locationName:"version" min:"1" type:"integer"` -} - -// String returns the string representation -func (s GetPipelineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPipelineInput"} - 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.Version != nil && *s.Version < 1 { - invalidParams.Add(request.NewErrParamMinValue("Version", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetPipelineInput) SetName(v string) *GetPipelineInput { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *GetPipelineInput) SetVersion(v int64) *GetPipelineInput { - s.Version = &v - return s -} - -// Represents the output of a get pipeline action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineOutput -type GetPipelineOutput struct { - _ struct{} `type:"structure"` - - // Represents the structure of actions and stages to be performed in the pipeline. - Pipeline *PipelineDeclaration `locationName:"pipeline" type:"structure"` -} - -// String returns the string representation -func (s GetPipelineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *GetPipelineOutput) SetPipeline(v *PipelineDeclaration) *GetPipelineOutput { - s.Pipeline = v - return s -} - -// Represents the input of a get pipeline state action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineStateInput -type GetPipelineStateInput struct { - _ struct{} `type:"structure"` - - // The name of the pipeline about which you want to get information. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPipelineStateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPipelineStateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPipelineStateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPipelineStateInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetPipelineStateInput) SetName(v string) *GetPipelineStateInput { - s.Name = &v - return s -} - -// Represents the output of a get pipeline state action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineStateOutput -type GetPipelineStateOutput struct { - _ struct{} `type:"structure"` - - // The date and time the pipeline was created, in timestamp format. - Created *time.Time `locationName:"created" type:"timestamp" timestampFormat:"unix"` - - // The name of the pipeline for which you want to get the state. - PipelineName *string `locationName:"pipelineName" min:"1" type:"string"` - - // The version number of the pipeline. - // - // A newly-created pipeline is always assigned a version number of 1. - PipelineVersion *int64 `locationName:"pipelineVersion" min:"1" type:"integer"` - - // A list of the pipeline stage output information, including stage name, state, - // most recent run details, whether the stage is disabled, and other data. - StageStates []*StageState `locationName:"stageStates" type:"list"` - - // The date and time the pipeline was last updated, in timestamp format. - Updated *time.Time `locationName:"updated" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s GetPipelineStateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPipelineStateOutput) GoString() string { - return s.String() -} - -// SetCreated sets the Created field's value. -func (s *GetPipelineStateOutput) SetCreated(v time.Time) *GetPipelineStateOutput { - s.Created = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *GetPipelineStateOutput) SetPipelineName(v string) *GetPipelineStateOutput { - s.PipelineName = &v - return s -} - -// SetPipelineVersion sets the PipelineVersion field's value. -func (s *GetPipelineStateOutput) SetPipelineVersion(v int64) *GetPipelineStateOutput { - s.PipelineVersion = &v - return s -} - -// SetStageStates sets the StageStates field's value. -func (s *GetPipelineStateOutput) SetStageStates(v []*StageState) *GetPipelineStateOutput { - s.StageStates = v - return s -} - -// SetUpdated sets the Updated field's value. -func (s *GetPipelineStateOutput) SetUpdated(v time.Time) *GetPipelineStateOutput { - s.Updated = &v - return s -} - -// Represents the input of a get third party job details action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetThirdPartyJobDetailsInput -type GetThirdPartyJobDetailsInput struct { - _ struct{} `type:"structure"` - - // The clientToken portion of the clientId and clientToken pair used to verify - // that the calling entity is allowed access to the job and its details. - // - // ClientToken is a required field - ClientToken *string `locationName:"clientToken" type:"string" required:"true"` - - // The unique system-generated ID used for identifying the job. - // - // JobId is a required field - JobId *string `locationName:"jobId" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetThirdPartyJobDetailsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetThirdPartyJobDetailsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetThirdPartyJobDetailsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetThirdPartyJobDetailsInput"} - if s.ClientToken == nil { - invalidParams.Add(request.NewErrParamRequired("ClientToken")) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *GetThirdPartyJobDetailsInput) SetClientToken(v string) *GetThirdPartyJobDetailsInput { - s.ClientToken = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *GetThirdPartyJobDetailsInput) SetJobId(v string) *GetThirdPartyJobDetailsInput { - s.JobId = &v - return s -} - -// Represents the output of a get third party job details action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetThirdPartyJobDetailsOutput -type GetThirdPartyJobDetailsOutput struct { - _ struct{} `type:"structure"` - - // The details of the job, including any protected values defined for the job. - JobDetails *ThirdPartyJobDetails `locationName:"jobDetails" type:"structure"` -} - -// String returns the string representation -func (s GetThirdPartyJobDetailsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetThirdPartyJobDetailsOutput) GoString() string { - return s.String() -} - -// SetJobDetails sets the JobDetails field's value. -func (s *GetThirdPartyJobDetailsOutput) SetJobDetails(v *ThirdPartyJobDetails) *GetThirdPartyJobDetailsOutput { - s.JobDetails = v - return s -} - -// Represents information about an artifact to be worked on, such as a test -// or build artifact. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/InputArtifact -type InputArtifact struct { - _ struct{} `type:"structure"` - - // The name of the artifact to be worked on, for example, "My App". - // - // The input artifact of an action must exactly match the output artifact declared - // in a preceding action, but the input artifact does not have to be the next - // action in strict sequence from the action that provided the output artifact. - // Actions in parallel can declare different output artifacts, which are in - // turn consumed by different following actions. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s InputArtifact) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InputArtifact) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputArtifact) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputArtifact"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *InputArtifact) SetName(v string) *InputArtifact { - s.Name = &v - return s -} - -// Represents information about a job. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/Job -type Job struct { - _ struct{} `type:"structure"` - - // The ID of the AWS account to use when performing the job. - AccountId *string `locationName:"accountId" type:"string"` - - // Additional data about a job. - Data *JobData `locationName:"data" type:"structure"` - - // The unique system-generated ID of the job. - Id *string `locationName:"id" type:"string"` - - // A system-generated random number that AWS CodePipeline uses to ensure that - // the job is being worked on by only one job worker. Use this number in an - // AcknowledgeJob request. - Nonce *string `locationName:"nonce" type:"string"` -} - -// 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() -} - -// SetAccountId sets the AccountId field's value. -func (s *Job) SetAccountId(v string) *Job { - s.AccountId = &v - return s -} - -// SetData sets the Data field's value. -func (s *Job) SetData(v *JobData) *Job { - s.Data = v - return s -} - -// SetId sets the Id field's value. -func (s *Job) SetId(v string) *Job { - s.Id = &v - return s -} - -// SetNonce sets the Nonce field's value. -func (s *Job) SetNonce(v string) *Job { - s.Nonce = &v - return s -} - -// Represents additional information about a job required for a job worker to -// complete the job. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/JobData -type JobData struct { - _ struct{} `type:"structure"` - - // Represents information about an action configuration. - ActionConfiguration *ActionConfiguration `locationName:"actionConfiguration" type:"structure"` - - // Represents information about an action type. - ActionTypeId *ActionTypeId `locationName:"actionTypeId" type:"structure"` - - // Represents an AWS session credentials object. These credentials are temporary - // credentials that are issued by AWS Secure Token Service (STS). They can be - // used to access input and output artifacts in the Amazon S3 bucket used to - // store artifact for the pipeline in AWS CodePipeline. - ArtifactCredentials *AWSSessionCredentials `locationName:"artifactCredentials" type:"structure"` - - // A system-generated token, such as a AWS CodeDeploy deployment ID, that a - // job requires in order to continue the job asynchronously. - ContinuationToken *string `locationName:"continuationToken" type:"string"` - - // Represents information about the key used to encrypt data in the artifact - // store, such as an AWS Key Management Service (AWS KMS) key. - EncryptionKey *EncryptionKey `locationName:"encryptionKey" type:"structure"` - - // The artifact supplied to the job. - InputArtifacts []*Artifact `locationName:"inputArtifacts" type:"list"` - - // The output of the job. - OutputArtifacts []*Artifact `locationName:"outputArtifacts" type:"list"` - - // Represents information about a pipeline to a job worker. - PipelineContext *PipelineContext `locationName:"pipelineContext" type:"structure"` -} - -// String returns the string representation -func (s JobData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobData) GoString() string { - return s.String() -} - -// SetActionConfiguration sets the ActionConfiguration field's value. -func (s *JobData) SetActionConfiguration(v *ActionConfiguration) *JobData { - s.ActionConfiguration = v - return s -} - -// SetActionTypeId sets the ActionTypeId field's value. -func (s *JobData) SetActionTypeId(v *ActionTypeId) *JobData { - s.ActionTypeId = v - return s -} - -// SetArtifactCredentials sets the ArtifactCredentials field's value. -func (s *JobData) SetArtifactCredentials(v *AWSSessionCredentials) *JobData { - s.ArtifactCredentials = v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *JobData) SetContinuationToken(v string) *JobData { - s.ContinuationToken = &v - return s -} - -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *JobData) SetEncryptionKey(v *EncryptionKey) *JobData { - s.EncryptionKey = v - return s -} - -// SetInputArtifacts sets the InputArtifacts field's value. -func (s *JobData) SetInputArtifacts(v []*Artifact) *JobData { - s.InputArtifacts = v - return s -} - -// SetOutputArtifacts sets the OutputArtifacts field's value. -func (s *JobData) SetOutputArtifacts(v []*Artifact) *JobData { - s.OutputArtifacts = v - return s -} - -// SetPipelineContext sets the PipelineContext field's value. -func (s *JobData) SetPipelineContext(v *PipelineContext) *JobData { - s.PipelineContext = v - return s -} - -// Represents information about the details of a job. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/JobDetails -type JobDetails struct { - _ struct{} `type:"structure"` - - // The AWS account ID associated with the job. - AccountId *string `locationName:"accountId" type:"string"` - - // Represents additional information about a job required for a job worker to - // complete the job. - Data *JobData `locationName:"data" type:"structure"` - - // The unique system-generated ID of the job. - Id *string `locationName:"id" type:"string"` -} - -// String returns the string representation -func (s JobDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobDetails) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *JobDetails) SetAccountId(v string) *JobDetails { - s.AccountId = &v - return s -} - -// SetData sets the Data field's value. -func (s *JobDetails) SetData(v *JobData) *JobDetails { - s.Data = v - return s -} - -// SetId sets the Id field's value. -func (s *JobDetails) SetId(v string) *JobDetails { - s.Id = &v - return s -} - -// Represents the input of a list action types action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListActionTypesInput -type ListActionTypesInput struct { - _ struct{} `type:"structure"` - - // Filters the list of action types to those created by a specified entity. - ActionOwnerFilter *string `locationName:"actionOwnerFilter" type:"string" enum:"ActionOwner"` - - // An identifier that was returned from the previous list action types call, - // which can be used to return the next set of action types in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListActionTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListActionTypesInput) GoString() string { - return s.String() -} - -// SetActionOwnerFilter sets the ActionOwnerFilter field's value. -func (s *ListActionTypesInput) SetActionOwnerFilter(v string) *ListActionTypesInput { - s.ActionOwnerFilter = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListActionTypesInput) SetNextToken(v string) *ListActionTypesInput { - s.NextToken = &v - return s -} - -// Represents the output of a list action types action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListActionTypesOutput -type ListActionTypesOutput struct { - _ struct{} `type:"structure"` - - // Provides details of the action types. - // - // ActionTypes is a required field - ActionTypes []*ActionType `locationName:"actionTypes" type:"list" required:"true"` - - // If the amount of returned information is significantly large, an identifier - // is also returned which can be used in a subsequent list action types call - // to return the next set of action types in the list. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListActionTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListActionTypesOutput) GoString() string { - return s.String() -} - -// SetActionTypes sets the ActionTypes field's value. -func (s *ListActionTypesOutput) SetActionTypes(v []*ActionType) *ListActionTypesOutput { - s.ActionTypes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListActionTypesOutput) SetNextToken(v string) *ListActionTypesOutput { - s.NextToken = &v - return s -} - -// Represents the input of a list pipelines action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelinesInput -type ListPipelinesInput struct { - _ struct{} `type:"structure"` - - // An identifier that was returned from the previous list pipelines call, which - // can be used to return the next set of pipelines in the list. - NextToken *string `locationName:"nextToken" 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() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPipelinesInput) SetNextToken(v string) *ListPipelinesInput { - s.NextToken = &v - return s -} - -// Represents the output of a list pipelines action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelinesOutput -type ListPipelinesOutput struct { - _ struct{} `type:"structure"` - - // If the amount of returned information is significantly large, an identifier - // is also returned which can be used in a subsequent list pipelines call to - // return the next set of pipelines in the list. - NextToken *string `locationName:"nextToken" type:"string"` - - // The list of pipelines. - Pipelines []*PipelineSummary `locationName:"pipelines" 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() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPipelinesOutput) SetNextToken(v string) *ListPipelinesOutput { - s.NextToken = &v - return s -} - -// SetPipelines sets the Pipelines field's value. -func (s *ListPipelinesOutput) SetPipelines(v []*PipelineSummary) *ListPipelinesOutput { - s.Pipelines = v - return s -} - -// Represents information about the output of an action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/OutputArtifact -type OutputArtifact struct { - _ struct{} `type:"structure"` - - // The name of the output of an artifact, such as "My App". - // - // The input artifact of an action must exactly match the output artifact declared - // in a preceding action, but the input artifact does not have to be the next - // action in strict sequence from the action that provided the output artifact. - // Actions in parallel can declare different output artifacts, which are in - // turn consumed by different following actions. - // - // Output artifact names must be unique within a pipeline. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s OutputArtifact) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OutputArtifact) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutputArtifact) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputArtifact"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *OutputArtifact) SetName(v string) *OutputArtifact { - s.Name = &v - return s -} - -// Represents information about a pipeline to a job worker. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PipelineContext -type PipelineContext struct { - _ struct{} `type:"structure"` - - // Represents the context of an action within the stage of a pipeline to a job - // worker. - Action *ActionContext `locationName:"action" type:"structure"` - - // The name of the pipeline. This is a user-specified value. Pipeline names - // must be unique across all pipeline names under an Amazon Web Services account. - PipelineName *string `locationName:"pipelineName" min:"1" type:"string"` - - // The stage of the pipeline. - Stage *StageContext `locationName:"stage" type:"structure"` -} - -// String returns the string representation -func (s PipelineContext) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PipelineContext) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *PipelineContext) SetAction(v *ActionContext) *PipelineContext { - s.Action = v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *PipelineContext) SetPipelineName(v string) *PipelineContext { - s.PipelineName = &v - return s -} - -// SetStage sets the Stage field's value. -func (s *PipelineContext) SetStage(v *StageContext) *PipelineContext { - s.Stage = v - return s -} - -// Represents the structure of actions and stages to be performed in the pipeline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PipelineDeclaration -type PipelineDeclaration struct { - _ struct{} `type:"structure"` - - // The Amazon S3 location where artifacts are stored for the pipeline. If this - // Amazon S3 bucket is created manually, it must meet the requirements for AWS - // CodePipeline. For more information, see the Concepts (http://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#CPS3Bucket). - // - // ArtifactStore is a required field - ArtifactStore *ArtifactStore `locationName:"artifactStore" type:"structure" required:"true"` - - // The name of the action to be performed. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) for AWS CodePipeline to use to either perform - // actions with no actionRoleArn, or to use to assume roles for actions with - // an actionRoleArn. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The stage in which to perform the action. - // - // Stages is a required field - Stages []*StageDeclaration `locationName:"stages" type:"list" required:"true"` - - // The version number of the pipeline. A new pipeline always has a version number - // of 1. This number is automatically incremented when a pipeline is updated. - Version *int64 `locationName:"version" min:"1" type:"integer"` -} - -// String returns the string representation -func (s PipelineDeclaration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PipelineDeclaration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipelineDeclaration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipelineDeclaration"} - if s.ArtifactStore == nil { - invalidParams.Add(request.NewErrParamRequired("ArtifactStore")) - } - 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.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.Stages == nil { - invalidParams.Add(request.NewErrParamRequired("Stages")) - } - if s.Version != nil && *s.Version < 1 { - invalidParams.Add(request.NewErrParamMinValue("Version", 1)) - } - if s.ArtifactStore != nil { - if err := s.ArtifactStore.Validate(); err != nil { - invalidParams.AddNested("ArtifactStore", err.(request.ErrInvalidParams)) - } - } - if s.Stages != nil { - for i, v := range s.Stages { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Stages", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArtifactStore sets the ArtifactStore field's value. -func (s *PipelineDeclaration) SetArtifactStore(v *ArtifactStore) *PipelineDeclaration { - s.ArtifactStore = v - return s -} - -// SetName sets the Name field's value. -func (s *PipelineDeclaration) SetName(v string) *PipelineDeclaration { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *PipelineDeclaration) SetRoleArn(v string) *PipelineDeclaration { - s.RoleArn = &v - return s -} - -// SetStages sets the Stages field's value. -func (s *PipelineDeclaration) SetStages(v []*StageDeclaration) *PipelineDeclaration { - s.Stages = v - return s -} - -// SetVersion sets the Version field's value. -func (s *PipelineDeclaration) SetVersion(v int64) *PipelineDeclaration { - s.Version = &v - return s -} - -// Represents information about an execution of a pipeline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PipelineExecution -type PipelineExecution struct { - _ struct{} `type:"structure"` - - // A list of ArtifactRevision objects included in a pipeline execution. - ArtifactRevisions []*ArtifactRevision `locationName:"artifactRevisions" type:"list"` - - // The ID of the pipeline execution. - PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"` - - // The name of the pipeline that was executed. - PipelineName *string `locationName:"pipelineName" min:"1" type:"string"` - - // The version number of the pipeline that was executed. - PipelineVersion *int64 `locationName:"pipelineVersion" min:"1" type:"integer"` - - // The status of the pipeline execution. - // - // * InProgress: The pipeline execution is currently running. - // - // * Succeeded: The pipeline execution completed successfully. - // - // * Superseded: While this pipeline execution was waiting for the next stage - // to be completed, a newer pipeline execution caught up and continued through - // the pipeline instead. - // - // * Failed: The pipeline did not complete successfully. - Status *string `locationName:"status" type:"string" enum:"PipelineExecutionStatus"` -} - -// String returns the string representation -func (s PipelineExecution) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PipelineExecution) GoString() string { - return s.String() -} - -// SetArtifactRevisions sets the ArtifactRevisions field's value. -func (s *PipelineExecution) SetArtifactRevisions(v []*ArtifactRevision) *PipelineExecution { - s.ArtifactRevisions = v - return s -} - -// SetPipelineExecutionId sets the PipelineExecutionId field's value. -func (s *PipelineExecution) SetPipelineExecutionId(v string) *PipelineExecution { - s.PipelineExecutionId = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *PipelineExecution) SetPipelineName(v string) *PipelineExecution { - s.PipelineName = &v - return s -} - -// SetPipelineVersion sets the PipelineVersion field's value. -func (s *PipelineExecution) SetPipelineVersion(v int64) *PipelineExecution { - s.PipelineVersion = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *PipelineExecution) SetStatus(v string) *PipelineExecution { - s.Status = &v - return s -} - -// Returns a summary of a pipeline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PipelineSummary -type PipelineSummary struct { - _ struct{} `type:"structure"` - - // The date and time the pipeline was created, in timestamp format. - Created *time.Time `locationName:"created" type:"timestamp" timestampFormat:"unix"` - - // The name of the pipeline. - Name *string `locationName:"name" min:"1" type:"string"` - - // The date and time of the last update to the pipeline, in timestamp format. - Updated *time.Time `locationName:"updated" type:"timestamp" timestampFormat:"unix"` - - // The version number of the pipeline. - Version *int64 `locationName:"version" min:"1" type:"integer"` -} - -// String returns the string representation -func (s PipelineSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PipelineSummary) GoString() string { - return s.String() -} - -// SetCreated sets the Created field's value. -func (s *PipelineSummary) SetCreated(v time.Time) *PipelineSummary { - s.Created = &v - return s -} - -// SetName sets the Name field's value. -func (s *PipelineSummary) SetName(v string) *PipelineSummary { - s.Name = &v - return s -} - -// SetUpdated sets the Updated field's value. -func (s *PipelineSummary) SetUpdated(v time.Time) *PipelineSummary { - s.Updated = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *PipelineSummary) SetVersion(v int64) *PipelineSummary { - s.Version = &v - return s -} - -// Represents the input of a poll for jobs action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForJobsInput -type PollForJobsInput struct { - _ struct{} `type:"structure"` - - // Represents information about an action type. - // - // ActionTypeId is a required field - ActionTypeId *ActionTypeId `locationName:"actionTypeId" type:"structure" required:"true"` - - // The maximum number of jobs to return in a poll for jobs call. - MaxBatchSize *int64 `locationName:"maxBatchSize" min:"1" type:"integer"` - - // A map of property names and values. For an action type with no queryable - // properties, this value must be null or an empty map. For an action type with - // a queryable property, you must supply that property as a key in the map. - // Only jobs whose action configuration matches the mapped value will be returned. - QueryParam map[string]*string `locationName:"queryParam" type:"map"` -} - -// String returns the string representation -func (s PollForJobsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PollForJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PollForJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PollForJobsInput"} - if s.ActionTypeId == nil { - invalidParams.Add(request.NewErrParamRequired("ActionTypeId")) - } - if s.MaxBatchSize != nil && *s.MaxBatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxBatchSize", 1)) - } - if s.ActionTypeId != nil { - if err := s.ActionTypeId.Validate(); err != nil { - invalidParams.AddNested("ActionTypeId", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionTypeId sets the ActionTypeId field's value. -func (s *PollForJobsInput) SetActionTypeId(v *ActionTypeId) *PollForJobsInput { - s.ActionTypeId = v - return s -} - -// SetMaxBatchSize sets the MaxBatchSize field's value. -func (s *PollForJobsInput) SetMaxBatchSize(v int64) *PollForJobsInput { - s.MaxBatchSize = &v - return s -} - -// SetQueryParam sets the QueryParam field's value. -func (s *PollForJobsInput) SetQueryParam(v map[string]*string) *PollForJobsInput { - s.QueryParam = v - return s -} - -// Represents the output of a poll for jobs action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForJobsOutput -type PollForJobsOutput struct { - _ struct{} `type:"structure"` - - // Information about the jobs to take action on. - Jobs []*Job `locationName:"jobs" type:"list"` -} - -// String returns the string representation -func (s PollForJobsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PollForJobsOutput) GoString() string { - return s.String() -} - -// SetJobs sets the Jobs field's value. -func (s *PollForJobsOutput) SetJobs(v []*Job) *PollForJobsOutput { - s.Jobs = v - return s -} - -// Represents the input of a poll for third party jobs action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForThirdPartyJobsInput -type PollForThirdPartyJobsInput struct { - _ struct{} `type:"structure"` - - // Represents information about an action type. - // - // ActionTypeId is a required field - ActionTypeId *ActionTypeId `locationName:"actionTypeId" type:"structure" required:"true"` - - // The maximum number of jobs to return in a poll for jobs call. - MaxBatchSize *int64 `locationName:"maxBatchSize" min:"1" type:"integer"` -} - -// String returns the string representation -func (s PollForThirdPartyJobsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PollForThirdPartyJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PollForThirdPartyJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PollForThirdPartyJobsInput"} - if s.ActionTypeId == nil { - invalidParams.Add(request.NewErrParamRequired("ActionTypeId")) - } - if s.MaxBatchSize != nil && *s.MaxBatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxBatchSize", 1)) - } - if s.ActionTypeId != nil { - if err := s.ActionTypeId.Validate(); err != nil { - invalidParams.AddNested("ActionTypeId", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionTypeId sets the ActionTypeId field's value. -func (s *PollForThirdPartyJobsInput) SetActionTypeId(v *ActionTypeId) *PollForThirdPartyJobsInput { - s.ActionTypeId = v - return s -} - -// SetMaxBatchSize sets the MaxBatchSize field's value. -func (s *PollForThirdPartyJobsInput) SetMaxBatchSize(v int64) *PollForThirdPartyJobsInput { - s.MaxBatchSize = &v - return s -} - -// Represents the output of a poll for third party jobs action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForThirdPartyJobsOutput -type PollForThirdPartyJobsOutput struct { - _ struct{} `type:"structure"` - - // Information about the jobs to take action on. - Jobs []*ThirdPartyJob `locationName:"jobs" type:"list"` -} - -// String returns the string representation -func (s PollForThirdPartyJobsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PollForThirdPartyJobsOutput) GoString() string { - return s.String() -} - -// SetJobs sets the Jobs field's value. -func (s *PollForThirdPartyJobsOutput) SetJobs(v []*ThirdPartyJob) *PollForThirdPartyJobsOutput { - s.Jobs = v - return s -} - -// Represents the input of a put action revision action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutActionRevisionInput -type PutActionRevisionInput struct { - _ struct{} `type:"structure"` - - // The name of the action that will process the revision. - // - // ActionName is a required field - ActionName *string `locationName:"actionName" min:"1" type:"string" required:"true"` - - // Represents information about the version (or revision) of an action. - // - // ActionRevision is a required field - ActionRevision *ActionRevision `locationName:"actionRevision" type:"structure" required:"true"` - - // The name of the pipeline that will start processing the revision to the source. - // - // PipelineName is a required field - PipelineName *string `locationName:"pipelineName" min:"1" type:"string" required:"true"` - - // The name of the stage that contains the action that will act upon the revision. - // - // StageName is a required field - StageName *string `locationName:"stageName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutActionRevisionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutActionRevisionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutActionRevisionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutActionRevisionInput"} - if s.ActionName == nil { - invalidParams.Add(request.NewErrParamRequired("ActionName")) - } - if s.ActionName != nil && len(*s.ActionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionName", 1)) - } - if s.ActionRevision == nil { - invalidParams.Add(request.NewErrParamRequired("ActionRevision")) - } - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 1)) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - if s.StageName != nil && len(*s.StageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageName", 1)) - } - if s.ActionRevision != nil { - if err := s.ActionRevision.Validate(); err != nil { - invalidParams.AddNested("ActionRevision", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionName sets the ActionName field's value. -func (s *PutActionRevisionInput) SetActionName(v string) *PutActionRevisionInput { - s.ActionName = &v - return s -} - -// SetActionRevision sets the ActionRevision field's value. -func (s *PutActionRevisionInput) SetActionRevision(v *ActionRevision) *PutActionRevisionInput { - s.ActionRevision = v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *PutActionRevisionInput) SetPipelineName(v string) *PutActionRevisionInput { - s.PipelineName = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *PutActionRevisionInput) SetStageName(v string) *PutActionRevisionInput { - s.StageName = &v - return s -} - -// Represents the output of a put action revision action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutActionRevisionOutput -type PutActionRevisionOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the artifact revision was previously used in an execution - // of the specified pipeline. - NewRevision *bool `locationName:"newRevision" type:"boolean"` - - // The ID of the current workflow state of the pipeline. - PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"` -} - -// String returns the string representation -func (s PutActionRevisionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutActionRevisionOutput) GoString() string { - return s.String() -} - -// SetNewRevision sets the NewRevision field's value. -func (s *PutActionRevisionOutput) SetNewRevision(v bool) *PutActionRevisionOutput { - s.NewRevision = &v - return s -} - -// SetPipelineExecutionId sets the PipelineExecutionId field's value. -func (s *PutActionRevisionOutput) SetPipelineExecutionId(v string) *PutActionRevisionOutput { - s.PipelineExecutionId = &v - return s -} - -// Represents the input of a put approval result action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutApprovalResultInput -type PutApprovalResultInput struct { - _ struct{} `type:"structure"` - - // The name of the action for which approval is requested. - // - // ActionName is a required field - ActionName *string `locationName:"actionName" min:"1" type:"string" required:"true"` - - // The name of the pipeline that contains the action. - // - // PipelineName is a required field - PipelineName *string `locationName:"pipelineName" min:"1" type:"string" required:"true"` - - // Represents information about the result of the approval request. - // - // Result is a required field - Result *ApprovalResult `locationName:"result" type:"structure" required:"true"` - - // The name of the stage that contains the action. - // - // StageName is a required field - StageName *string `locationName:"stageName" min:"1" type:"string" required:"true"` - - // The system-generated token used to identify a unique approval request. The - // token for each open approval request can be obtained using the GetPipelineState - // action and is used to validate that the approval request corresponding to - // this token is still valid. - // - // Token is a required field - Token *string `locationName:"token" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutApprovalResultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutApprovalResultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutApprovalResultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutApprovalResultInput"} - if s.ActionName == nil { - invalidParams.Add(request.NewErrParamRequired("ActionName")) - } - if s.ActionName != nil && len(*s.ActionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionName", 1)) - } - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 1)) - } - if s.Result == nil { - invalidParams.Add(request.NewErrParamRequired("Result")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - if s.StageName != nil && len(*s.StageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageName", 1)) - } - if s.Token == nil { - invalidParams.Add(request.NewErrParamRequired("Token")) - } - if s.Result != nil { - if err := s.Result.Validate(); err != nil { - invalidParams.AddNested("Result", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionName sets the ActionName field's value. -func (s *PutApprovalResultInput) SetActionName(v string) *PutApprovalResultInput { - s.ActionName = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *PutApprovalResultInput) SetPipelineName(v string) *PutApprovalResultInput { - s.PipelineName = &v - return s -} - -// SetResult sets the Result field's value. -func (s *PutApprovalResultInput) SetResult(v *ApprovalResult) *PutApprovalResultInput { - s.Result = v - return s -} - -// SetStageName sets the StageName field's value. -func (s *PutApprovalResultInput) SetStageName(v string) *PutApprovalResultInput { - s.StageName = &v - return s -} - -// SetToken sets the Token field's value. -func (s *PutApprovalResultInput) SetToken(v string) *PutApprovalResultInput { - s.Token = &v - return s -} - -// Represents the output of a put approval result action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutApprovalResultOutput -type PutApprovalResultOutput struct { - _ struct{} `type:"structure"` - - // The timestamp showing when the approval or rejection was submitted. - ApprovedAt *time.Time `locationName:"approvedAt" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s PutApprovalResultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutApprovalResultOutput) GoString() string { - return s.String() -} - -// SetApprovedAt sets the ApprovedAt field's value. -func (s *PutApprovalResultOutput) SetApprovedAt(v time.Time) *PutApprovalResultOutput { - s.ApprovedAt = &v - return s -} - -// Represents the input of a put job failure result action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobFailureResultInput -type PutJobFailureResultInput struct { - _ struct{} `type:"structure"` - - // The details about the failure of a job. - // - // FailureDetails is a required field - FailureDetails *FailureDetails `locationName:"failureDetails" type:"structure" required:"true"` - - // The unique system-generated ID of the job that failed. This is the same ID - // returned from PollForJobs. - // - // JobId is a required field - JobId *string `locationName:"jobId" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutJobFailureResultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutJobFailureResultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutJobFailureResultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutJobFailureResultInput"} - if s.FailureDetails == nil { - invalidParams.Add(request.NewErrParamRequired("FailureDetails")) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.FailureDetails != nil { - if err := s.FailureDetails.Validate(); err != nil { - invalidParams.AddNested("FailureDetails", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFailureDetails sets the FailureDetails field's value. -func (s *PutJobFailureResultInput) SetFailureDetails(v *FailureDetails) *PutJobFailureResultInput { - s.FailureDetails = v - return s -} - -// SetJobId sets the JobId field's value. -func (s *PutJobFailureResultInput) SetJobId(v string) *PutJobFailureResultInput { - s.JobId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobFailureResultOutput -type PutJobFailureResultOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutJobFailureResultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutJobFailureResultOutput) GoString() string { - return s.String() -} - -// Represents the input of a put job success result action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobSuccessResultInput -type PutJobSuccessResultInput struct { - _ struct{} `type:"structure"` - - // A token generated by a job worker, such as an AWS CodeDeploy deployment ID, - // that a successful job provides to identify a custom action in progress. Future - // jobs will use this token in order to identify the running instance of the - // action. It can be reused to return additional information about the progress - // of the custom action. When the action is complete, no continuation token - // should be supplied. - ContinuationToken *string `locationName:"continuationToken" type:"string"` - - // The ID of the current revision of the artifact successfully worked upon by - // the job. - CurrentRevision *CurrentRevision `locationName:"currentRevision" type:"structure"` - - // The execution details of the successful job, such as the actions taken by - // the job worker. - ExecutionDetails *ExecutionDetails `locationName:"executionDetails" type:"structure"` - - // The unique system-generated ID of the job that succeeded. This is the same - // ID returned from PollForJobs. - // - // JobId is a required field - JobId *string `locationName:"jobId" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutJobSuccessResultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutJobSuccessResultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutJobSuccessResultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutJobSuccessResultInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.CurrentRevision != nil { - if err := s.CurrentRevision.Validate(); err != nil { - invalidParams.AddNested("CurrentRevision", err.(request.ErrInvalidParams)) - } - } - if s.ExecutionDetails != nil { - if err := s.ExecutionDetails.Validate(); err != nil { - invalidParams.AddNested("ExecutionDetails", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *PutJobSuccessResultInput) SetContinuationToken(v string) *PutJobSuccessResultInput { - s.ContinuationToken = &v - return s -} - -// SetCurrentRevision sets the CurrentRevision field's value. -func (s *PutJobSuccessResultInput) SetCurrentRevision(v *CurrentRevision) *PutJobSuccessResultInput { - s.CurrentRevision = v - return s -} - -// SetExecutionDetails sets the ExecutionDetails field's value. -func (s *PutJobSuccessResultInput) SetExecutionDetails(v *ExecutionDetails) *PutJobSuccessResultInput { - s.ExecutionDetails = v - return s -} - -// SetJobId sets the JobId field's value. -func (s *PutJobSuccessResultInput) SetJobId(v string) *PutJobSuccessResultInput { - s.JobId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobSuccessResultOutput -type PutJobSuccessResultOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutJobSuccessResultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutJobSuccessResultOutput) GoString() string { - return s.String() -} - -// Represents the input of a third party job failure result action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobFailureResultInput -type PutThirdPartyJobFailureResultInput struct { - _ struct{} `type:"structure"` - - // The clientToken portion of the clientId and clientToken pair used to verify - // that the calling entity is allowed access to the job and its details. - // - // ClientToken is a required field - ClientToken *string `locationName:"clientToken" type:"string" required:"true"` - - // Represents information about failure details. - // - // FailureDetails is a required field - FailureDetails *FailureDetails `locationName:"failureDetails" type:"structure" required:"true"` - - // The ID of the job that failed. This is the same ID returned from PollForThirdPartyJobs. - // - // JobId is a required field - JobId *string `locationName:"jobId" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutThirdPartyJobFailureResultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutThirdPartyJobFailureResultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutThirdPartyJobFailureResultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutThirdPartyJobFailureResultInput"} - if s.ClientToken == nil { - invalidParams.Add(request.NewErrParamRequired("ClientToken")) - } - if s.FailureDetails == nil { - invalidParams.Add(request.NewErrParamRequired("FailureDetails")) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - if s.FailureDetails != nil { - if err := s.FailureDetails.Validate(); err != nil { - invalidParams.AddNested("FailureDetails", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *PutThirdPartyJobFailureResultInput) SetClientToken(v string) *PutThirdPartyJobFailureResultInput { - s.ClientToken = &v - return s -} - -// SetFailureDetails sets the FailureDetails field's value. -func (s *PutThirdPartyJobFailureResultInput) SetFailureDetails(v *FailureDetails) *PutThirdPartyJobFailureResultInput { - s.FailureDetails = v - return s -} - -// SetJobId sets the JobId field's value. -func (s *PutThirdPartyJobFailureResultInput) SetJobId(v string) *PutThirdPartyJobFailureResultInput { - s.JobId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobFailureResultOutput -type PutThirdPartyJobFailureResultOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutThirdPartyJobFailureResultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutThirdPartyJobFailureResultOutput) GoString() string { - return s.String() -} - -// Represents the input of a put third party job success result action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobSuccessResultInput -type PutThirdPartyJobSuccessResultInput struct { - _ struct{} `type:"structure"` - - // The clientToken portion of the clientId and clientToken pair used to verify - // that the calling entity is allowed access to the job and its details. - // - // ClientToken is a required field - ClientToken *string `locationName:"clientToken" type:"string" required:"true"` - - // A token generated by a job worker, such as an AWS CodeDeploy deployment ID, - // that a successful job provides to identify a partner action in progress. - // Future jobs will use this token in order to identify the running instance - // of the action. It can be reused to return additional information about the - // progress of the partner action. When the action is complete, no continuation - // token should be supplied. - ContinuationToken *string `locationName:"continuationToken" type:"string"` - - // Represents information about a current revision. - CurrentRevision *CurrentRevision `locationName:"currentRevision" type:"structure"` - - // The details of the actions taken and results produced on an artifact as it - // passes through stages in the pipeline. - ExecutionDetails *ExecutionDetails `locationName:"executionDetails" type:"structure"` - - // The ID of the job that successfully completed. This is the same ID returned - // from PollForThirdPartyJobs. - // - // JobId is a required field - JobId *string `locationName:"jobId" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutThirdPartyJobSuccessResultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutThirdPartyJobSuccessResultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutThirdPartyJobSuccessResultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutThirdPartyJobSuccessResultInput"} - if s.ClientToken == nil { - invalidParams.Add(request.NewErrParamRequired("ClientToken")) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - if s.CurrentRevision != nil { - if err := s.CurrentRevision.Validate(); err != nil { - invalidParams.AddNested("CurrentRevision", err.(request.ErrInvalidParams)) - } - } - if s.ExecutionDetails != nil { - if err := s.ExecutionDetails.Validate(); err != nil { - invalidParams.AddNested("ExecutionDetails", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *PutThirdPartyJobSuccessResultInput) SetClientToken(v string) *PutThirdPartyJobSuccessResultInput { - s.ClientToken = &v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *PutThirdPartyJobSuccessResultInput) SetContinuationToken(v string) *PutThirdPartyJobSuccessResultInput { - s.ContinuationToken = &v - return s -} - -// SetCurrentRevision sets the CurrentRevision field's value. -func (s *PutThirdPartyJobSuccessResultInput) SetCurrentRevision(v *CurrentRevision) *PutThirdPartyJobSuccessResultInput { - s.CurrentRevision = v - return s -} - -// SetExecutionDetails sets the ExecutionDetails field's value. -func (s *PutThirdPartyJobSuccessResultInput) SetExecutionDetails(v *ExecutionDetails) *PutThirdPartyJobSuccessResultInput { - s.ExecutionDetails = v - return s -} - -// SetJobId sets the JobId field's value. -func (s *PutThirdPartyJobSuccessResultInput) SetJobId(v string) *PutThirdPartyJobSuccessResultInput { - s.JobId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobSuccessResultOutput -type PutThirdPartyJobSuccessResultOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutThirdPartyJobSuccessResultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutThirdPartyJobSuccessResultOutput) GoString() string { - return s.String() -} - -// Represents the input of a retry stage execution action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/RetryStageExecutionInput -type RetryStageExecutionInput struct { - _ struct{} `type:"structure"` - - // The ID of the pipeline execution in the failed stage to be retried. Use the - // GetPipelineState action to retrieve the current pipelineExecutionId of the - // failed stage - // - // PipelineExecutionId is a required field - PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string" required:"true"` - - // The name of the pipeline that contains the failed stage. - // - // PipelineName is a required field - PipelineName *string `locationName:"pipelineName" min:"1" type:"string" required:"true"` - - // The scope of the retry attempt. Currently, the only supported value is FAILED_ACTIONS. - // - // RetryMode is a required field - RetryMode *string `locationName:"retryMode" type:"string" required:"true" enum:"StageRetryMode"` - - // The name of the failed stage to be retried. - // - // StageName is a required field - StageName *string `locationName:"stageName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RetryStageExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RetryStageExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetryStageExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetryStageExecutionInput"} - if s.PipelineExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineExecutionId")) - } - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 1)) - } - if s.RetryMode == nil { - invalidParams.Add(request.NewErrParamRequired("RetryMode")) - } - if s.StageName == nil { - invalidParams.Add(request.NewErrParamRequired("StageName")) - } - if s.StageName != nil && len(*s.StageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineExecutionId sets the PipelineExecutionId field's value. -func (s *RetryStageExecutionInput) SetPipelineExecutionId(v string) *RetryStageExecutionInput { - s.PipelineExecutionId = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *RetryStageExecutionInput) SetPipelineName(v string) *RetryStageExecutionInput { - s.PipelineName = &v - return s -} - -// SetRetryMode sets the RetryMode field's value. -func (s *RetryStageExecutionInput) SetRetryMode(v string) *RetryStageExecutionInput { - s.RetryMode = &v - return s -} - -// SetStageName sets the StageName field's value. -func (s *RetryStageExecutionInput) SetStageName(v string) *RetryStageExecutionInput { - s.StageName = &v - return s -} - -// Represents the output of a retry stage execution action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/RetryStageExecutionOutput -type RetryStageExecutionOutput struct { - _ struct{} `type:"structure"` - - // The ID of the current workflow execution in the failed stage. - PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"` -} - -// String returns the string representation -func (s RetryStageExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RetryStageExecutionOutput) GoString() string { - return s.String() -} - -// SetPipelineExecutionId sets the PipelineExecutionId field's value. -func (s *RetryStageExecutionOutput) SetPipelineExecutionId(v string) *RetryStageExecutionOutput { - s.PipelineExecutionId = &v - return s -} - -// The location of the Amazon S3 bucket that contains a revision. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/S3ArtifactLocation -type S3ArtifactLocation struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket. - // - // BucketName is a required field - BucketName *string `locationName:"bucketName" type:"string" required:"true"` - - // The key of the object in the Amazon S3 bucket, which uniquely identifies - // the object in the bucket. - // - // ObjectKey is a required field - ObjectKey *string `locationName:"objectKey" type:"string" required:"true"` -} - -// String returns the string representation -func (s S3ArtifactLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3ArtifactLocation) GoString() string { - return s.String() -} - -// SetBucketName sets the BucketName field's value. -func (s *S3ArtifactLocation) SetBucketName(v string) *S3ArtifactLocation { - s.BucketName = &v - return s -} - -// SetObjectKey sets the ObjectKey field's value. -func (s *S3ArtifactLocation) SetObjectKey(v string) *S3ArtifactLocation { - s.ObjectKey = &v - return s -} - -// Represents information about a stage to a job worker. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StageContext -type StageContext struct { - _ struct{} `type:"structure"` - - // The name of the stage. - Name *string `locationName:"name" min:"1" type:"string"` -} - -// String returns the string representation -func (s StageContext) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StageContext) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *StageContext) SetName(v string) *StageContext { - s.Name = &v - return s -} - -// Represents information about a stage and its definition. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StageDeclaration -type StageDeclaration struct { - _ struct{} `type:"structure"` - - // The actions included in a stage. - // - // Actions is a required field - Actions []*ActionDeclaration `locationName:"actions" type:"list" required:"true"` - - // Reserved for future use. - Blockers []*BlockerDeclaration `locationName:"blockers" type:"list"` - - // The name of the stage. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StageDeclaration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StageDeclaration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StageDeclaration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StageDeclaration"} - if s.Actions == nil { - invalidParams.Add(request.NewErrParamRequired("Actions")) - } - 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.Actions != nil { - for i, v := range s.Actions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Actions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Blockers != nil { - for i, v := range s.Blockers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Blockers", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActions sets the Actions field's value. -func (s *StageDeclaration) SetActions(v []*ActionDeclaration) *StageDeclaration { - s.Actions = v - return s -} - -// SetBlockers sets the Blockers field's value. -func (s *StageDeclaration) SetBlockers(v []*BlockerDeclaration) *StageDeclaration { - s.Blockers = v - return s -} - -// SetName sets the Name field's value. -func (s *StageDeclaration) SetName(v string) *StageDeclaration { - s.Name = &v - return s -} - -// Represents information about the run of a stage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StageExecution -type StageExecution struct { - _ struct{} `type:"structure"` - - // The ID of the pipeline execution associated with the stage. - // - // PipelineExecutionId is a required field - PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string" required:"true"` - - // The status of the stage, or for a completed stage, the last status of the - // stage. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StageExecutionStatus"` -} - -// String returns the string representation -func (s StageExecution) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StageExecution) GoString() string { - return s.String() -} - -// SetPipelineExecutionId sets the PipelineExecutionId field's value. -func (s *StageExecution) SetPipelineExecutionId(v string) *StageExecution { - s.PipelineExecutionId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StageExecution) SetStatus(v string) *StageExecution { - s.Status = &v - return s -} - -// Represents information about the state of the stage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StageState -type StageState struct { - _ struct{} `type:"structure"` - - // The state of the stage. - ActionStates []*ActionState `locationName:"actionStates" type:"list"` - - // The state of the inbound transition, which is either enabled or disabled. - InboundTransitionState *TransitionState `locationName:"inboundTransitionState" type:"structure"` - - // Information about the latest execution in the stage, including its ID and - // status. - LatestExecution *StageExecution `locationName:"latestExecution" type:"structure"` - - // The name of the stage. - StageName *string `locationName:"stageName" min:"1" type:"string"` -} - -// String returns the string representation -func (s StageState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StageState) GoString() string { - return s.String() -} - -// SetActionStates sets the ActionStates field's value. -func (s *StageState) SetActionStates(v []*ActionState) *StageState { - s.ActionStates = v - return s -} - -// SetInboundTransitionState sets the InboundTransitionState field's value. -func (s *StageState) SetInboundTransitionState(v *TransitionState) *StageState { - s.InboundTransitionState = v - return s -} - -// SetLatestExecution sets the LatestExecution field's value. -func (s *StageState) SetLatestExecution(v *StageExecution) *StageState { - s.LatestExecution = v - return s -} - -// SetStageName sets the StageName field's value. -func (s *StageState) SetStageName(v string) *StageState { - s.StageName = &v - return s -} - -// Represents the input of a start pipeline execution action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StartPipelineExecutionInput -type StartPipelineExecutionInput struct { - _ struct{} `type:"structure"` - - // The name of the pipeline to start. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartPipelineExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartPipelineExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartPipelineExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartPipelineExecutionInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *StartPipelineExecutionInput) SetName(v string) *StartPipelineExecutionInput { - s.Name = &v - return s -} - -// Represents the output of a start pipeline execution action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StartPipelineExecutionOutput -type StartPipelineExecutionOutput struct { - _ struct{} `type:"structure"` - - // The unique system-generated ID of the pipeline execution that was started. - PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"` -} - -// String returns the string representation -func (s StartPipelineExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartPipelineExecutionOutput) GoString() string { - return s.String() -} - -// SetPipelineExecutionId sets the PipelineExecutionId field's value. -func (s *StartPipelineExecutionOutput) SetPipelineExecutionId(v string) *StartPipelineExecutionOutput { - s.PipelineExecutionId = &v - return s -} - -// A response to a PollForThirdPartyJobs request returned by AWS CodePipeline -// when there is a job to be worked upon by a partner action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ThirdPartyJob -type ThirdPartyJob struct { - _ struct{} `type:"structure"` - - // The clientToken portion of the clientId and clientToken pair used to verify - // that the calling entity is allowed access to the job and its details. - ClientId *string `locationName:"clientId" type:"string"` - - // The identifier used to identify the job in AWS CodePipeline. - JobId *string `locationName:"jobId" type:"string"` -} - -// String returns the string representation -func (s ThirdPartyJob) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ThirdPartyJob) GoString() string { - return s.String() -} - -// SetClientId sets the ClientId field's value. -func (s *ThirdPartyJob) SetClientId(v string) *ThirdPartyJob { - s.ClientId = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *ThirdPartyJob) SetJobId(v string) *ThirdPartyJob { - s.JobId = &v - return s -} - -// Represents information about the job data for a partner action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ThirdPartyJobData -type ThirdPartyJobData struct { - _ struct{} `type:"structure"` - - // Represents information about an action configuration. - ActionConfiguration *ActionConfiguration `locationName:"actionConfiguration" type:"structure"` - - // Represents information about an action type. - ActionTypeId *ActionTypeId `locationName:"actionTypeId" type:"structure"` - - // Represents an AWS session credentials object. These credentials are temporary - // credentials that are issued by AWS Secure Token Service (STS). They can be - // used to access input and output artifacts in the Amazon S3 bucket used to - // store artifact for the pipeline in AWS CodePipeline. - ArtifactCredentials *AWSSessionCredentials `locationName:"artifactCredentials" type:"structure"` - - // A system-generated token, such as a AWS CodeDeploy deployment ID, that a - // job requires in order to continue the job asynchronously. - ContinuationToken *string `locationName:"continuationToken" type:"string"` - - // The encryption key used to encrypt and decrypt data in the artifact store - // for the pipeline, such as an AWS Key Management Service (AWS KMS) key. This - // is optional and might not be present. - EncryptionKey *EncryptionKey `locationName:"encryptionKey" type:"structure"` - - // The name of the artifact that will be worked upon by the action, if any. - // This name might be system-generated, such as "MyApp", or might be defined - // by the user when the action is created. The input artifact name must match - // the name of an output artifact generated by an action in an earlier action - // or stage of the pipeline. - InputArtifacts []*Artifact `locationName:"inputArtifacts" type:"list"` - - // The name of the artifact that will be the result of the action, if any. This - // name might be system-generated, such as "MyBuiltApp", or might be defined - // by the user when the action is created. - OutputArtifacts []*Artifact `locationName:"outputArtifacts" type:"list"` - - // Represents information about a pipeline to a job worker. - PipelineContext *PipelineContext `locationName:"pipelineContext" type:"structure"` -} - -// String returns the string representation -func (s ThirdPartyJobData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ThirdPartyJobData) GoString() string { - return s.String() -} - -// SetActionConfiguration sets the ActionConfiguration field's value. -func (s *ThirdPartyJobData) SetActionConfiguration(v *ActionConfiguration) *ThirdPartyJobData { - s.ActionConfiguration = v - return s -} - -// SetActionTypeId sets the ActionTypeId field's value. -func (s *ThirdPartyJobData) SetActionTypeId(v *ActionTypeId) *ThirdPartyJobData { - s.ActionTypeId = v - return s -} - -// SetArtifactCredentials sets the ArtifactCredentials field's value. -func (s *ThirdPartyJobData) SetArtifactCredentials(v *AWSSessionCredentials) *ThirdPartyJobData { - s.ArtifactCredentials = v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ThirdPartyJobData) SetContinuationToken(v string) *ThirdPartyJobData { - s.ContinuationToken = &v - return s -} - -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *ThirdPartyJobData) SetEncryptionKey(v *EncryptionKey) *ThirdPartyJobData { - s.EncryptionKey = v - return s -} - -// SetInputArtifacts sets the InputArtifacts field's value. -func (s *ThirdPartyJobData) SetInputArtifacts(v []*Artifact) *ThirdPartyJobData { - s.InputArtifacts = v - return s -} - -// SetOutputArtifacts sets the OutputArtifacts field's value. -func (s *ThirdPartyJobData) SetOutputArtifacts(v []*Artifact) *ThirdPartyJobData { - s.OutputArtifacts = v - return s -} - -// SetPipelineContext sets the PipelineContext field's value. -func (s *ThirdPartyJobData) SetPipelineContext(v *PipelineContext) *ThirdPartyJobData { - s.PipelineContext = v - return s -} - -// The details of a job sent in response to a GetThirdPartyJobDetails request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ThirdPartyJobDetails -type ThirdPartyJobDetails struct { - _ struct{} `type:"structure"` - - // The data to be returned by the third party job worker. - Data *ThirdPartyJobData `locationName:"data" type:"structure"` - - // The identifier used to identify the job details in AWS CodePipeline. - Id *string `locationName:"id" min:"1" type:"string"` - - // A system-generated random number that AWS CodePipeline uses to ensure that - // the job is being worked on by only one job worker. Use this number in an - // AcknowledgeThirdPartyJob request. - Nonce *string `locationName:"nonce" type:"string"` -} - -// String returns the string representation -func (s ThirdPartyJobDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ThirdPartyJobDetails) GoString() string { - return s.String() -} - -// SetData sets the Data field's value. -func (s *ThirdPartyJobDetails) SetData(v *ThirdPartyJobData) *ThirdPartyJobDetails { - s.Data = v - return s -} - -// SetId sets the Id field's value. -func (s *ThirdPartyJobDetails) SetId(v string) *ThirdPartyJobDetails { - s.Id = &v - return s -} - -// SetNonce sets the Nonce field's value. -func (s *ThirdPartyJobDetails) SetNonce(v string) *ThirdPartyJobDetails { - s.Nonce = &v - return s -} - -// Represents information about the state of transitions between one stage and -// another stage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/TransitionState -type TransitionState struct { - _ struct{} `type:"structure"` - - // The user-specified reason why the transition between two stages of a pipeline - // was disabled. - DisabledReason *string `locationName:"disabledReason" min:"1" type:"string"` - - // Whether the transition between stages is enabled (true) or disabled (false). - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The timestamp when the transition state was last changed. - LastChangedAt *time.Time `locationName:"lastChangedAt" type:"timestamp" timestampFormat:"unix"` - - // The ID of the user who last changed the transition state. - LastChangedBy *string `locationName:"lastChangedBy" type:"string"` -} - -// String returns the string representation -func (s TransitionState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TransitionState) GoString() string { - return s.String() -} - -// SetDisabledReason sets the DisabledReason field's value. -func (s *TransitionState) SetDisabledReason(v string) *TransitionState { - s.DisabledReason = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *TransitionState) SetEnabled(v bool) *TransitionState { - s.Enabled = &v - return s -} - -// SetLastChangedAt sets the LastChangedAt field's value. -func (s *TransitionState) SetLastChangedAt(v time.Time) *TransitionState { - s.LastChangedAt = &v - return s -} - -// SetLastChangedBy sets the LastChangedBy field's value. -func (s *TransitionState) SetLastChangedBy(v string) *TransitionState { - s.LastChangedBy = &v - return s -} - -// Represents the input of an update pipeline action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/UpdatePipelineInput -type UpdatePipelineInput struct { - _ struct{} `type:"structure"` - - // The name of the pipeline to be updated. - // - // Pipeline is a required field - Pipeline *PipelineDeclaration `locationName:"pipeline" type:"structure" required:"true"` -} - -// 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.Pipeline == nil { - invalidParams.Add(request.NewErrParamRequired("Pipeline")) - } - if s.Pipeline != nil { - if err := s.Pipeline.Validate(); err != nil { - invalidParams.AddNested("Pipeline", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipeline sets the Pipeline field's value. -func (s *UpdatePipelineInput) SetPipeline(v *PipelineDeclaration) *UpdatePipelineInput { - s.Pipeline = v - return s -} - -// Represents the output of an update pipeline action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/UpdatePipelineOutput -type UpdatePipelineOutput struct { - _ struct{} `type:"structure"` - - // The structure of the updated pipeline. - Pipeline *PipelineDeclaration `locationName:"pipeline" type:"structure"` -} - -// 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 *PipelineDeclaration) *UpdatePipelineOutput { - s.Pipeline = v - return s -} - -const ( - // ActionCategorySource is a ActionCategory enum value - ActionCategorySource = "Source" - - // ActionCategoryBuild is a ActionCategory enum value - ActionCategoryBuild = "Build" - - // ActionCategoryDeploy is a ActionCategory enum value - ActionCategoryDeploy = "Deploy" - - // ActionCategoryTest is a ActionCategory enum value - ActionCategoryTest = "Test" - - // ActionCategoryInvoke is a ActionCategory enum value - ActionCategoryInvoke = "Invoke" - - // ActionCategoryApproval is a ActionCategory enum value - ActionCategoryApproval = "Approval" -) - -const ( - // ActionConfigurationPropertyTypeString is a ActionConfigurationPropertyType enum value - ActionConfigurationPropertyTypeString = "String" - - // ActionConfigurationPropertyTypeNumber is a ActionConfigurationPropertyType enum value - ActionConfigurationPropertyTypeNumber = "Number" - - // ActionConfigurationPropertyTypeBoolean is a ActionConfigurationPropertyType enum value - ActionConfigurationPropertyTypeBoolean = "Boolean" -) - -const ( - // ActionExecutionStatusInProgress is a ActionExecutionStatus enum value - ActionExecutionStatusInProgress = "InProgress" - - // ActionExecutionStatusSucceeded is a ActionExecutionStatus enum value - ActionExecutionStatusSucceeded = "Succeeded" - - // ActionExecutionStatusFailed is a ActionExecutionStatus enum value - ActionExecutionStatusFailed = "Failed" -) - -const ( - // ActionOwnerAws is a ActionOwner enum value - ActionOwnerAws = "AWS" - - // ActionOwnerThirdParty is a ActionOwner enum value - ActionOwnerThirdParty = "ThirdParty" - - // ActionOwnerCustom is a ActionOwner enum value - ActionOwnerCustom = "Custom" -) - -const ( - // ApprovalStatusApproved is a ApprovalStatus enum value - ApprovalStatusApproved = "Approved" - - // ApprovalStatusRejected is a ApprovalStatus enum value - ApprovalStatusRejected = "Rejected" -) - -const ( - // ArtifactLocationTypeS3 is a ArtifactLocationType enum value - ArtifactLocationTypeS3 = "S3" -) - -const ( - // ArtifactStoreTypeS3 is a ArtifactStoreType enum value - ArtifactStoreTypeS3 = "S3" -) - -const ( - // BlockerTypeSchedule is a BlockerType enum value - BlockerTypeSchedule = "Schedule" -) - -const ( - // EncryptionKeyTypeKms is a EncryptionKeyType enum value - EncryptionKeyTypeKms = "KMS" -) - -const ( - // FailureTypeJobFailed is a FailureType enum value - FailureTypeJobFailed = "JobFailed" - - // FailureTypeConfigurationError is a FailureType enum value - FailureTypeConfigurationError = "ConfigurationError" - - // FailureTypePermissionError is a FailureType enum value - FailureTypePermissionError = "PermissionError" - - // FailureTypeRevisionOutOfSync is a FailureType enum value - FailureTypeRevisionOutOfSync = "RevisionOutOfSync" - - // FailureTypeRevisionUnavailable is a FailureType enum value - FailureTypeRevisionUnavailable = "RevisionUnavailable" - - // FailureTypeSystemUnavailable is a FailureType enum value - FailureTypeSystemUnavailable = "SystemUnavailable" -) - -const ( - // JobStatusCreated is a JobStatus enum value - JobStatusCreated = "Created" - - // JobStatusQueued is a JobStatus enum value - JobStatusQueued = "Queued" - - // JobStatusDispatched is a JobStatus enum value - JobStatusDispatched = "Dispatched" - - // JobStatusInProgress is a JobStatus enum value - JobStatusInProgress = "InProgress" - - // JobStatusTimedOut is a JobStatus enum value - JobStatusTimedOut = "TimedOut" - - // JobStatusSucceeded is a JobStatus enum value - JobStatusSucceeded = "Succeeded" - - // JobStatusFailed is a JobStatus enum value - JobStatusFailed = "Failed" -) - -const ( - // PipelineExecutionStatusInProgress is a PipelineExecutionStatus enum value - PipelineExecutionStatusInProgress = "InProgress" - - // PipelineExecutionStatusSucceeded is a PipelineExecutionStatus enum value - PipelineExecutionStatusSucceeded = "Succeeded" - - // PipelineExecutionStatusSuperseded is a PipelineExecutionStatus enum value - PipelineExecutionStatusSuperseded = "Superseded" - - // PipelineExecutionStatusFailed is a PipelineExecutionStatus enum value - PipelineExecutionStatusFailed = "Failed" -) - -const ( - // StageExecutionStatusInProgress is a StageExecutionStatus enum value - StageExecutionStatusInProgress = "InProgress" - - // StageExecutionStatusFailed is a StageExecutionStatus enum value - StageExecutionStatusFailed = "Failed" - - // StageExecutionStatusSucceeded is a StageExecutionStatus enum value - StageExecutionStatusSucceeded = "Succeeded" -) - -const ( - // StageRetryModeFailedActions is a StageRetryMode enum value - StageRetryModeFailedActions = "FAILED_ACTIONS" -) - -const ( - // StageTransitionTypeInbound is a StageTransitionType enum value - StageTransitionTypeInbound = "Inbound" - - // StageTransitionTypeOutbound is a StageTransitionType enum value - StageTransitionTypeOutbound = "Outbound" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go deleted file mode 100644 index 7e664c0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go +++ /dev/null @@ -1,152 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codepipeline - -const ( - - // ErrCodeActionNotFoundException for service response error code - // "ActionNotFoundException". - // - // The specified action cannot be found. - ErrCodeActionNotFoundException = "ActionNotFoundException" - - // ErrCodeActionTypeNotFoundException for service response error code - // "ActionTypeNotFoundException". - // - // The specified action type cannot be found. - ErrCodeActionTypeNotFoundException = "ActionTypeNotFoundException" - - // ErrCodeApprovalAlreadyCompletedException for service response error code - // "ApprovalAlreadyCompletedException". - // - // The approval action has already been approved or rejected. - ErrCodeApprovalAlreadyCompletedException = "ApprovalAlreadyCompletedException" - - // ErrCodeInvalidActionDeclarationException for service response error code - // "InvalidActionDeclarationException". - // - // The specified action declaration was specified in an invalid format. - ErrCodeInvalidActionDeclarationException = "InvalidActionDeclarationException" - - // ErrCodeInvalidApprovalTokenException for service response error code - // "InvalidApprovalTokenException". - // - // The approval request already received a response or has expired. - ErrCodeInvalidApprovalTokenException = "InvalidApprovalTokenException" - - // ErrCodeInvalidBlockerDeclarationException for service response error code - // "InvalidBlockerDeclarationException". - // - // Reserved for future use. - ErrCodeInvalidBlockerDeclarationException = "InvalidBlockerDeclarationException" - - // ErrCodeInvalidClientTokenException for service response error code - // "InvalidClientTokenException". - // - // The client token was specified in an invalid format - ErrCodeInvalidClientTokenException = "InvalidClientTokenException" - - // ErrCodeInvalidJobException for service response error code - // "InvalidJobException". - // - // The specified job was specified in an invalid format or cannot be found. - ErrCodeInvalidJobException = "InvalidJobException" - - // ErrCodeInvalidJobStateException for service response error code - // "InvalidJobStateException". - // - // The specified job state was specified in an invalid format. - ErrCodeInvalidJobStateException = "InvalidJobStateException" - - // ErrCodeInvalidNextTokenException for service response error code - // "InvalidNextTokenException". - // - // The next token was specified in an invalid format. Make sure that the next - // token you provided is the token returned by a previous call. - ErrCodeInvalidNextTokenException = "InvalidNextTokenException" - - // ErrCodeInvalidNonceException for service response error code - // "InvalidNonceException". - // - // The specified nonce was specified in an invalid format. - ErrCodeInvalidNonceException = "InvalidNonceException" - - // ErrCodeInvalidStageDeclarationException for service response error code - // "InvalidStageDeclarationException". - // - // The specified stage declaration was specified in an invalid format. - ErrCodeInvalidStageDeclarationException = "InvalidStageDeclarationException" - - // ErrCodeInvalidStructureException for service response error code - // "InvalidStructureException". - // - // The specified structure was specified in an invalid format. - ErrCodeInvalidStructureException = "InvalidStructureException" - - // ErrCodeJobNotFoundException for service response error code - // "JobNotFoundException". - // - // The specified job was specified in an invalid format or cannot be found. - ErrCodeJobNotFoundException = "JobNotFoundException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // The number of pipelines associated with the AWS account has exceeded the - // limit allowed for the account. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeNotLatestPipelineExecutionException for service response error code - // "NotLatestPipelineExecutionException". - // - // The stage has failed in a later run of the pipeline and the pipelineExecutionId - // associated with the request is out of date. - ErrCodeNotLatestPipelineExecutionException = "NotLatestPipelineExecutionException" - - // ErrCodePipelineExecutionNotFoundException for service response error code - // "PipelineExecutionNotFoundException". - // - // The pipeline execution was specified in an invalid format or cannot be found, - // or an execution ID does not belong to the specified pipeline. - ErrCodePipelineExecutionNotFoundException = "PipelineExecutionNotFoundException" - - // ErrCodePipelineNameInUseException for service response error code - // "PipelineNameInUseException". - // - // The specified pipeline name is already in use. - ErrCodePipelineNameInUseException = "PipelineNameInUseException" - - // ErrCodePipelineNotFoundException for service response error code - // "PipelineNotFoundException". - // - // The specified pipeline was specified in an invalid format or cannot be found. - ErrCodePipelineNotFoundException = "PipelineNotFoundException" - - // ErrCodePipelineVersionNotFoundException for service response error code - // "PipelineVersionNotFoundException". - // - // The specified pipeline version was specified in an invalid format or cannot - // be found. - ErrCodePipelineVersionNotFoundException = "PipelineVersionNotFoundException" - - // ErrCodeStageNotFoundException for service response error code - // "StageNotFoundException". - // - // The specified stage was specified in an invalid format or cannot be found. - ErrCodeStageNotFoundException = "StageNotFoundException" - - // ErrCodeStageNotRetryableException for service response error code - // "StageNotRetryableException". - // - // The specified stage can't be retried because the pipeline structure or stage - // state changed after the stage was not completed; the stage contains no failed - // actions; one or more actions are still in progress; or another retry attempt - // is already in progress. - ErrCodeStageNotRetryableException = "StageNotRetryableException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The validation was specified in an invalid format. - ErrCodeValidationException = "ValidationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go deleted file mode 100644 index 960d8f5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go +++ /dev/null @@ -1,201 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package codepipeline - -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" -) - -// Overview -// -// This is the AWS CodePipeline API Reference. This guide provides descriptions -// of the actions and data types for AWS CodePipeline. Some functionality for -// your pipeline is only configurable through the API. For additional information, -// see the AWS CodePipeline User Guide (http://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html). -// -// You can use the AWS CodePipeline API to work with pipelines, stages, actions, -// gates, and transitions, as described below. -// -// Pipelines are models of automated release processes. Each pipeline is uniquely -// named, and consists of actions, gates, and stages. -// -// You can work with pipelines by calling: -// -// * CreatePipeline, which creates a uniquely-named pipeline. -// -// * DeletePipeline, which deletes the specified pipeline. -// -// * GetPipeline, which returns information about a pipeline structure. -// -// * GetPipelineExecution, which returns information about a specific execution -// of a pipeline. -// -// * GetPipelineState, which returns information about the current state -// of the stages and actions of a pipeline. -// -// * ListPipelines, which gets a summary of all of the pipelines associated -// with your account. -// -// * StartPipelineExecution, which runs the the most recent revision of an -// artifact through the pipeline. -// -// * UpdatePipeline, which updates a pipeline with edits or changes to the -// structure of the pipeline. -// -// Pipelines include stages, which are logical groupings of gates and actions. -// Each stage contains one or more actions that must complete before the next -// stage begins. A stage will result in success or failure. If a stage fails, -// then the pipeline stops at that stage and will remain stopped until either -// a new version of an artifact appears in the source location, or a user takes -// action to re-run the most recent artifact through the pipeline. You can call -// GetPipelineState, which displays the status of a pipeline, including the -// status of stages in the pipeline, or GetPipeline, which returns the entire -// structure of the pipeline, including the stages of that pipeline. For more -// information about the structure of stages and actions, also refer to the -// AWS CodePipeline Pipeline Structure Reference (http://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-structure.html). -// -// Pipeline stages include actions, which are categorized into categories such -// as source or build actions performed within a stage of a pipeline. For example, -// you can use a source action to import artifacts into a pipeline from a source -// such as Amazon S3. Like stages, you do not work with actions directly in -// most cases, but you do define and interact with actions when working with -// pipeline operations such as CreatePipeline and GetPipelineState. -// -// Pipelines also include transitions, which allow the transition of artifacts -// from one stage to the next in a pipeline after the actions in one stage complete. -// -// You can work with transitions by calling: -// -// * DisableStageTransition, which prevents artifacts from transitioning -// to the next stage in a pipeline. -// -// * EnableStageTransition, which enables transition of artifacts between -// stages in a pipeline. -// -// Using the API to integrate with AWS CodePipeline -// -// For third-party integrators or developers who want to create their own integrations -// with AWS CodePipeline, the expected sequence varies from the standard API -// user. In order to integrate with AWS CodePipeline, developers will need to -// work with the following items: -// -// Jobs, which are instances of an action. For example, a job for a source action -// might import a revision of an artifact from a source. -// -// You can work with jobs by calling: -// -// * AcknowledgeJob, which confirms whether a job worker has received the -// specified job, -// -// * GetJobDetails, which returns the details of a job, -// -// * PollForJobs, which determines whether there are any jobs to act upon, -// -// -// * PutJobFailureResult, which provides details of a job failure, and -// -// * PutJobSuccessResult, which provides details of a job success. -// -// Third party jobs, which are instances of an action created by a partner action -// and integrated into AWS CodePipeline. Partner actions are created by members -// of the AWS Partner Network. -// -// You can work with third party jobs by calling: -// -// * AcknowledgeThirdPartyJob, which confirms whether a job worker has received -// the specified job, -// -// * GetThirdPartyJobDetails, which requests the details of a job for a partner -// action, -// -// * PollForThirdPartyJobs, which determines whether there are any jobs to -// act upon, -// -// * PutThirdPartyJobFailureResult, which provides details of a job failure, -// and -// -// * PutThirdPartyJobSuccessResult, which provides details of a job success. -// 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/codepipeline-2015-07-09 -type CodePipeline 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 = "codepipeline" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CodePipeline 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 CodePipeline client from just a session. -// svc := codepipeline.New(mySession) -// -// // Create a CodePipeline client with additional configuration -// svc := codepipeline.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodePipeline { - 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) *CodePipeline { - svc := &CodePipeline{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-07-09", - JSONVersion: "1.1", - TargetPrefix: "CodePipeline_20150709", - }, - 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 CodePipeline operation and runs any -// custom request initialization. -func (c *CodePipeline) 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/configservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/configservice/api.go deleted file mode 100644 index c5b4467..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/api.go +++ /dev/null @@ -1,6237 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package configservice provides a client for AWS Config. -package configservice - -import ( - "fmt" - "time" - - "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 opDeleteConfigRule = "DeleteConfigRule" - -// DeleteConfigRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConfigRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteConfigRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteConfigRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteConfigRuleRequest method. -// req, resp := client.DeleteConfigRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigRule -func (c *ConfigService) DeleteConfigRuleRequest(input *DeleteConfigRuleInput) (req *request.Request, output *DeleteConfigRuleOutput) { - op := &request.Operation{ - Name: opDeleteConfigRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteConfigRuleInput{} - } - - output = &DeleteConfigRuleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConfigRule API operation for AWS Config. -// -// Deletes the specified AWS Config rule and all of its evaluation results. -// -// AWS Config sets the state of a rule to DELETING until the deletion is complete. -// You cannot update a rule while it is in this state. If you make a PutConfigRule -// or DeleteConfigRule request for the rule, you will receive a ResourceInUseException. -// -// You can check the state of a rule by using the DescribeConfigRules 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 AWS Config's -// API operation DeleteConfigRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The rule is currently being deleted or the rule is deleting your evaluation -// results. Try your request again later. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigRule -func (c *ConfigService) DeleteConfigRule(input *DeleteConfigRuleInput) (*DeleteConfigRuleOutput, error) { - req, out := c.DeleteConfigRuleRequest(input) - err := req.Send() - return out, err -} - -const opDeleteConfigurationRecorder = "DeleteConfigurationRecorder" - -// DeleteConfigurationRecorderRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConfigurationRecorder operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteConfigurationRecorder for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteConfigurationRecorder method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteConfigurationRecorderRequest method. -// req, resp := client.DeleteConfigurationRecorderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigurationRecorder -func (c *ConfigService) DeleteConfigurationRecorderRequest(input *DeleteConfigurationRecorderInput) (req *request.Request, output *DeleteConfigurationRecorderOutput) { - op := &request.Operation{ - Name: opDeleteConfigurationRecorder, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteConfigurationRecorderInput{} - } - - output = &DeleteConfigurationRecorderOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConfigurationRecorder API operation for AWS Config. -// -// Deletes the configuration recorder. -// -// After the configuration recorder is deleted, AWS Config will not record resource -// configuration changes until you create a new configuration recorder. -// -// This action does not delete the configuration information that was previously -// recorded. You will be able to access the previously recorded information -// by using the GetResourceConfigHistory action, but you will not be able to -// access this information in the AWS Config console until you create a new -// configuration recorder. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation DeleteConfigurationRecorder for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" -// You have specified a configuration recorder that does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigurationRecorder -func (c *ConfigService) DeleteConfigurationRecorder(input *DeleteConfigurationRecorderInput) (*DeleteConfigurationRecorderOutput, error) { - req, out := c.DeleteConfigurationRecorderRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDeliveryChannel = "DeleteDeliveryChannel" - -// DeleteDeliveryChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDeliveryChannel operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDeliveryChannel for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDeliveryChannel method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDeliveryChannelRequest method. -// req, resp := client.DeleteDeliveryChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteDeliveryChannel -func (c *ConfigService) DeleteDeliveryChannelRequest(input *DeleteDeliveryChannelInput) (req *request.Request, output *DeleteDeliveryChannelOutput) { - op := &request.Operation{ - Name: opDeleteDeliveryChannel, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDeliveryChannelInput{} - } - - output = &DeleteDeliveryChannelOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDeliveryChannel API operation for AWS Config. -// -// Deletes the delivery channel. -// -// Before you can delete the delivery channel, you must stop the configuration -// recorder by using the StopConfigurationRecorder action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation DeleteDeliveryChannel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchDeliveryChannelException "NoSuchDeliveryChannelException" -// You have specified a delivery channel that does not exist. -// -// * ErrCodeLastDeliveryChannelDeleteFailedException "LastDeliveryChannelDeleteFailedException" -// You cannot delete the delivery channel you specified because the configuration -// recorder is running. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteDeliveryChannel -func (c *ConfigService) DeleteDeliveryChannel(input *DeleteDeliveryChannelInput) (*DeleteDeliveryChannelOutput, error) { - req, out := c.DeleteDeliveryChannelRequest(input) - err := req.Send() - return out, err -} - -const opDeleteEvaluationResults = "DeleteEvaluationResults" - -// DeleteEvaluationResultsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEvaluationResults operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteEvaluationResults for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteEvaluationResults method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteEvaluationResultsRequest method. -// req, resp := client.DeleteEvaluationResultsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteEvaluationResults -func (c *ConfigService) DeleteEvaluationResultsRequest(input *DeleteEvaluationResultsInput) (req *request.Request, output *DeleteEvaluationResultsOutput) { - op := &request.Operation{ - Name: opDeleteEvaluationResults, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEvaluationResultsInput{} - } - - output = &DeleteEvaluationResultsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteEvaluationResults API operation for AWS Config. -// -// Deletes the evaluation results for the specified Config rule. You can specify -// one Config rule per request. After you delete the evaluation results, you -// can call the StartConfigRulesEvaluation API to start evaluating your AWS -// resources against the rule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation DeleteEvaluationResults for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The rule is currently being deleted or the rule is deleting your evaluation -// results. Try your request again later. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteEvaluationResults -func (c *ConfigService) DeleteEvaluationResults(input *DeleteEvaluationResultsInput) (*DeleteEvaluationResultsOutput, error) { - req, out := c.DeleteEvaluationResultsRequest(input) - err := req.Send() - return out, err -} - -const opDeliverConfigSnapshot = "DeliverConfigSnapshot" - -// DeliverConfigSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeliverConfigSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeliverConfigSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeliverConfigSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeliverConfigSnapshotRequest method. -// req, resp := client.DeliverConfigSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeliverConfigSnapshot -func (c *ConfigService) DeliverConfigSnapshotRequest(input *DeliverConfigSnapshotInput) (req *request.Request, output *DeliverConfigSnapshotOutput) { - op := &request.Operation{ - Name: opDeliverConfigSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeliverConfigSnapshotInput{} - } - - output = &DeliverConfigSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeliverConfigSnapshot API operation for AWS Config. -// -// Schedules delivery of a configuration snapshot to the Amazon S3 bucket in -// the specified delivery channel. After the delivery has started, AWS Config -// sends following notifications using an Amazon SNS topic that you have specified. -// -// * Notification of starting the delivery. -// -// * Notification of delivery completed, if the delivery was successfully -// completed. -// -// * Notification of delivery failure, if the delivery failed to 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 AWS Config's -// API operation DeliverConfigSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchDeliveryChannelException "NoSuchDeliveryChannelException" -// You have specified a delivery channel that does not exist. -// -// * ErrCodeNoAvailableConfigurationRecorderException "NoAvailableConfigurationRecorderException" -// There are no configuration recorders available to provide the role needed -// to describe your resources. Create a configuration recorder. -// -// * ErrCodeNoRunningConfigurationRecorderException "NoRunningConfigurationRecorderException" -// There is no configuration recorder running. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeliverConfigSnapshot -func (c *ConfigService) DeliverConfigSnapshot(input *DeliverConfigSnapshotInput) (*DeliverConfigSnapshotOutput, error) { - req, out := c.DeliverConfigSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opDescribeComplianceByConfigRule = "DescribeComplianceByConfigRule" - -// DescribeComplianceByConfigRuleRequest generates a "aws/request.Request" representing the -// client's request for the DescribeComplianceByConfigRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeComplianceByConfigRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeComplianceByConfigRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeComplianceByConfigRuleRequest method. -// req, resp := client.DescribeComplianceByConfigRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByConfigRule -func (c *ConfigService) DescribeComplianceByConfigRuleRequest(input *DescribeComplianceByConfigRuleInput) (req *request.Request, output *DescribeComplianceByConfigRuleOutput) { - op := &request.Operation{ - Name: opDescribeComplianceByConfigRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeComplianceByConfigRuleInput{} - } - - output = &DescribeComplianceByConfigRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeComplianceByConfigRule API operation for AWS Config. -// -// Indicates whether the specified AWS Config rules are compliant. If a rule -// is noncompliant, this action returns the number of AWS resources that do -// not comply with the rule. -// -// A rule is compliant if all of the evaluated resources comply with it, and -// it is noncompliant if any of these resources do not comply. -// -// If AWS Config has no current evaluation results for the rule, it returns -// INSUFFICIENT_DATA. This result might indicate one of the following conditions: -// -// * AWS Config has never invoked an evaluation for the rule. To check whether -// it has, use the DescribeConfigRuleEvaluationStatus action to get the LastSuccessfulInvocationTime -// and LastFailedInvocationTime. -// -// * The rule's AWS Lambda function is failing to send evaluation results -// to AWS Config. Verify that the role that you assigned to your configuration -// recorder includes the config:PutEvaluations permission. If the rule is -// a custom rule, verify that the AWS Lambda execution role includes the -// config:PutEvaluations permission. -// -// * The rule's AWS Lambda function has returned NOT_APPLICABLE for all evaluation -// results. This can occur if the resources were deleted or removed from -// the rule's scope. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation DescribeComplianceByConfigRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The specified next token is invalid. Specify the NextToken string that was -// returned in the previous response to get the next page of results. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByConfigRule -func (c *ConfigService) DescribeComplianceByConfigRule(input *DescribeComplianceByConfigRuleInput) (*DescribeComplianceByConfigRuleOutput, error) { - req, out := c.DescribeComplianceByConfigRuleRequest(input) - err := req.Send() - return out, err -} - -const opDescribeComplianceByResource = "DescribeComplianceByResource" - -// DescribeComplianceByResourceRequest generates a "aws/request.Request" representing the -// client's request for the DescribeComplianceByResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeComplianceByResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeComplianceByResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeComplianceByResourceRequest method. -// req, resp := client.DescribeComplianceByResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByResource -func (c *ConfigService) DescribeComplianceByResourceRequest(input *DescribeComplianceByResourceInput) (req *request.Request, output *DescribeComplianceByResourceOutput) { - op := &request.Operation{ - Name: opDescribeComplianceByResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeComplianceByResourceInput{} - } - - output = &DescribeComplianceByResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeComplianceByResource API operation for AWS Config. -// -// Indicates whether the specified AWS resources are compliant. If a resource -// is noncompliant, this action returns the number of AWS Config rules that -// the resource does not comply with. -// -// A resource is compliant if it complies with all the AWS Config rules that -// evaluate it. It is noncompliant if it does not comply with one or more of -// these rules. -// -// If AWS Config has no current evaluation results for the resource, it returns -// INSUFFICIENT_DATA. This result might indicate one of the following conditions -// about the rules that evaluate the resource: -// -// * AWS Config has never invoked an evaluation for the rule. To check whether -// it has, use the DescribeConfigRuleEvaluationStatus action to get the LastSuccessfulInvocationTime -// and LastFailedInvocationTime. -// -// * The rule's AWS Lambda function is failing to send evaluation results -// to AWS Config. Verify that the role that you assigned to your configuration -// recorder includes the config:PutEvaluations permission. If the rule is -// a custom rule, verify that the AWS Lambda execution role includes the -// config:PutEvaluations permission. -// -// * The rule's AWS Lambda function has returned NOT_APPLICABLE for all evaluation -// results. This can occur if the resources were deleted or removed from -// the rule's scope. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation DescribeComplianceByResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The specified next token is invalid. Specify the NextToken string that was -// returned in the previous response to get the next page of results. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByResource -func (c *ConfigService) DescribeComplianceByResource(input *DescribeComplianceByResourceInput) (*DescribeComplianceByResourceOutput, error) { - req, out := c.DescribeComplianceByResourceRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConfigRuleEvaluationStatus = "DescribeConfigRuleEvaluationStatus" - -// DescribeConfigRuleEvaluationStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConfigRuleEvaluationStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConfigRuleEvaluationStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConfigRuleEvaluationStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConfigRuleEvaluationStatusRequest method. -// req, resp := client.DescribeConfigRuleEvaluationStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRuleEvaluationStatus -func (c *ConfigService) DescribeConfigRuleEvaluationStatusRequest(input *DescribeConfigRuleEvaluationStatusInput) (req *request.Request, output *DescribeConfigRuleEvaluationStatusOutput) { - op := &request.Operation{ - Name: opDescribeConfigRuleEvaluationStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConfigRuleEvaluationStatusInput{} - } - - output = &DescribeConfigRuleEvaluationStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConfigRuleEvaluationStatus API operation for AWS Config. -// -// Returns status information for each of your AWS managed Config rules. The -// status includes information such as the last time AWS Config invoked the -// rule, the last time AWS Config failed to invoke the rule, and the related -// error for the last failure. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation DescribeConfigRuleEvaluationStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The specified next token is invalid. Specify the NextToken string that was -// returned in the previous response to get the next page of results. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRuleEvaluationStatus -func (c *ConfigService) DescribeConfigRuleEvaluationStatus(input *DescribeConfigRuleEvaluationStatusInput) (*DescribeConfigRuleEvaluationStatusOutput, error) { - req, out := c.DescribeConfigRuleEvaluationStatusRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConfigRules = "DescribeConfigRules" - -// DescribeConfigRulesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConfigRules operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConfigRules for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConfigRules method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConfigRulesRequest method. -// req, resp := client.DescribeConfigRulesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRules -func (c *ConfigService) DescribeConfigRulesRequest(input *DescribeConfigRulesInput) (req *request.Request, output *DescribeConfigRulesOutput) { - op := &request.Operation{ - Name: opDescribeConfigRules, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConfigRulesInput{} - } - - output = &DescribeConfigRulesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConfigRules API operation for AWS Config. -// -// Returns details about your AWS Config rules. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation DescribeConfigRules for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The specified next token is invalid. Specify the NextToken string that was -// returned in the previous response to get the next page of results. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRules -func (c *ConfigService) DescribeConfigRules(input *DescribeConfigRulesInput) (*DescribeConfigRulesOutput, error) { - req, out := c.DescribeConfigRulesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConfigurationRecorderStatus = "DescribeConfigurationRecorderStatus" - -// DescribeConfigurationRecorderStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConfigurationRecorderStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConfigurationRecorderStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConfigurationRecorderStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConfigurationRecorderStatusRequest method. -// req, resp := client.DescribeConfigurationRecorderStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorderStatus -func (c *ConfigService) DescribeConfigurationRecorderStatusRequest(input *DescribeConfigurationRecorderStatusInput) (req *request.Request, output *DescribeConfigurationRecorderStatusOutput) { - op := &request.Operation{ - Name: opDescribeConfigurationRecorderStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConfigurationRecorderStatusInput{} - } - - output = &DescribeConfigurationRecorderStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConfigurationRecorderStatus API operation for AWS Config. -// -// Returns the current status of the specified configuration recorder. If a -// configuration recorder is not specified, this action returns the status of -// all configuration recorder associated with the account. -// -// Currently, you can specify only one configuration recorder per region 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 AWS Config's -// API operation DescribeConfigurationRecorderStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" -// You have specified a configuration recorder that does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorderStatus -func (c *ConfigService) DescribeConfigurationRecorderStatus(input *DescribeConfigurationRecorderStatusInput) (*DescribeConfigurationRecorderStatusOutput, error) { - req, out := c.DescribeConfigurationRecorderStatusRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConfigurationRecorders = "DescribeConfigurationRecorders" - -// DescribeConfigurationRecordersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConfigurationRecorders operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConfigurationRecorders for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConfigurationRecorders method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConfigurationRecordersRequest method. -// req, resp := client.DescribeConfigurationRecordersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorders -func (c *ConfigService) DescribeConfigurationRecordersRequest(input *DescribeConfigurationRecordersInput) (req *request.Request, output *DescribeConfigurationRecordersOutput) { - op := &request.Operation{ - Name: opDescribeConfigurationRecorders, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConfigurationRecordersInput{} - } - - output = &DescribeConfigurationRecordersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConfigurationRecorders API operation for AWS Config. -// -// Returns the details for the specified configuration recorders. If the configuration -// recorder is not specified, this action returns the details for all configuration -// recorders associated with the account. -// -// Currently, you can specify only one configuration recorder per region 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 AWS Config's -// API operation DescribeConfigurationRecorders for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" -// You have specified a configuration recorder that does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorders -func (c *ConfigService) DescribeConfigurationRecorders(input *DescribeConfigurationRecordersInput) (*DescribeConfigurationRecordersOutput, error) { - req, out := c.DescribeConfigurationRecordersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDeliveryChannelStatus = "DescribeDeliveryChannelStatus" - -// DescribeDeliveryChannelStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDeliveryChannelStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDeliveryChannelStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDeliveryChannelStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDeliveryChannelStatusRequest method. -// req, resp := client.DescribeDeliveryChannelStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannelStatus -func (c *ConfigService) DescribeDeliveryChannelStatusRequest(input *DescribeDeliveryChannelStatusInput) (req *request.Request, output *DescribeDeliveryChannelStatusOutput) { - op := &request.Operation{ - Name: opDescribeDeliveryChannelStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDeliveryChannelStatusInput{} - } - - output = &DescribeDeliveryChannelStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDeliveryChannelStatus API operation for AWS Config. -// -// Returns the current status of the specified delivery channel. If a delivery -// channel is not specified, this action returns the current status of all delivery -// channels associated with the account. -// -// Currently, you can specify only one delivery channel per region 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 AWS Config's -// API operation DescribeDeliveryChannelStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchDeliveryChannelException "NoSuchDeliveryChannelException" -// You have specified a delivery channel that does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannelStatus -func (c *ConfigService) DescribeDeliveryChannelStatus(input *DescribeDeliveryChannelStatusInput) (*DescribeDeliveryChannelStatusOutput, error) { - req, out := c.DescribeDeliveryChannelStatusRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDeliveryChannels = "DescribeDeliveryChannels" - -// DescribeDeliveryChannelsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDeliveryChannels operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDeliveryChannels for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDeliveryChannels method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDeliveryChannelsRequest method. -// req, resp := client.DescribeDeliveryChannelsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannels -func (c *ConfigService) DescribeDeliveryChannelsRequest(input *DescribeDeliveryChannelsInput) (req *request.Request, output *DescribeDeliveryChannelsOutput) { - op := &request.Operation{ - Name: opDescribeDeliveryChannels, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDeliveryChannelsInput{} - } - - output = &DescribeDeliveryChannelsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDeliveryChannels API operation for AWS Config. -// -// Returns details about the specified delivery channel. If a delivery channel -// is not specified, this action returns the details of all delivery channels -// associated with the account. -// -// Currently, you can specify only one delivery channel per region 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 AWS Config's -// API operation DescribeDeliveryChannels for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchDeliveryChannelException "NoSuchDeliveryChannelException" -// You have specified a delivery channel that does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannels -func (c *ConfigService) DescribeDeliveryChannels(input *DescribeDeliveryChannelsInput) (*DescribeDeliveryChannelsOutput, error) { - req, out := c.DescribeDeliveryChannelsRequest(input) - err := req.Send() - return out, err -} - -const opGetComplianceDetailsByConfigRule = "GetComplianceDetailsByConfigRule" - -// GetComplianceDetailsByConfigRuleRequest generates a "aws/request.Request" representing the -// client's request for the GetComplianceDetailsByConfigRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetComplianceDetailsByConfigRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetComplianceDetailsByConfigRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetComplianceDetailsByConfigRuleRequest method. -// req, resp := client.GetComplianceDetailsByConfigRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByConfigRule -func (c *ConfigService) GetComplianceDetailsByConfigRuleRequest(input *GetComplianceDetailsByConfigRuleInput) (req *request.Request, output *GetComplianceDetailsByConfigRuleOutput) { - op := &request.Operation{ - Name: opGetComplianceDetailsByConfigRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetComplianceDetailsByConfigRuleInput{} - } - - output = &GetComplianceDetailsByConfigRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetComplianceDetailsByConfigRule API operation for AWS Config. -// -// Returns the evaluation results for the specified AWS Config rule. The results -// indicate which AWS resources were evaluated by the rule, when each resource -// was last evaluated, and whether each resource complies with the rule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation GetComplianceDetailsByConfigRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The specified next token is invalid. Specify the NextToken string that was -// returned in the previous response to get the next page of results. -// -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByConfigRule -func (c *ConfigService) GetComplianceDetailsByConfigRule(input *GetComplianceDetailsByConfigRuleInput) (*GetComplianceDetailsByConfigRuleOutput, error) { - req, out := c.GetComplianceDetailsByConfigRuleRequest(input) - err := req.Send() - return out, err -} - -const opGetComplianceDetailsByResource = "GetComplianceDetailsByResource" - -// GetComplianceDetailsByResourceRequest generates a "aws/request.Request" representing the -// client's request for the GetComplianceDetailsByResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetComplianceDetailsByResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetComplianceDetailsByResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetComplianceDetailsByResourceRequest method. -// req, resp := client.GetComplianceDetailsByResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByResource -func (c *ConfigService) GetComplianceDetailsByResourceRequest(input *GetComplianceDetailsByResourceInput) (req *request.Request, output *GetComplianceDetailsByResourceOutput) { - op := &request.Operation{ - Name: opGetComplianceDetailsByResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetComplianceDetailsByResourceInput{} - } - - output = &GetComplianceDetailsByResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetComplianceDetailsByResource API operation for AWS Config. -// -// Returns the evaluation results for the specified AWS resource. The results -// indicate which AWS Config rules were used to evaluate the resource, when -// each rule was last used, and whether the resource complies with each rule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation GetComplianceDetailsByResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByResource -func (c *ConfigService) GetComplianceDetailsByResource(input *GetComplianceDetailsByResourceInput) (*GetComplianceDetailsByResourceOutput, error) { - req, out := c.GetComplianceDetailsByResourceRequest(input) - err := req.Send() - return out, err -} - -const opGetComplianceSummaryByConfigRule = "GetComplianceSummaryByConfigRule" - -// GetComplianceSummaryByConfigRuleRequest generates a "aws/request.Request" representing the -// client's request for the GetComplianceSummaryByConfigRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetComplianceSummaryByConfigRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetComplianceSummaryByConfigRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetComplianceSummaryByConfigRuleRequest method. -// req, resp := client.GetComplianceSummaryByConfigRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByConfigRule -func (c *ConfigService) GetComplianceSummaryByConfigRuleRequest(input *GetComplianceSummaryByConfigRuleInput) (req *request.Request, output *GetComplianceSummaryByConfigRuleOutput) { - op := &request.Operation{ - Name: opGetComplianceSummaryByConfigRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetComplianceSummaryByConfigRuleInput{} - } - - output = &GetComplianceSummaryByConfigRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetComplianceSummaryByConfigRule API operation for AWS Config. -// -// Returns the number of AWS Config rules that are compliant and noncompliant, -// up to a maximum of 25 for each. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation GetComplianceSummaryByConfigRule for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByConfigRule -func (c *ConfigService) GetComplianceSummaryByConfigRule(input *GetComplianceSummaryByConfigRuleInput) (*GetComplianceSummaryByConfigRuleOutput, error) { - req, out := c.GetComplianceSummaryByConfigRuleRequest(input) - err := req.Send() - return out, err -} - -const opGetComplianceSummaryByResourceType = "GetComplianceSummaryByResourceType" - -// GetComplianceSummaryByResourceTypeRequest generates a "aws/request.Request" representing the -// client's request for the GetComplianceSummaryByResourceType operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetComplianceSummaryByResourceType for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetComplianceSummaryByResourceType method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetComplianceSummaryByResourceTypeRequest method. -// req, resp := client.GetComplianceSummaryByResourceTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByResourceType -func (c *ConfigService) GetComplianceSummaryByResourceTypeRequest(input *GetComplianceSummaryByResourceTypeInput) (req *request.Request, output *GetComplianceSummaryByResourceTypeOutput) { - op := &request.Operation{ - Name: opGetComplianceSummaryByResourceType, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetComplianceSummaryByResourceTypeInput{} - } - - output = &GetComplianceSummaryByResourceTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetComplianceSummaryByResourceType API operation for AWS Config. -// -// Returns the number of resources that are compliant and the number that are -// noncompliant. You can specify one or more resource types to get these numbers -// for each resource type. The maximum number returned is 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 AWS Config's -// API operation GetComplianceSummaryByResourceType for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByResourceType -func (c *ConfigService) GetComplianceSummaryByResourceType(input *GetComplianceSummaryByResourceTypeInput) (*GetComplianceSummaryByResourceTypeOutput, error) { - req, out := c.GetComplianceSummaryByResourceTypeRequest(input) - err := req.Send() - return out, err -} - -const opGetResourceConfigHistory = "GetResourceConfigHistory" - -// GetResourceConfigHistoryRequest generates a "aws/request.Request" representing the -// client's request for the GetResourceConfigHistory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetResourceConfigHistory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetResourceConfigHistory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetResourceConfigHistoryRequest method. -// req, resp := client.GetResourceConfigHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetResourceConfigHistory -func (c *ConfigService) GetResourceConfigHistoryRequest(input *GetResourceConfigHistoryInput) (req *request.Request, output *GetResourceConfigHistoryOutput) { - op := &request.Operation{ - Name: opGetResourceConfigHistory, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetResourceConfigHistoryInput{} - } - - output = &GetResourceConfigHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetResourceConfigHistory API operation for AWS Config. -// -// Returns a list of configuration items for the specified resource. The list -// contains details about each state of the resource during the specified time -// interval. -// -// The response is paginated, and by default, AWS Config returns a limit of -// 10 configuration items per page. You can customize this number with the limit -// parameter. The response includes a nextToken string, and to get the next -// page of results, run the request again and enter this string for the nextToken -// parameter. -// -// Each call to the API is limited to span a duration of seven days. It is likely -// that the number of records returned is smaller than the specified limit. -// In such cases, you can make another call, using the 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 AWS Config's -// API operation GetResourceConfigHistory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The requested action is not valid. -// -// * ErrCodeInvalidTimeRangeException "InvalidTimeRangeException" -// The specified time range is not valid. The earlier time is not chronologically -// before the later time. -// -// * ErrCodeInvalidLimitException "InvalidLimitException" -// The specified limit is outside the allowable range. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The specified next token is invalid. Specify the NextToken string that was -// returned in the previous response to get the next page of results. -// -// * ErrCodeNoAvailableConfigurationRecorderException "NoAvailableConfigurationRecorderException" -// There are no configuration recorders available to provide the role needed -// to describe your resources. Create a configuration recorder. -// -// * ErrCodeResourceNotDiscoveredException "ResourceNotDiscoveredException" -// You have specified a resource that is either unknown or has not been discovered. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetResourceConfigHistory -func (c *ConfigService) GetResourceConfigHistory(input *GetResourceConfigHistoryInput) (*GetResourceConfigHistoryOutput, error) { - req, out := c.GetResourceConfigHistoryRequest(input) - err := req.Send() - return out, err -} - -// GetResourceConfigHistoryPages iterates over the pages of a GetResourceConfigHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetResourceConfigHistory 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 GetResourceConfigHistory operation. -// pageNum := 0 -// err := client.GetResourceConfigHistoryPages(params, -// func(page *GetResourceConfigHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ConfigService) GetResourceConfigHistoryPages(input *GetResourceConfigHistoryInput, fn func(p *GetResourceConfigHistoryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetResourceConfigHistoryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetResourceConfigHistoryOutput), lastPage) - }) -} - -const opListDiscoveredResources = "ListDiscoveredResources" - -// ListDiscoveredResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListDiscoveredResources operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDiscoveredResources for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDiscoveredResources method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDiscoveredResourcesRequest method. -// req, resp := client.ListDiscoveredResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListDiscoveredResources -func (c *ConfigService) ListDiscoveredResourcesRequest(input *ListDiscoveredResourcesInput) (req *request.Request, output *ListDiscoveredResourcesOutput) { - op := &request.Operation{ - Name: opListDiscoveredResources, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListDiscoveredResourcesInput{} - } - - output = &ListDiscoveredResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDiscoveredResources API operation for AWS Config. -// -// Accepts a resource type and returns a list of resource identifiers for the -// resources of that type. A resource identifier includes the resource type, -// ID, and (if available) the custom resource name. The results consist of resources -// that AWS Config has discovered, including those that AWS Config is not currently -// recording. You can narrow the results to include only resources that have -// specific resource IDs or a resource name. -// -// You can specify either resource IDs or a resource name but not both in the -// same request. -// -// The response is paginated, and by default AWS Config lists 100 resource identifiers -// on each page. You can customize this number with the limit parameter. The -// response includes a nextToken string, and to get the next page of results, -// run the request again and enter this string for the nextToken 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 AWS Config's -// API operation ListDiscoveredResources for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The requested action is not valid. -// -// * ErrCodeInvalidLimitException "InvalidLimitException" -// The specified limit is outside the allowable range. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The specified next token is invalid. Specify the NextToken string that was -// returned in the previous response to get the next page of results. -// -// * ErrCodeNoAvailableConfigurationRecorderException "NoAvailableConfigurationRecorderException" -// There are no configuration recorders available to provide the role needed -// to describe your resources. Create a configuration recorder. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListDiscoveredResources -func (c *ConfigService) ListDiscoveredResources(input *ListDiscoveredResourcesInput) (*ListDiscoveredResourcesOutput, error) { - req, out := c.ListDiscoveredResourcesRequest(input) - err := req.Send() - return out, err -} - -const opPutConfigRule = "PutConfigRule" - -// PutConfigRuleRequest generates a "aws/request.Request" representing the -// client's request for the PutConfigRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutConfigRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutConfigRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutConfigRuleRequest method. -// req, resp := client.PutConfigRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigRule -func (c *ConfigService) PutConfigRuleRequest(input *PutConfigRuleInput) (req *request.Request, output *PutConfigRuleOutput) { - op := &request.Operation{ - Name: opPutConfigRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutConfigRuleInput{} - } - - output = &PutConfigRuleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutConfigRule API operation for AWS Config. -// -// Adds or updates an AWS Config rule for evaluating whether your AWS resources -// comply with your desired configurations. -// -// You can use this action for custom Config rules and AWS managed Config rules. -// A custom Config rule is a rule that you develop and maintain. An AWS managed -// Config rule is a customizable, predefined rule that AWS Config provides. -// -// If you are adding a new custom Config rule, you must first create the AWS -// Lambda function that the rule invokes to evaluate your resources. When you -// use the PutConfigRule action to add the rule to AWS Config, you must specify -// the Amazon Resource Name (ARN) that AWS Lambda assigns to the function. Specify -// the ARN for the SourceIdentifier key. This key is part of the Source object, -// which is part of the ConfigRule object. -// -// If you are adding a new AWS managed Config rule, specify the rule's identifier -// for the SourceIdentifier key. To reference AWS managed Config rule identifiers, -// see Using AWS Managed Config Rules (http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). -// -// For any new rule that you add, specify the ConfigRuleName in the ConfigRule -// object. Do not specify the ConfigRuleArn or the ConfigRuleId. These values -// are generated by AWS Config for new rules. -// -// If you are updating a rule that you added previously, you can specify the -// rule by ConfigRuleName, ConfigRuleId, or ConfigRuleArn in the ConfigRule -// data type that you use in this request. -// -// The maximum number of rules that AWS Config supports is 50. -// -// For more information about requesting a rule limit increase, see AWS Config -// Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_config) -// in the AWS General Reference Guide. -// -// For more information about developing and using AWS Config rules, see Evaluating -// AWS Resource Configurations with AWS Config (http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) -// in the AWS Config 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 AWS Config's -// API operation PutConfigRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// * ErrCodeMaxNumberOfConfigRulesExceededException "MaxNumberOfConfigRulesExceededException" -// Failed to add the AWS Config rule because the account already contains the -// maximum number of 50 rules. Consider deleting any deactivated rules before -// adding new rules. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The rule is currently being deleted or the rule is deleting your evaluation -// results. Try your request again later. -// -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" -// Indicates one of the following errors: -// -// * The rule cannot be created because the IAM role assigned to AWS Config -// lacks permissions to perform the config:Put* action. -// -// * The AWS Lambda function cannot be invoked. Check the function ARN, and -// check the function's permissions. -// -// * ErrCodeNoAvailableConfigurationRecorderException "NoAvailableConfigurationRecorderException" -// There are no configuration recorders available to provide the role needed -// to describe your resources. Create a configuration recorder. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigRule -func (c *ConfigService) PutConfigRule(input *PutConfigRuleInput) (*PutConfigRuleOutput, error) { - req, out := c.PutConfigRuleRequest(input) - err := req.Send() - return out, err -} - -const opPutConfigurationRecorder = "PutConfigurationRecorder" - -// PutConfigurationRecorderRequest generates a "aws/request.Request" representing the -// client's request for the PutConfigurationRecorder operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutConfigurationRecorder for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutConfigurationRecorder method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutConfigurationRecorderRequest method. -// req, resp := client.PutConfigurationRecorderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationRecorder -func (c *ConfigService) PutConfigurationRecorderRequest(input *PutConfigurationRecorderInput) (req *request.Request, output *PutConfigurationRecorderOutput) { - op := &request.Operation{ - Name: opPutConfigurationRecorder, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutConfigurationRecorderInput{} - } - - output = &PutConfigurationRecorderOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutConfigurationRecorder API operation for AWS Config. -// -// Creates a new configuration recorder to record the selected resource configurations. -// -// You can use this action to change the role roleARN and/or the recordingGroup -// of an existing recorder. To change the role, call the action on the existing -// configuration recorder and specify a role. -// -// Currently, you can specify only one configuration recorder per region in -// your account. -// -// If ConfigurationRecorder does not have the recordingGroup parameter specified, -// the default is to record all supported resource types. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation PutConfigurationRecorder for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMaxNumberOfConfigurationRecordersExceededException "MaxNumberOfConfigurationRecordersExceededException" -// You have reached the limit on the number of recorders you can create. -// -// * ErrCodeInvalidConfigurationRecorderNameException "InvalidConfigurationRecorderNameException" -// You have provided a configuration recorder name that is not valid. -// -// * ErrCodeInvalidRoleException "InvalidRoleException" -// You have provided a null or empty role ARN. -// -// * ErrCodeInvalidRecordingGroupException "InvalidRecordingGroupException" -// AWS Config throws an exception if the recording group does not contain a -// valid list of resource types. Invalid values could also be incorrectly formatted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationRecorder -func (c *ConfigService) PutConfigurationRecorder(input *PutConfigurationRecorderInput) (*PutConfigurationRecorderOutput, error) { - req, out := c.PutConfigurationRecorderRequest(input) - err := req.Send() - return out, err -} - -const opPutDeliveryChannel = "PutDeliveryChannel" - -// PutDeliveryChannelRequest generates a "aws/request.Request" representing the -// client's request for the PutDeliveryChannel operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutDeliveryChannel for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutDeliveryChannel method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutDeliveryChannelRequest method. -// req, resp := client.PutDeliveryChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutDeliveryChannel -func (c *ConfigService) PutDeliveryChannelRequest(input *PutDeliveryChannelInput) (req *request.Request, output *PutDeliveryChannelOutput) { - op := &request.Operation{ - Name: opPutDeliveryChannel, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutDeliveryChannelInput{} - } - - output = &PutDeliveryChannelOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutDeliveryChannel API operation for AWS Config. -// -// Creates a delivery channel object to deliver configuration information to -// an Amazon S3 bucket and Amazon SNS topic. -// -// Before you can create a delivery channel, you must create a configuration -// recorder. -// -// You can use this action to change the Amazon S3 bucket or an Amazon SNS topic -// of the existing delivery channel. To change the Amazon S3 bucket or an Amazon -// SNS topic, call this action and specify the changed values for the S3 bucket -// and the SNS topic. If you specify a different value for either the S3 bucket -// or the SNS topic, this action will keep the existing value for the parameter -// that is not changed. -// -// You can have only one delivery channel per region 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 AWS Config's -// API operation PutDeliveryChannel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMaxNumberOfDeliveryChannelsExceededException "MaxNumberOfDeliveryChannelsExceededException" -// You have reached the limit on the number of delivery channels you can create. -// -// * ErrCodeNoAvailableConfigurationRecorderException "NoAvailableConfigurationRecorderException" -// There are no configuration recorders available to provide the role needed -// to describe your resources. Create a configuration recorder. -// -// * ErrCodeInvalidDeliveryChannelNameException "InvalidDeliveryChannelNameException" -// The specified delivery channel name is not valid. -// -// * ErrCodeNoSuchBucketException "NoSuchBucketException" -// The specified Amazon S3 bucket does not exist. -// -// * ErrCodeInvalidS3KeyPrefixException "InvalidS3KeyPrefixException" -// The specified Amazon S3 key prefix is not valid. -// -// * ErrCodeInvalidSNSTopicARNException "InvalidSNSTopicARNException" -// The specified Amazon SNS topic does not exist. -// -// * ErrCodeInsufficientDeliveryPolicyException "InsufficientDeliveryPolicyException" -// Your Amazon S3 bucket policy does not permit AWS Config to write to it. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutDeliveryChannel -func (c *ConfigService) PutDeliveryChannel(input *PutDeliveryChannelInput) (*PutDeliveryChannelOutput, error) { - req, out := c.PutDeliveryChannelRequest(input) - err := req.Send() - return out, err -} - -const opPutEvaluations = "PutEvaluations" - -// PutEvaluationsRequest generates a "aws/request.Request" representing the -// client's request for the PutEvaluations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutEvaluations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutEvaluations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutEvaluationsRequest method. -// req, resp := client.PutEvaluationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutEvaluations -func (c *ConfigService) PutEvaluationsRequest(input *PutEvaluationsInput) (req *request.Request, output *PutEvaluationsOutput) { - op := &request.Operation{ - Name: opPutEvaluations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutEvaluationsInput{} - } - - output = &PutEvaluationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutEvaluations API operation for AWS Config. -// -// Used by an AWS Lambda function to deliver evaluation results to AWS Config. -// This action is required in every AWS Lambda function that is invoked by an -// AWS Config rule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation PutEvaluations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// * ErrCodeInvalidResultTokenException "InvalidResultTokenException" -// The specified ResultToken is invalid. -// -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutEvaluations -func (c *ConfigService) PutEvaluations(input *PutEvaluationsInput) (*PutEvaluationsOutput, error) { - req, out := c.PutEvaluationsRequest(input) - err := req.Send() - return out, err -} - -const opStartConfigRulesEvaluation = "StartConfigRulesEvaluation" - -// StartConfigRulesEvaluationRequest generates a "aws/request.Request" representing the -// client's request for the StartConfigRulesEvaluation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartConfigRulesEvaluation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartConfigRulesEvaluation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartConfigRulesEvaluationRequest method. -// req, resp := client.StartConfigRulesEvaluationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigRulesEvaluation -func (c *ConfigService) StartConfigRulesEvaluationRequest(input *StartConfigRulesEvaluationInput) (req *request.Request, output *StartConfigRulesEvaluationOutput) { - op := &request.Operation{ - Name: opStartConfigRulesEvaluation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartConfigRulesEvaluationInput{} - } - - output = &StartConfigRulesEvaluationOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartConfigRulesEvaluation API operation for AWS Config. -// -// Runs an on-demand evaluation for the specified Config rules against the last -// known configuration state of the resources. Use StartConfigRulesEvaluation -// when you want to test a rule that you updated is working as expected. StartConfigRulesEvaluation -// does not re-record the latest configuration state for your resources; it -// re-runs an evaluation against the last known state of your resources. -// -// You can specify up to 25 Config rules per request. -// -// An existing StartConfigRulesEvaluation call must complete for the specified -// rules before you can call the API again. If you chose to have AWS Config -// stream to an Amazon SNS topic, you will receive a ConfigRuleEvaluationStarted -// notification when the evaluation starts. -// -// You don't need to call the StartConfigRulesEvaluation API to run an evaluation -// for a new rule. When you create a new rule, AWS Config automatically evaluates -// your resources against the rule. -// -// The StartConfigRulesEvaluation API is useful if you want to run on-demand -// evaluations, such as the following example: -// -// You have a custom rule that evaluates your IAM resources every 24 hours. -// -// You update your Lambda function to add additional conditions to your rule. -// -// Instead of waiting for the next periodic evaluation, you call the StartConfigRulesEvaluation -// API. -// -// AWS Config invokes your Lambda function and evaluates your IAM resources. -// -// Your custom rule will still run periodic evaluations every 24 hours. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation StartConfigRulesEvaluation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// This exception is thrown if an evaluation is in progress or if you call the -// StartConfigRulesEvaluation API more than once per minute. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The rule is currently being deleted or the rule is deleting your evaluation -// results. Try your request again later. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigRulesEvaluation -func (c *ConfigService) StartConfigRulesEvaluation(input *StartConfigRulesEvaluationInput) (*StartConfigRulesEvaluationOutput, error) { - req, out := c.StartConfigRulesEvaluationRequest(input) - err := req.Send() - return out, err -} - -const opStartConfigurationRecorder = "StartConfigurationRecorder" - -// StartConfigurationRecorderRequest generates a "aws/request.Request" representing the -// client's request for the StartConfigurationRecorder operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartConfigurationRecorder for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartConfigurationRecorder method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartConfigurationRecorderRequest method. -// req, resp := client.StartConfigurationRecorderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigurationRecorder -func (c *ConfigService) StartConfigurationRecorderRequest(input *StartConfigurationRecorderInput) (req *request.Request, output *StartConfigurationRecorderOutput) { - op := &request.Operation{ - Name: opStartConfigurationRecorder, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartConfigurationRecorderInput{} - } - - output = &StartConfigurationRecorderOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartConfigurationRecorder API operation for AWS Config. -// -// Starts recording configurations of the AWS resources you have selected to -// record in your AWS account. -// -// You must have created at least one delivery channel to successfully start -// the configuration recorder. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Config's -// API operation StartConfigurationRecorder for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" -// You have specified a configuration recorder that does not exist. -// -// * ErrCodeNoAvailableDeliveryChannelException "NoAvailableDeliveryChannelException" -// There is no delivery channel available to record configurations. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigurationRecorder -func (c *ConfigService) StartConfigurationRecorder(input *StartConfigurationRecorderInput) (*StartConfigurationRecorderOutput, error) { - req, out := c.StartConfigurationRecorderRequest(input) - err := req.Send() - return out, err -} - -const opStopConfigurationRecorder = "StopConfigurationRecorder" - -// StopConfigurationRecorderRequest generates a "aws/request.Request" representing the -// client's request for the StopConfigurationRecorder operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopConfigurationRecorder for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopConfigurationRecorder method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopConfigurationRecorderRequest method. -// req, resp := client.StopConfigurationRecorderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StopConfigurationRecorder -func (c *ConfigService) StopConfigurationRecorderRequest(input *StopConfigurationRecorderInput) (req *request.Request, output *StopConfigurationRecorderOutput) { - op := &request.Operation{ - Name: opStopConfigurationRecorder, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopConfigurationRecorderInput{} - } - - output = &StopConfigurationRecorderOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopConfigurationRecorder API operation for AWS Config. -// -// Stops recording configurations of the AWS resources you have selected to -// record in your 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 AWS Config's -// API operation StopConfigurationRecorder for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" -// You have specified a configuration recorder that does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StopConfigurationRecorder -func (c *ConfigService) StopConfigurationRecorder(input *StopConfigurationRecorderInput) (*StopConfigurationRecorderOutput, error) { - req, out := c.StopConfigurationRecorderRequest(input) - err := req.Send() - return out, err -} - -// Indicates whether an AWS resource or AWS Config rule is compliant and provides -// the number of contributors that affect the compliance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/Compliance -type Compliance struct { - _ struct{} `type:"structure"` - - // The number of AWS resources or AWS Config rules that cause a result of NON_COMPLIANT, - // up to a maximum number. - ComplianceContributorCount *ComplianceContributorCount `type:"structure"` - - // Indicates whether an AWS resource or AWS Config rule is compliant. - // - // A resource is compliant if it complies with all of the AWS Config rules that - // evaluate it, and it is noncompliant if it does not comply with one or more - // of these rules. - // - // A rule is compliant if all of the resources that the rule evaluates comply - // with it, and it is noncompliant if any of these resources do not comply. - // - // AWS Config returns the INSUFFICIENT_DATA value when no evaluation results - // are available for the AWS resource or Config rule. - // - // For the Compliance data type, AWS Config supports only COMPLIANT, NON_COMPLIANT, - // and INSUFFICIENT_DATA values. AWS Config does not support the NOT_APPLICABLE - // value for the Compliance data type. - ComplianceType *string `type:"string" enum:"ComplianceType"` -} - -// String returns the string representation -func (s Compliance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Compliance) GoString() string { - return s.String() -} - -// SetComplianceContributorCount sets the ComplianceContributorCount field's value. -func (s *Compliance) SetComplianceContributorCount(v *ComplianceContributorCount) *Compliance { - s.ComplianceContributorCount = v - return s -} - -// SetComplianceType sets the ComplianceType field's value. -func (s *Compliance) SetComplianceType(v string) *Compliance { - s.ComplianceType = &v - return s -} - -// Indicates whether an AWS Config rule is compliant. A rule is compliant if -// all of the resources that the rule evaluated comply with it, and it is noncompliant -// if any of these resources do not comply. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ComplianceByConfigRule -type ComplianceByConfigRule struct { - _ struct{} `type:"structure"` - - // Indicates whether the AWS Config rule is compliant. - Compliance *Compliance `type:"structure"` - - // The name of the AWS Config rule. - ConfigRuleName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ComplianceByConfigRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ComplianceByConfigRule) GoString() string { - return s.String() -} - -// SetCompliance sets the Compliance field's value. -func (s *ComplianceByConfigRule) SetCompliance(v *Compliance) *ComplianceByConfigRule { - s.Compliance = v - return s -} - -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *ComplianceByConfigRule) SetConfigRuleName(v string) *ComplianceByConfigRule { - s.ConfigRuleName = &v - return s -} - -// Indicates whether an AWS resource that is evaluated according to one or more -// AWS Config rules is compliant. A resource is compliant if it complies with -// all of the rules that evaluate it, and it is noncompliant if it does not -// comply with one or more of these rules. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ComplianceByResource -type ComplianceByResource struct { - _ struct{} `type:"structure"` - - // Indicates whether the AWS resource complies with all of the AWS Config rules - // that evaluated it. - Compliance *Compliance `type:"structure"` - - // The ID of the AWS resource that was evaluated. - ResourceId *string `min:"1" type:"string"` - - // The type of the AWS resource that was evaluated. - ResourceType *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ComplianceByResource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ComplianceByResource) GoString() string { - return s.String() -} - -// SetCompliance sets the Compliance field's value. -func (s *ComplianceByResource) SetCompliance(v *Compliance) *ComplianceByResource { - s.Compliance = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ComplianceByResource) SetResourceId(v string) *ComplianceByResource { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ComplianceByResource) SetResourceType(v string) *ComplianceByResource { - s.ResourceType = &v - return s -} - -// The number of AWS resources or AWS Config rules responsible for the current -// compliance of the item, up to a maximum number. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ComplianceContributorCount -type ComplianceContributorCount struct { - _ struct{} `type:"structure"` - - // Indicates whether the maximum count is reached. - CapExceeded *bool `type:"boolean"` - - // The number of AWS resources or AWS Config rules responsible for the current - // compliance of the item. - CappedCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s ComplianceContributorCount) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ComplianceContributorCount) GoString() string { - return s.String() -} - -// SetCapExceeded sets the CapExceeded field's value. -func (s *ComplianceContributorCount) SetCapExceeded(v bool) *ComplianceContributorCount { - s.CapExceeded = &v - return s -} - -// SetCappedCount sets the CappedCount field's value. -func (s *ComplianceContributorCount) SetCappedCount(v int64) *ComplianceContributorCount { - s.CappedCount = &v - return s -} - -// The number of AWS Config rules or AWS resources that are compliant and noncompliant. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ComplianceSummary -type ComplianceSummary struct { - _ struct{} `type:"structure"` - - // The time that AWS Config created the compliance summary. - ComplianceSummaryTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The number of AWS Config rules or AWS resources that are compliant, up to - // a maximum of 25 for rules and 100 for resources. - CompliantResourceCount *ComplianceContributorCount `type:"structure"` - - // The number of AWS Config rules or AWS resources that are noncompliant, up - // to a maximum of 25 for rules and 100 for resources. - NonCompliantResourceCount *ComplianceContributorCount `type:"structure"` -} - -// String returns the string representation -func (s ComplianceSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ComplianceSummary) GoString() string { - return s.String() -} - -// SetComplianceSummaryTimestamp sets the ComplianceSummaryTimestamp field's value. -func (s *ComplianceSummary) SetComplianceSummaryTimestamp(v time.Time) *ComplianceSummary { - s.ComplianceSummaryTimestamp = &v - return s -} - -// SetCompliantResourceCount sets the CompliantResourceCount field's value. -func (s *ComplianceSummary) SetCompliantResourceCount(v *ComplianceContributorCount) *ComplianceSummary { - s.CompliantResourceCount = v - return s -} - -// SetNonCompliantResourceCount sets the NonCompliantResourceCount field's value. -func (s *ComplianceSummary) SetNonCompliantResourceCount(v *ComplianceContributorCount) *ComplianceSummary { - s.NonCompliantResourceCount = v - return s -} - -// The number of AWS resources of a specific type that are compliant or noncompliant, -// up to a maximum of 100 for each compliance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ComplianceSummaryByResourceType -type ComplianceSummaryByResourceType struct { - _ struct{} `type:"structure"` - - // The number of AWS resources that are compliant or noncompliant, up to a maximum - // of 100 for each compliance. - ComplianceSummary *ComplianceSummary `type:"structure"` - - // The type of AWS resource. - ResourceType *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ComplianceSummaryByResourceType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ComplianceSummaryByResourceType) GoString() string { - return s.String() -} - -// SetComplianceSummary sets the ComplianceSummary field's value. -func (s *ComplianceSummaryByResourceType) SetComplianceSummary(v *ComplianceSummary) *ComplianceSummaryByResourceType { - s.ComplianceSummary = v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ComplianceSummaryByResourceType) SetResourceType(v string) *ComplianceSummaryByResourceType { - s.ResourceType = &v - return s -} - -// A list that contains the status of the delivery of either the snapshot or -// the configuration history to the specified Amazon S3 bucket. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ConfigExportDeliveryInfo -type ConfigExportDeliveryInfo struct { - _ struct{} `type:"structure"` - - // The time of the last attempted delivery. - LastAttemptTime *time.Time `locationName:"lastAttemptTime" type:"timestamp" timestampFormat:"unix"` - - // The error code from the last attempted delivery. - LastErrorCode *string `locationName:"lastErrorCode" type:"string"` - - // The error message from the last attempted delivery. - LastErrorMessage *string `locationName:"lastErrorMessage" type:"string"` - - // Status of the last attempted delivery. - LastStatus *string `locationName:"lastStatus" type:"string" enum:"DeliveryStatus"` - - // The time of the last successful delivery. - LastSuccessfulTime *time.Time `locationName:"lastSuccessfulTime" type:"timestamp" timestampFormat:"unix"` - - // The time that the next delivery occurs. - NextDeliveryTime *time.Time `locationName:"nextDeliveryTime" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s ConfigExportDeliveryInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigExportDeliveryInfo) GoString() string { - return s.String() -} - -// SetLastAttemptTime sets the LastAttemptTime field's value. -func (s *ConfigExportDeliveryInfo) SetLastAttemptTime(v time.Time) *ConfigExportDeliveryInfo { - s.LastAttemptTime = &v - return s -} - -// SetLastErrorCode sets the LastErrorCode field's value. -func (s *ConfigExportDeliveryInfo) SetLastErrorCode(v string) *ConfigExportDeliveryInfo { - s.LastErrorCode = &v - return s -} - -// SetLastErrorMessage sets the LastErrorMessage field's value. -func (s *ConfigExportDeliveryInfo) SetLastErrorMessage(v string) *ConfigExportDeliveryInfo { - s.LastErrorMessage = &v - return s -} - -// SetLastStatus sets the LastStatus field's value. -func (s *ConfigExportDeliveryInfo) SetLastStatus(v string) *ConfigExportDeliveryInfo { - s.LastStatus = &v - return s -} - -// SetLastSuccessfulTime sets the LastSuccessfulTime field's value. -func (s *ConfigExportDeliveryInfo) SetLastSuccessfulTime(v time.Time) *ConfigExportDeliveryInfo { - s.LastSuccessfulTime = &v - return s -} - -// SetNextDeliveryTime sets the NextDeliveryTime field's value. -func (s *ConfigExportDeliveryInfo) SetNextDeliveryTime(v time.Time) *ConfigExportDeliveryInfo { - s.NextDeliveryTime = &v - return s -} - -// An AWS Config rule represents an AWS Lambda function that you create for -// a custom rule or a predefined function for an AWS managed rule. The function -// evaluates configuration items to assess whether your AWS resources comply -// with your desired configurations. This function can run when AWS Config detects -// a configuration change to an AWS resource and at a periodic frequency that -// you choose (for example, every 24 hours). -// -// You can use the AWS CLI and AWS SDKs if you want to create a rule that triggers -// evaluations for your resources when AWS Config delivers the configuration -// snapshot. For more information, see ConfigSnapshotDeliveryProperties. -// -// For more information about developing and using AWS Config rules, see Evaluating -// AWS Resource Configurations with AWS Config (http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) -// in the AWS Config Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ConfigRule -type ConfigRule struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the AWS Config rule. - ConfigRuleArn *string `type:"string"` - - // The ID of the AWS Config rule. - ConfigRuleId *string `type:"string"` - - // The name that you assign to the AWS Config rule. The name is required if - // you are adding a new rule. - ConfigRuleName *string `min:"1" type:"string"` - - // Indicates whether the AWS Config rule is active or is currently being deleted - // by AWS Config. It can also indicate the evaluation status for the Config - // rule. - // - // AWS Config sets the state of the rule to EVALUATING temporarily after you - // use the StartConfigRulesEvaluation request to evaluate your resources against - // the Config rule. - // - // AWS Config sets the state of the rule to DELETING_RESULTS temporarily after - // you use the DeleteEvaluationResults request to delete the current evaluation - // results for the Config rule. - // - // AWS Config sets the state of a rule to DELETING temporarily after you use - // the DeleteConfigRule request to delete the rule. After AWS Config deletes - // the rule, the rule and all of its evaluations are erased and are no longer - // available. - ConfigRuleState *string `type:"string" enum:"ConfigRuleState"` - - // The description that you provide for the AWS Config rule. - Description *string `type:"string"` - - // A string in JSON format that is passed to the AWS Config rule Lambda function. - InputParameters *string `min:"1" type:"string"` - - // The maximum frequency with which AWS Config runs evaluations for a rule. - // You can specify a value for MaximumExecutionFrequency when: - // - // * You are using an AWS managed rule that is triggered at a periodic frequency. - // - // * Your custom rule is triggered when AWS Config delivers the configuration - // snapshot. - // - // For more information, see ConfigSnapshotDeliveryProperties. - MaximumExecutionFrequency *string `type:"string" enum:"MaximumExecutionFrequency"` - - // Defines which resources can trigger an evaluation for the rule. The scope - // can include one or more resource types, a combination of one resource type - // and one resource ID, or a combination of a tag key and value. Specify a scope - // to constrain the resources that can trigger an evaluation for the rule. If - // you do not specify a scope, evaluations are triggered when any resource in - // the recording group changes. - Scope *Scope `type:"structure"` - - // Provides the rule owner (AWS or customer), the rule identifier, and the notifications - // that cause the function to evaluate your AWS resources. - // - // Source is a required field - Source *Source `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ConfigRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfigRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfigRule"} - if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) - } - if s.InputParameters != nil && len(*s.InputParameters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputParameters", 1)) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.Scope != nil { - if err := s.Scope.Validate(); err != nil { - invalidParams.AddNested("Scope", err.(request.ErrInvalidParams)) - } - } - if s.Source != nil { - if err := s.Source.Validate(); err != nil { - invalidParams.AddNested("Source", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigRuleArn sets the ConfigRuleArn field's value. -func (s *ConfigRule) SetConfigRuleArn(v string) *ConfigRule { - s.ConfigRuleArn = &v - return s -} - -// SetConfigRuleId sets the ConfigRuleId field's value. -func (s *ConfigRule) SetConfigRuleId(v string) *ConfigRule { - s.ConfigRuleId = &v - return s -} - -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *ConfigRule) SetConfigRuleName(v string) *ConfigRule { - s.ConfigRuleName = &v - return s -} - -// SetConfigRuleState sets the ConfigRuleState field's value. -func (s *ConfigRule) SetConfigRuleState(v string) *ConfigRule { - s.ConfigRuleState = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ConfigRule) SetDescription(v string) *ConfigRule { - s.Description = &v - return s -} - -// SetInputParameters sets the InputParameters field's value. -func (s *ConfigRule) SetInputParameters(v string) *ConfigRule { - s.InputParameters = &v - return s -} - -// SetMaximumExecutionFrequency sets the MaximumExecutionFrequency field's value. -func (s *ConfigRule) SetMaximumExecutionFrequency(v string) *ConfigRule { - s.MaximumExecutionFrequency = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ConfigRule) SetScope(v *Scope) *ConfigRule { - s.Scope = v - return s -} - -// SetSource sets the Source field's value. -func (s *ConfigRule) SetSource(v *Source) *ConfigRule { - s.Source = v - return s -} - -// Status information for your AWS managed Config rules. The status includes -// information such as the last time the rule ran, the last time it failed, -// and the related error for the last failure. -// -// This action does not return status information about custom Config rules. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ConfigRuleEvaluationStatus -type ConfigRuleEvaluationStatus struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the AWS Config rule. - ConfigRuleArn *string `type:"string"` - - // The ID of the AWS Config rule. - ConfigRuleId *string `type:"string"` - - // The name of the AWS Config rule. - ConfigRuleName *string `min:"1" type:"string"` - - // The time that you first activated the AWS Config rule. - FirstActivatedTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Indicates whether AWS Config has evaluated your resources against the rule - // at least once. - // - // * true - AWS Config has evaluated your AWS resources against the rule - // at least once. - // - // * false - AWS Config has not once finished evaluating your AWS resources - // against the rule. - FirstEvaluationStarted *bool `type:"boolean"` - - // The error code that AWS Config returned when the rule last failed. - LastErrorCode *string `type:"string"` - - // The error message that AWS Config returned when the rule last failed. - LastErrorMessage *string `type:"string"` - - // The time that AWS Config last failed to evaluate your AWS resources against - // the rule. - LastFailedEvaluationTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time that AWS Config last failed to invoke the AWS Config rule to evaluate - // your AWS resources. - LastFailedInvocationTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time that AWS Config last successfully evaluated your AWS resources against - // the rule. - LastSuccessfulEvaluationTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time that AWS Config last successfully invoked the AWS Config rule to - // evaluate your AWS resources. - LastSuccessfulInvocationTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s ConfigRuleEvaluationStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigRuleEvaluationStatus) GoString() string { - return s.String() -} - -// SetConfigRuleArn sets the ConfigRuleArn field's value. -func (s *ConfigRuleEvaluationStatus) SetConfigRuleArn(v string) *ConfigRuleEvaluationStatus { - s.ConfigRuleArn = &v - return s -} - -// SetConfigRuleId sets the ConfigRuleId field's value. -func (s *ConfigRuleEvaluationStatus) SetConfigRuleId(v string) *ConfigRuleEvaluationStatus { - s.ConfigRuleId = &v - return s -} - -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *ConfigRuleEvaluationStatus) SetConfigRuleName(v string) *ConfigRuleEvaluationStatus { - s.ConfigRuleName = &v - return s -} - -// SetFirstActivatedTime sets the FirstActivatedTime field's value. -func (s *ConfigRuleEvaluationStatus) SetFirstActivatedTime(v time.Time) *ConfigRuleEvaluationStatus { - s.FirstActivatedTime = &v - return s -} - -// SetFirstEvaluationStarted sets the FirstEvaluationStarted field's value. -func (s *ConfigRuleEvaluationStatus) SetFirstEvaluationStarted(v bool) *ConfigRuleEvaluationStatus { - s.FirstEvaluationStarted = &v - return s -} - -// SetLastErrorCode sets the LastErrorCode field's value. -func (s *ConfigRuleEvaluationStatus) SetLastErrorCode(v string) *ConfigRuleEvaluationStatus { - s.LastErrorCode = &v - return s -} - -// SetLastErrorMessage sets the LastErrorMessage field's value. -func (s *ConfigRuleEvaluationStatus) SetLastErrorMessage(v string) *ConfigRuleEvaluationStatus { - s.LastErrorMessage = &v - return s -} - -// SetLastFailedEvaluationTime sets the LastFailedEvaluationTime field's value. -func (s *ConfigRuleEvaluationStatus) SetLastFailedEvaluationTime(v time.Time) *ConfigRuleEvaluationStatus { - s.LastFailedEvaluationTime = &v - return s -} - -// SetLastFailedInvocationTime sets the LastFailedInvocationTime field's value. -func (s *ConfigRuleEvaluationStatus) SetLastFailedInvocationTime(v time.Time) *ConfigRuleEvaluationStatus { - s.LastFailedInvocationTime = &v - return s -} - -// SetLastSuccessfulEvaluationTime sets the LastSuccessfulEvaluationTime field's value. -func (s *ConfigRuleEvaluationStatus) SetLastSuccessfulEvaluationTime(v time.Time) *ConfigRuleEvaluationStatus { - s.LastSuccessfulEvaluationTime = &v - return s -} - -// SetLastSuccessfulInvocationTime sets the LastSuccessfulInvocationTime field's value. -func (s *ConfigRuleEvaluationStatus) SetLastSuccessfulInvocationTime(v time.Time) *ConfigRuleEvaluationStatus { - s.LastSuccessfulInvocationTime = &v - return s -} - -// Provides options for how often AWS Config delivers configuration snapshots -// to the Amazon S3 bucket in your delivery channel. -// -// If you want to create a rule that triggers evaluations for your resources -// when AWS Config delivers the configuration snapshot, see the following: -// -// The frequency for a rule that triggers evaluations for your resources when -// AWS Config delivers the configuration snapshot is set by one of two values, -// depending on which is less frequent: -// -// * The value for the deliveryFrequency parameter within the delivery channel -// configuration, which sets how often AWS Config delivers configuration -// snapshots. This value also sets how often AWS Config invokes evaluations -// for Config rules. -// -// * The value for the MaximumExecutionFrequency parameter, which sets the -// maximum frequency with which AWS Config invokes evaluations for the rule. -// For more information, see ConfigRule. -// -// If the deliveryFrequency value is less frequent than the MaximumExecutionFrequency -// value for a rule, AWS Config invokes the rule only as often as the deliveryFrequency -// value. -// -// For example, you want your rule to run evaluations when AWS Config delivers -// the configuration snapshot. -// -// You specify the MaximumExecutionFrequency value for Six_Hours. -// -// You then specify the delivery channel deliveryFrequency value for TwentyFour_Hours. -// -// Because the value for deliveryFrequency is less frequent than MaximumExecutionFrequency, -// AWS Config invokes evaluations for the rule every 24 hours. -// -// You should set the MaximumExecutionFrequency value to be at least as frequent -// as the deliveryFrequency value. You can view the deliveryFrequency value -// by using the DescribeDeliveryChannnels action. -// -// To update the deliveryFrequency with which AWS Config delivers your configuration -// snapshots, use the PutDeliveryChannel action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ConfigSnapshotDeliveryProperties -type ConfigSnapshotDeliveryProperties struct { - _ struct{} `type:"structure"` - - // The frequency with which AWS Config delivers configuration snapshots. - DeliveryFrequency *string `locationName:"deliveryFrequency" type:"string" enum:"MaximumExecutionFrequency"` -} - -// String returns the string representation -func (s ConfigSnapshotDeliveryProperties) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigSnapshotDeliveryProperties) GoString() string { - return s.String() -} - -// SetDeliveryFrequency sets the DeliveryFrequency field's value. -func (s *ConfigSnapshotDeliveryProperties) SetDeliveryFrequency(v string) *ConfigSnapshotDeliveryProperties { - s.DeliveryFrequency = &v - return s -} - -// A list that contains the status of the delivery of the configuration stream -// notification to the Amazon SNS topic. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ConfigStreamDeliveryInfo -type ConfigStreamDeliveryInfo struct { - _ struct{} `type:"structure"` - - // The error code from the last attempted delivery. - LastErrorCode *string `locationName:"lastErrorCode" type:"string"` - - // The error message from the last attempted delivery. - LastErrorMessage *string `locationName:"lastErrorMessage" type:"string"` - - // Status of the last attempted delivery. - // - // Note Providing an SNS topic on a DeliveryChannel (http://docs.aws.amazon.com/config/latest/APIReference/API_DeliveryChannel.html) - // for AWS Config is optional. If the SNS delivery is turned off, the last status - // will be Not_Applicable. - LastStatus *string `locationName:"lastStatus" type:"string" enum:"DeliveryStatus"` - - // The time from the last status change. - LastStatusChangeTime *time.Time `locationName:"lastStatusChangeTime" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s ConfigStreamDeliveryInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigStreamDeliveryInfo) GoString() string { - return s.String() -} - -// SetLastErrorCode sets the LastErrorCode field's value. -func (s *ConfigStreamDeliveryInfo) SetLastErrorCode(v string) *ConfigStreamDeliveryInfo { - s.LastErrorCode = &v - return s -} - -// SetLastErrorMessage sets the LastErrorMessage field's value. -func (s *ConfigStreamDeliveryInfo) SetLastErrorMessage(v string) *ConfigStreamDeliveryInfo { - s.LastErrorMessage = &v - return s -} - -// SetLastStatus sets the LastStatus field's value. -func (s *ConfigStreamDeliveryInfo) SetLastStatus(v string) *ConfigStreamDeliveryInfo { - s.LastStatus = &v - return s -} - -// SetLastStatusChangeTime sets the LastStatusChangeTime field's value. -func (s *ConfigStreamDeliveryInfo) SetLastStatusChangeTime(v time.Time) *ConfigStreamDeliveryInfo { - s.LastStatusChangeTime = &v - return s -} - -// A list that contains detailed configurations of a specified resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ConfigurationItem -type ConfigurationItem struct { - _ struct{} `type:"structure"` - - // The 12 digit AWS account ID associated with the resource. - AccountId *string `locationName:"accountId" type:"string"` - - // The Amazon Resource Name (ARN) of the resource. - Arn *string `locationName:"arn" type:"string"` - - // The Availability Zone associated with the resource. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The region where the resource resides. - AwsRegion *string `locationName:"awsRegion" type:"string"` - - // The description of the resource configuration. - Configuration *string `locationName:"configuration" type:"string"` - - // The time when the configuration recording was initiated. - ConfigurationItemCaptureTime *time.Time `locationName:"configurationItemCaptureTime" type:"timestamp" timestampFormat:"unix"` - - // Unique MD5 hash that represents the configuration item's state. - // - // You can use MD5 hash to compare the states of two or more configuration items - // that are associated with the same resource. - ConfigurationItemMD5Hash *string `locationName:"configurationItemMD5Hash" type:"string"` - - // The configuration item status. - ConfigurationItemStatus *string `locationName:"configurationItemStatus" type:"string" enum:"ConfigurationItemStatus"` - - // An identifier that indicates the ordering of the configuration items of a - // resource. - ConfigurationStateId *string `locationName:"configurationStateId" type:"string"` - - // A list of CloudTrail event IDs. - // - // A populated field indicates that the current configuration was initiated - // by the events recorded in the CloudTrail log. For more information about - // CloudTrail, see What is AWS CloudTrail? (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html). - // - // An empty field indicates that the current configuration was not initiated - // by any event. - RelatedEvents []*string `locationName:"relatedEvents" type:"list"` - - // A list of related AWS resources. - Relationships []*Relationship `locationName:"relationships" type:"list"` - - // The time stamp when the resource was created. - ResourceCreationTime *time.Time `locationName:"resourceCreationTime" type:"timestamp" timestampFormat:"unix"` - - // The ID of the resource (for example., sg-xxxxxx). - ResourceId *string `locationName:"resourceId" type:"string"` - - // The custom name of the resource, if available. - ResourceName *string `locationName:"resourceName" type:"string"` - - // The type of AWS resource. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // Configuration attributes that AWS Config returns for certain resource types - // to supplement the information returned for the configuration parameter. - SupplementaryConfiguration map[string]*string `locationName:"supplementaryConfiguration" type:"map"` - - // A mapping of key value tags associated with the resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The version number of the resource configuration. - Version *string `locationName:"version" type:"string"` -} - -// String returns the string representation -func (s ConfigurationItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigurationItem) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *ConfigurationItem) SetAccountId(v string) *ConfigurationItem { - s.AccountId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *ConfigurationItem) SetArn(v string) *ConfigurationItem { - s.Arn = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ConfigurationItem) SetAvailabilityZone(v string) *ConfigurationItem { - s.AvailabilityZone = &v - return s -} - -// SetAwsRegion sets the AwsRegion field's value. -func (s *ConfigurationItem) SetAwsRegion(v string) *ConfigurationItem { - s.AwsRegion = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *ConfigurationItem) SetConfiguration(v string) *ConfigurationItem { - s.Configuration = &v - return s -} - -// SetConfigurationItemCaptureTime sets the ConfigurationItemCaptureTime field's value. -func (s *ConfigurationItem) SetConfigurationItemCaptureTime(v time.Time) *ConfigurationItem { - s.ConfigurationItemCaptureTime = &v - return s -} - -// SetConfigurationItemMD5Hash sets the ConfigurationItemMD5Hash field's value. -func (s *ConfigurationItem) SetConfigurationItemMD5Hash(v string) *ConfigurationItem { - s.ConfigurationItemMD5Hash = &v - return s -} - -// SetConfigurationItemStatus sets the ConfigurationItemStatus field's value. -func (s *ConfigurationItem) SetConfigurationItemStatus(v string) *ConfigurationItem { - s.ConfigurationItemStatus = &v - return s -} - -// SetConfigurationStateId sets the ConfigurationStateId field's value. -func (s *ConfigurationItem) SetConfigurationStateId(v string) *ConfigurationItem { - s.ConfigurationStateId = &v - return s -} - -// SetRelatedEvents sets the RelatedEvents field's value. -func (s *ConfigurationItem) SetRelatedEvents(v []*string) *ConfigurationItem { - s.RelatedEvents = v - return s -} - -// SetRelationships sets the Relationships field's value. -func (s *ConfigurationItem) SetRelationships(v []*Relationship) *ConfigurationItem { - s.Relationships = v - return s -} - -// SetResourceCreationTime sets the ResourceCreationTime field's value. -func (s *ConfigurationItem) SetResourceCreationTime(v time.Time) *ConfigurationItem { - s.ResourceCreationTime = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ConfigurationItem) SetResourceId(v string) *ConfigurationItem { - s.ResourceId = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *ConfigurationItem) SetResourceName(v string) *ConfigurationItem { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ConfigurationItem) SetResourceType(v string) *ConfigurationItem { - s.ResourceType = &v - return s -} - -// SetSupplementaryConfiguration sets the SupplementaryConfiguration field's value. -func (s *ConfigurationItem) SetSupplementaryConfiguration(v map[string]*string) *ConfigurationItem { - s.SupplementaryConfiguration = v - return s -} - -// SetTags sets the Tags field's value. -func (s *ConfigurationItem) SetTags(v map[string]*string) *ConfigurationItem { - s.Tags = v - return s -} - -// SetVersion sets the Version field's value. -func (s *ConfigurationItem) SetVersion(v string) *ConfigurationItem { - s.Version = &v - return s -} - -// An object that represents the recording of configuration changes of an AWS -// resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ConfigurationRecorder -type ConfigurationRecorder struct { - _ struct{} `type:"structure"` - - // The name of the recorder. By default, AWS Config automatically assigns the - // name "default" when creating the configuration recorder. You cannot change - // the assigned name. - Name *string `locationName:"name" min:"1" type:"string"` - - // Specifies the types of AWS resource for which AWS Config records configuration - // changes. - RecordingGroup *RecordingGroup `locationName:"recordingGroup" type:"structure"` - - // Amazon Resource Name (ARN) of the IAM role used to describe the AWS resources - // associated with the account. - RoleARN *string `locationName:"roleARN" type:"string"` -} - -// String returns the string representation -func (s ConfigurationRecorder) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigurationRecorder) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfigurationRecorder) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfigurationRecorder"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *ConfigurationRecorder) SetName(v string) *ConfigurationRecorder { - s.Name = &v - return s -} - -// SetRecordingGroup sets the RecordingGroup field's value. -func (s *ConfigurationRecorder) SetRecordingGroup(v *RecordingGroup) *ConfigurationRecorder { - s.RecordingGroup = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ConfigurationRecorder) SetRoleARN(v string) *ConfigurationRecorder { - s.RoleARN = &v - return s -} - -// The current status of the configuration recorder. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ConfigurationRecorderStatus -type ConfigurationRecorderStatus struct { - _ struct{} `type:"structure"` - - // The error code indicating that the recording failed. - LastErrorCode *string `locationName:"lastErrorCode" type:"string"` - - // The message indicating that the recording failed due to an error. - LastErrorMessage *string `locationName:"lastErrorMessage" type:"string"` - - // The time the recorder was last started. - LastStartTime *time.Time `locationName:"lastStartTime" type:"timestamp" timestampFormat:"unix"` - - // The last (previous) status of the recorder. - LastStatus *string `locationName:"lastStatus" type:"string" enum:"RecorderStatus"` - - // The time when the status was last changed. - LastStatusChangeTime *time.Time `locationName:"lastStatusChangeTime" type:"timestamp" timestampFormat:"unix"` - - // The time the recorder was last stopped. - LastStopTime *time.Time `locationName:"lastStopTime" type:"timestamp" timestampFormat:"unix"` - - // The name of the configuration recorder. - Name *string `locationName:"name" type:"string"` - - // Specifies whether the recorder is currently recording or not. - Recording *bool `locationName:"recording" type:"boolean"` -} - -// String returns the string representation -func (s ConfigurationRecorderStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigurationRecorderStatus) GoString() string { - return s.String() -} - -// SetLastErrorCode sets the LastErrorCode field's value. -func (s *ConfigurationRecorderStatus) SetLastErrorCode(v string) *ConfigurationRecorderStatus { - s.LastErrorCode = &v - return s -} - -// SetLastErrorMessage sets the LastErrorMessage field's value. -func (s *ConfigurationRecorderStatus) SetLastErrorMessage(v string) *ConfigurationRecorderStatus { - s.LastErrorMessage = &v - return s -} - -// SetLastStartTime sets the LastStartTime field's value. -func (s *ConfigurationRecorderStatus) SetLastStartTime(v time.Time) *ConfigurationRecorderStatus { - s.LastStartTime = &v - return s -} - -// SetLastStatus sets the LastStatus field's value. -func (s *ConfigurationRecorderStatus) SetLastStatus(v string) *ConfigurationRecorderStatus { - s.LastStatus = &v - return s -} - -// SetLastStatusChangeTime sets the LastStatusChangeTime field's value. -func (s *ConfigurationRecorderStatus) SetLastStatusChangeTime(v time.Time) *ConfigurationRecorderStatus { - s.LastStatusChangeTime = &v - return s -} - -// SetLastStopTime sets the LastStopTime field's value. -func (s *ConfigurationRecorderStatus) SetLastStopTime(v time.Time) *ConfigurationRecorderStatus { - s.LastStopTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *ConfigurationRecorderStatus) SetName(v string) *ConfigurationRecorderStatus { - s.Name = &v - return s -} - -// SetRecording sets the Recording field's value. -func (s *ConfigurationRecorderStatus) SetRecording(v bool) *ConfigurationRecorderStatus { - s.Recording = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigRuleRequest -type DeleteConfigRuleInput struct { - _ struct{} `type:"structure"` - - // The name of the AWS Config rule that you want to delete. - // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteConfigRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfigRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfigRuleInput"} - if s.ConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) - } - if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *DeleteConfigRuleInput) SetConfigRuleName(v string) *DeleteConfigRuleInput { - s.ConfigRuleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigRuleOutput -type DeleteConfigRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteConfigRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigRuleOutput) GoString() string { - return s.String() -} - -// The request object for the DeleteConfigurationRecorder action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigurationRecorderRequest -type DeleteConfigurationRecorderInput struct { - _ struct{} `type:"structure"` - - // The name of the configuration recorder to be deleted. You can retrieve the - // name of your configuration recorder by using the DescribeConfigurationRecorders - // action. - // - // ConfigurationRecorderName is a required field - ConfigurationRecorderName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteConfigurationRecorderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigurationRecorderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfigurationRecorderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfigurationRecorderInput"} - if s.ConfigurationRecorderName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationRecorderName")) - } - if s.ConfigurationRecorderName != nil && len(*s.ConfigurationRecorderName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationRecorderName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationRecorderName sets the ConfigurationRecorderName field's value. -func (s *DeleteConfigurationRecorderInput) SetConfigurationRecorderName(v string) *DeleteConfigurationRecorderInput { - s.ConfigurationRecorderName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigurationRecorderOutput -type DeleteConfigurationRecorderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteConfigurationRecorderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigurationRecorderOutput) GoString() string { - return s.String() -} - -// The input for the DeleteDeliveryChannel action. The action accepts the following -// data in JSON format. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteDeliveryChannelRequest -type DeleteDeliveryChannelInput struct { - _ struct{} `type:"structure"` - - // The name of the delivery channel to delete. - // - // DeliveryChannelName is a required field - DeliveryChannelName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDeliveryChannelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeliveryChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDeliveryChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDeliveryChannelInput"} - if s.DeliveryChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryChannelName")) - } - if s.DeliveryChannelName != nil && len(*s.DeliveryChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryChannelName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryChannelName sets the DeliveryChannelName field's value. -func (s *DeleteDeliveryChannelInput) SetDeliveryChannelName(v string) *DeleteDeliveryChannelInput { - s.DeliveryChannelName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteDeliveryChannelOutput -type DeleteDeliveryChannelOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDeliveryChannelOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeliveryChannelOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteEvaluationResultsRequest -type DeleteEvaluationResultsInput struct { - _ struct{} `type:"structure"` - - // The name of the Config rule for which you want to delete the evaluation results. - // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEvaluationResultsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEvaluationResultsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEvaluationResultsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEvaluationResultsInput"} - if s.ConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) - } - if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *DeleteEvaluationResultsInput) SetConfigRuleName(v string) *DeleteEvaluationResultsInput { - s.ConfigRuleName = &v - return s -} - -// The output when you delete the evaluation results for the specified Config -// rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteEvaluationResultsResponse -type DeleteEvaluationResultsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteEvaluationResultsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEvaluationResultsOutput) GoString() string { - return s.String() -} - -// The input for the DeliverConfigSnapshot action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeliverConfigSnapshotRequest -type DeliverConfigSnapshotInput struct { - _ struct{} `type:"structure"` - - // The name of the delivery channel through which the snapshot is delivered. - // - // DeliveryChannelName is a required field - DeliveryChannelName *string `locationName:"deliveryChannelName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeliverConfigSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeliverConfigSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeliverConfigSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeliverConfigSnapshotInput"} - if s.DeliveryChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryChannelName")) - } - if s.DeliveryChannelName != nil && len(*s.DeliveryChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryChannelName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryChannelName sets the DeliveryChannelName field's value. -func (s *DeliverConfigSnapshotInput) SetDeliveryChannelName(v string) *DeliverConfigSnapshotInput { - s.DeliveryChannelName = &v - return s -} - -// The output for the DeliverConfigSnapshot action in JSON format. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeliverConfigSnapshotResponse -type DeliverConfigSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The ID of the snapshot that is being created. - ConfigSnapshotId *string `locationName:"configSnapshotId" type:"string"` -} - -// String returns the string representation -func (s DeliverConfigSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeliverConfigSnapshotOutput) GoString() string { - return s.String() -} - -// SetConfigSnapshotId sets the ConfigSnapshotId field's value. -func (s *DeliverConfigSnapshotOutput) SetConfigSnapshotId(v string) *DeliverConfigSnapshotOutput { - s.ConfigSnapshotId = &v - return s -} - -// The channel through which AWS Config delivers notifications and updated configuration -// states. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeliveryChannel -type DeliveryChannel struct { - _ struct{} `type:"structure"` - - // Provides options for how often AWS Config delivers configuration snapshots - // to the Amazon S3 bucket in your delivery channel. - // - // If you want to create a rule that triggers evaluations for your resources - // when AWS Config delivers the configuration snapshot, see the following: - // - // The frequency for a rule that triggers evaluations for your resources when - // AWS Config delivers the configuration snapshot is set by one of two values, - // depending on which is less frequent: - // - // * The value for the deliveryFrequency parameter within the delivery channel - // configuration, which sets how often AWS Config delivers configuration - // snapshots. This value also sets how often AWS Config invokes evaluations - // for Config rules. - // - // * The value for the MaximumExecutionFrequency parameter, which sets the - // maximum frequency with which AWS Config invokes evaluations for the rule. - // For more information, see ConfigRule. - // - // If the deliveryFrequency value is less frequent than the MaximumExecutionFrequency - // value for a rule, AWS Config invokes the rule only as often as the deliveryFrequency - // value. - // - // For example, you want your rule to run evaluations when AWS Config delivers - // the configuration snapshot. - // - // You specify the MaximumExecutionFrequency value for Six_Hours. - // - // You then specify the delivery channel deliveryFrequency value for TwentyFour_Hours. - // - // Because the value for deliveryFrequency is less frequent than MaximumExecutionFrequency, - // AWS Config invokes evaluations for the rule every 24 hours. - // - // You should set the MaximumExecutionFrequency value to be at least as frequent - // as the deliveryFrequency value. You can view the deliveryFrequency value - // by using the DescribeDeliveryChannnels action. - // - // To update the deliveryFrequency with which AWS Config delivers your configuration - // snapshots, use the PutDeliveryChannel action. - ConfigSnapshotDeliveryProperties *ConfigSnapshotDeliveryProperties `locationName:"configSnapshotDeliveryProperties" type:"structure"` - - // The name of the delivery channel. By default, AWS Config assigns the name - // "default" when creating the delivery channel. To change the delivery channel - // name, you must use the DeleteDeliveryChannel action to delete your current - // delivery channel, and then you must use the PutDeliveryChannel command to - // create a delivery channel that has the desired name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The name of the Amazon S3 bucket to which AWS Config delivers configuration - // snapshots and configuration history files. - // - // If you specify a bucket that belongs to another AWS account, that bucket - // must have policies that grant access permissions to AWS Config. For more - // information, see Permissions for the Amazon S3 Bucket (http://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html) - // in the AWS Config Developer Guide. - S3BucketName *string `locationName:"s3BucketName" type:"string"` - - // The prefix for the specified Amazon S3 bucket. - S3KeyPrefix *string `locationName:"s3KeyPrefix" type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to which AWS Config - // sends notifications about configuration changes. - // - // If you choose a topic from another account, the topic must have policies - // that grant access permissions to AWS Config. For more information, see Permissions - // for the Amazon SNS Topic (http://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html) - // in the AWS Config Developer Guide. - SnsTopicARN *string `locationName:"snsTopicARN" type:"string"` -} - -// String returns the string representation -func (s DeliveryChannel) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeliveryChannel) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeliveryChannel) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeliveryChannel"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigSnapshotDeliveryProperties sets the ConfigSnapshotDeliveryProperties field's value. -func (s *DeliveryChannel) SetConfigSnapshotDeliveryProperties(v *ConfigSnapshotDeliveryProperties) *DeliveryChannel { - s.ConfigSnapshotDeliveryProperties = v - return s -} - -// SetName sets the Name field's value. -func (s *DeliveryChannel) SetName(v string) *DeliveryChannel { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *DeliveryChannel) SetS3BucketName(v string) *DeliveryChannel { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *DeliveryChannel) SetS3KeyPrefix(v string) *DeliveryChannel { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *DeliveryChannel) SetSnsTopicARN(v string) *DeliveryChannel { - s.SnsTopicARN = &v - return s -} - -// The status of a specified delivery channel. -// -// Valid values: Success | Failure -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeliveryChannelStatus -type DeliveryChannelStatus struct { - _ struct{} `type:"structure"` - - // A list that contains the status of the delivery of the configuration history - // to the specified Amazon S3 bucket. - ConfigHistoryDeliveryInfo *ConfigExportDeliveryInfo `locationName:"configHistoryDeliveryInfo" type:"structure"` - - // A list containing the status of the delivery of the snapshot to the specified - // Amazon S3 bucket. - ConfigSnapshotDeliveryInfo *ConfigExportDeliveryInfo `locationName:"configSnapshotDeliveryInfo" type:"structure"` - - // A list containing the status of the delivery of the configuration stream - // notification to the specified Amazon SNS topic. - ConfigStreamDeliveryInfo *ConfigStreamDeliveryInfo `locationName:"configStreamDeliveryInfo" type:"structure"` - - // The name of the delivery channel. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s DeliveryChannelStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeliveryChannelStatus) GoString() string { - return s.String() -} - -// SetConfigHistoryDeliveryInfo sets the ConfigHistoryDeliveryInfo field's value. -func (s *DeliveryChannelStatus) SetConfigHistoryDeliveryInfo(v *ConfigExportDeliveryInfo) *DeliveryChannelStatus { - s.ConfigHistoryDeliveryInfo = v - return s -} - -// SetConfigSnapshotDeliveryInfo sets the ConfigSnapshotDeliveryInfo field's value. -func (s *DeliveryChannelStatus) SetConfigSnapshotDeliveryInfo(v *ConfigExportDeliveryInfo) *DeliveryChannelStatus { - s.ConfigSnapshotDeliveryInfo = v - return s -} - -// SetConfigStreamDeliveryInfo sets the ConfigStreamDeliveryInfo field's value. -func (s *DeliveryChannelStatus) SetConfigStreamDeliveryInfo(v *ConfigStreamDeliveryInfo) *DeliveryChannelStatus { - s.ConfigStreamDeliveryInfo = v - return s -} - -// SetName sets the Name field's value. -func (s *DeliveryChannelStatus) SetName(v string) *DeliveryChannelStatus { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByConfigRuleRequest -type DescribeComplianceByConfigRuleInput struct { - _ struct{} `type:"structure"` - - // Filters the results by compliance. - // - // The allowed values are COMPLIANT, NON_COMPLIANT, and INSUFFICIENT_DATA. - ComplianceTypes []*string `type:"list"` - - // Specify one or more AWS Config rule names to filter the results by rule. - ConfigRuleNames []*string `type:"list"` - - // The NextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeComplianceByConfigRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeComplianceByConfigRuleInput) GoString() string { - return s.String() -} - -// SetComplianceTypes sets the ComplianceTypes field's value. -func (s *DescribeComplianceByConfigRuleInput) SetComplianceTypes(v []*string) *DescribeComplianceByConfigRuleInput { - s.ComplianceTypes = v - return s -} - -// SetConfigRuleNames sets the ConfigRuleNames field's value. -func (s *DescribeComplianceByConfigRuleInput) SetConfigRuleNames(v []*string) *DescribeComplianceByConfigRuleInput { - s.ConfigRuleNames = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeComplianceByConfigRuleInput) SetNextToken(v string) *DescribeComplianceByConfigRuleInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByConfigRuleResponse -type DescribeComplianceByConfigRuleOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether each of the specified AWS Config rules is compliant. - ComplianceByConfigRules []*ComplianceByConfigRule `type:"list"` - - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeComplianceByConfigRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeComplianceByConfigRuleOutput) GoString() string { - return s.String() -} - -// SetComplianceByConfigRules sets the ComplianceByConfigRules field's value. -func (s *DescribeComplianceByConfigRuleOutput) SetComplianceByConfigRules(v []*ComplianceByConfigRule) *DescribeComplianceByConfigRuleOutput { - s.ComplianceByConfigRules = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeComplianceByConfigRuleOutput) SetNextToken(v string) *DescribeComplianceByConfigRuleOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByResourceRequest -type DescribeComplianceByResourceInput struct { - _ struct{} `type:"structure"` - - // Filters the results by compliance. - // - // The allowed values are COMPLIANT, NON_COMPLIANT, and INSUFFICIENT_DATA. - ComplianceTypes []*string `type:"list"` - - // The maximum number of evaluation results returned on each page. The default - // is 10. You cannot specify a limit greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `type:"integer"` - - // The NextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. - NextToken *string `type:"string"` - - // The ID of the AWS resource for which you want compliance information. You - // can specify only one resource ID. If you specify a resource ID, you must - // also specify a type for ResourceType. - ResourceId *string `min:"1" type:"string"` - - // The types of AWS resources for which you want compliance information; for - // example, AWS::EC2::Instance. For this action, you can specify that the resource - // type is an AWS account by specifying AWS::::Account. - ResourceType *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeComplianceByResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeComplianceByResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeComplianceByResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeComplianceByResourceInput"} - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.ResourceType != nil && len(*s.ResourceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComplianceTypes sets the ComplianceTypes field's value. -func (s *DescribeComplianceByResourceInput) SetComplianceTypes(v []*string) *DescribeComplianceByResourceInput { - s.ComplianceTypes = v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeComplianceByResourceInput) SetLimit(v int64) *DescribeComplianceByResourceInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeComplianceByResourceInput) SetNextToken(v string) *DescribeComplianceByResourceInput { - s.NextToken = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DescribeComplianceByResourceInput) SetResourceId(v string) *DescribeComplianceByResourceInput { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *DescribeComplianceByResourceInput) SetResourceType(v string) *DescribeComplianceByResourceInput { - s.ResourceType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeComplianceByResourceResponse -type DescribeComplianceByResourceOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the specified AWS resource complies with all of the AWS - // Config rules that evaluate it. - ComplianceByResources []*ComplianceByResource `type:"list"` - - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeComplianceByResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeComplianceByResourceOutput) GoString() string { - return s.String() -} - -// SetComplianceByResources sets the ComplianceByResources field's value. -func (s *DescribeComplianceByResourceOutput) SetComplianceByResources(v []*ComplianceByResource) *DescribeComplianceByResourceOutput { - s.ComplianceByResources = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeComplianceByResourceOutput) SetNextToken(v string) *DescribeComplianceByResourceOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRuleEvaluationStatusRequest -type DescribeConfigRuleEvaluationStatusInput struct { - _ struct{} `type:"structure"` - - // The name of the AWS managed Config rules for which you want status information. - // If you do not specify any names, AWS Config returns status information for - // all AWS managed Config rules that you use. - ConfigRuleNames []*string `type:"list"` - - // The number of rule evaluation results that you want returned. - // - // This parameter is required if the rule limit for your account is more than - // the default of 50 rules. - // - // For more information about requesting a rule limit increase, see AWS Config - // Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_config) - // in the AWS General Reference Guide. - Limit *int64 `type:"integer"` - - // The NextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeConfigRuleEvaluationStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigRuleEvaluationStatusInput) GoString() string { - return s.String() -} - -// SetConfigRuleNames sets the ConfigRuleNames field's value. -func (s *DescribeConfigRuleEvaluationStatusInput) SetConfigRuleNames(v []*string) *DescribeConfigRuleEvaluationStatusInput { - s.ConfigRuleNames = v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeConfigRuleEvaluationStatusInput) SetLimit(v int64) *DescribeConfigRuleEvaluationStatusInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeConfigRuleEvaluationStatusInput) SetNextToken(v string) *DescribeConfigRuleEvaluationStatusInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRuleEvaluationStatusResponse -type DescribeConfigRuleEvaluationStatusOutput struct { - _ struct{} `type:"structure"` - - // Status information about your AWS managed Config rules. - ConfigRulesEvaluationStatus []*ConfigRuleEvaluationStatus `type:"list"` - - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeConfigRuleEvaluationStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigRuleEvaluationStatusOutput) GoString() string { - return s.String() -} - -// SetConfigRulesEvaluationStatus sets the ConfigRulesEvaluationStatus field's value. -func (s *DescribeConfigRuleEvaluationStatusOutput) SetConfigRulesEvaluationStatus(v []*ConfigRuleEvaluationStatus) *DescribeConfigRuleEvaluationStatusOutput { - s.ConfigRulesEvaluationStatus = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeConfigRuleEvaluationStatusOutput) SetNextToken(v string) *DescribeConfigRuleEvaluationStatusOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRulesRequest -type DescribeConfigRulesInput struct { - _ struct{} `type:"structure"` - - // The names of the AWS Config rules for which you want details. If you do not - // specify any names, AWS Config returns details for all your rules. - ConfigRuleNames []*string `type:"list"` - - // The NextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeConfigRulesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigRulesInput) GoString() string { - return s.String() -} - -// SetConfigRuleNames sets the ConfigRuleNames field's value. -func (s *DescribeConfigRulesInput) SetConfigRuleNames(v []*string) *DescribeConfigRulesInput { - s.ConfigRuleNames = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeConfigRulesInput) SetNextToken(v string) *DescribeConfigRulesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigRulesResponse -type DescribeConfigRulesOutput struct { - _ struct{} `type:"structure"` - - // The details about your AWS Config rules. - ConfigRules []*ConfigRule `type:"list"` - - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeConfigRulesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigRulesOutput) GoString() string { - return s.String() -} - -// SetConfigRules sets the ConfigRules field's value. -func (s *DescribeConfigRulesOutput) SetConfigRules(v []*ConfigRule) *DescribeConfigRulesOutput { - s.ConfigRules = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeConfigRulesOutput) SetNextToken(v string) *DescribeConfigRulesOutput { - s.NextToken = &v - return s -} - -// The input for the DescribeConfigurationRecorderStatus action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorderStatusRequest -type DescribeConfigurationRecorderStatusInput struct { - _ struct{} `type:"structure"` - - // The name(s) of the configuration recorder. If the name is not specified, - // the action returns the current status of all the configuration recorders - // associated with the account. - ConfigurationRecorderNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeConfigurationRecorderStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationRecorderStatusInput) GoString() string { - return s.String() -} - -// SetConfigurationRecorderNames sets the ConfigurationRecorderNames field's value. -func (s *DescribeConfigurationRecorderStatusInput) SetConfigurationRecorderNames(v []*string) *DescribeConfigurationRecorderStatusInput { - s.ConfigurationRecorderNames = v - return s -} - -// The output for the DescribeConfigurationRecorderStatus action in JSON format. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorderStatusResponse -type DescribeConfigurationRecorderStatusOutput struct { - _ struct{} `type:"structure"` - - // A list that contains status of the specified recorders. - ConfigurationRecordersStatus []*ConfigurationRecorderStatus `type:"list"` -} - -// String returns the string representation -func (s DescribeConfigurationRecorderStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationRecorderStatusOutput) GoString() string { - return s.String() -} - -// SetConfigurationRecordersStatus sets the ConfigurationRecordersStatus field's value. -func (s *DescribeConfigurationRecorderStatusOutput) SetConfigurationRecordersStatus(v []*ConfigurationRecorderStatus) *DescribeConfigurationRecorderStatusOutput { - s.ConfigurationRecordersStatus = v - return s -} - -// The input for the DescribeConfigurationRecorders action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecordersRequest -type DescribeConfigurationRecordersInput struct { - _ struct{} `type:"structure"` - - // A list of configuration recorder names. - ConfigurationRecorderNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeConfigurationRecordersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationRecordersInput) GoString() string { - return s.String() -} - -// SetConfigurationRecorderNames sets the ConfigurationRecorderNames field's value. -func (s *DescribeConfigurationRecordersInput) SetConfigurationRecorderNames(v []*string) *DescribeConfigurationRecordersInput { - s.ConfigurationRecorderNames = v - return s -} - -// The output for the DescribeConfigurationRecorders action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecordersResponse -type DescribeConfigurationRecordersOutput struct { - _ struct{} `type:"structure"` - - // A list that contains the descriptions of the specified configuration recorders. - ConfigurationRecorders []*ConfigurationRecorder `type:"list"` -} - -// String returns the string representation -func (s DescribeConfigurationRecordersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationRecordersOutput) GoString() string { - return s.String() -} - -// SetConfigurationRecorders sets the ConfigurationRecorders field's value. -func (s *DescribeConfigurationRecordersOutput) SetConfigurationRecorders(v []*ConfigurationRecorder) *DescribeConfigurationRecordersOutput { - s.ConfigurationRecorders = v - return s -} - -// The input for the DeliveryChannelStatus action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannelStatusRequest -type DescribeDeliveryChannelStatusInput struct { - _ struct{} `type:"structure"` - - // A list of delivery channel names. - DeliveryChannelNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeDeliveryChannelStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeliveryChannelStatusInput) GoString() string { - return s.String() -} - -// SetDeliveryChannelNames sets the DeliveryChannelNames field's value. -func (s *DescribeDeliveryChannelStatusInput) SetDeliveryChannelNames(v []*string) *DescribeDeliveryChannelStatusInput { - s.DeliveryChannelNames = v - return s -} - -// The output for the DescribeDeliveryChannelStatus action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannelStatusResponse -type DescribeDeliveryChannelStatusOutput struct { - _ struct{} `type:"structure"` - - // A list that contains the status of a specified delivery channel. - DeliveryChannelsStatus []*DeliveryChannelStatus `type:"list"` -} - -// String returns the string representation -func (s DescribeDeliveryChannelStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeliveryChannelStatusOutput) GoString() string { - return s.String() -} - -// SetDeliveryChannelsStatus sets the DeliveryChannelsStatus field's value. -func (s *DescribeDeliveryChannelStatusOutput) SetDeliveryChannelsStatus(v []*DeliveryChannelStatus) *DescribeDeliveryChannelStatusOutput { - s.DeliveryChannelsStatus = v - return s -} - -// The input for the DescribeDeliveryChannels action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannelsRequest -type DescribeDeliveryChannelsInput struct { - _ struct{} `type:"structure"` - - // A list of delivery channel names. - DeliveryChannelNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeDeliveryChannelsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeliveryChannelsInput) GoString() string { - return s.String() -} - -// SetDeliveryChannelNames sets the DeliveryChannelNames field's value. -func (s *DescribeDeliveryChannelsInput) SetDeliveryChannelNames(v []*string) *DescribeDeliveryChannelsInput { - s.DeliveryChannelNames = v - return s -} - -// The output for the DescribeDeliveryChannels action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannelsResponse -type DescribeDeliveryChannelsOutput struct { - _ struct{} `type:"structure"` - - // A list that contains the descriptions of the specified delivery channel. - DeliveryChannels []*DeliveryChannel `type:"list"` -} - -// String returns the string representation -func (s DescribeDeliveryChannelsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeliveryChannelsOutput) GoString() string { - return s.String() -} - -// SetDeliveryChannels sets the DeliveryChannels field's value. -func (s *DescribeDeliveryChannelsOutput) SetDeliveryChannels(v []*DeliveryChannel) *DescribeDeliveryChannelsOutput { - s.DeliveryChannels = v - return s -} - -// Identifies an AWS resource and indicates whether it complies with the AWS -// Config rule that it was evaluated against. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/Evaluation -type Evaluation struct { - _ struct{} `type:"structure"` - - // Supplementary information about how the evaluation determined the compliance. - Annotation *string `min:"1" type:"string"` - - // The ID of the AWS resource that was evaluated. - // - // ComplianceResourceId is a required field - ComplianceResourceId *string `min:"1" type:"string" required:"true"` - - // The type of AWS resource that was evaluated. - // - // ComplianceResourceType is a required field - ComplianceResourceType *string `min:"1" type:"string" required:"true"` - - // Indicates whether the AWS resource complies with the AWS Config rule that - // it was evaluated against. - // - // For the Evaluation data type, AWS Config supports only the COMPLIANT, NON_COMPLIANT, - // and NOT_APPLICABLE values. AWS Config does not support the INSUFFICIENT_DATA - // value for this data type. - // - // Similarly, AWS Config does not accept INSUFFICIENT_DATA as the value for - // ComplianceType from a PutEvaluations request. For example, an AWS Lambda - // function for a custom Config rule cannot pass an INSUFFICIENT_DATA value - // to AWS Config. - // - // ComplianceType is a required field - ComplianceType *string `type:"string" required:"true" enum:"ComplianceType"` - - // The time of the event in AWS Config that triggered the evaluation. For event-based - // evaluations, the time indicates when AWS Config created the configuration - // item that triggered the evaluation. For periodic evaluations, the time indicates - // when AWS Config triggered the evaluation at the frequency that you specified - // (for example, every 24 hours). - // - // OrderingTimestamp is a required field - OrderingTimestamp *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` -} - -// String returns the string representation -func (s Evaluation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Evaluation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Evaluation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Evaluation"} - if s.Annotation != nil && len(*s.Annotation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Annotation", 1)) - } - if s.ComplianceResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ComplianceResourceId")) - } - if s.ComplianceResourceId != nil && len(*s.ComplianceResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ComplianceResourceId", 1)) - } - if s.ComplianceResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ComplianceResourceType")) - } - if s.ComplianceResourceType != nil && len(*s.ComplianceResourceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ComplianceResourceType", 1)) - } - if s.ComplianceType == nil { - invalidParams.Add(request.NewErrParamRequired("ComplianceType")) - } - if s.OrderingTimestamp == nil { - invalidParams.Add(request.NewErrParamRequired("OrderingTimestamp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnnotation sets the Annotation field's value. -func (s *Evaluation) SetAnnotation(v string) *Evaluation { - s.Annotation = &v - return s -} - -// SetComplianceResourceId sets the ComplianceResourceId field's value. -func (s *Evaluation) SetComplianceResourceId(v string) *Evaluation { - s.ComplianceResourceId = &v - return s -} - -// SetComplianceResourceType sets the ComplianceResourceType field's value. -func (s *Evaluation) SetComplianceResourceType(v string) *Evaluation { - s.ComplianceResourceType = &v - return s -} - -// SetComplianceType sets the ComplianceType field's value. -func (s *Evaluation) SetComplianceType(v string) *Evaluation { - s.ComplianceType = &v - return s -} - -// SetOrderingTimestamp sets the OrderingTimestamp field's value. -func (s *Evaluation) SetOrderingTimestamp(v time.Time) *Evaluation { - s.OrderingTimestamp = &v - return s -} - -// The details of an AWS Config evaluation. Provides the AWS resource that was -// evaluated, the compliance of the resource, related timestamps, and supplementary -// information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/EvaluationResult -type EvaluationResult struct { - _ struct{} `type:"structure"` - - // Supplementary information about how the evaluation determined the compliance. - Annotation *string `min:"1" type:"string"` - - // Indicates whether the AWS resource complies with the AWS Config rule that - // evaluated it. - // - // For the EvaluationResult data type, AWS Config supports only the COMPLIANT, - // NON_COMPLIANT, and NOT_APPLICABLE values. AWS Config does not support the - // INSUFFICIENT_DATA value for the EvaluationResult data type. - ComplianceType *string `type:"string" enum:"ComplianceType"` - - // The time when the AWS Config rule evaluated the AWS resource. - ConfigRuleInvokedTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Uniquely identifies the evaluation result. - EvaluationResultIdentifier *EvaluationResultIdentifier `type:"structure"` - - // The time when AWS Config recorded the evaluation result. - ResultRecordedTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // An encrypted token that associates an evaluation with an AWS Config rule. - // The token identifies the rule, the AWS resource being evaluated, and the - // event that triggered the evaluation. - ResultToken *string `type:"string"` -} - -// String returns the string representation -func (s EvaluationResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EvaluationResult) GoString() string { - return s.String() -} - -// SetAnnotation sets the Annotation field's value. -func (s *EvaluationResult) SetAnnotation(v string) *EvaluationResult { - s.Annotation = &v - return s -} - -// SetComplianceType sets the ComplianceType field's value. -func (s *EvaluationResult) SetComplianceType(v string) *EvaluationResult { - s.ComplianceType = &v - return s -} - -// SetConfigRuleInvokedTime sets the ConfigRuleInvokedTime field's value. -func (s *EvaluationResult) SetConfigRuleInvokedTime(v time.Time) *EvaluationResult { - s.ConfigRuleInvokedTime = &v - return s -} - -// SetEvaluationResultIdentifier sets the EvaluationResultIdentifier field's value. -func (s *EvaluationResult) SetEvaluationResultIdentifier(v *EvaluationResultIdentifier) *EvaluationResult { - s.EvaluationResultIdentifier = v - return s -} - -// SetResultRecordedTime sets the ResultRecordedTime field's value. -func (s *EvaluationResult) SetResultRecordedTime(v time.Time) *EvaluationResult { - s.ResultRecordedTime = &v - return s -} - -// SetResultToken sets the ResultToken field's value. -func (s *EvaluationResult) SetResultToken(v string) *EvaluationResult { - s.ResultToken = &v - return s -} - -// Uniquely identifies an evaluation result. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/EvaluationResultIdentifier -type EvaluationResultIdentifier struct { - _ struct{} `type:"structure"` - - // Identifies an AWS Config rule used to evaluate an AWS resource, and provides - // the type and ID of the evaluated resource. - EvaluationResultQualifier *EvaluationResultQualifier `type:"structure"` - - // The time of the event that triggered the evaluation of your AWS resources. - // The time can indicate when AWS Config delivered a configuration item change - // notification, or it can indicate when AWS Config delivered the configuration - // snapshot, depending on which event triggered the evaluation. - OrderingTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s EvaluationResultIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EvaluationResultIdentifier) GoString() string { - return s.String() -} - -// SetEvaluationResultQualifier sets the EvaluationResultQualifier field's value. -func (s *EvaluationResultIdentifier) SetEvaluationResultQualifier(v *EvaluationResultQualifier) *EvaluationResultIdentifier { - s.EvaluationResultQualifier = v - return s -} - -// SetOrderingTimestamp sets the OrderingTimestamp field's value. -func (s *EvaluationResultIdentifier) SetOrderingTimestamp(v time.Time) *EvaluationResultIdentifier { - s.OrderingTimestamp = &v - return s -} - -// Identifies an AWS Config rule that evaluated an AWS resource, and provides -// the type and ID of the resource that the rule evaluated. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/EvaluationResultQualifier -type EvaluationResultQualifier struct { - _ struct{} `type:"structure"` - - // The name of the AWS Config rule that was used in the evaluation. - ConfigRuleName *string `min:"1" type:"string"` - - // The ID of the evaluated AWS resource. - ResourceId *string `min:"1" type:"string"` - - // The type of AWS resource that was evaluated. - ResourceType *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EvaluationResultQualifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EvaluationResultQualifier) GoString() string { - return s.String() -} - -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *EvaluationResultQualifier) SetConfigRuleName(v string) *EvaluationResultQualifier { - s.ConfigRuleName = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *EvaluationResultQualifier) SetResourceId(v string) *EvaluationResultQualifier { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *EvaluationResultQualifier) SetResourceType(v string) *EvaluationResultQualifier { - s.ResourceType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByConfigRuleRequest -type GetComplianceDetailsByConfigRuleInput struct { - _ struct{} `type:"structure"` - - // Filters the results by compliance. - // - // The allowed values are COMPLIANT, NON_COMPLIANT, and NOT_APPLICABLE. - ComplianceTypes []*string `type:"list"` - - // The name of the AWS Config rule for which you want compliance information. - // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` - - // The maximum number of evaluation results returned on each page. The default - // is 10. You cannot specify a limit greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `type:"integer"` - - // The NextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s GetComplianceDetailsByConfigRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetComplianceDetailsByConfigRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetComplianceDetailsByConfigRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetComplianceDetailsByConfigRuleInput"} - if s.ConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) - } - if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComplianceTypes sets the ComplianceTypes field's value. -func (s *GetComplianceDetailsByConfigRuleInput) SetComplianceTypes(v []*string) *GetComplianceDetailsByConfigRuleInput { - s.ComplianceTypes = v - return s -} - -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *GetComplianceDetailsByConfigRuleInput) SetConfigRuleName(v string) *GetComplianceDetailsByConfigRuleInput { - s.ConfigRuleName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *GetComplianceDetailsByConfigRuleInput) SetLimit(v int64) *GetComplianceDetailsByConfigRuleInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetComplianceDetailsByConfigRuleInput) SetNextToken(v string) *GetComplianceDetailsByConfigRuleInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByConfigRuleResponse -type GetComplianceDetailsByConfigRuleOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the AWS resource complies with the specified AWS Config - // rule. - EvaluationResults []*EvaluationResult `type:"list"` - - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s GetComplianceDetailsByConfigRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetComplianceDetailsByConfigRuleOutput) GoString() string { - return s.String() -} - -// SetEvaluationResults sets the EvaluationResults field's value. -func (s *GetComplianceDetailsByConfigRuleOutput) SetEvaluationResults(v []*EvaluationResult) *GetComplianceDetailsByConfigRuleOutput { - s.EvaluationResults = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetComplianceDetailsByConfigRuleOutput) SetNextToken(v string) *GetComplianceDetailsByConfigRuleOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByResourceRequest -type GetComplianceDetailsByResourceInput struct { - _ struct{} `type:"structure"` - - // Filters the results by compliance. - // - // The allowed values are COMPLIANT, NON_COMPLIANT, and NOT_APPLICABLE. - ComplianceTypes []*string `type:"list"` - - // The NextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. - NextToken *string `type:"string"` - - // The ID of the AWS resource for which you want compliance information. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The type of the AWS resource for which you want compliance information. - // - // ResourceType is a required field - ResourceType *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetComplianceDetailsByResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetComplianceDetailsByResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetComplianceDetailsByResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetComplianceDetailsByResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - if s.ResourceType != nil && len(*s.ResourceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComplianceTypes sets the ComplianceTypes field's value. -func (s *GetComplianceDetailsByResourceInput) SetComplianceTypes(v []*string) *GetComplianceDetailsByResourceInput { - s.ComplianceTypes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetComplianceDetailsByResourceInput) SetNextToken(v string) *GetComplianceDetailsByResourceInput { - s.NextToken = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetComplianceDetailsByResourceInput) SetResourceId(v string) *GetComplianceDetailsByResourceInput { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *GetComplianceDetailsByResourceInput) SetResourceType(v string) *GetComplianceDetailsByResourceInput { - s.ResourceType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceDetailsByResourceResponse -type GetComplianceDetailsByResourceOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the specified AWS resource complies each AWS Config rule. - EvaluationResults []*EvaluationResult `type:"list"` - - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s GetComplianceDetailsByResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetComplianceDetailsByResourceOutput) GoString() string { - return s.String() -} - -// SetEvaluationResults sets the EvaluationResults field's value. -func (s *GetComplianceDetailsByResourceOutput) SetEvaluationResults(v []*EvaluationResult) *GetComplianceDetailsByResourceOutput { - s.EvaluationResults = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetComplianceDetailsByResourceOutput) SetNextToken(v string) *GetComplianceDetailsByResourceOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByConfigRuleInput -type GetComplianceSummaryByConfigRuleInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetComplianceSummaryByConfigRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetComplianceSummaryByConfigRuleInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByConfigRuleResponse -type GetComplianceSummaryByConfigRuleOutput struct { - _ struct{} `type:"structure"` - - // The number of AWS Config rules that are compliant and the number that are - // noncompliant, up to a maximum of 25 for each. - ComplianceSummary *ComplianceSummary `type:"structure"` -} - -// String returns the string representation -func (s GetComplianceSummaryByConfigRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetComplianceSummaryByConfigRuleOutput) GoString() string { - return s.String() -} - -// SetComplianceSummary sets the ComplianceSummary field's value. -func (s *GetComplianceSummaryByConfigRuleOutput) SetComplianceSummary(v *ComplianceSummary) *GetComplianceSummaryByConfigRuleOutput { - s.ComplianceSummary = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByResourceTypeRequest -type GetComplianceSummaryByResourceTypeInput struct { - _ struct{} `type:"structure"` - - // Specify one or more resource types to get the number of resources that are - // compliant and the number that are noncompliant for each resource type. - // - // For this request, you can specify an AWS resource type such as AWS::EC2::Instance, - // and you can specify that the resource type is an AWS account by specifying - // AWS::::Account. - ResourceTypes []*string `type:"list"` -} - -// String returns the string representation -func (s GetComplianceSummaryByResourceTypeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetComplianceSummaryByResourceTypeInput) GoString() string { - return s.String() -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *GetComplianceSummaryByResourceTypeInput) SetResourceTypes(v []*string) *GetComplianceSummaryByResourceTypeInput { - s.ResourceTypes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetComplianceSummaryByResourceTypeResponse -type GetComplianceSummaryByResourceTypeOutput struct { - _ struct{} `type:"structure"` - - // The number of resources that are compliant and the number that are noncompliant. - // If one or more resource types were provided with the request, the numbers - // are returned for each resource type. The maximum number returned is 100. - ComplianceSummariesByResourceType []*ComplianceSummaryByResourceType `type:"list"` -} - -// String returns the string representation -func (s GetComplianceSummaryByResourceTypeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetComplianceSummaryByResourceTypeOutput) GoString() string { - return s.String() -} - -// SetComplianceSummariesByResourceType sets the ComplianceSummariesByResourceType field's value. -func (s *GetComplianceSummaryByResourceTypeOutput) SetComplianceSummariesByResourceType(v []*ComplianceSummaryByResourceType) *GetComplianceSummaryByResourceTypeOutput { - s.ComplianceSummariesByResourceType = v - return s -} - -// The input for the GetResourceConfigHistory action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetResourceConfigHistoryRequest -type GetResourceConfigHistoryInput struct { - _ struct{} `type:"structure"` - - // The chronological order for configuration items listed. By default the results - // are listed in reverse chronological order. - ChronologicalOrder *string `locationName:"chronologicalOrder" type:"string" enum:"ChronologicalOrder"` - - // The time stamp that indicates an earlier time. If not specified, the action - // returns paginated results that contain configuration items that start from - // when the first configuration item was recorded. - EarlierTime *time.Time `locationName:"earlierTime" type:"timestamp" timestampFormat:"unix"` - - // The time stamp that indicates a later time. If not specified, current time - // is taken. - LaterTime *time.Time `locationName:"laterTime" type:"timestamp" timestampFormat:"unix"` - - // The maximum number of configuration items returned on each page. The default - // is 10. You cannot specify a limit greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `locationName:"limit" type:"integer"` - - // The nextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the resource (for example., sg-xxxxxx). - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resource type. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` -} - -// String returns the string representation -func (s GetResourceConfigHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetResourceConfigHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetResourceConfigHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetResourceConfigHistoryInput"} - 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 -} - -// SetChronologicalOrder sets the ChronologicalOrder field's value. -func (s *GetResourceConfigHistoryInput) SetChronologicalOrder(v string) *GetResourceConfigHistoryInput { - s.ChronologicalOrder = &v - return s -} - -// SetEarlierTime sets the EarlierTime field's value. -func (s *GetResourceConfigHistoryInput) SetEarlierTime(v time.Time) *GetResourceConfigHistoryInput { - s.EarlierTime = &v - return s -} - -// SetLaterTime sets the LaterTime field's value. -func (s *GetResourceConfigHistoryInput) SetLaterTime(v time.Time) *GetResourceConfigHistoryInput { - s.LaterTime = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *GetResourceConfigHistoryInput) SetLimit(v int64) *GetResourceConfigHistoryInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetResourceConfigHistoryInput) SetNextToken(v string) *GetResourceConfigHistoryInput { - s.NextToken = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetResourceConfigHistoryInput) SetResourceId(v string) *GetResourceConfigHistoryInput { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *GetResourceConfigHistoryInput) SetResourceType(v string) *GetResourceConfigHistoryInput { - s.ResourceType = &v - return s -} - -// The output for the GetResourceConfigHistory action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetResourceConfigHistoryResponse -type GetResourceConfigHistoryOutput struct { - _ struct{} `type:"structure"` - - // A list that contains the configuration history of one or more resources. - ConfigurationItems []*ConfigurationItem `locationName:"configurationItems" type:"list"` - - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s GetResourceConfigHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetResourceConfigHistoryOutput) GoString() string { - return s.String() -} - -// SetConfigurationItems sets the ConfigurationItems field's value. -func (s *GetResourceConfigHistoryOutput) SetConfigurationItems(v []*ConfigurationItem) *GetResourceConfigHistoryOutput { - s.ConfigurationItems = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetResourceConfigHistoryOutput) SetNextToken(v string) *GetResourceConfigHistoryOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListDiscoveredResourcesRequest -type ListDiscoveredResourcesInput struct { - _ struct{} `type:"structure"` - - // Specifies whether AWS Config includes deleted resources in the results. By - // default, deleted resources are not included. - IncludeDeletedResources *bool `locationName:"includeDeletedResources" type:"boolean"` - - // The maximum number of resource identifiers returned on each page. The default - // is 100. You cannot specify a limit greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `locationName:"limit" type:"integer"` - - // The nextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. - NextToken *string `locationName:"nextToken" type:"string"` - - // The IDs of only those resources that you want AWS Config to list in the response. - // If you do not specify this parameter, AWS Config lists all resources of the - // specified type that it has discovered. - ResourceIds []*string `locationName:"resourceIds" type:"list"` - - // The custom name of only those resources that you want AWS Config to list - // in the response. If you do not specify this parameter, AWS Config lists all - // resources of the specified type that it has discovered. - ResourceName *string `locationName:"resourceName" type:"string"` - - // The type of resources that you want AWS Config to list in the response. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` -} - -// String returns the string representation -func (s ListDiscoveredResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDiscoveredResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDiscoveredResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDiscoveredResourcesInput"} - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIncludeDeletedResources sets the IncludeDeletedResources field's value. -func (s *ListDiscoveredResourcesInput) SetIncludeDeletedResources(v bool) *ListDiscoveredResourcesInput { - s.IncludeDeletedResources = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListDiscoveredResourcesInput) SetLimit(v int64) *ListDiscoveredResourcesInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDiscoveredResourcesInput) SetNextToken(v string) *ListDiscoveredResourcesInput { - s.NextToken = &v - return s -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *ListDiscoveredResourcesInput) SetResourceIds(v []*string) *ListDiscoveredResourcesInput { - s.ResourceIds = v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *ListDiscoveredResourcesInput) SetResourceName(v string) *ListDiscoveredResourcesInput { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ListDiscoveredResourcesInput) SetResourceType(v string) *ListDiscoveredResourcesInput { - s.ResourceType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListDiscoveredResourcesResponse -type ListDiscoveredResourcesOutput struct { - _ struct{} `type:"structure"` - - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `locationName:"nextToken" type:"string"` - - // The details that identify a resource that is discovered by AWS Config, including - // the resource type, ID, and (if available) the custom resource name. - ResourceIdentifiers []*ResourceIdentifier `locationName:"resourceIdentifiers" type:"list"` -} - -// String returns the string representation -func (s ListDiscoveredResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDiscoveredResourcesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDiscoveredResourcesOutput) SetNextToken(v string) *ListDiscoveredResourcesOutput { - s.NextToken = &v - return s -} - -// SetResourceIdentifiers sets the ResourceIdentifiers field's value. -func (s *ListDiscoveredResourcesOutput) SetResourceIdentifiers(v []*ResourceIdentifier) *ListDiscoveredResourcesOutput { - s.ResourceIdentifiers = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigRuleRequest -type PutConfigRuleInput struct { - _ struct{} `type:"structure"` - - // An AWS Config rule represents an AWS Lambda function that you create for - // a custom rule or a predefined function for an AWS managed rule. The function - // evaluates configuration items to assess whether your AWS resources comply - // with your desired configurations. This function can run when AWS Config detects - // a configuration change to an AWS resource and at a periodic frequency that - // you choose (for example, every 24 hours). - // - // You can use the AWS CLI and AWS SDKs if you want to create a rule that triggers - // evaluations for your resources when AWS Config delivers the configuration - // snapshot. For more information, see ConfigSnapshotDeliveryProperties. - // - // For more information about developing and using AWS Config rules, see Evaluating - // AWS Resource Configurations with AWS Config (http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) - // in the AWS Config Developer Guide. - // - // ConfigRule is a required field - ConfigRule *ConfigRule `type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutConfigRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutConfigRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutConfigRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutConfigRuleInput"} - if s.ConfigRule == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRule")) - } - if s.ConfigRule != nil { - if err := s.ConfigRule.Validate(); err != nil { - invalidParams.AddNested("ConfigRule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigRule sets the ConfigRule field's value. -func (s *PutConfigRuleInput) SetConfigRule(v *ConfigRule) *PutConfigRuleInput { - s.ConfigRule = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigRuleOutput -type PutConfigRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutConfigRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutConfigRuleOutput) GoString() string { - return s.String() -} - -// The input for the PutConfigurationRecorder action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationRecorderRequest -type PutConfigurationRecorderInput struct { - _ struct{} `type:"structure"` - - // The configuration recorder object that records each configuration change - // made to the resources. - // - // ConfigurationRecorder is a required field - ConfigurationRecorder *ConfigurationRecorder `type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutConfigurationRecorderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutConfigurationRecorderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutConfigurationRecorderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutConfigurationRecorderInput"} - if s.ConfigurationRecorder == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationRecorder")) - } - if s.ConfigurationRecorder != nil { - if err := s.ConfigurationRecorder.Validate(); err != nil { - invalidParams.AddNested("ConfigurationRecorder", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationRecorder sets the ConfigurationRecorder field's value. -func (s *PutConfigurationRecorderInput) SetConfigurationRecorder(v *ConfigurationRecorder) *PutConfigurationRecorderInput { - s.ConfigurationRecorder = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationRecorderOutput -type PutConfigurationRecorderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutConfigurationRecorderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutConfigurationRecorderOutput) GoString() string { - return s.String() -} - -// The input for the PutDeliveryChannel action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutDeliveryChannelRequest -type PutDeliveryChannelInput struct { - _ struct{} `type:"structure"` - - // The configuration delivery channel object that delivers the configuration - // information to an Amazon S3 bucket, and to an Amazon SNS topic. - // - // DeliveryChannel is a required field - DeliveryChannel *DeliveryChannel `type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutDeliveryChannelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutDeliveryChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutDeliveryChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutDeliveryChannelInput"} - if s.DeliveryChannel == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryChannel")) - } - if s.DeliveryChannel != nil { - if err := s.DeliveryChannel.Validate(); err != nil { - invalidParams.AddNested("DeliveryChannel", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryChannel sets the DeliveryChannel field's value. -func (s *PutDeliveryChannelInput) SetDeliveryChannel(v *DeliveryChannel) *PutDeliveryChannelInput { - s.DeliveryChannel = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutDeliveryChannelOutput -type PutDeliveryChannelOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutDeliveryChannelOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutDeliveryChannelOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutEvaluationsRequest -type PutEvaluationsInput struct { - _ struct{} `type:"structure"` - - // The assessments that the AWS Lambda function performs. Each evaluation identifies - // an AWS resource and indicates whether it complies with the AWS Config rule - // that invokes the AWS Lambda function. - Evaluations []*Evaluation `type:"list"` - - // An encrypted token that associates an evaluation with an AWS Config rule. - // Identifies the rule and the event that triggered the evaluation - // - // ResultToken is a required field - ResultToken *string `type:"string" required:"true"` - - // Use this parameter to specify a test run for PutEvaluations. You can 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. - // - // When TestMode is true, PutEvaluations doesn't require a valid value for the - // ResultToken parameter, but the value cannot be null. - TestMode *bool `type:"boolean"` -} - -// String returns the string representation -func (s PutEvaluationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEvaluationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutEvaluationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutEvaluationsInput"} - if s.ResultToken == nil { - invalidParams.Add(request.NewErrParamRequired("ResultToken")) - } - if s.Evaluations != nil { - for i, v := range s.Evaluations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Evaluations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvaluations sets the Evaluations field's value. -func (s *PutEvaluationsInput) SetEvaluations(v []*Evaluation) *PutEvaluationsInput { - s.Evaluations = v - return s -} - -// SetResultToken sets the ResultToken field's value. -func (s *PutEvaluationsInput) SetResultToken(v string) *PutEvaluationsInput { - s.ResultToken = &v - return s -} - -// SetTestMode sets the TestMode field's value. -func (s *PutEvaluationsInput) SetTestMode(v bool) *PutEvaluationsInput { - s.TestMode = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutEvaluationsResponse -type PutEvaluationsOutput struct { - _ struct{} `type:"structure"` - - // Requests that failed because of a client or server error. - FailedEvaluations []*Evaluation `type:"list"` -} - -// String returns the string representation -func (s PutEvaluationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutEvaluationsOutput) GoString() string { - return s.String() -} - -// SetFailedEvaluations sets the FailedEvaluations field's value. -func (s *PutEvaluationsOutput) SetFailedEvaluations(v []*Evaluation) *PutEvaluationsOutput { - s.FailedEvaluations = v - return s -} - -// Specifies the types of AWS resource for which AWS Config records configuration -// changes. -// -// In the recording group, you specify whether all supported types or specific -// types of resources are recorded. -// -// By default, AWS Config records configuration changes for all supported types -// of regional resources that AWS Config discovers in the region in which it -// is running. Regional resources are tied to a region and can be used only -// in that region. Examples of regional resources are EC2 instances and EBS -// volumes. -// -// You can also have AWS Config record configuration changes for supported types -// of global resources (for example, IAM resources). Global resources are not -// tied to an individual region and can be used in all regions. -// -// The configuration details for any global resource are the same in all regions. -// If you customize AWS Config in multiple regions to record global resources, -// it will create multiple configuration items each time a global resource changes: -// one configuration item for each region. These configuration items will contain -// identical data. To prevent duplicate configuration items, you should consider -// customizing AWS Config in only one region to record global resources, unless -// you want the configuration items to be available in multiple regions. -// -// If you don't want AWS Config to record all resources, you can specify which -// types of resources it will record with the resourceTypes parameter. -// -// For a list of supported resource types, see Supported resource types (http://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources). -// -// For more information, see Selecting Which Resources AWS Config Records (http://docs.aws.amazon.com/config/latest/developerguide/select-resources.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/RecordingGroup -type RecordingGroup struct { - _ struct{} `type:"structure"` - - // Specifies whether AWS Config records configuration changes for every supported - // type of regional resource. - // - // If you set this option to true, when AWS Config adds support for a new type - // of regional resource, it automatically starts recording resources of that - // type. - // - // If you set this option to true, you cannot enumerate a list of resourceTypes. - AllSupported *bool `locationName:"allSupported" type:"boolean"` - - // Specifies whether AWS Config includes all supported types of global resources - // (for example, IAM resources) with the resources that it records. - // - // Before you can set this option to true, you must set the allSupported option - // to true. - // - // If you set this option to true, when AWS Config adds support for a new type - // of global resource, it automatically starts recording resources of that type. - // - // The configuration details for any global resource are the same in all regions. - // To prevent duplicate configuration items, you should consider customizing - // AWS Config in only one region to record global resources. - IncludeGlobalResourceTypes *bool `locationName:"includeGlobalResourceTypes" type:"boolean"` - - // A comma-separated list that specifies the types of AWS resources for which - // AWS Config records configuration changes (for example, AWS::EC2::Instance - // or AWS::CloudTrail::Trail). - // - // Before you can set this option to true, you must set the allSupported option - // to false. - // - // If you set this option to true, when AWS Config adds support for a new type - // of resource, it will not record resources of that type unless you manually - // add that type to your recording group. - // - // For a list of valid resourceTypes values, see the resourceType Value column - // in Supported AWS Resource Types (http://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources). - ResourceTypes []*string `locationName:"resourceTypes" type:"list"` -} - -// String returns the string representation -func (s RecordingGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RecordingGroup) GoString() string { - return s.String() -} - -// SetAllSupported sets the AllSupported field's value. -func (s *RecordingGroup) SetAllSupported(v bool) *RecordingGroup { - s.AllSupported = &v - return s -} - -// SetIncludeGlobalResourceTypes sets the IncludeGlobalResourceTypes field's value. -func (s *RecordingGroup) SetIncludeGlobalResourceTypes(v bool) *RecordingGroup { - s.IncludeGlobalResourceTypes = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *RecordingGroup) SetResourceTypes(v []*string) *RecordingGroup { - s.ResourceTypes = v - return s -} - -// The relationship of the related resource to the main resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/Relationship -type Relationship struct { - _ struct{} `type:"structure"` - - // The type of relationship with the related resource. - RelationshipName *string `locationName:"relationshipName" type:"string"` - - // The ID of the related resource (for example, sg-xxxxxx). - ResourceId *string `locationName:"resourceId" type:"string"` - - // The custom name of the related resource, if available. - ResourceName *string `locationName:"resourceName" type:"string"` - - // The resource type of the related resource. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` -} - -// String returns the string representation -func (s Relationship) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Relationship) GoString() string { - return s.String() -} - -// SetRelationshipName sets the RelationshipName field's value. -func (s *Relationship) SetRelationshipName(v string) *Relationship { - s.RelationshipName = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *Relationship) SetResourceId(v string) *Relationship { - s.ResourceId = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *Relationship) SetResourceName(v string) *Relationship { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Relationship) SetResourceType(v string) *Relationship { - s.ResourceType = &v - return s -} - -// The details that identify a resource that is discovered by AWS Config, including -// the resource type, ID, and (if available) the custom resource name. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ResourceIdentifier -type ResourceIdentifier struct { - _ struct{} `type:"structure"` - - // The time that the resource was deleted. - ResourceDeletionTime *time.Time `locationName:"resourceDeletionTime" type:"timestamp" timestampFormat:"unix"` - - // The ID of the resource (for example., sg-xxxxxx). - ResourceId *string `locationName:"resourceId" type:"string"` - - // The custom name of the resource (if available). - ResourceName *string `locationName:"resourceName" type:"string"` - - // The type of resource. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` -} - -// String returns the string representation -func (s ResourceIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceIdentifier) GoString() string { - return s.String() -} - -// SetResourceDeletionTime sets the ResourceDeletionTime field's value. -func (s *ResourceIdentifier) SetResourceDeletionTime(v time.Time) *ResourceIdentifier { - s.ResourceDeletionTime = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ResourceIdentifier) SetResourceId(v string) *ResourceIdentifier { - s.ResourceId = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *ResourceIdentifier) SetResourceName(v string) *ResourceIdentifier { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ResourceIdentifier) SetResourceType(v string) *ResourceIdentifier { - s.ResourceType = &v - return s -} - -// Defines which resources trigger an evaluation for an AWS Config rule. The -// scope can include one or more resource types, a combination of a tag key -// and value, or a combination of one resource type and one resource ID. Specify -// a scope to constrain which resources trigger an evaluation for a rule. Otherwise, -// evaluations for the rule are triggered when any resource in your recording -// group changes in configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/Scope -type Scope struct { - _ struct{} `type:"structure"` - - // The IDs of the only AWS resource that you want to trigger an evaluation for - // the rule. If you specify a resource ID, you must specify one resource type - // for ComplianceResourceTypes. - ComplianceResourceId *string `min:"1" type:"string"` - - // The resource types of only those AWS resources that you want to trigger an - // evaluation for the rule. You can only specify one type if you also specify - // a resource ID for ComplianceResourceId. - ComplianceResourceTypes []*string `type:"list"` - - // The tag key that is applied to only those AWS resources that you want you - // want to trigger an evaluation for the rule. - TagKey *string `min:"1" type:"string"` - - // The tag value applied to only those AWS resources that you want to trigger - // an evaluation for the rule. If you specify a value for TagValue, you must - // also specify a value for TagKey. - TagValue *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s Scope) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Scope) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Scope) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Scope"} - if s.ComplianceResourceId != nil && len(*s.ComplianceResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ComplianceResourceId", 1)) - } - if s.TagKey != nil && len(*s.TagKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKey", 1)) - } - if s.TagValue != nil && len(*s.TagValue) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagValue", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComplianceResourceId sets the ComplianceResourceId field's value. -func (s *Scope) SetComplianceResourceId(v string) *Scope { - s.ComplianceResourceId = &v - return s -} - -// SetComplianceResourceTypes sets the ComplianceResourceTypes field's value. -func (s *Scope) SetComplianceResourceTypes(v []*string) *Scope { - s.ComplianceResourceTypes = v - return s -} - -// SetTagKey sets the TagKey field's value. -func (s *Scope) SetTagKey(v string) *Scope { - s.TagKey = &v - return s -} - -// SetTagValue sets the TagValue field's value. -func (s *Scope) SetTagValue(v string) *Scope { - s.TagValue = &v - return s -} - -// Provides the AWS Config rule owner (AWS or customer), the rule identifier, -// and the events that trigger the evaluation of your AWS resources. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/Source -type Source struct { - _ struct{} `type:"structure"` - - // Indicates whether AWS or the customer owns and manages the AWS Config rule. - // - // Owner is a required field - Owner *string `type:"string" required:"true" enum:"Owner"` - - // Provides the source and type of the event that causes AWS Config to evaluate - // your AWS resources. - SourceDetails []*SourceDetail `type:"list"` - - // For AWS Config managed rules, a predefined identifier from a list. For example, - // IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using - // AWS Managed Config Rules (http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). - // - // For custom rules, the identifier is the Amazon Resource Name (ARN) of the - // rule's AWS Lambda function, such as arn:aws:lambda:us-east-1:123456789012:function:custom_rule_name. - // - // SourceIdentifier is a required field - SourceIdentifier *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s Source) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Source) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Source) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Source"} - if s.Owner == nil { - invalidParams.Add(request.NewErrParamRequired("Owner")) - } - if s.SourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceIdentifier")) - } - if s.SourceIdentifier != nil && len(*s.SourceIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOwner sets the Owner field's value. -func (s *Source) SetOwner(v string) *Source { - s.Owner = &v - return s -} - -// SetSourceDetails sets the SourceDetails field's value. -func (s *Source) SetSourceDetails(v []*SourceDetail) *Source { - s.SourceDetails = v - return s -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *Source) SetSourceIdentifier(v string) *Source { - s.SourceIdentifier = &v - return s -} - -// Provides the source and the message types that trigger AWS Config to evaluate -// your AWS resources against a rule. It also provides the frequency with which -// you want AWS Config to run evaluations for the rule if the trigger type is -// periodic. You can specify the parameter values for SourceDetail only for -// custom rules. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/SourceDetail -type SourceDetail struct { - _ struct{} `type:"structure"` - - // The source of the event, such as an AWS service, that triggers AWS Config - // to evaluate your AWS resources. - EventSource *string `type:"string" enum:"EventSource"` - - // The frequency that you want AWS Config to run evaluations for a rule that - // is triggered periodically. If you specify a value for MaximumExecutionFrequency, - // then MessageType must use the ScheduledNotification value. - MaximumExecutionFrequency *string `type:"string" enum:"MaximumExecutionFrequency"` - - // The type of notification that triggers AWS Config to run an evaluation for - // a rule. You can specify the following notification types: - // - // * ConfigurationItemChangeNotification - Triggers an evaluation when AWS - // Config delivers a configuration item as a result of a resource change. - // - // * OversizedConfigurationItemChangeNotification - Triggers an evaluation - // when AWS Config delivers an oversized configuration item. AWS Config may - // generate this notification type when a resource changes and the notification - // exceeds the maximum size allowed by Amazon SNS. - // - // * ScheduledNotification - Triggers a periodic evaluation at the frequency - // specified for MaximumExecutionFrequency. - // - // * ConfigurationSnapshotDeliveryCompleted - Triggers a periodic evaluation - // when AWS Config delivers a configuration snapshot. - // - // If you want your custom rule to be triggered by configuration changes, specify - // both ConfigurationItemChangeNotification and OversizedConfigurationItemChangeNotification. - MessageType *string `type:"string" enum:"MessageType"` -} - -// String returns the string representation -func (s SourceDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceDetail) GoString() string { - return s.String() -} - -// SetEventSource sets the EventSource field's value. -func (s *SourceDetail) SetEventSource(v string) *SourceDetail { - s.EventSource = &v - return s -} - -// SetMaximumExecutionFrequency sets the MaximumExecutionFrequency field's value. -func (s *SourceDetail) SetMaximumExecutionFrequency(v string) *SourceDetail { - s.MaximumExecutionFrequency = &v - return s -} - -// SetMessageType sets the MessageType field's value. -func (s *SourceDetail) SetMessageType(v string) *SourceDetail { - s.MessageType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigRulesEvaluationRequest -type StartConfigRulesEvaluationInput struct { - _ struct{} `type:"structure"` - - // The list of names of Config rules that you want to run evaluations for. - ConfigRuleNames []*string `min:"1" type:"list"` -} - -// String returns the string representation -func (s StartConfigRulesEvaluationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartConfigRulesEvaluationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartConfigRulesEvaluationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartConfigRulesEvaluationInput"} - if s.ConfigRuleNames != nil && len(s.ConfigRuleNames) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleNames", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigRuleNames sets the ConfigRuleNames field's value. -func (s *StartConfigRulesEvaluationInput) SetConfigRuleNames(v []*string) *StartConfigRulesEvaluationInput { - s.ConfigRuleNames = v - return s -} - -// The output when you start the evaluation for the specified Config rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigRulesEvaluationResponse -type StartConfigRulesEvaluationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StartConfigRulesEvaluationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartConfigRulesEvaluationOutput) GoString() string { - return s.String() -} - -// The input for the StartConfigurationRecorder action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigurationRecorderRequest -type StartConfigurationRecorderInput struct { - _ struct{} `type:"structure"` - - // The name of the recorder object that records each configuration change made - // to the resources. - // - // ConfigurationRecorderName is a required field - ConfigurationRecorderName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartConfigurationRecorderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartConfigurationRecorderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartConfigurationRecorderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartConfigurationRecorderInput"} - if s.ConfigurationRecorderName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationRecorderName")) - } - if s.ConfigurationRecorderName != nil && len(*s.ConfigurationRecorderName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationRecorderName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationRecorderName sets the ConfigurationRecorderName field's value. -func (s *StartConfigurationRecorderInput) SetConfigurationRecorderName(v string) *StartConfigurationRecorderInput { - s.ConfigurationRecorderName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigurationRecorderOutput -type StartConfigurationRecorderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StartConfigurationRecorderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartConfigurationRecorderOutput) GoString() string { - return s.String() -} - -// The input for the StopConfigurationRecorder action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StopConfigurationRecorderRequest -type StopConfigurationRecorderInput struct { - _ struct{} `type:"structure"` - - // The name of the recorder object that records each configuration change made - // to the resources. - // - // ConfigurationRecorderName is a required field - ConfigurationRecorderName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopConfigurationRecorderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopConfigurationRecorderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopConfigurationRecorderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopConfigurationRecorderInput"} - if s.ConfigurationRecorderName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationRecorderName")) - } - if s.ConfigurationRecorderName != nil && len(*s.ConfigurationRecorderName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationRecorderName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationRecorderName sets the ConfigurationRecorderName field's value. -func (s *StopConfigurationRecorderInput) SetConfigurationRecorderName(v string) *StopConfigurationRecorderInput { - s.ConfigurationRecorderName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StopConfigurationRecorderOutput -type StopConfigurationRecorderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StopConfigurationRecorderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopConfigurationRecorderOutput) GoString() string { - return s.String() -} - -const ( - // ChronologicalOrderReverse is a ChronologicalOrder enum value - ChronologicalOrderReverse = "Reverse" - - // ChronologicalOrderForward is a ChronologicalOrder enum value - ChronologicalOrderForward = "Forward" -) - -const ( - // ComplianceTypeCompliant is a ComplianceType enum value - ComplianceTypeCompliant = "COMPLIANT" - - // ComplianceTypeNonCompliant is a ComplianceType enum value - ComplianceTypeNonCompliant = "NON_COMPLIANT" - - // ComplianceTypeNotApplicable is a ComplianceType enum value - ComplianceTypeNotApplicable = "NOT_APPLICABLE" - - // ComplianceTypeInsufficientData is a ComplianceType enum value - ComplianceTypeInsufficientData = "INSUFFICIENT_DATA" -) - -const ( - // ConfigRuleStateActive is a ConfigRuleState enum value - ConfigRuleStateActive = "ACTIVE" - - // ConfigRuleStateDeleting is a ConfigRuleState enum value - ConfigRuleStateDeleting = "DELETING" - - // ConfigRuleStateDeletingResults is a ConfigRuleState enum value - ConfigRuleStateDeletingResults = "DELETING_RESULTS" - - // ConfigRuleStateEvaluating is a ConfigRuleState enum value - ConfigRuleStateEvaluating = "EVALUATING" -) - -const ( - // ConfigurationItemStatusOk is a ConfigurationItemStatus enum value - ConfigurationItemStatusOk = "Ok" - - // ConfigurationItemStatusFailed is a ConfigurationItemStatus enum value - ConfigurationItemStatusFailed = "Failed" - - // ConfigurationItemStatusDiscovered is a ConfigurationItemStatus enum value - ConfigurationItemStatusDiscovered = "Discovered" - - // ConfigurationItemStatusDeleted is a ConfigurationItemStatus enum value - ConfigurationItemStatusDeleted = "Deleted" -) - -const ( - // DeliveryStatusSuccess is a DeliveryStatus enum value - DeliveryStatusSuccess = "Success" - - // DeliveryStatusFailure is a DeliveryStatus enum value - DeliveryStatusFailure = "Failure" - - // DeliveryStatusNotApplicable is a DeliveryStatus enum value - DeliveryStatusNotApplicable = "Not_Applicable" -) - -const ( - // EventSourceAwsConfig is a EventSource enum value - EventSourceAwsConfig = "aws.config" -) - -const ( - // MaximumExecutionFrequencyOneHour is a MaximumExecutionFrequency enum value - MaximumExecutionFrequencyOneHour = "One_Hour" - - // MaximumExecutionFrequencyThreeHours is a MaximumExecutionFrequency enum value - MaximumExecutionFrequencyThreeHours = "Three_Hours" - - // MaximumExecutionFrequencySixHours is a MaximumExecutionFrequency enum value - MaximumExecutionFrequencySixHours = "Six_Hours" - - // MaximumExecutionFrequencyTwelveHours is a MaximumExecutionFrequency enum value - MaximumExecutionFrequencyTwelveHours = "Twelve_Hours" - - // MaximumExecutionFrequencyTwentyFourHours is a MaximumExecutionFrequency enum value - MaximumExecutionFrequencyTwentyFourHours = "TwentyFour_Hours" -) - -const ( - // MessageTypeConfigurationItemChangeNotification is a MessageType enum value - MessageTypeConfigurationItemChangeNotification = "ConfigurationItemChangeNotification" - - // MessageTypeConfigurationSnapshotDeliveryCompleted is a MessageType enum value - MessageTypeConfigurationSnapshotDeliveryCompleted = "ConfigurationSnapshotDeliveryCompleted" - - // MessageTypeScheduledNotification is a MessageType enum value - MessageTypeScheduledNotification = "ScheduledNotification" - - // MessageTypeOversizedConfigurationItemChangeNotification is a MessageType enum value - MessageTypeOversizedConfigurationItemChangeNotification = "OversizedConfigurationItemChangeNotification" -) - -const ( - // OwnerCustomLambda is a Owner enum value - OwnerCustomLambda = "CUSTOM_LAMBDA" - - // OwnerAws is a Owner enum value - OwnerAws = "AWS" -) - -const ( - // RecorderStatusPending is a RecorderStatus enum value - RecorderStatusPending = "Pending" - - // RecorderStatusSuccess is a RecorderStatus enum value - RecorderStatusSuccess = "Success" - - // RecorderStatusFailure is a RecorderStatus enum value - RecorderStatusFailure = "Failure" -) - -const ( - // ResourceTypeAwsEc2CustomerGateway is a ResourceType enum value - ResourceTypeAwsEc2CustomerGateway = "AWS::EC2::CustomerGateway" - - // ResourceTypeAwsEc2Eip is a ResourceType enum value - ResourceTypeAwsEc2Eip = "AWS::EC2::EIP" - - // ResourceTypeAwsEc2Host is a ResourceType enum value - ResourceTypeAwsEc2Host = "AWS::EC2::Host" - - // ResourceTypeAwsEc2Instance is a ResourceType enum value - ResourceTypeAwsEc2Instance = "AWS::EC2::Instance" - - // ResourceTypeAwsEc2InternetGateway is a ResourceType enum value - ResourceTypeAwsEc2InternetGateway = "AWS::EC2::InternetGateway" - - // ResourceTypeAwsEc2NetworkAcl is a ResourceType enum value - ResourceTypeAwsEc2NetworkAcl = "AWS::EC2::NetworkAcl" - - // ResourceTypeAwsEc2NetworkInterface is a ResourceType enum value - ResourceTypeAwsEc2NetworkInterface = "AWS::EC2::NetworkInterface" - - // ResourceTypeAwsEc2RouteTable is a ResourceType enum value - ResourceTypeAwsEc2RouteTable = "AWS::EC2::RouteTable" - - // ResourceTypeAwsEc2SecurityGroup is a ResourceType enum value - ResourceTypeAwsEc2SecurityGroup = "AWS::EC2::SecurityGroup" - - // ResourceTypeAwsEc2Subnet is a ResourceType enum value - ResourceTypeAwsEc2Subnet = "AWS::EC2::Subnet" - - // ResourceTypeAwsCloudTrailTrail is a ResourceType enum value - ResourceTypeAwsCloudTrailTrail = "AWS::CloudTrail::Trail" - - // ResourceTypeAwsEc2Volume is a ResourceType enum value - ResourceTypeAwsEc2Volume = "AWS::EC2::Volume" - - // ResourceTypeAwsEc2Vpc is a ResourceType enum value - ResourceTypeAwsEc2Vpc = "AWS::EC2::VPC" - - // ResourceTypeAwsEc2Vpnconnection is a ResourceType enum value - ResourceTypeAwsEc2Vpnconnection = "AWS::EC2::VPNConnection" - - // ResourceTypeAwsEc2Vpngateway is a ResourceType enum value - ResourceTypeAwsEc2Vpngateway = "AWS::EC2::VPNGateway" - - // ResourceTypeAwsIamGroup is a ResourceType enum value - ResourceTypeAwsIamGroup = "AWS::IAM::Group" - - // ResourceTypeAwsIamPolicy is a ResourceType enum value - ResourceTypeAwsIamPolicy = "AWS::IAM::Policy" - - // ResourceTypeAwsIamRole is a ResourceType enum value - ResourceTypeAwsIamRole = "AWS::IAM::Role" - - // ResourceTypeAwsIamUser is a ResourceType enum value - ResourceTypeAwsIamUser = "AWS::IAM::User" - - // ResourceTypeAwsAcmCertificate is a ResourceType enum value - ResourceTypeAwsAcmCertificate = "AWS::ACM::Certificate" - - // ResourceTypeAwsRdsDbinstance is a ResourceType enum value - ResourceTypeAwsRdsDbinstance = "AWS::RDS::DBInstance" - - // ResourceTypeAwsRdsDbsubnetGroup is a ResourceType enum value - ResourceTypeAwsRdsDbsubnetGroup = "AWS::RDS::DBSubnetGroup" - - // ResourceTypeAwsRdsDbsecurityGroup is a ResourceType enum value - ResourceTypeAwsRdsDbsecurityGroup = "AWS::RDS::DBSecurityGroup" - - // ResourceTypeAwsRdsDbsnapshot is a ResourceType enum value - ResourceTypeAwsRdsDbsnapshot = "AWS::RDS::DBSnapshot" - - // ResourceTypeAwsRdsEventSubscription is a ResourceType enum value - ResourceTypeAwsRdsEventSubscription = "AWS::RDS::EventSubscription" - - // ResourceTypeAwsElasticLoadBalancingV2LoadBalancer is a ResourceType enum value - ResourceTypeAwsElasticLoadBalancingV2LoadBalancer = "AWS::ElasticLoadBalancingV2::LoadBalancer" - - // ResourceTypeAwsS3Bucket is a ResourceType enum value - ResourceTypeAwsS3Bucket = "AWS::S3::Bucket" - - // ResourceTypeAwsSsmManagedInstanceInventory is a ResourceType enum value - ResourceTypeAwsSsmManagedInstanceInventory = "AWS::SSM::ManagedInstanceInventory" - - // ResourceTypeAwsRedshiftCluster is a ResourceType enum value - ResourceTypeAwsRedshiftCluster = "AWS::Redshift::Cluster" - - // ResourceTypeAwsRedshiftClusterSnapshot is a ResourceType enum value - ResourceTypeAwsRedshiftClusterSnapshot = "AWS::Redshift::ClusterSnapshot" - - // ResourceTypeAwsRedshiftClusterParameterGroup is a ResourceType enum value - ResourceTypeAwsRedshiftClusterParameterGroup = "AWS::Redshift::ClusterParameterGroup" - - // ResourceTypeAwsRedshiftClusterSecurityGroup is a ResourceType enum value - ResourceTypeAwsRedshiftClusterSecurityGroup = "AWS::Redshift::ClusterSecurityGroup" - - // ResourceTypeAwsRedshiftClusterSubnetGroup is a ResourceType enum value - ResourceTypeAwsRedshiftClusterSubnetGroup = "AWS::Redshift::ClusterSubnetGroup" - - // ResourceTypeAwsRedshiftEventSubscription is a ResourceType enum value - ResourceTypeAwsRedshiftEventSubscription = "AWS::Redshift::EventSubscription" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go deleted file mode 100644 index abe7294..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go +++ /dev/null @@ -1,191 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package configservice - -const ( - - // ErrCodeInsufficientDeliveryPolicyException for service response error code - // "InsufficientDeliveryPolicyException". - // - // Your Amazon S3 bucket policy does not permit AWS Config to write to it. - ErrCodeInsufficientDeliveryPolicyException = "InsufficientDeliveryPolicyException" - - // ErrCodeInsufficientPermissionsException for service response error code - // "InsufficientPermissionsException". - // - // Indicates one of the following errors: - // - // * The rule cannot be created because the IAM role assigned to AWS Config - // lacks permissions to perform the config:Put* action. - // - // * The AWS Lambda function cannot be invoked. Check the function ARN, and - // check the function's permissions. - ErrCodeInsufficientPermissionsException = "InsufficientPermissionsException" - - // ErrCodeInvalidConfigurationRecorderNameException for service response error code - // "InvalidConfigurationRecorderNameException". - // - // You have provided a configuration recorder name that is not valid. - ErrCodeInvalidConfigurationRecorderNameException = "InvalidConfigurationRecorderNameException" - - // ErrCodeInvalidDeliveryChannelNameException for service response error code - // "InvalidDeliveryChannelNameException". - // - // The specified delivery channel name is not valid. - ErrCodeInvalidDeliveryChannelNameException = "InvalidDeliveryChannelNameException" - - // ErrCodeInvalidLimitException for service response error code - // "InvalidLimitException". - // - // The specified limit is outside the allowable range. - ErrCodeInvalidLimitException = "InvalidLimitException" - - // ErrCodeInvalidNextTokenException for service response error code - // "InvalidNextTokenException". - // - // The specified next token is invalid. Specify the NextToken string that was - // returned in the previous response to get the next page of results. - ErrCodeInvalidNextTokenException = "InvalidNextTokenException" - - // ErrCodeInvalidParameterValueException for service response error code - // "InvalidParameterValueException". - // - // One or more of the specified parameters are invalid. Verify that your parameters - // are valid and try again. - ErrCodeInvalidParameterValueException = "InvalidParameterValueException" - - // ErrCodeInvalidRecordingGroupException for service response error code - // "InvalidRecordingGroupException". - // - // AWS Config throws an exception if the recording group does not contain a - // valid list of resource types. Invalid values could also be incorrectly formatted. - ErrCodeInvalidRecordingGroupException = "InvalidRecordingGroupException" - - // ErrCodeInvalidResultTokenException for service response error code - // "InvalidResultTokenException". - // - // The specified ResultToken is invalid. - ErrCodeInvalidResultTokenException = "InvalidResultTokenException" - - // ErrCodeInvalidRoleException for service response error code - // "InvalidRoleException". - // - // You have provided a null or empty role ARN. - ErrCodeInvalidRoleException = "InvalidRoleException" - - // ErrCodeInvalidS3KeyPrefixException for service response error code - // "InvalidS3KeyPrefixException". - // - // The specified Amazon S3 key prefix is not valid. - ErrCodeInvalidS3KeyPrefixException = "InvalidS3KeyPrefixException" - - // ErrCodeInvalidSNSTopicARNException for service response error code - // "InvalidSNSTopicARNException". - // - // The specified Amazon SNS topic does not exist. - ErrCodeInvalidSNSTopicARNException = "InvalidSNSTopicARNException" - - // ErrCodeInvalidTimeRangeException for service response error code - // "InvalidTimeRangeException". - // - // The specified time range is not valid. The earlier time is not chronologically - // before the later time. - ErrCodeInvalidTimeRangeException = "InvalidTimeRangeException" - - // ErrCodeLastDeliveryChannelDeleteFailedException for service response error code - // "LastDeliveryChannelDeleteFailedException". - // - // You cannot delete the delivery channel you specified because the configuration - // recorder is running. - ErrCodeLastDeliveryChannelDeleteFailedException = "LastDeliveryChannelDeleteFailedException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // This exception is thrown if an evaluation is in progress or if you call the - // StartConfigRulesEvaluation API more than once per minute. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeMaxNumberOfConfigRulesExceededException for service response error code - // "MaxNumberOfConfigRulesExceededException". - // - // Failed to add the AWS Config rule because the account already contains the - // maximum number of 50 rules. Consider deleting any deactivated rules before - // adding new rules. - ErrCodeMaxNumberOfConfigRulesExceededException = "MaxNumberOfConfigRulesExceededException" - - // ErrCodeMaxNumberOfConfigurationRecordersExceededException for service response error code - // "MaxNumberOfConfigurationRecordersExceededException". - // - // You have reached the limit on the number of recorders you can create. - ErrCodeMaxNumberOfConfigurationRecordersExceededException = "MaxNumberOfConfigurationRecordersExceededException" - - // ErrCodeMaxNumberOfDeliveryChannelsExceededException for service response error code - // "MaxNumberOfDeliveryChannelsExceededException". - // - // You have reached the limit on the number of delivery channels you can create. - ErrCodeMaxNumberOfDeliveryChannelsExceededException = "MaxNumberOfDeliveryChannelsExceededException" - - // ErrCodeNoAvailableConfigurationRecorderException for service response error code - // "NoAvailableConfigurationRecorderException". - // - // There are no configuration recorders available to provide the role needed - // to describe your resources. Create a configuration recorder. - ErrCodeNoAvailableConfigurationRecorderException = "NoAvailableConfigurationRecorderException" - - // ErrCodeNoAvailableDeliveryChannelException for service response error code - // "NoAvailableDeliveryChannelException". - // - // There is no delivery channel available to record configurations. - ErrCodeNoAvailableDeliveryChannelException = "NoAvailableDeliveryChannelException" - - // ErrCodeNoRunningConfigurationRecorderException for service response error code - // "NoRunningConfigurationRecorderException". - // - // There is no configuration recorder running. - ErrCodeNoRunningConfigurationRecorderException = "NoRunningConfigurationRecorderException" - - // ErrCodeNoSuchBucketException for service response error code - // "NoSuchBucketException". - // - // The specified Amazon S3 bucket does not exist. - ErrCodeNoSuchBucketException = "NoSuchBucketException" - - // ErrCodeNoSuchConfigRuleException for service response error code - // "NoSuchConfigRuleException". - // - // One or more AWS Config rules in the request are invalid. Verify that the - // rule names are correct and try again. - ErrCodeNoSuchConfigRuleException = "NoSuchConfigRuleException" - - // ErrCodeNoSuchConfigurationRecorderException for service response error code - // "NoSuchConfigurationRecorderException". - // - // You have specified a configuration recorder that does not exist. - ErrCodeNoSuchConfigurationRecorderException = "NoSuchConfigurationRecorderException" - - // ErrCodeNoSuchDeliveryChannelException for service response error code - // "NoSuchDeliveryChannelException". - // - // You have specified a delivery channel that does not exist. - ErrCodeNoSuchDeliveryChannelException = "NoSuchDeliveryChannelException" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUseException". - // - // The rule is currently being deleted or the rule is deleting your evaluation - // results. Try your request again later. - ErrCodeResourceInUseException = "ResourceInUseException" - - // ErrCodeResourceNotDiscoveredException for service response error code - // "ResourceNotDiscoveredException". - // - // You have specified a resource that is either unknown or has not been discovered. - ErrCodeResourceNotDiscoveredException = "ResourceNotDiscoveredException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The requested action is not valid. - ErrCodeValidationException = "ValidationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go deleted file mode 100644 index b27bfb5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go +++ /dev/null @@ -1,116 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package configservice - -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" -) - -// AWS Config provides a way to keep track of the configurations of all the -// AWS resources associated with your AWS account. You can use AWS Config to -// get the current and historical configurations of each AWS resource and also -// to get information about the relationship between the resources. An AWS resource -// can be an Amazon Compute Cloud (Amazon EC2) instance, an Elastic Block Store -// (EBS) volume, an Elastic network Interface (ENI), or a security group. For -// a complete list of resources currently supported by AWS Config, see Supported -// AWS Resources (http://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources). -// -// You can access and manage AWS Config through the AWS Management Console, -// the AWS Command Line Interface (AWS CLI), the AWS Config API, or the AWS -// SDKs for AWS Config -// -// This reference guide contains documentation for the AWS Config API and the -// AWS CLI commands that you can use to manage AWS Config. -// -// The AWS Config API uses the Signature Version 4 protocol for signing requests. -// For more information about how to sign a request with this protocol, see -// Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). -// -// For detailed information about AWS Config features and their associated actions -// or commands, as well as how to work with AWS Management Console, see What -// Is AWS Config? (http://docs.aws.amazon.com/config/latest/developerguide/WhatIsConfig.html) -// in the AWS Config 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/config-2014-11-12 -type ConfigService 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 = "config" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ConfigService 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 ConfigService client from just a session. -// svc := configservice.New(mySession) -// -// // Create a ConfigService client with additional configuration -// svc := configservice.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ConfigService { - 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) *ConfigService { - svc := &ConfigService{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-11-12", - JSONVersion: "1.1", - TargetPrefix: "StarlingDoveService", - }, - 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 ConfigService operation and runs any -// custom request initialization. -func (c *ConfigService) 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/databasemigrationservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go deleted file mode 100644 index 06ceb94..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go +++ /dev/null @@ -1,7100 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package databasemigrationservice provides a client for AWS Database Migration Service. -package databasemigrationservice - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAddTagsToResource = "AddTagsToResource" - -// AddTagsToResourceRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToResourceRequest method. -// req, resp := client.AddTagsToResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AddTagsToResource -func (c *DatabaseMigrationService) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *request.Request, output *AddTagsToResourceOutput) { - op := &request.Operation{ - Name: opAddTagsToResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsToResourceInput{} - } - - output = &AddTagsToResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddTagsToResource API operation for AWS Database Migration Service. -// -// Adds metadata tags to a DMS resource, including replication instance, endpoint, -// security group, and migration task. These tags can also be used with cost -// allocation reporting to track cost associated with DMS resources, or used -// in a Condition statement in an IAM policy for DMS. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation AddTagsToResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AddTagsToResource -func (c *DatabaseMigrationService) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { - req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err -} - -const opCreateEndpoint = "CreateEndpoint" - -// CreateEndpointRequest generates a "aws/request.Request" representing the -// client's request for the CreateEndpoint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateEndpoint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateEndpoint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateEndpointRequest method. -// req, resp := client.CreateEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateEndpoint -func (c *DatabaseMigrationService) CreateEndpointRequest(input *CreateEndpointInput) (req *request.Request, output *CreateEndpointOutput) { - op := &request.Operation{ - Name: opCreateEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateEndpointInput{} - } - - output = &CreateEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEndpoint API operation for AWS Database Migration Service. -// -// Creates an endpoint using the provided 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 AWS Database Migration Service's -// API operation CreateEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// AWS DMS cannot access the KMS key. -// -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" -// The resource you are attempting to create already exists. -// -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" -// The quota for this resource quota has been exceeded. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeAccessDeniedFault "AccessDeniedFault" -// AWS DMS was denied access to the endpoint. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateEndpoint -func (c *DatabaseMigrationService) CreateEndpoint(input *CreateEndpointInput) (*CreateEndpointOutput, error) { - req, out := c.CreateEndpointRequest(input) - err := req.Send() - return out, err -} - -const opCreateReplicationInstance = "CreateReplicationInstance" - -// CreateReplicationInstanceRequest generates a "aws/request.Request" representing the -// client's request for the CreateReplicationInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReplicationInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReplicationInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReplicationInstanceRequest method. -// req, resp := client.CreateReplicationInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationInstance -func (c *DatabaseMigrationService) CreateReplicationInstanceRequest(input *CreateReplicationInstanceInput) (req *request.Request, output *CreateReplicationInstanceOutput) { - op := &request.Operation{ - Name: opCreateReplicationInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReplicationInstanceInput{} - } - - output = &CreateReplicationInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReplicationInstance API operation for AWS Database Migration Service. -// -// Creates the replication instance using the specified parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation CreateReplicationInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDeniedFault "AccessDeniedFault" -// AWS DMS was denied access to the endpoint. -// -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" -// The resource you are attempting to create already exists. -// -// * ErrCodeInsufficientResourceCapacityFault "InsufficientResourceCapacityFault" -// There are not enough resources allocated to the database migration. -// -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" -// The quota for this resource quota has been exceeded. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceededFault" -// The storage quota has been exceeded. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeReplicationSubnetGroupDoesNotCoverEnoughAZs "ReplicationSubnetGroupDoesNotCoverEnoughAZs" -// The replication subnet group does not cover enough Availability Zones (AZs). -// Edit the replication subnet group and add more AZs. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The subnet provided is invalid. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// AWS DMS cannot access the KMS key. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationInstance -func (c *DatabaseMigrationService) CreateReplicationInstance(input *CreateReplicationInstanceInput) (*CreateReplicationInstanceOutput, error) { - req, out := c.CreateReplicationInstanceRequest(input) - err := req.Send() - return out, err -} - -const opCreateReplicationSubnetGroup = "CreateReplicationSubnetGroup" - -// CreateReplicationSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateReplicationSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReplicationSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReplicationSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReplicationSubnetGroupRequest method. -// req, resp := client.CreateReplicationSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationSubnetGroup -func (c *DatabaseMigrationService) CreateReplicationSubnetGroupRequest(input *CreateReplicationSubnetGroupInput) (req *request.Request, output *CreateReplicationSubnetGroupOutput) { - op := &request.Operation{ - Name: opCreateReplicationSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReplicationSubnetGroupInput{} - } - - output = &CreateReplicationSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReplicationSubnetGroup API operation for AWS Database Migration Service. -// -// Creates a replication subnet group given a list of the subnet IDs in 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 AWS Database Migration Service's -// API operation CreateReplicationSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDeniedFault "AccessDeniedFault" -// AWS DMS was denied access to the endpoint. -// -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" -// The resource you are attempting to create already exists. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" -// The quota for this resource quota has been exceeded. -// -// * ErrCodeReplicationSubnetGroupDoesNotCoverEnoughAZs "ReplicationSubnetGroupDoesNotCoverEnoughAZs" -// The replication subnet group does not cover enough Availability Zones (AZs). -// Edit the replication subnet group and add more AZs. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The subnet provided is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationSubnetGroup -func (c *DatabaseMigrationService) CreateReplicationSubnetGroup(input *CreateReplicationSubnetGroupInput) (*CreateReplicationSubnetGroupOutput, error) { - req, out := c.CreateReplicationSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateReplicationTask = "CreateReplicationTask" - -// CreateReplicationTaskRequest generates a "aws/request.Request" representing the -// client's request for the CreateReplicationTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReplicationTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReplicationTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReplicationTaskRequest method. -// req, resp := client.CreateReplicationTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationTask -func (c *DatabaseMigrationService) CreateReplicationTaskRequest(input *CreateReplicationTaskInput) (req *request.Request, output *CreateReplicationTaskOutput) { - op := &request.Operation{ - Name: opCreateReplicationTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReplicationTaskInput{} - } - - output = &CreateReplicationTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReplicationTask API operation for AWS Database Migration Service. -// -// Creates a replication task using the specified parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation CreateReplicationTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" -// The resource you are attempting to create already exists. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// AWS DMS cannot access the KMS key. -// -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" -// The quota for this resource quota has been exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationTask -func (c *DatabaseMigrationService) CreateReplicationTask(input *CreateReplicationTaskInput) (*CreateReplicationTaskOutput, error) { - req, out := c.CreateReplicationTaskRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCertificate = "DeleteCertificate" - -// DeleteCertificateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCertificateRequest method. -// req, resp := client.DeleteCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteCertificate -func (c *DatabaseMigrationService) DeleteCertificateRequest(input *DeleteCertificateInput) (req *request.Request, output *DeleteCertificateOutput) { - op := &request.Operation{ - Name: opDeleteCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCertificateInput{} - } - - output = &DeleteCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCertificate API operation for AWS Database Migration Service. -// -// Deletes the specified certificate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation DeleteCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteCertificate -func (c *DatabaseMigrationService) DeleteCertificate(input *DeleteCertificateInput) (*DeleteCertificateOutput, error) { - req, out := c.DeleteCertificateRequest(input) - err := req.Send() - return out, err -} - -const opDeleteEndpoint = "DeleteEndpoint" - -// DeleteEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEndpoint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteEndpoint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteEndpoint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteEndpointRequest method. -// req, resp := client.DeleteEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteEndpoint -func (c *DatabaseMigrationService) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) { - op := &request.Operation{ - Name: opDeleteEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEndpointInput{} - } - - output = &DeleteEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteEndpoint API operation for AWS Database Migration Service. -// -// Deletes the specified endpoint. -// -// All tasks associated with the endpoint must be deleted before you can delete -// 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 AWS Database Migration Service's -// API operation DeleteEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteEndpoint -func (c *DatabaseMigrationService) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { - req, out := c.DeleteEndpointRequest(input) - err := req.Send() - return out, err -} - -const opDeleteReplicationInstance = "DeleteReplicationInstance" - -// DeleteReplicationInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReplicationInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteReplicationInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteReplicationInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteReplicationInstanceRequest method. -// req, resp := client.DeleteReplicationInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationInstance -func (c *DatabaseMigrationService) DeleteReplicationInstanceRequest(input *DeleteReplicationInstanceInput) (req *request.Request, output *DeleteReplicationInstanceOutput) { - op := &request.Operation{ - Name: opDeleteReplicationInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteReplicationInstanceInput{} - } - - output = &DeleteReplicationInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteReplicationInstance API operation for AWS Database Migration Service. -// -// Deletes the specified replication instance. -// -// You must delete any migration tasks that are associated with the replication -// instance 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 AWS Database Migration Service's -// API operation DeleteReplicationInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationInstance -func (c *DatabaseMigrationService) DeleteReplicationInstance(input *DeleteReplicationInstanceInput) (*DeleteReplicationInstanceOutput, error) { - req, out := c.DeleteReplicationInstanceRequest(input) - err := req.Send() - return out, err -} - -const opDeleteReplicationSubnetGroup = "DeleteReplicationSubnetGroup" - -// DeleteReplicationSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReplicationSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteReplicationSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteReplicationSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteReplicationSubnetGroupRequest method. -// req, resp := client.DeleteReplicationSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationSubnetGroup -func (c *DatabaseMigrationService) DeleteReplicationSubnetGroupRequest(input *DeleteReplicationSubnetGroupInput) (req *request.Request, output *DeleteReplicationSubnetGroupOutput) { - op := &request.Operation{ - Name: opDeleteReplicationSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteReplicationSubnetGroupInput{} - } - - output = &DeleteReplicationSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteReplicationSubnetGroup API operation for AWS Database Migration Service. -// -// Deletes a subnet group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation DeleteReplicationSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationSubnetGroup -func (c *DatabaseMigrationService) DeleteReplicationSubnetGroup(input *DeleteReplicationSubnetGroupInput) (*DeleteReplicationSubnetGroupOutput, error) { - req, out := c.DeleteReplicationSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteReplicationTask = "DeleteReplicationTask" - -// DeleteReplicationTaskRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReplicationTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteReplicationTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteReplicationTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteReplicationTaskRequest method. -// req, resp := client.DeleteReplicationTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationTask -func (c *DatabaseMigrationService) DeleteReplicationTaskRequest(input *DeleteReplicationTaskInput) (req *request.Request, output *DeleteReplicationTaskOutput) { - op := &request.Operation{ - Name: opDeleteReplicationTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteReplicationTaskInput{} - } - - output = &DeleteReplicationTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteReplicationTask API operation for AWS Database Migration Service. -// -// Deletes the specified replication 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 AWS Database Migration Service's -// API operation DeleteReplicationTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationTask -func (c *DatabaseMigrationService) DeleteReplicationTask(input *DeleteReplicationTaskInput) (*DeleteReplicationTaskOutput, error) { - req, out := c.DeleteReplicationTaskRequest(input) - err := req.Send() - return out, err -} - -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/dms-2016-01-01/DescribeAccountAttributes -func (c *DatabaseMigrationService) 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 AWS Database Migration Service. -// -// Lists all of the AWS DMS attributes for a customer account. The attributes -// include AWS DMS quotas for the account, such as the number of replication -// instances allowed. The description for a quota includes the quota name, current -// usage toward that quota, and the quota's maximum value. -// -// This command does not take any parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation DescribeAccountAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeAccountAttributes -func (c *DatabaseMigrationService) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error) { - req, out := c.DescribeAccountAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeCertificates = "DescribeCertificates" - -// DescribeCertificatesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCertificates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCertificates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCertificates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCertificatesRequest method. -// req, resp := client.DescribeCertificatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeCertificates -func (c *DatabaseMigrationService) DescribeCertificatesRequest(input *DescribeCertificatesInput) (req *request.Request, output *DescribeCertificatesOutput) { - op := &request.Operation{ - Name: opDescribeCertificates, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeCertificatesInput{} - } - - output = &DescribeCertificatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCertificates API operation for AWS Database Migration Service. -// -// Provides a description of the certificate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation DescribeCertificates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeCertificates -func (c *DatabaseMigrationService) DescribeCertificates(input *DescribeCertificatesInput) (*DescribeCertificatesOutput, error) { - req, out := c.DescribeCertificatesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConnections = "DescribeConnections" - -// DescribeConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConnections operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConnections for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConnections method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConnectionsRequest method. -// req, resp := client.DescribeConnectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeConnections -func (c *DatabaseMigrationService) DescribeConnectionsRequest(input *DescribeConnectionsInput) (req *request.Request, output *DescribeConnectionsOutput) { - op := &request.Operation{ - Name: opDescribeConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConnectionsInput{} - } - - output = &DescribeConnectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConnections API operation for AWS Database Migration Service. -// -// Describes the status of the connections that have been made between the replication -// instance and an endpoint. Connections are created when you test an 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 AWS Database Migration Service's -// API operation DescribeConnections for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeConnections -func (c *DatabaseMigrationService) DescribeConnections(input *DescribeConnectionsInput) (*DescribeConnectionsOutput, error) { - req, out := c.DescribeConnectionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEndpointTypes = "DescribeEndpointTypes" - -// DescribeEndpointTypesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEndpointTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEndpointTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEndpointTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEndpointTypesRequest method. -// req, resp := client.DescribeEndpointTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpointTypes -func (c *DatabaseMigrationService) DescribeEndpointTypesRequest(input *DescribeEndpointTypesInput) (req *request.Request, output *DescribeEndpointTypesOutput) { - op := &request.Operation{ - Name: opDescribeEndpointTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEndpointTypesInput{} - } - - output = &DescribeEndpointTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEndpointTypes API operation for AWS Database Migration Service. -// -// Returns information about the type of endpoints available. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation DescribeEndpointTypes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpointTypes -func (c *DatabaseMigrationService) DescribeEndpointTypes(input *DescribeEndpointTypesInput) (*DescribeEndpointTypesOutput, error) { - req, out := c.DescribeEndpointTypesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEndpoints = "DescribeEndpoints" - -// DescribeEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEndpoints operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEndpoints for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEndpoints method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEndpointsRequest method. -// req, resp := client.DescribeEndpointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpoints -func (c *DatabaseMigrationService) DescribeEndpointsRequest(input *DescribeEndpointsInput) (req *request.Request, output *DescribeEndpointsOutput) { - op := &request.Operation{ - Name: opDescribeEndpoints, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEndpointsInput{} - } - - output = &DescribeEndpointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEndpoints API operation for AWS Database Migration Service. -// -// Returns information about the endpoints for your account in the current 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 AWS Database Migration Service's -// API operation DescribeEndpoints for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpoints -func (c *DatabaseMigrationService) DescribeEndpoints(input *DescribeEndpointsInput) (*DescribeEndpointsOutput, error) { - req, out := c.DescribeEndpointsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeOrderableReplicationInstances = "DescribeOrderableReplicationInstances" - -// DescribeOrderableReplicationInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOrderableReplicationInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeOrderableReplicationInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeOrderableReplicationInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeOrderableReplicationInstancesRequest method. -// req, resp := client.DescribeOrderableReplicationInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeOrderableReplicationInstances -func (c *DatabaseMigrationService) DescribeOrderableReplicationInstancesRequest(input *DescribeOrderableReplicationInstancesInput) (req *request.Request, output *DescribeOrderableReplicationInstancesOutput) { - op := &request.Operation{ - Name: opDescribeOrderableReplicationInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeOrderableReplicationInstancesInput{} - } - - output = &DescribeOrderableReplicationInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeOrderableReplicationInstances API operation for AWS Database Migration Service. -// -// Returns information about the replication instance types that can be created -// in the specified 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 AWS Database Migration Service's -// API operation DescribeOrderableReplicationInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeOrderableReplicationInstances -func (c *DatabaseMigrationService) DescribeOrderableReplicationInstances(input *DescribeOrderableReplicationInstancesInput) (*DescribeOrderableReplicationInstancesOutput, error) { - req, out := c.DescribeOrderableReplicationInstancesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeRefreshSchemasStatus = "DescribeRefreshSchemasStatus" - -// DescribeRefreshSchemasStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRefreshSchemasStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRefreshSchemasStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRefreshSchemasStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRefreshSchemasStatusRequest method. -// req, resp := client.DescribeRefreshSchemasStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeRefreshSchemasStatus -func (c *DatabaseMigrationService) DescribeRefreshSchemasStatusRequest(input *DescribeRefreshSchemasStatusInput) (req *request.Request, output *DescribeRefreshSchemasStatusOutput) { - op := &request.Operation{ - Name: opDescribeRefreshSchemasStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRefreshSchemasStatusInput{} - } - - output = &DescribeRefreshSchemasStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRefreshSchemasStatus API operation for AWS Database Migration Service. -// -// Returns the status of the RefreshSchemas 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 AWS Database Migration Service's -// API operation DescribeRefreshSchemasStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeRefreshSchemasStatus -func (c *DatabaseMigrationService) DescribeRefreshSchemasStatus(input *DescribeRefreshSchemasStatusInput) (*DescribeRefreshSchemasStatusOutput, error) { - req, out := c.DescribeRefreshSchemasStatusRequest(input) - err := req.Send() - return out, err -} - -const opDescribeReplicationInstances = "DescribeReplicationInstances" - -// DescribeReplicationInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReplicationInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReplicationInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReplicationInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReplicationInstancesRequest method. -// req, resp := client.DescribeReplicationInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationInstances -func (c *DatabaseMigrationService) DescribeReplicationInstancesRequest(input *DescribeReplicationInstancesInput) (req *request.Request, output *DescribeReplicationInstancesOutput) { - op := &request.Operation{ - Name: opDescribeReplicationInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReplicationInstancesInput{} - } - - output = &DescribeReplicationInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReplicationInstances API operation for AWS Database Migration Service. -// -// Returns information about replication instances for your account in the current -// 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 AWS Database Migration Service's -// API operation DescribeReplicationInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationInstances -func (c *DatabaseMigrationService) DescribeReplicationInstances(input *DescribeReplicationInstancesInput) (*DescribeReplicationInstancesOutput, error) { - req, out := c.DescribeReplicationInstancesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeReplicationSubnetGroups = "DescribeReplicationSubnetGroups" - -// DescribeReplicationSubnetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReplicationSubnetGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReplicationSubnetGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReplicationSubnetGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReplicationSubnetGroupsRequest method. -// req, resp := client.DescribeReplicationSubnetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationSubnetGroups -func (c *DatabaseMigrationService) DescribeReplicationSubnetGroupsRequest(input *DescribeReplicationSubnetGroupsInput) (req *request.Request, output *DescribeReplicationSubnetGroupsOutput) { - op := &request.Operation{ - Name: opDescribeReplicationSubnetGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReplicationSubnetGroupsInput{} - } - - output = &DescribeReplicationSubnetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReplicationSubnetGroups API operation for AWS Database Migration Service. -// -// Returns information about the replication subnet groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation DescribeReplicationSubnetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationSubnetGroups -func (c *DatabaseMigrationService) DescribeReplicationSubnetGroups(input *DescribeReplicationSubnetGroupsInput) (*DescribeReplicationSubnetGroupsOutput, error) { - req, out := c.DescribeReplicationSubnetGroupsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeReplicationTasks = "DescribeReplicationTasks" - -// DescribeReplicationTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReplicationTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReplicationTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReplicationTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReplicationTasksRequest method. -// req, resp := client.DescribeReplicationTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationTasks -func (c *DatabaseMigrationService) DescribeReplicationTasksRequest(input *DescribeReplicationTasksInput) (req *request.Request, output *DescribeReplicationTasksOutput) { - op := &request.Operation{ - Name: opDescribeReplicationTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReplicationTasksInput{} - } - - output = &DescribeReplicationTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReplicationTasks API operation for AWS Database Migration Service. -// -// Returns information about replication tasks for your account in the current -// 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 AWS Database Migration Service's -// API operation DescribeReplicationTasks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationTasks -func (c *DatabaseMigrationService) DescribeReplicationTasks(input *DescribeReplicationTasksInput) (*DescribeReplicationTasksOutput, error) { - req, out := c.DescribeReplicationTasksRequest(input) - err := req.Send() - return out, err -} - -const opDescribeSchemas = "DescribeSchemas" - -// DescribeSchemasRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSchemas operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSchemas for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSchemas method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSchemasRequest method. -// req, resp := client.DescribeSchemasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeSchemas -func (c *DatabaseMigrationService) DescribeSchemasRequest(input *DescribeSchemasInput) (req *request.Request, output *DescribeSchemasOutput) { - op := &request.Operation{ - Name: opDescribeSchemas, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSchemasInput{} - } - - output = &DescribeSchemasOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSchemas API operation for AWS Database Migration Service. -// -// Returns information about the schema for the specified 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 AWS Database Migration Service's -// API operation DescribeSchemas for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeSchemas -func (c *DatabaseMigrationService) DescribeSchemas(input *DescribeSchemasInput) (*DescribeSchemasOutput, error) { - req, out := c.DescribeSchemasRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTableStatistics = "DescribeTableStatistics" - -// DescribeTableStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTableStatistics operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTableStatistics for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTableStatistics method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTableStatisticsRequest method. -// req, resp := client.DescribeTableStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeTableStatistics -func (c *DatabaseMigrationService) DescribeTableStatisticsRequest(input *DescribeTableStatisticsInput) (req *request.Request, output *DescribeTableStatisticsOutput) { - op := &request.Operation{ - Name: opDescribeTableStatistics, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTableStatisticsInput{} - } - - output = &DescribeTableStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTableStatistics API operation for AWS Database Migration Service. -// -// Returns table statistics on the database migration task, including table -// name, rows inserted, rows updated, and rows 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 AWS Database Migration Service's -// API operation DescribeTableStatistics for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeTableStatistics -func (c *DatabaseMigrationService) DescribeTableStatistics(input *DescribeTableStatisticsInput) (*DescribeTableStatisticsOutput, error) { - req, out := c.DescribeTableStatisticsRequest(input) - err := req.Send() - return out, err -} - -const opImportCertificate = "ImportCertificate" - -// ImportCertificateRequest generates a "aws/request.Request" representing the -// client's request for the ImportCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportCertificateRequest method. -// req, resp := client.ImportCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ImportCertificate -func (c *DatabaseMigrationService) ImportCertificateRequest(input *ImportCertificateInput) (req *request.Request, output *ImportCertificateOutput) { - op := &request.Operation{ - Name: opImportCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportCertificateInput{} - } - - output = &ImportCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportCertificate API operation for AWS Database Migration Service. -// -// Uploads the specified certificate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation ImportCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" -// The resource you are attempting to create already exists. -// -// * ErrCodeInvalidCertificateFault "InvalidCertificateFault" -// The certificate was not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ImportCertificate -func (c *DatabaseMigrationService) ImportCertificate(input *ImportCertificateInput) (*ImportCertificateOutput, error) { - req, out := c.ImportCertificateRequest(input) - err := req.Send() - return out, err -} - -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/dms-2016-01-01/ListTagsForResource -func (c *DatabaseMigrationService) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Database Migration Service. -// -// Lists all tags for an AWS DMS 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 AWS Database Migration Service's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ListTagsForResource -func (c *DatabaseMigrationService) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opModifyEndpoint = "ModifyEndpoint" - -// ModifyEndpointRequest generates a "aws/request.Request" representing the -// client's request for the ModifyEndpoint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyEndpoint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyEndpoint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyEndpointRequest method. -// req, resp := client.ModifyEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyEndpoint -func (c *DatabaseMigrationService) ModifyEndpointRequest(input *ModifyEndpointInput) (req *request.Request, output *ModifyEndpointOutput) { - op := &request.Operation{ - Name: opModifyEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyEndpointInput{} - } - - output = &ModifyEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyEndpoint API operation for AWS Database Migration Service. -// -// Modifies the specified 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 AWS Database Migration Service's -// API operation ModifyEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" -// The resource you are attempting to create already exists. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// AWS DMS cannot access the KMS key. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyEndpoint -func (c *DatabaseMigrationService) ModifyEndpoint(input *ModifyEndpointInput) (*ModifyEndpointOutput, error) { - req, out := c.ModifyEndpointRequest(input) - err := req.Send() - return out, err -} - -const opModifyReplicationInstance = "ModifyReplicationInstance" - -// ModifyReplicationInstanceRequest generates a "aws/request.Request" representing the -// client's request for the ModifyReplicationInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyReplicationInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyReplicationInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyReplicationInstanceRequest method. -// req, resp := client.ModifyReplicationInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationInstance -func (c *DatabaseMigrationService) ModifyReplicationInstanceRequest(input *ModifyReplicationInstanceInput) (req *request.Request, output *ModifyReplicationInstanceOutput) { - op := &request.Operation{ - Name: opModifyReplicationInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyReplicationInstanceInput{} - } - - output = &ModifyReplicationInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyReplicationInstance API operation for AWS Database Migration Service. -// -// Modifies the replication instance to apply new settings. You can change one -// or more parameters by specifying these parameters and the new values in the -// request. -// -// Some settings are applied during the maintenance window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation ModifyReplicationInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" -// The resource you are attempting to create already exists. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInsufficientResourceCapacityFault "InsufficientResourceCapacityFault" -// There are not enough resources allocated to the database migration. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceededFault" -// The storage quota has been exceeded. -// -// * ErrCodeUpgradeDependencyFailureFault "UpgradeDependencyFailureFault" -// An upgrade dependency is preventing the database migration. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationInstance -func (c *DatabaseMigrationService) ModifyReplicationInstance(input *ModifyReplicationInstanceInput) (*ModifyReplicationInstanceOutput, error) { - req, out := c.ModifyReplicationInstanceRequest(input) - err := req.Send() - return out, err -} - -const opModifyReplicationSubnetGroup = "ModifyReplicationSubnetGroup" - -// ModifyReplicationSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyReplicationSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyReplicationSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyReplicationSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyReplicationSubnetGroupRequest method. -// req, resp := client.ModifyReplicationSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationSubnetGroup -func (c *DatabaseMigrationService) ModifyReplicationSubnetGroupRequest(input *ModifyReplicationSubnetGroupInput) (req *request.Request, output *ModifyReplicationSubnetGroupOutput) { - op := &request.Operation{ - Name: opModifyReplicationSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyReplicationSubnetGroupInput{} - } - - output = &ModifyReplicationSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyReplicationSubnetGroup API operation for AWS Database Migration Service. -// -// Modifies the settings for the specified replication subnet group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Database Migration Service's -// API operation ModifyReplicationSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDeniedFault "AccessDeniedFault" -// AWS DMS was denied access to the endpoint. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" -// The quota for this resource quota has been exceeded. -// -// * ErrCodeSubnetAlreadyInUse "SubnetAlreadyInUse" -// The specified subnet is already in use. -// -// * ErrCodeReplicationSubnetGroupDoesNotCoverEnoughAZs "ReplicationSubnetGroupDoesNotCoverEnoughAZs" -// The replication subnet group does not cover enough Availability Zones (AZs). -// Edit the replication subnet group and add more AZs. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The subnet provided is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationSubnetGroup -func (c *DatabaseMigrationService) ModifyReplicationSubnetGroup(input *ModifyReplicationSubnetGroupInput) (*ModifyReplicationSubnetGroupOutput, error) { - req, out := c.ModifyReplicationSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyReplicationTask = "ModifyReplicationTask" - -// ModifyReplicationTaskRequest generates a "aws/request.Request" representing the -// client's request for the ModifyReplicationTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyReplicationTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyReplicationTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyReplicationTaskRequest method. -// req, resp := client.ModifyReplicationTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationTask -func (c *DatabaseMigrationService) ModifyReplicationTaskRequest(input *ModifyReplicationTaskInput) (req *request.Request, output *ModifyReplicationTaskOutput) { - op := &request.Operation{ - Name: opModifyReplicationTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyReplicationTaskInput{} - } - - output = &ModifyReplicationTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyReplicationTask API operation for AWS Database Migration Service. -// -// Modifies the specified replication task. -// -// You can't modify the task endpoints. The task must be stopped before you -// can modify 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 AWS Database Migration Service's -// API operation ModifyReplicationTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" -// The resource you are attempting to create already exists. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// AWS DMS cannot access the KMS key. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationTask -func (c *DatabaseMigrationService) ModifyReplicationTask(input *ModifyReplicationTaskInput) (*ModifyReplicationTaskOutput, error) { - req, out := c.ModifyReplicationTaskRequest(input) - err := req.Send() - return out, err -} - -const opRefreshSchemas = "RefreshSchemas" - -// RefreshSchemasRequest generates a "aws/request.Request" representing the -// client's request for the RefreshSchemas operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RefreshSchemas for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RefreshSchemas method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RefreshSchemasRequest method. -// req, resp := client.RefreshSchemasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RefreshSchemas -func (c *DatabaseMigrationService) RefreshSchemasRequest(input *RefreshSchemasInput) (req *request.Request, output *RefreshSchemasOutput) { - op := &request.Operation{ - Name: opRefreshSchemas, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RefreshSchemasInput{} - } - - output = &RefreshSchemasOutput{} - req = c.newRequest(op, input, output) - return -} - -// RefreshSchemas API operation for AWS Database Migration Service. -// -// Populates the schema for the specified endpoint. This is an asynchronous -// operation and can take several minutes. You can check the status of this -// operation by calling the DescribeRefreshSchemasStatus 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 AWS Database Migration Service's -// API operation RefreshSchemas for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// AWS DMS cannot access the KMS key. -// -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" -// The quota for this resource quota has been exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RefreshSchemas -func (c *DatabaseMigrationService) RefreshSchemas(input *RefreshSchemasInput) (*RefreshSchemasOutput, error) { - req, out := c.RefreshSchemasRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTagsFromResource = "RemoveTagsFromResource" - -// RemoveTagsFromResourceRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromResourceRequest method. -// req, resp := client.RemoveTagsFromResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RemoveTagsFromResource -func (c *DatabaseMigrationService) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) (req *request.Request, output *RemoveTagsFromResourceOutput) { - op := &request.Operation{ - Name: opRemoveTagsFromResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsFromResourceInput{} - } - - output = &RemoveTagsFromResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTagsFromResource API operation for AWS Database Migration Service. -// -// Removes metadata tags from a DMS 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 AWS Database Migration Service's -// API operation RemoveTagsFromResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RemoveTagsFromResource -func (c *DatabaseMigrationService) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { - req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err -} - -const opStartReplicationTask = "StartReplicationTask" - -// StartReplicationTaskRequest generates a "aws/request.Request" representing the -// client's request for the StartReplicationTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartReplicationTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartReplicationTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartReplicationTaskRequest method. -// req, resp := client.StartReplicationTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StartReplicationTask -func (c *DatabaseMigrationService) StartReplicationTaskRequest(input *StartReplicationTaskInput) (req *request.Request, output *StartReplicationTaskOutput) { - op := &request.Operation{ - Name: opStartReplicationTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartReplicationTaskInput{} - } - - output = &StartReplicationTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartReplicationTask API operation for AWS Database Migration Service. -// -// Starts the replication 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 AWS Database Migration Service's -// API operation StartReplicationTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StartReplicationTask -func (c *DatabaseMigrationService) StartReplicationTask(input *StartReplicationTaskInput) (*StartReplicationTaskOutput, error) { - req, out := c.StartReplicationTaskRequest(input) - err := req.Send() - return out, err -} - -const opStopReplicationTask = "StopReplicationTask" - -// StopReplicationTaskRequest generates a "aws/request.Request" representing the -// client's request for the StopReplicationTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopReplicationTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopReplicationTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopReplicationTaskRequest method. -// req, resp := client.StopReplicationTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StopReplicationTask -func (c *DatabaseMigrationService) StopReplicationTaskRequest(input *StopReplicationTaskInput) (req *request.Request, output *StopReplicationTaskOutput) { - op := &request.Operation{ - Name: opStopReplicationTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopReplicationTaskInput{} - } - - output = &StopReplicationTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopReplicationTask API operation for AWS Database Migration Service. -// -// Stops the replication 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 AWS Database Migration Service's -// API operation StopReplicationTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StopReplicationTask -func (c *DatabaseMigrationService) StopReplicationTask(input *StopReplicationTaskInput) (*StopReplicationTaskOutput, error) { - req, out := c.StopReplicationTaskRequest(input) - err := req.Send() - return out, err -} - -const opTestConnection = "TestConnection" - -// TestConnectionRequest generates a "aws/request.Request" representing the -// client's request for the TestConnection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TestConnection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TestConnection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TestConnectionRequest method. -// req, resp := client.TestConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/TestConnection -func (c *DatabaseMigrationService) TestConnectionRequest(input *TestConnectionInput) (req *request.Request, output *TestConnectionOutput) { - op := &request.Operation{ - Name: opTestConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TestConnectionInput{} - } - - output = &TestConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestConnection API operation for AWS Database Migration Service. -// -// Tests the connection between the replication instance and 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 AWS Database Migration Service's -// API operation TestConnection for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" -// The resource is in a state that prevents it from being used for database -// migration. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// AWS DMS cannot access the KMS key. -// -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" -// The quota for this resource quota has been exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/TestConnection -func (c *DatabaseMigrationService) TestConnection(input *TestConnectionInput) (*TestConnectionOutput, error) { - req, out := c.TestConnectionRequest(input) - err := req.Send() - return out, err -} - -// Describes a quota for an AWS account, for example, the number of replication -// instances allowed. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AccountQuota -type AccountQuota struct { - _ struct{} `type:"structure"` - - // The name of the AWS DMS quota for this AWS account. - AccountQuotaName *string `type:"string"` - - // The maximum allowed value for the quota. - Max *int64 `type:"long"` - - // The amount currently used toward the quota maximum. - Used *int64 `type:"long"` -} - -// String returns the string representation -func (s AccountQuota) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountQuota) GoString() string { - return s.String() -} - -// SetAccountQuotaName sets the AccountQuotaName field's value. -func (s *AccountQuota) SetAccountQuotaName(v string) *AccountQuota { - s.AccountQuotaName = &v - return s -} - -// SetMax sets the Max field's value. -func (s *AccountQuota) SetMax(v int64) *AccountQuota { - s.Max = &v - return s -} - -// SetUsed sets the Used field's value. -func (s *AccountQuota) SetUsed(v int64) *AccountQuota { - s.Used = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AddTagsToResourceMessage -type AddTagsToResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be added - // to. AWS DMS resources include a replication instance, endpoint, and a replication - // task. - // - // ResourceArn is a required field - ResourceArn *string `type:"string" required:"true"` - - // The tag to be assigned to the DMS resource. - // - // Tags is a required field - Tags []*Tag `locationNameList:"Tag" type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsToResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *AddTagsToResourceInput) SetResourceArn(v string) *AddTagsToResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToResourceInput) SetTags(v []*Tag) *AddTagsToResourceInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AddTagsToResourceResponse -type AddTagsToResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsToResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AvailabilityZone -type AvailabilityZone struct { - _ struct{} `type:"structure"` - - // The name of the availability zone. - Name *string `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() -} - -// SetName sets the Name field's value. -func (s *AvailabilityZone) SetName(v string) *AvailabilityZone { - s.Name = &v - return s -} - -// The SSL certificate that can be used to encrypt connections between the endpoints -// and the replication instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/Certificate -type Certificate struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the certificate. - CertificateArn *string `type:"string"` - - // The date that the certificate was created. - CertificateCreationDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The customer-assigned name of the certificate. Valid characters are A-z and - // 0-9. - CertificateIdentifier *string `type:"string"` - - // The owner of the certificate. - CertificateOwner *string `type:"string"` - - // The contents of the .pem X.509 certificate file for the certificate. - CertificatePem *string `type:"string"` - - // The location of the imported Oracle Wallet certificate for use with SSL. - // - // CertificateWallet is automatically base64 encoded/decoded by the SDK. - CertificateWallet []byte `type:"blob"` - - // The key length of the cryptographic algorithm being used. - KeyLength *int64 `type:"integer"` - - // The signing algorithm for the certificate. - SigningAlgorithm *string `type:"string"` - - // The beginning date that the certificate is valid. - ValidFromDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The final date that the certificate is valid. - ValidToDate *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s Certificate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Certificate) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *Certificate) SetCertificateArn(v string) *Certificate { - s.CertificateArn = &v - return s -} - -// SetCertificateCreationDate sets the CertificateCreationDate field's value. -func (s *Certificate) SetCertificateCreationDate(v time.Time) *Certificate { - s.CertificateCreationDate = &v - return s -} - -// SetCertificateIdentifier sets the CertificateIdentifier field's value. -func (s *Certificate) SetCertificateIdentifier(v string) *Certificate { - s.CertificateIdentifier = &v - return s -} - -// SetCertificateOwner sets the CertificateOwner field's value. -func (s *Certificate) SetCertificateOwner(v string) *Certificate { - s.CertificateOwner = &v - return s -} - -// SetCertificatePem sets the CertificatePem field's value. -func (s *Certificate) SetCertificatePem(v string) *Certificate { - s.CertificatePem = &v - return s -} - -// SetCertificateWallet sets the CertificateWallet field's value. -func (s *Certificate) SetCertificateWallet(v []byte) *Certificate { - s.CertificateWallet = v - return s -} - -// SetKeyLength sets the KeyLength field's value. -func (s *Certificate) SetKeyLength(v int64) *Certificate { - s.KeyLength = &v - return s -} - -// SetSigningAlgorithm sets the SigningAlgorithm field's value. -func (s *Certificate) SetSigningAlgorithm(v string) *Certificate { - s.SigningAlgorithm = &v - return s -} - -// SetValidFromDate sets the ValidFromDate field's value. -func (s *Certificate) SetValidFromDate(v time.Time) *Certificate { - s.ValidFromDate = &v - return s -} - -// SetValidToDate sets the ValidToDate field's value. -func (s *Certificate) SetValidToDate(v time.Time) *Certificate { - s.ValidToDate = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/Connection -type Connection struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - EndpointArn *string `type:"string"` - - // The identifier of the endpoint. Identifiers must begin with a letter; must - // contain only ASCII letters, digits, and hyphens; and must not end with a - // hyphen or contain two consecutive hyphens. - EndpointIdentifier *string `type:"string"` - - // The error message when the connection last failed. - LastFailureMessage *string `type:"string"` - - // The Amazon Resource Name (ARN) of the replication instance. - ReplicationInstanceArn *string `type:"string"` - - // The replication instance identifier. This parameter is stored as a lowercase - // string. - ReplicationInstanceIdentifier *string `type:"string"` - - // The connection status. - Status *string `type:"string"` -} - -// String returns the string representation -func (s Connection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Connection) GoString() string { - return s.String() -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *Connection) SetEndpointArn(v string) *Connection { - s.EndpointArn = &v - return s -} - -// SetEndpointIdentifier sets the EndpointIdentifier field's value. -func (s *Connection) SetEndpointIdentifier(v string) *Connection { - s.EndpointIdentifier = &v - return s -} - -// SetLastFailureMessage sets the LastFailureMessage field's value. -func (s *Connection) SetLastFailureMessage(v string) *Connection { - s.LastFailureMessage = &v - return s -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *Connection) SetReplicationInstanceArn(v string) *Connection { - s.ReplicationInstanceArn = &v - return s -} - -// SetReplicationInstanceIdentifier sets the ReplicationInstanceIdentifier field's value. -func (s *Connection) SetReplicationInstanceIdentifier(v string) *Connection { - s.ReplicationInstanceIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Connection) SetStatus(v string) *Connection { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateEndpointMessage -type CreateEndpointInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Number (ARN) for the certificate. - CertificateArn *string `type:"string"` - - // The name of the endpoint database. - DatabaseName *string `type:"string"` - - // The database endpoint identifier. Identifiers must begin with a letter; must - // contain only ASCII letters, digits, and hyphens; and must not end with a - // hyphen or contain two consecutive hyphens. - // - // EndpointIdentifier is a required field - EndpointIdentifier *string `type:"string" required:"true"` - - // The type of endpoint. - // - // EndpointType is a required field - EndpointType *string `type:"string" required:"true" enum:"ReplicationEndpointTypeValue"` - - // The type of engine for the endpoint. Valid values include MYSQL, ORACLE, - // POSTGRES, MARIADB, AURORA, REDSHIFT, SYBASE, and SQLSERVER. - // - // EngineName is a required field - EngineName *string `type:"string" required:"true"` - - // Additional attributes associated with the connection. - ExtraConnectionAttributes *string `type:"string"` - - // The KMS key identifier that will be used to encrypt the connection parameters. - // If you do not specify a value for the KmsKeyId parameter, then AWS DMS will - // use your default encryption key. AWS KMS creates the default encryption key - // for your AWS account. Your AWS account has a different default encryption - // key for each AWS region. - KmsKeyId *string `type:"string"` - - // The password to be used to login to the endpoint database. - Password *string `type:"string"` - - // The port used by the endpoint database. - Port *int64 `type:"integer"` - - // The name of the server where the endpoint database resides. - ServerName *string `type:"string"` - - // The SSL mode to use for the SSL connection. - // - // SSL mode can be one of four values: none, require, verify-ca, verify-full. - // - // The default value is none. - SslMode *string `type:"string" enum:"DmsSslModeValue"` - - // Tags to be added to the endpoint. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The user name to be used to login to the endpoint database. - Username *string `type:"string"` -} - -// String returns the string representation -func (s CreateEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEndpointInput"} - if s.EndpointIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointIdentifier")) - } - if s.EndpointType == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointType")) - } - if s.EngineName == nil { - invalidParams.Add(request.NewErrParamRequired("EngineName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *CreateEndpointInput) SetCertificateArn(v string) *CreateEndpointInput { - s.CertificateArn = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *CreateEndpointInput) SetDatabaseName(v string) *CreateEndpointInput { - s.DatabaseName = &v - return s -} - -// SetEndpointIdentifier sets the EndpointIdentifier field's value. -func (s *CreateEndpointInput) SetEndpointIdentifier(v string) *CreateEndpointInput { - s.EndpointIdentifier = &v - return s -} - -// SetEndpointType sets the EndpointType field's value. -func (s *CreateEndpointInput) SetEndpointType(v string) *CreateEndpointInput { - s.EndpointType = &v - return s -} - -// SetEngineName sets the EngineName field's value. -func (s *CreateEndpointInput) SetEngineName(v string) *CreateEndpointInput { - s.EngineName = &v - return s -} - -// SetExtraConnectionAttributes sets the ExtraConnectionAttributes field's value. -func (s *CreateEndpointInput) SetExtraConnectionAttributes(v string) *CreateEndpointInput { - s.ExtraConnectionAttributes = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateEndpointInput) SetKmsKeyId(v string) *CreateEndpointInput { - s.KmsKeyId = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *CreateEndpointInput) SetPassword(v string) *CreateEndpointInput { - s.Password = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateEndpointInput) SetPort(v int64) *CreateEndpointInput { - s.Port = &v - return s -} - -// SetServerName sets the ServerName field's value. -func (s *CreateEndpointInput) SetServerName(v string) *CreateEndpointInput { - s.ServerName = &v - return s -} - -// SetSslMode sets the SslMode field's value. -func (s *CreateEndpointInput) SetSslMode(v string) *CreateEndpointInput { - s.SslMode = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateEndpointInput) SetTags(v []*Tag) *CreateEndpointInput { - s.Tags = v - return s -} - -// SetUsername sets the Username field's value. -func (s *CreateEndpointInput) SetUsername(v string) *CreateEndpointInput { - s.Username = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateEndpointResponse -type CreateEndpointOutput struct { - _ struct{} `type:"structure"` - - // The endpoint that was created. - Endpoint *Endpoint `type:"structure"` -} - -// String returns the string representation -func (s CreateEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEndpointOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *CreateEndpointOutput) SetEndpoint(v *Endpoint) *CreateEndpointOutput { - s.Endpoint = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationInstanceMessage -type CreateReplicationInstanceInput struct { - _ struct{} `type:"structure"` - - // The amount of storage (in gigabytes) to be initially allocated for the replication - // instance. - AllocatedStorage *int64 `type:"integer"` - - // Indicates that minor engine upgrades will be applied automatically to the - // replication instance during the maintenance window. - // - // Default: true - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The EC2 Availability Zone that the replication instance will be created in. - // - // Default: A random, system-chosen Availability Zone in the endpoint's region. - // - // Example: us-east-1d - AvailabilityZone *string `type:"string"` - - // The engine version number of the replication instance. - EngineVersion *string `type:"string"` - - // The KMS key identifier that will be used to encrypt the content on the replication - // instance. If you do not specify a value for the KmsKeyId parameter, then - // AWS DMS will use your default encryption key. AWS KMS creates the default - // encryption key for your AWS account. Your AWS account has a different default - // encryption key for each AWS region. - KmsKeyId *string `type:"string"` - - // Specifies if the replication instance is a Multi-AZ deployment. You cannot - // set the AvailabilityZone parameter if the Multi-AZ parameter is set to true. - MultiAZ *bool `type:"boolean"` - - // The weekly time range during which system maintenance can occur, in Universal - // Coordinated Time (UTC). - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region, occurring on a random day of the week. - // - // Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `type:"string"` - - // Specifies the accessibility options for the replication instance. A value - // of true represents an instance with a public IP address. A value of false - // represents an instance with a private IP address. The default value is true. - PubliclyAccessible *bool `type:"boolean"` - - // The compute and memory capacity of the replication instance as specified - // by the replication instance class. - // - // Valid Values: dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large - // | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge - // - // ReplicationInstanceClass is a required field - ReplicationInstanceClass *string `type:"string" required:"true"` - - // The replication instance identifier. This parameter is stored as a lowercase - // string. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: myrepinstance - // - // ReplicationInstanceIdentifier is a required field - ReplicationInstanceIdentifier *string `type:"string" required:"true"` - - // A subnet group to associate with the replication instance. - ReplicationSubnetGroupIdentifier *string `type:"string"` - - // Tags to be associated with the replication instance. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // Specifies the VPC security group to be used with the replication instance. - // The VPC security group must work with the VPC containing the replication - // instance. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s CreateReplicationInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicationInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReplicationInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReplicationInstanceInput"} - if s.ReplicationInstanceClass == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationInstanceClass")) - } - if s.ReplicationInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationInstanceIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *CreateReplicationInstanceInput) SetAllocatedStorage(v int64) *CreateReplicationInstanceInput { - s.AllocatedStorage = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *CreateReplicationInstanceInput) SetAutoMinorVersionUpgrade(v bool) *CreateReplicationInstanceInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateReplicationInstanceInput) SetAvailabilityZone(v string) *CreateReplicationInstanceInput { - s.AvailabilityZone = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *CreateReplicationInstanceInput) SetEngineVersion(v string) *CreateReplicationInstanceInput { - s.EngineVersion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateReplicationInstanceInput) SetKmsKeyId(v string) *CreateReplicationInstanceInput { - s.KmsKeyId = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *CreateReplicationInstanceInput) SetMultiAZ(v bool) *CreateReplicationInstanceInput { - s.MultiAZ = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CreateReplicationInstanceInput) SetPreferredMaintenanceWindow(v string) *CreateReplicationInstanceInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *CreateReplicationInstanceInput) SetPubliclyAccessible(v bool) *CreateReplicationInstanceInput { - s.PubliclyAccessible = &v - return s -} - -// SetReplicationInstanceClass sets the ReplicationInstanceClass field's value. -func (s *CreateReplicationInstanceInput) SetReplicationInstanceClass(v string) *CreateReplicationInstanceInput { - s.ReplicationInstanceClass = &v - return s -} - -// SetReplicationInstanceIdentifier sets the ReplicationInstanceIdentifier field's value. -func (s *CreateReplicationInstanceInput) SetReplicationInstanceIdentifier(v string) *CreateReplicationInstanceInput { - s.ReplicationInstanceIdentifier = &v - return s -} - -// SetReplicationSubnetGroupIdentifier sets the ReplicationSubnetGroupIdentifier field's value. -func (s *CreateReplicationInstanceInput) SetReplicationSubnetGroupIdentifier(v string) *CreateReplicationInstanceInput { - s.ReplicationSubnetGroupIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateReplicationInstanceInput) SetTags(v []*Tag) *CreateReplicationInstanceInput { - s.Tags = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *CreateReplicationInstanceInput) SetVpcSecurityGroupIds(v []*string) *CreateReplicationInstanceInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationInstanceResponse -type CreateReplicationInstanceOutput struct { - _ struct{} `type:"structure"` - - // The replication instance that was created. - ReplicationInstance *ReplicationInstance `type:"structure"` -} - -// String returns the string representation -func (s CreateReplicationInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicationInstanceOutput) GoString() string { - return s.String() -} - -// SetReplicationInstance sets the ReplicationInstance field's value. -func (s *CreateReplicationInstanceOutput) SetReplicationInstance(v *ReplicationInstance) *CreateReplicationInstanceOutput { - s.ReplicationInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationSubnetGroupMessage -type CreateReplicationSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The description for the subnet group. - // - // ReplicationSubnetGroupDescription is a required field - ReplicationSubnetGroupDescription *string `type:"string" required:"true"` - - // The name for the replication subnet group. This value is stored as a lowercase - // string. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // spaces, underscores, or hyphens. Must not be "default". - // - // Example: mySubnetgroup - // - // ReplicationSubnetGroupIdentifier is a required field - ReplicationSubnetGroupIdentifier *string `type:"string" required:"true"` - - // The EC2 subnet IDs for the subnet group. - // - // SubnetIds is a required field - SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` - - // The tag to be assigned to the subnet group. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateReplicationSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicationSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReplicationSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReplicationSubnetGroupInput"} - if s.ReplicationSubnetGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationSubnetGroupDescription")) - } - if s.ReplicationSubnetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationSubnetGroupIdentifier")) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReplicationSubnetGroupDescription sets the ReplicationSubnetGroupDescription field's value. -func (s *CreateReplicationSubnetGroupInput) SetReplicationSubnetGroupDescription(v string) *CreateReplicationSubnetGroupInput { - s.ReplicationSubnetGroupDescription = &v - return s -} - -// SetReplicationSubnetGroupIdentifier sets the ReplicationSubnetGroupIdentifier field's value. -func (s *CreateReplicationSubnetGroupInput) SetReplicationSubnetGroupIdentifier(v string) *CreateReplicationSubnetGroupInput { - s.ReplicationSubnetGroupIdentifier = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateReplicationSubnetGroupInput) SetSubnetIds(v []*string) *CreateReplicationSubnetGroupInput { - s.SubnetIds = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateReplicationSubnetGroupInput) SetTags(v []*Tag) *CreateReplicationSubnetGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationSubnetGroupResponse -type CreateReplicationSubnetGroupOutput struct { - _ struct{} `type:"structure"` - - // The replication subnet group that was created. - ReplicationSubnetGroup *ReplicationSubnetGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateReplicationSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicationSubnetGroupOutput) GoString() string { - return s.String() -} - -// SetReplicationSubnetGroup sets the ReplicationSubnetGroup field's value. -func (s *CreateReplicationSubnetGroupOutput) SetReplicationSubnetGroup(v *ReplicationSubnetGroup) *CreateReplicationSubnetGroupOutput { - s.ReplicationSubnetGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationTaskMessage -type CreateReplicationTaskInput struct { - _ struct{} `type:"structure"` - - // The start time for the Change Data Capture (CDC) operation. - CdcStartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The migration type. - // - // MigrationType is a required field - MigrationType *string `type:"string" required:"true" enum:"MigrationTypeValue"` - - // The Amazon Resource Name (ARN) of the replication instance. - // - // ReplicationInstanceArn is a required field - ReplicationInstanceArn *string `type:"string" required:"true"` - - // The replication task identifier. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // ReplicationTaskIdentifier is a required field - ReplicationTaskIdentifier *string `type:"string" required:"true"` - - // Settings for the task, such as target metadata settings. For a complete list - // of task settings, see Task Settings for AWS Database Migration Service Tasks - // (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html). - ReplicationTaskSettings *string `type:"string"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // SourceEndpointArn is a required field - SourceEndpointArn *string `type:"string" required:"true"` - - // The path of the JSON file that contains the table mappings. Preceed the path - // with "file://". - // - // For example, --table-mappings file://mappingfile.json - // - // TableMappings is a required field - TableMappings *string `type:"string" required:"true"` - - // Tags to be added to the replication instance. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // TargetEndpointArn is a required field - TargetEndpointArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateReplicationTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicationTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReplicationTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReplicationTaskInput"} - if s.MigrationType == nil { - invalidParams.Add(request.NewErrParamRequired("MigrationType")) - } - if s.ReplicationInstanceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationInstanceArn")) - } - if s.ReplicationTaskIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationTaskIdentifier")) - } - if s.SourceEndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("SourceEndpointArn")) - } - if s.TableMappings == nil { - invalidParams.Add(request.NewErrParamRequired("TableMappings")) - } - if s.TargetEndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetEndpointArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCdcStartTime sets the CdcStartTime field's value. -func (s *CreateReplicationTaskInput) SetCdcStartTime(v time.Time) *CreateReplicationTaskInput { - s.CdcStartTime = &v - return s -} - -// SetMigrationType sets the MigrationType field's value. -func (s *CreateReplicationTaskInput) SetMigrationType(v string) *CreateReplicationTaskInput { - s.MigrationType = &v - return s -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *CreateReplicationTaskInput) SetReplicationInstanceArn(v string) *CreateReplicationTaskInput { - s.ReplicationInstanceArn = &v - return s -} - -// SetReplicationTaskIdentifier sets the ReplicationTaskIdentifier field's value. -func (s *CreateReplicationTaskInput) SetReplicationTaskIdentifier(v string) *CreateReplicationTaskInput { - s.ReplicationTaskIdentifier = &v - return s -} - -// SetReplicationTaskSettings sets the ReplicationTaskSettings field's value. -func (s *CreateReplicationTaskInput) SetReplicationTaskSettings(v string) *CreateReplicationTaskInput { - s.ReplicationTaskSettings = &v - return s -} - -// SetSourceEndpointArn sets the SourceEndpointArn field's value. -func (s *CreateReplicationTaskInput) SetSourceEndpointArn(v string) *CreateReplicationTaskInput { - s.SourceEndpointArn = &v - return s -} - -// SetTableMappings sets the TableMappings field's value. -func (s *CreateReplicationTaskInput) SetTableMappings(v string) *CreateReplicationTaskInput { - s.TableMappings = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateReplicationTaskInput) SetTags(v []*Tag) *CreateReplicationTaskInput { - s.Tags = v - return s -} - -// SetTargetEndpointArn sets the TargetEndpointArn field's value. -func (s *CreateReplicationTaskInput) SetTargetEndpointArn(v string) *CreateReplicationTaskInput { - s.TargetEndpointArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationTaskResponse -type CreateReplicationTaskOutput struct { - _ struct{} `type:"structure"` - - // The replication task that was created. - ReplicationTask *ReplicationTask `type:"structure"` -} - -// String returns the string representation -func (s CreateReplicationTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicationTaskOutput) GoString() string { - return s.String() -} - -// SetReplicationTask sets the ReplicationTask field's value. -func (s *CreateReplicationTaskOutput) SetReplicationTask(v *ReplicationTask) *CreateReplicationTaskOutput { - s.ReplicationTask = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteCertificateMessage -type DeleteCertificateInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the deleted certificate. - // - // CertificateArn is a required field - CertificateArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCertificateInput"} - if s.CertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *DeleteCertificateInput) SetCertificateArn(v string) *DeleteCertificateInput { - s.CertificateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteCertificateResponse -type DeleteCertificateOutput struct { - _ struct{} `type:"structure"` - - // The Secure Sockets Layer (SSL) certificate. - Certificate *Certificate `type:"structure"` -} - -// String returns the string representation -func (s DeleteCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCertificateOutput) GoString() string { - return s.String() -} - -// SetCertificate sets the Certificate field's value. -func (s *DeleteCertificateOutput) SetCertificate(v *Certificate) *DeleteCertificateOutput { - s.Certificate = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteEndpointMessage -type DeleteEndpointInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointInput"} - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *DeleteEndpointInput) SetEndpointArn(v string) *DeleteEndpointInput { - s.EndpointArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteEndpointResponse -type DeleteEndpointOutput struct { - _ struct{} `type:"structure"` - - // The endpoint that was deleted. - Endpoint *Endpoint `type:"structure"` -} - -// String returns the string representation -func (s DeleteEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEndpointOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *DeleteEndpointOutput) SetEndpoint(v *Endpoint) *DeleteEndpointOutput { - s.Endpoint = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationInstanceMessage -type DeleteReplicationInstanceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the replication instance to be deleted. - // - // ReplicationInstanceArn is a required field - ReplicationInstanceArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteReplicationInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicationInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReplicationInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReplicationInstanceInput"} - if s.ReplicationInstanceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationInstanceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *DeleteReplicationInstanceInput) SetReplicationInstanceArn(v string) *DeleteReplicationInstanceInput { - s.ReplicationInstanceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationInstanceResponse -type DeleteReplicationInstanceOutput struct { - _ struct{} `type:"structure"` - - // The replication instance that was deleted. - ReplicationInstance *ReplicationInstance `type:"structure"` -} - -// String returns the string representation -func (s DeleteReplicationInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicationInstanceOutput) GoString() string { - return s.String() -} - -// SetReplicationInstance sets the ReplicationInstance field's value. -func (s *DeleteReplicationInstanceOutput) SetReplicationInstance(v *ReplicationInstance) *DeleteReplicationInstanceOutput { - s.ReplicationInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationSubnetGroupMessage -type DeleteReplicationSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The subnet group name of the replication instance. - // - // ReplicationSubnetGroupIdentifier is a required field - ReplicationSubnetGroupIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteReplicationSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicationSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReplicationSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReplicationSubnetGroupInput"} - if s.ReplicationSubnetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationSubnetGroupIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReplicationSubnetGroupIdentifier sets the ReplicationSubnetGroupIdentifier field's value. -func (s *DeleteReplicationSubnetGroupInput) SetReplicationSubnetGroupIdentifier(v string) *DeleteReplicationSubnetGroupInput { - s.ReplicationSubnetGroupIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationSubnetGroupResponse -type DeleteReplicationSubnetGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteReplicationSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicationSubnetGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationTaskMessage -type DeleteReplicationTaskInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the replication task to be deleted. - // - // ReplicationTaskArn is a required field - ReplicationTaskArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteReplicationTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicationTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReplicationTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReplicationTaskInput"} - if s.ReplicationTaskArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationTaskArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReplicationTaskArn sets the ReplicationTaskArn field's value. -func (s *DeleteReplicationTaskInput) SetReplicationTaskArn(v string) *DeleteReplicationTaskInput { - s.ReplicationTaskArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationTaskResponse -type DeleteReplicationTaskOutput struct { - _ struct{} `type:"structure"` - - // The deleted replication task. - ReplicationTask *ReplicationTask `type:"structure"` -} - -// String returns the string representation -func (s DeleteReplicationTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicationTaskOutput) GoString() string { - return s.String() -} - -// SetReplicationTask sets the ReplicationTask field's value. -func (s *DeleteReplicationTaskOutput) SetReplicationTask(v *ReplicationTask) *DeleteReplicationTaskOutput { - s.ReplicationTask = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeAccountAttributesMessage -type DescribeAccountAttributesInput struct { - _ struct{} `type:"structure"` -} - -// 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() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeAccountAttributesResponse -type DescribeAccountAttributesOutput struct { - _ struct{} `type:"structure"` - - // Account quota information. - AccountQuotas []*AccountQuota `locationNameList:"AccountQuota" 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() -} - -// SetAccountQuotas sets the AccountQuotas field's value. -func (s *DescribeAccountAttributesOutput) SetAccountQuotas(v []*AccountQuota) *DescribeAccountAttributesOutput { - s.AccountQuotas = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeCertificatesMessage -type DescribeCertificatesInput struct { - _ struct{} `type:"structure"` - - // Filters applied to the certificate described in the form of key-value pairs. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 10 - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeCertificatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCertificatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCertificatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCertificatesInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeCertificatesInput) SetFilters(v []*Filter) *DescribeCertificatesInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCertificatesInput) SetMarker(v string) *DescribeCertificatesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeCertificatesInput) SetMaxRecords(v int64) *DescribeCertificatesInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeCertificatesResponse -type DescribeCertificatesOutput struct { - _ struct{} `type:"structure"` - - // The Secure Sockets Layer (SSL) certificates associated with the replication - // instance. - Certificates []*Certificate `locationNameList:"Certificate" type:"list"` - - // The pagination token. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCertificatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCertificatesOutput) GoString() string { - return s.String() -} - -// SetCertificates sets the Certificates field's value. -func (s *DescribeCertificatesOutput) SetCertificates(v []*Certificate) *DescribeCertificatesOutput { - s.Certificates = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCertificatesOutput) SetMarker(v string) *DescribeCertificatesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeConnectionsMessage -type DescribeConnectionsInput struct { - _ struct{} `type:"structure"` - - // The filters applied to the connection. - // - // Valid filter names: endpoint-arn | replication-instance-arn - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConnectionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeConnectionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeConnectionsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeConnectionsInput) SetFilters(v []*Filter) *DescribeConnectionsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeConnectionsInput) SetMarker(v string) *DescribeConnectionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeConnectionsInput) SetMaxRecords(v int64) *DescribeConnectionsInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeConnectionsResponse -type DescribeConnectionsOutput struct { - _ struct{} `type:"structure"` - - // A description of the connections. - Connections []*Connection `locationNameList:"Connection" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConnectionsOutput) GoString() string { - return s.String() -} - -// SetConnections sets the Connections field's value. -func (s *DescribeConnectionsOutput) SetConnections(v []*Connection) *DescribeConnectionsOutput { - s.Connections = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeConnectionsOutput) SetMarker(v string) *DescribeConnectionsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpointTypesMessage -type DescribeEndpointTypesInput struct { - _ struct{} `type:"structure"` - - // Filters applied to the describe action. - // - // Valid filter names: engine-name | endpoint-type - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeEndpointTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEndpointTypesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEndpointTypesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEndpointTypesInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeEndpointTypesInput) SetFilters(v []*Filter) *DescribeEndpointTypesInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEndpointTypesInput) SetMarker(v string) *DescribeEndpointTypesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEndpointTypesInput) SetMaxRecords(v int64) *DescribeEndpointTypesInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpointTypesResponse -type DescribeEndpointTypesOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The type of endpoints that are supported. - SupportedEndpointTypes []*SupportedEndpointType `locationNameList:"SupportedEndpointType" type:"list"` -} - -// String returns the string representation -func (s DescribeEndpointTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEndpointTypesOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEndpointTypesOutput) SetMarker(v string) *DescribeEndpointTypesOutput { - s.Marker = &v - return s -} - -// SetSupportedEndpointTypes sets the SupportedEndpointTypes field's value. -func (s *DescribeEndpointTypesOutput) SetSupportedEndpointTypes(v []*SupportedEndpointType) *DescribeEndpointTypesOutput { - s.SupportedEndpointTypes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpointsMessage -type DescribeEndpointsInput struct { - _ struct{} `type:"structure"` - - // Filters applied to the describe action. - // - // Valid filter names: endpoint-arn | endpoint-type | endpoint-id | engine-name - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeEndpointsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEndpointsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEndpointsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeEndpointsInput) SetFilters(v []*Filter) *DescribeEndpointsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEndpointsInput) SetMarker(v string) *DescribeEndpointsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEndpointsInput) SetMaxRecords(v int64) *DescribeEndpointsInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpointsResponse -type DescribeEndpointsOutput struct { - _ struct{} `type:"structure"` - - // Endpoint description. - Endpoints []*Endpoint `locationNameList:"Endpoint" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEndpointsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEndpointsOutput) GoString() string { - return s.String() -} - -// SetEndpoints sets the Endpoints field's value. -func (s *DescribeEndpointsOutput) SetEndpoints(v []*Endpoint) *DescribeEndpointsOutput { - s.Endpoints = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEndpointsOutput) SetMarker(v string) *DescribeEndpointsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeOrderableReplicationInstancesMessage -type DescribeOrderableReplicationInstancesInput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeOrderableReplicationInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOrderableReplicationInstancesInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOrderableReplicationInstancesInput) SetMarker(v string) *DescribeOrderableReplicationInstancesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeOrderableReplicationInstancesInput) SetMaxRecords(v int64) *DescribeOrderableReplicationInstancesInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeOrderableReplicationInstancesResponse -type DescribeOrderableReplicationInstancesOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The order-able replication instances available. - OrderableReplicationInstances []*OrderableReplicationInstance `locationNameList:"OrderableReplicationInstance" type:"list"` -} - -// String returns the string representation -func (s DescribeOrderableReplicationInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOrderableReplicationInstancesOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOrderableReplicationInstancesOutput) SetMarker(v string) *DescribeOrderableReplicationInstancesOutput { - s.Marker = &v - return s -} - -// SetOrderableReplicationInstances sets the OrderableReplicationInstances field's value. -func (s *DescribeOrderableReplicationInstancesOutput) SetOrderableReplicationInstances(v []*OrderableReplicationInstance) *DescribeOrderableReplicationInstancesOutput { - s.OrderableReplicationInstances = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeRefreshSchemasStatusMessage -type DescribeRefreshSchemasStatusInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeRefreshSchemasStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRefreshSchemasStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRefreshSchemasStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRefreshSchemasStatusInput"} - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *DescribeRefreshSchemasStatusInput) SetEndpointArn(v string) *DescribeRefreshSchemasStatusInput { - s.EndpointArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeRefreshSchemasStatusResponse -type DescribeRefreshSchemasStatusOutput struct { - _ struct{} `type:"structure"` - - // The status of the schema. - RefreshSchemasStatus *RefreshSchemasStatus `type:"structure"` -} - -// String returns the string representation -func (s DescribeRefreshSchemasStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRefreshSchemasStatusOutput) GoString() string { - return s.String() -} - -// SetRefreshSchemasStatus sets the RefreshSchemasStatus field's value. -func (s *DescribeRefreshSchemasStatusOutput) SetRefreshSchemasStatus(v *RefreshSchemasStatus) *DescribeRefreshSchemasStatusOutput { - s.RefreshSchemasStatus = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationInstancesMessage -type DescribeReplicationInstancesInput struct { - _ struct{} `type:"structure"` - - // Filters applied to the describe action. - // - // Valid filter names: replication-instance-arn | replication-instance-id | - // replication-instance-class | engine-version - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeReplicationInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReplicationInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeReplicationInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeReplicationInstancesInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReplicationInstancesInput) SetFilters(v []*Filter) *DescribeReplicationInstancesInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReplicationInstancesInput) SetMarker(v string) *DescribeReplicationInstancesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReplicationInstancesInput) SetMaxRecords(v int64) *DescribeReplicationInstancesInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationInstancesResponse -type DescribeReplicationInstancesOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The replication instances described. - ReplicationInstances []*ReplicationInstance `locationNameList:"ReplicationInstance" type:"list"` -} - -// String returns the string representation -func (s DescribeReplicationInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReplicationInstancesOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReplicationInstancesOutput) SetMarker(v string) *DescribeReplicationInstancesOutput { - s.Marker = &v - return s -} - -// SetReplicationInstances sets the ReplicationInstances field's value. -func (s *DescribeReplicationInstancesOutput) SetReplicationInstances(v []*ReplicationInstance) *DescribeReplicationInstancesOutput { - s.ReplicationInstances = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationSubnetGroupsMessage -type DescribeReplicationSubnetGroupsInput struct { - _ struct{} `type:"structure"` - - // Filters applied to the describe action. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeReplicationSubnetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReplicationSubnetGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeReplicationSubnetGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeReplicationSubnetGroupsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReplicationSubnetGroupsInput) SetFilters(v []*Filter) *DescribeReplicationSubnetGroupsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReplicationSubnetGroupsInput) SetMarker(v string) *DescribeReplicationSubnetGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReplicationSubnetGroupsInput) SetMaxRecords(v int64) *DescribeReplicationSubnetGroupsInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationSubnetGroupsResponse -type DescribeReplicationSubnetGroupsOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // A description of the replication subnet groups. - ReplicationSubnetGroups []*ReplicationSubnetGroup `locationNameList:"ReplicationSubnetGroup" type:"list"` -} - -// String returns the string representation -func (s DescribeReplicationSubnetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReplicationSubnetGroupsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReplicationSubnetGroupsOutput) SetMarker(v string) *DescribeReplicationSubnetGroupsOutput { - s.Marker = &v - return s -} - -// SetReplicationSubnetGroups sets the ReplicationSubnetGroups field's value. -func (s *DescribeReplicationSubnetGroupsOutput) SetReplicationSubnetGroups(v []*ReplicationSubnetGroup) *DescribeReplicationSubnetGroupsOutput { - s.ReplicationSubnetGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationTasksMessage -type DescribeReplicationTasksInput struct { - _ struct{} `type:"structure"` - - // Filters applied to the describe action. - // - // Valid filter names: replication-task-arn | replication-task-id | migration-type - // | endpoint-arn | replication-instance-arn - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeReplicationTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReplicationTasksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeReplicationTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeReplicationTasksInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReplicationTasksInput) SetFilters(v []*Filter) *DescribeReplicationTasksInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReplicationTasksInput) SetMarker(v string) *DescribeReplicationTasksInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReplicationTasksInput) SetMaxRecords(v int64) *DescribeReplicationTasksInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationTasksResponse -type DescribeReplicationTasksOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // A description of the replication tasks. - ReplicationTasks []*ReplicationTask `locationNameList:"ReplicationTask" type:"list"` -} - -// String returns the string representation -func (s DescribeReplicationTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReplicationTasksOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReplicationTasksOutput) SetMarker(v string) *DescribeReplicationTasksOutput { - s.Marker = &v - return s -} - -// SetReplicationTasks sets the ReplicationTasks field's value. -func (s *DescribeReplicationTasksOutput) SetReplicationTasks(v []*ReplicationTask) *DescribeReplicationTasksOutput { - s.ReplicationTasks = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeSchemasMessage -type DescribeSchemasInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeSchemasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSchemasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSchemasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSchemasInput"} - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *DescribeSchemasInput) SetEndpointArn(v string) *DescribeSchemasInput { - s.EndpointArn = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSchemasInput) SetMarker(v string) *DescribeSchemasInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeSchemasInput) SetMaxRecords(v int64) *DescribeSchemasInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeSchemasResponse -type DescribeSchemasOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The described schema. - Schemas []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeSchemasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSchemasOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSchemasOutput) SetMarker(v string) *DescribeSchemasOutput { - s.Marker = &v - return s -} - -// SetSchemas sets the Schemas field's value. -func (s *DescribeSchemasOutput) SetSchemas(v []*string) *DescribeSchemasOutput { - s.Schemas = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeTableStatisticsMessage -type DescribeTableStatisticsInput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The Amazon Resource Name (ARN) of the replication task. - // - // ReplicationTaskArn is a required field - ReplicationTaskArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeTableStatisticsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTableStatisticsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTableStatisticsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTableStatisticsInput"} - if s.ReplicationTaskArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationTaskArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTableStatisticsInput) SetMarker(v string) *DescribeTableStatisticsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeTableStatisticsInput) SetMaxRecords(v int64) *DescribeTableStatisticsInput { - s.MaxRecords = &v - return s -} - -// SetReplicationTaskArn sets the ReplicationTaskArn field's value. -func (s *DescribeTableStatisticsInput) SetReplicationTaskArn(v string) *DescribeTableStatisticsInput { - s.ReplicationTaskArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeTableStatisticsResponse -type DescribeTableStatisticsOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The Amazon Resource Name (ARN) of the replication task. - ReplicationTaskArn *string `type:"string"` - - // The table statistics. - TableStatistics []*TableStatistics `type:"list"` -} - -// String returns the string representation -func (s DescribeTableStatisticsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTableStatisticsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTableStatisticsOutput) SetMarker(v string) *DescribeTableStatisticsOutput { - s.Marker = &v - return s -} - -// SetReplicationTaskArn sets the ReplicationTaskArn field's value. -func (s *DescribeTableStatisticsOutput) SetReplicationTaskArn(v string) *DescribeTableStatisticsOutput { - s.ReplicationTaskArn = &v - return s -} - -// SetTableStatistics sets the TableStatistics field's value. -func (s *DescribeTableStatisticsOutput) SetTableStatistics(v []*TableStatistics) *DescribeTableStatisticsOutput { - s.TableStatistics = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/Endpoint -type Endpoint struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) used for SSL connection to the endpoint. - CertificateArn *string `type:"string"` - - // The name of the database at the endpoint. - DatabaseName *string `type:"string"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - EndpointArn *string `type:"string"` - - // The database endpoint identifier. Identifiers must begin with a letter; must - // contain only ASCII letters, digits, and hyphens; and must not end with a - // hyphen or contain two consecutive hyphens. - EndpointIdentifier *string `type:"string"` - - // The type of endpoint. - EndpointType *string `type:"string" enum:"ReplicationEndpointTypeValue"` - - // The database engine name. Valid values include MYSQL, ORACLE, POSTGRES, MARIADB, - // AURORA, REDSHIFT, SYBASE, and SQLSERVER. - EngineName *string `type:"string"` - - // Additional connection attributes used to connect to the endpoint. - ExtraConnectionAttributes *string `type:"string"` - - // The KMS key identifier that will be used to encrypt the connection parameters. - // If you do not specify a value for the KmsKeyId parameter, then AWS DMS will - // use your default encryption key. AWS KMS creates the default encryption key - // for your AWS account. Your AWS account has a different default encryption - // key for each AWS region. - KmsKeyId *string `type:"string"` - - // The port value used to access the endpoint. - Port *int64 `type:"integer"` - - // The name of the server at the endpoint. - ServerName *string `type:"string"` - - // The SSL mode used to connect to the endpoint. - // - // SSL mode can be one of four values: none, require, verify-ca, verify-full. - // - // The default value is none. - SslMode *string `type:"string" enum:"DmsSslModeValue"` - - // The status of the endpoint. - Status *string `type:"string"` - - // The user name used to connect to the endpoint. - Username *string `type:"string"` -} - -// String returns the string representation -func (s Endpoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Endpoint) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *Endpoint) SetCertificateArn(v string) *Endpoint { - s.CertificateArn = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *Endpoint) SetDatabaseName(v string) *Endpoint { - s.DatabaseName = &v - return s -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *Endpoint) SetEndpointArn(v string) *Endpoint { - s.EndpointArn = &v - return s -} - -// SetEndpointIdentifier sets the EndpointIdentifier field's value. -func (s *Endpoint) SetEndpointIdentifier(v string) *Endpoint { - s.EndpointIdentifier = &v - return s -} - -// SetEndpointType sets the EndpointType field's value. -func (s *Endpoint) SetEndpointType(v string) *Endpoint { - s.EndpointType = &v - return s -} - -// SetEngineName sets the EngineName field's value. -func (s *Endpoint) SetEngineName(v string) *Endpoint { - s.EngineName = &v - return s -} - -// SetExtraConnectionAttributes sets the ExtraConnectionAttributes field's value. -func (s *Endpoint) SetExtraConnectionAttributes(v string) *Endpoint { - s.ExtraConnectionAttributes = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Endpoint) SetKmsKeyId(v string) *Endpoint { - s.KmsKeyId = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Endpoint) SetPort(v int64) *Endpoint { - s.Port = &v - return s -} - -// SetServerName sets the ServerName field's value. -func (s *Endpoint) SetServerName(v string) *Endpoint { - s.ServerName = &v - return s -} - -// SetSslMode sets the SslMode field's value. -func (s *Endpoint) SetSslMode(v string) *Endpoint { - s.SslMode = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Endpoint) SetStatus(v string) *Endpoint { - s.Status = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *Endpoint) SetUsername(v string) *Endpoint { - s.Username = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/Filter -type Filter struct { - _ struct{} `type:"structure"` - - // The name of the filter. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The filter value. - // - // Values is a required field - Values []*string `locationNameList:"Value" type:"list" required:"true"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Filter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Filter"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// 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 -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ImportCertificateMessage -type ImportCertificateInput struct { - _ struct{} `type:"structure"` - - // The customer-assigned name of the certificate. Valid characters are A-z and - // 0-9. - // - // CertificateIdentifier is a required field - CertificateIdentifier *string `type:"string" required:"true"` - - // The contents of the .pem X.509 certificate file for the certificate. - CertificatePem *string `type:"string"` - - // The location of the imported Oracle Wallet certificate for use with SSL. - // - // CertificateWallet is automatically base64 encoded/decoded by the SDK. - CertificateWallet []byte `type:"blob"` -} - -// String returns the string representation -func (s ImportCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportCertificateInput"} - if s.CertificateIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateIdentifier sets the CertificateIdentifier field's value. -func (s *ImportCertificateInput) SetCertificateIdentifier(v string) *ImportCertificateInput { - s.CertificateIdentifier = &v - return s -} - -// SetCertificatePem sets the CertificatePem field's value. -func (s *ImportCertificateInput) SetCertificatePem(v string) *ImportCertificateInput { - s.CertificatePem = &v - return s -} - -// SetCertificateWallet sets the CertificateWallet field's value. -func (s *ImportCertificateInput) SetCertificateWallet(v []byte) *ImportCertificateInput { - s.CertificateWallet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ImportCertificateResponse -type ImportCertificateOutput struct { - _ struct{} `type:"structure"` - - // The certificate to be uploaded. - Certificate *Certificate `type:"structure"` -} - -// String returns the string representation -func (s ImportCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportCertificateOutput) GoString() string { - return s.String() -} - -// SetCertificate sets the Certificate field's value. -func (s *ImportCertificateOutput) SetCertificate(v *Certificate) *ImportCertificateOutput { - s.Certificate = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ListTagsForResourceMessage -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the AWS DMS - // resource. - // - // ResourceArn is a required field - ResourceArn *string `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.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ListTagsForResourceResponse -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of tags for the resource. - TagList []*Tag `locationNameList:"Tag" type:"list"` -} - -// 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() -} - -// SetTagList sets the TagList field's value. -func (s *ListTagsForResourceOutput) SetTagList(v []*Tag) *ListTagsForResourceOutput { - s.TagList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyEndpointMessage -type ModifyEndpointInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the certificate used for SSL connection. - CertificateArn *string `type:"string"` - - // The name of the endpoint database. - DatabaseName *string `type:"string"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` - - // The database endpoint identifier. Identifiers must begin with a letter; must - // contain only ASCII letters, digits, and hyphens; and must not end with a - // hyphen or contain two consecutive hyphens. - EndpointIdentifier *string `type:"string"` - - // The type of endpoint. - EndpointType *string `type:"string" enum:"ReplicationEndpointTypeValue"` - - // The type of engine for the endpoint. Valid values include MYSQL, ORACLE, - // POSTGRES, MARIADB, AURORA, REDSHIFT, SYBASE, and SQLSERVER. - EngineName *string `type:"string"` - - // Additional attributes associated with the connection. - ExtraConnectionAttributes *string `type:"string"` - - // The password to be used to login to the endpoint database. - Password *string `type:"string"` - - // The port used by the endpoint database. - Port *int64 `type:"integer"` - - // The name of the server where the endpoint database resides. - ServerName *string `type:"string"` - - // The SSL mode to be used. - // - // SSL mode can be one of four values: none, require, verify-ca, verify-full. - // - // The default value is none. - SslMode *string `type:"string" enum:"DmsSslModeValue"` - - // The user name to be used to login to the endpoint database. - Username *string `type:"string"` -} - -// String returns the string representation -func (s ModifyEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyEndpointInput"} - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *ModifyEndpointInput) SetCertificateArn(v string) *ModifyEndpointInput { - s.CertificateArn = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *ModifyEndpointInput) SetDatabaseName(v string) *ModifyEndpointInput { - s.DatabaseName = &v - return s -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *ModifyEndpointInput) SetEndpointArn(v string) *ModifyEndpointInput { - s.EndpointArn = &v - return s -} - -// SetEndpointIdentifier sets the EndpointIdentifier field's value. -func (s *ModifyEndpointInput) SetEndpointIdentifier(v string) *ModifyEndpointInput { - s.EndpointIdentifier = &v - return s -} - -// SetEndpointType sets the EndpointType field's value. -func (s *ModifyEndpointInput) SetEndpointType(v string) *ModifyEndpointInput { - s.EndpointType = &v - return s -} - -// SetEngineName sets the EngineName field's value. -func (s *ModifyEndpointInput) SetEngineName(v string) *ModifyEndpointInput { - s.EngineName = &v - return s -} - -// SetExtraConnectionAttributes sets the ExtraConnectionAttributes field's value. -func (s *ModifyEndpointInput) SetExtraConnectionAttributes(v string) *ModifyEndpointInput { - s.ExtraConnectionAttributes = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *ModifyEndpointInput) SetPassword(v string) *ModifyEndpointInput { - s.Password = &v - return s -} - -// SetPort sets the Port field's value. -func (s *ModifyEndpointInput) SetPort(v int64) *ModifyEndpointInput { - s.Port = &v - return s -} - -// SetServerName sets the ServerName field's value. -func (s *ModifyEndpointInput) SetServerName(v string) *ModifyEndpointInput { - s.ServerName = &v - return s -} - -// SetSslMode sets the SslMode field's value. -func (s *ModifyEndpointInput) SetSslMode(v string) *ModifyEndpointInput { - s.SslMode = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *ModifyEndpointInput) SetUsername(v string) *ModifyEndpointInput { - s.Username = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyEndpointResponse -type ModifyEndpointOutput struct { - _ struct{} `type:"structure"` - - // The modified endpoint. - Endpoint *Endpoint `type:"structure"` -} - -// String returns the string representation -func (s ModifyEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyEndpointOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *ModifyEndpointOutput) SetEndpoint(v *Endpoint) *ModifyEndpointOutput { - s.Endpoint = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationInstanceMessage -type ModifyReplicationInstanceInput struct { - _ struct{} `type:"structure"` - - // The amount of storage (in gigabytes) to be allocated for the replication - // instance. - AllocatedStorage *int64 `type:"integer"` - - // Indicates that major version upgrades are allowed. Changing this parameter - // does not result in an outage and the change is asynchronously applied as - // soon as possible. - // - // Constraints: This parameter must be set to true when specifying a value for - // the EngineVersion parameter that is a different major version than the replication - // instance's current version. - AllowMajorVersionUpgrade *bool `type:"boolean"` - - // Indicates whether the changes should be applied immediately or during the - // next maintenance window. - ApplyImmediately *bool `type:"boolean"` - - // Indicates that minor version upgrades will be applied automatically to the - // replication instance during the maintenance window. Changing this parameter - // does not result in an outage except in the following case and the change - // is asynchronously applied as soon as possible. An outage will result if this - // parameter is set to true during the maintenance window, and a newer minor - // version is available, and AWS DMS has enabled auto patching for that engine - // version. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The engine version number of the replication instance. - EngineVersion *string `type:"string"` - - // Specifies if the replication instance is a Multi-AZ deployment. You cannot - // set the AvailabilityZone parameter if the Multi-AZ parameter is set to true. - MultiAZ *bool `type:"boolean"` - - // The weekly time range (in UTC) during which system maintenance can occur, - // which might result in an outage. Changing this parameter does not result - // in an outage, except in the following situation, and the change is asynchronously - // applied as soon as possible. If moving this window to the current time, there - // must be at least 30 minutes between the current time and end of the window - // to ensure pending changes are applied. - // - // Default: Uses existing setting - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun - // - // Constraints: Must be at least 30 minutes - PreferredMaintenanceWindow *string `type:"string"` - - // The Amazon Resource Name (ARN) of the replication instance. - // - // ReplicationInstanceArn is a required field - ReplicationInstanceArn *string `type:"string" required:"true"` - - // The compute and memory capacity of the replication instance. - // - // Valid Values: dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large - // | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge - ReplicationInstanceClass *string `type:"string"` - - // The replication instance identifier. This parameter is stored as a lowercase - // string. - ReplicationInstanceIdentifier *string `type:"string"` - - // Specifies the VPC security group to be used with the replication instance. - // The VPC security group must work with the VPC containing the replication - // instance. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s ModifyReplicationInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReplicationInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyReplicationInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyReplicationInstanceInput"} - if s.ReplicationInstanceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationInstanceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *ModifyReplicationInstanceInput) SetAllocatedStorage(v int64) *ModifyReplicationInstanceInput { - s.AllocatedStorage = &v - return s -} - -// SetAllowMajorVersionUpgrade sets the AllowMajorVersionUpgrade field's value. -func (s *ModifyReplicationInstanceInput) SetAllowMajorVersionUpgrade(v bool) *ModifyReplicationInstanceInput { - s.AllowMajorVersionUpgrade = &v - return s -} - -// SetApplyImmediately sets the ApplyImmediately field's value. -func (s *ModifyReplicationInstanceInput) SetApplyImmediately(v bool) *ModifyReplicationInstanceInput { - s.ApplyImmediately = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *ModifyReplicationInstanceInput) SetAutoMinorVersionUpgrade(v bool) *ModifyReplicationInstanceInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *ModifyReplicationInstanceInput) SetEngineVersion(v string) *ModifyReplicationInstanceInput { - s.EngineVersion = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *ModifyReplicationInstanceInput) SetMultiAZ(v bool) *ModifyReplicationInstanceInput { - s.MultiAZ = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *ModifyReplicationInstanceInput) SetPreferredMaintenanceWindow(v string) *ModifyReplicationInstanceInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *ModifyReplicationInstanceInput) SetReplicationInstanceArn(v string) *ModifyReplicationInstanceInput { - s.ReplicationInstanceArn = &v - return s -} - -// SetReplicationInstanceClass sets the ReplicationInstanceClass field's value. -func (s *ModifyReplicationInstanceInput) SetReplicationInstanceClass(v string) *ModifyReplicationInstanceInput { - s.ReplicationInstanceClass = &v - return s -} - -// SetReplicationInstanceIdentifier sets the ReplicationInstanceIdentifier field's value. -func (s *ModifyReplicationInstanceInput) SetReplicationInstanceIdentifier(v string) *ModifyReplicationInstanceInput { - s.ReplicationInstanceIdentifier = &v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *ModifyReplicationInstanceInput) SetVpcSecurityGroupIds(v []*string) *ModifyReplicationInstanceInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationInstanceResponse -type ModifyReplicationInstanceOutput struct { - _ struct{} `type:"structure"` - - // The modified replication instance. - ReplicationInstance *ReplicationInstance `type:"structure"` -} - -// String returns the string representation -func (s ModifyReplicationInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReplicationInstanceOutput) GoString() string { - return s.String() -} - -// SetReplicationInstance sets the ReplicationInstance field's value. -func (s *ModifyReplicationInstanceOutput) SetReplicationInstance(v *ReplicationInstance) *ModifyReplicationInstanceOutput { - s.ReplicationInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationSubnetGroupMessage -type ModifyReplicationSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The description of the replication instance subnet group. - ReplicationSubnetGroupDescription *string `type:"string"` - - // The name of the replication instance subnet group. - // - // ReplicationSubnetGroupIdentifier is a required field - ReplicationSubnetGroupIdentifier *string `type:"string" required:"true"` - - // A list of subnet IDs. - // - // SubnetIds is a required field - SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyReplicationSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReplicationSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyReplicationSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyReplicationSubnetGroupInput"} - if s.ReplicationSubnetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationSubnetGroupIdentifier")) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReplicationSubnetGroupDescription sets the ReplicationSubnetGroupDescription field's value. -func (s *ModifyReplicationSubnetGroupInput) SetReplicationSubnetGroupDescription(v string) *ModifyReplicationSubnetGroupInput { - s.ReplicationSubnetGroupDescription = &v - return s -} - -// SetReplicationSubnetGroupIdentifier sets the ReplicationSubnetGroupIdentifier field's value. -func (s *ModifyReplicationSubnetGroupInput) SetReplicationSubnetGroupIdentifier(v string) *ModifyReplicationSubnetGroupInput { - s.ReplicationSubnetGroupIdentifier = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *ModifyReplicationSubnetGroupInput) SetSubnetIds(v []*string) *ModifyReplicationSubnetGroupInput { - s.SubnetIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationSubnetGroupResponse -type ModifyReplicationSubnetGroupOutput struct { - _ struct{} `type:"structure"` - - // The modified replication subnet group. - ReplicationSubnetGroup *ReplicationSubnetGroup `type:"structure"` -} - -// String returns the string representation -func (s ModifyReplicationSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReplicationSubnetGroupOutput) GoString() string { - return s.String() -} - -// SetReplicationSubnetGroup sets the ReplicationSubnetGroup field's value. -func (s *ModifyReplicationSubnetGroupOutput) SetReplicationSubnetGroup(v *ReplicationSubnetGroup) *ModifyReplicationSubnetGroupOutput { - s.ReplicationSubnetGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationTaskMessage -type ModifyReplicationTaskInput struct { - _ struct{} `type:"structure"` - - // The start time for the Change Data Capture (CDC) operation. - CdcStartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The migration type. - // - // Valid values: full-load | cdc | full-load-and-cdc - MigrationType *string `type:"string" enum:"MigrationTypeValue"` - - // The Amazon Resource Name (ARN) of the replication task. - // - // ReplicationTaskArn is a required field - ReplicationTaskArn *string `type:"string" required:"true"` - - // The replication task identifier. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - ReplicationTaskIdentifier *string `type:"string"` - - // JSON file that contains settings for the task, such as target metadata settings. - ReplicationTaskSettings *string `type:"string"` - - // The path of the JSON file that contains the table mappings. Preceed the path - // with "file://". - // - // For example, --table-mappings file://mappingfile.json - TableMappings *string `type:"string"` -} - -// String returns the string representation -func (s ModifyReplicationTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReplicationTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyReplicationTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyReplicationTaskInput"} - if s.ReplicationTaskArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationTaskArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCdcStartTime sets the CdcStartTime field's value. -func (s *ModifyReplicationTaskInput) SetCdcStartTime(v time.Time) *ModifyReplicationTaskInput { - s.CdcStartTime = &v - return s -} - -// SetMigrationType sets the MigrationType field's value. -func (s *ModifyReplicationTaskInput) SetMigrationType(v string) *ModifyReplicationTaskInput { - s.MigrationType = &v - return s -} - -// SetReplicationTaskArn sets the ReplicationTaskArn field's value. -func (s *ModifyReplicationTaskInput) SetReplicationTaskArn(v string) *ModifyReplicationTaskInput { - s.ReplicationTaskArn = &v - return s -} - -// SetReplicationTaskIdentifier sets the ReplicationTaskIdentifier field's value. -func (s *ModifyReplicationTaskInput) SetReplicationTaskIdentifier(v string) *ModifyReplicationTaskInput { - s.ReplicationTaskIdentifier = &v - return s -} - -// SetReplicationTaskSettings sets the ReplicationTaskSettings field's value. -func (s *ModifyReplicationTaskInput) SetReplicationTaskSettings(v string) *ModifyReplicationTaskInput { - s.ReplicationTaskSettings = &v - return s -} - -// SetTableMappings sets the TableMappings field's value. -func (s *ModifyReplicationTaskInput) SetTableMappings(v string) *ModifyReplicationTaskInput { - s.TableMappings = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationTaskResponse -type ModifyReplicationTaskOutput struct { - _ struct{} `type:"structure"` - - // The replication task that was modified. - ReplicationTask *ReplicationTask `type:"structure"` -} - -// String returns the string representation -func (s ModifyReplicationTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReplicationTaskOutput) GoString() string { - return s.String() -} - -// SetReplicationTask sets the ReplicationTask field's value. -func (s *ModifyReplicationTaskOutput) SetReplicationTask(v *ReplicationTask) *ModifyReplicationTaskOutput { - s.ReplicationTask = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/OrderableReplicationInstance -type OrderableReplicationInstance struct { - _ struct{} `type:"structure"` - - // The default amount of storage (in gigabytes) that is allocated for the replication - // instance. - DefaultAllocatedStorage *int64 `type:"integer"` - - // The version of the replication engine. - EngineVersion *string `type:"string"` - - // The amount of storage (in gigabytes) that is allocated for the replication - // instance. - IncludedAllocatedStorage *int64 `type:"integer"` - - // The minimum amount of storage (in gigabytes) that can be allocated for the - // replication instance. - MaxAllocatedStorage *int64 `type:"integer"` - - // The minimum amount of storage (in gigabytes) that can be allocated for the - // replication instance. - MinAllocatedStorage *int64 `type:"integer"` - - // The compute and memory capacity of the replication instance. - // - // Valid Values: dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large - // | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge - ReplicationInstanceClass *string `type:"string"` - - // The type of storage used by the replication instance. - StorageType *string `type:"string"` -} - -// String returns the string representation -func (s OrderableReplicationInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OrderableReplicationInstance) GoString() string { - return s.String() -} - -// SetDefaultAllocatedStorage sets the DefaultAllocatedStorage field's value. -func (s *OrderableReplicationInstance) SetDefaultAllocatedStorage(v int64) *OrderableReplicationInstance { - s.DefaultAllocatedStorage = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *OrderableReplicationInstance) SetEngineVersion(v string) *OrderableReplicationInstance { - s.EngineVersion = &v - return s -} - -// SetIncludedAllocatedStorage sets the IncludedAllocatedStorage field's value. -func (s *OrderableReplicationInstance) SetIncludedAllocatedStorage(v int64) *OrderableReplicationInstance { - s.IncludedAllocatedStorage = &v - return s -} - -// SetMaxAllocatedStorage sets the MaxAllocatedStorage field's value. -func (s *OrderableReplicationInstance) SetMaxAllocatedStorage(v int64) *OrderableReplicationInstance { - s.MaxAllocatedStorage = &v - return s -} - -// SetMinAllocatedStorage sets the MinAllocatedStorage field's value. -func (s *OrderableReplicationInstance) SetMinAllocatedStorage(v int64) *OrderableReplicationInstance { - s.MinAllocatedStorage = &v - return s -} - -// SetReplicationInstanceClass sets the ReplicationInstanceClass field's value. -func (s *OrderableReplicationInstance) SetReplicationInstanceClass(v string) *OrderableReplicationInstance { - s.ReplicationInstanceClass = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *OrderableReplicationInstance) SetStorageType(v string) *OrderableReplicationInstance { - s.StorageType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RefreshSchemasMessage -type RefreshSchemasInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the replication instance. - // - // ReplicationInstanceArn is a required field - ReplicationInstanceArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RefreshSchemasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RefreshSchemasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RefreshSchemasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RefreshSchemasInput"} - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - if s.ReplicationInstanceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationInstanceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *RefreshSchemasInput) SetEndpointArn(v string) *RefreshSchemasInput { - s.EndpointArn = &v - return s -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *RefreshSchemasInput) SetReplicationInstanceArn(v string) *RefreshSchemasInput { - s.ReplicationInstanceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RefreshSchemasResponse -type RefreshSchemasOutput struct { - _ struct{} `type:"structure"` - - // The status of the refreshed schema. - RefreshSchemasStatus *RefreshSchemasStatus `type:"structure"` -} - -// String returns the string representation -func (s RefreshSchemasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RefreshSchemasOutput) GoString() string { - return s.String() -} - -// SetRefreshSchemasStatus sets the RefreshSchemasStatus field's value. -func (s *RefreshSchemasOutput) SetRefreshSchemasStatus(v *RefreshSchemasStatus) *RefreshSchemasOutput { - s.RefreshSchemasStatus = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RefreshSchemasStatus -type RefreshSchemasStatus struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - EndpointArn *string `type:"string"` - - // The last failure message for the schema. - LastFailureMessage *string `type:"string"` - - // The date the schema was last refreshed. - LastRefreshDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The Amazon Resource Name (ARN) of the replication instance. - ReplicationInstanceArn *string `type:"string"` - - // The status of the schema. - Status *string `type:"string" enum:"RefreshSchemasStatusTypeValue"` -} - -// String returns the string representation -func (s RefreshSchemasStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RefreshSchemasStatus) GoString() string { - return s.String() -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *RefreshSchemasStatus) SetEndpointArn(v string) *RefreshSchemasStatus { - s.EndpointArn = &v - return s -} - -// SetLastFailureMessage sets the LastFailureMessage field's value. -func (s *RefreshSchemasStatus) SetLastFailureMessage(v string) *RefreshSchemasStatus { - s.LastFailureMessage = &v - return s -} - -// SetLastRefreshDate sets the LastRefreshDate field's value. -func (s *RefreshSchemasStatus) SetLastRefreshDate(v time.Time) *RefreshSchemasStatus { - s.LastRefreshDate = &v - return s -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *RefreshSchemasStatus) SetReplicationInstanceArn(v string) *RefreshSchemasStatus { - s.ReplicationInstanceArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RefreshSchemasStatus) SetStatus(v string) *RefreshSchemasStatus { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RemoveTagsFromResourceMessage -type RemoveTagsFromResourceInput struct { - _ struct{} `type:"structure"` - - // >The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be - // removed from. - // - // ResourceArn is a required field - ResourceArn *string `type:"string" required:"true"` - - // The tag key (name) of the tag to be removed. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - 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 *RemoveTagsFromResourceInput) SetResourceArn(v string) *RemoveTagsFromResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsFromResourceInput) SetTagKeys(v []*string) *RemoveTagsFromResourceInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RemoveTagsFromResourceResponse -type RemoveTagsFromResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ReplicationInstance -type ReplicationInstance struct { - _ struct{} `type:"structure"` - - // The amount of storage (in gigabytes) that is allocated for the replication - // instance. - AllocatedStorage *int64 `type:"integer"` - - // Boolean value indicating if minor version upgrades will be automatically - // applied to the instance. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The Availability Zone for the instance. - AvailabilityZone *string `type:"string"` - - // The engine version number of the replication instance. - EngineVersion *string `type:"string"` - - // The time the replication instance was created. - InstanceCreateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The KMS key identifier that is used to encrypt the content on the replication - // instance. If you do not specify a value for the KmsKeyId parameter, then - // AWS DMS will use your default encryption key. AWS KMS creates the default - // encryption key for your AWS account. Your AWS account has a different default - // encryption key for each AWS region. - KmsKeyId *string `type:"string"` - - // Specifies if the replication instance is a Multi-AZ deployment. You cannot - // set the AvailabilityZone parameter if the Multi-AZ parameter is set to true. - MultiAZ *bool `type:"boolean"` - - // The pending modification values. - PendingModifiedValues *ReplicationPendingModifiedValues `type:"structure"` - - // The maintenance window times for the replication instance. - PreferredMaintenanceWindow *string `type:"string"` - - // Specifies the accessibility options for the replication instance. A value - // of true represents an instance with a public IP address. A value of false - // represents an instance with a private IP address. The default value is true. - PubliclyAccessible *bool `type:"boolean"` - - // The Amazon Resource Name (ARN) of the replication instance. - ReplicationInstanceArn *string `type:"string"` - - // The compute and memory capacity of the replication instance. - // - // Valid Values: dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large - // | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge - ReplicationInstanceClass *string `type:"string"` - - // The replication instance identifier. This parameter is stored as a lowercase - // string. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: myrepinstance - ReplicationInstanceIdentifier *string `type:"string"` - - // The private IP address of the replication instance. - ReplicationInstancePrivateIpAddress *string `deprecated:"true" type:"string"` - - // The private IP address of the replication instance. - ReplicationInstancePrivateIpAddresses []*string `type:"list"` - - // The public IP address of the replication instance. - ReplicationInstancePublicIpAddress *string `deprecated:"true" type:"string"` - - // The public IP address of the replication instance. - ReplicationInstancePublicIpAddresses []*string `type:"list"` - - // The status of the replication instance. - ReplicationInstanceStatus *string `type:"string"` - - // The subnet group for the replication instance. - ReplicationSubnetGroup *ReplicationSubnetGroup `type:"structure"` - - // The availability zone of the standby replication instance in a Multi-AZ deployment. - SecondaryAvailabilityZone *string `type:"string"` - - // The VPC security group for the instance. - VpcSecurityGroups []*VpcSecurityGroupMembership `locationNameList:"VpcSecurityGroupMembership" type:"list"` -} - -// String returns the string representation -func (s ReplicationInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationInstance) GoString() string { - return s.String() -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *ReplicationInstance) SetAllocatedStorage(v int64) *ReplicationInstance { - s.AllocatedStorage = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *ReplicationInstance) SetAutoMinorVersionUpgrade(v bool) *ReplicationInstance { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ReplicationInstance) SetAvailabilityZone(v string) *ReplicationInstance { - s.AvailabilityZone = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *ReplicationInstance) SetEngineVersion(v string) *ReplicationInstance { - s.EngineVersion = &v - return s -} - -// SetInstanceCreateTime sets the InstanceCreateTime field's value. -func (s *ReplicationInstance) SetInstanceCreateTime(v time.Time) *ReplicationInstance { - s.InstanceCreateTime = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *ReplicationInstance) SetKmsKeyId(v string) *ReplicationInstance { - s.KmsKeyId = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *ReplicationInstance) SetMultiAZ(v bool) *ReplicationInstance { - s.MultiAZ = &v - return s -} - -// SetPendingModifiedValues sets the PendingModifiedValues field's value. -func (s *ReplicationInstance) SetPendingModifiedValues(v *ReplicationPendingModifiedValues) *ReplicationInstance { - s.PendingModifiedValues = v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *ReplicationInstance) SetPreferredMaintenanceWindow(v string) *ReplicationInstance { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *ReplicationInstance) SetPubliclyAccessible(v bool) *ReplicationInstance { - s.PubliclyAccessible = &v - return s -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *ReplicationInstance) SetReplicationInstanceArn(v string) *ReplicationInstance { - s.ReplicationInstanceArn = &v - return s -} - -// SetReplicationInstanceClass sets the ReplicationInstanceClass field's value. -func (s *ReplicationInstance) SetReplicationInstanceClass(v string) *ReplicationInstance { - s.ReplicationInstanceClass = &v - return s -} - -// SetReplicationInstanceIdentifier sets the ReplicationInstanceIdentifier field's value. -func (s *ReplicationInstance) SetReplicationInstanceIdentifier(v string) *ReplicationInstance { - s.ReplicationInstanceIdentifier = &v - return s -} - -// SetReplicationInstancePrivateIpAddress sets the ReplicationInstancePrivateIpAddress field's value. -func (s *ReplicationInstance) SetReplicationInstancePrivateIpAddress(v string) *ReplicationInstance { - s.ReplicationInstancePrivateIpAddress = &v - return s -} - -// SetReplicationInstancePrivateIpAddresses sets the ReplicationInstancePrivateIpAddresses field's value. -func (s *ReplicationInstance) SetReplicationInstancePrivateIpAddresses(v []*string) *ReplicationInstance { - s.ReplicationInstancePrivateIpAddresses = v - return s -} - -// SetReplicationInstancePublicIpAddress sets the ReplicationInstancePublicIpAddress field's value. -func (s *ReplicationInstance) SetReplicationInstancePublicIpAddress(v string) *ReplicationInstance { - s.ReplicationInstancePublicIpAddress = &v - return s -} - -// SetReplicationInstancePublicIpAddresses sets the ReplicationInstancePublicIpAddresses field's value. -func (s *ReplicationInstance) SetReplicationInstancePublicIpAddresses(v []*string) *ReplicationInstance { - s.ReplicationInstancePublicIpAddresses = v - return s -} - -// SetReplicationInstanceStatus sets the ReplicationInstanceStatus field's value. -func (s *ReplicationInstance) SetReplicationInstanceStatus(v string) *ReplicationInstance { - s.ReplicationInstanceStatus = &v - return s -} - -// SetReplicationSubnetGroup sets the ReplicationSubnetGroup field's value. -func (s *ReplicationInstance) SetReplicationSubnetGroup(v *ReplicationSubnetGroup) *ReplicationInstance { - s.ReplicationSubnetGroup = v - return s -} - -// SetSecondaryAvailabilityZone sets the SecondaryAvailabilityZone field's value. -func (s *ReplicationInstance) SetSecondaryAvailabilityZone(v string) *ReplicationInstance { - s.SecondaryAvailabilityZone = &v - return s -} - -// SetVpcSecurityGroups sets the VpcSecurityGroups field's value. -func (s *ReplicationInstance) SetVpcSecurityGroups(v []*VpcSecurityGroupMembership) *ReplicationInstance { - s.VpcSecurityGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ReplicationPendingModifiedValues -type ReplicationPendingModifiedValues struct { - _ struct{} `type:"structure"` - - // The amount of storage (in gigabytes) that is allocated for the replication - // instance. - AllocatedStorage *int64 `type:"integer"` - - // The engine version number of the replication instance. - EngineVersion *string `type:"string"` - - // Specifies if the replication instance is a Multi-AZ deployment. You cannot - // set the AvailabilityZone parameter if the Multi-AZ parameter is set to true. - MultiAZ *bool `type:"boolean"` - - // The compute and memory capacity of the replication instance. - // - // Valid Values: dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large - // | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge - ReplicationInstanceClass *string `type:"string"` -} - -// String returns the string representation -func (s ReplicationPendingModifiedValues) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationPendingModifiedValues) GoString() string { - return s.String() -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *ReplicationPendingModifiedValues) SetAllocatedStorage(v int64) *ReplicationPendingModifiedValues { - s.AllocatedStorage = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *ReplicationPendingModifiedValues) SetEngineVersion(v string) *ReplicationPendingModifiedValues { - s.EngineVersion = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *ReplicationPendingModifiedValues) SetMultiAZ(v bool) *ReplicationPendingModifiedValues { - s.MultiAZ = &v - return s -} - -// SetReplicationInstanceClass sets the ReplicationInstanceClass field's value. -func (s *ReplicationPendingModifiedValues) SetReplicationInstanceClass(v string) *ReplicationPendingModifiedValues { - s.ReplicationInstanceClass = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ReplicationSubnetGroup -type ReplicationSubnetGroup struct { - _ struct{} `type:"structure"` - - // The description of the replication subnet group. - ReplicationSubnetGroupDescription *string `type:"string"` - - // The identifier of the replication instance subnet group. - ReplicationSubnetGroupIdentifier *string `type:"string"` - - // The status of the subnet group. - SubnetGroupStatus *string `type:"string"` - - // The subnets that are in the subnet group. - Subnets []*Subnet `locationNameList:"Subnet" type:"list"` - - // The ID of the VPC. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s ReplicationSubnetGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationSubnetGroup) GoString() string { - return s.String() -} - -// SetReplicationSubnetGroupDescription sets the ReplicationSubnetGroupDescription field's value. -func (s *ReplicationSubnetGroup) SetReplicationSubnetGroupDescription(v string) *ReplicationSubnetGroup { - s.ReplicationSubnetGroupDescription = &v - return s -} - -// SetReplicationSubnetGroupIdentifier sets the ReplicationSubnetGroupIdentifier field's value. -func (s *ReplicationSubnetGroup) SetReplicationSubnetGroupIdentifier(v string) *ReplicationSubnetGroup { - s.ReplicationSubnetGroupIdentifier = &v - return s -} - -// SetSubnetGroupStatus sets the SubnetGroupStatus field's value. -func (s *ReplicationSubnetGroup) SetSubnetGroupStatus(v string) *ReplicationSubnetGroup { - s.SubnetGroupStatus = &v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *ReplicationSubnetGroup) SetSubnets(v []*Subnet) *ReplicationSubnetGroup { - s.Subnets = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ReplicationSubnetGroup) SetVpcId(v string) *ReplicationSubnetGroup { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ReplicationTask -type ReplicationTask struct { - _ struct{} `type:"structure"` - - // The last error (failure) message generated for the replication instance. - LastFailureMessage *string `type:"string"` - - // The type of migration. - MigrationType *string `type:"string" enum:"MigrationTypeValue"` - - // The Amazon Resource Name (ARN) of the replication instance. - ReplicationInstanceArn *string `type:"string"` - - // The Amazon Resource Name (ARN) of the replication task. - ReplicationTaskArn *string `type:"string"` - - // The date the replication task was created. - ReplicationTaskCreationDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The replication task identifier. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - ReplicationTaskIdentifier *string `type:"string"` - - // The settings for the replication task. - ReplicationTaskSettings *string `type:"string"` - - // The date the replication task is scheduled to start. - ReplicationTaskStartDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The statistics for the task, including elapsed time, tables loaded, and table - // errors. - ReplicationTaskStats *ReplicationTaskStats `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - SourceEndpointArn *string `type:"string"` - - // The status of the replication task. - Status *string `type:"string"` - - // The reason the replication task was stopped. - StopReason *string `type:"string"` - - // Table mappings specified in the task. - TableMappings *string `type:"string"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - TargetEndpointArn *string `type:"string"` -} - -// String returns the string representation -func (s ReplicationTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationTask) GoString() string { - return s.String() -} - -// SetLastFailureMessage sets the LastFailureMessage field's value. -func (s *ReplicationTask) SetLastFailureMessage(v string) *ReplicationTask { - s.LastFailureMessage = &v - return s -} - -// SetMigrationType sets the MigrationType field's value. -func (s *ReplicationTask) SetMigrationType(v string) *ReplicationTask { - s.MigrationType = &v - return s -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *ReplicationTask) SetReplicationInstanceArn(v string) *ReplicationTask { - s.ReplicationInstanceArn = &v - return s -} - -// SetReplicationTaskArn sets the ReplicationTaskArn field's value. -func (s *ReplicationTask) SetReplicationTaskArn(v string) *ReplicationTask { - s.ReplicationTaskArn = &v - return s -} - -// SetReplicationTaskCreationDate sets the ReplicationTaskCreationDate field's value. -func (s *ReplicationTask) SetReplicationTaskCreationDate(v time.Time) *ReplicationTask { - s.ReplicationTaskCreationDate = &v - return s -} - -// SetReplicationTaskIdentifier sets the ReplicationTaskIdentifier field's value. -func (s *ReplicationTask) SetReplicationTaskIdentifier(v string) *ReplicationTask { - s.ReplicationTaskIdentifier = &v - return s -} - -// SetReplicationTaskSettings sets the ReplicationTaskSettings field's value. -func (s *ReplicationTask) SetReplicationTaskSettings(v string) *ReplicationTask { - s.ReplicationTaskSettings = &v - return s -} - -// SetReplicationTaskStartDate sets the ReplicationTaskStartDate field's value. -func (s *ReplicationTask) SetReplicationTaskStartDate(v time.Time) *ReplicationTask { - s.ReplicationTaskStartDate = &v - return s -} - -// SetReplicationTaskStats sets the ReplicationTaskStats field's value. -func (s *ReplicationTask) SetReplicationTaskStats(v *ReplicationTaskStats) *ReplicationTask { - s.ReplicationTaskStats = v - return s -} - -// SetSourceEndpointArn sets the SourceEndpointArn field's value. -func (s *ReplicationTask) SetSourceEndpointArn(v string) *ReplicationTask { - s.SourceEndpointArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReplicationTask) SetStatus(v string) *ReplicationTask { - s.Status = &v - return s -} - -// SetStopReason sets the StopReason field's value. -func (s *ReplicationTask) SetStopReason(v string) *ReplicationTask { - s.StopReason = &v - return s -} - -// SetTableMappings sets the TableMappings field's value. -func (s *ReplicationTask) SetTableMappings(v string) *ReplicationTask { - s.TableMappings = &v - return s -} - -// SetTargetEndpointArn sets the TargetEndpointArn field's value. -func (s *ReplicationTask) SetTargetEndpointArn(v string) *ReplicationTask { - s.TargetEndpointArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ReplicationTaskStats -type ReplicationTaskStats struct { - _ struct{} `type:"structure"` - - // The elapsed time of the task, in milliseconds. - ElapsedTimeMillis *int64 `type:"long"` - - // The percent complete for the full load migration task. - FullLoadProgressPercent *int64 `type:"integer"` - - // The number of errors that have occurred during this task. - TablesErrored *int64 `type:"integer"` - - // The number of tables loaded for this task. - TablesLoaded *int64 `type:"integer"` - - // The number of tables currently loading for this task. - TablesLoading *int64 `type:"integer"` - - // The number of tables queued for this task. - TablesQueued *int64 `type:"integer"` -} - -// String returns the string representation -func (s ReplicationTaskStats) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationTaskStats) GoString() string { - return s.String() -} - -// SetElapsedTimeMillis sets the ElapsedTimeMillis field's value. -func (s *ReplicationTaskStats) SetElapsedTimeMillis(v int64) *ReplicationTaskStats { - s.ElapsedTimeMillis = &v - return s -} - -// SetFullLoadProgressPercent sets the FullLoadProgressPercent field's value. -func (s *ReplicationTaskStats) SetFullLoadProgressPercent(v int64) *ReplicationTaskStats { - s.FullLoadProgressPercent = &v - return s -} - -// SetTablesErrored sets the TablesErrored field's value. -func (s *ReplicationTaskStats) SetTablesErrored(v int64) *ReplicationTaskStats { - s.TablesErrored = &v - return s -} - -// SetTablesLoaded sets the TablesLoaded field's value. -func (s *ReplicationTaskStats) SetTablesLoaded(v int64) *ReplicationTaskStats { - s.TablesLoaded = &v - return s -} - -// SetTablesLoading sets the TablesLoading field's value. -func (s *ReplicationTaskStats) SetTablesLoading(v int64) *ReplicationTaskStats { - s.TablesLoading = &v - return s -} - -// SetTablesQueued sets the TablesQueued field's value. -func (s *ReplicationTaskStats) SetTablesQueued(v int64) *ReplicationTaskStats { - s.TablesQueued = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StartReplicationTaskMessage -type StartReplicationTaskInput struct { - _ struct{} `type:"structure"` - - // The start time for the Change Data Capture (CDC) operation. - CdcStartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The Amazon Resource Number (ARN) of the replication task to be started. - // - // ReplicationTaskArn is a required field - ReplicationTaskArn *string `type:"string" required:"true"` - - // The type of replication task. - // - // StartReplicationTaskType is a required field - StartReplicationTaskType *string `type:"string" required:"true" enum:"StartReplicationTaskTypeValue"` -} - -// String returns the string representation -func (s StartReplicationTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartReplicationTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReplicationTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReplicationTaskInput"} - if s.ReplicationTaskArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationTaskArn")) - } - if s.StartReplicationTaskType == nil { - invalidParams.Add(request.NewErrParamRequired("StartReplicationTaskType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCdcStartTime sets the CdcStartTime field's value. -func (s *StartReplicationTaskInput) SetCdcStartTime(v time.Time) *StartReplicationTaskInput { - s.CdcStartTime = &v - return s -} - -// SetReplicationTaskArn sets the ReplicationTaskArn field's value. -func (s *StartReplicationTaskInput) SetReplicationTaskArn(v string) *StartReplicationTaskInput { - s.ReplicationTaskArn = &v - return s -} - -// SetStartReplicationTaskType sets the StartReplicationTaskType field's value. -func (s *StartReplicationTaskInput) SetStartReplicationTaskType(v string) *StartReplicationTaskInput { - s.StartReplicationTaskType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StartReplicationTaskResponse -type StartReplicationTaskOutput struct { - _ struct{} `type:"structure"` - - // The replication task started. - ReplicationTask *ReplicationTask `type:"structure"` -} - -// String returns the string representation -func (s StartReplicationTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartReplicationTaskOutput) GoString() string { - return s.String() -} - -// SetReplicationTask sets the ReplicationTask field's value. -func (s *StartReplicationTaskOutput) SetReplicationTask(v *ReplicationTask) *StartReplicationTaskOutput { - s.ReplicationTask = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StopReplicationTaskMessage -type StopReplicationTaskInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Number(ARN) of the replication task to be stopped. - // - // ReplicationTaskArn is a required field - ReplicationTaskArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StopReplicationTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopReplicationTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopReplicationTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopReplicationTaskInput"} - if s.ReplicationTaskArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationTaskArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReplicationTaskArn sets the ReplicationTaskArn field's value. -func (s *StopReplicationTaskInput) SetReplicationTaskArn(v string) *StopReplicationTaskInput { - s.ReplicationTaskArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StopReplicationTaskResponse -type StopReplicationTaskOutput struct { - _ struct{} `type:"structure"` - - // The replication task stopped. - ReplicationTask *ReplicationTask `type:"structure"` -} - -// String returns the string representation -func (s StopReplicationTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopReplicationTaskOutput) GoString() string { - return s.String() -} - -// SetReplicationTask sets the ReplicationTask field's value. -func (s *StopReplicationTaskOutput) SetReplicationTask(v *ReplicationTask) *StopReplicationTaskOutput { - s.ReplicationTask = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/Subnet -type Subnet struct { - _ struct{} `type:"structure"` - - // The Availability Zone of the subnet. - SubnetAvailabilityZone *AvailabilityZone `type:"structure"` - - // The subnet identifier. - SubnetIdentifier *string `type:"string"` - - // The status of the subnet. - SubnetStatus *string `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() -} - -// SetSubnetAvailabilityZone sets the SubnetAvailabilityZone field's value. -func (s *Subnet) SetSubnetAvailabilityZone(v *AvailabilityZone) *Subnet { - s.SubnetAvailabilityZone = v - return s -} - -// SetSubnetIdentifier sets the SubnetIdentifier field's value. -func (s *Subnet) SetSubnetIdentifier(v string) *Subnet { - s.SubnetIdentifier = &v - return s -} - -// SetSubnetStatus sets the SubnetStatus field's value. -func (s *Subnet) SetSubnetStatus(v string) *Subnet { - s.SubnetStatus = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/SupportedEndpointType -type SupportedEndpointType struct { - _ struct{} `type:"structure"` - - // The type of endpoint. - EndpointType *string `type:"string" enum:"ReplicationEndpointTypeValue"` - - // The database engine name. Valid values include MYSQL, ORACLE, POSTGRES, MARIADB, - // AURORA, REDSHIFT, SYBASE, and SQLSERVER. - EngineName *string `type:"string"` - - // Indicates if Change Data Capture (CDC) is supported. - SupportsCDC *bool `type:"boolean"` -} - -// String returns the string representation -func (s SupportedEndpointType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SupportedEndpointType) GoString() string { - return s.String() -} - -// SetEndpointType sets the EndpointType field's value. -func (s *SupportedEndpointType) SetEndpointType(v string) *SupportedEndpointType { - s.EndpointType = &v - return s -} - -// SetEngineName sets the EngineName field's value. -func (s *SupportedEndpointType) SetEngineName(v string) *SupportedEndpointType { - s.EngineName = &v - return s -} - -// SetSupportsCDC sets the SupportsCDC field's value. -func (s *SupportedEndpointType) SetSupportsCDC(v bool) *SupportedEndpointType { - s.SupportsCDC = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/TableStatistics -type TableStatistics struct { - _ struct{} `type:"structure"` - - // The Data Definition Language (DDL) used to build and modify the structure - // of your tables. - Ddls *int64 `type:"long"` - - // The number of delete actions performed on a table. - Deletes *int64 `type:"long"` - - // The number of rows added during the Full Load operation. - FullLoadRows *int64 `type:"long"` - - // The number of insert actions performed on a table. - Inserts *int64 `type:"long"` - - // The last time the table was updated. - LastUpdateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The schema name. - SchemaName *string `type:"string"` - - // The name of the table. - TableName *string `type:"string"` - - // The state of the table. - TableState *string `type:"string"` - - // The number of update actions performed on a table. - Updates *int64 `type:"long"` -} - -// String returns the string representation -func (s TableStatistics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TableStatistics) GoString() string { - return s.String() -} - -// SetDdls sets the Ddls field's value. -func (s *TableStatistics) SetDdls(v int64) *TableStatistics { - s.Ddls = &v - return s -} - -// SetDeletes sets the Deletes field's value. -func (s *TableStatistics) SetDeletes(v int64) *TableStatistics { - s.Deletes = &v - return s -} - -// SetFullLoadRows sets the FullLoadRows field's value. -func (s *TableStatistics) SetFullLoadRows(v int64) *TableStatistics { - s.FullLoadRows = &v - return s -} - -// SetInserts sets the Inserts field's value. -func (s *TableStatistics) SetInserts(v int64) *TableStatistics { - s.Inserts = &v - return s -} - -// SetLastUpdateTime sets the LastUpdateTime field's value. -func (s *TableStatistics) SetLastUpdateTime(v time.Time) *TableStatistics { - s.LastUpdateTime = &v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *TableStatistics) SetSchemaName(v string) *TableStatistics { - s.SchemaName = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *TableStatistics) SetTableName(v string) *TableStatistics { - s.TableName = &v - return s -} - -// SetTableState sets the TableState field's value. -func (s *TableStatistics) SetTableState(v string) *TableStatistics { - s.TableState = &v - return s -} - -// SetUpdates sets the Updates field's value. -func (s *TableStatistics) SetUpdates(v int64) *TableStatistics { - s.Updates = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // A key is the required name of the tag. The string value can be from 1 to - // 128 Unicode characters in length and cannot be prefixed with "aws:" or "dms:". - // The string can only contain only the set of Unicode letters, digits, white-space, - // '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"). - Key *string `type:"string"` - - // A value is the optional value of the tag. The string value can be from 1 - // to 256 Unicode characters in length and cannot be prefixed with "aws:" or - // "dms:". The string can only contain only the set of Unicode letters, digits, - // white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"). - 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/dms-2016-01-01/TestConnectionMessage -type TestConnectionInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the replication instance. - // - // ReplicationInstanceArn is a required field - ReplicationInstanceArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s TestConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestConnectionInput"} - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - if s.ReplicationInstanceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationInstanceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *TestConnectionInput) SetEndpointArn(v string) *TestConnectionInput { - s.EndpointArn = &v - return s -} - -// SetReplicationInstanceArn sets the ReplicationInstanceArn field's value. -func (s *TestConnectionInput) SetReplicationInstanceArn(v string) *TestConnectionInput { - s.ReplicationInstanceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/TestConnectionResponse -type TestConnectionOutput struct { - _ struct{} `type:"structure"` - - // The connection tested. - Connection *Connection `type:"structure"` -} - -// String returns the string representation -func (s TestConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestConnectionOutput) GoString() string { - return s.String() -} - -// SetConnection sets the Connection field's value. -func (s *TestConnectionOutput) SetConnection(v *Connection) *TestConnectionOutput { - s.Connection = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/VpcSecurityGroupMembership -type VpcSecurityGroupMembership struct { - _ struct{} `type:"structure"` - - // The status of the VPC security group. - Status *string `type:"string"` - - // The VPC security group Id. - VpcSecurityGroupId *string `type:"string"` -} - -// String returns the string representation -func (s VpcSecurityGroupMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcSecurityGroupMembership) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *VpcSecurityGroupMembership) SetStatus(v string) *VpcSecurityGroupMembership { - s.Status = &v - return s -} - -// SetVpcSecurityGroupId sets the VpcSecurityGroupId field's value. -func (s *VpcSecurityGroupMembership) SetVpcSecurityGroupId(v string) *VpcSecurityGroupMembership { - s.VpcSecurityGroupId = &v - return s -} - -const ( - // DmsSslModeValueNone is a DmsSslModeValue enum value - DmsSslModeValueNone = "none" - - // DmsSslModeValueRequire is a DmsSslModeValue enum value - DmsSslModeValueRequire = "require" - - // DmsSslModeValueVerifyCa is a DmsSslModeValue enum value - DmsSslModeValueVerifyCa = "verify-ca" - - // DmsSslModeValueVerifyFull is a DmsSslModeValue enum value - DmsSslModeValueVerifyFull = "verify-full" -) - -const ( - // MigrationTypeValueFullLoad is a MigrationTypeValue enum value - MigrationTypeValueFullLoad = "full-load" - - // MigrationTypeValueCdc is a MigrationTypeValue enum value - MigrationTypeValueCdc = "cdc" - - // MigrationTypeValueFullLoadAndCdc is a MigrationTypeValue enum value - MigrationTypeValueFullLoadAndCdc = "full-load-and-cdc" -) - -const ( - // RefreshSchemasStatusTypeValueSuccessful is a RefreshSchemasStatusTypeValue enum value - RefreshSchemasStatusTypeValueSuccessful = "successful" - - // RefreshSchemasStatusTypeValueFailed is a RefreshSchemasStatusTypeValue enum value - RefreshSchemasStatusTypeValueFailed = "failed" - - // RefreshSchemasStatusTypeValueRefreshing is a RefreshSchemasStatusTypeValue enum value - RefreshSchemasStatusTypeValueRefreshing = "refreshing" -) - -const ( - // ReplicationEndpointTypeValueSource is a ReplicationEndpointTypeValue enum value - ReplicationEndpointTypeValueSource = "source" - - // ReplicationEndpointTypeValueTarget is a ReplicationEndpointTypeValue enum value - ReplicationEndpointTypeValueTarget = "target" -) - -const ( - // StartReplicationTaskTypeValueStartReplication is a StartReplicationTaskTypeValue enum value - StartReplicationTaskTypeValueStartReplication = "start-replication" - - // StartReplicationTaskTypeValueResumeProcessing is a StartReplicationTaskTypeValue enum value - StartReplicationTaskTypeValueResumeProcessing = "resume-processing" - - // StartReplicationTaskTypeValueReloadTarget is a StartReplicationTaskTypeValue enum value - StartReplicationTaskTypeValueReloadTarget = "reload-target" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go deleted file mode 100644 index 11d19d7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go +++ /dev/null @@ -1,86 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package databasemigrationservice - -const ( - - // ErrCodeAccessDeniedFault for service response error code - // "AccessDeniedFault". - // - // AWS DMS was denied access to the endpoint. - ErrCodeAccessDeniedFault = "AccessDeniedFault" - - // ErrCodeInsufficientResourceCapacityFault for service response error code - // "InsufficientResourceCapacityFault". - // - // There are not enough resources allocated to the database migration. - ErrCodeInsufficientResourceCapacityFault = "InsufficientResourceCapacityFault" - - // ErrCodeInvalidCertificateFault for service response error code - // "InvalidCertificateFault". - // - // The certificate was not valid. - ErrCodeInvalidCertificateFault = "InvalidCertificateFault" - - // ErrCodeInvalidResourceStateFault for service response error code - // "InvalidResourceStateFault". - // - // The resource is in a state that prevents it from being used for database - // migration. - ErrCodeInvalidResourceStateFault = "InvalidResourceStateFault" - - // ErrCodeInvalidSubnet for service response error code - // "InvalidSubnet". - // - // The subnet provided is invalid. - ErrCodeInvalidSubnet = "InvalidSubnet" - - // ErrCodeKMSKeyNotAccessibleFault for service response error code - // "KMSKeyNotAccessibleFault". - // - // AWS DMS cannot access the KMS key. - ErrCodeKMSKeyNotAccessibleFault = "KMSKeyNotAccessibleFault" - - // ErrCodeReplicationSubnetGroupDoesNotCoverEnoughAZs for service response error code - // "ReplicationSubnetGroupDoesNotCoverEnoughAZs". - // - // The replication subnet group does not cover enough Availability Zones (AZs). - // Edit the replication subnet group and add more AZs. - ErrCodeReplicationSubnetGroupDoesNotCoverEnoughAZs = "ReplicationSubnetGroupDoesNotCoverEnoughAZs" - - // ErrCodeResourceAlreadyExistsFault for service response error code - // "ResourceAlreadyExistsFault". - // - // The resource you are attempting to create already exists. - ErrCodeResourceAlreadyExistsFault = "ResourceAlreadyExistsFault" - - // ErrCodeResourceNotFoundFault for service response error code - // "ResourceNotFoundFault". - // - // The resource could not be found. - ErrCodeResourceNotFoundFault = "ResourceNotFoundFault" - - // ErrCodeResourceQuotaExceededFault for service response error code - // "ResourceQuotaExceededFault". - // - // The quota for this resource quota has been exceeded. - ErrCodeResourceQuotaExceededFault = "ResourceQuotaExceededFault" - - // ErrCodeStorageQuotaExceededFault for service response error code - // "StorageQuotaExceededFault". - // - // The storage quota has been exceeded. - ErrCodeStorageQuotaExceededFault = "StorageQuotaExceededFault" - - // ErrCodeSubnetAlreadyInUse for service response error code - // "SubnetAlreadyInUse". - // - // The specified subnet is already in use. - ErrCodeSubnetAlreadyInUse = "SubnetAlreadyInUse" - - // ErrCodeUpgradeDependencyFailureFault for service response error code - // "UpgradeDependencyFailureFault". - // - // An upgrade dependency is preventing the database migration. - ErrCodeUpgradeDependencyFailureFault = "UpgradeDependencyFailureFault" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go deleted file mode 100644 index cbb36fd..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go +++ /dev/null @@ -1,99 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package databasemigrationservice - -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" -) - -// AWS Database Migration Service (AWS DMS) can migrate your data to and from -// the most widely used commercial and open-source databases such as Oracle, -// PostgreSQL, Microsoft SQL Server, Amazon Redshift, MariaDB, Amazon Aurora, -// MySQL, and SAP Adaptive Server Enterprise (ASE). The service supports homogeneous -// migrations such as Oracle to Oracle, as well as heterogeneous migrations -// between different database platforms, such as Oracle to MySQL or SQL Server -// to PostgreSQL. -// 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/dms-2016-01-01 -type DatabaseMigrationService 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 = "dms" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the DatabaseMigrationService 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 DatabaseMigrationService client from just a session. -// svc := databasemigrationservice.New(mySession) -// -// // Create a DatabaseMigrationService client with additional configuration -// svc := databasemigrationservice.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *DatabaseMigrationService { - 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) *DatabaseMigrationService { - svc := &DatabaseMigrationService{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-01-01", - JSONVersion: "1.1", - TargetPrefix: "AmazonDMSv20160101", - }, - 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 DatabaseMigrationService operation and runs any -// custom request initialization. -func (c *DatabaseMigrationService) 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/directoryservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/api.go deleted file mode 100644 index 436175a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/api.go +++ /dev/null @@ -1,7841 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package directoryservice provides a client for AWS Directory Service. -package directoryservice - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAddIpRoutes = "AddIpRoutes" - -// AddIpRoutesRequest generates a "aws/request.Request" representing the -// client's request for the AddIpRoutes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddIpRoutes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddIpRoutes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddIpRoutesRequest method. -// req, resp := client.AddIpRoutesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddIpRoutes -func (c *DirectoryService) AddIpRoutesRequest(input *AddIpRoutesInput) (req *request.Request, output *AddIpRoutesOutput) { - op := &request.Operation{ - Name: opAddIpRoutes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddIpRoutesInput{} - } - - output = &AddIpRoutesOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddIpRoutes API operation for AWS Directory Service. -// -// If the DNS server for your on-premises domain uses a publicly addressable -// IP address, you must add a CIDR address block to correctly route traffic -// to and from your Microsoft AD on Amazon Web Services. AddIpRoutes adds this -// address block. You can also use AddIpRoutes to facilitate routing traffic -// that uses public IP ranges from your Microsoft AD on AWS to a peer VPC. -// -// Before you call AddIpRoutes, ensure that all of the required permissions -// have been explicitly granted through a policy. For details about what permissions -// are required to run the AddIpRoutes operation, see AWS Directory Service -// API Permissions: Actions, Resources, and Conditions Reference (http://docs.aws.amazon.com/directoryservice/latest/admin-guide/UsingWithDS_IAM_ResourcePermissions.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 AWS Directory Service's -// API operation AddIpRoutes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" -// The specified entity already exists. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" -// The specified directory is unavailable or could not be found. -// -// * ErrCodeIpRouteLimitExceededException "IpRouteLimitExceededException" -// The maximum allowed number of IP addresses was exceeded. The default limit -// is 100 IP address blocks. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddIpRoutes -func (c *DirectoryService) AddIpRoutes(input *AddIpRoutesInput) (*AddIpRoutesOutput, error) { - req, out := c.AddIpRoutesRequest(input) - err := req.Send() - return out, err -} - -const opAddTagsToResource = "AddTagsToResource" - -// AddTagsToResourceRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToResourceRequest method. -// req, resp := client.AddTagsToResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddTagsToResource -func (c *DirectoryService) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *request.Request, output *AddTagsToResourceOutput) { - op := &request.Operation{ - Name: opAddTagsToResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsToResourceInput{} - } - - output = &AddTagsToResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddTagsToResource API operation for AWS Directory Service. -// -// Adds or overwrites one or more tags for the specified directory. Each directory -// can have a maximum of 50 tags. Each tag consists of a key and optional value. -// Tag keys must be unique to each 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 AWS Directory Service's -// API operation AddTagsToResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeTagLimitExceededException "TagLimitExceededException" -// The maximum allowed number of tags was exceeded. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddTagsToResource -func (c *DirectoryService) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { - req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err -} - -const opCancelSchemaExtension = "CancelSchemaExtension" - -// CancelSchemaExtensionRequest generates a "aws/request.Request" representing the -// client's request for the CancelSchemaExtension operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelSchemaExtension for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelSchemaExtension method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelSchemaExtensionRequest method. -// req, resp := client.CancelSchemaExtensionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CancelSchemaExtension -func (c *DirectoryService) CancelSchemaExtensionRequest(input *CancelSchemaExtensionInput) (req *request.Request, output *CancelSchemaExtensionOutput) { - op := &request.Operation{ - Name: opCancelSchemaExtension, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelSchemaExtensionInput{} - } - - output = &CancelSchemaExtensionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelSchemaExtension API operation for AWS Directory Service. -// -// Cancels an in-progress schema extension to a Microsoft AD directory. Once -// a schema extension has started replicating to all domain controllers, the -// task can no longer be canceled. A schema extension can be canceled during -// any of the following states; Initializing, CreatingSnapshot, and UpdatingSchema. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation CancelSchemaExtension for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CancelSchemaExtension -func (c *DirectoryService) CancelSchemaExtension(input *CancelSchemaExtensionInput) (*CancelSchemaExtensionOutput, error) { - req, out := c.CancelSchemaExtensionRequest(input) - err := req.Send() - return out, err -} - -const opConnectDirectory = "ConnectDirectory" - -// ConnectDirectoryRequest generates a "aws/request.Request" representing the -// client's request for the ConnectDirectory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ConnectDirectory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ConnectDirectory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ConnectDirectoryRequest method. -// req, resp := client.ConnectDirectoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ConnectDirectory -func (c *DirectoryService) ConnectDirectoryRequest(input *ConnectDirectoryInput) (req *request.Request, output *ConnectDirectoryOutput) { - op := &request.Operation{ - Name: opConnectDirectory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ConnectDirectoryInput{} - } - - output = &ConnectDirectoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// ConnectDirectory API operation for AWS Directory Service. -// -// Creates an AD Connector to connect to an on-premises directory. -// -// Before you call ConnectDirectory, ensure that all of the required permissions -// have been explicitly granted through a policy. For details about what permissions -// are required to run the ConnectDirectory operation, see AWS Directory Service -// API Permissions: Actions, Resources, and Conditions Reference (http://docs.aws.amazon.com/directoryservice/latest/admin-guide/UsingWithDS_IAM_ResourcePermissions.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 AWS Directory Service's -// API operation ConnectDirectory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDirectoryLimitExceededException "DirectoryLimitExceededException" -// The maximum number of directories in the region has been reached. You can -// use the GetDirectoryLimits operation to determine your directory limits in -// the region. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ConnectDirectory -func (c *DirectoryService) ConnectDirectory(input *ConnectDirectoryInput) (*ConnectDirectoryOutput, error) { - req, out := c.ConnectDirectoryRequest(input) - err := req.Send() - return out, err -} - -const opCreateAlias = "CreateAlias" - -// CreateAliasRequest generates a "aws/request.Request" representing the -// client's request for the CreateAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAliasRequest method. -// req, resp := client.CreateAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateAlias -func (c *DirectoryService) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput) { - op := &request.Operation{ - Name: opCreateAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAliasInput{} - } - - output = &CreateAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAlias API operation for AWS Directory Service. -// -// Creates an alias for a directory and assigns the alias to the directory. -// The alias is used to construct the access URL for the directory, such as -// http://.awsapps.com. -// -// After an alias has been created, it cannot be deleted or reused, so this -// operation should only be used when absolutely necessary. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation CreateAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" -// The specified entity already exists. -// -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateAlias -func (c *DirectoryService) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { - req, out := c.CreateAliasRequest(input) - err := req.Send() - return out, err -} - -const opCreateComputer = "CreateComputer" - -// CreateComputerRequest generates a "aws/request.Request" representing the -// client's request for the CreateComputer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateComputer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateComputer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateComputerRequest method. -// req, resp := client.CreateComputerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateComputer -func (c *DirectoryService) CreateComputerRequest(input *CreateComputerInput) (req *request.Request, output *CreateComputerOutput) { - op := &request.Operation{ - Name: opCreateComputer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateComputerInput{} - } - - output = &CreateComputerOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateComputer API operation for AWS Directory Service. -// -// Creates a computer account in the specified directory, and joins the computer -// to the directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation CreateComputer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAuthenticationFailedException "AuthenticationFailedException" -// An authentication error occurred. -// -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" -// The specified directory is unavailable or could not be found. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" -// The specified entity already exists. -// -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateComputer -func (c *DirectoryService) CreateComputer(input *CreateComputerInput) (*CreateComputerOutput, error) { - req, out := c.CreateComputerRequest(input) - err := req.Send() - return out, err -} - -const opCreateConditionalForwarder = "CreateConditionalForwarder" - -// CreateConditionalForwarderRequest generates a "aws/request.Request" representing the -// client's request for the CreateConditionalForwarder operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateConditionalForwarder for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateConditionalForwarder method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateConditionalForwarderRequest method. -// req, resp := client.CreateConditionalForwarderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateConditionalForwarder -func (c *DirectoryService) CreateConditionalForwarderRequest(input *CreateConditionalForwarderInput) (req *request.Request, output *CreateConditionalForwarderOutput) { - op := &request.Operation{ - Name: opCreateConditionalForwarder, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateConditionalForwarderInput{} - } - - output = &CreateConditionalForwarderOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateConditionalForwarder API operation for AWS Directory Service. -// -// Creates a conditional forwarder associated with your AWS directory. Conditional -// forwarders are required in order to set up a trust relationship with another -// domain. The conditional forwarder points to the trusted domain. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation CreateConditionalForwarder for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" -// The specified entity already exists. -// -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" -// The specified directory is unavailable or could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateConditionalForwarder -func (c *DirectoryService) CreateConditionalForwarder(input *CreateConditionalForwarderInput) (*CreateConditionalForwarderOutput, error) { - req, out := c.CreateConditionalForwarderRequest(input) - err := req.Send() - return out, err -} - -const opCreateDirectory = "CreateDirectory" - -// CreateDirectoryRequest generates a "aws/request.Request" representing the -// client's request for the CreateDirectory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDirectory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDirectory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDirectoryRequest method. -// req, resp := client.CreateDirectoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateDirectory -func (c *DirectoryService) CreateDirectoryRequest(input *CreateDirectoryInput) (req *request.Request, output *CreateDirectoryOutput) { - op := &request.Operation{ - Name: opCreateDirectory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDirectoryInput{} - } - - output = &CreateDirectoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDirectory API operation for AWS Directory Service. -// -// Creates a Simple AD directory. -// -// Before you call CreateDirectory, ensure that all of the required permissions -// have been explicitly granted through a policy. For details about what permissions -// are required to run the CreateDirectory operation, see AWS Directory Service -// API Permissions: Actions, Resources, and Conditions Reference (http://docs.aws.amazon.com/directoryservice/latest/admin-guide/UsingWithDS_IAM_ResourcePermissions.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 AWS Directory Service's -// API operation CreateDirectory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDirectoryLimitExceededException "DirectoryLimitExceededException" -// The maximum number of directories in the region has been reached. You can -// use the GetDirectoryLimits operation to determine your directory limits in -// the region. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateDirectory -func (c *DirectoryService) CreateDirectory(input *CreateDirectoryInput) (*CreateDirectoryOutput, error) { - req, out := c.CreateDirectoryRequest(input) - err := req.Send() - return out, err -} - -const opCreateMicrosoftAD = "CreateMicrosoftAD" - -// CreateMicrosoftADRequest generates a "aws/request.Request" representing the -// client's request for the CreateMicrosoftAD operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateMicrosoftAD for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateMicrosoftAD method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateMicrosoftADRequest method. -// req, resp := client.CreateMicrosoftADRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateMicrosoftAD -func (c *DirectoryService) CreateMicrosoftADRequest(input *CreateMicrosoftADInput) (req *request.Request, output *CreateMicrosoftADOutput) { - op := &request.Operation{ - Name: opCreateMicrosoftAD, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateMicrosoftADInput{} - } - - output = &CreateMicrosoftADOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateMicrosoftAD API operation for AWS Directory Service. -// -// Creates a Microsoft AD in the AWS cloud. -// -// Before you call CreateMicrosoftAD, ensure that all of the required permissions -// have been explicitly granted through a policy. For details about what permissions -// are required to run the CreateMicrosoftAD operation, see AWS Directory Service -// API Permissions: Actions, Resources, and Conditions Reference (http://docs.aws.amazon.com/directoryservice/latest/admin-guide/UsingWithDS_IAM_ResourcePermissions.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 AWS Directory Service's -// API operation CreateMicrosoftAD for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDirectoryLimitExceededException "DirectoryLimitExceededException" -// The maximum number of directories in the region has been reached. You can -// use the GetDirectoryLimits operation to determine your directory limits in -// the region. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateMicrosoftAD -func (c *DirectoryService) CreateMicrosoftAD(input *CreateMicrosoftADInput) (*CreateMicrosoftADOutput, error) { - req, out := c.CreateMicrosoftADRequest(input) - err := req.Send() - return out, err -} - -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/ds-2015-04-16/CreateSnapshot -func (c *DirectoryService) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *CreateSnapshotOutput) { - op := &request.Operation{ - Name: opCreateSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSnapshotInput{} - } - - output = &CreateSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSnapshot API operation for AWS Directory Service. -// -// Creates a snapshot of a Simple AD or Microsoft AD directory in the AWS cloud. -// -// You cannot take snapshots of AD Connector directories. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation CreateSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeSnapshotLimitExceededException "SnapshotLimitExceededException" -// The maximum number of manual snapshots for the directory has been reached. -// You can use the GetSnapshotLimits operation to determine the snapshot limits -// for a directory. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateSnapshot -func (c *DirectoryService) CreateSnapshot(input *CreateSnapshotInput) (*CreateSnapshotOutput, error) { - req, out := c.CreateSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCreateTrust = "CreateTrust" - -// CreateTrustRequest generates a "aws/request.Request" representing the -// client's request for the CreateTrust operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTrust for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTrust method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTrustRequest method. -// req, resp := client.CreateTrustRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateTrust -func (c *DirectoryService) CreateTrustRequest(input *CreateTrustInput) (req *request.Request, output *CreateTrustOutput) { - op := &request.Operation{ - Name: opCreateTrust, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTrustInput{} - } - - output = &CreateTrustOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTrust API operation for AWS Directory Service. -// -// AWS Directory Service for Microsoft Active Directory allows you to configure -// trust relationships. For example, you can establish a trust between your -// Microsoft AD in the AWS cloud, and your existing on-premises Microsoft Active -// Directory. This would allow you to provide users and groups access to resources -// in either domain, with a single set of credentials. -// -// This action initiates the creation of the AWS side of a trust relationship -// between a Microsoft AD in the AWS cloud and an external domain. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation CreateTrust for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" -// The specified entity already exists. -// -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateTrust -func (c *DirectoryService) CreateTrust(input *CreateTrustInput) (*CreateTrustOutput, error) { - req, out := c.CreateTrustRequest(input) - err := req.Send() - return out, err -} - -const opDeleteConditionalForwarder = "DeleteConditionalForwarder" - -// DeleteConditionalForwarderRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConditionalForwarder operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteConditionalForwarder for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteConditionalForwarder method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteConditionalForwarderRequest method. -// req, resp := client.DeleteConditionalForwarderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteConditionalForwarder -func (c *DirectoryService) DeleteConditionalForwarderRequest(input *DeleteConditionalForwarderInput) (req *request.Request, output *DeleteConditionalForwarderOutput) { - op := &request.Operation{ - Name: opDeleteConditionalForwarder, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteConditionalForwarderInput{} - } - - output = &DeleteConditionalForwarderOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteConditionalForwarder API operation for AWS Directory Service. -// -// Deletes a conditional forwarder that has been set up for your AWS directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation DeleteConditionalForwarder for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" -// The specified directory is unavailable or could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteConditionalForwarder -func (c *DirectoryService) DeleteConditionalForwarder(input *DeleteConditionalForwarderInput) (*DeleteConditionalForwarderOutput, error) { - req, out := c.DeleteConditionalForwarderRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDirectory = "DeleteDirectory" - -// DeleteDirectoryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDirectory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDirectory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDirectory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDirectoryRequest method. -// req, resp := client.DeleteDirectoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteDirectory -func (c *DirectoryService) DeleteDirectoryRequest(input *DeleteDirectoryInput) (req *request.Request, output *DeleteDirectoryOutput) { - op := &request.Operation{ - Name: opDeleteDirectory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDirectoryInput{} - } - - output = &DeleteDirectoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDirectory API operation for AWS Directory Service. -// -// Deletes an AWS Directory Service directory. -// -// Before you call DeleteDirectory, ensure that all of the required permissions -// have been explicitly granted through a policy. For details about what permissions -// are required to run the DeleteDirectory operation, see AWS Directory Service -// API Permissions: Actions, Resources, and Conditions Reference (http://docs.aws.amazon.com/directoryservice/latest/admin-guide/UsingWithDS_IAM_ResourcePermissions.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 AWS Directory Service's -// API operation DeleteDirectory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteDirectory -func (c *DirectoryService) DeleteDirectory(input *DeleteDirectoryInput) (*DeleteDirectoryOutput, error) { - req, out := c.DeleteDirectoryRequest(input) - err := req.Send() - return out, err -} - -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/ds-2015-04-16/DeleteSnapshot -func (c *DirectoryService) 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) - return -} - -// DeleteSnapshot API operation for AWS Directory Service. -// -// Deletes a directory 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 AWS Directory Service's -// API operation DeleteSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteSnapshot -func (c *DirectoryService) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { - req, out := c.DeleteSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opDeleteTrust = "DeleteTrust" - -// DeleteTrustRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTrust operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteTrust for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteTrust method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteTrustRequest method. -// req, resp := client.DeleteTrustRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteTrust -func (c *DirectoryService) DeleteTrustRequest(input *DeleteTrustInput) (req *request.Request, output *DeleteTrustOutput) { - op := &request.Operation{ - Name: opDeleteTrust, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTrustInput{} - } - - output = &DeleteTrustOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTrust API operation for AWS Directory Service. -// -// Deletes an existing trust relationship between your Microsoft AD in the AWS -// cloud and an external domain. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation DeleteTrust for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteTrust -func (c *DirectoryService) DeleteTrust(input *DeleteTrustInput) (*DeleteTrustOutput, error) { - req, out := c.DeleteTrustRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterEventTopic = "DeregisterEventTopic" - -// DeregisterEventTopicRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterEventTopic operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterEventTopic for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterEventTopic method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterEventTopicRequest method. -// req, resp := client.DeregisterEventTopicRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeregisterEventTopic -func (c *DirectoryService) DeregisterEventTopicRequest(input *DeregisterEventTopicInput) (req *request.Request, output *DeregisterEventTopicOutput) { - op := &request.Operation{ - Name: opDeregisterEventTopic, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterEventTopicInput{} - } - - output = &DeregisterEventTopicOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterEventTopic API operation for AWS Directory Service. -// -// Removes the specified directory as a publisher to the specified SNS topic. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation DeregisterEventTopic for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeregisterEventTopic -func (c *DirectoryService) DeregisterEventTopic(input *DeregisterEventTopicInput) (*DeregisterEventTopicOutput, error) { - req, out := c.DeregisterEventTopicRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConditionalForwarders = "DescribeConditionalForwarders" - -// DescribeConditionalForwardersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConditionalForwarders operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConditionalForwarders for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConditionalForwarders method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConditionalForwardersRequest method. -// req, resp := client.DescribeConditionalForwardersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeConditionalForwarders -func (c *DirectoryService) DescribeConditionalForwardersRequest(input *DescribeConditionalForwardersInput) (req *request.Request, output *DescribeConditionalForwardersOutput) { - op := &request.Operation{ - Name: opDescribeConditionalForwarders, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConditionalForwardersInput{} - } - - output = &DescribeConditionalForwardersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConditionalForwarders API operation for AWS Directory Service. -// -// Obtains information about the conditional forwarders for this account. -// -// If no input parameters are provided for RemoteDomainNames, this request describes -// all conditional forwarders for the specified directory 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 AWS Directory Service's -// API operation DescribeConditionalForwarders for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" -// The specified directory is unavailable or could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeConditionalForwarders -func (c *DirectoryService) DescribeConditionalForwarders(input *DescribeConditionalForwardersInput) (*DescribeConditionalForwardersOutput, error) { - req, out := c.DescribeConditionalForwardersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDirectories = "DescribeDirectories" - -// DescribeDirectoriesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDirectories operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDirectories for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDirectories method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDirectoriesRequest method. -// req, resp := client.DescribeDirectoriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDirectories -func (c *DirectoryService) DescribeDirectoriesRequest(input *DescribeDirectoriesInput) (req *request.Request, output *DescribeDirectoriesOutput) { - op := &request.Operation{ - Name: opDescribeDirectories, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDirectoriesInput{} - } - - output = &DescribeDirectoriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDirectories API operation for AWS Directory Service. -// -// Obtains information about the directories that belong to this account. -// -// You can retrieve information about specific directories by passing the directory -// identifiers in the DirectoryIds parameter. Otherwise, all directories that -// belong to the current account are returned. -// -// This operation supports pagination with the use of the NextToken request -// and response parameters. If more results are available, the DescribeDirectoriesResult.NextToken -// member contains a token that you pass in the next call to DescribeDirectories -// to retrieve the next set of items. -// -// You can also specify a maximum number of return results with the Limit 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 AWS Directory Service's -// API operation DescribeDirectories for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value is not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDirectories -func (c *DirectoryService) DescribeDirectories(input *DescribeDirectoriesInput) (*DescribeDirectoriesOutput, error) { - req, out := c.DescribeDirectoriesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEventTopics = "DescribeEventTopics" - -// DescribeEventTopicsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEventTopics operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEventTopics for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEventTopics method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventTopicsRequest method. -// req, resp := client.DescribeEventTopicsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeEventTopics -func (c *DirectoryService) DescribeEventTopicsRequest(input *DescribeEventTopicsInput) (req *request.Request, output *DescribeEventTopicsOutput) { - op := &request.Operation{ - Name: opDescribeEventTopics, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEventTopicsInput{} - } - - output = &DescribeEventTopicsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEventTopics API operation for AWS Directory Service. -// -// Obtains information about which SNS topics receive status messages from the -// specified directory. -// -// If no input parameters are provided, such as DirectoryId or TopicName, this -// request describes all of the associations in the 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 AWS Directory Service's -// API operation DescribeEventTopics for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeEventTopics -func (c *DirectoryService) DescribeEventTopics(input *DescribeEventTopicsInput) (*DescribeEventTopicsOutput, error) { - req, out := c.DescribeEventTopicsRequest(input) - err := req.Send() - return out, err -} - -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/ds-2015-04-16/DescribeSnapshots -func (c *DirectoryService) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *request.Request, output *DescribeSnapshotsOutput) { - op := &request.Operation{ - Name: opDescribeSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSnapshotsInput{} - } - - output = &DescribeSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSnapshots API operation for AWS Directory Service. -// -// Obtains information about the directory snapshots that belong to this account. -// -// This operation supports pagination with the use of the NextToken request -// and response parameters. If more results are available, the DescribeSnapshots.NextToken -// member contains a token that you pass in the next call to DescribeSnapshots -// to retrieve the next set of items. -// -// You can also specify a maximum number of return results with the Limit 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 AWS Directory Service's -// API operation DescribeSnapshots for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value is not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeSnapshots -func (c *DirectoryService) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { - req, out := c.DescribeSnapshotsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTrusts = "DescribeTrusts" - -// DescribeTrustsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTrusts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTrusts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTrusts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTrustsRequest method. -// req, resp := client.DescribeTrustsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeTrusts -func (c *DirectoryService) DescribeTrustsRequest(input *DescribeTrustsInput) (req *request.Request, output *DescribeTrustsOutput) { - op := &request.Operation{ - Name: opDescribeTrusts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTrustsInput{} - } - - output = &DescribeTrustsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTrusts API operation for AWS Directory Service. -// -// Obtains information about the trust relationships for this account. -// -// If no input parameters are provided, such as DirectoryId or TrustIds, this -// request describes all the trust relationships belonging to the 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 AWS Directory Service's -// API operation DescribeTrusts for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeTrusts -func (c *DirectoryService) DescribeTrusts(input *DescribeTrustsInput) (*DescribeTrustsOutput, error) { - req, out := c.DescribeTrustsRequest(input) - err := req.Send() - return out, err -} - -const opDisableRadius = "DisableRadius" - -// DisableRadiusRequest generates a "aws/request.Request" representing the -// client's request for the DisableRadius operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableRadius for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableRadius method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableRadiusRequest method. -// req, resp := client.DisableRadiusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableRadius -func (c *DirectoryService) DisableRadiusRequest(input *DisableRadiusInput) (req *request.Request, output *DisableRadiusOutput) { - op := &request.Operation{ - Name: opDisableRadius, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableRadiusInput{} - } - - output = &DisableRadiusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableRadius API operation for AWS Directory Service. -// -// Disables multi-factor authentication (MFA) with the Remote Authentication -// Dial In User Service (RADIUS) server for an AD Connector directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation DisableRadius for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableRadius -func (c *DirectoryService) DisableRadius(input *DisableRadiusInput) (*DisableRadiusOutput, error) { - req, out := c.DisableRadiusRequest(input) - err := req.Send() - return out, err -} - -const opDisableSso = "DisableSso" - -// DisableSsoRequest generates a "aws/request.Request" representing the -// client's request for the DisableSso operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableSso for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableSso method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableSsoRequest method. -// req, resp := client.DisableSsoRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableSso -func (c *DirectoryService) DisableSsoRequest(input *DisableSsoInput) (req *request.Request, output *DisableSsoOutput) { - op := &request.Operation{ - Name: opDisableSso, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableSsoInput{} - } - - output = &DisableSsoOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableSso API operation for AWS Directory Service. -// -// Disables single-sign on for a directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation DisableSso for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" -// The account does not have sufficient permission to perform the operation. -// -// * ErrCodeAuthenticationFailedException "AuthenticationFailedException" -// An authentication error occurred. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableSso -func (c *DirectoryService) DisableSso(input *DisableSsoInput) (*DisableSsoOutput, error) { - req, out := c.DisableSsoRequest(input) - err := req.Send() - return out, err -} - -const opEnableRadius = "EnableRadius" - -// EnableRadiusRequest generates a "aws/request.Request" representing the -// client's request for the EnableRadius operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableRadius for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableRadius method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableRadiusRequest method. -// req, resp := client.EnableRadiusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableRadius -func (c *DirectoryService) EnableRadiusRequest(input *EnableRadiusInput) (req *request.Request, output *EnableRadiusOutput) { - op := &request.Operation{ - Name: opEnableRadius, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableRadiusInput{} - } - - output = &EnableRadiusOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableRadius API operation for AWS Directory Service. -// -// Enables multi-factor authentication (MFA) with the Remote Authentication -// Dial In User Service (RADIUS) server for an AD Connector directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation EnableRadius for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" -// The specified entity already exists. -// -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableRadius -func (c *DirectoryService) EnableRadius(input *EnableRadiusInput) (*EnableRadiusOutput, error) { - req, out := c.EnableRadiusRequest(input) - err := req.Send() - return out, err -} - -const opEnableSso = "EnableSso" - -// EnableSsoRequest generates a "aws/request.Request" representing the -// client's request for the EnableSso operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableSso for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableSso method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableSsoRequest method. -// req, resp := client.EnableSsoRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableSso -func (c *DirectoryService) EnableSsoRequest(input *EnableSsoInput) (req *request.Request, output *EnableSsoOutput) { - op := &request.Operation{ - Name: opEnableSso, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableSsoInput{} - } - - output = &EnableSsoOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableSso API operation for AWS Directory Service. -// -// Enables single sign-on for a directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation EnableSso for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" -// The account does not have sufficient permission to perform the operation. -// -// * ErrCodeAuthenticationFailedException "AuthenticationFailedException" -// An authentication error occurred. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableSso -func (c *DirectoryService) EnableSso(input *EnableSsoInput) (*EnableSsoOutput, error) { - req, out := c.EnableSsoRequest(input) - err := req.Send() - return out, err -} - -const opGetDirectoryLimits = "GetDirectoryLimits" - -// GetDirectoryLimitsRequest generates a "aws/request.Request" representing the -// client's request for the GetDirectoryLimits operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDirectoryLimits for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDirectoryLimits method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDirectoryLimitsRequest method. -// req, resp := client.GetDirectoryLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetDirectoryLimits -func (c *DirectoryService) GetDirectoryLimitsRequest(input *GetDirectoryLimitsInput) (req *request.Request, output *GetDirectoryLimitsOutput) { - op := &request.Operation{ - Name: opGetDirectoryLimits, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDirectoryLimitsInput{} - } - - output = &GetDirectoryLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDirectoryLimits API operation for AWS Directory Service. -// -// Obtains directory limit information for the current 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 AWS Directory Service's -// API operation GetDirectoryLimits for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetDirectoryLimits -func (c *DirectoryService) GetDirectoryLimits(input *GetDirectoryLimitsInput) (*GetDirectoryLimitsOutput, error) { - req, out := c.GetDirectoryLimitsRequest(input) - err := req.Send() - return out, err -} - -const opGetSnapshotLimits = "GetSnapshotLimits" - -// GetSnapshotLimitsRequest generates a "aws/request.Request" representing the -// client's request for the GetSnapshotLimits operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSnapshotLimits for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSnapshotLimits method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSnapshotLimitsRequest method. -// req, resp := client.GetSnapshotLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetSnapshotLimits -func (c *DirectoryService) GetSnapshotLimitsRequest(input *GetSnapshotLimitsInput) (req *request.Request, output *GetSnapshotLimitsOutput) { - op := &request.Operation{ - Name: opGetSnapshotLimits, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSnapshotLimitsInput{} - } - - output = &GetSnapshotLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSnapshotLimits API operation for AWS Directory Service. -// -// Obtains the manual snapshot limits for a directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation GetSnapshotLimits for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetSnapshotLimits -func (c *DirectoryService) GetSnapshotLimits(input *GetSnapshotLimitsInput) (*GetSnapshotLimitsOutput, error) { - req, out := c.GetSnapshotLimitsRequest(input) - err := req.Send() - return out, err -} - -const opListIpRoutes = "ListIpRoutes" - -// ListIpRoutesRequest generates a "aws/request.Request" representing the -// client's request for the ListIpRoutes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListIpRoutes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListIpRoutes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListIpRoutesRequest method. -// req, resp := client.ListIpRoutesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListIpRoutes -func (c *DirectoryService) ListIpRoutesRequest(input *ListIpRoutesInput) (req *request.Request, output *ListIpRoutesOutput) { - op := &request.Operation{ - Name: opListIpRoutes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListIpRoutesInput{} - } - - output = &ListIpRoutesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIpRoutes API operation for AWS Directory Service. -// -// Lists the address blocks that you have added to a directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation ListIpRoutes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListIpRoutes -func (c *DirectoryService) ListIpRoutes(input *ListIpRoutesInput) (*ListIpRoutesOutput, error) { - req, out := c.ListIpRoutesRequest(input) - err := req.Send() - return out, err -} - -const opListSchemaExtensions = "ListSchemaExtensions" - -// ListSchemaExtensionsRequest generates a "aws/request.Request" representing the -// client's request for the ListSchemaExtensions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSchemaExtensions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSchemaExtensions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSchemaExtensionsRequest method. -// req, resp := client.ListSchemaExtensionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListSchemaExtensions -func (c *DirectoryService) ListSchemaExtensionsRequest(input *ListSchemaExtensionsInput) (req *request.Request, output *ListSchemaExtensionsOutput) { - op := &request.Operation{ - Name: opListSchemaExtensions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListSchemaExtensionsInput{} - } - - output = &ListSchemaExtensionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSchemaExtensions API operation for AWS Directory Service. -// -// Lists all schema extensions applied to a Microsoft AD Directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation ListSchemaExtensions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value is not valid. -// -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListSchemaExtensions -func (c *DirectoryService) ListSchemaExtensions(input *ListSchemaExtensionsInput) (*ListSchemaExtensionsOutput, error) { - req, out := c.ListSchemaExtensionsRequest(input) - err := req.Send() - return out, err -} - -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/ds-2015-04-16/ListTagsForResource -func (c *DirectoryService) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Directory Service. -// -// Lists all tags on a directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListTagsForResource -func (c *DirectoryService) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opRegisterEventTopic = "RegisterEventTopic" - -// RegisterEventTopicRequest generates a "aws/request.Request" representing the -// client's request for the RegisterEventTopic operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterEventTopic for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterEventTopic method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterEventTopicRequest method. -// req, resp := client.RegisterEventTopicRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RegisterEventTopic -func (c *DirectoryService) RegisterEventTopicRequest(input *RegisterEventTopicInput) (req *request.Request, output *RegisterEventTopicOutput) { - op := &request.Operation{ - Name: opRegisterEventTopic, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterEventTopicInput{} - } - - output = &RegisterEventTopicOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterEventTopic API operation for AWS Directory Service. -// -// Associates a directory with an SNS topic. This establishes the directory -// as a publisher to the specified SNS topic. You can then receive email or -// text (SMS) messages when the status of your directory changes. You get notified -// if your directory goes from an Active status to an Impaired or Inoperable -// status. You also receive a notification when the directory returns to an -// Active 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 AWS Directory Service's -// API operation RegisterEventTopic for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RegisterEventTopic -func (c *DirectoryService) RegisterEventTopic(input *RegisterEventTopicInput) (*RegisterEventTopicOutput, error) { - req, out := c.RegisterEventTopicRequest(input) - err := req.Send() - return out, err -} - -const opRemoveIpRoutes = "RemoveIpRoutes" - -// RemoveIpRoutesRequest generates a "aws/request.Request" representing the -// client's request for the RemoveIpRoutes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveIpRoutes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveIpRoutes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveIpRoutesRequest method. -// req, resp := client.RemoveIpRoutesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveIpRoutes -func (c *DirectoryService) RemoveIpRoutesRequest(input *RemoveIpRoutesInput) (req *request.Request, output *RemoveIpRoutesOutput) { - op := &request.Operation{ - Name: opRemoveIpRoutes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveIpRoutesInput{} - } - - output = &RemoveIpRoutesOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveIpRoutes API operation for AWS Directory Service. -// -// Removes IP address blocks from a directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation RemoveIpRoutes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" -// The specified directory is unavailable or could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveIpRoutes -func (c *DirectoryService) RemoveIpRoutes(input *RemoveIpRoutesInput) (*RemoveIpRoutesOutput, error) { - req, out := c.RemoveIpRoutesRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTagsFromResource = "RemoveTagsFromResource" - -// RemoveTagsFromResourceRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromResourceRequest method. -// req, resp := client.RemoveTagsFromResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveTagsFromResource -func (c *DirectoryService) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) (req *request.Request, output *RemoveTagsFromResourceOutput) { - op := &request.Operation{ - Name: opRemoveTagsFromResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsFromResourceInput{} - } - - output = &RemoveTagsFromResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTagsFromResource API operation for AWS Directory Service. -// -// Removes tags from a directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation RemoveTagsFromResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveTagsFromResource -func (c *DirectoryService) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { - req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err -} - -const opRestoreFromSnapshot = "RestoreFromSnapshot" - -// RestoreFromSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the RestoreFromSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreFromSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreFromSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreFromSnapshotRequest method. -// req, resp := client.RestoreFromSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RestoreFromSnapshot -func (c *DirectoryService) RestoreFromSnapshotRequest(input *RestoreFromSnapshotInput) (req *request.Request, output *RestoreFromSnapshotOutput) { - op := &request.Operation{ - Name: opRestoreFromSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreFromSnapshotInput{} - } - - output = &RestoreFromSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreFromSnapshot API operation for AWS Directory Service. -// -// Restores a directory using an existing directory snapshot. -// -// When you restore a directory from a snapshot, any changes made to the directory -// after the snapshot date are overwritten. -// -// This action returns as soon as the restore operation is initiated. You can -// monitor the progress of the restore operation by calling the DescribeDirectories -// operation with the directory identifier. When the DirectoryDescription.Stage -// value changes to Active, the restore 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 AWS Directory Service's -// API operation RestoreFromSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RestoreFromSnapshot -func (c *DirectoryService) RestoreFromSnapshot(input *RestoreFromSnapshotInput) (*RestoreFromSnapshotOutput, error) { - req, out := c.RestoreFromSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opStartSchemaExtension = "StartSchemaExtension" - -// StartSchemaExtensionRequest generates a "aws/request.Request" representing the -// client's request for the StartSchemaExtension operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartSchemaExtension for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartSchemaExtension method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartSchemaExtensionRequest method. -// req, resp := client.StartSchemaExtensionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/StartSchemaExtension -func (c *DirectoryService) StartSchemaExtensionRequest(input *StartSchemaExtensionInput) (req *request.Request, output *StartSchemaExtensionOutput) { - op := &request.Operation{ - Name: opStartSchemaExtension, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartSchemaExtensionInput{} - } - - output = &StartSchemaExtensionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartSchemaExtension API operation for AWS Directory Service. -// -// Applies a schema extension to a Microsoft AD directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation StartSchemaExtension for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" -// The specified directory is unavailable or could not be found. -// -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeSnapshotLimitExceededException "SnapshotLimitExceededException" -// The maximum number of manual snapshots for the directory has been reached. -// You can use the GetSnapshotLimits operation to determine the snapshot limits -// for a directory. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/StartSchemaExtension -func (c *DirectoryService) StartSchemaExtension(input *StartSchemaExtensionInput) (*StartSchemaExtensionOutput, error) { - req, out := c.StartSchemaExtensionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateConditionalForwarder = "UpdateConditionalForwarder" - -// UpdateConditionalForwarderRequest generates a "aws/request.Request" representing the -// client's request for the UpdateConditionalForwarder operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateConditionalForwarder for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateConditionalForwarder method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateConditionalForwarderRequest method. -// req, resp := client.UpdateConditionalForwarderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateConditionalForwarder -func (c *DirectoryService) UpdateConditionalForwarderRequest(input *UpdateConditionalForwarderInput) (req *request.Request, output *UpdateConditionalForwarderOutput) { - op := &request.Operation{ - Name: opUpdateConditionalForwarder, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateConditionalForwarderInput{} - } - - output = &UpdateConditionalForwarderOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateConditionalForwarder API operation for AWS Directory Service. -// -// Updates a conditional forwarder that has been set up for your AWS directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation UpdateConditionalForwarder for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" -// The specified directory is unavailable or could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateConditionalForwarder -func (c *DirectoryService) UpdateConditionalForwarder(input *UpdateConditionalForwarderInput) (*UpdateConditionalForwarderOutput, error) { - req, out := c.UpdateConditionalForwarderRequest(input) - err := req.Send() - return out, err -} - -const opUpdateRadius = "UpdateRadius" - -// UpdateRadiusRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRadius operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateRadius for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateRadius method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateRadiusRequest method. -// req, resp := client.UpdateRadiusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateRadius -func (c *DirectoryService) UpdateRadiusRequest(input *UpdateRadiusInput) (req *request.Request, output *UpdateRadiusOutput) { - op := &request.Operation{ - Name: opUpdateRadius, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateRadiusInput{} - } - - output = &UpdateRadiusOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateRadius API operation for AWS Directory Service. -// -// Updates the Remote Authentication Dial In User Service (RADIUS) server information -// for an AD Connector directory. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation UpdateRadius for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateRadius -func (c *DirectoryService) UpdateRadius(input *UpdateRadiusInput) (*UpdateRadiusOutput, error) { - req, out := c.UpdateRadiusRequest(input) - err := req.Send() - return out, err -} - -const opVerifyTrust = "VerifyTrust" - -// VerifyTrustRequest generates a "aws/request.Request" representing the -// client's request for the VerifyTrust operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See VerifyTrust for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the VerifyTrust method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the VerifyTrustRequest method. -// req, resp := client.VerifyTrustRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/VerifyTrust -func (c *DirectoryService) VerifyTrustRequest(input *VerifyTrustInput) (req *request.Request, output *VerifyTrustOutput) { - op := &request.Operation{ - Name: opVerifyTrust, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &VerifyTrustInput{} - } - - output = &VerifyTrustOutput{} - req = c.newRequest(op, input, output) - return -} - -// VerifyTrust API operation for AWS Directory Service. -// -// AWS Directory Service for Microsoft Active Directory allows you to configure -// and verify trust relationships. -// -// This action verifies a trust relationship between your Microsoft AD in the -// AWS cloud and an external domain. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Directory Service's -// API operation VerifyTrust for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// One or more parameters are not valid. -// -// * ErrCodeClientException "ClientException" -// A client exception has occurred. -// -// * ErrCodeServiceException "ServiceException" -// An exception has occurred in AWS Directory Service. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The operation is not supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/VerifyTrust -func (c *DirectoryService) VerifyTrust(input *VerifyTrustInput) (*VerifyTrustOutput, error) { - req, out := c.VerifyTrustRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddIpRoutesRequest -type AddIpRoutesInput struct { - _ struct{} `type:"structure"` - - // Identifier (ID) of the directory to which to add the address block. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // IP address blocks, using CIDR format, of the traffic to route. This is often - // the IP address block of the DNS server used for your on-premises domain. - // - // IpRoutes is a required field - IpRoutes []*IpRoute `type:"list" required:"true"` - - // If set to true, updates the inbound and outbound rules of the security group - // that has the description: "AWS created security group for directory ID directory - // controllers." Following are the new rules: - // - // Inbound: - // - // * Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0 - // - // * Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0 - // - // * Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0 - // - // * Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0 - // - // * Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0 - // - // * Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0 - // - // * Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0 - // - // * Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0 - // - // * Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0 - // - // * Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0 - // - // * Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0 - // - // * Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0 - // - // * Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0 - // - // * Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0 - // - // * Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0 - // - // * Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0 - // - // * Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0 - // - // Outbound: - // - // Type: All traffic, Protocol: All, Range: All, Destination: 0.0.0.0/0 - UpdateSecurityGroupForDirectoryControllers *bool `type:"boolean"` -} - -// String returns the string representation -func (s AddIpRoutesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddIpRoutesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddIpRoutesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddIpRoutesInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.IpRoutes == nil { - invalidParams.Add(request.NewErrParamRequired("IpRoutes")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *AddIpRoutesInput) SetDirectoryId(v string) *AddIpRoutesInput { - s.DirectoryId = &v - return s -} - -// SetIpRoutes sets the IpRoutes field's value. -func (s *AddIpRoutesInput) SetIpRoutes(v []*IpRoute) *AddIpRoutesInput { - s.IpRoutes = v - return s -} - -// SetUpdateSecurityGroupForDirectoryControllers sets the UpdateSecurityGroupForDirectoryControllers field's value. -func (s *AddIpRoutesInput) SetUpdateSecurityGroupForDirectoryControllers(v bool) *AddIpRoutesInput { - s.UpdateSecurityGroupForDirectoryControllers = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddIpRoutesResult -type AddIpRoutesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddIpRoutesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddIpRoutesOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddTagsToResourceRequest -type AddTagsToResourceInput struct { - _ struct{} `type:"structure"` - - // Identifier (ID) for the directory to which to add the tag. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // The tags to be assigned to the directory. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsToResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - 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 -} - -// SetResourceId sets the ResourceId field's value. -func (s *AddTagsToResourceInput) SetResourceId(v string) *AddTagsToResourceInput { - s.ResourceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToResourceInput) SetTags(v []*Tag) *AddTagsToResourceInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddTagsToResourceResult -type AddTagsToResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsToResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceOutput) GoString() string { - return s.String() -} - -// Represents a named directory attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/Attribute -type Attribute struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - Name *string `min:"1" type:"string"` - - // The value of the attribute. - Value *string `type:"string"` -} - -// String returns the string representation -func (s Attribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Attribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Attribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Attribute"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *Attribute) SetName(v string) *Attribute { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Attribute) SetValue(v string) *Attribute { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CancelSchemaExtensionRequest -type CancelSchemaExtensionInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory whose schema extension will be canceled. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The identifier of the schema extension that will be canceled. - // - // SchemaExtensionId is a required field - SchemaExtensionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelSchemaExtensionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSchemaExtensionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelSchemaExtensionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelSchemaExtensionInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.SchemaExtensionId == nil { - invalidParams.Add(request.NewErrParamRequired("SchemaExtensionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CancelSchemaExtensionInput) SetDirectoryId(v string) *CancelSchemaExtensionInput { - s.DirectoryId = &v - return s -} - -// SetSchemaExtensionId sets the SchemaExtensionId field's value. -func (s *CancelSchemaExtensionInput) SetSchemaExtensionId(v string) *CancelSchemaExtensionInput { - s.SchemaExtensionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CancelSchemaExtensionResult -type CancelSchemaExtensionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CancelSchemaExtensionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSchemaExtensionOutput) GoString() string { - return s.String() -} - -// Contains information about a computer account in a directory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/Computer -type Computer struct { - _ struct{} `type:"structure"` - - // An array of Attribute objects containing the LDAP attributes that belong - // to the computer account. - ComputerAttributes []*Attribute `type:"list"` - - // The identifier of the computer. - ComputerId *string `min:"1" type:"string"` - - // The computer name. - ComputerName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s Computer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Computer) GoString() string { - return s.String() -} - -// SetComputerAttributes sets the ComputerAttributes field's value. -func (s *Computer) SetComputerAttributes(v []*Attribute) *Computer { - s.ComputerAttributes = v - return s -} - -// SetComputerId sets the ComputerId field's value. -func (s *Computer) SetComputerId(v string) *Computer { - s.ComputerId = &v - return s -} - -// SetComputerName sets the ComputerName field's value. -func (s *Computer) SetComputerName(v string) *Computer { - s.ComputerName = &v - return s -} - -// Points to a remote domain with which you are setting up a trust relationship. -// Conditional forwarders are required in order to set up a trust relationship -// with another domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ConditionalForwarder -type ConditionalForwarder struct { - _ struct{} `type:"structure"` - - // The IP addresses of the remote DNS server associated with RemoteDomainName. - // This is the IP address of the DNS server that your conditional forwarder - // points to. - DnsIpAddrs []*string `type:"list"` - - // The fully qualified domain name (FQDN) of the remote domains pointed to by - // the conditional forwarder. - RemoteDomainName *string `type:"string"` - - // The replication scope of the conditional forwarder. The only allowed value - // is Domain, which will replicate the conditional forwarder to all of the domain - // controllers for your AWS directory. - ReplicationScope *string `type:"string" enum:"ReplicationScope"` -} - -// String returns the string representation -func (s ConditionalForwarder) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConditionalForwarder) GoString() string { - return s.String() -} - -// SetDnsIpAddrs sets the DnsIpAddrs field's value. -func (s *ConditionalForwarder) SetDnsIpAddrs(v []*string) *ConditionalForwarder { - s.DnsIpAddrs = v - return s -} - -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *ConditionalForwarder) SetRemoteDomainName(v string) *ConditionalForwarder { - s.RemoteDomainName = &v - return s -} - -// SetReplicationScope sets the ReplicationScope field's value. -func (s *ConditionalForwarder) SetReplicationScope(v string) *ConditionalForwarder { - s.ReplicationScope = &v - return s -} - -// Contains the inputs for the ConnectDirectory operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ConnectDirectoryRequest -type ConnectDirectoryInput struct { - _ struct{} `type:"structure"` - - // A DirectoryConnectSettings object that contains additional information for - // the operation. - // - // ConnectSettings is a required field - ConnectSettings *DirectoryConnectSettings `type:"structure" required:"true"` - - // A textual description for the directory. - Description *string `type:"string"` - - // The fully-qualified name of the on-premises directory, such as corp.example.com. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The password for the on-premises user account. - // - // Password is a required field - Password *string `min:"1" type:"string" required:"true"` - - // The NetBIOS name of the on-premises directory, such as CORP. - ShortName *string `type:"string"` - - // The size of the directory. - // - // Size is a required field - Size *string `type:"string" required:"true" enum:"DirectorySize"` -} - -// String returns the string representation -func (s ConnectDirectoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConnectDirectoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConnectDirectoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConnectDirectoryInput"} - if s.ConnectSettings == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectSettings")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Password == nil { - invalidParams.Add(request.NewErrParamRequired("Password")) - } - if s.Password != nil && len(*s.Password) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Password", 1)) - } - if s.Size == nil { - invalidParams.Add(request.NewErrParamRequired("Size")) - } - if s.ConnectSettings != nil { - if err := s.ConnectSettings.Validate(); err != nil { - invalidParams.AddNested("ConnectSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectSettings sets the ConnectSettings field's value. -func (s *ConnectDirectoryInput) SetConnectSettings(v *DirectoryConnectSettings) *ConnectDirectoryInput { - s.ConnectSettings = v - return s -} - -// SetDescription sets the Description field's value. -func (s *ConnectDirectoryInput) SetDescription(v string) *ConnectDirectoryInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *ConnectDirectoryInput) SetName(v string) *ConnectDirectoryInput { - s.Name = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *ConnectDirectoryInput) SetPassword(v string) *ConnectDirectoryInput { - s.Password = &v - return s -} - -// SetShortName sets the ShortName field's value. -func (s *ConnectDirectoryInput) SetShortName(v string) *ConnectDirectoryInput { - s.ShortName = &v - return s -} - -// SetSize sets the Size field's value. -func (s *ConnectDirectoryInput) SetSize(v string) *ConnectDirectoryInput { - s.Size = &v - return s -} - -// Contains the results of the ConnectDirectory operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ConnectDirectoryResult -type ConnectDirectoryOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the new directory. - DirectoryId *string `type:"string"` -} - -// String returns the string representation -func (s ConnectDirectoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConnectDirectoryOutput) GoString() string { - return s.String() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *ConnectDirectoryOutput) SetDirectoryId(v string) *ConnectDirectoryOutput { - s.DirectoryId = &v - return s -} - -// Contains the inputs for the CreateAlias operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateAliasRequest -type CreateAliasInput struct { - _ struct{} `type:"structure"` - - // The requested alias. - // - // The alias must be unique amongst all aliases in AWS. This operation throws - // an EntityAlreadyExistsException error if the alias already exists. - // - // Alias is a required field - Alias *string `min:"1" type:"string" required:"true"` - - // The identifier of the directory for which to create the alias. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"} - if s.Alias == nil { - invalidParams.Add(request.NewErrParamRequired("Alias")) - } - if s.Alias != nil && len(*s.Alias) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Alias", 1)) - } - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlias sets the Alias field's value. -func (s *CreateAliasInput) SetAlias(v string) *CreateAliasInput { - s.Alias = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateAliasInput) SetDirectoryId(v string) *CreateAliasInput { - s.DirectoryId = &v - return s -} - -// Contains the results of the CreateAlias operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateAliasResult -type CreateAliasOutput struct { - _ struct{} `type:"structure"` - - // The alias for the directory. - Alias *string `min:"1" type:"string"` - - // The identifier of the directory. - DirectoryId *string `type:"string"` -} - -// String returns the string representation -func (s CreateAliasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAliasOutput) GoString() string { - return s.String() -} - -// SetAlias sets the Alias field's value. -func (s *CreateAliasOutput) SetAlias(v string) *CreateAliasOutput { - s.Alias = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateAliasOutput) SetDirectoryId(v string) *CreateAliasOutput { - s.DirectoryId = &v - return s -} - -// Contains the inputs for the CreateComputer operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateComputerRequest -type CreateComputerInput struct { - _ struct{} `type:"structure"` - - // An array of Attribute objects that contain any LDAP attributes to apply to - // the computer account. - ComputerAttributes []*Attribute `type:"list"` - - // The name of the computer account. - // - // ComputerName is a required field - ComputerName *string `min:"1" type:"string" required:"true"` - - // The identifier of the directory in which to create the computer account. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The fully-qualified distinguished name of the organizational unit to place - // the computer account in. - OrganizationalUnitDistinguishedName *string `min:"1" type:"string"` - - // A one-time password that is used to join the computer to the directory. You - // should generate a random, strong password to use for this parameter. - // - // Password is a required field - Password *string `min:"8" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateComputerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateComputerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateComputerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateComputerInput"} - if s.ComputerName == nil { - invalidParams.Add(request.NewErrParamRequired("ComputerName")) - } - if s.ComputerName != nil && len(*s.ComputerName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ComputerName", 1)) - } - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.OrganizationalUnitDistinguishedName != nil && len(*s.OrganizationalUnitDistinguishedName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OrganizationalUnitDistinguishedName", 1)) - } - if s.Password == nil { - invalidParams.Add(request.NewErrParamRequired("Password")) - } - if s.Password != nil && len(*s.Password) < 8 { - invalidParams.Add(request.NewErrParamMinLen("Password", 8)) - } - if s.ComputerAttributes != nil { - for i, v := range s.ComputerAttributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ComputerAttributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComputerAttributes sets the ComputerAttributes field's value. -func (s *CreateComputerInput) SetComputerAttributes(v []*Attribute) *CreateComputerInput { - s.ComputerAttributes = v - return s -} - -// SetComputerName sets the ComputerName field's value. -func (s *CreateComputerInput) SetComputerName(v string) *CreateComputerInput { - s.ComputerName = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateComputerInput) SetDirectoryId(v string) *CreateComputerInput { - s.DirectoryId = &v - return s -} - -// SetOrganizationalUnitDistinguishedName sets the OrganizationalUnitDistinguishedName field's value. -func (s *CreateComputerInput) SetOrganizationalUnitDistinguishedName(v string) *CreateComputerInput { - s.OrganizationalUnitDistinguishedName = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *CreateComputerInput) SetPassword(v string) *CreateComputerInput { - s.Password = &v - return s -} - -// Contains the results for the CreateComputer operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateComputerResult -type CreateComputerOutput struct { - _ struct{} `type:"structure"` - - // A Computer object that represents the computer account. - Computer *Computer `type:"structure"` -} - -// String returns the string representation -func (s CreateComputerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateComputerOutput) GoString() string { - return s.String() -} - -// SetComputer sets the Computer field's value. -func (s *CreateComputerOutput) SetComputer(v *Computer) *CreateComputerOutput { - s.Computer = v - return s -} - -// Initiates the creation of a conditional forwarder for your AWS Directory -// Service for Microsoft Active Directory. Conditional forwarders are required -// in order to set up a trust relationship with another domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateConditionalForwarderRequest -type CreateConditionalForwarderInput struct { - _ struct{} `type:"structure"` - - // The directory ID of the AWS directory for which you are creating the conditional - // forwarder. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The IP addresses of the remote DNS server associated with RemoteDomainName. - // - // DnsIpAddrs is a required field - DnsIpAddrs []*string `type:"list" required:"true"` - - // The fully qualified domain name (FQDN) of the remote domain with which you - // will set up a trust relationship. - // - // RemoteDomainName is a required field - RemoteDomainName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateConditionalForwarderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateConditionalForwarderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateConditionalForwarderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateConditionalForwarderInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.DnsIpAddrs == nil { - invalidParams.Add(request.NewErrParamRequired("DnsIpAddrs")) - } - if s.RemoteDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("RemoteDomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateConditionalForwarderInput) SetDirectoryId(v string) *CreateConditionalForwarderInput { - s.DirectoryId = &v - return s -} - -// SetDnsIpAddrs sets the DnsIpAddrs field's value. -func (s *CreateConditionalForwarderInput) SetDnsIpAddrs(v []*string) *CreateConditionalForwarderInput { - s.DnsIpAddrs = v - return s -} - -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *CreateConditionalForwarderInput) SetRemoteDomainName(v string) *CreateConditionalForwarderInput { - s.RemoteDomainName = &v - return s -} - -// The result of a CreateConditinalForwarder request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateConditionalForwarderResult -type CreateConditionalForwarderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateConditionalForwarderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateConditionalForwarderOutput) GoString() string { - return s.String() -} - -// Contains the inputs for the CreateDirectory operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateDirectoryRequest -type CreateDirectoryInput struct { - _ struct{} `type:"structure"` - - // A textual description for the directory. - Description *string `type:"string"` - - // The fully qualified name for the directory, such as corp.example.com. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The password for the directory administrator. The directory creation process - // creates a directory administrator account with the username Administrator - // and this password. - // - // Password is a required field - Password *string `type:"string" required:"true"` - - // The short name of the directory, such as CORP. - ShortName *string `type:"string"` - - // The size of the directory. - // - // Size is a required field - Size *string `type:"string" required:"true" enum:"DirectorySize"` - - // A DirectoryVpcSettings object that contains additional information for the - // operation. - VpcSettings *DirectoryVpcSettings `type:"structure"` -} - -// String returns the string representation -func (s CreateDirectoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDirectoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDirectoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDirectoryInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Password == nil { - invalidParams.Add(request.NewErrParamRequired("Password")) - } - if s.Size == nil { - invalidParams.Add(request.NewErrParamRequired("Size")) - } - if s.VpcSettings != nil { - if err := s.VpcSettings.Validate(); err != nil { - invalidParams.AddNested("VpcSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateDirectoryInput) SetDescription(v string) *CreateDirectoryInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDirectoryInput) SetName(v string) *CreateDirectoryInput { - s.Name = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *CreateDirectoryInput) SetPassword(v string) *CreateDirectoryInput { - s.Password = &v - return s -} - -// SetShortName sets the ShortName field's value. -func (s *CreateDirectoryInput) SetShortName(v string) *CreateDirectoryInput { - s.ShortName = &v - return s -} - -// SetSize sets the Size field's value. -func (s *CreateDirectoryInput) SetSize(v string) *CreateDirectoryInput { - s.Size = &v - return s -} - -// SetVpcSettings sets the VpcSettings field's value. -func (s *CreateDirectoryInput) SetVpcSettings(v *DirectoryVpcSettings) *CreateDirectoryInput { - s.VpcSettings = v - return s -} - -// Contains the results of the CreateDirectory operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateDirectoryResult -type CreateDirectoryOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory that was created. - DirectoryId *string `type:"string"` -} - -// String returns the string representation -func (s CreateDirectoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDirectoryOutput) GoString() string { - return s.String() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateDirectoryOutput) SetDirectoryId(v string) *CreateDirectoryOutput { - s.DirectoryId = &v - return s -} - -// Creates a Microsoft AD in the AWS cloud. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateMicrosoftADRequest -type CreateMicrosoftADInput struct { - _ struct{} `type:"structure"` - - // A textual description for the directory. This label will appear on the AWS - // console Directory Details page after the directory is created. - Description *string `type:"string"` - - // The fully qualified domain name for the directory, such as corp.example.com. - // This name will resolve inside your VPC only. It does not need to be publicly - // resolvable. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The password for the default administrative user named Admin. - // - // Password is a required field - Password *string `type:"string" required:"true"` - - // The NetBIOS name for your domain. A short identifier for your domain, such - // as CORP. If you don't specify a NetBIOS name, it will default to the first - // part of your directory DNS. For example, CORP for the directory DNS corp.example.com. - ShortName *string `type:"string"` - - // Contains VPC information for the CreateDirectory or CreateMicrosoftAD operation. - // - // VpcSettings is a required field - VpcSettings *DirectoryVpcSettings `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateMicrosoftADInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateMicrosoftADInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMicrosoftADInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMicrosoftADInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Password == nil { - invalidParams.Add(request.NewErrParamRequired("Password")) - } - if s.VpcSettings == nil { - invalidParams.Add(request.NewErrParamRequired("VpcSettings")) - } - if s.VpcSettings != nil { - if err := s.VpcSettings.Validate(); err != nil { - invalidParams.AddNested("VpcSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateMicrosoftADInput) SetDescription(v string) *CreateMicrosoftADInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateMicrosoftADInput) SetName(v string) *CreateMicrosoftADInput { - s.Name = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *CreateMicrosoftADInput) SetPassword(v string) *CreateMicrosoftADInput { - s.Password = &v - return s -} - -// SetShortName sets the ShortName field's value. -func (s *CreateMicrosoftADInput) SetShortName(v string) *CreateMicrosoftADInput { - s.ShortName = &v - return s -} - -// SetVpcSettings sets the VpcSettings field's value. -func (s *CreateMicrosoftADInput) SetVpcSettings(v *DirectoryVpcSettings) *CreateMicrosoftADInput { - s.VpcSettings = v - return s -} - -// Result of a CreateMicrosoftAD request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateMicrosoftADResult -type CreateMicrosoftADOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory that was created. - DirectoryId *string `type:"string"` -} - -// String returns the string representation -func (s CreateMicrosoftADOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateMicrosoftADOutput) GoString() string { - return s.String() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateMicrosoftADOutput) SetDirectoryId(v string) *CreateMicrosoftADOutput { - s.DirectoryId = &v - return s -} - -// Contains the inputs for the CreateSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateSnapshotRequest -type CreateSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory of which to take a snapshot. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The descriptive name to apply to the snapshot. - Name *string `type:"string"` -} - -// 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.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateSnapshotInput) SetDirectoryId(v string) *CreateSnapshotInput { - s.DirectoryId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSnapshotInput) SetName(v string) *CreateSnapshotInput { - s.Name = &v - return s -} - -// Contains the results of the CreateSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateSnapshotResult -type CreateSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the snapshot that was created. - SnapshotId *string `type:"string"` -} - -// String returns the string representation -func (s CreateSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *CreateSnapshotOutput) SetSnapshotId(v string) *CreateSnapshotOutput { - s.SnapshotId = &v - return s -} - -// AWS Directory Service for Microsoft Active Directory allows you to configure -// trust relationships. For example, you can establish a trust between your -// Microsoft AD in the AWS cloud, and your existing on-premises Microsoft Active -// Directory. This would allow you to provide users and groups access to resources -// in either domain, with a single set of credentials. -// -// This action initiates the creation of the AWS side of a trust relationship -// between a Microsoft AD in the AWS cloud and an external domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateTrustRequest -type CreateTrustInput struct { - _ struct{} `type:"structure"` - - // The IP addresses of the remote DNS server associated with RemoteDomainName. - ConditionalForwarderIpAddrs []*string `type:"list"` - - // The Directory ID of the Microsoft AD in the AWS cloud for which to establish - // the trust relationship. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The Fully Qualified Domain Name (FQDN) of the external domain for which to - // create the trust relationship. - // - // RemoteDomainName is a required field - RemoteDomainName *string `type:"string" required:"true"` - - // The direction of the trust relationship. - // - // TrustDirection is a required field - TrustDirection *string `type:"string" required:"true" enum:"TrustDirection"` - - // The trust password. The must be the same password that was used when creating - // the trust relationship on the external domain. - // - // TrustPassword is a required field - TrustPassword *string `min:"1" type:"string" required:"true"` - - // The trust relationship type. - TrustType *string `type:"string" enum:"TrustType"` -} - -// String returns the string representation -func (s CreateTrustInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrustInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrustInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrustInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.RemoteDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("RemoteDomainName")) - } - if s.TrustDirection == nil { - invalidParams.Add(request.NewErrParamRequired("TrustDirection")) - } - if s.TrustPassword == nil { - invalidParams.Add(request.NewErrParamRequired("TrustPassword")) - } - if s.TrustPassword != nil && len(*s.TrustPassword) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrustPassword", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConditionalForwarderIpAddrs sets the ConditionalForwarderIpAddrs field's value. -func (s *CreateTrustInput) SetConditionalForwarderIpAddrs(v []*string) *CreateTrustInput { - s.ConditionalForwarderIpAddrs = v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateTrustInput) SetDirectoryId(v string) *CreateTrustInput { - s.DirectoryId = &v - return s -} - -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *CreateTrustInput) SetRemoteDomainName(v string) *CreateTrustInput { - s.RemoteDomainName = &v - return s -} - -// SetTrustDirection sets the TrustDirection field's value. -func (s *CreateTrustInput) SetTrustDirection(v string) *CreateTrustInput { - s.TrustDirection = &v - return s -} - -// SetTrustPassword sets the TrustPassword field's value. -func (s *CreateTrustInput) SetTrustPassword(v string) *CreateTrustInput { - s.TrustPassword = &v - return s -} - -// SetTrustType sets the TrustType field's value. -func (s *CreateTrustInput) SetTrustType(v string) *CreateTrustInput { - s.TrustType = &v - return s -} - -// The result of a CreateTrust request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateTrustResult -type CreateTrustOutput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the trust relationship that was created. - TrustId *string `type:"string"` -} - -// String returns the string representation -func (s CreateTrustOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrustOutput) GoString() string { - return s.String() -} - -// SetTrustId sets the TrustId field's value. -func (s *CreateTrustOutput) SetTrustId(v string) *CreateTrustOutput { - s.TrustId = &v - return s -} - -// Deletes a conditional forwarder. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteConditionalForwarderRequest -type DeleteConditionalForwarderInput struct { - _ struct{} `type:"structure"` - - // The directory ID for which you are deleting the conditional forwarder. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The fully qualified domain name (FQDN) of the remote domain with which you - // are deleting the conditional forwarder. - // - // RemoteDomainName is a required field - RemoteDomainName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteConditionalForwarderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConditionalForwarderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConditionalForwarderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConditionalForwarderInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.RemoteDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("RemoteDomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DeleteConditionalForwarderInput) SetDirectoryId(v string) *DeleteConditionalForwarderInput { - s.DirectoryId = &v - return s -} - -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *DeleteConditionalForwarderInput) SetRemoteDomainName(v string) *DeleteConditionalForwarderInput { - s.RemoteDomainName = &v - return s -} - -// The result of a DeleteConditionalForwarder request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteConditionalForwarderResult -type DeleteConditionalForwarderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteConditionalForwarderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConditionalForwarderOutput) GoString() string { - return s.String() -} - -// Contains the inputs for the DeleteDirectory operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteDirectoryRequest -type DeleteDirectoryInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory to delete. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDirectoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDirectoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDirectoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDirectoryInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DeleteDirectoryInput) SetDirectoryId(v string) *DeleteDirectoryInput { - s.DirectoryId = &v - return s -} - -// Contains the results of the DeleteDirectory operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteDirectoryResult -type DeleteDirectoryOutput struct { - _ struct{} `type:"structure"` - - // The directory identifier. - DirectoryId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteDirectoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDirectoryOutput) GoString() string { - return s.String() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DeleteDirectoryOutput) SetDirectoryId(v string) *DeleteDirectoryOutput { - s.DirectoryId = &v - return s -} - -// Contains the inputs for the DeleteSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteSnapshotRequest -type DeleteSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory snapshot to be deleted. - // - // 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 -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *DeleteSnapshotInput) SetSnapshotId(v string) *DeleteSnapshotInput { - s.SnapshotId = &v - return s -} - -// Contains the results of the DeleteSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteSnapshotResult -type DeleteSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory snapshot that was deleted. - SnapshotId *string `type:"string"` -} - -// 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() -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *DeleteSnapshotOutput) SetSnapshotId(v string) *DeleteSnapshotOutput { - s.SnapshotId = &v - return s -} - -// Deletes the local side of an existing trust relationship between the Microsoft -// AD in the AWS cloud and the external domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteTrustRequest -type DeleteTrustInput struct { - _ struct{} `type:"structure"` - - // Delete a conditional forwarder as part of a DeleteTrustRequest. - DeleteAssociatedConditionalForwarder *bool `type:"boolean"` - - // The Trust ID of the trust relationship to be deleted. - // - // TrustId is a required field - TrustId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteTrustInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTrustInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrustInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrustInput"} - if s.TrustId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeleteAssociatedConditionalForwarder sets the DeleteAssociatedConditionalForwarder field's value. -func (s *DeleteTrustInput) SetDeleteAssociatedConditionalForwarder(v bool) *DeleteTrustInput { - s.DeleteAssociatedConditionalForwarder = &v - return s -} - -// SetTrustId sets the TrustId field's value. -func (s *DeleteTrustInput) SetTrustId(v string) *DeleteTrustInput { - s.TrustId = &v - return s -} - -// The result of a DeleteTrust request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteTrustResult -type DeleteTrustOutput struct { - _ struct{} `type:"structure"` - - // The Trust ID of the trust relationship that was deleted. - TrustId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteTrustOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTrustOutput) GoString() string { - return s.String() -} - -// SetTrustId sets the TrustId field's value. -func (s *DeleteTrustOutput) SetTrustId(v string) *DeleteTrustOutput { - s.TrustId = &v - return s -} - -// Removes the specified directory as a publisher to the specified SNS topic. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeregisterEventTopicRequest -type DeregisterEventTopicInput struct { - _ struct{} `type:"structure"` - - // The Directory ID to remove as a publisher. This directory will no longer - // send messages to the specified SNS topic. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The name of the SNS topic from which to remove the directory as a publisher. - // - // TopicName is a required field - TopicName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterEventTopicInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterEventTopicInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterEventTopicInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterEventTopicInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.TopicName == nil { - invalidParams.Add(request.NewErrParamRequired("TopicName")) - } - if s.TopicName != nil && len(*s.TopicName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DeregisterEventTopicInput) SetDirectoryId(v string) *DeregisterEventTopicInput { - s.DirectoryId = &v - return s -} - -// SetTopicName sets the TopicName field's value. -func (s *DeregisterEventTopicInput) SetTopicName(v string) *DeregisterEventTopicInput { - s.TopicName = &v - return s -} - -// The result of a DeregisterEventTopic request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeregisterEventTopicResult -type DeregisterEventTopicOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterEventTopicOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterEventTopicOutput) GoString() string { - return s.String() -} - -// Describes a conditional forwarder. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeConditionalForwardersRequest -type DescribeConditionalForwardersInput struct { - _ struct{} `type:"structure"` - - // The directory ID for which to get the list of associated conditional forwarders. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The fully qualified domain names (FQDN) of the remote domains for which to - // get the list of associated conditional forwarders. If this member is null, - // all conditional forwarders are returned. - RemoteDomainNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeConditionalForwardersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConditionalForwardersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeConditionalForwardersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeConditionalForwardersInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeConditionalForwardersInput) SetDirectoryId(v string) *DescribeConditionalForwardersInput { - s.DirectoryId = &v - return s -} - -// SetRemoteDomainNames sets the RemoteDomainNames field's value. -func (s *DescribeConditionalForwardersInput) SetRemoteDomainNames(v []*string) *DescribeConditionalForwardersInput { - s.RemoteDomainNames = v - return s -} - -// The result of a DescribeConditionalForwarder request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeConditionalForwardersResult -type DescribeConditionalForwardersOutput struct { - _ struct{} `type:"structure"` - - // The list of conditional forwarders that have been created. - ConditionalForwarders []*ConditionalForwarder `type:"list"` -} - -// String returns the string representation -func (s DescribeConditionalForwardersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConditionalForwardersOutput) GoString() string { - return s.String() -} - -// SetConditionalForwarders sets the ConditionalForwarders field's value. -func (s *DescribeConditionalForwardersOutput) SetConditionalForwarders(v []*ConditionalForwarder) *DescribeConditionalForwardersOutput { - s.ConditionalForwarders = v - return s -} - -// Contains the inputs for the DescribeDirectories operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDirectoriesRequest -type DescribeDirectoriesInput struct { - _ struct{} `type:"structure"` - - // A list of identifiers of the directories for which to obtain the information. - // If this member is null, all directories that belong to the current account - // are returned. - // - // An empty list results in an InvalidParameterException being thrown. - DirectoryIds []*string `type:"list"` - - // The maximum number of items to return. If this value is zero, the maximum - // number of items is specified by the limitations of the operation. - Limit *int64 `type:"integer"` - - // The DescribeDirectoriesResult.NextToken value from a previous call to DescribeDirectories. - // Pass null if this is the first call. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDirectoriesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDirectoriesInput) GoString() string { - return s.String() -} - -// SetDirectoryIds sets the DirectoryIds field's value. -func (s *DescribeDirectoriesInput) SetDirectoryIds(v []*string) *DescribeDirectoriesInput { - s.DirectoryIds = v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeDirectoriesInput) SetLimit(v int64) *DescribeDirectoriesInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDirectoriesInput) SetNextToken(v string) *DescribeDirectoriesInput { - s.NextToken = &v - return s -} - -// Contains the results of the DescribeDirectories operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDirectoriesResult -type DescribeDirectoriesOutput struct { - _ struct{} `type:"structure"` - - // The list of DirectoryDescription objects that were retrieved. - // - // It is possible that this list contains less than the number of items specified - // in the Limit member of the request. This occurs if there are less than the - // requested number of items left to retrieve, or if the limitations of the - // operation have been exceeded. - DirectoryDescriptions []*DirectoryDescription `type:"list"` - - // If not null, more results are available. Pass this value for the NextToken - // parameter in a subsequent call to DescribeDirectories to retrieve the next - // set of items. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDirectoriesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDirectoriesOutput) GoString() string { - return s.String() -} - -// SetDirectoryDescriptions sets the DirectoryDescriptions field's value. -func (s *DescribeDirectoriesOutput) SetDirectoryDescriptions(v []*DirectoryDescription) *DescribeDirectoriesOutput { - s.DirectoryDescriptions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDirectoriesOutput) SetNextToken(v string) *DescribeDirectoriesOutput { - s.NextToken = &v - return s -} - -// Describes event topics. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeEventTopicsRequest -type DescribeEventTopicsInput struct { - _ struct{} `type:"structure"` - - // The Directory ID for which to get the list of associated SNS topics. If this - // member is null, associations for all Directory IDs are returned. - DirectoryId *string `type:"string"` - - // A list of SNS topic names for which to obtain the information. If this member - // is null, all associations for the specified Directory ID are returned. - // - // An empty list results in an InvalidParameterException being thrown. - TopicNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeEventTopicsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventTopicsInput) GoString() string { - return s.String() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeEventTopicsInput) SetDirectoryId(v string) *DescribeEventTopicsInput { - s.DirectoryId = &v - return s -} - -// SetTopicNames sets the TopicNames field's value. -func (s *DescribeEventTopicsInput) SetTopicNames(v []*string) *DescribeEventTopicsInput { - s.TopicNames = v - return s -} - -// The result of a DescribeEventTopic request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeEventTopicsResult -type DescribeEventTopicsOutput struct { - _ struct{} `type:"structure"` - - // A list of SNS topic names that receive status messages from the specified - // Directory ID. - EventTopics []*EventTopic `type:"list"` -} - -// String returns the string representation -func (s DescribeEventTopicsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventTopicsOutput) GoString() string { - return s.String() -} - -// SetEventTopics sets the EventTopics field's value. -func (s *DescribeEventTopicsOutput) SetEventTopics(v []*EventTopic) *DescribeEventTopicsOutput { - s.EventTopics = v - return s -} - -// Contains the inputs for the DescribeSnapshots operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeSnapshotsRequest -type DescribeSnapshotsInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory for which to retrieve snapshot information. - DirectoryId *string `type:"string"` - - // The maximum number of objects to return. - Limit *int64 `type:"integer"` - - // The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. - // Pass null if this is the first call. - NextToken *string `type:"string"` - - // A list of identifiers of the snapshots to obtain the information for. If - // this member is null or empty, all snapshots are returned using the Limit - // and NextToken members. - SnapshotIds []*string `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() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeSnapshotsInput) SetDirectoryId(v string) *DescribeSnapshotsInput { - s.DirectoryId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeSnapshotsInput) SetLimit(v int64) *DescribeSnapshotsInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSnapshotsInput) SetNextToken(v string) *DescribeSnapshotsInput { - s.NextToken = &v - return s -} - -// SetSnapshotIds sets the SnapshotIds field's value. -func (s *DescribeSnapshotsInput) SetSnapshotIds(v []*string) *DescribeSnapshotsInput { - s.SnapshotIds = v - return s -} - -// Contains the results of the DescribeSnapshots operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeSnapshotsResult -type DescribeSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // If not null, more results are available. Pass this value in the NextToken - // member of a subsequent call to DescribeSnapshots. - NextToken *string `type:"string"` - - // The list of Snapshot objects that were retrieved. - // - // It is possible that this list contains less than the number of items specified - // in the Limit member of the request. This occurs if there are less than the - // requested number of items left to retrieve, or if the limitations of the - // operation have been exceeded. - Snapshots []*Snapshot `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 -} - -// Describes the trust relationships for a particular Microsoft AD in the AWS -// cloud. If no input parameters are are provided, such as directory ID or trust -// ID, this request describes all the trust relationships. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeTrustsRequest -type DescribeTrustsInput struct { - _ struct{} `type:"structure"` - - // The Directory ID of the AWS directory that is a part of the requested trust - // relationship. - DirectoryId *string `type:"string"` - - // The maximum number of objects to return. - Limit *int64 `type:"integer"` - - // The DescribeTrustsResult.NextToken value from a previous call to DescribeTrusts. - // Pass null if this is the first call. - NextToken *string `type:"string"` - - // A list of identifiers of the trust relationships for which to obtain the - // information. If this member is null, all trust relationships that belong - // to the current account are returned. - // - // An empty list results in an InvalidParameterException being thrown. - TrustIds []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeTrustsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTrustsInput) GoString() string { - return s.String() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeTrustsInput) SetDirectoryId(v string) *DescribeTrustsInput { - s.DirectoryId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeTrustsInput) SetLimit(v int64) *DescribeTrustsInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTrustsInput) SetNextToken(v string) *DescribeTrustsInput { - s.NextToken = &v - return s -} - -// SetTrustIds sets the TrustIds field's value. -func (s *DescribeTrustsInput) SetTrustIds(v []*string) *DescribeTrustsInput { - s.TrustIds = v - return s -} - -// The result of a DescribeTrust request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeTrustsResult -type DescribeTrustsOutput struct { - _ struct{} `type:"structure"` - - // If not null, more results are available. Pass this value for the NextToken - // parameter in a subsequent call to DescribeTrusts to retrieve the next set - // of items. - NextToken *string `type:"string"` - - // The list of Trust objects that were retrieved. - // - // It is possible that this list contains less than the number of items specified - // in the Limit member of the request. This occurs if there are less than the - // requested number of items left to retrieve, or if the limitations of the - // operation have been exceeded. - Trusts []*Trust `type:"list"` -} - -// String returns the string representation -func (s DescribeTrustsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTrustsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTrustsOutput) SetNextToken(v string) *DescribeTrustsOutput { - s.NextToken = &v - return s -} - -// SetTrusts sets the Trusts field's value. -func (s *DescribeTrustsOutput) SetTrusts(v []*Trust) *DescribeTrustsOutput { - s.Trusts = v - return s -} - -// Contains information for the ConnectDirectory operation when an AD Connector -// directory is being created. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DirectoryConnectSettings -type DirectoryConnectSettings struct { - _ struct{} `type:"structure"` - - // A list of one or more IP addresses of DNS servers or domain controllers in - // the on-premises directory. - // - // CustomerDnsIps is a required field - CustomerDnsIps []*string `type:"list" required:"true"` - - // The username of an account in the on-premises directory that is used to connect - // to the directory. This account must have the following privileges: - // - // * Read users and groups - // - // * Create computer objects - // - // * Join computers to the domain - // - // CustomerUserName is a required field - CustomerUserName *string `min:"1" type:"string" required:"true"` - - // A list of subnet identifiers in the VPC in which the AD Connector is created. - // - // SubnetIds is a required field - SubnetIds []*string `type:"list" required:"true"` - - // The identifier of the VPC in which the AD Connector is created. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DirectoryConnectSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DirectoryConnectSettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DirectoryConnectSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DirectoryConnectSettings"} - if s.CustomerDnsIps == nil { - invalidParams.Add(request.NewErrParamRequired("CustomerDnsIps")) - } - if s.CustomerUserName == nil { - invalidParams.Add(request.NewErrParamRequired("CustomerUserName")) - } - if s.CustomerUserName != nil && len(*s.CustomerUserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomerUserName", 1)) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomerDnsIps sets the CustomerDnsIps field's value. -func (s *DirectoryConnectSettings) SetCustomerDnsIps(v []*string) *DirectoryConnectSettings { - s.CustomerDnsIps = v - return s -} - -// SetCustomerUserName sets the CustomerUserName field's value. -func (s *DirectoryConnectSettings) SetCustomerUserName(v string) *DirectoryConnectSettings { - s.CustomerUserName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *DirectoryConnectSettings) SetSubnetIds(v []*string) *DirectoryConnectSettings { - s.SubnetIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DirectoryConnectSettings) SetVpcId(v string) *DirectoryConnectSettings { - s.VpcId = &v - return s -} - -// Contains information about an AD Connector directory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DirectoryConnectSettingsDescription -type DirectoryConnectSettingsDescription struct { - _ struct{} `type:"structure"` - - // A list of the Availability Zones that the directory is in. - AvailabilityZones []*string `type:"list"` - - // The IP addresses of the AD Connector servers. - ConnectIps []*string `type:"list"` - - // The username of the service account in the on-premises directory. - CustomerUserName *string `min:"1" type:"string"` - - // The security group identifier for the AD Connector directory. - SecurityGroupId *string `type:"string"` - - // A list of subnet identifiers in the VPC that the AD connector is in. - SubnetIds []*string `type:"list"` - - // The identifier of the VPC that the AD Connector is in. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s DirectoryConnectSettingsDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DirectoryConnectSettingsDescription) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DirectoryConnectSettingsDescription) SetAvailabilityZones(v []*string) *DirectoryConnectSettingsDescription { - s.AvailabilityZones = v - return s -} - -// SetConnectIps sets the ConnectIps field's value. -func (s *DirectoryConnectSettingsDescription) SetConnectIps(v []*string) *DirectoryConnectSettingsDescription { - s.ConnectIps = v - return s -} - -// SetCustomerUserName sets the CustomerUserName field's value. -func (s *DirectoryConnectSettingsDescription) SetCustomerUserName(v string) *DirectoryConnectSettingsDescription { - s.CustomerUserName = &v - return s -} - -// SetSecurityGroupId sets the SecurityGroupId field's value. -func (s *DirectoryConnectSettingsDescription) SetSecurityGroupId(v string) *DirectoryConnectSettingsDescription { - s.SecurityGroupId = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *DirectoryConnectSettingsDescription) SetSubnetIds(v []*string) *DirectoryConnectSettingsDescription { - s.SubnetIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DirectoryConnectSettingsDescription) SetVpcId(v string) *DirectoryConnectSettingsDescription { - s.VpcId = &v - return s -} - -// Contains information about an AWS Directory Service directory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DirectoryDescription -type DirectoryDescription struct { - _ struct{} `type:"structure"` - - // The access URL for the directory, such as http://.awsapps.com. If - // no alias has been created for the directory, is the directory identifier, - // such as d-XXXXXXXXXX. - AccessUrl *string `min:"1" type:"string"` - - // The alias for the directory. If no alias has been created for the directory, - // the alias is the directory identifier, such as d-XXXXXXXXXX. - Alias *string `min:"1" type:"string"` - - // A DirectoryConnectSettingsDescription object that contains additional information - // about an AD Connector directory. This member is only present if the directory - // is an AD Connector directory. - ConnectSettings *DirectoryConnectSettingsDescription `type:"structure"` - - // The textual description for the directory. - Description *string `type:"string"` - - // The directory identifier. - DirectoryId *string `type:"string"` - - // The IP addresses of the DNS servers for the directory. For a Simple AD or - // Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft - // AD directory servers. For an AD Connector directory, these are the IP addresses - // of the DNS servers or domain controllers in the on-premises directory to - // which the AD Connector is connected. - DnsIpAddrs []*string `type:"list"` - - // Specifies when the directory was created. - LaunchTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The fully-qualified name of the directory. - Name *string `type:"string"` - - // A RadiusSettings object that contains information about the RADIUS server - // configured for this directory. - RadiusSettings *RadiusSettings `type:"structure"` - - // The status of the RADIUS MFA server connection. - RadiusStatus *string `type:"string" enum:"RadiusStatus"` - - // The short name of the directory. - ShortName *string `type:"string"` - - // The directory size. - Size *string `type:"string" enum:"DirectorySize"` - - // Indicates if single-sign on is enabled for the directory. For more information, - // see EnableSso and DisableSso. - SsoEnabled *bool `type:"boolean"` - - // The current stage of the directory. - Stage *string `type:"string" enum:"DirectoryStage"` - - // The date and time that the stage was last updated. - StageLastUpdatedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Additional information about the directory stage. - StageReason *string `type:"string"` - - // The directory size. - Type *string `type:"string" enum:"DirectoryType"` - - // A DirectoryVpcSettingsDescription object that contains additional information - // about a directory. This member is only present if the directory is a Simple - // AD or Managed AD directory. - VpcSettings *DirectoryVpcSettingsDescription `type:"structure"` -} - -// String returns the string representation -func (s DirectoryDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DirectoryDescription) GoString() string { - return s.String() -} - -// SetAccessUrl sets the AccessUrl field's value. -func (s *DirectoryDescription) SetAccessUrl(v string) *DirectoryDescription { - s.AccessUrl = &v - return s -} - -// SetAlias sets the Alias field's value. -func (s *DirectoryDescription) SetAlias(v string) *DirectoryDescription { - s.Alias = &v - return s -} - -// SetConnectSettings sets the ConnectSettings field's value. -func (s *DirectoryDescription) SetConnectSettings(v *DirectoryConnectSettingsDescription) *DirectoryDescription { - s.ConnectSettings = v - return s -} - -// SetDescription sets the Description field's value. -func (s *DirectoryDescription) SetDescription(v string) *DirectoryDescription { - s.Description = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DirectoryDescription) SetDirectoryId(v string) *DirectoryDescription { - s.DirectoryId = &v - return s -} - -// SetDnsIpAddrs sets the DnsIpAddrs field's value. -func (s *DirectoryDescription) SetDnsIpAddrs(v []*string) *DirectoryDescription { - s.DnsIpAddrs = v - return s -} - -// SetLaunchTime sets the LaunchTime field's value. -func (s *DirectoryDescription) SetLaunchTime(v time.Time) *DirectoryDescription { - s.LaunchTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *DirectoryDescription) SetName(v string) *DirectoryDescription { - s.Name = &v - return s -} - -// SetRadiusSettings sets the RadiusSettings field's value. -func (s *DirectoryDescription) SetRadiusSettings(v *RadiusSettings) *DirectoryDescription { - s.RadiusSettings = v - return s -} - -// SetRadiusStatus sets the RadiusStatus field's value. -func (s *DirectoryDescription) SetRadiusStatus(v string) *DirectoryDescription { - s.RadiusStatus = &v - return s -} - -// SetShortName sets the ShortName field's value. -func (s *DirectoryDescription) SetShortName(v string) *DirectoryDescription { - s.ShortName = &v - return s -} - -// SetSize sets the Size field's value. -func (s *DirectoryDescription) SetSize(v string) *DirectoryDescription { - s.Size = &v - return s -} - -// SetSsoEnabled sets the SsoEnabled field's value. -func (s *DirectoryDescription) SetSsoEnabled(v bool) *DirectoryDescription { - s.SsoEnabled = &v - return s -} - -// SetStage sets the Stage field's value. -func (s *DirectoryDescription) SetStage(v string) *DirectoryDescription { - s.Stage = &v - return s -} - -// SetStageLastUpdatedDateTime sets the StageLastUpdatedDateTime field's value. -func (s *DirectoryDescription) SetStageLastUpdatedDateTime(v time.Time) *DirectoryDescription { - s.StageLastUpdatedDateTime = &v - return s -} - -// SetStageReason sets the StageReason field's value. -func (s *DirectoryDescription) SetStageReason(v string) *DirectoryDescription { - s.StageReason = &v - return s -} - -// SetType sets the Type field's value. -func (s *DirectoryDescription) SetType(v string) *DirectoryDescription { - s.Type = &v - return s -} - -// SetVpcSettings sets the VpcSettings field's value. -func (s *DirectoryDescription) SetVpcSettings(v *DirectoryVpcSettingsDescription) *DirectoryDescription { - s.VpcSettings = v - return s -} - -// Contains directory limit information for a region. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DirectoryLimits -type DirectoryLimits struct { - _ struct{} `type:"structure"` - - // The current number of cloud directories in the region. - CloudOnlyDirectoriesCurrentCount *int64 `type:"integer"` - - // The maximum number of cloud directories allowed in the region. - CloudOnlyDirectoriesLimit *int64 `type:"integer"` - - // Indicates if the cloud directory limit has been reached. - CloudOnlyDirectoriesLimitReached *bool `type:"boolean"` - - // The current number of Microsoft AD directories in the region. - CloudOnlyMicrosoftADCurrentCount *int64 `type:"integer"` - - // The maximum number of Microsoft AD directories allowed in the region. - CloudOnlyMicrosoftADLimit *int64 `type:"integer"` - - // Indicates if the Microsoft AD directory limit has been reached. - CloudOnlyMicrosoftADLimitReached *bool `type:"boolean"` - - // The current number of connected directories in the region. - ConnectedDirectoriesCurrentCount *int64 `type:"integer"` - - // The maximum number of connected directories allowed in the region. - ConnectedDirectoriesLimit *int64 `type:"integer"` - - // Indicates if the connected directory limit has been reached. - ConnectedDirectoriesLimitReached *bool `type:"boolean"` -} - -// String returns the string representation -func (s DirectoryLimits) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DirectoryLimits) GoString() string { - return s.String() -} - -// SetCloudOnlyDirectoriesCurrentCount sets the CloudOnlyDirectoriesCurrentCount field's value. -func (s *DirectoryLimits) SetCloudOnlyDirectoriesCurrentCount(v int64) *DirectoryLimits { - s.CloudOnlyDirectoriesCurrentCount = &v - return s -} - -// SetCloudOnlyDirectoriesLimit sets the CloudOnlyDirectoriesLimit field's value. -func (s *DirectoryLimits) SetCloudOnlyDirectoriesLimit(v int64) *DirectoryLimits { - s.CloudOnlyDirectoriesLimit = &v - return s -} - -// SetCloudOnlyDirectoriesLimitReached sets the CloudOnlyDirectoriesLimitReached field's value. -func (s *DirectoryLimits) SetCloudOnlyDirectoriesLimitReached(v bool) *DirectoryLimits { - s.CloudOnlyDirectoriesLimitReached = &v - return s -} - -// SetCloudOnlyMicrosoftADCurrentCount sets the CloudOnlyMicrosoftADCurrentCount field's value. -func (s *DirectoryLimits) SetCloudOnlyMicrosoftADCurrentCount(v int64) *DirectoryLimits { - s.CloudOnlyMicrosoftADCurrentCount = &v - return s -} - -// SetCloudOnlyMicrosoftADLimit sets the CloudOnlyMicrosoftADLimit field's value. -func (s *DirectoryLimits) SetCloudOnlyMicrosoftADLimit(v int64) *DirectoryLimits { - s.CloudOnlyMicrosoftADLimit = &v - return s -} - -// SetCloudOnlyMicrosoftADLimitReached sets the CloudOnlyMicrosoftADLimitReached field's value. -func (s *DirectoryLimits) SetCloudOnlyMicrosoftADLimitReached(v bool) *DirectoryLimits { - s.CloudOnlyMicrosoftADLimitReached = &v - return s -} - -// SetConnectedDirectoriesCurrentCount sets the ConnectedDirectoriesCurrentCount field's value. -func (s *DirectoryLimits) SetConnectedDirectoriesCurrentCount(v int64) *DirectoryLimits { - s.ConnectedDirectoriesCurrentCount = &v - return s -} - -// SetConnectedDirectoriesLimit sets the ConnectedDirectoriesLimit field's value. -func (s *DirectoryLimits) SetConnectedDirectoriesLimit(v int64) *DirectoryLimits { - s.ConnectedDirectoriesLimit = &v - return s -} - -// SetConnectedDirectoriesLimitReached sets the ConnectedDirectoriesLimitReached field's value. -func (s *DirectoryLimits) SetConnectedDirectoriesLimitReached(v bool) *DirectoryLimits { - s.ConnectedDirectoriesLimitReached = &v - return s -} - -// Contains VPC information for the CreateDirectory or CreateMicrosoftAD operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DirectoryVpcSettings -type DirectoryVpcSettings struct { - _ struct{} `type:"structure"` - - // The identifiers of the subnets for the directory servers. The two subnets - // must be in different Availability Zones. AWS Directory Service creates a - // directory server and a DNS server in each of these subnets. - // - // SubnetIds is a required field - SubnetIds []*string `type:"list" required:"true"` - - // The identifier of the VPC in which to create the directory. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DirectoryVpcSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DirectoryVpcSettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DirectoryVpcSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DirectoryVpcSettings"} - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *DirectoryVpcSettings) SetSubnetIds(v []*string) *DirectoryVpcSettings { - s.SubnetIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DirectoryVpcSettings) SetVpcId(v string) *DirectoryVpcSettings { - s.VpcId = &v - return s -} - -// Contains information about the directory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DirectoryVpcSettingsDescription -type DirectoryVpcSettingsDescription struct { - _ struct{} `type:"structure"` - - // The list of Availability Zones that the directory is in. - AvailabilityZones []*string `type:"list"` - - // The security group identifier for the directory. If the directory was created - // before 8/1/2014, this is the identifier of the directory members security - // group that was created when the directory was created. If the directory was - // created after this date, this value is null. - SecurityGroupId *string `type:"string"` - - // The identifiers of the subnets for the directory servers. - SubnetIds []*string `type:"list"` - - // The identifier of the VPC that the directory is in. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s DirectoryVpcSettingsDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DirectoryVpcSettingsDescription) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DirectoryVpcSettingsDescription) SetAvailabilityZones(v []*string) *DirectoryVpcSettingsDescription { - s.AvailabilityZones = v - return s -} - -// SetSecurityGroupId sets the SecurityGroupId field's value. -func (s *DirectoryVpcSettingsDescription) SetSecurityGroupId(v string) *DirectoryVpcSettingsDescription { - s.SecurityGroupId = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *DirectoryVpcSettingsDescription) SetSubnetIds(v []*string) *DirectoryVpcSettingsDescription { - s.SubnetIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DirectoryVpcSettingsDescription) SetVpcId(v string) *DirectoryVpcSettingsDescription { - s.VpcId = &v - return s -} - -// Contains the inputs for the DisableRadius operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableRadiusRequest -type DisableRadiusInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory for which to disable MFA. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableRadiusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableRadiusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableRadiusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableRadiusInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DisableRadiusInput) SetDirectoryId(v string) *DisableRadiusInput { - s.DirectoryId = &v - return s -} - -// Contains the results of the DisableRadius operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableRadiusResult -type DisableRadiusOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableRadiusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableRadiusOutput) GoString() string { - return s.String() -} - -// Contains the inputs for the DisableSso operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableSsoRequest -type DisableSsoInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory for which to disable single-sign on. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The password of an alternate account to use to disable single-sign on. This - // is only used for AD Connector directories. For more information, see the - // UserName parameter. - Password *string `min:"1" type:"string"` - - // The username of an alternate account to use to disable single-sign on. This - // is only used for AD Connector directories. This account must have privileges - // to remove a service principal name. - // - // If the AD Connector service account does not have privileges to remove a - // service principal name, you can specify an alternate account with the UserName - // and Password parameters. These credentials are only used to disable single - // sign-on and are not stored by the service. The AD Connector service account - // is not changed. - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DisableSsoInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableSsoInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableSsoInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableSsoInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.Password != nil && len(*s.Password) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Password", 1)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DisableSsoInput) SetDirectoryId(v string) *DisableSsoInput { - s.DirectoryId = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *DisableSsoInput) SetPassword(v string) *DisableSsoInput { - s.Password = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *DisableSsoInput) SetUserName(v string) *DisableSsoInput { - s.UserName = &v - return s -} - -// Contains the results of the DisableSso operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableSsoResult -type DisableSsoOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableSsoOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableSsoOutput) GoString() string { - return s.String() -} - -// Contains the inputs for the EnableRadius operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableRadiusRequest -type EnableRadiusInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory for which to enable MFA. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // A RadiusSettings object that contains information about the RADIUS server. - // - // RadiusSettings is a required field - RadiusSettings *RadiusSettings `type:"structure" required:"true"` -} - -// String returns the string representation -func (s EnableRadiusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableRadiusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableRadiusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableRadiusInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.RadiusSettings == nil { - invalidParams.Add(request.NewErrParamRequired("RadiusSettings")) - } - if s.RadiusSettings != nil { - if err := s.RadiusSettings.Validate(); err != nil { - invalidParams.AddNested("RadiusSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *EnableRadiusInput) SetDirectoryId(v string) *EnableRadiusInput { - s.DirectoryId = &v - return s -} - -// SetRadiusSettings sets the RadiusSettings field's value. -func (s *EnableRadiusInput) SetRadiusSettings(v *RadiusSettings) *EnableRadiusInput { - s.RadiusSettings = v - return s -} - -// Contains the results of the EnableRadius operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableRadiusResult -type EnableRadiusOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableRadiusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableRadiusOutput) GoString() string { - return s.String() -} - -// Contains the inputs for the EnableSso operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableSsoRequest -type EnableSsoInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory for which to enable single-sign on. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The password of an alternate account to use to enable single-sign on. This - // is only used for AD Connector directories. For more information, see the - // UserName parameter. - Password *string `min:"1" type:"string"` - - // The username of an alternate account to use to enable single-sign on. This - // is only used for AD Connector directories. This account must have privileges - // to add a service principal name. - // - // If the AD Connector service account does not have privileges to add a service - // principal name, you can specify an alternate account with the UserName and - // Password parameters. These credentials are only used to enable single sign-on - // and are not stored by the service. The AD Connector service account is not - // changed. - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EnableSsoInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableSsoInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableSsoInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableSsoInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.Password != nil && len(*s.Password) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Password", 1)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *EnableSsoInput) SetDirectoryId(v string) *EnableSsoInput { - s.DirectoryId = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *EnableSsoInput) SetPassword(v string) *EnableSsoInput { - s.Password = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *EnableSsoInput) SetUserName(v string) *EnableSsoInput { - s.UserName = &v - return s -} - -// Contains the results of the EnableSso operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableSsoResult -type EnableSsoOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableSsoOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableSsoOutput) GoString() string { - return s.String() -} - -// Information about SNS topic and AWS Directory Service directory associations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EventTopic -type EventTopic struct { - _ struct{} `type:"structure"` - - // The date and time of when you associated your directory with the SNS topic. - CreatedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The Directory ID of an AWS Directory Service directory that will publish - // status messages to an SNS topic. - DirectoryId *string `type:"string"` - - // The topic registration status. - Status *string `type:"string" enum:"TopicStatus"` - - // The SNS topic ARN (Amazon Resource Name). - TopicArn *string `type:"string"` - - // The name of an AWS SNS topic the receives status messages from the directory. - TopicName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EventTopic) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventTopic) GoString() string { - return s.String() -} - -// SetCreatedDateTime sets the CreatedDateTime field's value. -func (s *EventTopic) SetCreatedDateTime(v time.Time) *EventTopic { - s.CreatedDateTime = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *EventTopic) SetDirectoryId(v string) *EventTopic { - s.DirectoryId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EventTopic) SetStatus(v string) *EventTopic { - s.Status = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *EventTopic) SetTopicArn(v string) *EventTopic { - s.TopicArn = &v - return s -} - -// SetTopicName sets the TopicName field's value. -func (s *EventTopic) SetTopicName(v string) *EventTopic { - s.TopicName = &v - return s -} - -// Contains the inputs for the GetDirectoryLimits operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetDirectoryLimitsRequest -type GetDirectoryLimitsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetDirectoryLimitsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDirectoryLimitsInput) GoString() string { - return s.String() -} - -// Contains the results of the GetDirectoryLimits operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetDirectoryLimitsResult -type GetDirectoryLimitsOutput struct { - _ struct{} `type:"structure"` - - // A DirectoryLimits object that contains the directory limits for the current - // region. - DirectoryLimits *DirectoryLimits `type:"structure"` -} - -// String returns the string representation -func (s GetDirectoryLimitsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDirectoryLimitsOutput) GoString() string { - return s.String() -} - -// SetDirectoryLimits sets the DirectoryLimits field's value. -func (s *GetDirectoryLimitsOutput) SetDirectoryLimits(v *DirectoryLimits) *GetDirectoryLimitsOutput { - s.DirectoryLimits = v - return s -} - -// Contains the inputs for the GetSnapshotLimits operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetSnapshotLimitsRequest -type GetSnapshotLimitsInput struct { - _ struct{} `type:"structure"` - - // Contains the identifier of the directory to obtain the limits for. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSnapshotLimitsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSnapshotLimitsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSnapshotLimitsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSnapshotLimitsInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *GetSnapshotLimitsInput) SetDirectoryId(v string) *GetSnapshotLimitsInput { - s.DirectoryId = &v - return s -} - -// Contains the results of the GetSnapshotLimits operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetSnapshotLimitsResult -type GetSnapshotLimitsOutput struct { - _ struct{} `type:"structure"` - - // A SnapshotLimits object that contains the manual snapshot limits for the - // specified directory. - SnapshotLimits *SnapshotLimits `type:"structure"` -} - -// String returns the string representation -func (s GetSnapshotLimitsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSnapshotLimitsOutput) GoString() string { - return s.String() -} - -// SetSnapshotLimits sets the SnapshotLimits field's value. -func (s *GetSnapshotLimitsOutput) SetSnapshotLimits(v *SnapshotLimits) *GetSnapshotLimitsOutput { - s.SnapshotLimits = v - return s -} - -// IP address block. This is often the address block of the DNS server used -// for your on-premises domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/IpRoute -type IpRoute struct { - _ struct{} `type:"structure"` - - // IP address block using CIDR format, for example 10.0.0.0/24. This is often - // the address block of the DNS server used for your on-premises domain. For - // a single IP address use a CIDR address block with /32. For example 10.0.0.0/32. - CidrIp *string `type:"string"` - - // Description of the address block. - Description *string `type:"string"` -} - -// String returns the string representation -func (s IpRoute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IpRoute) GoString() string { - return s.String() -} - -// SetCidrIp sets the CidrIp field's value. -func (s *IpRoute) SetCidrIp(v string) *IpRoute { - s.CidrIp = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *IpRoute) SetDescription(v string) *IpRoute { - s.Description = &v - return s -} - -// Information about one or more IP address blocks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/IpRouteInfo -type IpRouteInfo struct { - _ struct{} `type:"structure"` - - // The date and time the address block was added to the directory. - AddedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // IP address block in the IpRoute. - CidrIp *string `type:"string"` - - // Description of the IpRouteInfo. - Description *string `type:"string"` - - // Identifier (ID) of the directory associated with the IP addresses. - DirectoryId *string `type:"string"` - - // The status of the IP address block. - IpRouteStatusMsg *string `type:"string" enum:"IpRouteStatusMsg"` - - // The reason for the IpRouteStatusMsg. - IpRouteStatusReason *string `type:"string"` -} - -// String returns the string representation -func (s IpRouteInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IpRouteInfo) GoString() string { - return s.String() -} - -// SetAddedDateTime sets the AddedDateTime field's value. -func (s *IpRouteInfo) SetAddedDateTime(v time.Time) *IpRouteInfo { - s.AddedDateTime = &v - return s -} - -// SetCidrIp sets the CidrIp field's value. -func (s *IpRouteInfo) SetCidrIp(v string) *IpRouteInfo { - s.CidrIp = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *IpRouteInfo) SetDescription(v string) *IpRouteInfo { - s.Description = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *IpRouteInfo) SetDirectoryId(v string) *IpRouteInfo { - s.DirectoryId = &v - return s -} - -// SetIpRouteStatusMsg sets the IpRouteStatusMsg field's value. -func (s *IpRouteInfo) SetIpRouteStatusMsg(v string) *IpRouteInfo { - s.IpRouteStatusMsg = &v - return s -} - -// SetIpRouteStatusReason sets the IpRouteStatusReason field's value. -func (s *IpRouteInfo) SetIpRouteStatusReason(v string) *IpRouteInfo { - s.IpRouteStatusReason = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListIpRoutesRequest -type ListIpRoutesInput struct { - _ struct{} `type:"structure"` - - // Identifier (ID) of the directory for which you want to retrieve the IP addresses. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // Maximum number of items to return. If this value is zero, the maximum number - // of items is specified by the limitations of the operation. - Limit *int64 `type:"integer"` - - // The ListIpRoutes.NextToken value from a previous call to ListIpRoutes. Pass - // null if this is the first call. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListIpRoutesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListIpRoutesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIpRoutesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIpRoutesInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *ListIpRoutesInput) SetDirectoryId(v string) *ListIpRoutesInput { - s.DirectoryId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListIpRoutesInput) SetLimit(v int64) *ListIpRoutesInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIpRoutesInput) SetNextToken(v string) *ListIpRoutesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListIpRoutesResult -type ListIpRoutesOutput struct { - _ struct{} `type:"structure"` - - // A list of IpRoutes. - IpRoutesInfo []*IpRouteInfo `type:"list"` - - // If not null, more results are available. Pass this value for the NextToken - // parameter in a subsequent call to ListIpRoutes to retrieve the next set of - // items. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListIpRoutesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListIpRoutesOutput) GoString() string { - return s.String() -} - -// SetIpRoutesInfo sets the IpRoutesInfo field's value. -func (s *ListIpRoutesOutput) SetIpRoutesInfo(v []*IpRouteInfo) *ListIpRoutesOutput { - s.IpRoutesInfo = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIpRoutesOutput) SetNextToken(v string) *ListIpRoutesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListSchemaExtensionsRequest -type ListSchemaExtensionsInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory from which to retrieve the schema extension - // information. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The maximum number of items to return. - Limit *int64 `type:"integer"` - - // The ListSchemaExtensions.NextToken value from a previous call to ListSchemaExtensions. - // Pass null if this is the first call. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListSchemaExtensionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSchemaExtensionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSchemaExtensionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSchemaExtensionsInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *ListSchemaExtensionsInput) SetDirectoryId(v string) *ListSchemaExtensionsInput { - s.DirectoryId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListSchemaExtensionsInput) SetLimit(v int64) *ListSchemaExtensionsInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSchemaExtensionsInput) SetNextToken(v string) *ListSchemaExtensionsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListSchemaExtensionsResult -type ListSchemaExtensionsOutput struct { - _ struct{} `type:"structure"` - - // If not null, more results are available. Pass this value for the NextToken - // parameter in a subsequent call to ListSchemaExtensions to retrieve the next - // set of items. - NextToken *string `type:"string"` - - // Information about the schema extensions applied to the directory. - SchemaExtensionsInfo []*SchemaExtensionInfo `type:"list"` -} - -// String returns the string representation -func (s ListSchemaExtensionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSchemaExtensionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSchemaExtensionsOutput) SetNextToken(v string) *ListSchemaExtensionsOutput { - s.NextToken = &v - return s -} - -// SetSchemaExtensionsInfo sets the SchemaExtensionsInfo field's value. -func (s *ListSchemaExtensionsOutput) SetSchemaExtensionsInfo(v []*SchemaExtensionInfo) *ListSchemaExtensionsOutput { - s.SchemaExtensionsInfo = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListTagsForResourceRequest -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - Limit *int64 `type:"integer"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // Identifier (ID) of the directory for which you want to retrieve tags. - // - // ResourceId is a required field - ResourceId *string `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.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListTagsForResourceInput) SetLimit(v int64) *ListTagsForResourceInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { - s.NextToken = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ListTagsForResourceInput) SetResourceId(v string) *ListTagsForResourceInput { - s.ResourceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListTagsForResourceResult -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // List of tags returned by the ListTagsForResource operation. - Tags []*Tag `type:"list"` -} - -// 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() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { - s.NextToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Contains information about a Remote Authentication Dial In User Service (RADIUS) -// server. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RadiusSettings -type RadiusSettings struct { - _ struct{} `type:"structure"` - - // The protocol specified for your RADIUS endpoints. - AuthenticationProtocol *string `type:"string" enum:"RadiusAuthenticationProtocol"` - - // Not currently used. - DisplayLabel *string `min:"1" type:"string"` - - // The port that your RADIUS server is using for communications. Your on-premises - // network must allow inbound traffic over this port from the AWS Directory - // Service servers. - RadiusPort *int64 `min:"1025" type:"integer"` - - // The maximum number of times that communication with the RADIUS server is - // attempted. - RadiusRetries *int64 `type:"integer"` - - // An array of strings that contains the IP addresses of the RADIUS server endpoints, - // or the IP addresses of your RADIUS server load balancer. - RadiusServers []*string `type:"list"` - - // The amount of time, in seconds, to wait for the RADIUS server to respond. - RadiusTimeout *int64 `min:"1" type:"integer"` - - // Not currently used. - SharedSecret *string `min:"8" type:"string"` - - // Not currently used. - UseSameUsername *bool `type:"boolean"` -} - -// String returns the string representation -func (s RadiusSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RadiusSettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RadiusSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RadiusSettings"} - if s.DisplayLabel != nil && len(*s.DisplayLabel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayLabel", 1)) - } - if s.RadiusPort != nil && *s.RadiusPort < 1025 { - invalidParams.Add(request.NewErrParamMinValue("RadiusPort", 1025)) - } - if s.RadiusTimeout != nil && *s.RadiusTimeout < 1 { - invalidParams.Add(request.NewErrParamMinValue("RadiusTimeout", 1)) - } - if s.SharedSecret != nil && len(*s.SharedSecret) < 8 { - invalidParams.Add(request.NewErrParamMinLen("SharedSecret", 8)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthenticationProtocol sets the AuthenticationProtocol field's value. -func (s *RadiusSettings) SetAuthenticationProtocol(v string) *RadiusSettings { - s.AuthenticationProtocol = &v - return s -} - -// SetDisplayLabel sets the DisplayLabel field's value. -func (s *RadiusSettings) SetDisplayLabel(v string) *RadiusSettings { - s.DisplayLabel = &v - return s -} - -// SetRadiusPort sets the RadiusPort field's value. -func (s *RadiusSettings) SetRadiusPort(v int64) *RadiusSettings { - s.RadiusPort = &v - return s -} - -// SetRadiusRetries sets the RadiusRetries field's value. -func (s *RadiusSettings) SetRadiusRetries(v int64) *RadiusSettings { - s.RadiusRetries = &v - return s -} - -// SetRadiusServers sets the RadiusServers field's value. -func (s *RadiusSettings) SetRadiusServers(v []*string) *RadiusSettings { - s.RadiusServers = v - return s -} - -// SetRadiusTimeout sets the RadiusTimeout field's value. -func (s *RadiusSettings) SetRadiusTimeout(v int64) *RadiusSettings { - s.RadiusTimeout = &v - return s -} - -// SetSharedSecret sets the SharedSecret field's value. -func (s *RadiusSettings) SetSharedSecret(v string) *RadiusSettings { - s.SharedSecret = &v - return s -} - -// SetUseSameUsername sets the UseSameUsername field's value. -func (s *RadiusSettings) SetUseSameUsername(v bool) *RadiusSettings { - s.UseSameUsername = &v - return s -} - -// Registers a new event topic. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RegisterEventTopicRequest -type RegisterEventTopicInput struct { - _ struct{} `type:"structure"` - - // The Directory ID that will publish status messages to the SNS topic. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The SNS topic name to which the directory will publish status messages. This - // SNS topic must be in the same region as the specified Directory ID. - // - // TopicName is a required field - TopicName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterEventTopicInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterEventTopicInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterEventTopicInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterEventTopicInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.TopicName == nil { - invalidParams.Add(request.NewErrParamRequired("TopicName")) - } - if s.TopicName != nil && len(*s.TopicName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *RegisterEventTopicInput) SetDirectoryId(v string) *RegisterEventTopicInput { - s.DirectoryId = &v - return s -} - -// SetTopicName sets the TopicName field's value. -func (s *RegisterEventTopicInput) SetTopicName(v string) *RegisterEventTopicInput { - s.TopicName = &v - return s -} - -// The result of a RegisterEventTopic request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RegisterEventTopicResult -type RegisterEventTopicOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RegisterEventTopicOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterEventTopicOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveIpRoutesRequest -type RemoveIpRoutesInput struct { - _ struct{} `type:"structure"` - - // IP address blocks that you want to remove. - // - // CidrIps is a required field - CidrIps []*string `type:"list" required:"true"` - - // Identifier (ID) of the directory from which you want to remove the IP addresses. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveIpRoutesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveIpRoutesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveIpRoutesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveIpRoutesInput"} - if s.CidrIps == nil { - invalidParams.Add(request.NewErrParamRequired("CidrIps")) - } - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrIps sets the CidrIps field's value. -func (s *RemoveIpRoutesInput) SetCidrIps(v []*string) *RemoveIpRoutesInput { - s.CidrIps = v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *RemoveIpRoutesInput) SetDirectoryId(v string) *RemoveIpRoutesInput { - s.DirectoryId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveIpRoutesResult -type RemoveIpRoutesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveIpRoutesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveIpRoutesOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveTagsFromResourceRequest -type RemoveTagsFromResourceInput struct { - _ struct{} `type:"structure"` - - // Identifier (ID) of the directory from which to remove the tag. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // The tag key (name) of the tag to be removed. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *RemoveTagsFromResourceInput) SetResourceId(v string) *RemoveTagsFromResourceInput { - s.ResourceId = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsFromResourceInput) SetTagKeys(v []*string) *RemoveTagsFromResourceInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveTagsFromResourceResult -type RemoveTagsFromResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceOutput) GoString() string { - return s.String() -} - -// An object representing the inputs for the RestoreFromSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RestoreFromSnapshotRequest -type RestoreFromSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of the snapshot to restore from. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RestoreFromSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreFromSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreFromSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreFromSnapshotInput"} - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *RestoreFromSnapshotInput) SetSnapshotId(v string) *RestoreFromSnapshotInput { - s.SnapshotId = &v - return s -} - -// Contains the results of the RestoreFromSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RestoreFromSnapshotResult -type RestoreFromSnapshotOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RestoreFromSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreFromSnapshotOutput) GoString() string { - return s.String() -} - -// Information about a schema extension. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/SchemaExtensionInfo -type SchemaExtensionInfo struct { - _ struct{} `type:"structure"` - - // A description of the schema extension. - Description *string `type:"string"` - - // The identifier of the directory to which the schema extension is applied. - DirectoryId *string `type:"string"` - - // The date and time that the schema extension was completed. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The identifier of the schema extension. - SchemaExtensionId *string `type:"string"` - - // The current status of the schema extension. - SchemaExtensionStatus *string `type:"string" enum:"SchemaExtensionStatus"` - - // The reason for the SchemaExtensionStatus. - SchemaExtensionStatusReason *string `type:"string"` - - // The date and time that the schema extension started being applied to the - // directory. - StartDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s SchemaExtensionInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SchemaExtensionInfo) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SchemaExtensionInfo) SetDescription(v string) *SchemaExtensionInfo { - s.Description = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *SchemaExtensionInfo) SetDirectoryId(v string) *SchemaExtensionInfo { - s.DirectoryId = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *SchemaExtensionInfo) SetEndDateTime(v time.Time) *SchemaExtensionInfo { - s.EndDateTime = &v - return s -} - -// SetSchemaExtensionId sets the SchemaExtensionId field's value. -func (s *SchemaExtensionInfo) SetSchemaExtensionId(v string) *SchemaExtensionInfo { - s.SchemaExtensionId = &v - return s -} - -// SetSchemaExtensionStatus sets the SchemaExtensionStatus field's value. -func (s *SchemaExtensionInfo) SetSchemaExtensionStatus(v string) *SchemaExtensionInfo { - s.SchemaExtensionStatus = &v - return s -} - -// SetSchemaExtensionStatusReason sets the SchemaExtensionStatusReason field's value. -func (s *SchemaExtensionInfo) SetSchemaExtensionStatusReason(v string) *SchemaExtensionInfo { - s.SchemaExtensionStatusReason = &v - return s -} - -// SetStartDateTime sets the StartDateTime field's value. -func (s *SchemaExtensionInfo) SetStartDateTime(v time.Time) *SchemaExtensionInfo { - s.StartDateTime = &v - return s -} - -// Describes a directory snapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/Snapshot -type Snapshot struct { - _ struct{} `type:"structure"` - - // The directory identifier. - DirectoryId *string `type:"string"` - - // The descriptive name of the snapshot. - Name *string `type:"string"` - - // The snapshot identifier. - SnapshotId *string `type:"string"` - - // The date and time that the snapshot was taken. - StartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The snapshot status. - Status *string `type:"string" enum:"SnapshotStatus"` - - // The snapshot type. - Type *string `type:"string" enum:"SnapshotType"` -} - -// 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() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *Snapshot) SetDirectoryId(v string) *Snapshot { - s.DirectoryId = &v - return s -} - -// SetName sets the Name field's value. -func (s *Snapshot) SetName(v string) *Snapshot { - s.Name = &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 -} - -// SetStatus sets the Status field's value. -func (s *Snapshot) SetStatus(v string) *Snapshot { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *Snapshot) SetType(v string) *Snapshot { - s.Type = &v - return s -} - -// Contains manual snapshot limit information for a directory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/SnapshotLimits -type SnapshotLimits struct { - _ struct{} `type:"structure"` - - // The current number of manual snapshots of the directory. - ManualSnapshotsCurrentCount *int64 `type:"integer"` - - // The maximum number of manual snapshots allowed. - ManualSnapshotsLimit *int64 `type:"integer"` - - // Indicates if the manual snapshot limit has been reached. - ManualSnapshotsLimitReached *bool `type:"boolean"` -} - -// String returns the string representation -func (s SnapshotLimits) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotLimits) GoString() string { - return s.String() -} - -// SetManualSnapshotsCurrentCount sets the ManualSnapshotsCurrentCount field's value. -func (s *SnapshotLimits) SetManualSnapshotsCurrentCount(v int64) *SnapshotLimits { - s.ManualSnapshotsCurrentCount = &v - return s -} - -// SetManualSnapshotsLimit sets the ManualSnapshotsLimit field's value. -func (s *SnapshotLimits) SetManualSnapshotsLimit(v int64) *SnapshotLimits { - s.ManualSnapshotsLimit = &v - return s -} - -// SetManualSnapshotsLimitReached sets the ManualSnapshotsLimitReached field's value. -func (s *SnapshotLimits) SetManualSnapshotsLimitReached(v bool) *SnapshotLimits { - s.ManualSnapshotsLimitReached = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/StartSchemaExtensionRequest -type StartSchemaExtensionInput struct { - _ struct{} `type:"structure"` - - // If true, creates a snapshot of the directory before applying the schema extension. - // - // CreateSnapshotBeforeSchemaExtension is a required field - CreateSnapshotBeforeSchemaExtension *bool `type:"boolean" required:"true"` - - // A description of the schema extension. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // The identifier of the directory for which the schema extension will be applied - // to. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The LDIF file represented as a string. To construct the LdifContent string, - // precede each line as it would be formatted in an ldif file with \n. See the - // example request below for more details. The file size can be no larger than - // 1MB. - // - // LdifContent is a required field - LdifContent *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartSchemaExtensionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartSchemaExtensionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartSchemaExtensionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartSchemaExtensionInput"} - if s.CreateSnapshotBeforeSchemaExtension == nil { - invalidParams.Add(request.NewErrParamRequired("CreateSnapshotBeforeSchemaExtension")) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.LdifContent == nil { - invalidParams.Add(request.NewErrParamRequired("LdifContent")) - } - if s.LdifContent != nil && len(*s.LdifContent) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LdifContent", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreateSnapshotBeforeSchemaExtension sets the CreateSnapshotBeforeSchemaExtension field's value. -func (s *StartSchemaExtensionInput) SetCreateSnapshotBeforeSchemaExtension(v bool) *StartSchemaExtensionInput { - s.CreateSnapshotBeforeSchemaExtension = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *StartSchemaExtensionInput) SetDescription(v string) *StartSchemaExtensionInput { - s.Description = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *StartSchemaExtensionInput) SetDirectoryId(v string) *StartSchemaExtensionInput { - s.DirectoryId = &v - return s -} - -// SetLdifContent sets the LdifContent field's value. -func (s *StartSchemaExtensionInput) SetLdifContent(v string) *StartSchemaExtensionInput { - s.LdifContent = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/StartSchemaExtensionResult -type StartSchemaExtensionOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the schema extension that will be applied. - SchemaExtensionId *string `type:"string"` -} - -// String returns the string representation -func (s StartSchemaExtensionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartSchemaExtensionOutput) GoString() string { - return s.String() -} - -// SetSchemaExtensionId sets the SchemaExtensionId field's value. -func (s *StartSchemaExtensionOutput) SetSchemaExtensionId(v string) *StartSchemaExtensionOutput { - s.SchemaExtensionId = &v - return s -} - -// Metadata assigned to a directory consisting of a key-value pair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // Required name of the tag. The string value can be Unicode characters and - // cannot be prefixed with "aws:". The string can contain only the set of Unicode - // letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"). - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The optional value of the tag. The string value can be Unicode characters. - // The string can contain only the set of Unicode letters, digits, white-space, - // '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"). - // - // 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 -} - -// Describes a trust relationship between an Microsoft AD in the AWS cloud and -// an external domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/Trust -type Trust struct { - _ struct{} `type:"structure"` - - // The date and time that the trust relationship was created. - CreatedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The Directory ID of the AWS directory involved in the trust relationship. - DirectoryId *string `type:"string"` - - // The date and time that the trust relationship was last updated. - LastUpdatedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The Fully Qualified Domain Name (FQDN) of the external domain involved in - // the trust relationship. - RemoteDomainName *string `type:"string"` - - // The date and time that the TrustState was last updated. - StateLastUpdatedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The trust relationship direction. - TrustDirection *string `type:"string" enum:"TrustDirection"` - - // The unique ID of the trust relationship. - TrustId *string `type:"string"` - - // The trust relationship state. - TrustState *string `type:"string" enum:"TrustState"` - - // The reason for the TrustState. - TrustStateReason *string `type:"string"` - - // The trust relationship type. - TrustType *string `type:"string" enum:"TrustType"` -} - -// String returns the string representation -func (s Trust) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Trust) GoString() string { - return s.String() -} - -// SetCreatedDateTime sets the CreatedDateTime field's value. -func (s *Trust) SetCreatedDateTime(v time.Time) *Trust { - s.CreatedDateTime = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *Trust) SetDirectoryId(v string) *Trust { - s.DirectoryId = &v - return s -} - -// SetLastUpdatedDateTime sets the LastUpdatedDateTime field's value. -func (s *Trust) SetLastUpdatedDateTime(v time.Time) *Trust { - s.LastUpdatedDateTime = &v - return s -} - -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *Trust) SetRemoteDomainName(v string) *Trust { - s.RemoteDomainName = &v - return s -} - -// SetStateLastUpdatedDateTime sets the StateLastUpdatedDateTime field's value. -func (s *Trust) SetStateLastUpdatedDateTime(v time.Time) *Trust { - s.StateLastUpdatedDateTime = &v - return s -} - -// SetTrustDirection sets the TrustDirection field's value. -func (s *Trust) SetTrustDirection(v string) *Trust { - s.TrustDirection = &v - return s -} - -// SetTrustId sets the TrustId field's value. -func (s *Trust) SetTrustId(v string) *Trust { - s.TrustId = &v - return s -} - -// SetTrustState sets the TrustState field's value. -func (s *Trust) SetTrustState(v string) *Trust { - s.TrustState = &v - return s -} - -// SetTrustStateReason sets the TrustStateReason field's value. -func (s *Trust) SetTrustStateReason(v string) *Trust { - s.TrustStateReason = &v - return s -} - -// SetTrustType sets the TrustType field's value. -func (s *Trust) SetTrustType(v string) *Trust { - s.TrustType = &v - return s -} - -// Updates a conditional forwarder. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateConditionalForwarderRequest -type UpdateConditionalForwarderInput struct { - _ struct{} `type:"structure"` - - // The directory ID of the AWS directory for which to update the conditional - // forwarder. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // The updated IP addresses of the remote DNS server associated with the conditional - // forwarder. - // - // DnsIpAddrs is a required field - DnsIpAddrs []*string `type:"list" required:"true"` - - // The fully qualified domain name (FQDN) of the remote domain with which you - // will set up a trust relationship. - // - // RemoteDomainName is a required field - RemoteDomainName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateConditionalForwarderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateConditionalForwarderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateConditionalForwarderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateConditionalForwarderInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.DnsIpAddrs == nil { - invalidParams.Add(request.NewErrParamRequired("DnsIpAddrs")) - } - if s.RemoteDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("RemoteDomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *UpdateConditionalForwarderInput) SetDirectoryId(v string) *UpdateConditionalForwarderInput { - s.DirectoryId = &v - return s -} - -// SetDnsIpAddrs sets the DnsIpAddrs field's value. -func (s *UpdateConditionalForwarderInput) SetDnsIpAddrs(v []*string) *UpdateConditionalForwarderInput { - s.DnsIpAddrs = v - return s -} - -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *UpdateConditionalForwarderInput) SetRemoteDomainName(v string) *UpdateConditionalForwarderInput { - s.RemoteDomainName = &v - return s -} - -// The result of an UpdateConditionalForwarder request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateConditionalForwarderResult -type UpdateConditionalForwarderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateConditionalForwarderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateConditionalForwarderOutput) GoString() string { - return s.String() -} - -// Contains the inputs for the UpdateRadius operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateRadiusRequest -type UpdateRadiusInput struct { - _ struct{} `type:"structure"` - - // The identifier of the directory for which to update the RADIUS server information. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // A RadiusSettings object that contains information about the RADIUS server. - // - // RadiusSettings is a required field - RadiusSettings *RadiusSettings `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateRadiusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRadiusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRadiusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRadiusInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.RadiusSettings == nil { - invalidParams.Add(request.NewErrParamRequired("RadiusSettings")) - } - if s.RadiusSettings != nil { - if err := s.RadiusSettings.Validate(); err != nil { - invalidParams.AddNested("RadiusSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *UpdateRadiusInput) SetDirectoryId(v string) *UpdateRadiusInput { - s.DirectoryId = &v - return s -} - -// SetRadiusSettings sets the RadiusSettings field's value. -func (s *UpdateRadiusInput) SetRadiusSettings(v *RadiusSettings) *UpdateRadiusInput { - s.RadiusSettings = v - return s -} - -// Contains the results of the UpdateRadius operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateRadiusResult -type UpdateRadiusOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateRadiusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRadiusOutput) GoString() string { - return s.String() -} - -// Initiates the verification of an existing trust relationship between a Microsoft -// AD in the AWS cloud and an external domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/VerifyTrustRequest -type VerifyTrustInput struct { - _ struct{} `type:"structure"` - - // The unique Trust ID of the trust relationship to verify. - // - // TrustId is a required field - TrustId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s VerifyTrustInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyTrustInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyTrustInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyTrustInput"} - if s.TrustId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTrustId sets the TrustId field's value. -func (s *VerifyTrustInput) SetTrustId(v string) *VerifyTrustInput { - s.TrustId = &v - return s -} - -// Result of a VerifyTrust request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/VerifyTrustResult -type VerifyTrustOutput struct { - _ struct{} `type:"structure"` - - // The unique Trust ID of the trust relationship that was verified. - TrustId *string `type:"string"` -} - -// String returns the string representation -func (s VerifyTrustOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyTrustOutput) GoString() string { - return s.String() -} - -// SetTrustId sets the TrustId field's value. -func (s *VerifyTrustOutput) SetTrustId(v string) *VerifyTrustOutput { - s.TrustId = &v - return s -} - -const ( - // DirectorySizeSmall is a DirectorySize enum value - DirectorySizeSmall = "Small" - - // DirectorySizeLarge is a DirectorySize enum value - DirectorySizeLarge = "Large" -) - -const ( - // DirectoryStageRequested is a DirectoryStage enum value - DirectoryStageRequested = "Requested" - - // DirectoryStageCreating is a DirectoryStage enum value - DirectoryStageCreating = "Creating" - - // DirectoryStageCreated is a DirectoryStage enum value - DirectoryStageCreated = "Created" - - // DirectoryStageActive is a DirectoryStage enum value - DirectoryStageActive = "Active" - - // DirectoryStageInoperable is a DirectoryStage enum value - DirectoryStageInoperable = "Inoperable" - - // DirectoryStageImpaired is a DirectoryStage enum value - DirectoryStageImpaired = "Impaired" - - // DirectoryStageRestoring is a DirectoryStage enum value - DirectoryStageRestoring = "Restoring" - - // DirectoryStageRestoreFailed is a DirectoryStage enum value - DirectoryStageRestoreFailed = "RestoreFailed" - - // DirectoryStageDeleting is a DirectoryStage enum value - DirectoryStageDeleting = "Deleting" - - // DirectoryStageDeleted is a DirectoryStage enum value - DirectoryStageDeleted = "Deleted" - - // DirectoryStageFailed is a DirectoryStage enum value - DirectoryStageFailed = "Failed" -) - -const ( - // DirectoryTypeSimpleAd is a DirectoryType enum value - DirectoryTypeSimpleAd = "SimpleAD" - - // DirectoryTypeAdconnector is a DirectoryType enum value - DirectoryTypeAdconnector = "ADConnector" - - // DirectoryTypeMicrosoftAd is a DirectoryType enum value - DirectoryTypeMicrosoftAd = "MicrosoftAD" -) - -const ( - // IpRouteStatusMsgAdding is a IpRouteStatusMsg enum value - IpRouteStatusMsgAdding = "Adding" - - // IpRouteStatusMsgAdded is a IpRouteStatusMsg enum value - IpRouteStatusMsgAdded = "Added" - - // IpRouteStatusMsgRemoving is a IpRouteStatusMsg enum value - IpRouteStatusMsgRemoving = "Removing" - - // IpRouteStatusMsgRemoved is a IpRouteStatusMsg enum value - IpRouteStatusMsgRemoved = "Removed" - - // IpRouteStatusMsgAddFailed is a IpRouteStatusMsg enum value - IpRouteStatusMsgAddFailed = "AddFailed" - - // IpRouteStatusMsgRemoveFailed is a IpRouteStatusMsg enum value - IpRouteStatusMsgRemoveFailed = "RemoveFailed" -) - -const ( - // RadiusAuthenticationProtocolPap is a RadiusAuthenticationProtocol enum value - RadiusAuthenticationProtocolPap = "PAP" - - // RadiusAuthenticationProtocolChap is a RadiusAuthenticationProtocol enum value - RadiusAuthenticationProtocolChap = "CHAP" - - // RadiusAuthenticationProtocolMsChapv1 is a RadiusAuthenticationProtocol enum value - RadiusAuthenticationProtocolMsChapv1 = "MS-CHAPv1" - - // RadiusAuthenticationProtocolMsChapv2 is a RadiusAuthenticationProtocol enum value - RadiusAuthenticationProtocolMsChapv2 = "MS-CHAPv2" -) - -const ( - // RadiusStatusCreating is a RadiusStatus enum value - RadiusStatusCreating = "Creating" - - // RadiusStatusCompleted is a RadiusStatus enum value - RadiusStatusCompleted = "Completed" - - // RadiusStatusFailed is a RadiusStatus enum value - RadiusStatusFailed = "Failed" -) - -const ( - // ReplicationScopeDomain is a ReplicationScope enum value - ReplicationScopeDomain = "Domain" -) - -const ( - // SchemaExtensionStatusInitializing is a SchemaExtensionStatus enum value - SchemaExtensionStatusInitializing = "Initializing" - - // SchemaExtensionStatusCreatingSnapshot is a SchemaExtensionStatus enum value - SchemaExtensionStatusCreatingSnapshot = "CreatingSnapshot" - - // SchemaExtensionStatusUpdatingSchema is a SchemaExtensionStatus enum value - SchemaExtensionStatusUpdatingSchema = "UpdatingSchema" - - // SchemaExtensionStatusReplicating is a SchemaExtensionStatus enum value - SchemaExtensionStatusReplicating = "Replicating" - - // SchemaExtensionStatusCancelInProgress is a SchemaExtensionStatus enum value - SchemaExtensionStatusCancelInProgress = "CancelInProgress" - - // SchemaExtensionStatusRollbackInProgress is a SchemaExtensionStatus enum value - SchemaExtensionStatusRollbackInProgress = "RollbackInProgress" - - // SchemaExtensionStatusCancelled is a SchemaExtensionStatus enum value - SchemaExtensionStatusCancelled = "Cancelled" - - // SchemaExtensionStatusFailed is a SchemaExtensionStatus enum value - SchemaExtensionStatusFailed = "Failed" - - // SchemaExtensionStatusCompleted is a SchemaExtensionStatus enum value - SchemaExtensionStatusCompleted = "Completed" -) - -const ( - // SnapshotStatusCreating is a SnapshotStatus enum value - SnapshotStatusCreating = "Creating" - - // SnapshotStatusCompleted is a SnapshotStatus enum value - SnapshotStatusCompleted = "Completed" - - // SnapshotStatusFailed is a SnapshotStatus enum value - SnapshotStatusFailed = "Failed" -) - -const ( - // SnapshotTypeAuto is a SnapshotType enum value - SnapshotTypeAuto = "Auto" - - // SnapshotTypeManual is a SnapshotType enum value - SnapshotTypeManual = "Manual" -) - -const ( - // TopicStatusRegistered is a TopicStatus enum value - TopicStatusRegistered = "Registered" - - // TopicStatusTopicnotfound is a TopicStatus enum value - TopicStatusTopicnotfound = "Topic not found" - - // TopicStatusFailed is a TopicStatus enum value - TopicStatusFailed = "Failed" - - // TopicStatusDeleted is a TopicStatus enum value - TopicStatusDeleted = "Deleted" -) - -const ( - // TrustDirectionOneWayOutgoing is a TrustDirection enum value - TrustDirectionOneWayOutgoing = "One-Way: Outgoing" - - // TrustDirectionOneWayIncoming is a TrustDirection enum value - TrustDirectionOneWayIncoming = "One-Way: Incoming" - - // TrustDirectionTwoWay is a TrustDirection enum value - TrustDirectionTwoWay = "Two-Way" -) - -const ( - // TrustStateCreating is a TrustState enum value - TrustStateCreating = "Creating" - - // TrustStateCreated is a TrustState enum value - TrustStateCreated = "Created" - - // TrustStateVerifying is a TrustState enum value - TrustStateVerifying = "Verifying" - - // TrustStateVerifyFailed is a TrustState enum value - TrustStateVerifyFailed = "VerifyFailed" - - // TrustStateVerified is a TrustState enum value - TrustStateVerified = "Verified" - - // TrustStateDeleting is a TrustState enum value - TrustStateDeleting = "Deleting" - - // TrustStateDeleted is a TrustState enum value - TrustStateDeleted = "Deleted" - - // TrustStateFailed is a TrustState enum value - TrustStateFailed = "Failed" -) - -const ( - // TrustTypeForest is a TrustType enum value - TrustTypeForest = "Forest" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go deleted file mode 100644 index d8d9fa5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go +++ /dev/null @@ -1,95 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package directoryservice - -const ( - - // ErrCodeAuthenticationFailedException for service response error code - // "AuthenticationFailedException". - // - // An authentication error occurred. - ErrCodeAuthenticationFailedException = "AuthenticationFailedException" - - // ErrCodeClientException for service response error code - // "ClientException". - // - // A client exception has occurred. - ErrCodeClientException = "ClientException" - - // ErrCodeDirectoryLimitExceededException for service response error code - // "DirectoryLimitExceededException". - // - // The maximum number of directories in the region has been reached. You can - // use the GetDirectoryLimits operation to determine your directory limits in - // the region. - ErrCodeDirectoryLimitExceededException = "DirectoryLimitExceededException" - - // ErrCodeDirectoryUnavailableException for service response error code - // "DirectoryUnavailableException". - // - // The specified directory is unavailable or could not be found. - ErrCodeDirectoryUnavailableException = "DirectoryUnavailableException" - - // ErrCodeEntityAlreadyExistsException for service response error code - // "EntityAlreadyExistsException". - // - // The specified entity already exists. - ErrCodeEntityAlreadyExistsException = "EntityAlreadyExistsException" - - // ErrCodeEntityDoesNotExistException for service response error code - // "EntityDoesNotExistException". - // - // The specified entity could not be found. - ErrCodeEntityDoesNotExistException = "EntityDoesNotExistException" - - // ErrCodeInsufficientPermissionsException for service response error code - // "InsufficientPermissionsException". - // - // The account does not have sufficient permission to perform the operation. - ErrCodeInsufficientPermissionsException = "InsufficientPermissionsException" - - // ErrCodeInvalidNextTokenException for service response error code - // "InvalidNextTokenException". - // - // The NextToken value is not valid. - ErrCodeInvalidNextTokenException = "InvalidNextTokenException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // One or more parameters are not valid. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeIpRouteLimitExceededException for service response error code - // "IpRouteLimitExceededException". - // - // The maximum allowed number of IP addresses was exceeded. The default limit - // is 100 IP address blocks. - ErrCodeIpRouteLimitExceededException = "IpRouteLimitExceededException" - - // ErrCodeServiceException for service response error code - // "ServiceException". - // - // An exception has occurred in AWS Directory Service. - ErrCodeServiceException = "ServiceException" - - // ErrCodeSnapshotLimitExceededException for service response error code - // "SnapshotLimitExceededException". - // - // The maximum number of manual snapshots for the directory has been reached. - // You can use the GetSnapshotLimits operation to determine the snapshot limits - // for a directory. - ErrCodeSnapshotLimitExceededException = "SnapshotLimitExceededException" - - // ErrCodeTagLimitExceededException for service response error code - // "TagLimitExceededException". - // - // The maximum allowed number of tags was exceeded. - ErrCodeTagLimitExceededException = "TagLimitExceededException" - - // ErrCodeUnsupportedOperationException for service response error code - // "UnsupportedOperationException". - // - // The operation is not supported. - ErrCodeUnsupportedOperationException = "UnsupportedOperationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go deleted file mode 100644 index 950ed3b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go +++ /dev/null @@ -1,105 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package directoryservice - -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" -) - -// AWS Directory Service is a web service that makes it easy for you to setup -// and run directories in the AWS cloud, or connect your AWS resources with -// an existing on-premises Microsoft Active Directory. This guide provides detailed -// information about AWS Directory Service operations, data types, parameters, -// and errors. For information about AWS Directory Services features, see AWS -// Directory Service (https://aws.amazon.com/directoryservice/) and the AWS -// Directory Service Administration Guide (http://docs.aws.amazon.com/directoryservice/latest/admin-guide/what_is.html). -// -// AWS provides SDKs that 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 AWS Directory Service -// and other AWS services. For more information about the AWS SDKs, including -// how to download and install them, see Tools for Amazon Web Services (http://aws.amazon.com/tools/). -// 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/ds-2015-04-16 -type DirectoryService 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 = "ds" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the DirectoryService 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 DirectoryService client from just a session. -// svc := directoryservice.New(mySession) -// -// // Create a DirectoryService client with additional configuration -// svc := directoryservice.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *DirectoryService { - 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) *DirectoryService { - svc := &DirectoryService{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-04-16", - JSONVersion: "1.1", - TargetPrefix: "DirectoryService_20150416", - }, - 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 DirectoryService operation and runs any -// custom request initialization. -func (c *DirectoryService) 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/api.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go deleted file mode 100644 index 55dfb23..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go +++ /dev/null @@ -1,8520 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package dynamodb provides a client for Amazon DynamoDB. -package dynamodb - -import ( - "fmt" - "time" - - "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) - err := req.Send() - return out, err -} - -// 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(p *BatchGetItemOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.BatchGetItemRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*BatchGetItemOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListTablesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTablesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTablesOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *QueryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.QueryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*QueryOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ScanOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ScanRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ScanOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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 51843cd..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go +++ /dev/null @@ -1,98 +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) { - r := retryer{} - if c.Config.MaxRetries == nil || aws.IntValue(c.Config.MaxRetries) == aws.UseServiceDefaultRetries { - r.NumMaxRetries = 10 - } else { - r.NumMaxRetries = *c.Config.MaxRetries - } - c.Retryer = r - - c.Handlers.Build.PushBack(disableCompression) - c.Handlers.Unmarshal.PushFront(validateCRC32) - } -} - -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/errors.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go deleted file mode 100644 index 05a9ee8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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/service.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go deleted file mode 100644 index b8765f0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go +++ /dev/null @@ -1,110 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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 57e1264..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go +++ /dev/null @@ -1,67 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package dynamodb - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeTable", - Delay: 20, - MaxAttempts: 25, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "Table.TableStatus", - Expected: "ACTIVE", - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "ResourceNotFoundException", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeTable", - Delay: 20, - MaxAttempts: 25, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "ResourceNotFoundException", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} 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 83191e2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ /dev/null @@ -1,54143 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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/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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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. 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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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. -// -// For more information, see Creating or Restoring 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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeInstanceStatusOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeInstanceStatusRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeInstanceStatusOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeInstancesOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeNatGatewaysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeNatGatewaysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeNatGatewaysOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeReservedInstancesModificationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedInstancesModificationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedInstancesModificationsOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeReservedInstancesOfferingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedInstancesOfferingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedInstancesOfferingsOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSnapshotsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSnapshotsOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeSpotFleetRequestsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSpotFleetRequestsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSpotFleetRequestsOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeSpotPriceHistoryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSpotPriceHistoryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSpotPriceHistoryOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeTagsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeTagsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeTagsOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeVolumeStatusOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeVolumeStatusRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeVolumeStatusOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeVolumesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeVolumesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeVolumesOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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 an Instance from a Snapshot -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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. After launch, you -// can apply tags to your running instance (requires a resource ID). 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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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 both the instance status - // check and 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 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 -} - -// 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. - 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 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 -} - -// 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 -} - -// 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/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go deleted file mode 100644 index f90fa6e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go +++ /dev/null @@ -1,3 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ec2 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 c289b5b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go +++ /dev/null @@ -1,94 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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 7917cbd..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go +++ /dev/null @@ -1,1060 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ec2 - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeBundleTasks", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "BundleTasks[].State", - Expected: "complete", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "BundleTasks[].State", - Expected: "failed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeConversionTasks", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ConversionTasks[].State", - Expected: "cancelled", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeConversionTasks", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ConversionTasks[].State", - Expected: "completed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "ConversionTasks[].State", - Expected: "cancelled", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "ConversionTasks[].State", - Expected: "cancelling", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeConversionTasks", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ConversionTasks[].State", - Expected: "deleted", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeCustomerGateways", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "CustomerGateways[].State", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CustomerGateways[].State", - Expected: "deleted", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CustomerGateways[].State", - Expected: "deleting", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeExportTasks", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ExportTasks[].State", - Expected: "cancelled", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeExportTasks", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ExportTasks[].State", - Expected: "completed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeImages", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Images[].State", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Images[].State", - Expected: "failed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeImages", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(Images[]) > `0`", - Expected: true, - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "InvalidAMIID.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 5, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(Reservations[]) > `0`", - Expected: true, - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "InvalidInstanceID.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Reservations[].Instances[].State.Name", - Expected: "running", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", - Expected: "shutting-down", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", - Expected: "stopping", - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "InvalidInstanceID.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceStatus", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "InstanceStatuses[].InstanceStatus.Status", - Expected: "ok", - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "InvalidInstanceID.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Reservations[].Instances[].State.Name", - Expected: "stopped", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", - Expected: "pending", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", - Expected: "pending", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Reservations[].Instances[].State.Name", - Expected: "stopping", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeKeyPairs", - Delay: 5, - MaxAttempts: 6, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(KeyPairs[].KeyName) > `0`", - Expected: true, - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "InvalidKeyPair.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeNatGateways", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "NatGateways[].State", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "NatGateways[].State", - Expected: "failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "NatGateways[].State", - Expected: "deleting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "NatGateways[].State", - Expected: "deleted", - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "NatGatewayNotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeNetworkInterfaces", - Delay: 20, - MaxAttempts: 10, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "NetworkInterfaces[].Status", - Expected: "available", - }, - { - State: "failure", - Matcher: "error", - Argument: "", - Expected: "InvalidNetworkInterfaceID.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "GetPasswordData", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(PasswordData) > `0`", - Expected: true, - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeSnapshots", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Snapshots[].State", - Expected: "completed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeSpotInstanceRequests", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "SpotInstanceRequests[].Status.Code", - Expected: "fulfilled", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "SpotInstanceRequests[].Status.Code", - Expected: "schedule-expired", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "SpotInstanceRequests[].Status.Code", - Expected: "canceled-before-fulfillment", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "SpotInstanceRequests[].Status.Code", - Expected: "bad-parameters", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "SpotInstanceRequests[].Status.Code", - Expected: "system-error", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeSubnets", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Subnets[].State", - Expected: "available", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceStatus", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "InstanceStatuses[].SystemStatus.Status", - Expected: "ok", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVolumes", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Volumes[].State", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Volumes[].State", - Expected: "deleted", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVolumes", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Volumes[].State", - Expected: "deleted", - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "InvalidVolume.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVolumes", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Volumes[].State", - Expected: "in-use", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Volumes[].State", - Expected: "deleted", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVpcs", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Vpcs[].State", - Expected: "available", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVpcs", - Delay: 1, - MaxAttempts: 5, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "status", - Argument: "", - Expected: 200, - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "InvalidVpcID.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVpcPeeringConnections", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "VpcPeeringConnections[].Status.Code", - Expected: "deleted", - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "InvalidVpcPeeringConnectionID.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVpcPeeringConnections", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "status", - Argument: "", - Expected: 200, - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "InvalidVpcPeeringConnectionID.NotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVpnConnections", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "VpnConnections[].State", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "VpnConnections[].State", - Expected: "deleting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "VpnConnections[].State", - Expected: "deleted", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeVpnConnections", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "VpnConnections[].State", - Expected: "deleted", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "VpnConnections[].State", - Expected: "pending", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go deleted file mode 100644 index fc46f51..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go +++ /dev/null @@ -1,3806 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package ecr provides a client for Amazon EC2 Container Registry. -package ecr - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opBatchCheckLayerAvailability = "BatchCheckLayerAvailability" - -// BatchCheckLayerAvailabilityRequest generates a "aws/request.Request" representing the -// client's request for the BatchCheckLayerAvailability operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchCheckLayerAvailability for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchCheckLayerAvailability method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchCheckLayerAvailabilityRequest method. -// req, resp := client.BatchCheckLayerAvailabilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchCheckLayerAvailability -func (c *ECR) BatchCheckLayerAvailabilityRequest(input *BatchCheckLayerAvailabilityInput) (req *request.Request, output *BatchCheckLayerAvailabilityOutput) { - op := &request.Operation{ - Name: opBatchCheckLayerAvailability, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchCheckLayerAvailabilityInput{} - } - - output = &BatchCheckLayerAvailabilityOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchCheckLayerAvailability API operation for Amazon EC2 Container Registry. -// -// Check the availability of multiple image layers in a specified registry and -// repository. -// -// This operation is used by the Amazon ECR proxy, and it is not intended for -// general use by customers for pulling and pushing images. In most cases, you -// should use the docker CLI to pull, tag, and push images. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation BatchCheckLayerAvailability for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchCheckLayerAvailability -func (c *ECR) BatchCheckLayerAvailability(input *BatchCheckLayerAvailabilityInput) (*BatchCheckLayerAvailabilityOutput, error) { - req, out := c.BatchCheckLayerAvailabilityRequest(input) - err := req.Send() - return out, err -} - -const opBatchDeleteImage = "BatchDeleteImage" - -// BatchDeleteImageRequest generates a "aws/request.Request" representing the -// client's request for the BatchDeleteImage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchDeleteImage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchDeleteImage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchDeleteImageRequest method. -// req, resp := client.BatchDeleteImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchDeleteImage -func (c *ECR) BatchDeleteImageRequest(input *BatchDeleteImageInput) (req *request.Request, output *BatchDeleteImageOutput) { - op := &request.Operation{ - Name: opBatchDeleteImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchDeleteImageInput{} - } - - output = &BatchDeleteImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchDeleteImage API operation for Amazon EC2 Container Registry. -// -// Deletes a list of specified images within a specified repository. Images -// are specified with either imageTag or imageDigest. -// -// You can remove a tag from an image by specifying the image's tag in your -// request. When you remove the last tag from an image, the image is deleted -// from your repository. -// -// You can completely delete an image (and all of its tags) by specifying the -// image's digest in your 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 EC2 Container Registry's -// API operation BatchDeleteImage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchDeleteImage -func (c *ECR) BatchDeleteImage(input *BatchDeleteImageInput) (*BatchDeleteImageOutput, error) { - req, out := c.BatchDeleteImageRequest(input) - err := req.Send() - return out, err -} - -const opBatchGetImage = "BatchGetImage" - -// BatchGetImageRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetImage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetImage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetImage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetImageRequest method. -// req, resp := client.BatchGetImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchGetImage -func (c *ECR) BatchGetImageRequest(input *BatchGetImageInput) (req *request.Request, output *BatchGetImageOutput) { - op := &request.Operation{ - Name: opBatchGetImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetImageInput{} - } - - output = &BatchGetImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetImage API operation for Amazon EC2 Container Registry. -// -// Gets detailed information for specified images within a specified repository. -// Images are specified with either imageTag or imageDigest. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation BatchGetImage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchGetImage -func (c *ECR) BatchGetImage(input *BatchGetImageInput) (*BatchGetImageOutput, error) { - req, out := c.BatchGetImageRequest(input) - err := req.Send() - return out, err -} - -const opCompleteLayerUpload = "CompleteLayerUpload" - -// CompleteLayerUploadRequest generates a "aws/request.Request" representing the -// client's request for the CompleteLayerUpload operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CompleteLayerUpload for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CompleteLayerUpload method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CompleteLayerUploadRequest method. -// req, resp := client.CompleteLayerUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CompleteLayerUpload -func (c *ECR) CompleteLayerUploadRequest(input *CompleteLayerUploadInput) (req *request.Request, output *CompleteLayerUploadOutput) { - op := &request.Operation{ - Name: opCompleteLayerUpload, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CompleteLayerUploadInput{} - } - - output = &CompleteLayerUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// CompleteLayerUpload API operation for Amazon EC2 Container Registry. -// -// Inform Amazon ECR that the image layer upload for a specified registry, repository -// name, and upload ID, has completed. You can optionally provide a sha256 digest -// of the image layer for data validation purposes. -// -// This operation is used by the Amazon ECR proxy, and it is not intended for -// general use by customers for pulling and pushing images. In most cases, you -// should use the docker CLI to pull, tag, and push images. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation CompleteLayerUpload for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ErrCodeUploadNotFoundException "UploadNotFoundException" -// The upload could not be found, or the specified upload id is not valid for -// this repository. -// -// * ErrCodeInvalidLayerException "InvalidLayerException" -// The layer digest calculation performed by Amazon ECR upon receipt of the -// image layer does not match the digest specified. -// -// * ErrCodeLayerPartTooSmallException "LayerPartTooSmallException" -// Layer parts must be at least 5 MiB in size. -// -// * ErrCodeLayerAlreadyExistsException "LayerAlreadyExistsException" -// The image layer already exists in the associated repository. -// -// * ErrCodeEmptyUploadException "EmptyUploadException" -// The specified layer upload does not contain any layer parts. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CompleteLayerUpload -func (c *ECR) CompleteLayerUpload(input *CompleteLayerUploadInput) (*CompleteLayerUploadOutput, error) { - req, out := c.CompleteLayerUploadRequest(input) - err := req.Send() - return out, err -} - -const opCreateRepository = "CreateRepository" - -// CreateRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the CreateRepository operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateRepository for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateRepository method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateRepositoryRequest method. -// req, resp := client.CreateRepositoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CreateRepository -func (c *ECR) CreateRepositoryRequest(input *CreateRepositoryInput) (req *request.Request, output *CreateRepositoryOutput) { - op := &request.Operation{ - Name: opCreateRepository, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRepositoryInput{} - } - - output = &CreateRepositoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRepository API operation for Amazon EC2 Container Registry. -// -// Creates an image repository. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation CreateRepository for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryAlreadyExistsException "RepositoryAlreadyExistsException" -// The specified repository already exists in the specified registry. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The operation did not succeed because it would have exceeded a service limit -// for your account. For more information, see Amazon ECR Default Service Limits -// (http://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html) -// in the Amazon EC2 Container Registry User Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CreateRepository -func (c *ECR) CreateRepository(input *CreateRepositoryInput) (*CreateRepositoryOutput, error) { - req, out := c.CreateRepositoryRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRepository = "DeleteRepository" - -// DeleteRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRepository operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRepository for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRepository method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRepositoryRequest method. -// req, resp := client.DeleteRepositoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepository -func (c *ECR) DeleteRepositoryRequest(input *DeleteRepositoryInput) (req *request.Request, output *DeleteRepositoryOutput) { - op := &request.Operation{ - Name: opDeleteRepository, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRepositoryInput{} - } - - output = &DeleteRepositoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteRepository API operation for Amazon EC2 Container Registry. -// -// Deletes an existing image repository. If a repository contains images, you -// must use the force option to 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 EC2 Container Registry's -// API operation DeleteRepository for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ErrCodeRepositoryNotEmptyException "RepositoryNotEmptyException" -// The specified repository contains images. To delete a repository that contains -// images, you must force the deletion with the force parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepository -func (c *ECR) DeleteRepository(input *DeleteRepositoryInput) (*DeleteRepositoryOutput, error) { - req, out := c.DeleteRepositoryRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRepositoryPolicy = "DeleteRepositoryPolicy" - -// DeleteRepositoryPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRepositoryPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRepositoryPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRepositoryPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRepositoryPolicyRequest method. -// req, resp := client.DeleteRepositoryPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepositoryPolicy -func (c *ECR) DeleteRepositoryPolicyRequest(input *DeleteRepositoryPolicyInput) (req *request.Request, output *DeleteRepositoryPolicyOutput) { - op := &request.Operation{ - Name: opDeleteRepositoryPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRepositoryPolicyInput{} - } - - output = &DeleteRepositoryPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteRepositoryPolicy API operation for Amazon EC2 Container Registry. -// -// Deletes the repository policy from a specified repository. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation DeleteRepositoryPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ErrCodeRepositoryPolicyNotFoundException "RepositoryPolicyNotFoundException" -// The specified repository and registry combination does not have an associated -// repository policy. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepositoryPolicy -func (c *ECR) DeleteRepositoryPolicy(input *DeleteRepositoryPolicyInput) (*DeleteRepositoryPolicyOutput, error) { - req, out := c.DeleteRepositoryPolicyRequest(input) - err := req.Send() - return out, err -} - -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/ecr-2015-09-21/DescribeImages -func (c *ECR) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Request, output *DescribeImagesOutput) { - op := &request.Operation{ - Name: opDescribeImages, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeImagesInput{} - } - - output = &DescribeImagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImages API operation for Amazon EC2 Container Registry. -// -// Returns metadata about the images in a repository, including image size, -// image tags, and creation date. -// -// Beginning with Docker version 1.9, the Docker client compresses image layers -// before pushing them to a V2 Docker registry. The output of the docker images -// command shows the uncompressed image size, so it may return a larger image -// size than the image sizes returned by DescribeImages. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation DescribeImages for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ErrCodeImageNotFoundException "ImageNotFoundException" -// The image requested does not exist in the specified repository. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeImages -func (c *ECR) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, error) { - req, out := c.DescribeImagesRequest(input) - err := req.Send() - return out, err -} - -// DescribeImagesPages iterates over the pages of a DescribeImages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeImages 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 DescribeImages operation. -// pageNum := 0 -// err := client.DescribeImagesPages(params, -// func(page *DescribeImagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECR) DescribeImagesPages(input *DescribeImagesInput, fn func(p *DescribeImagesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeImagesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeImagesOutput), lastPage) - }) -} - -const opDescribeRepositories = "DescribeRepositories" - -// DescribeRepositoriesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRepositories operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRepositories for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRepositories method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRepositoriesRequest method. -// req, resp := client.DescribeRepositoriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeRepositories -func (c *ECR) DescribeRepositoriesRequest(input *DescribeRepositoriesInput) (req *request.Request, output *DescribeRepositoriesOutput) { - op := &request.Operation{ - Name: opDescribeRepositories, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeRepositoriesInput{} - } - - output = &DescribeRepositoriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRepositories API operation for Amazon EC2 Container Registry. -// -// Describes image repositories in a registry. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation DescribeRepositories for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeRepositories -func (c *ECR) DescribeRepositories(input *DescribeRepositoriesInput) (*DescribeRepositoriesOutput, error) { - req, out := c.DescribeRepositoriesRequest(input) - err := req.Send() - return out, err -} - -// DescribeRepositoriesPages iterates over the pages of a DescribeRepositories operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeRepositories 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 DescribeRepositories operation. -// pageNum := 0 -// err := client.DescribeRepositoriesPages(params, -// func(page *DescribeRepositoriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECR) DescribeRepositoriesPages(input *DescribeRepositoriesInput, fn func(p *DescribeRepositoriesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeRepositoriesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeRepositoriesOutput), lastPage) - }) -} - -const opGetAuthorizationToken = "GetAuthorizationToken" - -// GetAuthorizationTokenRequest generates a "aws/request.Request" representing the -// client's request for the GetAuthorizationToken operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAuthorizationToken for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAuthorizationToken method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAuthorizationTokenRequest method. -// req, resp := client.GetAuthorizationTokenRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetAuthorizationToken -func (c *ECR) GetAuthorizationTokenRequest(input *GetAuthorizationTokenInput) (req *request.Request, output *GetAuthorizationTokenOutput) { - op := &request.Operation{ - Name: opGetAuthorizationToken, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAuthorizationTokenInput{} - } - - output = &GetAuthorizationTokenOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAuthorizationToken API operation for Amazon EC2 Container Registry. -// -// Retrieves a token that is valid for a specified registry for 12 hours. This -// command allows you to use the docker CLI to push and pull images with Amazon -// ECR. If you do not specify a registry, the default registry is assumed. -// -// The authorizationToken returned for each registry specified is a base64 encoded -// string that can be decoded and used in a docker login command to authenticate -// to a registry. The AWS CLI offers an aws ecr get-login command that simplifies -// the login process. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation GetAuthorizationToken for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetAuthorizationToken -func (c *ECR) GetAuthorizationToken(input *GetAuthorizationTokenInput) (*GetAuthorizationTokenOutput, error) { - req, out := c.GetAuthorizationTokenRequest(input) - err := req.Send() - return out, err -} - -const opGetDownloadUrlForLayer = "GetDownloadUrlForLayer" - -// GetDownloadUrlForLayerRequest generates a "aws/request.Request" representing the -// client's request for the GetDownloadUrlForLayer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDownloadUrlForLayer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDownloadUrlForLayer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDownloadUrlForLayerRequest method. -// req, resp := client.GetDownloadUrlForLayerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetDownloadUrlForLayer -func (c *ECR) GetDownloadUrlForLayerRequest(input *GetDownloadUrlForLayerInput) (req *request.Request, output *GetDownloadUrlForLayerOutput) { - op := &request.Operation{ - Name: opGetDownloadUrlForLayer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDownloadUrlForLayerInput{} - } - - output = &GetDownloadUrlForLayerOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDownloadUrlForLayer API operation for Amazon EC2 Container Registry. -// -// Retrieves the pre-signed Amazon S3 download URL corresponding to an image -// layer. You can only get URLs for image layers that are referenced in an image. -// -// This operation is used by the Amazon ECR proxy, and it is not intended for -// general use by customers for pulling and pushing images. In most cases, you -// should use the docker CLI to pull, tag, and push images. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation GetDownloadUrlForLayer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeLayersNotFoundException "LayersNotFoundException" -// The specified layers could not be found, or the specified layer is not valid -// for this repository. -// -// * ErrCodeLayerInaccessibleException "LayerInaccessibleException" -// The specified layer is not available because it is not associated with an -// image. Unassociated image layers may be cleaned up at any time. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetDownloadUrlForLayer -func (c *ECR) GetDownloadUrlForLayer(input *GetDownloadUrlForLayerInput) (*GetDownloadUrlForLayerOutput, error) { - req, out := c.GetDownloadUrlForLayerRequest(input) - err := req.Send() - return out, err -} - -const opGetRepositoryPolicy = "GetRepositoryPolicy" - -// GetRepositoryPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetRepositoryPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRepositoryPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRepositoryPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRepositoryPolicyRequest method. -// req, resp := client.GetRepositoryPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetRepositoryPolicy -func (c *ECR) GetRepositoryPolicyRequest(input *GetRepositoryPolicyInput) (req *request.Request, output *GetRepositoryPolicyOutput) { - op := &request.Operation{ - Name: opGetRepositoryPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRepositoryPolicyInput{} - } - - output = &GetRepositoryPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRepositoryPolicy API operation for Amazon EC2 Container Registry. -// -// Retrieves the repository policy for a specified repository. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation GetRepositoryPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ErrCodeRepositoryPolicyNotFoundException "RepositoryPolicyNotFoundException" -// The specified repository and registry combination does not have an associated -// repository policy. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetRepositoryPolicy -func (c *ECR) GetRepositoryPolicy(input *GetRepositoryPolicyInput) (*GetRepositoryPolicyOutput, error) { - req, out := c.GetRepositoryPolicyRequest(input) - err := req.Send() - return out, err -} - -const opInitiateLayerUpload = "InitiateLayerUpload" - -// InitiateLayerUploadRequest generates a "aws/request.Request" representing the -// client's request for the InitiateLayerUpload operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InitiateLayerUpload for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InitiateLayerUpload method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InitiateLayerUploadRequest method. -// req, resp := client.InitiateLayerUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/InitiateLayerUpload -func (c *ECR) InitiateLayerUploadRequest(input *InitiateLayerUploadInput) (req *request.Request, output *InitiateLayerUploadOutput) { - op := &request.Operation{ - Name: opInitiateLayerUpload, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InitiateLayerUploadInput{} - } - - output = &InitiateLayerUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// InitiateLayerUpload API operation for Amazon EC2 Container Registry. -// -// Notify Amazon ECR that you intend to upload an image layer. -// -// This operation is used by the Amazon ECR proxy, and it is not intended for -// general use by customers for pulling and pushing images. In most cases, you -// should use the docker CLI to pull, tag, and push images. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation InitiateLayerUpload for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/InitiateLayerUpload -func (c *ECR) InitiateLayerUpload(input *InitiateLayerUploadInput) (*InitiateLayerUploadOutput, error) { - req, out := c.InitiateLayerUploadRequest(input) - err := req.Send() - return out, err -} - -const opListImages = "ListImages" - -// ListImagesRequest generates a "aws/request.Request" representing the -// client's request for the ListImages operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListImages for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListImages method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListImagesRequest method. -// req, resp := client.ListImagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ListImages -func (c *ECR) ListImagesRequest(input *ListImagesInput) (req *request.Request, output *ListImagesOutput) { - op := &request.Operation{ - Name: opListImages, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListImagesInput{} - } - - output = &ListImagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListImages API operation for Amazon EC2 Container Registry. -// -// Lists all the image IDs for a given repository. -// -// You can filter images based on whether or not they are tagged by setting -// the tagStatus parameter to TAGGED or UNTAGGED. For example, you can filter -// your results to return only UNTAGGED images and then pipe that result to -// a BatchDeleteImage operation to delete them. Or, you can filter your results -// to return only TAGGED images to list all of the tags in your repository. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation ListImages for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ListImages -func (c *ECR) ListImages(input *ListImagesInput) (*ListImagesOutput, error) { - req, out := c.ListImagesRequest(input) - err := req.Send() - return out, err -} - -// ListImagesPages iterates over the pages of a ListImages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListImages 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 ListImages operation. -// pageNum := 0 -// err := client.ListImagesPages(params, -// func(page *ListImagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECR) ListImagesPages(input *ListImagesInput, fn func(p *ListImagesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListImagesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListImagesOutput), lastPage) - }) -} - -const opPutImage = "PutImage" - -// PutImageRequest generates a "aws/request.Request" representing the -// client's request for the PutImage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutImage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutImage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutImageRequest method. -// req, resp := client.PutImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutImage -func (c *ECR) PutImageRequest(input *PutImageInput) (req *request.Request, output *PutImageOutput) { - op := &request.Operation{ - Name: opPutImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutImageInput{} - } - - output = &PutImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutImage API operation for Amazon EC2 Container Registry. -// -// Creates or updates the image manifest and tags associated with an image. -// -// This operation is used by the Amazon ECR proxy, and it is not intended for -// general use by customers for pulling and pushing images. In most cases, you -// should use the docker CLI to pull, tag, and push images. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation PutImage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ErrCodeImageAlreadyExistsException "ImageAlreadyExistsException" -// The specified image has already been pushed, and there are no changes to -// the manifest or image tag since the last push. -// -// * ErrCodeLayersNotFoundException "LayersNotFoundException" -// The specified layers could not be found, or the specified layer is not valid -// for this repository. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The operation did not succeed because it would have exceeded a service limit -// for your account. For more information, see Amazon ECR Default Service Limits -// (http://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html) -// in the Amazon EC2 Container Registry User Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutImage -func (c *ECR) PutImage(input *PutImageInput) (*PutImageOutput, error) { - req, out := c.PutImageRequest(input) - err := req.Send() - return out, err -} - -const opSetRepositoryPolicy = "SetRepositoryPolicy" - -// SetRepositoryPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SetRepositoryPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetRepositoryPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetRepositoryPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetRepositoryPolicyRequest method. -// req, resp := client.SetRepositoryPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicy -func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) (req *request.Request, output *SetRepositoryPolicyOutput) { - op := &request.Operation{ - Name: opSetRepositoryPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetRepositoryPolicyInput{} - } - - output = &SetRepositoryPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetRepositoryPolicy API operation for Amazon EC2 Container Registry. -// -// Applies a repository policy on a specified repository to control access 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 EC2 Container Registry's -// API operation SetRepositoryPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicy -func (c *ECR) SetRepositoryPolicy(input *SetRepositoryPolicyInput) (*SetRepositoryPolicyOutput, error) { - req, out := c.SetRepositoryPolicyRequest(input) - err := req.Send() - return out, err -} - -const opUploadLayerPart = "UploadLayerPart" - -// UploadLayerPartRequest generates a "aws/request.Request" representing the -// client's request for the UploadLayerPart operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UploadLayerPart for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UploadLayerPart method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UploadLayerPartRequest method. -// req, resp := client.UploadLayerPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/UploadLayerPart -func (c *ECR) UploadLayerPartRequest(input *UploadLayerPartInput) (req *request.Request, output *UploadLayerPartOutput) { - op := &request.Operation{ - Name: opUploadLayerPart, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UploadLayerPartInput{} - } - - output = &UploadLayerPartOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadLayerPart API operation for Amazon EC2 Container Registry. -// -// Uploads an image layer part to Amazon ECR. -// -// This operation is used by the Amazon ECR proxy, and it is not intended for -// general use by customers for pulling and pushing images. In most cases, you -// should use the docker CLI to pull, tag, and push images. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation UploadLayerPart for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server-side issue. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeInvalidLayerPartException "InvalidLayerPartException" -// The layer part size is not valid, or the first byte specified is not consecutive -// to the last byte of a previous layer part upload. -// -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ErrCodeUploadNotFoundException "UploadNotFoundException" -// The upload could not be found, or the specified upload id is not valid for -// this repository. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The operation did not succeed because it would have exceeded a service limit -// for your account. For more information, see Amazon ECR Default Service Limits -// (http://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html) -// in the Amazon EC2 Container Registry User Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/UploadLayerPart -func (c *ECR) UploadLayerPart(input *UploadLayerPartInput) (*UploadLayerPartOutput, error) { - req, out := c.UploadLayerPartRequest(input) - err := req.Send() - return out, err -} - -// An object representing authorization data for an Amazon ECR registry. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/AuthorizationData -type AuthorizationData struct { - _ struct{} `type:"structure"` - - // A base64-encoded string that contains authorization data for the specified - // Amazon ECR registry. When the string is decoded, it is presented in the format - // user:password for private registry authentication using docker login. - AuthorizationToken *string `locationName:"authorizationToken" type:"string"` - - // The Unix time in seconds and milliseconds when the authorization token expires. - // Authorization tokens are valid for 12 hours. - ExpiresAt *time.Time `locationName:"expiresAt" type:"timestamp" timestampFormat:"unix"` - - // The registry URL to use for this authorization token in a docker login command. - // The Amazon ECR registry URL format is https://aws_account_id.dkr.ecr.region.amazonaws.com. - // For example, https://012345678910.dkr.ecr.us-east-1.amazonaws.com.. - ProxyEndpoint *string `locationName:"proxyEndpoint" type:"string"` -} - -// String returns the string representation -func (s AuthorizationData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizationData) GoString() string { - return s.String() -} - -// SetAuthorizationToken sets the AuthorizationToken field's value. -func (s *AuthorizationData) SetAuthorizationToken(v string) *AuthorizationData { - s.AuthorizationToken = &v - return s -} - -// SetExpiresAt sets the ExpiresAt field's value. -func (s *AuthorizationData) SetExpiresAt(v time.Time) *AuthorizationData { - s.ExpiresAt = &v - return s -} - -// SetProxyEndpoint sets the ProxyEndpoint field's value. -func (s *AuthorizationData) SetProxyEndpoint(v string) *AuthorizationData { - s.ProxyEndpoint = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchCheckLayerAvailabilityRequest -type BatchCheckLayerAvailabilityInput struct { - _ struct{} `type:"structure"` - - // The digests of the image layers to check. - // - // LayerDigests is a required field - LayerDigests []*string `locationName:"layerDigests" min:"1" type:"list" required:"true"` - - // The AWS account ID associated with the registry that contains the image layers - // to check. If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository that is associated with the image layers to check. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s BatchCheckLayerAvailabilityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchCheckLayerAvailabilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchCheckLayerAvailabilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchCheckLayerAvailabilityInput"} - if s.LayerDigests == nil { - invalidParams.Add(request.NewErrParamRequired("LayerDigests")) - } - if s.LayerDigests != nil && len(s.LayerDigests) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LayerDigests", 1)) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLayerDigests sets the LayerDigests field's value. -func (s *BatchCheckLayerAvailabilityInput) SetLayerDigests(v []*string) *BatchCheckLayerAvailabilityInput { - s.LayerDigests = v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *BatchCheckLayerAvailabilityInput) SetRegistryId(v string) *BatchCheckLayerAvailabilityInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *BatchCheckLayerAvailabilityInput) SetRepositoryName(v string) *BatchCheckLayerAvailabilityInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchCheckLayerAvailabilityResponse -type BatchCheckLayerAvailabilityOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*LayerFailure `locationName:"failures" type:"list"` - - // A list of image layer objects corresponding to the image layer references - // in the request. - Layers []*Layer `locationName:"layers" type:"list"` -} - -// String returns the string representation -func (s BatchCheckLayerAvailabilityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchCheckLayerAvailabilityOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *BatchCheckLayerAvailabilityOutput) SetFailures(v []*LayerFailure) *BatchCheckLayerAvailabilityOutput { - s.Failures = v - return s -} - -// SetLayers sets the Layers field's value. -func (s *BatchCheckLayerAvailabilityOutput) SetLayers(v []*Layer) *BatchCheckLayerAvailabilityOutput { - s.Layers = v - return s -} - -// Deletes specified images within a specified repository. Images are specified -// with either the imageTag or imageDigest. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchDeleteImageRequest -type BatchDeleteImageInput struct { - _ struct{} `type:"structure"` - - // A list of image ID references that correspond to images to delete. The format - // of the imageIds reference is imageTag=tag or imageDigest=digest. - // - // ImageIds is a required field - ImageIds []*ImageIdentifier `locationName:"imageIds" min:"1" type:"list" required:"true"` - - // The AWS account ID associated with the registry that contains the image to - // delete. If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The repository that contains the image to delete. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s BatchDeleteImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchDeleteImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchDeleteImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchDeleteImageInput"} - if s.ImageIds == nil { - invalidParams.Add(request.NewErrParamRequired("ImageIds")) - } - if s.ImageIds != nil && len(s.ImageIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageIds", 1)) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImageIds sets the ImageIds field's value. -func (s *BatchDeleteImageInput) SetImageIds(v []*ImageIdentifier) *BatchDeleteImageInput { - s.ImageIds = v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *BatchDeleteImageInput) SetRegistryId(v string) *BatchDeleteImageInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *BatchDeleteImageInput) SetRepositoryName(v string) *BatchDeleteImageInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchDeleteImageResponse -type BatchDeleteImageOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*ImageFailure `locationName:"failures" type:"list"` - - // The image IDs of the deleted images. - ImageIds []*ImageIdentifier `locationName:"imageIds" min:"1" type:"list"` -} - -// String returns the string representation -func (s BatchDeleteImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchDeleteImageOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *BatchDeleteImageOutput) SetFailures(v []*ImageFailure) *BatchDeleteImageOutput { - s.Failures = v - return s -} - -// SetImageIds sets the ImageIds field's value. -func (s *BatchDeleteImageOutput) SetImageIds(v []*ImageIdentifier) *BatchDeleteImageOutput { - s.ImageIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchGetImageRequest -type BatchGetImageInput struct { - _ struct{} `type:"structure"` - - // The accepted media types for the request. - // - // Valid values: application/vnd.docker.distribution.manifest.v1+json | application/vnd.docker.distribution.manifest.v2+json - // | application/vnd.oci.image.manifest.v1+json - AcceptedMediaTypes []*string `locationName:"acceptedMediaTypes" min:"1" type:"list"` - - // A list of image ID references that correspond to images to describe. The - // format of the imageIds reference is imageTag=tag or imageDigest=digest. - // - // ImageIds is a required field - ImageIds []*ImageIdentifier `locationName:"imageIds" min:"1" type:"list" required:"true"` - - // The AWS account ID associated with the registry that contains the images - // to describe. If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The repository that contains the images to describe. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s BatchGetImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetImageInput"} - if s.AcceptedMediaTypes != nil && len(s.AcceptedMediaTypes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AcceptedMediaTypes", 1)) - } - if s.ImageIds == nil { - invalidParams.Add(request.NewErrParamRequired("ImageIds")) - } - if s.ImageIds != nil && len(s.ImageIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageIds", 1)) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAcceptedMediaTypes sets the AcceptedMediaTypes field's value. -func (s *BatchGetImageInput) SetAcceptedMediaTypes(v []*string) *BatchGetImageInput { - s.AcceptedMediaTypes = v - return s -} - -// SetImageIds sets the ImageIds field's value. -func (s *BatchGetImageInput) SetImageIds(v []*ImageIdentifier) *BatchGetImageInput { - s.ImageIds = v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *BatchGetImageInput) SetRegistryId(v string) *BatchGetImageInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *BatchGetImageInput) SetRepositoryName(v string) *BatchGetImageInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchGetImageResponse -type BatchGetImageOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*ImageFailure `locationName:"failures" type:"list"` - - // A list of image objects corresponding to the image references in the request. - Images []*Image `locationName:"images" type:"list"` -} - -// String returns the string representation -func (s BatchGetImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetImageOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *BatchGetImageOutput) SetFailures(v []*ImageFailure) *BatchGetImageOutput { - s.Failures = v - return s -} - -// SetImages sets the Images field's value. -func (s *BatchGetImageOutput) SetImages(v []*Image) *BatchGetImageOutput { - s.Images = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CompleteLayerUploadRequest -type CompleteLayerUploadInput struct { - _ struct{} `type:"structure"` - - // The sha256 digest of the image layer. - // - // LayerDigests is a required field - LayerDigests []*string `locationName:"layerDigests" min:"1" type:"list" required:"true"` - - // The AWS account ID associated with the registry to which to upload layers. - // If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository to associate with the image layer. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` - - // The upload ID from a previous InitiateLayerUpload operation to associate - // with the image layer. - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CompleteLayerUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteLayerUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CompleteLayerUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CompleteLayerUploadInput"} - if s.LayerDigests == nil { - invalidParams.Add(request.NewErrParamRequired("LayerDigests")) - } - if s.LayerDigests != nil && len(s.LayerDigests) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LayerDigests", 1)) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLayerDigests sets the LayerDigests field's value. -func (s *CompleteLayerUploadInput) SetLayerDigests(v []*string) *CompleteLayerUploadInput { - s.LayerDigests = v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *CompleteLayerUploadInput) SetRegistryId(v string) *CompleteLayerUploadInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *CompleteLayerUploadInput) SetRepositoryName(v string) *CompleteLayerUploadInput { - s.RepositoryName = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CompleteLayerUploadInput) SetUploadId(v string) *CompleteLayerUploadInput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CompleteLayerUploadResponse -type CompleteLayerUploadOutput struct { - _ struct{} `type:"structure"` - - // The sha256 digest of the image layer. - LayerDigest *string `locationName:"layerDigest" type:"string"` - - // The registry ID associated with the request. - RegistryId *string `locationName:"registryId" type:"string"` - - // The repository name associated with the request. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` - - // The upload ID associated with the layer. - UploadId *string `locationName:"uploadId" type:"string"` -} - -// String returns the string representation -func (s CompleteLayerUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteLayerUploadOutput) GoString() string { - return s.String() -} - -// SetLayerDigest sets the LayerDigest field's value. -func (s *CompleteLayerUploadOutput) SetLayerDigest(v string) *CompleteLayerUploadOutput { - s.LayerDigest = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *CompleteLayerUploadOutput) SetRegistryId(v string) *CompleteLayerUploadOutput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *CompleteLayerUploadOutput) SetRepositoryName(v string) *CompleteLayerUploadOutput { - s.RepositoryName = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CompleteLayerUploadOutput) SetUploadId(v string) *CompleteLayerUploadOutput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CreateRepositoryRequest -type CreateRepositoryInput struct { - _ struct{} `type:"structure"` - - // The name to use for the repository. The repository name may be specified - // on its own (such as nginx-web-app) or it can be prepended with a namespace - // to group the repository into a category (such as project-a/nginx-web-app). - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateRepositoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRepositoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRepositoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRepositoryInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *CreateRepositoryInput) SetRepositoryName(v string) *CreateRepositoryInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CreateRepositoryResponse -type CreateRepositoryOutput struct { - _ struct{} `type:"structure"` - - // The repository that was created. - Repository *Repository `locationName:"repository" type:"structure"` -} - -// String returns the string representation -func (s CreateRepositoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRepositoryOutput) GoString() string { - return s.String() -} - -// SetRepository sets the Repository field's value. -func (s *CreateRepositoryOutput) SetRepository(v *Repository) *CreateRepositoryOutput { - s.Repository = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepositoryRequest -type DeleteRepositoryInput struct { - _ struct{} `type:"structure"` - - // Force the deletion of the repository if it contains images. - Force *bool `locationName:"force" type:"boolean"` - - // The AWS account ID associated with the registry that contains the repository - // to delete. If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository to delete. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRepositoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRepositoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRepositoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRepositoryInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetForce sets the Force field's value. -func (s *DeleteRepositoryInput) SetForce(v bool) *DeleteRepositoryInput { - s.Force = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *DeleteRepositoryInput) SetRegistryId(v string) *DeleteRepositoryInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *DeleteRepositoryInput) SetRepositoryName(v string) *DeleteRepositoryInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepositoryResponse -type DeleteRepositoryOutput struct { - _ struct{} `type:"structure"` - - // The repository that was deleted. - Repository *Repository `locationName:"repository" type:"structure"` -} - -// String returns the string representation -func (s DeleteRepositoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRepositoryOutput) GoString() string { - return s.String() -} - -// SetRepository sets the Repository field's value. -func (s *DeleteRepositoryOutput) SetRepository(v *Repository) *DeleteRepositoryOutput { - s.Repository = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepositoryPolicyRequest -type DeleteRepositoryPolicyInput struct { - _ struct{} `type:"structure"` - - // The AWS account ID associated with the registry that contains the repository - // policy to delete. If you do not specify a registry, the default registry - // is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository that is associated with the repository policy - // to delete. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRepositoryPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRepositoryPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRepositoryPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRepositoryPolicyInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegistryId sets the RegistryId field's value. -func (s *DeleteRepositoryPolicyInput) SetRegistryId(v string) *DeleteRepositoryPolicyInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *DeleteRepositoryPolicyInput) SetRepositoryName(v string) *DeleteRepositoryPolicyInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRepositoryPolicyResponse -type DeleteRepositoryPolicyOutput struct { - _ struct{} `type:"structure"` - - // The JSON repository policy that was deleted from the repository. - PolicyText *string `locationName:"policyText" type:"string"` - - // The registry ID associated with the request. - RegistryId *string `locationName:"registryId" type:"string"` - - // The repository name associated with the request. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` -} - -// String returns the string representation -func (s DeleteRepositoryPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRepositoryPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicyText sets the PolicyText field's value. -func (s *DeleteRepositoryPolicyOutput) SetPolicyText(v string) *DeleteRepositoryPolicyOutput { - s.PolicyText = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *DeleteRepositoryPolicyOutput) SetRegistryId(v string) *DeleteRepositoryPolicyOutput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *DeleteRepositoryPolicyOutput) SetRepositoryName(v string) *DeleteRepositoryPolicyOutput { - s.RepositoryName = &v - return s -} - -// An object representing a filter on a DescribeImages operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeImagesFilter -type DescribeImagesFilter struct { - _ struct{} `type:"structure"` - - // The tag status with which to filter your DescribeImages results. You can - // filter results based on whether they are TAGGED or UNTAGGED. - TagStatus *string `locationName:"tagStatus" type:"string" enum:"TagStatus"` -} - -// String returns the string representation -func (s DescribeImagesFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImagesFilter) GoString() string { - return s.String() -} - -// SetTagStatus sets the TagStatus field's value. -func (s *DescribeImagesFilter) SetTagStatus(v string) *DescribeImagesFilter { - s.TagStatus = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeImagesRequest -type DescribeImagesInput struct { - _ struct{} `type:"structure"` - - // The filter key and value with which to filter your DescribeImages results. - Filter *DescribeImagesFilter `locationName:"filter" type:"structure"` - - // The list of image IDs for the requested repository. - ImageIds []*ImageIdentifier `locationName:"imageIds" min:"1" type:"list"` - - // The maximum number of repository results returned by DescribeImages in paginated - // output. When this parameter is used, DescribeImages 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 DescribeImages - // request with the returned nextToken value. This value can be between 1 and - // 100. If this parameter is not used, then DescribeImages returns up to 100 - // results and a nextToken value, if applicable. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The nextToken value returned from a previous paginated DescribeImages 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"` - - // The AWS account ID associated with the registry that contains the repository - // in which to describe images. If you do not specify a registry, the default - // registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // A list of repositories to describe. If this parameter is omitted, then all - // repositories in a registry are described. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeImagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeImagesInput"} - if s.ImageIds != nil && len(s.ImageIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageIds", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *DescribeImagesInput) SetFilter(v *DescribeImagesFilter) *DescribeImagesInput { - s.Filter = v - return s -} - -// SetImageIds sets the ImageIds field's value. -func (s *DescribeImagesInput) SetImageIds(v []*ImageIdentifier) *DescribeImagesInput { - s.ImageIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeImagesInput) SetMaxResults(v int64) *DescribeImagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImagesInput) SetNextToken(v string) *DescribeImagesInput { - s.NextToken = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *DescribeImagesInput) SetRegistryId(v string) *DescribeImagesInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *DescribeImagesInput) SetRepositoryName(v string) *DescribeImagesInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeImagesResponse -type DescribeImagesOutput struct { - _ struct{} `type:"structure"` - - // A list of ImageDetail objects that contain data about the image. - ImageDetails []*ImageDetail `locationName:"imageDetails" type:"list"` - - // The nextToken value to include in a future DescribeImages request. When the - // results of a DescribeImages 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"` -} - -// 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() -} - -// SetImageDetails sets the ImageDetails field's value. -func (s *DescribeImagesOutput) SetImageDetails(v []*ImageDetail) *DescribeImagesOutput { - s.ImageDetails = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImagesOutput) SetNextToken(v string) *DescribeImagesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeRepositoriesRequest -type DescribeRepositoriesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of repository results returned by DescribeRepositories - // in paginated output. When this parameter is used, DescribeRepositories 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 DescribeRepositories request with the returned nextToken value. This - // value can be between 1 and 100. If this parameter is not used, then DescribeRepositories - // returns up to 100 results and a nextToken value, if applicable. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The nextToken value returned from a previous paginated DescribeRepositories - // 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The AWS account ID associated with the registry that contains the repositories - // to be described. If you do not specify a registry, the default registry is - // assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // A list of repositories to describe. If this parameter is omitted, then all - // repositories in a registry are described. - RepositoryNames []*string `locationName:"repositoryNames" min:"1" type:"list"` -} - -// String returns the string representation -func (s DescribeRepositoriesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRepositoriesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRepositoriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRepositoriesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.RepositoryNames != nil && len(s.RepositoryNames) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryNames", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeRepositoriesInput) SetMaxResults(v int64) *DescribeRepositoriesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeRepositoriesInput) SetNextToken(v string) *DescribeRepositoriesInput { - s.NextToken = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *DescribeRepositoriesInput) SetRegistryId(v string) *DescribeRepositoriesInput { - s.RegistryId = &v - return s -} - -// SetRepositoryNames sets the RepositoryNames field's value. -func (s *DescribeRepositoriesInput) SetRepositoryNames(v []*string) *DescribeRepositoriesInput { - s.RepositoryNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeRepositoriesResponse -type DescribeRepositoriesOutput struct { - _ struct{} `type:"structure"` - - // The nextToken value to include in a future DescribeRepositories request. - // When the results of a DescribeRepositories 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"` - - // A list of repository objects corresponding to valid repositories. - Repositories []*Repository `locationName:"repositories" type:"list"` -} - -// String returns the string representation -func (s DescribeRepositoriesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRepositoriesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeRepositoriesOutput) SetNextToken(v string) *DescribeRepositoriesOutput { - s.NextToken = &v - return s -} - -// SetRepositories sets the Repositories field's value. -func (s *DescribeRepositoriesOutput) SetRepositories(v []*Repository) *DescribeRepositoriesOutput { - s.Repositories = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetAuthorizationTokenRequest -type GetAuthorizationTokenInput struct { - _ struct{} `type:"structure"` - - // A list of AWS account IDs that are associated with the registries for which - // to get authorization tokens. If you do not specify a registry, the default - // registry is assumed. - RegistryIds []*string `locationName:"registryIds" min:"1" type:"list"` -} - -// String returns the string representation -func (s GetAuthorizationTokenInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAuthorizationTokenInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAuthorizationTokenInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAuthorizationTokenInput"} - if s.RegistryIds != nil && len(s.RegistryIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RegistryIds", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegistryIds sets the RegistryIds field's value. -func (s *GetAuthorizationTokenInput) SetRegistryIds(v []*string) *GetAuthorizationTokenInput { - s.RegistryIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetAuthorizationTokenResponse -type GetAuthorizationTokenOutput struct { - _ struct{} `type:"structure"` - - // A list of authorization token data objects that correspond to the registryIds - // values in the request. - AuthorizationData []*AuthorizationData `locationName:"authorizationData" type:"list"` -} - -// String returns the string representation -func (s GetAuthorizationTokenOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAuthorizationTokenOutput) GoString() string { - return s.String() -} - -// SetAuthorizationData sets the AuthorizationData field's value. -func (s *GetAuthorizationTokenOutput) SetAuthorizationData(v []*AuthorizationData) *GetAuthorizationTokenOutput { - s.AuthorizationData = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetDownloadUrlForLayerRequest -type GetDownloadUrlForLayerInput struct { - _ struct{} `type:"structure"` - - // The digest of the image layer to download. - // - // LayerDigest is a required field - LayerDigest *string `locationName:"layerDigest" type:"string" required:"true"` - - // The AWS account ID associated with the registry that contains the image layer - // to download. If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository that is associated with the image layer to download. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDownloadUrlForLayerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDownloadUrlForLayerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDownloadUrlForLayerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDownloadUrlForLayerInput"} - if s.LayerDigest == nil { - invalidParams.Add(request.NewErrParamRequired("LayerDigest")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLayerDigest sets the LayerDigest field's value. -func (s *GetDownloadUrlForLayerInput) SetLayerDigest(v string) *GetDownloadUrlForLayerInput { - s.LayerDigest = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *GetDownloadUrlForLayerInput) SetRegistryId(v string) *GetDownloadUrlForLayerInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetDownloadUrlForLayerInput) SetRepositoryName(v string) *GetDownloadUrlForLayerInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetDownloadUrlForLayerResponse -type GetDownloadUrlForLayerOutput struct { - _ struct{} `type:"structure"` - - // The pre-signed Amazon S3 download URL for the requested layer. - DownloadUrl *string `locationName:"downloadUrl" type:"string"` - - // The digest of the image layer to download. - LayerDigest *string `locationName:"layerDigest" type:"string"` -} - -// String returns the string representation -func (s GetDownloadUrlForLayerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDownloadUrlForLayerOutput) GoString() string { - return s.String() -} - -// SetDownloadUrl sets the DownloadUrl field's value. -func (s *GetDownloadUrlForLayerOutput) SetDownloadUrl(v string) *GetDownloadUrlForLayerOutput { - s.DownloadUrl = &v - return s -} - -// SetLayerDigest sets the LayerDigest field's value. -func (s *GetDownloadUrlForLayerOutput) SetLayerDigest(v string) *GetDownloadUrlForLayerOutput { - s.LayerDigest = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetRepositoryPolicyRequest -type GetRepositoryPolicyInput struct { - _ struct{} `type:"structure"` - - // The AWS account ID associated with the registry that contains the repository. - // If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository whose policy you want to retrieve. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRepositoryPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRepositoryPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRepositoryPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRepositoryPolicyInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegistryId sets the RegistryId field's value. -func (s *GetRepositoryPolicyInput) SetRegistryId(v string) *GetRepositoryPolicyInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetRepositoryPolicyInput) SetRepositoryName(v string) *GetRepositoryPolicyInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetRepositoryPolicyResponse -type GetRepositoryPolicyOutput struct { - _ struct{} `type:"structure"` - - // The JSON repository policy text associated with the repository. - PolicyText *string `locationName:"policyText" type:"string"` - - // The registry ID associated with the request. - RegistryId *string `locationName:"registryId" type:"string"` - - // The repository name associated with the request. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` -} - -// String returns the string representation -func (s GetRepositoryPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRepositoryPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicyText sets the PolicyText field's value. -func (s *GetRepositoryPolicyOutput) SetPolicyText(v string) *GetRepositoryPolicyOutput { - s.PolicyText = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *GetRepositoryPolicyOutput) SetRegistryId(v string) *GetRepositoryPolicyOutput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetRepositoryPolicyOutput) SetRepositoryName(v string) *GetRepositoryPolicyOutput { - s.RepositoryName = &v - return s -} - -// An object representing an Amazon ECR image. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/Image -type Image struct { - _ struct{} `type:"structure"` - - // An object containing the image tag and image digest associated with an image. - ImageId *ImageIdentifier `locationName:"imageId" type:"structure"` - - // The image manifest associated with the image. - ImageManifest *string `locationName:"imageManifest" type:"string"` - - // The AWS account ID associated with the registry containing the image. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository associated with the image. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` -} - -// 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() -} - -// SetImageId sets the ImageId field's value. -func (s *Image) SetImageId(v *ImageIdentifier) *Image { - s.ImageId = v - return s -} - -// SetImageManifest sets the ImageManifest field's value. -func (s *Image) SetImageManifest(v string) *Image { - s.ImageManifest = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *Image) SetRegistryId(v string) *Image { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *Image) SetRepositoryName(v string) *Image { - s.RepositoryName = &v - return s -} - -// An object that describes an image returned by a DescribeImages operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ImageDetail -type ImageDetail struct { - _ struct{} `type:"structure"` - - // The sha256 digest of the image manifest. - ImageDigest *string `locationName:"imageDigest" type:"string"` - - // The date and time, expressed in standard JavaScript date format, at which - // the current image was pushed to the repository. - ImagePushedAt *time.Time `locationName:"imagePushedAt" type:"timestamp" timestampFormat:"unix"` - - // The size, in bytes, of the image in the repository. - // - // Beginning with Docker version 1.9, the Docker client compresses image layers - // before pushing them to a V2 Docker registry. The output of the docker images - // command shows the uncompressed image size, so it may return a larger image - // size than the image sizes returned by DescribeImages. - ImageSizeInBytes *int64 `locationName:"imageSizeInBytes" type:"long"` - - // The list of tags associated with this image. - ImageTags []*string `locationName:"imageTags" type:"list"` - - // The AWS account ID associated with the registry to which this image belongs. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository to which this image belongs. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` -} - -// String returns the string representation -func (s ImageDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImageDetail) GoString() string { - return s.String() -} - -// SetImageDigest sets the ImageDigest field's value. -func (s *ImageDetail) SetImageDigest(v string) *ImageDetail { - s.ImageDigest = &v - return s -} - -// SetImagePushedAt sets the ImagePushedAt field's value. -func (s *ImageDetail) SetImagePushedAt(v time.Time) *ImageDetail { - s.ImagePushedAt = &v - return s -} - -// SetImageSizeInBytes sets the ImageSizeInBytes field's value. -func (s *ImageDetail) SetImageSizeInBytes(v int64) *ImageDetail { - s.ImageSizeInBytes = &v - return s -} - -// SetImageTags sets the ImageTags field's value. -func (s *ImageDetail) SetImageTags(v []*string) *ImageDetail { - s.ImageTags = v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *ImageDetail) SetRegistryId(v string) *ImageDetail { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *ImageDetail) SetRepositoryName(v string) *ImageDetail { - s.RepositoryName = &v - return s -} - -// An object representing an Amazon ECR image failure. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ImageFailure -type ImageFailure struct { - _ struct{} `type:"structure"` - - // The code associated with the failure. - FailureCode *string `locationName:"failureCode" type:"string" enum:"ImageFailureCode"` - - // The reason for the failure. - FailureReason *string `locationName:"failureReason" type:"string"` - - // The image ID associated with the failure. - ImageId *ImageIdentifier `locationName:"imageId" type:"structure"` -} - -// String returns the string representation -func (s ImageFailure) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImageFailure) GoString() string { - return s.String() -} - -// SetFailureCode sets the FailureCode field's value. -func (s *ImageFailure) SetFailureCode(v string) *ImageFailure { - s.FailureCode = &v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *ImageFailure) SetFailureReason(v string) *ImageFailure { - s.FailureReason = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ImageFailure) SetImageId(v *ImageIdentifier) *ImageFailure { - s.ImageId = v - return s -} - -// An object with identifying information for an Amazon ECR image. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ImageIdentifier -type ImageIdentifier struct { - _ struct{} `type:"structure"` - - // The sha256 digest of the image manifest. - ImageDigest *string `locationName:"imageDigest" type:"string"` - - // The tag used for the image. - ImageTag *string `locationName:"imageTag" type:"string"` -} - -// String returns the string representation -func (s ImageIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImageIdentifier) GoString() string { - return s.String() -} - -// SetImageDigest sets the ImageDigest field's value. -func (s *ImageIdentifier) SetImageDigest(v string) *ImageIdentifier { - s.ImageDigest = &v - return s -} - -// SetImageTag sets the ImageTag field's value. -func (s *ImageIdentifier) SetImageTag(v string) *ImageIdentifier { - s.ImageTag = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/InitiateLayerUploadRequest -type InitiateLayerUploadInput struct { - _ struct{} `type:"structure"` - - // The AWS account ID associated with the registry that you intend to upload - // layers to. If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository that you intend to upload layers to. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s InitiateLayerUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InitiateLayerUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InitiateLayerUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InitiateLayerUploadInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegistryId sets the RegistryId field's value. -func (s *InitiateLayerUploadInput) SetRegistryId(v string) *InitiateLayerUploadInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *InitiateLayerUploadInput) SetRepositoryName(v string) *InitiateLayerUploadInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/InitiateLayerUploadResponse -type InitiateLayerUploadOutput struct { - _ struct{} `type:"structure"` - - // The size, in bytes, that Amazon ECR expects future layer part uploads to - // be. - PartSize *int64 `locationName:"partSize" type:"long"` - - // The upload ID for the layer upload. This parameter is passed to further UploadLayerPart - // and CompleteLayerUpload operations. - UploadId *string `locationName:"uploadId" type:"string"` -} - -// String returns the string representation -func (s InitiateLayerUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InitiateLayerUploadOutput) GoString() string { - return s.String() -} - -// SetPartSize sets the PartSize field's value. -func (s *InitiateLayerUploadOutput) SetPartSize(v int64) *InitiateLayerUploadOutput { - s.PartSize = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *InitiateLayerUploadOutput) SetUploadId(v string) *InitiateLayerUploadOutput { - s.UploadId = &v - return s -} - -// An object representing an Amazon ECR image layer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/Layer -type Layer struct { - _ struct{} `type:"structure"` - - // The availability status of the image layer. - LayerAvailability *string `locationName:"layerAvailability" type:"string" enum:"LayerAvailability"` - - // The sha256 digest of the image layer. - LayerDigest *string `locationName:"layerDigest" type:"string"` - - // The size, in bytes, of the image layer. - LayerSize *int64 `locationName:"layerSize" type:"long"` - - // The media type of the layer, such as application/vnd.docker.image.rootfs.diff.tar.gzip - // or application/vnd.oci.image.layer.v1.tar+gzip. - MediaType *string `locationName:"mediaType" type:"string"` -} - -// String returns the string representation -func (s Layer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Layer) GoString() string { - return s.String() -} - -// SetLayerAvailability sets the LayerAvailability field's value. -func (s *Layer) SetLayerAvailability(v string) *Layer { - s.LayerAvailability = &v - return s -} - -// SetLayerDigest sets the LayerDigest field's value. -func (s *Layer) SetLayerDigest(v string) *Layer { - s.LayerDigest = &v - return s -} - -// SetLayerSize sets the LayerSize field's value. -func (s *Layer) SetLayerSize(v int64) *Layer { - s.LayerSize = &v - return s -} - -// SetMediaType sets the MediaType field's value. -func (s *Layer) SetMediaType(v string) *Layer { - s.MediaType = &v - return s -} - -// An object representing an Amazon ECR image layer failure. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/LayerFailure -type LayerFailure struct { - _ struct{} `type:"structure"` - - // The failure code associated with the failure. - FailureCode *string `locationName:"failureCode" type:"string" enum:"LayerFailureCode"` - - // The reason for the failure. - FailureReason *string `locationName:"failureReason" type:"string"` - - // The layer digest associated with the failure. - LayerDigest *string `locationName:"layerDigest" type:"string"` -} - -// String returns the string representation -func (s LayerFailure) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LayerFailure) GoString() string { - return s.String() -} - -// SetFailureCode sets the FailureCode field's value. -func (s *LayerFailure) SetFailureCode(v string) *LayerFailure { - s.FailureCode = &v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *LayerFailure) SetFailureReason(v string) *LayerFailure { - s.FailureReason = &v - return s -} - -// SetLayerDigest sets the LayerDigest field's value. -func (s *LayerFailure) SetLayerDigest(v string) *LayerFailure { - s.LayerDigest = &v - return s -} - -// An object representing a filter on a ListImages operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ListImagesFilter -type ListImagesFilter struct { - _ struct{} `type:"structure"` - - // The tag status with which to filter your ListImages results. You can filter - // results based on whether they are TAGGED or UNTAGGED. - TagStatus *string `locationName:"tagStatus" type:"string" enum:"TagStatus"` -} - -// String returns the string representation -func (s ListImagesFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListImagesFilter) GoString() string { - return s.String() -} - -// SetTagStatus sets the TagStatus field's value. -func (s *ListImagesFilter) SetTagStatus(v string) *ListImagesFilter { - s.TagStatus = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ListImagesRequest -type ListImagesInput struct { - _ struct{} `type:"structure"` - - // The filter key and value with which to filter your ListImages results. - Filter *ListImagesFilter `locationName:"filter" type:"structure"` - - // The maximum number of image results returned by ListImages in paginated output. - // When this parameter is used, ListImages 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 ListImages request - // with the returned nextToken value. This value can be between 1 and 100. If - // this parameter is not used, then ListImages returns up to 100 results and - // a nextToken value, if applicable. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The nextToken value returned from a previous paginated ListImages 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The AWS account ID associated with the registry that contains the repository - // to list images in. If you do not specify a registry, the default registry - // is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The repository whose image IDs are to be listed. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListImagesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListImagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListImagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListImagesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListImagesInput) SetFilter(v *ListImagesFilter) *ListImagesInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListImagesInput) SetMaxResults(v int64) *ListImagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImagesInput) SetNextToken(v string) *ListImagesInput { - s.NextToken = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *ListImagesInput) SetRegistryId(v string) *ListImagesInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *ListImagesInput) SetRepositoryName(v string) *ListImagesInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ListImagesResponse -type ListImagesOutput struct { - _ struct{} `type:"structure"` - - // The list of image IDs for the requested repository. - ImageIds []*ImageIdentifier `locationName:"imageIds" min:"1" type:"list"` - - // The nextToken value to include in a future ListImages request. When the results - // of a ListImages 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"` -} - -// String returns the string representation -func (s ListImagesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListImagesOutput) GoString() string { - return s.String() -} - -// SetImageIds sets the ImageIds field's value. -func (s *ListImagesOutput) SetImageIds(v []*ImageIdentifier) *ListImagesOutput { - s.ImageIds = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImagesOutput) SetNextToken(v string) *ListImagesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutImageRequest -type PutImageInput struct { - _ struct{} `type:"structure"` - - // The image manifest corresponding to the image to be uploaded. - // - // ImageManifest is a required field - ImageManifest *string `locationName:"imageManifest" type:"string" required:"true"` - - // The tag to associate with the image. This parameter is required for images - // that use the Docker Image Manifest V2 Schema 2 or OCI formats. - ImageTag *string `locationName:"imageTag" type:"string"` - - // The AWS account ID associated with the registry that contains the repository - // in which to put the image. If you do not specify a registry, the default - // registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository in which to put the image. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutImageInput"} - if s.ImageManifest == nil { - invalidParams.Add(request.NewErrParamRequired("ImageManifest")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImageManifest sets the ImageManifest field's value. -func (s *PutImageInput) SetImageManifest(v string) *PutImageInput { - s.ImageManifest = &v - return s -} - -// SetImageTag sets the ImageTag field's value. -func (s *PutImageInput) SetImageTag(v string) *PutImageInput { - s.ImageTag = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *PutImageInput) SetRegistryId(v string) *PutImageInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *PutImageInput) SetRepositoryName(v string) *PutImageInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutImageResponse -type PutImageOutput struct { - _ struct{} `type:"structure"` - - // Details of the image uploaded. - Image *Image `locationName:"image" type:"structure"` -} - -// String returns the string representation -func (s PutImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutImageOutput) GoString() string { - return s.String() -} - -// SetImage sets the Image field's value. -func (s *PutImageOutput) SetImage(v *Image) *PutImageOutput { - s.Image = v - return s -} - -// An object representing a repository. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/Repository -type Repository struct { - _ struct{} `type:"structure"` - - // The date and time, in JavaScript date/time format, when the repository was - // created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The AWS account ID associated with the registry that contains the repository. - RegistryId *string `locationName:"registryId" type:"string"` - - // The Amazon Resource Name (ARN) that identifies the repository. The ARN contains - // the arn:aws:ecr namespace, followed by the region of the repository, the - // AWS account ID of the repository owner, the repository namespace, and then - // the repository name. For example, arn:aws:ecr:region:012345678910:repository/test. - RepositoryArn *string `locationName:"repositoryArn" type:"string"` - - // The name of the repository. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` - - // The URI for the repository. You can use this URI for Docker push and pull - // operations. - RepositoryUri *string `locationName:"repositoryUri" type:"string"` -} - -// String returns the string representation -func (s Repository) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Repository) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Repository) SetCreatedAt(v time.Time) *Repository { - s.CreatedAt = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *Repository) SetRegistryId(v string) *Repository { - s.RegistryId = &v - return s -} - -// SetRepositoryArn sets the RepositoryArn field's value. -func (s *Repository) SetRepositoryArn(v string) *Repository { - s.RepositoryArn = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *Repository) SetRepositoryName(v string) *Repository { - s.RepositoryName = &v - return s -} - -// SetRepositoryUri sets the RepositoryUri field's value. -func (s *Repository) SetRepositoryUri(v string) *Repository { - s.RepositoryUri = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicyRequest -type SetRepositoryPolicyInput struct { - _ struct{} `type:"structure"` - - // If the policy you are attempting to set on a repository policy would prevent - // you from setting another policy in the future, you must force the SetRepositoryPolicy - // operation. This is intended to prevent accidental repository lock outs. - Force *bool `locationName:"force" type:"boolean"` - - // The JSON repository policy text to apply to the repository. - // - // PolicyText is a required field - PolicyText *string `locationName:"policyText" type:"string" required:"true"` - - // The AWS account ID associated with the registry that contains the repository. - // If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository to receive the policy. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s SetRepositoryPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetRepositoryPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetRepositoryPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetRepositoryPolicyInput"} - if s.PolicyText == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyText")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetForce sets the Force field's value. -func (s *SetRepositoryPolicyInput) SetForce(v bool) *SetRepositoryPolicyInput { - s.Force = &v - return s -} - -// SetPolicyText sets the PolicyText field's value. -func (s *SetRepositoryPolicyInput) SetPolicyText(v string) *SetRepositoryPolicyInput { - s.PolicyText = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *SetRepositoryPolicyInput) SetRegistryId(v string) *SetRepositoryPolicyInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *SetRepositoryPolicyInput) SetRepositoryName(v string) *SetRepositoryPolicyInput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicyResponse -type SetRepositoryPolicyOutput struct { - _ struct{} `type:"structure"` - - // The JSON repository policy text applied to the repository. - PolicyText *string `locationName:"policyText" type:"string"` - - // The registry ID associated with the request. - RegistryId *string `locationName:"registryId" type:"string"` - - // The repository name associated with the request. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` -} - -// String returns the string representation -func (s SetRepositoryPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetRepositoryPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicyText sets the PolicyText field's value. -func (s *SetRepositoryPolicyOutput) SetPolicyText(v string) *SetRepositoryPolicyOutput { - s.PolicyText = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *SetRepositoryPolicyOutput) SetRegistryId(v string) *SetRepositoryPolicyOutput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *SetRepositoryPolicyOutput) SetRepositoryName(v string) *SetRepositoryPolicyOutput { - s.RepositoryName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/UploadLayerPartRequest -type UploadLayerPartInput struct { - _ struct{} `type:"structure"` - - // The base64-encoded layer part payload. - // - // LayerPartBlob is automatically base64 encoded/decoded by the SDK. - // - // LayerPartBlob is a required field - LayerPartBlob []byte `locationName:"layerPartBlob" type:"blob" required:"true"` - - // The integer value of the first byte of the layer part. - // - // PartFirstByte is a required field - PartFirstByte *int64 `locationName:"partFirstByte" type:"long" required:"true"` - - // The integer value of the last byte of the layer part. - // - // PartLastByte is a required field - PartLastByte *int64 `locationName:"partLastByte" type:"long" required:"true"` - - // The AWS account ID associated with the registry that you are uploading layer - // parts to. If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` - - // The name of the repository that you are uploading layer parts to. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` - - // The upload ID from a previous InitiateLayerUpload operation to associate - // with the layer part upload. - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation -func (s UploadLayerPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadLayerPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadLayerPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadLayerPartInput"} - if s.LayerPartBlob == nil { - invalidParams.Add(request.NewErrParamRequired("LayerPartBlob")) - } - if s.PartFirstByte == nil { - invalidParams.Add(request.NewErrParamRequired("PartFirstByte")) - } - if s.PartLastByte == nil { - invalidParams.Add(request.NewErrParamRequired("PartLastByte")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLayerPartBlob sets the LayerPartBlob field's value. -func (s *UploadLayerPartInput) SetLayerPartBlob(v []byte) *UploadLayerPartInput { - s.LayerPartBlob = v - return s -} - -// SetPartFirstByte sets the PartFirstByte field's value. -func (s *UploadLayerPartInput) SetPartFirstByte(v int64) *UploadLayerPartInput { - s.PartFirstByte = &v - return s -} - -// SetPartLastByte sets the PartLastByte field's value. -func (s *UploadLayerPartInput) SetPartLastByte(v int64) *UploadLayerPartInput { - s.PartLastByte = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *UploadLayerPartInput) SetRegistryId(v string) *UploadLayerPartInput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *UploadLayerPartInput) SetRepositoryName(v string) *UploadLayerPartInput { - s.RepositoryName = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UploadLayerPartInput) SetUploadId(v string) *UploadLayerPartInput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/UploadLayerPartResponse -type UploadLayerPartOutput struct { - _ struct{} `type:"structure"` - - // The integer value of the last byte received in the request. - LastByteReceived *int64 `locationName:"lastByteReceived" type:"long"` - - // The registry ID associated with the request. - RegistryId *string `locationName:"registryId" type:"string"` - - // The repository name associated with the request. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` - - // The upload ID associated with the request. - UploadId *string `locationName:"uploadId" type:"string"` -} - -// String returns the string representation -func (s UploadLayerPartOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadLayerPartOutput) GoString() string { - return s.String() -} - -// SetLastByteReceived sets the LastByteReceived field's value. -func (s *UploadLayerPartOutput) SetLastByteReceived(v int64) *UploadLayerPartOutput { - s.LastByteReceived = &v - return s -} - -// SetRegistryId sets the RegistryId field's value. -func (s *UploadLayerPartOutput) SetRegistryId(v string) *UploadLayerPartOutput { - s.RegistryId = &v - return s -} - -// SetRepositoryName sets the RepositoryName field's value. -func (s *UploadLayerPartOutput) SetRepositoryName(v string) *UploadLayerPartOutput { - s.RepositoryName = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UploadLayerPartOutput) SetUploadId(v string) *UploadLayerPartOutput { - s.UploadId = &v - return s -} - -const ( - // ImageFailureCodeInvalidImageDigest is a ImageFailureCode enum value - ImageFailureCodeInvalidImageDigest = "InvalidImageDigest" - - // ImageFailureCodeInvalidImageTag is a ImageFailureCode enum value - ImageFailureCodeInvalidImageTag = "InvalidImageTag" - - // ImageFailureCodeImageTagDoesNotMatchDigest is a ImageFailureCode enum value - ImageFailureCodeImageTagDoesNotMatchDigest = "ImageTagDoesNotMatchDigest" - - // ImageFailureCodeImageNotFound is a ImageFailureCode enum value - ImageFailureCodeImageNotFound = "ImageNotFound" - - // ImageFailureCodeMissingDigestAndTag is a ImageFailureCode enum value - ImageFailureCodeMissingDigestAndTag = "MissingDigestAndTag" -) - -const ( - // LayerAvailabilityAvailable is a LayerAvailability enum value - LayerAvailabilityAvailable = "AVAILABLE" - - // LayerAvailabilityUnavailable is a LayerAvailability enum value - LayerAvailabilityUnavailable = "UNAVAILABLE" -) - -const ( - // LayerFailureCodeInvalidLayerDigest is a LayerFailureCode enum value - LayerFailureCodeInvalidLayerDigest = "InvalidLayerDigest" - - // LayerFailureCodeMissingLayerDigest is a LayerFailureCode enum value - LayerFailureCodeMissingLayerDigest = "MissingLayerDigest" -) - -const ( - // TagStatusTagged is a TagStatus enum value - TagStatusTagged = "TAGGED" - - // TagStatusUntagged is a TagStatus enum value - TagStatusUntagged = "UNTAGGED" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go deleted file mode 100644 index c51948b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go +++ /dev/null @@ -1,121 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ecr - -const ( - - // ErrCodeEmptyUploadException for service response error code - // "EmptyUploadException". - // - // The specified layer upload does not contain any layer parts. - ErrCodeEmptyUploadException = "EmptyUploadException" - - // ErrCodeImageAlreadyExistsException for service response error code - // "ImageAlreadyExistsException". - // - // The specified image has already been pushed, and there are no changes to - // the manifest or image tag since the last push. - ErrCodeImageAlreadyExistsException = "ImageAlreadyExistsException" - - // ErrCodeImageNotFoundException for service response error code - // "ImageNotFoundException". - // - // The image requested does not exist in the specified repository. - ErrCodeImageNotFoundException = "ImageNotFoundException" - - // ErrCodeInvalidLayerException for service response error code - // "InvalidLayerException". - // - // The layer digest calculation performed by Amazon ECR upon receipt of the - // image layer does not match the digest specified. - ErrCodeInvalidLayerException = "InvalidLayerException" - - // ErrCodeInvalidLayerPartException for service response error code - // "InvalidLayerPartException". - // - // The layer part size is not valid, or the first byte specified is not consecutive - // to the last byte of a previous layer part upload. - ErrCodeInvalidLayerPartException = "InvalidLayerPartException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // The specified parameter is invalid. Review the available parameters for the - // API request. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeLayerAlreadyExistsException for service response error code - // "LayerAlreadyExistsException". - // - // The image layer already exists in the associated repository. - ErrCodeLayerAlreadyExistsException = "LayerAlreadyExistsException" - - // ErrCodeLayerInaccessibleException for service response error code - // "LayerInaccessibleException". - // - // The specified layer is not available because it is not associated with an - // image. Unassociated image layers may be cleaned up at any time. - ErrCodeLayerInaccessibleException = "LayerInaccessibleException" - - // ErrCodeLayerPartTooSmallException for service response error code - // "LayerPartTooSmallException". - // - // Layer parts must be at least 5 MiB in size. - ErrCodeLayerPartTooSmallException = "LayerPartTooSmallException" - - // ErrCodeLayersNotFoundException for service response error code - // "LayersNotFoundException". - // - // The specified layers could not be found, or the specified layer is not valid - // for this repository. - ErrCodeLayersNotFoundException = "LayersNotFoundException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // The operation did not succeed because it would have exceeded a service limit - // for your account. For more information, see Amazon ECR Default Service Limits - // (http://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html) - // in the Amazon EC2 Container Registry User Guide. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeRepositoryAlreadyExistsException for service response error code - // "RepositoryAlreadyExistsException". - // - // The specified repository already exists in the specified registry. - ErrCodeRepositoryAlreadyExistsException = "RepositoryAlreadyExistsException" - - // ErrCodeRepositoryNotEmptyException for service response error code - // "RepositoryNotEmptyException". - // - // The specified repository contains images. To delete a repository that contains - // images, you must force the deletion with the force parameter. - ErrCodeRepositoryNotEmptyException = "RepositoryNotEmptyException" - - // ErrCodeRepositoryNotFoundException for service response error code - // "RepositoryNotFoundException". - // - // The specified repository could not be found. Check the spelling of the specified - // repository and ensure that you are performing operations on the correct registry. - ErrCodeRepositoryNotFoundException = "RepositoryNotFoundException" - - // ErrCodeRepositoryPolicyNotFoundException for service response error code - // "RepositoryPolicyNotFoundException". - // - // The specified repository and registry combination does not have an associated - // repository policy. - ErrCodeRepositoryPolicyNotFoundException = "RepositoryPolicyNotFoundException" - - // ErrCodeServerException for service response error code - // "ServerException". - // - // These errors are usually caused by a server-side issue. - ErrCodeServerException = "ServerException" - - // ErrCodeUploadNotFoundException for service response error code - // "UploadNotFoundException". - // - // The upload could not be found, or the specified upload id is not valid for - // this repository. - ErrCodeUploadNotFoundException = "UploadNotFoundException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go deleted file mode 100644 index 2c7904b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go +++ /dev/null @@ -1,98 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ecr - -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 EC2 Container Registry (Amazon ECR) is a managed AWS Docker registry -// service. Customers can use the familiar Docker CLI to push, pull, and manage -// images. Amazon ECR provides a secure, scalable, and reliable registry. Amazon -// ECR supports private Docker repositories with resource-based permissions -// using AWS IAM so that specific users or Amazon EC2 instances can access repositories -// and images. Developers can use the Docker CLI to author and manage images. -// 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/ecr-2015-09-21 -type ECR 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 = "ecr" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ECR 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 ECR client from just a session. -// svc := ecr.New(mySession) -// -// // Create a ECR client with additional configuration -// svc := ecr.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ECR { - 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) *ECR { - svc := &ECR{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-09-21", - JSONVersion: "1.1", - TargetPrefix: "AmazonEC2ContainerRegistry_V20150921", - }, - 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 ECR operation and runs any -// custom request initialization. -func (c *ECR) 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/ecs/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go deleted file mode 100644 index 68ccbd5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go +++ /dev/null @@ -1,8666 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package ecs provides a client for Amazon EC2 Container Service. -package ecs - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opCreateCluster = "CreateCluster" - -// CreateClusterRequest generates a "aws/request.Request" representing the -// client's request for the CreateCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateClusterRequest method. -// req, resp := client.CreateClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateCluster -func (c *ECS) CreateClusterRequest(input *CreateClusterInput) (req *request.Request, output *CreateClusterOutput) { - op := &request.Operation{ - Name: opCreateCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateClusterInput{} - } - - output = &CreateClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCluster API operation for Amazon EC2 Container Service. -// -// Creates a new Amazon ECS cluster. By default, your account receives a default -// cluster when you launch your first container instance. However, you can create -// your own cluster with a unique name with the CreateCluster action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation CreateCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateCluster -func (c *ECS) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) { - req, out := c.CreateClusterRequest(input) - err := req.Send() - return out, err -} - -const opCreateService = "CreateService" - -// CreateServiceRequest generates a "aws/request.Request" representing the -// client's request for the CreateService operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateService for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateService method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateServiceRequest method. -// req, resp := client.CreateServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateService -func (c *ECS) CreateServiceRequest(input *CreateServiceInput) (req *request.Request, output *CreateServiceOutput) { - op := &request.Operation{ - Name: opCreateService, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateServiceInput{} - } - - output = &CreateServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateService API operation for Amazon EC2 Container Service. -// -// Runs and maintains a desired number of tasks from a specified task definition. -// If the number of tasks running in a service drops below desiredCount, Amazon -// ECS spawns another copy of the task in the specified cluster. To update an -// existing service, see UpdateService. -// -// In addition to maintaining the desired count of tasks in your service, you -// can optionally run your service behind a load balancer. The load balancer -// distributes traffic across the tasks that are associated with the service. -// For more information, see Service Load Balancing (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) -// in the Amazon EC2 Container Service Developer Guide. -// -// You can optionally specify a deployment configuration for your service. During -// a deployment (which is triggered by changing the task definition or the desired -// count of a service with an UpdateService operation), the service scheduler -// uses the minimumHealthyPercent and maximumPercent parameters to determine -// the deployment strategy. -// -// The minimumHealthyPercent represents a lower limit on the number of your -// service's tasks that must remain in the RUNNING state during a deployment, -// as a percentage of the desiredCount (rounded up to the nearest integer). -// This parameter enables you to deploy without using additional cluster capacity. -// For example, if desiredCount is four tasks and the minimum is 50%, the scheduler -// can stop two existing tasks to free up cluster capacity before starting two -// new tasks. Tasks for services that do not use a load balancer are considered -// healthy if they are in the RUNNING state. Tasks for services that use a load -// balancer are considered healthy if they are in the RUNNING state and the -// container instance they are hosted on is reported as healthy by the load -// balancer. The default value is 50% in the console and 100% for the AWS CLI, -// the AWS SDKs, and the APIs. -// -// The maximumPercent parameter represents an upper limit on the number of your -// service's tasks that are allowed in the RUNNING or PENDING state during a -// deployment, as a percentage of the desiredCount (rounded down to the nearest -// integer). This parameter enables you to define the deployment batch size. -// For example, if desiredCount is four tasks and the maximum is 200%, the scheduler -// can start four new tasks before stopping the four older tasks (provided that -// the cluster resources required to do this are available). The default value -// is 200%. -// -// When the service scheduler launches new tasks, it determines task placement -// in your cluster using the following logic: -// -// * Determine which of the container instances in your cluster can support -// your service's task definition (for example, they have the required CPU, -// memory, ports, and container instance attributes). -// -// * By default, the service scheduler attempts to balance tasks across Availability -// Zones in this manner (although you can choose a different placement strategy): -// -// Sort the valid container instances by the fewest number of running tasks -// for this service in the same Availability Zone as the instance. For example, -// if zone A has one running service task and zones B and C each have zero, -// valid container instances in either zone B or C are considered optimal -// for placement. -// -// Place the new service task on a valid container instance in an optimal Availability -// Zone (based on the previous steps), favoring container instances with -// the fewest number of running tasks for this 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 EC2 Container Service's -// API operation CreateService for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateService -func (c *ECS) CreateService(input *CreateServiceInput) (*CreateServiceOutput, error) { - req, out := c.CreateServiceRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAttributes = "DeleteAttributes" - -// DeleteAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAttributesRequest method. -// req, resp := client.DeleteAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAttributes -func (c *ECS) DeleteAttributesRequest(input *DeleteAttributesInput) (req *request.Request, output *DeleteAttributesOutput) { - op := &request.Operation{ - Name: opDeleteAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAttributesInput{} - } - - output = &DeleteAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteAttributes API operation for Amazon EC2 Container Service. -// -// Deletes one or more custom attributes from an Amazon ECS 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 EC2 Container Service's -// API operation DeleteAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeTargetNotFoundException "TargetNotFoundException" -// The specified target could not be found. You can view your available container -// instances with ListContainerInstances. Amazon ECS container instances are -// cluster-specific and region-specific. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAttributes -func (c *ECS) DeleteAttributes(input *DeleteAttributesInput) (*DeleteAttributesOutput, error) { - req, out := c.DeleteAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCluster = "DeleteCluster" - -// DeleteClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteClusterRequest method. -// req, resp := client.DeleteClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteCluster -func (c *ECS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { - op := &request.Operation{ - Name: opDeleteCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteClusterInput{} - } - - output = &DeleteClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCluster API operation for Amazon EC2 Container Service. -// -// Deletes the specified cluster. You must deregister all container instances -// from this cluster before you may delete it. You can list the container instances -// in a cluster with ListContainerInstances and deregister them with DeregisterContainerInstance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DeleteCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeClusterContainsContainerInstancesException "ClusterContainsContainerInstancesException" -// You cannot delete a cluster that has registered container instances. You -// must first deregister the container instances before you can delete the cluster. -// For more information, see DeregisterContainerInstance. -// -// * ErrCodeClusterContainsServicesException "ClusterContainsServicesException" -// You cannot delete a cluster that contains services. You must first update -// the service to reduce its desired task count to 0 and then delete the service. -// For more information, see UpdateService and DeleteService. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteCluster -func (c *ECS) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) - err := req.Send() - return out, err -} - -const opDeleteService = "DeleteService" - -// DeleteServiceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteService operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteService for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteService method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteServiceRequest method. -// req, resp := client.DeleteServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteService -func (c *ECS) DeleteServiceRequest(input *DeleteServiceInput) (req *request.Request, output *DeleteServiceOutput) { - op := &request.Operation{ - Name: opDeleteService, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteServiceInput{} - } - - output = &DeleteServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteService API operation for Amazon EC2 Container Service. -// -// Deletes a specified service within a cluster. You can delete a service if -// you have no running tasks in it and the desired task count is zero. If the -// service is actively maintaining tasks, you cannot delete it, and you must -// update the service to a desired task count of zero. For more information, -// see UpdateService. -// -// When you delete a service, if there are still running tasks that require -// cleanup, the service status moves from ACTIVE to DRAINING, and the service -// is no longer visible in the console or in ListServices API operations. After -// the tasks have stopped, then the service status moves from DRAINING to INACTIVE. -// Services in the DRAINING or INACTIVE status can still be viewed with DescribeServices -// API operations; however, in the future, INACTIVE services may be cleaned -// up and purged from Amazon ECS record keeping, and DescribeServices API operations -// on those services will return a ServiceNotFoundException 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 EC2 Container Service's -// API operation DeleteService for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" -// The specified service could not be found. You can view your available services -// with ListServices. Amazon ECS services are cluster-specific and region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteService -func (c *ECS) DeleteService(input *DeleteServiceInput) (*DeleteServiceOutput, error) { - req, out := c.DeleteServiceRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterContainerInstance = "DeregisterContainerInstance" - -// DeregisterContainerInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterContainerInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterContainerInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterContainerInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterContainerInstanceRequest method. -// req, resp := client.DeregisterContainerInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterContainerInstance -func (c *ECS) DeregisterContainerInstanceRequest(input *DeregisterContainerInstanceInput) (req *request.Request, output *DeregisterContainerInstanceOutput) { - op := &request.Operation{ - Name: opDeregisterContainerInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterContainerInstanceInput{} - } - - output = &DeregisterContainerInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterContainerInstance API operation for Amazon EC2 Container Service. -// -// Deregisters an Amazon ECS container instance from the specified cluster. -// This instance is no longer available to run tasks. -// -// If you intend to use the container instance for some other purpose after -// deregistration, you should stop all of the tasks running on the container -// instance before deregistration to avoid any orphaned tasks from consuming -// resources. -// -// Deregistering a container instance removes the instance from a cluster, but -// it does not terminate the EC2 instance; if you are finished using the instance, -// be sure to terminate it in the Amazon EC2 console to stop billing. -// -// If you terminate a running container instance, Amazon ECS automatically deregisters -// the instance from your cluster (stopped container instances or instances -// with disconnected agents are not automatically deregistered when 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 EC2 Container Service's -// API operation DeregisterContainerInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterContainerInstance -func (c *ECS) DeregisterContainerInstance(input *DeregisterContainerInstanceInput) (*DeregisterContainerInstanceOutput, error) { - req, out := c.DeregisterContainerInstanceRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterTaskDefinition = "DeregisterTaskDefinition" - -// DeregisterTaskDefinitionRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterTaskDefinition operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterTaskDefinition for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterTaskDefinition method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterTaskDefinitionRequest method. -// req, resp := client.DeregisterTaskDefinitionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterTaskDefinition -func (c *ECS) DeregisterTaskDefinitionRequest(input *DeregisterTaskDefinitionInput) (req *request.Request, output *DeregisterTaskDefinitionOutput) { - op := &request.Operation{ - Name: opDeregisterTaskDefinition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterTaskDefinitionInput{} - } - - output = &DeregisterTaskDefinitionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterTaskDefinition API operation for Amazon EC2 Container Service. -// -// Deregisters the specified task definition by family and revision. Upon deregistration, -// the task definition is marked as INACTIVE. Existing tasks and services that -// reference an INACTIVE task definition continue to run without disruption. -// Existing services that reference an INACTIVE task definition can still scale -// up or down by modifying the service's desired count. -// -// You cannot use an INACTIVE task definition to run new tasks or create new -// services, and you cannot update an existing service to reference an INACTIVE -// task definition (although there may be up to a 10 minute window following -// deregistration where these restrictions have not yet taken effect). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DeregisterTaskDefinition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterTaskDefinition -func (c *ECS) DeregisterTaskDefinition(input *DeregisterTaskDefinitionInput) (*DeregisterTaskDefinitionOutput, error) { - req, out := c.DeregisterTaskDefinitionRequest(input) - err := req.Send() - return out, err -} - -const opDescribeClusters = "DescribeClusters" - -// DescribeClustersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClusters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClusters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClustersRequest method. -// req, resp := client.DescribeClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeClusters -func (c *ECS) DescribeClustersRequest(input *DescribeClustersInput) (req *request.Request, output *DescribeClustersOutput) { - op := &request.Operation{ - Name: opDescribeClusters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeClustersInput{} - } - - output = &DescribeClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusters API operation for Amazon EC2 Container Service. -// -// Describes one or more of your clusters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeClusters -func (c *ECS) DescribeClusters(input *DescribeClustersInput) (*DescribeClustersOutput, error) { - req, out := c.DescribeClustersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeContainerInstances = "DescribeContainerInstances" - -// DescribeContainerInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeContainerInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeContainerInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeContainerInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeContainerInstancesRequest method. -// req, resp := client.DescribeContainerInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeContainerInstances -func (c *ECS) DescribeContainerInstancesRequest(input *DescribeContainerInstancesInput) (req *request.Request, output *DescribeContainerInstancesOutput) { - op := &request.Operation{ - Name: opDescribeContainerInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeContainerInstancesInput{} - } - - output = &DescribeContainerInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeContainerInstances API operation for Amazon EC2 Container Service. -// -// Describes Amazon EC2 Container Service container instances. Returns metadata -// about registered and remaining resources on each container instance requested. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeContainerInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeContainerInstances -func (c *ECS) DescribeContainerInstances(input *DescribeContainerInstancesInput) (*DescribeContainerInstancesOutput, error) { - req, out := c.DescribeContainerInstancesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeServices = "DescribeServices" - -// DescribeServicesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeServices operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeServices for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeServices method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeServicesRequest method. -// req, resp := client.DescribeServicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeServices -func (c *ECS) DescribeServicesRequest(input *DescribeServicesInput) (req *request.Request, output *DescribeServicesOutput) { - op := &request.Operation{ - Name: opDescribeServices, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeServicesInput{} - } - - output = &DescribeServicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeServices API operation for Amazon EC2 Container Service. -// -// Describes the specified services running in your cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeServices for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeServices -func (c *ECS) DescribeServices(input *DescribeServicesInput) (*DescribeServicesOutput, error) { - req, out := c.DescribeServicesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTaskDefinition = "DescribeTaskDefinition" - -// DescribeTaskDefinitionRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTaskDefinition operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTaskDefinition for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTaskDefinition method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTaskDefinitionRequest method. -// req, resp := client.DescribeTaskDefinitionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskDefinition -func (c *ECS) DescribeTaskDefinitionRequest(input *DescribeTaskDefinitionInput) (req *request.Request, output *DescribeTaskDefinitionOutput) { - op := &request.Operation{ - Name: opDescribeTaskDefinition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTaskDefinitionInput{} - } - - output = &DescribeTaskDefinitionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTaskDefinition API operation for Amazon EC2 Container Service. -// -// Describes a task definition. You can specify a family and revision to find -// information about a specific task definition, or you can simply specify the -// family to find the latest ACTIVE revision in that family. -// -// You can only describe INACTIVE task definitions while an active task or service -// references them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeTaskDefinition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskDefinition -func (c *ECS) DescribeTaskDefinition(input *DescribeTaskDefinitionInput) (*DescribeTaskDefinitionOutput, error) { - req, out := c.DescribeTaskDefinitionRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTasks = "DescribeTasks" - -// DescribeTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTasksRequest method. -// req, resp := client.DescribeTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTasks -func (c *ECS) DescribeTasksRequest(input *DescribeTasksInput) (req *request.Request, output *DescribeTasksOutput) { - op := &request.Operation{ - Name: opDescribeTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTasksInput{} - } - - output = &DescribeTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTasks API operation for Amazon EC2 Container Service. -// -// Describes a specified task or 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 EC2 Container Service's -// API operation DescribeTasks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTasks -func (c *ECS) DescribeTasks(input *DescribeTasksInput) (*DescribeTasksOutput, error) { - req, out := c.DescribeTasksRequest(input) - err := req.Send() - return out, err -} - -const opDiscoverPollEndpoint = "DiscoverPollEndpoint" - -// DiscoverPollEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DiscoverPollEndpoint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DiscoverPollEndpoint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DiscoverPollEndpoint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DiscoverPollEndpointRequest method. -// req, resp := client.DiscoverPollEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DiscoverPollEndpoint -func (c *ECS) DiscoverPollEndpointRequest(input *DiscoverPollEndpointInput) (req *request.Request, output *DiscoverPollEndpointOutput) { - op := &request.Operation{ - Name: opDiscoverPollEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DiscoverPollEndpointInput{} - } - - output = &DiscoverPollEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// DiscoverPollEndpoint API operation for Amazon EC2 Container Service. -// -// This action is only used by the Amazon EC2 Container Service agent, and it -// is not intended for use outside of the agent. -// -// Returns an endpoint for the Amazon EC2 Container Service agent to poll for -// updates. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DiscoverPollEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DiscoverPollEndpoint -func (c *ECS) DiscoverPollEndpoint(input *DiscoverPollEndpointInput) (*DiscoverPollEndpointOutput, error) { - req, out := c.DiscoverPollEndpointRequest(input) - err := req.Send() - return out, err -} - -const opListAttributes = "ListAttributes" - -// ListAttributesRequest generates a "aws/request.Request" representing the -// client's request for the ListAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAttributesRequest method. -// req, resp := client.ListAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAttributes -func (c *ECS) ListAttributesRequest(input *ListAttributesInput) (req *request.Request, output *ListAttributesOutput) { - op := &request.Operation{ - Name: opListAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAttributesInput{} - } - - output = &ListAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAttributes API operation for Amazon EC2 Container Service. -// -// Lists the attributes for Amazon ECS resources within a specified target type -// and cluster. When you specify a target type and cluster, LisAttributes returns -// a list of attribute objects, one for each attribute on each resource. You -// can filter the list of results to a single attribute name to only return -// results that have that name. You can also filter the results by attribute -// name and value, for example, to see which container instances in a cluster -// are running a Linux AMI (ecs.os-type=linux). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAttributes -func (c *ECS) ListAttributes(input *ListAttributesInput) (*ListAttributesOutput, error) { - req, out := c.ListAttributesRequest(input) - err := req.Send() - return out, err -} - -const opListClusters = "ListClusters" - -// ListClustersRequest generates a "aws/request.Request" representing the -// client's request for the ListClusters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListClusters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListClusters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListClustersRequest method. -// req, resp := client.ListClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListClusters -func (c *ECS) ListClustersRequest(input *ListClustersInput) (req *request.Request, output *ListClustersOutput) { - op := &request.Operation{ - Name: opListClusters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListClustersInput{} - } - - output = &ListClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListClusters API operation for Amazon EC2 Container Service. -// -// Returns a list of existing clusters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListClusters -func (c *ECS) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) - err := req.Send() - return out, err -} - -// ListClustersPages iterates over the pages of a ListClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListClusters 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 ListClusters operation. -// pageNum := 0 -// err := client.ListClustersPages(params, -// func(page *ListClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListClustersPages(input *ListClustersInput, fn func(p *ListClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListClustersOutput), lastPage) - }) -} - -const opListContainerInstances = "ListContainerInstances" - -// ListContainerInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListContainerInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListContainerInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListContainerInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListContainerInstancesRequest method. -// req, resp := client.ListContainerInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListContainerInstances -func (c *ECS) ListContainerInstancesRequest(input *ListContainerInstancesInput) (req *request.Request, output *ListContainerInstancesOutput) { - op := &request.Operation{ - Name: opListContainerInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListContainerInstancesInput{} - } - - output = &ListContainerInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListContainerInstances API operation for Amazon EC2 Container Service. -// -// Returns a list of container instances in a specified cluster. You can filter -// the results of a ListContainerInstances operation with cluster query language -// statements inside the filter parameter. For more information, see Cluster -// Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) -// in the Amazon EC2 Container Service 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 EC2 Container Service's -// API operation ListContainerInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListContainerInstances -func (c *ECS) ListContainerInstances(input *ListContainerInstancesInput) (*ListContainerInstancesOutput, error) { - req, out := c.ListContainerInstancesRequest(input) - err := req.Send() - return out, err -} - -// ListContainerInstancesPages iterates over the pages of a ListContainerInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListContainerInstances 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 ListContainerInstances operation. -// pageNum := 0 -// err := client.ListContainerInstancesPages(params, -// func(page *ListContainerInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListContainerInstancesPages(input *ListContainerInstancesInput, fn func(p *ListContainerInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListContainerInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListContainerInstancesOutput), lastPage) - }) -} - -const opListServices = "ListServices" - -// ListServicesRequest generates a "aws/request.Request" representing the -// client's request for the ListServices operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListServices for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListServices method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListServicesRequest method. -// req, resp := client.ListServicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListServices -func (c *ECS) ListServicesRequest(input *ListServicesInput) (req *request.Request, output *ListServicesOutput) { - op := &request.Operation{ - Name: opListServices, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListServicesInput{} - } - - output = &ListServicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServices API operation for Amazon EC2 Container Service. -// -// Lists the services that are running in a specified cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListServices for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListServices -func (c *ECS) ListServices(input *ListServicesInput) (*ListServicesOutput, error) { - req, out := c.ListServicesRequest(input) - err := req.Send() - return out, err -} - -// ListServicesPages iterates over the pages of a ListServices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServices 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 ListServices operation. -// pageNum := 0 -// err := client.ListServicesPages(params, -// func(page *ListServicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListServicesPages(input *ListServicesInput, fn func(p *ListServicesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListServicesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListServicesOutput), lastPage) - }) -} - -const opListTaskDefinitionFamilies = "ListTaskDefinitionFamilies" - -// ListTaskDefinitionFamiliesRequest generates a "aws/request.Request" representing the -// client's request for the ListTaskDefinitionFamilies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTaskDefinitionFamilies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTaskDefinitionFamilies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTaskDefinitionFamiliesRequest method. -// req, resp := client.ListTaskDefinitionFamiliesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionFamilies -func (c *ECS) ListTaskDefinitionFamiliesRequest(input *ListTaskDefinitionFamiliesInput) (req *request.Request, output *ListTaskDefinitionFamiliesOutput) { - op := &request.Operation{ - Name: opListTaskDefinitionFamilies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTaskDefinitionFamiliesInput{} - } - - output = &ListTaskDefinitionFamiliesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTaskDefinitionFamilies API operation for Amazon EC2 Container Service. -// -// Returns a list of task definition families that are registered to your account -// (which may include task definition families that no longer have any ACTIVE -// task definition revisions). -// -// You can filter out task definition families that do not contain any ACTIVE -// task definition revisions by setting the status parameter to ACTIVE. You -// can also filter the results with the familyPrefix 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 EC2 Container Service's -// API operation ListTaskDefinitionFamilies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionFamilies -func (c *ECS) ListTaskDefinitionFamilies(input *ListTaskDefinitionFamiliesInput) (*ListTaskDefinitionFamiliesOutput, error) { - req, out := c.ListTaskDefinitionFamiliesRequest(input) - err := req.Send() - return out, err -} - -// ListTaskDefinitionFamiliesPages iterates over the pages of a ListTaskDefinitionFamilies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTaskDefinitionFamilies 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 ListTaskDefinitionFamilies operation. -// pageNum := 0 -// err := client.ListTaskDefinitionFamiliesPages(params, -// func(page *ListTaskDefinitionFamiliesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTaskDefinitionFamiliesPages(input *ListTaskDefinitionFamiliesInput, fn func(p *ListTaskDefinitionFamiliesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTaskDefinitionFamiliesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTaskDefinitionFamiliesOutput), lastPage) - }) -} - -const opListTaskDefinitions = "ListTaskDefinitions" - -// ListTaskDefinitionsRequest generates a "aws/request.Request" representing the -// client's request for the ListTaskDefinitions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTaskDefinitions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTaskDefinitions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTaskDefinitionsRequest method. -// req, resp := client.ListTaskDefinitionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitions -func (c *ECS) ListTaskDefinitionsRequest(input *ListTaskDefinitionsInput) (req *request.Request, output *ListTaskDefinitionsOutput) { - op := &request.Operation{ - Name: opListTaskDefinitions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTaskDefinitionsInput{} - } - - output = &ListTaskDefinitionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTaskDefinitions API operation for Amazon EC2 Container Service. -// -// Returns a list of task definitions that are registered to your account. You -// can filter the results by family name with the familyPrefix parameter or -// by status with the status 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 EC2 Container Service's -// API operation ListTaskDefinitions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitions -func (c *ECS) ListTaskDefinitions(input *ListTaskDefinitionsInput) (*ListTaskDefinitionsOutput, error) { - req, out := c.ListTaskDefinitionsRequest(input) - err := req.Send() - return out, err -} - -// ListTaskDefinitionsPages iterates over the pages of a ListTaskDefinitions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTaskDefinitions 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 ListTaskDefinitions operation. -// pageNum := 0 -// err := client.ListTaskDefinitionsPages(params, -// func(page *ListTaskDefinitionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTaskDefinitionsPages(input *ListTaskDefinitionsInput, fn func(p *ListTaskDefinitionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTaskDefinitionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTaskDefinitionsOutput), lastPage) - }) -} - -const opListTasks = "ListTasks" - -// ListTasksRequest generates a "aws/request.Request" representing the -// client's request for the ListTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTasksRequest method. -// req, resp := client.ListTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasks -func (c *ECS) ListTasksRequest(input *ListTasksInput) (req *request.Request, output *ListTasksOutput) { - op := &request.Operation{ - Name: opListTasks, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTasksInput{} - } - - output = &ListTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTasks API operation for Amazon EC2 Container Service. -// -// Returns a list of tasks for a specified cluster. You can filter the results -// by family name, by a particular container instance, or by the desired status -// of the task with the family, containerInstance, and desiredStatus parameters. -// -// Recently-stopped tasks might appear in the returned results. Currently, stopped -// tasks appear in the returned results for at least one hour. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListTasks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" -// The specified service could not be found. You can view your available services -// with ListServices. Amazon ECS services are cluster-specific and region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasks -func (c *ECS) ListTasks(input *ListTasksInput) (*ListTasksOutput, error) { - req, out := c.ListTasksRequest(input) - err := req.Send() - return out, err -} - -// ListTasksPages iterates over the pages of a ListTasks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTasks 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 ListTasks operation. -// pageNum := 0 -// err := client.ListTasksPages(params, -// func(page *ListTasksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTasksPages(input *ListTasksInput, fn func(p *ListTasksOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTasksRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTasksOutput), lastPage) - }) -} - -const opPutAttributes = "PutAttributes" - -// PutAttributesRequest generates a "aws/request.Request" representing the -// client's request for the PutAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutAttributesRequest method. -// req, resp := client.PutAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAttributes -func (c *ECS) PutAttributesRequest(input *PutAttributesInput) (req *request.Request, output *PutAttributesOutput) { - op := &request.Operation{ - Name: opPutAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutAttributesInput{} - } - - output = &PutAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutAttributes API operation for Amazon EC2 Container Service. -// -// Create or update an attribute on an Amazon ECS resource. If the attribute -// does not exist, it is created. If the attribute exists, its value is replaced -// with the specified value. To delete an attribute, use DeleteAttributes. For -// more information, see Attributes (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes) -// in the Amazon EC2 Container Service 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 EC2 Container Service's -// API operation PutAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeTargetNotFoundException "TargetNotFoundException" -// The specified target could not be found. You can view your available container -// instances with ListContainerInstances. Amazon ECS container instances are -// cluster-specific and region-specific. -// -// * ErrCodeAttributeLimitExceededException "AttributeLimitExceededException" -// You can apply up to 10 custom attributes per resource. You can view the attributes -// of a resource with ListAttributes. You can remove existing attributes on -// a resource with DeleteAttributes. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAttributes -func (c *ECS) PutAttributes(input *PutAttributesInput) (*PutAttributesOutput, error) { - req, out := c.PutAttributesRequest(input) - err := req.Send() - return out, err -} - -const opRegisterContainerInstance = "RegisterContainerInstance" - -// RegisterContainerInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RegisterContainerInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterContainerInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterContainerInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterContainerInstanceRequest method. -// req, resp := client.RegisterContainerInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterContainerInstance -func (c *ECS) RegisterContainerInstanceRequest(input *RegisterContainerInstanceInput) (req *request.Request, output *RegisterContainerInstanceOutput) { - op := &request.Operation{ - Name: opRegisterContainerInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterContainerInstanceInput{} - } - - output = &RegisterContainerInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterContainerInstance API operation for Amazon EC2 Container Service. -// -// This action is only used by the Amazon EC2 Container Service agent, and it -// is not intended for use outside of the agent. -// -// Registers an EC2 instance into the specified cluster. This instance becomes -// available to place containers 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 EC2 Container Service's -// API operation RegisterContainerInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterContainerInstance -func (c *ECS) RegisterContainerInstance(input *RegisterContainerInstanceInput) (*RegisterContainerInstanceOutput, error) { - req, out := c.RegisterContainerInstanceRequest(input) - err := req.Send() - return out, err -} - -const opRegisterTaskDefinition = "RegisterTaskDefinition" - -// RegisterTaskDefinitionRequest generates a "aws/request.Request" representing the -// client's request for the RegisterTaskDefinition operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterTaskDefinition for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterTaskDefinition method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterTaskDefinitionRequest method. -// req, resp := client.RegisterTaskDefinitionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterTaskDefinition -func (c *ECS) RegisterTaskDefinitionRequest(input *RegisterTaskDefinitionInput) (req *request.Request, output *RegisterTaskDefinitionOutput) { - op := &request.Operation{ - Name: opRegisterTaskDefinition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterTaskDefinitionInput{} - } - - output = &RegisterTaskDefinitionOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterTaskDefinition API operation for Amazon EC2 Container Service. -// -// Registers a new task definition from the supplied family and containerDefinitions. -// Optionally, you can add data volumes to your containers with the volumes -// parameter. For more information about task definition parameters and defaults, -// see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) -// in the Amazon EC2 Container Service Developer Guide. -// -// You can specify an IAM role for your task with the taskRoleArn parameter. -// When you specify an IAM role for a task, its containers can then use the -// latest versions of the AWS CLI or SDKs to make API requests to the AWS services -// that are specified in the IAM policy associated with the role. For more information, -// see IAM Roles for Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) -// in the Amazon EC2 Container Service Developer Guide. -// -// You can specify a Docker networking mode for the containers in your task -// definition with the networkMode parameter. The available network modes correspond -// to those described in Network settings (https://docs.docker.com/engine/reference/run/#/network-settings) -// in the Docker run reference. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation RegisterTaskDefinition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterTaskDefinition -func (c *ECS) RegisterTaskDefinition(input *RegisterTaskDefinitionInput) (*RegisterTaskDefinitionOutput, error) { - req, out := c.RegisterTaskDefinitionRequest(input) - err := req.Send() - return out, err -} - -const opRunTask = "RunTask" - -// RunTaskRequest generates a "aws/request.Request" representing the -// client's request for the RunTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RunTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RunTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RunTaskRequest method. -// req, resp := client.RunTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RunTask -func (c *ECS) RunTaskRequest(input *RunTaskInput) (req *request.Request, output *RunTaskOutput) { - op := &request.Operation{ - Name: opRunTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RunTaskInput{} - } - - output = &RunTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// RunTask API operation for Amazon EC2 Container Service. -// -// Starts a new task using the specified task definition. -// -// You can allow Amazon ECS to place tasks for you, or you can customize how -// Amazon ECS places tasks using placement constraints and placement strategies. -// For more information, see Scheduling Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) -// in the Amazon EC2 Container Service Developer Guide. -// -// Alternatively, you can use StartTask to use your own scheduler or place tasks -// manually on specific container 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 EC2 Container Service's -// API operation RunTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RunTask -func (c *ECS) RunTask(input *RunTaskInput) (*RunTaskOutput, error) { - req, out := c.RunTaskRequest(input) - err := req.Send() - return out, err -} - -const opStartTask = "StartTask" - -// StartTaskRequest generates a "aws/request.Request" representing the -// client's request for the StartTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartTaskRequest method. -// req, resp := client.StartTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StartTask -func (c *ECS) StartTaskRequest(input *StartTaskInput) (req *request.Request, output *StartTaskOutput) { - op := &request.Operation{ - Name: opStartTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartTaskInput{} - } - - output = &StartTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartTask API operation for Amazon EC2 Container Service. -// -// Starts a new task from the specified task definition on the specified container -// instance or instances. -// -// Alternatively, you can use RunTask to place tasks for you. For more information, -// see Scheduling Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) -// in the Amazon EC2 Container Service 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 EC2 Container Service's -// API operation StartTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StartTask -func (c *ECS) StartTask(input *StartTaskInput) (*StartTaskOutput, error) { - req, out := c.StartTaskRequest(input) - err := req.Send() - return out, err -} - -const opStopTask = "StopTask" - -// StopTaskRequest generates a "aws/request.Request" representing the -// client's request for the StopTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopTaskRequest method. -// req, resp := client.StopTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StopTask -func (c *ECS) StopTaskRequest(input *StopTaskInput) (req *request.Request, output *StopTaskOutput) { - op := &request.Operation{ - Name: opStopTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopTaskInput{} - } - - output = &StopTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopTask API operation for Amazon EC2 Container Service. -// -// Stops a running task. -// -// When StopTask is called on a task, the equivalent of docker stop is issued -// to the containers running in the task. This results in a SIGTERM and a 30-second -// timeout, after which SIGKILL is sent and the containers are forcibly stopped. -// If the container handles the SIGTERM gracefully and exits within 30 seconds -// from receiving it, no SIGKILL is sent. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation StopTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StopTask -func (c *ECS) StopTask(input *StopTaskInput) (*StopTaskOutput, error) { - req, out := c.StopTaskRequest(input) - err := req.Send() - return out, err -} - -const opSubmitContainerStateChange = "SubmitContainerStateChange" - -// SubmitContainerStateChangeRequest generates a "aws/request.Request" representing the -// client's request for the SubmitContainerStateChange operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SubmitContainerStateChange for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SubmitContainerStateChange method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SubmitContainerStateChangeRequest method. -// req, resp := client.SubmitContainerStateChangeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitContainerStateChange -func (c *ECS) SubmitContainerStateChangeRequest(input *SubmitContainerStateChangeInput) (req *request.Request, output *SubmitContainerStateChangeOutput) { - op := &request.Operation{ - Name: opSubmitContainerStateChange, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SubmitContainerStateChangeInput{} - } - - output = &SubmitContainerStateChangeOutput{} - req = c.newRequest(op, input, output) - return -} - -// SubmitContainerStateChange API operation for Amazon EC2 Container Service. -// -// This action is only used by the Amazon EC2 Container Service agent, and it -// is not intended for use outside of the agent. -// -// Sent to acknowledge that a container changed states. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation SubmitContainerStateChange for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitContainerStateChange -func (c *ECS) SubmitContainerStateChange(input *SubmitContainerStateChangeInput) (*SubmitContainerStateChangeOutput, error) { - req, out := c.SubmitContainerStateChangeRequest(input) - err := req.Send() - return out, err -} - -const opSubmitTaskStateChange = "SubmitTaskStateChange" - -// SubmitTaskStateChangeRequest generates a "aws/request.Request" representing the -// client's request for the SubmitTaskStateChange operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SubmitTaskStateChange for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SubmitTaskStateChange method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SubmitTaskStateChangeRequest method. -// req, resp := client.SubmitTaskStateChangeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitTaskStateChange -func (c *ECS) SubmitTaskStateChangeRequest(input *SubmitTaskStateChangeInput) (req *request.Request, output *SubmitTaskStateChangeOutput) { - op := &request.Operation{ - Name: opSubmitTaskStateChange, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SubmitTaskStateChangeInput{} - } - - output = &SubmitTaskStateChangeOutput{} - req = c.newRequest(op, input, output) - return -} - -// SubmitTaskStateChange API operation for Amazon EC2 Container Service. -// -// This action is only used by the Amazon EC2 Container Service agent, and it -// is not intended for use outside of the agent. -// -// Sent to acknowledge that a task changed states. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation SubmitTaskStateChange for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitTaskStateChange -func (c *ECS) SubmitTaskStateChange(input *SubmitTaskStateChangeInput) (*SubmitTaskStateChangeOutput, error) { - req, out := c.SubmitTaskStateChangeRequest(input) - err := req.Send() - return out, err -} - -const opUpdateContainerAgent = "UpdateContainerAgent" - -// UpdateContainerAgentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateContainerAgent operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateContainerAgent for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateContainerAgent method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateContainerAgentRequest method. -// req, resp := client.UpdateContainerAgentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerAgent -func (c *ECS) UpdateContainerAgentRequest(input *UpdateContainerAgentInput) (req *request.Request, output *UpdateContainerAgentOutput) { - op := &request.Operation{ - Name: opUpdateContainerAgent, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateContainerAgentInput{} - } - - output = &UpdateContainerAgentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateContainerAgent API operation for Amazon EC2 Container Service. -// -// Updates the Amazon ECS container agent on a specified container instance. -// Updating the Amazon ECS container agent does not interrupt running tasks -// or services on the container instance. The process for updating the agent -// differs depending on whether your container instance was launched with the -// Amazon ECS-optimized AMI or another operating system. -// -// UpdateContainerAgent requires the Amazon ECS-optimized AMI or Amazon Linux -// with the ecs-init service installed and running. For help updating the Amazon -// ECS container agent on other operating systems, see Manually Updating the -// Amazon ECS Container Agent (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html#manually_update_agent) -// in the Amazon EC2 Container Service 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 EC2 Container Service's -// API operation UpdateContainerAgent for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeUpdateInProgressException "UpdateInProgressException" -// There is already a current Amazon ECS container agent update in progress -// on the specified container instance. If the container agent becomes disconnected -// while it is in a transitional stage, such as PENDING or STAGING, the update -// process can get stuck in that state. However, when the agent reconnects, -// it resumes where it stopped previously. -// -// * ErrCodeNoUpdateAvailableException "NoUpdateAvailableException" -// There is no update available for this Amazon ECS container agent. This could -// be because the agent is already running the latest version, or it is so old -// that there is no update path to the current version. -// -// * ErrCodeMissingVersionException "MissingVersionException" -// Amazon ECS is unable to determine the current version of the Amazon ECS container -// agent on the container instance and does not have enough information to proceed -// with an update. This could be because the agent running on the container -// instance is an older or custom version that does not use our version information. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerAgent -func (c *ECS) UpdateContainerAgent(input *UpdateContainerAgentInput) (*UpdateContainerAgentOutput, error) { - req, out := c.UpdateContainerAgentRequest(input) - err := req.Send() - return out, err -} - -const opUpdateContainerInstancesState = "UpdateContainerInstancesState" - -// UpdateContainerInstancesStateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateContainerInstancesState operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateContainerInstancesState for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateContainerInstancesState method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateContainerInstancesStateRequest method. -// req, resp := client.UpdateContainerInstancesStateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerInstancesState -func (c *ECS) UpdateContainerInstancesStateRequest(input *UpdateContainerInstancesStateInput) (req *request.Request, output *UpdateContainerInstancesStateOutput) { - op := &request.Operation{ - Name: opUpdateContainerInstancesState, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateContainerInstancesStateInput{} - } - - output = &UpdateContainerInstancesStateOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateContainerInstancesState API operation for Amazon EC2 Container Service. -// -// Modifies the status of an Amazon ECS container instance. -// -// You can change the status of a container instance to DRAINING to manually -// remove an instance from a cluster, for example to perform system updates, -// update the Docker daemon, or scale down the cluster size. -// -// When you set a container instance to DRAINING, Amazon ECS prevents new tasks -// from being scheduled for placement on the container instance and replacement -// service tasks are started on other container instances in the cluster if -// the resources are available. Service tasks on the container instance that -// are in the PENDING state are stopped immediately. -// -// Service tasks on the container instance that are in the RUNNING state are -// stopped and replaced according the service's deployment configuration parameters, -// minimumHealthyPercent and maximumPercent. Note that you can change the deployment -// configuration of your service using UpdateService. -// -// * If minimumHealthyPercent is below 100%, the scheduler can ignore desiredCount -// temporarily during task replacement. For example, desiredCount is four -// tasks, a minimum of 50% allows the scheduler to stop two existing tasks -// before starting two new tasks. If the minimum is 100%, the service scheduler -// can't remove existing tasks until the replacement tasks are considered -// healthy. Tasks for services that do not use a load balancer are considered -// healthy if they are in the RUNNING state. Tasks for services that use -// a load balancer are considered healthy if they are in the RUNNING state -// and the container instance they are hosted on is reported as healthy by -// the load balancer. -// -// * The maximumPercent parameter represents an upper limit on the number -// of running tasks during task replacement, which enables you to define -// the replacement batch size. For example, if desiredCount of four tasks, -// a maximum of 200% starts four new tasks before stopping the four tasks -// to be drained (provided that the cluster resources required to do this -// are available). If the maximum is 100%, then replacement tasks can't start -// until the draining tasks have stopped. -// -// Any PENDING or RUNNING tasks that do not belong to a service are not affected; -// you must wait for them to finish or stop them manually. -// -// A container instance has completed draining when it has no more RUNNING tasks. -// You can verify this using ListTasks. -// -// When you set a container instance to ACTIVE, the Amazon ECS scheduler can -// begin scheduling tasks on the instance 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 EC2 Container Service's -// API operation UpdateContainerInstancesState for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerInstancesState -func (c *ECS) UpdateContainerInstancesState(input *UpdateContainerInstancesStateInput) (*UpdateContainerInstancesStateOutput, error) { - req, out := c.UpdateContainerInstancesStateRequest(input) - err := req.Send() - return out, err -} - -const opUpdateService = "UpdateService" - -// UpdateServiceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateService operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateService for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateService method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateServiceRequest method. -// req, resp := client.UpdateServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateService -func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Request, output *UpdateServiceOutput) { - op := &request.Operation{ - Name: opUpdateService, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateServiceInput{} - } - - output = &UpdateServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateService API operation for Amazon EC2 Container Service. -// -// Modifies the desired count, deployment configuration, or task definition -// used in a service. -// -// You can add to or subtract from the number of instantiations of a task definition -// in a service by specifying the cluster that the service is running in and -// a new desiredCount parameter. -// -// You can use UpdateService to modify your task definition and deploy a new -// version of your service. -// -// You can also update the deployment configuration of a service. When a deployment -// is triggered by updating the task definition of a service, the service scheduler -// uses the deployment configuration parameters, minimumHealthyPercent and maximumPercent, -// to determine the deployment strategy. -// -// * If minimumHealthyPercent is below 100%, the scheduler can ignore desiredCount -// temporarily during a deployment. For example, if desiredCount is four -// tasks, a minimum of 50% allows the scheduler to stop two existing tasks -// before starting two new tasks. Tasks for services that do not use a load -// balancer are considered healthy if they are in the RUNNING state. Tasks -// for services that use a load balancer are considered healthy if they are -// in the RUNNING state and the container instance they are hosted on is -// reported as healthy by the load balancer. -// -// * The maximumPercent parameter represents an upper limit on the number -// of running tasks during a deployment, which enables you to define the -// deployment batch size. For example, if desiredCount is four tasks, a maximum -// of 200% starts four new tasks before stopping the four older tasks (provided -// that the cluster resources required to do this are available). -// -// When UpdateService stops a task during a deployment, the equivalent of docker -// stop is issued to the containers running in the task. This results in a SIGTERM -// and a 30-second timeout, after which SIGKILL is sent and the containers are -// forcibly stopped. If the container handles the SIGTERM gracefully and exits -// within 30 seconds from receiving it, no SIGKILL is sent. -// -// When the service scheduler launches new tasks, it determines task placement -// in your cluster with the following logic: -// -// * Determine which of the container instances in your cluster can support -// your service's task definition (for example, they have the required CPU, -// memory, ports, and container instance attributes). -// -// * By default, the service scheduler attempts to balance tasks across Availability -// Zones in this manner (although you can choose a different placement strategy): -// -// Sort the valid container instances by the fewest number of running tasks -// for this service in the same Availability Zone as the instance. For example, -// if zone A has one running service task and zones B and C each have zero, -// valid container instances in either zone B or C are considered optimal -// for placement. -// -// Place the new service task on a valid container instance in an optimal Availability -// Zone (based on the previous steps), favoring container instances with -// the fewest number of running tasks for this service. -// -// When the service scheduler stops running tasks, it attempts to maintain balance -// across the Availability Zones in your cluster using the following logic: -// -// * Sort the container instances by the largest number of running tasks -// for this service in the same Availability Zone as the instance. For example, -// if zone A has one running service task and zones B and C each have two, -// container instances in either zone B or C are considered optimal for termination. -// -// * Stop the task on a container instance in an optimal Availability Zone -// (based on the previous steps), favoring container instances with the largest -// number of running tasks for this 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 EC2 Container Service's -// API operation UpdateService for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permission to use the action -// or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" -// The specified service could not be found. You can view your available services -// with ListServices. Amazon ECS services are cluster-specific and region-specific. -// -// * ErrCodeServiceNotActiveException "ServiceNotActiveException" -// The specified service is not active. You cannot update a service that is -// not active. If you have previously deleted a service, you can re-create it -// with CreateService. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateService -func (c *ECS) UpdateService(input *UpdateServiceInput) (*UpdateServiceOutput, error) { - req, out := c.UpdateServiceRequest(input) - err := req.Send() - return out, err -} - -// An attribute is a name-value pair associated with an Amazon ECS object. Attributes -// enable you to extend the Amazon ECS data model by adding custom metadata -// to your resources. For more information, see Attributes (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes) -// in the Amazon EC2 Container Service Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Attribute -type Attribute struct { - _ struct{} `type:"structure"` - - // The name of the attribute. Up to 128 letters (uppercase and lowercase), numbers, - // hyphens, underscores, and periods are allowed. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The ID of the target. You can specify the short form ID for a resource or - // the full Amazon Resource Name (ARN). - TargetId *string `locationName:"targetId" type:"string"` - - // The type of the target with which to attach the attribute. This parameter - // is required if you use the short form ID for a resource instead of the full - // Amazon Resource Name (ARN). - TargetType *string `locationName:"targetType" type:"string" enum:"TargetType"` - - // The value of the attribute. Up to 128 letters (uppercase and lowercase), - // numbers, hyphens, underscores, periods, at signs (@), forward slashes, colons, - // and spaces are allowed. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s Attribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Attribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Attribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Attribute"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *Attribute) SetName(v string) *Attribute { - s.Name = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *Attribute) SetTargetId(v string) *Attribute { - s.TargetId = &v - return s -} - -// SetTargetType sets the TargetType field's value. -func (s *Attribute) SetTargetType(v string) *Attribute { - s.TargetType = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Attribute) SetValue(v string) *Attribute { - s.Value = &v - return s -} - -// A regional grouping of one or more container instances on which you can run -// task requests. Each account receives a default cluster the first time you -// use the Amazon ECS service, but you may also create other clusters. Clusters -// may contain more than one instance type simultaneously. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Cluster -type Cluster struct { - _ struct{} `type:"structure"` - - // The number of services that are running on the cluster in an ACTIVE state. - // You can view these services with ListServices. - ActiveServicesCount *int64 `locationName:"activeServicesCount" type:"integer"` - - // The Amazon Resource Name (ARN) that identifies the cluster. The ARN contains - // the arn:aws:ecs namespace, followed by the region of the cluster, the AWS - // account ID of the cluster owner, the cluster namespace, and then the cluster - // name. For example, arn:aws:ecs:region:012345678910:cluster/test.. - ClusterArn *string `locationName:"clusterArn" type:"string"` - - // A user-generated string that you use to identify your cluster. - ClusterName *string `locationName:"clusterName" type:"string"` - - // The number of tasks in the cluster that are in the PENDING state. - PendingTasksCount *int64 `locationName:"pendingTasksCount" type:"integer"` - - // The number of container instances registered into the cluster. - RegisteredContainerInstancesCount *int64 `locationName:"registeredContainerInstancesCount" type:"integer"` - - // The number of tasks in the cluster that are in the RUNNING state. - RunningTasksCount *int64 `locationName:"runningTasksCount" type:"integer"` - - // The status of the cluster. The valid values are ACTIVE or INACTIVE. ACTIVE - // indicates that you can register container instances with the cluster and - // the associated instances can accept tasks. - Status *string `locationName:"status" type:"string"` -} - -// String returns the string representation -func (s Cluster) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Cluster) GoString() string { - return s.String() -} - -// SetActiveServicesCount sets the ActiveServicesCount field's value. -func (s *Cluster) SetActiveServicesCount(v int64) *Cluster { - s.ActiveServicesCount = &v - return s -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *Cluster) SetClusterArn(v string) *Cluster { - s.ClusterArn = &v - return s -} - -// SetClusterName sets the ClusterName field's value. -func (s *Cluster) SetClusterName(v string) *Cluster { - s.ClusterName = &v - return s -} - -// SetPendingTasksCount sets the PendingTasksCount field's value. -func (s *Cluster) SetPendingTasksCount(v int64) *Cluster { - s.PendingTasksCount = &v - return s -} - -// SetRegisteredContainerInstancesCount sets the RegisteredContainerInstancesCount field's value. -func (s *Cluster) SetRegisteredContainerInstancesCount(v int64) *Cluster { - s.RegisteredContainerInstancesCount = &v - return s -} - -// SetRunningTasksCount sets the RunningTasksCount field's value. -func (s *Cluster) SetRunningTasksCount(v int64) *Cluster { - s.RunningTasksCount = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Cluster) SetStatus(v string) *Cluster { - s.Status = &v - return s -} - -// A Docker container that is part of a task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Container -type Container struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the container. - ContainerArn *string `locationName:"containerArn" type:"string"` - - // The exit code returned from the container. - ExitCode *int64 `locationName:"exitCode" type:"integer"` - - // The last known status of the container. - LastStatus *string `locationName:"lastStatus" type:"string"` - - // The name of the container. - Name *string `locationName:"name" type:"string"` - - // The network bindings associated with the container. - NetworkBindings []*NetworkBinding `locationName:"networkBindings" type:"list"` - - // A short (255 max characters) human-readable string to provide additional - // details about a running or stopped container. - Reason *string `locationName:"reason" type:"string"` - - // The Amazon Resource Name (ARN) of the task. - TaskArn *string `locationName:"taskArn" type:"string"` -} - -// String returns the string representation -func (s Container) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Container) GoString() string { - return s.String() -} - -// SetContainerArn sets the ContainerArn field's value. -func (s *Container) SetContainerArn(v string) *Container { - s.ContainerArn = &v - return s -} - -// SetExitCode sets the ExitCode field's value. -func (s *Container) SetExitCode(v int64) *Container { - s.ExitCode = &v - return s -} - -// SetLastStatus sets the LastStatus field's value. -func (s *Container) SetLastStatus(v string) *Container { - s.LastStatus = &v - return s -} - -// SetName sets the Name field's value. -func (s *Container) SetName(v string) *Container { - s.Name = &v - return s -} - -// SetNetworkBindings sets the NetworkBindings field's value. -func (s *Container) SetNetworkBindings(v []*NetworkBinding) *Container { - s.NetworkBindings = v - return s -} - -// SetReason sets the Reason field's value. -func (s *Container) SetReason(v string) *Container { - s.Reason = &v - return s -} - -// SetTaskArn sets the TaskArn field's value. -func (s *Container) SetTaskArn(v string) *Container { - s.TaskArn = &v - return s -} - -// Container definitions are used in task definitions to describe the different -// containers that are launched as part of a task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ContainerDefinition -type ContainerDefinition struct { - _ struct{} `type:"structure"` - - // The command that is passed to the container. This parameter maps to Cmd in - // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the COMMAND parameter to docker run (https://docs.docker.com/engine/reference/run/). - // For more information, see https://docs.docker.com/engine/reference/builder/#cmd - // (https://docs.docker.com/engine/reference/builder/#cmd). - Command []*string `locationName:"command" type:"list"` - - // The number of cpu units reserved for the container. A container instance - // has 1,024 cpu units for every CPU core. This parameter specifies the minimum - // amount of CPU to reserve for a container, and containers share unallocated - // CPU units with other containers on the instance with the same ratio as their - // allocated amount. This parameter maps to CpuShares in the Create a container - // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --cpu-shares option to docker run (https://docs.docker.com/engine/reference/run/). - // - // You can determine the number of CPU units that are available per EC2 instance - // type by multiplying the vCPUs listed for that instance type on the Amazon - // EC2 Instances (http://aws.amazon.com/ec2/instance-types/) detail page by - // 1,024. - // - // For example, if you run a single-container task on a single-core instance - // type with 512 CPU units specified for that container, and that is the only - // task running on the container instance, that container could use the full - // 1,024 CPU unit share at any given time. However, if you launched another - // copy of the same task on that container instance, each task would be guaranteed - // a minimum of 512 CPU units when needed, and each container could float to - // higher CPU usage if the other container was not using it, but if both tasks - // were 100% active all of the time, they would be limited to 512 CPU units. - // - // The Docker daemon on the container instance uses the CPU value to calculate - // the relative CPU share ratios for running containers. For more information, - // see CPU share constraint (https://docs.docker.com/engine/reference/run/#cpu-share-constraint) - // in the Docker documentation. The minimum valid CPU share value that the Linux - // kernel allows is 2; however, the CPU parameter is not required, and you can - // use CPU values below 2 in your container definitions. For CPU values below - // 2 (including null), the behavior varies based on your Amazon ECS container - // agent version: - // - // * Agent versions less than or equal to 1.1.0: Null and zero CPU values - // are passed to Docker as 0, which Docker then converts to 1,024 CPU shares. - // CPU values of 1 are passed to Docker as 1, which the Linux kernel converts - // to 2 CPU shares. - // - // * Agent versions greater than or equal to 1.2.0: Null, zero, and CPU values - // of 1 are passed to Docker as 2. - Cpu *int64 `locationName:"cpu" type:"integer"` - - // When this parameter is true, networking is disabled within the container. - // This parameter maps to NetworkDisabled in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/). - DisableNetworking *bool `locationName:"disableNetworking" type:"boolean"` - - // A list of DNS search domains that are presented to the container. This parameter - // maps to DnsSearch in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --dns-search option to docker run (https://docs.docker.com/engine/reference/run/). - DnsSearchDomains []*string `locationName:"dnsSearchDomains" type:"list"` - - // A list of DNS servers that are presented to the container. This parameter - // maps to Dns in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --dns option to docker run (https://docs.docker.com/engine/reference/run/). - DnsServers []*string `locationName:"dnsServers" type:"list"` - - // A key/value map of labels to add to the container. This parameter maps to - // Labels in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --label option to docker run (https://docs.docker.com/engine/reference/run/). - // This parameter requires version 1.18 of the Docker Remote API or greater - // on your container instance. To check the Docker Remote API version on your - // container instance, log into your container instance and run the following - // command: sudo docker version | grep "Server API version" - DockerLabels map[string]*string `locationName:"dockerLabels" type:"map"` - - // A list of strings to provide custom labels for SELinux and AppArmor multi-level - // security systems. This parameter maps to SecurityOpt in the Create a container - // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --security-opt option to docker run (https://docs.docker.com/engine/reference/run/). - // - // The Amazon ECS container agent running on a container instance must register - // with the ECS_SELINUX_CAPABLE=true or ECS_APPARMOR_CAPABLE=true environment - // variables before containers placed on that instance can use these security - // options. For more information, see Amazon ECS Container Agent Configuration - // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) - // in the Amazon EC2 Container Service Developer Guide. - DockerSecurityOptions []*string `locationName:"dockerSecurityOptions" type:"list"` - - // Early versions of the Amazon ECS container agent do not properly handle entryPoint - // parameters. If you have problems using entryPoint, update your container - // agent or enter your commands and arguments as command array items instead. - // - // The entry point that is passed to the container. This parameter maps to Entrypoint - // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --entrypoint option to docker run (https://docs.docker.com/engine/reference/run/). - // For more information, see https://docs.docker.com/engine/reference/builder/#entrypoint - // (https://docs.docker.com/engine/reference/builder/#entrypoint). - EntryPoint []*string `locationName:"entryPoint" type:"list"` - - // The environment variables to pass to a container. This parameter maps to - // Env in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --env option to docker run (https://docs.docker.com/engine/reference/run/). - // - // We do not recommend using plain text environment variables for sensitive - // information, such as credential data. - Environment []*KeyValuePair `locationName:"environment" type:"list"` - - // If the essential parameter of a container is marked as true, and that container - // fails or stops for any reason, all other containers that are part of the - // task are stopped. If the essential parameter of a container is marked as - // false, then its failure does not affect the rest of the containers in a task. - // If this parameter is omitted, a container is assumed to be essential. - // - // All tasks must have at least one essential container. If you have an application - // that is composed of multiple containers, you should group containers that - // are used for a common purpose into components, and separate the different - // components into multiple task definitions. For more information, see Application - // Architecture (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html) - // in the Amazon EC2 Container Service Developer Guide. - Essential *bool `locationName:"essential" type:"boolean"` - - // A list of hostnames and IP address mappings to append to the /etc/hosts file - // on the container. This parameter maps to ExtraHosts in the Create a container - // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --add-host option to docker run (https://docs.docker.com/engine/reference/run/). - ExtraHosts []*HostEntry `locationName:"extraHosts" type:"list"` - - // The hostname to use for your container. This parameter maps to Hostname in - // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --hostname option to docker run (https://docs.docker.com/engine/reference/run/). - Hostname *string `locationName:"hostname" type:"string"` - - // The image used to start a container. This string is passed directly to the - // Docker daemon. Images in the Docker Hub registry are available by default. - // Other repositories are specified with repository-url/image:tag. Up to 255 - // letters (uppercase and lowercase), numbers, hyphens, underscores, colons, - // periods, forward slashes, and number signs are allowed. This parameter maps - // to Image in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the IMAGE parameter of docker run (https://docs.docker.com/engine/reference/run/). - // - // Amazon ECS task definitions currently only support tags as image identifiers - // within a specified repository (and not sha256 digests). - // - // * Images in Amazon ECR repositories use the full registry and repository - // URI (for example, 012345678910.dkr.ecr..amazonaws.com/). - // - // - // * Images in official repositories on Docker Hub use a single name (for - // example, ubuntu or mongo). - // - // * Images in other repositories on Docker Hub are qualified with an organization - // name (for example, amazon/amazon-ecs-agent). - // - // * Images in other online repositories are qualified further by a domain - // name (for example, quay.io/assemblyline/ubuntu). - Image *string `locationName:"image" type:"string"` - - // The link parameter allows containers to communicate with each other without - // the need for port mappings, using the name parameter and optionally, an alias - // for the link. This construct is analogous to name:alias in Docker links. - // Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores - // are allowed for each name and alias. For more information on linking Docker - // containers, see https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/ - // (https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/). - // This parameter maps to Links in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --link option to docker run (https://docs.docker.com/engine/reference/run/). - // - // Containers that are collocated on a single container instance may be able - // to communicate with each other without requiring links or host port mappings. - // Network isolation is achieved on the container instance using security groups - // and VPC settings. - Links []*string `locationName:"links" type:"list"` - - // The log configuration specification for the container. This parameter maps - // to LogConfig in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --log-driver option to docker run (https://docs.docker.com/engine/reference/run/). - // By default, containers use the same logging driver that the Docker daemon - // uses; however the container may use a different logging driver than the Docker - // daemon by specifying a log driver with this parameter in the container definition. - // To use a different logging driver for a container, the log system must be - // configured properly on the container instance (or on a different log server - // for remote logging options). For more information on the options for different - // supported log drivers, see Configure logging drivers (https://docs.docker.com/engine/admin/logging/overview/) - // in the Docker documentation. - // - // Amazon ECS currently supports a subset of the logging drivers available to - // the Docker daemon (shown in the LogConfiguration data type). Additional log - // drivers may be available in future releases of the Amazon ECS container agent. - // - // This parameter requires version 1.18 of the Docker Remote API or greater - // on your container instance. To check the Docker Remote API version on your - // container instance, log into your container instance and run the following - // command: sudo docker version | grep "Server API version" - // - // The Amazon ECS container agent running on a container instance must register - // the logging drivers available on that instance with the ECS_AVAILABLE_LOGGING_DRIVERS - // environment variable before containers placed on that instance can use these - // log configuration options. For more information, see Amazon ECS Container - // Agent Configuration (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) - // in the Amazon EC2 Container Service Developer Guide. - LogConfiguration *LogConfiguration `locationName:"logConfiguration" type:"structure"` - - // The hard limit (in MiB) of memory to present to the container. If your container - // attempts to exceed the memory specified here, the container is killed. This - // parameter maps to Memory in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --memory option to docker run (https://docs.docker.com/engine/reference/run/). - // - // You must specify a non-zero integer for one or both of memory or memoryReservation - // in container definitions. If you specify both, memory must be greater than - // memoryReservation. If you specify memoryReservation, then that value is subtracted - // from the available memory resources for the container instance on which the - // container is placed; otherwise, the value of memory is used. - // - // The Docker daemon reserves a minimum of 4 MiB of memory for a container, - // so you should not specify fewer than 4 MiB of memory for your containers. - Memory *int64 `locationName:"memory" type:"integer"` - - // The soft limit (in MiB) of memory to reserve for the container. When system - // memory is under heavy contention, Docker attempts to keep the container memory - // to this soft limit; however, your container can consume more memory when - // it needs to, up to either the hard limit specified with the memory parameter - // (if applicable), or all of the available memory on the container instance, - // whichever comes first. This parameter maps to MemoryReservation in the Create - // a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --memory-reservation option to docker run (https://docs.docker.com/engine/reference/run/). - // - // You must specify a non-zero integer for one or both of memory or memoryReservation - // in container definitions. If you specify both, memory must be greater than - // memoryReservation. If you specify memoryReservation, then that value is subtracted - // from the available memory resources for the container instance on which the - // container is placed; otherwise, the value of memory is used. - // - // For example, if your container normally uses 128 MiB of memory, but occasionally - // bursts to 256 MiB of memory for short periods of time, you can set a memoryReservation - // of 128 MiB, and a memory hard limit of 300 MiB. This configuration would - // allow the container to only reserve 128 MiB of memory from the remaining - // resources on the container instance, but also allow the container to consume - // more memory resources when needed. - MemoryReservation *int64 `locationName:"memoryReservation" type:"integer"` - - // The mount points for data volumes in your container. This parameter maps - // to Volumes in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --volume option to docker run (https://docs.docker.com/engine/reference/run/). - MountPoints []*MountPoint `locationName:"mountPoints" type:"list"` - - // The name of a container. If you are linking multiple containers together - // in a task definition, the name of one container can be entered in the links - // of another container to connect the containers. Up to 255 letters (uppercase - // and lowercase), numbers, hyphens, and underscores are allowed. This parameter - // maps to name in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --name option to docker run (https://docs.docker.com/engine/reference/run/). - Name *string `locationName:"name" type:"string"` - - // The list of port mappings for the container. Port mappings allow containers - // to access ports on the host container instance to send or receive traffic. - // This parameter maps to PortBindings in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --publish option to docker run (https://docs.docker.com/engine/reference/run/). - // If the network mode of a task definition is set to none, then you cannot - // specify port mappings. If the network mode of a task definition is set to - // host, then host ports must either be undefined or they must match the container - // port in the port mapping. - // - // After a task reaches the RUNNING status, manual and automatic host and container - // port assignments are visible in the Network Bindings section of a container - // description of a selected task in the Amazon ECS console, or the networkBindings - // section DescribeTasks responses. - PortMappings []*PortMapping `locationName:"portMappings" type:"list"` - - // When this parameter is true, the container is given elevated privileges on - // the host container instance (similar to the root user). This parameter maps - // to Privileged in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --privileged option to docker run (https://docs.docker.com/engine/reference/run/). - Privileged *bool `locationName:"privileged" type:"boolean"` - - // When this parameter is true, the container is given read-only access to its - // root file system. This parameter maps to ReadonlyRootfs in the Create a container - // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --read-only option to docker run. - ReadonlyRootFilesystem *bool `locationName:"readonlyRootFilesystem" type:"boolean"` - - // A list of ulimits to set in the container. This parameter maps to Ulimits - // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --ulimit option to docker run (https://docs.docker.com/engine/reference/run/). - // Valid naming values are displayed in the Ulimit data type. This parameter - // requires version 1.18 of the Docker Remote API or greater on your container - // instance. To check the Docker Remote API version on your container instance, - // log into your container instance and run the following command: sudo docker - // version | grep "Server API version" - Ulimits []*Ulimit `locationName:"ulimits" type:"list"` - - // The user name to use inside the container. This parameter maps to User in - // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --user option to docker run (https://docs.docker.com/engine/reference/run/). - User *string `locationName:"user" type:"string"` - - // Data volumes to mount from another container. This parameter maps to VolumesFrom - // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --volumes-from option to docker run (https://docs.docker.com/engine/reference/run/). - VolumesFrom []*VolumeFrom `locationName:"volumesFrom" type:"list"` - - // The working directory in which to run commands inside the container. This - // parameter maps to WorkingDir in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/) - // and the --workdir option to docker run (https://docs.docker.com/engine/reference/run/). - WorkingDirectory *string `locationName:"workingDirectory" type:"string"` -} - -// String returns the string representation -func (s ContainerDefinition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContainerDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContainerDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContainerDefinition"} - if s.ExtraHosts != nil { - for i, v := range s.ExtraHosts { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ExtraHosts", i), err.(request.ErrInvalidParams)) - } - } - } - if s.LogConfiguration != nil { - if err := s.LogConfiguration.Validate(); err != nil { - invalidParams.AddNested("LogConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Ulimits != nil { - for i, v := range s.Ulimits { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Ulimits", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommand sets the Command field's value. -func (s *ContainerDefinition) SetCommand(v []*string) *ContainerDefinition { - s.Command = v - return s -} - -// SetCpu sets the Cpu field's value. -func (s *ContainerDefinition) SetCpu(v int64) *ContainerDefinition { - s.Cpu = &v - return s -} - -// SetDisableNetworking sets the DisableNetworking field's value. -func (s *ContainerDefinition) SetDisableNetworking(v bool) *ContainerDefinition { - s.DisableNetworking = &v - return s -} - -// SetDnsSearchDomains sets the DnsSearchDomains field's value. -func (s *ContainerDefinition) SetDnsSearchDomains(v []*string) *ContainerDefinition { - s.DnsSearchDomains = v - return s -} - -// SetDnsServers sets the DnsServers field's value. -func (s *ContainerDefinition) SetDnsServers(v []*string) *ContainerDefinition { - s.DnsServers = v - return s -} - -// SetDockerLabels sets the DockerLabels field's value. -func (s *ContainerDefinition) SetDockerLabels(v map[string]*string) *ContainerDefinition { - s.DockerLabels = v - return s -} - -// SetDockerSecurityOptions sets the DockerSecurityOptions field's value. -func (s *ContainerDefinition) SetDockerSecurityOptions(v []*string) *ContainerDefinition { - s.DockerSecurityOptions = v - return s -} - -// SetEntryPoint sets the EntryPoint field's value. -func (s *ContainerDefinition) SetEntryPoint(v []*string) *ContainerDefinition { - s.EntryPoint = v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *ContainerDefinition) SetEnvironment(v []*KeyValuePair) *ContainerDefinition { - s.Environment = v - return s -} - -// SetEssential sets the Essential field's value. -func (s *ContainerDefinition) SetEssential(v bool) *ContainerDefinition { - s.Essential = &v - return s -} - -// SetExtraHosts sets the ExtraHosts field's value. -func (s *ContainerDefinition) SetExtraHosts(v []*HostEntry) *ContainerDefinition { - s.ExtraHosts = v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *ContainerDefinition) SetHostname(v string) *ContainerDefinition { - s.Hostname = &v - return s -} - -// SetImage sets the Image field's value. -func (s *ContainerDefinition) SetImage(v string) *ContainerDefinition { - s.Image = &v - return s -} - -// SetLinks sets the Links field's value. -func (s *ContainerDefinition) SetLinks(v []*string) *ContainerDefinition { - s.Links = v - return s -} - -// SetLogConfiguration sets the LogConfiguration field's value. -func (s *ContainerDefinition) SetLogConfiguration(v *LogConfiguration) *ContainerDefinition { - s.LogConfiguration = v - return s -} - -// SetMemory sets the Memory field's value. -func (s *ContainerDefinition) SetMemory(v int64) *ContainerDefinition { - s.Memory = &v - return s -} - -// SetMemoryReservation sets the MemoryReservation field's value. -func (s *ContainerDefinition) SetMemoryReservation(v int64) *ContainerDefinition { - s.MemoryReservation = &v - return s -} - -// SetMountPoints sets the MountPoints field's value. -func (s *ContainerDefinition) SetMountPoints(v []*MountPoint) *ContainerDefinition { - s.MountPoints = v - return s -} - -// SetName sets the Name field's value. -func (s *ContainerDefinition) SetName(v string) *ContainerDefinition { - s.Name = &v - return s -} - -// SetPortMappings sets the PortMappings field's value. -func (s *ContainerDefinition) SetPortMappings(v []*PortMapping) *ContainerDefinition { - s.PortMappings = v - return s -} - -// SetPrivileged sets the Privileged field's value. -func (s *ContainerDefinition) SetPrivileged(v bool) *ContainerDefinition { - s.Privileged = &v - return s -} - -// SetReadonlyRootFilesystem sets the ReadonlyRootFilesystem field's value. -func (s *ContainerDefinition) SetReadonlyRootFilesystem(v bool) *ContainerDefinition { - s.ReadonlyRootFilesystem = &v - return s -} - -// SetUlimits sets the Ulimits field's value. -func (s *ContainerDefinition) SetUlimits(v []*Ulimit) *ContainerDefinition { - s.Ulimits = v - return s -} - -// SetUser sets the User field's value. -func (s *ContainerDefinition) SetUser(v string) *ContainerDefinition { - s.User = &v - return s -} - -// SetVolumesFrom sets the VolumesFrom field's value. -func (s *ContainerDefinition) SetVolumesFrom(v []*VolumeFrom) *ContainerDefinition { - s.VolumesFrom = v - return s -} - -// SetWorkingDirectory sets the WorkingDirectory field's value. -func (s *ContainerDefinition) SetWorkingDirectory(v string) *ContainerDefinition { - s.WorkingDirectory = &v - return s -} - -// An EC2 instance that is running the Amazon ECS agent and has been registered -// with a cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ContainerInstance -type ContainerInstance struct { - _ struct{} `type:"structure"` - - // This parameter returns true if the agent is actually connected to Amazon - // ECS. Registered instances with an agent that may be unhealthy or stopped - // return false, and instances without a connected agent cannot accept placement - // requests. - AgentConnected *bool `locationName:"agentConnected" type:"boolean"` - - // The status of the most recent agent update. If an update has never been requested, - // this value is NULL. - AgentUpdateStatus *string `locationName:"agentUpdateStatus" type:"string" enum:"AgentUpdateStatus"` - - // The attributes set for the container instance, either by the Amazon ECS container - // agent at instance registration or manually with the PutAttributes operation. - Attributes []*Attribute `locationName:"attributes" type:"list"` - - // The Amazon Resource Name (ARN) of the container instance. The ARN contains - // the arn:aws:ecs namespace, followed by the region of the container instance, - // the AWS account ID of the container instance owner, the container-instance - // namespace, and then the container instance ID. For example, arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID. - ContainerInstanceArn *string `locationName:"containerInstanceArn" type:"string"` - - // The EC2 instance ID of the container instance. - Ec2InstanceId *string `locationName:"ec2InstanceId" type:"string"` - - // The number of tasks on the container instance that are in the PENDING status. - PendingTasksCount *int64 `locationName:"pendingTasksCount" type:"integer"` - - // For most resource types, this parameter describes the registered resources - // on the container instance that are in use by current tasks. For port resource - // types, this parameter describes the ports that were reserved by the Amazon - // ECS container agent when it registered the container instance with Amazon - // ECS. - RegisteredResources []*Resource `locationName:"registeredResources" type:"list"` - - // For most resource types, this parameter describes the remaining resources - // of the container instance that are available for new tasks. For port resource - // types, this parameter describes the ports that are reserved by the Amazon - // ECS container agent and any containers that have reserved port mappings; - // any port that is not specified here is available for new tasks. - RemainingResources []*Resource `locationName:"remainingResources" type:"list"` - - // The number of tasks on the container instance that are in the RUNNING status. - RunningTasksCount *int64 `locationName:"runningTasksCount" type:"integer"` - - // The status of the container instance. The valid values are ACTIVE or INACTIVE. - // ACTIVE indicates that the container instance can accept tasks. - Status *string `locationName:"status" type:"string"` - - // The version counter for the container instance. Every time a container instance - // experiences a change that triggers a CloudWatch event, the version counter - // is incremented. If you are replicating your Amazon ECS container instance - // state with CloudWatch events, you can compare the version of a container - // instance reported by the Amazon ECS APIs with the version reported in CloudWatch - // events for the container instance (inside the detail object) to verify that - // the version in your event stream is current. - Version *int64 `locationName:"version" type:"long"` - - // The version information for the Amazon ECS container agent and Docker daemon - // running on the container instance. - VersionInfo *VersionInfo `locationName:"versionInfo" type:"structure"` -} - -// String returns the string representation -func (s ContainerInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContainerInstance) GoString() string { - return s.String() -} - -// SetAgentConnected sets the AgentConnected field's value. -func (s *ContainerInstance) SetAgentConnected(v bool) *ContainerInstance { - s.AgentConnected = &v - return s -} - -// SetAgentUpdateStatus sets the AgentUpdateStatus field's value. -func (s *ContainerInstance) SetAgentUpdateStatus(v string) *ContainerInstance { - s.AgentUpdateStatus = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *ContainerInstance) SetAttributes(v []*Attribute) *ContainerInstance { - s.Attributes = v - return s -} - -// SetContainerInstanceArn sets the ContainerInstanceArn field's value. -func (s *ContainerInstance) SetContainerInstanceArn(v string) *ContainerInstance { - s.ContainerInstanceArn = &v - return s -} - -// SetEc2InstanceId sets the Ec2InstanceId field's value. -func (s *ContainerInstance) SetEc2InstanceId(v string) *ContainerInstance { - s.Ec2InstanceId = &v - return s -} - -// SetPendingTasksCount sets the PendingTasksCount field's value. -func (s *ContainerInstance) SetPendingTasksCount(v int64) *ContainerInstance { - s.PendingTasksCount = &v - return s -} - -// SetRegisteredResources sets the RegisteredResources field's value. -func (s *ContainerInstance) SetRegisteredResources(v []*Resource) *ContainerInstance { - s.RegisteredResources = v - return s -} - -// SetRemainingResources sets the RemainingResources field's value. -func (s *ContainerInstance) SetRemainingResources(v []*Resource) *ContainerInstance { - s.RemainingResources = v - return s -} - -// SetRunningTasksCount sets the RunningTasksCount field's value. -func (s *ContainerInstance) SetRunningTasksCount(v int64) *ContainerInstance { - s.RunningTasksCount = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ContainerInstance) SetStatus(v string) *ContainerInstance { - s.Status = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *ContainerInstance) SetVersion(v int64) *ContainerInstance { - s.Version = &v - return s -} - -// SetVersionInfo sets the VersionInfo field's value. -func (s *ContainerInstance) SetVersionInfo(v *VersionInfo) *ContainerInstance { - s.VersionInfo = v - return s -} - -// The overrides that should be sent to a container. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ContainerOverride -type ContainerOverride struct { - _ struct{} `type:"structure"` - - // The command to send to the container that overrides the default command from - // the Docker image or the task definition. - Command []*string `locationName:"command" type:"list"` - - // The environment variables to send to the container. You can add new environment - // variables, which are added to the container at launch, or you can override - // the existing environment variables from the Docker image or the task definition. - Environment []*KeyValuePair `locationName:"environment" type:"list"` - - // The name of the container that receives the override. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s ContainerOverride) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContainerOverride) GoString() string { - return s.String() -} - -// SetCommand sets the Command field's value. -func (s *ContainerOverride) SetCommand(v []*string) *ContainerOverride { - s.Command = v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *ContainerOverride) SetEnvironment(v []*KeyValuePair) *ContainerOverride { - s.Environment = v - return s -} - -// SetName sets the Name field's value. -func (s *ContainerOverride) SetName(v string) *ContainerOverride { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateClusterRequest -type CreateClusterInput struct { - _ struct{} `type:"structure"` - - // The name of your cluster. If you do not specify a name for your cluster, - // you create a cluster named default. Up to 255 letters (uppercase and lowercase), - // numbers, hyphens, and underscores are allowed. - ClusterName *string `locationName:"clusterName" type:"string"` -} - -// String returns the string representation -func (s CreateClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterInput) GoString() string { - return s.String() -} - -// SetClusterName sets the ClusterName field's value. -func (s *CreateClusterInput) SetClusterName(v string) *CreateClusterInput { - s.ClusterName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateClusterResponse -type CreateClusterOutput struct { - _ struct{} `type:"structure"` - - // The full description of your new cluster. - Cluster *Cluster `locationName:"cluster" type:"structure"` -} - -// String returns the string representation -func (s CreateClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *CreateClusterOutput) SetCluster(v *Cluster) *CreateClusterOutput { - s.Cluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateServiceRequest -type CreateServiceInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. Up to 32 ASCII characters are allowed. - ClientToken *string `locationName:"clientToken" type:"string"` - - // The short name or full Amazon Resource Name (ARN) of the cluster on which - // to run your service. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // Optional deployment parameters that control how many tasks run during the - // deployment and the ordering of stopping and starting tasks. - DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"` - - // The number of instantiations of the specified task definition to place and - // keep running on your cluster. - // - // DesiredCount is a required field - DesiredCount *int64 `locationName:"desiredCount" type:"integer" required:"true"` - - // A load balancer object representing the load balancer to use with your service. - // Currently, you are limited to one load balancer or target group per service. - // After you create a service, the load balancer name or target group ARN, container - // name, and container port specified in the service definition are immutable. - // - // For Elastic Load Balancing Classic load balancers, this object must contain - // the load balancer name, the container name (as it appears in a container - // definition), and the container port to access from the load balancer. When - // a task from this service is placed on a container instance, the container - // instance is registered with the load balancer specified here. - // - // For Elastic Load Balancing Application load balancers, this object must contain - // the load balancer target group ARN, the container name (as it appears in - // a container definition), and the container port to access from the load balancer. - // When a task from this service is placed on a container instance, the container - // instance and port combination is registered as a target in the target group - // specified here. - LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"` - - // An array of placement constraint objects to use for tasks in your service. - // You can specify a maximum of 10 constraints per task (this limit includes - // constraints in the task definition and those specified at run time). - PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The placement strategy objects to use for tasks in your service. You can - // specify a maximum of 5 strategy rules per service. - PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"` - - // The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon - // ECS to make calls to your load balancer on your behalf. This parameter is - // required if you are using a load balancer with your service. If you specify - // the role parameter, you must also specify a load balancer object with the - // loadBalancers parameter. - // - // If your specified role has a path other than /, then you must either specify - // the full role ARN (this is recommended) or prefix the role name with the - // path. For example, if a role with the name bar has a path of /foo/ then you - // would specify /foo/bar as the role name. For more information, see Friendly - // Names and Paths (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) - // in the IAM User Guide. - Role *string `locationName:"role" type:"string"` - - // The name of your service. Up to 255 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. Service names must be unique within - // a cluster, but you can have similarly named services in multiple clusters - // within a region or across multiple regions. - // - // ServiceName is a required field - ServiceName *string `locationName:"serviceName" type:"string" required:"true"` - - // The family and revision (family:revision) or full Amazon Resource Name (ARN) - // of the task definition to run in your service. If a revision is not specified, - // the latest ACTIVE revision is used. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateServiceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateServiceInput"} - if s.DesiredCount == nil { - invalidParams.Add(request.NewErrParamRequired("DesiredCount")) - } - if s.ServiceName == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceName")) - } - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateServiceInput) SetClientToken(v string) *CreateServiceInput { - s.ClientToken = &v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *CreateServiceInput) SetCluster(v string) *CreateServiceInput { - s.Cluster = &v - return s -} - -// SetDeploymentConfiguration sets the DeploymentConfiguration field's value. -func (s *CreateServiceInput) SetDeploymentConfiguration(v *DeploymentConfiguration) *CreateServiceInput { - s.DeploymentConfiguration = v - return s -} - -// SetDesiredCount sets the DesiredCount field's value. -func (s *CreateServiceInput) SetDesiredCount(v int64) *CreateServiceInput { - s.DesiredCount = &v - return s -} - -// SetLoadBalancers sets the LoadBalancers field's value. -func (s *CreateServiceInput) SetLoadBalancers(v []*LoadBalancer) *CreateServiceInput { - s.LoadBalancers = v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *CreateServiceInput) SetPlacementConstraints(v []*PlacementConstraint) *CreateServiceInput { - s.PlacementConstraints = v - return s -} - -// SetPlacementStrategy sets the PlacementStrategy field's value. -func (s *CreateServiceInput) SetPlacementStrategy(v []*PlacementStrategy) *CreateServiceInput { - s.PlacementStrategy = v - return s -} - -// SetRole sets the Role field's value. -func (s *CreateServiceInput) SetRole(v string) *CreateServiceInput { - s.Role = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *CreateServiceInput) SetServiceName(v string) *CreateServiceInput { - s.ServiceName = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *CreateServiceInput) SetTaskDefinition(v string) *CreateServiceInput { - s.TaskDefinition = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateServiceResponse -type CreateServiceOutput struct { - _ struct{} `type:"structure"` - - // The full description of your service following the create call. - Service *Service `locationName:"service" type:"structure"` -} - -// String returns the string representation -func (s CreateServiceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateServiceOutput) GoString() string { - return s.String() -} - -// SetService sets the Service field's value. -func (s *CreateServiceOutput) SetService(v *Service) *CreateServiceOutput { - s.Service = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAttributesRequest -type DeleteAttributesInput struct { - _ struct{} `type:"structure"` - - // The attributes to delete from your resource. You can specify up to 10 attributes - // per request. For custom attributes, specify the attribute name and target - // ID, but do not specify the value. If you specify the target ID using the - // short form, you must also specify the target type. - // - // Attributes is a required field - Attributes []*Attribute `locationName:"attributes" type:"list" required:"true"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that contains - // the resource to apply attributes. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` -} - -// String returns the string representation -func (s DeleteAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *DeleteAttributesInput) SetAttributes(v []*Attribute) *DeleteAttributesInput { - s.Attributes = v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteAttributesInput) SetCluster(v string) *DeleteAttributesInput { - s.Cluster = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAttributesResponse -type DeleteAttributesOutput struct { - _ struct{} `type:"structure"` - - // A list of attribute objects that were successfully deleted from your resource. - Attributes []*Attribute `locationName:"attributes" type:"list"` -} - -// String returns the string representation -func (s DeleteAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *DeleteAttributesOutput) SetAttributes(v []*Attribute) *DeleteAttributesOutput { - s.Attributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteClusterRequest -type DeleteClusterInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster to delete. - // - // Cluster is a required field - Cluster *string `locationName:"cluster" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"} - if s.Cluster == nil { - invalidParams.Add(request.NewErrParamRequired("Cluster")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteClusterInput) SetCluster(v string) *DeleteClusterInput { - s.Cluster = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteClusterResponse -type DeleteClusterOutput struct { - _ struct{} `type:"structure"` - - // The full description of the deleted cluster. - Cluster *Cluster `locationName:"cluster" type:"structure"` -} - -// String returns the string representation -func (s DeleteClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteClusterOutput) SetCluster(v *Cluster) *DeleteClusterOutput { - s.Cluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteServiceRequest -type DeleteServiceInput struct { - _ struct{} `type:"structure"` - - // The name of the cluster that hosts the service to delete. If you do not specify - // a cluster, the default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The name of the service to delete. - // - // Service is a required field - Service *string `locationName:"service" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteServiceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServiceInput"} - if s.Service == nil { - invalidParams.Add(request.NewErrParamRequired("Service")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteServiceInput) SetCluster(v string) *DeleteServiceInput { - s.Cluster = &v - return s -} - -// SetService sets the Service field's value. -func (s *DeleteServiceInput) SetService(v string) *DeleteServiceInput { - s.Service = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteServiceResponse -type DeleteServiceOutput struct { - _ struct{} `type:"structure"` - - // The full description of the deleted service. - Service *Service `locationName:"service" type:"structure"` -} - -// String returns the string representation -func (s DeleteServiceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteServiceOutput) GoString() string { - return s.String() -} - -// SetService sets the Service field's value. -func (s *DeleteServiceOutput) SetService(v *Service) *DeleteServiceOutput { - s.Service = v - return s -} - -// The details of an Amazon ECS service deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Deployment -type Deployment struct { - _ struct{} `type:"structure"` - - // The Unix timestamp for when the service was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The most recent desired count of tasks that was specified for the service - // to deploy or maintain. - DesiredCount *int64 `locationName:"desiredCount" type:"integer"` - - // The ID of the deployment. - Id *string `locationName:"id" type:"string"` - - // The number of tasks in the deployment that are in the PENDING status. - PendingCount *int64 `locationName:"pendingCount" type:"integer"` - - // The number of tasks in the deployment that are in the RUNNING status. - RunningCount *int64 `locationName:"runningCount" type:"integer"` - - // The status of the deployment. Valid values are PRIMARY (for the most recent - // deployment), ACTIVE (for previous deployments that still have tasks running, - // but are being replaced with the PRIMARY deployment), and INACTIVE (for deployments - // that have been completely replaced). - Status *string `locationName:"status" type:"string"` - - // The most recent task definition that was specified for the service to use. - TaskDefinition *string `locationName:"taskDefinition" type:"string"` - - // The Unix timestamp for when the service was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s Deployment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Deployment) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Deployment) SetCreatedAt(v time.Time) *Deployment { - s.CreatedAt = &v - return s -} - -// SetDesiredCount sets the DesiredCount field's value. -func (s *Deployment) SetDesiredCount(v int64) *Deployment { - s.DesiredCount = &v - return s -} - -// SetId sets the Id field's value. -func (s *Deployment) SetId(v string) *Deployment { - s.Id = &v - return s -} - -// SetPendingCount sets the PendingCount field's value. -func (s *Deployment) SetPendingCount(v int64) *Deployment { - s.PendingCount = &v - return s -} - -// SetRunningCount sets the RunningCount field's value. -func (s *Deployment) SetRunningCount(v int64) *Deployment { - s.RunningCount = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Deployment) SetStatus(v string) *Deployment { - s.Status = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *Deployment) SetTaskDefinition(v string) *Deployment { - s.TaskDefinition = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Deployment) SetUpdatedAt(v time.Time) *Deployment { - s.UpdatedAt = &v - return s -} - -// Optional deployment parameters that control how many tasks run during the -// deployment and the ordering of stopping and starting tasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeploymentConfiguration -type DeploymentConfiguration struct { - _ struct{} `type:"structure"` - - // The upper limit (as a percentage of the service's desiredCount) of the number - // of tasks that are allowed in the RUNNING or PENDING state in a service during - // a deployment. The maximum number of tasks during a deployment is the desiredCount - // multiplied by maximumPercent/100, rounded down to the nearest integer value. - MaximumPercent *int64 `locationName:"maximumPercent" type:"integer"` - - // The lower limit (as a percentage of the service's desiredCount) of the number - // of running tasks that must remain in the RUNNING state in a service during - // a deployment. The minimum healthy tasks during a deployment is the desiredCount - // multiplied by minimumHealthyPercent/100, rounded up to the nearest integer - // value. - MinimumHealthyPercent *int64 `locationName:"minimumHealthyPercent" type:"integer"` -} - -// String returns the string representation -func (s DeploymentConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentConfiguration) GoString() string { - return s.String() -} - -// SetMaximumPercent sets the MaximumPercent field's value. -func (s *DeploymentConfiguration) SetMaximumPercent(v int64) *DeploymentConfiguration { - s.MaximumPercent = &v - return s -} - -// SetMinimumHealthyPercent sets the MinimumHealthyPercent field's value. -func (s *DeploymentConfiguration) SetMinimumHealthyPercent(v int64) *DeploymentConfiguration { - s.MinimumHealthyPercent = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterContainerInstanceRequest -type DeregisterContainerInstanceInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container instance to deregister. If you do not specify a cluster, the - // default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance ID or full Amazon Resource Name (ARN) of the container - // instance to deregister. The ARN contains the arn:aws:ecs namespace, followed - // by the region of the container instance, the AWS account ID of the container - // instance owner, the container-instance namespace, and then the container - // instance ID. For example, arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID. - // - // ContainerInstance is a required field - ContainerInstance *string `locationName:"containerInstance" type:"string" required:"true"` - - // Forces the deregistration of the container instance. If you have tasks running - // on the container instance when you deregister it with the force option, these - // tasks remain running until you terminate the instance or the tasks stop through - // some other means, but they are orphaned (no longer monitored or accounted - // for by Amazon ECS). If an orphaned task on your container instance is part - // of an Amazon ECS service, then the service scheduler starts another copy - // of that task, on a different container instance if possible. - // - // Any containers in orphaned service tasks that are registered with a Classic - // load balancer or an Application load balancer target group are deregistered, - // and they will begin connection draining according to the settings on the - // load balancer or target group. - Force *bool `locationName:"force" type:"boolean"` -} - -// String returns the string representation -func (s DeregisterContainerInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterContainerInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterContainerInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterContainerInstanceInput"} - if s.ContainerInstance == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstance")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DeregisterContainerInstanceInput) SetCluster(v string) *DeregisterContainerInstanceInput { - s.Cluster = &v - return s -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *DeregisterContainerInstanceInput) SetContainerInstance(v string) *DeregisterContainerInstanceInput { - s.ContainerInstance = &v - return s -} - -// SetForce sets the Force field's value. -func (s *DeregisterContainerInstanceInput) SetForce(v bool) *DeregisterContainerInstanceInput { - s.Force = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterContainerInstanceResponse -type DeregisterContainerInstanceOutput struct { - _ struct{} `type:"structure"` - - // The container instance that was deregistered. - ContainerInstance *ContainerInstance `locationName:"containerInstance" type:"structure"` -} - -// String returns the string representation -func (s DeregisterContainerInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterContainerInstanceOutput) GoString() string { - return s.String() -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *DeregisterContainerInstanceOutput) SetContainerInstance(v *ContainerInstance) *DeregisterContainerInstanceOutput { - s.ContainerInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterTaskDefinitionRequest -type DeregisterTaskDefinitionInput struct { - _ struct{} `type:"structure"` - - // The family and revision (family:revision) or full Amazon Resource Name (ARN) - // of the task definition to deregister. You must specify a revision. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterTaskDefinitionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTaskDefinitionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterTaskDefinitionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterTaskDefinitionInput"} - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *DeregisterTaskDefinitionInput) SetTaskDefinition(v string) *DeregisterTaskDefinitionInput { - s.TaskDefinition = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterTaskDefinitionResponse -type DeregisterTaskDefinitionOutput struct { - _ struct{} `type:"structure"` - - // The full description of the deregistered task. - TaskDefinition *TaskDefinition `locationName:"taskDefinition" type:"structure"` -} - -// String returns the string representation -func (s DeregisterTaskDefinitionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTaskDefinitionOutput) GoString() string { - return s.String() -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *DeregisterTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *DeregisterTaskDefinitionOutput { - s.TaskDefinition = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeClustersRequest -type DescribeClustersInput struct { - _ struct{} `type:"structure"` - - // A space-separated list of up to 100 cluster names or full cluster Amazon - // Resource Name (ARN) entries. If you do not specify a cluster, the default - // cluster is assumed. - Clusters []*string `locationName:"clusters" type:"list"` -} - -// String returns the string representation -func (s DescribeClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClustersInput) GoString() string { - return s.String() -} - -// SetClusters sets the Clusters field's value. -func (s *DescribeClustersInput) SetClusters(v []*string) *DescribeClustersInput { - s.Clusters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeClustersResponse -type DescribeClustersOutput struct { - _ struct{} `type:"structure"` - - // The list of clusters. - Clusters []*Cluster `locationName:"clusters" type:"list"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` -} - -// String returns the string representation -func (s DescribeClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClustersOutput) GoString() string { - return s.String() -} - -// SetClusters sets the Clusters field's value. -func (s *DescribeClustersOutput) SetClusters(v []*Cluster) *DescribeClustersOutput { - s.Clusters = v - return s -} - -// SetFailures sets the Failures field's value. -func (s *DescribeClustersOutput) SetFailures(v []*Failure) *DescribeClustersOutput { - s.Failures = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeContainerInstancesRequest -type DescribeContainerInstancesInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container instances to describe. If you do not specify a cluster, the - // default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // A space-separated list of container instance IDs or full Amazon Resource - // Name (ARN) entries. - // - // ContainerInstances is a required field - ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeContainerInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeContainerInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeContainerInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeContainerInstancesInput"} - if s.ContainerInstances == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstances")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DescribeContainerInstancesInput) SetCluster(v string) *DescribeContainerInstancesInput { - s.Cluster = &v - return s -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *DescribeContainerInstancesInput) SetContainerInstances(v []*string) *DescribeContainerInstancesInput { - s.ContainerInstances = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeContainerInstancesResponse -type DescribeContainerInstancesOutput struct { - _ struct{} `type:"structure"` - - // The list of container instances. - ContainerInstances []*ContainerInstance `locationName:"containerInstances" type:"list"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` -} - -// String returns the string representation -func (s DescribeContainerInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeContainerInstancesOutput) GoString() string { - return s.String() -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *DescribeContainerInstancesOutput) SetContainerInstances(v []*ContainerInstance) *DescribeContainerInstancesOutput { - s.ContainerInstances = v - return s -} - -// SetFailures sets the Failures field's value. -func (s *DescribeContainerInstancesOutput) SetFailures(v []*Failure) *DescribeContainerInstancesOutput { - s.Failures = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeServicesRequest -type DescribeServicesInput struct { - _ struct{} `type:"structure"` - - // The name of the cluster that hosts the service to describe. If you do not - // specify a cluster, the default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // A list of services to describe. You may specify up to 10 services to describe - // in a single operation. - // - // Services is a required field - Services []*string `locationName:"services" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeServicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeServicesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeServicesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeServicesInput"} - if s.Services == nil { - invalidParams.Add(request.NewErrParamRequired("Services")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DescribeServicesInput) SetCluster(v string) *DescribeServicesInput { - s.Cluster = &v - return s -} - -// SetServices sets the Services field's value. -func (s *DescribeServicesInput) SetServices(v []*string) *DescribeServicesInput { - s.Services = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeServicesResponse -type DescribeServicesOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` - - // The list of services described. - Services []*Service `locationName:"services" type:"list"` -} - -// String returns the string representation -func (s DescribeServicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeServicesOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *DescribeServicesOutput) SetFailures(v []*Failure) *DescribeServicesOutput { - s.Failures = v - return s -} - -// SetServices sets the Services field's value. -func (s *DescribeServicesOutput) SetServices(v []*Service) *DescribeServicesOutput { - s.Services = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskDefinitionRequest -type DescribeTaskDefinitionInput struct { - _ struct{} `type:"structure"` - - // The family for the latest ACTIVE revision, family and revision (family:revision) - // for a specific revision in the family, or full Amazon Resource Name (ARN) - // of the task definition to describe. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeTaskDefinitionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTaskDefinitionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTaskDefinitionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTaskDefinitionInput"} - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *DescribeTaskDefinitionInput) SetTaskDefinition(v string) *DescribeTaskDefinitionInput { - s.TaskDefinition = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskDefinitionResponse -type DescribeTaskDefinitionOutput struct { - _ struct{} `type:"structure"` - - // The full task definition description. - TaskDefinition *TaskDefinition `locationName:"taskDefinition" type:"structure"` -} - -// String returns the string representation -func (s DescribeTaskDefinitionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTaskDefinitionOutput) GoString() string { - return s.String() -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *DescribeTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *DescribeTaskDefinitionOutput { - s.TaskDefinition = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTasksRequest -type DescribeTasksInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the task to describe. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // A space-separated list of task IDs or full Amazon Resource Name (ARN) entries. - // - // Tasks is a required field - Tasks []*string `locationName:"tasks" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTasksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTasksInput"} - if s.Tasks == nil { - invalidParams.Add(request.NewErrParamRequired("Tasks")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DescribeTasksInput) SetCluster(v string) *DescribeTasksInput { - s.Cluster = &v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *DescribeTasksInput) SetTasks(v []*string) *DescribeTasksInput { - s.Tasks = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTasksResponse -type DescribeTasksOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` - - // The list of tasks. - Tasks []*Task `locationName:"tasks" type:"list"` -} - -// String returns the string representation -func (s DescribeTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTasksOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *DescribeTasksOutput) SetFailures(v []*Failure) *DescribeTasksOutput { - s.Failures = v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *DescribeTasksOutput) SetTasks(v []*Task) *DescribeTasksOutput { - s.Tasks = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DiscoverPollEndpointRequest -type DiscoverPollEndpointInput struct { - _ struct{} `type:"structure"` - - // The cluster that the container instance belongs to. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance ID or full Amazon Resource Name (ARN) of the container - // instance. The ARN contains the arn:aws:ecs namespace, followed by the region - // of the container instance, the AWS account ID of the container instance owner, - // the container-instance namespace, and then the container instance ID. For - // example, arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID. - ContainerInstance *string `locationName:"containerInstance" type:"string"` -} - -// String returns the string representation -func (s DiscoverPollEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiscoverPollEndpointInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *DiscoverPollEndpointInput) SetCluster(v string) *DiscoverPollEndpointInput { - s.Cluster = &v - return s -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *DiscoverPollEndpointInput) SetContainerInstance(v string) *DiscoverPollEndpointInput { - s.ContainerInstance = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DiscoverPollEndpointResponse -type DiscoverPollEndpointOutput struct { - _ struct{} `type:"structure"` - - // The endpoint for the Amazon ECS agent to poll. - Endpoint *string `locationName:"endpoint" type:"string"` - - // The telemetry endpoint for the Amazon ECS agent. - TelemetryEndpoint *string `locationName:"telemetryEndpoint" type:"string"` -} - -// String returns the string representation -func (s DiscoverPollEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiscoverPollEndpointOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *DiscoverPollEndpointOutput) SetEndpoint(v string) *DiscoverPollEndpointOutput { - s.Endpoint = &v - return s -} - -// SetTelemetryEndpoint sets the TelemetryEndpoint field's value. -func (s *DiscoverPollEndpointOutput) SetTelemetryEndpoint(v string) *DiscoverPollEndpointOutput { - s.TelemetryEndpoint = &v - return s -} - -// A failed resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Failure -type Failure struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the failed resource. - Arn *string `locationName:"arn" type:"string"` - - // The reason for the failure. - Reason *string `locationName:"reason" type:"string"` -} - -// String returns the string representation -func (s Failure) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Failure) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Failure) SetArn(v string) *Failure { - s.Arn = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *Failure) SetReason(v string) *Failure { - s.Reason = &v - return s -} - -// Hostnames and IP address entries that are added to the /etc/hosts file of -// a container via the extraHosts parameter of its ContainerDefinition. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/HostEntry -type HostEntry struct { - _ struct{} `type:"structure"` - - // The hostname to use in the /etc/hosts entry. - // - // Hostname is a required field - Hostname *string `locationName:"hostname" type:"string" required:"true"` - - // The IP address to use in the /etc/hosts entry. - // - // IpAddress is a required field - IpAddress *string `locationName:"ipAddress" type:"string" required:"true"` -} - -// String returns the string representation -func (s HostEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostEntry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HostEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HostEntry"} - if s.Hostname == nil { - invalidParams.Add(request.NewErrParamRequired("Hostname")) - } - if s.IpAddress == nil { - invalidParams.Add(request.NewErrParamRequired("IpAddress")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostname sets the Hostname field's value. -func (s *HostEntry) SetHostname(v string) *HostEntry { - s.Hostname = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *HostEntry) SetIpAddress(v string) *HostEntry { - s.IpAddress = &v - return s -} - -// Details on a container instance host volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/HostVolumeProperties -type HostVolumeProperties struct { - _ struct{} `type:"structure"` - - // The path on the host container instance that is presented to the container. - // If this parameter is empty, then the Docker daemon has assigned a host path - // for you. If the host parameter contains a sourcePath file location, then - // the data volume persists at the specified location on the host container - // instance until you delete it manually. If the sourcePath value does not exist - // on the host container instance, the Docker daemon creates it. If the location - // does exist, the contents of the source path folder are exported. - SourcePath *string `locationName:"sourcePath" type:"string"` -} - -// String returns the string representation -func (s HostVolumeProperties) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostVolumeProperties) GoString() string { - return s.String() -} - -// SetSourcePath sets the SourcePath field's value. -func (s *HostVolumeProperties) SetSourcePath(v string) *HostVolumeProperties { - s.SourcePath = &v - return s -} - -// A key and value pair object. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/KeyValuePair -type KeyValuePair struct { - _ struct{} `type:"structure"` - - // The name of the key value pair. For environment variables, this is the name - // of the environment variable. - Name *string `locationName:"name" type:"string"` - - // The value of the key value pair. For environment variables, this is the value - // of the environment variable. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s KeyValuePair) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyValuePair) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *KeyValuePair) SetName(v string) *KeyValuePair { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *KeyValuePair) SetValue(v string) *KeyValuePair { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAttributesRequest -type ListAttributesInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute with which to filter the results. - AttributeName *string `locationName:"attributeName" type:"string"` - - // The value of the attribute with which to filter results. You must also specify - // an attribute name to use this parameter. - AttributeValue *string `locationName:"attributeValue" type:"string"` - - // The short name or full Amazon Resource Name (ARN) of the cluster to list - // attributes. If you do not specify a cluster, the default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The maximum number of cluster results returned by ListAttributes in paginated - // output. When this parameter is used, ListAttributes 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 ListAttributes - // request with the returned nextToken value. This value can be between 1 and - // 100. If this parameter is not used, then ListAttributes returns up to 100 - // results and a nextToken value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListAttributes 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The type of the target with which to list attributes. - // - // TargetType is a required field - TargetType *string `locationName:"targetType" type:"string" required:"true" enum:"TargetType"` -} - -// String returns the string representation -func (s ListAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAttributesInput"} - if s.TargetType == nil { - invalidParams.Add(request.NewErrParamRequired("TargetType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *ListAttributesInput) SetAttributeName(v string) *ListAttributesInput { - s.AttributeName = &v - return s -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *ListAttributesInput) SetAttributeValue(v string) *ListAttributesInput { - s.AttributeValue = &v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *ListAttributesInput) SetCluster(v string) *ListAttributesInput { - s.Cluster = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAttributesInput) SetMaxResults(v int64) *ListAttributesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAttributesInput) SetNextToken(v string) *ListAttributesInput { - s.NextToken = &v - return s -} - -// SetTargetType sets the TargetType field's value. -func (s *ListAttributesInput) SetTargetType(v string) *ListAttributesInput { - s.TargetType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAttributesResponse -type ListAttributesOutput struct { - _ struct{} `type:"structure"` - - // A list of attribute objects that meet the criteria of the request. - Attributes []*Attribute `locationName:"attributes" type:"list"` - - // The nextToken value to include in a future ListAttributes request. When the - // results of a ListAttributes 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"` -} - -// String returns the string representation -func (s ListAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *ListAttributesOutput) SetAttributes(v []*Attribute) *ListAttributesOutput { - s.Attributes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAttributesOutput) SetNextToken(v string) *ListAttributesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListClustersRequest -type ListClustersInput struct { - _ struct{} `type:"structure"` - - // The maximum number of cluster results returned by ListClusters in paginated - // output. When this parameter is used, ListClusters 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 ListClusters - // request with the returned nextToken value. This value can be between 1 and - // 100. If this parameter is not used, then ListClusters returns up to 100 results - // and a nextToken value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListClusters 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListClustersInput) GoString() string { - return s.String() -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListClustersInput) SetMaxResults(v int64) *ListClustersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListClustersInput) SetNextToken(v string) *ListClustersInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListClustersResponse -type ListClustersOutput struct { - _ struct{} `type:"structure"` - - // The list of full Amazon Resource Name (ARN) entries for each cluster associated - // with your account. - ClusterArns []*string `locationName:"clusterArns" type:"list"` - - // The nextToken value to include in a future ListClusters request. When the - // results of a ListClusters 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"` -} - -// String returns the string representation -func (s ListClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListClustersOutput) GoString() string { - return s.String() -} - -// SetClusterArns sets the ClusterArns field's value. -func (s *ListClustersOutput) SetClusterArns(v []*string) *ListClustersOutput { - s.ClusterArns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListClustersOutput) SetNextToken(v string) *ListClustersOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListContainerInstancesRequest -type ListContainerInstancesInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container instances to list. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // You can filter the results of a ListContainerInstances operation with cluster - // query language statements. For more information, see Cluster Query Language - // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) - // in the Amazon EC2 Container Service Developer Guide. - Filter *string `locationName:"filter" type:"string"` - - // The maximum number of container instance results returned by ListContainerInstances - // in paginated output. When this parameter is used, ListContainerInstances - // 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 ListContainerInstances request with the returned nextToken value. - // This value can be between 1 and 100. If this parameter is not used, then - // ListContainerInstances returns up to 100 results and a nextToken value if - // applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListContainerInstances - // 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The container instance status with which to filter the ListContainerInstances - // results. Specifying a container instance status of DRAINING limits the results - // to container instances that have been set to drain with the UpdateContainerInstancesState - // operation. - Status *string `locationName:"status" type:"string" enum:"ContainerInstanceStatus"` -} - -// String returns the string representation -func (s ListContainerInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListContainerInstancesInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ListContainerInstancesInput) SetCluster(v string) *ListContainerInstancesInput { - s.Cluster = &v - return s -} - -// SetFilter sets the Filter field's value. -func (s *ListContainerInstancesInput) SetFilter(v string) *ListContainerInstancesInput { - s.Filter = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListContainerInstancesInput) SetMaxResults(v int64) *ListContainerInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListContainerInstancesInput) SetNextToken(v string) *ListContainerInstancesInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListContainerInstancesInput) SetStatus(v string) *ListContainerInstancesInput { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListContainerInstancesResponse -type ListContainerInstancesOutput struct { - _ struct{} `type:"structure"` - - // The list of container instances with full Amazon Resource Name (ARN) entries - // for each container instance associated with the specified cluster. - ContainerInstanceArns []*string `locationName:"containerInstanceArns" type:"list"` - - // The nextToken value to include in a future ListContainerInstances request. - // When the results of a ListContainerInstances 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"` -} - -// String returns the string representation -func (s ListContainerInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListContainerInstancesOutput) GoString() string { - return s.String() -} - -// SetContainerInstanceArns sets the ContainerInstanceArns field's value. -func (s *ListContainerInstancesOutput) SetContainerInstanceArns(v []*string) *ListContainerInstancesOutput { - s.ContainerInstanceArns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListContainerInstancesOutput) SetNextToken(v string) *ListContainerInstancesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListServicesRequest -type ListServicesInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the services to list. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The maximum number of container instance results returned by ListServices - // in paginated output. When this parameter is used, ListServices 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 - // ListServices request with the returned nextToken value. This value can be - // between 1 and 10. If this parameter is not used, then ListServices returns - // up to 10 results and a nextToken value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListServices 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListServicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListServicesInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ListServicesInput) SetCluster(v string) *ListServicesInput { - s.Cluster = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListServicesInput) SetMaxResults(v int64) *ListServicesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServicesInput) SetNextToken(v string) *ListServicesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListServicesResponse -type ListServicesOutput struct { - _ struct{} `type:"structure"` - - // The nextToken value to include in a future ListServices request. When the - // results of a ListServices 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"` - - // The list of full Amazon Resource Name (ARN) entries for each service associated - // with the specified cluster. - ServiceArns []*string `locationName:"serviceArns" type:"list"` -} - -// String returns the string representation -func (s ListServicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListServicesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServicesOutput) SetNextToken(v string) *ListServicesOutput { - s.NextToken = &v - return s -} - -// SetServiceArns sets the ServiceArns field's value. -func (s *ListServicesOutput) SetServiceArns(v []*string) *ListServicesOutput { - s.ServiceArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionFamiliesRequest -type ListTaskDefinitionFamiliesInput struct { - _ struct{} `type:"structure"` - - // The familyPrefix is a string that is used to filter the results of ListTaskDefinitionFamilies. - // If you specify a familyPrefix, only task definition family names that begin - // with the familyPrefix string are returned. - FamilyPrefix *string `locationName:"familyPrefix" type:"string"` - - // The maximum number of task definition family results returned by ListTaskDefinitionFamilies - // in paginated output. When this parameter is used, ListTaskDefinitions 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 ListTaskDefinitionFamilies request with the returned nextToken value. - // This value can be between 1 and 100. If this parameter is not used, then - // ListTaskDefinitionFamilies returns up to 100 results and a nextToken value - // if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListTaskDefinitionFamilies - // 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The task definition family status with which to filter the ListTaskDefinitionFamilies - // results. By default, both ACTIVE and INACTIVE task definition families are - // listed. If this parameter is set to ACTIVE, only task definition families - // that have an ACTIVE task definition revision are returned. If this parameter - // is set to INACTIVE, only task definition families that do not have any ACTIVE - // task definition revisions are returned. If you paginate the resulting output, - // be sure to keep the status value constant in each subsequent request. - Status *string `locationName:"status" type:"string" enum:"TaskDefinitionFamilyStatus"` -} - -// String returns the string representation -func (s ListTaskDefinitionFamiliesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTaskDefinitionFamiliesInput) GoString() string { - return s.String() -} - -// SetFamilyPrefix sets the FamilyPrefix field's value. -func (s *ListTaskDefinitionFamiliesInput) SetFamilyPrefix(v string) *ListTaskDefinitionFamiliesInput { - s.FamilyPrefix = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTaskDefinitionFamiliesInput) SetMaxResults(v int64) *ListTaskDefinitionFamiliesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTaskDefinitionFamiliesInput) SetNextToken(v string) *ListTaskDefinitionFamiliesInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListTaskDefinitionFamiliesInput) SetStatus(v string) *ListTaskDefinitionFamiliesInput { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionFamiliesResponse -type ListTaskDefinitionFamiliesOutput struct { - _ struct{} `type:"structure"` - - // The list of task definition family names that match the ListTaskDefinitionFamilies - // request. - Families []*string `locationName:"families" type:"list"` - - // The nextToken value to include in a future ListTaskDefinitionFamilies request. - // When the results of a ListTaskDefinitionFamilies 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"` -} - -// String returns the string representation -func (s ListTaskDefinitionFamiliesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTaskDefinitionFamiliesOutput) GoString() string { - return s.String() -} - -// SetFamilies sets the Families field's value. -func (s *ListTaskDefinitionFamiliesOutput) SetFamilies(v []*string) *ListTaskDefinitionFamiliesOutput { - s.Families = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTaskDefinitionFamiliesOutput) SetNextToken(v string) *ListTaskDefinitionFamiliesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionsRequest -type ListTaskDefinitionsInput struct { - _ struct{} `type:"structure"` - - // The full family name with which to filter the ListTaskDefinitions results. - // Specifying a familyPrefix limits the listed task definitions to task definition - // revisions that belong to that family. - FamilyPrefix *string `locationName:"familyPrefix" type:"string"` - - // The maximum number of task definition results returned by ListTaskDefinitions - // in paginated output. When this parameter is used, ListTaskDefinitions 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 ListTaskDefinitions request with the returned nextToken value. This - // value can be between 1 and 100. If this parameter is not used, then ListTaskDefinitions - // returns up to 100 results and a nextToken value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListTaskDefinitions - // 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The order in which to sort the results. Valid values are ASC and DESC. By - // default (ASC), task definitions are listed lexicographically by family name - // and in ascending numerical order by revision so that the newest task definitions - // in a family are listed last. Setting this parameter to DESC reverses the - // sort order on family name and revision so that the newest task definitions - // in a family are listed first. - Sort *string `locationName:"sort" type:"string" enum:"SortOrder"` - - // The task definition status with which to filter the ListTaskDefinitions results. - // By default, only ACTIVE task definitions are listed. By setting this parameter - // to INACTIVE, you can view task definitions that are INACTIVE as long as an - // active task or service still references them. If you paginate the resulting - // output, be sure to keep the status value constant in each subsequent request. - Status *string `locationName:"status" type:"string" enum:"TaskDefinitionStatus"` -} - -// String returns the string representation -func (s ListTaskDefinitionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTaskDefinitionsInput) GoString() string { - return s.String() -} - -// SetFamilyPrefix sets the FamilyPrefix field's value. -func (s *ListTaskDefinitionsInput) SetFamilyPrefix(v string) *ListTaskDefinitionsInput { - s.FamilyPrefix = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTaskDefinitionsInput) SetMaxResults(v int64) *ListTaskDefinitionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTaskDefinitionsInput) SetNextToken(v string) *ListTaskDefinitionsInput { - s.NextToken = &v - return s -} - -// SetSort sets the Sort field's value. -func (s *ListTaskDefinitionsInput) SetSort(v string) *ListTaskDefinitionsInput { - s.Sort = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListTaskDefinitionsInput) SetStatus(v string) *ListTaskDefinitionsInput { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionsResponse -type ListTaskDefinitionsOutput struct { - _ struct{} `type:"structure"` - - // The nextToken value to include in a future ListTaskDefinitions request. When - // the results of a ListTaskDefinitions 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"` - - // The list of task definition Amazon Resource Name (ARN) entries for the ListTaskDefinitions - // request. - TaskDefinitionArns []*string `locationName:"taskDefinitionArns" type:"list"` -} - -// String returns the string representation -func (s ListTaskDefinitionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTaskDefinitionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTaskDefinitionsOutput) SetNextToken(v string) *ListTaskDefinitionsOutput { - s.NextToken = &v - return s -} - -// SetTaskDefinitionArns sets the TaskDefinitionArns field's value. -func (s *ListTaskDefinitionsOutput) SetTaskDefinitionArns(v []*string) *ListTaskDefinitionsOutput { - s.TaskDefinitionArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasksRequest -type ListTasksInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the tasks to list. If you do not specify a cluster, the default cluster is - // assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance ID or full Amazon Resource Name (ARN) of the container - // instance with which to filter the ListTasks results. Specifying a containerInstance - // limits the results to tasks that belong to that container instance. - ContainerInstance *string `locationName:"containerInstance" type:"string"` - - // The task desired status with which to filter the ListTasks results. Specifying - // a desiredStatus of STOPPED limits the results to tasks that ECS has set the - // desired status to STOPPED, which can be useful for debugging tasks that are - // not starting properly or have died or finished. The default status filter - // is RUNNING, which shows tasks that ECS has set the desired status to RUNNING. - // - // Although you can filter results based on a desired status of PENDING, this - // will not return any results because ECS never sets the desired status of - // a task to that value (only a task's lastStatus may have a value of PENDING). - DesiredStatus *string `locationName:"desiredStatus" type:"string" enum:"DesiredStatus"` - - // The name of the family with which to filter the ListTasks results. Specifying - // a family limits the results to tasks that belong to that family. - Family *string `locationName:"family" type:"string"` - - // The maximum number of task results returned by ListTasks in paginated output. - // When this parameter is used, ListTasks 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 ListTasks request with - // the returned nextToken value. This value can be between 1 and 100. If this - // parameter is not used, then ListTasks returns up to 100 results and a nextToken - // value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListTasks 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. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The name of the service with which to filter the ListTasks results. Specifying - // a serviceName limits the results to tasks that belong to that service. - ServiceName *string `locationName:"serviceName" type:"string"` - - // The startedBy value with which to filter the task results. Specifying a startedBy - // value limits the results to tasks that were started with that value. - StartedBy *string `locationName:"startedBy" type:"string"` -} - -// String returns the string representation -func (s ListTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTasksInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ListTasksInput) SetCluster(v string) *ListTasksInput { - s.Cluster = &v - return s -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *ListTasksInput) SetContainerInstance(v string) *ListTasksInput { - s.ContainerInstance = &v - return s -} - -// SetDesiredStatus sets the DesiredStatus field's value. -func (s *ListTasksInput) SetDesiredStatus(v string) *ListTasksInput { - s.DesiredStatus = &v - return s -} - -// SetFamily sets the Family field's value. -func (s *ListTasksInput) SetFamily(v string) *ListTasksInput { - s.Family = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTasksInput) SetMaxResults(v int64) *ListTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTasksInput) SetNextToken(v string) *ListTasksInput { - s.NextToken = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *ListTasksInput) SetServiceName(v string) *ListTasksInput { - s.ServiceName = &v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *ListTasksInput) SetStartedBy(v string) *ListTasksInput { - s.StartedBy = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasksResponse -type ListTasksOutput struct { - _ struct{} `type:"structure"` - - // The nextToken value to include in a future ListTasks request. When the results - // of a ListTasks 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"` - - // The list of task Amazon Resource Name (ARN) entries for the ListTasks request. - TaskArns []*string `locationName:"taskArns" type:"list"` -} - -// String returns the string representation -func (s ListTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTasksOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTasksOutput) SetNextToken(v string) *ListTasksOutput { - s.NextToken = &v - return s -} - -// SetTaskArns sets the TaskArns field's value. -func (s *ListTasksOutput) SetTaskArns(v []*string) *ListTasksOutput { - s.TaskArns = v - return s -} - -// Details on a load balancer that is used with a service. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/LoadBalancer -type LoadBalancer struct { - _ struct{} `type:"structure"` - - // The name of the container (as it appears in a container definition) to associate - // with the load balancer. - ContainerName *string `locationName:"containerName" type:"string"` - - // The port on the container to associate with the load balancer. This port - // must correspond to a containerPort in the service's task definition. Your - // container instances must allow ingress traffic on the hostPort of the port - // mapping. - ContainerPort *int64 `locationName:"containerPort" type:"integer"` - - // The name of the load balancer. - LoadBalancerName *string `locationName:"loadBalancerName" type:"string"` - - // The full Amazon Resource Name (ARN) of the Elastic Load Balancing target - // group associated with a service. - TargetGroupArn *string `locationName:"targetGroupArn" type:"string"` -} - -// String returns the string representation -func (s LoadBalancer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancer) GoString() string { - return s.String() -} - -// SetContainerName sets the ContainerName field's value. -func (s *LoadBalancer) SetContainerName(v string) *LoadBalancer { - s.ContainerName = &v - return s -} - -// SetContainerPort sets the ContainerPort field's value. -func (s *LoadBalancer) SetContainerPort(v int64) *LoadBalancer { - s.ContainerPort = &v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *LoadBalancer) SetLoadBalancerName(v string) *LoadBalancer { - s.LoadBalancerName = &v - return s -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *LoadBalancer) SetTargetGroupArn(v string) *LoadBalancer { - s.TargetGroupArn = &v - return s -} - -// Log configuration options to send to a custom log driver for the container. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/LogConfiguration -type LogConfiguration struct { - _ struct{} `type:"structure"` - - // The log driver to use for the container. The valid values listed for this - // parameter are log drivers that the Amazon ECS container agent can communicate - // with by default. - // - // If you have a custom driver that is not listed above that you would like - // to work with the Amazon ECS container agent, you can fork the Amazon ECS - // container agent project that is available on GitHub (https://github.com/aws/amazon-ecs-agent) - // and customize it to work with that driver. We encourage you to submit pull - // requests for changes that you would like to have included. However, Amazon - // Web Services does not currently provide support for running modified copies - // of this software. - // - // This parameter requires version 1.18 of the Docker Remote API or greater - // on your container instance. To check the Docker Remote API version on your - // container instance, log into your container instance and run the following - // command: sudo docker version | grep "Server API version" - // - // LogDriver is a required field - LogDriver *string `locationName:"logDriver" type:"string" required:"true" enum:"LogDriver"` - - // The configuration options to send to the log driver. This parameter requires - // version 1.19 of the Docker Remote API or greater on your container instance. - // To check the Docker Remote API version on your container instance, log into - // your container instance and run the following command: sudo docker version - // | grep "Server API version" - Options map[string]*string `locationName:"options" type:"map"` -} - -// String returns the string representation -func (s LogConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LogConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LogConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LogConfiguration"} - if s.LogDriver == nil { - invalidParams.Add(request.NewErrParamRequired("LogDriver")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogDriver sets the LogDriver field's value. -func (s *LogConfiguration) SetLogDriver(v string) *LogConfiguration { - s.LogDriver = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *LogConfiguration) SetOptions(v map[string]*string) *LogConfiguration { - s.Options = v - return s -} - -// Details on a volume mount point that is used in a container definition. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/MountPoint -type MountPoint struct { - _ struct{} `type:"structure"` - - // The path on the container to mount the host volume at. - ContainerPath *string `locationName:"containerPath" type:"string"` - - // If this value is true, the container has read-only access to the volume. - // If this value is false, then the container can write to the volume. The default - // value is false. - ReadOnly *bool `locationName:"readOnly" type:"boolean"` - - // The name of the volume to mount. - SourceVolume *string `locationName:"sourceVolume" type:"string"` -} - -// String returns the string representation -func (s MountPoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MountPoint) GoString() string { - return s.String() -} - -// SetContainerPath sets the ContainerPath field's value. -func (s *MountPoint) SetContainerPath(v string) *MountPoint { - s.ContainerPath = &v - return s -} - -// SetReadOnly sets the ReadOnly field's value. -func (s *MountPoint) SetReadOnly(v bool) *MountPoint { - s.ReadOnly = &v - return s -} - -// SetSourceVolume sets the SourceVolume field's value. -func (s *MountPoint) SetSourceVolume(v string) *MountPoint { - s.SourceVolume = &v - return s -} - -// Details on the network bindings between a container and its host container -// instance. After a task reaches the RUNNING status, manual and automatic host -// and container port assignments are visible in the networkBindings section -// of DescribeTasks API responses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/NetworkBinding -type NetworkBinding struct { - _ struct{} `type:"structure"` - - // The IP address that the container is bound to on the container instance. - BindIP *string `locationName:"bindIP" type:"string"` - - // The port number on the container that is be used with the network binding. - ContainerPort *int64 `locationName:"containerPort" type:"integer"` - - // The port number on the host that is used with the network binding. - HostPort *int64 `locationName:"hostPort" type:"integer"` - - // The protocol used for the network binding. - Protocol *string `locationName:"protocol" type:"string" enum:"TransportProtocol"` -} - -// String returns the string representation -func (s NetworkBinding) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkBinding) GoString() string { - return s.String() -} - -// SetBindIP sets the BindIP field's value. -func (s *NetworkBinding) SetBindIP(v string) *NetworkBinding { - s.BindIP = &v - return s -} - -// SetContainerPort sets the ContainerPort field's value. -func (s *NetworkBinding) SetContainerPort(v int64) *NetworkBinding { - s.ContainerPort = &v - return s -} - -// SetHostPort sets the HostPort field's value. -func (s *NetworkBinding) SetHostPort(v int64) *NetworkBinding { - s.HostPort = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *NetworkBinding) SetProtocol(v string) *NetworkBinding { - s.Protocol = &v - return s -} - -// An object representing a constraint on task placement. For more information, -// see Task Placement Constraints (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) -// in the Amazon EC2 Container Service Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PlacementConstraint -type PlacementConstraint struct { - _ struct{} `type:"structure"` - - // A cluster query language expression to apply to the constraint. Note you - // cannot specify an expression if the constraint type is distinctInstance. - // For more information, see Cluster Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) - // in the Amazon EC2 Container Service Developer Guide. - Expression *string `locationName:"expression" type:"string"` - - // The type of constraint. Use distinctInstance to ensure that each task in - // a particular group is running on a different container instance. Use memberOf - // to restrict selection to a group of valid candidates. Note that distinctInstance - // is not supported in task definitions. - Type *string `locationName:"type" type:"string" enum:"PlacementConstraintType"` -} - -// String returns the string representation -func (s PlacementConstraint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlacementConstraint) GoString() string { - return s.String() -} - -// SetExpression sets the Expression field's value. -func (s *PlacementConstraint) SetExpression(v string) *PlacementConstraint { - s.Expression = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlacementConstraint) SetType(v string) *PlacementConstraint { - s.Type = &v - return s -} - -// The task placement strategy for a task or service. For more information, -// see Task Placement Strategies (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) -// in the Amazon EC2 Container Service Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PlacementStrategy -type PlacementStrategy struct { - _ struct{} `type:"structure"` - - // The field to apply the placement strategy against. For the spread placement - // strategy, valid values are instanceId (or host, which has the same effect), - // or any platform or custom attribute that is applied to a container instance, - // such as attribute:ecs.availability-zone. For the binpack placement strategy, - // valid values are cpu and memory. For the random placement strategy, this - // field is not used. - Field *string `locationName:"field" type:"string"` - - // The type of placement strategy. The random placement strategy randomly places - // tasks on available candidates. The spread placement strategy spreads placement - // across available candidates evenly based on the field parameter. The binpack - // strategy places tasks on available candidates that have the least available - // amount of the resource that is specified with the field parameter. For example, - // if you binpack on memory, a task is placed on the instance with the least - // amount of remaining memory (but still enough to run the task). - Type *string `locationName:"type" type:"string" enum:"PlacementStrategyType"` -} - -// String returns the string representation -func (s PlacementStrategy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlacementStrategy) GoString() string { - return s.String() -} - -// SetField sets the Field field's value. -func (s *PlacementStrategy) SetField(v string) *PlacementStrategy { - s.Field = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlacementStrategy) SetType(v string) *PlacementStrategy { - s.Type = &v - return s -} - -// Port mappings allow containers to access ports on the host container instance -// to send or receive traffic. Port mappings are specified as part of the container -// definition. After a task reaches the RUNNING status, manual and automatic -// host and container port assignments are visible in the networkBindings section -// of DescribeTasks API responses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PortMapping -type PortMapping struct { - _ struct{} `type:"structure"` - - // The port number on the container that is bound to the user-specified or automatically - // assigned host port. If you specify a container port and not a host port, - // your container automatically receives a host port in the ephemeral port range - // (for more information, see hostPort). Port mappings that are automatically - // assigned in this way do not count toward the 100 reserved ports limit of - // a container instance. - ContainerPort *int64 `locationName:"containerPort" type:"integer"` - - // The port number on the container instance to reserve for your container. - // You can specify a non-reserved host port for your container port mapping, - // or you can omit the hostPort (or set it to 0) while specifying a containerPort - // and your container automatically receives a port in the ephemeral port range - // for your container instance operating system and Docker version. - // - // The default ephemeral port range is 49153 to 65535, and this range is used - // for Docker versions prior to 1.6.0. For Docker version 1.6.0 and later, the - // Docker daemon tries to read the ephemeral port range from /proc/sys/net/ipv4/ip_local_port_range; - // if this kernel parameter is unavailable, the default ephemeral port range - // is used. You should not attempt to specify a host port in the ephemeral port - // range, because these are reserved for automatic assignment. In general, ports - // below 32768 are outside of the ephemeral port range. - // - // The default reserved ports are 22 for SSH, the Docker ports 2375 and 2376, - // and the Amazon ECS container agent ports 51678 and 51679. Any host port that - // was previously specified in a running task is also reserved while the task - // is running (after a task stops, the host port is released).The current reserved - // ports are displayed in the remainingResources of DescribeContainerInstances - // output, and a container instance may have up to 100 reserved ports at a time, - // including the default reserved ports (automatically assigned ports do not - // count toward the 100 reserved ports limit). - HostPort *int64 `locationName:"hostPort" type:"integer"` - - // The protocol used for the port mapping. Valid values are tcp and udp. The - // default is tcp. - Protocol *string `locationName:"protocol" type:"string" enum:"TransportProtocol"` -} - -// String returns the string representation -func (s PortMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PortMapping) GoString() string { - return s.String() -} - -// SetContainerPort sets the ContainerPort field's value. -func (s *PortMapping) SetContainerPort(v int64) *PortMapping { - s.ContainerPort = &v - return s -} - -// SetHostPort sets the HostPort field's value. -func (s *PortMapping) SetHostPort(v int64) *PortMapping { - s.HostPort = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *PortMapping) SetProtocol(v string) *PortMapping { - s.Protocol = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAttributesRequest -type PutAttributesInput struct { - _ struct{} `type:"structure"` - - // The attributes to apply to your resource. You can specify up to 10 custom - // attributes per resource. You can specify up to 10 attributes in a single - // call. - // - // Attributes is a required field - Attributes []*Attribute `locationName:"attributes" type:"list" required:"true"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that contains - // the resource to apply attributes. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` -} - -// String returns the string representation -func (s PutAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *PutAttributesInput) SetAttributes(v []*Attribute) *PutAttributesInput { - s.Attributes = v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *PutAttributesInput) SetCluster(v string) *PutAttributesInput { - s.Cluster = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAttributesResponse -type PutAttributesOutput struct { - _ struct{} `type:"structure"` - - // The attributes applied to your resource. - Attributes []*Attribute `locationName:"attributes" type:"list"` -} - -// String returns the string representation -func (s PutAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *PutAttributesOutput) SetAttributes(v []*Attribute) *PutAttributesOutput { - s.Attributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterContainerInstanceRequest -type RegisterContainerInstanceInput struct { - _ struct{} `type:"structure"` - - // The container instance attributes that this container instance supports. - Attributes []*Attribute `locationName:"attributes" type:"list"` - - // The short name or full Amazon Resource Name (ARN) of the cluster with which - // to register your container instance. If you do not specify a cluster, the - // default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The Amazon Resource Name (ARN) of the container instance (if it was previously - // registered). - ContainerInstanceArn *string `locationName:"containerInstanceArn" type:"string"` - - // The instance identity document for the EC2 instance to register. This document - // can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/ - InstanceIdentityDocument *string `locationName:"instanceIdentityDocument" type:"string"` - - // The instance identity document signature for the EC2 instance to register. - // This signature can be found by running the following command from the instance: - // curl http://169.254.169.254/latest/dynamic/instance-identity/signature/ - InstanceIdentityDocumentSignature *string `locationName:"instanceIdentityDocumentSignature" type:"string"` - - // The resources available on the instance. - TotalResources []*Resource `locationName:"totalResources" type:"list"` - - // The version information for the Amazon ECS container agent and Docker daemon - // running on the container instance. - VersionInfo *VersionInfo `locationName:"versionInfo" type:"structure"` -} - -// String returns the string representation -func (s RegisterContainerInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterContainerInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterContainerInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterContainerInstanceInput"} - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *RegisterContainerInstanceInput) SetAttributes(v []*Attribute) *RegisterContainerInstanceInput { - s.Attributes = v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *RegisterContainerInstanceInput) SetCluster(v string) *RegisterContainerInstanceInput { - s.Cluster = &v - return s -} - -// SetContainerInstanceArn sets the ContainerInstanceArn field's value. -func (s *RegisterContainerInstanceInput) SetContainerInstanceArn(v string) *RegisterContainerInstanceInput { - s.ContainerInstanceArn = &v - return s -} - -// SetInstanceIdentityDocument sets the InstanceIdentityDocument field's value. -func (s *RegisterContainerInstanceInput) SetInstanceIdentityDocument(v string) *RegisterContainerInstanceInput { - s.InstanceIdentityDocument = &v - return s -} - -// SetInstanceIdentityDocumentSignature sets the InstanceIdentityDocumentSignature field's value. -func (s *RegisterContainerInstanceInput) SetInstanceIdentityDocumentSignature(v string) *RegisterContainerInstanceInput { - s.InstanceIdentityDocumentSignature = &v - return s -} - -// SetTotalResources sets the TotalResources field's value. -func (s *RegisterContainerInstanceInput) SetTotalResources(v []*Resource) *RegisterContainerInstanceInput { - s.TotalResources = v - return s -} - -// SetVersionInfo sets the VersionInfo field's value. -func (s *RegisterContainerInstanceInput) SetVersionInfo(v *VersionInfo) *RegisterContainerInstanceInput { - s.VersionInfo = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterContainerInstanceResponse -type RegisterContainerInstanceOutput struct { - _ struct{} `type:"structure"` - - // The container instance that was registered. - ContainerInstance *ContainerInstance `locationName:"containerInstance" type:"structure"` -} - -// String returns the string representation -func (s RegisterContainerInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterContainerInstanceOutput) GoString() string { - return s.String() -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *RegisterContainerInstanceOutput) SetContainerInstance(v *ContainerInstance) *RegisterContainerInstanceOutput { - s.ContainerInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterTaskDefinitionRequest -type RegisterTaskDefinitionInput struct { - _ struct{} `type:"structure"` - - // A list of container definitions in JSON format that describe the different - // containers that make up your task. - // - // ContainerDefinitions is a required field - ContainerDefinitions []*ContainerDefinition `locationName:"containerDefinitions" type:"list" required:"true"` - - // You must specify a family for a task definition, which allows you to track - // multiple versions of the same task definition. The family is used as a name - // for your task definition. Up to 255 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. - // - // Family is a required field - Family *string `locationName:"family" type:"string" required:"true"` - - // The Docker networking mode to use for the containers in the task. The valid - // values are none, bridge, and host. - // - // The default Docker network mode is bridge. If the network mode is set to - // none, you cannot specify port mappings in your container definitions, and - // the task's containers do not have external connectivity. The host network - // mode offers the highest networking performance for containers because they - // use the host network stack instead of the virtualized network stack provided - // by the bridge mode; however, exposed container ports are mapped directly - // to the corresponding host port, so you cannot take advantage of dynamic host - // port mappings or run multiple instantiations of the same task on a single - // container instance if port mappings are used. - // - // For more information, see Network settings (https://docs.docker.com/engine/reference/run/#network-settings) - // in the Docker run reference. - NetworkMode *string `locationName:"networkMode" type:"string" enum:"NetworkMode"` - - // An array of placement constraint objects to use for the task. You can specify - // a maximum of 10 constraints per task (this limit includes constraints in - // the task definition and those specified at run time). - PlacementConstraints []*TaskDefinitionPlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The short name or full Amazon Resource Name (ARN) of the IAM role that containers - // in this task can assume. All containers in this task are granted the permissions - // that are specified in this role. For more information, see IAM Roles for - // Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) - // in the Amazon EC2 Container Service Developer Guide. - TaskRoleArn *string `locationName:"taskRoleArn" type:"string"` - - // A list of volume definitions in JSON format that containers in your task - // may use. - Volumes []*Volume `locationName:"volumes" type:"list"` -} - -// String returns the string representation -func (s RegisterTaskDefinitionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTaskDefinitionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterTaskDefinitionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterTaskDefinitionInput"} - if s.ContainerDefinitions == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerDefinitions")) - } - if s.Family == nil { - invalidParams.Add(request.NewErrParamRequired("Family")) - } - if s.ContainerDefinitions != nil { - for i, v := range s.ContainerDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContainerDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContainerDefinitions sets the ContainerDefinitions field's value. -func (s *RegisterTaskDefinitionInput) SetContainerDefinitions(v []*ContainerDefinition) *RegisterTaskDefinitionInput { - s.ContainerDefinitions = v - return s -} - -// SetFamily sets the Family field's value. -func (s *RegisterTaskDefinitionInput) SetFamily(v string) *RegisterTaskDefinitionInput { - s.Family = &v - return s -} - -// SetNetworkMode sets the NetworkMode field's value. -func (s *RegisterTaskDefinitionInput) SetNetworkMode(v string) *RegisterTaskDefinitionInput { - s.NetworkMode = &v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *RegisterTaskDefinitionInput) SetPlacementConstraints(v []*TaskDefinitionPlacementConstraint) *RegisterTaskDefinitionInput { - s.PlacementConstraints = v - return s -} - -// SetTaskRoleArn sets the TaskRoleArn field's value. -func (s *RegisterTaskDefinitionInput) SetTaskRoleArn(v string) *RegisterTaskDefinitionInput { - s.TaskRoleArn = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *RegisterTaskDefinitionInput) SetVolumes(v []*Volume) *RegisterTaskDefinitionInput { - s.Volumes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterTaskDefinitionResponse -type RegisterTaskDefinitionOutput struct { - _ struct{} `type:"structure"` - - // The full description of the registered task definition. - TaskDefinition *TaskDefinition `locationName:"taskDefinition" type:"structure"` -} - -// String returns the string representation -func (s RegisterTaskDefinitionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTaskDefinitionOutput) GoString() string { - return s.String() -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *RegisterTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *RegisterTaskDefinitionOutput { - s.TaskDefinition = v - return s -} - -// Describes the resources available for a container instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Resource -type Resource struct { - _ struct{} `type:"structure"` - - // When the doubleValue type is set, the value of the resource must be a double - // precision floating-point type. - DoubleValue *float64 `locationName:"doubleValue" type:"double"` - - // When the integerValue type is set, the value of the resource must be an integer. - IntegerValue *int64 `locationName:"integerValue" type:"integer"` - - // When the longValue type is set, the value of the resource must be an extended - // precision floating-point type. - LongValue *int64 `locationName:"longValue" type:"long"` - - // The name of the resource, such as cpu, memory, ports, or a user-defined resource. - Name *string `locationName:"name" type:"string"` - - // When the stringSetValue type is set, the value of the resource must be a - // string type. - StringSetValue []*string `locationName:"stringSetValue" type:"list"` - - // The type of the resource, such as INTEGER, DOUBLE, LONG, or STRINGSET. - Type *string `locationName:"type" type:"string"` -} - -// String returns the string representation -func (s Resource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Resource) GoString() string { - return s.String() -} - -// SetDoubleValue sets the DoubleValue field's value. -func (s *Resource) SetDoubleValue(v float64) *Resource { - s.DoubleValue = &v - return s -} - -// SetIntegerValue sets the IntegerValue field's value. -func (s *Resource) SetIntegerValue(v int64) *Resource { - s.IntegerValue = &v - return s -} - -// SetLongValue sets the LongValue field's value. -func (s *Resource) SetLongValue(v int64) *Resource { - s.LongValue = &v - return s -} - -// SetName sets the Name field's value. -func (s *Resource) SetName(v string) *Resource { - s.Name = &v - return s -} - -// SetStringSetValue sets the StringSetValue field's value. -func (s *Resource) SetStringSetValue(v []*string) *Resource { - s.StringSetValue = v - return s -} - -// SetType sets the Type field's value. -func (s *Resource) SetType(v string) *Resource { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RunTaskRequest -type RunTaskInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster on which - // to run your task. If you do not specify a cluster, the default cluster is - // assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The number of instantiations of the specified task to place on your cluster. - // You can specify up to 10 tasks per call. - Count *int64 `locationName:"count" type:"integer"` - - // The name of the task group to associate with the task. The default value - // is the family name of the task definition (for example, family:my-family-name). - Group *string `locationName:"group" type:"string"` - - // A list of container overrides in JSON format that specify the name of a container - // in the specified task definition and the overrides it should receive. You - // can override the default command for a container (that is specified in the - // task definition or Docker image) with a command override. You can also override - // existing environment variables (that are specified in the task definition - // or Docker image) on a container or add new environment variables to it with - // an environment override. - // - // A total of 8192 characters are allowed for overrides. This limit includes - // the JSON formatting characters of the override structure. - Overrides *TaskOverride `locationName:"overrides" type:"structure"` - - // An array of placement constraint objects to use for the task. You can specify - // up to 10 constraints per task (including constraints in the task definition - // and those specified at run time). - PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The placement strategy objects to use for the task. You can specify a maximum - // of 5 strategy rules per task. - PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"` - - // An optional tag specified when a task is started. For example if you automatically - // trigger a task to run a batch process job, you could apply a unique identifier - // for that job to your task with the startedBy parameter. You can then identify - // which tasks belong to that job by filtering the results of a ListTasks call - // with the startedBy value. Up to 36 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. - // - // If a task is started by an Amazon ECS service, then the startedBy parameter - // contains the deployment ID of the service that starts it. - StartedBy *string `locationName:"startedBy" type:"string"` - - // The family and revision (family:revision) or full Amazon Resource Name (ARN) - // of the task definition to run. If a revision is not specified, the latest - // ACTIVE revision is used. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s RunTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunTaskInput"} - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *RunTaskInput) SetCluster(v string) *RunTaskInput { - s.Cluster = &v - return s -} - -// SetCount sets the Count field's value. -func (s *RunTaskInput) SetCount(v int64) *RunTaskInput { - s.Count = &v - return s -} - -// SetGroup sets the Group field's value. -func (s *RunTaskInput) SetGroup(v string) *RunTaskInput { - s.Group = &v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *RunTaskInput) SetOverrides(v *TaskOverride) *RunTaskInput { - s.Overrides = v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *RunTaskInput) SetPlacementConstraints(v []*PlacementConstraint) *RunTaskInput { - s.PlacementConstraints = v - return s -} - -// SetPlacementStrategy sets the PlacementStrategy field's value. -func (s *RunTaskInput) SetPlacementStrategy(v []*PlacementStrategy) *RunTaskInput { - s.PlacementStrategy = v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *RunTaskInput) SetStartedBy(v string) *RunTaskInput { - s.StartedBy = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *RunTaskInput) SetTaskDefinition(v string) *RunTaskInput { - s.TaskDefinition = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RunTaskResponse -type RunTaskOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` - - // A full description of the tasks that were run. Each task that was successfully - // placed on your cluster are described here. - Tasks []*Task `locationName:"tasks" type:"list"` -} - -// String returns the string representation -func (s RunTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunTaskOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *RunTaskOutput) SetFailures(v []*Failure) *RunTaskOutput { - s.Failures = v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *RunTaskOutput) SetTasks(v []*Task) *RunTaskOutput { - s.Tasks = v - return s -} - -// Details on a service within a cluster -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Service -type Service struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the cluster that hosts the service. - ClusterArn *string `locationName:"clusterArn" type:"string"` - - // The Unix timestamp for when the service was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // Optional deployment parameters that control how many tasks run during the - // deployment and the ordering of stopping and starting tasks. - DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"` - - // The current state of deployments for the service. - Deployments []*Deployment `locationName:"deployments" type:"list"` - - // The desired number of instantiations of the task definition to keep running - // on the service. This value is specified when the service is created with - // CreateService, and it can be modified with UpdateService. - DesiredCount *int64 `locationName:"desiredCount" type:"integer"` - - // The event stream for your service. A maximum of 100 of the latest events - // are displayed. - Events []*ServiceEvent `locationName:"events" type:"list"` - - // A list of Elastic Load Balancing load balancer objects, containing the load - // balancer name, the container name (as it appears in a container definition), - // and the container port to access from the load balancer. - LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"` - - // The number of tasks in the cluster that are in the PENDING state. - PendingCount *int64 `locationName:"pendingCount" type:"integer"` - - // The placement constraints for the tasks in the service. - PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The placement strategy that determines how tasks for the service are placed. - PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"` - - // The Amazon Resource Name (ARN) of the IAM role associated with the service - // that allows the Amazon ECS container agent to register container instances - // with an Elastic Load Balancing load balancer. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The number of tasks in the cluster that are in the RUNNING state. - RunningCount *int64 `locationName:"runningCount" type:"integer"` - - // The Amazon Resource Name (ARN) that identifies the service. The ARN contains - // the arn:aws:ecs namespace, followed by the region of the service, the AWS - // account ID of the service owner, the service namespace, and then the service - // name. For example, arn:aws:ecs:region:012345678910:service/my-service. - ServiceArn *string `locationName:"serviceArn" type:"string"` - - // The name of your service. Up to 255 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. Service names must be unique within - // a cluster, but you can have similarly named services in multiple clusters - // within a region or across multiple regions. - ServiceName *string `locationName:"serviceName" type:"string"` - - // The status of the service. The valid values are ACTIVE, DRAINING, or INACTIVE. - Status *string `locationName:"status" type:"string"` - - // The task definition to use for tasks in the service. This value is specified - // when the service is created with CreateService, and it can be modified with - // UpdateService. - TaskDefinition *string `locationName:"taskDefinition" type:"string"` -} - -// String returns the string representation -func (s Service) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Service) GoString() string { - return s.String() -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *Service) SetClusterArn(v string) *Service { - s.ClusterArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Service) SetCreatedAt(v time.Time) *Service { - s.CreatedAt = &v - return s -} - -// SetDeploymentConfiguration sets the DeploymentConfiguration field's value. -func (s *Service) SetDeploymentConfiguration(v *DeploymentConfiguration) *Service { - s.DeploymentConfiguration = v - return s -} - -// SetDeployments sets the Deployments field's value. -func (s *Service) SetDeployments(v []*Deployment) *Service { - s.Deployments = v - return s -} - -// SetDesiredCount sets the DesiredCount field's value. -func (s *Service) SetDesiredCount(v int64) *Service { - s.DesiredCount = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *Service) SetEvents(v []*ServiceEvent) *Service { - s.Events = v - return s -} - -// SetLoadBalancers sets the LoadBalancers field's value. -func (s *Service) SetLoadBalancers(v []*LoadBalancer) *Service { - s.LoadBalancers = v - return s -} - -// SetPendingCount sets the PendingCount field's value. -func (s *Service) SetPendingCount(v int64) *Service { - s.PendingCount = &v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *Service) SetPlacementConstraints(v []*PlacementConstraint) *Service { - s.PlacementConstraints = v - return s -} - -// SetPlacementStrategy sets the PlacementStrategy field's value. -func (s *Service) SetPlacementStrategy(v []*PlacementStrategy) *Service { - s.PlacementStrategy = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *Service) SetRoleArn(v string) *Service { - s.RoleArn = &v - return s -} - -// SetRunningCount sets the RunningCount field's value. -func (s *Service) SetRunningCount(v int64) *Service { - s.RunningCount = &v - return s -} - -// SetServiceArn sets the ServiceArn field's value. -func (s *Service) SetServiceArn(v string) *Service { - s.ServiceArn = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *Service) SetServiceName(v string) *Service { - s.ServiceName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Service) SetStatus(v string) *Service { - s.Status = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *Service) SetTaskDefinition(v string) *Service { - s.TaskDefinition = &v - return s -} - -// Details on an event associated with a service. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ServiceEvent -type ServiceEvent struct { - _ struct{} `type:"structure"` - - // The Unix timestamp for when the event was triggered. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The ID string of the event. - Id *string `locationName:"id" type:"string"` - - // The event message. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s ServiceEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceEvent) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServiceEvent) SetCreatedAt(v time.Time) *ServiceEvent { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *ServiceEvent) SetId(v string) *ServiceEvent { - s.Id = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ServiceEvent) SetMessage(v string) *ServiceEvent { - s.Message = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StartTaskRequest -type StartTaskInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster on which - // to start your task. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance IDs or full Amazon Resource Name (ARN) entries for - // the container instances on which you would like to place your task. You can - // specify up to 10 container instances. - // - // ContainerInstances is a required field - ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"` - - // The name of the task group to associate with the task. The default value - // is the family name of the task definition (for example, family:my-family-name). - Group *string `locationName:"group" type:"string"` - - // A list of container overrides in JSON format that specify the name of a container - // in the specified task definition and the overrides it should receive. You - // can override the default command for a container (that is specified in the - // task definition or Docker image) with a command override. You can also override - // existing environment variables (that are specified in the task definition - // or Docker image) on a container or add new environment variables to it with - // an environment override. - // - // A total of 8192 characters are allowed for overrides. This limit includes - // the JSON formatting characters of the override structure. - Overrides *TaskOverride `locationName:"overrides" type:"structure"` - - // An optional tag specified when a task is started. For example if you automatically - // trigger a task to run a batch process job, you could apply a unique identifier - // for that job to your task with the startedBy parameter. You can then identify - // which tasks belong to that job by filtering the results of a ListTasks call - // with the startedBy value. Up to 36 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. - // - // If a task is started by an Amazon ECS service, then the startedBy parameter - // contains the deployment ID of the service that starts it. - StartedBy *string `locationName:"startedBy" type:"string"` - - // The family and revision (family:revision) or full Amazon Resource Name (ARN) - // of the task definition to start. If a revision is not specified, the latest - // ACTIVE revision is used. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartTaskInput"} - if s.ContainerInstances == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstances")) - } - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *StartTaskInput) SetCluster(v string) *StartTaskInput { - s.Cluster = &v - return s -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *StartTaskInput) SetContainerInstances(v []*string) *StartTaskInput { - s.ContainerInstances = v - return s -} - -// SetGroup sets the Group field's value. -func (s *StartTaskInput) SetGroup(v string) *StartTaskInput { - s.Group = &v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *StartTaskInput) SetOverrides(v *TaskOverride) *StartTaskInput { - s.Overrides = v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *StartTaskInput) SetStartedBy(v string) *StartTaskInput { - s.StartedBy = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *StartTaskInput) SetTaskDefinition(v string) *StartTaskInput { - s.TaskDefinition = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StartTaskResponse -type StartTaskOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` - - // A full description of the tasks that were started. Each task that was successfully - // placed on your container instances are described here. - Tasks []*Task `locationName:"tasks" type:"list"` -} - -// String returns the string representation -func (s StartTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartTaskOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *StartTaskOutput) SetFailures(v []*Failure) *StartTaskOutput { - s.Failures = v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *StartTaskOutput) SetTasks(v []*Task) *StartTaskOutput { - s.Tasks = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StopTaskRequest -type StopTaskInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the task to stop. If you do not specify a cluster, the default cluster is - // assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // An optional message specified when a task is stopped. For example, if you - // are using a custom scheduler, you can use this parameter to specify the reason - // for stopping the task here, and the message will appear in subsequent DescribeTasks - // API operations on this task. Up to 255 characters are allowed in this message. - Reason *string `locationName:"reason" type:"string"` - - // The task ID or full Amazon Resource Name (ARN) entry of the task to stop. - // - // Task is a required field - Task *string `locationName:"task" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopTaskInput"} - if s.Task == nil { - invalidParams.Add(request.NewErrParamRequired("Task")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *StopTaskInput) SetCluster(v string) *StopTaskInput { - s.Cluster = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *StopTaskInput) SetReason(v string) *StopTaskInput { - s.Reason = &v - return s -} - -// SetTask sets the Task field's value. -func (s *StopTaskInput) SetTask(v string) *StopTaskInput { - s.Task = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StopTaskResponse -type StopTaskOutput struct { - _ struct{} `type:"structure"` - - // The task that was stopped. - Task *Task `locationName:"task" type:"structure"` -} - -// String returns the string representation -func (s StopTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopTaskOutput) GoString() string { - return s.String() -} - -// SetTask sets the Task field's value. -func (s *StopTaskOutput) SetTask(v *Task) *StopTaskOutput { - s.Task = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitContainerStateChangeRequest -type SubmitContainerStateChangeInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container. - Cluster *string `locationName:"cluster" type:"string"` - - // The name of the container. - ContainerName *string `locationName:"containerName" type:"string"` - - // The exit code returned for the state change request. - ExitCode *int64 `locationName:"exitCode" type:"integer"` - - // The network bindings of the container. - NetworkBindings []*NetworkBinding `locationName:"networkBindings" type:"list"` - - // The reason for the state change request. - Reason *string `locationName:"reason" type:"string"` - - // The status of the state change request. - Status *string `locationName:"status" type:"string"` - - // The task ID or full Amazon Resource Name (ARN) of the task that hosts the - // container. - Task *string `locationName:"task" type:"string"` -} - -// String returns the string representation -func (s SubmitContainerStateChangeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubmitContainerStateChangeInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *SubmitContainerStateChangeInput) SetCluster(v string) *SubmitContainerStateChangeInput { - s.Cluster = &v - return s -} - -// SetContainerName sets the ContainerName field's value. -func (s *SubmitContainerStateChangeInput) SetContainerName(v string) *SubmitContainerStateChangeInput { - s.ContainerName = &v - return s -} - -// SetExitCode sets the ExitCode field's value. -func (s *SubmitContainerStateChangeInput) SetExitCode(v int64) *SubmitContainerStateChangeInput { - s.ExitCode = &v - return s -} - -// SetNetworkBindings sets the NetworkBindings field's value. -func (s *SubmitContainerStateChangeInput) SetNetworkBindings(v []*NetworkBinding) *SubmitContainerStateChangeInput { - s.NetworkBindings = v - return s -} - -// SetReason sets the Reason field's value. -func (s *SubmitContainerStateChangeInput) SetReason(v string) *SubmitContainerStateChangeInput { - s.Reason = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SubmitContainerStateChangeInput) SetStatus(v string) *SubmitContainerStateChangeInput { - s.Status = &v - return s -} - -// SetTask sets the Task field's value. -func (s *SubmitContainerStateChangeInput) SetTask(v string) *SubmitContainerStateChangeInput { - s.Task = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitContainerStateChangeResponse -type SubmitContainerStateChangeOutput struct { - _ struct{} `type:"structure"` - - // Acknowledgement of the state change. - Acknowledgment *string `locationName:"acknowledgment" type:"string"` -} - -// String returns the string representation -func (s SubmitContainerStateChangeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubmitContainerStateChangeOutput) GoString() string { - return s.String() -} - -// SetAcknowledgment sets the Acknowledgment field's value. -func (s *SubmitContainerStateChangeOutput) SetAcknowledgment(v string) *SubmitContainerStateChangeOutput { - s.Acknowledgment = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitTaskStateChangeRequest -type SubmitTaskStateChangeInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the task. - Cluster *string `locationName:"cluster" type:"string"` - - // The reason for the state change request. - Reason *string `locationName:"reason" type:"string"` - - // The status of the state change request. - Status *string `locationName:"status" type:"string"` - - // The task ID or full Amazon Resource Name (ARN) of the task in the state change - // request. - Task *string `locationName:"task" type:"string"` -} - -// String returns the string representation -func (s SubmitTaskStateChangeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubmitTaskStateChangeInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *SubmitTaskStateChangeInput) SetCluster(v string) *SubmitTaskStateChangeInput { - s.Cluster = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *SubmitTaskStateChangeInput) SetReason(v string) *SubmitTaskStateChangeInput { - s.Reason = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SubmitTaskStateChangeInput) SetStatus(v string) *SubmitTaskStateChangeInput { - s.Status = &v - return s -} - -// SetTask sets the Task field's value. -func (s *SubmitTaskStateChangeInput) SetTask(v string) *SubmitTaskStateChangeInput { - s.Task = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitTaskStateChangeResponse -type SubmitTaskStateChangeOutput struct { - _ struct{} `type:"structure"` - - // Acknowledgement of the state change. - Acknowledgment *string `locationName:"acknowledgment" type:"string"` -} - -// String returns the string representation -func (s SubmitTaskStateChangeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubmitTaskStateChangeOutput) GoString() string { - return s.String() -} - -// SetAcknowledgment sets the Acknowledgment field's value. -func (s *SubmitTaskStateChangeOutput) SetAcknowledgment(v string) *SubmitTaskStateChangeOutput { - s.Acknowledgment = &v - return s -} - -// Details on a task in a cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Task -type Task struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the cluster that hosts the task. - ClusterArn *string `locationName:"clusterArn" type:"string"` - - // The Amazon Resource Name (ARN) of the container instances that host the task. - ContainerInstanceArn *string `locationName:"containerInstanceArn" type:"string"` - - // The containers associated with the task. - Containers []*Container `locationName:"containers" type:"list"` - - // The Unix timestamp for when the task was created (the task entered the PENDING - // state). - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The desired status of the task. - DesiredStatus *string `locationName:"desiredStatus" type:"string"` - - // The name of the task group associated with the task. - Group *string `locationName:"group" type:"string"` - - // The last known status of the task. - LastStatus *string `locationName:"lastStatus" type:"string"` - - // One or more container overrides. - Overrides *TaskOverride `locationName:"overrides" type:"structure"` - - // The Unix timestamp for when the task was started (the task transitioned from - // the PENDING state to the RUNNING state). - StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"unix"` - - // The tag specified when a task is started. If the task is started by an Amazon - // ECS service, then the startedBy parameter contains the deployment ID of the - // service that starts it. - StartedBy *string `locationName:"startedBy" type:"string"` - - // The Unix timestamp for when the task was stopped (the task transitioned from - // the RUNNING state to the STOPPED state). - StoppedAt *time.Time `locationName:"stoppedAt" type:"timestamp" timestampFormat:"unix"` - - // The reason the task was stopped. - StoppedReason *string `locationName:"stoppedReason" type:"string"` - - // The Amazon Resource Name (ARN) of the task. - TaskArn *string `locationName:"taskArn" type:"string"` - - // The Amazon Resource Name (ARN) of the task definition that creates the task. - TaskDefinitionArn *string `locationName:"taskDefinitionArn" type:"string"` - - // The version counter for the task. Every time a task experiences a change - // that triggers a CloudWatch event, the version counter is incremented. If - // you are replicating your Amazon ECS task state with CloudWatch events, you - // can compare the version of a task reported by the Amazon ECS APIs with the - // version reported in CloudWatch events for the task (inside the detail object) - // to verify that the version in your event stream is current. - Version *int64 `locationName:"version" type:"long"` -} - -// String returns the string representation -func (s Task) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Task) GoString() string { - return s.String() -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *Task) SetClusterArn(v string) *Task { - s.ClusterArn = &v - return s -} - -// SetContainerInstanceArn sets the ContainerInstanceArn field's value. -func (s *Task) SetContainerInstanceArn(v string) *Task { - s.ContainerInstanceArn = &v - return s -} - -// SetContainers sets the Containers field's value. -func (s *Task) SetContainers(v []*Container) *Task { - s.Containers = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Task) SetCreatedAt(v time.Time) *Task { - s.CreatedAt = &v - return s -} - -// SetDesiredStatus sets the DesiredStatus field's value. -func (s *Task) SetDesiredStatus(v string) *Task { - s.DesiredStatus = &v - return s -} - -// SetGroup sets the Group field's value. -func (s *Task) SetGroup(v string) *Task { - s.Group = &v - return s -} - -// SetLastStatus sets the LastStatus field's value. -func (s *Task) SetLastStatus(v string) *Task { - s.LastStatus = &v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *Task) SetOverrides(v *TaskOverride) *Task { - s.Overrides = v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *Task) SetStartedAt(v time.Time) *Task { - s.StartedAt = &v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *Task) SetStartedBy(v string) *Task { - s.StartedBy = &v - return s -} - -// SetStoppedAt sets the StoppedAt field's value. -func (s *Task) SetStoppedAt(v time.Time) *Task { - s.StoppedAt = &v - return s -} - -// SetStoppedReason sets the StoppedReason field's value. -func (s *Task) SetStoppedReason(v string) *Task { - s.StoppedReason = &v - return s -} - -// SetTaskArn sets the TaskArn field's value. -func (s *Task) SetTaskArn(v string) *Task { - s.TaskArn = &v - return s -} - -// SetTaskDefinitionArn sets the TaskDefinitionArn field's value. -func (s *Task) SetTaskDefinitionArn(v string) *Task { - s.TaskDefinitionArn = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *Task) SetVersion(v int64) *Task { - s.Version = &v - return s -} - -// Details of a task definition. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/TaskDefinition -type TaskDefinition struct { - _ struct{} `type:"structure"` - - // A list of container definitions in JSON format that describe the different - // containers that make up your task. For more information about container definition - // parameters and defaults, see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) - // in the Amazon EC2 Container Service Developer Guide. - ContainerDefinitions []*ContainerDefinition `locationName:"containerDefinitions" type:"list"` - - // The family of your task definition, used as the definition name. - Family *string `locationName:"family" type:"string"` - - // The Docker networking mode to use for the containers in the task. The valid - // values are none, bridge, and host. - // - // If the network mode is none, the containers do not have external connectivity. - // The default Docker network mode is bridge. The host network mode offers the - // highest networking performance for containers because it uses the host network - // stack instead of the virtualized network stack provided by the bridge mode. - // - // For more information, see Network settings (https://docs.docker.com/engine/reference/run/#network-settings) - // in the Docker run reference. - NetworkMode *string `locationName:"networkMode" type:"string" enum:"NetworkMode"` - - // An array of placement constraint objects to use for tasks. - PlacementConstraints []*TaskDefinitionPlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The container instance attributes required by your task. - RequiresAttributes []*Attribute `locationName:"requiresAttributes" type:"list"` - - // The revision of the task in a particular family. The revision is a version - // number of a task definition in a family. When you register a task definition - // for the first time, the revision is 1; each time you register a new revision - // of a task definition in the same family, the revision value always increases - // by one (even if you have deregistered previous revisions in this family). - Revision *int64 `locationName:"revision" type:"integer"` - - // The status of the task definition. - Status *string `locationName:"status" type:"string" enum:"TaskDefinitionStatus"` - - // The full Amazon Resource Name (ARN) of the task definition. - TaskDefinitionArn *string `locationName:"taskDefinitionArn" type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role that containers in this task - // can assume. All containers in this task are granted the permissions that - // are specified in this role. - TaskRoleArn *string `locationName:"taskRoleArn" type:"string"` - - // The list of volumes in a task. For more information about volume definition - // parameters and defaults, see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) - // in the Amazon EC2 Container Service Developer Guide. - Volumes []*Volume `locationName:"volumes" type:"list"` -} - -// String returns the string representation -func (s TaskDefinition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TaskDefinition) GoString() string { - return s.String() -} - -// SetContainerDefinitions sets the ContainerDefinitions field's value. -func (s *TaskDefinition) SetContainerDefinitions(v []*ContainerDefinition) *TaskDefinition { - s.ContainerDefinitions = v - return s -} - -// SetFamily sets the Family field's value. -func (s *TaskDefinition) SetFamily(v string) *TaskDefinition { - s.Family = &v - return s -} - -// SetNetworkMode sets the NetworkMode field's value. -func (s *TaskDefinition) SetNetworkMode(v string) *TaskDefinition { - s.NetworkMode = &v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *TaskDefinition) SetPlacementConstraints(v []*TaskDefinitionPlacementConstraint) *TaskDefinition { - s.PlacementConstraints = v - return s -} - -// SetRequiresAttributes sets the RequiresAttributes field's value. -func (s *TaskDefinition) SetRequiresAttributes(v []*Attribute) *TaskDefinition { - s.RequiresAttributes = v - return s -} - -// SetRevision sets the Revision field's value. -func (s *TaskDefinition) SetRevision(v int64) *TaskDefinition { - s.Revision = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TaskDefinition) SetStatus(v string) *TaskDefinition { - s.Status = &v - return s -} - -// SetTaskDefinitionArn sets the TaskDefinitionArn field's value. -func (s *TaskDefinition) SetTaskDefinitionArn(v string) *TaskDefinition { - s.TaskDefinitionArn = &v - return s -} - -// SetTaskRoleArn sets the TaskRoleArn field's value. -func (s *TaskDefinition) SetTaskRoleArn(v string) *TaskDefinition { - s.TaskRoleArn = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *TaskDefinition) SetVolumes(v []*Volume) *TaskDefinition { - s.Volumes = v - return s -} - -// An object representing a constraint on task placement in the task definition. -// For more information, see Task Placement Constraints (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) -// in the Amazon EC2 Container Service Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/TaskDefinitionPlacementConstraint -type TaskDefinitionPlacementConstraint struct { - _ struct{} `type:"structure"` - - // A cluster query language expression to apply to the constraint. For more - // information, see Cluster Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) - // in the Amazon EC2 Container Service Developer Guide. - Expression *string `locationName:"expression" type:"string"` - - // The type of constraint. The DistinctInstance constraint ensures that each - // task in a particular group is running on a different container instance. - // The MemberOf constraint restricts selection to be from a group of valid candidates. - Type *string `locationName:"type" type:"string" enum:"TaskDefinitionPlacementConstraintType"` -} - -// String returns the string representation -func (s TaskDefinitionPlacementConstraint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TaskDefinitionPlacementConstraint) GoString() string { - return s.String() -} - -// SetExpression sets the Expression field's value. -func (s *TaskDefinitionPlacementConstraint) SetExpression(v string) *TaskDefinitionPlacementConstraint { - s.Expression = &v - return s -} - -// SetType sets the Type field's value. -func (s *TaskDefinitionPlacementConstraint) SetType(v string) *TaskDefinitionPlacementConstraint { - s.Type = &v - return s -} - -// The overrides associated with a task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/TaskOverride -type TaskOverride struct { - _ struct{} `type:"structure"` - - // One or more container overrides sent to a task. - ContainerOverrides []*ContainerOverride `locationName:"containerOverrides" type:"list"` - - // The Amazon Resource Name (ARN) of the IAM role that containers in this task - // can assume. All containers in this task are granted the permissions that - // are specified in this role. - TaskRoleArn *string `locationName:"taskRoleArn" type:"string"` -} - -// String returns the string representation -func (s TaskOverride) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TaskOverride) GoString() string { - return s.String() -} - -// SetContainerOverrides sets the ContainerOverrides field's value. -func (s *TaskOverride) SetContainerOverrides(v []*ContainerOverride) *TaskOverride { - s.ContainerOverrides = v - return s -} - -// SetTaskRoleArn sets the TaskRoleArn field's value. -func (s *TaskOverride) SetTaskRoleArn(v string) *TaskOverride { - s.TaskRoleArn = &v - return s -} - -// The ulimit settings to pass to the container. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Ulimit -type Ulimit struct { - _ struct{} `type:"structure"` - - // The hard limit for the ulimit type. - // - // HardLimit is a required field - HardLimit *int64 `locationName:"hardLimit" type:"integer" required:"true"` - - // The type of the ulimit. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true" enum:"UlimitName"` - - // The soft limit for the ulimit type. - // - // SoftLimit is a required field - SoftLimit *int64 `locationName:"softLimit" type:"integer" required:"true"` -} - -// String returns the string representation -func (s Ulimit) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Ulimit) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Ulimit) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ulimit"} - if s.HardLimit == nil { - invalidParams.Add(request.NewErrParamRequired("HardLimit")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.SoftLimit == nil { - invalidParams.Add(request.NewErrParamRequired("SoftLimit")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHardLimit sets the HardLimit field's value. -func (s *Ulimit) SetHardLimit(v int64) *Ulimit { - s.HardLimit = &v - return s -} - -// SetName sets the Name field's value. -func (s *Ulimit) SetName(v string) *Ulimit { - s.Name = &v - return s -} - -// SetSoftLimit sets the SoftLimit field's value. -func (s *Ulimit) SetSoftLimit(v int64) *Ulimit { - s.SoftLimit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerAgentRequest -type UpdateContainerAgentInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that your - // container instance is running on. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance ID or full Amazon Resource Name (ARN) entries for - // the container instance on which you would like to update the Amazon ECS container - // agent. - // - // ContainerInstance is a required field - ContainerInstance *string `locationName:"containerInstance" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateContainerAgentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContainerAgentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateContainerAgentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateContainerAgentInput"} - if s.ContainerInstance == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstance")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *UpdateContainerAgentInput) SetCluster(v string) *UpdateContainerAgentInput { - s.Cluster = &v - return s -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *UpdateContainerAgentInput) SetContainerInstance(v string) *UpdateContainerAgentInput { - s.ContainerInstance = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerAgentResponse -type UpdateContainerAgentOutput struct { - _ struct{} `type:"structure"` - - // The container instance for which the container agent was updated. - ContainerInstance *ContainerInstance `locationName:"containerInstance" type:"structure"` -} - -// String returns the string representation -func (s UpdateContainerAgentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContainerAgentOutput) GoString() string { - return s.String() -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *UpdateContainerAgentOutput) SetContainerInstance(v *ContainerInstance) *UpdateContainerAgentOutput { - s.ContainerInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerInstancesStateRequest -type UpdateContainerInstancesStateInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container instance to update. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // A space-separated list of container instance IDs or full Amazon Resource - // Name (ARN) entries. - // - // ContainerInstances is a required field - ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"` - - // The container instance state with which to update the container instance. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ContainerInstanceStatus"` -} - -// String returns the string representation -func (s UpdateContainerInstancesStateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContainerInstancesStateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateContainerInstancesStateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateContainerInstancesStateInput"} - if s.ContainerInstances == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstances")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *UpdateContainerInstancesStateInput) SetCluster(v string) *UpdateContainerInstancesStateInput { - s.Cluster = &v - return s -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *UpdateContainerInstancesStateInput) SetContainerInstances(v []*string) *UpdateContainerInstancesStateInput { - s.ContainerInstances = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateContainerInstancesStateInput) SetStatus(v string) *UpdateContainerInstancesStateInput { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerInstancesStateResponse -type UpdateContainerInstancesStateOutput struct { - _ struct{} `type:"structure"` - - // The list of container instances. - ContainerInstances []*ContainerInstance `locationName:"containerInstances" type:"list"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` -} - -// String returns the string representation -func (s UpdateContainerInstancesStateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContainerInstancesStateOutput) GoString() string { - return s.String() -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *UpdateContainerInstancesStateOutput) SetContainerInstances(v []*ContainerInstance) *UpdateContainerInstancesStateOutput { - s.ContainerInstances = v - return s -} - -// SetFailures sets the Failures field's value. -func (s *UpdateContainerInstancesStateOutput) SetFailures(v []*Failure) *UpdateContainerInstancesStateOutput { - s.Failures = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateServiceRequest -type UpdateServiceInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that your - // service is running on. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // Optional deployment parameters that control how many tasks run during the - // deployment and the ordering of stopping and starting tasks. - DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"` - - // The number of instantiations of the task to place and keep running in your - // service. - DesiredCount *int64 `locationName:"desiredCount" type:"integer"` - - // The name of the service to update. - // - // Service is a required field - Service *string `locationName:"service" type:"string" required:"true"` - - // The family and revision (family:revision) or full Amazon Resource Name (ARN) - // of the task definition to run in your service. If a revision is not specified, - // the latest ACTIVE revision is used. If you modify the task definition with - // UpdateService, Amazon ECS spawns a task with the new version of the task - // definition and then stops an old task after the new version is running. - TaskDefinition *string `locationName:"taskDefinition" type:"string"` -} - -// String returns the string representation -func (s UpdateServiceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateServiceInput"} - if s.Service == nil { - invalidParams.Add(request.NewErrParamRequired("Service")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *UpdateServiceInput) SetCluster(v string) *UpdateServiceInput { - s.Cluster = &v - return s -} - -// SetDeploymentConfiguration sets the DeploymentConfiguration field's value. -func (s *UpdateServiceInput) SetDeploymentConfiguration(v *DeploymentConfiguration) *UpdateServiceInput { - s.DeploymentConfiguration = v - return s -} - -// SetDesiredCount sets the DesiredCount field's value. -func (s *UpdateServiceInput) SetDesiredCount(v int64) *UpdateServiceInput { - s.DesiredCount = &v - return s -} - -// SetService sets the Service field's value. -func (s *UpdateServiceInput) SetService(v string) *UpdateServiceInput { - s.Service = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *UpdateServiceInput) SetTaskDefinition(v string) *UpdateServiceInput { - s.TaskDefinition = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateServiceResponse -type UpdateServiceOutput struct { - _ struct{} `type:"structure"` - - // The full description of your service following the update call. - Service *Service `locationName:"service" type:"structure"` -} - -// String returns the string representation -func (s UpdateServiceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateServiceOutput) GoString() string { - return s.String() -} - -// SetService sets the Service field's value. -func (s *UpdateServiceOutput) SetService(v *Service) *UpdateServiceOutput { - s.Service = v - return s -} - -// The Docker and Amazon ECS container agent version information about a container -// instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/VersionInfo -type VersionInfo struct { - _ struct{} `type:"structure"` - - // The Git commit hash for the Amazon ECS container agent build on the amazon-ecs-agent - // (https://github.com/aws/amazon-ecs-agent/commits/master) GitHub repository. - AgentHash *string `locationName:"agentHash" type:"string"` - - // The version number of the Amazon ECS container agent. - AgentVersion *string `locationName:"agentVersion" type:"string"` - - // The Docker version running on the container instance. - DockerVersion *string `locationName:"dockerVersion" type:"string"` -} - -// String returns the string representation -func (s VersionInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VersionInfo) GoString() string { - return s.String() -} - -// SetAgentHash sets the AgentHash field's value. -func (s *VersionInfo) SetAgentHash(v string) *VersionInfo { - s.AgentHash = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *VersionInfo) SetAgentVersion(v string) *VersionInfo { - s.AgentVersion = &v - return s -} - -// SetDockerVersion sets the DockerVersion field's value. -func (s *VersionInfo) SetDockerVersion(v string) *VersionInfo { - s.DockerVersion = &v - return s -} - -// A data volume used in a task definition. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/Volume -type Volume struct { - _ struct{} `type:"structure"` - - // The contents of the host parameter determine whether your data volume persists - // on the host container instance and where it is stored. If the host parameter - // is empty, then the Docker daemon assigns a host path for your data volume, - // but the data is not guaranteed to persist after the containers associated - // with it stop running. - Host *HostVolumeProperties `locationName:"host" type:"structure"` - - // The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. This name is referenced in the sourceVolume - // parameter of container definition mountPoints. - Name *string `locationName:"name" type:"string"` -} - -// 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() -} - -// SetHost sets the Host field's value. -func (s *Volume) SetHost(v *HostVolumeProperties) *Volume { - s.Host = v - return s -} - -// SetName sets the Name field's value. -func (s *Volume) SetName(v string) *Volume { - s.Name = &v - return s -} - -// Details on a data volume from another container. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/VolumeFrom -type VolumeFrom struct { - _ struct{} `type:"structure"` - - // If this value is true, the container has read-only access to the volume. - // If this value is false, then the container can write to the volume. The default - // value is false. - ReadOnly *bool `locationName:"readOnly" type:"boolean"` - - // The name of the container to mount volumes from. - SourceContainer *string `locationName:"sourceContainer" type:"string"` -} - -// String returns the string representation -func (s VolumeFrom) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeFrom) GoString() string { - return s.String() -} - -// SetReadOnly sets the ReadOnly field's value. -func (s *VolumeFrom) SetReadOnly(v bool) *VolumeFrom { - s.ReadOnly = &v - return s -} - -// SetSourceContainer sets the SourceContainer field's value. -func (s *VolumeFrom) SetSourceContainer(v string) *VolumeFrom { - s.SourceContainer = &v - return s -} - -const ( - // AgentUpdateStatusPending is a AgentUpdateStatus enum value - AgentUpdateStatusPending = "PENDING" - - // AgentUpdateStatusStaging is a AgentUpdateStatus enum value - AgentUpdateStatusStaging = "STAGING" - - // AgentUpdateStatusStaged is a AgentUpdateStatus enum value - AgentUpdateStatusStaged = "STAGED" - - // AgentUpdateStatusUpdating is a AgentUpdateStatus enum value - AgentUpdateStatusUpdating = "UPDATING" - - // AgentUpdateStatusUpdated is a AgentUpdateStatus enum value - AgentUpdateStatusUpdated = "UPDATED" - - // AgentUpdateStatusFailed is a AgentUpdateStatus enum value - AgentUpdateStatusFailed = "FAILED" -) - -const ( - // ContainerInstanceStatusActive is a ContainerInstanceStatus enum value - ContainerInstanceStatusActive = "ACTIVE" - - // ContainerInstanceStatusDraining is a ContainerInstanceStatus enum value - ContainerInstanceStatusDraining = "DRAINING" -) - -const ( - // DesiredStatusRunning is a DesiredStatus enum value - DesiredStatusRunning = "RUNNING" - - // DesiredStatusPending is a DesiredStatus enum value - DesiredStatusPending = "PENDING" - - // DesiredStatusStopped is a DesiredStatus enum value - DesiredStatusStopped = "STOPPED" -) - -const ( - // LogDriverJsonFile is a LogDriver enum value - LogDriverJsonFile = "json-file" - - // LogDriverSyslog is a LogDriver enum value - LogDriverSyslog = "syslog" - - // LogDriverJournald is a LogDriver enum value - LogDriverJournald = "journald" - - // LogDriverGelf is a LogDriver enum value - LogDriverGelf = "gelf" - - // LogDriverFluentd is a LogDriver enum value - LogDriverFluentd = "fluentd" - - // LogDriverAwslogs is a LogDriver enum value - LogDriverAwslogs = "awslogs" - - // LogDriverSplunk is a LogDriver enum value - LogDriverSplunk = "splunk" -) - -const ( - // NetworkModeBridge is a NetworkMode enum value - NetworkModeBridge = "bridge" - - // NetworkModeHost is a NetworkMode enum value - NetworkModeHost = "host" - - // NetworkModeNone is a NetworkMode enum value - NetworkModeNone = "none" -) - -const ( - // PlacementConstraintTypeDistinctInstance is a PlacementConstraintType enum value - PlacementConstraintTypeDistinctInstance = "distinctInstance" - - // PlacementConstraintTypeMemberOf is a PlacementConstraintType enum value - PlacementConstraintTypeMemberOf = "memberOf" -) - -const ( - // PlacementStrategyTypeRandom is a PlacementStrategyType enum value - PlacementStrategyTypeRandom = "random" - - // PlacementStrategyTypeSpread is a PlacementStrategyType enum value - PlacementStrategyTypeSpread = "spread" - - // PlacementStrategyTypeBinpack is a PlacementStrategyType enum value - PlacementStrategyTypeBinpack = "binpack" -) - -const ( - // SortOrderAsc is a SortOrder enum value - SortOrderAsc = "ASC" - - // SortOrderDesc is a SortOrder enum value - SortOrderDesc = "DESC" -) - -const ( - // TargetTypeContainerInstance is a TargetType enum value - TargetTypeContainerInstance = "container-instance" -) - -const ( - // TaskDefinitionFamilyStatusActive is a TaskDefinitionFamilyStatus enum value - TaskDefinitionFamilyStatusActive = "ACTIVE" - - // TaskDefinitionFamilyStatusInactive is a TaskDefinitionFamilyStatus enum value - TaskDefinitionFamilyStatusInactive = "INACTIVE" - - // TaskDefinitionFamilyStatusAll is a TaskDefinitionFamilyStatus enum value - TaskDefinitionFamilyStatusAll = "ALL" -) - -const ( - // TaskDefinitionPlacementConstraintTypeMemberOf is a TaskDefinitionPlacementConstraintType enum value - TaskDefinitionPlacementConstraintTypeMemberOf = "memberOf" -) - -const ( - // TaskDefinitionStatusActive is a TaskDefinitionStatus enum value - TaskDefinitionStatusActive = "ACTIVE" - - // TaskDefinitionStatusInactive is a TaskDefinitionStatus enum value - TaskDefinitionStatusInactive = "INACTIVE" -) - -const ( - // TransportProtocolTcp is a TransportProtocol enum value - TransportProtocolTcp = "tcp" - - // TransportProtocolUdp is a TransportProtocol enum value - TransportProtocolUdp = "udp" -) - -const ( - // UlimitNameCore is a UlimitName enum value - UlimitNameCore = "core" - - // UlimitNameCpu is a UlimitName enum value - UlimitNameCpu = "cpu" - - // UlimitNameData is a UlimitName enum value - UlimitNameData = "data" - - // UlimitNameFsize is a UlimitName enum value - UlimitNameFsize = "fsize" - - // UlimitNameLocks is a UlimitName enum value - UlimitNameLocks = "locks" - - // UlimitNameMemlock is a UlimitName enum value - UlimitNameMemlock = "memlock" - - // UlimitNameMsgqueue is a UlimitName enum value - UlimitNameMsgqueue = "msgqueue" - - // UlimitNameNice is a UlimitName enum value - UlimitNameNice = "nice" - - // UlimitNameNofile is a UlimitName enum value - UlimitNameNofile = "nofile" - - // UlimitNameNproc is a UlimitName enum value - UlimitNameNproc = "nproc" - - // UlimitNameRss is a UlimitName enum value - UlimitNameRss = "rss" - - // UlimitNameRtprio is a UlimitName enum value - UlimitNameRtprio = "rtprio" - - // UlimitNameRttime is a UlimitName enum value - UlimitNameRttime = "rttime" - - // UlimitNameSigpending is a UlimitName enum value - UlimitNameSigpending = "sigpending" - - // UlimitNameStack is a UlimitName enum value - UlimitNameStack = "stack" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go deleted file mode 100644 index 02d4d4a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go +++ /dev/null @@ -1,108 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ecs - -const ( - - // ErrCodeAttributeLimitExceededException for service response error code - // "AttributeLimitExceededException". - // - // You can apply up to 10 custom attributes per resource. You can view the attributes - // of a resource with ListAttributes. You can remove existing attributes on - // a resource with DeleteAttributes. - ErrCodeAttributeLimitExceededException = "AttributeLimitExceededException" - - // ErrCodeClientException for service response error code - // "ClientException". - // - // These errors are usually caused by a client action, such as using an action - // or resource on behalf of a user that doesn't have permission to use the action - // or resource, or specifying an identifier that is not valid. - ErrCodeClientException = "ClientException" - - // ErrCodeClusterContainsContainerInstancesException for service response error code - // "ClusterContainsContainerInstancesException". - // - // You cannot delete a cluster that has registered container instances. You - // must first deregister the container instances before you can delete the cluster. - // For more information, see DeregisterContainerInstance. - ErrCodeClusterContainsContainerInstancesException = "ClusterContainsContainerInstancesException" - - // ErrCodeClusterContainsServicesException for service response error code - // "ClusterContainsServicesException". - // - // You cannot delete a cluster that contains services. You must first update - // the service to reduce its desired task count to 0 and then delete the service. - // For more information, see UpdateService and DeleteService. - ErrCodeClusterContainsServicesException = "ClusterContainsServicesException" - - // ErrCodeClusterNotFoundException for service response error code - // "ClusterNotFoundException". - // - // The specified cluster could not be found. You can view your available clusters - // with ListClusters. Amazon ECS clusters are region-specific. - ErrCodeClusterNotFoundException = "ClusterNotFoundException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // The specified parameter is invalid. Review the available parameters for the - // API request. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeMissingVersionException for service response error code - // "MissingVersionException". - // - // Amazon ECS is unable to determine the current version of the Amazon ECS container - // agent on the container instance and does not have enough information to proceed - // with an update. This could be because the agent running on the container - // instance is an older or custom version that does not use our version information. - ErrCodeMissingVersionException = "MissingVersionException" - - // ErrCodeNoUpdateAvailableException for service response error code - // "NoUpdateAvailableException". - // - // There is no update available for this Amazon ECS container agent. This could - // be because the agent is already running the latest version, or it is so old - // that there is no update path to the current version. - ErrCodeNoUpdateAvailableException = "NoUpdateAvailableException" - - // ErrCodeServerException for service response error code - // "ServerException". - // - // These errors are usually caused by a server issue. - ErrCodeServerException = "ServerException" - - // ErrCodeServiceNotActiveException for service response error code - // "ServiceNotActiveException". - // - // The specified service is not active. You cannot update a service that is - // not active. If you have previously deleted a service, you can re-create it - // with CreateService. - ErrCodeServiceNotActiveException = "ServiceNotActiveException" - - // ErrCodeServiceNotFoundException for service response error code - // "ServiceNotFoundException". - // - // The specified service could not be found. You can view your available services - // with ListServices. Amazon ECS services are cluster-specific and region-specific. - ErrCodeServiceNotFoundException = "ServiceNotFoundException" - - // ErrCodeTargetNotFoundException for service response error code - // "TargetNotFoundException". - // - // The specified target could not be found. You can view your available container - // instances with ListContainerInstances. Amazon ECS container instances are - // cluster-specific and region-specific. - ErrCodeTargetNotFoundException = "TargetNotFoundException" - - // ErrCodeUpdateInProgressException for service response error code - // "UpdateInProgressException". - // - // There is already a current Amazon ECS container agent update in progress - // on the specified container instance. If the container agent becomes disconnected - // while it is in a transitional stage, such as PENDING or STAGING, the update - // process can get stuck in that state. However, when the agent reconnects, - // it resumes where it stopped previously. - ErrCodeUpdateInProgressException = "UpdateInProgressException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go deleted file mode 100644 index 4998b15..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go +++ /dev/null @@ -1,104 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ecs - -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 EC2 Container Service (Amazon ECS) is a highly scalable, fast, container -// management service that makes it easy to run, stop, and manage Docker containers -// on a cluster of EC2 instances. Amazon ECS lets you launch and stop container-enabled -// applications with simple API calls, allows you to get the state of your cluster -// from a centralized service, and gives you access to many familiar Amazon -// EC2 features like security groups, Amazon EBS volumes, and IAM roles. -// -// You can use Amazon ECS to schedule the placement of containers across your -// cluster based on your resource needs, isolation policies, and availability -// requirements. Amazon EC2 Container Service eliminates the need for you to -// operate your own cluster management and configuration management systems -// or worry about scaling your management infrastructure. -// 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/ecs-2014-11-13 -type ECS 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 = "ecs" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ECS 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 ECS client from just a session. -// svc := ecs.New(mySession) -// -// // Create a ECS client with additional configuration -// svc := ecs.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ECS { - 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) *ECS { - svc := &ECS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-11-13", - JSONVersion: "1.1", - TargetPrefix: "AmazonEC2ContainerServiceV20141113", - }, - 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 ECS operation and runs any -// custom request initialization. -func (c *ECS) 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/ecs/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go deleted file mode 100644 index cbc6f76..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go +++ /dev/null @@ -1,151 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ecs - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilServicesInactive uses the Amazon ECS API operation -// DescribeServices 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 *ECS) WaitUntilServicesInactive(input *DescribeServicesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeServices", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "failure", - Matcher: "pathAny", - Argument: "failures[].reason", - Expected: "MISSING", - }, - { - State: "success", - Matcher: "pathAny", - Argument: "services[].status", - Expected: "INACTIVE", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilServicesStable uses the Amazon ECS API operation -// DescribeServices 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 *ECS) WaitUntilServicesStable(input *DescribeServicesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeServices", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "failure", - Matcher: "pathAny", - Argument: "failures[].reason", - Expected: "MISSING", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "services[].status", - Expected: "DRAINING", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "services[].status", - Expected: "INACTIVE", - }, - { - State: "success", - Matcher: "path", - Argument: "length(services[?!(length(deployments) == `1` && runningCount == desiredCount)]) == `0`", - Expected: true, - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilTasksRunning uses the Amazon ECS API operation -// DescribeTasks 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 *ECS) WaitUntilTasksRunning(input *DescribeTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeTasks", - Delay: 6, - MaxAttempts: 100, - Acceptors: []waiter.WaitAcceptor{ - { - State: "failure", - Matcher: "pathAny", - Argument: "tasks[].lastStatus", - Expected: "STOPPED", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "failures[].reason", - Expected: "MISSING", - }, - { - State: "success", - Matcher: "pathAll", - Argument: "tasks[].lastStatus", - Expected: "RUNNING", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilTasksStopped uses the Amazon ECS API operation -// DescribeTasks 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 *ECS) WaitUntilTasksStopped(input *DescribeTasksInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeTasks", - Delay: 6, - MaxAttempts: 100, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "tasks[].lastStatus", - Expected: "STOPPED", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/efs/api.go b/vendor/github.com/aws/aws-sdk-go/service/efs/api.go deleted file mode 100644 index f4c2ac1..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/api.go +++ /dev/null @@ -1,2334 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package efs provides a client for Amazon Elastic File System. -package efs - -import ( - "fmt" - "time" - - "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/restjson" -) - -const opCreateFileSystem = "CreateFileSystem" - -// CreateFileSystemRequest generates a "aws/request.Request" representing the -// client's request for the CreateFileSystem operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateFileSystem for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateFileSystem method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateFileSystemRequest method. -// req, resp := client.CreateFileSystemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateFileSystem -func (c *EFS) CreateFileSystemRequest(input *CreateFileSystemInput) (req *request.Request, output *FileSystemDescription) { - op := &request.Operation{ - Name: opCreateFileSystem, - HTTPMethod: "POST", - HTTPPath: "/2015-02-01/file-systems", - } - - if input == nil { - input = &CreateFileSystemInput{} - } - - output = &FileSystemDescription{} - req = c.newRequest(op, input, output) - return -} - -// CreateFileSystem API operation for Amazon Elastic File System. -// -// Creates a new, empty file system. The operation requires a creation token -// in the request that Amazon EFS uses to ensure idempotent creation (calling -// the operation with same creation token has no effect). If a file system does -// not currently exist that is owned by the caller's AWS account with the specified -// creation token, this operation does the following: -// -// * Creates a new, empty file system. The file system will have an Amazon -// EFS assigned ID, and an initial lifecycle state creating. -// -// * Returns with the description of the created file system. -// -// Otherwise, this operation returns a FileSystemAlreadyExists error with the -// ID of the existing file system. -// -// For basic use cases, you can use a randomly generated UUID for the creation -// token. -// -// The idempotent operation allows you to retry a CreateFileSystem call without -// risk of creating an extra file system. This can happen when an initial call -// fails in a way that leaves it uncertain whether or not a file system was -// actually created. An example might be that a transport level timeout occurred -// or your connection was reset. As long as you use the same creation token, -// if the initial call had succeeded in creating a file system, the client can -// learn of its existence from the FileSystemAlreadyExists error. -// -// The CreateFileSystem call returns while the file system's lifecycle state -// is still creating. You can check the file system creation status by calling -// the DescribeFileSystems operation, which among other things returns the file -// system state. -// -// This operation also takes an optional PerformanceMode parameter that you -// choose for your file system. We recommend generalPurpose performance mode -// for most file systems. File systems using the maxIO performance mode can -// scale to higher levels of aggregate throughput and operations per second -// with a tradeoff of slightly higher latencies for most file operations. The -// performance mode can't be changed after the file system has been created. -// For more information, see Amazon EFS: Performance Modes (http://docs.aws.amazon.com/efs/latest/ug/performance.html#performancemodes.html). -// -// After the file system is fully created, Amazon EFS sets its lifecycle state -// to available, at which point you can create one or more mount targets for -// the file system in your VPC. For more information, see CreateMountTarget. -// You mount your Amazon EFS file system on an EC2 instances in your VPC via -// the mount target. For more information, see Amazon EFS: How it Works (http://docs.aws.amazon.com/efs/latest/ug/how-it-works.html). -// -// This operation requires permissions for the elasticfilesystem:CreateFileSystem -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation CreateFileSystem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeFileSystemAlreadyExists "FileSystemAlreadyExists" -// Returned if the file system you are trying to create already exists, with -// the creation token you provided. -// -// * ErrCodeFileSystemLimitExceeded "FileSystemLimitExceeded" -// Returned if the AWS account has already created maximum number of file systems -// allowed per account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateFileSystem -func (c *EFS) CreateFileSystem(input *CreateFileSystemInput) (*FileSystemDescription, error) { - req, out := c.CreateFileSystemRequest(input) - err := req.Send() - return out, err -} - -const opCreateMountTarget = "CreateMountTarget" - -// CreateMountTargetRequest generates a "aws/request.Request" representing the -// client's request for the CreateMountTarget operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateMountTarget for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateMountTarget method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateMountTargetRequest method. -// req, resp := client.CreateMountTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateMountTarget -func (c *EFS) CreateMountTargetRequest(input *CreateMountTargetInput) (req *request.Request, output *MountTargetDescription) { - op := &request.Operation{ - Name: opCreateMountTarget, - HTTPMethod: "POST", - HTTPPath: "/2015-02-01/mount-targets", - } - - if input == nil { - input = &CreateMountTargetInput{} - } - - output = &MountTargetDescription{} - req = c.newRequest(op, input, output) - return -} - -// CreateMountTarget API operation for Amazon Elastic File System. -// -// Creates a mount target for a file system. You can then mount the file system -// on EC2 instances via the mount target. -// -// You can create one mount target in each Availability Zone in your VPC. All -// EC2 instances in a VPC within a given Availability Zone share a single mount -// target for a given file system. If you have multiple subnets in an Availability -// Zone, you create a mount target in one of the subnets. EC2 instances do not -// need to be in the same subnet as the mount target in order to access their -// file system. For more information, see Amazon EFS: How it Works (http://docs.aws.amazon.com/efs/latest/ug/how-it-works.html). -// -// In the request, you also specify a file system ID for which you are creating -// the mount target and the file system's lifecycle state must be available. -// For more information, see DescribeFileSystems. -// -// In the request, you also provide a subnet ID, which determines the following: -// -// * VPC in which Amazon EFS creates the mount target -// -// * Availability Zone in which Amazon EFS creates the mount target -// -// * IP address range from which Amazon EFS selects the IP address of the -// mount target (if you don't specify an IP address in the request) -// -// After creating the mount target, Amazon EFS returns a response that includes, -// a MountTargetId and an IpAddress. You use this IP address when mounting the -// file system in an EC2 instance. You can also use the mount target's DNS name -// when mounting the file system. The EC2 instance on which you mount the file -// system via the mount target can resolve the mount target's DNS name to its -// IP address. For more information, see How it Works: Implementation Overview -// (http://docs.aws.amazon.com/efs/latest/ug/how-it-works.html#how-it-works-implementation). -// -// Note that you can create mount targets for a file system in only one VPC, -// and there can be only one mount target per Availability Zone. That is, if -// the file system already has one or more mount targets created for it, the -// subnet specified in the request to add another mount target must meet the -// following requirements: -// -// * Must belong to the same VPC as the subnets of the existing mount targets -// -// * Must not be in the same Availability Zone as any of the subnets of the -// existing mount targets -// -// If the request satisfies the requirements, Amazon EFS does the following: -// -// * Creates a new mount target in the specified subnet. -// -// * Also creates a new network interface in the subnet as follows: -// -// If the request provides an IpAddress, Amazon EFS assigns that IP address -// to the network interface. Otherwise, Amazon EFS assigns a free address -// in the subnet (in the same way that the Amazon EC2 CreateNetworkInterface -// call does when a request does not specify a primary private IP address). -// -// If the request provides SecurityGroups, this network interface is associated -// with those security groups. Otherwise, it belongs to the default security -// group for the subnet's VPC. -// -// Assigns the description Mount target fsmt-id for file system fs-id where -// fsmt-id is the mount target ID, and fs-id is the FileSystemId. -// -// Sets the requesterManaged property of the network interface to true, and -// the requesterId value to EFS. -// -// Each Amazon EFS mount target has one corresponding requester-managed EC2 -// network interface. After the network interface is created, Amazon EFS -// sets the NetworkInterfaceId field in the mount target's description to -// the network interface ID, and the IpAddress field to its address. If network -// interface creation fails, the entire CreateMountTarget operation fails. -// -// The CreateMountTarget call returns only after creating the network interface, -// but while the mount target state is still creating, you can check the mount -// target creation status by calling the DescribeMountTargets operation, which -// among other things returns the mount target state. -// -// We recommend you create a mount target in each of the Availability Zones. -// There are cost considerations for using a file system in an Availability -// Zone through a mount target created in another Availability Zone. For more -// information, see Amazon EFS (http://aws.amazon.com/efs/). In addition, by -// always using a mount target local to the instance's Availability Zone, you -// eliminate a partial failure scenario. If the Availability Zone in which your -// mount target is created goes down, then you won't be able to access your -// file system through that mount target. -// -// This operation requires permissions for the following action on the file -// system: -// -// * elasticfilesystem:CreateMountTarget -// -// This operation also requires permissions for the following Amazon EC2 actions: -// -// * ec2:DescribeSubnets -// -// * ec2:DescribeNetworkInterfaces -// -// * ec2:CreateNetworkInterface -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation CreateMountTarget for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeFileSystemNotFound "FileSystemNotFound" -// Returned if the specified FileSystemId does not exist in the requester's -// AWS account. -// -// * ErrCodeIncorrectFileSystemLifeCycleState "IncorrectFileSystemLifeCycleState" -// Returned if the file system's life cycle state is not "created". -// -// * ErrCodeMountTargetConflict "MountTargetConflict" -// Returned if the mount target would violate one of the specified restrictions -// based on the file system's existing mount targets. -// -// * ErrCodeSubnetNotFound "SubnetNotFound" -// Returned if there is no subnet with ID SubnetId provided in the request. -// -// * ErrCodeNoFreeAddressesInSubnet "NoFreeAddressesInSubnet" -// Returned if IpAddress was not specified in the request and there are no free -// IP addresses in the subnet. -// -// * ErrCodeIpAddressInUse "IpAddressInUse" -// Returned if the request specified an IpAddress that is already in use in -// the subnet. -// -// * ErrCodeNetworkInterfaceLimitExceeded "NetworkInterfaceLimitExceeded" -// The calling account has reached the ENI limit for the specific AWS region. -// Client should try to delete some ENIs or get its account limit raised. For -// more information, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html) -// in the Amazon Virtual Private Cloud User Guide (see the Network interfaces -// per VPC entry in the table). -// -// * ErrCodeSecurityGroupLimitExceeded "SecurityGroupLimitExceeded" -// Returned if the size of SecurityGroups specified in the request is greater -// than five. -// -// * ErrCodeSecurityGroupNotFound "SecurityGroupNotFound" -// Returned if one of the specified security groups does not exist in the subnet's -// VPC. -// -// * ErrCodeUnsupportedAvailabilityZone "UnsupportedAvailabilityZone" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateMountTarget -func (c *EFS) CreateMountTarget(input *CreateMountTargetInput) (*MountTargetDescription, error) { - req, out := c.CreateMountTargetRequest(input) - err := req.Send() - return out, err -} - -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/elasticfilesystem-2015-02-01/CreateTags -func (c *EFS) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, output *CreateTagsOutput) { - op := &request.Operation{ - Name: opCreateTags, - HTTPMethod: "POST", - HTTPPath: "/2015-02-01/create-tags/{FileSystemId}", - } - - if input == nil { - input = &CreateTagsInput{} - } - - output = &CreateTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateTags API operation for Amazon Elastic File System. -// -// Creates or overwrites tags associated with a file system. Each tag is a key-value -// pair. If a tag key specified in the request already exists on the file system, -// this operation overwrites its value with the value provided in the request. -// If you add the Name tag to your file system, Amazon EFS returns it in the -// response to the DescribeFileSystems operation. -// -// This operation requires permission for the elasticfilesystem:CreateTags action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation CreateTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeFileSystemNotFound "FileSystemNotFound" -// Returned if the specified FileSystemId does not exist in the requester's -// AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateTags -func (c *EFS) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { - req, out := c.CreateTagsRequest(input) - err := req.Send() - return out, err -} - -const opDeleteFileSystem = "DeleteFileSystem" - -// DeleteFileSystemRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFileSystem operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteFileSystem for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteFileSystem method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteFileSystemRequest method. -// req, resp := client.DeleteFileSystemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteFileSystem -func (c *EFS) DeleteFileSystemRequest(input *DeleteFileSystemInput) (req *request.Request, output *DeleteFileSystemOutput) { - op := &request.Operation{ - Name: opDeleteFileSystem, - HTTPMethod: "DELETE", - HTTPPath: "/2015-02-01/file-systems/{FileSystemId}", - } - - if input == nil { - input = &DeleteFileSystemInput{} - } - - output = &DeleteFileSystemOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteFileSystem API operation for Amazon Elastic File System. -// -// Deletes a file system, permanently severing access to its contents. Upon -// return, the file system no longer exists and you can't access any contents -// of the deleted file system. -// -// You can't delete a file system that is in use. That is, if the file system -// has any mount targets, you must first delete them. For more information, -// see DescribeMountTargets and DeleteMountTarget. -// -// The DeleteFileSystem call returns while the file system state is still deleting. -// You can check the file system deletion status by calling the DescribeFileSystems -// operation, which returns a list of file systems in your account. If you pass -// file system ID or creation token for the deleted file system, the DescribeFileSystems -// returns a 404 FileSystemNotFound error. -// -// This operation requires permissions for the elasticfilesystem:DeleteFileSystem -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation DeleteFileSystem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeFileSystemNotFound "FileSystemNotFound" -// Returned if the specified FileSystemId does not exist in the requester's -// AWS account. -// -// * ErrCodeFileSystemInUse "FileSystemInUse" -// Returned if a file system has mount targets. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteFileSystem -func (c *EFS) DeleteFileSystem(input *DeleteFileSystemInput) (*DeleteFileSystemOutput, error) { - req, out := c.DeleteFileSystemRequest(input) - err := req.Send() - return out, err -} - -const opDeleteMountTarget = "DeleteMountTarget" - -// DeleteMountTargetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMountTarget operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteMountTarget for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteMountTarget method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteMountTargetRequest method. -// req, resp := client.DeleteMountTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteMountTarget -func (c *EFS) DeleteMountTargetRequest(input *DeleteMountTargetInput) (req *request.Request, output *DeleteMountTargetOutput) { - op := &request.Operation{ - Name: opDeleteMountTarget, - HTTPMethod: "DELETE", - HTTPPath: "/2015-02-01/mount-targets/{MountTargetId}", - } - - if input == nil { - input = &DeleteMountTargetInput{} - } - - output = &DeleteMountTargetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteMountTarget API operation for Amazon Elastic File System. -// -// Deletes the specified mount target. -// -// This operation forcibly breaks any mounts of the file system via the mount -// target that is being deleted, which might disrupt instances or applications -// using those mounts. To avoid applications getting cut off abruptly, you might -// consider unmounting any mounts of the mount target, if feasible. The operation -// also deletes the associated network interface. Uncommitted writes may be -// lost, but breaking a mount target using this operation does not corrupt the -// file system itself. The file system you created remains. You can mount an -// EC2 instance in your VPC via another mount target. -// -// This operation requires permissions for the following action on the file -// system: -// -// * elasticfilesystem:DeleteMountTarget -// -// The DeleteMountTarget call returns while the mount target state is still -// deleting. You can check the mount target deletion by calling the DescribeMountTargets -// operation, which returns a list of mount target descriptions for the given -// file system. -// -// The operation also requires permissions for the following Amazon EC2 action -// on the mount target's network interface: -// -// * ec2:DeleteNetworkInterface -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation DeleteMountTarget for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeDependencyTimeout "DependencyTimeout" -// The service timed out trying to fulfill the request, and the client should -// try the call again. -// -// * ErrCodeMountTargetNotFound "MountTargetNotFound" -// Returned if there is no mount target with the specified ID found in the caller's -// account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteMountTarget -func (c *EFS) DeleteMountTarget(input *DeleteMountTargetInput) (*DeleteMountTargetOutput, error) { - req, out := c.DeleteMountTargetRequest(input) - err := req.Send() - return out, err -} - -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/elasticfilesystem-2015-02-01/DeleteTags -func (c *EFS) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { - op := &request.Operation{ - Name: opDeleteTags, - HTTPMethod: "POST", - HTTPPath: "/2015-02-01/delete-tags/{FileSystemId}", - } - - if input == nil { - input = &DeleteTagsInput{} - } - - output = &DeleteTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTags API operation for Amazon Elastic File System. -// -// Deletes the specified tags from a file system. If the DeleteTags request -// includes a tag key that does not exist, Amazon EFS ignores it and doesn't -// cause an error. For more information about tags and related restrictions, -// see Tag Restrictions (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// in the AWS Billing and Cost Management User Guide. -// -// This operation requires permissions for the elasticfilesystem:DeleteTags -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation DeleteTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeFileSystemNotFound "FileSystemNotFound" -// Returned if the specified FileSystemId does not exist in the requester's -// AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteTags -func (c *EFS) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeFileSystems = "DescribeFileSystems" - -// DescribeFileSystemsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFileSystems operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeFileSystems for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeFileSystems method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeFileSystemsRequest method. -// req, resp := client.DescribeFileSystemsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeFileSystems -func (c *EFS) DescribeFileSystemsRequest(input *DescribeFileSystemsInput) (req *request.Request, output *DescribeFileSystemsOutput) { - op := &request.Operation{ - Name: opDescribeFileSystems, - HTTPMethod: "GET", - HTTPPath: "/2015-02-01/file-systems", - } - - if input == nil { - input = &DescribeFileSystemsInput{} - } - - output = &DescribeFileSystemsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFileSystems API operation for Amazon Elastic File System. -// -// Returns the description of a specific Amazon EFS file system if either the -// file system CreationToken or the FileSystemId is provided. Otherwise, it -// returns descriptions of all file systems owned by the caller's AWS account -// in the AWS Region of the endpoint that you're calling. -// -// When retrieving all file system descriptions, you can optionally specify -// the MaxItems parameter to limit the number of descriptions in a response. -// If more file system descriptions remain, Amazon EFS returns a NextMarker, -// an opaque token, in the response. In this case, you should send a subsequent -// request with the Marker request parameter set to the value of NextMarker. -// -// To retrieve a list of your file system descriptions, this operation is used -// in an iterative process, where DescribeFileSystems is called first without -// the Marker and then the operation continues to call it with the Marker parameter -// set to the value of the NextMarker from the previous response until the response -// has no NextMarker. -// -// The implementation may return fewer than MaxItems file system descriptions -// while still including a NextMarker value. -// -// The order of file systems returned in the response of one DescribeFileSystems -// call and the order of file systems returned across the responses of a multi-call -// iteration is unspecified. -// -// This operation requires permissions for the elasticfilesystem:DescribeFileSystems -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation DescribeFileSystems for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeFileSystemNotFound "FileSystemNotFound" -// Returned if the specified FileSystemId does not exist in the requester's -// AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeFileSystems -func (c *EFS) DescribeFileSystems(input *DescribeFileSystemsInput) (*DescribeFileSystemsOutput, error) { - req, out := c.DescribeFileSystemsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMountTargetSecurityGroups = "DescribeMountTargetSecurityGroups" - -// DescribeMountTargetSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMountTargetSecurityGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMountTargetSecurityGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMountTargetSecurityGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMountTargetSecurityGroupsRequest method. -// req, resp := client.DescribeMountTargetSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetSecurityGroups -func (c *EFS) DescribeMountTargetSecurityGroupsRequest(input *DescribeMountTargetSecurityGroupsInput) (req *request.Request, output *DescribeMountTargetSecurityGroupsOutput) { - op := &request.Operation{ - Name: opDescribeMountTargetSecurityGroups, - HTTPMethod: "GET", - HTTPPath: "/2015-02-01/mount-targets/{MountTargetId}/security-groups", - } - - if input == nil { - input = &DescribeMountTargetSecurityGroupsInput{} - } - - output = &DescribeMountTargetSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMountTargetSecurityGroups API operation for Amazon Elastic File System. -// -// Returns the security groups currently in effect for a mount target. This -// operation requires that the network interface of the mount target has been -// created and the lifecycle state of the mount target is not deleted. -// -// This operation requires permissions for the following actions: -// -// * elasticfilesystem:DescribeMountTargetSecurityGroups action on the mount -// target's file system. -// -// * ec2:DescribeNetworkInterfaceAttribute action on the mount target's 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 File System's -// API operation DescribeMountTargetSecurityGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeMountTargetNotFound "MountTargetNotFound" -// Returned if there is no mount target with the specified ID found in the caller's -// account. -// -// * ErrCodeIncorrectMountTargetState "IncorrectMountTargetState" -// Returned if the mount target is not in the correct state for the operation. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetSecurityGroups -func (c *EFS) DescribeMountTargetSecurityGroups(input *DescribeMountTargetSecurityGroupsInput) (*DescribeMountTargetSecurityGroupsOutput, error) { - req, out := c.DescribeMountTargetSecurityGroupsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMountTargets = "DescribeMountTargets" - -// DescribeMountTargetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMountTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMountTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMountTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMountTargetsRequest method. -// req, resp := client.DescribeMountTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargets -func (c *EFS) DescribeMountTargetsRequest(input *DescribeMountTargetsInput) (req *request.Request, output *DescribeMountTargetsOutput) { - op := &request.Operation{ - Name: opDescribeMountTargets, - HTTPMethod: "GET", - HTTPPath: "/2015-02-01/mount-targets", - } - - if input == nil { - input = &DescribeMountTargetsInput{} - } - - output = &DescribeMountTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMountTargets API operation for Amazon Elastic File System. -// -// Returns the descriptions of all the current mount targets, or a specific -// mount target, for a file system. When requesting all of the current mount -// targets, the order of mount targets returned in the response is unspecified. -// -// This operation requires permissions for the elasticfilesystem:DescribeMountTargets -// action, on either the file system ID that you specify in FileSystemId, or -// on the file system of the mount target that you specify in MountTargetId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation DescribeMountTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeFileSystemNotFound "FileSystemNotFound" -// Returned if the specified FileSystemId does not exist in the requester's -// AWS account. -// -// * ErrCodeMountTargetNotFound "MountTargetNotFound" -// Returned if there is no mount target with the specified ID found in the caller's -// account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargets -func (c *EFS) DescribeMountTargets(input *DescribeMountTargetsInput) (*DescribeMountTargetsOutput, error) { - req, out := c.DescribeMountTargetsRequest(input) - err := req.Send() - return out, err -} - -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/elasticfilesystem-2015-02-01/DescribeTags -func (c *EFS) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { - op := &request.Operation{ - Name: opDescribeTags, - HTTPMethod: "GET", - HTTPPath: "/2015-02-01/tags/{FileSystemId}/", - } - - if input == nil { - input = &DescribeTagsInput{} - } - - output = &DescribeTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTags API operation for Amazon Elastic File System. -// -// Returns the tags associated with a file system. The order of tags returned -// in the response of one DescribeTags call and the order of tags returned across -// the responses of a multi-call iteration (when using pagination) is unspecified. -// -// This operation requires permissions for the elasticfilesystem:DescribeTags -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 File System's -// API operation DescribeTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeFileSystemNotFound "FileSystemNotFound" -// Returned if the specified FileSystemId does not exist in the requester's -// AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeTags -func (c *EFS) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err -} - -const opModifyMountTargetSecurityGroups = "ModifyMountTargetSecurityGroups" - -// ModifyMountTargetSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyMountTargetSecurityGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyMountTargetSecurityGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyMountTargetSecurityGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyMountTargetSecurityGroupsRequest method. -// req, resp := client.ModifyMountTargetSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/ModifyMountTargetSecurityGroups -func (c *EFS) ModifyMountTargetSecurityGroupsRequest(input *ModifyMountTargetSecurityGroupsInput) (req *request.Request, output *ModifyMountTargetSecurityGroupsOutput) { - op := &request.Operation{ - Name: opModifyMountTargetSecurityGroups, - HTTPMethod: "PUT", - HTTPPath: "/2015-02-01/mount-targets/{MountTargetId}/security-groups", - } - - if input == nil { - input = &ModifyMountTargetSecurityGroupsInput{} - } - - output = &ModifyMountTargetSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyMountTargetSecurityGroups API operation for Amazon Elastic File System. -// -// Modifies the set of security groups in effect for a mount target. -// -// When you create a mount target, Amazon EFS also creates a new network interface. -// For more information, see CreateMountTarget. This operation replaces the -// security groups in effect for the network interface associated with a mount -// target, with the SecurityGroups provided in the request. This operation requires -// that the network interface of the mount target has been created and the lifecycle -// state of the mount target is not deleted. -// -// The operation requires permissions for the following actions: -// -// * elasticfilesystem:ModifyMountTargetSecurityGroups action on the mount -// target's file system. -// -// * ec2:ModifyNetworkInterfaceAttribute action on the mount target's 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 File System's -// API operation ModifyMountTargetSecurityGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" -// Returned if the request is malformed or contains an error such as an invalid -// parameter value or a missing required parameter. -// -// * ErrCodeInternalServerError "InternalServerError" -// Returned if an error occurred on the server side. -// -// * ErrCodeMountTargetNotFound "MountTargetNotFound" -// Returned if there is no mount target with the specified ID found in the caller's -// account. -// -// * ErrCodeIncorrectMountTargetState "IncorrectMountTargetState" -// Returned if the mount target is not in the correct state for the operation. -// -// * ErrCodeSecurityGroupLimitExceeded "SecurityGroupLimitExceeded" -// Returned if the size of SecurityGroups specified in the request is greater -// than five. -// -// * ErrCodeSecurityGroupNotFound "SecurityGroupNotFound" -// Returned if one of the specified security groups does not exist in the subnet's -// VPC. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/ModifyMountTargetSecurityGroups -func (c *EFS) ModifyMountTargetSecurityGroups(input *ModifyMountTargetSecurityGroupsInput) (*ModifyMountTargetSecurityGroupsOutput, error) { - req, out := c.ModifyMountTargetSecurityGroupsRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateFileSystemRequest -type CreateFileSystemInput struct { - _ struct{} `type:"structure"` - - // String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent - // creation. - // - // CreationToken is a required field - CreationToken *string `min:"1" type:"string" required:"true"` - - // The PerformanceMode of the file system. We recommend generalPurpose performance - // mode for most file systems. File systems using the maxIO performance mode - // can scale to higher levels of aggregate throughput and operations per second - // with a tradeoff of slightly higher latencies for most file operations. This - // can't be changed after the file system has been created. - PerformanceMode *string `type:"string" enum:"PerformanceMode"` -} - -// String returns the string representation -func (s CreateFileSystemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFileSystemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFileSystemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFileSystemInput"} - if s.CreationToken == nil { - invalidParams.Add(request.NewErrParamRequired("CreationToken")) - } - if s.CreationToken != nil && len(*s.CreationToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CreationToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreationToken sets the CreationToken field's value. -func (s *CreateFileSystemInput) SetCreationToken(v string) *CreateFileSystemInput { - s.CreationToken = &v - return s -} - -// SetPerformanceMode sets the PerformanceMode field's value. -func (s *CreateFileSystemInput) SetPerformanceMode(v string) *CreateFileSystemInput { - s.PerformanceMode = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateMountTargetRequest -type CreateMountTargetInput struct { - _ struct{} `type:"structure"` - - // ID of the file system for which to create the mount target. - // - // FileSystemId is a required field - FileSystemId *string `type:"string" required:"true"` - - // Valid IPv4 address within the address range of the specified subnet. - IpAddress *string `type:"string"` - - // Up to five VPC security group IDs, of the form sg-xxxxxxxx. These must be - // for the same VPC as subnet specified. - SecurityGroups []*string `type:"list"` - - // ID of the subnet to add the mount target in. - // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateMountTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateMountTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMountTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMountTargetInput"} - if s.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *CreateMountTargetInput) SetFileSystemId(v string) *CreateMountTargetInput { - s.FileSystemId = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *CreateMountTargetInput) SetIpAddress(v string) *CreateMountTargetInput { - s.IpAddress = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *CreateMountTargetInput) SetSecurityGroups(v []*string) *CreateMountTargetInput { - s.SecurityGroups = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *CreateMountTargetInput) SetSubnetId(v string) *CreateMountTargetInput { - s.SubnetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateTagsRequest -type CreateTagsInput struct { - _ struct{} `type:"structure"` - - // ID of the file system whose tags you want to modify (String). This operation - // modifies the tags only, not the file system. - // - // FileSystemId is a required field - FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` - - // Array of Tag objects to add. Each Tag object is a key-value pair. - // - // Tags is a required field - Tags []*Tag `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.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - 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 -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *CreateTagsInput) SetFileSystemId(v string) *CreateTagsInput { - s.FileSystemId = &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/elasticfilesystem-2015-02-01/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() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteFileSystemRequest -type DeleteFileSystemInput struct { - _ struct{} `type:"structure"` - - // ID of the file system you want to delete. - // - // FileSystemId is a required field - FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteFileSystemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFileSystemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFileSystemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFileSystemInput"} - if s.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *DeleteFileSystemInput) SetFileSystemId(v string) *DeleteFileSystemInput { - s.FileSystemId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteFileSystemOutput -type DeleteFileSystemOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteFileSystemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFileSystemOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteMountTargetRequest -type DeleteMountTargetInput struct { - _ struct{} `type:"structure"` - - // ID of the mount target to delete (String). - // - // MountTargetId is a required field - MountTargetId *string `location:"uri" locationName:"MountTargetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMountTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMountTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMountTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMountTargetInput"} - if s.MountTargetId == nil { - invalidParams.Add(request.NewErrParamRequired("MountTargetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMountTargetId sets the MountTargetId field's value. -func (s *DeleteMountTargetInput) SetMountTargetId(v string) *DeleteMountTargetInput { - s.MountTargetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteMountTargetOutput -type DeleteMountTargetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteMountTargetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMountTargetOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteTagsRequest -type DeleteTagsInput struct { - _ struct{} `type:"structure"` - - // ID of the file system whose tags you want to delete (String). - // - // FileSystemId is a required field - FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` - - // List of tag keys to delete. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// 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.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *DeleteTagsInput) SetFileSystemId(v string) *DeleteTagsInput { - s.FileSystemId = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/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() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeFileSystemsRequest -type DescribeFileSystemsInput struct { - _ struct{} `type:"structure"` - - // (Optional) Restricts the list to the file system with this creation token - // (String). You specify a creation token when you create an Amazon EFS file - // system. - CreationToken *string `location:"querystring" locationName:"CreationToken" min:"1" type:"string"` - - // (Optional) ID of the file system whose description you want to retrieve (String). - FileSystemId *string `location:"querystring" locationName:"FileSystemId" type:"string"` - - // (Optional) Opaque pagination token returned from a previous DescribeFileSystems - // operation (String). If present, specifies to continue the list from where - // the returning call had left off. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // (Optional) Specifies the maximum number of file systems to return in the - // response (integer). This parameter value must be greater than 0. The number - // of items that Amazon EFS returns is the minimum of the MaxItems parameter - // specified in the request and the service's internal maximum number of items - // per page. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` -} - -// String returns the string representation -func (s DescribeFileSystemsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFileSystemsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFileSystemsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFileSystemsInput"} - if s.CreationToken != nil && len(*s.CreationToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CreationToken", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreationToken sets the CreationToken field's value. -func (s *DescribeFileSystemsInput) SetCreationToken(v string) *DescribeFileSystemsInput { - s.CreationToken = &v - return s -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *DescribeFileSystemsInput) SetFileSystemId(v string) *DescribeFileSystemsInput { - s.FileSystemId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeFileSystemsInput) SetMarker(v string) *DescribeFileSystemsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *DescribeFileSystemsInput) SetMaxItems(v int64) *DescribeFileSystemsInput { - s.MaxItems = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeFileSystemsResponse -type DescribeFileSystemsOutput struct { - _ struct{} `type:"structure"` - - // Array of file system descriptions. - FileSystems []*FileSystemDescription `type:"list"` - - // Present if provided by caller in the request (String). - Marker *string `type:"string"` - - // Present if there are more file systems than returned in the response (String). - // You can use the NextMarker in the subsequent request to fetch the descriptions. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeFileSystemsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFileSystemsOutput) GoString() string { - return s.String() -} - -// SetFileSystems sets the FileSystems field's value. -func (s *DescribeFileSystemsOutput) SetFileSystems(v []*FileSystemDescription) *DescribeFileSystemsOutput { - s.FileSystems = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeFileSystemsOutput) SetMarker(v string) *DescribeFileSystemsOutput { - s.Marker = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeFileSystemsOutput) SetNextMarker(v string) *DescribeFileSystemsOutput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetSecurityGroupsRequest -type DescribeMountTargetSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // ID of the mount target whose security groups you want to retrieve. - // - // MountTargetId is a required field - MountTargetId *string `location:"uri" locationName:"MountTargetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeMountTargetSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMountTargetSecurityGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMountTargetSecurityGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMountTargetSecurityGroupsInput"} - if s.MountTargetId == nil { - invalidParams.Add(request.NewErrParamRequired("MountTargetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMountTargetId sets the MountTargetId field's value. -func (s *DescribeMountTargetSecurityGroupsInput) SetMountTargetId(v string) *DescribeMountTargetSecurityGroupsInput { - s.MountTargetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetSecurityGroupsResponse -type DescribeMountTargetSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // Array of security groups. - // - // SecurityGroups is a required field - SecurityGroups []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeMountTargetSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMountTargetSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *DescribeMountTargetSecurityGroupsOutput) SetSecurityGroups(v []*string) *DescribeMountTargetSecurityGroupsOutput { - s.SecurityGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetsRequest -type DescribeMountTargetsInput struct { - _ struct{} `type:"structure"` - - // (Optional) ID of the file system whose mount targets you want to list (String). - // It must be included in your request if MountTargetId is not included. - FileSystemId *string `location:"querystring" locationName:"FileSystemId" type:"string"` - - // (Optional) Opaque pagination token returned from a previous DescribeMountTargets - // operation (String). If present, it specifies to continue the list from where - // the previous returning call left off. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // (Optional) Maximum number of mount targets to return in the response. It - // must be an integer with a value greater than zero. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` - - // (Optional) ID of the mount target that you want to have described (String). - // It must be included in your request if FileSystemId is not included. - MountTargetId *string `location:"querystring" locationName:"MountTargetId" type:"string"` -} - -// String returns the string representation -func (s DescribeMountTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMountTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMountTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMountTargetsInput"} - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *DescribeMountTargetsInput) SetFileSystemId(v string) *DescribeMountTargetsInput { - s.FileSystemId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeMountTargetsInput) SetMarker(v string) *DescribeMountTargetsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *DescribeMountTargetsInput) SetMaxItems(v int64) *DescribeMountTargetsInput { - s.MaxItems = &v - return s -} - -// SetMountTargetId sets the MountTargetId field's value. -func (s *DescribeMountTargetsInput) SetMountTargetId(v string) *DescribeMountTargetsInput { - s.MountTargetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetsResponse -type DescribeMountTargetsOutput struct { - _ struct{} `type:"structure"` - - // If the request included the Marker, the response returns that value in this - // field. - Marker *string `type:"string"` - - // Returns the file system's mount targets as an array of MountTargetDescription - // objects. - MountTargets []*MountTargetDescription `type:"list"` - - // If a value is present, there are more mount targets to return. In a subsequent - // request, you can provide Marker in your request with this value to retrieve - // the next set of mount targets. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeMountTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMountTargetsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeMountTargetsOutput) SetMarker(v string) *DescribeMountTargetsOutput { - s.Marker = &v - return s -} - -// SetMountTargets sets the MountTargets field's value. -func (s *DescribeMountTargetsOutput) SetMountTargets(v []*MountTargetDescription) *DescribeMountTargetsOutput { - s.MountTargets = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeMountTargetsOutput) SetNextMarker(v string) *DescribeMountTargetsOutput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeTagsRequest -type DescribeTagsInput struct { - _ struct{} `type:"structure"` - - // ID of the file system whose tag set you want to retrieve. - // - // FileSystemId is a required field - FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` - - // (Optional) Opaque pagination token returned from a previous DescribeTags - // operation (String). If present, it specifies to continue the list from where - // the previous call left off. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // (Optional) Maximum number of file system tags to return in the response. - // It must be an integer with a value greater than zero. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTagsInput"} - if s.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *DescribeTagsInput) SetFileSystemId(v string) *DescribeTagsInput { - s.FileSystemId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTagsInput) SetMarker(v string) *DescribeTagsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *DescribeTagsInput) SetMaxItems(v int64) *DescribeTagsInput { - s.MaxItems = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeTagsResponse -type DescribeTagsOutput struct { - _ struct{} `type:"structure"` - - // If the request included a Marker, the response returns that value in this - // field. - Marker *string `type:"string"` - - // If a value is present, there are more tags to return. In a subsequent request, - // you can provide the value of NextMarker as the value of the Marker parameter - // in your next request to retrieve the next set of tags. - NextMarker *string `type:"string"` - - // Returns tags associated with the file system as an array of Tag objects. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// 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() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTagsOutput) SetMarker(v string) *DescribeTagsOutput { - s.Marker = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeTagsOutput) SetNextMarker(v string) *DescribeTagsOutput { - s.NextMarker = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DescribeTagsOutput) SetTags(v []*Tag) *DescribeTagsOutput { - s.Tags = v - return s -} - -// Description of the file system. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/FileSystemDescription -type FileSystemDescription struct { - _ struct{} `type:"structure"` - - // Time that the file system was created, in seconds (since 1970-01-01T00:00:00Z). - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // Opaque string specified in the request. - // - // CreationToken is a required field - CreationToken *string `min:"1" type:"string" required:"true"` - - // ID of the file system, assigned by Amazon EFS. - // - // FileSystemId is a required field - FileSystemId *string `type:"string" required:"true"` - - // Lifecycle phase of the file system. - // - // LifeCycleState is a required field - LifeCycleState *string `type:"string" required:"true" enum:"LifeCycleState"` - - // You can add tags to a file system, including a Name tag. For more information, - // see CreateTags. If the file system has a Name tag, Amazon EFS returns the - // value in this field. - Name *string `type:"string"` - - // Current number of mount targets that the file system has. For more information, - // see CreateMountTarget. - // - // NumberOfMountTargets is a required field - NumberOfMountTargets *int64 `type:"integer" required:"true"` - - // AWS account that created the file system. If the file system was created - // by an IAM user, the parent account to which the user belongs is the owner. - // - // OwnerId is a required field - OwnerId *string `type:"string" required:"true"` - - // The PerformanceMode of the file system. - // - // PerformanceMode is a required field - PerformanceMode *string `type:"string" required:"true" enum:"PerformanceMode"` - - // Latest known metered size (in bytes) of data stored in the file system, in - // bytes, in its Value field, and the time at which that size was determined - // in its Timestamp field. The Timestamp value is the integer number of seconds - // since 1970-01-01T00:00:00Z. Note that the value does not represent the size - // of a consistent snapshot of the file system, but it is eventually consistent - // when there are no writes to the file system. That is, the value will represent - // actual size only if the file system is not modified for a period longer than - // a couple of hours. Otherwise, the value is not the exact size the file system - // was at any instant in time. - // - // SizeInBytes is a required field - SizeInBytes *FileSystemSize `type:"structure" required:"true"` -} - -// String returns the string representation -func (s FileSystemDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FileSystemDescription) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *FileSystemDescription) SetCreationTime(v time.Time) *FileSystemDescription { - s.CreationTime = &v - return s -} - -// SetCreationToken sets the CreationToken field's value. -func (s *FileSystemDescription) SetCreationToken(v string) *FileSystemDescription { - s.CreationToken = &v - return s -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *FileSystemDescription) SetFileSystemId(v string) *FileSystemDescription { - s.FileSystemId = &v - return s -} - -// SetLifeCycleState sets the LifeCycleState field's value. -func (s *FileSystemDescription) SetLifeCycleState(v string) *FileSystemDescription { - s.LifeCycleState = &v - return s -} - -// SetName sets the Name field's value. -func (s *FileSystemDescription) SetName(v string) *FileSystemDescription { - s.Name = &v - return s -} - -// SetNumberOfMountTargets sets the NumberOfMountTargets field's value. -func (s *FileSystemDescription) SetNumberOfMountTargets(v int64) *FileSystemDescription { - s.NumberOfMountTargets = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *FileSystemDescription) SetOwnerId(v string) *FileSystemDescription { - s.OwnerId = &v - return s -} - -// SetPerformanceMode sets the PerformanceMode field's value. -func (s *FileSystemDescription) SetPerformanceMode(v string) *FileSystemDescription { - s.PerformanceMode = &v - return s -} - -// SetSizeInBytes sets the SizeInBytes field's value. -func (s *FileSystemDescription) SetSizeInBytes(v *FileSystemSize) *FileSystemDescription { - s.SizeInBytes = v - return s -} - -// Latest known metered size (in bytes) of data stored in the file system, in -// its Value field, and the time at which that size was determined in its Timestamp -// field. Note that the value does not represent the size of a consistent snapshot -// of the file system, but it is eventually consistent when there are no writes -// to the file system. That is, the value will represent the actual size only -// if the file system is not modified for a period longer than a couple of hours. -// Otherwise, the value is not necessarily the exact size the file system was -// at any instant in time. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/FileSystemSize -type FileSystemSize struct { - _ struct{} `type:"structure"` - - // Time at which the size of data, returned in the Value field, was determined. - // The value is the integer number of seconds since 1970-01-01T00:00:00Z. - Timestamp *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Latest known metered size (in bytes) of data stored in the file system. - // - // Value is a required field - Value *int64 `type:"long" required:"true"` -} - -// String returns the string representation -func (s FileSystemSize) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FileSystemSize) GoString() string { - return s.String() -} - -// SetTimestamp sets the Timestamp field's value. -func (s *FileSystemSize) SetTimestamp(v time.Time) *FileSystemSize { - s.Timestamp = &v - return s -} - -// SetValue sets the Value field's value. -func (s *FileSystemSize) SetValue(v int64) *FileSystemSize { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/ModifyMountTargetSecurityGroupsRequest -type ModifyMountTargetSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // ID of the mount target whose security groups you want to modify. - // - // MountTargetId is a required field - MountTargetId *string `location:"uri" locationName:"MountTargetId" type:"string" required:"true"` - - // Array of up to five VPC security group IDs. - SecurityGroups []*string `type:"list"` -} - -// String returns the string representation -func (s ModifyMountTargetSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyMountTargetSecurityGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyMountTargetSecurityGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyMountTargetSecurityGroupsInput"} - if s.MountTargetId == nil { - invalidParams.Add(request.NewErrParamRequired("MountTargetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMountTargetId sets the MountTargetId field's value. -func (s *ModifyMountTargetSecurityGroupsInput) SetMountTargetId(v string) *ModifyMountTargetSecurityGroupsInput { - s.MountTargetId = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *ModifyMountTargetSecurityGroupsInput) SetSecurityGroups(v []*string) *ModifyMountTargetSecurityGroupsInput { - s.SecurityGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/ModifyMountTargetSecurityGroupsOutput -type ModifyMountTargetSecurityGroupsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyMountTargetSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyMountTargetSecurityGroupsOutput) GoString() string { - return s.String() -} - -// Provides a description of a mount target. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/MountTargetDescription -type MountTargetDescription struct { - _ struct{} `type:"structure"` - - // ID of the file system for which the mount target is intended. - // - // FileSystemId is a required field - FileSystemId *string `type:"string" required:"true"` - - // Address at which the file system may be mounted via the mount target. - IpAddress *string `type:"string"` - - // Lifecycle state of the mount target. - // - // LifeCycleState is a required field - LifeCycleState *string `type:"string" required:"true" enum:"LifeCycleState"` - - // System-assigned mount target ID. - // - // MountTargetId is a required field - MountTargetId *string `type:"string" required:"true"` - - // ID of the network interface that Amazon EFS created when it created the mount - // target. - NetworkInterfaceId *string `type:"string"` - - // AWS account ID that owns the resource. - OwnerId *string `type:"string"` - - // ID of the mount target's subnet. - // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s MountTargetDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MountTargetDescription) GoString() string { - return s.String() -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *MountTargetDescription) SetFileSystemId(v string) *MountTargetDescription { - s.FileSystemId = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *MountTargetDescription) SetIpAddress(v string) *MountTargetDescription { - s.IpAddress = &v - return s -} - -// SetLifeCycleState sets the LifeCycleState field's value. -func (s *MountTargetDescription) SetLifeCycleState(v string) *MountTargetDescription { - s.LifeCycleState = &v - return s -} - -// SetMountTargetId sets the MountTargetId field's value. -func (s *MountTargetDescription) SetMountTargetId(v string) *MountTargetDescription { - s.MountTargetId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *MountTargetDescription) SetNetworkInterfaceId(v string) *MountTargetDescription { - s.NetworkInterfaceId = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *MountTargetDescription) SetOwnerId(v string) *MountTargetDescription { - s.OwnerId = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *MountTargetDescription) SetSubnetId(v string) *MountTargetDescription { - s.SubnetId = &v - return s -} - -// A tag is a key-value pair. Allowed characters: letters, whitespace, and numbers, -// representable in UTF-8, and the following characters: + - = . _ : / -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // Tag key (String). The key can't start with aws:. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // Value of the tag key. - // - // 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 -} - -const ( - // LifeCycleStateCreating is a LifeCycleState enum value - LifeCycleStateCreating = "creating" - - // LifeCycleStateAvailable is a LifeCycleState enum value - LifeCycleStateAvailable = "available" - - // LifeCycleStateDeleting is a LifeCycleState enum value - LifeCycleStateDeleting = "deleting" - - // LifeCycleStateDeleted is a LifeCycleState enum value - LifeCycleStateDeleted = "deleted" -) - -const ( - // PerformanceModeGeneralPurpose is a PerformanceMode enum value - PerformanceModeGeneralPurpose = "generalPurpose" - - // PerformanceModeMaxIo is a PerformanceMode enum value - PerformanceModeMaxIo = "maxIO" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go deleted file mode 100644 index 326ffa4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go +++ /dev/null @@ -1,127 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package efs - -const ( - - // ErrCodeBadRequest for service response error code - // "BadRequest". - // - // Returned if the request is malformed or contains an error such as an invalid - // parameter value or a missing required parameter. - ErrCodeBadRequest = "BadRequest" - - // ErrCodeDependencyTimeout for service response error code - // "DependencyTimeout". - // - // The service timed out trying to fulfill the request, and the client should - // try the call again. - ErrCodeDependencyTimeout = "DependencyTimeout" - - // ErrCodeFileSystemAlreadyExists for service response error code - // "FileSystemAlreadyExists". - // - // Returned if the file system you are trying to create already exists, with - // the creation token you provided. - ErrCodeFileSystemAlreadyExists = "FileSystemAlreadyExists" - - // ErrCodeFileSystemInUse for service response error code - // "FileSystemInUse". - // - // Returned if a file system has mount targets. - ErrCodeFileSystemInUse = "FileSystemInUse" - - // ErrCodeFileSystemLimitExceeded for service response error code - // "FileSystemLimitExceeded". - // - // Returned if the AWS account has already created maximum number of file systems - // allowed per account. - ErrCodeFileSystemLimitExceeded = "FileSystemLimitExceeded" - - // ErrCodeFileSystemNotFound for service response error code - // "FileSystemNotFound". - // - // Returned if the specified FileSystemId does not exist in the requester's - // AWS account. - ErrCodeFileSystemNotFound = "FileSystemNotFound" - - // ErrCodeIncorrectFileSystemLifeCycleState for service response error code - // "IncorrectFileSystemLifeCycleState". - // - // Returned if the file system's life cycle state is not "created". - ErrCodeIncorrectFileSystemLifeCycleState = "IncorrectFileSystemLifeCycleState" - - // ErrCodeIncorrectMountTargetState for service response error code - // "IncorrectMountTargetState". - // - // Returned if the mount target is not in the correct state for the operation. - ErrCodeIncorrectMountTargetState = "IncorrectMountTargetState" - - // ErrCodeInternalServerError for service response error code - // "InternalServerError". - // - // Returned if an error occurred on the server side. - ErrCodeInternalServerError = "InternalServerError" - - // ErrCodeIpAddressInUse for service response error code - // "IpAddressInUse". - // - // Returned if the request specified an IpAddress that is already in use in - // the subnet. - ErrCodeIpAddressInUse = "IpAddressInUse" - - // ErrCodeMountTargetConflict for service response error code - // "MountTargetConflict". - // - // Returned if the mount target would violate one of the specified restrictions - // based on the file system's existing mount targets. - ErrCodeMountTargetConflict = "MountTargetConflict" - - // ErrCodeMountTargetNotFound for service response error code - // "MountTargetNotFound". - // - // Returned if there is no mount target with the specified ID found in the caller's - // account. - ErrCodeMountTargetNotFound = "MountTargetNotFound" - - // ErrCodeNetworkInterfaceLimitExceeded for service response error code - // "NetworkInterfaceLimitExceeded". - // - // The calling account has reached the ENI limit for the specific AWS region. - // Client should try to delete some ENIs or get its account limit raised. For - // more information, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html) - // in the Amazon Virtual Private Cloud User Guide (see the Network interfaces - // per VPC entry in the table). - ErrCodeNetworkInterfaceLimitExceeded = "NetworkInterfaceLimitExceeded" - - // ErrCodeNoFreeAddressesInSubnet for service response error code - // "NoFreeAddressesInSubnet". - // - // Returned if IpAddress was not specified in the request and there are no free - // IP addresses in the subnet. - ErrCodeNoFreeAddressesInSubnet = "NoFreeAddressesInSubnet" - - // ErrCodeSecurityGroupLimitExceeded for service response error code - // "SecurityGroupLimitExceeded". - // - // Returned if the size of SecurityGroups specified in the request is greater - // than five. - ErrCodeSecurityGroupLimitExceeded = "SecurityGroupLimitExceeded" - - // ErrCodeSecurityGroupNotFound for service response error code - // "SecurityGroupNotFound". - // - // Returned if one of the specified security groups does not exist in the subnet's - // VPC. - ErrCodeSecurityGroupNotFound = "SecurityGroupNotFound" - - // ErrCodeSubnetNotFound for service response error code - // "SubnetNotFound". - // - // Returned if there is no subnet with ID SubnetId provided in the request. - ErrCodeSubnetNotFound = "SubnetNotFound" - - // ErrCodeUnsupportedAvailabilityZone for service response error code - // "UnsupportedAvailabilityZone". - ErrCodeUnsupportedAvailabilityZone = "UnsupportedAvailabilityZone" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/efs/service.go b/vendor/github.com/aws/aws-sdk-go/service/efs/service.go deleted file mode 100644 index 583f08d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/service.go +++ /dev/null @@ -1,95 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package efs - -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" -) - -// Amazon Elastic File System (Amazon EFS) provides simple, scalable file storage -// for use with Amazon EC2 instances in the AWS Cloud. With Amazon EFS, storage -// capacity is elastic, growing and shrinking automatically as you add and remove -// files, so your applications have the storage they need, when they need it. -// For more information, see the User Guide (http://docs.aws.amazon.com/efs/latest/ug/api-reference.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/elasticfilesystem-2015-02-01 -type EFS 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 = "elasticfilesystem" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the EFS 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 EFS client from just a session. -// svc := efs.New(mySession) -// -// // Create a EFS client with additional configuration -// svc := efs.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *EFS { - 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) *EFS { - svc := &EFS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-02-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a EFS operation and runs any -// custom request initialization. -func (c *EFS) 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/elasticache/api.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go deleted file mode 100644 index 4eab1e4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go +++ /dev/null @@ -1,10921 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elasticache provides a client for Amazon ElastiCache. -package elasticache - -import ( - "time" - - "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 opAddTagsToResource = "AddTagsToResource" - -// AddTagsToResourceRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToResourceRequest method. -// req, resp := client.AddTagsToResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AddTagsToResource -func (c *ElastiCache) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *request.Request, output *TagListMessage) { - op := &request.Operation{ - Name: opAddTagsToResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsToResourceInput{} - } - - output = &TagListMessage{} - req = c.newRequest(op, input, output) - return -} - -// AddTagsToResource API operation for Amazon ElastiCache. -// -// Adds up to 10 cost allocation tags to the named resource. A cost allocation -// tag is a key-value pair where the key and value are case-sensitive. You can -// use cost allocation tags to categorize and track your AWS costs. -// -// When you apply tags to your ElastiCache resources, AWS generates a cost allocation -// report as a comma-separated value (CSV) file with your usage and costs aggregated -// by your tags. You can apply tags that represent business categories (such -// as cost centers, application names, or owners) to organize your costs across -// multiple services. For more information, see Using Cost Allocation Tags in -// Amazon ElastiCache (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Tagging.html) -// in the ElastiCache 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 ElastiCache's -// API operation AddTagsToResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" -// The requested snapshot name does not refer to an existing snapshot. -// -// * ErrCodeTagQuotaPerResourceExceeded "TagQuotaPerResourceExceeded" -// The request cannot be processed because it would cause the resource to have -// more than the allowed number of tags. The maximum number of tags permitted -// on a resource is 10. -// -// * ErrCodeInvalidARNFault "InvalidARN" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AddTagsToResource -func (c *ElastiCache) AddTagsToResource(input *AddTagsToResourceInput) (*TagListMessage, error) { - req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err -} - -const opAuthorizeCacheSecurityGroupIngress = "AuthorizeCacheSecurityGroupIngress" - -// AuthorizeCacheSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the AuthorizeCacheSecurityGroupIngress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AuthorizeCacheSecurityGroupIngress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AuthorizeCacheSecurityGroupIngress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AuthorizeCacheSecurityGroupIngressRequest method. -// req, resp := client.AuthorizeCacheSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AuthorizeCacheSecurityGroupIngress -func (c *ElastiCache) AuthorizeCacheSecurityGroupIngressRequest(input *AuthorizeCacheSecurityGroupIngressInput) (req *request.Request, output *AuthorizeCacheSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opAuthorizeCacheSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AuthorizeCacheSecurityGroupIngressInput{} - } - - output = &AuthorizeCacheSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - return -} - -// AuthorizeCacheSecurityGroupIngress API operation for Amazon ElastiCache. -// -// Allows network ingress to a cache security group. Applications using ElastiCache -// must be running on Amazon EC2, and Amazon EC2 security groups are used as -// the authorization mechanism. -// -// You cannot authorize ingress from an Amazon EC2 security group in one region -// to an ElastiCache cluster in another 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 ElastiCache's -// API operation AuthorizeCacheSecurityGroupIngress for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" -// The requested cache security group name does not refer to an existing cache -// security group. -// -// * ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" -// The current state of the cache security group does not allow deletion. -// -// * ErrCodeAuthorizationAlreadyExistsFault "AuthorizationAlreadyExists" -// The specified Amazon EC2 security group is already authorized for the specified -// cache security group. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AuthorizeCacheSecurityGroupIngress -func (c *ElastiCache) AuthorizeCacheSecurityGroupIngress(input *AuthorizeCacheSecurityGroupIngressInput) (*AuthorizeCacheSecurityGroupIngressOutput, error) { - req, out := c.AuthorizeCacheSecurityGroupIngressRequest(input) - err := req.Send() - return out, err -} - -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/elasticache-2015-02-02/CopySnapshot -func (c *ElastiCache) 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 ElastiCache. -// -// Makes a copy of an existing snapshot. -// -// This operation is valid for Redis only. -// -// Users or groups that have permissions to use the CopySnapshot operation can -// create their own Amazon S3 buckets and copy snapshots to it. To control access -// to your snapshots, use an IAM policy to control who has the ability to use -// the CopySnapshot operation. For more information about using IAM to control -// the use of ElastiCache operations, see Exporting Snapshots (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html) -// and Authentication & Access Control (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/IAM.html). -// -// You could receive the following error messages. -// -// Error Messages -// -// * Error Message: The S3 bucket %s is outside of the region. -// -// Solution: Create an Amazon S3 bucket in the same region as your snapshot. -// For more information, see Step 1: Create an Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html#Snapshots.Exporting.CreateBucket) -// in the ElastiCache User Guide. -// -// * Error Message: The S3 bucket %s does not exist. -// -// Solution: Create an Amazon S3 bucket in the same region as your snapshot. -// For more information, see Step 1: Create an Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html#Snapshots.Exporting.CreateBucket) -// in the ElastiCache User Guide. -// -// * Error Message: The S3 bucket %s is not owned by the authenticated user. -// -// Solution: Create an Amazon S3 bucket in the same region as your snapshot. -// For more information, see Step 1: Create an Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html#Snapshots.Exporting.CreateBucket) -// in the ElastiCache User Guide. -// -// * Error Message: The authenticated user does not have sufficient permissions -// to perform the desired activity. -// -// Solution: Contact your system administrator to get the needed permissions. -// -// * Error Message: The S3 bucket %s already contains an object with key -// %s. -// -// Solution: Give the TargetSnapshotName a new and unique value. If exporting -// a snapshot, you could alternatively create a new Amazon S3 bucket and -// use this same value for TargetSnapshotName. -// -// * Error Message: ElastiCache has not been granted READ permissions %s -// on the S3 Bucket. -// -// Solution: Add List and Read permissions on the bucket. For more information, -// see Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html#Snapshots.Exporting.GrantAccess) -// in the ElastiCache User Guide. -// -// * Error Message: ElastiCache has not been granted WRITE permissions %s -// on the S3 Bucket. -// -// Solution: Add Upload/Delete permissions on the bucket. For more information, -// see Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html#Snapshots.Exporting.GrantAccess) -// in the ElastiCache User Guide. -// -// * Error Message: ElastiCache has not been granted READ_ACP permissions -// %s on the S3 Bucket. -// -// Solution: Add View Permissions on the bucket. For more information, see Step -// 2: Grant ElastiCache Access to Your Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html#Snapshots.Exporting.GrantAccess) -// in the ElastiCache 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 ElastiCache's -// API operation CopySnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSnapshotAlreadyExistsFault "SnapshotAlreadyExistsFault" -// You already have a snapshot with the given name. -// -// * ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" -// The requested snapshot name does not refer to an existing snapshot. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceededFault" -// The request cannot be processed because it would exceed the maximum number -// of snapshots. -// -// * ErrCodeInvalidSnapshotStateFault "InvalidSnapshotState" -// The current state of the snapshot does not allow the requested operation -// to occur. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CopySnapshot -func (c *ElastiCache) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) { - req, out := c.CopySnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCreateCacheCluster = "CreateCacheCluster" - -// CreateCacheClusterRequest generates a "aws/request.Request" representing the -// client's request for the CreateCacheCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCacheCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCacheCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateCacheClusterRequest method. -// req, resp := client.CreateCacheClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheCluster -func (c *ElastiCache) CreateCacheClusterRequest(input *CreateCacheClusterInput) (req *request.Request, output *CreateCacheClusterOutput) { - op := &request.Operation{ - Name: opCreateCacheCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCacheClusterInput{} - } - - output = &CreateCacheClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCacheCluster API operation for Amazon ElastiCache. -// -// Creates a cache cluster. All nodes in the cache cluster run the same protocol-compliant -// cache engine software, either Memcached or Redis. -// -// Due to current limitations on Redis (cluster mode disabled), this operation -// or parameter is not supported on Redis (cluster mode enabled) replication -// groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation CreateCacheCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" -// The specified replication group does not exist. -// -// * ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" -// The requested replication group is not in the available state. -// -// * ErrCodeCacheClusterAlreadyExistsFault "CacheClusterAlreadyExists" -// You already have a cache cluster with the given identifier. -// -// * ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" -// The requested cache node type is not available in the specified Availability -// Zone. -// -// * ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" -// The requested cache security group name does not refer to an existing cache -// security group. -// -// * ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" -// The requested cache subnet group name does not refer to an existing cache -// subnet group. -// -// * ErrCodeClusterQuotaForCustomerExceededFault "ClusterQuotaForCustomerExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache clusters per customer. -// -// * ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache nodes in a single cache cluster. -// -// * ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache nodes per customer. -// -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The VPC network is in an invalid state. -// -// * ErrCodeTagQuotaPerResourceExceeded "TagQuotaPerResourceExceeded" -// The request cannot be processed because it would cause the resource to have -// more than the allowed number of tags. The maximum number of tags permitted -// on a resource is 10. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheCluster -func (c *ElastiCache) CreateCacheCluster(input *CreateCacheClusterInput) (*CreateCacheClusterOutput, error) { - req, out := c.CreateCacheClusterRequest(input) - err := req.Send() - return out, err -} - -const opCreateCacheParameterGroup = "CreateCacheParameterGroup" - -// CreateCacheParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateCacheParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCacheParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCacheParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateCacheParameterGroupRequest method. -// req, resp := client.CreateCacheParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheParameterGroup -func (c *ElastiCache) CreateCacheParameterGroupRequest(input *CreateCacheParameterGroupInput) (req *request.Request, output *CreateCacheParameterGroupOutput) { - op := &request.Operation{ - Name: opCreateCacheParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCacheParameterGroupInput{} - } - - output = &CreateCacheParameterGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCacheParameterGroup API operation for Amazon ElastiCache. -// -// Creates a new cache parameter group. A cache parameter group is a collection -// of parameters that you apply to all of the nodes in a cache cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation CreateCacheParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheParameterGroupQuotaExceededFault "CacheParameterGroupQuotaExceeded" -// The request cannot be processed because it would exceed the maximum number -// of cache security groups. -// -// * ErrCodeCacheParameterGroupAlreadyExistsFault "CacheParameterGroupAlreadyExists" -// A cache parameter group with the requested name already exists. -// -// * ErrCodeInvalidCacheParameterGroupStateFault "InvalidCacheParameterGroupState" -// The current state of the cache parameter group does not allow the requested -// operation to occur. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheParameterGroup -func (c *ElastiCache) CreateCacheParameterGroup(input *CreateCacheParameterGroupInput) (*CreateCacheParameterGroupOutput, error) { - req, out := c.CreateCacheParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateCacheSecurityGroup = "CreateCacheSecurityGroup" - -// CreateCacheSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateCacheSecurityGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCacheSecurityGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCacheSecurityGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateCacheSecurityGroupRequest method. -// req, resp := client.CreateCacheSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSecurityGroup -func (c *ElastiCache) CreateCacheSecurityGroupRequest(input *CreateCacheSecurityGroupInput) (req *request.Request, output *CreateCacheSecurityGroupOutput) { - op := &request.Operation{ - Name: opCreateCacheSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCacheSecurityGroupInput{} - } - - output = &CreateCacheSecurityGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCacheSecurityGroup API operation for Amazon ElastiCache. -// -// Creates a new cache security group. Use a cache security group to control -// access to one or more cache clusters. -// -// Cache security groups are only used when you are creating a cache cluster -// outside of an Amazon Virtual Private Cloud (Amazon VPC). If you are creating -// a cache cluster inside of a VPC, use a cache subnet group instead. For more -// information, see CreateCacheSubnetGroup (http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateCacheSubnetGroup.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 ElastiCache's -// API operation CreateCacheSecurityGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheSecurityGroupAlreadyExistsFault "CacheSecurityGroupAlreadyExists" -// A cache security group with the specified name already exists. -// -// * ErrCodeCacheSecurityGroupQuotaExceededFault "QuotaExceeded.CacheSecurityGroup" -// The request cannot be processed because it would exceed the allowed number -// of cache security groups. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSecurityGroup -func (c *ElastiCache) CreateCacheSecurityGroup(input *CreateCacheSecurityGroupInput) (*CreateCacheSecurityGroupOutput, error) { - req, out := c.CreateCacheSecurityGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateCacheSubnetGroup = "CreateCacheSubnetGroup" - -// CreateCacheSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateCacheSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCacheSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCacheSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateCacheSubnetGroupRequest method. -// req, resp := client.CreateCacheSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSubnetGroup -func (c *ElastiCache) CreateCacheSubnetGroupRequest(input *CreateCacheSubnetGroupInput) (req *request.Request, output *CreateCacheSubnetGroupOutput) { - op := &request.Operation{ - Name: opCreateCacheSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCacheSubnetGroupInput{} - } - - output = &CreateCacheSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCacheSubnetGroup API operation for Amazon ElastiCache. -// -// Creates a new cache subnet group. -// -// Use this parameter only when you are creating a cluster in an Amazon Virtual -// Private Cloud (Amazon 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 ElastiCache's -// API operation CreateCacheSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheSubnetGroupAlreadyExistsFault "CacheSubnetGroupAlreadyExists" -// The requested cache subnet group name is already in use by an existing cache -// subnet group. -// -// * ErrCodeCacheSubnetGroupQuotaExceededFault "CacheSubnetGroupQuotaExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache subnet groups. -// -// * ErrCodeCacheSubnetQuotaExceededFault "CacheSubnetQuotaExceededFault" -// The request cannot be processed because it would exceed the allowed number -// of subnets in a cache subnet group. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// An invalid subnet identifier was specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSubnetGroup -func (c *ElastiCache) CreateCacheSubnetGroup(input *CreateCacheSubnetGroupInput) (*CreateCacheSubnetGroupOutput, error) { - req, out := c.CreateCacheSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateReplicationGroup = "CreateReplicationGroup" - -// CreateReplicationGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateReplicationGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReplicationGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReplicationGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReplicationGroupRequest method. -// req, resp := client.CreateReplicationGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateReplicationGroup -func (c *ElastiCache) CreateReplicationGroupRequest(input *CreateReplicationGroupInput) (req *request.Request, output *CreateReplicationGroupOutput) { - op := &request.Operation{ - Name: opCreateReplicationGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReplicationGroupInput{} - } - - output = &CreateReplicationGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReplicationGroup API operation for Amazon ElastiCache. -// -// Creates a Redis (cluster mode disabled) or a Redis (cluster mode enabled) -// replication group. -// -// A Redis (cluster mode disabled) replication group is a collection of cache -// clusters, where one of the cache clusters is a read/write primary and the -// others are read-only replicas. Writes to the primary are asynchronously propagated -// to the replicas. -// -// A Redis (cluster mode enabled) replication group is a collection of 1 to -// 15 node groups (shards). Each node group (shard) has one read/write primary -// node and up to 5 read-only replica nodes. Writes to the primary are asynchronously -// propagated to the replicas. Redis (cluster mode enabled) replication groups -// partition the data across node groups (shards). -// -// When a Redis (cluster mode disabled) replication group has been successfully -// created, you can add one or more read replicas to it, up to a total of 5 -// read replicas. You cannot alter a Redis (cluster mode enabled) replication -// group after it has been created. -// -// This operation is valid for Redis only. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation CreateReplicationGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" -// The requested cache cluster is not in the available state. -// -// * ErrCodeReplicationGroupAlreadyExistsFault "ReplicationGroupAlreadyExists" -// The specified replication group already exists. -// -// * ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" -// The requested cache node type is not available in the specified Availability -// Zone. -// -// * ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" -// The requested cache security group name does not refer to an existing cache -// security group. -// -// * ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" -// The requested cache subnet group name does not refer to an existing cache -// subnet group. -// -// * ErrCodeClusterQuotaForCustomerExceededFault "ClusterQuotaForCustomerExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache clusters per customer. -// -// * ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache nodes in a single cache cluster. -// -// * ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache nodes per customer. -// -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The VPC network is in an invalid state. -// -// * ErrCodeTagQuotaPerResourceExceeded "TagQuotaPerResourceExceeded" -// The request cannot be processed because it would cause the resource to have -// more than the allowed number of tags. The maximum number of tags permitted -// on a resource is 10. -// -// * ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault "NodeGroupsPerReplicationGroupQuotaExceeded" -// The request cannot be processed because it would exceed the maximum of 15 -// node groups (shards) in a single replication group. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateReplicationGroup -func (c *ElastiCache) CreateReplicationGroup(input *CreateReplicationGroupInput) (*CreateReplicationGroupOutput, error) { - req, out := c.CreateReplicationGroupRequest(input) - err := req.Send() - return out, err -} - -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/elasticache-2015-02-02/CreateSnapshot -func (c *ElastiCache) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *CreateSnapshotOutput) { - op := &request.Operation{ - Name: opCreateSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSnapshotInput{} - } - - output = &CreateSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSnapshot API operation for Amazon ElastiCache. -// -// Creates a copy of an entire cache cluster or replication group at a specific -// moment in time. -// -// This operation is valid for Redis only. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation CreateSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSnapshotAlreadyExistsFault "SnapshotAlreadyExistsFault" -// You already have a snapshot with the given name. -// -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" -// The specified replication group does not exist. -// -// * ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" -// The requested cache cluster is not in the available state. -// -// * ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" -// The requested replication group is not in the available state. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceededFault" -// The request cannot be processed because it would exceed the maximum number -// of snapshots. -// -// * ErrCodeSnapshotFeatureNotSupportedFault "SnapshotFeatureNotSupportedFault" -// You attempted one of the following operations: -// -// * Creating a snapshot of a Redis cache cluster running on a cache.t1.micro -// cache node. -// -// * Creating a snapshot of a cache cluster that is running Memcached rather -// than Redis. -// -// Neither of these are supported by ElastiCache. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateSnapshot -func (c *ElastiCache) CreateSnapshot(input *CreateSnapshotInput) (*CreateSnapshotOutput, error) { - req, out := c.CreateSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCacheCluster = "DeleteCacheCluster" - -// DeleteCacheClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCacheCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCacheCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCacheCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCacheClusterRequest method. -// req, resp := client.DeleteCacheClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheCluster -func (c *ElastiCache) DeleteCacheClusterRequest(input *DeleteCacheClusterInput) (req *request.Request, output *DeleteCacheClusterOutput) { - op := &request.Operation{ - Name: opDeleteCacheCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCacheClusterInput{} - } - - output = &DeleteCacheClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCacheCluster API operation for Amazon ElastiCache. -// -// Deletes a previously provisioned cache cluster. DeleteCacheCluster deletes -// all associated cache nodes, node endpoints and the cache cluster itself. -// When you receive a successful response from this operation, Amazon ElastiCache -// immediately begins deleting the cache cluster; you cannot cancel or revert -// this operation. -// -// This operation cannot be used to delete a cache cluster that is the last -// read replica of a replication group or node group (shard) that has Multi-AZ -// mode enabled or a cache cluster from a Redis (cluster mode enabled) replication -// group. -// -// Due to current limitations on Redis (cluster mode disabled), this operation -// or parameter is not supported on Redis (cluster mode enabled) replication -// groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DeleteCacheCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" -// The requested cache cluster is not in the available state. -// -// * ErrCodeSnapshotAlreadyExistsFault "SnapshotAlreadyExistsFault" -// You already have a snapshot with the given name. -// -// * ErrCodeSnapshotFeatureNotSupportedFault "SnapshotFeatureNotSupportedFault" -// You attempted one of the following operations: -// -// * Creating a snapshot of a Redis cache cluster running on a cache.t1.micro -// cache node. -// -// * Creating a snapshot of a cache cluster that is running Memcached rather -// than Redis. -// -// Neither of these are supported by ElastiCache. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceededFault" -// The request cannot be processed because it would exceed the maximum number -// of snapshots. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheCluster -func (c *ElastiCache) DeleteCacheCluster(input *DeleteCacheClusterInput) (*DeleteCacheClusterOutput, error) { - req, out := c.DeleteCacheClusterRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCacheParameterGroup = "DeleteCacheParameterGroup" - -// DeleteCacheParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCacheParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCacheParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCacheParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCacheParameterGroupRequest method. -// req, resp := client.DeleteCacheParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheParameterGroup -func (c *ElastiCache) DeleteCacheParameterGroupRequest(input *DeleteCacheParameterGroupInput) (req *request.Request, output *DeleteCacheParameterGroupOutput) { - op := &request.Operation{ - Name: opDeleteCacheParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCacheParameterGroupInput{} - } - - output = &DeleteCacheParameterGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCacheParameterGroup API operation for Amazon ElastiCache. -// -// Deletes the specified cache parameter group. You cannot delete a cache parameter -// group if it is associated with any cache clusters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DeleteCacheParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidCacheParameterGroupStateFault "InvalidCacheParameterGroupState" -// The current state of the cache parameter group does not allow the requested -// operation to occur. -// -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheParameterGroup -func (c *ElastiCache) DeleteCacheParameterGroup(input *DeleteCacheParameterGroupInput) (*DeleteCacheParameterGroupOutput, error) { - req, out := c.DeleteCacheParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCacheSecurityGroup = "DeleteCacheSecurityGroup" - -// DeleteCacheSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCacheSecurityGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCacheSecurityGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCacheSecurityGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCacheSecurityGroupRequest method. -// req, resp := client.DeleteCacheSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSecurityGroup -func (c *ElastiCache) DeleteCacheSecurityGroupRequest(input *DeleteCacheSecurityGroupInput) (req *request.Request, output *DeleteCacheSecurityGroupOutput) { - op := &request.Operation{ - Name: opDeleteCacheSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCacheSecurityGroupInput{} - } - - output = &DeleteCacheSecurityGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCacheSecurityGroup API operation for Amazon ElastiCache. -// -// Deletes a cache security group. -// -// You cannot delete a cache security group if it is associated with any cache -// clusters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DeleteCacheSecurityGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" -// The current state of the cache security group does not allow deletion. -// -// * ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" -// The requested cache security group name does not refer to an existing cache -// security group. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSecurityGroup -func (c *ElastiCache) DeleteCacheSecurityGroup(input *DeleteCacheSecurityGroupInput) (*DeleteCacheSecurityGroupOutput, error) { - req, out := c.DeleteCacheSecurityGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCacheSubnetGroup = "DeleteCacheSubnetGroup" - -// DeleteCacheSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCacheSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCacheSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCacheSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCacheSubnetGroupRequest method. -// req, resp := client.DeleteCacheSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSubnetGroup -func (c *ElastiCache) DeleteCacheSubnetGroupRequest(input *DeleteCacheSubnetGroupInput) (req *request.Request, output *DeleteCacheSubnetGroupOutput) { - op := &request.Operation{ - Name: opDeleteCacheSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCacheSubnetGroupInput{} - } - - output = &DeleteCacheSubnetGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCacheSubnetGroup API operation for Amazon ElastiCache. -// -// Deletes a cache subnet group. -// -// You cannot delete a cache subnet group if it is associated with any cache -// clusters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DeleteCacheSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheSubnetGroupInUse "CacheSubnetGroupInUse" -// The requested cache subnet group is currently in use. -// -// * ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" -// The requested cache subnet group name does not refer to an existing cache -// subnet group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSubnetGroup -func (c *ElastiCache) DeleteCacheSubnetGroup(input *DeleteCacheSubnetGroupInput) (*DeleteCacheSubnetGroupOutput, error) { - req, out := c.DeleteCacheSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteReplicationGroup = "DeleteReplicationGroup" - -// DeleteReplicationGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReplicationGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteReplicationGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteReplicationGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteReplicationGroupRequest method. -// req, resp := client.DeleteReplicationGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteReplicationGroup -func (c *ElastiCache) DeleteReplicationGroupRequest(input *DeleteReplicationGroupInput) (req *request.Request, output *DeleteReplicationGroupOutput) { - op := &request.Operation{ - Name: opDeleteReplicationGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteReplicationGroupInput{} - } - - output = &DeleteReplicationGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteReplicationGroup API operation for Amazon ElastiCache. -// -// Deletes an existing replication group. By default, this operation deletes -// the entire replication group, including the primary/primaries and all of -// the read replicas. If the replication group has only one primary, you can -// optionally delete only the read replicas, while retaining the primary by -// setting RetainPrimaryCluster=true. -// -// When you receive a successful response from this operation, Amazon ElastiCache -// immediately begins deleting the selected resources; you cannot cancel or -// revert this operation. -// -// This operation is valid for Redis only. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DeleteReplicationGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" -// The specified replication group does not exist. -// -// * ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" -// The requested replication group is not in the available state. -// -// * ErrCodeSnapshotAlreadyExistsFault "SnapshotAlreadyExistsFault" -// You already have a snapshot with the given name. -// -// * ErrCodeSnapshotFeatureNotSupportedFault "SnapshotFeatureNotSupportedFault" -// You attempted one of the following operations: -// -// * Creating a snapshot of a Redis cache cluster running on a cache.t1.micro -// cache node. -// -// * Creating a snapshot of a cache cluster that is running Memcached rather -// than Redis. -// -// Neither of these are supported by ElastiCache. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceededFault" -// The request cannot be processed because it would exceed the maximum number -// of snapshots. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteReplicationGroup -func (c *ElastiCache) DeleteReplicationGroup(input *DeleteReplicationGroupInput) (*DeleteReplicationGroupOutput, error) { - req, out := c.DeleteReplicationGroupRequest(input) - err := req.Send() - return out, err -} - -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/elasticache-2015-02-02/DeleteSnapshot -func (c *ElastiCache) 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) - return -} - -// DeleteSnapshot API operation for Amazon ElastiCache. -// -// Deletes an existing snapshot. When you receive a successful response from -// this operation, ElastiCache immediately begins deleting the snapshot; you -// cannot cancel or revert this operation. -// -// This operation is valid for Redis only. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DeleteSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" -// The requested snapshot name does not refer to an existing snapshot. -// -// * ErrCodeInvalidSnapshotStateFault "InvalidSnapshotState" -// The current state of the snapshot does not allow the requested operation -// to occur. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteSnapshot -func (c *ElastiCache) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { - req, out := c.DeleteSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opDescribeCacheClusters = "DescribeCacheClusters" - -// DescribeCacheClustersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCacheClusters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCacheClusters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCacheClusters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCacheClustersRequest method. -// req, resp := client.DescribeCacheClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheClusters -func (c *ElastiCache) DescribeCacheClustersRequest(input *DescribeCacheClustersInput) (req *request.Request, output *DescribeCacheClustersOutput) { - op := &request.Operation{ - Name: opDescribeCacheClusters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeCacheClustersInput{} - } - - output = &DescribeCacheClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCacheClusters API operation for Amazon ElastiCache. -// -// Returns information about all provisioned cache clusters if no cache cluster -// identifier is specified, or about a specific cache cluster if a cache cluster -// identifier is supplied. -// -// By default, abbreviated information about the cache clusters are returned. -// You can use the optional ShowDetails flag to retrieve detailed information -// about the cache nodes associated with the cache clusters. These details include -// the DNS address and port for the cache node endpoint. -// -// If the cluster is in the CREATING state, only cluster-level information is -// displayed until all of the nodes are successfully provisioned. -// -// If the cluster is in the DELETING state, only cluster-level information is -// displayed. -// -// If cache nodes are currently being added to the cache cluster, node endpoint -// information and creation time for the additional nodes are not displayed -// until they are completely provisioned. When the cache cluster state is available, -// the cluster is ready for use. -// -// If cache nodes are currently being removed from the cache cluster, no endpoint -// information for the removed nodes is displayed. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeCacheClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheClusters -func (c *ElastiCache) DescribeCacheClusters(input *DescribeCacheClustersInput) (*DescribeCacheClustersOutput, error) { - req, out := c.DescribeCacheClustersRequest(input) - err := req.Send() - return out, err -} - -// DescribeCacheClustersPages iterates over the pages of a DescribeCacheClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheClusters 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 DescribeCacheClusters operation. -// pageNum := 0 -// err := client.DescribeCacheClustersPages(params, -// func(page *DescribeCacheClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheClustersPages(input *DescribeCacheClustersInput, fn func(p *DescribeCacheClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheClustersOutput), lastPage) - }) -} - -const opDescribeCacheEngineVersions = "DescribeCacheEngineVersions" - -// DescribeCacheEngineVersionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCacheEngineVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCacheEngineVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCacheEngineVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCacheEngineVersionsRequest method. -// req, resp := client.DescribeCacheEngineVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheEngineVersions -func (c *ElastiCache) DescribeCacheEngineVersionsRequest(input *DescribeCacheEngineVersionsInput) (req *request.Request, output *DescribeCacheEngineVersionsOutput) { - op := &request.Operation{ - Name: opDescribeCacheEngineVersions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeCacheEngineVersionsInput{} - } - - output = &DescribeCacheEngineVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCacheEngineVersions API operation for Amazon ElastiCache. -// -// Returns a list of the available cache engines and their versions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeCacheEngineVersions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheEngineVersions -func (c *ElastiCache) DescribeCacheEngineVersions(input *DescribeCacheEngineVersionsInput) (*DescribeCacheEngineVersionsOutput, error) { - req, out := c.DescribeCacheEngineVersionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeCacheEngineVersionsPages iterates over the pages of a DescribeCacheEngineVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheEngineVersions 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 DescribeCacheEngineVersions operation. -// pageNum := 0 -// err := client.DescribeCacheEngineVersionsPages(params, -// func(page *DescribeCacheEngineVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheEngineVersionsPages(input *DescribeCacheEngineVersionsInput, fn func(p *DescribeCacheEngineVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheEngineVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheEngineVersionsOutput), lastPage) - }) -} - -const opDescribeCacheParameterGroups = "DescribeCacheParameterGroups" - -// DescribeCacheParameterGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCacheParameterGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCacheParameterGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCacheParameterGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCacheParameterGroupsRequest method. -// req, resp := client.DescribeCacheParameterGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameterGroups -func (c *ElastiCache) DescribeCacheParameterGroupsRequest(input *DescribeCacheParameterGroupsInput) (req *request.Request, output *DescribeCacheParameterGroupsOutput) { - op := &request.Operation{ - Name: opDescribeCacheParameterGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeCacheParameterGroupsInput{} - } - - output = &DescribeCacheParameterGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCacheParameterGroups API operation for Amazon ElastiCache. -// -// Returns a list of cache parameter group descriptions. If a cache parameter -// group name is specified, the list contains only the descriptions for that -// group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeCacheParameterGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameterGroups -func (c *ElastiCache) DescribeCacheParameterGroups(input *DescribeCacheParameterGroupsInput) (*DescribeCacheParameterGroupsOutput, error) { - req, out := c.DescribeCacheParameterGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeCacheParameterGroupsPages iterates over the pages of a DescribeCacheParameterGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheParameterGroups 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 DescribeCacheParameterGroups operation. -// pageNum := 0 -// err := client.DescribeCacheParameterGroupsPages(params, -// func(page *DescribeCacheParameterGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheParameterGroupsPages(input *DescribeCacheParameterGroupsInput, fn func(p *DescribeCacheParameterGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheParameterGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheParameterGroupsOutput), lastPage) - }) -} - -const opDescribeCacheParameters = "DescribeCacheParameters" - -// DescribeCacheParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCacheParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCacheParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCacheParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCacheParametersRequest method. -// req, resp := client.DescribeCacheParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameters -func (c *ElastiCache) DescribeCacheParametersRequest(input *DescribeCacheParametersInput) (req *request.Request, output *DescribeCacheParametersOutput) { - op := &request.Operation{ - Name: opDescribeCacheParameters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeCacheParametersInput{} - } - - output = &DescribeCacheParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCacheParameters API operation for Amazon ElastiCache. -// -// Returns the detailed parameter list for a particular cache parameter group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeCacheParameters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameters -func (c *ElastiCache) DescribeCacheParameters(input *DescribeCacheParametersInput) (*DescribeCacheParametersOutput, error) { - req, out := c.DescribeCacheParametersRequest(input) - err := req.Send() - return out, err -} - -// DescribeCacheParametersPages iterates over the pages of a DescribeCacheParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheParameters 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 DescribeCacheParameters operation. -// pageNum := 0 -// err := client.DescribeCacheParametersPages(params, -// func(page *DescribeCacheParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheParametersPages(input *DescribeCacheParametersInput, fn func(p *DescribeCacheParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheParametersOutput), lastPage) - }) -} - -const opDescribeCacheSecurityGroups = "DescribeCacheSecurityGroups" - -// DescribeCacheSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCacheSecurityGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCacheSecurityGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCacheSecurityGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCacheSecurityGroupsRequest method. -// req, resp := client.DescribeCacheSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSecurityGroups -func (c *ElastiCache) DescribeCacheSecurityGroupsRequest(input *DescribeCacheSecurityGroupsInput) (req *request.Request, output *DescribeCacheSecurityGroupsOutput) { - op := &request.Operation{ - Name: opDescribeCacheSecurityGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeCacheSecurityGroupsInput{} - } - - output = &DescribeCacheSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCacheSecurityGroups API operation for Amazon ElastiCache. -// -// Returns a list of cache security group descriptions. If a cache security -// group name is specified, the list contains only the description of that group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeCacheSecurityGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" -// The requested cache security group name does not refer to an existing cache -// security group. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSecurityGroups -func (c *ElastiCache) DescribeCacheSecurityGroups(input *DescribeCacheSecurityGroupsInput) (*DescribeCacheSecurityGroupsOutput, error) { - req, out := c.DescribeCacheSecurityGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeCacheSecurityGroupsPages iterates over the pages of a DescribeCacheSecurityGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheSecurityGroups 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 DescribeCacheSecurityGroups operation. -// pageNum := 0 -// err := client.DescribeCacheSecurityGroupsPages(params, -// func(page *DescribeCacheSecurityGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheSecurityGroupsPages(input *DescribeCacheSecurityGroupsInput, fn func(p *DescribeCacheSecurityGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheSecurityGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheSecurityGroupsOutput), lastPage) - }) -} - -const opDescribeCacheSubnetGroups = "DescribeCacheSubnetGroups" - -// DescribeCacheSubnetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCacheSubnetGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCacheSubnetGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCacheSubnetGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCacheSubnetGroupsRequest method. -// req, resp := client.DescribeCacheSubnetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSubnetGroups -func (c *ElastiCache) DescribeCacheSubnetGroupsRequest(input *DescribeCacheSubnetGroupsInput) (req *request.Request, output *DescribeCacheSubnetGroupsOutput) { - op := &request.Operation{ - Name: opDescribeCacheSubnetGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeCacheSubnetGroupsInput{} - } - - output = &DescribeCacheSubnetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCacheSubnetGroups API operation for Amazon ElastiCache. -// -// Returns a list of cache subnet group descriptions. If a subnet group name -// is specified, the list contains only the description of that group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeCacheSubnetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" -// The requested cache subnet group name does not refer to an existing cache -// subnet group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSubnetGroups -func (c *ElastiCache) DescribeCacheSubnetGroups(input *DescribeCacheSubnetGroupsInput) (*DescribeCacheSubnetGroupsOutput, error) { - req, out := c.DescribeCacheSubnetGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeCacheSubnetGroupsPages iterates over the pages of a DescribeCacheSubnetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeCacheSubnetGroups 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 DescribeCacheSubnetGroups operation. -// pageNum := 0 -// err := client.DescribeCacheSubnetGroupsPages(params, -// func(page *DescribeCacheSubnetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeCacheSubnetGroupsPages(input *DescribeCacheSubnetGroupsInput, fn func(p *DescribeCacheSubnetGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeCacheSubnetGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeCacheSubnetGroupsOutput), lastPage) - }) -} - -const opDescribeEngineDefaultParameters = "DescribeEngineDefaultParameters" - -// DescribeEngineDefaultParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEngineDefaultParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEngineDefaultParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEngineDefaultParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEngineDefaultParametersRequest method. -// req, resp := client.DescribeEngineDefaultParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEngineDefaultParameters -func (c *ElastiCache) DescribeEngineDefaultParametersRequest(input *DescribeEngineDefaultParametersInput) (req *request.Request, output *DescribeEngineDefaultParametersOutput) { - op := &request.Operation{ - Name: opDescribeEngineDefaultParameters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"EngineDefaults.Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEngineDefaultParametersInput{} - } - - output = &DescribeEngineDefaultParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEngineDefaultParameters API operation for Amazon ElastiCache. -// -// Returns the default engine and system parameter information for the specified -// cache engine. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeEngineDefaultParameters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEngineDefaultParameters -func (c *ElastiCache) DescribeEngineDefaultParameters(input *DescribeEngineDefaultParametersInput) (*DescribeEngineDefaultParametersOutput, error) { - req, out := c.DescribeEngineDefaultParametersRequest(input) - err := req.Send() - return out, err -} - -// DescribeEngineDefaultParametersPages iterates over the pages of a DescribeEngineDefaultParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEngineDefaultParameters 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 DescribeEngineDefaultParameters operation. -// pageNum := 0 -// err := client.DescribeEngineDefaultParametersPages(params, -// func(page *DescribeEngineDefaultParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeEngineDefaultParametersPages(input *DescribeEngineDefaultParametersInput, fn func(p *DescribeEngineDefaultParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEngineDefaultParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEngineDefaultParametersOutput), lastPage) - }) -} - -const opDescribeEvents = "DescribeEvents" - -// DescribeEventsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventsRequest method. -// req, resp := client.DescribeEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEvents -func (c *ElastiCache) DescribeEventsRequest(input *DescribeEventsInput) (req *request.Request, output *DescribeEventsOutput) { - op := &request.Operation{ - Name: opDescribeEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEventsInput{} - } - - output = &DescribeEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEvents API operation for Amazon ElastiCache. -// -// Returns events related to cache clusters, cache security groups, and cache -// parameter groups. You can obtain events specific to a particular cache cluster, -// cache security group, or cache parameter group by providing the name as a -// parameter. -// -// By default, only the events occurring within the last hour are returned; -// however, you can retrieve up to 14 days' worth of events if necessary. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeEvents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEvents -func (c *ElastiCache) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error) { - req, out := c.DescribeEventsRequest(input) - err := req.Send() - return out, err -} - -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents 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 DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeEventsPages(input *DescribeEventsInput, fn func(p *DescribeEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventsOutput), lastPage) - }) -} - -const opDescribeReplicationGroups = "DescribeReplicationGroups" - -// DescribeReplicationGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReplicationGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReplicationGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReplicationGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReplicationGroupsRequest method. -// req, resp := client.DescribeReplicationGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReplicationGroups -func (c *ElastiCache) DescribeReplicationGroupsRequest(input *DescribeReplicationGroupsInput) (req *request.Request, output *DescribeReplicationGroupsOutput) { - op := &request.Operation{ - Name: opDescribeReplicationGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReplicationGroupsInput{} - } - - output = &DescribeReplicationGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReplicationGroups API operation for Amazon ElastiCache. -// -// Returns information about a particular replication group. If no identifier -// is specified, DescribeReplicationGroups returns information about all replication -// groups. -// -// This operation is valid for Redis only. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeReplicationGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" -// The specified replication group does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReplicationGroups -func (c *ElastiCache) DescribeReplicationGroups(input *DescribeReplicationGroupsInput) (*DescribeReplicationGroupsOutput, error) { - req, out := c.DescribeReplicationGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeReplicationGroupsPages iterates over the pages of a DescribeReplicationGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReplicationGroups 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 DescribeReplicationGroups operation. -// pageNum := 0 -// err := client.DescribeReplicationGroupsPages(params, -// func(page *DescribeReplicationGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeReplicationGroupsPages(input *DescribeReplicationGroupsInput, fn func(p *DescribeReplicationGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReplicationGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReplicationGroupsOutput), lastPage) - }) -} - -const opDescribeReservedCacheNodes = "DescribeReservedCacheNodes" - -// DescribeReservedCacheNodesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedCacheNodes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedCacheNodes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedCacheNodes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedCacheNodesRequest method. -// req, resp := client.DescribeReservedCacheNodesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodes -func (c *ElastiCache) DescribeReservedCacheNodesRequest(input *DescribeReservedCacheNodesInput) (req *request.Request, output *DescribeReservedCacheNodesOutput) { - op := &request.Operation{ - Name: opDescribeReservedCacheNodes, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedCacheNodesInput{} - } - - output = &DescribeReservedCacheNodesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedCacheNodes API operation for Amazon ElastiCache. -// -// Returns information about reserved cache nodes for this account, or about -// a specified reserved cache node. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeReservedCacheNodes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedCacheNodeNotFoundFault "ReservedCacheNodeNotFound" -// The requested reserved cache node was not found. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodes -func (c *ElastiCache) DescribeReservedCacheNodes(input *DescribeReservedCacheNodesInput) (*DescribeReservedCacheNodesOutput, error) { - req, out := c.DescribeReservedCacheNodesRequest(input) - err := req.Send() - return out, err -} - -// DescribeReservedCacheNodesPages iterates over the pages of a DescribeReservedCacheNodes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedCacheNodes 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 DescribeReservedCacheNodes operation. -// pageNum := 0 -// err := client.DescribeReservedCacheNodesPages(params, -// func(page *DescribeReservedCacheNodesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeReservedCacheNodesPages(input *DescribeReservedCacheNodesInput, fn func(p *DescribeReservedCacheNodesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedCacheNodesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedCacheNodesOutput), lastPage) - }) -} - -const opDescribeReservedCacheNodesOfferings = "DescribeReservedCacheNodesOfferings" - -// DescribeReservedCacheNodesOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedCacheNodesOfferings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedCacheNodesOfferings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedCacheNodesOfferings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedCacheNodesOfferingsRequest method. -// req, resp := client.DescribeReservedCacheNodesOfferingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodesOfferings -func (c *ElastiCache) DescribeReservedCacheNodesOfferingsRequest(input *DescribeReservedCacheNodesOfferingsInput) (req *request.Request, output *DescribeReservedCacheNodesOfferingsOutput) { - op := &request.Operation{ - Name: opDescribeReservedCacheNodesOfferings, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedCacheNodesOfferingsInput{} - } - - output = &DescribeReservedCacheNodesOfferingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedCacheNodesOfferings API operation for Amazon ElastiCache. -// -// Lists available reserved cache node offerings. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeReservedCacheNodesOfferings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedCacheNodesOfferingNotFoundFault "ReservedCacheNodesOfferingNotFound" -// The requested cache node offering does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodesOfferings -func (c *ElastiCache) DescribeReservedCacheNodesOfferings(input *DescribeReservedCacheNodesOfferingsInput) (*DescribeReservedCacheNodesOfferingsOutput, error) { - req, out := c.DescribeReservedCacheNodesOfferingsRequest(input) - err := req.Send() - return out, err -} - -// DescribeReservedCacheNodesOfferingsPages iterates over the pages of a DescribeReservedCacheNodesOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedCacheNodesOfferings 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 DescribeReservedCacheNodesOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedCacheNodesOfferingsPages(params, -// func(page *DescribeReservedCacheNodesOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElastiCache) DescribeReservedCacheNodesOfferingsPages(input *DescribeReservedCacheNodesOfferingsInput, fn func(p *DescribeReservedCacheNodesOfferingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedCacheNodesOfferingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedCacheNodesOfferingsOutput), lastPage) - }) -} - -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/elasticache-2015-02-02/DescribeSnapshots -func (c *ElastiCache) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *request.Request, output *DescribeSnapshotsOutput) { - op := &request.Operation{ - Name: opDescribeSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeSnapshotsInput{} - } - - output = &DescribeSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSnapshots API operation for Amazon ElastiCache. -// -// Returns information about cache cluster or replication group snapshots. By -// default, DescribeSnapshots lists all of your snapshots; it can optionally -// describe a single snapshot, or just the snapshots associated with a particular -// cache cluster. -// -// This operation is valid for Redis only. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation DescribeSnapshots for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" -// The requested snapshot name does not refer to an existing snapshot. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeSnapshots -func (c *ElastiCache) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { - req, out := c.DescribeSnapshotsRequest(input) - err := req.Send() - return out, err -} - -// 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 *ElastiCache) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(p *DescribeSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeSnapshotsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeSnapshotsOutput), lastPage) - }) -} - -const opListAllowedNodeTypeModifications = "ListAllowedNodeTypeModifications" - -// ListAllowedNodeTypeModificationsRequest generates a "aws/request.Request" representing the -// client's request for the ListAllowedNodeTypeModifications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAllowedNodeTypeModifications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAllowedNodeTypeModifications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAllowedNodeTypeModificationsRequest method. -// req, resp := client.ListAllowedNodeTypeModificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListAllowedNodeTypeModifications -func (c *ElastiCache) ListAllowedNodeTypeModificationsRequest(input *ListAllowedNodeTypeModificationsInput) (req *request.Request, output *ListAllowedNodeTypeModificationsOutput) { - op := &request.Operation{ - Name: opListAllowedNodeTypeModifications, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAllowedNodeTypeModificationsInput{} - } - - output = &ListAllowedNodeTypeModificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAllowedNodeTypeModifications API operation for Amazon ElastiCache. -// -// Lists all available node types that you can scale your Redis cluster's or -// replication group's current node type up to. -// -// When you use the ModifyCacheCluster or ModifyReplicationGroup operations -// to scale up your cluster or replication group, the value of the CacheNodeType -// parameter must be one of the node types returned by this 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 ElastiCache's -// API operation ListAllowedNodeTypeModifications for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" -// The specified replication group does not exist. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListAllowedNodeTypeModifications -func (c *ElastiCache) ListAllowedNodeTypeModifications(input *ListAllowedNodeTypeModificationsInput) (*ListAllowedNodeTypeModificationsOutput, error) { - req, out := c.ListAllowedNodeTypeModificationsRequest(input) - err := req.Send() - return out, err -} - -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/elasticache-2015-02-02/ListTagsForResource -func (c *ElastiCache) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *TagListMessage) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &TagListMessage{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon ElastiCache. -// -// Lists all cost allocation tags currently on the named resource. A cost allocation -// tag is a key-value pair where the key is case-sensitive and the value is -// optional. You can use cost allocation tags to categorize and track your AWS -// costs. -// -// You can have a maximum of 10 cost allocation tags on an ElastiCache resource. -// For more information, see Using Cost Allocation Tags in Amazon ElastiCache -// (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/BestPractices.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 ElastiCache's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" -// The requested snapshot name does not refer to an existing snapshot. -// -// * ErrCodeInvalidARNFault "InvalidARN" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListTagsForResource -func (c *ElastiCache) ListTagsForResource(input *ListTagsForResourceInput) (*TagListMessage, error) { - req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opModifyCacheCluster = "ModifyCacheCluster" - -// ModifyCacheClusterRequest generates a "aws/request.Request" representing the -// client's request for the ModifyCacheCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyCacheCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyCacheCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyCacheClusterRequest method. -// req, resp := client.ModifyCacheClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheCluster -func (c *ElastiCache) ModifyCacheClusterRequest(input *ModifyCacheClusterInput) (req *request.Request, output *ModifyCacheClusterOutput) { - op := &request.Operation{ - Name: opModifyCacheCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyCacheClusterInput{} - } - - output = &ModifyCacheClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyCacheCluster API operation for Amazon ElastiCache. -// -// Modifies the settings for a cache cluster. You can use this operation to -// change one or more cluster configuration parameters by specifying the parameters -// and the new values. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation ModifyCacheCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" -// The requested cache cluster is not in the available state. -// -// * ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" -// The current state of the cache security group does not allow deletion. -// -// * ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" -// The requested cache node type is not available in the specified Availability -// Zone. -// -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache nodes in a single cache cluster. -// -// * ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache nodes per customer. -// -// * ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" -// The requested cache security group name does not refer to an existing cache -// security group. -// -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The VPC network is in an invalid state. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheCluster -func (c *ElastiCache) ModifyCacheCluster(input *ModifyCacheClusterInput) (*ModifyCacheClusterOutput, error) { - req, out := c.ModifyCacheClusterRequest(input) - err := req.Send() - return out, err -} - -const opModifyCacheParameterGroup = "ModifyCacheParameterGroup" - -// ModifyCacheParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyCacheParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyCacheParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyCacheParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyCacheParameterGroupRequest method. -// req, resp := client.ModifyCacheParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheParameterGroup -func (c *ElastiCache) ModifyCacheParameterGroupRequest(input *ModifyCacheParameterGroupInput) (req *request.Request, output *CacheParameterGroupNameMessage) { - op := &request.Operation{ - Name: opModifyCacheParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyCacheParameterGroupInput{} - } - - output = &CacheParameterGroupNameMessage{} - req = c.newRequest(op, input, output) - return -} - -// ModifyCacheParameterGroup API operation for Amazon ElastiCache. -// -// Modifies the parameters of a cache parameter group. You can modify up to -// 20 parameters in a single request by submitting a list parameter name and -// value pairs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation ModifyCacheParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidCacheParameterGroupStateFault "InvalidCacheParameterGroupState" -// The current state of the cache parameter group does not allow the requested -// operation to occur. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheParameterGroup -func (c *ElastiCache) ModifyCacheParameterGroup(input *ModifyCacheParameterGroupInput) (*CacheParameterGroupNameMessage, error) { - req, out := c.ModifyCacheParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyCacheSubnetGroup = "ModifyCacheSubnetGroup" - -// ModifyCacheSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyCacheSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyCacheSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyCacheSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyCacheSubnetGroupRequest method. -// req, resp := client.ModifyCacheSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheSubnetGroup -func (c *ElastiCache) ModifyCacheSubnetGroupRequest(input *ModifyCacheSubnetGroupInput) (req *request.Request, output *ModifyCacheSubnetGroupOutput) { - op := &request.Operation{ - Name: opModifyCacheSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyCacheSubnetGroupInput{} - } - - output = &ModifyCacheSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyCacheSubnetGroup API operation for Amazon ElastiCache. -// -// Modifies an existing cache subnet group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation ModifyCacheSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" -// The requested cache subnet group name does not refer to an existing cache -// subnet group. -// -// * ErrCodeCacheSubnetQuotaExceededFault "CacheSubnetQuotaExceededFault" -// The request cannot be processed because it would exceed the allowed number -// of subnets in a cache subnet group. -// -// * ErrCodeSubnetInUse "SubnetInUse" -// The requested subnet is being used by another cache subnet group. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// An invalid subnet identifier was specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheSubnetGroup -func (c *ElastiCache) ModifyCacheSubnetGroup(input *ModifyCacheSubnetGroupInput) (*ModifyCacheSubnetGroupOutput, error) { - req, out := c.ModifyCacheSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyReplicationGroup = "ModifyReplicationGroup" - -// ModifyReplicationGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyReplicationGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyReplicationGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyReplicationGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyReplicationGroupRequest method. -// req, resp := client.ModifyReplicationGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroup -func (c *ElastiCache) ModifyReplicationGroupRequest(input *ModifyReplicationGroupInput) (req *request.Request, output *ModifyReplicationGroupOutput) { - op := &request.Operation{ - Name: opModifyReplicationGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyReplicationGroupInput{} - } - - output = &ModifyReplicationGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyReplicationGroup API operation for Amazon ElastiCache. -// -// Modifies the settings for a replication group. -// -// Due to current limitations on Redis (cluster mode disabled), this operation -// or parameter is not supported on Redis (cluster mode enabled) replication -// groups. -// -// This operation is valid for Redis only. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation ModifyReplicationGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" -// The specified replication group does not exist. -// -// * ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" -// The requested replication group is not in the available state. -// -// * ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" -// The requested cache cluster is not in the available state. -// -// * ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" -// The current state of the cache security group does not allow deletion. -// -// * ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" -// The requested cache node type is not available in the specified Availability -// Zone. -// -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache nodes in a single cache cluster. -// -// * ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" -// The request cannot be processed because it would exceed the allowed number -// of cache nodes per customer. -// -// * ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" -// The requested cache security group name does not refer to an existing cache -// security group. -// -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The VPC network is in an invalid state. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroup -func (c *ElastiCache) ModifyReplicationGroup(input *ModifyReplicationGroupInput) (*ModifyReplicationGroupOutput, error) { - req, out := c.ModifyReplicationGroupRequest(input) - err := req.Send() - return out, err -} - -const opPurchaseReservedCacheNodesOffering = "PurchaseReservedCacheNodesOffering" - -// PurchaseReservedCacheNodesOfferingRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseReservedCacheNodesOffering operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PurchaseReservedCacheNodesOffering for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PurchaseReservedCacheNodesOffering method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PurchaseReservedCacheNodesOfferingRequest method. -// req, resp := client.PurchaseReservedCacheNodesOfferingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/PurchaseReservedCacheNodesOffering -func (c *ElastiCache) PurchaseReservedCacheNodesOfferingRequest(input *PurchaseReservedCacheNodesOfferingInput) (req *request.Request, output *PurchaseReservedCacheNodesOfferingOutput) { - op := &request.Operation{ - Name: opPurchaseReservedCacheNodesOffering, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseReservedCacheNodesOfferingInput{} - } - - output = &PurchaseReservedCacheNodesOfferingOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseReservedCacheNodesOffering API operation for Amazon ElastiCache. -// -// Allows you to purchase a reserved cache node offering. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation PurchaseReservedCacheNodesOffering for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedCacheNodesOfferingNotFoundFault "ReservedCacheNodesOfferingNotFound" -// The requested cache node offering does not exist. -// -// * ErrCodeReservedCacheNodeAlreadyExistsFault "ReservedCacheNodeAlreadyExists" -// You already have a reservation with the given identifier. -// -// * ErrCodeReservedCacheNodeQuotaExceededFault "ReservedCacheNodeQuotaExceeded" -// The request cannot be processed because it would exceed the user's cache -// node quota. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/PurchaseReservedCacheNodesOffering -func (c *ElastiCache) PurchaseReservedCacheNodesOffering(input *PurchaseReservedCacheNodesOfferingInput) (*PurchaseReservedCacheNodesOfferingOutput, error) { - req, out := c.PurchaseReservedCacheNodesOfferingRequest(input) - err := req.Send() - return out, err -} - -const opRebootCacheCluster = "RebootCacheCluster" - -// RebootCacheClusterRequest generates a "aws/request.Request" representing the -// client's request for the RebootCacheCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RebootCacheCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RebootCacheCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RebootCacheClusterRequest method. -// req, resp := client.RebootCacheClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RebootCacheCluster -func (c *ElastiCache) RebootCacheClusterRequest(input *RebootCacheClusterInput) (req *request.Request, output *RebootCacheClusterOutput) { - op := &request.Operation{ - Name: opRebootCacheCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RebootCacheClusterInput{} - } - - output = &RebootCacheClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// RebootCacheCluster API operation for Amazon ElastiCache. -// -// Reboots some, or all, of the cache nodes within a provisioned cache cluster. -// This operation applies any modified cache parameter groups to the cache cluster. -// The reboot operation takes place as soon as possible, and results in a momentary -// outage to the cache cluster. During the reboot, the cache cluster status -// is set to REBOOTING. -// -// The reboot causes the contents of the cache (for each cache node being rebooted) -// to be lost. -// -// When the reboot is complete, a cache cluster event is 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 ElastiCache's -// API operation RebootCacheCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" -// The requested cache cluster is not in the available state. -// -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RebootCacheCluster -func (c *ElastiCache) RebootCacheCluster(input *RebootCacheClusterInput) (*RebootCacheClusterOutput, error) { - req, out := c.RebootCacheClusterRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTagsFromResource = "RemoveTagsFromResource" - -// RemoveTagsFromResourceRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromResourceRequest method. -// req, resp := client.RemoveTagsFromResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RemoveTagsFromResource -func (c *ElastiCache) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) (req *request.Request, output *TagListMessage) { - op := &request.Operation{ - Name: opRemoveTagsFromResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsFromResourceInput{} - } - - output = &TagListMessage{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTagsFromResource API operation for Amazon ElastiCache. -// -// Removes the tags identified by the TagKeys list from the named 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 ElastiCache's -// API operation RemoveTagsFromResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" -// The requested cache cluster ID does not refer to an existing cache cluster. -// -// * ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" -// The requested snapshot name does not refer to an existing snapshot. -// -// * ErrCodeInvalidARNFault "InvalidARN" -// The requested Amazon Resource Name (ARN) does not refer to an existing resource. -// -// * ErrCodeTagNotFoundFault "TagNotFound" -// The requested tag was not found on this resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RemoveTagsFromResource -func (c *ElastiCache) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*TagListMessage, error) { - req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err -} - -const opResetCacheParameterGroup = "ResetCacheParameterGroup" - -// ResetCacheParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the ResetCacheParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetCacheParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetCacheParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetCacheParameterGroupRequest method. -// req, resp := client.ResetCacheParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ResetCacheParameterGroup -func (c *ElastiCache) ResetCacheParameterGroupRequest(input *ResetCacheParameterGroupInput) (req *request.Request, output *CacheParameterGroupNameMessage) { - op := &request.Operation{ - Name: opResetCacheParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetCacheParameterGroupInput{} - } - - output = &CacheParameterGroupNameMessage{} - req = c.newRequest(op, input, output) - return -} - -// ResetCacheParameterGroup API operation for Amazon ElastiCache. -// -// Modifies the parameters of a cache parameter group to the engine or system -// default value. You can reset specific parameters by submitting a list of -// parameter names. To reset the entire cache parameter group, specify the ResetAllParameters -// and CacheParameterGroupName parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation ResetCacheParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidCacheParameterGroupStateFault "InvalidCacheParameterGroupState" -// The current state of the cache parameter group does not allow the requested -// operation to occur. -// -// * ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" -// The requested cache parameter group name does not refer to an existing cache -// parameter group. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ResetCacheParameterGroup -func (c *ElastiCache) ResetCacheParameterGroup(input *ResetCacheParameterGroupInput) (*CacheParameterGroupNameMessage, error) { - req, out := c.ResetCacheParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opRevokeCacheSecurityGroupIngress = "RevokeCacheSecurityGroupIngress" - -// RevokeCacheSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeCacheSecurityGroupIngress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RevokeCacheSecurityGroupIngress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RevokeCacheSecurityGroupIngress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RevokeCacheSecurityGroupIngressRequest method. -// req, resp := client.RevokeCacheSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RevokeCacheSecurityGroupIngress -func (c *ElastiCache) RevokeCacheSecurityGroupIngressRequest(input *RevokeCacheSecurityGroupIngressInput) (req *request.Request, output *RevokeCacheSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opRevokeCacheSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeCacheSecurityGroupIngressInput{} - } - - output = &RevokeCacheSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - return -} - -// RevokeCacheSecurityGroupIngress API operation for Amazon ElastiCache. -// -// Revokes ingress from a cache security group. Use this operation to disallow -// access from an Amazon EC2 security group that had been previously authorized. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon ElastiCache's -// API operation RevokeCacheSecurityGroupIngress for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" -// The requested cache security group name does not refer to an existing cache -// security group. -// -// * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified Amazon EC2 security group is not authorized for the specified -// cache security group. -// -// * ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" -// The current state of the cache security group does not allow deletion. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" -// Two or more incompatible parameters were specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RevokeCacheSecurityGroupIngress -func (c *ElastiCache) RevokeCacheSecurityGroupIngress(input *RevokeCacheSecurityGroupIngressInput) (*RevokeCacheSecurityGroupIngressOutput, error) { - req, out := c.RevokeCacheSecurityGroupIngressRequest(input) - err := req.Send() - return out, err -} - -// Represents the input of an AddTagsToResource operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AddTagsToResourceMessage -type AddTagsToResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource to which the tags are to be - // added, for example arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster - // or arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // ResourceName is a required field - ResourceName *string `type:"string" required:"true"` - - // A list of cost allocation tags to be added to this resource. A tag is a key-value - // pair. A tag key must be accompanied by a tag value. - // - // Tags is a required field - Tags []*Tag `locationNameList:"Tag" type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsToResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToResourceInput"} - if s.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceName sets the ResourceName field's value. -func (s *AddTagsToResourceInput) SetResourceName(v string) *AddTagsToResourceInput { - s.ResourceName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToResourceInput) SetTags(v []*Tag) *AddTagsToResourceInput { - s.Tags = v - return s -} - -// Represents the input of an AuthorizeCacheSecurityGroupIngress operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AuthorizeCacheSecurityGroupIngressMessage -type AuthorizeCacheSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The cache security group that allows network ingress. - // - // CacheSecurityGroupName is a required field - CacheSecurityGroupName *string `type:"string" required:"true"` - - // The Amazon EC2 security group to be authorized for ingress to the cache security - // group. - // - // EC2SecurityGroupName is a required field - EC2SecurityGroupName *string `type:"string" required:"true"` - - // The AWS account number of the Amazon EC2 security group owner. Note that - // this is not the same thing as an AWS access key ID - you must provide a valid - // AWS account number for this parameter. - // - // EC2SecurityGroupOwnerId is a required field - EC2SecurityGroupOwnerId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AuthorizeCacheSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeCacheSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuthorizeCacheSecurityGroupIngressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthorizeCacheSecurityGroupIngressInput"} - if s.CacheSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheSecurityGroupName")) - } - if s.EC2SecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("EC2SecurityGroupName")) - } - if s.EC2SecurityGroupOwnerId == nil { - invalidParams.Add(request.NewErrParamRequired("EC2SecurityGroupOwnerId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheSecurityGroupName sets the CacheSecurityGroupName field's value. -func (s *AuthorizeCacheSecurityGroupIngressInput) SetCacheSecurityGroupName(v string) *AuthorizeCacheSecurityGroupIngressInput { - s.CacheSecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *AuthorizeCacheSecurityGroupIngressInput) SetEC2SecurityGroupName(v string) *AuthorizeCacheSecurityGroupIngressInput { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *AuthorizeCacheSecurityGroupIngressInput) SetEC2SecurityGroupOwnerId(v string) *AuthorizeCacheSecurityGroupIngressInput { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AuthorizeCacheSecurityGroupIngressResult -type AuthorizeCacheSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of one of the following operations: - // - // * AuthorizeCacheSecurityGroupIngress - // - // * CreateCacheSecurityGroup - // - // * RevokeCacheSecurityGroupIngress - CacheSecurityGroup *CacheSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s AuthorizeCacheSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeCacheSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// SetCacheSecurityGroup sets the CacheSecurityGroup field's value. -func (s *AuthorizeCacheSecurityGroupIngressOutput) SetCacheSecurityGroup(v *CacheSecurityGroup) *AuthorizeCacheSecurityGroupIngressOutput { - s.CacheSecurityGroup = v - return s -} - -// Describes an Availability Zone in which the cache cluster is launched. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AvailabilityZone -type AvailabilityZone struct { - _ struct{} `type:"structure"` - - // The name of the Availability Zone. - Name *string `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() -} - -// SetName sets the Name field's value. -func (s *AvailabilityZone) SetName(v string) *AvailabilityZone { - s.Name = &v - return s -} - -// Contains all of the attributes of a specific cache cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheCluster -type CacheCluster struct { - _ struct{} `type:"structure"` - - // This parameter is currently disabled. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The date and time when the cache cluster was created. - CacheClusterCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The user-supplied identifier of the cache cluster. This identifier is a unique - // key that identifies a cache cluster. - CacheClusterId *string `type:"string"` - - // The current state of this cache cluster, one of the following values: available, - // creating, deleted, deleting, incompatible-network, modifying, rebooting cache - // cluster nodes, restore-failed, or snapshotting. - CacheClusterStatus *string `type:"string"` - - // The name of the compute and memory capacity node type for the cache cluster. - // - // Valid node types are as follows: - // - // * General purpose: - // - // Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, - // cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge - // - // Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, - // cache.m1.xlarge - // - // * Compute optimized: cache.c1.xlarge - // - // * Memory optimized: - // - // Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, - // cache.r3.8xlarge - // - // Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge - // - // Notes: - // - // * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon - // VPC). - // - // * Redis backup/restore is not supported for Redis (cluster mode disabled) - // T1 and T2 instances. Backup/restore is supported on Redis (cluster mode - // enabled) T2 instances. - // - // * Redis Append-only files (AOF) functionality is not supported for T1 - // or T2 instances. - // - // For a complete listing of node types and specifications, see Amazon ElastiCache - // Product Features and Details (http://aws.amazon.com/elasticache/details) - // and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) - // or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). - CacheNodeType *string `type:"string"` - - // A list of cache nodes that are members of the cache cluster. - CacheNodes []*CacheNode `locationNameList:"CacheNode" type:"list"` - - // Status of the cache parameter group. - CacheParameterGroup *CacheParameterGroupStatus `type:"structure"` - - // A list of cache security group elements, composed of name and status sub-elements. - CacheSecurityGroups []*CacheSecurityGroupMembership `locationNameList:"CacheSecurityGroup" type:"list"` - - // The name of the cache subnet group associated with the cache cluster. - CacheSubnetGroupName *string `type:"string"` - - // The URL of the web page where you can download the latest ElastiCache client - // library. - ClientDownloadLandingPage *string `type:"string"` - - // Represents the information required for client programs to connect to a cache - // node. - ConfigurationEndpoint *Endpoint `type:"structure"` - - // The name of the cache engine (memcached or redis) to be used for this cache - // cluster. - Engine *string `type:"string"` - - // The version of the cache engine that is used in this cache cluster. - EngineVersion *string `type:"string"` - - // Describes a notification topic and its status. Notification topics are used - // for publishing ElastiCache events to subscribers using Amazon Simple Notification - // Service (SNS). - NotificationConfiguration *NotificationConfiguration `type:"structure"` - - // The number of cache nodes in the cache cluster. - // - // For clusters running Redis, this value must be 1. For clusters running Memcached, - // this value must be between 1 and 20. - NumCacheNodes *int64 `type:"integer"` - - // A group of settings that are applied to the cache cluster in the future, - // or that are currently being applied. - PendingModifiedValues *PendingModifiedValues `type:"structure"` - - // The name of the Availability Zone in which the cache cluster is located or - // "Multiple" if the cache nodes are located in different Availability Zones. - PreferredAvailabilityZone *string `type:"string"` - - // Specifies the weekly time range during which maintenance on the cluster is - // performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi - // (24H Clock UTC). The minimum maintenance window is a 60 minute period. - // - // Valid values for ddd are: - // - // * sun - // - // * mon - // - // * tue - // - // * wed - // - // * thu - // - // * fri - // - // * sat - // - // Example: sun:23:00-mon:01:30 - PreferredMaintenanceWindow *string `type:"string"` - - // The replication group to which this cache cluster belongs. If this field - // is empty, the cache cluster is not associated with any replication group. - ReplicationGroupId *string `type:"string"` - - // A list of VPC Security Groups associated with the cache cluster. - SecurityGroups []*SecurityGroupMembership `type:"list"` - - // The number of days for which ElastiCache retains automatic cache cluster - // snapshots before deleting them. For example, if you set SnapshotRetentionLimit - // to 5, a snapshot that was taken today is retained for 5 days before being - // deleted. - // - // If the value of SnapshotRetentionLimit is set to zero (0), backups are turned - // off. - SnapshotRetentionLimit *int64 `type:"integer"` - - // The daily time range (in UTC) during which ElastiCache begins taking a daily - // snapshot of your cache cluster. - // - // Example: 05:00-09:00 - SnapshotWindow *string `type:"string"` -} - -// String returns the string representation -func (s CacheCluster) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheCluster) GoString() string { - return s.String() -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *CacheCluster) SetAutoMinorVersionUpgrade(v bool) *CacheCluster { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetCacheClusterCreateTime sets the CacheClusterCreateTime field's value. -func (s *CacheCluster) SetCacheClusterCreateTime(v time.Time) *CacheCluster { - s.CacheClusterCreateTime = &v - return s -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *CacheCluster) SetCacheClusterId(v string) *CacheCluster { - s.CacheClusterId = &v - return s -} - -// SetCacheClusterStatus sets the CacheClusterStatus field's value. -func (s *CacheCluster) SetCacheClusterStatus(v string) *CacheCluster { - s.CacheClusterStatus = &v - return s -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *CacheCluster) SetCacheNodeType(v string) *CacheCluster { - s.CacheNodeType = &v - return s -} - -// SetCacheNodes sets the CacheNodes field's value. -func (s *CacheCluster) SetCacheNodes(v []*CacheNode) *CacheCluster { - s.CacheNodes = v - return s -} - -// SetCacheParameterGroup sets the CacheParameterGroup field's value. -func (s *CacheCluster) SetCacheParameterGroup(v *CacheParameterGroupStatus) *CacheCluster { - s.CacheParameterGroup = v - return s -} - -// SetCacheSecurityGroups sets the CacheSecurityGroups field's value. -func (s *CacheCluster) SetCacheSecurityGroups(v []*CacheSecurityGroupMembership) *CacheCluster { - s.CacheSecurityGroups = v - return s -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *CacheCluster) SetCacheSubnetGroupName(v string) *CacheCluster { - s.CacheSubnetGroupName = &v - return s -} - -// SetClientDownloadLandingPage sets the ClientDownloadLandingPage field's value. -func (s *CacheCluster) SetClientDownloadLandingPage(v string) *CacheCluster { - s.ClientDownloadLandingPage = &v - return s -} - -// SetConfigurationEndpoint sets the ConfigurationEndpoint field's value. -func (s *CacheCluster) SetConfigurationEndpoint(v *Endpoint) *CacheCluster { - s.ConfigurationEndpoint = v - return s -} - -// SetEngine sets the Engine field's value. -func (s *CacheCluster) SetEngine(v string) *CacheCluster { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *CacheCluster) SetEngineVersion(v string) *CacheCluster { - s.EngineVersion = &v - return s -} - -// SetNotificationConfiguration sets the NotificationConfiguration field's value. -func (s *CacheCluster) SetNotificationConfiguration(v *NotificationConfiguration) *CacheCluster { - s.NotificationConfiguration = v - return s -} - -// SetNumCacheNodes sets the NumCacheNodes field's value. -func (s *CacheCluster) SetNumCacheNodes(v int64) *CacheCluster { - s.NumCacheNodes = &v - return s -} - -// SetPendingModifiedValues sets the PendingModifiedValues field's value. -func (s *CacheCluster) SetPendingModifiedValues(v *PendingModifiedValues) *CacheCluster { - s.PendingModifiedValues = v - return s -} - -// SetPreferredAvailabilityZone sets the PreferredAvailabilityZone field's value. -func (s *CacheCluster) SetPreferredAvailabilityZone(v string) *CacheCluster { - s.PreferredAvailabilityZone = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CacheCluster) SetPreferredMaintenanceWindow(v string) *CacheCluster { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *CacheCluster) SetReplicationGroupId(v string) *CacheCluster { - s.ReplicationGroupId = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *CacheCluster) SetSecurityGroups(v []*SecurityGroupMembership) *CacheCluster { - s.SecurityGroups = v - return s -} - -// SetSnapshotRetentionLimit sets the SnapshotRetentionLimit field's value. -func (s *CacheCluster) SetSnapshotRetentionLimit(v int64) *CacheCluster { - s.SnapshotRetentionLimit = &v - return s -} - -// SetSnapshotWindow sets the SnapshotWindow field's value. -func (s *CacheCluster) SetSnapshotWindow(v string) *CacheCluster { - s.SnapshotWindow = &v - return s -} - -// Provides all of the details about a particular cache engine version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheEngineVersion -type CacheEngineVersion struct { - _ struct{} `type:"structure"` - - // The description of the cache engine. - CacheEngineDescription *string `type:"string"` - - // The description of the cache engine version. - CacheEngineVersionDescription *string `type:"string"` - - // The name of the cache parameter group family associated with this cache engine. - // - // Valid values are: memcached1.4 | redis2.6 | redis2.8 | redis3.2 - CacheParameterGroupFamily *string `type:"string"` - - // The name of the cache engine. - Engine *string `type:"string"` - - // The version number of the cache engine. - EngineVersion *string `type:"string"` -} - -// String returns the string representation -func (s CacheEngineVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheEngineVersion) GoString() string { - return s.String() -} - -// SetCacheEngineDescription sets the CacheEngineDescription field's value. -func (s *CacheEngineVersion) SetCacheEngineDescription(v string) *CacheEngineVersion { - s.CacheEngineDescription = &v - return s -} - -// SetCacheEngineVersionDescription sets the CacheEngineVersionDescription field's value. -func (s *CacheEngineVersion) SetCacheEngineVersionDescription(v string) *CacheEngineVersion { - s.CacheEngineVersionDescription = &v - return s -} - -// SetCacheParameterGroupFamily sets the CacheParameterGroupFamily field's value. -func (s *CacheEngineVersion) SetCacheParameterGroupFamily(v string) *CacheEngineVersion { - s.CacheParameterGroupFamily = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *CacheEngineVersion) SetEngine(v string) *CacheEngineVersion { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *CacheEngineVersion) SetEngineVersion(v string) *CacheEngineVersion { - s.EngineVersion = &v - return s -} - -// Represents an individual cache node within a cache cluster. Each cache node -// runs its own instance of the cluster's protocol-compliant caching software -// - either Memcached or Redis. -// -// Valid node types are as follows: -// -// * General purpose: -// -// Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, -// cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, -// cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge -// -// Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, -// cache.m1.xlarge -// -// * Compute optimized: cache.c1.xlarge -// -// * Memory optimized: -// -// Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, -// cache.r3.8xlarge -// -// Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge -// -// Notes: -// -// * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon -// VPC). -// -// * Redis backup/restore is not supported for Redis (cluster mode disabled) -// T1 and T2 instances. Backup/restore is supported on Redis (cluster mode -// enabled) T2 instances. -// -// * Redis Append-only files (AOF) functionality is not supported for T1 -// or T2 instances. -// -// For a complete listing of node types and specifications, see Amazon ElastiCache -// Product Features and Details (http://aws.amazon.com/elasticache/details) -// and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) -// or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheNode -type CacheNode struct { - _ struct{} `type:"structure"` - - // The date and time when the cache node was created. - CacheNodeCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The cache node identifier. A node ID is a numeric identifier (0001, 0002, - // etc.). The combination of cluster ID and node ID uniquely identifies every - // cache node used in a customer's AWS account. - CacheNodeId *string `type:"string"` - - // The current state of this cache node. - CacheNodeStatus *string `type:"string"` - - // The Availability Zone where this node was created and now resides. - CustomerAvailabilityZone *string `type:"string"` - - // The hostname for connecting to this cache node. - Endpoint *Endpoint `type:"structure"` - - // The status of the parameter group applied to this cache node. - ParameterGroupStatus *string `type:"string"` - - // The ID of the primary node to which this read replica node is synchronized. - // If this field is empty, this node is not associated with a primary cache - // cluster. - SourceCacheNodeId *string `type:"string"` -} - -// String returns the string representation -func (s CacheNode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheNode) GoString() string { - return s.String() -} - -// SetCacheNodeCreateTime sets the CacheNodeCreateTime field's value. -func (s *CacheNode) SetCacheNodeCreateTime(v time.Time) *CacheNode { - s.CacheNodeCreateTime = &v - return s -} - -// SetCacheNodeId sets the CacheNodeId field's value. -func (s *CacheNode) SetCacheNodeId(v string) *CacheNode { - s.CacheNodeId = &v - return s -} - -// SetCacheNodeStatus sets the CacheNodeStatus field's value. -func (s *CacheNode) SetCacheNodeStatus(v string) *CacheNode { - s.CacheNodeStatus = &v - return s -} - -// SetCustomerAvailabilityZone sets the CustomerAvailabilityZone field's value. -func (s *CacheNode) SetCustomerAvailabilityZone(v string) *CacheNode { - s.CustomerAvailabilityZone = &v - return s -} - -// SetEndpoint sets the Endpoint field's value. -func (s *CacheNode) SetEndpoint(v *Endpoint) *CacheNode { - s.Endpoint = v - return s -} - -// SetParameterGroupStatus sets the ParameterGroupStatus field's value. -func (s *CacheNode) SetParameterGroupStatus(v string) *CacheNode { - s.ParameterGroupStatus = &v - return s -} - -// SetSourceCacheNodeId sets the SourceCacheNodeId field's value. -func (s *CacheNode) SetSourceCacheNodeId(v string) *CacheNode { - s.SourceCacheNodeId = &v - return s -} - -// A parameter that has a different value for each cache node type it is applied -// to. For example, in a Redis cache cluster, a cache.m1.large cache node type -// would have a larger maxmemory value than a cache.m1.small type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheNodeTypeSpecificParameter -type CacheNodeTypeSpecificParameter struct { - _ struct{} `type:"structure"` - - // The valid range of values for the parameter. - AllowedValues *string `type:"string"` - - // A list of cache node types and their corresponding values for this parameter. - CacheNodeTypeSpecificValues []*CacheNodeTypeSpecificValue `locationNameList:"CacheNodeTypeSpecificValue" type:"list"` - - // Indicates whether a change to the parameter is applied immediately or requires - // a reboot for the change to be applied. You can force a reboot or wait until - // the next maintenance window's reboot. For more information, see Rebooting - // a Cluster (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Clusters.Rebooting.html). - ChangeType *string `type:"string" enum:"ChangeType"` - - // The valid data type for the parameter. - DataType *string `type:"string"` - - // A description of the parameter. - Description *string `type:"string"` - - // Indicates whether (true) or not (false) the parameter can be modified. Some - // parameters have security or operational implications that prevent them from - // being changed. - IsModifiable *bool `type:"boolean"` - - // The earliest cache engine version to which the parameter can apply. - MinimumEngineVersion *string `type:"string"` - - // The name of the parameter. - ParameterName *string `type:"string"` - - // The source of the parameter value. - Source *string `type:"string"` -} - -// String returns the string representation -func (s CacheNodeTypeSpecificParameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheNodeTypeSpecificParameter) GoString() string { - return s.String() -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *CacheNodeTypeSpecificParameter) SetAllowedValues(v string) *CacheNodeTypeSpecificParameter { - s.AllowedValues = &v - return s -} - -// SetCacheNodeTypeSpecificValues sets the CacheNodeTypeSpecificValues field's value. -func (s *CacheNodeTypeSpecificParameter) SetCacheNodeTypeSpecificValues(v []*CacheNodeTypeSpecificValue) *CacheNodeTypeSpecificParameter { - s.CacheNodeTypeSpecificValues = v - return s -} - -// SetChangeType sets the ChangeType field's value. -func (s *CacheNodeTypeSpecificParameter) SetChangeType(v string) *CacheNodeTypeSpecificParameter { - s.ChangeType = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *CacheNodeTypeSpecificParameter) SetDataType(v string) *CacheNodeTypeSpecificParameter { - s.DataType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CacheNodeTypeSpecificParameter) SetDescription(v string) *CacheNodeTypeSpecificParameter { - s.Description = &v - return s -} - -// SetIsModifiable sets the IsModifiable field's value. -func (s *CacheNodeTypeSpecificParameter) SetIsModifiable(v bool) *CacheNodeTypeSpecificParameter { - s.IsModifiable = &v - return s -} - -// SetMinimumEngineVersion sets the MinimumEngineVersion field's value. -func (s *CacheNodeTypeSpecificParameter) SetMinimumEngineVersion(v string) *CacheNodeTypeSpecificParameter { - s.MinimumEngineVersion = &v - return s -} - -// SetParameterName sets the ParameterName field's value. -func (s *CacheNodeTypeSpecificParameter) SetParameterName(v string) *CacheNodeTypeSpecificParameter { - s.ParameterName = &v - return s -} - -// SetSource sets the Source field's value. -func (s *CacheNodeTypeSpecificParameter) SetSource(v string) *CacheNodeTypeSpecificParameter { - s.Source = &v - return s -} - -// A value that applies only to a certain cache node type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheNodeTypeSpecificValue -type CacheNodeTypeSpecificValue struct { - _ struct{} `type:"structure"` - - // The cache node type for which this value applies. - CacheNodeType *string `type:"string"` - - // The value for the cache node type. - Value *string `type:"string"` -} - -// String returns the string representation -func (s CacheNodeTypeSpecificValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheNodeTypeSpecificValue) GoString() string { - return s.String() -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *CacheNodeTypeSpecificValue) SetCacheNodeType(v string) *CacheNodeTypeSpecificValue { - s.CacheNodeType = &v - return s -} - -// SetValue sets the Value field's value. -func (s *CacheNodeTypeSpecificValue) SetValue(v string) *CacheNodeTypeSpecificValue { - s.Value = &v - return s -} - -// Represents the output of a CreateCacheParameterGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheParameterGroup -type CacheParameterGroup struct { - _ struct{} `type:"structure"` - - // The name of the cache parameter group family that this cache parameter group - // is compatible with. - // - // Valid values are: memcached1.4 | redis2.6 | redis2.8 | redis3.2 - CacheParameterGroupFamily *string `type:"string"` - - // The name of the cache parameter group. - CacheParameterGroupName *string `type:"string"` - - // The description for this cache parameter group. - Description *string `type:"string"` -} - -// String returns the string representation -func (s CacheParameterGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheParameterGroup) GoString() string { - return s.String() -} - -// SetCacheParameterGroupFamily sets the CacheParameterGroupFamily field's value. -func (s *CacheParameterGroup) SetCacheParameterGroupFamily(v string) *CacheParameterGroup { - s.CacheParameterGroupFamily = &v - return s -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *CacheParameterGroup) SetCacheParameterGroupName(v string) *CacheParameterGroup { - s.CacheParameterGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CacheParameterGroup) SetDescription(v string) *CacheParameterGroup { - s.Description = &v - return s -} - -// Represents the output of one of the following operations: -// -// * ModifyCacheParameterGroup -// -// * ResetCacheParameterGroup -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheParameterGroupNameMessage -type CacheParameterGroupNameMessage struct { - _ struct{} `type:"structure"` - - // The name of the cache parameter group. - CacheParameterGroupName *string `type:"string"` -} - -// String returns the string representation -func (s CacheParameterGroupNameMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheParameterGroupNameMessage) GoString() string { - return s.String() -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *CacheParameterGroupNameMessage) SetCacheParameterGroupName(v string) *CacheParameterGroupNameMessage { - s.CacheParameterGroupName = &v - return s -} - -// Status of the cache parameter group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheParameterGroupStatus -type CacheParameterGroupStatus struct { - _ struct{} `type:"structure"` - - // A list of the cache node IDs which need to be rebooted for parameter changes - // to be applied. A node ID is a numeric identifier (0001, 0002, etc.). - CacheNodeIdsToReboot []*string `locationNameList:"CacheNodeId" type:"list"` - - // The name of the cache parameter group. - CacheParameterGroupName *string `type:"string"` - - // The status of parameter updates. - ParameterApplyStatus *string `type:"string"` -} - -// String returns the string representation -func (s CacheParameterGroupStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheParameterGroupStatus) GoString() string { - return s.String() -} - -// SetCacheNodeIdsToReboot sets the CacheNodeIdsToReboot field's value. -func (s *CacheParameterGroupStatus) SetCacheNodeIdsToReboot(v []*string) *CacheParameterGroupStatus { - s.CacheNodeIdsToReboot = v - return s -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *CacheParameterGroupStatus) SetCacheParameterGroupName(v string) *CacheParameterGroupStatus { - s.CacheParameterGroupName = &v - return s -} - -// SetParameterApplyStatus sets the ParameterApplyStatus field's value. -func (s *CacheParameterGroupStatus) SetParameterApplyStatus(v string) *CacheParameterGroupStatus { - s.ParameterApplyStatus = &v - return s -} - -// Represents the output of one of the following operations: -// -// * AuthorizeCacheSecurityGroupIngress -// -// * CreateCacheSecurityGroup -// -// * RevokeCacheSecurityGroupIngress -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheSecurityGroup -type CacheSecurityGroup struct { - _ struct{} `type:"structure"` - - // The name of the cache security group. - CacheSecurityGroupName *string `type:"string"` - - // The description of the cache security group. - Description *string `type:"string"` - - // A list of Amazon EC2 security groups that are associated with this cache - // security group. - EC2SecurityGroups []*EC2SecurityGroup `locationNameList:"EC2SecurityGroup" type:"list"` - - // The AWS account ID of the cache security group owner. - OwnerId *string `type:"string"` -} - -// String returns the string representation -func (s CacheSecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheSecurityGroup) GoString() string { - return s.String() -} - -// SetCacheSecurityGroupName sets the CacheSecurityGroupName field's value. -func (s *CacheSecurityGroup) SetCacheSecurityGroupName(v string) *CacheSecurityGroup { - s.CacheSecurityGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CacheSecurityGroup) SetDescription(v string) *CacheSecurityGroup { - s.Description = &v - return s -} - -// SetEC2SecurityGroups sets the EC2SecurityGroups field's value. -func (s *CacheSecurityGroup) SetEC2SecurityGroups(v []*EC2SecurityGroup) *CacheSecurityGroup { - s.EC2SecurityGroups = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *CacheSecurityGroup) SetOwnerId(v string) *CacheSecurityGroup { - s.OwnerId = &v - return s -} - -// Represents a cache cluster's status within a particular cache security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheSecurityGroupMembership -type CacheSecurityGroupMembership struct { - _ struct{} `type:"structure"` - - // The name of the cache security group. - CacheSecurityGroupName *string `type:"string"` - - // The membership status in the cache security group. The status changes when - // a cache security group is modified, or when the cache security groups assigned - // to a cache cluster are modified. - Status *string `type:"string"` -} - -// String returns the string representation -func (s CacheSecurityGroupMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheSecurityGroupMembership) GoString() string { - return s.String() -} - -// SetCacheSecurityGroupName sets the CacheSecurityGroupName field's value. -func (s *CacheSecurityGroupMembership) SetCacheSecurityGroupName(v string) *CacheSecurityGroupMembership { - s.CacheSecurityGroupName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CacheSecurityGroupMembership) SetStatus(v string) *CacheSecurityGroupMembership { - s.Status = &v - return s -} - -// Represents the output of one of the following operations: -// -// * CreateCacheSubnetGroup -// -// * ModifyCacheSubnetGroup -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheSubnetGroup -type CacheSubnetGroup struct { - _ struct{} `type:"structure"` - - // The description of the cache subnet group. - CacheSubnetGroupDescription *string `type:"string"` - - // The name of the cache subnet group. - CacheSubnetGroupName *string `type:"string"` - - // A list of subnets associated with the cache subnet group. - Subnets []*Subnet `locationNameList:"Subnet" type:"list"` - - // The Amazon Virtual Private Cloud identifier (VPC ID) of the cache subnet - // group. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s CacheSubnetGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheSubnetGroup) GoString() string { - return s.String() -} - -// SetCacheSubnetGroupDescription sets the CacheSubnetGroupDescription field's value. -func (s *CacheSubnetGroup) SetCacheSubnetGroupDescription(v string) *CacheSubnetGroup { - s.CacheSubnetGroupDescription = &v - return s -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *CacheSubnetGroup) SetCacheSubnetGroupName(v string) *CacheSubnetGroup { - s.CacheSubnetGroupName = &v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *CacheSubnetGroup) SetSubnets(v []*Subnet) *CacheSubnetGroup { - s.Subnets = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CacheSubnetGroup) SetVpcId(v string) *CacheSubnetGroup { - s.VpcId = &v - return s -} - -// Represents the input of a CopySnapshotMessage operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CopySnapshotMessage -type CopySnapshotInput struct { - _ struct{} `type:"structure"` - - // The name of an existing snapshot from which to make a copy. - // - // SourceSnapshotName is a required field - SourceSnapshotName *string `type:"string" required:"true"` - - // The Amazon S3 bucket to which the snapshot is exported. This parameter is - // used only when exporting a snapshot for external access. - // - // When using this parameter to export a snapshot, be sure Amazon ElastiCache - // has the needed permissions to this S3 bucket. For more information, see Step - // 2: Grant ElastiCache Access to Your Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html#Snapshots.Exporting.GrantAccess) - // in the Amazon ElastiCache User Guide. - // - // For more information, see Exporting a Snapshot (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Snapshots.Exporting.html) - // in the Amazon ElastiCache User Guide. - TargetBucket *string `type:"string"` - - // A name for the snapshot copy. ElastiCache does not permit overwriting a snapshot, - // therefore this name must be unique within its context - ElastiCache or an - // Amazon S3 bucket if exporting. - // - // TargetSnapshotName is a required field - TargetSnapshotName *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.SourceSnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceSnapshotName")) - } - if s.TargetSnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("TargetSnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceSnapshotName sets the SourceSnapshotName field's value. -func (s *CopySnapshotInput) SetSourceSnapshotName(v string) *CopySnapshotInput { - s.SourceSnapshotName = &v - return s -} - -// SetTargetBucket sets the TargetBucket field's value. -func (s *CopySnapshotInput) SetTargetBucket(v string) *CopySnapshotInput { - s.TargetBucket = &v - return s -} - -// SetTargetSnapshotName sets the TargetSnapshotName field's value. -func (s *CopySnapshotInput) SetTargetSnapshotName(v string) *CopySnapshotInput { - s.TargetSnapshotName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CopySnapshotResult -type CopySnapshotOutput struct { - _ struct{} `type:"structure"` - - // Represents a copy of an entire Redis cache cluster as of the time when the - // snapshot was taken. - Snapshot *Snapshot `type:"structure"` -} - -// 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() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *CopySnapshotOutput) SetSnapshot(v *Snapshot) *CopySnapshotOutput { - s.Snapshot = v - return s -} - -// Represents the input of a CreateCacheCluster operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheClusterMessage -type CreateCacheClusterInput struct { - _ struct{} `type:"structure"` - - // Specifies whether the nodes in this Memcached cluster are created in a single - // Availability Zone or created across multiple Availability Zones in the cluster's - // region. - // - // This parameter is only supported for Memcached cache clusters. - // - // If the AZMode and PreferredAvailabilityZones are not specified, ElastiCache - // assumes single-az mode. - AZMode *string `type:"string" enum:"AZMode"` - - // Reserved parameter. The password used to access a password protected server. - // - // Password constraints: - // - // * Must be only printable ASCII characters. - // - // * Must be at least 16 characters and no more than 128 characters in length. - // - // * Cannot contain any of the following characters: '/', '"', or "@". - // - // For more information, see AUTH password (http://redis.io/commands/AUTH) at - // Redis. - AuthToken *string `type:"string"` - - // This parameter is currently disabled. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The node group (shard) identifier. This parameter is stored as a lowercase - // string. - // - // Constraints: - // - // * A name must contain from 1 to 20 alphanumeric characters or hyphens. - // - // * The first character must be a letter. - // - // * A name cannot end with a hyphen or contain two consecutive hyphens. - // - // CacheClusterId is a required field - CacheClusterId *string `type:"string" required:"true"` - - // The compute and memory capacity of the nodes in the node group (shard). - // - // Valid node types are as follows: - // - // * General purpose: - // - // Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, - // cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge - // - // Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, - // cache.m1.xlarge - // - // * Compute optimized: cache.c1.xlarge - // - // * Memory optimized: - // - // Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, - // cache.r3.8xlarge - // - // Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge - // - // Notes: - // - // * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon - // VPC). - // - // * Redis backup/restore is not supported for Redis (cluster mode disabled) - // T1 and T2 instances. Backup/restore is supported on Redis (cluster mode - // enabled) T2 instances. - // - // * Redis Append-only files (AOF) functionality is not supported for T1 - // or T2 instances. - // - // For a complete listing of node types and specifications, see Amazon ElastiCache - // Product Features and Details (http://aws.amazon.com/elasticache/details) - // and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) - // or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). - CacheNodeType *string `type:"string"` - - // The name of the parameter group to associate with this cache cluster. If - // this argument is omitted, the default parameter group for the specified engine - // is used. You cannot use any parameter group which has cluster-enabled='yes' - // when creating a cluster. - CacheParameterGroupName *string `type:"string"` - - // A list of security group names to associate with this cache cluster. - // - // Use this parameter only when you are creating a cache cluster outside of - // an Amazon Virtual Private Cloud (Amazon VPC). - CacheSecurityGroupNames []*string `locationNameList:"CacheSecurityGroupName" type:"list"` - - // The name of the subnet group to be used for the cache cluster. - // - // Use this parameter only when you are creating a cache cluster in an Amazon - // Virtual Private Cloud (Amazon VPC). - // - // If you're going to launch your cluster in an Amazon VPC, you need to create - // a subnet group before you start creating a cluster. For more information, - // see Subnets and Subnet Groups (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/SubnetGroups.html). - CacheSubnetGroupName *string `type:"string"` - - // The name of the cache engine to be used for this cache cluster. - // - // Valid values for this parameter are: memcached | redis - Engine *string `type:"string"` - - // The version number of the cache engine to be used for this cache cluster. - // To view the supported cache engine versions, use the DescribeCacheEngineVersions - // operation. - // - // Important: You can upgrade to a newer engine version (see Selecting a Cache - // Engine and Version (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/SelectEngine.html#VersionManagement)), - // but you cannot downgrade to an earlier engine version. If you want to use - // an earlier engine version, you must delete the existing cache cluster or - // replication group and create it anew with the earlier engine version. - EngineVersion *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service - // (SNS) topic to which notifications are sent. - // - // The Amazon SNS topic owner must be the same as the cache cluster owner. - NotificationTopicArn *string `type:"string"` - - // The initial number of cache nodes that the cache cluster has. - // - // For clusters running Redis, this value must be 1. For clusters running Memcached, - // this value must be between 1 and 20. - // - // If you need more than 20 nodes for your Memcached cluster, please fill out - // the ElastiCache Limit Increase Request form at http://aws.amazon.com/contact-us/elasticache-node-limit-request/ - // (http://aws.amazon.com/contact-us/elasticache-node-limit-request/). - NumCacheNodes *int64 `type:"integer"` - - // The port number on which each of the cache nodes accepts connections. - Port *int64 `type:"integer"` - - // The EC2 Availability Zone in which the cache cluster is created. - // - // All nodes belonging to this Memcached cache cluster are placed in the preferred - // Availability Zone. If you want to create your nodes across multiple Availability - // Zones, use PreferredAvailabilityZones. - // - // Default: System chosen Availability Zone. - PreferredAvailabilityZone *string `type:"string"` - - // A list of the Availability Zones in which cache nodes are created. The order - // of the zones in the list is not important. - // - // This option is only supported on Memcached. - // - // If you are creating your cache cluster in an Amazon VPC (recommended) you - // can only locate nodes in Availability Zones that are associated with the - // subnets in the selected subnet group. - // - // The number of Availability Zones listed must equal the value of NumCacheNodes. - // - // If you want all the nodes in the same Availability Zone, use PreferredAvailabilityZone - // instead, or repeat the Availability Zone multiple times in the list. - // - // Default: System chosen Availability Zones. - PreferredAvailabilityZones []*string `locationNameList:"PreferredAvailabilityZone" type:"list"` - - // Specifies the weekly time range during which maintenance on the cache cluster - // is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi - // (24H Clock UTC). The minimum maintenance window is a 60 minute period. Valid - // values for ddd are: - // - // Specifies the weekly time range during which maintenance on the cluster is - // performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi - // (24H Clock UTC). The minimum maintenance window is a 60 minute period. - // - // Valid values for ddd are: - // - // * sun - // - // * mon - // - // * tue - // - // * wed - // - // * thu - // - // * fri - // - // * sat - // - // Example: sun:23:00-mon:01:30 - PreferredMaintenanceWindow *string `type:"string"` - - // Due to current limitations on Redis (cluster mode disabled), this operation - // or parameter is not supported on Redis (cluster mode enabled) replication - // groups. - // - // The ID of the replication group to which this cache cluster should belong. - // If this parameter is specified, the cache cluster is added to the specified - // replication group as a read replica; otherwise, the cache cluster is a standalone - // primary that is not part of any replication group. - // - // If the specified replication group is Multi-AZ enabled and the Availability - // Zone is not specified, the cache cluster is created in Availability Zones - // that provide the best spread of read replicas across Availability Zones. - // - // This parameter is only valid if the Engine parameter is redis. - ReplicationGroupId *string `type:"string"` - - // One or more VPC security groups associated with the cache cluster. - // - // Use this parameter only when you are creating a cache cluster in an Amazon - // Virtual Private Cloud (Amazon VPC). - SecurityGroupIds []*string `locationNameList:"SecurityGroupId" type:"list"` - - // A single-element string list containing an Amazon Resource Name (ARN) that - // uniquely identifies a Redis RDB snapshot file stored in Amazon S3. The snapshot - // file is used to populate the node group (shard). The Amazon S3 object name - // in the ARN cannot contain any commas. - // - // This parameter is only valid if the Engine parameter is redis. - // - // Example of an Amazon S3 ARN: arn:aws:s3:::my_bucket/snapshot1.rdb - SnapshotArns []*string `locationNameList:"SnapshotArn" type:"list"` - - // The name of a Redis snapshot from which to restore data into the new node - // group (shard). The snapshot status changes to restoring while the new node - // group (shard) is being created. - // - // This parameter is only valid if the Engine parameter is redis. - SnapshotName *string `type:"string"` - - // The number of days for which ElastiCache retains automatic snapshots before - // deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot - // taken today is retained for 5 days before being deleted. - // - // This parameter is only valid if the Engine parameter is redis. - // - // Default: 0 (i.e., automatic backups are disabled for this cache cluster). - SnapshotRetentionLimit *int64 `type:"integer"` - - // The daily time range (in UTC) during which ElastiCache begins taking a daily - // snapshot of your node group (shard). - // - // Example: 05:00-09:00 - // - // If you do not specify this parameter, ElastiCache automatically chooses an - // appropriate time range. - // - // Note: This parameter is only valid if the Engine parameter is redis. - SnapshotWindow *string `type:"string"` - - // A list of cost allocation tags to be added to this resource. A tag is a key-value - // pair. A tag key must be accompanied by a tag value. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateCacheClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCacheClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCacheClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCacheClusterInput"} - if s.CacheClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("CacheClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAZMode sets the AZMode field's value. -func (s *CreateCacheClusterInput) SetAZMode(v string) *CreateCacheClusterInput { - s.AZMode = &v - return s -} - -// SetAuthToken sets the AuthToken field's value. -func (s *CreateCacheClusterInput) SetAuthToken(v string) *CreateCacheClusterInput { - s.AuthToken = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *CreateCacheClusterInput) SetAutoMinorVersionUpgrade(v bool) *CreateCacheClusterInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *CreateCacheClusterInput) SetCacheClusterId(v string) *CreateCacheClusterInput { - s.CacheClusterId = &v - return s -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *CreateCacheClusterInput) SetCacheNodeType(v string) *CreateCacheClusterInput { - s.CacheNodeType = &v - return s -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *CreateCacheClusterInput) SetCacheParameterGroupName(v string) *CreateCacheClusterInput { - s.CacheParameterGroupName = &v - return s -} - -// SetCacheSecurityGroupNames sets the CacheSecurityGroupNames field's value. -func (s *CreateCacheClusterInput) SetCacheSecurityGroupNames(v []*string) *CreateCacheClusterInput { - s.CacheSecurityGroupNames = v - return s -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *CreateCacheClusterInput) SetCacheSubnetGroupName(v string) *CreateCacheClusterInput { - s.CacheSubnetGroupName = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *CreateCacheClusterInput) SetEngine(v string) *CreateCacheClusterInput { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *CreateCacheClusterInput) SetEngineVersion(v string) *CreateCacheClusterInput { - s.EngineVersion = &v - return s -} - -// SetNotificationTopicArn sets the NotificationTopicArn field's value. -func (s *CreateCacheClusterInput) SetNotificationTopicArn(v string) *CreateCacheClusterInput { - s.NotificationTopicArn = &v - return s -} - -// SetNumCacheNodes sets the NumCacheNodes field's value. -func (s *CreateCacheClusterInput) SetNumCacheNodes(v int64) *CreateCacheClusterInput { - s.NumCacheNodes = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateCacheClusterInput) SetPort(v int64) *CreateCacheClusterInput { - s.Port = &v - return s -} - -// SetPreferredAvailabilityZone sets the PreferredAvailabilityZone field's value. -func (s *CreateCacheClusterInput) SetPreferredAvailabilityZone(v string) *CreateCacheClusterInput { - s.PreferredAvailabilityZone = &v - return s -} - -// SetPreferredAvailabilityZones sets the PreferredAvailabilityZones field's value. -func (s *CreateCacheClusterInput) SetPreferredAvailabilityZones(v []*string) *CreateCacheClusterInput { - s.PreferredAvailabilityZones = v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CreateCacheClusterInput) SetPreferredMaintenanceWindow(v string) *CreateCacheClusterInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *CreateCacheClusterInput) SetReplicationGroupId(v string) *CreateCacheClusterInput { - s.ReplicationGroupId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateCacheClusterInput) SetSecurityGroupIds(v []*string) *CreateCacheClusterInput { - s.SecurityGroupIds = v - return s -} - -// SetSnapshotArns sets the SnapshotArns field's value. -func (s *CreateCacheClusterInput) SetSnapshotArns(v []*string) *CreateCacheClusterInput { - s.SnapshotArns = v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *CreateCacheClusterInput) SetSnapshotName(v string) *CreateCacheClusterInput { - s.SnapshotName = &v - return s -} - -// SetSnapshotRetentionLimit sets the SnapshotRetentionLimit field's value. -func (s *CreateCacheClusterInput) SetSnapshotRetentionLimit(v int64) *CreateCacheClusterInput { - s.SnapshotRetentionLimit = &v - return s -} - -// SetSnapshotWindow sets the SnapshotWindow field's value. -func (s *CreateCacheClusterInput) SetSnapshotWindow(v string) *CreateCacheClusterInput { - s.SnapshotWindow = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateCacheClusterInput) SetTags(v []*Tag) *CreateCacheClusterInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheClusterResult -type CreateCacheClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains all of the attributes of a specific cache cluster. - CacheCluster *CacheCluster `type:"structure"` -} - -// String returns the string representation -func (s CreateCacheClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCacheClusterOutput) GoString() string { - return s.String() -} - -// SetCacheCluster sets the CacheCluster field's value. -func (s *CreateCacheClusterOutput) SetCacheCluster(v *CacheCluster) *CreateCacheClusterOutput { - s.CacheCluster = v - return s -} - -// Represents the input of a CreateCacheParameterGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheParameterGroupMessage -type CreateCacheParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cache parameter group family that the cache parameter group - // can be used with. - // - // Valid values are: memcached1.4 | redis2.6 | redis2.8 | redis3.2 - // - // CacheParameterGroupFamily is a required field - CacheParameterGroupFamily *string `type:"string" required:"true"` - - // A user-specified name for the cache parameter group. - // - // CacheParameterGroupName is a required field - CacheParameterGroupName *string `type:"string" required:"true"` - - // A user-specified description for the cache parameter group. - // - // Description is a required field - Description *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateCacheParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCacheParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCacheParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCacheParameterGroupInput"} - if s.CacheParameterGroupFamily == nil { - invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupFamily")) - } - if s.CacheParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName")) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheParameterGroupFamily sets the CacheParameterGroupFamily field's value. -func (s *CreateCacheParameterGroupInput) SetCacheParameterGroupFamily(v string) *CreateCacheParameterGroupInput { - s.CacheParameterGroupFamily = &v - return s -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *CreateCacheParameterGroupInput) SetCacheParameterGroupName(v string) *CreateCacheParameterGroupInput { - s.CacheParameterGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateCacheParameterGroupInput) SetDescription(v string) *CreateCacheParameterGroupInput { - s.Description = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheParameterGroupResult -type CreateCacheParameterGroupOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of a CreateCacheParameterGroup operation. - CacheParameterGroup *CacheParameterGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateCacheParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCacheParameterGroupOutput) GoString() string { - return s.String() -} - -// SetCacheParameterGroup sets the CacheParameterGroup field's value. -func (s *CreateCacheParameterGroupOutput) SetCacheParameterGroup(v *CacheParameterGroup) *CreateCacheParameterGroupOutput { - s.CacheParameterGroup = v - return s -} - -// Represents the input of a CreateCacheSecurityGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSecurityGroupMessage -type CreateCacheSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // A name for the cache security group. This value is stored as a lowercase - // string. - // - // Constraints: Must contain no more than 255 alphanumeric characters. Cannot - // be the word "Default". - // - // Example: mysecuritygroup - // - // CacheSecurityGroupName is a required field - CacheSecurityGroupName *string `type:"string" required:"true"` - - // A description for the cache security group. - // - // Description is a required field - Description *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateCacheSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCacheSecurityGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCacheSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCacheSecurityGroupInput"} - if s.CacheSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheSecurityGroupName")) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheSecurityGroupName sets the CacheSecurityGroupName field's value. -func (s *CreateCacheSecurityGroupInput) SetCacheSecurityGroupName(v string) *CreateCacheSecurityGroupInput { - s.CacheSecurityGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateCacheSecurityGroupInput) SetDescription(v string) *CreateCacheSecurityGroupInput { - s.Description = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSecurityGroupResult -type CreateCacheSecurityGroupOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of one of the following operations: - // - // * AuthorizeCacheSecurityGroupIngress - // - // * CreateCacheSecurityGroup - // - // * RevokeCacheSecurityGroupIngress - CacheSecurityGroup *CacheSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateCacheSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCacheSecurityGroupOutput) GoString() string { - return s.String() -} - -// SetCacheSecurityGroup sets the CacheSecurityGroup field's value. -func (s *CreateCacheSecurityGroupOutput) SetCacheSecurityGroup(v *CacheSecurityGroup) *CreateCacheSecurityGroupOutput { - s.CacheSecurityGroup = v - return s -} - -// Represents the input of a CreateCacheSubnetGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSubnetGroupMessage -type CreateCacheSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // A description for the cache subnet group. - // - // CacheSubnetGroupDescription is a required field - CacheSubnetGroupDescription *string `type:"string" required:"true"` - - // A name for the cache subnet group. This value is stored as a lowercase string. - // - // Constraints: Must contain no more than 255 alphanumeric characters or hyphens. - // - // Example: mysubnetgroup - // - // CacheSubnetGroupName is a required field - CacheSubnetGroupName *string `type:"string" required:"true"` - - // A list of VPC subnet IDs for the cache subnet group. - // - // SubnetIds is a required field - SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` -} - -// String returns the string representation -func (s CreateCacheSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCacheSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCacheSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCacheSubnetGroupInput"} - if s.CacheSubnetGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("CacheSubnetGroupDescription")) - } - if s.CacheSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheSubnetGroupName")) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheSubnetGroupDescription sets the CacheSubnetGroupDescription field's value. -func (s *CreateCacheSubnetGroupInput) SetCacheSubnetGroupDescription(v string) *CreateCacheSubnetGroupInput { - s.CacheSubnetGroupDescription = &v - return s -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *CreateCacheSubnetGroupInput) SetCacheSubnetGroupName(v string) *CreateCacheSubnetGroupInput { - s.CacheSubnetGroupName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateCacheSubnetGroupInput) SetSubnetIds(v []*string) *CreateCacheSubnetGroupInput { - s.SubnetIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSubnetGroupResult -type CreateCacheSubnetGroupOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of one of the following operations: - // - // * CreateCacheSubnetGroup - // - // * ModifyCacheSubnetGroup - CacheSubnetGroup *CacheSubnetGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateCacheSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCacheSubnetGroupOutput) GoString() string { - return s.String() -} - -// SetCacheSubnetGroup sets the CacheSubnetGroup field's value. -func (s *CreateCacheSubnetGroupOutput) SetCacheSubnetGroup(v *CacheSubnetGroup) *CreateCacheSubnetGroupOutput { - s.CacheSubnetGroup = v - return s -} - -// Represents the input of a CreateReplicationGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateReplicationGroupMessage -type CreateReplicationGroupInput struct { - _ struct{} `type:"structure"` - - // Reserved parameter. The password used to access a password protected server. - // - // Password constraints: - // - // * Must be only printable ASCII characters. - // - // * Must be at least 16 characters and no more than 128 characters in length. - // - // * Cannot contain any of the following characters: '/', '"', or "@". - // - // For more information, see AUTH password (http://redis.io/commands/AUTH) at - // Redis. - AuthToken *string `type:"string"` - - // This parameter is currently disabled. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // Specifies whether a read-only replica is automatically promoted to read/write - // primary if the existing primary fails. - // - // If true, Multi-AZ is enabled for this replication group. If false, Multi-AZ - // is disabled for this replication group. - // - // AutomaticFailoverEnabled must be enabled for Redis (cluster mode enabled) - // replication groups. - // - // Default: false - // - // ElastiCache Multi-AZ replication groups is not supported on: - // - // Redis versions earlier than 2.8.6. - // - // Redis (cluster mode disabled): T1 and T2 node types. - // - // Redis (cluster mode enabled): T2 node types. - AutomaticFailoverEnabled *bool `type:"boolean"` - - // The compute and memory capacity of the nodes in the node group (shard). - // - // Valid node types are as follows: - // - // * General purpose: - // - // Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, - // cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge - // - // Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, - // cache.m1.xlarge - // - // * Compute optimized: cache.c1.xlarge - // - // * Memory optimized: - // - // Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, - // cache.r3.8xlarge - // - // Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge - // - // Notes: - // - // * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon - // VPC). - // - // * Redis backup/restore is not supported for Redis (cluster mode disabled) - // T1 and T2 instances. Backup/restore is supported on Redis (cluster mode - // enabled) T2 instances. - // - // * Redis Append-only files (AOF) functionality is not supported for T1 - // or T2 instances. - // - // For a complete listing of node types and specifications, see Amazon ElastiCache - // Product Features and Details (http://aws.amazon.com/elasticache/details) - // and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) - // or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). - CacheNodeType *string `type:"string"` - - // The name of the parameter group to associate with this replication group. - // If this argument is omitted, the default cache parameter group for the specified - // engine is used. - // - // If you are running Redis version 3.2.4 or later, only one node group (shard), - // and want to use a default parameter group, we recommend that you specify - // the parameter group by name. - // - // * To create a Redis (cluster mode disabled) replication group, use CacheParameterGroupName=default.redis3.2. - // - // * To create a Redis (cluster mode enabled) replication group, use CacheParameterGroupName=default.redis3.2.cluster.on. - CacheParameterGroupName *string `type:"string"` - - // A list of cache security group names to associate with this replication group. - CacheSecurityGroupNames []*string `locationNameList:"CacheSecurityGroupName" type:"list"` - - // The name of the cache subnet group to be used for the replication group. - // - // If you're going to launch your cluster in an Amazon VPC, you need to create - // a subnet group before you start creating a cluster. For more information, - // see Subnets and Subnet Groups (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/SubnetGroups.html). - CacheSubnetGroupName *string `type:"string"` - - // The name of the cache engine to be used for the cache clusters in this replication - // group. - Engine *string `type:"string"` - - // The version number of the cache engine to be used for the cache clusters - // in this replication group. To view the supported cache engine versions, use - // the DescribeCacheEngineVersions operation. - // - // Important: You can upgrade to a newer engine version (see Selecting a Cache - // Engine and Version (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/SelectEngine.html#VersionManagement)) - // in the ElastiCache User Guide, but you cannot downgrade to an earlier engine - // version. If you want to use an earlier engine version, you must delete the - // existing cache cluster or replication group and create it anew with the earlier - // engine version. - EngineVersion *string `type:"string"` - - // A list of node group (shard) configuration options. Each node group (shard) - // configuration has the following: Slots, PrimaryAvailabilityZone, ReplicaAvailabilityZones, - // ReplicaCount. - // - // If you're creating a Redis (cluster mode disabled) or a Redis (cluster mode - // enabled) replication group, you can use this parameter to configure one node - // group (shard) or you can omit this parameter. - NodeGroupConfiguration []*NodeGroupConfiguration `locationNameList:"NodeGroupConfiguration" type:"list"` - - // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service - // (SNS) topic to which notifications are sent. - // - // The Amazon SNS topic owner must be the same as the cache cluster owner. - NotificationTopicArn *string `type:"string"` - - // The number of clusters this replication group initially has. - // - // This parameter is not used if there is more than one node group (shard). - // You should use ReplicasPerNodeGroup instead. - // - // If Multi-AZ is enabled, the value of this parameter must be at least 2. - // - // The maximum permitted value for NumCacheClusters is 6 (primary plus 5 replicas). - NumCacheClusters *int64 `type:"integer"` - - // An optional parameter that specifies the number of node groups (shards) for - // this Redis (cluster mode enabled) replication group. For Redis (cluster mode - // disabled) either omit this parameter or set it to 1. - // - // Default: 1 - NumNodeGroups *int64 `type:"integer"` - - // The port number on which each member of the replication group accepts connections. - Port *int64 `type:"integer"` - - // A list of EC2 Availability Zones in which the replication group's cache clusters - // are created. The order of the Availability Zones in the list is the order - // in which clusters are allocated. The primary cluster is created in the first - // AZ in the list. - // - // This parameter is not used if there is more than one node group (shard). - // You should use NodeGroupConfiguration instead. - // - // If you are creating your replication group in an Amazon VPC (recommended), - // you can only locate cache clusters in Availability Zones associated with - // the subnets in the selected subnet group. - // - // The number of Availability Zones listed must equal the value of NumCacheClusters. - // - // Default: system chosen Availability Zones. - PreferredCacheClusterAZs []*string `locationNameList:"AvailabilityZone" type:"list"` - - // Specifies the weekly time range during which maintenance on the cache cluster - // is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi - // (24H Clock UTC). The minimum maintenance window is a 60 minute period. Valid - // values for ddd are: - // - // Specifies the weekly time range during which maintenance on the cluster is - // performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi - // (24H Clock UTC). The minimum maintenance window is a 60 minute period. - // - // Valid values for ddd are: - // - // * sun - // - // * mon - // - // * tue - // - // * wed - // - // * thu - // - // * fri - // - // * sat - // - // Example: sun:23:00-mon:01:30 - PreferredMaintenanceWindow *string `type:"string"` - - // The identifier of the cache cluster that serves as the primary for this replication - // group. This cache cluster must already exist and have a status of available. - // - // This parameter is not required if NumCacheClusters, NumNodeGroups, or ReplicasPerNodeGroup - // is specified. - PrimaryClusterId *string `type:"string"` - - // An optional parameter that specifies the number of replica nodes in each - // node group (shard). Valid values are 0 to 5. - ReplicasPerNodeGroup *int64 `type:"integer"` - - // A user-created description for the replication group. - // - // ReplicationGroupDescription is a required field - ReplicationGroupDescription *string `type:"string" required:"true"` - - // The replication group identifier. This parameter is stored as a lowercase - // string. - // - // Constraints: - // - // * A name must contain from 1 to 20 alphanumeric characters or hyphens. - // - // * The first character must be a letter. - // - // * A name cannot end with a hyphen or contain two consecutive hyphens. - // - // ReplicationGroupId is a required field - ReplicationGroupId *string `type:"string" required:"true"` - - // One or more Amazon VPC security groups associated with this replication group. - // - // Use this parameter only when you are creating a replication group in an Amazon - // Virtual Private Cloud (Amazon VPC). - SecurityGroupIds []*string `locationNameList:"SecurityGroupId" type:"list"` - - // A list of Amazon Resource Names (ARN) that uniquely identify the Redis RDB - // snapshot files stored in Amazon S3. The snapshot files are used to populate - // the replication group. The Amazon S3 object name in the ARN cannot contain - // any commas. The list must match the number of node groups (shards) in the - // replication group, which means you cannot repartition. - // - // This parameter is only valid if the Engine parameter is redis. - // - // Example of an Amazon S3 ARN: arn:aws:s3:::my_bucket/snapshot1.rdb - SnapshotArns []*string `locationNameList:"SnapshotArn" type:"list"` - - // The name of a snapshot from which to restore data into the new replication - // group. The snapshot status changes to restoring while the new replication - // group is being created. - // - // This parameter is only valid if the Engine parameter is redis. - SnapshotName *string `type:"string"` - - // The number of days for which ElastiCache retains automatic snapshots before - // deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot - // that was taken today is retained for 5 days before being deleted. - // - // This parameter is only valid if the Engine parameter is redis. - // - // Default: 0 (i.e., automatic backups are disabled for this cache cluster). - SnapshotRetentionLimit *int64 `type:"integer"` - - // The daily time range (in UTC) during which ElastiCache begins taking a daily - // snapshot of your node group (shard). - // - // Example: 05:00-09:00 - // - // If you do not specify this parameter, ElastiCache automatically chooses an - // appropriate time range. - // - // This parameter is only valid if the Engine parameter is redis. - SnapshotWindow *string `type:"string"` - - // A list of cost allocation tags to be added to this resource. A tag is a key-value - // pair. A tag key must be accompanied by a tag value. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateReplicationGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicationGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReplicationGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReplicationGroupInput"} - if s.ReplicationGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationGroupDescription")) - } - if s.ReplicationGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationGroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthToken sets the AuthToken field's value. -func (s *CreateReplicationGroupInput) SetAuthToken(v string) *CreateReplicationGroupInput { - s.AuthToken = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *CreateReplicationGroupInput) SetAutoMinorVersionUpgrade(v bool) *CreateReplicationGroupInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAutomaticFailoverEnabled sets the AutomaticFailoverEnabled field's value. -func (s *CreateReplicationGroupInput) SetAutomaticFailoverEnabled(v bool) *CreateReplicationGroupInput { - s.AutomaticFailoverEnabled = &v - return s -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *CreateReplicationGroupInput) SetCacheNodeType(v string) *CreateReplicationGroupInput { - s.CacheNodeType = &v - return s -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *CreateReplicationGroupInput) SetCacheParameterGroupName(v string) *CreateReplicationGroupInput { - s.CacheParameterGroupName = &v - return s -} - -// SetCacheSecurityGroupNames sets the CacheSecurityGroupNames field's value. -func (s *CreateReplicationGroupInput) SetCacheSecurityGroupNames(v []*string) *CreateReplicationGroupInput { - s.CacheSecurityGroupNames = v - return s -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *CreateReplicationGroupInput) SetCacheSubnetGroupName(v string) *CreateReplicationGroupInput { - s.CacheSubnetGroupName = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *CreateReplicationGroupInput) SetEngine(v string) *CreateReplicationGroupInput { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *CreateReplicationGroupInput) SetEngineVersion(v string) *CreateReplicationGroupInput { - s.EngineVersion = &v - return s -} - -// SetNodeGroupConfiguration sets the NodeGroupConfiguration field's value. -func (s *CreateReplicationGroupInput) SetNodeGroupConfiguration(v []*NodeGroupConfiguration) *CreateReplicationGroupInput { - s.NodeGroupConfiguration = v - return s -} - -// SetNotificationTopicArn sets the NotificationTopicArn field's value. -func (s *CreateReplicationGroupInput) SetNotificationTopicArn(v string) *CreateReplicationGroupInput { - s.NotificationTopicArn = &v - return s -} - -// SetNumCacheClusters sets the NumCacheClusters field's value. -func (s *CreateReplicationGroupInput) SetNumCacheClusters(v int64) *CreateReplicationGroupInput { - s.NumCacheClusters = &v - return s -} - -// SetNumNodeGroups sets the NumNodeGroups field's value. -func (s *CreateReplicationGroupInput) SetNumNodeGroups(v int64) *CreateReplicationGroupInput { - s.NumNodeGroups = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateReplicationGroupInput) SetPort(v int64) *CreateReplicationGroupInput { - s.Port = &v - return s -} - -// SetPreferredCacheClusterAZs sets the PreferredCacheClusterAZs field's value. -func (s *CreateReplicationGroupInput) SetPreferredCacheClusterAZs(v []*string) *CreateReplicationGroupInput { - s.PreferredCacheClusterAZs = v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CreateReplicationGroupInput) SetPreferredMaintenanceWindow(v string) *CreateReplicationGroupInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPrimaryClusterId sets the PrimaryClusterId field's value. -func (s *CreateReplicationGroupInput) SetPrimaryClusterId(v string) *CreateReplicationGroupInput { - s.PrimaryClusterId = &v - return s -} - -// SetReplicasPerNodeGroup sets the ReplicasPerNodeGroup field's value. -func (s *CreateReplicationGroupInput) SetReplicasPerNodeGroup(v int64) *CreateReplicationGroupInput { - s.ReplicasPerNodeGroup = &v - return s -} - -// SetReplicationGroupDescription sets the ReplicationGroupDescription field's value. -func (s *CreateReplicationGroupInput) SetReplicationGroupDescription(v string) *CreateReplicationGroupInput { - s.ReplicationGroupDescription = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *CreateReplicationGroupInput) SetReplicationGroupId(v string) *CreateReplicationGroupInput { - s.ReplicationGroupId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateReplicationGroupInput) SetSecurityGroupIds(v []*string) *CreateReplicationGroupInput { - s.SecurityGroupIds = v - return s -} - -// SetSnapshotArns sets the SnapshotArns field's value. -func (s *CreateReplicationGroupInput) SetSnapshotArns(v []*string) *CreateReplicationGroupInput { - s.SnapshotArns = v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *CreateReplicationGroupInput) SetSnapshotName(v string) *CreateReplicationGroupInput { - s.SnapshotName = &v - return s -} - -// SetSnapshotRetentionLimit sets the SnapshotRetentionLimit field's value. -func (s *CreateReplicationGroupInput) SetSnapshotRetentionLimit(v int64) *CreateReplicationGroupInput { - s.SnapshotRetentionLimit = &v - return s -} - -// SetSnapshotWindow sets the SnapshotWindow field's value. -func (s *CreateReplicationGroupInput) SetSnapshotWindow(v string) *CreateReplicationGroupInput { - s.SnapshotWindow = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateReplicationGroupInput) SetTags(v []*Tag) *CreateReplicationGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateReplicationGroupResult -type CreateReplicationGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains all of the attributes of a specific Redis replication group. - ReplicationGroup *ReplicationGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateReplicationGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicationGroupOutput) GoString() string { - return s.String() -} - -// SetReplicationGroup sets the ReplicationGroup field's value. -func (s *CreateReplicationGroupOutput) SetReplicationGroup(v *ReplicationGroup) *CreateReplicationGroupOutput { - s.ReplicationGroup = v - return s -} - -// Represents the input of a CreateSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateSnapshotMessage -type CreateSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of an existing cache cluster. The snapshot is created from - // this cache cluster. - CacheClusterId *string `type:"string"` - - // The identifier of an existing replication group. The snapshot is created - // from this replication group. - ReplicationGroupId *string `type:"string"` - - // A name for the snapshot being created. - // - // SnapshotName is a required field - SnapshotName *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.SnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *CreateSnapshotInput) SetCacheClusterId(v string) *CreateSnapshotInput { - s.CacheClusterId = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *CreateSnapshotInput) SetReplicationGroupId(v string) *CreateSnapshotInput { - s.ReplicationGroupId = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *CreateSnapshotInput) SetSnapshotName(v string) *CreateSnapshotInput { - s.SnapshotName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateSnapshotResult -type CreateSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Represents a copy of an entire Redis cache cluster as of the time when the - // snapshot was taken. - Snapshot *Snapshot `type:"structure"` -} - -// String returns the string representation -func (s CreateSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *CreateSnapshotOutput) SetSnapshot(v *Snapshot) *CreateSnapshotOutput { - s.Snapshot = v - return s -} - -// Represents the input of a DeleteCacheCluster operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheClusterMessage -type DeleteCacheClusterInput struct { - _ struct{} `type:"structure"` - - // The cache cluster identifier for the cluster to be deleted. This parameter - // is not case sensitive. - // - // CacheClusterId is a required field - CacheClusterId *string `type:"string" required:"true"` - - // The user-supplied name of a final cache cluster snapshot. This is the unique - // name that identifies the snapshot. ElastiCache creates the snapshot, and - // then deletes the cache cluster immediately afterward. - FinalSnapshotIdentifier *string `type:"string"` -} - -// String returns the string representation -func (s DeleteCacheClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCacheClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCacheClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCacheClusterInput"} - if s.CacheClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("CacheClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *DeleteCacheClusterInput) SetCacheClusterId(v string) *DeleteCacheClusterInput { - s.CacheClusterId = &v - return s -} - -// SetFinalSnapshotIdentifier sets the FinalSnapshotIdentifier field's value. -func (s *DeleteCacheClusterInput) SetFinalSnapshotIdentifier(v string) *DeleteCacheClusterInput { - s.FinalSnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheClusterResult -type DeleteCacheClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains all of the attributes of a specific cache cluster. - CacheCluster *CacheCluster `type:"structure"` -} - -// String returns the string representation -func (s DeleteCacheClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCacheClusterOutput) GoString() string { - return s.String() -} - -// SetCacheCluster sets the CacheCluster field's value. -func (s *DeleteCacheClusterOutput) SetCacheCluster(v *CacheCluster) *DeleteCacheClusterOutput { - s.CacheCluster = v - return s -} - -// Represents the input of a DeleteCacheParameterGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheParameterGroupMessage -type DeleteCacheParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cache parameter group to delete. - // - // The specified cache security group must not be associated with any cache - // clusters. - // - // CacheParameterGroupName is a required field - CacheParameterGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteCacheParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCacheParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCacheParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCacheParameterGroupInput"} - if s.CacheParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *DeleteCacheParameterGroupInput) SetCacheParameterGroupName(v string) *DeleteCacheParameterGroupInput { - s.CacheParameterGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheParameterGroupOutput -type DeleteCacheParameterGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteCacheParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCacheParameterGroupOutput) GoString() string { - return s.String() -} - -// Represents the input of a DeleteCacheSecurityGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSecurityGroupMessage -type DeleteCacheSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cache security group to delete. - // - // You cannot delete the default security group. - // - // CacheSecurityGroupName is a required field - CacheSecurityGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteCacheSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCacheSecurityGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCacheSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCacheSecurityGroupInput"} - if s.CacheSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheSecurityGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheSecurityGroupName sets the CacheSecurityGroupName field's value. -func (s *DeleteCacheSecurityGroupInput) SetCacheSecurityGroupName(v string) *DeleteCacheSecurityGroupInput { - s.CacheSecurityGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSecurityGroupOutput -type DeleteCacheSecurityGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteCacheSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCacheSecurityGroupOutput) GoString() string { - return s.String() -} - -// Represents the input of a DeleteCacheSubnetGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSubnetGroupMessage -type DeleteCacheSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cache subnet group to delete. - // - // Constraints: Must contain no more than 255 alphanumeric characters or hyphens. - // - // CacheSubnetGroupName is a required field - CacheSubnetGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteCacheSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCacheSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCacheSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCacheSubnetGroupInput"} - if s.CacheSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheSubnetGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *DeleteCacheSubnetGroupInput) SetCacheSubnetGroupName(v string) *DeleteCacheSubnetGroupInput { - s.CacheSubnetGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSubnetGroupOutput -type DeleteCacheSubnetGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteCacheSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCacheSubnetGroupOutput) GoString() string { - return s.String() -} - -// Represents the input of a DeleteReplicationGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteReplicationGroupMessage -type DeleteReplicationGroupInput struct { - _ struct{} `type:"structure"` - - // The name of a final node group (shard) snapshot. ElastiCache creates the - // snapshot from the primary node in the cluster, rather than one of the replicas; - // this is to ensure that it captures the freshest data. After the final snapshot - // is taken, the replication group is immediately deleted. - FinalSnapshotIdentifier *string `type:"string"` - - // The identifier for the cluster to be deleted. This parameter is not case - // sensitive. - // - // ReplicationGroupId is a required field - ReplicationGroupId *string `type:"string" required:"true"` - - // If set to true, all of the read replicas are deleted, but the primary node - // is retained. - RetainPrimaryCluster *bool `type:"boolean"` -} - -// String returns the string representation -func (s DeleteReplicationGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicationGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReplicationGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReplicationGroupInput"} - if s.ReplicationGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationGroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFinalSnapshotIdentifier sets the FinalSnapshotIdentifier field's value. -func (s *DeleteReplicationGroupInput) SetFinalSnapshotIdentifier(v string) *DeleteReplicationGroupInput { - s.FinalSnapshotIdentifier = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *DeleteReplicationGroupInput) SetReplicationGroupId(v string) *DeleteReplicationGroupInput { - s.ReplicationGroupId = &v - return s -} - -// SetRetainPrimaryCluster sets the RetainPrimaryCluster field's value. -func (s *DeleteReplicationGroupInput) SetRetainPrimaryCluster(v bool) *DeleteReplicationGroupInput { - s.RetainPrimaryCluster = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteReplicationGroupResult -type DeleteReplicationGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains all of the attributes of a specific Redis replication group. - ReplicationGroup *ReplicationGroup `type:"structure"` -} - -// String returns the string representation -func (s DeleteReplicationGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicationGroupOutput) GoString() string { - return s.String() -} - -// SetReplicationGroup sets the ReplicationGroup field's value. -func (s *DeleteReplicationGroupOutput) SetReplicationGroup(v *ReplicationGroup) *DeleteReplicationGroupOutput { - s.ReplicationGroup = v - return s -} - -// Represents the input of a DeleteSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteSnapshotMessage -type DeleteSnapshotInput struct { - _ struct{} `type:"structure"` - - // The name of the snapshot to be deleted. - // - // SnapshotName is a required field - SnapshotName *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.SnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *DeleteSnapshotInput) SetSnapshotName(v string) *DeleteSnapshotInput { - s.SnapshotName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteSnapshotResult -type DeleteSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Represents a copy of an entire Redis cache cluster as of the time when the - // snapshot was taken. - Snapshot *Snapshot `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() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *DeleteSnapshotOutput) SetSnapshot(v *Snapshot) *DeleteSnapshotOutput { - s.Snapshot = v - return s -} - -// Represents the input of a DescribeCacheClusters operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheClustersMessage -type DescribeCacheClustersInput struct { - _ struct{} `type:"structure"` - - // The user-supplied cluster identifier. If this parameter is specified, only - // information about that specific cache cluster is returned. This parameter - // isn't case sensitive. - CacheClusterId *string `type:"string"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` - - // An optional flag that can be included in the DescribeCacheCluster request - // to retrieve information about the individual cache nodes. - ShowCacheNodeInfo *bool `type:"boolean"` -} - -// String returns the string representation -func (s DescribeCacheClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheClustersInput) GoString() string { - return s.String() -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *DescribeCacheClustersInput) SetCacheClusterId(v string) *DescribeCacheClustersInput { - s.CacheClusterId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheClustersInput) SetMarker(v string) *DescribeCacheClustersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeCacheClustersInput) SetMaxRecords(v int64) *DescribeCacheClustersInput { - s.MaxRecords = &v - return s -} - -// SetShowCacheNodeInfo sets the ShowCacheNodeInfo field's value. -func (s *DescribeCacheClustersInput) SetShowCacheNodeInfo(v bool) *DescribeCacheClustersInput { - s.ShowCacheNodeInfo = &v - return s -} - -// Represents the output of a DescribeCacheClusters operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheClusterMessage -type DescribeCacheClustersOutput struct { - _ struct{} `type:"structure"` - - // A list of cache clusters. Each item in the list contains detailed information - // about one cache cluster. - CacheClusters []*CacheCluster `locationNameList:"CacheCluster" type:"list"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCacheClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheClustersOutput) GoString() string { - return s.String() -} - -// SetCacheClusters sets the CacheClusters field's value. -func (s *DescribeCacheClustersOutput) SetCacheClusters(v []*CacheCluster) *DescribeCacheClustersOutput { - s.CacheClusters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheClustersOutput) SetMarker(v string) *DescribeCacheClustersOutput { - s.Marker = &v - return s -} - -// Represents the input of a DescribeCacheEngineVersions operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheEngineVersionsMessage -type DescribeCacheEngineVersionsInput struct { - _ struct{} `type:"structure"` - - // The name of a specific cache parameter group family to return details for. - // - // Valid values are: memcached1.4 | redis2.6 | redis2.8 | redis3.2 - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - CacheParameterGroupFamily *string `type:"string"` - - // If true, specifies that only the default version of the specified engine - // or engine and major version combination is to be returned. - DefaultOnly *bool `type:"boolean"` - - // The cache engine to return. Valid values: memcached | redis - Engine *string `type:"string"` - - // The cache engine version to return. - // - // Example: 1.4.14 - EngineVersion *string `type:"string"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeCacheEngineVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheEngineVersionsInput) GoString() string { - return s.String() -} - -// SetCacheParameterGroupFamily sets the CacheParameterGroupFamily field's value. -func (s *DescribeCacheEngineVersionsInput) SetCacheParameterGroupFamily(v string) *DescribeCacheEngineVersionsInput { - s.CacheParameterGroupFamily = &v - return s -} - -// SetDefaultOnly sets the DefaultOnly field's value. -func (s *DescribeCacheEngineVersionsInput) SetDefaultOnly(v bool) *DescribeCacheEngineVersionsInput { - s.DefaultOnly = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *DescribeCacheEngineVersionsInput) SetEngine(v string) *DescribeCacheEngineVersionsInput { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *DescribeCacheEngineVersionsInput) SetEngineVersion(v string) *DescribeCacheEngineVersionsInput { - s.EngineVersion = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheEngineVersionsInput) SetMarker(v string) *DescribeCacheEngineVersionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeCacheEngineVersionsInput) SetMaxRecords(v int64) *DescribeCacheEngineVersionsInput { - s.MaxRecords = &v - return s -} - -// Represents the output of a DescribeCacheEngineVersions operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheEngineVersionMessage -type DescribeCacheEngineVersionsOutput struct { - _ struct{} `type:"structure"` - - // A list of cache engine version details. Each element in the list contains - // detailed information about one cache engine version. - CacheEngineVersions []*CacheEngineVersion `locationNameList:"CacheEngineVersion" type:"list"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCacheEngineVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheEngineVersionsOutput) GoString() string { - return s.String() -} - -// SetCacheEngineVersions sets the CacheEngineVersions field's value. -func (s *DescribeCacheEngineVersionsOutput) SetCacheEngineVersions(v []*CacheEngineVersion) *DescribeCacheEngineVersionsOutput { - s.CacheEngineVersions = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheEngineVersionsOutput) SetMarker(v string) *DescribeCacheEngineVersionsOutput { - s.Marker = &v - return s -} - -// Represents the input of a DescribeCacheParameterGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameterGroupsMessage -type DescribeCacheParameterGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of a specific cache parameter group to return details for. - CacheParameterGroupName *string `type:"string"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeCacheParameterGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheParameterGroupsInput) GoString() string { - return s.String() -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *DescribeCacheParameterGroupsInput) SetCacheParameterGroupName(v string) *DescribeCacheParameterGroupsInput { - s.CacheParameterGroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheParameterGroupsInput) SetMarker(v string) *DescribeCacheParameterGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeCacheParameterGroupsInput) SetMaxRecords(v int64) *DescribeCacheParameterGroupsInput { - s.MaxRecords = &v - return s -} - -// Represents the output of a DescribeCacheParameterGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheParameterGroupsMessage -type DescribeCacheParameterGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of cache parameter groups. Each element in the list contains detailed - // information about one cache parameter group. - CacheParameterGroups []*CacheParameterGroup `locationNameList:"CacheParameterGroup" type:"list"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCacheParameterGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheParameterGroupsOutput) GoString() string { - return s.String() -} - -// SetCacheParameterGroups sets the CacheParameterGroups field's value. -func (s *DescribeCacheParameterGroupsOutput) SetCacheParameterGroups(v []*CacheParameterGroup) *DescribeCacheParameterGroupsOutput { - s.CacheParameterGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheParameterGroupsOutput) SetMarker(v string) *DescribeCacheParameterGroupsOutput { - s.Marker = &v - return s -} - -// Represents the input of a DescribeCacheParameters operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParametersMessage -type DescribeCacheParametersInput struct { - _ struct{} `type:"structure"` - - // The name of a specific cache parameter group to return details for. - // - // CacheParameterGroupName is a required field - CacheParameterGroupName *string `type:"string" required:"true"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` - - // The parameter types to return. - // - // Valid values: user | system | engine-default - Source *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCacheParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCacheParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCacheParametersInput"} - if s.CacheParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *DescribeCacheParametersInput) SetCacheParameterGroupName(v string) *DescribeCacheParametersInput { - s.CacheParameterGroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheParametersInput) SetMarker(v string) *DescribeCacheParametersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeCacheParametersInput) SetMaxRecords(v int64) *DescribeCacheParametersInput { - s.MaxRecords = &v - return s -} - -// SetSource sets the Source field's value. -func (s *DescribeCacheParametersInput) SetSource(v string) *DescribeCacheParametersInput { - s.Source = &v - return s -} - -// Represents the output of a DescribeCacheParameters operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheParameterGroupDetails -type DescribeCacheParametersOutput struct { - _ struct{} `type:"structure"` - - // A list of parameters specific to a particular cache node type. Each element - // in the list contains detailed information about one parameter. - CacheNodeTypeSpecificParameters []*CacheNodeTypeSpecificParameter `locationNameList:"CacheNodeTypeSpecificParameter" type:"list"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` - - // A list of Parameter instances. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` -} - -// String returns the string representation -func (s DescribeCacheParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheParametersOutput) GoString() string { - return s.String() -} - -// SetCacheNodeTypeSpecificParameters sets the CacheNodeTypeSpecificParameters field's value. -func (s *DescribeCacheParametersOutput) SetCacheNodeTypeSpecificParameters(v []*CacheNodeTypeSpecificParameter) *DescribeCacheParametersOutput { - s.CacheNodeTypeSpecificParameters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheParametersOutput) SetMarker(v string) *DescribeCacheParametersOutput { - s.Marker = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DescribeCacheParametersOutput) SetParameters(v []*Parameter) *DescribeCacheParametersOutput { - s.Parameters = v - return s -} - -// Represents the input of a DescribeCacheSecurityGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSecurityGroupsMessage -type DescribeCacheSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of the cache security group to return details for. - CacheSecurityGroupName *string `type:"string"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeCacheSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheSecurityGroupsInput) GoString() string { - return s.String() -} - -// SetCacheSecurityGroupName sets the CacheSecurityGroupName field's value. -func (s *DescribeCacheSecurityGroupsInput) SetCacheSecurityGroupName(v string) *DescribeCacheSecurityGroupsInput { - s.CacheSecurityGroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheSecurityGroupsInput) SetMarker(v string) *DescribeCacheSecurityGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeCacheSecurityGroupsInput) SetMaxRecords(v int64) *DescribeCacheSecurityGroupsInput { - s.MaxRecords = &v - return s -} - -// Represents the output of a DescribeCacheSecurityGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheSecurityGroupMessage -type DescribeCacheSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of cache security groups. Each element in the list contains detailed - // information about one group. - CacheSecurityGroups []*CacheSecurityGroup `locationNameList:"CacheSecurityGroup" type:"list"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCacheSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetCacheSecurityGroups sets the CacheSecurityGroups field's value. -func (s *DescribeCacheSecurityGroupsOutput) SetCacheSecurityGroups(v []*CacheSecurityGroup) *DescribeCacheSecurityGroupsOutput { - s.CacheSecurityGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheSecurityGroupsOutput) SetMarker(v string) *DescribeCacheSecurityGroupsOutput { - s.Marker = &v - return s -} - -// Represents the input of a DescribeCacheSubnetGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSubnetGroupsMessage -type DescribeCacheSubnetGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of the cache subnet group to return details for. - CacheSubnetGroupName *string `type:"string"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeCacheSubnetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheSubnetGroupsInput) GoString() string { - return s.String() -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *DescribeCacheSubnetGroupsInput) SetCacheSubnetGroupName(v string) *DescribeCacheSubnetGroupsInput { - s.CacheSubnetGroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheSubnetGroupsInput) SetMarker(v string) *DescribeCacheSubnetGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeCacheSubnetGroupsInput) SetMaxRecords(v int64) *DescribeCacheSubnetGroupsInput { - s.MaxRecords = &v - return s -} - -// Represents the output of a DescribeCacheSubnetGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CacheSubnetGroupMessage -type DescribeCacheSubnetGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of cache subnet groups. Each element in the list contains detailed - // information about one group. - CacheSubnetGroups []*CacheSubnetGroup `locationNameList:"CacheSubnetGroup" type:"list"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCacheSubnetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCacheSubnetGroupsOutput) GoString() string { - return s.String() -} - -// SetCacheSubnetGroups sets the CacheSubnetGroups field's value. -func (s *DescribeCacheSubnetGroupsOutput) SetCacheSubnetGroups(v []*CacheSubnetGroup) *DescribeCacheSubnetGroupsOutput { - s.CacheSubnetGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCacheSubnetGroupsOutput) SetMarker(v string) *DescribeCacheSubnetGroupsOutput { - s.Marker = &v - return s -} - -// Represents the input of a DescribeEngineDefaultParameters operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEngineDefaultParametersMessage -type DescribeEngineDefaultParametersInput struct { - _ struct{} `type:"structure"` - - // The name of the cache parameter group family. - // - // Valid values are: memcached1.4 | redis2.6 | redis2.8 | redis3.2 - // - // CacheParameterGroupFamily is a required field - CacheParameterGroupFamily *string `type:"string" required:"true"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeEngineDefaultParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEngineDefaultParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEngineDefaultParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEngineDefaultParametersInput"} - if s.CacheParameterGroupFamily == nil { - invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupFamily")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheParameterGroupFamily sets the CacheParameterGroupFamily field's value. -func (s *DescribeEngineDefaultParametersInput) SetCacheParameterGroupFamily(v string) *DescribeEngineDefaultParametersInput { - s.CacheParameterGroupFamily = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEngineDefaultParametersInput) SetMarker(v string) *DescribeEngineDefaultParametersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEngineDefaultParametersInput) SetMaxRecords(v int64) *DescribeEngineDefaultParametersInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEngineDefaultParametersResult -type DescribeEngineDefaultParametersOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of a DescribeEngineDefaultParameters operation. - EngineDefaults *EngineDefaults `type:"structure"` -} - -// String returns the string representation -func (s DescribeEngineDefaultParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEngineDefaultParametersOutput) GoString() string { - return s.String() -} - -// SetEngineDefaults sets the EngineDefaults field's value. -func (s *DescribeEngineDefaultParametersOutput) SetEngineDefaults(v *EngineDefaults) *DescribeEngineDefaultParametersOutput { - s.EngineDefaults = v - return s -} - -// Represents the input of a DescribeEvents operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEventsMessage -type DescribeEventsInput struct { - _ struct{} `type:"structure"` - - // The number of minutes' worth of events to retrieve. - Duration *int64 `type:"integer"` - - // The end of the time interval for which to retrieve events, specified in ISO - // 8601 format. - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` - - // The identifier of the event source for which events are returned. If not - // specified, all sources are included in the response. - SourceIdentifier *string `type:"string"` - - // The event source to retrieve events for. If no value is specified, all events - // are returned. - SourceType *string `type:"string" enum:"SourceType"` - - // The beginning of the time interval to retrieve events for, specified in ISO - // 8601 format. - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventsInput) GoString() string { - return s.String() -} - -// SetDuration sets the Duration field's value. -func (s *DescribeEventsInput) SetDuration(v int64) *DescribeEventsInput { - s.Duration = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeEventsInput) SetEndTime(v time.Time) *DescribeEventsInput { - s.EndTime = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventsInput) SetMarker(v string) *DescribeEventsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEventsInput) SetMaxRecords(v int64) *DescribeEventsInput { - s.MaxRecords = &v - return s -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *DescribeEventsInput) SetSourceIdentifier(v string) *DescribeEventsInput { - s.SourceIdentifier = &v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *DescribeEventsInput) SetSourceType(v string) *DescribeEventsInput { - s.SourceType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeEventsInput) SetStartTime(v time.Time) *DescribeEventsInput { - s.StartTime = &v - return s -} - -// Represents the output of a DescribeEvents operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/EventsMessage -type DescribeEventsOutput struct { - _ struct{} `type:"structure"` - - // A list of events. Each element in the list contains detailed information - // about one event. - Events []*Event `locationNameList:"Event" type:"list"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *DescribeEventsOutput) SetEvents(v []*Event) *DescribeEventsOutput { - s.Events = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventsOutput) SetMarker(v string) *DescribeEventsOutput { - s.Marker = &v - return s -} - -// Represents the input of a DescribeReplicationGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReplicationGroupsMessage -type DescribeReplicationGroupsInput struct { - _ struct{} `type:"structure"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` - - // The identifier for the replication group to be described. This parameter - // is not case sensitive. - // - // If you do not specify this parameter, information about all replication groups - // is returned. - ReplicationGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeReplicationGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReplicationGroupsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReplicationGroupsInput) SetMarker(v string) *DescribeReplicationGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReplicationGroupsInput) SetMaxRecords(v int64) *DescribeReplicationGroupsInput { - s.MaxRecords = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *DescribeReplicationGroupsInput) SetReplicationGroupId(v string) *DescribeReplicationGroupsInput { - s.ReplicationGroupId = &v - return s -} - -// Represents the output of a DescribeReplicationGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ReplicationGroupMessage -type DescribeReplicationGroupsOutput struct { - _ struct{} `type:"structure"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` - - // A list of replication groups. Each item in the list contains detailed information - // about one replication group. - ReplicationGroups []*ReplicationGroup `locationNameList:"ReplicationGroup" type:"list"` -} - -// String returns the string representation -func (s DescribeReplicationGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReplicationGroupsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReplicationGroupsOutput) SetMarker(v string) *DescribeReplicationGroupsOutput { - s.Marker = &v - return s -} - -// SetReplicationGroups sets the ReplicationGroups field's value. -func (s *DescribeReplicationGroupsOutput) SetReplicationGroups(v []*ReplicationGroup) *DescribeReplicationGroupsOutput { - s.ReplicationGroups = v - return s -} - -// Represents the input of a DescribeReservedCacheNodes operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodesMessage -type DescribeReservedCacheNodesInput struct { - _ struct{} `type:"structure"` - - // The cache node type filter value. Use this parameter to show only those reservations - // matching the specified cache node type. - // - // Valid node types are as follows: - // - // * General purpose: - // - // Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, - // cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge - // - // Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, - // cache.m1.xlarge - // - // * Compute optimized: cache.c1.xlarge - // - // * Memory optimized: - // - // Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, - // cache.r3.8xlarge - // - // Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge - // - // Notes: - // - // * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon - // VPC). - // - // * Redis backup/restore is not supported for Redis (cluster mode disabled) - // T1 and T2 instances. Backup/restore is supported on Redis (cluster mode - // enabled) T2 instances. - // - // * Redis Append-only files (AOF) functionality is not supported for T1 - // or T2 instances. - // - // For a complete listing of node types and specifications, see Amazon ElastiCache - // Product Features and Details (http://aws.amazon.com/elasticache/details) - // and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) - // or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). - CacheNodeType *string `type:"string"` - - // The duration filter value, specified in years or seconds. Use this parameter - // to show only reservations for this duration. - // - // Valid Values: 1 | 3 | 31536000 | 94608000 - Duration *string `type:"string"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` - - // The offering type filter value. Use this parameter to show only the available - // offerings matching the specified offering type. - // - // Valid values: "Light Utilization"|"Medium Utilization"|"Heavy Utilization" - OfferingType *string `type:"string"` - - // The product description filter value. Use this parameter to show only those - // reservations matching the specified product description. - ProductDescription *string `type:"string"` - - // The reserved cache node identifier filter value. Use this parameter to show - // only the reservation that matches the specified reservation ID. - ReservedCacheNodeId *string `type:"string"` - - // The offering identifier filter value. Use this parameter to show only purchased - // reservations matching the specified offering identifier. - ReservedCacheNodesOfferingId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeReservedCacheNodesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedCacheNodesInput) GoString() string { - return s.String() -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *DescribeReservedCacheNodesInput) SetCacheNodeType(v string) *DescribeReservedCacheNodesInput { - s.CacheNodeType = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *DescribeReservedCacheNodesInput) SetDuration(v string) *DescribeReservedCacheNodesInput { - s.Duration = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedCacheNodesInput) SetMarker(v string) *DescribeReservedCacheNodesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReservedCacheNodesInput) SetMaxRecords(v int64) *DescribeReservedCacheNodesInput { - s.MaxRecords = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservedCacheNodesInput) SetOfferingType(v string) *DescribeReservedCacheNodesInput { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *DescribeReservedCacheNodesInput) SetProductDescription(v string) *DescribeReservedCacheNodesInput { - s.ProductDescription = &v - return s -} - -// SetReservedCacheNodeId sets the ReservedCacheNodeId field's value. -func (s *DescribeReservedCacheNodesInput) SetReservedCacheNodeId(v string) *DescribeReservedCacheNodesInput { - s.ReservedCacheNodeId = &v - return s -} - -// SetReservedCacheNodesOfferingId sets the ReservedCacheNodesOfferingId field's value. -func (s *DescribeReservedCacheNodesInput) SetReservedCacheNodesOfferingId(v string) *DescribeReservedCacheNodesInput { - s.ReservedCacheNodesOfferingId = &v - return s -} - -// Represents the input of a DescribeReservedCacheNodesOfferings operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodesOfferingsMessage -type DescribeReservedCacheNodesOfferingsInput struct { - _ struct{} `type:"structure"` - - // The cache node type filter value. Use this parameter to show only the available - // offerings matching the specified cache node type. - // - // Valid node types are as follows: - // - // * General purpose: - // - // Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, - // cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge - // - // Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, - // cache.m1.xlarge - // - // * Compute optimized: cache.c1.xlarge - // - // * Memory optimized: - // - // Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, - // cache.r3.8xlarge - // - // Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge - // - // Notes: - // - // * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon - // VPC). - // - // * Redis backup/restore is not supported for Redis (cluster mode disabled) - // T1 and T2 instances. Backup/restore is supported on Redis (cluster mode - // enabled) T2 instances. - // - // * Redis Append-only files (AOF) functionality is not supported for T1 - // or T2 instances. - // - // For a complete listing of node types and specifications, see Amazon ElastiCache - // Product Features and Details (http://aws.amazon.com/elasticache/details) - // and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) - // or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). - CacheNodeType *string `type:"string"` - - // Duration filter value, specified in years or seconds. Use this parameter - // to show only reservations for a given duration. - // - // Valid Values: 1 | 3 | 31536000 | 94608000 - Duration *string `type:"string"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: minimum 20; maximum 100. - MaxRecords *int64 `type:"integer"` - - // The offering type filter value. Use this parameter to show only the available - // offerings matching the specified offering type. - // - // Valid Values: "Light Utilization"|"Medium Utilization"|"Heavy Utilization" - OfferingType *string `type:"string"` - - // The product description filter value. Use this parameter to show only the - // available offerings matching the specified product description. - ProductDescription *string `type:"string"` - - // The offering identifier filter value. Use this parameter to show only the - // available offering that matches the specified reservation identifier. - // - // Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706 - ReservedCacheNodesOfferingId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeReservedCacheNodesOfferingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedCacheNodesOfferingsInput) GoString() string { - return s.String() -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *DescribeReservedCacheNodesOfferingsInput) SetCacheNodeType(v string) *DescribeReservedCacheNodesOfferingsInput { - s.CacheNodeType = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *DescribeReservedCacheNodesOfferingsInput) SetDuration(v string) *DescribeReservedCacheNodesOfferingsInput { - s.Duration = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedCacheNodesOfferingsInput) SetMarker(v string) *DescribeReservedCacheNodesOfferingsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReservedCacheNodesOfferingsInput) SetMaxRecords(v int64) *DescribeReservedCacheNodesOfferingsInput { - s.MaxRecords = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservedCacheNodesOfferingsInput) SetOfferingType(v string) *DescribeReservedCacheNodesOfferingsInput { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *DescribeReservedCacheNodesOfferingsInput) SetProductDescription(v string) *DescribeReservedCacheNodesOfferingsInput { - s.ProductDescription = &v - return s -} - -// SetReservedCacheNodesOfferingId sets the ReservedCacheNodesOfferingId field's value. -func (s *DescribeReservedCacheNodesOfferingsInput) SetReservedCacheNodesOfferingId(v string) *DescribeReservedCacheNodesOfferingsInput { - s.ReservedCacheNodesOfferingId = &v - return s -} - -// Represents the output of a DescribeReservedCacheNodesOfferings operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ReservedCacheNodesOfferingMessage -type DescribeReservedCacheNodesOfferingsOutput struct { - _ struct{} `type:"structure"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` - - // A list of reserved cache node offerings. Each element in the list contains - // detailed information about one offering. - ReservedCacheNodesOfferings []*ReservedCacheNodesOffering `locationNameList:"ReservedCacheNodesOffering" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedCacheNodesOfferingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedCacheNodesOfferingsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedCacheNodesOfferingsOutput) SetMarker(v string) *DescribeReservedCacheNodesOfferingsOutput { - s.Marker = &v - return s -} - -// SetReservedCacheNodesOfferings sets the ReservedCacheNodesOfferings field's value. -func (s *DescribeReservedCacheNodesOfferingsOutput) SetReservedCacheNodesOfferings(v []*ReservedCacheNodesOffering) *DescribeReservedCacheNodesOfferingsOutput { - s.ReservedCacheNodesOfferings = v - return s -} - -// Represents the output of a DescribeReservedCacheNodes operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ReservedCacheNodeMessage -type DescribeReservedCacheNodesOutput struct { - _ struct{} `type:"structure"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` - - // A list of reserved cache nodes. Each element in the list contains detailed - // information about one node. - ReservedCacheNodes []*ReservedCacheNode `locationNameList:"ReservedCacheNode" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedCacheNodesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedCacheNodesOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedCacheNodesOutput) SetMarker(v string) *DescribeReservedCacheNodesOutput { - s.Marker = &v - return s -} - -// SetReservedCacheNodes sets the ReservedCacheNodes field's value. -func (s *DescribeReservedCacheNodesOutput) SetReservedCacheNodes(v []*ReservedCacheNode) *DescribeReservedCacheNodesOutput { - s.ReservedCacheNodes = v - return s -} - -// Represents the input of a DescribeSnapshotsMessage operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeSnapshotsMessage -type DescribeSnapshotsInput struct { - _ struct{} `type:"structure"` - - // A user-supplied cluster identifier. If this parameter is specified, only - // snapshots associated with that specific cache cluster are described. - CacheClusterId *string `type:"string"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a marker is included in the response - // so that the remaining results can be retrieved. - // - // Default: 50 - // - // Constraints: minimum 20; maximum 50. - MaxRecords *int64 `type:"integer"` - - // A user-supplied replication group identifier. If this parameter is specified, - // only snapshots associated with that specific replication group are described. - ReplicationGroupId *string `type:"string"` - - // A Boolean value which if true, the node group (shard) configuration is included - // in the snapshot description. - ShowNodeGroupConfig *bool `type:"boolean"` - - // A user-supplied name of the snapshot. If this parameter is specified, only - // this snapshot are described. - SnapshotName *string `type:"string"` - - // If set to system, the output shows snapshots that were automatically created - // by ElastiCache. If set to user the output shows snapshots that were manually - // created. If omitted, the output shows both automatically and manually created - // snapshots. - SnapshotSource *string `type:"string"` -} - -// 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() -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *DescribeSnapshotsInput) SetCacheClusterId(v string) *DescribeSnapshotsInput { - s.CacheClusterId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSnapshotsInput) SetMarker(v string) *DescribeSnapshotsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeSnapshotsInput) SetMaxRecords(v int64) *DescribeSnapshotsInput { - s.MaxRecords = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *DescribeSnapshotsInput) SetReplicationGroupId(v string) *DescribeSnapshotsInput { - s.ReplicationGroupId = &v - return s -} - -// SetShowNodeGroupConfig sets the ShowNodeGroupConfig field's value. -func (s *DescribeSnapshotsInput) SetShowNodeGroupConfig(v bool) *DescribeSnapshotsInput { - s.ShowNodeGroupConfig = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *DescribeSnapshotsInput) SetSnapshotName(v string) *DescribeSnapshotsInput { - s.SnapshotName = &v - return s -} - -// SetSnapshotSource sets the SnapshotSource field's value. -func (s *DescribeSnapshotsInput) SetSnapshotSource(v string) *DescribeSnapshotsInput { - s.SnapshotSource = &v - return s -} - -// Represents the output of a DescribeSnapshots operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeSnapshotsListMessage -type DescribeSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // An optional marker returned from a prior request. Use this marker for pagination - // of results from this operation. If this parameter is specified, the response - // includes only records beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // A list of snapshots. Each item in the list contains detailed information - // about one snapshot. - Snapshots []*Snapshot `locationNameList:"Snapshot" 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() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSnapshotsOutput) SetMarker(v string) *DescribeSnapshotsOutput { - s.Marker = &v - return s -} - -// SetSnapshots sets the Snapshots field's value. -func (s *DescribeSnapshotsOutput) SetSnapshots(v []*Snapshot) *DescribeSnapshotsOutput { - s.Snapshots = v - return s -} - -// Provides ownership and status information for an Amazon EC2 security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/EC2SecurityGroup -type EC2SecurityGroup struct { - _ struct{} `type:"structure"` - - // The name of the Amazon EC2 security group. - EC2SecurityGroupName *string `type:"string"` - - // The AWS account ID of the Amazon EC2 security group owner. - EC2SecurityGroupOwnerId *string `type:"string"` - - // The status of the Amazon EC2 security group. - Status *string `type:"string"` -} - -// String returns the string representation -func (s EC2SecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EC2SecurityGroup) GoString() string { - return s.String() -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *EC2SecurityGroup) SetEC2SecurityGroupName(v string) *EC2SecurityGroup { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *EC2SecurityGroup) SetEC2SecurityGroupOwnerId(v string) *EC2SecurityGroup { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EC2SecurityGroup) SetStatus(v string) *EC2SecurityGroup { - s.Status = &v - return s -} - -// Represents the information required for client programs to connect to a cache -// node. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/Endpoint -type Endpoint struct { - _ struct{} `type:"structure"` - - // The DNS hostname of the cache node. - Address *string `type:"string"` - - // The port number that the cache engine is listening on. - Port *int64 `type:"integer"` -} - -// String returns the string representation -func (s Endpoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Endpoint) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *Endpoint) SetAddress(v string) *Endpoint { - s.Address = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Endpoint) SetPort(v int64) *Endpoint { - s.Port = &v - return s -} - -// Represents the output of a DescribeEngineDefaultParameters operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/EngineDefaults -type EngineDefaults struct { - _ struct{} `type:"structure"` - - // A list of parameters specific to a particular cache node type. Each element - // in the list contains detailed information about one parameter. - CacheNodeTypeSpecificParameters []*CacheNodeTypeSpecificParameter `locationNameList:"CacheNodeTypeSpecificParameter" type:"list"` - - // Specifies the name of the cache parameter group family to which the engine - // default parameters apply. - // - // Valid values are: memcached1.4 | redis2.6 | redis2.8 | redis3.2 - CacheParameterGroupFamily *string `type:"string"` - - // Provides an identifier to allow retrieval of paginated results. - Marker *string `type:"string"` - - // Contains a list of engine default parameters. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` -} - -// String returns the string representation -func (s EngineDefaults) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EngineDefaults) GoString() string { - return s.String() -} - -// SetCacheNodeTypeSpecificParameters sets the CacheNodeTypeSpecificParameters field's value. -func (s *EngineDefaults) SetCacheNodeTypeSpecificParameters(v []*CacheNodeTypeSpecificParameter) *EngineDefaults { - s.CacheNodeTypeSpecificParameters = v - return s -} - -// SetCacheParameterGroupFamily sets the CacheParameterGroupFamily field's value. -func (s *EngineDefaults) SetCacheParameterGroupFamily(v string) *EngineDefaults { - s.CacheParameterGroupFamily = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *EngineDefaults) SetMarker(v string) *EngineDefaults { - s.Marker = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *EngineDefaults) SetParameters(v []*Parameter) *EngineDefaults { - s.Parameters = v - return s -} - -// Represents a single occurrence of something interesting within the system. -// Some examples of events are creating a cache cluster, adding or removing -// a cache node, or rebooting a node. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/Event -type Event struct { - _ struct{} `type:"structure"` - - // The date and time when the event occurred. - Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The text of the event. - Message *string `type:"string"` - - // The identifier for the source of the event. For example, if the event occurred - // at the cache cluster level, the identifier would be the name of the cache - // cluster. - SourceIdentifier *string `type:"string"` - - // Specifies the origin of this event - a cache cluster, a parameter group, - // a security group, etc. - SourceType *string `type:"string" enum:"SourceType"` -} - -// String returns the string representation -func (s Event) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Event) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *Event) SetDate(v time.Time) *Event { - s.Date = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *Event) SetMessage(v string) *Event { - s.Message = &v - return s -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *Event) SetSourceIdentifier(v string) *Event { - s.SourceIdentifier = &v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *Event) SetSourceType(v string) *Event { - s.SourceType = &v - return s -} - -// The input parameters for the ListAllowedNodeTypeModifications operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListAllowedNodeTypeModificationsMessage -type ListAllowedNodeTypeModificationsInput struct { - _ struct{} `type:"structure"` - - // The name of the cache cluster you want to scale up to a larger node instanced - // type. ElastiCache uses the cluster id to identify the current node type of - // this cluster and from that to create a list of node types you can scale up - // to. - // - // You must provide a value for either the CacheClusterId or the ReplicationGroupId. - CacheClusterId *string `type:"string"` - - // The name of the replication group want to scale up to a larger node type. - // ElastiCache uses the replication group id to identify the current node type - // being used by this replication group, and from that to create a list of node - // types you can scale up to. - // - // You must provide a value for either the CacheClusterId or the ReplicationGroupId. - ReplicationGroupId *string `type:"string"` -} - -// String returns the string representation -func (s ListAllowedNodeTypeModificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAllowedNodeTypeModificationsInput) GoString() string { - return s.String() -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *ListAllowedNodeTypeModificationsInput) SetCacheClusterId(v string) *ListAllowedNodeTypeModificationsInput { - s.CacheClusterId = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *ListAllowedNodeTypeModificationsInput) SetReplicationGroupId(v string) *ListAllowedNodeTypeModificationsInput { - s.ReplicationGroupId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AllowedNodeTypeModificationsMessage -type ListAllowedNodeTypeModificationsOutput struct { - _ struct{} `type:"structure"` - - ScaleUpModifications []*string `type:"list"` -} - -// String returns the string representation -func (s ListAllowedNodeTypeModificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAllowedNodeTypeModificationsOutput) GoString() string { - return s.String() -} - -// SetScaleUpModifications sets the ScaleUpModifications field's value. -func (s *ListAllowedNodeTypeModificationsOutput) SetScaleUpModifications(v []*string) *ListAllowedNodeTypeModificationsOutput { - s.ScaleUpModifications = v - return s -} - -// The input parameters for the ListTagsForResource operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListTagsForResourceMessage -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource for which you want the list - // of tags, for example arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster - // or arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // ResourceName is a required field - ResourceName *string `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.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceName sets the ResourceName field's value. -func (s *ListTagsForResourceInput) SetResourceName(v string) *ListTagsForResourceInput { - s.ResourceName = &v - return s -} - -// Represents the input of a ModifyCacheCluster operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheClusterMessage -type ModifyCacheClusterInput struct { - _ struct{} `type:"structure"` - - // Specifies whether the new nodes in this Memcached cache cluster are all created - // in a single Availability Zone or created across multiple Availability Zones. - // - // Valid values: single-az | cross-az. - // - // This option is only supported for Memcached cache clusters. - // - // You cannot specify single-az if the Memcached cache cluster already has cache - // nodes in different Availability Zones. If cross-az is specified, existing - // Memcached nodes remain in their current Availability Zone. - // - // Only newly created nodes are located in different Availability Zones. For - // instructions on how to move existing Memcached nodes to different Availability - // Zones, see the Availability Zone Considerations section of Cache Node Considerations - // for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheNode.Memcached.html). - AZMode *string `type:"string" enum:"AZMode"` - - // If true, this parameter causes the modifications in this request and any - // pending modifications to be applied, asynchronously and as soon as possible, - // regardless of the PreferredMaintenanceWindow setting for the cache cluster. - // - // If false, changes to the cache cluster are applied on the next maintenance - // reboot, or the next failure reboot, whichever occurs first. - // - // If you perform a ModifyCacheCluster before a pending modification is applied, - // the pending modification is replaced by the newer modification. - // - // Valid values: true | false - // - // Default: false - ApplyImmediately *bool `type:"boolean"` - - // This parameter is currently disabled. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The cache cluster identifier. This value is stored as a lowercase string. - // - // CacheClusterId is a required field - CacheClusterId *string `type:"string" required:"true"` - - // A list of cache node IDs to be removed. A node ID is a numeric identifier - // (0001, 0002, etc.). This parameter is only valid when NumCacheNodes is less - // than the existing number of cache nodes. The number of cache node IDs supplied - // in this parameter must match the difference between the existing number of - // cache nodes in the cluster or pending cache nodes, whichever is greater, - // and the value of NumCacheNodes in the request. - // - // For example: If you have 3 active cache nodes, 7 pending cache nodes, and - // the number of cache nodes in this ModifyCacheCluser call is 5, you must list - // 2 (7 - 5) cache node IDs to remove. - CacheNodeIdsToRemove []*string `locationNameList:"CacheNodeId" type:"list"` - - // A valid cache node type that you want to scale this cache cluster up to. - CacheNodeType *string `type:"string"` - - // The name of the cache parameter group to apply to this cache cluster. This - // change is asynchronously applied as soon as possible for parameters when - // the ApplyImmediately parameter is specified as true for this request. - CacheParameterGroupName *string `type:"string"` - - // A list of cache security group names to authorize on this cache cluster. - // This change is asynchronously applied as soon as possible. - // - // You can use this parameter only with clusters that are created outside of - // an Amazon Virtual Private Cloud (Amazon VPC). - // - // Constraints: Must contain no more than 255 alphanumeric characters. Must - // not be "Default". - CacheSecurityGroupNames []*string `locationNameList:"CacheSecurityGroupName" type:"list"` - - // The upgraded version of the cache engine to be run on the cache nodes. - // - // Important: You can upgrade to a newer engine version (see Selecting a Cache - // Engine and Version (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/SelectEngine.html#VersionManagement)), - // but you cannot downgrade to an earlier engine version. If you want to use - // an earlier engine version, you must delete the existing cache cluster and - // create it anew with the earlier engine version. - EngineVersion *string `type:"string"` - - // The list of Availability Zones where the new Memcached cache nodes are created. - // - // This parameter is only valid when NumCacheNodes in the request is greater - // than the sum of the number of active cache nodes and the number of cache - // nodes pending creation (which may be zero). The number of Availability Zones - // supplied in this list must match the cache nodes being added in this request. - // - // This option is only supported on Memcached clusters. - // - // Scenarios: - // - // * Scenario 1: You have 3 active nodes and wish to add 2 nodes. Specify - // NumCacheNodes=5 (3 + 2) and optionally specify two Availability Zones - // for the two new nodes. - // - // * Scenario 2: You have 3 active nodes and 2 nodes pending creation (from - // the scenario 1 call) and want to add 1 more node. Specify NumCacheNodes=6 - // ((3 + 2) + 1) and optionally specify an Availability Zone for the new - // node. - // - // * Scenario 3: You want to cancel all pending operations. Specify NumCacheNodes=3 - // to cancel all pending operations. - // - // The Availability Zone placement of nodes pending creation cannot be modified. - // If you wish to cancel any nodes pending creation, add 0 nodes by setting - // NumCacheNodes to the number of current nodes. - // - // If cross-az is specified, existing Memcached nodes remain in their current - // Availability Zone. Only newly created nodes can be located in different Availability - // Zones. For guidance on how to move existing Memcached nodes to different - // Availability Zones, see the Availability Zone Considerations section of Cache - // Node Considerations for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheNode.Memcached.html). - // - // Impact of new add/remove requests upon pending requests - // - // * Scenario-1 - // - // Pending Action: Delete - // - // New Request: Delete - // - // Result: The new delete, pending or immediate, replaces the pending delete. - // - // * Scenario-2 - // - // Pending Action: Delete - // - // New Request: Create - // - // Result: The new create, pending or immediate, replaces the pending delete. - // - // * Scenario-3 - // - // Pending Action: Create - // - // New Request: Delete - // - // Result: The new delete, pending or immediate, replaces the pending create. - // - // * Scenario-4 - // - // Pending Action: Create - // - // New Request: Create - // - // Result: The new create is added to the pending create. - // - // Important: If the new create request is Apply Immediately - Yes, all creates - // are performed immediately. If the new create request is Apply Immediately - // - No, all creates are pending. - NewAvailabilityZones []*string `locationNameList:"PreferredAvailabilityZone" type:"list"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications - // are sent. - // - // The Amazon SNS topic owner must be same as the cache cluster owner. - NotificationTopicArn *string `type:"string"` - - // The status of the Amazon SNS notification topic. Notifications are sent only - // if the status is active. - // - // Valid values: active | inactive - NotificationTopicStatus *string `type:"string"` - - // The number of cache nodes that the cache cluster should have. If the value - // for NumCacheNodes is greater than the sum of the number of current cache - // nodes and the number of cache nodes pending creation (which may be zero), - // more nodes are added. If the value is less than the number of existing cache - // nodes, nodes are removed. If the value is equal to the number of current - // cache nodes, any pending add or remove requests are canceled. - // - // If you are removing cache nodes, you must use the CacheNodeIdsToRemove parameter - // to provide the IDs of the specific cache nodes to remove. - // - // For clusters running Redis, this value must be 1. For clusters running Memcached, - // this value must be between 1 and 20. - // - // Adding or removing Memcached cache nodes can be applied immediately or as - // a pending operation (see ApplyImmediately). - // - // A pending operation to modify the number of cache nodes in a cluster during - // its maintenance window, whether by adding or removing nodes in accordance - // with the scale out architecture, is not queued. The customer's latest request - // to add or remove nodes to the cluster overrides any previous pending operations - // to modify the number of cache nodes in the cluster. For example, a request - // to remove 2 nodes would override a previous pending operation to remove 3 - // nodes. Similarly, a request to add 2 nodes would override a previous pending - // operation to remove 3 nodes and vice versa. As Memcached cache nodes may - // now be provisioned in different Availability Zones with flexible cache node - // placement, a request to add nodes does not automatically override a previous - // pending operation to add nodes. The customer can modify the previous pending - // operation to add more nodes or explicitly cancel the pending request and - // retry the new request. To cancel pending operations to modify the number - // of cache nodes in a cluster, use the ModifyCacheCluster request and set NumCacheNodes - // equal to the number of cache nodes currently in the cache cluster. - NumCacheNodes *int64 `type:"integer"` - - // Specifies the weekly time range during which maintenance on the cluster is - // performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi - // (24H Clock UTC). The minimum maintenance window is a 60 minute period. - // - // Valid values for ddd are: - // - // * sun - // - // * mon - // - // * tue - // - // * wed - // - // * thu - // - // * fri - // - // * sat - // - // Example: sun:23:00-mon:01:30 - PreferredMaintenanceWindow *string `type:"string"` - - // Specifies the VPC Security Groups associated with the cache cluster. - // - // This parameter can be used only with clusters that are created in an Amazon - // Virtual Private Cloud (Amazon VPC). - SecurityGroupIds []*string `locationNameList:"SecurityGroupId" type:"list"` - - // The number of days for which ElastiCache retains automatic cache cluster - // snapshots before deleting them. For example, if you set SnapshotRetentionLimit - // to 5, a snapshot that was taken today is retained for 5 days before being - // deleted. - // - // If the value of SnapshotRetentionLimit is set to zero (0), backups are turned - // off. - SnapshotRetentionLimit *int64 `type:"integer"` - - // The daily time range (in UTC) during which ElastiCache begins taking a daily - // snapshot of your cache cluster. - SnapshotWindow *string `type:"string"` -} - -// String returns the string representation -func (s ModifyCacheClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyCacheClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyCacheClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyCacheClusterInput"} - if s.CacheClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("CacheClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAZMode sets the AZMode field's value. -func (s *ModifyCacheClusterInput) SetAZMode(v string) *ModifyCacheClusterInput { - s.AZMode = &v - return s -} - -// SetApplyImmediately sets the ApplyImmediately field's value. -func (s *ModifyCacheClusterInput) SetApplyImmediately(v bool) *ModifyCacheClusterInput { - s.ApplyImmediately = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *ModifyCacheClusterInput) SetAutoMinorVersionUpgrade(v bool) *ModifyCacheClusterInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *ModifyCacheClusterInput) SetCacheClusterId(v string) *ModifyCacheClusterInput { - s.CacheClusterId = &v - return s -} - -// SetCacheNodeIdsToRemove sets the CacheNodeIdsToRemove field's value. -func (s *ModifyCacheClusterInput) SetCacheNodeIdsToRemove(v []*string) *ModifyCacheClusterInput { - s.CacheNodeIdsToRemove = v - return s -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *ModifyCacheClusterInput) SetCacheNodeType(v string) *ModifyCacheClusterInput { - s.CacheNodeType = &v - return s -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *ModifyCacheClusterInput) SetCacheParameterGroupName(v string) *ModifyCacheClusterInput { - s.CacheParameterGroupName = &v - return s -} - -// SetCacheSecurityGroupNames sets the CacheSecurityGroupNames field's value. -func (s *ModifyCacheClusterInput) SetCacheSecurityGroupNames(v []*string) *ModifyCacheClusterInput { - s.CacheSecurityGroupNames = v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *ModifyCacheClusterInput) SetEngineVersion(v string) *ModifyCacheClusterInput { - s.EngineVersion = &v - return s -} - -// SetNewAvailabilityZones sets the NewAvailabilityZones field's value. -func (s *ModifyCacheClusterInput) SetNewAvailabilityZones(v []*string) *ModifyCacheClusterInput { - s.NewAvailabilityZones = v - return s -} - -// SetNotificationTopicArn sets the NotificationTopicArn field's value. -func (s *ModifyCacheClusterInput) SetNotificationTopicArn(v string) *ModifyCacheClusterInput { - s.NotificationTopicArn = &v - return s -} - -// SetNotificationTopicStatus sets the NotificationTopicStatus field's value. -func (s *ModifyCacheClusterInput) SetNotificationTopicStatus(v string) *ModifyCacheClusterInput { - s.NotificationTopicStatus = &v - return s -} - -// SetNumCacheNodes sets the NumCacheNodes field's value. -func (s *ModifyCacheClusterInput) SetNumCacheNodes(v int64) *ModifyCacheClusterInput { - s.NumCacheNodes = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *ModifyCacheClusterInput) SetPreferredMaintenanceWindow(v string) *ModifyCacheClusterInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ModifyCacheClusterInput) SetSecurityGroupIds(v []*string) *ModifyCacheClusterInput { - s.SecurityGroupIds = v - return s -} - -// SetSnapshotRetentionLimit sets the SnapshotRetentionLimit field's value. -func (s *ModifyCacheClusterInput) SetSnapshotRetentionLimit(v int64) *ModifyCacheClusterInput { - s.SnapshotRetentionLimit = &v - return s -} - -// SetSnapshotWindow sets the SnapshotWindow field's value. -func (s *ModifyCacheClusterInput) SetSnapshotWindow(v string) *ModifyCacheClusterInput { - s.SnapshotWindow = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheClusterResult -type ModifyCacheClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains all of the attributes of a specific cache cluster. - CacheCluster *CacheCluster `type:"structure"` -} - -// String returns the string representation -func (s ModifyCacheClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyCacheClusterOutput) GoString() string { - return s.String() -} - -// SetCacheCluster sets the CacheCluster field's value. -func (s *ModifyCacheClusterOutput) SetCacheCluster(v *CacheCluster) *ModifyCacheClusterOutput { - s.CacheCluster = v - return s -} - -// Represents the input of a ModifyCacheParameterGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheParameterGroupMessage -type ModifyCacheParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cache parameter group to modify. - // - // CacheParameterGroupName is a required field - CacheParameterGroupName *string `type:"string" required:"true"` - - // An array of parameter names and values for the parameter update. You must - // supply at least one parameter name and value; subsequent arguments are optional. - // A maximum of 20 parameters may be modified per request. - // - // ParameterNameValues is a required field - ParameterNameValues []*ParameterNameValue `locationNameList:"ParameterNameValue" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyCacheParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyCacheParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyCacheParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyCacheParameterGroupInput"} - if s.CacheParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName")) - } - if s.ParameterNameValues == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterNameValues")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *ModifyCacheParameterGroupInput) SetCacheParameterGroupName(v string) *ModifyCacheParameterGroupInput { - s.CacheParameterGroupName = &v - return s -} - -// SetParameterNameValues sets the ParameterNameValues field's value. -func (s *ModifyCacheParameterGroupInput) SetParameterNameValues(v []*ParameterNameValue) *ModifyCacheParameterGroupInput { - s.ParameterNameValues = v - return s -} - -// Represents the input of a ModifyCacheSubnetGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheSubnetGroupMessage -type ModifyCacheSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // A description of the cache subnet group. - CacheSubnetGroupDescription *string `type:"string"` - - // The name for the cache subnet group. This value is stored as a lowercase - // string. - // - // Constraints: Must contain no more than 255 alphanumeric characters or hyphens. - // - // Example: mysubnetgroup - // - // CacheSubnetGroupName is a required field - CacheSubnetGroupName *string `type:"string" required:"true"` - - // The EC2 subnet IDs for the cache subnet group. - SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list"` -} - -// String returns the string representation -func (s ModifyCacheSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyCacheSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyCacheSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyCacheSubnetGroupInput"} - if s.CacheSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheSubnetGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheSubnetGroupDescription sets the CacheSubnetGroupDescription field's value. -func (s *ModifyCacheSubnetGroupInput) SetCacheSubnetGroupDescription(v string) *ModifyCacheSubnetGroupInput { - s.CacheSubnetGroupDescription = &v - return s -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *ModifyCacheSubnetGroupInput) SetCacheSubnetGroupName(v string) *ModifyCacheSubnetGroupInput { - s.CacheSubnetGroupName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *ModifyCacheSubnetGroupInput) SetSubnetIds(v []*string) *ModifyCacheSubnetGroupInput { - s.SubnetIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheSubnetGroupResult -type ModifyCacheSubnetGroupOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of one of the following operations: - // - // * CreateCacheSubnetGroup - // - // * ModifyCacheSubnetGroup - CacheSubnetGroup *CacheSubnetGroup `type:"structure"` -} - -// String returns the string representation -func (s ModifyCacheSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyCacheSubnetGroupOutput) GoString() string { - return s.String() -} - -// SetCacheSubnetGroup sets the CacheSubnetGroup field's value. -func (s *ModifyCacheSubnetGroupOutput) SetCacheSubnetGroup(v *CacheSubnetGroup) *ModifyCacheSubnetGroupOutput { - s.CacheSubnetGroup = v - return s -} - -// Represents the input of a ModifyReplicationGroups operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroupMessage -type ModifyReplicationGroupInput struct { - _ struct{} `type:"structure"` - - // If true, this parameter causes the modifications in this request and any - // pending modifications to be applied, asynchronously and as soon as possible, - // regardless of the PreferredMaintenanceWindow setting for the replication - // group. - // - // If false, changes to the nodes in the replication group are applied on the - // next maintenance reboot, or the next failure reboot, whichever occurs first. - // - // Valid values: true | false - // - // Default: false - ApplyImmediately *bool `type:"boolean"` - - // This parameter is currently disabled. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // Determines whether a read replica is automatically promoted to read/write - // primary if the existing primary encounters a failure. - // - // Valid values: true | false - // - // ElastiCache Multi-AZ replication groups are not supported on: - // - // Redis versions earlier than 2.8.6. - // - // Redis (cluster mode disabled):T1 and T2 cache node types. - // - // Redis (cluster mode enabled): T1 node types. - AutomaticFailoverEnabled *bool `type:"boolean"` - - // A valid cache node type that you want to scale this replication group to. - CacheNodeType *string `type:"string"` - - // The name of the cache parameter group to apply to all of the clusters in - // this replication group. This change is asynchronously applied as soon as - // possible for parameters when the ApplyImmediately parameter is specified - // as true for this request. - CacheParameterGroupName *string `type:"string"` - - // A list of cache security group names to authorize for the clusters in this - // replication group. This change is asynchronously applied as soon as possible. - // - // This parameter can be used only with replication group containing cache clusters - // running outside of an Amazon Virtual Private Cloud (Amazon VPC). - // - // Constraints: Must contain no more than 255 alphanumeric characters. Must - // not be Default. - CacheSecurityGroupNames []*string `locationNameList:"CacheSecurityGroupName" type:"list"` - - // The upgraded version of the cache engine to be run on the cache clusters - // in the replication group. - // - // Important: You can upgrade to a newer engine version (see Selecting a Cache - // Engine and Version (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/SelectEngine.html#VersionManagement)), - // but you cannot downgrade to an earlier engine version. If you want to use - // an earlier engine version, you must delete the existing replication group - // and create it anew with the earlier engine version. - EngineVersion *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications - // are sent. - // - // The Amazon SNS topic owner must be same as the replication group owner. - NotificationTopicArn *string `type:"string"` - - // The status of the Amazon SNS notification topic for the replication group. - // Notifications are sent only if the status is active. - // - // Valid values: active | inactive - NotificationTopicStatus *string `type:"string"` - - // Specifies the weekly time range during which maintenance on the cluster is - // performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi - // (24H Clock UTC). The minimum maintenance window is a 60 minute period. - // - // Valid values for ddd are: - // - // * sun - // - // * mon - // - // * tue - // - // * wed - // - // * thu - // - // * fri - // - // * sat - // - // Example: sun:23:00-mon:01:30 - PreferredMaintenanceWindow *string `type:"string"` - - // For replication groups with a single primary, if this parameter is specified, - // ElastiCache promotes the specified cluster in the specified replication group - // to the primary role. The nodes of all other clusters in the replication group - // are read replicas. - PrimaryClusterId *string `type:"string"` - - // A description for the replication group. Maximum length is 255 characters. - ReplicationGroupDescription *string `type:"string"` - - // The identifier of the replication group to modify. - // - // ReplicationGroupId is a required field - ReplicationGroupId *string `type:"string" required:"true"` - - // Specifies the VPC Security Groups associated with the cache clusters in the - // replication group. - // - // This parameter can be used only with replication group containing cache clusters - // running in an Amazon Virtual Private Cloud (Amazon VPC). - SecurityGroupIds []*string `locationNameList:"SecurityGroupId" type:"list"` - - // The number of days for which ElastiCache retains automatic node group (shard) - // snapshots before deleting them. For example, if you set SnapshotRetentionLimit - // to 5, a snapshot that was taken today is retained for 5 days before being - // deleted. - // - // Important If the value of SnapshotRetentionLimit is set to zero (0), backups - // are turned off. - SnapshotRetentionLimit *int64 `type:"integer"` - - // The daily time range (in UTC) during which ElastiCache begins taking a daily - // snapshot of the node group (shard) specified by SnapshottingClusterId. - // - // Example: 05:00-09:00 - // - // If you do not specify this parameter, ElastiCache automatically chooses an - // appropriate time range. - SnapshotWindow *string `type:"string"` - - // The cache cluster ID that is used as the daily snapshot source for the replication - // group. This parameter cannot be set for Redis (cluster mode enabled) replication - // groups. - SnapshottingClusterId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyReplicationGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReplicationGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyReplicationGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyReplicationGroupInput"} - if s.ReplicationGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationGroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyImmediately sets the ApplyImmediately field's value. -func (s *ModifyReplicationGroupInput) SetApplyImmediately(v bool) *ModifyReplicationGroupInput { - s.ApplyImmediately = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *ModifyReplicationGroupInput) SetAutoMinorVersionUpgrade(v bool) *ModifyReplicationGroupInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAutomaticFailoverEnabled sets the AutomaticFailoverEnabled field's value. -func (s *ModifyReplicationGroupInput) SetAutomaticFailoverEnabled(v bool) *ModifyReplicationGroupInput { - s.AutomaticFailoverEnabled = &v - return s -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *ModifyReplicationGroupInput) SetCacheNodeType(v string) *ModifyReplicationGroupInput { - s.CacheNodeType = &v - return s -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *ModifyReplicationGroupInput) SetCacheParameterGroupName(v string) *ModifyReplicationGroupInput { - s.CacheParameterGroupName = &v - return s -} - -// SetCacheSecurityGroupNames sets the CacheSecurityGroupNames field's value. -func (s *ModifyReplicationGroupInput) SetCacheSecurityGroupNames(v []*string) *ModifyReplicationGroupInput { - s.CacheSecurityGroupNames = v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *ModifyReplicationGroupInput) SetEngineVersion(v string) *ModifyReplicationGroupInput { - s.EngineVersion = &v - return s -} - -// SetNotificationTopicArn sets the NotificationTopicArn field's value. -func (s *ModifyReplicationGroupInput) SetNotificationTopicArn(v string) *ModifyReplicationGroupInput { - s.NotificationTopicArn = &v - return s -} - -// SetNotificationTopicStatus sets the NotificationTopicStatus field's value. -func (s *ModifyReplicationGroupInput) SetNotificationTopicStatus(v string) *ModifyReplicationGroupInput { - s.NotificationTopicStatus = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *ModifyReplicationGroupInput) SetPreferredMaintenanceWindow(v string) *ModifyReplicationGroupInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPrimaryClusterId sets the PrimaryClusterId field's value. -func (s *ModifyReplicationGroupInput) SetPrimaryClusterId(v string) *ModifyReplicationGroupInput { - s.PrimaryClusterId = &v - return s -} - -// SetReplicationGroupDescription sets the ReplicationGroupDescription field's value. -func (s *ModifyReplicationGroupInput) SetReplicationGroupDescription(v string) *ModifyReplicationGroupInput { - s.ReplicationGroupDescription = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *ModifyReplicationGroupInput) SetReplicationGroupId(v string) *ModifyReplicationGroupInput { - s.ReplicationGroupId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ModifyReplicationGroupInput) SetSecurityGroupIds(v []*string) *ModifyReplicationGroupInput { - s.SecurityGroupIds = v - return s -} - -// SetSnapshotRetentionLimit sets the SnapshotRetentionLimit field's value. -func (s *ModifyReplicationGroupInput) SetSnapshotRetentionLimit(v int64) *ModifyReplicationGroupInput { - s.SnapshotRetentionLimit = &v - return s -} - -// SetSnapshotWindow sets the SnapshotWindow field's value. -func (s *ModifyReplicationGroupInput) SetSnapshotWindow(v string) *ModifyReplicationGroupInput { - s.SnapshotWindow = &v - return s -} - -// SetSnapshottingClusterId sets the SnapshottingClusterId field's value. -func (s *ModifyReplicationGroupInput) SetSnapshottingClusterId(v string) *ModifyReplicationGroupInput { - s.SnapshottingClusterId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroupResult -type ModifyReplicationGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains all of the attributes of a specific Redis replication group. - ReplicationGroup *ReplicationGroup `type:"structure"` -} - -// String returns the string representation -func (s ModifyReplicationGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReplicationGroupOutput) GoString() string { - return s.String() -} - -// SetReplicationGroup sets the ReplicationGroup field's value. -func (s *ModifyReplicationGroupOutput) SetReplicationGroup(v *ReplicationGroup) *ModifyReplicationGroupOutput { - s.ReplicationGroup = v - return s -} - -// Represents a collection of cache nodes in a replication group. One node in -// the node group is the read/write primary node. All the other nodes are read-only -// Replica nodes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/NodeGroup -type NodeGroup struct { - _ struct{} `type:"structure"` - - // The identifier for the node group (shard). A Redis (cluster mode disabled) - // replication group contains only 1 node group; therefore, the node group ID - // is 0001. A Redis (cluster mode enabled) replication group contains 1 to 15 - // node groups numbered 0001 to 0015. - NodeGroupId *string `type:"string"` - - // A list containing information about individual nodes within the node group - // (shard). - NodeGroupMembers []*NodeGroupMember `locationNameList:"NodeGroupMember" type:"list"` - - // The endpoint of the primary node in this node group (shard). - PrimaryEndpoint *Endpoint `type:"structure"` - - // The keyspace for this node group (shard). - Slots *string `type:"string"` - - // The current state of this replication group - creating, available, etc. - Status *string `type:"string"` -} - -// String returns the string representation -func (s NodeGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NodeGroup) GoString() string { - return s.String() -} - -// SetNodeGroupId sets the NodeGroupId field's value. -func (s *NodeGroup) SetNodeGroupId(v string) *NodeGroup { - s.NodeGroupId = &v - return s -} - -// SetNodeGroupMembers sets the NodeGroupMembers field's value. -func (s *NodeGroup) SetNodeGroupMembers(v []*NodeGroupMember) *NodeGroup { - s.NodeGroupMembers = v - return s -} - -// SetPrimaryEndpoint sets the PrimaryEndpoint field's value. -func (s *NodeGroup) SetPrimaryEndpoint(v *Endpoint) *NodeGroup { - s.PrimaryEndpoint = v - return s -} - -// SetSlots sets the Slots field's value. -func (s *NodeGroup) SetSlots(v string) *NodeGroup { - s.Slots = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *NodeGroup) SetStatus(v string) *NodeGroup { - s.Status = &v - return s -} - -// node group (shard) configuration options. Each node group (shard) configuration -// has the following: Slots, PrimaryAvailabilityZone, ReplicaAvailabilityZones, -// ReplicaCount. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/NodeGroupConfiguration -type NodeGroupConfiguration struct { - _ struct{} `type:"structure"` - - // The Availability Zone where the primary node of this node group (shard) is - // launched. - PrimaryAvailabilityZone *string `type:"string"` - - // A list of Availability Zones to be used for the read replicas. The number - // of Availability Zones in this list must match the value of ReplicaCount or - // ReplicasPerNodeGroup if not specified. - ReplicaAvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - - // The number of read replica nodes in this node group (shard). - ReplicaCount *int64 `type:"integer"` - - // A string that specifies the keyspaces as a series of comma separated values. - // Keyspaces are 0 to 16,383. The string is in the format startkey-endkey. - // - // Example: "0-3999" - Slots *string `type:"string"` -} - -// String returns the string representation -func (s NodeGroupConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NodeGroupConfiguration) GoString() string { - return s.String() -} - -// SetPrimaryAvailabilityZone sets the PrimaryAvailabilityZone field's value. -func (s *NodeGroupConfiguration) SetPrimaryAvailabilityZone(v string) *NodeGroupConfiguration { - s.PrimaryAvailabilityZone = &v - return s -} - -// SetReplicaAvailabilityZones sets the ReplicaAvailabilityZones field's value. -func (s *NodeGroupConfiguration) SetReplicaAvailabilityZones(v []*string) *NodeGroupConfiguration { - s.ReplicaAvailabilityZones = v - return s -} - -// SetReplicaCount sets the ReplicaCount field's value. -func (s *NodeGroupConfiguration) SetReplicaCount(v int64) *NodeGroupConfiguration { - s.ReplicaCount = &v - return s -} - -// SetSlots sets the Slots field's value. -func (s *NodeGroupConfiguration) SetSlots(v string) *NodeGroupConfiguration { - s.Slots = &v - return s -} - -// Represents a single node within a node group (shard). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/NodeGroupMember -type NodeGroupMember struct { - _ struct{} `type:"structure"` - - // The ID of the cache cluster to which the node belongs. - CacheClusterId *string `type:"string"` - - // The ID of the node within its cache cluster. A node ID is a numeric identifier - // (0001, 0002, etc.). - CacheNodeId *string `type:"string"` - - // The role that is currently assigned to the node - primary or replica. - CurrentRole *string `type:"string"` - - // The name of the Availability Zone in which the node is located. - PreferredAvailabilityZone *string `type:"string"` - - // Represents the information required for client programs to connect to a cache - // node. - ReadEndpoint *Endpoint `type:"structure"` -} - -// String returns the string representation -func (s NodeGroupMember) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NodeGroupMember) GoString() string { - return s.String() -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *NodeGroupMember) SetCacheClusterId(v string) *NodeGroupMember { - s.CacheClusterId = &v - return s -} - -// SetCacheNodeId sets the CacheNodeId field's value. -func (s *NodeGroupMember) SetCacheNodeId(v string) *NodeGroupMember { - s.CacheNodeId = &v - return s -} - -// SetCurrentRole sets the CurrentRole field's value. -func (s *NodeGroupMember) SetCurrentRole(v string) *NodeGroupMember { - s.CurrentRole = &v - return s -} - -// SetPreferredAvailabilityZone sets the PreferredAvailabilityZone field's value. -func (s *NodeGroupMember) SetPreferredAvailabilityZone(v string) *NodeGroupMember { - s.PreferredAvailabilityZone = &v - return s -} - -// SetReadEndpoint sets the ReadEndpoint field's value. -func (s *NodeGroupMember) SetReadEndpoint(v *Endpoint) *NodeGroupMember { - s.ReadEndpoint = v - return s -} - -// Represents an individual cache node in a snapshot of a cache cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/NodeSnapshot -type NodeSnapshot struct { - _ struct{} `type:"structure"` - - // A unique identifier for the source cache cluster. - CacheClusterId *string `type:"string"` - - // The date and time when the cache node was created in the source cache cluster. - CacheNodeCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The cache node identifier for the node in the source cache cluster. - CacheNodeId *string `type:"string"` - - // The size of the cache on the source cache node. - CacheSize *string `type:"string"` - - // The configuration for the source node group (shard). - NodeGroupConfiguration *NodeGroupConfiguration `type:"structure"` - - // A unique identifier for the source node group (shard). - NodeGroupId *string `type:"string"` - - // The date and time when the source node's metadata and cache data set was - // obtained for the snapshot. - SnapshotCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s NodeSnapshot) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NodeSnapshot) GoString() string { - return s.String() -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *NodeSnapshot) SetCacheClusterId(v string) *NodeSnapshot { - s.CacheClusterId = &v - return s -} - -// SetCacheNodeCreateTime sets the CacheNodeCreateTime field's value. -func (s *NodeSnapshot) SetCacheNodeCreateTime(v time.Time) *NodeSnapshot { - s.CacheNodeCreateTime = &v - return s -} - -// SetCacheNodeId sets the CacheNodeId field's value. -func (s *NodeSnapshot) SetCacheNodeId(v string) *NodeSnapshot { - s.CacheNodeId = &v - return s -} - -// SetCacheSize sets the CacheSize field's value. -func (s *NodeSnapshot) SetCacheSize(v string) *NodeSnapshot { - s.CacheSize = &v - return s -} - -// SetNodeGroupConfiguration sets the NodeGroupConfiguration field's value. -func (s *NodeSnapshot) SetNodeGroupConfiguration(v *NodeGroupConfiguration) *NodeSnapshot { - s.NodeGroupConfiguration = v - return s -} - -// SetNodeGroupId sets the NodeGroupId field's value. -func (s *NodeSnapshot) SetNodeGroupId(v string) *NodeSnapshot { - s.NodeGroupId = &v - return s -} - -// SetSnapshotCreateTime sets the SnapshotCreateTime field's value. -func (s *NodeSnapshot) SetSnapshotCreateTime(v time.Time) *NodeSnapshot { - s.SnapshotCreateTime = &v - return s -} - -// Describes a notification topic and its status. Notification topics are used -// for publishing ElastiCache events to subscribers using Amazon Simple Notification -// Service (SNS). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/NotificationConfiguration -type NotificationConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that identifies the topic. - TopicArn *string `type:"string"` - - // The current state of the topic. - TopicStatus *string `type:"string"` -} - -// 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() -} - -// SetTopicArn sets the TopicArn field's value. -func (s *NotificationConfiguration) SetTopicArn(v string) *NotificationConfiguration { - s.TopicArn = &v - return s -} - -// SetTopicStatus sets the TopicStatus field's value. -func (s *NotificationConfiguration) SetTopicStatus(v string) *NotificationConfiguration { - s.TopicStatus = &v - return s -} - -// Describes an individual setting that controls some aspect of ElastiCache -// behavior. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/Parameter -type Parameter struct { - _ struct{} `type:"structure"` - - // The valid range of values for the parameter. - AllowedValues *string `type:"string"` - - // Indicates whether a change to the parameter is applied immediately or requires - // a reboot for the change to be applied. You can force a reboot or wait until - // the next maintenance window's reboot. For more information, see Rebooting - // a Cluster (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Clusters.Rebooting.html). - ChangeType *string `type:"string" enum:"ChangeType"` - - // The valid data type for the parameter. - DataType *string `type:"string"` - - // A description of the parameter. - Description *string `type:"string"` - - // Indicates whether (true) or not (false) the parameter can be modified. Some - // parameters have security or operational implications that prevent them from - // being changed. - IsModifiable *bool `type:"boolean"` - - // The earliest cache engine version to which the parameter can apply. - MinimumEngineVersion *string `type:"string"` - - // The name of the parameter. - ParameterName *string `type:"string"` - - // The value of the parameter. - ParameterValue *string `type:"string"` - - // The source of the parameter. - Source *string `type:"string"` -} - -// String returns the string representation -func (s Parameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Parameter) GoString() string { - return s.String() -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *Parameter) SetAllowedValues(v string) *Parameter { - s.AllowedValues = &v - return s -} - -// SetChangeType sets the ChangeType field's value. -func (s *Parameter) SetChangeType(v string) *Parameter { - s.ChangeType = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *Parameter) SetDataType(v string) *Parameter { - s.DataType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Parameter) SetDescription(v string) *Parameter { - s.Description = &v - return s -} - -// SetIsModifiable sets the IsModifiable field's value. -func (s *Parameter) SetIsModifiable(v bool) *Parameter { - s.IsModifiable = &v - return s -} - -// SetMinimumEngineVersion sets the MinimumEngineVersion field's value. -func (s *Parameter) SetMinimumEngineVersion(v string) *Parameter { - s.MinimumEngineVersion = &v - return s -} - -// SetParameterName sets the ParameterName field's value. -func (s *Parameter) SetParameterName(v string) *Parameter { - s.ParameterName = &v - return s -} - -// SetParameterValue sets the ParameterValue field's value. -func (s *Parameter) SetParameterValue(v string) *Parameter { - s.ParameterValue = &v - return s -} - -// SetSource sets the Source field's value. -func (s *Parameter) SetSource(v string) *Parameter { - s.Source = &v - return s -} - -// Describes a name-value pair that is used to update the value of a parameter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ParameterNameValue -type ParameterNameValue struct { - _ struct{} `type:"structure"` - - // The name of the parameter. - ParameterName *string `type:"string"` - - // The value of the parameter. - ParameterValue *string `type:"string"` -} - -// String returns the string representation -func (s ParameterNameValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ParameterNameValue) GoString() string { - return s.String() -} - -// SetParameterName sets the ParameterName field's value. -func (s *ParameterNameValue) SetParameterName(v string) *ParameterNameValue { - s.ParameterName = &v - return s -} - -// SetParameterValue sets the ParameterValue field's value. -func (s *ParameterNameValue) SetParameterValue(v string) *ParameterNameValue { - s.ParameterValue = &v - return s -} - -// A group of settings that are applied to the cache cluster in the future, -// or that are currently being applied. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/PendingModifiedValues -type PendingModifiedValues struct { - _ struct{} `type:"structure"` - - // A list of cache node IDs that are being removed (or will be removed) from - // the cache cluster. A node ID is a numeric identifier (0001, 0002, etc.). - CacheNodeIdsToRemove []*string `locationNameList:"CacheNodeId" type:"list"` - - // The cache node type that this cache cluster or replication group is scaled - // to. - CacheNodeType *string `type:"string"` - - // The new cache engine version that the cache cluster runs. - EngineVersion *string `type:"string"` - - // The new number of cache nodes for the cache cluster. - // - // For clusters running Redis, this value must be 1. For clusters running Memcached, - // this value must be between 1 and 20. - NumCacheNodes *int64 `type:"integer"` -} - -// String returns the string representation -func (s PendingModifiedValues) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PendingModifiedValues) GoString() string { - return s.String() -} - -// SetCacheNodeIdsToRemove sets the CacheNodeIdsToRemove field's value. -func (s *PendingModifiedValues) SetCacheNodeIdsToRemove(v []*string) *PendingModifiedValues { - s.CacheNodeIdsToRemove = v - return s -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *PendingModifiedValues) SetCacheNodeType(v string) *PendingModifiedValues { - s.CacheNodeType = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *PendingModifiedValues) SetEngineVersion(v string) *PendingModifiedValues { - s.EngineVersion = &v - return s -} - -// SetNumCacheNodes sets the NumCacheNodes field's value. -func (s *PendingModifiedValues) SetNumCacheNodes(v int64) *PendingModifiedValues { - s.NumCacheNodes = &v - return s -} - -// Represents the input of a PurchaseReservedCacheNodesOffering operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/PurchaseReservedCacheNodesOfferingMessage -type PurchaseReservedCacheNodesOfferingInput struct { - _ struct{} `type:"structure"` - - // The number of cache node instances to reserve. - // - // Default: 1 - CacheNodeCount *int64 `type:"integer"` - - // A customer-specified identifier to track this reservation. - // - // The Reserved Cache Node ID is an unique customer-specified identifier to - // track this reservation. If this parameter is not specified, ElastiCache automatically - // generates an identifier for the reservation. - // - // Example: myreservationID - ReservedCacheNodeId *string `type:"string"` - - // The ID of the reserved cache node offering to purchase. - // - // Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706 - // - // ReservedCacheNodesOfferingId is a required field - ReservedCacheNodesOfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseReservedCacheNodesOfferingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedCacheNodesOfferingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseReservedCacheNodesOfferingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseReservedCacheNodesOfferingInput"} - if s.ReservedCacheNodesOfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedCacheNodesOfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheNodeCount sets the CacheNodeCount field's value. -func (s *PurchaseReservedCacheNodesOfferingInput) SetCacheNodeCount(v int64) *PurchaseReservedCacheNodesOfferingInput { - s.CacheNodeCount = &v - return s -} - -// SetReservedCacheNodeId sets the ReservedCacheNodeId field's value. -func (s *PurchaseReservedCacheNodesOfferingInput) SetReservedCacheNodeId(v string) *PurchaseReservedCacheNodesOfferingInput { - s.ReservedCacheNodeId = &v - return s -} - -// SetReservedCacheNodesOfferingId sets the ReservedCacheNodesOfferingId field's value. -func (s *PurchaseReservedCacheNodesOfferingInput) SetReservedCacheNodesOfferingId(v string) *PurchaseReservedCacheNodesOfferingInput { - s.ReservedCacheNodesOfferingId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/PurchaseReservedCacheNodesOfferingResult -type PurchaseReservedCacheNodesOfferingOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of a PurchaseReservedCacheNodesOffering operation. - ReservedCacheNode *ReservedCacheNode `type:"structure"` -} - -// String returns the string representation -func (s PurchaseReservedCacheNodesOfferingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedCacheNodesOfferingOutput) GoString() string { - return s.String() -} - -// SetReservedCacheNode sets the ReservedCacheNode field's value. -func (s *PurchaseReservedCacheNodesOfferingOutput) SetReservedCacheNode(v *ReservedCacheNode) *PurchaseReservedCacheNodesOfferingOutput { - s.ReservedCacheNode = v - return s -} - -// Represents the input of a RebootCacheCluster operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RebootCacheClusterMessage -type RebootCacheClusterInput struct { - _ struct{} `type:"structure"` - - // The cache cluster identifier. This parameter is stored as a lowercase string. - // - // CacheClusterId is a required field - CacheClusterId *string `type:"string" required:"true"` - - // A list of cache node IDs to reboot. A node ID is a numeric identifier (0001, - // 0002, etc.). To reboot an entire cache cluster, specify all of the cache - // node IDs. - // - // CacheNodeIdsToReboot is a required field - CacheNodeIdsToReboot []*string `locationNameList:"CacheNodeId" type:"list" required:"true"` -} - -// String returns the string representation -func (s RebootCacheClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootCacheClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootCacheClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootCacheClusterInput"} - if s.CacheClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("CacheClusterId")) - } - if s.CacheNodeIdsToReboot == nil { - invalidParams.Add(request.NewErrParamRequired("CacheNodeIdsToReboot")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *RebootCacheClusterInput) SetCacheClusterId(v string) *RebootCacheClusterInput { - s.CacheClusterId = &v - return s -} - -// SetCacheNodeIdsToReboot sets the CacheNodeIdsToReboot field's value. -func (s *RebootCacheClusterInput) SetCacheNodeIdsToReboot(v []*string) *RebootCacheClusterInput { - s.CacheNodeIdsToReboot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RebootCacheClusterResult -type RebootCacheClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains all of the attributes of a specific cache cluster. - CacheCluster *CacheCluster `type:"structure"` -} - -// String returns the string representation -func (s RebootCacheClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootCacheClusterOutput) GoString() string { - return s.String() -} - -// SetCacheCluster sets the CacheCluster field's value. -func (s *RebootCacheClusterOutput) SetCacheCluster(v *CacheCluster) *RebootCacheClusterOutput { - s.CacheCluster = v - return s -} - -// Contains the specific price and frequency of a recurring charges for a reserved -// cache node, or for a reserved cache node offering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RecurringCharge -type RecurringCharge struct { - _ struct{} `type:"structure"` - - // The monetary amount of the recurring charge. - RecurringChargeAmount *float64 `type:"double"` - - // The frequency of the recurring charge. - RecurringChargeFrequency *string `type:"string"` -} - -// 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() -} - -// SetRecurringChargeAmount sets the RecurringChargeAmount field's value. -func (s *RecurringCharge) SetRecurringChargeAmount(v float64) *RecurringCharge { - s.RecurringChargeAmount = &v - return s -} - -// SetRecurringChargeFrequency sets the RecurringChargeFrequency field's value. -func (s *RecurringCharge) SetRecurringChargeFrequency(v string) *RecurringCharge { - s.RecurringChargeFrequency = &v - return s -} - -// Represents the input of a RemoveTagsFromResource operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RemoveTagsFromResourceMessage -type RemoveTagsFromResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource from which you want the tags - // removed, for example arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster - // or arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // ResourceName is a required field - ResourceName *string `type:"string" required:"true"` - - // A list of TagKeys identifying the tags you want removed from the named resource. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromResourceInput"} - if s.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceName sets the ResourceName field's value. -func (s *RemoveTagsFromResourceInput) SetResourceName(v string) *RemoveTagsFromResourceInput { - s.ResourceName = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsFromResourceInput) SetTagKeys(v []*string) *RemoveTagsFromResourceInput { - s.TagKeys = v - return s -} - -// Contains all of the attributes of a specific Redis replication group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ReplicationGroup -type ReplicationGroup struct { - _ struct{} `type:"structure"` - - // Indicates the status of Multi-AZ for this replication group. - // - // ElastiCache Multi-AZ replication groups are not supported on: - // - // Redis versions earlier than 2.8.6. - // - // Redis (cluster mode disabled):T1 and T2 cache node types. - // - // Redis (cluster mode enabled): T1 node types. - AutomaticFailover *string `type:"string" enum:"AutomaticFailoverStatus"` - - // The configuration endpoint for this replicaiton group. Use the configuration - // endpoint to connect to this replication group. - ConfigurationEndpoint *Endpoint `type:"structure"` - - // The description of the replication group. - Description *string `type:"string"` - - // The names of all the cache clusters that are part of this replication group. - MemberClusters []*string `locationNameList:"ClusterId" type:"list"` - - // A single element list with information about the nodes in the replication - // group. - NodeGroups []*NodeGroup `locationNameList:"NodeGroup" type:"list"` - - // A group of settings to be applied to the replication group, either immediately - // or during the next maintenance window. - PendingModifiedValues *ReplicationGroupPendingModifiedValues `type:"structure"` - - // The identifier for the replication group. - ReplicationGroupId *string `type:"string"` - - // The number of days for which ElastiCache retains automatic cache cluster - // snapshots before deleting them. For example, if you set SnapshotRetentionLimit - // to 5, a snapshot that was taken today is retained for 5 days before being - // deleted. - // - // If the value of SnapshotRetentionLimit is set to zero (0), backups are turned - // off. - SnapshotRetentionLimit *int64 `type:"integer"` - - // The daily time range (in UTC) during which ElastiCache begins taking a daily - // snapshot of your node group (shard). - // - // Example: 05:00-09:00 - // - // If you do not specify this parameter, ElastiCache automatically chooses an - // appropriate time range. - // - // Note: This parameter is only valid if the Engine parameter is redis. - SnapshotWindow *string `type:"string"` - - // The cache cluster ID that is used as the daily snapshot source for the replication - // group. - SnapshottingClusterId *string `type:"string"` - - // The current state of this replication group - creating, available, modifying, - // deleting, create-failed, snapshotting. - Status *string `type:"string"` -} - -// String returns the string representation -func (s ReplicationGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationGroup) GoString() string { - return s.String() -} - -// SetAutomaticFailover sets the AutomaticFailover field's value. -func (s *ReplicationGroup) SetAutomaticFailover(v string) *ReplicationGroup { - s.AutomaticFailover = &v - return s -} - -// SetConfigurationEndpoint sets the ConfigurationEndpoint field's value. -func (s *ReplicationGroup) SetConfigurationEndpoint(v *Endpoint) *ReplicationGroup { - s.ConfigurationEndpoint = v - return s -} - -// SetDescription sets the Description field's value. -func (s *ReplicationGroup) SetDescription(v string) *ReplicationGroup { - s.Description = &v - return s -} - -// SetMemberClusters sets the MemberClusters field's value. -func (s *ReplicationGroup) SetMemberClusters(v []*string) *ReplicationGroup { - s.MemberClusters = v - return s -} - -// SetNodeGroups sets the NodeGroups field's value. -func (s *ReplicationGroup) SetNodeGroups(v []*NodeGroup) *ReplicationGroup { - s.NodeGroups = v - return s -} - -// SetPendingModifiedValues sets the PendingModifiedValues field's value. -func (s *ReplicationGroup) SetPendingModifiedValues(v *ReplicationGroupPendingModifiedValues) *ReplicationGroup { - s.PendingModifiedValues = v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *ReplicationGroup) SetReplicationGroupId(v string) *ReplicationGroup { - s.ReplicationGroupId = &v - return s -} - -// SetSnapshotRetentionLimit sets the SnapshotRetentionLimit field's value. -func (s *ReplicationGroup) SetSnapshotRetentionLimit(v int64) *ReplicationGroup { - s.SnapshotRetentionLimit = &v - return s -} - -// SetSnapshotWindow sets the SnapshotWindow field's value. -func (s *ReplicationGroup) SetSnapshotWindow(v string) *ReplicationGroup { - s.SnapshotWindow = &v - return s -} - -// SetSnapshottingClusterId sets the SnapshottingClusterId field's value. -func (s *ReplicationGroup) SetSnapshottingClusterId(v string) *ReplicationGroup { - s.SnapshottingClusterId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReplicationGroup) SetStatus(v string) *ReplicationGroup { - s.Status = &v - return s -} - -// The settings to be applied to the Redis replication group, either immediately -// or during the next maintenance window. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ReplicationGroupPendingModifiedValues -type ReplicationGroupPendingModifiedValues struct { - _ struct{} `type:"structure"` - - // Indicates the status of Multi-AZ for this Redis replication group. - // - // ElastiCache Multi-AZ replication groups are not supported on: - // - // Redis versions earlier than 2.8.6. - // - // Redis (cluster mode disabled):T1 and T2 cache node types. - // - // Redis (cluster mode enabled): T1 node types. - AutomaticFailoverStatus *string `type:"string" enum:"PendingAutomaticFailoverStatus"` - - // The primary cluster ID that is applied immediately (if --apply-immediately - // was specified), or during the next maintenance window. - PrimaryClusterId *string `type:"string"` -} - -// String returns the string representation -func (s ReplicationGroupPendingModifiedValues) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationGroupPendingModifiedValues) GoString() string { - return s.String() -} - -// SetAutomaticFailoverStatus sets the AutomaticFailoverStatus field's value. -func (s *ReplicationGroupPendingModifiedValues) SetAutomaticFailoverStatus(v string) *ReplicationGroupPendingModifiedValues { - s.AutomaticFailoverStatus = &v - return s -} - -// SetPrimaryClusterId sets the PrimaryClusterId field's value. -func (s *ReplicationGroupPendingModifiedValues) SetPrimaryClusterId(v string) *ReplicationGroupPendingModifiedValues { - s.PrimaryClusterId = &v - return s -} - -// Represents the output of a PurchaseReservedCacheNodesOffering operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ReservedCacheNode -type ReservedCacheNode struct { - _ struct{} `type:"structure"` - - // The number of cache nodes that have been reserved. - CacheNodeCount *int64 `type:"integer"` - - // The cache node type for the reserved cache nodes. - // - // Valid node types are as follows: - // - // * General purpose: - // - // Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, - // cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge - // - // Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, - // cache.m1.xlarge - // - // * Compute optimized: cache.c1.xlarge - // - // * Memory optimized: - // - // Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, - // cache.r3.8xlarge - // - // Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge - // - // Notes: - // - // * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon - // VPC). - // - // * Redis backup/restore is not supported for Redis (cluster mode disabled) - // T1 and T2 instances. Backup/restore is supported on Redis (cluster mode - // enabled) T2 instances. - // - // * Redis Append-only files (AOF) functionality is not supported for T1 - // or T2 instances. - // - // For a complete listing of node types and specifications, see Amazon ElastiCache - // Product Features and Details (http://aws.amazon.com/elasticache/details) - // and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) - // or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). - CacheNodeType *string `type:"string"` - - // The duration of the reservation in seconds. - Duration *int64 `type:"integer"` - - // The fixed price charged for this reserved cache node. - FixedPrice *float64 `type:"double"` - - // The offering type of this reserved cache node. - OfferingType *string `type:"string"` - - // The description of the reserved cache node. - ProductDescription *string `type:"string"` - - // The recurring price charged to run this reserved cache node. - RecurringCharges []*RecurringCharge `locationNameList:"RecurringCharge" type:"list"` - - // The unique identifier for the reservation. - ReservedCacheNodeId *string `type:"string"` - - // The offering identifier. - ReservedCacheNodesOfferingId *string `type:"string"` - - // The time the reservation started. - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The state of the reserved cache node. - State *string `type:"string"` - - // The hourly price charged for this reserved cache node. - UsagePrice *float64 `type:"double"` -} - -// String returns the string representation -func (s ReservedCacheNode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedCacheNode) GoString() string { - return s.String() -} - -// SetCacheNodeCount sets the CacheNodeCount field's value. -func (s *ReservedCacheNode) SetCacheNodeCount(v int64) *ReservedCacheNode { - s.CacheNodeCount = &v - return s -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *ReservedCacheNode) SetCacheNodeType(v string) *ReservedCacheNode { - s.CacheNodeType = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedCacheNode) SetDuration(v int64) *ReservedCacheNode { - s.Duration = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedCacheNode) SetFixedPrice(v float64) *ReservedCacheNode { - s.FixedPrice = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedCacheNode) SetOfferingType(v string) *ReservedCacheNode { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *ReservedCacheNode) SetProductDescription(v string) *ReservedCacheNode { - s.ProductDescription = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedCacheNode) SetRecurringCharges(v []*RecurringCharge) *ReservedCacheNode { - s.RecurringCharges = v - return s -} - -// SetReservedCacheNodeId sets the ReservedCacheNodeId field's value. -func (s *ReservedCacheNode) SetReservedCacheNodeId(v string) *ReservedCacheNode { - s.ReservedCacheNodeId = &v - return s -} - -// SetReservedCacheNodesOfferingId sets the ReservedCacheNodesOfferingId field's value. -func (s *ReservedCacheNode) SetReservedCacheNodesOfferingId(v string) *ReservedCacheNode { - s.ReservedCacheNodesOfferingId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ReservedCacheNode) SetStartTime(v time.Time) *ReservedCacheNode { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *ReservedCacheNode) SetState(v string) *ReservedCacheNode { - s.State = &v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedCacheNode) SetUsagePrice(v float64) *ReservedCacheNode { - s.UsagePrice = &v - return s -} - -// Describes all of the attributes of a reserved cache node offering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ReservedCacheNodesOffering -type ReservedCacheNodesOffering struct { - _ struct{} `type:"structure"` - - // The cache node type for the reserved cache node. - // - // Valid node types are as follows: - // - // * General purpose: - // - // Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, - // cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge - // - // Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, - // cache.m1.xlarge - // - // * Compute optimized: cache.c1.xlarge - // - // * Memory optimized: - // - // Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, - // cache.r3.8xlarge - // - // Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge - // - // Notes: - // - // * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon - // VPC). - // - // * Redis backup/restore is not supported for Redis (cluster mode disabled) - // T1 and T2 instances. Backup/restore is supported on Redis (cluster mode - // enabled) T2 instances. - // - // * Redis Append-only files (AOF) functionality is not supported for T1 - // or T2 instances. - // - // For a complete listing of node types and specifications, see Amazon ElastiCache - // Product Features and Details (http://aws.amazon.com/elasticache/details) - // and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) - // or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). - CacheNodeType *string `type:"string"` - - // The duration of the offering. in seconds. - Duration *int64 `type:"integer"` - - // The fixed price charged for this offering. - FixedPrice *float64 `type:"double"` - - // The offering type. - OfferingType *string `type:"string"` - - // The cache engine used by the offering. - ProductDescription *string `type:"string"` - - // The recurring price charged to run this reserved cache node. - RecurringCharges []*RecurringCharge `locationNameList:"RecurringCharge" type:"list"` - - // A unique identifier for the reserved cache node offering. - ReservedCacheNodesOfferingId *string `type:"string"` - - // The hourly price charged for this offering. - UsagePrice *float64 `type:"double"` -} - -// String returns the string representation -func (s ReservedCacheNodesOffering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedCacheNodesOffering) GoString() string { - return s.String() -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *ReservedCacheNodesOffering) SetCacheNodeType(v string) *ReservedCacheNodesOffering { - s.CacheNodeType = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedCacheNodesOffering) SetDuration(v int64) *ReservedCacheNodesOffering { - s.Duration = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedCacheNodesOffering) SetFixedPrice(v float64) *ReservedCacheNodesOffering { - s.FixedPrice = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedCacheNodesOffering) SetOfferingType(v string) *ReservedCacheNodesOffering { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *ReservedCacheNodesOffering) SetProductDescription(v string) *ReservedCacheNodesOffering { - s.ProductDescription = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedCacheNodesOffering) SetRecurringCharges(v []*RecurringCharge) *ReservedCacheNodesOffering { - s.RecurringCharges = v - return s -} - -// SetReservedCacheNodesOfferingId sets the ReservedCacheNodesOfferingId field's value. -func (s *ReservedCacheNodesOffering) SetReservedCacheNodesOfferingId(v string) *ReservedCacheNodesOffering { - s.ReservedCacheNodesOfferingId = &v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedCacheNodesOffering) SetUsagePrice(v float64) *ReservedCacheNodesOffering { - s.UsagePrice = &v - return s -} - -// Represents the input of a ResetCacheParameterGroup operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ResetCacheParameterGroupMessage -type ResetCacheParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cache parameter group to reset. - // - // CacheParameterGroupName is a required field - CacheParameterGroupName *string `type:"string" required:"true"` - - // An array of parameter names to reset to their default values. If ResetAllParameters - // is true, do not use ParameterNameValues. If ResetAllParameters is false, - // you must specify the name of at least one parameter to reset. - ParameterNameValues []*ParameterNameValue `locationNameList:"ParameterNameValue" type:"list"` - - // If true, all parameters in the cache parameter group are reset to their default - // values. If false, only the parameters listed by ParameterNameValues are reset - // to their default values. - // - // Valid values: true | false - ResetAllParameters *bool `type:"boolean"` -} - -// String returns the string representation -func (s ResetCacheParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetCacheParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetCacheParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetCacheParameterGroupInput"} - if s.CacheParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *ResetCacheParameterGroupInput) SetCacheParameterGroupName(v string) *ResetCacheParameterGroupInput { - s.CacheParameterGroupName = &v - return s -} - -// SetParameterNameValues sets the ParameterNameValues field's value. -func (s *ResetCacheParameterGroupInput) SetParameterNameValues(v []*ParameterNameValue) *ResetCacheParameterGroupInput { - s.ParameterNameValues = v - return s -} - -// SetResetAllParameters sets the ResetAllParameters field's value. -func (s *ResetCacheParameterGroupInput) SetResetAllParameters(v bool) *ResetCacheParameterGroupInput { - s.ResetAllParameters = &v - return s -} - -// Represents the input of a RevokeCacheSecurityGroupIngress operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RevokeCacheSecurityGroupIngressMessage -type RevokeCacheSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The name of the cache security group to revoke ingress from. - // - // CacheSecurityGroupName is a required field - CacheSecurityGroupName *string `type:"string" required:"true"` - - // The name of the Amazon EC2 security group to revoke access from. - // - // EC2SecurityGroupName is a required field - EC2SecurityGroupName *string `type:"string" required:"true"` - - // The AWS account number of the Amazon EC2 security group owner. Note that - // this is not the same thing as an AWS access key ID - you must provide a valid - // AWS account number for this parameter. - // - // EC2SecurityGroupOwnerId is a required field - EC2SecurityGroupOwnerId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RevokeCacheSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeCacheSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RevokeCacheSecurityGroupIngressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RevokeCacheSecurityGroupIngressInput"} - if s.CacheSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("CacheSecurityGroupName")) - } - if s.EC2SecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("EC2SecurityGroupName")) - } - if s.EC2SecurityGroupOwnerId == nil { - invalidParams.Add(request.NewErrParamRequired("EC2SecurityGroupOwnerId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCacheSecurityGroupName sets the CacheSecurityGroupName field's value. -func (s *RevokeCacheSecurityGroupIngressInput) SetCacheSecurityGroupName(v string) *RevokeCacheSecurityGroupIngressInput { - s.CacheSecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *RevokeCacheSecurityGroupIngressInput) SetEC2SecurityGroupName(v string) *RevokeCacheSecurityGroupIngressInput { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *RevokeCacheSecurityGroupIngressInput) SetEC2SecurityGroupOwnerId(v string) *RevokeCacheSecurityGroupIngressInput { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RevokeCacheSecurityGroupIngressResult -type RevokeCacheSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of one of the following operations: - // - // * AuthorizeCacheSecurityGroupIngress - // - // * CreateCacheSecurityGroup - // - // * RevokeCacheSecurityGroupIngress - CacheSecurityGroup *CacheSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s RevokeCacheSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeCacheSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// SetCacheSecurityGroup sets the CacheSecurityGroup field's value. -func (s *RevokeCacheSecurityGroupIngressOutput) SetCacheSecurityGroup(v *CacheSecurityGroup) *RevokeCacheSecurityGroupIngressOutput { - s.CacheSecurityGroup = v - return s -} - -// Represents a single cache security group and its status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/SecurityGroupMembership -type SecurityGroupMembership struct { - _ struct{} `type:"structure"` - - // The identifier of the cache security group. - SecurityGroupId *string `type:"string"` - - // The status of the cache security group membership. The status changes whenever - // a cache security group is modified, or when the cache security groups assigned - // to a cache cluster are modified. - Status *string `type:"string"` -} - -// String returns the string representation -func (s SecurityGroupMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SecurityGroupMembership) GoString() string { - return s.String() -} - -// SetSecurityGroupId sets the SecurityGroupId field's value. -func (s *SecurityGroupMembership) SetSecurityGroupId(v string) *SecurityGroupMembership { - s.SecurityGroupId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SecurityGroupMembership) SetStatus(v string) *SecurityGroupMembership { - s.Status = &v - return s -} - -// Represents a copy of an entire Redis cache cluster as of the time when the -// snapshot was taken. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/Snapshot -type Snapshot struct { - _ struct{} `type:"structure"` - - // This parameter is currently disabled. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // Indicates the status of Multi-AZ for the source replication group. - // - // ElastiCache Multi-AZ replication groups are not supported on: - // - // Redis versions earlier than 2.8.6. - // - // Redis (cluster mode disabled):T1 and T2 cache node types. - // - // Redis (cluster mode enabled): T1 node types. - AutomaticFailover *string `type:"string" enum:"AutomaticFailoverStatus"` - - // The date and time when the source cache cluster was created. - CacheClusterCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The user-supplied identifier of the source cache cluster. - CacheClusterId *string `type:"string"` - - // The name of the compute and memory capacity node type for the source cache - // cluster. - // - // Valid node types are as follows: - // - // * General purpose: - // - // Current generation: cache.t2.micro, cache.t2.small, cache.t2.medium, cache.m3.medium, - // cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge, cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge - // - // Previous generation: cache.t1.micro, cache.m1.small, cache.m1.medium, cache.m1.large, - // cache.m1.xlarge - // - // * Compute optimized: cache.c1.xlarge - // - // * Memory optimized: - // - // Current generation: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, - // cache.r3.8xlarge - // - // Previous generation: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge - // - // Notes: - // - // * All T2 instances are created in an Amazon Virtual Private Cloud (Amazon - // VPC). - // - // * Redis backup/restore is not supported for Redis (cluster mode disabled) - // T1 and T2 instances. Backup/restore is supported on Redis (cluster mode - // enabled) T2 instances. - // - // * Redis Append-only files (AOF) functionality is not supported for T1 - // or T2 instances. - // - // For a complete listing of node types and specifications, see Amazon ElastiCache - // Product Features and Details (http://aws.amazon.com/elasticache/details) - // and either Cache Node Type-Specific Parameters for Memcached (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html#ParameterGroups.Memcached.NodeSpecific) - // or Cache Node Type-Specific Parameters for Redis (http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html#ParameterGroups.Redis.NodeSpecific). - CacheNodeType *string `type:"string"` - - // The cache parameter group that is associated with the source cache cluster. - CacheParameterGroupName *string `type:"string"` - - // The name of the cache subnet group associated with the source cache cluster. - CacheSubnetGroupName *string `type:"string"` - - // The name of the cache engine (memcached or redis) used by the source cache - // cluster. - Engine *string `type:"string"` - - // The version of the cache engine version that is used by the source cache - // cluster. - EngineVersion *string `type:"string"` - - // A list of the cache nodes in the source cache cluster. - NodeSnapshots []*NodeSnapshot `locationNameList:"NodeSnapshot" type:"list"` - - // The number of cache nodes in the source cache cluster. - // - // For clusters running Redis, this value must be 1. For clusters running Memcached, - // this value must be between 1 and 20. - NumCacheNodes *int64 `type:"integer"` - - // The number of node groups (shards) in this snapshot. When restoring from - // a snapshot, the number of node groups (shards) in the snapshot and in the - // restored replication group must be the same. - NumNodeGroups *int64 `type:"integer"` - - // The port number used by each cache nodes in the source cache cluster. - Port *int64 `type:"integer"` - - // The name of the Availability Zone in which the source cache cluster is located. - PreferredAvailabilityZone *string `type:"string"` - - // Specifies the weekly time range during which maintenance on the cluster is - // performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi - // (24H Clock UTC). The minimum maintenance window is a 60 minute period. - // - // Valid values for ddd are: - // - // * sun - // - // * mon - // - // * tue - // - // * wed - // - // * thu - // - // * fri - // - // * sat - // - // Example: sun:23:00-mon:01:30 - PreferredMaintenanceWindow *string `type:"string"` - - // A description of the source replication group. - ReplicationGroupDescription *string `type:"string"` - - // The unique identifier of the source replication group. - ReplicationGroupId *string `type:"string"` - - // The name of a snapshot. For an automatic snapshot, the name is system-generated. - // For a manual snapshot, this is the user-provided name. - SnapshotName *string `type:"string"` - - // For an automatic snapshot, the number of days for which ElastiCache retains - // the snapshot before deleting it. - // - // For manual snapshots, this field reflects the SnapshotRetentionLimit for - // the source cache cluster when the snapshot was created. This field is otherwise - // ignored: Manual snapshots do not expire, and can only be deleted using the - // DeleteSnapshot operation. - // - // Important If the value of SnapshotRetentionLimit is set to zero (0), backups - // are turned off. - SnapshotRetentionLimit *int64 `type:"integer"` - - // Indicates whether the snapshot is from an automatic backup (automated) or - // was created manually (manual). - SnapshotSource *string `type:"string"` - - // The status of the snapshot. Valid values: creating | available | restoring - // | copying | deleting. - SnapshotStatus *string `type:"string"` - - // The daily time range during which ElastiCache takes daily snapshots of the - // source cache cluster. - SnapshotWindow *string `type:"string"` - - // The Amazon Resource Name (ARN) for the topic used by the source cache cluster - // for publishing notifications. - TopicArn *string `type:"string"` - - // The Amazon Virtual Private Cloud identifier (VPC ID) of the cache subnet - // group for the source cache cluster. - VpcId *string `type:"string"` -} - -// 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() -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *Snapshot) SetAutoMinorVersionUpgrade(v bool) *Snapshot { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAutomaticFailover sets the AutomaticFailover field's value. -func (s *Snapshot) SetAutomaticFailover(v string) *Snapshot { - s.AutomaticFailover = &v - return s -} - -// SetCacheClusterCreateTime sets the CacheClusterCreateTime field's value. -func (s *Snapshot) SetCacheClusterCreateTime(v time.Time) *Snapshot { - s.CacheClusterCreateTime = &v - return s -} - -// SetCacheClusterId sets the CacheClusterId field's value. -func (s *Snapshot) SetCacheClusterId(v string) *Snapshot { - s.CacheClusterId = &v - return s -} - -// SetCacheNodeType sets the CacheNodeType field's value. -func (s *Snapshot) SetCacheNodeType(v string) *Snapshot { - s.CacheNodeType = &v - return s -} - -// SetCacheParameterGroupName sets the CacheParameterGroupName field's value. -func (s *Snapshot) SetCacheParameterGroupName(v string) *Snapshot { - s.CacheParameterGroupName = &v - return s -} - -// SetCacheSubnetGroupName sets the CacheSubnetGroupName field's value. -func (s *Snapshot) SetCacheSubnetGroupName(v string) *Snapshot { - s.CacheSubnetGroupName = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *Snapshot) SetEngine(v string) *Snapshot { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *Snapshot) SetEngineVersion(v string) *Snapshot { - s.EngineVersion = &v - return s -} - -// SetNodeSnapshots sets the NodeSnapshots field's value. -func (s *Snapshot) SetNodeSnapshots(v []*NodeSnapshot) *Snapshot { - s.NodeSnapshots = v - return s -} - -// SetNumCacheNodes sets the NumCacheNodes field's value. -func (s *Snapshot) SetNumCacheNodes(v int64) *Snapshot { - s.NumCacheNodes = &v - return s -} - -// SetNumNodeGroups sets the NumNodeGroups field's value. -func (s *Snapshot) SetNumNodeGroups(v int64) *Snapshot { - s.NumNodeGroups = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Snapshot) SetPort(v int64) *Snapshot { - s.Port = &v - return s -} - -// SetPreferredAvailabilityZone sets the PreferredAvailabilityZone field's value. -func (s *Snapshot) SetPreferredAvailabilityZone(v string) *Snapshot { - s.PreferredAvailabilityZone = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *Snapshot) SetPreferredMaintenanceWindow(v string) *Snapshot { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetReplicationGroupDescription sets the ReplicationGroupDescription field's value. -func (s *Snapshot) SetReplicationGroupDescription(v string) *Snapshot { - s.ReplicationGroupDescription = &v - return s -} - -// SetReplicationGroupId sets the ReplicationGroupId field's value. -func (s *Snapshot) SetReplicationGroupId(v string) *Snapshot { - s.ReplicationGroupId = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *Snapshot) SetSnapshotName(v string) *Snapshot { - s.SnapshotName = &v - return s -} - -// SetSnapshotRetentionLimit sets the SnapshotRetentionLimit field's value. -func (s *Snapshot) SetSnapshotRetentionLimit(v int64) *Snapshot { - s.SnapshotRetentionLimit = &v - return s -} - -// SetSnapshotSource sets the SnapshotSource field's value. -func (s *Snapshot) SetSnapshotSource(v string) *Snapshot { - s.SnapshotSource = &v - return s -} - -// SetSnapshotStatus sets the SnapshotStatus field's value. -func (s *Snapshot) SetSnapshotStatus(v string) *Snapshot { - s.SnapshotStatus = &v - return s -} - -// SetSnapshotWindow sets the SnapshotWindow field's value. -func (s *Snapshot) SetSnapshotWindow(v string) *Snapshot { - s.SnapshotWindow = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *Snapshot) SetTopicArn(v string) *Snapshot { - s.TopicArn = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Snapshot) SetVpcId(v string) *Snapshot { - s.VpcId = &v - return s -} - -// Represents the subnet associated with a cache cluster. This parameter refers -// to subnets defined in Amazon Virtual Private Cloud (Amazon VPC) and used -// with ElastiCache. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/Subnet -type Subnet struct { - _ struct{} `type:"structure"` - - // The Availability Zone associated with the subnet. - SubnetAvailabilityZone *AvailabilityZone `type:"structure"` - - // The unique identifier for the subnet. - SubnetIdentifier *string `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() -} - -// SetSubnetAvailabilityZone sets the SubnetAvailabilityZone field's value. -func (s *Subnet) SetSubnetAvailabilityZone(v *AvailabilityZone) *Subnet { - s.SubnetAvailabilityZone = v - return s -} - -// SetSubnetIdentifier sets the SubnetIdentifier field's value. -func (s *Subnet) SetSubnetIdentifier(v string) *Subnet { - s.SubnetIdentifier = &v - return s -} - -// A cost allocation Tag that can be added to an ElastiCache cluster or replication -// group. Tags are composed of a Key/Value pair. A tag with a null Value is -// permitted. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key for the tag. - Key *string `type:"string"` - - // The tag's value. May not be null. - 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 -} - -// Represents the output from the AddTagsToResource, ListTagsOnResource, and -// RemoveTagsFromResource operations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/TagListMessage -type TagListMessage struct { - _ struct{} `type:"structure"` - - // A list of cost allocation tags as key-value pairs. - TagList []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s TagListMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagListMessage) GoString() string { - return s.String() -} - -// SetTagList sets the TagList field's value. -func (s *TagListMessage) SetTagList(v []*Tag) *TagListMessage { - s.TagList = v - return s -} - -const ( - // AZModeSingleAz is a AZMode enum value - AZModeSingleAz = "single-az" - - // AZModeCrossAz is a AZMode enum value - AZModeCrossAz = "cross-az" -) - -const ( - // AutomaticFailoverStatusEnabled is a AutomaticFailoverStatus enum value - AutomaticFailoverStatusEnabled = "enabled" - - // AutomaticFailoverStatusDisabled is a AutomaticFailoverStatus enum value - AutomaticFailoverStatusDisabled = "disabled" - - // AutomaticFailoverStatusEnabling is a AutomaticFailoverStatus enum value - AutomaticFailoverStatusEnabling = "enabling" - - // AutomaticFailoverStatusDisabling is a AutomaticFailoverStatus enum value - AutomaticFailoverStatusDisabling = "disabling" -) - -const ( - // ChangeTypeImmediate is a ChangeType enum value - ChangeTypeImmediate = "immediate" - - // ChangeTypeRequiresReboot is a ChangeType enum value - ChangeTypeRequiresReboot = "requires-reboot" -) - -const ( - // PendingAutomaticFailoverStatusEnabled is a PendingAutomaticFailoverStatus enum value - PendingAutomaticFailoverStatusEnabled = "enabled" - - // PendingAutomaticFailoverStatusDisabled is a PendingAutomaticFailoverStatus enum value - PendingAutomaticFailoverStatusDisabled = "disabled" -) - -const ( - // SourceTypeCacheCluster is a SourceType enum value - SourceTypeCacheCluster = "cache-cluster" - - // SourceTypeCacheParameterGroup is a SourceType enum value - SourceTypeCacheParameterGroup = "cache-parameter-group" - - // SourceTypeCacheSecurityGroup is a SourceType enum value - SourceTypeCacheSecurityGroup = "cache-security-group" - - // SourceTypeCacheSubnetGroup is a SourceType enum value - SourceTypeCacheSubnetGroup = "cache-subnet-group" - - // SourceTypeReplicationGroup is a SourceType enum value - SourceTypeReplicationGroup = "replication-group" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go deleted file mode 100644 index f5cffec..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go +++ /dev/null @@ -1,293 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elasticache - -const ( - - // ErrCodeAuthorizationAlreadyExistsFault for service response error code - // "AuthorizationAlreadyExists". - // - // The specified Amazon EC2 security group is already authorized for the specified - // cache security group. - ErrCodeAuthorizationAlreadyExistsFault = "AuthorizationAlreadyExists" - - // ErrCodeAuthorizationNotFoundFault for service response error code - // "AuthorizationNotFound". - // - // The specified Amazon EC2 security group is not authorized for the specified - // cache security group. - ErrCodeAuthorizationNotFoundFault = "AuthorizationNotFound" - - // ErrCodeCacheClusterAlreadyExistsFault for service response error code - // "CacheClusterAlreadyExists". - // - // You already have a cache cluster with the given identifier. - ErrCodeCacheClusterAlreadyExistsFault = "CacheClusterAlreadyExists" - - // ErrCodeCacheClusterNotFoundFault for service response error code - // "CacheClusterNotFound". - // - // The requested cache cluster ID does not refer to an existing cache cluster. - ErrCodeCacheClusterNotFoundFault = "CacheClusterNotFound" - - // ErrCodeCacheParameterGroupAlreadyExistsFault for service response error code - // "CacheParameterGroupAlreadyExists". - // - // A cache parameter group with the requested name already exists. - ErrCodeCacheParameterGroupAlreadyExistsFault = "CacheParameterGroupAlreadyExists" - - // ErrCodeCacheParameterGroupNotFoundFault for service response error code - // "CacheParameterGroupNotFound". - // - // The requested cache parameter group name does not refer to an existing cache - // parameter group. - ErrCodeCacheParameterGroupNotFoundFault = "CacheParameterGroupNotFound" - - // ErrCodeCacheParameterGroupQuotaExceededFault for service response error code - // "CacheParameterGroupQuotaExceeded". - // - // The request cannot be processed because it would exceed the maximum number - // of cache security groups. - ErrCodeCacheParameterGroupQuotaExceededFault = "CacheParameterGroupQuotaExceeded" - - // ErrCodeCacheSecurityGroupAlreadyExistsFault for service response error code - // "CacheSecurityGroupAlreadyExists". - // - // A cache security group with the specified name already exists. - ErrCodeCacheSecurityGroupAlreadyExistsFault = "CacheSecurityGroupAlreadyExists" - - // ErrCodeCacheSecurityGroupNotFoundFault for service response error code - // "CacheSecurityGroupNotFound". - // - // The requested cache security group name does not refer to an existing cache - // security group. - ErrCodeCacheSecurityGroupNotFoundFault = "CacheSecurityGroupNotFound" - - // ErrCodeCacheSecurityGroupQuotaExceededFault for service response error code - // "QuotaExceeded.CacheSecurityGroup". - // - // The request cannot be processed because it would exceed the allowed number - // of cache security groups. - ErrCodeCacheSecurityGroupQuotaExceededFault = "QuotaExceeded.CacheSecurityGroup" - - // ErrCodeCacheSubnetGroupAlreadyExistsFault for service response error code - // "CacheSubnetGroupAlreadyExists". - // - // The requested cache subnet group name is already in use by an existing cache - // subnet group. - ErrCodeCacheSubnetGroupAlreadyExistsFault = "CacheSubnetGroupAlreadyExists" - - // ErrCodeCacheSubnetGroupInUse for service response error code - // "CacheSubnetGroupInUse". - // - // The requested cache subnet group is currently in use. - ErrCodeCacheSubnetGroupInUse = "CacheSubnetGroupInUse" - - // ErrCodeCacheSubnetGroupNotFoundFault for service response error code - // "CacheSubnetGroupNotFoundFault". - // - // The requested cache subnet group name does not refer to an existing cache - // subnet group. - ErrCodeCacheSubnetGroupNotFoundFault = "CacheSubnetGroupNotFoundFault" - - // ErrCodeCacheSubnetGroupQuotaExceededFault for service response error code - // "CacheSubnetGroupQuotaExceeded". - // - // The request cannot be processed because it would exceed the allowed number - // of cache subnet groups. - ErrCodeCacheSubnetGroupQuotaExceededFault = "CacheSubnetGroupQuotaExceeded" - - // ErrCodeCacheSubnetQuotaExceededFault for service response error code - // "CacheSubnetQuotaExceededFault". - // - // The request cannot be processed because it would exceed the allowed number - // of subnets in a cache subnet group. - ErrCodeCacheSubnetQuotaExceededFault = "CacheSubnetQuotaExceededFault" - - // ErrCodeClusterQuotaForCustomerExceededFault for service response error code - // "ClusterQuotaForCustomerExceeded". - // - // The request cannot be processed because it would exceed the allowed number - // of cache clusters per customer. - ErrCodeClusterQuotaForCustomerExceededFault = "ClusterQuotaForCustomerExceeded" - - // ErrCodeInsufficientCacheClusterCapacityFault for service response error code - // "InsufficientCacheClusterCapacity". - // - // The requested cache node type is not available in the specified Availability - // Zone. - ErrCodeInsufficientCacheClusterCapacityFault = "InsufficientCacheClusterCapacity" - - // ErrCodeInvalidARNFault for service response error code - // "InvalidARN". - // - // The requested Amazon Resource Name (ARN) does not refer to an existing resource. - ErrCodeInvalidARNFault = "InvalidARN" - - // ErrCodeInvalidCacheClusterStateFault for service response error code - // "InvalidCacheClusterState". - // - // The requested cache cluster is not in the available state. - ErrCodeInvalidCacheClusterStateFault = "InvalidCacheClusterState" - - // ErrCodeInvalidCacheParameterGroupStateFault for service response error code - // "InvalidCacheParameterGroupState". - // - // The current state of the cache parameter group does not allow the requested - // operation to occur. - ErrCodeInvalidCacheParameterGroupStateFault = "InvalidCacheParameterGroupState" - - // ErrCodeInvalidCacheSecurityGroupStateFault for service response error code - // "InvalidCacheSecurityGroupState". - // - // The current state of the cache security group does not allow deletion. - ErrCodeInvalidCacheSecurityGroupStateFault = "InvalidCacheSecurityGroupState" - - // ErrCodeInvalidParameterCombinationException for service response error code - // "InvalidParameterCombination". - // - // Two or more incompatible parameters were specified. - ErrCodeInvalidParameterCombinationException = "InvalidParameterCombination" - - // ErrCodeInvalidParameterValueException for service response error code - // "InvalidParameterValue". - // - // The value for a parameter is invalid. - ErrCodeInvalidParameterValueException = "InvalidParameterValue" - - // ErrCodeInvalidReplicationGroupStateFault for service response error code - // "InvalidReplicationGroupState". - // - // The requested replication group is not in the available state. - ErrCodeInvalidReplicationGroupStateFault = "InvalidReplicationGroupState" - - // ErrCodeInvalidSnapshotStateFault for service response error code - // "InvalidSnapshotState". - // - // The current state of the snapshot does not allow the requested operation - // to occur. - ErrCodeInvalidSnapshotStateFault = "InvalidSnapshotState" - - // ErrCodeInvalidSubnet for service response error code - // "InvalidSubnet". - // - // An invalid subnet identifier was specified. - ErrCodeInvalidSubnet = "InvalidSubnet" - - // ErrCodeInvalidVPCNetworkStateFault for service response error code - // "InvalidVPCNetworkStateFault". - // - // The VPC network is in an invalid state. - ErrCodeInvalidVPCNetworkStateFault = "InvalidVPCNetworkStateFault" - - // ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault for service response error code - // "NodeGroupsPerReplicationGroupQuotaExceeded". - // - // The request cannot be processed because it would exceed the maximum of 15 - // node groups (shards) in a single replication group. - ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault = "NodeGroupsPerReplicationGroupQuotaExceeded" - - // ErrCodeNodeQuotaForClusterExceededFault for service response error code - // "NodeQuotaForClusterExceeded". - // - // The request cannot be processed because it would exceed the allowed number - // of cache nodes in a single cache cluster. - ErrCodeNodeQuotaForClusterExceededFault = "NodeQuotaForClusterExceeded" - - // ErrCodeNodeQuotaForCustomerExceededFault for service response error code - // "NodeQuotaForCustomerExceeded". - // - // The request cannot be processed because it would exceed the allowed number - // of cache nodes per customer. - ErrCodeNodeQuotaForCustomerExceededFault = "NodeQuotaForCustomerExceeded" - - // ErrCodeReplicationGroupAlreadyExistsFault for service response error code - // "ReplicationGroupAlreadyExists". - // - // The specified replication group already exists. - ErrCodeReplicationGroupAlreadyExistsFault = "ReplicationGroupAlreadyExists" - - // ErrCodeReplicationGroupNotFoundFault for service response error code - // "ReplicationGroupNotFoundFault". - // - // The specified replication group does not exist. - ErrCodeReplicationGroupNotFoundFault = "ReplicationGroupNotFoundFault" - - // ErrCodeReservedCacheNodeAlreadyExistsFault for service response error code - // "ReservedCacheNodeAlreadyExists". - // - // You already have a reservation with the given identifier. - ErrCodeReservedCacheNodeAlreadyExistsFault = "ReservedCacheNodeAlreadyExists" - - // ErrCodeReservedCacheNodeNotFoundFault for service response error code - // "ReservedCacheNodeNotFound". - // - // The requested reserved cache node was not found. - ErrCodeReservedCacheNodeNotFoundFault = "ReservedCacheNodeNotFound" - - // ErrCodeReservedCacheNodeQuotaExceededFault for service response error code - // "ReservedCacheNodeQuotaExceeded". - // - // The request cannot be processed because it would exceed the user's cache - // node quota. - ErrCodeReservedCacheNodeQuotaExceededFault = "ReservedCacheNodeQuotaExceeded" - - // ErrCodeReservedCacheNodesOfferingNotFoundFault for service response error code - // "ReservedCacheNodesOfferingNotFound". - // - // The requested cache node offering does not exist. - ErrCodeReservedCacheNodesOfferingNotFoundFault = "ReservedCacheNodesOfferingNotFound" - - // ErrCodeSnapshotAlreadyExistsFault for service response error code - // "SnapshotAlreadyExistsFault". - // - // You already have a snapshot with the given name. - ErrCodeSnapshotAlreadyExistsFault = "SnapshotAlreadyExistsFault" - - // ErrCodeSnapshotFeatureNotSupportedFault for service response error code - // "SnapshotFeatureNotSupportedFault". - // - // You attempted one of the following operations: - // - // * Creating a snapshot of a Redis cache cluster running on a cache.t1.micro - // cache node. - // - // * Creating a snapshot of a cache cluster that is running Memcached rather - // than Redis. - // - // Neither of these are supported by ElastiCache. - ErrCodeSnapshotFeatureNotSupportedFault = "SnapshotFeatureNotSupportedFault" - - // ErrCodeSnapshotNotFoundFault for service response error code - // "SnapshotNotFoundFault". - // - // The requested snapshot name does not refer to an existing snapshot. - ErrCodeSnapshotNotFoundFault = "SnapshotNotFoundFault" - - // ErrCodeSnapshotQuotaExceededFault for service response error code - // "SnapshotQuotaExceededFault". - // - // The request cannot be processed because it would exceed the maximum number - // of snapshots. - ErrCodeSnapshotQuotaExceededFault = "SnapshotQuotaExceededFault" - - // ErrCodeSubnetInUse for service response error code - // "SubnetInUse". - // - // The requested subnet is being used by another cache subnet group. - ErrCodeSubnetInUse = "SubnetInUse" - - // ErrCodeTagNotFoundFault for service response error code - // "TagNotFound". - // - // The requested tag was not found on this resource. - ErrCodeTagNotFoundFault = "TagNotFound" - - // ErrCodeTagQuotaPerResourceExceeded for service response error code - // "TagQuotaPerResourceExceeded". - // - // The request cannot be processed because it would cause the resource to have - // more than the allowed number of tags. The maximum number of tags permitted - // on a resource is 10. - ErrCodeTagQuotaPerResourceExceeded = "TagQuotaPerResourceExceeded" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go deleted file mode 100644 index 7654b3b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go +++ /dev/null @@ -1,101 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elasticache - -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" -) - -// Amazon ElastiCache is a web service that makes it easier to set up, operate, -// and scale a distributed cache in the cloud. -// -// With ElastiCache, customers get all of the benefits of a high-performance, -// in-memory cache with less of the administrative burden involved in launching -// and managing a distributed cache. The service makes setup, scaling, and cluster -// failure handling much simpler than in a self-managed cache deployment. -// -// In addition, through integration with Amazon CloudWatch, customers get enhanced -// visibility into the key performance statistics associated with their cache -// and can receive alarms if a part of their cache runs hot. -// 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/elasticache-2015-02-02 -type ElastiCache 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 = "elasticache" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ElastiCache 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 ElastiCache client from just a session. -// svc := elasticache.New(mySession) -// -// // Create a ElastiCache client with additional configuration -// svc := elasticache.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ElastiCache { - 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) *ElastiCache { - svc := &ElastiCache{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-02-02", - }, - 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 ElastiCache operation and runs any -// custom request initialization. -func (c *ElastiCache) 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/elasticache/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/waiters.go deleted file mode 100644 index 2e25f84..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/waiters.go +++ /dev/null @@ -1,199 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elasticache - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilCacheClusterAvailable uses the Amazon ElastiCache API operation -// DescribeCacheClusters 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 *ElastiCache) WaitUntilCacheClusterAvailable(input *DescribeCacheClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCacheClusters", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "deleted", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "deleting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "incompatible-network", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "restore-failed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilCacheClusterDeleted uses the Amazon ElastiCache API operation -// DescribeCacheClusters 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 *ElastiCache) WaitUntilCacheClusterDeleted(input *DescribeCacheClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCacheClusters", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "deleted", - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "CacheClusterNotFound", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "creating", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "incompatible-network", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "modifying", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "restore-failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "CacheClusters[].CacheClusterStatus", - Expected: "snapshotting", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilReplicationGroupAvailable uses the Amazon ElastiCache API operation -// DescribeReplicationGroups 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 *ElastiCache) WaitUntilReplicationGroupAvailable(input *DescribeReplicationGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeReplicationGroups", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationGroups[].Status", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "ReplicationGroups[].Status", - Expected: "deleted", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilReplicationGroupDeleted uses the Amazon ElastiCache API operation -// DescribeReplicationGroups 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 *ElastiCache) WaitUntilReplicationGroupDeleted(input *DescribeReplicationGroupsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeReplicationGroups", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationGroups[].Status", - Expected: "deleted", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "ReplicationGroups[].Status", - Expected: "available", - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "ReplicationGroupNotFoundFault", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go deleted file mode 100644 index 7f4e1f1..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go +++ /dev/null @@ -1,10526 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elasticbeanstalk provides a client for AWS Elastic Beanstalk. -package elasticbeanstalk - -import ( - "fmt" - "time" - - "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 opAbortEnvironmentUpdate = "AbortEnvironmentUpdate" - -// AbortEnvironmentUpdateRequest generates a "aws/request.Request" representing the -// client's request for the AbortEnvironmentUpdate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AbortEnvironmentUpdate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AbortEnvironmentUpdate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AbortEnvironmentUpdateRequest method. -// req, resp := client.AbortEnvironmentUpdateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AbortEnvironmentUpdate -func (c *ElasticBeanstalk) AbortEnvironmentUpdateRequest(input *AbortEnvironmentUpdateInput) (req *request.Request, output *AbortEnvironmentUpdateOutput) { - op := &request.Operation{ - Name: opAbortEnvironmentUpdate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AbortEnvironmentUpdateInput{} - } - - output = &AbortEnvironmentUpdateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AbortEnvironmentUpdate API operation for AWS Elastic Beanstalk. -// -// Cancels in-progress environment configuration update or application version -// deployment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation AbortEnvironmentUpdate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AbortEnvironmentUpdate -func (c *ElasticBeanstalk) AbortEnvironmentUpdate(input *AbortEnvironmentUpdateInput) (*AbortEnvironmentUpdateOutput, error) { - req, out := c.AbortEnvironmentUpdateRequest(input) - err := req.Send() - return out, err -} - -const opApplyEnvironmentManagedAction = "ApplyEnvironmentManagedAction" - -// ApplyEnvironmentManagedActionRequest generates a "aws/request.Request" representing the -// client's request for the ApplyEnvironmentManagedAction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ApplyEnvironmentManagedAction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ApplyEnvironmentManagedAction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ApplyEnvironmentManagedActionRequest method. -// req, resp := client.ApplyEnvironmentManagedActionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplyEnvironmentManagedAction -func (c *ElasticBeanstalk) ApplyEnvironmentManagedActionRequest(input *ApplyEnvironmentManagedActionInput) (req *request.Request, output *ApplyEnvironmentManagedActionOutput) { - op := &request.Operation{ - Name: opApplyEnvironmentManagedAction, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ApplyEnvironmentManagedActionInput{} - } - - output = &ApplyEnvironmentManagedActionOutput{} - req = c.newRequest(op, input, output) - return -} - -// ApplyEnvironmentManagedAction API operation for AWS Elastic Beanstalk. -// -// Applies a scheduled managed action immediately. A managed action can be applied -// only if its status is Scheduled. Get the status and action ID of a managed -// action with DescribeEnvironmentManagedActions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation ApplyEnvironmentManagedAction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// * ErrCodeManagedActionInvalidStateException "ManagedActionInvalidStateException" -// Cannot modify the managed action in its current state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplyEnvironmentManagedAction -func (c *ElasticBeanstalk) ApplyEnvironmentManagedAction(input *ApplyEnvironmentManagedActionInput) (*ApplyEnvironmentManagedActionOutput, error) { - req, out := c.ApplyEnvironmentManagedActionRequest(input) - err := req.Send() - return out, err -} - -const opCheckDNSAvailability = "CheckDNSAvailability" - -// CheckDNSAvailabilityRequest generates a "aws/request.Request" representing the -// client's request for the CheckDNSAvailability operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CheckDNSAvailability for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CheckDNSAvailability method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CheckDNSAvailabilityRequest method. -// req, resp := client.CheckDNSAvailabilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CheckDNSAvailability -func (c *ElasticBeanstalk) CheckDNSAvailabilityRequest(input *CheckDNSAvailabilityInput) (req *request.Request, output *CheckDNSAvailabilityOutput) { - op := &request.Operation{ - Name: opCheckDNSAvailability, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CheckDNSAvailabilityInput{} - } - - output = &CheckDNSAvailabilityOutput{} - req = c.newRequest(op, input, output) - return -} - -// CheckDNSAvailability API operation for AWS Elastic Beanstalk. -// -// Checks if the specified CNAME is available. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation CheckDNSAvailability for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CheckDNSAvailability -func (c *ElasticBeanstalk) CheckDNSAvailability(input *CheckDNSAvailabilityInput) (*CheckDNSAvailabilityOutput, error) { - req, out := c.CheckDNSAvailabilityRequest(input) - err := req.Send() - return out, err -} - -const opComposeEnvironments = "ComposeEnvironments" - -// ComposeEnvironmentsRequest generates a "aws/request.Request" representing the -// client's request for the ComposeEnvironments operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ComposeEnvironments for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ComposeEnvironments method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ComposeEnvironmentsRequest method. -// req, resp := client.ComposeEnvironmentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ComposeEnvironments -func (c *ElasticBeanstalk) ComposeEnvironmentsRequest(input *ComposeEnvironmentsInput) (req *request.Request, output *EnvironmentDescriptionsMessage) { - op := &request.Operation{ - Name: opComposeEnvironments, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ComposeEnvironmentsInput{} - } - - output = &EnvironmentDescriptionsMessage{} - req = c.newRequest(op, input, output) - return -} - -// ComposeEnvironments API operation for AWS Elastic Beanstalk. -// -// Create or update a group of environments that each run a separate component -// of a single application. Takes a list of version labels that specify application -// source bundles for each of the environments to create or update. The name -// of each environment and other required information must be included in the -// source bundles in an environment manifest named env.yaml. See Compose Environments -// (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-mgmt-compose.html) -// for details. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation ComposeEnvironments for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyEnvironmentsException "TooManyEnvironmentsException" -// The specified account has reached its limit of environments. -// -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ComposeEnvironments -func (c *ElasticBeanstalk) ComposeEnvironments(input *ComposeEnvironmentsInput) (*EnvironmentDescriptionsMessage, error) { - req, out := c.ComposeEnvironmentsRequest(input) - err := req.Send() - return out, err -} - -const opCreateApplication = "CreateApplication" - -// CreateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the CreateApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateApplicationRequest method. -// req, resp := client.CreateApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateApplication -func (c *ElasticBeanstalk) CreateApplicationRequest(input *CreateApplicationInput) (req *request.Request, output *ApplicationDescriptionMessage) { - op := &request.Operation{ - Name: opCreateApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateApplicationInput{} - } - - output = &ApplicationDescriptionMessage{} - req = c.newRequest(op, input, output) - return -} - -// CreateApplication API operation for AWS Elastic Beanstalk. -// -// Creates an application that has one configuration template named default -// and no application versions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation CreateApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyApplicationsException "TooManyApplicationsException" -// The specified account has reached its limit of applications. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateApplication -func (c *ElasticBeanstalk) CreateApplication(input *CreateApplicationInput) (*ApplicationDescriptionMessage, error) { - req, out := c.CreateApplicationRequest(input) - err := req.Send() - return out, err -} - -const opCreateApplicationVersion = "CreateApplicationVersion" - -// CreateApplicationVersionRequest generates a "aws/request.Request" representing the -// client's request for the CreateApplicationVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateApplicationVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateApplicationVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateApplicationVersionRequest method. -// req, resp := client.CreateApplicationVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateApplicationVersion -func (c *ElasticBeanstalk) CreateApplicationVersionRequest(input *CreateApplicationVersionInput) (req *request.Request, output *ApplicationVersionDescriptionMessage) { - op := &request.Operation{ - Name: opCreateApplicationVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateApplicationVersionInput{} - } - - output = &ApplicationVersionDescriptionMessage{} - req = c.newRequest(op, input, output) - return -} - -// CreateApplicationVersion API operation for AWS Elastic Beanstalk. -// -// Creates an application version for the specified application. You can create -// an application version from a source bundle in Amazon S3, a commit in AWS -// CodeCommit, or the output of an AWS CodeBuild build as follows: -// -// Specify a commit in an AWS CodeCommit repository with SourceBuildInformation. -// -// Specify a build in an AWS CodeBuild with SourceBuildInformation and BuildConfiguration. -// -// Specify a source bundle in S3 with SourceBundle -// -// Omit both SourceBuildInformation and SourceBundle to use the default sample -// application. -// -// Once you create an application version with a specified Amazon S3 bucket -// and key location, you cannot change that Amazon S3 location. If you change -// the Amazon S3 location, you receive an exception when you attempt to launch -// an environment from the application version. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation CreateApplicationVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyApplicationsException "TooManyApplicationsException" -// The specified account has reached its limit of applications. -// -// * ErrCodeTooManyApplicationVersionsException "TooManyApplicationVersionsException" -// The specified account has reached its limit of application versions. -// -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeS3LocationNotInServiceRegionException "S3LocationNotInServiceRegionException" -// The specified S3 bucket does not belong to the S3 region in which the service -// is running. The following regions are supported: -// -// * IAD/us-east-1 -// -// * PDX/us-west-2 -// -// * DUB/eu-west-1 -// -// * ErrCodeCodeBuildNotInServiceRegionException "CodeBuildNotInServiceRegionException" -// AWS CodeBuild is not available in the specified region. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateApplicationVersion -func (c *ElasticBeanstalk) CreateApplicationVersion(input *CreateApplicationVersionInput) (*ApplicationVersionDescriptionMessage, error) { - req, out := c.CreateApplicationVersionRequest(input) - err := req.Send() - return out, err -} - -const opCreateConfigurationTemplate = "CreateConfigurationTemplate" - -// CreateConfigurationTemplateRequest generates a "aws/request.Request" representing the -// client's request for the CreateConfigurationTemplate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateConfigurationTemplate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateConfigurationTemplate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateConfigurationTemplateRequest method. -// req, resp := client.CreateConfigurationTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateConfigurationTemplate -func (c *ElasticBeanstalk) CreateConfigurationTemplateRequest(input *CreateConfigurationTemplateInput) (req *request.Request, output *ConfigurationSettingsDescription) { - op := &request.Operation{ - Name: opCreateConfigurationTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateConfigurationTemplateInput{} - } - - output = &ConfigurationSettingsDescription{} - req = c.newRequest(op, input, output) - return -} - -// CreateConfigurationTemplate API operation for AWS Elastic Beanstalk. -// -// Creates a configuration template. Templates are associated with a specific -// application and are used to deploy different versions of the application -// with the same configuration settings. -// -// Related Topics -// -// * DescribeConfigurationOptions -// -// * DescribeConfigurationSettings -// -// * ListAvailableSolutionStacks -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation CreateConfigurationTemplate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeTooManyBucketsException "TooManyBucketsException" -// The specified account has reached its limit of Amazon S3 buckets. -// -// * ErrCodeTooManyConfigurationTemplatesException "TooManyConfigurationTemplatesException" -// The specified account has reached its limit of configuration templates. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateConfigurationTemplate -func (c *ElasticBeanstalk) CreateConfigurationTemplate(input *CreateConfigurationTemplateInput) (*ConfigurationSettingsDescription, error) { - req, out := c.CreateConfigurationTemplateRequest(input) - err := req.Send() - return out, err -} - -const opCreateEnvironment = "CreateEnvironment" - -// CreateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the CreateEnvironment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateEnvironment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateEnvironment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateEnvironmentRequest method. -// req, resp := client.CreateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateEnvironment -func (c *ElasticBeanstalk) CreateEnvironmentRequest(input *CreateEnvironmentInput) (req *request.Request, output *EnvironmentDescription) { - op := &request.Operation{ - Name: opCreateEnvironment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateEnvironmentInput{} - } - - output = &EnvironmentDescription{} - req = c.newRequest(op, input, output) - return -} - -// CreateEnvironment API operation for AWS Elastic Beanstalk. -// -// Launches an environment for the specified application using the specified -// 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 AWS Elastic Beanstalk's -// API operation CreateEnvironment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyEnvironmentsException "TooManyEnvironmentsException" -// The specified account has reached its limit of environments. -// -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateEnvironment -func (c *ElasticBeanstalk) CreateEnvironment(input *CreateEnvironmentInput) (*EnvironmentDescription, error) { - req, out := c.CreateEnvironmentRequest(input) - err := req.Send() - return out, err -} - -const opCreatePlatformVersion = "CreatePlatformVersion" - -// CreatePlatformVersionRequest generates a "aws/request.Request" representing the -// client's request for the CreatePlatformVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePlatformVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePlatformVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePlatformVersionRequest method. -// req, resp := client.CreatePlatformVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreatePlatformVersion -func (c *ElasticBeanstalk) CreatePlatformVersionRequest(input *CreatePlatformVersionInput) (req *request.Request, output *CreatePlatformVersionOutput) { - op := &request.Operation{ - Name: opCreatePlatformVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePlatformVersionInput{} - } - - output = &CreatePlatformVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePlatformVersion API operation for AWS Elastic Beanstalk. -// -// Create a new version of your custom 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 AWS Elastic Beanstalk's -// API operation CreatePlatformVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// * ErrCodeTooManyPlatformsException "TooManyPlatformsException" -// You have exceeded the maximum number of allowed platforms associated with -// the account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreatePlatformVersion -func (c *ElasticBeanstalk) CreatePlatformVersion(input *CreatePlatformVersionInput) (*CreatePlatformVersionOutput, error) { - req, out := c.CreatePlatformVersionRequest(input) - err := req.Send() - return out, err -} - -const opCreateStorageLocation = "CreateStorageLocation" - -// CreateStorageLocationRequest generates a "aws/request.Request" representing the -// client's request for the CreateStorageLocation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateStorageLocation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateStorageLocation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateStorageLocationRequest method. -// req, resp := client.CreateStorageLocationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateStorageLocation -func (c *ElasticBeanstalk) CreateStorageLocationRequest(input *CreateStorageLocationInput) (req *request.Request, output *CreateStorageLocationOutput) { - op := &request.Operation{ - Name: opCreateStorageLocation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateStorageLocationInput{} - } - - output = &CreateStorageLocationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateStorageLocation API operation for AWS Elastic Beanstalk. -// -// Creates the Amazon S3 storage location for the account. -// -// This location is used to store user log files. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation CreateStorageLocation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyBucketsException "TooManyBucketsException" -// The specified account has reached its limit of Amazon S3 buckets. -// -// * ErrCodeS3SubscriptionRequiredException "S3SubscriptionRequiredException" -// The specified account does not have a subscription to Amazon S3. -// -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateStorageLocation -func (c *ElasticBeanstalk) CreateStorageLocation(input *CreateStorageLocationInput) (*CreateStorageLocationOutput, error) { - req, out := c.CreateStorageLocationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteApplication = "DeleteApplication" - -// DeleteApplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteApplicationRequest method. -// req, resp := client.DeleteApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplication -func (c *ElasticBeanstalk) DeleteApplicationRequest(input *DeleteApplicationInput) (req *request.Request, output *DeleteApplicationOutput) { - op := &request.Operation{ - Name: opDeleteApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteApplicationInput{} - } - - output = &DeleteApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApplication API operation for AWS Elastic Beanstalk. -// -// Deletes the specified application along with all associated versions and -// configurations. The application versions will not be deleted from your Amazon -// S3 bucket. -// -// You cannot delete an application that has a running environment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DeleteApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOperationInProgressException "OperationInProgressFailure" -// Unable to perform the specified operation because another operation that -// effects an element in this activity is already in progress. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplication -func (c *ElasticBeanstalk) DeleteApplication(input *DeleteApplicationInput) (*DeleteApplicationOutput, error) { - req, out := c.DeleteApplicationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteApplicationVersion = "DeleteApplicationVersion" - -// DeleteApplicationVersionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApplicationVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteApplicationVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteApplicationVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteApplicationVersionRequest method. -// req, resp := client.DeleteApplicationVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplicationVersion -func (c *ElasticBeanstalk) DeleteApplicationVersionRequest(input *DeleteApplicationVersionInput) (req *request.Request, output *DeleteApplicationVersionOutput) { - op := &request.Operation{ - Name: opDeleteApplicationVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteApplicationVersionInput{} - } - - output = &DeleteApplicationVersionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApplicationVersion API operation for AWS Elastic Beanstalk. -// -// Deletes the specified version from the specified application. -// -// You cannot delete an application version that is associated with a running -// environment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DeleteApplicationVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSourceBundleDeletionException "SourceBundleDeletionFailure" -// Unable to delete the Amazon S3 source bundle associated with the application -// version. The application version was deleted successfully. -// -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeOperationInProgressException "OperationInProgressFailure" -// Unable to perform the specified operation because another operation that -// effects an element in this activity is already in progress. -// -// * ErrCodeS3LocationNotInServiceRegionException "S3LocationNotInServiceRegionException" -// The specified S3 bucket does not belong to the S3 region in which the service -// is running. The following regions are supported: -// -// * IAD/us-east-1 -// -// * PDX/us-west-2 -// -// * DUB/eu-west-1 -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplicationVersion -func (c *ElasticBeanstalk) DeleteApplicationVersion(input *DeleteApplicationVersionInput) (*DeleteApplicationVersionOutput, error) { - req, out := c.DeleteApplicationVersionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteConfigurationTemplate = "DeleteConfigurationTemplate" - -// DeleteConfigurationTemplateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConfigurationTemplate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteConfigurationTemplate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteConfigurationTemplate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteConfigurationTemplateRequest method. -// req, resp := client.DeleteConfigurationTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteConfigurationTemplate -func (c *ElasticBeanstalk) DeleteConfigurationTemplateRequest(input *DeleteConfigurationTemplateInput) (req *request.Request, output *DeleteConfigurationTemplateOutput) { - op := &request.Operation{ - Name: opDeleteConfigurationTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteConfigurationTemplateInput{} - } - - output = &DeleteConfigurationTemplateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConfigurationTemplate API operation for AWS Elastic Beanstalk. -// -// Deletes the specified configuration template. -// -// When you launch an environment using a configuration template, the environment -// gets a copy of the template. You can delete or modify the environment's copy -// of the template without affecting the running environment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DeleteConfigurationTemplate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOperationInProgressException "OperationInProgressFailure" -// Unable to perform the specified operation because another operation that -// effects an element in this activity is already in progress. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteConfigurationTemplate -func (c *ElasticBeanstalk) DeleteConfigurationTemplate(input *DeleteConfigurationTemplateInput) (*DeleteConfigurationTemplateOutput, error) { - req, out := c.DeleteConfigurationTemplateRequest(input) - err := req.Send() - return out, err -} - -const opDeleteEnvironmentConfiguration = "DeleteEnvironmentConfiguration" - -// DeleteEnvironmentConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEnvironmentConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteEnvironmentConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteEnvironmentConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteEnvironmentConfigurationRequest method. -// req, resp := client.DeleteEnvironmentConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteEnvironmentConfiguration -func (c *ElasticBeanstalk) DeleteEnvironmentConfigurationRequest(input *DeleteEnvironmentConfigurationInput) (req *request.Request, output *DeleteEnvironmentConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteEnvironmentConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEnvironmentConfigurationInput{} - } - - output = &DeleteEnvironmentConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEnvironmentConfiguration API operation for AWS Elastic Beanstalk. -// -// Deletes the draft configuration associated with the running environment. -// -// Updating a running environment with any configuration changes creates a draft -// configuration set. You can get the draft configuration using DescribeConfigurationSettings -// while the update is in progress or if the update fails. The DeploymentStatus -// for the draft configuration indicates whether the deployment is in process -// or has failed. The draft configuration remains in existence until it is deleted -// with this action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DeleteEnvironmentConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteEnvironmentConfiguration -func (c *ElasticBeanstalk) DeleteEnvironmentConfiguration(input *DeleteEnvironmentConfigurationInput) (*DeleteEnvironmentConfigurationOutput, error) { - req, out := c.DeleteEnvironmentConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opDeletePlatformVersion = "DeletePlatformVersion" - -// DeletePlatformVersionRequest generates a "aws/request.Request" representing the -// client's request for the DeletePlatformVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePlatformVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePlatformVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePlatformVersionRequest method. -// req, resp := client.DeletePlatformVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeletePlatformVersion -func (c *ElasticBeanstalk) DeletePlatformVersionRequest(input *DeletePlatformVersionInput) (req *request.Request, output *DeletePlatformVersionOutput) { - op := &request.Operation{ - Name: opDeletePlatformVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePlatformVersionInput{} - } - - output = &DeletePlatformVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeletePlatformVersion API operation for AWS Elastic Beanstalk. -// -// Deletes the specified version of a custom 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 AWS Elastic Beanstalk's -// API operation DeletePlatformVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOperationInProgressException "OperationInProgressFailure" -// Unable to perform the specified operation because another operation that -// effects an element in this activity is already in progress. -// -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// * ErrCodePlatformVersionStillReferencedException "PlatformVersionStillReferencedException" -// You cannot delete the platform version because there are still environments -// running on it. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeletePlatformVersion -func (c *ElasticBeanstalk) DeletePlatformVersion(input *DeletePlatformVersionInput) (*DeletePlatformVersionOutput, error) { - req, out := c.DeletePlatformVersionRequest(input) - err := req.Send() - return out, err -} - -const opDescribeApplicationVersions = "DescribeApplicationVersions" - -// DescribeApplicationVersionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeApplicationVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeApplicationVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeApplicationVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeApplicationVersionsRequest method. -// req, resp := client.DescribeApplicationVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeApplicationVersions -func (c *ElasticBeanstalk) DescribeApplicationVersionsRequest(input *DescribeApplicationVersionsInput) (req *request.Request, output *DescribeApplicationVersionsOutput) { - op := &request.Operation{ - Name: opDescribeApplicationVersions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeApplicationVersionsInput{} - } - - output = &DescribeApplicationVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeApplicationVersions API operation for AWS Elastic Beanstalk. -// -// Retrieve a list of application versions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DescribeApplicationVersions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeApplicationVersions -func (c *ElasticBeanstalk) DescribeApplicationVersions(input *DescribeApplicationVersionsInput) (*DescribeApplicationVersionsOutput, error) { - req, out := c.DescribeApplicationVersionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeApplications = "DescribeApplications" - -// DescribeApplicationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeApplications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeApplications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeApplications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeApplicationsRequest method. -// req, resp := client.DescribeApplicationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeApplications -func (c *ElasticBeanstalk) DescribeApplicationsRequest(input *DescribeApplicationsInput) (req *request.Request, output *DescribeApplicationsOutput) { - op := &request.Operation{ - Name: opDescribeApplications, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeApplicationsInput{} - } - - output = &DescribeApplicationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeApplications API operation for AWS Elastic Beanstalk. -// -// Returns the descriptions of existing 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 AWS Elastic Beanstalk's -// API operation DescribeApplications for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeApplications -func (c *ElasticBeanstalk) DescribeApplications(input *DescribeApplicationsInput) (*DescribeApplicationsOutput, error) { - req, out := c.DescribeApplicationsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConfigurationOptions = "DescribeConfigurationOptions" - -// DescribeConfigurationOptionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConfigurationOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConfigurationOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConfigurationOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConfigurationOptionsRequest method. -// req, resp := client.DescribeConfigurationOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeConfigurationOptions -func (c *ElasticBeanstalk) DescribeConfigurationOptionsRequest(input *DescribeConfigurationOptionsInput) (req *request.Request, output *DescribeConfigurationOptionsOutput) { - op := &request.Operation{ - Name: opDescribeConfigurationOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConfigurationOptionsInput{} - } - - output = &DescribeConfigurationOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConfigurationOptions API operation for AWS Elastic Beanstalk. -// -// Describes the configuration options that are used in a particular configuration -// template or environment, or that a specified solution stack defines. The -// description includes the values the options, their default values, and an -// indication of the required action on a running environment if an option value -// is 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 AWS Elastic Beanstalk's -// API operation DescribeConfigurationOptions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyBucketsException "TooManyBucketsException" -// The specified account has reached its limit of Amazon S3 buckets. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeConfigurationOptions -func (c *ElasticBeanstalk) DescribeConfigurationOptions(input *DescribeConfigurationOptionsInput) (*DescribeConfigurationOptionsOutput, error) { - req, out := c.DescribeConfigurationOptionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConfigurationSettings = "DescribeConfigurationSettings" - -// DescribeConfigurationSettingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConfigurationSettings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConfigurationSettings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConfigurationSettings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConfigurationSettingsRequest method. -// req, resp := client.DescribeConfigurationSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeConfigurationSettings -func (c *ElasticBeanstalk) DescribeConfigurationSettingsRequest(input *DescribeConfigurationSettingsInput) (req *request.Request, output *DescribeConfigurationSettingsOutput) { - op := &request.Operation{ - Name: opDescribeConfigurationSettings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConfigurationSettingsInput{} - } - - output = &DescribeConfigurationSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConfigurationSettings API operation for AWS Elastic Beanstalk. -// -// Returns a description of the settings for the specified configuration set, -// that is, either a configuration template or the configuration set associated -// with a running environment. -// -// When describing the settings for the configuration set associated with a -// running environment, it is possible to receive two sets of setting descriptions. -// One is the deployed configuration set, and the other is a draft configuration -// of an environment that is either in the process of deployment or that failed -// to deploy. -// -// Related Topics -// -// * DeleteEnvironmentConfiguration -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DescribeConfigurationSettings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyBucketsException "TooManyBucketsException" -// The specified account has reached its limit of Amazon S3 buckets. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeConfigurationSettings -func (c *ElasticBeanstalk) DescribeConfigurationSettings(input *DescribeConfigurationSettingsInput) (*DescribeConfigurationSettingsOutput, error) { - req, out := c.DescribeConfigurationSettingsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEnvironmentHealth = "DescribeEnvironmentHealth" - -// DescribeEnvironmentHealthRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEnvironmentHealth operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEnvironmentHealth for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEnvironmentHealth method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEnvironmentHealthRequest method. -// req, resp := client.DescribeEnvironmentHealthRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentHealth -func (c *ElasticBeanstalk) DescribeEnvironmentHealthRequest(input *DescribeEnvironmentHealthInput) (req *request.Request, output *DescribeEnvironmentHealthOutput) { - op := &request.Operation{ - Name: opDescribeEnvironmentHealth, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEnvironmentHealthInput{} - } - - output = &DescribeEnvironmentHealthOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEnvironmentHealth API operation for AWS Elastic Beanstalk. -// -// Returns information about the overall health of the specified environment. -// The DescribeEnvironmentHealth operation is only available with AWS Elastic -// Beanstalk Enhanced Health. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DescribeEnvironmentHealth for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// One or more input parameters is not valid. Please correct the input parameters -// and try the operation again. -// -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentHealth -func (c *ElasticBeanstalk) DescribeEnvironmentHealth(input *DescribeEnvironmentHealthInput) (*DescribeEnvironmentHealthOutput, error) { - req, out := c.DescribeEnvironmentHealthRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEnvironmentManagedActionHistory = "DescribeEnvironmentManagedActionHistory" - -// DescribeEnvironmentManagedActionHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEnvironmentManagedActionHistory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEnvironmentManagedActionHistory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEnvironmentManagedActionHistory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEnvironmentManagedActionHistoryRequest method. -// req, resp := client.DescribeEnvironmentManagedActionHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActionHistory -func (c *ElasticBeanstalk) DescribeEnvironmentManagedActionHistoryRequest(input *DescribeEnvironmentManagedActionHistoryInput) (req *request.Request, output *DescribeEnvironmentManagedActionHistoryOutput) { - op := &request.Operation{ - Name: opDescribeEnvironmentManagedActionHistory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEnvironmentManagedActionHistoryInput{} - } - - output = &DescribeEnvironmentManagedActionHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEnvironmentManagedActionHistory API operation for AWS Elastic Beanstalk. -// -// Lists an environment's completed and failed managed actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DescribeEnvironmentManagedActionHistory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActionHistory -func (c *ElasticBeanstalk) DescribeEnvironmentManagedActionHistory(input *DescribeEnvironmentManagedActionHistoryInput) (*DescribeEnvironmentManagedActionHistoryOutput, error) { - req, out := c.DescribeEnvironmentManagedActionHistoryRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEnvironmentManagedActions = "DescribeEnvironmentManagedActions" - -// DescribeEnvironmentManagedActionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEnvironmentManagedActions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEnvironmentManagedActions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEnvironmentManagedActions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEnvironmentManagedActionsRequest method. -// req, resp := client.DescribeEnvironmentManagedActionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActions -func (c *ElasticBeanstalk) DescribeEnvironmentManagedActionsRequest(input *DescribeEnvironmentManagedActionsInput) (req *request.Request, output *DescribeEnvironmentManagedActionsOutput) { - op := &request.Operation{ - Name: opDescribeEnvironmentManagedActions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEnvironmentManagedActionsInput{} - } - - output = &DescribeEnvironmentManagedActionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEnvironmentManagedActions API operation for AWS Elastic Beanstalk. -// -// Lists an environment's upcoming and in-progress managed actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DescribeEnvironmentManagedActions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActions -func (c *ElasticBeanstalk) DescribeEnvironmentManagedActions(input *DescribeEnvironmentManagedActionsInput) (*DescribeEnvironmentManagedActionsOutput, error) { - req, out := c.DescribeEnvironmentManagedActionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEnvironmentResources = "DescribeEnvironmentResources" - -// DescribeEnvironmentResourcesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEnvironmentResources operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEnvironmentResources for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEnvironmentResources method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEnvironmentResourcesRequest method. -// req, resp := client.DescribeEnvironmentResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentResources -func (c *ElasticBeanstalk) DescribeEnvironmentResourcesRequest(input *DescribeEnvironmentResourcesInput) (req *request.Request, output *DescribeEnvironmentResourcesOutput) { - op := &request.Operation{ - Name: opDescribeEnvironmentResources, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEnvironmentResourcesInput{} - } - - output = &DescribeEnvironmentResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEnvironmentResources API operation for AWS Elastic Beanstalk. -// -// Returns AWS resources for this environment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DescribeEnvironmentResources for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentResources -func (c *ElasticBeanstalk) DescribeEnvironmentResources(input *DescribeEnvironmentResourcesInput) (*DescribeEnvironmentResourcesOutput, error) { - req, out := c.DescribeEnvironmentResourcesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEnvironments = "DescribeEnvironments" - -// DescribeEnvironmentsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEnvironments operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEnvironments for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEnvironments method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEnvironmentsRequest method. -// req, resp := client.DescribeEnvironmentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironments -func (c *ElasticBeanstalk) DescribeEnvironmentsRequest(input *DescribeEnvironmentsInput) (req *request.Request, output *EnvironmentDescriptionsMessage) { - op := &request.Operation{ - Name: opDescribeEnvironments, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEnvironmentsInput{} - } - - output = &EnvironmentDescriptionsMessage{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEnvironments API operation for AWS Elastic Beanstalk. -// -// Returns descriptions for existing environments. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation DescribeEnvironments for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironments -func (c *ElasticBeanstalk) DescribeEnvironments(input *DescribeEnvironmentsInput) (*EnvironmentDescriptionsMessage, error) { - req, out := c.DescribeEnvironmentsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEvents = "DescribeEvents" - -// DescribeEventsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventsRequest method. -// req, resp := client.DescribeEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEvents -func (c *ElasticBeanstalk) DescribeEventsRequest(input *DescribeEventsInput) (req *request.Request, output *DescribeEventsOutput) { - op := &request.Operation{ - Name: opDescribeEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEventsInput{} - } - - output = &DescribeEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEvents API operation for AWS Elastic Beanstalk. -// -// Returns list of event descriptions matching criteria up to the last 6 weeks. -// -// This action returns the most recent 1,000 events from the specified 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 AWS Elastic Beanstalk's -// API operation DescribeEvents for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEvents -func (c *ElasticBeanstalk) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error) { - req, out := c.DescribeEventsRequest(input) - err := req.Send() - return out, err -} - -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents 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 DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElasticBeanstalk) DescribeEventsPages(input *DescribeEventsInput, fn func(p *DescribeEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventsOutput), lastPage) - }) -} - -const opDescribeInstancesHealth = "DescribeInstancesHealth" - -// DescribeInstancesHealthRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstancesHealth operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstancesHealth for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstancesHealth method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstancesHealthRequest method. -// req, resp := client.DescribeInstancesHealthRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeInstancesHealth -func (c *ElasticBeanstalk) DescribeInstancesHealthRequest(input *DescribeInstancesHealthInput) (req *request.Request, output *DescribeInstancesHealthOutput) { - op := &request.Operation{ - Name: opDescribeInstancesHealth, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstancesHealthInput{} - } - - output = &DescribeInstancesHealthOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstancesHealth API operation for AWS Elastic Beanstalk. -// -// Retrives detailed information about the health of instances in your AWS Elastic -// Beanstalk. This operation requires enhanced health reporting (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced.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 AWS Elastic Beanstalk's -// API operation DescribeInstancesHealth for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// One or more input parameters is not valid. Please correct the input parameters -// and try the operation again. -// -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeInstancesHealth -func (c *ElasticBeanstalk) DescribeInstancesHealth(input *DescribeInstancesHealthInput) (*DescribeInstancesHealthOutput, error) { - req, out := c.DescribeInstancesHealthRequest(input) - err := req.Send() - return out, err -} - -const opDescribePlatformVersion = "DescribePlatformVersion" - -// DescribePlatformVersionRequest generates a "aws/request.Request" representing the -// client's request for the DescribePlatformVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePlatformVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePlatformVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePlatformVersionRequest method. -// req, resp := client.DescribePlatformVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribePlatformVersion -func (c *ElasticBeanstalk) DescribePlatformVersionRequest(input *DescribePlatformVersionInput) (req *request.Request, output *DescribePlatformVersionOutput) { - op := &request.Operation{ - Name: opDescribePlatformVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePlatformVersionInput{} - } - - output = &DescribePlatformVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePlatformVersion API operation for AWS Elastic Beanstalk. -// -// Describes the version of the 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 AWS Elastic Beanstalk's -// API operation DescribePlatformVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribePlatformVersion -func (c *ElasticBeanstalk) DescribePlatformVersion(input *DescribePlatformVersionInput) (*DescribePlatformVersionOutput, error) { - req, out := c.DescribePlatformVersionRequest(input) - err := req.Send() - return out, err -} - -const opListAvailableSolutionStacks = "ListAvailableSolutionStacks" - -// ListAvailableSolutionStacksRequest generates a "aws/request.Request" representing the -// client's request for the ListAvailableSolutionStacks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAvailableSolutionStacks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAvailableSolutionStacks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAvailableSolutionStacksRequest method. -// req, resp := client.ListAvailableSolutionStacksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListAvailableSolutionStacks -func (c *ElasticBeanstalk) ListAvailableSolutionStacksRequest(input *ListAvailableSolutionStacksInput) (req *request.Request, output *ListAvailableSolutionStacksOutput) { - op := &request.Operation{ - Name: opListAvailableSolutionStacks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAvailableSolutionStacksInput{} - } - - output = &ListAvailableSolutionStacksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAvailableSolutionStacks API operation for AWS Elastic Beanstalk. -// -// Returns a list of the available solution stack names, with the public version -// first and then in reverse chronological 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 AWS Elastic Beanstalk's -// API operation ListAvailableSolutionStacks for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListAvailableSolutionStacks -func (c *ElasticBeanstalk) ListAvailableSolutionStacks(input *ListAvailableSolutionStacksInput) (*ListAvailableSolutionStacksOutput, error) { - req, out := c.ListAvailableSolutionStacksRequest(input) - err := req.Send() - return out, err -} - -const opListPlatformVersions = "ListPlatformVersions" - -// ListPlatformVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListPlatformVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListPlatformVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListPlatformVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPlatformVersionsRequest method. -// req, resp := client.ListPlatformVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListPlatformVersions -func (c *ElasticBeanstalk) ListPlatformVersionsRequest(input *ListPlatformVersionsInput) (req *request.Request, output *ListPlatformVersionsOutput) { - op := &request.Operation{ - Name: opListPlatformVersions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListPlatformVersionsInput{} - } - - output = &ListPlatformVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPlatformVersions API operation for AWS Elastic Beanstalk. -// -// Lists the available platforms. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation ListPlatformVersions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeServiceException "ServiceException" -// A generic service exception has occurred. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListPlatformVersions -func (c *ElasticBeanstalk) ListPlatformVersions(input *ListPlatformVersionsInput) (*ListPlatformVersionsOutput, error) { - req, out := c.ListPlatformVersionsRequest(input) - err := req.Send() - return out, err -} - -const opRebuildEnvironment = "RebuildEnvironment" - -// RebuildEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the RebuildEnvironment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RebuildEnvironment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RebuildEnvironment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RebuildEnvironmentRequest method. -// req, resp := client.RebuildEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RebuildEnvironment -func (c *ElasticBeanstalk) RebuildEnvironmentRequest(input *RebuildEnvironmentInput) (req *request.Request, output *RebuildEnvironmentOutput) { - op := &request.Operation{ - Name: opRebuildEnvironment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RebuildEnvironmentInput{} - } - - output = &RebuildEnvironmentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RebuildEnvironment API operation for AWS Elastic Beanstalk. -// -// Deletes and recreates all of the AWS resources (for example: the Auto Scaling -// group, load balancer, etc.) for a specified environment and forces a restart. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation RebuildEnvironment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RebuildEnvironment -func (c *ElasticBeanstalk) RebuildEnvironment(input *RebuildEnvironmentInput) (*RebuildEnvironmentOutput, error) { - req, out := c.RebuildEnvironmentRequest(input) - err := req.Send() - return out, err -} - -const opRequestEnvironmentInfo = "RequestEnvironmentInfo" - -// RequestEnvironmentInfoRequest generates a "aws/request.Request" representing the -// client's request for the RequestEnvironmentInfo operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RequestEnvironmentInfo for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RequestEnvironmentInfo method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RequestEnvironmentInfoRequest method. -// req, resp := client.RequestEnvironmentInfoRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RequestEnvironmentInfo -func (c *ElasticBeanstalk) RequestEnvironmentInfoRequest(input *RequestEnvironmentInfoInput) (req *request.Request, output *RequestEnvironmentInfoOutput) { - op := &request.Operation{ - Name: opRequestEnvironmentInfo, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RequestEnvironmentInfoInput{} - } - - output = &RequestEnvironmentInfoOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RequestEnvironmentInfo API operation for AWS Elastic Beanstalk. -// -// Initiates a request to compile the specified type of information of the deployed -// environment. -// -// Setting the InfoType to tail compiles the last lines from the application -// server log files of every Amazon EC2 instance in your environment. -// -// Setting the InfoType to bundle compresses the application server log files -// for every Amazon EC2 instance into a .zip file. Legacy and .NET containers -// do not support bundle logs. -// -// Use RetrieveEnvironmentInfo to obtain the set of logs. -// -// Related Topics -// -// * RetrieveEnvironmentInfo -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation RequestEnvironmentInfo for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RequestEnvironmentInfo -func (c *ElasticBeanstalk) RequestEnvironmentInfo(input *RequestEnvironmentInfoInput) (*RequestEnvironmentInfoOutput, error) { - req, out := c.RequestEnvironmentInfoRequest(input) - err := req.Send() - return out, err -} - -const opRestartAppServer = "RestartAppServer" - -// RestartAppServerRequest generates a "aws/request.Request" representing the -// client's request for the RestartAppServer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestartAppServer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestartAppServer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestartAppServerRequest method. -// req, resp := client.RestartAppServerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RestartAppServer -func (c *ElasticBeanstalk) RestartAppServerRequest(input *RestartAppServerInput) (req *request.Request, output *RestartAppServerOutput) { - op := &request.Operation{ - Name: opRestartAppServer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestartAppServerInput{} - } - - output = &RestartAppServerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RestartAppServer API operation for AWS Elastic Beanstalk. -// -// Causes the environment to restart the application container server running -// on each Amazon EC2 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 AWS Elastic Beanstalk's -// API operation RestartAppServer for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RestartAppServer -func (c *ElasticBeanstalk) RestartAppServer(input *RestartAppServerInput) (*RestartAppServerOutput, error) { - req, out := c.RestartAppServerRequest(input) - err := req.Send() - return out, err -} - -const opRetrieveEnvironmentInfo = "RetrieveEnvironmentInfo" - -// RetrieveEnvironmentInfoRequest generates a "aws/request.Request" representing the -// client's request for the RetrieveEnvironmentInfo operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RetrieveEnvironmentInfo for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RetrieveEnvironmentInfo method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RetrieveEnvironmentInfoRequest method. -// req, resp := client.RetrieveEnvironmentInfoRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RetrieveEnvironmentInfo -func (c *ElasticBeanstalk) RetrieveEnvironmentInfoRequest(input *RetrieveEnvironmentInfoInput) (req *request.Request, output *RetrieveEnvironmentInfoOutput) { - op := &request.Operation{ - Name: opRetrieveEnvironmentInfo, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RetrieveEnvironmentInfoInput{} - } - - output = &RetrieveEnvironmentInfoOutput{} - req = c.newRequest(op, input, output) - return -} - -// RetrieveEnvironmentInfo API operation for AWS Elastic Beanstalk. -// -// Retrieves the compiled information from a RequestEnvironmentInfo request. -// -// Related Topics -// -// * RequestEnvironmentInfo -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation RetrieveEnvironmentInfo for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RetrieveEnvironmentInfo -func (c *ElasticBeanstalk) RetrieveEnvironmentInfo(input *RetrieveEnvironmentInfoInput) (*RetrieveEnvironmentInfoOutput, error) { - req, out := c.RetrieveEnvironmentInfoRequest(input) - err := req.Send() - return out, err -} - -const opSwapEnvironmentCNAMEs = "SwapEnvironmentCNAMEs" - -// SwapEnvironmentCNAMEsRequest generates a "aws/request.Request" representing the -// client's request for the SwapEnvironmentCNAMEs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SwapEnvironmentCNAMEs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SwapEnvironmentCNAMEs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SwapEnvironmentCNAMEsRequest method. -// req, resp := client.SwapEnvironmentCNAMEsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs -func (c *ElasticBeanstalk) SwapEnvironmentCNAMEsRequest(input *SwapEnvironmentCNAMEsInput) (req *request.Request, output *SwapEnvironmentCNAMEsOutput) { - op := &request.Operation{ - Name: opSwapEnvironmentCNAMEs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SwapEnvironmentCNAMEsInput{} - } - - output = &SwapEnvironmentCNAMEsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SwapEnvironmentCNAMEs API operation for AWS Elastic Beanstalk. -// -// Swaps the CNAMEs of two environments. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation SwapEnvironmentCNAMEs for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs -func (c *ElasticBeanstalk) SwapEnvironmentCNAMEs(input *SwapEnvironmentCNAMEsInput) (*SwapEnvironmentCNAMEsOutput, error) { - req, out := c.SwapEnvironmentCNAMEsRequest(input) - err := req.Send() - return out, err -} - -const opTerminateEnvironment = "TerminateEnvironment" - -// TerminateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the TerminateEnvironment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TerminateEnvironment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TerminateEnvironment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TerminateEnvironmentRequest method. -// req, resp := client.TerminateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/TerminateEnvironment -func (c *ElasticBeanstalk) TerminateEnvironmentRequest(input *TerminateEnvironmentInput) (req *request.Request, output *EnvironmentDescription) { - op := &request.Operation{ - Name: opTerminateEnvironment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TerminateEnvironmentInput{} - } - - output = &EnvironmentDescription{} - req = c.newRequest(op, input, output) - return -} - -// TerminateEnvironment API operation for AWS Elastic Beanstalk. -// -// Terminates the specified environment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation TerminateEnvironment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/TerminateEnvironment -func (c *ElasticBeanstalk) TerminateEnvironment(input *TerminateEnvironmentInput) (*EnvironmentDescription, error) { - req, out := c.TerminateEnvironmentRequest(input) - err := req.Send() - return out, err -} - -const opUpdateApplication = "UpdateApplication" - -// UpdateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateApplicationRequest method. -// req, resp := client.UpdateApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplication -func (c *ElasticBeanstalk) UpdateApplicationRequest(input *UpdateApplicationInput) (req *request.Request, output *ApplicationDescriptionMessage) { - op := &request.Operation{ - Name: opUpdateApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateApplicationInput{} - } - - output = &ApplicationDescriptionMessage{} - req = c.newRequest(op, input, output) - return -} - -// UpdateApplication API operation for AWS Elastic Beanstalk. -// -// Updates the specified application to have the specified properties. -// -// If a property (for example, description) is not provided, the value remains -// unchanged. To clear these properties, specify an empty string. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation UpdateApplication for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplication -func (c *ElasticBeanstalk) UpdateApplication(input *UpdateApplicationInput) (*ApplicationDescriptionMessage, error) { - req, out := c.UpdateApplicationRequest(input) - err := req.Send() - return out, err -} - -const opUpdateApplicationResourceLifecycle = "UpdateApplicationResourceLifecycle" - -// UpdateApplicationResourceLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplicationResourceLifecycle operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateApplicationResourceLifecycle for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateApplicationResourceLifecycle method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateApplicationResourceLifecycleRequest method. -// req, resp := client.UpdateApplicationResourceLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationResourceLifecycle -func (c *ElasticBeanstalk) UpdateApplicationResourceLifecycleRequest(input *UpdateApplicationResourceLifecycleInput) (req *request.Request, output *UpdateApplicationResourceLifecycleOutput) { - op := &request.Operation{ - Name: opUpdateApplicationResourceLifecycle, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateApplicationResourceLifecycleInput{} - } - - output = &UpdateApplicationResourceLifecycleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateApplicationResourceLifecycle API operation for AWS Elastic Beanstalk. -// -// Modifies lifecycle settings for an application. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation UpdateApplicationResourceLifecycle for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationResourceLifecycle -func (c *ElasticBeanstalk) UpdateApplicationResourceLifecycle(input *UpdateApplicationResourceLifecycleInput) (*UpdateApplicationResourceLifecycleOutput, error) { - req, out := c.UpdateApplicationResourceLifecycleRequest(input) - err := req.Send() - return out, err -} - -const opUpdateApplicationVersion = "UpdateApplicationVersion" - -// UpdateApplicationVersionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplicationVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateApplicationVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateApplicationVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateApplicationVersionRequest method. -// req, resp := client.UpdateApplicationVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationVersion -func (c *ElasticBeanstalk) UpdateApplicationVersionRequest(input *UpdateApplicationVersionInput) (req *request.Request, output *ApplicationVersionDescriptionMessage) { - op := &request.Operation{ - Name: opUpdateApplicationVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateApplicationVersionInput{} - } - - output = &ApplicationVersionDescriptionMessage{} - req = c.newRequest(op, input, output) - return -} - -// UpdateApplicationVersion API operation for AWS Elastic Beanstalk. -// -// Updates the specified application version to have the specified properties. -// -// If a property (for example, description) is not provided, the value remains -// unchanged. To clear properties, specify an empty string. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation UpdateApplicationVersion for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationVersion -func (c *ElasticBeanstalk) UpdateApplicationVersion(input *UpdateApplicationVersionInput) (*ApplicationVersionDescriptionMessage, error) { - req, out := c.UpdateApplicationVersionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateConfigurationTemplate = "UpdateConfigurationTemplate" - -// UpdateConfigurationTemplateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateConfigurationTemplate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateConfigurationTemplate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateConfigurationTemplate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateConfigurationTemplateRequest method. -// req, resp := client.UpdateConfigurationTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateConfigurationTemplate -func (c *ElasticBeanstalk) UpdateConfigurationTemplateRequest(input *UpdateConfigurationTemplateInput) (req *request.Request, output *ConfigurationSettingsDescription) { - op := &request.Operation{ - Name: opUpdateConfigurationTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateConfigurationTemplateInput{} - } - - output = &ConfigurationSettingsDescription{} - req = c.newRequest(op, input, output) - return -} - -// UpdateConfigurationTemplate API operation for AWS Elastic Beanstalk. -// -// Updates the specified configuration template to have the specified properties -// or configuration option values. -// -// If a property (for example, ApplicationName) is not provided, its value remains -// unchanged. To clear such properties, specify an empty string. -// -// Related Topics -// -// * DescribeConfigurationOptions -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation UpdateConfigurationTemplate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeTooManyBucketsException "TooManyBucketsException" -// The specified account has reached its limit of Amazon S3 buckets. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateConfigurationTemplate -func (c *ElasticBeanstalk) UpdateConfigurationTemplate(input *UpdateConfigurationTemplateInput) (*ConfigurationSettingsDescription, error) { - req, out := c.UpdateConfigurationTemplateRequest(input) - err := req.Send() - return out, err -} - -const opUpdateEnvironment = "UpdateEnvironment" - -// UpdateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEnvironment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateEnvironment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateEnvironment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateEnvironmentRequest method. -// req, resp := client.UpdateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateEnvironment -func (c *ElasticBeanstalk) UpdateEnvironmentRequest(input *UpdateEnvironmentInput) (req *request.Request, output *EnvironmentDescription) { - op := &request.Operation{ - Name: opUpdateEnvironment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateEnvironmentInput{} - } - - output = &EnvironmentDescription{} - req = c.newRequest(op, input, output) - return -} - -// UpdateEnvironment API operation for AWS Elastic Beanstalk. -// -// Updates the environment description, deploys a new application version, updates -// the configuration settings to an entirely new configuration template, or -// updates select configuration option values in the running environment. -// -// Attempting to update both the release and configuration is not allowed and -// AWS Elastic Beanstalk returns an InvalidParameterCombination error. -// -// When updating the configuration settings to a new template or individual -// settings, a draft configuration is created and DescribeConfigurationSettings -// for this environment returns two setting descriptions with different DeploymentStatus -// values. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation UpdateEnvironment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeTooManyBucketsException "TooManyBucketsException" -// The specified account has reached its limit of Amazon S3 buckets. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateEnvironment -func (c *ElasticBeanstalk) UpdateEnvironment(input *UpdateEnvironmentInput) (*EnvironmentDescription, error) { - req, out := c.UpdateEnvironmentRequest(input) - err := req.Send() - return out, err -} - -const opValidateConfigurationSettings = "ValidateConfigurationSettings" - -// ValidateConfigurationSettingsRequest generates a "aws/request.Request" representing the -// client's request for the ValidateConfigurationSettings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ValidateConfigurationSettings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ValidateConfigurationSettings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ValidateConfigurationSettingsRequest method. -// req, resp := client.ValidateConfigurationSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ValidateConfigurationSettings -func (c *ElasticBeanstalk) ValidateConfigurationSettingsRequest(input *ValidateConfigurationSettingsInput) (req *request.Request, output *ValidateConfigurationSettingsOutput) { - op := &request.Operation{ - Name: opValidateConfigurationSettings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ValidateConfigurationSettingsInput{} - } - - output = &ValidateConfigurationSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ValidateConfigurationSettings API operation for AWS Elastic Beanstalk. -// -// Takes a set of configuration settings and either a configuration template -// or environment, and determines whether those values are valid. -// -// This action returns a list of messages indicating any errors or warnings -// associated with the selection of option values. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Elastic Beanstalk's -// API operation ValidateConfigurationSettings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInsufficientPrivilegesException "InsufficientPrivilegesException" -// The specified account does not have sufficient privileges for one of more -// AWS services. -// -// * ErrCodeTooManyBucketsException "TooManyBucketsException" -// The specified account has reached its limit of Amazon S3 buckets. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ValidateConfigurationSettings -func (c *ElasticBeanstalk) ValidateConfigurationSettings(input *ValidateConfigurationSettingsInput) (*ValidateConfigurationSettingsOutput, error) { - req, out := c.ValidateConfigurationSettingsRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AbortEnvironmentUpdateMessage -type AbortEnvironmentUpdateInput struct { - _ struct{} `type:"structure"` - - // This specifies the ID of the environment with the in-progress update that - // you want to cancel. - EnvironmentId *string `type:"string"` - - // This specifies the name of the environment with the in-progress update that - // you want to cancel. - EnvironmentName *string `min:"4" type:"string"` -} - -// String returns the string representation -func (s AbortEnvironmentUpdateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AbortEnvironmentUpdateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AbortEnvironmentUpdateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AbortEnvironmentUpdateInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *AbortEnvironmentUpdateInput) SetEnvironmentId(v string) *AbortEnvironmentUpdateInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *AbortEnvironmentUpdateInput) SetEnvironmentName(v string) *AbortEnvironmentUpdateInput { - s.EnvironmentName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AbortEnvironmentUpdateOutput -type AbortEnvironmentUpdateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AbortEnvironmentUpdateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AbortEnvironmentUpdateOutput) GoString() string { - return s.String() -} - -// Describes the properties of an application. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationDescription -type ApplicationDescription struct { - _ struct{} `type:"structure"` - - // The name of the application. - ApplicationName *string `min:"1" type:"string"` - - // The names of the configuration templates associated with this application. - ConfigurationTemplates []*string `type:"list"` - - // The date when the application was created. - DateCreated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The date when the application was last modified. - DateUpdated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // User-defined description of the application. - Description *string `type:"string"` - - // The lifecycle settings for the application. - ResourceLifecycleConfig *ApplicationResourceLifecycleConfig `type:"structure"` - - // The names of the versions for this application. - Versions []*string `type:"list"` -} - -// String returns the string representation -func (s ApplicationDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplicationDescription) GoString() string { - return s.String() -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ApplicationDescription) SetApplicationName(v string) *ApplicationDescription { - s.ApplicationName = &v - return s -} - -// SetConfigurationTemplates sets the ConfigurationTemplates field's value. -func (s *ApplicationDescription) SetConfigurationTemplates(v []*string) *ApplicationDescription { - s.ConfigurationTemplates = v - return s -} - -// SetDateCreated sets the DateCreated field's value. -func (s *ApplicationDescription) SetDateCreated(v time.Time) *ApplicationDescription { - s.DateCreated = &v - return s -} - -// SetDateUpdated sets the DateUpdated field's value. -func (s *ApplicationDescription) SetDateUpdated(v time.Time) *ApplicationDescription { - s.DateUpdated = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ApplicationDescription) SetDescription(v string) *ApplicationDescription { - s.Description = &v - return s -} - -// SetResourceLifecycleConfig sets the ResourceLifecycleConfig field's value. -func (s *ApplicationDescription) SetResourceLifecycleConfig(v *ApplicationResourceLifecycleConfig) *ApplicationDescription { - s.ResourceLifecycleConfig = v - return s -} - -// SetVersions sets the Versions field's value. -func (s *ApplicationDescription) SetVersions(v []*string) *ApplicationDescription { - s.Versions = v - return s -} - -// Result message containing a single description of an application. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationDescriptionMessage -type ApplicationDescriptionMessage struct { - _ struct{} `type:"structure"` - - // The ApplicationDescription of the application. - Application *ApplicationDescription `type:"structure"` -} - -// String returns the string representation -func (s ApplicationDescriptionMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplicationDescriptionMessage) GoString() string { - return s.String() -} - -// SetApplication sets the Application field's value. -func (s *ApplicationDescriptionMessage) SetApplication(v *ApplicationDescription) *ApplicationDescriptionMessage { - s.Application = v - return s -} - -// Application request metrics for an AWS Elastic Beanstalk environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationMetrics -type ApplicationMetrics struct { - _ struct{} `type:"structure"` - - // The amount of time that the metrics cover (usually 10 seconds). For example, - // you might have 5 requests (request_count) within the most recent time slice - // of 10 seconds (duration). - Duration *int64 `type:"integer"` - - // Represents the average latency for the slowest X percent of requests over - // the last 10 seconds. Latencies are in seconds with one millisecond resolution. - Latency *Latency `type:"structure"` - - // Average number of requests handled by the web server per second over the - // last 10 seconds. - RequestCount *int64 `type:"integer"` - - // Represents the percentage of requests over the last 10 seconds that resulted - // in each type of status code response. - StatusCodes *StatusCodes `type:"structure"` -} - -// String returns the string representation -func (s ApplicationMetrics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplicationMetrics) GoString() string { - return s.String() -} - -// SetDuration sets the Duration field's value. -func (s *ApplicationMetrics) SetDuration(v int64) *ApplicationMetrics { - s.Duration = &v - return s -} - -// SetLatency sets the Latency field's value. -func (s *ApplicationMetrics) SetLatency(v *Latency) *ApplicationMetrics { - s.Latency = v - return s -} - -// SetRequestCount sets the RequestCount field's value. -func (s *ApplicationMetrics) SetRequestCount(v int64) *ApplicationMetrics { - s.RequestCount = &v - return s -} - -// SetStatusCodes sets the StatusCodes field's value. -func (s *ApplicationMetrics) SetStatusCodes(v *StatusCodes) *ApplicationMetrics { - s.StatusCodes = v - return s -} - -// The resource lifecycle configuration for an application. Defines lifecycle -// settings for resources that belong to the application, and the service role -// that Elastic Beanstalk assumes in order to apply lifecycle settings. The -// version lifecycle configuration defines lifecycle settings for application -// versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationResourceLifecycleConfig -type ApplicationResourceLifecycleConfig struct { - _ struct{} `type:"structure"` - - // The ARN of an IAM service role that Elastic Beanstalk has permission to assume. - ServiceRole *string `type:"string"` - - // The application version lifecycle configuration. - VersionLifecycleConfig *ApplicationVersionLifecycleConfig `type:"structure"` -} - -// String returns the string representation -func (s ApplicationResourceLifecycleConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplicationResourceLifecycleConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApplicationResourceLifecycleConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplicationResourceLifecycleConfig"} - if s.VersionLifecycleConfig != nil { - if err := s.VersionLifecycleConfig.Validate(); err != nil { - invalidParams.AddNested("VersionLifecycleConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *ApplicationResourceLifecycleConfig) SetServiceRole(v string) *ApplicationResourceLifecycleConfig { - s.ServiceRole = &v - return s -} - -// SetVersionLifecycleConfig sets the VersionLifecycleConfig field's value. -func (s *ApplicationResourceLifecycleConfig) SetVersionLifecycleConfig(v *ApplicationVersionLifecycleConfig) *ApplicationResourceLifecycleConfig { - s.VersionLifecycleConfig = v - return s -} - -// Describes the properties of an application version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationVersionDescription -type ApplicationVersionDescription struct { - _ struct{} `type:"structure"` - - // The name of the application to which the application version belongs. - ApplicationName *string `min:"1" type:"string"` - - // Reference to the artifact from the AWS CodeBuild build. - BuildArn *string `type:"string"` - - // The creation date of the application version. - DateCreated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The last modified date of the application version. - DateUpdated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The description of the application version. - Description *string `type:"string"` - - // If the version's source code was retrieved from AWS CodeCommit, the location - // of the source code for the application version. - SourceBuildInformation *SourceBuildInformation `type:"structure"` - - // The storage location of the application version's source bundle in Amazon - // S3. - SourceBundle *S3Location `type:"structure"` - - // The processing status of the application version. - Status *string `type:"string" enum:"ApplicationVersionStatus"` - - // A unique identifier for the application version. - VersionLabel *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ApplicationVersionDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplicationVersionDescription) GoString() string { - return s.String() -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ApplicationVersionDescription) SetApplicationName(v string) *ApplicationVersionDescription { - s.ApplicationName = &v - return s -} - -// SetBuildArn sets the BuildArn field's value. -func (s *ApplicationVersionDescription) SetBuildArn(v string) *ApplicationVersionDescription { - s.BuildArn = &v - return s -} - -// SetDateCreated sets the DateCreated field's value. -func (s *ApplicationVersionDescription) SetDateCreated(v time.Time) *ApplicationVersionDescription { - s.DateCreated = &v - return s -} - -// SetDateUpdated sets the DateUpdated field's value. -func (s *ApplicationVersionDescription) SetDateUpdated(v time.Time) *ApplicationVersionDescription { - s.DateUpdated = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ApplicationVersionDescription) SetDescription(v string) *ApplicationVersionDescription { - s.Description = &v - return s -} - -// SetSourceBuildInformation sets the SourceBuildInformation field's value. -func (s *ApplicationVersionDescription) SetSourceBuildInformation(v *SourceBuildInformation) *ApplicationVersionDescription { - s.SourceBuildInformation = v - return s -} - -// SetSourceBundle sets the SourceBundle field's value. -func (s *ApplicationVersionDescription) SetSourceBundle(v *S3Location) *ApplicationVersionDescription { - s.SourceBundle = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ApplicationVersionDescription) SetStatus(v string) *ApplicationVersionDescription { - s.Status = &v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *ApplicationVersionDescription) SetVersionLabel(v string) *ApplicationVersionDescription { - s.VersionLabel = &v - return s -} - -// Result message wrapping a single description of an application version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationVersionDescriptionMessage -type ApplicationVersionDescriptionMessage struct { - _ struct{} `type:"structure"` - - // The ApplicationVersionDescription of the application version. - ApplicationVersion *ApplicationVersionDescription `type:"structure"` -} - -// String returns the string representation -func (s ApplicationVersionDescriptionMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplicationVersionDescriptionMessage) GoString() string { - return s.String() -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *ApplicationVersionDescriptionMessage) SetApplicationVersion(v *ApplicationVersionDescription) *ApplicationVersionDescriptionMessage { - s.ApplicationVersion = v - return s -} - -// The application version lifecycle settings for an application. Defines the -// rules that Elastic Beanstalk applies to an application's versions in order -// to avoid hitting the per-region limit for application versions. -// -// When Elastic Beanstalk deletes an application version from its database, -// you can no longer deploy that version to an environment. The source bundle -// remains in S3 unless you configure the rule to delete it. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationVersionLifecycleConfig -type ApplicationVersionLifecycleConfig struct { - _ struct{} `type:"structure"` - - // Specify a max age rule to restrict the length of time that application versions - // are retained for an application. - MaxAgeRule *MaxAgeRule `type:"structure"` - - // Specify a max count rule to restrict the number of application versions that - // are retained for an application. - MaxCountRule *MaxCountRule `type:"structure"` -} - -// String returns the string representation -func (s ApplicationVersionLifecycleConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplicationVersionLifecycleConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApplicationVersionLifecycleConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplicationVersionLifecycleConfig"} - if s.MaxAgeRule != nil { - if err := s.MaxAgeRule.Validate(); err != nil { - invalidParams.AddNested("MaxAgeRule", err.(request.ErrInvalidParams)) - } - } - if s.MaxCountRule != nil { - if err := s.MaxCountRule.Validate(); err != nil { - invalidParams.AddNested("MaxCountRule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxAgeRule sets the MaxAgeRule field's value. -func (s *ApplicationVersionLifecycleConfig) SetMaxAgeRule(v *MaxAgeRule) *ApplicationVersionLifecycleConfig { - s.MaxAgeRule = v - return s -} - -// SetMaxCountRule sets the MaxCountRule field's value. -func (s *ApplicationVersionLifecycleConfig) SetMaxCountRule(v *MaxCountRule) *ApplicationVersionLifecycleConfig { - s.MaxCountRule = v - return s -} - -// Request to execute a scheduled managed action immediately. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplyEnvironmentManagedActionRequest -type ApplyEnvironmentManagedActionInput struct { - _ struct{} `type:"structure"` - - // The action ID of the scheduled managed action to execute. - // - // ActionId is a required field - ActionId *string `type:"string" required:"true"` - - // The environment ID of the target environment. - EnvironmentId *string `type:"string"` - - // The name of the target environment. - EnvironmentName *string `type:"string"` -} - -// String returns the string representation -func (s ApplyEnvironmentManagedActionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplyEnvironmentManagedActionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApplyEnvironmentManagedActionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplyEnvironmentManagedActionInput"} - if s.ActionId == nil { - invalidParams.Add(request.NewErrParamRequired("ActionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionId sets the ActionId field's value. -func (s *ApplyEnvironmentManagedActionInput) SetActionId(v string) *ApplyEnvironmentManagedActionInput { - s.ActionId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *ApplyEnvironmentManagedActionInput) SetEnvironmentId(v string) *ApplyEnvironmentManagedActionInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *ApplyEnvironmentManagedActionInput) SetEnvironmentName(v string) *ApplyEnvironmentManagedActionInput { - s.EnvironmentName = &v - return s -} - -// The result message containing information about the managed action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplyEnvironmentManagedActionResult -type ApplyEnvironmentManagedActionOutput struct { - _ struct{} `type:"structure"` - - // A description of the managed action. - ActionDescription *string `type:"string"` - - // The action ID of the managed action. - ActionId *string `type:"string"` - - // The type of managed action. - ActionType *string `type:"string" enum:"ActionType"` - - // The status of the managed action. - Status *string `type:"string"` -} - -// String returns the string representation -func (s ApplyEnvironmentManagedActionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplyEnvironmentManagedActionOutput) GoString() string { - return s.String() -} - -// SetActionDescription sets the ActionDescription field's value. -func (s *ApplyEnvironmentManagedActionOutput) SetActionDescription(v string) *ApplyEnvironmentManagedActionOutput { - s.ActionDescription = &v - return s -} - -// SetActionId sets the ActionId field's value. -func (s *ApplyEnvironmentManagedActionOutput) SetActionId(v string) *ApplyEnvironmentManagedActionOutput { - s.ActionId = &v - return s -} - -// SetActionType sets the ActionType field's value. -func (s *ApplyEnvironmentManagedActionOutput) SetActionType(v string) *ApplyEnvironmentManagedActionOutput { - s.ActionType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ApplyEnvironmentManagedActionOutput) SetStatus(v string) *ApplyEnvironmentManagedActionOutput { - s.Status = &v - return s -} - -// Describes an Auto Scaling launch configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/AutoScalingGroup -type AutoScalingGroup struct { - _ struct{} `type:"structure"` - - // The name of the AutoScalingGroup . - Name *string `type:"string"` -} - -// String returns the string representation -func (s AutoScalingGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutoScalingGroup) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *AutoScalingGroup) SetName(v string) *AutoScalingGroup { - s.Name = &v - return s -} - -// Settings for an AWS CodeBuild build. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/BuildConfiguration -type BuildConfiguration struct { - _ struct{} `type:"structure"` - - // The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk - // stores the build artifact in the S3 location S3-bucket/resources/application-name/codebuild/codebuild-version-label-artifact-name.zip. - // If not provided, Elastic Beanstalk stores the build artifact in the S3 location - // S3-bucket/resources/application-name/codebuild/codebuild-version-label.zip. - ArtifactName *string `type:"string"` - - // The Amazon Resource Name (ARN) of the AWS Identity and Access Management - // (IAM) role that enables AWS CodeBuild to interact with dependent AWS services - // on behalf of the AWS account. - // - // CodeBuildServiceRole is a required field - CodeBuildServiceRole *string `type:"string" required:"true"` - - // Information about the compute resources the build project will use. - // - // * BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds - // - // * BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds - // - // * BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds - ComputeType *string `type:"string" enum:"ComputeType"` - - // The ID of the Docker image to use for this build project. - // - // Image is a required field - Image *string `type:"string" required:"true"` - - // How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until - // timing out any related build that does not get marked as completed. The default - // is 60 minutes. - TimeoutInMinutes *int64 `type:"integer"` -} - -// String returns the string representation -func (s BuildConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BuildConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BuildConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BuildConfiguration"} - if s.CodeBuildServiceRole == nil { - invalidParams.Add(request.NewErrParamRequired("CodeBuildServiceRole")) - } - if s.Image == nil { - invalidParams.Add(request.NewErrParamRequired("Image")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArtifactName sets the ArtifactName field's value. -func (s *BuildConfiguration) SetArtifactName(v string) *BuildConfiguration { - s.ArtifactName = &v - return s -} - -// SetCodeBuildServiceRole sets the CodeBuildServiceRole field's value. -func (s *BuildConfiguration) SetCodeBuildServiceRole(v string) *BuildConfiguration { - s.CodeBuildServiceRole = &v - return s -} - -// SetComputeType sets the ComputeType field's value. -func (s *BuildConfiguration) SetComputeType(v string) *BuildConfiguration { - s.ComputeType = &v - return s -} - -// SetImage sets the Image field's value. -func (s *BuildConfiguration) SetImage(v string) *BuildConfiguration { - s.Image = &v - return s -} - -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *BuildConfiguration) SetTimeoutInMinutes(v int64) *BuildConfiguration { - s.TimeoutInMinutes = &v - return s -} - -// The builder used to build the custom platform. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/Builder -type Builder struct { - _ struct{} `type:"structure"` - - // The ARN of the builder. - ARN *string `type:"string"` -} - -// String returns the string representation -func (s Builder) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Builder) GoString() string { - return s.String() -} - -// SetARN sets the ARN field's value. -func (s *Builder) SetARN(v string) *Builder { - s.ARN = &v - return s -} - -// CPU utilization metrics for an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CPUUtilization -type CPUUtilization struct { - _ struct{} `type:"structure"` - - // Percentage of time that the CPU has spent in the I/O Wait state over the - // last 10 seconds. - IOWait *float64 `type:"double"` - - // Percentage of time that the CPU has spent in the IRQ state over the last - // 10 seconds. - IRQ *float64 `type:"double"` - - // Percentage of time that the CPU has spent in the Idle state over the last - // 10 seconds. - Idle *float64 `type:"double"` - - // Percentage of time that the CPU has spent in the Nice state over the last - // 10 seconds. - Nice *float64 `type:"double"` - - // Percentage of time that the CPU has spent in the SoftIRQ state over the last - // 10 seconds. - SoftIRQ *float64 `type:"double"` - - // Percentage of time that the CPU has spent in the System state over the last - // 10 seconds. - System *float64 `type:"double"` - - // Percentage of time that the CPU has spent in the User state over the last - // 10 seconds. - User *float64 `type:"double"` -} - -// String returns the string representation -func (s CPUUtilization) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CPUUtilization) GoString() string { - return s.String() -} - -// SetIOWait sets the IOWait field's value. -func (s *CPUUtilization) SetIOWait(v float64) *CPUUtilization { - s.IOWait = &v - return s -} - -// SetIRQ sets the IRQ field's value. -func (s *CPUUtilization) SetIRQ(v float64) *CPUUtilization { - s.IRQ = &v - return s -} - -// SetIdle sets the Idle field's value. -func (s *CPUUtilization) SetIdle(v float64) *CPUUtilization { - s.Idle = &v - return s -} - -// SetNice sets the Nice field's value. -func (s *CPUUtilization) SetNice(v float64) *CPUUtilization { - s.Nice = &v - return s -} - -// SetSoftIRQ sets the SoftIRQ field's value. -func (s *CPUUtilization) SetSoftIRQ(v float64) *CPUUtilization { - s.SoftIRQ = &v - return s -} - -// SetSystem sets the System field's value. -func (s *CPUUtilization) SetSystem(v float64) *CPUUtilization { - s.System = &v - return s -} - -// SetUser sets the User field's value. -func (s *CPUUtilization) SetUser(v float64) *CPUUtilization { - s.User = &v - return s -} - -// Results message indicating whether a CNAME is available. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CheckDNSAvailabilityMessage -type CheckDNSAvailabilityInput struct { - _ struct{} `type:"structure"` - - // The prefix used when this CNAME is reserved. - // - // CNAMEPrefix is a required field - CNAMEPrefix *string `min:"4" type:"string" required:"true"` -} - -// String returns the string representation -func (s CheckDNSAvailabilityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CheckDNSAvailabilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CheckDNSAvailabilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CheckDNSAvailabilityInput"} - if s.CNAMEPrefix == nil { - invalidParams.Add(request.NewErrParamRequired("CNAMEPrefix")) - } - if s.CNAMEPrefix != nil && len(*s.CNAMEPrefix) < 4 { - invalidParams.Add(request.NewErrParamMinLen("CNAMEPrefix", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCNAMEPrefix sets the CNAMEPrefix field's value. -func (s *CheckDNSAvailabilityInput) SetCNAMEPrefix(v string) *CheckDNSAvailabilityInput { - s.CNAMEPrefix = &v - return s -} - -// Indicates if the specified CNAME is available. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CheckDNSAvailabilityResultMessage -type CheckDNSAvailabilityOutput struct { - _ struct{} `type:"structure"` - - // Indicates if the specified CNAME is available: - // - // * true : The CNAME is available. - // - // * false : The CNAME is not available. - Available *bool `type:"boolean"` - - // The fully qualified CNAME to reserve when CreateEnvironment is called with - // the provided prefix. - FullyQualifiedCNAME *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CheckDNSAvailabilityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CheckDNSAvailabilityOutput) GoString() string { - return s.String() -} - -// SetAvailable sets the Available field's value. -func (s *CheckDNSAvailabilityOutput) SetAvailable(v bool) *CheckDNSAvailabilityOutput { - s.Available = &v - return s -} - -// SetFullyQualifiedCNAME sets the FullyQualifiedCNAME field's value. -func (s *CheckDNSAvailabilityOutput) SetFullyQualifiedCNAME(v string) *CheckDNSAvailabilityOutput { - s.FullyQualifiedCNAME = &v - return s -} - -// Request to create or update a group of environments. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ComposeEnvironmentsMessage -type ComposeEnvironmentsInput struct { - _ struct{} `type:"structure"` - - // The name of the application to which the specified source bundles belong. - ApplicationName *string `min:"1" type:"string"` - - // The name of the group to which the target environments belong. Specify a - // group name only if the environment name defined in each target environment's - // manifest ends with a + (plus) character. See Environment Manifest (env.yaml) - // (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html) - // for details. - GroupName *string `min:"1" type:"string"` - - // A list of version labels, specifying one or more application source bundles - // that belong to the target application. Each source bundle must include an - // environment manifest that specifies the name of the environment and the name - // of the solution stack to use, and optionally can specify environment links - // to create. - VersionLabels []*string `type:"list"` -} - -// String returns the string representation -func (s ComposeEnvironmentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ComposeEnvironmentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ComposeEnvironmentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ComposeEnvironmentsInput"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ComposeEnvironmentsInput) SetApplicationName(v string) *ComposeEnvironmentsInput { - s.ApplicationName = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *ComposeEnvironmentsInput) SetGroupName(v string) *ComposeEnvironmentsInput { - s.GroupName = &v - return s -} - -// SetVersionLabels sets the VersionLabels field's value. -func (s *ComposeEnvironmentsInput) SetVersionLabels(v []*string) *ComposeEnvironmentsInput { - s.VersionLabels = v - return s -} - -// Describes the possible values for a configuration option. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ConfigurationOptionDescription -type ConfigurationOptionDescription struct { - _ struct{} `type:"structure"` - - // An indication of which action is required if the value for this configuration - // option changes: - // - // * NoInterruption : There is no interruption to the environment or application - // availability. - // - // * RestartEnvironment : The environment is entirely restarted, all AWS - // resources are deleted and recreated, and the environment is unavailable - // during the process. - // - // * RestartApplicationServer : The environment is available the entire time. - // However, a short application outage occurs when the application servers - // on the running Amazon EC2 instances are restarted. - ChangeSeverity *string `type:"string"` - - // The default value for this configuration option. - DefaultValue *string `type:"string"` - - // If specified, the configuration option must be a string value no longer than - // this value. - MaxLength *int64 `type:"integer"` - - // If specified, the configuration option must be a numeric value less than - // this value. - MaxValue *int64 `type:"integer"` - - // If specified, the configuration option must be a numeric value greater than - // this value. - MinValue *int64 `type:"integer"` - - // The name of the configuration option. - Name *string `type:"string"` - - // A unique namespace identifying the option's associated AWS resource. - Namespace *string `type:"string"` - - // If specified, the configuration option must be a string value that satisfies - // this regular expression. - Regex *OptionRestrictionRegex `type:"structure"` - - // An indication of whether the user defined this configuration option: - // - // * true : This configuration option was defined by the user. It is a valid - // choice for specifying if this as an Option to Remove when updating configuration - // settings. - // - // * false : This configuration was not defined by the user. - // - // Constraint: You can remove only UserDefined options from a configuration. - // - // Valid Values: true | false - UserDefined *bool `type:"boolean"` - - // If specified, values for the configuration option are selected from this - // list. - ValueOptions []*string `type:"list"` - - // An indication of which type of values this option has and whether it is allowable - // to select one or more than one of the possible values: - // - // * Scalar : Values for this option are a single selection from the possible - // values, or an unformatted string, or numeric value governed by the MIN/MAX/Regex - // constraints. - // - // * List : Values for this option are multiple selections from the possible - // values. - // - // * Boolean : Values for this option are either true or false . - // - // * Json : Values for this option are a JSON representation of a ConfigDocument. - ValueType *string `type:"string" enum:"ConfigurationOptionValueType"` -} - -// String returns the string representation -func (s ConfigurationOptionDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigurationOptionDescription) GoString() string { - return s.String() -} - -// SetChangeSeverity sets the ChangeSeverity field's value. -func (s *ConfigurationOptionDescription) SetChangeSeverity(v string) *ConfigurationOptionDescription { - s.ChangeSeverity = &v - return s -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *ConfigurationOptionDescription) SetDefaultValue(v string) *ConfigurationOptionDescription { - s.DefaultValue = &v - return s -} - -// SetMaxLength sets the MaxLength field's value. -func (s *ConfigurationOptionDescription) SetMaxLength(v int64) *ConfigurationOptionDescription { - s.MaxLength = &v - return s -} - -// SetMaxValue sets the MaxValue field's value. -func (s *ConfigurationOptionDescription) SetMaxValue(v int64) *ConfigurationOptionDescription { - s.MaxValue = &v - return s -} - -// SetMinValue sets the MinValue field's value. -func (s *ConfigurationOptionDescription) SetMinValue(v int64) *ConfigurationOptionDescription { - s.MinValue = &v - return s -} - -// SetName sets the Name field's value. -func (s *ConfigurationOptionDescription) SetName(v string) *ConfigurationOptionDescription { - s.Name = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *ConfigurationOptionDescription) SetNamespace(v string) *ConfigurationOptionDescription { - s.Namespace = &v - return s -} - -// SetRegex sets the Regex field's value. -func (s *ConfigurationOptionDescription) SetRegex(v *OptionRestrictionRegex) *ConfigurationOptionDescription { - s.Regex = v - return s -} - -// SetUserDefined sets the UserDefined field's value. -func (s *ConfigurationOptionDescription) SetUserDefined(v bool) *ConfigurationOptionDescription { - s.UserDefined = &v - return s -} - -// SetValueOptions sets the ValueOptions field's value. -func (s *ConfigurationOptionDescription) SetValueOptions(v []*string) *ConfigurationOptionDescription { - s.ValueOptions = v - return s -} - -// SetValueType sets the ValueType field's value. -func (s *ConfigurationOptionDescription) SetValueType(v string) *ConfigurationOptionDescription { - s.ValueType = &v - return s -} - -// A specification identifying an individual configuration option along with -// its current value. For a list of possible option values, go to Option Values -// (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html) -// in the AWS Elastic Beanstalk Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ConfigurationOptionSetting -type ConfigurationOptionSetting struct { - _ struct{} `type:"structure"` - - // A unique namespace identifying the option's associated AWS resource. - Namespace *string `type:"string"` - - // The name of the configuration option. - OptionName *string `type:"string"` - - // A unique resource name for a time-based scaling configuration option. - ResourceName *string `min:"1" type:"string"` - - // The current value for the configuration option. - Value *string `type:"string"` -} - -// String returns the string representation -func (s ConfigurationOptionSetting) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigurationOptionSetting) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfigurationOptionSetting) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfigurationOptionSetting"} - if s.ResourceName != nil && len(*s.ResourceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNamespace sets the Namespace field's value. -func (s *ConfigurationOptionSetting) SetNamespace(v string) *ConfigurationOptionSetting { - s.Namespace = &v - return s -} - -// SetOptionName sets the OptionName field's value. -func (s *ConfigurationOptionSetting) SetOptionName(v string) *ConfigurationOptionSetting { - s.OptionName = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *ConfigurationOptionSetting) SetResourceName(v string) *ConfigurationOptionSetting { - s.ResourceName = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ConfigurationOptionSetting) SetValue(v string) *ConfigurationOptionSetting { - s.Value = &v - return s -} - -// Describes the settings for a configuration set. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ConfigurationSettingsDescription -type ConfigurationSettingsDescription struct { - _ struct{} `type:"structure"` - - // The name of the application associated with this configuration set. - ApplicationName *string `min:"1" type:"string"` - - // The date (in UTC time) when this configuration set was created. - DateCreated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The date (in UTC time) when this configuration set was last modified. - DateUpdated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // If this configuration set is associated with an environment, the DeploymentStatus - // parameter indicates the deployment status of this configuration set: - // - // * null: This configuration is not associated with a running environment. - // - // * pending: This is a draft configuration that is not deployed to the associated - // environment but is in the process of deploying. - // - // * deployed: This is the configuration that is currently deployed to the - // associated running environment. - // - // * failed: This is a draft configuration that failed to successfully deploy. - DeploymentStatus *string `type:"string" enum:"ConfigurationDeploymentStatus"` - - // Describes this configuration set. - Description *string `type:"string"` - - // If not null, the name of the environment for this configuration set. - EnvironmentName *string `min:"4" type:"string"` - - // A list of the configuration options and their values in this configuration - // set. - OptionSettings []*ConfigurationOptionSetting `type:"list"` - - // The ARN of the custom platform. - PlatformArn *string `type:"string"` - - // The name of the solution stack this configuration set uses. - SolutionStackName *string `type:"string"` - - // If not null, the name of the configuration template for this configuration - // set. - TemplateName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ConfigurationSettingsDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigurationSettingsDescription) GoString() string { - return s.String() -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ConfigurationSettingsDescription) SetApplicationName(v string) *ConfigurationSettingsDescription { - s.ApplicationName = &v - return s -} - -// SetDateCreated sets the DateCreated field's value. -func (s *ConfigurationSettingsDescription) SetDateCreated(v time.Time) *ConfigurationSettingsDescription { - s.DateCreated = &v - return s -} - -// SetDateUpdated sets the DateUpdated field's value. -func (s *ConfigurationSettingsDescription) SetDateUpdated(v time.Time) *ConfigurationSettingsDescription { - s.DateUpdated = &v - return s -} - -// SetDeploymentStatus sets the DeploymentStatus field's value. -func (s *ConfigurationSettingsDescription) SetDeploymentStatus(v string) *ConfigurationSettingsDescription { - s.DeploymentStatus = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ConfigurationSettingsDescription) SetDescription(v string) *ConfigurationSettingsDescription { - s.Description = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *ConfigurationSettingsDescription) SetEnvironmentName(v string) *ConfigurationSettingsDescription { - s.EnvironmentName = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *ConfigurationSettingsDescription) SetOptionSettings(v []*ConfigurationOptionSetting) *ConfigurationSettingsDescription { - s.OptionSettings = v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *ConfigurationSettingsDescription) SetPlatformArn(v string) *ConfigurationSettingsDescription { - s.PlatformArn = &v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *ConfigurationSettingsDescription) SetSolutionStackName(v string) *ConfigurationSettingsDescription { - s.SolutionStackName = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *ConfigurationSettingsDescription) SetTemplateName(v string) *ConfigurationSettingsDescription { - s.TemplateName = &v - return s -} - -// Request to create an application. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateApplicationMessage -type CreateApplicationInput struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // Constraint: This name must be unique within your account. If the specified - // name already exists, the action returns an InvalidParameterValue error. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // Describes the application. - Description *string `type:"string"` - - // Specify an application resource lifecycle configuration to prevent your application - // from accumulating too many versions. - ResourceLifecycleConfig *ApplicationResourceLifecycleConfig `type:"structure"` -} - -// String returns the string representation -func (s CreateApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateApplicationInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.ResourceLifecycleConfig != nil { - if err := s.ResourceLifecycleConfig.Validate(); err != nil { - invalidParams.AddNested("ResourceLifecycleConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *CreateApplicationInput) SetApplicationName(v string) *CreateApplicationInput { - s.ApplicationName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateApplicationInput) SetDescription(v string) *CreateApplicationInput { - s.Description = &v - return s -} - -// SetResourceLifecycleConfig sets the ResourceLifecycleConfig field's value. -func (s *CreateApplicationInput) SetResourceLifecycleConfig(v *ApplicationResourceLifecycleConfig) *CreateApplicationInput { - s.ResourceLifecycleConfig = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateApplicationVersionMessage -type CreateApplicationVersionInput struct { - _ struct{} `type:"structure"` - - // The name of the application. If no application is found with this name, and - // AutoCreateApplication is false, returns an InvalidParameterValue error. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // Set to true to create an application with the specified name if it doesn't - // already exist. - AutoCreateApplication *bool `type:"boolean"` - - // Settings for an AWS CodeBuild build. - BuildConfiguration *BuildConfiguration `type:"structure"` - - // Describes this version. - Description *string `type:"string"` - - // Preprocesses and validates the environment manifest and configuration files - // in the source bundle. Validating configuration files can identify issues - // prior to deploying the application version to an environment. - Process *bool `type:"boolean"` - - // Specify a commit in an AWS CodeCommit Git repository to use as the source - // code for the application version. - SourceBuildInformation *SourceBuildInformation `type:"structure"` - - // The Amazon S3 bucket and key that identify the location of the source bundle - // for this version. - // - // The Amazon S3 bucket must be in the same region as the environment. - // - // Specify a source bundle in S3 or a commit in an AWS CodeCommit repository - // (with SourceBuildInformation), but not both. If neither SourceBundle nor - // SourceBuildInformation are provided, Elastic Beanstalk uses a sample application. - SourceBundle *S3Location `type:"structure"` - - // A label identifying this version. - // - // Constraint: Must be unique per application. If an application version already - // exists with this label for the specified application, AWS Elastic Beanstalk - // returns an InvalidParameterValue error. - // - // VersionLabel is a required field - VersionLabel *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateApplicationVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateApplicationVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateApplicationVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateApplicationVersionInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.VersionLabel == nil { - invalidParams.Add(request.NewErrParamRequired("VersionLabel")) - } - if s.VersionLabel != nil && len(*s.VersionLabel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionLabel", 1)) - } - if s.BuildConfiguration != nil { - if err := s.BuildConfiguration.Validate(); err != nil { - invalidParams.AddNested("BuildConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.SourceBuildInformation != nil { - if err := s.SourceBuildInformation.Validate(); err != nil { - invalidParams.AddNested("SourceBuildInformation", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *CreateApplicationVersionInput) SetApplicationName(v string) *CreateApplicationVersionInput { - s.ApplicationName = &v - return s -} - -// SetAutoCreateApplication sets the AutoCreateApplication field's value. -func (s *CreateApplicationVersionInput) SetAutoCreateApplication(v bool) *CreateApplicationVersionInput { - s.AutoCreateApplication = &v - return s -} - -// SetBuildConfiguration sets the BuildConfiguration field's value. -func (s *CreateApplicationVersionInput) SetBuildConfiguration(v *BuildConfiguration) *CreateApplicationVersionInput { - s.BuildConfiguration = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateApplicationVersionInput) SetDescription(v string) *CreateApplicationVersionInput { - s.Description = &v - return s -} - -// SetProcess sets the Process field's value. -func (s *CreateApplicationVersionInput) SetProcess(v bool) *CreateApplicationVersionInput { - s.Process = &v - return s -} - -// SetSourceBuildInformation sets the SourceBuildInformation field's value. -func (s *CreateApplicationVersionInput) SetSourceBuildInformation(v *SourceBuildInformation) *CreateApplicationVersionInput { - s.SourceBuildInformation = v - return s -} - -// SetSourceBundle sets the SourceBundle field's value. -func (s *CreateApplicationVersionInput) SetSourceBundle(v *S3Location) *CreateApplicationVersionInput { - s.SourceBundle = v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *CreateApplicationVersionInput) SetVersionLabel(v string) *CreateApplicationVersionInput { - s.VersionLabel = &v - return s -} - -// Request to create a configuration template. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateConfigurationTemplateMessage -type CreateConfigurationTemplateInput struct { - _ struct{} `type:"structure"` - - // The name of the application to associate with this configuration template. - // If no application is found with this name, AWS Elastic Beanstalk returns - // an InvalidParameterValue error. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // Describes this configuration. - Description *string `type:"string"` - - // The ID of the environment used with this configuration template. - EnvironmentId *string `type:"string"` - - // If specified, AWS Elastic Beanstalk sets the specified configuration option - // to the requested value. The new value overrides the value obtained from the - // solution stack or the source configuration template. - OptionSettings []*ConfigurationOptionSetting `type:"list"` - - // The ARN of the custome platform. - PlatformArn *string `type:"string"` - - // The name of the solution stack used by this configuration. The solution stack - // specifies the operating system, architecture, and application server for - // a configuration template. It determines the set of configuration options - // as well as the possible and default values. - // - // Use ListAvailableSolutionStacks to obtain a list of available solution stacks. - // - // A solution stack name or a source configuration parameter must be specified, - // otherwise AWS Elastic Beanstalk returns an InvalidParameterValue error. - // - // If a solution stack name is not specified and the source configuration parameter - // is specified, AWS Elastic Beanstalk uses the same solution stack as the source - // configuration template. - SolutionStackName *string `type:"string"` - - // If specified, AWS Elastic Beanstalk uses the configuration values from the - // specified configuration template to create a new configuration. - // - // Values specified in the OptionSettings parameter of this call overrides any - // values obtained from the SourceConfiguration. - // - // If no configuration template is found, returns an InvalidParameterValue error. - // - // Constraint: If both the solution stack name parameter and the source configuration - // parameters are specified, the solution stack of the source configuration - // template must match the specified solution stack name or else AWS Elastic - // Beanstalk returns an InvalidParameterCombination error. - SourceConfiguration *SourceConfiguration `type:"structure"` - - // The name of the configuration template. - // - // Constraint: This name must be unique per application. - // - // Default: If a configuration template already exists with this name, AWS Elastic - // Beanstalk returns an InvalidParameterValue error. - // - // TemplateName is a required field - TemplateName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateConfigurationTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateConfigurationTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateConfigurationTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateConfigurationTemplateInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.TemplateName == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateName")) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - if s.OptionSettings != nil { - for i, v := range s.OptionSettings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionSettings", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SourceConfiguration != nil { - if err := s.SourceConfiguration.Validate(); err != nil { - invalidParams.AddNested("SourceConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *CreateConfigurationTemplateInput) SetApplicationName(v string) *CreateConfigurationTemplateInput { - s.ApplicationName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateConfigurationTemplateInput) SetDescription(v string) *CreateConfigurationTemplateInput { - s.Description = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *CreateConfigurationTemplateInput) SetEnvironmentId(v string) *CreateConfigurationTemplateInput { - s.EnvironmentId = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *CreateConfigurationTemplateInput) SetOptionSettings(v []*ConfigurationOptionSetting) *CreateConfigurationTemplateInput { - s.OptionSettings = v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *CreateConfigurationTemplateInput) SetPlatformArn(v string) *CreateConfigurationTemplateInput { - s.PlatformArn = &v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *CreateConfigurationTemplateInput) SetSolutionStackName(v string) *CreateConfigurationTemplateInput { - s.SolutionStackName = &v - return s -} - -// SetSourceConfiguration sets the SourceConfiguration field's value. -func (s *CreateConfigurationTemplateInput) SetSourceConfiguration(v *SourceConfiguration) *CreateConfigurationTemplateInput { - s.SourceConfiguration = v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *CreateConfigurationTemplateInput) SetTemplateName(v string) *CreateConfigurationTemplateInput { - s.TemplateName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateEnvironmentMessage -type CreateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // The name of the application that contains the version to be deployed. - // - // If no application is found with this name, CreateEnvironment returns an InvalidParameterValue - // error. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // If specified, the environment attempts to use this value as the prefix for - // the CNAME. If not specified, the CNAME is generated automatically by appending - // a random alphanumeric string to the environment name. - CNAMEPrefix *string `min:"4" type:"string"` - - // Describes this environment. - Description *string `type:"string"` - - // A unique name for the deployment environment. Used in the application URL. - // - // Constraint: Must be from 4 to 40 characters in length. The name can contain - // only letters, numbers, and hyphens. It cannot start or end with a hyphen. - // This name must be unique in your account. If the specified name already exists, - // AWS Elastic Beanstalk returns an InvalidParameterValue error. - // - // Default: If the CNAME parameter is not specified, the environment name becomes - // part of the CNAME, and therefore part of the visible URL for your application. - EnvironmentName *string `min:"4" type:"string"` - - // The name of the group to which the target environment belongs. Specify a - // group name only if the environment's name is specified in an environment - // manifest and not with the environment name parameter. See Environment Manifest - // (env.yaml) (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html) - // for details. - GroupName *string `min:"1" type:"string"` - - // If specified, AWS Elastic Beanstalk sets the specified configuration options - // to the requested value in the configuration set for the new environment. - // These override the values obtained from the solution stack or the configuration - // template. - OptionSettings []*ConfigurationOptionSetting `type:"list"` - - // A list of custom user-defined configuration options to remove from the configuration - // set for this new environment. - OptionsToRemove []*OptionSpecification `type:"list"` - - // The ARN of the custom platform. - PlatformArn *string `type:"string"` - - // This is an alternative to specifying a template name. If specified, AWS Elastic - // Beanstalk sets the configuration values to the default values associated - // with the specified solution stack. - SolutionStackName *string `type:"string"` - - // This specifies the tags applied to resources in the environment. - Tags []*Tag `type:"list"` - - // The name of the configuration template to use in deployment. If no configuration - // template is found with this name, AWS Elastic Beanstalk returns an InvalidParameterValue - // error. - TemplateName *string `min:"1" type:"string"` - - // This specifies the tier to use for creating this environment. - Tier *EnvironmentTier `type:"structure"` - - // The name of the application version to deploy. - // - // If the specified application has no associated application versions, AWS - // Elastic Beanstalk UpdateEnvironment returns an InvalidParameterValue error. - // - // Default: If not specified, AWS Elastic Beanstalk attempts to launch the sample - // application in the container. - VersionLabel *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateEnvironmentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEnvironmentInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.CNAMEPrefix != nil && len(*s.CNAMEPrefix) < 4 { - invalidParams.Add(request.NewErrParamMinLen("CNAMEPrefix", 4)) - } - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - if s.VersionLabel != nil && len(*s.VersionLabel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionLabel", 1)) - } - if s.OptionSettings != nil { - for i, v := range s.OptionSettings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionSettings", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OptionsToRemove != nil { - for i, v := range s.OptionsToRemove { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionsToRemove", 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 - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *CreateEnvironmentInput) SetApplicationName(v string) *CreateEnvironmentInput { - s.ApplicationName = &v - return s -} - -// SetCNAMEPrefix sets the CNAMEPrefix field's value. -func (s *CreateEnvironmentInput) SetCNAMEPrefix(v string) *CreateEnvironmentInput { - s.CNAMEPrefix = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateEnvironmentInput) SetDescription(v string) *CreateEnvironmentInput { - s.Description = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *CreateEnvironmentInput) SetEnvironmentName(v string) *CreateEnvironmentInput { - s.EnvironmentName = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreateEnvironmentInput) SetGroupName(v string) *CreateEnvironmentInput { - s.GroupName = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *CreateEnvironmentInput) SetOptionSettings(v []*ConfigurationOptionSetting) *CreateEnvironmentInput { - s.OptionSettings = v - return s -} - -// SetOptionsToRemove sets the OptionsToRemove field's value. -func (s *CreateEnvironmentInput) SetOptionsToRemove(v []*OptionSpecification) *CreateEnvironmentInput { - s.OptionsToRemove = v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *CreateEnvironmentInput) SetPlatformArn(v string) *CreateEnvironmentInput { - s.PlatformArn = &v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *CreateEnvironmentInput) SetSolutionStackName(v string) *CreateEnvironmentInput { - s.SolutionStackName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateEnvironmentInput) SetTags(v []*Tag) *CreateEnvironmentInput { - s.Tags = v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *CreateEnvironmentInput) SetTemplateName(v string) *CreateEnvironmentInput { - s.TemplateName = &v - return s -} - -// SetTier sets the Tier field's value. -func (s *CreateEnvironmentInput) SetTier(v *EnvironmentTier) *CreateEnvironmentInput { - s.Tier = v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *CreateEnvironmentInput) SetVersionLabel(v string) *CreateEnvironmentInput { - s.VersionLabel = &v - return s -} - -// Request to create a new platform version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreatePlatformVersionRequest -type CreatePlatformVersionInput struct { - _ struct{} `type:"structure"` - - // The name of the builder environment. - EnvironmentName *string `min:"4" type:"string"` - - // The configuration option settings to apply to the builder environment. - OptionSettings []*ConfigurationOptionSetting `type:"list"` - - // The location of the platform definition archive in Amazon S3. - // - // PlatformDefinitionBundle is a required field - PlatformDefinitionBundle *S3Location `type:"structure" required:"true"` - - // The name of your custom platform. - // - // PlatformName is a required field - PlatformName *string `type:"string" required:"true"` - - // The number, such as 1.0.2, for the new platform version. - // - // PlatformVersion is a required field - PlatformVersion *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreatePlatformVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlatformVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePlatformVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePlatformVersionInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.PlatformDefinitionBundle == nil { - invalidParams.Add(request.NewErrParamRequired("PlatformDefinitionBundle")) - } - if s.PlatformName == nil { - invalidParams.Add(request.NewErrParamRequired("PlatformName")) - } - if s.PlatformVersion == nil { - invalidParams.Add(request.NewErrParamRequired("PlatformVersion")) - } - if s.OptionSettings != nil { - for i, v := range s.OptionSettings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionSettings", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *CreatePlatformVersionInput) SetEnvironmentName(v string) *CreatePlatformVersionInput { - s.EnvironmentName = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *CreatePlatformVersionInput) SetOptionSettings(v []*ConfigurationOptionSetting) *CreatePlatformVersionInput { - s.OptionSettings = v - return s -} - -// SetPlatformDefinitionBundle sets the PlatformDefinitionBundle field's value. -func (s *CreatePlatformVersionInput) SetPlatformDefinitionBundle(v *S3Location) *CreatePlatformVersionInput { - s.PlatformDefinitionBundle = v - return s -} - -// SetPlatformName sets the PlatformName field's value. -func (s *CreatePlatformVersionInput) SetPlatformName(v string) *CreatePlatformVersionInput { - s.PlatformName = &v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *CreatePlatformVersionInput) SetPlatformVersion(v string) *CreatePlatformVersionInput { - s.PlatformVersion = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreatePlatformVersionResult -type CreatePlatformVersionOutput struct { - _ struct{} `type:"structure"` - - // The builder used to create the custom platform. - Builder *Builder `type:"structure"` - - // Detailed information about the new version of the custom platform. - PlatformSummary *PlatformSummary `type:"structure"` -} - -// String returns the string representation -func (s CreatePlatformVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlatformVersionOutput) GoString() string { - return s.String() -} - -// SetBuilder sets the Builder field's value. -func (s *CreatePlatformVersionOutput) SetBuilder(v *Builder) *CreatePlatformVersionOutput { - s.Builder = v - return s -} - -// SetPlatformSummary sets the PlatformSummary field's value. -func (s *CreatePlatformVersionOutput) SetPlatformSummary(v *PlatformSummary) *CreatePlatformVersionOutput { - s.PlatformSummary = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateStorageLocationInput -type CreateStorageLocationInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateStorageLocationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStorageLocationInput) GoString() string { - return s.String() -} - -// Results of a CreateStorageLocationResult call. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CreateStorageLocationResultMessage -type CreateStorageLocationOutput struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket created. - S3Bucket *string `type:"string"` -} - -// String returns the string representation -func (s CreateStorageLocationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStorageLocationOutput) GoString() string { - return s.String() -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *CreateStorageLocationOutput) SetS3Bucket(v string) *CreateStorageLocationOutput { - s.S3Bucket = &v - return s -} - -// A custom AMI available to platforms. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/CustomAmi -type CustomAmi struct { - _ struct{} `type:"structure"` - - // THe ID of the image used to create the custom AMI. - ImageId *string `type:"string"` - - // The type of virtualization used to create the custom AMI. - VirtualizationType *string `type:"string"` -} - -// String returns the string representation -func (s CustomAmi) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CustomAmi) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *CustomAmi) SetImageId(v string) *CustomAmi { - s.ImageId = &v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *CustomAmi) SetVirtualizationType(v string) *CustomAmi { - s.VirtualizationType = &v - return s -} - -// Request to delete an application. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplicationMessage -type DeleteApplicationInput struct { - _ struct{} `type:"structure"` - - // The name of the application to delete. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // When set to true, running environments will be terminated before deleting - // the application. - TerminateEnvByForce *bool `type:"boolean"` -} - -// String returns the string representation -func (s DeleteApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApplicationInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DeleteApplicationInput) SetApplicationName(v string) *DeleteApplicationInput { - s.ApplicationName = &v - return s -} - -// SetTerminateEnvByForce sets the TerminateEnvByForce field's value. -func (s *DeleteApplicationInput) SetTerminateEnvByForce(v bool) *DeleteApplicationInput { - s.TerminateEnvByForce = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplicationOutput -type DeleteApplicationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteApplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteApplicationOutput) GoString() string { - return s.String() -} - -// Request to delete an application version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplicationVersionMessage -type DeleteApplicationVersionInput struct { - _ struct{} `type:"structure"` - - // The name of the application to which the version belongs. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // Set to true to delete the source bundle from your storage bucket. Otherwise, - // the application version is deleted only from Elastic Beanstalk and the source - // bundle remains in Amazon S3. - DeleteSourceBundle *bool `type:"boolean"` - - // The label of the version to delete. - // - // VersionLabel is a required field - VersionLabel *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteApplicationVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteApplicationVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApplicationVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApplicationVersionInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.VersionLabel == nil { - invalidParams.Add(request.NewErrParamRequired("VersionLabel")) - } - if s.VersionLabel != nil && len(*s.VersionLabel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionLabel", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DeleteApplicationVersionInput) SetApplicationName(v string) *DeleteApplicationVersionInput { - s.ApplicationName = &v - return s -} - -// SetDeleteSourceBundle sets the DeleteSourceBundle field's value. -func (s *DeleteApplicationVersionInput) SetDeleteSourceBundle(v bool) *DeleteApplicationVersionInput { - s.DeleteSourceBundle = &v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *DeleteApplicationVersionInput) SetVersionLabel(v string) *DeleteApplicationVersionInput { - s.VersionLabel = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplicationVersionOutput -type DeleteApplicationVersionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteApplicationVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteApplicationVersionOutput) GoString() string { - return s.String() -} - -// Request to delete a configuration template. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteConfigurationTemplateMessage -type DeleteConfigurationTemplateInput struct { - _ struct{} `type:"structure"` - - // The name of the application to delete the configuration template from. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // The name of the configuration template to delete. - // - // TemplateName is a required field - TemplateName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteConfigurationTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigurationTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfigurationTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfigurationTemplateInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.TemplateName == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateName")) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DeleteConfigurationTemplateInput) SetApplicationName(v string) *DeleteConfigurationTemplateInput { - s.ApplicationName = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *DeleteConfigurationTemplateInput) SetTemplateName(v string) *DeleteConfigurationTemplateInput { - s.TemplateName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteConfigurationTemplateOutput -type DeleteConfigurationTemplateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteConfigurationTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigurationTemplateOutput) GoString() string { - return s.String() -} - -// Request to delete a draft environment configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteEnvironmentConfigurationMessage -type DeleteEnvironmentConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the application the environment is associated with. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // The name of the environment to delete the draft configuration from. - // - // EnvironmentName is a required field - EnvironmentName *string `min:"4" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEnvironmentConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEnvironmentConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEnvironmentConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEnvironmentConfigurationInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.EnvironmentName == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentName")) - } - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DeleteEnvironmentConfigurationInput) SetApplicationName(v string) *DeleteEnvironmentConfigurationInput { - s.ApplicationName = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DeleteEnvironmentConfigurationInput) SetEnvironmentName(v string) *DeleteEnvironmentConfigurationInput { - s.EnvironmentName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteEnvironmentConfigurationOutput -type DeleteEnvironmentConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteEnvironmentConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEnvironmentConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeletePlatformVersionRequest -type DeletePlatformVersionInput struct { - _ struct{} `type:"structure"` - - // The ARN of the version of the custom platform. - PlatformArn *string `type:"string"` -} - -// String returns the string representation -func (s DeletePlatformVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePlatformVersionInput) GoString() string { - return s.String() -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *DeletePlatformVersionInput) SetPlatformArn(v string) *DeletePlatformVersionInput { - s.PlatformArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeletePlatformVersionResult -type DeletePlatformVersionOutput struct { - _ struct{} `type:"structure"` - - // Detailed information about the version of the custom platform. - PlatformSummary *PlatformSummary `type:"structure"` -} - -// String returns the string representation -func (s DeletePlatformVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePlatformVersionOutput) GoString() string { - return s.String() -} - -// SetPlatformSummary sets the PlatformSummary field's value. -func (s *DeletePlatformVersionOutput) SetPlatformSummary(v *PlatformSummary) *DeletePlatformVersionOutput { - s.PlatformSummary = v - return s -} - -// Information about an application version deployment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/Deployment -type Deployment struct { - _ struct{} `type:"structure"` - - // The ID of the deployment. This number increases by one each time that you - // deploy source code or change instance configuration settings. - DeploymentId *int64 `type:"long"` - - // For in-progress deployments, the time that the deloyment started. - // - // For completed deployments, the time that the deployment ended. - DeploymentTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The status of the deployment: - // - // * In Progress : The deployment is in progress. - // - // * Deployed : The deployment succeeded. - // - // * Failed : The deployment failed. - Status *string `type:"string"` - - // The version label of the application version in the deployment. - VersionLabel *string `type:"string"` -} - -// String returns the string representation -func (s Deployment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Deployment) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *Deployment) SetDeploymentId(v int64) *Deployment { - s.DeploymentId = &v - return s -} - -// SetDeploymentTime sets the DeploymentTime field's value. -func (s *Deployment) SetDeploymentTime(v time.Time) *Deployment { - s.DeploymentTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Deployment) SetStatus(v string) *Deployment { - s.Status = &v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *Deployment) SetVersionLabel(v string) *Deployment { - s.VersionLabel = &v - return s -} - -// Request to describe application versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeApplicationVersionsMessage -type DescribeApplicationVersionsInput struct { - _ struct{} `type:"structure"` - - // Specify an application name to show only application versions for that application. - ApplicationName *string `min:"1" type:"string"` - - // Specify a maximum number of application versions to paginate in the request. - MaxRecords *int64 `min:"1" type:"integer"` - - // Specify a next token to retrieve the next page in a paginated request. - NextToken *string `type:"string"` - - // Specify a version label to show a specific application version. - VersionLabels []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeApplicationVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeApplicationVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeApplicationVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeApplicationVersionsInput"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.MaxRecords != nil && *s.MaxRecords < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DescribeApplicationVersionsInput) SetApplicationName(v string) *DescribeApplicationVersionsInput { - s.ApplicationName = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeApplicationVersionsInput) SetMaxRecords(v int64) *DescribeApplicationVersionsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeApplicationVersionsInput) SetNextToken(v string) *DescribeApplicationVersionsInput { - s.NextToken = &v - return s -} - -// SetVersionLabels sets the VersionLabels field's value. -func (s *DescribeApplicationVersionsInput) SetVersionLabels(v []*string) *DescribeApplicationVersionsInput { - s.VersionLabels = v - return s -} - -// Result message wrapping a list of application version descriptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationVersionDescriptionsMessage -type DescribeApplicationVersionsOutput struct { - _ struct{} `type:"structure"` - - // List of ApplicationVersionDescription objects sorted in order of creation. - ApplicationVersions []*ApplicationVersionDescription `type:"list"` - - // For a paginated request, the token that you can pass in a subsequent request - // to get the next page. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeApplicationVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeApplicationVersionsOutput) GoString() string { - return s.String() -} - -// SetApplicationVersions sets the ApplicationVersions field's value. -func (s *DescribeApplicationVersionsOutput) SetApplicationVersions(v []*ApplicationVersionDescription) *DescribeApplicationVersionsOutput { - s.ApplicationVersions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeApplicationVersionsOutput) SetNextToken(v string) *DescribeApplicationVersionsOutput { - s.NextToken = &v - return s -} - -// Request to describe one or more applications. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeApplicationsMessage -type DescribeApplicationsInput struct { - _ struct{} `type:"structure"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // only include those with the specified names. - ApplicationNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeApplicationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeApplicationsInput) GoString() string { - return s.String() -} - -// SetApplicationNames sets the ApplicationNames field's value. -func (s *DescribeApplicationsInput) SetApplicationNames(v []*string) *DescribeApplicationsInput { - s.ApplicationNames = v - return s -} - -// Result message containing a list of application descriptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationDescriptionsMessage -type DescribeApplicationsOutput struct { - _ struct{} `type:"structure"` - - // This parameter contains a list of ApplicationDescription. - Applications []*ApplicationDescription `type:"list"` -} - -// String returns the string representation -func (s DescribeApplicationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeApplicationsOutput) GoString() string { - return s.String() -} - -// SetApplications sets the Applications field's value. -func (s *DescribeApplicationsOutput) SetApplications(v []*ApplicationDescription) *DescribeApplicationsOutput { - s.Applications = v - return s -} - -// Result message containing a list of application version descriptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeConfigurationOptionsMessage -type DescribeConfigurationOptionsInput struct { - _ struct{} `type:"structure"` - - // The name of the application associated with the configuration template or - // environment. Only needed if you want to describe the configuration options - // associated with either the configuration template or environment. - ApplicationName *string `min:"1" type:"string"` - - // The name of the environment whose configuration options you want to describe. - EnvironmentName *string `min:"4" type:"string"` - - // If specified, restricts the descriptions to only the specified options. - Options []*OptionSpecification `type:"list"` - - // The ARN of the custom platform. - PlatformArn *string `type:"string"` - - // The name of the solution stack whose configuration options you want to describe. - SolutionStackName *string `type:"string"` - - // The name of the configuration template whose configuration options you want - // to describe. - TemplateName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeConfigurationOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeConfigurationOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeConfigurationOptionsInput"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - if s.Options != nil { - for i, v := range s.Options { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Options", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DescribeConfigurationOptionsInput) SetApplicationName(v string) *DescribeConfigurationOptionsInput { - s.ApplicationName = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeConfigurationOptionsInput) SetEnvironmentName(v string) *DescribeConfigurationOptionsInput { - s.EnvironmentName = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *DescribeConfigurationOptionsInput) SetOptions(v []*OptionSpecification) *DescribeConfigurationOptionsInput { - s.Options = v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *DescribeConfigurationOptionsInput) SetPlatformArn(v string) *DescribeConfigurationOptionsInput { - s.PlatformArn = &v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *DescribeConfigurationOptionsInput) SetSolutionStackName(v string) *DescribeConfigurationOptionsInput { - s.SolutionStackName = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *DescribeConfigurationOptionsInput) SetTemplateName(v string) *DescribeConfigurationOptionsInput { - s.TemplateName = &v - return s -} - -// Describes the settings for a specified configuration set. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ConfigurationOptionsDescription -type DescribeConfigurationOptionsOutput struct { - _ struct{} `type:"structure"` - - // A list of ConfigurationOptionDescription. - Options []*ConfigurationOptionDescription `type:"list"` - - // The ARN of the custom platform. - PlatformArn *string `type:"string"` - - // The name of the solution stack these configuration options belong to. - SolutionStackName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeConfigurationOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationOptionsOutput) GoString() string { - return s.String() -} - -// SetOptions sets the Options field's value. -func (s *DescribeConfigurationOptionsOutput) SetOptions(v []*ConfigurationOptionDescription) *DescribeConfigurationOptionsOutput { - s.Options = v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *DescribeConfigurationOptionsOutput) SetPlatformArn(v string) *DescribeConfigurationOptionsOutput { - s.PlatformArn = &v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *DescribeConfigurationOptionsOutput) SetSolutionStackName(v string) *DescribeConfigurationOptionsOutput { - s.SolutionStackName = &v - return s -} - -// Result message containing all of the configuration settings for a specified -// solution stack or configuration template. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeConfigurationSettingsMessage -type DescribeConfigurationSettingsInput struct { - _ struct{} `type:"structure"` - - // The application for the environment or configuration template. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // The name of the environment to describe. - // - // Condition: You must specify either this or a TemplateName, but not both. - // If you specify both, AWS Elastic Beanstalk returns an InvalidParameterCombination - // error. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentName *string `min:"4" type:"string"` - - // The name of the configuration template to describe. - // - // Conditional: You must specify either this parameter or an EnvironmentName, - // but not both. If you specify both, AWS Elastic Beanstalk returns an InvalidParameterCombination - // error. If you do not specify either, AWS Elastic Beanstalk returns a MissingRequiredParameter - // error. - TemplateName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeConfigurationSettingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeConfigurationSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeConfigurationSettingsInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DescribeConfigurationSettingsInput) SetApplicationName(v string) *DescribeConfigurationSettingsInput { - s.ApplicationName = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeConfigurationSettingsInput) SetEnvironmentName(v string) *DescribeConfigurationSettingsInput { - s.EnvironmentName = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *DescribeConfigurationSettingsInput) SetTemplateName(v string) *DescribeConfigurationSettingsInput { - s.TemplateName = &v - return s -} - -// The results from a request to change the configuration settings of an environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ConfigurationSettingsDescriptions -type DescribeConfigurationSettingsOutput struct { - _ struct{} `type:"structure"` - - // A list of ConfigurationSettingsDescription. - ConfigurationSettings []*ConfigurationSettingsDescription `type:"list"` -} - -// String returns the string representation -func (s DescribeConfigurationSettingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationSettingsOutput) GoString() string { - return s.String() -} - -// SetConfigurationSettings sets the ConfigurationSettings field's value. -func (s *DescribeConfigurationSettingsOutput) SetConfigurationSettings(v []*ConfigurationSettingsDescription) *DescribeConfigurationSettingsOutput { - s.ConfigurationSettings = v - return s -} - -// See the example below to learn how to create a request body. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentHealthRequest -type DescribeEnvironmentHealthInput struct { - _ struct{} `type:"structure"` - - // Specify the response elements to return. To retrieve all attributes, set - // to All. If no attribute names are specified, returns the name of the environment. - AttributeNames []*string `type:"list"` - - // Specify the environment by ID. - // - // You must specify either this or an EnvironmentName, or both. - EnvironmentId *string `type:"string"` - - // Specify the environment by name. - // - // You must specify either this or an EnvironmentName, or both. - EnvironmentName *string `min:"4" type:"string"` -} - -// String returns the string representation -func (s DescribeEnvironmentHealthInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentHealthInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEnvironmentHealthInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEnvironmentHealthInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeNames sets the AttributeNames field's value. -func (s *DescribeEnvironmentHealthInput) SetAttributeNames(v []*string) *DescribeEnvironmentHealthInput { - s.AttributeNames = v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DescribeEnvironmentHealthInput) SetEnvironmentId(v string) *DescribeEnvironmentHealthInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeEnvironmentHealthInput) SetEnvironmentName(v string) *DescribeEnvironmentHealthInput { - s.EnvironmentName = &v - return s -} - -// Health details for an AWS Elastic Beanstalk environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentHealthResult -type DescribeEnvironmentHealthOutput struct { - _ struct{} `type:"structure"` - - // Application request metrics for the environment. - ApplicationMetrics *ApplicationMetrics `type:"structure"` - - // Descriptions of the data that contributed to the environment's current health - // status. - Causes []*string `type:"list"` - - // The health color (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html) - // of the environment. - Color *string `type:"string"` - - // The environment's name. - EnvironmentName *string `min:"4" type:"string"` - - // The health status (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html) - // of the environment. For example, Ok. - HealthStatus *string `type:"string"` - - // Summary health information for the instances in the environment. - InstancesHealth *InstanceHealthSummary `type:"structure"` - - // The date and time that the health information was retrieved. - RefreshedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The environment's operational status. Ready, Launching, Updating, Terminating, - // or Terminated. - Status *string `type:"string" enum:"EnvironmentHealth"` -} - -// String returns the string representation -func (s DescribeEnvironmentHealthOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentHealthOutput) GoString() string { - return s.String() -} - -// SetApplicationMetrics sets the ApplicationMetrics field's value. -func (s *DescribeEnvironmentHealthOutput) SetApplicationMetrics(v *ApplicationMetrics) *DescribeEnvironmentHealthOutput { - s.ApplicationMetrics = v - return s -} - -// SetCauses sets the Causes field's value. -func (s *DescribeEnvironmentHealthOutput) SetCauses(v []*string) *DescribeEnvironmentHealthOutput { - s.Causes = v - return s -} - -// SetColor sets the Color field's value. -func (s *DescribeEnvironmentHealthOutput) SetColor(v string) *DescribeEnvironmentHealthOutput { - s.Color = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeEnvironmentHealthOutput) SetEnvironmentName(v string) *DescribeEnvironmentHealthOutput { - s.EnvironmentName = &v - return s -} - -// SetHealthStatus sets the HealthStatus field's value. -func (s *DescribeEnvironmentHealthOutput) SetHealthStatus(v string) *DescribeEnvironmentHealthOutput { - s.HealthStatus = &v - return s -} - -// SetInstancesHealth sets the InstancesHealth field's value. -func (s *DescribeEnvironmentHealthOutput) SetInstancesHealth(v *InstanceHealthSummary) *DescribeEnvironmentHealthOutput { - s.InstancesHealth = v - return s -} - -// SetRefreshedAt sets the RefreshedAt field's value. -func (s *DescribeEnvironmentHealthOutput) SetRefreshedAt(v time.Time) *DescribeEnvironmentHealthOutput { - s.RefreshedAt = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeEnvironmentHealthOutput) SetStatus(v string) *DescribeEnvironmentHealthOutput { - s.Status = &v - return s -} - -// Request to list completed and failed managed actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActionHistoryRequest -type DescribeEnvironmentManagedActionHistoryInput struct { - _ struct{} `type:"structure"` - - // The environment ID of the target environment. - EnvironmentId *string `type:"string"` - - // The name of the target environment. - EnvironmentName *string `min:"4" type:"string"` - - // The maximum number of items to return for a single request. - MaxItems *int64 `type:"integer"` - - // The pagination token returned by a previous request. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEnvironmentManagedActionHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentManagedActionHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEnvironmentManagedActionHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEnvironmentManagedActionHistoryInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DescribeEnvironmentManagedActionHistoryInput) SetEnvironmentId(v string) *DescribeEnvironmentManagedActionHistoryInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeEnvironmentManagedActionHistoryInput) SetEnvironmentName(v string) *DescribeEnvironmentManagedActionHistoryInput { - s.EnvironmentName = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *DescribeEnvironmentManagedActionHistoryInput) SetMaxItems(v int64) *DescribeEnvironmentManagedActionHistoryInput { - s.MaxItems = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEnvironmentManagedActionHistoryInput) SetNextToken(v string) *DescribeEnvironmentManagedActionHistoryInput { - s.NextToken = &v - return s -} - -// A result message containing a list of completed and failed managed actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActionHistoryResult -type DescribeEnvironmentManagedActionHistoryOutput struct { - _ struct{} `type:"structure"` - - // A list of completed and failed managed actions. - ManagedActionHistoryItems []*ManagedActionHistoryItem `min:"1" type:"list"` - - // A pagination token that you pass to DescribeEnvironmentManagedActionHistory - // to get the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEnvironmentManagedActionHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentManagedActionHistoryOutput) GoString() string { - return s.String() -} - -// SetManagedActionHistoryItems sets the ManagedActionHistoryItems field's value. -func (s *DescribeEnvironmentManagedActionHistoryOutput) SetManagedActionHistoryItems(v []*ManagedActionHistoryItem) *DescribeEnvironmentManagedActionHistoryOutput { - s.ManagedActionHistoryItems = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEnvironmentManagedActionHistoryOutput) SetNextToken(v string) *DescribeEnvironmentManagedActionHistoryOutput { - s.NextToken = &v - return s -} - -// Request to list an environment's upcoming and in-progress managed actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActionsRequest -type DescribeEnvironmentManagedActionsInput struct { - _ struct{} `type:"structure"` - - // The environment ID of the target environment. - EnvironmentId *string `type:"string"` - - // The name of the target environment. - EnvironmentName *string `type:"string"` - - // To show only actions with a particular status, specify a status. - Status *string `type:"string" enum:"ActionStatus"` -} - -// String returns the string representation -func (s DescribeEnvironmentManagedActionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentManagedActionsInput) GoString() string { - return s.String() -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DescribeEnvironmentManagedActionsInput) SetEnvironmentId(v string) *DescribeEnvironmentManagedActionsInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeEnvironmentManagedActionsInput) SetEnvironmentName(v string) *DescribeEnvironmentManagedActionsInput { - s.EnvironmentName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeEnvironmentManagedActionsInput) SetStatus(v string) *DescribeEnvironmentManagedActionsInput { - s.Status = &v - return s -} - -// The result message containing a list of managed actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentManagedActionsResult -type DescribeEnvironmentManagedActionsOutput struct { - _ struct{} `type:"structure"` - - // A list of upcoming and in-progress managed actions. - ManagedActions []*ManagedAction `min:"1" type:"list"` -} - -// String returns the string representation -func (s DescribeEnvironmentManagedActionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentManagedActionsOutput) GoString() string { - return s.String() -} - -// SetManagedActions sets the ManagedActions field's value. -func (s *DescribeEnvironmentManagedActionsOutput) SetManagedActions(v []*ManagedAction) *DescribeEnvironmentManagedActionsOutput { - s.ManagedActions = v - return s -} - -// Request to describe the resources in an environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentResourcesMessage -type DescribeEnvironmentResourcesInput struct { - _ struct{} `type:"structure"` - - // The ID of the environment to retrieve AWS resource usage data. - // - // Condition: You must specify either this or an EnvironmentName, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentId *string `type:"string"` - - // The name of the environment to retrieve AWS resource usage data. - // - // Condition: You must specify either this or an EnvironmentId, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentName *string `min:"4" type:"string"` -} - -// String returns the string representation -func (s DescribeEnvironmentResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEnvironmentResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEnvironmentResourcesInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DescribeEnvironmentResourcesInput) SetEnvironmentId(v string) *DescribeEnvironmentResourcesInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeEnvironmentResourcesInput) SetEnvironmentName(v string) *DescribeEnvironmentResourcesInput { - s.EnvironmentName = &v - return s -} - -// Result message containing a list of environment resource descriptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EnvironmentResourceDescriptionsMessage -type DescribeEnvironmentResourcesOutput struct { - _ struct{} `type:"structure"` - - // A list of EnvironmentResourceDescription. - EnvironmentResources *EnvironmentResourceDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeEnvironmentResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentResourcesOutput) GoString() string { - return s.String() -} - -// SetEnvironmentResources sets the EnvironmentResources field's value. -func (s *DescribeEnvironmentResourcesOutput) SetEnvironmentResources(v *EnvironmentResourceDescription) *DescribeEnvironmentResourcesOutput { - s.EnvironmentResources = v - return s -} - -// Request to describe one or more environments. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEnvironmentsMessage -type DescribeEnvironmentsInput struct { - _ struct{} `type:"structure"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // include only those that are associated with this application. - ApplicationName *string `min:"1" type:"string"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // include only those that have the specified IDs. - EnvironmentIds []*string `type:"list"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // include only those that have the specified names. - EnvironmentNames []*string `type:"list"` - - // Indicates whether to include deleted environments: - // - // true: Environments that have been deleted after IncludedDeletedBackTo are - // displayed. - // - // false: Do not include deleted environments. - IncludeDeleted *bool `type:"boolean"` - - // If specified when IncludeDeleted is set to true, then environments deleted - // after this date are displayed. - IncludedDeletedBackTo *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // include only those that are associated with this application version. - VersionLabel *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeEnvironmentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEnvironmentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEnvironmentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEnvironmentsInput"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.VersionLabel != nil && len(*s.VersionLabel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionLabel", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DescribeEnvironmentsInput) SetApplicationName(v string) *DescribeEnvironmentsInput { - s.ApplicationName = &v - return s -} - -// SetEnvironmentIds sets the EnvironmentIds field's value. -func (s *DescribeEnvironmentsInput) SetEnvironmentIds(v []*string) *DescribeEnvironmentsInput { - s.EnvironmentIds = v - return s -} - -// SetEnvironmentNames sets the EnvironmentNames field's value. -func (s *DescribeEnvironmentsInput) SetEnvironmentNames(v []*string) *DescribeEnvironmentsInput { - s.EnvironmentNames = v - return s -} - -// SetIncludeDeleted sets the IncludeDeleted field's value. -func (s *DescribeEnvironmentsInput) SetIncludeDeleted(v bool) *DescribeEnvironmentsInput { - s.IncludeDeleted = &v - return s -} - -// SetIncludedDeletedBackTo sets the IncludedDeletedBackTo field's value. -func (s *DescribeEnvironmentsInput) SetIncludedDeletedBackTo(v time.Time) *DescribeEnvironmentsInput { - s.IncludedDeletedBackTo = &v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *DescribeEnvironmentsInput) SetVersionLabel(v string) *DescribeEnvironmentsInput { - s.VersionLabel = &v - return s -} - -// Request to retrieve a list of events for an environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEventsMessage -type DescribeEventsInput struct { - _ struct{} `type:"structure"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // include only those associated with this application. - ApplicationName *string `min:"1" type:"string"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // those that occur up to, but not including, the EndTime. - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // those associated with this environment. - EnvironmentId *string `type:"string"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // those associated with this environment. - EnvironmentName *string `min:"4" type:"string"` - - // Specifies the maximum number of events that can be returned, beginning with - // the most recent event. - MaxRecords *int64 `min:"1" type:"integer"` - - // Pagination token. If specified, the events return the next batch of results. - NextToken *string `type:"string"` - - // The ARN of the version of the custom platform. - PlatformArn *string `type:"string"` - - // If specified, AWS Elastic Beanstalk restricts the described events to include - // only those associated with this request ID. - RequestId *string `type:"string"` - - // If specified, limits the events returned from this call to include only those - // with the specified severity or higher. - Severity *string `type:"string" enum:"EventSeverity"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // those that occur on or after this time. - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // those that are associated with this environment configuration. - TemplateName *string `min:"1" type:"string"` - - // If specified, AWS Elastic Beanstalk restricts the returned descriptions to - // those associated with this application version. - VersionLabel *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEventsInput"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.MaxRecords != nil && *s.MaxRecords < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1)) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - if s.VersionLabel != nil && len(*s.VersionLabel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionLabel", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *DescribeEventsInput) SetApplicationName(v string) *DescribeEventsInput { - s.ApplicationName = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeEventsInput) SetEndTime(v time.Time) *DescribeEventsInput { - s.EndTime = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DescribeEventsInput) SetEnvironmentId(v string) *DescribeEventsInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeEventsInput) SetEnvironmentName(v string) *DescribeEventsInput { - s.EnvironmentName = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEventsInput) SetMaxRecords(v int64) *DescribeEventsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEventsInput) SetNextToken(v string) *DescribeEventsInput { - s.NextToken = &v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *DescribeEventsInput) SetPlatformArn(v string) *DescribeEventsInput { - s.PlatformArn = &v - return s -} - -// SetRequestId sets the RequestId field's value. -func (s *DescribeEventsInput) SetRequestId(v string) *DescribeEventsInput { - s.RequestId = &v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *DescribeEventsInput) SetSeverity(v string) *DescribeEventsInput { - s.Severity = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeEventsInput) SetStartTime(v time.Time) *DescribeEventsInput { - s.StartTime = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *DescribeEventsInput) SetTemplateName(v string) *DescribeEventsInput { - s.TemplateName = &v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *DescribeEventsInput) SetVersionLabel(v string) *DescribeEventsInput { - s.VersionLabel = &v - return s -} - -// Result message wrapping a list of event descriptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EventDescriptionsMessage -type DescribeEventsOutput struct { - _ struct{} `type:"structure"` - - // A list of EventDescription. - Events []*EventDescription `type:"list"` - - // If returned, this indicates that there are more results to obtain. Use this - // token in the next DescribeEvents call to get the next batch of events. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *DescribeEventsOutput) SetEvents(v []*EventDescription) *DescribeEventsOutput { - s.Events = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEventsOutput) SetNextToken(v string) *DescribeEventsOutput { - s.NextToken = &v - return s -} - -// Parameters for a call to DescribeInstancesHealth. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeInstancesHealthRequest -type DescribeInstancesHealthInput struct { - _ struct{} `type:"structure"` - - // Specifies the response elements you wish to receive. To retrieve all attributes, - // set to All. If no attribute names are specified, returns a list of instances. - AttributeNames []*string `type:"list"` - - // Specify the AWS Elastic Beanstalk environment by ID. - EnvironmentId *string `type:"string"` - - // Specify the AWS Elastic Beanstalk environment by name. - EnvironmentName *string `min:"4" type:"string"` - - // Specify the pagination token returned by a previous call. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeInstancesHealthInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesHealthInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstancesHealthInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstancesHealthInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeNames sets the AttributeNames field's value. -func (s *DescribeInstancesHealthInput) SetAttributeNames(v []*string) *DescribeInstancesHealthInput { - s.AttributeNames = v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DescribeInstancesHealthInput) SetEnvironmentId(v string) *DescribeInstancesHealthInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *DescribeInstancesHealthInput) SetEnvironmentName(v string) *DescribeInstancesHealthInput { - s.EnvironmentName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesHealthInput) SetNextToken(v string) *DescribeInstancesHealthInput { - s.NextToken = &v - return s -} - -// Detailed health information about the Amazon EC2 instances in an AWS Elastic -// Beanstalk environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeInstancesHealthResult -type DescribeInstancesHealthOutput struct { - _ struct{} `type:"structure"` - - // Detailed health information about each instance. - InstanceHealthList []*SingleInstanceHealth `type:"list"` - - // Pagination token for the next page of results, if available. - NextToken *string `min:"1" type:"string"` - - // The date and time that the health information was retrieved. - RefreshedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeInstancesHealthOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesHealthOutput) GoString() string { - return s.String() -} - -// SetInstanceHealthList sets the InstanceHealthList field's value. -func (s *DescribeInstancesHealthOutput) SetInstanceHealthList(v []*SingleInstanceHealth) *DescribeInstancesHealthOutput { - s.InstanceHealthList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesHealthOutput) SetNextToken(v string) *DescribeInstancesHealthOutput { - s.NextToken = &v - return s -} - -// SetRefreshedAt sets the RefreshedAt field's value. -func (s *DescribeInstancesHealthOutput) SetRefreshedAt(v time.Time) *DescribeInstancesHealthOutput { - s.RefreshedAt = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribePlatformVersionRequest -type DescribePlatformVersionInput struct { - _ struct{} `type:"structure"` - - // The ARN of the version of the platform. - PlatformArn *string `type:"string"` -} - -// String returns the string representation -func (s DescribePlatformVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePlatformVersionInput) GoString() string { - return s.String() -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *DescribePlatformVersionInput) SetPlatformArn(v string) *DescribePlatformVersionInput { - s.PlatformArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribePlatformVersionResult -type DescribePlatformVersionOutput struct { - _ struct{} `type:"structure"` - - // Detailed information about the version of the platform. - PlatformDescription *PlatformDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribePlatformVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePlatformVersionOutput) GoString() string { - return s.String() -} - -// SetPlatformDescription sets the PlatformDescription field's value. -func (s *DescribePlatformVersionOutput) SetPlatformDescription(v *PlatformDescription) *DescribePlatformVersionOutput { - s.PlatformDescription = v - return s -} - -// Describes the properties of an environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EnvironmentDescription -type EnvironmentDescription struct { - _ struct{} `type:"structure"` - - // Indicates if there is an in-progress environment configuration update or - // application version deployment that you can cancel. - // - // true: There is an update in progress. - // - // false: There are no updates currently in progress. - AbortableOperationInProgress *bool `type:"boolean"` - - // The name of the application associated with this environment. - ApplicationName *string `min:"1" type:"string"` - - // The URL to the CNAME for this environment. - CNAME *string `min:"1" type:"string"` - - // The creation date for this environment. - DateCreated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The last modified date for this environment. - DateUpdated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Describes this environment. - Description *string `type:"string"` - - // For load-balanced, autoscaling environments, the URL to the LoadBalancer. - // For single-instance environments, the IP address of the instance. - EndpointURL *string `type:"string"` - - // The ID of this environment. - EnvironmentId *string `type:"string"` - - // A list of links to other environments in the same group. - EnvironmentLinks []*EnvironmentLink `type:"list"` - - // The name of this environment. - EnvironmentName *string `min:"4" type:"string"` - - // Describes the health status of the environment. AWS Elastic Beanstalk indicates - // the failure levels for a running environment: - // - // * Red: Indicates the environment is not responsive. Occurs when three - // or more consecutive failures occur for an environment. - // - // * Yellow: Indicates that something is wrong. Occurs when two consecutive - // failures occur for an environment. - // - // * Green: Indicates the environment is healthy and fully functional. - // - // * Grey: Default health for a new environment. The environment is not fully - // launched and health checks have not started or health checks are suspended - // during an UpdateEnvironment or RestartEnvironement request. - // - // Default: Grey - Health *string `type:"string" enum:"EnvironmentHealth"` - - // Returns the health status of the application running in your environment. - // For more information, see Health Colors and Statuses (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html). - HealthStatus *string `type:"string" enum:"EnvironmentHealthStatus"` - - // The ARN of the custom platform. - PlatformArn *string `type:"string"` - - // The description of the AWS resources used by this environment. - Resources *EnvironmentResourcesDescription `type:"structure"` - - // The name of the SolutionStack deployed with this environment. - SolutionStackName *string `type:"string"` - - // The current operational status of the environment: - // - // * Launching: Environment is in the process of initial deployment. - // - // * Updating: Environment is in the process of updating its configuration - // settings or application version. - // - // * Ready: Environment is available to have an action performed on it, such - // as update or terminate. - // - // * Terminating: Environment is in the shut-down process. - // - // * Terminated: Environment is not running. - Status *string `type:"string" enum:"EnvironmentStatus"` - - // The name of the configuration template used to originally launch this environment. - TemplateName *string `min:"1" type:"string"` - - // Describes the current tier of this environment. - Tier *EnvironmentTier `type:"structure"` - - // The application version deployed in this environment. - VersionLabel *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EnvironmentDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentDescription) GoString() string { - return s.String() -} - -// SetAbortableOperationInProgress sets the AbortableOperationInProgress field's value. -func (s *EnvironmentDescription) SetAbortableOperationInProgress(v bool) *EnvironmentDescription { - s.AbortableOperationInProgress = &v - return s -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *EnvironmentDescription) SetApplicationName(v string) *EnvironmentDescription { - s.ApplicationName = &v - return s -} - -// SetCNAME sets the CNAME field's value. -func (s *EnvironmentDescription) SetCNAME(v string) *EnvironmentDescription { - s.CNAME = &v - return s -} - -// SetDateCreated sets the DateCreated field's value. -func (s *EnvironmentDescription) SetDateCreated(v time.Time) *EnvironmentDescription { - s.DateCreated = &v - return s -} - -// SetDateUpdated sets the DateUpdated field's value. -func (s *EnvironmentDescription) SetDateUpdated(v time.Time) *EnvironmentDescription { - s.DateUpdated = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *EnvironmentDescription) SetDescription(v string) *EnvironmentDescription { - s.Description = &v - return s -} - -// SetEndpointURL sets the EndpointURL field's value. -func (s *EnvironmentDescription) SetEndpointURL(v string) *EnvironmentDescription { - s.EndpointURL = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *EnvironmentDescription) SetEnvironmentId(v string) *EnvironmentDescription { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentLinks sets the EnvironmentLinks field's value. -func (s *EnvironmentDescription) SetEnvironmentLinks(v []*EnvironmentLink) *EnvironmentDescription { - s.EnvironmentLinks = v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *EnvironmentDescription) SetEnvironmentName(v string) *EnvironmentDescription { - s.EnvironmentName = &v - return s -} - -// SetHealth sets the Health field's value. -func (s *EnvironmentDescription) SetHealth(v string) *EnvironmentDescription { - s.Health = &v - return s -} - -// SetHealthStatus sets the HealthStatus field's value. -func (s *EnvironmentDescription) SetHealthStatus(v string) *EnvironmentDescription { - s.HealthStatus = &v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *EnvironmentDescription) SetPlatformArn(v string) *EnvironmentDescription { - s.PlatformArn = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *EnvironmentDescription) SetResources(v *EnvironmentResourcesDescription) *EnvironmentDescription { - s.Resources = v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *EnvironmentDescription) SetSolutionStackName(v string) *EnvironmentDescription { - s.SolutionStackName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EnvironmentDescription) SetStatus(v string) *EnvironmentDescription { - s.Status = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *EnvironmentDescription) SetTemplateName(v string) *EnvironmentDescription { - s.TemplateName = &v - return s -} - -// SetTier sets the Tier field's value. -func (s *EnvironmentDescription) SetTier(v *EnvironmentTier) *EnvironmentDescription { - s.Tier = v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *EnvironmentDescription) SetVersionLabel(v string) *EnvironmentDescription { - s.VersionLabel = &v - return s -} - -// Result message containing a list of environment descriptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EnvironmentDescriptionsMessage -type EnvironmentDescriptionsMessage struct { - _ struct{} `type:"structure"` - - // Returns an EnvironmentDescription list. - Environments []*EnvironmentDescription `type:"list"` -} - -// String returns the string representation -func (s EnvironmentDescriptionsMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentDescriptionsMessage) GoString() string { - return s.String() -} - -// SetEnvironments sets the Environments field's value. -func (s *EnvironmentDescriptionsMessage) SetEnvironments(v []*EnvironmentDescription) *EnvironmentDescriptionsMessage { - s.Environments = v - return s -} - -// The information retrieved from the Amazon EC2 instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EnvironmentInfoDescription -type EnvironmentInfoDescription struct { - _ struct{} `type:"structure"` - - // The Amazon EC2 Instance ID for this information. - Ec2InstanceId *string `type:"string"` - - // The type of information retrieved. - InfoType *string `type:"string" enum:"EnvironmentInfoType"` - - // The retrieved information. - Message *string `type:"string"` - - // The time stamp when this information was retrieved. - SampleTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s EnvironmentInfoDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentInfoDescription) GoString() string { - return s.String() -} - -// SetEc2InstanceId sets the Ec2InstanceId field's value. -func (s *EnvironmentInfoDescription) SetEc2InstanceId(v string) *EnvironmentInfoDescription { - s.Ec2InstanceId = &v - return s -} - -// SetInfoType sets the InfoType field's value. -func (s *EnvironmentInfoDescription) SetInfoType(v string) *EnvironmentInfoDescription { - s.InfoType = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *EnvironmentInfoDescription) SetMessage(v string) *EnvironmentInfoDescription { - s.Message = &v - return s -} - -// SetSampleTimestamp sets the SampleTimestamp field's value. -func (s *EnvironmentInfoDescription) SetSampleTimestamp(v time.Time) *EnvironmentInfoDescription { - s.SampleTimestamp = &v - return s -} - -// A link to another environment, defined in the environment's manifest. Links -// provide connection information in system properties that can be used to connect -// to another environment in the same group. See Environment Manifest (env.yaml) -// (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html) -// for details. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EnvironmentLink -type EnvironmentLink struct { - _ struct{} `type:"structure"` - - // The name of the linked environment (the dependency). - EnvironmentName *string `type:"string"` - - // The name of the link. - LinkName *string `type:"string"` -} - -// String returns the string representation -func (s EnvironmentLink) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentLink) GoString() string { - return s.String() -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *EnvironmentLink) SetEnvironmentName(v string) *EnvironmentLink { - s.EnvironmentName = &v - return s -} - -// SetLinkName sets the LinkName field's value. -func (s *EnvironmentLink) SetLinkName(v string) *EnvironmentLink { - s.LinkName = &v - return s -} - -// Describes the AWS resources in use by this environment. This data is live. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EnvironmentResourceDescription -type EnvironmentResourceDescription struct { - _ struct{} `type:"structure"` - - // The AutoScalingGroups used by this environment. - AutoScalingGroups []*AutoScalingGroup `type:"list"` - - // The name of the environment. - EnvironmentName *string `min:"4" type:"string"` - - // The Amazon EC2 instances used by this environment. - Instances []*Instance `type:"list"` - - // The Auto Scaling launch configurations in use by this environment. - LaunchConfigurations []*LaunchConfiguration `type:"list"` - - // The LoadBalancers in use by this environment. - LoadBalancers []*LoadBalancer `type:"list"` - - // The queues used by this environment. - Queues []*Queue `type:"list"` - - // The AutoScaling triggers in use by this environment. - Triggers []*Trigger `type:"list"` -} - -// String returns the string representation -func (s EnvironmentResourceDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentResourceDescription) GoString() string { - return s.String() -} - -// SetAutoScalingGroups sets the AutoScalingGroups field's value. -func (s *EnvironmentResourceDescription) SetAutoScalingGroups(v []*AutoScalingGroup) *EnvironmentResourceDescription { - s.AutoScalingGroups = v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *EnvironmentResourceDescription) SetEnvironmentName(v string) *EnvironmentResourceDescription { - s.EnvironmentName = &v - return s -} - -// SetInstances sets the Instances field's value. -func (s *EnvironmentResourceDescription) SetInstances(v []*Instance) *EnvironmentResourceDescription { - s.Instances = v - return s -} - -// SetLaunchConfigurations sets the LaunchConfigurations field's value. -func (s *EnvironmentResourceDescription) SetLaunchConfigurations(v []*LaunchConfiguration) *EnvironmentResourceDescription { - s.LaunchConfigurations = v - return s -} - -// SetLoadBalancers sets the LoadBalancers field's value. -func (s *EnvironmentResourceDescription) SetLoadBalancers(v []*LoadBalancer) *EnvironmentResourceDescription { - s.LoadBalancers = v - return s -} - -// SetQueues sets the Queues field's value. -func (s *EnvironmentResourceDescription) SetQueues(v []*Queue) *EnvironmentResourceDescription { - s.Queues = v - return s -} - -// SetTriggers sets the Triggers field's value. -func (s *EnvironmentResourceDescription) SetTriggers(v []*Trigger) *EnvironmentResourceDescription { - s.Triggers = v - return s -} - -// Describes the AWS resources in use by this environment. This data is not -// live data. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EnvironmentResourcesDescription -type EnvironmentResourcesDescription struct { - _ struct{} `type:"structure"` - - // Describes the LoadBalancer. - LoadBalancer *LoadBalancerDescription `type:"structure"` -} - -// String returns the string representation -func (s EnvironmentResourcesDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentResourcesDescription) GoString() string { - return s.String() -} - -// SetLoadBalancer sets the LoadBalancer field's value. -func (s *EnvironmentResourcesDescription) SetLoadBalancer(v *LoadBalancerDescription) *EnvironmentResourcesDescription { - s.LoadBalancer = v - return s -} - -// Describes the properties of an environment tier -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EnvironmentTier -type EnvironmentTier struct { - _ struct{} `type:"structure"` - - // The name of this environment tier. - Name *string `type:"string"` - - // The type of this environment tier. - Type *string `type:"string"` - - // The version of this environment tier. - Version *string `type:"string"` -} - -// String returns the string representation -func (s EnvironmentTier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentTier) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *EnvironmentTier) SetName(v string) *EnvironmentTier { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *EnvironmentTier) SetType(v string) *EnvironmentTier { - s.Type = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *EnvironmentTier) SetVersion(v string) *EnvironmentTier { - s.Version = &v - return s -} - -// Describes an event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/EventDescription -type EventDescription struct { - _ struct{} `type:"structure"` - - // The application associated with the event. - ApplicationName *string `min:"1" type:"string"` - - // The name of the environment associated with this event. - EnvironmentName *string `min:"4" type:"string"` - - // The date when the event occurred. - EventDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The event message. - Message *string `type:"string"` - - // The ARN of the custom platform. - PlatformArn *string `type:"string"` - - // The web service request ID for the activity of this event. - RequestId *string `type:"string"` - - // The severity level of this event. - Severity *string `type:"string" enum:"EventSeverity"` - - // The name of the configuration associated with this event. - TemplateName *string `min:"1" type:"string"` - - // The release label for the application version associated with this event. - VersionLabel *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EventDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventDescription) GoString() string { - return s.String() -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *EventDescription) SetApplicationName(v string) *EventDescription { - s.ApplicationName = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *EventDescription) SetEnvironmentName(v string) *EventDescription { - s.EnvironmentName = &v - return s -} - -// SetEventDate sets the EventDate field's value. -func (s *EventDescription) SetEventDate(v time.Time) *EventDescription { - s.EventDate = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *EventDescription) SetMessage(v string) *EventDescription { - s.Message = &v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *EventDescription) SetPlatformArn(v string) *EventDescription { - s.PlatformArn = &v - return s -} - -// SetRequestId sets the RequestId field's value. -func (s *EventDescription) SetRequestId(v string) *EventDescription { - s.RequestId = &v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *EventDescription) SetSeverity(v string) *EventDescription { - s.Severity = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *EventDescription) SetTemplateName(v string) *EventDescription { - s.TemplateName = &v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *EventDescription) SetVersionLabel(v string) *EventDescription { - s.VersionLabel = &v - return s -} - -// The description of an Amazon EC2 instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/Instance -type Instance struct { - _ struct{} `type:"structure"` - - // The ID of the Amazon EC2 instance. - Id *string `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() -} - -// SetId sets the Id field's value. -func (s *Instance) SetId(v string) *Instance { - s.Id = &v - return s -} - -// Represents summary information about the health of an instance. For more -// information, see Health Colors and Statuses (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/InstanceHealthSummary -type InstanceHealthSummary struct { - _ struct{} `type:"structure"` - - // Red. The health agent is reporting a high number of request failures or other - // issues for an instance or environment. - Degraded *int64 `type:"integer"` - - // Green. An operation is in progress on an instance. - Info *int64 `type:"integer"` - - // Grey. AWS Elastic Beanstalk and the health agent are reporting no data on - // an instance. - NoData *int64 `type:"integer"` - - // Green. An instance is passing health checks and the health agent is not reporting - // any problems. - Ok *int64 `type:"integer"` - - // Grey. An operation is in progress on an instance within the command timeout. - Pending *int64 `type:"integer"` - - // Red. The health agent is reporting a very high number of request failures - // or other issues for an instance or environment. - Severe *int64 `type:"integer"` - - // Grey. AWS Elastic Beanstalk and the health agent are reporting an insufficient - // amount of data on an instance. - Unknown *int64 `type:"integer"` - - // Yellow. The health agent is reporting a moderate number of request failures - // or other issues for an instance or environment. - Warning *int64 `type:"integer"` -} - -// String returns the string representation -func (s InstanceHealthSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceHealthSummary) GoString() string { - return s.String() -} - -// SetDegraded sets the Degraded field's value. -func (s *InstanceHealthSummary) SetDegraded(v int64) *InstanceHealthSummary { - s.Degraded = &v - return s -} - -// SetInfo sets the Info field's value. -func (s *InstanceHealthSummary) SetInfo(v int64) *InstanceHealthSummary { - s.Info = &v - return s -} - -// SetNoData sets the NoData field's value. -func (s *InstanceHealthSummary) SetNoData(v int64) *InstanceHealthSummary { - s.NoData = &v - return s -} - -// SetOk sets the Ok field's value. -func (s *InstanceHealthSummary) SetOk(v int64) *InstanceHealthSummary { - s.Ok = &v - return s -} - -// SetPending sets the Pending field's value. -func (s *InstanceHealthSummary) SetPending(v int64) *InstanceHealthSummary { - s.Pending = &v - return s -} - -// SetSevere sets the Severe field's value. -func (s *InstanceHealthSummary) SetSevere(v int64) *InstanceHealthSummary { - s.Severe = &v - return s -} - -// SetUnknown sets the Unknown field's value. -func (s *InstanceHealthSummary) SetUnknown(v int64) *InstanceHealthSummary { - s.Unknown = &v - return s -} - -// SetWarning sets the Warning field's value. -func (s *InstanceHealthSummary) SetWarning(v int64) *InstanceHealthSummary { - s.Warning = &v - return s -} - -// Represents the average latency for the slowest X percent of requests over -// the last 10 seconds. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/Latency -type Latency struct { - _ struct{} `type:"structure"` - - // The average latency for the slowest 90 percent of requests over the last - // 10 seconds. - P10 *float64 `type:"double"` - - // The average latency for the slowest 50 percent of requests over the last - // 10 seconds. - P50 *float64 `type:"double"` - - // The average latency for the slowest 25 percent of requests over the last - // 10 seconds. - P75 *float64 `type:"double"` - - // The average latency for the slowest 15 percent of requests over the last - // 10 seconds. - P85 *float64 `type:"double"` - - // The average latency for the slowest 10 percent of requests over the last - // 10 seconds. - P90 *float64 `type:"double"` - - // The average latency for the slowest 5 percent of requests over the last 10 - // seconds. - P95 *float64 `type:"double"` - - // The average latency for the slowest 1 percent of requests over the last 10 - // seconds. - P99 *float64 `type:"double"` - - // The average latency for the slowest 0.1 percent of requests over the last - // 10 seconds. - P999 *float64 `type:"double"` -} - -// String returns the string representation -func (s Latency) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Latency) GoString() string { - return s.String() -} - -// SetP10 sets the P10 field's value. -func (s *Latency) SetP10(v float64) *Latency { - s.P10 = &v - return s -} - -// SetP50 sets the P50 field's value. -func (s *Latency) SetP50(v float64) *Latency { - s.P50 = &v - return s -} - -// SetP75 sets the P75 field's value. -func (s *Latency) SetP75(v float64) *Latency { - s.P75 = &v - return s -} - -// SetP85 sets the P85 field's value. -func (s *Latency) SetP85(v float64) *Latency { - s.P85 = &v - return s -} - -// SetP90 sets the P90 field's value. -func (s *Latency) SetP90(v float64) *Latency { - s.P90 = &v - return s -} - -// SetP95 sets the P95 field's value. -func (s *Latency) SetP95(v float64) *Latency { - s.P95 = &v - return s -} - -// SetP99 sets the P99 field's value. -func (s *Latency) SetP99(v float64) *Latency { - s.P99 = &v - return s -} - -// SetP999 sets the P999 field's value. -func (s *Latency) SetP999(v float64) *Latency { - s.P999 = &v - return s -} - -// Describes an Auto Scaling launch configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/LaunchConfiguration -type LaunchConfiguration struct { - _ struct{} `type:"structure"` - - // The name of the launch configuration. - Name *string `type:"string"` -} - -// String returns the string representation -func (s LaunchConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchConfiguration) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *LaunchConfiguration) SetName(v string) *LaunchConfiguration { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListAvailableSolutionStacksInput -type ListAvailableSolutionStacksInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ListAvailableSolutionStacksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAvailableSolutionStacksInput) GoString() string { - return s.String() -} - -// A list of available AWS Elastic Beanstalk solution stacks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListAvailableSolutionStacksResultMessage -type ListAvailableSolutionStacksOutput struct { - _ struct{} `type:"structure"` - - // A list of available solution stacks and their SolutionStackDescription. - SolutionStackDetails []*SolutionStackDescription `type:"list"` - - // A list of available solution stacks. - SolutionStacks []*string `type:"list"` -} - -// String returns the string representation -func (s ListAvailableSolutionStacksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAvailableSolutionStacksOutput) GoString() string { - return s.String() -} - -// SetSolutionStackDetails sets the SolutionStackDetails field's value. -func (s *ListAvailableSolutionStacksOutput) SetSolutionStackDetails(v []*SolutionStackDescription) *ListAvailableSolutionStacksOutput { - s.SolutionStackDetails = v - return s -} - -// SetSolutionStacks sets the SolutionStacks field's value. -func (s *ListAvailableSolutionStacksOutput) SetSolutionStacks(v []*string) *ListAvailableSolutionStacksOutput { - s.SolutionStacks = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListPlatformVersionsRequest -type ListPlatformVersionsInput struct { - _ struct{} `type:"structure"` - - // List only the platforms where the platform member value relates to one of - // the supplied values. - Filters []*PlatformFilter `type:"list"` - - // The maximum number of platform values returned in one call. - MaxRecords *int64 `min:"1" type:"integer"` - - // The starting index into the remaining list of platforms. Use the NextToken - // value from a previous ListPlatformVersion call. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListPlatformVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPlatformVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPlatformVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPlatformVersionsInput"} - if s.MaxRecords != nil && *s.MaxRecords < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListPlatformVersionsInput) SetFilters(v []*PlatformFilter) *ListPlatformVersionsInput { - s.Filters = v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *ListPlatformVersionsInput) SetMaxRecords(v int64) *ListPlatformVersionsInput { - s.MaxRecords = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPlatformVersionsInput) SetNextToken(v string) *ListPlatformVersionsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ListPlatformVersionsResult -type ListPlatformVersionsOutput struct { - _ struct{} `type:"structure"` - - // The starting index into the remaining list of platforms. if this value is - // not null, you can use it in a subsequent ListPlatformVersion call. - NextToken *string `type:"string"` - - // Detailed information about the platforms. - PlatformSummaryList []*PlatformSummary `type:"list"` -} - -// String returns the string representation -func (s ListPlatformVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPlatformVersionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPlatformVersionsOutput) SetNextToken(v string) *ListPlatformVersionsOutput { - s.NextToken = &v - return s -} - -// SetPlatformSummaryList sets the PlatformSummaryList field's value. -func (s *ListPlatformVersionsOutput) SetPlatformSummaryList(v []*PlatformSummary) *ListPlatformVersionsOutput { - s.PlatformSummaryList = v - return s -} - -// Describes the properties of a Listener for the LoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/Listener -type Listener struct { - _ struct{} `type:"structure"` - - // The port that is used by the Listener. - Port *int64 `type:"integer"` - - // The protocol that is used by the Listener. - Protocol *string `type:"string"` -} - -// String returns the string representation -func (s Listener) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Listener) GoString() string { - return s.String() -} - -// SetPort sets the Port field's value. -func (s *Listener) SetPort(v int64) *Listener { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *Listener) SetProtocol(v string) *Listener { - s.Protocol = &v - return s -} - -// Describes a LoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/LoadBalancer -type LoadBalancer struct { - _ struct{} `type:"structure"` - - // The name of the LoadBalancer. - Name *string `type:"string"` -} - -// String returns the string representation -func (s LoadBalancer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancer) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *LoadBalancer) SetName(v string) *LoadBalancer { - s.Name = &v - return s -} - -// Describes the details of a LoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/LoadBalancerDescription -type LoadBalancerDescription struct { - _ struct{} `type:"structure"` - - // The domain name of the LoadBalancer. - Domain *string `type:"string"` - - // A list of Listeners used by the LoadBalancer. - Listeners []*Listener `type:"list"` - - // The name of the LoadBalancer. - LoadBalancerName *string `type:"string"` -} - -// String returns the string representation -func (s LoadBalancerDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancerDescription) GoString() string { - return s.String() -} - -// SetDomain sets the Domain field's value. -func (s *LoadBalancerDescription) SetDomain(v string) *LoadBalancerDescription { - s.Domain = &v - return s -} - -// SetListeners sets the Listeners field's value. -func (s *LoadBalancerDescription) SetListeners(v []*Listener) *LoadBalancerDescription { - s.Listeners = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *LoadBalancerDescription) SetLoadBalancerName(v string) *LoadBalancerDescription { - s.LoadBalancerName = &v - return s -} - -// The record of an upcoming or in-progress managed action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ManagedAction -type ManagedAction struct { - _ struct{} `type:"structure"` - - // A description of the managed action. - ActionDescription *string `type:"string"` - - // A unique identifier for the managed action. - ActionId *string `type:"string"` - - // The type of managed action. - ActionType *string `type:"string" enum:"ActionType"` - - // The status of the managed action. If the action is Scheduled, you can apply - // it immediately with ApplyEnvironmentManagedAction. - Status *string `type:"string" enum:"ActionStatus"` - - // The start time of the maintenance window in which the managed action will - // execute. - WindowStartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ManagedAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ManagedAction) GoString() string { - return s.String() -} - -// SetActionDescription sets the ActionDescription field's value. -func (s *ManagedAction) SetActionDescription(v string) *ManagedAction { - s.ActionDescription = &v - return s -} - -// SetActionId sets the ActionId field's value. -func (s *ManagedAction) SetActionId(v string) *ManagedAction { - s.ActionId = &v - return s -} - -// SetActionType sets the ActionType field's value. -func (s *ManagedAction) SetActionType(v string) *ManagedAction { - s.ActionType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ManagedAction) SetStatus(v string) *ManagedAction { - s.Status = &v - return s -} - -// SetWindowStartTime sets the WindowStartTime field's value. -func (s *ManagedAction) SetWindowStartTime(v time.Time) *ManagedAction { - s.WindowStartTime = &v - return s -} - -// The record of a completed or failed managed action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ManagedActionHistoryItem -type ManagedActionHistoryItem struct { - _ struct{} `type:"structure"` - - // A description of the managed action. - ActionDescription *string `type:"string"` - - // A unique identifier for the managed action. - ActionId *string `type:"string"` - - // The type of the managed action. - ActionType *string `type:"string" enum:"ActionType"` - - // The date and time that the action started executing. - ExecutedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // If the action failed, a description of the failure. - FailureDescription *string `type:"string"` - - // If the action failed, the type of failure. - FailureType *string `type:"string" enum:"FailureType"` - - // The date and time that the action finished executing. - FinishedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The status of the action. - Status *string `type:"string" enum:"ActionHistoryStatus"` -} - -// String returns the string representation -func (s ManagedActionHistoryItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ManagedActionHistoryItem) GoString() string { - return s.String() -} - -// SetActionDescription sets the ActionDescription field's value. -func (s *ManagedActionHistoryItem) SetActionDescription(v string) *ManagedActionHistoryItem { - s.ActionDescription = &v - return s -} - -// SetActionId sets the ActionId field's value. -func (s *ManagedActionHistoryItem) SetActionId(v string) *ManagedActionHistoryItem { - s.ActionId = &v - return s -} - -// SetActionType sets the ActionType field's value. -func (s *ManagedActionHistoryItem) SetActionType(v string) *ManagedActionHistoryItem { - s.ActionType = &v - return s -} - -// SetExecutedTime sets the ExecutedTime field's value. -func (s *ManagedActionHistoryItem) SetExecutedTime(v time.Time) *ManagedActionHistoryItem { - s.ExecutedTime = &v - return s -} - -// SetFailureDescription sets the FailureDescription field's value. -func (s *ManagedActionHistoryItem) SetFailureDescription(v string) *ManagedActionHistoryItem { - s.FailureDescription = &v - return s -} - -// SetFailureType sets the FailureType field's value. -func (s *ManagedActionHistoryItem) SetFailureType(v string) *ManagedActionHistoryItem { - s.FailureType = &v - return s -} - -// SetFinishedTime sets the FinishedTime field's value. -func (s *ManagedActionHistoryItem) SetFinishedTime(v time.Time) *ManagedActionHistoryItem { - s.FinishedTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ManagedActionHistoryItem) SetStatus(v string) *ManagedActionHistoryItem { - s.Status = &v - return s -} - -// A lifecycle rule that deletes application versions after the specified number -// of days. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/MaxAgeRule -type MaxAgeRule struct { - _ struct{} `type:"structure"` - - // Set to true to delete a version's source bundle from Amazon S3 when Elastic - // Beanstalk deletes the application version. - DeleteSourceFromS3 *bool `type:"boolean"` - - // Specify true to apply the rule, or false to disable it. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // Specify the number of days to retain an application versions. - MaxAgeInDays *int64 `type:"integer"` -} - -// String returns the string representation -func (s MaxAgeRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaxAgeRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MaxAgeRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MaxAgeRule"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeleteSourceFromS3 sets the DeleteSourceFromS3 field's value. -func (s *MaxAgeRule) SetDeleteSourceFromS3(v bool) *MaxAgeRule { - s.DeleteSourceFromS3 = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *MaxAgeRule) SetEnabled(v bool) *MaxAgeRule { - s.Enabled = &v - return s -} - -// SetMaxAgeInDays sets the MaxAgeInDays field's value. -func (s *MaxAgeRule) SetMaxAgeInDays(v int64) *MaxAgeRule { - s.MaxAgeInDays = &v - return s -} - -// A lifecycle rule that deletes the oldest application version when the maximum -// count is exceeded. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/MaxCountRule -type MaxCountRule struct { - _ struct{} `type:"structure"` - - // Set to true to delete a version's source bundle from Amazon S3 when Elastic - // Beanstalk deletes the application version. - DeleteSourceFromS3 *bool `type:"boolean"` - - // Specify true to apply the rule, or false to disable it. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // Specify the maximum number of application versions to retain. - MaxCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s MaxCountRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaxCountRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MaxCountRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MaxCountRule"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeleteSourceFromS3 sets the DeleteSourceFromS3 field's value. -func (s *MaxCountRule) SetDeleteSourceFromS3(v bool) *MaxCountRule { - s.DeleteSourceFromS3 = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *MaxCountRule) SetEnabled(v bool) *MaxCountRule { - s.Enabled = &v - return s -} - -// SetMaxCount sets the MaxCount field's value. -func (s *MaxCountRule) SetMaxCount(v int64) *MaxCountRule { - s.MaxCount = &v - return s -} - -// A regular expression representing a restriction on a string configuration -// option value. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/OptionRestrictionRegex -type OptionRestrictionRegex struct { - _ struct{} `type:"structure"` - - // A unique name representing this regular expression. - Label *string `type:"string"` - - // The regular expression pattern that a string configuration option value with - // this restriction must match. - Pattern *string `type:"string"` -} - -// String returns the string representation -func (s OptionRestrictionRegex) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionRestrictionRegex) GoString() string { - return s.String() -} - -// SetLabel sets the Label field's value. -func (s *OptionRestrictionRegex) SetLabel(v string) *OptionRestrictionRegex { - s.Label = &v - return s -} - -// SetPattern sets the Pattern field's value. -func (s *OptionRestrictionRegex) SetPattern(v string) *OptionRestrictionRegex { - s.Pattern = &v - return s -} - -// A specification identifying an individual configuration option. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/OptionSpecification -type OptionSpecification struct { - _ struct{} `type:"structure"` - - // A unique namespace identifying the option's associated AWS resource. - Namespace *string `type:"string"` - - // The name of the configuration option. - OptionName *string `type:"string"` - - // A unique resource name for a time-based scaling configuration option. - ResourceName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s OptionSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OptionSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OptionSpecification"} - if s.ResourceName != nil && len(*s.ResourceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNamespace sets the Namespace field's value. -func (s *OptionSpecification) SetNamespace(v string) *OptionSpecification { - s.Namespace = &v - return s -} - -// SetOptionName sets the OptionName field's value. -func (s *OptionSpecification) SetOptionName(v string) *OptionSpecification { - s.OptionName = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *OptionSpecification) SetResourceName(v string) *OptionSpecification { - s.ResourceName = &v - return s -} - -// Detailed information about a platform. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/PlatformDescription -type PlatformDescription struct { - _ struct{} `type:"structure"` - - // The custom AMIs supported by the platform. - CustomAmiList []*CustomAmi `type:"list"` - - // The date when the platform was created. - DateCreated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The date when the platform was last updated. - DateUpdated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The description of the platform. - Description *string `type:"string"` - - // The frameworks supported by the platform. - Frameworks []*PlatformFramework `type:"list"` - - // Information about the maintainer of the platform. - Maintainer *string `type:"string"` - - // The operating system used by the platform. - OperatingSystemName *string `type:"string"` - - // The version of the operating system used by the platform. - OperatingSystemVersion *string `type:"string"` - - // The ARN of the platform. - PlatformArn *string `type:"string"` - - // The category of the platform. - PlatformCategory *string `type:"string"` - - // The name of the platform. - PlatformName *string `type:"string"` - - // The AWS account ID of the person who created the platform. - PlatformOwner *string `type:"string"` - - // The status of the platform. - PlatformStatus *string `type:"string" enum:"PlatformStatus"` - - // The version of the platform. - PlatformVersion *string `type:"string"` - - // The programming languages supported by the platform. - ProgrammingLanguages []*PlatformProgrammingLanguage `type:"list"` - - // The name of the solution stack used by the platform. - SolutionStackName *string `type:"string"` - - // The additions supported by the platform. - SupportedAddonList []*string `type:"list"` - - // The tiers supported by the platform. - SupportedTierList []*string `type:"list"` -} - -// String returns the string representation -func (s PlatformDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlatformDescription) GoString() string { - return s.String() -} - -// SetCustomAmiList sets the CustomAmiList field's value. -func (s *PlatformDescription) SetCustomAmiList(v []*CustomAmi) *PlatformDescription { - s.CustomAmiList = v - return s -} - -// SetDateCreated sets the DateCreated field's value. -func (s *PlatformDescription) SetDateCreated(v time.Time) *PlatformDescription { - s.DateCreated = &v - return s -} - -// SetDateUpdated sets the DateUpdated field's value. -func (s *PlatformDescription) SetDateUpdated(v time.Time) *PlatformDescription { - s.DateUpdated = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *PlatformDescription) SetDescription(v string) *PlatformDescription { - s.Description = &v - return s -} - -// SetFrameworks sets the Frameworks field's value. -func (s *PlatformDescription) SetFrameworks(v []*PlatformFramework) *PlatformDescription { - s.Frameworks = v - return s -} - -// SetMaintainer sets the Maintainer field's value. -func (s *PlatformDescription) SetMaintainer(v string) *PlatformDescription { - s.Maintainer = &v - return s -} - -// SetOperatingSystemName sets the OperatingSystemName field's value. -func (s *PlatformDescription) SetOperatingSystemName(v string) *PlatformDescription { - s.OperatingSystemName = &v - return s -} - -// SetOperatingSystemVersion sets the OperatingSystemVersion field's value. -func (s *PlatformDescription) SetOperatingSystemVersion(v string) *PlatformDescription { - s.OperatingSystemVersion = &v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *PlatformDescription) SetPlatformArn(v string) *PlatformDescription { - s.PlatformArn = &v - return s -} - -// SetPlatformCategory sets the PlatformCategory field's value. -func (s *PlatformDescription) SetPlatformCategory(v string) *PlatformDescription { - s.PlatformCategory = &v - return s -} - -// SetPlatformName sets the PlatformName field's value. -func (s *PlatformDescription) SetPlatformName(v string) *PlatformDescription { - s.PlatformName = &v - return s -} - -// SetPlatformOwner sets the PlatformOwner field's value. -func (s *PlatformDescription) SetPlatformOwner(v string) *PlatformDescription { - s.PlatformOwner = &v - return s -} - -// SetPlatformStatus sets the PlatformStatus field's value. -func (s *PlatformDescription) SetPlatformStatus(v string) *PlatformDescription { - s.PlatformStatus = &v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *PlatformDescription) SetPlatformVersion(v string) *PlatformDescription { - s.PlatformVersion = &v - return s -} - -// SetProgrammingLanguages sets the ProgrammingLanguages field's value. -func (s *PlatformDescription) SetProgrammingLanguages(v []*PlatformProgrammingLanguage) *PlatformDescription { - s.ProgrammingLanguages = v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *PlatformDescription) SetSolutionStackName(v string) *PlatformDescription { - s.SolutionStackName = &v - return s -} - -// SetSupportedAddonList sets the SupportedAddonList field's value. -func (s *PlatformDescription) SetSupportedAddonList(v []*string) *PlatformDescription { - s.SupportedAddonList = v - return s -} - -// SetSupportedTierList sets the SupportedTierList field's value. -func (s *PlatformDescription) SetSupportedTierList(v []*string) *PlatformDescription { - s.SupportedTierList = v - return s -} - -// Specify criteria to restrict the results when listing custom platforms. -// -// The filter is evaluated as the expression: -// -// TypeOperatorValues[i] -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/PlatformFilter -type PlatformFilter struct { - _ struct{} `type:"structure"` - - // The operator to apply to the Type with each of the Values. - // - // Valid Values: = (equal to) | != (not equal to) | < (less than) | <= (less - // than or equal to) | > (greater than) | >= (greater than or equal to) | contains - // | begins_with | ends_with - Operator *string `type:"string"` - - // The custom platform attribute to which the filter values are applied. - // - // Valid Values: PlatformName | PlatformVersion | PlatformStatus | PlatformOwner - Type *string `type:"string"` - - // The list of values applied to the custom platform attribute. - Values []*string `type:"list"` -} - -// String returns the string representation -func (s PlatformFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlatformFilter) GoString() string { - return s.String() -} - -// SetOperator sets the Operator field's value. -func (s *PlatformFilter) SetOperator(v string) *PlatformFilter { - s.Operator = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlatformFilter) SetType(v string) *PlatformFilter { - s.Type = &v - return s -} - -// SetValues sets the Values field's value. -func (s *PlatformFilter) SetValues(v []*string) *PlatformFilter { - s.Values = v - return s -} - -// A framework supported by the custom platform. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/PlatformFramework -type PlatformFramework struct { - _ struct{} `type:"structure"` - - // The name of the framework. - Name *string `type:"string"` - - // The version of the framework. - Version *string `type:"string"` -} - -// String returns the string representation -func (s PlatformFramework) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlatformFramework) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *PlatformFramework) SetName(v string) *PlatformFramework { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *PlatformFramework) SetVersion(v string) *PlatformFramework { - s.Version = &v - return s -} - -// A programming language supported by the platform. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/PlatformProgrammingLanguage -type PlatformProgrammingLanguage struct { - _ struct{} `type:"structure"` - - // The name of the programming language. - Name *string `type:"string"` - - // The version of the programming language. - Version *string `type:"string"` -} - -// String returns the string representation -func (s PlatformProgrammingLanguage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlatformProgrammingLanguage) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *PlatformProgrammingLanguage) SetName(v string) *PlatformProgrammingLanguage { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *PlatformProgrammingLanguage) SetVersion(v string) *PlatformProgrammingLanguage { - s.Version = &v - return s -} - -// Detailed information about a platform. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/PlatformSummary -type PlatformSummary struct { - _ struct{} `type:"structure"` - - // The operating system used by the platform. - OperatingSystemName *string `type:"string"` - - // The version of the operating system used by the platform. - OperatingSystemVersion *string `type:"string"` - - // The ARN of the platform. - PlatformArn *string `type:"string"` - - // The category of platform. - PlatformCategory *string `type:"string"` - - // The AWS account ID of the person who created the platform. - PlatformOwner *string `type:"string"` - - // The status of the platform. You can create an environment from the platform - // once it is ready. - PlatformStatus *string `type:"string" enum:"PlatformStatus"` - - // The additions associated with the platform. - SupportedAddonList []*string `type:"list"` - - // The tiers in which the platform runs. - SupportedTierList []*string `type:"list"` -} - -// String returns the string representation -func (s PlatformSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlatformSummary) GoString() string { - return s.String() -} - -// SetOperatingSystemName sets the OperatingSystemName field's value. -func (s *PlatformSummary) SetOperatingSystemName(v string) *PlatformSummary { - s.OperatingSystemName = &v - return s -} - -// SetOperatingSystemVersion sets the OperatingSystemVersion field's value. -func (s *PlatformSummary) SetOperatingSystemVersion(v string) *PlatformSummary { - s.OperatingSystemVersion = &v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *PlatformSummary) SetPlatformArn(v string) *PlatformSummary { - s.PlatformArn = &v - return s -} - -// SetPlatformCategory sets the PlatformCategory field's value. -func (s *PlatformSummary) SetPlatformCategory(v string) *PlatformSummary { - s.PlatformCategory = &v - return s -} - -// SetPlatformOwner sets the PlatformOwner field's value. -func (s *PlatformSummary) SetPlatformOwner(v string) *PlatformSummary { - s.PlatformOwner = &v - return s -} - -// SetPlatformStatus sets the PlatformStatus field's value. -func (s *PlatformSummary) SetPlatformStatus(v string) *PlatformSummary { - s.PlatformStatus = &v - return s -} - -// SetSupportedAddonList sets the SupportedAddonList field's value. -func (s *PlatformSummary) SetSupportedAddonList(v []*string) *PlatformSummary { - s.SupportedAddonList = v - return s -} - -// SetSupportedTierList sets the SupportedTierList field's value. -func (s *PlatformSummary) SetSupportedTierList(v []*string) *PlatformSummary { - s.SupportedTierList = v - return s -} - -// Describes a queue. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/Queue -type Queue struct { - _ struct{} `type:"structure"` - - // The name of the queue. - Name *string `type:"string"` - - // The URL of the queue. - URL *string `type:"string"` -} - -// String returns the string representation -func (s Queue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Queue) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Queue) SetName(v string) *Queue { - s.Name = &v - return s -} - -// SetURL sets the URL field's value. -func (s *Queue) SetURL(v string) *Queue { - s.URL = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RebuildEnvironmentMessage -type RebuildEnvironmentInput struct { - _ struct{} `type:"structure"` - - // The ID of the environment to rebuild. - // - // Condition: You must specify either this or an EnvironmentName, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentId *string `type:"string"` - - // The name of the environment to rebuild. - // - // Condition: You must specify either this or an EnvironmentId, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentName *string `min:"4" type:"string"` -} - -// String returns the string representation -func (s RebuildEnvironmentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebuildEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebuildEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebuildEnvironmentInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *RebuildEnvironmentInput) SetEnvironmentId(v string) *RebuildEnvironmentInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *RebuildEnvironmentInput) SetEnvironmentName(v string) *RebuildEnvironmentInput { - s.EnvironmentName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RebuildEnvironmentOutput -type RebuildEnvironmentOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RebuildEnvironmentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebuildEnvironmentOutput) GoString() string { - return s.String() -} - -// Request to retrieve logs from an environment and store them in your Elastic -// Beanstalk storage bucket. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RequestEnvironmentInfoMessage -type RequestEnvironmentInfoInput struct { - _ struct{} `type:"structure"` - - // The ID of the environment of the requested data. - // - // If no such environment is found, RequestEnvironmentInfo returns an InvalidParameterValue - // error. - // - // Condition: You must specify either this or an EnvironmentName, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentId *string `type:"string"` - - // The name of the environment of the requested data. - // - // If no such environment is found, RequestEnvironmentInfo returns an InvalidParameterValue - // error. - // - // Condition: You must specify either this or an EnvironmentId, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentName *string `min:"4" type:"string"` - - // The type of information to request. - // - // InfoType is a required field - InfoType *string `type:"string" required:"true" enum:"EnvironmentInfoType"` -} - -// String returns the string representation -func (s RequestEnvironmentInfoInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestEnvironmentInfoInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestEnvironmentInfoInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestEnvironmentInfoInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.InfoType == nil { - invalidParams.Add(request.NewErrParamRequired("InfoType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *RequestEnvironmentInfoInput) SetEnvironmentId(v string) *RequestEnvironmentInfoInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *RequestEnvironmentInfoInput) SetEnvironmentName(v string) *RequestEnvironmentInfoInput { - s.EnvironmentName = &v - return s -} - -// SetInfoType sets the InfoType field's value. -func (s *RequestEnvironmentInfoInput) SetInfoType(v string) *RequestEnvironmentInfoInput { - s.InfoType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RequestEnvironmentInfoOutput -type RequestEnvironmentInfoOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RequestEnvironmentInfoOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestEnvironmentInfoOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RestartAppServerMessage -type RestartAppServerInput struct { - _ struct{} `type:"structure"` - - // The ID of the environment to restart the server for. - // - // Condition: You must specify either this or an EnvironmentName, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentId *string `type:"string"` - - // The name of the environment to restart the server for. - // - // Condition: You must specify either this or an EnvironmentId, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentName *string `min:"4" type:"string"` -} - -// String returns the string representation -func (s RestartAppServerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestartAppServerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestartAppServerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestartAppServerInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *RestartAppServerInput) SetEnvironmentId(v string) *RestartAppServerInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *RestartAppServerInput) SetEnvironmentName(v string) *RestartAppServerInput { - s.EnvironmentName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RestartAppServerOutput -type RestartAppServerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RestartAppServerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestartAppServerOutput) GoString() string { - return s.String() -} - -// Request to download logs retrieved with RequestEnvironmentInfo. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RetrieveEnvironmentInfoMessage -type RetrieveEnvironmentInfoInput struct { - _ struct{} `type:"structure"` - - // The ID of the data's environment. - // - // If no such environment is found, returns an InvalidParameterValue error. - // - // Condition: You must specify either this or an EnvironmentName, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentId *string `type:"string"` - - // The name of the data's environment. - // - // If no such environment is found, returns an InvalidParameterValue error. - // - // Condition: You must specify either this or an EnvironmentId, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentName *string `min:"4" type:"string"` - - // The type of information to retrieve. - // - // InfoType is a required field - InfoType *string `type:"string" required:"true" enum:"EnvironmentInfoType"` -} - -// String returns the string representation -func (s RetrieveEnvironmentInfoInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RetrieveEnvironmentInfoInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetrieveEnvironmentInfoInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetrieveEnvironmentInfoInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.InfoType == nil { - invalidParams.Add(request.NewErrParamRequired("InfoType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *RetrieveEnvironmentInfoInput) SetEnvironmentId(v string) *RetrieveEnvironmentInfoInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *RetrieveEnvironmentInfoInput) SetEnvironmentName(v string) *RetrieveEnvironmentInfoInput { - s.EnvironmentName = &v - return s -} - -// SetInfoType sets the InfoType field's value. -func (s *RetrieveEnvironmentInfoInput) SetInfoType(v string) *RetrieveEnvironmentInfoInput { - s.InfoType = &v - return s -} - -// Result message containing a description of the requested environment info. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RetrieveEnvironmentInfoResultMessage -type RetrieveEnvironmentInfoOutput struct { - _ struct{} `type:"structure"` - - // The EnvironmentInfoDescription of the environment. - EnvironmentInfo []*EnvironmentInfoDescription `type:"list"` -} - -// String returns the string representation -func (s RetrieveEnvironmentInfoOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RetrieveEnvironmentInfoOutput) GoString() string { - return s.String() -} - -// SetEnvironmentInfo sets the EnvironmentInfo field's value. -func (s *RetrieveEnvironmentInfoOutput) SetEnvironmentInfo(v []*EnvironmentInfoDescription) *RetrieveEnvironmentInfoOutput { - s.EnvironmentInfo = v - return s -} - -// The bucket and key of an item stored in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/S3Location -type S3Location struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket where the data is located. - S3Bucket *string `type:"string"` - - // The Amazon S3 key where the data is located. - S3Key *string `type:"string"` -} - -// String returns the string representation -func (s S3Location) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3Location) GoString() string { - return s.String() -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *S3Location) SetS3Bucket(v string) *S3Location { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *S3Location) SetS3Key(v string) *S3Location { - s.S3Key = &v - return s -} - -// Detailed health information about an Amazon EC2 instance in your Elastic -// Beanstalk environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SingleInstanceHealth -type SingleInstanceHealth struct { - _ struct{} `type:"structure"` - - // Request metrics from your application. - ApplicationMetrics *ApplicationMetrics `type:"structure"` - - // The availability zone in which the instance runs. - AvailabilityZone *string `type:"string"` - - // Represents the causes, which provide more information about the current health - // status. - Causes []*string `type:"list"` - - // Represents the color indicator that gives you information about the health - // of the EC2 instance. For more information, see Health Colors and Statuses - // (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html). - Color *string `type:"string"` - - // Information about the most recent deployment to an instance. - Deployment *Deployment `type:"structure"` - - // Returns the health status of the specified instance. For more information, - // see Health Colors and Statuses (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html). - HealthStatus *string `type:"string"` - - // The ID of the Amazon EC2 instance. - InstanceId *string `min:"1" type:"string"` - - // The instance's type. - InstanceType *string `type:"string"` - - // The time at which the EC2 instance was launched. - LaunchedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Operating system metrics from the instance. - System *SystemStatus `type:"structure"` -} - -// String returns the string representation -func (s SingleInstanceHealth) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SingleInstanceHealth) GoString() string { - return s.String() -} - -// SetApplicationMetrics sets the ApplicationMetrics field's value. -func (s *SingleInstanceHealth) SetApplicationMetrics(v *ApplicationMetrics) *SingleInstanceHealth { - s.ApplicationMetrics = v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *SingleInstanceHealth) SetAvailabilityZone(v string) *SingleInstanceHealth { - s.AvailabilityZone = &v - return s -} - -// SetCauses sets the Causes field's value. -func (s *SingleInstanceHealth) SetCauses(v []*string) *SingleInstanceHealth { - s.Causes = v - return s -} - -// SetColor sets the Color field's value. -func (s *SingleInstanceHealth) SetColor(v string) *SingleInstanceHealth { - s.Color = &v - return s -} - -// SetDeployment sets the Deployment field's value. -func (s *SingleInstanceHealth) SetDeployment(v *Deployment) *SingleInstanceHealth { - s.Deployment = v - return s -} - -// SetHealthStatus sets the HealthStatus field's value. -func (s *SingleInstanceHealth) SetHealthStatus(v string) *SingleInstanceHealth { - s.HealthStatus = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *SingleInstanceHealth) SetInstanceId(v string) *SingleInstanceHealth { - s.InstanceId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *SingleInstanceHealth) SetInstanceType(v string) *SingleInstanceHealth { - s.InstanceType = &v - return s -} - -// SetLaunchedAt sets the LaunchedAt field's value. -func (s *SingleInstanceHealth) SetLaunchedAt(v time.Time) *SingleInstanceHealth { - s.LaunchedAt = &v - return s -} - -// SetSystem sets the System field's value. -func (s *SingleInstanceHealth) SetSystem(v *SystemStatus) *SingleInstanceHealth { - s.System = v - return s -} - -// Describes the solution stack. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SolutionStackDescription -type SolutionStackDescription struct { - _ struct{} `type:"structure"` - - // The permitted file types allowed for a solution stack. - PermittedFileTypes []*string `type:"list"` - - // The name of the solution stack. - SolutionStackName *string `type:"string"` -} - -// String returns the string representation -func (s SolutionStackDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SolutionStackDescription) GoString() string { - return s.String() -} - -// SetPermittedFileTypes sets the PermittedFileTypes field's value. -func (s *SolutionStackDescription) SetPermittedFileTypes(v []*string) *SolutionStackDescription { - s.PermittedFileTypes = v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *SolutionStackDescription) SetSolutionStackName(v string) *SolutionStackDescription { - s.SolutionStackName = &v - return s -} - -// Location of the source code for an application version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SourceBuildInformation -type SourceBuildInformation struct { - _ struct{} `type:"structure"` - - // The location of the source code, as a formatted string, depending on the - // value of SourceRepository - // - // * For CodeCommit, the format is the repository name and commit ID, separated - // by a forward slash. For example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a. - // - // * For S3, the format is the S3 bucket name and object key, separated by - // a forward slash. For example, my-s3-bucket/Folders/my-source-file. - // - // SourceLocation is a required field - SourceLocation *string `min:"3" type:"string" required:"true"` - - // Location where the repository is stored. - // - // * CodeCommit - // - // * S3 - // - // SourceRepository is a required field - SourceRepository *string `type:"string" required:"true" enum:"SourceRepository"` - - // The type of repository. - // - // * Git - // - // * Zip - // - // SourceType is a required field - SourceType *string `type:"string" required:"true" enum:"SourceType"` -} - -// String returns the string representation -func (s SourceBuildInformation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceBuildInformation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceBuildInformation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceBuildInformation"} - if s.SourceLocation == nil { - invalidParams.Add(request.NewErrParamRequired("SourceLocation")) - } - if s.SourceLocation != nil && len(*s.SourceLocation) < 3 { - invalidParams.Add(request.NewErrParamMinLen("SourceLocation", 3)) - } - if s.SourceRepository == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRepository")) - } - if s.SourceType == nil { - invalidParams.Add(request.NewErrParamRequired("SourceType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceLocation sets the SourceLocation field's value. -func (s *SourceBuildInformation) SetSourceLocation(v string) *SourceBuildInformation { - s.SourceLocation = &v - return s -} - -// SetSourceRepository sets the SourceRepository field's value. -func (s *SourceBuildInformation) SetSourceRepository(v string) *SourceBuildInformation { - s.SourceRepository = &v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *SourceBuildInformation) SetSourceType(v string) *SourceBuildInformation { - s.SourceType = &v - return s -} - -// A specification for an environment configuration -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SourceConfiguration -type SourceConfiguration struct { - _ struct{} `type:"structure"` - - // The name of the application associated with the configuration. - ApplicationName *string `min:"1" type:"string"` - - // The name of the configuration template. - TemplateName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s SourceConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceConfiguration"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *SourceConfiguration) SetApplicationName(v string) *SourceConfiguration { - s.ApplicationName = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *SourceConfiguration) SetTemplateName(v string) *SourceConfiguration { - s.TemplateName = &v - return s -} - -// Represents the percentage of requests over the last 10 seconds that resulted -// in each type of status code response. For more information, see Status Code -// Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/StatusCodes -type StatusCodes struct { - _ struct{} `type:"structure"` - - // The percentage of requests over the last 10 seconds that resulted in a 2xx - // (200, 201, etc.) status code. - Status2xx *int64 `type:"integer"` - - // The percentage of requests over the last 10 seconds that resulted in a 3xx - // (300, 301, etc.) status code. - Status3xx *int64 `type:"integer"` - - // The percentage of requests over the last 10 seconds that resulted in a 4xx - // (400, 401, etc.) status code. - Status4xx *int64 `type:"integer"` - - // The percentage of requests over the last 10 seconds that resulted in a 5xx - // (500, 501, etc.) status code. - Status5xx *int64 `type:"integer"` -} - -// String returns the string representation -func (s StatusCodes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StatusCodes) GoString() string { - return s.String() -} - -// SetStatus2xx sets the Status2xx field's value. -func (s *StatusCodes) SetStatus2xx(v int64) *StatusCodes { - s.Status2xx = &v - return s -} - -// SetStatus3xx sets the Status3xx field's value. -func (s *StatusCodes) SetStatus3xx(v int64) *StatusCodes { - s.Status3xx = &v - return s -} - -// SetStatus4xx sets the Status4xx field's value. -func (s *StatusCodes) SetStatus4xx(v int64) *StatusCodes { - s.Status4xx = &v - return s -} - -// SetStatus5xx sets the Status5xx field's value. -func (s *StatusCodes) SetStatus5xx(v int64) *StatusCodes { - s.Status5xx = &v - return s -} - -// Swaps the CNAMEs of two environments. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEsMessage -type SwapEnvironmentCNAMEsInput struct { - _ struct{} `type:"structure"` - - // The ID of the destination environment. - // - // Condition: You must specify at least the DestinationEnvironmentID or the - // DestinationEnvironmentName. You may also specify both. You must specify the - // SourceEnvironmentId with the DestinationEnvironmentId. - DestinationEnvironmentId *string `type:"string"` - - // The name of the destination environment. - // - // Condition: You must specify at least the DestinationEnvironmentID or the - // DestinationEnvironmentName. You may also specify both. You must specify the - // SourceEnvironmentName with the DestinationEnvironmentName. - DestinationEnvironmentName *string `min:"4" type:"string"` - - // The ID of the source environment. - // - // Condition: You must specify at least the SourceEnvironmentID or the SourceEnvironmentName. - // You may also specify both. If you specify the SourceEnvironmentId, you must - // specify the DestinationEnvironmentId. - SourceEnvironmentId *string `type:"string"` - - // The name of the source environment. - // - // Condition: You must specify at least the SourceEnvironmentID or the SourceEnvironmentName. - // You may also specify both. If you specify the SourceEnvironmentName, you - // must specify the DestinationEnvironmentName. - SourceEnvironmentName *string `min:"4" type:"string"` -} - -// String returns the string representation -func (s SwapEnvironmentCNAMEsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SwapEnvironmentCNAMEsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SwapEnvironmentCNAMEsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SwapEnvironmentCNAMEsInput"} - if s.DestinationEnvironmentName != nil && len(*s.DestinationEnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("DestinationEnvironmentName", 4)) - } - if s.SourceEnvironmentName != nil && len(*s.SourceEnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("SourceEnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationEnvironmentId sets the DestinationEnvironmentId field's value. -func (s *SwapEnvironmentCNAMEsInput) SetDestinationEnvironmentId(v string) *SwapEnvironmentCNAMEsInput { - s.DestinationEnvironmentId = &v - return s -} - -// SetDestinationEnvironmentName sets the DestinationEnvironmentName field's value. -func (s *SwapEnvironmentCNAMEsInput) SetDestinationEnvironmentName(v string) *SwapEnvironmentCNAMEsInput { - s.DestinationEnvironmentName = &v - return s -} - -// SetSourceEnvironmentId sets the SourceEnvironmentId field's value. -func (s *SwapEnvironmentCNAMEsInput) SetSourceEnvironmentId(v string) *SwapEnvironmentCNAMEsInput { - s.SourceEnvironmentId = &v - return s -} - -// SetSourceEnvironmentName sets the SourceEnvironmentName field's value. -func (s *SwapEnvironmentCNAMEsInput) SetSourceEnvironmentName(v string) *SwapEnvironmentCNAMEsInput { - s.SourceEnvironmentName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEsOutput -type SwapEnvironmentCNAMEsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SwapEnvironmentCNAMEsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SwapEnvironmentCNAMEsOutput) GoString() string { - return s.String() -} - -// CPU utilization and load average metrics for an Amazon EC2 instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SystemStatus -type SystemStatus struct { - _ struct{} `type:"structure"` - - // CPU utilization metrics for the instance. - CPUUtilization *CPUUtilization `type:"structure"` - - // Load average in the last 1-minute, 5-minute, and 15-minute periods. For more - // information, see Operating System Metrics (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os). - LoadAverage []*float64 `type:"list"` -} - -// String returns the string representation -func (s SystemStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SystemStatus) GoString() string { - return s.String() -} - -// SetCPUUtilization sets the CPUUtilization field's value. -func (s *SystemStatus) SetCPUUtilization(v *CPUUtilization) *SystemStatus { - s.CPUUtilization = v - return s -} - -// SetLoadAverage sets the LoadAverage field's value. -func (s *SystemStatus) SetLoadAverage(v []*float64) *SystemStatus { - s.LoadAverage = v - return s -} - -// Describes a tag applied to a resource in an environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag. - Key *string `min:"1" type:"string"` - - // The value of the tag. - Value *string `min:"1" 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 && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 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 -} - -// Request to terminate an environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/TerminateEnvironmentMessage -type TerminateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // The ID of the environment to terminate. - // - // Condition: You must specify either this or an EnvironmentName, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentId *string `type:"string"` - - // The name of the environment to terminate. - // - // Condition: You must specify either this or an EnvironmentId, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentName *string `min:"4" type:"string"` - - // Terminates the target environment even if another environment in the same - // group is dependent on it. - ForceTerminate *bool `type:"boolean"` - - // Indicates whether the associated AWS resources should shut down when the - // environment is terminated: - // - // * true: The specified environment as well as the associated AWS resources, - // such as Auto Scaling group and LoadBalancer, are terminated. - // - // * false: AWS Elastic Beanstalk resource management is removed from the - // environment, but the AWS resources continue to operate. - // - // For more information, see the AWS Elastic Beanstalk User Guide. (http://docs.aws.amazon.com/elasticbeanstalk/latest/ug/) - // - // Default: true - // - // Valid Values: true | false - TerminateResources *bool `type:"boolean"` -} - -// String returns the string representation -func (s TerminateEnvironmentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TerminateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TerminateEnvironmentInput"} - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *TerminateEnvironmentInput) SetEnvironmentId(v string) *TerminateEnvironmentInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *TerminateEnvironmentInput) SetEnvironmentName(v string) *TerminateEnvironmentInput { - s.EnvironmentName = &v - return s -} - -// SetForceTerminate sets the ForceTerminate field's value. -func (s *TerminateEnvironmentInput) SetForceTerminate(v bool) *TerminateEnvironmentInput { - s.ForceTerminate = &v - return s -} - -// SetTerminateResources sets the TerminateResources field's value. -func (s *TerminateEnvironmentInput) SetTerminateResources(v bool) *TerminateEnvironmentInput { - s.TerminateResources = &v - return s -} - -// Describes a trigger. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/Trigger -type Trigger struct { - _ struct{} `type:"structure"` - - // The name of the trigger. - Name *string `type:"string"` -} - -// String returns the string representation -func (s Trigger) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Trigger) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Trigger) SetName(v string) *Trigger { - s.Name = &v - return s -} - -// Request to update an application. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationMessage -type UpdateApplicationInput struct { - _ struct{} `type:"structure"` - - // The name of the application to update. If no such application is found, UpdateApplication - // returns an InvalidParameterValue error. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // A new description for the application. - // - // Default: If not specified, AWS Elastic Beanstalk does not update the description. - Description *string `type:"string"` -} - -// String returns the string representation -func (s UpdateApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *UpdateApplicationInput) SetApplicationName(v string) *UpdateApplicationInput { - s.ApplicationName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateApplicationInput) SetDescription(v string) *UpdateApplicationInput { - s.Description = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationResourceLifecycleMessage -type UpdateApplicationResourceLifecycleInput struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // The lifecycle configuration. - // - // ResourceLifecycleConfig is a required field - ResourceLifecycleConfig *ApplicationResourceLifecycleConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateApplicationResourceLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateApplicationResourceLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApplicationResourceLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationResourceLifecycleInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.ResourceLifecycleConfig == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceLifecycleConfig")) - } - if s.ResourceLifecycleConfig != nil { - if err := s.ResourceLifecycleConfig.Validate(); err != nil { - invalidParams.AddNested("ResourceLifecycleConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *UpdateApplicationResourceLifecycleInput) SetApplicationName(v string) *UpdateApplicationResourceLifecycleInput { - s.ApplicationName = &v - return s -} - -// SetResourceLifecycleConfig sets the ResourceLifecycleConfig field's value. -func (s *UpdateApplicationResourceLifecycleInput) SetResourceLifecycleConfig(v *ApplicationResourceLifecycleConfig) *UpdateApplicationResourceLifecycleInput { - s.ResourceLifecycleConfig = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ApplicationResourceLifecycleDescriptionMessage -type UpdateApplicationResourceLifecycleOutput struct { - _ struct{} `type:"structure"` - - // The name of the application. - ApplicationName *string `min:"1" type:"string"` - - // The lifecycle configuration. - ResourceLifecycleConfig *ApplicationResourceLifecycleConfig `type:"structure"` -} - -// String returns the string representation -func (s UpdateApplicationResourceLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateApplicationResourceLifecycleOutput) GoString() string { - return s.String() -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *UpdateApplicationResourceLifecycleOutput) SetApplicationName(v string) *UpdateApplicationResourceLifecycleOutput { - s.ApplicationName = &v - return s -} - -// SetResourceLifecycleConfig sets the ResourceLifecycleConfig field's value. -func (s *UpdateApplicationResourceLifecycleOutput) SetResourceLifecycleConfig(v *ApplicationResourceLifecycleConfig) *UpdateApplicationResourceLifecycleOutput { - s.ResourceLifecycleConfig = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateApplicationVersionMessage -type UpdateApplicationVersionInput struct { - _ struct{} `type:"structure"` - - // The name of the application associated with this version. - // - // If no application is found with this name, UpdateApplication returns an InvalidParameterValue - // error. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // A new description for this version. - Description *string `type:"string"` - - // The name of the version to update. - // - // If no application version is found with this label, UpdateApplication returns - // an InvalidParameterValue error. - // - // VersionLabel is a required field - VersionLabel *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateApplicationVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateApplicationVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApplicationVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationVersionInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.VersionLabel == nil { - invalidParams.Add(request.NewErrParamRequired("VersionLabel")) - } - if s.VersionLabel != nil && len(*s.VersionLabel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionLabel", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *UpdateApplicationVersionInput) SetApplicationName(v string) *UpdateApplicationVersionInput { - s.ApplicationName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateApplicationVersionInput) SetDescription(v string) *UpdateApplicationVersionInput { - s.Description = &v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *UpdateApplicationVersionInput) SetVersionLabel(v string) *UpdateApplicationVersionInput { - s.VersionLabel = &v - return s -} - -// The result message containing the options for the specified solution stack. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateConfigurationTemplateMessage -type UpdateConfigurationTemplateInput struct { - _ struct{} `type:"structure"` - - // The name of the application associated with the configuration template to - // update. - // - // If no application is found with this name, UpdateConfigurationTemplate returns - // an InvalidParameterValue error. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // A new description for the configuration. - Description *string `type:"string"` - - // A list of configuration option settings to update with the new specified - // option value. - OptionSettings []*ConfigurationOptionSetting `type:"list"` - - // A list of configuration options to remove from the configuration set. - // - // Constraint: You can remove only UserDefined configuration options. - OptionsToRemove []*OptionSpecification `type:"list"` - - // The name of the configuration template to update. - // - // If no configuration template is found with this name, UpdateConfigurationTemplate - // returns an InvalidParameterValue error. - // - // TemplateName is a required field - TemplateName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateConfigurationTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateConfigurationTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateConfigurationTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateConfigurationTemplateInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.TemplateName == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateName")) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - if s.OptionSettings != nil { - for i, v := range s.OptionSettings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionSettings", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OptionsToRemove != nil { - for i, v := range s.OptionsToRemove { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionsToRemove", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *UpdateConfigurationTemplateInput) SetApplicationName(v string) *UpdateConfigurationTemplateInput { - s.ApplicationName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateConfigurationTemplateInput) SetDescription(v string) *UpdateConfigurationTemplateInput { - s.Description = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *UpdateConfigurationTemplateInput) SetOptionSettings(v []*ConfigurationOptionSetting) *UpdateConfigurationTemplateInput { - s.OptionSettings = v - return s -} - -// SetOptionsToRemove sets the OptionsToRemove field's value. -func (s *UpdateConfigurationTemplateInput) SetOptionsToRemove(v []*OptionSpecification) *UpdateConfigurationTemplateInput { - s.OptionsToRemove = v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *UpdateConfigurationTemplateInput) SetTemplateName(v string) *UpdateConfigurationTemplateInput { - s.TemplateName = &v - return s -} - -// Request to update an environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/UpdateEnvironmentMessage -type UpdateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // The name of the application with which the environment is associated. - ApplicationName *string `min:"1" type:"string"` - - // If this parameter is specified, AWS Elastic Beanstalk updates the description - // of this environment. - Description *string `type:"string"` - - // The ID of the environment to update. - // - // If no environment with this ID exists, AWS Elastic Beanstalk returns an InvalidParameterValue - // error. - // - // Condition: You must specify either this or an EnvironmentName, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentId *string `type:"string"` - - // The name of the environment to update. If no environment with this name exists, - // AWS Elastic Beanstalk returns an InvalidParameterValue error. - // - // Condition: You must specify either this or an EnvironmentId, or both. If - // you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter - // error. - EnvironmentName *string `min:"4" type:"string"` - - // The name of the group to which the target environment belongs. Specify a - // group name only if the environment's name is specified in an environment - // manifest and not with the environment name or environment ID parameters. - // See Environment Manifest (env.yaml) (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html) - // for details. - GroupName *string `min:"1" type:"string"` - - // If specified, AWS Elastic Beanstalk updates the configuration set associated - // with the running environment and sets the specified configuration options - // to the requested value. - OptionSettings []*ConfigurationOptionSetting `type:"list"` - - // A list of custom user-defined configuration options to remove from the configuration - // set for this environment. - OptionsToRemove []*OptionSpecification `type:"list"` - - // The ARN of the platform, if used. - PlatformArn *string `type:"string"` - - // This specifies the platform version that the environment will run after the - // environment is updated. - SolutionStackName *string `type:"string"` - - // If this parameter is specified, AWS Elastic Beanstalk deploys this configuration - // template to the environment. If no such configuration template is found, - // AWS Elastic Beanstalk returns an InvalidParameterValue error. - TemplateName *string `min:"1" type:"string"` - - // This specifies the tier to use to update the environment. - // - // Condition: At this time, if you change the tier version, name, or type, AWS - // Elastic Beanstalk returns InvalidParameterValue error. - Tier *EnvironmentTier `type:"structure"` - - // If this parameter is specified, AWS Elastic Beanstalk deploys the named application - // version to the environment. If no such application version is found, returns - // an InvalidParameterValue error. - VersionLabel *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateEnvironmentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEnvironmentInput"} - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - if s.VersionLabel != nil && len(*s.VersionLabel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionLabel", 1)) - } - if s.OptionSettings != nil { - for i, v := range s.OptionSettings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionSettings", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OptionsToRemove != nil { - for i, v := range s.OptionsToRemove { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionsToRemove", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *UpdateEnvironmentInput) SetApplicationName(v string) *UpdateEnvironmentInput { - s.ApplicationName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateEnvironmentInput) SetDescription(v string) *UpdateEnvironmentInput { - s.Description = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *UpdateEnvironmentInput) SetEnvironmentId(v string) *UpdateEnvironmentInput { - s.EnvironmentId = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *UpdateEnvironmentInput) SetEnvironmentName(v string) *UpdateEnvironmentInput { - s.EnvironmentName = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *UpdateEnvironmentInput) SetGroupName(v string) *UpdateEnvironmentInput { - s.GroupName = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *UpdateEnvironmentInput) SetOptionSettings(v []*ConfigurationOptionSetting) *UpdateEnvironmentInput { - s.OptionSettings = v - return s -} - -// SetOptionsToRemove sets the OptionsToRemove field's value. -func (s *UpdateEnvironmentInput) SetOptionsToRemove(v []*OptionSpecification) *UpdateEnvironmentInput { - s.OptionsToRemove = v - return s -} - -// SetPlatformArn sets the PlatformArn field's value. -func (s *UpdateEnvironmentInput) SetPlatformArn(v string) *UpdateEnvironmentInput { - s.PlatformArn = &v - return s -} - -// SetSolutionStackName sets the SolutionStackName field's value. -func (s *UpdateEnvironmentInput) SetSolutionStackName(v string) *UpdateEnvironmentInput { - s.SolutionStackName = &v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *UpdateEnvironmentInput) SetTemplateName(v string) *UpdateEnvironmentInput { - s.TemplateName = &v - return s -} - -// SetTier sets the Tier field's value. -func (s *UpdateEnvironmentInput) SetTier(v *EnvironmentTier) *UpdateEnvironmentInput { - s.Tier = v - return s -} - -// SetVersionLabel sets the VersionLabel field's value. -func (s *UpdateEnvironmentInput) SetVersionLabel(v string) *UpdateEnvironmentInput { - s.VersionLabel = &v - return s -} - -// A list of validation messages for a specified configuration template. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ValidateConfigurationSettingsMessage -type ValidateConfigurationSettingsInput struct { - _ struct{} `type:"structure"` - - // The name of the application that the configuration template or environment - // belongs to. - // - // ApplicationName is a required field - ApplicationName *string `min:"1" type:"string" required:"true"` - - // The name of the environment to validate the settings against. - // - // Condition: You cannot specify both this and a configuration template name. - EnvironmentName *string `min:"4" type:"string"` - - // A list of the options and desired values to evaluate. - // - // OptionSettings is a required field - OptionSettings []*ConfigurationOptionSetting `type:"list" required:"true"` - - // The name of the configuration template to validate the settings against. - // - // Condition: You cannot specify both this and an environment name. - TemplateName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ValidateConfigurationSettingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ValidateConfigurationSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidateConfigurationSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidateConfigurationSettingsInput"} - if s.ApplicationName == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationName")) - } - if s.ApplicationName != nil && len(*s.ApplicationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1)) - } - if s.EnvironmentName != nil && len(*s.EnvironmentName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 4)) - } - if s.OptionSettings == nil { - invalidParams.Add(request.NewErrParamRequired("OptionSettings")) - } - if s.TemplateName != nil && len(*s.TemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) - } - if s.OptionSettings != nil { - for i, v := range s.OptionSettings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionSettings", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationName sets the ApplicationName field's value. -func (s *ValidateConfigurationSettingsInput) SetApplicationName(v string) *ValidateConfigurationSettingsInput { - s.ApplicationName = &v - return s -} - -// SetEnvironmentName sets the EnvironmentName field's value. -func (s *ValidateConfigurationSettingsInput) SetEnvironmentName(v string) *ValidateConfigurationSettingsInput { - s.EnvironmentName = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *ValidateConfigurationSettingsInput) SetOptionSettings(v []*ConfigurationOptionSetting) *ValidateConfigurationSettingsInput { - s.OptionSettings = v - return s -} - -// SetTemplateName sets the TemplateName field's value. -func (s *ValidateConfigurationSettingsInput) SetTemplateName(v string) *ValidateConfigurationSettingsInput { - s.TemplateName = &v - return s -} - -// Provides a list of validation messages. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ConfigurationSettingsValidationMessages -type ValidateConfigurationSettingsOutput struct { - _ struct{} `type:"structure"` - - // A list of ValidationMessage. - Messages []*ValidationMessage `type:"list"` -} - -// String returns the string representation -func (s ValidateConfigurationSettingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ValidateConfigurationSettingsOutput) GoString() string { - return s.String() -} - -// SetMessages sets the Messages field's value. -func (s *ValidateConfigurationSettingsOutput) SetMessages(v []*ValidationMessage) *ValidateConfigurationSettingsOutput { - s.Messages = v - return s -} - -// An error or warning for a desired configuration option value. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/ValidationMessage -type ValidationMessage struct { - _ struct{} `type:"structure"` - - // A message describing the error or warning. - Message *string `type:"string"` - - // The namespace to which the option belongs. - Namespace *string `type:"string"` - - // The name of the option. - OptionName *string `type:"string"` - - // An indication of the severity of this message: - // - // * error: This message indicates that this is not a valid setting for an - // option. - // - // * warning: This message is providing information you should take into - // account. - Severity *string `type:"string" enum:"ValidationSeverity"` -} - -// String returns the string representation -func (s ValidationMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ValidationMessage) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationMessage) SetMessage(v string) *ValidationMessage { - s.Message = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *ValidationMessage) SetNamespace(v string) *ValidationMessage { - s.Namespace = &v - return s -} - -// SetOptionName sets the OptionName field's value. -func (s *ValidationMessage) SetOptionName(v string) *ValidationMessage { - s.OptionName = &v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *ValidationMessage) SetSeverity(v string) *ValidationMessage { - s.Severity = &v - return s -} - -const ( - // ActionHistoryStatusCompleted is a ActionHistoryStatus enum value - ActionHistoryStatusCompleted = "Completed" - - // ActionHistoryStatusFailed is a ActionHistoryStatus enum value - ActionHistoryStatusFailed = "Failed" - - // ActionHistoryStatusUnknown is a ActionHistoryStatus enum value - ActionHistoryStatusUnknown = "Unknown" -) - -const ( - // ActionStatusScheduled is a ActionStatus enum value - ActionStatusScheduled = "Scheduled" - - // ActionStatusPending is a ActionStatus enum value - ActionStatusPending = "Pending" - - // ActionStatusRunning is a ActionStatus enum value - ActionStatusRunning = "Running" - - // ActionStatusUnknown is a ActionStatus enum value - ActionStatusUnknown = "Unknown" -) - -const ( - // ActionTypeInstanceRefresh is a ActionType enum value - ActionTypeInstanceRefresh = "InstanceRefresh" - - // ActionTypePlatformUpdate is a ActionType enum value - ActionTypePlatformUpdate = "PlatformUpdate" - - // ActionTypeUnknown is a ActionType enum value - ActionTypeUnknown = "Unknown" -) - -const ( - // ApplicationVersionStatusProcessed is a ApplicationVersionStatus enum value - ApplicationVersionStatusProcessed = "Processed" - - // ApplicationVersionStatusUnprocessed is a ApplicationVersionStatus enum value - ApplicationVersionStatusUnprocessed = "Unprocessed" - - // ApplicationVersionStatusFailed is a ApplicationVersionStatus enum value - ApplicationVersionStatusFailed = "Failed" - - // ApplicationVersionStatusProcessing is a ApplicationVersionStatus enum value - ApplicationVersionStatusProcessing = "Processing" - - // ApplicationVersionStatusBuilding is a ApplicationVersionStatus enum value - ApplicationVersionStatusBuilding = "Building" -) - -const ( - // ComputeTypeBuildGeneral1Small is a ComputeType enum value - ComputeTypeBuildGeneral1Small = "BUILD_GENERAL1_SMALL" - - // ComputeTypeBuildGeneral1Medium is a ComputeType enum value - ComputeTypeBuildGeneral1Medium = "BUILD_GENERAL1_MEDIUM" - - // ComputeTypeBuildGeneral1Large is a ComputeType enum value - ComputeTypeBuildGeneral1Large = "BUILD_GENERAL1_LARGE" -) - -const ( - // ConfigurationDeploymentStatusDeployed is a ConfigurationDeploymentStatus enum value - ConfigurationDeploymentStatusDeployed = "deployed" - - // ConfigurationDeploymentStatusPending is a ConfigurationDeploymentStatus enum value - ConfigurationDeploymentStatusPending = "pending" - - // ConfigurationDeploymentStatusFailed is a ConfigurationDeploymentStatus enum value - ConfigurationDeploymentStatusFailed = "failed" -) - -const ( - // ConfigurationOptionValueTypeScalar is a ConfigurationOptionValueType enum value - ConfigurationOptionValueTypeScalar = "Scalar" - - // ConfigurationOptionValueTypeList is a ConfigurationOptionValueType enum value - ConfigurationOptionValueTypeList = "List" -) - -const ( - // EnvironmentHealthGreen is a EnvironmentHealth enum value - EnvironmentHealthGreen = "Green" - - // EnvironmentHealthYellow is a EnvironmentHealth enum value - EnvironmentHealthYellow = "Yellow" - - // EnvironmentHealthRed is a EnvironmentHealth enum value - EnvironmentHealthRed = "Red" - - // EnvironmentHealthGrey is a EnvironmentHealth enum value - EnvironmentHealthGrey = "Grey" -) - -const ( - // EnvironmentHealthAttributeStatus is a EnvironmentHealthAttribute enum value - EnvironmentHealthAttributeStatus = "Status" - - // EnvironmentHealthAttributeColor is a EnvironmentHealthAttribute enum value - EnvironmentHealthAttributeColor = "Color" - - // EnvironmentHealthAttributeCauses is a EnvironmentHealthAttribute enum value - EnvironmentHealthAttributeCauses = "Causes" - - // EnvironmentHealthAttributeApplicationMetrics is a EnvironmentHealthAttribute enum value - EnvironmentHealthAttributeApplicationMetrics = "ApplicationMetrics" - - // EnvironmentHealthAttributeInstancesHealth is a EnvironmentHealthAttribute enum value - EnvironmentHealthAttributeInstancesHealth = "InstancesHealth" - - // EnvironmentHealthAttributeAll is a EnvironmentHealthAttribute enum value - EnvironmentHealthAttributeAll = "All" - - // EnvironmentHealthAttributeHealthStatus is a EnvironmentHealthAttribute enum value - EnvironmentHealthAttributeHealthStatus = "HealthStatus" - - // EnvironmentHealthAttributeRefreshedAt is a EnvironmentHealthAttribute enum value - EnvironmentHealthAttributeRefreshedAt = "RefreshedAt" -) - -const ( - // EnvironmentHealthStatusNoData is a EnvironmentHealthStatus enum value - EnvironmentHealthStatusNoData = "NoData" - - // EnvironmentHealthStatusUnknown is a EnvironmentHealthStatus enum value - EnvironmentHealthStatusUnknown = "Unknown" - - // EnvironmentHealthStatusPending is a EnvironmentHealthStatus enum value - EnvironmentHealthStatusPending = "Pending" - - // EnvironmentHealthStatusOk is a EnvironmentHealthStatus enum value - EnvironmentHealthStatusOk = "Ok" - - // EnvironmentHealthStatusInfo is a EnvironmentHealthStatus enum value - EnvironmentHealthStatusInfo = "Info" - - // EnvironmentHealthStatusWarning is a EnvironmentHealthStatus enum value - EnvironmentHealthStatusWarning = "Warning" - - // EnvironmentHealthStatusDegraded is a EnvironmentHealthStatus enum value - EnvironmentHealthStatusDegraded = "Degraded" - - // EnvironmentHealthStatusSevere is a EnvironmentHealthStatus enum value - EnvironmentHealthStatusSevere = "Severe" -) - -const ( - // EnvironmentInfoTypeTail is a EnvironmentInfoType enum value - EnvironmentInfoTypeTail = "tail" - - // EnvironmentInfoTypeBundle is a EnvironmentInfoType enum value - EnvironmentInfoTypeBundle = "bundle" -) - -const ( - // EnvironmentStatusLaunching is a EnvironmentStatus enum value - EnvironmentStatusLaunching = "Launching" - - // EnvironmentStatusUpdating is a EnvironmentStatus enum value - EnvironmentStatusUpdating = "Updating" - - // EnvironmentStatusReady is a EnvironmentStatus enum value - EnvironmentStatusReady = "Ready" - - // EnvironmentStatusTerminating is a EnvironmentStatus enum value - EnvironmentStatusTerminating = "Terminating" - - // EnvironmentStatusTerminated is a EnvironmentStatus enum value - EnvironmentStatusTerminated = "Terminated" -) - -const ( - // EventSeverityTrace is a EventSeverity enum value - EventSeverityTrace = "TRACE" - - // EventSeverityDebug is a EventSeverity enum value - EventSeverityDebug = "DEBUG" - - // EventSeverityInfo is a EventSeverity enum value - EventSeverityInfo = "INFO" - - // EventSeverityWarn is a EventSeverity enum value - EventSeverityWarn = "WARN" - - // EventSeverityError is a EventSeverity enum value - EventSeverityError = "ERROR" - - // EventSeverityFatal is a EventSeverity enum value - EventSeverityFatal = "FATAL" -) - -const ( - // FailureTypeUpdateCancelled is a FailureType enum value - FailureTypeUpdateCancelled = "UpdateCancelled" - - // FailureTypeCancellationFailed is a FailureType enum value - FailureTypeCancellationFailed = "CancellationFailed" - - // FailureTypeRollbackFailed is a FailureType enum value - FailureTypeRollbackFailed = "RollbackFailed" - - // FailureTypeRollbackSuccessful is a FailureType enum value - FailureTypeRollbackSuccessful = "RollbackSuccessful" - - // FailureTypeInternalFailure is a FailureType enum value - FailureTypeInternalFailure = "InternalFailure" - - // FailureTypeInvalidEnvironmentState is a FailureType enum value - FailureTypeInvalidEnvironmentState = "InvalidEnvironmentState" - - // FailureTypePermissionsError is a FailureType enum value - FailureTypePermissionsError = "PermissionsError" -) - -const ( - // InstancesHealthAttributeHealthStatus is a InstancesHealthAttribute enum value - InstancesHealthAttributeHealthStatus = "HealthStatus" - - // InstancesHealthAttributeColor is a InstancesHealthAttribute enum value - InstancesHealthAttributeColor = "Color" - - // InstancesHealthAttributeCauses is a InstancesHealthAttribute enum value - InstancesHealthAttributeCauses = "Causes" - - // InstancesHealthAttributeApplicationMetrics is a InstancesHealthAttribute enum value - InstancesHealthAttributeApplicationMetrics = "ApplicationMetrics" - - // InstancesHealthAttributeRefreshedAt is a InstancesHealthAttribute enum value - InstancesHealthAttributeRefreshedAt = "RefreshedAt" - - // InstancesHealthAttributeLaunchedAt is a InstancesHealthAttribute enum value - InstancesHealthAttributeLaunchedAt = "LaunchedAt" - - // InstancesHealthAttributeSystem is a InstancesHealthAttribute enum value - InstancesHealthAttributeSystem = "System" - - // InstancesHealthAttributeDeployment is a InstancesHealthAttribute enum value - InstancesHealthAttributeDeployment = "Deployment" - - // InstancesHealthAttributeAvailabilityZone is a InstancesHealthAttribute enum value - InstancesHealthAttributeAvailabilityZone = "AvailabilityZone" - - // InstancesHealthAttributeInstanceType is a InstancesHealthAttribute enum value - InstancesHealthAttributeInstanceType = "InstanceType" - - // InstancesHealthAttributeAll is a InstancesHealthAttribute enum value - InstancesHealthAttributeAll = "All" -) - -const ( - // PlatformStatusCreating is a PlatformStatus enum value - PlatformStatusCreating = "Creating" - - // PlatformStatusFailed is a PlatformStatus enum value - PlatformStatusFailed = "Failed" - - // PlatformStatusReady is a PlatformStatus enum value - PlatformStatusReady = "Ready" - - // PlatformStatusDeleting is a PlatformStatus enum value - PlatformStatusDeleting = "Deleting" - - // PlatformStatusDeleted is a PlatformStatus enum value - PlatformStatusDeleted = "Deleted" -) - -const ( - // SourceRepositoryCodeCommit is a SourceRepository enum value - SourceRepositoryCodeCommit = "CodeCommit" - - // SourceRepositoryS3 is a SourceRepository enum value - SourceRepositoryS3 = "S3" -) - -const ( - // SourceTypeGit is a SourceType enum value - SourceTypeGit = "Git" - - // SourceTypeZip is a SourceType enum value - SourceTypeZip = "Zip" -) - -const ( - // ValidationSeverityError is a ValidationSeverity enum value - ValidationSeverityError = "error" - - // ValidationSeverityWarning is a ValidationSeverity enum value - ValidationSeverityWarning = "warning" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/errors.go deleted file mode 100644 index f185a05..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/errors.go +++ /dev/null @@ -1,115 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elasticbeanstalk - -const ( - - // ErrCodeCodeBuildNotInServiceRegionException for service response error code - // "CodeBuildNotInServiceRegionException". - // - // AWS CodeBuild is not available in the specified region. - ErrCodeCodeBuildNotInServiceRegionException = "CodeBuildNotInServiceRegionException" - - // ErrCodeInsufficientPrivilegesException for service response error code - // "InsufficientPrivilegesException". - // - // The specified account does not have sufficient privileges for one of more - // AWS services. - ErrCodeInsufficientPrivilegesException = "InsufficientPrivilegesException" - - // ErrCodeInvalidRequestException for service response error code - // "InvalidRequestException". - // - // One or more input parameters is not valid. Please correct the input parameters - // and try the operation again. - ErrCodeInvalidRequestException = "InvalidRequestException" - - // ErrCodeManagedActionInvalidStateException for service response error code - // "ManagedActionInvalidStateException". - // - // Cannot modify the managed action in its current state. - ErrCodeManagedActionInvalidStateException = "ManagedActionInvalidStateException" - - // ErrCodeOperationInProgressException for service response error code - // "OperationInProgressFailure". - // - // Unable to perform the specified operation because another operation that - // effects an element in this activity is already in progress. - ErrCodeOperationInProgressException = "OperationInProgressFailure" - - // ErrCodePlatformVersionStillReferencedException for service response error code - // "PlatformVersionStillReferencedException". - // - // You cannot delete the platform version because there are still environments - // running on it. - ErrCodePlatformVersionStillReferencedException = "PlatformVersionStillReferencedException" - - // ErrCodeS3LocationNotInServiceRegionException for service response error code - // "S3LocationNotInServiceRegionException". - // - // The specified S3 bucket does not belong to the S3 region in which the service - // is running. The following regions are supported: - // - // * IAD/us-east-1 - // - // * PDX/us-west-2 - // - // * DUB/eu-west-1 - ErrCodeS3LocationNotInServiceRegionException = "S3LocationNotInServiceRegionException" - - // ErrCodeS3SubscriptionRequiredException for service response error code - // "S3SubscriptionRequiredException". - // - // The specified account does not have a subscription to Amazon S3. - ErrCodeS3SubscriptionRequiredException = "S3SubscriptionRequiredException" - - // ErrCodeServiceException for service response error code - // "ServiceException". - // - // A generic service exception has occurred. - ErrCodeServiceException = "ServiceException" - - // ErrCodeSourceBundleDeletionException for service response error code - // "SourceBundleDeletionFailure". - // - // Unable to delete the Amazon S3 source bundle associated with the application - // version. The application version was deleted successfully. - ErrCodeSourceBundleDeletionException = "SourceBundleDeletionFailure" - - // ErrCodeTooManyApplicationVersionsException for service response error code - // "TooManyApplicationVersionsException". - // - // The specified account has reached its limit of application versions. - ErrCodeTooManyApplicationVersionsException = "TooManyApplicationVersionsException" - - // ErrCodeTooManyApplicationsException for service response error code - // "TooManyApplicationsException". - // - // The specified account has reached its limit of applications. - ErrCodeTooManyApplicationsException = "TooManyApplicationsException" - - // ErrCodeTooManyBucketsException for service response error code - // "TooManyBucketsException". - // - // The specified account has reached its limit of Amazon S3 buckets. - ErrCodeTooManyBucketsException = "TooManyBucketsException" - - // ErrCodeTooManyConfigurationTemplatesException for service response error code - // "TooManyConfigurationTemplatesException". - // - // The specified account has reached its limit of configuration templates. - ErrCodeTooManyConfigurationTemplatesException = "TooManyConfigurationTemplatesException" - - // ErrCodeTooManyEnvironmentsException for service response error code - // "TooManyEnvironmentsException". - // - // The specified account has reached its limit of environments. - ErrCodeTooManyEnvironmentsException = "TooManyEnvironmentsException" - - // ErrCodeTooManyPlatformsException for service response error code - // "TooManyPlatformsException". - // - // You have exceeded the maximum number of allowed platforms associated with - // the account. - ErrCodeTooManyPlatformsException = "TooManyPlatformsException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go deleted file mode 100644 index 2134341..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go +++ /dev/null @@ -1,107 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elasticbeanstalk - -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" -) - -// AWS Elastic Beanstalk makes it easy for you to create, deploy, and manage -// scalable, fault-tolerant applications running on the Amazon Web Services -// cloud. -// -// For more information about this product, go to the AWS Elastic Beanstalk -// (http://aws.amazon.com/elasticbeanstalk/) details page. The location of the -// latest AWS Elastic Beanstalk WSDL is http://elasticbeanstalk.s3.amazonaws.com/doc/2010-12-01/AWSElasticBeanstalk.wsdl -// (http://elasticbeanstalk.s3.amazonaws.com/doc/2010-12-01/AWSElasticBeanstalk.wsdl). -// To install the Software Development Kits (SDKs), Integrated Development Environment -// (IDE) Toolkits, and command line tools that enable you to access the API, -// go to Tools for Amazon Web Services (http://aws.amazon.com/tools/). -// -// Endpoints -// -// For a list of region-specific endpoints that AWS Elastic Beanstalk supports, -// go to Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region) -// in the Amazon Web Services Glossary. -// 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/elasticbeanstalk-2010-12-01 -type ElasticBeanstalk 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 = "elasticbeanstalk" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ElasticBeanstalk 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 ElasticBeanstalk client from just a session. -// svc := elasticbeanstalk.New(mySession) -// -// // Create a ElasticBeanstalk client with additional configuration -// svc := elasticbeanstalk.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ElasticBeanstalk { - 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) *ElasticBeanstalk { - svc := &ElasticBeanstalk{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2010-12-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ElasticBeanstalk operation and runs any -// custom request initialization. -func (c *ElasticBeanstalk) 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/elasticsearchservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/api.go deleted file mode 100644 index 64f26f6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/api.go +++ /dev/null @@ -1,3364 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elasticsearchservice provides a client for Amazon Elasticsearch Service. -package elasticsearchservice - -import ( - "fmt" - "time" - - "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/restjson" -) - -const opAddTags = "AddTags" - -// AddTagsRequest generates a "aws/request.Request" representing the -// client's request for the AddTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsRequest method. -// req, resp := client.AddTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AddTags -func (c *ElasticsearchService) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { - op := &request.Operation{ - Name: opAddTags, - HTTPMethod: "POST", - HTTPPath: "/2015-01-01/tags", - } - - if input == nil { - input = &AddTagsInput{} - } - - output = &AddTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddTags API operation for Amazon Elasticsearch Service. -// -// Attaches tags to an existing Elasticsearch domain. Tags are a set of case-sensitive -// key value pairs. An Elasticsearch domain may have up to 10 tags. See Tagging -// Amazon Elasticsearch Service Domains for more information. (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-awsresorcetagging) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation AddTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// An exception for trying to create more than allowed resources or sub-resources. -// Gives http status code of 409. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AddTags -func (c *ElasticsearchService) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { - req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err -} - -const opCreateElasticsearchDomain = "CreateElasticsearchDomain" - -// CreateElasticsearchDomainRequest generates a "aws/request.Request" representing the -// client's request for the CreateElasticsearchDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateElasticsearchDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateElasticsearchDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateElasticsearchDomainRequest method. -// req, resp := client.CreateElasticsearchDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateElasticsearchDomain -func (c *ElasticsearchService) CreateElasticsearchDomainRequest(input *CreateElasticsearchDomainInput) (req *request.Request, output *CreateElasticsearchDomainOutput) { - op := &request.Operation{ - Name: opCreateElasticsearchDomain, - HTTPMethod: "POST", - HTTPPath: "/2015-01-01/es/domain", - } - - if input == nil { - input = &CreateElasticsearchDomainInput{} - } - - output = &CreateElasticsearchDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateElasticsearchDomain API operation for Amazon Elasticsearch Service. -// -// Creates a new Elasticsearch domain. For more information, see Creating Elasticsearch -// Domains (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains) -// in the Amazon Elasticsearch Service 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 Elasticsearch Service's -// API operation CreateElasticsearchDomain for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeDisabledOperationException "DisabledOperationException" -// An error occured because the client wanted to access a not supported operation. -// Gives http status code of 409. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeInvalidTypeException "InvalidTypeException" -// An exception for trying to create or access sub-resource that is either invalid -// or not supported. Gives http status code of 409. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// An exception for trying to create more than allowed resources or sub-resources. -// Gives http status code of 409. -// -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// An exception for creating a resource that already exists. Gives http status -// code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateElasticsearchDomain -func (c *ElasticsearchService) CreateElasticsearchDomain(input *CreateElasticsearchDomainInput) (*CreateElasticsearchDomainOutput, error) { - req, out := c.CreateElasticsearchDomainRequest(input) - err := req.Send() - return out, err -} - -const opDeleteElasticsearchDomain = "DeleteElasticsearchDomain" - -// DeleteElasticsearchDomainRequest generates a "aws/request.Request" representing the -// client's request for the DeleteElasticsearchDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteElasticsearchDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteElasticsearchDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteElasticsearchDomainRequest method. -// req, resp := client.DeleteElasticsearchDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchDomain -func (c *ElasticsearchService) DeleteElasticsearchDomainRequest(input *DeleteElasticsearchDomainInput) (req *request.Request, output *DeleteElasticsearchDomainOutput) { - op := &request.Operation{ - Name: opDeleteElasticsearchDomain, - HTTPMethod: "DELETE", - HTTPPath: "/2015-01-01/es/domain/{DomainName}", - } - - if input == nil { - input = &DeleteElasticsearchDomainInput{} - } - - output = &DeleteElasticsearchDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteElasticsearchDomain API operation for Amazon Elasticsearch Service. -// -// Permanently deletes the specified Elasticsearch domain and all of its data. -// Once a domain is deleted, it cannot be recovered. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation DeleteElasticsearchDomain for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An exception for accessing or deleting a resource that does not exist. Gives -// http status code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchDomain -func (c *ElasticsearchService) DeleteElasticsearchDomain(input *DeleteElasticsearchDomainInput) (*DeleteElasticsearchDomainOutput, error) { - req, out := c.DeleteElasticsearchDomainRequest(input) - err := req.Send() - return out, err -} - -const opDescribeElasticsearchDomain = "DescribeElasticsearchDomain" - -// DescribeElasticsearchDomainRequest generates a "aws/request.Request" representing the -// client's request for the DescribeElasticsearchDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeElasticsearchDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeElasticsearchDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeElasticsearchDomainRequest method. -// req, resp := client.DescribeElasticsearchDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomain -func (c *ElasticsearchService) DescribeElasticsearchDomainRequest(input *DescribeElasticsearchDomainInput) (req *request.Request, output *DescribeElasticsearchDomainOutput) { - op := &request.Operation{ - Name: opDescribeElasticsearchDomain, - HTTPMethod: "GET", - HTTPPath: "/2015-01-01/es/domain/{DomainName}", - } - - if input == nil { - input = &DescribeElasticsearchDomainInput{} - } - - output = &DescribeElasticsearchDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeElasticsearchDomain API operation for Amazon Elasticsearch Service. -// -// Returns domain configuration information about the specified Elasticsearch -// domain, including the domain ID, domain endpoint, and domain ARN. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation DescribeElasticsearchDomain for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An exception for accessing or deleting a resource that does not exist. Gives -// http status code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomain -func (c *ElasticsearchService) DescribeElasticsearchDomain(input *DescribeElasticsearchDomainInput) (*DescribeElasticsearchDomainOutput, error) { - req, out := c.DescribeElasticsearchDomainRequest(input) - err := req.Send() - return out, err -} - -const opDescribeElasticsearchDomainConfig = "DescribeElasticsearchDomainConfig" - -// DescribeElasticsearchDomainConfigRequest generates a "aws/request.Request" representing the -// client's request for the DescribeElasticsearchDomainConfig operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeElasticsearchDomainConfig for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeElasticsearchDomainConfig method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeElasticsearchDomainConfigRequest method. -// req, resp := client.DescribeElasticsearchDomainConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainConfig -func (c *ElasticsearchService) DescribeElasticsearchDomainConfigRequest(input *DescribeElasticsearchDomainConfigInput) (req *request.Request, output *DescribeElasticsearchDomainConfigOutput) { - op := &request.Operation{ - Name: opDescribeElasticsearchDomainConfig, - HTTPMethod: "GET", - HTTPPath: "/2015-01-01/es/domain/{DomainName}/config", - } - - if input == nil { - input = &DescribeElasticsearchDomainConfigInput{} - } - - output = &DescribeElasticsearchDomainConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeElasticsearchDomainConfig API operation for Amazon Elasticsearch Service. -// -// Provides cluster configuration information about the specified Elasticsearch -// domain, such as the state, creation date, update version, and update date -// for cluster options. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation DescribeElasticsearchDomainConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An exception for accessing or deleting a resource that does not exist. Gives -// http status code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainConfig -func (c *ElasticsearchService) DescribeElasticsearchDomainConfig(input *DescribeElasticsearchDomainConfigInput) (*DescribeElasticsearchDomainConfigOutput, error) { - req, out := c.DescribeElasticsearchDomainConfigRequest(input) - err := req.Send() - return out, err -} - -const opDescribeElasticsearchDomains = "DescribeElasticsearchDomains" - -// DescribeElasticsearchDomainsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeElasticsearchDomains operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeElasticsearchDomains for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeElasticsearchDomains method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeElasticsearchDomainsRequest method. -// req, resp := client.DescribeElasticsearchDomainsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomains -func (c *ElasticsearchService) DescribeElasticsearchDomainsRequest(input *DescribeElasticsearchDomainsInput) (req *request.Request, output *DescribeElasticsearchDomainsOutput) { - op := &request.Operation{ - Name: opDescribeElasticsearchDomains, - HTTPMethod: "POST", - HTTPPath: "/2015-01-01/es/domain-info", - } - - if input == nil { - input = &DescribeElasticsearchDomainsInput{} - } - - output = &DescribeElasticsearchDomainsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeElasticsearchDomains API operation for Amazon Elasticsearch Service. -// -// Returns domain configuration information about the specified Elasticsearch -// domains, including the domain ID, domain endpoint, and domain ARN. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation DescribeElasticsearchDomains for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomains -func (c *ElasticsearchService) DescribeElasticsearchDomains(input *DescribeElasticsearchDomainsInput) (*DescribeElasticsearchDomainsOutput, error) { - req, out := c.DescribeElasticsearchDomainsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeElasticsearchInstanceTypeLimits = "DescribeElasticsearchInstanceTypeLimits" - -// DescribeElasticsearchInstanceTypeLimitsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeElasticsearchInstanceTypeLimits operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeElasticsearchInstanceTypeLimits for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeElasticsearchInstanceTypeLimits method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeElasticsearchInstanceTypeLimitsRequest method. -// req, resp := client.DescribeElasticsearchInstanceTypeLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimits -func (c *ElasticsearchService) DescribeElasticsearchInstanceTypeLimitsRequest(input *DescribeElasticsearchInstanceTypeLimitsInput) (req *request.Request, output *DescribeElasticsearchInstanceTypeLimitsOutput) { - op := &request.Operation{ - Name: opDescribeElasticsearchInstanceTypeLimits, - HTTPMethod: "GET", - HTTPPath: "/2015-01-01/es/instanceTypeLimits/{ElasticsearchVersion}/{InstanceType}", - } - - if input == nil { - input = &DescribeElasticsearchInstanceTypeLimitsInput{} - } - - output = &DescribeElasticsearchInstanceTypeLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeElasticsearchInstanceTypeLimits API operation for Amazon Elasticsearch Service. -// -// Describe Elasticsearch Limits for a given InstanceType and ElasticsearchVersion. -// When modifying existing Domain, specify the DomainName to know what Limits -// are supported for modifying. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation DescribeElasticsearchInstanceTypeLimits for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeInvalidTypeException "InvalidTypeException" -// An exception for trying to create or access sub-resource that is either invalid -// or not supported. Gives http status code of 409. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// An exception for trying to create more than allowed resources or sub-resources. -// Gives http status code of 409. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An exception for accessing or deleting a resource that does not exist. Gives -// http status code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimits -func (c *ElasticsearchService) DescribeElasticsearchInstanceTypeLimits(input *DescribeElasticsearchInstanceTypeLimitsInput) (*DescribeElasticsearchInstanceTypeLimitsOutput, error) { - req, out := c.DescribeElasticsearchInstanceTypeLimitsRequest(input) - err := req.Send() - return out, err -} - -const opListDomainNames = "ListDomainNames" - -// ListDomainNamesRequest generates a "aws/request.Request" representing the -// client's request for the ListDomainNames operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDomainNames for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDomainNames method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDomainNamesRequest method. -// req, resp := client.ListDomainNamesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNames -func (c *ElasticsearchService) ListDomainNamesRequest(input *ListDomainNamesInput) (req *request.Request, output *ListDomainNamesOutput) { - op := &request.Operation{ - Name: opListDomainNames, - HTTPMethod: "GET", - HTTPPath: "/2015-01-01/domain", - } - - if input == nil { - input = &ListDomainNamesInput{} - } - - output = &ListDomainNamesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDomainNames API operation for Amazon Elasticsearch Service. -// -// Returns the name of all Elasticsearch domains owned by the current user's -// 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 Elasticsearch Service's -// API operation ListDomainNames for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNames -func (c *ElasticsearchService) ListDomainNames(input *ListDomainNamesInput) (*ListDomainNamesOutput, error) { - req, out := c.ListDomainNamesRequest(input) - err := req.Send() - return out, err -} - -const opListElasticsearchInstanceTypes = "ListElasticsearchInstanceTypes" - -// ListElasticsearchInstanceTypesRequest generates a "aws/request.Request" representing the -// client's request for the ListElasticsearchInstanceTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListElasticsearchInstanceTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListElasticsearchInstanceTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListElasticsearchInstanceTypesRequest method. -// req, resp := client.ListElasticsearchInstanceTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypes -func (c *ElasticsearchService) ListElasticsearchInstanceTypesRequest(input *ListElasticsearchInstanceTypesInput) (req *request.Request, output *ListElasticsearchInstanceTypesOutput) { - op := &request.Operation{ - Name: opListElasticsearchInstanceTypes, - HTTPMethod: "GET", - HTTPPath: "/2015-01-01/es/instanceTypes/{ElasticsearchVersion}", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListElasticsearchInstanceTypesInput{} - } - - output = &ListElasticsearchInstanceTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListElasticsearchInstanceTypes API operation for Amazon Elasticsearch Service. -// -// List all Elasticsearch instance types that are supported for given ElasticsearchVersion -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation ListElasticsearchInstanceTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An exception for accessing or deleting a resource that does not exist. Gives -// http status code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypes -func (c *ElasticsearchService) ListElasticsearchInstanceTypes(input *ListElasticsearchInstanceTypesInput) (*ListElasticsearchInstanceTypesOutput, error) { - req, out := c.ListElasticsearchInstanceTypesRequest(input) - err := req.Send() - return out, err -} - -// ListElasticsearchInstanceTypesPages iterates over the pages of a ListElasticsearchInstanceTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListElasticsearchInstanceTypes 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 ListElasticsearchInstanceTypes operation. -// pageNum := 0 -// err := client.ListElasticsearchInstanceTypesPages(params, -// func(page *ListElasticsearchInstanceTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElasticsearchService) ListElasticsearchInstanceTypesPages(input *ListElasticsearchInstanceTypesInput, fn func(p *ListElasticsearchInstanceTypesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListElasticsearchInstanceTypesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListElasticsearchInstanceTypesOutput), lastPage) - }) -} - -const opListElasticsearchVersions = "ListElasticsearchVersions" - -// ListElasticsearchVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListElasticsearchVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListElasticsearchVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListElasticsearchVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListElasticsearchVersionsRequest method. -// req, resp := client.ListElasticsearchVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersions -func (c *ElasticsearchService) ListElasticsearchVersionsRequest(input *ListElasticsearchVersionsInput) (req *request.Request, output *ListElasticsearchVersionsOutput) { - op := &request.Operation{ - Name: opListElasticsearchVersions, - HTTPMethod: "GET", - HTTPPath: "/2015-01-01/es/versions", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListElasticsearchVersionsInput{} - } - - output = &ListElasticsearchVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListElasticsearchVersions API operation for Amazon Elasticsearch Service. -// -// List all supported Elasticsearch versions -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation ListElasticsearchVersions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An exception for accessing or deleting a resource that does not exist. Gives -// http status code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersions -func (c *ElasticsearchService) ListElasticsearchVersions(input *ListElasticsearchVersionsInput) (*ListElasticsearchVersionsOutput, error) { - req, out := c.ListElasticsearchVersionsRequest(input) - err := req.Send() - return out, err -} - -// ListElasticsearchVersionsPages iterates over the pages of a ListElasticsearchVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListElasticsearchVersions 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 ListElasticsearchVersions operation. -// pageNum := 0 -// err := client.ListElasticsearchVersionsPages(params, -// func(page *ListElasticsearchVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElasticsearchService) ListElasticsearchVersionsPages(input *ListElasticsearchVersionsInput, fn func(p *ListElasticsearchVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListElasticsearchVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListElasticsearchVersionsOutput), lastPage) - }) -} - -const opListTags = "ListTags" - -// ListTagsRequest generates a "aws/request.Request" representing the -// client's request for the ListTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsRequest method. -// req, resp := client.ListTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListTags -func (c *ElasticsearchService) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { - op := &request.Operation{ - Name: opListTags, - HTTPMethod: "GET", - HTTPPath: "/2015-01-01/tags/", - } - - if input == nil { - input = &ListTagsInput{} - } - - output = &ListTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTags API operation for Amazon Elasticsearch Service. -// -// Returns all tags for the given Elasticsearch domain. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation ListTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An exception for accessing or deleting a resource that does not exist. Gives -// http status code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListTags -func (c *ElasticsearchService) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTags = "RemoveTags" - -// RemoveTagsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsRequest method. -// req, resp := client.RemoveTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RemoveTags -func (c *ElasticsearchService) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { - op := &request.Operation{ - Name: opRemoveTags, - HTTPMethod: "POST", - HTTPPath: "/2015-01-01/tags-removal", - } - - if input == nil { - input = &RemoveTagsInput{} - } - - output = &RemoveTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveTags API operation for Amazon Elasticsearch Service. -// -// Removes the specified set of tags from the specified Elasticsearch domain. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elasticsearch Service's -// API operation RemoveTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RemoveTags -func (c *ElasticsearchService) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { - req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err -} - -const opUpdateElasticsearchDomainConfig = "UpdateElasticsearchDomainConfig" - -// UpdateElasticsearchDomainConfigRequest generates a "aws/request.Request" representing the -// client's request for the UpdateElasticsearchDomainConfig operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateElasticsearchDomainConfig for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateElasticsearchDomainConfig method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateElasticsearchDomainConfigRequest method. -// req, resp := client.UpdateElasticsearchDomainConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdateElasticsearchDomainConfig -func (c *ElasticsearchService) UpdateElasticsearchDomainConfigRequest(input *UpdateElasticsearchDomainConfigInput) (req *request.Request, output *UpdateElasticsearchDomainConfigOutput) { - op := &request.Operation{ - Name: opUpdateElasticsearchDomainConfig, - HTTPMethod: "POST", - HTTPPath: "/2015-01-01/es/domain/{DomainName}/config", - } - - if input == nil { - input = &UpdateElasticsearchDomainConfigInput{} - } - - output = &UpdateElasticsearchDomainConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateElasticsearchDomainConfig API operation for Amazon Elasticsearch Service. -// -// Modifies the cluster configuration of the specified Elasticsearch domain, -// setting as setting the instance type and the number of 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 Elasticsearch Service's -// API operation UpdateElasticsearchDomainConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" -// An error occurred while processing the request. -// -// * ErrCodeInternalException "InternalException" -// The request processing has failed because of an unknown error, exception -// or failure (the failure is internal to the service) . Gives http status code -// of 500. -// -// * ErrCodeInvalidTypeException "InvalidTypeException" -// An exception for trying to create or access sub-resource that is either invalid -// or not supported. Gives http status code of 409. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// An exception for trying to create more than allowed resources or sub-resources. -// Gives http status code of 409. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An exception for accessing or deleting a resource that does not exist. Gives -// http status code of 400. -// -// * ErrCodeValidationException "ValidationException" -// An exception for missing / invalid input fields. Gives http status code of -// 400. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdateElasticsearchDomainConfig -func (c *ElasticsearchService) UpdateElasticsearchDomainConfig(input *UpdateElasticsearchDomainConfigInput) (*UpdateElasticsearchDomainConfigOutput, error) { - req, out := c.UpdateElasticsearchDomainConfigRequest(input) - err := req.Send() - return out, err -} - -// The configured access rules for the domain's document and search endpoints, -// and the current status of those rules. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AccessPoliciesStatus -type AccessPoliciesStatus struct { - _ struct{} `type:"structure"` - - // The access policy configured for the Elasticsearch domain. Access policies - // may be resource-based, IP-based, or IAM-based. See Configuring Access Policies - // (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-access-policies)for - // more information. - // - // Options is a required field - Options *string `type:"string" required:"true"` - - // The status of the access policy for the Elasticsearch domain. See OptionStatus - // for the status information that's included. - // - // Status is a required field - Status *OptionStatus `type:"structure" required:"true"` -} - -// String returns the string representation -func (s AccessPoliciesStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccessPoliciesStatus) GoString() string { - return s.String() -} - -// SetOptions sets the Options field's value. -func (s *AccessPoliciesStatus) SetOptions(v string) *AccessPoliciesStatus { - s.Options = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AccessPoliciesStatus) SetStatus(v *OptionStatus) *AccessPoliciesStatus { - s.Status = v - return s -} - -// Container for the parameters to the AddTags operation. Specify the tags that -// you want to attach to the Elasticsearch domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AddTagsRequest -type AddTagsInput struct { - _ struct{} `type:"structure"` - - // Specify the ARN for which you want to add the tags. - // - // ARN is a required field - ARN *string `type:"string" required:"true"` - - // List of Tag that need to be added for the Elasticsearch domain. - // - // TagList is a required field - TagList []*Tag `type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"} - if s.ARN == nil { - invalidParams.Add(request.NewErrParamRequired("ARN")) - } - if s.TagList == nil { - invalidParams.Add(request.NewErrParamRequired("TagList")) - } - if s.TagList != nil { - for i, v := range s.TagList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetARN sets the ARN field's value. -func (s *AddTagsInput) SetARN(v string) *AddTagsInput { - s.ARN = &v - return s -} - -// SetTagList sets the TagList field's value. -func (s *AddTagsInput) SetTagList(v []*Tag) *AddTagsInput { - s.TagList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AddTagsOutput -type AddTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsOutput) GoString() string { - return s.String() -} - -// List of limits that are specific to a given InstanceType and for each of -// it's InstanceRole . -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AdditionalLimit -type AdditionalLimit struct { - _ struct{} `type:"structure"` - - // Name of Additional Limit is specific to a given InstanceType and for each - // of it's InstanceRole etc. Attributes and their details: MaximumNumberOfDataNodesSupported - // This attribute will be present in Master node only to specify how much data - // nodes upto which given ESPartitionInstanceTypecan support as master node. MaximumNumberOfDataNodesWithoutMasterNode - // This attribute will be present in Data node only to specify how much data - // nodes of given ESPartitionInstanceType - LimitName *string `type:"string"` - - // Value for given AdditionalLimit$LimitName . - LimitValues []*string `type:"list"` -} - -// String returns the string representation -func (s AdditionalLimit) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AdditionalLimit) GoString() string { - return s.String() -} - -// SetLimitName sets the LimitName field's value. -func (s *AdditionalLimit) SetLimitName(v string) *AdditionalLimit { - s.LimitName = &v - return s -} - -// SetLimitValues sets the LimitValues field's value. -func (s *AdditionalLimit) SetLimitValues(v []*string) *AdditionalLimit { - s.LimitValues = v - return s -} - -// Status of the advanced options for the specified Elasticsearch domain. Currently, -// the following advanced options are available: -// -// * Option to allow references to indices in an HTTP request body. Must -// be false when configuring access to individual sub-resources. By default, -// the value is true. See Configuration Advanced Options (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options) -// for more information. -// * Option to specify the percentage of heap space that is allocated to -// field data. By default, this setting is unbounded. -// For more information, see Configuring Advanced Options (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AdvancedOptionsStatus -type AdvancedOptionsStatus struct { - _ struct{} `type:"structure"` - - // Specifies the status of advanced options for the specified Elasticsearch - // domain. - // - // Options is a required field - Options map[string]*string `type:"map" required:"true"` - - // Specifies the status of OptionStatus for advanced options for the specified - // Elasticsearch domain. - // - // Status is a required field - Status *OptionStatus `type:"structure" required:"true"` -} - -// String returns the string representation -func (s AdvancedOptionsStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AdvancedOptionsStatus) GoString() string { - return s.String() -} - -// SetOptions sets the Options field's value. -func (s *AdvancedOptionsStatus) SetOptions(v map[string]*string) *AdvancedOptionsStatus { - s.Options = v - return s -} - -// SetStatus sets the Status field's value. -func (s *AdvancedOptionsStatus) SetStatus(v *OptionStatus) *AdvancedOptionsStatus { - s.Status = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateElasticsearchDomainRequest -type CreateElasticsearchDomainInput struct { - _ struct{} `type:"structure"` - - // IAM access policy as a JSON-formatted string. - AccessPolicies *string `type:"string"` - - // Option to allow references to indices in an HTTP request body. Must be false - // when configuring access to individual sub-resources. By default, the value - // is true. See Configuration Advanced Options (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options) - // for more information. - AdvancedOptions map[string]*string `type:"map"` - - // The name of the Elasticsearch domain that you are creating. Domain names - // are unique across the domains owned by an account within an AWS region. Domain - // names must start with a letter or number and can contain the following characters: - // a-z (lowercase), 0-9, and - (hyphen). - // - // DomainName is a required field - DomainName *string `min:"3" type:"string" required:"true"` - - // Options to enable, disable and specify the type and size of EBS storage volumes. - EBSOptions *EBSOptions `type:"structure"` - - // Configuration options for an Elasticsearch domain. Specifies the instance - // type and number of instances in the domain cluster. - ElasticsearchClusterConfig *ElasticsearchClusterConfig `type:"structure"` - - // String of format X.Y to specify version for the Elasticsearch domain eg. - // "1.5" or "2.3". For more information, see Creating Elasticsearch Domains - // (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains) - // in the Amazon Elasticsearch Service Developer Guide. - ElasticsearchVersion *string `type:"string"` - - // Option to set time, in UTC format, of the daily automated snapshot. Default - // value is 0 hours. - SnapshotOptions *SnapshotOptions `type:"structure"` -} - -// String returns the string representation -func (s CreateElasticsearchDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateElasticsearchDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateElasticsearchDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateElasticsearchDomainInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.DomainName != nil && len(*s.DomainName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessPolicies sets the AccessPolicies field's value. -func (s *CreateElasticsearchDomainInput) SetAccessPolicies(v string) *CreateElasticsearchDomainInput { - s.AccessPolicies = &v - return s -} - -// SetAdvancedOptions sets the AdvancedOptions field's value. -func (s *CreateElasticsearchDomainInput) SetAdvancedOptions(v map[string]*string) *CreateElasticsearchDomainInput { - s.AdvancedOptions = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *CreateElasticsearchDomainInput) SetDomainName(v string) *CreateElasticsearchDomainInput { - s.DomainName = &v - return s -} - -// SetEBSOptions sets the EBSOptions field's value. -func (s *CreateElasticsearchDomainInput) SetEBSOptions(v *EBSOptions) *CreateElasticsearchDomainInput { - s.EBSOptions = v - return s -} - -// SetElasticsearchClusterConfig sets the ElasticsearchClusterConfig field's value. -func (s *CreateElasticsearchDomainInput) SetElasticsearchClusterConfig(v *ElasticsearchClusterConfig) *CreateElasticsearchDomainInput { - s.ElasticsearchClusterConfig = v - return s -} - -// SetElasticsearchVersion sets the ElasticsearchVersion field's value. -func (s *CreateElasticsearchDomainInput) SetElasticsearchVersion(v string) *CreateElasticsearchDomainInput { - s.ElasticsearchVersion = &v - return s -} - -// SetSnapshotOptions sets the SnapshotOptions field's value. -func (s *CreateElasticsearchDomainInput) SetSnapshotOptions(v *SnapshotOptions) *CreateElasticsearchDomainInput { - s.SnapshotOptions = v - return s -} - -// The result of a CreateElasticsearchDomain operation. Contains the status -// of the newly created Elasticsearch domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateElasticsearchDomainResponse -type CreateElasticsearchDomainOutput struct { - _ struct{} `type:"structure"` - - // The status of the newly created Elasticsearch domain. - DomainStatus *ElasticsearchDomainStatus `type:"structure"` -} - -// String returns the string representation -func (s CreateElasticsearchDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateElasticsearchDomainOutput) GoString() string { - return s.String() -} - -// SetDomainStatus sets the DomainStatus field's value. -func (s *CreateElasticsearchDomainOutput) SetDomainStatus(v *ElasticsearchDomainStatus) *CreateElasticsearchDomainOutput { - s.DomainStatus = v - return s -} - -// Container for the parameters to the DeleteElasticsearchDomain operation. -// Specifies the name of the Elasticsearch domain that you want to delete. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchDomainRequest -type DeleteElasticsearchDomainInput struct { - _ struct{} `type:"structure"` - - // The name of the Elasticsearch domain that you want to permanently delete. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"DomainName" min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteElasticsearchDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteElasticsearchDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteElasticsearchDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteElasticsearchDomainInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.DomainName != nil && len(*s.DomainName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DeleteElasticsearchDomainInput) SetDomainName(v string) *DeleteElasticsearchDomainInput { - s.DomainName = &v - return s -} - -// The result of a DeleteElasticsearchDomain request. Contains the status of -// the pending deletion, or no status if the domain and all of its resources -// have been deleted. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchDomainResponse -type DeleteElasticsearchDomainOutput struct { - _ struct{} `type:"structure"` - - // The status of the Elasticsearch domain being deleted. - DomainStatus *ElasticsearchDomainStatus `type:"structure"` -} - -// String returns the string representation -func (s DeleteElasticsearchDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteElasticsearchDomainOutput) GoString() string { - return s.String() -} - -// SetDomainStatus sets the DomainStatus field's value. -func (s *DeleteElasticsearchDomainOutput) SetDomainStatus(v *ElasticsearchDomainStatus) *DeleteElasticsearchDomainOutput { - s.DomainStatus = v - return s -} - -// Container for the parameters to the DescribeElasticsearchDomainConfig operation. -// Specifies the domain name for which you want configuration information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainConfigRequest -type DescribeElasticsearchDomainConfigInput struct { - _ struct{} `type:"structure"` - - // The Elasticsearch domain that you want to get information about. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"DomainName" min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeElasticsearchDomainConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticsearchDomainConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeElasticsearchDomainConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeElasticsearchDomainConfigInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.DomainName != nil && len(*s.DomainName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DescribeElasticsearchDomainConfigInput) SetDomainName(v string) *DescribeElasticsearchDomainConfigInput { - s.DomainName = &v - return s -} - -// The result of a DescribeElasticsearchDomainConfig request. Contains the configuration -// information of the requested domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainConfigResponse -type DescribeElasticsearchDomainConfigOutput struct { - _ struct{} `type:"structure"` - - // The configuration information of the domain requested in the DescribeElasticsearchDomainConfig - // request. - // - // DomainConfig is a required field - DomainConfig *ElasticsearchDomainConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DescribeElasticsearchDomainConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticsearchDomainConfigOutput) GoString() string { - return s.String() -} - -// SetDomainConfig sets the DomainConfig field's value. -func (s *DescribeElasticsearchDomainConfigOutput) SetDomainConfig(v *ElasticsearchDomainConfig) *DescribeElasticsearchDomainConfigOutput { - s.DomainConfig = v - return s -} - -// Container for the parameters to the DescribeElasticsearchDomain operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainRequest -type DescribeElasticsearchDomainInput struct { - _ struct{} `type:"structure"` - - // The name of the Elasticsearch domain for which you want information. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"DomainName" min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeElasticsearchDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticsearchDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeElasticsearchDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeElasticsearchDomainInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.DomainName != nil && len(*s.DomainName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DescribeElasticsearchDomainInput) SetDomainName(v string) *DescribeElasticsearchDomainInput { - s.DomainName = &v - return s -} - -// The result of a DescribeElasticsearchDomain request. Contains the status -// of the domain specified in the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainResponse -type DescribeElasticsearchDomainOutput struct { - _ struct{} `type:"structure"` - - // The current status of the Elasticsearch domain. - // - // DomainStatus is a required field - DomainStatus *ElasticsearchDomainStatus `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DescribeElasticsearchDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticsearchDomainOutput) GoString() string { - return s.String() -} - -// SetDomainStatus sets the DomainStatus field's value. -func (s *DescribeElasticsearchDomainOutput) SetDomainStatus(v *ElasticsearchDomainStatus) *DescribeElasticsearchDomainOutput { - s.DomainStatus = v - return s -} - -// Container for the parameters to the DescribeElasticsearchDomains operation. -// By default, the API returns the status of all Elasticsearch domains. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainsRequest -type DescribeElasticsearchDomainsInput struct { - _ struct{} `type:"structure"` - - // The Elasticsearch domains for which you want information. - // - // DomainNames is a required field - DomainNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeElasticsearchDomainsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticsearchDomainsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeElasticsearchDomainsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeElasticsearchDomainsInput"} - if s.DomainNames == nil { - invalidParams.Add(request.NewErrParamRequired("DomainNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainNames sets the DomainNames field's value. -func (s *DescribeElasticsearchDomainsInput) SetDomainNames(v []*string) *DescribeElasticsearchDomainsInput { - s.DomainNames = v - return s -} - -// The result of a DescribeElasticsearchDomains request. Contains the status -// of the specified domains or all domains owned by the account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainsResponse -type DescribeElasticsearchDomainsOutput struct { - _ struct{} `type:"structure"` - - // The status of the domains requested in the DescribeElasticsearchDomains request. - // - // DomainStatusList is a required field - DomainStatusList []*ElasticsearchDomainStatus `type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeElasticsearchDomainsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticsearchDomainsOutput) GoString() string { - return s.String() -} - -// SetDomainStatusList sets the DomainStatusList field's value. -func (s *DescribeElasticsearchDomainsOutput) SetDomainStatusList(v []*ElasticsearchDomainStatus) *DescribeElasticsearchDomainsOutput { - s.DomainStatusList = v - return s -} - -// Container for the parameters to DescribeElasticsearchInstanceTypeLimits operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimitsRequest -type DescribeElasticsearchInstanceTypeLimitsInput struct { - _ struct{} `type:"structure"` - - // DomainName represents the name of the Domain that we are trying to modify. - // This should be present only if we are querying for Elasticsearch Limits for - // existing domain. - DomainName *string `location:"querystring" locationName:"domainName" min:"3" type:"string"` - - // Version of Elasticsearch for which Limits are needed. - // - // ElasticsearchVersion is a required field - ElasticsearchVersion *string `location:"uri" locationName:"ElasticsearchVersion" type:"string" required:"true"` - - // The instance type for an Elasticsearch cluster for which Elasticsearch Limits - // are needed. - // - // InstanceType is a required field - InstanceType *string `location:"uri" locationName:"InstanceType" type:"string" required:"true" enum:"ESPartitionInstanceType"` -} - -// String returns the string representation -func (s DescribeElasticsearchInstanceTypeLimitsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticsearchInstanceTypeLimitsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeElasticsearchInstanceTypeLimitsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeElasticsearchInstanceTypeLimitsInput"} - if s.DomainName != nil && len(*s.DomainName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) - } - if s.ElasticsearchVersion == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticsearchVersion")) - } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DescribeElasticsearchInstanceTypeLimitsInput) SetDomainName(v string) *DescribeElasticsearchInstanceTypeLimitsInput { - s.DomainName = &v - return s -} - -// SetElasticsearchVersion sets the ElasticsearchVersion field's value. -func (s *DescribeElasticsearchInstanceTypeLimitsInput) SetElasticsearchVersion(v string) *DescribeElasticsearchInstanceTypeLimitsInput { - s.ElasticsearchVersion = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeElasticsearchInstanceTypeLimitsInput) SetInstanceType(v string) *DescribeElasticsearchInstanceTypeLimitsInput { - s.InstanceType = &v - return s -} - -// Container for the parameters received from DescribeElasticsearchInstanceTypeLimits -// operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimitsResponse -type DescribeElasticsearchInstanceTypeLimitsOutput struct { - _ struct{} `type:"structure"` - - // Map of Role of the Instance and Limits that are applicable. Role performed - // by given Instance in Elasticsearch can be one of the following: Data: If - // the given InstanceType is used as Data node - // Master: If the given InstanceType is used as Master node - LimitsByRole map[string]*Limits `type:"map"` -} - -// String returns the string representation -func (s DescribeElasticsearchInstanceTypeLimitsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticsearchInstanceTypeLimitsOutput) GoString() string { - return s.String() -} - -// SetLimitsByRole sets the LimitsByRole field's value. -func (s *DescribeElasticsearchInstanceTypeLimitsOutput) SetLimitsByRole(v map[string]*Limits) *DescribeElasticsearchInstanceTypeLimitsOutput { - s.LimitsByRole = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DomainInfo -type DomainInfo struct { - _ struct{} `type:"structure"` - - // Specifies the DomainName. - DomainName *string `min:"3" type:"string"` -} - -// String returns the string representation -func (s DomainInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DomainInfo) GoString() string { - return s.String() -} - -// SetDomainName sets the DomainName field's value. -func (s *DomainInfo) SetDomainName(v string) *DomainInfo { - s.DomainName = &v - return s -} - -// Options to enable, disable, and specify the properties of EBS storage volumes. -// For more information, see Configuring EBS-based Storage (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-ebs). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/EBSOptions -type EBSOptions struct { - _ struct{} `type:"structure"` - - // Specifies whether EBS-based storage is enabled. - EBSEnabled *bool `type:"boolean"` - - // Specifies the IOPD for a Provisioned IOPS EBS volume (SSD). - Iops *int64 `type:"integer"` - - // Integer to specify the size of an EBS volume. - VolumeSize *int64 `type:"integer"` - - // Specifies the volume type for EBS-based storage. - VolumeType *string `type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s EBSOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EBSOptions) GoString() string { - return s.String() -} - -// SetEBSEnabled sets the EBSEnabled field's value. -func (s *EBSOptions) SetEBSEnabled(v bool) *EBSOptions { - s.EBSEnabled = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *EBSOptions) SetIops(v int64) *EBSOptions { - s.Iops = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *EBSOptions) SetVolumeSize(v int64) *EBSOptions { - s.VolumeSize = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *EBSOptions) SetVolumeType(v string) *EBSOptions { - s.VolumeType = &v - return s -} - -// Status of the EBS options for the specified Elasticsearch domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/EBSOptionsStatus -type EBSOptionsStatus struct { - _ struct{} `type:"structure"` - - // Specifies the EBS options for the specified Elasticsearch domain. - // - // Options is a required field - Options *EBSOptions `type:"structure" required:"true"` - - // Specifies the status of the EBS options for the specified Elasticsearch domain. - // - // Status is a required field - Status *OptionStatus `type:"structure" required:"true"` -} - -// String returns the string representation -func (s EBSOptionsStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EBSOptionsStatus) GoString() string { - return s.String() -} - -// SetOptions sets the Options field's value. -func (s *EBSOptionsStatus) SetOptions(v *EBSOptions) *EBSOptionsStatus { - s.Options = v - return s -} - -// SetStatus sets the Status field's value. -func (s *EBSOptionsStatus) SetStatus(v *OptionStatus) *EBSOptionsStatus { - s.Status = v - return s -} - -// Specifies the configuration for the domain cluster, such as the type and -// number of instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ElasticsearchClusterConfig -type ElasticsearchClusterConfig struct { - _ struct{} `type:"structure"` - - // Total number of dedicated master nodes, active and on standby, for the cluster. - DedicatedMasterCount *int64 `type:"integer"` - - // A boolean value to indicate whether a dedicated master node is enabled. See - // About Dedicated Master Nodes (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-dedicatedmasternodes) - // for more information. - DedicatedMasterEnabled *bool `type:"boolean"` - - // The instance type for a dedicated master node. - DedicatedMasterType *string `type:"string" enum:"ESPartitionInstanceType"` - - // The number of instances in the specified domain cluster. - InstanceCount *int64 `type:"integer"` - - // The instance type for an Elasticsearch cluster. - InstanceType *string `type:"string" enum:"ESPartitionInstanceType"` - - // A boolean value to indicate whether zone awareness is enabled. See About - // Zone Awareness (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness) - // for more information. - ZoneAwarenessEnabled *bool `type:"boolean"` -} - -// String returns the string representation -func (s ElasticsearchClusterConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchClusterConfig) GoString() string { - return s.String() -} - -// SetDedicatedMasterCount sets the DedicatedMasterCount field's value. -func (s *ElasticsearchClusterConfig) SetDedicatedMasterCount(v int64) *ElasticsearchClusterConfig { - s.DedicatedMasterCount = &v - return s -} - -// SetDedicatedMasterEnabled sets the DedicatedMasterEnabled field's value. -func (s *ElasticsearchClusterConfig) SetDedicatedMasterEnabled(v bool) *ElasticsearchClusterConfig { - s.DedicatedMasterEnabled = &v - return s -} - -// SetDedicatedMasterType sets the DedicatedMasterType field's value. -func (s *ElasticsearchClusterConfig) SetDedicatedMasterType(v string) *ElasticsearchClusterConfig { - s.DedicatedMasterType = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *ElasticsearchClusterConfig) SetInstanceCount(v int64) *ElasticsearchClusterConfig { - s.InstanceCount = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ElasticsearchClusterConfig) SetInstanceType(v string) *ElasticsearchClusterConfig { - s.InstanceType = &v - return s -} - -// SetZoneAwarenessEnabled sets the ZoneAwarenessEnabled field's value. -func (s *ElasticsearchClusterConfig) SetZoneAwarenessEnabled(v bool) *ElasticsearchClusterConfig { - s.ZoneAwarenessEnabled = &v - return s -} - -// Specifies the configuration status for the specified Elasticsearch domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ElasticsearchClusterConfigStatus -type ElasticsearchClusterConfigStatus struct { - _ struct{} `type:"structure"` - - // Specifies the cluster configuration for the specified Elasticsearch domain. - // - // Options is a required field - Options *ElasticsearchClusterConfig `type:"structure" required:"true"` - - // Specifies the status of the configuration for the specified Elasticsearch - // domain. - // - // Status is a required field - Status *OptionStatus `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ElasticsearchClusterConfigStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchClusterConfigStatus) GoString() string { - return s.String() -} - -// SetOptions sets the Options field's value. -func (s *ElasticsearchClusterConfigStatus) SetOptions(v *ElasticsearchClusterConfig) *ElasticsearchClusterConfigStatus { - s.Options = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ElasticsearchClusterConfigStatus) SetStatus(v *OptionStatus) *ElasticsearchClusterConfigStatus { - s.Status = v - return s -} - -// The configuration of an Elasticsearch domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ElasticsearchDomainConfig -type ElasticsearchDomainConfig struct { - _ struct{} `type:"structure"` - - // IAM access policy as a JSON-formatted string. - AccessPolicies *AccessPoliciesStatus `type:"structure"` - - // Specifies the AdvancedOptions for the domain. See Configuring Advanced Options - // (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options) - // for more information. - AdvancedOptions *AdvancedOptionsStatus `type:"structure"` - - // Specifies the EBSOptions for the Elasticsearch domain. - EBSOptions *EBSOptionsStatus `type:"structure"` - - // Specifies the ElasticsearchClusterConfig for the Elasticsearch domain. - ElasticsearchClusterConfig *ElasticsearchClusterConfigStatus `type:"structure"` - - // String of format X.Y to specify version for the Elasticsearch domain. - ElasticsearchVersion *ElasticsearchVersionStatus `type:"structure"` - - // Specifies the SnapshotOptions for the Elasticsearch domain. - SnapshotOptions *SnapshotOptionsStatus `type:"structure"` -} - -// String returns the string representation -func (s ElasticsearchDomainConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchDomainConfig) GoString() string { - return s.String() -} - -// SetAccessPolicies sets the AccessPolicies field's value. -func (s *ElasticsearchDomainConfig) SetAccessPolicies(v *AccessPoliciesStatus) *ElasticsearchDomainConfig { - s.AccessPolicies = v - return s -} - -// SetAdvancedOptions sets the AdvancedOptions field's value. -func (s *ElasticsearchDomainConfig) SetAdvancedOptions(v *AdvancedOptionsStatus) *ElasticsearchDomainConfig { - s.AdvancedOptions = v - return s -} - -// SetEBSOptions sets the EBSOptions field's value. -func (s *ElasticsearchDomainConfig) SetEBSOptions(v *EBSOptionsStatus) *ElasticsearchDomainConfig { - s.EBSOptions = v - return s -} - -// SetElasticsearchClusterConfig sets the ElasticsearchClusterConfig field's value. -func (s *ElasticsearchDomainConfig) SetElasticsearchClusterConfig(v *ElasticsearchClusterConfigStatus) *ElasticsearchDomainConfig { - s.ElasticsearchClusterConfig = v - return s -} - -// SetElasticsearchVersion sets the ElasticsearchVersion field's value. -func (s *ElasticsearchDomainConfig) SetElasticsearchVersion(v *ElasticsearchVersionStatus) *ElasticsearchDomainConfig { - s.ElasticsearchVersion = v - return s -} - -// SetSnapshotOptions sets the SnapshotOptions field's value. -func (s *ElasticsearchDomainConfig) SetSnapshotOptions(v *SnapshotOptionsStatus) *ElasticsearchDomainConfig { - s.SnapshotOptions = v - return s -} - -// The current status of an Elasticsearch domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ElasticsearchDomainStatus -type ElasticsearchDomainStatus struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) of an Elasticsearch domain. See Identifiers - // for IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/index.html?Using_Identifiers.html) - // in Using AWS Identity and Access Management for more information. - // - // ARN is a required field - ARN *string `type:"string" required:"true"` - - // IAM access policy as a JSON-formatted string. - AccessPolicies *string `type:"string"` - - // Specifies the status of the AdvancedOptions - AdvancedOptions map[string]*string `type:"map"` - - // The domain creation status. True if the creation of an Elasticsearch domain - // is complete. False if domain creation is still in progress. - Created *bool `type:"boolean"` - - // The domain deletion status. True if a delete request has been received for - // the domain but resource cleanup is still in progress. False if the domain - // has not been deleted. Once domain deletion is complete, the status of the - // domain is no longer returned. - Deleted *bool `type:"boolean"` - - // The unique identifier for the specified Elasticsearch domain. - // - // DomainId is a required field - DomainId *string `min:"1" type:"string" required:"true"` - - // The name of an Elasticsearch domain. Domain names are unique across the domains - // owned by an account within an AWS region. Domain names start with a letter - // or number and can contain the following characters: a-z (lowercase), 0-9, - // and - (hyphen). - // - // DomainName is a required field - DomainName *string `min:"3" type:"string" required:"true"` - - // The EBSOptions for the specified domain. See Configuring EBS-based Storage - // (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-ebs) - // for more information. - EBSOptions *EBSOptions `type:"structure"` - - // The type and number of instances in the domain cluster. - // - // ElasticsearchClusterConfig is a required field - ElasticsearchClusterConfig *ElasticsearchClusterConfig `type:"structure" required:"true"` - - ElasticsearchVersion *string `type:"string"` - - // The Elasticsearch domain endpoint that you use to submit index and search - // requests. - Endpoint *string `type:"string"` - - // The status of the Elasticsearch domain configuration. True if Amazon Elasticsearch - // Service is processing configuration changes. False if the configuration is - // active. - Processing *bool `type:"boolean"` - - // Specifies the status of the SnapshotOptions - SnapshotOptions *SnapshotOptions `type:"structure"` -} - -// String returns the string representation -func (s ElasticsearchDomainStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchDomainStatus) GoString() string { - return s.String() -} - -// SetARN sets the ARN field's value. -func (s *ElasticsearchDomainStatus) SetARN(v string) *ElasticsearchDomainStatus { - s.ARN = &v - return s -} - -// SetAccessPolicies sets the AccessPolicies field's value. -func (s *ElasticsearchDomainStatus) SetAccessPolicies(v string) *ElasticsearchDomainStatus { - s.AccessPolicies = &v - return s -} - -// SetAdvancedOptions sets the AdvancedOptions field's value. -func (s *ElasticsearchDomainStatus) SetAdvancedOptions(v map[string]*string) *ElasticsearchDomainStatus { - s.AdvancedOptions = v - return s -} - -// SetCreated sets the Created field's value. -func (s *ElasticsearchDomainStatus) SetCreated(v bool) *ElasticsearchDomainStatus { - s.Created = &v - return s -} - -// SetDeleted sets the Deleted field's value. -func (s *ElasticsearchDomainStatus) SetDeleted(v bool) *ElasticsearchDomainStatus { - s.Deleted = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *ElasticsearchDomainStatus) SetDomainId(v string) *ElasticsearchDomainStatus { - s.DomainId = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *ElasticsearchDomainStatus) SetDomainName(v string) *ElasticsearchDomainStatus { - s.DomainName = &v - return s -} - -// SetEBSOptions sets the EBSOptions field's value. -func (s *ElasticsearchDomainStatus) SetEBSOptions(v *EBSOptions) *ElasticsearchDomainStatus { - s.EBSOptions = v - return s -} - -// SetElasticsearchClusterConfig sets the ElasticsearchClusterConfig field's value. -func (s *ElasticsearchDomainStatus) SetElasticsearchClusterConfig(v *ElasticsearchClusterConfig) *ElasticsearchDomainStatus { - s.ElasticsearchClusterConfig = v - return s -} - -// SetElasticsearchVersion sets the ElasticsearchVersion field's value. -func (s *ElasticsearchDomainStatus) SetElasticsearchVersion(v string) *ElasticsearchDomainStatus { - s.ElasticsearchVersion = &v - return s -} - -// SetEndpoint sets the Endpoint field's value. -func (s *ElasticsearchDomainStatus) SetEndpoint(v string) *ElasticsearchDomainStatus { - s.Endpoint = &v - return s -} - -// SetProcessing sets the Processing field's value. -func (s *ElasticsearchDomainStatus) SetProcessing(v bool) *ElasticsearchDomainStatus { - s.Processing = &v - return s -} - -// SetSnapshotOptions sets the SnapshotOptions field's value. -func (s *ElasticsearchDomainStatus) SetSnapshotOptions(v *SnapshotOptions) *ElasticsearchDomainStatus { - s.SnapshotOptions = v - return s -} - -// Status of the Elasticsearch version options for the specified Elasticsearch -// domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ElasticsearchVersionStatus -type ElasticsearchVersionStatus struct { - _ struct{} `type:"structure"` - - // Specifies the Elasticsearch version for the specified Elasticsearch domain. - // - // Options is a required field - Options *string `type:"string" required:"true"` - - // Specifies the status of the Elasticsearch version options for the specified - // Elasticsearch domain. - // - // Status is a required field - Status *OptionStatus `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ElasticsearchVersionStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchVersionStatus) GoString() string { - return s.String() -} - -// SetOptions sets the Options field's value. -func (s *ElasticsearchVersionStatus) SetOptions(v string) *ElasticsearchVersionStatus { - s.Options = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ElasticsearchVersionStatus) SetStatus(v *OptionStatus) *ElasticsearchVersionStatus { - s.Status = v - return s -} - -// InstanceCountLimits represents the limits on number of instances that be -// created in Amazon Elasticsearch for given InstanceType. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/InstanceCountLimits -type InstanceCountLimits struct { - _ struct{} `type:"structure"` - - // Maximum number of Instances that can be instantiated for given InstanceType. - MaximumInstanceCount *int64 `type:"integer"` - - // Minimum number of Instances that can be instantiated for given InstanceType. - MinimumInstanceCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s InstanceCountLimits) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceCountLimits) GoString() string { - return s.String() -} - -// SetMaximumInstanceCount sets the MaximumInstanceCount field's value. -func (s *InstanceCountLimits) SetMaximumInstanceCount(v int64) *InstanceCountLimits { - s.MaximumInstanceCount = &v - return s -} - -// SetMinimumInstanceCount sets the MinimumInstanceCount field's value. -func (s *InstanceCountLimits) SetMinimumInstanceCount(v int64) *InstanceCountLimits { - s.MinimumInstanceCount = &v - return s -} - -// InstanceLimits represents the list of instance related attributes that are -// available for given InstanceType. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/InstanceLimits -type InstanceLimits struct { - _ struct{} `type:"structure"` - - // InstanceCountLimits represents the limits on number of instances that be - // created in Amazon Elasticsearch for given InstanceType. - InstanceCountLimits *InstanceCountLimits `type:"structure"` -} - -// String returns the string representation -func (s InstanceLimits) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceLimits) GoString() string { - return s.String() -} - -// SetInstanceCountLimits sets the InstanceCountLimits field's value. -func (s *InstanceLimits) SetInstanceCountLimits(v *InstanceCountLimits) *InstanceLimits { - s.InstanceCountLimits = v - return s -} - -// Limits for given InstanceType and for each of it's role. Limits contains following StorageTypes, InstanceLimitsand AdditionalLimits -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/Limits -type Limits struct { - _ struct{} `type:"structure"` - - // List of additional limits that are specific to a given InstanceType and for - // each of it's InstanceRole . - AdditionalLimits []*AdditionalLimit `type:"list"` - - // InstanceLimits represents the list of instance related attributes that are - // available for given InstanceType. - InstanceLimits *InstanceLimits `type:"structure"` - - // StorageType represents the list of storage related types and attributes that - // are available for given InstanceType. - StorageTypes []*StorageType `type:"list"` -} - -// String returns the string representation -func (s Limits) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Limits) GoString() string { - return s.String() -} - -// SetAdditionalLimits sets the AdditionalLimits field's value. -func (s *Limits) SetAdditionalLimits(v []*AdditionalLimit) *Limits { - s.AdditionalLimits = v - return s -} - -// SetInstanceLimits sets the InstanceLimits field's value. -func (s *Limits) SetInstanceLimits(v *InstanceLimits) *Limits { - s.InstanceLimits = v - return s -} - -// SetStorageTypes sets the StorageTypes field's value. -func (s *Limits) SetStorageTypes(v []*StorageType) *Limits { - s.StorageTypes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNamesInput -type ListDomainNamesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ListDomainNamesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDomainNamesInput) GoString() string { - return s.String() -} - -// The result of a ListDomainNames operation. Contains the names of all Elasticsearch -// domains owned by this account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNamesResponse -type ListDomainNamesOutput struct { - _ struct{} `type:"structure"` - - // List of Elasticsearch domain names. - DomainNames []*DomainInfo `type:"list"` -} - -// String returns the string representation -func (s ListDomainNamesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDomainNamesOutput) GoString() string { - return s.String() -} - -// SetDomainNames sets the DomainNames field's value. -func (s *ListDomainNamesOutput) SetDomainNames(v []*DomainInfo) *ListDomainNamesOutput { - s.DomainNames = v - return s -} - -// Container for the parameters to the ListElasticsearchInstanceTypes operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypesRequest -type ListElasticsearchInstanceTypesInput struct { - _ struct{} `type:"structure"` - - // DomainName represents the name of the Domain that we are trying to modify. - // This should be present only if we are querying for list of available Elasticsearch - // instance types when modifying existing domain. - DomainName *string `location:"querystring" locationName:"domainName" min:"3" type:"string"` - - // Version of Elasticsearch for which list of supported elasticsearch instance - // types are needed. - // - // ElasticsearchVersion is a required field - ElasticsearchVersion *string `location:"uri" locationName:"ElasticsearchVersion" type:"string" required:"true"` - - // Set this value to limit the number of results returned. Value provided must - // be greater than 30 else it wont be honored. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // NextToken should be sent in case if earlier API call produced result containing - // NextToken. It is used for pagination. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListElasticsearchInstanceTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListElasticsearchInstanceTypesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListElasticsearchInstanceTypesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListElasticsearchInstanceTypesInput"} - if s.DomainName != nil && len(*s.DomainName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) - } - if s.ElasticsearchVersion == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticsearchVersion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *ListElasticsearchInstanceTypesInput) SetDomainName(v string) *ListElasticsearchInstanceTypesInput { - s.DomainName = &v - return s -} - -// SetElasticsearchVersion sets the ElasticsearchVersion field's value. -func (s *ListElasticsearchInstanceTypesInput) SetElasticsearchVersion(v string) *ListElasticsearchInstanceTypesInput { - s.ElasticsearchVersion = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListElasticsearchInstanceTypesInput) SetMaxResults(v int64) *ListElasticsearchInstanceTypesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListElasticsearchInstanceTypesInput) SetNextToken(v string) *ListElasticsearchInstanceTypesInput { - s.NextToken = &v - return s -} - -// Container for the parameters returned by ListElasticsearchInstanceTypes operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypesResponse -type ListElasticsearchInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - // List of instance types supported by Amazon Elasticsearch service for given - // ElasticsearchVersion - ElasticsearchInstanceTypes []*string `type:"list"` - - // In case if there are more results available NextToken would be present, make - // further request to the same API with received NextToken to paginate remaining - // results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListElasticsearchInstanceTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListElasticsearchInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetElasticsearchInstanceTypes sets the ElasticsearchInstanceTypes field's value. -func (s *ListElasticsearchInstanceTypesOutput) SetElasticsearchInstanceTypes(v []*string) *ListElasticsearchInstanceTypesOutput { - s.ElasticsearchInstanceTypes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListElasticsearchInstanceTypesOutput) SetNextToken(v string) *ListElasticsearchInstanceTypesOutput { - s.NextToken = &v - return s -} - -// Container for the parameters to the ListElasticsearchVersions operation. -// Use MaxResults to control the maximum number of results to retrieve in a -// single call. -// -// Use NextToken in response to retrieve more results. If the received response -// does not contain a NextToken, then there are no more results to retrieve. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersionsRequest -type ListElasticsearchVersionsInput struct { - _ struct{} `type:"structure"` - - // Set this value to limit the number of results returned. Value provided must - // be greater than 10 else it wont be honored. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // Paginated APIs accepts NextToken input to returns next page results and provides - // a NextToken output in the response which can be used by the client to retrieve - // more results. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListElasticsearchVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListElasticsearchVersionsInput) GoString() string { - return s.String() -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListElasticsearchVersionsInput) SetMaxResults(v int64) *ListElasticsearchVersionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListElasticsearchVersionsInput) SetNextToken(v string) *ListElasticsearchVersionsInput { - s.NextToken = &v - return s -} - -// Container for the parameters for response received from ListElasticsearchVersions -// operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersionsResponse -type ListElasticsearchVersionsOutput struct { - _ struct{} `type:"structure"` - - // List of supported elastic search versions. - ElasticsearchVersions []*string `type:"list"` - - // Paginated APIs accepts NextToken input to returns next page results and provides - // a NextToken output in the response which can be used by the client to retrieve - // more results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListElasticsearchVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListElasticsearchVersionsOutput) GoString() string { - return s.String() -} - -// SetElasticsearchVersions sets the ElasticsearchVersions field's value. -func (s *ListElasticsearchVersionsOutput) SetElasticsearchVersions(v []*string) *ListElasticsearchVersionsOutput { - s.ElasticsearchVersions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListElasticsearchVersionsOutput) SetNextToken(v string) *ListElasticsearchVersionsOutput { - s.NextToken = &v - return s -} - -// Container for the parameters to the ListTags operation. Specify the ARN for -// the Elasticsearch domain to which the tags are attached that you want to -// view are attached. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListTagsRequest -type ListTagsInput struct { - _ struct{} `type:"structure"` - - // Specify the ARN for the Elasticsearch domain to which the tags are attached - // that you want to view. - // - // ARN is a required field - ARN *string `location:"querystring" locationName:"arn" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"} - if s.ARN == nil { - invalidParams.Add(request.NewErrParamRequired("ARN")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetARN sets the ARN field's value. -func (s *ListTagsInput) SetARN(v string) *ListTagsInput { - s.ARN = &v - return s -} - -// The result of a ListTags operation. Contains tags for all requested Elasticsearch -// domains. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListTagsResponse -type ListTagsOutput struct { - _ struct{} `type:"structure"` - - // List of Tag for the requested Elasticsearch domain. - TagList []*Tag `type:"list"` -} - -// String returns the string representation -func (s ListTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsOutput) GoString() string { - return s.String() -} - -// SetTagList sets the TagList field's value. -func (s *ListTagsOutput) SetTagList(v []*Tag) *ListTagsOutput { - s.TagList = v - return s -} - -// Provides the current status of the entity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/OptionStatus -type OptionStatus struct { - _ struct{} `type:"structure"` - - // Timestamp which tells the creation date for the entity. - // - // CreationDate is a required field - CreationDate *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // Indicates whether the Elasticsearch domain is being deleted. - PendingDeletion *bool `type:"boolean"` - - // Provides the OptionState for the Elasticsearch domain. - // - // State is a required field - State *string `type:"string" required:"true" enum:"OptionState"` - - // Timestamp which tells the last updated time for the entity. - // - // UpdateDate is a required field - UpdateDate *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // Specifies the latest version for the entity. - UpdateVersion *int64 `type:"integer"` -} - -// String returns the string representation -func (s OptionStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionStatus) GoString() string { - return s.String() -} - -// SetCreationDate sets the CreationDate field's value. -func (s *OptionStatus) SetCreationDate(v time.Time) *OptionStatus { - s.CreationDate = &v - return s -} - -// SetPendingDeletion sets the PendingDeletion field's value. -func (s *OptionStatus) SetPendingDeletion(v bool) *OptionStatus { - s.PendingDeletion = &v - return s -} - -// SetState sets the State field's value. -func (s *OptionStatus) SetState(v string) *OptionStatus { - s.State = &v - return s -} - -// SetUpdateDate sets the UpdateDate field's value. -func (s *OptionStatus) SetUpdateDate(v time.Time) *OptionStatus { - s.UpdateDate = &v - return s -} - -// SetUpdateVersion sets the UpdateVersion field's value. -func (s *OptionStatus) SetUpdateVersion(v int64) *OptionStatus { - s.UpdateVersion = &v - return s -} - -// Container for the parameters to the RemoveTags operation. Specify the ARN -// for the Elasticsearch domain from which you want to remove the specified -// TagKey. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RemoveTagsRequest -type RemoveTagsInput struct { - _ struct{} `type:"structure"` - - // Specifies the ARN for the Elasticsearch domain from which you want to delete - // the specified tags. - // - // ARN is a required field - ARN *string `type:"string" required:"true"` - - // Specifies the TagKey list which you want to remove from the Elasticsearch - // domain. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"} - if s.ARN == nil { - invalidParams.Add(request.NewErrParamRequired("ARN")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetARN sets the ARN field's value. -func (s *RemoveTagsInput) SetARN(v string) *RemoveTagsInput { - s.ARN = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsInput) SetTagKeys(v []*string) *RemoveTagsInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RemoveTagsOutput -type RemoveTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsOutput) GoString() string { - return s.String() -} - -// Specifies the time, in UTC format, when the service takes a daily automated -// snapshot of the specified Elasticsearch domain. Default value is 0 hours. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/SnapshotOptions -type SnapshotOptions struct { - _ struct{} `type:"structure"` - - // Specifies the time, in UTC format, when the service takes a daily automated - // snapshot of the specified Elasticsearch domain. Default value is 0 hours. - AutomatedSnapshotStartHour *int64 `type:"integer"` -} - -// String returns the string representation -func (s SnapshotOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotOptions) GoString() string { - return s.String() -} - -// SetAutomatedSnapshotStartHour sets the AutomatedSnapshotStartHour field's value. -func (s *SnapshotOptions) SetAutomatedSnapshotStartHour(v int64) *SnapshotOptions { - s.AutomatedSnapshotStartHour = &v - return s -} - -// Status of a daily automated snapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/SnapshotOptionsStatus -type SnapshotOptionsStatus struct { - _ struct{} `type:"structure"` - - // Specifies the daily snapshot options specified for the Elasticsearch domain. - // - // Options is a required field - Options *SnapshotOptions `type:"structure" required:"true"` - - // Specifies the status of a daily automated snapshot. - // - // Status is a required field - Status *OptionStatus `type:"structure" required:"true"` -} - -// String returns the string representation -func (s SnapshotOptionsStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotOptionsStatus) GoString() string { - return s.String() -} - -// SetOptions sets the Options field's value. -func (s *SnapshotOptionsStatus) SetOptions(v *SnapshotOptions) *SnapshotOptionsStatus { - s.Options = v - return s -} - -// SetStatus sets the Status field's value. -func (s *SnapshotOptionsStatus) SetStatus(v *OptionStatus) *SnapshotOptionsStatus { - s.Status = v - return s -} - -// StorageTypes represents the list of storage related types and their attributes -// that are available for given InstanceType. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/StorageType -type StorageType struct { - _ struct{} `type:"structure"` - - // SubType of the given storage type. List of available sub-storage options: - // For "instance" storageType we wont have any storageSubType, in case of "ebs" - // storageType we will have following valid storageSubTypes standard - // gp2 - // io1 - // Refer VolumeType for more information regarding above EBS storage options. - StorageSubTypeName *string `type:"string"` - - // List of limits that are applicable for given storage type. - StorageTypeLimits []*StorageTypeLimit `type:"list"` - - // Type of the storage. List of available storage options: instance - // Inbuilt storage available for the given Instance ebs - // Elastic block storage that would be attached to the given Instance - StorageTypeName *string `type:"string"` -} - -// String returns the string representation -func (s StorageType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StorageType) GoString() string { - return s.String() -} - -// SetStorageSubTypeName sets the StorageSubTypeName field's value. -func (s *StorageType) SetStorageSubTypeName(v string) *StorageType { - s.StorageSubTypeName = &v - return s -} - -// SetStorageTypeLimits sets the StorageTypeLimits field's value. -func (s *StorageType) SetStorageTypeLimits(v []*StorageTypeLimit) *StorageType { - s.StorageTypeLimits = v - return s -} - -// SetStorageTypeName sets the StorageTypeName field's value. -func (s *StorageType) SetStorageTypeName(v string) *StorageType { - s.StorageTypeName = &v - return s -} - -// Limits that are applicable for given storage type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/StorageTypeLimit -type StorageTypeLimit struct { - _ struct{} `type:"structure"` - - // Name of storage limits that are applicable for given storage type. If StorageType - // is ebs, following storage options are applicable MinimumVolumeSize - // Minimum amount of volume size that is applicable for given storage type.It - // can be empty if it is not applicable. MaximumVolumeSize - // Maximum amount of volume size that is applicable for given storage type.It - // can be empty if it is not applicable. MaximumIops - // Maximum amount of Iops that is applicable for given storage type.It can - // be empty if it is not applicable. MinimumIops - // Minimum amount of Iops that is applicable for given storage type.It can - // be empty if it is not applicable. - LimitName *string `type:"string"` - - // Values for the StorageTypeLimit$LimitName . - LimitValues []*string `type:"list"` -} - -// String returns the string representation -func (s StorageTypeLimit) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StorageTypeLimit) GoString() string { - return s.String() -} - -// SetLimitName sets the LimitName field's value. -func (s *StorageTypeLimit) SetLimitName(v string) *StorageTypeLimit { - s.LimitName = &v - return s -} - -// SetLimitValues sets the LimitValues field's value. -func (s *StorageTypeLimit) SetLimitValues(v []*string) *StorageTypeLimit { - s.LimitValues = v - return s -} - -// Specifies a key value pair for a resource tag. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // Specifies the TagKey, the name of the tag. Tag keys must be unique for the - // Elasticsearch domain to which they are attached. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // Specifies the TagValue, the value assigned to the corresponding tag key. - // Tag values can be null and do not have to be unique in a tag set. For example, - // you can have a key value pair in a tag set of project : Trinity and cost-center - // : Trinity - // - // 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 -} - -// Container for the parameters to the UpdateElasticsearchDomain operation. -// Specifies the type and number of instances in the domain cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdateElasticsearchDomainConfigRequest -type UpdateElasticsearchDomainConfigInput struct { - _ struct{} `type:"structure"` - - // IAM access policy as a JSON-formatted string. - AccessPolicies *string `type:"string"` - - // Modifies the advanced option to allow references to indices in an HTTP request - // body. Must be false when configuring access to individual sub-resources. - // By default, the value is true. See Configuration Advanced Options (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options) - // for more information. - AdvancedOptions map[string]*string `type:"map"` - - // The name of the Elasticsearch domain that you are updating. - // - // DomainName is a required field - DomainName *string `location:"uri" locationName:"DomainName" min:"3" type:"string" required:"true"` - - // Specify the type and size of the EBS volume that you want to use. - EBSOptions *EBSOptions `type:"structure"` - - // The type and number of instances to instantiate for the domain cluster. - ElasticsearchClusterConfig *ElasticsearchClusterConfig `type:"structure"` - - // Option to set the time, in UTC format, for the daily automated snapshot. - // Default value is 0 hours. - SnapshotOptions *SnapshotOptions `type:"structure"` -} - -// String returns the string representation -func (s UpdateElasticsearchDomainConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateElasticsearchDomainConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateElasticsearchDomainConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateElasticsearchDomainConfigInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.DomainName != nil && len(*s.DomainName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessPolicies sets the AccessPolicies field's value. -func (s *UpdateElasticsearchDomainConfigInput) SetAccessPolicies(v string) *UpdateElasticsearchDomainConfigInput { - s.AccessPolicies = &v - return s -} - -// SetAdvancedOptions sets the AdvancedOptions field's value. -func (s *UpdateElasticsearchDomainConfigInput) SetAdvancedOptions(v map[string]*string) *UpdateElasticsearchDomainConfigInput { - s.AdvancedOptions = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *UpdateElasticsearchDomainConfigInput) SetDomainName(v string) *UpdateElasticsearchDomainConfigInput { - s.DomainName = &v - return s -} - -// SetEBSOptions sets the EBSOptions field's value. -func (s *UpdateElasticsearchDomainConfigInput) SetEBSOptions(v *EBSOptions) *UpdateElasticsearchDomainConfigInput { - s.EBSOptions = v - return s -} - -// SetElasticsearchClusterConfig sets the ElasticsearchClusterConfig field's value. -func (s *UpdateElasticsearchDomainConfigInput) SetElasticsearchClusterConfig(v *ElasticsearchClusterConfig) *UpdateElasticsearchDomainConfigInput { - s.ElasticsearchClusterConfig = v - return s -} - -// SetSnapshotOptions sets the SnapshotOptions field's value. -func (s *UpdateElasticsearchDomainConfigInput) SetSnapshotOptions(v *SnapshotOptions) *UpdateElasticsearchDomainConfigInput { - s.SnapshotOptions = v - return s -} - -// The result of an UpdateElasticsearchDomain request. Contains the status of -// the Elasticsearch domain being updated. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdateElasticsearchDomainConfigResponse -type UpdateElasticsearchDomainConfigOutput struct { - _ struct{} `type:"structure"` - - // The status of the updated Elasticsearch domain. - // - // DomainConfig is a required field - DomainConfig *ElasticsearchDomainConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateElasticsearchDomainConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateElasticsearchDomainConfigOutput) GoString() string { - return s.String() -} - -// SetDomainConfig sets the DomainConfig field's value. -func (s *UpdateElasticsearchDomainConfigOutput) SetDomainConfig(v *ElasticsearchDomainConfig) *UpdateElasticsearchDomainConfigOutput { - s.DomainConfig = v - return s -} - -const ( - // ESPartitionInstanceTypeM3MediumElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM3MediumElasticsearch = "m3.medium.elasticsearch" - - // ESPartitionInstanceTypeM3LargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM3LargeElasticsearch = "m3.large.elasticsearch" - - // ESPartitionInstanceTypeM3XlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM3XlargeElasticsearch = "m3.xlarge.elasticsearch" - - // ESPartitionInstanceTypeM32xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM32xlargeElasticsearch = "m3.2xlarge.elasticsearch" - - // ESPartitionInstanceTypeM4LargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM4LargeElasticsearch = "m4.large.elasticsearch" - - // ESPartitionInstanceTypeM4XlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM4XlargeElasticsearch = "m4.xlarge.elasticsearch" - - // ESPartitionInstanceTypeM42xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM42xlargeElasticsearch = "m4.2xlarge.elasticsearch" - - // ESPartitionInstanceTypeM44xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM44xlargeElasticsearch = "m4.4xlarge.elasticsearch" - - // ESPartitionInstanceTypeM410xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeM410xlargeElasticsearch = "m4.10xlarge.elasticsearch" - - // ESPartitionInstanceTypeT2MicroElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeT2MicroElasticsearch = "t2.micro.elasticsearch" - - // ESPartitionInstanceTypeT2SmallElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeT2SmallElasticsearch = "t2.small.elasticsearch" - - // ESPartitionInstanceTypeT2MediumElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeT2MediumElasticsearch = "t2.medium.elasticsearch" - - // ESPartitionInstanceTypeR3LargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR3LargeElasticsearch = "r3.large.elasticsearch" - - // ESPartitionInstanceTypeR3XlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR3XlargeElasticsearch = "r3.xlarge.elasticsearch" - - // ESPartitionInstanceTypeR32xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR32xlargeElasticsearch = "r3.2xlarge.elasticsearch" - - // ESPartitionInstanceTypeR34xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR34xlargeElasticsearch = "r3.4xlarge.elasticsearch" - - // ESPartitionInstanceTypeR38xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR38xlargeElasticsearch = "r3.8xlarge.elasticsearch" - - // ESPartitionInstanceTypeI2XlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeI2XlargeElasticsearch = "i2.xlarge.elasticsearch" - - // ESPartitionInstanceTypeI22xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeI22xlargeElasticsearch = "i2.2xlarge.elasticsearch" - - // ESPartitionInstanceTypeD2XlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeD2XlargeElasticsearch = "d2.xlarge.elasticsearch" - - // ESPartitionInstanceTypeD22xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeD22xlargeElasticsearch = "d2.2xlarge.elasticsearch" - - // ESPartitionInstanceTypeD24xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeD24xlargeElasticsearch = "d2.4xlarge.elasticsearch" - - // ESPartitionInstanceTypeD28xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeD28xlargeElasticsearch = "d2.8xlarge.elasticsearch" - - // ESPartitionInstanceTypeC4LargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeC4LargeElasticsearch = "c4.large.elasticsearch" - - // ESPartitionInstanceTypeC4XlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeC4XlargeElasticsearch = "c4.xlarge.elasticsearch" - - // ESPartitionInstanceTypeC42xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeC42xlargeElasticsearch = "c4.2xlarge.elasticsearch" - - // ESPartitionInstanceTypeC44xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeC44xlargeElasticsearch = "c4.4xlarge.elasticsearch" - - // ESPartitionInstanceTypeC48xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeC48xlargeElasticsearch = "c4.8xlarge.elasticsearch" - - // ESPartitionInstanceTypeR4LargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR4LargeElasticsearch = "r4.large.elasticsearch" - - // ESPartitionInstanceTypeR4XlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR4XlargeElasticsearch = "r4.xlarge.elasticsearch" - - // ESPartitionInstanceTypeR42xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR42xlargeElasticsearch = "r4.2xlarge.elasticsearch" - - // ESPartitionInstanceTypeR44xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR44xlargeElasticsearch = "r4.4xlarge.elasticsearch" - - // ESPartitionInstanceTypeR48xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR48xlargeElasticsearch = "r4.8xlarge.elasticsearch" - - // ESPartitionInstanceTypeR416xlargeElasticsearch is a ESPartitionInstanceType enum value - ESPartitionInstanceTypeR416xlargeElasticsearch = "r4.16xlarge.elasticsearch" -) - -// The state of a requested change. One of the following: -// -// * Processing: The request change is still in-process. -// * Active: The request change is processed and deployed to the Elasticsearch -// domain. -const ( - // OptionStateRequiresIndexDocuments is a OptionState enum value - OptionStateRequiresIndexDocuments = "RequiresIndexDocuments" - - // OptionStateProcessing is a OptionState enum value - OptionStateProcessing = "Processing" - - // OptionStateActive is a OptionState enum value - OptionStateActive = "Active" -) - -// The type of EBS volume, standard, gp2, or io1. See Configuring EBS-based -// Storage (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-ebs)for -// more information. -const ( - // VolumeTypeStandard is a VolumeType enum value - VolumeTypeStandard = "standard" - - // VolumeTypeGp2 is a VolumeType enum value - VolumeTypeGp2 = "gp2" - - // VolumeTypeIo1 is a VolumeType enum value - VolumeTypeIo1 = "io1" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go deleted file mode 100644 index 66c1650..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go +++ /dev/null @@ -1,62 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elasticsearchservice - -const ( - - // ErrCodeBaseException for service response error code - // "BaseException". - // - // An error occurred while processing the request. - ErrCodeBaseException = "BaseException" - - // ErrCodeDisabledOperationException for service response error code - // "DisabledOperationException". - // - // An error occured because the client wanted to access a not supported operation. - // Gives http status code of 409. - ErrCodeDisabledOperationException = "DisabledOperationException" - - // ErrCodeInternalException for service response error code - // "InternalException". - // - // The request processing has failed because of an unknown error, exception - // or failure (the failure is internal to the service) . Gives http status code - // of 500. - ErrCodeInternalException = "InternalException" - - // ErrCodeInvalidTypeException for service response error code - // "InvalidTypeException". - // - // An exception for trying to create or access sub-resource that is either invalid - // or not supported. Gives http status code of 409. - ErrCodeInvalidTypeException = "InvalidTypeException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // An exception for trying to create more than allowed resources or sub-resources. - // Gives http status code of 409. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeResourceAlreadyExistsException for service response error code - // "ResourceAlreadyExistsException". - // - // An exception for creating a resource that already exists. Gives http status - // code of 400. - ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // An exception for accessing or deleting a resource that does not exist. Gives - // http status code of 400. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // An exception for missing / invalid input fields. Gives http status code of - // 400. - ErrCodeValidationException = "ValidationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go deleted file mode 100644 index 8ba1f8b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go +++ /dev/null @@ -1,96 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elasticsearchservice - -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" -) - -// Use the Amazon Elasticsearch configuration API to create, configure, and -// manage Elasticsearch domains. -// -// The endpoint for configuration service requests is region-specific: es.region.amazonaws.com. -// For example, es.us-east-1.amazonaws.com. For a current list of supported -// regions and endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticsearch-service-regions). -// 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/es-2015-01-01 -type ElasticsearchService 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 = "es" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ElasticsearchService 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 ElasticsearchService client from just a session. -// svc := elasticsearchservice.New(mySession) -// -// // Create a ElasticsearchService client with additional configuration -// svc := elasticsearchservice.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ElasticsearchService { - 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) *ElasticsearchService { - svc := &ElasticsearchService{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ElasticsearchService operation and runs any -// custom request initialization. -func (c *ElasticsearchService) 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/api.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go deleted file mode 100644 index df4a299..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go +++ /dev/null @@ -1,7666 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elastictranscoder provides a client for Amazon Elastic Transcoder. -package elastictranscoder - -import ( - "fmt" - - "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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListJobsByPipelineOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListJobsByPipelineRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListJobsByPipelineOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListJobsByStatusOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListJobsByStatusRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListJobsByStatusOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListPipelinesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPipelinesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPipelinesOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListPresetsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPresetsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPresetsOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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 18374bc..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go +++ /dev/null @@ -1,51 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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/service.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go deleted file mode 100644 index bbd6e24..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go +++ /dev/null @@ -1,90 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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 7674620..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/waiters.go +++ /dev/null @@ -1,46 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elastictranscoder - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// 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 { - waiterCfg := waiter.Config{ - Operation: "ReadJob", - Delay: 30, - MaxAttempts: 120, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "Job.Status", - Expected: "Complete", - }, - { - State: "failure", - Matcher: "path", - Argument: "Job.Status", - Expected: "Canceled", - }, - { - State: "failure", - Matcher: "path", - Argument: "Job.Status", - Expected: "Error", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go deleted file mode 100644 index b8c6d42..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go +++ /dev/null @@ -1,5943 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elb provides a client for Elastic Load Balancing. -package elb - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAddTags = "AddTags" - -// AddTagsRequest generates a "aws/request.Request" representing the -// client's request for the AddTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsRequest method. -// req, resp := client.AddTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTags -func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { - op := &request.Operation{ - Name: opAddTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsInput{} - } - - output = &AddTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddTags API operation for Elastic Load Balancing. -// -// Adds the specified tags to the specified load balancer. Each load balancer -// can have a maximum of 10 tags. -// -// Each tag consists of a key and an optional value. If a tag with the same -// key is already associated with the load balancer, AddTags updates its value. -// -// For more information, see Tag Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation AddTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeTooManyTagsException "TooManyTags" -// The quota for the number of tags that can be assigned to a load balancer -// has been reached. -// -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeys" -// A tag key was specified more than once. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTags -func (c *ELB) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { - req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err -} - -const opApplySecurityGroupsToLoadBalancer = "ApplySecurityGroupsToLoadBalancer" - -// ApplySecurityGroupsToLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the ApplySecurityGroupsToLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ApplySecurityGroupsToLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ApplySecurityGroupsToLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ApplySecurityGroupsToLoadBalancerRequest method. -// req, resp := client.ApplySecurityGroupsToLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancer -func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroupsToLoadBalancerInput) (req *request.Request, output *ApplySecurityGroupsToLoadBalancerOutput) { - op := &request.Operation{ - Name: opApplySecurityGroupsToLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ApplySecurityGroupsToLoadBalancerInput{} - } - - output = &ApplySecurityGroupsToLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// ApplySecurityGroupsToLoadBalancer API operation for Elastic Load Balancing. -// -// Associates one or more security groups with your load balancer in a virtual -// private cloud (VPC). The specified security groups override the previously -// associated security groups. -// -// For more information, see Security Groups for Load Balancers in a VPC (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html#elb-vpc-security-groups) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation ApplySecurityGroupsToLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// * ErrCodeInvalidSecurityGroupException "InvalidSecurityGroup" -// One or more of the specified security groups do not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancer -func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoadBalancerInput) (*ApplySecurityGroupsToLoadBalancerOutput, error) { - req, out := c.ApplySecurityGroupsToLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opAttachLoadBalancerToSubnets = "AttachLoadBalancerToSubnets" - -// AttachLoadBalancerToSubnetsRequest generates a "aws/request.Request" representing the -// client's request for the AttachLoadBalancerToSubnets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachLoadBalancerToSubnets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachLoadBalancerToSubnets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachLoadBalancerToSubnetsRequest method. -// req, resp := client.AttachLoadBalancerToSubnetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnets -func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubnetsInput) (req *request.Request, output *AttachLoadBalancerToSubnetsOutput) { - op := &request.Operation{ - Name: opAttachLoadBalancerToSubnets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachLoadBalancerToSubnetsInput{} - } - - output = &AttachLoadBalancerToSubnetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachLoadBalancerToSubnets API operation for Elastic Load Balancing. -// -// Adds one or more subnets to the set of configured subnets for the specified -// load balancer. -// -// The load balancer evenly distributes requests across all registered subnets. -// For more information, see Add or Remove Subnets for Your Load Balancer in -// a VPC (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-manage-subnets.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation AttachLoadBalancerToSubnets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// * ErrCodeSubnetNotFoundException "SubnetNotFound" -// One or more of the specified subnets do not exist. -// -// * ErrCodeInvalidSubnetException "InvalidSubnet" -// The specified VPC has no associated Internet gateway. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnets -func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInput) (*AttachLoadBalancerToSubnetsOutput, error) { - req, out := c.AttachLoadBalancerToSubnetsRequest(input) - err := req.Send() - return out, err -} - -const opConfigureHealthCheck = "ConfigureHealthCheck" - -// ConfigureHealthCheckRequest generates a "aws/request.Request" representing the -// client's request for the ConfigureHealthCheck operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ConfigureHealthCheck for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ConfigureHealthCheck method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ConfigureHealthCheckRequest method. -// req, resp := client.ConfigureHealthCheckRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheck -func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req *request.Request, output *ConfigureHealthCheckOutput) { - op := &request.Operation{ - Name: opConfigureHealthCheck, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ConfigureHealthCheckInput{} - } - - output = &ConfigureHealthCheckOutput{} - req = c.newRequest(op, input, output) - return -} - -// ConfigureHealthCheck API operation for Elastic Load Balancing. -// -// Specifies the health check settings to use when evaluating the health state -// of your EC2 instances. -// -// For more information, see Configure Health Checks for Your Load Balancer -// (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation ConfigureHealthCheck for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheck -func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (*ConfigureHealthCheckOutput, error) { - req, out := c.ConfigureHealthCheckRequest(input) - err := req.Send() - return out, err -} - -const opCreateAppCookieStickinessPolicy = "CreateAppCookieStickinessPolicy" - -// CreateAppCookieStickinessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreateAppCookieStickinessPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAppCookieStickinessPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAppCookieStickinessPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAppCookieStickinessPolicyRequest method. -// req, resp := client.CreateAppCookieStickinessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicy -func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStickinessPolicyInput) (req *request.Request, output *CreateAppCookieStickinessPolicyOutput) { - op := &request.Operation{ - Name: opCreateAppCookieStickinessPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAppCookieStickinessPolicyInput{} - } - - output = &CreateAppCookieStickinessPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAppCookieStickinessPolicy API operation for Elastic Load Balancing. -// -// Generates a stickiness policy with sticky session lifetimes that follow that -// of an application-generated cookie. This policy can be associated only with -// HTTP/HTTPS listeners. -// -// This policy is similar to the policy created by CreateLBCookieStickinessPolicy, -// except that the lifetime of the special Elastic Load Balancing cookie, AWSELB, -// follows the lifetime of the application-generated cookie specified in the -// policy configuration. The load balancer only inserts a new stickiness cookie -// when the application response includes a new application cookie. -// -// If the application cookie is explicitly removed or expires, the session stops -// being sticky until a new application cookie is issued. -// -// For more information, see Application-Controlled Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation CreateAppCookieStickinessPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" -// A policy with the specified name already exists for this load balancer. -// -// * ErrCodeTooManyPoliciesException "TooManyPolicies" -// The quota for the number of policies for this load balancer has been reached. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicy -func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPolicyInput) (*CreateAppCookieStickinessPolicyOutput, error) { - req, out := c.CreateAppCookieStickinessPolicyRequest(input) - err := req.Send() - return out, err -} - -const opCreateLBCookieStickinessPolicy = "CreateLBCookieStickinessPolicy" - -// CreateLBCookieStickinessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreateLBCookieStickinessPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLBCookieStickinessPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLBCookieStickinessPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLBCookieStickinessPolicyRequest method. -// req, resp := client.CreateLBCookieStickinessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicy -func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickinessPolicyInput) (req *request.Request, output *CreateLBCookieStickinessPolicyOutput) { - op := &request.Operation{ - Name: opCreateLBCookieStickinessPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLBCookieStickinessPolicyInput{} - } - - output = &CreateLBCookieStickinessPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLBCookieStickinessPolicy API operation for Elastic Load Balancing. -// -// Generates a stickiness policy with sticky session lifetimes controlled by -// the lifetime of the browser (user-agent) or a specified expiration period. -// This policy can be associated only with HTTP/HTTPS listeners. -// -// When a load balancer implements this policy, the load balancer uses a special -// cookie to track the instance for each request. When the load balancer receives -// a request, it first checks to see if this cookie is present in the request. -// If so, the load balancer sends the request to the application server specified -// in the cookie. If not, the load balancer sends the request to a server that -// is chosen based on the existing load-balancing algorithm. -// -// A cookie is inserted into the response for binding subsequent requests from -// the same user to that server. The validity of the cookie is based on the -// cookie expiration time, which is specified in the policy configuration. -// -// For more information, see Duration-Based Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation CreateLBCookieStickinessPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" -// A policy with the specified name already exists for this load balancer. -// -// * ErrCodeTooManyPoliciesException "TooManyPolicies" -// The quota for the number of policies for this load balancer has been reached. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicy -func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPolicyInput) (*CreateLBCookieStickinessPolicyOutput, error) { - req, out := c.CreateLBCookieStickinessPolicyRequest(input) - err := req.Send() - return out, err -} - -const opCreateLoadBalancer = "CreateLoadBalancer" - -// CreateLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the CreateLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLoadBalancerRequest method. -// req, resp := client.CreateLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancer -func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *request.Request, output *CreateLoadBalancerOutput) { - op := &request.Operation{ - Name: opCreateLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLoadBalancerInput{} - } - - output = &CreateLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLoadBalancer API operation for Elastic Load Balancing. -// -// Creates a Classic load balancer. -// -// You can add listeners, security groups, subnets, and tags when you create -// your load balancer, or you can add them later using CreateLoadBalancerListeners, -// ApplySecurityGroupsToLoadBalancer, AttachLoadBalancerToSubnets, and AddTags. -// -// To describe your current load balancers, see DescribeLoadBalancers. When -// you are finished with a load balancer, you can delete it using DeleteLoadBalancer. -// -// You can create up to 20 load balancers per region per account. You can request -// an increase for the number of load balancers for your account. For more information, -// see Limits for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation CreateLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDuplicateAccessPointNameException "DuplicateLoadBalancerName" -// The specified load balancer name already exists for this account. -// -// * ErrCodeTooManyAccessPointsException "TooManyLoadBalancers" -// The quota for the number of load balancers has been reached. -// -// * ErrCodeCertificateNotFoundException "CertificateNotFound" -// The specified ARN does not refer to a valid SSL certificate in AWS Identity -// and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if -// you recently uploaded the certificate to IAM, this error might indicate that -// the certificate is not fully available yet. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// * ErrCodeSubnetNotFoundException "SubnetNotFound" -// One or more of the specified subnets do not exist. -// -// * ErrCodeInvalidSubnetException "InvalidSubnet" -// The specified VPC has no associated Internet gateway. -// -// * ErrCodeInvalidSecurityGroupException "InvalidSecurityGroup" -// One or more of the specified security groups do not exist. -// -// * ErrCodeInvalidSchemeException "InvalidScheme" -// The specified value for the schema is not valid. You can only specify a scheme -// for load balancers in a VPC. -// -// * ErrCodeTooManyTagsException "TooManyTags" -// The quota for the number of tags that can be assigned to a load balancer -// has been reached. -// -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeys" -// A tag key was specified more than once. -// -// * ErrCodeUnsupportedProtocolException "UnsupportedProtocol" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancer -func (c *ELB) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) { - req, out := c.CreateLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opCreateLoadBalancerListeners = "CreateLoadBalancerListeners" - -// CreateLoadBalancerListenersRequest generates a "aws/request.Request" representing the -// client's request for the CreateLoadBalancerListeners operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLoadBalancerListeners for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLoadBalancerListeners method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLoadBalancerListenersRequest method. -// req, resp := client.CreateLoadBalancerListenersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListeners -func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListenersInput) (req *request.Request, output *CreateLoadBalancerListenersOutput) { - op := &request.Operation{ - Name: opCreateLoadBalancerListeners, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLoadBalancerListenersInput{} - } - - output = &CreateLoadBalancerListenersOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLoadBalancerListeners API operation for Elastic Load Balancing. -// -// Creates one or more listeners for the specified load balancer. If a listener -// with the specified port does not already exist, it is created; otherwise, -// the properties of the new listener must match the properties of the existing -// listener. -// -// For more information, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation CreateLoadBalancerListeners for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeDuplicateListenerException "DuplicateListener" -// A listener already exists for the specified load balancer name and port, -// but with a different instance port, protocol, or SSL certificate. -// -// * ErrCodeCertificateNotFoundException "CertificateNotFound" -// The specified ARN does not refer to a valid SSL certificate in AWS Identity -// and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if -// you recently uploaded the certificate to IAM, this error might indicate that -// the certificate is not fully available yet. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// * ErrCodeUnsupportedProtocolException "UnsupportedProtocol" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListeners -func (c *ELB) CreateLoadBalancerListeners(input *CreateLoadBalancerListenersInput) (*CreateLoadBalancerListenersOutput, error) { - req, out := c.CreateLoadBalancerListenersRequest(input) - err := req.Send() - return out, err -} - -const opCreateLoadBalancerPolicy = "CreateLoadBalancerPolicy" - -// CreateLoadBalancerPolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreateLoadBalancerPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLoadBalancerPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLoadBalancerPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLoadBalancerPolicyRequest method. -// req, resp := client.CreateLoadBalancerPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicy -func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInput) (req *request.Request, output *CreateLoadBalancerPolicyOutput) { - op := &request.Operation{ - Name: opCreateLoadBalancerPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLoadBalancerPolicyInput{} - } - - output = &CreateLoadBalancerPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLoadBalancerPolicy API operation for Elastic Load Balancing. -// -// Creates a policy with the specified attributes for the specified load balancer. -// -// Policies are settings that are saved for your load balancer and that can -// be applied to the listener or the application server, depending on the policy -// 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 Elastic Load Balancing's -// API operation CreateLoadBalancerPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodePolicyTypeNotFoundException "PolicyTypeNotFound" -// One or more of the specified policy types do not exist. -// -// * ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" -// A policy with the specified name already exists for this load balancer. -// -// * ErrCodeTooManyPoliciesException "TooManyPolicies" -// The quota for the number of policies for this load balancer has been reached. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicy -func (c *ELB) CreateLoadBalancerPolicy(input *CreateLoadBalancerPolicyInput) (*CreateLoadBalancerPolicyOutput, error) { - req, out := c.CreateLoadBalancerPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLoadBalancer = "DeleteLoadBalancer" - -// DeleteLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLoadBalancerRequest method. -// req, resp := client.DeleteLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancer -func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *request.Request, output *DeleteLoadBalancerOutput) { - op := &request.Operation{ - Name: opDeleteLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLoadBalancerInput{} - } - - output = &DeleteLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteLoadBalancer API operation for Elastic Load Balancing. -// -// Deletes the specified load balancer. -// -// If you are attempting to recreate a load balancer, you must reconfigure all -// settings. The DNS name associated with a deleted load balancer are no longer -// usable. The name and associated DNS record of the deleted load balancer no -// longer exist and traffic sent to any of its IP addresses is no longer delivered -// to your instances. -// -// If the load balancer does not exist or has already been deleted, the call -// to DeleteLoadBalancer still succeeds. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DeleteLoadBalancer for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancer -func (c *ELB) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (*DeleteLoadBalancerOutput, error) { - req, out := c.DeleteLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLoadBalancerListeners = "DeleteLoadBalancerListeners" - -// DeleteLoadBalancerListenersRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLoadBalancerListeners operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLoadBalancerListeners for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLoadBalancerListeners method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLoadBalancerListenersRequest method. -// req, resp := client.DeleteLoadBalancerListenersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListeners -func (c *ELB) DeleteLoadBalancerListenersRequest(input *DeleteLoadBalancerListenersInput) (req *request.Request, output *DeleteLoadBalancerListenersOutput) { - op := &request.Operation{ - Name: opDeleteLoadBalancerListeners, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLoadBalancerListenersInput{} - } - - output = &DeleteLoadBalancerListenersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteLoadBalancerListeners API operation for Elastic Load Balancing. -// -// Deletes the specified listeners from the specified load balancer. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DeleteLoadBalancerListeners for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListeners -func (c *ELB) DeleteLoadBalancerListeners(input *DeleteLoadBalancerListenersInput) (*DeleteLoadBalancerListenersOutput, error) { - req, out := c.DeleteLoadBalancerListenersRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLoadBalancerPolicy = "DeleteLoadBalancerPolicy" - -// DeleteLoadBalancerPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLoadBalancerPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLoadBalancerPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLoadBalancerPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLoadBalancerPolicyRequest method. -// req, resp := client.DeleteLoadBalancerPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicy -func (c *ELB) DeleteLoadBalancerPolicyRequest(input *DeleteLoadBalancerPolicyInput) (req *request.Request, output *DeleteLoadBalancerPolicyOutput) { - op := &request.Operation{ - Name: opDeleteLoadBalancerPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLoadBalancerPolicyInput{} - } - - output = &DeleteLoadBalancerPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteLoadBalancerPolicy API operation for Elastic Load Balancing. -// -// Deletes the specified policy from the specified load balancer. This policy -// must not be enabled for any listeners. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DeleteLoadBalancerPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicy -func (c *ELB) DeleteLoadBalancerPolicy(input *DeleteLoadBalancerPolicyInput) (*DeleteLoadBalancerPolicyOutput, error) { - req, out := c.DeleteLoadBalancerPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterInstancesFromLoadBalancer = "DeregisterInstancesFromLoadBalancer" - -// DeregisterInstancesFromLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterInstancesFromLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterInstancesFromLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterInstancesFromLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterInstancesFromLoadBalancerRequest method. -// req, resp := client.DeregisterInstancesFromLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterInstancesFromLoadBalancer -func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstancesFromLoadBalancerInput) (req *request.Request, output *DeregisterInstancesFromLoadBalancerOutput) { - op := &request.Operation{ - Name: opDeregisterInstancesFromLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterInstancesFromLoadBalancerInput{} - } - - output = &DeregisterInstancesFromLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterInstancesFromLoadBalancer API operation for Elastic Load Balancing. -// -// Deregisters the specified instances from the specified load balancer. After -// the instance is deregistered, it no longer receives traffic from the load -// balancer. -// -// You can use DescribeLoadBalancers to verify that the instance is deregistered -// from the load balancer. -// -// For more information, see Register or De-Register EC2 Instances (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation DeregisterInstancesFromLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidEndPointException "InvalidInstance" -// The specified endpoint is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterInstancesFromLoadBalancer -func (c *ELB) DeregisterInstancesFromLoadBalancer(input *DeregisterInstancesFromLoadBalancerInput) (*DeregisterInstancesFromLoadBalancerOutput, error) { - req, out := c.DeregisterInstancesFromLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opDescribeInstanceHealth = "DescribeInstanceHealth" - -// DescribeInstanceHealthRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstanceHealth operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstanceHealth for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstanceHealth method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstanceHealthRequest method. -// req, resp := client.DescribeInstanceHealthRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeInstanceHealth -func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) (req *request.Request, output *DescribeInstanceHealthOutput) { - op := &request.Operation{ - Name: opDescribeInstanceHealth, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceHealthInput{} - } - - output = &DescribeInstanceHealthOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstanceHealth API operation for Elastic Load Balancing. -// -// Describes the state of the specified instances with respect to the specified -// load balancer. If no instances are specified, the call describes the state -// of all instances that are currently registered with the load balancer. If -// instances are specified, their state is returned even if they are no longer -// registered with the load balancer. The state of terminated instances is not -// 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 Elastic Load Balancing's -// API operation DescribeInstanceHealth for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidEndPointException "InvalidInstance" -// The specified endpoint is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeInstanceHealth -func (c *ELB) DescribeInstanceHealth(input *DescribeInstanceHealthInput) (*DescribeInstanceHealthOutput, error) { - req, out := c.DescribeInstanceHealthRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" - -// DescribeLoadBalancerAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBalancerAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBalancerAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBalancerAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBalancerAttributesRequest method. -// req, resp := client.DescribeLoadBalancerAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributes -func (c *ELB) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerAttributesInput) (req *request.Request, output *DescribeLoadBalancerAttributesOutput) { - op := &request.Operation{ - Name: opDescribeLoadBalancerAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLoadBalancerAttributesInput{} - } - - output = &DescribeLoadBalancerAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBalancerAttributes API operation for Elastic Load Balancing. -// -// Describes the attributes for the specified load balancer. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeLoadBalancerAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeLoadBalancerAttributeNotFoundException "LoadBalancerAttributeNotFound" -// The specified load balancer attribute does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributes -func (c *ELB) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttributesInput) (*DescribeLoadBalancerAttributesOutput, error) { - req, out := c.DescribeLoadBalancerAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLoadBalancerPolicies = "DescribeLoadBalancerPolicies" - -// DescribeLoadBalancerPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBalancerPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBalancerPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBalancerPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBalancerPoliciesRequest method. -// req, resp := client.DescribeLoadBalancerPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicies -func (c *ELB) DescribeLoadBalancerPoliciesRequest(input *DescribeLoadBalancerPoliciesInput) (req *request.Request, output *DescribeLoadBalancerPoliciesOutput) { - op := &request.Operation{ - Name: opDescribeLoadBalancerPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLoadBalancerPoliciesInput{} - } - - output = &DescribeLoadBalancerPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBalancerPolicies API operation for Elastic Load Balancing. -// -// Describes the specified policies. -// -// If you specify a load balancer name, the action returns the descriptions -// of all policies created for the load balancer. If you specify a policy name -// associated with your load balancer, the action returns the description of -// that policy. If you don't specify a load balancer name, the action returns -// descriptions of the specified sample policies, or descriptions of all sample -// policies. The names of the sample policies have the ELBSample- prefix. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeLoadBalancerPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodePolicyNotFoundException "PolicyNotFound" -// One or more of the specified policies do not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicies -func (c *ELB) DescribeLoadBalancerPolicies(input *DescribeLoadBalancerPoliciesInput) (*DescribeLoadBalancerPoliciesOutput, error) { - req, out := c.DescribeLoadBalancerPoliciesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLoadBalancerPolicyTypes = "DescribeLoadBalancerPolicyTypes" - -// DescribeLoadBalancerPolicyTypesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBalancerPolicyTypes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBalancerPolicyTypes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBalancerPolicyTypes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBalancerPolicyTypesRequest method. -// req, resp := client.DescribeLoadBalancerPolicyTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypes -func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancerPolicyTypesInput) (req *request.Request, output *DescribeLoadBalancerPolicyTypesOutput) { - op := &request.Operation{ - Name: opDescribeLoadBalancerPolicyTypes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLoadBalancerPolicyTypesInput{} - } - - output = &DescribeLoadBalancerPolicyTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBalancerPolicyTypes API operation for Elastic Load Balancing. -// -// Describes the specified load balancer policy types or all load balancer policy -// types. -// -// The description of each type indicates how it can be used. For example, some -// policies can be used only with layer 7 listeners, some policies can be used -// only with layer 4 listeners, and some policies can be used only with your -// EC2 instances. -// -// You can use CreateLoadBalancerPolicy to create a policy configuration for -// any of these policy types. Then, depending on the policy type, use either -// SetLoadBalancerPoliciesOfListener or SetLoadBalancerPoliciesForBackendServer -// to set the 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 Elastic Load Balancing's -// API operation DescribeLoadBalancerPolicyTypes for usage and error information. -// -// Returned Error Codes: -// * ErrCodePolicyTypeNotFoundException "PolicyTypeNotFound" -// One or more of the specified policy types do not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypes -func (c *ELB) DescribeLoadBalancerPolicyTypes(input *DescribeLoadBalancerPolicyTypesInput) (*DescribeLoadBalancerPolicyTypesOutput, error) { - req, out := c.DescribeLoadBalancerPolicyTypesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLoadBalancers = "DescribeLoadBalancers" - -// DescribeLoadBalancersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBalancers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBalancers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBalancers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBalancersRequest method. -// req, resp := client.DescribeLoadBalancersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancers -func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *request.Request, output *DescribeLoadBalancersOutput) { - op := &request.Operation{ - Name: opDescribeLoadBalancers, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeLoadBalancersInput{} - } - - output = &DescribeLoadBalancersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBalancers API operation for Elastic Load Balancing. -// -// Describes the specified the load balancers. If no load balancers are specified, -// the call describes all of your load balancers. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeLoadBalancers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeDependencyThrottleException "DependencyThrottle" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancers -func (c *ELB) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { - req, out := c.DescribeLoadBalancersRequest(input) - err := req.Send() - return out, err -} - -// DescribeLoadBalancersPages iterates over the pages of a DescribeLoadBalancers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLoadBalancers 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 DescribeLoadBalancers operation. -// pageNum := 0 -// err := client.DescribeLoadBalancersPages(params, -// func(page *DescribeLoadBalancersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ELB) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(p *DescribeLoadBalancersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLoadBalancersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLoadBalancersOutput), lastPage) - }) -} - -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/elasticloadbalancing-2012-06-01/DescribeTags -func (c *ELB) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { - op := &request.Operation{ - Name: opDescribeTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTagsInput{} - } - - output = &DescribeTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTags API operation for Elastic Load Balancing. -// -// Describes the tags associated with the specified load balancers. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeTags -func (c *ELB) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err -} - -const opDetachLoadBalancerFromSubnets = "DetachLoadBalancerFromSubnets" - -// DetachLoadBalancerFromSubnetsRequest generates a "aws/request.Request" representing the -// client's request for the DetachLoadBalancerFromSubnets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachLoadBalancerFromSubnets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachLoadBalancerFromSubnets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachLoadBalancerFromSubnetsRequest method. -// req, resp := client.DetachLoadBalancerFromSubnetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnets -func (c *ELB) DetachLoadBalancerFromSubnetsRequest(input *DetachLoadBalancerFromSubnetsInput) (req *request.Request, output *DetachLoadBalancerFromSubnetsOutput) { - op := &request.Operation{ - Name: opDetachLoadBalancerFromSubnets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachLoadBalancerFromSubnetsInput{} - } - - output = &DetachLoadBalancerFromSubnetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DetachLoadBalancerFromSubnets API operation for Elastic Load Balancing. -// -// Removes the specified subnets from the set of configured subnets for the -// load balancer. -// -// After a subnet is removed, all EC2 instances registered with the load balancer -// in the removed subnet go into the OutOfService state. Then, the load balancer -// balances the traffic among the remaining routable subnets. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DetachLoadBalancerFromSubnets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnets -func (c *ELB) DetachLoadBalancerFromSubnets(input *DetachLoadBalancerFromSubnetsInput) (*DetachLoadBalancerFromSubnetsOutput, error) { - req, out := c.DetachLoadBalancerFromSubnetsRequest(input) - err := req.Send() - return out, err -} - -const opDisableAvailabilityZonesForLoadBalancer = "DisableAvailabilityZonesForLoadBalancer" - -// DisableAvailabilityZonesForLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the DisableAvailabilityZonesForLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableAvailabilityZonesForLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableAvailabilityZonesForLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableAvailabilityZonesForLoadBalancerRequest method. -// req, resp := client.DisableAvailabilityZonesForLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DisableAvailabilityZonesForLoadBalancer -func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvailabilityZonesForLoadBalancerInput) (req *request.Request, output *DisableAvailabilityZonesForLoadBalancerOutput) { - op := &request.Operation{ - Name: opDisableAvailabilityZonesForLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableAvailabilityZonesForLoadBalancerInput{} - } - - output = &DisableAvailabilityZonesForLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableAvailabilityZonesForLoadBalancer API operation for Elastic Load Balancing. -// -// Removes the specified Availability Zones from the set of Availability Zones -// for the specified load balancer. -// -// There must be at least one Availability Zone registered with a load balancer -// at all times. After an Availability Zone is removed, all instances registered -// with the load balancer that are in the removed Availability Zone go into -// the OutOfService state. Then, the load balancer attempts to equally balance -// the traffic among its remaining Availability Zones. -// -// For more information, see Add or Remove Availability Zones (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation DisableAvailabilityZonesForLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DisableAvailabilityZonesForLoadBalancer -func (c *ELB) DisableAvailabilityZonesForLoadBalancer(input *DisableAvailabilityZonesForLoadBalancerInput) (*DisableAvailabilityZonesForLoadBalancerOutput, error) { - req, out := c.DisableAvailabilityZonesForLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opEnableAvailabilityZonesForLoadBalancer = "EnableAvailabilityZonesForLoadBalancer" - -// EnableAvailabilityZonesForLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the EnableAvailabilityZonesForLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableAvailabilityZonesForLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableAvailabilityZonesForLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableAvailabilityZonesForLoadBalancerRequest method. -// req, resp := client.EnableAvailabilityZonesForLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/EnableAvailabilityZonesForLoadBalancer -func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailabilityZonesForLoadBalancerInput) (req *request.Request, output *EnableAvailabilityZonesForLoadBalancerOutput) { - op := &request.Operation{ - Name: opEnableAvailabilityZonesForLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableAvailabilityZonesForLoadBalancerInput{} - } - - output = &EnableAvailabilityZonesForLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableAvailabilityZonesForLoadBalancer API operation for Elastic Load Balancing. -// -// Adds the specified Availability Zones to the set of Availability Zones for -// the specified load balancer. -// -// The load balancer evenly distributes requests across all its registered Availability -// Zones that contain instances. -// -// For more information, see Add or Remove Availability Zones (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation EnableAvailabilityZonesForLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/EnableAvailabilityZonesForLoadBalancer -func (c *ELB) EnableAvailabilityZonesForLoadBalancer(input *EnableAvailabilityZonesForLoadBalancerInput) (*EnableAvailabilityZonesForLoadBalancerOutput, error) { - req, out := c.EnableAvailabilityZonesForLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" - -// ModifyLoadBalancerAttributesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyLoadBalancerAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyLoadBalancerAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyLoadBalancerAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyLoadBalancerAttributesRequest method. -// req, resp := client.ModifyLoadBalancerAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributes -func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttributesInput) (req *request.Request, output *ModifyLoadBalancerAttributesOutput) { - op := &request.Operation{ - Name: opModifyLoadBalancerAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyLoadBalancerAttributesInput{} - } - - output = &ModifyLoadBalancerAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyLoadBalancerAttributes API operation for Elastic Load Balancing. -// -// Modifies the attributes of the specified load balancer. -// -// You can modify the load balancer attributes, such as AccessLogs, ConnectionDraining, -// and CrossZoneLoadBalancing by either enabling or disabling them. Or, you -// can modify the load balancer attribute ConnectionSettings by specifying an -// idle connection timeout value for your load balancer. -// -// For more information, see the following in the Classic Load Balancers Guide: -// -// * Cross-Zone Load Balancing (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) -// -// * Connection Draining (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) -// -// * Access Logs (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html) -// -// * Idle Connection Timeout (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.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 Elastic Load Balancing's -// API operation ModifyLoadBalancerAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeLoadBalancerAttributeNotFoundException "LoadBalancerAttributeNotFound" -// The specified load balancer attribute does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributes -func (c *ELB) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error) { - req, out := c.ModifyLoadBalancerAttributesRequest(input) - err := req.Send() - return out, err -} - -const opRegisterInstancesWithLoadBalancer = "RegisterInstancesWithLoadBalancer" - -// RegisterInstancesWithLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the RegisterInstancesWithLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterInstancesWithLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterInstancesWithLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterInstancesWithLoadBalancerRequest method. -// req, resp := client.RegisterInstancesWithLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterInstancesWithLoadBalancer -func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesWithLoadBalancerInput) (req *request.Request, output *RegisterInstancesWithLoadBalancerOutput) { - op := &request.Operation{ - Name: opRegisterInstancesWithLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterInstancesWithLoadBalancerInput{} - } - - output = &RegisterInstancesWithLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterInstancesWithLoadBalancer API operation for Elastic Load Balancing. -// -// Adds the specified instances to the specified load balancer. -// -// The instance must be a running instance in the same network as the load balancer -// (EC2-Classic or the same VPC). If you have EC2-Classic instances and a load -// balancer in a VPC with ClassicLink enabled, you can link the EC2-Classic -// instances to that VPC and then register the linked EC2-Classic instances -// with the load balancer in the VPC. -// -// Note that RegisterInstanceWithLoadBalancer completes when the request has -// been registered. Instance registration takes a little time to complete. To -// check the state of the registered instances, use DescribeLoadBalancers or -// DescribeInstanceHealth. -// -// After the instance is registered, it starts receiving traffic and requests -// from the load balancer. Any instance that is not in one of the Availability -// Zones registered for the load balancer is moved to the OutOfService state. -// If an Availability Zone is added to the load balancer later, any instances -// registered with the load balancer move to the InService state. -// -// To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer. -// -// For more information, see Register or De-Register EC2 Instances (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation RegisterInstancesWithLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidEndPointException "InvalidInstance" -// The specified endpoint is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterInstancesWithLoadBalancer -func (c *ELB) RegisterInstancesWithLoadBalancer(input *RegisterInstancesWithLoadBalancerInput) (*RegisterInstancesWithLoadBalancerOutput, error) { - req, out := c.RegisterInstancesWithLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTags = "RemoveTags" - -// RemoveTagsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsRequest method. -// req, resp := client.RemoveTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTags -func (c *ELB) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { - op := &request.Operation{ - Name: opRemoveTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsInput{} - } - - output = &RemoveTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTags API operation for Elastic Load Balancing. -// -// Removes one or more tags from the specified load balancer. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation RemoveTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTags -func (c *ELB) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { - req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err -} - -const opSetLoadBalancerListenerSSLCertificate = "SetLoadBalancerListenerSSLCertificate" - -// SetLoadBalancerListenerSSLCertificateRequest generates a "aws/request.Request" representing the -// client's request for the SetLoadBalancerListenerSSLCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetLoadBalancerListenerSSLCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetLoadBalancerListenerSSLCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetLoadBalancerListenerSSLCertificateRequest method. -// req, resp := client.SetLoadBalancerListenerSSLCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificate -func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalancerListenerSSLCertificateInput) (req *request.Request, output *SetLoadBalancerListenerSSLCertificateOutput) { - op := &request.Operation{ - Name: opSetLoadBalancerListenerSSLCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetLoadBalancerListenerSSLCertificateInput{} - } - - output = &SetLoadBalancerListenerSSLCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetLoadBalancerListenerSSLCertificate API operation for Elastic Load Balancing. -// -// Sets the certificate that terminates the specified listener's SSL connections. -// The specified certificate replaces any prior certificate that was used on -// the same load balancer and port. -// -// For more information about updating your SSL certificate, see Replace the -// SSL Certificate for Your Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-update-ssl-cert.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation SetLoadBalancerListenerSSLCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCertificateNotFoundException "CertificateNotFound" -// The specified ARN does not refer to a valid SSL certificate in AWS Identity -// and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if -// you recently uploaded the certificate to IAM, this error might indicate that -// the certificate is not fully available yet. -// -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The load balancer does not have a listener configured at the specified port. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// * ErrCodeUnsupportedProtocolException "UnsupportedProtocol" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificate -func (c *ELB) SetLoadBalancerListenerSSLCertificate(input *SetLoadBalancerListenerSSLCertificateInput) (*SetLoadBalancerListenerSSLCertificateOutput, error) { - req, out := c.SetLoadBalancerListenerSSLCertificateRequest(input) - err := req.Send() - return out, err -} - -const opSetLoadBalancerPoliciesForBackendServer = "SetLoadBalancerPoliciesForBackendServer" - -// SetLoadBalancerPoliciesForBackendServerRequest generates a "aws/request.Request" representing the -// client's request for the SetLoadBalancerPoliciesForBackendServer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetLoadBalancerPoliciesForBackendServer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetLoadBalancerPoliciesForBackendServer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetLoadBalancerPoliciesForBackendServerRequest method. -// req, resp := client.SetLoadBalancerPoliciesForBackendServerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServer -func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalancerPoliciesForBackendServerInput) (req *request.Request, output *SetLoadBalancerPoliciesForBackendServerOutput) { - op := &request.Operation{ - Name: opSetLoadBalancerPoliciesForBackendServer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetLoadBalancerPoliciesForBackendServerInput{} - } - - output = &SetLoadBalancerPoliciesForBackendServerOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetLoadBalancerPoliciesForBackendServer API operation for Elastic Load Balancing. -// -// Replaces the set of policies associated with the specified port on which -// the EC2 instance is listening with a new set of policies. At this time, only -// the back-end server authentication policy type can be applied to the instance -// ports; this policy type is composed of multiple public key policies. -// -// Each time you use SetLoadBalancerPoliciesForBackendServer to enable the policies, -// use the PolicyNames parameter to list the policies that you want to enable. -// -// You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify -// that the policy is associated with the EC2 instance. -// -// For more information about enabling back-end instance authentication, see -// Configure Back-end Instance Authentication (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-create-https-ssl-load-balancer.html#configure_backendauth_clt) -// in the Classic Load Balancers Guide. For more information about Proxy Protocol, -// see Configure Proxy Protocol Support (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation SetLoadBalancerPoliciesForBackendServer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodePolicyNotFoundException "PolicyNotFound" -// One or more of the specified policies do not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServer -func (c *ELB) SetLoadBalancerPoliciesForBackendServer(input *SetLoadBalancerPoliciesForBackendServerInput) (*SetLoadBalancerPoliciesForBackendServerOutput, error) { - req, out := c.SetLoadBalancerPoliciesForBackendServerRequest(input) - err := req.Send() - return out, err -} - -const opSetLoadBalancerPoliciesOfListener = "SetLoadBalancerPoliciesOfListener" - -// SetLoadBalancerPoliciesOfListenerRequest generates a "aws/request.Request" representing the -// client's request for the SetLoadBalancerPoliciesOfListener operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetLoadBalancerPoliciesOfListener for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetLoadBalancerPoliciesOfListener method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetLoadBalancerPoliciesOfListenerRequest method. -// req, resp := client.SetLoadBalancerPoliciesOfListenerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListener -func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPoliciesOfListenerInput) (req *request.Request, output *SetLoadBalancerPoliciesOfListenerOutput) { - op := &request.Operation{ - Name: opSetLoadBalancerPoliciesOfListener, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetLoadBalancerPoliciesOfListenerInput{} - } - - output = &SetLoadBalancerPoliciesOfListenerOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetLoadBalancerPoliciesOfListener API operation for Elastic Load Balancing. -// -// Replaces the current set of policies for the specified load balancer port -// with the specified set of policies. -// -// To enable back-end server authentication, use SetLoadBalancerPoliciesForBackendServer. -// -// For more information about setting policies, see Update the SSL Negotiation -// Configuration (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ssl-config-update.html), -// Duration-Based Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration), -// and Application-Controlled Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) -// in the Classic Load Balancers 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 Elastic Load Balancing's -// API operation SetLoadBalancerPoliciesOfListener for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodePolicyNotFoundException "PolicyNotFound" -// One or more of the specified policies do not exist. -// -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The load balancer does not have a listener configured at the specified port. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration change is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListener -func (c *ELB) SetLoadBalancerPoliciesOfListener(input *SetLoadBalancerPoliciesOfListenerInput) (*SetLoadBalancerPoliciesOfListenerOutput, error) { - req, out := c.SetLoadBalancerPoliciesOfListenerRequest(input) - err := req.Send() - return out, err -} - -// Information about the AccessLog attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AccessLog -type AccessLog struct { - _ struct{} `type:"structure"` - - // The interval for publishing the access logs. You can specify an interval - // of either 5 minutes or 60 minutes. - // - // Default: 60 minutes - EmitInterval *int64 `type:"integer"` - - // Specifies whether access logs are enabled for the load balancer. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // The name of the Amazon S3 bucket where the access logs are stored. - S3BucketName *string `type:"string"` - - // The logical hierarchy you created for your Amazon S3 bucket, for example - // my-bucket-prefix/prod. If the prefix is not provided, the log is placed at - // the root level of the bucket. - S3BucketPrefix *string `type:"string"` -} - -// String returns the string representation -func (s AccessLog) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccessLog) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AccessLog) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AccessLog"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEmitInterval sets the EmitInterval field's value. -func (s *AccessLog) SetEmitInterval(v int64) *AccessLog { - s.EmitInterval = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *AccessLog) SetEnabled(v bool) *AccessLog { - s.Enabled = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *AccessLog) SetS3BucketName(v string) *AccessLog { - s.S3BucketName = &v - return s -} - -// SetS3BucketPrefix sets the S3BucketPrefix field's value. -func (s *AccessLog) SetS3BucketPrefix(v string) *AccessLog { - s.S3BucketPrefix = &v - return s -} - -// Contains the parameters for AddTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTagsInput -type AddTagsInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. You can specify one load balancer only. - // - // LoadBalancerNames is a required field - LoadBalancerNames []*string `type:"list" required:"true"` - - // The tags. - // - // Tags is a required field - Tags []*Tag `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"} - if s.LoadBalancerNames == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - 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 -} - -// SetLoadBalancerNames sets the LoadBalancerNames field's value. -func (s *AddTagsInput) SetLoadBalancerNames(v []*string) *AddTagsInput { - s.LoadBalancerNames = v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsInput) SetTags(v []*Tag) *AddTagsInput { - s.Tags = v - return s -} - -// Contains the output of AddTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTagsOutput -type AddTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsOutput) GoString() string { - return s.String() -} - -// This data type is reserved. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AdditionalAttribute -type AdditionalAttribute struct { - _ struct{} `type:"structure"` - - // This parameter is reserved. - Key *string `type:"string"` - - // This parameter is reserved. - Value *string `type:"string"` -} - -// String returns the string representation -func (s AdditionalAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AdditionalAttribute) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *AdditionalAttribute) SetKey(v string) *AdditionalAttribute { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *AdditionalAttribute) SetValue(v string) *AdditionalAttribute { - s.Value = &v - return s -} - -// Information about a policy for application-controlled session stickiness. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AppCookieStickinessPolicy -type AppCookieStickinessPolicy struct { - _ struct{} `type:"structure"` - - // The name of the application cookie used for stickiness. - CookieName *string `type:"string"` - - // The mnemonic name for the policy being created. The name must be unique within - // a set of policies for this load balancer. - PolicyName *string `type:"string"` -} - -// String returns the string representation -func (s AppCookieStickinessPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AppCookieStickinessPolicy) GoString() string { - return s.String() -} - -// SetCookieName sets the CookieName field's value. -func (s *AppCookieStickinessPolicy) SetCookieName(v string) *AppCookieStickinessPolicy { - s.CookieName = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *AppCookieStickinessPolicy) SetPolicyName(v string) *AppCookieStickinessPolicy { - s.PolicyName = &v - return s -} - -// Contains the parameters for ApplySecurityGroupsToLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancerInput -type ApplySecurityGroupsToLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The IDs of the security groups to associate with the load balancer. Note - // that you cannot specify the name of the security group. - // - // SecurityGroups is a required field - SecurityGroups []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s ApplySecurityGroupsToLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplySecurityGroupsToLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApplySecurityGroupsToLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplySecurityGroupsToLoadBalancerInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.SecurityGroups == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityGroups")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *ApplySecurityGroupsToLoadBalancerInput) SetLoadBalancerName(v string) *ApplySecurityGroupsToLoadBalancerInput { - s.LoadBalancerName = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *ApplySecurityGroupsToLoadBalancerInput) SetSecurityGroups(v []*string) *ApplySecurityGroupsToLoadBalancerInput { - s.SecurityGroups = v - return s -} - -// Contains the output of ApplySecurityGroupsToLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancerOutput -type ApplySecurityGroupsToLoadBalancerOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the security groups associated with the load balancer. - SecurityGroups []*string `type:"list"` -} - -// String returns the string representation -func (s ApplySecurityGroupsToLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplySecurityGroupsToLoadBalancerOutput) GoString() string { - return s.String() -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *ApplySecurityGroupsToLoadBalancerOutput) SetSecurityGroups(v []*string) *ApplySecurityGroupsToLoadBalancerOutput { - s.SecurityGroups = v - return s -} - -// Contains the parameters for AttachLoaBalancerToSubnets. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnetsInput -type AttachLoadBalancerToSubnetsInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The IDs of the subnets to add. You can add only one subnet per Availability - // Zone. - // - // Subnets is a required field - Subnets []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s AttachLoadBalancerToSubnetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachLoadBalancerToSubnetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachLoadBalancerToSubnetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachLoadBalancerToSubnetsInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.Subnets == nil { - invalidParams.Add(request.NewErrParamRequired("Subnets")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *AttachLoadBalancerToSubnetsInput) SetLoadBalancerName(v string) *AttachLoadBalancerToSubnetsInput { - s.LoadBalancerName = &v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *AttachLoadBalancerToSubnetsInput) SetSubnets(v []*string) *AttachLoadBalancerToSubnetsInput { - s.Subnets = v - return s -} - -// Contains the output of AttachLoadBalancerToSubnets. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnetsOutput -type AttachLoadBalancerToSubnetsOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the subnets attached to the load balancer. - Subnets []*string `type:"list"` -} - -// String returns the string representation -func (s AttachLoadBalancerToSubnetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachLoadBalancerToSubnetsOutput) GoString() string { - return s.String() -} - -// SetSubnets sets the Subnets field's value. -func (s *AttachLoadBalancerToSubnetsOutput) SetSubnets(v []*string) *AttachLoadBalancerToSubnetsOutput { - s.Subnets = v - return s -} - -// Information about the configuration of an EC2 instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/BackendServerDescription -type BackendServerDescription struct { - _ struct{} `type:"structure"` - - // The port on which the EC2 instance is listening. - InstancePort *int64 `min:"1" type:"integer"` - - // The names of the policies enabled for the EC2 instance. - PolicyNames []*string `type:"list"` -} - -// String returns the string representation -func (s BackendServerDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BackendServerDescription) GoString() string { - return s.String() -} - -// SetInstancePort sets the InstancePort field's value. -func (s *BackendServerDescription) SetInstancePort(v int64) *BackendServerDescription { - s.InstancePort = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *BackendServerDescription) SetPolicyNames(v []*string) *BackendServerDescription { - s.PolicyNames = v - return s -} - -// Contains the parameters for ConfigureHealthCheck. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheckInput -type ConfigureHealthCheckInput struct { - _ struct{} `type:"structure"` - - // The configuration information. - // - // HealthCheck is a required field - HealthCheck *HealthCheck `type:"structure" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ConfigureHealthCheckInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigureHealthCheckInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfigureHealthCheckInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfigureHealthCheckInput"} - if s.HealthCheck == nil { - invalidParams.Add(request.NewErrParamRequired("HealthCheck")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.HealthCheck != nil { - if err := s.HealthCheck.Validate(); err != nil { - invalidParams.AddNested("HealthCheck", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *ConfigureHealthCheckInput) SetHealthCheck(v *HealthCheck) *ConfigureHealthCheckInput { - s.HealthCheck = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *ConfigureHealthCheckInput) SetLoadBalancerName(v string) *ConfigureHealthCheckInput { - s.LoadBalancerName = &v - return s -} - -// Contains the output of ConfigureHealthCheck. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheckOutput -type ConfigureHealthCheckOutput struct { - _ struct{} `type:"structure"` - - // The updated health check. - HealthCheck *HealthCheck `type:"structure"` -} - -// String returns the string representation -func (s ConfigureHealthCheckOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigureHealthCheckOutput) GoString() string { - return s.String() -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *ConfigureHealthCheckOutput) SetHealthCheck(v *HealthCheck) *ConfigureHealthCheckOutput { - s.HealthCheck = v - return s -} - -// Information about the ConnectionDraining attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConnectionDraining -type ConnectionDraining struct { - _ struct{} `type:"structure"` - - // Specifies whether connection draining is enabled for the load balancer. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // The maximum time, in seconds, to keep the existing connections open before - // deregistering the instances. - Timeout *int64 `type:"integer"` -} - -// String returns the string representation -func (s ConnectionDraining) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConnectionDraining) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConnectionDraining) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConnectionDraining"} - 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 *ConnectionDraining) SetEnabled(v bool) *ConnectionDraining { - s.Enabled = &v - return s -} - -// SetTimeout sets the Timeout field's value. -func (s *ConnectionDraining) SetTimeout(v int64) *ConnectionDraining { - s.Timeout = &v - return s -} - -// Information about the ConnectionSettings attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConnectionSettings -type ConnectionSettings struct { - _ struct{} `type:"structure"` - - // The time, in seconds, that the connection is allowed to be idle (no data - // has been sent over the connection) before it is closed by the load balancer. - // - // IdleTimeout is a required field - IdleTimeout *int64 `min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s ConnectionSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConnectionSettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConnectionSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConnectionSettings"} - if s.IdleTimeout == nil { - invalidParams.Add(request.NewErrParamRequired("IdleTimeout")) - } - if s.IdleTimeout != nil && *s.IdleTimeout < 1 { - invalidParams.Add(request.NewErrParamMinValue("IdleTimeout", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdleTimeout sets the IdleTimeout field's value. -func (s *ConnectionSettings) SetIdleTimeout(v int64) *ConnectionSettings { - s.IdleTimeout = &v - return s -} - -// Contains the parameters for CreateAppCookieStickinessPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicyInput -type CreateAppCookieStickinessPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the application cookie used for stickiness. - // - // CookieName is a required field - CookieName *string `type:"string" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The name of the policy being created. Policy names must consist of alphanumeric - // characters and dashes (-). This name must be unique within the set of policies - // for this load balancer. - // - // PolicyName is a required field - PolicyName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateAppCookieStickinessPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAppCookieStickinessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAppCookieStickinessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAppCookieStickinessPolicyInput"} - if s.CookieName == nil { - invalidParams.Add(request.NewErrParamRequired("CookieName")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCookieName sets the CookieName field's value. -func (s *CreateAppCookieStickinessPolicyInput) SetCookieName(v string) *CreateAppCookieStickinessPolicyInput { - s.CookieName = &v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *CreateAppCookieStickinessPolicyInput) SetLoadBalancerName(v string) *CreateAppCookieStickinessPolicyInput { - s.LoadBalancerName = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *CreateAppCookieStickinessPolicyInput) SetPolicyName(v string) *CreateAppCookieStickinessPolicyInput { - s.PolicyName = &v - return s -} - -// Contains the output for CreateAppCookieStickinessPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicyOutput -type CreateAppCookieStickinessPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateAppCookieStickinessPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAppCookieStickinessPolicyOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateLBCookieStickinessPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicyInput -type CreateLBCookieStickinessPolicyInput struct { - _ struct{} `type:"structure"` - - // The time period, in seconds, after which the cookie should be considered - // stale. If you do not specify this parameter, the default value is 0, which - // indicates that the sticky session should last for the duration of the browser - // session. - CookieExpirationPeriod *int64 `type:"long"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The name of the policy being created. Policy names must consist of alphanumeric - // characters and dashes (-). This name must be unique within the set of policies - // for this load balancer. - // - // PolicyName is a required field - PolicyName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateLBCookieStickinessPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLBCookieStickinessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLBCookieStickinessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLBCookieStickinessPolicyInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCookieExpirationPeriod sets the CookieExpirationPeriod field's value. -func (s *CreateLBCookieStickinessPolicyInput) SetCookieExpirationPeriod(v int64) *CreateLBCookieStickinessPolicyInput { - s.CookieExpirationPeriod = &v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *CreateLBCookieStickinessPolicyInput) SetLoadBalancerName(v string) *CreateLBCookieStickinessPolicyInput { - s.LoadBalancerName = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *CreateLBCookieStickinessPolicyInput) SetPolicyName(v string) *CreateLBCookieStickinessPolicyInput { - s.PolicyName = &v - return s -} - -// Contains the output for CreateLBCookieStickinessPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicyOutput -type CreateLBCookieStickinessPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateLBCookieStickinessPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLBCookieStickinessPolicyOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAccessPointInput -type CreateLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // One or more Availability Zones from the same region as the load balancer. - // - // You must specify at least one Availability Zone. - // - // You can add more Availability Zones after you create the load balancer using - // EnableAvailabilityZonesForLoadBalancer. - AvailabilityZones []*string `type:"list"` - - // The listeners. - // - // For more information, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) - // in the Classic Load Balancers Guide. - // - // Listeners is a required field - Listeners []*Listener `type:"list" required:"true"` - - // The name of the load balancer. - // - // This name must be unique within your set of load balancers for the region, - // must have a maximum of 32 characters, must contain only alphanumeric characters - // or hyphens, and cannot begin or end with a hyphen. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The type of a load balancer. Valid only for load balancers in a VPC. - // - // By default, Elastic Load Balancing creates an Internet-facing load balancer - // with a DNS name that resolves to public IP addresses. For more information - // about Internet-facing and Internal load balancers, see Load Balancer Scheme - // (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#load-balancer-scheme) - // in the Elastic Load Balancing User Guide. - // - // Specify internal to create a load balancer with a DNS name that resolves - // to private IP addresses. - Scheme *string `type:"string"` - - // The IDs of the security groups to assign to the load balancer. - SecurityGroups []*string `type:"list"` - - // The IDs of the subnets in your VPC to attach to the load balancer. Specify - // one subnet per Availability Zone specified in AvailabilityZones. - Subnets []*string `type:"list"` - - // A list of tags to assign to the load balancer. - // - // For more information about tagging your load balancer, see Tag Your Classic - // Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) - // in the Classic Load Balancers Guide. - Tags []*Tag `min:"1" type:"list"` -} - -// String returns the string representation -func (s CreateLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerInput"} - if s.Listeners == nil { - invalidParams.Add(request.NewErrParamRequired("Listeners")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.Listeners != nil { - for i, v := range s.Listeners { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Listeners", 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 - } - return nil -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *CreateLoadBalancerInput) SetAvailabilityZones(v []*string) *CreateLoadBalancerInput { - s.AvailabilityZones = v - return s -} - -// SetListeners sets the Listeners field's value. -func (s *CreateLoadBalancerInput) SetListeners(v []*Listener) *CreateLoadBalancerInput { - s.Listeners = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *CreateLoadBalancerInput) SetLoadBalancerName(v string) *CreateLoadBalancerInput { - s.LoadBalancerName = &v - return s -} - -// SetScheme sets the Scheme field's value. -func (s *CreateLoadBalancerInput) SetScheme(v string) *CreateLoadBalancerInput { - s.Scheme = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *CreateLoadBalancerInput) SetSecurityGroups(v []*string) *CreateLoadBalancerInput { - s.SecurityGroups = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *CreateLoadBalancerInput) SetSubnets(v []*string) *CreateLoadBalancerInput { - s.Subnets = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateLoadBalancerInput) SetTags(v []*Tag) *CreateLoadBalancerInput { - s.Tags = v - return s -} - -// Contains the parameters for CreateLoadBalancerListeners. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListenerInput -type CreateLoadBalancerListenersInput struct { - _ struct{} `type:"structure"` - - // The listeners. - // - // Listeners is a required field - Listeners []*Listener `type:"list" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateLoadBalancerListenersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoadBalancerListenersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLoadBalancerListenersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerListenersInput"} - if s.Listeners == nil { - invalidParams.Add(request.NewErrParamRequired("Listeners")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.Listeners != nil { - for i, v := range s.Listeners { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Listeners", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListeners sets the Listeners field's value. -func (s *CreateLoadBalancerListenersInput) SetListeners(v []*Listener) *CreateLoadBalancerListenersInput { - s.Listeners = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *CreateLoadBalancerListenersInput) SetLoadBalancerName(v string) *CreateLoadBalancerListenersInput { - s.LoadBalancerName = &v - return s -} - -// Contains the parameters for CreateLoadBalancerListener. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListenerOutput -type CreateLoadBalancerListenersOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateLoadBalancerListenersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoadBalancerListenersOutput) GoString() string { - return s.String() -} - -// Contains the output for CreateLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAccessPointOutput -type CreateLoadBalancerOutput struct { - _ struct{} `type:"structure"` - - // The DNS name of the load balancer. - DNSName *string `type:"string"` -} - -// String returns the string representation -func (s CreateLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoadBalancerOutput) GoString() string { - return s.String() -} - -// SetDNSName sets the DNSName field's value. -func (s *CreateLoadBalancerOutput) SetDNSName(v string) *CreateLoadBalancerOutput { - s.DNSName = &v - return s -} - -// Contains the parameters for CreateLoadBalancerPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicyInput -type CreateLoadBalancerPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The policy attributes. - PolicyAttributes []*PolicyAttribute `type:"list"` - - // The name of the load balancer policy to be created. This name must be unique - // within the set of policies for this load balancer. - // - // PolicyName is a required field - PolicyName *string `type:"string" required:"true"` - - // The name of the base policy type. To get the list of policy types, use DescribeLoadBalancerPolicyTypes. - // - // PolicyTypeName is a required field - PolicyTypeName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateLoadBalancerPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoadBalancerPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLoadBalancerPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerPolicyInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyTypeName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyTypeName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *CreateLoadBalancerPolicyInput) SetLoadBalancerName(v string) *CreateLoadBalancerPolicyInput { - s.LoadBalancerName = &v - return s -} - -// SetPolicyAttributes sets the PolicyAttributes field's value. -func (s *CreateLoadBalancerPolicyInput) SetPolicyAttributes(v []*PolicyAttribute) *CreateLoadBalancerPolicyInput { - s.PolicyAttributes = v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *CreateLoadBalancerPolicyInput) SetPolicyName(v string) *CreateLoadBalancerPolicyInput { - s.PolicyName = &v - return s -} - -// SetPolicyTypeName sets the PolicyTypeName field's value. -func (s *CreateLoadBalancerPolicyInput) SetPolicyTypeName(v string) *CreateLoadBalancerPolicyInput { - s.PolicyTypeName = &v - return s -} - -// Contains the output of CreateLoadBalancerPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicyOutput -type CreateLoadBalancerPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateLoadBalancerPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoadBalancerPolicyOutput) GoString() string { - return s.String() -} - -// Information about the CrossZoneLoadBalancing attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CrossZoneLoadBalancing -type CrossZoneLoadBalancing struct { - _ struct{} `type:"structure"` - - // Specifies whether cross-zone load balancing is enabled for the load balancer. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s CrossZoneLoadBalancing) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CrossZoneLoadBalancing) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CrossZoneLoadBalancing) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CrossZoneLoadBalancing"} - 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 *CrossZoneLoadBalancing) SetEnabled(v bool) *CrossZoneLoadBalancing { - s.Enabled = &v - return s -} - -// Contains the parameters for DeleteLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteAccessPointInput -type DeleteLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DeleteLoadBalancerInput) SetLoadBalancerName(v string) *DeleteLoadBalancerInput { - s.LoadBalancerName = &v - return s -} - -// Contains the parameters for DeleteLoadBalancerListeners. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListenerInput -type DeleteLoadBalancerListenersInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The client port numbers of the listeners. - // - // LoadBalancerPorts is a required field - LoadBalancerPorts []*int64 `type:"list" required:"true"` -} - -// String returns the string representation -func (s DeleteLoadBalancerListenersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoadBalancerListenersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLoadBalancerListenersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerListenersInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.LoadBalancerPorts == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerPorts")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DeleteLoadBalancerListenersInput) SetLoadBalancerName(v string) *DeleteLoadBalancerListenersInput { - s.LoadBalancerName = &v - return s -} - -// SetLoadBalancerPorts sets the LoadBalancerPorts field's value. -func (s *DeleteLoadBalancerListenersInput) SetLoadBalancerPorts(v []*int64) *DeleteLoadBalancerListenersInput { - s.LoadBalancerPorts = v - return s -} - -// Contains the output of DeleteLoadBalancerListeners. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListenerOutput -type DeleteLoadBalancerListenersOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLoadBalancerListenersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoadBalancerListenersOutput) GoString() string { - return s.String() -} - -// Contains the output of DeleteLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteAccessPointOutput -type DeleteLoadBalancerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoadBalancerOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteLoadBalancerPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicyInput -type DeleteLoadBalancerPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The name of the policy. - // - // PolicyName is a required field - PolicyName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLoadBalancerPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoadBalancerPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLoadBalancerPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerPolicyInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DeleteLoadBalancerPolicyInput) SetLoadBalancerName(v string) *DeleteLoadBalancerPolicyInput { - s.LoadBalancerName = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *DeleteLoadBalancerPolicyInput) SetPolicyName(v string) *DeleteLoadBalancerPolicyInput { - s.PolicyName = &v - return s -} - -// Contains the output of DeleteLoadBalancerPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicyOutput -type DeleteLoadBalancerPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLoadBalancerPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoadBalancerPolicyOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeregisterInstancesFromLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterEndPointsInput -type DeregisterInstancesFromLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The IDs of the instances. - // - // Instances is a required field - Instances []*Instance `type:"list" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterInstancesFromLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterInstancesFromLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterInstancesFromLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterInstancesFromLoadBalancerInput"} - if s.Instances == nil { - invalidParams.Add(request.NewErrParamRequired("Instances")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstances sets the Instances field's value. -func (s *DeregisterInstancesFromLoadBalancerInput) SetInstances(v []*Instance) *DeregisterInstancesFromLoadBalancerInput { - s.Instances = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DeregisterInstancesFromLoadBalancerInput) SetLoadBalancerName(v string) *DeregisterInstancesFromLoadBalancerInput { - s.LoadBalancerName = &v - return s -} - -// Contains the output of DeregisterInstancesFromLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterEndPointsOutput -type DeregisterInstancesFromLoadBalancerOutput struct { - _ struct{} `type:"structure"` - - // The remaining instances registered with the load balancer. - Instances []*Instance `type:"list"` -} - -// String returns the string representation -func (s DeregisterInstancesFromLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterInstancesFromLoadBalancerOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *DeregisterInstancesFromLoadBalancerOutput) SetInstances(v []*Instance) *DeregisterInstancesFromLoadBalancerOutput { - s.Instances = v - return s -} - -// Contains the parameters for DescribeInstanceHealth. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeEndPointStateInput -type DescribeInstanceHealthInput struct { - _ struct{} `type:"structure"` - - // The IDs of the instances. - Instances []*Instance `type:"list"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeInstanceHealthInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceHealthInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstanceHealthInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceHealthInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstances sets the Instances field's value. -func (s *DescribeInstanceHealthInput) SetInstances(v []*Instance) *DescribeInstanceHealthInput { - s.Instances = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DescribeInstanceHealthInput) SetLoadBalancerName(v string) *DescribeInstanceHealthInput { - s.LoadBalancerName = &v - return s -} - -// Contains the output for DescribeInstanceHealth. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeEndPointStateOutput -type DescribeInstanceHealthOutput struct { - _ struct{} `type:"structure"` - - // Information about the health of the instances. - InstanceStates []*InstanceState `type:"list"` -} - -// String returns the string representation -func (s DescribeInstanceHealthOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceHealthOutput) GoString() string { - return s.String() -} - -// SetInstanceStates sets the InstanceStates field's value. -func (s *DescribeInstanceHealthOutput) SetInstanceStates(v []*InstanceState) *DescribeInstanceHealthOutput { - s.InstanceStates = v - return s -} - -// Contains the parameters for DescribeLoadBalancerAttributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributesInput -type DescribeLoadBalancerAttributesInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeLoadBalancerAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLoadBalancerAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancerAttributesInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DescribeLoadBalancerAttributesInput) SetLoadBalancerName(v string) *DescribeLoadBalancerAttributesInput { - s.LoadBalancerName = &v - return s -} - -// Contains the output of DescribeLoadBalancerAttributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributesOutput -type DescribeLoadBalancerAttributesOutput struct { - _ struct{} `type:"structure"` - - // Information about the load balancer attributes. - LoadBalancerAttributes *LoadBalancerAttributes `type:"structure"` -} - -// String returns the string representation -func (s DescribeLoadBalancerAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerAttributesOutput) GoString() string { - return s.String() -} - -// SetLoadBalancerAttributes sets the LoadBalancerAttributes field's value. -func (s *DescribeLoadBalancerAttributesOutput) SetLoadBalancerAttributes(v *LoadBalancerAttributes) *DescribeLoadBalancerAttributesOutput { - s.LoadBalancerAttributes = v - return s -} - -// Contains the parameters for DescribeLoadBalancerPolicies. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPoliciesInput -type DescribeLoadBalancerPoliciesInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - LoadBalancerName *string `type:"string"` - - // The names of the policies. - PolicyNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeLoadBalancerPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerPoliciesInput) GoString() string { - return s.String() -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DescribeLoadBalancerPoliciesInput) SetLoadBalancerName(v string) *DescribeLoadBalancerPoliciesInput { - s.LoadBalancerName = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *DescribeLoadBalancerPoliciesInput) SetPolicyNames(v []*string) *DescribeLoadBalancerPoliciesInput { - s.PolicyNames = v - return s -} - -// Contains the output of DescribeLoadBalancerPolicies. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPoliciesOutput -type DescribeLoadBalancerPoliciesOutput struct { - _ struct{} `type:"structure"` - - // Information about the policies. - PolicyDescriptions []*PolicyDescription `type:"list"` -} - -// String returns the string representation -func (s DescribeLoadBalancerPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerPoliciesOutput) GoString() string { - return s.String() -} - -// SetPolicyDescriptions sets the PolicyDescriptions field's value. -func (s *DescribeLoadBalancerPoliciesOutput) SetPolicyDescriptions(v []*PolicyDescription) *DescribeLoadBalancerPoliciesOutput { - s.PolicyDescriptions = v - return s -} - -// Contains the parameters for DescribeLoadBalancerPolicyTypes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypesInput -type DescribeLoadBalancerPolicyTypesInput struct { - _ struct{} `type:"structure"` - - // The names of the policy types. If no names are specified, describes all policy - // types defined by Elastic Load Balancing. - PolicyTypeNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeLoadBalancerPolicyTypesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerPolicyTypesInput) GoString() string { - return s.String() -} - -// SetPolicyTypeNames sets the PolicyTypeNames field's value. -func (s *DescribeLoadBalancerPolicyTypesInput) SetPolicyTypeNames(v []*string) *DescribeLoadBalancerPolicyTypesInput { - s.PolicyTypeNames = v - return s -} - -// Contains the output of DescribeLoadBalancerPolicyTypes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypesOutput -type DescribeLoadBalancerPolicyTypesOutput struct { - _ struct{} `type:"structure"` - - // Information about the policy types. - PolicyTypeDescriptions []*PolicyTypeDescription `type:"list"` -} - -// String returns the string representation -func (s DescribeLoadBalancerPolicyTypesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerPolicyTypesOutput) GoString() string { - return s.String() -} - -// SetPolicyTypeDescriptions sets the PolicyTypeDescriptions field's value. -func (s *DescribeLoadBalancerPolicyTypesOutput) SetPolicyTypeDescriptions(v []*PolicyTypeDescription) *DescribeLoadBalancerPolicyTypesOutput { - s.PolicyTypeDescriptions = v - return s -} - -// Contains the parameters for DescribeLoadBalancers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeAccessPointsInput -type DescribeLoadBalancersInput struct { - _ struct{} `type:"structure"` - - // The names of the load balancers. - LoadBalancerNames []*string `type:"list"` - - // The marker for the next set of results. (You received this marker from a - // previous call.) - Marker *string `type:"string"` - - // The maximum number of results to return with this call (a number from 1 to - // 400). The default is 400. - PageSize *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s DescribeLoadBalancersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLoadBalancersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancersInput"} - if s.PageSize != nil && *s.PageSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerNames sets the LoadBalancerNames field's value. -func (s *DescribeLoadBalancersInput) SetLoadBalancerNames(v []*string) *DescribeLoadBalancersInput { - s.LoadBalancerNames = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeLoadBalancersInput) SetMarker(v string) *DescribeLoadBalancersInput { - s.Marker = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeLoadBalancersInput) SetPageSize(v int64) *DescribeLoadBalancersInput { - s.PageSize = &v - return s -} - -// Contains the parameters for DescribeLoadBalancers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeAccessPointsOutput -type DescribeLoadBalancersOutput struct { - _ struct{} `type:"structure"` - - // Information about the load balancers. - LoadBalancerDescriptions []*LoadBalancerDescription `type:"list"` - - // The marker to use when requesting the next set of results. If there are no - // additional results, the string is empty. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLoadBalancersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancersOutput) GoString() string { - return s.String() -} - -// SetLoadBalancerDescriptions sets the LoadBalancerDescriptions field's value. -func (s *DescribeLoadBalancersOutput) SetLoadBalancerDescriptions(v []*LoadBalancerDescription) *DescribeLoadBalancersOutput { - s.LoadBalancerDescriptions = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeLoadBalancersOutput) SetNextMarker(v string) *DescribeLoadBalancersOutput { - s.NextMarker = &v - return s -} - -// Contains the parameters for DescribeTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeTagsInput -type DescribeTagsInput struct { - _ struct{} `type:"structure"` - - // The names of the load balancers. - // - // LoadBalancerNames is a required field - LoadBalancerNames []*string `min:"1" type:"list" required:"true"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTagsInput"} - if s.LoadBalancerNames == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) - } - if s.LoadBalancerNames != nil && len(s.LoadBalancerNames) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LoadBalancerNames", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerNames sets the LoadBalancerNames field's value. -func (s *DescribeTagsInput) SetLoadBalancerNames(v []*string) *DescribeTagsInput { - s.LoadBalancerNames = v - return s -} - -// Contains the output for DescribeTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeTagsOutput -type DescribeTagsOutput struct { - _ struct{} `type:"structure"` - - // Information about the tags. - TagDescriptions []*TagDescription `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() -} - -// SetTagDescriptions sets the TagDescriptions field's value. -func (s *DescribeTagsOutput) SetTagDescriptions(v []*TagDescription) *DescribeTagsOutput { - s.TagDescriptions = v - return s -} - -// Contains the parameters for DetachLoadBalancerFromSubnets. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnetsInput -type DetachLoadBalancerFromSubnetsInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The IDs of the subnets. - // - // Subnets is a required field - Subnets []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DetachLoadBalancerFromSubnetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachLoadBalancerFromSubnetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachLoadBalancerFromSubnetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachLoadBalancerFromSubnetsInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.Subnets == nil { - invalidParams.Add(request.NewErrParamRequired("Subnets")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DetachLoadBalancerFromSubnetsInput) SetLoadBalancerName(v string) *DetachLoadBalancerFromSubnetsInput { - s.LoadBalancerName = &v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *DetachLoadBalancerFromSubnetsInput) SetSubnets(v []*string) *DetachLoadBalancerFromSubnetsInput { - s.Subnets = v - return s -} - -// Contains the output of DetachLoadBalancerFromSubnets. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnetsOutput -type DetachLoadBalancerFromSubnetsOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the remaining subnets for the load balancer. - Subnets []*string `type:"list"` -} - -// String returns the string representation -func (s DetachLoadBalancerFromSubnetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachLoadBalancerFromSubnetsOutput) GoString() string { - return s.String() -} - -// SetSubnets sets the Subnets field's value. -func (s *DetachLoadBalancerFromSubnetsOutput) SetSubnets(v []*string) *DetachLoadBalancerFromSubnetsOutput { - s.Subnets = v - return s -} - -// Contains the parameters for DisableAvailabilityZonesForLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveAvailabilityZonesInput -type DisableAvailabilityZonesForLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The Availability Zones. - // - // AvailabilityZones is a required field - AvailabilityZones []*string `type:"list" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableAvailabilityZonesForLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableAvailabilityZonesForLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableAvailabilityZonesForLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableAvailabilityZonesForLoadBalancerInput"} - if s.AvailabilityZones == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZones")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DisableAvailabilityZonesForLoadBalancerInput) SetAvailabilityZones(v []*string) *DisableAvailabilityZonesForLoadBalancerInput { - s.AvailabilityZones = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *DisableAvailabilityZonesForLoadBalancerInput) SetLoadBalancerName(v string) *DisableAvailabilityZonesForLoadBalancerInput { - s.LoadBalancerName = &v - return s -} - -// Contains the output for DisableAvailabilityZonesForLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveAvailabilityZonesOutput -type DisableAvailabilityZonesForLoadBalancerOutput struct { - _ struct{} `type:"structure"` - - // The remaining Availability Zones for the load balancer. - AvailabilityZones []*string `type:"list"` -} - -// String returns the string representation -func (s DisableAvailabilityZonesForLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableAvailabilityZonesForLoadBalancerOutput) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DisableAvailabilityZonesForLoadBalancerOutput) SetAvailabilityZones(v []*string) *DisableAvailabilityZonesForLoadBalancerOutput { - s.AvailabilityZones = v - return s -} - -// Contains the parameters for EnableAvailabilityZonesForLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddAvailabilityZonesInput -type EnableAvailabilityZonesForLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The Availability Zones. These must be in the same region as the load balancer. - // - // AvailabilityZones is a required field - AvailabilityZones []*string `type:"list" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableAvailabilityZonesForLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableAvailabilityZonesForLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableAvailabilityZonesForLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableAvailabilityZonesForLoadBalancerInput"} - if s.AvailabilityZones == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZones")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *EnableAvailabilityZonesForLoadBalancerInput) SetAvailabilityZones(v []*string) *EnableAvailabilityZonesForLoadBalancerInput { - s.AvailabilityZones = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *EnableAvailabilityZonesForLoadBalancerInput) SetLoadBalancerName(v string) *EnableAvailabilityZonesForLoadBalancerInput { - s.LoadBalancerName = &v - return s -} - -// Contains the output of EnableAvailabilityZonesForLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddAvailabilityZonesOutput -type EnableAvailabilityZonesForLoadBalancerOutput struct { - _ struct{} `type:"structure"` - - // The updated list of Availability Zones for the load balancer. - AvailabilityZones []*string `type:"list"` -} - -// String returns the string representation -func (s EnableAvailabilityZonesForLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableAvailabilityZonesForLoadBalancerOutput) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *EnableAvailabilityZonesForLoadBalancerOutput) SetAvailabilityZones(v []*string) *EnableAvailabilityZonesForLoadBalancerOutput { - s.AvailabilityZones = v - return s -} - -// Information about a health check. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/HealthCheck -type HealthCheck struct { - _ struct{} `type:"structure"` - - // The number of consecutive health checks successes required before moving - // the instance to the Healthy state. - // - // HealthyThreshold is a required field - HealthyThreshold *int64 `min:"2" type:"integer" required:"true"` - - // The approximate interval, in seconds, between health checks of an individual - // instance. - // - // Interval is a required field - Interval *int64 `min:"5" type:"integer" required:"true"` - - // The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. - // The range of valid ports is one (1) through 65535. - // - // TCP is the default, specified as a TCP: port pair, for example "TCP:5000". - // In this case, a health check simply attempts to open a TCP connection to - // the instance on the specified port. Failure to connect within the configured - // timeout is considered unhealthy. - // - // SSL is also specified as SSL: port pair, for example, SSL:5000. - // - // For HTTP/HTTPS, you must include a ping path in the string. HTTP is specified - // as a HTTP:port;/;PathToPing; grouping, for example "HTTP:80/weather/us/wa/seattle". - // In this case, a HTTP GET request is issued to the instance on the given port - // and path. Any answer other than "200 OK" within the timeout period is considered - // unhealthy. - // - // The total length of the HTTP ping target must be 1024 16-bit Unicode characters - // or less. - // - // Target is a required field - Target *string `type:"string" required:"true"` - - // The amount of time, in seconds, during which no response means a failed health - // check. - // - // This value must be less than the Interval value. - // - // Timeout is a required field - Timeout *int64 `min:"2" type:"integer" required:"true"` - - // The number of consecutive health check failures required before moving the - // instance to the Unhealthy state. - // - // UnhealthyThreshold is a required field - UnhealthyThreshold *int64 `min:"2" type:"integer" 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HealthCheck) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HealthCheck"} - if s.HealthyThreshold == nil { - invalidParams.Add(request.NewErrParamRequired("HealthyThreshold")) - } - if s.HealthyThreshold != nil && *s.HealthyThreshold < 2 { - invalidParams.Add(request.NewErrParamMinValue("HealthyThreshold", 2)) - } - if s.Interval == nil { - invalidParams.Add(request.NewErrParamRequired("Interval")) - } - if s.Interval != nil && *s.Interval < 5 { - invalidParams.Add(request.NewErrParamMinValue("Interval", 5)) - } - if s.Target == nil { - invalidParams.Add(request.NewErrParamRequired("Target")) - } - if s.Timeout == nil { - invalidParams.Add(request.NewErrParamRequired("Timeout")) - } - if s.Timeout != nil && *s.Timeout < 2 { - invalidParams.Add(request.NewErrParamMinValue("Timeout", 2)) - } - if s.UnhealthyThreshold == nil { - invalidParams.Add(request.NewErrParamRequired("UnhealthyThreshold")) - } - if s.UnhealthyThreshold != nil && *s.UnhealthyThreshold < 2 { - invalidParams.Add(request.NewErrParamMinValue("UnhealthyThreshold", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthyThreshold sets the HealthyThreshold field's value. -func (s *HealthCheck) SetHealthyThreshold(v int64) *HealthCheck { - s.HealthyThreshold = &v - return s -} - -// SetInterval sets the Interval field's value. -func (s *HealthCheck) SetInterval(v int64) *HealthCheck { - s.Interval = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *HealthCheck) SetTarget(v string) *HealthCheck { - s.Target = &v - return s -} - -// SetTimeout sets the Timeout field's value. -func (s *HealthCheck) SetTimeout(v int64) *HealthCheck { - s.Timeout = &v - return s -} - -// SetUnhealthyThreshold sets the UnhealthyThreshold field's value. -func (s *HealthCheck) SetUnhealthyThreshold(v int64) *HealthCheck { - s.UnhealthyThreshold = &v - return s -} - -// The ID of an EC2 instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/Instance -type Instance struct { - _ struct{} `type:"structure"` - - // The instance ID. - InstanceId *string `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() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Instance) SetInstanceId(v string) *Instance { - s.InstanceId = &v - return s -} - -// Information about the state of an EC2 instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/InstanceState -type InstanceState struct { - _ struct{} `type:"structure"` - - // A description of the instance state. This string can contain one or more - // of the following messages. - // - // * N/A - // - // * A transient error occurred. Please try again later. - // - // * Instance has failed at least the UnhealthyThreshold number of health - // checks consecutively. - // - // * Instance has not passed the configured HealthyThreshold number of health - // checks consecutively. - // - // * Instance registration is still in progress. - // - // * Instance is in the EC2 Availability Zone for which LoadBalancer is not - // configured to route traffic to. - // - // * Instance is not currently registered with the LoadBalancer. - // - // * Instance deregistration currently in progress. - // - // * Disable Availability Zone is currently in progress. - // - // * Instance is in pending state. - // - // * Instance is in stopped state. - // - // * Instance is in terminated state. - Description *string `type:"string"` - - // The ID of the instance. - InstanceId *string `type:"string"` - - // Information about the cause of OutOfService instances. Specifically, whether - // the cause is Elastic Load Balancing or the instance. - // - // Valid values: ELB | Instance | N/A - ReasonCode *string `type:"string"` - - // The current state of the instance. - // - // Valid values: InService | OutOfService | Unknown - State *string `type:"string"` -} - -// 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() -} - -// SetDescription sets the Description field's value. -func (s *InstanceState) SetDescription(v string) *InstanceState { - s.Description = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceState) SetInstanceId(v string) *InstanceState { - s.InstanceId = &v - return s -} - -// SetReasonCode sets the ReasonCode field's value. -func (s *InstanceState) SetReasonCode(v string) *InstanceState { - s.ReasonCode = &v - return s -} - -// SetState sets the State field's value. -func (s *InstanceState) SetState(v string) *InstanceState { - s.State = &v - return s -} - -// Information about a policy for duration-based session stickiness. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/LBCookieStickinessPolicy -type LBCookieStickinessPolicy struct { - _ struct{} `type:"structure"` - - // The time period, in seconds, after which the cookie should be considered - // stale. If this parameter is not specified, the stickiness session lasts for - // the duration of the browser session. - CookieExpirationPeriod *int64 `type:"long"` - - // The name of the policy. This name must be unique within the set of policies - // for this load balancer. - PolicyName *string `type:"string"` -} - -// String returns the string representation -func (s LBCookieStickinessPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LBCookieStickinessPolicy) GoString() string { - return s.String() -} - -// SetCookieExpirationPeriod sets the CookieExpirationPeriod field's value. -func (s *LBCookieStickinessPolicy) SetCookieExpirationPeriod(v int64) *LBCookieStickinessPolicy { - s.CookieExpirationPeriod = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *LBCookieStickinessPolicy) SetPolicyName(v string) *LBCookieStickinessPolicy { - s.PolicyName = &v - return s -} - -// Information about a listener. -// -// For information about the protocols and the ports supported by Elastic Load -// Balancing, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) -// in the Classic Load Balancers Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/Listener -type Listener struct { - _ struct{} `type:"structure"` - - // The port on which the instance is listening. - // - // InstancePort is a required field - InstancePort *int64 `min:"1" type:"integer" required:"true"` - - // The protocol to use for routing traffic to instances: HTTP, HTTPS, TCP, or - // SSL. - // - // If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must - // be at the same protocol. - // - // If there is another listener with the same InstancePort whose InstanceProtocol - // is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure. - // - // If there is another listener with the same InstancePort whose InstanceProtocol - // is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP. - InstanceProtocol *string `type:"string"` - - // The port on which the load balancer is listening. On EC2-VPC, you can specify - // any port from the range 1-65535. On EC2-Classic, you can specify any port - // from the following list: 25, 80, 443, 465, 587, 1024-65535. - // - // LoadBalancerPort is a required field - LoadBalancerPort *int64 `type:"integer" required:"true"` - - // The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, - // or SSL. - // - // Protocol is a required field - Protocol *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the server certificate. - SSLCertificateId *string `type:"string"` -} - -// String returns the string representation -func (s Listener) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Listener) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Listener) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Listener"} - if s.InstancePort == nil { - invalidParams.Add(request.NewErrParamRequired("InstancePort")) - } - if s.InstancePort != nil && *s.InstancePort < 1 { - invalidParams.Add(request.NewErrParamMinValue("InstancePort", 1)) - } - if s.LoadBalancerPort == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort")) - } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstancePort sets the InstancePort field's value. -func (s *Listener) SetInstancePort(v int64) *Listener { - s.InstancePort = &v - return s -} - -// SetInstanceProtocol sets the InstanceProtocol field's value. -func (s *Listener) SetInstanceProtocol(v string) *Listener { - s.InstanceProtocol = &v - return s -} - -// SetLoadBalancerPort sets the LoadBalancerPort field's value. -func (s *Listener) SetLoadBalancerPort(v int64) *Listener { - s.LoadBalancerPort = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *Listener) SetProtocol(v string) *Listener { - s.Protocol = &v - return s -} - -// SetSSLCertificateId sets the SSLCertificateId field's value. -func (s *Listener) SetSSLCertificateId(v string) *Listener { - s.SSLCertificateId = &v - return s -} - -// The policies enabled for a listener. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ListenerDescription -type ListenerDescription struct { - _ struct{} `type:"structure"` - - // Information about a listener. - // - // For information about the protocols and the ports supported by Elastic Load - // Balancing, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) - // in the Classic Load Balancers Guide. - Listener *Listener `type:"structure"` - - // The policies. If there are no policies enabled, the list is empty. - PolicyNames []*string `type:"list"` -} - -// String returns the string representation -func (s ListenerDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListenerDescription) GoString() string { - return s.String() -} - -// SetListener sets the Listener field's value. -func (s *ListenerDescription) SetListener(v *Listener) *ListenerDescription { - s.Listener = v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *ListenerDescription) SetPolicyNames(v []*string) *ListenerDescription { - s.PolicyNames = v - return s -} - -// The attributes for a load balancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/LoadBalancerAttributes -type LoadBalancerAttributes struct { - _ struct{} `type:"structure"` - - // If enabled, the load balancer captures detailed information of all requests - // and delivers the information to the Amazon S3 bucket that you specify. - // - // For more information, see Enable Access Logs (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html) - // in the Classic Load Balancers Guide. - AccessLog *AccessLog `type:"structure"` - - // This parameter is reserved. - AdditionalAttributes []*AdditionalAttribute `type:"list"` - - // If enabled, the load balancer allows existing requests to complete before - // the load balancer shifts traffic away from a deregistered or unhealthy instance. - // - // For more information, see Configure Connection Draining (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) - // in the Classic Load Balancers Guide. - ConnectionDraining *ConnectionDraining `type:"structure"` - - // If enabled, the load balancer allows the connections to remain idle (no data - // is sent over the connection) for the specified duration. - // - // By default, Elastic Load Balancing maintains a 60-second idle connection - // timeout for both front-end and back-end connections of your load balancer. - // For more information, see Configure Idle Connection Timeout (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) - // in the Classic Load Balancers Guide. - ConnectionSettings *ConnectionSettings `type:"structure"` - - // If enabled, the load balancer routes the request traffic evenly across all - // instances regardless of the Availability Zones. - // - // For more information, see Configure Cross-Zone Load Balancing (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) - // in the Classic Load Balancers Guide. - CrossZoneLoadBalancing *CrossZoneLoadBalancing `type:"structure"` -} - -// String returns the string representation -func (s LoadBalancerAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancerAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LoadBalancerAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LoadBalancerAttributes"} - if s.AccessLog != nil { - if err := s.AccessLog.Validate(); err != nil { - invalidParams.AddNested("AccessLog", err.(request.ErrInvalidParams)) - } - } - if s.ConnectionDraining != nil { - if err := s.ConnectionDraining.Validate(); err != nil { - invalidParams.AddNested("ConnectionDraining", err.(request.ErrInvalidParams)) - } - } - if s.ConnectionSettings != nil { - if err := s.ConnectionSettings.Validate(); err != nil { - invalidParams.AddNested("ConnectionSettings", err.(request.ErrInvalidParams)) - } - } - if s.CrossZoneLoadBalancing != nil { - if err := s.CrossZoneLoadBalancing.Validate(); err != nil { - invalidParams.AddNested("CrossZoneLoadBalancing", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessLog sets the AccessLog field's value. -func (s *LoadBalancerAttributes) SetAccessLog(v *AccessLog) *LoadBalancerAttributes { - s.AccessLog = v - return s -} - -// SetAdditionalAttributes sets the AdditionalAttributes field's value. -func (s *LoadBalancerAttributes) SetAdditionalAttributes(v []*AdditionalAttribute) *LoadBalancerAttributes { - s.AdditionalAttributes = v - return s -} - -// SetConnectionDraining sets the ConnectionDraining field's value. -func (s *LoadBalancerAttributes) SetConnectionDraining(v *ConnectionDraining) *LoadBalancerAttributes { - s.ConnectionDraining = v - return s -} - -// SetConnectionSettings sets the ConnectionSettings field's value. -func (s *LoadBalancerAttributes) SetConnectionSettings(v *ConnectionSettings) *LoadBalancerAttributes { - s.ConnectionSettings = v - return s -} - -// SetCrossZoneLoadBalancing sets the CrossZoneLoadBalancing field's value. -func (s *LoadBalancerAttributes) SetCrossZoneLoadBalancing(v *CrossZoneLoadBalancing) *LoadBalancerAttributes { - s.CrossZoneLoadBalancing = v - return s -} - -// Information about a load balancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/LoadBalancerDescription -type LoadBalancerDescription struct { - _ struct{} `type:"structure"` - - // The Availability Zones for the load balancer. - AvailabilityZones []*string `type:"list"` - - // Information about your EC2 instances. - BackendServerDescriptions []*BackendServerDescription `type:"list"` - - // The DNS name of the load balancer. - // - // For more information, see Configure a Custom Domain Name (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-domain-names-with-elb.html) - // in the Classic Load Balancers Guide. - CanonicalHostedZoneName *string `type:"string"` - - // The ID of the Amazon Route 53 hosted zone for the load balancer. - CanonicalHostedZoneNameID *string `type:"string"` - - // The date and time the load balancer was created. - CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The DNS name of the load balancer. - DNSName *string `type:"string"` - - // Information about the health checks conducted on the load balancer. - HealthCheck *HealthCheck `type:"structure"` - - // The IDs of the instances for the load balancer. - Instances []*Instance `type:"list"` - - // The listeners for the load balancer. - ListenerDescriptions []*ListenerDescription `type:"list"` - - // The name of the load balancer. - LoadBalancerName *string `type:"string"` - - // The policies defined for the load balancer. - Policies *Policies `type:"structure"` - - // The type of load balancer. Valid only for load balancers in a VPC. - // - // If Scheme is internet-facing, the load balancer has a public DNS name that - // resolves to a public IP address. - // - // If Scheme is internal, the load balancer has a public DNS name that resolves - // to a private IP address. - Scheme *string `type:"string"` - - // The security groups for the load balancer. Valid only for load balancers - // in a VPC. - SecurityGroups []*string `type:"list"` - - // The security group for the load balancer, which you can use as part of your - // inbound rules for your registered instances. To only allow traffic from load - // balancers, add a security group rule that specifies this source security - // group as the inbound source. - SourceSecurityGroup *SourceSecurityGroup `type:"structure"` - - // The IDs of the subnets for the load balancer. - Subnets []*string `type:"list"` - - // The ID of the VPC for the load balancer. - VPCId *string `type:"string"` -} - -// String returns the string representation -func (s LoadBalancerDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancerDescription) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *LoadBalancerDescription) SetAvailabilityZones(v []*string) *LoadBalancerDescription { - s.AvailabilityZones = v - return s -} - -// SetBackendServerDescriptions sets the BackendServerDescriptions field's value. -func (s *LoadBalancerDescription) SetBackendServerDescriptions(v []*BackendServerDescription) *LoadBalancerDescription { - s.BackendServerDescriptions = v - return s -} - -// SetCanonicalHostedZoneName sets the CanonicalHostedZoneName field's value. -func (s *LoadBalancerDescription) SetCanonicalHostedZoneName(v string) *LoadBalancerDescription { - s.CanonicalHostedZoneName = &v - return s -} - -// SetCanonicalHostedZoneNameID sets the CanonicalHostedZoneNameID field's value. -func (s *LoadBalancerDescription) SetCanonicalHostedZoneNameID(v string) *LoadBalancerDescription { - s.CanonicalHostedZoneNameID = &v - return s -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *LoadBalancerDescription) SetCreatedTime(v time.Time) *LoadBalancerDescription { - s.CreatedTime = &v - return s -} - -// SetDNSName sets the DNSName field's value. -func (s *LoadBalancerDescription) SetDNSName(v string) *LoadBalancerDescription { - s.DNSName = &v - return s -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *LoadBalancerDescription) SetHealthCheck(v *HealthCheck) *LoadBalancerDescription { - s.HealthCheck = v - return s -} - -// SetInstances sets the Instances field's value. -func (s *LoadBalancerDescription) SetInstances(v []*Instance) *LoadBalancerDescription { - s.Instances = v - return s -} - -// SetListenerDescriptions sets the ListenerDescriptions field's value. -func (s *LoadBalancerDescription) SetListenerDescriptions(v []*ListenerDescription) *LoadBalancerDescription { - s.ListenerDescriptions = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *LoadBalancerDescription) SetLoadBalancerName(v string) *LoadBalancerDescription { - s.LoadBalancerName = &v - return s -} - -// SetPolicies sets the Policies field's value. -func (s *LoadBalancerDescription) SetPolicies(v *Policies) *LoadBalancerDescription { - s.Policies = v - return s -} - -// SetScheme sets the Scheme field's value. -func (s *LoadBalancerDescription) SetScheme(v string) *LoadBalancerDescription { - s.Scheme = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *LoadBalancerDescription) SetSecurityGroups(v []*string) *LoadBalancerDescription { - s.SecurityGroups = v - return s -} - -// SetSourceSecurityGroup sets the SourceSecurityGroup field's value. -func (s *LoadBalancerDescription) SetSourceSecurityGroup(v *SourceSecurityGroup) *LoadBalancerDescription { - s.SourceSecurityGroup = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *LoadBalancerDescription) SetSubnets(v []*string) *LoadBalancerDescription { - s.Subnets = v - return s -} - -// SetVPCId sets the VPCId field's value. -func (s *LoadBalancerDescription) SetVPCId(v string) *LoadBalancerDescription { - s.VPCId = &v - return s -} - -// Contains the parameters for ModifyLoadBalancerAttributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributesInput -type ModifyLoadBalancerAttributesInput struct { - _ struct{} `type:"structure"` - - // The attributes of the load balancer. - // - // LoadBalancerAttributes is a required field - LoadBalancerAttributes *LoadBalancerAttributes `type:"structure" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyLoadBalancerAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyLoadBalancerAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyLoadBalancerAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyLoadBalancerAttributesInput"} - if s.LoadBalancerAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerAttributes")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.LoadBalancerAttributes != nil { - if err := s.LoadBalancerAttributes.Validate(); err != nil { - invalidParams.AddNested("LoadBalancerAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerAttributes sets the LoadBalancerAttributes field's value. -func (s *ModifyLoadBalancerAttributesInput) SetLoadBalancerAttributes(v *LoadBalancerAttributes) *ModifyLoadBalancerAttributesInput { - s.LoadBalancerAttributes = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *ModifyLoadBalancerAttributesInput) SetLoadBalancerName(v string) *ModifyLoadBalancerAttributesInput { - s.LoadBalancerName = &v - return s -} - -// Contains the output of ModifyLoadBalancerAttributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributesOutput -type ModifyLoadBalancerAttributesOutput struct { - _ struct{} `type:"structure"` - - // The attributes for a load balancer. - LoadBalancerAttributes *LoadBalancerAttributes `type:"structure"` - - // The name of the load balancer. - LoadBalancerName *string `type:"string"` -} - -// String returns the string representation -func (s ModifyLoadBalancerAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyLoadBalancerAttributesOutput) GoString() string { - return s.String() -} - -// SetLoadBalancerAttributes sets the LoadBalancerAttributes field's value. -func (s *ModifyLoadBalancerAttributesOutput) SetLoadBalancerAttributes(v *LoadBalancerAttributes) *ModifyLoadBalancerAttributesOutput { - s.LoadBalancerAttributes = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *ModifyLoadBalancerAttributesOutput) SetLoadBalancerName(v string) *ModifyLoadBalancerAttributesOutput { - s.LoadBalancerName = &v - return s -} - -// The policies for a load balancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/Policies -type Policies struct { - _ struct{} `type:"structure"` - - // The stickiness policies created using CreateAppCookieStickinessPolicy. - AppCookieStickinessPolicies []*AppCookieStickinessPolicy `type:"list"` - - // The stickiness policies created using CreateLBCookieStickinessPolicy. - LBCookieStickinessPolicies []*LBCookieStickinessPolicy `type:"list"` - - // The policies other than the stickiness policies. - OtherPolicies []*string `type:"list"` -} - -// String returns the string representation -func (s Policies) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Policies) GoString() string { - return s.String() -} - -// SetAppCookieStickinessPolicies sets the AppCookieStickinessPolicies field's value. -func (s *Policies) SetAppCookieStickinessPolicies(v []*AppCookieStickinessPolicy) *Policies { - s.AppCookieStickinessPolicies = v - return s -} - -// SetLBCookieStickinessPolicies sets the LBCookieStickinessPolicies field's value. -func (s *Policies) SetLBCookieStickinessPolicies(v []*LBCookieStickinessPolicy) *Policies { - s.LBCookieStickinessPolicies = v - return s -} - -// SetOtherPolicies sets the OtherPolicies field's value. -func (s *Policies) SetOtherPolicies(v []*string) *Policies { - s.OtherPolicies = v - return s -} - -// Information about a policy attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/PolicyAttribute -type PolicyAttribute struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - AttributeName *string `type:"string"` - - // The value of the attribute. - AttributeValue *string `type:"string"` -} - -// String returns the string representation -func (s PolicyAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyAttribute) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *PolicyAttribute) SetAttributeName(v string) *PolicyAttribute { - s.AttributeName = &v - return s -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *PolicyAttribute) SetAttributeValue(v string) *PolicyAttribute { - s.AttributeValue = &v - return s -} - -// Information about a policy attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/PolicyAttributeDescription -type PolicyAttributeDescription struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - AttributeName *string `type:"string"` - - // The value of the attribute. - AttributeValue *string `type:"string"` -} - -// String returns the string representation -func (s PolicyAttributeDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyAttributeDescription) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *PolicyAttributeDescription) SetAttributeName(v string) *PolicyAttributeDescription { - s.AttributeName = &v - return s -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *PolicyAttributeDescription) SetAttributeValue(v string) *PolicyAttributeDescription { - s.AttributeValue = &v - return s -} - -// Information about a policy attribute type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/PolicyAttributeTypeDescription -type PolicyAttributeTypeDescription struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - AttributeName *string `type:"string"` - - // The type of the attribute. For example, Boolean or Integer. - AttributeType *string `type:"string"` - - // The cardinality of the attribute. - // - // Valid values: - // - // * ONE(1) : Single value required - // - // * ZERO_OR_ONE(0..1) : Up to one value is allowed - // - // * ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed - // - // * ONE_OR_MORE(1..*0) : Required. Multiple values are allowed - Cardinality *string `type:"string"` - - // The default value of the attribute, if applicable. - DefaultValue *string `type:"string"` - - // A description of the attribute. - Description *string `type:"string"` -} - -// String returns the string representation -func (s PolicyAttributeTypeDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyAttributeTypeDescription) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *PolicyAttributeTypeDescription) SetAttributeName(v string) *PolicyAttributeTypeDescription { - s.AttributeName = &v - return s -} - -// SetAttributeType sets the AttributeType field's value. -func (s *PolicyAttributeTypeDescription) SetAttributeType(v string) *PolicyAttributeTypeDescription { - s.AttributeType = &v - return s -} - -// SetCardinality sets the Cardinality field's value. -func (s *PolicyAttributeTypeDescription) SetCardinality(v string) *PolicyAttributeTypeDescription { - s.Cardinality = &v - return s -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *PolicyAttributeTypeDescription) SetDefaultValue(v string) *PolicyAttributeTypeDescription { - s.DefaultValue = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *PolicyAttributeTypeDescription) SetDescription(v string) *PolicyAttributeTypeDescription { - s.Description = &v - return s -} - -// Information about a policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/PolicyDescription -type PolicyDescription struct { - _ struct{} `type:"structure"` - - // The policy attributes. - PolicyAttributeDescriptions []*PolicyAttributeDescription `type:"list"` - - // The name of the policy. - PolicyName *string `type:"string"` - - // The name of the policy type. - PolicyTypeName *string `type:"string"` -} - -// String returns the string representation -func (s PolicyDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyDescription) GoString() string { - return s.String() -} - -// SetPolicyAttributeDescriptions sets the PolicyAttributeDescriptions field's value. -func (s *PolicyDescription) SetPolicyAttributeDescriptions(v []*PolicyAttributeDescription) *PolicyDescription { - s.PolicyAttributeDescriptions = v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PolicyDescription) SetPolicyName(v string) *PolicyDescription { - s.PolicyName = &v - return s -} - -// SetPolicyTypeName sets the PolicyTypeName field's value. -func (s *PolicyDescription) SetPolicyTypeName(v string) *PolicyDescription { - s.PolicyTypeName = &v - return s -} - -// Information about a policy type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/PolicyTypeDescription -type PolicyTypeDescription struct { - _ struct{} `type:"structure"` - - // A description of the policy type. - Description *string `type:"string"` - - // The description of the policy attributes associated with the policies defined - // by Elastic Load Balancing. - PolicyAttributeTypeDescriptions []*PolicyAttributeTypeDescription `type:"list"` - - // The name of the policy type. - PolicyTypeName *string `type:"string"` -} - -// String returns the string representation -func (s PolicyTypeDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyTypeDescription) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *PolicyTypeDescription) SetDescription(v string) *PolicyTypeDescription { - s.Description = &v - return s -} - -// SetPolicyAttributeTypeDescriptions sets the PolicyAttributeTypeDescriptions field's value. -func (s *PolicyTypeDescription) SetPolicyAttributeTypeDescriptions(v []*PolicyAttributeTypeDescription) *PolicyTypeDescription { - s.PolicyAttributeTypeDescriptions = v - return s -} - -// SetPolicyTypeName sets the PolicyTypeName field's value. -func (s *PolicyTypeDescription) SetPolicyTypeName(v string) *PolicyTypeDescription { - s.PolicyTypeName = &v - return s -} - -// Contains the parameters for RegisterInstancesWithLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterEndPointsInput -type RegisterInstancesWithLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The IDs of the instances. - // - // Instances is a required field - Instances []*Instance `type:"list" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterInstancesWithLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterInstancesWithLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterInstancesWithLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterInstancesWithLoadBalancerInput"} - if s.Instances == nil { - invalidParams.Add(request.NewErrParamRequired("Instances")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstances sets the Instances field's value. -func (s *RegisterInstancesWithLoadBalancerInput) SetInstances(v []*Instance) *RegisterInstancesWithLoadBalancerInput { - s.Instances = v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *RegisterInstancesWithLoadBalancerInput) SetLoadBalancerName(v string) *RegisterInstancesWithLoadBalancerInput { - s.LoadBalancerName = &v - return s -} - -// Contains the output of RegisterInstancesWithLoadBalancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterEndPointsOutput -type RegisterInstancesWithLoadBalancerOutput struct { - _ struct{} `type:"structure"` - - // The updated list of instances for the load balancer. - Instances []*Instance `type:"list"` -} - -// String returns the string representation -func (s RegisterInstancesWithLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterInstancesWithLoadBalancerOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *RegisterInstancesWithLoadBalancerOutput) SetInstances(v []*Instance) *RegisterInstancesWithLoadBalancerOutput { - s.Instances = v - return s -} - -// Contains the parameters for RemoveTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTagsInput -type RemoveTagsInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. You can specify a maximum of one load balancer - // name. - // - // LoadBalancerNames is a required field - LoadBalancerNames []*string `type:"list" required:"true"` - - // The list of tag keys to remove. - // - // Tags is a required field - Tags []*TagKeyOnly `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"} - if s.LoadBalancerNames == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - 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 -} - -// SetLoadBalancerNames sets the LoadBalancerNames field's value. -func (s *RemoveTagsInput) SetLoadBalancerNames(v []*string) *RemoveTagsInput { - s.LoadBalancerNames = v - return s -} - -// SetTags sets the Tags field's value. -func (s *RemoveTagsInput) SetTags(v []*TagKeyOnly) *RemoveTagsInput { - s.Tags = v - return s -} - -// Contains the output of RemoveTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTagsOutput -type RemoveTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsOutput) GoString() string { - return s.String() -} - -// Contains the parameters for SetLoadBalancerListenerSSLCertificate. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificateInput -type SetLoadBalancerListenerSSLCertificateInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The port that uses the specified SSL certificate. - // - // LoadBalancerPort is a required field - LoadBalancerPort *int64 `type:"integer" required:"true"` - - // The Amazon Resource Name (ARN) of the SSL certificate. - // - // SSLCertificateId is a required field - SSLCertificateId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetLoadBalancerListenerSSLCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetLoadBalancerListenerSSLCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetLoadBalancerListenerSSLCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerListenerSSLCertificateInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.LoadBalancerPort == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort")) - } - if s.SSLCertificateId == nil { - invalidParams.Add(request.NewErrParamRequired("SSLCertificateId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *SetLoadBalancerListenerSSLCertificateInput) SetLoadBalancerName(v string) *SetLoadBalancerListenerSSLCertificateInput { - s.LoadBalancerName = &v - return s -} - -// SetLoadBalancerPort sets the LoadBalancerPort field's value. -func (s *SetLoadBalancerListenerSSLCertificateInput) SetLoadBalancerPort(v int64) *SetLoadBalancerListenerSSLCertificateInput { - s.LoadBalancerPort = &v - return s -} - -// SetSSLCertificateId sets the SSLCertificateId field's value. -func (s *SetLoadBalancerListenerSSLCertificateInput) SetSSLCertificateId(v string) *SetLoadBalancerListenerSSLCertificateInput { - s.SSLCertificateId = &v - return s -} - -// Contains the output of SetLoadBalancerListenerSSLCertificate. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificateOutput -type SetLoadBalancerListenerSSLCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetLoadBalancerListenerSSLCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetLoadBalancerListenerSSLCertificateOutput) GoString() string { - return s.String() -} - -// Contains the parameters for SetLoadBalancerPoliciesForBackendServer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServerInput -type SetLoadBalancerPoliciesForBackendServerInput struct { - _ struct{} `type:"structure"` - - // The port number associated with the EC2 instance. - // - // InstancePort is a required field - InstancePort *int64 `type:"integer" required:"true"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The names of the policies. If the list is empty, then all current polices - // are removed from the EC2 instance. - // - // PolicyNames is a required field - PolicyNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s SetLoadBalancerPoliciesForBackendServerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetLoadBalancerPoliciesForBackendServerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetLoadBalancerPoliciesForBackendServerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerPoliciesForBackendServerInput"} - if s.InstancePort == nil { - invalidParams.Add(request.NewErrParamRequired("InstancePort")) - } - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.PolicyNames == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstancePort sets the InstancePort field's value. -func (s *SetLoadBalancerPoliciesForBackendServerInput) SetInstancePort(v int64) *SetLoadBalancerPoliciesForBackendServerInput { - s.InstancePort = &v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *SetLoadBalancerPoliciesForBackendServerInput) SetLoadBalancerName(v string) *SetLoadBalancerPoliciesForBackendServerInput { - s.LoadBalancerName = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *SetLoadBalancerPoliciesForBackendServerInput) SetPolicyNames(v []*string) *SetLoadBalancerPoliciesForBackendServerInput { - s.PolicyNames = v - return s -} - -// Contains the output of SetLoadBalancerPoliciesForBackendServer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServerOutput -type SetLoadBalancerPoliciesForBackendServerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetLoadBalancerPoliciesForBackendServerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetLoadBalancerPoliciesForBackendServerOutput) GoString() string { - return s.String() -} - -// Contains the parameters for SetLoadBalancePoliciesOfListener. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListenerInput -type SetLoadBalancerPoliciesOfListenerInput struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // LoadBalancerName is a required field - LoadBalancerName *string `type:"string" required:"true"` - - // The external port of the load balancer. - // - // LoadBalancerPort is a required field - LoadBalancerPort *int64 `type:"integer" required:"true"` - - // The names of the policies. This list must include all policies to be enabled. - // If you omit a policy that is currently enabled, it is disabled. If the list - // is empty, all current policies are disabled. - // - // PolicyNames is a required field - PolicyNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s SetLoadBalancerPoliciesOfListenerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetLoadBalancerPoliciesOfListenerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetLoadBalancerPoliciesOfListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerPoliciesOfListenerInput"} - if s.LoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) - } - if s.LoadBalancerPort == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort")) - } - if s.PolicyNames == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *SetLoadBalancerPoliciesOfListenerInput) SetLoadBalancerName(v string) *SetLoadBalancerPoliciesOfListenerInput { - s.LoadBalancerName = &v - return s -} - -// SetLoadBalancerPort sets the LoadBalancerPort field's value. -func (s *SetLoadBalancerPoliciesOfListenerInput) SetLoadBalancerPort(v int64) *SetLoadBalancerPoliciesOfListenerInput { - s.LoadBalancerPort = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *SetLoadBalancerPoliciesOfListenerInput) SetPolicyNames(v []*string) *SetLoadBalancerPoliciesOfListenerInput { - s.PolicyNames = v - return s -} - -// Contains the output of SetLoadBalancePoliciesOfListener. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListenerOutput -type SetLoadBalancerPoliciesOfListenerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetLoadBalancerPoliciesOfListenerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetLoadBalancerPoliciesOfListenerOutput) GoString() string { - return s.String() -} - -// Information about a source security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SourceSecurityGroup -type SourceSecurityGroup struct { - _ struct{} `type:"structure"` - - // The name of the security group. - GroupName *string `type:"string"` - - // The owner of the security group. - OwnerAlias *string `type:"string"` -} - -// String returns the string representation -func (s SourceSecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceSecurityGroup) GoString() string { - return s.String() -} - -// SetGroupName sets the GroupName field's value. -func (s *SourceSecurityGroup) SetGroupName(v string) *SourceSecurityGroup { - s.GroupName = &v - return s -} - -// SetOwnerAlias sets the OwnerAlias field's value. -func (s *SourceSecurityGroup) SetOwnerAlias(v string) *SourceSecurityGroup { - s.OwnerAlias = &v - return s -} - -// Information about a tag. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value of 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() -} - -// 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 -} - -// The tags associated with a load balancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/TagDescription -type TagDescription struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - LoadBalancerName *string `type:"string"` - - // The tags. - Tags []*Tag `min:"1" type:"list"` -} - -// 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() -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *TagDescription) SetLoadBalancerName(v string) *TagDescription { - s.LoadBalancerName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagDescription) SetTags(v []*Tag) *TagDescription { - s.Tags = v - return s -} - -// The key of a tag. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/TagKeyOnly -type TagKeyOnly struct { - _ struct{} `type:"structure"` - - // The name of the key. - Key *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s TagKeyOnly) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagKeyOnly) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagKeyOnly) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagKeyOnly"} - 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 *TagKeyOnly) SetKey(v string) *TagKeyOnly { - s.Key = &v - return s -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go deleted file mode 100644 index aab5399..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go +++ /dev/null @@ -1,134 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elb - -const ( - - // ErrCodeAccessPointNotFoundException for service response error code - // "LoadBalancerNotFound". - // - // The specified load balancer does not exist. - ErrCodeAccessPointNotFoundException = "LoadBalancerNotFound" - - // ErrCodeCertificateNotFoundException for service response error code - // "CertificateNotFound". - // - // The specified ARN does not refer to a valid SSL certificate in AWS Identity - // and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if - // you recently uploaded the certificate to IAM, this error might indicate that - // the certificate is not fully available yet. - ErrCodeCertificateNotFoundException = "CertificateNotFound" - - // ErrCodeDependencyThrottleException for service response error code - // "DependencyThrottle". - ErrCodeDependencyThrottleException = "DependencyThrottle" - - // ErrCodeDuplicateAccessPointNameException for service response error code - // "DuplicateLoadBalancerName". - // - // The specified load balancer name already exists for this account. - ErrCodeDuplicateAccessPointNameException = "DuplicateLoadBalancerName" - - // ErrCodeDuplicateListenerException for service response error code - // "DuplicateListener". - // - // A listener already exists for the specified load balancer name and port, - // but with a different instance port, protocol, or SSL certificate. - ErrCodeDuplicateListenerException = "DuplicateListener" - - // ErrCodeDuplicatePolicyNameException for service response error code - // "DuplicatePolicyName". - // - // A policy with the specified name already exists for this load balancer. - ErrCodeDuplicatePolicyNameException = "DuplicatePolicyName" - - // ErrCodeDuplicateTagKeysException for service response error code - // "DuplicateTagKeys". - // - // A tag key was specified more than once. - ErrCodeDuplicateTagKeysException = "DuplicateTagKeys" - - // ErrCodeInvalidConfigurationRequestException for service response error code - // "InvalidConfigurationRequest". - // - // The requested configuration change is not valid. - ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest" - - // ErrCodeInvalidEndPointException for service response error code - // "InvalidInstance". - // - // The specified endpoint is not valid. - ErrCodeInvalidEndPointException = "InvalidInstance" - - // ErrCodeInvalidSchemeException for service response error code - // "InvalidScheme". - // - // The specified value for the schema is not valid. You can only specify a scheme - // for load balancers in a VPC. - ErrCodeInvalidSchemeException = "InvalidScheme" - - // ErrCodeInvalidSecurityGroupException for service response error code - // "InvalidSecurityGroup". - // - // One or more of the specified security groups do not exist. - ErrCodeInvalidSecurityGroupException = "InvalidSecurityGroup" - - // ErrCodeInvalidSubnetException for service response error code - // "InvalidSubnet". - // - // The specified VPC has no associated Internet gateway. - ErrCodeInvalidSubnetException = "InvalidSubnet" - - // ErrCodeListenerNotFoundException for service response error code - // "ListenerNotFound". - // - // The load balancer does not have a listener configured at the specified port. - ErrCodeListenerNotFoundException = "ListenerNotFound" - - // ErrCodeLoadBalancerAttributeNotFoundException for service response error code - // "LoadBalancerAttributeNotFound". - // - // The specified load balancer attribute does not exist. - ErrCodeLoadBalancerAttributeNotFoundException = "LoadBalancerAttributeNotFound" - - // ErrCodePolicyNotFoundException for service response error code - // "PolicyNotFound". - // - // One or more of the specified policies do not exist. - ErrCodePolicyNotFoundException = "PolicyNotFound" - - // ErrCodePolicyTypeNotFoundException for service response error code - // "PolicyTypeNotFound". - // - // One or more of the specified policy types do not exist. - ErrCodePolicyTypeNotFoundException = "PolicyTypeNotFound" - - // ErrCodeSubnetNotFoundException for service response error code - // "SubnetNotFound". - // - // One or more of the specified subnets do not exist. - ErrCodeSubnetNotFoundException = "SubnetNotFound" - - // ErrCodeTooManyAccessPointsException for service response error code - // "TooManyLoadBalancers". - // - // The quota for the number of load balancers has been reached. - ErrCodeTooManyAccessPointsException = "TooManyLoadBalancers" - - // ErrCodeTooManyPoliciesException for service response error code - // "TooManyPolicies". - // - // The quota for the number of policies for this load balancer has been reached. - ErrCodeTooManyPoliciesException = "TooManyPolicies" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTags". - // - // The quota for the number of tags that can be assigned to a load balancer - // has been reached. - ErrCodeTooManyTagsException = "TooManyTags" - - // ErrCodeUnsupportedProtocolException for service response error code - // "UnsupportedProtocol". - ErrCodeUnsupportedProtocolException = "UnsupportedProtocol" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/service.go b/vendor/github.com/aws/aws-sdk-go/service/elb/service.go deleted file mode 100644 index 68d7e2a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/service.go +++ /dev/null @@ -1,117 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elb - -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" -) - -// A load balancer distributes incoming traffic across your EC2 instances. This -// enables you to increase the availability of your application. The load balancer -// also monitors the health of its registered instances and ensures that it -// routes traffic only to healthy instances. You configure your load balancer -// to accept incoming traffic by specifying one or more listeners, which are -// configured with a protocol and port number for connections from clients to -// the load balancer and a protocol and port number for connections from the -// load balancer to the instances. -// -// Elastic Load Balancing supports two types of load balancers: Classic load -// balancers and Application load balancers (new). A Classic load balancer makes -// routing and load balancing decisions either at the transport layer (TCP/SSL) -// or the application layer (HTTP/HTTPS), and supports either EC2-Classic or -// a VPC. An Application load balancer makes routing and load balancing decisions -// at the application layer (HTTP/HTTPS), supports path-based routing, and can -// route requests to one or more ports on each EC2 instance or container instance -// in your virtual private cloud (VPC). For more information, see the . -// -// This reference covers the 2012-06-01 API, which supports Classic load balancers. -// The 2015-12-01 API supports Application load balancers. -// -// To get started, create a load balancer with one or more listeners using CreateLoadBalancer. -// Register your instances with the load balancer using RegisterInstancesWithLoadBalancer. -// -// All Elastic Load Balancing operations are idempotent, which means that they -// complete at most one time. If you repeat an operation, it succeeds with a -// 200 OK response code. -// 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/elasticloadbalancing-2012-06-01 -type ELB 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 = "elasticloadbalancing" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ELB 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 ELB client from just a session. -// svc := elb.New(mySession) -// -// // Create a ELB client with additional configuration -// svc := elb.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ELB { - 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) *ELB { - svc := &ELB{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2012-06-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ELB operation and runs any -// custom request initialization. -func (c *ELB) 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/elb/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go deleted file mode 100644 index 89fc1d8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go +++ /dev/null @@ -1,94 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elb - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilAnyInstanceInService uses the Elastic Load Balancing API operation -// DescribeInstanceHealth 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 *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceHealth", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAny", - Argument: "InstanceStates[].State", - Expected: "InService", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilInstanceDeregistered uses the Elastic Load Balancing API operation -// DescribeInstanceHealth 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 *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceHealth", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "InstanceStates[].State", - Expected: "OutOfService", - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "InvalidInstance", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilInstanceInService uses the Elastic Load Balancing API operation -// DescribeInstanceHealth 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 *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstanceHealth", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "InstanceStates[].State", - Expected: "InService", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go b/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go deleted file mode 100644 index 2098550..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go +++ /dev/null @@ -1,6353 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elbv2 provides a client for Elastic Load Balancing. -package elbv2 - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAddTags = "AddTags" - -// AddTagsRequest generates a "aws/request.Request" representing the -// client's request for the AddTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsRequest method. -// req, resp := client.AddTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddTags -func (c *ELBV2) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { - op := &request.Operation{ - Name: opAddTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsInput{} - } - - output = &AddTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddTags API operation for Elastic Load Balancing. -// -// Adds the specified tags to the specified resource. You can tag your Application -// Load Balancers and your target groups. -// -// Each tag consists of a key and an optional value. If a resource already has -// a tag with the same key, AddTags updates its value. -// -// To list the current tags for your resources, use DescribeTags. To remove -// tags from your resources, use RemoveTags. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation AddTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeys" -// A tag key was specified more than once. -// -// * ErrCodeTooManyTagsException "TooManyTags" -// You've reached the limit on the number of tags per load balancer. -// -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddTags -func (c *ELBV2) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { - req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err -} - -const opCreateListener = "CreateListener" - -// CreateListenerRequest generates a "aws/request.Request" representing the -// client's request for the CreateListener operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateListener for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateListener method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateListenerRequest method. -// req, resp := client.CreateListenerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateListener -func (c *ELBV2) CreateListenerRequest(input *CreateListenerInput) (req *request.Request, output *CreateListenerOutput) { - op := &request.Operation{ - Name: opCreateListener, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateListenerInput{} - } - - output = &CreateListenerOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateListener API operation for Elastic Load Balancing. -// -// Creates a listener for the specified Application Load Balancer. -// -// You can create up to 10 listeners per load balancer. -// -// To update a listener, use ModifyListener. When you are finished with a listener, -// you can delete it using DeleteListener. If you are finished with both the -// listener and the load balancer, you can delete them both using DeleteLoadBalancer. -// -// For more information, see Listeners for Your Application Load Balancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html) -// in the Application Load Balancers 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 Elastic Load Balancing's -// API operation CreateListener for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDuplicateListenerException "DuplicateListener" -// A listener with the specified port already exists. -// -// * ErrCodeTooManyListenersException "TooManyListeners" -// You've reached the limit on the number of listeners per load balancer. -// -// * ErrCodeTooManyCertificatesException "TooManyCertificates" -// You've reached the limit on the number of certificates per listener. -// -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// * ErrCodeTargetGroupAssociationLimitException "TargetGroupAssociationLimit" -// You've reached the limit on the number of load balancers per target group. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration is not valid. -// -// * ErrCodeIncompatibleProtocolsException "IncompatibleProtocols" -// The specified configuration is not valid with this protocol. -// -// * ErrCodeSSLPolicyNotFoundException "SSLPolicyNotFound" -// The specified SSL policy does not exist. -// -// * ErrCodeCertificateNotFoundException "CertificateNotFound" -// The specified certificate does not exist. -// -// * ErrCodeUnsupportedProtocolException "UnsupportedProtocol" -// The specified protocol is not supported. -// -// * ErrCodeTooManyRegistrationsForTargetIdException "TooManyRegistrationsForTargetId" -// You've reached the limit on the number of times a target can be registered -// with a load balancer. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateListener -func (c *ELBV2) CreateListener(input *CreateListenerInput) (*CreateListenerOutput, error) { - req, out := c.CreateListenerRequest(input) - err := req.Send() - return out, err -} - -const opCreateLoadBalancer = "CreateLoadBalancer" - -// CreateLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the CreateLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLoadBalancerRequest method. -// req, resp := client.CreateLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateLoadBalancer -func (c *ELBV2) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *request.Request, output *CreateLoadBalancerOutput) { - op := &request.Operation{ - Name: opCreateLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLoadBalancerInput{} - } - - output = &CreateLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLoadBalancer API operation for Elastic Load Balancing. -// -// Creates an Application Load Balancer. -// -// When you create a load balancer, you can specify security groups, subnets, -// IP address type, and tags. Otherwise, you could do so later using SetSecurityGroups, -// SetSubnets, SetIpAddressType, and AddTags. -// -// To create listeners for your load balancer, use CreateListener. To describe -// your current load balancers, see DescribeLoadBalancers. When you are finished -// with a load balancer, you can delete it using DeleteLoadBalancer. -// -// You can create up to 20 load balancers per region per account. You can request -// an increase for the number of load balancers for your account. For more information, -// see Limits for Your Application Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html) -// in the Application Load Balancers Guide. -// -// For more information, see Application Load Balancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html) -// in the Application Load Balancers 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 Elastic Load Balancing's -// API operation CreateLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDuplicateLoadBalancerNameException "DuplicateLoadBalancerName" -// A load balancer with the specified name already exists for this account. -// -// * ErrCodeTooManyLoadBalancersException "TooManyLoadBalancers" -// You've reached the limit on the number of load balancers for your AWS account. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration is not valid. -// -// * ErrCodeSubnetNotFoundException "SubnetNotFound" -// The specified subnet does not exist. -// -// * ErrCodeInvalidSubnetException "InvalidSubnet" -// The specified subnet is out of available addresses. -// -// * ErrCodeInvalidSecurityGroupException "InvalidSecurityGroup" -// The specified security group does not exist. -// -// * ErrCodeInvalidSchemeException "InvalidScheme" -// The requested scheme is not valid. -// -// * ErrCodeTooManyTagsException "TooManyTags" -// You've reached the limit on the number of tags per load balancer. -// -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeys" -// A tag key was specified more than once. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateLoadBalancer -func (c *ELBV2) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) { - req, out := c.CreateLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opCreateRule = "CreateRule" - -// CreateRuleRequest generates a "aws/request.Request" representing the -// client's request for the CreateRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateRuleRequest method. -// req, resp := client.CreateRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateRule -func (c *ELBV2) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, output *CreateRuleOutput) { - op := &request.Operation{ - Name: opCreateRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRuleInput{} - } - - output = &CreateRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRule API operation for Elastic Load Balancing. -// -// Creates a rule for the specified listener. -// -// Each rule can have one action and one condition. Rules are evaluated in priority -// order, from the lowest value to the highest value. When the condition for -// a rule is met, the specified action is taken. If no conditions are met, the -// default action for the default rule is taken. For more information, see Listener -// Rules (http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#listener-rules) -// in the Application Load Balancers Guide. -// -// To view your current rules, use DescribeRules. To update a rule, use ModifyRule. -// To set the priorities of your rules, use SetRulePriorities. To delete a rule, -// use DeleteRule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation CreateRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodePriorityInUseException "PriorityInUse" -// The specified priority is in use. -// -// * ErrCodeTooManyTargetGroupsException "TooManyTargetGroups" -// You've reached the limit on the number of target groups for your AWS account. -// -// * ErrCodeTooManyRulesException "TooManyRules" -// You've reached the limit on the number of rules per load balancer. -// -// * ErrCodeTargetGroupAssociationLimitException "TargetGroupAssociationLimit" -// You've reached the limit on the number of load balancers per target group. -// -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The specified listener does not exist. -// -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration is not valid. -// -// * ErrCodeTooManyRegistrationsForTargetIdException "TooManyRegistrationsForTargetId" -// You've reached the limit on the number of times a target can be registered -// with a load balancer. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateRule -func (c *ELBV2) CreateRule(input *CreateRuleInput) (*CreateRuleOutput, error) { - req, out := c.CreateRuleRequest(input) - err := req.Send() - return out, err -} - -const opCreateTargetGroup = "CreateTargetGroup" - -// CreateTargetGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateTargetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTargetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTargetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTargetGroupRequest method. -// req, resp := client.CreateTargetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateTargetGroup -func (c *ELBV2) CreateTargetGroupRequest(input *CreateTargetGroupInput) (req *request.Request, output *CreateTargetGroupOutput) { - op := &request.Operation{ - Name: opCreateTargetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTargetGroupInput{} - } - - output = &CreateTargetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTargetGroup API operation for Elastic Load Balancing. -// -// Creates a target group. -// -// To register targets with the target group, use RegisterTargets. To update -// the health check settings for the target group, use ModifyTargetGroup. To -// monitor the health of targets in the target group, use DescribeTargetHealth. -// -// To route traffic to the targets in a target group, specify the target group -// in an action using CreateListener or CreateRule. -// -// To delete a target group, use DeleteTargetGroup. -// -// For more information, see Target Groups for Your Application Load Balancers -// (http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html) -// in the Application Load Balancers 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 Elastic Load Balancing's -// API operation CreateTargetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDuplicateTargetGroupNameException "DuplicateTargetGroupName" -// A target group with the specified name already exists. -// -// * ErrCodeTooManyTargetGroupsException "TooManyTargetGroups" -// You've reached the limit on the number of target groups for your AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateTargetGroup -func (c *ELBV2) CreateTargetGroup(input *CreateTargetGroupInput) (*CreateTargetGroupOutput, error) { - req, out := c.CreateTargetGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteListener = "DeleteListener" - -// DeleteListenerRequest generates a "aws/request.Request" representing the -// client's request for the DeleteListener operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteListener for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteListener method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteListenerRequest method. -// req, resp := client.DeleteListenerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteListener -func (c *ELBV2) DeleteListenerRequest(input *DeleteListenerInput) (req *request.Request, output *DeleteListenerOutput) { - op := &request.Operation{ - Name: opDeleteListener, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteListenerInput{} - } - - output = &DeleteListenerOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteListener API operation for Elastic Load Balancing. -// -// Deletes the specified listener. -// -// Alternatively, your listener is deleted when you delete the load balancer -// it is attached to using DeleteLoadBalancer. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DeleteListener for usage and error information. -// -// Returned Error Codes: -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The specified listener does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteListener -func (c *ELBV2) DeleteListener(input *DeleteListenerInput) (*DeleteListenerOutput, error) { - req, out := c.DeleteListenerRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLoadBalancer = "DeleteLoadBalancer" - -// DeleteLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLoadBalancerRequest method. -// req, resp := client.DeleteLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteLoadBalancer -func (c *ELBV2) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *request.Request, output *DeleteLoadBalancerOutput) { - op := &request.Operation{ - Name: opDeleteLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLoadBalancerInput{} - } - - output = &DeleteLoadBalancerOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteLoadBalancer API operation for Elastic Load Balancing. -// -// Deletes the specified Application Load Balancer and its attached listeners. -// -// You can't delete a load balancer if deletion protection is enabled. If the -// load balancer does not exist or has already been deleted, the call succeeds. -// -// Deleting a load balancer does not affect its registered targets. For example, -// your EC2 instances continue to run and are still registered to their target -// groups. If you no longer need these EC2 instances, you can stop or terminate -// them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DeleteLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermitted" -// This operation is not allowed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteLoadBalancer -func (c *ELBV2) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (*DeleteLoadBalancerOutput, error) { - req, out := c.DeleteLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRule = "DeleteRule" - -// DeleteRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRuleRequest method. -// req, resp := client.DeleteRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteRule -func (c *ELBV2) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, output *DeleteRuleOutput) { - op := &request.Operation{ - Name: opDeleteRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRuleInput{} - } - - output = &DeleteRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteRule API operation for Elastic Load Balancing. -// -// Deletes the specified rule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DeleteRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleNotFoundException "RuleNotFound" -// The specified rule does not exist. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermitted" -// This operation is not allowed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteRule -func (c *ELBV2) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { - req, out := c.DeleteRuleRequest(input) - err := req.Send() - return out, err -} - -const opDeleteTargetGroup = "DeleteTargetGroup" - -// DeleteTargetGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTargetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteTargetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteTargetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteTargetGroupRequest method. -// req, resp := client.DeleteTargetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteTargetGroup -func (c *ELBV2) DeleteTargetGroupRequest(input *DeleteTargetGroupInput) (req *request.Request, output *DeleteTargetGroupOutput) { - op := &request.Operation{ - Name: opDeleteTargetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTargetGroupInput{} - } - - output = &DeleteTargetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTargetGroup API operation for Elastic Load Balancing. -// -// Deletes the specified target group. -// -// You can delete a target group if it is not referenced by any actions. Deleting -// a target group also deletes any associated health checks. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DeleteTargetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUse" -// A specified resource is in use. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteTargetGroup -func (c *ELBV2) DeleteTargetGroup(input *DeleteTargetGroupInput) (*DeleteTargetGroupOutput, error) { - req, out := c.DeleteTargetGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterTargets = "DeregisterTargets" - -// DeregisterTargetsRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterTargetsRequest method. -// req, resp := client.DeregisterTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeregisterTargets -func (c *ELBV2) DeregisterTargetsRequest(input *DeregisterTargetsInput) (req *request.Request, output *DeregisterTargetsOutput) { - op := &request.Operation{ - Name: opDeregisterTargets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterTargetsInput{} - } - - output = &DeregisterTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterTargets API operation for Elastic Load Balancing. -// -// Deregisters the specified targets from the specified target group. After -// the targets are deregistered, they no longer receive traffic from the load -// balancer. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DeregisterTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// * ErrCodeInvalidTargetException "InvalidTarget" -// The specified target does not exist or is not in the same VPC as the target -// group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeregisterTargets -func (c *ELBV2) DeregisterTargets(input *DeregisterTargetsInput) (*DeregisterTargetsOutput, error) { - req, out := c.DeregisterTargetsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeListeners = "DescribeListeners" - -// DescribeListenersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeListeners operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeListeners for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeListeners method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeListenersRequest method. -// req, resp := client.DescribeListenersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListeners -func (c *ELBV2) DescribeListenersRequest(input *DescribeListenersInput) (req *request.Request, output *DescribeListenersOutput) { - op := &request.Operation{ - Name: opDescribeListeners, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeListenersInput{} - } - - output = &DescribeListenersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeListeners API operation for Elastic Load Balancing. -// -// Describes the specified listeners or the listeners for the specified Application -// Load Balancer. You must specify either a load balancer or one or more listeners. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeListeners for usage and error information. -// -// Returned Error Codes: -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The specified listener does not exist. -// -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListeners -func (c *ELBV2) DescribeListeners(input *DescribeListenersInput) (*DescribeListenersOutput, error) { - req, out := c.DescribeListenersRequest(input) - err := req.Send() - return out, err -} - -// DescribeListenersPages iterates over the pages of a DescribeListeners operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeListeners 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 DescribeListeners operation. -// pageNum := 0 -// err := client.DescribeListenersPages(params, -// func(page *DescribeListenersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ELBV2) DescribeListenersPages(input *DescribeListenersInput, fn func(p *DescribeListenersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeListenersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeListenersOutput), lastPage) - }) -} - -const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" - -// DescribeLoadBalancerAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBalancerAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBalancerAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBalancerAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBalancerAttributesRequest method. -// req, resp := client.DescribeLoadBalancerAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancerAttributes -func (c *ELBV2) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerAttributesInput) (req *request.Request, output *DescribeLoadBalancerAttributesOutput) { - op := &request.Operation{ - Name: opDescribeLoadBalancerAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLoadBalancerAttributesInput{} - } - - output = &DescribeLoadBalancerAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBalancerAttributes API operation for Elastic Load Balancing. -// -// Describes the attributes for the specified Application Load Balancer. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeLoadBalancerAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancerAttributes -func (c *ELBV2) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttributesInput) (*DescribeLoadBalancerAttributesOutput, error) { - req, out := c.DescribeLoadBalancerAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLoadBalancers = "DescribeLoadBalancers" - -// DescribeLoadBalancersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBalancers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBalancers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBalancers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBalancersRequest method. -// req, resp := client.DescribeLoadBalancersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancers -func (c *ELBV2) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *request.Request, output *DescribeLoadBalancersOutput) { - op := &request.Operation{ - Name: opDescribeLoadBalancers, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeLoadBalancersInput{} - } - - output = &DescribeLoadBalancersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBalancers API operation for Elastic Load Balancing. -// -// Describes the specified Application Load Balancers or all of your Application -// Load Balancers. -// -// To describe the listeners for a load balancer, use DescribeListeners. To -// describe the attributes for a load balancer, use DescribeLoadBalancerAttributes. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeLoadBalancers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancers -func (c *ELBV2) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { - req, out := c.DescribeLoadBalancersRequest(input) - err := req.Send() - return out, err -} - -// DescribeLoadBalancersPages iterates over the pages of a DescribeLoadBalancers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeLoadBalancers 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 DescribeLoadBalancers operation. -// pageNum := 0 -// err := client.DescribeLoadBalancersPages(params, -// func(page *DescribeLoadBalancersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ELBV2) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(p *DescribeLoadBalancersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeLoadBalancersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeLoadBalancersOutput), lastPage) - }) -} - -const opDescribeRules = "DescribeRules" - -// DescribeRulesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRules operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRules for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRules method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRulesRequest method. -// req, resp := client.DescribeRulesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeRules -func (c *ELBV2) DescribeRulesRequest(input *DescribeRulesInput) (req *request.Request, output *DescribeRulesOutput) { - op := &request.Operation{ - Name: opDescribeRules, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRulesInput{} - } - - output = &DescribeRulesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRules API operation for Elastic Load Balancing. -// -// Describes the specified rules or the rules for the specified listener. You -// must specify either a listener or one or more rules. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeRules for usage and error information. -// -// Returned Error Codes: -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The specified listener does not exist. -// -// * ErrCodeRuleNotFoundException "RuleNotFound" -// The specified rule does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeRules -func (c *ELBV2) DescribeRules(input *DescribeRulesInput) (*DescribeRulesOutput, error) { - req, out := c.DescribeRulesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeSSLPolicies = "DescribeSSLPolicies" - -// DescribeSSLPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSSLPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSSLPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSSLPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSSLPoliciesRequest method. -// req, resp := client.DescribeSSLPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeSSLPolicies -func (c *ELBV2) DescribeSSLPoliciesRequest(input *DescribeSSLPoliciesInput) (req *request.Request, output *DescribeSSLPoliciesOutput) { - op := &request.Operation{ - Name: opDescribeSSLPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSSLPoliciesInput{} - } - - output = &DescribeSSLPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSSLPolicies API operation for Elastic Load Balancing. -// -// Describes the specified policies or all policies used for SSL negotiation. -// -// Note that the only supported policy at this time is ELBSecurityPolicy-2015-05. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeSSLPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSSLPolicyNotFoundException "SSLPolicyNotFound" -// The specified SSL policy does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeSSLPolicies -func (c *ELBV2) DescribeSSLPolicies(input *DescribeSSLPoliciesInput) (*DescribeSSLPoliciesOutput, error) { - req, out := c.DescribeSSLPoliciesRequest(input) - err := req.Send() - return out, err -} - -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/elasticloadbalancingv2-2015-12-01/DescribeTags -func (c *ELBV2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { - op := &request.Operation{ - Name: opDescribeTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTagsInput{} - } - - output = &DescribeTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTags API operation for Elastic Load Balancing. -// -// Describes the tags for the specified 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 Elastic Load Balancing's -// API operation DescribeTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The specified listener does not exist. -// -// * ErrCodeRuleNotFoundException "RuleNotFound" -// The specified rule does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTags -func (c *ELBV2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTargetGroupAttributes = "DescribeTargetGroupAttributes" - -// DescribeTargetGroupAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTargetGroupAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTargetGroupAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTargetGroupAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTargetGroupAttributesRequest method. -// req, resp := client.DescribeTargetGroupAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupAttributes -func (c *ELBV2) DescribeTargetGroupAttributesRequest(input *DescribeTargetGroupAttributesInput) (req *request.Request, output *DescribeTargetGroupAttributesOutput) { - op := &request.Operation{ - Name: opDescribeTargetGroupAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTargetGroupAttributesInput{} - } - - output = &DescribeTargetGroupAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTargetGroupAttributes API operation for Elastic Load Balancing. -// -// Describes the attributes for the specified target group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeTargetGroupAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupAttributes -func (c *ELBV2) DescribeTargetGroupAttributes(input *DescribeTargetGroupAttributesInput) (*DescribeTargetGroupAttributesOutput, error) { - req, out := c.DescribeTargetGroupAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTargetGroups = "DescribeTargetGroups" - -// DescribeTargetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTargetGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTargetGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTargetGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTargetGroupsRequest method. -// req, resp := client.DescribeTargetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroups -func (c *ELBV2) DescribeTargetGroupsRequest(input *DescribeTargetGroupsInput) (req *request.Request, output *DescribeTargetGroupsOutput) { - op := &request.Operation{ - Name: opDescribeTargetGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeTargetGroupsInput{} - } - - output = &DescribeTargetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTargetGroups API operation for Elastic Load Balancing. -// -// Describes the specified target groups or all of your target groups. By default, -// all target groups are described. Alternatively, you can specify one of the -// following to filter the results: the ARN of the load balancer, the names -// of one or more target groups, or the ARNs of one or more target groups. -// -// To describe the targets for a target group, use DescribeTargetHealth. To -// describe the attributes of a target group, use DescribeTargetGroupAttributes. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeTargetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroups -func (c *ELBV2) DescribeTargetGroups(input *DescribeTargetGroupsInput) (*DescribeTargetGroupsOutput, error) { - req, out := c.DescribeTargetGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeTargetGroupsPages iterates over the pages of a DescribeTargetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTargetGroups 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 DescribeTargetGroups operation. -// pageNum := 0 -// err := client.DescribeTargetGroupsPages(params, -// func(page *DescribeTargetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ELBV2) DescribeTargetGroupsPages(input *DescribeTargetGroupsInput, fn func(p *DescribeTargetGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeTargetGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeTargetGroupsOutput), lastPage) - }) -} - -const opDescribeTargetHealth = "DescribeTargetHealth" - -// DescribeTargetHealthRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTargetHealth operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTargetHealth for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTargetHealth method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTargetHealthRequest method. -// req, resp := client.DescribeTargetHealthRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetHealth -func (c *ELBV2) DescribeTargetHealthRequest(input *DescribeTargetHealthInput) (req *request.Request, output *DescribeTargetHealthOutput) { - op := &request.Operation{ - Name: opDescribeTargetHealth, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTargetHealthInput{} - } - - output = &DescribeTargetHealthOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTargetHealth API operation for Elastic Load Balancing. -// -// Describes the health of the specified targets or all of your targets. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation DescribeTargetHealth for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidTargetException "InvalidTarget" -// The specified target does not exist or is not in the same VPC as the target -// group. -// -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// * ErrCodeHealthUnavailableException "HealthUnavailable" -// The health of the specified targets could not be retrieved due to an internal -// error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetHealth -func (c *ELBV2) DescribeTargetHealth(input *DescribeTargetHealthInput) (*DescribeTargetHealthOutput, error) { - req, out := c.DescribeTargetHealthRequest(input) - err := req.Send() - return out, err -} - -const opModifyListener = "ModifyListener" - -// ModifyListenerRequest generates a "aws/request.Request" representing the -// client's request for the ModifyListener operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyListener for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyListener method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyListenerRequest method. -// req, resp := client.ModifyListenerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyListener -func (c *ELBV2) ModifyListenerRequest(input *ModifyListenerInput) (req *request.Request, output *ModifyListenerOutput) { - op := &request.Operation{ - Name: opModifyListener, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyListenerInput{} - } - - output = &ModifyListenerOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyListener API operation for Elastic Load Balancing. -// -// Modifies the specified properties of the specified listener. -// -// Any properties that you do not specify retain their current values. However, -// changing the protocol from HTTPS to HTTP removes the security policy and -// SSL certificate properties. If you change the protocol from HTTP to HTTPS, -// you must add the security 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 Elastic Load Balancing's -// API operation ModifyListener for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDuplicateListenerException "DuplicateListener" -// A listener with the specified port already exists. -// -// * ErrCodeTooManyListenersException "TooManyListeners" -// You've reached the limit on the number of listeners per load balancer. -// -// * ErrCodeTooManyCertificatesException "TooManyCertificates" -// You've reached the limit on the number of certificates per listener. -// -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The specified listener does not exist. -// -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// * ErrCodeTargetGroupAssociationLimitException "TargetGroupAssociationLimit" -// You've reached the limit on the number of load balancers per target group. -// -// * ErrCodeIncompatibleProtocolsException "IncompatibleProtocols" -// The specified configuration is not valid with this protocol. -// -// * ErrCodeSSLPolicyNotFoundException "SSLPolicyNotFound" -// The specified SSL policy does not exist. -// -// * ErrCodeCertificateNotFoundException "CertificateNotFound" -// The specified certificate does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration is not valid. -// -// * ErrCodeUnsupportedProtocolException "UnsupportedProtocol" -// The specified protocol is not supported. -// -// * ErrCodeTooManyRegistrationsForTargetIdException "TooManyRegistrationsForTargetId" -// You've reached the limit on the number of times a target can be registered -// with a load balancer. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyListener -func (c *ELBV2) ModifyListener(input *ModifyListenerInput) (*ModifyListenerOutput, error) { - req, out := c.ModifyListenerRequest(input) - err := req.Send() - return out, err -} - -const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" - -// ModifyLoadBalancerAttributesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyLoadBalancerAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyLoadBalancerAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyLoadBalancerAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyLoadBalancerAttributesRequest method. -// req, resp := client.ModifyLoadBalancerAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyLoadBalancerAttributes -func (c *ELBV2) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttributesInput) (req *request.Request, output *ModifyLoadBalancerAttributesOutput) { - op := &request.Operation{ - Name: opModifyLoadBalancerAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyLoadBalancerAttributesInput{} - } - - output = &ModifyLoadBalancerAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyLoadBalancerAttributes API operation for Elastic Load Balancing. -// -// Modifies the specified attributes of the specified Application Load Balancer. -// -// If any of the specified attributes can't be modified as requested, the call -// fails. Any existing attributes that you do not modify retain their current -// values. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation ModifyLoadBalancerAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyLoadBalancerAttributes -func (c *ELBV2) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error) { - req, out := c.ModifyLoadBalancerAttributesRequest(input) - err := req.Send() - return out, err -} - -const opModifyRule = "ModifyRule" - -// ModifyRuleRequest generates a "aws/request.Request" representing the -// client's request for the ModifyRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyRuleRequest method. -// req, resp := client.ModifyRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyRule -func (c *ELBV2) ModifyRuleRequest(input *ModifyRuleInput) (req *request.Request, output *ModifyRuleOutput) { - op := &request.Operation{ - Name: opModifyRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyRuleInput{} - } - - output = &ModifyRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyRule API operation for Elastic Load Balancing. -// -// Modifies the specified rule. -// -// Any existing properties that you do not modify retain their current values. -// -// To modify the default action, use ModifyListener. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation ModifyRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTargetGroupAssociationLimitException "TargetGroupAssociationLimit" -// You've reached the limit on the number of load balancers per target group. -// -// * ErrCodeRuleNotFoundException "RuleNotFound" -// The specified rule does not exist. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermitted" -// This operation is not allowed. -// -// * ErrCodeTooManyRegistrationsForTargetIdException "TooManyRegistrationsForTargetId" -// You've reached the limit on the number of times a target can be registered -// with a load balancer. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyRule -func (c *ELBV2) ModifyRule(input *ModifyRuleInput) (*ModifyRuleOutput, error) { - req, out := c.ModifyRuleRequest(input) - err := req.Send() - return out, err -} - -const opModifyTargetGroup = "ModifyTargetGroup" - -// ModifyTargetGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyTargetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyTargetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyTargetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyTargetGroupRequest method. -// req, resp := client.ModifyTargetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroup -func (c *ELBV2) ModifyTargetGroupRequest(input *ModifyTargetGroupInput) (req *request.Request, output *ModifyTargetGroupOutput) { - op := &request.Operation{ - Name: opModifyTargetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyTargetGroupInput{} - } - - output = &ModifyTargetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyTargetGroup API operation for Elastic Load Balancing. -// -// Modifies the health checks used when evaluating the health state of the targets -// in the specified target group. -// -// To monitor the health of the targets, use DescribeTargetHealth. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation ModifyTargetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroup -func (c *ELBV2) ModifyTargetGroup(input *ModifyTargetGroupInput) (*ModifyTargetGroupOutput, error) { - req, out := c.ModifyTargetGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyTargetGroupAttributes = "ModifyTargetGroupAttributes" - -// ModifyTargetGroupAttributesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyTargetGroupAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyTargetGroupAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyTargetGroupAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyTargetGroupAttributesRequest method. -// req, resp := client.ModifyTargetGroupAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupAttributes -func (c *ELBV2) ModifyTargetGroupAttributesRequest(input *ModifyTargetGroupAttributesInput) (req *request.Request, output *ModifyTargetGroupAttributesOutput) { - op := &request.Operation{ - Name: opModifyTargetGroupAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyTargetGroupAttributesInput{} - } - - output = &ModifyTargetGroupAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyTargetGroupAttributes API operation for Elastic Load Balancing. -// -// Modifies the specified attributes of the specified target group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation ModifyTargetGroupAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupAttributes -func (c *ELBV2) ModifyTargetGroupAttributes(input *ModifyTargetGroupAttributesInput) (*ModifyTargetGroupAttributesOutput, error) { - req, out := c.ModifyTargetGroupAttributesRequest(input) - err := req.Send() - return out, err -} - -const opRegisterTargets = "RegisterTargets" - -// RegisterTargetsRequest generates a "aws/request.Request" representing the -// client's request for the RegisterTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterTargetsRequest method. -// req, resp := client.RegisterTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RegisterTargets -func (c *ELBV2) RegisterTargetsRequest(input *RegisterTargetsInput) (req *request.Request, output *RegisterTargetsOutput) { - op := &request.Operation{ - Name: opRegisterTargets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterTargetsInput{} - } - - output = &RegisterTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterTargets API operation for Elastic Load Balancing. -// -// Registers the specified targets with the specified target group. -// -// By default, the load balancer routes requests to registered targets using -// the protocol and port number for the target group. Alternatively, you can -// override the port for a target when you register it. -// -// The target must be in the virtual private cloud (VPC) that you specified -// for the target group. If the target is an EC2 instance, it must be in the -// running state when you register it. -// -// To remove a target from a target group, use DeregisterTargets. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation RegisterTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// * ErrCodeTooManyTargetsException "TooManyTargets" -// You've reached the limit on the number of targets. -// -// * ErrCodeInvalidTargetException "InvalidTarget" -// The specified target does not exist or is not in the same VPC as the target -// group. -// -// * ErrCodeTooManyRegistrationsForTargetIdException "TooManyRegistrationsForTargetId" -// You've reached the limit on the number of times a target can be registered -// with a load balancer. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RegisterTargets -func (c *ELBV2) RegisterTargets(input *RegisterTargetsInput) (*RegisterTargetsOutput, error) { - req, out := c.RegisterTargetsRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTags = "RemoveTags" - -// RemoveTagsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsRequest method. -// req, resp := client.RemoveTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveTags -func (c *ELBV2) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { - op := &request.Operation{ - Name: opRemoveTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsInput{} - } - - output = &RemoveTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTags API operation for Elastic Load Balancing. -// -// Removes the specified tags from the specified resource. -// -// To list the current tags for your resources, use DescribeTags. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation RemoveTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeTargetGroupNotFoundException "TargetGroupNotFound" -// The specified target group does not exist. -// -// * ErrCodeListenerNotFoundException "ListenerNotFound" -// The specified listener does not exist. -// -// * ErrCodeRuleNotFoundException "RuleNotFound" -// The specified rule does not exist. -// -// * ErrCodeTooManyTagsException "TooManyTags" -// You've reached the limit on the number of tags per load balancer. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveTags -func (c *ELBV2) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { - req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err -} - -const opSetIpAddressType = "SetIpAddressType" - -// SetIpAddressTypeRequest generates a "aws/request.Request" representing the -// client's request for the SetIpAddressType operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetIpAddressType for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetIpAddressType method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetIpAddressTypeRequest method. -// req, resp := client.SetIpAddressTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetIpAddressType -func (c *ELBV2) SetIpAddressTypeRequest(input *SetIpAddressTypeInput) (req *request.Request, output *SetIpAddressTypeOutput) { - op := &request.Operation{ - Name: opSetIpAddressType, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetIpAddressTypeInput{} - } - - output = &SetIpAddressTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetIpAddressType API operation for Elastic Load Balancing. -// -// Sets the type of IP addresses used by the subnets of the specified Application -// Load Balancer. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation SetIpAddressType for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration is not valid. -// -// * ErrCodeInvalidSubnetException "InvalidSubnet" -// The specified subnet is out of available addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetIpAddressType -func (c *ELBV2) SetIpAddressType(input *SetIpAddressTypeInput) (*SetIpAddressTypeOutput, error) { - req, out := c.SetIpAddressTypeRequest(input) - err := req.Send() - return out, err -} - -const opSetRulePriorities = "SetRulePriorities" - -// SetRulePrioritiesRequest generates a "aws/request.Request" representing the -// client's request for the SetRulePriorities operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetRulePriorities for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetRulePriorities method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetRulePrioritiesRequest method. -// req, resp := client.SetRulePrioritiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetRulePriorities -func (c *ELBV2) SetRulePrioritiesRequest(input *SetRulePrioritiesInput) (req *request.Request, output *SetRulePrioritiesOutput) { - op := &request.Operation{ - Name: opSetRulePriorities, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetRulePrioritiesInput{} - } - - output = &SetRulePrioritiesOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetRulePriorities API operation for Elastic Load Balancing. -// -// Sets the priorities of the specified rules. -// -// You can reorder the rules as long as there are no priority conflicts in the -// new order. Any existing rules that you do not specify retain their current -// priority. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation SetRulePriorities for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleNotFoundException "RuleNotFound" -// The specified rule does not exist. -// -// * ErrCodePriorityInUseException "PriorityInUse" -// The specified priority is in use. -// -// * ErrCodeOperationNotPermittedException "OperationNotPermitted" -// This operation is not allowed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetRulePriorities -func (c *ELBV2) SetRulePriorities(input *SetRulePrioritiesInput) (*SetRulePrioritiesOutput, error) { - req, out := c.SetRulePrioritiesRequest(input) - err := req.Send() - return out, err -} - -const opSetSecurityGroups = "SetSecurityGroups" - -// SetSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the SetSecurityGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetSecurityGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetSecurityGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetSecurityGroupsRequest method. -// req, resp := client.SetSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroups -func (c *ELBV2) SetSecurityGroupsRequest(input *SetSecurityGroupsInput) (req *request.Request, output *SetSecurityGroupsOutput) { - op := &request.Operation{ - Name: opSetSecurityGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetSecurityGroupsInput{} - } - - output = &SetSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetSecurityGroups API operation for Elastic Load Balancing. -// -// Associates the specified security groups with the specified load balancer. -// The specified security groups override the previously associated security -// groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation SetSecurityGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration is not valid. -// -// * ErrCodeInvalidSecurityGroupException "InvalidSecurityGroup" -// The specified security group does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroups -func (c *ELBV2) SetSecurityGroups(input *SetSecurityGroupsInput) (*SetSecurityGroupsOutput, error) { - req, out := c.SetSecurityGroupsRequest(input) - err := req.Send() - return out, err -} - -const opSetSubnets = "SetSubnets" - -// SetSubnetsRequest generates a "aws/request.Request" representing the -// client's request for the SetSubnets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetSubnets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetSubnets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetSubnetsRequest method. -// req, resp := client.SetSubnetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSubnets -func (c *ELBV2) SetSubnetsRequest(input *SetSubnetsInput) (req *request.Request, output *SetSubnetsOutput) { - op := &request.Operation{ - Name: opSetSubnets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetSubnetsInput{} - } - - output = &SetSubnetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetSubnets API operation for Elastic Load Balancing. -// -// Enables the Availability Zone for the specified subnets for the specified -// load balancer. The specified subnets replace the previously enabled subnets. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Elastic Load Balancing's -// API operation SetSubnets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLoadBalancerNotFoundException "LoadBalancerNotFound" -// The specified load balancer does not exist. -// -// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" -// The requested configuration is not valid. -// -// * ErrCodeSubnetNotFoundException "SubnetNotFound" -// The specified subnet does not exist. -// -// * ErrCodeInvalidSubnetException "InvalidSubnet" -// The specified subnet is out of available addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSubnets -func (c *ELBV2) SetSubnets(input *SetSubnetsInput) (*SetSubnetsOutput, error) { - req, out := c.SetSubnetsRequest(input) - err := req.Send() - return out, err -} - -// Information about an action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Action -type Action struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - // - // TargetGroupArn is a required field - TargetGroupArn *string `type:"string" required:"true"` - - // The type of action. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"ActionTypeEnum"` -} - -// String returns the string representation -func (s Action) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Action) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Action) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Action"} - if s.TargetGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupArn")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *Action) SetTargetGroupArn(v string) *Action { - s.TargetGroupArn = &v - return s -} - -// SetType sets the Type field's value. -func (s *Action) SetType(v string) *Action { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddTagsInput -type AddTagsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArns is a required field - ResourceArns []*string `type:"list" required:"true"` - - // The tags. Each resource can have a maximum of 10 tags. - // - // Tags is a required field - Tags []*Tag `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"} - if s.ResourceArns == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArns")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - 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 -} - -// SetResourceArns sets the ResourceArns field's value. -func (s *AddTagsInput) SetResourceArns(v []*string) *AddTagsInput { - s.ResourceArns = v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsInput) SetTags(v []*Tag) *AddTagsInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddTagsOutput -type AddTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsOutput) GoString() string { - return s.String() -} - -// Information about an Availability Zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AvailabilityZone -type AvailabilityZone struct { - _ struct{} `type:"structure"` - - // The ID of the subnet. - SubnetId *string `type:"string"` - - // The name of the Availability Zone. - ZoneName *string `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() -} - -// SetSubnetId sets the SubnetId field's value. -func (s *AvailabilityZone) SetSubnetId(v string) *AvailabilityZone { - s.SubnetId = &v - return s -} - -// SetZoneName sets the ZoneName field's value. -func (s *AvailabilityZone) SetZoneName(v string) *AvailabilityZone { - s.ZoneName = &v - return s -} - -// Information about an SSL server certificate deployed on a load balancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Certificate -type Certificate struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the certificate. - CertificateArn *string `type:"string"` -} - -// String returns the string representation -func (s Certificate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Certificate) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *Certificate) SetCertificateArn(v string) *Certificate { - s.CertificateArn = &v - return s -} - -// Information about a cipher used in a policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Cipher -type Cipher struct { - _ struct{} `type:"structure"` - - // The name of the cipher. - Name *string `type:"string"` - - // The priority of the cipher. - Priority *int64 `type:"integer"` -} - -// String returns the string representation -func (s Cipher) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Cipher) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Cipher) SetName(v string) *Cipher { - s.Name = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *Cipher) SetPriority(v int64) *Cipher { - s.Priority = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateListenerInput -type CreateListenerInput struct { - _ struct{} `type:"structure"` - - // The SSL server certificate. You must provide exactly one certificate if the - // protocol is HTTPS. - Certificates []*Certificate `type:"list"` - - // The default action for the listener. - // - // DefaultActions is a required field - DefaultActions []*Action `type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the load balancer. - // - // LoadBalancerArn is a required field - LoadBalancerArn *string `type:"string" required:"true"` - - // The port on which the load balancer is listening. - // - // Port is a required field - Port *int64 `min:"1" type:"integer" required:"true"` - - // The protocol for connections from clients to the load balancer. - // - // Protocol is a required field - Protocol *string `type:"string" required:"true" enum:"ProtocolEnum"` - - // The security policy that defines which ciphers and protocols are supported. - // The default is the current predefined security policy. - SslPolicy *string `type:"string"` -} - -// String returns the string representation -func (s CreateListenerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateListenerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateListenerInput"} - if s.DefaultActions == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultActions")) - } - if s.LoadBalancerArn == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerArn")) - } - if s.Port == nil { - invalidParams.Add(request.NewErrParamRequired("Port")) - } - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - if s.DefaultActions != nil { - for i, v := range s.DefaultActions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DefaultActions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificates sets the Certificates field's value. -func (s *CreateListenerInput) SetCertificates(v []*Certificate) *CreateListenerInput { - s.Certificates = v - return s -} - -// SetDefaultActions sets the DefaultActions field's value. -func (s *CreateListenerInput) SetDefaultActions(v []*Action) *CreateListenerInput { - s.DefaultActions = v - return s -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *CreateListenerInput) SetLoadBalancerArn(v string) *CreateListenerInput { - s.LoadBalancerArn = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateListenerInput) SetPort(v int64) *CreateListenerInput { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *CreateListenerInput) SetProtocol(v string) *CreateListenerInput { - s.Protocol = &v - return s -} - -// SetSslPolicy sets the SslPolicy field's value. -func (s *CreateListenerInput) SetSslPolicy(v string) *CreateListenerInput { - s.SslPolicy = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateListenerOutput -type CreateListenerOutput struct { - _ struct{} `type:"structure"` - - // Information about the listener. - Listeners []*Listener `type:"list"` -} - -// String returns the string representation -func (s CreateListenerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateListenerOutput) GoString() string { - return s.String() -} - -// SetListeners sets the Listeners field's value. -func (s *CreateListenerOutput) SetListeners(v []*Listener) *CreateListenerOutput { - s.Listeners = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateLoadBalancerInput -type CreateLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The type of IP addresses used by the subnets for your load balancer. The - // possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and - // IPv6 addresses). Internal load balancers must use ipv4. - IpAddressType *string `type:"string" enum:"IpAddressType"` - - // The name of the load balancer. - // - // This name must be unique within your AWS account, can have a maximum of 32 - // characters, must contain only alphanumeric characters or hyphens, and must - // not begin or end with a hyphen. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The nodes of an Internet-facing load balancer have public IP addresses. The - // DNS name of an Internet-facing load balancer is publicly resolvable to the - // public IP addresses of the nodes. Therefore, Internet-facing load balancers - // can route requests from clients over the Internet. - // - // The nodes of an internal load balancer have only private IP addresses. The - // DNS name of an internal load balancer is publicly resolvable to the private - // IP addresses of the nodes. Therefore, internal load balancers can only route - // requests from clients with access to the VPC for the load balancer. - // - // The default is an Internet-facing load balancer. - Scheme *string `type:"string" enum:"LoadBalancerSchemeEnum"` - - // The IDs of the security groups to assign to the load balancer. - SecurityGroups []*string `type:"list"` - - // The IDs of the subnets to attach to the load balancer. You can specify only - // one subnet per Availability Zone. You must specify subnets from at least - // two Availability Zones. - // - // Subnets is a required field - Subnets []*string `type:"list" required:"true"` - - // One or more tags to assign to the load balancer. - Tags []*Tag `min:"1" type:"list"` -} - -// String returns the string representation -func (s CreateLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Subnets == nil { - invalidParams.Add(request.NewErrParamRequired("Subnets")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - 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 -} - -// SetIpAddressType sets the IpAddressType field's value. -func (s *CreateLoadBalancerInput) SetIpAddressType(v string) *CreateLoadBalancerInput { - s.IpAddressType = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateLoadBalancerInput) SetName(v string) *CreateLoadBalancerInput { - s.Name = &v - return s -} - -// SetScheme sets the Scheme field's value. -func (s *CreateLoadBalancerInput) SetScheme(v string) *CreateLoadBalancerInput { - s.Scheme = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *CreateLoadBalancerInput) SetSecurityGroups(v []*string) *CreateLoadBalancerInput { - s.SecurityGroups = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *CreateLoadBalancerInput) SetSubnets(v []*string) *CreateLoadBalancerInput { - s.Subnets = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateLoadBalancerInput) SetTags(v []*Tag) *CreateLoadBalancerInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateLoadBalancerOutput -type CreateLoadBalancerOutput struct { - _ struct{} `type:"structure"` - - // Information about the load balancer. - LoadBalancers []*LoadBalancer `type:"list"` -} - -// String returns the string representation -func (s CreateLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoadBalancerOutput) GoString() string { - return s.String() -} - -// SetLoadBalancers sets the LoadBalancers field's value. -func (s *CreateLoadBalancerOutput) SetLoadBalancers(v []*LoadBalancer) *CreateLoadBalancerOutput { - s.LoadBalancers = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateRuleInput -type CreateRuleInput struct { - _ struct{} `type:"structure"` - - // An action. Each action has the type forward and specifies a target group. - // - // Actions is a required field - Actions []*Action `type:"list" required:"true"` - - // A condition. Each condition has the field path-pattern and specifies one - // path pattern. A path pattern is case sensitive, can be up to 128 characters - // in length, and can contain any of the following characters. Note that you - // can include up to three wildcard characters in a path pattern. - // - // * A-Z, a-z, 0-9 - // - // * _ - . $ / ~ " ' @ : + - // - // * & (using &) - // - // * * (matches 0 or more characters) - // - // * ? (matches exactly 1 character) - // - // Conditions is a required field - Conditions []*RuleCondition `type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the listener. - // - // ListenerArn is a required field - ListenerArn *string `type:"string" required:"true"` - - // The priority for the rule. A listener can't have multiple rules with the - // same priority. - // - // Priority is a required field - Priority *int64 `min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s CreateRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRuleInput"} - if s.Actions == nil { - invalidParams.Add(request.NewErrParamRequired("Actions")) - } - if s.Conditions == nil { - invalidParams.Add(request.NewErrParamRequired("Conditions")) - } - if s.ListenerArn == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerArn")) - } - if s.Priority == nil { - invalidParams.Add(request.NewErrParamRequired("Priority")) - } - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - if s.Actions != nil { - for i, v := range s.Actions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Actions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActions sets the Actions field's value. -func (s *CreateRuleInput) SetActions(v []*Action) *CreateRuleInput { - s.Actions = v - return s -} - -// SetConditions sets the Conditions field's value. -func (s *CreateRuleInput) SetConditions(v []*RuleCondition) *CreateRuleInput { - s.Conditions = v - return s -} - -// SetListenerArn sets the ListenerArn field's value. -func (s *CreateRuleInput) SetListenerArn(v string) *CreateRuleInput { - s.ListenerArn = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *CreateRuleInput) SetPriority(v int64) *CreateRuleInput { - s.Priority = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateRuleOutput -type CreateRuleOutput struct { - _ struct{} `type:"structure"` - - // Information about the rule. - Rules []*Rule `type:"list"` -} - -// String returns the string representation -func (s CreateRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRuleOutput) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *CreateRuleOutput) SetRules(v []*Rule) *CreateRuleOutput { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateTargetGroupInput -type CreateTargetGroupInput struct { - _ struct{} `type:"structure"` - - // The approximate amount of time, in seconds, between health checks of an individual - // target. The default is 30 seconds. - HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` - - // The ping path that is the destination on the targets for health checks. The - // default is /. - HealthCheckPath *string `min:"1" type:"string"` - - // The port the load balancer uses when performing health checks on targets. - // The default is traffic-port, which indicates the port on which each target - // receives traffic from the load balancer. - HealthCheckPort *string `type:"string"` - - // The protocol the load balancer uses when performing health checks on targets. - // The default is the HTTP protocol. - HealthCheckProtocol *string `type:"string" enum:"ProtocolEnum"` - - // The amount of time, in seconds, during which no response from a target means - // a failed health check. The default is 5 seconds. - HealthCheckTimeoutSeconds *int64 `min:"2" type:"integer"` - - // The number of consecutive health checks successes required before considering - // an unhealthy target healthy. The default is 5. - HealthyThresholdCount *int64 `min:"2" type:"integer"` - - // The HTTP codes to use when checking for a successful response from a target. - // The default is 200. - Matcher *Matcher `type:"structure"` - - // The name of the target group. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The port on which the targets receive traffic. This port is used unless you - // specify a port override when registering the target. - // - // Port is a required field - Port *int64 `min:"1" type:"integer" required:"true"` - - // The protocol to use for routing traffic to the targets. - // - // Protocol is a required field - Protocol *string `type:"string" required:"true" enum:"ProtocolEnum"` - - // The number of consecutive health check failures required before considering - // a target unhealthy. The default is 2. - UnhealthyThresholdCount *int64 `min:"2" type:"integer"` - - // The identifier of the virtual private cloud (VPC). - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateTargetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTargetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTargetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTargetGroupInput"} - if s.HealthCheckIntervalSeconds != nil && *s.HealthCheckIntervalSeconds < 5 { - invalidParams.Add(request.NewErrParamMinValue("HealthCheckIntervalSeconds", 5)) - } - if s.HealthCheckPath != nil && len(*s.HealthCheckPath) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HealthCheckPath", 1)) - } - if s.HealthCheckTimeoutSeconds != nil && *s.HealthCheckTimeoutSeconds < 2 { - invalidParams.Add(request.NewErrParamMinValue("HealthCheckTimeoutSeconds", 2)) - } - if s.HealthyThresholdCount != nil && *s.HealthyThresholdCount < 2 { - invalidParams.Add(request.NewErrParamMinValue("HealthyThresholdCount", 2)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Port == nil { - invalidParams.Add(request.NewErrParamRequired("Port")) - } - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - if s.UnhealthyThresholdCount != nil && *s.UnhealthyThresholdCount < 2 { - invalidParams.Add(request.NewErrParamMinValue("UnhealthyThresholdCount", 2)) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - if s.Matcher != nil { - if err := s.Matcher.Validate(); err != nil { - invalidParams.AddNested("Matcher", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheckIntervalSeconds sets the HealthCheckIntervalSeconds field's value. -func (s *CreateTargetGroupInput) SetHealthCheckIntervalSeconds(v int64) *CreateTargetGroupInput { - s.HealthCheckIntervalSeconds = &v - return s -} - -// SetHealthCheckPath sets the HealthCheckPath field's value. -func (s *CreateTargetGroupInput) SetHealthCheckPath(v string) *CreateTargetGroupInput { - s.HealthCheckPath = &v - return s -} - -// SetHealthCheckPort sets the HealthCheckPort field's value. -func (s *CreateTargetGroupInput) SetHealthCheckPort(v string) *CreateTargetGroupInput { - s.HealthCheckPort = &v - return s -} - -// SetHealthCheckProtocol sets the HealthCheckProtocol field's value. -func (s *CreateTargetGroupInput) SetHealthCheckProtocol(v string) *CreateTargetGroupInput { - s.HealthCheckProtocol = &v - return s -} - -// SetHealthCheckTimeoutSeconds sets the HealthCheckTimeoutSeconds field's value. -func (s *CreateTargetGroupInput) SetHealthCheckTimeoutSeconds(v int64) *CreateTargetGroupInput { - s.HealthCheckTimeoutSeconds = &v - return s -} - -// SetHealthyThresholdCount sets the HealthyThresholdCount field's value. -func (s *CreateTargetGroupInput) SetHealthyThresholdCount(v int64) *CreateTargetGroupInput { - s.HealthyThresholdCount = &v - return s -} - -// SetMatcher sets the Matcher field's value. -func (s *CreateTargetGroupInput) SetMatcher(v *Matcher) *CreateTargetGroupInput { - s.Matcher = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTargetGroupInput) SetName(v string) *CreateTargetGroupInput { - s.Name = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateTargetGroupInput) SetPort(v int64) *CreateTargetGroupInput { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *CreateTargetGroupInput) SetProtocol(v string) *CreateTargetGroupInput { - s.Protocol = &v - return s -} - -// SetUnhealthyThresholdCount sets the UnhealthyThresholdCount field's value. -func (s *CreateTargetGroupInput) SetUnhealthyThresholdCount(v int64) *CreateTargetGroupInput { - s.UnhealthyThresholdCount = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateTargetGroupInput) SetVpcId(v string) *CreateTargetGroupInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateTargetGroupOutput -type CreateTargetGroupOutput struct { - _ struct{} `type:"structure"` - - // Information about the target group. - TargetGroups []*TargetGroup `type:"list"` -} - -// String returns the string representation -func (s CreateTargetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTargetGroupOutput) GoString() string { - return s.String() -} - -// SetTargetGroups sets the TargetGroups field's value. -func (s *CreateTargetGroupOutput) SetTargetGroups(v []*TargetGroup) *CreateTargetGroupOutput { - s.TargetGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteListenerInput -type DeleteListenerInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - // - // ListenerArn is a required field - ListenerArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteListenerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteListenerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteListenerInput"} - if s.ListenerArn == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListenerArn sets the ListenerArn field's value. -func (s *DeleteListenerInput) SetListenerArn(v string) *DeleteListenerInput { - s.ListenerArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteListenerOutput -type DeleteListenerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteListenerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteListenerOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteLoadBalancerInput -type DeleteLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the load balancer. - // - // LoadBalancerArn is a required field - LoadBalancerArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerInput"} - if s.LoadBalancerArn == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *DeleteLoadBalancerInput) SetLoadBalancerArn(v string) *DeleteLoadBalancerInput { - s.LoadBalancerArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteLoadBalancerOutput -type DeleteLoadBalancerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoadBalancerOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteRuleInput -type DeleteRuleInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rule. - // - // RuleArn is a required field - RuleArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRuleInput"} - if s.RuleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RuleArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRuleArn sets the RuleArn field's value. -func (s *DeleteRuleInput) SetRuleArn(v string) *DeleteRuleInput { - s.RuleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteRuleOutput -type DeleteRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRuleOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteTargetGroupInput -type DeleteTargetGroupInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - // - // TargetGroupArn is a required field - TargetGroupArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteTargetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTargetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTargetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTargetGroupInput"} - if s.TargetGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *DeleteTargetGroupInput) SetTargetGroupArn(v string) *DeleteTargetGroupInput { - s.TargetGroupArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteTargetGroupOutput -type DeleteTargetGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteTargetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTargetGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeregisterTargetsInput -type DeregisterTargetsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - // - // TargetGroupArn is a required field - TargetGroupArn *string `type:"string" required:"true"` - - // The targets. If you specified a port override when you registered a target, - // you must specify both the target ID and the port when you deregister it. - // - // Targets is a required field - Targets []*TargetDescription `type:"list" required:"true"` -} - -// String returns the string representation -func (s DeregisterTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterTargetsInput"} - if s.TargetGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupArn")) - } - if s.Targets == nil { - invalidParams.Add(request.NewErrParamRequired("Targets")) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *DeregisterTargetsInput) SetTargetGroupArn(v string) *DeregisterTargetsInput { - s.TargetGroupArn = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *DeregisterTargetsInput) SetTargets(v []*TargetDescription) *DeregisterTargetsInput { - s.Targets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeregisterTargetsOutput -type DeregisterTargetsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTargetsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListenersInput -type DescribeListenersInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Names (ARN) of the listeners. - ListenerArns []*string `type:"list"` - - // The Amazon Resource Name (ARN) of the load balancer. - LoadBalancerArn *string `type:"string"` - - // The marker for the next set of results. (You received this marker from a - // previous call.) - Marker *string `type:"string"` - - // The maximum number of results to return with this call. - PageSize *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s DescribeListenersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeListenersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeListenersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeListenersInput"} - if s.PageSize != nil && *s.PageSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListenerArns sets the ListenerArns field's value. -func (s *DescribeListenersInput) SetListenerArns(v []*string) *DescribeListenersInput { - s.ListenerArns = v - return s -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *DescribeListenersInput) SetLoadBalancerArn(v string) *DescribeListenersInput { - s.LoadBalancerArn = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeListenersInput) SetMarker(v string) *DescribeListenersInput { - s.Marker = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeListenersInput) SetPageSize(v int64) *DescribeListenersInput { - s.PageSize = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListenersOutput -type DescribeListenersOutput struct { - _ struct{} `type:"structure"` - - // Information about the listeners. - Listeners []*Listener `type:"list"` - - // The marker to use when requesting the next set of results. If there are no - // additional results, the string is empty. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeListenersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeListenersOutput) GoString() string { - return s.String() -} - -// SetListeners sets the Listeners field's value. -func (s *DescribeListenersOutput) SetListeners(v []*Listener) *DescribeListenersOutput { - s.Listeners = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeListenersOutput) SetNextMarker(v string) *DescribeListenersOutput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancerAttributesInput -type DescribeLoadBalancerAttributesInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the load balancer. - // - // LoadBalancerArn is a required field - LoadBalancerArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeLoadBalancerAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLoadBalancerAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancerAttributesInput"} - if s.LoadBalancerArn == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *DescribeLoadBalancerAttributesInput) SetLoadBalancerArn(v string) *DescribeLoadBalancerAttributesInput { - s.LoadBalancerArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancerAttributesOutput -type DescribeLoadBalancerAttributesOutput struct { - _ struct{} `type:"structure"` - - // Information about the load balancer attributes. - Attributes []*LoadBalancerAttribute `type:"list"` -} - -// String returns the string representation -func (s DescribeLoadBalancerAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancerAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *DescribeLoadBalancerAttributesOutput) SetAttributes(v []*LoadBalancerAttribute) *DescribeLoadBalancerAttributesOutput { - s.Attributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancersInput -type DescribeLoadBalancersInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Names (ARN) of the load balancers. - LoadBalancerArns []*string `type:"list"` - - // The marker for the next set of results. (You received this marker from a - // previous call.) - Marker *string `type:"string"` - - // The names of the load balancers. - Names []*string `type:"list"` - - // The maximum number of results to return with this call. - PageSize *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s DescribeLoadBalancersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLoadBalancersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancersInput"} - if s.PageSize != nil && *s.PageSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerArns sets the LoadBalancerArns field's value. -func (s *DescribeLoadBalancersInput) SetLoadBalancerArns(v []*string) *DescribeLoadBalancersInput { - s.LoadBalancerArns = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeLoadBalancersInput) SetMarker(v string) *DescribeLoadBalancersInput { - s.Marker = &v - return s -} - -// SetNames sets the Names field's value. -func (s *DescribeLoadBalancersInput) SetNames(v []*string) *DescribeLoadBalancersInput { - s.Names = v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeLoadBalancersInput) SetPageSize(v int64) *DescribeLoadBalancersInput { - s.PageSize = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancersOutput -type DescribeLoadBalancersOutput struct { - _ struct{} `type:"structure"` - - // Information about the load balancers. - LoadBalancers []*LoadBalancer `type:"list"` - - // The marker to use when requesting the next set of results. If there are no - // additional results, the string is empty. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLoadBalancersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBalancersOutput) GoString() string { - return s.String() -} - -// SetLoadBalancers sets the LoadBalancers field's value. -func (s *DescribeLoadBalancersOutput) SetLoadBalancers(v []*LoadBalancer) *DescribeLoadBalancersOutput { - s.LoadBalancers = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeLoadBalancersOutput) SetNextMarker(v string) *DescribeLoadBalancersOutput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeRulesInput -type DescribeRulesInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - ListenerArn *string `type:"string"` - - // The Amazon Resource Names (ARN) of the rules. - RuleArns []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeRulesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRulesInput) GoString() string { - return s.String() -} - -// SetListenerArn sets the ListenerArn field's value. -func (s *DescribeRulesInput) SetListenerArn(v string) *DescribeRulesInput { - s.ListenerArn = &v - return s -} - -// SetRuleArns sets the RuleArns field's value. -func (s *DescribeRulesInput) SetRuleArns(v []*string) *DescribeRulesInput { - s.RuleArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeRulesOutput -type DescribeRulesOutput struct { - _ struct{} `type:"structure"` - - // Information about the rules. - Rules []*Rule `type:"list"` -} - -// String returns the string representation -func (s DescribeRulesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRulesOutput) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *DescribeRulesOutput) SetRules(v []*Rule) *DescribeRulesOutput { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeSSLPoliciesInput -type DescribeSSLPoliciesInput struct { - _ struct{} `type:"structure"` - - // The marker for the next set of results. (You received this marker from a - // previous call.) - Marker *string `type:"string"` - - // The names of the policies. - Names []*string `type:"list"` - - // The maximum number of results to return with this call. - PageSize *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s DescribeSSLPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSSLPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSSLPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSSLPoliciesInput"} - if s.PageSize != nil && *s.PageSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSSLPoliciesInput) SetMarker(v string) *DescribeSSLPoliciesInput { - s.Marker = &v - return s -} - -// SetNames sets the Names field's value. -func (s *DescribeSSLPoliciesInput) SetNames(v []*string) *DescribeSSLPoliciesInput { - s.Names = v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeSSLPoliciesInput) SetPageSize(v int64) *DescribeSSLPoliciesInput { - s.PageSize = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeSSLPoliciesOutput -type DescribeSSLPoliciesOutput struct { - _ struct{} `type:"structure"` - - // The marker to use when requesting the next set of results. If there are no - // additional results, the string is empty. - NextMarker *string `type:"string"` - - // Information about the policies. - SslPolicies []*SslPolicy `type:"list"` -} - -// String returns the string representation -func (s DescribeSSLPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSSLPoliciesOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeSSLPoliciesOutput) SetNextMarker(v string) *DescribeSSLPoliciesOutput { - s.NextMarker = &v - return s -} - -// SetSslPolicies sets the SslPolicies field's value. -func (s *DescribeSSLPoliciesOutput) SetSslPolicies(v []*SslPolicy) *DescribeSSLPoliciesOutput { - s.SslPolicies = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTagsInput -type DescribeTagsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Names (ARN) of the resources. - // - // ResourceArns is a required field - ResourceArns []*string `type:"list" required:"true"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTagsInput"} - if s.ResourceArns == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArns")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArns sets the ResourceArns field's value. -func (s *DescribeTagsInput) SetResourceArns(v []*string) *DescribeTagsInput { - s.ResourceArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTagsOutput -type DescribeTagsOutput struct { - _ struct{} `type:"structure"` - - // Information about the tags. - TagDescriptions []*TagDescription `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() -} - -// SetTagDescriptions sets the TagDescriptions field's value. -func (s *DescribeTagsOutput) SetTagDescriptions(v []*TagDescription) *DescribeTagsOutput { - s.TagDescriptions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupAttributesInput -type DescribeTargetGroupAttributesInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - // - // TargetGroupArn is a required field - TargetGroupArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeTargetGroupAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTargetGroupAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTargetGroupAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTargetGroupAttributesInput"} - if s.TargetGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *DescribeTargetGroupAttributesInput) SetTargetGroupArn(v string) *DescribeTargetGroupAttributesInput { - s.TargetGroupArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupAttributesOutput -type DescribeTargetGroupAttributesOutput struct { - _ struct{} `type:"structure"` - - // Information about the target group attributes - Attributes []*TargetGroupAttribute `type:"list"` -} - -// String returns the string representation -func (s DescribeTargetGroupAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTargetGroupAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *DescribeTargetGroupAttributesOutput) SetAttributes(v []*TargetGroupAttribute) *DescribeTargetGroupAttributesOutput { - s.Attributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupsInput -type DescribeTargetGroupsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the load balancer. - LoadBalancerArn *string `type:"string"` - - // The marker for the next set of results. (You received this marker from a - // previous call.) - Marker *string `type:"string"` - - // The names of the target groups. - Names []*string `type:"list"` - - // The maximum number of results to return with this call. - PageSize *int64 `min:"1" type:"integer"` - - // The Amazon Resource Names (ARN) of the target groups. - TargetGroupArns []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeTargetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTargetGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTargetGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTargetGroupsInput"} - if s.PageSize != nil && *s.PageSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *DescribeTargetGroupsInput) SetLoadBalancerArn(v string) *DescribeTargetGroupsInput { - s.LoadBalancerArn = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTargetGroupsInput) SetMarker(v string) *DescribeTargetGroupsInput { - s.Marker = &v - return s -} - -// SetNames sets the Names field's value. -func (s *DescribeTargetGroupsInput) SetNames(v []*string) *DescribeTargetGroupsInput { - s.Names = v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeTargetGroupsInput) SetPageSize(v int64) *DescribeTargetGroupsInput { - s.PageSize = &v - return s -} - -// SetTargetGroupArns sets the TargetGroupArns field's value. -func (s *DescribeTargetGroupsInput) SetTargetGroupArns(v []*string) *DescribeTargetGroupsInput { - s.TargetGroupArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupsOutput -type DescribeTargetGroupsOutput struct { - _ struct{} `type:"structure"` - - // The marker to use when requesting the next set of results. If there are no - // additional results, the string is empty. - NextMarker *string `type:"string"` - - // Information about the target groups. - TargetGroups []*TargetGroup `type:"list"` -} - -// String returns the string representation -func (s DescribeTargetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTargetGroupsOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeTargetGroupsOutput) SetNextMarker(v string) *DescribeTargetGroupsOutput { - s.NextMarker = &v - return s -} - -// SetTargetGroups sets the TargetGroups field's value. -func (s *DescribeTargetGroupsOutput) SetTargetGroups(v []*TargetGroup) *DescribeTargetGroupsOutput { - s.TargetGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetHealthInput -type DescribeTargetHealthInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - // - // TargetGroupArn is a required field - TargetGroupArn *string `type:"string" required:"true"` - - // The targets. - Targets []*TargetDescription `type:"list"` -} - -// String returns the string representation -func (s DescribeTargetHealthInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTargetHealthInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTargetHealthInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTargetHealthInput"} - if s.TargetGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupArn")) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *DescribeTargetHealthInput) SetTargetGroupArn(v string) *DescribeTargetHealthInput { - s.TargetGroupArn = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *DescribeTargetHealthInput) SetTargets(v []*TargetDescription) *DescribeTargetHealthInput { - s.Targets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetHealthOutput -type DescribeTargetHealthOutput struct { - _ struct{} `type:"structure"` - - // Information about the health of the targets. - TargetHealthDescriptions []*TargetHealthDescription `type:"list"` -} - -// String returns the string representation -func (s DescribeTargetHealthOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTargetHealthOutput) GoString() string { - return s.String() -} - -// SetTargetHealthDescriptions sets the TargetHealthDescriptions field's value. -func (s *DescribeTargetHealthOutput) SetTargetHealthDescriptions(v []*TargetHealthDescription) *DescribeTargetHealthOutput { - s.TargetHealthDescriptions = v - return s -} - -// Information about a listener. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Listener -type Listener struct { - _ struct{} `type:"structure"` - - // The SSL server certificate. You must provide a certificate if the protocol - // is HTTPS. - Certificates []*Certificate `type:"list"` - - // The default actions for the listener. - DefaultActions []*Action `type:"list"` - - // The Amazon Resource Name (ARN) of the listener. - ListenerArn *string `type:"string"` - - // The Amazon Resource Name (ARN) of the load balancer. - LoadBalancerArn *string `type:"string"` - - // The port on which the load balancer is listening. - Port *int64 `min:"1" type:"integer"` - - // The protocol for connections from clients to the load balancer. - Protocol *string `type:"string" enum:"ProtocolEnum"` - - // The security policy that defines which ciphers and protocols are supported. - // The default is the current predefined security policy. - SslPolicy *string `type:"string"` -} - -// String returns the string representation -func (s Listener) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Listener) GoString() string { - return s.String() -} - -// SetCertificates sets the Certificates field's value. -func (s *Listener) SetCertificates(v []*Certificate) *Listener { - s.Certificates = v - return s -} - -// SetDefaultActions sets the DefaultActions field's value. -func (s *Listener) SetDefaultActions(v []*Action) *Listener { - s.DefaultActions = v - return s -} - -// SetListenerArn sets the ListenerArn field's value. -func (s *Listener) SetListenerArn(v string) *Listener { - s.ListenerArn = &v - return s -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *Listener) SetLoadBalancerArn(v string) *Listener { - s.LoadBalancerArn = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Listener) SetPort(v int64) *Listener { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *Listener) SetProtocol(v string) *Listener { - s.Protocol = &v - return s -} - -// SetSslPolicy sets the SslPolicy field's value. -func (s *Listener) SetSslPolicy(v string) *Listener { - s.SslPolicy = &v - return s -} - -// Information about a load balancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/LoadBalancer -type LoadBalancer struct { - _ struct{} `type:"structure"` - - // The Availability Zones for the load balancer. - AvailabilityZones []*AvailabilityZone `type:"list"` - - // The ID of the Amazon Route 53 hosted zone associated with the load balancer. - CanonicalHostedZoneId *string `type:"string"` - - // The date and time the load balancer was created. - CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The public DNS name of the load balancer. - DNSName *string `type:"string"` - - // The type of IP addresses used by the subnets for your load balancer. The - // possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and - // IPv6 addresses). - IpAddressType *string `type:"string" enum:"IpAddressType"` - - // The Amazon Resource Name (ARN) of the load balancer. - LoadBalancerArn *string `type:"string"` - - // The name of the load balancer. - LoadBalancerName *string `type:"string"` - - // The nodes of an Internet-facing load balancer have public IP addresses. The - // DNS name of an Internet-facing load balancer is publicly resolvable to the - // public IP addresses of the nodes. Therefore, Internet-facing load balancers - // can route requests from clients over the Internet. - // - // The nodes of an internal load balancer have only private IP addresses. The - // DNS name of an internal load balancer is publicly resolvable to the private - // IP addresses of the nodes. Therefore, internal load balancers can only route - // requests from clients with access to the VPC for the load balancer. - Scheme *string `type:"string" enum:"LoadBalancerSchemeEnum"` - - // The IDs of the security groups for the load balancer. - SecurityGroups []*string `type:"list"` - - // The state of the load balancer. - State *LoadBalancerState `type:"structure"` - - // The type of load balancer. - Type *string `type:"string" enum:"LoadBalancerTypeEnum"` - - // The ID of the VPC for the load balancer. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s LoadBalancer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancer) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *LoadBalancer) SetAvailabilityZones(v []*AvailabilityZone) *LoadBalancer { - s.AvailabilityZones = v - return s -} - -// SetCanonicalHostedZoneId sets the CanonicalHostedZoneId field's value. -func (s *LoadBalancer) SetCanonicalHostedZoneId(v string) *LoadBalancer { - s.CanonicalHostedZoneId = &v - return s -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *LoadBalancer) SetCreatedTime(v time.Time) *LoadBalancer { - s.CreatedTime = &v - return s -} - -// SetDNSName sets the DNSName field's value. -func (s *LoadBalancer) SetDNSName(v string) *LoadBalancer { - s.DNSName = &v - return s -} - -// SetIpAddressType sets the IpAddressType field's value. -func (s *LoadBalancer) SetIpAddressType(v string) *LoadBalancer { - s.IpAddressType = &v - return s -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *LoadBalancer) SetLoadBalancerArn(v string) *LoadBalancer { - s.LoadBalancerArn = &v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *LoadBalancer) SetLoadBalancerName(v string) *LoadBalancer { - s.LoadBalancerName = &v - return s -} - -// SetScheme sets the Scheme field's value. -func (s *LoadBalancer) SetScheme(v string) *LoadBalancer { - s.Scheme = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *LoadBalancer) SetSecurityGroups(v []*string) *LoadBalancer { - s.SecurityGroups = v - return s -} - -// SetState sets the State field's value. -func (s *LoadBalancer) SetState(v *LoadBalancerState) *LoadBalancer { - s.State = v - return s -} - -// SetType sets the Type field's value. -func (s *LoadBalancer) SetType(v string) *LoadBalancer { - s.Type = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *LoadBalancer) SetVpcId(v string) *LoadBalancer { - s.VpcId = &v - return s -} - -// Information about a load balancer attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/LoadBalancerAttribute -type LoadBalancerAttribute struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - // - // * access_logs.s3.enabled - Indicates whether access logs stored in Amazon - // S3 are enabled. The value is true or false. - // - // * access_logs.s3.bucket - The name of the S3 bucket for the access logs. - // This attribute is required if access logs in Amazon S3 are enabled. The - // bucket must exist in the same region as the load balancer and have a bucket - // policy that grants Elastic Load Balancing permission to write to the bucket. - // - // * access_logs.s3.prefix - The prefix for the location in the S3 bucket. - // If you don't specify a prefix, the access logs are stored in the root - // of the bucket. - // - // * deletion_protection.enabled - Indicates whether deletion protection - // is enabled. The value is true or false. - // - // * idle_timeout.timeout_seconds - The idle timeout value, in seconds. The - // valid range is 1-3600. The default is 60 seconds. - Key *string `type:"string"` - - // The value of the attribute. - Value *string `type:"string"` -} - -// String returns the string representation -func (s LoadBalancerAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancerAttribute) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *LoadBalancerAttribute) SetKey(v string) *LoadBalancerAttribute { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *LoadBalancerAttribute) SetValue(v string) *LoadBalancerAttribute { - s.Value = &v - return s -} - -// Information about the state of the load balancer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/LoadBalancerState -type LoadBalancerState struct { - _ struct{} `type:"structure"` - - // The state code. The initial state of the load balancer is provisioning. After - // the load balancer is fully set up and ready to route traffic, its state is - // active. If the load balancer could not be set up, its state is failed. - Code *string `type:"string" enum:"LoadBalancerStateEnum"` - - // A description of the state. - Reason *string `type:"string"` -} - -// String returns the string representation -func (s LoadBalancerState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancerState) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *LoadBalancerState) SetCode(v string) *LoadBalancerState { - s.Code = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *LoadBalancerState) SetReason(v string) *LoadBalancerState { - s.Reason = &v - return s -} - -// Information to use when checking for a successful response from a target. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Matcher -type Matcher struct { - _ struct{} `type:"structure"` - - // The HTTP codes. The default value is 200. You can specify multiple values - // (for example, "200,202") or a range of values (for example, "200-299"). - // - // HttpCode is a required field - HttpCode *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Matcher) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Matcher) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Matcher) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Matcher"} - if s.HttpCode == nil { - invalidParams.Add(request.NewErrParamRequired("HttpCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpCode sets the HttpCode field's value. -func (s *Matcher) SetHttpCode(v string) *Matcher { - s.HttpCode = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyListenerInput -type ModifyListenerInput struct { - _ struct{} `type:"structure"` - - // The SSL server certificate. - Certificates []*Certificate `type:"list"` - - // The default actions. - DefaultActions []*Action `type:"list"` - - // The Amazon Resource Name (ARN) of the listener. - // - // ListenerArn is a required field - ListenerArn *string `type:"string" required:"true"` - - // The port for connections from clients to the load balancer. - Port *int64 `min:"1" type:"integer"` - - // The protocol for connections from clients to the load balancer. - Protocol *string `type:"string" enum:"ProtocolEnum"` - - // The security policy that defines which ciphers and protocols are supported. - SslPolicy *string `type:"string"` -} - -// String returns the string representation -func (s ModifyListenerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyListenerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyListenerInput"} - if s.ListenerArn == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerArn")) - } - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - if s.DefaultActions != nil { - for i, v := range s.DefaultActions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DefaultActions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificates sets the Certificates field's value. -func (s *ModifyListenerInput) SetCertificates(v []*Certificate) *ModifyListenerInput { - s.Certificates = v - return s -} - -// SetDefaultActions sets the DefaultActions field's value. -func (s *ModifyListenerInput) SetDefaultActions(v []*Action) *ModifyListenerInput { - s.DefaultActions = v - return s -} - -// SetListenerArn sets the ListenerArn field's value. -func (s *ModifyListenerInput) SetListenerArn(v string) *ModifyListenerInput { - s.ListenerArn = &v - return s -} - -// SetPort sets the Port field's value. -func (s *ModifyListenerInput) SetPort(v int64) *ModifyListenerInput { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *ModifyListenerInput) SetProtocol(v string) *ModifyListenerInput { - s.Protocol = &v - return s -} - -// SetSslPolicy sets the SslPolicy field's value. -func (s *ModifyListenerInput) SetSslPolicy(v string) *ModifyListenerInput { - s.SslPolicy = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyListenerOutput -type ModifyListenerOutput struct { - _ struct{} `type:"structure"` - - // Information about the modified listeners. - Listeners []*Listener `type:"list"` -} - -// String returns the string representation -func (s ModifyListenerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyListenerOutput) GoString() string { - return s.String() -} - -// SetListeners sets the Listeners field's value. -func (s *ModifyListenerOutput) SetListeners(v []*Listener) *ModifyListenerOutput { - s.Listeners = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyLoadBalancerAttributesInput -type ModifyLoadBalancerAttributesInput struct { - _ struct{} `type:"structure"` - - // The load balancer attributes. - // - // Attributes is a required field - Attributes []*LoadBalancerAttribute `type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the load balancer. - // - // LoadBalancerArn is a required field - LoadBalancerArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyLoadBalancerAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyLoadBalancerAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyLoadBalancerAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyLoadBalancerAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.LoadBalancerArn == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *ModifyLoadBalancerAttributesInput) SetAttributes(v []*LoadBalancerAttribute) *ModifyLoadBalancerAttributesInput { - s.Attributes = v - return s -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *ModifyLoadBalancerAttributesInput) SetLoadBalancerArn(v string) *ModifyLoadBalancerAttributesInput { - s.LoadBalancerArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyLoadBalancerAttributesOutput -type ModifyLoadBalancerAttributesOutput struct { - _ struct{} `type:"structure"` - - // Information about the load balancer attributes. - Attributes []*LoadBalancerAttribute `type:"list"` -} - -// String returns the string representation -func (s ModifyLoadBalancerAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyLoadBalancerAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *ModifyLoadBalancerAttributesOutput) SetAttributes(v []*LoadBalancerAttribute) *ModifyLoadBalancerAttributesOutput { - s.Attributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyRuleInput -type ModifyRuleInput struct { - _ struct{} `type:"structure"` - - // The actions. - Actions []*Action `type:"list"` - - // The conditions. - Conditions []*RuleCondition `type:"list"` - - // The Amazon Resource Name (ARN) of the rule. - // - // RuleArn is a required field - RuleArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyRuleInput"} - if s.RuleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RuleArn")) - } - if s.Actions != nil { - for i, v := range s.Actions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Actions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActions sets the Actions field's value. -func (s *ModifyRuleInput) SetActions(v []*Action) *ModifyRuleInput { - s.Actions = v - return s -} - -// SetConditions sets the Conditions field's value. -func (s *ModifyRuleInput) SetConditions(v []*RuleCondition) *ModifyRuleInput { - s.Conditions = v - return s -} - -// SetRuleArn sets the RuleArn field's value. -func (s *ModifyRuleInput) SetRuleArn(v string) *ModifyRuleInput { - s.RuleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyRuleOutput -type ModifyRuleOutput struct { - _ struct{} `type:"structure"` - - // Information about the rule. - Rules []*Rule `type:"list"` -} - -// String returns the string representation -func (s ModifyRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyRuleOutput) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *ModifyRuleOutput) SetRules(v []*Rule) *ModifyRuleOutput { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupAttributesInput -type ModifyTargetGroupAttributesInput struct { - _ struct{} `type:"structure"` - - // The attributes. - // - // Attributes is a required field - Attributes []*TargetGroupAttribute `type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the target group. - // - // TargetGroupArn is a required field - TargetGroupArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyTargetGroupAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyTargetGroupAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyTargetGroupAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyTargetGroupAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.TargetGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *ModifyTargetGroupAttributesInput) SetAttributes(v []*TargetGroupAttribute) *ModifyTargetGroupAttributesInput { - s.Attributes = v - return s -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *ModifyTargetGroupAttributesInput) SetTargetGroupArn(v string) *ModifyTargetGroupAttributesInput { - s.TargetGroupArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupAttributesOutput -type ModifyTargetGroupAttributesOutput struct { - _ struct{} `type:"structure"` - - // Information about the attributes. - Attributes []*TargetGroupAttribute `type:"list"` -} - -// String returns the string representation -func (s ModifyTargetGroupAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyTargetGroupAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *ModifyTargetGroupAttributesOutput) SetAttributes(v []*TargetGroupAttribute) *ModifyTargetGroupAttributesOutput { - s.Attributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupInput -type ModifyTargetGroupInput struct { - _ struct{} `type:"structure"` - - // The approximate amount of time, in seconds, between health checks of an individual - // target. - HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` - - // The ping path that is the destination for the health check request. - HealthCheckPath *string `min:"1" type:"string"` - - // The port to use to connect with the target. - HealthCheckPort *string `type:"string"` - - // The protocol to use to connect with the target. - HealthCheckProtocol *string `type:"string" enum:"ProtocolEnum"` - - // The amount of time, in seconds, during which no response means a failed health - // check. - HealthCheckTimeoutSeconds *int64 `min:"2" type:"integer"` - - // The number of consecutive health checks successes required before considering - // an unhealthy target healthy. - HealthyThresholdCount *int64 `min:"2" type:"integer"` - - // The HTTP codes to use when checking for a successful response from a target. - Matcher *Matcher `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - // - // TargetGroupArn is a required field - TargetGroupArn *string `type:"string" required:"true"` - - // The number of consecutive health check failures required before considering - // the target unhealthy. - UnhealthyThresholdCount *int64 `min:"2" type:"integer"` -} - -// String returns the string representation -func (s ModifyTargetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyTargetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyTargetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyTargetGroupInput"} - if s.HealthCheckIntervalSeconds != nil && *s.HealthCheckIntervalSeconds < 5 { - invalidParams.Add(request.NewErrParamMinValue("HealthCheckIntervalSeconds", 5)) - } - if s.HealthCheckPath != nil && len(*s.HealthCheckPath) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HealthCheckPath", 1)) - } - if s.HealthCheckTimeoutSeconds != nil && *s.HealthCheckTimeoutSeconds < 2 { - invalidParams.Add(request.NewErrParamMinValue("HealthCheckTimeoutSeconds", 2)) - } - if s.HealthyThresholdCount != nil && *s.HealthyThresholdCount < 2 { - invalidParams.Add(request.NewErrParamMinValue("HealthyThresholdCount", 2)) - } - if s.TargetGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupArn")) - } - if s.UnhealthyThresholdCount != nil && *s.UnhealthyThresholdCount < 2 { - invalidParams.Add(request.NewErrParamMinValue("UnhealthyThresholdCount", 2)) - } - if s.Matcher != nil { - if err := s.Matcher.Validate(); err != nil { - invalidParams.AddNested("Matcher", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheckIntervalSeconds sets the HealthCheckIntervalSeconds field's value. -func (s *ModifyTargetGroupInput) SetHealthCheckIntervalSeconds(v int64) *ModifyTargetGroupInput { - s.HealthCheckIntervalSeconds = &v - return s -} - -// SetHealthCheckPath sets the HealthCheckPath field's value. -func (s *ModifyTargetGroupInput) SetHealthCheckPath(v string) *ModifyTargetGroupInput { - s.HealthCheckPath = &v - return s -} - -// SetHealthCheckPort sets the HealthCheckPort field's value. -func (s *ModifyTargetGroupInput) SetHealthCheckPort(v string) *ModifyTargetGroupInput { - s.HealthCheckPort = &v - return s -} - -// SetHealthCheckProtocol sets the HealthCheckProtocol field's value. -func (s *ModifyTargetGroupInput) SetHealthCheckProtocol(v string) *ModifyTargetGroupInput { - s.HealthCheckProtocol = &v - return s -} - -// SetHealthCheckTimeoutSeconds sets the HealthCheckTimeoutSeconds field's value. -func (s *ModifyTargetGroupInput) SetHealthCheckTimeoutSeconds(v int64) *ModifyTargetGroupInput { - s.HealthCheckTimeoutSeconds = &v - return s -} - -// SetHealthyThresholdCount sets the HealthyThresholdCount field's value. -func (s *ModifyTargetGroupInput) SetHealthyThresholdCount(v int64) *ModifyTargetGroupInput { - s.HealthyThresholdCount = &v - return s -} - -// SetMatcher sets the Matcher field's value. -func (s *ModifyTargetGroupInput) SetMatcher(v *Matcher) *ModifyTargetGroupInput { - s.Matcher = v - return s -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *ModifyTargetGroupInput) SetTargetGroupArn(v string) *ModifyTargetGroupInput { - s.TargetGroupArn = &v - return s -} - -// SetUnhealthyThresholdCount sets the UnhealthyThresholdCount field's value. -func (s *ModifyTargetGroupInput) SetUnhealthyThresholdCount(v int64) *ModifyTargetGroupInput { - s.UnhealthyThresholdCount = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupOutput -type ModifyTargetGroupOutput struct { - _ struct{} `type:"structure"` - - // Information about the target group. - TargetGroups []*TargetGroup `type:"list"` -} - -// String returns the string representation -func (s ModifyTargetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyTargetGroupOutput) GoString() string { - return s.String() -} - -// SetTargetGroups sets the TargetGroups field's value. -func (s *ModifyTargetGroupOutput) SetTargetGroups(v []*TargetGroup) *ModifyTargetGroupOutput { - s.TargetGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RegisterTargetsInput -type RegisterTargetsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - // - // TargetGroupArn is a required field - TargetGroupArn *string `type:"string" required:"true"` - - // The targets. The default port for a target is the port for the target group. - // You can specify a port override. If a target is already registered, you can - // register it again using a different port. - // - // Targets is a required field - Targets []*TargetDescription `type:"list" required:"true"` -} - -// String returns the string representation -func (s RegisterTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterTargetsInput"} - if s.TargetGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupArn")) - } - if s.Targets == nil { - invalidParams.Add(request.NewErrParamRequired("Targets")) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *RegisterTargetsInput) SetTargetGroupArn(v string) *RegisterTargetsInput { - s.TargetGroupArn = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *RegisterTargetsInput) SetTargets(v []*TargetDescription) *RegisterTargetsInput { - s.Targets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RegisterTargetsOutput -type RegisterTargetsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RegisterTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTargetsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveTagsInput -type RemoveTagsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArns is a required field - ResourceArns []*string `type:"list" required:"true"` - - // The tag keys for the tags to remove. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"} - if s.ResourceArns == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArns")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArns sets the ResourceArns field's value. -func (s *RemoveTagsInput) SetResourceArns(v []*string) *RemoveTagsInput { - s.ResourceArns = v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsInput) SetTagKeys(v []*string) *RemoveTagsInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveTagsOutput -type RemoveTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsOutput) GoString() string { - return s.String() -} - -// Information about a rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Rule -type Rule struct { - _ struct{} `type:"structure"` - - // The actions. - Actions []*Action `type:"list"` - - // The conditions. - Conditions []*RuleCondition `type:"list"` - - // Indicates whether this is the default rule. - IsDefault *bool `type:"boolean"` - - // The priority. - Priority *string `type:"string"` - - // The Amazon Resource Name (ARN) of the rule. - RuleArn *string `type:"string"` -} - -// 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() -} - -// SetActions sets the Actions field's value. -func (s *Rule) SetActions(v []*Action) *Rule { - s.Actions = v - return s -} - -// SetConditions sets the Conditions field's value. -func (s *Rule) SetConditions(v []*RuleCondition) *Rule { - s.Conditions = v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *Rule) SetIsDefault(v bool) *Rule { - s.IsDefault = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *Rule) SetPriority(v string) *Rule { - s.Priority = &v - return s -} - -// SetRuleArn sets the RuleArn field's value. -func (s *Rule) SetRuleArn(v string) *Rule { - s.RuleArn = &v - return s -} - -// Information about a condition for a rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RuleCondition -type RuleCondition struct { - _ struct{} `type:"structure"` - - // The only possible value is path-pattern. - Field *string `type:"string"` - - // The path pattern. You can specify a single path pattern. - // - // A path pattern is case sensitive, can be up to 128 characters in length, - // and can contain any of the following characters. Note that you can include - // up to three wildcard characters in a path pattern. - // - // * A-Z, a-z, 0-9 - // - // * _ - . $ / ~ " ' @ : + - // - // * & (using &) - // - // * * (matches 0 or more characters) - // - // * ? (matches exactly 1 character) - Values []*string `type:"list"` -} - -// String returns the string representation -func (s RuleCondition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RuleCondition) GoString() string { - return s.String() -} - -// SetField sets the Field field's value. -func (s *RuleCondition) SetField(v string) *RuleCondition { - s.Field = &v - return s -} - -// SetValues sets the Values field's value. -func (s *RuleCondition) SetValues(v []*string) *RuleCondition { - s.Values = v - return s -} - -// Information about the priorities for the rules for a listener. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RulePriorityPair -type RulePriorityPair struct { - _ struct{} `type:"structure"` - - // The rule priority. - Priority *int64 `min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the rule. - RuleArn *string `type:"string"` -} - -// String returns the string representation -func (s RulePriorityPair) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RulePriorityPair) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RulePriorityPair) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RulePriorityPair"} - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPriority sets the Priority field's value. -func (s *RulePriorityPair) SetPriority(v int64) *RulePriorityPair { - s.Priority = &v - return s -} - -// SetRuleArn sets the RuleArn field's value. -func (s *RulePriorityPair) SetRuleArn(v string) *RulePriorityPair { - s.RuleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetIpAddressTypeInput -type SetIpAddressTypeInput struct { - _ struct{} `type:"structure"` - - // The IP address type. The possible values are ipv4 (for IPv4 addresses) and - // dualstack (for IPv4 and IPv6 addresses). Internal load balancers must use - // ipv4. - // - // IpAddressType is a required field - IpAddressType *string `type:"string" required:"true" enum:"IpAddressType"` - - // The Amazon Resource Name (ARN) of the load balancer. - // - // LoadBalancerArn is a required field - LoadBalancerArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetIpAddressTypeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIpAddressTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetIpAddressTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetIpAddressTypeInput"} - if s.IpAddressType == nil { - invalidParams.Add(request.NewErrParamRequired("IpAddressType")) - } - if s.LoadBalancerArn == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIpAddressType sets the IpAddressType field's value. -func (s *SetIpAddressTypeInput) SetIpAddressType(v string) *SetIpAddressTypeInput { - s.IpAddressType = &v - return s -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *SetIpAddressTypeInput) SetLoadBalancerArn(v string) *SetIpAddressTypeInput { - s.LoadBalancerArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetIpAddressTypeOutput -type SetIpAddressTypeOutput struct { - _ struct{} `type:"structure"` - - // The IP address type. - IpAddressType *string `type:"string" enum:"IpAddressType"` -} - -// String returns the string representation -func (s SetIpAddressTypeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIpAddressTypeOutput) GoString() string { - return s.String() -} - -// SetIpAddressType sets the IpAddressType field's value. -func (s *SetIpAddressTypeOutput) SetIpAddressType(v string) *SetIpAddressTypeOutput { - s.IpAddressType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetRulePrioritiesInput -type SetRulePrioritiesInput struct { - _ struct{} `type:"structure"` - - // The rule priorities. - // - // RulePriorities is a required field - RulePriorities []*RulePriorityPair `type:"list" required:"true"` -} - -// String returns the string representation -func (s SetRulePrioritiesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetRulePrioritiesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetRulePrioritiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetRulePrioritiesInput"} - if s.RulePriorities == nil { - invalidParams.Add(request.NewErrParamRequired("RulePriorities")) - } - if s.RulePriorities != nil { - for i, v := range s.RulePriorities { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RulePriorities", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRulePriorities sets the RulePriorities field's value. -func (s *SetRulePrioritiesInput) SetRulePriorities(v []*RulePriorityPair) *SetRulePrioritiesInput { - s.RulePriorities = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetRulePrioritiesOutput -type SetRulePrioritiesOutput struct { - _ struct{} `type:"structure"` - - // Information about the rules. - Rules []*Rule `type:"list"` -} - -// String returns the string representation -func (s SetRulePrioritiesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetRulePrioritiesOutput) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *SetRulePrioritiesOutput) SetRules(v []*Rule) *SetRulePrioritiesOutput { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroupsInput -type SetSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the load balancer. - // - // LoadBalancerArn is a required field - LoadBalancerArn *string `type:"string" required:"true"` - - // The IDs of the security groups. - // - // SecurityGroups is a required field - SecurityGroups []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s SetSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetSecurityGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetSecurityGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetSecurityGroupsInput"} - if s.LoadBalancerArn == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerArn")) - } - if s.SecurityGroups == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityGroups")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *SetSecurityGroupsInput) SetLoadBalancerArn(v string) *SetSecurityGroupsInput { - s.LoadBalancerArn = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *SetSecurityGroupsInput) SetSecurityGroups(v []*string) *SetSecurityGroupsInput { - s.SecurityGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroupsOutput -type SetSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the security groups associated with the load balancer. - SecurityGroupIds []*string `type:"list"` -} - -// String returns the string representation -func (s SetSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *SetSecurityGroupsOutput) SetSecurityGroupIds(v []*string) *SetSecurityGroupsOutput { - s.SecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSubnetsInput -type SetSubnetsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the load balancer. - // - // LoadBalancerArn is a required field - LoadBalancerArn *string `type:"string" required:"true"` - - // The IDs of the subnets. You must specify at least two subnets. You can add - // only one subnet per Availability Zone. - // - // Subnets is a required field - Subnets []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s SetSubnetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetSubnetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetSubnetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetSubnetsInput"} - if s.LoadBalancerArn == nil { - invalidParams.Add(request.NewErrParamRequired("LoadBalancerArn")) - } - if s.Subnets == nil { - invalidParams.Add(request.NewErrParamRequired("Subnets")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *SetSubnetsInput) SetLoadBalancerArn(v string) *SetSubnetsInput { - s.LoadBalancerArn = &v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *SetSubnetsInput) SetSubnets(v []*string) *SetSubnetsInput { - s.Subnets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSubnetsOutput -type SetSubnetsOutput struct { - _ struct{} `type:"structure"` - - // Information about the subnet and Availability Zone. - AvailabilityZones []*AvailabilityZone `type:"list"` -} - -// String returns the string representation -func (s SetSubnetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetSubnetsOutput) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *SetSubnetsOutput) SetAvailabilityZones(v []*AvailabilityZone) *SetSubnetsOutput { - s.AvailabilityZones = v - return s -} - -// Information about a policy used for SSL negotiation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SslPolicy -type SslPolicy struct { - _ struct{} `type:"structure"` - - // The ciphers. - Ciphers []*Cipher `type:"list"` - - // The name of the policy. - Name *string `type:"string"` - - // The protocols. - SslProtocols []*string `type:"list"` -} - -// String returns the string representation -func (s SslPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SslPolicy) GoString() string { - return s.String() -} - -// SetCiphers sets the Ciphers field's value. -func (s *SslPolicy) SetCiphers(v []*Cipher) *SslPolicy { - s.Ciphers = v - return s -} - -// SetName sets the Name field's value. -func (s *SslPolicy) SetName(v string) *SslPolicy { - s.Name = &v - return s -} - -// SetSslProtocols sets the SslProtocols field's value. -func (s *SslPolicy) SetSslProtocols(v []*string) *SslPolicy { - s.SslProtocols = v - return s -} - -// Information about a tag. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value of 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() -} - -// 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 -} - -// The tags associated with a resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TagDescription -type TagDescription struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - ResourceArn *string `type:"string"` - - // Information about the tags. - Tags []*Tag `min:"1" type:"list"` -} - -// 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() -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagDescription) SetResourceArn(v string) *TagDescription { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagDescription) SetTags(v []*Tag) *TagDescription { - s.Tags = v - return s -} - -// Information about a target. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetDescription -type TargetDescription struct { - _ struct{} `type:"structure"` - - // The ID of the target. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The port on which the target is listening. - Port *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s TargetDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetDescription) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetDescription) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetDescription"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *TargetDescription) SetId(v string) *TargetDescription { - s.Id = &v - return s -} - -// SetPort sets the Port field's value. -func (s *TargetDescription) SetPort(v int64) *TargetDescription { - s.Port = &v - return s -} - -// Information about a target group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetGroup -type TargetGroup struct { - _ struct{} `type:"structure"` - - // The approximate amount of time, in seconds, between health checks of an individual - // target. - HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` - - // The destination for the health check request. - HealthCheckPath *string `min:"1" type:"string"` - - // The port to use to connect with the target. - HealthCheckPort *string `type:"string"` - - // The protocol to use to connect with the target. - HealthCheckProtocol *string `type:"string" enum:"ProtocolEnum"` - - // The amount of time, in seconds, during which no response means a failed health - // check. - HealthCheckTimeoutSeconds *int64 `min:"2" type:"integer"` - - // The number of consecutive health checks successes required before considering - // an unhealthy target healthy. - HealthyThresholdCount *int64 `min:"2" type:"integer"` - - // The Amazon Resource Names (ARN) of the load balancers that route traffic - // to this target group. - LoadBalancerArns []*string `type:"list"` - - // The HTTP codes to use when checking for a successful response from a target. - Matcher *Matcher `type:"structure"` - - // The port on which the targets are listening. - Port *int64 `min:"1" type:"integer"` - - // The protocol to use for routing traffic to the targets. - Protocol *string `type:"string" enum:"ProtocolEnum"` - - // The Amazon Resource Name (ARN) of the target group. - TargetGroupArn *string `type:"string"` - - // The name of the target group. - TargetGroupName *string `type:"string"` - - // The number of consecutive health check failures required before considering - // the target unhealthy. - UnhealthyThresholdCount *int64 `min:"2" type:"integer"` - - // The ID of the VPC for the targets. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s TargetGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetGroup) GoString() string { - return s.String() -} - -// SetHealthCheckIntervalSeconds sets the HealthCheckIntervalSeconds field's value. -func (s *TargetGroup) SetHealthCheckIntervalSeconds(v int64) *TargetGroup { - s.HealthCheckIntervalSeconds = &v - return s -} - -// SetHealthCheckPath sets the HealthCheckPath field's value. -func (s *TargetGroup) SetHealthCheckPath(v string) *TargetGroup { - s.HealthCheckPath = &v - return s -} - -// SetHealthCheckPort sets the HealthCheckPort field's value. -func (s *TargetGroup) SetHealthCheckPort(v string) *TargetGroup { - s.HealthCheckPort = &v - return s -} - -// SetHealthCheckProtocol sets the HealthCheckProtocol field's value. -func (s *TargetGroup) SetHealthCheckProtocol(v string) *TargetGroup { - s.HealthCheckProtocol = &v - return s -} - -// SetHealthCheckTimeoutSeconds sets the HealthCheckTimeoutSeconds field's value. -func (s *TargetGroup) SetHealthCheckTimeoutSeconds(v int64) *TargetGroup { - s.HealthCheckTimeoutSeconds = &v - return s -} - -// SetHealthyThresholdCount sets the HealthyThresholdCount field's value. -func (s *TargetGroup) SetHealthyThresholdCount(v int64) *TargetGroup { - s.HealthyThresholdCount = &v - return s -} - -// SetLoadBalancerArns sets the LoadBalancerArns field's value. -func (s *TargetGroup) SetLoadBalancerArns(v []*string) *TargetGroup { - s.LoadBalancerArns = v - return s -} - -// SetMatcher sets the Matcher field's value. -func (s *TargetGroup) SetMatcher(v *Matcher) *TargetGroup { - s.Matcher = v - return s -} - -// SetPort sets the Port field's value. -func (s *TargetGroup) SetPort(v int64) *TargetGroup { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *TargetGroup) SetProtocol(v string) *TargetGroup { - s.Protocol = &v - return s -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *TargetGroup) SetTargetGroupArn(v string) *TargetGroup { - s.TargetGroupArn = &v - return s -} - -// SetTargetGroupName sets the TargetGroupName field's value. -func (s *TargetGroup) SetTargetGroupName(v string) *TargetGroup { - s.TargetGroupName = &v - return s -} - -// SetUnhealthyThresholdCount sets the UnhealthyThresholdCount field's value. -func (s *TargetGroup) SetUnhealthyThresholdCount(v int64) *TargetGroup { - s.UnhealthyThresholdCount = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *TargetGroup) SetVpcId(v string) *TargetGroup { - s.VpcId = &v - return s -} - -// Information about a target group attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetGroupAttribute -type TargetGroupAttribute struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - // - // * deregistration_delay.timeout_seconds - The amount time for Elastic Load - // Balancing to wait before changing the state of a deregistering target - // from draining to unused. The range is 0-3600 seconds. The default value - // is 300 seconds. - // - // * stickiness.enabled - Indicates whether sticky sessions are enabled. - // The value is true or false. - // - // * stickiness.type - The type of sticky sessions. The possible value is - // lb_cookie. - // - // * stickiness.lb_cookie.duration_seconds - The time period, in seconds, - // during which requests from a client should be routed to the same target. - // After this time period expires, the load balancer-generated cookie is - // considered stale. The range is 1 second to 1 week (604800 seconds). The - // default value is 1 day (86400 seconds). - Key *string `type:"string"` - - // The value of the attribute. - Value *string `type:"string"` -} - -// String returns the string representation -func (s TargetGroupAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetGroupAttribute) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TargetGroupAttribute) SetKey(v string) *TargetGroupAttribute { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *TargetGroupAttribute) SetValue(v string) *TargetGroupAttribute { - s.Value = &v - return s -} - -// Information about the current health of a target. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetHealth -type TargetHealth struct { - _ struct{} `type:"structure"` - - // A description of the target health that provides additional details. If the - // state is healthy, a description is not provided. - Description *string `type:"string"` - - // The reason code. If the target state is healthy, a reason code is not provided. - // - // If the target state is initial, the reason code can be one of the following - // values: - // - // * Elb.RegistrationInProgress - The target is in the process of being registered - // with the load balancer. - // - // * Elb.InitialHealthChecking - The load balancer is still sending the target - // the minimum number of health checks required to determine its health status. - // - // If the target state is unhealthy, the reason code can be one of the following - // values: - // - // * Target.ResponseCodeMismatch - The health checks did not return an expected - // HTTP code. - // - // * Target.Timeout - The health check requests timed out. - // - // * Target.FailedHealthChecks - The health checks failed because the connection - // to the target timed out, the target response was malformed, or the target - // failed the health check for an unknown reason. - // - // * Elb.InternalError - The health checks failed due to an internal error. - // - // If the target state is unused, the reason code can be one of the following - // values: - // - // * Target.NotRegistered - The target is not registered with the target - // group. - // - // * Target.NotInUse - The target group is not used by any load balancer - // or the target is in an Availability Zone that is not enabled for its load - // balancer. - // - // * Target.InvalidState - The target is in the stopped or terminated state. - // - // If the target state is draining, the reason code can be the following value: - // - // * Target.DeregistrationInProgress - The target is in the process of being - // deregistered and the deregistration delay period has not expired. - Reason *string `type:"string" enum:"TargetHealthReasonEnum"` - - // The state of the target. - State *string `type:"string" enum:"TargetHealthStateEnum"` -} - -// String returns the string representation -func (s TargetHealth) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetHealth) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *TargetHealth) SetDescription(v string) *TargetHealth { - s.Description = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *TargetHealth) SetReason(v string) *TargetHealth { - s.Reason = &v - return s -} - -// SetState sets the State field's value. -func (s *TargetHealth) SetState(v string) *TargetHealth { - s.State = &v - return s -} - -// Information about the health of a target. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetHealthDescription -type TargetHealthDescription struct { - _ struct{} `type:"structure"` - - // The port to use to connect with the target. - HealthCheckPort *string `type:"string"` - - // The description of the target. - Target *TargetDescription `type:"structure"` - - // The health information for the target. - TargetHealth *TargetHealth `type:"structure"` -} - -// String returns the string representation -func (s TargetHealthDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetHealthDescription) GoString() string { - return s.String() -} - -// SetHealthCheckPort sets the HealthCheckPort field's value. -func (s *TargetHealthDescription) SetHealthCheckPort(v string) *TargetHealthDescription { - s.HealthCheckPort = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *TargetHealthDescription) SetTarget(v *TargetDescription) *TargetHealthDescription { - s.Target = v - return s -} - -// SetTargetHealth sets the TargetHealth field's value. -func (s *TargetHealthDescription) SetTargetHealth(v *TargetHealth) *TargetHealthDescription { - s.TargetHealth = v - return s -} - -const ( - // ActionTypeEnumForward is a ActionTypeEnum enum value - ActionTypeEnumForward = "forward" -) - -const ( - // IpAddressTypeIpv4 is a IpAddressType enum value - IpAddressTypeIpv4 = "ipv4" - - // IpAddressTypeDualstack is a IpAddressType enum value - IpAddressTypeDualstack = "dualstack" -) - -const ( - // LoadBalancerSchemeEnumInternetFacing is a LoadBalancerSchemeEnum enum value - LoadBalancerSchemeEnumInternetFacing = "internet-facing" - - // LoadBalancerSchemeEnumInternal is a LoadBalancerSchemeEnum enum value - LoadBalancerSchemeEnumInternal = "internal" -) - -const ( - // LoadBalancerStateEnumActive is a LoadBalancerStateEnum enum value - LoadBalancerStateEnumActive = "active" - - // LoadBalancerStateEnumProvisioning is a LoadBalancerStateEnum enum value - LoadBalancerStateEnumProvisioning = "provisioning" - - // LoadBalancerStateEnumFailed is a LoadBalancerStateEnum enum value - LoadBalancerStateEnumFailed = "failed" -) - -const ( - // LoadBalancerTypeEnumApplication is a LoadBalancerTypeEnum enum value - LoadBalancerTypeEnumApplication = "application" -) - -const ( - // ProtocolEnumHttp is a ProtocolEnum enum value - ProtocolEnumHttp = "HTTP" - - // ProtocolEnumHttps is a ProtocolEnum enum value - ProtocolEnumHttps = "HTTPS" -) - -const ( - // TargetHealthReasonEnumElbRegistrationInProgress is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumElbRegistrationInProgress = "Elb.RegistrationInProgress" - - // TargetHealthReasonEnumElbInitialHealthChecking is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumElbInitialHealthChecking = "Elb.InitialHealthChecking" - - // TargetHealthReasonEnumTargetResponseCodeMismatch is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumTargetResponseCodeMismatch = "Target.ResponseCodeMismatch" - - // TargetHealthReasonEnumTargetTimeout is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumTargetTimeout = "Target.Timeout" - - // TargetHealthReasonEnumTargetFailedHealthChecks is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumTargetFailedHealthChecks = "Target.FailedHealthChecks" - - // TargetHealthReasonEnumTargetNotRegistered is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumTargetNotRegistered = "Target.NotRegistered" - - // TargetHealthReasonEnumTargetNotInUse is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumTargetNotInUse = "Target.NotInUse" - - // TargetHealthReasonEnumTargetDeregistrationInProgress is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumTargetDeregistrationInProgress = "Target.DeregistrationInProgress" - - // TargetHealthReasonEnumTargetInvalidState is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumTargetInvalidState = "Target.InvalidState" - - // TargetHealthReasonEnumElbInternalError is a TargetHealthReasonEnum enum value - TargetHealthReasonEnumElbInternalError = "Elb.InternalError" -) - -const ( - // TargetHealthStateEnumInitial is a TargetHealthStateEnum enum value - TargetHealthStateEnumInitial = "initial" - - // TargetHealthStateEnumHealthy is a TargetHealthStateEnum enum value - TargetHealthStateEnumHealthy = "healthy" - - // TargetHealthStateEnumUnhealthy is a TargetHealthStateEnum enum value - TargetHealthStateEnumUnhealthy = "unhealthy" - - // TargetHealthStateEnumUnused is a TargetHealthStateEnum enum value - TargetHealthStateEnumUnused = "unused" - - // TargetHealthStateEnumDraining is a TargetHealthStateEnum enum value - TargetHealthStateEnumDraining = "draining" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go deleted file mode 100644 index 4f49c2f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go +++ /dev/null @@ -1,195 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elbv2 - -const ( - - // ErrCodeCertificateNotFoundException for service response error code - // "CertificateNotFound". - // - // The specified certificate does not exist. - ErrCodeCertificateNotFoundException = "CertificateNotFound" - - // ErrCodeDuplicateListenerException for service response error code - // "DuplicateListener". - // - // A listener with the specified port already exists. - ErrCodeDuplicateListenerException = "DuplicateListener" - - // ErrCodeDuplicateLoadBalancerNameException for service response error code - // "DuplicateLoadBalancerName". - // - // A load balancer with the specified name already exists for this account. - ErrCodeDuplicateLoadBalancerNameException = "DuplicateLoadBalancerName" - - // ErrCodeDuplicateTagKeysException for service response error code - // "DuplicateTagKeys". - // - // A tag key was specified more than once. - ErrCodeDuplicateTagKeysException = "DuplicateTagKeys" - - // ErrCodeDuplicateTargetGroupNameException for service response error code - // "DuplicateTargetGroupName". - // - // A target group with the specified name already exists. - ErrCodeDuplicateTargetGroupNameException = "DuplicateTargetGroupName" - - // ErrCodeHealthUnavailableException for service response error code - // "HealthUnavailable". - // - // The health of the specified targets could not be retrieved due to an internal - // error. - ErrCodeHealthUnavailableException = "HealthUnavailable" - - // ErrCodeIncompatibleProtocolsException for service response error code - // "IncompatibleProtocols". - // - // The specified configuration is not valid with this protocol. - ErrCodeIncompatibleProtocolsException = "IncompatibleProtocols" - - // ErrCodeInvalidConfigurationRequestException for service response error code - // "InvalidConfigurationRequest". - // - // The requested configuration is not valid. - ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest" - - // ErrCodeInvalidSchemeException for service response error code - // "InvalidScheme". - // - // The requested scheme is not valid. - ErrCodeInvalidSchemeException = "InvalidScheme" - - // ErrCodeInvalidSecurityGroupException for service response error code - // "InvalidSecurityGroup". - // - // The specified security group does not exist. - ErrCodeInvalidSecurityGroupException = "InvalidSecurityGroup" - - // ErrCodeInvalidSubnetException for service response error code - // "InvalidSubnet". - // - // The specified subnet is out of available addresses. - ErrCodeInvalidSubnetException = "InvalidSubnet" - - // ErrCodeInvalidTargetException for service response error code - // "InvalidTarget". - // - // The specified target does not exist or is not in the same VPC as the target - // group. - ErrCodeInvalidTargetException = "InvalidTarget" - - // ErrCodeListenerNotFoundException for service response error code - // "ListenerNotFound". - // - // The specified listener does not exist. - ErrCodeListenerNotFoundException = "ListenerNotFound" - - // ErrCodeLoadBalancerNotFoundException for service response error code - // "LoadBalancerNotFound". - // - // The specified load balancer does not exist. - ErrCodeLoadBalancerNotFoundException = "LoadBalancerNotFound" - - // ErrCodeOperationNotPermittedException for service response error code - // "OperationNotPermitted". - // - // This operation is not allowed. - ErrCodeOperationNotPermittedException = "OperationNotPermitted" - - // ErrCodePriorityInUseException for service response error code - // "PriorityInUse". - // - // The specified priority is in use. - ErrCodePriorityInUseException = "PriorityInUse" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUse". - // - // A specified resource is in use. - ErrCodeResourceInUseException = "ResourceInUse" - - // ErrCodeRuleNotFoundException for service response error code - // "RuleNotFound". - // - // The specified rule does not exist. - ErrCodeRuleNotFoundException = "RuleNotFound" - - // ErrCodeSSLPolicyNotFoundException for service response error code - // "SSLPolicyNotFound". - // - // The specified SSL policy does not exist. - ErrCodeSSLPolicyNotFoundException = "SSLPolicyNotFound" - - // ErrCodeSubnetNotFoundException for service response error code - // "SubnetNotFound". - // - // The specified subnet does not exist. - ErrCodeSubnetNotFoundException = "SubnetNotFound" - - // ErrCodeTargetGroupAssociationLimitException for service response error code - // "TargetGroupAssociationLimit". - // - // You've reached the limit on the number of load balancers per target group. - ErrCodeTargetGroupAssociationLimitException = "TargetGroupAssociationLimit" - - // ErrCodeTargetGroupNotFoundException for service response error code - // "TargetGroupNotFound". - // - // The specified target group does not exist. - ErrCodeTargetGroupNotFoundException = "TargetGroupNotFound" - - // ErrCodeTooManyCertificatesException for service response error code - // "TooManyCertificates". - // - // You've reached the limit on the number of certificates per listener. - ErrCodeTooManyCertificatesException = "TooManyCertificates" - - // ErrCodeTooManyListenersException for service response error code - // "TooManyListeners". - // - // You've reached the limit on the number of listeners per load balancer. - ErrCodeTooManyListenersException = "TooManyListeners" - - // ErrCodeTooManyLoadBalancersException for service response error code - // "TooManyLoadBalancers". - // - // You've reached the limit on the number of load balancers for your AWS account. - ErrCodeTooManyLoadBalancersException = "TooManyLoadBalancers" - - // ErrCodeTooManyRegistrationsForTargetIdException for service response error code - // "TooManyRegistrationsForTargetId". - // - // You've reached the limit on the number of times a target can be registered - // with a load balancer. - ErrCodeTooManyRegistrationsForTargetIdException = "TooManyRegistrationsForTargetId" - - // ErrCodeTooManyRulesException for service response error code - // "TooManyRules". - // - // You've reached the limit on the number of rules per load balancer. - ErrCodeTooManyRulesException = "TooManyRules" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTags". - // - // You've reached the limit on the number of tags per load balancer. - ErrCodeTooManyTagsException = "TooManyTags" - - // ErrCodeTooManyTargetGroupsException for service response error code - // "TooManyTargetGroups". - // - // You've reached the limit on the number of target groups for your AWS account. - ErrCodeTooManyTargetGroupsException = "TooManyTargetGroups" - - // ErrCodeTooManyTargetsException for service response error code - // "TooManyTargets". - // - // You've reached the limit on the number of targets. - ErrCodeTooManyTargetsException = "TooManyTargets" - - // ErrCodeUnsupportedProtocolException for service response error code - // "UnsupportedProtocol". - // - // The specified protocol is not supported. - ErrCodeUnsupportedProtocolException = "UnsupportedProtocol" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go b/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go deleted file mode 100644 index 3e2e79a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go +++ /dev/null @@ -1,136 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package elbv2 - -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" -) - -// A load balancer distributes incoming traffic across targets, such as your -// EC2 instances. This enables you to increase the availability of your application. -// The load balancer also monitors the health of its registered targets and -// ensures that it routes traffic only to healthy targets. You configure your -// load balancer to accept incoming traffic by specifying one or more listeners, -// which are configured with a protocol and port number for connections from -// clients to the load balancer. You configure a target group with a protocol -// and port number for connections from the load balancer to the targets, and -// with health check settings to be used when checking the health status of -// the targets. -// -// Elastic Load Balancing supports two types of load balancers: Classic Load -// Balancers and Application Load Balancers. A Classic Load Balancer makes routing -// and load balancing decisions either at the transport layer (TCP/SSL) or the -// application layer (HTTP/HTTPS), and supports either EC2-Classic or a VPC. -// An Application Load Balancer makes routing and load balancing decisions at -// the application layer (HTTP/HTTPS), supports path-based routing, and can -// route requests to one or more ports on each EC2 instance or container instance -// in your virtual private cloud (VPC). For more information, see the Elastic -// Load Balancing User Guide (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/). -// -// This reference covers the 2015-12-01 API, which supports Application Load -// Balancers. The 2012-06-01 API supports Classic Load Balancers. -// -// To get started, complete the following tasks: -// -// Create an Application Load Balancer using CreateLoadBalancer. -// -// Create a target group using CreateTargetGroup. -// -// Register targets for the target group using RegisterTargets. -// -// Create one or more listeners for your load balancer using CreateListener. -// -// (Optional) Create one or more rules for content routing based on URL using -// CreateRule. -// -// To delete an Application Load Balancer and its related resources, complete -// the following tasks: -// -// Delete the load balancer using DeleteLoadBalancer. -// -// Delete the target group using DeleteTargetGroup. -// -// All Elastic Load Balancing operations are idempotent, which means that they -// complete at most one time. If you repeat an operation, it succeeds. -// 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/elasticloadbalancingv2-2015-12-01 -type ELBV2 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 = "elasticloadbalancing" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ELBV2 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 ELBV2 client from just a session. -// svc := elbv2.New(mySession) -// -// // Create a ELBV2 client with additional configuration -// svc := elbv2.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ELBV2 { - 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) *ELBV2 { - svc := &ELBV2{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-12-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ELBV2 operation and runs any -// custom request initialization. -func (c *ELBV2) 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/emr/api.go b/vendor/github.com/aws/aws-sdk-go/service/emr/api.go deleted file mode 100644 index 169ba4e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/api.go +++ /dev/null @@ -1,10125 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package emr provides a client for Amazon Elastic MapReduce. -package emr - -import ( - "fmt" - "time" - - "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 opAddInstanceFleet = "AddInstanceFleet" - -// AddInstanceFleetRequest generates a "aws/request.Request" representing the -// client's request for the AddInstanceFleet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddInstanceFleet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddInstanceFleet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddInstanceFleetRequest method. -// req, resp := client.AddInstanceFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleet -func (c *EMR) AddInstanceFleetRequest(input *AddInstanceFleetInput) (req *request.Request, output *AddInstanceFleetOutput) { - op := &request.Operation{ - Name: opAddInstanceFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddInstanceFleetInput{} - } - - output = &AddInstanceFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddInstanceFleet API operation for Amazon Elastic MapReduce. -// -// Adds an instance fleet to a running cluster. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation AddInstanceFleet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleet -func (c *EMR) AddInstanceFleet(input *AddInstanceFleetInput) (*AddInstanceFleetOutput, error) { - req, out := c.AddInstanceFleetRequest(input) - err := req.Send() - return out, err -} - -const opAddInstanceGroups = "AddInstanceGroups" - -// AddInstanceGroupsRequest generates a "aws/request.Request" representing the -// client's request for the AddInstanceGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddInstanceGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddInstanceGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddInstanceGroupsRequest method. -// req, resp := client.AddInstanceGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceGroups -func (c *EMR) AddInstanceGroupsRequest(input *AddInstanceGroupsInput) (req *request.Request, output *AddInstanceGroupsOutput) { - op := &request.Operation{ - Name: opAddInstanceGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddInstanceGroupsInput{} - } - - output = &AddInstanceGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddInstanceGroups API operation for Amazon Elastic MapReduce. -// -// Adds one or more instance groups to a running cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation AddInstanceGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceGroups -func (c *EMR) AddInstanceGroups(input *AddInstanceGroupsInput) (*AddInstanceGroupsOutput, error) { - req, out := c.AddInstanceGroupsRequest(input) - err := req.Send() - return out, err -} - -const opAddJobFlowSteps = "AddJobFlowSteps" - -// AddJobFlowStepsRequest generates a "aws/request.Request" representing the -// client's request for the AddJobFlowSteps operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddJobFlowSteps for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddJobFlowSteps method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddJobFlowStepsRequest method. -// req, resp := client.AddJobFlowStepsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddJobFlowSteps -func (c *EMR) AddJobFlowStepsRequest(input *AddJobFlowStepsInput) (req *request.Request, output *AddJobFlowStepsOutput) { - op := &request.Operation{ - Name: opAddJobFlowSteps, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddJobFlowStepsInput{} - } - - output = &AddJobFlowStepsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddJobFlowSteps API operation for Amazon Elastic MapReduce. -// -// AddJobFlowSteps adds new steps to a running cluster. A maximum of 256 steps -// are allowed in each job flow. -// -// If your cluster is long-running (such as a Hive data warehouse) or complex, -// you may require more than 256 steps to process your data. You can bypass -// the 256-step limitation in various ways, including using SSH to connect to -// the master node and submitting queries directly to the software running on -// the master node, such as Hive and Hadoop. For more information on how to -// do this, see Add More than 256 Steps to a Cluster (http://docs.aws.amazon.com/ElasticMapReduce/latest/ManagementGuide/AddMoreThan256Steps.html) -// in the Amazon EMR Management Guide. -// -// A step specifies the location of a JAR file stored either on the master node -// of the cluster or in Amazon S3. Each step is performed by the main function -// of the main class of the JAR file. The main class can be specified either -// in the manifest of the JAR or by using the MainFunction parameter of the -// step. -// -// Amazon EMR executes each step in the order listed. For a step to be considered -// complete, the main function must exit with a zero exit code and all Hadoop -// jobs started while the step was running must have completed and run successfully. -// -// You can only add steps to a cluster that is in one of the following states: -// STARTING, BOOTSTRAPPING, RUNNING, or WAITING. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation AddJobFlowSteps for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddJobFlowSteps -func (c *EMR) AddJobFlowSteps(input *AddJobFlowStepsInput) (*AddJobFlowStepsOutput, error) { - req, out := c.AddJobFlowStepsRequest(input) - err := req.Send() - return out, err -} - -const opAddTags = "AddTags" - -// AddTagsRequest generates a "aws/request.Request" representing the -// client's request for the AddTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsRequest method. -// req, resp := client.AddTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddTags -func (c *EMR) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { - op := &request.Operation{ - Name: opAddTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsInput{} - } - - output = &AddTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddTags API operation for Amazon Elastic MapReduce. -// -// Adds tags to an Amazon EMR resource. Tags make it easier to associate clusters -// in various ways, such as grouping clusters to track your Amazon EMR resource -// allocation costs. For more information, see Tagging Amazon EMR Resources -// (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-plan-tags.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 MapReduce's -// API operation AddTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddTags -func (c *EMR) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { - req, out := c.AddTagsRequest(input) - err := req.Send() - return out, err -} - -const opCancelSteps = "CancelSteps" - -// CancelStepsRequest generates a "aws/request.Request" representing the -// client's request for the CancelSteps operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelSteps for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelSteps method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelStepsRequest method. -// req, resp := client.CancelStepsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CancelSteps -func (c *EMR) CancelStepsRequest(input *CancelStepsInput) (req *request.Request, output *CancelStepsOutput) { - op := &request.Operation{ - Name: opCancelSteps, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelStepsInput{} - } - - output = &CancelStepsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelSteps API operation for Amazon Elastic MapReduce. -// -// Cancels a pending step or steps in a running cluster. Available only in Amazon -// EMR versions 4.8.0 and later, excluding version 5.0.0. A maximum of 256 steps -// are allowed in each CancelSteps request. CancelSteps is idempotent but asynchronous; -// it does not guarantee a step will be canceled, even if the request is successfully -// submitted. You can only cancel steps that are in a PENDING 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 MapReduce's -// API operation CancelSteps for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CancelSteps -func (c *EMR) CancelSteps(input *CancelStepsInput) (*CancelStepsOutput, error) { - req, out := c.CancelStepsRequest(input) - err := req.Send() - return out, err -} - -const opCreateSecurityConfiguration = "CreateSecurityConfiguration" - -// CreateSecurityConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the CreateSecurityConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSecurityConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSecurityConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSecurityConfigurationRequest method. -// req, resp := client.CreateSecurityConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CreateSecurityConfiguration -func (c *EMR) CreateSecurityConfigurationRequest(input *CreateSecurityConfigurationInput) (req *request.Request, output *CreateSecurityConfigurationOutput) { - op := &request.Operation{ - Name: opCreateSecurityConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSecurityConfigurationInput{} - } - - output = &CreateSecurityConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSecurityConfiguration API operation for Amazon Elastic MapReduce. -// -// Creates a security configuration, which is stored in the service and can -// be specified when a cluster is 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 MapReduce's -// API operation CreateSecurityConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CreateSecurityConfiguration -func (c *EMR) CreateSecurityConfiguration(input *CreateSecurityConfigurationInput) (*CreateSecurityConfigurationOutput, error) { - req, out := c.CreateSecurityConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteSecurityConfiguration = "DeleteSecurityConfiguration" - -// DeleteSecurityConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSecurityConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSecurityConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSecurityConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSecurityConfigurationRequest method. -// req, resp := client.DeleteSecurityConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DeleteSecurityConfiguration -func (c *EMR) DeleteSecurityConfigurationRequest(input *DeleteSecurityConfigurationInput) (req *request.Request, output *DeleteSecurityConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteSecurityConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSecurityConfigurationInput{} - } - - output = &DeleteSecurityConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSecurityConfiguration API operation for Amazon Elastic MapReduce. -// -// Deletes a security 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 Elastic MapReduce's -// API operation DeleteSecurityConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DeleteSecurityConfiguration -func (c *EMR) DeleteSecurityConfiguration(input *DeleteSecurityConfigurationInput) (*DeleteSecurityConfigurationOutput, error) { - req, out := c.DeleteSecurityConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opDescribeCluster = "DescribeCluster" - -// DescribeClusterRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClusterRequest method. -// req, resp := client.DescribeClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeCluster -func (c *EMR) DescribeClusterRequest(input *DescribeClusterInput) (req *request.Request, output *DescribeClusterOutput) { - op := &request.Operation{ - Name: opDescribeCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeClusterInput{} - } - - output = &DescribeClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCluster API operation for Amazon Elastic MapReduce. -// -// Provides cluster-level details including status, hardware and software configuration, -// VPC settings, and so on. For information about the cluster steps, see ListSteps. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation DescribeCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeCluster -func (c *EMR) DescribeCluster(input *DescribeClusterInput) (*DescribeClusterOutput, error) { - req, out := c.DescribeClusterRequest(input) - err := req.Send() - return out, err -} - -const opDescribeJobFlows = "DescribeJobFlows" - -// DescribeJobFlowsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeJobFlows operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeJobFlows for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeJobFlows method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeJobFlowsRequest method. -// req, resp := client.DescribeJobFlowsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeJobFlows -func (c *EMR) DescribeJobFlowsRequest(input *DescribeJobFlowsInput) (req *request.Request, output *DescribeJobFlowsOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, DescribeJobFlows, has been deprecated") - } - op := &request.Operation{ - Name: opDescribeJobFlows, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeJobFlowsInput{} - } - - output = &DescribeJobFlowsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeJobFlows API operation for Amazon Elastic MapReduce. -// -// This API is deprecated and will eventually be removed. We recommend you use -// ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions -// instead. -// -// DescribeJobFlows returns a list of job flows that match all of the supplied -// parameters. The parameters can include a list of job flow IDs, job flow states, -// and restrictions on job flow creation date and time. -// -// Regardless of supplied parameters, only job flows created within the last -// two months are returned. -// -// If no parameters are supplied, then job flows matching either of the following -// criteria are returned: -// -// * Job flows created and completed in the last two weeks -// -// * Job flows created within the last two months that are in one of the -// following states: RUNNING, WAITING, SHUTTING_DOWN, STARTING -// -// Amazon EMR can return a maximum of 512 job flow descriptions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation DescribeJobFlows for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeJobFlows -func (c *EMR) DescribeJobFlows(input *DescribeJobFlowsInput) (*DescribeJobFlowsOutput, error) { - req, out := c.DescribeJobFlowsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeSecurityConfiguration = "DescribeSecurityConfiguration" - -// DescribeSecurityConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSecurityConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSecurityConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSecurityConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSecurityConfigurationRequest method. -// req, resp := client.DescribeSecurityConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeSecurityConfiguration -func (c *EMR) DescribeSecurityConfigurationRequest(input *DescribeSecurityConfigurationInput) (req *request.Request, output *DescribeSecurityConfigurationOutput) { - op := &request.Operation{ - Name: opDescribeSecurityConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSecurityConfigurationInput{} - } - - output = &DescribeSecurityConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSecurityConfiguration API operation for Amazon Elastic MapReduce. -// -// Provides the details of a security configuration by returning the configuration -// JSON. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation DescribeSecurityConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeSecurityConfiguration -func (c *EMR) DescribeSecurityConfiguration(input *DescribeSecurityConfigurationInput) (*DescribeSecurityConfigurationOutput, error) { - req, out := c.DescribeSecurityConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opDescribeStep = "DescribeStep" - -// DescribeStepRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStep operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStep for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStep method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStepRequest method. -// req, resp := client.DescribeStepRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeStep -func (c *EMR) DescribeStepRequest(input *DescribeStepInput) (req *request.Request, output *DescribeStepOutput) { - op := &request.Operation{ - Name: opDescribeStep, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStepInput{} - } - - output = &DescribeStepOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStep API operation for Amazon Elastic MapReduce. -// -// Provides more detail about the cluster step. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation DescribeStep for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeStep -func (c *EMR) DescribeStep(input *DescribeStepInput) (*DescribeStepOutput, error) { - req, out := c.DescribeStepRequest(input) - err := req.Send() - return out, err -} - -const opListBootstrapActions = "ListBootstrapActions" - -// ListBootstrapActionsRequest generates a "aws/request.Request" representing the -// client's request for the ListBootstrapActions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListBootstrapActions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListBootstrapActions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListBootstrapActionsRequest method. -// req, resp := client.ListBootstrapActionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListBootstrapActions -func (c *EMR) ListBootstrapActionsRequest(input *ListBootstrapActionsInput) (req *request.Request, output *ListBootstrapActionsOutput) { - op := &request.Operation{ - Name: opListBootstrapActions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListBootstrapActionsInput{} - } - - output = &ListBootstrapActionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBootstrapActions API operation for Amazon Elastic MapReduce. -// -// Provides information about the bootstrap actions associated with a cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation ListBootstrapActions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListBootstrapActions -func (c *EMR) ListBootstrapActions(input *ListBootstrapActionsInput) (*ListBootstrapActionsOutput, error) { - req, out := c.ListBootstrapActionsRequest(input) - err := req.Send() - return out, err -} - -// ListBootstrapActionsPages iterates over the pages of a ListBootstrapActions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListBootstrapActions 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 ListBootstrapActions operation. -// pageNum := 0 -// err := client.ListBootstrapActionsPages(params, -// func(page *ListBootstrapActionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListBootstrapActionsPages(input *ListBootstrapActionsInput, fn func(p *ListBootstrapActionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListBootstrapActionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListBootstrapActionsOutput), lastPage) - }) -} - -const opListClusters = "ListClusters" - -// ListClustersRequest generates a "aws/request.Request" representing the -// client's request for the ListClusters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListClusters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListClusters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListClustersRequest method. -// req, resp := client.ListClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListClusters -func (c *EMR) ListClustersRequest(input *ListClustersInput) (req *request.Request, output *ListClustersOutput) { - op := &request.Operation{ - Name: opListClusters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListClustersInput{} - } - - output = &ListClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListClusters API operation for Amazon Elastic MapReduce. -// -// Provides the status of all clusters visible to this AWS account. Allows you -// to filter the list of clusters based on certain criteria; for example, filtering -// by cluster creation date and time or by status. This call returns a maximum -// of 50 clusters per call, but returns a marker to track the paging of the -// cluster list across multiple ListClusters calls. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation ListClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListClusters -func (c *EMR) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) - err := req.Send() - return out, err -} - -// ListClustersPages iterates over the pages of a ListClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListClusters 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 ListClusters operation. -// pageNum := 0 -// err := client.ListClustersPages(params, -// func(page *ListClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListClustersPages(input *ListClustersInput, fn func(p *ListClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListClustersOutput), lastPage) - }) -} - -const opListInstanceFleets = "ListInstanceFleets" - -// ListInstanceFleetsRequest generates a "aws/request.Request" representing the -// client's request for the ListInstanceFleets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListInstanceFleets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListInstanceFleets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListInstanceFleetsRequest method. -// req, resp := client.ListInstanceFleetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceFleets -func (c *EMR) ListInstanceFleetsRequest(input *ListInstanceFleetsInput) (req *request.Request, output *ListInstanceFleetsOutput) { - op := &request.Operation{ - Name: opListInstanceFleets, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListInstanceFleetsInput{} - } - - output = &ListInstanceFleetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListInstanceFleets API operation for Amazon Elastic MapReduce. -// -// Lists all available details about the instance fleets in a cluster. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation ListInstanceFleets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceFleets -func (c *EMR) ListInstanceFleets(input *ListInstanceFleetsInput) (*ListInstanceFleetsOutput, error) { - req, out := c.ListInstanceFleetsRequest(input) - err := req.Send() - return out, err -} - -// ListInstanceFleetsPages iterates over the pages of a ListInstanceFleets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstanceFleets 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 ListInstanceFleets operation. -// pageNum := 0 -// err := client.ListInstanceFleetsPages(params, -// func(page *ListInstanceFleetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListInstanceFleetsPages(input *ListInstanceFleetsInput, fn func(p *ListInstanceFleetsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstanceFleetsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstanceFleetsOutput), lastPage) - }) -} - -const opListInstanceGroups = "ListInstanceGroups" - -// ListInstanceGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListInstanceGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListInstanceGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListInstanceGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListInstanceGroupsRequest method. -// req, resp := client.ListInstanceGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceGroups -func (c *EMR) ListInstanceGroupsRequest(input *ListInstanceGroupsInput) (req *request.Request, output *ListInstanceGroupsOutput) { - op := &request.Operation{ - Name: opListInstanceGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListInstanceGroupsInput{} - } - - output = &ListInstanceGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListInstanceGroups API operation for Amazon Elastic MapReduce. -// -// Provides all available details about the instance groups in a cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation ListInstanceGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceGroups -func (c *EMR) ListInstanceGroups(input *ListInstanceGroupsInput) (*ListInstanceGroupsOutput, error) { - req, out := c.ListInstanceGroupsRequest(input) - err := req.Send() - return out, err -} - -// ListInstanceGroupsPages iterates over the pages of a ListInstanceGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstanceGroups 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 ListInstanceGroups operation. -// pageNum := 0 -// err := client.ListInstanceGroupsPages(params, -// func(page *ListInstanceGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListInstanceGroupsPages(input *ListInstanceGroupsInput, fn func(p *ListInstanceGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstanceGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstanceGroupsOutput), lastPage) - }) -} - -const opListInstances = "ListInstances" - -// ListInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListInstancesRequest method. -// req, resp := client.ListInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstances -func (c *EMR) ListInstancesRequest(input *ListInstancesInput) (req *request.Request, output *ListInstancesOutput) { - op := &request.Operation{ - Name: opListInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListInstancesInput{} - } - - output = &ListInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListInstances API operation for Amazon Elastic MapReduce. -// -// Provides information about the cluster instances that Amazon EMR provisions -// on behalf of a user when it creates the cluster. For example, this operation -// indicates when the EC2 instances reach the Ready state, when instances become -// available to Amazon EMR to use for jobs, and the IP addresses for cluster -// instances, etc. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation ListInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstances -func (c *EMR) ListInstances(input *ListInstancesInput) (*ListInstancesOutput, error) { - req, out := c.ListInstancesRequest(input) - err := req.Send() - return out, err -} - -// ListInstancesPages iterates over the pages of a ListInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstances 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 ListInstances operation. -// pageNum := 0 -// err := client.ListInstancesPages(params, -// func(page *ListInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListInstancesPages(input *ListInstancesInput, fn func(p *ListInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstancesOutput), lastPage) - }) -} - -const opListSecurityConfigurations = "ListSecurityConfigurations" - -// ListSecurityConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListSecurityConfigurations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSecurityConfigurations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSecurityConfigurations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSecurityConfigurationsRequest method. -// req, resp := client.ListSecurityConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSecurityConfigurations -func (c *EMR) ListSecurityConfigurationsRequest(input *ListSecurityConfigurationsInput) (req *request.Request, output *ListSecurityConfigurationsOutput) { - op := &request.Operation{ - Name: opListSecurityConfigurations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListSecurityConfigurationsInput{} - } - - output = &ListSecurityConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSecurityConfigurations API operation for Amazon Elastic MapReduce. -// -// Lists all the security configurations visible to this account, providing -// their creation dates and times, and their names. This call returns a maximum -// of 50 clusters per call, but returns a marker to track the paging of the -// cluster list across multiple ListSecurityConfigurations calls. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation ListSecurityConfigurations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSecurityConfigurations -func (c *EMR) ListSecurityConfigurations(input *ListSecurityConfigurationsInput) (*ListSecurityConfigurationsOutput, error) { - req, out := c.ListSecurityConfigurationsRequest(input) - err := req.Send() - return out, err -} - -const opListSteps = "ListSteps" - -// ListStepsRequest generates a "aws/request.Request" representing the -// client's request for the ListSteps operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSteps for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSteps method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListStepsRequest method. -// req, resp := client.ListStepsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSteps -func (c *EMR) ListStepsRequest(input *ListStepsInput) (req *request.Request, output *ListStepsOutput) { - op := &request.Operation{ - Name: opListSteps, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListStepsInput{} - } - - output = &ListStepsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSteps API operation for Amazon Elastic MapReduce. -// -// Provides a list of steps for the cluster in reverse order unless you specify -// stepIds 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 MapReduce's -// API operation ListSteps for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSteps -func (c *EMR) ListSteps(input *ListStepsInput) (*ListStepsOutput, error) { - req, out := c.ListStepsRequest(input) - err := req.Send() - return out, err -} - -// ListStepsPages iterates over the pages of a ListSteps operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSteps 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 ListSteps operation. -// pageNum := 0 -// err := client.ListStepsPages(params, -// func(page *ListStepsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EMR) ListStepsPages(input *ListStepsInput, fn func(p *ListStepsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStepsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStepsOutput), lastPage) - }) -} - -const opModifyInstanceFleet = "ModifyInstanceFleet" - -// ModifyInstanceFleetRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceFleet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyInstanceFleet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyInstanceFleet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyInstanceFleetRequest method. -// req, resp := client.ModifyInstanceFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceFleet -func (c *EMR) ModifyInstanceFleetRequest(input *ModifyInstanceFleetInput) (req *request.Request, output *ModifyInstanceFleetOutput) { - op := &request.Operation{ - Name: opModifyInstanceFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceFleetInput{} - } - - output = &ModifyInstanceFleetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyInstanceFleet API operation for Amazon Elastic MapReduce. -// -// Modifies the target On-Demand and target Spot capacities for the instance -// fleet with the specified InstanceFleetID within the cluster specified using -// ClusterID. The call either succeeds or fails atomically. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation ModifyInstanceFleet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceFleet -func (c *EMR) ModifyInstanceFleet(input *ModifyInstanceFleetInput) (*ModifyInstanceFleetOutput, error) { - req, out := c.ModifyInstanceFleetRequest(input) - err := req.Send() - return out, err -} - -const opModifyInstanceGroups = "ModifyInstanceGroups" - -// ModifyInstanceGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyInstanceGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyInstanceGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyInstanceGroupsRequest method. -// req, resp := client.ModifyInstanceGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceGroups -func (c *EMR) ModifyInstanceGroupsRequest(input *ModifyInstanceGroupsInput) (req *request.Request, output *ModifyInstanceGroupsOutput) { - op := &request.Operation{ - Name: opModifyInstanceGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceGroupsInput{} - } - - output = &ModifyInstanceGroupsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyInstanceGroups API operation for Amazon Elastic MapReduce. -// -// ModifyInstanceGroups modifies the number of nodes and configuration settings -// of an instance group. The input parameters include the new target instance -// count for the group and the instance group ID. The call will either succeed -// or fail atomically. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation ModifyInstanceGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceGroups -func (c *EMR) ModifyInstanceGroups(input *ModifyInstanceGroupsInput) (*ModifyInstanceGroupsOutput, error) { - req, out := c.ModifyInstanceGroupsRequest(input) - err := req.Send() - return out, err -} - -const opPutAutoScalingPolicy = "PutAutoScalingPolicy" - -// PutAutoScalingPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutAutoScalingPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutAutoScalingPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutAutoScalingPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutAutoScalingPolicyRequest method. -// req, resp := client.PutAutoScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/PutAutoScalingPolicy -func (c *EMR) PutAutoScalingPolicyRequest(input *PutAutoScalingPolicyInput) (req *request.Request, output *PutAutoScalingPolicyOutput) { - op := &request.Operation{ - Name: opPutAutoScalingPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutAutoScalingPolicyInput{} - } - - output = &PutAutoScalingPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutAutoScalingPolicy API operation for Amazon Elastic MapReduce. -// -// Creates or updates an automatic scaling policy for a core instance group -// or task instance group in an Amazon EMR cluster. The automatic scaling policy -// defines how an instance group dynamically adds and terminates EC2 instances -// in response to the value of a CloudWatch metric. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation PutAutoScalingPolicy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/PutAutoScalingPolicy -func (c *EMR) PutAutoScalingPolicy(input *PutAutoScalingPolicyInput) (*PutAutoScalingPolicyOutput, error) { - req, out := c.PutAutoScalingPolicyRequest(input) - err := req.Send() - return out, err -} - -const opRemoveAutoScalingPolicy = "RemoveAutoScalingPolicy" - -// RemoveAutoScalingPolicyRequest generates a "aws/request.Request" representing the -// client's request for the RemoveAutoScalingPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveAutoScalingPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveAutoScalingPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveAutoScalingPolicyRequest method. -// req, resp := client.RemoveAutoScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveAutoScalingPolicy -func (c *EMR) RemoveAutoScalingPolicyRequest(input *RemoveAutoScalingPolicyInput) (req *request.Request, output *RemoveAutoScalingPolicyOutput) { - op := &request.Operation{ - Name: opRemoveAutoScalingPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveAutoScalingPolicyInput{} - } - - output = &RemoveAutoScalingPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveAutoScalingPolicy API operation for Amazon Elastic MapReduce. -// -// Removes an automatic scaling policy from a specified instance group within -// an EMR cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation RemoveAutoScalingPolicy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveAutoScalingPolicy -func (c *EMR) RemoveAutoScalingPolicy(input *RemoveAutoScalingPolicyInput) (*RemoveAutoScalingPolicyOutput, error) { - req, out := c.RemoveAutoScalingPolicyRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTags = "RemoveTags" - -// RemoveTagsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsRequest method. -// req, resp := client.RemoveTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveTags -func (c *EMR) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { - op := &request.Operation{ - Name: opRemoveTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsInput{} - } - - output = &RemoveTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTags API operation for Amazon Elastic MapReduce. -// -// Removes tags from an Amazon EMR resource. Tags make it easier to associate -// clusters in various ways, such as grouping clusters to track your Amazon -// EMR resource allocation costs. For more information, see Tagging Amazon EMR -// Resources (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-plan-tags.html). -// -// The following example removes the stack tag with value Prod from a cluster: -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation RemoveTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// This exception occurs when there is an internal failure in the EMR service. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// This exception occurs when there is something wrong with user input. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveTags -func (c *EMR) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { - req, out := c.RemoveTagsRequest(input) - err := req.Send() - return out, err -} - -const opRunJobFlow = "RunJobFlow" - -// RunJobFlowRequest generates a "aws/request.Request" representing the -// client's request for the RunJobFlow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RunJobFlow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RunJobFlow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RunJobFlowRequest method. -// req, resp := client.RunJobFlowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RunJobFlow -func (c *EMR) RunJobFlowRequest(input *RunJobFlowInput) (req *request.Request, output *RunJobFlowOutput) { - op := &request.Operation{ - Name: opRunJobFlow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RunJobFlowInput{} - } - - output = &RunJobFlowOutput{} - req = c.newRequest(op, input, output) - return -} - -// RunJobFlow API operation for Amazon Elastic MapReduce. -// -// RunJobFlow creates and starts running a new cluster (job flow). The cluster -// runs the steps specified. After the steps complete, the cluster stops and -// the HDFS partition is lost. To prevent loss of data, configure the last step -// of the job flow to store results in Amazon S3. If the JobFlowInstancesConfigKeepJobFlowAliveWhenNoSteps -// parameter is set to TRUE, the cluster transitions to the WAITING state rather -// than shutting down after the steps have completed. -// -// For additional protection, you can set the JobFlowInstancesConfigTerminationProtected -// parameter to TRUE to lock the cluster and prevent it from being terminated -// by API call, user intervention, or in the event of a job flow error. -// -// A maximum of 256 steps are allowed in each job flow. -// -// If your cluster is long-running (such as a Hive data warehouse) or complex, -// you may require more than 256 steps to process your data. You can bypass -// the 256-step limitation in various ways, including using the SSH shell to -// connect to the master node and submitting queries directly to the software -// running on the master node, such as Hive and Hadoop. For more information -// on how to do this, see Add More than 256 Steps to a Cluster (http://docs.aws.amazon.com/ElasticMapReduce/latest/Management/Guide/AddMoreThan256Steps.html) -// in the Amazon EMR Management Guide. -// -// For long running clusters, we recommend that you periodically store your -// results. -// -// The instance fleets configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. The RunJobFlow request can contain -// InstanceFleets parameters or InstanceGroups parameters, but not both. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation RunJobFlow for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RunJobFlow -func (c *EMR) RunJobFlow(input *RunJobFlowInput) (*RunJobFlowOutput, error) { - req, out := c.RunJobFlowRequest(input) - err := req.Send() - return out, err -} - -const opSetTerminationProtection = "SetTerminationProtection" - -// SetTerminationProtectionRequest generates a "aws/request.Request" representing the -// client's request for the SetTerminationProtection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetTerminationProtection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetTerminationProtection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetTerminationProtectionRequest method. -// req, resp := client.SetTerminationProtectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetTerminationProtection -func (c *EMR) SetTerminationProtectionRequest(input *SetTerminationProtectionInput) (req *request.Request, output *SetTerminationProtectionOutput) { - op := &request.Operation{ - Name: opSetTerminationProtection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetTerminationProtectionInput{} - } - - output = &SetTerminationProtectionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetTerminationProtection API operation for Amazon Elastic MapReduce. -// -// SetTerminationProtection locks a cluster (job flow) so the EC2 instances -// in the cluster cannot be terminated by user intervention, an API call, or -// in the event of a job-flow error. The cluster still terminates upon successful -// completion of the job flow. Calling SetTerminationProtection on a cluster -// is similar to calling the Amazon EC2 DisableAPITermination API on all EC2 -// instances in a cluster. -// -// SetTerminationProtection is used to prevent accidental termination of a cluster -// and to ensure that in the event of an error, the instances persist so that -// you can recover any data stored in their ephemeral instance storage. -// -// To terminate a cluster that has been locked by setting SetTerminationProtection -// to true, you must first unlock the job flow by a subsequent call to SetTerminationProtection -// in which you set the value to false. -// -// For more information, seeManaging Cluster Termination (http://docs.aws.amazon.com/emr/latest/ManagementGuide/UsingEMR_TerminationProtection.html) -// in the Amazon EMR Management 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 MapReduce's -// API operation SetTerminationProtection for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetTerminationProtection -func (c *EMR) SetTerminationProtection(input *SetTerminationProtectionInput) (*SetTerminationProtectionOutput, error) { - req, out := c.SetTerminationProtectionRequest(input) - err := req.Send() - return out, err -} - -const opSetVisibleToAllUsers = "SetVisibleToAllUsers" - -// SetVisibleToAllUsersRequest generates a "aws/request.Request" representing the -// client's request for the SetVisibleToAllUsers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetVisibleToAllUsers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetVisibleToAllUsers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetVisibleToAllUsersRequest method. -// req, resp := client.SetVisibleToAllUsersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetVisibleToAllUsers -func (c *EMR) SetVisibleToAllUsersRequest(input *SetVisibleToAllUsersInput) (req *request.Request, output *SetVisibleToAllUsersOutput) { - op := &request.Operation{ - Name: opSetVisibleToAllUsers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetVisibleToAllUsersInput{} - } - - output = &SetVisibleToAllUsersOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetVisibleToAllUsers API operation for Amazon Elastic MapReduce. -// -// Sets whether all AWS Identity and Access Management (IAM) users under your -// account can access the specified clusters (job flows). This action works -// on running clusters. You can also set the visibility of a cluster when you -// launch it using the VisibleToAllUsers parameter of RunJobFlow. The SetVisibleToAllUsers -// action can be called only by an IAM user who created the cluster or the AWS -// account that owns the cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 MapReduce's -// API operation SetVisibleToAllUsers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetVisibleToAllUsers -func (c *EMR) SetVisibleToAllUsers(input *SetVisibleToAllUsersInput) (*SetVisibleToAllUsersOutput, error) { - req, out := c.SetVisibleToAllUsersRequest(input) - err := req.Send() - return out, err -} - -const opTerminateJobFlows = "TerminateJobFlows" - -// TerminateJobFlowsRequest generates a "aws/request.Request" representing the -// client's request for the TerminateJobFlows operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TerminateJobFlows for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TerminateJobFlows method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TerminateJobFlowsRequest method. -// req, resp := client.TerminateJobFlowsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/TerminateJobFlows -func (c *EMR) TerminateJobFlowsRequest(input *TerminateJobFlowsInput) (req *request.Request, output *TerminateJobFlowsOutput) { - op := &request.Operation{ - Name: opTerminateJobFlows, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TerminateJobFlowsInput{} - } - - output = &TerminateJobFlowsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// TerminateJobFlows API operation for Amazon Elastic MapReduce. -// -// TerminateJobFlows shuts a list of clusters (job flows) down. When a job flow -// is shut down, any step not yet completed is canceled and the EC2 instances -// on which the cluster is running are stopped. Any log files not already saved -// are uploaded to Amazon S3 if a LogUri was specified when the cluster was -// created. -// -// The maximum number of clusters allowed is 10. The call to TerminateJobFlows -// is asynchronous. Depending on the configuration of the cluster, it may take -// up to 1-5 minutes for the cluster to completely terminate and release allocated -// resources, such as Amazon EC2 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 MapReduce's -// API operation TerminateJobFlows for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// Indicates that an error occurred while processing the request and that the -// request was not completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/TerminateJobFlows -func (c *EMR) TerminateJobFlows(input *TerminateJobFlowsInput) (*TerminateJobFlowsOutput, error) { - req, out := c.TerminateJobFlowsRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleetInput -type AddInstanceFleetInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the cluster. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // Specifies the configuration of the instance fleet. - // - // InstanceFleet is a required field - InstanceFleet *InstanceFleetConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s AddInstanceFleetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddInstanceFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddInstanceFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddInstanceFleetInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - if s.InstanceFleet == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceFleet")) - } - if s.InstanceFleet != nil { - if err := s.InstanceFleet.Validate(); err != nil { - invalidParams.AddNested("InstanceFleet", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *AddInstanceFleetInput) SetClusterId(v string) *AddInstanceFleetInput { - s.ClusterId = &v - return s -} - -// SetInstanceFleet sets the InstanceFleet field's value. -func (s *AddInstanceFleetInput) SetInstanceFleet(v *InstanceFleetConfig) *AddInstanceFleetInput { - s.InstanceFleet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleetOutput -type AddInstanceFleetOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the cluster. - ClusterId *string `type:"string"` - - // The unique identifier of the instance fleet. - InstanceFleetId *string `type:"string"` -} - -// String returns the string representation -func (s AddInstanceFleetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddInstanceFleetOutput) GoString() string { - return s.String() -} - -// SetClusterId sets the ClusterId field's value. -func (s *AddInstanceFleetOutput) SetClusterId(v string) *AddInstanceFleetOutput { - s.ClusterId = &v - return s -} - -// SetInstanceFleetId sets the InstanceFleetId field's value. -func (s *AddInstanceFleetOutput) SetInstanceFleetId(v string) *AddInstanceFleetOutput { - s.InstanceFleetId = &v - return s -} - -// Input to an AddInstanceGroups call. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceGroupsInput -type AddInstanceGroupsInput struct { - _ struct{} `type:"structure"` - - // Instance groups to add. - // - // InstanceGroups is a required field - InstanceGroups []*InstanceGroupConfig `type:"list" required:"true"` - - // Job flow in which to add the instance groups. - // - // JobFlowId is a required field - JobFlowId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AddInstanceGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddInstanceGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddInstanceGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddInstanceGroupsInput"} - if s.InstanceGroups == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceGroups")) - } - if s.JobFlowId == nil { - invalidParams.Add(request.NewErrParamRequired("JobFlowId")) - } - if s.InstanceGroups != nil { - for i, v := range s.InstanceGroups { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InstanceGroups", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceGroups sets the InstanceGroups field's value. -func (s *AddInstanceGroupsInput) SetInstanceGroups(v []*InstanceGroupConfig) *AddInstanceGroupsInput { - s.InstanceGroups = v - return s -} - -// SetJobFlowId sets the JobFlowId field's value. -func (s *AddInstanceGroupsInput) SetJobFlowId(v string) *AddInstanceGroupsInput { - s.JobFlowId = &v - return s -} - -// Output from an AddInstanceGroups call. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceGroupsOutput -type AddInstanceGroupsOutput struct { - _ struct{} `type:"structure"` - - // Instance group IDs of the newly created instance groups. - InstanceGroupIds []*string `type:"list"` - - // The job flow ID in which the instance groups are added. - JobFlowId *string `type:"string"` -} - -// String returns the string representation -func (s AddInstanceGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddInstanceGroupsOutput) GoString() string { - return s.String() -} - -// SetInstanceGroupIds sets the InstanceGroupIds field's value. -func (s *AddInstanceGroupsOutput) SetInstanceGroupIds(v []*string) *AddInstanceGroupsOutput { - s.InstanceGroupIds = v - return s -} - -// SetJobFlowId sets the JobFlowId field's value. -func (s *AddInstanceGroupsOutput) SetJobFlowId(v string) *AddInstanceGroupsOutput { - s.JobFlowId = &v - return s -} - -// The input argument to the AddJobFlowSteps operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddJobFlowStepsInput -type AddJobFlowStepsInput struct { - _ struct{} `type:"structure"` - - // A string that uniquely identifies the job flow. This identifier is returned - // by RunJobFlow and can also be obtained from ListClusters. - // - // JobFlowId is a required field - JobFlowId *string `type:"string" required:"true"` - - // A list of StepConfig to be executed by the job flow. - // - // Steps is a required field - Steps []*StepConfig `type:"list" required:"true"` -} - -// String returns the string representation -func (s AddJobFlowStepsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddJobFlowStepsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddJobFlowStepsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddJobFlowStepsInput"} - if s.JobFlowId == nil { - invalidParams.Add(request.NewErrParamRequired("JobFlowId")) - } - if s.Steps == nil { - invalidParams.Add(request.NewErrParamRequired("Steps")) - } - if s.Steps != nil { - for i, v := range s.Steps { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Steps", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobFlowId sets the JobFlowId field's value. -func (s *AddJobFlowStepsInput) SetJobFlowId(v string) *AddJobFlowStepsInput { - s.JobFlowId = &v - return s -} - -// SetSteps sets the Steps field's value. -func (s *AddJobFlowStepsInput) SetSteps(v []*StepConfig) *AddJobFlowStepsInput { - s.Steps = v - return s -} - -// The output for the AddJobFlowSteps operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddJobFlowStepsOutput -type AddJobFlowStepsOutput struct { - _ struct{} `type:"structure"` - - // The identifiers of the list of steps added to the job flow. - StepIds []*string `type:"list"` -} - -// String returns the string representation -func (s AddJobFlowStepsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddJobFlowStepsOutput) GoString() string { - return s.String() -} - -// SetStepIds sets the StepIds field's value. -func (s *AddJobFlowStepsOutput) SetStepIds(v []*string) *AddJobFlowStepsOutput { - s.StepIds = v - return s -} - -// This input identifies a cluster and a list of tags to attach. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddTagsInput -type AddTagsInput struct { - _ struct{} `type:"structure"` - - // The Amazon EMR resource identifier to which tags will be added. This value - // must be a cluster identifier. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // A list of tags to associate with a cluster and propagate to EC2 instances. - // Tags are user-defined key/value pairs that consist of a required key string - // with a maximum of 128 characters, and an optional value string with a maximum - // of 256 characters. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *AddTagsInput) SetResourceId(v string) *AddTagsInput { - s.ResourceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsInput) SetTags(v []*Tag) *AddTagsInput { - s.Tags = v - return s -} - -// This output indicates the result of adding tags to a resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddTagsOutput -type AddTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsOutput) GoString() string { - return s.String() -} - -// An application is any Amazon or third-party software that you can add to -// the cluster. This structure contains a list of strings that indicates the -// software to use with the cluster and accepts a user argument list. Amazon -// EMR accepts and forwards the argument list to the corresponding installation -// script as bootstrap action argument. For more information, see Using the -// MapR Distribution for Hadoop (http://docs.aws.amazon.com/ElasticMapReduce/latest/ManagementGuide/emr-mapr.html). -// Currently supported values are: -// -// * "mapr-m3" - launch the cluster using MapR M3 Edition. -// -// * "mapr-m5" - launch the cluster using MapR M5 Edition. -// -// * "mapr" with the user arguments specifying "--edition,m3" or "--edition,m5" -// - launch the cluster using MapR M3 or M5 Edition, respectively. -// -// In Amazon EMR releases 4.0 and greater, the only accepted parameter is the -// application name. To pass arguments to applications, you supply a configuration -// for each application. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Application -type Application struct { - _ struct{} `type:"structure"` - - // This option is for advanced users only. This is meta information about third-party - // applications that third-party vendors use for testing purposes. - AdditionalInfo map[string]*string `type:"map"` - - // Arguments for Amazon EMR to pass to the application. - Args []*string `type:"list"` - - // The name of the application. - Name *string `type:"string"` - - // The version of the application. - Version *string `type:"string"` -} - -// String returns the string representation -func (s Application) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Application) GoString() string { - return s.String() -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *Application) SetAdditionalInfo(v map[string]*string) *Application { - s.AdditionalInfo = v - return s -} - -// SetArgs sets the Args field's value. -func (s *Application) SetArgs(v []*string) *Application { - s.Args = v - return s -} - -// SetName sets the Name field's value. -func (s *Application) SetName(v string) *Application { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *Application) SetVersion(v string) *Application { - s.Version = &v - return s -} - -// An automatic scaling policy for a core instance group or task instance group -// in an Amazon EMR cluster. An automatic scaling policy defines how an instance -// group dynamically adds and terminates EC2 instances in response to the value -// of a CloudWatch metric. See PutAutoScalingPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AutoScalingPolicy -type AutoScalingPolicy struct { - _ struct{} `type:"structure"` - - // The upper and lower EC2 instance limits for an automatic scaling policy. - // Automatic scaling activity will not cause an instance group to grow above - // or below these limits. - // - // Constraints is a required field - Constraints *ScalingConstraints `type:"structure" required:"true"` - - // The scale-in and scale-out rules that comprise the automatic scaling policy. - // - // Rules is a required field - Rules []*ScalingRule `type:"list" required:"true"` -} - -// String returns the string representation -func (s AutoScalingPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutoScalingPolicy) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AutoScalingPolicy) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AutoScalingPolicy"} - if s.Constraints == nil { - invalidParams.Add(request.NewErrParamRequired("Constraints")) - } - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Constraints != nil { - if err := s.Constraints.Validate(); err != nil { - invalidParams.AddNested("Constraints", err.(request.ErrInvalidParams)) - } - } - 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 -} - -// SetConstraints sets the Constraints field's value. -func (s *AutoScalingPolicy) SetConstraints(v *ScalingConstraints) *AutoScalingPolicy { - s.Constraints = v - return s -} - -// SetRules sets the Rules field's value. -func (s *AutoScalingPolicy) SetRules(v []*ScalingRule) *AutoScalingPolicy { - s.Rules = v - return s -} - -// An automatic scaling policy for a core instance group or task instance group -// in an Amazon EMR cluster. The automatic scaling policy defines how an instance -// group dynamically adds and terminates EC2 instances in response to the value -// of a CloudWatch metric. See PutAutoScalingPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AutoScalingPolicyDescription -type AutoScalingPolicyDescription struct { - _ struct{} `type:"structure"` - - // The upper and lower EC2 instance limits for an automatic scaling policy. - // Automatic scaling activity will not cause an instance group to grow above - // or below these limits. - Constraints *ScalingConstraints `type:"structure"` - - // The scale-in and scale-out rules that comprise the automatic scaling policy. - Rules []*ScalingRule `type:"list"` - - // The status of an automatic scaling policy. - Status *AutoScalingPolicyStatus `type:"structure"` -} - -// String returns the string representation -func (s AutoScalingPolicyDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutoScalingPolicyDescription) GoString() string { - return s.String() -} - -// SetConstraints sets the Constraints field's value. -func (s *AutoScalingPolicyDescription) SetConstraints(v *ScalingConstraints) *AutoScalingPolicyDescription { - s.Constraints = v - return s -} - -// SetRules sets the Rules field's value. -func (s *AutoScalingPolicyDescription) SetRules(v []*ScalingRule) *AutoScalingPolicyDescription { - s.Rules = v - return s -} - -// SetStatus sets the Status field's value. -func (s *AutoScalingPolicyDescription) SetStatus(v *AutoScalingPolicyStatus) *AutoScalingPolicyDescription { - s.Status = v - return s -} - -// The reason for an AutoScalingPolicyStatus change. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AutoScalingPolicyStateChangeReason -type AutoScalingPolicyStateChangeReason struct { - _ struct{} `type:"structure"` - - // The code indicating the reason for the change in status.USER_REQUEST indicates - // that the scaling policy status was changed by a user. PROVISION_FAILURE indicates - // that the status change was because the policy failed to provision. CLEANUP_FAILURE - // indicates an error. - Code *string `type:"string" enum:"AutoScalingPolicyStateChangeReasonCode"` - - // A friendly, more verbose message that accompanies an automatic scaling policy - // state change. - Message *string `type:"string"` -} - -// String returns the string representation -func (s AutoScalingPolicyStateChangeReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutoScalingPolicyStateChangeReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *AutoScalingPolicyStateChangeReason) SetCode(v string) *AutoScalingPolicyStateChangeReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *AutoScalingPolicyStateChangeReason) SetMessage(v string) *AutoScalingPolicyStateChangeReason { - s.Message = &v - return s -} - -// The status of an automatic scaling policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AutoScalingPolicyStatus -type AutoScalingPolicyStatus struct { - _ struct{} `type:"structure"` - - // Indicates the status of the automatic scaling policy. - State *string `type:"string" enum:"AutoScalingPolicyState"` - - // The reason for a change in status. - StateChangeReason *AutoScalingPolicyStateChangeReason `type:"structure"` -} - -// String returns the string representation -func (s AutoScalingPolicyStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutoScalingPolicyStatus) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *AutoScalingPolicyStatus) SetState(v string) *AutoScalingPolicyStatus { - s.State = &v - return s -} - -// SetStateChangeReason sets the StateChangeReason field's value. -func (s *AutoScalingPolicyStatus) SetStateChangeReason(v *AutoScalingPolicyStateChangeReason) *AutoScalingPolicyStatus { - s.StateChangeReason = v - return s -} - -// Configuration of a bootstrap action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/BootstrapActionConfig -type BootstrapActionConfig struct { - _ struct{} `type:"structure"` - - // The name of the bootstrap action. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The script run by the bootstrap action. - // - // ScriptBootstrapAction is a required field - ScriptBootstrapAction *ScriptBootstrapActionConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s BootstrapActionConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BootstrapActionConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BootstrapActionConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BootstrapActionConfig"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.ScriptBootstrapAction == nil { - invalidParams.Add(request.NewErrParamRequired("ScriptBootstrapAction")) - } - if s.ScriptBootstrapAction != nil { - if err := s.ScriptBootstrapAction.Validate(); err != nil { - invalidParams.AddNested("ScriptBootstrapAction", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *BootstrapActionConfig) SetName(v string) *BootstrapActionConfig { - s.Name = &v - return s -} - -// SetScriptBootstrapAction sets the ScriptBootstrapAction field's value. -func (s *BootstrapActionConfig) SetScriptBootstrapAction(v *ScriptBootstrapActionConfig) *BootstrapActionConfig { - s.ScriptBootstrapAction = v - return s -} - -// Reports the configuration of a bootstrap action in a cluster (job flow). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/BootstrapActionDetail -type BootstrapActionDetail struct { - _ struct{} `type:"structure"` - - // A description of the bootstrap action. - BootstrapActionConfig *BootstrapActionConfig `type:"structure"` -} - -// String returns the string representation -func (s BootstrapActionDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BootstrapActionDetail) GoString() string { - return s.String() -} - -// SetBootstrapActionConfig sets the BootstrapActionConfig field's value. -func (s *BootstrapActionDetail) SetBootstrapActionConfig(v *BootstrapActionConfig) *BootstrapActionDetail { - s.BootstrapActionConfig = v - return s -} - -// Specification of the status of a CancelSteps request. Available only in Amazon -// EMR version 4.8.0 and later, excluding version 5.0.0. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CancelStepsInfo -type CancelStepsInfo struct { - _ struct{} `type:"structure"` - - // The reason for the failure if the CancelSteps request fails. - Reason *string `type:"string"` - - // The status of a CancelSteps Request. The value may be SUBMITTED or FAILED. - Status *string `type:"string" enum:"CancelStepsRequestStatus"` - - // The encrypted StepId of a step. - StepId *string `type:"string"` -} - -// String returns the string representation -func (s CancelStepsInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelStepsInfo) GoString() string { - return s.String() -} - -// SetReason sets the Reason field's value. -func (s *CancelStepsInfo) SetReason(v string) *CancelStepsInfo { - s.Reason = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CancelStepsInfo) SetStatus(v string) *CancelStepsInfo { - s.Status = &v - return s -} - -// SetStepId sets the StepId field's value. -func (s *CancelStepsInfo) SetStepId(v string) *CancelStepsInfo { - s.StepId = &v - return s -} - -// The input argument to the CancelSteps operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CancelStepsInput -type CancelStepsInput struct { - _ struct{} `type:"structure"` - - // The ClusterID for which specified steps will be canceled. Use RunJobFlow - // and ListClusters to get ClusterIDs. - ClusterId *string `type:"string"` - - // The list of StepIDs to cancel. Use ListSteps to get steps and their states - // for the specified cluster. - StepIds []*string `type:"list"` -} - -// String returns the string representation -func (s CancelStepsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelStepsInput) GoString() string { - return s.String() -} - -// SetClusterId sets the ClusterId field's value. -func (s *CancelStepsInput) SetClusterId(v string) *CancelStepsInput { - s.ClusterId = &v - return s -} - -// SetStepIds sets the StepIds field's value. -func (s *CancelStepsInput) SetStepIds(v []*string) *CancelStepsInput { - s.StepIds = v - return s -} - -// The output for the CancelSteps operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CancelStepsOutput -type CancelStepsOutput struct { - _ struct{} `type:"structure"` - - // A list of CancelStepsInfo, which shows the status of specified cancel requests - // for each StepID specified. - CancelStepsInfoList []*CancelStepsInfo `type:"list"` -} - -// String returns the string representation -func (s CancelStepsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelStepsOutput) GoString() string { - return s.String() -} - -// SetCancelStepsInfoList sets the CancelStepsInfoList field's value. -func (s *CancelStepsOutput) SetCancelStepsInfoList(v []*CancelStepsInfo) *CancelStepsOutput { - s.CancelStepsInfoList = v - return s -} - -// The definition of a CloudWatch metric alarm, which determines when an automatic -// scaling activity is triggered. When the defined alarm conditions are satisfied, -// scaling activity begins. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CloudWatchAlarmDefinition -type CloudWatchAlarmDefinition struct { - _ struct{} `type:"structure"` - - // Determines how the metric specified by MetricName is compared to the value - // specified by Threshold. - // - // ComparisonOperator is a required field - ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` - - // A CloudWatch metric dimension. - Dimensions []*MetricDimension `type:"list"` - - // The number of periods, expressed in seconds using Period, during which the - // alarm condition must exist before the alarm triggers automatic scaling activity. - // The default value is 1. - EvaluationPeriods *int64 `type:"integer"` - - // The name of the CloudWatch metric that is watched to determine an alarm condition. - // - // MetricName is a required field - MetricName *string `type:"string" required:"true"` - - // The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce. - Namespace *string `type:"string"` - - // The period, in seconds, over which the statistic is applied. EMR CloudWatch - // metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch - // metric is specified, specify 300. - // - // Period is a required field - Period *int64 `type:"integer" required:"true"` - - // The statistic to apply to the metric associated with the alarm. The default - // is AVERAGE. - Statistic *string `type:"string" enum:"Statistic"` - - // The value against which the specified statistic is compared. - // - // Threshold is a required field - Threshold *float64 `type:"double" required:"true"` - - // The unit of measure associated with the CloudWatch metric being watched. - // The value specified for Unit must correspond to the units specified in the - // CloudWatch metric. - Unit *string `type:"string" enum:"Unit"` -} - -// String returns the string representation -func (s CloudWatchAlarmDefinition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloudWatchAlarmDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloudWatchAlarmDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudWatchAlarmDefinition"} - if s.ComparisonOperator == nil { - invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) - } - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.Period == nil { - invalidParams.Add(request.NewErrParamRequired("Period")) - } - if s.Threshold == nil { - invalidParams.Add(request.NewErrParamRequired("Threshold")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *CloudWatchAlarmDefinition) SetComparisonOperator(v string) *CloudWatchAlarmDefinition { - s.ComparisonOperator = &v - return s -} - -// SetDimensions sets the Dimensions field's value. -func (s *CloudWatchAlarmDefinition) SetDimensions(v []*MetricDimension) *CloudWatchAlarmDefinition { - s.Dimensions = v - return s -} - -// SetEvaluationPeriods sets the EvaluationPeriods field's value. -func (s *CloudWatchAlarmDefinition) SetEvaluationPeriods(v int64) *CloudWatchAlarmDefinition { - s.EvaluationPeriods = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *CloudWatchAlarmDefinition) SetMetricName(v string) *CloudWatchAlarmDefinition { - s.MetricName = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *CloudWatchAlarmDefinition) SetNamespace(v string) *CloudWatchAlarmDefinition { - s.Namespace = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *CloudWatchAlarmDefinition) SetPeriod(v int64) *CloudWatchAlarmDefinition { - s.Period = &v - return s -} - -// SetStatistic sets the Statistic field's value. -func (s *CloudWatchAlarmDefinition) SetStatistic(v string) *CloudWatchAlarmDefinition { - s.Statistic = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *CloudWatchAlarmDefinition) SetThreshold(v float64) *CloudWatchAlarmDefinition { - s.Threshold = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *CloudWatchAlarmDefinition) SetUnit(v string) *CloudWatchAlarmDefinition { - s.Unit = &v - return s -} - -// The detailed description of the cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Cluster -type Cluster struct { - _ struct{} `type:"structure"` - - // The applications installed on this cluster. - Applications []*Application `type:"list"` - - // An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole. - // The IAM role provides permissions that the automatic scaling feature requires - // to launch and terminate EC2 instances in an instance group. - AutoScalingRole *string `type:"string"` - - // Specifies whether the cluster should terminate after completing all steps. - AutoTerminate *bool `type:"boolean"` - - // Amazon EMR releases 4.x or later. - // - // The list of Configurations supplied to the EMR cluster. - Configurations []*Configuration `type:"list"` - - // Provides information about the EC2 instances in a cluster grouped by category. - // For example, key name, subnet ID, IAM instance profile, and so on. - Ec2InstanceAttributes *Ec2InstanceAttributes `type:"structure"` - - // The unique identifier for the cluster. - Id *string `type:"string"` - - // The instance fleet configuration is available only in Amazon EMR versions - // 4.8.0 and later, excluding 5.0.x versions. - // - // The instance group configuration of the cluster. A value of INSTANCE_GROUP - // indicates a uniform instance group configuration. A value of INSTANCE_FLEET - // indicates an instance fleets configuration. - InstanceCollectionType *string `type:"string" enum:"InstanceCollectionType"` - - // The path to the Amazon S3 location where logs for this cluster are stored. - LogUri *string `type:"string"` - - // The public DNS name of the master EC2 instance. - MasterPublicDnsName *string `type:"string"` - - // The name of the cluster. - Name *string `type:"string"` - - // An approximation of the cost of the cluster, represented in m1.small/hours. - // This value is incremented one time for every hour an m1.small instance runs. - // Larger instances are weighted more, so an EC2 instance that is roughly four - // times more expensive would result in the normalized instance hours being - // incremented by four. This result is only an approximation and does not reflect - // the actual billing rate. - NormalizedInstanceHours *int64 `type:"integer"` - - // The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x - // AMIs, use amiVersion instead instead of ReleaseLabel. - ReleaseLabel *string `type:"string"` - - // The AMI version requested for this cluster. - RequestedAmiVersion *string `type:"string"` - - // The AMI version running on this cluster. - RunningAmiVersion *string `type:"string"` - - // The way that individual Amazon EC2 instances terminate when an automatic - // scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR - // indicates that Amazon EMR terminates nodes at the instance-hour boundary, - // regardless of when the request to terminate the instance was submitted. This - // option is only available with Amazon EMR 5.1.0 and later and is the default - // for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates - // that Amazon EMR blacklists and drains tasks from nodes before terminating - // the Amazon EC2 instances, regardless of the instance-hour boundary. With - // either behavior, Amazon EMR removes the least active nodes first and blocks - // instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION - // is available only in Amazon EMR version 4.1.0 and later, and is the default - // for versions of Amazon EMR earlier than 5.1.0. - ScaleDownBehavior *string `type:"string" enum:"ScaleDownBehavior"` - - // The name of the security configuration applied to the cluster. - SecurityConfiguration *string `type:"string"` - - // The IAM role that will be assumed by the Amazon EMR service to access AWS - // resources on your behalf. - ServiceRole *string `type:"string"` - - // The current status details about the cluster. - Status *ClusterStatus `type:"structure"` - - // A list of tags associated with a cluster. - Tags []*Tag `type:"list"` - - // Indicates whether Amazon EMR will lock the cluster to prevent the EC2 instances - // from being terminated by an API call or user intervention, or in the event - // of a cluster error. - TerminationProtected *bool `type:"boolean"` - - // Indicates whether the cluster is visible to all IAM users of the AWS account - // associated with the cluster. If this value is set to true, all IAM users - // of that AWS account can view and manage the cluster if they have the proper - // policy permissions set. If this value is false, only the IAM user that created - // the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers - // action. - VisibleToAllUsers *bool `type:"boolean"` -} - -// String returns the string representation -func (s Cluster) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Cluster) GoString() string { - return s.String() -} - -// SetApplications sets the Applications field's value. -func (s *Cluster) SetApplications(v []*Application) *Cluster { - s.Applications = v - return s -} - -// SetAutoScalingRole sets the AutoScalingRole field's value. -func (s *Cluster) SetAutoScalingRole(v string) *Cluster { - s.AutoScalingRole = &v - return s -} - -// SetAutoTerminate sets the AutoTerminate field's value. -func (s *Cluster) SetAutoTerminate(v bool) *Cluster { - s.AutoTerminate = &v - return s -} - -// SetConfigurations sets the Configurations field's value. -func (s *Cluster) SetConfigurations(v []*Configuration) *Cluster { - s.Configurations = v - return s -} - -// SetEc2InstanceAttributes sets the Ec2InstanceAttributes field's value. -func (s *Cluster) SetEc2InstanceAttributes(v *Ec2InstanceAttributes) *Cluster { - s.Ec2InstanceAttributes = v - return s -} - -// SetId sets the Id field's value. -func (s *Cluster) SetId(v string) *Cluster { - s.Id = &v - return s -} - -// SetInstanceCollectionType sets the InstanceCollectionType field's value. -func (s *Cluster) SetInstanceCollectionType(v string) *Cluster { - s.InstanceCollectionType = &v - return s -} - -// SetLogUri sets the LogUri field's value. -func (s *Cluster) SetLogUri(v string) *Cluster { - s.LogUri = &v - return s -} - -// SetMasterPublicDnsName sets the MasterPublicDnsName field's value. -func (s *Cluster) SetMasterPublicDnsName(v string) *Cluster { - s.MasterPublicDnsName = &v - return s -} - -// SetName sets the Name field's value. -func (s *Cluster) SetName(v string) *Cluster { - s.Name = &v - return s -} - -// SetNormalizedInstanceHours sets the NormalizedInstanceHours field's value. -func (s *Cluster) SetNormalizedInstanceHours(v int64) *Cluster { - s.NormalizedInstanceHours = &v - return s -} - -// SetReleaseLabel sets the ReleaseLabel field's value. -func (s *Cluster) SetReleaseLabel(v string) *Cluster { - s.ReleaseLabel = &v - return s -} - -// SetRequestedAmiVersion sets the RequestedAmiVersion field's value. -func (s *Cluster) SetRequestedAmiVersion(v string) *Cluster { - s.RequestedAmiVersion = &v - return s -} - -// SetRunningAmiVersion sets the RunningAmiVersion field's value. -func (s *Cluster) SetRunningAmiVersion(v string) *Cluster { - s.RunningAmiVersion = &v - return s -} - -// SetScaleDownBehavior sets the ScaleDownBehavior field's value. -func (s *Cluster) SetScaleDownBehavior(v string) *Cluster { - s.ScaleDownBehavior = &v - return s -} - -// SetSecurityConfiguration sets the SecurityConfiguration field's value. -func (s *Cluster) SetSecurityConfiguration(v string) *Cluster { - s.SecurityConfiguration = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *Cluster) SetServiceRole(v string) *Cluster { - s.ServiceRole = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Cluster) SetStatus(v *ClusterStatus) *Cluster { - s.Status = v - return s -} - -// SetTags sets the Tags field's value. -func (s *Cluster) SetTags(v []*Tag) *Cluster { - s.Tags = v - return s -} - -// SetTerminationProtected sets the TerminationProtected field's value. -func (s *Cluster) SetTerminationProtected(v bool) *Cluster { - s.TerminationProtected = &v - return s -} - -// SetVisibleToAllUsers sets the VisibleToAllUsers field's value. -func (s *Cluster) SetVisibleToAllUsers(v bool) *Cluster { - s.VisibleToAllUsers = &v - return s -} - -// The reason that the cluster changed to its current state. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ClusterStateChangeReason -type ClusterStateChangeReason struct { - _ struct{} `type:"structure"` - - // The programmatic code for the state change reason. - Code *string `type:"string" enum:"ClusterStateChangeReasonCode"` - - // The descriptive message for the state change reason. - Message *string `type:"string"` -} - -// String returns the string representation -func (s ClusterStateChangeReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterStateChangeReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ClusterStateChangeReason) SetCode(v string) *ClusterStateChangeReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ClusterStateChangeReason) SetMessage(v string) *ClusterStateChangeReason { - s.Message = &v - return s -} - -// The detailed status of the cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ClusterStatus -type ClusterStatus struct { - _ struct{} `type:"structure"` - - // The current state of the cluster. - State *string `type:"string" enum:"ClusterState"` - - // The reason for the cluster status change. - StateChangeReason *ClusterStateChangeReason `type:"structure"` - - // A timeline that represents the status of a cluster over the lifetime of the - // cluster. - Timeline *ClusterTimeline `type:"structure"` -} - -// String returns the string representation -func (s ClusterStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterStatus) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *ClusterStatus) SetState(v string) *ClusterStatus { - s.State = &v - return s -} - -// SetStateChangeReason sets the StateChangeReason field's value. -func (s *ClusterStatus) SetStateChangeReason(v *ClusterStateChangeReason) *ClusterStatus { - s.StateChangeReason = v - return s -} - -// SetTimeline sets the Timeline field's value. -func (s *ClusterStatus) SetTimeline(v *ClusterTimeline) *ClusterStatus { - s.Timeline = v - return s -} - -// The summary description of the cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ClusterSummary -type ClusterSummary struct { - _ struct{} `type:"structure"` - - // The unique identifier for the cluster. - Id *string `type:"string"` - - // The name of the cluster. - Name *string `type:"string"` - - // An approximation of the cost of the cluster, represented in m1.small/hours. - // This value is incremented one time for every hour an m1.small instance runs. - // Larger instances are weighted more, so an EC2 instance that is roughly four - // times more expensive would result in the normalized instance hours being - // incremented by four. This result is only an approximation and does not reflect - // the actual billing rate. - NormalizedInstanceHours *int64 `type:"integer"` - - // The details about the current status of the cluster. - Status *ClusterStatus `type:"structure"` -} - -// String returns the string representation -func (s ClusterSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterSummary) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *ClusterSummary) SetId(v string) *ClusterSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *ClusterSummary) SetName(v string) *ClusterSummary { - s.Name = &v - return s -} - -// SetNormalizedInstanceHours sets the NormalizedInstanceHours field's value. -func (s *ClusterSummary) SetNormalizedInstanceHours(v int64) *ClusterSummary { - s.NormalizedInstanceHours = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ClusterSummary) SetStatus(v *ClusterStatus) *ClusterSummary { - s.Status = v - return s -} - -// Represents the timeline of the cluster's lifecycle. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ClusterTimeline -type ClusterTimeline struct { - _ struct{} `type:"structure"` - - // The creation date and time of the cluster. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when the cluster was terminated. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when the cluster was ready to execute steps. - ReadyDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s ClusterTimeline) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterTimeline) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *ClusterTimeline) SetCreationDateTime(v time.Time) *ClusterTimeline { - s.CreationDateTime = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *ClusterTimeline) SetEndDateTime(v time.Time) *ClusterTimeline { - s.EndDateTime = &v - return s -} - -// SetReadyDateTime sets the ReadyDateTime field's value. -func (s *ClusterTimeline) SetReadyDateTime(v time.Time) *ClusterTimeline { - s.ReadyDateTime = &v - return s -} - -// An entity describing an executable that runs on a cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Command -type Command struct { - _ struct{} `type:"structure"` - - // Arguments for Amazon EMR to pass to the command for execution. - Args []*string `type:"list"` - - // The name of the command. - Name *string `type:"string"` - - // The Amazon S3 location of the command script. - ScriptPath *string `type:"string"` -} - -// String returns the string representation -func (s Command) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Command) GoString() string { - return s.String() -} - -// SetArgs sets the Args field's value. -func (s *Command) SetArgs(v []*string) *Command { - s.Args = v - return s -} - -// SetName sets the Name field's value. -func (s *Command) SetName(v string) *Command { - s.Name = &v - return s -} - -// SetScriptPath sets the ScriptPath field's value. -func (s *Command) SetScriptPath(v string) *Command { - s.ScriptPath = &v - return s -} - -// Amazon EMR releases 4.x or later. -// -// An optional configuration specification to be used when provisioning cluster -// instances, which can include configurations for applications and software -// bundled with Amazon EMR. A configuration consists of a classification, properties, -// and optional nested configurations. A classification refers to an application-specific -// configuration file. Properties are the settings you want to change in that -// file. For more information, see Configuring Applications (http://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Configuration -type Configuration struct { - _ struct{} `type:"structure"` - - // The classification within a configuration. - Classification *string `type:"string"` - - // A list of additional configurations to apply within a configuration object. - Configurations []*Configuration `type:"list"` - - // A set of properties specified within a configuration classification. - Properties map[string]*string `type:"map"` -} - -// String returns the string representation -func (s Configuration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Configuration) GoString() string { - return s.String() -} - -// SetClassification sets the Classification field's value. -func (s *Configuration) SetClassification(v string) *Configuration { - s.Classification = &v - return s -} - -// SetConfigurations sets the Configurations field's value. -func (s *Configuration) SetConfigurations(v []*Configuration) *Configuration { - s.Configurations = v - return s -} - -// SetProperties sets the Properties field's value. -func (s *Configuration) SetProperties(v map[string]*string) *Configuration { - s.Properties = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CreateSecurityConfigurationInput -type CreateSecurityConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the security configuration. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The security configuration details in JSON format. - // - // SecurityConfiguration is a required field - SecurityConfiguration *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSecurityConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSecurityConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSecurityConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSecurityConfigurationInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.SecurityConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityConfiguration")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateSecurityConfigurationInput) SetName(v string) *CreateSecurityConfigurationInput { - s.Name = &v - return s -} - -// SetSecurityConfiguration sets the SecurityConfiguration field's value. -func (s *CreateSecurityConfigurationInput) SetSecurityConfiguration(v string) *CreateSecurityConfigurationInput { - s.SecurityConfiguration = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CreateSecurityConfigurationOutput -type CreateSecurityConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The date and time the security configuration was created. - // - // CreationDateTime is a required field - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The name of the security configuration. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSecurityConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSecurityConfigurationOutput) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *CreateSecurityConfigurationOutput) SetCreationDateTime(v time.Time) *CreateSecurityConfigurationOutput { - s.CreationDateTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSecurityConfigurationOutput) SetName(v string) *CreateSecurityConfigurationOutput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DeleteSecurityConfigurationInput -type DeleteSecurityConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the security configuration. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSecurityConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSecurityConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSecurityConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSecurityConfigurationInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteSecurityConfigurationInput) SetName(v string) *DeleteSecurityConfigurationInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DeleteSecurityConfigurationOutput -type DeleteSecurityConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSecurityConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSecurityConfigurationOutput) GoString() string { - return s.String() -} - -// This input determines which cluster to describe. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeClusterInput -type DescribeClusterInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster to describe. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClusterInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *DescribeClusterInput) SetClusterId(v string) *DescribeClusterInput { - s.ClusterId = &v - return s -} - -// This output contains the description of the cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeClusterOutput -type DescribeClusterOutput struct { - _ struct{} `type:"structure"` - - // This output contains the details for the requested cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s DescribeClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *DescribeClusterOutput) SetCluster(v *Cluster) *DescribeClusterOutput { - s.Cluster = v - return s -} - -// The input for the DescribeJobFlows operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeJobFlowsInput -type DescribeJobFlowsInput struct { - _ struct{} `type:"structure"` - - // Return only job flows created after this date and time. - CreatedAfter *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Return only job flows created before this date and time. - CreatedBefore *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Return only job flows whose job flow ID is contained in this list. - JobFlowIds []*string `type:"list"` - - // Return only job flows whose state is contained in this list. - JobFlowStates []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeJobFlowsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeJobFlowsInput) GoString() string { - return s.String() -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *DescribeJobFlowsInput) SetCreatedAfter(v time.Time) *DescribeJobFlowsInput { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *DescribeJobFlowsInput) SetCreatedBefore(v time.Time) *DescribeJobFlowsInput { - s.CreatedBefore = &v - return s -} - -// SetJobFlowIds sets the JobFlowIds field's value. -func (s *DescribeJobFlowsInput) SetJobFlowIds(v []*string) *DescribeJobFlowsInput { - s.JobFlowIds = v - return s -} - -// SetJobFlowStates sets the JobFlowStates field's value. -func (s *DescribeJobFlowsInput) SetJobFlowStates(v []*string) *DescribeJobFlowsInput { - s.JobFlowStates = v - return s -} - -// The output for the DescribeJobFlows operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeJobFlowsOutput -type DescribeJobFlowsOutput struct { - _ struct{} `type:"structure"` - - // A list of job flows matching the parameters supplied. - JobFlows []*JobFlowDetail `type:"list"` -} - -// String returns the string representation -func (s DescribeJobFlowsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeJobFlowsOutput) GoString() string { - return s.String() -} - -// SetJobFlows sets the JobFlows field's value. -func (s *DescribeJobFlowsOutput) SetJobFlows(v []*JobFlowDetail) *DescribeJobFlowsOutput { - s.JobFlows = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeSecurityConfigurationInput -type DescribeSecurityConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the security configuration. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeSecurityConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSecurityConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSecurityConfigurationInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DescribeSecurityConfigurationInput) SetName(v string) *DescribeSecurityConfigurationInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeSecurityConfigurationOutput -type DescribeSecurityConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The date and time the security configuration was created - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the security configuration. - Name *string `type:"string"` - - // The security configuration details in JSON format. - SecurityConfiguration *string `type:"string"` -} - -// String returns the string representation -func (s DescribeSecurityConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityConfigurationOutput) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *DescribeSecurityConfigurationOutput) SetCreationDateTime(v time.Time) *DescribeSecurityConfigurationOutput { - s.CreationDateTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeSecurityConfigurationOutput) SetName(v string) *DescribeSecurityConfigurationOutput { - s.Name = &v - return s -} - -// SetSecurityConfiguration sets the SecurityConfiguration field's value. -func (s *DescribeSecurityConfigurationOutput) SetSecurityConfiguration(v string) *DescribeSecurityConfigurationOutput { - s.SecurityConfiguration = &v - return s -} - -// This input determines which step to describe. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeStepInput -type DescribeStepInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster with steps to describe. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // The identifier of the step to describe. - // - // StepId is a required field - StepId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeStepInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStepInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStepInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStepInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - if s.StepId == nil { - invalidParams.Add(request.NewErrParamRequired("StepId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *DescribeStepInput) SetClusterId(v string) *DescribeStepInput { - s.ClusterId = &v - return s -} - -// SetStepId sets the StepId field's value. -func (s *DescribeStepInput) SetStepId(v string) *DescribeStepInput { - s.StepId = &v - return s -} - -// This output contains the description of the cluster step. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeStepOutput -type DescribeStepOutput struct { - _ struct{} `type:"structure"` - - // The step details for the requested step identifier. - Step *Step `type:"structure"` -} - -// String returns the string representation -func (s DescribeStepOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStepOutput) GoString() string { - return s.String() -} - -// SetStep sets the Step field's value. -func (s *DescribeStepOutput) SetStep(v *Step) *DescribeStepOutput { - s.Step = v - return s -} - -// Configuration of requested EBS block device associated with the instance -// group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/EbsBlockDevice -type EbsBlockDevice struct { - _ struct{} `type:"structure"` - - // The device name that is exposed to the instance, such as /dev/sdh. - Device *string `type:"string"` - - // EBS volume specifications such as volume type, IOPS, and size (GiB) that - // will be requested for the EBS volume attached to an EC2 instance in the cluster. - VolumeSpecification *VolumeSpecification `type:"structure"` -} - -// 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() -} - -// SetDevice sets the Device field's value. -func (s *EbsBlockDevice) SetDevice(v string) *EbsBlockDevice { - s.Device = &v - return s -} - -// SetVolumeSpecification sets the VolumeSpecification field's value. -func (s *EbsBlockDevice) SetVolumeSpecification(v *VolumeSpecification) *EbsBlockDevice { - s.VolumeSpecification = v - return s -} - -// Configuration of requested EBS block device associated with the instance -// group with count of volumes that will be associated to every instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/EbsBlockDeviceConfig -type EbsBlockDeviceConfig struct { - _ struct{} `type:"structure"` - - // EBS volume specifications such as volume type, IOPS, and size (GiB) that - // will be requested for the EBS volume attached to an EC2 instance in the cluster. - // - // VolumeSpecification is a required field - VolumeSpecification *VolumeSpecification `type:"structure" required:"true"` - - // Number of EBS volumes with a specific volume configuration that will be associated - // with every instance in the instance group - VolumesPerInstance *int64 `type:"integer"` -} - -// String returns the string representation -func (s EbsBlockDeviceConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsBlockDeviceConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EbsBlockDeviceConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EbsBlockDeviceConfig"} - if s.VolumeSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeSpecification")) - } - if s.VolumeSpecification != nil { - if err := s.VolumeSpecification.Validate(); err != nil { - invalidParams.AddNested("VolumeSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVolumeSpecification sets the VolumeSpecification field's value. -func (s *EbsBlockDeviceConfig) SetVolumeSpecification(v *VolumeSpecification) *EbsBlockDeviceConfig { - s.VolumeSpecification = v - return s -} - -// SetVolumesPerInstance sets the VolumesPerInstance field's value. -func (s *EbsBlockDeviceConfig) SetVolumesPerInstance(v int64) *EbsBlockDeviceConfig { - s.VolumesPerInstance = &v - return s -} - -// The Amazon EBS configuration of a cluster instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/EbsConfiguration -type EbsConfiguration struct { - _ struct{} `type:"structure"` - - // An array of Amazon EBS volume specifications attached to a cluster instance. - EbsBlockDeviceConfigs []*EbsBlockDeviceConfig `type:"list"` - - // Indicates whether an Amazon EBS volume is EBS-optimized. - EbsOptimized *bool `type:"boolean"` -} - -// String returns the string representation -func (s EbsConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EbsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EbsConfiguration"} - if s.EbsBlockDeviceConfigs != nil { - for i, v := range s.EbsBlockDeviceConfigs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "EbsBlockDeviceConfigs", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEbsBlockDeviceConfigs sets the EbsBlockDeviceConfigs field's value. -func (s *EbsConfiguration) SetEbsBlockDeviceConfigs(v []*EbsBlockDeviceConfig) *EbsConfiguration { - s.EbsBlockDeviceConfigs = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *EbsConfiguration) SetEbsOptimized(v bool) *EbsConfiguration { - s.EbsOptimized = &v - return s -} - -// EBS block device that's attached to an EC2 instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/EbsVolume -type EbsVolume struct { - _ struct{} `type:"structure"` - - // The device name that is exposed to the instance, such as /dev/sdh. - Device *string `type:"string"` - - // The volume identifier of the EBS volume. - VolumeId *string `type:"string"` -} - -// String returns the string representation -func (s EbsVolume) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsVolume) GoString() string { - return s.String() -} - -// SetDevice sets the Device field's value. -func (s *EbsVolume) SetDevice(v string) *EbsVolume { - s.Device = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *EbsVolume) SetVolumeId(v string) *EbsVolume { - s.VolumeId = &v - return s -} - -// Provides information about the EC2 instances in a cluster grouped by category. -// For example, key name, subnet ID, IAM instance profile, and so on. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Ec2InstanceAttributes -type Ec2InstanceAttributes struct { - _ struct{} `type:"structure"` - - // A list of additional Amazon EC2 security group IDs for the master node. - AdditionalMasterSecurityGroups []*string `type:"list"` - - // A list of additional Amazon EC2 security group IDs for the slave nodes. - AdditionalSlaveSecurityGroups []*string `type:"list"` - - // The Availability Zone in which the cluster will run. - Ec2AvailabilityZone *string `type:"string"` - - // The name of the Amazon EC2 key pair to use when connecting with SSH into - // the master node as a user named "hadoop". - Ec2KeyName *string `type:"string"` - - // To launch the cluster in Amazon VPC, set this parameter to the identifier - // of the Amazon VPC subnet where you want the cluster to launch. If you do - // not specify this value, the cluster is launched in the normal AWS cloud, - // outside of a VPC. - // - // Amazon VPC currently does not support cluster compute quadruple extra large - // (cc1.4xlarge) instances. Thus, you cannot specify the cc1.4xlarge instance - // type for nodes of a cluster launched in a VPC. - Ec2SubnetId *string `type:"string"` - - // The identifier of the Amazon EC2 security group for the master node. - EmrManagedMasterSecurityGroup *string `type:"string"` - - // The identifier of the Amazon EC2 security group for the slave nodes. - EmrManagedSlaveSecurityGroup *string `type:"string"` - - // The IAM role that was specified when the cluster was launched. The EC2 instances - // of the cluster assume this role. - IamInstanceProfile *string `type:"string"` - - // Applies to clusters configured with the The list of availability zones to - // choose from. The service will choose the availability zone with the best - // mix of available capacity and lowest cost to launch the cluster. If you do - // not specify this value, the cluster is launched in any availability zone - // that the customer account has access to. - RequestedEc2AvailabilityZones []*string `type:"list"` - - // Applies to clusters configured with the instance fleets option. Specifies - // the unique identifier of one or more Amazon EC2 subnets in which to launch - // EC2 cluster instances. Amazon EMR chooses the EC2 subnet with the best performance - // and cost characteristics from among the list of RequestedEc2SubnetIds and - // launches all cluster instances within that subnet. If this value is not specified, - // and the account supports EC2-Classic networks, the cluster launches instances - // in the EC2-Classic network and uses Requested - RequestedEc2SubnetIds []*string `type:"list"` - - // The identifier of the Amazon EC2 security group for the Amazon EMR service - // to access clusters in VPC private subnets. - ServiceAccessSecurityGroup *string `type:"string"` -} - -// String returns the string representation -func (s Ec2InstanceAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Ec2InstanceAttributes) GoString() string { - return s.String() -} - -// SetAdditionalMasterSecurityGroups sets the AdditionalMasterSecurityGroups field's value. -func (s *Ec2InstanceAttributes) SetAdditionalMasterSecurityGroups(v []*string) *Ec2InstanceAttributes { - s.AdditionalMasterSecurityGroups = v - return s -} - -// SetAdditionalSlaveSecurityGroups sets the AdditionalSlaveSecurityGroups field's value. -func (s *Ec2InstanceAttributes) SetAdditionalSlaveSecurityGroups(v []*string) *Ec2InstanceAttributes { - s.AdditionalSlaveSecurityGroups = v - return s -} - -// SetEc2AvailabilityZone sets the Ec2AvailabilityZone field's value. -func (s *Ec2InstanceAttributes) SetEc2AvailabilityZone(v string) *Ec2InstanceAttributes { - s.Ec2AvailabilityZone = &v - return s -} - -// SetEc2KeyName sets the Ec2KeyName field's value. -func (s *Ec2InstanceAttributes) SetEc2KeyName(v string) *Ec2InstanceAttributes { - s.Ec2KeyName = &v - return s -} - -// SetEc2SubnetId sets the Ec2SubnetId field's value. -func (s *Ec2InstanceAttributes) SetEc2SubnetId(v string) *Ec2InstanceAttributes { - s.Ec2SubnetId = &v - return s -} - -// SetEmrManagedMasterSecurityGroup sets the EmrManagedMasterSecurityGroup field's value. -func (s *Ec2InstanceAttributes) SetEmrManagedMasterSecurityGroup(v string) *Ec2InstanceAttributes { - s.EmrManagedMasterSecurityGroup = &v - return s -} - -// SetEmrManagedSlaveSecurityGroup sets the EmrManagedSlaveSecurityGroup field's value. -func (s *Ec2InstanceAttributes) SetEmrManagedSlaveSecurityGroup(v string) *Ec2InstanceAttributes { - s.EmrManagedSlaveSecurityGroup = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *Ec2InstanceAttributes) SetIamInstanceProfile(v string) *Ec2InstanceAttributes { - s.IamInstanceProfile = &v - return s -} - -// SetRequestedEc2AvailabilityZones sets the RequestedEc2AvailabilityZones field's value. -func (s *Ec2InstanceAttributes) SetRequestedEc2AvailabilityZones(v []*string) *Ec2InstanceAttributes { - s.RequestedEc2AvailabilityZones = v - return s -} - -// SetRequestedEc2SubnetIds sets the RequestedEc2SubnetIds field's value. -func (s *Ec2InstanceAttributes) SetRequestedEc2SubnetIds(v []*string) *Ec2InstanceAttributes { - s.RequestedEc2SubnetIds = v - return s -} - -// SetServiceAccessSecurityGroup sets the ServiceAccessSecurityGroup field's value. -func (s *Ec2InstanceAttributes) SetServiceAccessSecurityGroup(v string) *Ec2InstanceAttributes { - s.ServiceAccessSecurityGroup = &v - return s -} - -// The details of the step failure. The service attempts to detect the root -// cause for many common failures. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/FailureDetails -type FailureDetails struct { - _ struct{} `type:"structure"` - - // The path to the log file where the step failure root cause was originally - // recorded. - LogFile *string `type:"string"` - - // The descriptive message including the error the EMR service has identified - // as the cause of step failure. This is text from an error log that describes - // the root cause of the failure. - Message *string `type:"string"` - - // The reason for the step failure. In the case where the service cannot successfully - // determine the root cause of the failure, it returns "Unknown Error" as a - // reason. - Reason *string `type:"string"` -} - -// String returns the string representation -func (s FailureDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FailureDetails) GoString() string { - return s.String() -} - -// SetLogFile sets the LogFile field's value. -func (s *FailureDetails) SetLogFile(v string) *FailureDetails { - s.LogFile = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *FailureDetails) SetMessage(v string) *FailureDetails { - s.Message = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *FailureDetails) SetReason(v string) *FailureDetails { - s.Reason = &v - return s -} - -// A job flow step consisting of a JAR file whose main function will be executed. -// The main function submits a job for Hadoop to execute and waits for the job -// to finish or fail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/HadoopJarStepConfig -type HadoopJarStepConfig struct { - _ struct{} `type:"structure"` - - // A list of command line arguments passed to the JAR file's main function when - // executed. - Args []*string `type:"list"` - - // A path to a JAR file run during the step. - // - // Jar is a required field - Jar *string `type:"string" required:"true"` - - // The name of the main class in the specified Java file. If not specified, - // the JAR file should specify a Main-Class in its manifest file. - MainClass *string `type:"string"` - - // A list of Java properties that are set when the step runs. You can use these - // properties to pass key value pairs to your main function. - Properties []*KeyValue `type:"list"` -} - -// String returns the string representation -func (s HadoopJarStepConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HadoopJarStepConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HadoopJarStepConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HadoopJarStepConfig"} - if s.Jar == nil { - invalidParams.Add(request.NewErrParamRequired("Jar")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArgs sets the Args field's value. -func (s *HadoopJarStepConfig) SetArgs(v []*string) *HadoopJarStepConfig { - s.Args = v - return s -} - -// SetJar sets the Jar field's value. -func (s *HadoopJarStepConfig) SetJar(v string) *HadoopJarStepConfig { - s.Jar = &v - return s -} - -// SetMainClass sets the MainClass field's value. -func (s *HadoopJarStepConfig) SetMainClass(v string) *HadoopJarStepConfig { - s.MainClass = &v - return s -} - -// SetProperties sets the Properties field's value. -func (s *HadoopJarStepConfig) SetProperties(v []*KeyValue) *HadoopJarStepConfig { - s.Properties = v - return s -} - -// A cluster step consisting of a JAR file whose main function will be executed. -// The main function submits a job for Hadoop to execute and waits for the job -// to finish or fail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/HadoopStepConfig -type HadoopStepConfig struct { - _ struct{} `type:"structure"` - - // The list of command line arguments to pass to the JAR file's main function - // for execution. - Args []*string `type:"list"` - - // The path to the JAR file that runs during the step. - Jar *string `type:"string"` - - // The name of the main class in the specified Java file. If not specified, - // the JAR file should specify a main class in its manifest file. - MainClass *string `type:"string"` - - // The list of Java properties that are set when the step runs. You can use - // these properties to pass key value pairs to your main function. - Properties map[string]*string `type:"map"` -} - -// String returns the string representation -func (s HadoopStepConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HadoopStepConfig) GoString() string { - return s.String() -} - -// SetArgs sets the Args field's value. -func (s *HadoopStepConfig) SetArgs(v []*string) *HadoopStepConfig { - s.Args = v - return s -} - -// SetJar sets the Jar field's value. -func (s *HadoopStepConfig) SetJar(v string) *HadoopStepConfig { - s.Jar = &v - return s -} - -// SetMainClass sets the MainClass field's value. -func (s *HadoopStepConfig) SetMainClass(v string) *HadoopStepConfig { - s.MainClass = &v - return s -} - -// SetProperties sets the Properties field's value. -func (s *HadoopStepConfig) SetProperties(v map[string]*string) *HadoopStepConfig { - s.Properties = v - return s -} - -// Represents an EC2 instance provisioned as part of cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Instance -type Instance struct { - _ struct{} `type:"structure"` - - // The list of EBS volumes that are attached to this instance. - EbsVolumes []*EbsVolume `type:"list"` - - // The unique identifier of the instance in Amazon EC2. - Ec2InstanceId *string `type:"string"` - - // The unique identifier for the instance in Amazon EMR. - Id *string `type:"string"` - - // The unique identifier of the instance fleet to which an EC2 instance belongs. - InstanceFleetId *string `type:"string"` - - // The identifier of the instance group to which this instance belongs. - InstanceGroupId *string `type:"string"` - - // The EC2 instance type, for example m3.xlarge. - InstanceType *string `min:"1" type:"string"` - - // The instance purchasing option. Valid values are ON_DEMAND or SPOT. - Market *string `type:"string" enum:"MarketType"` - - // The private DNS name of the instance. - PrivateDnsName *string `type:"string"` - - // The private IP address of the instance. - PrivateIpAddress *string `type:"string"` - - // The public DNS name of the instance. - PublicDnsName *string `type:"string"` - - // The public IP address of the instance. - PublicIpAddress *string `type:"string"` - - // The current status of the instance. - Status *InstanceStatus `type:"structure"` -} - -// 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() -} - -// SetEbsVolumes sets the EbsVolumes field's value. -func (s *Instance) SetEbsVolumes(v []*EbsVolume) *Instance { - s.EbsVolumes = v - return s -} - -// SetEc2InstanceId sets the Ec2InstanceId field's value. -func (s *Instance) SetEc2InstanceId(v string) *Instance { - s.Ec2InstanceId = &v - return s -} - -// SetId sets the Id field's value. -func (s *Instance) SetId(v string) *Instance { - s.Id = &v - return s -} - -// SetInstanceFleetId sets the InstanceFleetId field's value. -func (s *Instance) SetInstanceFleetId(v string) *Instance { - s.InstanceFleetId = &v - return s -} - -// SetInstanceGroupId sets the InstanceGroupId field's value. -func (s *Instance) SetInstanceGroupId(v string) *Instance { - s.InstanceGroupId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *Instance) SetInstanceType(v string) *Instance { - s.InstanceType = &v - return s -} - -// SetMarket sets the Market field's value. -func (s *Instance) SetMarket(v string) *Instance { - s.Market = &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 -} - -// 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 -} - -// SetStatus sets the Status field's value. -func (s *Instance) SetStatus(v *InstanceStatus) *Instance { - s.Status = v - return s -} - -// Describes an instance fleet, which is a group of EC2 instances that host -// a particular node type (master, core, or task) in an Amazon EMR cluster. -// Instance fleets can consist of a mix of instance types and On-Demand and -// Spot instances, which are provisioned to meet a defined target capacity. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceFleet -type InstanceFleet struct { - _ struct{} `type:"structure"` - - // The unique identifier of the instance fleet. - Id *string `type:"string"` - - // The node type that the instance fleet hosts. Valid values are MASTER, CORE, - // or TASK. - InstanceFleetType *string `type:"string" enum:"InstanceFleetType"` - - // The specification for the instance types that comprise an instance fleet. - // Up to five unique instance specifications may be defined for each instance - // fleet. - InstanceTypeSpecifications []*InstanceTypeSpecification `type:"list"` - - // Describes the launch specification for an instance fleet. - LaunchSpecifications *InstanceFleetProvisioningSpecifications `type:"structure"` - - // A friendly name for the instance fleet. - Name *string `type:"string"` - - // The number of On-Demand units that have been provisioned for the instance - // fleet to fulfill TargetOnDemandCapacity. This provisioned capacity might - // be less than or greater than TargetOnDemandCapacity. - ProvisionedOnDemandCapacity *int64 `type:"integer"` - - // The number of Spot units that have been provisioned for this instance fleet - // to fulfill TargetSpotCapacity. This provisioned capacity might be less than - // or greater than TargetSpotCapacity. - ProvisionedSpotCapacity *int64 `type:"integer"` - - // The current status of the instance fleet. - Status *InstanceFleetStatus `type:"structure"` - - // The target capacity of On-Demand units for the instance fleet, which determines - // how many On-Demand instances to provision. When the instance fleet launches, - // Amazon EMR tries to provision On-Demand instances as specified by InstanceTypeConfig. - // Each instance configuration has a specified WeightedCapacity. When an On-Demand - // instance is provisioned, the WeightedCapacity units count toward the target - // capacity. Amazon EMR provisions instances until the target capacity is totally - // fulfilled, even if this results in an overage. For example, if there are - // 2 units remaining to fulfill capacity, and Amazon EMR can only provision - // an instance with a WeightedCapacity of 5 units, the instance is provisioned, - // and the target capacity is exceeded by 3 units. You can use InstanceFleet$ProvisionedOnDemandCapacity - // to determine the Spot capacity units that have been provisioned for the instance - // fleet. - // - // If not specified or set to 0, only Spot instances are provisioned for the - // instance fleet using TargetSpotCapacity. At least one of TargetSpotCapacity - // and TargetOnDemandCapacity should be greater than 0. For a master instance - // fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, - // and its value must be 1. - TargetOnDemandCapacity *int64 `type:"integer"` - - // The target capacity of Spot units for the instance fleet, which determines - // how many Spot instances to provision. When the instance fleet launches, Amazon - // EMR tries to provision Spot instances as specified by InstanceTypeConfig. - // Each instance configuration has a specified WeightedCapacity. When a Spot - // instance is provisioned, the WeightedCapacity units count toward the target - // capacity. Amazon EMR provisions instances until the target capacity is totally - // fulfilled, even if this results in an overage. For example, if there are - // 2 units remaining to fulfill capacity, and Amazon EMR can only provision - // an instance with a WeightedCapacity of 5 units, the instance is provisioned, - // and the target capacity is exceeded by 3 units. You can use InstanceFleet$ProvisionedSpotCapacity - // to determine the Spot capacity units that have been provisioned for the instance - // fleet. - // - // If not specified or set to 0, only On-Demand instances are provisioned for - // the instance fleet. At least one of TargetSpotCapacity and TargetOnDemandCapacity - // should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity - // and TargetOnDemandCapacity can be specified, and its value must be 1. - TargetSpotCapacity *int64 `type:"integer"` -} - -// String returns the string representation -func (s InstanceFleet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceFleet) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *InstanceFleet) SetId(v string) *InstanceFleet { - s.Id = &v - return s -} - -// SetInstanceFleetType sets the InstanceFleetType field's value. -func (s *InstanceFleet) SetInstanceFleetType(v string) *InstanceFleet { - s.InstanceFleetType = &v - return s -} - -// SetInstanceTypeSpecifications sets the InstanceTypeSpecifications field's value. -func (s *InstanceFleet) SetInstanceTypeSpecifications(v []*InstanceTypeSpecification) *InstanceFleet { - s.InstanceTypeSpecifications = v - return s -} - -// SetLaunchSpecifications sets the LaunchSpecifications field's value. -func (s *InstanceFleet) SetLaunchSpecifications(v *InstanceFleetProvisioningSpecifications) *InstanceFleet { - s.LaunchSpecifications = v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceFleet) SetName(v string) *InstanceFleet { - s.Name = &v - return s -} - -// SetProvisionedOnDemandCapacity sets the ProvisionedOnDemandCapacity field's value. -func (s *InstanceFleet) SetProvisionedOnDemandCapacity(v int64) *InstanceFleet { - s.ProvisionedOnDemandCapacity = &v - return s -} - -// SetProvisionedSpotCapacity sets the ProvisionedSpotCapacity field's value. -func (s *InstanceFleet) SetProvisionedSpotCapacity(v int64) *InstanceFleet { - s.ProvisionedSpotCapacity = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceFleet) SetStatus(v *InstanceFleetStatus) *InstanceFleet { - s.Status = v - return s -} - -// SetTargetOnDemandCapacity sets the TargetOnDemandCapacity field's value. -func (s *InstanceFleet) SetTargetOnDemandCapacity(v int64) *InstanceFleet { - s.TargetOnDemandCapacity = &v - return s -} - -// SetTargetSpotCapacity sets the TargetSpotCapacity field's value. -func (s *InstanceFleet) SetTargetSpotCapacity(v int64) *InstanceFleet { - s.TargetSpotCapacity = &v - return s -} - -// The configuration that defines an instance fleet. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceFleetConfig -type InstanceFleetConfig struct { - _ struct{} `type:"structure"` - - // The node type that the instance fleet hosts. Valid values are MASTER,CORE,and - // TASK. - // - // InstanceFleetType is a required field - InstanceFleetType *string `type:"string" required:"true" enum:"InstanceFleetType"` - - // The instance type configurations that define the EC2 instances in the instance - // fleet. - InstanceTypeConfigs []*InstanceTypeConfig `type:"list"` - - // The launch specification for the instance fleet. - LaunchSpecifications *InstanceFleetProvisioningSpecifications `type:"structure"` - - // The friendly name of the instance fleet. - Name *string `type:"string"` - - // The target capacity of On-Demand units for the instance fleet, which determines - // how many On-Demand instances to provision. When the instance fleet launches, - // Amazon EMR tries to provision On-Demand instances as specified by InstanceTypeConfig. - // Each instance configuration has a specified WeightedCapacity. When an On-Demand - // instance is provisioned, the WeightedCapacity units count toward the target - // capacity. Amazon EMR provisions instances until the target capacity is totally - // fulfilled, even if this results in an overage. For example, if there are - // 2 units remaining to fulfill capacity, and Amazon EMR can only provision - // an instance with a WeightedCapacity of 5 units, the instance is provisioned, - // and the target capacity is exceeded by 3 units. - // - // If not specified or set to 0, only Spot instances are provisioned for the - // instance fleet using TargetSpotCapacity. At least one of TargetSpotCapacity - // and TargetOnDemandCapacity should be greater than 0. For a master instance - // fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, - // and its value must be 1. - TargetOnDemandCapacity *int64 `type:"integer"` - - // The target capacity of Spot units for the instance fleet, which determines - // how many Spot instances to provision. When the instance fleet launches, Amazon - // EMR tries to provision Spot instances as specified by InstanceTypeConfig. - // Each instance configuration has a specified WeightedCapacity. When a Spot - // instance is provisioned, the WeightedCapacity units count toward the target - // capacity. Amazon EMR provisions instances until the target capacity is totally - // fulfilled, even if this results in an overage. For example, if there are - // 2 units remaining to fulfill capacity, and Amazon EMR can only provision - // an instance with a WeightedCapacity of 5 units, the instance is provisioned, - // and the target capacity is exceeded by 3 units. - // - // If not specified or set to 0, only On-Demand instances are provisioned for - // the instance fleet. At least one of TargetSpotCapacity and TargetOnDemandCapacity - // should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity - // and TargetOnDemandCapacity can be specified, and its value must be 1. - TargetSpotCapacity *int64 `type:"integer"` -} - -// String returns the string representation -func (s InstanceFleetConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceFleetConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceFleetConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceFleetConfig"} - if s.InstanceFleetType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceFleetType")) - } - if s.InstanceTypeConfigs != nil { - for i, v := range s.InstanceTypeConfigs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InstanceTypeConfigs", i), err.(request.ErrInvalidParams)) - } - } - } - if s.LaunchSpecifications != nil { - if err := s.LaunchSpecifications.Validate(); err != nil { - invalidParams.AddNested("LaunchSpecifications", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceFleetType sets the InstanceFleetType field's value. -func (s *InstanceFleetConfig) SetInstanceFleetType(v string) *InstanceFleetConfig { - s.InstanceFleetType = &v - return s -} - -// SetInstanceTypeConfigs sets the InstanceTypeConfigs field's value. -func (s *InstanceFleetConfig) SetInstanceTypeConfigs(v []*InstanceTypeConfig) *InstanceFleetConfig { - s.InstanceTypeConfigs = v - return s -} - -// SetLaunchSpecifications sets the LaunchSpecifications field's value. -func (s *InstanceFleetConfig) SetLaunchSpecifications(v *InstanceFleetProvisioningSpecifications) *InstanceFleetConfig { - s.LaunchSpecifications = v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceFleetConfig) SetName(v string) *InstanceFleetConfig { - s.Name = &v - return s -} - -// SetTargetOnDemandCapacity sets the TargetOnDemandCapacity field's value. -func (s *InstanceFleetConfig) SetTargetOnDemandCapacity(v int64) *InstanceFleetConfig { - s.TargetOnDemandCapacity = &v - return s -} - -// SetTargetSpotCapacity sets the TargetSpotCapacity field's value. -func (s *InstanceFleetConfig) SetTargetSpotCapacity(v int64) *InstanceFleetConfig { - s.TargetSpotCapacity = &v - return s -} - -// Configuration parameters for an instance fleet modification request. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceFleetModifyConfig -type InstanceFleetModifyConfig struct { - _ struct{} `type:"structure"` - - // A unique identifier for the instance fleet. - // - // InstanceFleetId is a required field - InstanceFleetId *string `type:"string" required:"true"` - - // The target capacity of On-Demand units for the instance fleet. For more information - // see InstanceFleetConfig$TargetOnDemandCapacity. - TargetOnDemandCapacity *int64 `type:"integer"` - - // The target capacity of Spot units for the instance fleet. For more information, - // see InstanceFleetConfig$TargetSpotCapacity. - TargetSpotCapacity *int64 `type:"integer"` -} - -// String returns the string representation -func (s InstanceFleetModifyConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceFleetModifyConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceFleetModifyConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceFleetModifyConfig"} - if s.InstanceFleetId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceFleetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceFleetId sets the InstanceFleetId field's value. -func (s *InstanceFleetModifyConfig) SetInstanceFleetId(v string) *InstanceFleetModifyConfig { - s.InstanceFleetId = &v - return s -} - -// SetTargetOnDemandCapacity sets the TargetOnDemandCapacity field's value. -func (s *InstanceFleetModifyConfig) SetTargetOnDemandCapacity(v int64) *InstanceFleetModifyConfig { - s.TargetOnDemandCapacity = &v - return s -} - -// SetTargetSpotCapacity sets the TargetSpotCapacity field's value. -func (s *InstanceFleetModifyConfig) SetTargetSpotCapacity(v int64) *InstanceFleetModifyConfig { - s.TargetSpotCapacity = &v - return s -} - -// The launch specification for Spot instances in the fleet, which determines -// the defined duration and provisioning timeout behavior. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceFleetProvisioningSpecifications -type InstanceFleetProvisioningSpecifications struct { - _ struct{} `type:"structure"` - - // The launch specification for Spot instances in the fleet, which determines - // the defined duration and provisioning timeout behavior. - // - // SpotSpecification is a required field - SpotSpecification *SpotProvisioningSpecification `type:"structure" required:"true"` -} - -// String returns the string representation -func (s InstanceFleetProvisioningSpecifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceFleetProvisioningSpecifications) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceFleetProvisioningSpecifications) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceFleetProvisioningSpecifications"} - if s.SpotSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("SpotSpecification")) - } - if s.SpotSpecification != nil { - if err := s.SpotSpecification.Validate(); err != nil { - invalidParams.AddNested("SpotSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSpotSpecification sets the SpotSpecification field's value. -func (s *InstanceFleetProvisioningSpecifications) SetSpotSpecification(v *SpotProvisioningSpecification) *InstanceFleetProvisioningSpecifications { - s.SpotSpecification = v - return s -} - -// Provides status change reason details for the instance fleet. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceFleetStateChangeReason -type InstanceFleetStateChangeReason struct { - _ struct{} `type:"structure"` - - // A code corresponding to the reason the state change occurred. - Code *string `type:"string" enum:"InstanceFleetStateChangeReasonCode"` - - // An explanatory message. - Message *string `type:"string"` -} - -// String returns the string representation -func (s InstanceFleetStateChangeReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceFleetStateChangeReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *InstanceFleetStateChangeReason) SetCode(v string) *InstanceFleetStateChangeReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *InstanceFleetStateChangeReason) SetMessage(v string) *InstanceFleetStateChangeReason { - s.Message = &v - return s -} - -// The status of the instance fleet. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceFleetStatus -type InstanceFleetStatus struct { - _ struct{} `type:"structure"` - - // A code representing the instance fleet status. - State *string `type:"string" enum:"InstanceFleetState"` - - // Provides status change reason details for the instance fleet. - StateChangeReason *InstanceFleetStateChangeReason `type:"structure"` - - // Provides historical timestamps for the instance fleet, including the time - // of creation, the time it became ready to run jobs, and the time of termination. - Timeline *InstanceFleetTimeline `type:"structure"` -} - -// String returns the string representation -func (s InstanceFleetStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceFleetStatus) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *InstanceFleetStatus) SetState(v string) *InstanceFleetStatus { - s.State = &v - return s -} - -// SetStateChangeReason sets the StateChangeReason field's value. -func (s *InstanceFleetStatus) SetStateChangeReason(v *InstanceFleetStateChangeReason) *InstanceFleetStatus { - s.StateChangeReason = v - return s -} - -// SetTimeline sets the Timeline field's value. -func (s *InstanceFleetStatus) SetTimeline(v *InstanceFleetTimeline) *InstanceFleetStatus { - s.Timeline = v - return s -} - -// Provides historical timestamps for the instance fleet, including the time -// of creation, the time it became ready to run jobs, and the time of termination. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceFleetTimeline -type InstanceFleetTimeline struct { - _ struct{} `type:"structure"` - - // The time and date the instance fleet was created. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time and date the instance fleet terminated. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time and date the instance fleet was ready to run jobs. - ReadyDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s InstanceFleetTimeline) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceFleetTimeline) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *InstanceFleetTimeline) SetCreationDateTime(v time.Time) *InstanceFleetTimeline { - s.CreationDateTime = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *InstanceFleetTimeline) SetEndDateTime(v time.Time) *InstanceFleetTimeline { - s.EndDateTime = &v - return s -} - -// SetReadyDateTime sets the ReadyDateTime field's value. -func (s *InstanceFleetTimeline) SetReadyDateTime(v time.Time) *InstanceFleetTimeline { - s.ReadyDateTime = &v - return s -} - -// This entity represents an instance group, which is a group of instances that -// have common purpose. For example, CORE instance group is used for HDFS. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceGroup -type InstanceGroup struct { - _ struct{} `type:"structure"` - - // An automatic scaling policy for a core instance group or task instance group - // in an Amazon EMR cluster. The automatic scaling policy defines how an instance - // group dynamically adds and terminates EC2 instances in response to the value - // of a CloudWatch metric. See PutAutoScalingPolicy. - AutoScalingPolicy *AutoScalingPolicyDescription `type:"structure"` - - // The bid price for each EC2 instance in the instance group when launching - // nodes as Spot Instances, expressed in USD. - BidPrice *string `type:"string"` - - // Amazon EMR releases 4.x or later. - // - // The list of configurations supplied for an EMR cluster instance group. You - // can specify a separate configuration for each instance group (master, core, - // and task). - Configurations []*Configuration `type:"list"` - - // The EBS block devices that are mapped to this instance group. - EbsBlockDevices []*EbsBlockDevice `type:"list"` - - // If the instance group is EBS-optimized. An Amazon EBS-optimized instance - // uses an optimized configuration stack and provides additional, dedicated - // capacity for Amazon EBS I/O. - EbsOptimized *bool `type:"boolean"` - - // The identifier of the instance group. - Id *string `type:"string"` - - // The type of the instance group. Valid values are MASTER, CORE or TASK. - InstanceGroupType *string `type:"string" enum:"InstanceGroupType"` - - // The EC2 instance type for all instances in the instance group. - InstanceType *string `min:"1" type:"string"` - - // The marketplace to provision instances for this group. Valid values are ON_DEMAND - // or SPOT. - Market *string `type:"string" enum:"MarketType"` - - // The name of the instance group. - Name *string `type:"string"` - - // The target number of instances for the instance group. - RequestedInstanceCount *int64 `type:"integer"` - - // The number of instances currently running in this instance group. - RunningInstanceCount *int64 `type:"integer"` - - // Policy for customizing shrink operations. - ShrinkPolicy *ShrinkPolicy `type:"structure"` - - // The current status of the instance group. - Status *InstanceGroupStatus `type:"structure"` -} - -// String returns the string representation -func (s InstanceGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceGroup) GoString() string { - return s.String() -} - -// SetAutoScalingPolicy sets the AutoScalingPolicy field's value. -func (s *InstanceGroup) SetAutoScalingPolicy(v *AutoScalingPolicyDescription) *InstanceGroup { - s.AutoScalingPolicy = v - return s -} - -// SetBidPrice sets the BidPrice field's value. -func (s *InstanceGroup) SetBidPrice(v string) *InstanceGroup { - s.BidPrice = &v - return s -} - -// SetConfigurations sets the Configurations field's value. -func (s *InstanceGroup) SetConfigurations(v []*Configuration) *InstanceGroup { - s.Configurations = v - return s -} - -// SetEbsBlockDevices sets the EbsBlockDevices field's value. -func (s *InstanceGroup) SetEbsBlockDevices(v []*EbsBlockDevice) *InstanceGroup { - s.EbsBlockDevices = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *InstanceGroup) SetEbsOptimized(v bool) *InstanceGroup { - s.EbsOptimized = &v - return s -} - -// SetId sets the Id field's value. -func (s *InstanceGroup) SetId(v string) *InstanceGroup { - s.Id = &v - return s -} - -// SetInstanceGroupType sets the InstanceGroupType field's value. -func (s *InstanceGroup) SetInstanceGroupType(v string) *InstanceGroup { - s.InstanceGroupType = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceGroup) SetInstanceType(v string) *InstanceGroup { - s.InstanceType = &v - return s -} - -// SetMarket sets the Market field's value. -func (s *InstanceGroup) SetMarket(v string) *InstanceGroup { - s.Market = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceGroup) SetName(v string) *InstanceGroup { - s.Name = &v - return s -} - -// SetRequestedInstanceCount sets the RequestedInstanceCount field's value. -func (s *InstanceGroup) SetRequestedInstanceCount(v int64) *InstanceGroup { - s.RequestedInstanceCount = &v - return s -} - -// SetRunningInstanceCount sets the RunningInstanceCount field's value. -func (s *InstanceGroup) SetRunningInstanceCount(v int64) *InstanceGroup { - s.RunningInstanceCount = &v - return s -} - -// SetShrinkPolicy sets the ShrinkPolicy field's value. -func (s *InstanceGroup) SetShrinkPolicy(v *ShrinkPolicy) *InstanceGroup { - s.ShrinkPolicy = v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceGroup) SetStatus(v *InstanceGroupStatus) *InstanceGroup { - s.Status = v - return s -} - -// Configuration defining a new instance group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceGroupConfig -type InstanceGroupConfig struct { - _ struct{} `type:"structure"` - - // An automatic scaling policy for a core instance group or task instance group - // in an Amazon EMR cluster. The automatic scaling policy defines how an instance - // group dynamically adds and terminates EC2 instances in response to the value - // of a CloudWatch metric. See PutAutoScalingPolicy. - AutoScalingPolicy *AutoScalingPolicy `type:"structure"` - - // Bid price for each EC2 instance in the instance group when launching nodes - // as Spot Instances, expressed in USD. - BidPrice *string `type:"string"` - - // Amazon EMR releases 4.x or later. - // - // The list of configurations supplied for an EMR cluster instance group. You - // can specify a separate configuration for each instance group (master, core, - // and task). - Configurations []*Configuration `type:"list"` - - // EBS configurations that will be attached to each EC2 instance in the instance - // group. - EbsConfiguration *EbsConfiguration `type:"structure"` - - // Target number of instances for the instance group. - // - // InstanceCount is a required field - InstanceCount *int64 `type:"integer" required:"true"` - - // The role of the instance group in the cluster. - // - // InstanceRole is a required field - InstanceRole *string `type:"string" required:"true" enum:"InstanceRoleType"` - - // The EC2 instance type for all instances in the instance group. - // - // InstanceType is a required field - InstanceType *string `min:"1" type:"string" required:"true"` - - // Market type of the EC2 instances used to create a cluster node. - Market *string `type:"string" enum:"MarketType"` - - // Friendly name given to the instance group. - Name *string `type:"string"` -} - -// String returns the string representation -func (s InstanceGroupConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceGroupConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceGroupConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceGroupConfig"} - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.InstanceRole == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceRole")) - } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } - if s.InstanceType != nil && len(*s.InstanceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceType", 1)) - } - if s.AutoScalingPolicy != nil { - if err := s.AutoScalingPolicy.Validate(); err != nil { - invalidParams.AddNested("AutoScalingPolicy", err.(request.ErrInvalidParams)) - } - } - if s.EbsConfiguration != nil { - if err := s.EbsConfiguration.Validate(); err != nil { - invalidParams.AddNested("EbsConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingPolicy sets the AutoScalingPolicy field's value. -func (s *InstanceGroupConfig) SetAutoScalingPolicy(v *AutoScalingPolicy) *InstanceGroupConfig { - s.AutoScalingPolicy = v - return s -} - -// SetBidPrice sets the BidPrice field's value. -func (s *InstanceGroupConfig) SetBidPrice(v string) *InstanceGroupConfig { - s.BidPrice = &v - return s -} - -// SetConfigurations sets the Configurations field's value. -func (s *InstanceGroupConfig) SetConfigurations(v []*Configuration) *InstanceGroupConfig { - s.Configurations = v - return s -} - -// SetEbsConfiguration sets the EbsConfiguration field's value. -func (s *InstanceGroupConfig) SetEbsConfiguration(v *EbsConfiguration) *InstanceGroupConfig { - s.EbsConfiguration = v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *InstanceGroupConfig) SetInstanceCount(v int64) *InstanceGroupConfig { - s.InstanceCount = &v - return s -} - -// SetInstanceRole sets the InstanceRole field's value. -func (s *InstanceGroupConfig) SetInstanceRole(v string) *InstanceGroupConfig { - s.InstanceRole = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceGroupConfig) SetInstanceType(v string) *InstanceGroupConfig { - s.InstanceType = &v - return s -} - -// SetMarket sets the Market field's value. -func (s *InstanceGroupConfig) SetMarket(v string) *InstanceGroupConfig { - s.Market = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceGroupConfig) SetName(v string) *InstanceGroupConfig { - s.Name = &v - return s -} - -// Detailed information about an instance group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceGroupDetail -type InstanceGroupDetail struct { - _ struct{} `type:"structure"` - - // Bid price for EC2 Instances when launching nodes as Spot Instances, expressed - // in USD. - BidPrice *string `type:"string"` - - // The date/time the instance group was created. - // - // CreationDateTime is a required field - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The date/time the instance group was terminated. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Unique identifier for the instance group. - InstanceGroupId *string `type:"string"` - - // Target number of instances to run in the instance group. - // - // InstanceRequestCount is a required field - InstanceRequestCount *int64 `type:"integer" required:"true"` - - // Instance group role in the cluster - // - // InstanceRole is a required field - InstanceRole *string `type:"string" required:"true" enum:"InstanceRoleType"` - - // Actual count of running instances. - // - // InstanceRunningCount is a required field - InstanceRunningCount *int64 `type:"integer" required:"true"` - - // EC2 instance type. - // - // InstanceType is a required field - InstanceType *string `min:"1" type:"string" required:"true"` - - // Details regarding the state of the instance group. - LastStateChangeReason *string `type:"string"` - - // Market type of the EC2 instances used to create a cluster node. - // - // Market is a required field - Market *string `type:"string" required:"true" enum:"MarketType"` - - // Friendly name for the instance group. - Name *string `type:"string"` - - // The date/time the instance group was available to the cluster. - ReadyDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date/time the instance group was started. - StartDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // State of instance group. The following values are deprecated: STARTING, TERMINATED, - // and FAILED. - // - // State is a required field - State *string `type:"string" required:"true" enum:"InstanceGroupState"` -} - -// String returns the string representation -func (s InstanceGroupDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceGroupDetail) GoString() string { - return s.String() -} - -// SetBidPrice sets the BidPrice field's value. -func (s *InstanceGroupDetail) SetBidPrice(v string) *InstanceGroupDetail { - s.BidPrice = &v - return s -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *InstanceGroupDetail) SetCreationDateTime(v time.Time) *InstanceGroupDetail { - s.CreationDateTime = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *InstanceGroupDetail) SetEndDateTime(v time.Time) *InstanceGroupDetail { - s.EndDateTime = &v - return s -} - -// SetInstanceGroupId sets the InstanceGroupId field's value. -func (s *InstanceGroupDetail) SetInstanceGroupId(v string) *InstanceGroupDetail { - s.InstanceGroupId = &v - return s -} - -// SetInstanceRequestCount sets the InstanceRequestCount field's value. -func (s *InstanceGroupDetail) SetInstanceRequestCount(v int64) *InstanceGroupDetail { - s.InstanceRequestCount = &v - return s -} - -// SetInstanceRole sets the InstanceRole field's value. -func (s *InstanceGroupDetail) SetInstanceRole(v string) *InstanceGroupDetail { - s.InstanceRole = &v - return s -} - -// SetInstanceRunningCount sets the InstanceRunningCount field's value. -func (s *InstanceGroupDetail) SetInstanceRunningCount(v int64) *InstanceGroupDetail { - s.InstanceRunningCount = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceGroupDetail) SetInstanceType(v string) *InstanceGroupDetail { - s.InstanceType = &v - return s -} - -// SetLastStateChangeReason sets the LastStateChangeReason field's value. -func (s *InstanceGroupDetail) SetLastStateChangeReason(v string) *InstanceGroupDetail { - s.LastStateChangeReason = &v - return s -} - -// SetMarket sets the Market field's value. -func (s *InstanceGroupDetail) SetMarket(v string) *InstanceGroupDetail { - s.Market = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceGroupDetail) SetName(v string) *InstanceGroupDetail { - s.Name = &v - return s -} - -// SetReadyDateTime sets the ReadyDateTime field's value. -func (s *InstanceGroupDetail) SetReadyDateTime(v time.Time) *InstanceGroupDetail { - s.ReadyDateTime = &v - return s -} - -// SetStartDateTime sets the StartDateTime field's value. -func (s *InstanceGroupDetail) SetStartDateTime(v time.Time) *InstanceGroupDetail { - s.StartDateTime = &v - return s -} - -// SetState sets the State field's value. -func (s *InstanceGroupDetail) SetState(v string) *InstanceGroupDetail { - s.State = &v - return s -} - -// Modify an instance group size. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceGroupModifyConfig -type InstanceGroupModifyConfig struct { - _ struct{} `type:"structure"` - - // The EC2 InstanceIds to terminate. After you terminate the instances, the - // instance group will not return to its original requested size. - EC2InstanceIdsToTerminate []*string `type:"list"` - - // Target size for the instance group. - InstanceCount *int64 `type:"integer"` - - // Unique ID of the instance group to expand or shrink. - // - // InstanceGroupId is a required field - InstanceGroupId *string `type:"string" required:"true"` - - // Policy for customizing shrink operations. - ShrinkPolicy *ShrinkPolicy `type:"structure"` -} - -// String returns the string representation -func (s InstanceGroupModifyConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceGroupModifyConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceGroupModifyConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceGroupModifyConfig"} - if s.InstanceGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceGroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEC2InstanceIdsToTerminate sets the EC2InstanceIdsToTerminate field's value. -func (s *InstanceGroupModifyConfig) SetEC2InstanceIdsToTerminate(v []*string) *InstanceGroupModifyConfig { - s.EC2InstanceIdsToTerminate = v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *InstanceGroupModifyConfig) SetInstanceCount(v int64) *InstanceGroupModifyConfig { - s.InstanceCount = &v - return s -} - -// SetInstanceGroupId sets the InstanceGroupId field's value. -func (s *InstanceGroupModifyConfig) SetInstanceGroupId(v string) *InstanceGroupModifyConfig { - s.InstanceGroupId = &v - return s -} - -// SetShrinkPolicy sets the ShrinkPolicy field's value. -func (s *InstanceGroupModifyConfig) SetShrinkPolicy(v *ShrinkPolicy) *InstanceGroupModifyConfig { - s.ShrinkPolicy = v - return s -} - -// The status change reason details for the instance group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceGroupStateChangeReason -type InstanceGroupStateChangeReason struct { - _ struct{} `type:"structure"` - - // The programmable code for the state change reason. - Code *string `type:"string" enum:"InstanceGroupStateChangeReasonCode"` - - // The status change reason description. - Message *string `type:"string"` -} - -// String returns the string representation -func (s InstanceGroupStateChangeReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceGroupStateChangeReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *InstanceGroupStateChangeReason) SetCode(v string) *InstanceGroupStateChangeReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *InstanceGroupStateChangeReason) SetMessage(v string) *InstanceGroupStateChangeReason { - s.Message = &v - return s -} - -// The details of the instance group status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceGroupStatus -type InstanceGroupStatus struct { - _ struct{} `type:"structure"` - - // The current state of the instance group. - State *string `type:"string" enum:"InstanceGroupState"` - - // The status change reason details for the instance group. - StateChangeReason *InstanceGroupStateChangeReason `type:"structure"` - - // The timeline of the instance group status over time. - Timeline *InstanceGroupTimeline `type:"structure"` -} - -// String returns the string representation -func (s InstanceGroupStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceGroupStatus) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *InstanceGroupStatus) SetState(v string) *InstanceGroupStatus { - s.State = &v - return s -} - -// SetStateChangeReason sets the StateChangeReason field's value. -func (s *InstanceGroupStatus) SetStateChangeReason(v *InstanceGroupStateChangeReason) *InstanceGroupStatus { - s.StateChangeReason = v - return s -} - -// SetTimeline sets the Timeline field's value. -func (s *InstanceGroupStatus) SetTimeline(v *InstanceGroupTimeline) *InstanceGroupStatus { - s.Timeline = v - return s -} - -// The timeline of the instance group lifecycle. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceGroupTimeline -type InstanceGroupTimeline struct { - _ struct{} `type:"structure"` - - // The creation date and time of the instance group. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when the instance group terminated. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when the instance group became ready to perform tasks. - ReadyDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s InstanceGroupTimeline) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceGroupTimeline) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *InstanceGroupTimeline) SetCreationDateTime(v time.Time) *InstanceGroupTimeline { - s.CreationDateTime = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *InstanceGroupTimeline) SetEndDateTime(v time.Time) *InstanceGroupTimeline { - s.EndDateTime = &v - return s -} - -// SetReadyDateTime sets the ReadyDateTime field's value. -func (s *InstanceGroupTimeline) SetReadyDateTime(v time.Time) *InstanceGroupTimeline { - s.ReadyDateTime = &v - return s -} - -// Custom policy for requesting termination protection or termination of specific -// instances when shrinking an instance group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceResizePolicy -type InstanceResizePolicy struct { - _ struct{} `type:"structure"` - - // Decommissioning timeout override for the specific list of instances to be - // terminated. - InstanceTerminationTimeout *int64 `type:"integer"` - - // Specific list of instances to be protected when shrinking an instance group. - InstancesToProtect []*string `type:"list"` - - // Specific list of instances to be terminated when shrinking an instance group. - InstancesToTerminate []*string `type:"list"` -} - -// String returns the string representation -func (s InstanceResizePolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceResizePolicy) GoString() string { - return s.String() -} - -// SetInstanceTerminationTimeout sets the InstanceTerminationTimeout field's value. -func (s *InstanceResizePolicy) SetInstanceTerminationTimeout(v int64) *InstanceResizePolicy { - s.InstanceTerminationTimeout = &v - return s -} - -// SetInstancesToProtect sets the InstancesToProtect field's value. -func (s *InstanceResizePolicy) SetInstancesToProtect(v []*string) *InstanceResizePolicy { - s.InstancesToProtect = v - return s -} - -// SetInstancesToTerminate sets the InstancesToTerminate field's value. -func (s *InstanceResizePolicy) SetInstancesToTerminate(v []*string) *InstanceResizePolicy { - s.InstancesToTerminate = v - return s -} - -// The details of the status change reason for the instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceStateChangeReason -type InstanceStateChangeReason struct { - _ struct{} `type:"structure"` - - // The programmable code for the state change reason. - Code *string `type:"string" enum:"InstanceStateChangeReasonCode"` - - // The status change reason description. - Message *string `type:"string"` -} - -// String returns the string representation -func (s InstanceStateChangeReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStateChangeReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *InstanceStateChangeReason) SetCode(v string) *InstanceStateChangeReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *InstanceStateChangeReason) SetMessage(v string) *InstanceStateChangeReason { - s.Message = &v - return s -} - -// The instance status details. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceStatus -type InstanceStatus struct { - _ struct{} `type:"structure"` - - // The current state of the instance. - State *string `type:"string" enum:"InstanceState"` - - // The details of the status change reason for the instance. - StateChangeReason *InstanceStateChangeReason `type:"structure"` - - // The timeline of the instance status over time. - Timeline *InstanceTimeline `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() -} - -// SetState sets the State field's value. -func (s *InstanceStatus) SetState(v string) *InstanceStatus { - s.State = &v - return s -} - -// SetStateChangeReason sets the StateChangeReason field's value. -func (s *InstanceStatus) SetStateChangeReason(v *InstanceStateChangeReason) *InstanceStatus { - s.StateChangeReason = v - return s -} - -// SetTimeline sets the Timeline field's value. -func (s *InstanceStatus) SetTimeline(v *InstanceTimeline) *InstanceStatus { - s.Timeline = v - return s -} - -// The timeline of the instance lifecycle. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceTimeline -type InstanceTimeline struct { - _ struct{} `type:"structure"` - - // The creation date and time of the instance. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when the instance was terminated. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when the instance was ready to perform tasks. - ReadyDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s InstanceTimeline) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceTimeline) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *InstanceTimeline) SetCreationDateTime(v time.Time) *InstanceTimeline { - s.CreationDateTime = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *InstanceTimeline) SetEndDateTime(v time.Time) *InstanceTimeline { - s.EndDateTime = &v - return s -} - -// SetReadyDateTime sets the ReadyDateTime field's value. -func (s *InstanceTimeline) SetReadyDateTime(v time.Time) *InstanceTimeline { - s.ReadyDateTime = &v - return s -} - -// An instance type configuration for each instance type in an instance fleet, -// which determines the EC2 instances Amazon EMR attempts to provision to fulfill -// On-Demand and Spot target capacities. There can be a maximum of 5 instance -// type configurations in a fleet. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceTypeConfig -type InstanceTypeConfig struct { - _ struct{} `type:"structure"` - - // The bid price for each EC2 Spot instance type as defined by InstanceType. - // Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice - // is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%. - BidPrice *string `type:"string"` - - // The bid price, as a percentage of On-Demand price, for each EC2 Spot instance - // as defined by InstanceType. Expressed as a number between 0 and 1000 (for - // example, 20 specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice - // is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%. - BidPriceAsPercentageOfOnDemandPrice *float64 `type:"double"` - - // A configuration classification that applies when provisioning cluster instances, - // which can include configurations for applications and software that run on - // the cluster. - Configurations []*Configuration `type:"list"` - - // The configuration of Amazon Elastic Block Storage (EBS) attached to each - // instance as defined by InstanceType. - EbsConfiguration *EbsConfiguration `type:"structure"` - - // An EC2 instance type, such as m3.xlarge. - // - // InstanceType is a required field - InstanceType *string `min:"1" type:"string" required:"true"` - - // The number of units that a provisioned instance of this type provides toward - // fulfilling the target capacities defined in InstanceFleetConfig. This value - // is 1 for a master instance fleet, and must be greater than 0 for core and - // task instance fleets. - WeightedCapacity *int64 `type:"integer"` -} - -// String returns the string representation -func (s InstanceTypeConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceTypeConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceTypeConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceTypeConfig"} - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } - if s.InstanceType != nil && len(*s.InstanceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceType", 1)) - } - if s.EbsConfiguration != nil { - if err := s.EbsConfiguration.Validate(); err != nil { - invalidParams.AddNested("EbsConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBidPrice sets the BidPrice field's value. -func (s *InstanceTypeConfig) SetBidPrice(v string) *InstanceTypeConfig { - s.BidPrice = &v - return s -} - -// SetBidPriceAsPercentageOfOnDemandPrice sets the BidPriceAsPercentageOfOnDemandPrice field's value. -func (s *InstanceTypeConfig) SetBidPriceAsPercentageOfOnDemandPrice(v float64) *InstanceTypeConfig { - s.BidPriceAsPercentageOfOnDemandPrice = &v - return s -} - -// SetConfigurations sets the Configurations field's value. -func (s *InstanceTypeConfig) SetConfigurations(v []*Configuration) *InstanceTypeConfig { - s.Configurations = v - return s -} - -// SetEbsConfiguration sets the EbsConfiguration field's value. -func (s *InstanceTypeConfig) SetEbsConfiguration(v *EbsConfiguration) *InstanceTypeConfig { - s.EbsConfiguration = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceTypeConfig) SetInstanceType(v string) *InstanceTypeConfig { - s.InstanceType = &v - return s -} - -// SetWeightedCapacity sets the WeightedCapacity field's value. -func (s *InstanceTypeConfig) SetWeightedCapacity(v int64) *InstanceTypeConfig { - s.WeightedCapacity = &v - return s -} - -// The configuration specification for each instance type in an instance fleet. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/InstanceTypeSpecification -type InstanceTypeSpecification struct { - _ struct{} `type:"structure"` - - // The bid price for each EC2 Spot instance type as defined by InstanceType. - // Expressed in USD. - BidPrice *string `type:"string"` - - // The bid price, as a percentage of On-Demand price, for each EC2 Spot instance - // as defined by InstanceType. Expressed as a number (for example, 20 specifies - // 20%). - BidPriceAsPercentageOfOnDemandPrice *float64 `type:"double"` - - // A configuration classification that applies when provisioning cluster instances, - // which can include configurations for applications and software bundled with - // Amazon EMR. - Configurations []*Configuration `type:"list"` - - // The configuration of Amazon Elastic Block Storage (EBS) attached to each - // instance as defined by InstanceType. - EbsBlockDevices []*EbsBlockDevice `type:"list"` - - // Evaluates to TRUE when the specified InstanceType is EBS-optimized. - EbsOptimized *bool `type:"boolean"` - - // The EC2 instance type, for example m3.xlarge. - InstanceType *string `min:"1" type:"string"` - - // The number of units that a provisioned instance of this type provides toward - // fulfilling the target capacities defined in InstanceFleetConfig. Capacity - // values represent performance characteristics such as vCPUs, memory, or I/O. - // If not specified, the default value is 1. - WeightedCapacity *int64 `type:"integer"` -} - -// String returns the string representation -func (s InstanceTypeSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceTypeSpecification) GoString() string { - return s.String() -} - -// SetBidPrice sets the BidPrice field's value. -func (s *InstanceTypeSpecification) SetBidPrice(v string) *InstanceTypeSpecification { - s.BidPrice = &v - return s -} - -// SetBidPriceAsPercentageOfOnDemandPrice sets the BidPriceAsPercentageOfOnDemandPrice field's value. -func (s *InstanceTypeSpecification) SetBidPriceAsPercentageOfOnDemandPrice(v float64) *InstanceTypeSpecification { - s.BidPriceAsPercentageOfOnDemandPrice = &v - return s -} - -// SetConfigurations sets the Configurations field's value. -func (s *InstanceTypeSpecification) SetConfigurations(v []*Configuration) *InstanceTypeSpecification { - s.Configurations = v - return s -} - -// SetEbsBlockDevices sets the EbsBlockDevices field's value. -func (s *InstanceTypeSpecification) SetEbsBlockDevices(v []*EbsBlockDevice) *InstanceTypeSpecification { - s.EbsBlockDevices = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *InstanceTypeSpecification) SetEbsOptimized(v bool) *InstanceTypeSpecification { - s.EbsOptimized = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceTypeSpecification) SetInstanceType(v string) *InstanceTypeSpecification { - s.InstanceType = &v - return s -} - -// SetWeightedCapacity sets the WeightedCapacity field's value. -func (s *InstanceTypeSpecification) SetWeightedCapacity(v int64) *InstanceTypeSpecification { - s.WeightedCapacity = &v - return s -} - -// A description of a cluster (job flow). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/JobFlowDetail -type JobFlowDetail struct { - _ struct{} `type:"structure"` - - // The version of the AMI used to initialize Amazon EC2 instances in the job - // flow. For a list of AMI versions currently supported by Amazon EMR, see AMI - // Versions Supported in EMR (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/EnvironmentConfig_AMIVersion.html#ami-versions-supported) - // in the Amazon EMR Developer Guide. - AmiVersion *string `type:"string"` - - // An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole. - // The IAM role provides a way for the automatic scaling feature to get the - // required permissions it needs to launch and terminate EC2 instances in an - // instance group. - AutoScalingRole *string `type:"string"` - - // A list of the bootstrap actions run by the job flow. - BootstrapActions []*BootstrapActionDetail `type:"list"` - - // Describes the execution status of the job flow. - // - // ExecutionStatusDetail is a required field - ExecutionStatusDetail *JobFlowExecutionStatusDetail `type:"structure" required:"true"` - - // Describes the Amazon EC2 instances of the job flow. - // - // Instances is a required field - Instances *JobFlowInstancesDetail `type:"structure" required:"true"` - - // The job flow identifier. - // - // JobFlowId is a required field - JobFlowId *string `type:"string" required:"true"` - - // The IAM role that was specified when the job flow was launched. The EC2 instances - // of the job flow assume this role. - JobFlowRole *string `type:"string"` - - // The location in Amazon S3 where log files for the job are stored. - LogUri *string `type:"string"` - - // The name of the job flow. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The way that individual Amazon EC2 instances terminate when an automatic - // scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR - // indicates that Amazon EMR terminates nodes at the instance-hour boundary, - // regardless of when the request to terminate the instance was submitted. This - // option is only available with Amazon EMR 5.1.0 and later and is the default - // for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates - // that Amazon EMR blacklists and drains tasks from nodes before terminating - // the Amazon EC2 instances, regardless of the instance-hour boundary. With - // either behavior, Amazon EMR removes the least active nodes first and blocks - // instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION - // available only in Amazon EMR version 4.1.0 and later, and is the default - // for versions of Amazon EMR earlier than 5.1.0. - ScaleDownBehavior *string `type:"string" enum:"ScaleDownBehavior"` - - // The IAM role that will be assumed by the Amazon EMR service to access AWS - // resources on your behalf. - ServiceRole *string `type:"string"` - - // A list of steps run by the job flow. - Steps []*StepDetail `type:"list"` - - // A list of strings set by third party software when the job flow is launched. - // If you are not using third party software to manage the job flow this value - // is empty. - SupportedProducts []*string `type:"list"` - - // Specifies whether the cluster is visible to all IAM users of the AWS account - // associated with the cluster. If this value is set to true, all IAM users - // of that AWS account can view and (if they have the proper policy permissions - // set) manage the cluster. If it is set to false, only the IAM user that created - // the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers - // action. - VisibleToAllUsers *bool `type:"boolean"` -} - -// String returns the string representation -func (s JobFlowDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobFlowDetail) GoString() string { - return s.String() -} - -// SetAmiVersion sets the AmiVersion field's value. -func (s *JobFlowDetail) SetAmiVersion(v string) *JobFlowDetail { - s.AmiVersion = &v - return s -} - -// SetAutoScalingRole sets the AutoScalingRole field's value. -func (s *JobFlowDetail) SetAutoScalingRole(v string) *JobFlowDetail { - s.AutoScalingRole = &v - return s -} - -// SetBootstrapActions sets the BootstrapActions field's value. -func (s *JobFlowDetail) SetBootstrapActions(v []*BootstrapActionDetail) *JobFlowDetail { - s.BootstrapActions = v - return s -} - -// SetExecutionStatusDetail sets the ExecutionStatusDetail field's value. -func (s *JobFlowDetail) SetExecutionStatusDetail(v *JobFlowExecutionStatusDetail) *JobFlowDetail { - s.ExecutionStatusDetail = v - return s -} - -// SetInstances sets the Instances field's value. -func (s *JobFlowDetail) SetInstances(v *JobFlowInstancesDetail) *JobFlowDetail { - s.Instances = v - return s -} - -// SetJobFlowId sets the JobFlowId field's value. -func (s *JobFlowDetail) SetJobFlowId(v string) *JobFlowDetail { - s.JobFlowId = &v - return s -} - -// SetJobFlowRole sets the JobFlowRole field's value. -func (s *JobFlowDetail) SetJobFlowRole(v string) *JobFlowDetail { - s.JobFlowRole = &v - return s -} - -// SetLogUri sets the LogUri field's value. -func (s *JobFlowDetail) SetLogUri(v string) *JobFlowDetail { - s.LogUri = &v - return s -} - -// SetName sets the Name field's value. -func (s *JobFlowDetail) SetName(v string) *JobFlowDetail { - s.Name = &v - return s -} - -// SetScaleDownBehavior sets the ScaleDownBehavior field's value. -func (s *JobFlowDetail) SetScaleDownBehavior(v string) *JobFlowDetail { - s.ScaleDownBehavior = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *JobFlowDetail) SetServiceRole(v string) *JobFlowDetail { - s.ServiceRole = &v - return s -} - -// SetSteps sets the Steps field's value. -func (s *JobFlowDetail) SetSteps(v []*StepDetail) *JobFlowDetail { - s.Steps = v - return s -} - -// SetSupportedProducts sets the SupportedProducts field's value. -func (s *JobFlowDetail) SetSupportedProducts(v []*string) *JobFlowDetail { - s.SupportedProducts = v - return s -} - -// SetVisibleToAllUsers sets the VisibleToAllUsers field's value. -func (s *JobFlowDetail) SetVisibleToAllUsers(v bool) *JobFlowDetail { - s.VisibleToAllUsers = &v - return s -} - -// Describes the status of the cluster (job flow). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/JobFlowExecutionStatusDetail -type JobFlowExecutionStatusDetail struct { - _ struct{} `type:"structure"` - - // The creation date and time of the job flow. - // - // CreationDateTime is a required field - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The completion date and time of the job flow. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Description of the job flow last changed state. - LastStateChangeReason *string `type:"string"` - - // The date and time when the job flow was ready to start running bootstrap - // actions. - ReadyDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The start date and time of the job flow. - StartDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The state of the job flow. - // - // State is a required field - State *string `type:"string" required:"true" enum:"JobFlowExecutionState"` -} - -// String returns the string representation -func (s JobFlowExecutionStatusDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobFlowExecutionStatusDetail) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *JobFlowExecutionStatusDetail) SetCreationDateTime(v time.Time) *JobFlowExecutionStatusDetail { - s.CreationDateTime = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *JobFlowExecutionStatusDetail) SetEndDateTime(v time.Time) *JobFlowExecutionStatusDetail { - s.EndDateTime = &v - return s -} - -// SetLastStateChangeReason sets the LastStateChangeReason field's value. -func (s *JobFlowExecutionStatusDetail) SetLastStateChangeReason(v string) *JobFlowExecutionStatusDetail { - s.LastStateChangeReason = &v - return s -} - -// SetReadyDateTime sets the ReadyDateTime field's value. -func (s *JobFlowExecutionStatusDetail) SetReadyDateTime(v time.Time) *JobFlowExecutionStatusDetail { - s.ReadyDateTime = &v - return s -} - -// SetStartDateTime sets the StartDateTime field's value. -func (s *JobFlowExecutionStatusDetail) SetStartDateTime(v time.Time) *JobFlowExecutionStatusDetail { - s.StartDateTime = &v - return s -} - -// SetState sets the State field's value. -func (s *JobFlowExecutionStatusDetail) SetState(v string) *JobFlowExecutionStatusDetail { - s.State = &v - return s -} - -// A description of the Amazon EC2 instance on which the cluster (job flow) -// runs. A valid JobFlowInstancesConfig must contain either InstanceGroups or -// InstanceFleets, which is the recommended configuration. They cannot be used -// together. You may also have MasterInstanceType, SlaveInstanceType, and InstanceCount -// (all three must be present), but we don't recommend this configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/JobFlowInstancesConfig -type JobFlowInstancesConfig struct { - _ struct{} `type:"structure"` - - // A list of additional Amazon EC2 security group IDs for the master node. - AdditionalMasterSecurityGroups []*string `type:"list"` - - // A list of additional Amazon EC2 security group IDs for the slave nodes. - AdditionalSlaveSecurityGroups []*string `type:"list"` - - // The name of the EC2 key pair that can be used to ssh to the master node as - // the user called "hadoop." - Ec2KeyName *string `type:"string"` - - // Applies to clusters that use the uniform instance group configuration. To - // launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set this - // parameter to the identifier of the Amazon VPC subnet where you want the cluster - // to launch. If you do not specify this value, the cluster launches in the - // normal Amazon Web Services cloud, outside of an Amazon VPC, if the account - // launching the cluster supports EC2 Classic networks in the region where the - // cluster launches. - // - // Amazon VPC currently does not support cluster compute quadruple extra large - // (cc1.4xlarge) instances. Thus you cannot specify the cc1.4xlarge instance - // type for clusters launched in an Amazon VPC. - Ec2SubnetId *string `type:"string"` - - // Applies to clusters that use the instance fleet configuration. When multiple - // EC2 subnet IDs are specified, Amazon EMR evaluates them and launches instances - // in the optimal subnet. - // - // The instance fleet configuration is available only in Amazon EMR versions - // 4.8.0 and later, excluding 5.0.x versions. - Ec2SubnetIds []*string `type:"list"` - - // The identifier of the Amazon EC2 security group for the master node. - EmrManagedMasterSecurityGroup *string `type:"string"` - - // The identifier of the Amazon EC2 security group for the slave nodes. - EmrManagedSlaveSecurityGroup *string `type:"string"` - - // The Hadoop version for the cluster. Valid inputs are "0.18" (deprecated), - // "0.20" (deprecated), "0.20.205" (deprecated), "1.0.3", "2.2.0", or "2.4.0". - // If you do not set this value, the default of 0.18 is used, unless the AmiVersion - // parameter is set in the RunJobFlow call, in which case the default version - // of Hadoop for that AMI version is used. - HadoopVersion *string `type:"string"` - - // The number of EC2 instances in the cluster. - InstanceCount *int64 `type:"integer"` - - // The instance fleet configuration is available only in Amazon EMR versions - // 4.8.0 and later, excluding 5.0.x versions. - // - // Describes the EC2 instances and instance configurations for clusters that - // use the instance fleet configuration. - InstanceFleets []*InstanceFleetConfig `type:"list"` - - // Configuration for the instance groups in a cluster. - InstanceGroups []*InstanceGroupConfig `type:"list"` - - // Specifies whether the cluster should remain available after completing all - // steps. - KeepJobFlowAliveWhenNoSteps *bool `type:"boolean"` - - // The EC2 instance type of the master node. - MasterInstanceType *string `min:"1" type:"string"` - - // The Availability Zone in which the cluster runs. - Placement *PlacementType `type:"structure"` - - // The identifier of the Amazon EC2 security group for the Amazon EMR service - // to access clusters in VPC private subnets. - ServiceAccessSecurityGroup *string `type:"string"` - - // The EC2 instance type of the slave nodes. - SlaveInstanceType *string `min:"1" type:"string"` - - // Specifies whether to lock the cluster to prevent the Amazon EC2 instances - // from being terminated by API call, user intervention, or in the event of - // a job-flow error. - TerminationProtected *bool `type:"boolean"` -} - -// String returns the string representation -func (s JobFlowInstancesConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobFlowInstancesConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *JobFlowInstancesConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "JobFlowInstancesConfig"} - if s.MasterInstanceType != nil && len(*s.MasterInstanceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MasterInstanceType", 1)) - } - if s.SlaveInstanceType != nil && len(*s.SlaveInstanceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SlaveInstanceType", 1)) - } - if s.InstanceFleets != nil { - for i, v := range s.InstanceFleets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InstanceFleets", i), err.(request.ErrInvalidParams)) - } - } - } - if s.InstanceGroups != nil { - for i, v := range s.InstanceGroups { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InstanceGroups", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalMasterSecurityGroups sets the AdditionalMasterSecurityGroups field's value. -func (s *JobFlowInstancesConfig) SetAdditionalMasterSecurityGroups(v []*string) *JobFlowInstancesConfig { - s.AdditionalMasterSecurityGroups = v - return s -} - -// SetAdditionalSlaveSecurityGroups sets the AdditionalSlaveSecurityGroups field's value. -func (s *JobFlowInstancesConfig) SetAdditionalSlaveSecurityGroups(v []*string) *JobFlowInstancesConfig { - s.AdditionalSlaveSecurityGroups = v - return s -} - -// SetEc2KeyName sets the Ec2KeyName field's value. -func (s *JobFlowInstancesConfig) SetEc2KeyName(v string) *JobFlowInstancesConfig { - s.Ec2KeyName = &v - return s -} - -// SetEc2SubnetId sets the Ec2SubnetId field's value. -func (s *JobFlowInstancesConfig) SetEc2SubnetId(v string) *JobFlowInstancesConfig { - s.Ec2SubnetId = &v - return s -} - -// SetEc2SubnetIds sets the Ec2SubnetIds field's value. -func (s *JobFlowInstancesConfig) SetEc2SubnetIds(v []*string) *JobFlowInstancesConfig { - s.Ec2SubnetIds = v - return s -} - -// SetEmrManagedMasterSecurityGroup sets the EmrManagedMasterSecurityGroup field's value. -func (s *JobFlowInstancesConfig) SetEmrManagedMasterSecurityGroup(v string) *JobFlowInstancesConfig { - s.EmrManagedMasterSecurityGroup = &v - return s -} - -// SetEmrManagedSlaveSecurityGroup sets the EmrManagedSlaveSecurityGroup field's value. -func (s *JobFlowInstancesConfig) SetEmrManagedSlaveSecurityGroup(v string) *JobFlowInstancesConfig { - s.EmrManagedSlaveSecurityGroup = &v - return s -} - -// SetHadoopVersion sets the HadoopVersion field's value. -func (s *JobFlowInstancesConfig) SetHadoopVersion(v string) *JobFlowInstancesConfig { - s.HadoopVersion = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *JobFlowInstancesConfig) SetInstanceCount(v int64) *JobFlowInstancesConfig { - s.InstanceCount = &v - return s -} - -// SetInstanceFleets sets the InstanceFleets field's value. -func (s *JobFlowInstancesConfig) SetInstanceFleets(v []*InstanceFleetConfig) *JobFlowInstancesConfig { - s.InstanceFleets = v - return s -} - -// SetInstanceGroups sets the InstanceGroups field's value. -func (s *JobFlowInstancesConfig) SetInstanceGroups(v []*InstanceGroupConfig) *JobFlowInstancesConfig { - s.InstanceGroups = v - return s -} - -// SetKeepJobFlowAliveWhenNoSteps sets the KeepJobFlowAliveWhenNoSteps field's value. -func (s *JobFlowInstancesConfig) SetKeepJobFlowAliveWhenNoSteps(v bool) *JobFlowInstancesConfig { - s.KeepJobFlowAliveWhenNoSteps = &v - return s -} - -// SetMasterInstanceType sets the MasterInstanceType field's value. -func (s *JobFlowInstancesConfig) SetMasterInstanceType(v string) *JobFlowInstancesConfig { - s.MasterInstanceType = &v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *JobFlowInstancesConfig) SetPlacement(v *PlacementType) *JobFlowInstancesConfig { - s.Placement = v - return s -} - -// SetServiceAccessSecurityGroup sets the ServiceAccessSecurityGroup field's value. -func (s *JobFlowInstancesConfig) SetServiceAccessSecurityGroup(v string) *JobFlowInstancesConfig { - s.ServiceAccessSecurityGroup = &v - return s -} - -// SetSlaveInstanceType sets the SlaveInstanceType field's value. -func (s *JobFlowInstancesConfig) SetSlaveInstanceType(v string) *JobFlowInstancesConfig { - s.SlaveInstanceType = &v - return s -} - -// SetTerminationProtected sets the TerminationProtected field's value. -func (s *JobFlowInstancesConfig) SetTerminationProtected(v bool) *JobFlowInstancesConfig { - s.TerminationProtected = &v - return s -} - -// Specify the type of Amazon EC2 instances that the cluster (job flow) runs -// on. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/JobFlowInstancesDetail -type JobFlowInstancesDetail struct { - _ struct{} `type:"structure"` - - // The name of an Amazon EC2 key pair that can be used to ssh to the master - // node. - Ec2KeyName *string `type:"string"` - - // For clusters launched within Amazon Virtual Private Cloud, this is the identifier - // of the subnet where the cluster was launched. - Ec2SubnetId *string `type:"string"` - - // The Hadoop version for the cluster. - HadoopVersion *string `type:"string"` - - // The number of Amazon EC2 instances in the cluster. If the value is 1, the - // same instance serves as both the master and slave node. If the value is greater - // than 1, one instance is the master node and all others are slave nodes. - // - // InstanceCount is a required field - InstanceCount *int64 `type:"integer" required:"true"` - - // Details about the instance groups in a cluster. - InstanceGroups []*InstanceGroupDetail `type:"list"` - - // Specifies whether the cluster should remain available after completing all - // steps. - KeepJobFlowAliveWhenNoSteps *bool `type:"boolean"` - - // The Amazon EC2 instance identifier of the master node. - MasterInstanceId *string `type:"string"` - - // The Amazon EC2 master node instance type. - // - // MasterInstanceType is a required field - MasterInstanceType *string `min:"1" type:"string" required:"true"` - - // The DNS name of the master node. - MasterPublicDnsName *string `type:"string"` - - // An approximation of the cost of the cluster, represented in m1.small/hours. - // This value is incremented one time for every hour that an m1.small runs. - // Larger instances are weighted more, so an Amazon EC2 instance that is roughly - // four times more expensive would result in the normalized instance hours being - // incremented by four. This result is only an approximation and does not reflect - // the actual billing rate. - NormalizedInstanceHours *int64 `type:"integer"` - - // The Amazon EC2 Availability Zone for the cluster. - Placement *PlacementType `type:"structure"` - - // The Amazon EC2 slave node instance type. - // - // SlaveInstanceType is a required field - SlaveInstanceType *string `min:"1" type:"string" required:"true"` - - // Specifies whether the Amazon EC2 instances in the cluster are protected from - // termination by API calls, user intervention, or in the event of a job-flow - // error. - TerminationProtected *bool `type:"boolean"` -} - -// String returns the string representation -func (s JobFlowInstancesDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobFlowInstancesDetail) GoString() string { - return s.String() -} - -// SetEc2KeyName sets the Ec2KeyName field's value. -func (s *JobFlowInstancesDetail) SetEc2KeyName(v string) *JobFlowInstancesDetail { - s.Ec2KeyName = &v - return s -} - -// SetEc2SubnetId sets the Ec2SubnetId field's value. -func (s *JobFlowInstancesDetail) SetEc2SubnetId(v string) *JobFlowInstancesDetail { - s.Ec2SubnetId = &v - return s -} - -// SetHadoopVersion sets the HadoopVersion field's value. -func (s *JobFlowInstancesDetail) SetHadoopVersion(v string) *JobFlowInstancesDetail { - s.HadoopVersion = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *JobFlowInstancesDetail) SetInstanceCount(v int64) *JobFlowInstancesDetail { - s.InstanceCount = &v - return s -} - -// SetInstanceGroups sets the InstanceGroups field's value. -func (s *JobFlowInstancesDetail) SetInstanceGroups(v []*InstanceGroupDetail) *JobFlowInstancesDetail { - s.InstanceGroups = v - return s -} - -// SetKeepJobFlowAliveWhenNoSteps sets the KeepJobFlowAliveWhenNoSteps field's value. -func (s *JobFlowInstancesDetail) SetKeepJobFlowAliveWhenNoSteps(v bool) *JobFlowInstancesDetail { - s.KeepJobFlowAliveWhenNoSteps = &v - return s -} - -// SetMasterInstanceId sets the MasterInstanceId field's value. -func (s *JobFlowInstancesDetail) SetMasterInstanceId(v string) *JobFlowInstancesDetail { - s.MasterInstanceId = &v - return s -} - -// SetMasterInstanceType sets the MasterInstanceType field's value. -func (s *JobFlowInstancesDetail) SetMasterInstanceType(v string) *JobFlowInstancesDetail { - s.MasterInstanceType = &v - return s -} - -// SetMasterPublicDnsName sets the MasterPublicDnsName field's value. -func (s *JobFlowInstancesDetail) SetMasterPublicDnsName(v string) *JobFlowInstancesDetail { - s.MasterPublicDnsName = &v - return s -} - -// SetNormalizedInstanceHours sets the NormalizedInstanceHours field's value. -func (s *JobFlowInstancesDetail) SetNormalizedInstanceHours(v int64) *JobFlowInstancesDetail { - s.NormalizedInstanceHours = &v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *JobFlowInstancesDetail) SetPlacement(v *PlacementType) *JobFlowInstancesDetail { - s.Placement = v - return s -} - -// SetSlaveInstanceType sets the SlaveInstanceType field's value. -func (s *JobFlowInstancesDetail) SetSlaveInstanceType(v string) *JobFlowInstancesDetail { - s.SlaveInstanceType = &v - return s -} - -// SetTerminationProtected sets the TerminationProtected field's value. -func (s *JobFlowInstancesDetail) SetTerminationProtected(v bool) *JobFlowInstancesDetail { - s.TerminationProtected = &v - return s -} - -// A key value pair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/KeyValue -type KeyValue struct { - _ struct{} `type:"structure"` - - // The unique identifier of a key value pair. - Key *string `type:"string"` - - // The value part of the identified key. - Value *string `type:"string"` -} - -// String returns the string representation -func (s KeyValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyValue) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *KeyValue) SetKey(v string) *KeyValue { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *KeyValue) SetValue(v string) *KeyValue { - s.Value = &v - return s -} - -// This input determines which bootstrap actions to retrieve. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListBootstrapActionsInput -type ListBootstrapActionsInput struct { - _ struct{} `type:"structure"` - - // The cluster identifier for the bootstrap actions to list. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListBootstrapActionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBootstrapActionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBootstrapActionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBootstrapActionsInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *ListBootstrapActionsInput) SetClusterId(v string) *ListBootstrapActionsInput { - s.ClusterId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListBootstrapActionsInput) SetMarker(v string) *ListBootstrapActionsInput { - s.Marker = &v - return s -} - -// This output contains the bootstrap actions detail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListBootstrapActionsOutput -type ListBootstrapActionsOutput struct { - _ struct{} `type:"structure"` - - // The bootstrap actions associated with the cluster. - BootstrapActions []*Command `type:"list"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListBootstrapActionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBootstrapActionsOutput) GoString() string { - return s.String() -} - -// SetBootstrapActions sets the BootstrapActions field's value. -func (s *ListBootstrapActionsOutput) SetBootstrapActions(v []*Command) *ListBootstrapActionsOutput { - s.BootstrapActions = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListBootstrapActionsOutput) SetMarker(v string) *ListBootstrapActionsOutput { - s.Marker = &v - return s -} - -// This input determines how the ListClusters action filters the list of clusters -// that it returns. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListClustersInput -type ListClustersInput struct { - _ struct{} `type:"structure"` - - // The cluster state filters to apply when listing clusters. - ClusterStates []*string `type:"list"` - - // The creation date and time beginning value filter for listing clusters. - CreatedAfter *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The creation date and time end value filter for listing clusters. - CreatedBefore *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListClustersInput) GoString() string { - return s.String() -} - -// SetClusterStates sets the ClusterStates field's value. -func (s *ListClustersInput) SetClusterStates(v []*string) *ListClustersInput { - s.ClusterStates = v - return s -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ListClustersInput) SetCreatedAfter(v time.Time) *ListClustersInput { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ListClustersInput) SetCreatedBefore(v time.Time) *ListClustersInput { - s.CreatedBefore = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListClustersInput) SetMarker(v string) *ListClustersInput { - s.Marker = &v - return s -} - -// This contains a ClusterSummaryList with the cluster details; for example, -// the cluster IDs, names, and status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListClustersOutput -type ListClustersOutput struct { - _ struct{} `type:"structure"` - - // The list of clusters for the account based on the given filters. - Clusters []*ClusterSummary `type:"list"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListClustersOutput) GoString() string { - return s.String() -} - -// SetClusters sets the Clusters field's value. -func (s *ListClustersOutput) SetClusters(v []*ClusterSummary) *ListClustersOutput { - s.Clusters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListClustersOutput) SetMarker(v string) *ListClustersOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceFleetsInput -type ListInstanceFleetsInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the cluster. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListInstanceFleetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstanceFleetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInstanceFleetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInstanceFleetsInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *ListInstanceFleetsInput) SetClusterId(v string) *ListInstanceFleetsInput { - s.ClusterId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInstanceFleetsInput) SetMarker(v string) *ListInstanceFleetsInput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceFleetsOutput -type ListInstanceFleetsOutput struct { - _ struct{} `type:"structure"` - - // The list of instance fleets for the cluster and given filters. - InstanceFleets []*InstanceFleet `type:"list"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListInstanceFleetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstanceFleetsOutput) GoString() string { - return s.String() -} - -// SetInstanceFleets sets the InstanceFleets field's value. -func (s *ListInstanceFleetsOutput) SetInstanceFleets(v []*InstanceFleet) *ListInstanceFleetsOutput { - s.InstanceFleets = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInstanceFleetsOutput) SetMarker(v string) *ListInstanceFleetsOutput { - s.Marker = &v - return s -} - -// This input determines which instance groups to retrieve. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceGroupsInput -type ListInstanceGroupsInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster for which to list the instance groups. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListInstanceGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstanceGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInstanceGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInstanceGroupsInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *ListInstanceGroupsInput) SetClusterId(v string) *ListInstanceGroupsInput { - s.ClusterId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInstanceGroupsInput) SetMarker(v string) *ListInstanceGroupsInput { - s.Marker = &v - return s -} - -// This input determines which instance groups to retrieve. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceGroupsOutput -type ListInstanceGroupsOutput struct { - _ struct{} `type:"structure"` - - // The list of instance groups for the cluster and given filters. - InstanceGroups []*InstanceGroup `type:"list"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListInstanceGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstanceGroupsOutput) GoString() string { - return s.String() -} - -// SetInstanceGroups sets the InstanceGroups field's value. -func (s *ListInstanceGroupsOutput) SetInstanceGroups(v []*InstanceGroup) *ListInstanceGroupsOutput { - s.InstanceGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInstanceGroupsOutput) SetMarker(v string) *ListInstanceGroupsOutput { - s.Marker = &v - return s -} - -// This input determines which instances to list. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstancesInput -type ListInstancesInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster for which to list the instances. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // The unique identifier of the instance fleet. - InstanceFleetId *string `type:"string"` - - // The node type of the instance fleet. For example MASTER, CORE, or TASK. - InstanceFleetType *string `type:"string" enum:"InstanceFleetType"` - - // The identifier of the instance group for which to list the instances. - InstanceGroupId *string `type:"string"` - - // The type of instance group for which to list the instances. - InstanceGroupTypes []*string `type:"list"` - - // A list of instance states that will filter the instances returned with this - // request. - InstanceStates []*string `type:"list"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInstancesInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *ListInstancesInput) SetClusterId(v string) *ListInstancesInput { - s.ClusterId = &v - return s -} - -// SetInstanceFleetId sets the InstanceFleetId field's value. -func (s *ListInstancesInput) SetInstanceFleetId(v string) *ListInstancesInput { - s.InstanceFleetId = &v - return s -} - -// SetInstanceFleetType sets the InstanceFleetType field's value. -func (s *ListInstancesInput) SetInstanceFleetType(v string) *ListInstancesInput { - s.InstanceFleetType = &v - return s -} - -// SetInstanceGroupId sets the InstanceGroupId field's value. -func (s *ListInstancesInput) SetInstanceGroupId(v string) *ListInstancesInput { - s.InstanceGroupId = &v - return s -} - -// SetInstanceGroupTypes sets the InstanceGroupTypes field's value. -func (s *ListInstancesInput) SetInstanceGroupTypes(v []*string) *ListInstancesInput { - s.InstanceGroupTypes = v - return s -} - -// SetInstanceStates sets the InstanceStates field's value. -func (s *ListInstancesInput) SetInstanceStates(v []*string) *ListInstancesInput { - s.InstanceStates = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInstancesInput) SetMarker(v string) *ListInstancesInput { - s.Marker = &v - return s -} - -// This output contains the list of instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstancesOutput -type ListInstancesOutput struct { - _ struct{} `type:"structure"` - - // The list of instances for the cluster and given filters. - Instances []*Instance `type:"list"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstancesOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *ListInstancesOutput) SetInstances(v []*Instance) *ListInstancesOutput { - s.Instances = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInstancesOutput) SetMarker(v string) *ListInstancesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSecurityConfigurationsInput -type ListSecurityConfigurationsInput struct { - _ struct{} `type:"structure"` - - // The pagination token that indicates the set of results to retrieve. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListSecurityConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSecurityConfigurationsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListSecurityConfigurationsInput) SetMarker(v string) *ListSecurityConfigurationsInput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSecurityConfigurationsOutput -type ListSecurityConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // A pagination token that indicates the next set of results to retrieve. Include - // the marker in the next ListSecurityConfiguration call to retrieve the next - // page of results, if required. - Marker *string `type:"string"` - - // The creation date and time, and name, of each security configuration. - SecurityConfigurations []*SecurityConfigurationSummary `type:"list"` -} - -// String returns the string representation -func (s ListSecurityConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSecurityConfigurationsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListSecurityConfigurationsOutput) SetMarker(v string) *ListSecurityConfigurationsOutput { - s.Marker = &v - return s -} - -// SetSecurityConfigurations sets the SecurityConfigurations field's value. -func (s *ListSecurityConfigurationsOutput) SetSecurityConfigurations(v []*SecurityConfigurationSummary) *ListSecurityConfigurationsOutput { - s.SecurityConfigurations = v - return s -} - -// This input determines which steps to list. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListStepsInput -type ListStepsInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster for which to list the steps. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` - - // The filter to limit the step list based on the identifier of the steps. - StepIds []*string `type:"list"` - - // The filter to limit the step list based on certain states. - StepStates []*string `type:"list"` -} - -// String returns the string representation -func (s ListStepsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStepsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListStepsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStepsInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *ListStepsInput) SetClusterId(v string) *ListStepsInput { - s.ClusterId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListStepsInput) SetMarker(v string) *ListStepsInput { - s.Marker = &v - return s -} - -// SetStepIds sets the StepIds field's value. -func (s *ListStepsInput) SetStepIds(v []*string) *ListStepsInput { - s.StepIds = v - return s -} - -// SetStepStates sets the StepStates field's value. -func (s *ListStepsInput) SetStepStates(v []*string) *ListStepsInput { - s.StepStates = v - return s -} - -// This output contains the list of steps returned in reverse order. This means -// that the last step is the first element in the list. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListStepsOutput -type ListStepsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token that indicates the next set of results to retrieve. - Marker *string `type:"string"` - - // The filtered list of steps for the cluster. - Steps []*StepSummary `type:"list"` -} - -// String returns the string representation -func (s ListStepsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStepsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListStepsOutput) SetMarker(v string) *ListStepsOutput { - s.Marker = &v - return s -} - -// SetSteps sets the Steps field's value. -func (s *ListStepsOutput) SetSteps(v []*StepSummary) *ListStepsOutput { - s.Steps = v - return s -} - -// A CloudWatch dimension, which is specified using a Key (known as a Name in -// CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose -// Key is JobFlowID and Value is a variable representing the cluster ID, which -// is ${emr.clusterId}. This enables the rule to bootstrap when the cluster -// ID becomes available. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/MetricDimension -type MetricDimension struct { - _ struct{} `type:"structure"` - - // The dimension name. - Key *string `type:"string"` - - // The dimension value. - Value *string `type:"string"` -} - -// String returns the string representation -func (s MetricDimension) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricDimension) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *MetricDimension) SetKey(v string) *MetricDimension { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *MetricDimension) SetValue(v string) *MetricDimension { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceFleetInput -type ModifyInstanceFleetInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the cluster. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // The unique identifier of the instance fleet. - // - // InstanceFleet is a required field - InstanceFleet *InstanceFleetModifyConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ModifyInstanceFleetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyInstanceFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceFleetInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - if s.InstanceFleet == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceFleet")) - } - if s.InstanceFleet != nil { - if err := s.InstanceFleet.Validate(); err != nil { - invalidParams.AddNested("InstanceFleet", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *ModifyInstanceFleetInput) SetClusterId(v string) *ModifyInstanceFleetInput { - s.ClusterId = &v - return s -} - -// SetInstanceFleet sets the InstanceFleet field's value. -func (s *ModifyInstanceFleetInput) SetInstanceFleet(v *InstanceFleetModifyConfig) *ModifyInstanceFleetInput { - s.InstanceFleet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceFleetOutput -type ModifyInstanceFleetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyInstanceFleetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceFleetOutput) GoString() string { - return s.String() -} - -// Change the size of some instance groups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceGroupsInput -type ModifyInstanceGroupsInput struct { - _ struct{} `type:"structure"` - - // The ID of the cluster to which the instance group belongs. - ClusterId *string `type:"string"` - - // Instance groups to change. - InstanceGroups []*InstanceGroupModifyConfig `type:"list"` -} - -// String returns the string representation -func (s ModifyInstanceGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyInstanceGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceGroupsInput"} - if s.InstanceGroups != nil { - for i, v := range s.InstanceGroups { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InstanceGroups", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *ModifyInstanceGroupsInput) SetClusterId(v string) *ModifyInstanceGroupsInput { - s.ClusterId = &v - return s -} - -// SetInstanceGroups sets the InstanceGroups field's value. -func (s *ModifyInstanceGroupsInput) SetInstanceGroups(v []*InstanceGroupModifyConfig) *ModifyInstanceGroupsInput { - s.InstanceGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceGroupsOutput -type ModifyInstanceGroupsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyInstanceGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceGroupsOutput) GoString() string { - return s.String() -} - -// The Amazon EC2 Availability Zone configuration of the cluster (job flow). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/PlacementType -type PlacementType struct { - _ struct{} `type:"structure"` - - // The Amazon EC2 Availability Zone for the cluster. AvailabilityZone is used - // for uniform instance groups, while AvailabilityZones (plural) is used for - // instance fleets. - AvailabilityZone *string `type:"string"` - - // When multiple Availability Zones are specified, Amazon EMR evaluates them - // and launches instances in the optimal Availability Zone. AvailabilityZones - // is used for instance fleets, while AvailabilityZone (singular) is used for - // uniform instance groups. - // - // The instance fleet configuration is available only in Amazon EMR versions - // 4.8.0 and later, excluding 5.0.x versions. - AvailabilityZones []*string `type:"list"` -} - -// String returns the string representation -func (s PlacementType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlacementType) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *PlacementType) SetAvailabilityZone(v string) *PlacementType { - s.AvailabilityZone = &v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *PlacementType) SetAvailabilityZones(v []*string) *PlacementType { - s.AvailabilityZones = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/PutAutoScalingPolicyInput -type PutAutoScalingPolicyInput struct { - _ struct{} `type:"structure"` - - // Specifies the definition of the automatic scaling policy. - // - // AutoScalingPolicy is a required field - AutoScalingPolicy *AutoScalingPolicy `type:"structure" required:"true"` - - // Specifies the ID of a cluster. The instance group to which the automatic - // scaling policy is applied is within this cluster. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // Specifies the ID of the instance group to which the automatic scaling policy - // is applied. - // - // InstanceGroupId is a required field - InstanceGroupId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PutAutoScalingPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutAutoScalingPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutAutoScalingPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutAutoScalingPolicyInput"} - if s.AutoScalingPolicy == nil { - invalidParams.Add(request.NewErrParamRequired("AutoScalingPolicy")) - } - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - if s.InstanceGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceGroupId")) - } - if s.AutoScalingPolicy != nil { - if err := s.AutoScalingPolicy.Validate(); err != nil { - invalidParams.AddNested("AutoScalingPolicy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingPolicy sets the AutoScalingPolicy field's value. -func (s *PutAutoScalingPolicyInput) SetAutoScalingPolicy(v *AutoScalingPolicy) *PutAutoScalingPolicyInput { - s.AutoScalingPolicy = v - return s -} - -// SetClusterId sets the ClusterId field's value. -func (s *PutAutoScalingPolicyInput) SetClusterId(v string) *PutAutoScalingPolicyInput { - s.ClusterId = &v - return s -} - -// SetInstanceGroupId sets the InstanceGroupId field's value. -func (s *PutAutoScalingPolicyInput) SetInstanceGroupId(v string) *PutAutoScalingPolicyInput { - s.InstanceGroupId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/PutAutoScalingPolicyOutput -type PutAutoScalingPolicyOutput struct { - _ struct{} `type:"structure"` - - // The automatic scaling policy definition. - AutoScalingPolicy *AutoScalingPolicyDescription `type:"structure"` - - // Specifies the ID of a cluster. The instance group to which the automatic - // scaling policy is applied is within this cluster. - ClusterId *string `type:"string"` - - // Specifies the ID of the instance group to which the scaling policy is applied. - InstanceGroupId *string `type:"string"` -} - -// String returns the string representation -func (s PutAutoScalingPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutAutoScalingPolicyOutput) GoString() string { - return s.String() -} - -// SetAutoScalingPolicy sets the AutoScalingPolicy field's value. -func (s *PutAutoScalingPolicyOutput) SetAutoScalingPolicy(v *AutoScalingPolicyDescription) *PutAutoScalingPolicyOutput { - s.AutoScalingPolicy = v - return s -} - -// SetClusterId sets the ClusterId field's value. -func (s *PutAutoScalingPolicyOutput) SetClusterId(v string) *PutAutoScalingPolicyOutput { - s.ClusterId = &v - return s -} - -// SetInstanceGroupId sets the InstanceGroupId field's value. -func (s *PutAutoScalingPolicyOutput) SetInstanceGroupId(v string) *PutAutoScalingPolicyOutput { - s.InstanceGroupId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveAutoScalingPolicyInput -type RemoveAutoScalingPolicyInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of a cluster. The instance group to which the automatic - // scaling policy is applied is within this cluster. - // - // ClusterId is a required field - ClusterId *string `type:"string" required:"true"` - - // Specifies the ID of the instance group to which the scaling policy is applied. - // - // InstanceGroupId is a required field - InstanceGroupId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveAutoScalingPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveAutoScalingPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveAutoScalingPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveAutoScalingPolicyInput"} - if s.ClusterId == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterId")) - } - if s.InstanceGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceGroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterId sets the ClusterId field's value. -func (s *RemoveAutoScalingPolicyInput) SetClusterId(v string) *RemoveAutoScalingPolicyInput { - s.ClusterId = &v - return s -} - -// SetInstanceGroupId sets the InstanceGroupId field's value. -func (s *RemoveAutoScalingPolicyInput) SetInstanceGroupId(v string) *RemoveAutoScalingPolicyInput { - s.InstanceGroupId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveAutoScalingPolicyOutput -type RemoveAutoScalingPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveAutoScalingPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveAutoScalingPolicyOutput) GoString() string { - return s.String() -} - -// This input identifies a cluster and a list of tags to remove. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveTagsInput -type RemoveTagsInput struct { - _ struct{} `type:"structure"` - - // The Amazon EMR resource identifier from which tags will be removed. This - // value must be a cluster identifier. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // A list of tag keys to remove from a resource. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *RemoveTagsInput) SetResourceId(v string) *RemoveTagsInput { - s.ResourceId = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsInput) SetTagKeys(v []*string) *RemoveTagsInput { - s.TagKeys = v - return s -} - -// This output indicates the result of removing tags from a resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveTagsOutput -type RemoveTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsOutput) GoString() string { - return s.String() -} - -// Input to the RunJobFlow operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RunJobFlowInput -type RunJobFlowInput struct { - _ struct{} `type:"structure"` - - // A JSON string for selecting additional features. - AdditionalInfo *string `type:"string"` - - // For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, - // use ReleaseLabel. - // - // The version of the Amazon Machine Image (AMI) to use when launching Amazon - // EC2 instances in the job flow. The following values are valid: - // - // * The version number of the AMI to use, for example, "2.0." - // - // If the AMI supports multiple versions of Hadoop (for example, AMI 1.0 supports - // both Hadoop 0.18 and 0.20) you can use the JobFlowInstancesConfigHadoopVersion - // parameter to modify the version of Hadoop from the defaults shown above. - // - // For details about the AMI versions currently supported by Amazon Elastic - // MapReduce, see AMI Versions Supported in Elastic MapReduce (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/EnvironmentConfig_AMIVersion.html#ami-versions-supported) - // in the Amazon Elastic MapReduce Developer Guide. - // - // Previously, the EMR AMI version API parameter options allowed you to use - // latest for the latest AMI version rather than specify a numerical value. - // Some regions no longer support this deprecated option as they only have a - // newer release label version of EMR, which requires you to specify an EMR - // release label release (EMR 4.x or later). - AmiVersion *string `type:"string"` - - // Amazon EMR releases 4.x or later. - // - // A list of applications for the cluster. Valid values are: "Hadoop", "Hive", - // "Mahout", "Pig", and "Spark." They are case insensitive. - Applications []*Application `type:"list"` - - // An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole. - // The IAM role provides permissions that the automatic scaling feature requires - // to launch and terminate EC2 instances in an instance group. - AutoScalingRole *string `type:"string"` - - // A list of bootstrap actions to run before Hadoop starts on the cluster nodes. - BootstrapActions []*BootstrapActionConfig `type:"list"` - - // Amazon EMR releases 4.x or later. - // - // The list of configurations supplied for the EMR cluster you are creating. - Configurations []*Configuration `type:"list"` - - // A specification of the number and type of Amazon EC2 instances. - // - // Instances is a required field - Instances *JobFlowInstancesConfig `type:"structure" required:"true"` - - // Also called instance profile and EC2 role. An IAM role for an EMR cluster. - // The EC2 instances of the cluster assume this role. The default role is EMR_EC2_DefaultRole. - // In order to use the default role, you must have already created it using - // the CLI or console. - JobFlowRole *string `type:"string"` - - // The location in Amazon S3 to write the log files of the job flow. If a value - // is not provided, logs are not created. - LogUri *string `type:"string"` - - // The name of the job flow. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, - // use Applications. - // - // A list of strings that indicates third-party software to use with the job - // flow that accepts a user argument list. EMR accepts and forwards the argument - // list to the corresponding installation script as bootstrap action arguments. - // For more information, see "Launch a Job Flow on the MapR Distribution for - // Hadoop" in the Amazon EMR Developer Guide (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf). - // Supported values are: - // - // * "mapr-m3" - launch the cluster using MapR M3 Edition. - // - // * "mapr-m5" - launch the cluster using MapR M5 Edition. - // - // * "mapr" with the user arguments specifying "--edition,m3" or "--edition,m5" - // - launch the job flow using MapR M3 or M5 Edition respectively. - // - // * "mapr-m7" - launch the cluster using MapR M7 Edition. - // - // * "hunk" - launch the cluster with the Hunk Big Data Analtics Platform. - // - // * "hue"- launch the cluster with Hue installed. - // - // * "spark" - launch the cluster with Apache Spark installed. - // - // * "ganglia" - launch the cluster with the Ganglia Monitoring System installed. - NewSupportedProducts []*SupportedProductConfig `type:"list"` - - // Amazon EMR releases 4.x or later. - // - // The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x - // AMIs, use amiVersion instead instead of ReleaseLabel. - ReleaseLabel *string `type:"string"` - - // Specifies the way that individual Amazon EC2 instances terminate when an - // automatic scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR - // indicates that Amazon EMR terminates nodes at the instance-hour boundary, - // regardless of when the request to terminate the instance was submitted. This - // option is only available with Amazon EMR 5.1.0 and later and is the default - // for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates - // that Amazon EMR blacklists and drains tasks from nodes before terminating - // the Amazon EC2 instances, regardless of the instance-hour boundary. With - // either behavior, Amazon EMR removes the least active nodes first and blocks - // instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION - // available only in Amazon EMR version 4.1.0 and later, and is the default - // for versions of Amazon EMR earlier than 5.1.0. - ScaleDownBehavior *string `type:"string" enum:"ScaleDownBehavior"` - - // The name of a security configuration to apply to the cluster. - SecurityConfiguration *string `type:"string"` - - // The IAM role that will be assumed by the Amazon EMR service to access AWS - // resources on your behalf. - ServiceRole *string `type:"string"` - - // A list of steps to run. - Steps []*StepConfig `type:"list"` - - // For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, - // use Applications. - // - // A list of strings that indicates third-party software to use. For more information, - // see Use Third Party Applications with Amazon EMR (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-supported-products.html). - // Currently supported values are: - // - // * "mapr-m3" - launch the job flow using MapR M3 Edition. - // - // * "mapr-m5" - launch the job flow using MapR M5 Edition. - SupportedProducts []*string `type:"list"` - - // A list of tags to associate with a cluster and propagate to Amazon EC2 instances. - Tags []*Tag `type:"list"` - - // Whether the cluster is visible to all IAM users of the AWS account associated - // with the cluster. If this value is set to true, all IAM users of that AWS - // account can view and (if they have the proper policy permissions set) manage - // the cluster. If it is set to false, only the IAM user that created the cluster - // can view and manage it. - VisibleToAllUsers *bool `type:"boolean"` -} - -// String returns the string representation -func (s RunJobFlowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunJobFlowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunJobFlowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunJobFlowInput"} - if s.Instances == nil { - invalidParams.Add(request.NewErrParamRequired("Instances")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.BootstrapActions != nil { - for i, v := range s.BootstrapActions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "BootstrapActions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Instances != nil { - if err := s.Instances.Validate(); err != nil { - invalidParams.AddNested("Instances", err.(request.ErrInvalidParams)) - } - } - if s.Steps != nil { - for i, v := range s.Steps { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Steps", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *RunJobFlowInput) SetAdditionalInfo(v string) *RunJobFlowInput { - s.AdditionalInfo = &v - return s -} - -// SetAmiVersion sets the AmiVersion field's value. -func (s *RunJobFlowInput) SetAmiVersion(v string) *RunJobFlowInput { - s.AmiVersion = &v - return s -} - -// SetApplications sets the Applications field's value. -func (s *RunJobFlowInput) SetApplications(v []*Application) *RunJobFlowInput { - s.Applications = v - return s -} - -// SetAutoScalingRole sets the AutoScalingRole field's value. -func (s *RunJobFlowInput) SetAutoScalingRole(v string) *RunJobFlowInput { - s.AutoScalingRole = &v - return s -} - -// SetBootstrapActions sets the BootstrapActions field's value. -func (s *RunJobFlowInput) SetBootstrapActions(v []*BootstrapActionConfig) *RunJobFlowInput { - s.BootstrapActions = v - return s -} - -// SetConfigurations sets the Configurations field's value. -func (s *RunJobFlowInput) SetConfigurations(v []*Configuration) *RunJobFlowInput { - s.Configurations = v - return s -} - -// SetInstances sets the Instances field's value. -func (s *RunJobFlowInput) SetInstances(v *JobFlowInstancesConfig) *RunJobFlowInput { - s.Instances = v - return s -} - -// SetJobFlowRole sets the JobFlowRole field's value. -func (s *RunJobFlowInput) SetJobFlowRole(v string) *RunJobFlowInput { - s.JobFlowRole = &v - return s -} - -// SetLogUri sets the LogUri field's value. -func (s *RunJobFlowInput) SetLogUri(v string) *RunJobFlowInput { - s.LogUri = &v - return s -} - -// SetName sets the Name field's value. -func (s *RunJobFlowInput) SetName(v string) *RunJobFlowInput { - s.Name = &v - return s -} - -// SetNewSupportedProducts sets the NewSupportedProducts field's value. -func (s *RunJobFlowInput) SetNewSupportedProducts(v []*SupportedProductConfig) *RunJobFlowInput { - s.NewSupportedProducts = v - return s -} - -// SetReleaseLabel sets the ReleaseLabel field's value. -func (s *RunJobFlowInput) SetReleaseLabel(v string) *RunJobFlowInput { - s.ReleaseLabel = &v - return s -} - -// SetScaleDownBehavior sets the ScaleDownBehavior field's value. -func (s *RunJobFlowInput) SetScaleDownBehavior(v string) *RunJobFlowInput { - s.ScaleDownBehavior = &v - return s -} - -// SetSecurityConfiguration sets the SecurityConfiguration field's value. -func (s *RunJobFlowInput) SetSecurityConfiguration(v string) *RunJobFlowInput { - s.SecurityConfiguration = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *RunJobFlowInput) SetServiceRole(v string) *RunJobFlowInput { - s.ServiceRole = &v - return s -} - -// SetSteps sets the Steps field's value. -func (s *RunJobFlowInput) SetSteps(v []*StepConfig) *RunJobFlowInput { - s.Steps = v - return s -} - -// SetSupportedProducts sets the SupportedProducts field's value. -func (s *RunJobFlowInput) SetSupportedProducts(v []*string) *RunJobFlowInput { - s.SupportedProducts = v - return s -} - -// SetTags sets the Tags field's value. -func (s *RunJobFlowInput) SetTags(v []*Tag) *RunJobFlowInput { - s.Tags = v - return s -} - -// SetVisibleToAllUsers sets the VisibleToAllUsers field's value. -func (s *RunJobFlowInput) SetVisibleToAllUsers(v bool) *RunJobFlowInput { - s.VisibleToAllUsers = &v - return s -} - -// The result of the RunJobFlow operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RunJobFlowOutput -type RunJobFlowOutput struct { - _ struct{} `type:"structure"` - - // An unique identifier for the job flow. - JobFlowId *string `type:"string"` -} - -// String returns the string representation -func (s RunJobFlowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunJobFlowOutput) GoString() string { - return s.String() -} - -// SetJobFlowId sets the JobFlowId field's value. -func (s *RunJobFlowOutput) SetJobFlowId(v string) *RunJobFlowOutput { - s.JobFlowId = &v - return s -} - -// The type of adjustment the automatic scaling activity makes when triggered, -// and the periodicity of the adjustment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ScalingAction -type ScalingAction struct { - _ struct{} `type:"structure"` - - // Not available for instance groups. Instance groups use the market type specified - // for the group. - Market *string `type:"string" enum:"MarketType"` - - // The type of adjustment the automatic scaling activity makes when triggered, - // and the periodicity of the adjustment. - // - // SimpleScalingPolicyConfiguration is a required field - SimpleScalingPolicyConfiguration *SimpleScalingPolicyConfiguration `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ScalingAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScalingAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScalingAction"} - if s.SimpleScalingPolicyConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("SimpleScalingPolicyConfiguration")) - } - if s.SimpleScalingPolicyConfiguration != nil { - if err := s.SimpleScalingPolicyConfiguration.Validate(); err != nil { - invalidParams.AddNested("SimpleScalingPolicyConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarket sets the Market field's value. -func (s *ScalingAction) SetMarket(v string) *ScalingAction { - s.Market = &v - return s -} - -// SetSimpleScalingPolicyConfiguration sets the SimpleScalingPolicyConfiguration field's value. -func (s *ScalingAction) SetSimpleScalingPolicyConfiguration(v *SimpleScalingPolicyConfiguration) *ScalingAction { - s.SimpleScalingPolicyConfiguration = v - return s -} - -// The upper and lower EC2 instance limits for an automatic scaling policy. -// Automatic scaling activities triggered by automatic scaling rules will not -// cause an instance group to grow above or below these limits. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ScalingConstraints -type ScalingConstraints struct { - _ struct{} `type:"structure"` - - // The upper boundary of EC2 instances in an instance group beyond which scaling - // activities are not allowed to grow. Scale-out activities will not add instances - // beyond this boundary. - // - // MaxCapacity is a required field - MaxCapacity *int64 `type:"integer" required:"true"` - - // The lower boundary of EC2 instances in an instance group below which scaling - // activities are not allowed to shrink. Scale-in activities will not terminate - // instances below this boundary. - // - // MinCapacity is a required field - MinCapacity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s ScalingConstraints) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingConstraints) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScalingConstraints) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScalingConstraints"} - if s.MaxCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("MaxCapacity")) - } - if s.MinCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("MinCapacity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxCapacity sets the MaxCapacity field's value. -func (s *ScalingConstraints) SetMaxCapacity(v int64) *ScalingConstraints { - s.MaxCapacity = &v - return s -} - -// SetMinCapacity sets the MinCapacity field's value. -func (s *ScalingConstraints) SetMinCapacity(v int64) *ScalingConstraints { - s.MinCapacity = &v - return s -} - -// A scale-in or scale-out rule that defines scaling activity, including the -// CloudWatch metric alarm that triggers activity, how EC2 instances are added -// or removed, and the periodicity of adjustments. The automatic scaling policy -// for an instance group can comprise one or more automatic scaling rules. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ScalingRule -type ScalingRule struct { - _ struct{} `type:"structure"` - - // The conditions that trigger an automatic scaling activity. - // - // Action is a required field - Action *ScalingAction `type:"structure" required:"true"` - - // A friendly, more verbose description of the automatic scaling rule. - Description *string `type:"string"` - - // The name used to identify an automatic scaling rule. Rule names must be unique - // within a scaling policy. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The CloudWatch alarm definition that determines when automatic scaling activity - // is triggered. - // - // Trigger is a required field - Trigger *ScalingTrigger `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ScalingRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScalingRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScalingRule"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Trigger == nil { - invalidParams.Add(request.NewErrParamRequired("Trigger")) - } - if s.Action != nil { - if err := s.Action.Validate(); err != nil { - invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) - } - } - if s.Trigger != nil { - if err := s.Trigger.Validate(); err != nil { - invalidParams.AddNested("Trigger", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *ScalingRule) SetAction(v *ScalingAction) *ScalingRule { - s.Action = v - return s -} - -// SetDescription sets the Description field's value. -func (s *ScalingRule) SetDescription(v string) *ScalingRule { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *ScalingRule) SetName(v string) *ScalingRule { - s.Name = &v - return s -} - -// SetTrigger sets the Trigger field's value. -func (s *ScalingRule) SetTrigger(v *ScalingTrigger) *ScalingRule { - s.Trigger = v - return s -} - -// The conditions that trigger an automatic scaling activity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ScalingTrigger -type ScalingTrigger struct { - _ struct{} `type:"structure"` - - // The definition of a CloudWatch metric alarm. When the defined alarm conditions - // are met along with other trigger parameters, scaling activity begins. - // - // CloudWatchAlarmDefinition is a required field - CloudWatchAlarmDefinition *CloudWatchAlarmDefinition `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ScalingTrigger) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingTrigger) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScalingTrigger) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScalingTrigger"} - if s.CloudWatchAlarmDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("CloudWatchAlarmDefinition")) - } - if s.CloudWatchAlarmDefinition != nil { - if err := s.CloudWatchAlarmDefinition.Validate(); err != nil { - invalidParams.AddNested("CloudWatchAlarmDefinition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchAlarmDefinition sets the CloudWatchAlarmDefinition field's value. -func (s *ScalingTrigger) SetCloudWatchAlarmDefinition(v *CloudWatchAlarmDefinition) *ScalingTrigger { - s.CloudWatchAlarmDefinition = v - return s -} - -// Configuration of the script to run during a bootstrap action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ScriptBootstrapActionConfig -type ScriptBootstrapActionConfig struct { - _ struct{} `type:"structure"` - - // A list of command line arguments to pass to the bootstrap action script. - Args []*string `type:"list"` - - // Location of the script to run during a bootstrap action. Can be either a - // location in Amazon S3 or on a local file system. - // - // Path is a required field - Path *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ScriptBootstrapActionConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScriptBootstrapActionConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScriptBootstrapActionConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScriptBootstrapActionConfig"} - if s.Path == nil { - invalidParams.Add(request.NewErrParamRequired("Path")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArgs sets the Args field's value. -func (s *ScriptBootstrapActionConfig) SetArgs(v []*string) *ScriptBootstrapActionConfig { - s.Args = v - return s -} - -// SetPath sets the Path field's value. -func (s *ScriptBootstrapActionConfig) SetPath(v string) *ScriptBootstrapActionConfig { - s.Path = &v - return s -} - -// The creation date and time, and name, of a security configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SecurityConfigurationSummary -type SecurityConfigurationSummary struct { - _ struct{} `type:"structure"` - - // The date and time the security configuration was created. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the security configuration. - Name *string `type:"string"` -} - -// String returns the string representation -func (s SecurityConfigurationSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SecurityConfigurationSummary) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *SecurityConfigurationSummary) SetCreationDateTime(v time.Time) *SecurityConfigurationSummary { - s.CreationDateTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *SecurityConfigurationSummary) SetName(v string) *SecurityConfigurationSummary { - s.Name = &v - return s -} - -// The input argument to the TerminationProtection operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetTerminationProtectionInput -type SetTerminationProtectionInput struct { - _ struct{} `type:"structure"` - - // A list of strings that uniquely identify the clusters to protect. This identifier - // is returned by RunJobFlow and can also be obtained from DescribeJobFlows - // . - // - // JobFlowIds is a required field - JobFlowIds []*string `type:"list" required:"true"` - - // A Boolean that indicates whether to protect the cluster and prevent the Amazon - // EC2 instances in the cluster from shutting down due to API calls, user intervention, - // or job-flow error. - // - // TerminationProtected is a required field - TerminationProtected *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s SetTerminationProtectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetTerminationProtectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetTerminationProtectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetTerminationProtectionInput"} - if s.JobFlowIds == nil { - invalidParams.Add(request.NewErrParamRequired("JobFlowIds")) - } - if s.TerminationProtected == nil { - invalidParams.Add(request.NewErrParamRequired("TerminationProtected")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobFlowIds sets the JobFlowIds field's value. -func (s *SetTerminationProtectionInput) SetJobFlowIds(v []*string) *SetTerminationProtectionInput { - s.JobFlowIds = v - return s -} - -// SetTerminationProtected sets the TerminationProtected field's value. -func (s *SetTerminationProtectionInput) SetTerminationProtected(v bool) *SetTerminationProtectionInput { - s.TerminationProtected = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetTerminationProtectionOutput -type SetTerminationProtectionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetTerminationProtectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetTerminationProtectionOutput) GoString() string { - return s.String() -} - -// The input to the SetVisibleToAllUsers action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetVisibleToAllUsersInput -type SetVisibleToAllUsersInput struct { - _ struct{} `type:"structure"` - - // Identifiers of the job flows to receive the new visibility setting. - // - // JobFlowIds is a required field - JobFlowIds []*string `type:"list" required:"true"` - - // Whether the specified clusters are visible to all IAM users of the AWS account - // associated with the cluster. If this value is set to True, all IAM users - // of that AWS account can view and, if they have the proper IAM policy permissions - // set, manage the clusters. If it is set to False, only the IAM user that created - // a cluster can view and manage it. - // - // VisibleToAllUsers is a required field - VisibleToAllUsers *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s SetVisibleToAllUsersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetVisibleToAllUsersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetVisibleToAllUsersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetVisibleToAllUsersInput"} - if s.JobFlowIds == nil { - invalidParams.Add(request.NewErrParamRequired("JobFlowIds")) - } - if s.VisibleToAllUsers == nil { - invalidParams.Add(request.NewErrParamRequired("VisibleToAllUsers")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobFlowIds sets the JobFlowIds field's value. -func (s *SetVisibleToAllUsersInput) SetJobFlowIds(v []*string) *SetVisibleToAllUsersInput { - s.JobFlowIds = v - return s -} - -// SetVisibleToAllUsers sets the VisibleToAllUsers field's value. -func (s *SetVisibleToAllUsersInput) SetVisibleToAllUsers(v bool) *SetVisibleToAllUsersInput { - s.VisibleToAllUsers = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetVisibleToAllUsersOutput -type SetVisibleToAllUsersOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetVisibleToAllUsersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetVisibleToAllUsersOutput) GoString() string { - return s.String() -} - -// Policy for customizing shrink operations. Allows configuration of decommissioning -// timeout and targeted instance shrinking. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ShrinkPolicy -type ShrinkPolicy struct { - _ struct{} `type:"structure"` - - // The desired timeout for decommissioning an instance. Overrides the default - // YARN decommissioning timeout. - DecommissionTimeout *int64 `type:"integer"` - - // Custom policy for requesting termination protection or termination of specific - // instances when shrinking an instance group. - InstanceResizePolicy *InstanceResizePolicy `type:"structure"` -} - -// String returns the string representation -func (s ShrinkPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ShrinkPolicy) GoString() string { - return s.String() -} - -// SetDecommissionTimeout sets the DecommissionTimeout field's value. -func (s *ShrinkPolicy) SetDecommissionTimeout(v int64) *ShrinkPolicy { - s.DecommissionTimeout = &v - return s -} - -// SetInstanceResizePolicy sets the InstanceResizePolicy field's value. -func (s *ShrinkPolicy) SetInstanceResizePolicy(v *InstanceResizePolicy) *ShrinkPolicy { - s.InstanceResizePolicy = v - return s -} - -// An automatic scaling configuration, which describes how the policy adds or -// removes instances, the cooldown period, and the number of EC2 instances that -// will be added each time the CloudWatch metric alarm condition is satisfied. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SimpleScalingPolicyConfiguration -type SimpleScalingPolicyConfiguration struct { - _ struct{} `type:"structure"` - - // The way in which EC2 instances are added (if ScalingAdjustment is a positive - // number) or terminated (if ScalingAdjustment is a negative number) each time - // the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY - // indicates that the EC2 instance count increments or decrements by ScalingAdjustment, - // which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates - // the instance count increments or decrements by the percentage specified by - // ScalingAdjustment, which should be expressed as a decimal. For example, 0.20 - // indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY - // indicates the scaling activity results in an instance group with the number - // of EC2 instances specified by ScalingAdjustment, which should be expressed - // as a positive integer. - AdjustmentType *string `type:"string" enum:"AdjustmentType"` - - // The amount of time, in seconds, after a scaling activity completes before - // any further trigger-related scaling activities can start. The default value - // is 0. - CoolDown *int64 `type:"integer"` - - // The amount by which to scale in or scale out, based on the specified AdjustmentType. - // A positive value adds to the instance group's EC2 instance count while a - // negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY, - // the number should only be a positive integer. If AdjustmentType is set to - // PERCENT_CHANGE_IN_CAPACITY, the value should express the percentage as a - // decimal. For example, -0.20 indicates a decrease in 20% increments of cluster - // capacity. - // - // ScalingAdjustment is a required field - ScalingAdjustment *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s SimpleScalingPolicyConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SimpleScalingPolicyConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SimpleScalingPolicyConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SimpleScalingPolicyConfiguration"} - if s.ScalingAdjustment == nil { - invalidParams.Add(request.NewErrParamRequired("ScalingAdjustment")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdjustmentType sets the AdjustmentType field's value. -func (s *SimpleScalingPolicyConfiguration) SetAdjustmentType(v string) *SimpleScalingPolicyConfiguration { - s.AdjustmentType = &v - return s -} - -// SetCoolDown sets the CoolDown field's value. -func (s *SimpleScalingPolicyConfiguration) SetCoolDown(v int64) *SimpleScalingPolicyConfiguration { - s.CoolDown = &v - return s -} - -// SetScalingAdjustment sets the ScalingAdjustment field's value. -func (s *SimpleScalingPolicyConfiguration) SetScalingAdjustment(v int64) *SimpleScalingPolicyConfiguration { - s.ScalingAdjustment = &v - return s -} - -// The launch specification for Spot instances in the instance fleet, which -// determines the defined duration and provisioning timeout behavior. -// -// The instance fleet configuration is available only in Amazon EMR versions -// 4.8.0 and later, excluding 5.0.x versions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SpotProvisioningSpecification -type SpotProvisioningSpecification struct { - _ struct{} `type:"structure"` - - // The defined duration for Spot instances (also known as Spot blocks) in minutes. - // When specified, the Spot instance does not terminate before the defined duration - // expires, and defined duration pricing for Spot instances applies. Valid values - // are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as - // a Spot instance receives its instance ID. At the end of the duration, 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. - BlockDurationMinutes *int64 `type:"integer"` - - // The action to take when TargetSpotCapacity has not been fulfilled when the - // TimeoutDurationMinutes has expired. Spot instances are not uprovisioned within - // the Spot provisioining timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND - // to fulfill the remaining capacity. - // - // TimeoutAction is a required field - TimeoutAction *string `type:"string" required:"true" enum:"SpotProvisioningTimeoutAction"` - - // The spot provisioning timeout period in minutes. If Spot instances are not - // provisioned within this time period, the TimeOutAction is taken. Minimum - // value is 5 and maximum value is 1440. The timeout applies only during initial - // provisioning, when the cluster is first created. - // - // TimeoutDurationMinutes is a required field - TimeoutDurationMinutes *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s SpotProvisioningSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotProvisioningSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SpotProvisioningSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SpotProvisioningSpecification"} - if s.TimeoutAction == nil { - invalidParams.Add(request.NewErrParamRequired("TimeoutAction")) - } - if s.TimeoutDurationMinutes == nil { - invalidParams.Add(request.NewErrParamRequired("TimeoutDurationMinutes")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlockDurationMinutes sets the BlockDurationMinutes field's value. -func (s *SpotProvisioningSpecification) SetBlockDurationMinutes(v int64) *SpotProvisioningSpecification { - s.BlockDurationMinutes = &v - return s -} - -// SetTimeoutAction sets the TimeoutAction field's value. -func (s *SpotProvisioningSpecification) SetTimeoutAction(v string) *SpotProvisioningSpecification { - s.TimeoutAction = &v - return s -} - -// SetTimeoutDurationMinutes sets the TimeoutDurationMinutes field's value. -func (s *SpotProvisioningSpecification) SetTimeoutDurationMinutes(v int64) *SpotProvisioningSpecification { - s.TimeoutDurationMinutes = &v - return s -} - -// This represents a step in a cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Step -type Step struct { - _ struct{} `type:"structure"` - - // This specifies what action to take when the cluster step fails. Possible - // values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE. - ActionOnFailure *string `type:"string" enum:"ActionOnFailure"` - - // The Hadoop job configuration of the cluster step. - Config *HadoopStepConfig `type:"structure"` - - // The identifier of the cluster step. - Id *string `type:"string"` - - // The name of the cluster step. - Name *string `type:"string"` - - // The current execution status details of the cluster step. - Status *StepStatus `type:"structure"` -} - -// String returns the string representation -func (s Step) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Step) GoString() string { - return s.String() -} - -// SetActionOnFailure sets the ActionOnFailure field's value. -func (s *Step) SetActionOnFailure(v string) *Step { - s.ActionOnFailure = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *Step) SetConfig(v *HadoopStepConfig) *Step { - s.Config = v - return s -} - -// SetId sets the Id field's value. -func (s *Step) SetId(v string) *Step { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *Step) SetName(v string) *Step { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Step) SetStatus(v *StepStatus) *Step { - s.Status = v - return s -} - -// Specification of a cluster (job flow) step. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/StepConfig -type StepConfig struct { - _ struct{} `type:"structure"` - - // The action to take if the step fails. - ActionOnFailure *string `type:"string" enum:"ActionOnFailure"` - - // The JAR file used for the step. - // - // HadoopJarStep is a required field - HadoopJarStep *HadoopJarStepConfig `type:"structure" required:"true"` - - // The name of the step. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StepConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StepConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StepConfig"} - if s.HadoopJarStep == nil { - invalidParams.Add(request.NewErrParamRequired("HadoopJarStep")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.HadoopJarStep != nil { - if err := s.HadoopJarStep.Validate(); err != nil { - invalidParams.AddNested("HadoopJarStep", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionOnFailure sets the ActionOnFailure field's value. -func (s *StepConfig) SetActionOnFailure(v string) *StepConfig { - s.ActionOnFailure = &v - return s -} - -// SetHadoopJarStep sets the HadoopJarStep field's value. -func (s *StepConfig) SetHadoopJarStep(v *HadoopJarStepConfig) *StepConfig { - s.HadoopJarStep = v - return s -} - -// SetName sets the Name field's value. -func (s *StepConfig) SetName(v string) *StepConfig { - s.Name = &v - return s -} - -// Combines the execution state and configuration of a step. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/StepDetail -type StepDetail struct { - _ struct{} `type:"structure"` - - // The description of the step status. - // - // ExecutionStatusDetail is a required field - ExecutionStatusDetail *StepExecutionStatusDetail `type:"structure" required:"true"` - - // The step configuration. - // - // StepConfig is a required field - StepConfig *StepConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s StepDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepDetail) GoString() string { - return s.String() -} - -// SetExecutionStatusDetail sets the ExecutionStatusDetail field's value. -func (s *StepDetail) SetExecutionStatusDetail(v *StepExecutionStatusDetail) *StepDetail { - s.ExecutionStatusDetail = v - return s -} - -// SetStepConfig sets the StepConfig field's value. -func (s *StepDetail) SetStepConfig(v *StepConfig) *StepDetail { - s.StepConfig = v - return s -} - -// The execution state of a step. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/StepExecutionStatusDetail -type StepExecutionStatusDetail struct { - _ struct{} `type:"structure"` - - // The creation date and time of the step. - // - // CreationDateTime is a required field - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The completion date and time of the step. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // A description of the step's current state. - LastStateChangeReason *string `type:"string"` - - // The start date and time of the step. - StartDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The state of the step. - // - // State is a required field - State *string `type:"string" required:"true" enum:"StepExecutionState"` -} - -// String returns the string representation -func (s StepExecutionStatusDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepExecutionStatusDetail) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *StepExecutionStatusDetail) SetCreationDateTime(v time.Time) *StepExecutionStatusDetail { - s.CreationDateTime = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *StepExecutionStatusDetail) SetEndDateTime(v time.Time) *StepExecutionStatusDetail { - s.EndDateTime = &v - return s -} - -// SetLastStateChangeReason sets the LastStateChangeReason field's value. -func (s *StepExecutionStatusDetail) SetLastStateChangeReason(v string) *StepExecutionStatusDetail { - s.LastStateChangeReason = &v - return s -} - -// SetStartDateTime sets the StartDateTime field's value. -func (s *StepExecutionStatusDetail) SetStartDateTime(v time.Time) *StepExecutionStatusDetail { - s.StartDateTime = &v - return s -} - -// SetState sets the State field's value. -func (s *StepExecutionStatusDetail) SetState(v string) *StepExecutionStatusDetail { - s.State = &v - return s -} - -// The details of the step state change reason. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/StepStateChangeReason -type StepStateChangeReason struct { - _ struct{} `type:"structure"` - - // The programmable code for the state change reason. Note: Currently, the service - // provides no code for the state change. - Code *string `type:"string" enum:"StepStateChangeReasonCode"` - - // The descriptive message for the state change reason. - Message *string `type:"string"` -} - -// String returns the string representation -func (s StepStateChangeReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepStateChangeReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *StepStateChangeReason) SetCode(v string) *StepStateChangeReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *StepStateChangeReason) SetMessage(v string) *StepStateChangeReason { - s.Message = &v - return s -} - -// The execution status details of the cluster step. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/StepStatus -type StepStatus struct { - _ struct{} `type:"structure"` - - // The details for the step failure including reason, message, and log file - // path where the root cause was identified. - FailureDetails *FailureDetails `type:"structure"` - - // The execution state of the cluster step. - State *string `type:"string" enum:"StepState"` - - // The reason for the step execution status change. - StateChangeReason *StepStateChangeReason `type:"structure"` - - // The timeline of the cluster step status over time. - Timeline *StepTimeline `type:"structure"` -} - -// String returns the string representation -func (s StepStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepStatus) GoString() string { - return s.String() -} - -// SetFailureDetails sets the FailureDetails field's value. -func (s *StepStatus) SetFailureDetails(v *FailureDetails) *StepStatus { - s.FailureDetails = v - return s -} - -// SetState sets the State field's value. -func (s *StepStatus) SetState(v string) *StepStatus { - s.State = &v - return s -} - -// SetStateChangeReason sets the StateChangeReason field's value. -func (s *StepStatus) SetStateChangeReason(v *StepStateChangeReason) *StepStatus { - s.StateChangeReason = v - return s -} - -// SetTimeline sets the Timeline field's value. -func (s *StepStatus) SetTimeline(v *StepTimeline) *StepStatus { - s.Timeline = v - return s -} - -// The summary of the cluster step. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/StepSummary -type StepSummary struct { - _ struct{} `type:"structure"` - - // This specifies what action to take when the cluster step fails. Possible - // values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE. - ActionOnFailure *string `type:"string" enum:"ActionOnFailure"` - - // The Hadoop job configuration of the cluster step. - Config *HadoopStepConfig `type:"structure"` - - // The identifier of the cluster step. - Id *string `type:"string"` - - // The name of the cluster step. - Name *string `type:"string"` - - // The current execution status details of the cluster step. - Status *StepStatus `type:"structure"` -} - -// String returns the string representation -func (s StepSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepSummary) GoString() string { - return s.String() -} - -// SetActionOnFailure sets the ActionOnFailure field's value. -func (s *StepSummary) SetActionOnFailure(v string) *StepSummary { - s.ActionOnFailure = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *StepSummary) SetConfig(v *HadoopStepConfig) *StepSummary { - s.Config = v - return s -} - -// SetId sets the Id field's value. -func (s *StepSummary) SetId(v string) *StepSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *StepSummary) SetName(v string) *StepSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StepSummary) SetStatus(v *StepStatus) *StepSummary { - s.Status = v - return s -} - -// The timeline of the cluster step lifecycle. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/StepTimeline -type StepTimeline struct { - _ struct{} `type:"structure"` - - // The date and time when the cluster step was created. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when the cluster step execution completed or failed. - EndDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when the cluster step execution started. - StartDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s StepTimeline) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepTimeline) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *StepTimeline) SetCreationDateTime(v time.Time) *StepTimeline { - s.CreationDateTime = &v - return s -} - -// SetEndDateTime sets the EndDateTime field's value. -func (s *StepTimeline) SetEndDateTime(v time.Time) *StepTimeline { - s.EndDateTime = &v - return s -} - -// SetStartDateTime sets the StartDateTime field's value. -func (s *StepTimeline) SetStartDateTime(v time.Time) *StepTimeline { - s.StartDateTime = &v - return s -} - -// The list of supported product configurations which allow user-supplied arguments. -// EMR accepts these arguments and forwards them to the corresponding installation -// script as bootstrap action arguments. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SupportedProductConfig -type SupportedProductConfig struct { - _ struct{} `type:"structure"` - - // The list of user-supplied arguments. - Args []*string `type:"list"` - - // The name of the product configuration. - Name *string `type:"string"` -} - -// String returns the string representation -func (s SupportedProductConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SupportedProductConfig) GoString() string { - return s.String() -} - -// SetArgs sets the Args field's value. -func (s *SupportedProductConfig) SetArgs(v []*string) *SupportedProductConfig { - s.Args = v - return s -} - -// SetName sets the Name field's value. -func (s *SupportedProductConfig) SetName(v string) *SupportedProductConfig { - s.Name = &v - return s -} - -// A key/value pair containing user-defined metadata that you can associate -// with an Amazon EMR resource. Tags make it easier to associate clusters in -// various ways, such as grouping clusters to track your Amazon EMR resource -// allocation costs. For more information, see Tagging Amazon EMR Resources -// (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-plan-tags.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // A user-defined key, which is the minimum required information for a valid - // tag. For more information, see Tagging Amazon EMR Resources (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-plan-tags.html). - Key *string `type:"string"` - - // A user-defined value, which is optional in a tag. For more information, see - // Tagging Amazon EMR Resources (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-plan-tags.html). - 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 -} - -// Input to the TerminateJobFlows operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/TerminateJobFlowsInput -type TerminateJobFlowsInput struct { - _ struct{} `type:"structure"` - - // A list of job flows to be shutdown. - // - // JobFlowIds is a required field - JobFlowIds []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s TerminateJobFlowsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateJobFlowsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TerminateJobFlowsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TerminateJobFlowsInput"} - if s.JobFlowIds == nil { - invalidParams.Add(request.NewErrParamRequired("JobFlowIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobFlowIds sets the JobFlowIds field's value. -func (s *TerminateJobFlowsInput) SetJobFlowIds(v []*string) *TerminateJobFlowsInput { - s.JobFlowIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/TerminateJobFlowsOutput -type TerminateJobFlowsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s TerminateJobFlowsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateJobFlowsOutput) GoString() string { - return s.String() -} - -// EBS volume specifications such as volume type, IOPS, and size (GiB) that -// will be requested for the EBS volume attached to an EC2 instance in the cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/VolumeSpecification -type VolumeSpecification struct { - _ struct{} `type:"structure"` - - // The number of I/O operations per second (IOPS) that the volume supports. - Iops *int64 `type:"integer"` - - // The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. - // If the volume type is EBS-optimized, the minimum value is 10. - // - // SizeInGB is a required field - SizeInGB *int64 `type:"integer" required:"true"` - - // The volume type. Volume types supported are gp2, io1, standard. - // - // VolumeType is a required field - VolumeType *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s VolumeSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VolumeSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VolumeSpecification"} - if s.SizeInGB == nil { - invalidParams.Add(request.NewErrParamRequired("SizeInGB")) - } - if s.VolumeType == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIops sets the Iops field's value. -func (s *VolumeSpecification) SetIops(v int64) *VolumeSpecification { - s.Iops = &v - return s -} - -// SetSizeInGB sets the SizeInGB field's value. -func (s *VolumeSpecification) SetSizeInGB(v int64) *VolumeSpecification { - s.SizeInGB = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *VolumeSpecification) SetVolumeType(v string) *VolumeSpecification { - s.VolumeType = &v - return s -} - -const ( - // ActionOnFailureTerminateJobFlow is a ActionOnFailure enum value - ActionOnFailureTerminateJobFlow = "TERMINATE_JOB_FLOW" - - // ActionOnFailureTerminateCluster is a ActionOnFailure enum value - ActionOnFailureTerminateCluster = "TERMINATE_CLUSTER" - - // ActionOnFailureCancelAndWait is a ActionOnFailure enum value - ActionOnFailureCancelAndWait = "CANCEL_AND_WAIT" - - // ActionOnFailureContinue is a ActionOnFailure enum value - ActionOnFailureContinue = "CONTINUE" -) - -const ( - // AdjustmentTypeChangeInCapacity is a AdjustmentType enum value - AdjustmentTypeChangeInCapacity = "CHANGE_IN_CAPACITY" - - // AdjustmentTypePercentChangeInCapacity is a AdjustmentType enum value - AdjustmentTypePercentChangeInCapacity = "PERCENT_CHANGE_IN_CAPACITY" - - // AdjustmentTypeExactCapacity is a AdjustmentType enum value - AdjustmentTypeExactCapacity = "EXACT_CAPACITY" -) - -const ( - // AutoScalingPolicyStatePending is a AutoScalingPolicyState enum value - AutoScalingPolicyStatePending = "PENDING" - - // AutoScalingPolicyStateAttaching is a AutoScalingPolicyState enum value - AutoScalingPolicyStateAttaching = "ATTACHING" - - // AutoScalingPolicyStateAttached is a AutoScalingPolicyState enum value - AutoScalingPolicyStateAttached = "ATTACHED" - - // AutoScalingPolicyStateDetaching is a AutoScalingPolicyState enum value - AutoScalingPolicyStateDetaching = "DETACHING" - - // AutoScalingPolicyStateDetached is a AutoScalingPolicyState enum value - AutoScalingPolicyStateDetached = "DETACHED" - - // AutoScalingPolicyStateFailed is a AutoScalingPolicyState enum value - AutoScalingPolicyStateFailed = "FAILED" -) - -const ( - // AutoScalingPolicyStateChangeReasonCodeUserRequest is a AutoScalingPolicyStateChangeReasonCode enum value - AutoScalingPolicyStateChangeReasonCodeUserRequest = "USER_REQUEST" - - // AutoScalingPolicyStateChangeReasonCodeProvisionFailure is a AutoScalingPolicyStateChangeReasonCode enum value - AutoScalingPolicyStateChangeReasonCodeProvisionFailure = "PROVISION_FAILURE" - - // AutoScalingPolicyStateChangeReasonCodeCleanupFailure is a AutoScalingPolicyStateChangeReasonCode enum value - AutoScalingPolicyStateChangeReasonCodeCleanupFailure = "CLEANUP_FAILURE" -) - -const ( - // CancelStepsRequestStatusSubmitted is a CancelStepsRequestStatus enum value - CancelStepsRequestStatusSubmitted = "SUBMITTED" - - // CancelStepsRequestStatusFailed is a CancelStepsRequestStatus enum value - CancelStepsRequestStatusFailed = "FAILED" -) - -const ( - // ClusterStateStarting is a ClusterState enum value - ClusterStateStarting = "STARTING" - - // ClusterStateBootstrapping is a ClusterState enum value - ClusterStateBootstrapping = "BOOTSTRAPPING" - - // ClusterStateRunning is a ClusterState enum value - ClusterStateRunning = "RUNNING" - - // ClusterStateWaiting is a ClusterState enum value - ClusterStateWaiting = "WAITING" - - // ClusterStateTerminating is a ClusterState enum value - ClusterStateTerminating = "TERMINATING" - - // ClusterStateTerminated is a ClusterState enum value - ClusterStateTerminated = "TERMINATED" - - // ClusterStateTerminatedWithErrors is a ClusterState enum value - ClusterStateTerminatedWithErrors = "TERMINATED_WITH_ERRORS" -) - -const ( - // ClusterStateChangeReasonCodeInternalError is a ClusterStateChangeReasonCode enum value - ClusterStateChangeReasonCodeInternalError = "INTERNAL_ERROR" - - // ClusterStateChangeReasonCodeValidationError is a ClusterStateChangeReasonCode enum value - ClusterStateChangeReasonCodeValidationError = "VALIDATION_ERROR" - - // ClusterStateChangeReasonCodeInstanceFailure is a ClusterStateChangeReasonCode enum value - ClusterStateChangeReasonCodeInstanceFailure = "INSTANCE_FAILURE" - - // ClusterStateChangeReasonCodeBootstrapFailure is a ClusterStateChangeReasonCode enum value - ClusterStateChangeReasonCodeBootstrapFailure = "BOOTSTRAP_FAILURE" - - // ClusterStateChangeReasonCodeUserRequest is a ClusterStateChangeReasonCode enum value - ClusterStateChangeReasonCodeUserRequest = "USER_REQUEST" - - // ClusterStateChangeReasonCodeStepFailure is a ClusterStateChangeReasonCode enum value - ClusterStateChangeReasonCodeStepFailure = "STEP_FAILURE" - - // ClusterStateChangeReasonCodeAllStepsCompleted is a ClusterStateChangeReasonCode enum value - ClusterStateChangeReasonCodeAllStepsCompleted = "ALL_STEPS_COMPLETED" -) - -const ( - // ComparisonOperatorGreaterThanOrEqual is a ComparisonOperator enum value - ComparisonOperatorGreaterThanOrEqual = "GREATER_THAN_OR_EQUAL" - - // ComparisonOperatorGreaterThan is a ComparisonOperator enum value - ComparisonOperatorGreaterThan = "GREATER_THAN" - - // ComparisonOperatorLessThan is a ComparisonOperator enum value - ComparisonOperatorLessThan = "LESS_THAN" - - // ComparisonOperatorLessThanOrEqual is a ComparisonOperator enum value - ComparisonOperatorLessThanOrEqual = "LESS_THAN_OR_EQUAL" -) - -const ( - // InstanceCollectionTypeInstanceFleet is a InstanceCollectionType enum value - InstanceCollectionTypeInstanceFleet = "INSTANCE_FLEET" - - // InstanceCollectionTypeInstanceGroup is a InstanceCollectionType enum value - InstanceCollectionTypeInstanceGroup = "INSTANCE_GROUP" -) - -const ( - // InstanceFleetStateProvisioning is a InstanceFleetState enum value - InstanceFleetStateProvisioning = "PROVISIONING" - - // InstanceFleetStateBootstrapping is a InstanceFleetState enum value - InstanceFleetStateBootstrapping = "BOOTSTRAPPING" - - // InstanceFleetStateRunning is a InstanceFleetState enum value - InstanceFleetStateRunning = "RUNNING" - - // InstanceFleetStateResizing is a InstanceFleetState enum value - InstanceFleetStateResizing = "RESIZING" - - // InstanceFleetStateSuspended is a InstanceFleetState enum value - InstanceFleetStateSuspended = "SUSPENDED" - - // InstanceFleetStateTerminating is a InstanceFleetState enum value - InstanceFleetStateTerminating = "TERMINATING" - - // InstanceFleetStateTerminated is a InstanceFleetState enum value - InstanceFleetStateTerminated = "TERMINATED" -) - -const ( - // InstanceFleetStateChangeReasonCodeInternalError is a InstanceFleetStateChangeReasonCode enum value - InstanceFleetStateChangeReasonCodeInternalError = "INTERNAL_ERROR" - - // InstanceFleetStateChangeReasonCodeValidationError is a InstanceFleetStateChangeReasonCode enum value - InstanceFleetStateChangeReasonCodeValidationError = "VALIDATION_ERROR" - - // InstanceFleetStateChangeReasonCodeInstanceFailure is a InstanceFleetStateChangeReasonCode enum value - InstanceFleetStateChangeReasonCodeInstanceFailure = "INSTANCE_FAILURE" - - // InstanceFleetStateChangeReasonCodeClusterTerminated is a InstanceFleetStateChangeReasonCode enum value - InstanceFleetStateChangeReasonCodeClusterTerminated = "CLUSTER_TERMINATED" -) - -const ( - // InstanceFleetTypeMaster is a InstanceFleetType enum value - InstanceFleetTypeMaster = "MASTER" - - // InstanceFleetTypeCore is a InstanceFleetType enum value - InstanceFleetTypeCore = "CORE" - - // InstanceFleetTypeTask is a InstanceFleetType enum value - InstanceFleetTypeTask = "TASK" -) - -const ( - // InstanceGroupStateProvisioning is a InstanceGroupState enum value - InstanceGroupStateProvisioning = "PROVISIONING" - - // InstanceGroupStateBootstrapping is a InstanceGroupState enum value - InstanceGroupStateBootstrapping = "BOOTSTRAPPING" - - // InstanceGroupStateRunning is a InstanceGroupState enum value - InstanceGroupStateRunning = "RUNNING" - - // InstanceGroupStateResizing is a InstanceGroupState enum value - InstanceGroupStateResizing = "RESIZING" - - // InstanceGroupStateSuspended is a InstanceGroupState enum value - InstanceGroupStateSuspended = "SUSPENDED" - - // InstanceGroupStateTerminating is a InstanceGroupState enum value - InstanceGroupStateTerminating = "TERMINATING" - - // InstanceGroupStateTerminated is a InstanceGroupState enum value - InstanceGroupStateTerminated = "TERMINATED" - - // InstanceGroupStateArrested is a InstanceGroupState enum value - InstanceGroupStateArrested = "ARRESTED" - - // InstanceGroupStateShuttingDown is a InstanceGroupState enum value - InstanceGroupStateShuttingDown = "SHUTTING_DOWN" - - // InstanceGroupStateEnded is a InstanceGroupState enum value - InstanceGroupStateEnded = "ENDED" -) - -const ( - // InstanceGroupStateChangeReasonCodeInternalError is a InstanceGroupStateChangeReasonCode enum value - InstanceGroupStateChangeReasonCodeInternalError = "INTERNAL_ERROR" - - // InstanceGroupStateChangeReasonCodeValidationError is a InstanceGroupStateChangeReasonCode enum value - InstanceGroupStateChangeReasonCodeValidationError = "VALIDATION_ERROR" - - // InstanceGroupStateChangeReasonCodeInstanceFailure is a InstanceGroupStateChangeReasonCode enum value - InstanceGroupStateChangeReasonCodeInstanceFailure = "INSTANCE_FAILURE" - - // InstanceGroupStateChangeReasonCodeClusterTerminated is a InstanceGroupStateChangeReasonCode enum value - InstanceGroupStateChangeReasonCodeClusterTerminated = "CLUSTER_TERMINATED" -) - -const ( - // InstanceGroupTypeMaster is a InstanceGroupType enum value - InstanceGroupTypeMaster = "MASTER" - - // InstanceGroupTypeCore is a InstanceGroupType enum value - InstanceGroupTypeCore = "CORE" - - // InstanceGroupTypeTask is a InstanceGroupType enum value - InstanceGroupTypeTask = "TASK" -) - -const ( - // InstanceRoleTypeMaster is a InstanceRoleType enum value - InstanceRoleTypeMaster = "MASTER" - - // InstanceRoleTypeCore is a InstanceRoleType enum value - InstanceRoleTypeCore = "CORE" - - // InstanceRoleTypeTask is a InstanceRoleType enum value - InstanceRoleTypeTask = "TASK" -) - -const ( - // InstanceStateAwaitingFulfillment is a InstanceState enum value - InstanceStateAwaitingFulfillment = "AWAITING_FULFILLMENT" - - // InstanceStateProvisioning is a InstanceState enum value - InstanceStateProvisioning = "PROVISIONING" - - // InstanceStateBootstrapping is a InstanceState enum value - InstanceStateBootstrapping = "BOOTSTRAPPING" - - // InstanceStateRunning is a InstanceState enum value - InstanceStateRunning = "RUNNING" - - // InstanceStateTerminated is a InstanceState enum value - InstanceStateTerminated = "TERMINATED" -) - -const ( - // InstanceStateChangeReasonCodeInternalError is a InstanceStateChangeReasonCode enum value - InstanceStateChangeReasonCodeInternalError = "INTERNAL_ERROR" - - // InstanceStateChangeReasonCodeValidationError is a InstanceStateChangeReasonCode enum value - InstanceStateChangeReasonCodeValidationError = "VALIDATION_ERROR" - - // InstanceStateChangeReasonCodeInstanceFailure is a InstanceStateChangeReasonCode enum value - InstanceStateChangeReasonCodeInstanceFailure = "INSTANCE_FAILURE" - - // InstanceStateChangeReasonCodeBootstrapFailure is a InstanceStateChangeReasonCode enum value - InstanceStateChangeReasonCodeBootstrapFailure = "BOOTSTRAP_FAILURE" - - // InstanceStateChangeReasonCodeClusterTerminated is a InstanceStateChangeReasonCode enum value - InstanceStateChangeReasonCodeClusterTerminated = "CLUSTER_TERMINATED" -) - -// The type of instance. -const ( - // JobFlowExecutionStateStarting is a JobFlowExecutionState enum value - JobFlowExecutionStateStarting = "STARTING" - - // JobFlowExecutionStateBootstrapping is a JobFlowExecutionState enum value - JobFlowExecutionStateBootstrapping = "BOOTSTRAPPING" - - // JobFlowExecutionStateRunning is a JobFlowExecutionState enum value - JobFlowExecutionStateRunning = "RUNNING" - - // JobFlowExecutionStateWaiting is a JobFlowExecutionState enum value - JobFlowExecutionStateWaiting = "WAITING" - - // JobFlowExecutionStateShuttingDown is a JobFlowExecutionState enum value - JobFlowExecutionStateShuttingDown = "SHUTTING_DOWN" - - // JobFlowExecutionStateTerminated is a JobFlowExecutionState enum value - JobFlowExecutionStateTerminated = "TERMINATED" - - // JobFlowExecutionStateCompleted is a JobFlowExecutionState enum value - JobFlowExecutionStateCompleted = "COMPLETED" - - // JobFlowExecutionStateFailed is a JobFlowExecutionState enum value - JobFlowExecutionStateFailed = "FAILED" -) - -const ( - // MarketTypeOnDemand is a MarketType enum value - MarketTypeOnDemand = "ON_DEMAND" - - // MarketTypeSpot is a MarketType enum value - MarketTypeSpot = "SPOT" -) - -const ( - // ScaleDownBehaviorTerminateAtInstanceHour is a ScaleDownBehavior enum value - ScaleDownBehaviorTerminateAtInstanceHour = "TERMINATE_AT_INSTANCE_HOUR" - - // ScaleDownBehaviorTerminateAtTaskCompletion is a ScaleDownBehavior enum value - ScaleDownBehaviorTerminateAtTaskCompletion = "TERMINATE_AT_TASK_COMPLETION" -) - -const ( - // SpotProvisioningTimeoutActionSwitchToOnDemand is a SpotProvisioningTimeoutAction enum value - SpotProvisioningTimeoutActionSwitchToOnDemand = "SWITCH_TO_ON_DEMAND" - - // SpotProvisioningTimeoutActionTerminateCluster is a SpotProvisioningTimeoutAction enum value - SpotProvisioningTimeoutActionTerminateCluster = "TERMINATE_CLUSTER" -) - -const ( - // StatisticSampleCount is a Statistic enum value - StatisticSampleCount = "SAMPLE_COUNT" - - // StatisticAverage is a Statistic enum value - StatisticAverage = "AVERAGE" - - // StatisticSum is a Statistic enum value - StatisticSum = "SUM" - - // StatisticMinimum is a Statistic enum value - StatisticMinimum = "MINIMUM" - - // StatisticMaximum is a Statistic enum value - StatisticMaximum = "MAXIMUM" -) - -const ( - // StepExecutionStatePending is a StepExecutionState enum value - StepExecutionStatePending = "PENDING" - - // StepExecutionStateRunning is a StepExecutionState enum value - StepExecutionStateRunning = "RUNNING" - - // StepExecutionStateContinue is a StepExecutionState enum value - StepExecutionStateContinue = "CONTINUE" - - // StepExecutionStateCompleted is a StepExecutionState enum value - StepExecutionStateCompleted = "COMPLETED" - - // StepExecutionStateCancelled is a StepExecutionState enum value - StepExecutionStateCancelled = "CANCELLED" - - // StepExecutionStateFailed is a StepExecutionState enum value - StepExecutionStateFailed = "FAILED" - - // StepExecutionStateInterrupted is a StepExecutionState enum value - StepExecutionStateInterrupted = "INTERRUPTED" -) - -const ( - // StepStatePending is a StepState enum value - StepStatePending = "PENDING" - - // StepStateCancelPending is a StepState enum value - StepStateCancelPending = "CANCEL_PENDING" - - // StepStateRunning is a StepState enum value - StepStateRunning = "RUNNING" - - // StepStateCompleted is a StepState enum value - StepStateCompleted = "COMPLETED" - - // StepStateCancelled is a StepState enum value - StepStateCancelled = "CANCELLED" - - // StepStateFailed is a StepState enum value - StepStateFailed = "FAILED" - - // StepStateInterrupted is a StepState enum value - StepStateInterrupted = "INTERRUPTED" -) - -const ( - // StepStateChangeReasonCodeNone is a StepStateChangeReasonCode enum value - StepStateChangeReasonCodeNone = "NONE" -) - -const ( - // UnitNone is a Unit enum value - UnitNone = "NONE" - - // UnitSeconds is a Unit enum value - UnitSeconds = "SECONDS" - - // UnitMicroSeconds is a Unit enum value - UnitMicroSeconds = "MICRO_SECONDS" - - // UnitMilliSeconds is a Unit enum value - UnitMilliSeconds = "MILLI_SECONDS" - - // UnitBytes is a Unit enum value - UnitBytes = "BYTES" - - // UnitKiloBytes is a Unit enum value - UnitKiloBytes = "KILO_BYTES" - - // UnitMegaBytes is a Unit enum value - UnitMegaBytes = "MEGA_BYTES" - - // UnitGigaBytes is a Unit enum value - UnitGigaBytes = "GIGA_BYTES" - - // UnitTeraBytes is a Unit enum value - UnitTeraBytes = "TERA_BYTES" - - // UnitBits is a Unit enum value - UnitBits = "BITS" - - // UnitKiloBits is a Unit enum value - UnitKiloBits = "KILO_BITS" - - // UnitMegaBits is a Unit enum value - UnitMegaBits = "MEGA_BITS" - - // UnitGigaBits is a Unit enum value - UnitGigaBits = "GIGA_BITS" - - // UnitTeraBits is a Unit enum value - UnitTeraBits = "TERA_BITS" - - // UnitPercent is a Unit enum value - UnitPercent = "PERCENT" - - // UnitCount is a Unit enum value - UnitCount = "COUNT" - - // UnitBytesPerSecond is a Unit enum value - UnitBytesPerSecond = "BYTES_PER_SECOND" - - // UnitKiloBytesPerSecond is a Unit enum value - UnitKiloBytesPerSecond = "KILO_BYTES_PER_SECOND" - - // UnitMegaBytesPerSecond is a Unit enum value - UnitMegaBytesPerSecond = "MEGA_BYTES_PER_SECOND" - - // UnitGigaBytesPerSecond is a Unit enum value - UnitGigaBytesPerSecond = "GIGA_BYTES_PER_SECOND" - - // UnitTeraBytesPerSecond is a Unit enum value - UnitTeraBytesPerSecond = "TERA_BYTES_PER_SECOND" - - // UnitBitsPerSecond is a Unit enum value - UnitBitsPerSecond = "BITS_PER_SECOND" - - // UnitKiloBitsPerSecond is a Unit enum value - UnitKiloBitsPerSecond = "KILO_BITS_PER_SECOND" - - // UnitMegaBitsPerSecond is a Unit enum value - UnitMegaBitsPerSecond = "MEGA_BITS_PER_SECOND" - - // UnitGigaBitsPerSecond is a Unit enum value - UnitGigaBitsPerSecond = "GIGA_BITS_PER_SECOND" - - // UnitTeraBitsPerSecond is a Unit enum value - UnitTeraBitsPerSecond = "TERA_BITS_PER_SECOND" - - // UnitCountPerSecond is a Unit enum value - UnitCountPerSecond = "COUNT_PER_SECOND" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go b/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go deleted file mode 100644 index 7621ae6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go +++ /dev/null @@ -1,25 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package emr - -const ( - - // ErrCodeInternalServerError for service response error code - // "InternalServerError". - // - // Indicates that an error occurred while processing the request and that the - // request was not completed. - ErrCodeInternalServerError = "InternalServerError" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // This exception occurs when there is an internal failure in the EMR service. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeInvalidRequestException for service response error code - // "InvalidRequestException". - // - // This exception occurs when there is something wrong with user input. - ErrCodeInvalidRequestException = "InvalidRequestException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/emr/service.go b/vendor/github.com/aws/aws-sdk-go/service/emr/service.go deleted file mode 100644 index 610c465..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/service.go +++ /dev/null @@ -1,96 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package emr - -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 EMR is a web service that makes it easy to process large amounts of -// data efficiently. Amazon EMR uses Hadoop processing combined with several -// AWS products to do tasks such as web indexing, data mining, log file analysis, -// machine learning, scientific simulation, and data warehousing. -// 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/elasticmapreduce-2009-03-31 -type EMR 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 = "elasticmapreduce" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the EMR 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 EMR client from just a session. -// svc := emr.New(mySession) -// -// // Create a EMR client with additional configuration -// svc := emr.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *EMR { - 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) *EMR { - svc := &EMR{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2009-03-31", - JSONVersion: "1.1", - TargetPrefix: "ElasticMapReduce", - }, - 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 EMR operation and runs any -// custom request initialization. -func (c *EMR) 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/emr/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/emr/waiters.go deleted file mode 100644 index 443240d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/waiters.go +++ /dev/null @@ -1,130 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package emr - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilClusterRunning uses the Amazon EMR API operation -// DescribeCluster 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 *EMR) WaitUntilClusterRunning(input *DescribeClusterInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCluster", - Delay: 30, - MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "Cluster.Status.State", - Expected: "RUNNING", - }, - { - State: "success", - Matcher: "path", - Argument: "Cluster.Status.State", - Expected: "WAITING", - }, - { - State: "failure", - Matcher: "path", - Argument: "Cluster.Status.State", - Expected: "TERMINATING", - }, - { - State: "failure", - Matcher: "path", - Argument: "Cluster.Status.State", - Expected: "TERMINATED", - }, - { - State: "failure", - Matcher: "path", - Argument: "Cluster.Status.State", - Expected: "TERMINATED_WITH_ERRORS", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilClusterTerminated uses the Amazon EMR API operation -// DescribeCluster 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 *EMR) WaitUntilClusterTerminated(input *DescribeClusterInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeCluster", - Delay: 30, - MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "Cluster.Status.State", - Expected: "TERMINATED", - }, - { - State: "failure", - Matcher: "path", - Argument: "Cluster.Status.State", - Expected: "TERMINATED_WITH_ERRORS", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilStepComplete uses the Amazon EMR API operation -// DescribeStep 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 *EMR) WaitUntilStepComplete(input *DescribeStepInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeStep", - Delay: 30, - MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "Step.Status.State", - Expected: "COMPLETED", - }, - { - State: "failure", - Matcher: "path", - Argument: "Step.Status.State", - Expected: "FAILED", - }, - { - State: "failure", - Matcher: "path", - Argument: "Step.Status.State", - Expected: "CANCELLED", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go b/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go deleted file mode 100644 index b22bb85..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go +++ /dev/null @@ -1,3991 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package firehose provides a client for Amazon Kinesis Firehose. -package firehose - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opCreateDeliveryStream = "CreateDeliveryStream" - -// CreateDeliveryStreamRequest generates a "aws/request.Request" representing the -// client's request for the CreateDeliveryStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDeliveryStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDeliveryStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDeliveryStreamRequest method. -// req, resp := client.CreateDeliveryStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/CreateDeliveryStream -func (c *Firehose) CreateDeliveryStreamRequest(input *CreateDeliveryStreamInput) (req *request.Request, output *CreateDeliveryStreamOutput) { - op := &request.Operation{ - Name: opCreateDeliveryStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDeliveryStreamInput{} - } - - output = &CreateDeliveryStreamOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDeliveryStream API operation for Amazon Kinesis Firehose. -// -// Creates a delivery stream. -// -// By default, you can create up to 20 delivery streams per region. -// -// This is an asynchronous operation that immediately returns. The initial status -// of the delivery stream is CREATING. After the delivery stream is created, -// its status is ACTIVE and it now accepts data. Attempts to send data to a -// delivery stream that is not in the ACTIVE state cause an exception. To check -// the state of a delivery stream, use DescribeDeliveryStream. -// -// A delivery stream is configured with a single destination: Amazon S3, Amazon -// Elasticsearch Service, or Amazon Redshift. You must specify only one of the -// following destination configuration parameters: ExtendedS3DestinationConfiguration, -// S3DestinationConfiguration, ElasticsearchDestinationConfiguration, or RedshiftDestinationConfiguration. -// -// When you specify S3DestinationConfiguration, you can also provide the following -// optional values: BufferingHints, EncryptionConfiguration, and CompressionFormat. -// By default, if no BufferingHints value is provided, Firehose buffers data -// up to 5 MB or for 5 minutes, whichever condition is satisfied first. Note -// that BufferingHints is a hint, so there are some cases where the service -// cannot adhere to these conditions strictly; for example, record boundaries -// are such that the size is a little over or under the configured buffering -// size. By default, no encryption is performed. We strongly recommend that -// you enable encryption to ensure secure data storage in Amazon S3. -// -// A few notes about Amazon Redshift as a destination: -// -// * An Amazon Redshift destination requires an S3 bucket as intermediate -// location, as Firehose first delivers data to S3 and then uses COPY syntax -// to load data into an Amazon Redshift table. This is specified in the RedshiftDestinationConfiguration.S3Configuration -// parameter. -// -// * The compression formats SNAPPY or ZIP cannot be specified in RedshiftDestinationConfiguration.S3Configuration -// because the Amazon Redshift COPY operation that reads from the S3 bucket -// doesn't support these compression formats. -// -// * We strongly recommend that you use the user name and password you provide -// exclusively with Firehose, and that the permissions for the account are -// restricted for Amazon Redshift INSERT permissions. -// -// Firehose assumes the IAM role that is configured as part of the destination. -// The role should allow the Firehose principal to assume the role, and the -// role should have permissions that allows the service to deliver the data. -// For more information, see Amazon S3 Bucket Access (http://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) -// in the Amazon Kinesis Firehose 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 Kinesis Firehose's -// API operation CreateDeliveryStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// The specified input parameter has an value that is not valid. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// You have already reached the limit for a requested resource. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is already in use and not available for this operation. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/CreateDeliveryStream -func (c *Firehose) CreateDeliveryStream(input *CreateDeliveryStreamInput) (*CreateDeliveryStreamOutput, error) { - req, out := c.CreateDeliveryStreamRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDeliveryStream = "DeleteDeliveryStream" - -// DeleteDeliveryStreamRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDeliveryStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDeliveryStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDeliveryStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDeliveryStreamRequest method. -// req, resp := client.DeleteDeliveryStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DeleteDeliveryStream -func (c *Firehose) DeleteDeliveryStreamRequest(input *DeleteDeliveryStreamInput) (req *request.Request, output *DeleteDeliveryStreamOutput) { - op := &request.Operation{ - Name: opDeleteDeliveryStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDeliveryStreamInput{} - } - - output = &DeleteDeliveryStreamOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDeliveryStream API operation for Amazon Kinesis Firehose. -// -// Deletes a delivery stream and its data. -// -// You can delete a delivery stream only if it is in ACTIVE or DELETING state, -// and not in the CREATING state. While the deletion request is in process, -// the delivery stream is in the DELETING state. -// -// To check the state of a delivery stream, use DescribeDeliveryStream. -// -// While the delivery stream is DELETING state, the service may continue to -// accept the records, but the service doesn't make any guarantees with respect -// to delivering the data. Therefore, as a best practice, you should first stop -// any applications that are sending records before deleting a delivery 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 Firehose's -// API operation DeleteDeliveryStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is already in use and not available for this operation. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DeleteDeliveryStream -func (c *Firehose) DeleteDeliveryStream(input *DeleteDeliveryStreamInput) (*DeleteDeliveryStreamOutput, error) { - req, out := c.DeleteDeliveryStreamRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDeliveryStream = "DescribeDeliveryStream" - -// DescribeDeliveryStreamRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDeliveryStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDeliveryStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDeliveryStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDeliveryStreamRequest method. -// req, resp := client.DescribeDeliveryStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DescribeDeliveryStream -func (c *Firehose) DescribeDeliveryStreamRequest(input *DescribeDeliveryStreamInput) (req *request.Request, output *DescribeDeliveryStreamOutput) { - op := &request.Operation{ - Name: opDescribeDeliveryStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDeliveryStreamInput{} - } - - output = &DescribeDeliveryStreamOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDeliveryStream API operation for Amazon Kinesis Firehose. -// -// Describes the specified delivery stream and gets the status. For example, -// after your delivery stream is created, call DescribeDeliveryStream to see -// if the delivery stream is ACTIVE and therefore ready for data to be sent -// 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 Kinesis Firehose's -// API operation DescribeDeliveryStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DescribeDeliveryStream -func (c *Firehose) DescribeDeliveryStream(input *DescribeDeliveryStreamInput) (*DescribeDeliveryStreamOutput, error) { - req, out := c.DescribeDeliveryStreamRequest(input) - err := req.Send() - return out, err -} - -const opListDeliveryStreams = "ListDeliveryStreams" - -// ListDeliveryStreamsRequest generates a "aws/request.Request" representing the -// client's request for the ListDeliveryStreams operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDeliveryStreams for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDeliveryStreams method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDeliveryStreamsRequest method. -// req, resp := client.ListDeliveryStreamsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ListDeliveryStreams -func (c *Firehose) ListDeliveryStreamsRequest(input *ListDeliveryStreamsInput) (req *request.Request, output *ListDeliveryStreamsOutput) { - op := &request.Operation{ - Name: opListDeliveryStreams, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListDeliveryStreamsInput{} - } - - output = &ListDeliveryStreamsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeliveryStreams API operation for Amazon Kinesis Firehose. -// -// Lists your delivery streams. -// -// The number of delivery streams might be too large to return using a single -// call to ListDeliveryStreams. You can limit the number of delivery streams -// returned, using the Limit parameter. To determine whether there are more -// delivery streams to list, check the value of HasMoreDeliveryStreams in the -// output. If there are more delivery streams to list, you can request them -// by specifying the name of the last delivery stream returned in the call in -// the ExclusiveStartDeliveryStreamName parameter of a subsequent 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 Kinesis Firehose's -// API operation ListDeliveryStreams for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ListDeliveryStreams -func (c *Firehose) ListDeliveryStreams(input *ListDeliveryStreamsInput) (*ListDeliveryStreamsOutput, error) { - req, out := c.ListDeliveryStreamsRequest(input) - err := req.Send() - return out, err -} - -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/firehose-2015-08-04/PutRecord -func (c *Firehose) 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 Firehose. -// -// Writes a single data record into an Amazon Kinesis Firehose delivery stream. -// To write multiple data records into a delivery stream, use PutRecordBatch. -// Applications using these operations are referred to as producers. -// -// By default, each delivery stream can take in up to 2,000 transactions per -// second, 5,000 records per second, or 5 MB per second. Note that if you use -// PutRecord and PutRecordBatch, the limits are an aggregate across these two -// operations for each delivery stream. For more information about limits and -// how to request an increase, see Amazon Kinesis Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). -// -// You must specify the name of the delivery stream and the data record when -// using PutRecord. The data record consists of a data blob that can be up to -// 1,000 KB in size, and any kind of data, for example, a segment from a log -// file, geographic location data, web site clickstream data, etc. -// -// Firehose buffers records before delivering them to the destination. To disambiguate -// the data blobs at the destination, a common solution is to use delimiters -// in the data, such as a newline (\n) or some other character unique within -// the data. This allows the consumer application(s) to parse individual data -// items when reading the data from the destination. -// -// The PutRecord operation returns a RecordId, which is a unique string assigned -// to each record. Producer applications can use this ID for purposes such as -// auditability and investigation. -// -// If the PutRecord operation throws a ServiceUnavailableException, back off -// and retry. If the exception persists, it is possible that the throughput -// limits have been exceeded for the delivery stream. -// -// Data records sent to Firehose are stored for 24 hours from the time they -// are added to a delivery stream as it attempts to send the records to the -// destination. If the destination is unreachable for more than 24 hours, the -// data is no longer available. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Firehose's -// API operation PutRecord for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// The specified input parameter has an value that is not valid. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service is unavailable, back off and retry the operation. If you continue -// to see the exception, throughput limits for the delivery stream may have -// been exceeded. For more information about limits and how to request an increase, -// see Amazon Kinesis Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecord -func (c *Firehose) PutRecord(input *PutRecordInput) (*PutRecordOutput, error) { - req, out := c.PutRecordRequest(input) - err := req.Send() - return out, err -} - -const opPutRecordBatch = "PutRecordBatch" - -// PutRecordBatchRequest generates a "aws/request.Request" representing the -// client's request for the PutRecordBatch operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutRecordBatch for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutRecordBatch method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutRecordBatchRequest method. -// req, resp := client.PutRecordBatchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordBatch -func (c *Firehose) PutRecordBatchRequest(input *PutRecordBatchInput) (req *request.Request, output *PutRecordBatchOutput) { - op := &request.Operation{ - Name: opPutRecordBatch, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutRecordBatchInput{} - } - - output = &PutRecordBatchOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutRecordBatch API operation for Amazon Kinesis Firehose. -// -// Writes multiple data records into a delivery stream in a single call, which -// can achieve higher throughput per producer than when writing single records. -// To write single data records into a delivery stream, use PutRecord. Applications -// using these operations are referred to as producers. -// -// By default, each delivery stream can take in up to 2,000 transactions per -// second, 5,000 records per second, or 5 MB per second. Note that if you use -// PutRecord and PutRecordBatch, the limits are an aggregate across these two -// operations for each delivery stream. For more information about limits, see -// Amazon Kinesis Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). -// -// Each PutRecordBatch request supports up to 500 records. Each record in the -// request can be as large as 1,000 KB (before 64-bit encoding), up to a limit -// of 4 MB for the entire request. These limits cannot be changed. -// -// You must specify the name of the delivery stream and the data record when -// using PutRecord. The data record consists of a data blob that can be up to -// 1,000 KB in size, and any kind of data, for example, a segment from a log -// file, geographic location data, web site clickstream data, and so on. -// -// Firehose buffers records before delivering them to the destination. To disambiguate -// the data blobs at the destination, a common solution is to use delimiters -// in the data, such as a newline (\n) or some other character unique within -// the data. This allows the consumer application(s) to parse individual data -// items when reading the data from the destination. -// -// The PutRecordBatch response includes a count of failed records, FailedPutCount, -// and an array of responses, RequestResponses. Each entry in the RequestResponses -// array provides additional information about the processed record, and directly -// correlates with a record in the request array using the same ordering, from -// the top to the bottom. The response array always includes the same number -// of records as the request array. RequestResponses includes both successfully -// and unsuccessfully processed records. Firehose attempts to process all records -// in each PutRecordBatch request. A single record failure does not stop the -// processing of subsequent records. -// -// A successfully processed record includes a RecordId value, which is unique -// for the record. An unsuccessfully processed record includes ErrorCode and -// ErrorMessage values. ErrorCode reflects the type of error, and is one of -// the following values: ServiceUnavailable or InternalFailure. ErrorMessage -// provides more detailed information about the error. -// -// If there is an internal server error or a timeout, the write might have completed -// or it might have failed. If FailedPutCount is greater than 0, retry the request, -// resending only those records that might have failed processing. This minimizes -// the possible duplicate records and also reduces the total bytes sent (and -// corresponding charges). We recommend that you handle any duplicates at the -// destination. -// -// If PutRecordBatch throws ServiceUnavailableException, back off and retry. -// If the exception persists, it is possible that the throughput limits have -// been exceeded for the delivery stream. -// -// Data records sent to Firehose are stored for 24 hours from the time they -// are added to a delivery stream as it attempts to send the records to the -// destination. If the destination is unreachable for more than 24 hours, the -// data is no longer available. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Firehose's -// API operation PutRecordBatch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// The specified input parameter has an value that is not valid. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service is unavailable, back off and retry the operation. If you continue -// to see the exception, throughput limits for the delivery stream may have -// been exceeded. For more information about limits and how to request an increase, -// see Amazon Kinesis Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordBatch -func (c *Firehose) PutRecordBatch(input *PutRecordBatchInput) (*PutRecordBatchOutput, error) { - req, out := c.PutRecordBatchRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDestination = "UpdateDestination" - -// UpdateDestinationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDestination operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDestination for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDestination method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDestinationRequest method. -// req, resp := client.UpdateDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/UpdateDestination -func (c *Firehose) UpdateDestinationRequest(input *UpdateDestinationInput) (req *request.Request, output *UpdateDestinationOutput) { - op := &request.Operation{ - Name: opUpdateDestination, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateDestinationInput{} - } - - output = &UpdateDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDestination API operation for Amazon Kinesis Firehose. -// -// Updates the specified destination of the specified delivery stream. -// -// You can use this operation to change the destination type (for example, to -// replace the Amazon S3 destination with Amazon Redshift) or change the parameters -// associated with a destination (for example, to change the bucket name of -// the Amazon S3 destination). The update might not occur immediately. The target -// delivery stream remains active while the configurations are updated, so data -// writes to the delivery stream can continue during this process. The updated -// configurations are usually effective within a few minutes. -// -// Note that switching between Amazon ES and other services is not supported. -// For an Amazon ES destination, you can only update to another Amazon ES destination. -// -// If the destination type is the same, Firehose merges the configuration parameters -// specified with the destination configuration that already exists on the delivery -// stream. If any of the parameters are not specified in the call, the existing -// values are retained. For example, in the Amazon S3 destination, if EncryptionConfiguration -// is not specified then the existing EncryptionConfiguration is maintained -// on the destination. -// -// If the destination type is not the same, for example, changing the destination -// from Amazon S3 to Amazon Redshift, Firehose does not merge any parameters. -// In this case, all parameters must be specified. -// -// Firehose uses CurrentDeliveryStreamVersionId to avoid race conditions and -// conflicting merges. This is a required field, and the service updates the -// configuration only if the existing configuration has a version ID that matches. -// After the update is applied successfully, the version ID is updated, and -// can be retrieved using DescribeDeliveryStream. You should use the new version -// ID to set CurrentDeliveryStreamVersionId in the next 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 Kinesis Firehose's -// API operation UpdateDestination for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// The specified input parameter has an value that is not valid. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is already in use and not available for this operation. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. -// -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// Another modification has already happened. Fetch VersionId again and use -// it to update the destination. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/UpdateDestination -func (c *Firehose) UpdateDestination(input *UpdateDestinationInput) (*UpdateDestinationOutput, error) { - req, out := c.UpdateDestinationRequest(input) - err := req.Send() - return out, err -} - -// Describes hints for the buffering to perform before delivering data to the -// destination. Please note that these options are treated as hints, and therefore -// Firehose may choose to use different values when it is optimal. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/BufferingHints -type BufferingHints struct { - _ struct{} `type:"structure"` - - // Buffer incoming data for the specified period of time, in seconds, before - // delivering it to the destination. The default value is 300. - IntervalInSeconds *int64 `min:"60" type:"integer"` - - // Buffer incoming data to the specified size, in MBs, before delivering it - // to the destination. The default value is 5. - // - // We recommend setting this parameter to a value greater than the amount of - // data you typically ingest into the delivery stream in 10 seconds. For example, - // if you typically ingest data at 1 MB/sec, the value should be 10 MB or higher. - SizeInMBs *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s BufferingHints) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BufferingHints) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BufferingHints) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BufferingHints"} - if s.IntervalInSeconds != nil && *s.IntervalInSeconds < 60 { - invalidParams.Add(request.NewErrParamMinValue("IntervalInSeconds", 60)) - } - if s.SizeInMBs != nil && *s.SizeInMBs < 1 { - invalidParams.Add(request.NewErrParamMinValue("SizeInMBs", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIntervalInSeconds sets the IntervalInSeconds field's value. -func (s *BufferingHints) SetIntervalInSeconds(v int64) *BufferingHints { - s.IntervalInSeconds = &v - return s -} - -// SetSizeInMBs sets the SizeInMBs field's value. -func (s *BufferingHints) SetSizeInMBs(v int64) *BufferingHints { - s.SizeInMBs = &v - return s -} - -// Describes the CloudWatch logging options for your delivery stream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/CloudWatchLoggingOptions -type CloudWatchLoggingOptions struct { - _ struct{} `type:"structure"` - - // Enables or disables CloudWatch logging. - Enabled *bool `type:"boolean"` - - // The CloudWatch group name for logging. This value is required if CloudWatch - // logging is enabled. - LogGroupName *string `type:"string"` - - // The CloudWatch log stream name for logging. This value is required if CloudWatch - // logging is enabled. - LogStreamName *string `type:"string"` -} - -// String returns the string representation -func (s CloudWatchLoggingOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloudWatchLoggingOptions) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *CloudWatchLoggingOptions) SetEnabled(v bool) *CloudWatchLoggingOptions { - s.Enabled = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CloudWatchLoggingOptions) SetLogGroupName(v string) *CloudWatchLoggingOptions { - s.LogGroupName = &v - return s -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *CloudWatchLoggingOptions) SetLogStreamName(v string) *CloudWatchLoggingOptions { - s.LogStreamName = &v - return s -} - -// Describes a COPY command for Amazon Redshift. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/CopyCommand -type CopyCommand struct { - _ struct{} `type:"structure"` - - // Optional parameters to use with the Amazon Redshift COPY command. For more - // information, see the "Optional Parameters" section of Amazon Redshift COPY - // command (http://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html). Some - // possible examples that would apply to Firehose are as follows: - // - // delimiter '\t' lzop; - fields are delimited with "\t" (TAB character) and - // compressed using lzop. - // - // delimiter '| - fields are delimited with "|" (this is the default delimiter). - // - // delimiter '|' escape - the delimiter should be escaped. - // - // fixedwidth 'venueid:3,venuename:25,venuecity:12,venuestate:2,venueseats:6' - // - fields are fixed width in the source, with each width specified after every - // column in the table. - // - // JSON 's3://mybucket/jsonpaths.txt' - data is in JSON format, and the path - // specified is the format of the data. - // - // For more examples, see Amazon Redshift COPY command examples (http://docs.aws.amazon.com/redshift/latest/dg/r_COPY_command_examples.html). - CopyOptions *string `type:"string"` - - // A comma-separated list of column names. - DataTableColumns *string `type:"string"` - - // The name of the target table. The table must already exist in the database. - // - // DataTableName is a required field - DataTableName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyCommand) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyCommand) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyCommand) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyCommand"} - if s.DataTableName == nil { - invalidParams.Add(request.NewErrParamRequired("DataTableName")) - } - if s.DataTableName != nil && len(*s.DataTableName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataTableName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCopyOptions sets the CopyOptions field's value. -func (s *CopyCommand) SetCopyOptions(v string) *CopyCommand { - s.CopyOptions = &v - return s -} - -// SetDataTableColumns sets the DataTableColumns field's value. -func (s *CopyCommand) SetDataTableColumns(v string) *CopyCommand { - s.DataTableColumns = &v - return s -} - -// SetDataTableName sets the DataTableName field's value. -func (s *CopyCommand) SetDataTableName(v string) *CopyCommand { - s.DataTableName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/CreateDeliveryStreamInput -type CreateDeliveryStreamInput struct { - _ struct{} `type:"structure"` - - // The name of the delivery stream. This name must be unique per AWS account - // in the same region. You can have multiple delivery streams with the same - // name if they are in different accounts or different regions. - // - // DeliveryStreamName is a required field - DeliveryStreamName *string `min:"1" type:"string" required:"true"` - - // The destination in Amazon ES. You can specify only one destination. - ElasticsearchDestinationConfiguration *ElasticsearchDestinationConfiguration `type:"structure"` - - // The destination in Amazon S3. You can specify only one destination. - ExtendedS3DestinationConfiguration *ExtendedS3DestinationConfiguration `type:"structure"` - - // The destination in Amazon Redshift. You can specify only one destination. - RedshiftDestinationConfiguration *RedshiftDestinationConfiguration `type:"structure"` - - // [Deprecated] The destination in Amazon S3. You can specify only one destination. - S3DestinationConfiguration *S3DestinationConfiguration `deprecated:"true" type:"structure"` -} - -// String returns the string representation -func (s CreateDeliveryStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeliveryStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDeliveryStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDeliveryStreamInput"} - if s.DeliveryStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryStreamName")) - } - if s.DeliveryStreamName != nil && len(*s.DeliveryStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryStreamName", 1)) - } - if s.ElasticsearchDestinationConfiguration != nil { - if err := s.ElasticsearchDestinationConfiguration.Validate(); err != nil { - invalidParams.AddNested("ElasticsearchDestinationConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ExtendedS3DestinationConfiguration != nil { - if err := s.ExtendedS3DestinationConfiguration.Validate(); err != nil { - invalidParams.AddNested("ExtendedS3DestinationConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.RedshiftDestinationConfiguration != nil { - if err := s.RedshiftDestinationConfiguration.Validate(); err != nil { - invalidParams.AddNested("RedshiftDestinationConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.S3DestinationConfiguration != nil { - if err := s.S3DestinationConfiguration.Validate(); err != nil { - invalidParams.AddNested("S3DestinationConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryStreamName sets the DeliveryStreamName field's value. -func (s *CreateDeliveryStreamInput) SetDeliveryStreamName(v string) *CreateDeliveryStreamInput { - s.DeliveryStreamName = &v - return s -} - -// SetElasticsearchDestinationConfiguration sets the ElasticsearchDestinationConfiguration field's value. -func (s *CreateDeliveryStreamInput) SetElasticsearchDestinationConfiguration(v *ElasticsearchDestinationConfiguration) *CreateDeliveryStreamInput { - s.ElasticsearchDestinationConfiguration = v - return s -} - -// SetExtendedS3DestinationConfiguration sets the ExtendedS3DestinationConfiguration field's value. -func (s *CreateDeliveryStreamInput) SetExtendedS3DestinationConfiguration(v *ExtendedS3DestinationConfiguration) *CreateDeliveryStreamInput { - s.ExtendedS3DestinationConfiguration = v - return s -} - -// SetRedshiftDestinationConfiguration sets the RedshiftDestinationConfiguration field's value. -func (s *CreateDeliveryStreamInput) SetRedshiftDestinationConfiguration(v *RedshiftDestinationConfiguration) *CreateDeliveryStreamInput { - s.RedshiftDestinationConfiguration = v - return s -} - -// SetS3DestinationConfiguration sets the S3DestinationConfiguration field's value. -func (s *CreateDeliveryStreamInput) SetS3DestinationConfiguration(v *S3DestinationConfiguration) *CreateDeliveryStreamInput { - s.S3DestinationConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/CreateDeliveryStreamOutput -type CreateDeliveryStreamOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the delivery stream. - DeliveryStreamARN *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateDeliveryStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeliveryStreamOutput) GoString() string { - return s.String() -} - -// SetDeliveryStreamARN sets the DeliveryStreamARN field's value. -func (s *CreateDeliveryStreamOutput) SetDeliveryStreamARN(v string) *CreateDeliveryStreamOutput { - s.DeliveryStreamARN = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DeleteDeliveryStreamInput -type DeleteDeliveryStreamInput struct { - _ struct{} `type:"structure"` - - // The name of the delivery stream. - // - // DeliveryStreamName is a required field - DeliveryStreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDeliveryStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeliveryStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDeliveryStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDeliveryStreamInput"} - if s.DeliveryStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryStreamName")) - } - if s.DeliveryStreamName != nil && len(*s.DeliveryStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryStreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryStreamName sets the DeliveryStreamName field's value. -func (s *DeleteDeliveryStreamInput) SetDeliveryStreamName(v string) *DeleteDeliveryStreamInput { - s.DeliveryStreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DeleteDeliveryStreamOutput -type DeleteDeliveryStreamOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDeliveryStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeliveryStreamOutput) GoString() string { - return s.String() -} - -// Contains information about a delivery stream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DeliveryStreamDescription -type DeliveryStreamDescription struct { - _ struct{} `type:"structure"` - - // The date and time that the delivery stream was created. - CreateTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The Amazon Resource Name (ARN) of the delivery stream. - // - // DeliveryStreamARN is a required field - DeliveryStreamARN *string `min:"1" type:"string" required:"true"` - - // The name of the delivery stream. - // - // DeliveryStreamName is a required field - DeliveryStreamName *string `min:"1" type:"string" required:"true"` - - // The status of the delivery stream. - // - // DeliveryStreamStatus is a required field - DeliveryStreamStatus *string `type:"string" required:"true" enum:"DeliveryStreamStatus"` - - // The destinations. - // - // Destinations is a required field - Destinations []*DestinationDescription `type:"list" required:"true"` - - // Indicates whether there are more destinations available to list. - // - // HasMoreDestinations is a required field - HasMoreDestinations *bool `type:"boolean" required:"true"` - - // The date and time that the delivery stream was last updated. - LastUpdateTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Each time the destination is updated for a delivery stream, the version ID - // is changed, and the current version ID is required when updating the destination. - // This is so that the service knows it is applying the changes to the correct - // version of the delivery stream. - // - // VersionId is a required field - VersionId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeliveryStreamDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeliveryStreamDescription) GoString() string { - return s.String() -} - -// SetCreateTimestamp sets the CreateTimestamp field's value. -func (s *DeliveryStreamDescription) SetCreateTimestamp(v time.Time) *DeliveryStreamDescription { - s.CreateTimestamp = &v - return s -} - -// SetDeliveryStreamARN sets the DeliveryStreamARN field's value. -func (s *DeliveryStreamDescription) SetDeliveryStreamARN(v string) *DeliveryStreamDescription { - s.DeliveryStreamARN = &v - return s -} - -// SetDeliveryStreamName sets the DeliveryStreamName field's value. -func (s *DeliveryStreamDescription) SetDeliveryStreamName(v string) *DeliveryStreamDescription { - s.DeliveryStreamName = &v - return s -} - -// SetDeliveryStreamStatus sets the DeliveryStreamStatus field's value. -func (s *DeliveryStreamDescription) SetDeliveryStreamStatus(v string) *DeliveryStreamDescription { - s.DeliveryStreamStatus = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *DeliveryStreamDescription) SetDestinations(v []*DestinationDescription) *DeliveryStreamDescription { - s.Destinations = v - return s -} - -// SetHasMoreDestinations sets the HasMoreDestinations field's value. -func (s *DeliveryStreamDescription) SetHasMoreDestinations(v bool) *DeliveryStreamDescription { - s.HasMoreDestinations = &v - return s -} - -// SetLastUpdateTimestamp sets the LastUpdateTimestamp field's value. -func (s *DeliveryStreamDescription) SetLastUpdateTimestamp(v time.Time) *DeliveryStreamDescription { - s.LastUpdateTimestamp = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeliveryStreamDescription) SetVersionId(v string) *DeliveryStreamDescription { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DescribeDeliveryStreamInput -type DescribeDeliveryStreamInput struct { - _ struct{} `type:"structure"` - - // The name of the delivery stream. - // - // DeliveryStreamName is a required field - DeliveryStreamName *string `min:"1" type:"string" required:"true"` - - // The ID of the destination to start returning the destination information. - // Currently Firehose supports one destination per delivery stream. - ExclusiveStartDestinationId *string `min:"1" type:"string"` - - // The limit on the number of destinations to return. Currently, you can have - // one destination per delivery stream. - Limit *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s DescribeDeliveryStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeliveryStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDeliveryStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDeliveryStreamInput"} - if s.DeliveryStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryStreamName")) - } - if s.DeliveryStreamName != nil && len(*s.DeliveryStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryStreamName", 1)) - } - if s.ExclusiveStartDestinationId != nil && len(*s.ExclusiveStartDestinationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartDestinationId", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryStreamName sets the DeliveryStreamName field's value. -func (s *DescribeDeliveryStreamInput) SetDeliveryStreamName(v string) *DescribeDeliveryStreamInput { - s.DeliveryStreamName = &v - return s -} - -// SetExclusiveStartDestinationId sets the ExclusiveStartDestinationId field's value. -func (s *DescribeDeliveryStreamInput) SetExclusiveStartDestinationId(v string) *DescribeDeliveryStreamInput { - s.ExclusiveStartDestinationId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeDeliveryStreamInput) SetLimit(v int64) *DescribeDeliveryStreamInput { - s.Limit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DescribeDeliveryStreamOutput -type DescribeDeliveryStreamOutput struct { - _ struct{} `type:"structure"` - - // Information about the delivery stream. - // - // DeliveryStreamDescription is a required field - DeliveryStreamDescription *DeliveryStreamDescription `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DescribeDeliveryStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeliveryStreamOutput) GoString() string { - return s.String() -} - -// SetDeliveryStreamDescription sets the DeliveryStreamDescription field's value. -func (s *DescribeDeliveryStreamOutput) SetDeliveryStreamDescription(v *DeliveryStreamDescription) *DescribeDeliveryStreamOutput { - s.DeliveryStreamDescription = v - return s -} - -// Describes the destination for a delivery stream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DestinationDescription -type DestinationDescription struct { - _ struct{} `type:"structure"` - - // The ID of the destination. - // - // DestinationId is a required field - DestinationId *string `min:"1" type:"string" required:"true"` - - // The destination in Amazon ES. - ElasticsearchDestinationDescription *ElasticsearchDestinationDescription `type:"structure"` - - // The destination in Amazon S3. - ExtendedS3DestinationDescription *ExtendedS3DestinationDescription `type:"structure"` - - // The destination in Amazon Redshift. - RedshiftDestinationDescription *RedshiftDestinationDescription `type:"structure"` - - // [Deprecated] The destination in Amazon S3. - S3DestinationDescription *S3DestinationDescription `type:"structure"` -} - -// String returns the string representation -func (s DestinationDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DestinationDescription) GoString() string { - return s.String() -} - -// SetDestinationId sets the DestinationId field's value. -func (s *DestinationDescription) SetDestinationId(v string) *DestinationDescription { - s.DestinationId = &v - return s -} - -// SetElasticsearchDestinationDescription sets the ElasticsearchDestinationDescription field's value. -func (s *DestinationDescription) SetElasticsearchDestinationDescription(v *ElasticsearchDestinationDescription) *DestinationDescription { - s.ElasticsearchDestinationDescription = v - return s -} - -// SetExtendedS3DestinationDescription sets the ExtendedS3DestinationDescription field's value. -func (s *DestinationDescription) SetExtendedS3DestinationDescription(v *ExtendedS3DestinationDescription) *DestinationDescription { - s.ExtendedS3DestinationDescription = v - return s -} - -// SetRedshiftDestinationDescription sets the RedshiftDestinationDescription field's value. -func (s *DestinationDescription) SetRedshiftDestinationDescription(v *RedshiftDestinationDescription) *DestinationDescription { - s.RedshiftDestinationDescription = v - return s -} - -// SetS3DestinationDescription sets the S3DestinationDescription field's value. -func (s *DestinationDescription) SetS3DestinationDescription(v *S3DestinationDescription) *DestinationDescription { - s.S3DestinationDescription = v - return s -} - -// Describes the buffering to perform before delivering data to the Amazon ES -// destination. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ElasticsearchBufferingHints -type ElasticsearchBufferingHints struct { - _ struct{} `type:"structure"` - - // Buffer incoming data for the specified period of time, in seconds, before - // delivering it to the destination. The default value is 300 (5 minutes). - IntervalInSeconds *int64 `min:"60" type:"integer"` - - // Buffer incoming data to the specified size, in MBs, before delivering it - // to the destination. The default value is 5. - // - // We recommend setting this parameter to a value greater than the amount of - // data you typically ingest into the delivery stream in 10 seconds. For example, - // if you typically ingest data at 1 MB/sec, the value should be 10 MB or higher. - SizeInMBs *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ElasticsearchBufferingHints) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchBufferingHints) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ElasticsearchBufferingHints) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ElasticsearchBufferingHints"} - if s.IntervalInSeconds != nil && *s.IntervalInSeconds < 60 { - invalidParams.Add(request.NewErrParamMinValue("IntervalInSeconds", 60)) - } - if s.SizeInMBs != nil && *s.SizeInMBs < 1 { - invalidParams.Add(request.NewErrParamMinValue("SizeInMBs", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIntervalInSeconds sets the IntervalInSeconds field's value. -func (s *ElasticsearchBufferingHints) SetIntervalInSeconds(v int64) *ElasticsearchBufferingHints { - s.IntervalInSeconds = &v - return s -} - -// SetSizeInMBs sets the SizeInMBs field's value. -func (s *ElasticsearchBufferingHints) SetSizeInMBs(v int64) *ElasticsearchBufferingHints { - s.SizeInMBs = &v - return s -} - -// Describes the configuration of a destination in Amazon ES. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ElasticsearchDestinationConfiguration -type ElasticsearchDestinationConfiguration struct { - _ struct{} `type:"structure"` - - // The buffering options. If no value is specified, the default values for ElasticsearchBufferingHints - // are used. - BufferingHints *ElasticsearchBufferingHints `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The ARN of the Amazon ES domain. The IAM role must have permissions for DescribeElasticsearchDomain, - // DescribeElasticsearchDomains, and DescribeElasticsearchDomainConfig after - // assuming the role specified in RoleARN. - // - // DomainARN is a required field - DomainARN *string `min:"1" type:"string" required:"true"` - - // The Elasticsearch index name. - // - // IndexName is a required field - IndexName *string `min:"1" type:"string" required:"true"` - - // The Elasticsearch index rotation period. Index rotation appends a timestamp - // to the IndexName to facilitate expiration of old data. For more information, - // see Index Rotation for Amazon Elasticsearch Service Destination (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation). - // The default value is OneDay. - IndexRotationPeriod *string `type:"string" enum:"ElasticsearchIndexRotationPeriod"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The retry behavior in the event that Firehose is unable to deliver documents - // to Amazon ES. The default value is 300 (5 minutes). - RetryOptions *ElasticsearchRetryOptions `type:"structure"` - - // The ARN of the IAM role to be assumed by Firehose for calling the Amazon - // ES Configuration API and for indexing documents. For more information, see - // Amazon S3 Bucket Access (http://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3). - // - // RoleARN is a required field - RoleARN *string `min:"1" type:"string" required:"true"` - - // Defines how documents should be delivered to Amazon S3. When set to FailedDocumentsOnly, - // Firehose writes any documents that could not be indexed to the configured - // Amazon S3 destination, with elasticsearch-failed/ appended to the key prefix. - // When set to AllDocuments, Firehose delivers all incoming records to Amazon - // S3, and also writes failed documents with elasticsearch-failed/ appended - // to the prefix. For more information, see Amazon S3 Backup for Amazon Elasticsearch - // Service Destination (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-s3-backup). - // Default value is FailedDocumentsOnly. - S3BackupMode *string `type:"string" enum:"ElasticsearchS3BackupMode"` - - // The configuration for the intermediate Amazon S3 location from which Amazon - // ES obtains data. - // - // S3Configuration is a required field - S3Configuration *S3DestinationConfiguration `type:"structure" required:"true"` - - // The Elasticsearch type name. - // - // TypeName is a required field - TypeName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ElasticsearchDestinationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchDestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ElasticsearchDestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ElasticsearchDestinationConfiguration"} - if s.DomainARN == nil { - invalidParams.Add(request.NewErrParamRequired("DomainARN")) - } - if s.DomainARN != nil && len(*s.DomainARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainARN", 1)) - } - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 1)) - } - if s.RoleARN == nil { - invalidParams.Add(request.NewErrParamRequired("RoleARN")) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.S3Configuration == nil { - invalidParams.Add(request.NewErrParamRequired("S3Configuration")) - } - if s.TypeName == nil { - invalidParams.Add(request.NewErrParamRequired("TypeName")) - } - if s.TypeName != nil && len(*s.TypeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeName", 1)) - } - if s.BufferingHints != nil { - if err := s.BufferingHints.Validate(); err != nil { - invalidParams.AddNested("BufferingHints", err.(request.ErrInvalidParams)) - } - } - if s.ProcessingConfiguration != nil { - if err := s.ProcessingConfiguration.Validate(); err != nil { - invalidParams.AddNested("ProcessingConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.S3Configuration != nil { - if err := s.S3Configuration.Validate(); err != nil { - invalidParams.AddNested("S3Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *ElasticsearchDestinationConfiguration) SetBufferingHints(v *ElasticsearchBufferingHints) *ElasticsearchDestinationConfiguration { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *ElasticsearchDestinationConfiguration) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *ElasticsearchDestinationConfiguration { - s.CloudWatchLoggingOptions = v - return s -} - -// SetDomainARN sets the DomainARN field's value. -func (s *ElasticsearchDestinationConfiguration) SetDomainARN(v string) *ElasticsearchDestinationConfiguration { - s.DomainARN = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *ElasticsearchDestinationConfiguration) SetIndexName(v string) *ElasticsearchDestinationConfiguration { - s.IndexName = &v - return s -} - -// SetIndexRotationPeriod sets the IndexRotationPeriod field's value. -func (s *ElasticsearchDestinationConfiguration) SetIndexRotationPeriod(v string) *ElasticsearchDestinationConfiguration { - s.IndexRotationPeriod = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *ElasticsearchDestinationConfiguration) SetProcessingConfiguration(v *ProcessingConfiguration) *ElasticsearchDestinationConfiguration { - s.ProcessingConfiguration = v - return s -} - -// SetRetryOptions sets the RetryOptions field's value. -func (s *ElasticsearchDestinationConfiguration) SetRetryOptions(v *ElasticsearchRetryOptions) *ElasticsearchDestinationConfiguration { - s.RetryOptions = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ElasticsearchDestinationConfiguration) SetRoleARN(v string) *ElasticsearchDestinationConfiguration { - s.RoleARN = &v - return s -} - -// SetS3BackupMode sets the S3BackupMode field's value. -func (s *ElasticsearchDestinationConfiguration) SetS3BackupMode(v string) *ElasticsearchDestinationConfiguration { - s.S3BackupMode = &v - return s -} - -// SetS3Configuration sets the S3Configuration field's value. -func (s *ElasticsearchDestinationConfiguration) SetS3Configuration(v *S3DestinationConfiguration) *ElasticsearchDestinationConfiguration { - s.S3Configuration = v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *ElasticsearchDestinationConfiguration) SetTypeName(v string) *ElasticsearchDestinationConfiguration { - s.TypeName = &v - return s -} - -// The destination description in Amazon ES. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ElasticsearchDestinationDescription -type ElasticsearchDestinationDescription struct { - _ struct{} `type:"structure"` - - // The buffering options. - BufferingHints *ElasticsearchBufferingHints `type:"structure"` - - // The CloudWatch logging options. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The ARN of the Amazon ES domain. - DomainARN *string `min:"1" type:"string"` - - // The Elasticsearch index name. - IndexName *string `min:"1" type:"string"` - - // The Elasticsearch index rotation period - IndexRotationPeriod *string `type:"string" enum:"ElasticsearchIndexRotationPeriod"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The Amazon ES retry options. - RetryOptions *ElasticsearchRetryOptions `type:"structure"` - - // The ARN of the AWS credentials. - RoleARN *string `min:"1" type:"string"` - - // The Amazon S3 backup mode. - S3BackupMode *string `type:"string" enum:"ElasticsearchS3BackupMode"` - - // The Amazon S3 destination. - S3DestinationDescription *S3DestinationDescription `type:"structure"` - - // The Elasticsearch type name. - TypeName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ElasticsearchDestinationDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchDestinationDescription) GoString() string { - return s.String() -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *ElasticsearchDestinationDescription) SetBufferingHints(v *ElasticsearchBufferingHints) *ElasticsearchDestinationDescription { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *ElasticsearchDestinationDescription) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *ElasticsearchDestinationDescription { - s.CloudWatchLoggingOptions = v - return s -} - -// SetDomainARN sets the DomainARN field's value. -func (s *ElasticsearchDestinationDescription) SetDomainARN(v string) *ElasticsearchDestinationDescription { - s.DomainARN = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *ElasticsearchDestinationDescription) SetIndexName(v string) *ElasticsearchDestinationDescription { - s.IndexName = &v - return s -} - -// SetIndexRotationPeriod sets the IndexRotationPeriod field's value. -func (s *ElasticsearchDestinationDescription) SetIndexRotationPeriod(v string) *ElasticsearchDestinationDescription { - s.IndexRotationPeriod = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *ElasticsearchDestinationDescription) SetProcessingConfiguration(v *ProcessingConfiguration) *ElasticsearchDestinationDescription { - s.ProcessingConfiguration = v - return s -} - -// SetRetryOptions sets the RetryOptions field's value. -func (s *ElasticsearchDestinationDescription) SetRetryOptions(v *ElasticsearchRetryOptions) *ElasticsearchDestinationDescription { - s.RetryOptions = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ElasticsearchDestinationDescription) SetRoleARN(v string) *ElasticsearchDestinationDescription { - s.RoleARN = &v - return s -} - -// SetS3BackupMode sets the S3BackupMode field's value. -func (s *ElasticsearchDestinationDescription) SetS3BackupMode(v string) *ElasticsearchDestinationDescription { - s.S3BackupMode = &v - return s -} - -// SetS3DestinationDescription sets the S3DestinationDescription field's value. -func (s *ElasticsearchDestinationDescription) SetS3DestinationDescription(v *S3DestinationDescription) *ElasticsearchDestinationDescription { - s.S3DestinationDescription = v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *ElasticsearchDestinationDescription) SetTypeName(v string) *ElasticsearchDestinationDescription { - s.TypeName = &v - return s -} - -// Describes an update for a destination in Amazon ES. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ElasticsearchDestinationUpdate -type ElasticsearchDestinationUpdate struct { - _ struct{} `type:"structure"` - - // The buffering options. If no value is specified, ElasticsearchBufferingHints - // object default values are used. - BufferingHints *ElasticsearchBufferingHints `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The ARN of the Amazon ES domain. The IAM role must have permissions for DescribeElasticsearchDomain, - // DescribeElasticsearchDomains, and DescribeElasticsearchDomainConfig after - // assuming the IAM role specified in RoleARN. - DomainARN *string `min:"1" type:"string"` - - // The Elasticsearch index name. - IndexName *string `min:"1" type:"string"` - - // The Elasticsearch index rotation period. Index rotation appends a timestamp - // to IndexName to facilitate the expiration of old data. For more information, - // see Index Rotation for Amazon Elasticsearch Service Destination (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation). - // Default value is OneDay. - IndexRotationPeriod *string `type:"string" enum:"ElasticsearchIndexRotationPeriod"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The retry behavior in the event that Firehose is unable to deliver documents - // to Amazon ES. Default value is 300 (5 minutes). - RetryOptions *ElasticsearchRetryOptions `type:"structure"` - - // The ARN of the IAM role to be assumed by Firehose for calling the Amazon - // ES Configuration API and for indexing documents. For more information, see - // Amazon S3 Bucket Access (http://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3). - RoleARN *string `min:"1" type:"string"` - - // The Amazon S3 destination. - S3Update *S3DestinationUpdate `type:"structure"` - - // The Elasticsearch type name. - TypeName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ElasticsearchDestinationUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchDestinationUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ElasticsearchDestinationUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ElasticsearchDestinationUpdate"} - if s.DomainARN != nil && len(*s.DomainARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainARN", 1)) - } - if s.IndexName != nil && len(*s.IndexName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 1)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.TypeName != nil && len(*s.TypeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeName", 1)) - } - if s.BufferingHints != nil { - if err := s.BufferingHints.Validate(); err != nil { - invalidParams.AddNested("BufferingHints", err.(request.ErrInvalidParams)) - } - } - if s.ProcessingConfiguration != nil { - if err := s.ProcessingConfiguration.Validate(); err != nil { - invalidParams.AddNested("ProcessingConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.S3Update != nil { - if err := s.S3Update.Validate(); err != nil { - invalidParams.AddNested("S3Update", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *ElasticsearchDestinationUpdate) SetBufferingHints(v *ElasticsearchBufferingHints) *ElasticsearchDestinationUpdate { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *ElasticsearchDestinationUpdate) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *ElasticsearchDestinationUpdate { - s.CloudWatchLoggingOptions = v - return s -} - -// SetDomainARN sets the DomainARN field's value. -func (s *ElasticsearchDestinationUpdate) SetDomainARN(v string) *ElasticsearchDestinationUpdate { - s.DomainARN = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *ElasticsearchDestinationUpdate) SetIndexName(v string) *ElasticsearchDestinationUpdate { - s.IndexName = &v - return s -} - -// SetIndexRotationPeriod sets the IndexRotationPeriod field's value. -func (s *ElasticsearchDestinationUpdate) SetIndexRotationPeriod(v string) *ElasticsearchDestinationUpdate { - s.IndexRotationPeriod = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *ElasticsearchDestinationUpdate) SetProcessingConfiguration(v *ProcessingConfiguration) *ElasticsearchDestinationUpdate { - s.ProcessingConfiguration = v - return s -} - -// SetRetryOptions sets the RetryOptions field's value. -func (s *ElasticsearchDestinationUpdate) SetRetryOptions(v *ElasticsearchRetryOptions) *ElasticsearchDestinationUpdate { - s.RetryOptions = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ElasticsearchDestinationUpdate) SetRoleARN(v string) *ElasticsearchDestinationUpdate { - s.RoleARN = &v - return s -} - -// SetS3Update sets the S3Update field's value. -func (s *ElasticsearchDestinationUpdate) SetS3Update(v *S3DestinationUpdate) *ElasticsearchDestinationUpdate { - s.S3Update = v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *ElasticsearchDestinationUpdate) SetTypeName(v string) *ElasticsearchDestinationUpdate { - s.TypeName = &v - return s -} - -// Configures retry behavior in the event that Firehose is unable to deliver -// documents to Amazon ES. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ElasticsearchRetryOptions -type ElasticsearchRetryOptions struct { - _ struct{} `type:"structure"` - - // After an initial failure to deliver to Amazon ES, the total amount of time - // during which Firehose re-attempts delivery (including the first attempt). - // After this time has elapsed, the failed documents are written to Amazon S3. - // Default value is 300 seconds (5 minutes). A value of 0 (zero) results in - // no retries. - DurationInSeconds *int64 `type:"integer"` -} - -// String returns the string representation -func (s ElasticsearchRetryOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticsearchRetryOptions) GoString() string { - return s.String() -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *ElasticsearchRetryOptions) SetDurationInSeconds(v int64) *ElasticsearchRetryOptions { - s.DurationInSeconds = &v - return s -} - -// Describes the encryption for a destination in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/EncryptionConfiguration -type EncryptionConfiguration struct { - _ struct{} `type:"structure"` - - // The encryption key. - KMSEncryptionConfig *KMSEncryptionConfig `type:"structure"` - - // Specifically override existing encryption information to ensure no encryption - // is used. - NoEncryptionConfig *string `type:"string" enum:"NoEncryptionConfig"` -} - -// String returns the string representation -func (s EncryptionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EncryptionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptionConfiguration"} - if s.KMSEncryptionConfig != nil { - if err := s.KMSEncryptionConfig.Validate(); err != nil { - invalidParams.AddNested("KMSEncryptionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKMSEncryptionConfig sets the KMSEncryptionConfig field's value. -func (s *EncryptionConfiguration) SetKMSEncryptionConfig(v *KMSEncryptionConfig) *EncryptionConfiguration { - s.KMSEncryptionConfig = v - return s -} - -// SetNoEncryptionConfig sets the NoEncryptionConfig field's value. -func (s *EncryptionConfiguration) SetNoEncryptionConfig(v string) *EncryptionConfiguration { - s.NoEncryptionConfig = &v - return s -} - -// Describes the configuration of a destination in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ExtendedS3DestinationConfiguration -type ExtendedS3DestinationConfiguration struct { - _ struct{} `type:"structure"` - - // The ARN of the S3 bucket. - // - // BucketARN is a required field - BucketARN *string `min:"1" type:"string" required:"true"` - - // The buffering option. - BufferingHints *BufferingHints `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The compression format. If no value is specified, the default is UNCOMPRESSED. - CompressionFormat *string `type:"string" enum:"CompressionFormat"` - - // The encryption configuration. If no value is specified, the default is no - // encryption. - EncryptionConfiguration *EncryptionConfiguration `type:"structure"` - - // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // S3 files. You can specify an extra prefix to be added in front of the time - // format prefix. Note that if the prefix ends with a slash, it appears as a - // folder in the S3 bucket. For more information, see Amazon S3 Object Name - // Format (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html) - // in the Amazon Kinesis Firehose Developer Guide. - Prefix *string `type:"string"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The ARN of the AWS credentials. - // - // RoleARN is a required field - RoleARN *string `min:"1" type:"string" required:"true"` - - // The configuration for backup in Amazon S3. - S3BackupConfiguration *S3DestinationConfiguration `type:"structure"` - - // The Amazon S3 backup mode. - S3BackupMode *string `type:"string" enum:"S3BackupMode"` -} - -// String returns the string representation -func (s ExtendedS3DestinationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExtendedS3DestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExtendedS3DestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExtendedS3DestinationConfiguration"} - if s.BucketARN == nil { - invalidParams.Add(request.NewErrParamRequired("BucketARN")) - } - if s.BucketARN != nil && len(*s.BucketARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BucketARN", 1)) - } - if s.RoleARN == nil { - invalidParams.Add(request.NewErrParamRequired("RoleARN")) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.BufferingHints != nil { - if err := s.BufferingHints.Validate(); err != nil { - invalidParams.AddNested("BufferingHints", err.(request.ErrInvalidParams)) - } - } - if s.EncryptionConfiguration != nil { - if err := s.EncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("EncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ProcessingConfiguration != nil { - if err := s.ProcessingConfiguration.Validate(); err != nil { - invalidParams.AddNested("ProcessingConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.S3BackupConfiguration != nil { - if err := s.S3BackupConfiguration.Validate(); err != nil { - invalidParams.AddNested("S3BackupConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketARN sets the BucketARN field's value. -func (s *ExtendedS3DestinationConfiguration) SetBucketARN(v string) *ExtendedS3DestinationConfiguration { - s.BucketARN = &v - return s -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *ExtendedS3DestinationConfiguration) SetBufferingHints(v *BufferingHints) *ExtendedS3DestinationConfiguration { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *ExtendedS3DestinationConfiguration) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *ExtendedS3DestinationConfiguration { - s.CloudWatchLoggingOptions = v - return s -} - -// SetCompressionFormat sets the CompressionFormat field's value. -func (s *ExtendedS3DestinationConfiguration) SetCompressionFormat(v string) *ExtendedS3DestinationConfiguration { - s.CompressionFormat = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *ExtendedS3DestinationConfiguration) SetEncryptionConfiguration(v *EncryptionConfiguration) *ExtendedS3DestinationConfiguration { - s.EncryptionConfiguration = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ExtendedS3DestinationConfiguration) SetPrefix(v string) *ExtendedS3DestinationConfiguration { - s.Prefix = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *ExtendedS3DestinationConfiguration) SetProcessingConfiguration(v *ProcessingConfiguration) *ExtendedS3DestinationConfiguration { - s.ProcessingConfiguration = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ExtendedS3DestinationConfiguration) SetRoleARN(v string) *ExtendedS3DestinationConfiguration { - s.RoleARN = &v - return s -} - -// SetS3BackupConfiguration sets the S3BackupConfiguration field's value. -func (s *ExtendedS3DestinationConfiguration) SetS3BackupConfiguration(v *S3DestinationConfiguration) *ExtendedS3DestinationConfiguration { - s.S3BackupConfiguration = v - return s -} - -// SetS3BackupMode sets the S3BackupMode field's value. -func (s *ExtendedS3DestinationConfiguration) SetS3BackupMode(v string) *ExtendedS3DestinationConfiguration { - s.S3BackupMode = &v - return s -} - -// Describes a destination in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ExtendedS3DestinationDescription -type ExtendedS3DestinationDescription struct { - _ struct{} `type:"structure"` - - // The ARN of the S3 bucket. - // - // BucketARN is a required field - BucketARN *string `min:"1" type:"string" required:"true"` - - // The buffering option. - // - // BufferingHints is a required field - BufferingHints *BufferingHints `type:"structure" required:"true"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The compression format. If no value is specified, the default is UNCOMPRESSED. - // - // CompressionFormat is a required field - CompressionFormat *string `type:"string" required:"true" enum:"CompressionFormat"` - - // The encryption configuration. If no value is specified, the default is no - // encryption. - // - // EncryptionConfiguration is a required field - EncryptionConfiguration *EncryptionConfiguration `type:"structure" required:"true"` - - // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // S3 files. You can specify an extra prefix to be added in front of the time - // format prefix. Note that if the prefix ends with a slash, it appears as a - // folder in the S3 bucket. For more information, see Amazon S3 Object Name - // Format (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html) - // in the Amazon Kinesis Firehose Developer Guide. - Prefix *string `type:"string"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The ARN of the AWS credentials. - // - // RoleARN is a required field - RoleARN *string `min:"1" type:"string" required:"true"` - - // The configuration for backup in Amazon S3. - S3BackupDescription *S3DestinationDescription `type:"structure"` - - // The Amazon S3 backup mode. - S3BackupMode *string `type:"string" enum:"S3BackupMode"` -} - -// String returns the string representation -func (s ExtendedS3DestinationDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExtendedS3DestinationDescription) GoString() string { - return s.String() -} - -// SetBucketARN sets the BucketARN field's value. -func (s *ExtendedS3DestinationDescription) SetBucketARN(v string) *ExtendedS3DestinationDescription { - s.BucketARN = &v - return s -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *ExtendedS3DestinationDescription) SetBufferingHints(v *BufferingHints) *ExtendedS3DestinationDescription { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *ExtendedS3DestinationDescription) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *ExtendedS3DestinationDescription { - s.CloudWatchLoggingOptions = v - return s -} - -// SetCompressionFormat sets the CompressionFormat field's value. -func (s *ExtendedS3DestinationDescription) SetCompressionFormat(v string) *ExtendedS3DestinationDescription { - s.CompressionFormat = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *ExtendedS3DestinationDescription) SetEncryptionConfiguration(v *EncryptionConfiguration) *ExtendedS3DestinationDescription { - s.EncryptionConfiguration = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ExtendedS3DestinationDescription) SetPrefix(v string) *ExtendedS3DestinationDescription { - s.Prefix = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *ExtendedS3DestinationDescription) SetProcessingConfiguration(v *ProcessingConfiguration) *ExtendedS3DestinationDescription { - s.ProcessingConfiguration = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ExtendedS3DestinationDescription) SetRoleARN(v string) *ExtendedS3DestinationDescription { - s.RoleARN = &v - return s -} - -// SetS3BackupDescription sets the S3BackupDescription field's value. -func (s *ExtendedS3DestinationDescription) SetS3BackupDescription(v *S3DestinationDescription) *ExtendedS3DestinationDescription { - s.S3BackupDescription = v - return s -} - -// SetS3BackupMode sets the S3BackupMode field's value. -func (s *ExtendedS3DestinationDescription) SetS3BackupMode(v string) *ExtendedS3DestinationDescription { - s.S3BackupMode = &v - return s -} - -// Describes an update for a destination in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ExtendedS3DestinationUpdate -type ExtendedS3DestinationUpdate struct { - _ struct{} `type:"structure"` - - // The ARN of the S3 bucket. - BucketARN *string `min:"1" type:"string"` - - // The buffering option. - BufferingHints *BufferingHints `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The compression format. If no value is specified, the default is UNCOMPRESSED. - CompressionFormat *string `type:"string" enum:"CompressionFormat"` - - // The encryption configuration. If no value is specified, the default is no - // encryption. - EncryptionConfiguration *EncryptionConfiguration `type:"structure"` - - // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // S3 files. You can specify an extra prefix to be added in front of the time - // format prefix. Note that if the prefix ends with a slash, it appears as a - // folder in the S3 bucket. For more information, see Amazon S3 Object Name - // Format (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html) - // in the Amazon Kinesis Firehose Developer Guide. - Prefix *string `type:"string"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The ARN of the AWS credentials. - RoleARN *string `min:"1" type:"string"` - - // Enables or disables Amazon S3 backup mode. - S3BackupMode *string `type:"string" enum:"S3BackupMode"` - - // The Amazon S3 destination for backup. - S3BackupUpdate *S3DestinationUpdate `type:"structure"` -} - -// String returns the string representation -func (s ExtendedS3DestinationUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExtendedS3DestinationUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExtendedS3DestinationUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExtendedS3DestinationUpdate"} - if s.BucketARN != nil && len(*s.BucketARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BucketARN", 1)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.BufferingHints != nil { - if err := s.BufferingHints.Validate(); err != nil { - invalidParams.AddNested("BufferingHints", err.(request.ErrInvalidParams)) - } - } - if s.EncryptionConfiguration != nil { - if err := s.EncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("EncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ProcessingConfiguration != nil { - if err := s.ProcessingConfiguration.Validate(); err != nil { - invalidParams.AddNested("ProcessingConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.S3BackupUpdate != nil { - if err := s.S3BackupUpdate.Validate(); err != nil { - invalidParams.AddNested("S3BackupUpdate", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketARN sets the BucketARN field's value. -func (s *ExtendedS3DestinationUpdate) SetBucketARN(v string) *ExtendedS3DestinationUpdate { - s.BucketARN = &v - return s -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *ExtendedS3DestinationUpdate) SetBufferingHints(v *BufferingHints) *ExtendedS3DestinationUpdate { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *ExtendedS3DestinationUpdate) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *ExtendedS3DestinationUpdate { - s.CloudWatchLoggingOptions = v - return s -} - -// SetCompressionFormat sets the CompressionFormat field's value. -func (s *ExtendedS3DestinationUpdate) SetCompressionFormat(v string) *ExtendedS3DestinationUpdate { - s.CompressionFormat = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *ExtendedS3DestinationUpdate) SetEncryptionConfiguration(v *EncryptionConfiguration) *ExtendedS3DestinationUpdate { - s.EncryptionConfiguration = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ExtendedS3DestinationUpdate) SetPrefix(v string) *ExtendedS3DestinationUpdate { - s.Prefix = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *ExtendedS3DestinationUpdate) SetProcessingConfiguration(v *ProcessingConfiguration) *ExtendedS3DestinationUpdate { - s.ProcessingConfiguration = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *ExtendedS3DestinationUpdate) SetRoleARN(v string) *ExtendedS3DestinationUpdate { - s.RoleARN = &v - return s -} - -// SetS3BackupMode sets the S3BackupMode field's value. -func (s *ExtendedS3DestinationUpdate) SetS3BackupMode(v string) *ExtendedS3DestinationUpdate { - s.S3BackupMode = &v - return s -} - -// SetS3BackupUpdate sets the S3BackupUpdate field's value. -func (s *ExtendedS3DestinationUpdate) SetS3BackupUpdate(v *S3DestinationUpdate) *ExtendedS3DestinationUpdate { - s.S3BackupUpdate = v - return s -} - -// Describes an encryption key for a destination in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/KMSEncryptionConfig -type KMSEncryptionConfig struct { - _ struct{} `type:"structure"` - - // The ARN of the encryption key. Must belong to the same region as the destination - // Amazon S3 bucket. - // - // AWSKMSKeyARN is a required field - AWSKMSKeyARN *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s KMSEncryptionConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KMSEncryptionConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KMSEncryptionConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KMSEncryptionConfig"} - if s.AWSKMSKeyARN == nil { - invalidParams.Add(request.NewErrParamRequired("AWSKMSKeyARN")) - } - if s.AWSKMSKeyARN != nil && len(*s.AWSKMSKeyARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AWSKMSKeyARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAWSKMSKeyARN sets the AWSKMSKeyARN field's value. -func (s *KMSEncryptionConfig) SetAWSKMSKeyARN(v string) *KMSEncryptionConfig { - s.AWSKMSKeyARN = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ListDeliveryStreamsInput -type ListDeliveryStreamsInput struct { - _ struct{} `type:"structure"` - - // The name of the delivery stream to start the list with. - ExclusiveStartDeliveryStreamName *string `min:"1" type:"string"` - - // The maximum number of delivery streams to list. - Limit *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListDeliveryStreamsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeliveryStreamsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeliveryStreamsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeliveryStreamsInput"} - if s.ExclusiveStartDeliveryStreamName != nil && len(*s.ExclusiveStartDeliveryStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartDeliveryStreamName", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExclusiveStartDeliveryStreamName sets the ExclusiveStartDeliveryStreamName field's value. -func (s *ListDeliveryStreamsInput) SetExclusiveStartDeliveryStreamName(v string) *ListDeliveryStreamsInput { - s.ExclusiveStartDeliveryStreamName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListDeliveryStreamsInput) SetLimit(v int64) *ListDeliveryStreamsInput { - s.Limit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ListDeliveryStreamsOutput -type ListDeliveryStreamsOutput struct { - _ struct{} `type:"structure"` - - // The names of the delivery streams. - // - // DeliveryStreamNames is a required field - DeliveryStreamNames []*string `type:"list" required:"true"` - - // Indicates whether there are more delivery streams available to list. - // - // HasMoreDeliveryStreams is a required field - HasMoreDeliveryStreams *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s ListDeliveryStreamsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeliveryStreamsOutput) GoString() string { - return s.String() -} - -// SetDeliveryStreamNames sets the DeliveryStreamNames field's value. -func (s *ListDeliveryStreamsOutput) SetDeliveryStreamNames(v []*string) *ListDeliveryStreamsOutput { - s.DeliveryStreamNames = v - return s -} - -// SetHasMoreDeliveryStreams sets the HasMoreDeliveryStreams field's value. -func (s *ListDeliveryStreamsOutput) SetHasMoreDeliveryStreams(v bool) *ListDeliveryStreamsOutput { - s.HasMoreDeliveryStreams = &v - return s -} - -// Describes a data processing configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ProcessingConfiguration -type ProcessingConfiguration struct { - _ struct{} `type:"structure"` - - // Enables or disables data processing. - Enabled *bool `type:"boolean"` - - // The data processors. - Processors []*Processor `type:"list"` -} - -// String returns the string representation -func (s ProcessingConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProcessingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProcessingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProcessingConfiguration"} - if s.Processors != nil { - for i, v := range s.Processors { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Processors", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *ProcessingConfiguration) SetEnabled(v bool) *ProcessingConfiguration { - s.Enabled = &v - return s -} - -// SetProcessors sets the Processors field's value. -func (s *ProcessingConfiguration) SetProcessors(v []*Processor) *ProcessingConfiguration { - s.Processors = v - return s -} - -// Describes a data processor. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/Processor -type Processor struct { - _ struct{} `type:"structure"` - - // The processor parameters. - Parameters []*ProcessorParameter `type:"list"` - - // The type of processor. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"ProcessorType"` -} - -// String returns the string representation -func (s Processor) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Processor) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Processor) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Processor"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Parameters != nil { - for i, v := range s.Parameters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Parameters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParameters sets the Parameters field's value. -func (s *Processor) SetParameters(v []*ProcessorParameter) *Processor { - s.Parameters = v - return s -} - -// SetType sets the Type field's value. -func (s *Processor) SetType(v string) *Processor { - s.Type = &v - return s -} - -// Describes the processor parameter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ProcessorParameter -type ProcessorParameter struct { - _ struct{} `type:"structure"` - - // The name of the parameter. - // - // ParameterName is a required field - ParameterName *string `type:"string" required:"true" enum:"ProcessorParameterName"` - - // The parameter value. - // - // ParameterValue is a required field - ParameterValue *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ProcessorParameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProcessorParameter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProcessorParameter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProcessorParameter"} - if s.ParameterName == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterName")) - } - if s.ParameterValue == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterValue")) - } - if s.ParameterValue != nil && len(*s.ParameterValue) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ParameterValue", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParameterName sets the ParameterName field's value. -func (s *ProcessorParameter) SetParameterName(v string) *ProcessorParameter { - s.ParameterName = &v - return s -} - -// SetParameterValue sets the ParameterValue field's value. -func (s *ProcessorParameter) SetParameterValue(v string) *ProcessorParameter { - s.ParameterValue = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordBatchInput -type PutRecordBatchInput struct { - _ struct{} `type:"structure"` - - // The name of the delivery stream. - // - // DeliveryStreamName is a required field - DeliveryStreamName *string `min:"1" type:"string" required:"true"` - - // One or more records. - // - // Records is a required field - Records []*Record `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PutRecordBatchInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordBatchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRecordBatchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRecordBatchInput"} - if s.DeliveryStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryStreamName")) - } - if s.DeliveryStreamName != nil && len(*s.DeliveryStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryStreamName", 1)) - } - 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.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 -} - -// SetDeliveryStreamName sets the DeliveryStreamName field's value. -func (s *PutRecordBatchInput) SetDeliveryStreamName(v string) *PutRecordBatchInput { - s.DeliveryStreamName = &v - return s -} - -// SetRecords sets the Records field's value. -func (s *PutRecordBatchInput) SetRecords(v []*Record) *PutRecordBatchInput { - s.Records = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordBatchOutput -type PutRecordBatchOutput struct { - _ struct{} `type:"structure"` - - // The number of records that might have failed processing. - // - // FailedPutCount is a required field - FailedPutCount *int64 `type:"integer" required:"true"` - - // The results array. For each record, the index of the response element is - // the same as the index used in the request array. - // - // RequestResponses is a required field - RequestResponses []*PutRecordBatchResponseEntry `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PutRecordBatchOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordBatchOutput) GoString() string { - return s.String() -} - -// SetFailedPutCount sets the FailedPutCount field's value. -func (s *PutRecordBatchOutput) SetFailedPutCount(v int64) *PutRecordBatchOutput { - s.FailedPutCount = &v - return s -} - -// SetRequestResponses sets the RequestResponses field's value. -func (s *PutRecordBatchOutput) SetRequestResponses(v []*PutRecordBatchResponseEntry) *PutRecordBatchOutput { - s.RequestResponses = v - return s -} - -// Contains the result for an individual record from a PutRecordBatch request. -// If the record is successfully added to your delivery stream, it receives -// a record ID. If the record fails to be added to your delivery stream, the -// result includes an error code and an error message. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordBatchResponseEntry -type PutRecordBatchResponseEntry struct { - _ struct{} `type:"structure"` - - // The error code for an individual record result. - ErrorCode *string `type:"string"` - - // The error message for an individual record result. - ErrorMessage *string `type:"string"` - - // The ID of the record. - RecordId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PutRecordBatchResponseEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordBatchResponseEntry) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *PutRecordBatchResponseEntry) SetErrorCode(v string) *PutRecordBatchResponseEntry { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *PutRecordBatchResponseEntry) SetErrorMessage(v string) *PutRecordBatchResponseEntry { - s.ErrorMessage = &v - return s -} - -// SetRecordId sets the RecordId field's value. -func (s *PutRecordBatchResponseEntry) SetRecordId(v string) *PutRecordBatchResponseEntry { - s.RecordId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordInput -type PutRecordInput struct { - _ struct{} `type:"structure"` - - // The name of the delivery stream. - // - // DeliveryStreamName is a required field - DeliveryStreamName *string `min:"1" type:"string" required:"true"` - - // The record. - // - // Record is a required field - Record *Record `type:"structure" 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.DeliveryStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryStreamName")) - } - if s.DeliveryStreamName != nil && len(*s.DeliveryStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryStreamName", 1)) - } - if s.Record == nil { - invalidParams.Add(request.NewErrParamRequired("Record")) - } - if s.Record != nil { - if err := s.Record.Validate(); err != nil { - invalidParams.AddNested("Record", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryStreamName sets the DeliveryStreamName field's value. -func (s *PutRecordInput) SetDeliveryStreamName(v string) *PutRecordInput { - s.DeliveryStreamName = &v - return s -} - -// SetRecord sets the Record field's value. -func (s *PutRecordInput) SetRecord(v *Record) *PutRecordInput { - s.Record = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordOutput -type PutRecordOutput struct { - _ struct{} `type:"structure"` - - // The ID of the record. - // - // RecordId is a required field - RecordId *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() -} - -// SetRecordId sets the RecordId field's value. -func (s *PutRecordOutput) SetRecordId(v string) *PutRecordOutput { - s.RecordId = &v - return s -} - -// The unit of data in a delivery stream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/Record -type Record struct { - _ struct{} `type:"structure"` - - // The data blob, which is base64-encoded when the blob is serialized. The maximum - // size of the data blob, before base64-encoding, is 1,000 KB. - // - // Data is automatically base64 encoded/decoded by the SDK. - // - // Data is a required field - Data []byte `type:"blob" 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Record) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Record"} - if s.Data == nil { - invalidParams.Add(request.NewErrParamRequired("Data")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetData sets the Data field's value. -func (s *Record) SetData(v []byte) *Record { - s.Data = v - return s -} - -// Describes the configuration of a destination in Amazon Redshift. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/RedshiftDestinationConfiguration -type RedshiftDestinationConfiguration struct { - _ struct{} `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The database connection string. - // - // ClusterJDBCURL is a required field - ClusterJDBCURL *string `min:"1" type:"string" required:"true"` - - // The COPY command. - // - // CopyCommand is a required field - CopyCommand *CopyCommand `type:"structure" required:"true"` - - // The user password. - // - // Password is a required field - Password *string `min:"6" type:"string" required:"true"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The retry behavior in the event that Firehose is unable to deliver documents - // to Amazon Redshift. Default value is 3600 (60 minutes). - RetryOptions *RedshiftRetryOptions `type:"structure"` - - // The ARN of the AWS credentials. - // - // RoleARN is a required field - RoleARN *string `min:"1" type:"string" required:"true"` - - // The configuration for backup in Amazon S3. - S3BackupConfiguration *S3DestinationConfiguration `type:"structure"` - - // The Amazon S3 backup mode. - S3BackupMode *string `type:"string" enum:"RedshiftS3BackupMode"` - - // The configuration for the intermediate Amazon S3 location from which Amazon - // Redshift obtains data. Restrictions are described in the topic for CreateDeliveryStream. - // - // The compression formats SNAPPY or ZIP cannot be specified in RedshiftDestinationConfiguration.S3Configuration - // because the Amazon Redshift COPY operation that reads from the S3 bucket - // doesn't support these compression formats. - // - // S3Configuration is a required field - S3Configuration *S3DestinationConfiguration `type:"structure" required:"true"` - - // The name of the user. - // - // Username is a required field - Username *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RedshiftDestinationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RedshiftDestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedshiftDestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedshiftDestinationConfiguration"} - if s.ClusterJDBCURL == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterJDBCURL")) - } - if s.ClusterJDBCURL != nil && len(*s.ClusterJDBCURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClusterJDBCURL", 1)) - } - if s.CopyCommand == nil { - invalidParams.Add(request.NewErrParamRequired("CopyCommand")) - } - if s.Password == nil { - invalidParams.Add(request.NewErrParamRequired("Password")) - } - if s.Password != nil && len(*s.Password) < 6 { - invalidParams.Add(request.NewErrParamMinLen("Password", 6)) - } - if s.RoleARN == nil { - invalidParams.Add(request.NewErrParamRequired("RoleARN")) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.S3Configuration == nil { - invalidParams.Add(request.NewErrParamRequired("S3Configuration")) - } - if s.Username == nil { - invalidParams.Add(request.NewErrParamRequired("Username")) - } - if s.Username != nil && len(*s.Username) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Username", 1)) - } - if s.CopyCommand != nil { - if err := s.CopyCommand.Validate(); err != nil { - invalidParams.AddNested("CopyCommand", err.(request.ErrInvalidParams)) - } - } - if s.ProcessingConfiguration != nil { - if err := s.ProcessingConfiguration.Validate(); err != nil { - invalidParams.AddNested("ProcessingConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.S3BackupConfiguration != nil { - if err := s.S3BackupConfiguration.Validate(); err != nil { - invalidParams.AddNested("S3BackupConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.S3Configuration != nil { - if err := s.S3Configuration.Validate(); err != nil { - invalidParams.AddNested("S3Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *RedshiftDestinationConfiguration) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *RedshiftDestinationConfiguration { - s.CloudWatchLoggingOptions = v - return s -} - -// SetClusterJDBCURL sets the ClusterJDBCURL field's value. -func (s *RedshiftDestinationConfiguration) SetClusterJDBCURL(v string) *RedshiftDestinationConfiguration { - s.ClusterJDBCURL = &v - return s -} - -// SetCopyCommand sets the CopyCommand field's value. -func (s *RedshiftDestinationConfiguration) SetCopyCommand(v *CopyCommand) *RedshiftDestinationConfiguration { - s.CopyCommand = v - return s -} - -// SetPassword sets the Password field's value. -func (s *RedshiftDestinationConfiguration) SetPassword(v string) *RedshiftDestinationConfiguration { - s.Password = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *RedshiftDestinationConfiguration) SetProcessingConfiguration(v *ProcessingConfiguration) *RedshiftDestinationConfiguration { - s.ProcessingConfiguration = v - return s -} - -// SetRetryOptions sets the RetryOptions field's value. -func (s *RedshiftDestinationConfiguration) SetRetryOptions(v *RedshiftRetryOptions) *RedshiftDestinationConfiguration { - s.RetryOptions = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *RedshiftDestinationConfiguration) SetRoleARN(v string) *RedshiftDestinationConfiguration { - s.RoleARN = &v - return s -} - -// SetS3BackupConfiguration sets the S3BackupConfiguration field's value. -func (s *RedshiftDestinationConfiguration) SetS3BackupConfiguration(v *S3DestinationConfiguration) *RedshiftDestinationConfiguration { - s.S3BackupConfiguration = v - return s -} - -// SetS3BackupMode sets the S3BackupMode field's value. -func (s *RedshiftDestinationConfiguration) SetS3BackupMode(v string) *RedshiftDestinationConfiguration { - s.S3BackupMode = &v - return s -} - -// SetS3Configuration sets the S3Configuration field's value. -func (s *RedshiftDestinationConfiguration) SetS3Configuration(v *S3DestinationConfiguration) *RedshiftDestinationConfiguration { - s.S3Configuration = v - return s -} - -// SetUsername sets the Username field's value. -func (s *RedshiftDestinationConfiguration) SetUsername(v string) *RedshiftDestinationConfiguration { - s.Username = &v - return s -} - -// Describes a destination in Amazon Redshift. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/RedshiftDestinationDescription -type RedshiftDestinationDescription struct { - _ struct{} `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The database connection string. - // - // ClusterJDBCURL is a required field - ClusterJDBCURL *string `min:"1" type:"string" required:"true"` - - // The COPY command. - // - // CopyCommand is a required field - CopyCommand *CopyCommand `type:"structure" required:"true"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The retry behavior in the event that Firehose is unable to deliver documents - // to Amazon Redshift. Default value is 3600 (60 minutes). - RetryOptions *RedshiftRetryOptions `type:"structure"` - - // The ARN of the AWS credentials. - // - // RoleARN is a required field - RoleARN *string `min:"1" type:"string" required:"true"` - - // The configuration for backup in Amazon S3. - S3BackupDescription *S3DestinationDescription `type:"structure"` - - // The Amazon S3 backup mode. - S3BackupMode *string `type:"string" enum:"RedshiftS3BackupMode"` - - // The Amazon S3 destination. - // - // S3DestinationDescription is a required field - S3DestinationDescription *S3DestinationDescription `type:"structure" required:"true"` - - // The name of the user. - // - // Username is a required field - Username *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RedshiftDestinationDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RedshiftDestinationDescription) GoString() string { - return s.String() -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *RedshiftDestinationDescription) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *RedshiftDestinationDescription { - s.CloudWatchLoggingOptions = v - return s -} - -// SetClusterJDBCURL sets the ClusterJDBCURL field's value. -func (s *RedshiftDestinationDescription) SetClusterJDBCURL(v string) *RedshiftDestinationDescription { - s.ClusterJDBCURL = &v - return s -} - -// SetCopyCommand sets the CopyCommand field's value. -func (s *RedshiftDestinationDescription) SetCopyCommand(v *CopyCommand) *RedshiftDestinationDescription { - s.CopyCommand = v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *RedshiftDestinationDescription) SetProcessingConfiguration(v *ProcessingConfiguration) *RedshiftDestinationDescription { - s.ProcessingConfiguration = v - return s -} - -// SetRetryOptions sets the RetryOptions field's value. -func (s *RedshiftDestinationDescription) SetRetryOptions(v *RedshiftRetryOptions) *RedshiftDestinationDescription { - s.RetryOptions = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *RedshiftDestinationDescription) SetRoleARN(v string) *RedshiftDestinationDescription { - s.RoleARN = &v - return s -} - -// SetS3BackupDescription sets the S3BackupDescription field's value. -func (s *RedshiftDestinationDescription) SetS3BackupDescription(v *S3DestinationDescription) *RedshiftDestinationDescription { - s.S3BackupDescription = v - return s -} - -// SetS3BackupMode sets the S3BackupMode field's value. -func (s *RedshiftDestinationDescription) SetS3BackupMode(v string) *RedshiftDestinationDescription { - s.S3BackupMode = &v - return s -} - -// SetS3DestinationDescription sets the S3DestinationDescription field's value. -func (s *RedshiftDestinationDescription) SetS3DestinationDescription(v *S3DestinationDescription) *RedshiftDestinationDescription { - s.S3DestinationDescription = v - return s -} - -// SetUsername sets the Username field's value. -func (s *RedshiftDestinationDescription) SetUsername(v string) *RedshiftDestinationDescription { - s.Username = &v - return s -} - -// Describes an update for a destination in Amazon Redshift. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/RedshiftDestinationUpdate -type RedshiftDestinationUpdate struct { - _ struct{} `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The database connection string. - ClusterJDBCURL *string `min:"1" type:"string"` - - // The COPY command. - CopyCommand *CopyCommand `type:"structure"` - - // The user password. - Password *string `min:"6" type:"string"` - - // The data processing configuration. - ProcessingConfiguration *ProcessingConfiguration `type:"structure"` - - // The retry behavior in the event that Firehose is unable to deliver documents - // to Amazon Redshift. Default value is 3600 (60 minutes). - RetryOptions *RedshiftRetryOptions `type:"structure"` - - // The ARN of the AWS credentials. - RoleARN *string `min:"1" type:"string"` - - // The Amazon S3 backup mode. - S3BackupMode *string `type:"string" enum:"RedshiftS3BackupMode"` - - // The Amazon S3 destination for backup. - S3BackupUpdate *S3DestinationUpdate `type:"structure"` - - // The Amazon S3 destination. - // - // The compression formats SNAPPY or ZIP cannot be specified in RedshiftDestinationUpdate.S3Update - // because the Amazon Redshift COPY operation that reads from the S3 bucket - // doesn't support these compression formats. - S3Update *S3DestinationUpdate `type:"structure"` - - // The name of the user. - Username *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s RedshiftDestinationUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RedshiftDestinationUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedshiftDestinationUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedshiftDestinationUpdate"} - if s.ClusterJDBCURL != nil && len(*s.ClusterJDBCURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClusterJDBCURL", 1)) - } - if s.Password != nil && len(*s.Password) < 6 { - invalidParams.Add(request.NewErrParamMinLen("Password", 6)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.Username != nil && len(*s.Username) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Username", 1)) - } - if s.CopyCommand != nil { - if err := s.CopyCommand.Validate(); err != nil { - invalidParams.AddNested("CopyCommand", err.(request.ErrInvalidParams)) - } - } - if s.ProcessingConfiguration != nil { - if err := s.ProcessingConfiguration.Validate(); err != nil { - invalidParams.AddNested("ProcessingConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.S3BackupUpdate != nil { - if err := s.S3BackupUpdate.Validate(); err != nil { - invalidParams.AddNested("S3BackupUpdate", err.(request.ErrInvalidParams)) - } - } - if s.S3Update != nil { - if err := s.S3Update.Validate(); err != nil { - invalidParams.AddNested("S3Update", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *RedshiftDestinationUpdate) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *RedshiftDestinationUpdate { - s.CloudWatchLoggingOptions = v - return s -} - -// SetClusterJDBCURL sets the ClusterJDBCURL field's value. -func (s *RedshiftDestinationUpdate) SetClusterJDBCURL(v string) *RedshiftDestinationUpdate { - s.ClusterJDBCURL = &v - return s -} - -// SetCopyCommand sets the CopyCommand field's value. -func (s *RedshiftDestinationUpdate) SetCopyCommand(v *CopyCommand) *RedshiftDestinationUpdate { - s.CopyCommand = v - return s -} - -// SetPassword sets the Password field's value. -func (s *RedshiftDestinationUpdate) SetPassword(v string) *RedshiftDestinationUpdate { - s.Password = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *RedshiftDestinationUpdate) SetProcessingConfiguration(v *ProcessingConfiguration) *RedshiftDestinationUpdate { - s.ProcessingConfiguration = v - return s -} - -// SetRetryOptions sets the RetryOptions field's value. -func (s *RedshiftDestinationUpdate) SetRetryOptions(v *RedshiftRetryOptions) *RedshiftDestinationUpdate { - s.RetryOptions = v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *RedshiftDestinationUpdate) SetRoleARN(v string) *RedshiftDestinationUpdate { - s.RoleARN = &v - return s -} - -// SetS3BackupMode sets the S3BackupMode field's value. -func (s *RedshiftDestinationUpdate) SetS3BackupMode(v string) *RedshiftDestinationUpdate { - s.S3BackupMode = &v - return s -} - -// SetS3BackupUpdate sets the S3BackupUpdate field's value. -func (s *RedshiftDestinationUpdate) SetS3BackupUpdate(v *S3DestinationUpdate) *RedshiftDestinationUpdate { - s.S3BackupUpdate = v - return s -} - -// SetS3Update sets the S3Update field's value. -func (s *RedshiftDestinationUpdate) SetS3Update(v *S3DestinationUpdate) *RedshiftDestinationUpdate { - s.S3Update = v - return s -} - -// SetUsername sets the Username field's value. -func (s *RedshiftDestinationUpdate) SetUsername(v string) *RedshiftDestinationUpdate { - s.Username = &v - return s -} - -// Configures retry behavior in the event that Firehose is unable to deliver -// documents to Amazon Redshift. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/RedshiftRetryOptions -type RedshiftRetryOptions struct { - _ struct{} `type:"structure"` - - // The length of time during which Firehose retries delivery after a failure, - // starting from the initial request and including the first attempt. The default - // value is 3600 seconds (60 minutes). Firehose does not retry if the value - // of DurationInSeconds is 0 (zero) or if the first delivery attempt takes longer - // than the current value. - DurationInSeconds *int64 `type:"integer"` -} - -// String returns the string representation -func (s RedshiftRetryOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RedshiftRetryOptions) GoString() string { - return s.String() -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *RedshiftRetryOptions) SetDurationInSeconds(v int64) *RedshiftRetryOptions { - s.DurationInSeconds = &v - return s -} - -// Describes the configuration of a destination in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/S3DestinationConfiguration -type S3DestinationConfiguration struct { - _ struct{} `type:"structure"` - - // The ARN of the S3 bucket. - // - // BucketARN is a required field - BucketARN *string `min:"1" type:"string" required:"true"` - - // The buffering option. If no value is specified, BufferingHints object default - // values are used. - BufferingHints *BufferingHints `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The compression format. If no value is specified, the default is UNCOMPRESSED. - // - // The compression formats SNAPPY or ZIP cannot be specified for Amazon Redshift - // destinations because they are not supported by the Amazon Redshift COPY operation - // that reads from the S3 bucket. - CompressionFormat *string `type:"string" enum:"CompressionFormat"` - - // The encryption configuration. If no value is specified, the default is no - // encryption. - EncryptionConfiguration *EncryptionConfiguration `type:"structure"` - - // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // S3 files. You can specify an extra prefix to be added in front of the time - // format prefix. Note that if the prefix ends with a slash, it appears as a - // folder in the S3 bucket. For more information, see Amazon S3 Object Name - // Format (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html) - // in the Amazon Kinesis Firehose Developer Guide. - Prefix *string `type:"string"` - - // The ARN of the AWS credentials. - // - // RoleARN is a required field - RoleARN *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s S3DestinationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3DestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3DestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3DestinationConfiguration"} - if s.BucketARN == nil { - invalidParams.Add(request.NewErrParamRequired("BucketARN")) - } - if s.BucketARN != nil && len(*s.BucketARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BucketARN", 1)) - } - if s.RoleARN == nil { - invalidParams.Add(request.NewErrParamRequired("RoleARN")) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.BufferingHints != nil { - if err := s.BufferingHints.Validate(); err != nil { - invalidParams.AddNested("BufferingHints", err.(request.ErrInvalidParams)) - } - } - if s.EncryptionConfiguration != nil { - if err := s.EncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("EncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketARN sets the BucketARN field's value. -func (s *S3DestinationConfiguration) SetBucketARN(v string) *S3DestinationConfiguration { - s.BucketARN = &v - return s -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *S3DestinationConfiguration) SetBufferingHints(v *BufferingHints) *S3DestinationConfiguration { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *S3DestinationConfiguration) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *S3DestinationConfiguration { - s.CloudWatchLoggingOptions = v - return s -} - -// SetCompressionFormat sets the CompressionFormat field's value. -func (s *S3DestinationConfiguration) SetCompressionFormat(v string) *S3DestinationConfiguration { - s.CompressionFormat = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *S3DestinationConfiguration) SetEncryptionConfiguration(v *EncryptionConfiguration) *S3DestinationConfiguration { - s.EncryptionConfiguration = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3DestinationConfiguration) SetPrefix(v string) *S3DestinationConfiguration { - s.Prefix = &v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *S3DestinationConfiguration) SetRoleARN(v string) *S3DestinationConfiguration { - s.RoleARN = &v - return s -} - -// Describes a destination in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/S3DestinationDescription -type S3DestinationDescription struct { - _ struct{} `type:"structure"` - - // The ARN of the S3 bucket. - // - // BucketARN is a required field - BucketARN *string `min:"1" type:"string" required:"true"` - - // The buffering option. If no value is specified, BufferingHints object default - // values are used. - // - // BufferingHints is a required field - BufferingHints *BufferingHints `type:"structure" required:"true"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The compression format. If no value is specified, the default is UNCOMPRESSED. - // - // CompressionFormat is a required field - CompressionFormat *string `type:"string" required:"true" enum:"CompressionFormat"` - - // The encryption configuration. If no value is specified, the default is no - // encryption. - // - // EncryptionConfiguration is a required field - EncryptionConfiguration *EncryptionConfiguration `type:"structure" required:"true"` - - // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // S3 files. You can specify an extra prefix to be added in front of the time - // format prefix. Note that if the prefix ends with a slash, it appears as a - // folder in the S3 bucket. For more information, see Amazon S3 Object Name - // Format (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html) - // in the Amazon Kinesis Firehose Developer Guide. - Prefix *string `type:"string"` - - // The ARN of the AWS credentials. - // - // RoleARN is a required field - RoleARN *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s S3DestinationDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3DestinationDescription) GoString() string { - return s.String() -} - -// SetBucketARN sets the BucketARN field's value. -func (s *S3DestinationDescription) SetBucketARN(v string) *S3DestinationDescription { - s.BucketARN = &v - return s -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *S3DestinationDescription) SetBufferingHints(v *BufferingHints) *S3DestinationDescription { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *S3DestinationDescription) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *S3DestinationDescription { - s.CloudWatchLoggingOptions = v - return s -} - -// SetCompressionFormat sets the CompressionFormat field's value. -func (s *S3DestinationDescription) SetCompressionFormat(v string) *S3DestinationDescription { - s.CompressionFormat = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *S3DestinationDescription) SetEncryptionConfiguration(v *EncryptionConfiguration) *S3DestinationDescription { - s.EncryptionConfiguration = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3DestinationDescription) SetPrefix(v string) *S3DestinationDescription { - s.Prefix = &v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *S3DestinationDescription) SetRoleARN(v string) *S3DestinationDescription { - s.RoleARN = &v - return s -} - -// Describes an update for a destination in Amazon S3. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/S3DestinationUpdate -type S3DestinationUpdate struct { - _ struct{} `type:"structure"` - - // The ARN of the S3 bucket. - BucketARN *string `min:"1" type:"string"` - - // The buffering option. If no value is specified, BufferingHints object default - // values are used. - BufferingHints *BufferingHints `type:"structure"` - - // The CloudWatch logging options for your delivery stream. - CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` - - // The compression format. If no value is specified, the default is UNCOMPRESSED. - // - // The compression formats SNAPPY or ZIP cannot be specified for Amazon Redshift - // destinations because they are not supported by the Amazon Redshift COPY operation - // that reads from the S3 bucket. - CompressionFormat *string `type:"string" enum:"CompressionFormat"` - - // The encryption configuration. If no value is specified, the default is no - // encryption. - EncryptionConfiguration *EncryptionConfiguration `type:"structure"` - - // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // S3 files. You can specify an extra prefix to be added in front of the time - // format prefix. Note that if the prefix ends with a slash, it appears as a - // folder in the S3 bucket. For more information, see Amazon S3 Object Name - // Format (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html) - // in the Amazon Kinesis Firehose Developer Guide. - Prefix *string `type:"string"` - - // The ARN of the AWS credentials. - RoleARN *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s S3DestinationUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3DestinationUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3DestinationUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3DestinationUpdate"} - if s.BucketARN != nil && len(*s.BucketARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BucketARN", 1)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) - } - if s.BufferingHints != nil { - if err := s.BufferingHints.Validate(); err != nil { - invalidParams.AddNested("BufferingHints", err.(request.ErrInvalidParams)) - } - } - if s.EncryptionConfiguration != nil { - if err := s.EncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("EncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketARN sets the BucketARN field's value. -func (s *S3DestinationUpdate) SetBucketARN(v string) *S3DestinationUpdate { - s.BucketARN = &v - return s -} - -// SetBufferingHints sets the BufferingHints field's value. -func (s *S3DestinationUpdate) SetBufferingHints(v *BufferingHints) *S3DestinationUpdate { - s.BufferingHints = v - return s -} - -// SetCloudWatchLoggingOptions sets the CloudWatchLoggingOptions field's value. -func (s *S3DestinationUpdate) SetCloudWatchLoggingOptions(v *CloudWatchLoggingOptions) *S3DestinationUpdate { - s.CloudWatchLoggingOptions = v - return s -} - -// SetCompressionFormat sets the CompressionFormat field's value. -func (s *S3DestinationUpdate) SetCompressionFormat(v string) *S3DestinationUpdate { - s.CompressionFormat = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *S3DestinationUpdate) SetEncryptionConfiguration(v *EncryptionConfiguration) *S3DestinationUpdate { - s.EncryptionConfiguration = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3DestinationUpdate) SetPrefix(v string) *S3DestinationUpdate { - s.Prefix = &v - return s -} - -// SetRoleARN sets the RoleARN field's value. -func (s *S3DestinationUpdate) SetRoleARN(v string) *S3DestinationUpdate { - s.RoleARN = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/UpdateDestinationInput -type UpdateDestinationInput struct { - _ struct{} `type:"structure"` - - // Obtain this value from the VersionId result of DeliveryStreamDescription. - // This value is required, and helps the service to perform conditional operations. - // For example, if there is a interleaving update and this value is null, then - // the update destination fails. After the update is successful, the VersionId - // value is updated. The service then performs a merge of the old configuration - // with the new configuration. - // - // CurrentDeliveryStreamVersionId is a required field - CurrentDeliveryStreamVersionId *string `min:"1" type:"string" required:"true"` - - // The name of the delivery stream. - // - // DeliveryStreamName is a required field - DeliveryStreamName *string `min:"1" type:"string" required:"true"` - - // The ID of the destination. - // - // DestinationId is a required field - DestinationId *string `min:"1" type:"string" required:"true"` - - // Describes an update for a destination in Amazon ES. - ElasticsearchDestinationUpdate *ElasticsearchDestinationUpdate `type:"structure"` - - // Describes an update for a destination in Amazon S3. - ExtendedS3DestinationUpdate *ExtendedS3DestinationUpdate `type:"structure"` - - // Describes an update for a destination in Amazon Redshift. - RedshiftDestinationUpdate *RedshiftDestinationUpdate `type:"structure"` - - // [Deprecated] Describes an update for a destination in Amazon S3. - S3DestinationUpdate *S3DestinationUpdate `deprecated:"true" type:"structure"` -} - -// String returns the string representation -func (s UpdateDestinationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDestinationInput"} - if s.CurrentDeliveryStreamVersionId == nil { - invalidParams.Add(request.NewErrParamRequired("CurrentDeliveryStreamVersionId")) - } - if s.CurrentDeliveryStreamVersionId != nil && len(*s.CurrentDeliveryStreamVersionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CurrentDeliveryStreamVersionId", 1)) - } - if s.DeliveryStreamName == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryStreamName")) - } - if s.DeliveryStreamName != nil && len(*s.DeliveryStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryStreamName", 1)) - } - if s.DestinationId == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationId")) - } - if s.DestinationId != nil && len(*s.DestinationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DestinationId", 1)) - } - if s.ElasticsearchDestinationUpdate != nil { - if err := s.ElasticsearchDestinationUpdate.Validate(); err != nil { - invalidParams.AddNested("ElasticsearchDestinationUpdate", err.(request.ErrInvalidParams)) - } - } - if s.ExtendedS3DestinationUpdate != nil { - if err := s.ExtendedS3DestinationUpdate.Validate(); err != nil { - invalidParams.AddNested("ExtendedS3DestinationUpdate", err.(request.ErrInvalidParams)) - } - } - if s.RedshiftDestinationUpdate != nil { - if err := s.RedshiftDestinationUpdate.Validate(); err != nil { - invalidParams.AddNested("RedshiftDestinationUpdate", err.(request.ErrInvalidParams)) - } - } - if s.S3DestinationUpdate != nil { - if err := s.S3DestinationUpdate.Validate(); err != nil { - invalidParams.AddNested("S3DestinationUpdate", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCurrentDeliveryStreamVersionId sets the CurrentDeliveryStreamVersionId field's value. -func (s *UpdateDestinationInput) SetCurrentDeliveryStreamVersionId(v string) *UpdateDestinationInput { - s.CurrentDeliveryStreamVersionId = &v - return s -} - -// SetDeliveryStreamName sets the DeliveryStreamName field's value. -func (s *UpdateDestinationInput) SetDeliveryStreamName(v string) *UpdateDestinationInput { - s.DeliveryStreamName = &v - return s -} - -// SetDestinationId sets the DestinationId field's value. -func (s *UpdateDestinationInput) SetDestinationId(v string) *UpdateDestinationInput { - s.DestinationId = &v - return s -} - -// SetElasticsearchDestinationUpdate sets the ElasticsearchDestinationUpdate field's value. -func (s *UpdateDestinationInput) SetElasticsearchDestinationUpdate(v *ElasticsearchDestinationUpdate) *UpdateDestinationInput { - s.ElasticsearchDestinationUpdate = v - return s -} - -// SetExtendedS3DestinationUpdate sets the ExtendedS3DestinationUpdate field's value. -func (s *UpdateDestinationInput) SetExtendedS3DestinationUpdate(v *ExtendedS3DestinationUpdate) *UpdateDestinationInput { - s.ExtendedS3DestinationUpdate = v - return s -} - -// SetRedshiftDestinationUpdate sets the RedshiftDestinationUpdate field's value. -func (s *UpdateDestinationInput) SetRedshiftDestinationUpdate(v *RedshiftDestinationUpdate) *UpdateDestinationInput { - s.RedshiftDestinationUpdate = v - return s -} - -// SetS3DestinationUpdate sets the S3DestinationUpdate field's value. -func (s *UpdateDestinationInput) SetS3DestinationUpdate(v *S3DestinationUpdate) *UpdateDestinationInput { - s.S3DestinationUpdate = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/UpdateDestinationOutput -type UpdateDestinationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateDestinationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDestinationOutput) GoString() string { - return s.String() -} - -const ( - // CompressionFormatUncompressed is a CompressionFormat enum value - CompressionFormatUncompressed = "UNCOMPRESSED" - - // CompressionFormatGzip is a CompressionFormat enum value - CompressionFormatGzip = "GZIP" - - // CompressionFormatZip is a CompressionFormat enum value - CompressionFormatZip = "ZIP" - - // CompressionFormatSnappy is a CompressionFormat enum value - CompressionFormatSnappy = "Snappy" -) - -const ( - // DeliveryStreamStatusCreating is a DeliveryStreamStatus enum value - DeliveryStreamStatusCreating = "CREATING" - - // DeliveryStreamStatusDeleting is a DeliveryStreamStatus enum value - DeliveryStreamStatusDeleting = "DELETING" - - // DeliveryStreamStatusActive is a DeliveryStreamStatus enum value - DeliveryStreamStatusActive = "ACTIVE" -) - -const ( - // ElasticsearchIndexRotationPeriodNoRotation is a ElasticsearchIndexRotationPeriod enum value - ElasticsearchIndexRotationPeriodNoRotation = "NoRotation" - - // ElasticsearchIndexRotationPeriodOneHour is a ElasticsearchIndexRotationPeriod enum value - ElasticsearchIndexRotationPeriodOneHour = "OneHour" - - // ElasticsearchIndexRotationPeriodOneDay is a ElasticsearchIndexRotationPeriod enum value - ElasticsearchIndexRotationPeriodOneDay = "OneDay" - - // ElasticsearchIndexRotationPeriodOneWeek is a ElasticsearchIndexRotationPeriod enum value - ElasticsearchIndexRotationPeriodOneWeek = "OneWeek" - - // ElasticsearchIndexRotationPeriodOneMonth is a ElasticsearchIndexRotationPeriod enum value - ElasticsearchIndexRotationPeriodOneMonth = "OneMonth" -) - -const ( - // ElasticsearchS3BackupModeFailedDocumentsOnly is a ElasticsearchS3BackupMode enum value - ElasticsearchS3BackupModeFailedDocumentsOnly = "FailedDocumentsOnly" - - // ElasticsearchS3BackupModeAllDocuments is a ElasticsearchS3BackupMode enum value - ElasticsearchS3BackupModeAllDocuments = "AllDocuments" -) - -const ( - // NoEncryptionConfigNoEncryption is a NoEncryptionConfig enum value - NoEncryptionConfigNoEncryption = "NoEncryption" -) - -const ( - // ProcessorParameterNameLambdaArn is a ProcessorParameterName enum value - ProcessorParameterNameLambdaArn = "LambdaArn" - - // ProcessorParameterNameNumberOfRetries is a ProcessorParameterName enum value - ProcessorParameterNameNumberOfRetries = "NumberOfRetries" -) - -const ( - // ProcessorTypeLambda is a ProcessorType enum value - ProcessorTypeLambda = "Lambda" -) - -const ( - // RedshiftS3BackupModeDisabled is a RedshiftS3BackupMode enum value - RedshiftS3BackupModeDisabled = "Disabled" - - // RedshiftS3BackupModeEnabled is a RedshiftS3BackupMode enum value - RedshiftS3BackupModeEnabled = "Enabled" -) - -const ( - // S3BackupModeDisabled is a S3BackupMode enum value - S3BackupModeDisabled = "Disabled" - - // S3BackupModeEnabled is a S3BackupMode enum value - S3BackupModeEnabled = "Enabled" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go b/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go deleted file mode 100644 index f541053..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go +++ /dev/null @@ -1,46 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package firehose - -const ( - - // ErrCodeConcurrentModificationException for service response error code - // "ConcurrentModificationException". - // - // Another modification has already happened. Fetch VersionId again and use - // it to update the destination. - ErrCodeConcurrentModificationException = "ConcurrentModificationException" - - // ErrCodeInvalidArgumentException for service response error code - // "InvalidArgumentException". - // - // The specified input parameter has an value that is not valid. - ErrCodeInvalidArgumentException = "InvalidArgumentException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // You have already reached the limit for a requested resource. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUseException". - // - // The resource is already in use and not available for this operation. - ErrCodeResourceInUseException = "ResourceInUseException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource could not be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - // - // The service is unavailable, back off and retry the operation. If you continue - // to see the exception, throughput limits for the delivery stream may have - // been exceeded. For more information about limits and how to request an increase, - // see Amazon Kinesis Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). - ErrCodeServiceUnavailableException = "ServiceUnavailableException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go b/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go deleted file mode 100644 index 930a4d4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go +++ /dev/null @@ -1,95 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package firehose - -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 Firehose is a fully-managed service that delivers real-time -// streaming data to destinations such as Amazon Simple Storage Service (Amazon -// S3), Amazon Elasticsearch Service (Amazon ES), and Amazon Redshift. -// 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/firehose-2015-08-04 -type Firehose 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 = "firehose" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the Firehose 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 Firehose client from just a session. -// svc := firehose.New(mySession) -// -// // Create a Firehose client with additional configuration -// svc := firehose.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Firehose { - 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) *Firehose { - svc := &Firehose{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-08-04", - JSONVersion: "1.1", - TargetPrefix: "Firehose_20150804", - }, - 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 Firehose operation and runs any -// custom request initialization. -func (c *Firehose) 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/glacier/api.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/api.go deleted file mode 100644 index e48809e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/api.go +++ /dev/null @@ -1,7214 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package glacier provides a client for Amazon Glacier. -package glacier - -import ( - "io" - - "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/restjson" -) - -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) -// } -func (c *Glacier) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req *request.Request, output *AbortMultipartUploadOutput) { - op := &request.Operation{ - Name: opAbortMultipartUpload, - HTTPMethod: "DELETE", - HTTPPath: "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}", - } - - if input == nil { - input = &AbortMultipartUploadInput{} - } - - output = &AbortMultipartUploadOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AbortMultipartUpload API operation for Amazon Glacier. -// -// This operation aborts a multipart upload identified by the upload ID. -// -// After the Abort Multipart Upload request succeeds, you cannot upload any -// more parts to the multipart upload or complete the multipart upload. Aborting -// a completed upload fails. However, aborting an already-aborted upload will -// succeed, for a short time. For more information about uploading a part and -// completing a multipart upload, see UploadMultipartPart and CompleteMultipartUpload. -// -// This operation is idempotent. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Working with Archives -// in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html) -// and Abort Multipart Upload (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-abort-upload.html) -// in the Amazon Glacier 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 Glacier's -// API operation AbortMultipartUpload for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) AbortMultipartUpload(input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error) { - req, out := c.AbortMultipartUploadRequest(input) - err := req.Send() - return out, err -} - -const opAbortVaultLock = "AbortVaultLock" - -// AbortVaultLockRequest generates a "aws/request.Request" representing the -// client's request for the AbortVaultLock operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AbortVaultLock for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AbortVaultLock method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AbortVaultLockRequest method. -// req, resp := client.AbortVaultLockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) AbortVaultLockRequest(input *AbortVaultLockInput) (req *request.Request, output *AbortVaultLockOutput) { - op := &request.Operation{ - Name: opAbortVaultLock, - HTTPMethod: "DELETE", - HTTPPath: "/{accountId}/vaults/{vaultName}/lock-policy", - } - - if input == nil { - input = &AbortVaultLockInput{} - } - - output = &AbortVaultLockOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AbortVaultLock API operation for Amazon Glacier. -// -// This operation aborts the vault locking process if the vault lock is not -// in the Locked state. If the vault lock is in the Locked state when this operation -// is requested, the operation returns an AccessDeniedException error. Aborting -// the vault locking process removes the vault lock policy from the specified -// vault. -// -// A vault lock is put into the InProgress state by calling InitiateVaultLock. -// A vault lock is put into the Locked state by calling CompleteVaultLock. You -// can get the state of a vault lock by calling GetVaultLock. For more information -// about the vault locking process, see Amazon Glacier Vault Lock (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-lock.html). -// For more information about vault lock policies, see Amazon Glacier Access -// Control with Vault Lock Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-lock-policy.html). -// -// This operation is idempotent. You can successfully invoke this operation -// multiple times, if the vault lock is in the InProgress state or if there -// is no policy associated with the vault. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Glacier's -// API operation AbortVaultLock for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) AbortVaultLock(input *AbortVaultLockInput) (*AbortVaultLockOutput, error) { - req, out := c.AbortVaultLockRequest(input) - err := req.Send() - return out, err -} - -const opAddTagsToVault = "AddTagsToVault" - -// AddTagsToVaultRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToVault operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToVault for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToVault method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToVaultRequest method. -// req, resp := client.AddTagsToVaultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) AddTagsToVaultRequest(input *AddTagsToVaultInput) (req *request.Request, output *AddTagsToVaultOutput) { - op := &request.Operation{ - Name: opAddTagsToVault, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/vaults/{vaultName}/tags?operation=add", - } - - if input == nil { - input = &AddTagsToVaultInput{} - } - - output = &AddTagsToVaultOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddTagsToVault API operation for Amazon Glacier. -// -// This operation adds the specified tags to a vault. Each tag is composed of -// a key and a value. Each vault can have up to 10 tags. If your request would -// cause the tag limit for the vault to be exceeded, the operation throws the -// LimitExceededException error. If a tag already exists on the vault under -// a specified key, the existing key value will be overwritten. For more information -// about tags, see Tagging Amazon Glacier Resources (http://docs.aws.amazon.com/amazonglacier/latest/dev/tagging.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 Glacier's -// API operation AddTagsToVault for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Returned if the request results in a vault or account limit being exceeded. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) AddTagsToVault(input *AddTagsToVaultInput) (*AddTagsToVaultOutput, error) { - req, out := c.AddTagsToVaultRequest(input) - err := req.Send() - return out, err -} - -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) -// } -func (c *Glacier) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) (req *request.Request, output *ArchiveCreationOutput) { - op := &request.Operation{ - Name: opCompleteMultipartUpload, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}", - } - - if input == nil { - input = &CompleteMultipartUploadInput{} - } - - output = &ArchiveCreationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CompleteMultipartUpload API operation for Amazon Glacier. -// -// You call this operation to inform Amazon Glacier that all the archive parts -// have been uploaded and that Amazon Glacier can now assemble the archive from -// the uploaded parts. After assembling and saving the archive to the vault, -// Amazon Glacier returns the URI path of the newly created archive resource. -// Using the URI path, you can then access the archive. After you upload an -// archive, you should save the archive ID returned to retrieve the archive -// at a later point. You can also get the vault inventory to obtain a list of -// archive IDs in a vault. For more information, see InitiateJob. -// -// In the request, you must include the computed SHA256 tree hash of the entire -// archive you have uploaded. For information about computing a SHA256 tree -// hash, see Computing Checksums (http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html). -// On the server side, Amazon Glacier also constructs the SHA256 tree hash of -// the assembled archive. If the values match, Amazon Glacier saves the archive -// to the vault; otherwise, it returns an error, and the operation fails. The -// ListParts operation returns a list of parts uploaded for a specific multipart -// upload. It includes checksum information for each uploaded part that can -// be used to debug a bad checksum issue. -// -// Additionally, Amazon Glacier also checks for any missing content ranges when -// assembling the archive, if missing content ranges are found, Amazon Glacier -// returns an error and the operation fails. -// -// Complete Multipart Upload is an idempotent operation. After your first successful -// complete multipart upload, if you call the operation again within a short -// period, the operation will succeed and return the same archive ID. This is -// useful in the event you experience a network issue that causes an aborted -// connection or receive a 500 server error, in which case you can repeat your -// Complete Multipart Upload request and get the same archive ID without creating -// duplicate archives. Note, however, that after the multipart upload completes, -// you cannot call the List Parts operation and the multipart upload will not -// appear in List Multipart Uploads response, even if idempotent complete is -// possible. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Uploading Large Archives -// in Parts (Multipart Upload) (http://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-archive-mpu.html) -// and Complete Multipart Upload (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-complete-upload.html) -// in the Amazon Glacier 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 Glacier's -// API operation CompleteMultipartUpload for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (*ArchiveCreationOutput, error) { - req, out := c.CompleteMultipartUploadRequest(input) - err := req.Send() - return out, err -} - -const opCompleteVaultLock = "CompleteVaultLock" - -// CompleteVaultLockRequest generates a "aws/request.Request" representing the -// client's request for the CompleteVaultLock operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CompleteVaultLock for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CompleteVaultLock method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CompleteVaultLockRequest method. -// req, resp := client.CompleteVaultLockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) CompleteVaultLockRequest(input *CompleteVaultLockInput) (req *request.Request, output *CompleteVaultLockOutput) { - op := &request.Operation{ - Name: opCompleteVaultLock, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/vaults/{vaultName}/lock-policy/{lockId}", - } - - if input == nil { - input = &CompleteVaultLockInput{} - } - - output = &CompleteVaultLockOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CompleteVaultLock API operation for Amazon Glacier. -// -// This operation completes the vault locking process by transitioning the vault -// lock from the InProgress state to the Locked state, which causes the vault -// lock policy to become unchangeable. A vault lock is put into the InProgress -// state by calling InitiateVaultLock. You can obtain the state of the vault -// lock by calling GetVaultLock. For more information about the vault locking -// process, Amazon Glacier Vault Lock (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-lock.html). -// -// This operation is idempotent. This request is always successful if the vault -// lock is in the Locked state and the provided lock ID matches the lock ID -// originally used to lock the vault. -// -// If an invalid lock ID is passed in the request when the vault lock is in -// the Locked state, the operation returns an AccessDeniedException error. If -// an invalid lock ID is passed in the request when the vault lock is in the -// InProgress state, the operation throws an InvalidParameter 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 Glacier's -// API operation CompleteVaultLock for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) CompleteVaultLock(input *CompleteVaultLockInput) (*CompleteVaultLockOutput, error) { - req, out := c.CompleteVaultLockRequest(input) - err := req.Send() - return out, err -} - -const opCreateVault = "CreateVault" - -// CreateVaultRequest generates a "aws/request.Request" representing the -// client's request for the CreateVault operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVault for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVault method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVaultRequest method. -// req, resp := client.CreateVaultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) CreateVaultRequest(input *CreateVaultInput) (req *request.Request, output *CreateVaultOutput) { - op := &request.Operation{ - Name: opCreateVault, - HTTPMethod: "PUT", - HTTPPath: "/{accountId}/vaults/{vaultName}", - } - - if input == nil { - input = &CreateVaultInput{} - } - - output = &CreateVaultOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVault API operation for Amazon Glacier. -// -// This operation creates a new vault with the specified name. The name of the -// vault must be unique within a region for an AWS account. You can create up -// to 1,000 vaults per account. If you need to create more vaults, contact Amazon -// Glacier. -// -// You must use the following guidelines when naming a vault. -// -// * Names can be between 1 and 255 characters long. -// -// * Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), -// and '.' (period). -// -// This operation is idempotent. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Creating a Vault -// in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/creating-vaults.html) -// and Create Vault (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-put.html) -// in the Amazon Glacier 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 Glacier's -// API operation CreateVault for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Returned if the request results in a vault or account limit being exceeded. -// -func (c *Glacier) CreateVault(input *CreateVaultInput) (*CreateVaultOutput, error) { - req, out := c.CreateVaultRequest(input) - err := req.Send() - return out, err -} - -const opDeleteArchive = "DeleteArchive" - -// DeleteArchiveRequest generates a "aws/request.Request" representing the -// client's request for the DeleteArchive operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteArchive for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteArchive method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteArchiveRequest method. -// req, resp := client.DeleteArchiveRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) DeleteArchiveRequest(input *DeleteArchiveInput) (req *request.Request, output *DeleteArchiveOutput) { - op := &request.Operation{ - Name: opDeleteArchive, - HTTPMethod: "DELETE", - HTTPPath: "/{accountId}/vaults/{vaultName}/archives/{archiveId}", - } - - if input == nil { - input = &DeleteArchiveInput{} - } - - output = &DeleteArchiveOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteArchive API operation for Amazon Glacier. -// -// This operation deletes an archive from a vault. Subsequent requests to initiate -// a retrieval of this archive will fail. Archive retrievals that are in progress -// for this archive ID may or may not succeed according to the following scenarios: -// -// * If the archive retrieval job is actively preparing the data for download -// when Amazon Glacier receives the delete archive request, the archival -// retrieval operation might fail. -// -// * If the archive retrieval job has successfully prepared the archive for -// download when Amazon Glacier receives the delete archive request, you -// will be able to download the output. -// -// This operation is idempotent. Attempting to delete an already-deleted archive -// does not result in an error. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Deleting an Archive -// in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/deleting-an-archive.html) -// and Delete Archive (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-delete.html) -// in the Amazon Glacier 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 Glacier's -// API operation DeleteArchive for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) DeleteArchive(input *DeleteArchiveInput) (*DeleteArchiveOutput, error) { - req, out := c.DeleteArchiveRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVault = "DeleteVault" - -// DeleteVaultRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVault operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVault for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVault method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVaultRequest method. -// req, resp := client.DeleteVaultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) DeleteVaultRequest(input *DeleteVaultInput) (req *request.Request, output *DeleteVaultOutput) { - op := &request.Operation{ - Name: opDeleteVault, - HTTPMethod: "DELETE", - HTTPPath: "/{accountId}/vaults/{vaultName}", - } - - if input == nil { - input = &DeleteVaultInput{} - } - - output = &DeleteVaultOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVault API operation for Amazon Glacier. -// -// This operation deletes a vault. Amazon Glacier will delete a vault only if -// there are no archives in the vault as of the last inventory and there have -// been no writes to the vault since the last inventory. If either of these -// conditions is not satisfied, the vault deletion fails (that is, the vault -// is not removed) and Amazon Glacier returns an error. You can use DescribeVault -// to return the number of archives in a vault, and you can use Initiate a Job -// (POST jobs) (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html) -// to initiate a new inventory retrieval for a vault. The inventory contains -// the archive IDs you use to delete archives using Delete Archive (DELETE archive) -// (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-delete.html). -// -// This operation is idempotent. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Deleting a Vault -// in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/deleting-vaults.html) -// and Delete Vault (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-delete.html) -// in the Amazon Glacier 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 Glacier's -// API operation DeleteVault for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) DeleteVault(input *DeleteVaultInput) (*DeleteVaultOutput, error) { - req, out := c.DeleteVaultRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVaultAccessPolicy = "DeleteVaultAccessPolicy" - -// DeleteVaultAccessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVaultAccessPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVaultAccessPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVaultAccessPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVaultAccessPolicyRequest method. -// req, resp := client.DeleteVaultAccessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) DeleteVaultAccessPolicyRequest(input *DeleteVaultAccessPolicyInput) (req *request.Request, output *DeleteVaultAccessPolicyOutput) { - op := &request.Operation{ - Name: opDeleteVaultAccessPolicy, - HTTPMethod: "DELETE", - HTTPPath: "/{accountId}/vaults/{vaultName}/access-policy", - } - - if input == nil { - input = &DeleteVaultAccessPolicyInput{} - } - - output = &DeleteVaultAccessPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVaultAccessPolicy API operation for Amazon Glacier. -// -// This operation deletes the access policy associated with the specified vault. -// The operation is eventually consistent; that is, it might take some time -// for Amazon Glacier to completely remove the access policy, and you might -// still see the effect of the policy for a short time after you send the delete -// request. -// -// This operation is idempotent. You can invoke delete multiple times, even -// if there is no policy associated with the vault. For more information about -// vault access policies, see Amazon Glacier Access Control with Vault Access -// Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-access-policy.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 Glacier's -// API operation DeleteVaultAccessPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) DeleteVaultAccessPolicy(input *DeleteVaultAccessPolicyInput) (*DeleteVaultAccessPolicyOutput, error) { - req, out := c.DeleteVaultAccessPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVaultNotifications = "DeleteVaultNotifications" - -// DeleteVaultNotificationsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVaultNotifications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVaultNotifications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVaultNotifications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVaultNotificationsRequest method. -// req, resp := client.DeleteVaultNotificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) DeleteVaultNotificationsRequest(input *DeleteVaultNotificationsInput) (req *request.Request, output *DeleteVaultNotificationsOutput) { - op := &request.Operation{ - Name: opDeleteVaultNotifications, - HTTPMethod: "DELETE", - HTTPPath: "/{accountId}/vaults/{vaultName}/notification-configuration", - } - - if input == nil { - input = &DeleteVaultNotificationsInput{} - } - - output = &DeleteVaultNotificationsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVaultNotifications API operation for Amazon Glacier. -// -// This operation deletes the notification configuration set for a vault. The -// operation is eventually consistent; that is, it might take some time for -// Amazon Glacier to completely disable the notifications and you might still -// receive some notifications for a short time after you send the delete request. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Configuring Vault -// Notifications in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html) -// and Delete Vault Notification Configuration (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-delete.html) -// in the Amazon Glacier 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 Glacier's -// API operation DeleteVaultNotifications for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) DeleteVaultNotifications(input *DeleteVaultNotificationsInput) (*DeleteVaultNotificationsOutput, error) { - req, out := c.DeleteVaultNotificationsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeJob = "DescribeJob" - -// DescribeJobRequest generates a "aws/request.Request" representing the -// client's request for the DescribeJob operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeJob for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeJob method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeJobRequest method. -// req, resp := client.DescribeJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) DescribeJobRequest(input *DescribeJobInput) (req *request.Request, output *JobDescription) { - op := &request.Operation{ - Name: opDescribeJob, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/jobs/{jobId}", - } - - if input == nil { - input = &DescribeJobInput{} - } - - output = &JobDescription{} - req = c.newRequest(op, input, output) - return -} - -// DescribeJob API operation for Amazon Glacier. -// -// This operation returns information about a job you previously initiated, -// including the job initiation date, the user who initiated the job, the job -// status code/message and the Amazon SNS topic to notify after Amazon Glacier -// completes the job. For more information about initiating a job, see InitiateJob. -// -// This operation enables you to check the status of your job. However, it is -// strongly recommended that you set up an Amazon SNS topic and specify it in -// your initiate job request so that Amazon Glacier can notify the topic after -// it completes the job. -// -// A job ID will not expire for at least 24 hours after Amazon Glacier completes -// the job. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For information about the underlying REST API, see Working with Archives -// in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-describe-job-get.html) -// in the Amazon Glacier 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 Glacier's -// API operation DescribeJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) DescribeJob(input *DescribeJobInput) (*JobDescription, error) { - req, out := c.DescribeJobRequest(input) - err := req.Send() - return out, err -} - -const opDescribeVault = "DescribeVault" - -// DescribeVaultRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVault operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVault for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVault method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVaultRequest method. -// req, resp := client.DescribeVaultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) DescribeVaultRequest(input *DescribeVaultInput) (req *request.Request, output *DescribeVaultOutput) { - op := &request.Operation{ - Name: opDescribeVault, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}", - } - - if input == nil { - input = &DescribeVaultInput{} - } - - output = &DescribeVaultOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVault API operation for Amazon Glacier. -// -// This operation returns information about a vault, including the vault's Amazon -// Resource Name (ARN), the date the vault was created, the number of archives -// it contains, and the total size of all the archives in the vault. The number -// of archives and their total size are as of the last inventory generation. -// This means that if you add or remove an archive from a vault, and then immediately -// use Describe Vault, the change in contents will not be immediately reflected. -// If you want to retrieve the latest inventory of the vault, use InitiateJob. -// Amazon Glacier generates vault inventories approximately daily. For more -// information, see Downloading a Vault Inventory in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-inventory.html). -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Retrieving Vault -// Metadata in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/retrieving-vault-info.html) -// and Describe Vault (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-get.html) -// in the Amazon Glacier 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 Glacier's -// API operation DescribeVault for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) DescribeVault(input *DescribeVaultInput) (*DescribeVaultOutput, error) { - req, out := c.DescribeVaultRequest(input) - err := req.Send() - return out, err -} - -const opGetDataRetrievalPolicy = "GetDataRetrievalPolicy" - -// GetDataRetrievalPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetDataRetrievalPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDataRetrievalPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDataRetrievalPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDataRetrievalPolicyRequest method. -// req, resp := client.GetDataRetrievalPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) GetDataRetrievalPolicyRequest(input *GetDataRetrievalPolicyInput) (req *request.Request, output *GetDataRetrievalPolicyOutput) { - op := &request.Operation{ - Name: opGetDataRetrievalPolicy, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/policies/data-retrieval", - } - - if input == nil { - input = &GetDataRetrievalPolicyInput{} - } - - output = &GetDataRetrievalPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataRetrievalPolicy API operation for Amazon Glacier. -// -// This operation returns the current data retrieval policy for the account -// and region specified in the GET request. For more information about data -// retrieval policies, see Amazon Glacier Data Retrieval Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/data-retrieval-policy.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 Glacier's -// API operation GetDataRetrievalPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) GetDataRetrievalPolicy(input *GetDataRetrievalPolicyInput) (*GetDataRetrievalPolicyOutput, error) { - req, out := c.GetDataRetrievalPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetJobOutput = "GetJobOutput" - -// GetJobOutputRequest generates a "aws/request.Request" representing the -// client's request for the GetJobOutput operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetJobOutput for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetJobOutput method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetJobOutputRequest method. -// req, resp := client.GetJobOutputRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) GetJobOutputRequest(input *GetJobOutputInput) (req *request.Request, output *GetJobOutputOutput) { - op := &request.Operation{ - Name: opGetJobOutput, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/jobs/{jobId}/output", - } - - if input == nil { - input = &GetJobOutputInput{} - } - - output = &GetJobOutputOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetJobOutput API operation for Amazon Glacier. -// -// This operation downloads the output of the job you initiated using InitiateJob. -// Depending on the job type you specified when you initiated the job, the output -// will be either the content of an archive or a vault inventory. -// -// You can download all the job output or download a portion of the output by -// specifying a byte range. In the case of an archive retrieval job, depending -// on the byte range you specify, Amazon Glacier returns the checksum for the -// portion of the data. You can compute the checksum on the client and verify -// that the values match to ensure the portion you downloaded is the correct -// data. -// -// A job ID will not expire for at least 24 hours after Amazon Glacier completes -// the job. That a byte range. For both archive and inventory retrieval jobs, -// you should verify the downloaded size against the size returned in the headers -// from the Get Job Output response. -// -// For archive retrieval jobs, you should also verify that the size is what -// you expected. If you download a portion of the output, the expected size -// is based on the range of bytes you specified. For example, if you specify -// a range of bytes=0-1048575, you should verify your download size is 1,048,576 -// bytes. If you download an entire archive, the expected size is the size of -// the archive when you uploaded it to Amazon Glacier The expected size is also -// returned in the headers from the Get Job Output response. -// -// In the case of an archive retrieval job, depending on the byte range you -// specify, Amazon Glacier returns the checksum for the portion of the data. -// To ensure the portion you downloaded is the correct data, compute the checksum -// on the client, verify that the values match, and verify that the size is -// what you expected. -// -// A job ID does not expire for at least 24 hours after Amazon Glacier completes -// the job. That is, you can download the job output within the 24 hours period -// after Amazon Glacier completes the job. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and the underlying REST API, see Downloading a -// Vault Inventory (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-inventory.html), -// Downloading an Archive (http://docs.aws.amazon.com/amazonglacier/latest/dev/downloading-an-archive.html), -// and Get Job Output (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-job-output-get.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 Glacier's -// API operation GetJobOutput for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) GetJobOutput(input *GetJobOutputInput) (*GetJobOutputOutput, error) { - req, out := c.GetJobOutputRequest(input) - err := req.Send() - return out, err -} - -const opGetVaultAccessPolicy = "GetVaultAccessPolicy" - -// GetVaultAccessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetVaultAccessPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetVaultAccessPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetVaultAccessPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetVaultAccessPolicyRequest method. -// req, resp := client.GetVaultAccessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) GetVaultAccessPolicyRequest(input *GetVaultAccessPolicyInput) (req *request.Request, output *GetVaultAccessPolicyOutput) { - op := &request.Operation{ - Name: opGetVaultAccessPolicy, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/access-policy", - } - - if input == nil { - input = &GetVaultAccessPolicyInput{} - } - - output = &GetVaultAccessPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVaultAccessPolicy API operation for Amazon Glacier. -// -// This operation retrieves the access-policy subresource set on the vault; -// for more information on setting this subresource, see Set Vault Access Policy -// (PUT access-policy) (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-SetVaultAccessPolicy.html). -// If there is no access policy set on the vault, the operation returns a 404 -// Not found error. For more information about vault access policies, see Amazon -// Glacier Access Control with Vault Access Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-access-policy.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 Glacier's -// API operation GetVaultAccessPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) GetVaultAccessPolicy(input *GetVaultAccessPolicyInput) (*GetVaultAccessPolicyOutput, error) { - req, out := c.GetVaultAccessPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetVaultLock = "GetVaultLock" - -// GetVaultLockRequest generates a "aws/request.Request" representing the -// client's request for the GetVaultLock operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetVaultLock for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetVaultLock method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetVaultLockRequest method. -// req, resp := client.GetVaultLockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) GetVaultLockRequest(input *GetVaultLockInput) (req *request.Request, output *GetVaultLockOutput) { - op := &request.Operation{ - Name: opGetVaultLock, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/lock-policy", - } - - if input == nil { - input = &GetVaultLockInput{} - } - - output = &GetVaultLockOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVaultLock API operation for Amazon Glacier. -// -// This operation retrieves the following attributes from the lock-policy subresource -// set on the specified vault: -// -// * The vault lock policy set on the vault. -// -// * The state of the vault lock, which is either InProgess or Locked. -// -// * When the lock ID expires. The lock ID is used to complete the vault -// locking process. -// -// * When the vault lock was initiated and put into the InProgress state. -// -// A vault lock is put into the InProgress state by calling InitiateVaultLock. -// A vault lock is put into the Locked state by calling CompleteVaultLock. You -// can abort the vault locking process by calling AbortVaultLock. For more information -// about the vault locking process, Amazon Glacier Vault Lock (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-lock.html). -// -// If there is no vault lock policy set on the vault, the operation returns -// a 404 Not found error. For more information about vault lock policies, Amazon -// Glacier Access Control with Vault Lock Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-lock-policy.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 Glacier's -// API operation GetVaultLock for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) GetVaultLock(input *GetVaultLockInput) (*GetVaultLockOutput, error) { - req, out := c.GetVaultLockRequest(input) - err := req.Send() - return out, err -} - -const opGetVaultNotifications = "GetVaultNotifications" - -// GetVaultNotificationsRequest generates a "aws/request.Request" representing the -// client's request for the GetVaultNotifications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetVaultNotifications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetVaultNotifications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetVaultNotificationsRequest method. -// req, resp := client.GetVaultNotificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) GetVaultNotificationsRequest(input *GetVaultNotificationsInput) (req *request.Request, output *GetVaultNotificationsOutput) { - op := &request.Operation{ - Name: opGetVaultNotifications, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/notification-configuration", - } - - if input == nil { - input = &GetVaultNotificationsInput{} - } - - output = &GetVaultNotificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVaultNotifications API operation for Amazon Glacier. -// -// This operation retrieves the notification-configuration subresource of the -// specified vault. -// -// For information about setting a notification configuration on a vault, see -// SetVaultNotifications. If a notification configuration for a vault is not -// set, the operation returns a 404 Not Found error. For more information about -// vault notifications, see Configuring Vault Notifications in Amazon Glacier -// (http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html). -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Configuring Vault -// Notifications in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html) -// and Get Vault Notification Configuration (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-get.html) -// in the Amazon Glacier 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 Glacier's -// API operation GetVaultNotifications for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) GetVaultNotifications(input *GetVaultNotificationsInput) (*GetVaultNotificationsOutput, error) { - req, out := c.GetVaultNotificationsRequest(input) - err := req.Send() - return out, err -} - -const opInitiateJob = "InitiateJob" - -// InitiateJobRequest generates a "aws/request.Request" representing the -// client's request for the InitiateJob operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InitiateJob for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InitiateJob method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InitiateJobRequest method. -// req, resp := client.InitiateJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) InitiateJobRequest(input *InitiateJobInput) (req *request.Request, output *InitiateJobOutput) { - op := &request.Operation{ - Name: opInitiateJob, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/vaults/{vaultName}/jobs", - } - - if input == nil { - input = &InitiateJobInput{} - } - - output = &InitiateJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// InitiateJob API operation for Amazon Glacier. -// -// This operation initiates a job of the specified type. In this release, you -// can initiate a job to retrieve either an archive or a vault inventory (a -// list of archives in a vault). -// -// Retrieving data from Amazon Glacier is a two-step process: -// -// Initiate a retrieval job. -// -// A data retrieval policy can cause your initiate retrieval job request to -// fail with a PolicyEnforcedException exception. For more information about -// data retrieval policies, see Amazon Glacier Data Retrieval Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/data-retrieval-policy.html). -// For more information about the PolicyEnforcedException exception, see Error -// Responses (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-error-responses.html). -// -// After the job completes, download the bytes. -// -// The retrieval request is executed asynchronously. When you initiate a retrieval -// job, Amazon Glacier creates a job and returns a job ID in the response. When -// Amazon Glacier completes the job, you can get the job output (archive or -// inventory data). For information about getting job output, see GetJobOutput -// operation. -// -// The job must complete before you can get its output. To determine when a -// job is complete, you have the following options: -// -// * Use Amazon SNS Notification You can specify an Amazon Simple Notification -// Service (Amazon SNS) topic to which Amazon Glacier can post a notification -// after the job is completed. You can specify an SNS topic per job request. -// The notification is sent only after Amazon Glacier completes the job. -// In addition to specifying an SNS topic per job request, you can configure -// vault notifications for a vault so that job notifications are always sent. -// For more information, see SetVaultNotifications. -// -// * Get job details You can make a DescribeJob request to obtain job status -// information while a job is in progress. However, it is more efficient -// to use an Amazon SNS notification to determine when a job is complete. -// -// The information you get via notification is same that you get by calling -// DescribeJob. -// -// If for a specific event, you add both the notification configuration on the -// vault and also specify an SNS topic in your initiate job request, Amazon -// Glacier sends both notifications. For more information, see SetVaultNotifications. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// About the Vault Inventory -// -// Amazon Glacier prepares an inventory for each vault periodically, every 24 -// hours. When you initiate a job for a vault inventory, Amazon Glacier returns -// the last inventory for the vault. The inventory data you get might be up -// to a day or two days old. Also, the initiate inventory job might take some -// time to complete before you can download the vault inventory. So you do not -// want to retrieve a vault inventory for each vault operation. However, in -// some scenarios, you might find the vault inventory useful. For example, when -// you upload an archive, you can provide an archive description but not an -// archive name. Amazon Glacier provides you a unique archive ID, an opaque -// string of characters. So, you might maintain your own database that maps -// archive names to their corresponding Amazon Glacier assigned archive IDs. -// You might find the vault inventory useful in the event you need to reconcile -// information in your database with the actual vault inventory. -// -// Range Inventory Retrieval -// -// You can limit the number of inventory items retrieved by filtering on the -// archive creation date or by setting a limit. -// -// Filtering by Archive Creation Date -// -// You can retrieve inventory items for archives created between StartDate and -// EndDate by specifying values for these parameters in the InitiateJob request. -// Archives created on or after the StartDate and before the EndDate will be -// returned. If you only provide the StartDate without the EndDate, you will -// retrieve the inventory for all archives created on or after the StartDate. -// If you only provide the EndDate without the StartDate, you will get back -// the inventory for all archives created before the EndDate. -// -// Limiting Inventory Items per Retrieval -// -// You can limit the number of inventory items returned by setting the Limit -// parameter in the InitiateJob request. The inventory job output will contain -// inventory items up to the specified Limit. If there are more inventory items -// available, the result is paginated. After a job is complete you can use the -// DescribeJob operation to get a marker that you use in a subsequent InitiateJob -// request. The marker will indicate the starting point to retrieve the next -// set of inventory items. You can page through your entire inventory by repeatedly -// making InitiateJob requests with the marker from the previous DescribeJob -// output, until you get a marker from DescribeJob that returns null, indicating -// that there are no more inventory items available. -// -// You can use the Limit parameter together with the date range parameters. -// -// About Ranged Archive Retrieval -// -// You can initiate an archive retrieval for the whole archive or a range of -// the archive. In the case of ranged archive retrieval, you specify a byte -// range to return or the whole archive. The range specified must be megabyte -// (MB) aligned, that is the range start value must be divisible by 1 MB and -// range end value plus 1 must be divisible by 1 MB or equal the end of the -// archive. If the ranged archive retrieval is not megabyte aligned, this operation -// returns a 400 response. Furthermore, to ensure you get checksum values for -// data you download using Get Job Output API, the range must be tree hash aligned. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and the underlying REST API, see Initiate a Job -// (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html) -// and Downloading a Vault Inventory (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-inventory.html) -// -// Expedited and Bulk Archive Retrievals -// -// When retrieving an archive, you can specify one of the following options -// in the Tier field of the request body: -// -// * Standard The default type of retrieval, which allows access to any of -// your archives within several hours. Standard retrievals typically complete -// within 3–5 hours. -// -// * Bulk Amazon Glacier’s lowest-cost retrieval option, which enables you -// to retrieve large amounts of data inexpensively in a day. Bulk retrieval -// requests typically complete within 5–12 hours. -// -// * Expedited Amazon Glacier’s option for the fastest retrievals. Archives -// requested using the expedited retrievals typically become accessible within -// 1–5 minutes. -// -// For more information about expedited and bulk retrievals, see Retrieving -// Amazon Glacier Archives (http://docs.aws.amazon.com/amazonglacier/latest/dev/downloading-an-archive-two-steps.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 Glacier's -// API operation InitiateJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodePolicyEnforcedException "PolicyEnforcedException" -// Returned if a retrieval job would exceed the current data policy's retrieval -// rate limit. For more information about data retrieval policies, -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeInsufficientCapacityException "InsufficientCapacityException" -// Returned if there is insufficient capacity to process this expedited request. -// This error only applies to expedited retrievals and not to standard or bulk -// retrievals. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) InitiateJob(input *InitiateJobInput) (*InitiateJobOutput, error) { - req, out := c.InitiateJobRequest(input) - err := req.Send() - return out, err -} - -const opInitiateMultipartUpload = "InitiateMultipartUpload" - -// InitiateMultipartUploadRequest generates a "aws/request.Request" representing the -// client's request for the InitiateMultipartUpload operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InitiateMultipartUpload for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InitiateMultipartUpload method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InitiateMultipartUploadRequest method. -// req, resp := client.InitiateMultipartUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) InitiateMultipartUploadRequest(input *InitiateMultipartUploadInput) (req *request.Request, output *InitiateMultipartUploadOutput) { - op := &request.Operation{ - Name: opInitiateMultipartUpload, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/vaults/{vaultName}/multipart-uploads", - } - - if input == nil { - input = &InitiateMultipartUploadInput{} - } - - output = &InitiateMultipartUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// InitiateMultipartUpload API operation for Amazon Glacier. -// -// This operation initiates a multipart upload. Amazon Glacier creates a multipart -// upload resource and returns its ID in the response. The multipart upload -// ID is used in subsequent requests to upload parts of an archive (see UploadMultipartPart). -// -// When you initiate a multipart upload, you specify the part size in number -// of bytes. The part size must be a megabyte (1024 KB) multiplied by a power -// of 2-for example, 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 -// (8 MB), and so on. The minimum allowable part size is 1 MB, and the maximum -// is 4 GB. -// -// Every part you upload to this resource (see UploadMultipartPart), except -// the last one, must have the same size. The last one can be the same size -// or smaller. For example, suppose you want to upload a 16.2 MB file. If you -// initiate the multipart upload with a part size of 4 MB, you will upload four -// parts of 4 MB each and one part of 0.2 MB. -// -// You don't need to know the size of the archive when you start a multipart -// upload because Amazon Glacier does not require you to specify the overall -// archive size. -// -// After you complete the multipart upload, Amazon Glacier removes the multipart -// upload resource referenced by the ID. Amazon Glacier also removes the multipart -// upload resource if you cancel the multipart upload or it may be removed if -// there is no activity for a period of 24 hours. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Uploading Large Archives -// in Parts (Multipart Upload) (http://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-archive-mpu.html) -// and Initiate Multipart Upload (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-initiate-upload.html) -// in the Amazon Glacier 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 Glacier's -// API operation InitiateMultipartUpload for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) InitiateMultipartUpload(input *InitiateMultipartUploadInput) (*InitiateMultipartUploadOutput, error) { - req, out := c.InitiateMultipartUploadRequest(input) - err := req.Send() - return out, err -} - -const opInitiateVaultLock = "InitiateVaultLock" - -// InitiateVaultLockRequest generates a "aws/request.Request" representing the -// client's request for the InitiateVaultLock operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InitiateVaultLock for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InitiateVaultLock method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InitiateVaultLockRequest method. -// req, resp := client.InitiateVaultLockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) InitiateVaultLockRequest(input *InitiateVaultLockInput) (req *request.Request, output *InitiateVaultLockOutput) { - op := &request.Operation{ - Name: opInitiateVaultLock, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/vaults/{vaultName}/lock-policy", - } - - if input == nil { - input = &InitiateVaultLockInput{} - } - - output = &InitiateVaultLockOutput{} - req = c.newRequest(op, input, output) - return -} - -// InitiateVaultLock API operation for Amazon Glacier. -// -// This operation initiates the vault locking process by doing the following: -// -// * Installing a vault lock policy on the specified vault. -// -// * Setting the lock state of vault lock to InProgress. -// -// * Returning a lock ID, which is used to complete the vault locking process. -// -// You can set one vault lock policy for each vault and this policy can be up -// to 20 KB in size. For more information about vault lock policies, see Amazon -// Glacier Access Control with Vault Lock Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-lock-policy.html). -// -// You must complete the vault locking process within 24 hours after the vault -// lock enters the InProgress state. After the 24 hour window ends, the lock -// ID expires, the vault automatically exits the InProgress state, and the vault -// lock policy is removed from the vault. You call CompleteVaultLock to complete -// the vault locking process by setting the state of the vault lock to Locked. -// -// After a vault lock is in the Locked state, you cannot initiate a new vault -// lock for the vault. -// -// You can abort the vault locking process by calling AbortVaultLock. You can -// get the state of the vault lock by calling GetVaultLock. For more information -// about the vault locking process, Amazon Glacier Vault Lock (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-lock.html). -// -// If this operation is called when the vault lock is in the InProgress state, -// the operation returns an AccessDeniedException error. When the vault lock -// is in the InProgress state you must call AbortVaultLock before you can initiate -// a new vault lock 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 Glacier's -// API operation InitiateVaultLock for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) InitiateVaultLock(input *InitiateVaultLockInput) (*InitiateVaultLockOutput, error) { - req, out := c.InitiateVaultLockRequest(input) - err := req.Send() - return out, err -} - -const opListJobs = "ListJobs" - -// ListJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListJobs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListJobs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListJobs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListJobsRequest method. -// req, resp := client.ListJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) ListJobsRequest(input *ListJobsInput) (req *request.Request, output *ListJobsOutput) { - op := &request.Operation{ - Name: opListJobs, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/jobs", - Paginator: &request.Paginator{ - InputTokens: []string{"marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListJobsInput{} - } - - output = &ListJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListJobs API operation for Amazon Glacier. -// -// This operation lists jobs for a vault, including jobs that are in-progress -// and jobs that have recently finished. -// -// Amazon Glacier retains recently completed jobs for a period before deleting -// them; however, it eventually removes completed jobs. The output of completed -// jobs can be retrieved. Retaining completed jobs for a period of time after -// they have completed enables you to get a job output in the event you miss -// the job completion notification or your first attempt to download it fails. -// For example, suppose you start an archive retrieval job to download an archive. -// After the job completes, you start to download the archive but encounter -// a network error. In this scenario, you can retry and download the archive -// while the job exists. -// -// To retrieve an archive or retrieve a vault inventory from Amazon Glacier, -// you first initiate a job, and after the job completes, you download the data. -// For an archive retrieval, the output is the archive data. For an inventory -// retrieval, it is the inventory list. The List Job operation returns a list -// of these jobs sorted by job initiation time. -// -// The List Jobs operation supports pagination. You should always check the -// response Marker field. If there are no more jobs to list, the Marker field -// is set to null. If there are more jobs to list, the Marker field is set to -// a non-null value, which you can use to continue the pagination of the list. -// To return a list of jobs that begins at a specific job, set the marker request -// parameter to the Marker value for that job that you obtained from a previous -// List Jobs request. -// -// You can set a maximum limit for the number of jobs returned in the response -// by specifying the limit parameter in the request. The default limit is 1000. -// The number of jobs returned might be fewer than the limit, but the number -// of returned jobs never exceeds the limit. -// -// Additionally, you can filter the jobs list returned by specifying the optional -// statuscode parameter or completed parameter, or both. Using the statuscode -// parameter, you can specify to return only jobs that match either the InProgress, -// Succeeded, or Failed status. Using the completed parameter, you can specify -// to return only jobs that were completed (true) or jobs that were not completed -// (false). -// -// For the underlying REST API, see List Jobs (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-jobs-get.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 Glacier's -// API operation ListJobs for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { - req, out := c.ListJobsRequest(input) - err := req.Send() - return out, err -} - -// ListJobsPages iterates over the pages of a ListJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListJobs 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 ListJobs operation. -// pageNum := 0 -// err := client.ListJobsPages(params, -// func(page *ListJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glacier) ListJobsPages(input *ListJobsInput, fn func(p *ListJobsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListJobsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListJobsOutput), lastPage) - }) -} - -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) -// } -func (c *Glacier) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req *request.Request, output *ListMultipartUploadsOutput) { - op := &request.Operation{ - Name: opListMultipartUploads, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/multipart-uploads", - Paginator: &request.Paginator{ - InputTokens: []string{"marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMultipartUploadsInput{} - } - - output = &ListMultipartUploadsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMultipartUploads API operation for Amazon Glacier. -// -// This operation lists in-progress multipart uploads for the specified vault. -// An in-progress multipart upload is a multipart upload that has been initiated -// by an InitiateMultipartUpload request, but has not yet been completed or -// aborted. The list returned in the List Multipart Upload response has no guaranteed -// order. -// -// The List Multipart Uploads operation supports pagination. By default, this -// operation returns up to 1,000 multipart uploads in the response. You should -// always check the response for a marker at which to continue the list; if -// there are no more items the marker is null. To return a list of multipart -// uploads that begins at a specific upload, set the marker request parameter -// to the value you obtained from a previous List Multipart Upload request. -// You can also limit the number of uploads returned in the response by specifying -// the limit parameter in the request. -// -// Note the difference between this operation and listing parts (ListParts). -// The List Multipart Uploads operation lists all multipart uploads for a vault -// and does not require a multipart upload ID. The List Parts operation requires -// a multipart upload ID since parts are associated with a single upload. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and the underlying REST API, see Working with -// Archives in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html) -// and List Multipart Uploads (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-list-uploads.html) -// in the Amazon Glacier 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 Glacier's -// API operation ListMultipartUploads for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultipartUploadsOutput, error) { - req, out := c.ListMultipartUploadsRequest(input) - err := req.Send() - return out, err -} - -// 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 *Glacier) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(p *ListMultipartUploadsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListMultipartUploadsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListMultipartUploadsOutput), lastPage) - }) -} - -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) -// } -func (c *Glacier) ListPartsRequest(input *ListPartsInput) (req *request.Request, output *ListPartsOutput) { - op := &request.Operation{ - Name: opListParts, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}", - Paginator: &request.Paginator{ - InputTokens: []string{"marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPartsInput{} - } - - output = &ListPartsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListParts API operation for Amazon Glacier. -// -// This operation lists the parts of an archive that have been uploaded in a -// specific multipart upload. You can make this request at any time during an -// in-progress multipart upload before you complete the upload (see CompleteMultipartUpload. -// List Parts returns an error for completed uploads. The list returned in the -// List Parts response is sorted by part range. -// -// The List Parts operation supports pagination. By default, this operation -// returns up to 1,000 uploaded parts in the response. You should always check -// the response for a marker at which to continue the list; if there are no -// more items the marker is null. To return a list of parts that begins at a -// specific part, set the marker request parameter to the value you obtained -// from a previous List Parts request. You can also limit the number of parts -// returned in the response by specifying the limit parameter in the request. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and the underlying REST API, see Working with -// Archives in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html) -// and List Parts (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-list-parts.html) -// in the Amazon Glacier 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 Glacier's -// API operation ListParts for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { - req, out := c.ListPartsRequest(input) - err := req.Send() - return out, err -} - -// 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 *Glacier) ListPartsPages(input *ListPartsInput, fn func(p *ListPartsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPartsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPartsOutput), lastPage) - }) -} - -const opListProvisionedCapacity = "ListProvisionedCapacity" - -// ListProvisionedCapacityRequest generates a "aws/request.Request" representing the -// client's request for the ListProvisionedCapacity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListProvisionedCapacity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListProvisionedCapacity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListProvisionedCapacityRequest method. -// req, resp := client.ListProvisionedCapacityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) ListProvisionedCapacityRequest(input *ListProvisionedCapacityInput) (req *request.Request, output *ListProvisionedCapacityOutput) { - op := &request.Operation{ - Name: opListProvisionedCapacity, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/provisioned-capacity", - } - - if input == nil { - input = &ListProvisionedCapacityInput{} - } - - output = &ListProvisionedCapacityOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProvisionedCapacity API operation for Amazon Glacier. -// -// This operation lists the provisioned capacity for the specified 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 Glacier's -// API operation ListProvisionedCapacity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) ListProvisionedCapacity(input *ListProvisionedCapacityInput) (*ListProvisionedCapacityOutput, error) { - req, out := c.ListProvisionedCapacityRequest(input) - err := req.Send() - return out, err -} - -const opListTagsForVault = "ListTagsForVault" - -// ListTagsForVaultRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForVault operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTagsForVault for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTagsForVault method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsForVaultRequest method. -// req, resp := client.ListTagsForVaultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) ListTagsForVaultRequest(input *ListTagsForVaultInput) (req *request.Request, output *ListTagsForVaultOutput) { - op := &request.Operation{ - Name: opListTagsForVault, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults/{vaultName}/tags", - } - - if input == nil { - input = &ListTagsForVaultInput{} - } - - output = &ListTagsForVaultOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForVault API operation for Amazon Glacier. -// -// This operation lists all the tags attached to a vault. The operation returns -// an empty map if there are no tags. For more information about tags, see Tagging -// Amazon Glacier Resources (http://docs.aws.amazon.com/amazonglacier/latest/dev/tagging.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 Glacier's -// API operation ListTagsForVault for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) ListTagsForVault(input *ListTagsForVaultInput) (*ListTagsForVaultOutput, error) { - req, out := c.ListTagsForVaultRequest(input) - err := req.Send() - return out, err -} - -const opListVaults = "ListVaults" - -// ListVaultsRequest generates a "aws/request.Request" representing the -// client's request for the ListVaults operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListVaults for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListVaults method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListVaultsRequest method. -// req, resp := client.ListVaultsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) ListVaultsRequest(input *ListVaultsInput) (req *request.Request, output *ListVaultsOutput) { - op := &request.Operation{ - Name: opListVaults, - HTTPMethod: "GET", - HTTPPath: "/{accountId}/vaults", - Paginator: &request.Paginator{ - InputTokens: []string{"marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVaultsInput{} - } - - output = &ListVaultsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVaults API operation for Amazon Glacier. -// -// This operation lists all vaults owned by the calling user's account. The -// list returned in the response is ASCII-sorted by vault name. -// -// By default, this operation returns up to 1,000 items. If there are more vaults -// to list, the response marker field contains the vault Amazon Resource Name -// (ARN) at which to continue the list with a new List Vaults request; otherwise, -// the marker field is null. To return a list of vaults that begins at a specific -// vault, set the marker request parameter to the vault ARN you obtained from -// a previous List Vaults request. You can also limit the number of vaults returned -// in the response by specifying the limit parameter in the request. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Retrieving Vault -// Metadata in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/retrieving-vault-info.html) -// and List Vaults (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vaults-get.html) -// in the Amazon Glacier 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 Glacier's -// API operation ListVaults for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) ListVaults(input *ListVaultsInput) (*ListVaultsOutput, error) { - req, out := c.ListVaultsRequest(input) - err := req.Send() - return out, err -} - -// ListVaultsPages iterates over the pages of a ListVaults operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVaults 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 ListVaults operation. -// pageNum := 0 -// err := client.ListVaultsPages(params, -// func(page *ListVaultsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Glacier) ListVaultsPages(input *ListVaultsInput, fn func(p *ListVaultsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListVaultsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListVaultsOutput), lastPage) - }) -} - -const opPurchaseProvisionedCapacity = "PurchaseProvisionedCapacity" - -// PurchaseProvisionedCapacityRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseProvisionedCapacity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PurchaseProvisionedCapacity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PurchaseProvisionedCapacity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PurchaseProvisionedCapacityRequest method. -// req, resp := client.PurchaseProvisionedCapacityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) PurchaseProvisionedCapacityRequest(input *PurchaseProvisionedCapacityInput) (req *request.Request, output *PurchaseProvisionedCapacityOutput) { - op := &request.Operation{ - Name: opPurchaseProvisionedCapacity, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/provisioned-capacity", - } - - if input == nil { - input = &PurchaseProvisionedCapacityInput{} - } - - output = &PurchaseProvisionedCapacityOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseProvisionedCapacity API operation for Amazon Glacier. -// -// This operation purchases a provisioned capacity unit for an 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 Glacier's -// API operation PurchaseProvisionedCapacity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Returned if the request results in a vault or account limit being exceeded. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) PurchaseProvisionedCapacity(input *PurchaseProvisionedCapacityInput) (*PurchaseProvisionedCapacityOutput, error) { - req, out := c.PurchaseProvisionedCapacityRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTagsFromVault = "RemoveTagsFromVault" - -// RemoveTagsFromVaultRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromVault operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromVault for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromVault method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromVaultRequest method. -// req, resp := client.RemoveTagsFromVaultRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) RemoveTagsFromVaultRequest(input *RemoveTagsFromVaultInput) (req *request.Request, output *RemoveTagsFromVaultOutput) { - op := &request.Operation{ - Name: opRemoveTagsFromVault, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/vaults/{vaultName}/tags?operation=remove", - } - - if input == nil { - input = &RemoveTagsFromVaultInput{} - } - - output = &RemoveTagsFromVaultOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveTagsFromVault API operation for Amazon Glacier. -// -// This operation removes one or more tags from the set of tags attached to -// a vault. For more information about tags, see Tagging Amazon Glacier Resources -// (http://docs.aws.amazon.com/amazonglacier/latest/dev/tagging.html). This -// operation is idempotent. The operation will be successful, even if there -// are no tags attached to the vault. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Glacier's -// API operation RemoveTagsFromVault for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) RemoveTagsFromVault(input *RemoveTagsFromVaultInput) (*RemoveTagsFromVaultOutput, error) { - req, out := c.RemoveTagsFromVaultRequest(input) - err := req.Send() - return out, err -} - -const opSetDataRetrievalPolicy = "SetDataRetrievalPolicy" - -// SetDataRetrievalPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SetDataRetrievalPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetDataRetrievalPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetDataRetrievalPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetDataRetrievalPolicyRequest method. -// req, resp := client.SetDataRetrievalPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) SetDataRetrievalPolicyRequest(input *SetDataRetrievalPolicyInput) (req *request.Request, output *SetDataRetrievalPolicyOutput) { - op := &request.Operation{ - Name: opSetDataRetrievalPolicy, - HTTPMethod: "PUT", - HTTPPath: "/{accountId}/policies/data-retrieval", - } - - if input == nil { - input = &SetDataRetrievalPolicyInput{} - } - - output = &SetDataRetrievalPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetDataRetrievalPolicy API operation for Amazon Glacier. -// -// This operation sets and then enacts a data retrieval policy in the region -// specified in the PUT request. You can set one policy per region for an AWS -// account. The policy is enacted within a few minutes of a successful PUT operation. -// -// The set policy operation does not affect retrieval jobs that were in progress -// before the policy was enacted. For more information about data retrieval -// policies, see Amazon Glacier Data Retrieval Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/data-retrieval-policy.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 Glacier's -// API operation SetDataRetrievalPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) SetDataRetrievalPolicy(input *SetDataRetrievalPolicyInput) (*SetDataRetrievalPolicyOutput, error) { - req, out := c.SetDataRetrievalPolicyRequest(input) - err := req.Send() - return out, err -} - -const opSetVaultAccessPolicy = "SetVaultAccessPolicy" - -// SetVaultAccessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SetVaultAccessPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetVaultAccessPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetVaultAccessPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetVaultAccessPolicyRequest method. -// req, resp := client.SetVaultAccessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) SetVaultAccessPolicyRequest(input *SetVaultAccessPolicyInput) (req *request.Request, output *SetVaultAccessPolicyOutput) { - op := &request.Operation{ - Name: opSetVaultAccessPolicy, - HTTPMethod: "PUT", - HTTPPath: "/{accountId}/vaults/{vaultName}/access-policy", - } - - if input == nil { - input = &SetVaultAccessPolicyInput{} - } - - output = &SetVaultAccessPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetVaultAccessPolicy API operation for Amazon Glacier. -// -// This operation configures an access policy for a vault and will overwrite -// an existing policy. To configure a vault access policy, send a PUT request -// to the access-policy subresource of the vault. An access policy is specific -// to a vault and is also called a vault subresource. You can set one access -// policy per vault and the policy can be up to 20 KB in size. For more information -// about vault access policies, see Amazon Glacier Access Control with Vault -// Access Policies (http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-access-policy.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 Glacier's -// API operation SetVaultAccessPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) SetVaultAccessPolicy(input *SetVaultAccessPolicyInput) (*SetVaultAccessPolicyOutput, error) { - req, out := c.SetVaultAccessPolicyRequest(input) - err := req.Send() - return out, err -} - -const opSetVaultNotifications = "SetVaultNotifications" - -// SetVaultNotificationsRequest generates a "aws/request.Request" representing the -// client's request for the SetVaultNotifications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetVaultNotifications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetVaultNotifications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetVaultNotificationsRequest method. -// req, resp := client.SetVaultNotificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) SetVaultNotificationsRequest(input *SetVaultNotificationsInput) (req *request.Request, output *SetVaultNotificationsOutput) { - op := &request.Operation{ - Name: opSetVaultNotifications, - HTTPMethod: "PUT", - HTTPPath: "/{accountId}/vaults/{vaultName}/notification-configuration", - } - - if input == nil { - input = &SetVaultNotificationsInput{} - } - - output = &SetVaultNotificationsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetVaultNotifications API operation for Amazon Glacier. -// -// This operation configures notifications that will be sent when specific events -// happen to a vault. By default, you don't get any notifications. -// -// To configure vault notifications, send a PUT request to the notification-configuration -// subresource of the vault. The request should include a JSON document that -// provides an Amazon SNS topic and specific events for which you want Amazon -// Glacier to send notifications to the topic. -// -// Amazon SNS topics must grant permission to the vault to be allowed to publish -// notifications to the topic. You can configure a vault to publish a notification -// for the following vault events: -// -// * ArchiveRetrievalCompleted This event occurs when a job that was initiated -// for an archive retrieval is completed (InitiateJob). The status of the -// completed job can be "Succeeded" or "Failed". The notification sent to -// the SNS topic is the same output as returned from DescribeJob. -// -// * InventoryRetrievalCompleted This event occurs when a job that was initiated -// for an inventory retrieval is completed (InitiateJob). The status of the -// completed job can be "Succeeded" or "Failed". The notification sent to -// the SNS topic is the same output as returned from DescribeJob. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Configuring Vault -// Notifications in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html) -// and Set Vault Notification Configuration (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-put.html) -// in the Amazon Glacier 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 Glacier's -// API operation SetVaultNotifications for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) SetVaultNotifications(input *SetVaultNotificationsInput) (*SetVaultNotificationsOutput, error) { - req, out := c.SetVaultNotificationsRequest(input) - err := req.Send() - return out, err -} - -const opUploadArchive = "UploadArchive" - -// UploadArchiveRequest generates a "aws/request.Request" representing the -// client's request for the UploadArchive operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UploadArchive for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UploadArchive method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UploadArchiveRequest method. -// req, resp := client.UploadArchiveRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) UploadArchiveRequest(input *UploadArchiveInput) (req *request.Request, output *ArchiveCreationOutput) { - op := &request.Operation{ - Name: opUploadArchive, - HTTPMethod: "POST", - HTTPPath: "/{accountId}/vaults/{vaultName}/archives", - } - - if input == nil { - input = &UploadArchiveInput{} - } - - output = &ArchiveCreationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadArchive API operation for Amazon Glacier. -// -// This operation adds an archive to a vault. This is a synchronous operation, -// and for a successful upload, your data is durably persisted. Amazon Glacier -// returns the archive ID in the x-amz-archive-id header of the response. -// -// You must use the archive ID to access your data in Amazon Glacier. After -// you upload an archive, you should save the archive ID returned so that you -// can retrieve or delete the archive later. Besides saving the archive ID, -// you can also index it and give it a friendly name to allow for better searching. -// You can also use the optional archive description field to specify how the -// archive is referred to in an external index of archives, such as you might -// create in Amazon DynamoDB. You can also get the vault inventory to obtain -// a list of archive IDs in a vault. For more information, see InitiateJob. -// -// You must provide a SHA256 tree hash of the data you are uploading. For information -// about computing a SHA256 tree hash, see Computing Checksums (http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html). -// -// You can optionally specify an archive description of up to 1,024 printable -// ASCII characters. You can get the archive description when you either retrieve -// the archive or get the vault inventory. For more information, see InitiateJob. -// Amazon Glacier does not interpret the description in any way. An archive -// description does not need to be unique. You cannot use the description to -// retrieve or sort the archive list. -// -// Archives are immutable. After you upload an archive, you cannot edit the -// archive or its description. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Uploading an Archive -// in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-an-archive.html) -// and Upload Archive (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-post.html) -// in the Amazon Glacier 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 Glacier's -// API operation UploadArchive for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeRequestTimeoutException "RequestTimeoutException" -// Returned if, when uploading an archive, Amazon Glacier times out while receiving -// the upload. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) UploadArchive(input *UploadArchiveInput) (*ArchiveCreationOutput, error) { - req, out := c.UploadArchiveRequest(input) - err := req.Send() - return out, err -} - -const opUploadMultipartPart = "UploadMultipartPart" - -// UploadMultipartPartRequest generates a "aws/request.Request" representing the -// client's request for the UploadMultipartPart operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UploadMultipartPart for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UploadMultipartPart method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UploadMultipartPartRequest method. -// req, resp := client.UploadMultipartPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Glacier) UploadMultipartPartRequest(input *UploadMultipartPartInput) (req *request.Request, output *UploadMultipartPartOutput) { - op := &request.Operation{ - Name: opUploadMultipartPart, - HTTPMethod: "PUT", - HTTPPath: "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}", - } - - if input == nil { - input = &UploadMultipartPartInput{} - } - - output = &UploadMultipartPartOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadMultipartPart API operation for Amazon Glacier. -// -// This operation uploads a part of an archive. You can upload archive parts -// in any order. You can also upload them in parallel. You can upload up to -// 10,000 parts for a multipart upload. -// -// Amazon Glacier rejects your upload part request if any of the following conditions -// is true: -// -// * SHA256 tree hash does not matchTo ensure that part data is not corrupted -// in transmission, you compute a SHA256 tree hash of the part and include -// it in your request. Upon receiving the part data, Amazon Glacier also -// computes a SHA256 tree hash. If these hash values don't match, the operation -// fails. For information about computing a SHA256 tree hash, see Computing -// Checksums (http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html). -// -// * Part size does not matchThe size of each part except the last must match -// the size specified in the corresponding InitiateMultipartUpload request. -// The size of the last part must be the same size as, or smaller than, the -// specified size. -// -// If you upload a part whose size is smaller than the part size you specified -// in your initiate multipart upload request and that part is not the last -// part, then the upload part request will succeed. However, the subsequent -// Complete Multipart Upload request will fail. -// -// * Range does not alignThe byte range value in the request does not align -// with the part size specified in the corresponding initiate request. For -// example, if you specify a part size of 4194304 bytes (4 MB), then 0 to -// 4194303 bytes (4 MB - 1) and 4194304 (4 MB) to 8388607 (8 MB - 1) are -// valid part ranges. However, if you set a range value of 2 MB to 6 MB, -// the range does not align with the part size and the upload will fail. -// -// -// This operation is idempotent. If you upload the same part multiple times, -// the data included in the most recent request overwrites the previously uploaded -// data. -// -// An AWS account has full permission to perform all operations (actions). However, -// AWS Identity and Access Management (IAM) users don't have any permissions -// by default. You must grant them explicit permission to perform specific actions. -// For more information, see Access Control Using AWS Identity and Access Management -// (IAM) (http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html). -// -// For conceptual information and underlying REST API, see Uploading Large Archives -// in Parts (Multipart Upload) (http://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-archive-mpu.html) -// and Upload Part (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-upload-part.html) -// in the Amazon Glacier 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 Glacier's -// API operation UploadMultipartPart for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Returned if the specified resource (such as a vault, upload ID, or job ID) -// doesn't exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// Returned if a parameter of the request is incorrectly specified. -// -// * ErrCodeMissingParameterValueException "MissingParameterValueException" -// Returned if a required header or parameter is missing from the request. -// -// * ErrCodeRequestTimeoutException "RequestTimeoutException" -// Returned if, when uploading an archive, Amazon Glacier times out while receiving -// the upload. -// -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// Returned if the service cannot complete the request. -// -func (c *Glacier) UploadMultipartPart(input *UploadMultipartPartInput) (*UploadMultipartPartOutput, error) { - req, out := c.UploadMultipartPartRequest(input) - err := req.Send() - return out, err -} - -// Provides options to abort a multipart upload identified by the upload ID. -// -// For information about the underlying REST API, see Abort Multipart Upload -// (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-abort-upload.html). -// For conceptual information, see Working with Archives in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html). -type AbortMultipartUploadInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The upload ID of the multipart upload to delete. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" 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.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *AbortMultipartUploadInput) SetAccountId(v string) *AbortMultipartUploadInput { - s.AccountId = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *AbortMultipartUploadInput) SetUploadId(v string) *AbortMultipartUploadInput { - s.UploadId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *AbortMultipartUploadInput) SetVaultName(v string) *AbortMultipartUploadInput { - s.VaultName = &v - return s -} - -type AbortMultipartUploadOutput struct { - _ struct{} `type:"structure"` -} - -// 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() -} - -// The input values for AbortVaultLock. -type AbortVaultLockInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID. This value must match the AWS - // account ID associated with the credentials used to sign the request. You - // can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you specify your account ID, do - // not include any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s AbortVaultLockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AbortVaultLockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AbortVaultLockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AbortVaultLockInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *AbortVaultLockInput) SetAccountId(v string) *AbortVaultLockInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *AbortVaultLockInput) SetVaultName(v string) *AbortVaultLockInput { - s.VaultName = &v - return s -} - -type AbortVaultLockOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AbortVaultLockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AbortVaultLockOutput) GoString() string { - return s.String() -} - -// The input values for AddTagsToVault. -type AddTagsToVaultInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The tags to add to the vault. Each tag is composed of a key and a value. - // The value can be an empty string. - Tags map[string]*string `type:"map"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s AddTagsToVaultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToVaultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToVaultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToVaultInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *AddTagsToVaultInput) SetAccountId(v string) *AddTagsToVaultInput { - s.AccountId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToVaultInput) SetTags(v map[string]*string) *AddTagsToVaultInput { - s.Tags = v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *AddTagsToVaultInput) SetVaultName(v string) *AddTagsToVaultInput { - s.VaultName = &v - return s -} - -type AddTagsToVaultOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsToVaultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToVaultOutput) GoString() string { - return s.String() -} - -// Contains the Amazon Glacier response to your request. -// -// For information about the underlying REST API, see Upload Archive (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-post.html). -// For conceptual information, see Working with Archives in Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html). -type ArchiveCreationOutput struct { - _ struct{} `type:"structure"` - - // The ID of the archive. This value is also included as part of the location. - ArchiveId *string `location:"header" locationName:"x-amz-archive-id" type:"string"` - - // The checksum of the archive computed by Amazon Glacier. - Checksum *string `location:"header" locationName:"x-amz-sha256-tree-hash" type:"string"` - - // The relative URI path of the newly added archive resource. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s ArchiveCreationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ArchiveCreationOutput) GoString() string { - return s.String() -} - -// SetArchiveId sets the ArchiveId field's value. -func (s *ArchiveCreationOutput) SetArchiveId(v string) *ArchiveCreationOutput { - s.ArchiveId = &v - return s -} - -// SetChecksum sets the Checksum field's value. -func (s *ArchiveCreationOutput) SetChecksum(v string) *ArchiveCreationOutput { - s.Checksum = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *ArchiveCreationOutput) SetLocation(v string) *ArchiveCreationOutput { - s.Location = &v - return s -} - -// Provides options to complete a multipart upload operation. This informs Amazon -// Glacier that all the archive parts have been uploaded and Amazon Glacier -// can now assemble the archive from the uploaded parts. After assembling and -// saving the archive to the vault, Amazon Glacier returns the URI path of the -// newly created archive resource. -type CompleteMultipartUploadInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The total size, in bytes, of the entire archive. This value should be the - // sum of all the sizes of the individual parts that you uploaded. - ArchiveSize *string `location:"header" locationName:"x-amz-archive-size" type:"string"` - - // The SHA256 tree hash of the entire archive. It is the tree hash of SHA256 - // tree hash of the individual parts. If the value you specify in the request - // does not match the SHA256 tree hash of the final assembled archive as computed - // by Amazon Glacier, Amazon Glacier returns an error and the request fails. - Checksum *string `location:"header" locationName:"x-amz-sha256-tree-hash" type:"string"` - - // The upload ID of the multipart upload. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" 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.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *CompleteMultipartUploadInput) SetAccountId(v string) *CompleteMultipartUploadInput { - s.AccountId = &v - return s -} - -// SetArchiveSize sets the ArchiveSize field's value. -func (s *CompleteMultipartUploadInput) SetArchiveSize(v string) *CompleteMultipartUploadInput { - s.ArchiveSize = &v - return s -} - -// SetChecksum sets the Checksum field's value. -func (s *CompleteMultipartUploadInput) SetChecksum(v string) *CompleteMultipartUploadInput { - s.Checksum = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CompleteMultipartUploadInput) SetUploadId(v string) *CompleteMultipartUploadInput { - s.UploadId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *CompleteMultipartUploadInput) SetVaultName(v string) *CompleteMultipartUploadInput { - s.VaultName = &v - return s -} - -// The input values for CompleteVaultLock. -type CompleteVaultLockInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID. This value must match the AWS - // account ID associated with the credentials used to sign the request. You - // can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you specify your account ID, do - // not include any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The lockId value is the lock ID obtained from a InitiateVaultLock request. - // - // LockId is a required field - LockId *string `location:"uri" locationName:"lockId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s CompleteVaultLockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteVaultLockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CompleteVaultLockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CompleteVaultLockInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.LockId == nil { - invalidParams.Add(request.NewErrParamRequired("LockId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *CompleteVaultLockInput) SetAccountId(v string) *CompleteVaultLockInput { - s.AccountId = &v - return s -} - -// SetLockId sets the LockId field's value. -func (s *CompleteVaultLockInput) SetLockId(v string) *CompleteVaultLockInput { - s.LockId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *CompleteVaultLockInput) SetVaultName(v string) *CompleteVaultLockInput { - s.VaultName = &v - return s -} - -type CompleteVaultLockOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CompleteVaultLockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteVaultLockOutput) GoString() string { - return s.String() -} - -// Provides options to create a vault. -type CreateVaultInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID. This value must match the AWS - // account ID associated with the credentials used to sign the request. You - // can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you specify your account ID, do - // not include any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateVaultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVaultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVaultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVaultInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *CreateVaultInput) SetAccountId(v string) *CreateVaultInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *CreateVaultInput) SetVaultName(v string) *CreateVaultInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type CreateVaultOutput struct { - _ struct{} `type:"structure"` - - // The URI of the vault that was created. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s CreateVaultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVaultOutput) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *CreateVaultOutput) SetLocation(v string) *CreateVaultOutput { - s.Location = &v - return s -} - -// Data retrieval policy. -type DataRetrievalPolicy struct { - _ struct{} `type:"structure"` - - // The policy rule. Although this is a list type, currently there must be only - // one rule, which contains a Strategy field and optionally a BytesPerHour field. - Rules []*DataRetrievalRule `type:"list"` -} - -// String returns the string representation -func (s DataRetrievalPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DataRetrievalPolicy) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *DataRetrievalPolicy) SetRules(v []*DataRetrievalRule) *DataRetrievalPolicy { - s.Rules = v - return s -} - -// Data retrieval policy rule. -type DataRetrievalRule struct { - _ struct{} `type:"structure"` - - // The maximum number of bytes that can be retrieved in an hour. - // - // This field is required only if the value of the Strategy field is BytesPerHour. - // Your PUT operation will be rejected if the Strategy field is not set to BytesPerHour - // and you set this field. - BytesPerHour *int64 `type:"long"` - - // The type of data retrieval policy to set. - // - // Valid values: BytesPerHour|FreeTier|None - Strategy *string `type:"string"` -} - -// String returns the string representation -func (s DataRetrievalRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DataRetrievalRule) GoString() string { - return s.String() -} - -// SetBytesPerHour sets the BytesPerHour field's value. -func (s *DataRetrievalRule) SetBytesPerHour(v int64) *DataRetrievalRule { - s.BytesPerHour = &v - return s -} - -// SetStrategy sets the Strategy field's value. -func (s *DataRetrievalRule) SetStrategy(v string) *DataRetrievalRule { - s.Strategy = &v - return s -} - -// Provides options for deleting an archive from an Amazon Glacier vault. -type DeleteArchiveInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The ID of the archive to delete. - // - // ArchiveId is a required field - ArchiveId *string `location:"uri" locationName:"archiveId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteArchiveInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteArchiveInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteArchiveInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteArchiveInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.ArchiveId == nil { - invalidParams.Add(request.NewErrParamRequired("ArchiveId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DeleteArchiveInput) SetAccountId(v string) *DeleteArchiveInput { - s.AccountId = &v - return s -} - -// SetArchiveId sets the ArchiveId field's value. -func (s *DeleteArchiveInput) SetArchiveId(v string) *DeleteArchiveInput { - s.ArchiveId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *DeleteArchiveInput) SetVaultName(v string) *DeleteArchiveInput { - s.VaultName = &v - return s -} - -type DeleteArchiveOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteArchiveOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteArchiveOutput) GoString() string { - return s.String() -} - -// DeleteVaultAccessPolicy input. -type DeleteVaultAccessPolicyInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVaultAccessPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVaultAccessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVaultAccessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVaultAccessPolicyInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DeleteVaultAccessPolicyInput) SetAccountId(v string) *DeleteVaultAccessPolicyInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *DeleteVaultAccessPolicyInput) SetVaultName(v string) *DeleteVaultAccessPolicyInput { - s.VaultName = &v - return s -} - -type DeleteVaultAccessPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVaultAccessPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVaultAccessPolicyOutput) GoString() string { - return s.String() -} - -// Provides options for deleting a vault from Amazon Glacier. -type DeleteVaultInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVaultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVaultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVaultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVaultInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DeleteVaultInput) SetAccountId(v string) *DeleteVaultInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *DeleteVaultInput) SetVaultName(v string) *DeleteVaultInput { - s.VaultName = &v - return s -} - -// Provides options for deleting a vault notification configuration from an -// Amazon Glacier vault. -type DeleteVaultNotificationsInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVaultNotificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVaultNotificationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVaultNotificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVaultNotificationsInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DeleteVaultNotificationsInput) SetAccountId(v string) *DeleteVaultNotificationsInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *DeleteVaultNotificationsInput) SetVaultName(v string) *DeleteVaultNotificationsInput { - s.VaultName = &v - return s -} - -type DeleteVaultNotificationsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVaultNotificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVaultNotificationsOutput) GoString() string { - return s.String() -} - -type DeleteVaultOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVaultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVaultOutput) GoString() string { - return s.String() -} - -// Provides options for retrieving a job description. -type DescribeJobInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The ID of the job to describe. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeJobInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DescribeJobInput) SetAccountId(v string) *DescribeJobInput { - s.AccountId = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *DescribeJobInput) SetJobId(v string) *DescribeJobInput { - s.JobId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *DescribeJobInput) SetVaultName(v string) *DescribeJobInput { - s.VaultName = &v - return s -} - -// Provides options for retrieving metadata for a specific vault in Amazon Glacier. -type DescribeVaultInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeVaultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVaultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeVaultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeVaultInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DescribeVaultInput) SetAccountId(v string) *DescribeVaultInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *DescribeVaultInput) SetVaultName(v string) *DescribeVaultInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type DescribeVaultOutput struct { - _ struct{} `type:"structure"` - - // The Universal Coordinated Time (UTC) date when the vault was created. This - // value should be a string in the ISO 8601 date format, for example 2012-03-20T17:03:43.221Z. - CreationDate *string `type:"string"` - - // The Universal Coordinated Time (UTC) date when Amazon Glacier completed the - // last vault inventory. This value should be a string in the ISO 8601 date - // format, for example 2012-03-20T17:03:43.221Z. - LastInventoryDate *string `type:"string"` - - // The number of archives in the vault as of the last inventory date. This field - // will return null if an inventory has not yet run on the vault, for example - // if you just created the vault. - NumberOfArchives *int64 `type:"long"` - - // Total size, in bytes, of the archives in the vault as of the last inventory - // date. This field will return null if an inventory has not yet run on the - // vault, for example if you just created the vault. - SizeInBytes *int64 `type:"long"` - - // The Amazon Resource Name (ARN) of the vault. - VaultARN *string `type:"string"` - - // The name of the vault. - VaultName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeVaultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVaultOutput) GoString() string { - return s.String() -} - -// SetCreationDate sets the CreationDate field's value. -func (s *DescribeVaultOutput) SetCreationDate(v string) *DescribeVaultOutput { - s.CreationDate = &v - return s -} - -// SetLastInventoryDate sets the LastInventoryDate field's value. -func (s *DescribeVaultOutput) SetLastInventoryDate(v string) *DescribeVaultOutput { - s.LastInventoryDate = &v - return s -} - -// SetNumberOfArchives sets the NumberOfArchives field's value. -func (s *DescribeVaultOutput) SetNumberOfArchives(v int64) *DescribeVaultOutput { - s.NumberOfArchives = &v - return s -} - -// SetSizeInBytes sets the SizeInBytes field's value. -func (s *DescribeVaultOutput) SetSizeInBytes(v int64) *DescribeVaultOutput { - s.SizeInBytes = &v - return s -} - -// SetVaultARN sets the VaultARN field's value. -func (s *DescribeVaultOutput) SetVaultARN(v string) *DescribeVaultOutput { - s.VaultARN = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *DescribeVaultOutput) SetVaultName(v string) *DescribeVaultOutput { - s.VaultName = &v - return s -} - -// Input for GetDataRetrievalPolicy. -type GetDataRetrievalPolicyInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID. This value must match the AWS - // account ID associated with the credentials used to sign the request. You - // can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you specify your account ID, do - // not include any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDataRetrievalPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDataRetrievalPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataRetrievalPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataRetrievalPolicyInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *GetDataRetrievalPolicyInput) SetAccountId(v string) *GetDataRetrievalPolicyInput { - s.AccountId = &v - return s -} - -// Contains the Amazon Glacier response to the GetDataRetrievalPolicy request. -type GetDataRetrievalPolicyOutput struct { - _ struct{} `type:"structure"` - - // Contains the returned data retrieval policy in JSON format. - Policy *DataRetrievalPolicy `type:"structure"` -} - -// String returns the string representation -func (s GetDataRetrievalPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDataRetrievalPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetDataRetrievalPolicyOutput) SetPolicy(v *DataRetrievalPolicy) *GetDataRetrievalPolicyOutput { - s.Policy = v - return s -} - -// Provides options for downloading output of an Amazon Glacier job. -type GetJobOutputInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The job ID whose data is downloaded. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // The range of bytes to retrieve from the output. For example, if you want - // to download the first 1,048,576 bytes, specify the range as bytes=0-1048575. - // By default, this operation downloads the entire output. - // - // If the job output is large, then you can use a range to retrieve a portion - // of the output. This allows you to download the entire output in smaller chunks - // of bytes. For example, suppose you have 1 GB of job output you want to download - // and you decide to download 128 MB chunks of data at a time, which is a total - // of eight Get Job Output requests. You use the following process to download - // the job output: - // - // Download a 128 MB chunk of output by specifying the appropriate byte range. - // Verify that all 128 MB of data was received. - // - // Along with the data, the response includes a SHA256 tree hash of the payload. - // You compute the checksum of the payload on the client and compare it with - // the checksum you received in the response to ensure you received all the - // expected data. - // - // Repeat steps 1 and 2 for all the eight 128 MB chunks of output data, each - // time specifying the appropriate byte range. - // - // After downloading all the parts of the job output, you have a list of eight - // checksum values. Compute the tree hash of these values to find the checksum - // of the entire output. Using the DescribeJob API, obtain job information of - // the job that provided you the output. The response includes the checksum - // of the entire archive stored in Amazon Glacier. You compare this value with - // the checksum you computed to ensure you have downloaded the entire archive - // content with no errors. - Range *string `location:"header" locationName:"Range" type:"string"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetJobOutputInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetJobOutputInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetJobOutputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetJobOutputInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *GetJobOutputInput) SetAccountId(v string) *GetJobOutputInput { - s.AccountId = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *GetJobOutputInput) SetJobId(v string) *GetJobOutputInput { - s.JobId = &v - return s -} - -// SetRange sets the Range field's value. -func (s *GetJobOutputInput) SetRange(v string) *GetJobOutputInput { - s.Range = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *GetJobOutputInput) SetVaultName(v string) *GetJobOutputInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type GetJobOutputOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - // Indicates the range units accepted. For more information, see RFC2616 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). - AcceptRanges *string `location:"header" locationName:"Accept-Ranges" type:"string"` - - // The description of an archive. - ArchiveDescription *string `location:"header" locationName:"x-amz-archive-description" type:"string"` - - // The job data, either archive data or inventory data. - Body io.ReadCloser `locationName:"body" type:"blob"` - - // The checksum of the data in the response. This header is returned only when - // retrieving the output for an archive retrieval job. Furthermore, this header - // appears only under the following conditions: - // - // * You get the entire range of the archive. - // - // * You request a range to return of the archive that starts and ends on - // a multiple of 1 MB. For example, if you have an 3.1 MB archive and you - // specify a range to return that starts at 1 MB and ends at 2 MB, then the - // x-amz-sha256-tree-hash is returned as a response header. - // - // * You request a range of the archive to return that starts on a multiple - // of 1 MB and goes to the end of the archive. For example, if you have a - // 3.1 MB archive and you specify a range that starts at 2 MB and ends at - // 3.1 MB (the end of the archive), then the x-amz-sha256-tree-hash is returned - // as a response header. - Checksum *string `location:"header" locationName:"x-amz-sha256-tree-hash" type:"string"` - - // The range of bytes returned by Amazon Glacier. If only partial output is - // downloaded, the response provides the range of bytes Amazon Glacier returned. - // For example, bytes 0-1048575/8388608 returns the first 1 MB from 8 MB. - ContentRange *string `location:"header" locationName:"Content-Range" type:"string"` - - // The Content-Type depends on whether the job output is an archive or a vault - // inventory. For archive data, the Content-Type is application/octet-stream. - // For vault inventory, if you requested CSV format when you initiated the job, - // the Content-Type is text/csv. Otherwise, by default, vault inventory is returned - // as JSON, and the Content-Type is application/json. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The HTTP response code for a job output request. The value depends on whether - // a range was specified in the request. - Status *int64 `location:"statusCode" locationName:"status" type:"integer"` -} - -// String returns the string representation -func (s GetJobOutputOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetJobOutputOutput) GoString() string { - return s.String() -} - -// SetAcceptRanges sets the AcceptRanges field's value. -func (s *GetJobOutputOutput) SetAcceptRanges(v string) *GetJobOutputOutput { - s.AcceptRanges = &v - return s -} - -// SetArchiveDescription sets the ArchiveDescription field's value. -func (s *GetJobOutputOutput) SetArchiveDescription(v string) *GetJobOutputOutput { - s.ArchiveDescription = &v - return s -} - -// SetBody sets the Body field's value. -func (s *GetJobOutputOutput) SetBody(v io.ReadCloser) *GetJobOutputOutput { - s.Body = v - return s -} - -// SetChecksum sets the Checksum field's value. -func (s *GetJobOutputOutput) SetChecksum(v string) *GetJobOutputOutput { - s.Checksum = &v - return s -} - -// SetContentRange sets the ContentRange field's value. -func (s *GetJobOutputOutput) SetContentRange(v string) *GetJobOutputOutput { - s.ContentRange = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *GetJobOutputOutput) SetContentType(v string) *GetJobOutputOutput { - s.ContentType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetJobOutputOutput) SetStatus(v int64) *GetJobOutputOutput { - s.Status = &v - return s -} - -// Input for GetVaultAccessPolicy. -type GetVaultAccessPolicyInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetVaultAccessPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetVaultAccessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVaultAccessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVaultAccessPolicyInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *GetVaultAccessPolicyInput) SetAccountId(v string) *GetVaultAccessPolicyInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *GetVaultAccessPolicyInput) SetVaultName(v string) *GetVaultAccessPolicyInput { - s.VaultName = &v - return s -} - -// Output for GetVaultAccessPolicy. -type GetVaultAccessPolicyOutput struct { - _ struct{} `type:"structure" payload:"Policy"` - - // Contains the returned vault access policy as a JSON string. - Policy *VaultAccessPolicy `locationName:"policy" type:"structure"` -} - -// String returns the string representation -func (s GetVaultAccessPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetVaultAccessPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetVaultAccessPolicyOutput) SetPolicy(v *VaultAccessPolicy) *GetVaultAccessPolicyOutput { - s.Policy = v - return s -} - -// The input values for GetVaultLock. -type GetVaultLockInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetVaultLockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetVaultLockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVaultLockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVaultLockInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *GetVaultLockInput) SetAccountId(v string) *GetVaultLockInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *GetVaultLockInput) SetVaultName(v string) *GetVaultLockInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type GetVaultLockOutput struct { - _ struct{} `type:"structure"` - - // The UTC date and time at which the vault lock was put into the InProgress - // state. - CreationDate *string `type:"string"` - - // The UTC date and time at which the lock ID expires. This value can be null - // if the vault lock is in a Locked state. - ExpirationDate *string `type:"string"` - - // The vault lock policy as a JSON string, which uses "\" as an escape character. - Policy *string `type:"string"` - - // The state of the vault lock. InProgress or Locked. - State *string `type:"string"` -} - -// String returns the string representation -func (s GetVaultLockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetVaultLockOutput) GoString() string { - return s.String() -} - -// SetCreationDate sets the CreationDate field's value. -func (s *GetVaultLockOutput) SetCreationDate(v string) *GetVaultLockOutput { - s.CreationDate = &v - return s -} - -// SetExpirationDate sets the ExpirationDate field's value. -func (s *GetVaultLockOutput) SetExpirationDate(v string) *GetVaultLockOutput { - s.ExpirationDate = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *GetVaultLockOutput) SetPolicy(v string) *GetVaultLockOutput { - s.Policy = &v - return s -} - -// SetState sets the State field's value. -func (s *GetVaultLockOutput) SetState(v string) *GetVaultLockOutput { - s.State = &v - return s -} - -// Provides options for retrieving the notification configuration set on an -// Amazon Glacier vault. -type GetVaultNotificationsInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetVaultNotificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetVaultNotificationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVaultNotificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVaultNotificationsInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *GetVaultNotificationsInput) SetAccountId(v string) *GetVaultNotificationsInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *GetVaultNotificationsInput) SetVaultName(v string) *GetVaultNotificationsInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type GetVaultNotificationsOutput struct { - _ struct{} `type:"structure" payload:"VaultNotificationConfig"` - - // Returns the notification configuration set on the vault. - VaultNotificationConfig *VaultNotificationConfig `locationName:"vaultNotificationConfig" type:"structure"` -} - -// String returns the string representation -func (s GetVaultNotificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetVaultNotificationsOutput) GoString() string { - return s.String() -} - -// SetVaultNotificationConfig sets the VaultNotificationConfig field's value. -func (s *GetVaultNotificationsOutput) SetVaultNotificationConfig(v *VaultNotificationConfig) *GetVaultNotificationsOutput { - s.VaultNotificationConfig = v - return s -} - -// Provides options for initiating an Amazon Glacier job. -type InitiateJobInput struct { - _ struct{} `type:"structure" payload:"JobParameters"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // Provides options for specifying job information. - JobParameters *JobParameters `locationName:"jobParameters" type:"structure"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s InitiateJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InitiateJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InitiateJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InitiateJobInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *InitiateJobInput) SetAccountId(v string) *InitiateJobInput { - s.AccountId = &v - return s -} - -// SetJobParameters sets the JobParameters field's value. -func (s *InitiateJobInput) SetJobParameters(v *JobParameters) *InitiateJobInput { - s.JobParameters = v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *InitiateJobInput) SetVaultName(v string) *InitiateJobInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type InitiateJobOutput struct { - _ struct{} `type:"structure"` - - // The ID of the job. - JobId *string `location:"header" locationName:"x-amz-job-id" type:"string"` - - // The relative URI path of the job. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s InitiateJobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InitiateJobOutput) GoString() string { - return s.String() -} - -// SetJobId sets the JobId field's value. -func (s *InitiateJobOutput) SetJobId(v string) *InitiateJobOutput { - s.JobId = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *InitiateJobOutput) SetLocation(v string) *InitiateJobOutput { - s.Location = &v - return s -} - -// Provides options for initiating a multipart upload to an Amazon Glacier vault. -type InitiateMultipartUploadInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The archive description that you are uploading in parts. - // - // The part size must be a megabyte (1024 KB) multiplied by a power of 2, for - // example 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8 MB), and - // so on. The minimum allowable part size is 1 MB, and the maximum is 4 GB (4096 - // MB). - ArchiveDescription *string `location:"header" locationName:"x-amz-archive-description" type:"string"` - - // The size of each part except the last, in bytes. The last part can be smaller - // than this part size. - PartSize *string `location:"header" locationName:"x-amz-part-size" type:"string"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s InitiateMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InitiateMultipartUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InitiateMultipartUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InitiateMultipartUploadInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *InitiateMultipartUploadInput) SetAccountId(v string) *InitiateMultipartUploadInput { - s.AccountId = &v - return s -} - -// SetArchiveDescription sets the ArchiveDescription field's value. -func (s *InitiateMultipartUploadInput) SetArchiveDescription(v string) *InitiateMultipartUploadInput { - s.ArchiveDescription = &v - return s -} - -// SetPartSize sets the PartSize field's value. -func (s *InitiateMultipartUploadInput) SetPartSize(v string) *InitiateMultipartUploadInput { - s.PartSize = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *InitiateMultipartUploadInput) SetVaultName(v string) *InitiateMultipartUploadInput { - s.VaultName = &v - return s -} - -// The Amazon Glacier response to your request. -type InitiateMultipartUploadOutput struct { - _ struct{} `type:"structure"` - - // The relative URI path of the multipart upload ID Amazon Glacier created. - Location *string `location:"header" locationName:"Location" type:"string"` - - // The ID of the multipart upload. This value is also included as part of the - // location. - UploadId *string `location:"header" locationName:"x-amz-multipart-upload-id" type:"string"` -} - -// String returns the string representation -func (s InitiateMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InitiateMultipartUploadOutput) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *InitiateMultipartUploadOutput) SetLocation(v string) *InitiateMultipartUploadOutput { - s.Location = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *InitiateMultipartUploadOutput) SetUploadId(v string) *InitiateMultipartUploadOutput { - s.UploadId = &v - return s -} - -// The input values for InitiateVaultLock. -type InitiateVaultLockInput struct { - _ struct{} `type:"structure" payload:"Policy"` - - // The AccountId value is the AWS account ID. This value must match the AWS - // account ID associated with the credentials used to sign the request. You - // can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you specify your account ID, do - // not include any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The vault lock policy as a JSON string, which uses "\" as an escape character. - Policy *VaultLockPolicy `locationName:"policy" type:"structure"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s InitiateVaultLockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InitiateVaultLockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InitiateVaultLockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InitiateVaultLockInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *InitiateVaultLockInput) SetAccountId(v string) *InitiateVaultLockInput { - s.AccountId = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *InitiateVaultLockInput) SetPolicy(v *VaultLockPolicy) *InitiateVaultLockInput { - s.Policy = v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *InitiateVaultLockInput) SetVaultName(v string) *InitiateVaultLockInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type InitiateVaultLockOutput struct { - _ struct{} `type:"structure"` - - // The lock ID, which is used to complete the vault locking process. - LockId *string `location:"header" locationName:"x-amz-lock-id" type:"string"` -} - -// String returns the string representation -func (s InitiateVaultLockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InitiateVaultLockOutput) GoString() string { - return s.String() -} - -// SetLockId sets the LockId field's value. -func (s *InitiateVaultLockOutput) SetLockId(v string) *InitiateVaultLockOutput { - s.LockId = &v - return s -} - -// Describes the options for a range inventory retrieval job. -type InventoryRetrievalJobDescription struct { - _ struct{} `type:"structure"` - - // The end of the date range in UTC for vault inventory retrieval that includes - // archives created before this date. This value should be a string in the ISO - // 8601 date format, for example 2013-03-20T17:03:43Z. - EndDate *string `type:"string"` - - // The output format for the vault inventory list, which is set by the InitiateJob - // request when initiating a job to retrieve a vault inventory. Valid values - // are CSV and JSON. - Format *string `type:"string"` - - // The maximum number of inventory items returned per vault inventory retrieval - // request. This limit is set when initiating the job with the a InitiateJob - // request. - Limit *string `type:"string"` - - // An opaque string that represents where to continue pagination of the vault - // inventory retrieval results. You use the marker in a new InitiateJob request - // to obtain additional inventory items. If there are no more inventory items, - // this value is null. For more information, see Range Inventory Retrieval - // (http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html#api-initiate-job-post-vault-inventory-list-filtering). - Marker *string `type:"string"` - - // The start of the date range in Universal Coordinated Time (UTC) for vault - // inventory retrieval that includes archives created on or after this date. - // This value should be a string in the ISO 8601 date format, for example 2013-03-20T17:03:43Z. - StartDate *string `type:"string"` -} - -// String returns the string representation -func (s InventoryRetrievalJobDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryRetrievalJobDescription) GoString() string { - return s.String() -} - -// SetEndDate sets the EndDate field's value. -func (s *InventoryRetrievalJobDescription) SetEndDate(v string) *InventoryRetrievalJobDescription { - s.EndDate = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *InventoryRetrievalJobDescription) SetFormat(v string) *InventoryRetrievalJobDescription { - s.Format = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *InventoryRetrievalJobDescription) SetLimit(v string) *InventoryRetrievalJobDescription { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *InventoryRetrievalJobDescription) SetMarker(v string) *InventoryRetrievalJobDescription { - s.Marker = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *InventoryRetrievalJobDescription) SetStartDate(v string) *InventoryRetrievalJobDescription { - s.StartDate = &v - return s -} - -// Provides options for specifying a range inventory retrieval job. -type InventoryRetrievalJobInput struct { - _ struct{} `type:"structure"` - - // The end of the date range in UTC for vault inventory retrieval that includes - // archives created before this date. This value should be a string in the ISO - // 8601 date format, for example 2013-03-20T17:03:43Z. - EndDate *string `type:"string"` - - // Specifies the maximum number of inventory items returned per vault inventory - // retrieval request. Valid values are greater than or equal to 1. - Limit *string `type:"string"` - - // An opaque string that represents where to continue pagination of the vault - // inventory retrieval results. You use the marker in a new InitiateJob request - // to obtain additional inventory items. If there are no more inventory items, - // this value is null. - Marker *string `type:"string"` - - // The start of the date range in UTC for vault inventory retrieval that includes - // archives created on or after this date. This value should be a string in - // the ISO 8601 date format, for example 2013-03-20T17:03:43Z. - StartDate *string `type:"string"` -} - -// String returns the string representation -func (s InventoryRetrievalJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryRetrievalJobInput) GoString() string { - return s.String() -} - -// SetEndDate sets the EndDate field's value. -func (s *InventoryRetrievalJobInput) SetEndDate(v string) *InventoryRetrievalJobInput { - s.EndDate = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *InventoryRetrievalJobInput) SetLimit(v string) *InventoryRetrievalJobInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *InventoryRetrievalJobInput) SetMarker(v string) *InventoryRetrievalJobInput { - s.Marker = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *InventoryRetrievalJobInput) SetStartDate(v string) *InventoryRetrievalJobInput { - s.StartDate = &v - return s -} - -// Describes an Amazon Glacier job. -type JobDescription struct { - _ struct{} `type:"structure"` - - // The job type. It is either ArchiveRetrieval or InventoryRetrieval. - Action *string `type:"string" enum:"ActionCode"` - - // For an ArchiveRetrieval job, this is the archive ID requested for download. - // Otherwise, this field is null. - ArchiveId *string `type:"string"` - - // The SHA256 tree hash of the entire archive for an archive retrieval. For - // inventory retrieval jobs, this field is null. - ArchiveSHA256TreeHash *string `type:"string"` - - // For an ArchiveRetrieval job, this is the size in bytes of the archive being - // requested for download. For the InventoryRetrieval job, the value is null. - ArchiveSizeInBytes *int64 `type:"long"` - - // The job status. When a job is completed, you get the job's output. - Completed *bool `type:"boolean"` - - // The UTC time that the archive retrieval request completed. While the job - // is in progress, the value will be null. - CompletionDate *string `type:"string"` - - // The UTC date when the job was created. A string representation of ISO 8601 - // date format, for example, "2012-03-20T17:03:43.221Z". - CreationDate *string `type:"string"` - - // Parameters used for range inventory retrieval. - InventoryRetrievalParameters *InventoryRetrievalJobDescription `type:"structure"` - - // For an InventoryRetrieval job, this is the size in bytes of the inventory - // requested for download. For the ArchiveRetrieval job, the value is null. - InventorySizeInBytes *int64 `type:"long"` - - // The job description you provided when you initiated the job. - JobDescription *string `type:"string"` - - // An opaque string that identifies an Amazon Glacier job. - JobId *string `type:"string"` - - // The retrieved byte range for archive retrieval jobs in the form "StartByteValue-EndByteValue" - // If no range was specified in the archive retrieval, then the whole archive - // is retrieved and StartByteValue equals 0 and EndByteValue equals the size - // of the archive minus 1. For inventory retrieval jobs this field is null. - RetrievalByteRange *string `type:"string"` - - // For an ArchiveRetrieval job, it is the checksum of the archive. Otherwise, - // the value is null. - // - // The SHA256 tree hash value for the requested range of an archive. If the - // Initiate a Job request for an archive specified a tree-hash aligned range, - // then this field returns a value. - // - // For the specific case when the whole archive is retrieved, this value is - // the same as the ArchiveSHA256TreeHash value. - // - // This field is null in the following situations: - // - // * Archive retrieval jobs that specify a range that is not tree-hash aligned. - // - // * Archival jobs that specify a range that is equal to the whole archive - // and the job status is InProgress. - // - // * Inventory jobs. - SHA256TreeHash *string `type:"string"` - - // An Amazon Simple Notification Service (Amazon SNS) topic that receives notification. - SNSTopic *string `type:"string"` - - // The status code can be InProgress, Succeeded, or Failed, and indicates the - // status of the job. - StatusCode *string `type:"string" enum:"StatusCode"` - - // A friendly message that describes the job status. - StatusMessage *string `type:"string"` - - // The retrieval option to use for the archive retrieval. Valid values are Expedited, - // Standard, or Bulk. Standard is the default. - Tier *string `type:"string"` - - // The Amazon Resource Name (ARN) of the vault from which the archive retrieval - // was requested. - VaultARN *string `type:"string"` -} - -// String returns the string representation -func (s JobDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobDescription) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *JobDescription) SetAction(v string) *JobDescription { - s.Action = &v - return s -} - -// SetArchiveId sets the ArchiveId field's value. -func (s *JobDescription) SetArchiveId(v string) *JobDescription { - s.ArchiveId = &v - return s -} - -// SetArchiveSHA256TreeHash sets the ArchiveSHA256TreeHash field's value. -func (s *JobDescription) SetArchiveSHA256TreeHash(v string) *JobDescription { - s.ArchiveSHA256TreeHash = &v - return s -} - -// SetArchiveSizeInBytes sets the ArchiveSizeInBytes field's value. -func (s *JobDescription) SetArchiveSizeInBytes(v int64) *JobDescription { - s.ArchiveSizeInBytes = &v - return s -} - -// SetCompleted sets the Completed field's value. -func (s *JobDescription) SetCompleted(v bool) *JobDescription { - s.Completed = &v - return s -} - -// SetCompletionDate sets the CompletionDate field's value. -func (s *JobDescription) SetCompletionDate(v string) *JobDescription { - s.CompletionDate = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *JobDescription) SetCreationDate(v string) *JobDescription { - s.CreationDate = &v - return s -} - -// SetInventoryRetrievalParameters sets the InventoryRetrievalParameters field's value. -func (s *JobDescription) SetInventoryRetrievalParameters(v *InventoryRetrievalJobDescription) *JobDescription { - s.InventoryRetrievalParameters = v - return s -} - -// SetInventorySizeInBytes sets the InventorySizeInBytes field's value. -func (s *JobDescription) SetInventorySizeInBytes(v int64) *JobDescription { - s.InventorySizeInBytes = &v - return s -} - -// SetJobDescription sets the JobDescription field's value. -func (s *JobDescription) SetJobDescription(v string) *JobDescription { - s.JobDescription = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *JobDescription) SetJobId(v string) *JobDescription { - s.JobId = &v - return s -} - -// SetRetrievalByteRange sets the RetrievalByteRange field's value. -func (s *JobDescription) SetRetrievalByteRange(v string) *JobDescription { - s.RetrievalByteRange = &v - return s -} - -// SetSHA256TreeHash sets the SHA256TreeHash field's value. -func (s *JobDescription) SetSHA256TreeHash(v string) *JobDescription { - s.SHA256TreeHash = &v - return s -} - -// SetSNSTopic sets the SNSTopic field's value. -func (s *JobDescription) SetSNSTopic(v string) *JobDescription { - s.SNSTopic = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *JobDescription) SetStatusCode(v string) *JobDescription { - s.StatusCode = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *JobDescription) SetStatusMessage(v string) *JobDescription { - s.StatusMessage = &v - return s -} - -// SetTier sets the Tier field's value. -func (s *JobDescription) SetTier(v string) *JobDescription { - s.Tier = &v - return s -} - -// SetVaultARN sets the VaultARN field's value. -func (s *JobDescription) SetVaultARN(v string) *JobDescription { - s.VaultARN = &v - return s -} - -// Provides options for defining a job. -type JobParameters struct { - _ struct{} `type:"structure"` - - // The ID of the archive that you want to retrieve. This field is required only - // if Type is set to archive-retrieval. An error occurs if you specify this - // request parameter for an inventory retrieval job request. - ArchiveId *string `type:"string"` - - // The optional description for the job. The description must be less than or - // equal to 1,024 bytes. The allowable characters are 7-bit ASCII without control - // codes-specifically, ASCII values 32-126 decimal or 0x20-0x7E hexadecimal. - Description *string `type:"string"` - - // When initiating a job to retrieve a vault inventory, you can optionally add - // this parameter to your request to specify the output format. If you are initiating - // an inventory job and do not specify a Format field, JSON is the default format. - // Valid values are "CSV" and "JSON". - Format *string `type:"string"` - - // Input parameters used for range inventory retrieval. - InventoryRetrievalParameters *InventoryRetrievalJobInput `type:"structure"` - - // The byte range to retrieve for an archive retrieval. in the form "StartByteValue-EndByteValue" - // If not specified, the whole archive is retrieved. If specified, the byte - // range must be megabyte (1024*1024) aligned which means that StartByteValue - // must be divisible by 1 MB and EndByteValue plus 1 must be divisible by 1 - // MB or be the end of the archive specified as the archive byte size value - // minus 1. If RetrievalByteRange is not megabyte aligned, this operation returns - // a 400 response. - // - // An error occurs if you specify this field for an inventory retrieval job - // request. - RetrievalByteRange *string `type:"string"` - - // The Amazon SNS topic ARN to which Amazon Glacier sends a notification when - // the job is completed and the output is ready for you to download. The specified - // topic publishes the notification to its subscribers. The SNS topic must exist. - SNSTopic *string `type:"string"` - - // The retrieval option to use for the archive retrieval. Valid values are Expedited, - // Standard, or Bulk. Standard is the default. - Tier *string `type:"string"` - - // The job type. You can initiate a job to retrieve an archive or get an inventory - // of a vault. Valid values are "archive-retrieval" and "inventory-retrieval". - Type *string `type:"string"` -} - -// String returns the string representation -func (s JobParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobParameters) GoString() string { - return s.String() -} - -// SetArchiveId sets the ArchiveId field's value. -func (s *JobParameters) SetArchiveId(v string) *JobParameters { - s.ArchiveId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *JobParameters) SetDescription(v string) *JobParameters { - s.Description = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *JobParameters) SetFormat(v string) *JobParameters { - s.Format = &v - return s -} - -// SetInventoryRetrievalParameters sets the InventoryRetrievalParameters field's value. -func (s *JobParameters) SetInventoryRetrievalParameters(v *InventoryRetrievalJobInput) *JobParameters { - s.InventoryRetrievalParameters = v - return s -} - -// SetRetrievalByteRange sets the RetrievalByteRange field's value. -func (s *JobParameters) SetRetrievalByteRange(v string) *JobParameters { - s.RetrievalByteRange = &v - return s -} - -// SetSNSTopic sets the SNSTopic field's value. -func (s *JobParameters) SetSNSTopic(v string) *JobParameters { - s.SNSTopic = &v - return s -} - -// SetTier sets the Tier field's value. -func (s *JobParameters) SetTier(v string) *JobParameters { - s.Tier = &v - return s -} - -// SetType sets the Type field's value. -func (s *JobParameters) SetType(v string) *JobParameters { - s.Type = &v - return s -} - -// Provides options for retrieving a job list for an Amazon Glacier vault. -type ListJobsInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The state of the jobs to return. You can specify true or false. - Completed *string `location:"querystring" locationName:"completed" type:"string"` - - // The maximum number of jobs to be returned. The default limit is 1000. The - // number of jobs returned might be fewer than the specified limit, but the - // number of returned jobs never exceeds the limit. - Limit *string `location:"querystring" locationName:"limit" type:"string"` - - // An opaque string used for pagination. This value specifies the job at which - // the listing of jobs should begin. Get the marker value from a previous List - // Jobs response. You only need to include the marker if you are continuing - // the pagination of results started in a previous List Jobs request. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // The type of job status to return. You can specify the following values: InProgress, - // Succeeded, or Failed. - Statuscode *string `location:"querystring" locationName:"statuscode" type:"string"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListJobsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListJobsInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ListJobsInput) SetAccountId(v string) *ListJobsInput { - s.AccountId = &v - return s -} - -// SetCompleted sets the Completed field's value. -func (s *ListJobsInput) SetCompleted(v string) *ListJobsInput { - s.Completed = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListJobsInput) SetLimit(v string) *ListJobsInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListJobsInput) SetMarker(v string) *ListJobsInput { - s.Marker = &v - return s -} - -// SetStatuscode sets the Statuscode field's value. -func (s *ListJobsInput) SetStatuscode(v string) *ListJobsInput { - s.Statuscode = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *ListJobsInput) SetVaultName(v string) *ListJobsInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type ListJobsOutput struct { - _ struct{} `type:"structure"` - - // A list of job objects. Each job object contains metadata describing the job. - JobList []*JobDescription `type:"list"` - - // An opaque string used for pagination that specifies the job at which the - // listing of jobs should begin. You get the marker value from a previous List - // Jobs response. You only need to include the marker if you are continuing - // the pagination of the results started in a previous List Jobs request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s ListJobsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListJobsOutput) GoString() string { - return s.String() -} - -// SetJobList sets the JobList field's value. -func (s *ListJobsOutput) SetJobList(v []*JobDescription) *ListJobsOutput { - s.JobList = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListJobsOutput) SetMarker(v string) *ListJobsOutput { - s.Marker = &v - return s -} - -// Provides options for retrieving list of in-progress multipart uploads for -// an Amazon Glacier vault. -type ListMultipartUploadsInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // Specifies the maximum number of uploads returned in the response body. If - // this value is not specified, the List Uploads operation returns up to 1,000 - // uploads. - Limit *string `location:"querystring" locationName:"limit" type:"string"` - - // An opaque string used for pagination. This value specifies the upload at - // which the listing of uploads should begin. Get the marker value from a previous - // List Uploads response. You need only include the marker if you are continuing - // the pagination of results started in a previous List Uploads request. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// 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.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ListMultipartUploadsInput) SetAccountId(v string) *ListMultipartUploadsInput { - s.AccountId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListMultipartUploadsInput) SetLimit(v string) *ListMultipartUploadsInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListMultipartUploadsInput) SetMarker(v string) *ListMultipartUploadsInput { - s.Marker = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *ListMultipartUploadsInput) SetVaultName(v string) *ListMultipartUploadsInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type ListMultipartUploadsOutput struct { - _ struct{} `type:"structure"` - - // An opaque string that represents where to continue pagination of the results. - // You use the marker in a new List Multipart Uploads request to obtain more - // uploads in the list. If there are no more uploads, this value is null. - Marker *string `type:"string"` - - // A list of in-progress multipart uploads. - UploadsList []*UploadListElement `type:"list"` -} - -// 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() -} - -// SetMarker sets the Marker field's value. -func (s *ListMultipartUploadsOutput) SetMarker(v string) *ListMultipartUploadsOutput { - s.Marker = &v - return s -} - -// SetUploadsList sets the UploadsList field's value. -func (s *ListMultipartUploadsOutput) SetUploadsList(v []*UploadListElement) *ListMultipartUploadsOutput { - s.UploadsList = v - return s -} - -// Provides options for retrieving a list of parts of an archive that have been -// uploaded in a specific multipart upload. -type ListPartsInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The maximum number of parts to be returned. The default limit is 1000. The - // number of parts returned might be fewer than the specified limit, but the - // number of returned parts never exceeds the limit. - Limit *string `location:"querystring" locationName:"limit" type:"string"` - - // An opaque string used for pagination. This value specifies the part at which - // the listing of parts should begin. Get the marker value from the response - // of a previous List Parts response. You need only include the marker if you - // are continuing the pagination of results started in a previous List Parts - // request. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // The upload ID of the multipart upload. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" 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.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ListPartsInput) SetAccountId(v string) *ListPartsInput { - s.AccountId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListPartsInput) SetLimit(v string) *ListPartsInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListPartsInput) SetMarker(v string) *ListPartsInput { - s.Marker = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *ListPartsInput) SetUploadId(v string) *ListPartsInput { - s.UploadId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *ListPartsInput) SetVaultName(v string) *ListPartsInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type ListPartsOutput struct { - _ struct{} `type:"structure"` - - // The description of the archive that was specified in the Initiate Multipart - // Upload request. - ArchiveDescription *string `type:"string"` - - // The UTC time at which the multipart upload was initiated. - CreationDate *string `type:"string"` - - // An opaque string that represents where to continue pagination of the results. - // You use the marker in a new List Parts request to obtain more jobs in the - // list. If there are no more parts, this value is null. - Marker *string `type:"string"` - - // The ID of the upload to which the parts are associated. - MultipartUploadId *string `type:"string"` - - // The part size in bytes. This is the same value that you specified in the - // Initiate Multipart Upload request. - PartSizeInBytes *int64 `type:"long"` - - // A list of the part sizes of the multipart upload. Each object in the array - // contains a RangeBytes and sha256-tree-hash name/value pair. - Parts []*PartListElement `type:"list"` - - // The Amazon Resource Name (ARN) of the vault to which the multipart upload - // was initiated. - VaultARN *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() -} - -// SetArchiveDescription sets the ArchiveDescription field's value. -func (s *ListPartsOutput) SetArchiveDescription(v string) *ListPartsOutput { - s.ArchiveDescription = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *ListPartsOutput) SetCreationDate(v string) *ListPartsOutput { - s.CreationDate = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListPartsOutput) SetMarker(v string) *ListPartsOutput { - s.Marker = &v - return s -} - -// SetMultipartUploadId sets the MultipartUploadId field's value. -func (s *ListPartsOutput) SetMultipartUploadId(v string) *ListPartsOutput { - s.MultipartUploadId = &v - return s -} - -// SetPartSizeInBytes sets the PartSizeInBytes field's value. -func (s *ListPartsOutput) SetPartSizeInBytes(v int64) *ListPartsOutput { - s.PartSizeInBytes = &v - return s -} - -// SetParts sets the Parts field's value. -func (s *ListPartsOutput) SetParts(v []*PartListElement) *ListPartsOutput { - s.Parts = v - return s -} - -// SetVaultARN sets the VaultARN field's value. -func (s *ListPartsOutput) SetVaultARN(v string) *ListPartsOutput { - s.VaultARN = &v - return s -} - -type ListProvisionedCapacityInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, don't include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListProvisionedCapacityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListProvisionedCapacityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProvisionedCapacityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProvisionedCapacityInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ListProvisionedCapacityInput) SetAccountId(v string) *ListProvisionedCapacityInput { - s.AccountId = &v - return s -} - -type ListProvisionedCapacityOutput struct { - _ struct{} `type:"structure"` - - // The response body contains the following JSON fields. - ProvisionedCapacityList []*ProvisionedCapacityDescription `type:"list"` -} - -// String returns the string representation -func (s ListProvisionedCapacityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListProvisionedCapacityOutput) GoString() string { - return s.String() -} - -// SetProvisionedCapacityList sets the ProvisionedCapacityList field's value. -func (s *ListProvisionedCapacityOutput) SetProvisionedCapacityList(v []*ProvisionedCapacityDescription) *ListProvisionedCapacityOutput { - s.ProvisionedCapacityList = v - return s -} - -// The input value for ListTagsForVaultInput. -type ListTagsForVaultInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTagsForVaultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForVaultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForVaultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForVaultInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ListTagsForVaultInput) SetAccountId(v string) *ListTagsForVaultInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *ListTagsForVaultInput) SetVaultName(v string) *ListTagsForVaultInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type ListTagsForVaultOutput struct { - _ struct{} `type:"structure"` - - // The tags attached to the vault. Each tag is composed of a key and a value. - Tags map[string]*string `type:"map"` -} - -// String returns the string representation -func (s ListTagsForVaultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForVaultOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForVaultOutput) SetTags(v map[string]*string) *ListTagsForVaultOutput { - s.Tags = v - return s -} - -// Provides options to retrieve the vault list owned by the calling user's account. -// The list provides metadata information for each vault. -type ListVaultsInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID. This value must match the AWS - // account ID associated with the credentials used to sign the request. You - // can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you specify your account ID, do - // not include any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The maximum number of vaults to be returned. The default limit is 1000. The - // number of vaults returned might be fewer than the specified limit, but the - // number of returned vaults never exceeds the limit. - Limit *string `location:"querystring" locationName:"limit" type:"string"` - - // A string used for pagination. The marker specifies the vault ARN after which - // the listing of vaults should begin. - Marker *string `location:"querystring" locationName:"marker" type:"string"` -} - -// String returns the string representation -func (s ListVaultsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVaultsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVaultsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVaultsInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ListVaultsInput) SetAccountId(v string) *ListVaultsInput { - s.AccountId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListVaultsInput) SetLimit(v string) *ListVaultsInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListVaultsInput) SetMarker(v string) *ListVaultsInput { - s.Marker = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type ListVaultsOutput struct { - _ struct{} `type:"structure"` - - // The vault ARN at which to continue pagination of the results. You use the - // marker in another List Vaults request to obtain more vaults in the list. - Marker *string `type:"string"` - - // List of vaults. - VaultList []*DescribeVaultOutput `type:"list"` -} - -// String returns the string representation -func (s ListVaultsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVaultsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListVaultsOutput) SetMarker(v string) *ListVaultsOutput { - s.Marker = &v - return s -} - -// SetVaultList sets the VaultList field's value. -func (s *ListVaultsOutput) SetVaultList(v []*DescribeVaultOutput) *ListVaultsOutput { - s.VaultList = v - return s -} - -// A list of the part sizes of the multipart upload. -type PartListElement struct { - _ struct{} `type:"structure"` - - // The byte range of a part, inclusive of the upper value of the range. - RangeInBytes *string `type:"string"` - - // The SHA256 tree hash value that Amazon Glacier calculated for the part. This - // field is never null. - SHA256TreeHash *string `type:"string"` -} - -// String returns the string representation -func (s PartListElement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PartListElement) GoString() string { - return s.String() -} - -// SetRangeInBytes sets the RangeInBytes field's value. -func (s *PartListElement) SetRangeInBytes(v string) *PartListElement { - s.RangeInBytes = &v - return s -} - -// SetSHA256TreeHash sets the SHA256TreeHash field's value. -func (s *PartListElement) SetSHA256TreeHash(v string) *PartListElement { - s.SHA256TreeHash = &v - return s -} - -// The definition for a provisioned capacity unit. -type ProvisionedCapacityDescription struct { - _ struct{} `type:"structure"` - - // The ID that identifies the provisioned capacity unit. - CapacityId *string `type:"string"` - - // The date that the provisioned capacity unit expires, in Universal Coordinated - // Time (UTC). - ExpirationDate *string `type:"string"` - - // The date that the provisioned capacity unit was purchased, in Universal Coordinated - // Time (UTC). - StartDate *string `type:"string"` -} - -// String returns the string representation -func (s ProvisionedCapacityDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProvisionedCapacityDescription) GoString() string { - return s.String() -} - -// SetCapacityId sets the CapacityId field's value. -func (s *ProvisionedCapacityDescription) SetCapacityId(v string) *ProvisionedCapacityDescription { - s.CapacityId = &v - return s -} - -// SetExpirationDate sets the ExpirationDate field's value. -func (s *ProvisionedCapacityDescription) SetExpirationDate(v string) *ProvisionedCapacityDescription { - s.ExpirationDate = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *ProvisionedCapacityDescription) SetStartDate(v string) *ProvisionedCapacityDescription { - s.StartDate = &v - return s -} - -type PurchaseProvisionedCapacityInput struct { - _ struct{} `type:"structure"` - - // The AWS account ID of the account that owns the vault. You can either specify - // an AWS account ID or optionally a single '-' (hyphen), in which case Amazon - // Glacier uses the AWS account ID associated with the credentials used to sign - // the request. If you use an account ID, don't include any hyphens ('-') in - // the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseProvisionedCapacityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseProvisionedCapacityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseProvisionedCapacityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseProvisionedCapacityInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *PurchaseProvisionedCapacityInput) SetAccountId(v string) *PurchaseProvisionedCapacityInput { - s.AccountId = &v - return s -} - -type PurchaseProvisionedCapacityOutput struct { - _ struct{} `type:"structure"` - - // The ID that identifies the provisioned capacity unit. - CapacityId *string `location:"header" locationName:"x-amz-capacity-id" type:"string"` -} - -// String returns the string representation -func (s PurchaseProvisionedCapacityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseProvisionedCapacityOutput) GoString() string { - return s.String() -} - -// SetCapacityId sets the CapacityId field's value. -func (s *PurchaseProvisionedCapacityOutput) SetCapacityId(v string) *PurchaseProvisionedCapacityOutput { - s.CapacityId = &v - return s -} - -// The input value for RemoveTagsFromVaultInput. -type RemoveTagsFromVaultInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // A list of tag keys. Each corresponding tag is removed from the vault. - TagKeys []*string `type:"list"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromVaultInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromVaultInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromVaultInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromVaultInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *RemoveTagsFromVaultInput) SetAccountId(v string) *RemoveTagsFromVaultInput { - s.AccountId = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsFromVaultInput) SetTagKeys(v []*string) *RemoveTagsFromVaultInput { - s.TagKeys = v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *RemoveTagsFromVaultInput) SetVaultName(v string) *RemoveTagsFromVaultInput { - s.VaultName = &v - return s -} - -type RemoveTagsFromVaultOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsFromVaultOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromVaultOutput) GoString() string { - return s.String() -} - -// SetDataRetrievalPolicy input. -type SetDataRetrievalPolicyInput struct { - _ struct{} `type:"structure"` - - // The AccountId value is the AWS account ID. This value must match the AWS - // account ID associated with the credentials used to sign the request. You - // can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you specify your account ID, do - // not include any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The data retrieval policy in JSON format. - Policy *DataRetrievalPolicy `type:"structure"` -} - -// String returns the string representation -func (s SetDataRetrievalPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetDataRetrievalPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetDataRetrievalPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetDataRetrievalPolicyInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *SetDataRetrievalPolicyInput) SetAccountId(v string) *SetDataRetrievalPolicyInput { - s.AccountId = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *SetDataRetrievalPolicyInput) SetPolicy(v *DataRetrievalPolicy) *SetDataRetrievalPolicyInput { - s.Policy = v - return s -} - -type SetDataRetrievalPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetDataRetrievalPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetDataRetrievalPolicyOutput) GoString() string { - return s.String() -} - -// SetVaultAccessPolicy input. -type SetVaultAccessPolicyInput struct { - _ struct{} `type:"structure" payload:"Policy"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The vault access policy as a JSON string. - Policy *VaultAccessPolicy `locationName:"policy" type:"structure"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s SetVaultAccessPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetVaultAccessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetVaultAccessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetVaultAccessPolicyInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *SetVaultAccessPolicyInput) SetAccountId(v string) *SetVaultAccessPolicyInput { - s.AccountId = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *SetVaultAccessPolicyInput) SetPolicy(v *VaultAccessPolicy) *SetVaultAccessPolicyInput { - s.Policy = v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *SetVaultAccessPolicyInput) SetVaultName(v string) *SetVaultAccessPolicyInput { - s.VaultName = &v - return s -} - -type SetVaultAccessPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetVaultAccessPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetVaultAccessPolicyOutput) GoString() string { - return s.String() -} - -// Provides options to configure notifications that will be sent when specific -// events happen to a vault. -type SetVaultNotificationsInput struct { - _ struct{} `type:"structure" payload:"VaultNotificationConfig"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` - - // Provides options for specifying notification configuration. - VaultNotificationConfig *VaultNotificationConfig `locationName:"vaultNotificationConfig" type:"structure"` -} - -// String returns the string representation -func (s SetVaultNotificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetVaultNotificationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetVaultNotificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetVaultNotificationsInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *SetVaultNotificationsInput) SetAccountId(v string) *SetVaultNotificationsInput { - s.AccountId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *SetVaultNotificationsInput) SetVaultName(v string) *SetVaultNotificationsInput { - s.VaultName = &v - return s -} - -// SetVaultNotificationConfig sets the VaultNotificationConfig field's value. -func (s *SetVaultNotificationsInput) SetVaultNotificationConfig(v *VaultNotificationConfig) *SetVaultNotificationsInput { - s.VaultNotificationConfig = v - return s -} - -type SetVaultNotificationsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetVaultNotificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetVaultNotificationsOutput) GoString() string { - return s.String() -} - -// Provides options to add an archive to a vault. -type UploadArchiveInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The optional description of the archive you are uploading. - ArchiveDescription *string `location:"header" locationName:"x-amz-archive-description" type:"string"` - - // The data to upload. - Body io.ReadSeeker `locationName:"body" type:"blob"` - - // The SHA256 tree hash of the data being uploaded. - Checksum *string `location:"header" locationName:"x-amz-sha256-tree-hash" type:"string"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s UploadArchiveInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadArchiveInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadArchiveInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadArchiveInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *UploadArchiveInput) SetAccountId(v string) *UploadArchiveInput { - s.AccountId = &v - return s -} - -// SetArchiveDescription sets the ArchiveDescription field's value. -func (s *UploadArchiveInput) SetArchiveDescription(v string) *UploadArchiveInput { - s.ArchiveDescription = &v - return s -} - -// SetBody sets the Body field's value. -func (s *UploadArchiveInput) SetBody(v io.ReadSeeker) *UploadArchiveInput { - s.Body = v - return s -} - -// SetChecksum sets the Checksum field's value. -func (s *UploadArchiveInput) SetChecksum(v string) *UploadArchiveInput { - s.Checksum = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *UploadArchiveInput) SetVaultName(v string) *UploadArchiveInput { - s.VaultName = &v - return s -} - -// A list of in-progress multipart uploads for a vault. -type UploadListElement struct { - _ struct{} `type:"structure"` - - // The description of the archive that was specified in the Initiate Multipart - // Upload request. - ArchiveDescription *string `type:"string"` - - // The UTC time at which the multipart upload was initiated. - CreationDate *string `type:"string"` - - // The ID of a multipart upload. - MultipartUploadId *string `type:"string"` - - // The part size, in bytes, specified in the Initiate Multipart Upload request. - // This is the size of all the parts in the upload except the last part, which - // may be smaller than this size. - PartSizeInBytes *int64 `type:"long"` - - // The Amazon Resource Name (ARN) of the vault that contains the archive. - VaultARN *string `type:"string"` -} - -// String returns the string representation -func (s UploadListElement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadListElement) GoString() string { - return s.String() -} - -// SetArchiveDescription sets the ArchiveDescription field's value. -func (s *UploadListElement) SetArchiveDescription(v string) *UploadListElement { - s.ArchiveDescription = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *UploadListElement) SetCreationDate(v string) *UploadListElement { - s.CreationDate = &v - return s -} - -// SetMultipartUploadId sets the MultipartUploadId field's value. -func (s *UploadListElement) SetMultipartUploadId(v string) *UploadListElement { - s.MultipartUploadId = &v - return s -} - -// SetPartSizeInBytes sets the PartSizeInBytes field's value. -func (s *UploadListElement) SetPartSizeInBytes(v int64) *UploadListElement { - s.PartSizeInBytes = &v - return s -} - -// SetVaultARN sets the VaultARN field's value. -func (s *UploadListElement) SetVaultARN(v string) *UploadListElement { - s.VaultARN = &v - return s -} - -// Provides options to upload a part of an archive in a multipart upload operation. -type UploadMultipartPartInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The AccountId value is the AWS account ID of the account that owns the vault. - // You can either specify an AWS account ID or optionally a single '-' (hyphen), - // in which case Amazon Glacier uses the AWS account ID associated with the - // credentials used to sign the request. If you use an account ID, do not include - // any hyphens ('-') in the ID. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" type:"string" required:"true"` - - // The data to upload. - Body io.ReadSeeker `locationName:"body" type:"blob"` - - // The SHA256 tree hash of the data being uploaded. - Checksum *string `location:"header" locationName:"x-amz-sha256-tree-hash" type:"string"` - - // Identifies the range of bytes in the assembled archive that will be uploaded - // in this part. Amazon Glacier uses this information to assemble the archive - // in the proper sequence. The format of this header follows RFC 2616. An example - // header is Content-Range:bytes 0-4194303/*. - Range *string `location:"header" locationName:"Content-Range" type:"string"` - - // The upload ID of the multipart upload. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" type:"string" required:"true"` - - // The name of the vault. - // - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// String returns the string representation -func (s UploadMultipartPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadMultipartPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadMultipartPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadMultipartPartInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *UploadMultipartPartInput) SetAccountId(v string) *UploadMultipartPartInput { - s.AccountId = &v - return s -} - -// SetBody sets the Body field's value. -func (s *UploadMultipartPartInput) SetBody(v io.ReadSeeker) *UploadMultipartPartInput { - s.Body = v - return s -} - -// SetChecksum sets the Checksum field's value. -func (s *UploadMultipartPartInput) SetChecksum(v string) *UploadMultipartPartInput { - s.Checksum = &v - return s -} - -// SetRange sets the Range field's value. -func (s *UploadMultipartPartInput) SetRange(v string) *UploadMultipartPartInput { - s.Range = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UploadMultipartPartInput) SetUploadId(v string) *UploadMultipartPartInput { - s.UploadId = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *UploadMultipartPartInput) SetVaultName(v string) *UploadMultipartPartInput { - s.VaultName = &v - return s -} - -// Contains the Amazon Glacier response to your request. -type UploadMultipartPartOutput struct { - _ struct{} `type:"structure"` - - // The SHA256 tree hash that Amazon Glacier computed for the uploaded part. - Checksum *string `location:"header" locationName:"x-amz-sha256-tree-hash" type:"string"` -} - -// String returns the string representation -func (s UploadMultipartPartOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadMultipartPartOutput) GoString() string { - return s.String() -} - -// SetChecksum sets the Checksum field's value. -func (s *UploadMultipartPartOutput) SetChecksum(v string) *UploadMultipartPartOutput { - s.Checksum = &v - return s -} - -// Contains the vault access policy. -type VaultAccessPolicy struct { - _ struct{} `type:"structure"` - - // The vault access policy. - Policy *string `type:"string"` -} - -// String returns the string representation -func (s VaultAccessPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VaultAccessPolicy) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *VaultAccessPolicy) SetPolicy(v string) *VaultAccessPolicy { - s.Policy = &v - return s -} - -// Contains the vault lock policy. -type VaultLockPolicy struct { - _ struct{} `type:"structure"` - - // The vault lock policy. - Policy *string `type:"string"` -} - -// String returns the string representation -func (s VaultLockPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VaultLockPolicy) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *VaultLockPolicy) SetPolicy(v string) *VaultLockPolicy { - s.Policy = &v - return s -} - -// Represents a vault's notification configuration. -type VaultNotificationConfig struct { - _ struct{} `type:"structure"` - - // A list of one or more events for which Amazon Glacier will send a notification - // to the specified Amazon SNS topic. - Events []*string `type:"list"` - - // The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource - // Name (ARN). - SNSTopic *string `type:"string"` -} - -// String returns the string representation -func (s VaultNotificationConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VaultNotificationConfig) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *VaultNotificationConfig) SetEvents(v []*string) *VaultNotificationConfig { - s.Events = v - return s -} - -// SetSNSTopic sets the SNSTopic field's value. -func (s *VaultNotificationConfig) SetSNSTopic(v string) *VaultNotificationConfig { - s.SNSTopic = &v - return s -} - -const ( - // ActionCodeArchiveRetrieval is a ActionCode enum value - ActionCodeArchiveRetrieval = "ArchiveRetrieval" - - // ActionCodeInventoryRetrieval is a ActionCode enum value - ActionCodeInventoryRetrieval = "InventoryRetrieval" -) - -const ( - // StatusCodeInProgress is a StatusCode enum value - StatusCodeInProgress = "InProgress" - - // StatusCodeSucceeded is a StatusCode enum value - StatusCodeSucceeded = "Succeeded" - - // StatusCodeFailed is a StatusCode enum value - StatusCodeFailed = "Failed" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/customizations.go deleted file mode 100644 index 6136060..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/customizations.go +++ /dev/null @@ -1,54 +0,0 @@ -package glacier - -import ( - "encoding/hex" - "reflect" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -var ( - defaultAccountID = "-" -) - -func init() { - initRequest = func(r *request.Request) { - r.Handlers.Validate.PushFront(addAccountID) - r.Handlers.Validate.PushFront(copyParams) // this happens first - r.Handlers.Build.PushBack(addChecksum) - r.Handlers.Build.PushBack(addAPIVersion) - } -} - -func copyParams(r *request.Request) { - r.Params = awsutil.CopyOf(r.Params) -} - -func addAccountID(r *request.Request) { - if !r.ParamsFilled() { - return - } - - v := reflect.Indirect(reflect.ValueOf(r.Params)) - if f := v.FieldByName("AccountId"); f.IsNil() { - f.Set(reflect.ValueOf(&defaultAccountID)) - } -} - -func addChecksum(r *request.Request) { - if r.Body == nil || r.HTTPRequest.Header.Get("X-Amz-Sha256-Tree-Hash") != "" { - return - } - - h := ComputeHashes(r.Body) - hstr := hex.EncodeToString(h.TreeHash) - r.HTTPRequest.Header.Set("X-Amz-Sha256-Tree-Hash", hstr) - - hLstr := hex.EncodeToString(h.LinearHash) - r.HTTPRequest.Header.Set("X-Amz-Content-Sha256", hLstr) -} - -func addAPIVersion(r *request.Request) { - r.HTTPRequest.Header.Set("X-Amz-Glacier-Version", r.ClientInfo.APIVersion) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go deleted file mode 100644 index 9ce9531..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go +++ /dev/null @@ -1,59 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package glacier - -const ( - - // ErrCodeInsufficientCapacityException for service response error code - // "InsufficientCapacityException". - // - // Returned if there is insufficient capacity to process this expedited request. - // This error only applies to expedited retrievals and not to standard or bulk - // retrievals. - ErrCodeInsufficientCapacityException = "InsufficientCapacityException" - - // ErrCodeInvalidParameterValueException for service response error code - // "InvalidParameterValueException". - // - // Returned if a parameter of the request is incorrectly specified. - ErrCodeInvalidParameterValueException = "InvalidParameterValueException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // Returned if the request results in a vault or account limit being exceeded. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeMissingParameterValueException for service response error code - // "MissingParameterValueException". - // - // Returned if a required header or parameter is missing from the request. - ErrCodeMissingParameterValueException = "MissingParameterValueException" - - // ErrCodePolicyEnforcedException for service response error code - // "PolicyEnforcedException". - // - // Returned if a retrieval job would exceed the current data policy's retrieval - // rate limit. For more information about data retrieval policies, - ErrCodePolicyEnforcedException = "PolicyEnforcedException" - - // ErrCodeRequestTimeoutException for service response error code - // "RequestTimeoutException". - // - // Returned if, when uploading an archive, Amazon Glacier times out while receiving - // the upload. - ErrCodeRequestTimeoutException = "RequestTimeoutException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Returned if the specified resource (such as a vault, upload ID, or job ID) - // doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - // - // Returned if the service cannot complete the request. - ErrCodeServiceUnavailableException = "ServiceUnavailableException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go deleted file mode 100644 index d668dde..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go +++ /dev/null @@ -1,120 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package glacier - -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" -) - -// Amazon Glacier is a storage solution for "cold data." -// -// Amazon Glacier is an extremely low-cost storage service that provides secure, -// durable, and easy-to-use storage for data backup and archival. With Amazon -// Glacier, customers can store their data cost effectively for months, years, -// or decades. Amazon Glacier also enables customers to offload the administrative -// burdens of operating and scaling storage to AWS, so they don't have to worry -// about capacity planning, hardware provisioning, data replication, hardware -// failure and recovery, or time-consuming hardware migrations. -// -// Amazon Glacier is a great storage choice when low storage cost is paramount, -// your data is rarely retrieved, and retrieval latency of several hours is -// acceptable. If your application requires fast or frequent access to your -// data, consider using Amazon S3. For more information, see Amazon Simple Storage -// Service (Amazon S3) (http://aws.amazon.com/s3/). -// -// You can store any kind of data in any format. There is no maximum limit on -// the total amount of data you can store in Amazon Glacier. -// -// If you are a first-time user of Amazon Glacier, we recommend that you begin -// by reading the following sections in the Amazon Glacier Developer Guide: -// -// * What is Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/introduction.html) -// - This section of the Developer Guide describes the underlying data model, -// the operations it supports, and the AWS SDKs that you can use to interact -// with the service. -// -// * Getting Started with Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-getting-started.html) -// - The Getting Started section walks you through the process of creating -// a vault, uploading archives, creating jobs to download archives, retrieving -// the job output, and deleting archives. -// 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 Glacier 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 = "glacier" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the Glacier 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 Glacier client from just a session. -// svc := glacier.New(mySession) -// -// // Create a Glacier client with additional configuration -// svc := glacier.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Glacier { - 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) *Glacier { - svc := &Glacier{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2012-06-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Glacier operation and runs any -// custom request initialization. -func (c *Glacier) 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/glacier/treehash.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/treehash.go deleted file mode 100644 index dac44ba..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/treehash.go +++ /dev/null @@ -1,71 +0,0 @@ -package glacier - -import ( - "crypto/sha256" - "io" -) - -const bufsize = 1024 * 1024 - -// Hash contains information about the tree-hash and linear hash of a -// Glacier payload. This structure is generated by ComputeHashes(). -type Hash struct { - TreeHash []byte - LinearHash []byte -} - -// ComputeHashes computes the tree-hash and linear hash of a seekable reader r. -func ComputeHashes(r io.ReadSeeker) Hash { - r.Seek(0, 0) // Read the whole stream - defer r.Seek(0, 0) // Rewind stream at end - - buf := make([]byte, bufsize) - hashes := [][]byte{} - hsh := sha256.New() - - for { - // Build leaf nodes in 1MB chunks - n, err := io.ReadAtLeast(r, buf, bufsize) - if n == 0 { - break - } - - tmpHash := sha256.Sum256(buf[:n]) - hashes = append(hashes, tmpHash[:]) - hsh.Write(buf[:n]) // Track linear hash while we're at it - - if err != nil { - break // This is the last chunk - } - } - - return Hash{ - LinearHash: hsh.Sum(nil), - TreeHash: buildHashTree(hashes), - } -} - -// buildHashTree builds a hash tree root node given a set of hashes. -func buildHashTree(hashes [][]byte) []byte { - if hashes == nil || len(hashes) == 0 { - return nil - } - - for len(hashes) > 1 { - tmpHashes := [][]byte{} - - for i := 0; i < len(hashes); i += 2 { - if i+1 <= len(hashes)-1 { - tmpHash := append(append([]byte{}, hashes[i]...), hashes[i+1]...) - tmpSum := sha256.Sum256(tmpHash) - tmpHashes = append(tmpHashes, tmpSum[:]) - } else { - tmpHashes = append(tmpHashes, hashes[i]) - } - } - - hashes = tmpHashes - } - - return hashes[0] -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/waiters.go deleted file mode 100644 index fd33dc9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/waiters.go +++ /dev/null @@ -1,73 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package glacier - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilVaultExists uses the Amazon Glacier API operation -// DescribeVault 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 *Glacier) WaitUntilVaultExists(input *DescribeVaultInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVault", - Delay: 3, - MaxAttempts: 15, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "status", - Argument: "", - Expected: 200, - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "ResourceNotFoundException", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilVaultNotExists uses the Amazon Glacier API operation -// DescribeVault 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 *Glacier) WaitUntilVaultNotExists(input *DescribeVaultInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeVault", - Delay: 3, - MaxAttempts: 15, - Acceptors: []waiter.WaitAcceptor{ - { - State: "retry", - Matcher: "status", - Argument: "", - Expected: 200, - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "ResourceNotFoundException", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/api.go b/vendor/github.com/aws/aws-sdk-go/service/iam/api.go deleted file mode 100644 index e418186..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/api.go +++ /dev/null @@ -1,25196 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package iam provides a client for AWS Identity and Access Management. -package iam - -import ( - "fmt" - "time" - - "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 opAddClientIDToOpenIDConnectProvider = "AddClientIDToOpenIDConnectProvider" - -// AddClientIDToOpenIDConnectProviderRequest generates a "aws/request.Request" representing the -// client's request for the AddClientIDToOpenIDConnectProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddClientIDToOpenIDConnectProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddClientIDToOpenIDConnectProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddClientIDToOpenIDConnectProviderRequest method. -// req, resp := client.AddClientIDToOpenIDConnectProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProvider -func (c *IAM) AddClientIDToOpenIDConnectProviderRequest(input *AddClientIDToOpenIDConnectProviderInput) (req *request.Request, output *AddClientIDToOpenIDConnectProviderOutput) { - op := &request.Operation{ - Name: opAddClientIDToOpenIDConnectProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddClientIDToOpenIDConnectProviderInput{} - } - - output = &AddClientIDToOpenIDConnectProviderOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddClientIDToOpenIDConnectProvider API operation for AWS Identity and Access Management. -// -// Adds a new client ID (also known as audience) to the list of client IDs already -// registered for the specified IAM OpenID Connect (OIDC) provider resource. -// -// This action is idempotent; it does not fail or return an error if you add -// an existing client ID to the provider. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation AddClientIDToOpenIDConnectProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProvider -func (c *IAM) AddClientIDToOpenIDConnectProvider(input *AddClientIDToOpenIDConnectProviderInput) (*AddClientIDToOpenIDConnectProviderOutput, error) { - req, out := c.AddClientIDToOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err -} - -const opAddRoleToInstanceProfile = "AddRoleToInstanceProfile" - -// AddRoleToInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the AddRoleToInstanceProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddRoleToInstanceProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddRoleToInstanceProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddRoleToInstanceProfileRequest method. -// req, resp := client.AddRoleToInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfile -func (c *IAM) AddRoleToInstanceProfileRequest(input *AddRoleToInstanceProfileInput) (req *request.Request, output *AddRoleToInstanceProfileOutput) { - op := &request.Operation{ - Name: opAddRoleToInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddRoleToInstanceProfileInput{} - } - - output = &AddRoleToInstanceProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddRoleToInstanceProfile API operation for AWS Identity and Access Management. -// -// Adds the specified IAM role to the specified instance profile. -// -// The caller of this API must be granted the PassRole permission on the IAM -// role by a permission policy. -// -// For more information about roles, go to Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). -// For more information about instance profiles, go to About Instance Profiles -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.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 AWS Identity and Access Management's -// API operation AddRoleToInstanceProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfile -func (c *IAM) AddRoleToInstanceProfile(input *AddRoleToInstanceProfileInput) (*AddRoleToInstanceProfileOutput, error) { - req, out := c.AddRoleToInstanceProfileRequest(input) - err := req.Send() - return out, err -} - -const opAddUserToGroup = "AddUserToGroup" - -// AddUserToGroupRequest generates a "aws/request.Request" representing the -// client's request for the AddUserToGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddUserToGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddUserToGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddUserToGroupRequest method. -// req, resp := client.AddUserToGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroup -func (c *IAM) AddUserToGroupRequest(input *AddUserToGroupInput) (req *request.Request, output *AddUserToGroupOutput) { - op := &request.Operation{ - Name: opAddUserToGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddUserToGroupInput{} - } - - output = &AddUserToGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddUserToGroup API operation for AWS Identity and Access Management. -// -// Adds the specified user to the specified group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation AddUserToGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroup -func (c *IAM) AddUserToGroup(input *AddUserToGroupInput) (*AddUserToGroupOutput, error) { - req, out := c.AddUserToGroupRequest(input) - err := req.Send() - return out, err -} - -const opAttachGroupPolicy = "AttachGroupPolicy" - -// AttachGroupPolicyRequest generates a "aws/request.Request" representing the -// client's request for the AttachGroupPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachGroupPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachGroupPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachGroupPolicyRequest method. -// req, resp := client.AttachGroupPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicy -func (c *IAM) AttachGroupPolicyRequest(input *AttachGroupPolicyInput) (req *request.Request, output *AttachGroupPolicyOutput) { - op := &request.Operation{ - Name: opAttachGroupPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachGroupPolicyInput{} - } - - output = &AttachGroupPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AttachGroupPolicy API operation for AWS Identity and Access Management. -// -// Attaches the specified managed policy to the specified IAM group. -// -// You use this API to attach a managed policy to a group. To embed an inline -// policy in a group, use PutGroupPolicy. -// -// For more information about policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation AttachGroupPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicy -func (c *IAM) AttachGroupPolicy(input *AttachGroupPolicyInput) (*AttachGroupPolicyOutput, error) { - req, out := c.AttachGroupPolicyRequest(input) - err := req.Send() - return out, err -} - -const opAttachRolePolicy = "AttachRolePolicy" - -// AttachRolePolicyRequest generates a "aws/request.Request" representing the -// client's request for the AttachRolePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachRolePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachRolePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachRolePolicyRequest method. -// req, resp := client.AttachRolePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicy -func (c *IAM) AttachRolePolicyRequest(input *AttachRolePolicyInput) (req *request.Request, output *AttachRolePolicyOutput) { - op := &request.Operation{ - Name: opAttachRolePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachRolePolicyInput{} - } - - output = &AttachRolePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AttachRolePolicy API operation for AWS Identity and Access Management. -// -// Attaches the specified managed policy to the specified IAM role. -// -// When you attach a managed policy to a role, the managed policy becomes part -// of the role's permission (access) policy. You cannot use a managed policy -// as the role's trust policy. The role's trust policy is created at the same -// time as the role, using CreateRole. You can update a role's trust policy -// using UpdateAssumeRolePolicy. -// -// Use this API to attach a managed policy to a role. To embed an inline policy -// in a role, use PutRolePolicy. For more information about policies, see Managed -// Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation AttachRolePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicy -func (c *IAM) AttachRolePolicy(input *AttachRolePolicyInput) (*AttachRolePolicyOutput, error) { - req, out := c.AttachRolePolicyRequest(input) - err := req.Send() - return out, err -} - -const opAttachUserPolicy = "AttachUserPolicy" - -// AttachUserPolicyRequest generates a "aws/request.Request" representing the -// client's request for the AttachUserPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachUserPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachUserPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachUserPolicyRequest method. -// req, resp := client.AttachUserPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicy -func (c *IAM) AttachUserPolicyRequest(input *AttachUserPolicyInput) (req *request.Request, output *AttachUserPolicyOutput) { - op := &request.Operation{ - Name: opAttachUserPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachUserPolicyInput{} - } - - output = &AttachUserPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AttachUserPolicy API operation for AWS Identity and Access Management. -// -// Attaches the specified managed policy to the specified user. -// -// You use this API to attach a managed policy to a user. To embed an inline -// policy in a user, use PutUserPolicy. -// -// For more information about policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation AttachUserPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicy -func (c *IAM) AttachUserPolicy(input *AttachUserPolicyInput) (*AttachUserPolicyOutput, error) { - req, out := c.AttachUserPolicyRequest(input) - err := req.Send() - return out, err -} - -const opChangePassword = "ChangePassword" - -// ChangePasswordRequest generates a "aws/request.Request" representing the -// client's request for the ChangePassword operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ChangePassword for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ChangePassword method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ChangePasswordRequest method. -// req, resp := client.ChangePasswordRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePassword -func (c *IAM) ChangePasswordRequest(input *ChangePasswordInput) (req *request.Request, output *ChangePasswordOutput) { - op := &request.Operation{ - Name: opChangePassword, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ChangePasswordInput{} - } - - output = &ChangePasswordOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ChangePassword API operation for AWS Identity and Access Management. -// -// Changes the password of the IAM user who is calling this action. The root -// account password is not affected by this action. -// -// To change the password for a different user, see UpdateLoginProfile. For -// more information about modifying passwords, see Managing Passwords (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation ChangePassword for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidUserTypeException "InvalidUserType" -// The request was rejected because the type of user for the transaction was -// incorrect. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" -// The request was rejected because it referenced an entity that is temporarily -// unmodifiable, such as a user name that was deleted and then recreated. The -// error indicates that the request is likely to succeed if you try again after -// waiting several minutes. The error message describes the entity. -// -// * ErrCodePasswordPolicyViolationException "PasswordPolicyViolation" -// The request was rejected because the provided password did not meet the requirements -// imposed by the account password policy. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePassword -func (c *IAM) ChangePassword(input *ChangePasswordInput) (*ChangePasswordOutput, error) { - req, out := c.ChangePasswordRequest(input) - err := req.Send() - return out, err -} - -const opCreateAccessKey = "CreateAccessKey" - -// CreateAccessKeyRequest generates a "aws/request.Request" representing the -// client's request for the CreateAccessKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAccessKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAccessKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAccessKeyRequest method. -// req, resp := client.CreateAccessKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKey -func (c *IAM) CreateAccessKeyRequest(input *CreateAccessKeyInput) (req *request.Request, output *CreateAccessKeyOutput) { - op := &request.Operation{ - Name: opCreateAccessKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAccessKeyInput{} - } - - output = &CreateAccessKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAccessKey API operation for AWS Identity and Access Management. -// -// Creates a new AWS secret access key and corresponding AWS access key ID for -// the specified user. The default status for new keys is Active. -// -// If you do not specify a user name, IAM determines the user name implicitly -// based on the AWS access key ID signing the request. Because this action works -// for access keys under the AWS account, you can use this action to manage -// root credentials even if the AWS account has no associated users. -// -// For information about limits on the number of keys you can create, see Limitations -// on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// in the IAM User Guide. -// -// To ensure the security of your AWS account, the secret access key is accessible -// only during key and user creation. You must save the key (for example, in -// a text file) if you want to be able to access it again. If a secret key is -// lost, you can delete the access keys for the associated user and then create -// new 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 AWS Identity and Access Management's -// API operation CreateAccessKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKey -func (c *IAM) CreateAccessKey(input *CreateAccessKeyInput) (*CreateAccessKeyOutput, error) { - req, out := c.CreateAccessKeyRequest(input) - err := req.Send() - return out, err -} - -const opCreateAccountAlias = "CreateAccountAlias" - -// CreateAccountAliasRequest generates a "aws/request.Request" representing the -// client's request for the CreateAccountAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAccountAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAccountAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAccountAliasRequest method. -// req, resp := client.CreateAccountAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAlias -func (c *IAM) CreateAccountAliasRequest(input *CreateAccountAliasInput) (req *request.Request, output *CreateAccountAliasOutput) { - op := &request.Operation{ - Name: opCreateAccountAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAccountAliasInput{} - } - - output = &CreateAccountAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateAccountAlias API operation for AWS Identity and Access Management. -// -// Creates an alias for your AWS account. For information about using an AWS -// account alias, see Using an Alias for Your AWS Account ID (http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreateAccountAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAlias -func (c *IAM) CreateAccountAlias(input *CreateAccountAliasInput) (*CreateAccountAliasOutput, error) { - req, out := c.CreateAccountAliasRequest(input) - err := req.Send() - return out, err -} - -const opCreateGroup = "CreateGroup" - -// CreateGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateGroupRequest method. -// req, resp := client.CreateGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroup -func (c *IAM) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) { - op := &request.Operation{ - Name: opCreateGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateGroupInput{} - } - - output = &CreateGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateGroup API operation for AWS Identity and Access Management. -// -// Creates a new group. -// -// For information about the number of groups you can create, see Limitations -// on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreateGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroup -func (c *IAM) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { - req, out := c.CreateGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateInstanceProfile = "CreateInstanceProfile" - -// CreateInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateInstanceProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateInstanceProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateInstanceProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateInstanceProfileRequest method. -// req, resp := client.CreateInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfile -func (c *IAM) CreateInstanceProfileRequest(input *CreateInstanceProfileInput) (req *request.Request, output *CreateInstanceProfileOutput) { - op := &request.Operation{ - Name: opCreateInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInstanceProfileInput{} - } - - output = &CreateInstanceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInstanceProfile API operation for AWS Identity and Access Management. -// -// Creates a new instance profile. For information about instance profiles, -// go to About Instance Profiles (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html). -// -// For information about the number of instance profiles you can create, see -// Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreateInstanceProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfile -func (c *IAM) CreateInstanceProfile(input *CreateInstanceProfileInput) (*CreateInstanceProfileOutput, error) { - req, out := c.CreateInstanceProfileRequest(input) - err := req.Send() - return out, err -} - -const opCreateLoginProfile = "CreateLoginProfile" - -// CreateLoginProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateLoginProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLoginProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLoginProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLoginProfileRequest method. -// req, resp := client.CreateLoginProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfile -func (c *IAM) CreateLoginProfileRequest(input *CreateLoginProfileInput) (req *request.Request, output *CreateLoginProfileOutput) { - op := &request.Operation{ - Name: opCreateLoginProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLoginProfileInput{} - } - - output = &CreateLoginProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLoginProfile API operation for AWS Identity and Access Management. -// -// Creates a password for the specified user, giving the user the ability to -// access AWS services through the AWS Management Console. For more information -// about managing passwords, see Managing Passwords (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreateLoginProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodePasswordPolicyViolationException "PasswordPolicyViolation" -// The request was rejected because the provided password did not meet the requirements -// imposed by the account password policy. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfile -func (c *IAM) CreateLoginProfile(input *CreateLoginProfileInput) (*CreateLoginProfileOutput, error) { - req, out := c.CreateLoginProfileRequest(input) - err := req.Send() - return out, err -} - -const opCreateOpenIDConnectProvider = "CreateOpenIDConnectProvider" - -// CreateOpenIDConnectProviderRequest generates a "aws/request.Request" representing the -// client's request for the CreateOpenIDConnectProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateOpenIDConnectProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateOpenIDConnectProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateOpenIDConnectProviderRequest method. -// req, resp := client.CreateOpenIDConnectProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProvider -func (c *IAM) CreateOpenIDConnectProviderRequest(input *CreateOpenIDConnectProviderInput) (req *request.Request, output *CreateOpenIDConnectProviderOutput) { - op := &request.Operation{ - Name: opCreateOpenIDConnectProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateOpenIDConnectProviderInput{} - } - - output = &CreateOpenIDConnectProviderOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateOpenIDConnectProvider API operation for AWS Identity and Access Management. -// -// Creates an IAM entity to describe an identity provider (IdP) that supports -// OpenID Connect (OIDC) (http://openid.net/connect/). -// -// The OIDC provider that you create with this operation can be used as a principal -// in a role's trust policy to establish a trust relationship between AWS and -// the OIDC provider. -// -// When you create the IAM OIDC provider, you specify the URL of the OIDC identity -// provider (IdP) to trust, a list of client IDs (also known as audiences) that -// identify the application or applications that are allowed to authenticate -// using the OIDC provider, and a list of thumbprints of the server certificate(s) -// that the IdP uses. You get all of this information from the OIDC IdP that -// you want to use for access to AWS. -// -// Because trust for the OIDC provider is ultimately derived from the IAM provider -// that this action creates, it is a best practice to limit access to the CreateOpenIDConnectProvider -// action to highly-privileged users. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation CreateOpenIDConnectProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProvider -func (c *IAM) CreateOpenIDConnectProvider(input *CreateOpenIDConnectProviderInput) (*CreateOpenIDConnectProviderOutput, error) { - req, out := c.CreateOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err -} - -const opCreatePolicy = "CreatePolicy" - -// CreatePolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreatePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePolicyRequest method. -// req, resp := client.CreatePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicy -func (c *IAM) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Request, output *CreatePolicyOutput) { - op := &request.Operation{ - Name: opCreatePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePolicyInput{} - } - - output = &CreatePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePolicy API operation for AWS Identity and Access Management. -// -// Creates a new managed policy for your AWS account. -// -// This operation creates a policy version with a version identifier of v1 and -// sets v1 as the policy's default version. For more information about policy -// versions, see Versioning for Managed Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) -// in the IAM User Guide. -// -// For more information about managed policies in general, see Managed Policies -// and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreatePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicy -func (c *IAM) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) { - req, out := c.CreatePolicyRequest(input) - err := req.Send() - return out, err -} - -const opCreatePolicyVersion = "CreatePolicyVersion" - -// CreatePolicyVersionRequest generates a "aws/request.Request" representing the -// client's request for the CreatePolicyVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePolicyVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePolicyVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePolicyVersionRequest method. -// req, resp := client.CreatePolicyVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersion -func (c *IAM) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) (req *request.Request, output *CreatePolicyVersionOutput) { - op := &request.Operation{ - Name: opCreatePolicyVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePolicyVersionInput{} - } - - output = &CreatePolicyVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePolicyVersion API operation for AWS Identity and Access Management. -// -// Creates a new version of the specified managed policy. To update a managed -// policy, you create a new policy version. A managed policy can have up to -// five versions. If the policy has five versions, you must delete an existing -// version using DeletePolicyVersion before you create a new version. -// -// Optionally, you can set the new version as the policy's default version. -// The default version is the version that is in effect for the IAM users, groups, -// and roles to which the policy is attached. -// -// For more information about managed policy versions, see Versioning for Managed -// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreatePolicyVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersion -func (c *IAM) CreatePolicyVersion(input *CreatePolicyVersionInput) (*CreatePolicyVersionOutput, error) { - req, out := c.CreatePolicyVersionRequest(input) - err := req.Send() - return out, err -} - -const opCreateRole = "CreateRole" - -// CreateRoleRequest generates a "aws/request.Request" representing the -// client's request for the CreateRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateRole for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateRole method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateRoleRequest method. -// req, resp := client.CreateRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRole -func (c *IAM) CreateRoleRequest(input *CreateRoleInput) (req *request.Request, output *CreateRoleOutput) { - op := &request.Operation{ - Name: opCreateRole, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRoleInput{} - } - - output = &CreateRoleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRole API operation for AWS Identity and Access Management. -// -// Creates a new role for your AWS account. For more information about roles, -// go to Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). -// For information about limitations on role names and the number of roles you -// can create, go to Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreateRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRole -func (c *IAM) CreateRole(input *CreateRoleInput) (*CreateRoleOutput, error) { - req, out := c.CreateRoleRequest(input) - err := req.Send() - return out, err -} - -const opCreateSAMLProvider = "CreateSAMLProvider" - -// CreateSAMLProviderRequest generates a "aws/request.Request" representing the -// client's request for the CreateSAMLProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSAMLProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSAMLProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSAMLProviderRequest method. -// req, resp := client.CreateSAMLProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProvider -func (c *IAM) CreateSAMLProviderRequest(input *CreateSAMLProviderInput) (req *request.Request, output *CreateSAMLProviderOutput) { - op := &request.Operation{ - Name: opCreateSAMLProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSAMLProviderInput{} - } - - output = &CreateSAMLProviderOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSAMLProvider API operation for AWS Identity and Access Management. -// -// Creates an IAM resource that describes an identity provider (IdP) that supports -// SAML 2.0. -// -// The SAML provider resource that you create with this operation can be used -// as a principal in an IAM role's trust policy to enable federated users who -// sign-in using the SAML IdP to assume the role. You can create an IAM role -// that supports Web-based single sign-on (SSO) to the AWS Management Console -// or one that supports API access to AWS. -// -// When you create the SAML provider resource, you upload an a SAML metadata -// document that you get from your IdP and that includes the issuer's name, -// expiration information, and keys that can be used to validate the SAML authentication -// response (assertions) that the IdP sends. You must generate the metadata -// document using the identity management software that is used as your organization's -// IdP. -// -// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). -// -// 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) -// and About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreateSAMLProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProvider -func (c *IAM) CreateSAMLProvider(input *CreateSAMLProviderInput) (*CreateSAMLProviderOutput, error) { - req, out := c.CreateSAMLProviderRequest(input) - err := req.Send() - return out, err -} - -const opCreateServiceSpecificCredential = "CreateServiceSpecificCredential" - -// CreateServiceSpecificCredentialRequest generates a "aws/request.Request" representing the -// client's request for the CreateServiceSpecificCredential operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateServiceSpecificCredential for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateServiceSpecificCredential method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateServiceSpecificCredentialRequest method. -// req, resp := client.CreateServiceSpecificCredentialRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredential -func (c *IAM) CreateServiceSpecificCredentialRequest(input *CreateServiceSpecificCredentialInput) (req *request.Request, output *CreateServiceSpecificCredentialOutput) { - op := &request.Operation{ - Name: opCreateServiceSpecificCredential, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateServiceSpecificCredentialInput{} - } - - output = &CreateServiceSpecificCredentialOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateServiceSpecificCredential API operation for AWS Identity and Access Management. -// -// Generates a set of credentials consisting of a user name and password that -// can be used to access the service specified in the request. These credentials -// are generated by IAM, and can be used only for the specified service. -// -// You can have a maximum of two sets of service-specific credentials for each -// supported service per user. -// -// The only supported service at this time is AWS CodeCommit. -// -// You can reset the password to a new service-generated value by calling ResetServiceSpecificCredential. -// -// For more information about service-specific credentials, see Using IAM with -// AWS CodeCommit: Git Credentials, SSH Keys, and AWS Access Keys (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreateServiceSpecificCredential for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceNotSupportedException "NotSupportedService" -// The specified service does not support service-specific credentials. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredential -func (c *IAM) CreateServiceSpecificCredential(input *CreateServiceSpecificCredentialInput) (*CreateServiceSpecificCredentialOutput, error) { - req, out := c.CreateServiceSpecificCredentialRequest(input) - err := req.Send() - return out, err -} - -const opCreateUser = "CreateUser" - -// CreateUserRequest generates a "aws/request.Request" representing the -// client's request for the CreateUser operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateUser for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateUser method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateUserRequest method. -// req, resp := client.CreateUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUser -func (c *IAM) CreateUserRequest(input *CreateUserInput) (req *request.Request, output *CreateUserOutput) { - op := &request.Operation{ - Name: opCreateUser, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateUserInput{} - } - - output = &CreateUserOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateUser API operation for AWS Identity and Access Management. -// -// Creates a new IAM user for your AWS account. -// -// For information about limitations on the number of IAM users you can create, -// see Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation CreateUser for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUser -func (c *IAM) CreateUser(input *CreateUserInput) (*CreateUserOutput, error) { - req, out := c.CreateUserRequest(input) - err := req.Send() - return out, err -} - -const opCreateVirtualMFADevice = "CreateVirtualMFADevice" - -// CreateVirtualMFADeviceRequest generates a "aws/request.Request" representing the -// client's request for the CreateVirtualMFADevice operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVirtualMFADevice for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVirtualMFADevice method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVirtualMFADeviceRequest method. -// req, resp := client.CreateVirtualMFADeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADevice -func (c *IAM) CreateVirtualMFADeviceRequest(input *CreateVirtualMFADeviceInput) (req *request.Request, output *CreateVirtualMFADeviceOutput) { - op := &request.Operation{ - Name: opCreateVirtualMFADevice, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVirtualMFADeviceInput{} - } - - output = &CreateVirtualMFADeviceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVirtualMFADevice API operation for AWS Identity and Access Management. -// -// Creates a new virtual MFA device for the AWS account. After creating the -// virtual MFA, use EnableMFADevice to attach the MFA device to an IAM user. -// For more information about creating and working with virtual MFA devices, -// go to Using a Virtual MFA Device (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) -// in the IAM User Guide. -// -// For information about limits on the number of MFA devices you can create, -// see Limitations on Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// in the IAM User Guide. -// -// The seed information contained in the QR code and the Base32 string should -// be treated like any other secret access information, such as your AWS access -// keys or your passwords. After you provision your virtual device, you should -// ensure that the information is destroyed following secure procedures. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation CreateVirtualMFADevice for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADevice -func (c *IAM) CreateVirtualMFADevice(input *CreateVirtualMFADeviceInput) (*CreateVirtualMFADeviceOutput, error) { - req, out := c.CreateVirtualMFADeviceRequest(input) - err := req.Send() - return out, err -} - -const opDeactivateMFADevice = "DeactivateMFADevice" - -// DeactivateMFADeviceRequest generates a "aws/request.Request" representing the -// client's request for the DeactivateMFADevice operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeactivateMFADevice for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeactivateMFADevice method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeactivateMFADeviceRequest method. -// req, resp := client.DeactivateMFADeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADevice -func (c *IAM) DeactivateMFADeviceRequest(input *DeactivateMFADeviceInput) (req *request.Request, output *DeactivateMFADeviceOutput) { - op := &request.Operation{ - Name: opDeactivateMFADevice, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeactivateMFADeviceInput{} - } - - output = &DeactivateMFADeviceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeactivateMFADevice API operation for AWS Identity and Access Management. -// -// Deactivates the specified MFA device and removes it from association with -// the user name for which it was originally enabled. -// -// For more information about creating and working with virtual MFA devices, -// go to Using a Virtual MFA Device (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DeactivateMFADevice for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" -// The request was rejected because it referenced an entity that is temporarily -// unmodifiable, such as a user name that was deleted and then recreated. The -// error indicates that the request is likely to succeed if you try again after -// waiting several minutes. The error message describes the entity. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADevice -func (c *IAM) DeactivateMFADevice(input *DeactivateMFADeviceInput) (*DeactivateMFADeviceOutput, error) { - req, out := c.DeactivateMFADeviceRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAccessKey = "DeleteAccessKey" - -// DeleteAccessKeyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAccessKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAccessKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAccessKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAccessKeyRequest method. -// req, resp := client.DeleteAccessKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKey -func (c *IAM) DeleteAccessKeyRequest(input *DeleteAccessKeyInput) (req *request.Request, output *DeleteAccessKeyOutput) { - op := &request.Operation{ - Name: opDeleteAccessKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAccessKeyInput{} - } - - output = &DeleteAccessKeyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAccessKey API operation for AWS Identity and Access Management. -// -// Deletes the access key pair associated with the specified IAM user. -// -// If you do not specify a user name, IAM determines the user name implicitly -// based on the AWS access key ID signing the request. Because this action works -// for access keys under the AWS account, you can use this action to manage -// root credentials even if the AWS account has no associated users. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteAccessKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKey -func (c *IAM) DeleteAccessKey(input *DeleteAccessKeyInput) (*DeleteAccessKeyOutput, error) { - req, out := c.DeleteAccessKeyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAccountAlias = "DeleteAccountAlias" - -// DeleteAccountAliasRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAccountAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAccountAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAccountAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAccountAliasRequest method. -// req, resp := client.DeleteAccountAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAlias -func (c *IAM) DeleteAccountAliasRequest(input *DeleteAccountAliasInput) (req *request.Request, output *DeleteAccountAliasOutput) { - op := &request.Operation{ - Name: opDeleteAccountAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAccountAliasInput{} - } - - output = &DeleteAccountAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAccountAlias API operation for AWS Identity and Access Management. -// -// Deletes the specified AWS account alias. For information about using an AWS -// account alias, see Using an Alias for Your AWS Account ID (http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DeleteAccountAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAlias -func (c *IAM) DeleteAccountAlias(input *DeleteAccountAliasInput) (*DeleteAccountAliasOutput, error) { - req, out := c.DeleteAccountAliasRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAccountPasswordPolicy = "DeleteAccountPasswordPolicy" - -// DeleteAccountPasswordPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAccountPasswordPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAccountPasswordPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAccountPasswordPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAccountPasswordPolicyRequest method. -// req, resp := client.DeleteAccountPasswordPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicy -func (c *IAM) DeleteAccountPasswordPolicyRequest(input *DeleteAccountPasswordPolicyInput) (req *request.Request, output *DeleteAccountPasswordPolicyOutput) { - op := &request.Operation{ - Name: opDeleteAccountPasswordPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAccountPasswordPolicyInput{} - } - - output = &DeleteAccountPasswordPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAccountPasswordPolicy API operation for AWS Identity and Access Management. -// -// Deletes the password policy for the AWS account. There are no parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteAccountPasswordPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicy -func (c *IAM) DeleteAccountPasswordPolicy(input *DeleteAccountPasswordPolicyInput) (*DeleteAccountPasswordPolicyOutput, error) { - req, out := c.DeleteAccountPasswordPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteGroup = "DeleteGroup" - -// DeleteGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteGroupRequest method. -// req, resp := client.DeleteGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroup -func (c *IAM) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) { - op := &request.Operation{ - Name: opDeleteGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteGroupInput{} - } - - output = &DeleteGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteGroup API operation for AWS Identity and Access Management. -// -// Deletes the specified IAM group. The group must not contain any users or -// have any attached policies. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeDeleteConflictException "DeleteConflict" -// The request was rejected because it attempted to delete a resource that has -// attached subordinate entities. The error message describes these entities. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroup -func (c *IAM) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { - req, out := c.DeleteGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteGroupPolicy = "DeleteGroupPolicy" - -// DeleteGroupPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGroupPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteGroupPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteGroupPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteGroupPolicyRequest method. -// req, resp := client.DeleteGroupPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicy -func (c *IAM) DeleteGroupPolicyRequest(input *DeleteGroupPolicyInput) (req *request.Request, output *DeleteGroupPolicyOutput) { - op := &request.Operation{ - Name: opDeleteGroupPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteGroupPolicyInput{} - } - - output = &DeleteGroupPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteGroupPolicy API operation for AWS Identity and Access Management. -// -// Deletes the specified inline policy that is embedded in the specified IAM -// group. -// -// A group can also have managed policies attached to it. To detach a managed -// policy from a group, use DetachGroupPolicy. For more information about policies, -// refer to Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DeleteGroupPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicy -func (c *IAM) DeleteGroupPolicy(input *DeleteGroupPolicyInput) (*DeleteGroupPolicyOutput, error) { - req, out := c.DeleteGroupPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteInstanceProfile = "DeleteInstanceProfile" - -// DeleteInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the DeleteInstanceProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteInstanceProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteInstanceProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteInstanceProfileRequest method. -// req, resp := client.DeleteInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfile -func (c *IAM) DeleteInstanceProfileRequest(input *DeleteInstanceProfileInput) (req *request.Request, output *DeleteInstanceProfileOutput) { - op := &request.Operation{ - Name: opDeleteInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteInstanceProfileInput{} - } - - output = &DeleteInstanceProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteInstanceProfile API operation for AWS Identity and Access Management. -// -// Deletes the specified instance profile. The instance profile must not have -// an associated role. -// -// Make sure you do not have any Amazon EC2 instances running with the instance -// profile you are about to delete. Deleting a role or instance profile that -// is associated with a running instance will break any applications running -// on the instance. -// -// For more information about instance profiles, go to About Instance Profiles -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.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 AWS Identity and Access Management's -// API operation DeleteInstanceProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeDeleteConflictException "DeleteConflict" -// The request was rejected because it attempted to delete a resource that has -// attached subordinate entities. The error message describes these entities. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfile -func (c *IAM) DeleteInstanceProfile(input *DeleteInstanceProfileInput) (*DeleteInstanceProfileOutput, error) { - req, out := c.DeleteInstanceProfileRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLoginProfile = "DeleteLoginProfile" - -// DeleteLoginProfileRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLoginProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLoginProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLoginProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLoginProfileRequest method. -// req, resp := client.DeleteLoginProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfile -func (c *IAM) DeleteLoginProfileRequest(input *DeleteLoginProfileInput) (req *request.Request, output *DeleteLoginProfileOutput) { - op := &request.Operation{ - Name: opDeleteLoginProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLoginProfileInput{} - } - - output = &DeleteLoginProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteLoginProfile API operation for AWS Identity and Access Management. -// -// Deletes the password for the specified IAM user, which terminates the user's -// ability to access AWS services through the AWS Management Console. -// -// Deleting a user's password does not prevent a user from accessing AWS through -// the command line interface or the API. To prevent all user access you must -// also either make any access keys inactive or delete them. For more information -// about making keys inactive or deleting them, see UpdateAccessKey and DeleteAccessKey. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteLoginProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" -// The request was rejected because it referenced an entity that is temporarily -// unmodifiable, such as a user name that was deleted and then recreated. The -// error indicates that the request is likely to succeed if you try again after -// waiting several minutes. The error message describes the entity. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfile -func (c *IAM) DeleteLoginProfile(input *DeleteLoginProfileInput) (*DeleteLoginProfileOutput, error) { - req, out := c.DeleteLoginProfileRequest(input) - err := req.Send() - return out, err -} - -const opDeleteOpenIDConnectProvider = "DeleteOpenIDConnectProvider" - -// DeleteOpenIDConnectProviderRequest generates a "aws/request.Request" representing the -// client's request for the DeleteOpenIDConnectProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteOpenIDConnectProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteOpenIDConnectProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteOpenIDConnectProviderRequest method. -// req, resp := client.DeleteOpenIDConnectProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProvider -func (c *IAM) DeleteOpenIDConnectProviderRequest(input *DeleteOpenIDConnectProviderInput) (req *request.Request, output *DeleteOpenIDConnectProviderOutput) { - op := &request.Operation{ - Name: opDeleteOpenIDConnectProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteOpenIDConnectProviderInput{} - } - - output = &DeleteOpenIDConnectProviderOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteOpenIDConnectProvider API operation for AWS Identity and Access Management. -// -// Deletes an OpenID Connect identity provider (IdP) resource object in IAM. -// -// Deleting an IAM OIDC provider resource does not update any roles that reference -// the provider as a principal in their trust policies. Any attempt to assume -// a role that references a deleted provider fails. -// -// This action is idempotent; it does not fail or return an error if you call -// the action for a provider that does not 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 Identity and Access Management's -// API operation DeleteOpenIDConnectProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProvider -func (c *IAM) DeleteOpenIDConnectProvider(input *DeleteOpenIDConnectProviderInput) (*DeleteOpenIDConnectProviderOutput, error) { - req, out := c.DeleteOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err -} - -const opDeletePolicy = "DeletePolicy" - -// DeletePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeletePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePolicyRequest method. -// req, resp := client.DeletePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicy -func (c *IAM) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput) { - op := &request.Operation{ - Name: opDeletePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePolicyInput{} - } - - output = &DeletePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePolicy API operation for AWS Identity and Access Management. -// -// Deletes the specified managed policy. -// -// Before you can delete a managed policy, you must first detach the policy -// from all users, groups, and roles that it is attached to, and you must delete -// all of the policy's versions. The following steps describe the process for -// deleting a managed policy: -// -// * Detach the policy from all users, groups, and roles that the policy -// is attached to, using the DetachUserPolicy, DetachGroupPolicy, or DetachRolePolicy -// APIs. To list all the users, groups, and roles that a policy is attached -// to, use ListEntitiesForPolicy. -// -// * Delete all versions of the policy using DeletePolicyVersion. To list -// the policy's versions, use ListPolicyVersions. You cannot use DeletePolicyVersion -// to delete the version that is marked as the default version. You delete -// the policy's default version in the next step of the process. -// -// * Delete the policy (this automatically deletes the policy's default version) -// using this API. -// -// For information about managed policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DeletePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeDeleteConflictException "DeleteConflict" -// The request was rejected because it attempted to delete a resource that has -// attached subordinate entities. The error message describes these entities. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicy -func (c *IAM) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { - req, out := c.DeletePolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeletePolicyVersion = "DeletePolicyVersion" - -// DeletePolicyVersionRequest generates a "aws/request.Request" representing the -// client's request for the DeletePolicyVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePolicyVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePolicyVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePolicyVersionRequest method. -// req, resp := client.DeletePolicyVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersion -func (c *IAM) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) (req *request.Request, output *DeletePolicyVersionOutput) { - op := &request.Operation{ - Name: opDeletePolicyVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePolicyVersionInput{} - } - - output = &DeletePolicyVersionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePolicyVersion API operation for AWS Identity and Access Management. -// -// Deletes the specified version from the specified managed policy. -// -// You cannot delete the default version from a policy using this API. To delete -// the default version from a policy, use DeletePolicy. To find out which version -// of a policy is marked as the default version, use ListPolicyVersions. -// -// For information about versions for managed policies, see Versioning for Managed -// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DeletePolicyVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeDeleteConflictException "DeleteConflict" -// The request was rejected because it attempted to delete a resource that has -// attached subordinate entities. The error message describes these entities. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersion -func (c *IAM) DeletePolicyVersion(input *DeletePolicyVersionInput) (*DeletePolicyVersionOutput, error) { - req, out := c.DeletePolicyVersionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRole = "DeleteRole" - -// DeleteRoleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRole for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRole method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRoleRequest method. -// req, resp := client.DeleteRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRole -func (c *IAM) DeleteRoleRequest(input *DeleteRoleInput) (req *request.Request, output *DeleteRoleOutput) { - op := &request.Operation{ - Name: opDeleteRole, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRoleInput{} - } - - output = &DeleteRoleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRole API operation for AWS Identity and Access Management. -// -// Deletes the specified role. The role must not have any policies attached. -// For more information about roles, go to Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). -// -// Make sure you do not have any Amazon EC2 instances running with the role -// you are about to delete. Deleting a role or instance profile that is associated -// with a running instance will break any applications running on the 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 AWS Identity and Access Management's -// API operation DeleteRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeDeleteConflictException "DeleteConflict" -// The request was rejected because it attempted to delete a resource that has -// attached subordinate entities. The error message describes these entities. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRole -func (c *IAM) DeleteRole(input *DeleteRoleInput) (*DeleteRoleOutput, error) { - req, out := c.DeleteRoleRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRolePolicy = "DeleteRolePolicy" - -// DeleteRolePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRolePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRolePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRolePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRolePolicyRequest method. -// req, resp := client.DeleteRolePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicy -func (c *IAM) DeleteRolePolicyRequest(input *DeleteRolePolicyInput) (req *request.Request, output *DeleteRolePolicyOutput) { - op := &request.Operation{ - Name: opDeleteRolePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRolePolicyInput{} - } - - output = &DeleteRolePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRolePolicy API operation for AWS Identity and Access Management. -// -// Deletes the specified inline policy that is embedded in the specified IAM -// role. -// -// A role can also have managed policies attached to it. To detach a managed -// policy from a role, use DetachRolePolicy. For more information about policies, -// refer to Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DeleteRolePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicy -func (c *IAM) DeleteRolePolicy(input *DeleteRolePolicyInput) (*DeleteRolePolicyOutput, error) { - req, out := c.DeleteRolePolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteSAMLProvider = "DeleteSAMLProvider" - -// DeleteSAMLProviderRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSAMLProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSAMLProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSAMLProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSAMLProviderRequest method. -// req, resp := client.DeleteSAMLProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProvider -func (c *IAM) DeleteSAMLProviderRequest(input *DeleteSAMLProviderInput) (req *request.Request, output *DeleteSAMLProviderOutput) { - op := &request.Operation{ - Name: opDeleteSAMLProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSAMLProviderInput{} - } - - output = &DeleteSAMLProviderOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSAMLProvider API operation for AWS Identity and Access Management. -// -// Deletes a SAML provider resource in IAM. -// -// Deleting the provider resource from IAM does not update any roles that reference -// the SAML provider resource's ARN as a principal in their trust policies. -// Any attempt to assume a role that references a non-existent provider resource -// ARN fails. -// -// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.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 AWS Identity and Access Management's -// API operation DeleteSAMLProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProvider -func (c *IAM) DeleteSAMLProvider(input *DeleteSAMLProviderInput) (*DeleteSAMLProviderOutput, error) { - req, out := c.DeleteSAMLProviderRequest(input) - err := req.Send() - return out, err -} - -const opDeleteSSHPublicKey = "DeleteSSHPublicKey" - -// DeleteSSHPublicKeyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSSHPublicKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSSHPublicKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSSHPublicKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSSHPublicKeyRequest method. -// req, resp := client.DeleteSSHPublicKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKey -func (c *IAM) DeleteSSHPublicKeyRequest(input *DeleteSSHPublicKeyInput) (req *request.Request, output *DeleteSSHPublicKeyOutput) { - op := &request.Operation{ - Name: opDeleteSSHPublicKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSSHPublicKeyInput{} - } - - output = &DeleteSSHPublicKeyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSSHPublicKey API operation for AWS Identity and Access Management. -// -// Deletes the specified SSH public key. -// -// The SSH public key deleted by this action is used only for authenticating -// the associated IAM user to an AWS CodeCommit repository. For more information -// about using SSH keys to authenticate to an AWS CodeCommit repository, see -// Set up AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) -// in the AWS CodeCommit 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 AWS Identity and Access Management's -// API operation DeleteSSHPublicKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKey -func (c *IAM) DeleteSSHPublicKey(input *DeleteSSHPublicKeyInput) (*DeleteSSHPublicKeyOutput, error) { - req, out := c.DeleteSSHPublicKeyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteServerCertificate = "DeleteServerCertificate" - -// DeleteServerCertificateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteServerCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteServerCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteServerCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteServerCertificateRequest method. -// req, resp := client.DeleteServerCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificate -func (c *IAM) DeleteServerCertificateRequest(input *DeleteServerCertificateInput) (req *request.Request, output *DeleteServerCertificateOutput) { - op := &request.Operation{ - Name: opDeleteServerCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteServerCertificateInput{} - } - - output = &DeleteServerCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteServerCertificate API operation for AWS Identity and Access Management. -// -// Deletes the specified server certificate. -// -// For more information about working with server certificates, including a -// list of AWS services that can use the server certificates that you manage -// with IAM, go to Working with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) -// in the IAM User Guide. -// -// If you are using a server certificate with Elastic Load Balancing, deleting -// the certificate could have implications for your application. If Elastic -// Load Balancing doesn't detect the deletion of bound certificates, it may -// continue to use the certificates. This could cause Elastic Load Balancing -// to stop accepting traffic. We recommend that you remove the reference to -// the certificate from Elastic Load Balancing before using this command to -// delete the certificate. For more information, go to DeleteLoadBalancerListeners -// (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_DeleteLoadBalancerListeners.html) -// in the Elastic Load Balancing API Reference. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteServerCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeDeleteConflictException "DeleteConflict" -// The request was rejected because it attempted to delete a resource that has -// attached subordinate entities. The error message describes these entities. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificate -func (c *IAM) DeleteServerCertificate(input *DeleteServerCertificateInput) (*DeleteServerCertificateOutput, error) { - req, out := c.DeleteServerCertificateRequest(input) - err := req.Send() - return out, err -} - -const opDeleteServiceSpecificCredential = "DeleteServiceSpecificCredential" - -// DeleteServiceSpecificCredentialRequest generates a "aws/request.Request" representing the -// client's request for the DeleteServiceSpecificCredential operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteServiceSpecificCredential for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteServiceSpecificCredential method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteServiceSpecificCredentialRequest method. -// req, resp := client.DeleteServiceSpecificCredentialRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredential -func (c *IAM) DeleteServiceSpecificCredentialRequest(input *DeleteServiceSpecificCredentialInput) (req *request.Request, output *DeleteServiceSpecificCredentialOutput) { - op := &request.Operation{ - Name: opDeleteServiceSpecificCredential, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteServiceSpecificCredentialInput{} - } - - output = &DeleteServiceSpecificCredentialOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteServiceSpecificCredential API operation for AWS Identity and Access Management. -// -// Deletes the specified service-specific credential. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteServiceSpecificCredential for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredential -func (c *IAM) DeleteServiceSpecificCredential(input *DeleteServiceSpecificCredentialInput) (*DeleteServiceSpecificCredentialOutput, error) { - req, out := c.DeleteServiceSpecificCredentialRequest(input) - err := req.Send() - return out, err -} - -const opDeleteSigningCertificate = "DeleteSigningCertificate" - -// DeleteSigningCertificateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSigningCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSigningCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSigningCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSigningCertificateRequest method. -// req, resp := client.DeleteSigningCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificate -func (c *IAM) DeleteSigningCertificateRequest(input *DeleteSigningCertificateInput) (req *request.Request, output *DeleteSigningCertificateOutput) { - op := &request.Operation{ - Name: opDeleteSigningCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSigningCertificateInput{} - } - - output = &DeleteSigningCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSigningCertificate API operation for AWS Identity and Access Management. -// -// Deletes a signing certificate associated with the specified IAM user. -// -// If you do not specify a user name, IAM determines the user name implicitly -// based on the AWS access key ID signing the request. Because this action works -// for access keys under the AWS account, you can use this action to manage -// root credentials even if the AWS account has no associated IAM users. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteSigningCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificate -func (c *IAM) DeleteSigningCertificate(input *DeleteSigningCertificateInput) (*DeleteSigningCertificateOutput, error) { - req, out := c.DeleteSigningCertificateRequest(input) - err := req.Send() - return out, err -} - -const opDeleteUser = "DeleteUser" - -// DeleteUserRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUser operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteUser for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteUser method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteUserRequest method. -// req, resp := client.DeleteUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUser -func (c *IAM) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, output *DeleteUserOutput) { - op := &request.Operation{ - Name: opDeleteUser, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteUserInput{} - } - - output = &DeleteUserOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteUser API operation for AWS Identity and Access Management. -// -// Deletes the specified IAM user. The user must not belong to any groups or -// have any access keys, signing certificates, or attached policies. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteUser for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeDeleteConflictException "DeleteConflict" -// The request was rejected because it attempted to delete a resource that has -// attached subordinate entities. The error message describes these entities. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUser -func (c *IAM) DeleteUser(input *DeleteUserInput) (*DeleteUserOutput, error) { - req, out := c.DeleteUserRequest(input) - err := req.Send() - return out, err -} - -const opDeleteUserPolicy = "DeleteUserPolicy" - -// DeleteUserPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUserPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteUserPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteUserPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteUserPolicyRequest method. -// req, resp := client.DeleteUserPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicy -func (c *IAM) DeleteUserPolicyRequest(input *DeleteUserPolicyInput) (req *request.Request, output *DeleteUserPolicyOutput) { - op := &request.Operation{ - Name: opDeleteUserPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteUserPolicyInput{} - } - - output = &DeleteUserPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteUserPolicy API operation for AWS Identity and Access Management. -// -// Deletes the specified inline policy that is embedded in the specified IAM -// user. -// -// A user can also have managed policies attached to it. To detach a managed -// policy from a user, use DetachUserPolicy. For more information about policies, -// refer to Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DeleteUserPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicy -func (c *IAM) DeleteUserPolicy(input *DeleteUserPolicyInput) (*DeleteUserPolicyOutput, error) { - req, out := c.DeleteUserPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVirtualMFADevice = "DeleteVirtualMFADevice" - -// DeleteVirtualMFADeviceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVirtualMFADevice operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVirtualMFADevice for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVirtualMFADevice method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVirtualMFADeviceRequest method. -// req, resp := client.DeleteVirtualMFADeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADevice -func (c *IAM) DeleteVirtualMFADeviceRequest(input *DeleteVirtualMFADeviceInput) (req *request.Request, output *DeleteVirtualMFADeviceOutput) { - op := &request.Operation{ - Name: opDeleteVirtualMFADevice, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVirtualMFADeviceInput{} - } - - output = &DeleteVirtualMFADeviceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVirtualMFADevice API operation for AWS Identity and Access Management. -// -// Deletes a virtual MFA device. -// -// You must deactivate a user's virtual MFA device before you can delete it. -// For information about deactivating MFA devices, see DeactivateMFADevice. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation DeleteVirtualMFADevice for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeDeleteConflictException "DeleteConflict" -// The request was rejected because it attempted to delete a resource that has -// attached subordinate entities. The error message describes these entities. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADevice -func (c *IAM) DeleteVirtualMFADevice(input *DeleteVirtualMFADeviceInput) (*DeleteVirtualMFADeviceOutput, error) { - req, out := c.DeleteVirtualMFADeviceRequest(input) - err := req.Send() - return out, err -} - -const opDetachGroupPolicy = "DetachGroupPolicy" - -// DetachGroupPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DetachGroupPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachGroupPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachGroupPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachGroupPolicyRequest method. -// req, resp := client.DetachGroupPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicy -func (c *IAM) DetachGroupPolicyRequest(input *DetachGroupPolicyInput) (req *request.Request, output *DetachGroupPolicyOutput) { - op := &request.Operation{ - Name: opDetachGroupPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachGroupPolicyInput{} - } - - output = &DetachGroupPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachGroupPolicy API operation for AWS Identity and Access Management. -// -// Removes the specified managed policy from the specified IAM group. -// -// A group can also have inline policies embedded with it. To delete an inline -// policy, use the DeleteGroupPolicy API. For information about policies, see -// Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DetachGroupPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicy -func (c *IAM) DetachGroupPolicy(input *DetachGroupPolicyInput) (*DetachGroupPolicyOutput, error) { - req, out := c.DetachGroupPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDetachRolePolicy = "DetachRolePolicy" - -// DetachRolePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DetachRolePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachRolePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachRolePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachRolePolicyRequest method. -// req, resp := client.DetachRolePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicy -func (c *IAM) DetachRolePolicyRequest(input *DetachRolePolicyInput) (req *request.Request, output *DetachRolePolicyOutput) { - op := &request.Operation{ - Name: opDetachRolePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachRolePolicyInput{} - } - - output = &DetachRolePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachRolePolicy API operation for AWS Identity and Access Management. -// -// Removes the specified managed policy from the specified role. -// -// A role can also have inline policies embedded with it. To delete an inline -// policy, use the DeleteRolePolicy API. For information about policies, see -// Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DetachRolePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicy -func (c *IAM) DetachRolePolicy(input *DetachRolePolicyInput) (*DetachRolePolicyOutput, error) { - req, out := c.DetachRolePolicyRequest(input) - err := req.Send() - return out, err -} - -const opDetachUserPolicy = "DetachUserPolicy" - -// DetachUserPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DetachUserPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachUserPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachUserPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachUserPolicyRequest method. -// req, resp := client.DetachUserPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicy -func (c *IAM) DetachUserPolicyRequest(input *DetachUserPolicyInput) (req *request.Request, output *DetachUserPolicyOutput) { - op := &request.Operation{ - Name: opDetachUserPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachUserPolicyInput{} - } - - output = &DetachUserPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachUserPolicy API operation for AWS Identity and Access Management. -// -// Removes the specified managed policy from the specified user. -// -// A user can also have inline policies embedded with it. To delete an inline -// policy, use the DeleteUserPolicy API. For information about policies, see -// Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation DetachUserPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicy -func (c *IAM) DetachUserPolicy(input *DetachUserPolicyInput) (*DetachUserPolicyOutput, error) { - req, out := c.DetachUserPolicyRequest(input) - err := req.Send() - return out, err -} - -const opEnableMFADevice = "EnableMFADevice" - -// EnableMFADeviceRequest generates a "aws/request.Request" representing the -// client's request for the EnableMFADevice operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableMFADevice for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableMFADevice method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableMFADeviceRequest method. -// req, resp := client.EnableMFADeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADevice -func (c *IAM) EnableMFADeviceRequest(input *EnableMFADeviceInput) (req *request.Request, output *EnableMFADeviceOutput) { - op := &request.Operation{ - Name: opEnableMFADevice, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableMFADeviceInput{} - } - - output = &EnableMFADeviceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableMFADevice API operation for AWS Identity and Access Management. -// -// Enables the specified MFA device and associates it with the specified IAM -// user. When enabled, the MFA device is required for every subsequent login -// by the IAM user associated with the device. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation EnableMFADevice for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" -// The request was rejected because it referenced an entity that is temporarily -// unmodifiable, such as a user name that was deleted and then recreated. The -// error indicates that the request is likely to succeed if you try again after -// waiting several minutes. The error message describes the entity. -// -// * ErrCodeInvalidAuthenticationCodeException "InvalidAuthenticationCode" -// The request was rejected because the authentication code was not recognized. -// The error message describes the specific error. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADevice -func (c *IAM) EnableMFADevice(input *EnableMFADeviceInput) (*EnableMFADeviceOutput, error) { - req, out := c.EnableMFADeviceRequest(input) - err := req.Send() - return out, err -} - -const opGenerateCredentialReport = "GenerateCredentialReport" - -// GenerateCredentialReportRequest generates a "aws/request.Request" representing the -// client's request for the GenerateCredentialReport operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GenerateCredentialReport for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GenerateCredentialReport method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GenerateCredentialReportRequest method. -// req, resp := client.GenerateCredentialReportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReport -func (c *IAM) GenerateCredentialReportRequest(input *GenerateCredentialReportInput) (req *request.Request, output *GenerateCredentialReportOutput) { - op := &request.Operation{ - Name: opGenerateCredentialReport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GenerateCredentialReportInput{} - } - - output = &GenerateCredentialReportOutput{} - req = c.newRequest(op, input, output) - return -} - -// GenerateCredentialReport API operation for AWS Identity and Access Management. -// -// Generates a credential report for the AWS account. For more information about -// the credential report, see Getting Credential Reports (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GenerateCredentialReport for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReport -func (c *IAM) GenerateCredentialReport(input *GenerateCredentialReportInput) (*GenerateCredentialReportOutput, error) { - req, out := c.GenerateCredentialReportRequest(input) - err := req.Send() - return out, err -} - -const opGetAccessKeyLastUsed = "GetAccessKeyLastUsed" - -// GetAccessKeyLastUsedRequest generates a "aws/request.Request" representing the -// client's request for the GetAccessKeyLastUsed operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAccessKeyLastUsed for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAccessKeyLastUsed method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAccessKeyLastUsedRequest method. -// req, resp := client.GetAccessKeyLastUsedRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsed -func (c *IAM) GetAccessKeyLastUsedRequest(input *GetAccessKeyLastUsedInput) (req *request.Request, output *GetAccessKeyLastUsedOutput) { - op := &request.Operation{ - Name: opGetAccessKeyLastUsed, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAccessKeyLastUsedInput{} - } - - output = &GetAccessKeyLastUsedOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccessKeyLastUsed API operation for AWS Identity and Access Management. -// -// Retrieves information about when the specified access key was last used. -// The information includes the date and time of last use, along with the AWS -// service and region that were specified in the last request made with that -// key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation GetAccessKeyLastUsed for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsed -func (c *IAM) GetAccessKeyLastUsed(input *GetAccessKeyLastUsedInput) (*GetAccessKeyLastUsedOutput, error) { - req, out := c.GetAccessKeyLastUsedRequest(input) - err := req.Send() - return out, err -} - -const opGetAccountAuthorizationDetails = "GetAccountAuthorizationDetails" - -// GetAccountAuthorizationDetailsRequest generates a "aws/request.Request" representing the -// client's request for the GetAccountAuthorizationDetails operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAccountAuthorizationDetails for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAccountAuthorizationDetails method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAccountAuthorizationDetailsRequest method. -// req, resp := client.GetAccountAuthorizationDetailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetails -func (c *IAM) GetAccountAuthorizationDetailsRequest(input *GetAccountAuthorizationDetailsInput) (req *request.Request, output *GetAccountAuthorizationDetailsOutput) { - op := &request.Operation{ - Name: opGetAccountAuthorizationDetails, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &GetAccountAuthorizationDetailsInput{} - } - - output = &GetAccountAuthorizationDetailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccountAuthorizationDetails API operation for AWS Identity and Access Management. -// -// Retrieves information about all IAM users, groups, roles, and policies in -// your AWS account, including their relationships to one another. Use this -// API to obtain a snapshot of the configuration of IAM permissions (users, -// groups, roles, and policies) in your account. -// -// You can optionally filter the results using the Filter parameter. You can -// paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation GetAccountAuthorizationDetails for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetails -func (c *IAM) GetAccountAuthorizationDetails(input *GetAccountAuthorizationDetailsInput) (*GetAccountAuthorizationDetailsOutput, error) { - req, out := c.GetAccountAuthorizationDetailsRequest(input) - err := req.Send() - return out, err -} - -// GetAccountAuthorizationDetailsPages iterates over the pages of a GetAccountAuthorizationDetails operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetAccountAuthorizationDetails 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 GetAccountAuthorizationDetails operation. -// pageNum := 0 -// err := client.GetAccountAuthorizationDetailsPages(params, -// func(page *GetAccountAuthorizationDetailsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) GetAccountAuthorizationDetailsPages(input *GetAccountAuthorizationDetailsInput, fn func(p *GetAccountAuthorizationDetailsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetAccountAuthorizationDetailsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetAccountAuthorizationDetailsOutput), lastPage) - }) -} - -const opGetAccountPasswordPolicy = "GetAccountPasswordPolicy" - -// GetAccountPasswordPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetAccountPasswordPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAccountPasswordPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAccountPasswordPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAccountPasswordPolicyRequest method. -// req, resp := client.GetAccountPasswordPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicy -func (c *IAM) GetAccountPasswordPolicyRequest(input *GetAccountPasswordPolicyInput) (req *request.Request, output *GetAccountPasswordPolicyOutput) { - op := &request.Operation{ - Name: opGetAccountPasswordPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAccountPasswordPolicyInput{} - } - - output = &GetAccountPasswordPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccountPasswordPolicy API operation for AWS Identity and Access Management. -// -// Retrieves the password policy for the AWS account. For more information about -// using a password policy, go to Managing an IAM Password Policy (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.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 AWS Identity and Access Management's -// API operation GetAccountPasswordPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicy -func (c *IAM) GetAccountPasswordPolicy(input *GetAccountPasswordPolicyInput) (*GetAccountPasswordPolicyOutput, error) { - req, out := c.GetAccountPasswordPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetAccountSummary = "GetAccountSummary" - -// GetAccountSummaryRequest generates a "aws/request.Request" representing the -// client's request for the GetAccountSummary operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAccountSummary for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAccountSummary method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAccountSummaryRequest method. -// req, resp := client.GetAccountSummaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummary -func (c *IAM) GetAccountSummaryRequest(input *GetAccountSummaryInput) (req *request.Request, output *GetAccountSummaryOutput) { - op := &request.Operation{ - Name: opGetAccountSummary, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAccountSummaryInput{} - } - - output = &GetAccountSummaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccountSummary API operation for AWS Identity and Access Management. -// -// Retrieves information about IAM entity usage and IAM quotas in the AWS account. -// -// For information about limitations on IAM entities, see Limitations on IAM -// Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GetAccountSummary for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummary -func (c *IAM) GetAccountSummary(input *GetAccountSummaryInput) (*GetAccountSummaryOutput, error) { - req, out := c.GetAccountSummaryRequest(input) - err := req.Send() - return out, err -} - -const opGetContextKeysForCustomPolicy = "GetContextKeysForCustomPolicy" - -// GetContextKeysForCustomPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetContextKeysForCustomPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetContextKeysForCustomPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetContextKeysForCustomPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetContextKeysForCustomPolicyRequest method. -// req, resp := client.GetContextKeysForCustomPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForCustomPolicy -func (c *IAM) GetContextKeysForCustomPolicyRequest(input *GetContextKeysForCustomPolicyInput) (req *request.Request, output *GetContextKeysForPolicyResponse) { - op := &request.Operation{ - Name: opGetContextKeysForCustomPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetContextKeysForCustomPolicyInput{} - } - - output = &GetContextKeysForPolicyResponse{} - req = c.newRequest(op, input, output) - return -} - -// GetContextKeysForCustomPolicy API operation for AWS Identity and Access Management. -// -// Gets a list of all of the context keys referenced in the input policies. -// The policies are supplied as a list of one or more strings. To get the context -// keys from policies associated with an IAM user, group, or role, use GetContextKeysForPrincipalPolicy. -// -// Context keys are variables maintained by AWS and its services that provide -// details about the context of an API query request, and can be evaluated by -// testing against a value specified in an IAM policy. Use GetContextKeysForCustomPolicy -// to understand what key names and values you must supply when you call SimulateCustomPolicy. -// Note that all parameters are shown in unencoded form here for clarity, but -// must be URL encoded to be included as a part of a real HTML 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 AWS Identity and Access Management's -// API operation GetContextKeysForCustomPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForCustomPolicy -func (c *IAM) GetContextKeysForCustomPolicy(input *GetContextKeysForCustomPolicyInput) (*GetContextKeysForPolicyResponse, error) { - req, out := c.GetContextKeysForCustomPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetContextKeysForPrincipalPolicy = "GetContextKeysForPrincipalPolicy" - -// GetContextKeysForPrincipalPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetContextKeysForPrincipalPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetContextKeysForPrincipalPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetContextKeysForPrincipalPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetContextKeysForPrincipalPolicyRequest method. -// req, resp := client.GetContextKeysForPrincipalPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPrincipalPolicy -func (c *IAM) GetContextKeysForPrincipalPolicyRequest(input *GetContextKeysForPrincipalPolicyInput) (req *request.Request, output *GetContextKeysForPolicyResponse) { - op := &request.Operation{ - Name: opGetContextKeysForPrincipalPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetContextKeysForPrincipalPolicyInput{} - } - - output = &GetContextKeysForPolicyResponse{} - req = c.newRequest(op, input, output) - return -} - -// GetContextKeysForPrincipalPolicy API operation for AWS Identity and Access Management. -// -// Gets a list of all of the context keys referenced in all of the IAM policies -// attached to the specified IAM entity. The entity can be an IAM user, group, -// or role. If you specify a user, then the request also includes all of the -// policies attached to groups that the user is a member of. -// -// You can optionally include a list of one or more additional policies, specified -// as strings. If you want to include only a list of policies by string, use -// GetContextKeysForCustomPolicy instead. -// -// Note: This API discloses information about the permissions granted to other -// users. If you do not want users to see other user's permissions, then consider -// allowing them to use GetContextKeysForCustomPolicy instead. -// -// Context keys are variables maintained by AWS and its services that provide -// details about the context of an API query request, and can be evaluated by -// testing against a value in an IAM policy. Use GetContextKeysForPrincipalPolicy -// to understand what key names and values you must supply when you call SimulatePrincipalPolicy. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation GetContextKeysForPrincipalPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPrincipalPolicy -func (c *IAM) GetContextKeysForPrincipalPolicy(input *GetContextKeysForPrincipalPolicyInput) (*GetContextKeysForPolicyResponse, error) { - req, out := c.GetContextKeysForPrincipalPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetCredentialReport = "GetCredentialReport" - -// GetCredentialReportRequest generates a "aws/request.Request" representing the -// client's request for the GetCredentialReport operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetCredentialReport for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetCredentialReport method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetCredentialReportRequest method. -// req, resp := client.GetCredentialReportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReport -func (c *IAM) GetCredentialReportRequest(input *GetCredentialReportInput) (req *request.Request, output *GetCredentialReportOutput) { - op := &request.Operation{ - Name: opGetCredentialReport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCredentialReportInput{} - } - - output = &GetCredentialReportOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCredentialReport API operation for AWS Identity and Access Management. -// -// Retrieves a credential report for the AWS account. For more information about -// the credential report, see Getting Credential Reports (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GetCredentialReport for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCredentialReportNotPresentException "ReportNotPresent" -// The request was rejected because the credential report does not exist. To -// generate a credential report, use GenerateCredentialReport. -// -// * ErrCodeCredentialReportExpiredException "ReportExpired" -// The request was rejected because the most recent credential report has expired. -// To generate a new credential report, use GenerateCredentialReport. For more -// information about credential report expiration, see Getting Credential Reports -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) -// in the IAM User Guide. -// -// * ErrCodeCredentialReportNotReadyException "ReportInProgress" -// The request was rejected because the credential report is still being generated. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReport -func (c *IAM) GetCredentialReport(input *GetCredentialReportInput) (*GetCredentialReportOutput, error) { - req, out := c.GetCredentialReportRequest(input) - err := req.Send() - return out, err -} - -const opGetGroup = "GetGroup" - -// GetGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetGroupRequest method. -// req, resp := client.GetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroup -func (c *IAM) GetGroupRequest(input *GetGroupInput) (req *request.Request, output *GetGroupOutput) { - op := &request.Operation{ - Name: opGetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &GetGroupInput{} - } - - output = &GetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGroup API operation for AWS Identity and Access Management. -// -// Returns a list of IAM users that are in the specified IAM group. You can -// paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation GetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroup -func (c *IAM) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) { - req, out := c.GetGroupRequest(input) - err := req.Send() - return out, err -} - -// GetGroupPages iterates over the pages of a GetGroup operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetGroup 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 GetGroup operation. -// pageNum := 0 -// err := client.GetGroupPages(params, -// func(page *GetGroupOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) GetGroupPages(input *GetGroupInput, fn func(p *GetGroupOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetGroupRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetGroupOutput), lastPage) - }) -} - -const opGetGroupPolicy = "GetGroupPolicy" - -// GetGroupPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetGroupPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetGroupPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetGroupPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetGroupPolicyRequest method. -// req, resp := client.GetGroupPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicy -func (c *IAM) GetGroupPolicyRequest(input *GetGroupPolicyInput) (req *request.Request, output *GetGroupPolicyOutput) { - op := &request.Operation{ - Name: opGetGroupPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetGroupPolicyInput{} - } - - output = &GetGroupPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGroupPolicy API operation for AWS Identity and Access Management. -// -// Retrieves the specified inline policy document that is embedded in the specified -// IAM group. -// -// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). -// You can use a URL decoding method to convert the policy back to plain JSON -// text. For example, if you use Java, you can use the decode method of the -// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs -// provide similar functionality. -// -// An IAM group can also have managed policies attached to it. To retrieve a -// managed policy document that is attached to a group, use GetPolicy to determine -// the policy's default version, then use GetPolicyVersion to retrieve the policy -// document. -// -// For more information about policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GetGroupPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicy -func (c *IAM) GetGroupPolicy(input *GetGroupPolicyInput) (*GetGroupPolicyOutput, error) { - req, out := c.GetGroupPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetInstanceProfile = "GetInstanceProfile" - -// GetInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the GetInstanceProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstanceProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstanceProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstanceProfileRequest method. -// req, resp := client.GetInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfile -func (c *IAM) GetInstanceProfileRequest(input *GetInstanceProfileInput) (req *request.Request, output *GetInstanceProfileOutput) { - op := &request.Operation{ - Name: opGetInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstanceProfileInput{} - } - - output = &GetInstanceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstanceProfile API operation for AWS Identity and Access Management. -// -// Retrieves information about the specified instance profile, including the -// instance profile's path, GUID, ARN, and role. For more information about -// instance profiles, see About Instance Profiles (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GetInstanceProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfile -func (c *IAM) GetInstanceProfile(input *GetInstanceProfileInput) (*GetInstanceProfileOutput, error) { - req, out := c.GetInstanceProfileRequest(input) - err := req.Send() - return out, err -} - -const opGetLoginProfile = "GetLoginProfile" - -// GetLoginProfileRequest generates a "aws/request.Request" representing the -// client's request for the GetLoginProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetLoginProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetLoginProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetLoginProfileRequest method. -// req, resp := client.GetLoginProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfile -func (c *IAM) GetLoginProfileRequest(input *GetLoginProfileInput) (req *request.Request, output *GetLoginProfileOutput) { - op := &request.Operation{ - Name: opGetLoginProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetLoginProfileInput{} - } - - output = &GetLoginProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetLoginProfile API operation for AWS Identity and Access Management. -// -// Retrieves the user name and password-creation date for the specified IAM -// user. If the user has not been assigned a password, the action returns a -// 404 (NoSuchEntity) 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 AWS Identity and Access Management's -// API operation GetLoginProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfile -func (c *IAM) GetLoginProfile(input *GetLoginProfileInput) (*GetLoginProfileOutput, error) { - req, out := c.GetLoginProfileRequest(input) - err := req.Send() - return out, err -} - -const opGetOpenIDConnectProvider = "GetOpenIDConnectProvider" - -// GetOpenIDConnectProviderRequest generates a "aws/request.Request" representing the -// client's request for the GetOpenIDConnectProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetOpenIDConnectProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetOpenIDConnectProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetOpenIDConnectProviderRequest method. -// req, resp := client.GetOpenIDConnectProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProvider -func (c *IAM) GetOpenIDConnectProviderRequest(input *GetOpenIDConnectProviderInput) (req *request.Request, output *GetOpenIDConnectProviderOutput) { - op := &request.Operation{ - Name: opGetOpenIDConnectProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetOpenIDConnectProviderInput{} - } - - output = &GetOpenIDConnectProviderOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOpenIDConnectProvider API operation for AWS Identity and Access Management. -// -// Returns information about the specified OpenID Connect (OIDC) provider resource -// object in IAM. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation GetOpenIDConnectProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProvider -func (c *IAM) GetOpenIDConnectProvider(input *GetOpenIDConnectProviderInput) (*GetOpenIDConnectProviderOutput, error) { - req, out := c.GetOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err -} - -const opGetPolicy = "GetPolicy" - -// GetPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPolicyRequest method. -// req, resp := client.GetPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicy -func (c *IAM) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput) { - op := &request.Operation{ - Name: opGetPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPolicyInput{} - } - - output = &GetPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPolicy API operation for AWS Identity and Access Management. -// -// Retrieves information about the specified managed policy, including the policy's -// default version and the total number of IAM users, groups, and roles to which -// the policy is attached. To retrieve the list of the specific users, groups, -// and roles that the policy is attached to, use the ListEntitiesForPolicy API. -// This API returns metadata about the policy. To retrieve the actual policy -// document for a specific version of the policy, use GetPolicyVersion. -// -// This API retrieves information about managed policies. To retrieve information -// about an inline policy that is embedded with an IAM user, group, or role, -// use the GetUserPolicy, GetGroupPolicy, or GetRolePolicy API. -// -// For more information about policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GetPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicy -func (c *IAM) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { - req, out := c.GetPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetPolicyVersion = "GetPolicyVersion" - -// GetPolicyVersionRequest generates a "aws/request.Request" representing the -// client's request for the GetPolicyVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPolicyVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPolicyVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPolicyVersionRequest method. -// req, resp := client.GetPolicyVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersion -func (c *IAM) GetPolicyVersionRequest(input *GetPolicyVersionInput) (req *request.Request, output *GetPolicyVersionOutput) { - op := &request.Operation{ - Name: opGetPolicyVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPolicyVersionInput{} - } - - output = &GetPolicyVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPolicyVersion API operation for AWS Identity and Access Management. -// -// Retrieves information about the specified version of the specified managed -// policy, including the policy document. -// -// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). -// You can use a URL decoding method to convert the policy back to plain JSON -// text. For example, if you use Java, you can use the decode method of the -// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs -// provide similar functionality. -// -// To list the available versions for a policy, use ListPolicyVersions. -// -// This API retrieves information about managed policies. To retrieve information -// about an inline policy that is embedded in a user, group, or role, use the -// GetUserPolicy, GetGroupPolicy, or GetRolePolicy API. -// -// For more information about the types of policies, see Managed Policies and -// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// For more information about managed policy versions, see Versioning for Managed -// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GetPolicyVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersion -func (c *IAM) GetPolicyVersion(input *GetPolicyVersionInput) (*GetPolicyVersionOutput, error) { - req, out := c.GetPolicyVersionRequest(input) - err := req.Send() - return out, err -} - -const opGetRole = "GetRole" - -// GetRoleRequest generates a "aws/request.Request" representing the -// client's request for the GetRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRole for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRole method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRoleRequest method. -// req, resp := client.GetRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRole -func (c *IAM) GetRoleRequest(input *GetRoleInput) (req *request.Request, output *GetRoleOutput) { - op := &request.Operation{ - Name: opGetRole, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRoleInput{} - } - - output = &GetRoleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRole API operation for AWS Identity and Access Management. -// -// Retrieves information about the specified role, including the role's path, -// GUID, ARN, and the role's trust policy that grants permission to assume the -// role. For more information about roles, see Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). -// -// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). -// You can use a URL decoding method to convert the policy back to plain JSON -// text. For example, if you use Java, you can use the decode method of the -// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs -// provide similar functionality. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation GetRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRole -func (c *IAM) GetRole(input *GetRoleInput) (*GetRoleOutput, error) { - req, out := c.GetRoleRequest(input) - err := req.Send() - return out, err -} - -const opGetRolePolicy = "GetRolePolicy" - -// GetRolePolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetRolePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRolePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRolePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRolePolicyRequest method. -// req, resp := client.GetRolePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicy -func (c *IAM) GetRolePolicyRequest(input *GetRolePolicyInput) (req *request.Request, output *GetRolePolicyOutput) { - op := &request.Operation{ - Name: opGetRolePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRolePolicyInput{} - } - - output = &GetRolePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRolePolicy API operation for AWS Identity and Access Management. -// -// Retrieves the specified inline policy document that is embedded with the -// specified IAM role. -// -// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). -// You can use a URL decoding method to convert the policy back to plain JSON -// text. For example, if you use Java, you can use the decode method of the -// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs -// provide similar functionality. -// -// An IAM role can also have managed policies attached to it. To retrieve a -// managed policy document that is attached to a role, use GetPolicy to determine -// the policy's default version, then use GetPolicyVersion to retrieve the policy -// document. -// -// For more information about policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// For more information about roles, see Using Roles to Delegate Permissions -// and Federate Identities (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.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 AWS Identity and Access Management's -// API operation GetRolePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicy -func (c *IAM) GetRolePolicy(input *GetRolePolicyInput) (*GetRolePolicyOutput, error) { - req, out := c.GetRolePolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetSAMLProvider = "GetSAMLProvider" - -// GetSAMLProviderRequest generates a "aws/request.Request" representing the -// client's request for the GetSAMLProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSAMLProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSAMLProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSAMLProviderRequest method. -// req, resp := client.GetSAMLProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProvider -func (c *IAM) GetSAMLProviderRequest(input *GetSAMLProviderInput) (req *request.Request, output *GetSAMLProviderOutput) { - op := &request.Operation{ - Name: opGetSAMLProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSAMLProviderInput{} - } - - output = &GetSAMLProviderOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSAMLProvider API operation for AWS Identity and Access Management. -// -// Returns the SAML provider metadocument that was uploaded when the IAM SAML -// provider resource object was created or updated. -// -// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.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 AWS Identity and Access Management's -// API operation GetSAMLProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProvider -func (c *IAM) GetSAMLProvider(input *GetSAMLProviderInput) (*GetSAMLProviderOutput, error) { - req, out := c.GetSAMLProviderRequest(input) - err := req.Send() - return out, err -} - -const opGetSSHPublicKey = "GetSSHPublicKey" - -// GetSSHPublicKeyRequest generates a "aws/request.Request" representing the -// client's request for the GetSSHPublicKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSSHPublicKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSSHPublicKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSSHPublicKeyRequest method. -// req, resp := client.GetSSHPublicKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKey -func (c *IAM) GetSSHPublicKeyRequest(input *GetSSHPublicKeyInput) (req *request.Request, output *GetSSHPublicKeyOutput) { - op := &request.Operation{ - Name: opGetSSHPublicKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSSHPublicKeyInput{} - } - - output = &GetSSHPublicKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSSHPublicKey API operation for AWS Identity and Access Management. -// -// Retrieves the specified SSH public key, including metadata about the key. -// -// The SSH public key retrieved by this action is used only for authenticating -// the associated IAM user to an AWS CodeCommit repository. For more information -// about using SSH keys to authenticate to an AWS CodeCommit repository, see -// Set up AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) -// in the AWS CodeCommit 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 AWS Identity and Access Management's -// API operation GetSSHPublicKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeUnrecognizedPublicKeyEncodingException "UnrecognizedPublicKeyEncoding" -// The request was rejected because the public key encoding format is unsupported -// or unrecognized. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKey -func (c *IAM) GetSSHPublicKey(input *GetSSHPublicKeyInput) (*GetSSHPublicKeyOutput, error) { - req, out := c.GetSSHPublicKeyRequest(input) - err := req.Send() - return out, err -} - -const opGetServerCertificate = "GetServerCertificate" - -// GetServerCertificateRequest generates a "aws/request.Request" representing the -// client's request for the GetServerCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetServerCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetServerCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetServerCertificateRequest method. -// req, resp := client.GetServerCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificate -func (c *IAM) GetServerCertificateRequest(input *GetServerCertificateInput) (req *request.Request, output *GetServerCertificateOutput) { - op := &request.Operation{ - Name: opGetServerCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetServerCertificateInput{} - } - - output = &GetServerCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetServerCertificate API operation for AWS Identity and Access Management. -// -// Retrieves information about the specified server certificate stored in IAM. -// -// For more information about working with server certificates, including a -// list of AWS services that can use the server certificates that you manage -// with IAM, go to Working with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GetServerCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificate -func (c *IAM) GetServerCertificate(input *GetServerCertificateInput) (*GetServerCertificateOutput, error) { - req, out := c.GetServerCertificateRequest(input) - err := req.Send() - return out, err -} - -const opGetUser = "GetUser" - -// GetUserRequest generates a "aws/request.Request" representing the -// client's request for the GetUser operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetUser for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetUser method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetUserRequest method. -// req, resp := client.GetUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUser -func (c *IAM) GetUserRequest(input *GetUserInput) (req *request.Request, output *GetUserOutput) { - op := &request.Operation{ - Name: opGetUser, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetUserInput{} - } - - output = &GetUserOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetUser API operation for AWS Identity and Access Management. -// -// Retrieves information about the specified IAM user, including the user's -// creation date, path, unique ID, and ARN. -// -// If you do not specify a user name, IAM determines the user name implicitly -// based on the AWS access key ID used to sign the request to this 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 AWS Identity and Access Management's -// API operation GetUser for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUser -func (c *IAM) GetUser(input *GetUserInput) (*GetUserOutput, error) { - req, out := c.GetUserRequest(input) - err := req.Send() - return out, err -} - -const opGetUserPolicy = "GetUserPolicy" - -// GetUserPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetUserPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetUserPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetUserPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetUserPolicyRequest method. -// req, resp := client.GetUserPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicy -func (c *IAM) GetUserPolicyRequest(input *GetUserPolicyInput) (req *request.Request, output *GetUserPolicyOutput) { - op := &request.Operation{ - Name: opGetUserPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetUserPolicyInput{} - } - - output = &GetUserPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetUserPolicy API operation for AWS Identity and Access Management. -// -// Retrieves the specified inline policy document that is embedded in the specified -// IAM user. -// -// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). -// You can use a URL decoding method to convert the policy back to plain JSON -// text. For example, if you use Java, you can use the decode method of the -// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs -// provide similar functionality. -// -// An IAM user can also have managed policies attached to it. To retrieve a -// managed policy document that is attached to a user, use GetPolicy to determine -// the policy's default version, then use GetPolicyVersion to retrieve the policy -// document. -// -// For more information about policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation GetUserPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicy -func (c *IAM) GetUserPolicy(input *GetUserPolicyInput) (*GetUserPolicyOutput, error) { - req, out := c.GetUserPolicyRequest(input) - err := req.Send() - return out, err -} - -const opListAccessKeys = "ListAccessKeys" - -// ListAccessKeysRequest generates a "aws/request.Request" representing the -// client's request for the ListAccessKeys operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAccessKeys for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAccessKeys method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAccessKeysRequest method. -// req, resp := client.ListAccessKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeys -func (c *IAM) ListAccessKeysRequest(input *ListAccessKeysInput) (req *request.Request, output *ListAccessKeysOutput) { - op := &request.Operation{ - Name: opListAccessKeys, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListAccessKeysInput{} - } - - output = &ListAccessKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAccessKeys API operation for AWS Identity and Access Management. -// -// Returns information about the access key IDs associated with the specified -// IAM user. If there are none, the action returns an empty list. -// -// Although each user is limited to a small number of keys, you can still paginate -// the results using the MaxItems and Marker parameters. -// -// If the UserName field is not specified, the UserName is determined implicitly -// based on the AWS access key ID used to sign the request. Because this action -// works for access keys under the AWS account, you can use this action to manage -// root credentials even if the AWS account has no associated users. -// -// To ensure the security of your AWS account, the secret access key is accessible -// only during key and user creation. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListAccessKeys for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeys -func (c *IAM) ListAccessKeys(input *ListAccessKeysInput) (*ListAccessKeysOutput, error) { - req, out := c.ListAccessKeysRequest(input) - err := req.Send() - return out, err -} - -// ListAccessKeysPages iterates over the pages of a ListAccessKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccessKeys 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 ListAccessKeys operation. -// pageNum := 0 -// err := client.ListAccessKeysPages(params, -// func(page *ListAccessKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAccessKeysPages(input *ListAccessKeysInput, fn func(p *ListAccessKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAccessKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAccessKeysOutput), lastPage) - }) -} - -const opListAccountAliases = "ListAccountAliases" - -// ListAccountAliasesRequest generates a "aws/request.Request" representing the -// client's request for the ListAccountAliases operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAccountAliases for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAccountAliases method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAccountAliasesRequest method. -// req, resp := client.ListAccountAliasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliases -func (c *IAM) ListAccountAliasesRequest(input *ListAccountAliasesInput) (req *request.Request, output *ListAccountAliasesOutput) { - op := &request.Operation{ - Name: opListAccountAliases, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListAccountAliasesInput{} - } - - output = &ListAccountAliasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAccountAliases API operation for AWS Identity and Access Management. -// -// Lists the account alias associated with the AWS account (Note: you can have -// only one). For information about using an AWS account alias, see Using an -// Alias for Your AWS Account ID (http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation ListAccountAliases for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliases -func (c *IAM) ListAccountAliases(input *ListAccountAliasesInput) (*ListAccountAliasesOutput, error) { - req, out := c.ListAccountAliasesRequest(input) - err := req.Send() - return out, err -} - -// ListAccountAliasesPages iterates over the pages of a ListAccountAliases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccountAliases 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 ListAccountAliases operation. -// pageNum := 0 -// err := client.ListAccountAliasesPages(params, -// func(page *ListAccountAliasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAccountAliasesPages(input *ListAccountAliasesInput, fn func(p *ListAccountAliasesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAccountAliasesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAccountAliasesOutput), lastPage) - }) -} - -const opListAttachedGroupPolicies = "ListAttachedGroupPolicies" - -// ListAttachedGroupPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListAttachedGroupPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAttachedGroupPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAttachedGroupPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAttachedGroupPoliciesRequest method. -// req, resp := client.ListAttachedGroupPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPolicies -func (c *IAM) ListAttachedGroupPoliciesRequest(input *ListAttachedGroupPoliciesInput) (req *request.Request, output *ListAttachedGroupPoliciesOutput) { - op := &request.Operation{ - Name: opListAttachedGroupPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListAttachedGroupPoliciesInput{} - } - - output = &ListAttachedGroupPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAttachedGroupPolicies API operation for AWS Identity and Access Management. -// -// Lists all managed policies that are attached to the specified IAM group. -// -// An IAM group can also have inline policies embedded with it. To list the -// inline policies for a group, use the ListGroupPolicies API. For information -// about policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// You can paginate the results using the MaxItems and Marker parameters. You -// can use the PathPrefix parameter to limit the list of policies to only those -// matching the specified path prefix. If there are no policies attached to -// the specified group (or none that match the specified path prefix), the action -// returns an empty list. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListAttachedGroupPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPolicies -func (c *IAM) ListAttachedGroupPolicies(input *ListAttachedGroupPoliciesInput) (*ListAttachedGroupPoliciesOutput, error) { - req, out := c.ListAttachedGroupPoliciesRequest(input) - err := req.Send() - return out, err -} - -// ListAttachedGroupPoliciesPages iterates over the pages of a ListAttachedGroupPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAttachedGroupPolicies 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 ListAttachedGroupPolicies operation. -// pageNum := 0 -// err := client.ListAttachedGroupPoliciesPages(params, -// func(page *ListAttachedGroupPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAttachedGroupPoliciesPages(input *ListAttachedGroupPoliciesInput, fn func(p *ListAttachedGroupPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAttachedGroupPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAttachedGroupPoliciesOutput), lastPage) - }) -} - -const opListAttachedRolePolicies = "ListAttachedRolePolicies" - -// ListAttachedRolePoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListAttachedRolePolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAttachedRolePolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAttachedRolePolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAttachedRolePoliciesRequest method. -// req, resp := client.ListAttachedRolePoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePolicies -func (c *IAM) ListAttachedRolePoliciesRequest(input *ListAttachedRolePoliciesInput) (req *request.Request, output *ListAttachedRolePoliciesOutput) { - op := &request.Operation{ - Name: opListAttachedRolePolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListAttachedRolePoliciesInput{} - } - - output = &ListAttachedRolePoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAttachedRolePolicies API operation for AWS Identity and Access Management. -// -// Lists all managed policies that are attached to the specified IAM role. -// -// An IAM role can also have inline policies embedded with it. To list the inline -// policies for a role, use the ListRolePolicies API. For information about -// policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// You can paginate the results using the MaxItems and Marker parameters. You -// can use the PathPrefix parameter to limit the list of policies to only those -// matching the specified path prefix. If there are no policies attached to -// the specified role (or none that match the specified path prefix), the action -// returns an empty list. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListAttachedRolePolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePolicies -func (c *IAM) ListAttachedRolePolicies(input *ListAttachedRolePoliciesInput) (*ListAttachedRolePoliciesOutput, error) { - req, out := c.ListAttachedRolePoliciesRequest(input) - err := req.Send() - return out, err -} - -// ListAttachedRolePoliciesPages iterates over the pages of a ListAttachedRolePolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAttachedRolePolicies 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 ListAttachedRolePolicies operation. -// pageNum := 0 -// err := client.ListAttachedRolePoliciesPages(params, -// func(page *ListAttachedRolePoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAttachedRolePoliciesPages(input *ListAttachedRolePoliciesInput, fn func(p *ListAttachedRolePoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAttachedRolePoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAttachedRolePoliciesOutput), lastPage) - }) -} - -const opListAttachedUserPolicies = "ListAttachedUserPolicies" - -// ListAttachedUserPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListAttachedUserPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAttachedUserPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAttachedUserPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAttachedUserPoliciesRequest method. -// req, resp := client.ListAttachedUserPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPolicies -func (c *IAM) ListAttachedUserPoliciesRequest(input *ListAttachedUserPoliciesInput) (req *request.Request, output *ListAttachedUserPoliciesOutput) { - op := &request.Operation{ - Name: opListAttachedUserPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListAttachedUserPoliciesInput{} - } - - output = &ListAttachedUserPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAttachedUserPolicies API operation for AWS Identity and Access Management. -// -// Lists all managed policies that are attached to the specified IAM user. -// -// An IAM user can also have inline policies embedded with it. To list the inline -// policies for a user, use the ListUserPolicies API. For information about -// policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// You can paginate the results using the MaxItems and Marker parameters. You -// can use the PathPrefix parameter to limit the list of policies to only those -// matching the specified path prefix. If there are no policies attached to -// the specified group (or none that match the specified path prefix), the action -// returns an empty list. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListAttachedUserPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPolicies -func (c *IAM) ListAttachedUserPolicies(input *ListAttachedUserPoliciesInput) (*ListAttachedUserPoliciesOutput, error) { - req, out := c.ListAttachedUserPoliciesRequest(input) - err := req.Send() - return out, err -} - -// ListAttachedUserPoliciesPages iterates over the pages of a ListAttachedUserPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAttachedUserPolicies 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 ListAttachedUserPolicies operation. -// pageNum := 0 -// err := client.ListAttachedUserPoliciesPages(params, -// func(page *ListAttachedUserPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListAttachedUserPoliciesPages(input *ListAttachedUserPoliciesInput, fn func(p *ListAttachedUserPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAttachedUserPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAttachedUserPoliciesOutput), lastPage) - }) -} - -const opListEntitiesForPolicy = "ListEntitiesForPolicy" - -// ListEntitiesForPolicyRequest generates a "aws/request.Request" representing the -// client's request for the ListEntitiesForPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListEntitiesForPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListEntitiesForPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListEntitiesForPolicyRequest method. -// req, resp := client.ListEntitiesForPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicy -func (c *IAM) ListEntitiesForPolicyRequest(input *ListEntitiesForPolicyInput) (req *request.Request, output *ListEntitiesForPolicyOutput) { - op := &request.Operation{ - Name: opListEntitiesForPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListEntitiesForPolicyInput{} - } - - output = &ListEntitiesForPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEntitiesForPolicy API operation for AWS Identity and Access Management. -// -// Lists all IAM users, groups, and roles that the specified managed policy -// is attached to. -// -// You can use the optional EntityFilter parameter to limit the results to a -// particular type of entity (users, groups, or roles). For example, to list -// only the roles that are attached to the specified policy, set EntityFilter -// to Role. -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListEntitiesForPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicy -func (c *IAM) ListEntitiesForPolicy(input *ListEntitiesForPolicyInput) (*ListEntitiesForPolicyOutput, error) { - req, out := c.ListEntitiesForPolicyRequest(input) - err := req.Send() - return out, err -} - -// ListEntitiesForPolicyPages iterates over the pages of a ListEntitiesForPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEntitiesForPolicy 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 ListEntitiesForPolicy operation. -// pageNum := 0 -// err := client.ListEntitiesForPolicyPages(params, -// func(page *ListEntitiesForPolicyOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListEntitiesForPolicyPages(input *ListEntitiesForPolicyInput, fn func(p *ListEntitiesForPolicyOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListEntitiesForPolicyRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListEntitiesForPolicyOutput), lastPage) - }) -} - -const opListGroupPolicies = "ListGroupPolicies" - -// ListGroupPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListGroupPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListGroupPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListGroupPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListGroupPoliciesRequest method. -// req, resp := client.ListGroupPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPolicies -func (c *IAM) ListGroupPoliciesRequest(input *ListGroupPoliciesInput) (req *request.Request, output *ListGroupPoliciesOutput) { - op := &request.Operation{ - Name: opListGroupPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListGroupPoliciesInput{} - } - - output = &ListGroupPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListGroupPolicies API operation for AWS Identity and Access Management. -// -// Lists the names of the inline policies that are embedded in the specified -// IAM group. -// -// An IAM group can also have managed policies attached to it. To list the managed -// policies that are attached to a group, use ListAttachedGroupPolicies. For -// more information about policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// You can paginate the results using the MaxItems and Marker parameters. If -// there are no inline policies embedded with the specified group, the action -// returns an empty list. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListGroupPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPolicies -func (c *IAM) ListGroupPolicies(input *ListGroupPoliciesInput) (*ListGroupPoliciesOutput, error) { - req, out := c.ListGroupPoliciesRequest(input) - err := req.Send() - return out, err -} - -// ListGroupPoliciesPages iterates over the pages of a ListGroupPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroupPolicies 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 ListGroupPolicies operation. -// pageNum := 0 -// err := client.ListGroupPoliciesPages(params, -// func(page *ListGroupPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListGroupPoliciesPages(input *ListGroupPoliciesInput, fn func(p *ListGroupPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListGroupPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListGroupPoliciesOutput), lastPage) - }) -} - -const opListGroups = "ListGroups" - -// ListGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListGroupsRequest method. -// req, resp := client.ListGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroups -func (c *IAM) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput) { - op := &request.Operation{ - Name: opListGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListGroupsInput{} - } - - output = &ListGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListGroups API operation for AWS Identity and Access Management. -// -// Lists the IAM groups that have the specified path prefix. -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroups -func (c *IAM) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { - req, out := c.ListGroupsRequest(input) - err := req.Send() - return out, err -} - -// ListGroupsPages iterates over the pages of a ListGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroups 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 ListGroups operation. -// pageNum := 0 -// err := client.ListGroupsPages(params, -// func(page *ListGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListGroupsPages(input *ListGroupsInput, fn func(p *ListGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListGroupsOutput), lastPage) - }) -} - -const opListGroupsForUser = "ListGroupsForUser" - -// ListGroupsForUserRequest generates a "aws/request.Request" representing the -// client's request for the ListGroupsForUser operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListGroupsForUser for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListGroupsForUser method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListGroupsForUserRequest method. -// req, resp := client.ListGroupsForUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUser -func (c *IAM) ListGroupsForUserRequest(input *ListGroupsForUserInput) (req *request.Request, output *ListGroupsForUserOutput) { - op := &request.Operation{ - Name: opListGroupsForUser, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListGroupsForUserInput{} - } - - output = &ListGroupsForUserOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListGroupsForUser API operation for AWS Identity and Access Management. -// -// Lists the IAM groups that the specified IAM user belongs to. -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListGroupsForUser for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUser -func (c *IAM) ListGroupsForUser(input *ListGroupsForUserInput) (*ListGroupsForUserOutput, error) { - req, out := c.ListGroupsForUserRequest(input) - err := req.Send() - return out, err -} - -// ListGroupsForUserPages iterates over the pages of a ListGroupsForUser operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroupsForUser 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 ListGroupsForUser operation. -// pageNum := 0 -// err := client.ListGroupsForUserPages(params, -// func(page *ListGroupsForUserOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListGroupsForUserPages(input *ListGroupsForUserInput, fn func(p *ListGroupsForUserOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListGroupsForUserRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListGroupsForUserOutput), lastPage) - }) -} - -const opListInstanceProfiles = "ListInstanceProfiles" - -// ListInstanceProfilesRequest generates a "aws/request.Request" representing the -// client's request for the ListInstanceProfiles operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListInstanceProfiles for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListInstanceProfiles method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListInstanceProfilesRequest method. -// req, resp := client.ListInstanceProfilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfiles -func (c *IAM) ListInstanceProfilesRequest(input *ListInstanceProfilesInput) (req *request.Request, output *ListInstanceProfilesOutput) { - op := &request.Operation{ - Name: opListInstanceProfiles, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListInstanceProfilesInput{} - } - - output = &ListInstanceProfilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListInstanceProfiles API operation for AWS Identity and Access Management. -// -// Lists the instance profiles that have the specified path prefix. If there -// are none, the action returns an empty list. For more information about instance -// profiles, go to About Instance Profiles (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html). -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListInstanceProfiles for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfiles -func (c *IAM) ListInstanceProfiles(input *ListInstanceProfilesInput) (*ListInstanceProfilesOutput, error) { - req, out := c.ListInstanceProfilesRequest(input) - err := req.Send() - return out, err -} - -// ListInstanceProfilesPages iterates over the pages of a ListInstanceProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstanceProfiles 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 ListInstanceProfiles operation. -// pageNum := 0 -// err := client.ListInstanceProfilesPages(params, -// func(page *ListInstanceProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListInstanceProfilesPages(input *ListInstanceProfilesInput, fn func(p *ListInstanceProfilesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstanceProfilesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstanceProfilesOutput), lastPage) - }) -} - -const opListInstanceProfilesForRole = "ListInstanceProfilesForRole" - -// ListInstanceProfilesForRoleRequest generates a "aws/request.Request" representing the -// client's request for the ListInstanceProfilesForRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListInstanceProfilesForRole for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListInstanceProfilesForRole method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListInstanceProfilesForRoleRequest method. -// req, resp := client.ListInstanceProfilesForRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRole -func (c *IAM) ListInstanceProfilesForRoleRequest(input *ListInstanceProfilesForRoleInput) (req *request.Request, output *ListInstanceProfilesForRoleOutput) { - op := &request.Operation{ - Name: opListInstanceProfilesForRole, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListInstanceProfilesForRoleInput{} - } - - output = &ListInstanceProfilesForRoleOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListInstanceProfilesForRole API operation for AWS Identity and Access Management. -// -// Lists the instance profiles that have the specified associated IAM role. -// If there are none, the action returns an empty list. For more information -// about instance profiles, go to About Instance Profiles (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html). -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListInstanceProfilesForRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRole -func (c *IAM) ListInstanceProfilesForRole(input *ListInstanceProfilesForRoleInput) (*ListInstanceProfilesForRoleOutput, error) { - req, out := c.ListInstanceProfilesForRoleRequest(input) - err := req.Send() - return out, err -} - -// ListInstanceProfilesForRolePages iterates over the pages of a ListInstanceProfilesForRole operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstanceProfilesForRole 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 ListInstanceProfilesForRole operation. -// pageNum := 0 -// err := client.ListInstanceProfilesForRolePages(params, -// func(page *ListInstanceProfilesForRoleOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListInstanceProfilesForRolePages(input *ListInstanceProfilesForRoleInput, fn func(p *ListInstanceProfilesForRoleOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListInstanceProfilesForRoleRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListInstanceProfilesForRoleOutput), lastPage) - }) -} - -const opListMFADevices = "ListMFADevices" - -// ListMFADevicesRequest generates a "aws/request.Request" representing the -// client's request for the ListMFADevices operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListMFADevices for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListMFADevices method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListMFADevicesRequest method. -// req, resp := client.ListMFADevicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevices -func (c *IAM) ListMFADevicesRequest(input *ListMFADevicesInput) (req *request.Request, output *ListMFADevicesOutput) { - op := &request.Operation{ - Name: opListMFADevices, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListMFADevicesInput{} - } - - output = &ListMFADevicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMFADevices API operation for AWS Identity and Access Management. -// -// Lists the MFA devices for an IAM user. If the request includes a IAM user -// name, then this action lists all the MFA devices associated with the specified -// user. If you do not specify a user name, IAM determines the user name implicitly -// based on the AWS access key ID signing the request for this API. -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListMFADevices for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevices -func (c *IAM) ListMFADevices(input *ListMFADevicesInput) (*ListMFADevicesOutput, error) { - req, out := c.ListMFADevicesRequest(input) - err := req.Send() - return out, err -} - -// ListMFADevicesPages iterates over the pages of a ListMFADevices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMFADevices 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 ListMFADevices operation. -// pageNum := 0 -// err := client.ListMFADevicesPages(params, -// func(page *ListMFADevicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListMFADevicesPages(input *ListMFADevicesInput, fn func(p *ListMFADevicesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListMFADevicesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListMFADevicesOutput), lastPage) - }) -} - -const opListOpenIDConnectProviders = "ListOpenIDConnectProviders" - -// ListOpenIDConnectProvidersRequest generates a "aws/request.Request" representing the -// client's request for the ListOpenIDConnectProviders operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListOpenIDConnectProviders for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListOpenIDConnectProviders method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListOpenIDConnectProvidersRequest method. -// req, resp := client.ListOpenIDConnectProvidersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProviders -func (c *IAM) ListOpenIDConnectProvidersRequest(input *ListOpenIDConnectProvidersInput) (req *request.Request, output *ListOpenIDConnectProvidersOutput) { - op := &request.Operation{ - Name: opListOpenIDConnectProviders, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListOpenIDConnectProvidersInput{} - } - - output = &ListOpenIDConnectProvidersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOpenIDConnectProviders API operation for AWS Identity and Access Management. -// -// Lists information about the IAM OpenID Connect (OIDC) provider resource objects -// defined in the 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 AWS Identity and Access Management's -// API operation ListOpenIDConnectProviders for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProviders -func (c *IAM) ListOpenIDConnectProviders(input *ListOpenIDConnectProvidersInput) (*ListOpenIDConnectProvidersOutput, error) { - req, out := c.ListOpenIDConnectProvidersRequest(input) - err := req.Send() - return out, err -} - -const opListPolicies = "ListPolicies" - -// ListPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPoliciesRequest method. -// req, resp := client.ListPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicies -func (c *IAM) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Request, output *ListPoliciesOutput) { - op := &request.Operation{ - Name: opListPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListPoliciesInput{} - } - - output = &ListPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPolicies API operation for AWS Identity and Access Management. -// -// Lists all the managed policies that are available in your AWS account, including -// your own customer-defined managed policies and all AWS managed policies. -// -// You can filter the list of policies that is returned using the optional OnlyAttached, -// Scope, and PathPrefix parameters. For example, to list only the customer -// managed policies in your AWS account, set Scope to Local. To list only AWS -// managed policies, set Scope to AWS. -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// For more information about managed policies, see Managed Policies and Inline -// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation ListPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicies -func (c *IAM) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error) { - req, out := c.ListPoliciesRequest(input) - err := req.Send() - return out, err -} - -// ListPoliciesPages iterates over the pages of a ListPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicies 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 ListPolicies operation. -// pageNum := 0 -// err := client.ListPoliciesPages(params, -// func(page *ListPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListPoliciesPages(input *ListPoliciesInput, fn func(p *ListPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPoliciesOutput), lastPage) - }) -} - -const opListPolicyVersions = "ListPolicyVersions" - -// ListPolicyVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListPolicyVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListPolicyVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListPolicyVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPolicyVersionsRequest method. -// req, resp := client.ListPolicyVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersions -func (c *IAM) ListPolicyVersionsRequest(input *ListPolicyVersionsInput) (req *request.Request, output *ListPolicyVersionsOutput) { - op := &request.Operation{ - Name: opListPolicyVersions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListPolicyVersionsInput{} - } - - output = &ListPolicyVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPolicyVersions API operation for AWS Identity and Access Management. -// -// Lists information about the versions of the specified managed policy, including -// the version that is currently set as the policy's default version. -// -// For more information about managed policies, see Managed Policies and Inline -// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation ListPolicyVersions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersions -func (c *IAM) ListPolicyVersions(input *ListPolicyVersionsInput) (*ListPolicyVersionsOutput, error) { - req, out := c.ListPolicyVersionsRequest(input) - err := req.Send() - return out, err -} - -// ListPolicyVersionsPages iterates over the pages of a ListPolicyVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicyVersions 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 ListPolicyVersions operation. -// pageNum := 0 -// err := client.ListPolicyVersionsPages(params, -// func(page *ListPolicyVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListPolicyVersionsPages(input *ListPolicyVersionsInput, fn func(p *ListPolicyVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPolicyVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPolicyVersionsOutput), lastPage) - }) -} - -const opListRolePolicies = "ListRolePolicies" - -// ListRolePoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListRolePolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListRolePolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListRolePolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListRolePoliciesRequest method. -// req, resp := client.ListRolePoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePolicies -func (c *IAM) ListRolePoliciesRequest(input *ListRolePoliciesInput) (req *request.Request, output *ListRolePoliciesOutput) { - op := &request.Operation{ - Name: opListRolePolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListRolePoliciesInput{} - } - - output = &ListRolePoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRolePolicies API operation for AWS Identity and Access Management. -// -// Lists the names of the inline policies that are embedded in the specified -// IAM role. -// -// An IAM role can also have managed policies attached to it. To list the managed -// policies that are attached to a role, use ListAttachedRolePolicies. For more -// information about policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// You can paginate the results using the MaxItems and Marker parameters. If -// there are no inline policies embedded with the specified role, the action -// returns an empty list. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListRolePolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePolicies -func (c *IAM) ListRolePolicies(input *ListRolePoliciesInput) (*ListRolePoliciesOutput, error) { - req, out := c.ListRolePoliciesRequest(input) - err := req.Send() - return out, err -} - -// ListRolePoliciesPages iterates over the pages of a ListRolePolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRolePolicies 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 ListRolePolicies operation. -// pageNum := 0 -// err := client.ListRolePoliciesPages(params, -// func(page *ListRolePoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListRolePoliciesPages(input *ListRolePoliciesInput, fn func(p *ListRolePoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListRolePoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListRolePoliciesOutput), lastPage) - }) -} - -const opListRoles = "ListRoles" - -// ListRolesRequest generates a "aws/request.Request" representing the -// client's request for the ListRoles operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListRoles for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListRoles method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListRolesRequest method. -// req, resp := client.ListRolesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoles -func (c *IAM) ListRolesRequest(input *ListRolesInput) (req *request.Request, output *ListRolesOutput) { - op := &request.Operation{ - Name: opListRoles, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListRolesInput{} - } - - output = &ListRolesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRoles API operation for AWS Identity and Access Management. -// -// Lists the IAM roles that have the specified path prefix. If there are none, -// the action returns an empty list. For more information about roles, go to -// Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListRoles for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoles -func (c *IAM) ListRoles(input *ListRolesInput) (*ListRolesOutput, error) { - req, out := c.ListRolesRequest(input) - err := req.Send() - return out, err -} - -// ListRolesPages iterates over the pages of a ListRoles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRoles 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 ListRoles operation. -// pageNum := 0 -// err := client.ListRolesPages(params, -// func(page *ListRolesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListRolesPages(input *ListRolesInput, fn func(p *ListRolesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListRolesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListRolesOutput), lastPage) - }) -} - -const opListSAMLProviders = "ListSAMLProviders" - -// ListSAMLProvidersRequest generates a "aws/request.Request" representing the -// client's request for the ListSAMLProviders operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSAMLProviders for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSAMLProviders method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSAMLProvidersRequest method. -// req, resp := client.ListSAMLProvidersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProviders -func (c *IAM) ListSAMLProvidersRequest(input *ListSAMLProvidersInput) (req *request.Request, output *ListSAMLProvidersOutput) { - op := &request.Operation{ - Name: opListSAMLProviders, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListSAMLProvidersInput{} - } - - output = &ListSAMLProvidersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSAMLProviders API operation for AWS Identity and Access Management. -// -// Lists the SAML provider resource objects defined in IAM in the account. -// -// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.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 AWS Identity and Access Management's -// API operation ListSAMLProviders for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProviders -func (c *IAM) ListSAMLProviders(input *ListSAMLProvidersInput) (*ListSAMLProvidersOutput, error) { - req, out := c.ListSAMLProvidersRequest(input) - err := req.Send() - return out, err -} - -const opListSSHPublicKeys = "ListSSHPublicKeys" - -// ListSSHPublicKeysRequest generates a "aws/request.Request" representing the -// client's request for the ListSSHPublicKeys operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSSHPublicKeys for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSSHPublicKeys method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSSHPublicKeysRequest method. -// req, resp := client.ListSSHPublicKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSSHPublicKeys -func (c *IAM) ListSSHPublicKeysRequest(input *ListSSHPublicKeysInput) (req *request.Request, output *ListSSHPublicKeysOutput) { - op := &request.Operation{ - Name: opListSSHPublicKeys, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListSSHPublicKeysInput{} - } - - output = &ListSSHPublicKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSSHPublicKeys API operation for AWS Identity and Access Management. -// -// Returns information about the SSH public keys associated with the specified -// IAM user. If there are none, the action returns an empty list. -// -// The SSH public keys returned by this action are used only for authenticating -// the IAM user to an AWS CodeCommit repository. For more information about -// using SSH keys to authenticate to an AWS CodeCommit repository, see Set up -// AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) -// in the AWS CodeCommit User Guide. -// -// Although each user is limited to a small number of keys, you can still paginate -// the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListSSHPublicKeys for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSSHPublicKeys -func (c *IAM) ListSSHPublicKeys(input *ListSSHPublicKeysInput) (*ListSSHPublicKeysOutput, error) { - req, out := c.ListSSHPublicKeysRequest(input) - err := req.Send() - return out, err -} - -// ListSSHPublicKeysPages iterates over the pages of a ListSSHPublicKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSSHPublicKeys 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 ListSSHPublicKeys operation. -// pageNum := 0 -// err := client.ListSSHPublicKeysPages(params, -// func(page *ListSSHPublicKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListSSHPublicKeysPages(input *ListSSHPublicKeysInput, fn func(p *ListSSHPublicKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListSSHPublicKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListSSHPublicKeysOutput), lastPage) - }) -} - -const opListServerCertificates = "ListServerCertificates" - -// ListServerCertificatesRequest generates a "aws/request.Request" representing the -// client's request for the ListServerCertificates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListServerCertificates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListServerCertificates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListServerCertificatesRequest method. -// req, resp := client.ListServerCertificatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServerCertificates -func (c *IAM) ListServerCertificatesRequest(input *ListServerCertificatesInput) (req *request.Request, output *ListServerCertificatesOutput) { - op := &request.Operation{ - Name: opListServerCertificates, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListServerCertificatesInput{} - } - - output = &ListServerCertificatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServerCertificates API operation for AWS Identity and Access Management. -// -// Lists the server certificates stored in IAM that have the specified path -// prefix. If none exist, the action returns an empty list. -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// For more information about working with server certificates, including a -// list of AWS services that can use the server certificates that you manage -// with IAM, go to Working with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation ListServerCertificates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServerCertificates -func (c *IAM) ListServerCertificates(input *ListServerCertificatesInput) (*ListServerCertificatesOutput, error) { - req, out := c.ListServerCertificatesRequest(input) - err := req.Send() - return out, err -} - -// ListServerCertificatesPages iterates over the pages of a ListServerCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServerCertificates 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 ListServerCertificates operation. -// pageNum := 0 -// err := client.ListServerCertificatesPages(params, -// func(page *ListServerCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListServerCertificatesPages(input *ListServerCertificatesInput, fn func(p *ListServerCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListServerCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListServerCertificatesOutput), lastPage) - }) -} - -const opListServiceSpecificCredentials = "ListServiceSpecificCredentials" - -// ListServiceSpecificCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the ListServiceSpecificCredentials operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListServiceSpecificCredentials for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListServiceSpecificCredentials method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListServiceSpecificCredentialsRequest method. -// req, resp := client.ListServiceSpecificCredentialsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServiceSpecificCredentials -func (c *IAM) ListServiceSpecificCredentialsRequest(input *ListServiceSpecificCredentialsInput) (req *request.Request, output *ListServiceSpecificCredentialsOutput) { - op := &request.Operation{ - Name: opListServiceSpecificCredentials, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListServiceSpecificCredentialsInput{} - } - - output = &ListServiceSpecificCredentialsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServiceSpecificCredentials API operation for AWS Identity and Access Management. -// -// Returns information about the service-specific credentials associated with -// the specified IAM user. If there are none, the action returns an empty list. -// The service-specific credentials returned by this action are used only for -// authenticating the IAM user to a specific service. For more information about -// using service-specific credentials to authenticate to an AWS service, see -// Set Up service-specific credentials (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html) -// in the AWS CodeCommit 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 AWS Identity and Access Management's -// API operation ListServiceSpecificCredentials for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceNotSupportedException "NotSupportedService" -// The specified service does not support service-specific credentials. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServiceSpecificCredentials -func (c *IAM) ListServiceSpecificCredentials(input *ListServiceSpecificCredentialsInput) (*ListServiceSpecificCredentialsOutput, error) { - req, out := c.ListServiceSpecificCredentialsRequest(input) - err := req.Send() - return out, err -} - -const opListSigningCertificates = "ListSigningCertificates" - -// ListSigningCertificatesRequest generates a "aws/request.Request" representing the -// client's request for the ListSigningCertificates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSigningCertificates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSigningCertificates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSigningCertificatesRequest method. -// req, resp := client.ListSigningCertificatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSigningCertificates -func (c *IAM) ListSigningCertificatesRequest(input *ListSigningCertificatesInput) (req *request.Request, output *ListSigningCertificatesOutput) { - op := &request.Operation{ - Name: opListSigningCertificates, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListSigningCertificatesInput{} - } - - output = &ListSigningCertificatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSigningCertificates API operation for AWS Identity and Access Management. -// -// Returns information about the signing certificates associated with the specified -// IAM user. If there are none, the action returns an empty list. -// -// Although each user is limited to a small number of signing certificates, -// you can still paginate the results using the MaxItems and Marker parameters. -// -// If the UserName field is not specified, the user name is determined implicitly -// based on the AWS access key ID used to sign the request for this API. Because -// this action works for access keys under the AWS account, you can use this -// action to manage root credentials even if the AWS account has no associated -// users. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListSigningCertificates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSigningCertificates -func (c *IAM) ListSigningCertificates(input *ListSigningCertificatesInput) (*ListSigningCertificatesOutput, error) { - req, out := c.ListSigningCertificatesRequest(input) - err := req.Send() - return out, err -} - -// ListSigningCertificatesPages iterates over the pages of a ListSigningCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSigningCertificates 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 ListSigningCertificates operation. -// pageNum := 0 -// err := client.ListSigningCertificatesPages(params, -// func(page *ListSigningCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListSigningCertificatesPages(input *ListSigningCertificatesInput, fn func(p *ListSigningCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListSigningCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListSigningCertificatesOutput), lastPage) - }) -} - -const opListUserPolicies = "ListUserPolicies" - -// ListUserPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListUserPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListUserPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListUserPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListUserPoliciesRequest method. -// req, resp := client.ListUserPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUserPolicies -func (c *IAM) ListUserPoliciesRequest(input *ListUserPoliciesInput) (req *request.Request, output *ListUserPoliciesOutput) { - op := &request.Operation{ - Name: opListUserPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListUserPoliciesInput{} - } - - output = &ListUserPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListUserPolicies API operation for AWS Identity and Access Management. -// -// Lists the names of the inline policies embedded in the specified IAM user. -// -// An IAM user can also have managed policies attached to it. To list the managed -// policies that are attached to a user, use ListAttachedUserPolicies. For more -// information about policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// You can paginate the results using the MaxItems and Marker parameters. If -// there are no inline policies embedded with the specified user, the action -// returns an empty list. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListUserPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUserPolicies -func (c *IAM) ListUserPolicies(input *ListUserPoliciesInput) (*ListUserPoliciesOutput, error) { - req, out := c.ListUserPoliciesRequest(input) - err := req.Send() - return out, err -} - -// ListUserPoliciesPages iterates over the pages of a ListUserPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUserPolicies 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 ListUserPolicies operation. -// pageNum := 0 -// err := client.ListUserPoliciesPages(params, -// func(page *ListUserPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListUserPoliciesPages(input *ListUserPoliciesInput, fn func(p *ListUserPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListUserPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListUserPoliciesOutput), lastPage) - }) -} - -const opListUsers = "ListUsers" - -// ListUsersRequest generates a "aws/request.Request" representing the -// client's request for the ListUsers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListUsers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListUsers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListUsersRequest method. -// req, resp := client.ListUsersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUsers -func (c *IAM) ListUsersRequest(input *ListUsersInput) (req *request.Request, output *ListUsersOutput) { - op := &request.Operation{ - Name: opListUsers, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListUsersInput{} - } - - output = &ListUsersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListUsers API operation for AWS Identity and Access Management. -// -// Lists the IAM users that have the specified path prefix. If no path prefix -// is specified, the action returns all users in the AWS account. If there are -// none, the action returns an empty list. -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListUsers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUsers -func (c *IAM) ListUsers(input *ListUsersInput) (*ListUsersOutput, error) { - req, out := c.ListUsersRequest(input) - err := req.Send() - return out, err -} - -// ListUsersPages iterates over the pages of a ListUsers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUsers 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 ListUsers operation. -// pageNum := 0 -// err := client.ListUsersPages(params, -// func(page *ListUsersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListUsersPages(input *ListUsersInput, fn func(p *ListUsersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListUsersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListUsersOutput), lastPage) - }) -} - -const opListVirtualMFADevices = "ListVirtualMFADevices" - -// ListVirtualMFADevicesRequest generates a "aws/request.Request" representing the -// client's request for the ListVirtualMFADevices operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListVirtualMFADevices for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListVirtualMFADevices method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListVirtualMFADevicesRequest method. -// req, resp := client.ListVirtualMFADevicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListVirtualMFADevices -func (c *IAM) ListVirtualMFADevicesRequest(input *ListVirtualMFADevicesInput) (req *request.Request, output *ListVirtualMFADevicesOutput) { - op := &request.Operation{ - Name: opListVirtualMFADevices, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListVirtualMFADevicesInput{} - } - - output = &ListVirtualMFADevicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVirtualMFADevices API operation for AWS Identity and Access Management. -// -// Lists the virtual MFA devices defined in the AWS account by assignment status. -// If you do not specify an assignment status, the action returns a list of -// all virtual MFA devices. Assignment status can be Assigned, Unassigned, or -// Any. -// -// You can paginate the results using the MaxItems and Marker parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ListVirtualMFADevices for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListVirtualMFADevices -func (c *IAM) ListVirtualMFADevices(input *ListVirtualMFADevicesInput) (*ListVirtualMFADevicesOutput, error) { - req, out := c.ListVirtualMFADevicesRequest(input) - err := req.Send() - return out, err -} - -// ListVirtualMFADevicesPages iterates over the pages of a ListVirtualMFADevices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVirtualMFADevices 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 ListVirtualMFADevices operation. -// pageNum := 0 -// err := client.ListVirtualMFADevicesPages(params, -// func(page *ListVirtualMFADevicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) ListVirtualMFADevicesPages(input *ListVirtualMFADevicesInput, fn func(p *ListVirtualMFADevicesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListVirtualMFADevicesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListVirtualMFADevicesOutput), lastPage) - }) -} - -const opPutGroupPolicy = "PutGroupPolicy" - -// PutGroupPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutGroupPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutGroupPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutGroupPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutGroupPolicyRequest method. -// req, resp := client.PutGroupPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutGroupPolicy -func (c *IAM) PutGroupPolicyRequest(input *PutGroupPolicyInput) (req *request.Request, output *PutGroupPolicyOutput) { - op := &request.Operation{ - Name: opPutGroupPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutGroupPolicyInput{} - } - - output = &PutGroupPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutGroupPolicy API operation for AWS Identity and Access Management. -// -// Adds or updates an inline policy document that is embedded in the specified -// IAM group. -// -// A user can also have managed policies attached to it. To attach a managed -// policy to a group, use AttachGroupPolicy. To create a new managed policy, -// use CreatePolicy. For information about policies, see Managed Policies and -// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// For information about limits on the number of inline policies that you can -// embed in a group, see Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// in the IAM User Guide. -// -// Because policy documents can be large, you should use POST rather than GET -// when calling PutGroupPolicy. For general information about using the Query -// API with IAM, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation PutGroupPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutGroupPolicy -func (c *IAM) PutGroupPolicy(input *PutGroupPolicyInput) (*PutGroupPolicyOutput, error) { - req, out := c.PutGroupPolicyRequest(input) - err := req.Send() - return out, err -} - -const opPutRolePolicy = "PutRolePolicy" - -// PutRolePolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutRolePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutRolePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutRolePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutRolePolicyRequest method. -// req, resp := client.PutRolePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePolicy -func (c *IAM) PutRolePolicyRequest(input *PutRolePolicyInput) (req *request.Request, output *PutRolePolicyOutput) { - op := &request.Operation{ - Name: opPutRolePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutRolePolicyInput{} - } - - output = &PutRolePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutRolePolicy API operation for AWS Identity and Access Management. -// -// Adds or updates an inline policy document that is embedded in the specified -// IAM role. -// -// When you embed an inline policy in a role, the inline policy is used as part -// of the role's access (permissions) policy. The role's trust policy is created -// at the same time as the role, using CreateRole. You can update a role's trust -// policy using UpdateAssumeRolePolicy. For more information about IAM roles, -// go to Using Roles to Delegate Permissions and Federate Identities (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html). -// -// A role can also have a managed policy attached to it. To attach a managed -// policy to a role, use AttachRolePolicy. To create a new managed policy, use -// CreatePolicy. For information about policies, see Managed Policies and Inline -// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// For information about limits on the number of inline policies that you can -// embed with a role, see Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// in the IAM User Guide. -// -// Because policy documents can be large, you should use POST rather than GET -// when calling PutRolePolicy. For general information about using the Query -// API with IAM, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation PutRolePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePolicy -func (c *IAM) PutRolePolicy(input *PutRolePolicyInput) (*PutRolePolicyOutput, error) { - req, out := c.PutRolePolicyRequest(input) - err := req.Send() - return out, err -} - -const opPutUserPolicy = "PutUserPolicy" - -// PutUserPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutUserPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutUserPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutUserPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutUserPolicyRequest method. -// req, resp := client.PutUserPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPolicy -func (c *IAM) PutUserPolicyRequest(input *PutUserPolicyInput) (req *request.Request, output *PutUserPolicyOutput) { - op := &request.Operation{ - Name: opPutUserPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutUserPolicyInput{} - } - - output = &PutUserPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutUserPolicy API operation for AWS Identity and Access Management. -// -// Adds or updates an inline policy document that is embedded in the specified -// IAM user. -// -// An IAM user can also have a managed policy attached to it. To attach a managed -// policy to a user, use AttachUserPolicy. To create a new managed policy, use -// CreatePolicy. For information about policies, see Managed Policies and Inline -// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the IAM User Guide. -// -// For information about limits on the number of inline policies that you can -// embed in a user, see Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) -// in the IAM User Guide. -// -// Because policy documents can be large, you should use POST rather than GET -// when calling PutUserPolicy. For general information about using the Query -// API with IAM, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation PutUserPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPolicy -func (c *IAM) PutUserPolicy(input *PutUserPolicyInput) (*PutUserPolicyOutput, error) { - req, out := c.PutUserPolicyRequest(input) - err := req.Send() - return out, err -} - -const opRemoveClientIDFromOpenIDConnectProvider = "RemoveClientIDFromOpenIDConnectProvider" - -// RemoveClientIDFromOpenIDConnectProviderRequest generates a "aws/request.Request" representing the -// client's request for the RemoveClientIDFromOpenIDConnectProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveClientIDFromOpenIDConnectProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveClientIDFromOpenIDConnectProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveClientIDFromOpenIDConnectProviderRequest method. -// req, resp := client.RemoveClientIDFromOpenIDConnectProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveClientIDFromOpenIDConnectProvider -func (c *IAM) RemoveClientIDFromOpenIDConnectProviderRequest(input *RemoveClientIDFromOpenIDConnectProviderInput) (req *request.Request, output *RemoveClientIDFromOpenIDConnectProviderOutput) { - op := &request.Operation{ - Name: opRemoveClientIDFromOpenIDConnectProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveClientIDFromOpenIDConnectProviderInput{} - } - - output = &RemoveClientIDFromOpenIDConnectProviderOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveClientIDFromOpenIDConnectProvider API operation for AWS Identity and Access Management. -// -// Removes the specified client ID (also known as audience) from the list of -// client IDs registered for the specified IAM OpenID Connect (OIDC) provider -// resource object. -// -// This action is idempotent; it does not fail or return an error if you try -// to remove a client ID that does not 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 Identity and Access Management's -// API operation RemoveClientIDFromOpenIDConnectProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveClientIDFromOpenIDConnectProvider -func (c *IAM) RemoveClientIDFromOpenIDConnectProvider(input *RemoveClientIDFromOpenIDConnectProviderInput) (*RemoveClientIDFromOpenIDConnectProviderOutput, error) { - req, out := c.RemoveClientIDFromOpenIDConnectProviderRequest(input) - err := req.Send() - return out, err -} - -const opRemoveRoleFromInstanceProfile = "RemoveRoleFromInstanceProfile" - -// RemoveRoleFromInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the RemoveRoleFromInstanceProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveRoleFromInstanceProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveRoleFromInstanceProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveRoleFromInstanceProfileRequest method. -// req, resp := client.RemoveRoleFromInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveRoleFromInstanceProfile -func (c *IAM) RemoveRoleFromInstanceProfileRequest(input *RemoveRoleFromInstanceProfileInput) (req *request.Request, output *RemoveRoleFromInstanceProfileOutput) { - op := &request.Operation{ - Name: opRemoveRoleFromInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveRoleFromInstanceProfileInput{} - } - - output = &RemoveRoleFromInstanceProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveRoleFromInstanceProfile API operation for AWS Identity and Access Management. -// -// Removes the specified IAM role from the specified EC2 instance profile. -// -// Make sure you do not have any Amazon EC2 instances running with the role -// you are about to remove from the instance profile. Removing a role from an -// instance profile that is associated with a running instance break any applications -// running on the instance. -// -// For more information about IAM roles, go to Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). -// For more information about instance profiles, go to About Instance Profiles -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.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 AWS Identity and Access Management's -// API operation RemoveRoleFromInstanceProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveRoleFromInstanceProfile -func (c *IAM) RemoveRoleFromInstanceProfile(input *RemoveRoleFromInstanceProfileInput) (*RemoveRoleFromInstanceProfileOutput, error) { - req, out := c.RemoveRoleFromInstanceProfileRequest(input) - err := req.Send() - return out, err -} - -const opRemoveUserFromGroup = "RemoveUserFromGroup" - -// RemoveUserFromGroupRequest generates a "aws/request.Request" representing the -// client's request for the RemoveUserFromGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveUserFromGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveUserFromGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveUserFromGroupRequest method. -// req, resp := client.RemoveUserFromGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveUserFromGroup -func (c *IAM) RemoveUserFromGroupRequest(input *RemoveUserFromGroupInput) (req *request.Request, output *RemoveUserFromGroupOutput) { - op := &request.Operation{ - Name: opRemoveUserFromGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveUserFromGroupInput{} - } - - output = &RemoveUserFromGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveUserFromGroup API operation for AWS Identity and Access Management. -// -// Removes the specified user from the specified group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation RemoveUserFromGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveUserFromGroup -func (c *IAM) RemoveUserFromGroup(input *RemoveUserFromGroupInput) (*RemoveUserFromGroupOutput, error) { - req, out := c.RemoveUserFromGroupRequest(input) - err := req.Send() - return out, err -} - -const opResetServiceSpecificCredential = "ResetServiceSpecificCredential" - -// ResetServiceSpecificCredentialRequest generates a "aws/request.Request" representing the -// client's request for the ResetServiceSpecificCredential operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetServiceSpecificCredential for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetServiceSpecificCredential method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetServiceSpecificCredentialRequest method. -// req, resp := client.ResetServiceSpecificCredentialRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResetServiceSpecificCredential -func (c *IAM) ResetServiceSpecificCredentialRequest(input *ResetServiceSpecificCredentialInput) (req *request.Request, output *ResetServiceSpecificCredentialOutput) { - op := &request.Operation{ - Name: opResetServiceSpecificCredential, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetServiceSpecificCredentialInput{} - } - - output = &ResetServiceSpecificCredentialOutput{} - req = c.newRequest(op, input, output) - return -} - -// ResetServiceSpecificCredential API operation for AWS Identity and Access Management. -// -// Resets the password for a service-specific credential. The new password is -// AWS generated and cryptographically strong. It cannot be configured by the -// user. Resetting the password immediately invalidates the previous password -// associated with this user. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation ResetServiceSpecificCredential for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResetServiceSpecificCredential -func (c *IAM) ResetServiceSpecificCredential(input *ResetServiceSpecificCredentialInput) (*ResetServiceSpecificCredentialOutput, error) { - req, out := c.ResetServiceSpecificCredentialRequest(input) - err := req.Send() - return out, err -} - -const opResyncMFADevice = "ResyncMFADevice" - -// ResyncMFADeviceRequest generates a "aws/request.Request" representing the -// client's request for the ResyncMFADevice operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResyncMFADevice for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResyncMFADevice method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResyncMFADeviceRequest method. -// req, resp := client.ResyncMFADeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResyncMFADevice -func (c *IAM) ResyncMFADeviceRequest(input *ResyncMFADeviceInput) (req *request.Request, output *ResyncMFADeviceOutput) { - op := &request.Operation{ - Name: opResyncMFADevice, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResyncMFADeviceInput{} - } - - output = &ResyncMFADeviceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResyncMFADevice API operation for AWS Identity and Access Management. -// -// Synchronizes the specified MFA device with its IAM resource object on the -// AWS servers. -// -// For more information about creating and working with virtual MFA devices, -// go to Using a Virtual MFA Device (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation ResyncMFADevice for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidAuthenticationCodeException "InvalidAuthenticationCode" -// The request was rejected because the authentication code was not recognized. -// The error message describes the specific error. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResyncMFADevice -func (c *IAM) ResyncMFADevice(input *ResyncMFADeviceInput) (*ResyncMFADeviceOutput, error) { - req, out := c.ResyncMFADeviceRequest(input) - err := req.Send() - return out, err -} - -const opSetDefaultPolicyVersion = "SetDefaultPolicyVersion" - -// SetDefaultPolicyVersionRequest generates a "aws/request.Request" representing the -// client's request for the SetDefaultPolicyVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetDefaultPolicyVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetDefaultPolicyVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetDefaultPolicyVersionRequest method. -// req, resp := client.SetDefaultPolicyVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SetDefaultPolicyVersion -func (c *IAM) SetDefaultPolicyVersionRequest(input *SetDefaultPolicyVersionInput) (req *request.Request, output *SetDefaultPolicyVersionOutput) { - op := &request.Operation{ - Name: opSetDefaultPolicyVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetDefaultPolicyVersionInput{} - } - - output = &SetDefaultPolicyVersionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetDefaultPolicyVersion API operation for AWS Identity and Access Management. -// -// Sets the specified version of the specified policy as the policy's default -// (operative) version. -// -// This action affects all users, groups, and roles that the policy is attached -// to. To list the users, groups, and roles that the policy is attached to, -// use the ListEntitiesForPolicy API. -// -// For information about managed policies, see Managed Policies and Inline Policies -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation SetDefaultPolicyVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SetDefaultPolicyVersion -func (c *IAM) SetDefaultPolicyVersion(input *SetDefaultPolicyVersionInput) (*SetDefaultPolicyVersionOutput, error) { - req, out := c.SetDefaultPolicyVersionRequest(input) - err := req.Send() - return out, err -} - -const opSimulateCustomPolicy = "SimulateCustomPolicy" - -// SimulateCustomPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SimulateCustomPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SimulateCustomPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SimulateCustomPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SimulateCustomPolicyRequest method. -// req, resp := client.SimulateCustomPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulateCustomPolicy -func (c *IAM) SimulateCustomPolicyRequest(input *SimulateCustomPolicyInput) (req *request.Request, output *SimulatePolicyResponse) { - op := &request.Operation{ - Name: opSimulateCustomPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &SimulateCustomPolicyInput{} - } - - output = &SimulatePolicyResponse{} - req = c.newRequest(op, input, output) - return -} - -// SimulateCustomPolicy API operation for AWS Identity and Access Management. -// -// Simulate how a set of IAM policies and optionally a resource-based policy -// works with a list of API actions and AWS resources to determine the policies' -// effective permissions. The policies are provided as strings. -// -// The simulation does not perform the API actions; it only checks the authorization -// to determine if the simulated policies allow or deny the actions. -// -// If you want to simulate existing policies attached to an IAM user, group, -// or role, use SimulatePrincipalPolicy instead. -// -// Context keys are variables maintained by AWS and its services that provide -// details about the context of an API query request. You can use the Condition -// element of an IAM policy to evaluate context keys. To get the list of context -// keys that the policies require for correct simulation, use GetContextKeysForCustomPolicy. -// -// If the output is long, you can use MaxItems and Marker parameters to paginate -// the results. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation SimulateCustomPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodePolicyEvaluationException "PolicyEvaluation" -// The request failed because a provided policy could not be successfully evaluated. -// An additional detail message indicates the source of the failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulateCustomPolicy -func (c *IAM) SimulateCustomPolicy(input *SimulateCustomPolicyInput) (*SimulatePolicyResponse, error) { - req, out := c.SimulateCustomPolicyRequest(input) - err := req.Send() - return out, err -} - -// SimulateCustomPolicyPages iterates over the pages of a SimulateCustomPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SimulateCustomPolicy 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 SimulateCustomPolicy operation. -// pageNum := 0 -// err := client.SimulateCustomPolicyPages(params, -// func(page *SimulatePolicyResponse, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) SimulateCustomPolicyPages(input *SimulateCustomPolicyInput, fn func(p *SimulatePolicyResponse, lastPage bool) (shouldContinue bool)) error { - page, _ := c.SimulateCustomPolicyRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*SimulatePolicyResponse), lastPage) - }) -} - -const opSimulatePrincipalPolicy = "SimulatePrincipalPolicy" - -// SimulatePrincipalPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SimulatePrincipalPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SimulatePrincipalPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SimulatePrincipalPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SimulatePrincipalPolicyRequest method. -// req, resp := client.SimulatePrincipalPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulatePrincipalPolicy -func (c *IAM) SimulatePrincipalPolicyRequest(input *SimulatePrincipalPolicyInput) (req *request.Request, output *SimulatePolicyResponse) { - op := &request.Operation{ - Name: opSimulatePrincipalPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &SimulatePrincipalPolicyInput{} - } - - output = &SimulatePolicyResponse{} - req = c.newRequest(op, input, output) - return -} - -// SimulatePrincipalPolicy API operation for AWS Identity and Access Management. -// -// Simulate how a set of IAM policies attached to an IAM entity works with a -// list of API actions and AWS resources to determine the policies' effective -// permissions. The entity can be an IAM user, group, or role. If you specify -// a user, then the simulation also includes all of the policies that are attached -// to groups that the user belongs to . -// -// You can optionally include a list of one or more additional policies specified -// as strings to include in the simulation. If you want to simulate only policies -// specified as strings, use SimulateCustomPolicy instead. -// -// You can also optionally include one resource-based policy to be evaluated -// with each of the resources included in the simulation. -// -// The simulation does not perform the API actions, it only checks the authorization -// to determine if the simulated policies allow or deny the actions. -// -// Note: This API discloses information about the permissions granted to other -// users. If you do not want users to see other user's permissions, then consider -// allowing them to use SimulateCustomPolicy instead. -// -// Context keys are variables maintained by AWS and its services that provide -// details about the context of an API query request. You can use the Condition -// element of an IAM policy to evaluate context keys. To get the list of context -// keys that the policies require for correct simulation, use GetContextKeysForPrincipalPolicy. -// -// If the output is long, you can use the MaxItems and Marker parameters to -// paginate the results. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation SimulatePrincipalPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodePolicyEvaluationException "PolicyEvaluation" -// The request failed because a provided policy could not be successfully evaluated. -// An additional detail message indicates the source of the failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulatePrincipalPolicy -func (c *IAM) SimulatePrincipalPolicy(input *SimulatePrincipalPolicyInput) (*SimulatePolicyResponse, error) { - req, out := c.SimulatePrincipalPolicyRequest(input) - err := req.Send() - return out, err -} - -// SimulatePrincipalPolicyPages iterates over the pages of a SimulatePrincipalPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SimulatePrincipalPolicy 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 SimulatePrincipalPolicy operation. -// pageNum := 0 -// err := client.SimulatePrincipalPolicyPages(params, -// func(page *SimulatePolicyResponse, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *IAM) SimulatePrincipalPolicyPages(input *SimulatePrincipalPolicyInput, fn func(p *SimulatePolicyResponse, lastPage bool) (shouldContinue bool)) error { - page, _ := c.SimulatePrincipalPolicyRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*SimulatePolicyResponse), lastPage) - }) -} - -const opUpdateAccessKey = "UpdateAccessKey" - -// UpdateAccessKeyRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAccessKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAccessKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAccessKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAccessKeyRequest method. -// req, resp := client.UpdateAccessKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccessKey -func (c *IAM) UpdateAccessKeyRequest(input *UpdateAccessKeyInput) (req *request.Request, output *UpdateAccessKeyOutput) { - op := &request.Operation{ - Name: opUpdateAccessKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAccessKeyInput{} - } - - output = &UpdateAccessKeyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateAccessKey API operation for AWS Identity and Access Management. -// -// Changes the status of the specified access key from Active to Inactive, or -// vice versa. This action can be used to disable a user's key as part of a -// key rotation work flow. -// -// If the UserName field is not specified, the UserName is determined implicitly -// based on the AWS access key ID used to sign the request. Because this action -// works for access keys under the AWS account, you can use this action to manage -// root credentials even if the AWS account has no associated users. -// -// For information about rotating keys, see Managing Keys and Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingCredentials.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation UpdateAccessKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccessKey -func (c *IAM) UpdateAccessKey(input *UpdateAccessKeyInput) (*UpdateAccessKeyOutput, error) { - req, out := c.UpdateAccessKeyRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAccountPasswordPolicy = "UpdateAccountPasswordPolicy" - -// UpdateAccountPasswordPolicyRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAccountPasswordPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAccountPasswordPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAccountPasswordPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAccountPasswordPolicyRequest method. -// req, resp := client.UpdateAccountPasswordPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccountPasswordPolicy -func (c *IAM) UpdateAccountPasswordPolicyRequest(input *UpdateAccountPasswordPolicyInput) (req *request.Request, output *UpdateAccountPasswordPolicyOutput) { - op := &request.Operation{ - Name: opUpdateAccountPasswordPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAccountPasswordPolicyInput{} - } - - output = &UpdateAccountPasswordPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateAccountPasswordPolicy API operation for AWS Identity and Access Management. -// -// Updates the password policy settings for the AWS account. -// -// This action does not support partial updates. No parameters are required, -// but if you do not specify a parameter, that parameter's value reverts to -// its default value. See the Request Parameters section for each parameter's -// default value. -// -// For more information about using a password policy, see Managing an IAM Password -// Policy (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation UpdateAccountPasswordPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccountPasswordPolicy -func (c *IAM) UpdateAccountPasswordPolicy(input *UpdateAccountPasswordPolicyInput) (*UpdateAccountPasswordPolicyOutput, error) { - req, out := c.UpdateAccountPasswordPolicyRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAssumeRolePolicy = "UpdateAssumeRolePolicy" - -// UpdateAssumeRolePolicyRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAssumeRolePolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAssumeRolePolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAssumeRolePolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAssumeRolePolicyRequest method. -// req, resp := client.UpdateAssumeRolePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAssumeRolePolicy -func (c *IAM) UpdateAssumeRolePolicyRequest(input *UpdateAssumeRolePolicyInput) (req *request.Request, output *UpdateAssumeRolePolicyOutput) { - op := &request.Operation{ - Name: opUpdateAssumeRolePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAssumeRolePolicyInput{} - } - - output = &UpdateAssumeRolePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateAssumeRolePolicy API operation for AWS Identity and Access Management. -// -// Updates the policy that grants an IAM entity permission to assume a role. -// This is typically referred to as the "role trust policy". For more information -// about roles, go to Using Roles to Delegate Permissions and Federate Identities -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.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 AWS Identity and Access Management's -// API operation UpdateAssumeRolePolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAssumeRolePolicy -func (c *IAM) UpdateAssumeRolePolicy(input *UpdateAssumeRolePolicyInput) (*UpdateAssumeRolePolicyOutput, error) { - req, out := c.UpdateAssumeRolePolicyRequest(input) - err := req.Send() - return out, err -} - -const opUpdateGroup = "UpdateGroup" - -// UpdateGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateGroupRequest method. -// req, resp := client.UpdateGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateGroup -func (c *IAM) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, output *UpdateGroupOutput) { - op := &request.Operation{ - Name: opUpdateGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateGroupInput{} - } - - output = &UpdateGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateGroup API operation for AWS Identity and Access Management. -// -// Updates the name and/or the path of the specified IAM group. -// -// You should understand the implications of changing a group's path or name. -// For more information, see Renaming Users and Groups (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_WorkingWithGroupsAndUsers.html) -// in the IAM User Guide. -// -// To change an IAM group name the requester must have appropriate permissions -// on both the source object and the target object. For example, to change "Managers" -// to "MGRs", the entity making the request must have permission on both "Managers" -// and "MGRs", or must have permission on all (*). For more information about -// permissions, see Permissions and Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PermissionsAndPolicies.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 AWS Identity and Access Management's -// API operation UpdateGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateGroup -func (c *IAM) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) { - req, out := c.UpdateGroupRequest(input) - err := req.Send() - return out, err -} - -const opUpdateLoginProfile = "UpdateLoginProfile" - -// UpdateLoginProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateLoginProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateLoginProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateLoginProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateLoginProfileRequest method. -// req, resp := client.UpdateLoginProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateLoginProfile -func (c *IAM) UpdateLoginProfileRequest(input *UpdateLoginProfileInput) (req *request.Request, output *UpdateLoginProfileOutput) { - op := &request.Operation{ - Name: opUpdateLoginProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateLoginProfileInput{} - } - - output = &UpdateLoginProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateLoginProfile API operation for AWS Identity and Access Management. -// -// Changes the password for the specified IAM user. -// -// IAM users can change their own passwords by calling ChangePassword. For more -// information about modifying passwords, see Managing Passwords (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation UpdateLoginProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" -// The request was rejected because it referenced an entity that is temporarily -// unmodifiable, such as a user name that was deleted and then recreated. The -// error indicates that the request is likely to succeed if you try again after -// waiting several minutes. The error message describes the entity. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodePasswordPolicyViolationException "PasswordPolicyViolation" -// The request was rejected because the provided password did not meet the requirements -// imposed by the account password policy. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateLoginProfile -func (c *IAM) UpdateLoginProfile(input *UpdateLoginProfileInput) (*UpdateLoginProfileOutput, error) { - req, out := c.UpdateLoginProfileRequest(input) - err := req.Send() - return out, err -} - -const opUpdateOpenIDConnectProviderThumbprint = "UpdateOpenIDConnectProviderThumbprint" - -// UpdateOpenIDConnectProviderThumbprintRequest generates a "aws/request.Request" representing the -// client's request for the UpdateOpenIDConnectProviderThumbprint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateOpenIDConnectProviderThumbprint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateOpenIDConnectProviderThumbprint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateOpenIDConnectProviderThumbprintRequest method. -// req, resp := client.UpdateOpenIDConnectProviderThumbprintRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateOpenIDConnectProviderThumbprint -func (c *IAM) UpdateOpenIDConnectProviderThumbprintRequest(input *UpdateOpenIDConnectProviderThumbprintInput) (req *request.Request, output *UpdateOpenIDConnectProviderThumbprintOutput) { - op := &request.Operation{ - Name: opUpdateOpenIDConnectProviderThumbprint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateOpenIDConnectProviderThumbprintInput{} - } - - output = &UpdateOpenIDConnectProviderThumbprintOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateOpenIDConnectProviderThumbprint API operation for AWS Identity and Access Management. -// -// Replaces the existing list of server certificate thumbprints associated with -// an OpenID Connect (OIDC) provider resource object with a new list of thumbprints. -// -// The list that you pass with this action completely replaces the existing -// list of thumbprints. (The lists are not merged.) -// -// Typically, you need to update a thumbprint only when the identity provider's -// certificate changes, which occurs rarely. However, if the provider's certificate -// does change, any attempt to assume an IAM role that specifies the OIDC provider -// as a principal fails until the certificate thumbprint is updated. -// -// Because trust for the OIDC provider is ultimately derived from the provider's -// certificate and is validated by the thumbprint, it is a best practice to -// limit access to the UpdateOpenIDConnectProviderThumbprint action to highly-privileged -// users. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation UpdateOpenIDConnectProviderThumbprint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateOpenIDConnectProviderThumbprint -func (c *IAM) UpdateOpenIDConnectProviderThumbprint(input *UpdateOpenIDConnectProviderThumbprintInput) (*UpdateOpenIDConnectProviderThumbprintOutput, error) { - req, out := c.UpdateOpenIDConnectProviderThumbprintRequest(input) - err := req.Send() - return out, err -} - -const opUpdateSAMLProvider = "UpdateSAMLProvider" - -// UpdateSAMLProviderRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSAMLProvider operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateSAMLProvider for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateSAMLProvider method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateSAMLProviderRequest method. -// req, resp := client.UpdateSAMLProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSAMLProvider -func (c *IAM) UpdateSAMLProviderRequest(input *UpdateSAMLProviderInput) (req *request.Request, output *UpdateSAMLProviderOutput) { - op := &request.Operation{ - Name: opUpdateSAMLProvider, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSAMLProviderInput{} - } - - output = &UpdateSAMLProviderOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSAMLProvider API operation for AWS Identity and Access Management. -// -// Updates the metadata document for an existing SAML provider resource object. -// -// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.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 AWS Identity and Access Management's -// API operation UpdateSAMLProvider for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidInputException "InvalidInput" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSAMLProvider -func (c *IAM) UpdateSAMLProvider(input *UpdateSAMLProviderInput) (*UpdateSAMLProviderOutput, error) { - req, out := c.UpdateSAMLProviderRequest(input) - err := req.Send() - return out, err -} - -const opUpdateSSHPublicKey = "UpdateSSHPublicKey" - -// UpdateSSHPublicKeyRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSSHPublicKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateSSHPublicKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateSSHPublicKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateSSHPublicKeyRequest method. -// req, resp := client.UpdateSSHPublicKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSSHPublicKey -func (c *IAM) UpdateSSHPublicKeyRequest(input *UpdateSSHPublicKeyInput) (req *request.Request, output *UpdateSSHPublicKeyOutput) { - op := &request.Operation{ - Name: opUpdateSSHPublicKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSSHPublicKeyInput{} - } - - output = &UpdateSSHPublicKeyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateSSHPublicKey API operation for AWS Identity and Access Management. -// -// Sets the status of an IAM user's SSH public key to active or inactive. SSH -// public keys that are inactive cannot be used for authentication. This action -// can be used to disable a user's SSH public key as part of a key rotation -// work flow. -// -// The SSH public key affected by this action is used only for authenticating -// the associated IAM user to an AWS CodeCommit repository. For more information -// about using SSH keys to authenticate to an AWS CodeCommit repository, see -// Set up AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) -// in the AWS CodeCommit 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 AWS Identity and Access Management's -// API operation UpdateSSHPublicKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSSHPublicKey -func (c *IAM) UpdateSSHPublicKey(input *UpdateSSHPublicKeyInput) (*UpdateSSHPublicKeyOutput, error) { - req, out := c.UpdateSSHPublicKeyRequest(input) - err := req.Send() - return out, err -} - -const opUpdateServerCertificate = "UpdateServerCertificate" - -// UpdateServerCertificateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateServerCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateServerCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateServerCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateServerCertificateRequest method. -// req, resp := client.UpdateServerCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServerCertificate -func (c *IAM) UpdateServerCertificateRequest(input *UpdateServerCertificateInput) (req *request.Request, output *UpdateServerCertificateOutput) { - op := &request.Operation{ - Name: opUpdateServerCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateServerCertificateInput{} - } - - output = &UpdateServerCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateServerCertificate API operation for AWS Identity and Access Management. -// -// Updates the name and/or the path of the specified server certificate stored -// in IAM. -// -// For more information about working with server certificates, including a -// list of AWS services that can use the server certificates that you manage -// with IAM, go to Working with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) -// in the IAM User Guide. -// -// You should understand the implications of changing a server certificate's -// path or name. For more information, see Renaming a Server Certificate (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs_manage.html#RenamingServerCerts) -// in the IAM User Guide. -// -// To change a server certificate name the requester must have appropriate permissions -// on both the source object and the target object. For example, to change the -// name from "ProductionCert" to "ProdCert", the entity making the request must -// have permission on "ProductionCert" and "ProdCert", or must have permission -// on all (*). For more information about permissions, see Access Management -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation UpdateServerCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServerCertificate -func (c *IAM) UpdateServerCertificate(input *UpdateServerCertificateInput) (*UpdateServerCertificateOutput, error) { - req, out := c.UpdateServerCertificateRequest(input) - err := req.Send() - return out, err -} - -const opUpdateServiceSpecificCredential = "UpdateServiceSpecificCredential" - -// UpdateServiceSpecificCredentialRequest generates a "aws/request.Request" representing the -// client's request for the UpdateServiceSpecificCredential operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateServiceSpecificCredential for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateServiceSpecificCredential method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateServiceSpecificCredentialRequest method. -// req, resp := client.UpdateServiceSpecificCredentialRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServiceSpecificCredential -func (c *IAM) UpdateServiceSpecificCredentialRequest(input *UpdateServiceSpecificCredentialInput) (req *request.Request, output *UpdateServiceSpecificCredentialOutput) { - op := &request.Operation{ - Name: opUpdateServiceSpecificCredential, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateServiceSpecificCredentialInput{} - } - - output = &UpdateServiceSpecificCredentialOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateServiceSpecificCredential API operation for AWS Identity and Access Management. -// -// Sets the status of a service-specific credential to Active or Inactive. Service-specific -// credentials that are inactive cannot be used for authentication to the service. -// This action can be used to disable a user’s service-specific credential as -// part of a credential rotation work flow. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation UpdateServiceSpecificCredential for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServiceSpecificCredential -func (c *IAM) UpdateServiceSpecificCredential(input *UpdateServiceSpecificCredentialInput) (*UpdateServiceSpecificCredentialOutput, error) { - req, out := c.UpdateServiceSpecificCredentialRequest(input) - err := req.Send() - return out, err -} - -const opUpdateSigningCertificate = "UpdateSigningCertificate" - -// UpdateSigningCertificateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSigningCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateSigningCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateSigningCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateSigningCertificateRequest method. -// req, resp := client.UpdateSigningCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSigningCertificate -func (c *IAM) UpdateSigningCertificateRequest(input *UpdateSigningCertificateInput) (req *request.Request, output *UpdateSigningCertificateOutput) { - op := &request.Operation{ - Name: opUpdateSigningCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSigningCertificateInput{} - } - - output = &UpdateSigningCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateSigningCertificate API operation for AWS Identity and Access Management. -// -// Changes the status of the specified user signing certificate from active -// to disabled, or vice versa. This action can be used to disable an IAM user's -// signing certificate as part of a certificate rotation work flow. -// -// If the UserName field is not specified, the UserName is determined implicitly -// based on the AWS access key ID used to sign the request. Because this action -// works for access keys under the AWS account, you can use this action to manage -// root credentials even if the AWS account has no associated users. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Identity and Access Management's -// API operation UpdateSigningCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSigningCertificate -func (c *IAM) UpdateSigningCertificate(input *UpdateSigningCertificateInput) (*UpdateSigningCertificateOutput, error) { - req, out := c.UpdateSigningCertificateRequest(input) - err := req.Send() - return out, err -} - -const opUpdateUser = "UpdateUser" - -// UpdateUserRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUser operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateUser for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateUser method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateUserRequest method. -// req, resp := client.UpdateUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateUser -func (c *IAM) UpdateUserRequest(input *UpdateUserInput) (req *request.Request, output *UpdateUserOutput) { - op := &request.Operation{ - Name: opUpdateUser, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateUserInput{} - } - - output = &UpdateUserOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateUser API operation for AWS Identity and Access Management. -// -// Updates the name and/or the path of the specified IAM user. -// -// You should understand the implications of changing an IAM user's path or -// name. For more information, see Renaming an IAM User (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_manage.html#id_users_renaming) -// and Renaming an IAM Group (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups_manage_rename.html) -// in the IAM User Guide. -// -// To change a user name the requester must have appropriate permissions on -// both the source object and the target object. For example, to change Bob -// to Robert, the entity making the request must have permission on Bob and -// Robert, or must have permission on all (*). For more information about permissions, -// see Permissions and Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PermissionsAndPolicies.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 AWS Identity and Access Management's -// API operation UpdateUser for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" -// The request was rejected because it referenced an entity that is temporarily -// unmodifiable, such as a user name that was deleted and then recreated. The -// error indicates that the request is likely to succeed if you try again after -// waiting several minutes. The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateUser -func (c *IAM) UpdateUser(input *UpdateUserInput) (*UpdateUserOutput, error) { - req, out := c.UpdateUserRequest(input) - err := req.Send() - return out, err -} - -const opUploadSSHPublicKey = "UploadSSHPublicKey" - -// UploadSSHPublicKeyRequest generates a "aws/request.Request" representing the -// client's request for the UploadSSHPublicKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UploadSSHPublicKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UploadSSHPublicKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UploadSSHPublicKeyRequest method. -// req, resp := client.UploadSSHPublicKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSSHPublicKey -func (c *IAM) UploadSSHPublicKeyRequest(input *UploadSSHPublicKeyInput) (req *request.Request, output *UploadSSHPublicKeyOutput) { - op := &request.Operation{ - Name: opUploadSSHPublicKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UploadSSHPublicKeyInput{} - } - - output = &UploadSSHPublicKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadSSHPublicKey API operation for AWS Identity and Access Management. -// -// Uploads an SSH public key and associates it with the specified IAM user. -// -// The SSH public key uploaded by this action can be used only for authenticating -// the associated IAM user to an AWS CodeCommit repository. For more information -// about using SSH keys to authenticate to an AWS CodeCommit repository, see -// Set up AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) -// in the AWS CodeCommit 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 AWS Identity and Access Management's -// API operation UploadSSHPublicKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeInvalidPublicKeyException "InvalidPublicKey" -// The request was rejected because the public key is malformed or otherwise -// invalid. -// -// * ErrCodeDuplicateSSHPublicKeyException "DuplicateSSHPublicKey" -// The request was rejected because the SSH public key is already associated -// with the specified IAM user. -// -// * ErrCodeUnrecognizedPublicKeyEncodingException "UnrecognizedPublicKeyEncoding" -// The request was rejected because the public key encoding format is unsupported -// or unrecognized. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSSHPublicKey -func (c *IAM) UploadSSHPublicKey(input *UploadSSHPublicKeyInput) (*UploadSSHPublicKeyOutput, error) { - req, out := c.UploadSSHPublicKeyRequest(input) - err := req.Send() - return out, err -} - -const opUploadServerCertificate = "UploadServerCertificate" - -// UploadServerCertificateRequest generates a "aws/request.Request" representing the -// client's request for the UploadServerCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UploadServerCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UploadServerCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UploadServerCertificateRequest method. -// req, resp := client.UploadServerCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadServerCertificate -func (c *IAM) UploadServerCertificateRequest(input *UploadServerCertificateInput) (req *request.Request, output *UploadServerCertificateOutput) { - op := &request.Operation{ - Name: opUploadServerCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UploadServerCertificateInput{} - } - - output = &UploadServerCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadServerCertificate API operation for AWS Identity and Access Management. -// -// Uploads a server certificate entity for the AWS account. The server certificate -// entity includes a public key certificate, a private key, and an optional -// certificate chain, which should all be PEM-encoded. -// -// We recommend that you use AWS Certificate Manager (https://aws.amazon.com/certificate-manager/) -// to provision, manage, and deploy your server certificates. With ACM you can -// request a certificate, deploy it to AWS resources, and let ACM handle certificate -// renewals for you. Certificates provided by ACM are free. For more information -// about using ACM, see the AWS Certificate Manager User Guide (http://docs.aws.amazon.com/acm/latest/userguide/). -// -// For more information about working with server certificates, including a -// list of AWS services that can use the server certificates that you manage -// with IAM, go to Working with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) -// in the IAM User Guide. -// -// For information about the number of server certificates you can upload, see -// Limitations on IAM Entities and Objects (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html) -// in the IAM User Guide. -// -// Because the body of the public key certificate, private key, and the certificate -// chain can be large, you should use POST rather than GET when calling UploadServerCertificate. -// 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 using the Query -// API with IAM, go to Calling the API by Making HTTP Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/programming.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation UploadServerCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeMalformedCertificateException "MalformedCertificate" -// The request was rejected because the certificate was malformed or expired. -// The error message describes the specific error. -// -// * ErrCodeKeyPairMismatchException "KeyPairMismatch" -// The request was rejected because the public key certificate and the private -// key do not match. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadServerCertificate -func (c *IAM) UploadServerCertificate(input *UploadServerCertificateInput) (*UploadServerCertificateOutput, error) { - req, out := c.UploadServerCertificateRequest(input) - err := req.Send() - return out, err -} - -const opUploadSigningCertificate = "UploadSigningCertificate" - -// UploadSigningCertificateRequest generates a "aws/request.Request" representing the -// client's request for the UploadSigningCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UploadSigningCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UploadSigningCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UploadSigningCertificateRequest method. -// req, resp := client.UploadSigningCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSigningCertificate -func (c *IAM) UploadSigningCertificateRequest(input *UploadSigningCertificateInput) (req *request.Request, output *UploadSigningCertificateOutput) { - op := &request.Operation{ - Name: opUploadSigningCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UploadSigningCertificateInput{} - } - - output = &UploadSigningCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadSigningCertificate API operation for AWS Identity and Access Management. -// -// Uploads an X.509 signing certificate and associates it with the specified -// IAM user. Some AWS services use X.509 signing certificates to validate requests -// that are signed with a corresponding private key. When you upload the certificate, -// its default status is Active. -// -// If the UserName field is not specified, the IAM user name is determined implicitly -// based on the AWS access key ID used to sign the request. Because this action -// works for access keys under the AWS account, you can use this action to manage -// root credentials even if the AWS account has no associated users. -// -// Because the body of a X.509 certificate can be large, you should use POST -// rather than GET when calling UploadSigningCertificate. 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 using the Query -// API with IAM, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) -// 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 -// the error. -// -// See the AWS API reference guide for AWS Identity and Access Management's -// API operation UploadSigningCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. -// -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeMalformedCertificateException "MalformedCertificate" -// The request was rejected because the certificate was malformed or expired. -// The error message describes the specific error. -// -// * ErrCodeInvalidCertificateException "InvalidCertificate" -// The request was rejected because the certificate is invalid. -// -// * ErrCodeDuplicateCertificateException "DuplicateCertificate" -// The request was rejected because the same certificate is associated with -// an IAM user in the account. -// -// * ErrCodeNoSuchEntityException "NoSuchEntity" -// The request was rejected because it referenced an entity that does not exist. -// The error message describes the entity. -// -// * ErrCodeServiceFailureException "ServiceFailure" -// The request processing has failed because of an unknown error, exception -// or failure. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSigningCertificate -func (c *IAM) UploadSigningCertificate(input *UploadSigningCertificateInput) (*UploadSigningCertificateOutput, error) { - req, out := c.UploadSigningCertificateRequest(input) - err := req.Send() - return out, err -} - -// Contains information about an AWS access key. -// -// This data type is used as a response element in the CreateAccessKey and ListAccessKeys -// actions. -// -// The SecretAccessKey value is returned only in response to CreateAccessKey. -// You can get a secret access key only when you first create an access key; -// you cannot recover the secret access key later. If you lose a secret access -// key, you must create a new access key. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AccessKey -type AccessKey struct { - _ struct{} `type:"structure"` - - // The ID for this access key. - // - // AccessKeyId is a required field - AccessKeyId *string `min:"16" type:"string" required:"true"` - - // The date when the access key was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The secret key used to sign requests. - // - // SecretAccessKey is a required field - SecretAccessKey *string `type:"string" required:"true"` - - // The status of the access key. Active means the key is valid for API calls, - // while Inactive means it is not. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The name of the IAM user that the access key is associated with. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s AccessKey) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccessKey) GoString() string { - return s.String() -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *AccessKey) SetAccessKeyId(v string) *AccessKey { - s.AccessKeyId = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *AccessKey) SetCreateDate(v time.Time) *AccessKey { - s.CreateDate = &v - return s -} - -// SetSecretAccessKey sets the SecretAccessKey field's value. -func (s *AccessKey) SetSecretAccessKey(v string) *AccessKey { - s.SecretAccessKey = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AccessKey) SetStatus(v string) *AccessKey { - s.Status = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *AccessKey) SetUserName(v string) *AccessKey { - s.UserName = &v - return s -} - -// Contains information about the last time an AWS access key was used. -// -// This data type is used as a response element in the GetAccessKeyLastUsed -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AccessKeyLastUsed -type AccessKeyLastUsed struct { - _ struct{} `type:"structure"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the access key was most recently used. This field is null when: - // - // * The user does not have an access key. - // - // * An access key exists but has never been used, at least not since IAM - // started tracking this information on April 22nd, 2015. - // - // * There is no sign-in data associated with the user - // - // LastUsedDate is a required field - LastUsedDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The AWS region where this access key was most recently used. This field is - // null when: - // - // * The user does not have an access key. - // - // * An access key exists but has never been used, at least not since IAM - // started tracking this information on April 22nd, 2015. - // - // * There is no sign-in data associated with the user - // - // For more information about AWS regions, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html) - // in the Amazon Web Services General Reference. - // - // Region is a required field - Region *string `type:"string" required:"true"` - - // The name of the AWS service with which this access key was most recently - // used. This field is null when: - // - // * The user does not have an access key. - // - // * An access key exists but has never been used, at least not since IAM - // started tracking this information on April 22nd, 2015. - // - // * There is no sign-in data associated with the user - // - // ServiceName is a required field - ServiceName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AccessKeyLastUsed) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccessKeyLastUsed) GoString() string { - return s.String() -} - -// SetLastUsedDate sets the LastUsedDate field's value. -func (s *AccessKeyLastUsed) SetLastUsedDate(v time.Time) *AccessKeyLastUsed { - s.LastUsedDate = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *AccessKeyLastUsed) SetRegion(v string) *AccessKeyLastUsed { - s.Region = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *AccessKeyLastUsed) SetServiceName(v string) *AccessKeyLastUsed { - s.ServiceName = &v - return s -} - -// Contains information about an AWS access key, without its secret key. -// -// This data type is used as a response element in the ListAccessKeys action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AccessKeyMetadata -type AccessKeyMetadata struct { - _ struct{} `type:"structure"` - - // The ID for this access key. - AccessKeyId *string `min:"16" type:"string"` - - // The date when the access key was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The status of the access key. Active means the key is valid for API calls; - // Inactive means it is not. - Status *string `type:"string" enum:"statusType"` - - // The name of the IAM user that the key is associated with. - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s AccessKeyMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccessKeyMetadata) GoString() string { - return s.String() -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *AccessKeyMetadata) SetAccessKeyId(v string) *AccessKeyMetadata { - s.AccessKeyId = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *AccessKeyMetadata) SetCreateDate(v time.Time) *AccessKeyMetadata { - s.CreateDate = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AccessKeyMetadata) SetStatus(v string) *AccessKeyMetadata { - s.Status = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *AccessKeyMetadata) SetUserName(v string) *AccessKeyMetadata { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProviderRequest -type AddClientIDToOpenIDConnectProviderInput struct { - _ struct{} `type:"structure"` - - // The client ID (also known as audience) to add to the IAM OpenID Connect provider - // resource. - // - // ClientID is a required field - ClientID *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM OpenID Connect (OIDC) provider - // resource to add the client ID to. You can get a list of OIDC provider ARNs - // by using the ListOpenIDConnectProviders action. - // - // OpenIDConnectProviderArn is a required field - OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s AddClientIDToOpenIDConnectProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddClientIDToOpenIDConnectProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddClientIDToOpenIDConnectProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddClientIDToOpenIDConnectProviderInput"} - if s.ClientID == nil { - invalidParams.Add(request.NewErrParamRequired("ClientID")) - } - if s.ClientID != nil && len(*s.ClientID) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientID", 1)) - } - if s.OpenIDConnectProviderArn == nil { - invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) - } - if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientID sets the ClientID field's value. -func (s *AddClientIDToOpenIDConnectProviderInput) SetClientID(v string) *AddClientIDToOpenIDConnectProviderInput { - s.ClientID = &v - return s -} - -// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. -func (s *AddClientIDToOpenIDConnectProviderInput) SetOpenIDConnectProviderArn(v string) *AddClientIDToOpenIDConnectProviderInput { - s.OpenIDConnectProviderArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProviderOutput -type AddClientIDToOpenIDConnectProviderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddClientIDToOpenIDConnectProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddClientIDToOpenIDConnectProviderOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfileRequest -type AddRoleToInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The name of the instance profile to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // InstanceProfileName is a required field - InstanceProfileName *string `min:"1" type:"string" required:"true"` - - // The name of the role to add. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s AddRoleToInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddRoleToInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddRoleToInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddRoleToInstanceProfileInput"} - if s.InstanceProfileName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) - } - if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceProfileName sets the InstanceProfileName field's value. -func (s *AddRoleToInstanceProfileInput) SetInstanceProfileName(v string) *AddRoleToInstanceProfileInput { - s.InstanceProfileName = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *AddRoleToInstanceProfileInput) SetRoleName(v string) *AddRoleToInstanceProfileInput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfileOutput -type AddRoleToInstanceProfileOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddRoleToInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddRoleToInstanceProfileOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroupRequest -type AddUserToGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the group to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The name of the user to add. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s AddUserToGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddUserToGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddUserToGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddUserToGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *AddUserToGroupInput) SetGroupName(v string) *AddUserToGroupInput { - s.GroupName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *AddUserToGroupInput) SetUserName(v string) *AddUserToGroupInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroupOutput -type AddUserToGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddUserToGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddUserToGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicyRequest -type AttachGroupPolicyInput struct { - _ struct{} `type:"structure"` - - // The name (friendly name, not ARN) of the group to attach the policy to. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM policy you want to attach. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachGroupPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachGroupPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachGroupPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachGroupPolicyInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *AttachGroupPolicyInput) SetGroupName(v string) *AttachGroupPolicyInput { - s.GroupName = &v - return s -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *AttachGroupPolicyInput) SetPolicyArn(v string) *AttachGroupPolicyInput { - s.PolicyArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicyOutput -type AttachGroupPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachGroupPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachGroupPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicyRequest -type AttachRolePolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM policy you want to attach. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` - - // The name (friendly name, not ARN) of the role to attach the policy to. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachRolePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachRolePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachRolePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachRolePolicyInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *AttachRolePolicyInput) SetPolicyArn(v string) *AttachRolePolicyInput { - s.PolicyArn = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *AttachRolePolicyInput) SetRoleName(v string) *AttachRolePolicyInput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicyOutput -type AttachRolePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachRolePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachRolePolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicyRequest -type AttachUserPolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM policy you want to attach. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` - - // The name (friendly name, not ARN) of the IAM user to attach the policy to. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachUserPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachUserPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachUserPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachUserPolicyInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *AttachUserPolicyInput) SetPolicyArn(v string) *AttachUserPolicyInput { - s.PolicyArn = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *AttachUserPolicyInput) SetUserName(v string) *AttachUserPolicyInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicyOutput -type AttachUserPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachUserPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachUserPolicyOutput) GoString() string { - return s.String() -} - -// Contains information about an attached policy. -// -// An attached policy is a managed policy that has been attached to a user, -// group, or role. This data type is used as a response element in the ListAttachedGroupPolicies, -// ListAttachedRolePolicies, ListAttachedUserPolicies, and GetAccountAuthorizationDetails -// actions. -// -// For more information about managed policies, refer to Managed Policies and -// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachedPolicy -type AttachedPolicy struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. - // - // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - PolicyArn *string `min:"20" type:"string"` - - // The friendly name of the attached policy. - PolicyName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s AttachedPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachedPolicy) GoString() string { - return s.String() -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *AttachedPolicy) SetPolicyArn(v string) *AttachedPolicy { - s.PolicyArn = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *AttachedPolicy) SetPolicyName(v string) *AttachedPolicy { - s.PolicyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePasswordRequest -type ChangePasswordInput struct { - _ struct{} `type:"structure"` - - // The new password. The new password must conform to the AWS account's password - // policy, if one exists. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of almost any printable ASCII - // character from the space (\u0020) through the end of the ASCII character - // range (\u00FF). You can also include the tab (\u0009), line feed (\u000A), - // and carriage return (\u000D) characters. Although any of these characters - // are valid in a password, note that many tools, such as the AWS Management - // Console, might restrict the ability to enter certain characters because they - // have special meaning within that tool. - // - // NewPassword is a required field - NewPassword *string `min:"1" type:"string" required:"true"` - - // The IAM user's current password. - // - // OldPassword is a required field - OldPassword *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ChangePasswordInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangePasswordInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChangePasswordInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChangePasswordInput"} - if s.NewPassword == nil { - invalidParams.Add(request.NewErrParamRequired("NewPassword")) - } - if s.NewPassword != nil && len(*s.NewPassword) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewPassword", 1)) - } - if s.OldPassword == nil { - invalidParams.Add(request.NewErrParamRequired("OldPassword")) - } - if s.OldPassword != nil && len(*s.OldPassword) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OldPassword", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNewPassword sets the NewPassword field's value. -func (s *ChangePasswordInput) SetNewPassword(v string) *ChangePasswordInput { - s.NewPassword = &v - return s -} - -// SetOldPassword sets the OldPassword field's value. -func (s *ChangePasswordInput) SetOldPassword(v string) *ChangePasswordInput { - s.OldPassword = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePasswordOutput -type ChangePasswordOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ChangePasswordOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangePasswordOutput) GoString() string { - return s.String() -} - -// Contains information about a condition context key. It includes the name -// of the key and specifies the value (or values, if the context key supports -// multiple values) to use in the simulation. This information is used when -// evaluating the Condition elements of the input policies. -// -// This data type is used as an input parameter to SimulateCustomPolicy and -// SimulateCustomPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ContextEntry -type ContextEntry struct { - _ struct{} `type:"structure"` - - // The full name of a condition context key, including the service prefix. For - // example, aws:SourceIp or s3:VersionId. - ContextKeyName *string `min:"5" type:"string"` - - // The data type of the value (or values) specified in the ContextKeyValues - // parameter. - ContextKeyType *string `type:"string" enum:"ContextKeyTypeEnum"` - - // The value (or values, if the condition context key supports multiple values) - // to provide to the simulation for use when the key is referenced by a Condition - // element in an input policy. - ContextKeyValues []*string `type:"list"` -} - -// String returns the string representation -func (s ContextEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContextEntry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContextEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContextEntry"} - if s.ContextKeyName != nil && len(*s.ContextKeyName) < 5 { - invalidParams.Add(request.NewErrParamMinLen("ContextKeyName", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContextKeyName sets the ContextKeyName field's value. -func (s *ContextEntry) SetContextKeyName(v string) *ContextEntry { - s.ContextKeyName = &v - return s -} - -// SetContextKeyType sets the ContextKeyType field's value. -func (s *ContextEntry) SetContextKeyType(v string) *ContextEntry { - s.ContextKeyType = &v - return s -} - -// SetContextKeyValues sets the ContextKeyValues field's value. -func (s *ContextEntry) SetContextKeyValues(v []*string) *ContextEntry { - s.ContextKeyValues = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKeyRequest -type CreateAccessKeyInput struct { - _ struct{} `type:"structure"` - - // The name of the IAM user that the new key will belong to. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateAccessKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAccessKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAccessKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAccessKeyInput"} - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUserName sets the UserName field's value. -func (s *CreateAccessKeyInput) SetUserName(v string) *CreateAccessKeyInput { - s.UserName = &v - return s -} - -// Contains the response to a successful CreateAccessKey request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKeyResponse -type CreateAccessKeyOutput struct { - _ struct{} `type:"structure"` - - // A structure with details about the access key. - // - // AccessKey is a required field - AccessKey *AccessKey `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateAccessKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAccessKeyOutput) GoString() string { - return s.String() -} - -// SetAccessKey sets the AccessKey field's value. -func (s *CreateAccessKeyOutput) SetAccessKey(v *AccessKey) *CreateAccessKeyOutput { - s.AccessKey = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAliasRequest -type CreateAccountAliasInput struct { - _ struct{} `type:"structure"` - - // The account alias to create. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of lowercase letters, digits, and dashes. - // You cannot start or finish with a dash, nor can you have two dashes in a - // row. - // - // AccountAlias is a required field - AccountAlias *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateAccountAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAccountAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAccountAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAccountAliasInput"} - if s.AccountAlias == nil { - invalidParams.Add(request.NewErrParamRequired("AccountAlias")) - } - if s.AccountAlias != nil && len(*s.AccountAlias) < 3 { - invalidParams.Add(request.NewErrParamMinLen("AccountAlias", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountAlias sets the AccountAlias field's value. -func (s *CreateAccountAliasInput) SetAccountAlias(v string) *CreateAccountAliasInput { - s.AccountAlias = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAliasOutput -type CreateAccountAliasOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateAccountAliasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAccountAliasOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroupRequest -type CreateGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the group to create. Do not include the path in this value. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@-. - // The group name must be unique within the account. Group names are not distinguished - // by case. For example, you cannot create groups named both "ADMINS" and "admins". - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The path to the group. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - Path *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.Path != nil && len(*s.Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Path", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *CreateGroupInput) SetGroupName(v string) *CreateGroupInput { - s.GroupName = &v - return s -} - -// SetPath sets the Path field's value. -func (s *CreateGroupInput) SetPath(v string) *CreateGroupInput { - s.Path = &v - return s -} - -// Contains the response to a successful CreateGroup request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroupResponse -type CreateGroupOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the new group. - // - // Group is a required field - Group *Group `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGroupOutput) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *CreateGroupOutput) SetGroup(v *Group) *CreateGroupOutput { - s.Group = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfileRequest -type CreateInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The name of the instance profile to create. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // InstanceProfileName is a required field - InstanceProfileName *string `min:"1" type:"string" required:"true"` - - // The path to the instance profile. For more information about paths, see IAM - // Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - Path *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInstanceProfileInput"} - if s.InstanceProfileName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) - } - if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) - } - if s.Path != nil && len(*s.Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Path", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceProfileName sets the InstanceProfileName field's value. -func (s *CreateInstanceProfileInput) SetInstanceProfileName(v string) *CreateInstanceProfileInput { - s.InstanceProfileName = &v - return s -} - -// SetPath sets the Path field's value. -func (s *CreateInstanceProfileInput) SetPath(v string) *CreateInstanceProfileInput { - s.Path = &v - return s -} - -// Contains the response to a successful CreateInstanceProfile request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfileResponse -type CreateInstanceProfileOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the new instance profile. - // - // InstanceProfile is a required field - InstanceProfile *InstanceProfile `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceProfileOutput) GoString() string { - return s.String() -} - -// SetInstanceProfile sets the InstanceProfile field's value. -func (s *CreateInstanceProfileOutput) SetInstanceProfile(v *InstanceProfile) *CreateInstanceProfileOutput { - s.InstanceProfile = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfileRequest -type CreateLoginProfileInput struct { - _ struct{} `type:"structure"` - - // The new password for the user. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of almost any printable ASCII - // character from the space (\u0020) through the end of the ASCII character - // range (\u00FF). You can also include the tab (\u0009), line feed (\u000A), - // and carriage return (\u000D) characters. Although any of these characters - // are valid in a password, note that many tools, such as the AWS Management - // Console, might restrict the ability to enter certain characters because they - // have special meaning within that tool. - // - // Password is a required field - Password *string `min:"1" type:"string" required:"true"` - - // Specifies whether the user is required to set a new password on next sign-in. - PasswordResetRequired *bool `type:"boolean"` - - // The name of the IAM user to create a password for. The user must already - // exist. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateLoginProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoginProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLoginProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLoginProfileInput"} - if s.Password == nil { - invalidParams.Add(request.NewErrParamRequired("Password")) - } - if s.Password != nil && len(*s.Password) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Password", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPassword sets the Password field's value. -func (s *CreateLoginProfileInput) SetPassword(v string) *CreateLoginProfileInput { - s.Password = &v - return s -} - -// SetPasswordResetRequired sets the PasswordResetRequired field's value. -func (s *CreateLoginProfileInput) SetPasswordResetRequired(v bool) *CreateLoginProfileInput { - s.PasswordResetRequired = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *CreateLoginProfileInput) SetUserName(v string) *CreateLoginProfileInput { - s.UserName = &v - return s -} - -// Contains the response to a successful CreateLoginProfile request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfileResponse -type CreateLoginProfileOutput struct { - _ struct{} `type:"structure"` - - // A structure containing the user name and password create date. - // - // LoginProfile is a required field - LoginProfile *LoginProfile `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateLoginProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLoginProfileOutput) GoString() string { - return s.String() -} - -// SetLoginProfile sets the LoginProfile field's value. -func (s *CreateLoginProfileOutput) SetLoginProfile(v *LoginProfile) *CreateLoginProfileOutput { - s.LoginProfile = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProviderRequest -type CreateOpenIDConnectProviderInput struct { - _ struct{} `type:"structure"` - - // A list of client IDs (also known as audiences). When a mobile or web app - // registers with an OpenID Connect provider, they establish a value that identifies - // the application. (This is the value that's sent as the client_id parameter - // on OAuth requests.) - // - // You can register multiple client IDs with the same provider. For example, - // you might have multiple applications that use the same OIDC provider. You - // cannot register more than 100 client IDs with a single IAM OIDC provider. - // - // There is no defined format for a client ID. The CreateOpenIDConnectProviderRequest - // action accepts client IDs up to 255 characters long. - ClientIDList []*string `type:"list"` - - // A list of server certificate thumbprints for the OpenID Connect (OIDC) identity - // provider's server certificate(s). Typically this list includes only one entry. - // However, IAM lets you have up to five thumbprints for an OIDC provider. This - // lets you maintain multiple thumbprints if the identity provider is rotating - // certificates. - // - // The server certificate thumbprint is the hex-encoded SHA-1 hash value of - // the X.509 certificate used by the domain where the OpenID Connect provider - // makes its keys available. It is always a 40-character string. - // - // You must provide at least one thumbprint when creating an IAM OIDC provider. - // For example, if the OIDC provider is server.example.com and the provider - // stores its keys at "https://keys.server.example.com/openid-connect", the - // thumbprint string would be the hex-encoded SHA-1 hash value of the certificate - // used by https://keys.server.example.com. - // - // For more information about obtaining the OIDC provider's thumbprint, see - // Obtaining the Thumbprint for an OpenID Connect Provider (http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc-obtain-thumbprint.html) - // in the IAM User Guide. - // - // ThumbprintList is a required field - ThumbprintList []*string `type:"list" required:"true"` - - // The URL of the identity provider. The URL must begin with "https://" and - // should correspond to the iss claim in the provider's OpenID Connect ID tokens. - // Per the OIDC standard, path components are allowed but query parameters are - // not. Typically the URL consists of only a host name, like "https://server.example.org" - // or "https://example.com". - // - // You cannot register the same provider multiple times in a single AWS account. - // If you try to submit a URL that has already been used for an OpenID Connect - // provider in the AWS account, you will get an error. - // - // Url is a required field - Url *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateOpenIDConnectProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateOpenIDConnectProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateOpenIDConnectProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateOpenIDConnectProviderInput"} - if s.ThumbprintList == nil { - invalidParams.Add(request.NewErrParamRequired("ThumbprintList")) - } - if s.Url == nil { - invalidParams.Add(request.NewErrParamRequired("Url")) - } - if s.Url != nil && len(*s.Url) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Url", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientIDList sets the ClientIDList field's value. -func (s *CreateOpenIDConnectProviderInput) SetClientIDList(v []*string) *CreateOpenIDConnectProviderInput { - s.ClientIDList = v - return s -} - -// SetThumbprintList sets the ThumbprintList field's value. -func (s *CreateOpenIDConnectProviderInput) SetThumbprintList(v []*string) *CreateOpenIDConnectProviderInput { - s.ThumbprintList = v - return s -} - -// SetUrl sets the Url field's value. -func (s *CreateOpenIDConnectProviderInput) SetUrl(v string) *CreateOpenIDConnectProviderInput { - s.Url = &v - return s -} - -// Contains the response to a successful CreateOpenIDConnectProvider request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProviderResponse -type CreateOpenIDConnectProviderOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the new IAM OpenID Connect provider that - // is created. For more information, see OpenIDConnectProviderListEntry. - OpenIDConnectProviderArn *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s CreateOpenIDConnectProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateOpenIDConnectProviderOutput) GoString() string { - return s.String() -} - -// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. -func (s *CreateOpenIDConnectProviderOutput) SetOpenIDConnectProviderArn(v string) *CreateOpenIDConnectProviderOutput { - s.OpenIDConnectProviderArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyRequest -type CreatePolicyInput struct { - _ struct{} `type:"structure"` - - // A friendly description of the policy. - // - // Typically used to store information about the permissions defined in the - // policy. For example, "Grants access to production DynamoDB tables." - // - // The policy description is immutable. After a value is assigned, it cannot - // be changed. - Description *string `type:"string"` - - // The path for the policy. - // - // For more information about paths, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - Path *string `type:"string"` - - // The JSON policy document that you want to use as the content for the new - // policy. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // The friendly name of the policy. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreatePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePolicyInput"} - if s.PolicyDocument == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) - } - if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreatePolicyInput) SetDescription(v string) *CreatePolicyInput { - s.Description = &v - return s -} - -// SetPath sets the Path field's value. -func (s *CreatePolicyInput) SetPath(v string) *CreatePolicyInput { - s.Path = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *CreatePolicyInput) SetPolicyDocument(v string) *CreatePolicyInput { - s.PolicyDocument = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *CreatePolicyInput) SetPolicyName(v string) *CreatePolicyInput { - s.PolicyName = &v - return s -} - -// Contains the response to a successful CreatePolicy request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyResponse -type CreatePolicyOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the new policy. - Policy *Policy `type:"structure"` -} - -// String returns the string representation -func (s CreatePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *CreatePolicyOutput) SetPolicy(v *Policy) *CreatePolicyOutput { - s.Policy = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersionRequest -type CreatePolicyVersionInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM policy to which you want to add - // a new version. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` - - // The JSON policy document that you want to use as the content for this new - // version of the policy. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // Specifies whether to set this version as the policy's default version. - // - // When this parameter is true, the new policy version becomes the operative - // version; that is, the version that is in effect for the IAM users, groups, - // and roles that the policy is attached to. - // - // For more information about managed policy versions, see Versioning for Managed - // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) - // in the IAM User Guide. - SetAsDefault *bool `type:"boolean"` -} - -// String returns the string representation -func (s CreatePolicyVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePolicyVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePolicyVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePolicyVersionInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - if s.PolicyDocument == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) - } - if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *CreatePolicyVersionInput) SetPolicyArn(v string) *CreatePolicyVersionInput { - s.PolicyArn = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *CreatePolicyVersionInput) SetPolicyDocument(v string) *CreatePolicyVersionInput { - s.PolicyDocument = &v - return s -} - -// SetSetAsDefault sets the SetAsDefault field's value. -func (s *CreatePolicyVersionInput) SetSetAsDefault(v bool) *CreatePolicyVersionInput { - s.SetAsDefault = &v - return s -} - -// Contains the response to a successful CreatePolicyVersion request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersionResponse -type CreatePolicyVersionOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the new policy version. - PolicyVersion *PolicyVersion `type:"structure"` -} - -// String returns the string representation -func (s CreatePolicyVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePolicyVersionOutput) GoString() string { - return s.String() -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *CreatePolicyVersionOutput) SetPolicyVersion(v *PolicyVersion) *CreatePolicyVersionOutput { - s.PolicyVersion = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRoleRequest -type CreateRoleInput struct { - _ struct{} `type:"structure"` - - // The trust relationship policy document that grants an entity permission to - // assume the role. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // AssumeRolePolicyDocument is a required field - AssumeRolePolicyDocument *string `min:"1" type:"string" required:"true"` - - // The path to the role. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - Path *string `min:"1" type:"string"` - - // The name of the role to create. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@-. - // Role names are not distinguished by case. For example, you cannot create - // roles named both "PRODROLE" and "prodrole". - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRoleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRoleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRoleInput"} - if s.AssumeRolePolicyDocument == nil { - invalidParams.Add(request.NewErrParamRequired("AssumeRolePolicyDocument")) - } - if s.AssumeRolePolicyDocument != nil && len(*s.AssumeRolePolicyDocument) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssumeRolePolicyDocument", 1)) - } - if s.Path != nil && len(*s.Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Path", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssumeRolePolicyDocument sets the AssumeRolePolicyDocument field's value. -func (s *CreateRoleInput) SetAssumeRolePolicyDocument(v string) *CreateRoleInput { - s.AssumeRolePolicyDocument = &v - return s -} - -// SetPath sets the Path field's value. -func (s *CreateRoleInput) SetPath(v string) *CreateRoleInput { - s.Path = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *CreateRoleInput) SetRoleName(v string) *CreateRoleInput { - s.RoleName = &v - return s -} - -// Contains the response to a successful CreateRole request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRoleResponse -type CreateRoleOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the new role. - // - // Role is a required field - Role *Role `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRoleOutput) GoString() string { - return s.String() -} - -// SetRole sets the Role field's value. -func (s *CreateRoleOutput) SetRole(v *Role) *CreateRoleOutput { - s.Role = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProviderRequest -type CreateSAMLProviderInput struct { - _ struct{} `type:"structure"` - - // The name of the provider to create. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // An XML document generated by an identity provider (IdP) that supports SAML - // 2.0. The document includes the issuer's name, expiration information, and - // keys that can be used to validate the SAML authentication response (assertions) - // that are received from the IdP. You must generate the metadata document using - // the identity management software that is used as your organization's IdP. - // - // For more information, see About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) - // in the IAM User Guide - // - // SAMLMetadataDocument is a required field - SAMLMetadataDocument *string `min:"1000" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSAMLProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSAMLProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSAMLProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSAMLProviderInput"} - 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.SAMLMetadataDocument == nil { - invalidParams.Add(request.NewErrParamRequired("SAMLMetadataDocument")) - } - if s.SAMLMetadataDocument != nil && len(*s.SAMLMetadataDocument) < 1000 { - invalidParams.Add(request.NewErrParamMinLen("SAMLMetadataDocument", 1000)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateSAMLProviderInput) SetName(v string) *CreateSAMLProviderInput { - s.Name = &v - return s -} - -// SetSAMLMetadataDocument sets the SAMLMetadataDocument field's value. -func (s *CreateSAMLProviderInput) SetSAMLMetadataDocument(v string) *CreateSAMLProviderInput { - s.SAMLMetadataDocument = &v - return s -} - -// Contains the response to a successful CreateSAMLProvider request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProviderResponse -type CreateSAMLProviderOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the new SAML provider resource in IAM. - SAMLProviderArn *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s CreateSAMLProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSAMLProviderOutput) GoString() string { - return s.String() -} - -// SetSAMLProviderArn sets the SAMLProviderArn field's value. -func (s *CreateSAMLProviderOutput) SetSAMLProviderArn(v string) *CreateSAMLProviderOutput { - s.SAMLProviderArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredentialRequest -type CreateServiceSpecificCredentialInput struct { - _ struct{} `type:"structure"` - - // The name of the AWS service that is to be associated with the credentials. - // The service you specify here is the only service that can be accessed using - // these credentials. - // - // ServiceName is a required field - ServiceName *string `type:"string" required:"true"` - - // The name of the IAM user that is to be associated with the credentials. The - // new service-specific credentials have the same permissions as the associated - // user except that they can be used only to access the specified service. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateServiceSpecificCredentialInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateServiceSpecificCredentialInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateServiceSpecificCredentialInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateServiceSpecificCredentialInput"} - if s.ServiceName == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceName")) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceName sets the ServiceName field's value. -func (s *CreateServiceSpecificCredentialInput) SetServiceName(v string) *CreateServiceSpecificCredentialInput { - s.ServiceName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *CreateServiceSpecificCredentialInput) SetUserName(v string) *CreateServiceSpecificCredentialInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredentialResponse -type CreateServiceSpecificCredentialOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains information about the newly created service-specific - // credential. - // - // This is the only time that the password for this credential set is available. - // It cannot be recovered later. Instead, you will have to reset the password - // with ResetServiceSpecificCredential. - ServiceSpecificCredential *ServiceSpecificCredential `type:"structure"` -} - -// String returns the string representation -func (s CreateServiceSpecificCredentialOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateServiceSpecificCredentialOutput) GoString() string { - return s.String() -} - -// SetServiceSpecificCredential sets the ServiceSpecificCredential field's value. -func (s *CreateServiceSpecificCredentialOutput) SetServiceSpecificCredential(v *ServiceSpecificCredential) *CreateServiceSpecificCredentialOutput { - s.ServiceSpecificCredential = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUserRequest -type CreateUserInput struct { - _ struct{} `type:"structure"` - - // The path for the user name. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - Path *string `min:"1" type:"string"` - - // The name of the user to create. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@-. - // User names are not distinguished by case. For example, you cannot create - // users named both "TESTUSER" and "testuser". - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateUserInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUserInput"} - if s.Path != nil && len(*s.Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Path", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPath sets the Path field's value. -func (s *CreateUserInput) SetPath(v string) *CreateUserInput { - s.Path = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *CreateUserInput) SetUserName(v string) *CreateUserInput { - s.UserName = &v - return s -} - -// Contains the response to a successful CreateUser request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUserResponse -type CreateUserOutput struct { - _ struct{} `type:"structure"` - - // A structure with details about the new IAM user. - User *User `type:"structure"` -} - -// String returns the string representation -func (s CreateUserOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateUserOutput) GoString() string { - return s.String() -} - -// SetUser sets the User field's value. -func (s *CreateUserOutput) SetUser(v *User) *CreateUserOutput { - s.User = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADeviceRequest -type CreateVirtualMFADeviceInput struct { - _ struct{} `type:"structure"` - - // The path for the virtual MFA device. For more information about paths, see - // IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - Path *string `min:"1" type:"string"` - - // The name of the virtual MFA device. Use with path to uniquely identify a - // virtual MFA device. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // VirtualMFADeviceName is a required field - VirtualMFADeviceName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateVirtualMFADeviceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVirtualMFADeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVirtualMFADeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVirtualMFADeviceInput"} - if s.Path != nil && len(*s.Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Path", 1)) - } - if s.VirtualMFADeviceName == nil { - invalidParams.Add(request.NewErrParamRequired("VirtualMFADeviceName")) - } - if s.VirtualMFADeviceName != nil && len(*s.VirtualMFADeviceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VirtualMFADeviceName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPath sets the Path field's value. -func (s *CreateVirtualMFADeviceInput) SetPath(v string) *CreateVirtualMFADeviceInput { - s.Path = &v - return s -} - -// SetVirtualMFADeviceName sets the VirtualMFADeviceName field's value. -func (s *CreateVirtualMFADeviceInput) SetVirtualMFADeviceName(v string) *CreateVirtualMFADeviceInput { - s.VirtualMFADeviceName = &v - return s -} - -// Contains the response to a successful CreateVirtualMFADevice request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADeviceResponse -type CreateVirtualMFADeviceOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the new virtual MFA device. - // - // VirtualMFADevice is a required field - VirtualMFADevice *VirtualMFADevice `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateVirtualMFADeviceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVirtualMFADeviceOutput) GoString() string { - return s.String() -} - -// SetVirtualMFADevice sets the VirtualMFADevice field's value. -func (s *CreateVirtualMFADeviceOutput) SetVirtualMFADevice(v *VirtualMFADevice) *CreateVirtualMFADeviceOutput { - s.VirtualMFADevice = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADeviceRequest -type DeactivateMFADeviceInput struct { - _ struct{} `type:"structure"` - - // The serial number that uniquely identifies the MFA device. For virtual MFA - // devices, the serial number is the device ARN. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =/:,.@- - // - // SerialNumber is a required field - SerialNumber *string `min:"9" type:"string" required:"true"` - - // The name of the user whose MFA device you want to deactivate. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeactivateMFADeviceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeactivateMFADeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeactivateMFADeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeactivateMFADeviceInput"} - if s.SerialNumber == nil { - invalidParams.Add(request.NewErrParamRequired("SerialNumber")) - } - if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { - invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *DeactivateMFADeviceInput) SetSerialNumber(v string) *DeactivateMFADeviceInput { - s.SerialNumber = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *DeactivateMFADeviceInput) SetUserName(v string) *DeactivateMFADeviceInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADeviceOutput -type DeactivateMFADeviceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeactivateMFADeviceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeactivateMFADeviceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKeyRequest -type DeleteAccessKeyInput struct { - _ struct{} `type:"structure"` - - // The access key ID for the access key ID and secret access key you want to - // delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // AccessKeyId is a required field - AccessKeyId *string `min:"16" type:"string" required:"true"` - - // The name of the user whose access key pair you want to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteAccessKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAccessKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAccessKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAccessKeyInput"} - if s.AccessKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) - } - if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { - invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *DeleteAccessKeyInput) SetAccessKeyId(v string) *DeleteAccessKeyInput { - s.AccessKeyId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *DeleteAccessKeyInput) SetUserName(v string) *DeleteAccessKeyInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKeyOutput -type DeleteAccessKeyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAccessKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAccessKeyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAliasRequest -type DeleteAccountAliasInput struct { - _ struct{} `type:"structure"` - - // The name of the account alias to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of lowercase letters, digits, and dashes. - // You cannot start or finish with a dash, nor can you have two dashes in a - // row. - // - // AccountAlias is a required field - AccountAlias *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAccountAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAccountAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAccountAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAccountAliasInput"} - if s.AccountAlias == nil { - invalidParams.Add(request.NewErrParamRequired("AccountAlias")) - } - if s.AccountAlias != nil && len(*s.AccountAlias) < 3 { - invalidParams.Add(request.NewErrParamMinLen("AccountAlias", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountAlias sets the AccountAlias field's value. -func (s *DeleteAccountAliasInput) SetAccountAlias(v string) *DeleteAccountAliasInput { - s.AccountAlias = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAliasOutput -type DeleteAccountAliasOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAccountAliasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAccountAliasOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicyInput -type DeleteAccountPasswordPolicyInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAccountPasswordPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAccountPasswordPolicyInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicyOutput -type DeleteAccountPasswordPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAccountPasswordPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAccountPasswordPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupRequest -type DeleteGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the IAM group to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *DeleteGroupInput) SetGroupName(v string) *DeleteGroupInput { - s.GroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupOutput -type DeleteGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicyRequest -type DeleteGroupPolicyInput struct { - _ struct{} `type:"structure"` - - // The name (friendly name, not ARN) identifying the group that the policy is - // embedded in. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The name identifying the policy document to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteGroupPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGroupPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGroupPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGroupPolicyInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *DeleteGroupPolicyInput) SetGroupName(v string) *DeleteGroupPolicyInput { - s.GroupName = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *DeleteGroupPolicyInput) SetPolicyName(v string) *DeleteGroupPolicyInput { - s.PolicyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicyOutput -type DeleteGroupPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteGroupPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGroupPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfileRequest -type DeleteInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The name of the instance profile to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // InstanceProfileName is a required field - InstanceProfileName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInstanceProfileInput"} - if s.InstanceProfileName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) - } - if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceProfileName sets the InstanceProfileName field's value. -func (s *DeleteInstanceProfileInput) SetInstanceProfileName(v string) *DeleteInstanceProfileInput { - s.InstanceProfileName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfileOutput -type DeleteInstanceProfileOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceProfileOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfileRequest -type DeleteLoginProfileInput struct { - _ struct{} `type:"structure"` - - // The name of the user whose password you want to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLoginProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoginProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLoginProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLoginProfileInput"} - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUserName sets the UserName field's value. -func (s *DeleteLoginProfileInput) SetUserName(v string) *DeleteLoginProfileInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfileOutput -type DeleteLoginProfileOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLoginProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLoginProfileOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProviderRequest -type DeleteOpenIDConnectProviderInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM OpenID Connect provider resource - // object to delete. You can get a list of OpenID Connect provider resource - // ARNs by using the ListOpenIDConnectProviders action. - // - // OpenIDConnectProviderArn is a required field - OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteOpenIDConnectProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteOpenIDConnectProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteOpenIDConnectProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteOpenIDConnectProviderInput"} - if s.OpenIDConnectProviderArn == nil { - invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) - } - if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. -func (s *DeleteOpenIDConnectProviderInput) SetOpenIDConnectProviderArn(v string) *DeleteOpenIDConnectProviderInput { - s.OpenIDConnectProviderArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProviderOutput -type DeleteOpenIDConnectProviderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteOpenIDConnectProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteOpenIDConnectProviderOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyRequest -type DeletePolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM policy you want to delete. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePolicyInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *DeletePolicyInput) SetPolicyArn(v string) *DeletePolicyInput { - s.PolicyArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyOutput -type DeletePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeletePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersionRequest -type DeletePolicyVersionInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM policy from which you want to delete - // a version. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` - - // The policy version to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that consists of the lowercase letter 'v' followed - // by one or two digits, and optionally followed by a period '.' and a string - // of letters and digits. - // - // For more information about managed policy versions, see Versioning for Managed - // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) - // in the IAM User Guide. - // - // VersionId is a required field - VersionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePolicyVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePolicyVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePolicyVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePolicyVersionInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - if s.VersionId == nil { - invalidParams.Add(request.NewErrParamRequired("VersionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *DeletePolicyVersionInput) SetPolicyArn(v string) *DeletePolicyVersionInput { - s.PolicyArn = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeletePolicyVersionInput) SetVersionId(v string) *DeletePolicyVersionInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersionOutput -type DeletePolicyVersionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeletePolicyVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePolicyVersionOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRoleRequest -type DeleteRoleInput struct { - _ struct{} `type:"structure"` - - // The name of the role to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRoleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRoleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRoleInput"} - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRoleName sets the RoleName field's value. -func (s *DeleteRoleInput) SetRoleName(v string) *DeleteRoleInput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRoleOutput -type DeleteRoleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRoleOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicyRequest -type DeleteRolePolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the inline policy to delete from the specified IAM role. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The name (friendly name, not ARN) identifying the role that the policy is - // embedded in. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRolePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRolePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRolePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRolePolicyInput"} - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyName sets the PolicyName field's value. -func (s *DeleteRolePolicyInput) SetPolicyName(v string) *DeleteRolePolicyInput { - s.PolicyName = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *DeleteRolePolicyInput) SetRoleName(v string) *DeleteRolePolicyInput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicyOutput -type DeleteRolePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRolePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRolePolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProviderRequest -type DeleteSAMLProviderInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the SAML provider to delete. - // - // SAMLProviderArn is a required field - SAMLProviderArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSAMLProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSAMLProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSAMLProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSAMLProviderInput"} - if s.SAMLProviderArn == nil { - invalidParams.Add(request.NewErrParamRequired("SAMLProviderArn")) - } - if s.SAMLProviderArn != nil && len(*s.SAMLProviderArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("SAMLProviderArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSAMLProviderArn sets the SAMLProviderArn field's value. -func (s *DeleteSAMLProviderInput) SetSAMLProviderArn(v string) *DeleteSAMLProviderInput { - s.SAMLProviderArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProviderOutput -type DeleteSAMLProviderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSAMLProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSAMLProviderOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKeyRequest -type DeleteSSHPublicKeyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the SSH public key. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // SSHPublicKeyId is a required field - SSHPublicKeyId *string `min:"20" type:"string" required:"true"` - - // The name of the IAM user associated with the SSH public key. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSSHPublicKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSSHPublicKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSSHPublicKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSSHPublicKeyInput"} - if s.SSHPublicKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("SSHPublicKeyId")) - } - if s.SSHPublicKeyId != nil && len(*s.SSHPublicKeyId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("SSHPublicKeyId", 20)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. -func (s *DeleteSSHPublicKeyInput) SetSSHPublicKeyId(v string) *DeleteSSHPublicKeyInput { - s.SSHPublicKeyId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *DeleteSSHPublicKeyInput) SetUserName(v string) *DeleteSSHPublicKeyInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKeyOutput -type DeleteSSHPublicKeyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSSHPublicKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSSHPublicKeyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificateRequest -type DeleteServerCertificateInput struct { - _ struct{} `type:"structure"` - - // The name of the server certificate you want to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // ServerCertificateName is a required field - ServerCertificateName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteServerCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteServerCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServerCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServerCertificateInput"} - if s.ServerCertificateName == nil { - invalidParams.Add(request.NewErrParamRequired("ServerCertificateName")) - } - if s.ServerCertificateName != nil && len(*s.ServerCertificateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServerCertificateName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServerCertificateName sets the ServerCertificateName field's value. -func (s *DeleteServerCertificateInput) SetServerCertificateName(v string) *DeleteServerCertificateInput { - s.ServerCertificateName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificateOutput -type DeleteServerCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteServerCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteServerCertificateOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredentialRequest -type DeleteServiceSpecificCredentialInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the service-specific credential. You can get this - // value by calling ListServiceSpecificCredentials. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // ServiceSpecificCredentialId is a required field - ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` - - // The name of the IAM user associated with the service-specific credential. - // If this value is not specified, then the operation assumes the user whose - // credentials are used to call the operation. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteServiceSpecificCredentialInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteServiceSpecificCredentialInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServiceSpecificCredentialInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServiceSpecificCredentialInput"} - if s.ServiceSpecificCredentialId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceSpecificCredentialId")) - } - if s.ServiceSpecificCredentialId != nil && len(*s.ServiceSpecificCredentialId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ServiceSpecificCredentialId", 20)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. -func (s *DeleteServiceSpecificCredentialInput) SetServiceSpecificCredentialId(v string) *DeleteServiceSpecificCredentialInput { - s.ServiceSpecificCredentialId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *DeleteServiceSpecificCredentialInput) SetUserName(v string) *DeleteServiceSpecificCredentialInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredentialOutput -type DeleteServiceSpecificCredentialOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteServiceSpecificCredentialOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteServiceSpecificCredentialOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificateRequest -type DeleteSigningCertificateInput struct { - _ struct{} `type:"structure"` - - // The ID of the signing certificate to delete. - // - // The format of this parameter, as described by its regex (http://wikipedia.org/wiki/regex) - // pattern, is a string of characters that can be upper- or lower-cased letters - // or digits. - // - // CertificateId is a required field - CertificateId *string `min:"24" type:"string" required:"true"` - - // The name of the user the signing certificate belongs to. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteSigningCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSigningCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSigningCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSigningCertificateInput"} - if s.CertificateId == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateId")) - } - if s.CertificateId != nil && len(*s.CertificateId) < 24 { - invalidParams.Add(request.NewErrParamMinLen("CertificateId", 24)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateId sets the CertificateId field's value. -func (s *DeleteSigningCertificateInput) SetCertificateId(v string) *DeleteSigningCertificateInput { - s.CertificateId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *DeleteSigningCertificateInput) SetUserName(v string) *DeleteSigningCertificateInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificateOutput -type DeleteSigningCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSigningCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSigningCertificateOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserRequest -type DeleteUserInput struct { - _ struct{} `type:"structure"` - - // The name of the user to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteUserInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUserInput"} - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUserName sets the UserName field's value. -func (s *DeleteUserInput) SetUserName(v string) *DeleteUserInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserOutput -type DeleteUserOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteUserOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUserOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicyRequest -type DeleteUserPolicyInput struct { - _ struct{} `type:"structure"` - - // The name identifying the policy document to delete. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The name (friendly name, not ARN) identifying the user that the policy is - // embedded in. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteUserPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUserPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUserPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUserPolicyInput"} - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyName sets the PolicyName field's value. -func (s *DeleteUserPolicyInput) SetPolicyName(v string) *DeleteUserPolicyInput { - s.PolicyName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *DeleteUserPolicyInput) SetUserName(v string) *DeleteUserPolicyInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicyOutput -type DeleteUserPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteUserPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUserPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADeviceRequest -type DeleteVirtualMFADeviceInput struct { - _ struct{} `type:"structure"` - - // The serial number that uniquely identifies the MFA device. For virtual MFA - // devices, the serial number is the same as the ARN. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =/:,.@- - // - // SerialNumber is a required field - SerialNumber *string `min:"9" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVirtualMFADeviceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVirtualMFADeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVirtualMFADeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVirtualMFADeviceInput"} - if s.SerialNumber == nil { - invalidParams.Add(request.NewErrParamRequired("SerialNumber")) - } - if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { - invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *DeleteVirtualMFADeviceInput) SetSerialNumber(v string) *DeleteVirtualMFADeviceInput { - s.SerialNumber = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADeviceOutput -type DeleteVirtualMFADeviceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVirtualMFADeviceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVirtualMFADeviceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicyRequest -type DetachGroupPolicyInput struct { - _ struct{} `type:"structure"` - - // The name (friendly name, not ARN) of the IAM group to detach the policy from. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM policy you want to detach. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachGroupPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachGroupPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachGroupPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachGroupPolicyInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *DetachGroupPolicyInput) SetGroupName(v string) *DetachGroupPolicyInput { - s.GroupName = &v - return s -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *DetachGroupPolicyInput) SetPolicyArn(v string) *DetachGroupPolicyInput { - s.PolicyArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicyOutput -type DetachGroupPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachGroupPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachGroupPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicyRequest -type DetachRolePolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM policy you want to detach. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` - - // The name (friendly name, not ARN) of the IAM role to detach the policy from. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachRolePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachRolePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachRolePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachRolePolicyInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *DetachRolePolicyInput) SetPolicyArn(v string) *DetachRolePolicyInput { - s.PolicyArn = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *DetachRolePolicyInput) SetRoleName(v string) *DetachRolePolicyInput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicyOutput -type DetachRolePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachRolePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachRolePolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicyRequest -type DetachUserPolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM policy you want to detach. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` - - // The name (friendly name, not ARN) of the IAM user to detach the policy from. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachUserPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachUserPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachUserPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachUserPolicyInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *DetachUserPolicyInput) SetPolicyArn(v string) *DetachUserPolicyInput { - s.PolicyArn = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *DetachUserPolicyInput) SetUserName(v string) *DetachUserPolicyInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicyOutput -type DetachUserPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachUserPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachUserPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADeviceRequest -type EnableMFADeviceInput struct { - _ struct{} `type:"structure"` - - // An authentication code emitted by the device. - // - // The format for this parameter is a string of 6 digits. - // - // AuthenticationCode1 is a required field - AuthenticationCode1 *string `min:"6" type:"string" required:"true"` - - // A subsequent authentication code emitted by the device. - // - // The format for this parameter is a string of 6 digits. - // - // AuthenticationCode2 is a required field - AuthenticationCode2 *string `min:"6" type:"string" required:"true"` - - // The serial number that uniquely identifies the MFA device. For virtual MFA - // devices, the serial number is the device ARN. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =/:,.@- - // - // SerialNumber is a required field - SerialNumber *string `min:"9" type:"string" required:"true"` - - // The name of the IAM user for whom you want to enable the MFA device. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableMFADeviceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableMFADeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableMFADeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableMFADeviceInput"} - if s.AuthenticationCode1 == nil { - invalidParams.Add(request.NewErrParamRequired("AuthenticationCode1")) - } - if s.AuthenticationCode1 != nil && len(*s.AuthenticationCode1) < 6 { - invalidParams.Add(request.NewErrParamMinLen("AuthenticationCode1", 6)) - } - if s.AuthenticationCode2 == nil { - invalidParams.Add(request.NewErrParamRequired("AuthenticationCode2")) - } - if s.AuthenticationCode2 != nil && len(*s.AuthenticationCode2) < 6 { - invalidParams.Add(request.NewErrParamMinLen("AuthenticationCode2", 6)) - } - if s.SerialNumber == nil { - invalidParams.Add(request.NewErrParamRequired("SerialNumber")) - } - if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { - invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthenticationCode1 sets the AuthenticationCode1 field's value. -func (s *EnableMFADeviceInput) SetAuthenticationCode1(v string) *EnableMFADeviceInput { - s.AuthenticationCode1 = &v - return s -} - -// SetAuthenticationCode2 sets the AuthenticationCode2 field's value. -func (s *EnableMFADeviceInput) SetAuthenticationCode2(v string) *EnableMFADeviceInput { - s.AuthenticationCode2 = &v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *EnableMFADeviceInput) SetSerialNumber(v string) *EnableMFADeviceInput { - s.SerialNumber = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *EnableMFADeviceInput) SetUserName(v string) *EnableMFADeviceInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADeviceOutput -type EnableMFADeviceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableMFADeviceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableMFADeviceOutput) GoString() string { - return s.String() -} - -// Contains the results of a simulation. -// -// This data type is used by the return parameter of SimulateCustomPolicy and -// SimulatePrincipalPolicy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EvaluationResult -type EvaluationResult struct { - _ struct{} `type:"structure"` - - // The name of the API action tested on the indicated resource. - // - // EvalActionName is a required field - EvalActionName *string `min:"3" type:"string" required:"true"` - - // The result of the simulation. - // - // EvalDecision is a required field - EvalDecision *string `type:"string" required:"true" enum:"PolicyEvaluationDecisionType"` - - // Additional details about the results of the evaluation decision. When there - // are both IAM policies and resource policies, this parameter explains how - // each set of policies contributes to the final evaluation decision. When simulating - // cross-account access to a resource, both the resource-based policy and the - // caller's IAM policy must grant access. See How IAM Roles Differ from Resource-based - // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) - EvalDecisionDetails map[string]*string `type:"map"` - - // The ARN of the resource that the indicated API action was tested on. - EvalResourceName *string `min:"1" type:"string"` - - // A list of the statements in the input policies that determine the result - // for this scenario. Remember that even if multiple statements allow the action - // on the resource, if only one statement denies that action, then the explicit - // deny overrides any allow, and the deny statement is the only entry included - // in the result. - MatchedStatements []*Statement `type:"list"` - - // A list of context keys that are required by the included input policies but - // that were not provided by one of the input parameters. This list is used - // when the resource in a simulation is "*", either explicitly, or when the - // ResourceArns parameter blank. If you include a list of resources, then any - // missing context values are instead included under the ResourceSpecificResults - // section. To discover the context keys used by a set of policies, you can - // call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy. - MissingContextValues []*string `type:"list"` - - // A structure that details how AWS Organizations and its service control policies - // affect the results of the simulation. Only applies if the simulated user's - // account is part of an organization. - OrganizationsDecisionDetail *OrganizationsDecisionDetail `type:"structure"` - - // The individual results of the simulation of the API action specified in EvalActionName - // on each resource. - ResourceSpecificResults []*ResourceSpecificResult `type:"list"` -} - -// String returns the string representation -func (s EvaluationResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EvaluationResult) GoString() string { - return s.String() -} - -// SetEvalActionName sets the EvalActionName field's value. -func (s *EvaluationResult) SetEvalActionName(v string) *EvaluationResult { - s.EvalActionName = &v - return s -} - -// SetEvalDecision sets the EvalDecision field's value. -func (s *EvaluationResult) SetEvalDecision(v string) *EvaluationResult { - s.EvalDecision = &v - return s -} - -// SetEvalDecisionDetails sets the EvalDecisionDetails field's value. -func (s *EvaluationResult) SetEvalDecisionDetails(v map[string]*string) *EvaluationResult { - s.EvalDecisionDetails = v - return s -} - -// SetEvalResourceName sets the EvalResourceName field's value. -func (s *EvaluationResult) SetEvalResourceName(v string) *EvaluationResult { - s.EvalResourceName = &v - return s -} - -// SetMatchedStatements sets the MatchedStatements field's value. -func (s *EvaluationResult) SetMatchedStatements(v []*Statement) *EvaluationResult { - s.MatchedStatements = v - return s -} - -// SetMissingContextValues sets the MissingContextValues field's value. -func (s *EvaluationResult) SetMissingContextValues(v []*string) *EvaluationResult { - s.MissingContextValues = v - return s -} - -// SetOrganizationsDecisionDetail sets the OrganizationsDecisionDetail field's value. -func (s *EvaluationResult) SetOrganizationsDecisionDetail(v *OrganizationsDecisionDetail) *EvaluationResult { - s.OrganizationsDecisionDetail = v - return s -} - -// SetResourceSpecificResults sets the ResourceSpecificResults field's value. -func (s *EvaluationResult) SetResourceSpecificResults(v []*ResourceSpecificResult) *EvaluationResult { - s.ResourceSpecificResults = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReportInput -type GenerateCredentialReportInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GenerateCredentialReportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateCredentialReportInput) GoString() string { - return s.String() -} - -// Contains the response to a successful GenerateCredentialReport request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReportResponse -type GenerateCredentialReportOutput struct { - _ struct{} `type:"structure"` - - // Information about the credential report. - Description *string `type:"string"` - - // Information about the state of the credential report. - State *string `type:"string" enum:"ReportStateType"` -} - -// String returns the string representation -func (s GenerateCredentialReportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateCredentialReportOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *GenerateCredentialReportOutput) SetDescription(v string) *GenerateCredentialReportOutput { - s.Description = &v - return s -} - -// SetState sets the State field's value. -func (s *GenerateCredentialReportOutput) SetState(v string) *GenerateCredentialReportOutput { - s.State = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsedRequest -type GetAccessKeyLastUsedInput struct { - _ struct{} `type:"structure"` - - // The identifier of an access key. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // AccessKeyId is a required field - AccessKeyId *string `min:"16" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetAccessKeyLastUsedInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccessKeyLastUsedInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAccessKeyLastUsedInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAccessKeyLastUsedInput"} - 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 *GetAccessKeyLastUsedInput) SetAccessKeyId(v string) *GetAccessKeyLastUsedInput { - s.AccessKeyId = &v - return s -} - -// Contains the response to a successful GetAccessKeyLastUsed request. It is -// also returned as a member of the AccessKeyMetaData structure returned by -// the ListAccessKeys action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsedResponse -type GetAccessKeyLastUsedOutput struct { - _ struct{} `type:"structure"` - - // Contains information about the last time the access key was used. - AccessKeyLastUsed *AccessKeyLastUsed `type:"structure"` - - // The name of the AWS IAM user that owns this access key. - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetAccessKeyLastUsedOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccessKeyLastUsedOutput) GoString() string { - return s.String() -} - -// SetAccessKeyLastUsed sets the AccessKeyLastUsed field's value. -func (s *GetAccessKeyLastUsedOutput) SetAccessKeyLastUsed(v *AccessKeyLastUsed) *GetAccessKeyLastUsedOutput { - s.AccessKeyLastUsed = v - return s -} - -// SetUserName sets the UserName field's value. -func (s *GetAccessKeyLastUsedOutput) SetUserName(v string) *GetAccessKeyLastUsedOutput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetailsRequest -type GetAccountAuthorizationDetailsInput struct { - _ struct{} `type:"structure"` - - // A list of entity types used to filter the results. Only the entities that - // match the types you specify are included in the output. Use the value LocalManagedPolicy - // to include customer managed policies. - // - // The format for this parameter is a comma-separated (if more than one) list - // of strings. Each string value in the list must be one of the valid values - // listed below. - Filter []*string `type:"list"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s GetAccountAuthorizationDetailsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountAuthorizationDetailsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAccountAuthorizationDetailsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAccountAuthorizationDetailsInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *GetAccountAuthorizationDetailsInput) SetFilter(v []*string) *GetAccountAuthorizationDetailsInput { - s.Filter = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *GetAccountAuthorizationDetailsInput) SetMarker(v string) *GetAccountAuthorizationDetailsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *GetAccountAuthorizationDetailsInput) SetMaxItems(v int64) *GetAccountAuthorizationDetailsInput { - s.MaxItems = &v - return s -} - -// Contains the response to a successful GetAccountAuthorizationDetails request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetailsResponse -type GetAccountAuthorizationDetailsOutput struct { - _ struct{} `type:"structure"` - - // A list containing information about IAM groups. - GroupDetailList []*GroupDetail `type:"list"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list containing information about managed policies. - Policies []*ManagedPolicyDetail `type:"list"` - - // A list containing information about IAM roles. - RoleDetailList []*RoleDetail `type:"list"` - - // A list containing information about IAM users. - UserDetailList []*UserDetail `type:"list"` -} - -// String returns the string representation -func (s GetAccountAuthorizationDetailsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountAuthorizationDetailsOutput) GoString() string { - return s.String() -} - -// SetGroupDetailList sets the GroupDetailList field's value. -func (s *GetAccountAuthorizationDetailsOutput) SetGroupDetailList(v []*GroupDetail) *GetAccountAuthorizationDetailsOutput { - s.GroupDetailList = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *GetAccountAuthorizationDetailsOutput) SetIsTruncated(v bool) *GetAccountAuthorizationDetailsOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *GetAccountAuthorizationDetailsOutput) SetMarker(v string) *GetAccountAuthorizationDetailsOutput { - s.Marker = &v - return s -} - -// SetPolicies sets the Policies field's value. -func (s *GetAccountAuthorizationDetailsOutput) SetPolicies(v []*ManagedPolicyDetail) *GetAccountAuthorizationDetailsOutput { - s.Policies = v - return s -} - -// SetRoleDetailList sets the RoleDetailList field's value. -func (s *GetAccountAuthorizationDetailsOutput) SetRoleDetailList(v []*RoleDetail) *GetAccountAuthorizationDetailsOutput { - s.RoleDetailList = v - return s -} - -// SetUserDetailList sets the UserDetailList field's value. -func (s *GetAccountAuthorizationDetailsOutput) SetUserDetailList(v []*UserDetail) *GetAccountAuthorizationDetailsOutput { - s.UserDetailList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicyInput -type GetAccountPasswordPolicyInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetAccountPasswordPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountPasswordPolicyInput) GoString() string { - return s.String() -} - -// Contains the response to a successful GetAccountPasswordPolicy request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicyResponse -type GetAccountPasswordPolicyOutput struct { - _ struct{} `type:"structure"` - - // Contains information about the account password policy. - // - // PasswordPolicy is a required field - PasswordPolicy *PasswordPolicy `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetAccountPasswordPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountPasswordPolicyOutput) GoString() string { - return s.String() -} - -// SetPasswordPolicy sets the PasswordPolicy field's value. -func (s *GetAccountPasswordPolicyOutput) SetPasswordPolicy(v *PasswordPolicy) *GetAccountPasswordPolicyOutput { - s.PasswordPolicy = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummaryInput -type GetAccountSummaryInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetAccountSummaryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountSummaryInput) GoString() string { - return s.String() -} - -// Contains the response to a successful GetAccountSummary request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummaryResponse -type GetAccountSummaryOutput struct { - _ struct{} `type:"structure"` - - // A set of key value pairs containing information about IAM entity usage and - // IAM quotas. - SummaryMap map[string]*int64 `type:"map"` -} - -// String returns the string representation -func (s GetAccountSummaryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountSummaryOutput) GoString() string { - return s.String() -} - -// SetSummaryMap sets the SummaryMap field's value. -func (s *GetAccountSummaryOutput) SetSummaryMap(v map[string]*int64) *GetAccountSummaryOutput { - s.SummaryMap = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForCustomPolicyRequest -type GetContextKeysForCustomPolicyInput struct { - _ struct{} `type:"structure"` - - // A list of policies for which you want the list of context keys referenced - // in those policies. Each document is specified as a string containing the - // complete, valid JSON text of an IAM policy. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PolicyInputList is a required field - PolicyInputList []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetContextKeysForCustomPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetContextKeysForCustomPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetContextKeysForCustomPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetContextKeysForCustomPolicyInput"} - if s.PolicyInputList == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyInputList")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyInputList sets the PolicyInputList field's value. -func (s *GetContextKeysForCustomPolicyInput) SetPolicyInputList(v []*string) *GetContextKeysForCustomPolicyInput { - s.PolicyInputList = v - return s -} - -// Contains the response to a successful GetContextKeysForPrincipalPolicy or -// GetContextKeysForCustomPolicy request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPolicyResponse -type GetContextKeysForPolicyResponse struct { - _ struct{} `type:"structure"` - - // The list of context keys that are referenced in the input policies. - ContextKeyNames []*string `type:"list"` -} - -// String returns the string representation -func (s GetContextKeysForPolicyResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetContextKeysForPolicyResponse) GoString() string { - return s.String() -} - -// SetContextKeyNames sets the ContextKeyNames field's value. -func (s *GetContextKeysForPolicyResponse) SetContextKeyNames(v []*string) *GetContextKeysForPolicyResponse { - s.ContextKeyNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPrincipalPolicyRequest -type GetContextKeysForPrincipalPolicyInput struct { - _ struct{} `type:"structure"` - - // An optional list of additional policies for which you want the list of context - // keys that are referenced. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - PolicyInputList []*string `type:"list"` - - // The ARN of a user, group, or role whose policies contain the context keys - // that you want listed. If you specify a user, the list includes context keys - // that are found in all policies attached to the user as well as to all groups - // that the user is a member of. If you pick a group or a role, then it includes - // only those context keys that are found in policies attached to that entity. - // Note that all parameters are shown in unencoded form here for clarity, but - // must be URL encoded to be included as a part of a real HTML request. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicySourceArn is a required field - PolicySourceArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetContextKeysForPrincipalPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetContextKeysForPrincipalPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetContextKeysForPrincipalPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetContextKeysForPrincipalPolicyInput"} - if s.PolicySourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicySourceArn")) - } - if s.PolicySourceArn != nil && len(*s.PolicySourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicySourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyInputList sets the PolicyInputList field's value. -func (s *GetContextKeysForPrincipalPolicyInput) SetPolicyInputList(v []*string) *GetContextKeysForPrincipalPolicyInput { - s.PolicyInputList = v - return s -} - -// SetPolicySourceArn sets the PolicySourceArn field's value. -func (s *GetContextKeysForPrincipalPolicyInput) SetPolicySourceArn(v string) *GetContextKeysForPrincipalPolicyInput { - s.PolicySourceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReportInput -type GetCredentialReportInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetCredentialReportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCredentialReportInput) GoString() string { - return s.String() -} - -// Contains the response to a successful GetCredentialReport request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReportResponse -type GetCredentialReportOutput struct { - _ struct{} `type:"structure"` - - // Contains the credential report. The report is Base64-encoded. - // - // Content is automatically base64 encoded/decoded by the SDK. - Content []byte `type:"blob"` - - // The date and time when the credential report was created, in ISO 8601 date-time - // format (http://www.iso.org/iso/iso8601). - GeneratedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The format (MIME type) of the credential report. - ReportFormat *string `type:"string" enum:"ReportFormatType"` -} - -// String returns the string representation -func (s GetCredentialReportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCredentialReportOutput) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *GetCredentialReportOutput) SetContent(v []byte) *GetCredentialReportOutput { - s.Content = v - return s -} - -// SetGeneratedTime sets the GeneratedTime field's value. -func (s *GetCredentialReportOutput) SetGeneratedTime(v time.Time) *GetCredentialReportOutput { - s.GeneratedTime = &v - return s -} - -// SetReportFormat sets the ReportFormat field's value. -func (s *GetCredentialReportOutput) SetReportFormat(v string) *GetCredentialReportOutput { - s.ReportFormat = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupRequest -type GetGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the group. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s GetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *GetGroupInput) SetGroupName(v string) *GetGroupInput { - s.GroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *GetGroupInput) SetMarker(v string) *GetGroupInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *GetGroupInput) SetMaxItems(v int64) *GetGroupInput { - s.MaxItems = &v - return s -} - -// Contains the response to a successful GetGroup request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupResponse -type GetGroupOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the group. - // - // Group is a required field - Group *Group `type:"structure" required:"true"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of users in the group. - // - // Users is a required field - Users []*User `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGroupOutput) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *GetGroupOutput) SetGroup(v *Group) *GetGroupOutput { - s.Group = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *GetGroupOutput) SetIsTruncated(v bool) *GetGroupOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *GetGroupOutput) SetMarker(v string) *GetGroupOutput { - s.Marker = &v - return s -} - -// SetUsers sets the Users field's value. -func (s *GetGroupOutput) SetUsers(v []*User) *GetGroupOutput { - s.Users = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicyRequest -type GetGroupPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the group the policy is associated with. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The name of the policy document to get. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetGroupPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGroupPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGroupPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGroupPolicyInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *GetGroupPolicyInput) SetGroupName(v string) *GetGroupPolicyInput { - s.GroupName = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *GetGroupPolicyInput) SetPolicyName(v string) *GetGroupPolicyInput { - s.PolicyName = &v - return s -} - -// Contains the response to a successful GetGroupPolicy request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicyResponse -type GetGroupPolicyOutput struct { - _ struct{} `type:"structure"` - - // The group the policy is associated with. - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The policy document. - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // The name of the policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetGroupPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGroupPolicyOutput) GoString() string { - return s.String() -} - -// SetGroupName sets the GroupName field's value. -func (s *GetGroupPolicyOutput) SetGroupName(v string) *GetGroupPolicyOutput { - s.GroupName = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *GetGroupPolicyOutput) SetPolicyDocument(v string) *GetGroupPolicyOutput { - s.PolicyDocument = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *GetGroupPolicyOutput) SetPolicyName(v string) *GetGroupPolicyOutput { - s.PolicyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfileRequest -type GetInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The name of the instance profile to get information about. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // InstanceProfileName is a required field - InstanceProfileName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInstanceProfileInput"} - if s.InstanceProfileName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) - } - if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceProfileName sets the InstanceProfileName field's value. -func (s *GetInstanceProfileInput) SetInstanceProfileName(v string) *GetInstanceProfileInput { - s.InstanceProfileName = &v - return s -} - -// Contains the response to a successful GetInstanceProfile request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfileResponse -type GetInstanceProfileOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the instance profile. - // - // InstanceProfile is a required field - InstanceProfile *InstanceProfile `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceProfileOutput) GoString() string { - return s.String() -} - -// SetInstanceProfile sets the InstanceProfile field's value. -func (s *GetInstanceProfileOutput) SetInstanceProfile(v *InstanceProfile) *GetInstanceProfileOutput { - s.InstanceProfile = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfileRequest -type GetLoginProfileInput struct { - _ struct{} `type:"structure"` - - // The name of the user whose login profile you want to retrieve. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetLoginProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetLoginProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetLoginProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetLoginProfileInput"} - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUserName sets the UserName field's value. -func (s *GetLoginProfileInput) SetUserName(v string) *GetLoginProfileInput { - s.UserName = &v - return s -} - -// Contains the response to a successful GetLoginProfile request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfileResponse -type GetLoginProfileOutput struct { - _ struct{} `type:"structure"` - - // A structure containing the user name and password create date for the user. - // - // LoginProfile is a required field - LoginProfile *LoginProfile `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetLoginProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetLoginProfileOutput) GoString() string { - return s.String() -} - -// SetLoginProfile sets the LoginProfile field's value. -func (s *GetLoginProfileOutput) SetLoginProfile(v *LoginProfile) *GetLoginProfileOutput { - s.LoginProfile = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProviderRequest -type GetOpenIDConnectProviderInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the OIDC provider resource object in IAM - // to get information for. You can get a list of OIDC provider resource ARNs - // by using the ListOpenIDConnectProviders action. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // OpenIDConnectProviderArn is a required field - OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetOpenIDConnectProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOpenIDConnectProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOpenIDConnectProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOpenIDConnectProviderInput"} - if s.OpenIDConnectProviderArn == nil { - invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) - } - if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. -func (s *GetOpenIDConnectProviderInput) SetOpenIDConnectProviderArn(v string) *GetOpenIDConnectProviderInput { - s.OpenIDConnectProviderArn = &v - return s -} - -// Contains the response to a successful GetOpenIDConnectProvider request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProviderResponse -type GetOpenIDConnectProviderOutput struct { - _ struct{} `type:"structure"` - - // A list of client IDs (also known as audiences) that are associated with the - // specified IAM OIDC provider resource object. For more information, see CreateOpenIDConnectProvider. - ClientIDList []*string `type:"list"` - - // The date and time when the IAM OIDC provider resource object was created - // in the AWS account. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A list of certificate thumbprints that are associated with the specified - // IAM OIDC provider resource object. For more information, see CreateOpenIDConnectProvider. - ThumbprintList []*string `type:"list"` - - // The URL that the IAM OIDC provider resource object is associated with. For - // more information, see CreateOpenIDConnectProvider. - Url *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetOpenIDConnectProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOpenIDConnectProviderOutput) GoString() string { - return s.String() -} - -// SetClientIDList sets the ClientIDList field's value. -func (s *GetOpenIDConnectProviderOutput) SetClientIDList(v []*string) *GetOpenIDConnectProviderOutput { - s.ClientIDList = v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *GetOpenIDConnectProviderOutput) SetCreateDate(v time.Time) *GetOpenIDConnectProviderOutput { - s.CreateDate = &v - return s -} - -// SetThumbprintList sets the ThumbprintList field's value. -func (s *GetOpenIDConnectProviderOutput) SetThumbprintList(v []*string) *GetOpenIDConnectProviderOutput { - s.ThumbprintList = v - return s -} - -// SetUrl sets the Url field's value. -func (s *GetOpenIDConnectProviderOutput) SetUrl(v string) *GetOpenIDConnectProviderOutput { - s.Url = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyRequest -type GetPolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the managed policy that you want information - // about. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPolicyInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *GetPolicyInput) SetPolicyArn(v string) *GetPolicyInput { - s.PolicyArn = &v - return s -} - -// Contains the response to a successful GetPolicy request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyResponse -type GetPolicyOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the policy. - Policy *Policy `type:"structure"` -} - -// String returns the string representation -func (s GetPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetPolicyOutput) SetPolicy(v *Policy) *GetPolicyOutput { - s.Policy = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersionRequest -type GetPolicyVersionInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the managed policy that you want information - // about. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` - - // Identifies the policy version to retrieve. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that consists of the lowercase letter 'v' followed - // by one or two digits, and optionally followed by a period '.' and a string - // of letters and digits. - // - // VersionId is a required field - VersionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPolicyVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPolicyVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPolicyVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPolicyVersionInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - if s.VersionId == nil { - invalidParams.Add(request.NewErrParamRequired("VersionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *GetPolicyVersionInput) SetPolicyArn(v string) *GetPolicyVersionInput { - s.PolicyArn = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetPolicyVersionInput) SetVersionId(v string) *GetPolicyVersionInput { - s.VersionId = &v - return s -} - -// Contains the response to a successful GetPolicyVersion request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersionResponse -type GetPolicyVersionOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the policy version. - PolicyVersion *PolicyVersion `type:"structure"` -} - -// String returns the string representation -func (s GetPolicyVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPolicyVersionOutput) GoString() string { - return s.String() -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *GetPolicyVersionOutput) SetPolicyVersion(v *PolicyVersion) *GetPolicyVersionOutput { - s.PolicyVersion = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRoleRequest -type GetRoleInput struct { - _ struct{} `type:"structure"` - - // The name of the IAM role to get information about. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRoleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRoleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRoleInput"} - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRoleName sets the RoleName field's value. -func (s *GetRoleInput) SetRoleName(v string) *GetRoleInput { - s.RoleName = &v - return s -} - -// Contains the response to a successful GetRole request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRoleResponse -type GetRoleOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the IAM role. - // - // Role is a required field - Role *Role `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRoleOutput) GoString() string { - return s.String() -} - -// SetRole sets the Role field's value. -func (s *GetRoleOutput) SetRole(v *Role) *GetRoleOutput { - s.Role = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicyRequest -type GetRolePolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the policy document to get. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The name of the role associated with the policy. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRolePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRolePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRolePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRolePolicyInput"} - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyName sets the PolicyName field's value. -func (s *GetRolePolicyInput) SetPolicyName(v string) *GetRolePolicyInput { - s.PolicyName = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *GetRolePolicyInput) SetRoleName(v string) *GetRolePolicyInput { - s.RoleName = &v - return s -} - -// Contains the response to a successful GetRolePolicy request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicyResponse -type GetRolePolicyOutput struct { - _ struct{} `type:"structure"` - - // The policy document. - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // The name of the policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The role the policy is associated with. - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRolePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRolePolicyOutput) GoString() string { - return s.String() -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *GetRolePolicyOutput) SetPolicyDocument(v string) *GetRolePolicyOutput { - s.PolicyDocument = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *GetRolePolicyOutput) SetPolicyName(v string) *GetRolePolicyOutput { - s.PolicyName = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *GetRolePolicyOutput) SetRoleName(v string) *GetRolePolicyOutput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProviderRequest -type GetSAMLProviderInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the SAML provider resource object in IAM - // to get information about. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // SAMLProviderArn is a required field - SAMLProviderArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSAMLProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSAMLProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSAMLProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSAMLProviderInput"} - if s.SAMLProviderArn == nil { - invalidParams.Add(request.NewErrParamRequired("SAMLProviderArn")) - } - if s.SAMLProviderArn != nil && len(*s.SAMLProviderArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("SAMLProviderArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSAMLProviderArn sets the SAMLProviderArn field's value. -func (s *GetSAMLProviderInput) SetSAMLProviderArn(v string) *GetSAMLProviderInput { - s.SAMLProviderArn = &v - return s -} - -// Contains the response to a successful GetSAMLProvider request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProviderResponse -type GetSAMLProviderOutput struct { - _ struct{} `type:"structure"` - - // The date and time when the SAML provider was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The XML metadata document that includes information about an identity provider. - SAMLMetadataDocument *string `min:"1000" type:"string"` - - // The expiration date and time for the SAML provider. - ValidUntil *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s GetSAMLProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSAMLProviderOutput) GoString() string { - return s.String() -} - -// SetCreateDate sets the CreateDate field's value. -func (s *GetSAMLProviderOutput) SetCreateDate(v time.Time) *GetSAMLProviderOutput { - s.CreateDate = &v - return s -} - -// SetSAMLMetadataDocument sets the SAMLMetadataDocument field's value. -func (s *GetSAMLProviderOutput) SetSAMLMetadataDocument(v string) *GetSAMLProviderOutput { - s.SAMLMetadataDocument = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *GetSAMLProviderOutput) SetValidUntil(v time.Time) *GetSAMLProviderOutput { - s.ValidUntil = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKeyRequest -type GetSSHPublicKeyInput struct { - _ struct{} `type:"structure"` - - // Specifies the public key encoding format to use in the response. To retrieve - // the public key in ssh-rsa format, use SSH. To retrieve the public key in - // PEM format, use PEM. - // - // Encoding is a required field - Encoding *string `type:"string" required:"true" enum:"encodingType"` - - // The unique identifier for the SSH public key. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // SSHPublicKeyId is a required field - SSHPublicKeyId *string `min:"20" type:"string" required:"true"` - - // The name of the IAM user associated with the SSH public key. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSSHPublicKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSSHPublicKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSSHPublicKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSSHPublicKeyInput"} - if s.Encoding == nil { - invalidParams.Add(request.NewErrParamRequired("Encoding")) - } - if s.SSHPublicKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("SSHPublicKeyId")) - } - if s.SSHPublicKeyId != nil && len(*s.SSHPublicKeyId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("SSHPublicKeyId", 20)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncoding sets the Encoding field's value. -func (s *GetSSHPublicKeyInput) SetEncoding(v string) *GetSSHPublicKeyInput { - s.Encoding = &v - return s -} - -// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. -func (s *GetSSHPublicKeyInput) SetSSHPublicKeyId(v string) *GetSSHPublicKeyInput { - s.SSHPublicKeyId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *GetSSHPublicKeyInput) SetUserName(v string) *GetSSHPublicKeyInput { - s.UserName = &v - return s -} - -// Contains the response to a successful GetSSHPublicKey request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKeyResponse -type GetSSHPublicKeyOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the SSH public key. - SSHPublicKey *SSHPublicKey `type:"structure"` -} - -// String returns the string representation -func (s GetSSHPublicKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSSHPublicKeyOutput) GoString() string { - return s.String() -} - -// SetSSHPublicKey sets the SSHPublicKey field's value. -func (s *GetSSHPublicKeyOutput) SetSSHPublicKey(v *SSHPublicKey) *GetSSHPublicKeyOutput { - s.SSHPublicKey = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificateRequest -type GetServerCertificateInput struct { - _ struct{} `type:"structure"` - - // The name of the server certificate you want to retrieve information about. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // ServerCertificateName is a required field - ServerCertificateName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetServerCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetServerCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetServerCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetServerCertificateInput"} - if s.ServerCertificateName == nil { - invalidParams.Add(request.NewErrParamRequired("ServerCertificateName")) - } - if s.ServerCertificateName != nil && len(*s.ServerCertificateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServerCertificateName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServerCertificateName sets the ServerCertificateName field's value. -func (s *GetServerCertificateInput) SetServerCertificateName(v string) *GetServerCertificateInput { - s.ServerCertificateName = &v - return s -} - -// Contains the response to a successful GetServerCertificate request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificateResponse -type GetServerCertificateOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the server certificate. - // - // ServerCertificate is a required field - ServerCertificate *ServerCertificate `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetServerCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetServerCertificateOutput) GoString() string { - return s.String() -} - -// SetServerCertificate sets the ServerCertificate field's value. -func (s *GetServerCertificateOutput) SetServerCertificate(v *ServerCertificate) *GetServerCertificateOutput { - s.ServerCertificate = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserRequest -type GetUserInput struct { - _ struct{} `type:"structure"` - - // The name of the user to get information about. - // - // This parameter is optional. If it is not included, it defaults to the user - // making the request. This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetUserInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUserInput"} - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUserName sets the UserName field's value. -func (s *GetUserInput) SetUserName(v string) *GetUserInput { - s.UserName = &v - return s -} - -// Contains the response to a successful GetUser request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserResponse -type GetUserOutput struct { - _ struct{} `type:"structure"` - - // A structure containing details about the IAM user. - // - // User is a required field - User *User `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetUserOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUserOutput) GoString() string { - return s.String() -} - -// SetUser sets the User field's value. -func (s *GetUserOutput) SetUser(v *User) *GetUserOutput { - s.User = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicyRequest -type GetUserPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the policy document to get. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The name of the user who the policy is associated with. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetUserPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUserPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUserPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUserPolicyInput"} - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyName sets the PolicyName field's value. -func (s *GetUserPolicyInput) SetPolicyName(v string) *GetUserPolicyInput { - s.PolicyName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *GetUserPolicyInput) SetUserName(v string) *GetUserPolicyInput { - s.UserName = &v - return s -} - -// Contains the response to a successful GetUserPolicy request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicyResponse -type GetUserPolicyOutput struct { - _ struct{} `type:"structure"` - - // The policy document. - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // The name of the policy. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The user the policy is associated with. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetUserPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetUserPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *GetUserPolicyOutput) SetPolicyDocument(v string) *GetUserPolicyOutput { - s.PolicyDocument = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *GetUserPolicyOutput) SetPolicyName(v string) *GetUserPolicyOutput { - s.PolicyName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *GetUserPolicyOutput) SetUserName(v string) *GetUserPolicyOutput { - s.UserName = &v - return s -} - -// Contains information about an IAM group entity. -// -// This data type is used as a response element in the following actions: -// -// * CreateGroup -// -// * GetGroup -// -// * ListGroups -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/Group -type Group struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) specifying the group. For more information - // about ARNs and how to use them in policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Arn is a required field - Arn *string `min:"20" type:"string" required:"true"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the group was created. - // - // CreateDate is a required field - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The stable and unique string identifying the group. For more information - // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // GroupId is a required field - GroupId *string `min:"16" type:"string" required:"true"` - - // The friendly name that identifies the group. - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The path to the group. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Path is a required field - Path *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s Group) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Group) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Group) SetArn(v string) *Group { - s.Arn = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *Group) SetCreateDate(v time.Time) *Group { - s.CreateDate = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *Group) SetGroupId(v string) *Group { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *Group) SetGroupName(v string) *Group { - s.GroupName = &v - return s -} - -// SetPath sets the Path field's value. -func (s *Group) SetPath(v string) *Group { - s.Path = &v - return s -} - -// Contains information about an IAM group, including all of the group's policies. -// -// This data type is used as a response element in the GetAccountAuthorizationDetails -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GroupDetail -type GroupDetail struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. - // - // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - Arn *string `min:"20" type:"string"` - - // A list of the managed policies attached to the group. - AttachedManagedPolicies []*AttachedPolicy `type:"list"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the group was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The stable and unique string identifying the group. For more information - // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - GroupId *string `min:"16" type:"string"` - - // The friendly name that identifies the group. - GroupName *string `min:"1" type:"string"` - - // A list of the inline policies embedded in the group. - GroupPolicyList []*PolicyDetail `type:"list"` - - // The path to the group. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - Path *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GroupDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GroupDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GroupDetail) SetArn(v string) *GroupDetail { - s.Arn = &v - return s -} - -// SetAttachedManagedPolicies sets the AttachedManagedPolicies field's value. -func (s *GroupDetail) SetAttachedManagedPolicies(v []*AttachedPolicy) *GroupDetail { - s.AttachedManagedPolicies = v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *GroupDetail) SetCreateDate(v time.Time) *GroupDetail { - s.CreateDate = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *GroupDetail) SetGroupId(v string) *GroupDetail { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GroupDetail) SetGroupName(v string) *GroupDetail { - s.GroupName = &v - return s -} - -// SetGroupPolicyList sets the GroupPolicyList field's value. -func (s *GroupDetail) SetGroupPolicyList(v []*PolicyDetail) *GroupDetail { - s.GroupPolicyList = v - return s -} - -// SetPath sets the Path field's value. -func (s *GroupDetail) SetPath(v string) *GroupDetail { - s.Path = &v - return s -} - -// Contains information about an instance profile. -// -// This data type is used as a response element in the following actions: -// -// * CreateInstanceProfile -// -// * GetInstanceProfile -// -// * ListInstanceProfiles -// -// * ListInstanceProfilesForRole -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/InstanceProfile -type InstanceProfile struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) specifying the instance profile. For more - // information about ARNs and how to use them in policies, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Arn is a required field - Arn *string `min:"20" type:"string" required:"true"` - - // The date when the instance profile was created. - // - // CreateDate is a required field - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The stable and unique string identifying the instance profile. For more information - // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // InstanceProfileId is a required field - InstanceProfileId *string `min:"16" type:"string" required:"true"` - - // The name identifying the instance profile. - // - // InstanceProfileName is a required field - InstanceProfileName *string `min:"1" type:"string" required:"true"` - - // The path to the instance profile. For more information about paths, see IAM - // Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Path is a required field - Path *string `min:"1" type:"string" required:"true"` - - // The role associated with the instance profile. - // - // Roles is a required field - Roles []*Role `type:"list" required:"true"` -} - -// String returns the string representation -func (s InstanceProfile) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceProfile) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *InstanceProfile) SetArn(v string) *InstanceProfile { - s.Arn = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *InstanceProfile) SetCreateDate(v time.Time) *InstanceProfile { - s.CreateDate = &v - return s -} - -// SetInstanceProfileId sets the InstanceProfileId field's value. -func (s *InstanceProfile) SetInstanceProfileId(v string) *InstanceProfile { - s.InstanceProfileId = &v - return s -} - -// SetInstanceProfileName sets the InstanceProfileName field's value. -func (s *InstanceProfile) SetInstanceProfileName(v string) *InstanceProfile { - s.InstanceProfileName = &v - return s -} - -// SetPath sets the Path field's value. -func (s *InstanceProfile) SetPath(v string) *InstanceProfile { - s.Path = &v - return s -} - -// SetRoles sets the Roles field's value. -func (s *InstanceProfile) SetRoles(v []*Role) *InstanceProfile { - s.Roles = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeysRequest -type ListAccessKeysInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The name of the user. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAccessKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAccessKeysInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAccessKeysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAccessKeysInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListAccessKeysInput) SetMarker(v string) *ListAccessKeysInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListAccessKeysInput) SetMaxItems(v int64) *ListAccessKeysInput { - s.MaxItems = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListAccessKeysInput) SetUserName(v string) *ListAccessKeysInput { - s.UserName = &v - return s -} - -// Contains the response to a successful ListAccessKeys request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeysResponse -type ListAccessKeysOutput struct { - _ struct{} `type:"structure"` - - // A list of objects containing metadata about the access keys. - // - // AccessKeyMetadata is a required field - AccessKeyMetadata []*AccessKeyMetadata `type:"list" required:"true"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAccessKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAccessKeysOutput) GoString() string { - return s.String() -} - -// SetAccessKeyMetadata sets the AccessKeyMetadata field's value. -func (s *ListAccessKeysOutput) SetAccessKeyMetadata(v []*AccessKeyMetadata) *ListAccessKeysOutput { - s.AccessKeyMetadata = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListAccessKeysOutput) SetIsTruncated(v bool) *ListAccessKeysOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListAccessKeysOutput) SetMarker(v string) *ListAccessKeysOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliasesRequest -type ListAccountAliasesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListAccountAliasesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAccountAliasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAccountAliasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAccountAliasesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListAccountAliasesInput) SetMarker(v string) *ListAccountAliasesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListAccountAliasesInput) SetMaxItems(v int64) *ListAccountAliasesInput { - s.MaxItems = &v - return s -} - -// Contains the response to a successful ListAccountAliases request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliasesResponse -type ListAccountAliasesOutput struct { - _ struct{} `type:"structure"` - - // A list of aliases associated with the account. AWS supports only one alias - // per account. - // - // AccountAliases is a required field - AccountAliases []*string `type:"list" required:"true"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAccountAliasesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAccountAliasesOutput) GoString() string { - return s.String() -} - -// SetAccountAliases sets the AccountAliases field's value. -func (s *ListAccountAliasesOutput) SetAccountAliases(v []*string) *ListAccountAliasesOutput { - s.AccountAliases = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListAccountAliasesOutput) SetIsTruncated(v bool) *ListAccountAliasesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListAccountAliasesOutput) SetMarker(v string) *ListAccountAliasesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPoliciesRequest -type ListAttachedGroupPoliciesInput struct { - _ struct{} `type:"structure"` - - // The name (friendly name, not ARN) of the group to list attached policies - // for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. This parameter is optional. If - // it is not included, it defaults to a slash (/), listing all policies. - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - PathPrefix *string `type:"string"` -} - -// String returns the string representation -func (s ListAttachedGroupPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttachedGroupPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAttachedGroupPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAttachedGroupPoliciesInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *ListAttachedGroupPoliciesInput) SetGroupName(v string) *ListAttachedGroupPoliciesInput { - s.GroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListAttachedGroupPoliciesInput) SetMarker(v string) *ListAttachedGroupPoliciesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListAttachedGroupPoliciesInput) SetMaxItems(v int64) *ListAttachedGroupPoliciesInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListAttachedGroupPoliciesInput) SetPathPrefix(v string) *ListAttachedGroupPoliciesInput { - s.PathPrefix = &v - return s -} - -// Contains the response to a successful ListAttachedGroupPolicies request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPoliciesResponse -type ListAttachedGroupPoliciesOutput struct { - _ struct{} `type:"structure"` - - // A list of the attached policies. - AttachedPolicies []*AttachedPolicy `type:"list"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAttachedGroupPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttachedGroupPoliciesOutput) GoString() string { - return s.String() -} - -// SetAttachedPolicies sets the AttachedPolicies field's value. -func (s *ListAttachedGroupPoliciesOutput) SetAttachedPolicies(v []*AttachedPolicy) *ListAttachedGroupPoliciesOutput { - s.AttachedPolicies = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListAttachedGroupPoliciesOutput) SetIsTruncated(v bool) *ListAttachedGroupPoliciesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListAttachedGroupPoliciesOutput) SetMarker(v string) *ListAttachedGroupPoliciesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePoliciesRequest -type ListAttachedRolePoliciesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. This parameter is optional. If - // it is not included, it defaults to a slash (/), listing all policies. - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - PathPrefix *string `type:"string"` - - // The name (friendly name, not ARN) of the role to list attached policies for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListAttachedRolePoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttachedRolePoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAttachedRolePoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAttachedRolePoliciesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListAttachedRolePoliciesInput) SetMarker(v string) *ListAttachedRolePoliciesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListAttachedRolePoliciesInput) SetMaxItems(v int64) *ListAttachedRolePoliciesInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListAttachedRolePoliciesInput) SetPathPrefix(v string) *ListAttachedRolePoliciesInput { - s.PathPrefix = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *ListAttachedRolePoliciesInput) SetRoleName(v string) *ListAttachedRolePoliciesInput { - s.RoleName = &v - return s -} - -// Contains the response to a successful ListAttachedRolePolicies request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePoliciesResponse -type ListAttachedRolePoliciesOutput struct { - _ struct{} `type:"structure"` - - // A list of the attached policies. - AttachedPolicies []*AttachedPolicy `type:"list"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAttachedRolePoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttachedRolePoliciesOutput) GoString() string { - return s.String() -} - -// SetAttachedPolicies sets the AttachedPolicies field's value. -func (s *ListAttachedRolePoliciesOutput) SetAttachedPolicies(v []*AttachedPolicy) *ListAttachedRolePoliciesOutput { - s.AttachedPolicies = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListAttachedRolePoliciesOutput) SetIsTruncated(v bool) *ListAttachedRolePoliciesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListAttachedRolePoliciesOutput) SetMarker(v string) *ListAttachedRolePoliciesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPoliciesRequest -type ListAttachedUserPoliciesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. This parameter is optional. If - // it is not included, it defaults to a slash (/), listing all policies. - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - PathPrefix *string `type:"string"` - - // The name (friendly name, not ARN) of the user to list attached policies for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListAttachedUserPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttachedUserPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAttachedUserPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAttachedUserPoliciesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListAttachedUserPoliciesInput) SetMarker(v string) *ListAttachedUserPoliciesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListAttachedUserPoliciesInput) SetMaxItems(v int64) *ListAttachedUserPoliciesInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListAttachedUserPoliciesInput) SetPathPrefix(v string) *ListAttachedUserPoliciesInput { - s.PathPrefix = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListAttachedUserPoliciesInput) SetUserName(v string) *ListAttachedUserPoliciesInput { - s.UserName = &v - return s -} - -// Contains the response to a successful ListAttachedUserPolicies request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPoliciesResponse -type ListAttachedUserPoliciesOutput struct { - _ struct{} `type:"structure"` - - // A list of the attached policies. - AttachedPolicies []*AttachedPolicy `type:"list"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAttachedUserPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttachedUserPoliciesOutput) GoString() string { - return s.String() -} - -// SetAttachedPolicies sets the AttachedPolicies field's value. -func (s *ListAttachedUserPoliciesOutput) SetAttachedPolicies(v []*AttachedPolicy) *ListAttachedUserPoliciesOutput { - s.AttachedPolicies = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListAttachedUserPoliciesOutput) SetIsTruncated(v bool) *ListAttachedUserPoliciesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListAttachedUserPoliciesOutput) SetMarker(v string) *ListAttachedUserPoliciesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicyRequest -type ListEntitiesForPolicyInput struct { - _ struct{} `type:"structure"` - - // The entity type to use for filtering the results. - // - // For example, when EntityFilter is Role, only the roles that are attached - // to the specified policy are returned. This parameter is optional. If it is - // not included, all attached entities (users, groups, and roles) are returned. - // The argument for this parameter must be one of the valid values listed below. - EntityFilter *string `type:"string" enum:"EntityType"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. This parameter is optional. If - // it is not included, it defaults to a slash (/), listing all entities. - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - PathPrefix *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the IAM policy for which you want the versions. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListEntitiesForPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListEntitiesForPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEntitiesForPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEntitiesForPolicyInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) - } - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntityFilter sets the EntityFilter field's value. -func (s *ListEntitiesForPolicyInput) SetEntityFilter(v string) *ListEntitiesForPolicyInput { - s.EntityFilter = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListEntitiesForPolicyInput) SetMarker(v string) *ListEntitiesForPolicyInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListEntitiesForPolicyInput) SetMaxItems(v int64) *ListEntitiesForPolicyInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListEntitiesForPolicyInput) SetPathPrefix(v string) *ListEntitiesForPolicyInput { - s.PathPrefix = &v - return s -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *ListEntitiesForPolicyInput) SetPolicyArn(v string) *ListEntitiesForPolicyInput { - s.PolicyArn = &v - return s -} - -// Contains the response to a successful ListEntitiesForPolicy request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicyResponse -type ListEntitiesForPolicyOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of IAM groups that the policy is attached to. - PolicyGroups []*PolicyGroup `type:"list"` - - // A list of IAM roles that the policy is attached to. - PolicyRoles []*PolicyRole `type:"list"` - - // A list of IAM users that the policy is attached to. - PolicyUsers []*PolicyUser `type:"list"` -} - -// String returns the string representation -func (s ListEntitiesForPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListEntitiesForPolicyOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListEntitiesForPolicyOutput) SetIsTruncated(v bool) *ListEntitiesForPolicyOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListEntitiesForPolicyOutput) SetMarker(v string) *ListEntitiesForPolicyOutput { - s.Marker = &v - return s -} - -// SetPolicyGroups sets the PolicyGroups field's value. -func (s *ListEntitiesForPolicyOutput) SetPolicyGroups(v []*PolicyGroup) *ListEntitiesForPolicyOutput { - s.PolicyGroups = v - return s -} - -// SetPolicyRoles sets the PolicyRoles field's value. -func (s *ListEntitiesForPolicyOutput) SetPolicyRoles(v []*PolicyRole) *ListEntitiesForPolicyOutput { - s.PolicyRoles = v - return s -} - -// SetPolicyUsers sets the PolicyUsers field's value. -func (s *ListEntitiesForPolicyOutput) SetPolicyUsers(v []*PolicyUser) *ListEntitiesForPolicyOutput { - s.PolicyUsers = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPoliciesRequest -type ListGroupPoliciesInput struct { - _ struct{} `type:"structure"` - - // The name of the group to list policies for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListGroupPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGroupPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGroupPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGroupPoliciesInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *ListGroupPoliciesInput) SetGroupName(v string) *ListGroupPoliciesInput { - s.GroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListGroupPoliciesInput) SetMarker(v string) *ListGroupPoliciesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListGroupPoliciesInput) SetMaxItems(v int64) *ListGroupPoliciesInput { - s.MaxItems = &v - return s -} - -// Contains the response to a successful ListGroupPolicies request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPoliciesResponse -type ListGroupPoliciesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of policy names. - // - // PolicyNames is a required field - PolicyNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListGroupPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGroupPoliciesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListGroupPoliciesOutput) SetIsTruncated(v bool) *ListGroupPoliciesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListGroupPoliciesOutput) SetMarker(v string) *ListGroupPoliciesOutput { - s.Marker = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *ListGroupPoliciesOutput) SetPolicyNames(v []*string) *ListGroupPoliciesOutput { - s.PolicyNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUserRequest -type ListGroupsForUserInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The name of the user to list groups for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListGroupsForUserInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGroupsForUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGroupsForUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGroupsForUserInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListGroupsForUserInput) SetMarker(v string) *ListGroupsForUserInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListGroupsForUserInput) SetMaxItems(v int64) *ListGroupsForUserInput { - s.MaxItems = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListGroupsForUserInput) SetUserName(v string) *ListGroupsForUserInput { - s.UserName = &v - return s -} - -// Contains the response to a successful ListGroupsForUser request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUserResponse -type ListGroupsForUserOutput struct { - _ struct{} `type:"structure"` - - // A list of groups. - // - // Groups is a required field - Groups []*Group `type:"list" required:"true"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListGroupsForUserOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGroupsForUserOutput) GoString() string { - return s.String() -} - -// SetGroups sets the Groups field's value. -func (s *ListGroupsForUserOutput) SetGroups(v []*Group) *ListGroupsForUserOutput { - s.Groups = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListGroupsForUserOutput) SetIsTruncated(v bool) *ListGroupsForUserOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListGroupsForUserOutput) SetMarker(v string) *ListGroupsForUserOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsRequest -type ListGroupsInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. For example, the prefix /division_abc/subdivision_xyz/ - // gets all groups whose path starts with /division_abc/subdivision_xyz/. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/), listing all groups. This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - PathPrefix *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGroupsInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListGroupsInput) SetMarker(v string) *ListGroupsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListGroupsInput) SetMaxItems(v int64) *ListGroupsInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListGroupsInput) SetPathPrefix(v string) *ListGroupsInput { - s.PathPrefix = &v - return s -} - -// Contains the response to a successful ListGroups request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsResponse -type ListGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of groups. - // - // Groups is a required field - Groups []*Group `type:"list" required:"true"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGroupsOutput) GoString() string { - return s.String() -} - -// SetGroups sets the Groups field's value. -func (s *ListGroupsOutput) SetGroups(v []*Group) *ListGroupsOutput { - s.Groups = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListGroupsOutput) SetIsTruncated(v bool) *ListGroupsOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListGroupsOutput) SetMarker(v string) *ListGroupsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRoleRequest -type ListInstanceProfilesForRoleInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The name of the role to list instance profiles for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListInstanceProfilesForRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstanceProfilesForRoleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInstanceProfilesForRoleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInstanceProfilesForRoleInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListInstanceProfilesForRoleInput) SetMarker(v string) *ListInstanceProfilesForRoleInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListInstanceProfilesForRoleInput) SetMaxItems(v int64) *ListInstanceProfilesForRoleInput { - s.MaxItems = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *ListInstanceProfilesForRoleInput) SetRoleName(v string) *ListInstanceProfilesForRoleInput { - s.RoleName = &v - return s -} - -// Contains the response to a successful ListInstanceProfilesForRole request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRoleResponse -type ListInstanceProfilesForRoleOutput struct { - _ struct{} `type:"structure"` - - // A list of instance profiles. - // - // InstanceProfiles is a required field - InstanceProfiles []*InstanceProfile `type:"list" required:"true"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListInstanceProfilesForRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstanceProfilesForRoleOutput) GoString() string { - return s.String() -} - -// SetInstanceProfiles sets the InstanceProfiles field's value. -func (s *ListInstanceProfilesForRoleOutput) SetInstanceProfiles(v []*InstanceProfile) *ListInstanceProfilesForRoleOutput { - s.InstanceProfiles = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListInstanceProfilesForRoleOutput) SetIsTruncated(v bool) *ListInstanceProfilesForRoleOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInstanceProfilesForRoleOutput) SetMarker(v string) *ListInstanceProfilesForRoleOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesRequest -type ListInstanceProfilesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ - // gets all instance profiles whose path starts with /application_abc/component_xyz/. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/), listing all instance profiles. This paramater allows (per its regex - // pattern (http://wikipedia.org/wiki/regex)) a string of characters consisting - // of either a forward slash (/) by itself or a string that must begin and end - // with forward slashes, containing any ASCII character from the ! (\u0021) - // thru the DEL character (\u007F), including most punctuation characters, digits, - // and upper and lowercased letters. - PathPrefix *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListInstanceProfilesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstanceProfilesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInstanceProfilesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInstanceProfilesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListInstanceProfilesInput) SetMarker(v string) *ListInstanceProfilesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListInstanceProfilesInput) SetMaxItems(v int64) *ListInstanceProfilesInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListInstanceProfilesInput) SetPathPrefix(v string) *ListInstanceProfilesInput { - s.PathPrefix = &v - return s -} - -// Contains the response to a successful ListInstanceProfiles request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesResponse -type ListInstanceProfilesOutput struct { - _ struct{} `type:"structure"` - - // A list of instance profiles. - // - // InstanceProfiles is a required field - InstanceProfiles []*InstanceProfile `type:"list" required:"true"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListInstanceProfilesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInstanceProfilesOutput) GoString() string { - return s.String() -} - -// SetInstanceProfiles sets the InstanceProfiles field's value. -func (s *ListInstanceProfilesOutput) SetInstanceProfiles(v []*InstanceProfile) *ListInstanceProfilesOutput { - s.InstanceProfiles = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListInstanceProfilesOutput) SetIsTruncated(v bool) *ListInstanceProfilesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInstanceProfilesOutput) SetMarker(v string) *ListInstanceProfilesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevicesRequest -type ListMFADevicesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The name of the user whose MFA devices you want to list. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListMFADevicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListMFADevicesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMFADevicesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMFADevicesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListMFADevicesInput) SetMarker(v string) *ListMFADevicesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListMFADevicesInput) SetMaxItems(v int64) *ListMFADevicesInput { - s.MaxItems = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListMFADevicesInput) SetUserName(v string) *ListMFADevicesInput { - s.UserName = &v - return s -} - -// Contains the response to a successful ListMFADevices request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevicesResponse -type ListMFADevicesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // A list of MFA devices. - // - // MFADevices is a required field - MFADevices []*MFADevice `type:"list" required:"true"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListMFADevicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListMFADevicesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListMFADevicesOutput) SetIsTruncated(v bool) *ListMFADevicesOutput { - s.IsTruncated = &v - return s -} - -// SetMFADevices sets the MFADevices field's value. -func (s *ListMFADevicesOutput) SetMFADevices(v []*MFADevice) *ListMFADevicesOutput { - s.MFADevices = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListMFADevicesOutput) SetMarker(v string) *ListMFADevicesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProvidersRequest -type ListOpenIDConnectProvidersInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ListOpenIDConnectProvidersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListOpenIDConnectProvidersInput) GoString() string { - return s.String() -} - -// Contains the response to a successful ListOpenIDConnectProviders request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProvidersResponse -type ListOpenIDConnectProvidersOutput struct { - _ struct{} `type:"structure"` - - // The list of IAM OIDC provider resource objects defined in the AWS account. - OpenIDConnectProviderList []*OpenIDConnectProviderListEntry `type:"list"` -} - -// String returns the string representation -func (s ListOpenIDConnectProvidersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListOpenIDConnectProvidersOutput) GoString() string { - return s.String() -} - -// SetOpenIDConnectProviderList sets the OpenIDConnectProviderList field's value. -func (s *ListOpenIDConnectProvidersOutput) SetOpenIDConnectProviderList(v []*OpenIDConnectProviderListEntry) *ListOpenIDConnectProvidersOutput { - s.OpenIDConnectProviderList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPoliciesRequest -type ListPoliciesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // A flag to filter the results to only the attached policies. - // - // When OnlyAttached is true, the returned list contains only the policies that - // are attached to an IAM user, group, or role. When OnlyAttached is false, - // or when the parameter is not included, all policies are returned. - OnlyAttached *bool `type:"boolean"` - - // The path prefix for filtering the results. This parameter is optional. If - // it is not included, it defaults to a slash (/), listing all policies. This - // paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - PathPrefix *string `type:"string"` - - // The scope to use for filtering the results. - // - // To list only AWS managed policies, set Scope to AWS. To list only the customer - // managed policies in your AWS account, set Scope to Local. - // - // This parameter is optional. If it is not included, or if it is set to All, - // all policies are returned. - Scope *string `type:"string" enum:"policyScopeType"` -} - -// String returns the string representation -func (s ListPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPoliciesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListPoliciesInput) SetMarker(v string) *ListPoliciesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListPoliciesInput) SetMaxItems(v int64) *ListPoliciesInput { - s.MaxItems = &v - return s -} - -// SetOnlyAttached sets the OnlyAttached field's value. -func (s *ListPoliciesInput) SetOnlyAttached(v bool) *ListPoliciesInput { - s.OnlyAttached = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListPoliciesInput) SetPathPrefix(v string) *ListPoliciesInput { - s.PathPrefix = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ListPoliciesInput) SetScope(v string) *ListPoliciesInput { - s.Scope = &v - return s -} - -// Contains the response to a successful ListPolicies request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPoliciesResponse -type ListPoliciesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of policies. - Policies []*Policy `type:"list"` -} - -// String returns the string representation -func (s ListPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPoliciesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListPoliciesOutput) SetIsTruncated(v bool) *ListPoliciesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListPoliciesOutput) SetMarker(v string) *ListPoliciesOutput { - s.Marker = &v - return s -} - -// SetPolicies sets the Policies field's value. -func (s *ListPoliciesOutput) SetPolicies(v []*Policy) *ListPoliciesOutput { - s.Policies = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersionsRequest -type ListPolicyVersionsInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the IAM policy for which you want the versions. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListPolicyVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPolicyVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPolicyVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPolicyVersionsInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListPolicyVersionsInput) SetMarker(v string) *ListPolicyVersionsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListPolicyVersionsInput) SetMaxItems(v int64) *ListPolicyVersionsInput { - s.MaxItems = &v - return s -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *ListPolicyVersionsInput) SetPolicyArn(v string) *ListPolicyVersionsInput { - s.PolicyArn = &v - return s -} - -// Contains the response to a successful ListPolicyVersions request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersionsResponse -type ListPolicyVersionsOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of policy versions. - // - // For more information about managed policy versions, see Versioning for Managed - // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) - // in the IAM User Guide. - Versions []*PolicyVersion `type:"list"` -} - -// String returns the string representation -func (s ListPolicyVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPolicyVersionsOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListPolicyVersionsOutput) SetIsTruncated(v bool) *ListPolicyVersionsOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListPolicyVersionsOutput) SetMarker(v string) *ListPolicyVersionsOutput { - s.Marker = &v - return s -} - -// SetVersions sets the Versions field's value. -func (s *ListPolicyVersionsOutput) SetVersions(v []*PolicyVersion) *ListPolicyVersionsOutput { - s.Versions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePoliciesRequest -type ListRolePoliciesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The name of the role to list policies for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListRolePoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRolePoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRolePoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRolePoliciesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListRolePoliciesInput) SetMarker(v string) *ListRolePoliciesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListRolePoliciesInput) SetMaxItems(v int64) *ListRolePoliciesInput { - s.MaxItems = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *ListRolePoliciesInput) SetRoleName(v string) *ListRolePoliciesInput { - s.RoleName = &v - return s -} - -// Contains the response to a successful ListRolePolicies request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePoliciesResponse -type ListRolePoliciesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of policy names. - // - // PolicyNames is a required field - PolicyNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListRolePoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRolePoliciesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListRolePoliciesOutput) SetIsTruncated(v bool) *ListRolePoliciesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListRolePoliciesOutput) SetMarker(v string) *ListRolePoliciesOutput { - s.Marker = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *ListRolePoliciesOutput) SetPolicyNames(v []*string) *ListRolePoliciesOutput { - s.PolicyNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolesRequest -type ListRolesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ - // gets all roles whose path starts with /application_abc/component_xyz/. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/), listing all roles. This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - PathPrefix *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListRolesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRolesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRolesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRolesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListRolesInput) SetMarker(v string) *ListRolesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListRolesInput) SetMaxItems(v int64) *ListRolesInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListRolesInput) SetPathPrefix(v string) *ListRolesInput { - s.PathPrefix = &v - return s -} - -// Contains the response to a successful ListRoles request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolesResponse -type ListRolesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of roles. - // - // Roles is a required field - Roles []*Role `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListRolesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRolesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListRolesOutput) SetIsTruncated(v bool) *ListRolesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListRolesOutput) SetMarker(v string) *ListRolesOutput { - s.Marker = &v - return s -} - -// SetRoles sets the Roles field's value. -func (s *ListRolesOutput) SetRoles(v []*Role) *ListRolesOutput { - s.Roles = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProvidersRequest -type ListSAMLProvidersInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ListSAMLProvidersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSAMLProvidersInput) GoString() string { - return s.String() -} - -// Contains the response to a successful ListSAMLProviders request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProvidersResponse -type ListSAMLProvidersOutput struct { - _ struct{} `type:"structure"` - - // The list of SAML provider resource objects defined in IAM for this AWS account. - SAMLProviderList []*SAMLProviderListEntry `type:"list"` -} - -// String returns the string representation -func (s ListSAMLProvidersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSAMLProvidersOutput) GoString() string { - return s.String() -} - -// SetSAMLProviderList sets the SAMLProviderList field's value. -func (s *ListSAMLProvidersOutput) SetSAMLProviderList(v []*SAMLProviderListEntry) *ListSAMLProvidersOutput { - s.SAMLProviderList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSSHPublicKeysRequest -type ListSSHPublicKeysInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The name of the IAM user to list SSH public keys for. If none is specified, - // the UserName field is determined implicitly based on the AWS access key used - // to sign the request. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListSSHPublicKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSSHPublicKeysInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSSHPublicKeysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSSHPublicKeysInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListSSHPublicKeysInput) SetMarker(v string) *ListSSHPublicKeysInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListSSHPublicKeysInput) SetMaxItems(v int64) *ListSSHPublicKeysInput { - s.MaxItems = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListSSHPublicKeysInput) SetUserName(v string) *ListSSHPublicKeysInput { - s.UserName = &v - return s -} - -// Contains the response to a successful ListSSHPublicKeys request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSSHPublicKeysResponse -type ListSSHPublicKeysOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of the SSH public keys assigned to IAM user. - SSHPublicKeys []*SSHPublicKeyMetadata `type:"list"` -} - -// String returns the string representation -func (s ListSSHPublicKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSSHPublicKeysOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListSSHPublicKeysOutput) SetIsTruncated(v bool) *ListSSHPublicKeysOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListSSHPublicKeysOutput) SetMarker(v string) *ListSSHPublicKeysOutput { - s.Marker = &v - return s -} - -// SetSSHPublicKeys sets the SSHPublicKeys field's value. -func (s *ListSSHPublicKeysOutput) SetSSHPublicKeys(v []*SSHPublicKeyMetadata) *ListSSHPublicKeysOutput { - s.SSHPublicKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServerCertificatesRequest -type ListServerCertificatesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. For example: /company/servercerts - // would get all server certificates for which the path starts with /company/servercerts. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/), listing all server certificates. This paramater allows (per its regex - // pattern (http://wikipedia.org/wiki/regex)) a string of characters consisting - // of either a forward slash (/) by itself or a string that must begin and end - // with forward slashes, containing any ASCII character from the ! (\u0021) - // thru the DEL character (\u007F), including most punctuation characters, digits, - // and upper and lowercased letters. - PathPrefix *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListServerCertificatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListServerCertificatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListServerCertificatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListServerCertificatesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListServerCertificatesInput) SetMarker(v string) *ListServerCertificatesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListServerCertificatesInput) SetMaxItems(v int64) *ListServerCertificatesInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListServerCertificatesInput) SetPathPrefix(v string) *ListServerCertificatesInput { - s.PathPrefix = &v - return s -} - -// Contains the response to a successful ListServerCertificates request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServerCertificatesResponse -type ListServerCertificatesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of server certificates. - // - // ServerCertificateMetadataList is a required field - ServerCertificateMetadataList []*ServerCertificateMetadata `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListServerCertificatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListServerCertificatesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListServerCertificatesOutput) SetIsTruncated(v bool) *ListServerCertificatesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListServerCertificatesOutput) SetMarker(v string) *ListServerCertificatesOutput { - s.Marker = &v - return s -} - -// SetServerCertificateMetadataList sets the ServerCertificateMetadataList field's value. -func (s *ListServerCertificatesOutput) SetServerCertificateMetadataList(v []*ServerCertificateMetadata) *ListServerCertificatesOutput { - s.ServerCertificateMetadataList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServiceSpecificCredentialsRequest -type ListServiceSpecificCredentialsInput struct { - _ struct{} `type:"structure"` - - // Filters the returned results to only those for the specified AWS service. - // If not specified, then AWS returns service-specific credentials for all services. - ServiceName *string `type:"string"` - - // The name of the user whose service-specific credentials you want information - // about. If this value is not specified then the operation assumes the user - // whose credentials are used to call the operation. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListServiceSpecificCredentialsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListServiceSpecificCredentialsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListServiceSpecificCredentialsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListServiceSpecificCredentialsInput"} - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceName sets the ServiceName field's value. -func (s *ListServiceSpecificCredentialsInput) SetServiceName(v string) *ListServiceSpecificCredentialsInput { - s.ServiceName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListServiceSpecificCredentialsInput) SetUserName(v string) *ListServiceSpecificCredentialsInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServiceSpecificCredentialsResponse -type ListServiceSpecificCredentialsOutput struct { - _ struct{} `type:"structure"` - - // A list of structures that each contain details about a service-specific credential. - ServiceSpecificCredentials []*ServiceSpecificCredentialMetadata `type:"list"` -} - -// String returns the string representation -func (s ListServiceSpecificCredentialsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListServiceSpecificCredentialsOutput) GoString() string { - return s.String() -} - -// SetServiceSpecificCredentials sets the ServiceSpecificCredentials field's value. -func (s *ListServiceSpecificCredentialsOutput) SetServiceSpecificCredentials(v []*ServiceSpecificCredentialMetadata) *ListServiceSpecificCredentialsOutput { - s.ServiceSpecificCredentials = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSigningCertificatesRequest -type ListSigningCertificatesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The name of the IAM user whose signing certificates you want to examine. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListSigningCertificatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSigningCertificatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSigningCertificatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSigningCertificatesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListSigningCertificatesInput) SetMarker(v string) *ListSigningCertificatesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListSigningCertificatesInput) SetMaxItems(v int64) *ListSigningCertificatesInput { - s.MaxItems = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListSigningCertificatesInput) SetUserName(v string) *ListSigningCertificatesInput { - s.UserName = &v - return s -} - -// Contains the response to a successful ListSigningCertificates request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSigningCertificatesResponse -type ListSigningCertificatesOutput struct { - _ struct{} `type:"structure"` - - // A list of the user's signing certificate information. - // - // Certificates is a required field - Certificates []*SigningCertificate `type:"list" required:"true"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListSigningCertificatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSigningCertificatesOutput) GoString() string { - return s.String() -} - -// SetCertificates sets the Certificates field's value. -func (s *ListSigningCertificatesOutput) SetCertificates(v []*SigningCertificate) *ListSigningCertificatesOutput { - s.Certificates = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListSigningCertificatesOutput) SetIsTruncated(v bool) *ListSigningCertificatesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListSigningCertificatesOutput) SetMarker(v string) *ListSigningCertificatesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUserPoliciesRequest -type ListUserPoliciesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The name of the user to list policies for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListUserPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListUserPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListUserPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListUserPoliciesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListUserPoliciesInput) SetMarker(v string) *ListUserPoliciesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListUserPoliciesInput) SetMaxItems(v int64) *ListUserPoliciesInput { - s.MaxItems = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListUserPoliciesInput) SetUserName(v string) *ListUserPoliciesInput { - s.UserName = &v - return s -} - -// Contains the response to a successful ListUserPolicies request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUserPoliciesResponse -type ListUserPoliciesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of policy names. - // - // PolicyNames is a required field - PolicyNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListUserPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListUserPoliciesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListUserPoliciesOutput) SetIsTruncated(v bool) *ListUserPoliciesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListUserPoliciesOutput) SetMarker(v string) *ListUserPoliciesOutput { - s.Marker = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *ListUserPoliciesOutput) SetPolicyNames(v []*string) *ListUserPoliciesOutput { - s.PolicyNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUsersRequest -type ListUsersInput struct { - _ struct{} `type:"structure"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/, - // which would get all user names whose path starts with /division_abc/subdivision_xyz/. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/), listing all user names. This paramater allows (per its regex pattern - // (http://wikipedia.org/wiki/regex)) a string of characters consisting of either - // a forward slash (/) by itself or a string that must begin and end with forward - // slashes, containing any ASCII character from the ! (\u0021) thru the DEL - // character (\u007F), including most punctuation characters, digits, and upper - // and lowercased letters. - PathPrefix *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListUsersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListUsersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListUsersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListUsersInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListUsersInput) SetMarker(v string) *ListUsersInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListUsersInput) SetMaxItems(v int64) *ListUsersInput { - s.MaxItems = &v - return s -} - -// SetPathPrefix sets the PathPrefix field's value. -func (s *ListUsersInput) SetPathPrefix(v string) *ListUsersInput { - s.PathPrefix = &v - return s -} - -// Contains the response to a successful ListUsers request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUsersResponse -type ListUsersOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // A list of users. - // - // Users is a required field - Users []*User `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListUsersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListUsersOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListUsersOutput) SetIsTruncated(v bool) *ListUsersOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListUsersOutput) SetMarker(v string) *ListUsersOutput { - s.Marker = &v - return s -} - -// SetUsers sets the Users field's value. -func (s *ListUsersOutput) SetUsers(v []*User) *ListUsersOutput { - s.Users = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListVirtualMFADevicesRequest -type ListVirtualMFADevicesInput struct { - _ struct{} `type:"structure"` - - // The status (Unassigned or Assigned) of the devices to list. If you do not - // specify an AssignmentStatus, the action defaults to Any which lists both - // assigned and unassigned virtual MFA devices. - AssignmentStatus *string `type:"string" enum:"assignmentStatusType"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListVirtualMFADevicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVirtualMFADevicesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVirtualMFADevicesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVirtualMFADevicesInput"} - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssignmentStatus sets the AssignmentStatus field's value. -func (s *ListVirtualMFADevicesInput) SetAssignmentStatus(v string) *ListVirtualMFADevicesInput { - s.AssignmentStatus = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListVirtualMFADevicesInput) SetMarker(v string) *ListVirtualMFADevicesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListVirtualMFADevicesInput) SetMaxItems(v int64) *ListVirtualMFADevicesInput { - s.MaxItems = &v - return s -} - -// Contains the response to a successful ListVirtualMFADevices request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListVirtualMFADevicesResponse -type ListVirtualMFADevicesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` - - // The list of virtual MFA devices in the current account that match the AssignmentStatus - // value that was passed in the request. - // - // VirtualMFADevices is a required field - VirtualMFADevices []*VirtualMFADevice `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListVirtualMFADevicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVirtualMFADevicesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListVirtualMFADevicesOutput) SetIsTruncated(v bool) *ListVirtualMFADevicesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListVirtualMFADevicesOutput) SetMarker(v string) *ListVirtualMFADevicesOutput { - s.Marker = &v - return s -} - -// SetVirtualMFADevices sets the VirtualMFADevices field's value. -func (s *ListVirtualMFADevicesOutput) SetVirtualMFADevices(v []*VirtualMFADevice) *ListVirtualMFADevicesOutput { - s.VirtualMFADevices = v - return s -} - -// Contains the user name and password create date for a user. -// -// This data type is used as a response element in the CreateLoginProfile and -// GetLoginProfile actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/LoginProfile -type LoginProfile struct { - _ struct{} `type:"structure"` - - // The date when the password for the user was created. - // - // CreateDate is a required field - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Specifies whether the user is required to set a new password on next sign-in. - PasswordResetRequired *bool `type:"boolean"` - - // The name of the user, which can be used for signing in to the AWS Management - // Console. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s LoginProfile) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoginProfile) GoString() string { - return s.String() -} - -// SetCreateDate sets the CreateDate field's value. -func (s *LoginProfile) SetCreateDate(v time.Time) *LoginProfile { - s.CreateDate = &v - return s -} - -// SetPasswordResetRequired sets the PasswordResetRequired field's value. -func (s *LoginProfile) SetPasswordResetRequired(v bool) *LoginProfile { - s.PasswordResetRequired = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *LoginProfile) SetUserName(v string) *LoginProfile { - s.UserName = &v - return s -} - -// Contains information about an MFA device. -// -// This data type is used as a response element in the ListMFADevices action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/MFADevice -type MFADevice struct { - _ struct{} `type:"structure"` - - // The date when the MFA device was enabled for the user. - // - // EnableDate is a required field - EnableDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The serial number that uniquely identifies the MFA device. For virtual MFA - // devices, the serial number is the device ARN. - // - // SerialNumber is a required field - SerialNumber *string `min:"9" type:"string" required:"true"` - - // The user with whom the MFA device is associated. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s MFADevice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MFADevice) GoString() string { - return s.String() -} - -// SetEnableDate sets the EnableDate field's value. -func (s *MFADevice) SetEnableDate(v time.Time) *MFADevice { - s.EnableDate = &v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *MFADevice) SetSerialNumber(v string) *MFADevice { - s.SerialNumber = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *MFADevice) SetUserName(v string) *MFADevice { - s.UserName = &v - return s -} - -// Contains information about a managed policy, including the policy's ARN, -// versions, and the number of principal entities (users, groups, and roles) -// that the policy is attached to. -// -// This data type is used as a response element in the GetAccountAuthorizationDetails -// action. -// -// For more information about managed policies, see Managed Policies and Inline -// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ManagedPolicyDetail -type ManagedPolicyDetail struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. - // - // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - Arn *string `min:"20" type:"string"` - - // The number of principal entities (users, groups, and roles) that the policy - // is attached to. - AttachmentCount *int64 `type:"integer"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the policy was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The identifier for the version of the policy that is set as the default (operative) - // version. - // - // For more information about policy versions, see Versioning for Managed Policies - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) - // in the Using IAM guide. - DefaultVersionId *string `type:"string"` - - // A friendly description of the policy. - Description *string `type:"string"` - - // Specifies whether the policy can be attached to an IAM user, group, or role. - IsAttachable *bool `type:"boolean"` - - // The path to the policy. - // - // For more information about paths, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - Path *string `type:"string"` - - // The stable and unique string identifying the policy. - // - // For more information about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - PolicyId *string `min:"16" type:"string"` - - // The friendly name (not ARN) identifying the policy. - PolicyName *string `min:"1" type:"string"` - - // A list containing information about the versions of the policy. - PolicyVersionList []*PolicyVersion `type:"list"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the policy was last updated. - // - // When a policy has only one version, this field contains the date and time - // when the policy was created. When a policy has more than one version, this - // field contains the date and time when the most recent policy version was - // created. - UpdateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ManagedPolicyDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ManagedPolicyDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ManagedPolicyDetail) SetArn(v string) *ManagedPolicyDetail { - s.Arn = &v - return s -} - -// SetAttachmentCount sets the AttachmentCount field's value. -func (s *ManagedPolicyDetail) SetAttachmentCount(v int64) *ManagedPolicyDetail { - s.AttachmentCount = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ManagedPolicyDetail) SetCreateDate(v time.Time) *ManagedPolicyDetail { - s.CreateDate = &v - return s -} - -// SetDefaultVersionId sets the DefaultVersionId field's value. -func (s *ManagedPolicyDetail) SetDefaultVersionId(v string) *ManagedPolicyDetail { - s.DefaultVersionId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ManagedPolicyDetail) SetDescription(v string) *ManagedPolicyDetail { - s.Description = &v - return s -} - -// SetIsAttachable sets the IsAttachable field's value. -func (s *ManagedPolicyDetail) SetIsAttachable(v bool) *ManagedPolicyDetail { - s.IsAttachable = &v - return s -} - -// SetPath sets the Path field's value. -func (s *ManagedPolicyDetail) SetPath(v string) *ManagedPolicyDetail { - s.Path = &v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *ManagedPolicyDetail) SetPolicyId(v string) *ManagedPolicyDetail { - s.PolicyId = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *ManagedPolicyDetail) SetPolicyName(v string) *ManagedPolicyDetail { - s.PolicyName = &v - return s -} - -// SetPolicyVersionList sets the PolicyVersionList field's value. -func (s *ManagedPolicyDetail) SetPolicyVersionList(v []*PolicyVersion) *ManagedPolicyDetail { - s.PolicyVersionList = v - return s -} - -// SetUpdateDate sets the UpdateDate field's value. -func (s *ManagedPolicyDetail) SetUpdateDate(v time.Time) *ManagedPolicyDetail { - s.UpdateDate = &v - return s -} - -// Contains the Amazon Resource Name (ARN) for an IAM OpenID Connect provider. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/OpenIDConnectProviderListEntry -type OpenIDConnectProviderListEntry struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. - // - // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - Arn *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s OpenIDConnectProviderListEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OpenIDConnectProviderListEntry) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *OpenIDConnectProviderListEntry) SetArn(v string) *OpenIDConnectProviderListEntry { - s.Arn = &v - return s -} - -// Contains information about AWS Organizations's affect on a policy simulation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/OrganizationsDecisionDetail -type OrganizationsDecisionDetail struct { - _ struct{} `type:"structure"` - - // Specifies whether the simulated action is allowed by the AWS Organizations - // service control policies that impact the simulated user's account. - AllowedByOrganizations *bool `type:"boolean"` -} - -// String returns the string representation -func (s OrganizationsDecisionDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OrganizationsDecisionDetail) GoString() string { - return s.String() -} - -// SetAllowedByOrganizations sets the AllowedByOrganizations field's value. -func (s *OrganizationsDecisionDetail) SetAllowedByOrganizations(v bool) *OrganizationsDecisionDetail { - s.AllowedByOrganizations = &v - return s -} - -// Contains information about the account password policy. -// -// This data type is used as a response element in the GetAccountPasswordPolicy -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PasswordPolicy -type PasswordPolicy struct { - _ struct{} `type:"structure"` - - // Specifies whether IAM users are allowed to change their own password. - AllowUsersToChangePassword *bool `type:"boolean"` - - // Indicates whether passwords in the account expire. Returns true if MaxPasswordAge - // is contains a value greater than 0. Returns false if MaxPasswordAge is 0 - // or not present. - ExpirePasswords *bool `type:"boolean"` - - // Specifies whether IAM users are prevented from setting a new password after - // their password has expired. - HardExpiry *bool `type:"boolean"` - - // The number of days that an IAM user password is valid. - MaxPasswordAge *int64 `min:"1" type:"integer"` - - // Minimum length to require for IAM user passwords. - MinimumPasswordLength *int64 `min:"6" type:"integer"` - - // Specifies the number of previous passwords that IAM users are prevented from - // reusing. - PasswordReusePrevention *int64 `min:"1" type:"integer"` - - // Specifies whether to require lowercase characters for IAM user passwords. - RequireLowercaseCharacters *bool `type:"boolean"` - - // Specifies whether to require numbers for IAM user passwords. - RequireNumbers *bool `type:"boolean"` - - // Specifies whether to require symbols for IAM user passwords. - RequireSymbols *bool `type:"boolean"` - - // Specifies whether to require uppercase characters for IAM user passwords. - RequireUppercaseCharacters *bool `type:"boolean"` -} - -// String returns the string representation -func (s PasswordPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PasswordPolicy) GoString() string { - return s.String() -} - -// SetAllowUsersToChangePassword sets the AllowUsersToChangePassword field's value. -func (s *PasswordPolicy) SetAllowUsersToChangePassword(v bool) *PasswordPolicy { - s.AllowUsersToChangePassword = &v - return s -} - -// SetExpirePasswords sets the ExpirePasswords field's value. -func (s *PasswordPolicy) SetExpirePasswords(v bool) *PasswordPolicy { - s.ExpirePasswords = &v - return s -} - -// SetHardExpiry sets the HardExpiry field's value. -func (s *PasswordPolicy) SetHardExpiry(v bool) *PasswordPolicy { - s.HardExpiry = &v - return s -} - -// SetMaxPasswordAge sets the MaxPasswordAge field's value. -func (s *PasswordPolicy) SetMaxPasswordAge(v int64) *PasswordPolicy { - s.MaxPasswordAge = &v - return s -} - -// SetMinimumPasswordLength sets the MinimumPasswordLength field's value. -func (s *PasswordPolicy) SetMinimumPasswordLength(v int64) *PasswordPolicy { - s.MinimumPasswordLength = &v - return s -} - -// SetPasswordReusePrevention sets the PasswordReusePrevention field's value. -func (s *PasswordPolicy) SetPasswordReusePrevention(v int64) *PasswordPolicy { - s.PasswordReusePrevention = &v - return s -} - -// SetRequireLowercaseCharacters sets the RequireLowercaseCharacters field's value. -func (s *PasswordPolicy) SetRequireLowercaseCharacters(v bool) *PasswordPolicy { - s.RequireLowercaseCharacters = &v - return s -} - -// SetRequireNumbers sets the RequireNumbers field's value. -func (s *PasswordPolicy) SetRequireNumbers(v bool) *PasswordPolicy { - s.RequireNumbers = &v - return s -} - -// SetRequireSymbols sets the RequireSymbols field's value. -func (s *PasswordPolicy) SetRequireSymbols(v bool) *PasswordPolicy { - s.RequireSymbols = &v - return s -} - -// SetRequireUppercaseCharacters sets the RequireUppercaseCharacters field's value. -func (s *PasswordPolicy) SetRequireUppercaseCharacters(v bool) *PasswordPolicy { - s.RequireUppercaseCharacters = &v - return s -} - -// Contains information about a managed policy. -// -// This data type is used as a response element in the CreatePolicy, GetPolicy, -// and ListPolicies actions. -// -// For more information about managed policies, refer to Managed Policies and -// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/Policy -type Policy struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. - // - // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - Arn *string `min:"20" type:"string"` - - // The number of entities (users, groups, and roles) that the policy is attached - // to. - AttachmentCount *int64 `type:"integer"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the policy was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The identifier for the version of the policy that is set as the default version. - DefaultVersionId *string `type:"string"` - - // A friendly description of the policy. - // - // This element is included in the response to the GetPolicy operation. It is - // not included in the response to the ListPolicies operation. - Description *string `type:"string"` - - // Specifies whether the policy can be attached to an IAM user, group, or role. - IsAttachable *bool `type:"boolean"` - - // The path to the policy. - // - // For more information about paths, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - Path *string `type:"string"` - - // The stable and unique string identifying the policy. - // - // For more information about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - PolicyId *string `min:"16" type:"string"` - - // The friendly name (not ARN) identifying the policy. - PolicyName *string `min:"1" type:"string"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the policy was last updated. - // - // When a policy has only one version, this field contains the date and time - // when the policy was created. When a policy has more than one version, this - // field contains the date and time when the most recent policy version was - // created. - UpdateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s Policy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Policy) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Policy) SetArn(v string) *Policy { - s.Arn = &v - return s -} - -// SetAttachmentCount sets the AttachmentCount field's value. -func (s *Policy) SetAttachmentCount(v int64) *Policy { - s.AttachmentCount = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *Policy) SetCreateDate(v time.Time) *Policy { - s.CreateDate = &v - return s -} - -// SetDefaultVersionId sets the DefaultVersionId field's value. -func (s *Policy) SetDefaultVersionId(v string) *Policy { - s.DefaultVersionId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Policy) SetDescription(v string) *Policy { - s.Description = &v - return s -} - -// SetIsAttachable sets the IsAttachable field's value. -func (s *Policy) SetIsAttachable(v bool) *Policy { - s.IsAttachable = &v - return s -} - -// SetPath sets the Path field's value. -func (s *Policy) SetPath(v string) *Policy { - s.Path = &v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *Policy) SetPolicyId(v string) *Policy { - s.PolicyId = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *Policy) SetPolicyName(v string) *Policy { - s.PolicyName = &v - return s -} - -// SetUpdateDate sets the UpdateDate field's value. -func (s *Policy) SetUpdateDate(v time.Time) *Policy { - s.UpdateDate = &v - return s -} - -// Contains information about an IAM policy, including the policy document. -// -// This data type is used as a response element in the GetAccountAuthorizationDetails -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PolicyDetail -type PolicyDetail struct { - _ struct{} `type:"structure"` - - // The policy document. - PolicyDocument *string `min:"1" type:"string"` - - // The name of the policy. - PolicyName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PolicyDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyDetail) GoString() string { - return s.String() -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *PolicyDetail) SetPolicyDocument(v string) *PolicyDetail { - s.PolicyDocument = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PolicyDetail) SetPolicyName(v string) *PolicyDetail { - s.PolicyName = &v - return s -} - -// Contains information about a group that a managed policy is attached to. -// -// This data type is used as a response element in the ListEntitiesForPolicy -// action. -// -// For more information about managed policies, refer to Managed Policies and -// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PolicyGroup -type PolicyGroup struct { - _ struct{} `type:"structure"` - - // The stable and unique string identifying the group. For more information - // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in the IAM User Guide. - GroupId *string `min:"16" type:"string"` - - // The name (friendly name, not ARN) identifying the group. - GroupName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PolicyGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyGroup) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *PolicyGroup) SetGroupId(v string) *PolicyGroup { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *PolicyGroup) SetGroupName(v string) *PolicyGroup { - s.GroupName = &v - return s -} - -// Contains information about a role that a managed policy is attached to. -// -// This data type is used as a response element in the ListEntitiesForPolicy -// action. -// -// For more information about managed policies, refer to Managed Policies and -// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PolicyRole -type PolicyRole struct { - _ struct{} `type:"structure"` - - // The stable and unique string identifying the role. For more information about - // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in the IAM User Guide. - RoleId *string `min:"16" type:"string"` - - // The name (friendly name, not ARN) identifying the role. - RoleName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PolicyRole) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyRole) GoString() string { - return s.String() -} - -// SetRoleId sets the RoleId field's value. -func (s *PolicyRole) SetRoleId(v string) *PolicyRole { - s.RoleId = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *PolicyRole) SetRoleName(v string) *PolicyRole { - s.RoleName = &v - return s -} - -// Contains information about a user that a managed policy is attached to. -// -// This data type is used as a response element in the ListEntitiesForPolicy -// action. -// -// For more information about managed policies, refer to Managed Policies and -// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PolicyUser -type PolicyUser struct { - _ struct{} `type:"structure"` - - // The stable and unique string identifying the user. For more information about - // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in the IAM User Guide. - UserId *string `min:"16" type:"string"` - - // The name (friendly name, not ARN) identifying the user. - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PolicyUser) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyUser) GoString() string { - return s.String() -} - -// SetUserId sets the UserId field's value. -func (s *PolicyUser) SetUserId(v string) *PolicyUser { - s.UserId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *PolicyUser) SetUserName(v string) *PolicyUser { - s.UserName = &v - return s -} - -// Contains information about a version of a managed policy. -// -// This data type is used as a response element in the CreatePolicyVersion, -// GetPolicyVersion, ListPolicyVersions, and GetAccountAuthorizationDetails -// actions. -// -// For more information about managed policies, refer to Managed Policies and -// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PolicyVersion -type PolicyVersion struct { - _ struct{} `type:"structure"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the policy version was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The policy document. - // - // The policy document is returned in the response to the GetPolicyVersion and - // GetAccountAuthorizationDetails operations. It is not returned in the response - // to the CreatePolicyVersion or ListPolicyVersions operations. - Document *string `min:"1" type:"string"` - - // Specifies whether the policy version is set as the policy's default version. - IsDefaultVersion *bool `type:"boolean"` - - // The identifier for the policy version. - // - // Policy version identifiers always begin with v (always lowercase). When a - // policy is created, the first policy version is v1. - VersionId *string `type:"string"` -} - -// String returns the string representation -func (s PolicyVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyVersion) GoString() string { - return s.String() -} - -// SetCreateDate sets the CreateDate field's value. -func (s *PolicyVersion) SetCreateDate(v time.Time) *PolicyVersion { - s.CreateDate = &v - return s -} - -// SetDocument sets the Document field's value. -func (s *PolicyVersion) SetDocument(v string) *PolicyVersion { - s.Document = &v - return s -} - -// SetIsDefaultVersion sets the IsDefaultVersion field's value. -func (s *PolicyVersion) SetIsDefaultVersion(v bool) *PolicyVersion { - s.IsDefaultVersion = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PolicyVersion) SetVersionId(v string) *PolicyVersion { - s.VersionId = &v - return s -} - -// Contains the row and column of a location of a Statement element in a policy -// document. -// -// This data type is used as a member of the Statement type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/Position -type Position struct { - _ struct{} `type:"structure"` - - // The column in the line containing the specified position in the document. - Column *int64 `type:"integer"` - - // The line containing the specified position in the document. - Line *int64 `type:"integer"` -} - -// String returns the string representation -func (s Position) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Position) GoString() string { - return s.String() -} - -// SetColumn sets the Column field's value. -func (s *Position) SetColumn(v int64) *Position { - s.Column = &v - return s -} - -// SetLine sets the Line field's value. -func (s *Position) SetLine(v int64) *Position { - s.Line = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutGroupPolicyRequest -type PutGroupPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the group to associate the policy with. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The policy document. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // The name of the policy document. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutGroupPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutGroupPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutGroupPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutGroupPolicyInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.PolicyDocument == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) - } - if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *PutGroupPolicyInput) SetGroupName(v string) *PutGroupPolicyInput { - s.GroupName = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *PutGroupPolicyInput) SetPolicyDocument(v string) *PutGroupPolicyInput { - s.PolicyDocument = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PutGroupPolicyInput) SetPolicyName(v string) *PutGroupPolicyInput { - s.PolicyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutGroupPolicyOutput -type PutGroupPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutGroupPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutGroupPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePolicyRequest -type PutRolePolicyInput struct { - _ struct{} `type:"structure"` - - // The policy document. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // The name of the policy document. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The name of the role to associate the policy with. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutRolePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRolePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRolePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRolePolicyInput"} - if s.PolicyDocument == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) - } - if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *PutRolePolicyInput) SetPolicyDocument(v string) *PutRolePolicyInput { - s.PolicyDocument = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PutRolePolicyInput) SetPolicyName(v string) *PutRolePolicyInput { - s.PolicyName = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *PutRolePolicyInput) SetRoleName(v string) *PutRolePolicyInput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePolicyOutput -type PutRolePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutRolePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRolePolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPolicyRequest -type PutUserPolicyInput struct { - _ struct{} `type:"structure"` - - // The policy document. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // The name of the policy document. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` - - // The name of the user to associate the policy with. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutUserPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutUserPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutUserPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutUserPolicyInput"} - if s.PolicyDocument == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) - } - if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *PutUserPolicyInput) SetPolicyDocument(v string) *PutUserPolicyInput { - s.PolicyDocument = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PutUserPolicyInput) SetPolicyName(v string) *PutUserPolicyInput { - s.PolicyName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *PutUserPolicyInput) SetUserName(v string) *PutUserPolicyInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPolicyOutput -type PutUserPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutUserPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutUserPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveClientIDFromOpenIDConnectProviderRequest -type RemoveClientIDFromOpenIDConnectProviderInput struct { - _ struct{} `type:"structure"` - - // The client ID (also known as audience) to remove from the IAM OIDC provider - // resource. For more information about client IDs, see CreateOpenIDConnectProvider. - // - // ClientID is a required field - ClientID *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM OIDC provider resource to remove - // the client ID from. You can get a list of OIDC provider ARNs by using the - // ListOpenIDConnectProviders action. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // OpenIDConnectProviderArn is a required field - OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveClientIDFromOpenIDConnectProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveClientIDFromOpenIDConnectProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveClientIDFromOpenIDConnectProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveClientIDFromOpenIDConnectProviderInput"} - if s.ClientID == nil { - invalidParams.Add(request.NewErrParamRequired("ClientID")) - } - if s.ClientID != nil && len(*s.ClientID) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientID", 1)) - } - if s.OpenIDConnectProviderArn == nil { - invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) - } - if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientID sets the ClientID field's value. -func (s *RemoveClientIDFromOpenIDConnectProviderInput) SetClientID(v string) *RemoveClientIDFromOpenIDConnectProviderInput { - s.ClientID = &v - return s -} - -// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. -func (s *RemoveClientIDFromOpenIDConnectProviderInput) SetOpenIDConnectProviderArn(v string) *RemoveClientIDFromOpenIDConnectProviderInput { - s.OpenIDConnectProviderArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveClientIDFromOpenIDConnectProviderOutput -type RemoveClientIDFromOpenIDConnectProviderOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveClientIDFromOpenIDConnectProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveClientIDFromOpenIDConnectProviderOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveRoleFromInstanceProfileRequest -type RemoveRoleFromInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The name of the instance profile to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // InstanceProfileName is a required field - InstanceProfileName *string `min:"1" type:"string" required:"true"` - - // The name of the role to remove. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveRoleFromInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveRoleFromInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveRoleFromInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveRoleFromInstanceProfileInput"} - if s.InstanceProfileName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) - } - if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceProfileName sets the InstanceProfileName field's value. -func (s *RemoveRoleFromInstanceProfileInput) SetInstanceProfileName(v string) *RemoveRoleFromInstanceProfileInput { - s.InstanceProfileName = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *RemoveRoleFromInstanceProfileInput) SetRoleName(v string) *RemoveRoleFromInstanceProfileInput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveRoleFromInstanceProfileOutput -type RemoveRoleFromInstanceProfileOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveRoleFromInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveRoleFromInstanceProfileOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveUserFromGroupRequest -type RemoveUserFromGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the group to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // The name of the user to remove. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveUserFromGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveUserFromGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveUserFromGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveUserFromGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *RemoveUserFromGroupInput) SetGroupName(v string) *RemoveUserFromGroupInput { - s.GroupName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *RemoveUserFromGroupInput) SetUserName(v string) *RemoveUserFromGroupInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveUserFromGroupOutput -type RemoveUserFromGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveUserFromGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveUserFromGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResetServiceSpecificCredentialRequest -type ResetServiceSpecificCredentialInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the service-specific credential. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // ServiceSpecificCredentialId is a required field - ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` - - // The name of the IAM user associated with the service-specific credential. - // If this value is not specified, then the operation assumes the user whose - // credentials are used to call the operation. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ResetServiceSpecificCredentialInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetServiceSpecificCredentialInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetServiceSpecificCredentialInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetServiceSpecificCredentialInput"} - if s.ServiceSpecificCredentialId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceSpecificCredentialId")) - } - if s.ServiceSpecificCredentialId != nil && len(*s.ServiceSpecificCredentialId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ServiceSpecificCredentialId", 20)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. -func (s *ResetServiceSpecificCredentialInput) SetServiceSpecificCredentialId(v string) *ResetServiceSpecificCredentialInput { - s.ServiceSpecificCredentialId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ResetServiceSpecificCredentialInput) SetUserName(v string) *ResetServiceSpecificCredentialInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResetServiceSpecificCredentialResponse -type ResetServiceSpecificCredentialOutput struct { - _ struct{} `type:"structure"` - - // A structure with details about the updated service-specific credential, including - // the new password. - // - // This is the only time that you can access the password. You cannot recover - // the password later, but you can reset it again. - ServiceSpecificCredential *ServiceSpecificCredential `type:"structure"` -} - -// String returns the string representation -func (s ResetServiceSpecificCredentialOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetServiceSpecificCredentialOutput) GoString() string { - return s.String() -} - -// SetServiceSpecificCredential sets the ServiceSpecificCredential field's value. -func (s *ResetServiceSpecificCredentialOutput) SetServiceSpecificCredential(v *ServiceSpecificCredential) *ResetServiceSpecificCredentialOutput { - s.ServiceSpecificCredential = v - return s -} - -// Contains the result of the simulation of a single API action call on a single -// resource. -// -// This data type is used by a member of the EvaluationResult data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResourceSpecificResult -type ResourceSpecificResult struct { - _ struct{} `type:"structure"` - - // Additional details about the results of the evaluation decision. When there - // are both IAM policies and resource policies, this parameter explains how - // each set of policies contributes to the final evaluation decision. When simulating - // cross-account access to a resource, both the resource-based policy and the - // caller's IAM policy must grant access. - EvalDecisionDetails map[string]*string `type:"map"` - - // The result of the simulation of the simulated API action on the resource - // specified in EvalResourceName. - // - // EvalResourceDecision is a required field - EvalResourceDecision *string `type:"string" required:"true" enum:"PolicyEvaluationDecisionType"` - - // The name of the simulated resource, in Amazon Resource Name (ARN) format. - // - // EvalResourceName is a required field - EvalResourceName *string `min:"1" type:"string" required:"true"` - - // A list of the statements in the input policies that determine the result - // for this part of the simulation. Remember that even if multiple statements - // allow the action on the resource, if any statement denies that action, then - // the explicit deny overrides any allow, and the deny statement is the only - // entry included in the result. - MatchedStatements []*Statement `type:"list"` - - // A list of context keys that are required by the included input policies but - // that were not provided by one of the input parameters. This list is used - // when a list of ARNs is included in the ResourceArns parameter instead of - // "*". If you do not specify individual resources, by setting ResourceArns - // to "*" or by not including the ResourceArns parameter, then any missing context - // values are instead included under the EvaluationResults section. To discover - // the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy - // or GetContextKeysForPrincipalPolicy. - MissingContextValues []*string `type:"list"` -} - -// String returns the string representation -func (s ResourceSpecificResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceSpecificResult) GoString() string { - return s.String() -} - -// SetEvalDecisionDetails sets the EvalDecisionDetails field's value. -func (s *ResourceSpecificResult) SetEvalDecisionDetails(v map[string]*string) *ResourceSpecificResult { - s.EvalDecisionDetails = v - return s -} - -// SetEvalResourceDecision sets the EvalResourceDecision field's value. -func (s *ResourceSpecificResult) SetEvalResourceDecision(v string) *ResourceSpecificResult { - s.EvalResourceDecision = &v - return s -} - -// SetEvalResourceName sets the EvalResourceName field's value. -func (s *ResourceSpecificResult) SetEvalResourceName(v string) *ResourceSpecificResult { - s.EvalResourceName = &v - return s -} - -// SetMatchedStatements sets the MatchedStatements field's value. -func (s *ResourceSpecificResult) SetMatchedStatements(v []*Statement) *ResourceSpecificResult { - s.MatchedStatements = v - return s -} - -// SetMissingContextValues sets the MissingContextValues field's value. -func (s *ResourceSpecificResult) SetMissingContextValues(v []*string) *ResourceSpecificResult { - s.MissingContextValues = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResyncMFADeviceRequest -type ResyncMFADeviceInput struct { - _ struct{} `type:"structure"` - - // An authentication code emitted by the device. - // - // The format for this parameter is a sequence of six digits. - // - // AuthenticationCode1 is a required field - AuthenticationCode1 *string `min:"6" type:"string" required:"true"` - - // A subsequent authentication code emitted by the device. - // - // The format for this parameter is a sequence of six digits. - // - // AuthenticationCode2 is a required field - AuthenticationCode2 *string `min:"6" type:"string" required:"true"` - - // Serial number that uniquely identifies the MFA device. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // SerialNumber is a required field - SerialNumber *string `min:"9" type:"string" required:"true"` - - // The name of the user whose MFA device you want to resynchronize. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ResyncMFADeviceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResyncMFADeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResyncMFADeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResyncMFADeviceInput"} - if s.AuthenticationCode1 == nil { - invalidParams.Add(request.NewErrParamRequired("AuthenticationCode1")) - } - if s.AuthenticationCode1 != nil && len(*s.AuthenticationCode1) < 6 { - invalidParams.Add(request.NewErrParamMinLen("AuthenticationCode1", 6)) - } - if s.AuthenticationCode2 == nil { - invalidParams.Add(request.NewErrParamRequired("AuthenticationCode2")) - } - if s.AuthenticationCode2 != nil && len(*s.AuthenticationCode2) < 6 { - invalidParams.Add(request.NewErrParamMinLen("AuthenticationCode2", 6)) - } - if s.SerialNumber == nil { - invalidParams.Add(request.NewErrParamRequired("SerialNumber")) - } - if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { - invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthenticationCode1 sets the AuthenticationCode1 field's value. -func (s *ResyncMFADeviceInput) SetAuthenticationCode1(v string) *ResyncMFADeviceInput { - s.AuthenticationCode1 = &v - return s -} - -// SetAuthenticationCode2 sets the AuthenticationCode2 field's value. -func (s *ResyncMFADeviceInput) SetAuthenticationCode2(v string) *ResyncMFADeviceInput { - s.AuthenticationCode2 = &v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *ResyncMFADeviceInput) SetSerialNumber(v string) *ResyncMFADeviceInput { - s.SerialNumber = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ResyncMFADeviceInput) SetUserName(v string) *ResyncMFADeviceInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResyncMFADeviceOutput -type ResyncMFADeviceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResyncMFADeviceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResyncMFADeviceOutput) GoString() string { - return s.String() -} - -// Contains information about an IAM role. -// -// This data type is used as a response element in the following actions: -// -// * CreateRole -// -// * GetRole -// -// * ListRoles -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/Role -type Role struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) specifying the role. For more information - // about ARNs and how to use them in policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Arn is a required field - Arn *string `min:"20" type:"string" required:"true"` - - // The policy that grants an entity permission to assume the role. - AssumeRolePolicyDocument *string `min:"1" type:"string"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the role was created. - // - // CreateDate is a required field - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The path to the role. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Path is a required field - Path *string `min:"1" type:"string" required:"true"` - - // The stable and unique string identifying the role. For more information about - // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // RoleId is a required field - RoleId *string `min:"16" type:"string" required:"true"` - - // The friendly name that identifies the role. - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s Role) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Role) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Role) SetArn(v string) *Role { - s.Arn = &v - return s -} - -// SetAssumeRolePolicyDocument sets the AssumeRolePolicyDocument field's value. -func (s *Role) SetAssumeRolePolicyDocument(v string) *Role { - s.AssumeRolePolicyDocument = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *Role) SetCreateDate(v time.Time) *Role { - s.CreateDate = &v - return s -} - -// SetPath sets the Path field's value. -func (s *Role) SetPath(v string) *Role { - s.Path = &v - return s -} - -// SetRoleId sets the RoleId field's value. -func (s *Role) SetRoleId(v string) *Role { - s.RoleId = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *Role) SetRoleName(v string) *Role { - s.RoleName = &v - return s -} - -// Contains information about an IAM role, including all of the role's policies. -// -// This data type is used as a response element in the GetAccountAuthorizationDetails -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RoleDetail -type RoleDetail struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. - // - // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - Arn *string `min:"20" type:"string"` - - // The trust policy that grants permission to assume the role. - AssumeRolePolicyDocument *string `min:"1" type:"string"` - - // A list of managed policies attached to the role. These policies are the role's - // access (permissions) policies. - AttachedManagedPolicies []*AttachedPolicy `type:"list"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the role was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A list of instance profiles that contain this role. - InstanceProfileList []*InstanceProfile `type:"list"` - - // The path to the role. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - Path *string `min:"1" type:"string"` - - // The stable and unique string identifying the role. For more information about - // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - RoleId *string `min:"16" type:"string"` - - // The friendly name that identifies the role. - RoleName *string `min:"1" type:"string"` - - // A list of inline policies embedded in the role. These policies are the role's - // access (permissions) policies. - RolePolicyList []*PolicyDetail `type:"list"` -} - -// String returns the string representation -func (s RoleDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RoleDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *RoleDetail) SetArn(v string) *RoleDetail { - s.Arn = &v - return s -} - -// SetAssumeRolePolicyDocument sets the AssumeRolePolicyDocument field's value. -func (s *RoleDetail) SetAssumeRolePolicyDocument(v string) *RoleDetail { - s.AssumeRolePolicyDocument = &v - return s -} - -// SetAttachedManagedPolicies sets the AttachedManagedPolicies field's value. -func (s *RoleDetail) SetAttachedManagedPolicies(v []*AttachedPolicy) *RoleDetail { - s.AttachedManagedPolicies = v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *RoleDetail) SetCreateDate(v time.Time) *RoleDetail { - s.CreateDate = &v - return s -} - -// SetInstanceProfileList sets the InstanceProfileList field's value. -func (s *RoleDetail) SetInstanceProfileList(v []*InstanceProfile) *RoleDetail { - s.InstanceProfileList = v - return s -} - -// SetPath sets the Path field's value. -func (s *RoleDetail) SetPath(v string) *RoleDetail { - s.Path = &v - return s -} - -// SetRoleId sets the RoleId field's value. -func (s *RoleDetail) SetRoleId(v string) *RoleDetail { - s.RoleId = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *RoleDetail) SetRoleName(v string) *RoleDetail { - s.RoleName = &v - return s -} - -// SetRolePolicyList sets the RolePolicyList field's value. -func (s *RoleDetail) SetRolePolicyList(v []*PolicyDetail) *RoleDetail { - s.RolePolicyList = v - return s -} - -// Contains the list of SAML providers for this account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SAMLProviderListEntry -type SAMLProviderListEntry struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the SAML provider. - Arn *string `min:"20" type:"string"` - - // The date and time when the SAML provider was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The expiration date and time for the SAML provider. - ValidUntil *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SAMLProviderListEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SAMLProviderListEntry) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *SAMLProviderListEntry) SetArn(v string) *SAMLProviderListEntry { - s.Arn = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *SAMLProviderListEntry) SetCreateDate(v time.Time) *SAMLProviderListEntry { - s.CreateDate = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *SAMLProviderListEntry) SetValidUntil(v time.Time) *SAMLProviderListEntry { - s.ValidUntil = &v - return s -} - -// Contains information about an SSH public key. -// -// This data type is used as a response element in the GetSSHPublicKey and UploadSSHPublicKey -// actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SSHPublicKey -type SSHPublicKey struct { - _ struct{} `type:"structure"` - - // The MD5 message digest of the SSH public key. - // - // Fingerprint is a required field - Fingerprint *string `min:"48" type:"string" required:"true"` - - // The SSH public key. - // - // SSHPublicKeyBody is a required field - SSHPublicKeyBody *string `min:"1" type:"string" required:"true"` - - // The unique identifier for the SSH public key. - // - // SSHPublicKeyId is a required field - SSHPublicKeyId *string `min:"20" type:"string" required:"true"` - - // The status of the SSH public key. Active means the key can be used for authentication - // with an AWS CodeCommit repository. Inactive means the key cannot be used. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the SSH public key was uploaded. - UploadDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The name of the IAM user associated with the SSH public key. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SSHPublicKey) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SSHPublicKey) GoString() string { - return s.String() -} - -// SetFingerprint sets the Fingerprint field's value. -func (s *SSHPublicKey) SetFingerprint(v string) *SSHPublicKey { - s.Fingerprint = &v - return s -} - -// SetSSHPublicKeyBody sets the SSHPublicKeyBody field's value. -func (s *SSHPublicKey) SetSSHPublicKeyBody(v string) *SSHPublicKey { - s.SSHPublicKeyBody = &v - return s -} - -// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. -func (s *SSHPublicKey) SetSSHPublicKeyId(v string) *SSHPublicKey { - s.SSHPublicKeyId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SSHPublicKey) SetStatus(v string) *SSHPublicKey { - s.Status = &v - return s -} - -// SetUploadDate sets the UploadDate field's value. -func (s *SSHPublicKey) SetUploadDate(v time.Time) *SSHPublicKey { - s.UploadDate = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *SSHPublicKey) SetUserName(v string) *SSHPublicKey { - s.UserName = &v - return s -} - -// Contains information about an SSH public key, without the key's body or fingerprint. -// -// This data type is used as a response element in the ListSSHPublicKeys action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SSHPublicKeyMetadata -type SSHPublicKeyMetadata struct { - _ struct{} `type:"structure"` - - // The unique identifier for the SSH public key. - // - // SSHPublicKeyId is a required field - SSHPublicKeyId *string `min:"20" type:"string" required:"true"` - - // The status of the SSH public key. Active means the key can be used for authentication - // with an AWS CodeCommit repository. Inactive means the key cannot be used. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the SSH public key was uploaded. - // - // UploadDate is a required field - UploadDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The name of the IAM user associated with the SSH public key. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SSHPublicKeyMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SSHPublicKeyMetadata) GoString() string { - return s.String() -} - -// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. -func (s *SSHPublicKeyMetadata) SetSSHPublicKeyId(v string) *SSHPublicKeyMetadata { - s.SSHPublicKeyId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SSHPublicKeyMetadata) SetStatus(v string) *SSHPublicKeyMetadata { - s.Status = &v - return s -} - -// SetUploadDate sets the UploadDate field's value. -func (s *SSHPublicKeyMetadata) SetUploadDate(v time.Time) *SSHPublicKeyMetadata { - s.UploadDate = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *SSHPublicKeyMetadata) SetUserName(v string) *SSHPublicKeyMetadata { - s.UserName = &v - return s -} - -// Contains information about a server certificate. -// -// This data type is used as a response element in the GetServerCertificate -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ServerCertificate -type ServerCertificate struct { - _ struct{} `type:"structure"` - - // The contents of the public key certificate. - // - // CertificateBody is a required field - CertificateBody *string `min:"1" type:"string" required:"true"` - - // The contents of the public key certificate chain. - CertificateChain *string `min:"1" type:"string"` - - // The meta information of the server certificate, such as its name, path, ID, - // and ARN. - // - // ServerCertificateMetadata is a required field - ServerCertificateMetadata *ServerCertificateMetadata `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ServerCertificate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServerCertificate) GoString() string { - return s.String() -} - -// SetCertificateBody sets the CertificateBody field's value. -func (s *ServerCertificate) SetCertificateBody(v string) *ServerCertificate { - s.CertificateBody = &v - return s -} - -// SetCertificateChain sets the CertificateChain field's value. -func (s *ServerCertificate) SetCertificateChain(v string) *ServerCertificate { - s.CertificateChain = &v - return s -} - -// SetServerCertificateMetadata sets the ServerCertificateMetadata field's value. -func (s *ServerCertificate) SetServerCertificateMetadata(v *ServerCertificateMetadata) *ServerCertificate { - s.ServerCertificateMetadata = v - return s -} - -// Contains information about a server certificate without its certificate body, -// certificate chain, and private key. -// -// This data type is used as a response element in the UploadServerCertificate -// and ListServerCertificates actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ServerCertificateMetadata -type ServerCertificateMetadata struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) specifying the server certificate. For more - // information about ARNs and how to use them in policies, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Arn is a required field - Arn *string `min:"20" type:"string" required:"true"` - - // The date on which the certificate is set to expire. - Expiration *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The path to the server certificate. For more information about paths, see - // IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Path is a required field - Path *string `min:"1" type:"string" required:"true"` - - // The stable and unique string identifying the server certificate. For more - // information about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // ServerCertificateId is a required field - ServerCertificateId *string `min:"16" type:"string" required:"true"` - - // The name that identifies the server certificate. - // - // ServerCertificateName is a required field - ServerCertificateName *string `min:"1" type:"string" required:"true"` - - // The date when the server certificate was uploaded. - UploadDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ServerCertificateMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServerCertificateMetadata) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ServerCertificateMetadata) SetArn(v string) *ServerCertificateMetadata { - s.Arn = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *ServerCertificateMetadata) SetExpiration(v time.Time) *ServerCertificateMetadata { - s.Expiration = &v - return s -} - -// SetPath sets the Path field's value. -func (s *ServerCertificateMetadata) SetPath(v string) *ServerCertificateMetadata { - s.Path = &v - return s -} - -// SetServerCertificateId sets the ServerCertificateId field's value. -func (s *ServerCertificateMetadata) SetServerCertificateId(v string) *ServerCertificateMetadata { - s.ServerCertificateId = &v - return s -} - -// SetServerCertificateName sets the ServerCertificateName field's value. -func (s *ServerCertificateMetadata) SetServerCertificateName(v string) *ServerCertificateMetadata { - s.ServerCertificateName = &v - return s -} - -// SetUploadDate sets the UploadDate field's value. -func (s *ServerCertificateMetadata) SetUploadDate(v time.Time) *ServerCertificateMetadata { - s.UploadDate = &v - return s -} - -// Contains the details of a service specific credential. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ServiceSpecificCredential -type ServiceSpecificCredential struct { - _ struct{} `type:"structure"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the service-specific credential were created. - // - // CreateDate is a required field - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The name of the service associated with the service-specific credential. - // - // ServiceName is a required field - ServiceName *string `type:"string" required:"true"` - - // The generated password for the service-specific credential. - // - // ServicePassword is a required field - ServicePassword *string `type:"string" required:"true"` - - // The unique identifier for the service-specific credential. - // - // ServiceSpecificCredentialId is a required field - ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` - - // The generated user name for the service-specific credential. This value is - // generated by combining the IAM user's name combined with the ID number of - // the AWS account, as in jane-at-123456789012, for example. This value cannot - // be configured by the user. - // - // ServiceUserName is a required field - ServiceUserName *string `min:"17" type:"string" required:"true"` - - // The status of the service-specific credential. Active means the key is valid - // for API calls, while Inactive means it is not. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The name of the IAM user associated with the service-specific credential. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ServiceSpecificCredential) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceSpecificCredential) GoString() string { - return s.String() -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ServiceSpecificCredential) SetCreateDate(v time.Time) *ServiceSpecificCredential { - s.CreateDate = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *ServiceSpecificCredential) SetServiceName(v string) *ServiceSpecificCredential { - s.ServiceName = &v - return s -} - -// SetServicePassword sets the ServicePassword field's value. -func (s *ServiceSpecificCredential) SetServicePassword(v string) *ServiceSpecificCredential { - s.ServicePassword = &v - return s -} - -// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. -func (s *ServiceSpecificCredential) SetServiceSpecificCredentialId(v string) *ServiceSpecificCredential { - s.ServiceSpecificCredentialId = &v - return s -} - -// SetServiceUserName sets the ServiceUserName field's value. -func (s *ServiceSpecificCredential) SetServiceUserName(v string) *ServiceSpecificCredential { - s.ServiceUserName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ServiceSpecificCredential) SetStatus(v string) *ServiceSpecificCredential { - s.Status = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ServiceSpecificCredential) SetUserName(v string) *ServiceSpecificCredential { - s.UserName = &v - return s -} - -// Contains additional details about a service-specific credential. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ServiceSpecificCredentialMetadata -type ServiceSpecificCredentialMetadata struct { - _ struct{} `type:"structure"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the service-specific credential were created. - // - // CreateDate is a required field - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The name of the service associated with the service-specific credential. - // - // ServiceName is a required field - ServiceName *string `type:"string" required:"true"` - - // The unique identifier for the service-specific credential. - // - // ServiceSpecificCredentialId is a required field - ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` - - // The generated user name for the service-specific credential. - // - // ServiceUserName is a required field - ServiceUserName *string `min:"17" type:"string" required:"true"` - - // The status of the service-specific credential. Active means the key is valid - // for API calls, while Inactive means it is not. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The name of the IAM user associated with the service-specific credential. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ServiceSpecificCredentialMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceSpecificCredentialMetadata) GoString() string { - return s.String() -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ServiceSpecificCredentialMetadata) SetCreateDate(v time.Time) *ServiceSpecificCredentialMetadata { - s.CreateDate = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *ServiceSpecificCredentialMetadata) SetServiceName(v string) *ServiceSpecificCredentialMetadata { - s.ServiceName = &v - return s -} - -// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. -func (s *ServiceSpecificCredentialMetadata) SetServiceSpecificCredentialId(v string) *ServiceSpecificCredentialMetadata { - s.ServiceSpecificCredentialId = &v - return s -} - -// SetServiceUserName sets the ServiceUserName field's value. -func (s *ServiceSpecificCredentialMetadata) SetServiceUserName(v string) *ServiceSpecificCredentialMetadata { - s.ServiceUserName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ServiceSpecificCredentialMetadata) SetStatus(v string) *ServiceSpecificCredentialMetadata { - s.Status = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ServiceSpecificCredentialMetadata) SetUserName(v string) *ServiceSpecificCredentialMetadata { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SetDefaultPolicyVersionRequest -type SetDefaultPolicyVersionInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM policy whose default version you - // want to set. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicyArn is a required field - PolicyArn *string `min:"20" type:"string" required:"true"` - - // The version of the policy to set as the default (operative) version. - // - // For more information about managed policy versions, see Versioning for Managed - // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) - // in the IAM User Guide. - // - // VersionId is a required field - VersionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetDefaultPolicyVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetDefaultPolicyVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetDefaultPolicyVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetDefaultPolicyVersionInput"} - if s.PolicyArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyArn")) - } - if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) - } - if s.VersionId == nil { - invalidParams.Add(request.NewErrParamRequired("VersionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyArn sets the PolicyArn field's value. -func (s *SetDefaultPolicyVersionInput) SetPolicyArn(v string) *SetDefaultPolicyVersionInput { - s.PolicyArn = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *SetDefaultPolicyVersionInput) SetVersionId(v string) *SetDefaultPolicyVersionInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SetDefaultPolicyVersionOutput -type SetDefaultPolicyVersionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetDefaultPolicyVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetDefaultPolicyVersionOutput) GoString() string { - return s.String() -} - -// Contains information about an X.509 signing certificate. -// -// This data type is used as a response element in the UploadSigningCertificate -// and ListSigningCertificates actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SigningCertificate -type SigningCertificate struct { - _ struct{} `type:"structure"` - - // The contents of the signing certificate. - // - // CertificateBody is a required field - CertificateBody *string `min:"1" type:"string" required:"true"` - - // The ID for the signing certificate. - // - // CertificateId is a required field - CertificateId *string `min:"24" type:"string" required:"true"` - - // The status of the signing certificate. Active means the key is valid for - // API calls, while Inactive means it is not. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The date when the signing certificate was uploaded. - UploadDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The name of the user the signing certificate is associated with. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SigningCertificate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SigningCertificate) GoString() string { - return s.String() -} - -// SetCertificateBody sets the CertificateBody field's value. -func (s *SigningCertificate) SetCertificateBody(v string) *SigningCertificate { - s.CertificateBody = &v - return s -} - -// SetCertificateId sets the CertificateId field's value. -func (s *SigningCertificate) SetCertificateId(v string) *SigningCertificate { - s.CertificateId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SigningCertificate) SetStatus(v string) *SigningCertificate { - s.Status = &v - return s -} - -// SetUploadDate sets the UploadDate field's value. -func (s *SigningCertificate) SetUploadDate(v time.Time) *SigningCertificate { - s.UploadDate = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *SigningCertificate) SetUserName(v string) *SigningCertificate { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulateCustomPolicyRequest -type SimulateCustomPolicyInput struct { - _ struct{} `type:"structure"` - - // A list of names of API actions to evaluate in the simulation. Each action - // is evaluated against each resource. Each action must include the service - // identifier, such as iam:CreateUser. - // - // ActionNames is a required field - ActionNames []*string `type:"list" required:"true"` - - // The ARN of the IAM user that you want to use as the simulated caller of the - // APIs. CallerArn is required if you include a ResourcePolicy so that the policy's - // Principal element has a value to use in evaluating the policy. - // - // You can specify only the ARN of an IAM user. You cannot specify the ARN of - // an assumed role, federated user, or a service principal. - CallerArn *string `min:"1" type:"string"` - - // A list of context keys and corresponding values for the simulation to use. - // Whenever a context key is evaluated in one of the simulated IAM permission - // policies, the corresponding value is supplied. - ContextEntries []*ContextEntry `type:"list"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // A list of policy documents to include in the simulation. Each document is - // specified as a string containing the complete, valid JSON text of an IAM - // policy. Do not include any resource-based policies in this parameter. Any - // resource-based policy must be submitted with the ResourcePolicy parameter. - // The policies cannot be "scope-down" policies, such as you could include in - // a call to GetFederationToken (http://docs.aws.amazon.com/IAM/latest/APIReference/API_GetFederationToken.html) - // or one of the AssumeRole (http://docs.aws.amazon.com/IAM/latest/APIReference/API_AssumeRole.html) - // APIs to restrict what a user can do while using the temporary credentials. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PolicyInputList is a required field - PolicyInputList []*string `type:"list" required:"true"` - - // A list of ARNs of AWS resources to include in the simulation. If this parameter - // is not provided then the value defaults to * (all resources). Each API in - // the ActionNames parameter is evaluated for each resource in this list. The - // simulation determines the access result (allowed or denied) of each combination - // and reports it in the response. - // - // The simulation does not automatically retrieve policies for the specified - // resources. If you want to include a resource policy in the simulation, then - // you must include the policy as a string in the ResourcePolicy parameter. - // - // If you include a ResourcePolicy, then it must be applicable to all of the - // resources included in the simulation or you receive an invalid input error. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - ResourceArns []*string `type:"list"` - - // Specifies the type of simulation to run. Different APIs that support resource-based - // policies require different combinations of resources. By specifying the type - // of simulation to run, you enable the policy simulator to enforce the presence - // of the required resources to ensure reliable simulation results. If your - // simulation does not match one of the following scenarios, then you can omit - // this parameter. The following list shows each of the supported scenario values - // and the resources that you must define to run the simulation. - // - // Each of the EC2 scenarios requires that you specify instance, image, and - // security-group resources. If your scenario includes an EBS volume, then you - // must specify that volume as a resource. If the EC2 scenario includes VPC, - // then you must supply the network-interface resource. If it includes an IP - // subnet, then you must specify the subnet resource. For more information on - // the EC2 scenario options, see Supported Platforms (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html) - // in the AWS EC2 User Guide. - // - // * EC2-Classic-InstanceStore - // - // instance, image, security-group - // - // * EC2-Classic-EBS - // - // instance, image, security-group, volume - // - // * EC2-VPC-InstanceStore - // - // instance, image, security-group, network-interface - // - // * EC2-VPC-InstanceStore-Subnet - // - // instance, image, security-group, network-interface, subnet - // - // * EC2-VPC-EBS - // - // instance, image, security-group, network-interface, volume - // - // * EC2-VPC-EBS-Subnet - // - // instance, image, security-group, network-interface, subnet, volume - ResourceHandlingOption *string `min:"1" type:"string"` - - // An AWS account ID that specifies the owner of any simulated resource that - // does not identify its owner in the resource ARN, such as an S3 bucket or - // object. If ResourceOwner is specified, it is also used as the account owner - // of any ResourcePolicy included in the simulation. If the ResourceOwner parameter - // is not specified, then the owner of the resources and the resource policy - // defaults to the account of the identity provided in CallerArn. This parameter - // is required only if you specify a resource-based policy and account that - // owns the resource is different from the account that owns the simulated calling - // user CallerArn. - ResourceOwner *string `min:"1" type:"string"` - - // A resource-based policy to include in the simulation provided as a string. - // Each resource in the simulation is treated as if it had this policy attached. - // You can include only one resource-based policy in a simulation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - ResourcePolicy *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s SimulateCustomPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SimulateCustomPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SimulateCustomPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SimulateCustomPolicyInput"} - if s.ActionNames == nil { - invalidParams.Add(request.NewErrParamRequired("ActionNames")) - } - if s.CallerArn != nil && len(*s.CallerArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CallerArn", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PolicyInputList == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyInputList")) - } - if s.ResourceHandlingOption != nil && len(*s.ResourceHandlingOption) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceHandlingOption", 1)) - } - if s.ResourceOwner != nil && len(*s.ResourceOwner) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceOwner", 1)) - } - if s.ResourcePolicy != nil && len(*s.ResourcePolicy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourcePolicy", 1)) - } - if s.ContextEntries != nil { - for i, v := range s.ContextEntries { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContextEntries", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionNames sets the ActionNames field's value. -func (s *SimulateCustomPolicyInput) SetActionNames(v []*string) *SimulateCustomPolicyInput { - s.ActionNames = v - return s -} - -// SetCallerArn sets the CallerArn field's value. -func (s *SimulateCustomPolicyInput) SetCallerArn(v string) *SimulateCustomPolicyInput { - s.CallerArn = &v - return s -} - -// SetContextEntries sets the ContextEntries field's value. -func (s *SimulateCustomPolicyInput) SetContextEntries(v []*ContextEntry) *SimulateCustomPolicyInput { - s.ContextEntries = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *SimulateCustomPolicyInput) SetMarker(v string) *SimulateCustomPolicyInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *SimulateCustomPolicyInput) SetMaxItems(v int64) *SimulateCustomPolicyInput { - s.MaxItems = &v - return s -} - -// SetPolicyInputList sets the PolicyInputList field's value. -func (s *SimulateCustomPolicyInput) SetPolicyInputList(v []*string) *SimulateCustomPolicyInput { - s.PolicyInputList = v - return s -} - -// SetResourceArns sets the ResourceArns field's value. -func (s *SimulateCustomPolicyInput) SetResourceArns(v []*string) *SimulateCustomPolicyInput { - s.ResourceArns = v - return s -} - -// SetResourceHandlingOption sets the ResourceHandlingOption field's value. -func (s *SimulateCustomPolicyInput) SetResourceHandlingOption(v string) *SimulateCustomPolicyInput { - s.ResourceHandlingOption = &v - return s -} - -// SetResourceOwner sets the ResourceOwner field's value. -func (s *SimulateCustomPolicyInput) SetResourceOwner(v string) *SimulateCustomPolicyInput { - s.ResourceOwner = &v - return s -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *SimulateCustomPolicyInput) SetResourcePolicy(v string) *SimulateCustomPolicyInput { - s.ResourcePolicy = &v - return s -} - -// Contains the response to a successful SimulatePrincipalPolicy or SimulateCustomPolicy -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulatePolicyResponse -type SimulatePolicyResponse struct { - _ struct{} `type:"structure"` - - // The results of the simulation. - EvaluationResults []*EvaluationResult `type:"list"` - - // A flag that indicates whether there are more items to return. If your results - // were truncated, you can make a subsequent pagination request using the Marker - // request parameter to retrieve more items. Note that IAM might return fewer - // than the MaxItems number of results even when there are more results available. - // We recommend that you check IsTruncated after every call to ensure that you - // receive all of your results. - IsTruncated *bool `type:"boolean"` - - // When IsTruncated is true, this element is present and contains the value - // to use for the Marker parameter in a subsequent pagination request. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s SimulatePolicyResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SimulatePolicyResponse) GoString() string { - return s.String() -} - -// SetEvaluationResults sets the EvaluationResults field's value. -func (s *SimulatePolicyResponse) SetEvaluationResults(v []*EvaluationResult) *SimulatePolicyResponse { - s.EvaluationResults = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *SimulatePolicyResponse) SetIsTruncated(v bool) *SimulatePolicyResponse { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *SimulatePolicyResponse) SetMarker(v string) *SimulatePolicyResponse { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulatePrincipalPolicyRequest -type SimulatePrincipalPolicyInput struct { - _ struct{} `type:"structure"` - - // A list of names of API actions to evaluate in the simulation. Each action - // is evaluated for each resource. Each action must include the service identifier, - // such as iam:CreateUser. - // - // ActionNames is a required field - ActionNames []*string `type:"list" required:"true"` - - // The ARN of the IAM user that you want to specify as the simulated caller - // of the APIs. If you do not specify a CallerArn, it defaults to the ARN of - // the user that you specify in PolicySourceArn, if you specified a user. If - // you include both a PolicySourceArn (for example, arn:aws:iam::123456789012:user/David) - // and a CallerArn (for example, arn:aws:iam::123456789012:user/Bob), the result - // is that you simulate calling the APIs as Bob, as if Bob had David's policies. - // - // You can specify only the ARN of an IAM user. You cannot specify the ARN of - // an assumed role, federated user, or a service principal. - // - // CallerArn is required if you include a ResourcePolicy and the PolicySourceArn - // is not the ARN for an IAM user. This is required so that the resource-based - // policy's Principal element has a value to use in evaluating the policy. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - CallerArn *string `min:"1" type:"string"` - - // A list of context keys and corresponding values for the simulation to use. - // Whenever a context key is evaluated in one of the simulated IAM permission - // policies, the corresponding value is supplied. - ContextEntries []*ContextEntry `type:"list"` - - // Use this parameter only when paginating results and only after you receive - // a response indicating that the results are truncated. Set it to the value - // of the Marker element in the response that you received to indicate where - // the next call should start. - Marker *string `min:"1" type:"string"` - - // (Optional) Use this only when paginating results to indicate the maximum - // number of items you want in the response. If additional items exist beyond - // the maximum you specify, the IsTruncated response element is true. - // - // If you do not include this parameter, it defaults to 100. Note that IAM might - // return fewer results, even when there are more results available. In that - // case, the IsTruncated response element returns true and Marker contains a - // value to include in the subsequent call that tells the service where to continue - // from. - MaxItems *int64 `min:"1" type:"integer"` - - // An optional list of additional policy documents to include in the simulation. - // Each document is specified as a string containing the complete, valid JSON - // text of an IAM policy. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - PolicyInputList []*string `type:"list"` - - // The Amazon Resource Name (ARN) of a user, group, or role whose policies you - // want to include in the simulation. If you specify a user, group, or role, - // the simulation includes all policies that are associated with that entity. - // If you specify a user, the simulation also includes all policies that are - // attached to any groups the user belongs to. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // PolicySourceArn is a required field - PolicySourceArn *string `min:"20" type:"string" required:"true"` - - // A list of ARNs of AWS resources to include in the simulation. If this parameter - // is not provided then the value defaults to * (all resources). Each API in - // the ActionNames parameter is evaluated for each resource in this list. The - // simulation determines the access result (allowed or denied) of each combination - // and reports it in the response. - // - // The simulation does not automatically retrieve policies for the specified - // resources. If you want to include a resource policy in the simulation, then - // you must include the policy as a string in the ResourcePolicy parameter. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - ResourceArns []*string `type:"list"` - - // Specifies the type of simulation to run. Different APIs that support resource-based - // policies require different combinations of resources. By specifying the type - // of simulation to run, you enable the policy simulator to enforce the presence - // of the required resources to ensure reliable simulation results. If your - // simulation does not match one of the following scenarios, then you can omit - // this parameter. The following list shows each of the supported scenario values - // and the resources that you must define to run the simulation. - // - // Each of the EC2 scenarios requires that you specify instance, image, and - // security-group resources. If your scenario includes an EBS volume, then you - // must specify that volume as a resource. If the EC2 scenario includes VPC, - // then you must supply the network-interface resource. If it includes an IP - // subnet, then you must specify the subnet resource. For more information on - // the EC2 scenario options, see Supported Platforms (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html) - // in the AWS EC2 User Guide. - // - // * EC2-Classic-InstanceStore - // - // instance, image, security-group - // - // * EC2-Classic-EBS - // - // instance, image, security-group, volume - // - // * EC2-VPC-InstanceStore - // - // instance, image, security-group, network-interface - // - // * EC2-VPC-InstanceStore-Subnet - // - // instance, image, security-group, network-interface, subnet - // - // * EC2-VPC-EBS - // - // instance, image, security-group, network-interface, volume - // - // * EC2-VPC-EBS-Subnet - // - // instance, image, security-group, network-interface, subnet, volume - ResourceHandlingOption *string `min:"1" type:"string"` - - // An AWS account ID that specifies the owner of any simulated resource that - // does not identify its owner in the resource ARN, such as an S3 bucket or - // object. If ResourceOwner is specified, it is also used as the account owner - // of any ResourcePolicy included in the simulation. If the ResourceOwner parameter - // is not specified, then the owner of the resources and the resource policy - // defaults to the account of the identity provided in CallerArn. This parameter - // is required only if you specify a resource-based policy and account that - // owns the resource is different from the account that owns the simulated calling - // user CallerArn. - ResourceOwner *string `min:"1" type:"string"` - - // A resource-based policy to include in the simulation provided as a string. - // Each resource in the simulation is treated as if it had this policy attached. - // You can include only one resource-based policy in a simulation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - ResourcePolicy *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s SimulatePrincipalPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SimulatePrincipalPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SimulatePrincipalPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SimulatePrincipalPolicyInput"} - if s.ActionNames == nil { - invalidParams.Add(request.NewErrParamRequired("ActionNames")) - } - if s.CallerArn != nil && len(*s.CallerArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CallerArn", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.PolicySourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("PolicySourceArn")) - } - if s.PolicySourceArn != nil && len(*s.PolicySourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicySourceArn", 20)) - } - if s.ResourceHandlingOption != nil && len(*s.ResourceHandlingOption) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceHandlingOption", 1)) - } - if s.ResourceOwner != nil && len(*s.ResourceOwner) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceOwner", 1)) - } - if s.ResourcePolicy != nil && len(*s.ResourcePolicy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourcePolicy", 1)) - } - if s.ContextEntries != nil { - for i, v := range s.ContextEntries { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContextEntries", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionNames sets the ActionNames field's value. -func (s *SimulatePrincipalPolicyInput) SetActionNames(v []*string) *SimulatePrincipalPolicyInput { - s.ActionNames = v - return s -} - -// SetCallerArn sets the CallerArn field's value. -func (s *SimulatePrincipalPolicyInput) SetCallerArn(v string) *SimulatePrincipalPolicyInput { - s.CallerArn = &v - return s -} - -// SetContextEntries sets the ContextEntries field's value. -func (s *SimulatePrincipalPolicyInput) SetContextEntries(v []*ContextEntry) *SimulatePrincipalPolicyInput { - s.ContextEntries = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *SimulatePrincipalPolicyInput) SetMarker(v string) *SimulatePrincipalPolicyInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *SimulatePrincipalPolicyInput) SetMaxItems(v int64) *SimulatePrincipalPolicyInput { - s.MaxItems = &v - return s -} - -// SetPolicyInputList sets the PolicyInputList field's value. -func (s *SimulatePrincipalPolicyInput) SetPolicyInputList(v []*string) *SimulatePrincipalPolicyInput { - s.PolicyInputList = v - return s -} - -// SetPolicySourceArn sets the PolicySourceArn field's value. -func (s *SimulatePrincipalPolicyInput) SetPolicySourceArn(v string) *SimulatePrincipalPolicyInput { - s.PolicySourceArn = &v - return s -} - -// SetResourceArns sets the ResourceArns field's value. -func (s *SimulatePrincipalPolicyInput) SetResourceArns(v []*string) *SimulatePrincipalPolicyInput { - s.ResourceArns = v - return s -} - -// SetResourceHandlingOption sets the ResourceHandlingOption field's value. -func (s *SimulatePrincipalPolicyInput) SetResourceHandlingOption(v string) *SimulatePrincipalPolicyInput { - s.ResourceHandlingOption = &v - return s -} - -// SetResourceOwner sets the ResourceOwner field's value. -func (s *SimulatePrincipalPolicyInput) SetResourceOwner(v string) *SimulatePrincipalPolicyInput { - s.ResourceOwner = &v - return s -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *SimulatePrincipalPolicyInput) SetResourcePolicy(v string) *SimulatePrincipalPolicyInput { - s.ResourcePolicy = &v - return s -} - -// Contains a reference to a Statement element in a policy document that determines -// the result of the simulation. -// -// This data type is used by the MatchedStatements member of the EvaluationResult -// type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/Statement -type Statement struct { - _ struct{} `type:"structure"` - - // The row and column of the end of a Statement in an IAM policy. - EndPosition *Position `type:"structure"` - - // The identifier of the policy that was provided as an input. - SourcePolicyId *string `type:"string"` - - // The type of the policy. - SourcePolicyType *string `type:"string" enum:"PolicySourceType"` - - // The row and column of the beginning of the Statement in an IAM policy. - StartPosition *Position `type:"structure"` -} - -// String returns the string representation -func (s Statement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Statement) GoString() string { - return s.String() -} - -// SetEndPosition sets the EndPosition field's value. -func (s *Statement) SetEndPosition(v *Position) *Statement { - s.EndPosition = v - return s -} - -// SetSourcePolicyId sets the SourcePolicyId field's value. -func (s *Statement) SetSourcePolicyId(v string) *Statement { - s.SourcePolicyId = &v - return s -} - -// SetSourcePolicyType sets the SourcePolicyType field's value. -func (s *Statement) SetSourcePolicyType(v string) *Statement { - s.SourcePolicyType = &v - return s -} - -// SetStartPosition sets the StartPosition field's value. -func (s *Statement) SetStartPosition(v *Position) *Statement { - s.StartPosition = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccessKeyRequest -type UpdateAccessKeyInput struct { - _ struct{} `type:"structure"` - - // The access key ID of the secret access key you want to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // AccessKeyId is a required field - AccessKeyId *string `min:"16" type:"string" required:"true"` - - // The status you want to assign to the secret access key. Active means the - // key can be used for API calls to AWS, while Inactive means the key cannot - // be used. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The name of the user whose key you want to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateAccessKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAccessKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAccessKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAccessKeyInput"} - if s.AccessKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) - } - if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { - invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *UpdateAccessKeyInput) SetAccessKeyId(v string) *UpdateAccessKeyInput { - s.AccessKeyId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateAccessKeyInput) SetStatus(v string) *UpdateAccessKeyInput { - s.Status = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UpdateAccessKeyInput) SetUserName(v string) *UpdateAccessKeyInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccessKeyOutput -type UpdateAccessKeyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateAccessKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAccessKeyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccountPasswordPolicyRequest -type UpdateAccountPasswordPolicyInput struct { - _ struct{} `type:"structure"` - - // Allows all IAM users in your account to use the AWS Management Console to - // change their own passwords. For more information, see Letting IAM Users Change - // Their Own Passwords (http://docs.aws.amazon.com/IAM/latest/UserGuide/HowToPwdIAMUser.html) - // in the IAM User Guide. - // - // Default value: false - AllowUsersToChangePassword *bool `type:"boolean"` - - // Prevents IAM users from setting a new password after their password has expired. - // - // Default value: false - HardExpiry *bool `type:"boolean"` - - // The number of days that an IAM user password is valid. The default value - // of 0 means IAM user passwords never expire. - // - // Default value: 0 - MaxPasswordAge *int64 `min:"1" type:"integer"` - - // The minimum number of characters allowed in an IAM user password. - // - // Default value: 6 - MinimumPasswordLength *int64 `min:"6" type:"integer"` - - // Specifies the number of previous passwords that IAM users are prevented from - // reusing. The default value of 0 means IAM users are not prevented from reusing - // previous passwords. - // - // Default value: 0 - PasswordReusePrevention *int64 `min:"1" type:"integer"` - - // Specifies whether IAM user passwords must contain at least one lowercase - // character from the ISO basic Latin alphabet (a to z). - // - // Default value: false - RequireLowercaseCharacters *bool `type:"boolean"` - - // Specifies whether IAM user passwords must contain at least one numeric character - // (0 to 9). - // - // Default value: false - RequireNumbers *bool `type:"boolean"` - - // Specifies whether IAM user passwords must contain at least one of the following - // non-alphanumeric characters: - // - // ! @ # $ % ^ & * ( ) _ + - = [ ] { } | ' - // - // Default value: false - RequireSymbols *bool `type:"boolean"` - - // Specifies whether IAM user passwords must contain at least one uppercase - // character from the ISO basic Latin alphabet (A to Z). - // - // Default value: false - RequireUppercaseCharacters *bool `type:"boolean"` -} - -// String returns the string representation -func (s UpdateAccountPasswordPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAccountPasswordPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAccountPasswordPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAccountPasswordPolicyInput"} - if s.MaxPasswordAge != nil && *s.MaxPasswordAge < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxPasswordAge", 1)) - } - if s.MinimumPasswordLength != nil && *s.MinimumPasswordLength < 6 { - invalidParams.Add(request.NewErrParamMinValue("MinimumPasswordLength", 6)) - } - if s.PasswordReusePrevention != nil && *s.PasswordReusePrevention < 1 { - invalidParams.Add(request.NewErrParamMinValue("PasswordReusePrevention", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowUsersToChangePassword sets the AllowUsersToChangePassword field's value. -func (s *UpdateAccountPasswordPolicyInput) SetAllowUsersToChangePassword(v bool) *UpdateAccountPasswordPolicyInput { - s.AllowUsersToChangePassword = &v - return s -} - -// SetHardExpiry sets the HardExpiry field's value. -func (s *UpdateAccountPasswordPolicyInput) SetHardExpiry(v bool) *UpdateAccountPasswordPolicyInput { - s.HardExpiry = &v - return s -} - -// SetMaxPasswordAge sets the MaxPasswordAge field's value. -func (s *UpdateAccountPasswordPolicyInput) SetMaxPasswordAge(v int64) *UpdateAccountPasswordPolicyInput { - s.MaxPasswordAge = &v - return s -} - -// SetMinimumPasswordLength sets the MinimumPasswordLength field's value. -func (s *UpdateAccountPasswordPolicyInput) SetMinimumPasswordLength(v int64) *UpdateAccountPasswordPolicyInput { - s.MinimumPasswordLength = &v - return s -} - -// SetPasswordReusePrevention sets the PasswordReusePrevention field's value. -func (s *UpdateAccountPasswordPolicyInput) SetPasswordReusePrevention(v int64) *UpdateAccountPasswordPolicyInput { - s.PasswordReusePrevention = &v - return s -} - -// SetRequireLowercaseCharacters sets the RequireLowercaseCharacters field's value. -func (s *UpdateAccountPasswordPolicyInput) SetRequireLowercaseCharacters(v bool) *UpdateAccountPasswordPolicyInput { - s.RequireLowercaseCharacters = &v - return s -} - -// SetRequireNumbers sets the RequireNumbers field's value. -func (s *UpdateAccountPasswordPolicyInput) SetRequireNumbers(v bool) *UpdateAccountPasswordPolicyInput { - s.RequireNumbers = &v - return s -} - -// SetRequireSymbols sets the RequireSymbols field's value. -func (s *UpdateAccountPasswordPolicyInput) SetRequireSymbols(v bool) *UpdateAccountPasswordPolicyInput { - s.RequireSymbols = &v - return s -} - -// SetRequireUppercaseCharacters sets the RequireUppercaseCharacters field's value. -func (s *UpdateAccountPasswordPolicyInput) SetRequireUppercaseCharacters(v bool) *UpdateAccountPasswordPolicyInput { - s.RequireUppercaseCharacters = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccountPasswordPolicyOutput -type UpdateAccountPasswordPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateAccountPasswordPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAccountPasswordPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAssumeRolePolicyRequest -type UpdateAssumeRolePolicyInput struct { - _ struct{} `type:"structure"` - - // The policy that grants an entity permission to assume the role. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PolicyDocument is a required field - PolicyDocument *string `min:"1" type:"string" required:"true"` - - // The name of the role to update with the new policy. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // RoleName is a required field - RoleName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateAssumeRolePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAssumeRolePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAssumeRolePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAssumeRolePolicyInput"} - if s.PolicyDocument == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) - } - if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - if s.RoleName != nil && len(*s.RoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *UpdateAssumeRolePolicyInput) SetPolicyDocument(v string) *UpdateAssumeRolePolicyInput { - s.PolicyDocument = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *UpdateAssumeRolePolicyInput) SetRoleName(v string) *UpdateAssumeRolePolicyInput { - s.RoleName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAssumeRolePolicyOutput -type UpdateAssumeRolePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateAssumeRolePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAssumeRolePolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateGroupRequest -type UpdateGroupInput struct { - _ struct{} `type:"structure"` - - // Name of the IAM group to update. If you're changing the name of the group, - // this is the original name. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` - - // New name for the IAM group. Only include this if changing the group's name. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - NewGroupName *string `min:"1" type:"string"` - - // New path for the IAM group. Only include this if changing the group's path. - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - NewPath *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.NewGroupName != nil && len(*s.NewGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewGroupName", 1)) - } - if s.NewPath != nil && len(*s.NewPath) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewPath", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *UpdateGroupInput) SetGroupName(v string) *UpdateGroupInput { - s.GroupName = &v - return s -} - -// SetNewGroupName sets the NewGroupName field's value. -func (s *UpdateGroupInput) SetNewGroupName(v string) *UpdateGroupInput { - s.NewGroupName = &v - return s -} - -// SetNewPath sets the NewPath field's value. -func (s *UpdateGroupInput) SetNewPath(v string) *UpdateGroupInput { - s.NewPath = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateGroupOutput -type UpdateGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateLoginProfileRequest -type UpdateLoginProfileInput struct { - _ struct{} `type:"structure"` - - // The new password for the specified IAM user. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). However, - // the format can be further restricted by the account administrator by setting - // a password policy on the AWS account. For more information, see UpdateAccountPasswordPolicy. - Password *string `min:"1" type:"string"` - - // Allows this new password to be used only once by requiring the specified - // IAM user to set a new password on next sign-in. - PasswordResetRequired *bool `type:"boolean"` - - // The name of the user whose password you want to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateLoginProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateLoginProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateLoginProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateLoginProfileInput"} - if s.Password != nil && len(*s.Password) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Password", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPassword sets the Password field's value. -func (s *UpdateLoginProfileInput) SetPassword(v string) *UpdateLoginProfileInput { - s.Password = &v - return s -} - -// SetPasswordResetRequired sets the PasswordResetRequired field's value. -func (s *UpdateLoginProfileInput) SetPasswordResetRequired(v bool) *UpdateLoginProfileInput { - s.PasswordResetRequired = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UpdateLoginProfileInput) SetUserName(v string) *UpdateLoginProfileInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateLoginProfileOutput -type UpdateLoginProfileOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateLoginProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateLoginProfileOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateOpenIDConnectProviderThumbprintRequest -type UpdateOpenIDConnectProviderThumbprintInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM OIDC provider resource object for - // which you want to update the thumbprint. You can get a list of OIDC provider - // ARNs by using the ListOpenIDConnectProviders action. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // OpenIDConnectProviderArn is a required field - OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` - - // A list of certificate thumbprints that are associated with the specified - // IAM OpenID Connect provider. For more information, see CreateOpenIDConnectProvider. - // - // ThumbprintList is a required field - ThumbprintList []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateOpenIDConnectProviderThumbprintInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateOpenIDConnectProviderThumbprintInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateOpenIDConnectProviderThumbprintInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateOpenIDConnectProviderThumbprintInput"} - if s.OpenIDConnectProviderArn == nil { - invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) - } - if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) - } - if s.ThumbprintList == nil { - invalidParams.Add(request.NewErrParamRequired("ThumbprintList")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. -func (s *UpdateOpenIDConnectProviderThumbprintInput) SetOpenIDConnectProviderArn(v string) *UpdateOpenIDConnectProviderThumbprintInput { - s.OpenIDConnectProviderArn = &v - return s -} - -// SetThumbprintList sets the ThumbprintList field's value. -func (s *UpdateOpenIDConnectProviderThumbprintInput) SetThumbprintList(v []*string) *UpdateOpenIDConnectProviderThumbprintInput { - s.ThumbprintList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateOpenIDConnectProviderThumbprintOutput -type UpdateOpenIDConnectProviderThumbprintOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateOpenIDConnectProviderThumbprintOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateOpenIDConnectProviderThumbprintOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSAMLProviderRequest -type UpdateSAMLProviderInput struct { - _ struct{} `type:"structure"` - - // An XML document generated by an identity provider (IdP) that supports SAML - // 2.0. The document includes the issuer's name, expiration information, and - // keys that can be used to validate the SAML authentication response (assertions) - // that are received from the IdP. You must generate the metadata document using - // the identity management software that is used as your organization's IdP. - // - // SAMLMetadataDocument is a required field - SAMLMetadataDocument *string `min:"1000" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the SAML provider to update. - // - // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // SAMLProviderArn is a required field - SAMLProviderArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateSAMLProviderInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSAMLProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSAMLProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSAMLProviderInput"} - if s.SAMLMetadataDocument == nil { - invalidParams.Add(request.NewErrParamRequired("SAMLMetadataDocument")) - } - if s.SAMLMetadataDocument != nil && len(*s.SAMLMetadataDocument) < 1000 { - invalidParams.Add(request.NewErrParamMinLen("SAMLMetadataDocument", 1000)) - } - if s.SAMLProviderArn == nil { - invalidParams.Add(request.NewErrParamRequired("SAMLProviderArn")) - } - if s.SAMLProviderArn != nil && len(*s.SAMLProviderArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("SAMLProviderArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSAMLMetadataDocument sets the SAMLMetadataDocument field's value. -func (s *UpdateSAMLProviderInput) SetSAMLMetadataDocument(v string) *UpdateSAMLProviderInput { - s.SAMLMetadataDocument = &v - return s -} - -// SetSAMLProviderArn sets the SAMLProviderArn field's value. -func (s *UpdateSAMLProviderInput) SetSAMLProviderArn(v string) *UpdateSAMLProviderInput { - s.SAMLProviderArn = &v - return s -} - -// Contains the response to a successful UpdateSAMLProvider request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSAMLProviderResponse -type UpdateSAMLProviderOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the SAML provider that was updated. - SAMLProviderArn *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s UpdateSAMLProviderOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSAMLProviderOutput) GoString() string { - return s.String() -} - -// SetSAMLProviderArn sets the SAMLProviderArn field's value. -func (s *UpdateSAMLProviderOutput) SetSAMLProviderArn(v string) *UpdateSAMLProviderOutput { - s.SAMLProviderArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSSHPublicKeyRequest -type UpdateSSHPublicKeyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the SSH public key. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // SSHPublicKeyId is a required field - SSHPublicKeyId *string `min:"20" type:"string" required:"true"` - - // The status to assign to the SSH public key. Active means the key can be used - // for authentication with an AWS CodeCommit repository. Inactive means the - // key cannot be used. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The name of the IAM user associated with the SSH public key. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateSSHPublicKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSSHPublicKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSSHPublicKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSSHPublicKeyInput"} - if s.SSHPublicKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("SSHPublicKeyId")) - } - if s.SSHPublicKeyId != nil && len(*s.SSHPublicKeyId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("SSHPublicKeyId", 20)) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. -func (s *UpdateSSHPublicKeyInput) SetSSHPublicKeyId(v string) *UpdateSSHPublicKeyInput { - s.SSHPublicKeyId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateSSHPublicKeyInput) SetStatus(v string) *UpdateSSHPublicKeyInput { - s.Status = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UpdateSSHPublicKeyInput) SetUserName(v string) *UpdateSSHPublicKeyInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSSHPublicKeyOutput -type UpdateSSHPublicKeyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateSSHPublicKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSSHPublicKeyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServerCertificateRequest -type UpdateServerCertificateInput struct { - _ struct{} `type:"structure"` - - // The new path for the server certificate. Include this only if you are updating - // the server certificate's path. - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - NewPath *string `min:"1" type:"string"` - - // The new name for the server certificate. Include this only if you are updating - // the server certificate's name. The name of the certificate cannot contain - // any spaces. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - NewServerCertificateName *string `min:"1" type:"string"` - - // The name of the server certificate that you want to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // ServerCertificateName is a required field - ServerCertificateName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateServerCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateServerCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateServerCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateServerCertificateInput"} - if s.NewPath != nil && len(*s.NewPath) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewPath", 1)) - } - if s.NewServerCertificateName != nil && len(*s.NewServerCertificateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewServerCertificateName", 1)) - } - if s.ServerCertificateName == nil { - invalidParams.Add(request.NewErrParamRequired("ServerCertificateName")) - } - if s.ServerCertificateName != nil && len(*s.ServerCertificateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServerCertificateName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNewPath sets the NewPath field's value. -func (s *UpdateServerCertificateInput) SetNewPath(v string) *UpdateServerCertificateInput { - s.NewPath = &v - return s -} - -// SetNewServerCertificateName sets the NewServerCertificateName field's value. -func (s *UpdateServerCertificateInput) SetNewServerCertificateName(v string) *UpdateServerCertificateInput { - s.NewServerCertificateName = &v - return s -} - -// SetServerCertificateName sets the ServerCertificateName field's value. -func (s *UpdateServerCertificateInput) SetServerCertificateName(v string) *UpdateServerCertificateInput { - s.ServerCertificateName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServerCertificateOutput -type UpdateServerCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateServerCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateServerCertificateOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServiceSpecificCredentialRequest -type UpdateServiceSpecificCredentialInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the service-specific credential. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // ServiceSpecificCredentialId is a required field - ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` - - // The status to be assigned to the service-specific credential. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The name of the IAM user associated with the service-specific credential. - // If you do not specify this value, then the operation assumes the user whose - // credentials are used to call the operation. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateServiceSpecificCredentialInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateServiceSpecificCredentialInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateServiceSpecificCredentialInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateServiceSpecificCredentialInput"} - if s.ServiceSpecificCredentialId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceSpecificCredentialId")) - } - if s.ServiceSpecificCredentialId != nil && len(*s.ServiceSpecificCredentialId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ServiceSpecificCredentialId", 20)) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. -func (s *UpdateServiceSpecificCredentialInput) SetServiceSpecificCredentialId(v string) *UpdateServiceSpecificCredentialInput { - s.ServiceSpecificCredentialId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateServiceSpecificCredentialInput) SetStatus(v string) *UpdateServiceSpecificCredentialInput { - s.Status = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UpdateServiceSpecificCredentialInput) SetUserName(v string) *UpdateServiceSpecificCredentialInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServiceSpecificCredentialOutput -type UpdateServiceSpecificCredentialOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateServiceSpecificCredentialOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateServiceSpecificCredentialOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSigningCertificateRequest -type UpdateSigningCertificateInput struct { - _ struct{} `type:"structure"` - - // The ID of the signing certificate you want to update. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters that can consist of any upper or lowercased letter - // or digit. - // - // CertificateId is a required field - CertificateId *string `min:"24" type:"string" required:"true"` - - // The status you want to assign to the certificate. Active means the certificate - // can be used for API calls to AWS, while Inactive means the certificate cannot - // be used. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` - - // The name of the IAM user the signing certificate belongs to. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateSigningCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSigningCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSigningCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSigningCertificateInput"} - if s.CertificateId == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateId")) - } - if s.CertificateId != nil && len(*s.CertificateId) < 24 { - invalidParams.Add(request.NewErrParamMinLen("CertificateId", 24)) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateId sets the CertificateId field's value. -func (s *UpdateSigningCertificateInput) SetCertificateId(v string) *UpdateSigningCertificateInput { - s.CertificateId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateSigningCertificateInput) SetStatus(v string) *UpdateSigningCertificateInput { - s.Status = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UpdateSigningCertificateInput) SetUserName(v string) *UpdateSigningCertificateInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSigningCertificateOutput -type UpdateSigningCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateSigningCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSigningCertificateOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateUserRequest -type UpdateUserInput struct { - _ struct{} `type:"structure"` - - // New path for the IAM user. Include this parameter only if you're changing - // the user's path. - // - // This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - NewPath *string `min:"1" type:"string"` - - // New name for the user. Include this parameter only if you're changing the - // user's name. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - NewUserName *string `min:"1" type:"string"` - - // Name of the user to update. If you're changing the name of the user, this - // is the original user name. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateUserInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateUserInput"} - if s.NewPath != nil && len(*s.NewPath) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewPath", 1)) - } - if s.NewUserName != nil && len(*s.NewUserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NewUserName", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNewPath sets the NewPath field's value. -func (s *UpdateUserInput) SetNewPath(v string) *UpdateUserInput { - s.NewPath = &v - return s -} - -// SetNewUserName sets the NewUserName field's value. -func (s *UpdateUserInput) SetNewUserName(v string) *UpdateUserInput { - s.NewUserName = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UpdateUserInput) SetUserName(v string) *UpdateUserInput { - s.UserName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateUserOutput -type UpdateUserOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateUserOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateUserOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSSHPublicKeyRequest -type UploadSSHPublicKeyInput struct { - _ struct{} `type:"structure"` - - // The SSH public key. The public key must be encoded in ssh-rsa format or PEM - // format. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // SSHPublicKeyBody is a required field - SSHPublicKeyBody *string `min:"1" type:"string" required:"true"` - - // The name of the IAM user to associate the SSH public key with. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UploadSSHPublicKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadSSHPublicKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadSSHPublicKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadSSHPublicKeyInput"} - if s.SSHPublicKeyBody == nil { - invalidParams.Add(request.NewErrParamRequired("SSHPublicKeyBody")) - } - if s.SSHPublicKeyBody != nil && len(*s.SSHPublicKeyBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SSHPublicKeyBody", 1)) - } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSSHPublicKeyBody sets the SSHPublicKeyBody field's value. -func (s *UploadSSHPublicKeyInput) SetSSHPublicKeyBody(v string) *UploadSSHPublicKeyInput { - s.SSHPublicKeyBody = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UploadSSHPublicKeyInput) SetUserName(v string) *UploadSSHPublicKeyInput { - s.UserName = &v - return s -} - -// Contains the response to a successful UploadSSHPublicKey request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSSHPublicKeyResponse -type UploadSSHPublicKeyOutput struct { - _ struct{} `type:"structure"` - - // Contains information about the SSH public key. - SSHPublicKey *SSHPublicKey `type:"structure"` -} - -// String returns the string representation -func (s UploadSSHPublicKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadSSHPublicKeyOutput) GoString() string { - return s.String() -} - -// SetSSHPublicKey sets the SSHPublicKey field's value. -func (s *UploadSSHPublicKeyOutput) SetSSHPublicKey(v *SSHPublicKey) *UploadSSHPublicKeyOutput { - s.SSHPublicKey = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadServerCertificateRequest -type UploadServerCertificateInput struct { - _ struct{} `type:"structure"` - - // The contents of the public key certificate in PEM-encoded format. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // CertificateBody is a required field - CertificateBody *string `min:"1" type:"string" required:"true"` - - // The contents of the certificate chain. This is typically a concatenation - // of the PEM-encoded public key certificates of the chain. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - CertificateChain *string `min:"1" type:"string"` - - // The path for the server certificate. For more information about paths, see - // IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). This paramater allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of either a forward slash (/) by itself - // or a string that must begin and end with forward slashes, containing any - // ASCII character from the ! (\u0021) thru the DEL character (\u007F), including - // most punctuation characters, digits, and upper and lowercased letters. - // - // If you are uploading a server certificate specifically for use with Amazon - // CloudFront distributions, you must specify a path using the --path option. - // The path must begin with /cloudfront and must include a trailing slash (for - // example, /cloudfront/test/). - Path *string `min:"1" type:"string"` - - // The contents of the private key in PEM-encoded format. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // PrivateKey is a required field - PrivateKey *string `min:"1" type:"string" required:"true"` - - // The name for the server certificate. Do not include the path in this value. - // The name of the certificate cannot contain any spaces. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - // - // ServerCertificateName is a required field - ServerCertificateName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UploadServerCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadServerCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadServerCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadServerCertificateInput"} - if s.CertificateBody == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateBody")) - } - if s.CertificateBody != nil && len(*s.CertificateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CertificateBody", 1)) - } - if s.CertificateChain != nil && len(*s.CertificateChain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CertificateChain", 1)) - } - if s.Path != nil && len(*s.Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Path", 1)) - } - if s.PrivateKey == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKey")) - } - if s.PrivateKey != nil && len(*s.PrivateKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PrivateKey", 1)) - } - if s.ServerCertificateName == nil { - invalidParams.Add(request.NewErrParamRequired("ServerCertificateName")) - } - if s.ServerCertificateName != nil && len(*s.ServerCertificateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServerCertificateName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateBody sets the CertificateBody field's value. -func (s *UploadServerCertificateInput) SetCertificateBody(v string) *UploadServerCertificateInput { - s.CertificateBody = &v - return s -} - -// SetCertificateChain sets the CertificateChain field's value. -func (s *UploadServerCertificateInput) SetCertificateChain(v string) *UploadServerCertificateInput { - s.CertificateChain = &v - return s -} - -// SetPath sets the Path field's value. -func (s *UploadServerCertificateInput) SetPath(v string) *UploadServerCertificateInput { - s.Path = &v - return s -} - -// SetPrivateKey sets the PrivateKey field's value. -func (s *UploadServerCertificateInput) SetPrivateKey(v string) *UploadServerCertificateInput { - s.PrivateKey = &v - return s -} - -// SetServerCertificateName sets the ServerCertificateName field's value. -func (s *UploadServerCertificateInput) SetServerCertificateName(v string) *UploadServerCertificateInput { - s.ServerCertificateName = &v - return s -} - -// Contains the response to a successful UploadServerCertificate request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadServerCertificateResponse -type UploadServerCertificateOutput struct { - _ struct{} `type:"structure"` - - // The meta information of the uploaded server certificate without its certificate - // body, certificate chain, and private key. - ServerCertificateMetadata *ServerCertificateMetadata `type:"structure"` -} - -// String returns the string representation -func (s UploadServerCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadServerCertificateOutput) GoString() string { - return s.String() -} - -// SetServerCertificateMetadata sets the ServerCertificateMetadata field's value. -func (s *UploadServerCertificateOutput) SetServerCertificateMetadata(v *ServerCertificateMetadata) *UploadServerCertificateOutput { - s.ServerCertificateMetadata = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSigningCertificateRequest -type UploadSigningCertificateInput struct { - _ struct{} `type:"structure"` - - // The contents of the signing certificate. - // - // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this - // parameter is a string of characters consisting of any printable ASCII character - // ranging from the space character (\u0020) through end of the ASCII character - // range as well as the printable characters in the Basic Latin and Latin-1 - // Supplement character set (through \u00FF). It also includes the special characters - // tab (\u0009), line feed (\u000A), and carriage return (\u000D). - // - // CertificateBody is a required field - CertificateBody *string `min:"1" type:"string" required:"true"` - - // The name of the user the signing certificate is for. - // - // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) - // a string of characters consisting of upper and lowercase alphanumeric characters - // with no spaces. You can also include any of the following characters: =,.@- - UserName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UploadSigningCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadSigningCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadSigningCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadSigningCertificateInput"} - if s.CertificateBody == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateBody")) - } - if s.CertificateBody != nil && len(*s.CertificateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CertificateBody", 1)) - } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateBody sets the CertificateBody field's value. -func (s *UploadSigningCertificateInput) SetCertificateBody(v string) *UploadSigningCertificateInput { - s.CertificateBody = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UploadSigningCertificateInput) SetUserName(v string) *UploadSigningCertificateInput { - s.UserName = &v - return s -} - -// Contains the response to a successful UploadSigningCertificate request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSigningCertificateResponse -type UploadSigningCertificateOutput struct { - _ struct{} `type:"structure"` - - // Information about the certificate. - // - // Certificate is a required field - Certificate *SigningCertificate `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UploadSigningCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadSigningCertificateOutput) GoString() string { - return s.String() -} - -// SetCertificate sets the Certificate field's value. -func (s *UploadSigningCertificateOutput) SetCertificate(v *SigningCertificate) *UploadSigningCertificateOutput { - s.Certificate = v - return s -} - -// Contains information about an IAM user entity. -// -// This data type is used as a response element in the following actions: -// -// * CreateUser -// -// * GetUser -// -// * ListUsers -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/User -type User struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that identifies the user. For more information - // about ARNs and how to use ARNs in policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Arn is a required field - Arn *string `min:"20" type:"string" required:"true"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the user was created. - // - // CreateDate is a required field - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the user's password was last used to sign in to an AWS website. For - // a list of AWS websites that capture a user's last sign-in time, see the Credential - // Reports (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) - // topic in the Using IAM guide. If a password is used more than once in a five-minute - // span, only the first use is returned in this field. This field is null (not - // present) when: - // - // * The user does not have a password - // - // * The password exists but has never been used (at least not since IAM - // started tracking this information on October 20th, 2014 - // - // * there is no sign-in data associated with the user - // - // This value is returned only in the GetUser and ListUsers actions. - PasswordLastUsed *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The path to the user. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // Path is a required field - Path *string `min:"1" type:"string" required:"true"` - - // The stable and unique string identifying the user. For more information about - // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - // - // UserId is a required field - UserId *string `min:"16" type:"string" required:"true"` - - // The friendly name identifying the user. - // - // UserName is a required field - UserName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s User) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s User) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *User) SetArn(v string) *User { - s.Arn = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *User) SetCreateDate(v time.Time) *User { - s.CreateDate = &v - return s -} - -// SetPasswordLastUsed sets the PasswordLastUsed field's value. -func (s *User) SetPasswordLastUsed(v time.Time) *User { - s.PasswordLastUsed = &v - return s -} - -// SetPath sets the Path field's value. -func (s *User) SetPath(v string) *User { - s.Path = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *User) SetUserId(v string) *User { - s.UserId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *User) SetUserName(v string) *User { - s.UserName = &v - return s -} - -// Contains information about an IAM user, including all the user's policies -// and all the IAM groups the user is in. -// -// This data type is used as a response element in the GetAccountAuthorizationDetails -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UserDetail -type UserDetail struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. - // - // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS - // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - Arn *string `min:"20" type:"string"` - - // A list of the managed policies attached to the user. - AttachedManagedPolicies []*AttachedPolicy `type:"list"` - - // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), - // when the user was created. - CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A list of IAM groups that the user is in. - GroupList []*string `type:"list"` - - // The path to the user. For more information about paths, see IAM Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - Path *string `min:"1" type:"string"` - - // The stable and unique string identifying the user. For more information about - // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. - UserId *string `min:"16" type:"string"` - - // The friendly name identifying the user. - UserName *string `min:"1" type:"string"` - - // A list of the inline policies embedded in the user. - UserPolicyList []*PolicyDetail `type:"list"` -} - -// String returns the string representation -func (s UserDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UserDetail) SetArn(v string) *UserDetail { - s.Arn = &v - return s -} - -// SetAttachedManagedPolicies sets the AttachedManagedPolicies field's value. -func (s *UserDetail) SetAttachedManagedPolicies(v []*AttachedPolicy) *UserDetail { - s.AttachedManagedPolicies = v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *UserDetail) SetCreateDate(v time.Time) *UserDetail { - s.CreateDate = &v - return s -} - -// SetGroupList sets the GroupList field's value. -func (s *UserDetail) SetGroupList(v []*string) *UserDetail { - s.GroupList = v - return s -} - -// SetPath sets the Path field's value. -func (s *UserDetail) SetPath(v string) *UserDetail { - s.Path = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *UserDetail) SetUserId(v string) *UserDetail { - s.UserId = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *UserDetail) SetUserName(v string) *UserDetail { - s.UserName = &v - return s -} - -// SetUserPolicyList sets the UserPolicyList field's value. -func (s *UserDetail) SetUserPolicyList(v []*PolicyDetail) *UserDetail { - s.UserPolicyList = v - return s -} - -// Contains information about a virtual MFA device. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/VirtualMFADevice -type VirtualMFADevice struct { - _ struct{} `type:"structure"` - - // The Base32 seed defined as specified in RFC3548 (https://tools.ietf.org/html/rfc3548.txt). - // The Base32StringSeed is Base64-encoded. - // - // Base32StringSeed is automatically base64 encoded/decoded by the SDK. - Base32StringSeed []byte `type:"blob"` - - // The date and time on which the virtual MFA device was enabled. - EnableDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String - // where $virtualMFADeviceName is one of the create call arguments, AccountName - // is the user name if set (otherwise, the account ID otherwise), and Base32String - // is the seed in Base32 format. The Base32String value is Base64-encoded. - // - // QRCodePNG is automatically base64 encoded/decoded by the SDK. - QRCodePNG []byte `type:"blob"` - - // The serial number associated with VirtualMFADevice. - // - // SerialNumber is a required field - SerialNumber *string `min:"9" type:"string" required:"true"` - - // The user to whom the MFA device is assigned. - User *User `type:"structure"` -} - -// String returns the string representation -func (s VirtualMFADevice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VirtualMFADevice) GoString() string { - return s.String() -} - -// SetBase32StringSeed sets the Base32StringSeed field's value. -func (s *VirtualMFADevice) SetBase32StringSeed(v []byte) *VirtualMFADevice { - s.Base32StringSeed = v - return s -} - -// SetEnableDate sets the EnableDate field's value. -func (s *VirtualMFADevice) SetEnableDate(v time.Time) *VirtualMFADevice { - s.EnableDate = &v - return s -} - -// SetQRCodePNG sets the QRCodePNG field's value. -func (s *VirtualMFADevice) SetQRCodePNG(v []byte) *VirtualMFADevice { - s.QRCodePNG = v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *VirtualMFADevice) SetSerialNumber(v string) *VirtualMFADevice { - s.SerialNumber = &v - return s -} - -// SetUser sets the User field's value. -func (s *VirtualMFADevice) SetUser(v *User) *VirtualMFADevice { - s.User = v - return s -} - -const ( - // ContextKeyTypeEnumString is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumString = "string" - - // ContextKeyTypeEnumStringList is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumStringList = "stringList" - - // ContextKeyTypeEnumNumeric is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumNumeric = "numeric" - - // ContextKeyTypeEnumNumericList is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumNumericList = "numericList" - - // ContextKeyTypeEnumBoolean is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumBoolean = "boolean" - - // ContextKeyTypeEnumBooleanList is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumBooleanList = "booleanList" - - // ContextKeyTypeEnumIp is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumIp = "ip" - - // ContextKeyTypeEnumIpList is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumIpList = "ipList" - - // ContextKeyTypeEnumBinary is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumBinary = "binary" - - // ContextKeyTypeEnumBinaryList is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumBinaryList = "binaryList" - - // ContextKeyTypeEnumDate is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumDate = "date" - - // ContextKeyTypeEnumDateList is a ContextKeyTypeEnum enum value - ContextKeyTypeEnumDateList = "dateList" -) - -const ( - // EntityTypeUser is a EntityType enum value - EntityTypeUser = "User" - - // EntityTypeRole is a EntityType enum value - EntityTypeRole = "Role" - - // EntityTypeGroup is a EntityType enum value - EntityTypeGroup = "Group" - - // EntityTypeLocalManagedPolicy is a EntityType enum value - EntityTypeLocalManagedPolicy = "LocalManagedPolicy" - - // EntityTypeAwsmanagedPolicy is a EntityType enum value - EntityTypeAwsmanagedPolicy = "AWSManagedPolicy" -) - -const ( - // PolicyEvaluationDecisionTypeAllowed is a PolicyEvaluationDecisionType enum value - PolicyEvaluationDecisionTypeAllowed = "allowed" - - // PolicyEvaluationDecisionTypeExplicitDeny is a PolicyEvaluationDecisionType enum value - PolicyEvaluationDecisionTypeExplicitDeny = "explicitDeny" - - // PolicyEvaluationDecisionTypeImplicitDeny is a PolicyEvaluationDecisionType enum value - PolicyEvaluationDecisionTypeImplicitDeny = "implicitDeny" -) - -const ( - // PolicySourceTypeUser is a PolicySourceType enum value - PolicySourceTypeUser = "user" - - // PolicySourceTypeGroup is a PolicySourceType enum value - PolicySourceTypeGroup = "group" - - // PolicySourceTypeRole is a PolicySourceType enum value - PolicySourceTypeRole = "role" - - // PolicySourceTypeAwsManaged is a PolicySourceType enum value - PolicySourceTypeAwsManaged = "aws-managed" - - // PolicySourceTypeUserManaged is a PolicySourceType enum value - PolicySourceTypeUserManaged = "user-managed" - - // PolicySourceTypeResource is a PolicySourceType enum value - PolicySourceTypeResource = "resource" - - // PolicySourceTypeNone is a PolicySourceType enum value - PolicySourceTypeNone = "none" -) - -const ( - // ReportFormatTypeTextCsv is a ReportFormatType enum value - ReportFormatTypeTextCsv = "text/csv" -) - -const ( - // ReportStateTypeStarted is a ReportStateType enum value - ReportStateTypeStarted = "STARTED" - - // ReportStateTypeInprogress is a ReportStateType enum value - ReportStateTypeInprogress = "INPROGRESS" - - // ReportStateTypeComplete is a ReportStateType enum value - ReportStateTypeComplete = "COMPLETE" -) - -const ( - // AssignmentStatusTypeAssigned is a assignmentStatusType enum value - AssignmentStatusTypeAssigned = "Assigned" - - // AssignmentStatusTypeUnassigned is a assignmentStatusType enum value - AssignmentStatusTypeUnassigned = "Unassigned" - - // AssignmentStatusTypeAny is a assignmentStatusType enum value - AssignmentStatusTypeAny = "Any" -) - -const ( - // EncodingTypeSsh is a encodingType enum value - EncodingTypeSsh = "SSH" - - // EncodingTypePem is a encodingType enum value - EncodingTypePem = "PEM" -) - -const ( - // PolicyScopeTypeAll is a policyScopeType enum value - PolicyScopeTypeAll = "All" - - // PolicyScopeTypeAws is a policyScopeType enum value - PolicyScopeTypeAws = "AWS" - - // PolicyScopeTypeLocal is a policyScopeType enum value - PolicyScopeTypeLocal = "Local" -) - -const ( - // StatusTypeActive is a statusType enum value - StatusTypeActive = "Active" - - // StatusTypeInactive is a statusType enum value - StatusTypeInactive = "Inactive" -) - -const ( - // SummaryKeyTypeUsers is a summaryKeyType enum value - SummaryKeyTypeUsers = "Users" - - // SummaryKeyTypeUsersQuota is a summaryKeyType enum value - SummaryKeyTypeUsersQuota = "UsersQuota" - - // SummaryKeyTypeGroups is a summaryKeyType enum value - SummaryKeyTypeGroups = "Groups" - - // SummaryKeyTypeGroupsQuota is a summaryKeyType enum value - SummaryKeyTypeGroupsQuota = "GroupsQuota" - - // SummaryKeyTypeServerCertificates is a summaryKeyType enum value - SummaryKeyTypeServerCertificates = "ServerCertificates" - - // SummaryKeyTypeServerCertificatesQuota is a summaryKeyType enum value - SummaryKeyTypeServerCertificatesQuota = "ServerCertificatesQuota" - - // SummaryKeyTypeUserPolicySizeQuota is a summaryKeyType enum value - SummaryKeyTypeUserPolicySizeQuota = "UserPolicySizeQuota" - - // SummaryKeyTypeGroupPolicySizeQuota is a summaryKeyType enum value - SummaryKeyTypeGroupPolicySizeQuota = "GroupPolicySizeQuota" - - // SummaryKeyTypeGroupsPerUserQuota is a summaryKeyType enum value - SummaryKeyTypeGroupsPerUserQuota = "GroupsPerUserQuota" - - // SummaryKeyTypeSigningCertificatesPerUserQuota is a summaryKeyType enum value - SummaryKeyTypeSigningCertificatesPerUserQuota = "SigningCertificatesPerUserQuota" - - // SummaryKeyTypeAccessKeysPerUserQuota is a summaryKeyType enum value - SummaryKeyTypeAccessKeysPerUserQuota = "AccessKeysPerUserQuota" - - // SummaryKeyTypeMfadevices is a summaryKeyType enum value - SummaryKeyTypeMfadevices = "MFADevices" - - // SummaryKeyTypeMfadevicesInUse is a summaryKeyType enum value - SummaryKeyTypeMfadevicesInUse = "MFADevicesInUse" - - // SummaryKeyTypeAccountMfaenabled is a summaryKeyType enum value - SummaryKeyTypeAccountMfaenabled = "AccountMFAEnabled" - - // SummaryKeyTypeAccountAccessKeysPresent is a summaryKeyType enum value - SummaryKeyTypeAccountAccessKeysPresent = "AccountAccessKeysPresent" - - // SummaryKeyTypeAccountSigningCertificatesPresent is a summaryKeyType enum value - SummaryKeyTypeAccountSigningCertificatesPresent = "AccountSigningCertificatesPresent" - - // SummaryKeyTypeAttachedPoliciesPerGroupQuota is a summaryKeyType enum value - SummaryKeyTypeAttachedPoliciesPerGroupQuota = "AttachedPoliciesPerGroupQuota" - - // SummaryKeyTypeAttachedPoliciesPerRoleQuota is a summaryKeyType enum value - SummaryKeyTypeAttachedPoliciesPerRoleQuota = "AttachedPoliciesPerRoleQuota" - - // SummaryKeyTypeAttachedPoliciesPerUserQuota is a summaryKeyType enum value - SummaryKeyTypeAttachedPoliciesPerUserQuota = "AttachedPoliciesPerUserQuota" - - // SummaryKeyTypePolicies is a summaryKeyType enum value - SummaryKeyTypePolicies = "Policies" - - // SummaryKeyTypePoliciesQuota is a summaryKeyType enum value - SummaryKeyTypePoliciesQuota = "PoliciesQuota" - - // SummaryKeyTypePolicySizeQuota is a summaryKeyType enum value - SummaryKeyTypePolicySizeQuota = "PolicySizeQuota" - - // SummaryKeyTypePolicyVersionsInUse is a summaryKeyType enum value - SummaryKeyTypePolicyVersionsInUse = "PolicyVersionsInUse" - - // SummaryKeyTypePolicyVersionsInUseQuota is a summaryKeyType enum value - SummaryKeyTypePolicyVersionsInUseQuota = "PolicyVersionsInUseQuota" - - // SummaryKeyTypeVersionsPerPolicyQuota is a summaryKeyType enum value - SummaryKeyTypeVersionsPerPolicyQuota = "VersionsPerPolicyQuota" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go b/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go deleted file mode 100644 index 26c2534..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go +++ /dev/null @@ -1,169 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package iam - -const ( - - // ErrCodeCredentialReportExpiredException for service response error code - // "ReportExpired". - // - // The request was rejected because the most recent credential report has expired. - // To generate a new credential report, use GenerateCredentialReport. For more - // information about credential report expiration, see Getting Credential Reports - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) - // in the IAM User Guide. - ErrCodeCredentialReportExpiredException = "ReportExpired" - - // ErrCodeCredentialReportNotPresentException for service response error code - // "ReportNotPresent". - // - // The request was rejected because the credential report does not exist. To - // generate a credential report, use GenerateCredentialReport. - ErrCodeCredentialReportNotPresentException = "ReportNotPresent" - - // ErrCodeCredentialReportNotReadyException for service response error code - // "ReportInProgress". - // - // The request was rejected because the credential report is still being generated. - ErrCodeCredentialReportNotReadyException = "ReportInProgress" - - // ErrCodeDeleteConflictException for service response error code - // "DeleteConflict". - // - // The request was rejected because it attempted to delete a resource that has - // attached subordinate entities. The error message describes these entities. - ErrCodeDeleteConflictException = "DeleteConflict" - - // ErrCodeDuplicateCertificateException for service response error code - // "DuplicateCertificate". - // - // The request was rejected because the same certificate is associated with - // an IAM user in the account. - ErrCodeDuplicateCertificateException = "DuplicateCertificate" - - // ErrCodeDuplicateSSHPublicKeyException for service response error code - // "DuplicateSSHPublicKey". - // - // The request was rejected because the SSH public key is already associated - // with the specified IAM user. - ErrCodeDuplicateSSHPublicKeyException = "DuplicateSSHPublicKey" - - // ErrCodeEntityAlreadyExistsException for service response error code - // "EntityAlreadyExists". - // - // The request was rejected because it attempted to create a resource that already - // exists. - ErrCodeEntityAlreadyExistsException = "EntityAlreadyExists" - - // ErrCodeEntityTemporarilyUnmodifiableException for service response error code - // "EntityTemporarilyUnmodifiable". - // - // The request was rejected because it referenced an entity that is temporarily - // unmodifiable, such as a user name that was deleted and then recreated. The - // error indicates that the request is likely to succeed if you try again after - // waiting several minutes. The error message describes the entity. - ErrCodeEntityTemporarilyUnmodifiableException = "EntityTemporarilyUnmodifiable" - - // ErrCodeInvalidAuthenticationCodeException for service response error code - // "InvalidAuthenticationCode". - // - // The request was rejected because the authentication code was not recognized. - // The error message describes the specific error. - ErrCodeInvalidAuthenticationCodeException = "InvalidAuthenticationCode" - - // ErrCodeInvalidCertificateException for service response error code - // "InvalidCertificate". - // - // The request was rejected because the certificate is invalid. - ErrCodeInvalidCertificateException = "InvalidCertificate" - - // ErrCodeInvalidInputException for service response error code - // "InvalidInput". - // - // The request was rejected because an invalid or out-of-range value was supplied - // for an input parameter. - ErrCodeInvalidInputException = "InvalidInput" - - // ErrCodeInvalidPublicKeyException for service response error code - // "InvalidPublicKey". - // - // The request was rejected because the public key is malformed or otherwise - // invalid. - ErrCodeInvalidPublicKeyException = "InvalidPublicKey" - - // ErrCodeInvalidUserTypeException for service response error code - // "InvalidUserType". - // - // The request was rejected because the type of user for the transaction was - // incorrect. - ErrCodeInvalidUserTypeException = "InvalidUserType" - - // ErrCodeKeyPairMismatchException for service response error code - // "KeyPairMismatch". - // - // The request was rejected because the public key certificate and the private - // key do not match. - ErrCodeKeyPairMismatchException = "KeyPairMismatch" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceeded". - // - // The request was rejected because it attempted to create resources beyond - // the current AWS account limits. The error message describes the limit exceeded. - ErrCodeLimitExceededException = "LimitExceeded" - - // ErrCodeMalformedCertificateException for service response error code - // "MalformedCertificate". - // - // The request was rejected because the certificate was malformed or expired. - // The error message describes the specific error. - ErrCodeMalformedCertificateException = "MalformedCertificate" - - // ErrCodeMalformedPolicyDocumentException for service response error code - // "MalformedPolicyDocument". - // - // The request was rejected because the policy document was malformed. The error - // message describes the specific error. - ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocument" - - // ErrCodeNoSuchEntityException for service response error code - // "NoSuchEntity". - // - // The request was rejected because it referenced an entity that does not exist. - // The error message describes the entity. - ErrCodeNoSuchEntityException = "NoSuchEntity" - - // ErrCodePasswordPolicyViolationException for service response error code - // "PasswordPolicyViolation". - // - // The request was rejected because the provided password did not meet the requirements - // imposed by the account password policy. - ErrCodePasswordPolicyViolationException = "PasswordPolicyViolation" - - // ErrCodePolicyEvaluationException for service response error code - // "PolicyEvaluation". - // - // The request failed because a provided policy could not be successfully evaluated. - // An additional detail message indicates the source of the failure. - ErrCodePolicyEvaluationException = "PolicyEvaluation" - - // ErrCodeServiceFailureException for service response error code - // "ServiceFailure". - // - // The request processing has failed because of an unknown error, exception - // or failure. - ErrCodeServiceFailureException = "ServiceFailure" - - // ErrCodeServiceNotSupportedException for service response error code - // "NotSupportedService". - // - // The specified service does not support service-specific credentials. - ErrCodeServiceNotSupportedException = "NotSupportedService" - - // ErrCodeUnrecognizedPublicKeyEncodingException for service response error code - // "UnrecognizedPublicKeyEncoding". - // - // The request was rejected because the public key encoding format is unsupported - // or unrecognized. - ErrCodeUnrecognizedPublicKeyEncodingException = "UnrecognizedPublicKeyEncoding" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/service.go b/vendor/github.com/aws/aws-sdk-go/service/iam/service.go deleted file mode 100644 index 1942ec0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/service.go +++ /dev/null @@ -1,143 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package iam - -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" -) - -// AWS Identity and Access Management (IAM) is a web service that you can use -// to manage users and user permissions under your AWS account. This guide provides -// descriptions of IAM actions that you can call programmatically. For general -// information about IAM, see AWS Identity and Access Management (IAM) (http://aws.amazon.com/iam/). -// For the user guide for IAM, see Using IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/). -// -// AWS provides SDKs that 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 IAM and AWS. For -// example, the SDKs take care of tasks such as cryptographically signing requests -// (see below), 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 (http://aws.amazon.com/tools/) page. -// -// We recommend that you use the AWS SDKs to make programmatic API calls to -// IAM. However, you can also use the IAM Query API to make direct calls to -// the IAM web service. To learn more about the IAM Query API, see Making Query -// Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) -// in the Using IAM guide. IAM supports GET and POST requests for all actions. -// That is, the API does not require you to use GET for some actions and POST -// for others. However, GET requests are subject to the limitation size of a -// URL. Therefore, for operations that require larger sizes, use a POST request. -// -// Signing Requests -// -// Requests must be signed using an access key ID and a secret access key. We -// strongly recommend that you do not use your AWS account access key ID and -// secret access key for everyday work with IAM. You can use the access key -// ID and secret access key for an IAM user or you can use the AWS Security -// Token Service to generate temporary security credentials and use those to -// sign requests. -// -// To sign requests, we recommend that you use Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). -// If you have an existing application that uses Signature Version 2, you do -// not have to update it to use Signature Version 4. However, some operations -// now require Signature Version 4. The documentation for operations that require -// version 4 indicate this requirement. -// -// Additional Resources -// -// For more information, see the following: -// -// * AWS Security Credentials (http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html). -// This topic provides general information about the types of credentials -// used for accessing AWS. -// -// * IAM Best Practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAMBestPractices.html). -// This topic presents a list of suggestions for using the IAM service to -// help secure your AWS resources. -// -// * Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html). -// This set of topics walk you through the process of signing a request using -// an access key ID and secret access key. -// 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/iam-2010-05-08 -type IAM 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 = "iam" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the IAM 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 IAM client from just a session. -// svc := iam.New(mySession) -// -// // Create a IAM client with additional configuration -// svc := iam.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *IAM { - 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) *IAM { - svc := &IAM{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2010-05-08", - }, - 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 IAM operation and runs any -// custom request initialization. -func (c *IAM) 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/iam/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go deleted file mode 100644 index 9231bf0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go +++ /dev/null @@ -1,73 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package iam - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilInstanceProfileExists uses the IAM API operation -// GetInstanceProfile 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 *IAM) WaitUntilInstanceProfileExists(input *GetInstanceProfileInput) error { - waiterCfg := waiter.Config{ - Operation: "GetInstanceProfile", - Delay: 1, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "status", - Argument: "", - Expected: 200, - }, - { - State: "retry", - Matcher: "status", - Argument: "", - Expected: 404, - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilUserExists uses the IAM API operation -// GetUser 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 *IAM) WaitUntilUserExists(input *GetUserInput) error { - waiterCfg := waiter.Config{ - Operation: "GetUser", - Delay: 1, - MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "status", - Argument: "", - Expected: 200, - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "NoSuchEntity", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go b/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go deleted file mode 100644 index a81c6b0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go +++ /dev/null @@ -1,7530 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package inspector provides a client for Amazon Inspector. -package inspector - -import ( - "fmt" - "time" - - "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 opAddAttributesToFindings = "AddAttributesToFindings" - -// AddAttributesToFindingsRequest generates a "aws/request.Request" representing the -// client's request for the AddAttributesToFindings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddAttributesToFindings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddAttributesToFindings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddAttributesToFindingsRequest method. -// req, resp := client.AddAttributesToFindingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindings -func (c *Inspector) AddAttributesToFindingsRequest(input *AddAttributesToFindingsInput) (req *request.Request, output *AddAttributesToFindingsOutput) { - op := &request.Operation{ - Name: opAddAttributesToFindings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddAttributesToFindingsInput{} - } - - output = &AddAttributesToFindingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddAttributesToFindings API operation for Amazon Inspector. -// -// Assigns attributes (key and value pairs) to the findings that are specified -// by the ARNs of the findings. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation AddAttributesToFindings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindings -func (c *Inspector) AddAttributesToFindings(input *AddAttributesToFindingsInput) (*AddAttributesToFindingsOutput, error) { - req, out := c.AddAttributesToFindingsRequest(input) - err := req.Send() - return out, err -} - -const opCreateAssessmentTarget = "CreateAssessmentTarget" - -// CreateAssessmentTargetRequest generates a "aws/request.Request" representing the -// client's request for the CreateAssessmentTarget operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAssessmentTarget for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAssessmentTarget method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAssessmentTargetRequest method. -// req, resp := client.CreateAssessmentTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTarget -func (c *Inspector) CreateAssessmentTargetRequest(input *CreateAssessmentTargetInput) (req *request.Request, output *CreateAssessmentTargetOutput) { - op := &request.Operation{ - Name: opCreateAssessmentTarget, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAssessmentTargetInput{} - } - - output = &CreateAssessmentTargetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAssessmentTarget API operation for Amazon Inspector. -// -// Creates a new assessment target using the ARN of the resource group that -// is generated by CreateResourceGroup. You can create up to 50 assessment targets -// per AWS account. You can run up to 500 concurrent agents per AWS account. -// For more information, see Amazon Inspector Assessment Targets (http://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.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 Inspector's -// API operation CreateAssessmentTarget for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error code describes the limit exceeded. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTarget -func (c *Inspector) CreateAssessmentTarget(input *CreateAssessmentTargetInput) (*CreateAssessmentTargetOutput, error) { - req, out := c.CreateAssessmentTargetRequest(input) - err := req.Send() - return out, err -} - -const opCreateAssessmentTemplate = "CreateAssessmentTemplate" - -// CreateAssessmentTemplateRequest generates a "aws/request.Request" representing the -// client's request for the CreateAssessmentTemplate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAssessmentTemplate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAssessmentTemplate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAssessmentTemplateRequest method. -// req, resp := client.CreateAssessmentTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTemplate -func (c *Inspector) CreateAssessmentTemplateRequest(input *CreateAssessmentTemplateInput) (req *request.Request, output *CreateAssessmentTemplateOutput) { - op := &request.Operation{ - Name: opCreateAssessmentTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAssessmentTemplateInput{} - } - - output = &CreateAssessmentTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAssessmentTemplate API operation for Amazon Inspector. -// -// Creates an assessment template for the assessment target that is specified -// by the ARN of the assessment target. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation CreateAssessmentTemplate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error code describes the limit exceeded. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTemplate -func (c *Inspector) CreateAssessmentTemplate(input *CreateAssessmentTemplateInput) (*CreateAssessmentTemplateOutput, error) { - req, out := c.CreateAssessmentTemplateRequest(input) - err := req.Send() - return out, err -} - -const opCreateResourceGroup = "CreateResourceGroup" - -// CreateResourceGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateResourceGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateResourceGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateResourceGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateResourceGroupRequest method. -// req, resp := client.CreateResourceGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroup -func (c *Inspector) CreateResourceGroupRequest(input *CreateResourceGroupInput) (req *request.Request, output *CreateResourceGroupOutput) { - op := &request.Operation{ - Name: opCreateResourceGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateResourceGroupInput{} - } - - output = &CreateResourceGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateResourceGroup API operation for Amazon Inspector. -// -// Creates a resource group using the specified set of tags (key and value pairs) -// that are used to select the EC2 instances to be included in an Amazon Inspector -// assessment target. The created resource group is then used to create an Amazon -// Inspector assessment target. For more information, see CreateAssessmentTarget. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation CreateResourceGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error code describes the limit exceeded. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroup -func (c *Inspector) CreateResourceGroup(input *CreateResourceGroupInput) (*CreateResourceGroupOutput, error) { - req, out := c.CreateResourceGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAssessmentRun = "DeleteAssessmentRun" - -// DeleteAssessmentRunRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAssessmentRun operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAssessmentRun for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAssessmentRun method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAssessmentRunRequest method. -// req, resp := client.DeleteAssessmentRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentRun -func (c *Inspector) DeleteAssessmentRunRequest(input *DeleteAssessmentRunInput) (req *request.Request, output *DeleteAssessmentRunOutput) { - op := &request.Operation{ - Name: opDeleteAssessmentRun, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAssessmentRunInput{} - } - - output = &DeleteAssessmentRunOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAssessmentRun API operation for Amazon Inspector. -// -// Deletes the assessment run that is specified by the ARN of the assessment -// run. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DeleteAssessmentRun for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" -// You cannot perform a specified action if an assessment run is currently in -// progress. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentRun -func (c *Inspector) DeleteAssessmentRun(input *DeleteAssessmentRunInput) (*DeleteAssessmentRunOutput, error) { - req, out := c.DeleteAssessmentRunRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAssessmentTarget = "DeleteAssessmentTarget" - -// DeleteAssessmentTargetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAssessmentTarget operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAssessmentTarget for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAssessmentTarget method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAssessmentTargetRequest method. -// req, resp := client.DeleteAssessmentTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTarget -func (c *Inspector) DeleteAssessmentTargetRequest(input *DeleteAssessmentTargetInput) (req *request.Request, output *DeleteAssessmentTargetOutput) { - op := &request.Operation{ - Name: opDeleteAssessmentTarget, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAssessmentTargetInput{} - } - - output = &DeleteAssessmentTargetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAssessmentTarget API operation for Amazon Inspector. -// -// Deletes the assessment target that is specified by the ARN of the assessment -// target. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DeleteAssessmentTarget for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" -// You cannot perform a specified action if an assessment run is currently in -// progress. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTarget -func (c *Inspector) DeleteAssessmentTarget(input *DeleteAssessmentTargetInput) (*DeleteAssessmentTargetOutput, error) { - req, out := c.DeleteAssessmentTargetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAssessmentTemplate = "DeleteAssessmentTemplate" - -// DeleteAssessmentTemplateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAssessmentTemplate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAssessmentTemplate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAssessmentTemplate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAssessmentTemplateRequest method. -// req, resp := client.DeleteAssessmentTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTemplate -func (c *Inspector) DeleteAssessmentTemplateRequest(input *DeleteAssessmentTemplateInput) (req *request.Request, output *DeleteAssessmentTemplateOutput) { - op := &request.Operation{ - Name: opDeleteAssessmentTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAssessmentTemplateInput{} - } - - output = &DeleteAssessmentTemplateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAssessmentTemplate API operation for Amazon Inspector. -// -// Deletes the assessment template that is specified by the ARN of the assessment -// template. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DeleteAssessmentTemplate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" -// You cannot perform a specified action if an assessment run is currently in -// progress. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTemplate -func (c *Inspector) DeleteAssessmentTemplate(input *DeleteAssessmentTemplateInput) (*DeleteAssessmentTemplateOutput, error) { - req, out := c.DeleteAssessmentTemplateRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAssessmentRuns = "DescribeAssessmentRuns" - -// DescribeAssessmentRunsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAssessmentRuns operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAssessmentRuns for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAssessmentRuns method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAssessmentRunsRequest method. -// req, resp := client.DescribeAssessmentRunsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentRuns -func (c *Inspector) DescribeAssessmentRunsRequest(input *DescribeAssessmentRunsInput) (req *request.Request, output *DescribeAssessmentRunsOutput) { - op := &request.Operation{ - Name: opDescribeAssessmentRuns, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAssessmentRunsInput{} - } - - output = &DescribeAssessmentRunsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAssessmentRuns API operation for Amazon Inspector. -// -// Describes the assessment runs that are specified by the ARNs of the assessment -// runs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DescribeAssessmentRuns for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentRuns -func (c *Inspector) DescribeAssessmentRuns(input *DescribeAssessmentRunsInput) (*DescribeAssessmentRunsOutput, error) { - req, out := c.DescribeAssessmentRunsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAssessmentTargets = "DescribeAssessmentTargets" - -// DescribeAssessmentTargetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAssessmentTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAssessmentTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAssessmentTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAssessmentTargetsRequest method. -// req, resp := client.DescribeAssessmentTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTargets -func (c *Inspector) DescribeAssessmentTargetsRequest(input *DescribeAssessmentTargetsInput) (req *request.Request, output *DescribeAssessmentTargetsOutput) { - op := &request.Operation{ - Name: opDescribeAssessmentTargets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAssessmentTargetsInput{} - } - - output = &DescribeAssessmentTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAssessmentTargets API operation for Amazon Inspector. -// -// Describes the assessment targets that are specified by the ARNs of the assessment -// targets. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DescribeAssessmentTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTargets -func (c *Inspector) DescribeAssessmentTargets(input *DescribeAssessmentTargetsInput) (*DescribeAssessmentTargetsOutput, error) { - req, out := c.DescribeAssessmentTargetsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAssessmentTemplates = "DescribeAssessmentTemplates" - -// DescribeAssessmentTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAssessmentTemplates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAssessmentTemplates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAssessmentTemplates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAssessmentTemplatesRequest method. -// req, resp := client.DescribeAssessmentTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTemplates -func (c *Inspector) DescribeAssessmentTemplatesRequest(input *DescribeAssessmentTemplatesInput) (req *request.Request, output *DescribeAssessmentTemplatesOutput) { - op := &request.Operation{ - Name: opDescribeAssessmentTemplates, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAssessmentTemplatesInput{} - } - - output = &DescribeAssessmentTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAssessmentTemplates API operation for Amazon Inspector. -// -// Describes the assessment templates that are specified by the ARNs of the -// assessment templates. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DescribeAssessmentTemplates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTemplates -func (c *Inspector) DescribeAssessmentTemplates(input *DescribeAssessmentTemplatesInput) (*DescribeAssessmentTemplatesOutput, error) { - req, out := c.DescribeAssessmentTemplatesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeCrossAccountAccessRole = "DescribeCrossAccountAccessRole" - -// DescribeCrossAccountAccessRoleRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCrossAccountAccessRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCrossAccountAccessRole for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCrossAccountAccessRole method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCrossAccountAccessRoleRequest method. -// req, resp := client.DescribeCrossAccountAccessRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeCrossAccountAccessRole -func (c *Inspector) DescribeCrossAccountAccessRoleRequest(input *DescribeCrossAccountAccessRoleInput) (req *request.Request, output *DescribeCrossAccountAccessRoleOutput) { - op := &request.Operation{ - Name: opDescribeCrossAccountAccessRole, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeCrossAccountAccessRoleInput{} - } - - output = &DescribeCrossAccountAccessRoleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCrossAccountAccessRole API operation for Amazon Inspector. -// -// Describes the IAM role that enables Amazon Inspector to access your 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 Inspector's -// API operation DescribeCrossAccountAccessRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeCrossAccountAccessRole -func (c *Inspector) DescribeCrossAccountAccessRole(input *DescribeCrossAccountAccessRoleInput) (*DescribeCrossAccountAccessRoleOutput, error) { - req, out := c.DescribeCrossAccountAccessRoleRequest(input) - err := req.Send() - return out, err -} - -const opDescribeFindings = "DescribeFindings" - -// DescribeFindingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFindings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeFindings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeFindings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeFindingsRequest method. -// req, resp := client.DescribeFindingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeFindings -func (c *Inspector) DescribeFindingsRequest(input *DescribeFindingsInput) (req *request.Request, output *DescribeFindingsOutput) { - op := &request.Operation{ - Name: opDescribeFindings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeFindingsInput{} - } - - output = &DescribeFindingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFindings API operation for Amazon Inspector. -// -// Describes the findings that are specified by the ARNs of the findings. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DescribeFindings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeFindings -func (c *Inspector) DescribeFindings(input *DescribeFindingsInput) (*DescribeFindingsOutput, error) { - req, out := c.DescribeFindingsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeResourceGroups = "DescribeResourceGroups" - -// DescribeResourceGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeResourceGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeResourceGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeResourceGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeResourceGroupsRequest method. -// req, resp := client.DescribeResourceGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeResourceGroups -func (c *Inspector) DescribeResourceGroupsRequest(input *DescribeResourceGroupsInput) (req *request.Request, output *DescribeResourceGroupsOutput) { - op := &request.Operation{ - Name: opDescribeResourceGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeResourceGroupsInput{} - } - - output = &DescribeResourceGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeResourceGroups API operation for Amazon Inspector. -// -// Describes the resource groups that are specified by the ARNs of the resource -// groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DescribeResourceGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeResourceGroups -func (c *Inspector) DescribeResourceGroups(input *DescribeResourceGroupsInput) (*DescribeResourceGroupsOutput, error) { - req, out := c.DescribeResourceGroupsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeRulesPackages = "DescribeRulesPackages" - -// DescribeRulesPackagesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRulesPackages operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRulesPackages for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRulesPackages method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRulesPackagesRequest method. -// req, resp := client.DescribeRulesPackagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeRulesPackages -func (c *Inspector) DescribeRulesPackagesRequest(input *DescribeRulesPackagesInput) (req *request.Request, output *DescribeRulesPackagesOutput) { - op := &request.Operation{ - Name: opDescribeRulesPackages, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRulesPackagesInput{} - } - - output = &DescribeRulesPackagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRulesPackages API operation for Amazon Inspector. -// -// Describes the rules packages that are specified by the ARNs of the rules -// packages. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation DescribeRulesPackages for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeRulesPackages -func (c *Inspector) DescribeRulesPackages(input *DescribeRulesPackagesInput) (*DescribeRulesPackagesOutput, error) { - req, out := c.DescribeRulesPackagesRequest(input) - err := req.Send() - return out, err -} - -const opGetTelemetryMetadata = "GetTelemetryMetadata" - -// GetTelemetryMetadataRequest generates a "aws/request.Request" representing the -// client's request for the GetTelemetryMetadata operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetTelemetryMetadata for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetTelemetryMetadata method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetTelemetryMetadataRequest method. -// req, resp := client.GetTelemetryMetadataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetTelemetryMetadata -func (c *Inspector) GetTelemetryMetadataRequest(input *GetTelemetryMetadataInput) (req *request.Request, output *GetTelemetryMetadataOutput) { - op := &request.Operation{ - Name: opGetTelemetryMetadata, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTelemetryMetadataInput{} - } - - output = &GetTelemetryMetadataOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTelemetryMetadata API operation for Amazon Inspector. -// -// Information about the data that is collected for the specified assessment -// run. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation GetTelemetryMetadata for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetTelemetryMetadata -func (c *Inspector) GetTelemetryMetadata(input *GetTelemetryMetadataInput) (*GetTelemetryMetadataOutput, error) { - req, out := c.GetTelemetryMetadataRequest(input) - err := req.Send() - return out, err -} - -const opListAssessmentRunAgents = "ListAssessmentRunAgents" - -// ListAssessmentRunAgentsRequest generates a "aws/request.Request" representing the -// client's request for the ListAssessmentRunAgents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAssessmentRunAgents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAssessmentRunAgents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAssessmentRunAgentsRequest method. -// req, resp := client.ListAssessmentRunAgentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunAgents -func (c *Inspector) ListAssessmentRunAgentsRequest(input *ListAssessmentRunAgentsInput) (req *request.Request, output *ListAssessmentRunAgentsOutput) { - op := &request.Operation{ - Name: opListAssessmentRunAgents, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAssessmentRunAgentsInput{} - } - - output = &ListAssessmentRunAgentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssessmentRunAgents API operation for Amazon Inspector. -// -// Lists the agents of the assessment runs that are specified by the ARNs of -// the assessment runs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation ListAssessmentRunAgents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunAgents -func (c *Inspector) ListAssessmentRunAgents(input *ListAssessmentRunAgentsInput) (*ListAssessmentRunAgentsOutput, error) { - req, out := c.ListAssessmentRunAgentsRequest(input) - err := req.Send() - return out, err -} - -const opListAssessmentRuns = "ListAssessmentRuns" - -// ListAssessmentRunsRequest generates a "aws/request.Request" representing the -// client's request for the ListAssessmentRuns operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAssessmentRuns for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAssessmentRuns method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAssessmentRunsRequest method. -// req, resp := client.ListAssessmentRunsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRuns -func (c *Inspector) ListAssessmentRunsRequest(input *ListAssessmentRunsInput) (req *request.Request, output *ListAssessmentRunsOutput) { - op := &request.Operation{ - Name: opListAssessmentRuns, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAssessmentRunsInput{} - } - - output = &ListAssessmentRunsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssessmentRuns API operation for Amazon Inspector. -// -// Lists the assessment runs that correspond to the assessment templates that -// are specified by the ARNs of the assessment templates. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation ListAssessmentRuns for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRuns -func (c *Inspector) ListAssessmentRuns(input *ListAssessmentRunsInput) (*ListAssessmentRunsOutput, error) { - req, out := c.ListAssessmentRunsRequest(input) - err := req.Send() - return out, err -} - -const opListAssessmentTargets = "ListAssessmentTargets" - -// ListAssessmentTargetsRequest generates a "aws/request.Request" representing the -// client's request for the ListAssessmentTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAssessmentTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAssessmentTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAssessmentTargetsRequest method. -// req, resp := client.ListAssessmentTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTargets -func (c *Inspector) ListAssessmentTargetsRequest(input *ListAssessmentTargetsInput) (req *request.Request, output *ListAssessmentTargetsOutput) { - op := &request.Operation{ - Name: opListAssessmentTargets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAssessmentTargetsInput{} - } - - output = &ListAssessmentTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssessmentTargets API operation for Amazon Inspector. -// -// Lists the ARNs of the assessment targets within this AWS account. For more -// information about assessment targets, see Amazon Inspector Assessment Targets -// (http://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.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 Inspector's -// API operation ListAssessmentTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTargets -func (c *Inspector) ListAssessmentTargets(input *ListAssessmentTargetsInput) (*ListAssessmentTargetsOutput, error) { - req, out := c.ListAssessmentTargetsRequest(input) - err := req.Send() - return out, err -} - -const opListAssessmentTemplates = "ListAssessmentTemplates" - -// ListAssessmentTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the ListAssessmentTemplates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAssessmentTemplates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAssessmentTemplates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAssessmentTemplatesRequest method. -// req, resp := client.ListAssessmentTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTemplates -func (c *Inspector) ListAssessmentTemplatesRequest(input *ListAssessmentTemplatesInput) (req *request.Request, output *ListAssessmentTemplatesOutput) { - op := &request.Operation{ - Name: opListAssessmentTemplates, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAssessmentTemplatesInput{} - } - - output = &ListAssessmentTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssessmentTemplates API operation for Amazon Inspector. -// -// Lists the assessment templates that correspond to the assessment targets -// that are specified by the ARNs of the assessment targets. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation ListAssessmentTemplates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTemplates -func (c *Inspector) ListAssessmentTemplates(input *ListAssessmentTemplatesInput) (*ListAssessmentTemplatesOutput, error) { - req, out := c.ListAssessmentTemplatesRequest(input) - err := req.Send() - return out, err -} - -const opListEventSubscriptions = "ListEventSubscriptions" - -// ListEventSubscriptionsRequest generates a "aws/request.Request" representing the -// client's request for the ListEventSubscriptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListEventSubscriptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListEventSubscriptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListEventSubscriptionsRequest method. -// req, resp := client.ListEventSubscriptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListEventSubscriptions -func (c *Inspector) ListEventSubscriptionsRequest(input *ListEventSubscriptionsInput) (req *request.Request, output *ListEventSubscriptionsOutput) { - op := &request.Operation{ - Name: opListEventSubscriptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListEventSubscriptionsInput{} - } - - output = &ListEventSubscriptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEventSubscriptions API operation for Amazon Inspector. -// -// Lists all the event subscriptions for the assessment template that is specified -// by the ARN of the assessment template. For more information, see SubscribeToEvent -// and UnsubscribeFromEvent. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation ListEventSubscriptions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListEventSubscriptions -func (c *Inspector) ListEventSubscriptions(input *ListEventSubscriptionsInput) (*ListEventSubscriptionsOutput, error) { - req, out := c.ListEventSubscriptionsRequest(input) - err := req.Send() - return out, err -} - -const opListFindings = "ListFindings" - -// ListFindingsRequest generates a "aws/request.Request" representing the -// client's request for the ListFindings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListFindings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListFindings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListFindingsRequest method. -// req, resp := client.ListFindingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListFindings -func (c *Inspector) ListFindingsRequest(input *ListFindingsInput) (req *request.Request, output *ListFindingsOutput) { - op := &request.Operation{ - Name: opListFindings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListFindingsInput{} - } - - output = &ListFindingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListFindings API operation for Amazon Inspector. -// -// Lists findings that are generated by the assessment runs that are specified -// by the ARNs of the assessment runs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation ListFindings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListFindings -func (c *Inspector) ListFindings(input *ListFindingsInput) (*ListFindingsOutput, error) { - req, out := c.ListFindingsRequest(input) - err := req.Send() - return out, err -} - -const opListRulesPackages = "ListRulesPackages" - -// ListRulesPackagesRequest generates a "aws/request.Request" representing the -// client's request for the ListRulesPackages operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListRulesPackages for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListRulesPackages method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListRulesPackagesRequest method. -// req, resp := client.ListRulesPackagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListRulesPackages -func (c *Inspector) ListRulesPackagesRequest(input *ListRulesPackagesInput) (req *request.Request, output *ListRulesPackagesOutput) { - op := &request.Operation{ - Name: opListRulesPackages, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListRulesPackagesInput{} - } - - output = &ListRulesPackagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRulesPackages API operation for Amazon Inspector. -// -// Lists all available Amazon Inspector rules packages. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation ListRulesPackages for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListRulesPackages -func (c *Inspector) ListRulesPackages(input *ListRulesPackagesInput) (*ListRulesPackagesOutput, error) { - req, out := c.ListRulesPackagesRequest(input) - err := req.Send() - return out, err -} - -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/inspector-2016-02-16/ListTagsForResource -func (c *Inspector) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Inspector. -// -// Lists all tags associated with an assessment template. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListTagsForResource -func (c *Inspector) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opPreviewAgents = "PreviewAgents" - -// PreviewAgentsRequest generates a "aws/request.Request" representing the -// client's request for the PreviewAgents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PreviewAgents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PreviewAgents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PreviewAgentsRequest method. -// req, resp := client.PreviewAgentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/PreviewAgents -func (c *Inspector) PreviewAgentsRequest(input *PreviewAgentsInput) (req *request.Request, output *PreviewAgentsOutput) { - op := &request.Operation{ - Name: opPreviewAgents, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PreviewAgentsInput{} - } - - output = &PreviewAgentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PreviewAgents API operation for Amazon Inspector. -// -// Previews the agents installed on the EC2 instances that are part of the specified -// assessment target. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation PreviewAgents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// * ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" -// Amazon Inspector cannot assume the cross-account role that it needs to list -// your EC2 instances during the assessment run. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/PreviewAgents -func (c *Inspector) PreviewAgents(input *PreviewAgentsInput) (*PreviewAgentsOutput, error) { - req, out := c.PreviewAgentsRequest(input) - err := req.Send() - return out, err -} - -const opRegisterCrossAccountAccessRole = "RegisterCrossAccountAccessRole" - -// RegisterCrossAccountAccessRoleRequest generates a "aws/request.Request" representing the -// client's request for the RegisterCrossAccountAccessRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterCrossAccountAccessRole for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterCrossAccountAccessRole method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterCrossAccountAccessRoleRequest method. -// req, resp := client.RegisterCrossAccountAccessRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RegisterCrossAccountAccessRole -func (c *Inspector) RegisterCrossAccountAccessRoleRequest(input *RegisterCrossAccountAccessRoleInput) (req *request.Request, output *RegisterCrossAccountAccessRoleOutput) { - op := &request.Operation{ - Name: opRegisterCrossAccountAccessRole, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterCrossAccountAccessRoleInput{} - } - - output = &RegisterCrossAccountAccessRoleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RegisterCrossAccountAccessRole API operation for Amazon Inspector. -// -// Registers the IAM role that Amazon Inspector uses to list your EC2 instances -// at the start of the assessment run or when you call the PreviewAgents action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation RegisterCrossAccountAccessRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" -// Amazon Inspector cannot assume the cross-account role that it needs to list -// your EC2 instances during the assessment run. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RegisterCrossAccountAccessRole -func (c *Inspector) RegisterCrossAccountAccessRole(input *RegisterCrossAccountAccessRoleInput) (*RegisterCrossAccountAccessRoleOutput, error) { - req, out := c.RegisterCrossAccountAccessRoleRequest(input) - err := req.Send() - return out, err -} - -const opRemoveAttributesFromFindings = "RemoveAttributesFromFindings" - -// RemoveAttributesFromFindingsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveAttributesFromFindings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveAttributesFromFindings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveAttributesFromFindings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveAttributesFromFindingsRequest method. -// req, resp := client.RemoveAttributesFromFindingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RemoveAttributesFromFindings -func (c *Inspector) RemoveAttributesFromFindingsRequest(input *RemoveAttributesFromFindingsInput) (req *request.Request, output *RemoveAttributesFromFindingsOutput) { - op := &request.Operation{ - Name: opRemoveAttributesFromFindings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveAttributesFromFindingsInput{} - } - - output = &RemoveAttributesFromFindingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveAttributesFromFindings API operation for Amazon Inspector. -// -// Removes entire attributes (key and value pairs) from the findings that are -// specified by the ARNs of the findings where an attribute with the specified -// key exists. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation RemoveAttributesFromFindings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RemoveAttributesFromFindings -func (c *Inspector) RemoveAttributesFromFindings(input *RemoveAttributesFromFindingsInput) (*RemoveAttributesFromFindingsOutput, error) { - req, out := c.RemoveAttributesFromFindingsRequest(input) - err := req.Send() - return out, err -} - -const opSetTagsForResource = "SetTagsForResource" - -// SetTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the SetTagsForResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetTagsForResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetTagsForResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetTagsForResourceRequest method. -// req, resp := client.SetTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SetTagsForResource -func (c *Inspector) SetTagsForResourceRequest(input *SetTagsForResourceInput) (req *request.Request, output *SetTagsForResourceOutput) { - op := &request.Operation{ - Name: opSetTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetTagsForResourceInput{} - } - - output = &SetTagsForResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetTagsForResource API operation for Amazon Inspector. -// -// Sets tags (key and value pairs) to the assessment template that is specified -// by the ARN of the assessment template. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation SetTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SetTagsForResource -func (c *Inspector) SetTagsForResource(input *SetTagsForResourceInput) (*SetTagsForResourceOutput, error) { - req, out := c.SetTagsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opStartAssessmentRun = "StartAssessmentRun" - -// StartAssessmentRunRequest generates a "aws/request.Request" representing the -// client's request for the StartAssessmentRun operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartAssessmentRun for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartAssessmentRun method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartAssessmentRunRequest method. -// req, resp := client.StartAssessmentRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StartAssessmentRun -func (c *Inspector) StartAssessmentRunRequest(input *StartAssessmentRunInput) (req *request.Request, output *StartAssessmentRunOutput) { - op := &request.Operation{ - Name: opStartAssessmentRun, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartAssessmentRunInput{} - } - - output = &StartAssessmentRunOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartAssessmentRun API operation for Amazon Inspector. -// -// Starts the assessment run specified by the ARN of the assessment template. -// For this API to function properly, you must not exceed the limit of running -// up to 500 concurrent agents per 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 Inspector's -// API operation StartAssessmentRun for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error code describes the limit exceeded. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// * ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" -// Amazon Inspector cannot assume the cross-account role that it needs to list -// your EC2 instances during the assessment run. -// -// * ErrCodeAgentsAlreadyRunningAssessmentException "AgentsAlreadyRunningAssessmentException" -// You started an assessment run, but one of the instances is already participating -// in another assessment run. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StartAssessmentRun -func (c *Inspector) StartAssessmentRun(input *StartAssessmentRunInput) (*StartAssessmentRunOutput, error) { - req, out := c.StartAssessmentRunRequest(input) - err := req.Send() - return out, err -} - -const opStopAssessmentRun = "StopAssessmentRun" - -// StopAssessmentRunRequest generates a "aws/request.Request" representing the -// client's request for the StopAssessmentRun operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopAssessmentRun for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopAssessmentRun method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopAssessmentRunRequest method. -// req, resp := client.StopAssessmentRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StopAssessmentRun -func (c *Inspector) StopAssessmentRunRequest(input *StopAssessmentRunInput) (req *request.Request, output *StopAssessmentRunOutput) { - op := &request.Operation{ - Name: opStopAssessmentRun, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopAssessmentRunInput{} - } - - output = &StopAssessmentRunOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopAssessmentRun API operation for Amazon Inspector. -// -// Stops the assessment run that is specified by the ARN of the assessment run. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation StopAssessmentRun for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StopAssessmentRun -func (c *Inspector) StopAssessmentRun(input *StopAssessmentRunInput) (*StopAssessmentRunOutput, error) { - req, out := c.StopAssessmentRunRequest(input) - err := req.Send() - return out, err -} - -const opSubscribeToEvent = "SubscribeToEvent" - -// SubscribeToEventRequest generates a "aws/request.Request" representing the -// client's request for the SubscribeToEvent operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SubscribeToEvent for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SubscribeToEvent method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SubscribeToEventRequest method. -// req, resp := client.SubscribeToEventRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SubscribeToEvent -func (c *Inspector) SubscribeToEventRequest(input *SubscribeToEventInput) (req *request.Request, output *SubscribeToEventOutput) { - op := &request.Operation{ - Name: opSubscribeToEvent, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SubscribeToEventInput{} - } - - output = &SubscribeToEventOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SubscribeToEvent API operation for Amazon Inspector. -// -// Enables the process of sending Amazon Simple Notification Service (SNS) notifications -// about a specified event to a specified SNS topic. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation SubscribeToEvent for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error code describes the limit exceeded. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SubscribeToEvent -func (c *Inspector) SubscribeToEvent(input *SubscribeToEventInput) (*SubscribeToEventOutput, error) { - req, out := c.SubscribeToEventRequest(input) - err := req.Send() - return out, err -} - -const opUnsubscribeFromEvent = "UnsubscribeFromEvent" - -// UnsubscribeFromEventRequest generates a "aws/request.Request" representing the -// client's request for the UnsubscribeFromEvent operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UnsubscribeFromEvent for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UnsubscribeFromEvent method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UnsubscribeFromEventRequest method. -// req, resp := client.UnsubscribeFromEventRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UnsubscribeFromEvent -func (c *Inspector) UnsubscribeFromEventRequest(input *UnsubscribeFromEventInput) (req *request.Request, output *UnsubscribeFromEventOutput) { - op := &request.Operation{ - Name: opUnsubscribeFromEvent, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnsubscribeFromEventInput{} - } - - output = &UnsubscribeFromEventOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UnsubscribeFromEvent API operation for Amazon Inspector. -// -// Disables the process of sending Amazon Simple Notification Service (SNS) -// notifications about a specified event to a specified SNS topic. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation UnsubscribeFromEvent for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UnsubscribeFromEvent -func (c *Inspector) UnsubscribeFromEvent(input *UnsubscribeFromEventInput) (*UnsubscribeFromEventOutput, error) { - req, out := c.UnsubscribeFromEventRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAssessmentTarget = "UpdateAssessmentTarget" - -// UpdateAssessmentTargetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAssessmentTarget operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAssessmentTarget for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAssessmentTarget method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAssessmentTargetRequest method. -// req, resp := client.UpdateAssessmentTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UpdateAssessmentTarget -func (c *Inspector) UpdateAssessmentTargetRequest(input *UpdateAssessmentTargetInput) (req *request.Request, output *UpdateAssessmentTargetOutput) { - op := &request.Operation{ - Name: opUpdateAssessmentTarget, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAssessmentTargetInput{} - } - - output = &UpdateAssessmentTargetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateAssessmentTarget API operation for Amazon Inspector. -// -// Updates the assessment target that is specified by the ARN of the assessment -// target. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Inspector's -// API operation UpdateAssessmentTarget for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// Internal server error. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// The request was rejected because an invalid or out-of-range value was supplied -// for an input parameter. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have required permissions to access the requested resource. -// -// * ErrCodeNoSuchEntityException "NoSuchEntityException" -// The request was rejected because it referenced an entity that does not exist. -// The error code describes the entity. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UpdateAssessmentTarget -func (c *Inspector) UpdateAssessmentTarget(input *UpdateAssessmentTargetInput) (*UpdateAssessmentTargetOutput, error) { - req, out := c.UpdateAssessmentTargetRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindingsRequest -type AddAttributesToFindingsInput struct { - _ struct{} `type:"structure"` - - // The array of attributes that you want to assign to specified findings. - // - // Attributes is a required field - Attributes []*Attribute `locationName:"attributes" type:"list" required:"true"` - - // The ARNs that specify the findings that you want to assign attributes to. - // - // FindingArns is a required field - FindingArns []*string `locationName:"findingArns" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s AddAttributesToFindingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddAttributesToFindingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddAttributesToFindingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddAttributesToFindingsInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.FindingArns == nil { - invalidParams.Add(request.NewErrParamRequired("FindingArns")) - } - if s.FindingArns != nil && len(s.FindingArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FindingArns", 1)) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *AddAttributesToFindingsInput) SetAttributes(v []*Attribute) *AddAttributesToFindingsInput { - s.Attributes = v - return s -} - -// SetFindingArns sets the FindingArns field's value. -func (s *AddAttributesToFindingsInput) SetFindingArns(v []*string) *AddAttributesToFindingsInput { - s.FindingArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindingsResponse -type AddAttributesToFindingsOutput struct { - _ struct{} `type:"structure"` - - // Attribute details that cannot be described. An error code is provided for - // each failed item. - // - // FailedItems is a required field - FailedItems map[string]*FailedItemDetails `locationName:"failedItems" type:"map" required:"true"` -} - -// String returns the string representation -func (s AddAttributesToFindingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddAttributesToFindingsOutput) GoString() string { - return s.String() -} - -// SetFailedItems sets the FailedItems field's value. -func (s *AddAttributesToFindingsOutput) SetFailedItems(v map[string]*FailedItemDetails) *AddAttributesToFindingsOutput { - s.FailedItems = v - return s -} - -// Used in the exception error that is thrown if you start an assessment run -// for an assessment target that includes an EC2 instance that is already participating -// in another started assessment run. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AgentAlreadyRunningAssessment -type AgentAlreadyRunningAssessment struct { - _ struct{} `type:"structure"` - - // ID of the agent that is running on an EC2 instance that is already participating - // in another started assessment run. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" min:"1" type:"string" required:"true"` - - // The ARN of the assessment run that has already been started. - // - // AssessmentRunArn is a required field - AssessmentRunArn *string `locationName:"assessmentRunArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s AgentAlreadyRunningAssessment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AgentAlreadyRunningAssessment) GoString() string { - return s.String() -} - -// SetAgentId sets the AgentId field's value. -func (s *AgentAlreadyRunningAssessment) SetAgentId(v string) *AgentAlreadyRunningAssessment { - s.AgentId = &v - return s -} - -// SetAssessmentRunArn sets the AssessmentRunArn field's value. -func (s *AgentAlreadyRunningAssessment) SetAssessmentRunArn(v string) *AgentAlreadyRunningAssessment { - s.AssessmentRunArn = &v - return s -} - -// Contains information about an Amazon Inspector agent. This data type is used -// as a request parameter in the ListAssessmentRunAgents action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AgentFilter -type AgentFilter struct { - _ struct{} `type:"structure"` - - // The detailed health state of the agent. Values can be set to IDLE, RUNNING, - // SHUTDOWN, UNHEALTHY, THROTTLED, and UNKNOWN. - // - // AgentHealthCodes is a required field - AgentHealthCodes []*string `locationName:"agentHealthCodes" type:"list" required:"true"` - - // The current health state of the agent. Values can be set to HEALTHY or UNHEALTHY. - // - // AgentHealths is a required field - AgentHealths []*string `locationName:"agentHealths" type:"list" required:"true"` -} - -// String returns the string representation -func (s AgentFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AgentFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AgentFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AgentFilter"} - if s.AgentHealthCodes == nil { - invalidParams.Add(request.NewErrParamRequired("AgentHealthCodes")) - } - if s.AgentHealths == nil { - invalidParams.Add(request.NewErrParamRequired("AgentHealths")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentHealthCodes sets the AgentHealthCodes field's value. -func (s *AgentFilter) SetAgentHealthCodes(v []*string) *AgentFilter { - s.AgentHealthCodes = v - return s -} - -// SetAgentHealths sets the AgentHealths field's value. -func (s *AgentFilter) SetAgentHealths(v []*string) *AgentFilter { - s.AgentHealths = v - return s -} - -// Used as a response element in the PreviewAgents action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AgentPreview -type AgentPreview struct { - _ struct{} `type:"structure"` - - // The ID of the EC2 instance where the agent is installed. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" min:"1" type:"string" required:"true"` - - // The Auto Scaling group for the EC2 instance where the agent is installed. - AutoScalingGroup *string `locationName:"autoScalingGroup" min:"1" type:"string"` -} - -// String returns the string representation -func (s AgentPreview) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AgentPreview) GoString() string { - return s.String() -} - -// SetAgentId sets the AgentId field's value. -func (s *AgentPreview) SetAgentId(v string) *AgentPreview { - s.AgentId = &v - return s -} - -// SetAutoScalingGroup sets the AutoScalingGroup field's value. -func (s *AgentPreview) SetAutoScalingGroup(v string) *AgentPreview { - s.AutoScalingGroup = &v - return s -} - -// A snapshot of an Amazon Inspector assessment run that contains the findings -// of the assessment run . -// -// Used as the response element in the DescribeAssessmentRuns action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentRun -type AssessmentRun struct { - _ struct{} `type:"structure"` - - // The ARN of the assessment run. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The ARN of the assessment template that is associated with the assessment - // run. - // - // AssessmentTemplateArn is a required field - AssessmentTemplateArn *string `locationName:"assessmentTemplateArn" min:"1" type:"string" required:"true"` - - // The assessment run completion time that corresponds to the rules packages - // evaluation completion time or failure. - CompletedAt *time.Time `locationName:"completedAt" type:"timestamp" timestampFormat:"unix"` - - // The time when StartAssessmentRun was called. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix" required:"true"` - - // A Boolean value (true or false) that specifies whether the process of collecting - // data from the agents is completed. - // - // DataCollected is a required field - DataCollected *bool `locationName:"dataCollected" type:"boolean" required:"true"` - - // The duration of the assessment run. - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `locationName:"durationInSeconds" min:"180" type:"integer" required:"true"` - - // The auto-generated name for the assessment run. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of notifications for the event subscriptions. A notification about - // a particular generated finding is added to this list only once. - // - // Notifications is a required field - Notifications []*AssessmentRunNotification `locationName:"notifications" type:"list" required:"true"` - - // The rules packages selected for the assessment run. - // - // RulesPackageArns is a required field - RulesPackageArns []*string `locationName:"rulesPackageArns" min:"1" type:"list" required:"true"` - - // The time when StartAssessmentRun was called. - StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"unix"` - - // The state of the assessment run. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"AssessmentRunState"` - - // The last time when the assessment run's state changed. - // - // StateChangedAt is a required field - StateChangedAt *time.Time `locationName:"stateChangedAt" type:"timestamp" timestampFormat:"unix" required:"true"` - - // A list of the assessment run state changes. - // - // StateChanges is a required field - StateChanges []*AssessmentRunStateChange `locationName:"stateChanges" type:"list" required:"true"` - - // The user-defined attributes that are assigned to every generated finding. - // - // UserAttributesForFindings is a required field - UserAttributesForFindings []*Attribute `locationName:"userAttributesForFindings" type:"list" required:"true"` -} - -// String returns the string representation -func (s AssessmentRun) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentRun) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AssessmentRun) SetArn(v string) *AssessmentRun { - s.Arn = &v - return s -} - -// SetAssessmentTemplateArn sets the AssessmentTemplateArn field's value. -func (s *AssessmentRun) SetAssessmentTemplateArn(v string) *AssessmentRun { - s.AssessmentTemplateArn = &v - return s -} - -// SetCompletedAt sets the CompletedAt field's value. -func (s *AssessmentRun) SetCompletedAt(v time.Time) *AssessmentRun { - s.CompletedAt = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AssessmentRun) SetCreatedAt(v time.Time) *AssessmentRun { - s.CreatedAt = &v - return s -} - -// SetDataCollected sets the DataCollected field's value. -func (s *AssessmentRun) SetDataCollected(v bool) *AssessmentRun { - s.DataCollected = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *AssessmentRun) SetDurationInSeconds(v int64) *AssessmentRun { - s.DurationInSeconds = &v - return s -} - -// SetName sets the Name field's value. -func (s *AssessmentRun) SetName(v string) *AssessmentRun { - s.Name = &v - return s -} - -// SetNotifications sets the Notifications field's value. -func (s *AssessmentRun) SetNotifications(v []*AssessmentRunNotification) *AssessmentRun { - s.Notifications = v - return s -} - -// SetRulesPackageArns sets the RulesPackageArns field's value. -func (s *AssessmentRun) SetRulesPackageArns(v []*string) *AssessmentRun { - s.RulesPackageArns = v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *AssessmentRun) SetStartedAt(v time.Time) *AssessmentRun { - s.StartedAt = &v - return s -} - -// SetState sets the State field's value. -func (s *AssessmentRun) SetState(v string) *AssessmentRun { - s.State = &v - return s -} - -// SetStateChangedAt sets the StateChangedAt field's value. -func (s *AssessmentRun) SetStateChangedAt(v time.Time) *AssessmentRun { - s.StateChangedAt = &v - return s -} - -// SetStateChanges sets the StateChanges field's value. -func (s *AssessmentRun) SetStateChanges(v []*AssessmentRunStateChange) *AssessmentRun { - s.StateChanges = v - return s -} - -// SetUserAttributesForFindings sets the UserAttributesForFindings field's value. -func (s *AssessmentRun) SetUserAttributesForFindings(v []*Attribute) *AssessmentRun { - s.UserAttributesForFindings = v - return s -} - -// Contains information about an Amazon Inspector agent. This data type is used -// as a response element in the ListAssessmentRunAgents action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentRunAgent -type AssessmentRunAgent struct { - _ struct{} `type:"structure"` - - // The current health state of the agent. - // - // AgentHealth is a required field - AgentHealth *string `locationName:"agentHealth" type:"string" required:"true" enum:"AgentHealth"` - - // The detailed health state of the agent. - // - // AgentHealthCode is a required field - AgentHealthCode *string `locationName:"agentHealthCode" type:"string" required:"true" enum:"AgentHealthCode"` - - // The description for the agent health code. - AgentHealthDetails *string `locationName:"agentHealthDetails" type:"string"` - - // The AWS account of the EC2 instance where the agent is installed. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" min:"1" type:"string" required:"true"` - - // The ARN of the assessment run that is associated with the agent. - // - // AssessmentRunArn is a required field - AssessmentRunArn *string `locationName:"assessmentRunArn" min:"1" type:"string" required:"true"` - - // The Auto Scaling group of the EC2 instance that is specified by the agent - // ID. - AutoScalingGroup *string `locationName:"autoScalingGroup" min:"1" type:"string"` - - // The Amazon Inspector application data metrics that are collected by the agent. - // - // TelemetryMetadata is a required field - TelemetryMetadata []*TelemetryMetadata `locationName:"telemetryMetadata" type:"list" required:"true"` -} - -// String returns the string representation -func (s AssessmentRunAgent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentRunAgent) GoString() string { - return s.String() -} - -// SetAgentHealth sets the AgentHealth field's value. -func (s *AssessmentRunAgent) SetAgentHealth(v string) *AssessmentRunAgent { - s.AgentHealth = &v - return s -} - -// SetAgentHealthCode sets the AgentHealthCode field's value. -func (s *AssessmentRunAgent) SetAgentHealthCode(v string) *AssessmentRunAgent { - s.AgentHealthCode = &v - return s -} - -// SetAgentHealthDetails sets the AgentHealthDetails field's value. -func (s *AssessmentRunAgent) SetAgentHealthDetails(v string) *AssessmentRunAgent { - s.AgentHealthDetails = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *AssessmentRunAgent) SetAgentId(v string) *AssessmentRunAgent { - s.AgentId = &v - return s -} - -// SetAssessmentRunArn sets the AssessmentRunArn field's value. -func (s *AssessmentRunAgent) SetAssessmentRunArn(v string) *AssessmentRunAgent { - s.AssessmentRunArn = &v - return s -} - -// SetAutoScalingGroup sets the AutoScalingGroup field's value. -func (s *AssessmentRunAgent) SetAutoScalingGroup(v string) *AssessmentRunAgent { - s.AutoScalingGroup = &v - return s -} - -// SetTelemetryMetadata sets the TelemetryMetadata field's value. -func (s *AssessmentRunAgent) SetTelemetryMetadata(v []*TelemetryMetadata) *AssessmentRunAgent { - s.TelemetryMetadata = v - return s -} - -// Used as the request parameter in the ListAssessmentRuns action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentRunFilter -type AssessmentRunFilter struct { - _ struct{} `type:"structure"` - - // For a record to match a filter, the value that is specified for this data - // type property must inclusively match any value between the specified minimum - // and maximum values of the completedAt property of the AssessmentRun data - // type. - CompletionTimeRange *TimestampRange `locationName:"completionTimeRange" type:"structure"` - - // For a record to match a filter, the value that is specified for this data - // type property must inclusively match any value between the specified minimum - // and maximum values of the durationInSeconds property of the AssessmentRun - // data type. - DurationRange *DurationRange `locationName:"durationRange" type:"structure"` - - // For a record to match a filter, an explicit value or a string containing - // a wildcard that is specified for this data type property must match the value - // of the assessmentRunName property of the AssessmentRun data type. - NamePattern *string `locationName:"namePattern" min:"1" type:"string"` - - // For a record to match a filter, the value that is specified for this data - // type property must be contained in the list of values of the rulesPackages - // property of the AssessmentRun data type. - RulesPackageArns []*string `locationName:"rulesPackageArns" type:"list"` - - // For a record to match a filter, the value that is specified for this data - // type property must inclusively match any value between the specified minimum - // and maximum values of the startTime property of the AssessmentRun data type. - StartTimeRange *TimestampRange `locationName:"startTimeRange" type:"structure"` - - // For a record to match a filter, the value that is specified for this data - // type property must match the stateChangedAt property of the AssessmentRun - // data type. - StateChangeTimeRange *TimestampRange `locationName:"stateChangeTimeRange" type:"structure"` - - // For a record to match a filter, one of the values specified for this data - // type property must be the exact match of the value of the assessmentRunState - // property of the AssessmentRun data type. - States []*string `locationName:"states" type:"list"` -} - -// String returns the string representation -func (s AssessmentRunFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentRunFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssessmentRunFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssessmentRunFilter"} - if s.NamePattern != nil && len(*s.NamePattern) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NamePattern", 1)) - } - if s.DurationRange != nil { - if err := s.DurationRange.Validate(); err != nil { - invalidParams.AddNested("DurationRange", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCompletionTimeRange sets the CompletionTimeRange field's value. -func (s *AssessmentRunFilter) SetCompletionTimeRange(v *TimestampRange) *AssessmentRunFilter { - s.CompletionTimeRange = v - return s -} - -// SetDurationRange sets the DurationRange field's value. -func (s *AssessmentRunFilter) SetDurationRange(v *DurationRange) *AssessmentRunFilter { - s.DurationRange = v - return s -} - -// SetNamePattern sets the NamePattern field's value. -func (s *AssessmentRunFilter) SetNamePattern(v string) *AssessmentRunFilter { - s.NamePattern = &v - return s -} - -// SetRulesPackageArns sets the RulesPackageArns field's value. -func (s *AssessmentRunFilter) SetRulesPackageArns(v []*string) *AssessmentRunFilter { - s.RulesPackageArns = v - return s -} - -// SetStartTimeRange sets the StartTimeRange field's value. -func (s *AssessmentRunFilter) SetStartTimeRange(v *TimestampRange) *AssessmentRunFilter { - s.StartTimeRange = v - return s -} - -// SetStateChangeTimeRange sets the StateChangeTimeRange field's value. -func (s *AssessmentRunFilter) SetStateChangeTimeRange(v *TimestampRange) *AssessmentRunFilter { - s.StateChangeTimeRange = v - return s -} - -// SetStates sets the States field's value. -func (s *AssessmentRunFilter) SetStates(v []*string) *AssessmentRunFilter { - s.States = v - return s -} - -// Used as one of the elements of the AssessmentRun data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentRunNotification -type AssessmentRunNotification struct { - _ struct{} `type:"structure"` - - // The date of the notification. - // - // Date is a required field - Date *time.Time `locationName:"date" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The Boolean value that specifies whether the notification represents an error. - // - // Error is a required field - Error *bool `locationName:"error" type:"boolean" required:"true"` - - // The event for which a notification is sent. - // - // Event is a required field - Event *string `locationName:"event" type:"string" required:"true" enum:"Event"` - - Message *string `locationName:"message" type:"string"` - - // The status code of the SNS notification. - SnsPublishStatusCode *string `locationName:"snsPublishStatusCode" type:"string" enum:"AssessmentRunNotificationSnsStatusCode"` - - // The SNS topic to which the SNS notification is sent. - SnsTopicArn *string `locationName:"snsTopicArn" min:"1" type:"string"` -} - -// String returns the string representation -func (s AssessmentRunNotification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentRunNotification) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *AssessmentRunNotification) SetDate(v time.Time) *AssessmentRunNotification { - s.Date = &v - return s -} - -// SetError sets the Error field's value. -func (s *AssessmentRunNotification) SetError(v bool) *AssessmentRunNotification { - s.Error = &v - return s -} - -// SetEvent sets the Event field's value. -func (s *AssessmentRunNotification) SetEvent(v string) *AssessmentRunNotification { - s.Event = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *AssessmentRunNotification) SetMessage(v string) *AssessmentRunNotification { - s.Message = &v - return s -} - -// SetSnsPublishStatusCode sets the SnsPublishStatusCode field's value. -func (s *AssessmentRunNotification) SetSnsPublishStatusCode(v string) *AssessmentRunNotification { - s.SnsPublishStatusCode = &v - return s -} - -// SetSnsTopicArn sets the SnsTopicArn field's value. -func (s *AssessmentRunNotification) SetSnsTopicArn(v string) *AssessmentRunNotification { - s.SnsTopicArn = &v - return s -} - -// Used as one of the elements of the AssessmentRun data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentRunStateChange -type AssessmentRunStateChange struct { - _ struct{} `type:"structure"` - - // The assessment run state. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"AssessmentRunState"` - - // The last time the assessment run state changed. - // - // StateChangedAt is a required field - StateChangedAt *time.Time `locationName:"stateChangedAt" type:"timestamp" timestampFormat:"unix" required:"true"` -} - -// String returns the string representation -func (s AssessmentRunStateChange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentRunStateChange) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *AssessmentRunStateChange) SetState(v string) *AssessmentRunStateChange { - s.State = &v - return s -} - -// SetStateChangedAt sets the StateChangedAt field's value. -func (s *AssessmentRunStateChange) SetStateChangedAt(v time.Time) *AssessmentRunStateChange { - s.StateChangedAt = &v - return s -} - -// Contains information about an Amazon Inspector application. This data type -// is used as the response element in the DescribeAssessmentTargets action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentTarget -type AssessmentTarget struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the Amazon Inspector assessment target. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The time at which the assessment target is created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The name of the Amazon Inspector assessment target. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The ARN that specifies the resource group that is associated with the assessment - // target. - // - // ResourceGroupArn is a required field - ResourceGroupArn *string `locationName:"resourceGroupArn" min:"1" type:"string" required:"true"` - - // The time at which UpdateAssessmentTarget is called. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"unix" required:"true"` -} - -// String returns the string representation -func (s AssessmentTarget) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentTarget) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AssessmentTarget) SetArn(v string) *AssessmentTarget { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AssessmentTarget) SetCreatedAt(v time.Time) *AssessmentTarget { - s.CreatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *AssessmentTarget) SetName(v string) *AssessmentTarget { - s.Name = &v - return s -} - -// SetResourceGroupArn sets the ResourceGroupArn field's value. -func (s *AssessmentTarget) SetResourceGroupArn(v string) *AssessmentTarget { - s.ResourceGroupArn = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AssessmentTarget) SetUpdatedAt(v time.Time) *AssessmentTarget { - s.UpdatedAt = &v - return s -} - -// Used as the request parameter in the ListAssessmentTargets action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentTargetFilter -type AssessmentTargetFilter struct { - _ struct{} `type:"structure"` - - // For a record to match a filter, an explicit value or a string that contains - // a wildcard that is specified for this data type property must match the value - // of the assessmentTargetName property of the AssessmentTarget data type. - AssessmentTargetNamePattern *string `locationName:"assessmentTargetNamePattern" min:"1" type:"string"` -} - -// String returns the string representation -func (s AssessmentTargetFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentTargetFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssessmentTargetFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssessmentTargetFilter"} - if s.AssessmentTargetNamePattern != nil && len(*s.AssessmentTargetNamePattern) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTargetNamePattern", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentTargetNamePattern sets the AssessmentTargetNamePattern field's value. -func (s *AssessmentTargetFilter) SetAssessmentTargetNamePattern(v string) *AssessmentTargetFilter { - s.AssessmentTargetNamePattern = &v - return s -} - -// Contains information about an Amazon Inspector assessment template. This -// data type is used as the response element in the DescribeAssessmentTemplates -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentTemplate -type AssessmentTemplate struct { - _ struct{} `type:"structure"` - - // The ARN of the assessment template. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The ARN of the assessment target that corresponds to this assessment template. - // - // AssessmentTargetArn is a required field - AssessmentTargetArn *string `locationName:"assessmentTargetArn" min:"1" type:"string" required:"true"` - - // The time at which the assessment template is created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The duration in seconds specified for this assessment tempate. The default - // value is 3600 seconds (one hour). The maximum value is 86400 seconds (one - // day). - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `locationName:"durationInSeconds" min:"180" type:"integer" required:"true"` - - // The name of the assessment template. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The rules packages that are specified for this assessment template. - // - // RulesPackageArns is a required field - RulesPackageArns []*string `locationName:"rulesPackageArns" type:"list" required:"true"` - - // The user-defined attributes that are assigned to every generated finding - // from the assessment run that uses this assessment template. - // - // UserAttributesForFindings is a required field - UserAttributesForFindings []*Attribute `locationName:"userAttributesForFindings" type:"list" required:"true"` -} - -// String returns the string representation -func (s AssessmentTemplate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentTemplate) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AssessmentTemplate) SetArn(v string) *AssessmentTemplate { - s.Arn = &v - return s -} - -// SetAssessmentTargetArn sets the AssessmentTargetArn field's value. -func (s *AssessmentTemplate) SetAssessmentTargetArn(v string) *AssessmentTemplate { - s.AssessmentTargetArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AssessmentTemplate) SetCreatedAt(v time.Time) *AssessmentTemplate { - s.CreatedAt = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *AssessmentTemplate) SetDurationInSeconds(v int64) *AssessmentTemplate { - s.DurationInSeconds = &v - return s -} - -// SetName sets the Name field's value. -func (s *AssessmentTemplate) SetName(v string) *AssessmentTemplate { - s.Name = &v - return s -} - -// SetRulesPackageArns sets the RulesPackageArns field's value. -func (s *AssessmentTemplate) SetRulesPackageArns(v []*string) *AssessmentTemplate { - s.RulesPackageArns = v - return s -} - -// SetUserAttributesForFindings sets the UserAttributesForFindings field's value. -func (s *AssessmentTemplate) SetUserAttributesForFindings(v []*Attribute) *AssessmentTemplate { - s.UserAttributesForFindings = v - return s -} - -// Used as the request parameter in the ListAssessmentTemplates action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssessmentTemplateFilter -type AssessmentTemplateFilter struct { - _ struct{} `type:"structure"` - - // For a record to match a filter, the value specified for this data type property - // must inclusively match any value between the specified minimum and maximum - // values of the durationInSeconds property of the AssessmentTemplate data type. - DurationRange *DurationRange `locationName:"durationRange" type:"structure"` - - // For a record to match a filter, an explicit value or a string that contains - // a wildcard that is specified for this data type property must match the value - // of the assessmentTemplateName property of the AssessmentTemplate data type. - NamePattern *string `locationName:"namePattern" min:"1" type:"string"` - - // For a record to match a filter, the values that are specified for this data - // type property must be contained in the list of values of the rulesPackageArns - // property of the AssessmentTemplate data type. - RulesPackageArns []*string `locationName:"rulesPackageArns" type:"list"` -} - -// String returns the string representation -func (s AssessmentTemplateFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssessmentTemplateFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssessmentTemplateFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssessmentTemplateFilter"} - if s.NamePattern != nil && len(*s.NamePattern) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NamePattern", 1)) - } - if s.DurationRange != nil { - if err := s.DurationRange.Validate(); err != nil { - invalidParams.AddNested("DurationRange", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDurationRange sets the DurationRange field's value. -func (s *AssessmentTemplateFilter) SetDurationRange(v *DurationRange) *AssessmentTemplateFilter { - s.DurationRange = v - return s -} - -// SetNamePattern sets the NamePattern field's value. -func (s *AssessmentTemplateFilter) SetNamePattern(v string) *AssessmentTemplateFilter { - s.NamePattern = &v - return s -} - -// SetRulesPackageArns sets the RulesPackageArns field's value. -func (s *AssessmentTemplateFilter) SetRulesPackageArns(v []*string) *AssessmentTemplateFilter { - s.RulesPackageArns = v - return s -} - -// A collection of attributes of the host from which the finding is generated. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AssetAttributes -type AssetAttributes struct { - _ struct{} `type:"structure"` - - // The ID of the agent that is installed on the EC2 instance where the finding - // is generated. - AgentId *string `locationName:"agentId" min:"1" type:"string"` - - // The ID of the Amazon Machine Image (AMI) that is installed on the EC2 instance - // where the finding is generated. - AmiId *string `locationName:"amiId" type:"string"` - - // The Auto Scaling group of the EC2 instance where the finding is generated. - AutoScalingGroup *string `locationName:"autoScalingGroup" min:"1" type:"string"` - - // The hostname of the EC2 instance where the finding is generated. - Hostname *string `locationName:"hostname" type:"string"` - - // The list of IP v4 addresses of the EC2 instance where the finding is generated. - Ipv4Addresses []*string `locationName:"ipv4Addresses" type:"list"` - - // The schema version of this data type. - // - // SchemaVersion is a required field - SchemaVersion *int64 `locationName:"schemaVersion" type:"integer" required:"true"` -} - -// String returns the string representation -func (s AssetAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssetAttributes) GoString() string { - return s.String() -} - -// SetAgentId sets the AgentId field's value. -func (s *AssetAttributes) SetAgentId(v string) *AssetAttributes { - s.AgentId = &v - return s -} - -// SetAmiId sets the AmiId field's value. -func (s *AssetAttributes) SetAmiId(v string) *AssetAttributes { - s.AmiId = &v - return s -} - -// SetAutoScalingGroup sets the AutoScalingGroup field's value. -func (s *AssetAttributes) SetAutoScalingGroup(v string) *AssetAttributes { - s.AutoScalingGroup = &v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *AssetAttributes) SetHostname(v string) *AssetAttributes { - s.Hostname = &v - return s -} - -// SetIpv4Addresses sets the Ipv4Addresses field's value. -func (s *AssetAttributes) SetIpv4Addresses(v []*string) *AssetAttributes { - s.Ipv4Addresses = v - return s -} - -// SetSchemaVersion sets the SchemaVersion field's value. -func (s *AssetAttributes) SetSchemaVersion(v int64) *AssetAttributes { - s.SchemaVersion = &v - return s -} - -// This data type is used as a request parameter in the AddAttributesToFindings -// and CreateAssessmentTemplate actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/Attribute -type Attribute struct { - _ struct{} `type:"structure"` - - // The attribute key. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // The value assigned to the attribute key. - Value *string `locationName:"value" min:"1" type:"string"` -} - -// String returns the string representation -func (s Attribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Attribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Attribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Attribute"} - 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 && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Attribute) SetKey(v string) *Attribute { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Attribute) SetValue(v string) *Attribute { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTargetRequest -type CreateAssessmentTargetInput struct { - _ struct{} `type:"structure"` - - // The user-defined name that identifies the assessment target that you want - // to create. The name must be unique within the AWS account. - // - // AssessmentTargetName is a required field - AssessmentTargetName *string `locationName:"assessmentTargetName" min:"1" type:"string" required:"true"` - - // The ARN that specifies the resource group that is used to create the assessment - // target. - // - // ResourceGroupArn is a required field - ResourceGroupArn *string `locationName:"resourceGroupArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateAssessmentTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssessmentTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssessmentTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssessmentTargetInput"} - if s.AssessmentTargetName == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTargetName")) - } - if s.AssessmentTargetName != nil && len(*s.AssessmentTargetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTargetName", 1)) - } - if s.ResourceGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupArn")) - } - if s.ResourceGroupArn != nil && len(*s.ResourceGroupArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceGroupArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentTargetName sets the AssessmentTargetName field's value. -func (s *CreateAssessmentTargetInput) SetAssessmentTargetName(v string) *CreateAssessmentTargetInput { - s.AssessmentTargetName = &v - return s -} - -// SetResourceGroupArn sets the ResourceGroupArn field's value. -func (s *CreateAssessmentTargetInput) SetResourceGroupArn(v string) *CreateAssessmentTargetInput { - s.ResourceGroupArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTargetResponse -type CreateAssessmentTargetOutput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment target that is created. - // - // AssessmentTargetArn is a required field - AssessmentTargetArn *string `locationName:"assessmentTargetArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateAssessmentTargetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssessmentTargetOutput) GoString() string { - return s.String() -} - -// SetAssessmentTargetArn sets the AssessmentTargetArn field's value. -func (s *CreateAssessmentTargetOutput) SetAssessmentTargetArn(v string) *CreateAssessmentTargetOutput { - s.AssessmentTargetArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTemplateRequest -type CreateAssessmentTemplateInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment target for which you want to create - // the assessment template. - // - // AssessmentTargetArn is a required field - AssessmentTargetArn *string `locationName:"assessmentTargetArn" min:"1" type:"string" required:"true"` - - // The user-defined name that identifies the assessment template that you want - // to create. You can create several assessment templates for an assessment - // target. The names of the assessment templates that correspond to a particular - // assessment target must be unique. - // - // AssessmentTemplateName is a required field - AssessmentTemplateName *string `locationName:"assessmentTemplateName" min:"1" type:"string" required:"true"` - - // The duration of the assessment run in seconds. The default value is 3600 - // seconds (one hour). - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `locationName:"durationInSeconds" min:"180" type:"integer" required:"true"` - - // The ARNs that specify the rules packages that you want to attach to the assessment - // template. - // - // RulesPackageArns is a required field - RulesPackageArns []*string `locationName:"rulesPackageArns" type:"list" required:"true"` - - // The user-defined attributes that are assigned to every finding that is generated - // by the assessment run that uses this assessment template. - UserAttributesForFindings []*Attribute `locationName:"userAttributesForFindings" type:"list"` -} - -// String returns the string representation -func (s CreateAssessmentTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssessmentTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssessmentTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssessmentTemplateInput"} - if s.AssessmentTargetArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTargetArn")) - } - if s.AssessmentTargetArn != nil && len(*s.AssessmentTargetArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTargetArn", 1)) - } - if s.AssessmentTemplateName == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTemplateName")) - } - if s.AssessmentTemplateName != nil && len(*s.AssessmentTemplateName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTemplateName", 1)) - } - if s.DurationInSeconds == nil { - invalidParams.Add(request.NewErrParamRequired("DurationInSeconds")) - } - if s.DurationInSeconds != nil && *s.DurationInSeconds < 180 { - invalidParams.Add(request.NewErrParamMinValue("DurationInSeconds", 180)) - } - if s.RulesPackageArns == nil { - invalidParams.Add(request.NewErrParamRequired("RulesPackageArns")) - } - if s.UserAttributesForFindings != nil { - for i, v := range s.UserAttributesForFindings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UserAttributesForFindings", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentTargetArn sets the AssessmentTargetArn field's value. -func (s *CreateAssessmentTemplateInput) SetAssessmentTargetArn(v string) *CreateAssessmentTemplateInput { - s.AssessmentTargetArn = &v - return s -} - -// SetAssessmentTemplateName sets the AssessmentTemplateName field's value. -func (s *CreateAssessmentTemplateInput) SetAssessmentTemplateName(v string) *CreateAssessmentTemplateInput { - s.AssessmentTemplateName = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *CreateAssessmentTemplateInput) SetDurationInSeconds(v int64) *CreateAssessmentTemplateInput { - s.DurationInSeconds = &v - return s -} - -// SetRulesPackageArns sets the RulesPackageArns field's value. -func (s *CreateAssessmentTemplateInput) SetRulesPackageArns(v []*string) *CreateAssessmentTemplateInput { - s.RulesPackageArns = v - return s -} - -// SetUserAttributesForFindings sets the UserAttributesForFindings field's value. -func (s *CreateAssessmentTemplateInput) SetUserAttributesForFindings(v []*Attribute) *CreateAssessmentTemplateInput { - s.UserAttributesForFindings = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTemplateResponse -type CreateAssessmentTemplateOutput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment template that is created. - // - // AssessmentTemplateArn is a required field - AssessmentTemplateArn *string `locationName:"assessmentTemplateArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateAssessmentTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssessmentTemplateOutput) GoString() string { - return s.String() -} - -// SetAssessmentTemplateArn sets the AssessmentTemplateArn field's value. -func (s *CreateAssessmentTemplateOutput) SetAssessmentTemplateArn(v string) *CreateAssessmentTemplateOutput { - s.AssessmentTemplateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroupRequest -type CreateResourceGroupInput struct { - _ struct{} `type:"structure"` - - // A collection of keys and an array of possible values, '[{"key":"key1","values":["Value1","Value2"]},{"key":"Key2","values":["Value3"]}]'. - // - // For example,'[{"key":"Name","values":["TestEC2Instance"]}]'. - // - // ResourceGroupTags is a required field - ResourceGroupTags []*ResourceGroupTag `locationName:"resourceGroupTags" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s CreateResourceGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateResourceGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateResourceGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateResourceGroupInput"} - if s.ResourceGroupTags == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupTags")) - } - if s.ResourceGroupTags != nil && len(s.ResourceGroupTags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceGroupTags", 1)) - } - if s.ResourceGroupTags != nil { - for i, v := range s.ResourceGroupTags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceGroupTags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceGroupTags sets the ResourceGroupTags field's value. -func (s *CreateResourceGroupInput) SetResourceGroupTags(v []*ResourceGroupTag) *CreateResourceGroupInput { - s.ResourceGroupTags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroupResponse -type CreateResourceGroupOutput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the resource group that is created. - // - // ResourceGroupArn is a required field - ResourceGroupArn *string `locationName:"resourceGroupArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateResourceGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateResourceGroupOutput) GoString() string { - return s.String() -} - -// SetResourceGroupArn sets the ResourceGroupArn field's value. -func (s *CreateResourceGroupOutput) SetResourceGroupArn(v string) *CreateResourceGroupOutput { - s.ResourceGroupArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentRunRequest -type DeleteAssessmentRunInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment run that you want to delete. - // - // AssessmentRunArn is a required field - AssessmentRunArn *string `locationName:"assessmentRunArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAssessmentRunInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAssessmentRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAssessmentRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAssessmentRunInput"} - if s.AssessmentRunArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentRunArn")) - } - if s.AssessmentRunArn != nil && len(*s.AssessmentRunArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentRunArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentRunArn sets the AssessmentRunArn field's value. -func (s *DeleteAssessmentRunInput) SetAssessmentRunArn(v string) *DeleteAssessmentRunInput { - s.AssessmentRunArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentRunOutput -type DeleteAssessmentRunOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAssessmentRunOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAssessmentRunOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTargetRequest -type DeleteAssessmentTargetInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment target that you want to delete. - // - // AssessmentTargetArn is a required field - AssessmentTargetArn *string `locationName:"assessmentTargetArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAssessmentTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAssessmentTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAssessmentTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAssessmentTargetInput"} - if s.AssessmentTargetArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTargetArn")) - } - if s.AssessmentTargetArn != nil && len(*s.AssessmentTargetArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTargetArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentTargetArn sets the AssessmentTargetArn field's value. -func (s *DeleteAssessmentTargetInput) SetAssessmentTargetArn(v string) *DeleteAssessmentTargetInput { - s.AssessmentTargetArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTargetOutput -type DeleteAssessmentTargetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAssessmentTargetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAssessmentTargetOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTemplateRequest -type DeleteAssessmentTemplateInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment template that you want to delete. - // - // AssessmentTemplateArn is a required field - AssessmentTemplateArn *string `locationName:"assessmentTemplateArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAssessmentTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAssessmentTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAssessmentTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAssessmentTemplateInput"} - if s.AssessmentTemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTemplateArn")) - } - if s.AssessmentTemplateArn != nil && len(*s.AssessmentTemplateArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTemplateArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentTemplateArn sets the AssessmentTemplateArn field's value. -func (s *DeleteAssessmentTemplateInput) SetAssessmentTemplateArn(v string) *DeleteAssessmentTemplateInput { - s.AssessmentTemplateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTemplateOutput -type DeleteAssessmentTemplateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAssessmentTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAssessmentTemplateOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentRunsRequest -type DescribeAssessmentRunsInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment run that you want to describe. - // - // AssessmentRunArns is a required field - AssessmentRunArns []*string `locationName:"assessmentRunArns" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeAssessmentRunsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAssessmentRunsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAssessmentRunsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAssessmentRunsInput"} - if s.AssessmentRunArns == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentRunArns")) - } - if s.AssessmentRunArns != nil && len(s.AssessmentRunArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentRunArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentRunArns sets the AssessmentRunArns field's value. -func (s *DescribeAssessmentRunsInput) SetAssessmentRunArns(v []*string) *DescribeAssessmentRunsInput { - s.AssessmentRunArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentRunsResponse -type DescribeAssessmentRunsOutput struct { - _ struct{} `type:"structure"` - - // Information about the assessment run. - // - // AssessmentRuns is a required field - AssessmentRuns []*AssessmentRun `locationName:"assessmentRuns" type:"list" required:"true"` - - // Assessment run details that cannot be described. An error code is provided - // for each failed item. - // - // FailedItems is a required field - FailedItems map[string]*FailedItemDetails `locationName:"failedItems" type:"map" required:"true"` -} - -// String returns the string representation -func (s DescribeAssessmentRunsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAssessmentRunsOutput) GoString() string { - return s.String() -} - -// SetAssessmentRuns sets the AssessmentRuns field's value. -func (s *DescribeAssessmentRunsOutput) SetAssessmentRuns(v []*AssessmentRun) *DescribeAssessmentRunsOutput { - s.AssessmentRuns = v - return s -} - -// SetFailedItems sets the FailedItems field's value. -func (s *DescribeAssessmentRunsOutput) SetFailedItems(v map[string]*FailedItemDetails) *DescribeAssessmentRunsOutput { - s.FailedItems = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTargetsRequest -type DescribeAssessmentTargetsInput struct { - _ struct{} `type:"structure"` - - // The ARNs that specifies the assessment targets that you want to describe. - // - // AssessmentTargetArns is a required field - AssessmentTargetArns []*string `locationName:"assessmentTargetArns" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeAssessmentTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAssessmentTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAssessmentTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAssessmentTargetsInput"} - if s.AssessmentTargetArns == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTargetArns")) - } - if s.AssessmentTargetArns != nil && len(s.AssessmentTargetArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTargetArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentTargetArns sets the AssessmentTargetArns field's value. -func (s *DescribeAssessmentTargetsInput) SetAssessmentTargetArns(v []*string) *DescribeAssessmentTargetsInput { - s.AssessmentTargetArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTargetsResponse -type DescribeAssessmentTargetsOutput struct { - _ struct{} `type:"structure"` - - // Information about the assessment targets. - // - // AssessmentTargets is a required field - AssessmentTargets []*AssessmentTarget `locationName:"assessmentTargets" type:"list" required:"true"` - - // Assessment target details that cannot be described. An error code is provided - // for each failed item. - // - // FailedItems is a required field - FailedItems map[string]*FailedItemDetails `locationName:"failedItems" type:"map" required:"true"` -} - -// String returns the string representation -func (s DescribeAssessmentTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAssessmentTargetsOutput) GoString() string { - return s.String() -} - -// SetAssessmentTargets sets the AssessmentTargets field's value. -func (s *DescribeAssessmentTargetsOutput) SetAssessmentTargets(v []*AssessmentTarget) *DescribeAssessmentTargetsOutput { - s.AssessmentTargets = v - return s -} - -// SetFailedItems sets the FailedItems field's value. -func (s *DescribeAssessmentTargetsOutput) SetFailedItems(v map[string]*FailedItemDetails) *DescribeAssessmentTargetsOutput { - s.FailedItems = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTemplatesRequest -type DescribeAssessmentTemplatesInput struct { - _ struct{} `type:"structure"` - - // AssessmentTemplateArns is a required field - AssessmentTemplateArns []*string `locationName:"assessmentTemplateArns" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeAssessmentTemplatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAssessmentTemplatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAssessmentTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAssessmentTemplatesInput"} - if s.AssessmentTemplateArns == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTemplateArns")) - } - if s.AssessmentTemplateArns != nil && len(s.AssessmentTemplateArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTemplateArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentTemplateArns sets the AssessmentTemplateArns field's value. -func (s *DescribeAssessmentTemplatesInput) SetAssessmentTemplateArns(v []*string) *DescribeAssessmentTemplatesInput { - s.AssessmentTemplateArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTemplatesResponse -type DescribeAssessmentTemplatesOutput struct { - _ struct{} `type:"structure"` - - // Information about the assessment templates. - // - // AssessmentTemplates is a required field - AssessmentTemplates []*AssessmentTemplate `locationName:"assessmentTemplates" type:"list" required:"true"` - - // Assessment template details that cannot be described. An error code is provided - // for each failed item. - // - // FailedItems is a required field - FailedItems map[string]*FailedItemDetails `locationName:"failedItems" type:"map" required:"true"` -} - -// String returns the string representation -func (s DescribeAssessmentTemplatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAssessmentTemplatesOutput) GoString() string { - return s.String() -} - -// SetAssessmentTemplates sets the AssessmentTemplates field's value. -func (s *DescribeAssessmentTemplatesOutput) SetAssessmentTemplates(v []*AssessmentTemplate) *DescribeAssessmentTemplatesOutput { - s.AssessmentTemplates = v - return s -} - -// SetFailedItems sets the FailedItems field's value. -func (s *DescribeAssessmentTemplatesOutput) SetFailedItems(v map[string]*FailedItemDetails) *DescribeAssessmentTemplatesOutput { - s.FailedItems = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeCrossAccountAccessRoleInput -type DescribeCrossAccountAccessRoleInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeCrossAccountAccessRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCrossAccountAccessRoleInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeCrossAccountAccessRoleResponse -type DescribeCrossAccountAccessRoleOutput struct { - _ struct{} `type:"structure"` - - // The date when the cross-account access role was registered. - // - // RegisteredAt is a required field - RegisteredAt *time.Time `locationName:"registeredAt" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The ARN that specifies the IAM role that Amazon Inspector uses to access - // your AWS account. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"1" type:"string" required:"true"` - - // A Boolean value that specifies whether the IAM role has the necessary policies - // attached to enable Amazon Inspector to access your AWS account. - // - // Valid is a required field - Valid *bool `locationName:"valid" type:"boolean" required:"true"` -} - -// String returns the string representation -func (s DescribeCrossAccountAccessRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCrossAccountAccessRoleOutput) GoString() string { - return s.String() -} - -// SetRegisteredAt sets the RegisteredAt field's value. -func (s *DescribeCrossAccountAccessRoleOutput) SetRegisteredAt(v time.Time) *DescribeCrossAccountAccessRoleOutput { - s.RegisteredAt = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeCrossAccountAccessRoleOutput) SetRoleArn(v string) *DescribeCrossAccountAccessRoleOutput { - s.RoleArn = &v - return s -} - -// SetValid sets the Valid field's value. -func (s *DescribeCrossAccountAccessRoleOutput) SetValid(v bool) *DescribeCrossAccountAccessRoleOutput { - s.Valid = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeFindingsRequest -type DescribeFindingsInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the finding that you want to describe. - // - // FindingArns is a required field - FindingArns []*string `locationName:"findingArns" min:"1" type:"list" required:"true"` - - // The locale into which you want to translate a finding description, recommendation, - // and the short description that identifies the finding. - Locale *string `locationName:"locale" type:"string" enum:"Locale"` -} - -// String returns the string representation -func (s DescribeFindingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFindingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFindingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFindingsInput"} - if s.FindingArns == nil { - invalidParams.Add(request.NewErrParamRequired("FindingArns")) - } - if s.FindingArns != nil && len(s.FindingArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FindingArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFindingArns sets the FindingArns field's value. -func (s *DescribeFindingsInput) SetFindingArns(v []*string) *DescribeFindingsInput { - s.FindingArns = v - return s -} - -// SetLocale sets the Locale field's value. -func (s *DescribeFindingsInput) SetLocale(v string) *DescribeFindingsInput { - s.Locale = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeFindingsResponse -type DescribeFindingsOutput struct { - _ struct{} `type:"structure"` - - // Finding details that cannot be described. An error code is provided for each - // failed item. - // - // FailedItems is a required field - FailedItems map[string]*FailedItemDetails `locationName:"failedItems" type:"map" required:"true"` - - // Information about the finding. - // - // Findings is a required field - Findings []*Finding `locationName:"findings" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeFindingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFindingsOutput) GoString() string { - return s.String() -} - -// SetFailedItems sets the FailedItems field's value. -func (s *DescribeFindingsOutput) SetFailedItems(v map[string]*FailedItemDetails) *DescribeFindingsOutput { - s.FailedItems = v - return s -} - -// SetFindings sets the Findings field's value. -func (s *DescribeFindingsOutput) SetFindings(v []*Finding) *DescribeFindingsOutput { - s.Findings = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeResourceGroupsRequest -type DescribeResourceGroupsInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the resource group that you want to describe. - // - // ResourceGroupArns is a required field - ResourceGroupArns []*string `locationName:"resourceGroupArns" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeResourceGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeResourceGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeResourceGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeResourceGroupsInput"} - if s.ResourceGroupArns == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupArns")) - } - if s.ResourceGroupArns != nil && len(s.ResourceGroupArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceGroupArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceGroupArns sets the ResourceGroupArns field's value. -func (s *DescribeResourceGroupsInput) SetResourceGroupArns(v []*string) *DescribeResourceGroupsInput { - s.ResourceGroupArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeResourceGroupsResponse -type DescribeResourceGroupsOutput struct { - _ struct{} `type:"structure"` - - // Resource group details that cannot be described. An error code is provided - // for each failed item. - // - // FailedItems is a required field - FailedItems map[string]*FailedItemDetails `locationName:"failedItems" type:"map" required:"true"` - - // Information about a resource group. - // - // ResourceGroups is a required field - ResourceGroups []*ResourceGroup `locationName:"resourceGroups" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeResourceGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeResourceGroupsOutput) GoString() string { - return s.String() -} - -// SetFailedItems sets the FailedItems field's value. -func (s *DescribeResourceGroupsOutput) SetFailedItems(v map[string]*FailedItemDetails) *DescribeResourceGroupsOutput { - s.FailedItems = v - return s -} - -// SetResourceGroups sets the ResourceGroups field's value. -func (s *DescribeResourceGroupsOutput) SetResourceGroups(v []*ResourceGroup) *DescribeResourceGroupsOutput { - s.ResourceGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeRulesPackagesRequest -type DescribeRulesPackagesInput struct { - _ struct{} `type:"structure"` - - // The locale that you want to translate a rules package description into. - Locale *string `locationName:"locale" type:"string" enum:"Locale"` - - // The ARN that specifies the rules package that you want to describe. - // - // RulesPackageArns is a required field - RulesPackageArns []*string `locationName:"rulesPackageArns" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeRulesPackagesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRulesPackagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRulesPackagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRulesPackagesInput"} - if s.RulesPackageArns == nil { - invalidParams.Add(request.NewErrParamRequired("RulesPackageArns")) - } - if s.RulesPackageArns != nil && len(s.RulesPackageArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RulesPackageArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLocale sets the Locale field's value. -func (s *DescribeRulesPackagesInput) SetLocale(v string) *DescribeRulesPackagesInput { - s.Locale = &v - return s -} - -// SetRulesPackageArns sets the RulesPackageArns field's value. -func (s *DescribeRulesPackagesInput) SetRulesPackageArns(v []*string) *DescribeRulesPackagesInput { - s.RulesPackageArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeRulesPackagesResponse -type DescribeRulesPackagesOutput struct { - _ struct{} `type:"structure"` - - // Rules package details that cannot be described. An error code is provided - // for each failed item. - // - // FailedItems is a required field - FailedItems map[string]*FailedItemDetails `locationName:"failedItems" type:"map" required:"true"` - - // Information about the rules package. - // - // RulesPackages is a required field - RulesPackages []*RulesPackage `locationName:"rulesPackages" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeRulesPackagesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRulesPackagesOutput) GoString() string { - return s.String() -} - -// SetFailedItems sets the FailedItems field's value. -func (s *DescribeRulesPackagesOutput) SetFailedItems(v map[string]*FailedItemDetails) *DescribeRulesPackagesOutput { - s.FailedItems = v - return s -} - -// SetRulesPackages sets the RulesPackages field's value. -func (s *DescribeRulesPackagesOutput) SetRulesPackages(v []*RulesPackage) *DescribeRulesPackagesOutput { - s.RulesPackages = v - return s -} - -// This data type is used in the AssessmentTemplateFilter data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DurationRange -type DurationRange struct { - _ struct{} `type:"structure"` - - // The maximum value of the duration range. Must be less than or equal to 604800 - // seconds (1 week). - MaxSeconds *int64 `locationName:"maxSeconds" min:"180" type:"integer"` - - // The minimum value of the duration range. Must be greater than zero. - MinSeconds *int64 `locationName:"minSeconds" min:"180" type:"integer"` -} - -// String returns the string representation -func (s DurationRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DurationRange) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DurationRange) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DurationRange"} - if s.MaxSeconds != nil && *s.MaxSeconds < 180 { - invalidParams.Add(request.NewErrParamMinValue("MaxSeconds", 180)) - } - if s.MinSeconds != nil && *s.MinSeconds < 180 { - invalidParams.Add(request.NewErrParamMinValue("MinSeconds", 180)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxSeconds sets the MaxSeconds field's value. -func (s *DurationRange) SetMaxSeconds(v int64) *DurationRange { - s.MaxSeconds = &v - return s -} - -// SetMinSeconds sets the MinSeconds field's value. -func (s *DurationRange) SetMinSeconds(v int64) *DurationRange { - s.MinSeconds = &v - return s -} - -// This data type is used in the Subscription data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/EventSubscription -type EventSubscription struct { - _ struct{} `type:"structure"` - - // The event for which Amazon Simple Notification Service (SNS) notifications - // are sent. - // - // Event is a required field - Event *string `locationName:"event" type:"string" required:"true" enum:"Event"` - - // The time at which SubscribeToEvent is called. - // - // SubscribedAt is a required field - SubscribedAt *time.Time `locationName:"subscribedAt" type:"timestamp" timestampFormat:"unix" required:"true"` -} - -// String returns the string representation -func (s EventSubscription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventSubscription) GoString() string { - return s.String() -} - -// SetEvent sets the Event field's value. -func (s *EventSubscription) SetEvent(v string) *EventSubscription { - s.Event = &v - return s -} - -// SetSubscribedAt sets the SubscribedAt field's value. -func (s *EventSubscription) SetSubscribedAt(v time.Time) *EventSubscription { - s.SubscribedAt = &v - return s -} - -// Includes details about the failed items. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/FailedItemDetails -type FailedItemDetails struct { - _ struct{} `type:"structure"` - - // The status code of a failed item. - // - // FailureCode is a required field - FailureCode *string `locationName:"failureCode" type:"string" required:"true" enum:"FailedItemErrorCode"` - - // Indicates whether you can immediately retry a request for this item for a - // specified resource. - // - // Retryable is a required field - Retryable *bool `locationName:"retryable" type:"boolean" required:"true"` -} - -// String returns the string representation -func (s FailedItemDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FailedItemDetails) GoString() string { - return s.String() -} - -// SetFailureCode sets the FailureCode field's value. -func (s *FailedItemDetails) SetFailureCode(v string) *FailedItemDetails { - s.FailureCode = &v - return s -} - -// SetRetryable sets the Retryable field's value. -func (s *FailedItemDetails) SetRetryable(v bool) *FailedItemDetails { - s.Retryable = &v - return s -} - -// Contains information about an Amazon Inspector finding. This data type is -// used as the response element in the DescribeFindings action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/Finding -type Finding struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the finding. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // A collection of attributes of the host from which the finding is generated. - AssetAttributes *AssetAttributes `locationName:"assetAttributes" type:"structure"` - - // The type of the host from which the finding is generated. - AssetType *string `locationName:"assetType" type:"string" enum:"AssetType"` - - // The system-defined attributes for the finding. - // - // Attributes is a required field - Attributes []*Attribute `locationName:"attributes" type:"list" required:"true"` - - // This data element is currently not used. - Confidence *int64 `locationName:"confidence" type:"integer"` - - // The time when the finding was generated. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The description of the finding. - Description *string `locationName:"description" type:"string"` - - // The ID of the finding. - Id *string `locationName:"id" type:"string"` - - // This data element is currently not used. - IndicatorOfCompromise *bool `locationName:"indicatorOfCompromise" type:"boolean"` - - // The numeric value of the finding severity. - NumericSeverity *float64 `locationName:"numericSeverity" type:"double"` - - // The recommendation for the finding. - Recommendation *string `locationName:"recommendation" type:"string"` - - // The schema version of this data type. - SchemaVersion *int64 `locationName:"schemaVersion" type:"integer"` - - // The data element is set to "Inspector". - Service *string `locationName:"service" type:"string"` - - // This data type is used in the Finding data type. - ServiceAttributes *ServiceAttributes `locationName:"serviceAttributes" type:"structure"` - - // The finding severity. Values can be set to High, Medium, Low, and Informational. - Severity *string `locationName:"severity" type:"string" enum:"Severity"` - - // The name of the finding. - Title *string `locationName:"title" type:"string"` - - // The time when AddAttributesToFindings is called. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The user-defined attributes that are assigned to the finding. - // - // UserAttributes is a required field - UserAttributes []*Attribute `locationName:"userAttributes" type:"list" required:"true"` -} - -// String returns the string representation -func (s Finding) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Finding) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Finding) SetArn(v string) *Finding { - s.Arn = &v - return s -} - -// SetAssetAttributes sets the AssetAttributes field's value. -func (s *Finding) SetAssetAttributes(v *AssetAttributes) *Finding { - s.AssetAttributes = v - return s -} - -// SetAssetType sets the AssetType field's value. -func (s *Finding) SetAssetType(v string) *Finding { - s.AssetType = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *Finding) SetAttributes(v []*Attribute) *Finding { - s.Attributes = v - return s -} - -// SetConfidence sets the Confidence field's value. -func (s *Finding) SetConfidence(v int64) *Finding { - s.Confidence = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Finding) SetCreatedAt(v time.Time) *Finding { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Finding) SetDescription(v string) *Finding { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *Finding) SetId(v string) *Finding { - s.Id = &v - return s -} - -// SetIndicatorOfCompromise sets the IndicatorOfCompromise field's value. -func (s *Finding) SetIndicatorOfCompromise(v bool) *Finding { - s.IndicatorOfCompromise = &v - return s -} - -// SetNumericSeverity sets the NumericSeverity field's value. -func (s *Finding) SetNumericSeverity(v float64) *Finding { - s.NumericSeverity = &v - return s -} - -// SetRecommendation sets the Recommendation field's value. -func (s *Finding) SetRecommendation(v string) *Finding { - s.Recommendation = &v - return s -} - -// SetSchemaVersion sets the SchemaVersion field's value. -func (s *Finding) SetSchemaVersion(v int64) *Finding { - s.SchemaVersion = &v - return s -} - -// SetService sets the Service field's value. -func (s *Finding) SetService(v string) *Finding { - s.Service = &v - return s -} - -// SetServiceAttributes sets the ServiceAttributes field's value. -func (s *Finding) SetServiceAttributes(v *ServiceAttributes) *Finding { - s.ServiceAttributes = v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *Finding) SetSeverity(v string) *Finding { - s.Severity = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *Finding) SetTitle(v string) *Finding { - s.Title = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Finding) SetUpdatedAt(v time.Time) *Finding { - s.UpdatedAt = &v - return s -} - -// SetUserAttributes sets the UserAttributes field's value. -func (s *Finding) SetUserAttributes(v []*Attribute) *Finding { - s.UserAttributes = v - return s -} - -// This data type is used as a request parameter in the ListFindings action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/FindingFilter -type FindingFilter struct { - _ struct{} `type:"structure"` - - // For a record to match a filter, one of the values that is specified for this - // data type property must be the exact match of the value of the agentId property - // of the Finding data type. - AgentIds []*string `locationName:"agentIds" type:"list"` - - // For a record to match a filter, the list of values that are specified for - // this data type property must be contained in the list of values of the attributes - // property of the Finding data type. - Attributes []*Attribute `locationName:"attributes" type:"list"` - - // For a record to match a filter, one of the values that is specified for this - // data type property must be the exact match of the value of the autoScalingGroup - // property of the Finding data type. - AutoScalingGroups []*string `locationName:"autoScalingGroups" type:"list"` - - // The time range during which the finding is generated. - CreationTimeRange *TimestampRange `locationName:"creationTimeRange" type:"structure"` - - // For a record to match a filter, one of the values that is specified for this - // data type property must be the exact match of the value of the ruleName property - // of the Finding data type. - RuleNames []*string `locationName:"ruleNames" type:"list"` - - // For a record to match a filter, one of the values that is specified for this - // data type property must be the exact match of the value of the rulesPackageArn - // property of the Finding data type. - RulesPackageArns []*string `locationName:"rulesPackageArns" type:"list"` - - // For a record to match a filter, one of the values that is specified for this - // data type property must be the exact match of the value of the severity property - // of the Finding data type. - Severities []*string `locationName:"severities" type:"list"` - - // For a record to match a filter, the value that is specified for this data - // type property must be contained in the list of values of the userAttributes - // property of the Finding data type. - UserAttributes []*Attribute `locationName:"userAttributes" type:"list"` -} - -// String returns the string representation -func (s FindingFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FindingFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FindingFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FindingFilter"} - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.UserAttributes != nil { - for i, v := range s.UserAttributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UserAttributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentIds sets the AgentIds field's value. -func (s *FindingFilter) SetAgentIds(v []*string) *FindingFilter { - s.AgentIds = v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *FindingFilter) SetAttributes(v []*Attribute) *FindingFilter { - s.Attributes = v - return s -} - -// SetAutoScalingGroups sets the AutoScalingGroups field's value. -func (s *FindingFilter) SetAutoScalingGroups(v []*string) *FindingFilter { - s.AutoScalingGroups = v - return s -} - -// SetCreationTimeRange sets the CreationTimeRange field's value. -func (s *FindingFilter) SetCreationTimeRange(v *TimestampRange) *FindingFilter { - s.CreationTimeRange = v - return s -} - -// SetRuleNames sets the RuleNames field's value. -func (s *FindingFilter) SetRuleNames(v []*string) *FindingFilter { - s.RuleNames = v - return s -} - -// SetRulesPackageArns sets the RulesPackageArns field's value. -func (s *FindingFilter) SetRulesPackageArns(v []*string) *FindingFilter { - s.RulesPackageArns = v - return s -} - -// SetSeverities sets the Severities field's value. -func (s *FindingFilter) SetSeverities(v []*string) *FindingFilter { - s.Severities = v - return s -} - -// SetUserAttributes sets the UserAttributes field's value. -func (s *FindingFilter) SetUserAttributes(v []*Attribute) *FindingFilter { - s.UserAttributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetTelemetryMetadataRequest -type GetTelemetryMetadataInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment run that has the telemetry data that - // you want to obtain. - // - // AssessmentRunArn is a required field - AssessmentRunArn *string `locationName:"assessmentRunArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetTelemetryMetadataInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTelemetryMetadataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTelemetryMetadataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTelemetryMetadataInput"} - if s.AssessmentRunArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentRunArn")) - } - if s.AssessmentRunArn != nil && len(*s.AssessmentRunArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentRunArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentRunArn sets the AssessmentRunArn field's value. -func (s *GetTelemetryMetadataInput) SetAssessmentRunArn(v string) *GetTelemetryMetadataInput { - s.AssessmentRunArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetTelemetryMetadataResponse -type GetTelemetryMetadataOutput struct { - _ struct{} `type:"structure"` - - // Telemetry details. - // - // TelemetryMetadata is a required field - TelemetryMetadata []*TelemetryMetadata `locationName:"telemetryMetadata" type:"list" required:"true"` -} - -// String returns the string representation -func (s GetTelemetryMetadataOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTelemetryMetadataOutput) GoString() string { - return s.String() -} - -// SetTelemetryMetadata sets the TelemetryMetadata field's value. -func (s *GetTelemetryMetadataOutput) SetTelemetryMetadata(v []*TelemetryMetadata) *GetTelemetryMetadataOutput { - s.TelemetryMetadata = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunAgentsRequest -type ListAssessmentRunAgentsInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment run whose agents you want to list. - // - // AssessmentRunArn is a required field - AssessmentRunArn *string `locationName:"assessmentRunArn" min:"1" type:"string" required:"true"` - - // You can use this parameter to specify a subset of data to be included in - // the action's response. - // - // For a record to match a filter, all specified filter attributes must match. - // When multiple values are specified for a filter attribute, any of the values - // can match. - Filter *AgentFilter `locationName:"filter" type:"structure"` - - // You can use this parameter to indicate the maximum number of items that you - // want in the response. The default value is 10. The maximum value is 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the ListAssessmentRunAgents action. - // Subsequent calls to the action fill nextToken in the request with the value - // of NextToken from the previous response to continue listing data. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAssessmentRunAgentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssessmentRunAgentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssessmentRunAgentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssessmentRunAgentsInput"} - if s.AssessmentRunArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentRunArn")) - } - if s.AssessmentRunArn != nil && len(*s.AssessmentRunArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentRunArn", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - 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 -} - -// SetAssessmentRunArn sets the AssessmentRunArn field's value. -func (s *ListAssessmentRunAgentsInput) SetAssessmentRunArn(v string) *ListAssessmentRunAgentsInput { - s.AssessmentRunArn = &v - return s -} - -// SetFilter sets the Filter field's value. -func (s *ListAssessmentRunAgentsInput) SetFilter(v *AgentFilter) *ListAssessmentRunAgentsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssessmentRunAgentsInput) SetMaxResults(v int64) *ListAssessmentRunAgentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssessmentRunAgentsInput) SetNextToken(v string) *ListAssessmentRunAgentsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunAgentsResponse -type ListAssessmentRunAgentsOutput struct { - _ struct{} `type:"structure"` - - // A list of ARNs that specifies the agents returned by the action. - // - // AssessmentRunAgents is a required field - AssessmentRunAgents []*AssessmentRunAgent `locationName:"assessmentRunAgents" type:"list" required:"true"` - - // When a response is generated, if there is more data to be listed, this parameter - // is present in the response and contains the value to use for the nextToken - // parameter in a subsequent pagination request. If there is no more data to - // be listed, this parameter is set to null. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAssessmentRunAgentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssessmentRunAgentsOutput) GoString() string { - return s.String() -} - -// SetAssessmentRunAgents sets the AssessmentRunAgents field's value. -func (s *ListAssessmentRunAgentsOutput) SetAssessmentRunAgents(v []*AssessmentRunAgent) *ListAssessmentRunAgentsOutput { - s.AssessmentRunAgents = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssessmentRunAgentsOutput) SetNextToken(v string) *ListAssessmentRunAgentsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunsRequest -type ListAssessmentRunsInput struct { - _ struct{} `type:"structure"` - - // The ARNs that specify the assessment templates whose assessment runs you - // want to list. - AssessmentTemplateArns []*string `locationName:"assessmentTemplateArns" type:"list"` - - // You can use this parameter to specify a subset of data to be included in - // the action's response. - // - // For a record to match a filter, all specified filter attributes must match. - // When multiple values are specified for a filter attribute, any of the values - // can match. - Filter *AssessmentRunFilter `locationName:"filter" type:"structure"` - - // You can use this parameter to indicate the maximum number of items that you - // want in the response. The default value is 10. The maximum value is 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the ListAssessmentRuns action. Subsequent - // calls to the action fill nextToken in the request with the value of NextToken - // from the previous response to continue listing data. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAssessmentRunsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssessmentRunsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssessmentRunsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssessmentRunsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - 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 -} - -// SetAssessmentTemplateArns sets the AssessmentTemplateArns field's value. -func (s *ListAssessmentRunsInput) SetAssessmentTemplateArns(v []*string) *ListAssessmentRunsInput { - s.AssessmentTemplateArns = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *ListAssessmentRunsInput) SetFilter(v *AssessmentRunFilter) *ListAssessmentRunsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssessmentRunsInput) SetMaxResults(v int64) *ListAssessmentRunsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssessmentRunsInput) SetNextToken(v string) *ListAssessmentRunsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunsResponse -type ListAssessmentRunsOutput struct { - _ struct{} `type:"structure"` - - // A list of ARNs that specifies the assessment runs that are returned by the - // action. - // - // AssessmentRunArns is a required field - AssessmentRunArns []*string `locationName:"assessmentRunArns" type:"list" required:"true"` - - // When a response is generated, if there is more data to be listed, this parameter - // is present in the response and contains the value to use for the nextToken - // parameter in a subsequent pagination request. If there is no more data to - // be listed, this parameter is set to null. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAssessmentRunsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssessmentRunsOutput) GoString() string { - return s.String() -} - -// SetAssessmentRunArns sets the AssessmentRunArns field's value. -func (s *ListAssessmentRunsOutput) SetAssessmentRunArns(v []*string) *ListAssessmentRunsOutput { - s.AssessmentRunArns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssessmentRunsOutput) SetNextToken(v string) *ListAssessmentRunsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTargetsRequest -type ListAssessmentTargetsInput struct { - _ struct{} `type:"structure"` - - // You can use this parameter to specify a subset of data to be included in - // the action's response. - // - // For a record to match a filter, all specified filter attributes must match. - // When multiple values are specified for a filter attribute, any of the values - // can match. - Filter *AssessmentTargetFilter `locationName:"filter" type:"structure"` - - // You can use this parameter to indicate the maximum number of items you want - // in the response. The default value is 10. The maximum value is 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the ListAssessmentTargets action. - // Subsequent calls to the action fill nextToken in the request with the value - // of NextToken from the previous response to continue listing data. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAssessmentTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssessmentTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssessmentTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssessmentTargetsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - 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 *ListAssessmentTargetsInput) SetFilter(v *AssessmentTargetFilter) *ListAssessmentTargetsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssessmentTargetsInput) SetMaxResults(v int64) *ListAssessmentTargetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssessmentTargetsInput) SetNextToken(v string) *ListAssessmentTargetsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTargetsResponse -type ListAssessmentTargetsOutput struct { - _ struct{} `type:"structure"` - - // A list of ARNs that specifies the assessment targets that are returned by - // the action. - // - // AssessmentTargetArns is a required field - AssessmentTargetArns []*string `locationName:"assessmentTargetArns" type:"list" required:"true"` - - // When a response is generated, if there is more data to be listed, this parameter - // is present in the response and contains the value to use for the nextToken - // parameter in a subsequent pagination request. If there is no more data to - // be listed, this parameter is set to null. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAssessmentTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssessmentTargetsOutput) GoString() string { - return s.String() -} - -// SetAssessmentTargetArns sets the AssessmentTargetArns field's value. -func (s *ListAssessmentTargetsOutput) SetAssessmentTargetArns(v []*string) *ListAssessmentTargetsOutput { - s.AssessmentTargetArns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssessmentTargetsOutput) SetNextToken(v string) *ListAssessmentTargetsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTemplatesRequest -type ListAssessmentTemplatesInput struct { - _ struct{} `type:"structure"` - - // A list of ARNs that specifies the assessment targets whose assessment templates - // you want to list. - AssessmentTargetArns []*string `locationName:"assessmentTargetArns" type:"list"` - - // You can use this parameter to specify a subset of data to be included in - // the action's response. - // - // For a record to match a filter, all specified filter attributes must match. - // When multiple values are specified for a filter attribute, any of the values - // can match. - Filter *AssessmentTemplateFilter `locationName:"filter" type:"structure"` - - // You can use this parameter to indicate the maximum number of items you want - // in the response. The default value is 10. The maximum value is 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the ListAssessmentTemplates action. - // Subsequent calls to the action fill nextToken in the request with the value - // of NextToken from the previous response to continue listing data. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAssessmentTemplatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssessmentTemplatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssessmentTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssessmentTemplatesInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - 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 -} - -// SetAssessmentTargetArns sets the AssessmentTargetArns field's value. -func (s *ListAssessmentTemplatesInput) SetAssessmentTargetArns(v []*string) *ListAssessmentTemplatesInput { - s.AssessmentTargetArns = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *ListAssessmentTemplatesInput) SetFilter(v *AssessmentTemplateFilter) *ListAssessmentTemplatesInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssessmentTemplatesInput) SetMaxResults(v int64) *ListAssessmentTemplatesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssessmentTemplatesInput) SetNextToken(v string) *ListAssessmentTemplatesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTemplatesResponse -type ListAssessmentTemplatesOutput struct { - _ struct{} `type:"structure"` - - // A list of ARNs that specifies the assessment templates returned by the action. - // - // AssessmentTemplateArns is a required field - AssessmentTemplateArns []*string `locationName:"assessmentTemplateArns" type:"list" required:"true"` - - // When a response is generated, if there is more data to be listed, this parameter - // is present in the response and contains the value to use for the nextToken - // parameter in a subsequent pagination request. If there is no more data to - // be listed, this parameter is set to null. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAssessmentTemplatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssessmentTemplatesOutput) GoString() string { - return s.String() -} - -// SetAssessmentTemplateArns sets the AssessmentTemplateArns field's value. -func (s *ListAssessmentTemplatesOutput) SetAssessmentTemplateArns(v []*string) *ListAssessmentTemplatesOutput { - s.AssessmentTemplateArns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssessmentTemplatesOutput) SetNextToken(v string) *ListAssessmentTemplatesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListEventSubscriptionsRequest -type ListEventSubscriptionsInput struct { - _ struct{} `type:"structure"` - - // You can use this parameter to indicate the maximum number of items you want - // in the response. The default value is 10. The maximum value is 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the ListEventSubscriptions action. - // Subsequent calls to the action fill nextToken in the request with the value - // of NextToken from the previous response to continue listing data. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The ARN of the assessment template for which you want to list the existing - // event subscriptions. - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListEventSubscriptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListEventSubscriptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEventSubscriptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEventSubscriptionsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEventSubscriptionsInput) SetMaxResults(v int64) *ListEventSubscriptionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEventSubscriptionsInput) SetNextToken(v string) *ListEventSubscriptionsInput { - s.NextToken = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListEventSubscriptionsInput) SetResourceArn(v string) *ListEventSubscriptionsInput { - s.ResourceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListEventSubscriptionsResponse -type ListEventSubscriptionsOutput struct { - _ struct{} `type:"structure"` - - // When a response is generated, if there is more data to be listed, this parameter - // is present in the response and contains the value to use for the nextToken - // parameter in a subsequent pagination request. If there is no more data to - // be listed, this parameter is set to null. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Details of the returned event subscriptions. - // - // Subscriptions is a required field - Subscriptions []*Subscription `locationName:"subscriptions" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListEventSubscriptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListEventSubscriptionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEventSubscriptionsOutput) SetNextToken(v string) *ListEventSubscriptionsOutput { - s.NextToken = &v - return s -} - -// SetSubscriptions sets the Subscriptions field's value. -func (s *ListEventSubscriptionsOutput) SetSubscriptions(v []*Subscription) *ListEventSubscriptionsOutput { - s.Subscriptions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListFindingsRequest -type ListFindingsInput struct { - _ struct{} `type:"structure"` - - // The ARNs of the assessment runs that generate the findings that you want - // to list. - AssessmentRunArns []*string `locationName:"assessmentRunArns" type:"list"` - - // You can use this parameter to specify a subset of data to be included in - // the action's response. - // - // For a record to match a filter, all specified filter attributes must match. - // When multiple values are specified for a filter attribute, any of the values - // can match. - Filter *FindingFilter `locationName:"filter" type:"structure"` - - // You can use this parameter to indicate the maximum number of items you want - // in the response. The default value is 10. The maximum value is 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the ListFindings action. Subsequent - // calls to the action fill nextToken in the request with the value of NextToken - // from the previous response to continue listing data. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListFindingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListFindingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListFindingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListFindingsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - 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 -} - -// SetAssessmentRunArns sets the AssessmentRunArns field's value. -func (s *ListFindingsInput) SetAssessmentRunArns(v []*string) *ListFindingsInput { - s.AssessmentRunArns = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *ListFindingsInput) SetFilter(v *FindingFilter) *ListFindingsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListFindingsInput) SetMaxResults(v int64) *ListFindingsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFindingsInput) SetNextToken(v string) *ListFindingsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListFindingsResponse -type ListFindingsOutput struct { - _ struct{} `type:"structure"` - - // A list of ARNs that specifies the findings returned by the action. - // - // FindingArns is a required field - FindingArns []*string `locationName:"findingArns" type:"list" required:"true"` - - // When a response is generated, if there is more data to be listed, this parameter - // is present in the response and contains the value to use for the nextToken - // parameter in a subsequent pagination request. If there is no more data to - // be listed, this parameter is set to null. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListFindingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListFindingsOutput) GoString() string { - return s.String() -} - -// SetFindingArns sets the FindingArns field's value. -func (s *ListFindingsOutput) SetFindingArns(v []*string) *ListFindingsOutput { - s.FindingArns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFindingsOutput) SetNextToken(v string) *ListFindingsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListRulesPackagesRequest -type ListRulesPackagesInput struct { - _ struct{} `type:"structure"` - - // You can use this parameter to indicate the maximum number of items you want - // in the response. The default value is 10. The maximum value is 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the ListRulesPackages action. Subsequent - // calls to the action fill nextToken in the request with the value of NextToken - // from the previous response to continue listing data. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListRulesPackagesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRulesPackagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRulesPackagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRulesPackagesInput"} - 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 *ListRulesPackagesInput) SetMaxResults(v int64) *ListRulesPackagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRulesPackagesInput) SetNextToken(v string) *ListRulesPackagesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListRulesPackagesResponse -type ListRulesPackagesOutput struct { - _ struct{} `type:"structure"` - - // When a response is generated, if there is more data to be listed, this parameter - // is present in the response and contains the value to use for the nextToken - // parameter in a subsequent pagination request. If there is no more data to - // be listed, this parameter is set to null. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The list of ARNs that specifies the rules packages returned by the action. - // - // RulesPackageArns is a required field - RulesPackageArns []*string `locationName:"rulesPackageArns" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListRulesPackagesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRulesPackagesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRulesPackagesOutput) SetNextToken(v string) *ListRulesPackagesOutput { - s.NextToken = &v - return s -} - -// SetRulesPackageArns sets the RulesPackageArns field's value. -func (s *ListRulesPackagesOutput) SetRulesPackageArns(v []*string) *ListRulesPackagesOutput { - s.RulesPackageArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListTagsForResourceRequest -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the assessment template whose tags you want to list. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" 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.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 -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListTagsForResourceResponse -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A collection of key and value pairs. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" 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 []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/PreviewAgentsRequest -type PreviewAgentsInput struct { - _ struct{} `type:"structure"` - - // You can use this parameter to indicate the maximum number of items you want - // in the response. The default value is 10. The maximum value is 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the PreviewAgents action. Subsequent - // calls to the action fill nextToken in the request with the value of NextToken - // from the previous response to continue listing data. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The ARN of the assessment target whose agents you want to preview. - // - // PreviewAgentsArn is a required field - PreviewAgentsArn *string `locationName:"previewAgentsArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PreviewAgentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PreviewAgentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PreviewAgentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PreviewAgentsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.PreviewAgentsArn == nil { - invalidParams.Add(request.NewErrParamRequired("PreviewAgentsArn")) - } - if s.PreviewAgentsArn != nil && len(*s.PreviewAgentsArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PreviewAgentsArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *PreviewAgentsInput) SetMaxResults(v int64) *PreviewAgentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *PreviewAgentsInput) SetNextToken(v string) *PreviewAgentsInput { - s.NextToken = &v - return s -} - -// SetPreviewAgentsArn sets the PreviewAgentsArn field's value. -func (s *PreviewAgentsInput) SetPreviewAgentsArn(v string) *PreviewAgentsInput { - s.PreviewAgentsArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/PreviewAgentsResponse -type PreviewAgentsOutput struct { - _ struct{} `type:"structure"` - - // The resulting list of agents. - // - // AgentPreviews is a required field - AgentPreviews []*AgentPreview `locationName:"agentPreviews" type:"list" required:"true"` - - // When a response is generated, if there is more data to be listed, this parameter - // is present in the response and contains the value to use for the nextToken - // parameter in a subsequent pagination request. If there is no more data to - // be listed, this parameter is set to null. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s PreviewAgentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PreviewAgentsOutput) GoString() string { - return s.String() -} - -// SetAgentPreviews sets the AgentPreviews field's value. -func (s *PreviewAgentsOutput) SetAgentPreviews(v []*AgentPreview) *PreviewAgentsOutput { - s.AgentPreviews = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *PreviewAgentsOutput) SetNextToken(v string) *PreviewAgentsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RegisterCrossAccountAccessRoleRequest -type RegisterCrossAccountAccessRoleInput struct { - _ struct{} `type:"structure"` - - // The ARN of the IAM role that Amazon Inspector uses to list your EC2 instances - // during the assessment run or when you call the PreviewAgents action. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterCrossAccountAccessRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterCrossAccountAccessRoleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterCrossAccountAccessRoleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterCrossAccountAccessRoleInput"} - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRoleArn sets the RoleArn field's value. -func (s *RegisterCrossAccountAccessRoleInput) SetRoleArn(v string) *RegisterCrossAccountAccessRoleInput { - s.RoleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RegisterCrossAccountAccessRoleOutput -type RegisterCrossAccountAccessRoleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RegisterCrossAccountAccessRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterCrossAccountAccessRoleOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RemoveAttributesFromFindingsRequest -type RemoveAttributesFromFindingsInput struct { - _ struct{} `type:"structure"` - - // The array of attribute keys that you want to remove from specified findings. - // - // AttributeKeys is a required field - AttributeKeys []*string `locationName:"attributeKeys" type:"list" required:"true"` - - // The ARNs that specify the findings that you want to remove attributes from. - // - // FindingArns is a required field - FindingArns []*string `locationName:"findingArns" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveAttributesFromFindingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveAttributesFromFindingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveAttributesFromFindingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveAttributesFromFindingsInput"} - if s.AttributeKeys == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeKeys")) - } - if s.FindingArns == nil { - invalidParams.Add(request.NewErrParamRequired("FindingArns")) - } - if s.FindingArns != nil && len(s.FindingArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FindingArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeKeys sets the AttributeKeys field's value. -func (s *RemoveAttributesFromFindingsInput) SetAttributeKeys(v []*string) *RemoveAttributesFromFindingsInput { - s.AttributeKeys = v - return s -} - -// SetFindingArns sets the FindingArns field's value. -func (s *RemoveAttributesFromFindingsInput) SetFindingArns(v []*string) *RemoveAttributesFromFindingsInput { - s.FindingArns = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RemoveAttributesFromFindingsResponse -type RemoveAttributesFromFindingsOutput struct { - _ struct{} `type:"structure"` - - // Attributes details that cannot be described. An error code is provided for - // each failed item. - // - // FailedItems is a required field - FailedItems map[string]*FailedItemDetails `locationName:"failedItems" type:"map" required:"true"` -} - -// String returns the string representation -func (s RemoveAttributesFromFindingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveAttributesFromFindingsOutput) GoString() string { - return s.String() -} - -// SetFailedItems sets the FailedItems field's value. -func (s *RemoveAttributesFromFindingsOutput) SetFailedItems(v map[string]*FailedItemDetails) *RemoveAttributesFromFindingsOutput { - s.FailedItems = v - return s -} - -// Contains information about a resource group. The resource group defines a -// set of tags that, when queried, identify the AWS resources that make up the -// assessment target. This data type is used as the response element in the -// DescribeResourceGroups action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ResourceGroup -type ResourceGroup struct { - _ struct{} `type:"structure"` - - // The ARN of the resource group. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The time at which resource group is created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The tags (key and value pairs) of the resource group. This data type property - // is used in the CreateResourceGroup action. - // - // Tags is a required field - Tags []*ResourceGroupTag `locationName:"tags" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s ResourceGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceGroup) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ResourceGroup) SetArn(v string) *ResourceGroup { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ResourceGroup) SetCreatedAt(v time.Time) *ResourceGroup { - s.CreatedAt = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ResourceGroup) SetTags(v []*ResourceGroupTag) *ResourceGroup { - s.Tags = v - return s -} - -// This data type is used as one of the elements of the ResourceGroup data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ResourceGroupTag -type ResourceGroupTag struct { - _ struct{} `type:"structure"` - - // A tag key. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // The value assigned to a tag key. - Value *string `locationName:"value" min:"1" type:"string"` -} - -// String returns the string representation -func (s ResourceGroupTag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceGroupTag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResourceGroupTag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResourceGroupTag"} - 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 && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *ResourceGroupTag) SetKey(v string) *ResourceGroupTag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ResourceGroupTag) SetValue(v string) *ResourceGroupTag { - s.Value = &v - return s -} - -// Contains information about an Amazon Inspector rules package. This data type -// is used as the response element in the DescribeRulesPackages action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RulesPackage -type RulesPackage struct { - _ struct{} `type:"structure"` - - // The ARN of the rules package. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The description of the rules package. - Description *string `locationName:"description" type:"string"` - - // The name of the rules package. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The provider of the rules package. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The version ID of the rules package. - // - // Version is a required field - Version *string `locationName:"version" type:"string" required:"true"` -} - -// String returns the string representation -func (s RulesPackage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RulesPackage) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *RulesPackage) SetArn(v string) *RulesPackage { - s.Arn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *RulesPackage) SetDescription(v string) *RulesPackage { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *RulesPackage) SetName(v string) *RulesPackage { - s.Name = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *RulesPackage) SetProvider(v string) *RulesPackage { - s.Provider = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *RulesPackage) SetVersion(v string) *RulesPackage { - s.Version = &v - return s -} - -// This data type is used in the Finding data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/InspectorServiceAttributes -type ServiceAttributes struct { - _ struct{} `type:"structure"` - - // The ARN of the assessment run during which the finding is generated. - AssessmentRunArn *string `locationName:"assessmentRunArn" min:"1" type:"string"` - - // The ARN of the rules package that is used to generate the finding. - RulesPackageArn *string `locationName:"rulesPackageArn" min:"1" type:"string"` - - // The schema version of this data type. - // - // SchemaVersion is a required field - SchemaVersion *int64 `locationName:"schemaVersion" type:"integer" required:"true"` -} - -// String returns the string representation -func (s ServiceAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceAttributes) GoString() string { - return s.String() -} - -// SetAssessmentRunArn sets the AssessmentRunArn field's value. -func (s *ServiceAttributes) SetAssessmentRunArn(v string) *ServiceAttributes { - s.AssessmentRunArn = &v - return s -} - -// SetRulesPackageArn sets the RulesPackageArn field's value. -func (s *ServiceAttributes) SetRulesPackageArn(v string) *ServiceAttributes { - s.RulesPackageArn = &v - return s -} - -// SetSchemaVersion sets the SchemaVersion field's value. -func (s *ServiceAttributes) SetSchemaVersion(v int64) *ServiceAttributes { - s.SchemaVersion = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SetTagsForResourceRequest -type SetTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the assessment template that you want to set tags to. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // A collection of key and value pairs that you want to set to the assessment - // template. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// String returns the string representation -func (s SetTagsForResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetTagsForResourceInput"} - 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 { - 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 *SetTagsForResourceInput) SetResourceArn(v string) *SetTagsForResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SetTagsForResourceInput) SetTags(v []*Tag) *SetTagsForResourceInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SetTagsForResourceOutput -type SetTagsForResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetTagsForResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetTagsForResourceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StartAssessmentRunRequest -type StartAssessmentRunInput struct { - _ struct{} `type:"structure"` - - // You can specify the name for the assessment run. The name must be unique - // for the assessment template whose ARN is used to start the assessment run. - AssessmentRunName *string `locationName:"assessmentRunName" min:"1" type:"string"` - - // The ARN of the assessment template of the assessment run that you want to - // start. - // - // AssessmentTemplateArn is a required field - AssessmentTemplateArn *string `locationName:"assessmentTemplateArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartAssessmentRunInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartAssessmentRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartAssessmentRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartAssessmentRunInput"} - if s.AssessmentRunName != nil && len(*s.AssessmentRunName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentRunName", 1)) - } - if s.AssessmentTemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTemplateArn")) - } - if s.AssessmentTemplateArn != nil && len(*s.AssessmentTemplateArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTemplateArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentRunName sets the AssessmentRunName field's value. -func (s *StartAssessmentRunInput) SetAssessmentRunName(v string) *StartAssessmentRunInput { - s.AssessmentRunName = &v - return s -} - -// SetAssessmentTemplateArn sets the AssessmentTemplateArn field's value. -func (s *StartAssessmentRunInput) SetAssessmentTemplateArn(v string) *StartAssessmentRunInput { - s.AssessmentTemplateArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StartAssessmentRunResponse -type StartAssessmentRunOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the assessment run that has been started. - // - // AssessmentRunArn is a required field - AssessmentRunArn *string `locationName:"assessmentRunArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartAssessmentRunOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartAssessmentRunOutput) GoString() string { - return s.String() -} - -// SetAssessmentRunArn sets the AssessmentRunArn field's value. -func (s *StartAssessmentRunOutput) SetAssessmentRunArn(v string) *StartAssessmentRunOutput { - s.AssessmentRunArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StopAssessmentRunRequest -type StopAssessmentRunInput struct { - _ struct{} `type:"structure"` - - // The ARN of the assessment run that you want to stop. - // - // AssessmentRunArn is a required field - AssessmentRunArn *string `locationName:"assessmentRunArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopAssessmentRunInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopAssessmentRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopAssessmentRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopAssessmentRunInput"} - if s.AssessmentRunArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentRunArn")) - } - if s.AssessmentRunArn != nil && len(*s.AssessmentRunArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentRunArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentRunArn sets the AssessmentRunArn field's value. -func (s *StopAssessmentRunInput) SetAssessmentRunArn(v string) *StopAssessmentRunInput { - s.AssessmentRunArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StopAssessmentRunOutput -type StopAssessmentRunOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StopAssessmentRunOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopAssessmentRunOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SubscribeToEventRequest -type SubscribeToEventInput struct { - _ struct{} `type:"structure"` - - // The event for which you want to receive SNS notifications. - // - // Event is a required field - Event *string `locationName:"event" type:"string" required:"true" enum:"Event"` - - // The ARN of the assessment template that is used during the event for which - // you want to receive SNS notifications. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The ARN of the SNS topic to which the SNS notifications are sent. - // - // TopicArn is a required field - TopicArn *string `locationName:"topicArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SubscribeToEventInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubscribeToEventInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SubscribeToEventInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SubscribeToEventInput"} - if s.Event == nil { - invalidParams.Add(request.NewErrParamRequired("Event")) - } - 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.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - if s.TopicArn != nil && len(*s.TopicArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvent sets the Event field's value. -func (s *SubscribeToEventInput) SetEvent(v string) *SubscribeToEventInput { - s.Event = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *SubscribeToEventInput) SetResourceArn(v string) *SubscribeToEventInput { - s.ResourceArn = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *SubscribeToEventInput) SetTopicArn(v string) *SubscribeToEventInput { - s.TopicArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SubscribeToEventOutput -type SubscribeToEventOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SubscribeToEventOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubscribeToEventOutput) GoString() string { - return s.String() -} - -// This data type is used as a response element in the ListEventSubscriptions -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/Subscription -type Subscription struct { - _ struct{} `type:"structure"` - - // The list of existing event subscriptions. - // - // EventSubscriptions is a required field - EventSubscriptions []*EventSubscription `locationName:"eventSubscriptions" min:"1" type:"list" required:"true"` - - // The ARN of the assessment template that is used during the event for which - // the SNS notification is sent. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The ARN of the Amazon Simple Notification Service (SNS) topic to which the - // SNS notifications are sent. - // - // TopicArn is a required field - TopicArn *string `locationName:"topicArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s Subscription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Subscription) GoString() string { - return s.String() -} - -// SetEventSubscriptions sets the EventSubscriptions field's value. -func (s *Subscription) SetEventSubscriptions(v []*EventSubscription) *Subscription { - s.EventSubscriptions = v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *Subscription) SetResourceArn(v string) *Subscription { - s.ResourceArn = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *Subscription) SetTopicArn(v string) *Subscription { - s.TopicArn = &v - return s -} - -// A key and value pair. This data type is used as a request parameter in the -// SetTagsForResource action and a response element in the ListTagsForResource -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // A tag key. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // A value assigned to a tag key. - Value *string `locationName:"value" min:"1" 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 s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 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 -} - -// The metadata about the Amazon Inspector application data metrics collected -// by the agent. This data type is used as the response element in the GetTelemetryMetadata -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/TelemetryMetadata -type TelemetryMetadata struct { - _ struct{} `type:"structure"` - - // The count of messages that the agent sends to the Amazon Inspector service. - // - // Count is a required field - Count *int64 `locationName:"count" type:"long" required:"true"` - - // The data size of messages that the agent sends to the Amazon Inspector service. - DataSize *int64 `locationName:"dataSize" type:"long"` - - // A specific type of behavioral data that is collected by the agent. - // - // MessageType is a required field - MessageType *string `locationName:"messageType" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s TelemetryMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TelemetryMetadata) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *TelemetryMetadata) SetCount(v int64) *TelemetryMetadata { - s.Count = &v - return s -} - -// SetDataSize sets the DataSize field's value. -func (s *TelemetryMetadata) SetDataSize(v int64) *TelemetryMetadata { - s.DataSize = &v - return s -} - -// SetMessageType sets the MessageType field's value. -func (s *TelemetryMetadata) SetMessageType(v string) *TelemetryMetadata { - s.MessageType = &v - return s -} - -// This data type is used in the AssessmentRunFilter data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/TimestampRange -type TimestampRange struct { - _ struct{} `type:"structure"` - - // The minimum value of the timestamp range. - BeginDate *time.Time `locationName:"beginDate" type:"timestamp" timestampFormat:"unix"` - - // The maximum value of the timestamp range. - EndDate *time.Time `locationName:"endDate" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s TimestampRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimestampRange) GoString() string { - return s.String() -} - -// SetBeginDate sets the BeginDate field's value. -func (s *TimestampRange) SetBeginDate(v time.Time) *TimestampRange { - s.BeginDate = &v - return s -} - -// SetEndDate sets the EndDate field's value. -func (s *TimestampRange) SetEndDate(v time.Time) *TimestampRange { - s.EndDate = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UnsubscribeFromEventRequest -type UnsubscribeFromEventInput struct { - _ struct{} `type:"structure"` - - // The event for which you want to stop receiving SNS notifications. - // - // Event is a required field - Event *string `locationName:"event" type:"string" required:"true" enum:"Event"` - - // The ARN of the assessment template that is used during the event for which - // you want to stop receiving SNS notifications. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The ARN of the SNS topic to which SNS notifications are sent. - // - // TopicArn is a required field - TopicArn *string `locationName:"topicArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UnsubscribeFromEventInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsubscribeFromEventInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnsubscribeFromEventInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnsubscribeFromEventInput"} - if s.Event == nil { - invalidParams.Add(request.NewErrParamRequired("Event")) - } - 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.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - if s.TopicArn != nil && len(*s.TopicArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvent sets the Event field's value. -func (s *UnsubscribeFromEventInput) SetEvent(v string) *UnsubscribeFromEventInput { - s.Event = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UnsubscribeFromEventInput) SetResourceArn(v string) *UnsubscribeFromEventInput { - s.ResourceArn = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *UnsubscribeFromEventInput) SetTopicArn(v string) *UnsubscribeFromEventInput { - s.TopicArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UnsubscribeFromEventOutput -type UnsubscribeFromEventOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UnsubscribeFromEventOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsubscribeFromEventOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UpdateAssessmentTargetRequest -type UpdateAssessmentTargetInput struct { - _ struct{} `type:"structure"` - - // The ARN of the assessment target that you want to update. - // - // AssessmentTargetArn is a required field - AssessmentTargetArn *string `locationName:"assessmentTargetArn" min:"1" type:"string" required:"true"` - - // The name of the assessment target that you want to update. - // - // AssessmentTargetName is a required field - AssessmentTargetName *string `locationName:"assessmentTargetName" min:"1" type:"string" required:"true"` - - // The ARN of the resource group that is used to specify the new resource group - // to associate with the assessment target. - // - // ResourceGroupArn is a required field - ResourceGroupArn *string `locationName:"resourceGroupArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateAssessmentTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAssessmentTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAssessmentTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAssessmentTargetInput"} - if s.AssessmentTargetArn == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTargetArn")) - } - if s.AssessmentTargetArn != nil && len(*s.AssessmentTargetArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTargetArn", 1)) - } - if s.AssessmentTargetName == nil { - invalidParams.Add(request.NewErrParamRequired("AssessmentTargetName")) - } - if s.AssessmentTargetName != nil && len(*s.AssessmentTargetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssessmentTargetName", 1)) - } - if s.ResourceGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupArn")) - } - if s.ResourceGroupArn != nil && len(*s.ResourceGroupArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceGroupArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssessmentTargetArn sets the AssessmentTargetArn field's value. -func (s *UpdateAssessmentTargetInput) SetAssessmentTargetArn(v string) *UpdateAssessmentTargetInput { - s.AssessmentTargetArn = &v - return s -} - -// SetAssessmentTargetName sets the AssessmentTargetName field's value. -func (s *UpdateAssessmentTargetInput) SetAssessmentTargetName(v string) *UpdateAssessmentTargetInput { - s.AssessmentTargetName = &v - return s -} - -// SetResourceGroupArn sets the ResourceGroupArn field's value. -func (s *UpdateAssessmentTargetInput) SetResourceGroupArn(v string) *UpdateAssessmentTargetInput { - s.ResourceGroupArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UpdateAssessmentTargetOutput -type UpdateAssessmentTargetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateAssessmentTargetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAssessmentTargetOutput) GoString() string { - return s.String() -} - -const ( - // AccessDeniedErrorCodeAccessDeniedToAssessmentTarget is a AccessDeniedErrorCode enum value - AccessDeniedErrorCodeAccessDeniedToAssessmentTarget = "ACCESS_DENIED_TO_ASSESSMENT_TARGET" - - // AccessDeniedErrorCodeAccessDeniedToAssessmentTemplate is a AccessDeniedErrorCode enum value - AccessDeniedErrorCodeAccessDeniedToAssessmentTemplate = "ACCESS_DENIED_TO_ASSESSMENT_TEMPLATE" - - // AccessDeniedErrorCodeAccessDeniedToAssessmentRun is a AccessDeniedErrorCode enum value - AccessDeniedErrorCodeAccessDeniedToAssessmentRun = "ACCESS_DENIED_TO_ASSESSMENT_RUN" - - // AccessDeniedErrorCodeAccessDeniedToFinding is a AccessDeniedErrorCode enum value - AccessDeniedErrorCodeAccessDeniedToFinding = "ACCESS_DENIED_TO_FINDING" - - // AccessDeniedErrorCodeAccessDeniedToResourceGroup is a AccessDeniedErrorCode enum value - AccessDeniedErrorCodeAccessDeniedToResourceGroup = "ACCESS_DENIED_TO_RESOURCE_GROUP" - - // AccessDeniedErrorCodeAccessDeniedToRulesPackage is a AccessDeniedErrorCode enum value - AccessDeniedErrorCodeAccessDeniedToRulesPackage = "ACCESS_DENIED_TO_RULES_PACKAGE" - - // AccessDeniedErrorCodeAccessDeniedToSnsTopic is a AccessDeniedErrorCode enum value - AccessDeniedErrorCodeAccessDeniedToSnsTopic = "ACCESS_DENIED_TO_SNS_TOPIC" - - // AccessDeniedErrorCodeAccessDeniedToIamRole is a AccessDeniedErrorCode enum value - AccessDeniedErrorCodeAccessDeniedToIamRole = "ACCESS_DENIED_TO_IAM_ROLE" -) - -const ( - // AgentHealthHealthy is a AgentHealth enum value - AgentHealthHealthy = "HEALTHY" - - // AgentHealthUnhealthy is a AgentHealth enum value - AgentHealthUnhealthy = "UNHEALTHY" -) - -const ( - // AgentHealthCodeIdle is a AgentHealthCode enum value - AgentHealthCodeIdle = "IDLE" - - // AgentHealthCodeRunning is a AgentHealthCode enum value - AgentHealthCodeRunning = "RUNNING" - - // AgentHealthCodeShutdown is a AgentHealthCode enum value - AgentHealthCodeShutdown = "SHUTDOWN" - - // AgentHealthCodeUnhealthy is a AgentHealthCode enum value - AgentHealthCodeUnhealthy = "UNHEALTHY" - - // AgentHealthCodeThrottled is a AgentHealthCode enum value - AgentHealthCodeThrottled = "THROTTLED" - - // AgentHealthCodeUnknown is a AgentHealthCode enum value - AgentHealthCodeUnknown = "UNKNOWN" -) - -const ( - // AssessmentRunNotificationSnsStatusCodeSuccess is a AssessmentRunNotificationSnsStatusCode enum value - AssessmentRunNotificationSnsStatusCodeSuccess = "SUCCESS" - - // AssessmentRunNotificationSnsStatusCodeTopicDoesNotExist is a AssessmentRunNotificationSnsStatusCode enum value - AssessmentRunNotificationSnsStatusCodeTopicDoesNotExist = "TOPIC_DOES_NOT_EXIST" - - // AssessmentRunNotificationSnsStatusCodeAccessDenied is a AssessmentRunNotificationSnsStatusCode enum value - AssessmentRunNotificationSnsStatusCodeAccessDenied = "ACCESS_DENIED" - - // AssessmentRunNotificationSnsStatusCodeInternalError is a AssessmentRunNotificationSnsStatusCode enum value - AssessmentRunNotificationSnsStatusCodeInternalError = "INTERNAL_ERROR" -) - -const ( - // AssessmentRunStateCreated is a AssessmentRunState enum value - AssessmentRunStateCreated = "CREATED" - - // AssessmentRunStateStartDataCollectionPending is a AssessmentRunState enum value - AssessmentRunStateStartDataCollectionPending = "START_DATA_COLLECTION_PENDING" - - // AssessmentRunStateStartDataCollectionInProgress is a AssessmentRunState enum value - AssessmentRunStateStartDataCollectionInProgress = "START_DATA_COLLECTION_IN_PROGRESS" - - // AssessmentRunStateCollectingData is a AssessmentRunState enum value - AssessmentRunStateCollectingData = "COLLECTING_DATA" - - // AssessmentRunStateStopDataCollectionPending is a AssessmentRunState enum value - AssessmentRunStateStopDataCollectionPending = "STOP_DATA_COLLECTION_PENDING" - - // AssessmentRunStateDataCollected is a AssessmentRunState enum value - AssessmentRunStateDataCollected = "DATA_COLLECTED" - - // AssessmentRunStateEvaluatingRules is a AssessmentRunState enum value - AssessmentRunStateEvaluatingRules = "EVALUATING_RULES" - - // AssessmentRunStateFailed is a AssessmentRunState enum value - AssessmentRunStateFailed = "FAILED" - - // AssessmentRunStateCompleted is a AssessmentRunState enum value - AssessmentRunStateCompleted = "COMPLETED" - - // AssessmentRunStateCompletedWithErrors is a AssessmentRunState enum value - AssessmentRunStateCompletedWithErrors = "COMPLETED_WITH_ERRORS" -) - -const ( - // AssetTypeEc2Instance is a AssetType enum value - AssetTypeEc2Instance = "ec2-instance" -) - -const ( - // EventAssessmentRunStarted is a Event enum value - EventAssessmentRunStarted = "ASSESSMENT_RUN_STARTED" - - // EventAssessmentRunCompleted is a Event enum value - EventAssessmentRunCompleted = "ASSESSMENT_RUN_COMPLETED" - - // EventAssessmentRunStateChanged is a Event enum value - EventAssessmentRunStateChanged = "ASSESSMENT_RUN_STATE_CHANGED" - - // EventFindingReported is a Event enum value - EventFindingReported = "FINDING_REPORTED" - - // EventOther is a Event enum value - EventOther = "OTHER" -) - -const ( - // FailedItemErrorCodeInvalidArn is a FailedItemErrorCode enum value - FailedItemErrorCodeInvalidArn = "INVALID_ARN" - - // FailedItemErrorCodeDuplicateArn is a FailedItemErrorCode enum value - FailedItemErrorCodeDuplicateArn = "DUPLICATE_ARN" - - // FailedItemErrorCodeItemDoesNotExist is a FailedItemErrorCode enum value - FailedItemErrorCodeItemDoesNotExist = "ITEM_DOES_NOT_EXIST" - - // FailedItemErrorCodeAccessDenied is a FailedItemErrorCode enum value - FailedItemErrorCodeAccessDenied = "ACCESS_DENIED" - - // FailedItemErrorCodeLimitExceeded is a FailedItemErrorCode enum value - FailedItemErrorCodeLimitExceeded = "LIMIT_EXCEEDED" - - // FailedItemErrorCodeInternalError is a FailedItemErrorCode enum value - FailedItemErrorCodeInternalError = "INTERNAL_ERROR" -) - -const ( - // InvalidCrossAccountRoleErrorCodeRoleDoesNotExistOrInvalidTrustRelationship is a InvalidCrossAccountRoleErrorCode enum value - InvalidCrossAccountRoleErrorCodeRoleDoesNotExistOrInvalidTrustRelationship = "ROLE_DOES_NOT_EXIST_OR_INVALID_TRUST_RELATIONSHIP" - - // InvalidCrossAccountRoleErrorCodeRoleDoesNotHaveCorrectPolicy is a InvalidCrossAccountRoleErrorCode enum value - InvalidCrossAccountRoleErrorCodeRoleDoesNotHaveCorrectPolicy = "ROLE_DOES_NOT_HAVE_CORRECT_POLICY" -) - -const ( - // InvalidInputErrorCodeInvalidAssessmentTargetArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentTargetArn = "INVALID_ASSESSMENT_TARGET_ARN" - - // InvalidInputErrorCodeInvalidAssessmentTemplateArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentTemplateArn = "INVALID_ASSESSMENT_TEMPLATE_ARN" - - // InvalidInputErrorCodeInvalidAssessmentRunArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentRunArn = "INVALID_ASSESSMENT_RUN_ARN" - - // InvalidInputErrorCodeInvalidFindingArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidFindingArn = "INVALID_FINDING_ARN" - - // InvalidInputErrorCodeInvalidResourceGroupArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidResourceGroupArn = "INVALID_RESOURCE_GROUP_ARN" - - // InvalidInputErrorCodeInvalidRulesPackageArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidRulesPackageArn = "INVALID_RULES_PACKAGE_ARN" - - // InvalidInputErrorCodeInvalidResourceArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidResourceArn = "INVALID_RESOURCE_ARN" - - // InvalidInputErrorCodeInvalidSnsTopicArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidSnsTopicArn = "INVALID_SNS_TOPIC_ARN" - - // InvalidInputErrorCodeInvalidIamRoleArn is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidIamRoleArn = "INVALID_IAM_ROLE_ARN" - - // InvalidInputErrorCodeInvalidAssessmentTargetName is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentTargetName = "INVALID_ASSESSMENT_TARGET_NAME" - - // InvalidInputErrorCodeInvalidAssessmentTargetNamePattern is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentTargetNamePattern = "INVALID_ASSESSMENT_TARGET_NAME_PATTERN" - - // InvalidInputErrorCodeInvalidAssessmentTemplateName is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentTemplateName = "INVALID_ASSESSMENT_TEMPLATE_NAME" - - // InvalidInputErrorCodeInvalidAssessmentTemplateNamePattern is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentTemplateNamePattern = "INVALID_ASSESSMENT_TEMPLATE_NAME_PATTERN" - - // InvalidInputErrorCodeInvalidAssessmentTemplateDuration is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentTemplateDuration = "INVALID_ASSESSMENT_TEMPLATE_DURATION" - - // InvalidInputErrorCodeInvalidAssessmentTemplateDurationRange is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentTemplateDurationRange = "INVALID_ASSESSMENT_TEMPLATE_DURATION_RANGE" - - // InvalidInputErrorCodeInvalidAssessmentRunDurationRange is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentRunDurationRange = "INVALID_ASSESSMENT_RUN_DURATION_RANGE" - - // InvalidInputErrorCodeInvalidAssessmentRunStartTimeRange is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentRunStartTimeRange = "INVALID_ASSESSMENT_RUN_START_TIME_RANGE" - - // InvalidInputErrorCodeInvalidAssessmentRunCompletionTimeRange is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentRunCompletionTimeRange = "INVALID_ASSESSMENT_RUN_COMPLETION_TIME_RANGE" - - // InvalidInputErrorCodeInvalidAssessmentRunStateChangeTimeRange is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentRunStateChangeTimeRange = "INVALID_ASSESSMENT_RUN_STATE_CHANGE_TIME_RANGE" - - // InvalidInputErrorCodeInvalidAssessmentRunState is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAssessmentRunState = "INVALID_ASSESSMENT_RUN_STATE" - - // InvalidInputErrorCodeInvalidTag is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidTag = "INVALID_TAG" - - // InvalidInputErrorCodeInvalidTagKey is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidTagKey = "INVALID_TAG_KEY" - - // InvalidInputErrorCodeInvalidTagValue is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidTagValue = "INVALID_TAG_VALUE" - - // InvalidInputErrorCodeInvalidResourceGroupTagKey is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidResourceGroupTagKey = "INVALID_RESOURCE_GROUP_TAG_KEY" - - // InvalidInputErrorCodeInvalidResourceGroupTagValue is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidResourceGroupTagValue = "INVALID_RESOURCE_GROUP_TAG_VALUE" - - // InvalidInputErrorCodeInvalidAttribute is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAttribute = "INVALID_ATTRIBUTE" - - // InvalidInputErrorCodeInvalidUserAttribute is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidUserAttribute = "INVALID_USER_ATTRIBUTE" - - // InvalidInputErrorCodeInvalidUserAttributeKey is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidUserAttributeKey = "INVALID_USER_ATTRIBUTE_KEY" - - // InvalidInputErrorCodeInvalidUserAttributeValue is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidUserAttributeValue = "INVALID_USER_ATTRIBUTE_VALUE" - - // InvalidInputErrorCodeInvalidPaginationToken is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidPaginationToken = "INVALID_PAGINATION_TOKEN" - - // InvalidInputErrorCodeInvalidMaxResults is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidMaxResults = "INVALID_MAX_RESULTS" - - // InvalidInputErrorCodeInvalidAgentId is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAgentId = "INVALID_AGENT_ID" - - // InvalidInputErrorCodeInvalidAutoScalingGroup is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidAutoScalingGroup = "INVALID_AUTO_SCALING_GROUP" - - // InvalidInputErrorCodeInvalidRuleName is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidRuleName = "INVALID_RULE_NAME" - - // InvalidInputErrorCodeInvalidSeverity is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidSeverity = "INVALID_SEVERITY" - - // InvalidInputErrorCodeInvalidLocale is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidLocale = "INVALID_LOCALE" - - // InvalidInputErrorCodeInvalidEvent is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidEvent = "INVALID_EVENT" - - // InvalidInputErrorCodeAssessmentTargetNameAlreadyTaken is a InvalidInputErrorCode enum value - InvalidInputErrorCodeAssessmentTargetNameAlreadyTaken = "ASSESSMENT_TARGET_NAME_ALREADY_TAKEN" - - // InvalidInputErrorCodeAssessmentTemplateNameAlreadyTaken is a InvalidInputErrorCode enum value - InvalidInputErrorCodeAssessmentTemplateNameAlreadyTaken = "ASSESSMENT_TEMPLATE_NAME_ALREADY_TAKEN" - - // InvalidInputErrorCodeInvalidNumberOfAssessmentTargetArns is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfAssessmentTargetArns = "INVALID_NUMBER_OF_ASSESSMENT_TARGET_ARNS" - - // InvalidInputErrorCodeInvalidNumberOfAssessmentTemplateArns is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfAssessmentTemplateArns = "INVALID_NUMBER_OF_ASSESSMENT_TEMPLATE_ARNS" - - // InvalidInputErrorCodeInvalidNumberOfAssessmentRunArns is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfAssessmentRunArns = "INVALID_NUMBER_OF_ASSESSMENT_RUN_ARNS" - - // InvalidInputErrorCodeInvalidNumberOfFindingArns is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfFindingArns = "INVALID_NUMBER_OF_FINDING_ARNS" - - // InvalidInputErrorCodeInvalidNumberOfResourceGroupArns is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfResourceGroupArns = "INVALID_NUMBER_OF_RESOURCE_GROUP_ARNS" - - // InvalidInputErrorCodeInvalidNumberOfRulesPackageArns is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfRulesPackageArns = "INVALID_NUMBER_OF_RULES_PACKAGE_ARNS" - - // InvalidInputErrorCodeInvalidNumberOfAssessmentRunStates is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfAssessmentRunStates = "INVALID_NUMBER_OF_ASSESSMENT_RUN_STATES" - - // InvalidInputErrorCodeInvalidNumberOfTags is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfTags = "INVALID_NUMBER_OF_TAGS" - - // InvalidInputErrorCodeInvalidNumberOfResourceGroupTags is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfResourceGroupTags = "INVALID_NUMBER_OF_RESOURCE_GROUP_TAGS" - - // InvalidInputErrorCodeInvalidNumberOfAttributes is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfAttributes = "INVALID_NUMBER_OF_ATTRIBUTES" - - // InvalidInputErrorCodeInvalidNumberOfUserAttributes is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfUserAttributes = "INVALID_NUMBER_OF_USER_ATTRIBUTES" - - // InvalidInputErrorCodeInvalidNumberOfAgentIds is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfAgentIds = "INVALID_NUMBER_OF_AGENT_IDS" - - // InvalidInputErrorCodeInvalidNumberOfAutoScalingGroups is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfAutoScalingGroups = "INVALID_NUMBER_OF_AUTO_SCALING_GROUPS" - - // InvalidInputErrorCodeInvalidNumberOfRuleNames is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfRuleNames = "INVALID_NUMBER_OF_RULE_NAMES" - - // InvalidInputErrorCodeInvalidNumberOfSeverities is a InvalidInputErrorCode enum value - InvalidInputErrorCodeInvalidNumberOfSeverities = "INVALID_NUMBER_OF_SEVERITIES" -) - -const ( - // LimitExceededErrorCodeAssessmentTargetLimitExceeded is a LimitExceededErrorCode enum value - LimitExceededErrorCodeAssessmentTargetLimitExceeded = "ASSESSMENT_TARGET_LIMIT_EXCEEDED" - - // LimitExceededErrorCodeAssessmentTemplateLimitExceeded is a LimitExceededErrorCode enum value - LimitExceededErrorCodeAssessmentTemplateLimitExceeded = "ASSESSMENT_TEMPLATE_LIMIT_EXCEEDED" - - // LimitExceededErrorCodeAssessmentRunLimitExceeded is a LimitExceededErrorCode enum value - LimitExceededErrorCodeAssessmentRunLimitExceeded = "ASSESSMENT_RUN_LIMIT_EXCEEDED" - - // LimitExceededErrorCodeResourceGroupLimitExceeded is a LimitExceededErrorCode enum value - LimitExceededErrorCodeResourceGroupLimitExceeded = "RESOURCE_GROUP_LIMIT_EXCEEDED" - - // LimitExceededErrorCodeEventSubscriptionLimitExceeded is a LimitExceededErrorCode enum value - LimitExceededErrorCodeEventSubscriptionLimitExceeded = "EVENT_SUBSCRIPTION_LIMIT_EXCEEDED" -) - -const ( - // LocaleEnUs is a Locale enum value - LocaleEnUs = "EN_US" -) - -const ( - // NoSuchEntityErrorCodeAssessmentTargetDoesNotExist is a NoSuchEntityErrorCode enum value - NoSuchEntityErrorCodeAssessmentTargetDoesNotExist = "ASSESSMENT_TARGET_DOES_NOT_EXIST" - - // NoSuchEntityErrorCodeAssessmentTemplateDoesNotExist is a NoSuchEntityErrorCode enum value - NoSuchEntityErrorCodeAssessmentTemplateDoesNotExist = "ASSESSMENT_TEMPLATE_DOES_NOT_EXIST" - - // NoSuchEntityErrorCodeAssessmentRunDoesNotExist is a NoSuchEntityErrorCode enum value - NoSuchEntityErrorCodeAssessmentRunDoesNotExist = "ASSESSMENT_RUN_DOES_NOT_EXIST" - - // NoSuchEntityErrorCodeFindingDoesNotExist is a NoSuchEntityErrorCode enum value - NoSuchEntityErrorCodeFindingDoesNotExist = "FINDING_DOES_NOT_EXIST" - - // NoSuchEntityErrorCodeResourceGroupDoesNotExist is a NoSuchEntityErrorCode enum value - NoSuchEntityErrorCodeResourceGroupDoesNotExist = "RESOURCE_GROUP_DOES_NOT_EXIST" - - // NoSuchEntityErrorCodeRulesPackageDoesNotExist is a NoSuchEntityErrorCode enum value - NoSuchEntityErrorCodeRulesPackageDoesNotExist = "RULES_PACKAGE_DOES_NOT_EXIST" - - // NoSuchEntityErrorCodeSnsTopicDoesNotExist is a NoSuchEntityErrorCode enum value - NoSuchEntityErrorCodeSnsTopicDoesNotExist = "SNS_TOPIC_DOES_NOT_EXIST" - - // NoSuchEntityErrorCodeIamRoleDoesNotExist is a NoSuchEntityErrorCode enum value - NoSuchEntityErrorCodeIamRoleDoesNotExist = "IAM_ROLE_DOES_NOT_EXIST" -) - -const ( - // SeverityLow is a Severity enum value - SeverityLow = "Low" - - // SeverityMedium is a Severity enum value - SeverityMedium = "Medium" - - // SeverityHigh is a Severity enum value - SeverityHigh = "High" - - // SeverityInformational is a Severity enum value - SeverityInformational = "Informational" - - // SeverityUndefined is a Severity enum value - SeverityUndefined = "Undefined" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go b/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go deleted file mode 100644 index e398530..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go +++ /dev/null @@ -1,60 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package inspector - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have required permissions to access the requested resource. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeAgentsAlreadyRunningAssessmentException for service response error code - // "AgentsAlreadyRunningAssessmentException". - // - // You started an assessment run, but one of the instances is already participating - // in another assessment run. - ErrCodeAgentsAlreadyRunningAssessmentException = "AgentsAlreadyRunningAssessmentException" - - // ErrCodeAssessmentRunInProgressException for service response error code - // "AssessmentRunInProgressException". - // - // You cannot perform a specified action if an assessment run is currently in - // progress. - ErrCodeAssessmentRunInProgressException = "AssessmentRunInProgressException" - - // ErrCodeInternalException for service response error code - // "InternalException". - // - // Internal server error. - ErrCodeInternalException = "InternalException" - - // ErrCodeInvalidCrossAccountRoleException for service response error code - // "InvalidCrossAccountRoleException". - // - // Amazon Inspector cannot assume the cross-account role that it needs to list - // your EC2 instances during the assessment run. - ErrCodeInvalidCrossAccountRoleException = "InvalidCrossAccountRoleException" - - // ErrCodeInvalidInputException for service response error code - // "InvalidInputException". - // - // The request was rejected because an invalid or out-of-range value was supplied - // for an input parameter. - ErrCodeInvalidInputException = "InvalidInputException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // The request was rejected because it attempted to create resources beyond - // the current AWS account limits. The error code describes the limit exceeded. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeNoSuchEntityException for service response error code - // "NoSuchEntityException". - // - // The request was rejected because it referenced an entity that does not exist. - // The error code describes the entity. - ErrCodeNoSuchEntityException = "NoSuchEntityException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go b/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go deleted file mode 100644 index 3401a9c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go +++ /dev/null @@ -1,95 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package inspector - -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 Inspector enables you to analyze the behavior of your AWS resources -// and to identify potential security issues. For more information, see Amazon -// Inspector User Guide (http://docs.aws.amazon.com/inspector/latest/userguide/inspector_introduction.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/inspector-2016-02-16 -type Inspector 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 = "inspector" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the Inspector 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 Inspector client from just a session. -// svc := inspector.New(mySession) -// -// // Create a Inspector client with additional configuration -// svc := inspector.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Inspector { - 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) *Inspector { - svc := &Inspector{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-02-16", - JSONVersion: "1.1", - TargetPrefix: "InspectorService", - }, - 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 Inspector operation and runs any -// custom request initialization. -func (c *Inspector) 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/api.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go deleted file mode 100644 index e36f23d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go +++ /dev/null @@ -1,4353 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package kinesis provides a client for Amazon Kinesis. -package kinesis - -import ( - "fmt" - "time" - - "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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *DescribeStreamOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeStreamRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeStreamOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListStreamsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStreamsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStreamsOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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 083aa5e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go +++ /dev/null @@ -1,51 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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/service.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go deleted file mode 100644 index ed037fe..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go +++ /dev/null @@ -1,94 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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 c1f56d6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/waiters.go +++ /dev/null @@ -1,34 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package kinesis - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// 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 { - waiterCfg := waiter.Config{ - Operation: "DescribeStream", - Delay: 10, - MaxAttempts: 18, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "StreamDescription.StreamStatus", - Expected: "ACTIVE", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/kms/api.go b/vendor/github.com/aws/aws-sdk-go/service/kms/api.go deleted file mode 100644 index afd375b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/api.go +++ /dev/null @@ -1,7535 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package kms provides a client for AWS Key Management Service. -package kms - -import ( - "fmt" - "time" - - "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 opCancelKeyDeletion = "CancelKeyDeletion" - -// CancelKeyDeletionRequest generates a "aws/request.Request" representing the -// client's request for the CancelKeyDeletion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelKeyDeletion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelKeyDeletion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelKeyDeletionRequest method. -// req, resp := client.CancelKeyDeletionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletion -func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *request.Request, output *CancelKeyDeletionOutput) { - op := &request.Operation{ - Name: opCancelKeyDeletion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelKeyDeletionInput{} - } - - output = &CancelKeyDeletionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelKeyDeletion API operation for AWS Key Management Service. -// -// Cancels the deletion of a customer master key (CMK). When this operation -// is successful, the CMK is set to the Disabled state. To enable a CMK, use -// EnableKey. -// -// For more information about scheduling and canceling deletion of a CMK, see -// Deleting Customer Master Keys (http://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) -// in the AWS Key Management Service 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 AWS Key Management Service's -// API operation CancelKeyDeletion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletion -func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error) { - req, out := c.CancelKeyDeletionRequest(input) - err := req.Send() - return out, err -} - -const opCreateAlias = "CreateAlias" - -// CreateAliasRequest generates a "aws/request.Request" representing the -// client's request for the CreateAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAliasRequest method. -// req, resp := client.CreateAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAlias -func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput) { - op := &request.Operation{ - Name: opCreateAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAliasInput{} - } - - output = &CreateAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateAlias API operation for AWS Key Management Service. -// -// Creates a display name for a customer master key. An alias can be used to -// identify a key and should be unique. The console enforces a one-to-one mapping -// between the alias and a key. An alias name can contain only alphanumeric -// characters, forward slashes (/), underscores (_), and dashes (-). An alias -// must start with the word "alias" followed by a forward slash (alias/). An -// alias that begins with "aws" after the forward slash (alias/aws...) is reserved -// by Amazon Web Services (AWS). -// -// The alias and the key it is mapped to must be in the same AWS account and -// the same region. -// -// To map an alias to a different key, call UpdateAlias. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation CreateAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeAlreadyExistsException "AlreadyExistsException" -// The request was rejected because it attempted to create a resource that already -// exists. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidAliasNameException "InvalidAliasNameException" -// The request was rejected because the specified alias name is not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because a limit was exceeded. For more information, -// see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAlias -func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { - req, out := c.CreateAliasRequest(input) - err := req.Send() - return out, err -} - -const opCreateGrant = "CreateGrant" - -// CreateGrantRequest generates a "aws/request.Request" representing the -// client's request for the CreateGrant operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateGrant for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateGrant method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateGrantRequest method. -// req, resp := client.CreateGrantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrant -func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, output *CreateGrantOutput) { - op := &request.Operation{ - Name: opCreateGrant, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateGrantInput{} - } - - output = &CreateGrantOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateGrant API operation for AWS Key Management Service. -// -// Adds a grant to a key to specify who can use the key and under what conditions. -// Grants are alternate permission mechanisms to key policies. -// -// For more information about grants, see Grants (http://docs.aws.amazon.com/kms/latest/developerguide/grants.html) -// in the AWS Key Management Service 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 AWS Key Management Service's -// API operation CreateGrant for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDisabledException "DisabledException" -// The request was rejected because the specified CMK is not enabled. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" -// The request was rejected because the specified grant token is not valid. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because a limit was exceeded. For more information, -// see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrant -func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error) { - req, out := c.CreateGrantRequest(input) - err := req.Send() - return out, err -} - -const opCreateKey = "CreateKey" - -// CreateKeyRequest generates a "aws/request.Request" representing the -// client's request for the CreateKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateKeyRequest method. -// req, resp := client.CreateKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey -func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput) { - op := &request.Operation{ - Name: opCreateKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateKeyInput{} - } - - output = &CreateKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateKey API operation for AWS Key Management Service. -// -// Creates a customer master key (CMK). -// -// You can use a CMK to encrypt small amounts of data (4 KiB or less) directly, -// but CMKs are more commonly used to encrypt data encryption keys (DEKs), which -// are used to encrypt raw data. For more information about DEKs and the difference -// between CMKs and DEKs, see the following: -// -// * The GenerateDataKey operation -// -// * AWS Key Management Service Concepts (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html) -// in the AWS Key Management Service 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 AWS Key Management Service's -// API operation CreateKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException" -// The request was rejected because the specified policy is not syntactically -// or semantically correct. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because a limit was exceeded. For more information, -// see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeTagException "TagException" -// The request was rejected because one or more tags are not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey -func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error) { - req, out := c.CreateKeyRequest(input) - err := req.Send() - return out, err -} - -const opDecrypt = "Decrypt" - -// DecryptRequest generates a "aws/request.Request" representing the -// client's request for the Decrypt operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Decrypt for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Decrypt method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DecryptRequest method. -// req, resp := client.DecryptRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt -func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output *DecryptOutput) { - op := &request.Operation{ - Name: opDecrypt, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DecryptInput{} - } - - output = &DecryptOutput{} - req = c.newRequest(op, input, output) - return -} - -// Decrypt API operation for AWS Key Management Service. -// -// Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted -// by using any of the following functions: -// -// * GenerateDataKey -// -// * GenerateDataKeyWithoutPlaintext -// -// * Encrypt -// -// Note that if a caller has been granted access permissions to all keys (through, -// for example, IAM user policies that grant Decrypt permission on all resources), -// then ciphertext encrypted by using keys in other accounts where the key grants -// access to the caller can be decrypted. To remedy this, we recommend that -// you do not grant Decrypt access in an IAM user policy. Instead grant Decrypt -// access only in key policies. If you must grant Decrypt access in an IAM user -// policy, you should scope the resource to specific keys or to specific trusted -// accounts. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation Decrypt for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDisabledException "DisabledException" -// The request was rejected because the specified CMK is not enabled. -// -// * ErrCodeInvalidCiphertextException "InvalidCiphertextException" -// The request was rejected because the specified ciphertext has been corrupted -// or is otherwise invalid. -// -// * ErrCodeKeyUnavailableException "KeyUnavailableException" -// The request was rejected because the specified CMK was not available. The -// request can be retried. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" -// The request was rejected because the specified grant token is not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt -func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error) { - req, out := c.DecryptRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAlias = "DeleteAlias" - -// DeleteAliasRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAliasRequest method. -// req, resp := client.DeleteAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAlias -func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) { - op := &request.Operation{ - Name: opDeleteAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAliasInput{} - } - - output = &DeleteAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAlias API operation for AWS Key Management Service. -// -// Deletes the specified alias. To map an alias to a different key, call UpdateAlias. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation DeleteAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAlias -func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { - req, out := c.DeleteAliasRequest(input) - err := req.Send() - return out, err -} - -const opDeleteImportedKeyMaterial = "DeleteImportedKeyMaterial" - -// DeleteImportedKeyMaterialRequest generates a "aws/request.Request" representing the -// client's request for the DeleteImportedKeyMaterial operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteImportedKeyMaterial for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteImportedKeyMaterial method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteImportedKeyMaterialRequest method. -// req, resp := client.DeleteImportedKeyMaterialRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterial -func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialInput) (req *request.Request, output *DeleteImportedKeyMaterialOutput) { - op := &request.Operation{ - Name: opDeleteImportedKeyMaterial, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteImportedKeyMaterialInput{} - } - - output = &DeleteImportedKeyMaterialOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteImportedKeyMaterial API operation for AWS Key Management Service. -// -// Deletes key material that you previously imported and makes the specified -// customer master key (CMK) unusable. For more information about importing -// key material into AWS KMS, see Importing Key Material (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) -// in the AWS Key Management Service Developer Guide. -// -// When the specified CMK is in the PendingDeletion state, this operation does -// not change the CMK's state. Otherwise, it changes the CMK's state to PendingImport. -// -// After you delete key material, you can use ImportKeyMaterial to reimport -// the same key material into the CMK. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation DeleteImportedKeyMaterial for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterial -func (c *KMS) DeleteImportedKeyMaterial(input *DeleteImportedKeyMaterialInput) (*DeleteImportedKeyMaterialOutput, error) { - req, out := c.DeleteImportedKeyMaterialRequest(input) - err := req.Send() - return out, err -} - -const opDescribeKey = "DescribeKey" - -// DescribeKeyRequest generates a "aws/request.Request" representing the -// client's request for the DescribeKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeKeyRequest method. -// req, resp := client.DescribeKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey -func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, output *DescribeKeyOutput) { - op := &request.Operation{ - Name: opDescribeKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeKeyInput{} - } - - output = &DescribeKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeKey API operation for AWS Key Management Service. -// -// Provides detailed information about the specified customer master key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation DescribeKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey -func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error) { - req, out := c.DescribeKeyRequest(input) - err := req.Send() - return out, err -} - -const opDisableKey = "DisableKey" - -// DisableKeyRequest generates a "aws/request.Request" representing the -// client's request for the DisableKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableKeyRequest method. -// req, resp := client.DisableKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKey -func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, output *DisableKeyOutput) { - op := &request.Operation{ - Name: opDisableKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableKeyInput{} - } - - output = &DisableKeyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableKey API operation for AWS Key Management Service. -// -// Sets the state of a customer master key (CMK) to disabled, thereby preventing -// its use for cryptographic operations. For more information about how key -// state affects the use of a CMK, see How Key State Affects the Use of a Customer -// Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service 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 AWS Key Management Service's -// API operation DisableKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKey -func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error) { - req, out := c.DisableKeyRequest(input) - err := req.Send() - return out, err -} - -const opDisableKeyRotation = "DisableKeyRotation" - -// DisableKeyRotationRequest generates a "aws/request.Request" representing the -// client's request for the DisableKeyRotation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableKeyRotation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableKeyRotation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableKeyRotationRequest method. -// req, resp := client.DisableKeyRotationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotation -func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *request.Request, output *DisableKeyRotationOutput) { - op := &request.Operation{ - Name: opDisableKeyRotation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableKeyRotationInput{} - } - - output = &DisableKeyRotationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableKeyRotation API operation for AWS Key Management Service. -// -// Disables rotation of the specified key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation DisableKeyRotation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDisabledException "DisabledException" -// The request was rejected because the specified CMK is not enabled. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotation -func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error) { - req, out := c.DisableKeyRotationRequest(input) - err := req.Send() - return out, err -} - -const opEnableKey = "EnableKey" - -// EnableKeyRequest generates a "aws/request.Request" representing the -// client's request for the EnableKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableKeyRequest method. -// req, resp := client.EnableKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKey -func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, output *EnableKeyOutput) { - op := &request.Operation{ - Name: opEnableKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableKeyInput{} - } - - output = &EnableKeyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableKey API operation for AWS Key Management Service. -// -// Marks a key as enabled, thereby permitting its use. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation EnableKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because a limit was exceeded. For more information, -// see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKey -func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error) { - req, out := c.EnableKeyRequest(input) - err := req.Send() - return out, err -} - -const opEnableKeyRotation = "EnableKeyRotation" - -// EnableKeyRotationRequest generates a "aws/request.Request" representing the -// client's request for the EnableKeyRotation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableKeyRotation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableKeyRotation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableKeyRotationRequest method. -// req, resp := client.EnableKeyRotationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation -func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *request.Request, output *EnableKeyRotationOutput) { - op := &request.Operation{ - Name: opEnableKeyRotation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableKeyRotationInput{} - } - - output = &EnableKeyRotationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableKeyRotation API operation for AWS Key Management Service. -// -// Enables rotation of the specified customer master key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation EnableKeyRotation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDisabledException "DisabledException" -// The request was rejected because the specified CMK is not enabled. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation -func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error) { - req, out := c.EnableKeyRotationRequest(input) - err := req.Send() - return out, err -} - -const opEncrypt = "Encrypt" - -// EncryptRequest generates a "aws/request.Request" representing the -// client's request for the Encrypt operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Encrypt for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Encrypt method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EncryptRequest method. -// req, resp := client.EncryptRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt -func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output *EncryptOutput) { - op := &request.Operation{ - Name: opEncrypt, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EncryptInput{} - } - - output = &EncryptOutput{} - req = c.newRequest(op, input, output) - return -} - -// Encrypt API operation for AWS Key Management Service. -// -// Encrypts plaintext into ciphertext by using a customer master key. The Encrypt -// function has two primary use cases: -// -// * You can encrypt up to 4 KB of arbitrary data such as an RSA key, a database -// password, or other sensitive customer information. -// -// * If you are moving encrypted data from one region to another, you can -// use this API to encrypt in the new region the plaintext data key that -// was used to encrypt the data in the original region. This provides you -// with an encrypted copy of the data key that can be decrypted in the new -// region and used there to decrypt the encrypted data. -// -// Unless you are moving encrypted data from one region to another, you don't -// use this function to encrypt a generated data key within a region. You retrieve -// data keys already encrypted by calling the GenerateDataKey or GenerateDataKeyWithoutPlaintext -// function. Data keys don't need to be encrypted again by calling Encrypt. -// -// If you want to encrypt data locally in your application, you can use the -// GenerateDataKey function to return a plaintext data encryption key and a -// copy of the key encrypted under the customer master key (CMK) of your choosing. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation Encrypt for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDisabledException "DisabledException" -// The request was rejected because the specified CMK is not enabled. -// -// * ErrCodeKeyUnavailableException "KeyUnavailableException" -// The request was rejected because the specified CMK was not available. The -// request can be retried. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidKeyUsageException "InvalidKeyUsageException" -// The request was rejected because the specified KeySpec value is not valid. -// -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" -// The request was rejected because the specified grant token is not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt -func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error) { - req, out := c.EncryptRequest(input) - err := req.Send() - return out, err -} - -const opGenerateDataKey = "GenerateDataKey" - -// GenerateDataKeyRequest generates a "aws/request.Request" representing the -// client's request for the GenerateDataKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GenerateDataKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GenerateDataKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GenerateDataKeyRequest method. -// req, resp := client.GenerateDataKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKey -func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.Request, output *GenerateDataKeyOutput) { - op := &request.Operation{ - Name: opGenerateDataKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GenerateDataKeyInput{} - } - - output = &GenerateDataKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GenerateDataKey API operation for AWS Key Management Service. -// -// Returns a data encryption key that you can use in your application to encrypt -// data locally. -// -// You must specify the customer master key (CMK) under which to generate the -// data key. You must also specify the length of the data key using either the -// KeySpec or NumberOfBytes field. You must specify one field or the other, -// but not both. For common key lengths (128-bit and 256-bit symmetric keys), -// we recommend that you use KeySpec. -// -// This operation returns a plaintext copy of the data key in the Plaintext -// field of the response, and an encrypted copy of the data key in the CiphertextBlob -// field. The data key is encrypted under the CMK specified in the KeyId field -// of the request. -// -// We recommend that you use the following pattern to encrypt data locally in -// your application: -// -// Use this operation (GenerateDataKey) to retrieve a data encryption key. -// -// Use the plaintext data encryption key (returned in the Plaintext field of -// the response) to encrypt data locally, then erase the plaintext data key -// from memory. -// -// Store the encrypted data key (returned in the CiphertextBlob field of the -// response) alongside the locally encrypted data. -// -// To decrypt data locally: -// -// Use the Decrypt operation to decrypt the encrypted data key into a plaintext -// copy of the data key. -// -// Use the plaintext data key to decrypt data locally, then erase the plaintext -// data key from memory. -// -// To return only an encrypted copy of the data key, use GenerateDataKeyWithoutPlaintext. -// To return an arbitrary unpredictable byte string, use GenerateRandom. -// -// If you use the optional EncryptionContext field, you must store at least -// enough information to be able to reconstruct the full encryption context -// when you later send the ciphertext to the Decrypt operation. It is a good -// practice to choose an encryption context that you can reconstruct on the -// fly to better secure the ciphertext. For more information, see Encryption -// Context (http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html) -// in the AWS Key Management Service 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 AWS Key Management Service's -// API operation GenerateDataKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDisabledException "DisabledException" -// The request was rejected because the specified CMK is not enabled. -// -// * ErrCodeKeyUnavailableException "KeyUnavailableException" -// The request was rejected because the specified CMK was not available. The -// request can be retried. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidKeyUsageException "InvalidKeyUsageException" -// The request was rejected because the specified KeySpec value is not valid. -// -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" -// The request was rejected because the specified grant token is not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKey -func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error) { - req, out := c.GenerateDataKeyRequest(input) - err := req.Send() - return out, err -} - -const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" - -// GenerateDataKeyWithoutPlaintextRequest generates a "aws/request.Request" representing the -// client's request for the GenerateDataKeyWithoutPlaintext operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GenerateDataKeyWithoutPlaintext for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GenerateDataKeyWithoutPlaintext method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GenerateDataKeyWithoutPlaintextRequest method. -// req, resp := client.GenerateDataKeyWithoutPlaintextRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintext -func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput) { - op := &request.Operation{ - Name: opGenerateDataKeyWithoutPlaintext, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GenerateDataKeyWithoutPlaintextInput{} - } - - output = &GenerateDataKeyWithoutPlaintextOutput{} - req = c.newRequest(op, input, output) - return -} - -// GenerateDataKeyWithoutPlaintext API operation for AWS Key Management Service. -// -// Returns a data encryption key encrypted under a customer master key (CMK). -// This operation is identical to GenerateDataKey but returns only the encrypted -// copy of the data key. -// -// This operation is useful in a system that has multiple components with different -// degrees of trust. For example, consider a system that stores encrypted data -// in containers. Each container stores the encrypted data and an encrypted -// copy of the data key. One component of the system, called the control plane, -// creates new containers. When it creates a new container, it uses this operation -// (GenerateDataKeyWithoutPlaintext) to get an encrypted data key and then stores -// it in the container. Later, a different component of the system, called the -// data plane, puts encrypted data into the containers. To do this, it passes -// the encrypted data key to the Decrypt operation, then uses the returned plaintext -// data key to encrypt data, and finally stores the encrypted data in the container. -// In this system, the control plane never sees the plaintext data key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation GenerateDataKeyWithoutPlaintext for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDisabledException "DisabledException" -// The request was rejected because the specified CMK is not enabled. -// -// * ErrCodeKeyUnavailableException "KeyUnavailableException" -// The request was rejected because the specified CMK was not available. The -// request can be retried. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidKeyUsageException "InvalidKeyUsageException" -// The request was rejected because the specified KeySpec value is not valid. -// -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" -// The request was rejected because the specified grant token is not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintext -func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error) { - req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) - err := req.Send() - return out, err -} - -const opGenerateRandom = "GenerateRandom" - -// GenerateRandomRequest generates a "aws/request.Request" representing the -// client's request for the GenerateRandom operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GenerateRandom for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GenerateRandom method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GenerateRandomRequest method. -// req, resp := client.GenerateRandomRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandom -func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput) { - op := &request.Operation{ - Name: opGenerateRandom, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GenerateRandomInput{} - } - - output = &GenerateRandomOutput{} - req = c.newRequest(op, input, output) - return -} - -// GenerateRandom API operation for AWS Key Management Service. -// -// Generates an unpredictable byte string. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation GenerateRandom for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandom -func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error) { - req, out := c.GenerateRandomRequest(input) - err := req.Send() - return out, err -} - -const opGetKeyPolicy = "GetKeyPolicy" - -// GetKeyPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetKeyPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetKeyPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetKeyPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetKeyPolicyRequest method. -// req, resp := client.GetKeyPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy -func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput) { - op := &request.Operation{ - Name: opGetKeyPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetKeyPolicyInput{} - } - - output = &GetKeyPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetKeyPolicy API operation for AWS Key Management Service. -// -// Retrieves a policy attached to the specified key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation GetKeyPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy -func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error) { - req, out := c.GetKeyPolicyRequest(input) - err := req.Send() - return out, err -} - -const opGetKeyRotationStatus = "GetKeyRotationStatus" - -// GetKeyRotationStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetKeyRotationStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetKeyRotationStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetKeyRotationStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetKeyRotationStatusRequest method. -// req, resp := client.GetKeyRotationStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus -func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req *request.Request, output *GetKeyRotationStatusOutput) { - op := &request.Operation{ - Name: opGetKeyRotationStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetKeyRotationStatusInput{} - } - - output = &GetKeyRotationStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetKeyRotationStatus API operation for AWS Key Management Service. -// -// Retrieves a Boolean value that indicates whether key rotation is enabled -// for the specified key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation GetKeyRotationStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus -func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error) { - req, out := c.GetKeyRotationStatusRequest(input) - err := req.Send() - return out, err -} - -const opGetParametersForImport = "GetParametersForImport" - -// GetParametersForImportRequest generates a "aws/request.Request" representing the -// client's request for the GetParametersForImport operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetParametersForImport for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetParametersForImport method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetParametersForImportRequest method. -// req, resp := client.GetParametersForImportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImport -func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) (req *request.Request, output *GetParametersForImportOutput) { - op := &request.Operation{ - Name: opGetParametersForImport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetParametersForImportInput{} - } - - output = &GetParametersForImportOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetParametersForImport API operation for AWS Key Management Service. -// -// Returns the items you need in order to import key material into AWS KMS from -// your existing key management infrastructure. For more information about importing -// key material into AWS KMS, see Importing Key Material (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) -// in the AWS Key Management Service Developer Guide. -// -// You must specify the key ID of the customer master key (CMK) into which you -// will import key material. This CMK's Origin must be EXTERNAL. You must also -// specify the wrapping algorithm and type of wrapping key (public key) that -// you will use to encrypt the key material. -// -// This operation returns a public key and an import token. Use the public key -// to encrypt the key material. Store the import token to send with a subsequent -// ImportKeyMaterial request. The public key and import token from the same -// response must be used together. These items are valid for 24 hours, after -// which they cannot be used for a subsequent ImportKeyMaterial request. To -// retrieve new ones, send another GetParametersForImport 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 AWS Key Management Service's -// API operation GetParametersForImport for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImport -func (c *KMS) GetParametersForImport(input *GetParametersForImportInput) (*GetParametersForImportOutput, error) { - req, out := c.GetParametersForImportRequest(input) - err := req.Send() - return out, err -} - -const opImportKeyMaterial = "ImportKeyMaterial" - -// ImportKeyMaterialRequest generates a "aws/request.Request" representing the -// client's request for the ImportKeyMaterial operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportKeyMaterial for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportKeyMaterial method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportKeyMaterialRequest method. -// req, resp := client.ImportKeyMaterialRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterial -func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *request.Request, output *ImportKeyMaterialOutput) { - op := &request.Operation{ - Name: opImportKeyMaterial, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportKeyMaterialInput{} - } - - output = &ImportKeyMaterialOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportKeyMaterial API operation for AWS Key Management Service. -// -// Imports key material into an AWS KMS customer master key (CMK) from your -// existing key management infrastructure. For more information about importing -// key material into AWS KMS, see Importing Key Material (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) -// in the AWS Key Management Service Developer Guide. -// -// You must specify the key ID of the CMK to import the key material into. This -// CMK's Origin must be EXTERNAL. You must also send an import token and the -// encrypted key material. Send the import token that you received in the same -// GetParametersForImport response that contained the public key that you used -// to encrypt the key material. You must also specify whether the key material -// expires and if so, when. When the key material expires, AWS KMS deletes the -// key material and the CMK becomes unusable. To use the CMK again, you can -// reimport the same key material. If you set an expiration date, you can change -// it only by reimporting the same key material and specifying a new expiration -// date. -// -// When this operation is successful, the specified CMK's key state changes -// to Enabled, and you can use the CMK. -// -// After you successfully import key material into a CMK, you can reimport the -// same key material into that CMK, but you cannot import different key material. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation ImportKeyMaterial for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeInvalidCiphertextException "InvalidCiphertextException" -// The request was rejected because the specified ciphertext has been corrupted -// or is otherwise invalid. -// -// * ErrCodeIncorrectKeyMaterialException "IncorrectKeyMaterialException" -// The request was rejected because the provided key material is invalid or -// is not the same key material that was previously imported into this customer -// master key (CMK). -// -// * ErrCodeExpiredImportTokenException "ExpiredImportTokenException" -// The request was rejected because the provided import token is expired. Use -// GetParametersForImport to retrieve a new import token and public key, use -// the new public key to encrypt the key material, and then try the request -// again. -// -// * ErrCodeInvalidImportTokenException "InvalidImportTokenException" -// The request was rejected because the provided import token is invalid or -// is associated with a different customer master key (CMK). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterial -func (c *KMS) ImportKeyMaterial(input *ImportKeyMaterialInput) (*ImportKeyMaterialOutput, error) { - req, out := c.ImportKeyMaterialRequest(input) - err := req.Send() - return out, err -} - -const opListAliases = "ListAliases" - -// ListAliasesRequest generates a "aws/request.Request" representing the -// client's request for the ListAliases operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAliases for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAliases method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAliasesRequest method. -// req, resp := client.ListAliasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliases -func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) { - op := &request.Operation{ - Name: opListAliases, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "Limit", - TruncationToken: "Truncated", - }, - } - - if input == nil { - input = &ListAliasesInput{} - } - - output = &ListAliasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAliases API operation for AWS Key Management Service. -// -// Lists all of the key aliases in the 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 AWS Key Management Service's -// API operation ListAliases for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidMarkerException "InvalidMarkerException" -// The request was rejected because the marker that specifies where pagination -// should next begin is not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliases -func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { - req, out := c.ListAliasesRequest(input) - err := req.Send() - return out, err -} - -// ListAliasesPages iterates over the pages of a ListAliases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAliases 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 ListAliases operation. -// pageNum := 0 -// err := client.ListAliasesPages(params, -// func(page *ListAliasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(p *ListAliasesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAliasesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAliasesOutput), lastPage) - }) -} - -const opListGrants = "ListGrants" - -// ListGrantsRequest generates a "aws/request.Request" representing the -// client's request for the ListGrants operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListGrants for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListGrants method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListGrantsRequest method. -// req, resp := client.ListGrantsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrants -func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, output *ListGrantsResponse) { - op := &request.Operation{ - Name: opListGrants, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "Limit", - TruncationToken: "Truncated", - }, - } - - if input == nil { - input = &ListGrantsInput{} - } - - output = &ListGrantsResponse{} - req = c.newRequest(op, input, output) - return -} - -// ListGrants API operation for AWS Key Management Service. -// -// List the grants for a specified key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation ListGrants for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidMarkerException "InvalidMarkerException" -// The request was rejected because the marker that specifies where pagination -// should next begin is not valid. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrants -func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error) { - req, out := c.ListGrantsRequest(input) - err := req.Send() - return out, err -} - -// ListGrantsPages iterates over the pages of a ListGrants operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGrants 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 ListGrants operation. -// pageNum := 0 -// err := client.ListGrantsPages(params, -// func(page *ListGrantsResponse, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(p *ListGrantsResponse, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListGrantsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListGrantsResponse), lastPage) - }) -} - -const opListKeyPolicies = "ListKeyPolicies" - -// ListKeyPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListKeyPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListKeyPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListKeyPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListKeyPoliciesRequest method. -// req, resp := client.ListKeyPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPolicies -func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.Request, output *ListKeyPoliciesOutput) { - op := &request.Operation{ - Name: opListKeyPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "Limit", - TruncationToken: "Truncated", - }, - } - - if input == nil { - input = &ListKeyPoliciesInput{} - } - - output = &ListKeyPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListKeyPolicies API operation for AWS Key Management Service. -// -// Retrieves a list of policies attached to a key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation ListKeyPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPolicies -func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error) { - req, out := c.ListKeyPoliciesRequest(input) - err := req.Send() - return out, err -} - -// ListKeyPoliciesPages iterates over the pages of a ListKeyPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListKeyPolicies 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 ListKeyPolicies operation. -// pageNum := 0 -// err := client.ListKeyPoliciesPages(params, -// func(page *ListKeyPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(p *ListKeyPoliciesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListKeyPoliciesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListKeyPoliciesOutput), lastPage) - }) -} - -const opListKeys = "ListKeys" - -// ListKeysRequest generates a "aws/request.Request" representing the -// client's request for the ListKeys operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListKeys for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListKeys method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListKeysRequest method. -// req, resp := client.ListKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeys -func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput) { - op := &request.Operation{ - Name: opListKeys, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "Limit", - TruncationToken: "Truncated", - }, - } - - if input == nil { - input = &ListKeysInput{} - } - - output = &ListKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListKeys API operation for AWS Key Management Service. -// -// Lists the customer master 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 AWS Key Management Service's -// API operation ListKeys for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidMarkerException "InvalidMarkerException" -// The request was rejected because the marker that specifies where pagination -// should next begin is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeys -func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) { - req, out := c.ListKeysRequest(input) - err := req.Send() - return out, err -} - -// ListKeysPages iterates over the pages of a ListKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListKeys 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 ListKeys operation. -// pageNum := 0 -// err := client.ListKeysPages(params, -// func(page *ListKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(p *ListKeysOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListKeysRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListKeysOutput), lastPage) - }) -} - -const opListResourceTags = "ListResourceTags" - -// ListResourceTagsRequest generates a "aws/request.Request" representing the -// client's request for the ListResourceTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListResourceTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListResourceTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListResourceTagsRequest method. -// req, resp := client.ListResourceTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTags -func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) (req *request.Request, output *ListResourceTagsOutput) { - op := &request.Operation{ - Name: opListResourceTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListResourceTagsInput{} - } - - output = &ListResourceTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListResourceTags API operation for AWS Key Management Service. -// -// Returns a list of all tags for the specified customer master key (CMK). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation ListResourceTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeInvalidMarkerException "InvalidMarkerException" -// The request was rejected because the marker that specifies where pagination -// should next begin is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTags -func (c *KMS) ListResourceTags(input *ListResourceTagsInput) (*ListResourceTagsOutput, error) { - req, out := c.ListResourceTagsRequest(input) - err := req.Send() - return out, err -} - -const opListRetirableGrants = "ListRetirableGrants" - -// ListRetirableGrantsRequest generates a "aws/request.Request" representing the -// client's request for the ListRetirableGrants operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListRetirableGrants for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListRetirableGrants method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListRetirableGrantsRequest method. -// req, resp := client.ListRetirableGrantsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListRetirableGrants -func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *request.Request, output *ListGrantsResponse) { - op := &request.Operation{ - Name: opListRetirableGrants, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListRetirableGrantsInput{} - } - - output = &ListGrantsResponse{} - req = c.newRequest(op, input, output) - return -} - -// ListRetirableGrants API operation for AWS Key Management Service. -// -// Returns a list of all grants for which the grant's RetiringPrincipal matches -// the one specified. -// -// A typical use is to list all grants that you are able to retire. To retire -// a grant, use RetireGrant. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation ListRetirableGrants for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidMarkerException "InvalidMarkerException" -// The request was rejected because the marker that specifies where pagination -// should next begin is not valid. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListRetirableGrants -func (c *KMS) ListRetirableGrants(input *ListRetirableGrantsInput) (*ListGrantsResponse, error) { - req, out := c.ListRetirableGrantsRequest(input) - err := req.Send() - return out, err -} - -const opPutKeyPolicy = "PutKeyPolicy" - -// PutKeyPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutKeyPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutKeyPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutKeyPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutKeyPolicyRequest method. -// req, resp := client.PutKeyPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicy -func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Request, output *PutKeyPolicyOutput) { - op := &request.Operation{ - Name: opPutKeyPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutKeyPolicyInput{} - } - - output = &PutKeyPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutKeyPolicy API operation for AWS Key Management Service. -// -// Attaches a key policy to the specified customer master key (CMK). -// -// For more information about key policies, see Key Policies (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) -// in the AWS Key Management Service 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 AWS Key Management Service's -// API operation PutKeyPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException" -// The request was rejected because the specified policy is not syntactically -// or semantically correct. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because a limit was exceeded. For more information, -// see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicy -func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error) { - req, out := c.PutKeyPolicyRequest(input) - err := req.Send() - return out, err -} - -const opReEncrypt = "ReEncrypt" - -// ReEncryptRequest generates a "aws/request.Request" representing the -// client's request for the ReEncrypt operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReEncrypt for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReEncrypt method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReEncryptRequest method. -// req, resp := client.ReEncryptRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt -func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, output *ReEncryptOutput) { - op := &request.Operation{ - Name: opReEncrypt, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReEncryptInput{} - } - - output = &ReEncryptOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReEncrypt API operation for AWS Key Management Service. -// -// Encrypts data on the server side with a new customer master key (CMK) without -// exposing the plaintext of the data on the client side. The data is first -// decrypted and then reencrypted. You can also use this operation to change -// the encryption context of a ciphertext. -// -// Unlike other operations, ReEncrypt is authorized twice, once as ReEncryptFrom -// on the source CMK and once as ReEncryptTo on the destination CMK. We recommend -// that you include the "kms:ReEncrypt*" permission in your key policies (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) -// to permit reencryption from or to the CMK. This permission is automatically -// included in the key policy when you create a CMK through the console, but -// you must include it manually when you create a CMK programmatically or when -// you set a key policy with the PutKeyPolicy 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 AWS Key Management Service's -// API operation ReEncrypt for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDisabledException "DisabledException" -// The request was rejected because the specified CMK is not enabled. -// -// * ErrCodeInvalidCiphertextException "InvalidCiphertextException" -// The request was rejected because the specified ciphertext has been corrupted -// or is otherwise invalid. -// -// * ErrCodeKeyUnavailableException "KeyUnavailableException" -// The request was rejected because the specified CMK was not available. The -// request can be retried. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidKeyUsageException "InvalidKeyUsageException" -// The request was rejected because the specified KeySpec value is not valid. -// -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" -// The request was rejected because the specified grant token is not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt -func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error) { - req, out := c.ReEncryptRequest(input) - err := req.Send() - return out, err -} - -const opRetireGrant = "RetireGrant" - -// RetireGrantRequest generates a "aws/request.Request" representing the -// client's request for the RetireGrant operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RetireGrant for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RetireGrant method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RetireGrantRequest method. -// req, resp := client.RetireGrantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrant -func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, output *RetireGrantOutput) { - op := &request.Operation{ - Name: opRetireGrant, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RetireGrantInput{} - } - - output = &RetireGrantOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RetireGrant API operation for AWS Key Management Service. -// -// Retires a grant. To clean up, you can retire a grant when you're done using -// it. You should revoke a grant when you intend to actively deny operations -// that depend on it. The following are permitted to call this API: -// -// * The AWS account (root user) under which the grant was created -// -// * The RetiringPrincipal, if present in the grant -// -// * The GranteePrincipal, if RetireGrant is an operation specified in the -// grant -// -// You must identify the grant to retire by its grant token or by a combination -// of the grant ID and the Amazon Resource Name (ARN) of the customer master -// key (CMK). A grant token is a unique variable-length base64-encoded string. -// A grant ID is a 64 character unique identifier of a grant. The CreateGrant -// operation returns both. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation RetireGrant for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" -// The request was rejected because the specified grant token is not valid. -// -// * ErrCodeInvalidGrantIdException "InvalidGrantIdException" -// The request was rejected because the specified GrantId is not valid. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrant -func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error) { - req, out := c.RetireGrantRequest(input) - err := req.Send() - return out, err -} - -const opRevokeGrant = "RevokeGrant" - -// RevokeGrantRequest generates a "aws/request.Request" representing the -// client's request for the RevokeGrant operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RevokeGrant for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RevokeGrant method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RevokeGrantRequest method. -// req, resp := client.RevokeGrantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrant -func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, output *RevokeGrantOutput) { - op := &request.Operation{ - Name: opRevokeGrant, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeGrantInput{} - } - - output = &RevokeGrantOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RevokeGrant API operation for AWS Key Management Service. -// -// Revokes a grant. You can revoke a grant to actively deny operations that -// depend on 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 AWS Key Management Service's -// API operation RevokeGrant for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeInvalidGrantIdException "InvalidGrantIdException" -// The request was rejected because the specified GrantId is not valid. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrant -func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error) { - req, out := c.RevokeGrantRequest(input) - err := req.Send() - return out, err -} - -const opScheduleKeyDeletion = "ScheduleKeyDeletion" - -// ScheduleKeyDeletionRequest generates a "aws/request.Request" representing the -// client's request for the ScheduleKeyDeletion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ScheduleKeyDeletion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ScheduleKeyDeletion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ScheduleKeyDeletionRequest method. -// req, resp := client.ScheduleKeyDeletionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletion -func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *request.Request, output *ScheduleKeyDeletionOutput) { - op := &request.Operation{ - Name: opScheduleKeyDeletion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ScheduleKeyDeletionInput{} - } - - output = &ScheduleKeyDeletionOutput{} - req = c.newRequest(op, input, output) - return -} - -// ScheduleKeyDeletion API operation for AWS Key Management Service. -// -// Schedules the deletion of a customer master key (CMK). You may provide a -// waiting period, specified in days, before deletion occurs. If you do not -// provide a waiting period, the default period of 30 days is used. When this -// operation is successful, the state of the CMK changes to PendingDeletion. -// Before the waiting period ends, you can use CancelKeyDeletion to cancel the -// deletion of the CMK. After the waiting period ends, AWS KMS deletes the CMK -// and all AWS KMS data associated with it, including all aliases that refer -// to it. -// -// Deleting a CMK is a destructive and potentially dangerous operation. When -// a CMK is deleted, all data that was encrypted under the CMK is rendered unrecoverable. -// To restrict the use of a CMK without deleting it, use DisableKey. -// -// For more information about scheduling a CMK for deletion, see Deleting Customer -// Master Keys (http://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) -// in the AWS Key Management Service 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 AWS Key Management Service's -// API operation ScheduleKeyDeletion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletion -func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error) { - req, out := c.ScheduleKeyDeletionRequest(input) - err := req.Send() - return out, 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/kms-2014-11-01/TagResource -func (c *KMS) 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 AWS Key Management Service. -// -// Adds or overwrites one or more tags for the specified customer master key -// (CMK). -// -// Each tag consists of a tag key and a tag value. Tag keys and tag values are -// both required, but tag values can be empty (null) strings. -// -// You cannot use the same tag key more than once per CMK. For example, consider -// a CMK with one tag whose tag key is Purpose and tag value is Test. If you -// send a TagResource request for this CMK with a tag key of Purpose and a tag -// value of Prod, it does not create a second tag. Instead, the original tag -// is overwritten with the new tag 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 AWS Key Management Service's -// API operation TagResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because a limit was exceeded. For more information, -// see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeTagException "TagException" -// The request was rejected because one or more tags are not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/TagResource -func (c *KMS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - err := req.Send() - return out, err -} - -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/kms-2014-11-01/UntagResource -func (c *KMS) 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 AWS Key Management Service. -// -// Removes the specified tag or tags from the specified customer master key -// (CMK). -// -// To remove a tag, you specify the tag key for each tag to remove. You do not -// specify the tag value. To overwrite the tag value for an existing tag, use -// TagResource. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation UntagResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// * ErrCodeTagException "TagException" -// The request was rejected because one or more tags are not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UntagResource -func (c *KMS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAlias = "UpdateAlias" - -// UpdateAliasRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAliasRequest method. -// req, resp := client.UpdateAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAlias -func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) { - op := &request.Operation{ - Name: opUpdateAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAliasInput{} - } - - output = &UpdateAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateAlias API operation for AWS Key Management Service. -// -// Updates an alias to map it to a different key. -// -// An alias is not a property of a key. Therefore, an alias can be mapped to -// and unmapped from an existing key without changing the properties of the -// key. -// -// An alias name can contain only alphanumeric characters, forward slashes (/), -// underscores (_), and dashes (-). An alias must start with the word "alias" -// followed by a forward slash (alias/). An alias that begins with "aws" after -// the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS). -// -// The alias and the key it is mapped to must be in the same AWS account and -// the same 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 AWS Key Management Service's -// API operation UpdateAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAlias -func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) { - req, out := c.UpdateAliasRequest(input) - err := req.Send() - return out, err -} - -const opUpdateKeyDescription = "UpdateKeyDescription" - -// UpdateKeyDescriptionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateKeyDescription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateKeyDescription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateKeyDescription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateKeyDescriptionRequest method. -// req, resp := client.UpdateKeyDescriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescription -func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req *request.Request, output *UpdateKeyDescriptionOutput) { - op := &request.Operation{ - Name: opUpdateKeyDescription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateKeyDescriptionInput{} - } - - output = &UpdateKeyDescriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateKeyDescription API operation for AWS Key Management Service. -// -// Updates the description of a customer master key (CMK). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Key Management Service's -// API operation UpdateKeyDescription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" -// The request was rejected because the specified entity or resource could not -// be found. -// -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN was not valid. -// -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" -// The system timed out while trying to fulfill the request. The request can -// be retried. -// -// * ErrCodeInternalException "InternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. -// -// * ErrCodeInvalidStateException "InvalidStateException" -// The request was rejected because the state of the specified resource is not -// valid for this request. -// -// For more information about how key state affects the use of a CMK, see How -// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescription -func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error) { - req, out := c.UpdateKeyDescriptionRequest(input) - err := req.Send() - return out, err -} - -// Contains information about an alias. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/AliasListEntry -type AliasListEntry struct { - _ struct{} `type:"structure"` - - // String that contains the key ARN. - AliasArn *string `min:"20" type:"string"` - - // String that contains the alias. - AliasName *string `min:"1" type:"string"` - - // String that contains the key identifier referred to by the alias. - TargetKeyId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s AliasListEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AliasListEntry) GoString() string { - return s.String() -} - -// SetAliasArn sets the AliasArn field's value. -func (s *AliasListEntry) SetAliasArn(v string) *AliasListEntry { - s.AliasArn = &v - return s -} - -// SetAliasName sets the AliasName field's value. -func (s *AliasListEntry) SetAliasName(v string) *AliasListEntry { - s.AliasName = &v - return s -} - -// SetTargetKeyId sets the TargetKeyId field's value. -func (s *AliasListEntry) SetTargetKeyId(v string) *AliasListEntry { - s.TargetKeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletionRequest -type CancelKeyDeletionInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the customer master key (CMK) for which to cancel - // deletion. - // - // To specify this value, use the unique key ID or the Amazon Resource Name - // (ARN) of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To obtain the unique key ID and key ARN for a given CMK, use ListKeys or - // DescribeKey. - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelKeyDeletionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelKeyDeletionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelKeyDeletionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelKeyDeletionInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *CancelKeyDeletionInput) SetKeyId(v string) *CancelKeyDeletionInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletionResponse -type CancelKeyDeletionOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the master key for which deletion is canceled. - KeyId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CancelKeyDeletionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelKeyDeletionOutput) GoString() string { - return s.String() -} - -// SetKeyId sets the KeyId field's value. -func (s *CancelKeyDeletionOutput) SetKeyId(v string) *CancelKeyDeletionOutput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAliasRequest -type CreateAliasInput struct { - _ struct{} `type:"structure"` - - // String that contains the display name. The name must start with the word - // "alias" followed by a forward slash (alias/). Aliases that begin with "alias/AWS" - // are reserved. - // - // AliasName is a required field - AliasName *string `min:"1" type:"string" required:"true"` - - // An identifier of the key for which you are creating the alias. This value - // cannot be another alias but can be a globally unique identifier or a fully - // specified ARN to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // TargetKeyId is a required field - TargetKeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"} - if s.AliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AliasName")) - } - if s.AliasName != nil && len(*s.AliasName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) - } - if s.TargetKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("TargetKeyId")) - } - if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliasName sets the AliasName field's value. -func (s *CreateAliasInput) SetAliasName(v string) *CreateAliasInput { - s.AliasName = &v - return s -} - -// SetTargetKeyId sets the TargetKeyId field's value. -func (s *CreateAliasInput) SetTargetKeyId(v string) *CreateAliasInput { - s.TargetKeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAliasOutput -type CreateAliasOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateAliasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAliasOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrantRequest -type CreateGrantInput struct { - _ struct{} `type:"structure"` - - // The conditions under which the operations permitted by the grant are allowed. - // - // You can use this value to allow the operations permitted by the grant only - // when a specified encryption context is present. For more information, see - // Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html) - // in the AWS Key Management Service Developer Guide. - Constraints *GrantConstraints `type:"structure"` - - // A list of grant tokens. - // - // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) - // in the AWS Key Management Service Developer Guide. - GrantTokens []*string `type:"list"` - - // The principal that is given permission to perform the operations that the - // grant permits. - // - // To specify the principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM - // users, federated users, and assumed role users. For examples of the ARN syntax - // to use for specifying a principal, see AWS Identity and Access Management - // (IAM) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) - // in the Example ARNs section of the AWS General Reference. - // - // GranteePrincipal is a required field - GranteePrincipal *string `min:"1" type:"string" required:"true"` - - // The unique identifier for the customer master key (CMK) that the grant applies - // to. - // - // To specify this value, use the globally unique key ID or the Amazon Resource - // Name (ARN) of the key. Examples: - // - // * Globally unique key ID: 12345678-1234-1234-1234-123456789012 - // - // * Key ARN: arn:aws:kms:us-west-2:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // A friendly name for identifying the grant. Use this value to prevent unintended - // creation of duplicate grants when retrying this request. - // - // When this value is absent, all CreateGrant requests result in a new grant - // with a unique GrantId even if all the supplied parameters are identical. - // This can result in unintended duplicates when you retry the CreateGrant request. - // - // When this value is present, you can retry a CreateGrant request with identical - // parameters; if the grant already exists, the original GrantId is returned - // without creating a new grant. Note that the returned grant token is unique - // with every CreateGrant request, even when a duplicate GrantId is returned. - // All grant tokens obtained in this way can be used interchangeably. - Name *string `min:"1" type:"string"` - - // A list of operations that the grant permits. - Operations []*string `type:"list"` - - // The principal that is given permission to retire the grant by using RetireGrant - // operation. - // - // To specify the principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM - // users, federated users, and assumed role users. For examples of the ARN syntax - // to use for specifying a principal, see AWS Identity and Access Management - // (IAM) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) - // in the Example ARNs section of the AWS General Reference. - RetiringPrincipal *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateGrantInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGrantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGrantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGrantInput"} - if s.GranteePrincipal == nil { - invalidParams.Add(request.NewErrParamRequired("GranteePrincipal")) - } - if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1)) - } - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConstraints sets the Constraints field's value. -func (s *CreateGrantInput) SetConstraints(v *GrantConstraints) *CreateGrantInput { - s.Constraints = v - return s -} - -// SetGrantTokens sets the GrantTokens field's value. -func (s *CreateGrantInput) SetGrantTokens(v []*string) *CreateGrantInput { - s.GrantTokens = v - return s -} - -// SetGranteePrincipal sets the GranteePrincipal field's value. -func (s *CreateGrantInput) SetGranteePrincipal(v string) *CreateGrantInput { - s.GranteePrincipal = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *CreateGrantInput) SetKeyId(v string) *CreateGrantInput { - s.KeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateGrantInput) SetName(v string) *CreateGrantInput { - s.Name = &v - return s -} - -// SetOperations sets the Operations field's value. -func (s *CreateGrantInput) SetOperations(v []*string) *CreateGrantInput { - s.Operations = v - return s -} - -// SetRetiringPrincipal sets the RetiringPrincipal field's value. -func (s *CreateGrantInput) SetRetiringPrincipal(v string) *CreateGrantInput { - s.RetiringPrincipal = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrantResponse -type CreateGrantOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the grant. - // - // You can use the GrantId in a subsequent RetireGrant or RevokeGrant operation. - GrantId *string `min:"1" type:"string"` - - // The grant token. - // - // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) - // in the AWS Key Management Service Developer Guide. - GrantToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateGrantOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGrantOutput) GoString() string { - return s.String() -} - -// SetGrantId sets the GrantId field's value. -func (s *CreateGrantOutput) SetGrantId(v string) *CreateGrantOutput { - s.GrantId = &v - return s -} - -// SetGrantToken sets the GrantToken field's value. -func (s *CreateGrantOutput) SetGrantToken(v string) *CreateGrantOutput { - s.GrantToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKeyRequest -type CreateKeyInput struct { - _ struct{} `type:"structure"` - - // A flag to indicate whether to bypass the key policy lockout safety check. - // - // Setting this value to true increases the likelihood that the CMK becomes - // unmanageable. Do not set this value to true indiscriminately. - // - // For more information, refer to the scenario in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) - // section in the AWS Key Management Service Developer Guide. - // - // Use this parameter only when you include a policy in the request and you - // intend to prevent the principal that is making the request from making a - // subsequent PutKeyPolicy request on the CMK. - // - // The default value is false. - BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` - - // A description of the CMK. - // - // Use a description that helps you decide whether the CMK is appropriate for - // a task. - Description *string `type:"string"` - - // The intended use of the CMK. - // - // You can use CMKs only for symmetric encryption and decryption. - KeyUsage *string `type:"string" enum:"KeyUsageType"` - - // The source of the CMK's key material. - // - // The default is AWS_KMS, which means AWS KMS creates the key material. When - // this parameter is set to EXTERNAL, the request creates a CMK without key - // material so that you can import key material from your existing key management - // infrastructure. For more information about importing key material into AWS - // KMS, see Importing Key Material (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) - // in the AWS Key Management Service Developer Guide. - // - // The CMK's Origin is immutable and is set when the CMK is created. - Origin *string `type:"string" enum:"OriginType"` - - // The key policy to attach to the CMK. - // - // If you specify a policy and do not set BypassPolicyLockoutSafetyCheck to - // true, the policy must meet the following criteria: - // - // * It must allow the principal that is making the CreateKey request to - // make a subsequent PutKeyPolicy request on the CMK. This reduces the likelihood - // that the CMK becomes unmanageable. For more information, refer to the - // scenario in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) - // section in the AWS Key Management Service Developer Guide. - // - // * The principals that are specified in the key policy must exist and be - // visible to AWS KMS. When you create a new AWS principal (for example, - // an IAM user or role), you might need to enforce a delay before specifying - // the new principal in a key policy because the new principal might not - // immediately be visible to AWS KMS. For more information, see Changes that - // I make are not always immediately visible (http://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) - // in the IAM User Guide. - // - // If you do not specify a policy, AWS KMS attaches a default key policy to - // the CMK. For more information, see Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) - // in the AWS Key Management Service Developer Guide. - // - // The policy size limit is 32 KiB (32768 bytes). - Policy *string `min:"1" type:"string"` - - // One or more tags. Each tag consists of a tag key and a tag value. Tag keys - // and tag values are both required, but tag values can be empty (null) strings. - // - // Use this parameter to tag the CMK when it is created. Alternately, you can - // omit this parameter and instead tag the CMK after it is created using TagResource. - Tags []*Tag `type:"list"` -} - -// String returns the string representation -func (s CreateKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateKeyInput"} - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - 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 -} - -// SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. -func (s *CreateKeyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *CreateKeyInput { - s.BypassPolicyLockoutSafetyCheck = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateKeyInput) SetDescription(v string) *CreateKeyInput { - s.Description = &v - return s -} - -// SetKeyUsage sets the KeyUsage field's value. -func (s *CreateKeyInput) SetKeyUsage(v string) *CreateKeyInput { - s.KeyUsage = &v - return s -} - -// SetOrigin sets the Origin field's value. -func (s *CreateKeyInput) SetOrigin(v string) *CreateKeyInput { - s.Origin = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *CreateKeyInput) SetPolicy(v string) *CreateKeyInput { - s.Policy = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateKeyInput) SetTags(v []*Tag) *CreateKeyInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKeyResponse -type CreateKeyOutput struct { - _ struct{} `type:"structure"` - - // Metadata associated with the CMK. - KeyMetadata *KeyMetadata `type:"structure"` -} - -// String returns the string representation -func (s CreateKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateKeyOutput) GoString() string { - return s.String() -} - -// SetKeyMetadata sets the KeyMetadata field's value. -func (s *CreateKeyOutput) SetKeyMetadata(v *KeyMetadata) *CreateKeyOutput { - s.KeyMetadata = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DecryptRequest -type DecryptInput struct { - _ struct{} `type:"structure"` - - // Ciphertext to be decrypted. The blob includes metadata. - // - // CiphertextBlob is automatically base64 encoded/decoded by the SDK. - // - // CiphertextBlob is a required field - CiphertextBlob []byte `min:"1" type:"blob" required:"true"` - - // The encryption context. If this was specified in the Encrypt function, it - // must be specified here or the decryption operation will fail. For more information, - // see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html). - EncryptionContext map[string]*string `type:"map"` - - // A list of grant tokens. - // - // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) - // in the AWS Key Management Service Developer Guide. - GrantTokens []*string `type:"list"` -} - -// String returns the string representation -func (s DecryptInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DecryptInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DecryptInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DecryptInput"} - if s.CiphertextBlob == nil { - invalidParams.Add(request.NewErrParamRequired("CiphertextBlob")) - } - if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCiphertextBlob sets the CiphertextBlob field's value. -func (s *DecryptInput) SetCiphertextBlob(v []byte) *DecryptInput { - s.CiphertextBlob = v - return s -} - -// SetEncryptionContext sets the EncryptionContext field's value. -func (s *DecryptInput) SetEncryptionContext(v map[string]*string) *DecryptInput { - s.EncryptionContext = v - return s -} - -// SetGrantTokens sets the GrantTokens field's value. -func (s *DecryptInput) SetGrantTokens(v []*string) *DecryptInput { - s.GrantTokens = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DecryptResponse -type DecryptOutput struct { - _ struct{} `type:"structure"` - - // ARN of the key used to perform the decryption. This value is returned if - // no errors are encountered during the operation. - KeyId *string `min:"1" type:"string"` - - // Decrypted plaintext data. This value may not be returned if the customer - // master key is not available or if you didn't have permission to use it. - // - // Plaintext is automatically base64 encoded/decoded by the SDK. - Plaintext []byte `min:"1" type:"blob"` -} - -// String returns the string representation -func (s DecryptOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DecryptOutput) GoString() string { - return s.String() -} - -// SetKeyId sets the KeyId field's value. -func (s *DecryptOutput) SetKeyId(v string) *DecryptOutput { - s.KeyId = &v - return s -} - -// SetPlaintext sets the Plaintext field's value. -func (s *DecryptOutput) SetPlaintext(v []byte) *DecryptOutput { - s.Plaintext = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAliasRequest -type DeleteAliasInput struct { - _ struct{} `type:"structure"` - - // The alias to be deleted. The name must start with the word "alias" followed - // by a forward slash (alias/). Aliases that begin with "alias/AWS" are reserved. - // - // AliasName is a required field - AliasName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"} - if s.AliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AliasName")) - } - if s.AliasName != nil && len(*s.AliasName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliasName sets the AliasName field's value. -func (s *DeleteAliasInput) SetAliasName(v string) *DeleteAliasInput { - s.AliasName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAliasOutput -type DeleteAliasOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAliasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAliasOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterialRequest -type DeleteImportedKeyMaterialInput struct { - _ struct{} `type:"structure"` - - // The identifier of the CMK whose key material to delete. The CMK's Origin - // must be EXTERNAL. - // - // A valid identifier is the unique key ID or the Amazon Resource Name (ARN) - // of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteImportedKeyMaterialInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteImportedKeyMaterialInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteImportedKeyMaterialInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteImportedKeyMaterialInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *DeleteImportedKeyMaterialInput) SetKeyId(v string) *DeleteImportedKeyMaterialInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterialOutput -type DeleteImportedKeyMaterialOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteImportedKeyMaterialOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteImportedKeyMaterialOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKeyRequest -type DescribeKeyInput struct { - _ struct{} `type:"structure"` - - // A list of grant tokens. - // - // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) - // in the AWS Key Management Service Developer Guide. - GrantTokens []*string `type:"list"` - - // A unique identifier for the customer master key. This value can be a globally - // unique identifier, a fully specified ARN to either an alias or a key, or - // an alias name prefixed by "alias/". - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // * Alias Name Example - alias/MyAliasName - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeKeyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrantTokens sets the GrantTokens field's value. -func (s *DescribeKeyInput) SetGrantTokens(v []*string) *DescribeKeyInput { - s.GrantTokens = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *DescribeKeyInput) SetKeyId(v string) *DescribeKeyInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKeyResponse -type DescribeKeyOutput struct { - _ struct{} `type:"structure"` - - // Metadata associated with the key. - KeyMetadata *KeyMetadata `type:"structure"` -} - -// String returns the string representation -func (s DescribeKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeKeyOutput) GoString() string { - return s.String() -} - -// SetKeyMetadata sets the KeyMetadata field's value. -func (s *DescribeKeyOutput) SetKeyMetadata(v *KeyMetadata) *DescribeKeyOutput { - s.KeyMetadata = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRequest -type DisableKeyInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the CMK. - // - // Use the CMK's unique identifier or its Amazon Resource Name (ARN). For example: - // - // * Unique ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableKeyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *DisableKeyInput) SetKeyId(v string) *DisableKeyInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyOutput -type DisableKeyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableKeyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotationRequest -type DisableKeyRotationInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the customer master key. This value can be a globally - // unique identifier or the fully specified ARN to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableKeyRotationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableKeyRotationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableKeyRotationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableKeyRotationInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *DisableKeyRotationInput) SetKeyId(v string) *DisableKeyRotationInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotationOutput -type DisableKeyRotationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableKeyRotationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableKeyRotationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRequest -type EnableKeyInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the customer master key. This value can be a globally - // unique identifier or the fully specified ARN to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableKeyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *EnableKeyInput) SetKeyId(v string) *EnableKeyInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyOutput -type EnableKeyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableKeyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotationRequest -type EnableKeyRotationInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the customer master key. This value can be a globally - // unique identifier or the fully specified ARN to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableKeyRotationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableKeyRotationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableKeyRotationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableKeyRotationInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *EnableKeyRotationInput) SetKeyId(v string) *EnableKeyRotationInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotationOutput -type EnableKeyRotationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableKeyRotationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableKeyRotationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EncryptRequest -type EncryptInput struct { - _ struct{} `type:"structure"` - - // Name-value pair that specifies the encryption context to be used for authenticated - // encryption. If used here, the same value must be supplied to the Decrypt - // API or decryption will fail. For more information, see Encryption Context - // (http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html). - EncryptionContext map[string]*string `type:"map"` - - // A list of grant tokens. - // - // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) - // in the AWS Key Management Service Developer Guide. - GrantTokens []*string `type:"list"` - - // A unique identifier for the customer master key. This value can be a globally - // unique identifier, a fully specified ARN to either an alias or a key, or - // an alias name prefixed by "alias/". - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // * Alias Name Example - alias/MyAliasName - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // Data to be encrypted. - // - // Plaintext is automatically base64 encoded/decoded by the SDK. - // - // Plaintext is a required field - Plaintext []byte `min:"1" type:"blob" required:"true"` -} - -// String returns the string representation -func (s EncryptInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EncryptInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.Plaintext == nil { - invalidParams.Add(request.NewErrParamRequired("Plaintext")) - } - if s.Plaintext != nil && len(s.Plaintext) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Plaintext", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionContext sets the EncryptionContext field's value. -func (s *EncryptInput) SetEncryptionContext(v map[string]*string) *EncryptInput { - s.EncryptionContext = v - return s -} - -// SetGrantTokens sets the GrantTokens field's value. -func (s *EncryptInput) SetGrantTokens(v []*string) *EncryptInput { - s.GrantTokens = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *EncryptInput) SetKeyId(v string) *EncryptInput { - s.KeyId = &v - return s -} - -// SetPlaintext sets the Plaintext field's value. -func (s *EncryptInput) SetPlaintext(v []byte) *EncryptInput { - s.Plaintext = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EncryptResponse -type EncryptOutput struct { - _ struct{} `type:"structure"` - - // The encrypted plaintext. If you are using the CLI, the value is Base64 encoded. - // Otherwise, it is not encoded. - // - // CiphertextBlob is automatically base64 encoded/decoded by the SDK. - CiphertextBlob []byte `min:"1" type:"blob"` - - // The ID of the key used during encryption. - KeyId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EncryptOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EncryptOutput) GoString() string { - return s.String() -} - -// SetCiphertextBlob sets the CiphertextBlob field's value. -func (s *EncryptOutput) SetCiphertextBlob(v []byte) *EncryptOutput { - s.CiphertextBlob = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *EncryptOutput) SetKeyId(v string) *EncryptOutput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyRequest -type GenerateDataKeyInput struct { - _ struct{} `type:"structure"` - - // A set of key-value pairs that represents additional authenticated data. - // - // For more information, see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html) - // in the AWS Key Management Service Developer Guide. - EncryptionContext map[string]*string `type:"map"` - - // A list of grant tokens. - // - // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) - // in the AWS Key Management Service Developer Guide. - GrantTokens []*string `type:"list"` - - // The identifier of the CMK under which to generate and encrypt the data encryption - // key. - // - // A valid identifier is the unique key ID or the Amazon Resource Name (ARN) - // of the CMK, or the alias name or ARN of an alias that refers to the CMK. - // Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * CMK ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Alias name: alias/ExampleAlias - // - // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // The length of the data encryption key. Use AES_128 to generate a 128-bit - // symmetric key, or AES_256 to generate a 256-bit symmetric key. - KeySpec *string `type:"string" enum:"DataKeySpec"` - - // The length of the data encryption key in bytes. For example, use the value - // 64 to generate a 512-bit data key (64 bytes is 512 bits). For common key - // lengths (128-bit and 256-bit symmetric keys), we recommend that you use the - // KeySpec field instead of this one. - NumberOfBytes *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s GenerateDataKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateDataKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GenerateDataKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { - invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionContext sets the EncryptionContext field's value. -func (s *GenerateDataKeyInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyInput { - s.EncryptionContext = v - return s -} - -// SetGrantTokens sets the GrantTokens field's value. -func (s *GenerateDataKeyInput) SetGrantTokens(v []*string) *GenerateDataKeyInput { - s.GrantTokens = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *GenerateDataKeyInput) SetKeyId(v string) *GenerateDataKeyInput { - s.KeyId = &v - return s -} - -// SetKeySpec sets the KeySpec field's value. -func (s *GenerateDataKeyInput) SetKeySpec(v string) *GenerateDataKeyInput { - s.KeySpec = &v - return s -} - -// SetNumberOfBytes sets the NumberOfBytes field's value. -func (s *GenerateDataKeyInput) SetNumberOfBytes(v int64) *GenerateDataKeyInput { - s.NumberOfBytes = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyResponse -type GenerateDataKeyOutput struct { - _ struct{} `type:"structure"` - - // The encrypted data encryption key. - // - // CiphertextBlob is automatically base64 encoded/decoded by the SDK. - CiphertextBlob []byte `min:"1" type:"blob"` - - // The identifier of the CMK under which the data encryption key was generated - // and encrypted. - KeyId *string `min:"1" type:"string"` - - // The data encryption key. Use this data key for local encryption and decryption, - // then remove it from memory as soon as possible. - // - // Plaintext is automatically base64 encoded/decoded by the SDK. - Plaintext []byte `min:"1" type:"blob"` -} - -// String returns the string representation -func (s GenerateDataKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateDataKeyOutput) GoString() string { - return s.String() -} - -// SetCiphertextBlob sets the CiphertextBlob field's value. -func (s *GenerateDataKeyOutput) SetCiphertextBlob(v []byte) *GenerateDataKeyOutput { - s.CiphertextBlob = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *GenerateDataKeyOutput) SetKeyId(v string) *GenerateDataKeyOutput { - s.KeyId = &v - return s -} - -// SetPlaintext sets the Plaintext field's value. -func (s *GenerateDataKeyOutput) SetPlaintext(v []byte) *GenerateDataKeyOutput { - s.Plaintext = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintextRequest -type GenerateDataKeyWithoutPlaintextInput struct { - _ struct{} `type:"structure"` - - // A set of key-value pairs that represents additional authenticated data. - // - // For more information, see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html) - // in the AWS Key Management Service Developer Guide. - EncryptionContext map[string]*string `type:"map"` - - // A list of grant tokens. - // - // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) - // in the AWS Key Management Service Developer Guide. - GrantTokens []*string `type:"list"` - - // The identifier of the CMK under which to generate and encrypt the data encryption - // key. - // - // A valid identifier is the unique key ID or the Amazon Resource Name (ARN) - // of the CMK, or the alias name or ARN of an alias that refers to the CMK. - // Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * CMK ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Alias name: alias/ExampleAlias - // - // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // The length of the data encryption key. Use AES_128 to generate a 128-bit - // symmetric key, or AES_256 to generate a 256-bit symmetric key. - KeySpec *string `type:"string" enum:"DataKeySpec"` - - // The length of the data encryption key in bytes. For example, use the value - // 64 to generate a 512-bit data key (64 bytes is 512 bits). For common key - // lengths (128-bit and 256-bit symmetric keys), we recommend that you use the - // KeySpec field instead of this one. - NumberOfBytes *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s GenerateDataKeyWithoutPlaintextInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateDataKeyWithoutPlaintextInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GenerateDataKeyWithoutPlaintextInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyWithoutPlaintextInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { - invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionContext sets the EncryptionContext field's value. -func (s *GenerateDataKeyWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyWithoutPlaintextInput { - s.EncryptionContext = v - return s -} - -// SetGrantTokens sets the GrantTokens field's value. -func (s *GenerateDataKeyWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyWithoutPlaintextInput { - s.GrantTokens = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *GenerateDataKeyWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextInput { - s.KeyId = &v - return s -} - -// SetKeySpec sets the KeySpec field's value. -func (s *GenerateDataKeyWithoutPlaintextInput) SetKeySpec(v string) *GenerateDataKeyWithoutPlaintextInput { - s.KeySpec = &v - return s -} - -// SetNumberOfBytes sets the NumberOfBytes field's value. -func (s *GenerateDataKeyWithoutPlaintextInput) SetNumberOfBytes(v int64) *GenerateDataKeyWithoutPlaintextInput { - s.NumberOfBytes = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintextResponse -type GenerateDataKeyWithoutPlaintextOutput struct { - _ struct{} `type:"structure"` - - // The encrypted data encryption key. - // - // CiphertextBlob is automatically base64 encoded/decoded by the SDK. - CiphertextBlob []byte `min:"1" type:"blob"` - - // The identifier of the CMK under which the data encryption key was generated - // and encrypted. - KeyId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GenerateDataKeyWithoutPlaintextOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string { - return s.String() -} - -// SetCiphertextBlob sets the CiphertextBlob field's value. -func (s *GenerateDataKeyWithoutPlaintextOutput) SetCiphertextBlob(v []byte) *GenerateDataKeyWithoutPlaintextOutput { - s.CiphertextBlob = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *GenerateDataKeyWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextOutput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandomRequest -type GenerateRandomInput struct { - _ struct{} `type:"structure"` - - // The length of the byte string. - NumberOfBytes *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s GenerateRandomInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateRandomInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GenerateRandomInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GenerateRandomInput"} - if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { - invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNumberOfBytes sets the NumberOfBytes field's value. -func (s *GenerateRandomInput) SetNumberOfBytes(v int64) *GenerateRandomInput { - s.NumberOfBytes = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandomResponse -type GenerateRandomOutput struct { - _ struct{} `type:"structure"` - - // The unpredictable byte string. - // - // Plaintext is automatically base64 encoded/decoded by the SDK. - Plaintext []byte `min:"1" type:"blob"` -} - -// String returns the string representation -func (s GenerateRandomOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GenerateRandomOutput) GoString() string { - return s.String() -} - -// SetPlaintext sets the Plaintext field's value. -func (s *GenerateRandomOutput) SetPlaintext(v []byte) *GenerateRandomOutput { - s.Plaintext = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicyRequest -type GetKeyPolicyInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the customer master key. This value can be a globally - // unique identifier or the fully specified ARN to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // String that contains the name of the policy. Currently, this must be "default". - // Policy names can be discovered by calling ListKeyPolicies. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetKeyPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetKeyPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetKeyPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetKeyPolicyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *GetKeyPolicyInput) SetKeyId(v string) *GetKeyPolicyInput { - s.KeyId = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *GetKeyPolicyInput) SetPolicyName(v string) *GetKeyPolicyInput { - s.PolicyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicyResponse -type GetKeyPolicyOutput struct { - _ struct{} `type:"structure"` - - // A policy document in JSON format. - Policy *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetKeyPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetKeyPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetKeyPolicyOutput) SetPolicy(v string) *GetKeyPolicyOutput { - s.Policy = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatusRequest -type GetKeyRotationStatusInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the customer master key. This value can be a globally - // unique identifier or the fully specified ARN to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetKeyRotationStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetKeyRotationStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetKeyRotationStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetKeyRotationStatusInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *GetKeyRotationStatusInput) SetKeyId(v string) *GetKeyRotationStatusInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatusResponse -type GetKeyRotationStatusOutput struct { - _ struct{} `type:"structure"` - - // A Boolean value that specifies whether key rotation is enabled. - KeyRotationEnabled *bool `type:"boolean"` -} - -// String returns the string representation -func (s GetKeyRotationStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetKeyRotationStatusOutput) GoString() string { - return s.String() -} - -// SetKeyRotationEnabled sets the KeyRotationEnabled field's value. -func (s *GetKeyRotationStatusOutput) SetKeyRotationEnabled(v bool) *GetKeyRotationStatusOutput { - s.KeyRotationEnabled = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImportRequest -type GetParametersForImportInput struct { - _ struct{} `type:"structure"` - - // The identifier of the CMK into which you will import key material. The CMK's - // Origin must be EXTERNAL. - // - // A valid identifier is the unique key ID or the Amazon Resource Name (ARN) - // of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // The algorithm you will use to encrypt the key material before importing it - // with ImportKeyMaterial. For more information, see Encrypt the Key Material - // (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-encrypt-key-material.html) - // in the AWS Key Management Service Developer Guide. - // - // WrappingAlgorithm is a required field - WrappingAlgorithm *string `type:"string" required:"true" enum:"AlgorithmSpec"` - - // The type of wrapping key (public key) to return in the response. Only 2048-bit - // RSA public keys are supported. - // - // WrappingKeySpec is a required field - WrappingKeySpec *string `type:"string" required:"true" enum:"WrappingKeySpec"` -} - -// String returns the string representation -func (s GetParametersForImportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetParametersForImportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetParametersForImportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetParametersForImportInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.WrappingAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("WrappingAlgorithm")) - } - if s.WrappingKeySpec == nil { - invalidParams.Add(request.NewErrParamRequired("WrappingKeySpec")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *GetParametersForImportInput) SetKeyId(v string) *GetParametersForImportInput { - s.KeyId = &v - return s -} - -// SetWrappingAlgorithm sets the WrappingAlgorithm field's value. -func (s *GetParametersForImportInput) SetWrappingAlgorithm(v string) *GetParametersForImportInput { - s.WrappingAlgorithm = &v - return s -} - -// SetWrappingKeySpec sets the WrappingKeySpec field's value. -func (s *GetParametersForImportInput) SetWrappingKeySpec(v string) *GetParametersForImportInput { - s.WrappingKeySpec = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImportResponse -type GetParametersForImportOutput struct { - _ struct{} `type:"structure"` - - // The import token to send in a subsequent ImportKeyMaterial request. - // - // ImportToken is automatically base64 encoded/decoded by the SDK. - ImportToken []byte `min:"1" type:"blob"` - - // The identifier of the CMK to use in a subsequent ImportKeyMaterial request. - // This is the same CMK specified in the GetParametersForImport request. - KeyId *string `min:"1" type:"string"` - - // The time at which the import token and public key are no longer valid. After - // this time, you cannot use them to make an ImportKeyMaterial request and you - // must send another GetParametersForImport request to retrieve new ones. - ParametersValidTo *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The public key to use to encrypt the key material before importing it with - // ImportKeyMaterial. - // - // PublicKey is automatically base64 encoded/decoded by the SDK. - PublicKey []byte `min:"1" type:"blob"` -} - -// String returns the string representation -func (s GetParametersForImportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetParametersForImportOutput) GoString() string { - return s.String() -} - -// SetImportToken sets the ImportToken field's value. -func (s *GetParametersForImportOutput) SetImportToken(v []byte) *GetParametersForImportOutput { - s.ImportToken = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *GetParametersForImportOutput) SetKeyId(v string) *GetParametersForImportOutput { - s.KeyId = &v - return s -} - -// SetParametersValidTo sets the ParametersValidTo field's value. -func (s *GetParametersForImportOutput) SetParametersValidTo(v time.Time) *GetParametersForImportOutput { - s.ParametersValidTo = &v - return s -} - -// SetPublicKey sets the PublicKey field's value. -func (s *GetParametersForImportOutput) SetPublicKey(v []byte) *GetParametersForImportOutput { - s.PublicKey = v - return s -} - -// A structure for specifying the conditions under which the operations permitted -// by the grant are allowed. -// -// You can use this structure to allow the operations permitted by the grant -// only when a specified encryption context is present. For more information -// about encryption context, see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html) -// in the AWS Key Management Service Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GrantConstraints -type GrantConstraints struct { - _ struct{} `type:"structure"` - - // Contains a list of key-value pairs that must be present in the encryption - // context of a subsequent operation permitted by the grant. When a subsequent - // operation permitted by the grant includes an encryption context that matches - // this list, the grant allows the operation. Otherwise, the operation is not - // allowed. - EncryptionContextEquals map[string]*string `type:"map"` - - // Contains a list of key-value pairs, a subset of which must be present in - // the encryption context of a subsequent operation permitted by the grant. - // When a subsequent operation permitted by the grant includes an encryption - // context that matches this list or is a subset of this list, the grant allows - // the operation. Otherwise, the operation is not allowed. - EncryptionContextSubset map[string]*string `type:"map"` -} - -// String returns the string representation -func (s GrantConstraints) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GrantConstraints) GoString() string { - return s.String() -} - -// SetEncryptionContextEquals sets the EncryptionContextEquals field's value. -func (s *GrantConstraints) SetEncryptionContextEquals(v map[string]*string) *GrantConstraints { - s.EncryptionContextEquals = v - return s -} - -// SetEncryptionContextSubset sets the EncryptionContextSubset field's value. -func (s *GrantConstraints) SetEncryptionContextSubset(v map[string]*string) *GrantConstraints { - s.EncryptionContextSubset = v - return s -} - -// Contains information about an entry in a list of grants. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GrantListEntry -type GrantListEntry struct { - _ struct{} `type:"structure"` - - // The conditions under which the grant's operations are allowed. - Constraints *GrantConstraints `type:"structure"` - - // The date and time when the grant was created. - CreationDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The unique identifier for the grant. - GrantId *string `min:"1" type:"string"` - - // The principal that receives the grant's permissions. - GranteePrincipal *string `min:"1" type:"string"` - - // The AWS account under which the grant was issued. - IssuingAccount *string `min:"1" type:"string"` - - // The unique identifier for the customer master key (CMK) to which the grant - // applies. - KeyId *string `min:"1" type:"string"` - - // The friendly name that identifies the grant. If a name was provided in the - // CreateGrant request, that name is returned. Otherwise this value is null. - Name *string `min:"1" type:"string"` - - // The list of operations permitted by the grant. - Operations []*string `type:"list"` - - // The principal that can retire the grant. - RetiringPrincipal *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GrantListEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GrantListEntry) GoString() string { - return s.String() -} - -// SetConstraints sets the Constraints field's value. -func (s *GrantListEntry) SetConstraints(v *GrantConstraints) *GrantListEntry { - s.Constraints = v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *GrantListEntry) SetCreationDate(v time.Time) *GrantListEntry { - s.CreationDate = &v - return s -} - -// SetGrantId sets the GrantId field's value. -func (s *GrantListEntry) SetGrantId(v string) *GrantListEntry { - s.GrantId = &v - return s -} - -// SetGranteePrincipal sets the GranteePrincipal field's value. -func (s *GrantListEntry) SetGranteePrincipal(v string) *GrantListEntry { - s.GranteePrincipal = &v - return s -} - -// SetIssuingAccount sets the IssuingAccount field's value. -func (s *GrantListEntry) SetIssuingAccount(v string) *GrantListEntry { - s.IssuingAccount = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *GrantListEntry) SetKeyId(v string) *GrantListEntry { - s.KeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *GrantListEntry) SetName(v string) *GrantListEntry { - s.Name = &v - return s -} - -// SetOperations sets the Operations field's value. -func (s *GrantListEntry) SetOperations(v []*string) *GrantListEntry { - s.Operations = v - return s -} - -// SetRetiringPrincipal sets the RetiringPrincipal field's value. -func (s *GrantListEntry) SetRetiringPrincipal(v string) *GrantListEntry { - s.RetiringPrincipal = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterialRequest -type ImportKeyMaterialInput struct { - _ struct{} `type:"structure"` - - // The encrypted key material to import. It must be encrypted with the public - // key that you received in the response to a previous GetParametersForImport - // request, using the wrapping algorithm that you specified in that request. - // - // EncryptedKeyMaterial is automatically base64 encoded/decoded by the SDK. - // - // EncryptedKeyMaterial is a required field - EncryptedKeyMaterial []byte `min:"1" type:"blob" required:"true"` - - // Specifies whether the key material expires. The default is KEY_MATERIAL_EXPIRES, - // in which case you must include the ValidTo parameter. When this parameter - // is set to KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the ValidTo parameter. - ExpirationModel *string `type:"string" enum:"ExpirationModelType"` - - // The import token that you received in the response to a previous GetParametersForImport - // request. It must be from the same response that contained the public key - // that you used to encrypt the key material. - // - // ImportToken is automatically base64 encoded/decoded by the SDK. - // - // ImportToken is a required field - ImportToken []byte `min:"1" type:"blob" required:"true"` - - // The identifier of the CMK to import the key material into. The CMK's Origin - // must be EXTERNAL. - // - // A valid identifier is the unique key ID or the Amazon Resource Name (ARN) - // of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // The time at which the imported key material expires. When the key material - // expires, AWS KMS deletes the key material and the CMK becomes unusable. You - // must omit this parameter when the ExpirationModel parameter is set to KEY_MATERIAL_DOES_NOT_EXPIRE. - // Otherwise it is required. - ValidTo *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s ImportKeyMaterialInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportKeyMaterialInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportKeyMaterialInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportKeyMaterialInput"} - if s.EncryptedKeyMaterial == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptedKeyMaterial")) - } - if s.EncryptedKeyMaterial != nil && len(s.EncryptedKeyMaterial) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EncryptedKeyMaterial", 1)) - } - if s.ImportToken == nil { - invalidParams.Add(request.NewErrParamRequired("ImportToken")) - } - if s.ImportToken != nil && len(s.ImportToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImportToken", 1)) - } - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptedKeyMaterial sets the EncryptedKeyMaterial field's value. -func (s *ImportKeyMaterialInput) SetEncryptedKeyMaterial(v []byte) *ImportKeyMaterialInput { - s.EncryptedKeyMaterial = v - return s -} - -// SetExpirationModel sets the ExpirationModel field's value. -func (s *ImportKeyMaterialInput) SetExpirationModel(v string) *ImportKeyMaterialInput { - s.ExpirationModel = &v - return s -} - -// SetImportToken sets the ImportToken field's value. -func (s *ImportKeyMaterialInput) SetImportToken(v []byte) *ImportKeyMaterialInput { - s.ImportToken = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *ImportKeyMaterialInput) SetKeyId(v string) *ImportKeyMaterialInput { - s.KeyId = &v - return s -} - -// SetValidTo sets the ValidTo field's value. -func (s *ImportKeyMaterialInput) SetValidTo(v time.Time) *ImportKeyMaterialInput { - s.ValidTo = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterialResponse -type ImportKeyMaterialOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ImportKeyMaterialOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportKeyMaterialOutput) GoString() string { - return s.String() -} - -// Contains information about each entry in the key list. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/KeyListEntry -type KeyListEntry struct { - _ struct{} `type:"structure"` - - // ARN of the key. - KeyArn *string `min:"20" type:"string"` - - // Unique identifier of the key. - KeyId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s KeyListEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyListEntry) GoString() string { - return s.String() -} - -// SetKeyArn sets the KeyArn field's value. -func (s *KeyListEntry) SetKeyArn(v string) *KeyListEntry { - s.KeyArn = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *KeyListEntry) SetKeyId(v string) *KeyListEntry { - s.KeyId = &v - return s -} - -// Contains metadata about a customer master key (CMK). -// -// This data type is used as a response element for the CreateKey and DescribeKey -// operations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/KeyMetadata -type KeyMetadata struct { - _ struct{} `type:"structure"` - - // The twelve-digit account ID of the AWS account that owns the CMK. - AWSAccountId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management - // Service (AWS KMS) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms) - // in the Example ARNs section of the AWS General Reference. - Arn *string `min:"20" type:"string"` - - // The date and time when the CMK was created. - CreationDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time after which AWS KMS deletes the CMK. This value is present - // only when KeyState is PendingDeletion, otherwise this value is omitted. - DeletionDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The description of the CMK. - Description *string `type:"string"` - - // Specifies whether the CMK is enabled. When KeyState is Enabled this value - // is true, otherwise it is false. - Enabled *bool `type:"boolean"` - - // Specifies whether the CMK's key material expires. This value is present only - // when Origin is EXTERNAL, otherwise this value is omitted. - ExpirationModel *string `type:"string" enum:"ExpirationModelType"` - - // The globally unique identifier for the CMK. - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // The state of the CMK. - // - // For more information about how key state affects the use of a CMK, see How - // Key State Affects the Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) - // in the AWS Key Management Service Developer Guide. - KeyState *string `type:"string" enum:"KeyState"` - - // The cryptographic operations for which you can use the CMK. Currently the - // only allowed value is ENCRYPT_DECRYPT, which means you can use the CMK for - // the Encrypt and Decrypt operations. - KeyUsage *string `type:"string" enum:"KeyUsageType"` - - // The source of the CMK's key material. When this value is AWS_KMS, AWS KMS - // created the key material. When this value is EXTERNAL, the key material was - // imported from your existing key management infrastructure or the CMK lacks - // key material. - Origin *string `type:"string" enum:"OriginType"` - - // The time at which the imported key material expires. When the key material - // expires, AWS KMS deletes the key material and the CMK becomes unusable. This - // value is present only for CMKs whose Origin is EXTERNAL and whose ExpirationModel - // is KEY_MATERIAL_EXPIRES, otherwise this value is omitted. - ValidTo *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s KeyMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyMetadata) GoString() string { - return s.String() -} - -// SetAWSAccountId sets the AWSAccountId field's value. -func (s *KeyMetadata) SetAWSAccountId(v string) *KeyMetadata { - s.AWSAccountId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *KeyMetadata) SetArn(v string) *KeyMetadata { - s.Arn = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *KeyMetadata) SetCreationDate(v time.Time) *KeyMetadata { - s.CreationDate = &v - return s -} - -// SetDeletionDate sets the DeletionDate field's value. -func (s *KeyMetadata) SetDeletionDate(v time.Time) *KeyMetadata { - s.DeletionDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *KeyMetadata) SetDescription(v string) *KeyMetadata { - s.Description = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *KeyMetadata) SetEnabled(v bool) *KeyMetadata { - s.Enabled = &v - return s -} - -// SetExpirationModel sets the ExpirationModel field's value. -func (s *KeyMetadata) SetExpirationModel(v string) *KeyMetadata { - s.ExpirationModel = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *KeyMetadata) SetKeyId(v string) *KeyMetadata { - s.KeyId = &v - return s -} - -// SetKeyState sets the KeyState field's value. -func (s *KeyMetadata) SetKeyState(v string) *KeyMetadata { - s.KeyState = &v - return s -} - -// SetKeyUsage sets the KeyUsage field's value. -func (s *KeyMetadata) SetKeyUsage(v string) *KeyMetadata { - s.KeyUsage = &v - return s -} - -// SetOrigin sets the Origin field's value. -func (s *KeyMetadata) SetOrigin(v string) *KeyMetadata { - s.Origin = &v - return s -} - -// SetValidTo sets the ValidTo field's value. -func (s *KeyMetadata) SetValidTo(v time.Time) *KeyMetadata { - s.ValidTo = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliasesRequest -type ListAliasesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, AWS KMS does not return more than the specified number - // of items, but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and - // 100, inclusive. If you do not include a value, it defaults to 50. - Limit *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextMarker from the truncated response - // you just received. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListAliasesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAliasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAliasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListAliasesInput) SetLimit(v int64) *ListAliasesInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListAliasesInput) SetMarker(v string) *ListAliasesInput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliasesResponse -type ListAliasesOutput struct { - _ struct{} `type:"structure"` - - // A list of key aliases in the user's account. - Aliases []*AliasListEntry `type:"list"` - - // When Truncated is true, this element is present and contains the value to - // use for the Marker parameter in a subsequent request. - NextMarker *string `min:"1" type:"string"` - - // A flag that indicates whether there are more items in the list. When this - // value is true, the list in this response is truncated. To retrieve more items, - // pass the value of the NextMarker element in this response to the Marker parameter - // in a subsequent request. - Truncated *bool `type:"boolean"` -} - -// String returns the string representation -func (s ListAliasesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAliasesOutput) GoString() string { - return s.String() -} - -// SetAliases sets the Aliases field's value. -func (s *ListAliasesOutput) SetAliases(v []*AliasListEntry) *ListAliasesOutput { - s.Aliases = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListAliasesOutput) SetNextMarker(v string) *ListAliasesOutput { - s.NextMarker = &v - return s -} - -// SetTruncated sets the Truncated field's value. -func (s *ListAliasesOutput) SetTruncated(v bool) *ListAliasesOutput { - s.Truncated = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrantsRequest -type ListGrantsInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the customer master key. This value can be a globally - // unique identifier or the fully specified ARN to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, AWS KMS does not return more than the specified number - // of items, but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and - // 100, inclusive. If you do not include a value, it defaults to 50. - Limit *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextMarker from the truncated response - // you just received. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListGrantsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGrantsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGrantsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGrantsInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *ListGrantsInput) SetKeyId(v string) *ListGrantsInput { - s.KeyId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListGrantsInput) SetLimit(v int64) *ListGrantsInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListGrantsInput) SetMarker(v string) *ListGrantsInput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrantsResponse -type ListGrantsResponse struct { - _ struct{} `type:"structure"` - - // A list of grants. - Grants []*GrantListEntry `type:"list"` - - // When Truncated is true, this element is present and contains the value to - // use for the Marker parameter in a subsequent request. - NextMarker *string `min:"1" type:"string"` - - // A flag that indicates whether there are more items in the list. When this - // value is true, the list in this response is truncated. To retrieve more items, - // pass the value of the NextMarker element in this response to the Marker parameter - // in a subsequent request. - Truncated *bool `type:"boolean"` -} - -// String returns the string representation -func (s ListGrantsResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGrantsResponse) GoString() string { - return s.String() -} - -// SetGrants sets the Grants field's value. -func (s *ListGrantsResponse) SetGrants(v []*GrantListEntry) *ListGrantsResponse { - s.Grants = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListGrantsResponse) SetNextMarker(v string) *ListGrantsResponse { - s.NextMarker = &v - return s -} - -// SetTruncated sets the Truncated field's value. -func (s *ListGrantsResponse) SetTruncated(v bool) *ListGrantsResponse { - s.Truncated = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPoliciesRequest -type ListKeyPoliciesInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the customer master key (CMK). You can use the unique - // key ID or the Amazon Resource Name (ARN) of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, AWS KMS does not return more than the specified number - // of items, but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and - // 1000, inclusive. If you do not include a value, it defaults to 100. - // - // Currently only 1 policy can be attached to a key. - Limit *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextMarker from the truncated response - // you just received. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListKeyPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListKeyPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListKeyPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListKeyPoliciesInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *ListKeyPoliciesInput) SetKeyId(v string) *ListKeyPoliciesInput { - s.KeyId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListKeyPoliciesInput) SetLimit(v int64) *ListKeyPoliciesInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListKeyPoliciesInput) SetMarker(v string) *ListKeyPoliciesInput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPoliciesResponse -type ListKeyPoliciesOutput struct { - _ struct{} `type:"structure"` - - // When Truncated is true, this element is present and contains the value to - // use for the Marker parameter in a subsequent request. - NextMarker *string `min:"1" type:"string"` - - // A list of policy names. Currently, there is only one policy and it is named - // "Default". - PolicyNames []*string `type:"list"` - - // A flag that indicates whether there are more items in the list. When this - // value is true, the list in this response is truncated. To retrieve more items, - // pass the value of the NextMarker element in this response to the Marker parameter - // in a subsequent request. - Truncated *bool `type:"boolean"` -} - -// String returns the string representation -func (s ListKeyPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListKeyPoliciesOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListKeyPoliciesOutput) SetNextMarker(v string) *ListKeyPoliciesOutput { - s.NextMarker = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *ListKeyPoliciesOutput) SetPolicyNames(v []*string) *ListKeyPoliciesOutput { - s.PolicyNames = v - return s -} - -// SetTruncated sets the Truncated field's value. -func (s *ListKeyPoliciesOutput) SetTruncated(v bool) *ListKeyPoliciesOutput { - s.Truncated = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeysRequest -type ListKeysInput struct { - _ struct{} `type:"structure"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, AWS KMS does not return more than the specified number - // of items, but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and - // 1000, inclusive. If you do not include a value, it defaults to 100. - Limit *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextMarker from the truncated response - // you just received. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListKeysInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListKeysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListKeysInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListKeysInput) SetLimit(v int64) *ListKeysInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListKeysInput) SetMarker(v string) *ListKeysInput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeysResponse -type ListKeysOutput struct { - _ struct{} `type:"structure"` - - // A list of keys. - Keys []*KeyListEntry `type:"list"` - - // When Truncated is true, this element is present and contains the value to - // use for the Marker parameter in a subsequent request. - NextMarker *string `min:"1" type:"string"` - - // A flag that indicates whether there are more items in the list. When this - // value is true, the list in this response is truncated. To retrieve more items, - // pass the value of the NextMarker element in this response to the Marker parameter - // in a subsequent request. - Truncated *bool `type:"boolean"` -} - -// String returns the string representation -func (s ListKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListKeysOutput) GoString() string { - return s.String() -} - -// SetKeys sets the Keys field's value. -func (s *ListKeysOutput) SetKeys(v []*KeyListEntry) *ListKeysOutput { - s.Keys = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListKeysOutput) SetNextMarker(v string) *ListKeysOutput { - s.NextMarker = &v - return s -} - -// SetTruncated sets the Truncated field's value. -func (s *ListKeysOutput) SetTruncated(v bool) *ListKeysOutput { - s.Truncated = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTagsRequest -type ListResourceTagsInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the CMK whose tags you are listing. You can use the - // unique key ID or the Amazon Resource Name (ARN) of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, AWS KMS does not return more than the specified number - // of items, but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and - // 50, inclusive. If you do not include a value, it defaults to 50. - Limit *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextMarker from the truncated response - // you just received. - // - // Do not attempt to construct this value. Use only the value of NextMarker - // from the truncated response you just received. - Marker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListResourceTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListResourceTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListResourceTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListResourceTagsInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *ListResourceTagsInput) SetKeyId(v string) *ListResourceTagsInput { - s.KeyId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListResourceTagsInput) SetLimit(v int64) *ListResourceTagsInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListResourceTagsInput) SetMarker(v string) *ListResourceTagsInput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTagsResponse -type ListResourceTagsOutput struct { - _ struct{} `type:"structure"` - - // When Truncated is true, this element is present and contains the value to - // use for the Marker parameter in a subsequent request. - // - // Do not assume or infer any information from this value. - NextMarker *string `min:"1" type:"string"` - - // A list of tags. Each tag consists of a tag key and a tag value. - Tags []*Tag `type:"list"` - - // A flag that indicates whether there are more items in the list. When this - // value is true, the list in this response is truncated. To retrieve more items, - // pass the value of the NextMarker element in this response to the Marker parameter - // in a subsequent request. - Truncated *bool `type:"boolean"` -} - -// String returns the string representation -func (s ListResourceTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListResourceTagsOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListResourceTagsOutput) SetNextMarker(v string) *ListResourceTagsOutput { - s.NextMarker = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListResourceTagsOutput) SetTags(v []*Tag) *ListResourceTagsOutput { - s.Tags = v - return s -} - -// SetTruncated sets the Truncated field's value. -func (s *ListResourceTagsOutput) SetTruncated(v bool) *ListResourceTagsOutput { - s.Truncated = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListRetirableGrantsRequest -type ListRetirableGrantsInput struct { - _ struct{} `type:"structure"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, AWS KMS does not return more than the specified number - // of items, but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and - // 100, inclusive. If you do not include a value, it defaults to 50. - Limit *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextMarker from the truncated response - // you just received. - Marker *string `min:"1" type:"string"` - - // The retiring principal for which to list grants. - // - // To specify the retiring principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM - // users, federated users, and assumed role users. For examples of the ARN syntax - // for specifying a principal, see AWS Identity and Access Management (IAM) - // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) - // in the Example ARNs section of the Amazon Web Services General Reference. - // - // RetiringPrincipal is a required field - RetiringPrincipal *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListRetirableGrantsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRetirableGrantsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRetirableGrantsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRetirableGrantsInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.Marker != nil && len(*s.Marker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) - } - if s.RetiringPrincipal == nil { - invalidParams.Add(request.NewErrParamRequired("RetiringPrincipal")) - } - if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListRetirableGrantsInput) SetLimit(v int64) *ListRetirableGrantsInput { - s.Limit = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListRetirableGrantsInput) SetMarker(v string) *ListRetirableGrantsInput { - s.Marker = &v - return s -} - -// SetRetiringPrincipal sets the RetiringPrincipal field's value. -func (s *ListRetirableGrantsInput) SetRetiringPrincipal(v string) *ListRetirableGrantsInput { - s.RetiringPrincipal = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicyRequest -type PutKeyPolicyInput struct { - _ struct{} `type:"structure"` - - // A flag to indicate whether to bypass the key policy lockout safety check. - // - // Setting this value to true increases the likelihood that the CMK becomes - // unmanageable. Do not set this value to true indiscriminately. - // - // For more information, refer to the scenario in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) - // section in the AWS Key Management Service Developer Guide. - // - // Use this parameter only when you intend to prevent the principal that is - // making the request from making a subsequent PutKeyPolicy request on the CMK. - // - // The default value is false. - BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` - - // A unique identifier for the CMK. - // - // Use the CMK's unique identifier or its Amazon Resource Name (ARN). For example: - // - // * Unique ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // The key policy to attach to the CMK. - // - // If you do not set BypassPolicyLockoutSafetyCheck to true, the policy must - // meet the following criteria: - // - // * It must allow the principal that is making the PutKeyPolicy request - // to make a subsequent PutKeyPolicy request on the CMK. This reduces the - // likelihood that the CMK becomes unmanageable. For more information, refer - // to the scenario in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) - // section in the AWS Key Management Service Developer Guide. - // - // * The principals that are specified in the key policy must exist and be - // visible to AWS KMS. When you create a new AWS principal (for example, - // an IAM user or role), you might need to enforce a delay before specifying - // the new principal in a key policy because the new principal might not - // immediately be visible to AWS KMS. For more information, see Changes that - // I make are not always immediately visible (http://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) - // in the IAM User Guide. - // - // The policy size limit is 32 KiB (32768 bytes). - // - // Policy is a required field - Policy *string `min:"1" type:"string" required:"true"` - - // The name of the key policy. - // - // This value must be default. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutKeyPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutKeyPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutKeyPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutKeyPolicyInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. -func (s *PutKeyPolicyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *PutKeyPolicyInput { - s.BypassPolicyLockoutSafetyCheck = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *PutKeyPolicyInput) SetKeyId(v string) *PutKeyPolicyInput { - s.KeyId = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *PutKeyPolicyInput) SetPolicy(v string) *PutKeyPolicyInput { - s.Policy = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PutKeyPolicyInput) SetPolicyName(v string) *PutKeyPolicyInput { - s.PolicyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicyOutput -type PutKeyPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutKeyPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutKeyPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncryptRequest -type ReEncryptInput struct { - _ struct{} `type:"structure"` - - // Ciphertext of the data to reencrypt. - // - // CiphertextBlob is automatically base64 encoded/decoded by the SDK. - // - // CiphertextBlob is a required field - CiphertextBlob []byte `min:"1" type:"blob" required:"true"` - - // Encryption context to use when the data is reencrypted. - DestinationEncryptionContext map[string]*string `type:"map"` - - // A unique identifier for the CMK to use to reencrypt the data. This value - // can be a globally unique identifier, a fully specified ARN to either an alias - // or a key, or an alias name prefixed by "alias/". - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // * Alias Name Example - alias/MyAliasName - // - // DestinationKeyId is a required field - DestinationKeyId *string `min:"1" type:"string" required:"true"` - - // A list of grant tokens. - // - // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) - // in the AWS Key Management Service Developer Guide. - GrantTokens []*string `type:"list"` - - // Encryption context used to encrypt and decrypt the data specified in the - // CiphertextBlob parameter. - SourceEncryptionContext map[string]*string `type:"map"` -} - -// String returns the string representation -func (s ReEncryptInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReEncryptInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReEncryptInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReEncryptInput"} - if s.CiphertextBlob == nil { - invalidParams.Add(request.NewErrParamRequired("CiphertextBlob")) - } - if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1)) - } - if s.DestinationKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationKeyId")) - } - if s.DestinationKeyId != nil && len(*s.DestinationKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DestinationKeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCiphertextBlob sets the CiphertextBlob field's value. -func (s *ReEncryptInput) SetCiphertextBlob(v []byte) *ReEncryptInput { - s.CiphertextBlob = v - return s -} - -// SetDestinationEncryptionContext sets the DestinationEncryptionContext field's value. -func (s *ReEncryptInput) SetDestinationEncryptionContext(v map[string]*string) *ReEncryptInput { - s.DestinationEncryptionContext = v - return s -} - -// SetDestinationKeyId sets the DestinationKeyId field's value. -func (s *ReEncryptInput) SetDestinationKeyId(v string) *ReEncryptInput { - s.DestinationKeyId = &v - return s -} - -// SetGrantTokens sets the GrantTokens field's value. -func (s *ReEncryptInput) SetGrantTokens(v []*string) *ReEncryptInput { - s.GrantTokens = v - return s -} - -// SetSourceEncryptionContext sets the SourceEncryptionContext field's value. -func (s *ReEncryptInput) SetSourceEncryptionContext(v map[string]*string) *ReEncryptInput { - s.SourceEncryptionContext = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncryptResponse -type ReEncryptOutput struct { - _ struct{} `type:"structure"` - - // The reencrypted data. - // - // CiphertextBlob is automatically base64 encoded/decoded by the SDK. - CiphertextBlob []byte `min:"1" type:"blob"` - - // Unique identifier of the CMK used to reencrypt the data. - KeyId *string `min:"1" type:"string"` - - // Unique identifier of the CMK used to originally encrypt the data. - SourceKeyId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ReEncryptOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReEncryptOutput) GoString() string { - return s.String() -} - -// SetCiphertextBlob sets the CiphertextBlob field's value. -func (s *ReEncryptOutput) SetCiphertextBlob(v []byte) *ReEncryptOutput { - s.CiphertextBlob = v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *ReEncryptOutput) SetKeyId(v string) *ReEncryptOutput { - s.KeyId = &v - return s -} - -// SetSourceKeyId sets the SourceKeyId field's value. -func (s *ReEncryptOutput) SetSourceKeyId(v string) *ReEncryptOutput { - s.SourceKeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrantRequest -type RetireGrantInput struct { - _ struct{} `type:"structure"` - - // Unique identifier of the grant to retire. The grant ID is returned in the - // response to a CreateGrant operation. - // - // * Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123 - GrantId *string `min:"1" type:"string"` - - // Token that identifies the grant to be retired. - GrantToken *string `min:"1" type:"string"` - - // The Amazon Resource Name of the CMK associated with the grant. Example: - // - // * arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab - KeyId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s RetireGrantInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RetireGrantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetireGrantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetireGrantInput"} - if s.GrantId != nil && len(*s.GrantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) - } - if s.GrantToken != nil && len(*s.GrantToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GrantToken", 1)) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrantId sets the GrantId field's value. -func (s *RetireGrantInput) SetGrantId(v string) *RetireGrantInput { - s.GrantId = &v - return s -} - -// SetGrantToken sets the GrantToken field's value. -func (s *RetireGrantInput) SetGrantToken(v string) *RetireGrantInput { - s.GrantToken = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *RetireGrantInput) SetKeyId(v string) *RetireGrantInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrantOutput -type RetireGrantOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RetireGrantOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RetireGrantOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrantRequest -type RevokeGrantInput struct { - _ struct{} `type:"structure"` - - // Identifier of the grant to be revoked. - // - // GrantId is a required field - GrantId *string `min:"1" type:"string" required:"true"` - - // A unique identifier for the customer master key associated with the grant. - // This value can be a globally unique identifier or the fully specified ARN - // to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RevokeGrantInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeGrantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RevokeGrantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RevokeGrantInput"} - if s.GrantId == nil { - invalidParams.Add(request.NewErrParamRequired("GrantId")) - } - if s.GrantId != nil && len(*s.GrantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) - } - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrantId sets the GrantId field's value. -func (s *RevokeGrantInput) SetGrantId(v string) *RevokeGrantInput { - s.GrantId = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *RevokeGrantInput) SetKeyId(v string) *RevokeGrantInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrantOutput -type RevokeGrantOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RevokeGrantOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeGrantOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletionRequest -type ScheduleKeyDeletionInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the customer master key (CMK) to delete. - // - // To specify this value, use the unique key ID or the Amazon Resource Name - // (ARN) of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To obtain the unique key ID and key ARN for a given CMK, use ListKeys or - // DescribeKey. - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // The waiting period, specified in number of days. After the waiting period - // ends, AWS KMS deletes the customer master key (CMK). - // - // This value is optional. If you include a value, it must be between 7 and - // 30, inclusive. If you do not include a value, it defaults to 30. - PendingWindowInDays *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ScheduleKeyDeletionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduleKeyDeletionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScheduleKeyDeletionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScheduleKeyDeletionInput"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.PendingWindowInDays != nil && *s.PendingWindowInDays < 1 { - invalidParams.Add(request.NewErrParamMinValue("PendingWindowInDays", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *ScheduleKeyDeletionInput) SetKeyId(v string) *ScheduleKeyDeletionInput { - s.KeyId = &v - return s -} - -// SetPendingWindowInDays sets the PendingWindowInDays field's value. -func (s *ScheduleKeyDeletionInput) SetPendingWindowInDays(v int64) *ScheduleKeyDeletionInput { - s.PendingWindowInDays = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletionResponse -type ScheduleKeyDeletionOutput struct { - _ struct{} `type:"structure"` - - // The date and time after which AWS KMS deletes the customer master key (CMK). - DeletionDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The unique identifier of the customer master key (CMK) for which deletion - // is scheduled. - KeyId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ScheduleKeyDeletionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduleKeyDeletionOutput) GoString() string { - return s.String() -} - -// SetDeletionDate sets the DeletionDate field's value. -func (s *ScheduleKeyDeletionOutput) SetDeletionDate(v time.Time) *ScheduleKeyDeletionOutput { - s.DeletionDate = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *ScheduleKeyDeletionOutput) SetKeyId(v string) *ScheduleKeyDeletionOutput { - s.KeyId = &v - return s -} - -// A key-value pair. A tag consists of a tag key and a tag value. Tag keys and -// tag values are both required, but tag values can be empty (null) strings. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag. - // - // TagKey is a required field - TagKey *string `min:"1" type:"string" required:"true"` - - // The value of the tag. - // - // TagValue is a required field - TagValue *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.TagKey == nil { - invalidParams.Add(request.NewErrParamRequired("TagKey")) - } - if s.TagKey != nil && len(*s.TagKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKey", 1)) - } - if s.TagValue == nil { - invalidParams.Add(request.NewErrParamRequired("TagValue")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTagKey sets the TagKey field's value. -func (s *Tag) SetTagKey(v string) *Tag { - s.TagKey = &v - return s -} - -// SetTagValue sets the TagValue field's value. -func (s *Tag) SetTagValue(v string) *Tag { - s.TagValue = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/TagResourceRequest -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the CMK you are tagging. You can use the unique key - // ID or the Amazon Resource Name (ARN) of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // One or more tags. Each tag consists of a tag key and a tag value. - // - // 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.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 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 -} - -// SetKeyId sets the KeyId field's value. -func (s *TagResourceInput) SetKeyId(v string) *TagResourceInput { - s.KeyId = &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/kms-2014-11-01/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() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UntagResourceRequest -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the CMK from which you are removing tags. You can - // use the unique key ID or the Amazon Resource Name (ARN) of the CMK. Examples: - // - // * Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` - - // One or more tag keys. Specify only the tag keys, not the tag values. - // - // 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.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *UntagResourceInput) SetKeyId(v string) *UntagResourceInput { - s.KeyId = &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/kms-2014-11-01/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() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAliasRequest -type UpdateAliasInput struct { - _ struct{} `type:"structure"` - - // String that contains the name of the alias to be modified. The name must - // start with the word "alias" followed by a forward slash (alias/). Aliases - // that begin with "alias/aws" are reserved. - // - // AliasName is a required field - AliasName *string `min:"1" type:"string" required:"true"` - - // Unique identifier of the customer master key to be mapped to the alias. This - // value can be a globally unique identifier or the fully specified ARN of a - // key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // You can call ListAliases to verify that the alias is mapped to the correct - // TargetKeyId. - // - // TargetKeyId is a required field - TargetKeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"} - if s.AliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AliasName")) - } - if s.AliasName != nil && len(*s.AliasName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) - } - if s.TargetKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("TargetKeyId")) - } - if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliasName sets the AliasName field's value. -func (s *UpdateAliasInput) SetAliasName(v string) *UpdateAliasInput { - s.AliasName = &v - return s -} - -// SetTargetKeyId sets the TargetKeyId field's value. -func (s *UpdateAliasInput) SetTargetKeyId(v string) *UpdateAliasInput { - s.TargetKeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAliasOutput -type UpdateAliasOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateAliasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAliasOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescriptionRequest -type UpdateKeyDescriptionInput struct { - _ struct{} `type:"structure"` - - // New description for the CMK. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // A unique identifier for the CMK. This value can be a globally unique identifier - // or the fully specified ARN to a key. - // - // * Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateKeyDescriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateKeyDescriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateKeyDescriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateKeyDescriptionInput"} - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateKeyDescriptionInput) SetDescription(v string) *UpdateKeyDescriptionInput { - s.Description = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *UpdateKeyDescriptionInput) SetKeyId(v string) *UpdateKeyDescriptionInput { - s.KeyId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescriptionOutput -type UpdateKeyDescriptionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateKeyDescriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateKeyDescriptionOutput) GoString() string { - return s.String() -} - -const ( - // AlgorithmSpecRsaesPkcs1V15 is a AlgorithmSpec enum value - AlgorithmSpecRsaesPkcs1V15 = "RSAES_PKCS1_V1_5" - - // AlgorithmSpecRsaesOaepSha1 is a AlgorithmSpec enum value - AlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1" - - // AlgorithmSpecRsaesOaepSha256 is a AlgorithmSpec enum value - AlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256" -) - -const ( - // DataKeySpecAes256 is a DataKeySpec enum value - DataKeySpecAes256 = "AES_256" - - // DataKeySpecAes128 is a DataKeySpec enum value - DataKeySpecAes128 = "AES_128" -) - -const ( - // ExpirationModelTypeKeyMaterialExpires is a ExpirationModelType enum value - ExpirationModelTypeKeyMaterialExpires = "KEY_MATERIAL_EXPIRES" - - // ExpirationModelTypeKeyMaterialDoesNotExpire is a ExpirationModelType enum value - ExpirationModelTypeKeyMaterialDoesNotExpire = "KEY_MATERIAL_DOES_NOT_EXPIRE" -) - -const ( - // GrantOperationDecrypt is a GrantOperation enum value - GrantOperationDecrypt = "Decrypt" - - // GrantOperationEncrypt is a GrantOperation enum value - GrantOperationEncrypt = "Encrypt" - - // GrantOperationGenerateDataKey is a GrantOperation enum value - GrantOperationGenerateDataKey = "GenerateDataKey" - - // GrantOperationGenerateDataKeyWithoutPlaintext is a GrantOperation enum value - GrantOperationGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" - - // GrantOperationReEncryptFrom is a GrantOperation enum value - GrantOperationReEncryptFrom = "ReEncryptFrom" - - // GrantOperationReEncryptTo is a GrantOperation enum value - GrantOperationReEncryptTo = "ReEncryptTo" - - // GrantOperationCreateGrant is a GrantOperation enum value - GrantOperationCreateGrant = "CreateGrant" - - // GrantOperationRetireGrant is a GrantOperation enum value - GrantOperationRetireGrant = "RetireGrant" - - // GrantOperationDescribeKey is a GrantOperation enum value - GrantOperationDescribeKey = "DescribeKey" -) - -const ( - // KeyStateEnabled is a KeyState enum value - KeyStateEnabled = "Enabled" - - // KeyStateDisabled is a KeyState enum value - KeyStateDisabled = "Disabled" - - // KeyStatePendingDeletion is a KeyState enum value - KeyStatePendingDeletion = "PendingDeletion" - - // KeyStatePendingImport is a KeyState enum value - KeyStatePendingImport = "PendingImport" -) - -const ( - // KeyUsageTypeEncryptDecrypt is a KeyUsageType enum value - KeyUsageTypeEncryptDecrypt = "ENCRYPT_DECRYPT" -) - -const ( - // OriginTypeAwsKms is a OriginType enum value - OriginTypeAwsKms = "AWS_KMS" - - // OriginTypeExternal is a OriginType enum value - OriginTypeExternal = "EXTERNAL" -) - -const ( - // WrappingKeySpecRsa2048 is a WrappingKeySpec enum value - WrappingKeySpecRsa2048 = "RSA_2048" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go b/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go deleted file mode 100644 index 474ae6b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go +++ /dev/null @@ -1,154 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package kms - -const ( - - // ErrCodeAlreadyExistsException for service response error code - // "AlreadyExistsException". - // - // The request was rejected because it attempted to create a resource that already - // exists. - ErrCodeAlreadyExistsException = "AlreadyExistsException" - - // ErrCodeDependencyTimeoutException for service response error code - // "DependencyTimeoutException". - // - // The system timed out while trying to fulfill the request. The request can - // be retried. - ErrCodeDependencyTimeoutException = "DependencyTimeoutException" - - // ErrCodeDisabledException for service response error code - // "DisabledException". - // - // The request was rejected because the specified CMK is not enabled. - ErrCodeDisabledException = "DisabledException" - - // ErrCodeExpiredImportTokenException for service response error code - // "ExpiredImportTokenException". - // - // The request was rejected because the provided import token is expired. Use - // GetParametersForImport to retrieve a new import token and public key, use - // the new public key to encrypt the key material, and then try the request - // again. - ErrCodeExpiredImportTokenException = "ExpiredImportTokenException" - - // ErrCodeIncorrectKeyMaterialException for service response error code - // "IncorrectKeyMaterialException". - // - // The request was rejected because the provided key material is invalid or - // is not the same key material that was previously imported into this customer - // master key (CMK). - ErrCodeIncorrectKeyMaterialException = "IncorrectKeyMaterialException" - - // ErrCodeInternalException for service response error code - // "InternalException". - // - // The request was rejected because an internal exception occurred. The request - // can be retried. - ErrCodeInternalException = "InternalException" - - // ErrCodeInvalidAliasNameException for service response error code - // "InvalidAliasNameException". - // - // The request was rejected because the specified alias name is not valid. - ErrCodeInvalidAliasNameException = "InvalidAliasNameException" - - // ErrCodeInvalidArnException for service response error code - // "InvalidArnException". - // - // The request was rejected because a specified ARN was not valid. - ErrCodeInvalidArnException = "InvalidArnException" - - // ErrCodeInvalidCiphertextException for service response error code - // "InvalidCiphertextException". - // - // The request was rejected because the specified ciphertext has been corrupted - // or is otherwise invalid. - ErrCodeInvalidCiphertextException = "InvalidCiphertextException" - - // ErrCodeInvalidGrantIdException for service response error code - // "InvalidGrantIdException". - // - // The request was rejected because the specified GrantId is not valid. - ErrCodeInvalidGrantIdException = "InvalidGrantIdException" - - // ErrCodeInvalidGrantTokenException for service response error code - // "InvalidGrantTokenException". - // - // The request was rejected because the specified grant token is not valid. - ErrCodeInvalidGrantTokenException = "InvalidGrantTokenException" - - // ErrCodeInvalidImportTokenException for service response error code - // "InvalidImportTokenException". - // - // The request was rejected because the provided import token is invalid or - // is associated with a different customer master key (CMK). - ErrCodeInvalidImportTokenException = "InvalidImportTokenException" - - // ErrCodeInvalidKeyUsageException for service response error code - // "InvalidKeyUsageException". - // - // The request was rejected because the specified KeySpec value is not valid. - ErrCodeInvalidKeyUsageException = "InvalidKeyUsageException" - - // ErrCodeInvalidMarkerException for service response error code - // "InvalidMarkerException". - // - // The request was rejected because the marker that specifies where pagination - // should next begin is not valid. - ErrCodeInvalidMarkerException = "InvalidMarkerException" - - // ErrCodeInvalidStateException for service response error code - // "InvalidStateException". - // - // The request was rejected because the state of the specified resource is not - // valid for this request. - // - // For more information about how key state affects the use of a CMK, see How - // Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) - // in the AWS Key Management Service Developer Guide. - ErrCodeInvalidStateException = "InvalidStateException" - - // ErrCodeKeyUnavailableException for service response error code - // "KeyUnavailableException". - // - // The request was rejected because the specified CMK was not available. The - // request can be retried. - ErrCodeKeyUnavailableException = "KeyUnavailableException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // The request was rejected because a limit was exceeded. For more information, - // see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html) - // in the AWS Key Management Service Developer Guide. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeMalformedPolicyDocumentException for service response error code - // "MalformedPolicyDocumentException". - // - // The request was rejected because the specified policy is not syntactically - // or semantically correct. - ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocumentException" - - // ErrCodeNotFoundException for service response error code - // "NotFoundException". - // - // The request was rejected because the specified entity or resource could not - // be found. - ErrCodeNotFoundException = "NotFoundException" - - // ErrCodeTagException for service response error code - // "TagException". - // - // The request was rejected because one or more tags are not valid. - ErrCodeTagException = "TagException" - - // ErrCodeUnsupportedOperationException for service response error code - // "UnsupportedOperationException". - // - // The request was rejected because a specified parameter is not supported or - // a specified resource is not valid for this operation. - ErrCodeUnsupportedOperationException = "UnsupportedOperationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/kms/service.go b/vendor/github.com/aws/aws-sdk-go/service/kms/service.go deleted file mode 100644 index b4688ca..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/service.go +++ /dev/null @@ -1,163 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package kms - -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" -) - -// AWS Key Management Service (AWS KMS) is an encryption and key management -// web service. This guide describes the AWS KMS operations that you can call -// programmatically. For general information about AWS KMS, see the AWS Key -// Management Service Developer Guide (http://docs.aws.amazon.com/kms/latest/developerguide/). -// -// AWS provides SDKs that 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 AWS KMS and other -// AWS services. For example, the SDKs take care of tasks such as signing requests -// (see below), managing errors, and retrying requests automatically. For more -// information about the AWS SDKs, including how to download and install them, -// see Tools for Amazon Web Services (http://aws.amazon.com/tools/). -// -// We recommend that you use the AWS SDKs to make programmatic API calls to -// AWS KMS. -// -// Clients must support TLS (Transport Layer Security) 1.0. We recommend TLS -// 1.2. Clients must also support cipher suites with Perfect Forward Secrecy -// (PFS) such as Ephemeral Diffie-Hellman (DHE) or Elliptic Curve Ephemeral -// Diffie-Hellman (ECDHE). Most modern systems such as Java 7 and later support -// these modes. -// -// Signing Requests -// -// Requests must be signed by using an access key ID and a secret access key. -// We strongly recommend that you do not use your AWS account (root) access -// key ID and secret key for everyday work with AWS KMS. Instead, use the access -// key ID and secret access key for an IAM user, or you can use the AWS Security -// Token Service to generate temporary security credentials that you can use -// to sign requests. -// -// All AWS KMS operations require Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). -// -// Logging API Requests -// -// AWS KMS supports AWS CloudTrail, a service that logs AWS API calls and related -// events for your AWS account and delivers them to an Amazon S3 bucket that -// you specify. By using the information collected by CloudTrail, you can determine -// what requests were made to AWS KMS, 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/). -// -// Additional Resources -// -// For more information about credentials and request signing, see the following: -// -// * AWS Security Credentials (http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html) -// - This topic provides general information about the types of credentials -// used for accessing AWS. -// -// * Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) -// - This section of the IAM User Guide describes how to create and use temporary -// security credentials. -// -// * Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) -// - This set of topics walks you through the process of signing a request -// using an access key ID and a secret access key. -// -// Commonly Used APIs -// -// Of the APIs discussed in this guide, the following will prove the most useful -// for most applications. You will likely perform actions other than these, -// such as creating keys and assigning policies, by using the console. -// -// * Encrypt -// -// * Decrypt -// -// * GenerateDataKey -// -// * GenerateDataKeyWithoutPlaintext -// 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/kms-2014-11-01 -type KMS 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 = "kms" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the KMS 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 KMS client from just a session. -// svc := kms.New(mySession) -// -// // Create a KMS client with additional configuration -// svc := kms.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *KMS { - 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) *KMS { - svc := &KMS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-11-01", - JSONVersion: "1.1", - TargetPrefix: "TrentService", - }, - 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 KMS operation and runs any -// custom request initialization. -func (c *KMS) 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/lambda/api.go b/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go deleted file mode 100644 index 4a215f4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go +++ /dev/null @@ -1,5447 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package lambda provides a client for AWS Lambda. -package lambda - -import ( - "io" - "time" - - "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/restjson" -) - -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) -// } -func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) { - op := &request.Operation{ - Name: opAddPermission, - HTTPMethod: "POST", - HTTPPath: "/2015-03-31/functions/{FunctionName}/policy", - } - - if input == nil { - input = &AddPermissionInput{} - } - - output = &AddPermissionOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddPermission API operation for AWS Lambda. -// -// Adds a permission to the resource policy associated with the specified AWS -// Lambda function. You use resource policies to grant permissions to event -// sources that use push model. In a push model, event sources (such as Amazon -// S3 and custom applications) invoke your Lambda function. Each permission -// you add to the resource policy allows an event source, permission to invoke -// the Lambda function. -// -// For information about the push model, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html). -// -// If you are using versioning, the permissions you add are specific to the -// Lambda function version or alias you specify in the AddPermission request -// via the Qualifier parameter. For more information about versioning, see AWS -// Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:AddPermission action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation AddPermission for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodePolicyLengthExceededException "PolicyLengthExceededException" -// Lambda function access policy is limited to 20 KB. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) { - req, out := c.AddPermissionRequest(input) - err := req.Send() - return out, err -} - -const opCreateAlias = "CreateAlias" - -// CreateAliasRequest generates a "aws/request.Request" representing the -// client's request for the CreateAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAliasRequest method. -// req, resp := client.CreateAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *AliasConfiguration) { - op := &request.Operation{ - Name: opCreateAlias, - HTTPMethod: "POST", - HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases", - } - - if input == nil { - input = &CreateAliasInput{} - } - - output = &AliasConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// CreateAlias API operation for AWS Lambda. -// -// Creates an alias that points to the specified Lambda function version. For -// more information, see Introduction to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html). -// -// Alias names are unique for a given function. This requires permission for -// the lambda:CreateAlias action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation CreateAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) CreateAlias(input *CreateAliasInput) (*AliasConfiguration, error) { - req, out := c.CreateAliasRequest(input) - err := req.Send() - return out, err -} - -const opCreateEventSourceMapping = "CreateEventSourceMapping" - -// CreateEventSourceMappingRequest generates a "aws/request.Request" representing the -// client's request for the CreateEventSourceMapping operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateEventSourceMapping for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateEventSourceMapping method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateEventSourceMappingRequest method. -// req, resp := client.CreateEventSourceMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) { - op := &request.Operation{ - Name: opCreateEventSourceMapping, - HTTPMethod: "POST", - HTTPPath: "/2015-03-31/event-source-mappings/", - } - - if input == nil { - input = &CreateEventSourceMappingInput{} - } - - output = &EventSourceMappingConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// CreateEventSourceMapping API operation for AWS Lambda. -// -// Identifies a stream as an event source for a Lambda function. It can be either -// an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda invokes -// the specified function when records are posted to the stream. -// -// This association between a stream source and a Lambda function is called -// the event source mapping. -// -// This event source mapping is relevant only in the AWS Lambda pull model, -// where AWS Lambda invokes the function. For more information, see AWS Lambda: -// How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html) -// in the AWS Lambda Developer Guide. -// -// You provide mapping information (for example, which stream to read from and -// which Lambda function to invoke) in the request body. -// -// Each event source, such as an Amazon Kinesis or a DynamoDB stream, can be -// associated with multiple AWS Lambda function. A given Lambda function can -// be associated with multiple AWS event sources. -// -// If you are using versioning, you can specify a specific function version -// or an alias via the function name parameter. For more information about versioning, -// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:CreateEventSourceMapping -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation CreateEventSourceMapping for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -func (c *Lambda) CreateEventSourceMapping(input *CreateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { - req, out := c.CreateEventSourceMappingRequest(input) - err := req.Send() - return out, err -} - -const opCreateFunction = "CreateFunction" - -// CreateFunctionRequest generates a "aws/request.Request" representing the -// client's request for the CreateFunction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateFunction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateFunction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateFunctionRequest method. -// req, resp := client.CreateFunctionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request.Request, output *FunctionConfiguration) { - op := &request.Operation{ - Name: opCreateFunction, - HTTPMethod: "POST", - HTTPPath: "/2015-03-31/functions", - } - - if input == nil { - input = &CreateFunctionInput{} - } - - output = &FunctionConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// CreateFunction API operation for AWS Lambda. -// -// Creates a new Lambda function. The function metadata is created from the -// request parameters, and the code for the function is provided by a .zip file -// in the request body. If the function name already exists, the operation will -// fail. Note that the function name is case-sensitive. -// -// If you are using versioning, you can also publish a version of the Lambda -// function you are creating using the Publish parameter. For more information -// about versioning, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:CreateFunction action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation CreateFunction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeCodeStorageExceededException "CodeStorageExceededException" -// You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html) -// -func (c *Lambda) CreateFunction(input *CreateFunctionInput) (*FunctionConfiguration, error) { - req, out := c.CreateFunctionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAlias = "DeleteAlias" - -// DeleteAliasRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAliasRequest method. -// req, resp := client.DeleteAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) { - op := &request.Operation{ - Name: opDeleteAlias, - HTTPMethod: "DELETE", - HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases/{Name}", - } - - if input == nil { - input = &DeleteAliasInput{} - } - - output = &DeleteAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAlias API operation for AWS Lambda. -// -// Deletes the specified Lambda function alias. For more information, see Introduction -// to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html). -// -// This requires permission for the lambda:DeleteAlias action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation DeleteAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { - req, out := c.DeleteAliasRequest(input) - err := req.Send() - return out, err -} - -const opDeleteEventSourceMapping = "DeleteEventSourceMapping" - -// DeleteEventSourceMappingRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEventSourceMapping operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteEventSourceMapping for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteEventSourceMapping method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteEventSourceMappingRequest method. -// req, resp := client.DeleteEventSourceMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) { - op := &request.Operation{ - Name: opDeleteEventSourceMapping, - HTTPMethod: "DELETE", - HTTPPath: "/2015-03-31/event-source-mappings/{UUID}", - } - - if input == nil { - input = &DeleteEventSourceMappingInput{} - } - - output = &EventSourceMappingConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// DeleteEventSourceMapping API operation for AWS Lambda. -// -// Removes an event source mapping. This means AWS Lambda will no longer invoke -// the function for events in the associated source. -// -// This operation requires permission for the lambda:DeleteEventSourceMapping -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation DeleteEventSourceMapping for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) DeleteEventSourceMapping(input *DeleteEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { - req, out := c.DeleteEventSourceMappingRequest(input) - err := req.Send() - return out, err -} - -const opDeleteFunction = "DeleteFunction" - -// DeleteFunctionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFunction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteFunction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteFunction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteFunctionRequest method. -// req, resp := client.DeleteFunctionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) (req *request.Request, output *DeleteFunctionOutput) { - op := &request.Operation{ - Name: opDeleteFunction, - HTTPMethod: "DELETE", - HTTPPath: "/2015-03-31/functions/{FunctionName}", - } - - if input == nil { - input = &DeleteFunctionInput{} - } - - output = &DeleteFunctionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteFunction API operation for AWS Lambda. -// -// Deletes the specified Lambda function code and configuration. -// -// If you are using the versioning feature and you don't specify a function -// version in your DeleteFunction request, AWS Lambda will delete the function, -// including all its versions, and any aliases pointing to the function versions. -// To delete a specific function version, you must provide the function version -// via the Qualifier parameter. For information about function versioning, see -// AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// When you delete a function the associated resource policy is also deleted. -// You will need to delete the event source mappings explicitly. -// -// This operation requires permission for the lambda:DeleteFunction action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation DeleteFunction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. -// -func (c *Lambda) DeleteFunction(input *DeleteFunctionInput) (*DeleteFunctionOutput, error) { - req, out := c.DeleteFunctionRequest(input) - err := req.Send() - return out, err -} - -const opGetAccountSettings = "GetAccountSettings" - -// GetAccountSettingsRequest generates a "aws/request.Request" representing the -// client's request for the GetAccountSettings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAccountSettings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAccountSettings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAccountSettingsRequest method. -// req, resp := client.GetAccountSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) GetAccountSettingsRequest(input *GetAccountSettingsInput) (req *request.Request, output *GetAccountSettingsOutput) { - op := &request.Operation{ - Name: opGetAccountSettings, - HTTPMethod: "GET", - HTTPPath: "/2016-08-19/account-settings/", - } - - if input == nil { - input = &GetAccountSettingsInput{} - } - - output = &GetAccountSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccountSettings API operation for AWS Lambda. -// -// Returns a customer's account settings. -// -// You can use this operation to retrieve Lambda limits information, such as -// code size and concurrency limits. For more information about limits, see -// AWS Lambda Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html). -// You can also retrieve resource usage statistics, such as code storage usage -// and function count. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation GetAccountSettings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -func (c *Lambda) GetAccountSettings(input *GetAccountSettingsInput) (*GetAccountSettingsOutput, error) { - req, out := c.GetAccountSettingsRequest(input) - err := req.Send() - return out, err -} - -const opGetAlias = "GetAlias" - -// GetAliasRequest generates a "aws/request.Request" representing the -// client's request for the GetAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAliasRequest method. -// req, resp := client.GetAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) GetAliasRequest(input *GetAliasInput) (req *request.Request, output *AliasConfiguration) { - op := &request.Operation{ - Name: opGetAlias, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases/{Name}", - } - - if input == nil { - input = &GetAliasInput{} - } - - output = &AliasConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// GetAlias API operation for AWS Lambda. -// -// Returns the specified alias information such as the alias ARN, description, -// and function version it is pointing to. For more information, see Introduction -// to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html). -// -// This requires permission for the lambda:GetAlias action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation GetAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) GetAlias(input *GetAliasInput) (*AliasConfiguration, error) { - req, out := c.GetAliasRequest(input) - err := req.Send() - return out, err -} - -const opGetEventSourceMapping = "GetEventSourceMapping" - -// GetEventSourceMappingRequest generates a "aws/request.Request" representing the -// client's request for the GetEventSourceMapping operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetEventSourceMapping for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetEventSourceMapping method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetEventSourceMappingRequest method. -// req, resp := client.GetEventSourceMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) { - op := &request.Operation{ - Name: opGetEventSourceMapping, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/event-source-mappings/{UUID}", - } - - if input == nil { - input = &GetEventSourceMappingInput{} - } - - output = &EventSourceMappingConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// GetEventSourceMapping API operation for AWS Lambda. -// -// Returns configuration information for the specified event source mapping -// (see CreateEventSourceMapping). -// -// This operation requires permission for the lambda:GetEventSourceMapping action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation GetEventSourceMapping for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) GetEventSourceMapping(input *GetEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { - req, out := c.GetEventSourceMappingRequest(input) - err := req.Send() - return out, err -} - -const opGetFunction = "GetFunction" - -// GetFunctionRequest generates a "aws/request.Request" representing the -// client's request for the GetFunction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetFunction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetFunction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetFunctionRequest method. -// req, resp := client.GetFunctionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) (req *request.Request, output *GetFunctionOutput) { - op := &request.Operation{ - Name: opGetFunction, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/functions/{FunctionName}", - } - - if input == nil { - input = &GetFunctionInput{} - } - - output = &GetFunctionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetFunction API operation for AWS Lambda. -// -// Returns the configuration information of the Lambda function and a presigned -// URL link to the .zip file you uploaded with CreateFunction so you can download -// the .zip file. Note that the URL is valid for up to 10 minutes. The configuration -// information is the same information you provided as parameters when uploading -// the function. -// -// Using the optional Qualifier parameter, you can specify a specific function -// version for which you want this information. If you don't specify this parameter, -// the API uses unqualified function ARN which return information about the -// $LATEST version of the Lambda function. For more information, see AWS Lambda -// Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:GetFunction action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation GetFunction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -func (c *Lambda) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error) { - req, out := c.GetFunctionRequest(input) - err := req.Send() - return out, err -} - -const opGetFunctionConfiguration = "GetFunctionConfiguration" - -// GetFunctionConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetFunctionConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetFunctionConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetFunctionConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetFunctionConfigurationRequest method. -// req, resp := client.GetFunctionConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration) { - op := &request.Operation{ - Name: opGetFunctionConfiguration, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/functions/{FunctionName}/configuration", - } - - if input == nil { - input = &GetFunctionConfigurationInput{} - } - - output = &FunctionConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// GetFunctionConfiguration API operation for AWS Lambda. -// -// Returns the configuration information of the Lambda function. This the same -// information you provided as parameters when uploading the function by using -// CreateFunction. -// -// If you are using the versioning feature, you can retrieve this information -// for a specific function version by using the optional Qualifier parameter -// and specifying the function version or alias that points to it. If you don't -// provide it, the API returns information about the $LATEST version of the -// function. For more information about versioning, see AWS Lambda Function -// Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:GetFunctionConfiguration -// 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 AWS Lambda's -// API operation GetFunctionConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -func (c *Lambda) GetFunctionConfiguration(input *GetFunctionConfigurationInput) (*FunctionConfiguration, error) { - req, out := c.GetFunctionConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opGetPolicy = "GetPolicy" - -// GetPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPolicyRequest method. -// req, resp := client.GetPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput) { - op := &request.Operation{ - Name: opGetPolicy, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/functions/{FunctionName}/policy", - } - - if input == nil { - input = &GetPolicyInput{} - } - - output = &GetPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPolicy API operation for AWS Lambda. -// -// Returns the resource policy associated with the specified Lambda function. -// -// If you are using the versioning feature, you can get the resource policy -// associated with the specific Lambda function version or alias by specifying -// the version or alias name using the Qualifier parameter. For more information -// about versioning, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// For information about adding permissions, see AddPermission. -// -// You need permission for the lambda:GetPolicy action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation GetPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -func (c *Lambda) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { - req, out := c.GetPolicyRequest(input) - err := req.Send() - return out, err -} - -const opInvoke = "Invoke" - -// InvokeRequest generates a "aws/request.Request" representing the -// client's request for the Invoke operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Invoke for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Invoke method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InvokeRequest method. -// req, resp := client.InvokeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output *InvokeOutput) { - op := &request.Operation{ - Name: opInvoke, - HTTPMethod: "POST", - HTTPPath: "/2015-03-31/functions/{FunctionName}/invocations", - } - - if input == nil { - input = &InvokeInput{} - } - - output = &InvokeOutput{} - req = c.newRequest(op, input, output) - return -} - -// Invoke API operation for AWS Lambda. -// -// Invokes a specific Lambda function. For an example, see Create the Lambda -// Function and Test It Manually (http://docs.aws.amazon.com/lambda/latest/dg/with-dynamodb-create-function.html#with-dbb-invoke-manually). -// -// If you are using the versioning feature, you can invoke the specific function -// version by providing function version or alias name that is pointing to the -// function version using the Qualifier parameter in the request. If you don't -// provide the Qualifier parameter, the $LATEST version of the Lambda function -// is invoked. Invocations occur at least once in response to an event and functions -// must be idempotent to handle this. For information about the versioning feature, -// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:InvokeFunction action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation Invoke for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidRequestContentException "InvalidRequestContentException" -// The request body could not be parsed as JSON. -// -// * ErrCodeRequestTooLargeException "RequestTooLargeException" -// The request payload exceeded the Invoke request body JSON input limit. For -// more information, see Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html). -// -// * ErrCodeUnsupportedMediaTypeException "UnsupportedMediaTypeException" -// The content type of the Invoke request body is not JSON. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeEC2UnexpectedException "EC2UnexpectedException" -// AWS Lambda received an unexpected EC2 client exception while setting up for -// the Lambda function. -// -// * ErrCodeSubnetIPAddressLimitReachedException "SubnetIPAddressLimitReachedException" -// AWS Lambda was not able to set up VPC access for the Lambda function because -// one or more configured subnets has no available IP addresses. -// -// * ErrCodeENILimitReachedException "ENILimitReachedException" -// AWS Lambda was not able to create an Elastic Network Interface (ENI) in the -// VPC, specified as part of Lambda function configuration, because the limit -// for network interfaces has been reached. -// -// * ErrCodeEC2ThrottledException "EC2ThrottledException" -// AWS Lambda was throttled by Amazon EC2 during Lambda function initialization -// using the execution role provided for the Lambda function. -// -// * ErrCodeEC2AccessDeniedException "EC2AccessDeniedException" -// -// * ErrCodeInvalidSubnetIDException "InvalidSubnetIDException" -// The Subnet ID provided in the Lambda function VPC configuration is invalid. -// -// * ErrCodeInvalidSecurityGroupIDException "InvalidSecurityGroupIDException" -// The Security Group ID provided in the Lambda function VPC configuration is -// invalid. -// -// * ErrCodeInvalidZipFileException "InvalidZipFileException" -// AWS Lambda could not unzip the function zip file. -// -// * ErrCodeKMSDisabledException "KMSDisabledException" -// Lambda was unable to decrypt the environment variables because the KMS key -// used is disabled. Check the Lambda function's KMS key settings. -// -// * ErrCodeKMSInvalidStateException "KMSInvalidStateException" -// Lambda was unable to decrypt the environment variables because the KMS key -// used is in an invalid state for Decrypt. Check the function's KMS key settings. -// -// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException" -// Lambda was unable to decrypt the environment variables because KMS access -// was denied. Check the Lambda function's KMS permissions. -// -// * ErrCodeKMSNotFoundException "KMSNotFoundException" -// Lambda was unable to decrypt the environment variables because the KMS key -// was not found. Check the function's KMS key settings. -// -func (c *Lambda) Invoke(input *InvokeInput) (*InvokeOutput, error) { - req, out := c.InvokeRequest(input) - err := req.Send() - return out, err -} - -const opInvokeAsync = "InvokeAsync" - -// InvokeAsyncRequest generates a "aws/request.Request" representing the -// client's request for the InvokeAsync operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InvokeAsync for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InvokeAsync method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InvokeAsyncRequest method. -// req, resp := client.InvokeAsyncRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) (req *request.Request, output *InvokeAsyncOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, InvokeAsync, has been deprecated") - } - op := &request.Operation{ - Name: opInvokeAsync, - HTTPMethod: "POST", - HTTPPath: "/2014-11-13/functions/{FunctionName}/invoke-async/", - } - - if input == nil { - input = &InvokeAsyncInput{} - } - - output = &InvokeAsyncOutput{} - req = c.newRequest(op, input, output) - return -} - -// InvokeAsync API operation for AWS Lambda. -// -// This API is deprecated. We recommend you use Invoke API (see Invoke). -// -// Submits an invocation request to AWS Lambda. Upon receiving the request, -// Lambda executes the specified function asynchronously. To see the logs generated -// by the Lambda function execution, see the CloudWatch Logs console. -// -// This operation requires permission for the lambda:InvokeFunction action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation InvokeAsync for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidRequestContentException "InvalidRequestContentException" -// The request body could not be parsed as JSON. -// -func (c *Lambda) InvokeAsync(input *InvokeAsyncInput) (*InvokeAsyncOutput, error) { - req, out := c.InvokeAsyncRequest(input) - err := req.Send() - return out, err -} - -const opListAliases = "ListAliases" - -// ListAliasesRequest generates a "aws/request.Request" representing the -// client's request for the ListAliases operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAliases for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAliases method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAliasesRequest method. -// req, resp := client.ListAliasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) { - op := &request.Operation{ - Name: opListAliases, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases", - } - - if input == nil { - input = &ListAliasesInput{} - } - - output = &ListAliasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAliases API operation for AWS Lambda. -// -// Returns list of aliases created for a Lambda function. For each alias, the -// response includes information such as the alias ARN, description, alias name, -// and the function version to which it points. For more information, see Introduction -// to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html). -// -// This requires permission for the lambda:ListAliases action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation ListAliases for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { - req, out := c.ListAliasesRequest(input) - err := req.Send() - return out, err -} - -const opListEventSourceMappings = "ListEventSourceMappings" - -// ListEventSourceMappingsRequest generates a "aws/request.Request" representing the -// client's request for the ListEventSourceMappings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListEventSourceMappings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListEventSourceMappings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListEventSourceMappingsRequest method. -// req, resp := client.ListEventSourceMappingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsInput) (req *request.Request, output *ListEventSourceMappingsOutput) { - op := &request.Operation{ - Name: opListEventSourceMappings, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/event-source-mappings/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEventSourceMappingsInput{} - } - - output = &ListEventSourceMappingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEventSourceMappings API operation for AWS Lambda. -// -// Returns a list of event source mappings you created using the CreateEventSourceMapping -// (see CreateEventSourceMapping). -// -// For each mapping, the API returns configuration information. You can optionally -// specify filters to retrieve specific event source mappings. -// -// If you are using the versioning feature, you can get list of event source -// mappings for a specific Lambda function version or an alias as described -// in the FunctionName parameter. For information about the versioning feature, -// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:ListEventSourceMappings -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation ListEventSourceMappings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) ListEventSourceMappings(input *ListEventSourceMappingsInput) (*ListEventSourceMappingsOutput, error) { - req, out := c.ListEventSourceMappingsRequest(input) - err := req.Send() - return out, err -} - -// ListEventSourceMappingsPages iterates over the pages of a ListEventSourceMappings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEventSourceMappings 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 ListEventSourceMappings operation. -// pageNum := 0 -// err := client.ListEventSourceMappingsPages(params, -// func(page *ListEventSourceMappingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Lambda) ListEventSourceMappingsPages(input *ListEventSourceMappingsInput, fn func(p *ListEventSourceMappingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListEventSourceMappingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListEventSourceMappingsOutput), lastPage) - }) -} - -const opListFunctions = "ListFunctions" - -// ListFunctionsRequest generates a "aws/request.Request" representing the -// client's request for the ListFunctions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListFunctions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListFunctions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListFunctionsRequest method. -// req, resp := client.ListFunctionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.Request, output *ListFunctionsOutput) { - op := &request.Operation{ - Name: opListFunctions, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/functions/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListFunctionsInput{} - } - - output = &ListFunctionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListFunctions API operation for AWS Lambda. -// -// Returns a list of your Lambda functions. For each function, the response -// includes the function configuration information. You must use GetFunction -// to retrieve the code for your function. -// -// This operation requires permission for the lambda:ListFunctions action. -// -// If you are using versioning feature, the response returns list of $LATEST -// versions of your functions. For information about the versioning feature, -// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.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 AWS Lambda's -// API operation ListFunctions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, error) { - req, out := c.ListFunctionsRequest(input) - err := req.Send() - return out, err -} - -// ListFunctionsPages iterates over the pages of a ListFunctions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFunctions 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 ListFunctions operation. -// pageNum := 0 -// err := client.ListFunctionsPages(params, -// func(page *ListFunctionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Lambda) ListFunctionsPages(input *ListFunctionsInput, fn func(p *ListFunctionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListFunctionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListFunctionsOutput), lastPage) - }) -} - -const opListVersionsByFunction = "ListVersionsByFunction" - -// ListVersionsByFunctionRequest generates a "aws/request.Request" representing the -// client's request for the ListVersionsByFunction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListVersionsByFunction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListVersionsByFunction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListVersionsByFunctionRequest method. -// req, resp := client.ListVersionsByFunctionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInput) (req *request.Request, output *ListVersionsByFunctionOutput) { - op := &request.Operation{ - Name: opListVersionsByFunction, - HTTPMethod: "GET", - HTTPPath: "/2015-03-31/functions/{FunctionName}/versions", - } - - if input == nil { - input = &ListVersionsByFunctionInput{} - } - - output = &ListVersionsByFunctionOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVersionsByFunction API operation for AWS Lambda. -// -// List all versions of a function. For information about the versioning feature, -// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.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 AWS Lambda's -// API operation ListVersionsByFunction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) ListVersionsByFunction(input *ListVersionsByFunctionInput) (*ListVersionsByFunctionOutput, error) { - req, out := c.ListVersionsByFunctionRequest(input) - err := req.Send() - return out, err -} - -const opPublishVersion = "PublishVersion" - -// PublishVersionRequest generates a "aws/request.Request" representing the -// client's request for the PublishVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PublishVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PublishVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PublishVersionRequest method. -// req, resp := client.PublishVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) (req *request.Request, output *FunctionConfiguration) { - op := &request.Operation{ - Name: opPublishVersion, - HTTPMethod: "POST", - HTTPPath: "/2015-03-31/functions/{FunctionName}/versions", - } - - if input == nil { - input = &PublishVersionInput{} - } - - output = &FunctionConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// PublishVersion API operation for AWS Lambda. -// -// Publishes a version of your function from the current snapshot of $LATEST. -// That is, AWS Lambda takes a snapshot of the function code and configuration -// information from $LATEST and publishes a new version. The code and configuration -// cannot be modified after publication. For information about the versioning -// feature, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.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 AWS Lambda's -// API operation PublishVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeCodeStorageExceededException "CodeStorageExceededException" -// You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html) -// -func (c *Lambda) PublishVersion(input *PublishVersionInput) (*FunctionConfiguration, error) { - req, out := c.PublishVersionRequest(input) - err := req.Send() - return out, err -} - -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) -// } -func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) { - op := &request.Operation{ - Name: opRemovePermission, - HTTPMethod: "DELETE", - HTTPPath: "/2015-03-31/functions/{FunctionName}/policy/{StatementId}", - } - - if input == nil { - input = &RemovePermissionInput{} - } - - output = &RemovePermissionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemovePermission API operation for AWS Lambda. -// -// You can remove individual permissions from an resource policy associated -// with a Lambda function by providing a statement ID that you provided when -// you added the permission. -// -// If you are using versioning, the permissions you remove are specific to the -// Lambda function version or alias you specify in the AddPermission request -// via the Qualifier parameter. For more information about versioning, see AWS -// Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// Note that removal of a permission will cause an active event source to lose -// permission to the function. -// -// You need permission for the lambda:RemovePermission action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation RemovePermission for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { - req, out := c.RemovePermissionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAlias = "UpdateAlias" - -// UpdateAliasRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAlias operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAlias for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAlias method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAliasRequest method. -// req, resp := client.UpdateAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *AliasConfiguration) { - op := &request.Operation{ - Name: opUpdateAlias, - HTTPMethod: "PUT", - HTTPPath: "/2015-03-31/functions/{FunctionName}/aliases/{Name}", - } - - if input == nil { - input = &UpdateAliasInput{} - } - - output = &AliasConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAlias API operation for AWS Lambda. -// -// Using this API you can update the function version to which the alias points -// and the alias description. For more information, see Introduction to AWS -// Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html). -// -// This requires permission for the lambda:UpdateAlias action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation UpdateAlias for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) UpdateAlias(input *UpdateAliasInput) (*AliasConfiguration, error) { - req, out := c.UpdateAliasRequest(input) - err := req.Send() - return out, err -} - -const opUpdateEventSourceMapping = "UpdateEventSourceMapping" - -// UpdateEventSourceMappingRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEventSourceMapping operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateEventSourceMapping for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateEventSourceMapping method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateEventSourceMappingRequest method. -// req, resp := client.UpdateEventSourceMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration) { - op := &request.Operation{ - Name: opUpdateEventSourceMapping, - HTTPMethod: "PUT", - HTTPPath: "/2015-03-31/event-source-mappings/{UUID}", - } - - if input == nil { - input = &UpdateEventSourceMappingInput{} - } - - output = &EventSourceMappingConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// UpdateEventSourceMapping API operation for AWS Lambda. -// -// You can update an event source mapping. This is useful if you want to change -// the parameters of the existing mapping without losing your position in the -// stream. You can change which function will receive the stream records, but -// to change the stream itself, you must create a new mapping. -// -// If you are using the versioning feature, you can update the event source -// mapping to map to a specific Lambda function version or alias as described -// in the FunctionName parameter. For information about the versioning feature, -// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// If you disable the event source mapping, AWS Lambda stops polling. If you -// enable again, it will resume polling from the time it had stopped polling, -// so you don't lose processing of any records. However, if you delete event -// source mapping and create it again, it will reset. -// -// This operation requires permission for the lambda:UpdateEventSourceMapping -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation UpdateEventSourceMapping for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. -// -func (c *Lambda) UpdateEventSourceMapping(input *UpdateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { - req, out := c.UpdateEventSourceMappingRequest(input) - err := req.Send() - return out, err -} - -const opUpdateFunctionCode = "UpdateFunctionCode" - -// UpdateFunctionCodeRequest generates a "aws/request.Request" representing the -// client's request for the UpdateFunctionCode operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateFunctionCode for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateFunctionCode method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateFunctionCodeRequest method. -// req, resp := client.UpdateFunctionCodeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req *request.Request, output *FunctionConfiguration) { - op := &request.Operation{ - Name: opUpdateFunctionCode, - HTTPMethod: "PUT", - HTTPPath: "/2015-03-31/functions/{FunctionName}/code", - } - - if input == nil { - input = &UpdateFunctionCodeInput{} - } - - output = &FunctionConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// UpdateFunctionCode API operation for AWS Lambda. -// -// Updates the code for the specified Lambda function. This operation must only -// be used on an existing Lambda function and cannot be used to update the function -// configuration. -// -// If you are using the versioning feature, note this API will always update -// the $LATEST version of your Lambda function. For information about the versioning -// feature, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:UpdateFunctionCode action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation UpdateFunctionCode for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeCodeStorageExceededException "CodeStorageExceededException" -// You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html) -// -func (c *Lambda) UpdateFunctionCode(input *UpdateFunctionCodeInput) (*FunctionConfiguration, error) { - req, out := c.UpdateFunctionCodeRequest(input) - err := req.Send() - return out, err -} - -const opUpdateFunctionConfiguration = "UpdateFunctionConfiguration" - -// UpdateFunctionConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateFunctionConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateFunctionConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateFunctionConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateFunctionConfigurationRequest method. -// req, resp := client.UpdateFunctionConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration) { - op := &request.Operation{ - Name: opUpdateFunctionConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/2015-03-31/functions/{FunctionName}/configuration", - } - - if input == nil { - input = &UpdateFunctionConfigurationInput{} - } - - output = &FunctionConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// UpdateFunctionConfiguration API operation for AWS Lambda. -// -// Updates the configuration parameters for the specified Lambda function by -// using the values provided in the request. You provide only the parameters -// you want to change. This operation must only be used on an existing Lambda -// function and cannot be used to update the function's code. -// -// If you are using the versioning feature, note this API will always update -// the $LATEST version of your Lambda function. For information about the versioning -// feature, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html). -// -// This operation requires permission for the lambda:UpdateFunctionConfiguration -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Lambda's -// API operation UpdateFunctionConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One of the parameters in the request is invalid. For example, if you provided -// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration -// API, that AWS Lambda is unable to assume you will get this exception. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -func (c *Lambda) UpdateFunctionConfiguration(input *UpdateFunctionConfigurationInput) (*FunctionConfiguration, error) { - req, out := c.UpdateFunctionConfigurationRequest(input) - err := req.Send() - return out, err -} - -// Provides limits of code size and concurrency associated with the current -// account and region. -type AccountLimit struct { - _ struct{} `type:"structure"` - - // Size, in bytes, of code/dependencies that you can zip into a deployment package - // (uncompressed zip/jar size) for uploading. The default limit is 250 MB. - CodeSizeUnzipped *int64 `type:"long"` - - // Size, in bytes, of a single zipped code/dependencies package you can upload - // for your Lambda function(.zip/.jar file). Try using Amazon S3 for uploading - // larger files. Default limit is 50 MB. - CodeSizeZipped *int64 `type:"long"` - - // Number of simultaneous executions of your function per region. For more information - // or to request a limit increase for concurrent executions, see Lambda Function - // Concurrent Executions (http://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html). - // The default limit is 100. - ConcurrentExecutions *int64 `type:"integer"` - - // Maximum size, in megabytes, of a code package you can upload per region. - // The default size is 75 GB. - TotalCodeSize *int64 `type:"long"` -} - -// String returns the string representation -func (s AccountLimit) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountLimit) GoString() string { - return s.String() -} - -// SetCodeSizeUnzipped sets the CodeSizeUnzipped field's value. -func (s *AccountLimit) SetCodeSizeUnzipped(v int64) *AccountLimit { - s.CodeSizeUnzipped = &v - return s -} - -// SetCodeSizeZipped sets the CodeSizeZipped field's value. -func (s *AccountLimit) SetCodeSizeZipped(v int64) *AccountLimit { - s.CodeSizeZipped = &v - return s -} - -// SetConcurrentExecutions sets the ConcurrentExecutions field's value. -func (s *AccountLimit) SetConcurrentExecutions(v int64) *AccountLimit { - s.ConcurrentExecutions = &v - return s -} - -// SetTotalCodeSize sets the TotalCodeSize field's value. -func (s *AccountLimit) SetTotalCodeSize(v int64) *AccountLimit { - s.TotalCodeSize = &v - return s -} - -// Provides code size usage and function count associated with the current account -// and region. -type AccountUsage struct { - _ struct{} `type:"structure"` - - // The number of your account's existing functions per region. - FunctionCount *int64 `type:"long"` - - // Total size, in bytes, of the account's deployment packages per region. - TotalCodeSize *int64 `type:"long"` -} - -// String returns the string representation -func (s AccountUsage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountUsage) GoString() string { - return s.String() -} - -// SetFunctionCount sets the FunctionCount field's value. -func (s *AccountUsage) SetFunctionCount(v int64) *AccountUsage { - s.FunctionCount = &v - return s -} - -// SetTotalCodeSize sets the TotalCodeSize field's value. -func (s *AccountUsage) SetTotalCodeSize(v int64) *AccountUsage { - s.TotalCodeSize = &v - return s -} - -type AddPermissionInput struct { - _ struct{} `type:"structure"` - - // The AWS Lambda action you want to allow in this statement. Each Lambda action - // is a string starting with lambda: followed by the API name . For example, - // lambda:CreateFunction. You can use wildcard (lambda:*) to grant permission - // for all AWS Lambda actions. - // - // Action is a required field - Action *string `type:"string" required:"true"` - - // A unique token that must be supplied by the principal invoking the function. - // This is currently only used for Alexa Smart Home functions. - EventSourceToken *string `type:"string"` - - // Name of the Lambda function whose resource policy you are updating by adding - // a new permission. - // - // You can specify a function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // The principal who is getting this permission. It can be Amazon S3 service - // Principal (s3.amazonaws.com) if you want Amazon S3 to invoke the function, - // an AWS account ID if you are granting cross-account permission, or any valid - // AWS service principal such as sns.amazonaws.com. For example, you might want - // to allow a custom application in another AWS account to push events to AWS - // Lambda by invoking your function. - // - // Principal is a required field - Principal *string `type:"string" required:"true"` - - // You can use this optional query parameter to describe a qualified ARN using - // a function version or an alias name. The permission will then apply to the - // specific qualified ARN. For example, if you specify function version 2 as - // the qualifier, then permission applies only when request is made using qualified - // function ARN: - // - // arn:aws:lambda:aws-region:acct-id:function:function-name:2 - // - // If you specify an alias name, for example PROD, then the permission is valid - // only for requests made using the alias ARN: - // - // arn:aws:lambda:aws-region:acct-id:function:function-name:PROD - // - // If the qualifier is not specified, the permission is valid only when requests - // is made using unqualified function ARN. - // - // arn:aws:lambda:aws-region:acct-id:function:function-name - Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` - - // This parameter is used for S3, SES, CloudWatch Logs and CloudWatch Rules - // only. The AWS account ID (without a hyphen) of the source owner. For example, - // if the SourceArn identifies a bucket, then this is the bucket owner's account - // ID. You can use this additional condition to ensure the bucket you specify - // is owned by a specific account (it is possible the bucket owner deleted the - // bucket and some other AWS account created the bucket). You can also use this - // condition to specify all sources (that is, you don't specify the SourceArn) - // owned by a specific account. - SourceAccount *string `type:"string"` - - // This is optional; however, when granting Amazon S3 permission to invoke your - // function, you should specify this field with the Amazon Resource Name (ARN) - // as its value. This ensures that only events generated from the specified - // source can invoke the function. - // - // If you add a permission for the Amazon S3 principal without providing the - // source ARN, any AWS account that creates a mapping to your function ARN can - // send events to invoke your Lambda function from Amazon S3. - SourceArn *string `type:"string"` - - // A unique statement identifier. - // - // StatementId is a required field - StatementId *string `min:"1" 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.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Principal == nil { - invalidParams.Add(request.NewErrParamRequired("Principal")) - } - if s.Qualifier != nil && len(*s.Qualifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) - } - if s.StatementId == nil { - invalidParams.Add(request.NewErrParamRequired("StatementId")) - } - if s.StatementId != nil && len(*s.StatementId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StatementId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *AddPermissionInput) SetAction(v string) *AddPermissionInput { - s.Action = &v - return s -} - -// SetEventSourceToken sets the EventSourceToken field's value. -func (s *AddPermissionInput) SetEventSourceToken(v string) *AddPermissionInput { - s.EventSourceToken = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *AddPermissionInput) SetFunctionName(v string) *AddPermissionInput { - s.FunctionName = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *AddPermissionInput) SetPrincipal(v string) *AddPermissionInput { - s.Principal = &v - return s -} - -// SetQualifier sets the Qualifier field's value. -func (s *AddPermissionInput) SetQualifier(v string) *AddPermissionInput { - s.Qualifier = &v - return s -} - -// SetSourceAccount sets the SourceAccount field's value. -func (s *AddPermissionInput) SetSourceAccount(v string) *AddPermissionInput { - s.SourceAccount = &v - return s -} - -// SetSourceArn sets the SourceArn field's value. -func (s *AddPermissionInput) SetSourceArn(v string) *AddPermissionInput { - s.SourceArn = &v - return s -} - -// SetStatementId sets the StatementId field's value. -func (s *AddPermissionInput) SetStatementId(v string) *AddPermissionInput { - s.StatementId = &v - return s -} - -type AddPermissionOutput struct { - _ struct{} `type:"structure"` - - // The permission statement you specified in the request. The response returns - // the same as a string using a backslash ("\") as an escape character in the - // JSON. - Statement *string `type:"string"` -} - -// 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() -} - -// SetStatement sets the Statement field's value. -func (s *AddPermissionOutput) SetStatement(v string) *AddPermissionOutput { - s.Statement = &v - return s -} - -// Provides configuration information about a Lambda function version alias. -type AliasConfiguration struct { - _ struct{} `type:"structure"` - - // Lambda function ARN that is qualified using the alias name as the suffix. - // For example, if you create an alias called BETA that points to a helloworld - // function version, the ARN is arn:aws:lambda:aws-regions:acct-id:function:helloworld:BETA. - AliasArn *string `type:"string"` - - // Alias description. - Description *string `type:"string"` - - // Function version to which the alias points. - FunctionVersion *string `min:"1" type:"string"` - - // Alias name. - Name *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s AliasConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AliasConfiguration) GoString() string { - return s.String() -} - -// SetAliasArn sets the AliasArn field's value. -func (s *AliasConfiguration) SetAliasArn(v string) *AliasConfiguration { - s.AliasArn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AliasConfiguration) SetDescription(v string) *AliasConfiguration { - s.Description = &v - return s -} - -// SetFunctionVersion sets the FunctionVersion field's value. -func (s *AliasConfiguration) SetFunctionVersion(v string) *AliasConfiguration { - s.FunctionVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *AliasConfiguration) SetName(v string) *AliasConfiguration { - s.Name = &v - return s -} - -type CreateAliasInput struct { - _ struct{} `type:"structure"` - - // Description of the alias. - Description *string `type:"string"` - - // Name of the Lambda function for which you want to create an alias. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // Lambda function version for which you are creating the alias. - // - // FunctionVersion is a required field - FunctionVersion *string `min:"1" type:"string" required:"true"` - - // Name for the alias you are creating. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.FunctionVersion == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionVersion")) - } - if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateAliasInput) SetDescription(v string) *CreateAliasInput { - s.Description = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *CreateAliasInput) SetFunctionName(v string) *CreateAliasInput { - s.FunctionName = &v - return s -} - -// SetFunctionVersion sets the FunctionVersion field's value. -func (s *CreateAliasInput) SetFunctionVersion(v string) *CreateAliasInput { - s.FunctionVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAliasInput) SetName(v string) *CreateAliasInput { - s.Name = &v - return s -} - -type CreateEventSourceMappingInput struct { - _ struct{} `type:"structure"` - - // The largest number of records that AWS Lambda will retrieve from your event - // source at the time of invoking your function. Your function receives an event - // with all the retrieved records. The default is 100 records. - BatchSize *int64 `min:"1" type:"integer"` - - // Indicates whether AWS Lambda should begin polling the event source. By default, - // Enabled is true. - Enabled *bool `type:"boolean"` - - // The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon DynamoDB - // stream that is the event source. Any record added to this stream could cause - // AWS Lambda to invoke your Lambda function, it depends on the BatchSize. AWS - // Lambda POSTs the Amazon Kinesis event, containing records, to your Lambda - // function as JSON. - // - // EventSourceArn is a required field - EventSourceArn *string `type:"string" required:"true"` - - // The Lambda function to invoke when AWS Lambda detects an event on the stream. - // - // You can specify the function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // - // If you are using versioning, you can also provide a qualified function ARN - // (ARN that is qualified with function version or alias name as suffix). For - // more information about versioning, see AWS Lambda Function Versioning and - // Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) - // - // AWS Lambda also allows you to specify only the function name with the account - // ID qualifier (for example, account-id:Thumbnail). - // - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `min:"1" type:"string" required:"true"` - - // The position in the stream where AWS Lambda should start reading. Valid only - // for Kinesis streams. For more information, see ShardIteratorType (http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType) - // in the Amazon Kinesis API Reference. - // - // StartingPosition is a required field - StartingPosition *string `type:"string" required:"true" enum:"EventSourcePosition"` - - // The timestamp of the data record from which to start reading. Used with shard - // iterator type (http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType) - // AT_TIMESTAMP. 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). Valid only for Kinesis streams. - StartingPositionTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s CreateEventSourceMappingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEventSourceMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEventSourceMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEventSourceMappingInput"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.EventSourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("EventSourceArn")) - } - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.StartingPosition == nil { - invalidParams.Add(request.NewErrParamRequired("StartingPosition")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *CreateEventSourceMappingInput) SetBatchSize(v int64) *CreateEventSourceMappingInput { - s.BatchSize = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *CreateEventSourceMappingInput) SetEnabled(v bool) *CreateEventSourceMappingInput { - s.Enabled = &v - return s -} - -// SetEventSourceArn sets the EventSourceArn field's value. -func (s *CreateEventSourceMappingInput) SetEventSourceArn(v string) *CreateEventSourceMappingInput { - s.EventSourceArn = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *CreateEventSourceMappingInput) SetFunctionName(v string) *CreateEventSourceMappingInput { - s.FunctionName = &v - return s -} - -// SetStartingPosition sets the StartingPosition field's value. -func (s *CreateEventSourceMappingInput) SetStartingPosition(v string) *CreateEventSourceMappingInput { - s.StartingPosition = &v - return s -} - -// SetStartingPositionTimestamp sets the StartingPositionTimestamp field's value. -func (s *CreateEventSourceMappingInput) SetStartingPositionTimestamp(v time.Time) *CreateEventSourceMappingInput { - s.StartingPositionTimestamp = &v - return s -} - -type CreateFunctionInput struct { - _ struct{} `type:"structure"` - - // The code for the Lambda function. - // - // Code is a required field - Code *FunctionCode `type:"structure" required:"true"` - - // The parent object that contains the target Amazon Resource Name (ARN) of - // an Amazon SQS queue or Amazon SNS topic. - DeadLetterConfig *DeadLetterConfig `type:"structure"` - - // A short, user-defined function description. Lambda does not use this value. - // Assign a meaningful description as you see fit. - Description *string `type:"string"` - - // The parent object that contains your environment's configuration settings. - Environment *Environment `type:"structure"` - - // The name you want to assign to the function you are uploading. The function - // names appear in the console and are returned in the ListFunctions API. Function - // names are used to specify functions to other AWS Lambda API operations, such - // as Invoke. - // - // FunctionName is a required field - FunctionName *string `min:"1" type:"string" required:"true"` - - // The function within your code that Lambda calls to begin execution. For Node.js, - // it is the module-name.export value in your function. For Java, it can be - // package.class-name::handler or package.class-name. For more information, - // see Lambda Function Handler (Java) (http://docs.aws.amazon.com/lambda/latest/dg/java-programming-model-handler-types.html). - // - // Handler is a required field - Handler *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the KMS key used to encrypt your function's - // environment variables. If not provided, AWS Lambda will use a default service - // key. - KMSKeyArn *string `type:"string"` - - // The amount of memory, in MB, your Lambda function is given. Lambda uses this - // memory size to infer the amount of CPU and memory allocated to your function. - // Your function use-case determines your CPU and memory requirements. For example, - // a database operation might need less memory compared to an image processing - // function. The default value is 128 MB. The value must be a multiple of 64 - // MB. - MemorySize *int64 `min:"128" type:"integer"` - - // This boolean parameter can be used to request AWS Lambda to create the Lambda - // function and publish a version as an atomic operation. - Publish *bool `type:"boolean"` - - // The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it - // executes your function to access any other Amazon Web Services (AWS) resources. - // For more information, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html). - // - // Role is a required field - Role *string `type:"string" required:"true"` - - // The runtime environment for the Lambda function you are uploading. - // - // To use the Node.js runtime v4.3, set the value to "nodejs4.3". To use earlier - // runtime (v0.10.42), set the value to "nodejs". - // - // You can no longer create functions using the v0.10.42 runtime version as - // of November, 2016. Existing functions will be supported until early 2017, - // but we recommend you migrate them to nodejs4.3 runtime version as soon as - // possible. - // - // Runtime is a required field - Runtime *string `type:"string" required:"true" enum:"Runtime"` - - // The function execution time at which Lambda should terminate the function. - // Because the execution time has cost implications, we recommend you set this - // value based on your expected execution time. The default is 3 seconds. - Timeout *int64 `min:"1" type:"integer"` - - // If your Lambda function accesses resources in a VPC, you provide this parameter - // identifying the list of security group IDs and subnet IDs. These must belong - // to the same VPC. You must provide at least one security group and one subnet - // ID. - VpcConfig *VpcConfig `type:"structure"` -} - -// String returns the string representation -func (s CreateFunctionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFunctionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFunctionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFunctionInput"} - if s.Code == nil { - invalidParams.Add(request.NewErrParamRequired("Code")) - } - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Handler == nil { - invalidParams.Add(request.NewErrParamRequired("Handler")) - } - if s.MemorySize != nil && *s.MemorySize < 128 { - invalidParams.Add(request.NewErrParamMinValue("MemorySize", 128)) - } - if s.Role == nil { - invalidParams.Add(request.NewErrParamRequired("Role")) - } - if s.Runtime == nil { - invalidParams.Add(request.NewErrParamRequired("Runtime")) - } - if s.Timeout != nil && *s.Timeout < 1 { - invalidParams.Add(request.NewErrParamMinValue("Timeout", 1)) - } - if s.Code != nil { - if err := s.Code.Validate(); err != nil { - invalidParams.AddNested("Code", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCode sets the Code field's value. -func (s *CreateFunctionInput) SetCode(v *FunctionCode) *CreateFunctionInput { - s.Code = v - return s -} - -// SetDeadLetterConfig sets the DeadLetterConfig field's value. -func (s *CreateFunctionInput) SetDeadLetterConfig(v *DeadLetterConfig) *CreateFunctionInput { - s.DeadLetterConfig = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateFunctionInput) SetDescription(v string) *CreateFunctionInput { - s.Description = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *CreateFunctionInput) SetEnvironment(v *Environment) *CreateFunctionInput { - s.Environment = v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *CreateFunctionInput) SetFunctionName(v string) *CreateFunctionInput { - s.FunctionName = &v - return s -} - -// SetHandler sets the Handler field's value. -func (s *CreateFunctionInput) SetHandler(v string) *CreateFunctionInput { - s.Handler = &v - return s -} - -// SetKMSKeyArn sets the KMSKeyArn field's value. -func (s *CreateFunctionInput) SetKMSKeyArn(v string) *CreateFunctionInput { - s.KMSKeyArn = &v - return s -} - -// SetMemorySize sets the MemorySize field's value. -func (s *CreateFunctionInput) SetMemorySize(v int64) *CreateFunctionInput { - s.MemorySize = &v - return s -} - -// SetPublish sets the Publish field's value. -func (s *CreateFunctionInput) SetPublish(v bool) *CreateFunctionInput { - s.Publish = &v - return s -} - -// SetRole sets the Role field's value. -func (s *CreateFunctionInput) SetRole(v string) *CreateFunctionInput { - s.Role = &v - return s -} - -// SetRuntime sets the Runtime field's value. -func (s *CreateFunctionInput) SetRuntime(v string) *CreateFunctionInput { - s.Runtime = &v - return s -} - -// SetTimeout sets the Timeout field's value. -func (s *CreateFunctionInput) SetTimeout(v int64) *CreateFunctionInput { - s.Timeout = &v - return s -} - -// SetVpcConfig sets the VpcConfig field's value. -func (s *CreateFunctionInput) SetVpcConfig(v *VpcConfig) *CreateFunctionInput { - s.VpcConfig = v - return s -} - -// The parent object that contains the target Amazon Resource Name (ARN) of -// an Amazon SQS queue or Amazon SNS topic. -type DeadLetterConfig struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic - // you specify as your Dead Letter Queue (DLQ). - TargetArn *string `type:"string"` -} - -// String returns the string representation -func (s DeadLetterConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeadLetterConfig) GoString() string { - return s.String() -} - -// SetTargetArn sets the TargetArn field's value. -func (s *DeadLetterConfig) SetTargetArn(v string) *DeadLetterConfig { - s.TargetArn = &v - return s -} - -type DeleteAliasInput struct { - _ struct{} `type:"structure"` - - // The Lambda function name for which the alias is created. Deleting an alias - // does not delete the function version to which it is pointing. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // Name of the alias to delete. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *DeleteAliasInput) SetFunctionName(v string) *DeleteAliasInput { - s.FunctionName = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteAliasInput) SetName(v string) *DeleteAliasInput { - s.Name = &v - return s -} - -type DeleteAliasOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAliasOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAliasOutput) GoString() string { - return s.String() -} - -type DeleteEventSourceMappingInput struct { - _ struct{} `type:"structure"` - - // The event source mapping ID. - // - // UUID is a required field - UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEventSourceMappingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEventSourceMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEventSourceMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEventSourceMappingInput"} - if s.UUID == nil { - invalidParams.Add(request.NewErrParamRequired("UUID")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUUID sets the UUID field's value. -func (s *DeleteEventSourceMappingInput) SetUUID(v string) *DeleteEventSourceMappingInput { - s.UUID = &v - return s -} - -type DeleteFunctionInput struct { - _ struct{} `type:"structure"` - - // The Lambda function to delete. - // - // You can specify the function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // If you are using versioning, you can also provide a qualified function ARN - // (ARN that is qualified with function version or alias name as suffix). AWS - // Lambda also allows you to specify only the function name with the account - // ID qualifier (for example, account-id:Thumbnail). Note that the length constraint - // applies only to the ARN. If you specify only the function name, it is limited - // to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // Using this optional parameter you can specify a function version (but not - // the $LATEST version) to direct AWS Lambda to delete a specific function version. - // If the function version has one or more aliases pointing to it, you will - // get an error because you cannot have aliases pointing to it. You can delete - // any function version but not the $LATEST, that is, you cannot specify $LATEST - // as the value of this parameter. The $LATEST version can be deleted only when - // you want to delete all the function versions and aliases. - // - // You can only specify a function version, not an alias name, using this parameter. - // You cannot delete a function version using its alias. - // - // If you don't specify this parameter, AWS Lambda will delete the function, - // including all of its versions and aliases. - Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteFunctionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFunctionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFunctionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFunctionInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Qualifier != nil && len(*s.Qualifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *DeleteFunctionInput) SetFunctionName(v string) *DeleteFunctionInput { - s.FunctionName = &v - return s -} - -// SetQualifier sets the Qualifier field's value. -func (s *DeleteFunctionInput) SetQualifier(v string) *DeleteFunctionInput { - s.Qualifier = &v - return s -} - -type DeleteFunctionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteFunctionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFunctionOutput) GoString() string { - return s.String() -} - -// The parent object that contains your environment's configuration settings. -type Environment struct { - _ struct{} `type:"structure"` - - // The key-value pairs that represent your environment's configuration settings. - // The value you specify cannot contain a ",". - Variables map[string]*string `type:"map"` -} - -// String returns the string representation -func (s Environment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Environment) GoString() string { - return s.String() -} - -// SetVariables sets the Variables field's value. -func (s *Environment) SetVariables(v map[string]*string) *Environment { - s.Variables = v - return s -} - -// The parent object that contains error information associated with your configuration -// settings. -type EnvironmentError struct { - _ struct{} `type:"structure"` - - // The error code returned by the environment error object. - ErrorCode *string `type:"string"` - - // The message returned by the environment error object. - Message *string `type:"string"` -} - -// String returns the string representation -func (s EnvironmentError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentError) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *EnvironmentError) SetErrorCode(v string) *EnvironmentError { - s.ErrorCode = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *EnvironmentError) SetMessage(v string) *EnvironmentError { - s.Message = &v - return s -} - -// The parent object returned that contains your environment's configuration -// settings or any error information associated with your configuration settings. -type EnvironmentResponse struct { - _ struct{} `type:"structure"` - - // The parent object that contains error information associated with your configuration - // settings. - Error *EnvironmentError `type:"structure"` - - // The key-value pairs returned that represent your environment's configuration - // settings or error information. - Variables map[string]*string `type:"map"` -} - -// String returns the string representation -func (s EnvironmentResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentResponse) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *EnvironmentResponse) SetError(v *EnvironmentError) *EnvironmentResponse { - s.Error = v - return s -} - -// SetVariables sets the Variables field's value. -func (s *EnvironmentResponse) SetVariables(v map[string]*string) *EnvironmentResponse { - s.Variables = v - return s -} - -// Describes mapping between an Amazon Kinesis stream and a Lambda function. -type EventSourceMappingConfiguration struct { - _ struct{} `type:"structure"` - - // The largest number of records that AWS Lambda will retrieve from your event - // source at the time of invoking your function. Your function receives an event - // with all the retrieved records. - BatchSize *int64 `min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the source - // of events. - EventSourceArn *string `type:"string"` - - // The Lambda function to invoke when AWS Lambda detects an event on the stream. - FunctionArn *string `type:"string"` - - // The UTC time string indicating the last time the event mapping was updated. - LastModified *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The result of the last AWS Lambda invocation of your Lambda function. - LastProcessingResult *string `type:"string"` - - // The state of the event source mapping. It can be Creating, Enabled, Disabled, - // Enabling, Disabling, Updating, or Deleting. - State *string `type:"string"` - - // The reason the event source mapping is in its current state. It is either - // user-requested or an AWS Lambda-initiated state transition. - StateTransitionReason *string `type:"string"` - - // The AWS Lambda assigned opaque identifier for the mapping. - UUID *string `type:"string"` -} - -// String returns the string representation -func (s EventSourceMappingConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventSourceMappingConfiguration) GoString() string { - return s.String() -} - -// SetBatchSize sets the BatchSize field's value. -func (s *EventSourceMappingConfiguration) SetBatchSize(v int64) *EventSourceMappingConfiguration { - s.BatchSize = &v - return s -} - -// SetEventSourceArn sets the EventSourceArn field's value. -func (s *EventSourceMappingConfiguration) SetEventSourceArn(v string) *EventSourceMappingConfiguration { - s.EventSourceArn = &v - return s -} - -// SetFunctionArn sets the FunctionArn field's value. -func (s *EventSourceMappingConfiguration) SetFunctionArn(v string) *EventSourceMappingConfiguration { - s.FunctionArn = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *EventSourceMappingConfiguration) SetLastModified(v time.Time) *EventSourceMappingConfiguration { - s.LastModified = &v - return s -} - -// SetLastProcessingResult sets the LastProcessingResult field's value. -func (s *EventSourceMappingConfiguration) SetLastProcessingResult(v string) *EventSourceMappingConfiguration { - s.LastProcessingResult = &v - return s -} - -// SetState sets the State field's value. -func (s *EventSourceMappingConfiguration) SetState(v string) *EventSourceMappingConfiguration { - s.State = &v - return s -} - -// SetStateTransitionReason sets the StateTransitionReason field's value. -func (s *EventSourceMappingConfiguration) SetStateTransitionReason(v string) *EventSourceMappingConfiguration { - s.StateTransitionReason = &v - return s -} - -// SetUUID sets the UUID field's value. -func (s *EventSourceMappingConfiguration) SetUUID(v string) *EventSourceMappingConfiguration { - s.UUID = &v - return s -} - -// The code for the Lambda function. -type FunctionCode struct { - _ struct{} `type:"structure"` - - // Amazon S3 bucket name where the .zip file containing your deployment package - // is stored. This bucket must reside in the same AWS region where you are creating - // the Lambda function. - S3Bucket *string `min:"3" type:"string"` - - // The Amazon S3 object (the deployment package) key name you want to upload. - S3Key *string `min:"1" type:"string"` - - // The Amazon S3 object (the deployment package) version you want to upload. - S3ObjectVersion *string `min:"1" type:"string"` - - // The contents of your zip file containing your deployment package. If you - // are using the web API directly, the contents of the zip file must be base64-encoded. - // If you are using the AWS SDKs or the AWS CLI, the SDKs or CLI will do the - // encoding for you. For more information about creating a .zip file, see Execution - // Permissions (http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role.html) - // in the AWS Lambda Developer Guide. - // - // ZipFile is automatically base64 encoded/decoded by the SDK. - ZipFile []byte `type:"blob"` -} - -// String returns the string representation -func (s FunctionCode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FunctionCode) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FunctionCode) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FunctionCode"} - if s.S3Bucket != nil && len(*s.S3Bucket) < 3 { - invalidParams.Add(request.NewErrParamMinLen("S3Bucket", 3)) - } - if s.S3Key != nil && len(*s.S3Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3Key", 1)) - } - if s.S3ObjectVersion != nil && len(*s.S3ObjectVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3ObjectVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *FunctionCode) SetS3Bucket(v string) *FunctionCode { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *FunctionCode) SetS3Key(v string) *FunctionCode { - s.S3Key = &v - return s -} - -// SetS3ObjectVersion sets the S3ObjectVersion field's value. -func (s *FunctionCode) SetS3ObjectVersion(v string) *FunctionCode { - s.S3ObjectVersion = &v - return s -} - -// SetZipFile sets the ZipFile field's value. -func (s *FunctionCode) SetZipFile(v []byte) *FunctionCode { - s.ZipFile = v - return s -} - -// The object for the Lambda function location. -type FunctionCodeLocation struct { - _ struct{} `type:"structure"` - - // The presigned URL you can use to download the function's .zip file that you - // previously uploaded. The URL is valid for up to 10 minutes. - Location *string `type:"string"` - - // The repository from which you can download the function. - RepositoryType *string `type:"string"` -} - -// String returns the string representation -func (s FunctionCodeLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FunctionCodeLocation) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *FunctionCodeLocation) SetLocation(v string) *FunctionCodeLocation { - s.Location = &v - return s -} - -// SetRepositoryType sets the RepositoryType field's value. -func (s *FunctionCodeLocation) SetRepositoryType(v string) *FunctionCodeLocation { - s.RepositoryType = &v - return s -} - -// A complex type that describes function metadata. -type FunctionConfiguration struct { - _ struct{} `type:"structure"` - - // It is the SHA256 hash of your function deployment package. - CodeSha256 *string `type:"string"` - - // The size, in bytes, of the function .zip file you uploaded. - CodeSize *int64 `type:"long"` - - // The parent object that contains the target Amazon Resource Name (ARN) of - // an Amazon SQS queue or Amazon SNS topic. - DeadLetterConfig *DeadLetterConfig `type:"structure"` - - // The user-provided description. - Description *string `type:"string"` - - // The parent object that contains your environment's configuration settings. - Environment *EnvironmentResponse `type:"structure"` - - // The Amazon Resource Name (ARN) assigned to the function. - FunctionArn *string `type:"string"` - - // The name of the function. - FunctionName *string `min:"1" type:"string"` - - // The function Lambda calls to begin executing your function. - Handler *string `type:"string"` - - // The Amazon Resource Name (ARN) of the KMS key used to encrypt your function's - // environment variables. If empty, it means you are using the AWS Lambda default - // service key. - KMSKeyArn *string `type:"string"` - - // The time stamp of the last time you updated the function. - LastModified *string `type:"string"` - - // The memory size, in MB, you configured for the function. Must be a multiple - // of 64 MB. - MemorySize *int64 `min:"128" type:"integer"` - - // The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it - // executes your function to access any other Amazon Web Services (AWS) resources. - Role *string `type:"string"` - - // The runtime environment for the Lambda function. - // - // To use the Node.js runtime v4.3, set the value to "nodejs4.3". To use earlier - // runtime (v0.10.42), set the value to "nodejs". - Runtime *string `type:"string" enum:"Runtime"` - - // The function execution time at which Lambda should terminate the function. - // Because the execution time has cost implications, we recommend you set this - // value based on your expected execution time. The default is 3 seconds. - Timeout *int64 `min:"1" type:"integer"` - - // The version of the Lambda function. - Version *string `min:"1" type:"string"` - - // VPC configuration associated with your Lambda function. - VpcConfig *VpcConfigResponse `type:"structure"` -} - -// String returns the string representation -func (s FunctionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FunctionConfiguration) GoString() string { - return s.String() -} - -// SetCodeSha256 sets the CodeSha256 field's value. -func (s *FunctionConfiguration) SetCodeSha256(v string) *FunctionConfiguration { - s.CodeSha256 = &v - return s -} - -// SetCodeSize sets the CodeSize field's value. -func (s *FunctionConfiguration) SetCodeSize(v int64) *FunctionConfiguration { - s.CodeSize = &v - return s -} - -// SetDeadLetterConfig sets the DeadLetterConfig field's value. -func (s *FunctionConfiguration) SetDeadLetterConfig(v *DeadLetterConfig) *FunctionConfiguration { - s.DeadLetterConfig = v - return s -} - -// SetDescription sets the Description field's value. -func (s *FunctionConfiguration) SetDescription(v string) *FunctionConfiguration { - s.Description = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *FunctionConfiguration) SetEnvironment(v *EnvironmentResponse) *FunctionConfiguration { - s.Environment = v - return s -} - -// SetFunctionArn sets the FunctionArn field's value. -func (s *FunctionConfiguration) SetFunctionArn(v string) *FunctionConfiguration { - s.FunctionArn = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *FunctionConfiguration) SetFunctionName(v string) *FunctionConfiguration { - s.FunctionName = &v - return s -} - -// SetHandler sets the Handler field's value. -func (s *FunctionConfiguration) SetHandler(v string) *FunctionConfiguration { - s.Handler = &v - return s -} - -// SetKMSKeyArn sets the KMSKeyArn field's value. -func (s *FunctionConfiguration) SetKMSKeyArn(v string) *FunctionConfiguration { - s.KMSKeyArn = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *FunctionConfiguration) SetLastModified(v string) *FunctionConfiguration { - s.LastModified = &v - return s -} - -// SetMemorySize sets the MemorySize field's value. -func (s *FunctionConfiguration) SetMemorySize(v int64) *FunctionConfiguration { - s.MemorySize = &v - return s -} - -// SetRole sets the Role field's value. -func (s *FunctionConfiguration) SetRole(v string) *FunctionConfiguration { - s.Role = &v - return s -} - -// SetRuntime sets the Runtime field's value. -func (s *FunctionConfiguration) SetRuntime(v string) *FunctionConfiguration { - s.Runtime = &v - return s -} - -// SetTimeout sets the Timeout field's value. -func (s *FunctionConfiguration) SetTimeout(v int64) *FunctionConfiguration { - s.Timeout = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *FunctionConfiguration) SetVersion(v string) *FunctionConfiguration { - s.Version = &v - return s -} - -// SetVpcConfig sets the VpcConfig field's value. -func (s *FunctionConfiguration) SetVpcConfig(v *VpcConfigResponse) *FunctionConfiguration { - s.VpcConfig = v - return s -} - -type GetAccountSettingsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetAccountSettingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountSettingsInput) GoString() string { - return s.String() -} - -type GetAccountSettingsOutput struct { - _ struct{} `type:"structure"` - - // Provides limits of code size and concurrency associated with the current - // account and region. - AccountLimit *AccountLimit `type:"structure"` - - // Provides code size usage and function count associated with the current account - // and region. - AccountUsage *AccountUsage `type:"structure"` -} - -// String returns the string representation -func (s GetAccountSettingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccountSettingsOutput) GoString() string { - return s.String() -} - -// SetAccountLimit sets the AccountLimit field's value. -func (s *GetAccountSettingsOutput) SetAccountLimit(v *AccountLimit) *GetAccountSettingsOutput { - s.AccountLimit = v - return s -} - -// SetAccountUsage sets the AccountUsage field's value. -func (s *GetAccountSettingsOutput) SetAccountUsage(v *AccountUsage) *GetAccountSettingsOutput { - s.AccountUsage = v - return s -} - -type GetAliasInput struct { - _ struct{} `type:"structure"` - - // Function name for which the alias is created. An alias is a subresource that - // exists only in the context of an existing Lambda function so you must specify - // the function name. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // Name of the alias for which you want to retrieve information. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAliasInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *GetAliasInput) SetFunctionName(v string) *GetAliasInput { - s.FunctionName = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetAliasInput) SetName(v string) *GetAliasInput { - s.Name = &v - return s -} - -type GetEventSourceMappingInput struct { - _ struct{} `type:"structure"` - - // The AWS Lambda assigned ID of the event source mapping. - // - // UUID is a required field - UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetEventSourceMappingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetEventSourceMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEventSourceMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEventSourceMappingInput"} - if s.UUID == nil { - invalidParams.Add(request.NewErrParamRequired("UUID")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUUID sets the UUID field's value. -func (s *GetEventSourceMappingInput) SetUUID(v string) *GetEventSourceMappingInput { - s.UUID = &v - return s -} - -type GetFunctionConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the Lambda function for which you want to retrieve the configuration - // information. - // - // You can specify a function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // Using this optional parameter you can specify a function version or an alias - // name. If you specify function version, the API uses qualified function ARN - // and returns information about the specific function version. If you specify - // an alias name, the API uses the alias ARN and returns information about the - // function version to which the alias points. - // - // If you don't specify this parameter, the API uses unqualified function ARN, - // and returns information about the $LATEST function version. - Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetFunctionConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetFunctionConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFunctionConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFunctionConfigurationInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Qualifier != nil && len(*s.Qualifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *GetFunctionConfigurationInput) SetFunctionName(v string) *GetFunctionConfigurationInput { - s.FunctionName = &v - return s -} - -// SetQualifier sets the Qualifier field's value. -func (s *GetFunctionConfigurationInput) SetQualifier(v string) *GetFunctionConfigurationInput { - s.Qualifier = &v - return s -} - -type GetFunctionInput struct { - _ struct{} `type:"structure"` - - // The Lambda function name. - // - // You can specify a function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // Using this optional parameter to specify a function version or an alias name. - // If you specify function version, the API uses qualified function ARN for - // the request and returns information about the specific Lambda function version. - // If you specify an alias name, the API uses the alias ARN and returns information - // about the function version to which the alias points. If you don't provide - // this parameter, the API uses unqualified function ARN and returns information - // about the $LATEST version of the Lambda function. - Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetFunctionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetFunctionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFunctionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFunctionInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Qualifier != nil && len(*s.Qualifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *GetFunctionInput) SetFunctionName(v string) *GetFunctionInput { - s.FunctionName = &v - return s -} - -// SetQualifier sets the Qualifier field's value. -func (s *GetFunctionInput) SetQualifier(v string) *GetFunctionInput { - s.Qualifier = &v - return s -} - -// This response contains the object for the Lambda function location (see FunctionCodeLocation. -type GetFunctionOutput struct { - _ struct{} `type:"structure"` - - // The object for the Lambda function location. - Code *FunctionCodeLocation `type:"structure"` - - // A complex type that describes function metadata. - Configuration *FunctionConfiguration `type:"structure"` -} - -// String returns the string representation -func (s GetFunctionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetFunctionOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *GetFunctionOutput) SetCode(v *FunctionCodeLocation) *GetFunctionOutput { - s.Code = v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *GetFunctionOutput) SetConfiguration(v *FunctionConfiguration) *GetFunctionOutput { - s.Configuration = v - return s -} - -type GetPolicyInput struct { - _ struct{} `type:"structure"` - - // Function name whose resource policy you want to retrieve. - // - // You can specify the function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // If you are using versioning, you can also provide a qualified function ARN - // (ARN that is qualified with function version or alias name as suffix). AWS - // Lambda also allows you to specify only the function name with the account - // ID qualifier (for example, account-id:Thumbnail). Note that the length constraint - // applies only to the ARN. If you specify only the function name, it is limited - // to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // You can specify this optional query parameter to specify a function version - // or an alias name in which case this API will return all permissions associated - // with the specific qualified ARN. If you don't provide this parameter, the - // API will return permissions that apply to the unqualified function ARN. - Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPolicyInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Qualifier != nil && len(*s.Qualifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *GetPolicyInput) SetFunctionName(v string) *GetPolicyInput { - s.FunctionName = &v - return s -} - -// SetQualifier sets the Qualifier field's value. -func (s *GetPolicyInput) SetQualifier(v string) *GetPolicyInput { - s.Qualifier = &v - return s -} - -type GetPolicyOutput struct { - _ struct{} `type:"structure"` - - // The resource policy associated with the specified function. The response - // returns the same as a string using a backslash ("\") as an escape character - // in the JSON. - Policy *string `type:"string"` -} - -// String returns the string representation -func (s GetPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetPolicyOutput) SetPolicy(v string) *GetPolicyOutput { - s.Policy = &v - return s -} - -type InvokeAsyncInput struct { - _ struct{} `deprecated:"true" type:"structure" payload:"InvokeArgs"` - - // The Lambda function name. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // JSON that you want to provide to your Lambda function as input. - // - // InvokeArgs is a required field - InvokeArgs io.ReadSeeker `type:"blob" required:"true"` -} - -// String returns the string representation -func (s InvokeAsyncInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InvokeAsyncInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvokeAsyncInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvokeAsyncInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.InvokeArgs == nil { - invalidParams.Add(request.NewErrParamRequired("InvokeArgs")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *InvokeAsyncInput) SetFunctionName(v string) *InvokeAsyncInput { - s.FunctionName = &v - return s -} - -// SetInvokeArgs sets the InvokeArgs field's value. -func (s *InvokeAsyncInput) SetInvokeArgs(v io.ReadSeeker) *InvokeAsyncInput { - s.InvokeArgs = v - return s -} - -// Upon success, it returns empty response. Otherwise, throws an exception. -type InvokeAsyncOutput struct { - _ struct{} `deprecated:"true" type:"structure"` - - // It will be 202 upon success. - Status *int64 `location:"statusCode" type:"integer"` -} - -// String returns the string representation -func (s InvokeAsyncOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InvokeAsyncOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *InvokeAsyncOutput) SetStatus(v int64) *InvokeAsyncOutput { - s.Status = &v - return s -} - -type InvokeInput struct { - _ struct{} `type:"structure" payload:"Payload"` - - // Using the ClientContext you can pass client-specific information to the Lambda - // function you are invoking. You can then process the client information in - // your Lambda function as you choose through the context variable. For an example - // of a ClientContext JSON, see PutEvents (http://docs.aws.amazon.com/mobileanalytics/latest/ug/PutEvents.html) - // in the Amazon Mobile Analytics API Reference and User Guide. - // - // The ClientContext JSON must be base64-encoded. - ClientContext *string `location:"header" locationName:"X-Amz-Client-Context" type:"string"` - - // The Lambda function name. - // - // You can specify a function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // By default, the Invoke API assumes RequestResponse invocation type. You can - // optionally request asynchronous execution by specifying Event as the InvocationType. - // You can also use this parameter to request AWS Lambda to not execute the - // function but do some verification, such as if the caller is authorized to - // invoke the function and if the inputs are valid. You request this by specifying - // DryRun as the InvocationType. This is useful in a cross-account scenario - // when you want to verify access to a function without running it. - InvocationType *string `location:"header" locationName:"X-Amz-Invocation-Type" type:"string" enum:"InvocationType"` - - // You can set this optional parameter to Tail in the request only if you specify - // the InvocationType parameter with value RequestResponse. In this case, AWS - // Lambda returns the base64-encoded last 4 KB of log data produced by your - // Lambda function in the x-amz-log-result header. - LogType *string `location:"header" locationName:"X-Amz-Log-Type" type:"string" enum:"LogType"` - - // JSON that you want to provide to your Lambda function as input. - Payload []byte `type:"blob"` - - // You can use this optional parameter to specify a Lambda function version - // or alias name. If you specify a function version, the API uses the qualified - // function ARN to invoke a specific Lambda function. If you specify an alias - // name, the API uses the alias ARN to invoke the Lambda function version to - // which the alias points. - // - // If you don't provide this parameter, then the API uses unqualified function - // ARN which results in invocation of the $LATEST version. - Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` -} - -// String returns the string representation -func (s InvokeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InvokeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvokeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvokeInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Qualifier != nil && len(*s.Qualifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientContext sets the ClientContext field's value. -func (s *InvokeInput) SetClientContext(v string) *InvokeInput { - s.ClientContext = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *InvokeInput) SetFunctionName(v string) *InvokeInput { - s.FunctionName = &v - return s -} - -// SetInvocationType sets the InvocationType field's value. -func (s *InvokeInput) SetInvocationType(v string) *InvokeInput { - s.InvocationType = &v - return s -} - -// SetLogType sets the LogType field's value. -func (s *InvokeInput) SetLogType(v string) *InvokeInput { - s.LogType = &v - return s -} - -// SetPayload sets the Payload field's value. -func (s *InvokeInput) SetPayload(v []byte) *InvokeInput { - s.Payload = v - return s -} - -// SetQualifier sets the Qualifier field's value. -func (s *InvokeInput) SetQualifier(v string) *InvokeInput { - s.Qualifier = &v - return s -} - -// Upon success, returns an empty response. Otherwise, throws an exception. -type InvokeOutput struct { - _ struct{} `type:"structure" payload:"Payload"` - - // Indicates whether an error occurred while executing the Lambda function. - // If an error occurred this field will have one of two values; Handled or Unhandled. - // Handled errors are errors that are reported by the function while the Unhandled - // errors are those detected and reported by AWS Lambda. Unhandled errors include - // out of memory errors and function timeouts. For information about how to - // report an Handled error, see Programming Model (http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html). - FunctionError *string `location:"header" locationName:"X-Amz-Function-Error" type:"string"` - - // It is the base64-encoded logs for the Lambda function invocation. This is - // present only if the invocation type is RequestResponse and the logs were - // requested. - LogResult *string `location:"header" locationName:"X-Amz-Log-Result" type:"string"` - - // It is the JSON representation of the object returned by the Lambda function. - // This is present only if the invocation type is RequestResponse. - // - // In the event of a function error this field contains a message describing - // the error. For the Handled errors the Lambda function will report this message. - // For Unhandled errors AWS Lambda reports the message. - Payload []byte `type:"blob"` - - // The HTTP status code will be in the 200 range for successful request. For - // the RequestResonse invocation type this status code will be 200. For the - // Event invocation type this status code will be 202. For the DryRun invocation - // type the status code will be 204. - StatusCode *int64 `location:"statusCode" type:"integer"` -} - -// String returns the string representation -func (s InvokeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InvokeOutput) GoString() string { - return s.String() -} - -// SetFunctionError sets the FunctionError field's value. -func (s *InvokeOutput) SetFunctionError(v string) *InvokeOutput { - s.FunctionError = &v - return s -} - -// SetLogResult sets the LogResult field's value. -func (s *InvokeOutput) SetLogResult(v string) *InvokeOutput { - s.LogResult = &v - return s -} - -// SetPayload sets the Payload field's value. -func (s *InvokeOutput) SetPayload(v []byte) *InvokeOutput { - s.Payload = v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *InvokeOutput) SetStatusCode(v int64) *InvokeOutput { - s.StatusCode = &v - return s -} - -type ListAliasesInput struct { - _ struct{} `type:"structure"` - - // Lambda function name for which the alias is created. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // If you specify this optional parameter, the API returns only the aliases - // that are pointing to the specific Lambda function version, otherwise the - // API returns all of the aliases created for the Lambda function. - FunctionVersion *string `location:"querystring" locationName:"FunctionVersion" min:"1" type:"string"` - - // Optional string. An opaque pagination token returned from a previous ListAliases - // operation. If present, indicates where to continue the listing. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // Optional integer. Specifies the maximum number of aliases to return in response. - // This parameter value must be greater than 0. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListAliasesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAliasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAliasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *ListAliasesInput) SetFunctionName(v string) *ListAliasesInput { - s.FunctionName = &v - return s -} - -// SetFunctionVersion sets the FunctionVersion field's value. -func (s *ListAliasesInput) SetFunctionVersion(v string) *ListAliasesInput { - s.FunctionVersion = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListAliasesInput) SetMarker(v string) *ListAliasesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListAliasesInput) SetMaxItems(v int64) *ListAliasesInput { - s.MaxItems = &v - return s -} - -type ListAliasesOutput struct { - _ struct{} `type:"structure"` - - // A list of aliases. - Aliases []*AliasConfiguration `type:"list"` - - // A string, present if there are more aliases. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s ListAliasesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAliasesOutput) GoString() string { - return s.String() -} - -// SetAliases sets the Aliases field's value. -func (s *ListAliasesOutput) SetAliases(v []*AliasConfiguration) *ListAliasesOutput { - s.Aliases = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListAliasesOutput) SetNextMarker(v string) *ListAliasesOutput { - s.NextMarker = &v - return s -} - -type ListEventSourceMappingsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Kinesis stream. (This parameter - // is optional.) - EventSourceArn *string `location:"querystring" locationName:"EventSourceArn" type:"string"` - - // The name of the Lambda function. - // - // You can specify the function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // If you are using versioning, you can also provide a qualified function ARN - // (ARN that is qualified with function version or alias name as suffix). AWS - // Lambda also allows you to specify only the function name with the account - // ID qualifier (for example, account-id:Thumbnail). Note that the length constraint - // applies only to the ARN. If you specify only the function name, it is limited - // to 64 character in length. - FunctionName *string `location:"querystring" locationName:"FunctionName" min:"1" type:"string"` - - // Optional string. An opaque pagination token returned from a previous ListEventSourceMappings - // operation. If present, specifies to continue the list from where the returning - // call left off. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // Optional integer. Specifies the maximum number of event sources to return - // in response. This value must be greater than 0. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListEventSourceMappingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListEventSourceMappingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEventSourceMappingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEventSourceMappingsInput"} - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventSourceArn sets the EventSourceArn field's value. -func (s *ListEventSourceMappingsInput) SetEventSourceArn(v string) *ListEventSourceMappingsInput { - s.EventSourceArn = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *ListEventSourceMappingsInput) SetFunctionName(v string) *ListEventSourceMappingsInput { - s.FunctionName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListEventSourceMappingsInput) SetMarker(v string) *ListEventSourceMappingsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListEventSourceMappingsInput) SetMaxItems(v int64) *ListEventSourceMappingsInput { - s.MaxItems = &v - return s -} - -// Contains a list of event sources (see EventSourceMappingConfiguration) -type ListEventSourceMappingsOutput struct { - _ struct{} `type:"structure"` - - // An array of EventSourceMappingConfiguration objects. - EventSourceMappings []*EventSourceMappingConfiguration `type:"list"` - - // A string, present if there are more event source mappings. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s ListEventSourceMappingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListEventSourceMappingsOutput) GoString() string { - return s.String() -} - -// SetEventSourceMappings sets the EventSourceMappings field's value. -func (s *ListEventSourceMappingsOutput) SetEventSourceMappings(v []*EventSourceMappingConfiguration) *ListEventSourceMappingsOutput { - s.EventSourceMappings = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListEventSourceMappingsOutput) SetNextMarker(v string) *ListEventSourceMappingsOutput { - s.NextMarker = &v - return s -} - -type ListFunctionsInput struct { - _ struct{} `type:"structure"` - - // Optional string. An opaque pagination token returned from a previous ListFunctions - // operation. If present, indicates where to continue the listing. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // Optional integer. Specifies the maximum number of AWS Lambda functions to - // return in response. This parameter value must be greater than 0. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListFunctionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListFunctionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListFunctionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListFunctionsInput"} - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListFunctionsInput) SetMarker(v string) *ListFunctionsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListFunctionsInput) SetMaxItems(v int64) *ListFunctionsInput { - s.MaxItems = &v - return s -} - -// Contains a list of AWS Lambda function configurations (see FunctionConfiguration. -type ListFunctionsOutput struct { - _ struct{} `type:"structure"` - - // A list of Lambda functions. - Functions []*FunctionConfiguration `type:"list"` - - // A string, present if there are more functions. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s ListFunctionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListFunctionsOutput) GoString() string { - return s.String() -} - -// SetFunctions sets the Functions field's value. -func (s *ListFunctionsOutput) SetFunctions(v []*FunctionConfiguration) *ListFunctionsOutput { - s.Functions = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListFunctionsOutput) SetNextMarker(v string) *ListFunctionsOutput { - s.NextMarker = &v - return s -} - -type ListVersionsByFunctionInput struct { - _ struct{} `type:"structure"` - - // Function name whose versions to list. You can specify a function name (for - // example, Thumbnail) or you can specify Amazon Resource Name (ARN) of the - // function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // Optional string. An opaque pagination token returned from a previous ListVersionsByFunction - // operation. If present, indicates where to continue the listing. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // Optional integer. Specifies the maximum number of AWS Lambda function versions - // to return in response. This parameter value must be greater than 0. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListVersionsByFunctionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVersionsByFunctionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVersionsByFunctionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVersionsByFunctionInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *ListVersionsByFunctionInput) SetFunctionName(v string) *ListVersionsByFunctionInput { - s.FunctionName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListVersionsByFunctionInput) SetMarker(v string) *ListVersionsByFunctionInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListVersionsByFunctionInput) SetMaxItems(v int64) *ListVersionsByFunctionInput { - s.MaxItems = &v - return s -} - -type ListVersionsByFunctionOutput struct { - _ struct{} `type:"structure"` - - // A string, present if there are more function versions. - NextMarker *string `type:"string"` - - // A list of Lambda function versions. - Versions []*FunctionConfiguration `type:"list"` -} - -// String returns the string representation -func (s ListVersionsByFunctionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVersionsByFunctionOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListVersionsByFunctionOutput) SetNextMarker(v string) *ListVersionsByFunctionOutput { - s.NextMarker = &v - return s -} - -// SetVersions sets the Versions field's value. -func (s *ListVersionsByFunctionOutput) SetVersions(v []*FunctionConfiguration) *ListVersionsByFunctionOutput { - s.Versions = v - return s -} - -type PublishVersionInput struct { - _ struct{} `type:"structure"` - - // The SHA256 hash of the deployment package you want to publish. This provides - // validation on the code you are publishing. If you provide this parameter - // value must match the SHA256 of the $LATEST version for the publication to - // succeed. - CodeSha256 *string `type:"string"` - - // The description for the version you are publishing. If not provided, AWS - // Lambda copies the description from the $LATEST version. - Description *string `type:"string"` - - // The Lambda function name. You can specify a function name (for example, Thumbnail) - // or you can specify Amazon Resource Name (ARN) of the function (for example, - // arn:aws:lambda:us-west-2:account-id:function:ThumbNail). AWS Lambda also - // allows you to specify a partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PublishVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PublishVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PublishVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PublishVersionInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCodeSha256 sets the CodeSha256 field's value. -func (s *PublishVersionInput) SetCodeSha256(v string) *PublishVersionInput { - s.CodeSha256 = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *PublishVersionInput) SetDescription(v string) *PublishVersionInput { - s.Description = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *PublishVersionInput) SetFunctionName(v string) *PublishVersionInput { - s.FunctionName = &v - return s -} - -type RemovePermissionInput struct { - _ struct{} `type:"structure"` - - // Lambda function whose resource policy you want to remove a permission from. - // - // You can specify a function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // You can specify this optional parameter to remove permission associated with - // a specific function version or function alias. If you don't specify this - // parameter, the API removes permission associated with the unqualified function - // ARN. - Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` - - // Statement ID of the permission to remove. - // - // StatementId is a required field - StatementId *string `location:"uri" locationName:"StatementId" min:"1" 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.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.Qualifier != nil && len(*s.Qualifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) - } - if s.StatementId == nil { - invalidParams.Add(request.NewErrParamRequired("StatementId")) - } - if s.StatementId != nil && len(*s.StatementId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StatementId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *RemovePermissionInput) SetFunctionName(v string) *RemovePermissionInput { - s.FunctionName = &v - return s -} - -// SetQualifier sets the Qualifier field's value. -func (s *RemovePermissionInput) SetQualifier(v string) *RemovePermissionInput { - s.Qualifier = &v - return s -} - -// SetStatementId sets the StatementId field's value. -func (s *RemovePermissionInput) SetStatementId(v string) *RemovePermissionInput { - s.StatementId = &v - return s -} - -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() -} - -type UpdateAliasInput struct { - _ struct{} `type:"structure"` - - // You can change the description of the alias using this parameter. - Description *string `type:"string"` - - // The function name for which the alias is created. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // Using this parameter you can change the Lambda function version to which - // the alias points. - FunctionVersion *string `min:"1" type:"string"` - - // The alias name. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateAliasInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateAliasInput) SetDescription(v string) *UpdateAliasInput { - s.Description = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *UpdateAliasInput) SetFunctionName(v string) *UpdateAliasInput { - s.FunctionName = &v - return s -} - -// SetFunctionVersion sets the FunctionVersion field's value. -func (s *UpdateAliasInput) SetFunctionVersion(v string) *UpdateAliasInput { - s.FunctionVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateAliasInput) SetName(v string) *UpdateAliasInput { - s.Name = &v - return s -} - -type UpdateEventSourceMappingInput struct { - _ struct{} `type:"structure"` - - // The maximum number of stream records that can be sent to your Lambda function - // for a single invocation. - BatchSize *int64 `min:"1" type:"integer"` - - // Specifies whether AWS Lambda should actively poll the stream or not. If disabled, - // AWS Lambda will not poll the stream. - Enabled *bool `type:"boolean"` - - // The Lambda function to which you want the stream records sent. - // - // You can specify a function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail). - // - // If you are using versioning, you can also provide a qualified function ARN - // (ARN that is qualified with function version or alias name as suffix). For - // more information about versioning, see AWS Lambda Function Versioning and - // Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) - // - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - FunctionName *string `min:"1" type:"string"` - - // The event source mapping identifier. - // - // UUID is a required field - UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateEventSourceMappingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateEventSourceMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEventSourceMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEventSourceMappingInput"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.UUID == nil { - invalidParams.Add(request.NewErrParamRequired("UUID")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *UpdateEventSourceMappingInput) SetBatchSize(v int64) *UpdateEventSourceMappingInput { - s.BatchSize = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *UpdateEventSourceMappingInput) SetEnabled(v bool) *UpdateEventSourceMappingInput { - s.Enabled = &v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *UpdateEventSourceMappingInput) SetFunctionName(v string) *UpdateEventSourceMappingInput { - s.FunctionName = &v - return s -} - -// SetUUID sets the UUID field's value. -func (s *UpdateEventSourceMappingInput) SetUUID(v string) *UpdateEventSourceMappingInput { - s.UUID = &v - return s -} - -type UpdateFunctionCodeInput struct { - _ struct{} `type:"structure"` - - // The existing Lambda function name whose code you want to replace. - // - // You can specify a function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // This boolean parameter can be used to request AWS Lambda to update the Lambda - // function and publish a version as an atomic operation. - Publish *bool `type:"boolean"` - - // Amazon S3 bucket name where the .zip file containing your deployment package - // is stored. This bucket must reside in the same AWS Region where you are creating - // the Lambda function. - S3Bucket *string `min:"3" type:"string"` - - // The Amazon S3 object (the deployment package) key name you want to upload. - S3Key *string `min:"1" type:"string"` - - // The Amazon S3 object (the deployment package) version you want to upload. - S3ObjectVersion *string `min:"1" type:"string"` - - // The contents of your zip file containing your deployment package. If you - // are using the web API directly, the contents of the zip file must be base64-encoded. - // If you are using the AWS SDKs or the AWS CLI, the SDKs or CLI will do the - // encoding for you. For more information about creating a .zip file, see Execution - // Permissions (http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role.html) - // in the AWS Lambda Developer Guide. - // - // ZipFile is automatically base64 encoded/decoded by the SDK. - ZipFile []byte `type:"blob"` -} - -// String returns the string representation -func (s UpdateFunctionCodeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateFunctionCodeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateFunctionCodeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateFunctionCodeInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.S3Bucket != nil && len(*s.S3Bucket) < 3 { - invalidParams.Add(request.NewErrParamMinLen("S3Bucket", 3)) - } - if s.S3Key != nil && len(*s.S3Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3Key", 1)) - } - if s.S3ObjectVersion != nil && len(*s.S3ObjectVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3ObjectVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionName sets the FunctionName field's value. -func (s *UpdateFunctionCodeInput) SetFunctionName(v string) *UpdateFunctionCodeInput { - s.FunctionName = &v - return s -} - -// SetPublish sets the Publish field's value. -func (s *UpdateFunctionCodeInput) SetPublish(v bool) *UpdateFunctionCodeInput { - s.Publish = &v - return s -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *UpdateFunctionCodeInput) SetS3Bucket(v string) *UpdateFunctionCodeInput { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *UpdateFunctionCodeInput) SetS3Key(v string) *UpdateFunctionCodeInput { - s.S3Key = &v - return s -} - -// SetS3ObjectVersion sets the S3ObjectVersion field's value. -func (s *UpdateFunctionCodeInput) SetS3ObjectVersion(v string) *UpdateFunctionCodeInput { - s.S3ObjectVersion = &v - return s -} - -// SetZipFile sets the ZipFile field's value. -func (s *UpdateFunctionCodeInput) SetZipFile(v []byte) *UpdateFunctionCodeInput { - s.ZipFile = v - return s -} - -type UpdateFunctionConfigurationInput struct { - _ struct{} `type:"structure"` - - // The parent object that contains the target Amazon Resource Name (ARN) of - // an Amazon SQS queue or Amazon SNS topic. - DeadLetterConfig *DeadLetterConfig `type:"structure"` - - // A short user-defined function description. AWS Lambda does not use this value. - // Assign a meaningful description as you see fit. - Description *string `type:"string"` - - // The parent object that contains your environment's configuration settings. - Environment *Environment `type:"structure"` - - // The name of the Lambda function. - // - // You can specify a function name (for example, Thumbnail) or you can specify - // Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail). - // AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail). - // Note that the length constraint applies only to the ARN. If you specify only - // the function name, it is limited to 64 character in length. - // - // FunctionName is a required field - FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - - // The function that Lambda calls to begin executing your function. For Node.js, - // it is the module-name.export value in your function. - Handler *string `type:"string"` - - // The Amazon Resource Name (ARN) of the KMS key used to encrypt your function's - // environment variables. If you elect to use the AWS Lambda default service - // key, pass in an empty string ("") for this parameter. - KMSKeyArn *string `type:"string"` - - // The amount of memory, in MB, your Lambda function is given. AWS Lambda uses - // this memory size to infer the amount of CPU allocated to your function. Your - // function use-case determines your CPU and memory requirements. For example, - // a database operation might need less memory compared to an image processing - // function. The default value is 128 MB. The value must be a multiple of 64 - // MB. - MemorySize *int64 `min:"128" type:"integer"` - - // The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when - // it executes your function. - Role *string `type:"string"` - - // The runtime environment for the Lambda function. - // - // To use the Node.js runtime v4.3, set the value to "nodejs4.3". To use earlier - // runtime (v0.10.42), set the value to "nodejs". - // - // You can no longer downgrade to the v0.10.42 runtime version. This version - // will no longer be supported as of early 2017. - Runtime *string `type:"string" enum:"Runtime"` - - // The function execution time at which AWS Lambda should terminate the function. - // Because the execution time has cost implications, we recommend you set this - // value based on your expected execution time. The default is 3 seconds. - Timeout *int64 `min:"1" type:"integer"` - - // If your Lambda function accesses resources in a VPC, you provide this parameter - // identifying the list of security group IDs and subnet IDs. These must belong - // to the same VPC. You must provide at least one security group and one subnet - // ID. - VpcConfig *VpcConfig `type:"structure"` -} - -// String returns the string representation -func (s UpdateFunctionConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateFunctionConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateFunctionConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateFunctionConfigurationInput"} - if s.FunctionName == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionName")) - } - if s.FunctionName != nil && len(*s.FunctionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) - } - if s.MemorySize != nil && *s.MemorySize < 128 { - invalidParams.Add(request.NewErrParamMinValue("MemorySize", 128)) - } - if s.Timeout != nil && *s.Timeout < 1 { - invalidParams.Add(request.NewErrParamMinValue("Timeout", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeadLetterConfig sets the DeadLetterConfig field's value. -func (s *UpdateFunctionConfigurationInput) SetDeadLetterConfig(v *DeadLetterConfig) *UpdateFunctionConfigurationInput { - s.DeadLetterConfig = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateFunctionConfigurationInput) SetDescription(v string) *UpdateFunctionConfigurationInput { - s.Description = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *UpdateFunctionConfigurationInput) SetEnvironment(v *Environment) *UpdateFunctionConfigurationInput { - s.Environment = v - return s -} - -// SetFunctionName sets the FunctionName field's value. -func (s *UpdateFunctionConfigurationInput) SetFunctionName(v string) *UpdateFunctionConfigurationInput { - s.FunctionName = &v - return s -} - -// SetHandler sets the Handler field's value. -func (s *UpdateFunctionConfigurationInput) SetHandler(v string) *UpdateFunctionConfigurationInput { - s.Handler = &v - return s -} - -// SetKMSKeyArn sets the KMSKeyArn field's value. -func (s *UpdateFunctionConfigurationInput) SetKMSKeyArn(v string) *UpdateFunctionConfigurationInput { - s.KMSKeyArn = &v - return s -} - -// SetMemorySize sets the MemorySize field's value. -func (s *UpdateFunctionConfigurationInput) SetMemorySize(v int64) *UpdateFunctionConfigurationInput { - s.MemorySize = &v - return s -} - -// SetRole sets the Role field's value. -func (s *UpdateFunctionConfigurationInput) SetRole(v string) *UpdateFunctionConfigurationInput { - s.Role = &v - return s -} - -// SetRuntime sets the Runtime field's value. -func (s *UpdateFunctionConfigurationInput) SetRuntime(v string) *UpdateFunctionConfigurationInput { - s.Runtime = &v - return s -} - -// SetTimeout sets the Timeout field's value. -func (s *UpdateFunctionConfigurationInput) SetTimeout(v int64) *UpdateFunctionConfigurationInput { - s.Timeout = &v - return s -} - -// SetVpcConfig sets the VpcConfig field's value. -func (s *UpdateFunctionConfigurationInput) SetVpcConfig(v *VpcConfig) *UpdateFunctionConfigurationInput { - s.VpcConfig = v - return s -} - -// If your Lambda function accesses resources in a VPC, you provide this parameter -// identifying the list of security group IDs and subnet IDs. These must belong -// to the same VPC. You must provide at least one security group and one subnet -// ID. -type VpcConfig struct { - _ struct{} `type:"structure"` - - // A list of one or more security groups IDs in your VPC. - SecurityGroupIds []*string `type:"list"` - - // A list of one or more subnet IDs in your VPC. - SubnetIds []*string `type:"list"` -} - -// String returns the string representation -func (s VpcConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcConfig) GoString() string { - return s.String() -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *VpcConfig) SetSecurityGroupIds(v []*string) *VpcConfig { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *VpcConfig) SetSubnetIds(v []*string) *VpcConfig { - s.SubnetIds = v - return s -} - -// VPC configuration associated with your Lambda function. -type VpcConfigResponse struct { - _ struct{} `type:"structure"` - - // A list of security group IDs associated with the Lambda function. - SecurityGroupIds []*string `type:"list"` - - // A list of subnet IDs associated with the Lambda function. - SubnetIds []*string `type:"list"` - - // The VPC ID associated with you Lambda function. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s VpcConfigResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcConfigResponse) GoString() string { - return s.String() -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *VpcConfigResponse) SetSecurityGroupIds(v []*string) *VpcConfigResponse { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *VpcConfigResponse) SetSubnetIds(v []*string) *VpcConfigResponse { - s.SubnetIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcConfigResponse) SetVpcId(v string) *VpcConfigResponse { - s.VpcId = &v - return s -} - -const ( - // EventSourcePositionTrimHorizon is a EventSourcePosition enum value - EventSourcePositionTrimHorizon = "TRIM_HORIZON" - - // EventSourcePositionLatest is a EventSourcePosition enum value - EventSourcePositionLatest = "LATEST" - - // EventSourcePositionAtTimestamp is a EventSourcePosition enum value - EventSourcePositionAtTimestamp = "AT_TIMESTAMP" -) - -const ( - // InvocationTypeEvent is a InvocationType enum value - InvocationTypeEvent = "Event" - - // InvocationTypeRequestResponse is a InvocationType enum value - InvocationTypeRequestResponse = "RequestResponse" - - // InvocationTypeDryRun is a InvocationType enum value - InvocationTypeDryRun = "DryRun" -) - -const ( - // LogTypeNone is a LogType enum value - LogTypeNone = "None" - - // LogTypeTail is a LogType enum value - LogTypeTail = "Tail" -) - -const ( - // RuntimeNodejs is a Runtime enum value - RuntimeNodejs = "nodejs" - - // RuntimeNodejs43 is a Runtime enum value - RuntimeNodejs43 = "nodejs4.3" - - // RuntimeJava8 is a Runtime enum value - RuntimeJava8 = "java8" - - // RuntimePython27 is a Runtime enum value - RuntimePython27 = "python2.7" - - // RuntimeDotnetcore10 is a Runtime enum value - RuntimeDotnetcore10 = "dotnetcore1.0" - - // RuntimeNodejs43Edge is a Runtime enum value - RuntimeNodejs43Edge = "nodejs4.3-edge" -) - -const ( - // ThrottleReasonConcurrentInvocationLimitExceeded is a ThrottleReason enum value - ThrottleReasonConcurrentInvocationLimitExceeded = "ConcurrentInvocationLimitExceeded" - - // ThrottleReasonFunctionInvocationRateLimitExceeded is a ThrottleReason enum value - ThrottleReasonFunctionInvocationRateLimitExceeded = "FunctionInvocationRateLimitExceeded" - - // ThrottleReasonCallerRateLimitExceeded is a ThrottleReason enum value - ThrottleReasonCallerRateLimitExceeded = "CallerRateLimitExceeded" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go b/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go deleted file mode 100644 index 1f9a11b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go +++ /dev/null @@ -1,148 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package lambda - -const ( - - // ErrCodeCodeStorageExceededException for service response error code - // "CodeStorageExceededException". - // - // You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html) - ErrCodeCodeStorageExceededException = "CodeStorageExceededException" - - // ErrCodeEC2AccessDeniedException for service response error code - // "EC2AccessDeniedException". - ErrCodeEC2AccessDeniedException = "EC2AccessDeniedException" - - // ErrCodeEC2ThrottledException for service response error code - // "EC2ThrottledException". - // - // AWS Lambda was throttled by Amazon EC2 during Lambda function initialization - // using the execution role provided for the Lambda function. - ErrCodeEC2ThrottledException = "EC2ThrottledException" - - // ErrCodeEC2UnexpectedException for service response error code - // "EC2UnexpectedException". - // - // AWS Lambda received an unexpected EC2 client exception while setting up for - // the Lambda function. - ErrCodeEC2UnexpectedException = "EC2UnexpectedException" - - // ErrCodeENILimitReachedException for service response error code - // "ENILimitReachedException". - // - // AWS Lambda was not able to create an Elastic Network Interface (ENI) in the - // VPC, specified as part of Lambda function configuration, because the limit - // for network interfaces has been reached. - ErrCodeENILimitReachedException = "ENILimitReachedException" - - // ErrCodeInvalidParameterValueException for service response error code - // "InvalidParameterValueException". - // - // One of the parameters in the request is invalid. For example, if you provided - // an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration - // API, that AWS Lambda is unable to assume you will get this exception. - ErrCodeInvalidParameterValueException = "InvalidParameterValueException" - - // ErrCodeInvalidRequestContentException for service response error code - // "InvalidRequestContentException". - // - // The request body could not be parsed as JSON. - ErrCodeInvalidRequestContentException = "InvalidRequestContentException" - - // ErrCodeInvalidSecurityGroupIDException for service response error code - // "InvalidSecurityGroupIDException". - // - // The Security Group ID provided in the Lambda function VPC configuration is - // invalid. - ErrCodeInvalidSecurityGroupIDException = "InvalidSecurityGroupIDException" - - // ErrCodeInvalidSubnetIDException for service response error code - // "InvalidSubnetIDException". - // - // The Subnet ID provided in the Lambda function VPC configuration is invalid. - ErrCodeInvalidSubnetIDException = "InvalidSubnetIDException" - - // ErrCodeInvalidZipFileException for service response error code - // "InvalidZipFileException". - // - // AWS Lambda could not unzip the function zip file. - ErrCodeInvalidZipFileException = "InvalidZipFileException" - - // ErrCodeKMSAccessDeniedException for service response error code - // "KMSAccessDeniedException". - // - // Lambda was unable to decrypt the environment variables because KMS access - // was denied. Check the Lambda function's KMS permissions. - ErrCodeKMSAccessDeniedException = "KMSAccessDeniedException" - - // ErrCodeKMSDisabledException for service response error code - // "KMSDisabledException". - // - // Lambda was unable to decrypt the environment variables because the KMS key - // used is disabled. Check the Lambda function's KMS key settings. - ErrCodeKMSDisabledException = "KMSDisabledException" - - // ErrCodeKMSInvalidStateException for service response error code - // "KMSInvalidStateException". - // - // Lambda was unable to decrypt the environment variables because the KMS key - // used is in an invalid state for Decrypt. Check the function's KMS key settings. - ErrCodeKMSInvalidStateException = "KMSInvalidStateException" - - // ErrCodeKMSNotFoundException for service response error code - // "KMSNotFoundException". - // - // Lambda was unable to decrypt the environment variables because the KMS key - // was not found. Check the function's KMS key settings. - ErrCodeKMSNotFoundException = "KMSNotFoundException" - - // ErrCodePolicyLengthExceededException for service response error code - // "PolicyLengthExceededException". - // - // Lambda function access policy is limited to 20 KB. - ErrCodePolicyLengthExceededException = "PolicyLengthExceededException" - - // ErrCodeRequestTooLargeException for service response error code - // "RequestTooLargeException". - // - // The request payload exceeded the Invoke request body JSON input limit. For - // more information, see Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html). - ErrCodeRequestTooLargeException = "RequestTooLargeException" - - // ErrCodeResourceConflictException for service response error code - // "ResourceConflictException". - // - // The resource already exists. - ErrCodeResourceConflictException = "ResourceConflictException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource (for example, a Lambda function or access policy statement) - // specified in the request does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceException for service response error code - // "ServiceException". - // - // The AWS Lambda service encountered an internal error. - ErrCodeServiceException = "ServiceException" - - // ErrCodeSubnetIPAddressLimitReachedException for service response error code - // "SubnetIPAddressLimitReachedException". - // - // AWS Lambda was not able to set up VPC access for the Lambda function because - // one or more configured subnets has no available IP addresses. - ErrCodeSubnetIPAddressLimitReachedException = "SubnetIPAddressLimitReachedException" - - // ErrCodeTooManyRequestsException for service response error code - // "TooManyRequestsException". - ErrCodeTooManyRequestsException = "TooManyRequestsException" - - // ErrCodeUnsupportedMediaTypeException for service response error code - // "UnsupportedMediaTypeException". - // - // The content type of the Invoke request body is not JSON. - ErrCodeUnsupportedMediaTypeException = "UnsupportedMediaTypeException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go b/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go deleted file mode 100644 index abb46fa..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go +++ /dev/null @@ -1,96 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package lambda - -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" -) - -// Overview -// -// This is the AWS Lambda API Reference. The AWS Lambda Developer Guide provides -// additional information. For the service overview, see What is AWS Lambda -// (http://docs.aws.amazon.com/lambda/latest/dg/welcome.html), and for information -// about how the service works, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html) -// in the AWS Lambda 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. -type Lambda 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 = "lambda" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the Lambda 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 Lambda client from just a session. -// svc := lambda.New(mySession) -// -// // Create a Lambda client with additional configuration -// svc := lambda.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Lambda { - 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) *Lambda { - svc := &Lambda{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-03-31", - }, - 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 Lambda operation and runs any -// custom request initialization. -func (c *Lambda) 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/lightsail/api.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go deleted file mode 100644 index 06a4473..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go +++ /dev/null @@ -1,9366 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package lightsail provides a client for Amazon Lightsail. -package lightsail - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAllocateStaticIp = "AllocateStaticIp" - -// AllocateStaticIpRequest generates a "aws/request.Request" representing the -// client's request for the AllocateStaticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AllocateStaticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AllocateStaticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AllocateStaticIpRequest method. -// req, resp := client.AllocateStaticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIp -func (c *Lightsail) AllocateStaticIpRequest(input *AllocateStaticIpInput) (req *request.Request, output *AllocateStaticIpOutput) { - op := &request.Operation{ - Name: opAllocateStaticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AllocateStaticIpInput{} - } - - output = &AllocateStaticIpOutput{} - req = c.newRequest(op, input, output) - return -} - -// AllocateStaticIp API operation for Amazon Lightsail. -// -// Allocates a static IP address. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation AllocateStaticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIp -func (c *Lightsail) AllocateStaticIp(input *AllocateStaticIpInput) (*AllocateStaticIpOutput, error) { - req, out := c.AllocateStaticIpRequest(input) - err := req.Send() - return out, err -} - -const opAttachStaticIp = "AttachStaticIp" - -// AttachStaticIpRequest generates a "aws/request.Request" representing the -// client's request for the AttachStaticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachStaticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachStaticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachStaticIpRequest method. -// req, resp := client.AttachStaticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIp -func (c *Lightsail) AttachStaticIpRequest(input *AttachStaticIpInput) (req *request.Request, output *AttachStaticIpOutput) { - op := &request.Operation{ - Name: opAttachStaticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachStaticIpInput{} - } - - output = &AttachStaticIpOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachStaticIp API operation for Amazon Lightsail. -// -// Attaches a static IP address to a specific Amazon Lightsail 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 Lightsail's -// API operation AttachStaticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIp -func (c *Lightsail) AttachStaticIp(input *AttachStaticIpInput) (*AttachStaticIpOutput, error) { - req, out := c.AttachStaticIpRequest(input) - err := req.Send() - return out, err -} - -const opCloseInstancePublicPorts = "CloseInstancePublicPorts" - -// CloseInstancePublicPortsRequest generates a "aws/request.Request" representing the -// client's request for the CloseInstancePublicPorts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CloseInstancePublicPorts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CloseInstancePublicPorts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CloseInstancePublicPortsRequest method. -// req, resp := client.CloseInstancePublicPortsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPorts -func (c *Lightsail) CloseInstancePublicPortsRequest(input *CloseInstancePublicPortsInput) (req *request.Request, output *CloseInstancePublicPortsOutput) { - op := &request.Operation{ - Name: opCloseInstancePublicPorts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CloseInstancePublicPortsInput{} - } - - output = &CloseInstancePublicPortsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CloseInstancePublicPorts API operation for Amazon Lightsail. -// -// Closes the public ports on a specific Amazon Lightsail 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 Lightsail's -// API operation CloseInstancePublicPorts for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPorts -func (c *Lightsail) CloseInstancePublicPorts(input *CloseInstancePublicPortsInput) (*CloseInstancePublicPortsOutput, error) { - req, out := c.CloseInstancePublicPortsRequest(input) - err := req.Send() - return out, err -} - -const opCreateDomain = "CreateDomain" - -// CreateDomainRequest generates a "aws/request.Request" representing the -// client's request for the CreateDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDomainRequest method. -// req, resp := client.CreateDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomain -func (c *Lightsail) CreateDomainRequest(input *CreateDomainInput) (req *request.Request, output *CreateDomainOutput) { - op := &request.Operation{ - Name: opCreateDomain, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDomainInput{} - } - - output = &CreateDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDomain API operation for Amazon Lightsail. -// -// Creates a domain resource for the specified domain (e.g., example.com). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation CreateDomain for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomain -func (c *Lightsail) CreateDomain(input *CreateDomainInput) (*CreateDomainOutput, error) { - req, out := c.CreateDomainRequest(input) - err := req.Send() - return out, err -} - -const opCreateDomainEntry = "CreateDomainEntry" - -// CreateDomainEntryRequest generates a "aws/request.Request" representing the -// client's request for the CreateDomainEntry operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDomainEntry for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDomainEntry method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDomainEntryRequest method. -// req, resp := client.CreateDomainEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntry -func (c *Lightsail) CreateDomainEntryRequest(input *CreateDomainEntryInput) (req *request.Request, output *CreateDomainEntryOutput) { - op := &request.Operation{ - Name: opCreateDomainEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDomainEntryInput{} - } - - output = &CreateDomainEntryOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDomainEntry API operation for Amazon Lightsail. -// -// Creates one of the following entry records associated with the domain: A -// record, CNAME record, TXT record, or MX record. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation CreateDomainEntry for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntry -func (c *Lightsail) CreateDomainEntry(input *CreateDomainEntryInput) (*CreateDomainEntryOutput, error) { - req, out := c.CreateDomainEntryRequest(input) - err := req.Send() - return out, err -} - -const opCreateInstanceSnapshot = "CreateInstanceSnapshot" - -// CreateInstanceSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateInstanceSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateInstanceSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateInstanceSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateInstanceSnapshotRequest method. -// req, resp := client.CreateInstanceSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshot -func (c *Lightsail) CreateInstanceSnapshotRequest(input *CreateInstanceSnapshotInput) (req *request.Request, output *CreateInstanceSnapshotOutput) { - op := &request.Operation{ - Name: opCreateInstanceSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInstanceSnapshotInput{} - } - - output = &CreateInstanceSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInstanceSnapshot API operation for Amazon Lightsail. -// -// Creates a snapshot of a specific virtual private server, or instance. You -// can use a snapshot to create a new instance that is based on that 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 Lightsail's -// API operation CreateInstanceSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshot -func (c *Lightsail) CreateInstanceSnapshot(input *CreateInstanceSnapshotInput) (*CreateInstanceSnapshotOutput, error) { - req, out := c.CreateInstanceSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCreateInstances = "CreateInstances" - -// CreateInstancesRequest generates a "aws/request.Request" representing the -// client's request for the CreateInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateInstancesRequest method. -// req, resp := client.CreateInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstances -func (c *Lightsail) CreateInstancesRequest(input *CreateInstancesInput) (req *request.Request, output *CreateInstancesOutput) { - op := &request.Operation{ - Name: opCreateInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInstancesInput{} - } - - output = &CreateInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInstances API operation for Amazon Lightsail. -// -// Creates one or more Amazon Lightsail virtual private servers, or 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 Lightsail's -// API operation CreateInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstances -func (c *Lightsail) CreateInstances(input *CreateInstancesInput) (*CreateInstancesOutput, error) { - req, out := c.CreateInstancesRequest(input) - err := req.Send() - return out, err -} - -const opCreateInstancesFromSnapshot = "CreateInstancesFromSnapshot" - -// CreateInstancesFromSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateInstancesFromSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateInstancesFromSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateInstancesFromSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateInstancesFromSnapshotRequest method. -// req, resp := client.CreateInstancesFromSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshot -func (c *Lightsail) CreateInstancesFromSnapshotRequest(input *CreateInstancesFromSnapshotInput) (req *request.Request, output *CreateInstancesFromSnapshotOutput) { - op := &request.Operation{ - Name: opCreateInstancesFromSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInstancesFromSnapshotInput{} - } - - output = &CreateInstancesFromSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInstancesFromSnapshot API operation for Amazon Lightsail. -// -// Uses a specific snapshot as a blueprint for creating one or more new instances -// that are based on that identical 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 Lightsail's -// API operation CreateInstancesFromSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshot -func (c *Lightsail) CreateInstancesFromSnapshot(input *CreateInstancesFromSnapshotInput) (*CreateInstancesFromSnapshotOutput, error) { - req, out := c.CreateInstancesFromSnapshotRequest(input) - err := req.Send() - return out, err -} - -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/lightsail-2016-11-28/CreateKeyPair -func (c *Lightsail) 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 Lightsail. -// -// Creates sn SSH key pair. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation CreateKeyPair for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateKeyPair -func (c *Lightsail) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, error) { - req, out := c.CreateKeyPairRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDomain = "DeleteDomain" - -// DeleteDomainRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDomainRequest method. -// req, resp := client.DeleteDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomain -func (c *Lightsail) DeleteDomainRequest(input *DeleteDomainInput) (req *request.Request, output *DeleteDomainOutput) { - op := &request.Operation{ - Name: opDeleteDomain, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDomainInput{} - } - - output = &DeleteDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDomain API operation for Amazon Lightsail. -// -// Deletes the specified domain recordset and all of its domain 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 Lightsail's -// API operation DeleteDomain for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomain -func (c *Lightsail) DeleteDomain(input *DeleteDomainInput) (*DeleteDomainOutput, error) { - req, out := c.DeleteDomainRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDomainEntry = "DeleteDomainEntry" - -// DeleteDomainEntryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDomainEntry operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDomainEntry for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDomainEntry method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDomainEntryRequest method. -// req, resp := client.DeleteDomainEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntry -func (c *Lightsail) DeleteDomainEntryRequest(input *DeleteDomainEntryInput) (req *request.Request, output *DeleteDomainEntryOutput) { - op := &request.Operation{ - Name: opDeleteDomainEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDomainEntryInput{} - } - - output = &DeleteDomainEntryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDomainEntry API operation for Amazon Lightsail. -// -// Deletes a specific domain entry. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation DeleteDomainEntry for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntry -func (c *Lightsail) DeleteDomainEntry(input *DeleteDomainEntryInput) (*DeleteDomainEntryOutput, error) { - req, out := c.DeleteDomainEntryRequest(input) - err := req.Send() - return out, err -} - -const opDeleteInstance = "DeleteInstance" - -// DeleteInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteInstanceRequest method. -// req, resp := client.DeleteInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstance -func (c *Lightsail) DeleteInstanceRequest(input *DeleteInstanceInput) (req *request.Request, output *DeleteInstanceOutput) { - op := &request.Operation{ - Name: opDeleteInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteInstanceInput{} - } - - output = &DeleteInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteInstance API operation for Amazon Lightsail. -// -// Deletes a specific Amazon Lightsail virtual private server, or 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 Lightsail's -// API operation DeleteInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstance -func (c *Lightsail) DeleteInstance(input *DeleteInstanceInput) (*DeleteInstanceOutput, error) { - req, out := c.DeleteInstanceRequest(input) - err := req.Send() - return out, err -} - -const opDeleteInstanceSnapshot = "DeleteInstanceSnapshot" - -// DeleteInstanceSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeleteInstanceSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteInstanceSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteInstanceSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteInstanceSnapshotRequest method. -// req, resp := client.DeleteInstanceSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshot -func (c *Lightsail) DeleteInstanceSnapshotRequest(input *DeleteInstanceSnapshotInput) (req *request.Request, output *DeleteInstanceSnapshotOutput) { - op := &request.Operation{ - Name: opDeleteInstanceSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteInstanceSnapshotInput{} - } - - output = &DeleteInstanceSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteInstanceSnapshot API operation for Amazon Lightsail. -// -// Deletes a specific snapshot of a virtual private server (or 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 Lightsail's -// API operation DeleteInstanceSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshot -func (c *Lightsail) DeleteInstanceSnapshot(input *DeleteInstanceSnapshotInput) (*DeleteInstanceSnapshotOutput, error) { - req, out := c.DeleteInstanceSnapshotRequest(input) - err := req.Send() - return out, err -} - -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/lightsail-2016-11-28/DeleteKeyPair -func (c *Lightsail) 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) - return -} - -// DeleteKeyPair API operation for Amazon Lightsail. -// -// Deletes a specific SSH key pair. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation DeleteKeyPair for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKeyPair -func (c *Lightsail) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, error) { - req, out := c.DeleteKeyPairRequest(input) - err := req.Send() - return out, err -} - -const opDetachStaticIp = "DetachStaticIp" - -// DetachStaticIpRequest generates a "aws/request.Request" representing the -// client's request for the DetachStaticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachStaticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachStaticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachStaticIpRequest method. -// req, resp := client.DetachStaticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIp -func (c *Lightsail) DetachStaticIpRequest(input *DetachStaticIpInput) (req *request.Request, output *DetachStaticIpOutput) { - op := &request.Operation{ - Name: opDetachStaticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachStaticIpInput{} - } - - output = &DetachStaticIpOutput{} - req = c.newRequest(op, input, output) - return -} - -// DetachStaticIp API operation for Amazon Lightsail. -// -// Detaches a static IP from the Amazon Lightsail instance to which it is attached. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation DetachStaticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIp -func (c *Lightsail) DetachStaticIp(input *DetachStaticIpInput) (*DetachStaticIpOutput, error) { - req, out := c.DetachStaticIpRequest(input) - err := req.Send() - return out, err -} - -const opDownloadDefaultKeyPair = "DownloadDefaultKeyPair" - -// DownloadDefaultKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the DownloadDefaultKeyPair operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DownloadDefaultKeyPair for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DownloadDefaultKeyPair method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DownloadDefaultKeyPairRequest method. -// req, resp := client.DownloadDefaultKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPair -func (c *Lightsail) DownloadDefaultKeyPairRequest(input *DownloadDefaultKeyPairInput) (req *request.Request, output *DownloadDefaultKeyPairOutput) { - op := &request.Operation{ - Name: opDownloadDefaultKeyPair, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DownloadDefaultKeyPairInput{} - } - - output = &DownloadDefaultKeyPairOutput{} - req = c.newRequest(op, input, output) - return -} - -// DownloadDefaultKeyPair API operation for Amazon Lightsail. -// -// Downloads the default SSH key pair from the user's 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 Lightsail's -// API operation DownloadDefaultKeyPair for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPair -func (c *Lightsail) DownloadDefaultKeyPair(input *DownloadDefaultKeyPairInput) (*DownloadDefaultKeyPairOutput, error) { - req, out := c.DownloadDefaultKeyPairRequest(input) - err := req.Send() - return out, err -} - -const opGetActiveNames = "GetActiveNames" - -// GetActiveNamesRequest generates a "aws/request.Request" representing the -// client's request for the GetActiveNames operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetActiveNames for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetActiveNames method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetActiveNamesRequest method. -// req, resp := client.GetActiveNamesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNames -func (c *Lightsail) GetActiveNamesRequest(input *GetActiveNamesInput) (req *request.Request, output *GetActiveNamesOutput) { - op := &request.Operation{ - Name: opGetActiveNames, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetActiveNamesInput{} - } - - output = &GetActiveNamesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetActiveNames API operation for Amazon Lightsail. -// -// Returns the names of all active (not deleted) 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 Lightsail's -// API operation GetActiveNames for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNames -func (c *Lightsail) GetActiveNames(input *GetActiveNamesInput) (*GetActiveNamesOutput, error) { - req, out := c.GetActiveNamesRequest(input) - err := req.Send() - return out, err -} - -const opGetBlueprints = "GetBlueprints" - -// GetBlueprintsRequest generates a "aws/request.Request" representing the -// client's request for the GetBlueprints operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBlueprints for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBlueprints method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBlueprintsRequest method. -// req, resp := client.GetBlueprintsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprints -func (c *Lightsail) GetBlueprintsRequest(input *GetBlueprintsInput) (req *request.Request, output *GetBlueprintsOutput) { - op := &request.Operation{ - Name: opGetBlueprints, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetBlueprintsInput{} - } - - output = &GetBlueprintsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBlueprints API operation for Amazon Lightsail. -// -// Returns the list of available instance images, or blueprints. You can use -// a blueprint to create a new virtual private server already running a specific -// operating system, as well as a preinstalled app or development stack. The -// software each instance is running depends on the blueprint image you choose. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation GetBlueprints for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprints -func (c *Lightsail) GetBlueprints(input *GetBlueprintsInput) (*GetBlueprintsOutput, error) { - req, out := c.GetBlueprintsRequest(input) - err := req.Send() - return out, err -} - -const opGetBundles = "GetBundles" - -// GetBundlesRequest generates a "aws/request.Request" representing the -// client's request for the GetBundles operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBundles for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBundles method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBundlesRequest method. -// req, resp := client.GetBundlesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundles -func (c *Lightsail) GetBundlesRequest(input *GetBundlesInput) (req *request.Request, output *GetBundlesOutput) { - op := &request.Operation{ - Name: opGetBundles, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetBundlesInput{} - } - - output = &GetBundlesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBundles API operation for Amazon Lightsail. -// -// Returns the list of bundles that are available for purchase. A bundle describes -// the specs for your virtual private server (or 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 Lightsail's -// API operation GetBundles for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundles -func (c *Lightsail) GetBundles(input *GetBundlesInput) (*GetBundlesOutput, error) { - req, out := c.GetBundlesRequest(input) - err := req.Send() - return out, err -} - -const opGetDomain = "GetDomain" - -// GetDomainRequest generates a "aws/request.Request" representing the -// client's request for the GetDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDomainRequest method. -// req, resp := client.GetDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomain -func (c *Lightsail) GetDomainRequest(input *GetDomainInput) (req *request.Request, output *GetDomainOutput) { - op := &request.Operation{ - Name: opGetDomain, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDomainInput{} - } - - output = &GetDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDomain API operation for Amazon Lightsail. -// -// Returns information about a specific domain recordset. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation GetDomain for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomain -func (c *Lightsail) GetDomain(input *GetDomainInput) (*GetDomainOutput, error) { - req, out := c.GetDomainRequest(input) - err := req.Send() - return out, err -} - -const opGetDomains = "GetDomains" - -// GetDomainsRequest generates a "aws/request.Request" representing the -// client's request for the GetDomains operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDomains for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDomains method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDomainsRequest method. -// req, resp := client.GetDomainsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomains -func (c *Lightsail) GetDomainsRequest(input *GetDomainsInput) (req *request.Request, output *GetDomainsOutput) { - op := &request.Operation{ - Name: opGetDomains, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDomainsInput{} - } - - output = &GetDomainsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDomains API operation for Amazon Lightsail. -// -// Returns a list of all domains in the user's 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 Lightsail's -// API operation GetDomains for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomains -func (c *Lightsail) GetDomains(input *GetDomainsInput) (*GetDomainsOutput, error) { - req, out := c.GetDomainsRequest(input) - err := req.Send() - return out, err -} - -const opGetInstance = "GetInstance" - -// GetInstanceRequest generates a "aws/request.Request" representing the -// client's request for the GetInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstanceRequest method. -// req, resp := client.GetInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstance -func (c *Lightsail) GetInstanceRequest(input *GetInstanceInput) (req *request.Request, output *GetInstanceOutput) { - op := &request.Operation{ - Name: opGetInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstanceInput{} - } - - output = &GetInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstance API operation for Amazon Lightsail. -// -// Returns information about a specific Amazon Lightsail instance, which is -// a virtual private server. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation GetInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstance -func (c *Lightsail) GetInstance(input *GetInstanceInput) (*GetInstanceOutput, error) { - req, out := c.GetInstanceRequest(input) - err := req.Send() - return out, err -} - -const opGetInstanceAccessDetails = "GetInstanceAccessDetails" - -// GetInstanceAccessDetailsRequest generates a "aws/request.Request" representing the -// client's request for the GetInstanceAccessDetails operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstanceAccessDetails for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstanceAccessDetails method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstanceAccessDetailsRequest method. -// req, resp := client.GetInstanceAccessDetailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetails -func (c *Lightsail) GetInstanceAccessDetailsRequest(input *GetInstanceAccessDetailsInput) (req *request.Request, output *GetInstanceAccessDetailsOutput) { - op := &request.Operation{ - Name: opGetInstanceAccessDetails, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstanceAccessDetailsInput{} - } - - output = &GetInstanceAccessDetailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstanceAccessDetails API operation for Amazon Lightsail. -// -// Returns temporary SSH keys you can use to connect to a specific virtual private -// server, or 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 Lightsail's -// API operation GetInstanceAccessDetails for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetails -func (c *Lightsail) GetInstanceAccessDetails(input *GetInstanceAccessDetailsInput) (*GetInstanceAccessDetailsOutput, error) { - req, out := c.GetInstanceAccessDetailsRequest(input) - err := req.Send() - return out, err -} - -const opGetInstanceMetricData = "GetInstanceMetricData" - -// GetInstanceMetricDataRequest generates a "aws/request.Request" representing the -// client's request for the GetInstanceMetricData operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstanceMetricData for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstanceMetricData method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstanceMetricDataRequest method. -// req, resp := client.GetInstanceMetricDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricData -func (c *Lightsail) GetInstanceMetricDataRequest(input *GetInstanceMetricDataInput) (req *request.Request, output *GetInstanceMetricDataOutput) { - op := &request.Operation{ - Name: opGetInstanceMetricData, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstanceMetricDataInput{} - } - - output = &GetInstanceMetricDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstanceMetricData API operation for Amazon Lightsail. -// -// Returns the data points for the specified Amazon Lightsail instance metric, -// given an instance 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 Lightsail's -// API operation GetInstanceMetricData for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricData -func (c *Lightsail) GetInstanceMetricData(input *GetInstanceMetricDataInput) (*GetInstanceMetricDataOutput, error) { - req, out := c.GetInstanceMetricDataRequest(input) - err := req.Send() - return out, err -} - -const opGetInstancePortStates = "GetInstancePortStates" - -// GetInstancePortStatesRequest generates a "aws/request.Request" representing the -// client's request for the GetInstancePortStates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstancePortStates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstancePortStates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstancePortStatesRequest method. -// req, resp := client.GetInstancePortStatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStates -func (c *Lightsail) GetInstancePortStatesRequest(input *GetInstancePortStatesInput) (req *request.Request, output *GetInstancePortStatesOutput) { - op := &request.Operation{ - Name: opGetInstancePortStates, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstancePortStatesInput{} - } - - output = &GetInstancePortStatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstancePortStates API operation for Amazon Lightsail. -// -// Returns the port states for a specific virtual private server, or 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 Lightsail's -// API operation GetInstancePortStates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStates -func (c *Lightsail) GetInstancePortStates(input *GetInstancePortStatesInput) (*GetInstancePortStatesOutput, error) { - req, out := c.GetInstancePortStatesRequest(input) - err := req.Send() - return out, err -} - -const opGetInstanceSnapshot = "GetInstanceSnapshot" - -// GetInstanceSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the GetInstanceSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstanceSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstanceSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstanceSnapshotRequest method. -// req, resp := client.GetInstanceSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshot -func (c *Lightsail) GetInstanceSnapshotRequest(input *GetInstanceSnapshotInput) (req *request.Request, output *GetInstanceSnapshotOutput) { - op := &request.Operation{ - Name: opGetInstanceSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstanceSnapshotInput{} - } - - output = &GetInstanceSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstanceSnapshot API operation for Amazon Lightsail. -// -// Returns information about a specific instance 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 Lightsail's -// API operation GetInstanceSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshot -func (c *Lightsail) GetInstanceSnapshot(input *GetInstanceSnapshotInput) (*GetInstanceSnapshotOutput, error) { - req, out := c.GetInstanceSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opGetInstanceSnapshots = "GetInstanceSnapshots" - -// GetInstanceSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the GetInstanceSnapshots operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstanceSnapshots for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstanceSnapshots method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstanceSnapshotsRequest method. -// req, resp := client.GetInstanceSnapshotsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshots -func (c *Lightsail) GetInstanceSnapshotsRequest(input *GetInstanceSnapshotsInput) (req *request.Request, output *GetInstanceSnapshotsOutput) { - op := &request.Operation{ - Name: opGetInstanceSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstanceSnapshotsInput{} - } - - output = &GetInstanceSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstanceSnapshots API operation for Amazon Lightsail. -// -// Returns all instance snapshots for the user's 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 Lightsail's -// API operation GetInstanceSnapshots for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshots -func (c *Lightsail) GetInstanceSnapshots(input *GetInstanceSnapshotsInput) (*GetInstanceSnapshotsOutput, error) { - req, out := c.GetInstanceSnapshotsRequest(input) - err := req.Send() - return out, err -} - -const opGetInstanceState = "GetInstanceState" - -// GetInstanceStateRequest generates a "aws/request.Request" representing the -// client's request for the GetInstanceState operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstanceState for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstanceState method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstanceStateRequest method. -// req, resp := client.GetInstanceStateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceState -func (c *Lightsail) GetInstanceStateRequest(input *GetInstanceStateInput) (req *request.Request, output *GetInstanceStateOutput) { - op := &request.Operation{ - Name: opGetInstanceState, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstanceStateInput{} - } - - output = &GetInstanceStateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstanceState API operation for Amazon Lightsail. -// -// Returns the state of a specific instance. Works on one instance 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 Lightsail's -// API operation GetInstanceState for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceState -func (c *Lightsail) GetInstanceState(input *GetInstanceStateInput) (*GetInstanceStateOutput, error) { - req, out := c.GetInstanceStateRequest(input) - err := req.Send() - return out, err -} - -const opGetInstances = "GetInstances" - -// GetInstancesRequest generates a "aws/request.Request" representing the -// client's request for the GetInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInstancesRequest method. -// req, resp := client.GetInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstances -func (c *Lightsail) GetInstancesRequest(input *GetInstancesInput) (req *request.Request, output *GetInstancesOutput) { - op := &request.Operation{ - Name: opGetInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInstancesInput{} - } - - output = &GetInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstances API operation for Amazon Lightsail. -// -// Returns information about all Amazon Lightsail virtual private servers, or -// 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 Lightsail's -// API operation GetInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstances -func (c *Lightsail) GetInstances(input *GetInstancesInput) (*GetInstancesOutput, error) { - req, out := c.GetInstancesRequest(input) - err := req.Send() - return out, err -} - -const opGetKeyPair = "GetKeyPair" - -// GetKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the GetKeyPair operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetKeyPair for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetKeyPair method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetKeyPairRequest method. -// req, resp := client.GetKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPair -func (c *Lightsail) GetKeyPairRequest(input *GetKeyPairInput) (req *request.Request, output *GetKeyPairOutput) { - op := &request.Operation{ - Name: opGetKeyPair, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetKeyPairInput{} - } - - output = &GetKeyPairOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetKeyPair API operation for Amazon Lightsail. -// -// Returns information about a specific key pair. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation GetKeyPair for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPair -func (c *Lightsail) GetKeyPair(input *GetKeyPairInput) (*GetKeyPairOutput, error) { - req, out := c.GetKeyPairRequest(input) - err := req.Send() - return out, err -} - -const opGetKeyPairs = "GetKeyPairs" - -// GetKeyPairsRequest generates a "aws/request.Request" representing the -// client's request for the GetKeyPairs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetKeyPairs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetKeyPairs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetKeyPairsRequest method. -// req, resp := client.GetKeyPairsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairs -func (c *Lightsail) GetKeyPairsRequest(input *GetKeyPairsInput) (req *request.Request, output *GetKeyPairsOutput) { - op := &request.Operation{ - Name: opGetKeyPairs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetKeyPairsInput{} - } - - output = &GetKeyPairsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetKeyPairs API operation for Amazon Lightsail. -// -// Returns information about all key pairs in the user's 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 Lightsail's -// API operation GetKeyPairs for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairs -func (c *Lightsail) GetKeyPairs(input *GetKeyPairsInput) (*GetKeyPairsOutput, error) { - req, out := c.GetKeyPairsRequest(input) - err := req.Send() - return out, err -} - -const opGetOperation = "GetOperation" - -// GetOperationRequest generates a "aws/request.Request" representing the -// client's request for the GetOperation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetOperation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetOperation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetOperationRequest method. -// req, resp := client.GetOperationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperation -func (c *Lightsail) GetOperationRequest(input *GetOperationInput) (req *request.Request, output *GetOperationOutput) { - op := &request.Operation{ - Name: opGetOperation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetOperationInput{} - } - - output = &GetOperationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOperation API operation for Amazon Lightsail. -// -// Returns information about a specific operation. Operations include events -// such as when you create an instance, allocate a static IP, attach a static -// IP, 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 Lightsail's -// API operation GetOperation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperation -func (c *Lightsail) GetOperation(input *GetOperationInput) (*GetOperationOutput, error) { - req, out := c.GetOperationRequest(input) - err := req.Send() - return out, err -} - -const opGetOperations = "GetOperations" - -// GetOperationsRequest generates a "aws/request.Request" representing the -// client's request for the GetOperations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetOperations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetOperations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetOperationsRequest method. -// req, resp := client.GetOperationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperations -func (c *Lightsail) GetOperationsRequest(input *GetOperationsInput) (req *request.Request, output *GetOperationsOutput) { - op := &request.Operation{ - Name: opGetOperations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetOperationsInput{} - } - - output = &GetOperationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOperations API operation for Amazon Lightsail. -// -// Returns information about all operations. -// -// Results are returned from oldest to newest, up to a maximum of 200. Results -// can be paged by making each subsequent call to GetOperations use the maximum -// (last) statusChangedAt value from 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 Lightsail's -// API operation GetOperations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperations -func (c *Lightsail) GetOperations(input *GetOperationsInput) (*GetOperationsOutput, error) { - req, out := c.GetOperationsRequest(input) - err := req.Send() - return out, err -} - -const opGetOperationsForResource = "GetOperationsForResource" - -// GetOperationsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the GetOperationsForResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetOperationsForResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetOperationsForResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetOperationsForResourceRequest method. -// req, resp := client.GetOperationsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResource -func (c *Lightsail) GetOperationsForResourceRequest(input *GetOperationsForResourceInput) (req *request.Request, output *GetOperationsForResourceOutput) { - op := &request.Operation{ - Name: opGetOperationsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetOperationsForResourceInput{} - } - - output = &GetOperationsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOperationsForResource API operation for Amazon Lightsail. -// -// Gets operations for a specific resource (e.g., an instance or a static IP). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation GetOperationsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResource -func (c *Lightsail) GetOperationsForResource(input *GetOperationsForResourceInput) (*GetOperationsForResourceOutput, error) { - req, out := c.GetOperationsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opGetRegions = "GetRegions" - -// GetRegionsRequest generates a "aws/request.Request" representing the -// client's request for the GetRegions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRegions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRegions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRegionsRequest method. -// req, resp := client.GetRegionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegions -func (c *Lightsail) GetRegionsRequest(input *GetRegionsInput) (req *request.Request, output *GetRegionsOutput) { - op := &request.Operation{ - Name: opGetRegions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRegionsInput{} - } - - output = &GetRegionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRegions API operation for Amazon Lightsail. -// -// Returns a list of all valid regions for Amazon Lightsail. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation GetRegions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegions -func (c *Lightsail) GetRegions(input *GetRegionsInput) (*GetRegionsOutput, error) { - req, out := c.GetRegionsRequest(input) - err := req.Send() - return out, err -} - -const opGetStaticIp = "GetStaticIp" - -// GetStaticIpRequest generates a "aws/request.Request" representing the -// client's request for the GetStaticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetStaticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetStaticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetStaticIpRequest method. -// req, resp := client.GetStaticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIp -func (c *Lightsail) GetStaticIpRequest(input *GetStaticIpInput) (req *request.Request, output *GetStaticIpOutput) { - op := &request.Operation{ - Name: opGetStaticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetStaticIpInput{} - } - - output = &GetStaticIpOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStaticIp API operation for Amazon Lightsail. -// -// Returns information about a specific static IP. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation GetStaticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIp -func (c *Lightsail) GetStaticIp(input *GetStaticIpInput) (*GetStaticIpOutput, error) { - req, out := c.GetStaticIpRequest(input) - err := req.Send() - return out, err -} - -const opGetStaticIps = "GetStaticIps" - -// GetStaticIpsRequest generates a "aws/request.Request" representing the -// client's request for the GetStaticIps operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetStaticIps for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetStaticIps method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetStaticIpsRequest method. -// req, resp := client.GetStaticIpsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIps -func (c *Lightsail) GetStaticIpsRequest(input *GetStaticIpsInput) (req *request.Request, output *GetStaticIpsOutput) { - op := &request.Operation{ - Name: opGetStaticIps, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetStaticIpsInput{} - } - - output = &GetStaticIpsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStaticIps API operation for Amazon Lightsail. -// -// Returns information about all static IPs in the user's 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 Lightsail's -// API operation GetStaticIps for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIps -func (c *Lightsail) GetStaticIps(input *GetStaticIpsInput) (*GetStaticIpsOutput, error) { - req, out := c.GetStaticIpsRequest(input) - err := req.Send() - return out, err -} - -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/lightsail-2016-11-28/ImportKeyPair -func (c *Lightsail) 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 Lightsail. -// -// Imports a public SSH key from a specific key pair. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation ImportKeyPair for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ImportKeyPair -func (c *Lightsail) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, error) { - req, out := c.ImportKeyPairRequest(input) - err := req.Send() - return out, err -} - -const opIsVpcPeered = "IsVpcPeered" - -// IsVpcPeeredRequest generates a "aws/request.Request" representing the -// client's request for the IsVpcPeered operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See IsVpcPeered for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the IsVpcPeered method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the IsVpcPeeredRequest method. -// req, resp := client.IsVpcPeeredRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeered -func (c *Lightsail) IsVpcPeeredRequest(input *IsVpcPeeredInput) (req *request.Request, output *IsVpcPeeredOutput) { - op := &request.Operation{ - Name: opIsVpcPeered, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &IsVpcPeeredInput{} - } - - output = &IsVpcPeeredOutput{} - req = c.newRequest(op, input, output) - return -} - -// IsVpcPeered API operation for Amazon Lightsail. -// -// Returns a Boolean value indicating whether your Lightsail VPC is peered. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation IsVpcPeered for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeered -func (c *Lightsail) IsVpcPeered(input *IsVpcPeeredInput) (*IsVpcPeeredOutput, error) { - req, out := c.IsVpcPeeredRequest(input) - err := req.Send() - return out, err -} - -const opOpenInstancePublicPorts = "OpenInstancePublicPorts" - -// OpenInstancePublicPortsRequest generates a "aws/request.Request" representing the -// client's request for the OpenInstancePublicPorts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See OpenInstancePublicPorts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OpenInstancePublicPorts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the OpenInstancePublicPortsRequest method. -// req, resp := client.OpenInstancePublicPortsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPorts -func (c *Lightsail) OpenInstancePublicPortsRequest(input *OpenInstancePublicPortsInput) (req *request.Request, output *OpenInstancePublicPortsOutput) { - op := &request.Operation{ - Name: opOpenInstancePublicPorts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &OpenInstancePublicPortsInput{} - } - - output = &OpenInstancePublicPortsOutput{} - req = c.newRequest(op, input, output) - return -} - -// OpenInstancePublicPorts API operation for Amazon Lightsail. -// -// Adds public ports to an Amazon Lightsail 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 Lightsail's -// API operation OpenInstancePublicPorts for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPorts -func (c *Lightsail) OpenInstancePublicPorts(input *OpenInstancePublicPortsInput) (*OpenInstancePublicPortsOutput, error) { - req, out := c.OpenInstancePublicPortsRequest(input) - err := req.Send() - return out, err -} - -const opPeerVpc = "PeerVpc" - -// PeerVpcRequest generates a "aws/request.Request" representing the -// client's request for the PeerVpc operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PeerVpc for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PeerVpc method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PeerVpcRequest method. -// req, resp := client.PeerVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpc -func (c *Lightsail) PeerVpcRequest(input *PeerVpcInput) (req *request.Request, output *PeerVpcOutput) { - op := &request.Operation{ - Name: opPeerVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PeerVpcInput{} - } - - output = &PeerVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// PeerVpc API operation for Amazon Lightsail. -// -// Tries to peer the Lightsail VPC with the user's default 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 Lightsail's -// API operation PeerVpc for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpc -func (c *Lightsail) PeerVpc(input *PeerVpcInput) (*PeerVpcOutput, error) { - req, out := c.PeerVpcRequest(input) - err := req.Send() - return out, err -} - -const opRebootInstance = "RebootInstance" - -// RebootInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RebootInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RebootInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RebootInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RebootInstanceRequest method. -// req, resp := client.RebootInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstance -func (c *Lightsail) RebootInstanceRequest(input *RebootInstanceInput) (req *request.Request, output *RebootInstanceOutput) { - op := &request.Operation{ - Name: opRebootInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RebootInstanceInput{} - } - - output = &RebootInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// RebootInstance API operation for Amazon Lightsail. -// -// Restarts a specific instance. When your Amazon Lightsail instance is finished -// rebooting, Lightsail assigns a new public IP address. To use the same IP -// address after restarting, create a static IP address and attach it to the -// 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 Lightsail's -// API operation RebootInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstance -func (c *Lightsail) RebootInstance(input *RebootInstanceInput) (*RebootInstanceOutput, error) { - req, out := c.RebootInstanceRequest(input) - err := req.Send() - return out, err -} - -const opReleaseStaticIp = "ReleaseStaticIp" - -// ReleaseStaticIpRequest generates a "aws/request.Request" representing the -// client's request for the ReleaseStaticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReleaseStaticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReleaseStaticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReleaseStaticIpRequest method. -// req, resp := client.ReleaseStaticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIp -func (c *Lightsail) ReleaseStaticIpRequest(input *ReleaseStaticIpInput) (req *request.Request, output *ReleaseStaticIpOutput) { - op := &request.Operation{ - Name: opReleaseStaticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReleaseStaticIpInput{} - } - - output = &ReleaseStaticIpOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReleaseStaticIp API operation for Amazon Lightsail. -// -// Deletes a specific static IP from 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 Lightsail's -// API operation ReleaseStaticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIp -func (c *Lightsail) ReleaseStaticIp(input *ReleaseStaticIpInput) (*ReleaseStaticIpOutput, error) { - req, out := c.ReleaseStaticIpRequest(input) - err := req.Send() - return out, err -} - -const opStartInstance = "StartInstance" - -// StartInstanceRequest generates a "aws/request.Request" representing the -// client's request for the StartInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartInstanceRequest method. -// req, resp := client.StartInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstance -func (c *Lightsail) StartInstanceRequest(input *StartInstanceInput) (req *request.Request, output *StartInstanceOutput) { - op := &request.Operation{ - Name: opStartInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartInstanceInput{} - } - - output = &StartInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartInstance API operation for Amazon Lightsail. -// -// Starts a specific Amazon Lightsail instance from a stopped state. To restart -// an instance, use the reboot instance 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 Lightsail's -// API operation StartInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstance -func (c *Lightsail) StartInstance(input *StartInstanceInput) (*StartInstanceOutput, error) { - req, out := c.StartInstanceRequest(input) - err := req.Send() - return out, err -} - -const opStopInstance = "StopInstance" - -// StopInstanceRequest generates a "aws/request.Request" representing the -// client's request for the StopInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopInstanceRequest method. -// req, resp := client.StopInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstance -func (c *Lightsail) StopInstanceRequest(input *StopInstanceInput) (req *request.Request, output *StopInstanceOutput) { - op := &request.Operation{ - Name: opStopInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopInstanceInput{} - } - - output = &StopInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopInstance API operation for Amazon Lightsail. -// -// Stops a specific Amazon Lightsail instance that is currently running. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Lightsail's -// API operation StopInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstance -func (c *Lightsail) StopInstance(input *StopInstanceInput) (*StopInstanceOutput, error) { - req, out := c.StopInstanceRequest(input) - err := req.Send() - return out, err -} - -const opUnpeerVpc = "UnpeerVpc" - -// UnpeerVpcRequest generates a "aws/request.Request" representing the -// client's request for the UnpeerVpc operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UnpeerVpc for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UnpeerVpc method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UnpeerVpcRequest method. -// req, resp := client.UnpeerVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpc -func (c *Lightsail) UnpeerVpcRequest(input *UnpeerVpcInput) (req *request.Request, output *UnpeerVpcOutput) { - op := &request.Operation{ - Name: opUnpeerVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnpeerVpcInput{} - } - - output = &UnpeerVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// UnpeerVpc API operation for Amazon Lightsail. -// -// Attempts to unpeer the Lightsail VPC from the user's default 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 Lightsail's -// API operation UnpeerVpc for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpc -func (c *Lightsail) UnpeerVpc(input *UnpeerVpcInput) (*UnpeerVpcOutput, error) { - req, out := c.UnpeerVpcRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDomainEntry = "UpdateDomainEntry" - -// UpdateDomainEntryRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDomainEntry operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDomainEntry for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDomainEntry method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDomainEntryRequest method. -// req, resp := client.UpdateDomainEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntry -func (c *Lightsail) UpdateDomainEntryRequest(input *UpdateDomainEntryInput) (req *request.Request, output *UpdateDomainEntryOutput) { - op := &request.Operation{ - Name: opUpdateDomainEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateDomainEntryInput{} - } - - output = &UpdateDomainEntryOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDomainEntry API operation for Amazon Lightsail. -// -// Updates a domain recordset after it is 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 Lightsail's -// API operation UpdateDomainEntry for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// A general service exception. -// -// * ErrCodeInvalidInputException "InvalidInputException" -// Lightsail throws this exception when user input does not conform to the validation -// rules of an input field. -// -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" -// Lightsail throws this exception when an operation fails to execute. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// Lightsail throws this exception when the user cannot be authenticated or -// uses invalid credentials to access a resource. -// -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" -// Lightsail throws this exception when an account is still in the setup in -// progress state. -// -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntry -func (c *Lightsail) UpdateDomainEntry(input *UpdateDomainEntryInput) (*UpdateDomainEntryOutput, error) { - req, out := c.UpdateDomainEntryRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIpRequest -type AllocateStaticIpInput struct { - _ struct{} `type:"structure"` - - // The name of the static IP address. - // - // StaticIpName is a required field - StaticIpName *string `locationName:"staticIpName" type:"string" required:"true"` -} - -// String returns the string representation -func (s AllocateStaticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateStaticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AllocateStaticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AllocateStaticIpInput"} - if s.StaticIpName == nil { - invalidParams.Add(request.NewErrParamRequired("StaticIpName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStaticIpName sets the StaticIpName field's value. -func (s *AllocateStaticIpInput) SetStaticIpName(v string) *AllocateStaticIpInput { - s.StaticIpName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIpResult -type AllocateStaticIpOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the static IP address - // you allocated. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s AllocateStaticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateStaticIpOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *AllocateStaticIpOutput) SetOperations(v []*Operation) *AllocateStaticIpOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIpRequest -type AttachStaticIpInput struct { - _ struct{} `type:"structure"` - - // The instance name to which you want to attach the static IP address. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` - - // The name of the static IP. - // - // StaticIpName is a required field - StaticIpName *string `locationName:"staticIpName" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachStaticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachStaticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachStaticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachStaticIpInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - if s.StaticIpName == nil { - invalidParams.Add(request.NewErrParamRequired("StaticIpName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *AttachStaticIpInput) SetInstanceName(v string) *AttachStaticIpInput { - s.InstanceName = &v - return s -} - -// SetStaticIpName sets the StaticIpName field's value. -func (s *AttachStaticIpInput) SetStaticIpName(v string) *AttachStaticIpInput { - s.StaticIpName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIpResult -type AttachStaticIpOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about your API operations. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s AttachStaticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachStaticIpOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *AttachStaticIpOutput) SetOperations(v []*Operation) *AttachStaticIpOutput { - s.Operations = v - return s -} - -// Describes an Availability Zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AvailabilityZone -type AvailabilityZone struct { - _ struct{} `type:"structure"` - - // The state of the Availability Zone. - State *string `locationName:"state" type:"string"` - - // 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() -} - -// 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 blueprint (a virtual private server image). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/Blueprint -type Blueprint struct { - _ struct{} `type:"structure"` - - // The ID for the virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0). - BlueprintId *string `locationName:"blueprintId" type:"string"` - - // The description of the blueprint. - Description *string `locationName:"description" type:"string"` - - // The group name of the blueprint (e.g., amazon-linux). - Group *string `locationName:"group" type:"string"` - - // A Boolean value indicating whether the blueprint is active. When you update - // your blueprints, you will inactivate old blueprints and keep the most recent - // versions active. - IsActive *bool `locationName:"isActive" type:"boolean"` - - // The end-user license agreement URL for the image or blueprint. - LicenseUrl *string `locationName:"licenseUrl" type:"string"` - - // The minimum machine size required to run this blueprint. 0 indicates that - // the blueprint runs on all instances. - MinPower *int64 `locationName:"minPower" type:"integer"` - - // The friendly name of the blueprint (e.g., Amazon Linux). - Name *string `locationName:"name" type:"string"` - - // The product URL to learn more about the image or blueprint. - ProductUrl *string `locationName:"productUrl" type:"string"` - - // The type of the blueprint (e.g., os or app). - Type *string `locationName:"type" type:"string" enum:"BlueprintType"` - - // The version number of the operating system, application, or stack (e.g., - // 2016.03.0). - Version *string `locationName:"version" type:"string"` - - // The version code. - VersionCode *string `locationName:"versionCode" type:"string"` -} - -// String returns the string representation -func (s Blueprint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Blueprint) GoString() string { - return s.String() -} - -// SetBlueprintId sets the BlueprintId field's value. -func (s *Blueprint) SetBlueprintId(v string) *Blueprint { - s.BlueprintId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Blueprint) SetDescription(v string) *Blueprint { - s.Description = &v - return s -} - -// SetGroup sets the Group field's value. -func (s *Blueprint) SetGroup(v string) *Blueprint { - s.Group = &v - return s -} - -// SetIsActive sets the IsActive field's value. -func (s *Blueprint) SetIsActive(v bool) *Blueprint { - s.IsActive = &v - return s -} - -// SetLicenseUrl sets the LicenseUrl field's value. -func (s *Blueprint) SetLicenseUrl(v string) *Blueprint { - s.LicenseUrl = &v - return s -} - -// SetMinPower sets the MinPower field's value. -func (s *Blueprint) SetMinPower(v int64) *Blueprint { - s.MinPower = &v - return s -} - -// SetName sets the Name field's value. -func (s *Blueprint) SetName(v string) *Blueprint { - s.Name = &v - return s -} - -// SetProductUrl sets the ProductUrl field's value. -func (s *Blueprint) SetProductUrl(v string) *Blueprint { - s.ProductUrl = &v - return s -} - -// SetType sets the Type field's value. -func (s *Blueprint) SetType(v string) *Blueprint { - s.Type = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *Blueprint) SetVersion(v string) *Blueprint { - s.Version = &v - return s -} - -// SetVersionCode sets the VersionCode field's value. -func (s *Blueprint) SetVersionCode(v string) *Blueprint { - s.VersionCode = &v - return s -} - -// Describes a bundle, which is a set of specs describing your virtual private -// server (or instance). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/Bundle -type Bundle struct { - _ struct{} `type:"structure"` - - // The bundle ID (e.g., micro_1_0). - BundleId *string `locationName:"bundleId" type:"string"` - - // The number of vCPUs included in the bundle (e.g., 2). - CpuCount *int64 `locationName:"cpuCount" type:"integer"` - - // The size of the SSD (e.g., 30). - DiskSizeInGb *int64 `locationName:"diskSizeInGb" type:"integer"` - - // The Amazon EC2 instance type (e.g., t2.micro). - InstanceType *string `locationName:"instanceType" type:"string"` - - // A Boolean value indicating whether the bundle is active. - IsActive *bool `locationName:"isActive" type:"boolean"` - - // A friendly name for the bundle (e.g., Micro). - Name *string `locationName:"name" type:"string"` - - // The power of the bundle (e.g., 500). - Power *int64 `locationName:"power" type:"integer"` - - // The price in US dollars (e.g., 5.0). - Price *float64 `locationName:"price" type:"float"` - - // The amount of RAM in GB (e.g., 2.0). - RamSizeInGb *float64 `locationName:"ramSizeInGb" type:"float"` - - // The data transfer rate per month in GB (e.g., 2000). - TransferPerMonthInGb *int64 `locationName:"transferPerMonthInGb" type:"integer"` -} - -// String returns the string representation -func (s Bundle) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Bundle) GoString() string { - return s.String() -} - -// SetBundleId sets the BundleId field's value. -func (s *Bundle) SetBundleId(v string) *Bundle { - s.BundleId = &v - return s -} - -// SetCpuCount sets the CpuCount field's value. -func (s *Bundle) SetCpuCount(v int64) *Bundle { - s.CpuCount = &v - return s -} - -// SetDiskSizeInGb sets the DiskSizeInGb field's value. -func (s *Bundle) SetDiskSizeInGb(v int64) *Bundle { - s.DiskSizeInGb = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *Bundle) SetInstanceType(v string) *Bundle { - s.InstanceType = &v - return s -} - -// SetIsActive sets the IsActive field's value. -func (s *Bundle) SetIsActive(v bool) *Bundle { - s.IsActive = &v - return s -} - -// SetName sets the Name field's value. -func (s *Bundle) SetName(v string) *Bundle { - s.Name = &v - return s -} - -// SetPower sets the Power field's value. -func (s *Bundle) SetPower(v int64) *Bundle { - s.Power = &v - return s -} - -// SetPrice sets the Price field's value. -func (s *Bundle) SetPrice(v float64) *Bundle { - s.Price = &v - return s -} - -// SetRamSizeInGb sets the RamSizeInGb field's value. -func (s *Bundle) SetRamSizeInGb(v float64) *Bundle { - s.RamSizeInGb = &v - return s -} - -// SetTransferPerMonthInGb sets the TransferPerMonthInGb field's value. -func (s *Bundle) SetTransferPerMonthInGb(v int64) *Bundle { - s.TransferPerMonthInGb = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPortsRequest -type CloseInstancePublicPortsInput struct { - _ struct{} `type:"structure"` - - // The name of the instance on which you're attempting to close the public ports. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` - - // Information about the public port you are trying to close. - // - // PortInfo is a required field - PortInfo *PortInfo `locationName:"portInfo" type:"structure" required:"true"` -} - -// String returns the string representation -func (s CloseInstancePublicPortsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloseInstancePublicPortsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloseInstancePublicPortsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloseInstancePublicPortsInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - if s.PortInfo == nil { - invalidParams.Add(request.NewErrParamRequired("PortInfo")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *CloseInstancePublicPortsInput) SetInstanceName(v string) *CloseInstancePublicPortsInput { - s.InstanceName = &v - return s -} - -// SetPortInfo sets the PortInfo field's value. -func (s *CloseInstancePublicPortsInput) SetPortInfo(v *PortInfo) *CloseInstancePublicPortsInput { - s.PortInfo = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPortsResult -type CloseInstancePublicPortsOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs that contains information about the operation. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s CloseInstancePublicPortsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloseInstancePublicPortsOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *CloseInstancePublicPortsOutput) SetOperation(v *Operation) *CloseInstancePublicPortsOutput { - s.Operation = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntryRequest -type CreateDomainEntryInput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the domain entry - // request. - // - // DomainEntry is a required field - DomainEntry *DomainEntry `locationName:"domainEntry" type:"structure" required:"true"` - - // The domain name (e.g., example.com) for which you want to create the domain - // entry. - // - // DomainName is a required field - DomainName *string `locationName:"domainName" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateDomainEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDomainEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDomainEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDomainEntryInput"} - if s.DomainEntry == nil { - invalidParams.Add(request.NewErrParamRequired("DomainEntry")) - } - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainEntry sets the DomainEntry field's value. -func (s *CreateDomainEntryInput) SetDomainEntry(v *DomainEntry) *CreateDomainEntryInput { - s.DomainEntry = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *CreateDomainEntryInput) SetDomainName(v string) *CreateDomainEntryInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntryResult -type CreateDomainEntryOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the operation. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s CreateDomainEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDomainEntryOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *CreateDomainEntryOutput) SetOperation(v *Operation) *CreateDomainEntryOutput { - s.Operation = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainRequest -type CreateDomainInput struct { - _ struct{} `type:"structure"` - - // The domain name to manage (e.g., example.com). - // - // You cannot register a new domain name using Lightsail. You must register - // a domain name using Amazon Route 53 or another domain name registrar. If - // you have already registered your domain, you can enter its name in this parameter - // to manage the DNS records for that domain. - // - // DomainName is a required field - DomainName *string `locationName:"domainName" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDomainInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *CreateDomainInput) SetDomainName(v string) *CreateDomainInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainResult -type CreateDomainOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the domain resource - // you created. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s CreateDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDomainOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *CreateDomainOutput) SetOperation(v *Operation) *CreateDomainOutput { - s.Operation = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshotRequest -type CreateInstanceSnapshotInput struct { - _ struct{} `type:"structure"` - - // The Lightsail instance on which to base your snapshot. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` - - // The name for your new snapshot. - // - // InstanceSnapshotName is a required field - InstanceSnapshotName *string `locationName:"instanceSnapshotName" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateInstanceSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInstanceSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInstanceSnapshotInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - if s.InstanceSnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceSnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *CreateInstanceSnapshotInput) SetInstanceName(v string) *CreateInstanceSnapshotInput { - s.InstanceName = &v - return s -} - -// SetInstanceSnapshotName sets the InstanceSnapshotName field's value. -func (s *CreateInstanceSnapshotInput) SetInstanceSnapshotName(v string) *CreateInstanceSnapshotInput { - s.InstanceSnapshotName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshotResult -type CreateInstanceSnapshotOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // create instances snapshot request. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s CreateInstanceSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceSnapshotOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *CreateInstanceSnapshotOutput) SetOperations(v []*Operation) *CreateInstanceSnapshotOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshotRequest -type CreateInstancesFromSnapshotInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone where you want to create your instances. Use the following - // formatting: us-east-1a (case sensitive). - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // The bundle of specification information for your virtual private server (or - // instance), including the pricing plan (e.g., micro_1_0). - // - // BundleId is a required field - BundleId *string `locationName:"bundleId" type:"string" required:"true"` - - // The names for your new instances. - // - // InstanceNames is a required field - InstanceNames []*string `locationName:"instanceNames" type:"list" required:"true"` - - // The name of the instance snapshot on which you are basing your new instances. - // Use the get instance snapshots operation to return information about your - // existing snapshots. - // - // InstanceSnapshotName is a required field - InstanceSnapshotName *string `locationName:"instanceSnapshotName" type:"string" required:"true"` - - // The name for your key pair. - KeyPairName *string `locationName:"keyPairName" type:"string"` - - // You can create a launch script that configures a server with additional user - // data. For example, apt-get –y update. - // - // Depending on the machine image you choose, the command to get software on - // your instance varies. Amazon Linux and CentOS use yum, Debian and Ubuntu - // use apt-get, and FreeBSD uses pkg. For a complete list, see the Dev Guide - // (http://lightsail.aws.amazon.com/ls/docs/getting-started/articles/pre-installed-apps). - UserData *string `locationName:"userData" type:"string"` -} - -// String returns the string representation -func (s CreateInstancesFromSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstancesFromSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInstancesFromSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInstancesFromSnapshotInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - if s.BundleId == nil { - invalidParams.Add(request.NewErrParamRequired("BundleId")) - } - if s.InstanceNames == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceNames")) - } - if s.InstanceSnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceSnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateInstancesFromSnapshotInput) SetAvailabilityZone(v string) *CreateInstancesFromSnapshotInput { - s.AvailabilityZone = &v - return s -} - -// SetBundleId sets the BundleId field's value. -func (s *CreateInstancesFromSnapshotInput) SetBundleId(v string) *CreateInstancesFromSnapshotInput { - s.BundleId = &v - return s -} - -// SetInstanceNames sets the InstanceNames field's value. -func (s *CreateInstancesFromSnapshotInput) SetInstanceNames(v []*string) *CreateInstancesFromSnapshotInput { - s.InstanceNames = v - return s -} - -// SetInstanceSnapshotName sets the InstanceSnapshotName field's value. -func (s *CreateInstancesFromSnapshotInput) SetInstanceSnapshotName(v string) *CreateInstancesFromSnapshotInput { - s.InstanceSnapshotName = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *CreateInstancesFromSnapshotInput) SetKeyPairName(v string) *CreateInstancesFromSnapshotInput { - s.KeyPairName = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *CreateInstancesFromSnapshotInput) SetUserData(v string) *CreateInstancesFromSnapshotInput { - s.UserData = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshotResult -type CreateInstancesFromSnapshotOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // create instances from snapshot request. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s CreateInstancesFromSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstancesFromSnapshotOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *CreateInstancesFromSnapshotOutput) SetOperations(v []*Operation) *CreateInstancesFromSnapshotOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesRequest -type CreateInstancesInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which to create your instance. Use the following - // format: us-east-1a (case sensitive). - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0). - // Use the get blueprints operation to return a list of available images (or - // blueprints). - // - // BlueprintId is a required field - BlueprintId *string `locationName:"blueprintId" type:"string" required:"true"` - - // The bundle of specification information for your virtual private server (or - // instance), including the pricing plan (e.g., micro_1_0). - // - // BundleId is a required field - BundleId *string `locationName:"bundleId" type:"string" required:"true"` - - // The name for your custom image. - CustomImageName *string `locationName:"customImageName" type:"string"` - - // The names to use for your new Lightsail instances. Separate multiple values - // using quotation marks and commas, for example: ["MyFirstInstance","MySecondInstance"] - // - // InstanceNames is a required field - InstanceNames []*string `locationName:"instanceNames" type:"list" required:"true"` - - // The name of your key pair. - KeyPairName *string `locationName:"keyPairName" type:"string"` - - // A launch script you can create that configures a server with additional user - // data. For example, you might want to run apt-get –y update. - // - // Depending on the machine image you choose, the command to get software on - // your instance varies. Amazon Linux and CentOS use yum, Debian and Ubuntu - // use apt-get, and FreeBSD uses pkg. For a complete list, see the Dev Guide - // (http://lightsail.aws.amazon.com/ls/docs/getting-started/articles/pre-installed-apps). - UserData *string `locationName:"userData" type:"string"` -} - -// String returns the string representation -func (s CreateInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInstancesInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - if s.BlueprintId == nil { - invalidParams.Add(request.NewErrParamRequired("BlueprintId")) - } - if s.BundleId == nil { - invalidParams.Add(request.NewErrParamRequired("BundleId")) - } - if s.InstanceNames == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateInstancesInput) SetAvailabilityZone(v string) *CreateInstancesInput { - s.AvailabilityZone = &v - return s -} - -// SetBlueprintId sets the BlueprintId field's value. -func (s *CreateInstancesInput) SetBlueprintId(v string) *CreateInstancesInput { - s.BlueprintId = &v - return s -} - -// SetBundleId sets the BundleId field's value. -func (s *CreateInstancesInput) SetBundleId(v string) *CreateInstancesInput { - s.BundleId = &v - return s -} - -// SetCustomImageName sets the CustomImageName field's value. -func (s *CreateInstancesInput) SetCustomImageName(v string) *CreateInstancesInput { - s.CustomImageName = &v - return s -} - -// SetInstanceNames sets the InstanceNames field's value. -func (s *CreateInstancesInput) SetInstanceNames(v []*string) *CreateInstancesInput { - s.InstanceNames = v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *CreateInstancesInput) SetKeyPairName(v string) *CreateInstancesInput { - s.KeyPairName = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *CreateInstancesInput) SetUserData(v string) *CreateInstancesInput { - s.UserData = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesResult -type CreateInstancesOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // create instances request. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s CreateInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstancesOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *CreateInstancesOutput) SetOperations(v []*Operation) *CreateInstancesOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateKeyPairRequest -type CreateKeyPairInput struct { - _ struct{} `type:"structure"` - - // The name for your new key pair. - // - // KeyPairName is a required field - KeyPairName *string `locationName:"keyPairName" 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.KeyPairName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyPairName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *CreateKeyPairInput) SetKeyPairName(v string) *CreateKeyPairInput { - s.KeyPairName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateKeyPairResult -type CreateKeyPairOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the new key pair - // you just created. - KeyPair *KeyPair `locationName:"keyPair" type:"structure"` - - // An array of key-value pairs containing information about the results of your - // create key pair request. - Operation *Operation `locationName:"operation" type:"structure"` - - // A base64-encoded RSA private key. - PrivateKeyBase64 *string `locationName:"privateKeyBase64" type:"string"` - - // A base64-encoded public key of the ssh-rsa type. - PublicKeyBase64 *string `locationName:"publicKeyBase64" 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() -} - -// SetKeyPair sets the KeyPair field's value. -func (s *CreateKeyPairOutput) SetKeyPair(v *KeyPair) *CreateKeyPairOutput { - s.KeyPair = v - return s -} - -// SetOperation sets the Operation field's value. -func (s *CreateKeyPairOutput) SetOperation(v *Operation) *CreateKeyPairOutput { - s.Operation = v - return s -} - -// SetPrivateKeyBase64 sets the PrivateKeyBase64 field's value. -func (s *CreateKeyPairOutput) SetPrivateKeyBase64(v string) *CreateKeyPairOutput { - s.PrivateKeyBase64 = &v - return s -} - -// SetPublicKeyBase64 sets the PublicKeyBase64 field's value. -func (s *CreateKeyPairOutput) SetPublicKeyBase64(v string) *CreateKeyPairOutput { - s.PublicKeyBase64 = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntryRequest -type DeleteDomainEntryInput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about your domain entries. - // - // DomainEntry is a required field - DomainEntry *DomainEntry `locationName:"domainEntry" type:"structure" required:"true"` - - // The name of the domain entry to delete. - // - // DomainName is a required field - DomainName *string `locationName:"domainName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDomainEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDomainEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDomainEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDomainEntryInput"} - if s.DomainEntry == nil { - invalidParams.Add(request.NewErrParamRequired("DomainEntry")) - } - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainEntry sets the DomainEntry field's value. -func (s *DeleteDomainEntryInput) SetDomainEntry(v *DomainEntry) *DeleteDomainEntryInput { - s.DomainEntry = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *DeleteDomainEntryInput) SetDomainName(v string) *DeleteDomainEntryInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntryResult -type DeleteDomainEntryOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // delete domain entry request. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s DeleteDomainEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDomainEntryOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *DeleteDomainEntryOutput) SetOperation(v *Operation) *DeleteDomainEntryOutput { - s.Operation = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainRequest -type DeleteDomainInput struct { - _ struct{} `type:"structure"` - - // The specific domain name to delete. - // - // DomainName is a required field - DomainName *string `locationName:"domainName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDomainInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DeleteDomainInput) SetDomainName(v string) *DeleteDomainInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainResult -type DeleteDomainOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // delete domain request. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s DeleteDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDomainOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *DeleteDomainOutput) SetOperation(v *Operation) *DeleteDomainOutput { - s.Operation = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceRequest -type DeleteInstanceInput struct { - _ struct{} `type:"structure"` - - // The name of the instance to delete. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInstanceInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *DeleteInstanceInput) SetInstanceName(v string) *DeleteInstanceInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceResult -type DeleteInstanceOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // delete instance request. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s DeleteInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *DeleteInstanceOutput) SetOperations(v []*Operation) *DeleteInstanceOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshotRequest -type DeleteInstanceSnapshotInput struct { - _ struct{} `type:"structure"` - - // The name of the snapshot to delete. - // - // InstanceSnapshotName is a required field - InstanceSnapshotName *string `locationName:"instanceSnapshotName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteInstanceSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInstanceSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInstanceSnapshotInput"} - if s.InstanceSnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceSnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceSnapshotName sets the InstanceSnapshotName field's value. -func (s *DeleteInstanceSnapshotInput) SetInstanceSnapshotName(v string) *DeleteInstanceSnapshotInput { - s.InstanceSnapshotName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshotResult -type DeleteInstanceSnapshotOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // delete instance snapshot request. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s DeleteInstanceSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceSnapshotOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *DeleteInstanceSnapshotOutput) SetOperations(v []*Operation) *DeleteInstanceSnapshotOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKeyPairRequest -type DeleteKeyPairInput struct { - _ struct{} `type:"structure"` - - // The name of the key pair to delete. - // - // KeyPairName is a required field - KeyPairName *string `locationName:"keyPairName" 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.KeyPairName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyPairName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *DeleteKeyPairInput) SetKeyPairName(v string) *DeleteKeyPairInput { - s.KeyPairName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKeyPairResult -type DeleteKeyPairOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // delete key pair request. - Operation *Operation `locationName:"operation" 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() -} - -// SetOperation sets the Operation field's value. -func (s *DeleteKeyPairOutput) SetOperation(v *Operation) *DeleteKeyPairOutput { - s.Operation = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIpRequest -type DetachStaticIpInput struct { - _ struct{} `type:"structure"` - - // The name of the static IP to detach from the instance. - // - // StaticIpName is a required field - StaticIpName *string `locationName:"staticIpName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachStaticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachStaticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachStaticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachStaticIpInput"} - if s.StaticIpName == nil { - invalidParams.Add(request.NewErrParamRequired("StaticIpName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStaticIpName sets the StaticIpName field's value. -func (s *DetachStaticIpInput) SetStaticIpName(v string) *DetachStaticIpInput { - s.StaticIpName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIpResult -type DetachStaticIpOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // detach static IP request. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s DetachStaticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachStaticIpOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *DetachStaticIpOutput) SetOperations(v []*Operation) *DetachStaticIpOutput { - s.Operations = v - return s -} - -// Describes the hard disk (an SSD). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/Disk -type Disk struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the disk. - Arn *string `locationName:"arn" type:"string"` - - // The resources to which the disk is attached. - AttachedTo *string `locationName:"attachedTo" type:"string"` - - // The attachment state of the disk. - AttachmentState *string `locationName:"attachmentState" type:"string"` - - // The date when the disk was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The number of GB in use by the disk. - GbInUse *int64 `locationName:"gbInUse" type:"integer"` - - // The input/output operations per second (IOPS) of the disk. - Iops *int64 `locationName:"iops" type:"integer"` - - // A Boolean value indicating whether the disk is attached. - IsAttached *bool `locationName:"isAttached" type:"boolean"` - - // A Boolean value indicating whether this disk is a system disk (has an operating - // system loaded on it). - IsSystemDisk *bool `locationName:"isSystemDisk" type:"boolean"` - - // The region and Availability Zone where the disk is located. - Location *ResourceLocation `locationName:"location" type:"structure"` - - // The name of the disk. - Name *string `locationName:"name" type:"string"` - - // The disk path. - Path *string `locationName:"path" type:"string"` - - // The resource type of the disk. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The size of the disk in GB. - SizeInGb *int64 `locationName:"sizeInGb" type:"integer"` - - // The support code. Include this code in your email to support when you have - // questions about an instance or another resource in Lightsail. This code enables - // our support team to look up your Lightsail information more easily. - SupportCode *string `locationName:"supportCode" type:"string"` -} - -// String returns the string representation -func (s Disk) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Disk) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Disk) SetArn(v string) *Disk { - s.Arn = &v - return s -} - -// SetAttachedTo sets the AttachedTo field's value. -func (s *Disk) SetAttachedTo(v string) *Disk { - s.AttachedTo = &v - return s -} - -// SetAttachmentState sets the AttachmentState field's value. -func (s *Disk) SetAttachmentState(v string) *Disk { - s.AttachmentState = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Disk) SetCreatedAt(v time.Time) *Disk { - s.CreatedAt = &v - return s -} - -// SetGbInUse sets the GbInUse field's value. -func (s *Disk) SetGbInUse(v int64) *Disk { - s.GbInUse = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *Disk) SetIops(v int64) *Disk { - s.Iops = &v - return s -} - -// SetIsAttached sets the IsAttached field's value. -func (s *Disk) SetIsAttached(v bool) *Disk { - s.IsAttached = &v - return s -} - -// SetIsSystemDisk sets the IsSystemDisk field's value. -func (s *Disk) SetIsSystemDisk(v bool) *Disk { - s.IsSystemDisk = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *Disk) SetLocation(v *ResourceLocation) *Disk { - s.Location = v - return s -} - -// SetName sets the Name field's value. -func (s *Disk) SetName(v string) *Disk { - s.Name = &v - return s -} - -// SetPath sets the Path field's value. -func (s *Disk) SetPath(v string) *Disk { - s.Path = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Disk) SetResourceType(v string) *Disk { - s.ResourceType = &v - return s -} - -// SetSizeInGb sets the SizeInGb field's value. -func (s *Disk) SetSizeInGb(v int64) *Disk { - s.SizeInGb = &v - return s -} - -// SetSupportCode sets the SupportCode field's value. -func (s *Disk) SetSupportCode(v string) *Disk { - s.SupportCode = &v - return s -} - -// Describes a domain where you are storing recordsets in Lightsail. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/Domain -type Domain struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the domain recordset (e.g., arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE). - Arn *string `locationName:"arn" type:"string"` - - // The date when the domain recordset was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // An array of key-value pairs containing information about the domain entries. - DomainEntries []*DomainEntry `locationName:"domainEntries" type:"list"` - - // The AWS Region and Availability Zones where the domain recordset was created. - Location *ResourceLocation `locationName:"location" type:"structure"` - - // The name of the domain. - Name *string `locationName:"name" type:"string"` - - // The resource type. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The support code. Include this code in your email to support when you have - // questions about an instance or another resource in Lightsail. This code enables - // our support team to look up your Lightsail information more easily. - SupportCode *string `locationName:"supportCode" type:"string"` -} - -// String returns the string representation -func (s Domain) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Domain) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Domain) SetArn(v string) *Domain { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Domain) SetCreatedAt(v time.Time) *Domain { - s.CreatedAt = &v - return s -} - -// SetDomainEntries sets the DomainEntries field's value. -func (s *Domain) SetDomainEntries(v []*DomainEntry) *Domain { - s.DomainEntries = v - return s -} - -// SetLocation sets the Location field's value. -func (s *Domain) SetLocation(v *ResourceLocation) *Domain { - s.Location = v - return s -} - -// SetName sets the Name field's value. -func (s *Domain) SetName(v string) *Domain { - s.Name = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Domain) SetResourceType(v string) *Domain { - s.ResourceType = &v - return s -} - -// SetSupportCode sets the SupportCode field's value. -func (s *Domain) SetSupportCode(v string) *Domain { - s.SupportCode = &v - return s -} - -// Describes a domain recordset entry. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DomainEntry -type DomainEntry struct { - _ struct{} `type:"structure"` - - // The ID of the domain recordset entry. - Id *string `locationName:"id" type:"string"` - - // The name of the domain. - Name *string `locationName:"name" type:"string"` - - // The options for the domain entry. - Options map[string]*string `locationName:"options" type:"map"` - - // The target AWS name server (e.g., ns-111.awsdns-22.com.). - Target *string `locationName:"target" type:"string"` - - // The type of domain entry (e.g., SOA or NS). - Type *string `locationName:"type" type:"string"` -} - -// String returns the string representation -func (s DomainEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DomainEntry) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *DomainEntry) SetId(v string) *DomainEntry { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *DomainEntry) SetName(v string) *DomainEntry { - s.Name = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *DomainEntry) SetOptions(v map[string]*string) *DomainEntry { - s.Options = v - return s -} - -// SetTarget sets the Target field's value. -func (s *DomainEntry) SetTarget(v string) *DomainEntry { - s.Target = &v - return s -} - -// SetType sets the Type field's value. -func (s *DomainEntry) SetType(v string) *DomainEntry { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPairRequest -type DownloadDefaultKeyPairInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DownloadDefaultKeyPairInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DownloadDefaultKeyPairInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPairResult -type DownloadDefaultKeyPairOutput struct { - _ struct{} `type:"structure"` - - // A base64-encoded RSA private key. - PrivateKeyBase64 *string `locationName:"privateKeyBase64" type:"string"` - - // A base64-encoded public key of the ssh-rsa type. - PublicKeyBase64 *string `locationName:"publicKeyBase64" type:"string"` -} - -// String returns the string representation -func (s DownloadDefaultKeyPairOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DownloadDefaultKeyPairOutput) GoString() string { - return s.String() -} - -// SetPrivateKeyBase64 sets the PrivateKeyBase64 field's value. -func (s *DownloadDefaultKeyPairOutput) SetPrivateKeyBase64(v string) *DownloadDefaultKeyPairOutput { - s.PrivateKeyBase64 = &v - return s -} - -// SetPublicKeyBase64 sets the PublicKeyBase64 field's value. -func (s *DownloadDefaultKeyPairOutput) SetPublicKeyBase64(v string) *DownloadDefaultKeyPairOutput { - s.PublicKeyBase64 = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNamesRequest -type GetActiveNamesInput struct { - _ struct{} `type:"structure"` - - // A token used for paginating results from your get active names request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetActiveNamesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetActiveNamesInput) GoString() string { - return s.String() -} - -// SetPageToken sets the PageToken field's value. -func (s *GetActiveNamesInput) SetPageToken(v string) *GetActiveNamesInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNamesResult -type GetActiveNamesOutput struct { - _ struct{} `type:"structure"` - - // The list of active names returned by the get active names request. - ActiveNames []*string `locationName:"activeNames" type:"list"` - - // A token used for advancing to the next page of results from your get active - // names request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` -} - -// String returns the string representation -func (s GetActiveNamesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetActiveNamesOutput) GoString() string { - return s.String() -} - -// SetActiveNames sets the ActiveNames field's value. -func (s *GetActiveNamesOutput) SetActiveNames(v []*string) *GetActiveNamesOutput { - s.ActiveNames = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetActiveNamesOutput) SetNextPageToken(v string) *GetActiveNamesOutput { - s.NextPageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprintsRequest -type GetBlueprintsInput struct { - _ struct{} `type:"structure"` - - // A Boolean value indicating whether to include inactive results in your request. - IncludeInactive *bool `locationName:"includeInactive" type:"boolean"` - - // A token used for advancing to the next page of results from your get blueprints - // request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetBlueprintsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBlueprintsInput) GoString() string { - return s.String() -} - -// SetIncludeInactive sets the IncludeInactive field's value. -func (s *GetBlueprintsInput) SetIncludeInactive(v bool) *GetBlueprintsInput { - s.IncludeInactive = &v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *GetBlueprintsInput) SetPageToken(v string) *GetBlueprintsInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprintsResult -type GetBlueprintsOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs that contains information about the available - // blueprints. - Blueprints []*Blueprint `locationName:"blueprints" type:"list"` - - // A token used for advancing to the next page of results from your get blueprints - // request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` -} - -// String returns the string representation -func (s GetBlueprintsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBlueprintsOutput) GoString() string { - return s.String() -} - -// SetBlueprints sets the Blueprints field's value. -func (s *GetBlueprintsOutput) SetBlueprints(v []*Blueprint) *GetBlueprintsOutput { - s.Blueprints = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetBlueprintsOutput) SetNextPageToken(v string) *GetBlueprintsOutput { - s.NextPageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundlesRequest -type GetBundlesInput struct { - _ struct{} `type:"structure"` - - // A Boolean value that indicates whether to include inactive bundle results - // in your request. - IncludeInactive *bool `locationName:"includeInactive" type:"boolean"` - - // A token used for advancing to the next page of results from your get bundles - // request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetBundlesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBundlesInput) GoString() string { - return s.String() -} - -// SetIncludeInactive sets the IncludeInactive field's value. -func (s *GetBundlesInput) SetIncludeInactive(v bool) *GetBundlesInput { - s.IncludeInactive = &v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *GetBundlesInput) SetPageToken(v string) *GetBundlesInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundlesResult -type GetBundlesOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs that contains information about the available - // bundles. - Bundles []*Bundle `locationName:"bundles" type:"list"` - - // A token used for advancing to the next page of results from your get active - // names request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` -} - -// String returns the string representation -func (s GetBundlesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBundlesOutput) GoString() string { - return s.String() -} - -// SetBundles sets the Bundles field's value. -func (s *GetBundlesOutput) SetBundles(v []*Bundle) *GetBundlesOutput { - s.Bundles = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetBundlesOutput) SetNextPageToken(v string) *GetBundlesOutput { - s.NextPageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomainRequest -type GetDomainInput struct { - _ struct{} `type:"structure"` - - // The domain name for which your want to return information about. - // - // DomainName is a required field - DomainName *string `locationName:"domainName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDomainInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *GetDomainInput) SetDomainName(v string) *GetDomainInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomainResult -type GetDomainOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about your get domain - // request. - Domain *Domain `locationName:"domain" type:"structure"` -} - -// String returns the string representation -func (s GetDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDomainOutput) GoString() string { - return s.String() -} - -// SetDomain sets the Domain field's value. -func (s *GetDomainOutput) SetDomain(v *Domain) *GetDomainOutput { - s.Domain = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomainsRequest -type GetDomainsInput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get domains - // request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetDomainsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDomainsInput) GoString() string { - return s.String() -} - -// SetPageToken sets the PageToken field's value. -func (s *GetDomainsInput) SetPageToken(v string) *GetDomainsInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomainsResult -type GetDomainsOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about each of the domain - // entries in the user's account. - Domains []*Domain `locationName:"domains" type:"list"` - - // A token used for advancing to the next page of results from your get active - // names request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` -} - -// String returns the string representation -func (s GetDomainsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDomainsOutput) GoString() string { - return s.String() -} - -// SetDomains sets the Domains field's value. -func (s *GetDomainsOutput) SetDomains(v []*Domain) *GetDomainsOutput { - s.Domains = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetDomainsOutput) SetNextPageToken(v string) *GetDomainsOutput { - s.NextPageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetailsRequest -type GetInstanceAccessDetailsInput struct { - _ struct{} `type:"structure"` - - // The name of the instance to access. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` - - // The protocol to use to connect to your instance. Defaults to ssh. - Protocol *string `locationName:"protocol" type:"string" enum:"InstanceAccessProtocol"` -} - -// String returns the string representation -func (s GetInstanceAccessDetailsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceAccessDetailsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInstanceAccessDetailsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInstanceAccessDetailsInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *GetInstanceAccessDetailsInput) SetInstanceName(v string) *GetInstanceAccessDetailsInput { - s.InstanceName = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *GetInstanceAccessDetailsInput) SetProtocol(v string) *GetInstanceAccessDetailsInput { - s.Protocol = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetailsResult -type GetInstanceAccessDetailsOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about a get instance access - // request. - AccessDetails *InstanceAccessDetails `locationName:"accessDetails" type:"structure"` -} - -// String returns the string representation -func (s GetInstanceAccessDetailsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceAccessDetailsOutput) GoString() string { - return s.String() -} - -// SetAccessDetails sets the AccessDetails field's value. -func (s *GetInstanceAccessDetailsOutput) SetAccessDetails(v *InstanceAccessDetails) *GetInstanceAccessDetailsOutput { - s.AccessDetails = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceRequest -type GetInstanceInput struct { - _ struct{} `type:"structure"` - - // The name of the instance. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInstanceInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *GetInstanceInput) SetInstanceName(v string) *GetInstanceInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricDataRequest -type GetInstanceMetricDataInput struct { - _ struct{} `type:"structure"` - - // The end time of the time period. - // - // EndTime is a required field - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The name of the instance for which you want to get metrics data. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` - - // The metric name to get data about. - // - // MetricName is a required field - MetricName *string `locationName:"metricName" type:"string" required:"true" enum:"InstanceMetricName"` - - // The time period for which you are requesting data. - // - // Period is a required field - Period *int64 `locationName:"period" min:"60" type:"integer" required:"true"` - - // The start time of the time period. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The instance statistics. - // - // Statistics is a required field - Statistics []*string `locationName:"statistics" type:"list" required:"true"` - - // The unit. The list of valid values is below. - // - // Unit is a required field - Unit *string `locationName:"unit" type:"string" required:"true" enum:"MetricUnit"` -} - -// String returns the string representation -func (s GetInstanceMetricDataInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceMetricDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInstanceMetricDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInstanceMetricDataInput"} - if s.EndTime == nil { - invalidParams.Add(request.NewErrParamRequired("EndTime")) - } - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.Period == nil { - invalidParams.Add(request.NewErrParamRequired("Period")) - } - if s.Period != nil && *s.Period < 60 { - invalidParams.Add(request.NewErrParamMinValue("Period", 60)) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - if s.Statistics == nil { - invalidParams.Add(request.NewErrParamRequired("Statistics")) - } - if s.Unit == nil { - invalidParams.Add(request.NewErrParamRequired("Unit")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *GetInstanceMetricDataInput) SetEndTime(v time.Time) *GetInstanceMetricDataInput { - s.EndTime = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *GetInstanceMetricDataInput) SetInstanceName(v string) *GetInstanceMetricDataInput { - s.InstanceName = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *GetInstanceMetricDataInput) SetMetricName(v string) *GetInstanceMetricDataInput { - s.MetricName = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *GetInstanceMetricDataInput) SetPeriod(v int64) *GetInstanceMetricDataInput { - s.Period = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetInstanceMetricDataInput) SetStartTime(v time.Time) *GetInstanceMetricDataInput { - s.StartTime = &v - return s -} - -// SetStatistics sets the Statistics field's value. -func (s *GetInstanceMetricDataInput) SetStatistics(v []*string) *GetInstanceMetricDataInput { - s.Statistics = v - return s -} - -// SetUnit sets the Unit field's value. -func (s *GetInstanceMetricDataInput) SetUnit(v string) *GetInstanceMetricDataInput { - s.Unit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricDataResult -type GetInstanceMetricDataOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // get instance metric data request. - MetricData []*MetricDatapoint `locationName:"metricData" type:"list"` - - // The metric name to return data for. - MetricName *string `locationName:"metricName" type:"string" enum:"InstanceMetricName"` -} - -// String returns the string representation -func (s GetInstanceMetricDataOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceMetricDataOutput) GoString() string { - return s.String() -} - -// SetMetricData sets the MetricData field's value. -func (s *GetInstanceMetricDataOutput) SetMetricData(v []*MetricDatapoint) *GetInstanceMetricDataOutput { - s.MetricData = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *GetInstanceMetricDataOutput) SetMetricName(v string) *GetInstanceMetricDataOutput { - s.MetricName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceResult -type GetInstanceOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the specified instance. - Instance *Instance `locationName:"instance" type:"structure"` -} - -// String returns the string representation -func (s GetInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceOutput) GoString() string { - return s.String() -} - -// SetInstance sets the Instance field's value. -func (s *GetInstanceOutput) SetInstance(v *Instance) *GetInstanceOutput { - s.Instance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStatesRequest -type GetInstancePortStatesInput struct { - _ struct{} `type:"structure"` - - // The name of the instance. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetInstancePortStatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstancePortStatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInstancePortStatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInstancePortStatesInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *GetInstancePortStatesInput) SetInstanceName(v string) *GetInstancePortStatesInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStatesResult -type GetInstancePortStatesOutput struct { - _ struct{} `type:"structure"` - - // Information about the port states resulting from your request. - PortStates []*string `locationName:"portStates" type:"list"` -} - -// String returns the string representation -func (s GetInstancePortStatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstancePortStatesOutput) GoString() string { - return s.String() -} - -// SetPortStates sets the PortStates field's value. -func (s *GetInstancePortStatesOutput) SetPortStates(v []*string) *GetInstancePortStatesOutput { - s.PortStates = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshotRequest -type GetInstanceSnapshotInput struct { - _ struct{} `type:"structure"` - - // The name of the snapshot for which you are requesting information. - // - // InstanceSnapshotName is a required field - InstanceSnapshotName *string `locationName:"instanceSnapshotName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetInstanceSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInstanceSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInstanceSnapshotInput"} - if s.InstanceSnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceSnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceSnapshotName sets the InstanceSnapshotName field's value. -func (s *GetInstanceSnapshotInput) SetInstanceSnapshotName(v string) *GetInstanceSnapshotInput { - s.InstanceSnapshotName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshotResult -type GetInstanceSnapshotOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // get instance snapshot request. - InstanceSnapshot *InstanceSnapshot `locationName:"instanceSnapshot" type:"structure"` -} - -// String returns the string representation -func (s GetInstanceSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceSnapshotOutput) GoString() string { - return s.String() -} - -// SetInstanceSnapshot sets the InstanceSnapshot field's value. -func (s *GetInstanceSnapshotOutput) SetInstanceSnapshot(v *InstanceSnapshot) *GetInstanceSnapshotOutput { - s.InstanceSnapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshotsRequest -type GetInstanceSnapshotsInput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get instance - // snapshots request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetInstanceSnapshotsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceSnapshotsInput) GoString() string { - return s.String() -} - -// SetPageToken sets the PageToken field's value. -func (s *GetInstanceSnapshotsInput) SetPageToken(v string) *GetInstanceSnapshotsInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshotsResult -type GetInstanceSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // get instance snapshots request. - InstanceSnapshots []*InstanceSnapshot `locationName:"instanceSnapshots" type:"list"` - - // A token used for advancing to the next page of results from your get instance - // snapshots request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` -} - -// String returns the string representation -func (s GetInstanceSnapshotsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceSnapshotsOutput) GoString() string { - return s.String() -} - -// SetInstanceSnapshots sets the InstanceSnapshots field's value. -func (s *GetInstanceSnapshotsOutput) SetInstanceSnapshots(v []*InstanceSnapshot) *GetInstanceSnapshotsOutput { - s.InstanceSnapshots = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetInstanceSnapshotsOutput) SetNextPageToken(v string) *GetInstanceSnapshotsOutput { - s.NextPageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceStateRequest -type GetInstanceStateInput struct { - _ struct{} `type:"structure"` - - // The name of the instance to get state information about. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetInstanceStateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceStateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInstanceStateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInstanceStateInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *GetInstanceStateInput) SetInstanceName(v string) *GetInstanceStateInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceStateResult -type GetInstanceStateOutput struct { - _ struct{} `type:"structure"` - - // The state of the instance. - State *InstanceState `locationName:"state" type:"structure"` -} - -// String returns the string representation -func (s GetInstanceStateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstanceStateOutput) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *GetInstanceStateOutput) SetState(v *InstanceState) *GetInstanceStateOutput { - s.State = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancesRequest -type GetInstancesInput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get instances - // request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstancesInput) GoString() string { - return s.String() -} - -// SetPageToken sets the PageToken field's value. -func (s *GetInstancesInput) SetPageToken(v string) *GetInstancesInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancesResult -type GetInstancesOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about your instances. - Instances []*Instance `locationName:"instances" type:"list"` - - // A token used for advancing to the next page of results from your get instances - // request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` -} - -// String returns the string representation -func (s GetInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInstancesOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *GetInstancesOutput) SetInstances(v []*Instance) *GetInstancesOutput { - s.Instances = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetInstancesOutput) SetNextPageToken(v string) *GetInstancesOutput { - s.NextPageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairRequest -type GetKeyPairInput struct { - _ struct{} `type:"structure"` - - // The name of the key pair for which you are requesting information. - // - // KeyPairName is a required field - KeyPairName *string `locationName:"keyPairName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetKeyPairInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetKeyPairInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetKeyPairInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetKeyPairInput"} - if s.KeyPairName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyPairName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *GetKeyPairInput) SetKeyPairName(v string) *GetKeyPairInput { - s.KeyPairName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairResult -type GetKeyPairOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the key pair. - KeyPair *KeyPair `locationName:"keyPair" type:"structure"` -} - -// String returns the string representation -func (s GetKeyPairOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetKeyPairOutput) GoString() string { - return s.String() -} - -// SetKeyPair sets the KeyPair field's value. -func (s *GetKeyPairOutput) SetKeyPair(v *KeyPair) *GetKeyPairOutput { - s.KeyPair = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairsRequest -type GetKeyPairsInput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get key - // pairs request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetKeyPairsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetKeyPairsInput) GoString() string { - return s.String() -} - -// SetPageToken sets the PageToken field's value. -func (s *GetKeyPairsInput) SetPageToken(v string) *GetKeyPairsInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairsResult -type GetKeyPairsOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the key pairs. - KeyPairs []*KeyPair `locationName:"keyPairs" type:"list"` - - // A token used for advancing to the next page of results from your get key - // pairs request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` -} - -// String returns the string representation -func (s GetKeyPairsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetKeyPairsOutput) GoString() string { - return s.String() -} - -// SetKeyPairs sets the KeyPairs field's value. -func (s *GetKeyPairsOutput) SetKeyPairs(v []*KeyPair) *GetKeyPairsOutput { - s.KeyPairs = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetKeyPairsOutput) SetNextPageToken(v string) *GetKeyPairsOutput { - s.NextPageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationRequest -type GetOperationInput struct { - _ struct{} `type:"structure"` - - // A GUID used to identify the operation. - // - // OperationId is a required field - OperationId *string `locationName:"operationId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetOperationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOperationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOperationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOperationInput"} - if s.OperationId == nil { - invalidParams.Add(request.NewErrParamRequired("OperationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOperationId sets the OperationId field's value. -func (s *GetOperationInput) SetOperationId(v string) *GetOperationInput { - s.OperationId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationResult -type GetOperationOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the results of your - // get operation request. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s GetOperationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOperationOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *GetOperationOutput) SetOperation(v *Operation) *GetOperationOutput { - s.Operation = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResourceRequest -type GetOperationsForResourceInput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get operations - // for resource request. - PageToken *string `locationName:"pageToken" type:"string"` - - // The name of the resource for which you are requesting information. - // - // ResourceName is a required field - ResourceName *string `locationName:"resourceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetOperationsForResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOperationsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOperationsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOperationsForResourceInput"} - if s.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPageToken sets the PageToken field's value. -func (s *GetOperationsForResourceInput) SetPageToken(v string) *GetOperationsForResourceInput { - s.PageToken = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *GetOperationsForResourceInput) SetResourceName(v string) *GetOperationsForResourceInput { - s.ResourceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResourceResult -type GetOperationsForResourceOutput struct { - _ struct{} `type:"structure"` - - // Returns the number of pages of results that remain. - NextPageCount *string `locationName:"nextPageCount" type:"string"` - - // An array of key-value pairs containing information about the results of your - // get operations for resource request. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s GetOperationsForResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOperationsForResourceOutput) GoString() string { - return s.String() -} - -// SetNextPageCount sets the NextPageCount field's value. -func (s *GetOperationsForResourceOutput) SetNextPageCount(v string) *GetOperationsForResourceOutput { - s.NextPageCount = &v - return s -} - -// SetOperations sets the Operations field's value. -func (s *GetOperationsForResourceOutput) SetOperations(v []*Operation) *GetOperationsForResourceOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsRequest -type GetOperationsInput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get operations - // request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetOperationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOperationsInput) GoString() string { - return s.String() -} - -// SetPageToken sets the PageToken field's value. -func (s *GetOperationsInput) SetPageToken(v string) *GetOperationsInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsResult -type GetOperationsOutput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get operations - // request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` - - // An array of key-value pairs containing information about the results of your - // get operations request. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s GetOperationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetOperationsOutput) GoString() string { - return s.String() -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetOperationsOutput) SetNextPageToken(v string) *GetOperationsOutput { - s.NextPageToken = &v - return s -} - -// SetOperations sets the Operations field's value. -func (s *GetOperationsOutput) SetOperations(v []*Operation) *GetOperationsOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegionsRequest -type GetRegionsInput struct { - _ struct{} `type:"structure"` - - // A Boolean value indicating whether to also include Availability Zones in - // your get regions request. Availability Zones are indicated with a letter: - // e.g., us-east-1a. - IncludeAvailabilityZones *bool `locationName:"includeAvailabilityZones" type:"boolean"` -} - -// String returns the string representation -func (s GetRegionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRegionsInput) GoString() string { - return s.String() -} - -// SetIncludeAvailabilityZones sets the IncludeAvailabilityZones field's value. -func (s *GetRegionsInput) SetIncludeAvailabilityZones(v bool) *GetRegionsInput { - s.IncludeAvailabilityZones = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegionsResult -type GetRegionsOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about your get regions - // request. - Regions []*Region `locationName:"regions" type:"list"` -} - -// String returns the string representation -func (s GetRegionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRegionsOutput) GoString() string { - return s.String() -} - -// SetRegions sets the Regions field's value. -func (s *GetRegionsOutput) SetRegions(v []*Region) *GetRegionsOutput { - s.Regions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIpRequest -type GetStaticIpInput struct { - _ struct{} `type:"structure"` - - // The name of the static IP in Lightsail. - // - // StaticIpName is a required field - StaticIpName *string `locationName:"staticIpName" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetStaticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStaticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStaticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStaticIpInput"} - if s.StaticIpName == nil { - invalidParams.Add(request.NewErrParamRequired("StaticIpName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStaticIpName sets the StaticIpName field's value. -func (s *GetStaticIpInput) SetStaticIpName(v string) *GetStaticIpInput { - s.StaticIpName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIpResult -type GetStaticIpOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the requested static - // IP. - StaticIp *StaticIp `locationName:"staticIp" type:"structure"` -} - -// String returns the string representation -func (s GetStaticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStaticIpOutput) GoString() string { - return s.String() -} - -// SetStaticIp sets the StaticIp field's value. -func (s *GetStaticIpOutput) SetStaticIp(v *StaticIp) *GetStaticIpOutput { - s.StaticIp = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIpsRequest -type GetStaticIpsInput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get static - // IPs request. - PageToken *string `locationName:"pageToken" type:"string"` -} - -// String returns the string representation -func (s GetStaticIpsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStaticIpsInput) GoString() string { - return s.String() -} - -// SetPageToken sets the PageToken field's value. -func (s *GetStaticIpsInput) SetPageToken(v string) *GetStaticIpsInput { - s.PageToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIpsResult -type GetStaticIpsOutput struct { - _ struct{} `type:"structure"` - - // A token used for advancing to the next page of results from your get static - // IPs request. - NextPageToken *string `locationName:"nextPageToken" type:"string"` - - // An array of key-value pairs containing information about your get static - // IPs request. - StaticIps []*StaticIp `locationName:"staticIps" type:"list"` -} - -// String returns the string representation -func (s GetStaticIpsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStaticIpsOutput) GoString() string { - return s.String() -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *GetStaticIpsOutput) SetNextPageToken(v string) *GetStaticIpsOutput { - s.NextPageToken = &v - return s -} - -// SetStaticIps sets the StaticIps field's value. -func (s *GetStaticIpsOutput) SetStaticIps(v []*StaticIp) *GetStaticIpsOutput { - s.StaticIps = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ImportKeyPairRequest -type ImportKeyPairInput struct { - _ struct{} `type:"structure"` - - // The name of the key pair for which you want to import the public key. - // - // KeyPairName is a required field - KeyPairName *string `locationName:"keyPairName" type:"string" required:"true"` - - // A base64-encoded public key of the ssh-rsa type. - // - // PublicKeyBase64 is a required field - PublicKeyBase64 *string `locationName:"publicKeyBase64" type:"string" 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.KeyPairName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyPairName")) - } - if s.PublicKeyBase64 == nil { - invalidParams.Add(request.NewErrParamRequired("PublicKeyBase64")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *ImportKeyPairInput) SetKeyPairName(v string) *ImportKeyPairInput { - s.KeyPairName = &v - return s -} - -// SetPublicKeyBase64 sets the PublicKeyBase64 field's value. -func (s *ImportKeyPairInput) SetPublicKeyBase64(v string) *ImportKeyPairInput { - s.PublicKeyBase64 = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ImportKeyPairResult -type ImportKeyPairOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// 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() -} - -// SetOperation sets the Operation field's value. -func (s *ImportKeyPairOutput) SetOperation(v *Operation) *ImportKeyPairOutput { - s.Operation = v - return s -} - -// Describes an instance (a virtual private server). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/Instance -type Instance struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the instance (e.g., arn:aws:lightsail:us-east-1:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE). - Arn *string `locationName:"arn" type:"string"` - - // The blueprint ID (e.g., os_amlinux_2016_03). - BlueprintId *string `locationName:"blueprintId" type:"string"` - - // The friendly name of the blueprint (e.g., Amazon Linux). - BlueprintName *string `locationName:"blueprintName" type:"string"` - - // The bundle for the instance (e.g., micro_1_0). - BundleId *string `locationName:"bundleId" type:"string"` - - // The timestamp when the instance was created (e.g., 1479734909.17). - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The size of the vCPU and the amount of RAM for the instance. - Hardware *InstanceHardware `locationName:"hardware" type:"structure"` - - // The IPv6 address of the instance. - Ipv6Address *string `locationName:"ipv6Address" type:"string"` - - // A Boolean value indicating whether this instance has a static IP assigned - // to it. - IsStaticIp *bool `locationName:"isStaticIp" type:"boolean"` - - // The region name and availability zone where the instance is located. - Location *ResourceLocation `locationName:"location" type:"structure"` - - // The name the user gave the instance (e.g., Amazon_Linux-1GB-Virginia-1). - Name *string `locationName:"name" type:"string"` - - // Information about the public ports and monthly data transfer rates for the - // instance. - Networking *InstanceNetworking `locationName:"networking" type:"structure"` - - // The private IP address of the instance. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The public IP address of the instance. - PublicIpAddress *string `locationName:"publicIpAddress" type:"string"` - - // The type of resource (usually Instance). - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The name of the SSH key being used to connect to the instance (e.g., LightsailDefaultKeyPair). - SshKeyName *string `locationName:"sshKeyName" type:"string"` - - // The status code and the state (e.g., running) for the instance. - State *InstanceState `locationName:"state" type:"structure"` - - // The support code. Include this code in your email to support when you have - // questions about an instance or another resource in Lightsail. This code enables - // our support team to look up your Lightsail information more easily. - SupportCode *string `locationName:"supportCode" type:"string"` - - // The user name for connecting to the instance (e.g., ec2-user). - Username *string `locationName:"username" 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() -} - -// SetArn sets the Arn field's value. -func (s *Instance) SetArn(v string) *Instance { - s.Arn = &v - return s -} - -// SetBlueprintId sets the BlueprintId field's value. -func (s *Instance) SetBlueprintId(v string) *Instance { - s.BlueprintId = &v - return s -} - -// SetBlueprintName sets the BlueprintName field's value. -func (s *Instance) SetBlueprintName(v string) *Instance { - s.BlueprintName = &v - return s -} - -// SetBundleId sets the BundleId field's value. -func (s *Instance) SetBundleId(v string) *Instance { - s.BundleId = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Instance) SetCreatedAt(v time.Time) *Instance { - s.CreatedAt = &v - return s -} - -// SetHardware sets the Hardware field's value. -func (s *Instance) SetHardware(v *InstanceHardware) *Instance { - s.Hardware = v - return s -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *Instance) SetIpv6Address(v string) *Instance { - s.Ipv6Address = &v - return s -} - -// SetIsStaticIp sets the IsStaticIp field's value. -func (s *Instance) SetIsStaticIp(v bool) *Instance { - s.IsStaticIp = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *Instance) SetLocation(v *ResourceLocation) *Instance { - s.Location = v - return s -} - -// SetName sets the Name field's value. -func (s *Instance) SetName(v string) *Instance { - s.Name = &v - return s -} - -// SetNetworking sets the Networking field's value. -func (s *Instance) SetNetworking(v *InstanceNetworking) *Instance { - s.Networking = v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *Instance) SetPrivateIpAddress(v string) *Instance { - s.PrivateIpAddress = &v - return s -} - -// SetPublicIpAddress sets the PublicIpAddress field's value. -func (s *Instance) SetPublicIpAddress(v string) *Instance { - s.PublicIpAddress = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Instance) SetResourceType(v string) *Instance { - s.ResourceType = &v - return s -} - -// SetSshKeyName sets the SshKeyName field's value. -func (s *Instance) SetSshKeyName(v string) *Instance { - s.SshKeyName = &v - return s -} - -// SetState sets the State field's value. -func (s *Instance) SetState(v *InstanceState) *Instance { - s.State = v - return s -} - -// SetSupportCode sets the SupportCode field's value. -func (s *Instance) SetSupportCode(v string) *Instance { - s.SupportCode = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *Instance) SetUsername(v string) *Instance { - s.Username = &v - return s -} - -// The parameters for gaining temporary access to one of your Amazon Lightsail -// instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/InstanceAccessDetails -type InstanceAccessDetails struct { - _ struct{} `type:"structure"` - - // For SSH access, the public key to use when accessing your instance For OpenSSH - // clients (e.g., command line SSH), you should save this value to tempkey-cert.pub. - CertKey *string `locationName:"certKey" type:"string"` - - // For SSH access, the date on which the temporary keys expire. - ExpiresAt *time.Time `locationName:"expiresAt" type:"timestamp" timestampFormat:"unix"` - - // The name of this Amazon Lightsail instance. - InstanceName *string `locationName:"instanceName" type:"string"` - - // The public IP address of the Amazon Lightsail instance. - IpAddress *string `locationName:"ipAddress" type:"string"` - - // For RDP access, the temporary password of the Amazon EC2 instance. - Password *string `locationName:"password" type:"string"` - - // For SSH access, the temporary private key. For OpenSSH clients (e.g., command - // line SSH), you should save this value to tempkey). - PrivateKey *string `locationName:"privateKey" type:"string"` - - // The protocol for these Amazon Lightsail instance access details. - Protocol *string `locationName:"protocol" type:"string" enum:"InstanceAccessProtocol"` - - // The user name to use when logging in to the Amazon Lightsail instance. - Username *string `locationName:"username" type:"string"` -} - -// String returns the string representation -func (s InstanceAccessDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceAccessDetails) GoString() string { - return s.String() -} - -// SetCertKey sets the CertKey field's value. -func (s *InstanceAccessDetails) SetCertKey(v string) *InstanceAccessDetails { - s.CertKey = &v - return s -} - -// SetExpiresAt sets the ExpiresAt field's value. -func (s *InstanceAccessDetails) SetExpiresAt(v time.Time) *InstanceAccessDetails { - s.ExpiresAt = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *InstanceAccessDetails) SetInstanceName(v string) *InstanceAccessDetails { - s.InstanceName = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *InstanceAccessDetails) SetIpAddress(v string) *InstanceAccessDetails { - s.IpAddress = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *InstanceAccessDetails) SetPassword(v string) *InstanceAccessDetails { - s.Password = &v - return s -} - -// SetPrivateKey sets the PrivateKey field's value. -func (s *InstanceAccessDetails) SetPrivateKey(v string) *InstanceAccessDetails { - s.PrivateKey = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *InstanceAccessDetails) SetProtocol(v string) *InstanceAccessDetails { - s.Protocol = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *InstanceAccessDetails) SetUsername(v string) *InstanceAccessDetails { - s.Username = &v - return s -} - -// Describes the hardware for the instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/InstanceHardware -type InstanceHardware struct { - _ struct{} `type:"structure"` - - // The number of vCPUs the instance has. - CpuCount *int64 `locationName:"cpuCount" type:"integer"` - - // The disks attached to the instance. - Disks []*Disk `locationName:"disks" type:"list"` - - // The amount of RAM in GB on the instance (e.g., 1.0). - RamSizeInGb *float64 `locationName:"ramSizeInGb" type:"float"` -} - -// String returns the string representation -func (s InstanceHardware) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceHardware) GoString() string { - return s.String() -} - -// SetCpuCount sets the CpuCount field's value. -func (s *InstanceHardware) SetCpuCount(v int64) *InstanceHardware { - s.CpuCount = &v - return s -} - -// SetDisks sets the Disks field's value. -func (s *InstanceHardware) SetDisks(v []*Disk) *InstanceHardware { - s.Disks = v - return s -} - -// SetRamSizeInGb sets the RamSizeInGb field's value. -func (s *InstanceHardware) SetRamSizeInGb(v float64) *InstanceHardware { - s.RamSizeInGb = &v - return s -} - -// Describes monthly data transfer rates and port information for an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/InstanceNetworking -type InstanceNetworking struct { - _ struct{} `type:"structure"` - - // The amount of data in GB allocated for monthly data transfers. - MonthlyTransfer *MonthlyTransfer `locationName:"monthlyTransfer" type:"structure"` - - // An array of key-value pairs containing information about the ports on the - // instance. - Ports []*InstancePortInfo `locationName:"ports" type:"list"` -} - -// String returns the string representation -func (s InstanceNetworking) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworking) GoString() string { - return s.String() -} - -// SetMonthlyTransfer sets the MonthlyTransfer field's value. -func (s *InstanceNetworking) SetMonthlyTransfer(v *MonthlyTransfer) *InstanceNetworking { - s.MonthlyTransfer = v - return s -} - -// SetPorts sets the Ports field's value. -func (s *InstanceNetworking) SetPorts(v []*InstancePortInfo) *InstanceNetworking { - s.Ports = v - return s -} - -// Describes information about the instance ports. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/InstancePortInfo -type InstancePortInfo struct { - _ struct{} `type:"structure"` - - // The access direction (inbound or outbound). - AccessDirection *string `locationName:"accessDirection" type:"string" enum:"AccessDirection"` - - // The location from which access is allowed (e.g., Anywhere (0.0.0.0/0)). - AccessFrom *string `locationName:"accessFrom" type:"string"` - - // The type of access (Public or Private). - AccessType *string `locationName:"accessType" type:"string" enum:"PortAccessType"` - - // The common name. - CommonName *string `locationName:"commonName" type:"string"` - - // The first port in the range. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The protocol. - Protocol *string `locationName:"protocol" type:"string" enum:"NetworkProtocol"` - - // The last port in the range. - ToPort *int64 `locationName:"toPort" type:"integer"` -} - -// String returns the string representation -func (s InstancePortInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstancePortInfo) GoString() string { - return s.String() -} - -// SetAccessDirection sets the AccessDirection field's value. -func (s *InstancePortInfo) SetAccessDirection(v string) *InstancePortInfo { - s.AccessDirection = &v - return s -} - -// SetAccessFrom sets the AccessFrom field's value. -func (s *InstancePortInfo) SetAccessFrom(v string) *InstancePortInfo { - s.AccessFrom = &v - return s -} - -// SetAccessType sets the AccessType field's value. -func (s *InstancePortInfo) SetAccessType(v string) *InstancePortInfo { - s.AccessType = &v - return s -} - -// SetCommonName sets the CommonName field's value. -func (s *InstancePortInfo) SetCommonName(v string) *InstancePortInfo { - s.CommonName = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *InstancePortInfo) SetFromPort(v int64) *InstancePortInfo { - s.FromPort = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *InstancePortInfo) SetProtocol(v string) *InstancePortInfo { - s.Protocol = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *InstancePortInfo) SetToPort(v int64) *InstancePortInfo { - s.ToPort = &v - return s -} - -// Describes the snapshot of the virtual private server, or instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/InstanceSnapshot -type InstanceSnapshot struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the snapshot (e.g., arn:aws:lightsail:us-east-1:123456789101:InstanceSnapshot/d23b5706-3322-4d83-81e5-12345EXAMPLE). - Arn *string `locationName:"arn" type:"string"` - - // The timestamp when the snapshot was created (e.g., 1479907467.024). - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The blueprint ID from which you created the snapshot (e.g., os_debian_8_3). - // A blueprint is a virtual private server (or instance) image used to create - // instances quickly. - FromBlueprintId *string `locationName:"fromBlueprintId" type:"string"` - - // The bundle ID from which you created the snapshot (e.g., micro_1_0). - FromBundleId *string `locationName:"fromBundleId" type:"string"` - - // The Amazon Resource Name (ARN) of the instance from which the snapshot was - // created (e.g., arn:aws:lightsail:us-east-1:123456789101:Instance/64b8404c-ccb1-430b-8daf-12345EXAMPLE). - FromInstanceArn *string `locationName:"fromInstanceArn" type:"string"` - - // The instance from which the snapshot was created. - FromInstanceName *string `locationName:"fromInstanceName" type:"string"` - - // The region name and availability zone where you created the snapshot. - Location *ResourceLocation `locationName:"location" type:"structure"` - - // The name of the snapshot. - Name *string `locationName:"name" type:"string"` - - // The progress of the snapshot. - Progress *string `locationName:"progress" type:"string"` - - // The type of resource (usually InstanceSnapshot). - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The size in GB of the SSD. - SizeInGb *int64 `locationName:"sizeInGb" type:"integer"` - - // The state the snapshot is in. - State *string `locationName:"state" type:"string" enum:"InstanceSnapshotState"` - - // The support code. Include this code in your email to support when you have - // questions about an instance or another resource in Lightsail. This code enables - // our support team to look up your Lightsail information more easily. - SupportCode *string `locationName:"supportCode" type:"string"` -} - -// String returns the string representation -func (s InstanceSnapshot) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceSnapshot) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *InstanceSnapshot) SetArn(v string) *InstanceSnapshot { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *InstanceSnapshot) SetCreatedAt(v time.Time) *InstanceSnapshot { - s.CreatedAt = &v - return s -} - -// SetFromBlueprintId sets the FromBlueprintId field's value. -func (s *InstanceSnapshot) SetFromBlueprintId(v string) *InstanceSnapshot { - s.FromBlueprintId = &v - return s -} - -// SetFromBundleId sets the FromBundleId field's value. -func (s *InstanceSnapshot) SetFromBundleId(v string) *InstanceSnapshot { - s.FromBundleId = &v - return s -} - -// SetFromInstanceArn sets the FromInstanceArn field's value. -func (s *InstanceSnapshot) SetFromInstanceArn(v string) *InstanceSnapshot { - s.FromInstanceArn = &v - return s -} - -// SetFromInstanceName sets the FromInstanceName field's value. -func (s *InstanceSnapshot) SetFromInstanceName(v string) *InstanceSnapshot { - s.FromInstanceName = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *InstanceSnapshot) SetLocation(v *ResourceLocation) *InstanceSnapshot { - s.Location = v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceSnapshot) SetName(v string) *InstanceSnapshot { - s.Name = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *InstanceSnapshot) SetProgress(v string) *InstanceSnapshot { - s.Progress = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *InstanceSnapshot) SetResourceType(v string) *InstanceSnapshot { - s.ResourceType = &v - return s -} - -// SetSizeInGb sets the SizeInGb field's value. -func (s *InstanceSnapshot) SetSizeInGb(v int64) *InstanceSnapshot { - s.SizeInGb = &v - return s -} - -// SetState sets the State field's value. -func (s *InstanceSnapshot) SetState(v string) *InstanceSnapshot { - s.State = &v - return s -} - -// SetSupportCode sets the SupportCode field's value. -func (s *InstanceSnapshot) SetSupportCode(v string) *InstanceSnapshot { - s.SupportCode = &v - return s -} - -// Describes the virtual private server (or instance) status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/InstanceState -type InstanceState struct { - _ struct{} `type:"structure"` - - // The status code for the instance. - Code *int64 `locationName:"code" type:"integer"` - - // The state of the instance (e.g., running or pending). - Name *string `locationName:"name" type:"string"` -} - -// 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 -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeeredRequest -type IsVpcPeeredInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s IsVpcPeeredInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IsVpcPeeredInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeeredResult -type IsVpcPeeredOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the Lightsail VPC is peered; otherwise, false. - IsPeered *bool `locationName:"isPeered" type:"boolean"` -} - -// String returns the string representation -func (s IsVpcPeeredOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IsVpcPeeredOutput) GoString() string { - return s.String() -} - -// SetIsPeered sets the IsPeered field's value. -func (s *IsVpcPeeredOutput) SetIsPeered(v bool) *IsVpcPeeredOutput { - s.IsPeered = &v - return s -} - -// Describes the SSH key pair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/KeyPair -type KeyPair struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the key pair (e.g., arn:aws:lightsail:us-east-1:123456789101:KeyPair/05859e3d-331d-48ba-9034-12345EXAMPLE). - Arn *string `locationName:"arn" type:"string"` - - // The timestamp when the key pair was created (e.g., 1479816991.349). - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The RSA fingerprint of the key pair. - Fingerprint *string `locationName:"fingerprint" type:"string"` - - // The region name and Availability Zone where the key pair was created. - Location *ResourceLocation `locationName:"location" type:"structure"` - - // The friendly name of the SSH key pair. - Name *string `locationName:"name" type:"string"` - - // The resource type (usually KeyPair). - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The support code. Include this code in your email to support when you have - // questions about an instance or another resource in Lightsail. This code enables - // our support team to look up your Lightsail information more easily. - SupportCode *string `locationName:"supportCode" type:"string"` -} - -// String returns the string representation -func (s KeyPair) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyPair) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *KeyPair) SetArn(v string) *KeyPair { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *KeyPair) SetCreatedAt(v time.Time) *KeyPair { - s.CreatedAt = &v - return s -} - -// SetFingerprint sets the Fingerprint field's value. -func (s *KeyPair) SetFingerprint(v string) *KeyPair { - s.Fingerprint = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *KeyPair) SetLocation(v *ResourceLocation) *KeyPair { - s.Location = v - return s -} - -// SetName sets the Name field's value. -func (s *KeyPair) SetName(v string) *KeyPair { - s.Name = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *KeyPair) SetResourceType(v string) *KeyPair { - s.ResourceType = &v - return s -} - -// SetSupportCode sets the SupportCode field's value. -func (s *KeyPair) SetSupportCode(v string) *KeyPair { - s.SupportCode = &v - return s -} - -// Describes the metric data point. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/MetricDatapoint -type MetricDatapoint struct { - _ struct{} `type:"structure"` - - // The average. - Average *float64 `locationName:"average" type:"double"` - - // The maximum. - Maximum *float64 `locationName:"maximum" type:"double"` - - // The minimum. - Minimum *float64 `locationName:"minimum" type:"double"` - - // The sample count. - SampleCount *float64 `locationName:"sampleCount" type:"double"` - - // The sum. - Sum *float64 `locationName:"sum" type:"double"` - - // The timestamp (e.g., 1479816991.349). - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"unix"` - - // The unit. - Unit *string `locationName:"unit" type:"string" enum:"MetricUnit"` -} - -// String returns the string representation -func (s MetricDatapoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricDatapoint) GoString() string { - return s.String() -} - -// SetAverage sets the Average field's value. -func (s *MetricDatapoint) SetAverage(v float64) *MetricDatapoint { - s.Average = &v - return s -} - -// SetMaximum sets the Maximum field's value. -func (s *MetricDatapoint) SetMaximum(v float64) *MetricDatapoint { - s.Maximum = &v - return s -} - -// SetMinimum sets the Minimum field's value. -func (s *MetricDatapoint) SetMinimum(v float64) *MetricDatapoint { - s.Minimum = &v - return s -} - -// SetSampleCount sets the SampleCount field's value. -func (s *MetricDatapoint) SetSampleCount(v float64) *MetricDatapoint { - s.SampleCount = &v - return s -} - -// SetSum sets the Sum field's value. -func (s *MetricDatapoint) SetSum(v float64) *MetricDatapoint { - s.Sum = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *MetricDatapoint) SetTimestamp(v time.Time) *MetricDatapoint { - s.Timestamp = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *MetricDatapoint) SetUnit(v string) *MetricDatapoint { - s.Unit = &v - return s -} - -// Describes the monthly data transfer in and out of your virtual private server -// (or instance). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/MonthlyTransfer -type MonthlyTransfer struct { - _ struct{} `type:"structure"` - - // The amount allocated per month (in GB). - GbPerMonthAllocated *int64 `locationName:"gbPerMonthAllocated" type:"integer"` -} - -// String returns the string representation -func (s MonthlyTransfer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MonthlyTransfer) GoString() string { - return s.String() -} - -// SetGbPerMonthAllocated sets the GbPerMonthAllocated field's value. -func (s *MonthlyTransfer) SetGbPerMonthAllocated(v int64) *MonthlyTransfer { - s.GbPerMonthAllocated = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPortsRequest -type OpenInstancePublicPortsInput struct { - _ struct{} `type:"structure"` - - // The name of the instance for which you want to open the public ports. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` - - // An array of key-value pairs containing information about the port mappings. - // - // PortInfo is a required field - PortInfo *PortInfo `locationName:"portInfo" type:"structure" required:"true"` -} - -// String returns the string representation -func (s OpenInstancePublicPortsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OpenInstancePublicPortsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OpenInstancePublicPortsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OpenInstancePublicPortsInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - if s.PortInfo == nil { - invalidParams.Add(request.NewErrParamRequired("PortInfo")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *OpenInstancePublicPortsInput) SetInstanceName(v string) *OpenInstancePublicPortsInput { - s.InstanceName = &v - return s -} - -// SetPortInfo sets the PortInfo field's value. -func (s *OpenInstancePublicPortsInput) SetPortInfo(v *PortInfo) *OpenInstancePublicPortsInput { - s.PortInfo = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPortsResult -type OpenInstancePublicPortsOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s OpenInstancePublicPortsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OpenInstancePublicPortsOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *OpenInstancePublicPortsOutput) SetOperation(v *Operation) *OpenInstancePublicPortsOutput { - s.Operation = v - return s -} - -// Describes the API operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/Operation -type Operation struct { - _ struct{} `type:"structure"` - - // The timestamp when the operation was initialized (e.g., 1479816991.349). - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The error code. - ErrorCode *string `locationName:"errorCode" type:"string"` - - // The error details. - ErrorDetails *string `locationName:"errorDetails" type:"string"` - - // The ID of the operation. - Id *string `locationName:"id" type:"string"` - - // A Boolean value indicating whether the operation is terminal. - IsTerminal *bool `locationName:"isTerminal" type:"boolean"` - - // The region and Availability Zone. - Location *ResourceLocation `locationName:"location" type:"structure"` - - // Details about the operation (e.g., Debian-1GB-Virginia-1). - OperationDetails *string `locationName:"operationDetails" type:"string"` - - // The type of operation. - OperationType *string `locationName:"operationType" type:"string" enum:"OperationType"` - - // The resource name. - ResourceName *string `locationName:"resourceName" type:"string"` - - // The resource type. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The status of the operation. - Status *string `locationName:"status" type:"string" enum:"OperationStatus"` - - // The timestamp when the status was changed (e.g., 1479816991.349). - StatusChangedAt *time.Time `locationName:"statusChangedAt" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s Operation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Operation) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Operation) SetCreatedAt(v time.Time) *Operation { - s.CreatedAt = &v - return s -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *Operation) SetErrorCode(v string) *Operation { - s.ErrorCode = &v - return s -} - -// SetErrorDetails sets the ErrorDetails field's value. -func (s *Operation) SetErrorDetails(v string) *Operation { - s.ErrorDetails = &v - return s -} - -// SetId sets the Id field's value. -func (s *Operation) SetId(v string) *Operation { - s.Id = &v - return s -} - -// SetIsTerminal sets the IsTerminal field's value. -func (s *Operation) SetIsTerminal(v bool) *Operation { - s.IsTerminal = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *Operation) SetLocation(v *ResourceLocation) *Operation { - s.Location = v - return s -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *Operation) SetOperationDetails(v string) *Operation { - s.OperationDetails = &v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *Operation) SetOperationType(v string) *Operation { - s.OperationType = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *Operation) SetResourceName(v string) *Operation { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Operation) SetResourceType(v string) *Operation { - s.ResourceType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Operation) SetStatus(v string) *Operation { - s.Status = &v - return s -} - -// SetStatusChangedAt sets the StatusChangedAt field's value. -func (s *Operation) SetStatusChangedAt(v time.Time) *Operation { - s.StatusChangedAt = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpcRequest -type PeerVpcInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PeerVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PeerVpcInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpcResult -type PeerVpcOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s PeerVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PeerVpcOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *PeerVpcOutput) SetOperation(v *Operation) *PeerVpcOutput { - s.Operation = v - return s -} - -// Describes information about the ports on your virtual private server (or -// instance). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PortInfo -type PortInfo struct { - _ struct{} `type:"structure"` - - // The first port in the range. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The protocol. - Protocol *string `locationName:"protocol" type:"string" enum:"NetworkProtocol"` - - // The last port in the range. - ToPort *int64 `locationName:"toPort" type:"integer"` -} - -// String returns the string representation -func (s PortInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PortInfo) GoString() string { - return s.String() -} - -// SetFromPort sets the FromPort field's value. -func (s *PortInfo) SetFromPort(v int64) *PortInfo { - s.FromPort = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *PortInfo) SetProtocol(v string) *PortInfo { - s.Protocol = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *PortInfo) SetToPort(v int64) *PortInfo { - s.ToPort = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstanceRequest -type RebootInstanceInput struct { - _ struct{} `type:"structure"` - - // The name of the instance to reboot. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s RebootInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootInstanceInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *RebootInstanceInput) SetInstanceName(v string) *RebootInstanceInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstanceResult -type RebootInstanceOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s RebootInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstanceOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *RebootInstanceOutput) SetOperations(v []*Operation) *RebootInstanceOutput { - s.Operations = v - return s -} - -// Describes the AWS Region. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/Region -type Region struct { - _ struct{} `type:"structure"` - - // The Availability Zones. - AvailabilityZones []*AvailabilityZone `locationName:"availabilityZones" type:"list"` - - // The continent code (e.g., NA, meaning North America). - ContinentCode *string `locationName:"continentCode" type:"string"` - - // The description of the AWS Region (e.g., This region is recommended to serve - // users in the eastern United States and eastern Canada). - Description *string `locationName:"description" type:"string"` - - // The display name (e.g., Virginia). - DisplayName *string `locationName:"displayName" type:"string"` - - // The region name (e.g., us-east-1). - Name *string `locationName:"name" type:"string" enum:"RegionName"` -} - -// 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() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *Region) SetAvailabilityZones(v []*AvailabilityZone) *Region { - s.AvailabilityZones = v - return s -} - -// SetContinentCode sets the ContinentCode field's value. -func (s *Region) SetContinentCode(v string) *Region { - s.ContinentCode = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Region) SetDescription(v string) *Region { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Region) SetDisplayName(v string) *Region { - s.DisplayName = &v - return s -} - -// SetName sets the Name field's value. -func (s *Region) SetName(v string) *Region { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIpRequest -type ReleaseStaticIpInput struct { - _ struct{} `type:"structure"` - - // The name of the static IP to delete. - // - // StaticIpName is a required field - StaticIpName *string `locationName:"staticIpName" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReleaseStaticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseStaticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReleaseStaticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReleaseStaticIpInput"} - if s.StaticIpName == nil { - invalidParams.Add(request.NewErrParamRequired("StaticIpName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStaticIpName sets the StaticIpName field's value. -func (s *ReleaseStaticIpInput) SetStaticIpName(v string) *ReleaseStaticIpInput { - s.StaticIpName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIpResult -type ReleaseStaticIpOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s ReleaseStaticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseStaticIpOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *ReleaseStaticIpOutput) SetOperations(v []*Operation) *ReleaseStaticIpOutput { - s.Operations = v - return s -} - -// Describes the resource location. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ResourceLocation -type ResourceLocation struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The AWS Region name. - RegionName *string `locationName:"regionName" type:"string" enum:"RegionName"` -} - -// String returns the string representation -func (s ResourceLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceLocation) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ResourceLocation) SetAvailabilityZone(v string) *ResourceLocation { - s.AvailabilityZone = &v - return s -} - -// SetRegionName sets the RegionName field's value. -func (s *ResourceLocation) SetRegionName(v string) *ResourceLocation { - s.RegionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstanceRequest -type StartInstanceInput struct { - _ struct{} `type:"structure"` - - // The name of the instance (a virtual private server) to start. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartInstanceInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *StartInstanceInput) SetInstanceName(v string) *StartInstanceInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstanceResult -type StartInstanceOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s StartInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstanceOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *StartInstanceOutput) SetOperations(v []*Operation) *StartInstanceOutput { - s.Operations = v - return s -} - -// Describes the static IP. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StaticIp -type StaticIp struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the static IP (e.g., arn:aws:lightsail:us-east-1:123456789101:StaticIp/9cbb4a9e-f8e3-4dfe-b57e-12345EXAMPLE). - Arn *string `locationName:"arn" type:"string"` - - // The instance where the static IP is attached (e.g., Amazon_Linux-1GB-Virginia-1). - AttachedTo *string `locationName:"attachedTo" type:"string"` - - // The timestamp when the static IP was created (e.g., 1479735304.222). - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The static IP address. - IpAddress *string `locationName:"ipAddress" type:"string"` - - // A Boolean value indicating whether the static IP is attached. - IsAttached *bool `locationName:"isAttached" type:"boolean"` - - // The region and Availability Zone where the static IP was created. - Location *ResourceLocation `locationName:"location" type:"structure"` - - // The name of the static IP (e.g., StaticIP-Virginia-EXAMPLE). - Name *string `locationName:"name" type:"string"` - - // The resource type (usually StaticIp). - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The support code. Include this code in your email to support when you have - // questions about an instance or another resource in Lightsail. This code enables - // our support team to look up your Lightsail information more easily. - SupportCode *string `locationName:"supportCode" type:"string"` -} - -// String returns the string representation -func (s StaticIp) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StaticIp) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StaticIp) SetArn(v string) *StaticIp { - s.Arn = &v - return s -} - -// SetAttachedTo sets the AttachedTo field's value. -func (s *StaticIp) SetAttachedTo(v string) *StaticIp { - s.AttachedTo = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *StaticIp) SetCreatedAt(v time.Time) *StaticIp { - s.CreatedAt = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *StaticIp) SetIpAddress(v string) *StaticIp { - s.IpAddress = &v - return s -} - -// SetIsAttached sets the IsAttached field's value. -func (s *StaticIp) SetIsAttached(v bool) *StaticIp { - s.IsAttached = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *StaticIp) SetLocation(v *ResourceLocation) *StaticIp { - s.Location = v - return s -} - -// SetName sets the Name field's value. -func (s *StaticIp) SetName(v string) *StaticIp { - s.Name = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *StaticIp) SetResourceType(v string) *StaticIp { - s.ResourceType = &v - return s -} - -// SetSupportCode sets the SupportCode field's value. -func (s *StaticIp) SetSupportCode(v string) *StaticIp { - s.SupportCode = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstanceRequest -type StopInstanceInput struct { - _ struct{} `type:"structure"` - - // The name of the instance (a virtual private server) to stop. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopInstanceInput"} - if s.InstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceName sets the InstanceName field's value. -func (s *StopInstanceInput) SetInstanceName(v string) *StopInstanceInput { - s.InstanceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstanceResult -type StopInstanceOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s StopInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstanceOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *StopInstanceOutput) SetOperations(v []*Operation) *StopInstanceOutput { - s.Operations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpcRequest -type UnpeerVpcInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UnpeerVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnpeerVpcInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpcResult -type UnpeerVpcOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operation *Operation `locationName:"operation" type:"structure"` -} - -// String returns the string representation -func (s UnpeerVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnpeerVpcOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *UnpeerVpcOutput) SetOperation(v *Operation) *UnpeerVpcOutput { - s.Operation = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntryRequest -type UpdateDomainEntryInput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the domain entry. - // - // DomainEntry is a required field - DomainEntry *DomainEntry `locationName:"domainEntry" type:"structure" required:"true"` - - // The name of the domain recordset to update. - // - // DomainName is a required field - DomainName *string `locationName:"domainName" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateDomainEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDomainEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDomainEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDomainEntryInput"} - if s.DomainEntry == nil { - invalidParams.Add(request.NewErrParamRequired("DomainEntry")) - } - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainEntry sets the DomainEntry field's value. -func (s *UpdateDomainEntryInput) SetDomainEntry(v *DomainEntry) *UpdateDomainEntryInput { - s.DomainEntry = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *UpdateDomainEntryInput) SetDomainName(v string) *UpdateDomainEntryInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntryResult -type UpdateDomainEntryOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs containing information about the request operation. - Operations []*Operation `locationName:"operations" type:"list"` -} - -// String returns the string representation -func (s UpdateDomainEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDomainEntryOutput) GoString() string { - return s.String() -} - -// SetOperations sets the Operations field's value. -func (s *UpdateDomainEntryOutput) SetOperations(v []*Operation) *UpdateDomainEntryOutput { - s.Operations = v - return s -} - -const ( - // AccessDirectionInbound is a AccessDirection enum value - AccessDirectionInbound = "inbound" - - // AccessDirectionOutbound is a AccessDirection enum value - AccessDirectionOutbound = "outbound" -) - -const ( - // BlueprintTypeOs is a BlueprintType enum value - BlueprintTypeOs = "os" - - // BlueprintTypeApp is a BlueprintType enum value - BlueprintTypeApp = "app" -) - -const ( - // InstanceAccessProtocolSsh is a InstanceAccessProtocol enum value - InstanceAccessProtocolSsh = "ssh" - - // InstanceAccessProtocolRdp is a InstanceAccessProtocol enum value - InstanceAccessProtocolRdp = "rdp" -) - -const ( - // InstanceMetricNameCpuutilization is a InstanceMetricName enum value - InstanceMetricNameCpuutilization = "CPUUtilization" - - // InstanceMetricNameNetworkIn is a InstanceMetricName enum value - InstanceMetricNameNetworkIn = "NetworkIn" - - // InstanceMetricNameNetworkOut is a InstanceMetricName enum value - InstanceMetricNameNetworkOut = "NetworkOut" - - // InstanceMetricNameStatusCheckFailed is a InstanceMetricName enum value - InstanceMetricNameStatusCheckFailed = "StatusCheckFailed" - - // InstanceMetricNameStatusCheckFailedInstance is a InstanceMetricName enum value - InstanceMetricNameStatusCheckFailedInstance = "StatusCheckFailed_Instance" - - // InstanceMetricNameStatusCheckFailedSystem is a InstanceMetricName enum value - InstanceMetricNameStatusCheckFailedSystem = "StatusCheckFailed_System" -) - -const ( - // InstanceSnapshotStatePending is a InstanceSnapshotState enum value - InstanceSnapshotStatePending = "pending" - - // InstanceSnapshotStateError is a InstanceSnapshotState enum value - InstanceSnapshotStateError = "error" - - // InstanceSnapshotStateAvailable is a InstanceSnapshotState enum value - InstanceSnapshotStateAvailable = "available" -) - -const ( - // MetricStatisticMinimum is a MetricStatistic enum value - MetricStatisticMinimum = "Minimum" - - // MetricStatisticMaximum is a MetricStatistic enum value - MetricStatisticMaximum = "Maximum" - - // MetricStatisticSum is a MetricStatistic enum value - MetricStatisticSum = "Sum" - - // MetricStatisticAverage is a MetricStatistic enum value - MetricStatisticAverage = "Average" - - // MetricStatisticSampleCount is a MetricStatistic enum value - MetricStatisticSampleCount = "SampleCount" -) - -const ( - // MetricUnitSeconds is a MetricUnit enum value - MetricUnitSeconds = "Seconds" - - // MetricUnitMicroseconds is a MetricUnit enum value - MetricUnitMicroseconds = "Microseconds" - - // MetricUnitMilliseconds is a MetricUnit enum value - MetricUnitMilliseconds = "Milliseconds" - - // MetricUnitBytes is a MetricUnit enum value - MetricUnitBytes = "Bytes" - - // MetricUnitKilobytes is a MetricUnit enum value - MetricUnitKilobytes = "Kilobytes" - - // MetricUnitMegabytes is a MetricUnit enum value - MetricUnitMegabytes = "Megabytes" - - // MetricUnitGigabytes is a MetricUnit enum value - MetricUnitGigabytes = "Gigabytes" - - // MetricUnitTerabytes is a MetricUnit enum value - MetricUnitTerabytes = "Terabytes" - - // MetricUnitBits is a MetricUnit enum value - MetricUnitBits = "Bits" - - // MetricUnitKilobits is a MetricUnit enum value - MetricUnitKilobits = "Kilobits" - - // MetricUnitMegabits is a MetricUnit enum value - MetricUnitMegabits = "Megabits" - - // MetricUnitGigabits is a MetricUnit enum value - MetricUnitGigabits = "Gigabits" - - // MetricUnitTerabits is a MetricUnit enum value - MetricUnitTerabits = "Terabits" - - // MetricUnitPercent is a MetricUnit enum value - MetricUnitPercent = "Percent" - - // MetricUnitCount is a MetricUnit enum value - MetricUnitCount = "Count" - - // MetricUnitBytesSecond is a MetricUnit enum value - MetricUnitBytesSecond = "Bytes/Second" - - // MetricUnitKilobytesSecond is a MetricUnit enum value - MetricUnitKilobytesSecond = "Kilobytes/Second" - - // MetricUnitMegabytesSecond is a MetricUnit enum value - MetricUnitMegabytesSecond = "Megabytes/Second" - - // MetricUnitGigabytesSecond is a MetricUnit enum value - MetricUnitGigabytesSecond = "Gigabytes/Second" - - // MetricUnitTerabytesSecond is a MetricUnit enum value - MetricUnitTerabytesSecond = "Terabytes/Second" - - // MetricUnitBitsSecond is a MetricUnit enum value - MetricUnitBitsSecond = "Bits/Second" - - // MetricUnitKilobitsSecond is a MetricUnit enum value - MetricUnitKilobitsSecond = "Kilobits/Second" - - // MetricUnitMegabitsSecond is a MetricUnit enum value - MetricUnitMegabitsSecond = "Megabits/Second" - - // MetricUnitGigabitsSecond is a MetricUnit enum value - MetricUnitGigabitsSecond = "Gigabits/Second" - - // MetricUnitTerabitsSecond is a MetricUnit enum value - MetricUnitTerabitsSecond = "Terabits/Second" - - // MetricUnitCountSecond is a MetricUnit enum value - MetricUnitCountSecond = "Count/Second" - - // MetricUnitNone is a MetricUnit enum value - MetricUnitNone = "None" -) - -const ( - // NetworkProtocolTcp is a NetworkProtocol enum value - NetworkProtocolTcp = "tcp" - - // NetworkProtocolAll is a NetworkProtocol enum value - NetworkProtocolAll = "all" - - // NetworkProtocolUdp is a NetworkProtocol enum value - NetworkProtocolUdp = "udp" -) - -const ( - // OperationStatusNotStarted is a OperationStatus enum value - OperationStatusNotStarted = "NotStarted" - - // OperationStatusStarted is a OperationStatus enum value - OperationStatusStarted = "Started" - - // OperationStatusFailed is a OperationStatus enum value - OperationStatusFailed = "Failed" - - // OperationStatusCompleted is a OperationStatus enum value - OperationStatusCompleted = "Completed" -) - -const ( - // OperationTypeDeleteInstance is a OperationType enum value - OperationTypeDeleteInstance = "DeleteInstance" - - // OperationTypeCreateInstance is a OperationType enum value - OperationTypeCreateInstance = "CreateInstance" - - // OperationTypeStopInstance is a OperationType enum value - OperationTypeStopInstance = "StopInstance" - - // OperationTypeStartInstance is a OperationType enum value - OperationTypeStartInstance = "StartInstance" - - // OperationTypeRebootInstance is a OperationType enum value - OperationTypeRebootInstance = "RebootInstance" - - // OperationTypeOpenInstancePublicPorts is a OperationType enum value - OperationTypeOpenInstancePublicPorts = "OpenInstancePublicPorts" - - // OperationTypeCloseInstancePublicPorts is a OperationType enum value - OperationTypeCloseInstancePublicPorts = "CloseInstancePublicPorts" - - // OperationTypeAllocateStaticIp is a OperationType enum value - OperationTypeAllocateStaticIp = "AllocateStaticIp" - - // OperationTypeReleaseStaticIp is a OperationType enum value - OperationTypeReleaseStaticIp = "ReleaseStaticIp" - - // OperationTypeAttachStaticIp is a OperationType enum value - OperationTypeAttachStaticIp = "AttachStaticIp" - - // OperationTypeDetachStaticIp is a OperationType enum value - OperationTypeDetachStaticIp = "DetachStaticIp" - - // OperationTypeUpdateDomainEntry is a OperationType enum value - OperationTypeUpdateDomainEntry = "UpdateDomainEntry" - - // OperationTypeDeleteDomainEntry is a OperationType enum value - OperationTypeDeleteDomainEntry = "DeleteDomainEntry" - - // OperationTypeCreateDomain is a OperationType enum value - OperationTypeCreateDomain = "CreateDomain" - - // OperationTypeDeleteDomain is a OperationType enum value - OperationTypeDeleteDomain = "DeleteDomain" - - // OperationTypeCreateInstanceSnapshot is a OperationType enum value - OperationTypeCreateInstanceSnapshot = "CreateInstanceSnapshot" - - // OperationTypeDeleteInstanceSnapshot is a OperationType enum value - OperationTypeDeleteInstanceSnapshot = "DeleteInstanceSnapshot" - - // OperationTypeCreateInstancesFromSnapshot is a OperationType enum value - OperationTypeCreateInstancesFromSnapshot = "CreateInstancesFromSnapshot" -) - -const ( - // PortAccessTypePublic is a PortAccessType enum value - PortAccessTypePublic = "Public" - - // PortAccessTypePrivate is a PortAccessType enum value - PortAccessTypePrivate = "Private" -) - -const ( - // PortStateOpen is a PortState enum value - PortStateOpen = "open" - - // PortStateClosed is a PortState enum value - PortStateClosed = "closed" -) - -const ( - // RegionNameUsEast1 is a RegionName enum value - RegionNameUsEast1 = "us-east-1" - - // RegionNameUsWest1 is a RegionName enum value - RegionNameUsWest1 = "us-west-1" - - // RegionNameUsWest2 is a RegionName enum value - RegionNameUsWest2 = "us-west-2" - - // RegionNameEuWest1 is a RegionName enum value - RegionNameEuWest1 = "eu-west-1" - - // RegionNameEuCentral1 is a RegionName enum value - RegionNameEuCentral1 = "eu-central-1" - - // RegionNameApSouth1 is a RegionName enum value - RegionNameApSouth1 = "ap-south-1" - - // RegionNameApSoutheast1 is a RegionName enum value - RegionNameApSoutheast1 = "ap-southeast-1" - - // RegionNameApSoutheast2 is a RegionName enum value - RegionNameApSoutheast2 = "ap-southeast-2" - - // RegionNameApNortheast1 is a RegionName enum value - RegionNameApNortheast1 = "ap-northeast-1" - - // RegionNameApNortheast2 is a RegionName enum value - RegionNameApNortheast2 = "ap-northeast-2" -) - -const ( - // ResourceTypeInstance is a ResourceType enum value - ResourceTypeInstance = "Instance" - - // ResourceTypeStaticIp is a ResourceType enum value - ResourceTypeStaticIp = "StaticIp" - - // ResourceTypeKeyPair is a ResourceType enum value - ResourceTypeKeyPair = "KeyPair" - - // ResourceTypeInstanceSnapshot is a ResourceType enum value - ResourceTypeInstanceSnapshot = "InstanceSnapshot" - - // ResourceTypeDomain is a ResourceType enum value - ResourceTypeDomain = "Domain" - - // ResourceTypePeeredVpc is a ResourceType enum value - ResourceTypePeeredVpc = "PeeredVpc" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go deleted file mode 100644 index 309a86b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go +++ /dev/null @@ -1,51 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package lightsail - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // Lightsail throws this exception when the user cannot be authenticated or - // uses invalid credentials to access a resource. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeAccountSetupInProgressException for service response error code - // "AccountSetupInProgressException". - // - // Lightsail throws this exception when an account is still in the setup in - // progress state. - ErrCodeAccountSetupInProgressException = "AccountSetupInProgressException" - - // ErrCodeInvalidInputException for service response error code - // "InvalidInputException". - // - // Lightsail throws this exception when user input does not conform to the validation - // rules of an input field. - ErrCodeInvalidInputException = "InvalidInputException" - - // ErrCodeNotFoundException for service response error code - // "NotFoundException". - // - // Lightsail throws this exception when it cannot find a resource. - ErrCodeNotFoundException = "NotFoundException" - - // ErrCodeOperationFailureException for service response error code - // "OperationFailureException". - // - // Lightsail throws this exception when an operation fails to execute. - ErrCodeOperationFailureException = "OperationFailureException" - - // ErrCodeServiceException for service response error code - // "ServiceException". - // - // A general service exception. - ErrCodeServiceException = "ServiceException" - - // ErrCodeUnauthenticatedException for service response error code - // "UnauthenticatedException". - // - // Lightsail throws this exception when the user has not been authenticated. - ErrCodeUnauthenticatedException = "UnauthenticatedException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go deleted file mode 100644 index c3e15de..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go +++ /dev/null @@ -1,105 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package lightsail - -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 Lightsail is the easiest way to get started with AWS for developers -// who just need virtual private servers. Lightsail includes everything you -// need to launch your project quickly - a virtual machine, SSD-based storage, -// data transfer, DNS management, and a static IP - for a low, predictable price. -// You manage those Lightsail servers through the Lightsail console or by using -// the API or command-line interface (CLI). -// -// For more information about Lightsail concepts and tasks, see the Lightsail -// Dev Guide (http://lightsail.aws.amazon.com/ls/docs). -// -// To use the Lightsail API or the CLI, you will need to use AWS Identity and -// Access Management (IAM) to generate access keys. For details about how to -// set this up, see the Lightsail Dev Guide (http://lightsail.aws.amazon.com/ls/docs/how-to/articles/lightsail-how-to-set-up-access-keys-to-use-sdk-api-cli). -// 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/lightsail-2016-11-28 -type Lightsail 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 = "lightsail" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the Lightsail 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 Lightsail client from just a session. -// svc := lightsail.New(mySession) -// -// // Create a Lightsail client with additional configuration -// svc := lightsail.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Lightsail { - 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) *Lightsail { - svc := &Lightsail{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-11-28", - JSONVersion: "1.1", - TargetPrefix: "Lightsail_20161128", - }, - 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 Lightsail operation and runs any -// custom request initialization. -func (c *Lightsail) 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/opsworks/api.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/api.go deleted file mode 100644 index d0c09d2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/api.go +++ /dev/null @@ -1,15871 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package opsworks provides a client for AWS OpsWorks. -package opsworks - -import ( - "fmt" - - "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 opAssignInstance = "AssignInstance" - -// AssignInstanceRequest generates a "aws/request.Request" representing the -// client's request for the AssignInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssignInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssignInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssignInstanceRequest method. -// req, resp := client.AssignInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignInstance -func (c *OpsWorks) AssignInstanceRequest(input *AssignInstanceInput) (req *request.Request, output *AssignInstanceOutput) { - op := &request.Operation{ - Name: opAssignInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssignInstanceInput{} - } - - output = &AssignInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssignInstance API operation for AWS OpsWorks. -// -// Assign a registered instance to a layer. -// -// * You can assign registered on-premises instances to any layer type. -// -// * You can assign registered Amazon EC2 instances only to custom layers. -// -// * You cannot use this action with instances that were created with AWS -// OpsWorks. -// -// Required Permissions: To use this action, an AWS Identity and Access Management -// (IAM) user must have a Manage permissions level for the stack or an attached -// policy that explicitly grants permissions. For more information on user permissions, -// see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation AssignInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignInstance -func (c *OpsWorks) AssignInstance(input *AssignInstanceInput) (*AssignInstanceOutput, error) { - req, out := c.AssignInstanceRequest(input) - err := req.Send() - return out, err -} - -const opAssignVolume = "AssignVolume" - -// AssignVolumeRequest generates a "aws/request.Request" representing the -// client's request for the AssignVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssignVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssignVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssignVolumeRequest method. -// req, resp := client.AssignVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignVolume -func (c *OpsWorks) AssignVolumeRequest(input *AssignVolumeInput) (req *request.Request, output *AssignVolumeOutput) { - op := &request.Operation{ - Name: opAssignVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssignVolumeInput{} - } - - output = &AssignVolumeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssignVolume API operation for AWS OpsWorks. -// -// Assigns one of the stack's registered Amazon EBS volumes to a specified instance. -// The volume must first be registered with the stack by calling RegisterVolume. -// After you register the volume, you must call UpdateVolume to specify a mount -// point before calling AssignVolume. For more information, see Resource Management -// (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation AssignVolume for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignVolume -func (c *OpsWorks) AssignVolume(input *AssignVolumeInput) (*AssignVolumeOutput, error) { - req, out := c.AssignVolumeRequest(input) - err := req.Send() - return out, err -} - -const opAssociateElasticIp = "AssociateElasticIp" - -// AssociateElasticIpRequest generates a "aws/request.Request" representing the -// client's request for the AssociateElasticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssociateElasticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssociateElasticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssociateElasticIpRequest method. -// req, resp := client.AssociateElasticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssociateElasticIp -func (c *OpsWorks) AssociateElasticIpRequest(input *AssociateElasticIpInput) (req *request.Request, output *AssociateElasticIpOutput) { - op := &request.Operation{ - Name: opAssociateElasticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateElasticIpInput{} - } - - output = &AssociateElasticIpOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssociateElasticIp API operation for AWS OpsWorks. -// -// Associates one of the stack's registered Elastic IP addresses with a specified -// instance. The address must first be registered with the stack by calling -// RegisterElasticIp. For more information, see Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation AssociateElasticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssociateElasticIp -func (c *OpsWorks) AssociateElasticIp(input *AssociateElasticIpInput) (*AssociateElasticIpOutput, error) { - req, out := c.AssociateElasticIpRequest(input) - err := req.Send() - return out, err -} - -const opAttachElasticLoadBalancer = "AttachElasticLoadBalancer" - -// AttachElasticLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the AttachElasticLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachElasticLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachElasticLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachElasticLoadBalancerRequest method. -// req, resp := client.AttachElasticLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AttachElasticLoadBalancer -func (c *OpsWorks) AttachElasticLoadBalancerRequest(input *AttachElasticLoadBalancerInput) (req *request.Request, output *AttachElasticLoadBalancerOutput) { - op := &request.Operation{ - Name: opAttachElasticLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachElasticLoadBalancerInput{} - } - - output = &AttachElasticLoadBalancerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AttachElasticLoadBalancer API operation for AWS OpsWorks. -// -// Attaches an Elastic Load Balancing load balancer to a specified layer. For -// more information, see Elastic Load Balancing (http://docs.aws.amazon.com/opsworks/latest/userguide/load-balancer-elb.html). -// -// You must create the Elastic Load Balancing instance separately, by using -// the Elastic Load Balancing console, API, or CLI. For more information, see -// Elastic Load Balancing Developer Guide (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/Welcome.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation AttachElasticLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AttachElasticLoadBalancer -func (c *OpsWorks) AttachElasticLoadBalancer(input *AttachElasticLoadBalancerInput) (*AttachElasticLoadBalancerOutput, error) { - req, out := c.AttachElasticLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opCloneStack = "CloneStack" - -// CloneStackRequest generates a "aws/request.Request" representing the -// client's request for the CloneStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CloneStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CloneStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CloneStackRequest method. -// req, resp := client.CloneStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CloneStack -func (c *OpsWorks) CloneStackRequest(input *CloneStackInput) (req *request.Request, output *CloneStackOutput) { - op := &request.Operation{ - Name: opCloneStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CloneStackInput{} - } - - output = &CloneStackOutput{} - req = c.newRequest(op, input, output) - return -} - -// CloneStack API operation for AWS OpsWorks. -// -// Creates a clone of a specified stack. For more information, see Clone a Stack -// (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-cloning.html). -// By default, all parameters are set to the values used by the parent stack. -// -// Required Permissions: To use this action, an IAM user must have an attached -// policy that explicitly grants permissions. For more information on user permissions, -// see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation CloneStack for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CloneStack -func (c *OpsWorks) CloneStack(input *CloneStackInput) (*CloneStackOutput, error) { - req, out := c.CloneStackRequest(input) - err := req.Send() - return out, err -} - -const opCreateApp = "CreateApp" - -// CreateAppRequest generates a "aws/request.Request" representing the -// client's request for the CreateApp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateApp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateApp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAppRequest method. -// req, resp := client.CreateAppRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateApp -func (c *OpsWorks) CreateAppRequest(input *CreateAppInput) (req *request.Request, output *CreateAppOutput) { - op := &request.Operation{ - Name: opCreateApp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAppInput{} - } - - output = &CreateAppOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateApp API operation for AWS OpsWorks. -// -// Creates an app for a specified stack. For more information, see Creating -// Apps (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation CreateApp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateApp -func (c *OpsWorks) CreateApp(input *CreateAppInput) (*CreateAppOutput, error) { - req, out := c.CreateAppRequest(input) - err := req.Send() - return out, err -} - -const opCreateDeployment = "CreateDeployment" - -// CreateDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the CreateDeployment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDeployment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDeployment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDeploymentRequest method. -// req, resp := client.CreateDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateDeployment -func (c *OpsWorks) CreateDeploymentRequest(input *CreateDeploymentInput) (req *request.Request, output *CreateDeploymentOutput) { - op := &request.Operation{ - Name: opCreateDeployment, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDeploymentInput{} - } - - output = &CreateDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDeployment API operation for AWS OpsWorks. -// -// Runs deployment or stack commands. For more information, see Deploying Apps -// (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-deploying.html) -// and Run Stack Commands (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-commands.html). -// -// Required Permissions: To use this action, an IAM user must have a Deploy -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation CreateDeployment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateDeployment -func (c *OpsWorks) CreateDeployment(input *CreateDeploymentInput) (*CreateDeploymentOutput, error) { - req, out := c.CreateDeploymentRequest(input) - err := req.Send() - return out, err -} - -const opCreateInstance = "CreateInstance" - -// CreateInstanceRequest generates a "aws/request.Request" representing the -// client's request for the CreateInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateInstanceRequest method. -// req, resp := client.CreateInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateInstance -func (c *OpsWorks) CreateInstanceRequest(input *CreateInstanceInput) (req *request.Request, output *CreateInstanceOutput) { - op := &request.Operation{ - Name: opCreateInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInstanceInput{} - } - - output = &CreateInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInstance API operation for AWS OpsWorks. -// -// Creates an instance in a specified stack. For more information, see Adding -// an Instance to a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation CreateInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateInstance -func (c *OpsWorks) CreateInstance(input *CreateInstanceInput) (*CreateInstanceOutput, error) { - req, out := c.CreateInstanceRequest(input) - err := req.Send() - return out, err -} - -const opCreateLayer = "CreateLayer" - -// CreateLayerRequest generates a "aws/request.Request" representing the -// client's request for the CreateLayer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateLayer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateLayer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateLayerRequest method. -// req, resp := client.CreateLayerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateLayer -func (c *OpsWorks) CreateLayerRequest(input *CreateLayerInput) (req *request.Request, output *CreateLayerOutput) { - op := &request.Operation{ - Name: opCreateLayer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLayerInput{} - } - - output = &CreateLayerOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLayer API operation for AWS OpsWorks. -// -// Creates a layer. For more information, see How to Create a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-create.html). -// -// You should use CreateLayer for noncustom layer types such as PHP App Server -// only if the stack does not have an existing layer of that type. A stack can -// have at most one instance of each noncustom layer; if you attempt to create -// a second instance, CreateLayer fails. A stack can have an arbitrary number -// of custom layers, so you can call CreateLayer as many times as you like for -// that layer type. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation CreateLayer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateLayer -func (c *OpsWorks) CreateLayer(input *CreateLayerInput) (*CreateLayerOutput, error) { - req, out := c.CreateLayerRequest(input) - err := req.Send() - return out, err -} - -const opCreateStack = "CreateStack" - -// CreateStackRequest generates a "aws/request.Request" representing the -// client's request for the CreateStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateStackRequest method. -// req, resp := client.CreateStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateStack -func (c *OpsWorks) CreateStackRequest(input *CreateStackInput) (req *request.Request, output *CreateStackOutput) { - op := &request.Operation{ - Name: opCreateStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateStackInput{} - } - - output = &CreateStackOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateStack API operation for AWS OpsWorks. -// -// Creates a new stack. For more information, see Create a New Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-edit.html). -// -// Required Permissions: To use this action, an IAM user must have an attached -// policy that explicitly grants permissions. For more information on user permissions, -// see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation CreateStack for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateStack -func (c *OpsWorks) CreateStack(input *CreateStackInput) (*CreateStackOutput, error) { - req, out := c.CreateStackRequest(input) - err := req.Send() - return out, err -} - -const opCreateUserProfile = "CreateUserProfile" - -// CreateUserProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateUserProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateUserProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateUserProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateUserProfileRequest method. -// req, resp := client.CreateUserProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateUserProfile -func (c *OpsWorks) CreateUserProfileRequest(input *CreateUserProfileInput) (req *request.Request, output *CreateUserProfileOutput) { - op := &request.Operation{ - Name: opCreateUserProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateUserProfileInput{} - } - - output = &CreateUserProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateUserProfile API operation for AWS OpsWorks. -// -// Creates a new user profile. -// -// Required Permissions: To use this action, an IAM user must have an attached -// policy that explicitly grants permissions. For more information on user permissions, -// see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation CreateUserProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateUserProfile -func (c *OpsWorks) CreateUserProfile(input *CreateUserProfileInput) (*CreateUserProfileOutput, error) { - req, out := c.CreateUserProfileRequest(input) - err := req.Send() - return out, err -} - -const opDeleteApp = "DeleteApp" - -// DeleteAppRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteApp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteApp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAppRequest method. -// req, resp := client.DeleteAppRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteApp -func (c *OpsWorks) DeleteAppRequest(input *DeleteAppInput) (req *request.Request, output *DeleteAppOutput) { - op := &request.Operation{ - Name: opDeleteApp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAppInput{} - } - - output = &DeleteAppOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApp API operation for AWS OpsWorks. -// -// Deletes a specified app. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeleteApp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteApp -func (c *OpsWorks) DeleteApp(input *DeleteAppInput) (*DeleteAppOutput, error) { - req, out := c.DeleteAppRequest(input) - err := req.Send() - return out, err -} - -const opDeleteInstance = "DeleteInstance" - -// DeleteInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteInstanceRequest method. -// req, resp := client.DeleteInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteInstance -func (c *OpsWorks) DeleteInstanceRequest(input *DeleteInstanceInput) (req *request.Request, output *DeleteInstanceOutput) { - op := &request.Operation{ - Name: opDeleteInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteInstanceInput{} - } - - output = &DeleteInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteInstance API operation for AWS OpsWorks. -// -// Deletes a specified instance, which terminates the associated Amazon EC2 -// instance. You must stop an instance before you can delete it. -// -// For more information, see Deleting Instances (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-delete.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeleteInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteInstance -func (c *OpsWorks) DeleteInstance(input *DeleteInstanceInput) (*DeleteInstanceOutput, error) { - req, out := c.DeleteInstanceRequest(input) - err := req.Send() - return out, err -} - -const opDeleteLayer = "DeleteLayer" - -// DeleteLayerRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLayer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteLayer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteLayer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteLayerRequest method. -// req, resp := client.DeleteLayerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteLayer -func (c *OpsWorks) DeleteLayerRequest(input *DeleteLayerInput) (req *request.Request, output *DeleteLayerOutput) { - op := &request.Operation{ - Name: opDeleteLayer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLayerInput{} - } - - output = &DeleteLayerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteLayer API operation for AWS OpsWorks. -// -// Deletes a specified layer. You must first stop and then delete all associated -// instances or unassign registered instances. For more information, see How -// to Delete a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-delete.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeleteLayer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteLayer -func (c *OpsWorks) DeleteLayer(input *DeleteLayerInput) (*DeleteLayerOutput, error) { - req, out := c.DeleteLayerRequest(input) - err := req.Send() - return out, err -} - -const opDeleteStack = "DeleteStack" - -// DeleteStackRequest generates a "aws/request.Request" representing the -// client's request for the DeleteStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteStackRequest method. -// req, resp := client.DeleteStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteStack -func (c *OpsWorks) DeleteStackRequest(input *DeleteStackInput) (req *request.Request, output *DeleteStackOutput) { - op := &request.Operation{ - Name: opDeleteStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteStackInput{} - } - - output = &DeleteStackOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteStack API operation for AWS OpsWorks. -// -// Deletes a specified stack. You must first delete all instances, layers, and -// apps or deregister registered instances. For more information, see Shut Down -// a Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-shutting.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeleteStack for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteStack -func (c *OpsWorks) DeleteStack(input *DeleteStackInput) (*DeleteStackOutput, error) { - req, out := c.DeleteStackRequest(input) - err := req.Send() - return out, err -} - -const opDeleteUserProfile = "DeleteUserProfile" - -// DeleteUserProfileRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUserProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteUserProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteUserProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteUserProfileRequest method. -// req, resp := client.DeleteUserProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteUserProfile -func (c *OpsWorks) DeleteUserProfileRequest(input *DeleteUserProfileInput) (req *request.Request, output *DeleteUserProfileOutput) { - op := &request.Operation{ - Name: opDeleteUserProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteUserProfileInput{} - } - - output = &DeleteUserProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteUserProfile API operation for AWS OpsWorks. -// -// Deletes a user profile. -// -// Required Permissions: To use this action, an IAM user must have an attached -// policy that explicitly grants permissions. For more information on user permissions, -// see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeleteUserProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteUserProfile -func (c *OpsWorks) DeleteUserProfile(input *DeleteUserProfileInput) (*DeleteUserProfileOutput, error) { - req, out := c.DeleteUserProfileRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterEcsCluster = "DeregisterEcsCluster" - -// DeregisterEcsClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterEcsCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterEcsCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterEcsCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterEcsClusterRequest method. -// req, resp := client.DeregisterEcsClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterEcsCluster -func (c *OpsWorks) DeregisterEcsClusterRequest(input *DeregisterEcsClusterInput) (req *request.Request, output *DeregisterEcsClusterOutput) { - op := &request.Operation{ - Name: opDeregisterEcsCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterEcsClusterInput{} - } - - output = &DeregisterEcsClusterOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterEcsCluster API operation for AWS OpsWorks. -// -// Deregisters a specified Amazon ECS cluster from a stack. For more information, -// see Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-ecscluster.html#workinglayers-ecscluster-delete). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack or an attached policy that explicitly grants -// permissions. For more information on user permissions, see http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html -// (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeregisterEcsCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterEcsCluster -func (c *OpsWorks) DeregisterEcsCluster(input *DeregisterEcsClusterInput) (*DeregisterEcsClusterOutput, error) { - req, out := c.DeregisterEcsClusterRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterElasticIp = "DeregisterElasticIp" - -// DeregisterElasticIpRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterElasticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterElasticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterElasticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterElasticIpRequest method. -// req, resp := client.DeregisterElasticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterElasticIp -func (c *OpsWorks) DeregisterElasticIpRequest(input *DeregisterElasticIpInput) (req *request.Request, output *DeregisterElasticIpOutput) { - op := &request.Operation{ - Name: opDeregisterElasticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterElasticIpInput{} - } - - output = &DeregisterElasticIpOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterElasticIp API operation for AWS OpsWorks. -// -// Deregisters a specified Elastic IP address. The address can then be registered -// by another stack. For more information, see Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeregisterElasticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterElasticIp -func (c *OpsWorks) DeregisterElasticIp(input *DeregisterElasticIpInput) (*DeregisterElasticIpOutput, error) { - req, out := c.DeregisterElasticIpRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterInstance = "DeregisterInstance" - -// DeregisterInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterInstanceRequest method. -// req, resp := client.DeregisterInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterInstance -func (c *OpsWorks) DeregisterInstanceRequest(input *DeregisterInstanceInput) (req *request.Request, output *DeregisterInstanceOutput) { - op := &request.Operation{ - Name: opDeregisterInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterInstanceInput{} - } - - output = &DeregisterInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterInstance API operation for AWS OpsWorks. -// -// Deregister a registered Amazon EC2 or on-premises instance. This action removes -// the instance from the stack and returns it to your control. This action can -// not be used with instances that were created with AWS OpsWorks. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeregisterInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterInstance -func (c *OpsWorks) DeregisterInstance(input *DeregisterInstanceInput) (*DeregisterInstanceOutput, error) { - req, out := c.DeregisterInstanceRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterRdsDbInstance = "DeregisterRdsDbInstance" - -// DeregisterRdsDbInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterRdsDbInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterRdsDbInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterRdsDbInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterRdsDbInstanceRequest method. -// req, resp := client.DeregisterRdsDbInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterRdsDbInstance -func (c *OpsWorks) DeregisterRdsDbInstanceRequest(input *DeregisterRdsDbInstanceInput) (req *request.Request, output *DeregisterRdsDbInstanceOutput) { - op := &request.Operation{ - Name: opDeregisterRdsDbInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterRdsDbInstanceInput{} - } - - output = &DeregisterRdsDbInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterRdsDbInstance API operation for AWS OpsWorks. -// -// Deregisters an Amazon RDS instance. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeregisterRdsDbInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterRdsDbInstance -func (c *OpsWorks) DeregisterRdsDbInstance(input *DeregisterRdsDbInstanceInput) (*DeregisterRdsDbInstanceOutput, error) { - req, out := c.DeregisterRdsDbInstanceRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterVolume = "DeregisterVolume" - -// DeregisterVolumeRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterVolumeRequest method. -// req, resp := client.DeregisterVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterVolume -func (c *OpsWorks) DeregisterVolumeRequest(input *DeregisterVolumeInput) (req *request.Request, output *DeregisterVolumeOutput) { - op := &request.Operation{ - Name: opDeregisterVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterVolumeInput{} - } - - output = &DeregisterVolumeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterVolume API operation for AWS OpsWorks. -// -// Deregisters an Amazon EBS volume. The volume can then be registered by another -// stack. For more information, see Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DeregisterVolume for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterVolume -func (c *OpsWorks) DeregisterVolume(input *DeregisterVolumeInput) (*DeregisterVolumeOutput, error) { - req, out := c.DeregisterVolumeRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAgentVersions = "DescribeAgentVersions" - -// DescribeAgentVersionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAgentVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAgentVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAgentVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAgentVersionsRequest method. -// req, resp := client.DescribeAgentVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAgentVersions -func (c *OpsWorks) DescribeAgentVersionsRequest(input *DescribeAgentVersionsInput) (req *request.Request, output *DescribeAgentVersionsOutput) { - op := &request.Operation{ - Name: opDescribeAgentVersions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAgentVersionsInput{} - } - - output = &DescribeAgentVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAgentVersions API operation for AWS OpsWorks. -// -// Describes the available AWS OpsWorks agent versions. You must specify a stack -// ID or a configuration manager. DescribeAgentVersions returns a list of available -// agent versions for the specified stack or configuration manager. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 OpsWorks's -// API operation DescribeAgentVersions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAgentVersions -func (c *OpsWorks) DescribeAgentVersions(input *DescribeAgentVersionsInput) (*DescribeAgentVersionsOutput, error) { - req, out := c.DescribeAgentVersionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeApps = "DescribeApps" - -// DescribeAppsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeApps operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeApps for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeApps method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAppsRequest method. -// req, resp := client.DescribeAppsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeApps -func (c *OpsWorks) DescribeAppsRequest(input *DescribeAppsInput) (req *request.Request, output *DescribeAppsOutput) { - op := &request.Operation{ - Name: opDescribeApps, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAppsInput{} - } - - output = &DescribeAppsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeApps API operation for AWS OpsWorks. -// -// Requests a description of a specified set of apps. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeApps for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeApps -func (c *OpsWorks) DescribeApps(input *DescribeAppsInput) (*DescribeAppsOutput, error) { - req, out := c.DescribeAppsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeCommands = "DescribeCommands" - -// DescribeCommandsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCommands operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCommands for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCommands method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCommandsRequest method. -// req, resp := client.DescribeCommandsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeCommands -func (c *OpsWorks) DescribeCommandsRequest(input *DescribeCommandsInput) (req *request.Request, output *DescribeCommandsOutput) { - op := &request.Operation{ - Name: opDescribeCommands, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeCommandsInput{} - } - - output = &DescribeCommandsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCommands API operation for AWS OpsWorks. -// -// Describes the results of specified commands. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeCommands for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeCommands -func (c *OpsWorks) DescribeCommands(input *DescribeCommandsInput) (*DescribeCommandsOutput, error) { - req, out := c.DescribeCommandsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDeployments = "DescribeDeployments" - -// DescribeDeploymentsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDeployments operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDeployments for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDeployments method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDeploymentsRequest method. -// req, resp := client.DescribeDeploymentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeDeployments -func (c *OpsWorks) DescribeDeploymentsRequest(input *DescribeDeploymentsInput) (req *request.Request, output *DescribeDeploymentsOutput) { - op := &request.Operation{ - Name: opDescribeDeployments, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDeploymentsInput{} - } - - output = &DescribeDeploymentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDeployments API operation for AWS OpsWorks. -// -// Requests a description of a specified set of deployments. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeDeployments for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeDeployments -func (c *OpsWorks) DescribeDeployments(input *DescribeDeploymentsInput) (*DescribeDeploymentsOutput, error) { - req, out := c.DescribeDeploymentsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEcsClusters = "DescribeEcsClusters" - -// DescribeEcsClustersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEcsClusters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEcsClusters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEcsClusters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEcsClustersRequest method. -// req, resp := client.DescribeEcsClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeEcsClusters -func (c *OpsWorks) DescribeEcsClustersRequest(input *DescribeEcsClustersInput) (req *request.Request, output *DescribeEcsClustersOutput) { - op := &request.Operation{ - Name: opDescribeEcsClusters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEcsClustersInput{} - } - - output = &DescribeEcsClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEcsClusters API operation for AWS OpsWorks. -// -// Describes Amazon ECS clusters that are registered with a stack. If you specify -// only a stack ID, you can use the MaxResults and NextToken parameters to paginate -// the response. However, AWS OpsWorks currently supports only one cluster per -// layer, so the result set has a maximum of one element. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack or an attached policy that explicitly -// grants permission. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeEcsClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeEcsClusters -func (c *OpsWorks) DescribeEcsClusters(input *DescribeEcsClustersInput) (*DescribeEcsClustersOutput, error) { - req, out := c.DescribeEcsClustersRequest(input) - err := req.Send() - return out, err -} - -// DescribeEcsClustersPages iterates over the pages of a DescribeEcsClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEcsClusters 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 DescribeEcsClusters operation. -// pageNum := 0 -// err := client.DescribeEcsClustersPages(params, -// func(page *DescribeEcsClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *OpsWorks) DescribeEcsClustersPages(input *DescribeEcsClustersInput, fn func(p *DescribeEcsClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEcsClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEcsClustersOutput), lastPage) - }) -} - -const opDescribeElasticIps = "DescribeElasticIps" - -// DescribeElasticIpsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeElasticIps operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeElasticIps for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeElasticIps method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeElasticIpsRequest method. -// req, resp := client.DescribeElasticIpsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticIps -func (c *OpsWorks) DescribeElasticIpsRequest(input *DescribeElasticIpsInput) (req *request.Request, output *DescribeElasticIpsOutput) { - op := &request.Operation{ - Name: opDescribeElasticIps, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeElasticIpsInput{} - } - - output = &DescribeElasticIpsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeElasticIps API operation for AWS OpsWorks. -// -// Describes Elastic IP addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html). -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeElasticIps for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticIps -func (c *OpsWorks) DescribeElasticIps(input *DescribeElasticIpsInput) (*DescribeElasticIpsOutput, error) { - req, out := c.DescribeElasticIpsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeElasticLoadBalancers = "DescribeElasticLoadBalancers" - -// DescribeElasticLoadBalancersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeElasticLoadBalancers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeElasticLoadBalancers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeElasticLoadBalancers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeElasticLoadBalancersRequest method. -// req, resp := client.DescribeElasticLoadBalancersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticLoadBalancers -func (c *OpsWorks) DescribeElasticLoadBalancersRequest(input *DescribeElasticLoadBalancersInput) (req *request.Request, output *DescribeElasticLoadBalancersOutput) { - op := &request.Operation{ - Name: opDescribeElasticLoadBalancers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeElasticLoadBalancersInput{} - } - - output = &DescribeElasticLoadBalancersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeElasticLoadBalancers API operation for AWS OpsWorks. -// -// Describes a stack's Elastic Load Balancing instances. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeElasticLoadBalancers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticLoadBalancers -func (c *OpsWorks) DescribeElasticLoadBalancers(input *DescribeElasticLoadBalancersInput) (*DescribeElasticLoadBalancersOutput, error) { - req, out := c.DescribeElasticLoadBalancersRequest(input) - err := req.Send() - return out, 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/opsworks-2013-02-18/DescribeInstances -func (c *OpsWorks) DescribeInstancesRequest(input *DescribeInstancesInput) (req *request.Request, output *DescribeInstancesOutput) { - op := &request.Operation{ - Name: opDescribeInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstancesInput{} - } - - output = &DescribeInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstances API operation for AWS OpsWorks. -// -// Requests a description of a set of instances. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeInstances -func (c *OpsWorks) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstancesOutput, error) { - req, out := c.DescribeInstancesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLayers = "DescribeLayers" - -// DescribeLayersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLayers operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLayers for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLayers method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLayersRequest method. -// req, resp := client.DescribeLayersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLayers -func (c *OpsWorks) DescribeLayersRequest(input *DescribeLayersInput) (req *request.Request, output *DescribeLayersOutput) { - op := &request.Operation{ - Name: opDescribeLayers, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLayersInput{} - } - - output = &DescribeLayersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLayers API operation for AWS OpsWorks. -// -// Requests a description of one or more layers in a specified stack. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeLayers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLayers -func (c *OpsWorks) DescribeLayers(input *DescribeLayersInput) (*DescribeLayersOutput, error) { - req, out := c.DescribeLayersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeLoadBasedAutoScaling = "DescribeLoadBasedAutoScaling" - -// DescribeLoadBasedAutoScalingRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoadBasedAutoScaling operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoadBasedAutoScaling for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoadBasedAutoScaling method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoadBasedAutoScalingRequest method. -// req, resp := client.DescribeLoadBasedAutoScalingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLoadBasedAutoScaling -func (c *OpsWorks) DescribeLoadBasedAutoScalingRequest(input *DescribeLoadBasedAutoScalingInput) (req *request.Request, output *DescribeLoadBasedAutoScalingOutput) { - op := &request.Operation{ - Name: opDescribeLoadBasedAutoScaling, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLoadBasedAutoScalingInput{} - } - - output = &DescribeLoadBasedAutoScalingOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoadBasedAutoScaling API operation for AWS OpsWorks. -// -// Describes load-based auto scaling configurations for specified layers. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeLoadBasedAutoScaling for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLoadBasedAutoScaling -func (c *OpsWorks) DescribeLoadBasedAutoScaling(input *DescribeLoadBasedAutoScalingInput) (*DescribeLoadBasedAutoScalingOutput, error) { - req, out := c.DescribeLoadBasedAutoScalingRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMyUserProfile = "DescribeMyUserProfile" - -// DescribeMyUserProfileRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMyUserProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMyUserProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMyUserProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMyUserProfileRequest method. -// req, resp := client.DescribeMyUserProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeMyUserProfile -func (c *OpsWorks) DescribeMyUserProfileRequest(input *DescribeMyUserProfileInput) (req *request.Request, output *DescribeMyUserProfileOutput) { - op := &request.Operation{ - Name: opDescribeMyUserProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMyUserProfileInput{} - } - - output = &DescribeMyUserProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMyUserProfile API operation for AWS OpsWorks. -// -// Describes a user's SSH information. -// -// Required Permissions: To use this action, an IAM user must have self-management -// enabled or an attached policy that explicitly grants permissions. For more -// information on user permissions, see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeMyUserProfile for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeMyUserProfile -func (c *OpsWorks) DescribeMyUserProfile(input *DescribeMyUserProfileInput) (*DescribeMyUserProfileOutput, error) { - req, out := c.DescribeMyUserProfileRequest(input) - err := req.Send() - return out, err -} - -const opDescribePermissions = "DescribePermissions" - -// DescribePermissionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePermissions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePermissions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePermissions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePermissionsRequest method. -// req, resp := client.DescribePermissionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribePermissions -func (c *OpsWorks) DescribePermissionsRequest(input *DescribePermissionsInput) (req *request.Request, output *DescribePermissionsOutput) { - op := &request.Operation{ - Name: opDescribePermissions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePermissionsInput{} - } - - output = &DescribePermissionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePermissions API operation for AWS OpsWorks. -// -// Describes the permissions for a specified stack. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribePermissions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribePermissions -func (c *OpsWorks) DescribePermissions(input *DescribePermissionsInput) (*DescribePermissionsOutput, error) { - req, out := c.DescribePermissionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeRaidArrays = "DescribeRaidArrays" - -// DescribeRaidArraysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRaidArrays operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRaidArrays for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRaidArrays method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRaidArraysRequest method. -// req, resp := client.DescribeRaidArraysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRaidArrays -func (c *OpsWorks) DescribeRaidArraysRequest(input *DescribeRaidArraysInput) (req *request.Request, output *DescribeRaidArraysOutput) { - op := &request.Operation{ - Name: opDescribeRaidArrays, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRaidArraysInput{} - } - - output = &DescribeRaidArraysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRaidArrays API operation for AWS OpsWorks. -// -// Describe an instance's RAID arrays. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeRaidArrays for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRaidArrays -func (c *OpsWorks) DescribeRaidArrays(input *DescribeRaidArraysInput) (*DescribeRaidArraysOutput, error) { - req, out := c.DescribeRaidArraysRequest(input) - err := req.Send() - return out, err -} - -const opDescribeRdsDbInstances = "DescribeRdsDbInstances" - -// DescribeRdsDbInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRdsDbInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRdsDbInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRdsDbInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRdsDbInstancesRequest method. -// req, resp := client.DescribeRdsDbInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRdsDbInstances -func (c *OpsWorks) DescribeRdsDbInstancesRequest(input *DescribeRdsDbInstancesInput) (req *request.Request, output *DescribeRdsDbInstancesOutput) { - op := &request.Operation{ - Name: opDescribeRdsDbInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRdsDbInstancesInput{} - } - - output = &DescribeRdsDbInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRdsDbInstances API operation for AWS OpsWorks. -// -// Describes Amazon RDS instances. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeRdsDbInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRdsDbInstances -func (c *OpsWorks) DescribeRdsDbInstances(input *DescribeRdsDbInstancesInput) (*DescribeRdsDbInstancesOutput, error) { - req, out := c.DescribeRdsDbInstancesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeServiceErrors = "DescribeServiceErrors" - -// DescribeServiceErrorsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeServiceErrors operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeServiceErrors for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeServiceErrors method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeServiceErrorsRequest method. -// req, resp := client.DescribeServiceErrorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeServiceErrors -func (c *OpsWorks) DescribeServiceErrorsRequest(input *DescribeServiceErrorsInput) (req *request.Request, output *DescribeServiceErrorsOutput) { - op := &request.Operation{ - Name: opDescribeServiceErrors, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeServiceErrorsInput{} - } - - output = &DescribeServiceErrorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeServiceErrors API operation for AWS OpsWorks. -// -// Describes AWS OpsWorks service errors. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeServiceErrors for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeServiceErrors -func (c *OpsWorks) DescribeServiceErrors(input *DescribeServiceErrorsInput) (*DescribeServiceErrorsOutput, error) { - req, out := c.DescribeServiceErrorsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeStackProvisioningParameters = "DescribeStackProvisioningParameters" - -// DescribeStackProvisioningParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStackProvisioningParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStackProvisioningParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStackProvisioningParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStackProvisioningParametersRequest method. -// req, resp := client.DescribeStackProvisioningParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackProvisioningParameters -func (c *OpsWorks) DescribeStackProvisioningParametersRequest(input *DescribeStackProvisioningParametersInput) (req *request.Request, output *DescribeStackProvisioningParametersOutput) { - op := &request.Operation{ - Name: opDescribeStackProvisioningParameters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStackProvisioningParametersInput{} - } - - output = &DescribeStackProvisioningParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStackProvisioningParameters API operation for AWS OpsWorks. -// -// Requests a description of a stack's provisioning parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeStackProvisioningParameters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackProvisioningParameters -func (c *OpsWorks) DescribeStackProvisioningParameters(input *DescribeStackProvisioningParametersInput) (*DescribeStackProvisioningParametersOutput, error) { - req, out := c.DescribeStackProvisioningParametersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeStackSummary = "DescribeStackSummary" - -// DescribeStackSummaryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStackSummary operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStackSummary for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStackSummary method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStackSummaryRequest method. -// req, resp := client.DescribeStackSummaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackSummary -func (c *OpsWorks) DescribeStackSummaryRequest(input *DescribeStackSummaryInput) (req *request.Request, output *DescribeStackSummaryOutput) { - op := &request.Operation{ - Name: opDescribeStackSummary, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStackSummaryInput{} - } - - output = &DescribeStackSummaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStackSummary API operation for AWS OpsWorks. -// -// Describes the number of layers and apps in a specified stack, and the number -// of instances in each state, such as running_setup or online. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeStackSummary for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackSummary -func (c *OpsWorks) DescribeStackSummary(input *DescribeStackSummaryInput) (*DescribeStackSummaryOutput, error) { - req, out := c.DescribeStackSummaryRequest(input) - err := req.Send() - return out, err -} - -const opDescribeStacks = "DescribeStacks" - -// DescribeStacksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStacks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStacks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStacks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStacksRequest method. -// req, resp := client.DescribeStacksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStacks -func (c *OpsWorks) DescribeStacksRequest(input *DescribeStacksInput) (req *request.Request, output *DescribeStacksOutput) { - op := &request.Operation{ - Name: opDescribeStacks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStacksInput{} - } - - output = &DescribeStacksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStacks API operation for AWS OpsWorks. -// -// Requests a description of one or more stacks. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeStacks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStacks -func (c *OpsWorks) DescribeStacks(input *DescribeStacksInput) (*DescribeStacksOutput, error) { - req, out := c.DescribeStacksRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTimeBasedAutoScaling = "DescribeTimeBasedAutoScaling" - -// DescribeTimeBasedAutoScalingRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTimeBasedAutoScaling operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTimeBasedAutoScaling for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTimeBasedAutoScaling method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTimeBasedAutoScalingRequest method. -// req, resp := client.DescribeTimeBasedAutoScalingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeTimeBasedAutoScaling -func (c *OpsWorks) DescribeTimeBasedAutoScalingRequest(input *DescribeTimeBasedAutoScalingInput) (req *request.Request, output *DescribeTimeBasedAutoScalingOutput) { - op := &request.Operation{ - Name: opDescribeTimeBasedAutoScaling, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTimeBasedAutoScalingInput{} - } - - output = &DescribeTimeBasedAutoScalingOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTimeBasedAutoScaling API operation for AWS OpsWorks. -// -// Describes time-based auto scaling configurations for specified instances. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeTimeBasedAutoScaling for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeTimeBasedAutoScaling -func (c *OpsWorks) DescribeTimeBasedAutoScaling(input *DescribeTimeBasedAutoScalingInput) (*DescribeTimeBasedAutoScalingOutput, error) { - req, out := c.DescribeTimeBasedAutoScalingRequest(input) - err := req.Send() - return out, err -} - -const opDescribeUserProfiles = "DescribeUserProfiles" - -// DescribeUserProfilesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeUserProfiles operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeUserProfiles for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeUserProfiles method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeUserProfilesRequest method. -// req, resp := client.DescribeUserProfilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeUserProfiles -func (c *OpsWorks) DescribeUserProfilesRequest(input *DescribeUserProfilesInput) (req *request.Request, output *DescribeUserProfilesOutput) { - op := &request.Operation{ - Name: opDescribeUserProfiles, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeUserProfilesInput{} - } - - output = &DescribeUserProfilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeUserProfiles API operation for AWS OpsWorks. -// -// Describe specified users. -// -// Required Permissions: To use this action, an IAM user must have an attached -// policy that explicitly grants permissions. For more information on user permissions, -// see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeUserProfiles for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeUserProfiles -func (c *OpsWorks) DescribeUserProfiles(input *DescribeUserProfilesInput) (*DescribeUserProfilesOutput, error) { - req, out := c.DescribeUserProfilesRequest(input) - err := req.Send() - return out, 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/opsworks-2013-02-18/DescribeVolumes -func (c *OpsWorks) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.Request, output *DescribeVolumesOutput) { - op := &request.Operation{ - Name: opDescribeVolumes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVolumesInput{} - } - - output = &DescribeVolumesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumes API operation for AWS OpsWorks. -// -// Describes an instance's Amazon EBS volumes. -// -// You must specify at least one of the parameters. -// -// Required Permissions: To use this action, an IAM user must have a Show, Deploy, -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DescribeVolumes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeVolumes -func (c *OpsWorks) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutput, error) { - req, out := c.DescribeVolumesRequest(input) - err := req.Send() - return out, err -} - -const opDetachElasticLoadBalancer = "DetachElasticLoadBalancer" - -// DetachElasticLoadBalancerRequest generates a "aws/request.Request" representing the -// client's request for the DetachElasticLoadBalancer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachElasticLoadBalancer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachElasticLoadBalancer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachElasticLoadBalancerRequest method. -// req, resp := client.DetachElasticLoadBalancerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DetachElasticLoadBalancer -func (c *OpsWorks) DetachElasticLoadBalancerRequest(input *DetachElasticLoadBalancerInput) (req *request.Request, output *DetachElasticLoadBalancerOutput) { - op := &request.Operation{ - Name: opDetachElasticLoadBalancer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachElasticLoadBalancerInput{} - } - - output = &DetachElasticLoadBalancerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachElasticLoadBalancer API operation for AWS OpsWorks. -// -// Detaches a specified Elastic Load Balancing instance from its layer. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DetachElasticLoadBalancer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DetachElasticLoadBalancer -func (c *OpsWorks) DetachElasticLoadBalancer(input *DetachElasticLoadBalancerInput) (*DetachElasticLoadBalancerOutput, error) { - req, out := c.DetachElasticLoadBalancerRequest(input) - err := req.Send() - return out, err -} - -const opDisassociateElasticIp = "DisassociateElasticIp" - -// DisassociateElasticIpRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateElasticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisassociateElasticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisassociateElasticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisassociateElasticIpRequest method. -// req, resp := client.DisassociateElasticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DisassociateElasticIp -func (c *OpsWorks) DisassociateElasticIpRequest(input *DisassociateElasticIpInput) (req *request.Request, output *DisassociateElasticIpOutput) { - op := &request.Operation{ - Name: opDisassociateElasticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateElasticIpInput{} - } - - output = &DisassociateElasticIpOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateElasticIp API operation for AWS OpsWorks. -// -// Disassociates an Elastic IP address from its instance. The address remains -// registered with the stack. For more information, see Resource Management -// (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation DisassociateElasticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DisassociateElasticIp -func (c *OpsWorks) DisassociateElasticIp(input *DisassociateElasticIpInput) (*DisassociateElasticIpOutput, error) { - req, out := c.DisassociateElasticIpRequest(input) - err := req.Send() - return out, err -} - -const opGetHostnameSuggestion = "GetHostnameSuggestion" - -// GetHostnameSuggestionRequest generates a "aws/request.Request" representing the -// client's request for the GetHostnameSuggestion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetHostnameSuggestion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetHostnameSuggestion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetHostnameSuggestionRequest method. -// req, resp := client.GetHostnameSuggestionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GetHostnameSuggestion -func (c *OpsWorks) GetHostnameSuggestionRequest(input *GetHostnameSuggestionInput) (req *request.Request, output *GetHostnameSuggestionOutput) { - op := &request.Operation{ - Name: opGetHostnameSuggestion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetHostnameSuggestionInput{} - } - - output = &GetHostnameSuggestionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHostnameSuggestion API operation for AWS OpsWorks. -// -// Gets a generated host name for the specified layer, based on the current -// host name theme. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation GetHostnameSuggestion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GetHostnameSuggestion -func (c *OpsWorks) GetHostnameSuggestion(input *GetHostnameSuggestionInput) (*GetHostnameSuggestionOutput, error) { - req, out := c.GetHostnameSuggestionRequest(input) - err := req.Send() - return out, err -} - -const opGrantAccess = "GrantAccess" - -// GrantAccessRequest generates a "aws/request.Request" representing the -// client's request for the GrantAccess operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GrantAccess for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GrantAccess method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GrantAccessRequest method. -// req, resp := client.GrantAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GrantAccess -func (c *OpsWorks) GrantAccessRequest(input *GrantAccessInput) (req *request.Request, output *GrantAccessOutput) { - op := &request.Operation{ - Name: opGrantAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GrantAccessInput{} - } - - output = &GrantAccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// GrantAccess API operation for AWS OpsWorks. -// -// This action can be used only with Windows stacks. -// -// Grants RDP access to a Windows instance for a specified time period. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 OpsWorks's -// API operation GrantAccess for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GrantAccess -func (c *OpsWorks) GrantAccess(input *GrantAccessInput) (*GrantAccessOutput, error) { - req, out := c.GrantAccessRequest(input) - err := req.Send() - return out, err -} - -const opRebootInstance = "RebootInstance" - -// RebootInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RebootInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RebootInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RebootInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RebootInstanceRequest method. -// req, resp := client.RebootInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RebootInstance -func (c *OpsWorks) RebootInstanceRequest(input *RebootInstanceInput) (req *request.Request, output *RebootInstanceOutput) { - op := &request.Operation{ - Name: opRebootInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RebootInstanceInput{} - } - - output = &RebootInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RebootInstance API operation for AWS OpsWorks. -// -// Reboots a specified instance. For more information, see Starting, Stopping, -// and Rebooting Instances (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-starting.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation RebootInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RebootInstance -func (c *OpsWorks) RebootInstance(input *RebootInstanceInput) (*RebootInstanceOutput, error) { - req, out := c.RebootInstanceRequest(input) - err := req.Send() - return out, err -} - -const opRegisterEcsCluster = "RegisterEcsCluster" - -// RegisterEcsClusterRequest generates a "aws/request.Request" representing the -// client's request for the RegisterEcsCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterEcsCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterEcsCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterEcsClusterRequest method. -// req, resp := client.RegisterEcsClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterEcsCluster -func (c *OpsWorks) RegisterEcsClusterRequest(input *RegisterEcsClusterInput) (req *request.Request, output *RegisterEcsClusterOutput) { - op := &request.Operation{ - Name: opRegisterEcsCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterEcsClusterInput{} - } - - output = &RegisterEcsClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterEcsCluster API operation for AWS OpsWorks. -// -// Registers a specified Amazon ECS cluster with a stack. You can register only -// one cluster with a stack. A cluster can be registered with only one stack. -// For more information, see Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-ecscluster.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation RegisterEcsCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterEcsCluster -func (c *OpsWorks) RegisterEcsCluster(input *RegisterEcsClusterInput) (*RegisterEcsClusterOutput, error) { - req, out := c.RegisterEcsClusterRequest(input) - err := req.Send() - return out, err -} - -const opRegisterElasticIp = "RegisterElasticIp" - -// RegisterElasticIpRequest generates a "aws/request.Request" representing the -// client's request for the RegisterElasticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterElasticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterElasticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterElasticIpRequest method. -// req, resp := client.RegisterElasticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterElasticIp -func (c *OpsWorks) RegisterElasticIpRequest(input *RegisterElasticIpInput) (req *request.Request, output *RegisterElasticIpOutput) { - op := &request.Operation{ - Name: opRegisterElasticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterElasticIpInput{} - } - - output = &RegisterElasticIpOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterElasticIp API operation for AWS OpsWorks. -// -// Registers an Elastic IP address with a specified stack. An address can be -// registered with only one stack at a time. If the address is already registered, -// you must first deregister it by calling DeregisterElasticIp. For more information, -// see Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation RegisterElasticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterElasticIp -func (c *OpsWorks) RegisterElasticIp(input *RegisterElasticIpInput) (*RegisterElasticIpOutput, error) { - req, out := c.RegisterElasticIpRequest(input) - err := req.Send() - return out, err -} - -const opRegisterInstance = "RegisterInstance" - -// RegisterInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RegisterInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterInstanceRequest method. -// req, resp := client.RegisterInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterInstance -func (c *OpsWorks) RegisterInstanceRequest(input *RegisterInstanceInput) (req *request.Request, output *RegisterInstanceOutput) { - op := &request.Operation{ - Name: opRegisterInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterInstanceInput{} - } - - output = &RegisterInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterInstance API operation for AWS OpsWorks. -// -// Registers instances with a specified stack that were created outside of AWS -// OpsWorks. -// -// We do not recommend using this action to register instances. The complete -// registration operation has two primary steps, installing the AWS OpsWorks -// agent on the instance and registering the instance with the stack. RegisterInstance -// handles only the second step. You should instead use the AWS CLI register -// command, which performs the entire registration operation. For more information, -// see Registering an Instance with an AWS OpsWorks Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-register.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation RegisterInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterInstance -func (c *OpsWorks) RegisterInstance(input *RegisterInstanceInput) (*RegisterInstanceOutput, error) { - req, out := c.RegisterInstanceRequest(input) - err := req.Send() - return out, err -} - -const opRegisterRdsDbInstance = "RegisterRdsDbInstance" - -// RegisterRdsDbInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RegisterRdsDbInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterRdsDbInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterRdsDbInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterRdsDbInstanceRequest method. -// req, resp := client.RegisterRdsDbInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterRdsDbInstance -func (c *OpsWorks) RegisterRdsDbInstanceRequest(input *RegisterRdsDbInstanceInput) (req *request.Request, output *RegisterRdsDbInstanceOutput) { - op := &request.Operation{ - Name: opRegisterRdsDbInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterRdsDbInstanceInput{} - } - - output = &RegisterRdsDbInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RegisterRdsDbInstance API operation for AWS OpsWorks. -// -// Registers an Amazon RDS instance with a stack. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation RegisterRdsDbInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterRdsDbInstance -func (c *OpsWorks) RegisterRdsDbInstance(input *RegisterRdsDbInstanceInput) (*RegisterRdsDbInstanceOutput, error) { - req, out := c.RegisterRdsDbInstanceRequest(input) - err := req.Send() - return out, err -} - -const opRegisterVolume = "RegisterVolume" - -// RegisterVolumeRequest generates a "aws/request.Request" representing the -// client's request for the RegisterVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterVolumeRequest method. -// req, resp := client.RegisterVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterVolume -func (c *OpsWorks) RegisterVolumeRequest(input *RegisterVolumeInput) (req *request.Request, output *RegisterVolumeOutput) { - op := &request.Operation{ - Name: opRegisterVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterVolumeInput{} - } - - output = &RegisterVolumeOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterVolume API operation for AWS OpsWorks. -// -// Registers an Amazon EBS volume with a specified stack. A volume can be registered -// with only one stack at a time. If the volume is already registered, you must -// first deregister it by calling DeregisterVolume. For more information, see -// Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation RegisterVolume for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterVolume -func (c *OpsWorks) RegisterVolume(input *RegisterVolumeInput) (*RegisterVolumeOutput, error) { - req, out := c.RegisterVolumeRequest(input) - err := req.Send() - return out, err -} - -const opSetLoadBasedAutoScaling = "SetLoadBasedAutoScaling" - -// SetLoadBasedAutoScalingRequest generates a "aws/request.Request" representing the -// client's request for the SetLoadBasedAutoScaling operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetLoadBasedAutoScaling for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetLoadBasedAutoScaling method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetLoadBasedAutoScalingRequest method. -// req, resp := client.SetLoadBasedAutoScalingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetLoadBasedAutoScaling -func (c *OpsWorks) SetLoadBasedAutoScalingRequest(input *SetLoadBasedAutoScalingInput) (req *request.Request, output *SetLoadBasedAutoScalingOutput) { - op := &request.Operation{ - Name: opSetLoadBasedAutoScaling, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetLoadBasedAutoScalingInput{} - } - - output = &SetLoadBasedAutoScalingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetLoadBasedAutoScaling API operation for AWS OpsWorks. -// -// Specify the load-based auto scaling configuration for a specified layer. -// For more information, see Managing Load with Time-based and Load-based Instances -// (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-autoscaling.html). -// -// To use load-based auto scaling, you must create a set of load-based auto -// scaling instances. Load-based auto scaling operates only on the instances -// from that set, so you must ensure that you have created enough instances -// to handle the maximum anticipated load. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation SetLoadBasedAutoScaling for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetLoadBasedAutoScaling -func (c *OpsWorks) SetLoadBasedAutoScaling(input *SetLoadBasedAutoScalingInput) (*SetLoadBasedAutoScalingOutput, error) { - req, out := c.SetLoadBasedAutoScalingRequest(input) - err := req.Send() - return out, err -} - -const opSetPermission = "SetPermission" - -// SetPermissionRequest generates a "aws/request.Request" representing the -// client's request for the SetPermission operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetPermission for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetPermission method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetPermissionRequest method. -// req, resp := client.SetPermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetPermission -func (c *OpsWorks) SetPermissionRequest(input *SetPermissionInput) (req *request.Request, output *SetPermissionOutput) { - op := &request.Operation{ - Name: opSetPermission, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetPermissionInput{} - } - - output = &SetPermissionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetPermission API operation for AWS OpsWorks. -// -// Specifies a user's permissions. For more information, see Security and Permissions -// (http://docs.aws.amazon.com/opsworks/latest/userguide/workingsecurity.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation SetPermission for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetPermission -func (c *OpsWorks) SetPermission(input *SetPermissionInput) (*SetPermissionOutput, error) { - req, out := c.SetPermissionRequest(input) - err := req.Send() - return out, err -} - -const opSetTimeBasedAutoScaling = "SetTimeBasedAutoScaling" - -// SetTimeBasedAutoScalingRequest generates a "aws/request.Request" representing the -// client's request for the SetTimeBasedAutoScaling operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetTimeBasedAutoScaling for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetTimeBasedAutoScaling method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetTimeBasedAutoScalingRequest method. -// req, resp := client.SetTimeBasedAutoScalingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetTimeBasedAutoScaling -func (c *OpsWorks) SetTimeBasedAutoScalingRequest(input *SetTimeBasedAutoScalingInput) (req *request.Request, output *SetTimeBasedAutoScalingOutput) { - op := &request.Operation{ - Name: opSetTimeBasedAutoScaling, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetTimeBasedAutoScalingInput{} - } - - output = &SetTimeBasedAutoScalingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetTimeBasedAutoScaling API operation for AWS OpsWorks. -// -// Specify the time-based auto scaling configuration for a specified instance. -// For more information, see Managing Load with Time-based and Load-based Instances -// (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-autoscaling.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation SetTimeBasedAutoScaling for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetTimeBasedAutoScaling -func (c *OpsWorks) SetTimeBasedAutoScaling(input *SetTimeBasedAutoScalingInput) (*SetTimeBasedAutoScalingOutput, error) { - req, out := c.SetTimeBasedAutoScalingRequest(input) - err := req.Send() - return out, err -} - -const opStartInstance = "StartInstance" - -// StartInstanceRequest generates a "aws/request.Request" representing the -// client's request for the StartInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartInstanceRequest method. -// req, resp := client.StartInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartInstance -func (c *OpsWorks) StartInstanceRequest(input *StartInstanceInput) (req *request.Request, output *StartInstanceOutput) { - op := &request.Operation{ - Name: opStartInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartInstanceInput{} - } - - output = &StartInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartInstance API operation for AWS OpsWorks. -// -// Starts a specified instance. For more information, see Starting, Stopping, -// and Rebooting Instances (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-starting.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation StartInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartInstance -func (c *OpsWorks) StartInstance(input *StartInstanceInput) (*StartInstanceOutput, error) { - req, out := c.StartInstanceRequest(input) - err := req.Send() - return out, err -} - -const opStartStack = "StartStack" - -// StartStackRequest generates a "aws/request.Request" representing the -// client's request for the StartStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartStackRequest method. -// req, resp := client.StartStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartStack -func (c *OpsWorks) StartStackRequest(input *StartStackInput) (req *request.Request, output *StartStackOutput) { - op := &request.Operation{ - Name: opStartStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartStackInput{} - } - - output = &StartStackOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartStack API operation for AWS OpsWorks. -// -// Starts a stack's instances. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation StartStack for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartStack -func (c *OpsWorks) StartStack(input *StartStackInput) (*StartStackOutput, error) { - req, out := c.StartStackRequest(input) - err := req.Send() - return out, err -} - -const opStopInstance = "StopInstance" - -// StopInstanceRequest generates a "aws/request.Request" representing the -// client's request for the StopInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopInstanceRequest method. -// req, resp := client.StopInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopInstance -func (c *OpsWorks) StopInstanceRequest(input *StopInstanceInput) (req *request.Request, output *StopInstanceOutput) { - op := &request.Operation{ - Name: opStopInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopInstanceInput{} - } - - output = &StopInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopInstance API operation for AWS OpsWorks. -// -// Stops a specified instance. When you stop a standard instance, the data disappears -// and must be reinstalled when you restart the instance. You can stop an Amazon -// EBS-backed instance without losing data. For more information, see Starting, -// Stopping, and Rebooting Instances (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-starting.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation StopInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopInstance -func (c *OpsWorks) StopInstance(input *StopInstanceInput) (*StopInstanceOutput, error) { - req, out := c.StopInstanceRequest(input) - err := req.Send() - return out, err -} - -const opStopStack = "StopStack" - -// StopStackRequest generates a "aws/request.Request" representing the -// client's request for the StopStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopStackRequest method. -// req, resp := client.StopStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopStack -func (c *OpsWorks) StopStackRequest(input *StopStackInput) (req *request.Request, output *StopStackOutput) { - op := &request.Operation{ - Name: opStopStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopStackInput{} - } - - output = &StopStackOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopStack API operation for AWS OpsWorks. -// -// Stops a specified stack. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation StopStack for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopStack -func (c *OpsWorks) StopStack(input *StopStackInput) (*StopStackOutput, error) { - req, out := c.StopStackRequest(input) - err := req.Send() - return out, err -} - -const opUnassignInstance = "UnassignInstance" - -// UnassignInstanceRequest generates a "aws/request.Request" representing the -// client's request for the UnassignInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UnassignInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UnassignInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UnassignInstanceRequest method. -// req, resp := client.UnassignInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignInstance -func (c *OpsWorks) UnassignInstanceRequest(input *UnassignInstanceInput) (req *request.Request, output *UnassignInstanceOutput) { - op := &request.Operation{ - Name: opUnassignInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnassignInstanceInput{} - } - - output = &UnassignInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UnassignInstance API operation for AWS OpsWorks. -// -// Unassigns a registered instance from all of it's layers. The instance remains -// in the stack as an unassigned instance and can be assigned to another layer, -// as needed. You cannot use this action with instances that were created with -// AWS OpsWorks. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UnassignInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignInstance -func (c *OpsWorks) UnassignInstance(input *UnassignInstanceInput) (*UnassignInstanceOutput, error) { - req, out := c.UnassignInstanceRequest(input) - err := req.Send() - return out, err -} - -const opUnassignVolume = "UnassignVolume" - -// UnassignVolumeRequest generates a "aws/request.Request" representing the -// client's request for the UnassignVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UnassignVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UnassignVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UnassignVolumeRequest method. -// req, resp := client.UnassignVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignVolume -func (c *OpsWorks) UnassignVolumeRequest(input *UnassignVolumeInput) (req *request.Request, output *UnassignVolumeOutput) { - op := &request.Operation{ - Name: opUnassignVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnassignVolumeInput{} - } - - output = &UnassignVolumeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UnassignVolume API operation for AWS OpsWorks. -// -// Unassigns an assigned Amazon EBS volume. The volume remains registered with -// the stack. For more information, see Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UnassignVolume for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignVolume -func (c *OpsWorks) UnassignVolume(input *UnassignVolumeInput) (*UnassignVolumeOutput, error) { - req, out := c.UnassignVolumeRequest(input) - err := req.Send() - return out, err -} - -const opUpdateApp = "UpdateApp" - -// UpdateAppRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateApp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateApp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAppRequest method. -// req, resp := client.UpdateAppRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateApp -func (c *OpsWorks) UpdateAppRequest(input *UpdateAppInput) (req *request.Request, output *UpdateAppOutput) { - op := &request.Operation{ - Name: opUpdateApp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAppInput{} - } - - output = &UpdateAppOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateApp API operation for AWS OpsWorks. -// -// Updates a specified app. -// -// Required Permissions: To use this action, an IAM user must have a Deploy -// or Manage permissions level for the stack, or an attached policy that explicitly -// grants permissions. For more information on user permissions, see Managing -// User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateApp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateApp -func (c *OpsWorks) UpdateApp(input *UpdateAppInput) (*UpdateAppOutput, error) { - req, out := c.UpdateAppRequest(input) - err := req.Send() - return out, err -} - -const opUpdateElasticIp = "UpdateElasticIp" - -// UpdateElasticIpRequest generates a "aws/request.Request" representing the -// client's request for the UpdateElasticIp operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateElasticIp for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateElasticIp method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateElasticIpRequest method. -// req, resp := client.UpdateElasticIpRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateElasticIp -func (c *OpsWorks) UpdateElasticIpRequest(input *UpdateElasticIpInput) (req *request.Request, output *UpdateElasticIpOutput) { - op := &request.Operation{ - Name: opUpdateElasticIp, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateElasticIpInput{} - } - - output = &UpdateElasticIpOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateElasticIp API operation for AWS OpsWorks. -// -// Updates a registered Elastic IP address's name. For more information, see -// Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateElasticIp for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateElasticIp -func (c *OpsWorks) UpdateElasticIp(input *UpdateElasticIpInput) (*UpdateElasticIpOutput, error) { - req, out := c.UpdateElasticIpRequest(input) - err := req.Send() - return out, err -} - -const opUpdateInstance = "UpdateInstance" - -// UpdateInstanceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateInstanceRequest method. -// req, resp := client.UpdateInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateInstance -func (c *OpsWorks) UpdateInstanceRequest(input *UpdateInstanceInput) (req *request.Request, output *UpdateInstanceOutput) { - op := &request.Operation{ - Name: opUpdateInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateInstanceInput{} - } - - output = &UpdateInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateInstance API operation for AWS OpsWorks. -// -// Updates a specified instance. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateInstance -func (c *OpsWorks) UpdateInstance(input *UpdateInstanceInput) (*UpdateInstanceOutput, error) { - req, out := c.UpdateInstanceRequest(input) - err := req.Send() - return out, err -} - -const opUpdateLayer = "UpdateLayer" - -// UpdateLayerRequest generates a "aws/request.Request" representing the -// client's request for the UpdateLayer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateLayer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateLayer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateLayerRequest method. -// req, resp := client.UpdateLayerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateLayer -func (c *OpsWorks) UpdateLayerRequest(input *UpdateLayerInput) (req *request.Request, output *UpdateLayerOutput) { - op := &request.Operation{ - Name: opUpdateLayer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateLayerInput{} - } - - output = &UpdateLayerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateLayer API operation for AWS OpsWorks. -// -// Updates a specified layer. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateLayer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateLayer -func (c *OpsWorks) UpdateLayer(input *UpdateLayerInput) (*UpdateLayerOutput, error) { - req, out := c.UpdateLayerRequest(input) - err := req.Send() - return out, err -} - -const opUpdateMyUserProfile = "UpdateMyUserProfile" - -// UpdateMyUserProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateMyUserProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateMyUserProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateMyUserProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateMyUserProfileRequest method. -// req, resp := client.UpdateMyUserProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateMyUserProfile -func (c *OpsWorks) UpdateMyUserProfileRequest(input *UpdateMyUserProfileInput) (req *request.Request, output *UpdateMyUserProfileOutput) { - op := &request.Operation{ - Name: opUpdateMyUserProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateMyUserProfileInput{} - } - - output = &UpdateMyUserProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateMyUserProfile API operation for AWS OpsWorks. -// -// Updates a user's SSH public key. -// -// Required Permissions: To use this action, an IAM user must have self-management -// enabled or an attached policy that explicitly grants permissions. For more -// information on user permissions, see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateMyUserProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateMyUserProfile -func (c *OpsWorks) UpdateMyUserProfile(input *UpdateMyUserProfileInput) (*UpdateMyUserProfileOutput, error) { - req, out := c.UpdateMyUserProfileRequest(input) - err := req.Send() - return out, err -} - -const opUpdateRdsDbInstance = "UpdateRdsDbInstance" - -// UpdateRdsDbInstanceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRdsDbInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateRdsDbInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateRdsDbInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateRdsDbInstanceRequest method. -// req, resp := client.UpdateRdsDbInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateRdsDbInstance -func (c *OpsWorks) UpdateRdsDbInstanceRequest(input *UpdateRdsDbInstanceInput) (req *request.Request, output *UpdateRdsDbInstanceOutput) { - op := &request.Operation{ - Name: opUpdateRdsDbInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateRdsDbInstanceInput{} - } - - output = &UpdateRdsDbInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateRdsDbInstance API operation for AWS OpsWorks. -// -// Updates an Amazon RDS instance. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateRdsDbInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateRdsDbInstance -func (c *OpsWorks) UpdateRdsDbInstance(input *UpdateRdsDbInstanceInput) (*UpdateRdsDbInstanceOutput, error) { - req, out := c.UpdateRdsDbInstanceRequest(input) - err := req.Send() - return out, err -} - -const opUpdateStack = "UpdateStack" - -// UpdateStackRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStack operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateStack for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateStack method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateStackRequest method. -// req, resp := client.UpdateStackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateStack -func (c *OpsWorks) UpdateStackRequest(input *UpdateStackInput) (req *request.Request, output *UpdateStackOutput) { - op := &request.Operation{ - Name: opUpdateStack, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateStackInput{} - } - - output = &UpdateStackOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateStack API operation for AWS OpsWorks. -// -// Updates a specified stack. -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateStack for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateStack -func (c *OpsWorks) UpdateStack(input *UpdateStackInput) (*UpdateStackOutput, error) { - req, out := c.UpdateStackRequest(input) - err := req.Send() - return out, err -} - -const opUpdateUserProfile = "UpdateUserProfile" - -// UpdateUserProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUserProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateUserProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateUserProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateUserProfileRequest method. -// req, resp := client.UpdateUserProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateUserProfile -func (c *OpsWorks) UpdateUserProfileRequest(input *UpdateUserProfileInput) (req *request.Request, output *UpdateUserProfileOutput) { - op := &request.Operation{ - Name: opUpdateUserProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateUserProfileInput{} - } - - output = &UpdateUserProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateUserProfile API operation for AWS OpsWorks. -// -// Updates a specified user profile. -// -// Required Permissions: To use this action, an IAM user must have an attached -// policy that explicitly grants permissions. For more information on user permissions, -// see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateUserProfile for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateUserProfile -func (c *OpsWorks) UpdateUserProfile(input *UpdateUserProfileInput) (*UpdateUserProfileOutput, error) { - req, out := c.UpdateUserProfileRequest(input) - err := req.Send() - return out, err -} - -const opUpdateVolume = "UpdateVolume" - -// UpdateVolumeRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateVolumeRequest method. -// req, resp := client.UpdateVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateVolume -func (c *OpsWorks) UpdateVolumeRequest(input *UpdateVolumeInput) (req *request.Request, output *UpdateVolumeOutput) { - op := &request.Operation{ - Name: opUpdateVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateVolumeInput{} - } - - output = &UpdateVolumeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateVolume API operation for AWS OpsWorks. -// -// Updates an Amazon EBS volume's name or mount point. For more information, -// see Resource Management (http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html). -// -// Required Permissions: To use this action, an IAM user must have a Manage -// permissions level for the stack, or an attached policy that explicitly grants -// permissions. For more information on user permissions, see Managing User -// Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.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 AWS OpsWorks's -// API operation UpdateVolume for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// Indicates that a request was not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Indicates that a resource was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateVolume -func (c *OpsWorks) UpdateVolume(input *UpdateVolumeInput) (*UpdateVolumeOutput, error) { - req, out := c.UpdateVolumeRequest(input) - err := req.Send() - return out, err -} - -// Describes an agent version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AgentVersion -type AgentVersion struct { - _ struct{} `type:"structure"` - - // The configuration manager. - ConfigurationManager *StackConfigurationManager `type:"structure"` - - // The agent version. - Version *string `type:"string"` -} - -// String returns the string representation -func (s AgentVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AgentVersion) GoString() string { - return s.String() -} - -// SetConfigurationManager sets the ConfigurationManager field's value. -func (s *AgentVersion) SetConfigurationManager(v *StackConfigurationManager) *AgentVersion { - s.ConfigurationManager = v - return s -} - -// SetVersion sets the Version field's value. -func (s *AgentVersion) SetVersion(v string) *AgentVersion { - s.Version = &v - return s -} - -// A description of the app. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/App -type App struct { - _ struct{} `type:"structure"` - - // The app ID. - AppId *string `type:"string"` - - // A Source object that describes the app repository. - AppSource *Source `type:"structure"` - - // The stack attributes. - Attributes map[string]*string `type:"map"` - - // When the app was created. - CreatedAt *string `type:"string"` - - // The app's data sources. - DataSources []*DataSource `type:"list"` - - // A description of the app. - Description *string `type:"string"` - - // The app vhost settings with multiple domains separated by commas. For example: - // 'www.example.com, example.com' - Domains []*string `type:"list"` - - // Whether to enable SSL for the app. - EnableSsl *bool `type:"boolean"` - - // An array of EnvironmentVariable objects that specify environment variables - // to be associated with the app. After you deploy the app, these variables - // are defined on the associated app server instances. For more information, - // see Environment Variables (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment). - // - // There is no specific limit on the number of environment variables. However, - // the size of the associated data structure - which includes the variable names, - // values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This - // limit should accommodate most if not all use cases, but if you do exceed - // it, you will cause an exception (API) with an "Environment: is too large - // (maximum is 10KB)" message. - Environment []*EnvironmentVariable `type:"list"` - - // The app name. - Name *string `type:"string"` - - // The app's short name. - Shortname *string `type:"string"` - - // An SslConfiguration object with the SSL configuration. - SslConfiguration *SslConfiguration `type:"structure"` - - // The app stack ID. - StackId *string `type:"string"` - - // The app type. - Type *string `type:"string" enum:"AppType"` -} - -// String returns the string representation -func (s App) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s App) GoString() string { - return s.String() -} - -// SetAppId sets the AppId field's value. -func (s *App) SetAppId(v string) *App { - s.AppId = &v - return s -} - -// SetAppSource sets the AppSource field's value. -func (s *App) SetAppSource(v *Source) *App { - s.AppSource = v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *App) SetAttributes(v map[string]*string) *App { - s.Attributes = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *App) SetCreatedAt(v string) *App { - s.CreatedAt = &v - return s -} - -// SetDataSources sets the DataSources field's value. -func (s *App) SetDataSources(v []*DataSource) *App { - s.DataSources = v - return s -} - -// SetDescription sets the Description field's value. -func (s *App) SetDescription(v string) *App { - s.Description = &v - return s -} - -// SetDomains sets the Domains field's value. -func (s *App) SetDomains(v []*string) *App { - s.Domains = v - return s -} - -// SetEnableSsl sets the EnableSsl field's value. -func (s *App) SetEnableSsl(v bool) *App { - s.EnableSsl = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *App) SetEnvironment(v []*EnvironmentVariable) *App { - s.Environment = v - return s -} - -// SetName sets the Name field's value. -func (s *App) SetName(v string) *App { - s.Name = &v - return s -} - -// SetShortname sets the Shortname field's value. -func (s *App) SetShortname(v string) *App { - s.Shortname = &v - return s -} - -// SetSslConfiguration sets the SslConfiguration field's value. -func (s *App) SetSslConfiguration(v *SslConfiguration) *App { - s.SslConfiguration = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *App) SetStackId(v string) *App { - s.StackId = &v - return s -} - -// SetType sets the Type field's value. -func (s *App) SetType(v string) *App { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignInstanceRequest -type AssignInstanceInput struct { - _ struct{} `type:"structure"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The layer ID, which must correspond to a custom layer. You cannot assign - // a registered instance to a built-in layer. - // - // LayerIds is a required field - LayerIds []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s AssignInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssignInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssignInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.LayerIds == nil { - invalidParams.Add(request.NewErrParamRequired("LayerIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssignInstanceInput) SetInstanceId(v string) *AssignInstanceInput { - s.InstanceId = &v - return s -} - -// SetLayerIds sets the LayerIds field's value. -func (s *AssignInstanceInput) SetLayerIds(v []*string) *AssignInstanceInput { - s.LayerIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignInstanceOutput -type AssignInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AssignInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignVolumeRequest -type AssignVolumeInput struct { - _ struct{} `type:"structure"` - - // The instance ID. - InstanceId *string `type:"string"` - - // The volume ID. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AssignVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssignVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssignVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssignVolumeInput) SetInstanceId(v string) *AssignVolumeInput { - s.InstanceId = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *AssignVolumeInput) SetVolumeId(v string) *AssignVolumeInput { - s.VolumeId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignVolumeOutput -type AssignVolumeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AssignVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignVolumeOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssociateElasticIpRequest -type AssociateElasticIpInput struct { - _ struct{} `type:"structure"` - - // The Elastic IP address. - // - // ElasticIp is a required field - ElasticIp *string `type:"string" required:"true"` - - // The instance ID. - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s AssociateElasticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateElasticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateElasticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateElasticIpInput"} - if s.ElasticIp == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticIp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *AssociateElasticIpInput) SetElasticIp(v string) *AssociateElasticIpInput { - s.ElasticIp = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssociateElasticIpInput) SetInstanceId(v string) *AssociateElasticIpInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssociateElasticIpOutput -type AssociateElasticIpOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AssociateElasticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateElasticIpOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AttachElasticLoadBalancerRequest -type AttachElasticLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The Elastic Load Balancing instance's name. - // - // ElasticLoadBalancerName is a required field - ElasticLoadBalancerName *string `type:"string" required:"true"` - - // The ID of the layer that the Elastic Load Balancing instance is to be attached - // to. - // - // LayerId is a required field - LayerId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachElasticLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachElasticLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachElasticLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachElasticLoadBalancerInput"} - if s.ElasticLoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticLoadBalancerName")) - } - if s.LayerId == nil { - invalidParams.Add(request.NewErrParamRequired("LayerId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetElasticLoadBalancerName sets the ElasticLoadBalancerName field's value. -func (s *AttachElasticLoadBalancerInput) SetElasticLoadBalancerName(v string) *AttachElasticLoadBalancerInput { - s.ElasticLoadBalancerName = &v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *AttachElasticLoadBalancerInput) SetLayerId(v string) *AttachElasticLoadBalancerInput { - s.LayerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AttachElasticLoadBalancerOutput -type AttachElasticLoadBalancerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachElasticLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachElasticLoadBalancerOutput) GoString() string { - return s.String() -} - -// Describes a load-based auto scaling upscaling or downscaling threshold configuration, -// which specifies when AWS OpsWorks starts or stops load-based instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AutoScalingThresholds -type AutoScalingThresholds struct { - _ struct{} `type:"structure"` - - // Custom Cloudwatch auto scaling alarms, to be used as thresholds. This parameter - // takes a list of up to five alarm names, which are case sensitive and must - // be in the same region as the stack. - // - // To use custom alarms, you must update your service role to allow cloudwatch:DescribeAlarms. - // You can either have AWS OpsWorks update the role for you when you first use - // this feature or you can edit the role manually. For more information, see - // Allowing AWS OpsWorks to Act on Your Behalf (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-servicerole.html). - Alarms []*string `type:"list"` - - // The CPU utilization threshold, as a percent of the available CPU. A value - // of -1 disables the threshold. - CpuThreshold *float64 `type:"double"` - - // The amount of time (in minutes) after a scaling event occurs that AWS OpsWorks - // should ignore metrics and suppress additional scaling events. For example, - // AWS OpsWorks adds new instances following an upscaling event but the instances - // won't start reducing the load until they have been booted and configured. - // There is no point in raising additional scaling events during that operation, - // which typically takes several minutes. IgnoreMetricsTime allows you to direct - // AWS OpsWorks to suppress scaling events long enough to get the new instances - // online. - IgnoreMetricsTime *int64 `min:"1" type:"integer"` - - // The number of instances to add or remove when the load exceeds a threshold. - InstanceCount *int64 `type:"integer"` - - // The load threshold. A value of -1 disables the threshold. For more information - // about how load is computed, see Load (computing) (http://en.wikipedia.org/wiki/Load_%28computing%29). - LoadThreshold *float64 `type:"double"` - - // The memory utilization threshold, as a percent of the available memory. A - // value of -1 disables the threshold. - MemoryThreshold *float64 `type:"double"` - - // The amount of time, in minutes, that the load must exceed a threshold before - // more instances are added or removed. - ThresholdsWaitTime *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s AutoScalingThresholds) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutoScalingThresholds) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AutoScalingThresholds) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AutoScalingThresholds"} - if s.IgnoreMetricsTime != nil && *s.IgnoreMetricsTime < 1 { - invalidParams.Add(request.NewErrParamMinValue("IgnoreMetricsTime", 1)) - } - if s.ThresholdsWaitTime != nil && *s.ThresholdsWaitTime < 1 { - invalidParams.Add(request.NewErrParamMinValue("ThresholdsWaitTime", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarms sets the Alarms field's value. -func (s *AutoScalingThresholds) SetAlarms(v []*string) *AutoScalingThresholds { - s.Alarms = v - return s -} - -// SetCpuThreshold sets the CpuThreshold field's value. -func (s *AutoScalingThresholds) SetCpuThreshold(v float64) *AutoScalingThresholds { - s.CpuThreshold = &v - return s -} - -// SetIgnoreMetricsTime sets the IgnoreMetricsTime field's value. -func (s *AutoScalingThresholds) SetIgnoreMetricsTime(v int64) *AutoScalingThresholds { - s.IgnoreMetricsTime = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *AutoScalingThresholds) SetInstanceCount(v int64) *AutoScalingThresholds { - s.InstanceCount = &v - return s -} - -// SetLoadThreshold sets the LoadThreshold field's value. -func (s *AutoScalingThresholds) SetLoadThreshold(v float64) *AutoScalingThresholds { - s.LoadThreshold = &v - return s -} - -// SetMemoryThreshold sets the MemoryThreshold field's value. -func (s *AutoScalingThresholds) SetMemoryThreshold(v float64) *AutoScalingThresholds { - s.MemoryThreshold = &v - return s -} - -// SetThresholdsWaitTime sets the ThresholdsWaitTime field's value. -func (s *AutoScalingThresholds) SetThresholdsWaitTime(v int64) *AutoScalingThresholds { - s.ThresholdsWaitTime = &v - return s -} - -// Describes a block device mapping. This data type maps directly to the Amazon -// EC2 BlockDeviceMapping (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html) -// data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/BlockDeviceMapping -type BlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name that is exposed to the instance, such as /dev/sdh. For the - // root device, you can use the explicit device name or you can set this parameter - // to ROOT_DEVICE and AWS OpsWorks will provide the correct device name. - DeviceName *string `type:"string"` - - // An EBSBlockDevice that defines how to configure an Amazon EBS volume when - // the instance is launched. - Ebs *EbsBlockDevice `type:"structure"` - - // Suppresses the specified device included in the AMI's block device mapping. - NoDevice *string `type:"string"` - - // The virtual device name. For more information, see BlockDeviceMapping (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html). - VirtualName *string `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 -} - -// Describes the Chef configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ChefConfiguration -type ChefConfiguration struct { - _ struct{} `type:"structure"` - - // The Berkshelf version. - BerkshelfVersion *string `type:"string"` - - // Whether to enable Berkshelf. - ManageBerkshelf *bool `type:"boolean"` -} - -// String returns the string representation -func (s ChefConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChefConfiguration) GoString() string { - return s.String() -} - -// SetBerkshelfVersion sets the BerkshelfVersion field's value. -func (s *ChefConfiguration) SetBerkshelfVersion(v string) *ChefConfiguration { - s.BerkshelfVersion = &v - return s -} - -// SetManageBerkshelf sets the ManageBerkshelf field's value. -func (s *ChefConfiguration) SetManageBerkshelf(v bool) *ChefConfiguration { - s.ManageBerkshelf = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CloneStackRequest -type CloneStackInput struct { - _ struct{} `type:"structure"` - - // The default AWS OpsWorks agent version. You have the following options: - // - // * Auto-update - Set this parameter to LATEST. AWS OpsWorks automatically - // installs new agent versions on the stack's instances as soon as they are - // available. - // - // * Fixed version - Set this parameter to your preferred agent version. - // To update the agent version, you must edit the stack configuration and - // specify a new version. AWS OpsWorks then automatically installs that version - // on the stack's instances. - // - // The default setting is LATEST. To specify an agent version, you must use - // the complete version number, not the abbreviated number shown on the console. - // For a list of available agent version numbers, call DescribeAgentVersions. - // - // You can also specify an agent version when you create or update an instance, - // which overrides the stack's default setting. - AgentVersion *string `type:"string"` - - // A list of stack attributes and values as key/value pairs to be added to the - // cloned stack. - Attributes map[string]*string `type:"map"` - - // A ChefConfiguration object that specifies whether to enable Berkshelf and - // the Berkshelf version on Chef 11.10 stacks. For more information, see Create - // a New Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html). - ChefConfiguration *ChefConfiguration `type:"structure"` - - // A list of source stack app IDs to be included in the cloned stack. - CloneAppIds []*string `type:"list"` - - // Whether to clone the source stack's permissions. - ClonePermissions *bool `type:"boolean"` - - // The configuration manager. When you clone a stack we recommend that you use - // the configuration manager to specify the Chef version: 12, 11.10, or 11.4 - // for Linux stacks, or 12.2 for Windows stacks. The default value for Linux - // stacks is currently 12. - ConfigurationManager *StackConfigurationManager `type:"structure"` - - // Contains the information required to retrieve an app or cookbook from a repository. - // For more information, see Creating Apps (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html) - // or Custom Recipes and Cookbooks (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html). - CustomCookbooksSource *Source `type:"structure"` - - // A string that contains user-defined, custom JSON. It is used to override - // the corresponding default stack configuration JSON values. The string should - // be in the following format: - // - // "{\"key1\": \"value1\", \"key2\": \"value2\",...}" - // - // For more information on custom JSON, see Use Custom JSON to Modify the Stack - // Configuration Attributes (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html) - CustomJson *string `type:"string"` - - // The cloned stack's default Availability Zone, which must be in the specified - // region. For more information, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). - // If you also specify a value for DefaultSubnetId, the subnet must be in the - // same zone. For more information, see the VpcId parameter description. - DefaultAvailabilityZone *string `type:"string"` - - // The Amazon Resource Name (ARN) of an IAM profile that is the default profile - // for all of the stack's EC2 instances. For more information about IAM ARNs, - // see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - DefaultInstanceProfileArn *string `type:"string"` - - // The stack's operating system, which must be set to one of the following. - // - // * A supported Linux operating system: An Amazon Linux version, such as - // Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon Linux 2015.03. - // - // * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu - // 14.04 LTS, or Ubuntu 12.04 LTS. - // - // * CentOS 7 - // - // * Red Hat Enterprise Linux 7 - // - // * Microsoft Windows Server 2012 R2 Base, Microsoft Windows Server 2012 - // R2 with SQL Server Express, Microsoft Windows Server 2012 R2 with SQL - // Server Standard, or Microsoft Windows Server 2012 R2 with SQL Server Web. - // - // * A custom AMI: Custom. You specify the custom AMI you want to use when - // you create instances. For more information on how to use custom AMIs with - // OpsWorks, see Using Custom AMIs (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html). - // - // The default option is the parent stack's operating system. For more information - // on the supported operating systems, see AWS OpsWorks Operating Systems (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html). - // - // You can specify a different Linux operating system for the cloned stack, - // but you cannot change from Linux to Windows or Windows to Linux. - DefaultOs *string `type:"string"` - - // The default root device type. This value is used by default for all instances - // in the cloned stack, but you can override it when you create an instance. - // For more information, see Storage for the Root Device (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device). - DefaultRootDeviceType *string `type:"string" enum:"RootDeviceType"` - - // A default Amazon EC2 key pair name. The default value is none. If you specify - // a key pair name, AWS OpsWorks installs the public key on the instance and - // you can use the private key with an SSH client to log in to the instance. - // For more information, see Using SSH to Communicate with an Instance (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html) - // and Managing SSH Access (http://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html). - // You can override this setting by specifying a different key pair, or no key - // pair, when you create an instance (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html). - DefaultSshKeyName *string `type:"string"` - - // The stack's default VPC subnet ID. This parameter is required if you specify - // a value for the VpcId parameter. All instances are launched into this subnet - // unless you specify otherwise when you create the instance. If you also specify - // a value for DefaultAvailabilityZone, the subnet must be in that zone. For - // information on default values and when this parameter is required, see the - // VpcId parameter description. - DefaultSubnetId *string `type:"string"` - - // The stack's host name theme, with spaces are replaced by underscores. The - // theme is used to generate host names for the stack's instances. By default, - // HostnameTheme is set to Layer_Dependent, which creates host names by appending - // integers to the layer's short name. The other themes are: - // - // * Baked_Goods - // - // * Clouds - // - // * Europe_Cities - // - // * Fruits - // - // * Greek_Deities - // - // * Legendary_creatures_from_Japan - // - // * Planets_and_Moons - // - // * Roman_Deities - // - // * Scottish_Islands - // - // * US_Cities - // - // * Wild_Cats - // - // To obtain a generated host name, call GetHostNameSuggestion, which returns - // a host name based on the current theme. - HostnameTheme *string `type:"string"` - - // The cloned stack name. - Name *string `type:"string"` - - // The cloned stack AWS region, such as "ap-northeast-2". For more information - // about AWS regions, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). - Region *string `type:"string"` - - // The stack AWS Identity and Access Management (IAM) role, which allows AWS - // OpsWorks to work with AWS resources on your behalf. You must set this parameter - // to the Amazon Resource Name (ARN) for an existing IAM role. If you create - // a stack by using the AWS OpsWorks console, it creates the role for you. You - // can obtain an existing stack's IAM ARN programmatically by calling DescribePermissions. - // For more information about IAM ARNs, see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - // - // You must set this parameter to a valid service role ARN or the action will - // fail; there is no default value. You can specify the source stack's service - // role ARN, if you prefer, but you must do so explicitly. - // - // ServiceRoleArn is a required field - ServiceRoleArn *string `type:"string" required:"true"` - - // The source stack ID. - // - // SourceStackId is a required field - SourceStackId *string `type:"string" required:"true"` - - // Whether to use custom cookbooks. - UseCustomCookbooks *bool `type:"boolean"` - - // Whether to associate the AWS OpsWorks built-in security groups with the stack's - // layers. - // - // AWS OpsWorks provides a standard set of built-in security groups, one for - // each layer, which are associated with layers by default. With UseOpsworksSecurityGroups - // you can instead provide your own custom security groups. UseOpsworksSecurityGroups - // has the following settings: - // - // * True - AWS OpsWorks automatically associates the appropriate built-in - // security group with each layer (default setting). You can associate additional - // security groups with a layer after you create it but you cannot delete - // the built-in security group. - // - // * False - AWS OpsWorks does not associate built-in security groups with - // layers. You must create appropriate Amazon Elastic Compute Cloud (Amazon - // EC2) security groups and associate a security group with each layer that - // you create. However, you can still manually associate a built-in security - // group with a layer on creation; custom security groups are required only - // for those layers that need custom settings. - // - // For more information, see Create a New Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html). - UseOpsworksSecurityGroups *bool `type:"boolean"` - - // The ID of the VPC that the cloned stack is to be launched into. It must be - // in the specified region. All instances are launched into this VPC, and you - // cannot change the ID later. - // - // * If your account supports EC2 Classic, the default value is no VPC. - // - // * If your account does not support EC2 Classic, the default value is the - // default VPC for the specified region. - // - // If the VPC ID corresponds to a default VPC and you have specified either - // the DefaultAvailabilityZone or the DefaultSubnetId parameter only, AWS OpsWorks - // infers the value of the other parameter. If you specify neither parameter, - // AWS OpsWorks sets these parameters to the first valid Availability Zone for - // the specified region and the corresponding default VPC subnet ID, respectively. - // - // If you specify a nondefault VPC ID, note the following: - // - // * It must belong to a VPC in your account that is in the specified region. - // - // * You must specify a value for DefaultSubnetId. - // - // For more information on how to use AWS OpsWorks with a VPC, see Running a - // Stack in a VPC (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html). - // For more information on default VPC and EC2 Classic, see Supported Platforms - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html). - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s CloneStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloneStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloneStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloneStackInput"} - if s.ServiceRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceRoleArn")) - } - if s.SourceStackId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceStackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *CloneStackInput) SetAgentVersion(v string) *CloneStackInput { - s.AgentVersion = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *CloneStackInput) SetAttributes(v map[string]*string) *CloneStackInput { - s.Attributes = v - return s -} - -// SetChefConfiguration sets the ChefConfiguration field's value. -func (s *CloneStackInput) SetChefConfiguration(v *ChefConfiguration) *CloneStackInput { - s.ChefConfiguration = v - return s -} - -// SetCloneAppIds sets the CloneAppIds field's value. -func (s *CloneStackInput) SetCloneAppIds(v []*string) *CloneStackInput { - s.CloneAppIds = v - return s -} - -// SetClonePermissions sets the ClonePermissions field's value. -func (s *CloneStackInput) SetClonePermissions(v bool) *CloneStackInput { - s.ClonePermissions = &v - return s -} - -// SetConfigurationManager sets the ConfigurationManager field's value. -func (s *CloneStackInput) SetConfigurationManager(v *StackConfigurationManager) *CloneStackInput { - s.ConfigurationManager = v - return s -} - -// SetCustomCookbooksSource sets the CustomCookbooksSource field's value. -func (s *CloneStackInput) SetCustomCookbooksSource(v *Source) *CloneStackInput { - s.CustomCookbooksSource = v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *CloneStackInput) SetCustomJson(v string) *CloneStackInput { - s.CustomJson = &v - return s -} - -// SetDefaultAvailabilityZone sets the DefaultAvailabilityZone field's value. -func (s *CloneStackInput) SetDefaultAvailabilityZone(v string) *CloneStackInput { - s.DefaultAvailabilityZone = &v - return s -} - -// SetDefaultInstanceProfileArn sets the DefaultInstanceProfileArn field's value. -func (s *CloneStackInput) SetDefaultInstanceProfileArn(v string) *CloneStackInput { - s.DefaultInstanceProfileArn = &v - return s -} - -// SetDefaultOs sets the DefaultOs field's value. -func (s *CloneStackInput) SetDefaultOs(v string) *CloneStackInput { - s.DefaultOs = &v - return s -} - -// SetDefaultRootDeviceType sets the DefaultRootDeviceType field's value. -func (s *CloneStackInput) SetDefaultRootDeviceType(v string) *CloneStackInput { - s.DefaultRootDeviceType = &v - return s -} - -// SetDefaultSshKeyName sets the DefaultSshKeyName field's value. -func (s *CloneStackInput) SetDefaultSshKeyName(v string) *CloneStackInput { - s.DefaultSshKeyName = &v - return s -} - -// SetDefaultSubnetId sets the DefaultSubnetId field's value. -func (s *CloneStackInput) SetDefaultSubnetId(v string) *CloneStackInput { - s.DefaultSubnetId = &v - return s -} - -// SetHostnameTheme sets the HostnameTheme field's value. -func (s *CloneStackInput) SetHostnameTheme(v string) *CloneStackInput { - s.HostnameTheme = &v - return s -} - -// SetName sets the Name field's value. -func (s *CloneStackInput) SetName(v string) *CloneStackInput { - s.Name = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *CloneStackInput) SetRegion(v string) *CloneStackInput { - s.Region = &v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *CloneStackInput) SetServiceRoleArn(v string) *CloneStackInput { - s.ServiceRoleArn = &v - return s -} - -// SetSourceStackId sets the SourceStackId field's value. -func (s *CloneStackInput) SetSourceStackId(v string) *CloneStackInput { - s.SourceStackId = &v - return s -} - -// SetUseCustomCookbooks sets the UseCustomCookbooks field's value. -func (s *CloneStackInput) SetUseCustomCookbooks(v bool) *CloneStackInput { - s.UseCustomCookbooks = &v - return s -} - -// SetUseOpsworksSecurityGroups sets the UseOpsworksSecurityGroups field's value. -func (s *CloneStackInput) SetUseOpsworksSecurityGroups(v bool) *CloneStackInput { - s.UseOpsworksSecurityGroups = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CloneStackInput) SetVpcId(v string) *CloneStackInput { - s.VpcId = &v - return s -} - -// Contains the response to a CloneStack request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CloneStackResult -type CloneStackOutput struct { - _ struct{} `type:"structure"` - - // The cloned stack ID. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s CloneStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloneStackOutput) GoString() string { - return s.String() -} - -// SetStackId sets the StackId field's value. -func (s *CloneStackOutput) SetStackId(v string) *CloneStackOutput { - s.StackId = &v - return s -} - -// Describes a command. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Command -type Command struct { - _ struct{} `type:"structure"` - - // Date and time when the command was acknowledged. - AcknowledgedAt *string `type:"string"` - - // The command ID. - CommandId *string `type:"string"` - - // Date when the command completed. - CompletedAt *string `type:"string"` - - // Date and time when the command was run. - CreatedAt *string `type:"string"` - - // The command deployment ID. - DeploymentId *string `type:"string"` - - // The command exit code. - ExitCode *int64 `type:"integer"` - - // The ID of the instance where the command was executed. - InstanceId *string `type:"string"` - - // The URL of the command log. - LogUrl *string `type:"string"` - - // The command status: - // - // * failed - // - // * successful - // - // * skipped - // - // * pending - Status *string `type:"string"` - - // The command type: - // - // * deploy - // - // * rollback - // - // * start - // - // * stop - // - // * restart - // - // * undeploy - // - // * update_dependencies - // - // * install_dependencies - // - // * update_custom_cookbooks - // - // * execute_recipes - Type *string `type:"string"` -} - -// String returns the string representation -func (s Command) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Command) GoString() string { - return s.String() -} - -// SetAcknowledgedAt sets the AcknowledgedAt field's value. -func (s *Command) SetAcknowledgedAt(v string) *Command { - s.AcknowledgedAt = &v - return s -} - -// SetCommandId sets the CommandId field's value. -func (s *Command) SetCommandId(v string) *Command { - s.CommandId = &v - return s -} - -// SetCompletedAt sets the CompletedAt field's value. -func (s *Command) SetCompletedAt(v string) *Command { - s.CompletedAt = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Command) SetCreatedAt(v string) *Command { - s.CreatedAt = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *Command) SetDeploymentId(v string) *Command { - s.DeploymentId = &v - return s -} - -// SetExitCode sets the ExitCode field's value. -func (s *Command) SetExitCode(v int64) *Command { - s.ExitCode = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Command) SetInstanceId(v string) *Command { - s.InstanceId = &v - return s -} - -// SetLogUrl sets the LogUrl field's value. -func (s *Command) SetLogUrl(v string) *Command { - s.LogUrl = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Command) SetStatus(v string) *Command { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *Command) SetType(v string) *Command { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateAppRequest -type CreateAppInput struct { - _ struct{} `type:"structure"` - - // A Source object that specifies the app repository. - AppSource *Source `type:"structure"` - - // One or more user-defined key/value pairs to be added to the stack attributes. - Attributes map[string]*string `type:"map"` - - // The app's data source. - DataSources []*DataSource `type:"list"` - - // A description of the app. - Description *string `type:"string"` - - // The app virtual host settings, with multiple domains separated by commas. - // For example: 'www.example.com, example.com' - Domains []*string `type:"list"` - - // Whether to enable SSL for the app. - EnableSsl *bool `type:"boolean"` - - // An array of EnvironmentVariable objects that specify environment variables - // to be associated with the app. After you deploy the app, these variables - // are defined on the associated app server instance. For more information, - // see Environment Variables (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment). - // - // There is no specific limit on the number of environment variables. However, - // the size of the associated data structure - which includes the variables' - // names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). - // This limit should accommodate most if not all use cases. Exceeding it will - // cause an exception with the message, "Environment: is too large (maximum - // is 10KB)." - // - // This parameter is supported only by Chef 11.10 stacks. If you have specified - // one or more environment variables, you cannot modify the stack's Chef version. - Environment []*EnvironmentVariable `type:"list"` - - // The app name. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The app's short name. - Shortname *string `type:"string"` - - // An SslConfiguration object with the SSL configuration. - SslConfiguration *SslConfiguration `type:"structure"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` - - // The app type. Each supported type is associated with a particular layer. - // For example, PHP applications are associated with a PHP layer. AWS OpsWorks - // deploys an application to those instances that are members of the corresponding - // layer. If your app isn't one of the standard types, or you prefer to implement - // your own Deploy recipes, specify other. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"AppType"` -} - -// String returns the string representation -func (s CreateAppInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAppInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAppInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAppInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Environment != nil { - for i, v := range s.Environment { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Environment", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SslConfiguration != nil { - if err := s.SslConfiguration.Validate(); err != nil { - invalidParams.AddNested("SslConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppSource sets the AppSource field's value. -func (s *CreateAppInput) SetAppSource(v *Source) *CreateAppInput { - s.AppSource = v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *CreateAppInput) SetAttributes(v map[string]*string) *CreateAppInput { - s.Attributes = v - return s -} - -// SetDataSources sets the DataSources field's value. -func (s *CreateAppInput) SetDataSources(v []*DataSource) *CreateAppInput { - s.DataSources = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAppInput) SetDescription(v string) *CreateAppInput { - s.Description = &v - return s -} - -// SetDomains sets the Domains field's value. -func (s *CreateAppInput) SetDomains(v []*string) *CreateAppInput { - s.Domains = v - return s -} - -// SetEnableSsl sets the EnableSsl field's value. -func (s *CreateAppInput) SetEnableSsl(v bool) *CreateAppInput { - s.EnableSsl = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *CreateAppInput) SetEnvironment(v []*EnvironmentVariable) *CreateAppInput { - s.Environment = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAppInput) SetName(v string) *CreateAppInput { - s.Name = &v - return s -} - -// SetShortname sets the Shortname field's value. -func (s *CreateAppInput) SetShortname(v string) *CreateAppInput { - s.Shortname = &v - return s -} - -// SetSslConfiguration sets the SslConfiguration field's value. -func (s *CreateAppInput) SetSslConfiguration(v *SslConfiguration) *CreateAppInput { - s.SslConfiguration = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *CreateAppInput) SetStackId(v string) *CreateAppInput { - s.StackId = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateAppInput) SetType(v string) *CreateAppInput { - s.Type = &v - return s -} - -// Contains the response to a CreateApp request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateAppResult -type CreateAppOutput struct { - _ struct{} `type:"structure"` - - // The app ID. - AppId *string `type:"string"` -} - -// String returns the string representation -func (s CreateAppOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAppOutput) GoString() string { - return s.String() -} - -// SetAppId sets the AppId field's value. -func (s *CreateAppOutput) SetAppId(v string) *CreateAppOutput { - s.AppId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateDeploymentRequest -type CreateDeploymentInput struct { - _ struct{} `type:"structure"` - - // The app ID. This parameter is required for app deployments, but not for other - // deployment commands. - AppId *string `type:"string"` - - // A DeploymentCommand object that specifies the deployment command and any - // associated arguments. - // - // Command is a required field - Command *DeploymentCommand `type:"structure" required:"true"` - - // A user-defined comment. - Comment *string `type:"string"` - - // A string that contains user-defined, custom JSON. It is used to override - // the corresponding default stack configuration JSON values. The string should - // be in the following format: - // - // "{\"key1\": \"value1\", \"key2\": \"value2\",...}" - // - // For more information on custom JSON, see Use Custom JSON to Modify the Stack - // Configuration Attributes (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html). - CustomJson *string `type:"string"` - - // The instance IDs for the deployment targets. - InstanceIds []*string `type:"list"` - - // The layer IDs for the deployment targets. - LayerIds []*string `type:"list"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateDeploymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentInput"} - if s.Command == nil { - invalidParams.Add(request.NewErrParamRequired("Command")) - } - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - if s.Command != nil { - if err := s.Command.Validate(); err != nil { - invalidParams.AddNested("Command", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppId sets the AppId field's value. -func (s *CreateDeploymentInput) SetAppId(v string) *CreateDeploymentInput { - s.AppId = &v - return s -} - -// SetCommand sets the Command field's value. -func (s *CreateDeploymentInput) SetCommand(v *DeploymentCommand) *CreateDeploymentInput { - s.Command = v - return s -} - -// SetComment sets the Comment field's value. -func (s *CreateDeploymentInput) SetComment(v string) *CreateDeploymentInput { - s.Comment = &v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *CreateDeploymentInput) SetCustomJson(v string) *CreateDeploymentInput { - s.CustomJson = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *CreateDeploymentInput) SetInstanceIds(v []*string) *CreateDeploymentInput { - s.InstanceIds = v - return s -} - -// SetLayerIds sets the LayerIds field's value. -func (s *CreateDeploymentInput) SetLayerIds(v []*string) *CreateDeploymentInput { - s.LayerIds = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *CreateDeploymentInput) SetStackId(v string) *CreateDeploymentInput { - s.StackId = &v - return s -} - -// Contains the response to a CreateDeployment request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateDeploymentResult -type CreateDeploymentOutput struct { - _ struct{} `type:"structure"` - - // The deployment ID, which can be used with other requests to identify the - // deployment. - DeploymentId *string `type:"string"` -} - -// String returns the string representation -func (s CreateDeploymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentOutput) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *CreateDeploymentOutput) SetDeploymentId(v string) *CreateDeploymentOutput { - s.DeploymentId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateInstanceRequest -type CreateInstanceInput struct { - _ struct{} `type:"structure"` - - // The default AWS OpsWorks agent version. You have the following options: - // - // * INHERIT - Use the stack's default agent version setting. - // - // * version_number - Use the specified agent version. This value overrides - // the stack's default setting. To update the agent version, edit the instance - // configuration and specify a new version. AWS OpsWorks then automatically - // installs that version on the instance. - // - // The default setting is INHERIT. To specify an agent version, you must use - // the complete version number, not the abbreviated number shown on the console. - // For a list of available agent version numbers, call DescribeAgentVersions. - AgentVersion *string `type:"string"` - - // A custom AMI ID to be used to create the instance. The AMI should be based - // on one of the supported operating systems. For more information, see Using - // Custom AMIs (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html). - // - // If you specify a custom AMI, you must set Os to Custom. - AmiId *string `type:"string"` - - // The instance architecture. The default option is x86_64. Instance types do - // not necessarily support both architectures. For a list of the architectures - // that are supported by the different instance types, see Instance Families - // and Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). - Architecture *string `type:"string" enum:"Architecture"` - - // For load-based or time-based instances, the type. Windows stacks can use - // only time-based instances. - AutoScalingType *string `type:"string" enum:"AutoScalingType"` - - // The instance Availability Zone. For more information, see Regions and Endpoints - // (http://docs.aws.amazon.com/general/latest/gr/rande.html). - AvailabilityZone *string `type:"string"` - - // An array of BlockDeviceMapping objects that specify the instance's block - // devices. For more information, see Block Device Mapping (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html). - // Note that block device mappings are not supported for custom AMIs. - BlockDeviceMappings []*BlockDeviceMapping `type:"list"` - - // Whether to create an Amazon EBS-optimized instance. - EbsOptimized *bool `type:"boolean"` - - // The instance host name. - Hostname *string `type:"string"` - - // Whether to install operating system and package updates when the instance - // boots. The default value is true. To control when updates are installed, - // set this value to false. You must then update your instances manually by - // using CreateDeployment to run the update_dependencies stack command or by - // manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. - // - // We strongly recommend using the default value of true to ensure that your - // instances have the latest security updates. - InstallUpdatesOnBoot *bool `type:"boolean"` - - // The instance type, such as t2.micro. For a list of supported instance types, - // open the stack in the console, choose Instances, and choose + Instance. The - // Size list contains the currently supported types. For more information, see - // Instance Families and Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). - // The parameter values that you use to specify the various types are in the - // API Name column of the Available Instance Types table. - // - // InstanceType is a required field - InstanceType *string `type:"string" required:"true"` - - // An array that contains the instance's layer IDs. - // - // LayerIds is a required field - LayerIds []*string `type:"list" required:"true"` - - // The instance's operating system, which must be set to one of the following. - // - // * A supported Linux operating system: An Amazon Linux version, such as - // Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon Linux 2015.03. - // - // * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu - // 14.04 LTS, or Ubuntu 12.04 LTS. - // - // * CentOS 7 - // - // * Red Hat Enterprise Linux 7 - // - // * A supported Windows operating system, such as Microsoft Windows Server - // 2012 R2 Base, Microsoft Windows Server 2012 R2 with SQL Server Express, - // Microsoft Windows Server 2012 R2 with SQL Server Standard, or Microsoft - // Windows Server 2012 R2 with SQL Server Web. - // - // * A custom AMI: Custom. - // - // For more information on the supported operating systems, see AWS OpsWorks - // Operating Systems (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html). - // - // The default option is the current Amazon Linux version. If you set this parameter - // to Custom, you must use the CreateInstance action's AmiId parameter to specify - // the custom AMI that you want to use. Block device mappings are not supported - // if the value is Custom. For more information on the supported operating systems, - // see Operating Systems (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html)For - // more information on how to use custom AMIs with AWS OpsWorks, see Using Custom - // AMIs (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html). - Os *string `type:"string"` - - // The instance root device type. For more information, see Storage for the - // Root Device (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device). - RootDeviceType *string `type:"string" enum:"RootDeviceType"` - - // The instance's Amazon EC2 key-pair name. - SshKeyName *string `type:"string"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` - - // The ID of the instance's subnet. If the stack is running in a VPC, you can - // use this parameter to override the stack's default subnet ID value and direct - // AWS OpsWorks to launch the instance in a different subnet. - SubnetId *string `type:"string"` - - // The instance's tenancy option. The default option is no tenancy, or if the - // instance is running in a VPC, inherit tenancy settings from the VPC. The - // following are valid values for this parameter: dedicated, default, or host. - // Because there are costs associated with changes in tenancy options, we recommend - // that you research tenancy options before choosing them for your instances. - // For more information about dedicated hosts, see Dedicated Hosts Overview - // (http://aws.amazon.com/ec2/dedicated-hosts/) and Amazon EC2 Dedicated Hosts - // (http://aws.amazon.com/ec2/dedicated-hosts/). For more information about - // dedicated instances, see Dedicated Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/dedicated-instance.html) - // and Amazon EC2 Dedicated Instances (http://aws.amazon.com/ec2/purchasing-options/dedicated-instances/). - Tenancy *string `type:"string"` - - // The instance's virtualization type, paravirtual or hvm. - VirtualizationType *string `type:"string"` -} - -// String returns the string representation -func (s CreateInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInstanceInput"} - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } - if s.LayerIds == nil { - invalidParams.Add(request.NewErrParamRequired("LayerIds")) - } - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *CreateInstanceInput) SetAgentVersion(v string) *CreateInstanceInput { - s.AgentVersion = &v - return s -} - -// SetAmiId sets the AmiId field's value. -func (s *CreateInstanceInput) SetAmiId(v string) *CreateInstanceInput { - s.AmiId = &v - return s -} - -// SetArchitecture sets the Architecture field's value. -func (s *CreateInstanceInput) SetArchitecture(v string) *CreateInstanceInput { - s.Architecture = &v - return s -} - -// SetAutoScalingType sets the AutoScalingType field's value. -func (s *CreateInstanceInput) SetAutoScalingType(v string) *CreateInstanceInput { - s.AutoScalingType = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateInstanceInput) SetAvailabilityZone(v string) *CreateInstanceInput { - s.AvailabilityZone = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *CreateInstanceInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *CreateInstanceInput { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *CreateInstanceInput) SetEbsOptimized(v bool) *CreateInstanceInput { - s.EbsOptimized = &v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *CreateInstanceInput) SetHostname(v string) *CreateInstanceInput { - s.Hostname = &v - return s -} - -// SetInstallUpdatesOnBoot sets the InstallUpdatesOnBoot field's value. -func (s *CreateInstanceInput) SetInstallUpdatesOnBoot(v bool) *CreateInstanceInput { - s.InstallUpdatesOnBoot = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *CreateInstanceInput) SetInstanceType(v string) *CreateInstanceInput { - s.InstanceType = &v - return s -} - -// SetLayerIds sets the LayerIds field's value. -func (s *CreateInstanceInput) SetLayerIds(v []*string) *CreateInstanceInput { - s.LayerIds = v - return s -} - -// SetOs sets the Os field's value. -func (s *CreateInstanceInput) SetOs(v string) *CreateInstanceInput { - s.Os = &v - return s -} - -// SetRootDeviceType sets the RootDeviceType field's value. -func (s *CreateInstanceInput) SetRootDeviceType(v string) *CreateInstanceInput { - s.RootDeviceType = &v - return s -} - -// SetSshKeyName sets the SshKeyName field's value. -func (s *CreateInstanceInput) SetSshKeyName(v string) *CreateInstanceInput { - s.SshKeyName = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *CreateInstanceInput) SetStackId(v string) *CreateInstanceInput { - s.StackId = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *CreateInstanceInput) SetSubnetId(v string) *CreateInstanceInput { - s.SubnetId = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *CreateInstanceInput) SetTenancy(v string) *CreateInstanceInput { - s.Tenancy = &v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *CreateInstanceInput) SetVirtualizationType(v string) *CreateInstanceInput { - s.VirtualizationType = &v - return s -} - -// Contains the response to a CreateInstance request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateInstanceResult -type CreateInstanceOutput struct { - _ struct{} `type:"structure"` - - // The instance ID. - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s CreateInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateInstanceOutput) SetInstanceId(v string) *CreateInstanceOutput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateLayerRequest -type CreateLayerInput struct { - _ struct{} `type:"structure"` - - // One or more user-defined key-value pairs to be added to the stack attributes. - // - // To create a cluster layer, set the EcsClusterArn attribute to the cluster's - // ARN. - Attributes map[string]*string `type:"map"` - - // Whether to automatically assign an Elastic IP address (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) - // to the layer's instances. For more information, see How to Edit a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html). - AutoAssignElasticIps *bool `type:"boolean"` - - // For stacks that are running in a VPC, whether to automatically assign a public - // IP address to the layer's instances. For more information, see How to Edit - // a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html). - AutoAssignPublicIps *bool `type:"boolean"` - - // The ARN of an IAM profile to be used for the layer's EC2 instances. For more - // information about IAM ARNs, see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - CustomInstanceProfileArn *string `type:"string"` - - // A JSON-formatted string containing custom stack configuration and deployment - // attributes to be installed on the layer's instances. For more information, - // see Using Custom JSON (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html). - // This feature is supported as of version 1.7.42 of the AWS CLI. - CustomJson *string `type:"string"` - - // A LayerCustomRecipes object that specifies the layer custom recipes. - CustomRecipes *Recipes `type:"structure"` - - // An array containing the layer custom security group IDs. - CustomSecurityGroupIds []*string `type:"list"` - - // Whether to disable auto healing for the layer. - EnableAutoHealing *bool `type:"boolean"` - - // Whether to install operating system and package updates when the instance - // boots. The default value is true. To control when updates are installed, - // set this value to false. You must then update your instances manually by - // using CreateDeployment to run the update_dependencies stack command or by - // manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. - // - // To ensure that your instances have the latest security updates, we strongly - // recommend using the default value of true. - InstallUpdatesOnBoot *bool `type:"boolean"` - - // A LifeCycleEventConfiguration object that you can use to configure the Shutdown - // event to specify an execution timeout and enable or disable Elastic Load - // Balancer connection draining. - LifecycleEventConfiguration *LifecycleEventConfiguration `type:"structure"` - - // The layer name, which is used by the console. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // An array of Package objects that describes the layer packages. - Packages []*string `type:"list"` - - // For custom layers only, use this parameter to specify the layer's short name, - // which is used internally by AWS OpsWorks and by Chef recipes. The short name - // is also used as the name for the directory where your app files are installed. - // It can have a maximum of 200 characters, which are limited to the alphanumeric - // characters, '-', '_', and '.'. - // - // The built-in layers' short names are defined by AWS OpsWorks. For more information, - // see the Layer Reference (http://docs.aws.amazon.com/opsworks/latest/userguide/layers.html). - // - // Shortname is a required field - Shortname *string `type:"string" required:"true"` - - // The layer stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` - - // The layer type. A stack cannot have more than one built-in layer of the same - // type. It can have any number of custom layers. Built-in layers are not available - // in Chef 12 stacks. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"LayerType"` - - // Whether to use Amazon EBS-optimized instances. - UseEbsOptimizedInstances *bool `type:"boolean"` - - // A VolumeConfigurations object that describes the layer's Amazon EBS volumes. - VolumeConfigurations []*VolumeConfiguration `type:"list"` -} - -// String returns the string representation -func (s CreateLayerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLayerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLayerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLayerInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Shortname == nil { - invalidParams.Add(request.NewErrParamRequired("Shortname")) - } - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.VolumeConfigurations != nil { - for i, v := range s.VolumeConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VolumeConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *CreateLayerInput) SetAttributes(v map[string]*string) *CreateLayerInput { - s.Attributes = v - return s -} - -// SetAutoAssignElasticIps sets the AutoAssignElasticIps field's value. -func (s *CreateLayerInput) SetAutoAssignElasticIps(v bool) *CreateLayerInput { - s.AutoAssignElasticIps = &v - return s -} - -// SetAutoAssignPublicIps sets the AutoAssignPublicIps field's value. -func (s *CreateLayerInput) SetAutoAssignPublicIps(v bool) *CreateLayerInput { - s.AutoAssignPublicIps = &v - return s -} - -// SetCustomInstanceProfileArn sets the CustomInstanceProfileArn field's value. -func (s *CreateLayerInput) SetCustomInstanceProfileArn(v string) *CreateLayerInput { - s.CustomInstanceProfileArn = &v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *CreateLayerInput) SetCustomJson(v string) *CreateLayerInput { - s.CustomJson = &v - return s -} - -// SetCustomRecipes sets the CustomRecipes field's value. -func (s *CreateLayerInput) SetCustomRecipes(v *Recipes) *CreateLayerInput { - s.CustomRecipes = v - return s -} - -// SetCustomSecurityGroupIds sets the CustomSecurityGroupIds field's value. -func (s *CreateLayerInput) SetCustomSecurityGroupIds(v []*string) *CreateLayerInput { - s.CustomSecurityGroupIds = v - return s -} - -// SetEnableAutoHealing sets the EnableAutoHealing field's value. -func (s *CreateLayerInput) SetEnableAutoHealing(v bool) *CreateLayerInput { - s.EnableAutoHealing = &v - return s -} - -// SetInstallUpdatesOnBoot sets the InstallUpdatesOnBoot field's value. -func (s *CreateLayerInput) SetInstallUpdatesOnBoot(v bool) *CreateLayerInput { - s.InstallUpdatesOnBoot = &v - return s -} - -// SetLifecycleEventConfiguration sets the LifecycleEventConfiguration field's value. -func (s *CreateLayerInput) SetLifecycleEventConfiguration(v *LifecycleEventConfiguration) *CreateLayerInput { - s.LifecycleEventConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateLayerInput) SetName(v string) *CreateLayerInput { - s.Name = &v - return s -} - -// SetPackages sets the Packages field's value. -func (s *CreateLayerInput) SetPackages(v []*string) *CreateLayerInput { - s.Packages = v - return s -} - -// SetShortname sets the Shortname field's value. -func (s *CreateLayerInput) SetShortname(v string) *CreateLayerInput { - s.Shortname = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *CreateLayerInput) SetStackId(v string) *CreateLayerInput { - s.StackId = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateLayerInput) SetType(v string) *CreateLayerInput { - s.Type = &v - return s -} - -// SetUseEbsOptimizedInstances sets the UseEbsOptimizedInstances field's value. -func (s *CreateLayerInput) SetUseEbsOptimizedInstances(v bool) *CreateLayerInput { - s.UseEbsOptimizedInstances = &v - return s -} - -// SetVolumeConfigurations sets the VolumeConfigurations field's value. -func (s *CreateLayerInput) SetVolumeConfigurations(v []*VolumeConfiguration) *CreateLayerInput { - s.VolumeConfigurations = v - return s -} - -// Contains the response to a CreateLayer request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateLayerResult -type CreateLayerOutput struct { - _ struct{} `type:"structure"` - - // The layer ID. - LayerId *string `type:"string"` -} - -// String returns the string representation -func (s CreateLayerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLayerOutput) GoString() string { - return s.String() -} - -// SetLayerId sets the LayerId field's value. -func (s *CreateLayerOutput) SetLayerId(v string) *CreateLayerOutput { - s.LayerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateStackRequest -type CreateStackInput struct { - _ struct{} `type:"structure"` - - // The default AWS OpsWorks agent version. You have the following options: - // - // * Auto-update - Set this parameter to LATEST. AWS OpsWorks automatically - // installs new agent versions on the stack's instances as soon as they are - // available. - // - // * Fixed version - Set this parameter to your preferred agent version. - // To update the agent version, you must edit the stack configuration and - // specify a new version. AWS OpsWorks then automatically installs that version - // on the stack's instances. - // - // The default setting is the most recent release of the agent. To specify an - // agent version, you must use the complete version number, not the abbreviated - // number shown on the console. For a list of available agent version numbers, - // call DescribeAgentVersions. - // - // You can also specify an agent version when you create or update an instance, - // which overrides the stack's default setting. - AgentVersion *string `type:"string"` - - // One or more user-defined key-value pairs to be added to the stack attributes. - Attributes map[string]*string `type:"map"` - - // A ChefConfiguration object that specifies whether to enable Berkshelf and - // the Berkshelf version on Chef 11.10 stacks. For more information, see Create - // a New Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html). - ChefConfiguration *ChefConfiguration `type:"structure"` - - // The configuration manager. When you create a stack we recommend that you - // use the configuration manager to specify the Chef version: 12, 11.10, or - // 11.4 for Linux stacks, or 12.2 for Windows stacks. The default value for - // Linux stacks is currently 11.4. - ConfigurationManager *StackConfigurationManager `type:"structure"` - - // Contains the information required to retrieve an app or cookbook from a repository. - // For more information, see Creating Apps (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html) - // or Custom Recipes and Cookbooks (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html). - CustomCookbooksSource *Source `type:"structure"` - - // A string that contains user-defined, custom JSON. It can be used to override - // the corresponding default stack configuration attribute values or to pass - // data to recipes. The string should be in the following format: - // - // "{\"key1\": \"value1\", \"key2\": \"value2\",...}" - // - // For more information on custom JSON, see Use Custom JSON to Modify the Stack - // Configuration Attributes (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html). - CustomJson *string `type:"string"` - - // The stack's default Availability Zone, which must be in the specified region. - // For more information, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). - // If you also specify a value for DefaultSubnetId, the subnet must be in the - // same zone. For more information, see the VpcId parameter description. - DefaultAvailabilityZone *string `type:"string"` - - // The Amazon Resource Name (ARN) of an IAM profile that is the default profile - // for all of the stack's EC2 instances. For more information about IAM ARNs, - // see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - // - // DefaultInstanceProfileArn is a required field - DefaultInstanceProfileArn *string `type:"string" required:"true"` - - // The stack's default operating system, which is installed on every instance - // unless you specify a different operating system when you create the instance. - // You can specify one of the following. - // - // * A supported Linux operating system: An Amazon Linux version, such as - // Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon Linux 2015.03. - // - // * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu - // 14.04 LTS, or Ubuntu 12.04 LTS. - // - // * CentOS 7 - // - // * Red Hat Enterprise Linux 7 - // - // * A supported Windows operating system, such as Microsoft Windows Server - // 2012 R2 Base, Microsoft Windows Server 2012 R2 with SQL Server Express, - // Microsoft Windows Server 2012 R2 with SQL Server Standard, or Microsoft - // Windows Server 2012 R2 with SQL Server Web. - // - // * A custom AMI: Custom. You specify the custom AMI you want to use when - // you create instances. For more information, see Using Custom AMIs (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html). - // - // The default option is the current Amazon Linux version. For more information - // on the supported operating systems, see AWS OpsWorks Operating Systems (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html). - DefaultOs *string `type:"string"` - - // The default root device type. This value is the default for all instances - // in the stack, but you can override it when you create an instance. The default - // option is instance-store. For more information, see Storage for the Root - // Device (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device). - DefaultRootDeviceType *string `type:"string" enum:"RootDeviceType"` - - // A default Amazon EC2 key pair name. The default value is none. If you specify - // a key pair name, AWS OpsWorks installs the public key on the instance and - // you can use the private key with an SSH client to log in to the instance. - // For more information, see Using SSH to Communicate with an Instance (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html) - // and Managing SSH Access (http://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html). - // You can override this setting by specifying a different key pair, or no key - // pair, when you create an instance (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html). - DefaultSshKeyName *string `type:"string"` - - // The stack's default VPC subnet ID. This parameter is required if you specify - // a value for the VpcId parameter. All instances are launched into this subnet - // unless you specify otherwise when you create the instance. If you also specify - // a value for DefaultAvailabilityZone, the subnet must be in that zone. For - // information on default values and when this parameter is required, see the - // VpcId parameter description. - DefaultSubnetId *string `type:"string"` - - // The stack's host name theme, with spaces replaced by underscores. The theme - // is used to generate host names for the stack's instances. By default, HostnameTheme - // is set to Layer_Dependent, which creates host names by appending integers - // to the layer's short name. The other themes are: - // - // * Baked_Goods - // - // * Clouds - // - // * Europe_Cities - // - // * Fruits - // - // * Greek_Deities - // - // * Legendary_creatures_from_Japan - // - // * Planets_and_Moons - // - // * Roman_Deities - // - // * Scottish_Islands - // - // * US_Cities - // - // * Wild_Cats - // - // To obtain a generated host name, call GetHostNameSuggestion, which returns - // a host name based on the current theme. - HostnameTheme *string `type:"string"` - - // The stack name. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The stack's AWS region, such as "ap-south-1". For more information about - // Amazon regions, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). - // - // Region is a required field - Region *string `type:"string" required:"true"` - - // The stack's AWS Identity and Access Management (IAM) role, which allows AWS - // OpsWorks to work with AWS resources on your behalf. You must set this parameter - // to the Amazon Resource Name (ARN) for an existing IAM role. For more information - // about IAM ARNs, see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - // - // ServiceRoleArn is a required field - ServiceRoleArn *string `type:"string" required:"true"` - - // Whether the stack uses custom cookbooks. - UseCustomCookbooks *bool `type:"boolean"` - - // Whether to associate the AWS OpsWorks built-in security groups with the stack's - // layers. - // - // AWS OpsWorks provides a standard set of built-in security groups, one for - // each layer, which are associated with layers by default. With UseOpsworksSecurityGroups - // you can instead provide your own custom security groups. UseOpsworksSecurityGroups - // has the following settings: - // - // * True - AWS OpsWorks automatically associates the appropriate built-in - // security group with each layer (default setting). You can associate additional - // security groups with a layer after you create it, but you cannot delete - // the built-in security group. - // - // * False - AWS OpsWorks does not associate built-in security groups with - // layers. You must create appropriate EC2 security groups and associate - // a security group with each layer that you create. However, you can still - // manually associate a built-in security group with a layer on creation; - // custom security groups are required only for those layers that need custom - // settings. - // - // For more information, see Create a New Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html). - UseOpsworksSecurityGroups *bool `type:"boolean"` - - // The ID of the VPC that the stack is to be launched into. The VPC must be - // in the stack's region. All instances are launched into this VPC. You cannot - // change the ID later. - // - // * If your account supports EC2-Classic, the default value is no VPC. - // - // * If your account does not support EC2-Classic, the default value is the - // default VPC for the specified region. - // - // If the VPC ID corresponds to a default VPC and you have specified either - // the DefaultAvailabilityZone or the DefaultSubnetId parameter only, AWS OpsWorks - // infers the value of the other parameter. If you specify neither parameter, - // AWS OpsWorks sets these parameters to the first valid Availability Zone for - // the specified region and the corresponding default VPC subnet ID, respectively. - // - // If you specify a nondefault VPC ID, note the following: - // - // * It must belong to a VPC in your account that is in the specified region. - // - // * You must specify a value for DefaultSubnetId. - // - // For more information on how to use AWS OpsWorks with a VPC, see Running a - // Stack in a VPC (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html). - // For more information on default VPC and EC2-Classic, see Supported Platforms - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html). - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s CreateStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStackInput"} - if s.DefaultInstanceProfileArn == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultInstanceProfileArn")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Region == nil { - invalidParams.Add(request.NewErrParamRequired("Region")) - } - if s.ServiceRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceRoleArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *CreateStackInput) SetAgentVersion(v string) *CreateStackInput { - s.AgentVersion = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *CreateStackInput) SetAttributes(v map[string]*string) *CreateStackInput { - s.Attributes = v - return s -} - -// SetChefConfiguration sets the ChefConfiguration field's value. -func (s *CreateStackInput) SetChefConfiguration(v *ChefConfiguration) *CreateStackInput { - s.ChefConfiguration = v - return s -} - -// SetConfigurationManager sets the ConfigurationManager field's value. -func (s *CreateStackInput) SetConfigurationManager(v *StackConfigurationManager) *CreateStackInput { - s.ConfigurationManager = v - return s -} - -// SetCustomCookbooksSource sets the CustomCookbooksSource field's value. -func (s *CreateStackInput) SetCustomCookbooksSource(v *Source) *CreateStackInput { - s.CustomCookbooksSource = v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *CreateStackInput) SetCustomJson(v string) *CreateStackInput { - s.CustomJson = &v - return s -} - -// SetDefaultAvailabilityZone sets the DefaultAvailabilityZone field's value. -func (s *CreateStackInput) SetDefaultAvailabilityZone(v string) *CreateStackInput { - s.DefaultAvailabilityZone = &v - return s -} - -// SetDefaultInstanceProfileArn sets the DefaultInstanceProfileArn field's value. -func (s *CreateStackInput) SetDefaultInstanceProfileArn(v string) *CreateStackInput { - s.DefaultInstanceProfileArn = &v - return s -} - -// SetDefaultOs sets the DefaultOs field's value. -func (s *CreateStackInput) SetDefaultOs(v string) *CreateStackInput { - s.DefaultOs = &v - return s -} - -// SetDefaultRootDeviceType sets the DefaultRootDeviceType field's value. -func (s *CreateStackInput) SetDefaultRootDeviceType(v string) *CreateStackInput { - s.DefaultRootDeviceType = &v - return s -} - -// SetDefaultSshKeyName sets the DefaultSshKeyName field's value. -func (s *CreateStackInput) SetDefaultSshKeyName(v string) *CreateStackInput { - s.DefaultSshKeyName = &v - return s -} - -// SetDefaultSubnetId sets the DefaultSubnetId field's value. -func (s *CreateStackInput) SetDefaultSubnetId(v string) *CreateStackInput { - s.DefaultSubnetId = &v - return s -} - -// SetHostnameTheme sets the HostnameTheme field's value. -func (s *CreateStackInput) SetHostnameTheme(v string) *CreateStackInput { - s.HostnameTheme = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateStackInput) SetName(v string) *CreateStackInput { - s.Name = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *CreateStackInput) SetRegion(v string) *CreateStackInput { - s.Region = &v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *CreateStackInput) SetServiceRoleArn(v string) *CreateStackInput { - s.ServiceRoleArn = &v - return s -} - -// SetUseCustomCookbooks sets the UseCustomCookbooks field's value. -func (s *CreateStackInput) SetUseCustomCookbooks(v bool) *CreateStackInput { - s.UseCustomCookbooks = &v - return s -} - -// SetUseOpsworksSecurityGroups sets the UseOpsworksSecurityGroups field's value. -func (s *CreateStackInput) SetUseOpsworksSecurityGroups(v bool) *CreateStackInput { - s.UseOpsworksSecurityGroups = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateStackInput) SetVpcId(v string) *CreateStackInput { - s.VpcId = &v - return s -} - -// Contains the response to a CreateStack request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateStackResult -type CreateStackOutput struct { - _ struct{} `type:"structure"` - - // The stack ID, which is an opaque string that you use to identify the stack - // when performing actions such as DescribeStacks. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s CreateStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStackOutput) GoString() string { - return s.String() -} - -// SetStackId sets the StackId field's value. -func (s *CreateStackOutput) SetStackId(v string) *CreateStackOutput { - s.StackId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateUserProfileRequest -type CreateUserProfileInput struct { - _ struct{} `type:"structure"` - - // Whether users can specify their own SSH public key through the My Settings - // page. For more information, see Setting an IAM User's Public SSH Key (http://docs.aws.amazon.com/opsworks/latest/userguide/security-settingsshkey.html). - AllowSelfManagement *bool `type:"boolean"` - - // The user's IAM ARN; this can also be a federated user's ARN. - // - // IamUserArn is a required field - IamUserArn *string `type:"string" required:"true"` - - // The user's public SSH key. - SshPublicKey *string `type:"string"` - - // The user's SSH user name. The allowable characters are [a-z], [A-Z], [0-9], - // '-', and '_'. If the specified name includes other punctuation marks, AWS - // OpsWorks removes them. For example, my.name will be changed to myname. If - // you do not specify an SSH user name, AWS OpsWorks generates one from the - // IAM user name. - SshUsername *string `type:"string"` -} - -// String returns the string representation -func (s CreateUserProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateUserProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUserProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUserProfileInput"} - if s.IamUserArn == nil { - invalidParams.Add(request.NewErrParamRequired("IamUserArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowSelfManagement sets the AllowSelfManagement field's value. -func (s *CreateUserProfileInput) SetAllowSelfManagement(v bool) *CreateUserProfileInput { - s.AllowSelfManagement = &v - return s -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *CreateUserProfileInput) SetIamUserArn(v string) *CreateUserProfileInput { - s.IamUserArn = &v - return s -} - -// SetSshPublicKey sets the SshPublicKey field's value. -func (s *CreateUserProfileInput) SetSshPublicKey(v string) *CreateUserProfileInput { - s.SshPublicKey = &v - return s -} - -// SetSshUsername sets the SshUsername field's value. -func (s *CreateUserProfileInput) SetSshUsername(v string) *CreateUserProfileInput { - s.SshUsername = &v - return s -} - -// Contains the response to a CreateUserProfile request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateUserProfileResult -type CreateUserProfileOutput struct { - _ struct{} `type:"structure"` - - // The user's IAM ARN. - IamUserArn *string `type:"string"` -} - -// String returns the string representation -func (s CreateUserProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateUserProfileOutput) GoString() string { - return s.String() -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *CreateUserProfileOutput) SetIamUserArn(v string) *CreateUserProfileOutput { - s.IamUserArn = &v - return s -} - -// Describes an app's data source. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DataSource -type DataSource struct { - _ struct{} `type:"structure"` - - // The data source's ARN. - Arn *string `type:"string"` - - // The database name. - DatabaseName *string `type:"string"` - - // The data source's type, AutoSelectOpsworksMysqlInstance, OpsworksMysqlInstance, - // or RdsDbInstance. - Type *string `type:"string"` -} - -// String returns the string representation -func (s DataSource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DataSource) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DataSource) SetArn(v string) *DataSource { - s.Arn = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *DataSource) SetDatabaseName(v string) *DataSource { - s.DatabaseName = &v - return s -} - -// SetType sets the Type field's value. -func (s *DataSource) SetType(v string) *DataSource { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteAppRequest -type DeleteAppInput struct { - _ struct{} `type:"structure"` - - // The app ID. - // - // AppId is a required field - AppId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAppInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAppInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAppInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAppInput"} - if s.AppId == nil { - invalidParams.Add(request.NewErrParamRequired("AppId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppId sets the AppId field's value. -func (s *DeleteAppInput) SetAppId(v string) *DeleteAppInput { - s.AppId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteAppOutput -type DeleteAppOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAppOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAppOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteInstanceRequest -type DeleteInstanceInput struct { - _ struct{} `type:"structure"` - - // Whether to delete the instance Elastic IP address. - DeleteElasticIp *bool `type:"boolean"` - - // Whether to delete the instance's Amazon EBS volumes. - DeleteVolumes *bool `type:"boolean"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeleteElasticIp sets the DeleteElasticIp field's value. -func (s *DeleteInstanceInput) SetDeleteElasticIp(v bool) *DeleteInstanceInput { - s.DeleteElasticIp = &v - return s -} - -// SetDeleteVolumes sets the DeleteVolumes field's value. -func (s *DeleteInstanceInput) SetDeleteVolumes(v bool) *DeleteInstanceInput { - s.DeleteVolumes = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DeleteInstanceInput) SetInstanceId(v string) *DeleteInstanceInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteInstanceOutput -type DeleteInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteLayerRequest -type DeleteLayerInput struct { - _ struct{} `type:"structure"` - - // The layer ID. - // - // LayerId is a required field - LayerId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteLayerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLayerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLayerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLayerInput"} - if s.LayerId == nil { - invalidParams.Add(request.NewErrParamRequired("LayerId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLayerId sets the LayerId field's value. -func (s *DeleteLayerInput) SetLayerId(v string) *DeleteLayerInput { - s.LayerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteLayerOutput -type DeleteLayerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLayerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLayerOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteStackRequest -type DeleteStackInput struct { - _ struct{} `type:"structure"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStackInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackId sets the StackId field's value. -func (s *DeleteStackInput) SetStackId(v string) *DeleteStackInput { - s.StackId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteStackOutput -type DeleteStackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStackOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteUserProfileRequest -type DeleteUserProfileInput struct { - _ struct{} `type:"structure"` - - // The user's IAM ARN. This can also be a federated user's ARN. - // - // IamUserArn is a required field - IamUserArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteUserProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUserProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUserProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUserProfileInput"} - if s.IamUserArn == nil { - invalidParams.Add(request.NewErrParamRequired("IamUserArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *DeleteUserProfileInput) SetIamUserArn(v string) *DeleteUserProfileInput { - s.IamUserArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteUserProfileOutput -type DeleteUserProfileOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteUserProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteUserProfileOutput) GoString() string { - return s.String() -} - -// Describes a deployment of a stack or app. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Deployment -type Deployment struct { - _ struct{} `type:"structure"` - - // The app ID. - AppId *string `type:"string"` - - // Used to specify a stack or deployment command. - Command *DeploymentCommand `type:"structure"` - - // A user-defined comment. - Comment *string `type:"string"` - - // Date when the deployment completed. - CompletedAt *string `type:"string"` - - // Date when the deployment was created. - CreatedAt *string `type:"string"` - - // A string that contains user-defined custom JSON. It can be used to override - // the corresponding default stack configuration attribute values for stack - // or to pass data to recipes. The string should be in the following format: - // - // "{\"key1\": \"value1\", \"key2\": \"value2\",...}" - // - // For more information on custom JSON, see Use Custom JSON to Modify the Stack - // Configuration Attributes (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html). - CustomJson *string `type:"string"` - - // The deployment ID. - DeploymentId *string `type:"string"` - - // The deployment duration. - Duration *int64 `type:"integer"` - - // The user's IAM ARN. - IamUserArn *string `type:"string"` - - // The IDs of the target instances. - InstanceIds []*string `type:"list"` - - // The stack ID. - StackId *string `type:"string"` - - // The deployment status: - // - // * running - // - // * successful - // - // * failed - Status *string `type:"string"` -} - -// String returns the string representation -func (s Deployment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Deployment) GoString() string { - return s.String() -} - -// SetAppId sets the AppId field's value. -func (s *Deployment) SetAppId(v string) *Deployment { - s.AppId = &v - return s -} - -// SetCommand sets the Command field's value. -func (s *Deployment) SetCommand(v *DeploymentCommand) *Deployment { - s.Command = v - return s -} - -// SetComment sets the Comment field's value. -func (s *Deployment) SetComment(v string) *Deployment { - s.Comment = &v - return s -} - -// SetCompletedAt sets the CompletedAt field's value. -func (s *Deployment) SetCompletedAt(v string) *Deployment { - s.CompletedAt = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Deployment) SetCreatedAt(v string) *Deployment { - s.CreatedAt = &v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *Deployment) SetCustomJson(v string) *Deployment { - s.CustomJson = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *Deployment) SetDeploymentId(v string) *Deployment { - s.DeploymentId = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *Deployment) SetDuration(v int64) *Deployment { - s.Duration = &v - return s -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *Deployment) SetIamUserArn(v string) *Deployment { - s.IamUserArn = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *Deployment) SetInstanceIds(v []*string) *Deployment { - s.InstanceIds = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *Deployment) SetStackId(v string) *Deployment { - s.StackId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Deployment) SetStatus(v string) *Deployment { - s.Status = &v - return s -} - -// Used to specify a stack or deployment command. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeploymentCommand -type DeploymentCommand struct { - _ struct{} `type:"structure"` - - // The arguments of those commands that take arguments. It should be set to - // a JSON object with the following format: - // - // {"arg_name1" : ["value1", "value2", ...], "arg_name2" : ["value1", "value2", - // ...], ...} - // - // The update_dependencies command takes two arguments: - // - // * upgrade_os_to - Specifies the desired Amazon Linux version for instances - // whose OS you want to upgrade, such as Amazon Linux 2014.09. You must also - // set the allow_reboot argument to true. - // - // * allow_reboot - Specifies whether to allow AWS OpsWorks to reboot the - // instances if necessary, after installing the updates. This argument can - // be set to either true or false. The default value is false. - // - // For example, to upgrade an instance to Amazon Linux 2014.09, set Args to - // the following. - // - // { "upgrade_os_to":["Amazon Linux 2014.09"], "allow_reboot":["true"] } - Args map[string][]*string `type:"map"` - - // Specifies the operation. You can specify only one command. - // - // For stacks, the following commands are available: - // - // * execute_recipes: Execute one or more recipes. To specify the recipes, - // set an Args parameter named recipes to the list of recipes to be executed. - // For example, to execute phpapp::appsetup, set Args to {"recipes":["phpapp::appsetup"]}. - // - // * install_dependencies: Install the stack's dependencies. - // - // * update_custom_cookbooks: Update the stack's custom cookbooks. - // - // * update_dependencies: Update the stack's dependencies. - // - // The update_dependencies and install_dependencies commands are supported only - // for Linux instances. You can run the commands successfully on Windows instances, - // but they do nothing. - // - // For apps, the following commands are available: - // - // * deploy: Deploy an app. Ruby on Rails apps have an optional Args parameter - // named migrate. Set Args to {"migrate":["true"]} to migrate the database. - // The default setting is {"migrate":["false"]}. - // - // * rollback Roll the app back to the previous version. When you update - // an app, AWS OpsWorks stores the previous version, up to a maximum of five - // versions. You can use this command to roll an app back as many as four - // versions. - // - // * start: Start the app's web or application server. - // - // * stop: Stop the app's web or application server. - // - // * restart: Restart the app's web or application server. - // - // * undeploy: Undeploy the app. - // - // Name is a required field - Name *string `type:"string" required:"true" enum:"DeploymentCommandName"` -} - -// String returns the string representation -func (s DeploymentCommand) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentCommand) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeploymentCommand) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeploymentCommand"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArgs sets the Args field's value. -func (s *DeploymentCommand) SetArgs(v map[string][]*string) *DeploymentCommand { - s.Args = v - return s -} - -// SetName sets the Name field's value. -func (s *DeploymentCommand) SetName(v string) *DeploymentCommand { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterEcsClusterRequest -type DeregisterEcsClusterInput struct { - _ struct{} `type:"structure"` - - // The cluster's ARN. - // - // EcsClusterArn is a required field - EcsClusterArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterEcsClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterEcsClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterEcsClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterEcsClusterInput"} - if s.EcsClusterArn == nil { - invalidParams.Add(request.NewErrParamRequired("EcsClusterArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEcsClusterArn sets the EcsClusterArn field's value. -func (s *DeregisterEcsClusterInput) SetEcsClusterArn(v string) *DeregisterEcsClusterInput { - s.EcsClusterArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterEcsClusterOutput -type DeregisterEcsClusterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterEcsClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterEcsClusterOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterElasticIpRequest -type DeregisterElasticIpInput struct { - _ struct{} `type:"structure"` - - // The Elastic IP address. - // - // ElasticIp is a required field - ElasticIp *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterElasticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterElasticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterElasticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterElasticIpInput"} - if s.ElasticIp == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticIp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *DeregisterElasticIpInput) SetElasticIp(v string) *DeregisterElasticIpInput { - s.ElasticIp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterElasticIpOutput -type DeregisterElasticIpOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterElasticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterElasticIpOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterInstanceRequest -type DeregisterInstanceInput struct { - _ struct{} `type:"structure"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DeregisterInstanceInput) SetInstanceId(v string) *DeregisterInstanceInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterInstanceOutput -type DeregisterInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterRdsDbInstanceRequest -type DeregisterRdsDbInstanceInput struct { - _ struct{} `type:"structure"` - - // The Amazon RDS instance's ARN. - // - // RdsDbInstanceArn is a required field - RdsDbInstanceArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterRdsDbInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterRdsDbInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterRdsDbInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterRdsDbInstanceInput"} - if s.RdsDbInstanceArn == nil { - invalidParams.Add(request.NewErrParamRequired("RdsDbInstanceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRdsDbInstanceArn sets the RdsDbInstanceArn field's value. -func (s *DeregisterRdsDbInstanceInput) SetRdsDbInstanceArn(v string) *DeregisterRdsDbInstanceInput { - s.RdsDbInstanceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterRdsDbInstanceOutput -type DeregisterRdsDbInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterRdsDbInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterRdsDbInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterVolumeRequest -type DeregisterVolumeInput struct { - _ struct{} `type:"structure"` - - // The AWS OpsWorks volume ID, which is the GUID that AWS OpsWorks assigned - // to the instance when you registered the volume with the stack, not the Amazon - // EC2 volume ID. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DeregisterVolumeInput) SetVolumeId(v string) *DeregisterVolumeInput { - s.VolumeId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterVolumeOutput -type DeregisterVolumeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterVolumeOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAgentVersionsRequest -type DescribeAgentVersionsInput struct { - _ struct{} `type:"structure"` - - // The configuration manager. - ConfigurationManager *StackConfigurationManager `type:"structure"` - - // The stack ID. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAgentVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAgentVersionsInput) GoString() string { - return s.String() -} - -// SetConfigurationManager sets the ConfigurationManager field's value. -func (s *DescribeAgentVersionsInput) SetConfigurationManager(v *StackConfigurationManager) *DescribeAgentVersionsInput { - s.ConfigurationManager = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeAgentVersionsInput) SetStackId(v string) *DescribeAgentVersionsInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeAgentVersions request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAgentVersionsResult -type DescribeAgentVersionsOutput struct { - _ struct{} `type:"structure"` - - // The agent versions for the specified stack or configuration manager. Note - // that this value is the complete version number, not the abbreviated number - // used by the console. - AgentVersions []*AgentVersion `type:"list"` -} - -// String returns the string representation -func (s DescribeAgentVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAgentVersionsOutput) GoString() string { - return s.String() -} - -// SetAgentVersions sets the AgentVersions field's value. -func (s *DescribeAgentVersionsOutput) SetAgentVersions(v []*AgentVersion) *DescribeAgentVersionsOutput { - s.AgentVersions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAppsRequest -type DescribeAppsInput struct { - _ struct{} `type:"structure"` - - // An array of app IDs for the apps to be described. If you use this parameter, - // DescribeApps returns a description of the specified apps. Otherwise, it returns - // a description of every app. - AppIds []*string `type:"list"` - - // The app stack ID. If you use this parameter, DescribeApps returns a description - // of the apps in the specified stack. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAppsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAppsInput) GoString() string { - return s.String() -} - -// SetAppIds sets the AppIds field's value. -func (s *DescribeAppsInput) SetAppIds(v []*string) *DescribeAppsInput { - s.AppIds = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeAppsInput) SetStackId(v string) *DescribeAppsInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeApps request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAppsResult -type DescribeAppsOutput struct { - _ struct{} `type:"structure"` - - // An array of App objects that describe the specified apps. - Apps []*App `type:"list"` -} - -// String returns the string representation -func (s DescribeAppsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAppsOutput) GoString() string { - return s.String() -} - -// SetApps sets the Apps field's value. -func (s *DescribeAppsOutput) SetApps(v []*App) *DescribeAppsOutput { - s.Apps = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeCommandsRequest -type DescribeCommandsInput struct { - _ struct{} `type:"structure"` - - // An array of command IDs. If you include this parameter, DescribeCommands - // returns a description of the specified commands. Otherwise, it returns a - // description of every command. - CommandIds []*string `type:"list"` - - // The deployment ID. If you include this parameter, DescribeCommands returns - // a description of the commands associated with the specified deployment. - DeploymentId *string `type:"string"` - - // The instance ID. If you include this parameter, DescribeCommands returns - // a description of the commands associated with the specified instance. - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCommandsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCommandsInput) GoString() string { - return s.String() -} - -// SetCommandIds sets the CommandIds field's value. -func (s *DescribeCommandsInput) SetCommandIds(v []*string) *DescribeCommandsInput { - s.CommandIds = v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *DescribeCommandsInput) SetDeploymentId(v string) *DescribeCommandsInput { - s.DeploymentId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeCommandsInput) SetInstanceId(v string) *DescribeCommandsInput { - s.InstanceId = &v - return s -} - -// Contains the response to a DescribeCommands request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeCommandsResult -type DescribeCommandsOutput struct { - _ struct{} `type:"structure"` - - // An array of Command objects that describe each of the specified commands. - Commands []*Command `type:"list"` -} - -// String returns the string representation -func (s DescribeCommandsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCommandsOutput) GoString() string { - return s.String() -} - -// SetCommands sets the Commands field's value. -func (s *DescribeCommandsOutput) SetCommands(v []*Command) *DescribeCommandsOutput { - s.Commands = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeDeploymentsRequest -type DescribeDeploymentsInput struct { - _ struct{} `type:"structure"` - - // The app ID. If you include this parameter, DescribeDeployments returns a - // description of the commands associated with the specified app. - AppId *string `type:"string"` - - // An array of deployment IDs to be described. If you include this parameter, - // DescribeDeployments returns a description of the specified deployments. Otherwise, - // it returns a description of every deployment. - DeploymentIds []*string `type:"list"` - - // The stack ID. If you include this parameter, DescribeDeployments returns - // a description of the commands associated with the specified stack. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDeploymentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeploymentsInput) GoString() string { - return s.String() -} - -// SetAppId sets the AppId field's value. -func (s *DescribeDeploymentsInput) SetAppId(v string) *DescribeDeploymentsInput { - s.AppId = &v - return s -} - -// SetDeploymentIds sets the DeploymentIds field's value. -func (s *DescribeDeploymentsInput) SetDeploymentIds(v []*string) *DescribeDeploymentsInput { - s.DeploymentIds = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeDeploymentsInput) SetStackId(v string) *DescribeDeploymentsInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeDeployments request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeDeploymentsResult -type DescribeDeploymentsOutput struct { - _ struct{} `type:"structure"` - - // An array of Deployment objects that describe the deployments. - Deployments []*Deployment `type:"list"` -} - -// String returns the string representation -func (s DescribeDeploymentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeploymentsOutput) GoString() string { - return s.String() -} - -// SetDeployments sets the Deployments field's value. -func (s *DescribeDeploymentsOutput) SetDeployments(v []*Deployment) *DescribeDeploymentsOutput { - s.Deployments = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeEcsClustersRequest -type DescribeEcsClustersInput struct { - _ struct{} `type:"structure"` - - // A list of ARNs, one for each cluster to be described. - EcsClusterArns []*string `type:"list"` - - // To receive a paginated response, use this parameter to specify the maximum - // number of results to be returned with a single call. If the number of available - // results exceeds this maximum, the response includes a NextToken value that - // you can assign to the NextToken request parameter to get the next set of - // results. - MaxResults *int64 `type:"integer"` - - // If the previous paginated request did not return all of the remaining results, - // the response object'sNextToken parameter value is set to a token. To retrieve - // the next set of results, call DescribeEcsClusters again and assign that token - // to the request object's NextToken parameter. If there are no remaining results, - // the previous response object's NextToken parameter is set to null. - NextToken *string `type:"string"` - - // A stack ID. DescribeEcsClusters returns a description of the cluster that - // is registered with the stack. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEcsClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEcsClustersInput) GoString() string { - return s.String() -} - -// SetEcsClusterArns sets the EcsClusterArns field's value. -func (s *DescribeEcsClustersInput) SetEcsClusterArns(v []*string) *DescribeEcsClustersInput { - s.EcsClusterArns = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeEcsClustersInput) SetMaxResults(v int64) *DescribeEcsClustersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEcsClustersInput) SetNextToken(v string) *DescribeEcsClustersInput { - s.NextToken = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeEcsClustersInput) SetStackId(v string) *DescribeEcsClustersInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeEcsClusters request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeEcsClustersResult -type DescribeEcsClustersOutput struct { - _ struct{} `type:"structure"` - - // A list of EcsCluster objects containing the cluster descriptions. - EcsClusters []*EcsCluster `type:"list"` - - // If a paginated request does not return all of the remaining results, this - // parameter is set to a token that you can assign to the request object's NextToken - // parameter to retrieve the next set of results. If the previous paginated - // request returned all of the remaining results, this parameter is set to null. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEcsClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEcsClustersOutput) GoString() string { - return s.String() -} - -// SetEcsClusters sets the EcsClusters field's value. -func (s *DescribeEcsClustersOutput) SetEcsClusters(v []*EcsCluster) *DescribeEcsClustersOutput { - s.EcsClusters = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEcsClustersOutput) SetNextToken(v string) *DescribeEcsClustersOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticIpsRequest -type DescribeElasticIpsInput struct { - _ struct{} `type:"structure"` - - // The instance ID. If you include this parameter, DescribeElasticIps returns - // a description of the Elastic IP addresses associated with the specified instance. - InstanceId *string `type:"string"` - - // An array of Elastic IP addresses to be described. If you include this parameter, - // DescribeElasticIps returns a description of the specified Elastic IP addresses. - // Otherwise, it returns a description of every Elastic IP address. - Ips []*string `type:"list"` - - // A stack ID. If you include this parameter, DescribeElasticIps returns a description - // of the Elastic IP addresses that are registered with the specified stack. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeElasticIpsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticIpsInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeElasticIpsInput) SetInstanceId(v string) *DescribeElasticIpsInput { - s.InstanceId = &v - return s -} - -// SetIps sets the Ips field's value. -func (s *DescribeElasticIpsInput) SetIps(v []*string) *DescribeElasticIpsInput { - s.Ips = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeElasticIpsInput) SetStackId(v string) *DescribeElasticIpsInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeElasticIps request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticIpsResult -type DescribeElasticIpsOutput struct { - _ struct{} `type:"structure"` - - // An ElasticIps object that describes the specified Elastic IP addresses. - ElasticIps []*ElasticIp `type:"list"` -} - -// String returns the string representation -func (s DescribeElasticIpsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticIpsOutput) GoString() string { - return s.String() -} - -// SetElasticIps sets the ElasticIps field's value. -func (s *DescribeElasticIpsOutput) SetElasticIps(v []*ElasticIp) *DescribeElasticIpsOutput { - s.ElasticIps = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticLoadBalancersRequest -type DescribeElasticLoadBalancersInput struct { - _ struct{} `type:"structure"` - - // A list of layer IDs. The action describes the Elastic Load Balancing instances - // for the specified layers. - LayerIds []*string `type:"list"` - - // A stack ID. The action describes the stack's Elastic Load Balancing instances. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeElasticLoadBalancersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticLoadBalancersInput) GoString() string { - return s.String() -} - -// SetLayerIds sets the LayerIds field's value. -func (s *DescribeElasticLoadBalancersInput) SetLayerIds(v []*string) *DescribeElasticLoadBalancersInput { - s.LayerIds = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeElasticLoadBalancersInput) SetStackId(v string) *DescribeElasticLoadBalancersInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeElasticLoadBalancers request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticLoadBalancersResult -type DescribeElasticLoadBalancersOutput struct { - _ struct{} `type:"structure"` - - // A list of ElasticLoadBalancer objects that describe the specified Elastic - // Load Balancing instances. - ElasticLoadBalancers []*ElasticLoadBalancer `type:"list"` -} - -// String returns the string representation -func (s DescribeElasticLoadBalancersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticLoadBalancersOutput) GoString() string { - return s.String() -} - -// SetElasticLoadBalancers sets the ElasticLoadBalancers field's value. -func (s *DescribeElasticLoadBalancersOutput) SetElasticLoadBalancers(v []*ElasticLoadBalancer) *DescribeElasticLoadBalancersOutput { - s.ElasticLoadBalancers = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeInstancesRequest -type DescribeInstancesInput struct { - _ struct{} `type:"structure"` - - // An array of instance IDs to be described. If you use this parameter, DescribeInstances - // returns a description of the specified instances. Otherwise, it returns a - // description of every instance. - InstanceIds []*string `type:"list"` - - // A layer ID. If you use this parameter, DescribeInstances returns descriptions - // of the instances associated with the specified layer. - LayerId *string `type:"string"` - - // A stack ID. If you use this parameter, DescribeInstances returns descriptions - // of the instances associated with the specified stack. - StackId *string `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() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstancesInput) SetInstanceIds(v []*string) *DescribeInstancesInput { - s.InstanceIds = v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *DescribeInstancesInput) SetLayerId(v string) *DescribeInstancesInput { - s.LayerId = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeInstancesInput) SetStackId(v string) *DescribeInstancesInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeInstances request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeInstancesResult -type DescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - // An array of Instance objects that describe the instances. - Instances []*Instance `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() -} - -// SetInstances sets the Instances field's value. -func (s *DescribeInstancesOutput) SetInstances(v []*Instance) *DescribeInstancesOutput { - s.Instances = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLayersRequest -type DescribeLayersInput struct { - _ struct{} `type:"structure"` - - // An array of layer IDs that specify the layers to be described. If you omit - // this parameter, DescribeLayers returns a description of every layer in the - // specified stack. - LayerIds []*string `type:"list"` - - // The stack ID. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLayersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLayersInput) GoString() string { - return s.String() -} - -// SetLayerIds sets the LayerIds field's value. -func (s *DescribeLayersInput) SetLayerIds(v []*string) *DescribeLayersInput { - s.LayerIds = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeLayersInput) SetStackId(v string) *DescribeLayersInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeLayers request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLayersResult -type DescribeLayersOutput struct { - _ struct{} `type:"structure"` - - // An array of Layer objects that describe the layers. - Layers []*Layer `type:"list"` -} - -// String returns the string representation -func (s DescribeLayersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLayersOutput) GoString() string { - return s.String() -} - -// SetLayers sets the Layers field's value. -func (s *DescribeLayersOutput) SetLayers(v []*Layer) *DescribeLayersOutput { - s.Layers = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLoadBasedAutoScalingRequest -type DescribeLoadBasedAutoScalingInput struct { - _ struct{} `type:"structure"` - - // An array of layer IDs. - // - // LayerIds is a required field - LayerIds []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeLoadBasedAutoScalingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBasedAutoScalingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLoadBasedAutoScalingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBasedAutoScalingInput"} - if s.LayerIds == nil { - invalidParams.Add(request.NewErrParamRequired("LayerIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLayerIds sets the LayerIds field's value. -func (s *DescribeLoadBasedAutoScalingInput) SetLayerIds(v []*string) *DescribeLoadBasedAutoScalingInput { - s.LayerIds = v - return s -} - -// Contains the response to a DescribeLoadBasedAutoScaling request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLoadBasedAutoScalingResult -type DescribeLoadBasedAutoScalingOutput struct { - _ struct{} `type:"structure"` - - // An array of LoadBasedAutoScalingConfiguration objects that describe each - // layer's configuration. - LoadBasedAutoScalingConfigurations []*LoadBasedAutoScalingConfiguration `type:"list"` -} - -// String returns the string representation -func (s DescribeLoadBasedAutoScalingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoadBasedAutoScalingOutput) GoString() string { - return s.String() -} - -// SetLoadBasedAutoScalingConfigurations sets the LoadBasedAutoScalingConfigurations field's value. -func (s *DescribeLoadBasedAutoScalingOutput) SetLoadBasedAutoScalingConfigurations(v []*LoadBasedAutoScalingConfiguration) *DescribeLoadBasedAutoScalingOutput { - s.LoadBasedAutoScalingConfigurations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeMyUserProfileInput -type DescribeMyUserProfileInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeMyUserProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMyUserProfileInput) GoString() string { - return s.String() -} - -// Contains the response to a DescribeMyUserProfile request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeMyUserProfileResult -type DescribeMyUserProfileOutput struct { - _ struct{} `type:"structure"` - - // A UserProfile object that describes the user's SSH information. - UserProfile *SelfUserProfile `type:"structure"` -} - -// String returns the string representation -func (s DescribeMyUserProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMyUserProfileOutput) GoString() string { - return s.String() -} - -// SetUserProfile sets the UserProfile field's value. -func (s *DescribeMyUserProfileOutput) SetUserProfile(v *SelfUserProfile) *DescribeMyUserProfileOutput { - s.UserProfile = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribePermissionsRequest -type DescribePermissionsInput struct { - _ struct{} `type:"structure"` - - // The user's IAM ARN. This can also be a federated user's ARN. For more information - // about IAM ARNs, see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - IamUserArn *string `type:"string"` - - // The stack ID. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribePermissionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePermissionsInput) GoString() string { - return s.String() -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *DescribePermissionsInput) SetIamUserArn(v string) *DescribePermissionsInput { - s.IamUserArn = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribePermissionsInput) SetStackId(v string) *DescribePermissionsInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribePermissions request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribePermissionsResult -type DescribePermissionsOutput struct { - _ struct{} `type:"structure"` - - // An array of Permission objects that describe the stack permissions. - // - // * If the request object contains only a stack ID, the array contains a - // Permission object with permissions for each of the stack IAM ARNs. - // - // * If the request object contains only an IAM ARN, the array contains a - // Permission object with permissions for each of the user's stack IDs. - // - // * If the request contains a stack ID and an IAM ARN, the array contains - // a single Permission object with permissions for the specified stack and - // IAM ARN. - Permissions []*Permission `type:"list"` -} - -// String returns the string representation -func (s DescribePermissionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePermissionsOutput) GoString() string { - return s.String() -} - -// SetPermissions sets the Permissions field's value. -func (s *DescribePermissionsOutput) SetPermissions(v []*Permission) *DescribePermissionsOutput { - s.Permissions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRaidArraysRequest -type DescribeRaidArraysInput struct { - _ struct{} `type:"structure"` - - // The instance ID. If you use this parameter, DescribeRaidArrays returns descriptions - // of the RAID arrays associated with the specified instance. - InstanceId *string `type:"string"` - - // An array of RAID array IDs. If you use this parameter, DescribeRaidArrays - // returns descriptions of the specified arrays. Otherwise, it returns a description - // of every array. - RaidArrayIds []*string `type:"list"` - - // The stack ID. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeRaidArraysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRaidArraysInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeRaidArraysInput) SetInstanceId(v string) *DescribeRaidArraysInput { - s.InstanceId = &v - return s -} - -// SetRaidArrayIds sets the RaidArrayIds field's value. -func (s *DescribeRaidArraysInput) SetRaidArrayIds(v []*string) *DescribeRaidArraysInput { - s.RaidArrayIds = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeRaidArraysInput) SetStackId(v string) *DescribeRaidArraysInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeRaidArrays request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRaidArraysResult -type DescribeRaidArraysOutput struct { - _ struct{} `type:"structure"` - - // A RaidArrays object that describes the specified RAID arrays. - RaidArrays []*RaidArray `type:"list"` -} - -// String returns the string representation -func (s DescribeRaidArraysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRaidArraysOutput) GoString() string { - return s.String() -} - -// SetRaidArrays sets the RaidArrays field's value. -func (s *DescribeRaidArraysOutput) SetRaidArrays(v []*RaidArray) *DescribeRaidArraysOutput { - s.RaidArrays = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRdsDbInstancesRequest -type DescribeRdsDbInstancesInput struct { - _ struct{} `type:"structure"` - - // An array containing the ARNs of the instances to be described. - RdsDbInstanceArns []*string `type:"list"` - - // The stack ID that the instances are registered with. The operation returns - // descriptions of all registered Amazon RDS instances. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeRdsDbInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRdsDbInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRdsDbInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRdsDbInstancesInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRdsDbInstanceArns sets the RdsDbInstanceArns field's value. -func (s *DescribeRdsDbInstancesInput) SetRdsDbInstanceArns(v []*string) *DescribeRdsDbInstancesInput { - s.RdsDbInstanceArns = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeRdsDbInstancesInput) SetStackId(v string) *DescribeRdsDbInstancesInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeRdsDbInstances request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRdsDbInstancesResult -type DescribeRdsDbInstancesOutput struct { - _ struct{} `type:"structure"` - - // An a array of RdsDbInstance objects that describe the instances. - RdsDbInstances []*RdsDbInstance `type:"list"` -} - -// String returns the string representation -func (s DescribeRdsDbInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRdsDbInstancesOutput) GoString() string { - return s.String() -} - -// SetRdsDbInstances sets the RdsDbInstances field's value. -func (s *DescribeRdsDbInstancesOutput) SetRdsDbInstances(v []*RdsDbInstance) *DescribeRdsDbInstancesOutput { - s.RdsDbInstances = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeServiceErrorsRequest -type DescribeServiceErrorsInput struct { - _ struct{} `type:"structure"` - - // The instance ID. If you use this parameter, DescribeServiceErrors returns - // descriptions of the errors associated with the specified instance. - InstanceId *string `type:"string"` - - // An array of service error IDs. If you use this parameter, DescribeServiceErrors - // returns descriptions of the specified errors. Otherwise, it returns a description - // of every error. - ServiceErrorIds []*string `type:"list"` - - // The stack ID. If you use this parameter, DescribeServiceErrors returns descriptions - // of the errors associated with the specified stack. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeServiceErrorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeServiceErrorsInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeServiceErrorsInput) SetInstanceId(v string) *DescribeServiceErrorsInput { - s.InstanceId = &v - return s -} - -// SetServiceErrorIds sets the ServiceErrorIds field's value. -func (s *DescribeServiceErrorsInput) SetServiceErrorIds(v []*string) *DescribeServiceErrorsInput { - s.ServiceErrorIds = v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeServiceErrorsInput) SetStackId(v string) *DescribeServiceErrorsInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeServiceErrors request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeServiceErrorsResult -type DescribeServiceErrorsOutput struct { - _ struct{} `type:"structure"` - - // An array of ServiceError objects that describe the specified service errors. - ServiceErrors []*ServiceError `type:"list"` -} - -// String returns the string representation -func (s DescribeServiceErrorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeServiceErrorsOutput) GoString() string { - return s.String() -} - -// SetServiceErrors sets the ServiceErrors field's value. -func (s *DescribeServiceErrorsOutput) SetServiceErrors(v []*ServiceError) *DescribeServiceErrorsOutput { - s.ServiceErrors = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackProvisioningParametersRequest -type DescribeStackProvisioningParametersInput struct { - _ struct{} `type:"structure"` - - // The stack ID - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeStackProvisioningParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackProvisioningParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackProvisioningParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackProvisioningParametersInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackId sets the StackId field's value. -func (s *DescribeStackProvisioningParametersInput) SetStackId(v string) *DescribeStackProvisioningParametersInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeStackProvisioningParameters request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackProvisioningParametersResult -type DescribeStackProvisioningParametersOutput struct { - _ struct{} `type:"structure"` - - // The AWS OpsWorks agent installer's URL. - AgentInstallerUrl *string `type:"string"` - - // An embedded object that contains the provisioning parameters. - Parameters map[string]*string `type:"map"` -} - -// String returns the string representation -func (s DescribeStackProvisioningParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackProvisioningParametersOutput) GoString() string { - return s.String() -} - -// SetAgentInstallerUrl sets the AgentInstallerUrl field's value. -func (s *DescribeStackProvisioningParametersOutput) SetAgentInstallerUrl(v string) *DescribeStackProvisioningParametersOutput { - s.AgentInstallerUrl = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DescribeStackProvisioningParametersOutput) SetParameters(v map[string]*string) *DescribeStackProvisioningParametersOutput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackSummaryRequest -type DescribeStackSummaryInput struct { - _ struct{} `type:"structure"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeStackSummaryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackSummaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackSummaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackSummaryInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackId sets the StackId field's value. -func (s *DescribeStackSummaryInput) SetStackId(v string) *DescribeStackSummaryInput { - s.StackId = &v - return s -} - -// Contains the response to a DescribeStackSummary request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackSummaryResult -type DescribeStackSummaryOutput struct { - _ struct{} `type:"structure"` - - // A StackSummary object that contains the results. - StackSummary *StackSummary `type:"structure"` -} - -// String returns the string representation -func (s DescribeStackSummaryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackSummaryOutput) GoString() string { - return s.String() -} - -// SetStackSummary sets the StackSummary field's value. -func (s *DescribeStackSummaryOutput) SetStackSummary(v *StackSummary) *DescribeStackSummaryOutput { - s.StackSummary = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStacksRequest -type DescribeStacksInput struct { - _ struct{} `type:"structure"` - - // An array of stack IDs that specify the stacks to be described. If you omit - // this parameter, DescribeStacks returns a description of every stack. - StackIds []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeStacksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStacksInput) GoString() string { - return s.String() -} - -// SetStackIds sets the StackIds field's value. -func (s *DescribeStacksInput) SetStackIds(v []*string) *DescribeStacksInput { - s.StackIds = v - return s -} - -// Contains the response to a DescribeStacks request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStacksResult -type DescribeStacksOutput struct { - _ struct{} `type:"structure"` - - // An array of Stack objects that describe the stacks. - Stacks []*Stack `type:"list"` -} - -// String returns the string representation -func (s DescribeStacksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStacksOutput) GoString() string { - return s.String() -} - -// SetStacks sets the Stacks field's value. -func (s *DescribeStacksOutput) SetStacks(v []*Stack) *DescribeStacksOutput { - s.Stacks = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeTimeBasedAutoScalingRequest -type DescribeTimeBasedAutoScalingInput struct { - _ struct{} `type:"structure"` - - // An array of instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeTimeBasedAutoScalingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTimeBasedAutoScalingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTimeBasedAutoScalingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTimeBasedAutoScalingInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeTimeBasedAutoScalingInput) SetInstanceIds(v []*string) *DescribeTimeBasedAutoScalingInput { - s.InstanceIds = v - return s -} - -// Contains the response to a DescribeTimeBasedAutoScaling request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeTimeBasedAutoScalingResult -type DescribeTimeBasedAutoScalingOutput struct { - _ struct{} `type:"structure"` - - // An array of TimeBasedAutoScalingConfiguration objects that describe the configuration - // for the specified instances. - TimeBasedAutoScalingConfigurations []*TimeBasedAutoScalingConfiguration `type:"list"` -} - -// String returns the string representation -func (s DescribeTimeBasedAutoScalingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTimeBasedAutoScalingOutput) GoString() string { - return s.String() -} - -// SetTimeBasedAutoScalingConfigurations sets the TimeBasedAutoScalingConfigurations field's value. -func (s *DescribeTimeBasedAutoScalingOutput) SetTimeBasedAutoScalingConfigurations(v []*TimeBasedAutoScalingConfiguration) *DescribeTimeBasedAutoScalingOutput { - s.TimeBasedAutoScalingConfigurations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeUserProfilesRequest -type DescribeUserProfilesInput struct { - _ struct{} `type:"structure"` - - // An array of IAM or federated user ARNs that identify the users to be described. - IamUserArns []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeUserProfilesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeUserProfilesInput) GoString() string { - return s.String() -} - -// SetIamUserArns sets the IamUserArns field's value. -func (s *DescribeUserProfilesInput) SetIamUserArns(v []*string) *DescribeUserProfilesInput { - s.IamUserArns = v - return s -} - -// Contains the response to a DescribeUserProfiles request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeUserProfilesResult -type DescribeUserProfilesOutput struct { - _ struct{} `type:"structure"` - - // A Users object that describes the specified users. - UserProfiles []*UserProfile `type:"list"` -} - -// String returns the string representation -func (s DescribeUserProfilesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeUserProfilesOutput) GoString() string { - return s.String() -} - -// SetUserProfiles sets the UserProfiles field's value. -func (s *DescribeUserProfilesOutput) SetUserProfiles(v []*UserProfile) *DescribeUserProfilesOutput { - s.UserProfiles = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeVolumesRequest -type DescribeVolumesInput struct { - _ struct{} `type:"structure"` - - // The instance ID. If you use this parameter, DescribeVolumes returns descriptions - // of the volumes associated with the specified instance. - InstanceId *string `type:"string"` - - // The RAID array ID. If you use this parameter, DescribeVolumes returns descriptions - // of the volumes associated with the specified RAID array. - RaidArrayId *string `type:"string"` - - // A stack ID. The action describes the stack's registered Amazon EBS volumes. - StackId *string `type:"string"` - - // Am array of volume IDs. If you use this parameter, DescribeVolumes returns - // descriptions of the specified volumes. Otherwise, it returns a description - // of every volume. - VolumeIds []*string `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() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeVolumesInput) SetInstanceId(v string) *DescribeVolumesInput { - s.InstanceId = &v - return s -} - -// SetRaidArrayId sets the RaidArrayId field's value. -func (s *DescribeVolumesInput) SetRaidArrayId(v string) *DescribeVolumesInput { - s.RaidArrayId = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *DescribeVolumesInput) SetStackId(v string) *DescribeVolumesInput { - s.StackId = &v - return s -} - -// SetVolumeIds sets the VolumeIds field's value. -func (s *DescribeVolumesInput) SetVolumeIds(v []*string) *DescribeVolumesInput { - s.VolumeIds = v - return s -} - -// Contains the response to a DescribeVolumes request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeVolumesResult -type DescribeVolumesOutput struct { - _ struct{} `type:"structure"` - - // An array of volume IDs. - Volumes []*Volume `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() -} - -// SetVolumes sets the Volumes field's value. -func (s *DescribeVolumesOutput) SetVolumes(v []*Volume) *DescribeVolumesOutput { - s.Volumes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DetachElasticLoadBalancerRequest -type DetachElasticLoadBalancerInput struct { - _ struct{} `type:"structure"` - - // The Elastic Load Balancing instance's name. - // - // ElasticLoadBalancerName is a required field - ElasticLoadBalancerName *string `type:"string" required:"true"` - - // The ID of the layer that the Elastic Load Balancing instance is attached - // to. - // - // LayerId is a required field - LayerId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachElasticLoadBalancerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachElasticLoadBalancerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachElasticLoadBalancerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachElasticLoadBalancerInput"} - if s.ElasticLoadBalancerName == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticLoadBalancerName")) - } - if s.LayerId == nil { - invalidParams.Add(request.NewErrParamRequired("LayerId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetElasticLoadBalancerName sets the ElasticLoadBalancerName field's value. -func (s *DetachElasticLoadBalancerInput) SetElasticLoadBalancerName(v string) *DetachElasticLoadBalancerInput { - s.ElasticLoadBalancerName = &v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *DetachElasticLoadBalancerInput) SetLayerId(v string) *DetachElasticLoadBalancerInput { - s.LayerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DetachElasticLoadBalancerOutput -type DetachElasticLoadBalancerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachElasticLoadBalancerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachElasticLoadBalancerOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DisassociateElasticIpRequest -type DisassociateElasticIpInput struct { - _ struct{} `type:"structure"` - - // The Elastic IP address. - // - // ElasticIp is a required field - ElasticIp *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisassociateElasticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateElasticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateElasticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateElasticIpInput"} - if s.ElasticIp == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticIp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *DisassociateElasticIpInput) SetElasticIp(v string) *DisassociateElasticIpInput { - s.ElasticIp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DisassociateElasticIpOutput -type DisassociateElasticIpOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisassociateElasticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateElasticIpOutput) GoString() string { - return s.String() -} - -// Describes an Amazon EBS volume. This data type maps directly to the Amazon -// EC2 EbsBlockDevice (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html) -// data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/EbsBlockDevice -type EbsBlockDevice struct { - _ struct{} `type:"structure"` - - // Whether the volume is deleted on instance termination. - DeleteOnTermination *bool `type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For more information, see EbsBlockDevice (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html). - Iops *int64 `type:"integer"` - - // The snapshot ID. - SnapshotId *string `type:"string"` - - // The volume size, in GiB. For more information, see EbsBlockDevice (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html). - VolumeSize *int64 `type:"integer"` - - // The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned - // IOPS (SSD) volumes, and standard for Magnetic volumes. - VolumeType *string `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 -} - -// 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 registered Amazon ECS cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/EcsCluster -type EcsCluster struct { - _ struct{} `type:"structure"` - - // The cluster's ARN. - EcsClusterArn *string `type:"string"` - - // The cluster name. - EcsClusterName *string `type:"string"` - - // The time and date that the cluster was registered with the stack. - RegisteredAt *string `type:"string"` - - // The stack ID. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s EcsCluster) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EcsCluster) GoString() string { - return s.String() -} - -// SetEcsClusterArn sets the EcsClusterArn field's value. -func (s *EcsCluster) SetEcsClusterArn(v string) *EcsCluster { - s.EcsClusterArn = &v - return s -} - -// SetEcsClusterName sets the EcsClusterName field's value. -func (s *EcsCluster) SetEcsClusterName(v string) *EcsCluster { - s.EcsClusterName = &v - return s -} - -// SetRegisteredAt sets the RegisteredAt field's value. -func (s *EcsCluster) SetRegisteredAt(v string) *EcsCluster { - s.RegisteredAt = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *EcsCluster) SetStackId(v string) *EcsCluster { - s.StackId = &v - return s -} - -// Describes an Elastic IP address. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ElasticIp -type ElasticIp struct { - _ struct{} `type:"structure"` - - // The domain. - Domain *string `type:"string"` - - // The ID of the instance that the address is attached to. - InstanceId *string `type:"string"` - - // The IP address. - Ip *string `type:"string"` - - // The name. - Name *string `type:"string"` - - // The AWS region. For more information, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). - Region *string `type:"string"` -} - -// String returns the string representation -func (s ElasticIp) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticIp) GoString() string { - return s.String() -} - -// SetDomain sets the Domain field's value. -func (s *ElasticIp) SetDomain(v string) *ElasticIp { - s.Domain = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ElasticIp) SetInstanceId(v string) *ElasticIp { - s.InstanceId = &v - return s -} - -// SetIp sets the Ip field's value. -func (s *ElasticIp) SetIp(v string) *ElasticIp { - s.Ip = &v - return s -} - -// SetName sets the Name field's value. -func (s *ElasticIp) SetName(v string) *ElasticIp { - s.Name = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *ElasticIp) SetRegion(v string) *ElasticIp { - s.Region = &v - return s -} - -// Describes an Elastic Load Balancing instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ElasticLoadBalancer -type ElasticLoadBalancer struct { - _ struct{} `type:"structure"` - - // A list of Availability Zones. - AvailabilityZones []*string `type:"list"` - - // The instance's public DNS name. - DnsName *string `type:"string"` - - // A list of the EC2 instances that the Elastic Load Balancing instance is managing - // traffic for. - Ec2InstanceIds []*string `type:"list"` - - // The Elastic Load Balancing instance's name. - ElasticLoadBalancerName *string `type:"string"` - - // The ID of the layer that the instance is attached to. - LayerId *string `type:"string"` - - // The instance's AWS region. - Region *string `type:"string"` - - // The ID of the stack that the instance is associated with. - StackId *string `type:"string"` - - // A list of subnet IDs, if the stack is running in a VPC. - SubnetIds []*string `type:"list"` - - // The VPC ID. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s ElasticLoadBalancer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticLoadBalancer) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *ElasticLoadBalancer) SetAvailabilityZones(v []*string) *ElasticLoadBalancer { - s.AvailabilityZones = v - return s -} - -// SetDnsName sets the DnsName field's value. -func (s *ElasticLoadBalancer) SetDnsName(v string) *ElasticLoadBalancer { - s.DnsName = &v - return s -} - -// SetEc2InstanceIds sets the Ec2InstanceIds field's value. -func (s *ElasticLoadBalancer) SetEc2InstanceIds(v []*string) *ElasticLoadBalancer { - s.Ec2InstanceIds = v - return s -} - -// SetElasticLoadBalancerName sets the ElasticLoadBalancerName field's value. -func (s *ElasticLoadBalancer) SetElasticLoadBalancerName(v string) *ElasticLoadBalancer { - s.ElasticLoadBalancerName = &v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *ElasticLoadBalancer) SetLayerId(v string) *ElasticLoadBalancer { - s.LayerId = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *ElasticLoadBalancer) SetRegion(v string) *ElasticLoadBalancer { - s.Region = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *ElasticLoadBalancer) SetStackId(v string) *ElasticLoadBalancer { - s.StackId = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *ElasticLoadBalancer) SetSubnetIds(v []*string) *ElasticLoadBalancer { - s.SubnetIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ElasticLoadBalancer) SetVpcId(v string) *ElasticLoadBalancer { - s.VpcId = &v - return s -} - -// Represents an app's environment variable. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/EnvironmentVariable -type EnvironmentVariable struct { - _ struct{} `type:"structure"` - - // (Required) The environment variable's name, which can consist of up to 64 - // characters and must be specified. The name can contain upper- and lowercase - // letters, numbers, and underscores (_), but it must start with a letter or - // underscore. - // - // Key is a required field - Key *string `type:"string" required:"true"` - - // (Optional) Whether the variable's value will be returned by the DescribeApps - // action. To conceal an environment variable's value, set Secure to true. DescribeApps - // then returns *****FILTERED***** instead of the actual value. The default - // value for Secure is false. - Secure *bool `type:"boolean"` - - // (Optional) The environment variable's value, which can be left empty. If - // you specify a value, it can contain up to 256 characters, which must all - // be printable. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s EnvironmentVariable) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnvironmentVariable) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnvironmentVariable) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnvironmentVariable"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - 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 *EnvironmentVariable) SetKey(v string) *EnvironmentVariable { - s.Key = &v - return s -} - -// SetSecure sets the Secure field's value. -func (s *EnvironmentVariable) SetSecure(v bool) *EnvironmentVariable { - s.Secure = &v - return s -} - -// SetValue sets the Value field's value. -func (s *EnvironmentVariable) SetValue(v string) *EnvironmentVariable { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GetHostnameSuggestionRequest -type GetHostnameSuggestionInput struct { - _ struct{} `type:"structure"` - - // The layer ID. - // - // LayerId is a required field - LayerId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetHostnameSuggestionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostnameSuggestionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetHostnameSuggestionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetHostnameSuggestionInput"} - if s.LayerId == nil { - invalidParams.Add(request.NewErrParamRequired("LayerId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLayerId sets the LayerId field's value. -func (s *GetHostnameSuggestionInput) SetLayerId(v string) *GetHostnameSuggestionInput { - s.LayerId = &v - return s -} - -// Contains the response to a GetHostnameSuggestion request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GetHostnameSuggestionResult -type GetHostnameSuggestionOutput struct { - _ struct{} `type:"structure"` - - // The generated host name. - Hostname *string `type:"string"` - - // The layer ID. - LayerId *string `type:"string"` -} - -// String returns the string representation -func (s GetHostnameSuggestionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostnameSuggestionOutput) GoString() string { - return s.String() -} - -// SetHostname sets the Hostname field's value. -func (s *GetHostnameSuggestionOutput) SetHostname(v string) *GetHostnameSuggestionOutput { - s.Hostname = &v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *GetHostnameSuggestionOutput) SetLayerId(v string) *GetHostnameSuggestionOutput { - s.LayerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GrantAccessRequest -type GrantAccessInput struct { - _ struct{} `type:"structure"` - - // The instance's AWS OpsWorks ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The length of time (in minutes) that the grant is valid. When the grant expires - // at the end of this period, the user will no longer be able to use the credentials - // to log in. If the user is logged in at the time, he or she automatically - // will be logged out. - ValidForInMinutes *int64 `min:"60" type:"integer"` -} - -// String returns the string representation -func (s GrantAccessInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GrantAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GrantAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GrantAccessInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.ValidForInMinutes != nil && *s.ValidForInMinutes < 60 { - invalidParams.Add(request.NewErrParamMinValue("ValidForInMinutes", 60)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GrantAccessInput) SetInstanceId(v string) *GrantAccessInput { - s.InstanceId = &v - return s -} - -// SetValidForInMinutes sets the ValidForInMinutes field's value. -func (s *GrantAccessInput) SetValidForInMinutes(v int64) *GrantAccessInput { - s.ValidForInMinutes = &v - return s -} - -// Contains the response to a GrantAccess request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GrantAccessResult -type GrantAccessOutput struct { - _ struct{} `type:"structure"` - - // A TemporaryCredential object that contains the data needed to log in to the - // instance by RDP clients, such as the Microsoft Remote Desktop Connection. - TemporaryCredential *TemporaryCredential `type:"structure"` -} - -// String returns the string representation -func (s GrantAccessOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GrantAccessOutput) GoString() string { - return s.String() -} - -// SetTemporaryCredential sets the TemporaryCredential field's value. -func (s *GrantAccessOutput) SetTemporaryCredential(v *TemporaryCredential) *GrantAccessOutput { - s.TemporaryCredential = v - return s -} - -// Describes an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Instance -type Instance struct { - _ struct{} `type:"structure"` - - // The agent version. This parameter is set to INHERIT if the instance inherits - // the default stack setting or to a a version number for a fixed agent version. - AgentVersion *string `type:"string"` - - // A custom AMI ID to be used to create the instance. For more information, - // see Instances (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html) - AmiId *string `type:"string"` - - // The instance architecture: "i386" or "x86_64". - Architecture *string `type:"string" enum:"Architecture"` - - // For load-based or time-based instances, the type. - AutoScalingType *string `type:"string" enum:"AutoScalingType"` - - // The instance Availability Zone. For more information, see Regions and Endpoints - // (http://docs.aws.amazon.com/general/latest/gr/rande.html). - AvailabilityZone *string `type:"string"` - - // An array of BlockDeviceMapping objects that specify the instance's block - // device mappings. - BlockDeviceMappings []*BlockDeviceMapping `type:"list"` - - // The time that the instance was created. - CreatedAt *string `type:"string"` - - // Whether this is an Amazon EBS-optimized instance. - EbsOptimized *bool `type:"boolean"` - - // The ID of the associated Amazon EC2 instance. - Ec2InstanceId *string `type:"string"` - - // For container instances, the Amazon ECS cluster's ARN. - EcsClusterArn *string `type:"string"` - - // For container instances, the instance's ARN. - EcsContainerInstanceArn *string `type:"string"` - - // The instance Elastic IP address (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html). - ElasticIp *string `type:"string"` - - // The instance host name. - Hostname *string `type:"string"` - - // For registered instances, the infrastructure class: ec2 or on-premises. - InfrastructureClass *string `type:"string"` - - // Whether to install operating system and package updates when the instance - // boots. The default value is true. If this value is set to false, you must - // then update your instances manually by using CreateDeployment to run the - // update_dependencies stack command or by manually running yum (Amazon Linux) - // or apt-get (Ubuntu) on the instances. - // - // We strongly recommend using the default value of true, to ensure that your - // instances have the latest security updates. - InstallUpdatesOnBoot *bool `type:"boolean"` - - // The instance ID. - InstanceId *string `type:"string"` - - // The ARN of the instance's IAM profile. For more information about IAM ARNs, - // see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - InstanceProfileArn *string `type:"string"` - - // The instance type, such as t2.micro. - InstanceType *string `type:"string"` - - // The ID of the last service error. For more information, call DescribeServiceErrors. - LastServiceErrorId *string `type:"string"` - - // An array containing the instance layer IDs. - LayerIds []*string `type:"list"` - - // The instance's operating system. - Os *string `type:"string"` - - // The instance's platform. - Platform *string `type:"string"` - - // The The instance's private DNS name. - PrivateDns *string `type:"string"` - - // The instance's private IP address. - PrivateIp *string `type:"string"` - - // The instance public DNS name. - PublicDns *string `type:"string"` - - // The instance public IP address. - PublicIp *string `type:"string"` - - // For registered instances, who performed the registration. - RegisteredBy *string `type:"string"` - - // The instance's reported AWS OpsWorks agent version. - ReportedAgentVersion *string `type:"string"` - - // For registered instances, the reported operating system. - ReportedOs *ReportedOs `type:"structure"` - - // The instance's root device type. For more information, see Storage for the - // Root Device (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device). - RootDeviceType *string `type:"string" enum:"RootDeviceType"` - - // The root device volume ID. - RootDeviceVolumeId *string `type:"string"` - - // An array containing the instance security group IDs. - SecurityGroupIds []*string `type:"list"` - - // The SSH key's Deep Security Agent (DSA) fingerprint. - SshHostDsaKeyFingerprint *string `type:"string"` - - // The SSH key's RSA fingerprint. - SshHostRsaKeyFingerprint *string `type:"string"` - - // The instance's Amazon EC2 key-pair name. - SshKeyName *string `type:"string"` - - // The stack ID. - StackId *string `type:"string"` - - // The instance status: - // - // * booting - // - // * connection_lost - // - // * online - // - // * pending - // - // * rebooting - // - // * requested - // - // * running_setup - // - // * setup_failed - // - // * shutting_down - // - // * start_failed - // - // * stop_failed - // - // * stopped - // - // * stopping - // - // * terminated - // - // * terminating - Status *string `type:"string"` - - // The instance's subnet ID; applicable only if the stack is running in a VPC. - SubnetId *string `type:"string"` - - // The instance's tenancy option, such as dedicated or host. - Tenancy *string `type:"string"` - - // The instance's virtualization type: paravirtual or hvm. - VirtualizationType *string `type:"string" enum:"VirtualizationType"` -} - -// 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() -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *Instance) SetAgentVersion(v string) *Instance { - s.AgentVersion = &v - return s -} - -// SetAmiId sets the AmiId field's value. -func (s *Instance) SetAmiId(v string) *Instance { - s.AmiId = &v - return s -} - -// SetArchitecture sets the Architecture field's value. -func (s *Instance) SetArchitecture(v string) *Instance { - s.Architecture = &v - return s -} - -// SetAutoScalingType sets the AutoScalingType field's value. -func (s *Instance) SetAutoScalingType(v string) *Instance { - s.AutoScalingType = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Instance) SetAvailabilityZone(v string) *Instance { - s.AvailabilityZone = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *Instance) SetBlockDeviceMappings(v []*BlockDeviceMapping) *Instance { - s.BlockDeviceMappings = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Instance) SetCreatedAt(v string) *Instance { - s.CreatedAt = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *Instance) SetEbsOptimized(v bool) *Instance { - s.EbsOptimized = &v - return s -} - -// SetEc2InstanceId sets the Ec2InstanceId field's value. -func (s *Instance) SetEc2InstanceId(v string) *Instance { - s.Ec2InstanceId = &v - return s -} - -// SetEcsClusterArn sets the EcsClusterArn field's value. -func (s *Instance) SetEcsClusterArn(v string) *Instance { - s.EcsClusterArn = &v - return s -} - -// SetEcsContainerInstanceArn sets the EcsContainerInstanceArn field's value. -func (s *Instance) SetEcsContainerInstanceArn(v string) *Instance { - s.EcsContainerInstanceArn = &v - return s -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *Instance) SetElasticIp(v string) *Instance { - s.ElasticIp = &v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *Instance) SetHostname(v string) *Instance { - s.Hostname = &v - return s -} - -// SetInfrastructureClass sets the InfrastructureClass field's value. -func (s *Instance) SetInfrastructureClass(v string) *Instance { - s.InfrastructureClass = &v - return s -} - -// SetInstallUpdatesOnBoot sets the InstallUpdatesOnBoot field's value. -func (s *Instance) SetInstallUpdatesOnBoot(v bool) *Instance { - s.InstallUpdatesOnBoot = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Instance) SetInstanceId(v string) *Instance { - s.InstanceId = &v - return s -} - -// SetInstanceProfileArn sets the InstanceProfileArn field's value. -func (s *Instance) SetInstanceProfileArn(v string) *Instance { - s.InstanceProfileArn = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *Instance) SetInstanceType(v string) *Instance { - s.InstanceType = &v - return s -} - -// SetLastServiceErrorId sets the LastServiceErrorId field's value. -func (s *Instance) SetLastServiceErrorId(v string) *Instance { - s.LastServiceErrorId = &v - return s -} - -// SetLayerIds sets the LayerIds field's value. -func (s *Instance) SetLayerIds(v []*string) *Instance { - s.LayerIds = v - return s -} - -// SetOs sets the Os field's value. -func (s *Instance) SetOs(v string) *Instance { - s.Os = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *Instance) SetPlatform(v string) *Instance { - s.Platform = &v - return s -} - -// SetPrivateDns sets the PrivateDns field's value. -func (s *Instance) SetPrivateDns(v string) *Instance { - s.PrivateDns = &v - return s -} - -// SetPrivateIp sets the PrivateIp field's value. -func (s *Instance) SetPrivateIp(v string) *Instance { - s.PrivateIp = &v - return s -} - -// SetPublicDns sets the PublicDns field's value. -func (s *Instance) SetPublicDns(v string) *Instance { - s.PublicDns = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *Instance) SetPublicIp(v string) *Instance { - s.PublicIp = &v - return s -} - -// SetRegisteredBy sets the RegisteredBy field's value. -func (s *Instance) SetRegisteredBy(v string) *Instance { - s.RegisteredBy = &v - return s -} - -// SetReportedAgentVersion sets the ReportedAgentVersion field's value. -func (s *Instance) SetReportedAgentVersion(v string) *Instance { - s.ReportedAgentVersion = &v - return s -} - -// SetReportedOs sets the ReportedOs field's value. -func (s *Instance) SetReportedOs(v *ReportedOs) *Instance { - s.ReportedOs = v - return s -} - -// SetRootDeviceType sets the RootDeviceType field's value. -func (s *Instance) SetRootDeviceType(v string) *Instance { - s.RootDeviceType = &v - return s -} - -// SetRootDeviceVolumeId sets the RootDeviceVolumeId field's value. -func (s *Instance) SetRootDeviceVolumeId(v string) *Instance { - s.RootDeviceVolumeId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *Instance) SetSecurityGroupIds(v []*string) *Instance { - s.SecurityGroupIds = v - return s -} - -// SetSshHostDsaKeyFingerprint sets the SshHostDsaKeyFingerprint field's value. -func (s *Instance) SetSshHostDsaKeyFingerprint(v string) *Instance { - s.SshHostDsaKeyFingerprint = &v - return s -} - -// SetSshHostRsaKeyFingerprint sets the SshHostRsaKeyFingerprint field's value. -func (s *Instance) SetSshHostRsaKeyFingerprint(v string) *Instance { - s.SshHostRsaKeyFingerprint = &v - return s -} - -// SetSshKeyName sets the SshKeyName field's value. -func (s *Instance) SetSshKeyName(v string) *Instance { - s.SshKeyName = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *Instance) SetStackId(v string) *Instance { - s.StackId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Instance) SetStatus(v string) *Instance { - s.Status = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *Instance) SetSubnetId(v string) *Instance { - s.SubnetId = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *Instance) SetTenancy(v string) *Instance { - s.Tenancy = &v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *Instance) SetVirtualizationType(v string) *Instance { - s.VirtualizationType = &v - return s -} - -// Contains a description of an Amazon EC2 instance from the Amazon EC2 metadata -// service. For more information, see Instance Metadata and User Data (http://docs.aws.amazon.com/sdkfornet/latest/apidocs/Index.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/InstanceIdentity -type InstanceIdentity struct { - _ struct{} `type:"structure"` - - // A JSON document that contains the metadata. - Document *string `type:"string"` - - // A signature that can be used to verify the document's accuracy and authenticity. - Signature *string `type:"string"` -} - -// String returns the string representation -func (s InstanceIdentity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceIdentity) GoString() string { - return s.String() -} - -// SetDocument sets the Document field's value. -func (s *InstanceIdentity) SetDocument(v string) *InstanceIdentity { - s.Document = &v - return s -} - -// SetSignature sets the Signature field's value. -func (s *InstanceIdentity) SetSignature(v string) *InstanceIdentity { - s.Signature = &v - return s -} - -// Describes how many instances a stack has for each status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/InstancesCount -type InstancesCount struct { - _ struct{} `type:"structure"` - - // The number of instances in the Assigning state. - Assigning *int64 `type:"integer"` - - // The number of instances with booting status. - Booting *int64 `type:"integer"` - - // The number of instances with connection_lost status. - ConnectionLost *int64 `type:"integer"` - - // The number of instances in the Deregistering state. - Deregistering *int64 `type:"integer"` - - // The number of instances with online status. - Online *int64 `type:"integer"` - - // The number of instances with pending status. - Pending *int64 `type:"integer"` - - // The number of instances with rebooting status. - Rebooting *int64 `type:"integer"` - - // The number of instances in the Registered state. - Registered *int64 `type:"integer"` - - // The number of instances in the Registering state. - Registering *int64 `type:"integer"` - - // The number of instances with requested status. - Requested *int64 `type:"integer"` - - // The number of instances with running_setup status. - RunningSetup *int64 `type:"integer"` - - // The number of instances with setup_failed status. - SetupFailed *int64 `type:"integer"` - - // The number of instances with shutting_down status. - ShuttingDown *int64 `type:"integer"` - - // The number of instances with start_failed status. - StartFailed *int64 `type:"integer"` - - // The number of instances with stopped status. - Stopped *int64 `type:"integer"` - - // The number of instances with stopping status. - Stopping *int64 `type:"integer"` - - // The number of instances with terminated status. - Terminated *int64 `type:"integer"` - - // The number of instances with terminating status. - Terminating *int64 `type:"integer"` - - // The number of instances in the Unassigning state. - Unassigning *int64 `type:"integer"` -} - -// String returns the string representation -func (s InstancesCount) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstancesCount) GoString() string { - return s.String() -} - -// SetAssigning sets the Assigning field's value. -func (s *InstancesCount) SetAssigning(v int64) *InstancesCount { - s.Assigning = &v - return s -} - -// SetBooting sets the Booting field's value. -func (s *InstancesCount) SetBooting(v int64) *InstancesCount { - s.Booting = &v - return s -} - -// SetConnectionLost sets the ConnectionLost field's value. -func (s *InstancesCount) SetConnectionLost(v int64) *InstancesCount { - s.ConnectionLost = &v - return s -} - -// SetDeregistering sets the Deregistering field's value. -func (s *InstancesCount) SetDeregistering(v int64) *InstancesCount { - s.Deregistering = &v - return s -} - -// SetOnline sets the Online field's value. -func (s *InstancesCount) SetOnline(v int64) *InstancesCount { - s.Online = &v - return s -} - -// SetPending sets the Pending field's value. -func (s *InstancesCount) SetPending(v int64) *InstancesCount { - s.Pending = &v - return s -} - -// SetRebooting sets the Rebooting field's value. -func (s *InstancesCount) SetRebooting(v int64) *InstancesCount { - s.Rebooting = &v - return s -} - -// SetRegistered sets the Registered field's value. -func (s *InstancesCount) SetRegistered(v int64) *InstancesCount { - s.Registered = &v - return s -} - -// SetRegistering sets the Registering field's value. -func (s *InstancesCount) SetRegistering(v int64) *InstancesCount { - s.Registering = &v - return s -} - -// SetRequested sets the Requested field's value. -func (s *InstancesCount) SetRequested(v int64) *InstancesCount { - s.Requested = &v - return s -} - -// SetRunningSetup sets the RunningSetup field's value. -func (s *InstancesCount) SetRunningSetup(v int64) *InstancesCount { - s.RunningSetup = &v - return s -} - -// SetSetupFailed sets the SetupFailed field's value. -func (s *InstancesCount) SetSetupFailed(v int64) *InstancesCount { - s.SetupFailed = &v - return s -} - -// SetShuttingDown sets the ShuttingDown field's value. -func (s *InstancesCount) SetShuttingDown(v int64) *InstancesCount { - s.ShuttingDown = &v - return s -} - -// SetStartFailed sets the StartFailed field's value. -func (s *InstancesCount) SetStartFailed(v int64) *InstancesCount { - s.StartFailed = &v - return s -} - -// SetStopped sets the Stopped field's value. -func (s *InstancesCount) SetStopped(v int64) *InstancesCount { - s.Stopped = &v - return s -} - -// SetStopping sets the Stopping field's value. -func (s *InstancesCount) SetStopping(v int64) *InstancesCount { - s.Stopping = &v - return s -} - -// SetTerminated sets the Terminated field's value. -func (s *InstancesCount) SetTerminated(v int64) *InstancesCount { - s.Terminated = &v - return s -} - -// SetTerminating sets the Terminating field's value. -func (s *InstancesCount) SetTerminating(v int64) *InstancesCount { - s.Terminating = &v - return s -} - -// SetUnassigning sets the Unassigning field's value. -func (s *InstancesCount) SetUnassigning(v int64) *InstancesCount { - s.Unassigning = &v - return s -} - -// Describes a layer. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Layer -type Layer struct { - _ struct{} `type:"structure"` - - // The layer attributes. - // - // For the HaproxyStatsPassword, MysqlRootPassword, and GangliaPassword attributes, - // AWS OpsWorks returns *****FILTERED***** instead of the actual value - // - // For an ECS Cluster layer, AWS OpsWorks the EcsClusterArn attribute is set - // to the cluster's ARN. - Attributes map[string]*string `type:"map"` - - // Whether to automatically assign an Elastic IP address (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) - // to the layer's instances. For more information, see How to Edit a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html). - AutoAssignElasticIps *bool `type:"boolean"` - - // For stacks that are running in a VPC, whether to automatically assign a public - // IP address to the layer's instances. For more information, see How to Edit - // a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html). - AutoAssignPublicIps *bool `type:"boolean"` - - // Date when the layer was created. - CreatedAt *string `type:"string"` - - // The ARN of the default IAM profile to be used for the layer's EC2 instances. - // For more information about IAM ARNs, see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - CustomInstanceProfileArn *string `type:"string"` - - // A JSON formatted string containing the layer's custom stack configuration - // and deployment attributes. - CustomJson *string `type:"string"` - - // A LayerCustomRecipes object that specifies the layer's custom recipes. - CustomRecipes *Recipes `type:"structure"` - - // An array containing the layer's custom security group IDs. - CustomSecurityGroupIds []*string `type:"list"` - - // AWS OpsWorks supports five lifecycle events: setup, configuration, deploy, - // undeploy, and shutdown. For each layer, AWS OpsWorks runs a set of standard - // recipes for each event. In addition, you can provide custom recipes for any - // or all layers and events. AWS OpsWorks runs custom event recipes after the - // standard recipes. LayerCustomRecipes specifies the custom recipes for a particular - // layer to be run in response to each of the five events. - // - // To specify a recipe, use the cookbook's directory name in the repository - // followed by two colons and the recipe name, which is the recipe's file name - // without the .rb extension. For example: phpapp2::dbsetup specifies the dbsetup.rb - // recipe in the repository's phpapp2 folder. - DefaultRecipes *Recipes `type:"structure"` - - // An array containing the layer's security group names. - DefaultSecurityGroupNames []*string `type:"list"` - - // Whether auto healing is disabled for the layer. - EnableAutoHealing *bool `type:"boolean"` - - // Whether to install operating system and package updates when the instance - // boots. The default value is true. If this value is set to false, you must - // then update your instances manually by using CreateDeployment to run the - // update_dependencies stack command or manually running yum (Amazon Linux) - // or apt-get (Ubuntu) on the instances. - // - // We strongly recommend using the default value of true, to ensure that your - // instances have the latest security updates. - InstallUpdatesOnBoot *bool `type:"boolean"` - - // The layer ID. - LayerId *string `type:"string"` - - // A LifeCycleEventConfiguration object that specifies the Shutdown event configuration. - LifecycleEventConfiguration *LifecycleEventConfiguration `type:"structure"` - - // The layer name. - Name *string `type:"string"` - - // An array of Package objects that describe the layer's packages. - Packages []*string `type:"list"` - - // The layer short name. - Shortname *string `type:"string"` - - // The layer stack ID. - StackId *string `type:"string"` - - // The layer type. - Type *string `type:"string" enum:"LayerType"` - - // Whether the layer uses Amazon EBS-optimized instances. - UseEbsOptimizedInstances *bool `type:"boolean"` - - // A VolumeConfigurations object that describes the layer's Amazon EBS volumes. - VolumeConfigurations []*VolumeConfiguration `type:"list"` -} - -// String returns the string representation -func (s Layer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Layer) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *Layer) SetAttributes(v map[string]*string) *Layer { - s.Attributes = v - return s -} - -// SetAutoAssignElasticIps sets the AutoAssignElasticIps field's value. -func (s *Layer) SetAutoAssignElasticIps(v bool) *Layer { - s.AutoAssignElasticIps = &v - return s -} - -// SetAutoAssignPublicIps sets the AutoAssignPublicIps field's value. -func (s *Layer) SetAutoAssignPublicIps(v bool) *Layer { - s.AutoAssignPublicIps = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Layer) SetCreatedAt(v string) *Layer { - s.CreatedAt = &v - return s -} - -// SetCustomInstanceProfileArn sets the CustomInstanceProfileArn field's value. -func (s *Layer) SetCustomInstanceProfileArn(v string) *Layer { - s.CustomInstanceProfileArn = &v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *Layer) SetCustomJson(v string) *Layer { - s.CustomJson = &v - return s -} - -// SetCustomRecipes sets the CustomRecipes field's value. -func (s *Layer) SetCustomRecipes(v *Recipes) *Layer { - s.CustomRecipes = v - return s -} - -// SetCustomSecurityGroupIds sets the CustomSecurityGroupIds field's value. -func (s *Layer) SetCustomSecurityGroupIds(v []*string) *Layer { - s.CustomSecurityGroupIds = v - return s -} - -// SetDefaultRecipes sets the DefaultRecipes field's value. -func (s *Layer) SetDefaultRecipes(v *Recipes) *Layer { - s.DefaultRecipes = v - return s -} - -// SetDefaultSecurityGroupNames sets the DefaultSecurityGroupNames field's value. -func (s *Layer) SetDefaultSecurityGroupNames(v []*string) *Layer { - s.DefaultSecurityGroupNames = v - return s -} - -// SetEnableAutoHealing sets the EnableAutoHealing field's value. -func (s *Layer) SetEnableAutoHealing(v bool) *Layer { - s.EnableAutoHealing = &v - return s -} - -// SetInstallUpdatesOnBoot sets the InstallUpdatesOnBoot field's value. -func (s *Layer) SetInstallUpdatesOnBoot(v bool) *Layer { - s.InstallUpdatesOnBoot = &v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *Layer) SetLayerId(v string) *Layer { - s.LayerId = &v - return s -} - -// SetLifecycleEventConfiguration sets the LifecycleEventConfiguration field's value. -func (s *Layer) SetLifecycleEventConfiguration(v *LifecycleEventConfiguration) *Layer { - s.LifecycleEventConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *Layer) SetName(v string) *Layer { - s.Name = &v - return s -} - -// SetPackages sets the Packages field's value. -func (s *Layer) SetPackages(v []*string) *Layer { - s.Packages = v - return s -} - -// SetShortname sets the Shortname field's value. -func (s *Layer) SetShortname(v string) *Layer { - s.Shortname = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *Layer) SetStackId(v string) *Layer { - s.StackId = &v - return s -} - -// SetType sets the Type field's value. -func (s *Layer) SetType(v string) *Layer { - s.Type = &v - return s -} - -// SetUseEbsOptimizedInstances sets the UseEbsOptimizedInstances field's value. -func (s *Layer) SetUseEbsOptimizedInstances(v bool) *Layer { - s.UseEbsOptimizedInstances = &v - return s -} - -// SetVolumeConfigurations sets the VolumeConfigurations field's value. -func (s *Layer) SetVolumeConfigurations(v []*VolumeConfiguration) *Layer { - s.VolumeConfigurations = v - return s -} - -// Specifies the lifecycle event configuration -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/LifecycleEventConfiguration -type LifecycleEventConfiguration struct { - _ struct{} `type:"structure"` - - // A ShutdownEventConfiguration object that specifies the Shutdown event configuration. - Shutdown *ShutdownEventConfiguration `type:"structure"` -} - -// String returns the string representation -func (s LifecycleEventConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleEventConfiguration) GoString() string { - return s.String() -} - -// SetShutdown sets the Shutdown field's value. -func (s *LifecycleEventConfiguration) SetShutdown(v *ShutdownEventConfiguration) *LifecycleEventConfiguration { - s.Shutdown = v - return s -} - -// Describes a layer's load-based auto scaling configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/LoadBasedAutoScalingConfiguration -type LoadBasedAutoScalingConfiguration struct { - _ struct{} `type:"structure"` - - // An AutoScalingThresholds object that describes the downscaling configuration, - // which defines how and when AWS OpsWorks reduces the number of instances. - DownScaling *AutoScalingThresholds `type:"structure"` - - // Whether load-based auto scaling is enabled for the layer. - Enable *bool `type:"boolean"` - - // The layer ID. - LayerId *string `type:"string"` - - // An AutoScalingThresholds object that describes the upscaling configuration, - // which defines how and when AWS OpsWorks increases the number of instances. - UpScaling *AutoScalingThresholds `type:"structure"` -} - -// String returns the string representation -func (s LoadBasedAutoScalingConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBasedAutoScalingConfiguration) GoString() string { - return s.String() -} - -// SetDownScaling sets the DownScaling field's value. -func (s *LoadBasedAutoScalingConfiguration) SetDownScaling(v *AutoScalingThresholds) *LoadBasedAutoScalingConfiguration { - s.DownScaling = v - return s -} - -// SetEnable sets the Enable field's value. -func (s *LoadBasedAutoScalingConfiguration) SetEnable(v bool) *LoadBasedAutoScalingConfiguration { - s.Enable = &v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *LoadBasedAutoScalingConfiguration) SetLayerId(v string) *LoadBasedAutoScalingConfiguration { - s.LayerId = &v - return s -} - -// SetUpScaling sets the UpScaling field's value. -func (s *LoadBasedAutoScalingConfiguration) SetUpScaling(v *AutoScalingThresholds) *LoadBasedAutoScalingConfiguration { - s.UpScaling = v - return s -} - -// Describes stack or user permissions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Permission -type Permission struct { - _ struct{} `type:"structure"` - - // Whether the user can use SSH. - AllowSsh *bool `type:"boolean"` - - // Whether the user can use sudo. - AllowSudo *bool `type:"boolean"` - - // The Amazon Resource Name (ARN) for an AWS Identity and Access Management - // (IAM) role. For more information about IAM ARNs, see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - IamUserArn *string `type:"string"` - - // The user's permission level, which must be the following: - // - // * deny - // - // * show - // - // * deploy - // - // * manage - // - // * iam_only - // - // For more information on the permissions associated with these levels, see - // Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) - Level *string `type:"string"` - - // A stack ID. - StackId *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() -} - -// SetAllowSsh sets the AllowSsh field's value. -func (s *Permission) SetAllowSsh(v bool) *Permission { - s.AllowSsh = &v - return s -} - -// SetAllowSudo sets the AllowSudo field's value. -func (s *Permission) SetAllowSudo(v bool) *Permission { - s.AllowSudo = &v - return s -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *Permission) SetIamUserArn(v string) *Permission { - s.IamUserArn = &v - return s -} - -// SetLevel sets the Level field's value. -func (s *Permission) SetLevel(v string) *Permission { - s.Level = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *Permission) SetStackId(v string) *Permission { - s.StackId = &v - return s -} - -// Describes an instance's RAID array. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RaidArray -type RaidArray struct { - _ struct{} `type:"structure"` - - // The array's Availability Zone. For more information, see Regions and Endpoints - // (http://docs.aws.amazon.com/general/latest/gr/rande.html). - AvailabilityZone *string `type:"string"` - - // When the RAID array was created. - CreatedAt *string `type:"string"` - - // The array's Linux device. For example /dev/mdadm0. - Device *string `type:"string"` - - // The instance ID. - InstanceId *string `type:"string"` - - // For PIOPS volumes, the IOPS per disk. - Iops *int64 `type:"integer"` - - // The array's mount point. - MountPoint *string `type:"string"` - - // The array name. - Name *string `type:"string"` - - // The number of disks in the array. - NumberOfDisks *int64 `type:"integer"` - - // The array ID. - RaidArrayId *string `type:"string"` - - // The RAID level (http://en.wikipedia.org/wiki/Standard_RAID_levels). - RaidLevel *int64 `type:"integer"` - - // The array's size. - Size *int64 `type:"integer"` - - // The stack ID. - StackId *string `type:"string"` - - // The volume type, standard or PIOPS. - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s RaidArray) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RaidArray) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *RaidArray) SetAvailabilityZone(v string) *RaidArray { - s.AvailabilityZone = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *RaidArray) SetCreatedAt(v string) *RaidArray { - s.CreatedAt = &v - return s -} - -// SetDevice sets the Device field's value. -func (s *RaidArray) SetDevice(v string) *RaidArray { - s.Device = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *RaidArray) SetInstanceId(v string) *RaidArray { - s.InstanceId = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *RaidArray) SetIops(v int64) *RaidArray { - s.Iops = &v - return s -} - -// SetMountPoint sets the MountPoint field's value. -func (s *RaidArray) SetMountPoint(v string) *RaidArray { - s.MountPoint = &v - return s -} - -// SetName sets the Name field's value. -func (s *RaidArray) SetName(v string) *RaidArray { - s.Name = &v - return s -} - -// SetNumberOfDisks sets the NumberOfDisks field's value. -func (s *RaidArray) SetNumberOfDisks(v int64) *RaidArray { - s.NumberOfDisks = &v - return s -} - -// SetRaidArrayId sets the RaidArrayId field's value. -func (s *RaidArray) SetRaidArrayId(v string) *RaidArray { - s.RaidArrayId = &v - return s -} - -// SetRaidLevel sets the RaidLevel field's value. -func (s *RaidArray) SetRaidLevel(v int64) *RaidArray { - s.RaidLevel = &v - return s -} - -// SetSize sets the Size field's value. -func (s *RaidArray) SetSize(v int64) *RaidArray { - s.Size = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *RaidArray) SetStackId(v string) *RaidArray { - s.StackId = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *RaidArray) SetVolumeType(v string) *RaidArray { - s.VolumeType = &v - return s -} - -// Describes an Amazon RDS instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RdsDbInstance -type RdsDbInstance struct { - _ struct{} `type:"structure"` - - // The instance's address. - Address *string `type:"string"` - - // The DB instance identifier. - DbInstanceIdentifier *string `type:"string"` - - // AWS OpsWorks returns *****FILTERED***** instead of the actual value. - DbPassword *string `type:"string"` - - // The master user name. - DbUser *string `type:"string"` - - // The instance's database engine. - Engine *string `type:"string"` - - // Set to true if AWS OpsWorks was unable to discover the Amazon RDS instance. - // AWS OpsWorks attempts to discover the instance only once. If this value is - // set to true, you must deregister the instance and then register it again. - MissingOnRds *bool `type:"boolean"` - - // The instance's ARN. - RdsDbInstanceArn *string `type:"string"` - - // The instance's AWS region. - Region *string `type:"string"` - - // The ID of the stack that the instance is registered with. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s RdsDbInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RdsDbInstance) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *RdsDbInstance) SetAddress(v string) *RdsDbInstance { - s.Address = &v - return s -} - -// SetDbInstanceIdentifier sets the DbInstanceIdentifier field's value. -func (s *RdsDbInstance) SetDbInstanceIdentifier(v string) *RdsDbInstance { - s.DbInstanceIdentifier = &v - return s -} - -// SetDbPassword sets the DbPassword field's value. -func (s *RdsDbInstance) SetDbPassword(v string) *RdsDbInstance { - s.DbPassword = &v - return s -} - -// SetDbUser sets the DbUser field's value. -func (s *RdsDbInstance) SetDbUser(v string) *RdsDbInstance { - s.DbUser = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *RdsDbInstance) SetEngine(v string) *RdsDbInstance { - s.Engine = &v - return s -} - -// SetMissingOnRds sets the MissingOnRds field's value. -func (s *RdsDbInstance) SetMissingOnRds(v bool) *RdsDbInstance { - s.MissingOnRds = &v - return s -} - -// SetRdsDbInstanceArn sets the RdsDbInstanceArn field's value. -func (s *RdsDbInstance) SetRdsDbInstanceArn(v string) *RdsDbInstance { - s.RdsDbInstanceArn = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *RdsDbInstance) SetRegion(v string) *RdsDbInstance { - s.Region = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *RdsDbInstance) SetStackId(v string) *RdsDbInstance { - s.StackId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RebootInstanceRequest -type RebootInstanceInput struct { - _ struct{} `type:"structure"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RebootInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *RebootInstanceInput) SetInstanceId(v string) *RebootInstanceInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RebootInstanceOutput -type RebootInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RebootInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstanceOutput) GoString() string { - return s.String() -} - -// AWS OpsWorks supports five lifecycle events: setup, configuration, deploy, -// undeploy, and shutdown. For each layer, AWS OpsWorks runs a set of standard -// recipes for each event. In addition, you can provide custom recipes for any -// or all layers and events. AWS OpsWorks runs custom event recipes after the -// standard recipes. LayerCustomRecipes specifies the custom recipes for a particular -// layer to be run in response to each of the five events. -// -// To specify a recipe, use the cookbook's directory name in the repository -// followed by two colons and the recipe name, which is the recipe's file name -// without the .rb extension. For example: phpapp2::dbsetup specifies the dbsetup.rb -// recipe in the repository's phpapp2 folder. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Recipes -type Recipes struct { - _ struct{} `type:"structure"` - - // An array of custom recipe names to be run following a configure event. - Configure []*string `type:"list"` - - // An array of custom recipe names to be run following a deploy event. - Deploy []*string `type:"list"` - - // An array of custom recipe names to be run following a setup event. - Setup []*string `type:"list"` - - // An array of custom recipe names to be run following a shutdown event. - Shutdown []*string `type:"list"` - - // An array of custom recipe names to be run following a undeploy event. - Undeploy []*string `type:"list"` -} - -// String returns the string representation -func (s Recipes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Recipes) GoString() string { - return s.String() -} - -// SetConfigure sets the Configure field's value. -func (s *Recipes) SetConfigure(v []*string) *Recipes { - s.Configure = v - return s -} - -// SetDeploy sets the Deploy field's value. -func (s *Recipes) SetDeploy(v []*string) *Recipes { - s.Deploy = v - return s -} - -// SetSetup sets the Setup field's value. -func (s *Recipes) SetSetup(v []*string) *Recipes { - s.Setup = v - return s -} - -// SetShutdown sets the Shutdown field's value. -func (s *Recipes) SetShutdown(v []*string) *Recipes { - s.Shutdown = v - return s -} - -// SetUndeploy sets the Undeploy field's value. -func (s *Recipes) SetUndeploy(v []*string) *Recipes { - s.Undeploy = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterEcsClusterRequest -type RegisterEcsClusterInput struct { - _ struct{} `type:"structure"` - - // The cluster's ARN. - // - // EcsClusterArn is a required field - EcsClusterArn *string `type:"string" required:"true"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterEcsClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterEcsClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterEcsClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterEcsClusterInput"} - if s.EcsClusterArn == nil { - invalidParams.Add(request.NewErrParamRequired("EcsClusterArn")) - } - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEcsClusterArn sets the EcsClusterArn field's value. -func (s *RegisterEcsClusterInput) SetEcsClusterArn(v string) *RegisterEcsClusterInput { - s.EcsClusterArn = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *RegisterEcsClusterInput) SetStackId(v string) *RegisterEcsClusterInput { - s.StackId = &v - return s -} - -// Contains the response to a RegisterEcsCluster request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterEcsClusterResult -type RegisterEcsClusterOutput struct { - _ struct{} `type:"structure"` - - // The cluster's ARN. - EcsClusterArn *string `type:"string"` -} - -// String returns the string representation -func (s RegisterEcsClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterEcsClusterOutput) GoString() string { - return s.String() -} - -// SetEcsClusterArn sets the EcsClusterArn field's value. -func (s *RegisterEcsClusterOutput) SetEcsClusterArn(v string) *RegisterEcsClusterOutput { - s.EcsClusterArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterElasticIpRequest -type RegisterElasticIpInput struct { - _ struct{} `type:"structure"` - - // The Elastic IP address. - // - // ElasticIp is a required field - ElasticIp *string `type:"string" required:"true"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterElasticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterElasticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterElasticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterElasticIpInput"} - if s.ElasticIp == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticIp")) - } - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *RegisterElasticIpInput) SetElasticIp(v string) *RegisterElasticIpInput { - s.ElasticIp = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *RegisterElasticIpInput) SetStackId(v string) *RegisterElasticIpInput { - s.StackId = &v - return s -} - -// Contains the response to a RegisterElasticIp request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterElasticIpResult -type RegisterElasticIpOutput struct { - _ struct{} `type:"structure"` - - // The Elastic IP address. - ElasticIp *string `type:"string"` -} - -// String returns the string representation -func (s RegisterElasticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterElasticIpOutput) GoString() string { - return s.String() -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *RegisterElasticIpOutput) SetElasticIp(v string) *RegisterElasticIpOutput { - s.ElasticIp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterInstanceRequest -type RegisterInstanceInput struct { - _ struct{} `type:"structure"` - - // The instance's hostname. - Hostname *string `type:"string"` - - // An InstanceIdentity object that contains the instance's identity. - InstanceIdentity *InstanceIdentity `type:"structure"` - - // The instance's private IP address. - PrivateIp *string `type:"string"` - - // The instance's public IP address. - PublicIp *string `type:"string"` - - // The instances public RSA key. This key is used to encrypt communication between - // the instance and the service. - RsaPublicKey *string `type:"string"` - - // The instances public RSA key fingerprint. - RsaPublicKeyFingerprint *string `type:"string"` - - // The ID of the stack that the instance is to be registered with. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterInstanceInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostname sets the Hostname field's value. -func (s *RegisterInstanceInput) SetHostname(v string) *RegisterInstanceInput { - s.Hostname = &v - return s -} - -// SetInstanceIdentity sets the InstanceIdentity field's value. -func (s *RegisterInstanceInput) SetInstanceIdentity(v *InstanceIdentity) *RegisterInstanceInput { - s.InstanceIdentity = v - return s -} - -// SetPrivateIp sets the PrivateIp field's value. -func (s *RegisterInstanceInput) SetPrivateIp(v string) *RegisterInstanceInput { - s.PrivateIp = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *RegisterInstanceInput) SetPublicIp(v string) *RegisterInstanceInput { - s.PublicIp = &v - return s -} - -// SetRsaPublicKey sets the RsaPublicKey field's value. -func (s *RegisterInstanceInput) SetRsaPublicKey(v string) *RegisterInstanceInput { - s.RsaPublicKey = &v - return s -} - -// SetRsaPublicKeyFingerprint sets the RsaPublicKeyFingerprint field's value. -func (s *RegisterInstanceInput) SetRsaPublicKeyFingerprint(v string) *RegisterInstanceInput { - s.RsaPublicKeyFingerprint = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *RegisterInstanceInput) SetStackId(v string) *RegisterInstanceInput { - s.StackId = &v - return s -} - -// Contains the response to a RegisterInstanceResult request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterInstanceResult -type RegisterInstanceOutput struct { - _ struct{} `type:"structure"` - - // The registered instance's AWS OpsWorks ID. - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s RegisterInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterInstanceOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *RegisterInstanceOutput) SetInstanceId(v string) *RegisterInstanceOutput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterRdsDbInstanceRequest -type RegisterRdsDbInstanceInput struct { - _ struct{} `type:"structure"` - - // The database password. - // - // DbPassword is a required field - DbPassword *string `type:"string" required:"true"` - - // The database's master user name. - // - // DbUser is a required field - DbUser *string `type:"string" required:"true"` - - // The Amazon RDS instance's ARN. - // - // RdsDbInstanceArn is a required field - RdsDbInstanceArn *string `type:"string" required:"true"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterRdsDbInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterRdsDbInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterRdsDbInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterRdsDbInstanceInput"} - if s.DbPassword == nil { - invalidParams.Add(request.NewErrParamRequired("DbPassword")) - } - if s.DbUser == nil { - invalidParams.Add(request.NewErrParamRequired("DbUser")) - } - if s.RdsDbInstanceArn == nil { - invalidParams.Add(request.NewErrParamRequired("RdsDbInstanceArn")) - } - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDbPassword sets the DbPassword field's value. -func (s *RegisterRdsDbInstanceInput) SetDbPassword(v string) *RegisterRdsDbInstanceInput { - s.DbPassword = &v - return s -} - -// SetDbUser sets the DbUser field's value. -func (s *RegisterRdsDbInstanceInput) SetDbUser(v string) *RegisterRdsDbInstanceInput { - s.DbUser = &v - return s -} - -// SetRdsDbInstanceArn sets the RdsDbInstanceArn field's value. -func (s *RegisterRdsDbInstanceInput) SetRdsDbInstanceArn(v string) *RegisterRdsDbInstanceInput { - s.RdsDbInstanceArn = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *RegisterRdsDbInstanceInput) SetStackId(v string) *RegisterRdsDbInstanceInput { - s.StackId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterRdsDbInstanceOutput -type RegisterRdsDbInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RegisterRdsDbInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterRdsDbInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterVolumeRequest -type RegisterVolumeInput struct { - _ struct{} `type:"structure"` - - // The Amazon EBS volume ID. - Ec2VolumeId *string `type:"string"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterVolumeInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEc2VolumeId sets the Ec2VolumeId field's value. -func (s *RegisterVolumeInput) SetEc2VolumeId(v string) *RegisterVolumeInput { - s.Ec2VolumeId = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *RegisterVolumeInput) SetStackId(v string) *RegisterVolumeInput { - s.StackId = &v - return s -} - -// Contains the response to a RegisterVolume request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterVolumeResult -type RegisterVolumeOutput struct { - _ struct{} `type:"structure"` - - // The volume ID. - VolumeId *string `type:"string"` -} - -// String returns the string representation -func (s RegisterVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterVolumeOutput) GoString() string { - return s.String() -} - -// SetVolumeId sets the VolumeId field's value. -func (s *RegisterVolumeOutput) SetVolumeId(v string) *RegisterVolumeOutput { - s.VolumeId = &v - return s -} - -// A registered instance's reported operating system. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ReportedOs -type ReportedOs struct { - _ struct{} `type:"structure"` - - // The operating system family. - Family *string `type:"string"` - - // The operating system name. - Name *string `type:"string"` - - // The operating system version. - Version *string `type:"string"` -} - -// String returns the string representation -func (s ReportedOs) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReportedOs) GoString() string { - return s.String() -} - -// SetFamily sets the Family field's value. -func (s *ReportedOs) SetFamily(v string) *ReportedOs { - s.Family = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReportedOs) SetName(v string) *ReportedOs { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *ReportedOs) SetVersion(v string) *ReportedOs { - s.Version = &v - return s -} - -// Describes a user's SSH information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SelfUserProfile -type SelfUserProfile struct { - _ struct{} `type:"structure"` - - // The user's IAM ARN. - IamUserArn *string `type:"string"` - - // The user's name. - Name *string `type:"string"` - - // The user's SSH public key. - SshPublicKey *string `type:"string"` - - // The user's SSH user name. - SshUsername *string `type:"string"` -} - -// String returns the string representation -func (s SelfUserProfile) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SelfUserProfile) GoString() string { - return s.String() -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *SelfUserProfile) SetIamUserArn(v string) *SelfUserProfile { - s.IamUserArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *SelfUserProfile) SetName(v string) *SelfUserProfile { - s.Name = &v - return s -} - -// SetSshPublicKey sets the SshPublicKey field's value. -func (s *SelfUserProfile) SetSshPublicKey(v string) *SelfUserProfile { - s.SshPublicKey = &v - return s -} - -// SetSshUsername sets the SshUsername field's value. -func (s *SelfUserProfile) SetSshUsername(v string) *SelfUserProfile { - s.SshUsername = &v - return s -} - -// Describes an AWS OpsWorks service error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ServiceError -type ServiceError struct { - _ struct{} `type:"structure"` - - // When the error occurred. - CreatedAt *string `type:"string"` - - // The instance ID. - InstanceId *string `type:"string"` - - // A message that describes the error. - Message *string `type:"string"` - - // The error ID. - ServiceErrorId *string `type:"string"` - - // The stack ID. - StackId *string `type:"string"` - - // The error type. - Type *string `type:"string"` -} - -// String returns the string representation -func (s ServiceError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceError) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServiceError) SetCreatedAt(v string) *ServiceError { - s.CreatedAt = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ServiceError) SetInstanceId(v string) *ServiceError { - s.InstanceId = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ServiceError) SetMessage(v string) *ServiceError { - s.Message = &v - return s -} - -// SetServiceErrorId sets the ServiceErrorId field's value. -func (s *ServiceError) SetServiceErrorId(v string) *ServiceError { - s.ServiceErrorId = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *ServiceError) SetStackId(v string) *ServiceError { - s.StackId = &v - return s -} - -// SetType sets the Type field's value. -func (s *ServiceError) SetType(v string) *ServiceError { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetLoadBasedAutoScalingRequest -type SetLoadBasedAutoScalingInput struct { - _ struct{} `type:"structure"` - - // An AutoScalingThresholds object with the downscaling threshold configuration. - // If the load falls below these thresholds for a specified amount of time, - // AWS OpsWorks stops a specified number of instances. - DownScaling *AutoScalingThresholds `type:"structure"` - - // Enables load-based auto scaling for the layer. - Enable *bool `type:"boolean"` - - // The layer ID. - // - // LayerId is a required field - LayerId *string `type:"string" required:"true"` - - // An AutoScalingThresholds object with the upscaling threshold configuration. - // If the load exceeds these thresholds for a specified amount of time, AWS - // OpsWorks starts a specified number of instances. - UpScaling *AutoScalingThresholds `type:"structure"` -} - -// String returns the string representation -func (s SetLoadBasedAutoScalingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetLoadBasedAutoScalingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetLoadBasedAutoScalingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetLoadBasedAutoScalingInput"} - if s.LayerId == nil { - invalidParams.Add(request.NewErrParamRequired("LayerId")) - } - if s.DownScaling != nil { - if err := s.DownScaling.Validate(); err != nil { - invalidParams.AddNested("DownScaling", err.(request.ErrInvalidParams)) - } - } - if s.UpScaling != nil { - if err := s.UpScaling.Validate(); err != nil { - invalidParams.AddNested("UpScaling", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDownScaling sets the DownScaling field's value. -func (s *SetLoadBasedAutoScalingInput) SetDownScaling(v *AutoScalingThresholds) *SetLoadBasedAutoScalingInput { - s.DownScaling = v - return s -} - -// SetEnable sets the Enable field's value. -func (s *SetLoadBasedAutoScalingInput) SetEnable(v bool) *SetLoadBasedAutoScalingInput { - s.Enable = &v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *SetLoadBasedAutoScalingInput) SetLayerId(v string) *SetLoadBasedAutoScalingInput { - s.LayerId = &v - return s -} - -// SetUpScaling sets the UpScaling field's value. -func (s *SetLoadBasedAutoScalingInput) SetUpScaling(v *AutoScalingThresholds) *SetLoadBasedAutoScalingInput { - s.UpScaling = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetLoadBasedAutoScalingOutput -type SetLoadBasedAutoScalingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetLoadBasedAutoScalingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetLoadBasedAutoScalingOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetPermissionRequest -type SetPermissionInput struct { - _ struct{} `type:"structure"` - - // The user is allowed to use SSH to communicate with the instance. - AllowSsh *bool `type:"boolean"` - - // The user is allowed to use sudo to elevate privileges. - AllowSudo *bool `type:"boolean"` - - // The user's IAM ARN. This can also be a federated user's ARN. - // - // IamUserArn is a required field - IamUserArn *string `type:"string" required:"true"` - - // The user's permission level, which must be set to one of the following strings. - // You cannot set your own permissions level. - // - // * deny - // - // * show - // - // * deploy - // - // * manage - // - // * iam_only - // - // For more information on the permissions associated with these levels, see - // Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html). - Level *string `type:"string"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetPermissionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetPermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetPermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetPermissionInput"} - if s.IamUserArn == nil { - invalidParams.Add(request.NewErrParamRequired("IamUserArn")) - } - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowSsh sets the AllowSsh field's value. -func (s *SetPermissionInput) SetAllowSsh(v bool) *SetPermissionInput { - s.AllowSsh = &v - return s -} - -// SetAllowSudo sets the AllowSudo field's value. -func (s *SetPermissionInput) SetAllowSudo(v bool) *SetPermissionInput { - s.AllowSudo = &v - return s -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *SetPermissionInput) SetIamUserArn(v string) *SetPermissionInput { - s.IamUserArn = &v - return s -} - -// SetLevel sets the Level field's value. -func (s *SetPermissionInput) SetLevel(v string) *SetPermissionInput { - s.Level = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *SetPermissionInput) SetStackId(v string) *SetPermissionInput { - s.StackId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetPermissionOutput -type SetPermissionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetPermissionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetPermissionOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetTimeBasedAutoScalingRequest -type SetTimeBasedAutoScalingInput struct { - _ struct{} `type:"structure"` - - // An AutoScalingSchedule with the instance schedule. - AutoScalingSchedule *WeeklyAutoScalingSchedule `type:"structure"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetTimeBasedAutoScalingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetTimeBasedAutoScalingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetTimeBasedAutoScalingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetTimeBasedAutoScalingInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoScalingSchedule sets the AutoScalingSchedule field's value. -func (s *SetTimeBasedAutoScalingInput) SetAutoScalingSchedule(v *WeeklyAutoScalingSchedule) *SetTimeBasedAutoScalingInput { - s.AutoScalingSchedule = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *SetTimeBasedAutoScalingInput) SetInstanceId(v string) *SetTimeBasedAutoScalingInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetTimeBasedAutoScalingOutput -type SetTimeBasedAutoScalingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetTimeBasedAutoScalingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetTimeBasedAutoScalingOutput) GoString() string { - return s.String() -} - -// The Shutdown event configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ShutdownEventConfiguration -type ShutdownEventConfiguration struct { - _ struct{} `type:"structure"` - - // Whether to enable Elastic Load Balancing connection draining. For more information, - // see Connection Draining (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#conn-drain) - DelayUntilElbConnectionsDrained *bool `type:"boolean"` - - // The time, in seconds, that AWS OpsWorks will wait after triggering a Shutdown - // event before shutting down an instance. - ExecutionTimeout *int64 `type:"integer"` -} - -// String returns the string representation -func (s ShutdownEventConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ShutdownEventConfiguration) GoString() string { - return s.String() -} - -// SetDelayUntilElbConnectionsDrained sets the DelayUntilElbConnectionsDrained field's value. -func (s *ShutdownEventConfiguration) SetDelayUntilElbConnectionsDrained(v bool) *ShutdownEventConfiguration { - s.DelayUntilElbConnectionsDrained = &v - return s -} - -// SetExecutionTimeout sets the ExecutionTimeout field's value. -func (s *ShutdownEventConfiguration) SetExecutionTimeout(v int64) *ShutdownEventConfiguration { - s.ExecutionTimeout = &v - return s -} - -// Contains the information required to retrieve an app or cookbook from a repository. -// For more information, see Creating Apps (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html) -// or Custom Recipes and Cookbooks (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Source -type Source struct { - _ struct{} `type:"structure"` - - // When included in a request, the parameter depends on the repository type. - // - // * For Amazon S3 bundles, set Password to the appropriate IAM secret access - // key. - // - // * For HTTP bundles and Subversion repositories, set Password to the password. - // - // For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html - // (http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html). - // - // In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual - // value. - Password *string `type:"string"` - - // The application's version. AWS OpsWorks enables you to easily deploy new - // versions of an application. One of the simplest approaches is to have branches - // or revisions in your repository that represent different versions that can - // potentially be deployed. - Revision *string `type:"string"` - - // In requests, the repository's SSH key. - // - // In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual - // value. - SshKey *string `type:"string"` - - // The repository type. - Type *string `type:"string" enum:"SourceType"` - - // The source URL. - Url *string `type:"string"` - - // This parameter depends on the repository type. - // - // * For Amazon S3 bundles, set Username to the appropriate IAM access key - // ID. - // - // * For HTTP bundles, Git repositories, and Subversion repositories, set - // Username to the user name. - Username *string `type:"string"` -} - -// String returns the string representation -func (s Source) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Source) GoString() string { - return s.String() -} - -// SetPassword sets the Password field's value. -func (s *Source) SetPassword(v string) *Source { - s.Password = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *Source) SetRevision(v string) *Source { - s.Revision = &v - return s -} - -// SetSshKey sets the SshKey field's value. -func (s *Source) SetSshKey(v string) *Source { - s.SshKey = &v - return s -} - -// SetType sets the Type field's value. -func (s *Source) SetType(v string) *Source { - s.Type = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *Source) SetUrl(v string) *Source { - s.Url = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *Source) SetUsername(v string) *Source { - s.Username = &v - return s -} - -// Describes an app's SSL configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SslConfiguration -type SslConfiguration struct { - _ struct{} `type:"structure"` - - // The contents of the certificate's domain.crt file. - // - // Certificate is a required field - Certificate *string `type:"string" required:"true"` - - // Optional. Can be used to specify an intermediate certificate authority key - // or client authentication. - Chain *string `type:"string"` - - // The private key; the contents of the certificate's domain.kex file. - // - // PrivateKey is a required field - PrivateKey *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SslConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SslConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SslConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SslConfiguration"} - if s.Certificate == nil { - invalidParams.Add(request.NewErrParamRequired("Certificate")) - } - if s.PrivateKey == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKey")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificate sets the Certificate field's value. -func (s *SslConfiguration) SetCertificate(v string) *SslConfiguration { - s.Certificate = &v - return s -} - -// SetChain sets the Chain field's value. -func (s *SslConfiguration) SetChain(v string) *SslConfiguration { - s.Chain = &v - return s -} - -// SetPrivateKey sets the PrivateKey field's value. -func (s *SslConfiguration) SetPrivateKey(v string) *SslConfiguration { - s.PrivateKey = &v - return s -} - -// Describes a stack. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Stack -type Stack struct { - _ struct{} `type:"structure"` - - // The agent version. This parameter is set to LATEST for auto-update. or a - // version number for a fixed agent version. - AgentVersion *string `type:"string"` - - // The stack's ARN. - Arn *string `type:"string"` - - // The stack's attributes. - Attributes map[string]*string `type:"map"` - - // A ChefConfiguration object that specifies whether to enable Berkshelf and - // the Berkshelf version. For more information, see Create a New Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html). - ChefConfiguration *ChefConfiguration `type:"structure"` - - // The configuration manager. - ConfigurationManager *StackConfigurationManager `type:"structure"` - - // The date when the stack was created. - CreatedAt *string `type:"string"` - - // Contains the information required to retrieve an app or cookbook from a repository. - // For more information, see Creating Apps (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html) - // or Custom Recipes and Cookbooks (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html). - CustomCookbooksSource *Source `type:"structure"` - - // A JSON object that contains user-defined attributes to be added to the stack - // configuration and deployment attributes. You can use custom JSON to override - // the corresponding default stack configuration attribute values or to pass - // data to recipes. The string should be in the following format: - // - // "{\"key1\": \"value1\", \"key2\": \"value2\",...}" - // - // For more information on custom JSON, see Use Custom JSON to Modify the Stack - // Configuration Attributes (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html). - CustomJson *string `type:"string"` - - // The stack's default Availability Zone. For more information, see Regions - // and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). - DefaultAvailabilityZone *string `type:"string"` - - // The ARN of an IAM profile that is the default profile for all of the stack's - // EC2 instances. For more information about IAM ARNs, see Using Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - DefaultInstanceProfileArn *string `type:"string"` - - // The stack's default operating system. - DefaultOs *string `type:"string"` - - // The default root device type. This value is used by default for all instances - // in the stack, but you can override it when you create an instance. For more - // information, see Storage for the Root Device (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device). - DefaultRootDeviceType *string `type:"string" enum:"RootDeviceType"` - - // A default Amazon EC2 key pair for the stack's instances. You can override - // this value when you create or update an instance. - DefaultSshKeyName *string `type:"string"` - - // The default subnet ID; applicable only if the stack is running in a VPC. - DefaultSubnetId *string `type:"string"` - - // The stack host name theme, with spaces replaced by underscores. - HostnameTheme *string `type:"string"` - - // The stack name. - Name *string `type:"string"` - - // The stack AWS region, such as "ap-northeast-2". For more information about - // AWS regions, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). - Region *string `type:"string"` - - // The stack AWS Identity and Access Management (IAM) role. - ServiceRoleArn *string `type:"string"` - - // The stack ID. - StackId *string `type:"string"` - - // Whether the stack uses custom cookbooks. - UseCustomCookbooks *bool `type:"boolean"` - - // Whether the stack automatically associates the AWS OpsWorks built-in security - // groups with the stack's layers. - UseOpsworksSecurityGroups *bool `type:"boolean"` - - // The VPC ID; applicable only if the stack is running in a VPC. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s Stack) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Stack) GoString() string { - return s.String() -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *Stack) SetAgentVersion(v string) *Stack { - s.AgentVersion = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Stack) SetArn(v string) *Stack { - s.Arn = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *Stack) SetAttributes(v map[string]*string) *Stack { - s.Attributes = v - return s -} - -// SetChefConfiguration sets the ChefConfiguration field's value. -func (s *Stack) SetChefConfiguration(v *ChefConfiguration) *Stack { - s.ChefConfiguration = v - return s -} - -// SetConfigurationManager sets the ConfigurationManager field's value. -func (s *Stack) SetConfigurationManager(v *StackConfigurationManager) *Stack { - s.ConfigurationManager = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Stack) SetCreatedAt(v string) *Stack { - s.CreatedAt = &v - return s -} - -// SetCustomCookbooksSource sets the CustomCookbooksSource field's value. -func (s *Stack) SetCustomCookbooksSource(v *Source) *Stack { - s.CustomCookbooksSource = v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *Stack) SetCustomJson(v string) *Stack { - s.CustomJson = &v - return s -} - -// SetDefaultAvailabilityZone sets the DefaultAvailabilityZone field's value. -func (s *Stack) SetDefaultAvailabilityZone(v string) *Stack { - s.DefaultAvailabilityZone = &v - return s -} - -// SetDefaultInstanceProfileArn sets the DefaultInstanceProfileArn field's value. -func (s *Stack) SetDefaultInstanceProfileArn(v string) *Stack { - s.DefaultInstanceProfileArn = &v - return s -} - -// SetDefaultOs sets the DefaultOs field's value. -func (s *Stack) SetDefaultOs(v string) *Stack { - s.DefaultOs = &v - return s -} - -// SetDefaultRootDeviceType sets the DefaultRootDeviceType field's value. -func (s *Stack) SetDefaultRootDeviceType(v string) *Stack { - s.DefaultRootDeviceType = &v - return s -} - -// SetDefaultSshKeyName sets the DefaultSshKeyName field's value. -func (s *Stack) SetDefaultSshKeyName(v string) *Stack { - s.DefaultSshKeyName = &v - return s -} - -// SetDefaultSubnetId sets the DefaultSubnetId field's value. -func (s *Stack) SetDefaultSubnetId(v string) *Stack { - s.DefaultSubnetId = &v - return s -} - -// SetHostnameTheme sets the HostnameTheme field's value. -func (s *Stack) SetHostnameTheme(v string) *Stack { - s.HostnameTheme = &v - return s -} - -// SetName sets the Name field's value. -func (s *Stack) SetName(v string) *Stack { - s.Name = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *Stack) SetRegion(v string) *Stack { - s.Region = &v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *Stack) SetServiceRoleArn(v string) *Stack { - s.ServiceRoleArn = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *Stack) SetStackId(v string) *Stack { - s.StackId = &v - return s -} - -// SetUseCustomCookbooks sets the UseCustomCookbooks field's value. -func (s *Stack) SetUseCustomCookbooks(v bool) *Stack { - s.UseCustomCookbooks = &v - return s -} - -// SetUseOpsworksSecurityGroups sets the UseOpsworksSecurityGroups field's value. -func (s *Stack) SetUseOpsworksSecurityGroups(v bool) *Stack { - s.UseOpsworksSecurityGroups = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Stack) SetVpcId(v string) *Stack { - s.VpcId = &v - return s -} - -// Describes the configuration manager. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StackConfigurationManager -type StackConfigurationManager struct { - _ struct{} `type:"structure"` - - // The name. This parameter must be set to "Chef". - Name *string `type:"string"` - - // The Chef version. This parameter must be set to 12, 11.10, or 11.4 for Linux - // stacks, and to 12.2 for Windows stacks. The default value for Linux stacks - // is 11.4. - Version *string `type:"string"` -} - -// String returns the string representation -func (s StackConfigurationManager) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StackConfigurationManager) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *StackConfigurationManager) SetName(v string) *StackConfigurationManager { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *StackConfigurationManager) SetVersion(v string) *StackConfigurationManager { - s.Version = &v - return s -} - -// Summarizes the number of layers, instances, and apps in a stack. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StackSummary -type StackSummary struct { - _ struct{} `type:"structure"` - - // The number of apps. - AppsCount *int64 `type:"integer"` - - // The stack's ARN. - Arn *string `type:"string"` - - // An InstancesCount object with the number of instances in each status. - InstancesCount *InstancesCount `type:"structure"` - - // The number of layers. - LayersCount *int64 `type:"integer"` - - // The stack name. - Name *string `type:"string"` - - // The stack ID. - StackId *string `type:"string"` -} - -// String returns the string representation -func (s StackSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StackSummary) GoString() string { - return s.String() -} - -// SetAppsCount sets the AppsCount field's value. -func (s *StackSummary) SetAppsCount(v int64) *StackSummary { - s.AppsCount = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *StackSummary) SetArn(v string) *StackSummary { - s.Arn = &v - return s -} - -// SetInstancesCount sets the InstancesCount field's value. -func (s *StackSummary) SetInstancesCount(v *InstancesCount) *StackSummary { - s.InstancesCount = v - return s -} - -// SetLayersCount sets the LayersCount field's value. -func (s *StackSummary) SetLayersCount(v int64) *StackSummary { - s.LayersCount = &v - return s -} - -// SetName sets the Name field's value. -func (s *StackSummary) SetName(v string) *StackSummary { - s.Name = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *StackSummary) SetStackId(v string) *StackSummary { - s.StackId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartInstanceRequest -type StartInstanceInput struct { - _ struct{} `type:"structure"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StartInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *StartInstanceInput) SetInstanceId(v string) *StartInstanceInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartInstanceOutput -type StartInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StartInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartStackRequest -type StartStackInput struct { - _ struct{} `type:"structure"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StartStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartStackInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackId sets the StackId field's value. -func (s *StartStackInput) SetStackId(v string) *StartStackInput { - s.StackId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartStackOutput -type StartStackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StartStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartStackOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopInstanceRequest -type StopInstanceInput struct { - _ struct{} `type:"structure"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StopInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *StopInstanceInput) SetInstanceId(v string) *StopInstanceInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopInstanceOutput -type StopInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StopInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopStackRequest -type StopStackInput struct { - _ struct{} `type:"structure"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StopStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopStackInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStackId sets the StackId field's value. -func (s *StopStackInput) SetStackId(v string) *StopStackInput { - s.StackId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopStackOutput -type StopStackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StopStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopStackOutput) GoString() string { - return s.String() -} - -// Contains the data needed by RDP clients such as the Microsoft Remote Desktop -// Connection to log in to the instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/TemporaryCredential -type TemporaryCredential struct { - _ struct{} `type:"structure"` - - // The instance's AWS OpsWorks ID. - InstanceId *string `type:"string"` - - // The password. - Password *string `type:"string"` - - // The user name. - Username *string `type:"string"` - - // The length of time (in minutes) that the grant is valid. When the grant expires, - // at the end of this period, the user will no longer be able to use the credentials - // to log in. If they are logged in at the time, they will be automatically - // logged out. - ValidForInMinutes *int64 `type:"integer"` -} - -// String returns the string representation -func (s TemporaryCredential) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TemporaryCredential) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *TemporaryCredential) SetInstanceId(v string) *TemporaryCredential { - s.InstanceId = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *TemporaryCredential) SetPassword(v string) *TemporaryCredential { - s.Password = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *TemporaryCredential) SetUsername(v string) *TemporaryCredential { - s.Username = &v - return s -} - -// SetValidForInMinutes sets the ValidForInMinutes field's value. -func (s *TemporaryCredential) SetValidForInMinutes(v int64) *TemporaryCredential { - s.ValidForInMinutes = &v - return s -} - -// Describes an instance's time-based auto scaling configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/TimeBasedAutoScalingConfiguration -type TimeBasedAutoScalingConfiguration struct { - _ struct{} `type:"structure"` - - // A WeeklyAutoScalingSchedule object with the instance schedule. - AutoScalingSchedule *WeeklyAutoScalingSchedule `type:"structure"` - - // The instance ID. - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s TimeBasedAutoScalingConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimeBasedAutoScalingConfiguration) GoString() string { - return s.String() -} - -// SetAutoScalingSchedule sets the AutoScalingSchedule field's value. -func (s *TimeBasedAutoScalingConfiguration) SetAutoScalingSchedule(v *WeeklyAutoScalingSchedule) *TimeBasedAutoScalingConfiguration { - s.AutoScalingSchedule = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *TimeBasedAutoScalingConfiguration) SetInstanceId(v string) *TimeBasedAutoScalingConfiguration { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignInstanceRequest -type UnassignInstanceInput struct { - _ struct{} `type:"structure"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UnassignInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnassignInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnassignInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *UnassignInstanceInput) SetInstanceId(v string) *UnassignInstanceInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignInstanceOutput -type UnassignInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UnassignInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignVolumeRequest -type UnassignVolumeInput struct { - _ struct{} `type:"structure"` - - // The volume ID. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UnassignVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnassignVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnassignVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVolumeId sets the VolumeId field's value. -func (s *UnassignVolumeInput) SetVolumeId(v string) *UnassignVolumeInput { - s.VolumeId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignVolumeOutput -type UnassignVolumeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UnassignVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignVolumeOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateAppRequest -type UpdateAppInput struct { - _ struct{} `type:"structure"` - - // The app ID. - // - // AppId is a required field - AppId *string `type:"string" required:"true"` - - // A Source object that specifies the app repository. - AppSource *Source `type:"structure"` - - // One or more user-defined key/value pairs to be added to the stack attributes. - Attributes map[string]*string `type:"map"` - - // The app's data sources. - DataSources []*DataSource `type:"list"` - - // A description of the app. - Description *string `type:"string"` - - // The app's virtual host settings, with multiple domains separated by commas. - // For example: 'www.example.com, example.com' - Domains []*string `type:"list"` - - // Whether SSL is enabled for the app. - EnableSsl *bool `type:"boolean"` - - // An array of EnvironmentVariable objects that specify environment variables - // to be associated with the app. After you deploy the app, these variables - // are defined on the associated app server instances.For more information, - // see Environment Variables (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment). - // - // There is no specific limit on the number of environment variables. However, - // the size of the associated data structure - which includes the variables' - // names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). - // This limit should accommodate most if not all use cases. Exceeding it will - // cause an exception with the message, "Environment: is too large (maximum - // is 10KB)." - // - // This parameter is supported only by Chef 11.10 stacks. If you have specified - // one or more environment variables, you cannot modify the stack's Chef version. - Environment []*EnvironmentVariable `type:"list"` - - // The app name. - Name *string `type:"string"` - - // An SslConfiguration object with the SSL configuration. - SslConfiguration *SslConfiguration `type:"structure"` - - // The app type. - Type *string `type:"string" enum:"AppType"` -} - -// String returns the string representation -func (s UpdateAppInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAppInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAppInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAppInput"} - if s.AppId == nil { - invalidParams.Add(request.NewErrParamRequired("AppId")) - } - if s.Environment != nil { - for i, v := range s.Environment { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Environment", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SslConfiguration != nil { - if err := s.SslConfiguration.Validate(); err != nil { - invalidParams.AddNested("SslConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppId sets the AppId field's value. -func (s *UpdateAppInput) SetAppId(v string) *UpdateAppInput { - s.AppId = &v - return s -} - -// SetAppSource sets the AppSource field's value. -func (s *UpdateAppInput) SetAppSource(v *Source) *UpdateAppInput { - s.AppSource = v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *UpdateAppInput) SetAttributes(v map[string]*string) *UpdateAppInput { - s.Attributes = v - return s -} - -// SetDataSources sets the DataSources field's value. -func (s *UpdateAppInput) SetDataSources(v []*DataSource) *UpdateAppInput { - s.DataSources = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAppInput) SetDescription(v string) *UpdateAppInput { - s.Description = &v - return s -} - -// SetDomains sets the Domains field's value. -func (s *UpdateAppInput) SetDomains(v []*string) *UpdateAppInput { - s.Domains = v - return s -} - -// SetEnableSsl sets the EnableSsl field's value. -func (s *UpdateAppInput) SetEnableSsl(v bool) *UpdateAppInput { - s.EnableSsl = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *UpdateAppInput) SetEnvironment(v []*EnvironmentVariable) *UpdateAppInput { - s.Environment = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateAppInput) SetName(v string) *UpdateAppInput { - s.Name = &v - return s -} - -// SetSslConfiguration sets the SslConfiguration field's value. -func (s *UpdateAppInput) SetSslConfiguration(v *SslConfiguration) *UpdateAppInput { - s.SslConfiguration = v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateAppInput) SetType(v string) *UpdateAppInput { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateAppOutput -type UpdateAppOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateAppOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAppOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateElasticIpRequest -type UpdateElasticIpInput struct { - _ struct{} `type:"structure"` - - // The address. - // - // ElasticIp is a required field - ElasticIp *string `type:"string" required:"true"` - - // The new name. - Name *string `type:"string"` -} - -// String returns the string representation -func (s UpdateElasticIpInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateElasticIpInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateElasticIpInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateElasticIpInput"} - if s.ElasticIp == nil { - invalidParams.Add(request.NewErrParamRequired("ElasticIp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *UpdateElasticIpInput) SetElasticIp(v string) *UpdateElasticIpInput { - s.ElasticIp = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateElasticIpInput) SetName(v string) *UpdateElasticIpInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateElasticIpOutput -type UpdateElasticIpOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateElasticIpOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateElasticIpOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateInstanceRequest -type UpdateInstanceInput struct { - _ struct{} `type:"structure"` - - // The default AWS OpsWorks agent version. You have the following options: - // - // * INHERIT - Use the stack's default agent version setting. - // - // * version_number - Use the specified agent version. This value overrides - // the stack's default setting. To update the agent version, you must edit - // the instance configuration and specify a new version. AWS OpsWorks then - // automatically installs that version on the instance. - // - // The default setting is INHERIT. To specify an agent version, you must use - // the complete version number, not the abbreviated number shown on the console. - // For a list of available agent version numbers, call DescribeAgentVersions. - AgentVersion *string `type:"string"` - - // The ID of the AMI that was used to create the instance. The value of this - // parameter must be the same AMI ID that the instance is already using. You - // cannot apply a new AMI to an instance by running UpdateInstance. UpdateInstance - // does not work on instances that are using custom AMIs. - AmiId *string `type:"string"` - - // The instance architecture. Instance types do not necessarily support both - // architectures. For a list of the architectures that are supported by the - // different instance types, see Instance Families and Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). - Architecture *string `type:"string" enum:"Architecture"` - - // For load-based or time-based instances, the type. Windows stacks can use - // only time-based instances. - AutoScalingType *string `type:"string" enum:"AutoScalingType"` - - // This property cannot be updated. - EbsOptimized *bool `type:"boolean"` - - // The instance host name. - Hostname *string `type:"string"` - - // Whether to install operating system and package updates when the instance - // boots. The default value is true. To control when updates are installed, - // set this value to false. You must then update your instances manually by - // using CreateDeployment to run the update_dependencies stack command or by - // manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. - // - // We strongly recommend using the default value of true, to ensure that your - // instances have the latest security updates. - InstallUpdatesOnBoot *bool `type:"boolean"` - - // The instance ID. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The instance type, such as t2.micro. For a list of supported instance types, - // open the stack in the console, choose Instances, and choose + Instance. The - // Size list contains the currently supported types. For more information, see - // Instance Families and Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). - // The parameter values that you use to specify the various types are in the - // API Name column of the Available Instance Types table. - InstanceType *string `type:"string"` - - // The instance's layer IDs. - LayerIds []*string `type:"list"` - - // The instance's operating system, which must be set to one of the following. - // You cannot update an instance that is using a custom AMI. - // - // * A supported Linux operating system: An Amazon Linux version, such as - // Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon Linux 2015.03. - // - // * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu - // 14.04 LTS, or Ubuntu 12.04 LTS. - // - // * CentOS 7 - // - // * Red Hat Enterprise Linux 7 - // - // * A supported Windows operating system, such as Microsoft Windows Server - // 2012 R2 Base, Microsoft Windows Server 2012 R2 with SQL Server Express, - // Microsoft Windows Server 2012 R2 with SQL Server Standard, or Microsoft - // Windows Server 2012 R2 with SQL Server Web. - // - // For more information on the supported operating systems, see AWS OpsWorks - // Operating Systems (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html). - // - // The default option is the current Amazon Linux version. If you set this parameter - // to Custom, you must use the AmiId parameter to specify the custom AMI that - // you want to use. For more information on the supported operating systems, - // see Operating Systems (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html). - // For more information on how to use custom AMIs with OpsWorks, see Using Custom - // AMIs (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html). - // - // You can specify a different Linux operating system for the updated stack, - // but you cannot change from Linux to Windows or Windows to Linux. - Os *string `type:"string"` - - // The instance's Amazon EC2 key name. - SshKeyName *string `type:"string"` -} - -// String returns the string representation -func (s UpdateInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *UpdateInstanceInput) SetAgentVersion(v string) *UpdateInstanceInput { - s.AgentVersion = &v - return s -} - -// SetAmiId sets the AmiId field's value. -func (s *UpdateInstanceInput) SetAmiId(v string) *UpdateInstanceInput { - s.AmiId = &v - return s -} - -// SetArchitecture sets the Architecture field's value. -func (s *UpdateInstanceInput) SetArchitecture(v string) *UpdateInstanceInput { - s.Architecture = &v - return s -} - -// SetAutoScalingType sets the AutoScalingType field's value. -func (s *UpdateInstanceInput) SetAutoScalingType(v string) *UpdateInstanceInput { - s.AutoScalingType = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *UpdateInstanceInput) SetEbsOptimized(v bool) *UpdateInstanceInput { - s.EbsOptimized = &v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *UpdateInstanceInput) SetHostname(v string) *UpdateInstanceInput { - s.Hostname = &v - return s -} - -// SetInstallUpdatesOnBoot sets the InstallUpdatesOnBoot field's value. -func (s *UpdateInstanceInput) SetInstallUpdatesOnBoot(v bool) *UpdateInstanceInput { - s.InstallUpdatesOnBoot = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *UpdateInstanceInput) SetInstanceId(v string) *UpdateInstanceInput { - s.InstanceId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *UpdateInstanceInput) SetInstanceType(v string) *UpdateInstanceInput { - s.InstanceType = &v - return s -} - -// SetLayerIds sets the LayerIds field's value. -func (s *UpdateInstanceInput) SetLayerIds(v []*string) *UpdateInstanceInput { - s.LayerIds = v - return s -} - -// SetOs sets the Os field's value. -func (s *UpdateInstanceInput) SetOs(v string) *UpdateInstanceInput { - s.Os = &v - return s -} - -// SetSshKeyName sets the SshKeyName field's value. -func (s *UpdateInstanceInput) SetSshKeyName(v string) *UpdateInstanceInput { - s.SshKeyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateInstanceOutput -type UpdateInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateLayerRequest -type UpdateLayerInput struct { - _ struct{} `type:"structure"` - - // One or more user-defined key/value pairs to be added to the stack attributes. - Attributes map[string]*string `type:"map"` - - // Whether to automatically assign an Elastic IP address (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) - // to the layer's instances. For more information, see How to Edit a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html). - AutoAssignElasticIps *bool `type:"boolean"` - - // For stacks that are running in a VPC, whether to automatically assign a public - // IP address to the layer's instances. For more information, see How to Edit - // a Layer (http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html). - AutoAssignPublicIps *bool `type:"boolean"` - - // The ARN of an IAM profile to be used for all of the layer's EC2 instances. - // For more information about IAM ARNs, see Using Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - CustomInstanceProfileArn *string `type:"string"` - - // A JSON-formatted string containing custom stack configuration and deployment - // attributes to be installed on the layer's instances. For more information, - // see Using Custom JSON (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html). - CustomJson *string `type:"string"` - - // A LayerCustomRecipes object that specifies the layer's custom recipes. - CustomRecipes *Recipes `type:"structure"` - - // An array containing the layer's custom security group IDs. - CustomSecurityGroupIds []*string `type:"list"` - - // Whether to disable auto healing for the layer. - EnableAutoHealing *bool `type:"boolean"` - - // Whether to install operating system and package updates when the instance - // boots. The default value is true. To control when updates are installed, - // set this value to false. You must then update your instances manually by - // using CreateDeployment to run the update_dependencies stack command or manually - // running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. - // - // We strongly recommend using the default value of true, to ensure that your - // instances have the latest security updates. - InstallUpdatesOnBoot *bool `type:"boolean"` - - // The layer ID. - // - // LayerId is a required field - LayerId *string `type:"string" required:"true"` - - LifecycleEventConfiguration *LifecycleEventConfiguration `type:"structure"` - - // The layer name, which is used by the console. - Name *string `type:"string"` - - // An array of Package objects that describe the layer's packages. - Packages []*string `type:"list"` - - // For custom layers only, use this parameter to specify the layer's short name, - // which is used internally by AWS OpsWorksand by Chef. The short name is also - // used as the name for the directory where your app files are installed. It - // can have a maximum of 200 characters and must be in the following format: - // /\A[a-z0-9\-\_\.]+\Z/. - // - // The built-in layers' short names are defined by AWS OpsWorks. For more information, - // see the Layer Reference (http://docs.aws.amazon.com/opsworks/latest/userguide/layers.html) - Shortname *string `type:"string"` - - // Whether to use Amazon EBS-optimized instances. - UseEbsOptimizedInstances *bool `type:"boolean"` - - // A VolumeConfigurations object that describes the layer's Amazon EBS volumes. - VolumeConfigurations []*VolumeConfiguration `type:"list"` -} - -// String returns the string representation -func (s UpdateLayerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateLayerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateLayerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateLayerInput"} - if s.LayerId == nil { - invalidParams.Add(request.NewErrParamRequired("LayerId")) - } - if s.VolumeConfigurations != nil { - for i, v := range s.VolumeConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VolumeConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *UpdateLayerInput) SetAttributes(v map[string]*string) *UpdateLayerInput { - s.Attributes = v - return s -} - -// SetAutoAssignElasticIps sets the AutoAssignElasticIps field's value. -func (s *UpdateLayerInput) SetAutoAssignElasticIps(v bool) *UpdateLayerInput { - s.AutoAssignElasticIps = &v - return s -} - -// SetAutoAssignPublicIps sets the AutoAssignPublicIps field's value. -func (s *UpdateLayerInput) SetAutoAssignPublicIps(v bool) *UpdateLayerInput { - s.AutoAssignPublicIps = &v - return s -} - -// SetCustomInstanceProfileArn sets the CustomInstanceProfileArn field's value. -func (s *UpdateLayerInput) SetCustomInstanceProfileArn(v string) *UpdateLayerInput { - s.CustomInstanceProfileArn = &v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *UpdateLayerInput) SetCustomJson(v string) *UpdateLayerInput { - s.CustomJson = &v - return s -} - -// SetCustomRecipes sets the CustomRecipes field's value. -func (s *UpdateLayerInput) SetCustomRecipes(v *Recipes) *UpdateLayerInput { - s.CustomRecipes = v - return s -} - -// SetCustomSecurityGroupIds sets the CustomSecurityGroupIds field's value. -func (s *UpdateLayerInput) SetCustomSecurityGroupIds(v []*string) *UpdateLayerInput { - s.CustomSecurityGroupIds = v - return s -} - -// SetEnableAutoHealing sets the EnableAutoHealing field's value. -func (s *UpdateLayerInput) SetEnableAutoHealing(v bool) *UpdateLayerInput { - s.EnableAutoHealing = &v - return s -} - -// SetInstallUpdatesOnBoot sets the InstallUpdatesOnBoot field's value. -func (s *UpdateLayerInput) SetInstallUpdatesOnBoot(v bool) *UpdateLayerInput { - s.InstallUpdatesOnBoot = &v - return s -} - -// SetLayerId sets the LayerId field's value. -func (s *UpdateLayerInput) SetLayerId(v string) *UpdateLayerInput { - s.LayerId = &v - return s -} - -// SetLifecycleEventConfiguration sets the LifecycleEventConfiguration field's value. -func (s *UpdateLayerInput) SetLifecycleEventConfiguration(v *LifecycleEventConfiguration) *UpdateLayerInput { - s.LifecycleEventConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateLayerInput) SetName(v string) *UpdateLayerInput { - s.Name = &v - return s -} - -// SetPackages sets the Packages field's value. -func (s *UpdateLayerInput) SetPackages(v []*string) *UpdateLayerInput { - s.Packages = v - return s -} - -// SetShortname sets the Shortname field's value. -func (s *UpdateLayerInput) SetShortname(v string) *UpdateLayerInput { - s.Shortname = &v - return s -} - -// SetUseEbsOptimizedInstances sets the UseEbsOptimizedInstances field's value. -func (s *UpdateLayerInput) SetUseEbsOptimizedInstances(v bool) *UpdateLayerInput { - s.UseEbsOptimizedInstances = &v - return s -} - -// SetVolumeConfigurations sets the VolumeConfigurations field's value. -func (s *UpdateLayerInput) SetVolumeConfigurations(v []*VolumeConfiguration) *UpdateLayerInput { - s.VolumeConfigurations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateLayerOutput -type UpdateLayerOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateLayerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateLayerOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateMyUserProfileRequest -type UpdateMyUserProfileInput struct { - _ struct{} `type:"structure"` - - // The user's SSH public key. - SshPublicKey *string `type:"string"` -} - -// String returns the string representation -func (s UpdateMyUserProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateMyUserProfileInput) GoString() string { - return s.String() -} - -// SetSshPublicKey sets the SshPublicKey field's value. -func (s *UpdateMyUserProfileInput) SetSshPublicKey(v string) *UpdateMyUserProfileInput { - s.SshPublicKey = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateMyUserProfileOutput -type UpdateMyUserProfileOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateMyUserProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateMyUserProfileOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateRdsDbInstanceRequest -type UpdateRdsDbInstanceInput struct { - _ struct{} `type:"structure"` - - // The database password. - DbPassword *string `type:"string"` - - // The master user name. - DbUser *string `type:"string"` - - // The Amazon RDS instance's ARN. - // - // RdsDbInstanceArn is a required field - RdsDbInstanceArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateRdsDbInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRdsDbInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRdsDbInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRdsDbInstanceInput"} - if s.RdsDbInstanceArn == nil { - invalidParams.Add(request.NewErrParamRequired("RdsDbInstanceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDbPassword sets the DbPassword field's value. -func (s *UpdateRdsDbInstanceInput) SetDbPassword(v string) *UpdateRdsDbInstanceInput { - s.DbPassword = &v - return s -} - -// SetDbUser sets the DbUser field's value. -func (s *UpdateRdsDbInstanceInput) SetDbUser(v string) *UpdateRdsDbInstanceInput { - s.DbUser = &v - return s -} - -// SetRdsDbInstanceArn sets the RdsDbInstanceArn field's value. -func (s *UpdateRdsDbInstanceInput) SetRdsDbInstanceArn(v string) *UpdateRdsDbInstanceInput { - s.RdsDbInstanceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateRdsDbInstanceOutput -type UpdateRdsDbInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateRdsDbInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRdsDbInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateStackRequest -type UpdateStackInput struct { - _ struct{} `type:"structure"` - - // The default AWS OpsWorks agent version. You have the following options: - // - // * Auto-update - Set this parameter to LATEST. AWS OpsWorks automatically - // installs new agent versions on the stack's instances as soon as they are - // available. - // - // * Fixed version - Set this parameter to your preferred agent version. - // To update the agent version, you must edit the stack configuration and - // specify a new version. AWS OpsWorks then automatically installs that version - // on the stack's instances. - // - // The default setting is LATEST. To specify an agent version, you must use - // the complete version number, not the abbreviated number shown on the console. - // For a list of available agent version numbers, call DescribeAgentVersions. - // - // You can also specify an agent version when you create or update an instance, - // which overrides the stack's default setting. - AgentVersion *string `type:"string"` - - // One or more user-defined key-value pairs to be added to the stack attributes. - Attributes map[string]*string `type:"map"` - - // A ChefConfiguration object that specifies whether to enable Berkshelf and - // the Berkshelf version on Chef 11.10 stacks. For more information, see Create - // a New Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html). - ChefConfiguration *ChefConfiguration `type:"structure"` - - // The configuration manager. When you update a stack, we recommend that you - // use the configuration manager to specify the Chef version: 12, 11.10, or - // 11.4 for Linux stacks, or 12.2 for Windows stacks. The default value for - // Linux stacks is currently 11.4. - ConfigurationManager *StackConfigurationManager `type:"structure"` - - // Contains the information required to retrieve an app or cookbook from a repository. - // For more information, see Creating Apps (http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html) - // or Custom Recipes and Cookbooks (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html). - CustomCookbooksSource *Source `type:"structure"` - - // A string that contains user-defined, custom JSON. It can be used to override - // the corresponding default stack configuration JSON values or to pass data - // to recipes. The string should be in the following format: - // - // "{\"key1\": \"value1\", \"key2\": \"value2\",...}" - // - // For more information on custom JSON, see Use Custom JSON to Modify the Stack - // Configuration Attributes (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html). - CustomJson *string `type:"string"` - - // The stack's default Availability Zone, which must be in the stack's region. - // For more information, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). - // If you also specify a value for DefaultSubnetId, the subnet must be in the - // same zone. For more information, see CreateStack. - DefaultAvailabilityZone *string `type:"string"` - - // The ARN of an IAM profile that is the default profile for all of the stack's - // EC2 instances. For more information about IAM ARNs, see Using Identifiers - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html). - DefaultInstanceProfileArn *string `type:"string"` - - // The stack's operating system, which must be set to one of the following: - // - // * A supported Linux operating system: An Amazon Linux version, such as - // Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon Linux 2015.03. - // - // * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu - // 14.04 LTS, or Ubuntu 12.04 LTS. - // - // * CentOS 7 - // - // * Red Hat Enterprise Linux 7 - // - // * A supported Windows operating system, such as Microsoft Windows Server - // 2012 R2 Base, Microsoft Windows Server 2012 R2 with SQL Server Express, - // Microsoft Windows Server 2012 R2 with SQL Server Standard, or Microsoft - // Windows Server 2012 R2 with SQL Server Web. - // - // * A custom AMI: Custom. You specify the custom AMI you want to use when - // you create instances. For more information on how to use custom AMIs with - // OpsWorks, see Using Custom AMIs (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html). - // - // The default option is the stack's current operating system. For more information - // on the supported operating systems, see AWS OpsWorks Operating Systems (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html). - DefaultOs *string `type:"string"` - - // The default root device type. This value is used by default for all instances - // in the stack, but you can override it when you create an instance. For more - // information, see Storage for the Root Device (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device). - DefaultRootDeviceType *string `type:"string" enum:"RootDeviceType"` - - // A default Amazon EC2 key-pair name. The default value is none. If you specify - // a key-pair name, AWS OpsWorks installs the public key on the instance and - // you can use the private key with an SSH client to log in to the instance. - // For more information, see Using SSH to Communicate with an Instance (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html) - // and Managing SSH Access (http://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html). - // You can override this setting by specifying a different key pair, or no key - // pair, when you create an instance (http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html). - DefaultSshKeyName *string `type:"string"` - - // The stack's default VPC subnet ID. This parameter is required if you specify - // a value for the VpcId parameter. All instances are launched into this subnet - // unless you specify otherwise when you create the instance. If you also specify - // a value for DefaultAvailabilityZone, the subnet must be in that zone. For - // information on default values and when this parameter is required, see the - // VpcId parameter description. - DefaultSubnetId *string `type:"string"` - - // The stack's new host name theme, with spaces replaced by underscores. The - // theme is used to generate host names for the stack's instances. By default, - // HostnameTheme is set to Layer_Dependent, which creates host names by appending - // integers to the layer's short name. The other themes are: - // - // * Baked_Goods - // - // * Clouds - // - // * Europe_Cities - // - // * Fruits - // - // * Greek_Deities - // - // * Legendary_creatures_from_Japan - // - // * Planets_and_Moons - // - // * Roman_Deities - // - // * Scottish_Islands - // - // * US_Cities - // - // * Wild_Cats - // - // To obtain a generated host name, call GetHostNameSuggestion, which returns - // a host name based on the current theme. - HostnameTheme *string `type:"string"` - - // The stack's new name. - Name *string `type:"string"` - - // Do not use this parameter. You cannot update a stack's service role. - ServiceRoleArn *string `type:"string"` - - // The stack ID. - // - // StackId is a required field - StackId *string `type:"string" required:"true"` - - // Whether the stack uses custom cookbooks. - UseCustomCookbooks *bool `type:"boolean"` - - // Whether to associate the AWS OpsWorks built-in security groups with the stack's - // layers. - // - // AWS OpsWorks provides a standard set of built-in security groups, one for - // each layer, which are associated with layers by default. UseOpsworksSecurityGroups - // allows you to provide your own custom security groups instead of using the - // built-in groups. UseOpsworksSecurityGroups has the following settings: - // - // * True - AWS OpsWorks automatically associates the appropriate built-in - // security group with each layer (default setting). You can associate additional - // security groups with a layer after you create it, but you cannot delete - // the built-in security group. - // - // * False - AWS OpsWorks does not associate built-in security groups with - // layers. You must create appropriate EC2 security groups and associate - // a security group with each layer that you create. However, you can still - // manually associate a built-in security group with a layer on. Custom security - // groups are required only for those layers that need custom settings. - // - // For more information, see Create a New Stack (http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html). - UseOpsworksSecurityGroups *bool `type:"boolean"` -} - -// String returns the string representation -func (s UpdateStackInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateStackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateStackInput"} - if s.StackId == nil { - invalidParams.Add(request.NewErrParamRequired("StackId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *UpdateStackInput) SetAgentVersion(v string) *UpdateStackInput { - s.AgentVersion = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *UpdateStackInput) SetAttributes(v map[string]*string) *UpdateStackInput { - s.Attributes = v - return s -} - -// SetChefConfiguration sets the ChefConfiguration field's value. -func (s *UpdateStackInput) SetChefConfiguration(v *ChefConfiguration) *UpdateStackInput { - s.ChefConfiguration = v - return s -} - -// SetConfigurationManager sets the ConfigurationManager field's value. -func (s *UpdateStackInput) SetConfigurationManager(v *StackConfigurationManager) *UpdateStackInput { - s.ConfigurationManager = v - return s -} - -// SetCustomCookbooksSource sets the CustomCookbooksSource field's value. -func (s *UpdateStackInput) SetCustomCookbooksSource(v *Source) *UpdateStackInput { - s.CustomCookbooksSource = v - return s -} - -// SetCustomJson sets the CustomJson field's value. -func (s *UpdateStackInput) SetCustomJson(v string) *UpdateStackInput { - s.CustomJson = &v - return s -} - -// SetDefaultAvailabilityZone sets the DefaultAvailabilityZone field's value. -func (s *UpdateStackInput) SetDefaultAvailabilityZone(v string) *UpdateStackInput { - s.DefaultAvailabilityZone = &v - return s -} - -// SetDefaultInstanceProfileArn sets the DefaultInstanceProfileArn field's value. -func (s *UpdateStackInput) SetDefaultInstanceProfileArn(v string) *UpdateStackInput { - s.DefaultInstanceProfileArn = &v - return s -} - -// SetDefaultOs sets the DefaultOs field's value. -func (s *UpdateStackInput) SetDefaultOs(v string) *UpdateStackInput { - s.DefaultOs = &v - return s -} - -// SetDefaultRootDeviceType sets the DefaultRootDeviceType field's value. -func (s *UpdateStackInput) SetDefaultRootDeviceType(v string) *UpdateStackInput { - s.DefaultRootDeviceType = &v - return s -} - -// SetDefaultSshKeyName sets the DefaultSshKeyName field's value. -func (s *UpdateStackInput) SetDefaultSshKeyName(v string) *UpdateStackInput { - s.DefaultSshKeyName = &v - return s -} - -// SetDefaultSubnetId sets the DefaultSubnetId field's value. -func (s *UpdateStackInput) SetDefaultSubnetId(v string) *UpdateStackInput { - s.DefaultSubnetId = &v - return s -} - -// SetHostnameTheme sets the HostnameTheme field's value. -func (s *UpdateStackInput) SetHostnameTheme(v string) *UpdateStackInput { - s.HostnameTheme = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateStackInput) SetName(v string) *UpdateStackInput { - s.Name = &v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *UpdateStackInput) SetServiceRoleArn(v string) *UpdateStackInput { - s.ServiceRoleArn = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *UpdateStackInput) SetStackId(v string) *UpdateStackInput { - s.StackId = &v - return s -} - -// SetUseCustomCookbooks sets the UseCustomCookbooks field's value. -func (s *UpdateStackInput) SetUseCustomCookbooks(v bool) *UpdateStackInput { - s.UseCustomCookbooks = &v - return s -} - -// SetUseOpsworksSecurityGroups sets the UseOpsworksSecurityGroups field's value. -func (s *UpdateStackInput) SetUseOpsworksSecurityGroups(v bool) *UpdateStackInput { - s.UseOpsworksSecurityGroups = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateStackOutput -type UpdateStackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateStackOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateUserProfileRequest -type UpdateUserProfileInput struct { - _ struct{} `type:"structure"` - - // Whether users can specify their own SSH public key through the My Settings - // page. For more information, see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/security-settingsshkey.html). - AllowSelfManagement *bool `type:"boolean"` - - // The user IAM ARN. This can also be a federated user's ARN. - // - // IamUserArn is a required field - IamUserArn *string `type:"string" required:"true"` - - // The user's new SSH public key. - SshPublicKey *string `type:"string"` - - // The user's SSH user name. The allowable characters are [a-z], [A-Z], [0-9], - // '-', and '_'. If the specified name includes other punctuation marks, AWS - // OpsWorks removes them. For example, my.name will be changed to myname. If - // you do not specify an SSH user name, AWS OpsWorks generates one from the - // IAM user name. - SshUsername *string `type:"string"` -} - -// String returns the string representation -func (s UpdateUserProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateUserProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateUserProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateUserProfileInput"} - if s.IamUserArn == nil { - invalidParams.Add(request.NewErrParamRequired("IamUserArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowSelfManagement sets the AllowSelfManagement field's value. -func (s *UpdateUserProfileInput) SetAllowSelfManagement(v bool) *UpdateUserProfileInput { - s.AllowSelfManagement = &v - return s -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *UpdateUserProfileInput) SetIamUserArn(v string) *UpdateUserProfileInput { - s.IamUserArn = &v - return s -} - -// SetSshPublicKey sets the SshPublicKey field's value. -func (s *UpdateUserProfileInput) SetSshPublicKey(v string) *UpdateUserProfileInput { - s.SshPublicKey = &v - return s -} - -// SetSshUsername sets the SshUsername field's value. -func (s *UpdateUserProfileInput) SetSshUsername(v string) *UpdateUserProfileInput { - s.SshUsername = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateUserProfileOutput -type UpdateUserProfileOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateUserProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateUserProfileOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateVolumeRequest -type UpdateVolumeInput struct { - _ struct{} `type:"structure"` - - // The new mount point. - MountPoint *string `type:"string"` - - // The new name. - Name *string `type:"string"` - - // The volume ID. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMountPoint sets the MountPoint field's value. -func (s *UpdateVolumeInput) SetMountPoint(v string) *UpdateVolumeInput { - s.MountPoint = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateVolumeInput) SetName(v string) *UpdateVolumeInput { - s.Name = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *UpdateVolumeInput) SetVolumeId(v string) *UpdateVolumeInput { - s.VolumeId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateVolumeOutput -type UpdateVolumeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateVolumeOutput) GoString() string { - return s.String() -} - -// Describes a user's SSH information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UserProfile -type UserProfile struct { - _ struct{} `type:"structure"` - - // Whether users can specify their own SSH public key through the My Settings - // page. For more information, see Managing User Permissions (http://docs.aws.amazon.com/opsworks/latest/userguide/security-settingsshkey.html). - AllowSelfManagement *bool `type:"boolean"` - - // The user's IAM ARN. - IamUserArn *string `type:"string"` - - // The user's name. - Name *string `type:"string"` - - // The user's SSH public key. - SshPublicKey *string `type:"string"` - - // The user's SSH user name. - SshUsername *string `type:"string"` -} - -// String returns the string representation -func (s UserProfile) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserProfile) GoString() string { - return s.String() -} - -// SetAllowSelfManagement sets the AllowSelfManagement field's value. -func (s *UserProfile) SetAllowSelfManagement(v bool) *UserProfile { - s.AllowSelfManagement = &v - return s -} - -// SetIamUserArn sets the IamUserArn field's value. -func (s *UserProfile) SetIamUserArn(v string) *UserProfile { - s.IamUserArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *UserProfile) SetName(v string) *UserProfile { - s.Name = &v - return s -} - -// SetSshPublicKey sets the SshPublicKey field's value. -func (s *UserProfile) SetSshPublicKey(v string) *UserProfile { - s.SshPublicKey = &v - return s -} - -// SetSshUsername sets the SshUsername field's value. -func (s *UserProfile) SetSshUsername(v string) *UserProfile { - s.SshUsername = &v - return s -} - -// Describes an instance's Amazon EBS volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/Volume -type Volume struct { - _ struct{} `type:"structure"` - - // The volume Availability Zone. For more information, see Regions and Endpoints - // (http://docs.aws.amazon.com/general/latest/gr/rande.html). - AvailabilityZone *string `type:"string"` - - // The device name. - Device *string `type:"string"` - - // The Amazon EC2 volume ID. - Ec2VolumeId *string `type:"string"` - - // The instance ID. - InstanceId *string `type:"string"` - - // For PIOPS volumes, the IOPS per disk. - Iops *int64 `type:"integer"` - - // The volume mount point. For example, "/mnt/disk1". - MountPoint *string `type:"string"` - - // The volume name. - Name *string `type:"string"` - - // The RAID array ID. - RaidArrayId *string `type:"string"` - - // The AWS region. For more information about AWS regions, see Regions and Endpoints - // (http://docs.aws.amazon.com/general/latest/gr/rande.html). - Region *string `type:"string"` - - // The volume size. - Size *int64 `type:"integer"` - - // The value returned by DescribeVolumes (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVolumes.html). - Status *string `type:"string"` - - // The volume ID. - VolumeId *string `type:"string"` - - // The volume type, standard or PIOPS. - VolumeType *string `type:"string"` -} - -// 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() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Volume) SetAvailabilityZone(v string) *Volume { - s.AvailabilityZone = &v - return s -} - -// SetDevice sets the Device field's value. -func (s *Volume) SetDevice(v string) *Volume { - s.Device = &v - return s -} - -// SetEc2VolumeId sets the Ec2VolumeId field's value. -func (s *Volume) SetEc2VolumeId(v string) *Volume { - s.Ec2VolumeId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Volume) SetInstanceId(v string) *Volume { - s.InstanceId = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *Volume) SetIops(v int64) *Volume { - s.Iops = &v - return s -} - -// SetMountPoint sets the MountPoint field's value. -func (s *Volume) SetMountPoint(v string) *Volume { - s.MountPoint = &v - return s -} - -// SetName sets the Name field's value. -func (s *Volume) SetName(v string) *Volume { - s.Name = &v - return s -} - -// SetRaidArrayId sets the RaidArrayId field's value. -func (s *Volume) SetRaidArrayId(v string) *Volume { - s.RaidArrayId = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *Volume) SetRegion(v string) *Volume { - s.Region = &v - return s -} - -// SetSize sets the Size field's value. -func (s *Volume) SetSize(v int64) *Volume { - s.Size = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Volume) SetStatus(v string) *Volume { - s.Status = &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 an Amazon EBS volume configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/VolumeConfiguration -type VolumeConfiguration struct { - _ struct{} `type:"structure"` - - // For PIOPS volumes, the IOPS per disk. - Iops *int64 `type:"integer"` - - // The volume mount point. For example "/dev/sdh". - // - // MountPoint is a required field - MountPoint *string `type:"string" required:"true"` - - // The number of disks in the volume. - // - // NumberOfDisks is a required field - NumberOfDisks *int64 `type:"integer" required:"true"` - - // The volume RAID level (http://en.wikipedia.org/wiki/Standard_RAID_levels). - RaidLevel *int64 `type:"integer"` - - // The volume size. - // - // Size is a required field - Size *int64 `type:"integer" required:"true"` - - // The volume type: - // - // * standard - Magnetic - // - // * io1 - Provisioned IOPS (SSD) - // - // * gp2 - General Purpose (SSD) - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s VolumeConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VolumeConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VolumeConfiguration"} - if s.MountPoint == nil { - invalidParams.Add(request.NewErrParamRequired("MountPoint")) - } - if s.NumberOfDisks == nil { - invalidParams.Add(request.NewErrParamRequired("NumberOfDisks")) - } - if s.Size == nil { - invalidParams.Add(request.NewErrParamRequired("Size")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIops sets the Iops field's value. -func (s *VolumeConfiguration) SetIops(v int64) *VolumeConfiguration { - s.Iops = &v - return s -} - -// SetMountPoint sets the MountPoint field's value. -func (s *VolumeConfiguration) SetMountPoint(v string) *VolumeConfiguration { - s.MountPoint = &v - return s -} - -// SetNumberOfDisks sets the NumberOfDisks field's value. -func (s *VolumeConfiguration) SetNumberOfDisks(v int64) *VolumeConfiguration { - s.NumberOfDisks = &v - return s -} - -// SetRaidLevel sets the RaidLevel field's value. -func (s *VolumeConfiguration) SetRaidLevel(v int64) *VolumeConfiguration { - s.RaidLevel = &v - return s -} - -// SetSize sets the Size field's value. -func (s *VolumeConfiguration) SetSize(v int64) *VolumeConfiguration { - s.Size = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *VolumeConfiguration) SetVolumeType(v string) *VolumeConfiguration { - s.VolumeType = &v - return s -} - -// Describes a time-based instance's auto scaling schedule. The schedule consists -// of a set of key-value pairs. -// -// * The key is the time period (a UTC hour) and must be an integer from -// 0 - 23. -// -// * The value indicates whether the instance should be online or offline -// for the specified period, and must be set to "on" or "off" -// -// The default setting for all time periods is off, so you use the following -// parameters primarily to specify the online periods. You don't have to explicitly -// specify offline periods unless you want to change an online period to an -// offline period. -// -// The following example specifies that the instance should be online for four -// hours, from UTC 1200 - 1600. It will be off for the remainder of the day. -// -// { "12":"on", "13":"on", "14":"on", "15":"on" } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/WeeklyAutoScalingSchedule -type WeeklyAutoScalingSchedule struct { - _ struct{} `type:"structure"` - - // The schedule for Friday. - Friday map[string]*string `type:"map"` - - // The schedule for Monday. - Monday map[string]*string `type:"map"` - - // The schedule for Saturday. - Saturday map[string]*string `type:"map"` - - // The schedule for Sunday. - Sunday map[string]*string `type:"map"` - - // The schedule for Thursday. - Thursday map[string]*string `type:"map"` - - // The schedule for Tuesday. - Tuesday map[string]*string `type:"map"` - - // The schedule for Wednesday. - Wednesday map[string]*string `type:"map"` -} - -// String returns the string representation -func (s WeeklyAutoScalingSchedule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WeeklyAutoScalingSchedule) GoString() string { - return s.String() -} - -// SetFriday sets the Friday field's value. -func (s *WeeklyAutoScalingSchedule) SetFriday(v map[string]*string) *WeeklyAutoScalingSchedule { - s.Friday = v - return s -} - -// SetMonday sets the Monday field's value. -func (s *WeeklyAutoScalingSchedule) SetMonday(v map[string]*string) *WeeklyAutoScalingSchedule { - s.Monday = v - return s -} - -// SetSaturday sets the Saturday field's value. -func (s *WeeklyAutoScalingSchedule) SetSaturday(v map[string]*string) *WeeklyAutoScalingSchedule { - s.Saturday = v - return s -} - -// SetSunday sets the Sunday field's value. -func (s *WeeklyAutoScalingSchedule) SetSunday(v map[string]*string) *WeeklyAutoScalingSchedule { - s.Sunday = v - return s -} - -// SetThursday sets the Thursday field's value. -func (s *WeeklyAutoScalingSchedule) SetThursday(v map[string]*string) *WeeklyAutoScalingSchedule { - s.Thursday = v - return s -} - -// SetTuesday sets the Tuesday field's value. -func (s *WeeklyAutoScalingSchedule) SetTuesday(v map[string]*string) *WeeklyAutoScalingSchedule { - s.Tuesday = v - return s -} - -// SetWednesday sets the Wednesday field's value. -func (s *WeeklyAutoScalingSchedule) SetWednesday(v map[string]*string) *WeeklyAutoScalingSchedule { - s.Wednesday = v - return s -} - -const ( - // AppAttributesKeysDocumentRoot is a AppAttributesKeys enum value - AppAttributesKeysDocumentRoot = "DocumentRoot" - - // AppAttributesKeysRailsEnv is a AppAttributesKeys enum value - AppAttributesKeysRailsEnv = "RailsEnv" - - // AppAttributesKeysAutoBundleOnDeploy is a AppAttributesKeys enum value - AppAttributesKeysAutoBundleOnDeploy = "AutoBundleOnDeploy" - - // AppAttributesKeysAwsFlowRubySettings is a AppAttributesKeys enum value - AppAttributesKeysAwsFlowRubySettings = "AwsFlowRubySettings" -) - -const ( - // AppTypeAwsFlowRuby is a AppType enum value - AppTypeAwsFlowRuby = "aws-flow-ruby" - - // AppTypeJava is a AppType enum value - AppTypeJava = "java" - - // AppTypeRails is a AppType enum value - AppTypeRails = "rails" - - // AppTypePhp is a AppType enum value - AppTypePhp = "php" - - // AppTypeNodejs is a AppType enum value - AppTypeNodejs = "nodejs" - - // AppTypeStatic is a AppType enum value - AppTypeStatic = "static" - - // AppTypeOther is a AppType enum value - AppTypeOther = "other" -) - -const ( - // ArchitectureX8664 is a Architecture enum value - ArchitectureX8664 = "x86_64" - - // ArchitectureI386 is a Architecture enum value - ArchitectureI386 = "i386" -) - -const ( - // AutoScalingTypeLoad is a AutoScalingType enum value - AutoScalingTypeLoad = "load" - - // AutoScalingTypeTimer is a AutoScalingType enum value - AutoScalingTypeTimer = "timer" -) - -const ( - // DeploymentCommandNameInstallDependencies is a DeploymentCommandName enum value - DeploymentCommandNameInstallDependencies = "install_dependencies" - - // DeploymentCommandNameUpdateDependencies is a DeploymentCommandName enum value - DeploymentCommandNameUpdateDependencies = "update_dependencies" - - // DeploymentCommandNameUpdateCustomCookbooks is a DeploymentCommandName enum value - DeploymentCommandNameUpdateCustomCookbooks = "update_custom_cookbooks" - - // DeploymentCommandNameExecuteRecipes is a DeploymentCommandName enum value - DeploymentCommandNameExecuteRecipes = "execute_recipes" - - // DeploymentCommandNameConfigure is a DeploymentCommandName enum value - DeploymentCommandNameConfigure = "configure" - - // DeploymentCommandNameSetup is a DeploymentCommandName enum value - DeploymentCommandNameSetup = "setup" - - // DeploymentCommandNameDeploy is a DeploymentCommandName enum value - DeploymentCommandNameDeploy = "deploy" - - // DeploymentCommandNameRollback is a DeploymentCommandName enum value - DeploymentCommandNameRollback = "rollback" - - // DeploymentCommandNameStart is a DeploymentCommandName enum value - DeploymentCommandNameStart = "start" - - // DeploymentCommandNameStop is a DeploymentCommandName enum value - DeploymentCommandNameStop = "stop" - - // DeploymentCommandNameRestart is a DeploymentCommandName enum value - DeploymentCommandNameRestart = "restart" - - // DeploymentCommandNameUndeploy is a DeploymentCommandName enum value - DeploymentCommandNameUndeploy = "undeploy" -) - -const ( - // LayerAttributesKeysEcsClusterArn is a LayerAttributesKeys enum value - LayerAttributesKeysEcsClusterArn = "EcsClusterArn" - - // LayerAttributesKeysEnableHaproxyStats is a LayerAttributesKeys enum value - LayerAttributesKeysEnableHaproxyStats = "EnableHaproxyStats" - - // LayerAttributesKeysHaproxyStatsUrl is a LayerAttributesKeys enum value - LayerAttributesKeysHaproxyStatsUrl = "HaproxyStatsUrl" - - // LayerAttributesKeysHaproxyStatsUser is a LayerAttributesKeys enum value - LayerAttributesKeysHaproxyStatsUser = "HaproxyStatsUser" - - // LayerAttributesKeysHaproxyStatsPassword is a LayerAttributesKeys enum value - LayerAttributesKeysHaproxyStatsPassword = "HaproxyStatsPassword" - - // LayerAttributesKeysHaproxyHealthCheckUrl is a LayerAttributesKeys enum value - LayerAttributesKeysHaproxyHealthCheckUrl = "HaproxyHealthCheckUrl" - - // LayerAttributesKeysHaproxyHealthCheckMethod is a LayerAttributesKeys enum value - LayerAttributesKeysHaproxyHealthCheckMethod = "HaproxyHealthCheckMethod" - - // LayerAttributesKeysMysqlRootPassword is a LayerAttributesKeys enum value - LayerAttributesKeysMysqlRootPassword = "MysqlRootPassword" - - // LayerAttributesKeysMysqlRootPasswordUbiquitous is a LayerAttributesKeys enum value - LayerAttributesKeysMysqlRootPasswordUbiquitous = "MysqlRootPasswordUbiquitous" - - // LayerAttributesKeysGangliaUrl is a LayerAttributesKeys enum value - LayerAttributesKeysGangliaUrl = "GangliaUrl" - - // LayerAttributesKeysGangliaUser is a LayerAttributesKeys enum value - LayerAttributesKeysGangliaUser = "GangliaUser" - - // LayerAttributesKeysGangliaPassword is a LayerAttributesKeys enum value - LayerAttributesKeysGangliaPassword = "GangliaPassword" - - // LayerAttributesKeysMemcachedMemory is a LayerAttributesKeys enum value - LayerAttributesKeysMemcachedMemory = "MemcachedMemory" - - // LayerAttributesKeysNodejsVersion is a LayerAttributesKeys enum value - LayerAttributesKeysNodejsVersion = "NodejsVersion" - - // LayerAttributesKeysRubyVersion is a LayerAttributesKeys enum value - LayerAttributesKeysRubyVersion = "RubyVersion" - - // LayerAttributesKeysRubygemsVersion is a LayerAttributesKeys enum value - LayerAttributesKeysRubygemsVersion = "RubygemsVersion" - - // LayerAttributesKeysManageBundler is a LayerAttributesKeys enum value - LayerAttributesKeysManageBundler = "ManageBundler" - - // LayerAttributesKeysBundlerVersion is a LayerAttributesKeys enum value - LayerAttributesKeysBundlerVersion = "BundlerVersion" - - // LayerAttributesKeysRailsStack is a LayerAttributesKeys enum value - LayerAttributesKeysRailsStack = "RailsStack" - - // LayerAttributesKeysPassengerVersion is a LayerAttributesKeys enum value - LayerAttributesKeysPassengerVersion = "PassengerVersion" - - // LayerAttributesKeysJvm is a LayerAttributesKeys enum value - LayerAttributesKeysJvm = "Jvm" - - // LayerAttributesKeysJvmVersion is a LayerAttributesKeys enum value - LayerAttributesKeysJvmVersion = "JvmVersion" - - // LayerAttributesKeysJvmOptions is a LayerAttributesKeys enum value - LayerAttributesKeysJvmOptions = "JvmOptions" - - // LayerAttributesKeysJavaAppServer is a LayerAttributesKeys enum value - LayerAttributesKeysJavaAppServer = "JavaAppServer" - - // LayerAttributesKeysJavaAppServerVersion is a LayerAttributesKeys enum value - LayerAttributesKeysJavaAppServerVersion = "JavaAppServerVersion" -) - -const ( - // LayerTypeAwsFlowRuby is a LayerType enum value - LayerTypeAwsFlowRuby = "aws-flow-ruby" - - // LayerTypeEcsCluster is a LayerType enum value - LayerTypeEcsCluster = "ecs-cluster" - - // LayerTypeJavaApp is a LayerType enum value - LayerTypeJavaApp = "java-app" - - // LayerTypeLb is a LayerType enum value - LayerTypeLb = "lb" - - // LayerTypeWeb is a LayerType enum value - LayerTypeWeb = "web" - - // LayerTypePhpApp is a LayerType enum value - LayerTypePhpApp = "php-app" - - // LayerTypeRailsApp is a LayerType enum value - LayerTypeRailsApp = "rails-app" - - // LayerTypeNodejsApp is a LayerType enum value - LayerTypeNodejsApp = "nodejs-app" - - // LayerTypeMemcached is a LayerType enum value - LayerTypeMemcached = "memcached" - - // LayerTypeDbMaster is a LayerType enum value - LayerTypeDbMaster = "db-master" - - // LayerTypeMonitoringMaster is a LayerType enum value - LayerTypeMonitoringMaster = "monitoring-master" - - // LayerTypeCustom is a LayerType enum value - LayerTypeCustom = "custom" -) - -const ( - // RootDeviceTypeEbs is a RootDeviceType enum value - RootDeviceTypeEbs = "ebs" - - // RootDeviceTypeInstanceStore is a RootDeviceType enum value - RootDeviceTypeInstanceStore = "instance-store" -) - -const ( - // SourceTypeGit is a SourceType enum value - SourceTypeGit = "git" - - // SourceTypeSvn is a SourceType enum value - SourceTypeSvn = "svn" - - // SourceTypeArchive is a SourceType enum value - SourceTypeArchive = "archive" - - // SourceTypeS3 is a SourceType enum value - SourceTypeS3 = "s3" -) - -const ( - // StackAttributesKeysColor is a StackAttributesKeys enum value - StackAttributesKeysColor = "Color" -) - -const ( - // VirtualizationTypeParavirtual is a VirtualizationType enum value - VirtualizationTypeParavirtual = "paravirtual" - - // VirtualizationTypeHvm is a VirtualizationType enum value - VirtualizationTypeHvm = "hvm" -) - -const ( - // VolumeTypeGp2 is a VolumeType enum value - VolumeTypeGp2 = "gp2" - - // VolumeTypeIo1 is a VolumeType enum value - VolumeTypeIo1 = "io1" - - // VolumeTypeStandard is a VolumeType enum value - VolumeTypeStandard = "standard" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go deleted file mode 100644 index d3e0949..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go +++ /dev/null @@ -1,18 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package opsworks - -const ( - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Indicates that a resource was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Indicates that a request was not valid. - ErrCodeValidationException = "ValidationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go deleted file mode 100644 index fa799d9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go +++ /dev/null @@ -1,158 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package opsworks - -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" -) - -// Welcome to the AWS OpsWorks API Reference. This guide provides descriptions, -// syntax, and usage examples for AWS OpsWorks actions and data types, including -// common parameters and error codes. -// -// AWS OpsWorks is an application management service that provides an integrated -// experience for overseeing the complete application lifecycle. For information -// about this product, go to the AWS OpsWorks (http://aws.amazon.com/opsworks/) -// details page. -// -// SDKs and CLI -// -// The most common way to use the AWS OpsWorks API is by using the AWS Command -// Line Interface (CLI) or by using one of the AWS SDKs to implement applications -// in your preferred language. For more information, see: -// -// * AWS CLI (http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) -// -// * AWS SDK for Java (http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/opsworks/AWSOpsWorksClient.html) -// -// * AWS SDK for .NET (http://docs.aws.amazon.com/sdkfornet/latest/apidocs/html/N_Amazon_OpsWorks.htm) -// -// * AWS SDK for PHP 2 (http://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.OpsWorks.OpsWorksClient.html) -// -// * AWS SDK for Ruby (http://docs.aws.amazon.com/sdkforruby/api/) -// -// * AWS SDK for Node.js (http://aws.amazon.com/documentation/sdkforjavascript/) -// -// * AWS SDK for Python(Boto) (http://docs.pythonboto.org/en/latest/ref/opsworks.html) -// -// Endpoints -// -// AWS OpsWorks supports the following endpoints, all HTTPS. You must connect -// to one of the following endpoints. Stacks can only be accessed or managed -// within the endpoint in which they are created. -// -// * opsworks.us-east-1.amazonaws.com -// -// * opsworks.us-west-1.amazonaws.com -// -// * opsworks.us-west-2.amazonaws.com -// -// * opsworks.eu-west-1.amazonaws.com -// -// * opsworks.eu-central-1.amazonaws.com -// -// * opsworks.ap-northeast-1.amazonaws.com -// -// * opsworks.ap-northeast-2.amazonaws.com -// -// * opsworks.ap-south-1.amazonaws.com -// -// * opsworks.ap-southeast-1.amazonaws.com -// -// * opsworks.ap-southeast-2.amazonaws.com -// -// * opsworks.sa-east-1.amazonaws.com -// -// Chef Versions -// -// When you call CreateStack, CloneStack, or UpdateStack we recommend you use -// the ConfigurationManager parameter to specify the Chef version. The recommended -// and default value for Linux stacks is currently 12. Windows stacks use Chef -// 12.2. For more information, see Chef Versions (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-chef11.html). -// -// You can specify Chef 12, 11.10, or 11.4 for your Linux stack. We recommend -// migrating your existing Linux stacks to Chef 12 as soon as possible. -// 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/opsworks-2013-02-18 -type OpsWorks 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 = "opsworks" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the OpsWorks 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 OpsWorks client from just a session. -// svc := opsworks.New(mySession) -// -// // Create a OpsWorks client with additional configuration -// svc := opsworks.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *OpsWorks { - 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) *OpsWorks { - svc := &OpsWorks{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2013-02-18", - JSONVersion: "1.1", - TargetPrefix: "OpsWorks_20130218", - }, - 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 OpsWorks operation and runs any -// custom request initialization. -func (c *OpsWorks) 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/opsworks/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/waiters.go deleted file mode 100644 index dc4fa42..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/waiters.go +++ /dev/null @@ -1,379 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package opsworks - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilAppExists uses the AWS OpsWorks API operation -// DescribeApps 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 *OpsWorks) WaitUntilAppExists(input *DescribeAppsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeApps", - Delay: 1, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "status", - Argument: "", - Expected: 200, - }, - { - State: "failure", - Matcher: "status", - Argument: "", - Expected: 400, - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilDeploymentSuccessful uses the AWS OpsWorks API operation -// DescribeDeployments 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 *OpsWorks) WaitUntilDeploymentSuccessful(input *DescribeDeploymentsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeDeployments", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Deployments[].Status", - Expected: "successful", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Deployments[].Status", - Expected: "failed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilInstanceOnline uses the AWS OpsWorks 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 *OpsWorks) WaitUntilInstanceOnline(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Instances[].Status", - Expected: "online", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "setup_failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "shutting_down", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "start_failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "stopped", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "stopping", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "terminating", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "terminated", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "stop_failed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilInstanceRegistered uses the AWS OpsWorks 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 *OpsWorks) WaitUntilInstanceRegistered(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Instances[].Status", - Expected: "registered", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "setup_failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "shutting_down", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "stopped", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "stopping", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "terminating", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "terminated", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "stop_failed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilInstanceStopped uses the AWS OpsWorks 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 *OpsWorks) WaitUntilInstanceStopped(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Instances[].Status", - Expected: "stopped", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "booting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "online", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "pending", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "rebooting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "requested", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "running_setup", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "setup_failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "start_failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "stop_failed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilInstanceTerminated uses the AWS OpsWorks 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 *OpsWorks) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeInstances", - Delay: 15, - MaxAttempts: 40, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Instances[].Status", - Expected: "terminated", - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "ResourceNotFoundException", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "booting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "online", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "pending", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "rebooting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "requested", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "running_setup", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "setup_failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Instances[].Status", - Expected: "start_failed", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/api.go b/vendor/github.com/aws/aws-sdk-go/service/rds/api.go deleted file mode 100644 index 48b6d2c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/api.go +++ /dev/null @@ -1,25476 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package rds provides a client for Amazon Relational Database Service. -package rds - -import ( - "fmt" - "time" - - "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 opAddRoleToDBCluster = "AddRoleToDBCluster" - -// AddRoleToDBClusterRequest generates a "aws/request.Request" representing the -// client's request for the AddRoleToDBCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddRoleToDBCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddRoleToDBCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddRoleToDBClusterRequest method. -// req, resp := client.AddRoleToDBClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddRoleToDBCluster -func (c *RDS) AddRoleToDBClusterRequest(input *AddRoleToDBClusterInput) (req *request.Request, output *AddRoleToDBClusterOutput) { - op := &request.Operation{ - Name: opAddRoleToDBCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddRoleToDBClusterInput{} - } - - output = &AddRoleToDBClusterOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddRoleToDBCluster API operation for Amazon Relational Database Service. -// -// Associates an Identity and Access Management (IAM) role from an Aurora DB -// cluster. For more information, see Authorizing Amazon Aurora to Access Other -// AWS Services On Your Behalf (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Authorizing.AWSServices.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 Relational Database Service's -// API operation AddRoleToDBCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeDBClusterRoleAlreadyExistsFault "DBClusterRoleAlreadyExists" -// The specified IAM role Amazon Resource Name (ARN) is already associated with -// the specified DB cluster. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeDBClusterRoleQuotaExceededFault "DBClusterRoleQuotaExceeded" -// You have exceeded the maximum number of IAM roles that can be associated -// with the specified DB cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddRoleToDBCluster -func (c *RDS) AddRoleToDBCluster(input *AddRoleToDBClusterInput) (*AddRoleToDBClusterOutput, error) { - req, out := c.AddRoleToDBClusterRequest(input) - err := req.Send() - return out, err -} - -const opAddSourceIdentifierToSubscription = "AddSourceIdentifierToSubscription" - -// AddSourceIdentifierToSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the AddSourceIdentifierToSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddSourceIdentifierToSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddSourceIdentifierToSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddSourceIdentifierToSubscriptionRequest method. -// req, resp := client.AddSourceIdentifierToSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddSourceIdentifierToSubscription -func (c *RDS) AddSourceIdentifierToSubscriptionRequest(input *AddSourceIdentifierToSubscriptionInput) (req *request.Request, output *AddSourceIdentifierToSubscriptionOutput) { - op := &request.Operation{ - Name: opAddSourceIdentifierToSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddSourceIdentifierToSubscriptionInput{} - } - - output = &AddSourceIdentifierToSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddSourceIdentifierToSubscription API operation for Amazon Relational Database Service. -// -// Adds a source identifier to an existing RDS event notification subscription. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation AddSourceIdentifierToSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionNotFoundFault "SubscriptionNotFound" -// The subscription name does not exist. -// -// * ErrCodeSourceNotFoundFault "SourceNotFound" -// The requested source could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddSourceIdentifierToSubscription -func (c *RDS) AddSourceIdentifierToSubscription(input *AddSourceIdentifierToSubscriptionInput) (*AddSourceIdentifierToSubscriptionOutput, error) { - req, out := c.AddSourceIdentifierToSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opAddTagsToResource = "AddTagsToResource" - -// AddTagsToResourceRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToResourceRequest method. -// req, resp := client.AddTagsToResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddTagsToResource -func (c *RDS) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *request.Request, output *AddTagsToResourceOutput) { - op := &request.Operation{ - Name: opAddTagsToResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsToResourceInput{} - } - - output = &AddTagsToResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddTagsToResource API operation for Amazon Relational Database Service. -// -// Adds metadata tags to an Amazon RDS resource. These tags can also be used -// with cost allocation reporting to track cost associated with Amazon RDS resources, -// or used in a Condition statement in an IAM policy for Amazon RDS. -// -// For an overview on tagging Amazon RDS resources, see Tagging Amazon RDS Resources -// (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Tagging.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 Relational Database Service's -// API operation AddTagsToResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddTagsToResource -func (c *RDS) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { - req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err -} - -const opApplyPendingMaintenanceAction = "ApplyPendingMaintenanceAction" - -// ApplyPendingMaintenanceActionRequest generates a "aws/request.Request" representing the -// client's request for the ApplyPendingMaintenanceAction operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ApplyPendingMaintenanceAction for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ApplyPendingMaintenanceAction method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ApplyPendingMaintenanceActionRequest method. -// req, resp := client.ApplyPendingMaintenanceActionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ApplyPendingMaintenanceAction -func (c *RDS) ApplyPendingMaintenanceActionRequest(input *ApplyPendingMaintenanceActionInput) (req *request.Request, output *ApplyPendingMaintenanceActionOutput) { - op := &request.Operation{ - Name: opApplyPendingMaintenanceAction, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ApplyPendingMaintenanceActionInput{} - } - - output = &ApplyPendingMaintenanceActionOutput{} - req = c.newRequest(op, input, output) - return -} - -// ApplyPendingMaintenanceAction API operation for Amazon Relational Database Service. -// -// Applies a pending maintenance action to a resource (for example, to a DB -// 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 Relational Database Service's -// API operation ApplyPendingMaintenanceAction for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The specified resource ID was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ApplyPendingMaintenanceAction -func (c *RDS) ApplyPendingMaintenanceAction(input *ApplyPendingMaintenanceActionInput) (*ApplyPendingMaintenanceActionOutput, error) { - req, out := c.ApplyPendingMaintenanceActionRequest(input) - err := req.Send() - return out, err -} - -const opAuthorizeDBSecurityGroupIngress = "AuthorizeDBSecurityGroupIngress" - -// AuthorizeDBSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the AuthorizeDBSecurityGroupIngress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AuthorizeDBSecurityGroupIngress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AuthorizeDBSecurityGroupIngress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AuthorizeDBSecurityGroupIngressRequest method. -// req, resp := client.AuthorizeDBSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AuthorizeDBSecurityGroupIngress -func (c *RDS) AuthorizeDBSecurityGroupIngressRequest(input *AuthorizeDBSecurityGroupIngressInput) (req *request.Request, output *AuthorizeDBSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opAuthorizeDBSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AuthorizeDBSecurityGroupIngressInput{} - } - - output = &AuthorizeDBSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - return -} - -// AuthorizeDBSecurityGroupIngress API operation for Amazon Relational Database Service. -// -// Enables ingress to a DBSecurityGroup using one of two forms of authorization. -// First, EC2 or VPC security groups can be added to the DBSecurityGroup if -// the application using the database is running on EC2 or VPC instances. Second, -// IP ranges are available if the application accessing your database is running -// on the Internet. Required parameters for this API are one of CIDR range, -// EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName -// or EC2SecurityGroupId for non-VPC). -// -// You cannot authorize ingress from an EC2 security group in one region to -// an Amazon RDS DB instance in another. You cannot authorize ingress from a -// VPC security group in one VPC to an Amazon RDS DB instance in another. -// -// For an overview of CIDR ranges, go to the Wikipedia Tutorial (http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation AuthorizeDBSecurityGroupIngress for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// * ErrCodeInvalidDBSecurityGroupStateFault "InvalidDBSecurityGroupState" -// The state of the DB security group does not allow deletion. -// -// * ErrCodeAuthorizationAlreadyExistsFault "AuthorizationAlreadyExists" -// The specified CIDRIP or EC2 security group is already authorized for the -// specified DB security group. -// -// * ErrCodeAuthorizationQuotaExceededFault "AuthorizationQuotaExceeded" -// DB security group authorization quota has been reached. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AuthorizeDBSecurityGroupIngress -func (c *RDS) AuthorizeDBSecurityGroupIngress(input *AuthorizeDBSecurityGroupIngressInput) (*AuthorizeDBSecurityGroupIngressOutput, error) { - req, out := c.AuthorizeDBSecurityGroupIngressRequest(input) - err := req.Send() - return out, err -} - -const opCopyDBClusterParameterGroup = "CopyDBClusterParameterGroup" - -// CopyDBClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the CopyDBClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopyDBClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopyDBClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopyDBClusterParameterGroupRequest method. -// req, resp := client.CopyDBClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterParameterGroup -func (c *RDS) CopyDBClusterParameterGroupRequest(input *CopyDBClusterParameterGroupInput) (req *request.Request, output *CopyDBClusterParameterGroupOutput) { - op := &request.Operation{ - Name: opCopyDBClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyDBClusterParameterGroupInput{} - } - - output = &CopyDBClusterParameterGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyDBClusterParameterGroup API operation for Amazon Relational Database Service. -// -// Copies the specified DB cluster parameter group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation CopyDBClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// * ErrCodeDBParameterGroupQuotaExceededFault "DBParameterGroupQuotaExceeded" -// Request would result in user exceeding the allowed number of DB parameter -// groups. -// -// * ErrCodeDBParameterGroupAlreadyExistsFault "DBParameterGroupAlreadyExists" -// A DB parameter group with the same name exists. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterParameterGroup -func (c *RDS) CopyDBClusterParameterGroup(input *CopyDBClusterParameterGroupInput) (*CopyDBClusterParameterGroupOutput, error) { - req, out := c.CopyDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opCopyDBClusterSnapshot = "CopyDBClusterSnapshot" - -// CopyDBClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CopyDBClusterSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopyDBClusterSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopyDBClusterSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopyDBClusterSnapshotRequest method. -// req, resp := client.CopyDBClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterSnapshot -func (c *RDS) CopyDBClusterSnapshotRequest(input *CopyDBClusterSnapshotInput) (req *request.Request, output *CopyDBClusterSnapshotOutput) { - op := &request.Operation{ - Name: opCopyDBClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyDBClusterSnapshotInput{} - } - - output = &CopyDBClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyDBClusterSnapshot API operation for Amazon Relational Database Service. -// -// Copies a snapshot of a DB cluster. -// -// To copy a DB cluster snapshot from a shared manual DB cluster snapshot, SourceDBClusterSnapshotIdentifier -// must be the Amazon Resource Name (ARN) of the shared DB cluster snapshot. -// -// You can copy an encrypted DB cluster snapshot from another AWS region. In -// that case, the region where you call the CopyDBClusterSnapshot action is -// the destination region for the encrypted DB cluster snapshot to be copied -// to. To copy an encrypted DB cluster snapshot from another region, you must -// provide the following values: -// -// * KmsKeyId - The AWS Key Management System (KMS) key identifier for the -// key to use to encrypt the copy of the DB cluster snapshot in the destination -// region. -// -// * PreSignedUrl - A URL that contains a Signature Version 4 signed request -// for the CopyDBClusterSnapshot action to be called in the source region -// where the DB cluster snapshot will be copied from. The pre-signed URL -// must be a valid request for the CopyDBClusterSnapshot API action that -// can be executed in the source region that contains the encrypted DB cluster -// snapshot to be copied. -// -// The pre-signed URL request must contain the following parameter values: -// -// KmsKeyId - The KMS key identifier for the key to use to encrypt the copy -// of the DB cluster snapshot in the destination region. This is the same -// identifier for both the CopyDBClusterSnapshot action that is called in -// the destination region, and the action contained in the pre-signed URL. -// -// DestinationRegion - The name of the region that the DB cluster snapshot will -// be created in. -// -// SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier for -// the encrypted DB cluster snapshot to be copied. This identifier must be -// in the Amazon Resource Name (ARN) format for the source region. For example, -// if you are copying an encrypted DB cluster snapshot from the us-west-2 -// region, then your SourceDBClusterSnapshotIdentifier looks like the following -// example: arn:aws:rds:us-west-2:123456789012:cluster-snapshot:aurora-cluster1-snapshot-20161115. -// -// To learn how to generate a Signature Version 4 signed request, see Authenticating -// Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) -// and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). -// -// * TargetDBClusterSnapshotIdentifier - The identifier for the new copy -// of the DB cluster snapshot in the destination region. -// -// * SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier -// for the encrypted DB cluster snapshot to be copied. This identifier must -// be in the ARN format for the source region and is the same value as the -// SourceDBClusterSnapshotIdentifier in the pre-signed URL. -// -// To cancel the copy operation once it is in progress, delete the target DB -// cluster snapshot identified by TargetDBClusterSnapshotIdentifier while that -// DB cluster snapshot is in "copying" status. -// -// For more information on copying encrypted DB cluster snapshots from one region -// to another, see Copying a DB Cluster Snapshot in the Same Account, Either -// in the Same Region or Across Regions (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopyDBClusterSnapshot.CrossRegion) -// in the Amazon RDS User Guide. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation CopyDBClusterSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterSnapshotAlreadyExistsFault "DBClusterSnapshotAlreadyExistsFault" -// User already has a DB cluster snapshot with the given identifier. -// -// * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The supplied value is not a valid DB cluster snapshot state. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// Request would result in user exceeding the allowed number of DB snapshots. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterSnapshot -func (c *RDS) CopyDBClusterSnapshot(input *CopyDBClusterSnapshotInput) (*CopyDBClusterSnapshotOutput, error) { - req, out := c.CopyDBClusterSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCopyDBParameterGroup = "CopyDBParameterGroup" - -// CopyDBParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the CopyDBParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopyDBParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopyDBParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopyDBParameterGroupRequest method. -// req, resp := client.CopyDBParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBParameterGroup -func (c *RDS) CopyDBParameterGroupRequest(input *CopyDBParameterGroupInput) (req *request.Request, output *CopyDBParameterGroupOutput) { - op := &request.Operation{ - Name: opCopyDBParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyDBParameterGroupInput{} - } - - output = &CopyDBParameterGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyDBParameterGroup API operation for Amazon Relational Database Service. -// -// Copies the specified DB parameter group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation CopyDBParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// * ErrCodeDBParameterGroupAlreadyExistsFault "DBParameterGroupAlreadyExists" -// A DB parameter group with the same name exists. -// -// * ErrCodeDBParameterGroupQuotaExceededFault "DBParameterGroupQuotaExceeded" -// Request would result in user exceeding the allowed number of DB parameter -// groups. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBParameterGroup -func (c *RDS) CopyDBParameterGroup(input *CopyDBParameterGroupInput) (*CopyDBParameterGroupOutput, error) { - req, out := c.CopyDBParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opCopyDBSnapshot = "CopyDBSnapshot" - -// CopyDBSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CopyDBSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopyDBSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopyDBSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopyDBSnapshotRequest method. -// req, resp := client.CopyDBSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBSnapshot -func (c *RDS) CopyDBSnapshotRequest(input *CopyDBSnapshotInput) (req *request.Request, output *CopyDBSnapshotOutput) { - op := &request.Operation{ - Name: opCopyDBSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyDBSnapshotInput{} - } - - output = &CopyDBSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyDBSnapshot API operation for Amazon Relational Database Service. -// -// Copies the specified DB snapshot. The source DB snapshot must be in the "available" -// state. -// -// To copy a DB snapshot from a shared manual DB snapshot, SourceDBSnapshotIdentifier -// must be the Amazon Resource Name (ARN) of the shared DB snapshot. -// -// You can copy an encrypted DB snapshot from another AWS Region. In that case, -// the region where you call the CopyDBSnapshot action is the destination region -// for the encrypted DB snapshot to be copied to. To copy an encrypted DB snapshot -// from another region, you must provide the following values: -// -// * KmsKeyId - The AWS Key Management System (KMS) key identifier for the -// key to use to encrypt the copy of the DB snapshot in the destination region. -// -// * PreSignedUrl - A URL that contains a Signature Version 4 signed request -// for the CopyDBSnapshot action to be called in the source region where -// the DB snapshot will be copied from. The presigned URL must be a valid -// request for the CopyDBSnapshot API action that can be executed in the -// source region that contains the encrypted DB snapshot to be copied. -// -// The presigned URL request must contain the following parameter values: -// -// DestinationRegion - The AWS Region that the encrypted DB snapshot will be -// copied to. This region is the same one where the CopyDBSnapshot action -// is called that contains this presigned URL. -// -// For example, if you copy an encrypted DB snapshot from the us-west-2 region -// to the us-east-1 region, then you will call the CopyDBSnapshot action -// in the us-east-1 region and provide a presigned URL that contains a call -// to the CopyDBSnapshot action in the us-west-2 region. For this example, -// the DestinationRegion in the presigned URL must be set to the us-east-1 -// region. -// -// KmsKeyId - The KMS key identifier for the key to use to encrypt the copy -// of the DB snapshot in the destination region. This identifier is the same -// for both the CopyDBSnapshot action that is called in the destination region, -// and the action contained in the presigned URL. -// -// SourceDBSnapshotIdentifier - The DB snapshot identifier for the encrypted -// snapshot to be copied. This identifier must be in the Amazon Resource -// Name (ARN) format for the source region. For example, if you copy an encrypted -// DB snapshot from the us-west-2 region, then your SourceDBSnapshotIdentifier -// looks like this example: arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115. -// -// To learn how to generate a Signature Version 4 signed request, see Authenticating -// Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) -// and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). -// -// * TargetDBSnapshotIdentifier - The identifier for the new copy of the -// DB snapshot in the destination region. -// -// * SourceDBSnapshotIdentifier - The DB snapshot identifier for the encrypted -// snapshot to be copied. This identifier must be in the ARN format for the -// source region and is the same value as the SourceDBSnapshotIdentifier -// in the presigned URL. -// -// For more information on copying encrypted snapshots from one region to another, -// see Copying an Encrypted DB Snapshot to Another Region (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopySnapshot.Encrypted.CrossRegion) -// in the Amazon RDS 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 Relational Database Service's -// API operation CopyDBSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSnapshotAlreadyExistsFault "DBSnapshotAlreadyExists" -// DBSnapshotIdentifier is already used by an existing snapshot. -// -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// * ErrCodeInvalidDBSnapshotStateFault "InvalidDBSnapshotState" -// The state of the DB snapshot does not allow deletion. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// Request would result in user exceeding the allowed number of DB snapshots. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBSnapshot -func (c *RDS) CopyDBSnapshot(input *CopyDBSnapshotInput) (*CopyDBSnapshotOutput, error) { - req, out := c.CopyDBSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCopyOptionGroup = "CopyOptionGroup" - -// CopyOptionGroupRequest generates a "aws/request.Request" representing the -// client's request for the CopyOptionGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopyOptionGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopyOptionGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopyOptionGroupRequest method. -// req, resp := client.CopyOptionGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyOptionGroup -func (c *RDS) CopyOptionGroupRequest(input *CopyOptionGroupInput) (req *request.Request, output *CopyOptionGroupOutput) { - op := &request.Operation{ - Name: opCopyOptionGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyOptionGroupInput{} - } - - output = &CopyOptionGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyOptionGroup API operation for Amazon Relational Database Service. -// -// Copies the specified option group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation CopyOptionGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOptionGroupAlreadyExistsFault "OptionGroupAlreadyExistsFault" -// The option group you are trying to create already exists. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeOptionGroupQuotaExceededFault "OptionGroupQuotaExceededFault" -// The quota of 20 option groups was exceeded for this AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyOptionGroup -func (c *RDS) CopyOptionGroup(input *CopyOptionGroupInput) (*CopyOptionGroupOutput, error) { - req, out := c.CopyOptionGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBCluster = "CreateDBCluster" - -// CreateDBClusterRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBClusterRequest method. -// req, resp := client.CreateDBClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBCluster -func (c *RDS) CreateDBClusterRequest(input *CreateDBClusterInput) (req *request.Request, output *CreateDBClusterOutput) { - op := &request.Operation{ - Name: opCreateDBCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBClusterInput{} - } - - output = &CreateDBClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBCluster API operation for Amazon Relational Database Service. -// -// Creates a new Amazon Aurora DB cluster. -// -// You can use the ReplicationSourceIdentifier parameter to create the DB cluster -// as a Read Replica of another DB cluster or Amazon RDS MySQL DB instance. -// For cross-region replication where the DB cluster identified by ReplicationSourceIdentifier -// is encrypted, you must also specify the PreSignedUrl parameter. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation CreateDBCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// User already has a DB cluster with the given identifier. -// -// * ErrCodeInsufficientStorageClusterCapacityFault "InsufficientStorageClusterCapacity" -// There is insufficient storage available for the current action. You may be -// able to resolve this error by updating your subnet group to use different -// Availability Zones that have more storage available. -// -// * ErrCodeDBClusterQuotaExceededFault "DBClusterQuotaExceededFault" -// User attempted to create a new DB cluster and the user has already reached -// the maximum allowed DB cluster quota. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeInvalidDBSubnetGroupStateFault "InvalidDBSubnetGroupStateFault" -// The DB subnet group cannot be deleted because it is in use. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodeDBClusterParameterGroupNotFoundFault "DBClusterParameterGroupNotFound" -// DBClusterParameterGroupName does not refer to an existing DB Cluster parameter -// group. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones -// unless there is only one Availability Zone. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBCluster -func (c *RDS) CreateDBCluster(input *CreateDBClusterInput) (*CreateDBClusterOutput, error) { - req, out := c.CreateDBClusterRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBClusterParameterGroup = "CreateDBClusterParameterGroup" - -// CreateDBClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBClusterParameterGroupRequest method. -// req, resp := client.CreateDBClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterParameterGroup -func (c *RDS) CreateDBClusterParameterGroupRequest(input *CreateDBClusterParameterGroupInput) (req *request.Request, output *CreateDBClusterParameterGroupOutput) { - op := &request.Operation{ - Name: opCreateDBClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBClusterParameterGroupInput{} - } - - output = &CreateDBClusterParameterGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBClusterParameterGroup API operation for Amazon Relational Database Service. -// -// Creates a new DB cluster parameter group. -// -// Parameters in a DB cluster parameter group apply to all of the instances -// in a DB cluster. -// -// A DB cluster parameter group is initially created with the default parameters -// for the database engine used by instances in the DB cluster. To provide custom -// values for any of the parameters, you must modify the group after creating -// it using ModifyDBClusterParameterGroup. Once you've created a DB cluster -// parameter group, you need to associate it with your DB cluster using ModifyDBCluster. -// When you associate a new DB cluster parameter group with a running DB cluster, -// you need to reboot the DB instances in the DB cluster without failover for -// the new DB cluster parameter group and associated settings to take effect. -// -// After you create a DB cluster parameter group, you should wait at least 5 -// minutes before creating your first DB cluster that uses that DB cluster parameter -// group as the default parameter group. This allows Amazon RDS to fully complete -// the create action before the DB cluster parameter group is used as the default -// for a new DB cluster. This is especially important for parameters that are -// critical when creating the default database for a DB cluster, such as the -// character set for the default database defined by the character_set_database -// parameter. You can use the Parameter Groups option of the Amazon RDS console -// (https://console.aws.amazon.com/rds/) or the DescribeDBClusterParameters -// command to verify that your DB cluster parameter group has been created or -// modified. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation CreateDBClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupQuotaExceededFault "DBParameterGroupQuotaExceeded" -// Request would result in user exceeding the allowed number of DB parameter -// groups. -// -// * ErrCodeDBParameterGroupAlreadyExistsFault "DBParameterGroupAlreadyExists" -// A DB parameter group with the same name exists. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterParameterGroup -func (c *RDS) CreateDBClusterParameterGroup(input *CreateDBClusterParameterGroupInput) (*CreateDBClusterParameterGroupOutput, error) { - req, out := c.CreateDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBClusterSnapshot = "CreateDBClusterSnapshot" - -// CreateDBClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBClusterSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBClusterSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBClusterSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBClusterSnapshotRequest method. -// req, resp := client.CreateDBClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterSnapshot -func (c *RDS) CreateDBClusterSnapshotRequest(input *CreateDBClusterSnapshotInput) (req *request.Request, output *CreateDBClusterSnapshotOutput) { - op := &request.Operation{ - Name: opCreateDBClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBClusterSnapshotInput{} - } - - output = &CreateDBClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBClusterSnapshot API operation for Amazon Relational Database Service. -// -// Creates a snapshot of a DB cluster. For more information on Amazon Aurora, -// see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation CreateDBClusterSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterSnapshotAlreadyExistsFault "DBClusterSnapshotAlreadyExistsFault" -// User already has a DB cluster snapshot with the given identifier. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// Request would result in user exceeding the allowed number of DB snapshots. -// -// * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The supplied value is not a valid DB cluster snapshot state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterSnapshot -func (c *RDS) CreateDBClusterSnapshot(input *CreateDBClusterSnapshotInput) (*CreateDBClusterSnapshotOutput, error) { - req, out := c.CreateDBClusterSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBInstance = "CreateDBInstance" - -// CreateDBInstanceRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBInstanceRequest method. -// req, resp := client.CreateDBInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstance -func (c *RDS) CreateDBInstanceRequest(input *CreateDBInstanceInput) (req *request.Request, output *CreateDBInstanceOutput) { - op := &request.Operation{ - Name: opCreateDBInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBInstanceInput{} - } - - output = &CreateDBInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBInstance API operation for Amazon Relational Database Service. -// -// Creates a new DB 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 Relational Database Service's -// API operation CreateDBInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceAlreadyExistsFault "DBInstanceAlreadyExists" -// User already has a DB instance with the given identifier. -// -// * ErrCodeInsufficientDBInstanceCapacityFault "InsufficientDBInstanceCapacity" -// Specified DB instance class is not available in the specified Availability -// Zone. -// -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// * ErrCodeInstanceQuotaExceededFault "InstanceQuotaExceeded" -// Request would result in user exceeding the allowed number of DB instances. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones -// unless there is only one Availability Zone. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeProvisionedIopsNotAvailableInAZFault "ProvisionedIopsNotAvailableInAZFault" -// Provisioned IOPS not available in the specified Availability Zone. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeStorageTypeNotSupportedFault "StorageTypeNotSupported" -// StorageType specified cannot be associated with the DB Instance. -// -// * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// Specified CIDRIP or EC2 security group is not authorized for the specified -// DB security group. -// -// RDS may not also be authorized via IAM to perform necessary actions on your -// behalf. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// * ErrCodeDomainNotFoundFault "DomainNotFoundFault" -// Domain does not refer to an existing Active Directory Domain. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstance -func (c *RDS) CreateDBInstance(input *CreateDBInstanceInput) (*CreateDBInstanceOutput, error) { - req, out := c.CreateDBInstanceRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBInstanceReadReplica = "CreateDBInstanceReadReplica" - -// CreateDBInstanceReadReplicaRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBInstanceReadReplica operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBInstanceReadReplica for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBInstanceReadReplica method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBInstanceReadReplicaRequest method. -// req, resp := client.CreateDBInstanceReadReplicaRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstanceReadReplica -func (c *RDS) CreateDBInstanceReadReplicaRequest(input *CreateDBInstanceReadReplicaInput) (req *request.Request, output *CreateDBInstanceReadReplicaOutput) { - op := &request.Operation{ - Name: opCreateDBInstanceReadReplica, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBInstanceReadReplicaInput{} - } - - output = &CreateDBInstanceReadReplicaOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBInstanceReadReplica API operation for Amazon Relational Database Service. -// -// Creates a DB instance for a DB instance running MySQL, MariaDB, or PostgreSQL -// that acts as a Read Replica of a source DB instance. -// -// All Read Replica DB instances are created as Single-AZ deployments with backups -// disabled. All other DB instance attributes (including DB security groups -// and DB parameter groups) are inherited from the source DB instance, except -// as specified below. -// -// The source DB instance must have backup retention enabled. -// -// You can create an encrypted Read Replica in a different AWS Region than the -// source DB instance. In that case, the region where you call the CreateDBInstanceReadReplica -// action is the destination region of the encrypted Read Replica. The source -// DB instance must be encrypted. -// -// To create an encrypted Read Replica in another AWS Region, you must provide -// the following values: -// -// * KmsKeyId - The AWS Key Management System (KMS) key identifier for the -// key to use to encrypt the Read Replica in the destination region. -// -// * PreSignedUrl - A URL that contains a Signature Version 4 signed request -// for the CreateDBInstanceReadReplica API action in the AWS region that -// contains the source DB instance. The PreSignedUrl parameter must be used -// when encrypting a Read Replica from another AWS region. -// -// The presigned URL must be a valid request for the CreateDBInstanceReadReplica -// API action that can be executed in the source region that contains the -// encrypted DB instance. The presigned URL request must contain the following -// parameter values: -// -// DestinationRegion - The AWS Region that the Read Replica is created in. This -// region is the same one where the CreateDBInstanceReadReplica action is -// called that contains this presigned URL. -// -// For example, if you create an encrypted Read Replica in the us-east-1 region, -// and the source DB instance is in the west-2 region, then you call the -// CreateDBInstanceReadReplica action in the us-east-1 region and provide -// a presigned URL that contains a call to the CreateDBInstanceReadReplica -// action in the us-west-2 region. For this example, the DestinationRegion -// in the presigned URL must be set to the us-east-1 region. -// -// KmsKeyId - The KMS key identifier for the key to use to encrypt the Read -// Replica in the destination region. This is the same identifier for both -// the CreateDBInstanceReadReplica action that is called in the destination -// region, and the action contained in the presigned URL. -// -// SourceDBInstanceIdentifier - The DB instance identifier for the encrypted -// Read Replica to be created. This identifier must be in the Amazon Resource -// Name (ARN) format for the source region. For example, if you create an -// encrypted Read Replica from a DB instance in the us-west-2 region, then -// your SourceDBInstanceIdentifier would look like this example: arn:aws:rds:us-west-2:123456789012:instance:mysql-instance1-instance-20161115. -// -// To learn how to generate a Signature Version 4 signed request, see Authenticating -// Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) -// and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). -// -// * DBInstanceIdentifier - The identifier for the encrypted Read Replica -// in the destination region. -// -// * SourceDBInstanceIdentifier - The DB instance identifier for the encrypted -// Read Replica. This identifier must be in the ARN format for the source -// region and is the same value as the SourceDBInstanceIdentifier in the -// presigned URL. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation CreateDBInstanceReadReplica for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceAlreadyExistsFault "DBInstanceAlreadyExists" -// User already has a DB instance with the given identifier. -// -// * ErrCodeInsufficientDBInstanceCapacityFault "InsufficientDBInstanceCapacity" -// Specified DB instance class is not available in the specified Availability -// Zone. -// -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// * ErrCodeInstanceQuotaExceededFault "InstanceQuotaExceeded" -// Request would result in user exceeding the allowed number of DB instances. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones -// unless there is only one Availability Zone. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeProvisionedIopsNotAvailableInAZFault "ProvisionedIopsNotAvailableInAZFault" -// Provisioned IOPS not available in the specified Availability Zone. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeDBSubnetGroupNotAllowedFault "DBSubnetGroupNotAllowedFault" -// Indicates that the DBSubnetGroup should not be specified while creating read -// replicas that lie in the same region as the source instance. -// -// * ErrCodeInvalidDBSubnetGroupFault "InvalidDBSubnetGroupFault" -// Indicates the DBSubnetGroup does not belong to the same VPC as that of an -// existing cross region read replica of the same source instance. -// -// * ErrCodeStorageTypeNotSupportedFault "StorageTypeNotSupported" -// StorageType specified cannot be associated with the DB Instance. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstanceReadReplica -func (c *RDS) CreateDBInstanceReadReplica(input *CreateDBInstanceReadReplicaInput) (*CreateDBInstanceReadReplicaOutput, error) { - req, out := c.CreateDBInstanceReadReplicaRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBParameterGroup = "CreateDBParameterGroup" - -// CreateDBParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBParameterGroupRequest method. -// req, resp := client.CreateDBParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBParameterGroup -func (c *RDS) CreateDBParameterGroupRequest(input *CreateDBParameterGroupInput) (req *request.Request, output *CreateDBParameterGroupOutput) { - op := &request.Operation{ - Name: opCreateDBParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBParameterGroupInput{} - } - - output = &CreateDBParameterGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBParameterGroup API operation for Amazon Relational Database Service. -// -// Creates a new DB parameter group. -// -// A DB parameter group is initially created with the default parameters for -// the database engine used by the DB instance. To provide custom values for -// any of the parameters, you must modify the group after creating it using -// ModifyDBParameterGroup. Once you've created a DB parameter group, you need -// to associate it with your DB instance using ModifyDBInstance. When you associate -// a new DB parameter group with a running DB instance, you need to reboot the -// DB instance without failover for the new DB parameter group and associated -// settings to take effect. -// -// After you create a DB parameter group, you should wait at least 5 minutes -// before creating your first DB instance that uses that DB parameter group -// as the default parameter group. This allows Amazon RDS to fully complete -// the create action before the parameter group is used as the default for a -// new DB instance. This is especially important for parameters that are critical -// when creating the default database for a DB instance, such as the character -// set for the default database defined by the character_set_database parameter. -// You can use the Parameter Groups option of the Amazon RDS console (https://console.aws.amazon.com/rds/) -// or the DescribeDBParameters command to verify that your DB parameter group -// has been created or modified. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation CreateDBParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupQuotaExceededFault "DBParameterGroupQuotaExceeded" -// Request would result in user exceeding the allowed number of DB parameter -// groups. -// -// * ErrCodeDBParameterGroupAlreadyExistsFault "DBParameterGroupAlreadyExists" -// A DB parameter group with the same name exists. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBParameterGroup -func (c *RDS) CreateDBParameterGroup(input *CreateDBParameterGroupInput) (*CreateDBParameterGroupOutput, error) { - req, out := c.CreateDBParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBSecurityGroup = "CreateDBSecurityGroup" - -// CreateDBSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBSecurityGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBSecurityGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBSecurityGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBSecurityGroupRequest method. -// req, resp := client.CreateDBSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSecurityGroup -func (c *RDS) CreateDBSecurityGroupRequest(input *CreateDBSecurityGroupInput) (req *request.Request, output *CreateDBSecurityGroupOutput) { - op := &request.Operation{ - Name: opCreateDBSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBSecurityGroupInput{} - } - - output = &CreateDBSecurityGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBSecurityGroup API operation for Amazon Relational Database Service. -// -// Creates a new DB security group. DB security groups control access to a DB -// 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 Relational Database Service's -// API operation CreateDBSecurityGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSecurityGroupAlreadyExistsFault "DBSecurityGroupAlreadyExists" -// A DB security group with the name specified in DBSecurityGroupName already -// exists. -// -// * ErrCodeDBSecurityGroupQuotaExceededFault "QuotaExceeded.DBSecurityGroup" -// Request would result in user exceeding the allowed number of DB security -// groups. -// -// * ErrCodeDBSecurityGroupNotSupportedFault "DBSecurityGroupNotSupported" -// A DB security group is not allowed for this action. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSecurityGroup -func (c *RDS) CreateDBSecurityGroup(input *CreateDBSecurityGroupInput) (*CreateDBSecurityGroupOutput, error) { - req, out := c.CreateDBSecurityGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBSnapshot = "CreateDBSnapshot" - -// CreateDBSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBSnapshotRequest method. -// req, resp := client.CreateDBSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSnapshot -func (c *RDS) CreateDBSnapshotRequest(input *CreateDBSnapshotInput) (req *request.Request, output *CreateDBSnapshotOutput) { - op := &request.Operation{ - Name: opCreateDBSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBSnapshotInput{} - } - - output = &CreateDBSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBSnapshot API operation for Amazon Relational Database Service. -// -// Creates a DBSnapshot. The source DBInstance must be in "available" 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 Relational Database Service's -// API operation CreateDBSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSnapshotAlreadyExistsFault "DBSnapshotAlreadyExists" -// DBSnapshotIdentifier is already used by an existing snapshot. -// -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// Request would result in user exceeding the allowed number of DB snapshots. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSnapshot -func (c *RDS) CreateDBSnapshot(input *CreateDBSnapshotInput) (*CreateDBSnapshotOutput, error) { - req, out := c.CreateDBSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCreateDBSubnetGroup = "CreateDBSubnetGroup" - -// CreateDBSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateDBSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDBSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDBSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDBSubnetGroupRequest method. -// req, resp := client.CreateDBSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSubnetGroup -func (c *RDS) CreateDBSubnetGroupRequest(input *CreateDBSubnetGroupInput) (req *request.Request, output *CreateDBSubnetGroupOutput) { - op := &request.Operation{ - Name: opCreateDBSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDBSubnetGroupInput{} - } - - output = &CreateDBSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDBSubnetGroup API operation for Amazon Relational Database Service. -// -// Creates a new DB subnet group. DB subnet groups must contain at least one -// subnet in at least two AZs in the 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 Relational Database Service's -// API operation CreateDBSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSubnetGroupAlreadyExistsFault "DBSubnetGroupAlreadyExists" -// DBSubnetGroupName is already used by an existing DB subnet group. -// -// * ErrCodeDBSubnetGroupQuotaExceededFault "DBSubnetGroupQuotaExceeded" -// Request would result in user exceeding the allowed number of DB subnet groups. -// -// * ErrCodeDBSubnetQuotaExceededFault "DBSubnetQuotaExceededFault" -// Request would result in user exceeding the allowed number of subnets in a -// DB subnet groups. -// -// * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones -// unless there is only one Availability Zone. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSubnetGroup -func (c *RDS) CreateDBSubnetGroup(input *CreateDBSubnetGroupInput) (*CreateDBSubnetGroupOutput, error) { - req, out := c.CreateDBSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateEventSubscription = "CreateEventSubscription" - -// CreateEventSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the CreateEventSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateEventSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateEventSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateEventSubscriptionRequest method. -// req, resp := client.CreateEventSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateEventSubscription -func (c *RDS) CreateEventSubscriptionRequest(input *CreateEventSubscriptionInput) (req *request.Request, output *CreateEventSubscriptionOutput) { - op := &request.Operation{ - Name: opCreateEventSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateEventSubscriptionInput{} - } - - output = &CreateEventSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEventSubscription API operation for Amazon Relational Database Service. -// -// Creates an RDS event notification subscription. This action requires a topic -// ARN (Amazon Resource Name) created by either the RDS console, the SNS console, -// or the SNS API. To obtain an ARN with SNS, you must create a topic in Amazon -// SNS and subscribe to the topic. The ARN is displayed in the SNS console. -// -// You can specify the type of source (SourceType) you want to be notified of, -// provide a list of RDS sources (SourceIds) that triggers the events, and provide -// a list of event categories (EventCategories) for events you want to be notified -// of. For example, you can specify SourceType = db-instance, SourceIds = mydbinstance1, -// mydbinstance2 and EventCategories = Availability, Backup. -// -// If you specify both the SourceType and SourceIds, such as SourceType = db-instance -// and SourceIdentifier = myDBInstance1, you will be notified of all the db-instance -// events for the specified source. If you specify a SourceType but do not specify -// a SourceIdentifier, you will receive notice of the events for that source -// type for all your RDS sources. If you do not specify either the SourceType -// nor the SourceIdentifier, you will be notified of events generated from all -// RDS sources belonging to your customer 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 Relational Database Service's -// API operation CreateEventSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEventSubscriptionQuotaExceededFault "EventSubscriptionQuotaExceeded" -// You have reached the maximum number of event subscriptions. -// -// * ErrCodeSubscriptionAlreadyExistFault "SubscriptionAlreadyExist" -// The supplied subscription name already exists. -// -// * ErrCodeSNSInvalidTopicFault "SNSInvalidTopic" -// SNS has responded that there is a problem with the SND topic specified. -// -// * ErrCodeSNSNoAuthorizationFault "SNSNoAuthorization" -// You do not have permission to publish to the SNS topic ARN. -// -// * ErrCodeSNSTopicArnNotFoundFault "SNSTopicArnNotFound" -// The SNS topic ARN does not exist. -// -// * ErrCodeSubscriptionCategoryNotFoundFault "SubscriptionCategoryNotFound" -// The supplied category does not exist. -// -// * ErrCodeSourceNotFoundFault "SourceNotFound" -// The requested source could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateEventSubscription -func (c *RDS) CreateEventSubscription(input *CreateEventSubscriptionInput) (*CreateEventSubscriptionOutput, error) { - req, out := c.CreateEventSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opCreateOptionGroup = "CreateOptionGroup" - -// CreateOptionGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateOptionGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateOptionGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateOptionGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateOptionGroupRequest method. -// req, resp := client.CreateOptionGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateOptionGroup -func (c *RDS) CreateOptionGroupRequest(input *CreateOptionGroupInput) (req *request.Request, output *CreateOptionGroupOutput) { - op := &request.Operation{ - Name: opCreateOptionGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateOptionGroupInput{} - } - - output = &CreateOptionGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateOptionGroup API operation for Amazon Relational Database Service. -// -// Creates a new option group. You can create up to 20 option groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation CreateOptionGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOptionGroupAlreadyExistsFault "OptionGroupAlreadyExistsFault" -// The option group you are trying to create already exists. -// -// * ErrCodeOptionGroupQuotaExceededFault "OptionGroupQuotaExceededFault" -// The quota of 20 option groups was exceeded for this AWS account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateOptionGroup -func (c *RDS) CreateOptionGroup(input *CreateOptionGroupInput) (*CreateOptionGroupOutput, error) { - req, out := c.CreateOptionGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDBCluster = "DeleteDBCluster" - -// DeleteDBClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDBCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDBCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDBCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDBClusterRequest method. -// req, resp := client.DeleteDBClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBCluster -func (c *RDS) DeleteDBClusterRequest(input *DeleteDBClusterInput) (req *request.Request, output *DeleteDBClusterOutput) { - op := &request.Operation{ - Name: opDeleteDBCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDBClusterInput{} - } - - output = &DeleteDBClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDBCluster API operation for Amazon Relational Database Service. -// -// The DeleteDBCluster action deletes a previously provisioned DB cluster. When -// you delete a DB cluster, all automated backups for that DB cluster are deleted -// and cannot be recovered. Manual DB cluster snapshots of the specified DB -// cluster are not deleted. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html)in the Amazon RDS 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 Relational Database Service's -// API operation DeleteDBCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeDBClusterSnapshotAlreadyExistsFault "DBClusterSnapshotAlreadyExistsFault" -// User already has a DB cluster snapshot with the given identifier. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// Request would result in user exceeding the allowed number of DB snapshots. -// -// * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The supplied value is not a valid DB cluster snapshot state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBCluster -func (c *RDS) DeleteDBCluster(input *DeleteDBClusterInput) (*DeleteDBClusterOutput, error) { - req, out := c.DeleteDBClusterRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDBClusterParameterGroup = "DeleteDBClusterParameterGroup" - -// DeleteDBClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDBClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDBClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDBClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDBClusterParameterGroupRequest method. -// req, resp := client.DeleteDBClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterParameterGroup -func (c *RDS) DeleteDBClusterParameterGroupRequest(input *DeleteDBClusterParameterGroupInput) (req *request.Request, output *DeleteDBClusterParameterGroupOutput) { - op := &request.Operation{ - Name: opDeleteDBClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDBClusterParameterGroupInput{} - } - - output = &DeleteDBClusterParameterGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDBClusterParameterGroup API operation for Amazon Relational Database Service. -// -// Deletes a specified DB cluster parameter group. The DB cluster parameter -// group to be deleted cannot be associated with any DB clusters. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation DeleteDBClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group cannot be deleted because it is in use. -// -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterParameterGroup -func (c *RDS) DeleteDBClusterParameterGroup(input *DeleteDBClusterParameterGroupInput) (*DeleteDBClusterParameterGroupOutput, error) { - req, out := c.DeleteDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDBClusterSnapshot = "DeleteDBClusterSnapshot" - -// DeleteDBClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDBClusterSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDBClusterSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDBClusterSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDBClusterSnapshotRequest method. -// req, resp := client.DeleteDBClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterSnapshot -func (c *RDS) DeleteDBClusterSnapshotRequest(input *DeleteDBClusterSnapshotInput) (req *request.Request, output *DeleteDBClusterSnapshotOutput) { - op := &request.Operation{ - Name: opDeleteDBClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDBClusterSnapshotInput{} - } - - output = &DeleteDBClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDBClusterSnapshot API operation for Amazon Relational Database Service. -// -// Deletes a DB cluster snapshot. If the snapshot is being copied, the copy -// operation is terminated. -// -// The DB cluster snapshot must be in the available state to be deleted. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation DeleteDBClusterSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The supplied value is not a valid DB cluster snapshot state. -// -// * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterSnapshot -func (c *RDS) DeleteDBClusterSnapshot(input *DeleteDBClusterSnapshotInput) (*DeleteDBClusterSnapshotOutput, error) { - req, out := c.DeleteDBClusterSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDBInstance = "DeleteDBInstance" - -// DeleteDBInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDBInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDBInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDBInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDBInstanceRequest method. -// req, resp := client.DeleteDBInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBInstance -func (c *RDS) DeleteDBInstanceRequest(input *DeleteDBInstanceInput) (req *request.Request, output *DeleteDBInstanceOutput) { - op := &request.Operation{ - Name: opDeleteDBInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDBInstanceInput{} - } - - output = &DeleteDBInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDBInstance API operation for Amazon Relational Database Service. -// -// The DeleteDBInstance action deletes a previously provisioned DB instance. -// When you delete a DB instance, all automated backups for that instance are -// deleted and cannot be recovered. Manual DB snapshots of the DB instance to -// be deleted by DeleteDBInstance are not deleted. -// -// If you request a final DB snapshot the status of the Amazon RDS DB instance -// is deleting until the DB snapshot is created. The API action DescribeDBInstance -// is used to monitor the status of this operation. The action cannot be canceled -// or reverted once submitted. -// -// Note that when a DB instance is in a failure state and has a status of failed, -// incompatible-restore, or incompatible-network, you can only delete it when -// the SkipFinalSnapshot parameter is set to true. -// -// If the specified DB instance is part of an Amazon Aurora DB cluster, you -// cannot delete the DB instance if the following are true: -// -// * The DB cluster is a Read Replica of another Amazon Aurora DB cluster. -// -// * The DB instance is the only instance in the DB cluster. -// -// To delete a DB instance in this case, first call the PromoteReadReplicaDBCluster -// API action to promote the DB cluster so it's no longer a Read Replica. After -// the promotion completes, then call the DeleteDBInstance API action to delete -// the final instance in the DB cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DeleteDBInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodeDBSnapshotAlreadyExistsFault "DBSnapshotAlreadyExists" -// DBSnapshotIdentifier is already used by an existing snapshot. -// -// * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// Request would result in user exceeding the allowed number of DB snapshots. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBInstance -func (c *RDS) DeleteDBInstance(input *DeleteDBInstanceInput) (*DeleteDBInstanceOutput, error) { - req, out := c.DeleteDBInstanceRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDBParameterGroup = "DeleteDBParameterGroup" - -// DeleteDBParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDBParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDBParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDBParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDBParameterGroupRequest method. -// req, resp := client.DeleteDBParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBParameterGroup -func (c *RDS) DeleteDBParameterGroupRequest(input *DeleteDBParameterGroupInput) (req *request.Request, output *DeleteDBParameterGroupOutput) { - op := &request.Operation{ - Name: opDeleteDBParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDBParameterGroupInput{} - } - - output = &DeleteDBParameterGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDBParameterGroup API operation for Amazon Relational Database Service. -// -// Deletes a specified DBParameterGroup. The DBParameterGroup to be deleted -// cannot be associated with any DB 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 Relational Database Service's -// API operation DeleteDBParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group cannot be deleted because it is in use. -// -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBParameterGroup -func (c *RDS) DeleteDBParameterGroup(input *DeleteDBParameterGroupInput) (*DeleteDBParameterGroupOutput, error) { - req, out := c.DeleteDBParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDBSecurityGroup = "DeleteDBSecurityGroup" - -// DeleteDBSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDBSecurityGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDBSecurityGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDBSecurityGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDBSecurityGroupRequest method. -// req, resp := client.DeleteDBSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSecurityGroup -func (c *RDS) DeleteDBSecurityGroupRequest(input *DeleteDBSecurityGroupInput) (req *request.Request, output *DeleteDBSecurityGroupOutput) { - op := &request.Operation{ - Name: opDeleteDBSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDBSecurityGroupInput{} - } - - output = &DeleteDBSecurityGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDBSecurityGroup API operation for Amazon Relational Database Service. -// -// Deletes a DB security group. -// -// The specified DB security group must not be associated with any DB 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 Relational Database Service's -// API operation DeleteDBSecurityGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBSecurityGroupStateFault "InvalidDBSecurityGroupState" -// The state of the DB security group does not allow deletion. -// -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSecurityGroup -func (c *RDS) DeleteDBSecurityGroup(input *DeleteDBSecurityGroupInput) (*DeleteDBSecurityGroupOutput, error) { - req, out := c.DeleteDBSecurityGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDBSnapshot = "DeleteDBSnapshot" - -// DeleteDBSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDBSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDBSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDBSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDBSnapshotRequest method. -// req, resp := client.DeleteDBSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSnapshot -func (c *RDS) DeleteDBSnapshotRequest(input *DeleteDBSnapshotInput) (req *request.Request, output *DeleteDBSnapshotOutput) { - op := &request.Operation{ - Name: opDeleteDBSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDBSnapshotInput{} - } - - output = &DeleteDBSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDBSnapshot API operation for Amazon Relational Database Service. -// -// Deletes a DBSnapshot. If the snapshot is being copied, the copy operation -// is terminated. -// -// The DBSnapshot must be in the available state to 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 Relational Database Service's -// API operation DeleteDBSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBSnapshotStateFault "InvalidDBSnapshotState" -// The state of the DB snapshot does not allow deletion. -// -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSnapshot -func (c *RDS) DeleteDBSnapshot(input *DeleteDBSnapshotInput) (*DeleteDBSnapshotOutput, error) { - req, out := c.DeleteDBSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDBSubnetGroup = "DeleteDBSubnetGroup" - -// DeleteDBSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDBSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDBSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDBSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDBSubnetGroupRequest method. -// req, resp := client.DeleteDBSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSubnetGroup -func (c *RDS) DeleteDBSubnetGroupRequest(input *DeleteDBSubnetGroupInput) (req *request.Request, output *DeleteDBSubnetGroupOutput) { - op := &request.Operation{ - Name: opDeleteDBSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDBSubnetGroupInput{} - } - - output = &DeleteDBSubnetGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDBSubnetGroup API operation for Amazon Relational Database Service. -// -// Deletes a DB subnet group. -// -// The specified database subnet group must not be associated with any DB 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 Relational Database Service's -// API operation DeleteDBSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBSubnetGroupStateFault "InvalidDBSubnetGroupStateFault" -// The DB subnet group cannot be deleted because it is in use. -// -// * ErrCodeInvalidDBSubnetStateFault "InvalidDBSubnetStateFault" -// The DB subnet is not in the available state. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSubnetGroup -func (c *RDS) DeleteDBSubnetGroup(input *DeleteDBSubnetGroupInput) (*DeleteDBSubnetGroupOutput, error) { - req, out := c.DeleteDBSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteEventSubscription = "DeleteEventSubscription" - -// DeleteEventSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEventSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteEventSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteEventSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteEventSubscriptionRequest method. -// req, resp := client.DeleteEventSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteEventSubscription -func (c *RDS) DeleteEventSubscriptionRequest(input *DeleteEventSubscriptionInput) (req *request.Request, output *DeleteEventSubscriptionOutput) { - op := &request.Operation{ - Name: opDeleteEventSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEventSubscriptionInput{} - } - - output = &DeleteEventSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteEventSubscription API operation for Amazon Relational Database Service. -// -// Deletes an RDS event notification subscription. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DeleteEventSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionNotFoundFault "SubscriptionNotFound" -// The subscription name does not exist. -// -// * ErrCodeInvalidEventSubscriptionStateFault "InvalidEventSubscriptionState" -// This error can occur if someone else is modifying a subscription. You should -// retry the action. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteEventSubscription -func (c *RDS) DeleteEventSubscription(input *DeleteEventSubscriptionInput) (*DeleteEventSubscriptionOutput, error) { - req, out := c.DeleteEventSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteOptionGroup = "DeleteOptionGroup" - -// DeleteOptionGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteOptionGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteOptionGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteOptionGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteOptionGroupRequest method. -// req, resp := client.DeleteOptionGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteOptionGroup -func (c *RDS) DeleteOptionGroupRequest(input *DeleteOptionGroupInput) (req *request.Request, output *DeleteOptionGroupOutput) { - op := &request.Operation{ - Name: opDeleteOptionGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteOptionGroupInput{} - } - - output = &DeleteOptionGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteOptionGroup API operation for Amazon Relational Database Service. -// -// Deletes an existing option group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DeleteOptionGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeInvalidOptionGroupStateFault "InvalidOptionGroupStateFault" -// The option group is not in the available state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteOptionGroup -func (c *RDS) DeleteOptionGroup(input *DeleteOptionGroupInput) (*DeleteOptionGroupOutput, error) { - req, out := c.DeleteOptionGroupRequest(input) - err := req.Send() - return out, err -} - -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/rds-2014-10-31/DescribeAccountAttributes -func (c *RDS) 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 Relational Database Service. -// -// Lists all of the attributes for a customer account. The attributes include -// Amazon RDS quotas for the account, such as the number of DB instances allowed. -// The description for a quota includes the quota name, current usage toward -// that quota, and the quota's maximum value. -// -// This command does not take any parameters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeAccountAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeAccountAttributes -func (c *RDS) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error) { - req, out := c.DescribeAccountAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeCertificates = "DescribeCertificates" - -// DescribeCertificatesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCertificates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCertificates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCertificates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCertificatesRequest method. -// req, resp := client.DescribeCertificatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeCertificates -func (c *RDS) DescribeCertificatesRequest(input *DescribeCertificatesInput) (req *request.Request, output *DescribeCertificatesOutput) { - op := &request.Operation{ - Name: opDescribeCertificates, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeCertificatesInput{} - } - - output = &DescribeCertificatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCertificates API operation for Amazon Relational Database Service. -// -// Lists the set of CA certificates provided by Amazon RDS for this 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 Relational Database Service's -// API operation DescribeCertificates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCertificateNotFoundFault "CertificateNotFound" -// CertificateIdentifier does not refer to an existing certificate. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeCertificates -func (c *RDS) DescribeCertificates(input *DescribeCertificatesInput) (*DescribeCertificatesOutput, error) { - req, out := c.DescribeCertificatesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDBClusterParameterGroups = "DescribeDBClusterParameterGroups" - -// DescribeDBClusterParameterGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBClusterParameterGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBClusterParameterGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBClusterParameterGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBClusterParameterGroupsRequest method. -// req, resp := client.DescribeDBClusterParameterGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterParameterGroups -func (c *RDS) DescribeDBClusterParameterGroupsRequest(input *DescribeDBClusterParameterGroupsInput) (req *request.Request, output *DescribeDBClusterParameterGroupsOutput) { - op := &request.Operation{ - Name: opDescribeDBClusterParameterGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDBClusterParameterGroupsInput{} - } - - output = &DescribeDBClusterParameterGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBClusterParameterGroups API operation for Amazon Relational Database Service. -// -// Returns a list of DBClusterParameterGroup descriptions. If a DBClusterParameterGroupName -// parameter is specified, the list will contain only the description of the -// specified DB cluster parameter group. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation DescribeDBClusterParameterGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterParameterGroups -func (c *RDS) DescribeDBClusterParameterGroups(input *DescribeDBClusterParameterGroupsInput) (*DescribeDBClusterParameterGroupsOutput, error) { - req, out := c.DescribeDBClusterParameterGroupsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDBClusterParameters = "DescribeDBClusterParameters" - -// DescribeDBClusterParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBClusterParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBClusterParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBClusterParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBClusterParametersRequest method. -// req, resp := client.DescribeDBClusterParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterParameters -func (c *RDS) DescribeDBClusterParametersRequest(input *DescribeDBClusterParametersInput) (req *request.Request, output *DescribeDBClusterParametersOutput) { - op := &request.Operation{ - Name: opDescribeDBClusterParameters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDBClusterParametersInput{} - } - - output = &DescribeDBClusterParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBClusterParameters API operation for Amazon Relational Database Service. -// -// Returns the detailed parameter list for a particular DB cluster parameter -// group. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation DescribeDBClusterParameters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterParameters -func (c *RDS) DescribeDBClusterParameters(input *DescribeDBClusterParametersInput) (*DescribeDBClusterParametersOutput, error) { - req, out := c.DescribeDBClusterParametersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDBClusterSnapshotAttributes = "DescribeDBClusterSnapshotAttributes" - -// DescribeDBClusterSnapshotAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBClusterSnapshotAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBClusterSnapshotAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBClusterSnapshotAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBClusterSnapshotAttributesRequest method. -// req, resp := client.DescribeDBClusterSnapshotAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshotAttributes -func (c *RDS) DescribeDBClusterSnapshotAttributesRequest(input *DescribeDBClusterSnapshotAttributesInput) (req *request.Request, output *DescribeDBClusterSnapshotAttributesOutput) { - op := &request.Operation{ - Name: opDescribeDBClusterSnapshotAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDBClusterSnapshotAttributesInput{} - } - - output = &DescribeDBClusterSnapshotAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBClusterSnapshotAttributes API operation for Amazon Relational Database Service. -// -// Returns a list of DB cluster snapshot attribute names and values for a manual -// DB cluster snapshot. -// -// When sharing snapshots with other AWS accounts, DescribeDBClusterSnapshotAttributes -// returns the restore attribute and a list of IDs for the AWS accounts that -// are authorized to copy or restore the manual DB cluster snapshot. If all -// is included in the list of values for the restore attribute, then the manual -// DB cluster snapshot is public and can be copied or restored by all AWS accounts. -// -// To add or remove access for an AWS account to copy or restore a manual DB -// cluster snapshot, or to make the manual DB cluster snapshot public or private, -// use the ModifyDBClusterSnapshotAttribute API action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBClusterSnapshotAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshotAttributes -func (c *RDS) DescribeDBClusterSnapshotAttributes(input *DescribeDBClusterSnapshotAttributesInput) (*DescribeDBClusterSnapshotAttributesOutput, error) { - req, out := c.DescribeDBClusterSnapshotAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDBClusterSnapshots = "DescribeDBClusterSnapshots" - -// DescribeDBClusterSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBClusterSnapshots operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBClusterSnapshots for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBClusterSnapshots method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBClusterSnapshotsRequest method. -// req, resp := client.DescribeDBClusterSnapshotsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshots -func (c *RDS) DescribeDBClusterSnapshotsRequest(input *DescribeDBClusterSnapshotsInput) (req *request.Request, output *DescribeDBClusterSnapshotsOutput) { - op := &request.Operation{ - Name: opDescribeDBClusterSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDBClusterSnapshotsInput{} - } - - output = &DescribeDBClusterSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBClusterSnapshots API operation for Amazon Relational Database Service. -// -// Returns information about DB cluster snapshots. This API action supports -// pagination. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation DescribeDBClusterSnapshots for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshots -func (c *RDS) DescribeDBClusterSnapshots(input *DescribeDBClusterSnapshotsInput) (*DescribeDBClusterSnapshotsOutput, error) { - req, out := c.DescribeDBClusterSnapshotsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDBClusters = "DescribeDBClusters" - -// DescribeDBClustersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBClusters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBClusters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBClusters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBClustersRequest method. -// req, resp := client.DescribeDBClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusters -func (c *RDS) DescribeDBClustersRequest(input *DescribeDBClustersInput) (req *request.Request, output *DescribeDBClustersOutput) { - op := &request.Operation{ - Name: opDescribeDBClusters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDBClustersInput{} - } - - output = &DescribeDBClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBClusters API operation for Amazon Relational Database Service. -// -// Returns information about provisioned Aurora DB clusters. This API supports -// pagination. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation DescribeDBClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusters -func (c *RDS) DescribeDBClusters(input *DescribeDBClustersInput) (*DescribeDBClustersOutput, error) { - req, out := c.DescribeDBClustersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDBEngineVersions = "DescribeDBEngineVersions" - -// DescribeDBEngineVersionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBEngineVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBEngineVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBEngineVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBEngineVersionsRequest method. -// req, resp := client.DescribeDBEngineVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBEngineVersions -func (c *RDS) DescribeDBEngineVersionsRequest(input *DescribeDBEngineVersionsInput) (req *request.Request, output *DescribeDBEngineVersionsOutput) { - op := &request.Operation{ - Name: opDescribeDBEngineVersions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDBEngineVersionsInput{} - } - - output = &DescribeDBEngineVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBEngineVersions API operation for Amazon Relational Database Service. -// -// Returns a list of the available DB engines. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBEngineVersions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBEngineVersions -func (c *RDS) DescribeDBEngineVersions(input *DescribeDBEngineVersionsInput) (*DescribeDBEngineVersionsOutput, error) { - req, out := c.DescribeDBEngineVersionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeDBEngineVersionsPages iterates over the pages of a DescribeDBEngineVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBEngineVersions 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 DescribeDBEngineVersions operation. -// pageNum := 0 -// err := client.DescribeDBEngineVersionsPages(params, -// func(page *DescribeDBEngineVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBEngineVersionsPages(input *DescribeDBEngineVersionsInput, fn func(p *DescribeDBEngineVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBEngineVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBEngineVersionsOutput), lastPage) - }) -} - -const opDescribeDBInstances = "DescribeDBInstances" - -// DescribeDBInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBInstancesRequest method. -// req, resp := client.DescribeDBInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBInstances -func (c *RDS) DescribeDBInstancesRequest(input *DescribeDBInstancesInput) (req *request.Request, output *DescribeDBInstancesOutput) { - op := &request.Operation{ - Name: opDescribeDBInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDBInstancesInput{} - } - - output = &DescribeDBInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBInstances API operation for Amazon Relational Database Service. -// -// Returns information about provisioned RDS instances. This API supports pagination. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBInstances -func (c *RDS) DescribeDBInstances(input *DescribeDBInstancesInput) (*DescribeDBInstancesOutput, error) { - req, out := c.DescribeDBInstancesRequest(input) - err := req.Send() - return out, err -} - -// DescribeDBInstancesPages iterates over the pages of a DescribeDBInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBInstances 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 DescribeDBInstances operation. -// pageNum := 0 -// err := client.DescribeDBInstancesPages(params, -// func(page *DescribeDBInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBInstancesPages(input *DescribeDBInstancesInput, fn func(p *DescribeDBInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBInstancesOutput), lastPage) - }) -} - -const opDescribeDBLogFiles = "DescribeDBLogFiles" - -// DescribeDBLogFilesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBLogFiles operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBLogFiles for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBLogFiles method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBLogFilesRequest method. -// req, resp := client.DescribeDBLogFilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBLogFiles -func (c *RDS) DescribeDBLogFilesRequest(input *DescribeDBLogFilesInput) (req *request.Request, output *DescribeDBLogFilesOutput) { - op := &request.Operation{ - Name: opDescribeDBLogFiles, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDBLogFilesInput{} - } - - output = &DescribeDBLogFilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBLogFiles API operation for Amazon Relational Database Service. -// -// Returns a list of DB log files for the DB 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 Relational Database Service's -// API operation DescribeDBLogFiles for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBLogFiles -func (c *RDS) DescribeDBLogFiles(input *DescribeDBLogFilesInput) (*DescribeDBLogFilesOutput, error) { - req, out := c.DescribeDBLogFilesRequest(input) - err := req.Send() - return out, err -} - -// DescribeDBLogFilesPages iterates over the pages of a DescribeDBLogFiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBLogFiles 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 DescribeDBLogFiles operation. -// pageNum := 0 -// err := client.DescribeDBLogFilesPages(params, -// func(page *DescribeDBLogFilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBLogFilesPages(input *DescribeDBLogFilesInput, fn func(p *DescribeDBLogFilesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBLogFilesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBLogFilesOutput), lastPage) - }) -} - -const opDescribeDBParameterGroups = "DescribeDBParameterGroups" - -// DescribeDBParameterGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBParameterGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBParameterGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBParameterGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBParameterGroupsRequest method. -// req, resp := client.DescribeDBParameterGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBParameterGroups -func (c *RDS) DescribeDBParameterGroupsRequest(input *DescribeDBParameterGroupsInput) (req *request.Request, output *DescribeDBParameterGroupsOutput) { - op := &request.Operation{ - Name: opDescribeDBParameterGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDBParameterGroupsInput{} - } - - output = &DescribeDBParameterGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBParameterGroups API operation for Amazon Relational Database Service. -// -// Returns a list of DBParameterGroup descriptions. If a DBParameterGroupName -// is specified, the list will contain only the description of the specified -// DB parameter group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBParameterGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBParameterGroups -func (c *RDS) DescribeDBParameterGroups(input *DescribeDBParameterGroupsInput) (*DescribeDBParameterGroupsOutput, error) { - req, out := c.DescribeDBParameterGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeDBParameterGroupsPages iterates over the pages of a DescribeDBParameterGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBParameterGroups 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 DescribeDBParameterGroups operation. -// pageNum := 0 -// err := client.DescribeDBParameterGroupsPages(params, -// func(page *DescribeDBParameterGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBParameterGroupsPages(input *DescribeDBParameterGroupsInput, fn func(p *DescribeDBParameterGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBParameterGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBParameterGroupsOutput), lastPage) - }) -} - -const opDescribeDBParameters = "DescribeDBParameters" - -// DescribeDBParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBParametersRequest method. -// req, resp := client.DescribeDBParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBParameters -func (c *RDS) DescribeDBParametersRequest(input *DescribeDBParametersInput) (req *request.Request, output *DescribeDBParametersOutput) { - op := &request.Operation{ - Name: opDescribeDBParameters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDBParametersInput{} - } - - output = &DescribeDBParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBParameters API operation for Amazon Relational Database Service. -// -// Returns the detailed parameter list for a particular DB parameter group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBParameters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBParameters -func (c *RDS) DescribeDBParameters(input *DescribeDBParametersInput) (*DescribeDBParametersOutput, error) { - req, out := c.DescribeDBParametersRequest(input) - err := req.Send() - return out, err -} - -// DescribeDBParametersPages iterates over the pages of a DescribeDBParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBParameters 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 DescribeDBParameters operation. -// pageNum := 0 -// err := client.DescribeDBParametersPages(params, -// func(page *DescribeDBParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBParametersPages(input *DescribeDBParametersInput, fn func(p *DescribeDBParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBParametersOutput), lastPage) - }) -} - -const opDescribeDBSecurityGroups = "DescribeDBSecurityGroups" - -// DescribeDBSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBSecurityGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBSecurityGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBSecurityGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBSecurityGroupsRequest method. -// req, resp := client.DescribeDBSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSecurityGroups -func (c *RDS) DescribeDBSecurityGroupsRequest(input *DescribeDBSecurityGroupsInput) (req *request.Request, output *DescribeDBSecurityGroupsOutput) { - op := &request.Operation{ - Name: opDescribeDBSecurityGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDBSecurityGroupsInput{} - } - - output = &DescribeDBSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBSecurityGroups API operation for Amazon Relational Database Service. -// -// Returns a list of DBSecurityGroup descriptions. If a DBSecurityGroupName -// is specified, the list will contain only the descriptions of the specified -// DB security group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBSecurityGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSecurityGroups -func (c *RDS) DescribeDBSecurityGroups(input *DescribeDBSecurityGroupsInput) (*DescribeDBSecurityGroupsOutput, error) { - req, out := c.DescribeDBSecurityGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeDBSecurityGroupsPages iterates over the pages of a DescribeDBSecurityGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBSecurityGroups 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 DescribeDBSecurityGroups operation. -// pageNum := 0 -// err := client.DescribeDBSecurityGroupsPages(params, -// func(page *DescribeDBSecurityGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBSecurityGroupsPages(input *DescribeDBSecurityGroupsInput, fn func(p *DescribeDBSecurityGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBSecurityGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBSecurityGroupsOutput), lastPage) - }) -} - -const opDescribeDBSnapshotAttributes = "DescribeDBSnapshotAttributes" - -// DescribeDBSnapshotAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBSnapshotAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBSnapshotAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBSnapshotAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBSnapshotAttributesRequest method. -// req, resp := client.DescribeDBSnapshotAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshotAttributes -func (c *RDS) DescribeDBSnapshotAttributesRequest(input *DescribeDBSnapshotAttributesInput) (req *request.Request, output *DescribeDBSnapshotAttributesOutput) { - op := &request.Operation{ - Name: opDescribeDBSnapshotAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDBSnapshotAttributesInput{} - } - - output = &DescribeDBSnapshotAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBSnapshotAttributes API operation for Amazon Relational Database Service. -// -// Returns a list of DB snapshot attribute names and values for a manual DB -// snapshot. -// -// When sharing snapshots with other AWS accounts, DescribeDBSnapshotAttributes -// returns the restore attribute and a list of IDs for the AWS accounts that -// are authorized to copy or restore the manual DB snapshot. If all is included -// in the list of values for the restore attribute, then the manual DB snapshot -// is public and can be copied or restored by all AWS accounts. -// -// To add or remove access for an AWS account to copy or restore a manual DB -// snapshot, or to make the manual DB snapshot public or private, use the ModifyDBSnapshotAttribute -// API action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBSnapshotAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshotAttributes -func (c *RDS) DescribeDBSnapshotAttributes(input *DescribeDBSnapshotAttributesInput) (*DescribeDBSnapshotAttributesOutput, error) { - req, out := c.DescribeDBSnapshotAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDBSnapshots = "DescribeDBSnapshots" - -// DescribeDBSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBSnapshots operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBSnapshots for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBSnapshots method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBSnapshotsRequest method. -// req, resp := client.DescribeDBSnapshotsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshots -func (c *RDS) DescribeDBSnapshotsRequest(input *DescribeDBSnapshotsInput) (req *request.Request, output *DescribeDBSnapshotsOutput) { - op := &request.Operation{ - Name: opDescribeDBSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDBSnapshotsInput{} - } - - output = &DescribeDBSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBSnapshots API operation for Amazon Relational Database Service. -// -// Returns information about DB snapshots. This API action supports pagination. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBSnapshots for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshots -func (c *RDS) DescribeDBSnapshots(input *DescribeDBSnapshotsInput) (*DescribeDBSnapshotsOutput, error) { - req, out := c.DescribeDBSnapshotsRequest(input) - err := req.Send() - return out, err -} - -// DescribeDBSnapshotsPages iterates over the pages of a DescribeDBSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBSnapshots 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 DescribeDBSnapshots operation. -// pageNum := 0 -// err := client.DescribeDBSnapshotsPages(params, -// func(page *DescribeDBSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBSnapshotsPages(input *DescribeDBSnapshotsInput, fn func(p *DescribeDBSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBSnapshotsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBSnapshotsOutput), lastPage) - }) -} - -const opDescribeDBSubnetGroups = "DescribeDBSubnetGroups" - -// DescribeDBSubnetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDBSubnetGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDBSubnetGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDBSubnetGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDBSubnetGroupsRequest method. -// req, resp := client.DescribeDBSubnetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSubnetGroups -func (c *RDS) DescribeDBSubnetGroupsRequest(input *DescribeDBSubnetGroupsInput) (req *request.Request, output *DescribeDBSubnetGroupsOutput) { - op := &request.Operation{ - Name: opDescribeDBSubnetGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDBSubnetGroupsInput{} - } - - output = &DescribeDBSubnetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDBSubnetGroups API operation for Amazon Relational Database Service. -// -// Returns a list of DBSubnetGroup descriptions. If a DBSubnetGroupName is specified, -// the list will contain only the descriptions of the specified DBSubnetGroup. -// -// For an overview of CIDR ranges, go to the Wikipedia Tutorial (http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeDBSubnetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSubnetGroups -func (c *RDS) DescribeDBSubnetGroups(input *DescribeDBSubnetGroupsInput) (*DescribeDBSubnetGroupsOutput, error) { - req, out := c.DescribeDBSubnetGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeDBSubnetGroupsPages iterates over the pages of a DescribeDBSubnetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDBSubnetGroups 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 DescribeDBSubnetGroups operation. -// pageNum := 0 -// err := client.DescribeDBSubnetGroupsPages(params, -// func(page *DescribeDBSubnetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeDBSubnetGroupsPages(input *DescribeDBSubnetGroupsInput, fn func(p *DescribeDBSubnetGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDBSubnetGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDBSubnetGroupsOutput), lastPage) - }) -} - -const opDescribeEngineDefaultClusterParameters = "DescribeEngineDefaultClusterParameters" - -// DescribeEngineDefaultClusterParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEngineDefaultClusterParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEngineDefaultClusterParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEngineDefaultClusterParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEngineDefaultClusterParametersRequest method. -// req, resp := client.DescribeEngineDefaultClusterParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultClusterParameters -func (c *RDS) DescribeEngineDefaultClusterParametersRequest(input *DescribeEngineDefaultClusterParametersInput) (req *request.Request, output *DescribeEngineDefaultClusterParametersOutput) { - op := &request.Operation{ - Name: opDescribeEngineDefaultClusterParameters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEngineDefaultClusterParametersInput{} - } - - output = &DescribeEngineDefaultClusterParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEngineDefaultClusterParameters API operation for Amazon Relational Database Service. -// -// Returns the default engine and system parameter information for the cluster -// database engine. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation DescribeEngineDefaultClusterParameters for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultClusterParameters -func (c *RDS) DescribeEngineDefaultClusterParameters(input *DescribeEngineDefaultClusterParametersInput) (*DescribeEngineDefaultClusterParametersOutput, error) { - req, out := c.DescribeEngineDefaultClusterParametersRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEngineDefaultParameters = "DescribeEngineDefaultParameters" - -// DescribeEngineDefaultParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEngineDefaultParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEngineDefaultParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEngineDefaultParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEngineDefaultParametersRequest method. -// req, resp := client.DescribeEngineDefaultParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultParameters -func (c *RDS) DescribeEngineDefaultParametersRequest(input *DescribeEngineDefaultParametersInput) (req *request.Request, output *DescribeEngineDefaultParametersOutput) { - op := &request.Operation{ - Name: opDescribeEngineDefaultParameters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"EngineDefaults.Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEngineDefaultParametersInput{} - } - - output = &DescribeEngineDefaultParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEngineDefaultParameters API operation for Amazon Relational Database Service. -// -// Returns the default engine and system parameter information for the specified -// database engine. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeEngineDefaultParameters for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultParameters -func (c *RDS) DescribeEngineDefaultParameters(input *DescribeEngineDefaultParametersInput) (*DescribeEngineDefaultParametersOutput, error) { - req, out := c.DescribeEngineDefaultParametersRequest(input) - err := req.Send() - return out, err -} - -// DescribeEngineDefaultParametersPages iterates over the pages of a DescribeEngineDefaultParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEngineDefaultParameters 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 DescribeEngineDefaultParameters operation. -// pageNum := 0 -// err := client.DescribeEngineDefaultParametersPages(params, -// func(page *DescribeEngineDefaultParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeEngineDefaultParametersPages(input *DescribeEngineDefaultParametersInput, fn func(p *DescribeEngineDefaultParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEngineDefaultParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEngineDefaultParametersOutput), lastPage) - }) -} - -const opDescribeEventCategories = "DescribeEventCategories" - -// DescribeEventCategoriesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEventCategories operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEventCategories for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEventCategories method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventCategoriesRequest method. -// req, resp := client.DescribeEventCategoriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventCategories -func (c *RDS) DescribeEventCategoriesRequest(input *DescribeEventCategoriesInput) (req *request.Request, output *DescribeEventCategoriesOutput) { - op := &request.Operation{ - Name: opDescribeEventCategories, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEventCategoriesInput{} - } - - output = &DescribeEventCategoriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEventCategories API operation for Amazon Relational Database Service. -// -// Displays a list of categories for all event source types, or, if specified, -// for a specified source type. You can see a list of the event categories and -// source types in the Events (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) -// topic in the Amazon RDS 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 Relational Database Service's -// API operation DescribeEventCategories for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventCategories -func (c *RDS) DescribeEventCategories(input *DescribeEventCategoriesInput) (*DescribeEventCategoriesOutput, error) { - req, out := c.DescribeEventCategoriesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEventSubscriptions = "DescribeEventSubscriptions" - -// DescribeEventSubscriptionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEventSubscriptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEventSubscriptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEventSubscriptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventSubscriptionsRequest method. -// req, resp := client.DescribeEventSubscriptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventSubscriptions -func (c *RDS) DescribeEventSubscriptionsRequest(input *DescribeEventSubscriptionsInput) (req *request.Request, output *DescribeEventSubscriptionsOutput) { - op := &request.Operation{ - Name: opDescribeEventSubscriptions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEventSubscriptionsInput{} - } - - output = &DescribeEventSubscriptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEventSubscriptions API operation for Amazon Relational Database Service. -// -// Lists all the subscription descriptions for a customer account. The description -// for a subscription includes SubscriptionName, SNSTopicARN, CustomerID, SourceType, -// SourceID, CreationTime, and Status. -// -// If you specify a SubscriptionName, lists the description for that subscription. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeEventSubscriptions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionNotFoundFault "SubscriptionNotFound" -// The subscription name does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventSubscriptions -func (c *RDS) DescribeEventSubscriptions(input *DescribeEventSubscriptionsInput) (*DescribeEventSubscriptionsOutput, error) { - req, out := c.DescribeEventSubscriptionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeEventSubscriptionsPages iterates over the pages of a DescribeEventSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEventSubscriptions 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 DescribeEventSubscriptions operation. -// pageNum := 0 -// err := client.DescribeEventSubscriptionsPages(params, -// func(page *DescribeEventSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeEventSubscriptionsPages(input *DescribeEventSubscriptionsInput, fn func(p *DescribeEventSubscriptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventSubscriptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventSubscriptionsOutput), lastPage) - }) -} - -const opDescribeEvents = "DescribeEvents" - -// DescribeEventsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventsRequest method. -// req, resp := client.DescribeEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEvents -func (c *RDS) DescribeEventsRequest(input *DescribeEventsInput) (req *request.Request, output *DescribeEventsOutput) { - op := &request.Operation{ - Name: opDescribeEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEventsInput{} - } - - output = &DescribeEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEvents API operation for Amazon Relational Database Service. -// -// Returns events related to DB instances, DB security groups, DB snapshots, -// and DB parameter groups for the past 14 days. Events specific to a particular -// DB instance, DB security group, database snapshot, or DB parameter group -// can be obtained by providing the name as a parameter. By default, the past -// hour of events 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 Relational Database Service's -// API operation DescribeEvents for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEvents -func (c *RDS) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error) { - req, out := c.DescribeEventsRequest(input) - err := req.Send() - return out, err -} - -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents 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 DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeEventsPages(input *DescribeEventsInput, fn func(p *DescribeEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventsOutput), lastPage) - }) -} - -const opDescribeOptionGroupOptions = "DescribeOptionGroupOptions" - -// DescribeOptionGroupOptionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOptionGroupOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeOptionGroupOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeOptionGroupOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeOptionGroupOptionsRequest method. -// req, resp := client.DescribeOptionGroupOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroupOptions -func (c *RDS) DescribeOptionGroupOptionsRequest(input *DescribeOptionGroupOptionsInput) (req *request.Request, output *DescribeOptionGroupOptionsOutput) { - op := &request.Operation{ - Name: opDescribeOptionGroupOptions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeOptionGroupOptionsInput{} - } - - output = &DescribeOptionGroupOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeOptionGroupOptions API operation for Amazon Relational Database Service. -// -// Describes all available options. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeOptionGroupOptions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroupOptions -func (c *RDS) DescribeOptionGroupOptions(input *DescribeOptionGroupOptionsInput) (*DescribeOptionGroupOptionsOutput, error) { - req, out := c.DescribeOptionGroupOptionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeOptionGroupOptionsPages iterates over the pages of a DescribeOptionGroupOptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOptionGroupOptions 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 DescribeOptionGroupOptions operation. -// pageNum := 0 -// err := client.DescribeOptionGroupOptionsPages(params, -// func(page *DescribeOptionGroupOptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeOptionGroupOptionsPages(input *DescribeOptionGroupOptionsInput, fn func(p *DescribeOptionGroupOptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeOptionGroupOptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeOptionGroupOptionsOutput), lastPage) - }) -} - -const opDescribeOptionGroups = "DescribeOptionGroups" - -// DescribeOptionGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOptionGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeOptionGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeOptionGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeOptionGroupsRequest method. -// req, resp := client.DescribeOptionGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroups -func (c *RDS) DescribeOptionGroupsRequest(input *DescribeOptionGroupsInput) (req *request.Request, output *DescribeOptionGroupsOutput) { - op := &request.Operation{ - Name: opDescribeOptionGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeOptionGroupsInput{} - } - - output = &DescribeOptionGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeOptionGroups API operation for Amazon Relational Database Service. -// -// Describes the available option groups. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeOptionGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroups -func (c *RDS) DescribeOptionGroups(input *DescribeOptionGroupsInput) (*DescribeOptionGroupsOutput, error) { - req, out := c.DescribeOptionGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeOptionGroupsPages iterates over the pages of a DescribeOptionGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOptionGroups 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 DescribeOptionGroups operation. -// pageNum := 0 -// err := client.DescribeOptionGroupsPages(params, -// func(page *DescribeOptionGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeOptionGroupsPages(input *DescribeOptionGroupsInput, fn func(p *DescribeOptionGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeOptionGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeOptionGroupsOutput), lastPage) - }) -} - -const opDescribeOrderableDBInstanceOptions = "DescribeOrderableDBInstanceOptions" - -// DescribeOrderableDBInstanceOptionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOrderableDBInstanceOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeOrderableDBInstanceOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeOrderableDBInstanceOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeOrderableDBInstanceOptionsRequest method. -// req, resp := client.DescribeOrderableDBInstanceOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOrderableDBInstanceOptions -func (c *RDS) DescribeOrderableDBInstanceOptionsRequest(input *DescribeOrderableDBInstanceOptionsInput) (req *request.Request, output *DescribeOrderableDBInstanceOptionsOutput) { - op := &request.Operation{ - Name: opDescribeOrderableDBInstanceOptions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeOrderableDBInstanceOptionsInput{} - } - - output = &DescribeOrderableDBInstanceOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeOrderableDBInstanceOptions API operation for Amazon Relational Database Service. -// -// Returns a list of orderable DB instance options for the specified engine. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeOrderableDBInstanceOptions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOrderableDBInstanceOptions -func (c *RDS) DescribeOrderableDBInstanceOptions(input *DescribeOrderableDBInstanceOptionsInput) (*DescribeOrderableDBInstanceOptionsOutput, error) { - req, out := c.DescribeOrderableDBInstanceOptionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeOrderableDBInstanceOptionsPages iterates over the pages of a DescribeOrderableDBInstanceOptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOrderableDBInstanceOptions 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 DescribeOrderableDBInstanceOptions operation. -// pageNum := 0 -// err := client.DescribeOrderableDBInstanceOptionsPages(params, -// func(page *DescribeOrderableDBInstanceOptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeOrderableDBInstanceOptionsPages(input *DescribeOrderableDBInstanceOptionsInput, fn func(p *DescribeOrderableDBInstanceOptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeOrderableDBInstanceOptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeOrderableDBInstanceOptionsOutput), lastPage) - }) -} - -const opDescribePendingMaintenanceActions = "DescribePendingMaintenanceActions" - -// DescribePendingMaintenanceActionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePendingMaintenanceActions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePendingMaintenanceActions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePendingMaintenanceActions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePendingMaintenanceActionsRequest method. -// req, resp := client.DescribePendingMaintenanceActionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribePendingMaintenanceActions -func (c *RDS) DescribePendingMaintenanceActionsRequest(input *DescribePendingMaintenanceActionsInput) (req *request.Request, output *DescribePendingMaintenanceActionsOutput) { - op := &request.Operation{ - Name: opDescribePendingMaintenanceActions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePendingMaintenanceActionsInput{} - } - - output = &DescribePendingMaintenanceActionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePendingMaintenanceActions API operation for Amazon Relational Database Service. -// -// Returns a list of resources (for example, DB instances) that have at least -// one pending maintenance action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribePendingMaintenanceActions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The specified resource ID was not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribePendingMaintenanceActions -func (c *RDS) DescribePendingMaintenanceActions(input *DescribePendingMaintenanceActionsInput) (*DescribePendingMaintenanceActionsOutput, error) { - req, out := c.DescribePendingMaintenanceActionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeReservedDBInstances = "DescribeReservedDBInstances" - -// DescribeReservedDBInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedDBInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedDBInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedDBInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedDBInstancesRequest method. -// req, resp := client.DescribeReservedDBInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeReservedDBInstances -func (c *RDS) DescribeReservedDBInstancesRequest(input *DescribeReservedDBInstancesInput) (req *request.Request, output *DescribeReservedDBInstancesOutput) { - op := &request.Operation{ - Name: opDescribeReservedDBInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedDBInstancesInput{} - } - - output = &DescribeReservedDBInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedDBInstances API operation for Amazon Relational Database Service. -// -// Returns information about reserved DB instances for this account, or about -// a specified reserved DB 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 Relational Database Service's -// API operation DescribeReservedDBInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedDBInstanceNotFoundFault "ReservedDBInstanceNotFound" -// The specified reserved DB Instance not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeReservedDBInstances -func (c *RDS) DescribeReservedDBInstances(input *DescribeReservedDBInstancesInput) (*DescribeReservedDBInstancesOutput, error) { - req, out := c.DescribeReservedDBInstancesRequest(input) - err := req.Send() - return out, err -} - -// DescribeReservedDBInstancesPages iterates over the pages of a DescribeReservedDBInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedDBInstances 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 DescribeReservedDBInstances operation. -// pageNum := 0 -// err := client.DescribeReservedDBInstancesPages(params, -// func(page *DescribeReservedDBInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeReservedDBInstancesPages(input *DescribeReservedDBInstancesInput, fn func(p *DescribeReservedDBInstancesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedDBInstancesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedDBInstancesOutput), lastPage) - }) -} - -const opDescribeReservedDBInstancesOfferings = "DescribeReservedDBInstancesOfferings" - -// DescribeReservedDBInstancesOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedDBInstancesOfferings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedDBInstancesOfferings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedDBInstancesOfferings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedDBInstancesOfferingsRequest method. -// req, resp := client.DescribeReservedDBInstancesOfferingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeReservedDBInstancesOfferings -func (c *RDS) DescribeReservedDBInstancesOfferingsRequest(input *DescribeReservedDBInstancesOfferingsInput) (req *request.Request, output *DescribeReservedDBInstancesOfferingsOutput) { - op := &request.Operation{ - Name: opDescribeReservedDBInstancesOfferings, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedDBInstancesOfferingsInput{} - } - - output = &DescribeReservedDBInstancesOfferingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedDBInstancesOfferings API operation for Amazon Relational Database Service. -// -// Lists available reserved DB instance offerings. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeReservedDBInstancesOfferings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedDBInstancesOfferingNotFoundFault "ReservedDBInstancesOfferingNotFound" -// Specified offering does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeReservedDBInstancesOfferings -func (c *RDS) DescribeReservedDBInstancesOfferings(input *DescribeReservedDBInstancesOfferingsInput) (*DescribeReservedDBInstancesOfferingsOutput, error) { - req, out := c.DescribeReservedDBInstancesOfferingsRequest(input) - err := req.Send() - return out, err -} - -// DescribeReservedDBInstancesOfferingsPages iterates over the pages of a DescribeReservedDBInstancesOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedDBInstancesOfferings 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 DescribeReservedDBInstancesOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedDBInstancesOfferingsPages(params, -// func(page *DescribeReservedDBInstancesOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DescribeReservedDBInstancesOfferingsPages(input *DescribeReservedDBInstancesOfferingsInput, fn func(p *DescribeReservedDBInstancesOfferingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedDBInstancesOfferingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedDBInstancesOfferingsOutput), lastPage) - }) -} - -const opDescribeSourceRegions = "DescribeSourceRegions" - -// DescribeSourceRegionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSourceRegions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSourceRegions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSourceRegions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSourceRegionsRequest method. -// req, resp := client.DescribeSourceRegionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeSourceRegions -func (c *RDS) DescribeSourceRegionsRequest(input *DescribeSourceRegionsInput) (req *request.Request, output *DescribeSourceRegionsOutput) { - op := &request.Operation{ - Name: opDescribeSourceRegions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSourceRegionsInput{} - } - - output = &DescribeSourceRegionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSourceRegions API operation for Amazon Relational Database Service. -// -// Returns a list of the source AWS regions where the current AWS region can -// create a Read Replica or copy a DB snapshot from. This API action supports -// pagination. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DescribeSourceRegions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeSourceRegions -func (c *RDS) DescribeSourceRegions(input *DescribeSourceRegionsInput) (*DescribeSourceRegionsOutput, error) { - req, out := c.DescribeSourceRegionsRequest(input) - err := req.Send() - return out, err -} - -const opDownloadDBLogFilePortion = "DownloadDBLogFilePortion" - -// DownloadDBLogFilePortionRequest generates a "aws/request.Request" representing the -// client's request for the DownloadDBLogFilePortion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DownloadDBLogFilePortion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DownloadDBLogFilePortion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DownloadDBLogFilePortionRequest method. -// req, resp := client.DownloadDBLogFilePortionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DownloadDBLogFilePortion -func (c *RDS) DownloadDBLogFilePortionRequest(input *DownloadDBLogFilePortionInput) (req *request.Request, output *DownloadDBLogFilePortionOutput) { - op := &request.Operation{ - Name: opDownloadDBLogFilePortion, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "NumberOfLines", - TruncationToken: "AdditionalDataPending", - }, - } - - if input == nil { - input = &DownloadDBLogFilePortionInput{} - } - - output = &DownloadDBLogFilePortionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DownloadDBLogFilePortion API operation for Amazon Relational Database Service. -// -// Downloads all or a portion of the specified log file, up to 1 MB in size. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation DownloadDBLogFilePortion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeDBLogFileNotFoundFault "DBLogFileNotFoundFault" -// LogFileName does not refer to an existing DB log file. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DownloadDBLogFilePortion -func (c *RDS) DownloadDBLogFilePortion(input *DownloadDBLogFilePortionInput) (*DownloadDBLogFilePortionOutput, error) { - req, out := c.DownloadDBLogFilePortionRequest(input) - err := req.Send() - return out, err -} - -// DownloadDBLogFilePortionPages iterates over the pages of a DownloadDBLogFilePortion operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DownloadDBLogFilePortion 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 DownloadDBLogFilePortion operation. -// pageNum := 0 -// err := client.DownloadDBLogFilePortionPages(params, -// func(page *DownloadDBLogFilePortionOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *RDS) DownloadDBLogFilePortionPages(input *DownloadDBLogFilePortionInput, fn func(p *DownloadDBLogFilePortionOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DownloadDBLogFilePortionRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DownloadDBLogFilePortionOutput), lastPage) - }) -} - -const opFailoverDBCluster = "FailoverDBCluster" - -// FailoverDBClusterRequest generates a "aws/request.Request" representing the -// client's request for the FailoverDBCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See FailoverDBCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the FailoverDBCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the FailoverDBClusterRequest method. -// req, resp := client.FailoverDBClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/FailoverDBCluster -func (c *RDS) FailoverDBClusterRequest(input *FailoverDBClusterInput) (req *request.Request, output *FailoverDBClusterOutput) { - op := &request.Operation{ - Name: opFailoverDBCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &FailoverDBClusterInput{} - } - - output = &FailoverDBClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// FailoverDBCluster API operation for Amazon Relational Database Service. -// -// Forces a failover for a DB cluster. -// -// A failover for a DB cluster promotes one of the Aurora Replicas (read-only -// instances) in the DB cluster to be the primary instance (the cluster writer). -// -// Amazon Aurora will automatically fail over to an Aurora Replica, if one exists, -// when the primary instance fails. You can force a failover when you want to -// simulate a failure of a primary instance for testing. Because each instance -// in a DB cluster has its own endpoint address, you will need to clean up and -// re-establish any existing connections that use those endpoint addresses when -// the failover is complete. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation FailoverDBCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/FailoverDBCluster -func (c *RDS) FailoverDBCluster(input *FailoverDBClusterInput) (*FailoverDBClusterOutput, error) { - req, out := c.FailoverDBClusterRequest(input) - err := req.Send() - return out, err -} - -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/rds-2014-10-31/ListTagsForResource -func (c *RDS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Relational Database Service. -// -// Lists all tags on an Amazon RDS resource. -// -// For an overview on tagging an Amazon RDS resource, see Tagging Amazon RDS -// Resources (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Tagging.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 Relational Database Service's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ListTagsForResource -func (c *RDS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opModifyDBCluster = "ModifyDBCluster" - -// ModifyDBClusterRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDBCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDBCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDBCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDBClusterRequest method. -// req, resp := client.ModifyDBClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBCluster -func (c *RDS) ModifyDBClusterRequest(input *ModifyDBClusterInput) (req *request.Request, output *ModifyDBClusterOutput) { - op := &request.Operation{ - Name: opModifyDBCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDBClusterInput{} - } - - output = &ModifyDBClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDBCluster API operation for Amazon Relational Database Service. -// -// Modify a setting for an Amazon Aurora DB cluster. You can change one or more -// database configuration parameters by specifying these parameters and the -// new values in the request. For more information on Amazon Aurora, see Aurora -// on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation ModifyDBCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeInvalidDBSubnetGroupStateFault "InvalidDBSubnetGroupStateFault" -// The DB subnet group cannot be deleted because it is in use. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeDBClusterParameterGroupNotFoundFault "DBClusterParameterGroupNotFound" -// DBClusterParameterGroupName does not refer to an existing DB Cluster parameter -// group. -// -// * ErrCodeInvalidDBSecurityGroupStateFault "InvalidDBSecurityGroupState" -// The state of the DB security group does not allow deletion. -// -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// User already has a DB cluster with the given identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBCluster -func (c *RDS) ModifyDBCluster(input *ModifyDBClusterInput) (*ModifyDBClusterOutput, error) { - req, out := c.ModifyDBClusterRequest(input) - err := req.Send() - return out, err -} - -const opModifyDBClusterParameterGroup = "ModifyDBClusterParameterGroup" - -// ModifyDBClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDBClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDBClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDBClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDBClusterParameterGroupRequest method. -// req, resp := client.ModifyDBClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterParameterGroup -func (c *RDS) ModifyDBClusterParameterGroupRequest(input *ModifyDBClusterParameterGroupInput) (req *request.Request, output *DBClusterParameterGroupNameMessage) { - op := &request.Operation{ - Name: opModifyDBClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDBClusterParameterGroupInput{} - } - - output = &DBClusterParameterGroupNameMessage{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDBClusterParameterGroup API operation for Amazon Relational Database Service. -// -// Modifies the parameters of a DB cluster parameter group. To modify more than -// one parameter, submit a list of the following: ParameterName, ParameterValue, -// and ApplyMethod. A maximum of 20 parameters can be modified in a single request. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS User Guide. -// -// Changes to dynamic parameters are applied immediately. Changes to static -// parameters require a reboot without failover to the DB cluster associated -// with the parameter group before the change can take effect. -// -// After you create a DB cluster parameter group, you should wait at least 5 -// minutes before creating your first DB cluster that uses that DB cluster parameter -// group as the default parameter group. This allows Amazon RDS to fully complete -// the create action before the parameter group is used as the default for a -// new DB cluster. This is especially important for parameters that are critical -// when creating the default database for a DB cluster, such as the character -// set for the default database defined by the character_set_database parameter. -// You can use the Parameter Groups option of the Amazon RDS console (https://console.aws.amazon.com/rds/) -// or the DescribeDBClusterParameters command to verify that your DB cluster -// parameter group has been created or modified. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation ModifyDBClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group cannot be deleted because it is in use. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterParameterGroup -func (c *RDS) ModifyDBClusterParameterGroup(input *ModifyDBClusterParameterGroupInput) (*DBClusterParameterGroupNameMessage, error) { - req, out := c.ModifyDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyDBClusterSnapshotAttribute = "ModifyDBClusterSnapshotAttribute" - -// ModifyDBClusterSnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDBClusterSnapshotAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDBClusterSnapshotAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDBClusterSnapshotAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDBClusterSnapshotAttributeRequest method. -// req, resp := client.ModifyDBClusterSnapshotAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterSnapshotAttribute -func (c *RDS) ModifyDBClusterSnapshotAttributeRequest(input *ModifyDBClusterSnapshotAttributeInput) (req *request.Request, output *ModifyDBClusterSnapshotAttributeOutput) { - op := &request.Operation{ - Name: opModifyDBClusterSnapshotAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDBClusterSnapshotAttributeInput{} - } - - output = &ModifyDBClusterSnapshotAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDBClusterSnapshotAttribute API operation for Amazon Relational Database Service. -// -// Adds an attribute and values to, or removes an attribute and values from, -// a manual DB cluster snapshot. -// -// To share a manual DB cluster snapshot with other AWS accounts, specify restore -// as the AttributeName and use the ValuesToAdd parameter to add a list of IDs -// of the AWS accounts that are authorized to restore the manual DB cluster -// snapshot. Use the value all to make the manual DB cluster snapshot public, -// which means that it can be copied or restored by all AWS accounts. Do not -// add the all value for any manual DB cluster snapshots that contain private -// information that you don't want available to all AWS accounts. -// -// To view which AWS accounts have access to copy or restore a manual DB cluster -// snapshot, or whether a manual DB cluster snapshot public or private, use -// the DescribeDBClusterSnapshotAttributes API action. -// -// If a manual DB cluster snapshot is encrypted, it cannot be shared. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation ModifyDBClusterSnapshotAttribute for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot. -// -// * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The supplied value is not a valid DB cluster snapshot state. -// -// * ErrCodeSharedSnapshotQuotaExceededFault "SharedSnapshotQuotaExceeded" -// You have exceeded the maximum number of accounts that you can share a manual -// DB snapshot with. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterSnapshotAttribute -func (c *RDS) ModifyDBClusterSnapshotAttribute(input *ModifyDBClusterSnapshotAttributeInput) (*ModifyDBClusterSnapshotAttributeOutput, error) { - req, out := c.ModifyDBClusterSnapshotAttributeRequest(input) - err := req.Send() - return out, err -} - -const opModifyDBInstance = "ModifyDBInstance" - -// ModifyDBInstanceRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDBInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDBInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDBInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDBInstanceRequest method. -// req, resp := client.ModifyDBInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBInstance -func (c *RDS) ModifyDBInstanceRequest(input *ModifyDBInstanceInput) (req *request.Request, output *ModifyDBInstanceOutput) { - op := &request.Operation{ - Name: opModifyDBInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDBInstanceInput{} - } - - output = &ModifyDBInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDBInstance API operation for Amazon Relational Database Service. -// -// Modifies settings for a DB instance. You can change one or more database -// configuration parameters by specifying these parameters and the new values -// 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 Relational Database Service's -// API operation ModifyDBInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodeInvalidDBSecurityGroupStateFault "InvalidDBSecurityGroupState" -// The state of the DB security group does not allow deletion. -// -// * ErrCodeDBInstanceAlreadyExistsFault "DBInstanceAlreadyExists" -// User already has a DB instance with the given identifier. -// -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// * ErrCodeInsufficientDBInstanceCapacityFault "InsufficientDBInstanceCapacity" -// Specified DB instance class is not available in the specified Availability -// Zone. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeProvisionedIopsNotAvailableInAZFault "ProvisionedIopsNotAvailableInAZFault" -// Provisioned IOPS not available in the specified Availability Zone. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeDBUpgradeDependencyFailureFault "DBUpgradeDependencyFailure" -// The DB upgrade failed because a resource the DB depends on could not be modified. -// -// * ErrCodeStorageTypeNotSupportedFault "StorageTypeNotSupported" -// StorageType specified cannot be associated with the DB Instance. -// -// * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// Specified CIDRIP or EC2 security group is not authorized for the specified -// DB security group. -// -// RDS may not also be authorized via IAM to perform necessary actions on your -// behalf. -// -// * ErrCodeCertificateNotFoundFault "CertificateNotFound" -// CertificateIdentifier does not refer to an existing certificate. -// -// * ErrCodeDomainNotFoundFault "DomainNotFoundFault" -// Domain does not refer to an existing Active Directory Domain. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBInstance -func (c *RDS) ModifyDBInstance(input *ModifyDBInstanceInput) (*ModifyDBInstanceOutput, error) { - req, out := c.ModifyDBInstanceRequest(input) - err := req.Send() - return out, err -} - -const opModifyDBParameterGroup = "ModifyDBParameterGroup" - -// ModifyDBParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDBParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDBParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDBParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDBParameterGroupRequest method. -// req, resp := client.ModifyDBParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBParameterGroup -func (c *RDS) ModifyDBParameterGroupRequest(input *ModifyDBParameterGroupInput) (req *request.Request, output *DBParameterGroupNameMessage) { - op := &request.Operation{ - Name: opModifyDBParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDBParameterGroupInput{} - } - - output = &DBParameterGroupNameMessage{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDBParameterGroup API operation for Amazon Relational Database Service. -// -// Modifies the parameters of a DB parameter group. To modify more than one -// parameter, submit a list of the following: ParameterName, ParameterValue, -// and ApplyMethod. A maximum of 20 parameters can be modified in a single request. -// -// Changes to dynamic parameters are applied immediately. Changes to static -// parameters require a reboot without failover to the DB instance associated -// with the parameter group before the change can take effect. -// -// After you modify a DB parameter group, you should wait at least 5 minutes -// before creating your first DB instance that uses that DB parameter group -// as the default parameter group. This allows Amazon RDS to fully complete -// the modify action before the parameter group is used as the default for a -// new DB instance. This is especially important for parameters that are critical -// when creating the default database for a DB instance, such as the character -// set for the default database defined by the character_set_database parameter. -// You can use the Parameter Groups option of the Amazon RDS console (https://console.aws.amazon.com/rds/) -// or the DescribeDBParameters command to verify that your DB parameter group -// has been created or modified. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation ModifyDBParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group cannot be deleted because it is in use. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBParameterGroup -func (c *RDS) ModifyDBParameterGroup(input *ModifyDBParameterGroupInput) (*DBParameterGroupNameMessage, error) { - req, out := c.ModifyDBParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyDBSnapshot = "ModifyDBSnapshot" - -// ModifyDBSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDBSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDBSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDBSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDBSnapshotRequest method. -// req, resp := client.ModifyDBSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshot -func (c *RDS) ModifyDBSnapshotRequest(input *ModifyDBSnapshotInput) (req *request.Request, output *ModifyDBSnapshotOutput) { - op := &request.Operation{ - Name: opModifyDBSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDBSnapshotInput{} - } - - output = &ModifyDBSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDBSnapshot API operation for Amazon Relational Database Service. -// -// Updates a manual DB snapshot, which can be encrypted or not encrypted, with -// a new engine version. You can update the engine version to either a new major -// or minor engine version. -// -// Amazon RDS supports upgrading a MySQL DB snapshot from MySQL 5.1 to MySQL -// 5.5. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation ModifyDBSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshot -func (c *RDS) ModifyDBSnapshot(input *ModifyDBSnapshotInput) (*ModifyDBSnapshotOutput, error) { - req, out := c.ModifyDBSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opModifyDBSnapshotAttribute = "ModifyDBSnapshotAttribute" - -// ModifyDBSnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDBSnapshotAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDBSnapshotAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDBSnapshotAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDBSnapshotAttributeRequest method. -// req, resp := client.ModifyDBSnapshotAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshotAttribute -func (c *RDS) ModifyDBSnapshotAttributeRequest(input *ModifyDBSnapshotAttributeInput) (req *request.Request, output *ModifyDBSnapshotAttributeOutput) { - op := &request.Operation{ - Name: opModifyDBSnapshotAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDBSnapshotAttributeInput{} - } - - output = &ModifyDBSnapshotAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDBSnapshotAttribute API operation for Amazon Relational Database Service. -// -// Adds an attribute and values to, or removes an attribute and values from, -// a manual DB snapshot. -// -// To share a manual DB snapshot with other AWS accounts, specify restore as -// the AttributeName and use the ValuesToAdd parameter to add a list of IDs -// of the AWS accounts that are authorized to restore the manual DB snapshot. -// Uses the value all to make the manual DB snapshot public, which means it -// can be copied or restored by all AWS accounts. Do not add the all value for -// any manual DB snapshots that contain private information that you don't want -// available to all AWS accounts. -// -// To view which AWS accounts have access to copy or restore a manual DB snapshot, -// or whether a manual DB snapshot public or private, use the DescribeDBSnapshotAttributes -// API action. -// -// If the manual DB snapshot is encrypted, it cannot be shared. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation ModifyDBSnapshotAttribute for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// * ErrCodeInvalidDBSnapshotStateFault "InvalidDBSnapshotState" -// The state of the DB snapshot does not allow deletion. -// -// * ErrCodeSharedSnapshotQuotaExceededFault "SharedSnapshotQuotaExceeded" -// You have exceeded the maximum number of accounts that you can share a manual -// DB snapshot with. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshotAttribute -func (c *RDS) ModifyDBSnapshotAttribute(input *ModifyDBSnapshotAttributeInput) (*ModifyDBSnapshotAttributeOutput, error) { - req, out := c.ModifyDBSnapshotAttributeRequest(input) - err := req.Send() - return out, err -} - -const opModifyDBSubnetGroup = "ModifyDBSubnetGroup" - -// ModifyDBSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDBSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDBSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDBSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDBSubnetGroupRequest method. -// req, resp := client.ModifyDBSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSubnetGroup -func (c *RDS) ModifyDBSubnetGroupRequest(input *ModifyDBSubnetGroupInput) (req *request.Request, output *ModifyDBSubnetGroupOutput) { - op := &request.Operation{ - Name: opModifyDBSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDBSubnetGroupInput{} - } - - output = &ModifyDBSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDBSubnetGroup API operation for Amazon Relational Database Service. -// -// Modifies an existing DB subnet group. DB subnet groups must contain at least -// one subnet in at least two AZs in the 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 Relational Database Service's -// API operation ModifyDBSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeDBSubnetQuotaExceededFault "DBSubnetQuotaExceededFault" -// Request would result in user exceeding the allowed number of subnets in a -// DB subnet groups. -// -// * ErrCodeSubnetAlreadyInUse "SubnetAlreadyInUse" -// The DB subnet is already in use in the Availability Zone. -// -// * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones -// unless there is only one Availability Zone. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSubnetGroup -func (c *RDS) ModifyDBSubnetGroup(input *ModifyDBSubnetGroupInput) (*ModifyDBSubnetGroupOutput, error) { - req, out := c.ModifyDBSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyEventSubscription = "ModifyEventSubscription" - -// ModifyEventSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the ModifyEventSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyEventSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyEventSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyEventSubscriptionRequest method. -// req, resp := client.ModifyEventSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyEventSubscription -func (c *RDS) ModifyEventSubscriptionRequest(input *ModifyEventSubscriptionInput) (req *request.Request, output *ModifyEventSubscriptionOutput) { - op := &request.Operation{ - Name: opModifyEventSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyEventSubscriptionInput{} - } - - output = &ModifyEventSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyEventSubscription API operation for Amazon Relational Database Service. -// -// Modifies an existing RDS event notification subscription. Note that you cannot -// modify the source identifiers using this call; to change source identifiers -// for a subscription, use the AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription -// calls. -// -// You can see a list of the event categories for a given SourceType in the -// Events (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) -// topic in the Amazon RDS User Guide or by using the DescribeEventCategories -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation ModifyEventSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEventSubscriptionQuotaExceededFault "EventSubscriptionQuotaExceeded" -// You have reached the maximum number of event subscriptions. -// -// * ErrCodeSubscriptionNotFoundFault "SubscriptionNotFound" -// The subscription name does not exist. -// -// * ErrCodeSNSInvalidTopicFault "SNSInvalidTopic" -// SNS has responded that there is a problem with the SND topic specified. -// -// * ErrCodeSNSNoAuthorizationFault "SNSNoAuthorization" -// You do not have permission to publish to the SNS topic ARN. -// -// * ErrCodeSNSTopicArnNotFoundFault "SNSTopicArnNotFound" -// The SNS topic ARN does not exist. -// -// * ErrCodeSubscriptionCategoryNotFoundFault "SubscriptionCategoryNotFound" -// The supplied category does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyEventSubscription -func (c *RDS) ModifyEventSubscription(input *ModifyEventSubscriptionInput) (*ModifyEventSubscriptionOutput, error) { - req, out := c.ModifyEventSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opModifyOptionGroup = "ModifyOptionGroup" - -// ModifyOptionGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyOptionGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyOptionGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyOptionGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyOptionGroupRequest method. -// req, resp := client.ModifyOptionGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyOptionGroup -func (c *RDS) ModifyOptionGroupRequest(input *ModifyOptionGroupInput) (req *request.Request, output *ModifyOptionGroupOutput) { - op := &request.Operation{ - Name: opModifyOptionGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyOptionGroupInput{} - } - - output = &ModifyOptionGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyOptionGroup API operation for Amazon Relational Database Service. -// -// Modifies an existing option group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation ModifyOptionGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidOptionGroupStateFault "InvalidOptionGroupStateFault" -// The option group is not in the available state. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyOptionGroup -func (c *RDS) ModifyOptionGroup(input *ModifyOptionGroupInput) (*ModifyOptionGroupOutput, error) { - req, out := c.ModifyOptionGroupRequest(input) - err := req.Send() - return out, err -} - -const opPromoteReadReplica = "PromoteReadReplica" - -// PromoteReadReplicaRequest generates a "aws/request.Request" representing the -// client's request for the PromoteReadReplica operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PromoteReadReplica for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PromoteReadReplica method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PromoteReadReplicaRequest method. -// req, resp := client.PromoteReadReplicaRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplica -func (c *RDS) PromoteReadReplicaRequest(input *PromoteReadReplicaInput) (req *request.Request, output *PromoteReadReplicaOutput) { - op := &request.Operation{ - Name: opPromoteReadReplica, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PromoteReadReplicaInput{} - } - - output = &PromoteReadReplicaOutput{} - req = c.newRequest(op, input, output) - return -} - -// PromoteReadReplica API operation for Amazon Relational Database Service. -// -// Promotes a Read Replica DB instance to a standalone DB instance. -// -// We recommend that you enable automated backups on your Read Replica before -// promoting the Read Replica. This ensures that no backup is taken during the -// promotion process. Once the instance is promoted to a primary instance, backups -// are taken based on your backup 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 Relational Database Service's -// API operation PromoteReadReplica for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplica -func (c *RDS) PromoteReadReplica(input *PromoteReadReplicaInput) (*PromoteReadReplicaOutput, error) { - req, out := c.PromoteReadReplicaRequest(input) - err := req.Send() - return out, err -} - -const opPromoteReadReplicaDBCluster = "PromoteReadReplicaDBCluster" - -// PromoteReadReplicaDBClusterRequest generates a "aws/request.Request" representing the -// client's request for the PromoteReadReplicaDBCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PromoteReadReplicaDBCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PromoteReadReplicaDBCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PromoteReadReplicaDBClusterRequest method. -// req, resp := client.PromoteReadReplicaDBClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplicaDBCluster -func (c *RDS) PromoteReadReplicaDBClusterRequest(input *PromoteReadReplicaDBClusterInput) (req *request.Request, output *PromoteReadReplicaDBClusterOutput) { - op := &request.Operation{ - Name: opPromoteReadReplicaDBCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PromoteReadReplicaDBClusterInput{} - } - - output = &PromoteReadReplicaDBClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// PromoteReadReplicaDBCluster API operation for Amazon Relational Database Service. -// -// Promotes a Read Replica DB cluster to a standalone DB cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation PromoteReadReplicaDBCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplicaDBCluster -func (c *RDS) PromoteReadReplicaDBCluster(input *PromoteReadReplicaDBClusterInput) (*PromoteReadReplicaDBClusterOutput, error) { - req, out := c.PromoteReadReplicaDBClusterRequest(input) - err := req.Send() - return out, err -} - -const opPurchaseReservedDBInstancesOffering = "PurchaseReservedDBInstancesOffering" - -// PurchaseReservedDBInstancesOfferingRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseReservedDBInstancesOffering operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PurchaseReservedDBInstancesOffering for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PurchaseReservedDBInstancesOffering method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PurchaseReservedDBInstancesOfferingRequest method. -// req, resp := client.PurchaseReservedDBInstancesOfferingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PurchaseReservedDBInstancesOffering -func (c *RDS) PurchaseReservedDBInstancesOfferingRequest(input *PurchaseReservedDBInstancesOfferingInput) (req *request.Request, output *PurchaseReservedDBInstancesOfferingOutput) { - op := &request.Operation{ - Name: opPurchaseReservedDBInstancesOffering, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseReservedDBInstancesOfferingInput{} - } - - output = &PurchaseReservedDBInstancesOfferingOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseReservedDBInstancesOffering API operation for Amazon Relational Database Service. -// -// Purchases a reserved DB instance offering. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation PurchaseReservedDBInstancesOffering for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedDBInstancesOfferingNotFoundFault "ReservedDBInstancesOfferingNotFound" -// Specified offering does not exist. -// -// * ErrCodeReservedDBInstanceAlreadyExistsFault "ReservedDBInstanceAlreadyExists" -// User already has a reservation with the given identifier. -// -// * ErrCodeReservedDBInstanceQuotaExceededFault "ReservedDBInstanceQuotaExceeded" -// Request would exceed the user's DB Instance quota. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PurchaseReservedDBInstancesOffering -func (c *RDS) PurchaseReservedDBInstancesOffering(input *PurchaseReservedDBInstancesOfferingInput) (*PurchaseReservedDBInstancesOfferingOutput, error) { - req, out := c.PurchaseReservedDBInstancesOfferingRequest(input) - err := req.Send() - return out, err -} - -const opRebootDBInstance = "RebootDBInstance" - -// RebootDBInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RebootDBInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RebootDBInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RebootDBInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RebootDBInstanceRequest method. -// req, resp := client.RebootDBInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RebootDBInstance -func (c *RDS) RebootDBInstanceRequest(input *RebootDBInstanceInput) (req *request.Request, output *RebootDBInstanceOutput) { - op := &request.Operation{ - Name: opRebootDBInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RebootDBInstanceInput{} - } - - output = &RebootDBInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// RebootDBInstance API operation for Amazon Relational Database Service. -// -// Rebooting a DB instance restarts the database engine service. A reboot also -// applies to the DB instance any modifications to the associated DB parameter -// group that were pending. Rebooting a DB instance results in a momentary outage -// of the instance, during which the DB instance status is set to rebooting. -// If the RDS instance is configured for MultiAZ, it is possible that the reboot -// will be conducted through a failover. An Amazon RDS event is created when -// the reboot is completed. -// -// If your DB instance is deployed in multiple Availability Zones, you can force -// a failover from one AZ to the other during the reboot. You might force a -// failover to test the availability of your DB instance deployment or to restore -// operations to the original AZ after a failover occurs. -// -// The time required to reboot is a function of the specific database engine's -// crash recovery process. To improve the reboot time, we recommend that you -// reduce database activities as much as possible during the reboot process -// to reduce rollback activity for in-transit transactions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation RebootDBInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RebootDBInstance -func (c *RDS) RebootDBInstance(input *RebootDBInstanceInput) (*RebootDBInstanceOutput, error) { - req, out := c.RebootDBInstanceRequest(input) - err := req.Send() - return out, err -} - -const opRemoveRoleFromDBCluster = "RemoveRoleFromDBCluster" - -// RemoveRoleFromDBClusterRequest generates a "aws/request.Request" representing the -// client's request for the RemoveRoleFromDBCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveRoleFromDBCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveRoleFromDBCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveRoleFromDBClusterRequest method. -// req, resp := client.RemoveRoleFromDBClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveRoleFromDBCluster -func (c *RDS) RemoveRoleFromDBClusterRequest(input *RemoveRoleFromDBClusterInput) (req *request.Request, output *RemoveRoleFromDBClusterOutput) { - op := &request.Operation{ - Name: opRemoveRoleFromDBCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveRoleFromDBClusterInput{} - } - - output = &RemoveRoleFromDBClusterOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveRoleFromDBCluster API operation for Amazon Relational Database Service. -// -// Disassociates an Identity and Access Management (IAM) role from an Aurora -// DB cluster. For more information, see Authorizing Amazon Aurora to Access -// Other AWS Services On Your Behalf (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Authorizing.AWSServices.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 Relational Database Service's -// API operation RemoveRoleFromDBCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeDBClusterRoleNotFoundFault "DBClusterRoleNotFound" -// The specified IAM role Amazon Resource Name (ARN) is not associated with -// the specified DB cluster. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveRoleFromDBCluster -func (c *RDS) RemoveRoleFromDBCluster(input *RemoveRoleFromDBClusterInput) (*RemoveRoleFromDBClusterOutput, error) { - req, out := c.RemoveRoleFromDBClusterRequest(input) - err := req.Send() - return out, err -} - -const opRemoveSourceIdentifierFromSubscription = "RemoveSourceIdentifierFromSubscription" - -// RemoveSourceIdentifierFromSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the RemoveSourceIdentifierFromSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveSourceIdentifierFromSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveSourceIdentifierFromSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveSourceIdentifierFromSubscriptionRequest method. -// req, resp := client.RemoveSourceIdentifierFromSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveSourceIdentifierFromSubscription -func (c *RDS) RemoveSourceIdentifierFromSubscriptionRequest(input *RemoveSourceIdentifierFromSubscriptionInput) (req *request.Request, output *RemoveSourceIdentifierFromSubscriptionOutput) { - op := &request.Operation{ - Name: opRemoveSourceIdentifierFromSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveSourceIdentifierFromSubscriptionInput{} - } - - output = &RemoveSourceIdentifierFromSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveSourceIdentifierFromSubscription API operation for Amazon Relational Database Service. -// -// Removes a source identifier from an existing RDS event notification subscription. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation RemoveSourceIdentifierFromSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionNotFoundFault "SubscriptionNotFound" -// The subscription name does not exist. -// -// * ErrCodeSourceNotFoundFault "SourceNotFound" -// The requested source could not be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveSourceIdentifierFromSubscription -func (c *RDS) RemoveSourceIdentifierFromSubscription(input *RemoveSourceIdentifierFromSubscriptionInput) (*RemoveSourceIdentifierFromSubscriptionOutput, error) { - req, out := c.RemoveSourceIdentifierFromSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTagsFromResource = "RemoveTagsFromResource" - -// RemoveTagsFromResourceRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromResourceRequest method. -// req, resp := client.RemoveTagsFromResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveTagsFromResource -func (c *RDS) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) (req *request.Request, output *RemoveTagsFromResourceOutput) { - op := &request.Operation{ - Name: opRemoveTagsFromResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsFromResourceInput{} - } - - output = &RemoveTagsFromResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveTagsFromResource API operation for Amazon Relational Database Service. -// -// Removes metadata tags from an Amazon RDS resource. -// -// For an overview on tagging an Amazon RDS resource, see Tagging Amazon RDS -// Resources (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Tagging.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 Relational Database Service's -// API operation RemoveTagsFromResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveTagsFromResource -func (c *RDS) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { - req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err -} - -const opResetDBClusterParameterGroup = "ResetDBClusterParameterGroup" - -// ResetDBClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the ResetDBClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetDBClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetDBClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetDBClusterParameterGroupRequest method. -// req, resp := client.ResetDBClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResetDBClusterParameterGroup -func (c *RDS) ResetDBClusterParameterGroupRequest(input *ResetDBClusterParameterGroupInput) (req *request.Request, output *DBClusterParameterGroupNameMessage) { - op := &request.Operation{ - Name: opResetDBClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetDBClusterParameterGroupInput{} - } - - output = &DBClusterParameterGroupNameMessage{} - req = c.newRequest(op, input, output) - return -} - -// ResetDBClusterParameterGroup API operation for Amazon Relational Database Service. -// -// Modifies the parameters of a DB cluster parameter group to the default value. -// To reset specific parameters submit a list of the following: ParameterName -// and ApplyMethod. To reset the entire DB cluster parameter group, specify -// the DBClusterParameterGroupName and ResetAllParameters parameters. -// -// When resetting the entire group, dynamic parameters are updated immediately -// and static parameters are set to pending-reboot to take effect on the next -// DB instance restart or RebootDBInstance request. You must call RebootDBInstance -// for every DB instance in your DB cluster that you want the updated static -// parameter to apply to. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation ResetDBClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group cannot be deleted because it is in use. -// -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResetDBClusterParameterGroup -func (c *RDS) ResetDBClusterParameterGroup(input *ResetDBClusterParameterGroupInput) (*DBClusterParameterGroupNameMessage, error) { - req, out := c.ResetDBClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opResetDBParameterGroup = "ResetDBParameterGroup" - -// ResetDBParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the ResetDBParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetDBParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetDBParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetDBParameterGroupRequest method. -// req, resp := client.ResetDBParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResetDBParameterGroup -func (c *RDS) ResetDBParameterGroupRequest(input *ResetDBParameterGroupInput) (req *request.Request, output *DBParameterGroupNameMessage) { - op := &request.Operation{ - Name: opResetDBParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetDBParameterGroupInput{} - } - - output = &DBParameterGroupNameMessage{} - req = c.newRequest(op, input, output) - return -} - -// ResetDBParameterGroup API operation for Amazon Relational Database Service. -// -// Modifies the parameters of a DB parameter group to the engine/system default -// value. To reset specific parameters submit a list of the following: ParameterName -// and ApplyMethod. To reset the entire DB parameter group, specify the DBParameterGroup -// name and ResetAllParameters parameters. When resetting the entire group, -// dynamic parameters are updated immediately and static parameters are set -// to pending-reboot to take effect on the next DB instance restart or RebootDBInstance -// 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 Relational Database Service's -// API operation ResetDBParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group cannot be deleted because it is in use. -// -// * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName does not refer to an existing DB parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResetDBParameterGroup -func (c *RDS) ResetDBParameterGroup(input *ResetDBParameterGroupInput) (*DBParameterGroupNameMessage, error) { - req, out := c.ResetDBParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opRestoreDBClusterFromS3 = "RestoreDBClusterFromS3" - -// RestoreDBClusterFromS3Request generates a "aws/request.Request" representing the -// client's request for the RestoreDBClusterFromS3 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreDBClusterFromS3 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreDBClusterFromS3 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreDBClusterFromS3Request method. -// req, resp := client.RestoreDBClusterFromS3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromS3 -func (c *RDS) RestoreDBClusterFromS3Request(input *RestoreDBClusterFromS3Input) (req *request.Request, output *RestoreDBClusterFromS3Output) { - op := &request.Operation{ - Name: opRestoreDBClusterFromS3, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreDBClusterFromS3Input{} - } - - output = &RestoreDBClusterFromS3Output{} - req = c.newRequest(op, input, output) - return -} - -// RestoreDBClusterFromS3 API operation for Amazon Relational Database Service. -// -// Creates an Amazon Aurora DB cluster from data stored in an Amazon S3 bucket. -// Amazon RDS must be authorized to access the Amazon S3 bucket and the data -// must be created using the Percona XtraBackup utility as described in Migrating -// Data from MySQL by Using an Amazon S3 Bucket (AmazonRDS/latest/UserGuide/Aurora.Migrate.MySQL.html#Aurora.Migrate.MySQL.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 Relational Database Service's -// API operation RestoreDBClusterFromS3 for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// User already has a DB cluster with the given identifier. -// -// * ErrCodeDBClusterQuotaExceededFault "DBClusterQuotaExceededFault" -// User attempted to create a new DB cluster and the user has already reached -// the maximum allowed DB cluster quota. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster is not in a valid state. -// -// * ErrCodeInvalidDBSubnetGroupStateFault "InvalidDBSubnetGroupStateFault" -// The DB subnet group cannot be deleted because it is in use. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeInvalidS3BucketFault "InvalidS3BucketFault" -// The specified Amazon S3 bucket name could not be found or Amazon RDS is not -// authorized to access the specified Amazon S3 bucket. Verify the SourceS3BucketName -// and S3IngestionRoleArn values and try again. -// -// * ErrCodeDBClusterParameterGroupNotFoundFault "DBClusterParameterGroupNotFound" -// DBClusterParameterGroupName does not refer to an existing DB Cluster parameter -// group. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeInsufficientStorageClusterCapacityFault "InsufficientStorageClusterCapacity" -// There is insufficient storage available for the current action. You may be -// able to resolve this error by updating your subnet group to use different -// Availability Zones that have more storage available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromS3 -func (c *RDS) RestoreDBClusterFromS3(input *RestoreDBClusterFromS3Input) (*RestoreDBClusterFromS3Output, error) { - req, out := c.RestoreDBClusterFromS3Request(input) - err := req.Send() - return out, err -} - -const opRestoreDBClusterFromSnapshot = "RestoreDBClusterFromSnapshot" - -// RestoreDBClusterFromSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the RestoreDBClusterFromSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreDBClusterFromSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreDBClusterFromSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreDBClusterFromSnapshotRequest method. -// req, resp := client.RestoreDBClusterFromSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromSnapshot -func (c *RDS) RestoreDBClusterFromSnapshotRequest(input *RestoreDBClusterFromSnapshotInput) (req *request.Request, output *RestoreDBClusterFromSnapshotOutput) { - op := &request.Operation{ - Name: opRestoreDBClusterFromSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreDBClusterFromSnapshotInput{} - } - - output = &RestoreDBClusterFromSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreDBClusterFromSnapshot API operation for Amazon Relational Database Service. -// -// Creates a new DB cluster from a DB cluster snapshot. The target DB cluster -// is created from the source DB cluster restore point with the same configuration -// as the original source DB cluster, except that the new DB cluster is created -// with the default security group. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation RestoreDBClusterFromSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// User already has a DB cluster with the given identifier. -// -// * ErrCodeDBClusterQuotaExceededFault "DBClusterQuotaExceededFault" -// User attempted to create a new DB cluster and the user has already reached -// the maximum allowed DB cluster quota. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot. -// -// * ErrCodeInsufficientDBClusterCapacityFault "InsufficientDBClusterCapacityFault" -// The DB cluster does not have enough capacity for the current operation. -// -// * ErrCodeInsufficientStorageClusterCapacityFault "InsufficientStorageClusterCapacity" -// There is insufficient storage available for the current action. You may be -// able to resolve this error by updating your subnet group to use different -// Availability Zones that have more storage available. -// -// * ErrCodeInvalidDBSnapshotStateFault "InvalidDBSnapshotState" -// The state of the DB snapshot does not allow deletion. -// -// * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The supplied value is not a valid DB cluster snapshot state. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeInvalidRestoreFault "InvalidRestoreFault" -// Cannot restore from vpc backup to non-vpc DB instance. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromSnapshot -func (c *RDS) RestoreDBClusterFromSnapshot(input *RestoreDBClusterFromSnapshotInput) (*RestoreDBClusterFromSnapshotOutput, error) { - req, out := c.RestoreDBClusterFromSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opRestoreDBClusterToPointInTime = "RestoreDBClusterToPointInTime" - -// RestoreDBClusterToPointInTimeRequest generates a "aws/request.Request" representing the -// client's request for the RestoreDBClusterToPointInTime operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreDBClusterToPointInTime for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreDBClusterToPointInTime method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreDBClusterToPointInTimeRequest method. -// req, resp := client.RestoreDBClusterToPointInTimeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterToPointInTime -func (c *RDS) RestoreDBClusterToPointInTimeRequest(input *RestoreDBClusterToPointInTimeInput) (req *request.Request, output *RestoreDBClusterToPointInTimeOutput) { - op := &request.Operation{ - Name: opRestoreDBClusterToPointInTime, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreDBClusterToPointInTimeInput{} - } - - output = &RestoreDBClusterToPointInTimeOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreDBClusterToPointInTime API operation for Amazon Relational Database Service. -// -// Restores a DB cluster to an arbitrary point in time. Users can restore to -// any point in time before LatestRestorableTime for up to BackupRetentionPeriod -// days. The target DB cluster is created from the source DB cluster with the -// same configuration as the original DB cluster, except that the new DB cluster -// is created with the default DB security group. -// -// For more information on Amazon Aurora, see Aurora on Amazon RDS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) -// in the Amazon RDS 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 Relational Database Service's -// API operation RestoreDBClusterToPointInTime for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// User already has a DB cluster with the given identifier. -// -// * ErrCodeDBClusterQuotaExceededFault "DBClusterQuotaExceededFault" -// User attempted to create a new DB cluster and the user has already reached -// the maximum allowed DB cluster quota. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier does not refer to an existing DB cluster. -// -// * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot. -// -// * ErrCodeInsufficientDBClusterCapacityFault "InsufficientDBClusterCapacityFault" -// The DB cluster does not have enough capacity for the current operation. -// -// * ErrCodeInsufficientStorageClusterCapacityFault "InsufficientStorageClusterCapacity" -// There is insufficient storage available for the current action. You may be -// able to resolve this error by updating your subnet group to use different -// Availability Zones that have more storage available. -// -// * ErrCodeInvalidDBSnapshotStateFault "InvalidDBSnapshotState" -// The state of the DB snapshot does not allow deletion. -// -// * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The supplied value is not a valid DB cluster snapshot state. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeInvalidRestoreFault "InvalidRestoreFault" -// Cannot restore from vpc backup to non-vpc DB instance. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterToPointInTime -func (c *RDS) RestoreDBClusterToPointInTime(input *RestoreDBClusterToPointInTimeInput) (*RestoreDBClusterToPointInTimeOutput, error) { - req, out := c.RestoreDBClusterToPointInTimeRequest(input) - err := req.Send() - return out, err -} - -const opRestoreDBInstanceFromDBSnapshot = "RestoreDBInstanceFromDBSnapshot" - -// RestoreDBInstanceFromDBSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the RestoreDBInstanceFromDBSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreDBInstanceFromDBSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreDBInstanceFromDBSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreDBInstanceFromDBSnapshotRequest method. -// req, resp := client.RestoreDBInstanceFromDBSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceFromDBSnapshot -func (c *RDS) RestoreDBInstanceFromDBSnapshotRequest(input *RestoreDBInstanceFromDBSnapshotInput) (req *request.Request, output *RestoreDBInstanceFromDBSnapshotOutput) { - op := &request.Operation{ - Name: opRestoreDBInstanceFromDBSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreDBInstanceFromDBSnapshotInput{} - } - - output = &RestoreDBInstanceFromDBSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreDBInstanceFromDBSnapshot API operation for Amazon Relational Database Service. -// -// Creates a new DB instance from a DB snapshot. The target database is created -// from the source database restore point with the most of original configuration -// with the default security group and the default DB parameter group. By default, -// the new DB instance is created as a single-AZ deployment except when the -// instance is a SQL Server instance that has an option group that is associated -// with mirroring; in this case, the instance becomes a mirrored AZ deployment -// and not a single-AZ deployment. -// -// If your intent is to replace your original DB instance with the new, restored -// DB instance, then rename your original DB instance before you call the RestoreDBInstanceFromDBSnapshot -// action. RDS does not allow two DB instances with the same name. Once you -// have renamed your original DB instance with a different identifier, then -// you can pass the original name of the DB instance as the DBInstanceIdentifier -// in the call to the RestoreDBInstanceFromDBSnapshot action. The result is -// that you will replace the original DB instance with the DB instance created -// from the snapshot. -// -// If you are restoring from a shared manual DB snapshot, the DBSnapshotIdentifier -// must be the ARN of the shared DB 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 Relational Database Service's -// API operation RestoreDBInstanceFromDBSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceAlreadyExistsFault "DBInstanceAlreadyExists" -// User already has a DB instance with the given identifier. -// -// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier does not refer to an existing DB snapshot. -// -// * ErrCodeInstanceQuotaExceededFault "InstanceQuotaExceeded" -// Request would result in user exceeding the allowed number of DB instances. -// -// * ErrCodeInsufficientDBInstanceCapacityFault "InsufficientDBInstanceCapacity" -// Specified DB instance class is not available in the specified Availability -// Zone. -// -// * ErrCodeInvalidDBSnapshotStateFault "InvalidDBSnapshotState" -// The state of the DB snapshot does not allow deletion. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeInvalidRestoreFault "InvalidRestoreFault" -// Cannot restore from vpc backup to non-vpc DB instance. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones -// unless there is only one Availability Zone. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeProvisionedIopsNotAvailableInAZFault "ProvisionedIopsNotAvailableInAZFault" -// Provisioned IOPS not available in the specified Availability Zone. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeStorageTypeNotSupportedFault "StorageTypeNotSupported" -// StorageType specified cannot be associated with the DB Instance. -// -// * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// Specified CIDRIP or EC2 security group is not authorized for the specified -// DB security group. -// -// RDS may not also be authorized via IAM to perform necessary actions on your -// behalf. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// * ErrCodeDomainNotFoundFault "DomainNotFoundFault" -// Domain does not refer to an existing Active Directory Domain. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceFromDBSnapshot -func (c *RDS) RestoreDBInstanceFromDBSnapshot(input *RestoreDBInstanceFromDBSnapshotInput) (*RestoreDBInstanceFromDBSnapshotOutput, error) { - req, out := c.RestoreDBInstanceFromDBSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opRestoreDBInstanceToPointInTime = "RestoreDBInstanceToPointInTime" - -// RestoreDBInstanceToPointInTimeRequest generates a "aws/request.Request" representing the -// client's request for the RestoreDBInstanceToPointInTime operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreDBInstanceToPointInTime for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreDBInstanceToPointInTime method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreDBInstanceToPointInTimeRequest method. -// req, resp := client.RestoreDBInstanceToPointInTimeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceToPointInTime -func (c *RDS) RestoreDBInstanceToPointInTimeRequest(input *RestoreDBInstanceToPointInTimeInput) (req *request.Request, output *RestoreDBInstanceToPointInTimeOutput) { - op := &request.Operation{ - Name: opRestoreDBInstanceToPointInTime, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreDBInstanceToPointInTimeInput{} - } - - output = &RestoreDBInstanceToPointInTimeOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreDBInstanceToPointInTime API operation for Amazon Relational Database Service. -// -// Restores a DB instance to an arbitrary point in time. You can restore to -// any point in time before the time identified by the LatestRestorableTime -// property. You can restore to a point up to the number of days specified by -// the BackupRetentionPeriod property. -// -// The target database is created with most of the original configuration, but -// in a system-selected availability zone, with the default security group, -// the default subnet group, and the default DB parameter group. By default, -// the new DB instance is created as a single-AZ deployment except when the -// instance is a SQL Server instance that has an option group that is associated -// with mirroring; in this case, the instance becomes a mirrored deployment -// and not a single-AZ deployment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation RestoreDBInstanceToPointInTime for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBInstanceAlreadyExistsFault "DBInstanceAlreadyExists" -// User already has a DB instance with the given identifier. -// -// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier does not refer to an existing DB instance. -// -// * ErrCodeInstanceQuotaExceededFault "InstanceQuotaExceeded" -// Request would result in user exceeding the allowed number of DB instances. -// -// * ErrCodeInsufficientDBInstanceCapacityFault "InsufficientDBInstanceCapacity" -// Specified DB instance class is not available in the specified Availability -// Zone. -// -// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance is not in the available state. -// -// * ErrCodePointInTimeRestoreNotEnabledFault "PointInTimeRestoreNotEnabled" -// SourceDBInstanceIdentifier refers to a DB instance with BackupRetentionPeriod -// equal to 0. -// -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" -// Request would result in user exceeding the allowed amount of storage available -// across all DB instances. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// DB subnet group does not cover all Availability Zones after it is created -// because users' change. -// -// * ErrCodeInvalidRestoreFault "InvalidRestoreFault" -// Cannot restore from vpc backup to non-vpc DB instance. -// -// * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName does not refer to an existing DB subnet group. -// -// * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones -// unless there is only one Availability Zone. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is invalid, or multiple subnets were requested that -// are not all in a common VPC. -// -// * ErrCodeProvisionedIopsNotAvailableInAZFault "ProvisionedIopsNotAvailableInAZFault" -// Provisioned IOPS not available in the specified Availability Zone. -// -// * ErrCodeOptionGroupNotFoundFault "OptionGroupNotFoundFault" -// The specified option group could not be found. -// -// * ErrCodeStorageTypeNotSupportedFault "StorageTypeNotSupported" -// StorageType specified cannot be associated with the DB Instance. -// -// * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// Specified CIDRIP or EC2 security group is not authorized for the specified -// DB security group. -// -// RDS may not also be authorized via IAM to perform necessary actions on your -// behalf. -// -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" -// Error accessing KMS key. -// -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// * ErrCodeDomainNotFoundFault "DomainNotFoundFault" -// Domain does not refer to an existing Active Directory Domain. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceToPointInTime -func (c *RDS) RestoreDBInstanceToPointInTime(input *RestoreDBInstanceToPointInTimeInput) (*RestoreDBInstanceToPointInTimeOutput, error) { - req, out := c.RestoreDBInstanceToPointInTimeRequest(input) - err := req.Send() - return out, err -} - -const opRevokeDBSecurityGroupIngress = "RevokeDBSecurityGroupIngress" - -// RevokeDBSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeDBSecurityGroupIngress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RevokeDBSecurityGroupIngress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RevokeDBSecurityGroupIngress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RevokeDBSecurityGroupIngressRequest method. -// req, resp := client.RevokeDBSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RevokeDBSecurityGroupIngress -func (c *RDS) RevokeDBSecurityGroupIngressRequest(input *RevokeDBSecurityGroupIngressInput) (req *request.Request, output *RevokeDBSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opRevokeDBSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeDBSecurityGroupIngressInput{} - } - - output = &RevokeDBSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - return -} - -// RevokeDBSecurityGroupIngress API operation for Amazon Relational Database Service. -// -// Revokes ingress from a DBSecurityGroup for previously authorized IP ranges -// or EC2 or VPC Security Groups. Required parameters for this API are one of -// CIDRIP, EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either -// EC2SecurityGroupName or EC2SecurityGroupId). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Relational Database Service's -// API operation RevokeDBSecurityGroupIngress for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName does not refer to an existing DB security group. -// -// * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// Specified CIDRIP or EC2 security group is not authorized for the specified -// DB security group. -// -// RDS may not also be authorized via IAM to perform necessary actions on your -// behalf. -// -// * ErrCodeInvalidDBSecurityGroupStateFault "InvalidDBSecurityGroupState" -// The state of the DB security group does not allow deletion. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RevokeDBSecurityGroupIngress -func (c *RDS) RevokeDBSecurityGroupIngress(input *RevokeDBSecurityGroupIngressInput) (*RevokeDBSecurityGroupIngressOutput, error) { - req, out := c.RevokeDBSecurityGroupIngressRequest(input) - err := req.Send() - return out, err -} - -// Describes a quota for an AWS account, for example, the number of DB instances -// allowed. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AccountQuota -type AccountQuota struct { - _ struct{} `type:"structure"` - - // The name of the Amazon RDS quota for this AWS account. - AccountQuotaName *string `type:"string"` - - // The maximum allowed value for the quota. - Max *int64 `type:"long"` - - // The amount currently used toward the quota maximum. - Used *int64 `type:"long"` -} - -// String returns the string representation -func (s AccountQuota) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountQuota) GoString() string { - return s.String() -} - -// SetAccountQuotaName sets the AccountQuotaName field's value. -func (s *AccountQuota) SetAccountQuotaName(v string) *AccountQuota { - s.AccountQuotaName = &v - return s -} - -// SetMax sets the Max field's value. -func (s *AccountQuota) SetMax(v int64) *AccountQuota { - s.Max = &v - return s -} - -// SetUsed sets the Used field's value. -func (s *AccountQuota) SetUsed(v int64) *AccountQuota { - s.Used = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddRoleToDBClusterMessage -type AddRoleToDBClusterInput struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster to associate the IAM role with. - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role to associate with the Aurora - // DB cluster, for example arn:aws:iam::123456789012:role/AuroraAccessRole. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AddRoleToDBClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddRoleToDBClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddRoleToDBClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddRoleToDBClusterInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *AddRoleToDBClusterInput) SetDBClusterIdentifier(v string) *AddRoleToDBClusterInput { - s.DBClusterIdentifier = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *AddRoleToDBClusterInput) SetRoleArn(v string) *AddRoleToDBClusterInput { - s.RoleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddRoleToDBClusterOutput -type AddRoleToDBClusterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddRoleToDBClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddRoleToDBClusterOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddSourceIdentifierToSubscriptionMessage -type AddSourceIdentifierToSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The identifier of the event source to be added. An identifier must begin - // with a letter and must contain only ASCII letters, digits, and hyphens; it - // cannot end with a hyphen or contain two consecutive hyphens. - // - // Constraints: - // - // * If the source type is a DB instance, then a DBInstanceIdentifier must - // be supplied. - // - // * If the source type is a DB security group, a DBSecurityGroupName must - // be supplied. - // - // * If the source type is a DB parameter group, a DBParameterGroupName must - // be supplied. - // - // * If the source type is a DB snapshot, a DBSnapshotIdentifier must be - // supplied. - // - // SourceIdentifier is a required field - SourceIdentifier *string `type:"string" required:"true"` - - // The name of the RDS event notification subscription you want to add a source - // identifier to. - // - // SubscriptionName is a required field - SubscriptionName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AddSourceIdentifierToSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddSourceIdentifierToSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddSourceIdentifierToSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddSourceIdentifierToSubscriptionInput"} - if s.SourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceIdentifier")) - } - if s.SubscriptionName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *AddSourceIdentifierToSubscriptionInput) SetSourceIdentifier(v string) *AddSourceIdentifierToSubscriptionInput { - s.SourceIdentifier = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *AddSourceIdentifierToSubscriptionInput) SetSubscriptionName(v string) *AddSourceIdentifierToSubscriptionInput { - s.SubscriptionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddSourceIdentifierToSubscriptionResult -type AddSourceIdentifierToSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful invocation of the DescribeEventSubscriptions - // action. - EventSubscription *EventSubscription `type:"structure"` -} - -// String returns the string representation -func (s AddSourceIdentifierToSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddSourceIdentifierToSubscriptionOutput) GoString() string { - return s.String() -} - -// SetEventSubscription sets the EventSubscription field's value. -func (s *AddSourceIdentifierToSubscriptionOutput) SetEventSubscription(v *EventSubscription) *AddSourceIdentifierToSubscriptionOutput { - s.EventSubscription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddTagsToResourceMessage -type AddTagsToResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon RDS resource the tags will be added to. This value is an Amazon - // Resource Name (ARN). For information about creating an ARN, see Constructing - // an RDS Amazon Resource Name (ARN) (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing). - // - // ResourceName is a required field - ResourceName *string `type:"string" required:"true"` - - // The tags to be assigned to the Amazon RDS resource. - // - // Tags is a required field - Tags []*Tag `locationNameList:"Tag" type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsToResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToResourceInput"} - if s.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceName sets the ResourceName field's value. -func (s *AddTagsToResourceInput) SetResourceName(v string) *AddTagsToResourceInput { - s.ResourceName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToResourceInput) SetTags(v []*Tag) *AddTagsToResourceInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddTagsToResourceOutput -type AddTagsToResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsToResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ApplyPendingMaintenanceActionMessage -type ApplyPendingMaintenanceActionInput struct { - _ struct{} `type:"structure"` - - // The pending maintenance action to apply to this resource. - // - // Valid values: system-update, db-upgrade - // - // ApplyAction is a required field - ApplyAction *string `type:"string" required:"true"` - - // A value that specifies the type of opt-in request, or undoes an opt-in request. - // An opt-in request of type immediate cannot be undone. - // - // Valid values: - // - // * immediate - Apply the maintenance action immediately. - // - // * next-maintenance - Apply the maintenance action during the next maintenance - // window for the resource. - // - // * undo-opt-in - Cancel any existing next-maintenance opt-in requests. - // - // OptInType is a required field - OptInType *string `type:"string" required:"true"` - - // The RDS Amazon Resource Name (ARN) of the resource that the pending maintenance - // action applies to. For information about creating an ARN, see Constructing - // an RDS Amazon Resource Name (ARN) (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing). - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ApplyPendingMaintenanceActionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplyPendingMaintenanceActionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApplyPendingMaintenanceActionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplyPendingMaintenanceActionInput"} - if s.ApplyAction == nil { - invalidParams.Add(request.NewErrParamRequired("ApplyAction")) - } - if s.OptInType == nil { - invalidParams.Add(request.NewErrParamRequired("OptInType")) - } - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyAction sets the ApplyAction field's value. -func (s *ApplyPendingMaintenanceActionInput) SetApplyAction(v string) *ApplyPendingMaintenanceActionInput { - s.ApplyAction = &v - return s -} - -// SetOptInType sets the OptInType field's value. -func (s *ApplyPendingMaintenanceActionInput) SetOptInType(v string) *ApplyPendingMaintenanceActionInput { - s.OptInType = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *ApplyPendingMaintenanceActionInput) SetResourceIdentifier(v string) *ApplyPendingMaintenanceActionInput { - s.ResourceIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ApplyPendingMaintenanceActionResult -type ApplyPendingMaintenanceActionOutput struct { - _ struct{} `type:"structure"` - - // Describes the pending maintenance actions for a resource. - ResourcePendingMaintenanceActions *ResourcePendingMaintenanceActions `type:"structure"` -} - -// String returns the string representation -func (s ApplyPendingMaintenanceActionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ApplyPendingMaintenanceActionOutput) GoString() string { - return s.String() -} - -// SetResourcePendingMaintenanceActions sets the ResourcePendingMaintenanceActions field's value. -func (s *ApplyPendingMaintenanceActionOutput) SetResourcePendingMaintenanceActions(v *ResourcePendingMaintenanceActions) *ApplyPendingMaintenanceActionOutput { - s.ResourcePendingMaintenanceActions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AuthorizeDBSecurityGroupIngressMessage -type AuthorizeDBSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The IP range to authorize. - CIDRIP *string `type:"string"` - - // The name of the DB security group to add authorization to. - // - // DBSecurityGroupName is a required field - DBSecurityGroupName *string `type:"string" required:"true"` - - // Id of the EC2 security group to authorize. For VPC DB security groups, EC2SecurityGroupId - // must be provided. Otherwise, EC2SecurityGroupOwnerId and either EC2SecurityGroupName - // or EC2SecurityGroupId must be provided. - EC2SecurityGroupId *string `type:"string"` - - // Name of the EC2 security group to authorize. For VPC DB security groups, - // EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId and - // either EC2SecurityGroupName or EC2SecurityGroupId must be provided. - EC2SecurityGroupName *string `type:"string"` - - // AWS account number of the owner of the EC2 security group specified in the - // EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable - // value. For VPC DB security groups, EC2SecurityGroupId must be provided. Otherwise, - // EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId - // must be provided. - EC2SecurityGroupOwnerId *string `type:"string"` -} - -// String returns the string representation -func (s AuthorizeDBSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeDBSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuthorizeDBSecurityGroupIngressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthorizeDBSecurityGroupIngressInput"} - if s.DBSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBSecurityGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCIDRIP sets the CIDRIP field's value. -func (s *AuthorizeDBSecurityGroupIngressInput) SetCIDRIP(v string) *AuthorizeDBSecurityGroupIngressInput { - s.CIDRIP = &v - return s -} - -// SetDBSecurityGroupName sets the DBSecurityGroupName field's value. -func (s *AuthorizeDBSecurityGroupIngressInput) SetDBSecurityGroupName(v string) *AuthorizeDBSecurityGroupIngressInput { - s.DBSecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupId sets the EC2SecurityGroupId field's value. -func (s *AuthorizeDBSecurityGroupIngressInput) SetEC2SecurityGroupId(v string) *AuthorizeDBSecurityGroupIngressInput { - s.EC2SecurityGroupId = &v - return s -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *AuthorizeDBSecurityGroupIngressInput) SetEC2SecurityGroupName(v string) *AuthorizeDBSecurityGroupIngressInput { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *AuthorizeDBSecurityGroupIngressInput) SetEC2SecurityGroupOwnerId(v string) *AuthorizeDBSecurityGroupIngressInput { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AuthorizeDBSecurityGroupIngressResult -type AuthorizeDBSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * DescribeDBSecurityGroups - // - // * AuthorizeDBSecurityGroupIngress - // - // * CreateDBSecurityGroup - // - // * RevokeDBSecurityGroupIngress - // - // This data type is used as a response element in the DescribeDBSecurityGroups - // action. - DBSecurityGroup *DBSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s AuthorizeDBSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeDBSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// SetDBSecurityGroup sets the DBSecurityGroup field's value. -func (s *AuthorizeDBSecurityGroupIngressOutput) SetDBSecurityGroup(v *DBSecurityGroup) *AuthorizeDBSecurityGroupIngressOutput { - s.DBSecurityGroup = v - return s -} - -// Contains Availability Zone information. -// -// This data type is used as an element in the following data type: -// -// * OrderableDBInstanceOption -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AvailabilityZone -type AvailabilityZone struct { - _ struct{} `type:"structure"` - - // The name of the availability zone. - Name *string `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() -} - -// SetName sets the Name field's value. -func (s *AvailabilityZone) SetName(v string) *AvailabilityZone { - s.Name = &v - return s -} - -// A CA certificate for an AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Certificate -type Certificate struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the certificate. - CertificateArn *string `type:"string"` - - // The unique key that identifies a certificate. - CertificateIdentifier *string `type:"string"` - - // The type of the certificate. - CertificateType *string `type:"string"` - - // The thumbprint of the certificate. - Thumbprint *string `type:"string"` - - // The starting date from which the certificate is valid. - ValidFrom *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The final date that the certificate continues to be valid. - ValidTill *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s Certificate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Certificate) GoString() string { - return s.String() -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *Certificate) SetCertificateArn(v string) *Certificate { - s.CertificateArn = &v - return s -} - -// SetCertificateIdentifier sets the CertificateIdentifier field's value. -func (s *Certificate) SetCertificateIdentifier(v string) *Certificate { - s.CertificateIdentifier = &v - return s -} - -// SetCertificateType sets the CertificateType field's value. -func (s *Certificate) SetCertificateType(v string) *Certificate { - s.CertificateType = &v - return s -} - -// SetThumbprint sets the Thumbprint field's value. -func (s *Certificate) SetThumbprint(v string) *Certificate { - s.Thumbprint = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *Certificate) SetValidFrom(v time.Time) *Certificate { - s.ValidFrom = &v - return s -} - -// SetValidTill sets the ValidTill field's value. -func (s *Certificate) SetValidTill(v time.Time) *Certificate { - s.ValidTill = &v - return s -} - -// This data type is used as a response element in the action DescribeDBEngineVersions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CharacterSet -type CharacterSet struct { - _ struct{} `type:"structure"` - - // The description of the character set. - CharacterSetDescription *string `type:"string"` - - // The name of the character set. - CharacterSetName *string `type:"string"` -} - -// String returns the string representation -func (s CharacterSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CharacterSet) GoString() string { - return s.String() -} - -// SetCharacterSetDescription sets the CharacterSetDescription field's value. -func (s *CharacterSet) SetCharacterSetDescription(v string) *CharacterSet { - s.CharacterSetDescription = &v - return s -} - -// SetCharacterSetName sets the CharacterSetName field's value. -func (s *CharacterSet) SetCharacterSetName(v string) *CharacterSet { - s.CharacterSetName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterParameterGroupMessage -type CopyDBClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The identifier or Amazon Resource Name (ARN) for the source DB cluster parameter - // group. For information about creating an ARN, see Constructing an RDS Amazon - // Resource Name (ARN) (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing). - // - // Constraints: - // - // * Must specify a valid DB cluster parameter group. - // - // * If the source DB cluster parameter group is in the same region as the - // copy, specify a valid DB parameter group identifier, for example my-db-cluster-param-group, - // or a valid ARN. - // - // * If the source DB parameter group is in a different region than the copy, - // specify a valid DB cluster parameter group ARN, for example arn:aws:rds:us-east-1:123456789012:cluster-pg:custom-cluster-group1. - // - // SourceDBClusterParameterGroupIdentifier is a required field - SourceDBClusterParameterGroupIdentifier *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // A description for the copied DB cluster parameter group. - // - // TargetDBClusterParameterGroupDescription is a required field - TargetDBClusterParameterGroupDescription *string `type:"string" required:"true"` - - // The identifier for the copied DB cluster parameter group. - // - // Constraints: - // - // * Cannot be null, empty, or blank - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-cluster-param-group1 - // - // TargetDBClusterParameterGroupIdentifier is a required field - TargetDBClusterParameterGroupIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyDBClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyDBClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyDBClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyDBClusterParameterGroupInput"} - if s.SourceDBClusterParameterGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDBClusterParameterGroupIdentifier")) - } - if s.TargetDBClusterParameterGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("TargetDBClusterParameterGroupDescription")) - } - if s.TargetDBClusterParameterGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetDBClusterParameterGroupIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceDBClusterParameterGroupIdentifier sets the SourceDBClusterParameterGroupIdentifier field's value. -func (s *CopyDBClusterParameterGroupInput) SetSourceDBClusterParameterGroupIdentifier(v string) *CopyDBClusterParameterGroupInput { - s.SourceDBClusterParameterGroupIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CopyDBClusterParameterGroupInput) SetTags(v []*Tag) *CopyDBClusterParameterGroupInput { - s.Tags = v - return s -} - -// SetTargetDBClusterParameterGroupDescription sets the TargetDBClusterParameterGroupDescription field's value. -func (s *CopyDBClusterParameterGroupInput) SetTargetDBClusterParameterGroupDescription(v string) *CopyDBClusterParameterGroupInput { - s.TargetDBClusterParameterGroupDescription = &v - return s -} - -// SetTargetDBClusterParameterGroupIdentifier sets the TargetDBClusterParameterGroupIdentifier field's value. -func (s *CopyDBClusterParameterGroupInput) SetTargetDBClusterParameterGroupIdentifier(v string) *CopyDBClusterParameterGroupInput { - s.TargetDBClusterParameterGroupIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterParameterGroupResult -type CopyDBClusterParameterGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the CreateDBClusterParameterGroup - // or CopyDBClusterParameterGroup action. - // - // This data type is used as a request parameter in the DeleteDBClusterParameterGroup - // action, and as a response element in the DescribeDBClusterParameterGroups - // action. - DBClusterParameterGroup *DBClusterParameterGroup `type:"structure"` -} - -// String returns the string representation -func (s CopyDBClusterParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyDBClusterParameterGroupOutput) GoString() string { - return s.String() -} - -// SetDBClusterParameterGroup sets the DBClusterParameterGroup field's value. -func (s *CopyDBClusterParameterGroupOutput) SetDBClusterParameterGroup(v *DBClusterParameterGroup) *CopyDBClusterParameterGroupOutput { - s.DBClusterParameterGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterSnapshotMessage -type CopyDBClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - CopyTags *bool `type:"boolean"` - - // DestinationRegion is used for presigning the request to a given region. - DestinationRegion *string `type:"string"` - - // The AWS KMS key ID for an encrypted DB cluster snapshot. The KMS key ID is - // the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias - // for the KMS encryption key. - // - // If you copy an unencrypted DB cluster snapshot and specify a value for the - // KmsKeyId parameter, Amazon RDS encrypts the target DB cluster snapshot using - // the specified KMS encryption key. - // - // If you copy an encrypted DB cluster snapshot from your AWS account, you can - // specify a value for KmsKeyId to encrypt the copy with a new KMS encryption - // key. If you don't specify a value for KmsKeyId, then the copy of the DB cluster - // snapshot is encrypted with the same KMS key as the source DB cluster snapshot. - // - // If you copy an encrypted DB cluster snapshot that is shared from another - // AWS account, then you must specify a value for KmsKeyId. - // - // To copy an encrypted DB cluster snapshot to another region, you must set - // KmsKeyId to the KMS key ID you want to use to encrypt the copy of the DB - // cluster snapshot in the destination region. KMS encryption keys are specific - // to the region that they are created in, and you cannot use encryption keys - // from one region in another region. - KmsKeyId *string `type:"string"` - - // The URL that contains a Signature Version 4 signed request for the CopyDBClusterSnapshot - // API action in the AWS region that contains the source DB cluster snapshot - // to copy. The PreSignedUrl parameter must be used when copying an encrypted - // DB cluster snapshot from another AWS region. - // - // The pre-signed URL must be a valid request for the CopyDBSClusterSnapshot - // API action that can be executed in the source region that contains the encrypted - // DB cluster snapshot to be copied. The pre-signed URL request must contain - // the following parameter values: - // - // * KmsKeyId - The KMS key identifier for the key to use to encrypt the - // copy of the DB cluster snapshot in the destination region. This is the - // same identifier for both the CopyDBClusterSnapshot action that is called - // in the destination region, and the action contained in the pre-signed - // URL. - // - // * DestinationRegion - The name of the region that the DB cluster snapshot - // will be created in. - // - // * SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier - // for the encrypted DB cluster snapshot to be copied. This identifier must - // be in the Amazon Resource Name (ARN) format for the source region. For - // example, if you are copying an encrypted DB cluster snapshot from the - // us-west-2 region, then your SourceDBClusterSnapshotIdentifier looks like - // the following example: arn:aws:rds:us-west-2:123456789012:cluster-snapshot:aurora-cluster1-snapshot-20161115. - // - // To learn how to generate a Signature Version 4 signed request, see Authenticating - // Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) - // and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). - PreSignedUrl *string `type:"string"` - - // The identifier of the DB cluster snapshot to copy. This parameter is not - // case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: my-cluster-snapshot1 - // - // SourceDBClusterSnapshotIdentifier is a required field - SourceDBClusterSnapshotIdentifier *string `type:"string" required:"true"` - - // SourceRegion is the source region where the resource exists. This is not - // sent over the wire and is only used for presigning. This value should always - // have the same region as the source ARN. - SourceRegion *string `type:"string" ignore:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The identifier of the new DB cluster snapshot to create from the source DB - // cluster snapshot. This parameter is not case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: my-cluster-snapshot2 - // - // TargetDBClusterSnapshotIdentifier is a required field - TargetDBClusterSnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyDBClusterSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyDBClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyDBClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyDBClusterSnapshotInput"} - if s.SourceDBClusterSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDBClusterSnapshotIdentifier")) - } - if s.TargetDBClusterSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetDBClusterSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCopyTags sets the CopyTags field's value. -func (s *CopyDBClusterSnapshotInput) SetCopyTags(v bool) *CopyDBClusterSnapshotInput { - s.CopyTags = &v - return s -} - -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *CopyDBClusterSnapshotInput) SetDestinationRegion(v string) *CopyDBClusterSnapshotInput { - s.DestinationRegion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CopyDBClusterSnapshotInput) SetKmsKeyId(v string) *CopyDBClusterSnapshotInput { - s.KmsKeyId = &v - return s -} - -// SetPreSignedUrl sets the PreSignedUrl field's value. -func (s *CopyDBClusterSnapshotInput) SetPreSignedUrl(v string) *CopyDBClusterSnapshotInput { - s.PreSignedUrl = &v - return s -} - -// SetSourceDBClusterSnapshotIdentifier sets the SourceDBClusterSnapshotIdentifier field's value. -func (s *CopyDBClusterSnapshotInput) SetSourceDBClusterSnapshotIdentifier(v string) *CopyDBClusterSnapshotInput { - s.SourceDBClusterSnapshotIdentifier = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopyDBClusterSnapshotInput) SetSourceRegion(v string) *CopyDBClusterSnapshotInput { - s.SourceRegion = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CopyDBClusterSnapshotInput) SetTags(v []*Tag) *CopyDBClusterSnapshotInput { - s.Tags = v - return s -} - -// SetTargetDBClusterSnapshotIdentifier sets the TargetDBClusterSnapshotIdentifier field's value. -func (s *CopyDBClusterSnapshotInput) SetTargetDBClusterSnapshotIdentifier(v string) *CopyDBClusterSnapshotInput { - s.TargetDBClusterSnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBClusterSnapshotResult -type CopyDBClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBClusterSnapshot - // - // * DeleteDBClusterSnapshot - // - // This data type is used as a response element in the DescribeDBClusterSnapshots - // action. - DBClusterSnapshot *DBClusterSnapshot `type:"structure"` -} - -// String returns the string representation -func (s CopyDBClusterSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyDBClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBClusterSnapshot sets the DBClusterSnapshot field's value. -func (s *CopyDBClusterSnapshotOutput) SetDBClusterSnapshot(v *DBClusterSnapshot) *CopyDBClusterSnapshotOutput { - s.DBClusterSnapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBParameterGroupMessage -type CopyDBParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The identifier or ARN for the source DB parameter group. For information - // about creating an ARN, see Constructing an RDS Amazon Resource Name (ARN) - // (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing). - // - // Constraints: - // - // * Must specify a valid DB parameter group. - // - // * Must specify a valid DB parameter group identifier, for example my-db-param-group, - // or a valid ARN. - // - // SourceDBParameterGroupIdentifier is a required field - SourceDBParameterGroupIdentifier *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // A description for the copied DB parameter group. - // - // TargetDBParameterGroupDescription is a required field - TargetDBParameterGroupDescription *string `type:"string" required:"true"` - - // The identifier for the copied DB parameter group. - // - // Constraints: - // - // * Cannot be null, empty, or blank - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-db-parameter-group - // - // TargetDBParameterGroupIdentifier is a required field - TargetDBParameterGroupIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyDBParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyDBParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyDBParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyDBParameterGroupInput"} - if s.SourceDBParameterGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDBParameterGroupIdentifier")) - } - if s.TargetDBParameterGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("TargetDBParameterGroupDescription")) - } - if s.TargetDBParameterGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetDBParameterGroupIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceDBParameterGroupIdentifier sets the SourceDBParameterGroupIdentifier field's value. -func (s *CopyDBParameterGroupInput) SetSourceDBParameterGroupIdentifier(v string) *CopyDBParameterGroupInput { - s.SourceDBParameterGroupIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CopyDBParameterGroupInput) SetTags(v []*Tag) *CopyDBParameterGroupInput { - s.Tags = v - return s -} - -// SetTargetDBParameterGroupDescription sets the TargetDBParameterGroupDescription field's value. -func (s *CopyDBParameterGroupInput) SetTargetDBParameterGroupDescription(v string) *CopyDBParameterGroupInput { - s.TargetDBParameterGroupDescription = &v - return s -} - -// SetTargetDBParameterGroupIdentifier sets the TargetDBParameterGroupIdentifier field's value. -func (s *CopyDBParameterGroupInput) SetTargetDBParameterGroupIdentifier(v string) *CopyDBParameterGroupInput { - s.TargetDBParameterGroupIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBParameterGroupResult -type CopyDBParameterGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the CreateDBParameterGroup - // action. - // - // This data type is used as a request parameter in the DeleteDBParameterGroup - // action, and as a response element in the DescribeDBParameterGroups action. - DBParameterGroup *DBParameterGroup `type:"structure"` -} - -// String returns the string representation -func (s CopyDBParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyDBParameterGroupOutput) GoString() string { - return s.String() -} - -// SetDBParameterGroup sets the DBParameterGroup field's value. -func (s *CopyDBParameterGroupOutput) SetDBParameterGroup(v *DBParameterGroup) *CopyDBParameterGroupOutput { - s.DBParameterGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBSnapshotMessage -type CopyDBSnapshotInput struct { - _ struct{} `type:"structure"` - - // True to copy all tags from the source DB snapshot to the target DB snapshot; - // otherwise false. The default is false. - CopyTags *bool `type:"boolean"` - - // DestinationRegion is used for presigning the request to a given region. - DestinationRegion *string `type:"string"` - - // The AWS KMS key ID for an encrypted DB snapshot. The KMS key ID is the Amazon - // Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS - // encryption key. - // - // If you copy an unencrypted DB snapshot and specify a value for the KmsKeyId - // parameter, Amazon RDS encrypts the target DB snapshot using the specified - // KMS encryption key. - // - // If you copy an encrypted DB snapshot from your AWS account, you can specify - // a value for KmsKeyId to encrypt the copy with a new KMS encryption key. If - // you don't specify a value for KmsKeyId, then the copy of the DB snapshot - // is encrypted with the same KMS key as the source DB snapshot. - // - // If you copy an encrypted snapshot to a different AWS region, then you must - // specify a KMS key for the destination AWS region. - // - // If you copy an encrypted DB snapshot that is shared from another AWS account, - // then you must specify a value for KmsKeyId. - // - // To copy an encrypted DB snapshot to another region, you must set KmsKeyId - // to the KMS key ID used to encrypt the copy of the DB snapshot in the destination - // region. KMS encryption keys are specific to the region that they are created - // in, and you cannot use encryption keys from one region in another region. - KmsKeyId *string `type:"string"` - - // The URL that contains a Signature Version 4 signed request for the CopyDBSnapshot - // API action in the AWS region that contains the source DB snapshot to copy. - // The PreSignedUrl parameter must be used when copying an encrypted DB snapshot - // from another AWS region. - // - // The presigned URL must be a valid request for the CopyDBSnapshot API action - // that can be executed in the source region that contains the encrypted DB - // snapshot to be copied. The presigned URL request must contain the following - // parameter values: - // - // * DestinationRegion - The AWS Region that the encrypted DB snapshot will - // be copied to. This region is the same one where the CopyDBSnapshot action - // is called that contains this presigned URL. - // - // For example, if you copy an encrypted DB snapshot from the us-west-2 region - // to the us-east-1 region, then you will call the CopyDBSnapshot action - // in the us-east-1 region and provide a presigned URL that contains a call - // to the CopyDBSnapshot action in the us-west-2 region. For this example, - // the DestinationRegion in the presigned URL must be set to the us-east-1 - // region. - // - // * KmsKeyId - The KMS key identifier for the key to use to encrypt the - // copy of the DB snapshot in the destination region. This is the same identifier - // for both the CopyDBSnapshot action that is called in the destination region, - // and the action contained in the presigned URL. - // - // * SourceDBSnapshotIdentifier - The DB snapshot identifier for the encrypted - // snapshot to be copied. This identifier must be in the Amazon Resource - // Name (ARN) format for the source region. For example, if you are copying - // an encrypted DB snapshot from the us-west-2 region, then your SourceDBSnapshotIdentifier - // would look like Example: arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115. - // - // To learn how to generate a Signature Version 4 signed request, see Authenticating - // Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) - // and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). - PreSignedUrl *string `type:"string"` - - // The identifier for the source DB snapshot. - // - // If you are copying from a shared manual DB snapshot, this must be the ARN - // of the shared DB snapshot. - // - // You cannot copy an encrypted, shared DB snapshot from one AWS region to another. - // - // Constraints: - // - // * Must specify a valid system snapshot in the "available" state. - // - // * If the source snapshot is in the same region as the copy, specify a - // valid DB snapshot identifier. - // - // * If the source snapshot is in a different region than the copy, specify - // a valid DB snapshot ARN. For more information, go to Copying a DB Snapshot - // (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html). - // - // Example: rds:mydb-2012-04-02-00-01 - // - // Example: arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805 - // - // SourceDBSnapshotIdentifier is a required field - SourceDBSnapshotIdentifier *string `type:"string" required:"true"` - - // SourceRegion is the source region where the resource exists. This is not - // sent over the wire and is only used for presigning. This value should always - // have the same region as the source ARN. - SourceRegion *string `type:"string" ignore:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The identifier for the copied snapshot. - // - // Constraints: - // - // * Cannot be null, empty, or blank - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-db-snapshot - // - // TargetDBSnapshotIdentifier is a required field - TargetDBSnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyDBSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyDBSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyDBSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyDBSnapshotInput"} - if s.SourceDBSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDBSnapshotIdentifier")) - } - if s.TargetDBSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetDBSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCopyTags sets the CopyTags field's value. -func (s *CopyDBSnapshotInput) SetCopyTags(v bool) *CopyDBSnapshotInput { - s.CopyTags = &v - return s -} - -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *CopyDBSnapshotInput) SetDestinationRegion(v string) *CopyDBSnapshotInput { - s.DestinationRegion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CopyDBSnapshotInput) SetKmsKeyId(v string) *CopyDBSnapshotInput { - s.KmsKeyId = &v - return s -} - -// SetPreSignedUrl sets the PreSignedUrl field's value. -func (s *CopyDBSnapshotInput) SetPreSignedUrl(v string) *CopyDBSnapshotInput { - s.PreSignedUrl = &v - return s -} - -// SetSourceDBSnapshotIdentifier sets the SourceDBSnapshotIdentifier field's value. -func (s *CopyDBSnapshotInput) SetSourceDBSnapshotIdentifier(v string) *CopyDBSnapshotInput { - s.SourceDBSnapshotIdentifier = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopyDBSnapshotInput) SetSourceRegion(v string) *CopyDBSnapshotInput { - s.SourceRegion = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CopyDBSnapshotInput) SetTags(v []*Tag) *CopyDBSnapshotInput { - s.Tags = v - return s -} - -// SetTargetDBSnapshotIdentifier sets the TargetDBSnapshotIdentifier field's value. -func (s *CopyDBSnapshotInput) SetTargetDBSnapshotIdentifier(v string) *CopyDBSnapshotInput { - s.TargetDBSnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyDBSnapshotResult -type CopyDBSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBSnapshot - // - // * DeleteDBSnapshot - // - // This data type is used as a response element in the DescribeDBSnapshots action. - DBSnapshot *DBSnapshot `type:"structure"` -} - -// String returns the string representation -func (s CopyDBSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyDBSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBSnapshot sets the DBSnapshot field's value. -func (s *CopyDBSnapshotOutput) SetDBSnapshot(v *DBSnapshot) *CopyDBSnapshotOutput { - s.DBSnapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyOptionGroupMessage -type CopyOptionGroupInput struct { - _ struct{} `type:"structure"` - - // The identifier or ARN for the source option group. For information about - // creating an ARN, see Constructing an RDS Amazon Resource Name (ARN) (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing). - // - // Constraints: - // - // * Must specify a valid option group. - // - // * If the source option group is in the same region as the copy, specify - // a valid option group identifier, for example my-option-group, or a valid - // ARN. - // - // * If the source option group is in a different region than the copy, specify - // a valid option group ARN, for example arn:aws:rds:us-west-2:123456789012:og:special-options. - // - // SourceOptionGroupIdentifier is a required field - SourceOptionGroupIdentifier *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The description for the copied option group. - // - // TargetOptionGroupDescription is a required field - TargetOptionGroupDescription *string `type:"string" required:"true"` - - // The identifier for the copied option group. - // - // Constraints: - // - // * Cannot be null, empty, or blank - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-option-group - // - // TargetOptionGroupIdentifier is a required field - TargetOptionGroupIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyOptionGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyOptionGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyOptionGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyOptionGroupInput"} - if s.SourceOptionGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceOptionGroupIdentifier")) - } - if s.TargetOptionGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("TargetOptionGroupDescription")) - } - if s.TargetOptionGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetOptionGroupIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceOptionGroupIdentifier sets the SourceOptionGroupIdentifier field's value. -func (s *CopyOptionGroupInput) SetSourceOptionGroupIdentifier(v string) *CopyOptionGroupInput { - s.SourceOptionGroupIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CopyOptionGroupInput) SetTags(v []*Tag) *CopyOptionGroupInput { - s.Tags = v - return s -} - -// SetTargetOptionGroupDescription sets the TargetOptionGroupDescription field's value. -func (s *CopyOptionGroupInput) SetTargetOptionGroupDescription(v string) *CopyOptionGroupInput { - s.TargetOptionGroupDescription = &v - return s -} - -// SetTargetOptionGroupIdentifier sets the TargetOptionGroupIdentifier field's value. -func (s *CopyOptionGroupInput) SetTargetOptionGroupIdentifier(v string) *CopyOptionGroupInput { - s.TargetOptionGroupIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CopyOptionGroupResult -type CopyOptionGroupOutput struct { - _ struct{} `type:"structure"` - - OptionGroup *OptionGroup `type:"structure"` -} - -// String returns the string representation -func (s CopyOptionGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyOptionGroupOutput) GoString() string { - return s.String() -} - -// SetOptionGroup sets the OptionGroup field's value. -func (s *CopyOptionGroupOutput) SetOptionGroup(v *OptionGroup) *CopyOptionGroupOutput { - s.OptionGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterMessage -type CreateDBClusterInput struct { - _ struct{} `type:"structure"` - - // A list of EC2 Availability Zones that instances in the DB cluster can be - // created in. For information on regions and Availability Zones, see Regions - // and Availability Zones (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html). - AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - - // The number of days for which automated backups are retained. You must specify - // a minimum value of 1. - // - // Default: 1 - // - // Constraints: - // - // * Must be a value from 1 to 35 - BackupRetentionPeriod *int64 `type:"integer"` - - // A value that indicates that the DB cluster should be associated with the - // specified CharacterSet. - CharacterSetName *string `type:"string"` - - // The DB cluster identifier. This parameter is stored as a lowercase string. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: my-cluster1 - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The name of the DB cluster parameter group to associate with this DB cluster. - // If this argument is omitted, default.aurora5.6 will be used. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBClusterParameterGroupName *string `type:"string"` - - // A DB subnet group to associate with this DB cluster. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - DBSubnetGroupName *string `type:"string"` - - // The name for your database of up to 8 alpha-numeric characters. If you do - // not provide a name, Amazon RDS will not create a database in the DB cluster - // you are creating. - DatabaseName *string `type:"string"` - - // DestinationRegion is used for presigning the request to a given region. - DestinationRegion *string `type:"string"` - - // The name of the database engine to be used for this DB cluster. - // - // Valid Values: aurora - // - // Engine is a required field - Engine *string `type:"string" required:"true"` - - // The version number of the database engine to use. - // - // Aurora - // - // Example: 5.6.10a - EngineVersion *string `type:"string"` - - // The KMS key identifier for an encrypted DB cluster. - // - // The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption - // key. If you are creating a DB cluster with the same AWS account that owns - // the KMS encryption key used to encrypt the new DB cluster, then you can use - // the KMS key alias instead of the ARN for the KMS encryption key. - // - // If the StorageEncrypted parameter is true, and you do not specify a value - // for the KmsKeyId parameter, then Amazon RDS will use your default encryption - // key. AWS KMS creates the default encryption key for your AWS account. Your - // AWS account has a different default encryption key for each AWS region. - // - // If you create a Read Replica of an encrypted DB cluster in another region, - // you must set KmsKeyId to a KMS key ID that is valid in the destination region. - // This key is used to encrypt the Read Replica in that region. - KmsKeyId *string `type:"string"` - - // The password for the master database user. This password can contain any - // printable ASCII character except "/", """, or "@". - // - // Constraints: Must contain from 8 to 41 characters. - MasterUserPassword *string `type:"string"` - - // The name of the master user for the DB cluster. - // - // Constraints: - // - // * Must be 1 to 16 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot be a reserved word for the chosen database engine. - MasterUsername *string `type:"string"` - - // A value that indicates that the DB cluster should be associated with the - // specified option group. - // - // Permanent options cannot be removed from an option group. The option group - // cannot be removed from a DB cluster once it is associated with a DB cluster. - OptionGroupName *string `type:"string"` - - // The port number on which the instances in the DB cluster accept connections. - // - // Default: 3306 - Port *int64 `type:"integer"` - - // A URL that contains a Signature Version 4 signed request for the CreateDBCluster - // action to be called in the source region where the DB cluster will be replicated - // from. You only need to specify PreSignedUrl when you are performing cross-region - // replication from an encrypted DB cluster. - // - // The pre-signed URL must be a valid request for the CreateDBCluster API action - // that can be executed in the source region that contains the encrypted DB - // cluster to be copied. - // - // The pre-signed URL request must contain the following parameter values: - // - // * KmsKeyId - The KMS key identifier for the key to use to encrypt the - // copy of the DB cluster in the destination region. This should refer to - // the same KMS key for both the CreateDBCluster action that is called in - // the destination region, and the action contained in the pre-signed URL. - // - // * DestinationRegion - The name of the region that Aurora Read Replica - // will be created in. - // - // * ReplicationSourceIdentifier - The DB cluster identifier for the encrypted - // DB cluster to be copied. This identifier must be in the Amazon Resource - // Name (ARN) format for the source region. For example, if you are copying - // an encrypted DB cluster from the us-west-2 region, then your ReplicationSourceIdentifier - // would look like Example: arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1. - // - // To learn how to generate a Signature Version 4 signed request, see Authenticating - // Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) - // and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). - PreSignedUrl *string `type:"string"` - - // The daily time range during which automated backups are created if automated - // backups are enabled using the BackupRetentionPeriod parameter. - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region. To see the time blocks available, see Adjusting the Preferred - // Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Constraints: - // - // * Must be in the format hh24:mi-hh24:mi. - // - // * Times should be in Universal Coordinated Time (UTC). - // - // * Must not conflict with the preferred maintenance window. - // - // * Must be at least 30 minutes. - PreferredBackupWindow *string `type:"string"` - - // The weekly time range during which system maintenance can occur, in Universal - // Coordinated Time (UTC). - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region, occurring on a random day of the week. To see the time blocks - // available, see Adjusting the Preferred Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `type:"string"` - - // The Amazon Resource Name (ARN) of the source DB instance or DB cluster if - // this DB cluster is created as a Read Replica. - ReplicationSourceIdentifier *string `type:"string"` - - // SourceRegion is the source region where the resource exists. This is not - // sent over the wire and is only used for presigning. This value should always - // have the same region as the source ARN. - SourceRegion *string `type:"string" ignore:"true"` - - // Specifies whether the DB cluster is encrypted. - StorageEncrypted *bool `type:"boolean"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // A list of EC2 VPC security groups to associate with this DB cluster. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s CreateDBClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBClusterInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - if s.Engine == nil { - invalidParams.Add(request.NewErrParamRequired("Engine")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *CreateDBClusterInput) SetAvailabilityZones(v []*string) *CreateDBClusterInput { - s.AvailabilityZones = v - return s -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *CreateDBClusterInput) SetBackupRetentionPeriod(v int64) *CreateDBClusterInput { - s.BackupRetentionPeriod = &v - return s -} - -// SetCharacterSetName sets the CharacterSetName field's value. -func (s *CreateDBClusterInput) SetCharacterSetName(v string) *CreateDBClusterInput { - s.CharacterSetName = &v - return s -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *CreateDBClusterInput) SetDBClusterIdentifier(v string) *CreateDBClusterInput { - s.DBClusterIdentifier = &v - return s -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *CreateDBClusterInput) SetDBClusterParameterGroupName(v string) *CreateDBClusterInput { - s.DBClusterParameterGroupName = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *CreateDBClusterInput) SetDBSubnetGroupName(v string) *CreateDBClusterInput { - s.DBSubnetGroupName = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *CreateDBClusterInput) SetDatabaseName(v string) *CreateDBClusterInput { - s.DatabaseName = &v - return s -} - -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *CreateDBClusterInput) SetDestinationRegion(v string) *CreateDBClusterInput { - s.DestinationRegion = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *CreateDBClusterInput) SetEngine(v string) *CreateDBClusterInput { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *CreateDBClusterInput) SetEngineVersion(v string) *CreateDBClusterInput { - s.EngineVersion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateDBClusterInput) SetKmsKeyId(v string) *CreateDBClusterInput { - s.KmsKeyId = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *CreateDBClusterInput) SetMasterUserPassword(v string) *CreateDBClusterInput { - s.MasterUserPassword = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *CreateDBClusterInput) SetMasterUsername(v string) *CreateDBClusterInput { - s.MasterUsername = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *CreateDBClusterInput) SetOptionGroupName(v string) *CreateDBClusterInput { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateDBClusterInput) SetPort(v int64) *CreateDBClusterInput { - s.Port = &v - return s -} - -// SetPreSignedUrl sets the PreSignedUrl field's value. -func (s *CreateDBClusterInput) SetPreSignedUrl(v string) *CreateDBClusterInput { - s.PreSignedUrl = &v - return s -} - -// SetPreferredBackupWindow sets the PreferredBackupWindow field's value. -func (s *CreateDBClusterInput) SetPreferredBackupWindow(v string) *CreateDBClusterInput { - s.PreferredBackupWindow = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CreateDBClusterInput) SetPreferredMaintenanceWindow(v string) *CreateDBClusterInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetReplicationSourceIdentifier sets the ReplicationSourceIdentifier field's value. -func (s *CreateDBClusterInput) SetReplicationSourceIdentifier(v string) *CreateDBClusterInput { - s.ReplicationSourceIdentifier = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CreateDBClusterInput) SetSourceRegion(v string) *CreateDBClusterInput { - s.SourceRegion = &v - return s -} - -// SetStorageEncrypted sets the StorageEncrypted field's value. -func (s *CreateDBClusterInput) SetStorageEncrypted(v bool) *CreateDBClusterInput { - s.StorageEncrypted = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBClusterInput) SetTags(v []*Tag) *CreateDBClusterInput { - s.Tags = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *CreateDBClusterInput) SetVpcSecurityGroupIds(v []*string) *CreateDBClusterInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterResult -type CreateDBClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBCluster - // - // * DeleteDBCluster - // - // * FailoverDBCluster - // - // * ModifyDBCluster - // - // * RestoreDBClusterFromSnapshot - // - // * RestoreDBClusterToPointInTime - // - // This data type is used as a response element in the DescribeDBClusters action. - DBCluster *DBCluster `type:"structure"` -} - -// String returns the string representation -func (s CreateDBClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBClusterOutput) GoString() string { - return s.String() -} - -// SetDBCluster sets the DBCluster field's value. -func (s *CreateDBClusterOutput) SetDBCluster(v *DBCluster) *CreateDBClusterOutput { - s.DBCluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterParameterGroupMessage -type CreateDBClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster parameter group. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // This value is stored as a lowercase string. - // - // DBClusterParameterGroupName is a required field - DBClusterParameterGroupName *string `type:"string" required:"true"` - - // The DB cluster parameter group family name. A DB cluster parameter group - // can be associated with one and only one DB cluster parameter group family, - // and can be applied only to a DB cluster running a database engine and engine - // version compatible with that DB cluster parameter group family. - // - // DBParameterGroupFamily is a required field - DBParameterGroupFamily *string `type:"string" required:"true"` - - // The description for the DB cluster parameter group. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateDBClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBClusterParameterGroupInput"} - if s.DBClusterParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterParameterGroupName")) - } - if s.DBParameterGroupFamily == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupFamily")) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *CreateDBClusterParameterGroupInput) SetDBClusterParameterGroupName(v string) *CreateDBClusterParameterGroupInput { - s.DBClusterParameterGroupName = &v - return s -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *CreateDBClusterParameterGroupInput) SetDBParameterGroupFamily(v string) *CreateDBClusterParameterGroupInput { - s.DBParameterGroupFamily = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDBClusterParameterGroupInput) SetDescription(v string) *CreateDBClusterParameterGroupInput { - s.Description = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBClusterParameterGroupInput) SetTags(v []*Tag) *CreateDBClusterParameterGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterParameterGroupResult -type CreateDBClusterParameterGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the CreateDBClusterParameterGroup - // or CopyDBClusterParameterGroup action. - // - // This data type is used as a request parameter in the DeleteDBClusterParameterGroup - // action, and as a response element in the DescribeDBClusterParameterGroups - // action. - DBClusterParameterGroup *DBClusterParameterGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateDBClusterParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBClusterParameterGroupOutput) GoString() string { - return s.String() -} - -// SetDBClusterParameterGroup sets the DBClusterParameterGroup field's value. -func (s *CreateDBClusterParameterGroupOutput) SetDBClusterParameterGroup(v *DBClusterParameterGroup) *CreateDBClusterParameterGroupOutput { - s.DBClusterParameterGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterSnapshotMessage -type CreateDBClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of the DB cluster to create a snapshot for. This parameter - // is not case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: my-cluster1 - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The identifier of the DB cluster snapshot. This parameter is stored as a - // lowercase string. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: my-cluster1-snapshot1 - // - // DBClusterSnapshotIdentifier is a required field - DBClusterSnapshotIdentifier *string `type:"string" required:"true"` - - // The tags to be assigned to the DB cluster snapshot. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateDBClusterSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBClusterSnapshotInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - if s.DBClusterSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *CreateDBClusterSnapshotInput) SetDBClusterIdentifier(v string) *CreateDBClusterSnapshotInput { - s.DBClusterIdentifier = &v - return s -} - -// SetDBClusterSnapshotIdentifier sets the DBClusterSnapshotIdentifier field's value. -func (s *CreateDBClusterSnapshotInput) SetDBClusterSnapshotIdentifier(v string) *CreateDBClusterSnapshotInput { - s.DBClusterSnapshotIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBClusterSnapshotInput) SetTags(v []*Tag) *CreateDBClusterSnapshotInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBClusterSnapshotResult -type CreateDBClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBClusterSnapshot - // - // * DeleteDBClusterSnapshot - // - // This data type is used as a response element in the DescribeDBClusterSnapshots - // action. - DBClusterSnapshot *DBClusterSnapshot `type:"structure"` -} - -// String returns the string representation -func (s CreateDBClusterSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBClusterSnapshot sets the DBClusterSnapshot field's value. -func (s *CreateDBClusterSnapshotOutput) SetDBClusterSnapshot(v *DBClusterSnapshot) *CreateDBClusterSnapshotOutput { - s.DBClusterSnapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstanceMessage -type CreateDBInstanceInput struct { - _ struct{} `type:"structure"` - - // The amount of storage (in gigabytes) to be initially allocated for the database - // instance. - // - // Type: Integer - // - // MySQL - // - // Constraints: Must be an integer from 5 to 6144. - // - // MariaDB - // - // Constraints: Must be an integer from 5 to 6144. - // - // PostgreSQL - // - // Constraints: Must be an integer from 5 to 6144. - // - // Oracle - // - // Constraints: Must be an integer from 10 to 6144. - // - // SQL Server - // - // Constraints: Must be an integer from 200 to 4096 (Standard Edition and Enterprise - // Edition) or from 20 to 4096 (Express Edition and Web Edition) - AllocatedStorage *int64 `type:"integer"` - - // Indicates that minor engine upgrades will be applied automatically to the - // DB instance during the maintenance window. - // - // Default: true - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The EC2 Availability Zone that the database instance will be created in. - // For information on regions and Availability Zones, see Regions and Availability - // Zones (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html). - // - // Default: A random, system-chosen Availability Zone in the endpoint's region. - // - // Example: us-east-1d - // - // Constraint: The AvailabilityZone parameter cannot be specified if the MultiAZ - // parameter is set to true. The specified Availability Zone must be in the - // same region as the current endpoint. - AvailabilityZone *string `type:"string"` - - // The number of days for which automated backups are retained. Setting this - // parameter to a positive number enables backups. Setting this parameter to - // 0 disables automated backups. - // - // Default: 1 - // - // Constraints: - // - // * Must be a value from 0 to 35 - // - // * Cannot be set to 0 if the DB instance is a source to Read Replicas - BackupRetentionPeriod *int64 `type:"integer"` - - // For supported engines, indicates that the DB instance should be associated - // with the specified CharacterSet. - CharacterSetName *string `type:"string"` - - // True to copy all tags from the DB instance to snapshots of the DB instance; - // otherwise false. The default is false. - CopyTagsToSnapshot *bool `type:"boolean"` - - // The identifier of the DB cluster that the instance will belong to. - // - // For information on creating a DB cluster, see CreateDBCluster. - // - // Type: String - DBClusterIdentifier *string `type:"string"` - - // The compute and memory capacity of the DB instance. Note that not all instance - // classes are available in all regions for all DB engines. - // - // Valid Values: db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge - // | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge | db.m3.medium | db.m3.large - // | db.m3.xlarge | db.m3.2xlarge | db.m4.large | db.m4.xlarge | db.m4.2xlarge - // | db.m4.4xlarge | db.m4.10xlarge | db.r3.large | db.r3.xlarge | db.r3.2xlarge - // | db.r3.4xlarge | db.r3.8xlarge | db.t2.micro | db.t2.small | db.t2.medium - // | db.t2.large - // - // DBInstanceClass is a required field - DBInstanceClass *string `type:"string" required:"true"` - - // The DB instance identifier. This parameter is stored as a lowercase string. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens (1 to 15 - // for SQL Server). - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: mydbinstance - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // The meaning of this parameter differs according to the database engine you - // use. - // - // Type: String - // - // MySQL - // - // The name of the database to create when the DB instance is created. If this - // parameter is not specified, no database is created in the DB instance. - // - // Constraints: - // - // * Must contain 1 to 64 alphanumeric characters - // - // * Cannot be a word reserved by the specified database engine - // - // MariaDB - // - // The name of the database to create when the DB instance is created. If this - // parameter is not specified, no database is created in the DB instance. - // - // Constraints: - // - // * Must contain 1 to 64 alphanumeric characters - // - // * Cannot be a word reserved by the specified database engine - // - // PostgreSQL - // - // The name of the database to create when the DB instance is created. If this - // parameter is not specified, the default "postgres" database is created in - // the DB instance. - // - // Constraints: - // - // * Must contain 1 to 63 alphanumeric characters - // - // * Must begin with a letter or an underscore. Subsequent characters can - // be letters, underscores, or digits (0-9). - // - // * Cannot be a word reserved by the specified database engine - // - // Oracle - // - // The Oracle System ID (SID) of the created DB instance. - // - // Default: ORCL - // - // Constraints: - // - // * Cannot be longer than 8 characters - // - // SQL Server - // - // Not applicable. Must be null. - // - // Amazon Aurora - // - // The name of the database to create when the primary instance of the DB cluster - // is created. If this parameter is not specified, no database is created in - // the DB instance. - // - // Constraints: - // - // * Must contain 1 to 64 alphanumeric characters - // - // * Cannot be a word reserved by the specified database engine - DBName *string `type:"string"` - - // The name of the DB parameter group to associate with this DB instance. If - // this argument is omitted, the default DBParameterGroup for the specified - // engine will be used. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBParameterGroupName *string `type:"string"` - - // A list of DB security groups to associate with this DB instance. - // - // Default: The default DB security group for the database engine. - DBSecurityGroups []*string `locationNameList:"DBSecurityGroupName" type:"list"` - - // A DB subnet group to associate with this DB instance. - // - // If there is no DB subnet group, then it is a non-VPC DB instance. - DBSubnetGroupName *string `type:"string"` - - // Specify the Active Directory Domain to create the instance in. - Domain *string `type:"string"` - - // Specify the name of the IAM role to be used when making API calls to the - // Directory Service. - DomainIAMRoleName *string `type:"string"` - - // The name of the database engine to be used for this instance. - // - // Valid Values: mysql | mariadb | oracle-se1 | oracle-se2 | oracle-se | oracle-ee - // | sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web | postgres | - // aurora - // - // Not every database engine is available for every AWS region. - // - // Engine is a required field - Engine *string `type:"string" required:"true"` - - // The version number of the database engine to use. - // - // The following are the database engines and major and minor versions that - // are available with Amazon RDS. Not every database engine is available for - // every AWS region. - // - // Amazon Aurora - // - // * Version 5.6 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-2, eu-west-1, us-east-1, us-east-2, us-west-2): - // 5.6.10a - // - // MariaDB - // - // * Version 10.1 (available in these AWS regions: us-east-2): 10.1.16 - // - // * Version 10.1 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, - // us-east-1, us-west-1, us-west-2): 10.1.14 - // - // * Version 10.0 (available in all AWS regions): 10.0.24 - // - // * Version 10.0 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, - // us-east-1, us-gov-west-1, us-west-1, us-west-2): 10.0.17 - // - // Microsoft SQL Server 2016 - // - // * 13.00.2164.0.v1 (supported for all editions, and all AWS regions except - // sa-east-1) - // - // Microsoft SQL Server 2014 - // - // * 12.00.5000.0.v1 (supported for all editions, and all AWS regions) - // - // * 12.00.4422.0.v1 (supported for all editions except Enterprise Edition, - // and all AWS regions except us-east-2) - // - // Microsoft SQL Server 2012 - // - // * 11.00.6020.0.v1 (supported for all editions, and all AWS regions) - // - // * 11.00.5058.0.v1 (supported for all editions, and all AWS regions except - // us-east-2) - // - // * 11.00.2100.60.v1 (supported for all editions, and all AWS regions except - // us-east-2) - // - // Microsoft SQL Server 2008 R2 - // - // * 10.50.6529.0.v1 (supported for all editions, and all AWS regions except - // us-east-2) - // - // * 10.50.6000.34.v1 (supported for all editions, and all AWS regions except - // us-east-2) - // - // * 10.50.2789.0.v1 (supported for all editions, and all AWS regions except - // us-east-2) - // - // MySQL - // - // * Version 5.7 (available in all AWS regions): 5.7.11 - // - // * Version 5.7 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, - // us-east-1, us-gov-west-1, us-west-1, us-west-2): 5.7.10 - // - // * Version 5.6 (available in all AWS regions): 5.6.29 - // - // * Version 5.6 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, - // us-east-1, us-gov-west-1, us-west-1, us-west-2): 5.6.27 - // - // * Version 5.6 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, - // us-gov-west-1, us-west-1, us-west-2): 5.6.23 - // - // * Version 5.6 (available in these AWS regions: ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-gov-west-1, - // us-west-1, us-west-2): 5.6.19a | 5.6.19b | 5.6.21 | 5.6.21b | 5.6.22 - // - // * Version 5.5 (available in all AWS regions): 5.5.46 - // - // * Version 5.1 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-west-1, sa-east-1, us-east-1, us-gov-west-1, us-west-1, - // us-west-2): 5.1.73a | 5.1.73b - // - // Oracle Database Enterprise Edition (oracle-ee) - // - // * Version 12.1 (available in all AWS regions except ap-south-1, ap-northeast-2): - // 12.1.0.1.v1 | 12.1.0.1.v2 - // - // * Version 12.1 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-west-1, - // us-west-2): 12.1.0.1.v3 | 12.1.0.1.v4 | 12.1.0.1.v5 - // - // * Version 12.1 (available in all AWS regions): 12.1.0.2.v1 - // - // * Version 12.1 (available in all AWS regions except us-gov-west-1): 12.1.0.2.v2 - // | 12.1.0.2.v3 | 12.1.0.2.v4 - // - // * Version 11.2 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-west-1, sa-east-1, us-east-1, us-gov-west-1, us-west-1, - // us-west-2): 11.2.0.2.v3 | 11.2.0.2.v4 | 11.2.0.2.v5 | 11.2.0.2.v6 | 11.2.0.2.v7 - // - // * Version 11.2 (available in all AWS regions except ap-south-1, ap-northeast-2): - // 11.2.0.3.v1 | 11.2.0.3.v2 | 11.2.0.3.v3 - // - // * Version 11.2 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-west-1, - // us-west-2): 11.2.0.3.v4 - // - // * Version 11.2 (available in all AWS regions): 11.2.0.4.v1 | 11.2.0.4.v3 - // | 11.2.0.4.v4 - // - // * Version 11.2 (available in all AWS regions except us-gov-west-1): 11.2.0.4.v5 - // | 11.2.0.4.v6 | 11.2.0.4.v7 | 11.2.0.4.v8 - // - // Oracle Database Standard Edition (oracle-se) - // - // * Version 12.1 (available in all AWS regions except ap-south-1, ap-northeast-2): - // 12.1.0.1.v1 | 12.1.0.1.v2 - // - // * Version 12.1 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-west-1, - // us-west-2): 12.1.0.1.v3 | 12.1.0.1.v4 | 12.1.0.1.v5 - // - // * Version 11.2 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-west-1, sa-east-1, us-east-1, us-gov-west-1, us-west-1, - // us-west-2): 11.2.0.2.v3 | 11.2.0.2.v4 | 11.2.0.2.v5 | 11.2.0.2.v6 | 11.2.0.2.v7 - // - // * Version 11.2 (available in all AWS regions except ap-south-1, ap-northeast-2): - // 11.2.0.3.v1 | 11.2.0.3.v2 | 11.2.0.3.v3 - // - // * Version 11.2 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-west-1, - // us-west-2): 11.2.0.3.v4 - // - // * Version 11.2 (available in all AWS regions): 11.2.0.4.v1 | 11.2.0.4.v3 - // | 11.2.0.4.v4 - // - // * Version 11.2 (available in all AWS regions except us-gov-west-1): 11.2.0.4.v5 - // | 11.2.0.4.v6 | 11.2.0.4.v7 | 11.2.0.4.v8 - // - // Oracle Database Standard Edition One (oracle-se1) - // - // * Version 12.1 (available in all AWS regions except ap-south-1, ap-northeast-2): - // 12.1.0.1.v1 | 12.1.0.1.v2 - // - // * Version 12.1 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-west-1, - // us-west-2): 12.1.0.1.v3 | 12.1.0.1.v4 | 12.1.0.1.v5 - // - // * Version 11.2 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-west-1, sa-east-1, us-east-1, us-gov-west-1, us-west-1, - // us-west-2): 11.2.0.2.v3 | 11.2.0.2.v4 | 11.2.0.2.v5 | 11.2.0.2.v6 | 11.2.0.2.v7 - // - // * Version 11.2 (available in all AWS regions except ap-south-1, ap-northeast-2): - // 11.2.0.3.v1 | 11.2.0.3.v2 | 11.2.0.3.v3 - // - // * Version 11.2 (only available in AWS regions ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-west-1, - // us-west-2): 11.2.0.3.v4 - // - // * Version 11.2 (available in all AWS regions): 11.2.0.4.v1 | 11.2.0.4.v3 - // | 11.2.0.4.v4 - // - // * Version 11.2 (available in all AWS regions except us-gov-west-1): 11.2.0.4.v5 - // | 11.2.0.4.v6 | 11.2.0.4.v7 | 11.2.0.4.v8 - // - // Oracle Database Standard Edition Two (oracle-se2) - // - // * Version 12.1 (available in all AWS regions except us-gov-west-1): 12.1.0.2.v2 - // | 12.1.0.2.v3 | 12.1.0.2.v4 - // - // PostgreSQL - // - // * Version 9.6: 9.6.1 - // - // * Version 9.5:9.5.4 | 9.5.2 - // - // * Version 9.4: 9.4.9 | 9.4.7 | 9.4.5 | 9.4.4 | 9.4.1 - // - // * Version 9.3: 9.3.14 | 9.3.12 | 9.3.10 | 9.3.9 | 9.3.6 | 9.3.5 | 9.3.3 - // | 9.3.2 | 9.3.1 - // - // Oracle 12c - // - // 12.1.0.2.v6 (supported for EE in all AWS regions, and SE2 in all AWS regions - // except us-gov-west-1) - // - // * 12.1.0.2.v5 (supported for EE in all AWS regions, and SE2 in all AWS - // regions except us-gov-west-1) - // - // * 12.1.0.2.v4 (supported for EE in all AWS regions, and SE2 in all AWS - // regions except us-gov-west-1) - // - // * 12.1.0.2.v3 (supported for EE in all AWS regions, and SE2 in all AWS - // regions except us-gov-west-1) - // - // * 12.1.0.2.v2 (supported for EE in all AWS regions, and SE2 in all AWS - // regions except us-gov-west-1) - // - // * 12.1.0.2.v1 (supported for EE in all AWS regions, and SE2 in all AWS - // regions except us-gov-west-1) - // - // * 12.1.0.1.v6 (supported for EE, SE1, and SE, in all AWS regions except - // ap-south-1, ap-northeast-2) - // - // * 12.1.0.1.v5 (supported for EE, SE1, and SE, in all AWS regions except - // ap-south-1, ap-northeast-2) - // - // * 12.1.0.1.v4 (supported for EE, SE1, and SE, in all AWS regions except - // ap-south-1, ap-northeast-2) - // - // * 12.1.0.1.v3 (supported for EE, SE1, and SE, in all AWS regions except - // ap-south-1, ap-northeast-2) - // - // * 12.1.0.1.v2 (supported for EE, SE1, and SE, in all AWS regions except - // ap-south-1, ap-northeast-2) - // - // * 12.1.0.1.v1 (supported for EE, SE1, and SE, in all AWS regions except - // ap-south-1, ap-northeast-2) - // - // Oracle 11g - // - // * 11.2.0.4.v10 (supported for EE, SE1, and SE, in all AWS regions) - // - // * 11.2.0.4.v9 (supported for EE, SE1, and SE, in all AWS regions) - // - // * 11.2.0.4.v8 (supported for EE, SE1, and SE, in all AWS regions) - // - // * 11.2.0.4.v7 (supported for EE, SE1, and SE, in all AWS regions) - // - // * 11.2.0.4.v6 (supported for EE, SE1, and SE, in all AWS regions) - // - // * 11.2.0.4.v5 (supported for EE, SE1, and SE, in all AWS regions) - // - // * 11.2.0.4.v4 (supported for EE, SE1, and SE, in all AWS regions) - // - // * 11.2.0.4.v3 (supported for EE, SE1, and SE, in all AWS regions) - // - // * 11.2.0.4.v1 (supported for EE, SE1, and SE, in all AWS regions) - // - // PostgreSQL - // - // * Version 9.5 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, - // us-east-1, us-west-1, us-west-2): * 9.5.4 - // - // * Version 9.5 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, - // us-east-1, us-east-2, us-west-1, us-west-2): * 9.5.2 - // - // * Version 9.4 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, - // us-east-1, us-west-1, us-west-2): * 9.4.9 - // - // * Version 9.4 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, - // us-east-1, us-east-2, us-west-1, us-west-2): * 9.4.7 - // - // * Version 9.4 (available in all AWS regions): * 9.4.5 - // - // * Version 9.4 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, - // us-gov-west-1, us-west-1, us-west-2): * 9.4.4 - // - // * Version 9.4 (available in these AWS regions: ap-northeast-1, ap-northeast-2, - // ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, - // us-east-2, us-gov-west-1, us-west-1, us-west-2): * 9.4.1 - // - // * Version 9.3 (available in these AWS regions: ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-gov-west-1, - // us-west-1, us-west-2): * 9.3.10 | 9.3.3 | 9.3.5 | 9.3.6 | 9.3.9 - // - // * Version 9.3 (available in these AWS regions: ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-west-1, sa-east-1, us-east-1, us-gov-west-1, us-west-1, - // us-west-2): * 9.3.1 | 9.3.2 - // - // * Version 9.3 (available in these AWS regions: ap-northeast-1, ap-southeast-1, - // ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-west-1, - // us-west-2): * 9.3.12 | 9.3.14 - EngineVersion *string `type:"string"` - - // The amount of Provisioned IOPS (input/output operations per second) to be - // initially allocated for the DB instance. - // - // Constraints: Must be a multiple between 3 and 10 of the storage amount for - // the DB instance. Must also be an integer multiple of 1000. For example, if - // the size of your DB instance is 500 GB, then your Iops value can be 2000, - // 3000, 4000, or 5000. - Iops *int64 `type:"integer"` - - // The KMS key identifier for an encrypted DB instance. - // - // The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption - // key. If you are creating a DB instance with the same AWS account that owns - // the KMS encryption key used to encrypt the new DB instance, then you can - // use the KMS key alias instead of the ARN for the KM encryption key. - // - // If the StorageEncrypted parameter is true, and you do not specify a value - // for the KmsKeyId parameter, then Amazon RDS will use your default encryption - // key. AWS KMS creates the default encryption key for your AWS account. Your - // AWS account has a different default encryption key for each AWS region. - KmsKeyId *string `type:"string"` - - // License model information for this DB instance. - // - // Valid values: license-included | bring-your-own-license | general-public-license - LicenseModel *string `type:"string"` - - // The password for the master database user. Can be any printable ASCII character - // except "/", """, or "@". - // - // Type: String - // - // MySQL - // - // Constraints: Must contain from 8 to 41 characters. - // - // MariaDB - // - // Constraints: Must contain from 8 to 41 characters. - // - // Oracle - // - // Constraints: Must contain from 8 to 30 characters. - // - // SQL Server - // - // Constraints: Must contain from 8 to 128 characters. - // - // PostgreSQL - // - // Constraints: Must contain from 8 to 128 characters. - // - // Amazon Aurora - // - // Constraints: Must contain from 8 to 41 characters. - MasterUserPassword *string `type:"string"` - - // The name of master user for the client DB instance. - // - // MySQL - // - // Constraints: - // - // * Must be 1 to 16 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot be a reserved word for the chosen database engine. - // - // MariaDB - // - // Constraints: - // - // * Must be 1 to 16 alphanumeric characters. - // - // * Cannot be a reserved word for the chosen database engine. - // - // Type: String - // - // Oracle - // - // Constraints: - // - // * Must be 1 to 30 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot be a reserved word for the chosen database engine. - // - // SQL Server - // - // Constraints: - // - // * Must be 1 to 128 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot be a reserved word for the chosen database engine. - // - // PostgreSQL - // - // Constraints: - // - // * Must be 1 to 63 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot be a reserved word for the chosen database engine. - MasterUsername *string `type:"string"` - - // The interval, in seconds, between points when Enhanced Monitoring metrics - // are collected for the DB instance. To disable collecting Enhanced Monitoring - // metrics, specify 0. The default is 0. - // - // If MonitoringRoleArn is specified, then you must also set MonitoringInterval - // to a value other than 0. - // - // Valid Values: 0, 1, 5, 10, 15, 30, 60 - MonitoringInterval *int64 `type:"integer"` - - // The ARN for the IAM role that permits RDS to send enhanced monitoring metrics - // to CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess. - // For information on creating a monitoring role, go to To create an IAM role - // for Amazon RDS Enhanced Monitoring (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html#USER_Monitoring.OS.IAMRole). - // - // If MonitoringInterval is set to a value other than 0, then you must supply - // a MonitoringRoleArn value. - MonitoringRoleArn *string `type:"string"` - - // Specifies if the DB instance is a Multi-AZ deployment. You cannot set the - // AvailabilityZone parameter if the MultiAZ parameter is set to true. - MultiAZ *bool `type:"boolean"` - - // Indicates that the DB instance should be associated with the specified option - // group. - // - // Permanent options, such as the TDE option for Oracle Advanced Security TDE, - // cannot be removed from an option group, and that option group cannot be removed - // from a DB instance once it is associated with a DB instance - OptionGroupName *string `type:"string"` - - // The port number on which the database accepts connections. - // - // MySQL - // - // Default: 3306 - // - // Valid Values: 1150-65535 - // - // Type: Integer - // - // MariaDB - // - // Default: 3306 - // - // Valid Values: 1150-65535 - // - // Type: Integer - // - // PostgreSQL - // - // Default: 5432 - // - // Valid Values: 1150-65535 - // - // Type: Integer - // - // Oracle - // - // Default: 1521 - // - // Valid Values: 1150-65535 - // - // SQL Server - // - // Default: 1433 - // - // Valid Values: 1150-65535 except for 1434, 3389, 47001, 49152, and 49152 through - // 49156. - // - // Amazon Aurora - // - // Default: 3306 - // - // Valid Values: 1150-65535 - // - // Type: Integer - Port *int64 `type:"integer"` - - // The daily time range during which automated backups are created if automated - // backups are enabled, using the BackupRetentionPeriod parameter. For more - // information, see DB Instance Backups (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.BackingUpAndRestoringAmazonRDSInstances.html). - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region. To see the time blocks available, see Adjusting the Preferred - // Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Constraints: - // - // * Must be in the format hh24:mi-hh24:mi. - // - // * Times should be in Universal Coordinated Time (UTC). - // - // * Must not conflict with the preferred maintenance window. - // - // * Must be at least 30 minutes. - PreferredBackupWindow *string `type:"string"` - - // The weekly time range during which system maintenance can occur, in Universal - // Coordinated Time (UTC). For more information, see DB Instance Maintenance - // (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBMaintenance.html). - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region, occurring on a random day of the week. To see the time blocks - // available, see Adjusting the Preferred Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `type:"string"` - - // A value that specifies the order in which an Aurora Replica is promoted to - // the primary instance after a failure of the existing primary instance. For - // more information, see Fault Tolerance for an Aurora DB Cluster (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html#Aurora.Managing.FaultTolerance). - // - // Default: 1 - // - // Valid Values: 0 - 15 - PromotionTier *int64 `type:"integer"` - - // Specifies the accessibility options for the DB instance. A value of true - // specifies an Internet-facing instance with a publicly resolvable DNS name, - // which resolves to a public IP address. A value of false specifies an internal - // instance with a DNS name that resolves to a private IP address. - // - // Default: The default behavior varies depending on whether a VPC has been - // requested or not. The following list shows the default behavior in each case. - // - // * Default VPC: true - // - // * VPC: false - // - // If no DB subnet group has been specified as part of the request and the PubliclyAccessible - // value has not been set, the DB instance will be publicly accessible. If a - // specific DB subnet group has been specified as part of the request and the - // PubliclyAccessible value has not been set, the DB instance will be private. - PubliclyAccessible *bool `type:"boolean"` - - // Specifies whether the DB instance is encrypted. - // - // Default: false - StorageEncrypted *bool `type:"boolean"` - - // Specifies the storage type to be associated with the DB instance. - // - // Valid values: standard | gp2 | io1 - // - // If you specify io1, you must also include a value for the Iops parameter. - // - // Default: io1 if the Iops parameter is specified; otherwise standard - StorageType *string `type:"string"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The ARN from the Key Store with which to associate the instance for TDE encryption. - TdeCredentialArn *string `type:"string"` - - // The password for the given ARN from the Key Store in order to access the - // device. - TdeCredentialPassword *string `type:"string"` - - // The time zone of the DB instance. The time zone parameter is currently supported - // only by Microsoft SQL Server (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone). - Timezone *string `type:"string"` - - // A list of EC2 VPC security groups to associate with this DB instance. - // - // Default: The default EC2 VPC security group for the DB subnet group's VPC. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s CreateDBInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBInstanceInput"} - if s.DBInstanceClass == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceClass")) - } - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - if s.Engine == nil { - invalidParams.Add(request.NewErrParamRequired("Engine")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *CreateDBInstanceInput) SetAllocatedStorage(v int64) *CreateDBInstanceInput { - s.AllocatedStorage = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *CreateDBInstanceInput) SetAutoMinorVersionUpgrade(v bool) *CreateDBInstanceInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateDBInstanceInput) SetAvailabilityZone(v string) *CreateDBInstanceInput { - s.AvailabilityZone = &v - return s -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *CreateDBInstanceInput) SetBackupRetentionPeriod(v int64) *CreateDBInstanceInput { - s.BackupRetentionPeriod = &v - return s -} - -// SetCharacterSetName sets the CharacterSetName field's value. -func (s *CreateDBInstanceInput) SetCharacterSetName(v string) *CreateDBInstanceInput { - s.CharacterSetName = &v - return s -} - -// SetCopyTagsToSnapshot sets the CopyTagsToSnapshot field's value. -func (s *CreateDBInstanceInput) SetCopyTagsToSnapshot(v bool) *CreateDBInstanceInput { - s.CopyTagsToSnapshot = &v - return s -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *CreateDBInstanceInput) SetDBClusterIdentifier(v string) *CreateDBInstanceInput { - s.DBClusterIdentifier = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *CreateDBInstanceInput) SetDBInstanceClass(v string) *CreateDBInstanceInput { - s.DBInstanceClass = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *CreateDBInstanceInput) SetDBInstanceIdentifier(v string) *CreateDBInstanceInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBName sets the DBName field's value. -func (s *CreateDBInstanceInput) SetDBName(v string) *CreateDBInstanceInput { - s.DBName = &v - return s -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *CreateDBInstanceInput) SetDBParameterGroupName(v string) *CreateDBInstanceInput { - s.DBParameterGroupName = &v - return s -} - -// SetDBSecurityGroups sets the DBSecurityGroups field's value. -func (s *CreateDBInstanceInput) SetDBSecurityGroups(v []*string) *CreateDBInstanceInput { - s.DBSecurityGroups = v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *CreateDBInstanceInput) SetDBSubnetGroupName(v string) *CreateDBInstanceInput { - s.DBSubnetGroupName = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *CreateDBInstanceInput) SetDomain(v string) *CreateDBInstanceInput { - s.Domain = &v - return s -} - -// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. -func (s *CreateDBInstanceInput) SetDomainIAMRoleName(v string) *CreateDBInstanceInput { - s.DomainIAMRoleName = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *CreateDBInstanceInput) SetEngine(v string) *CreateDBInstanceInput { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *CreateDBInstanceInput) SetEngineVersion(v string) *CreateDBInstanceInput { - s.EngineVersion = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *CreateDBInstanceInput) SetIops(v int64) *CreateDBInstanceInput { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateDBInstanceInput) SetKmsKeyId(v string) *CreateDBInstanceInput { - s.KmsKeyId = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *CreateDBInstanceInput) SetLicenseModel(v string) *CreateDBInstanceInput { - s.LicenseModel = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *CreateDBInstanceInput) SetMasterUserPassword(v string) *CreateDBInstanceInput { - s.MasterUserPassword = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *CreateDBInstanceInput) SetMasterUsername(v string) *CreateDBInstanceInput { - s.MasterUsername = &v - return s -} - -// SetMonitoringInterval sets the MonitoringInterval field's value. -func (s *CreateDBInstanceInput) SetMonitoringInterval(v int64) *CreateDBInstanceInput { - s.MonitoringInterval = &v - return s -} - -// SetMonitoringRoleArn sets the MonitoringRoleArn field's value. -func (s *CreateDBInstanceInput) SetMonitoringRoleArn(v string) *CreateDBInstanceInput { - s.MonitoringRoleArn = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *CreateDBInstanceInput) SetMultiAZ(v bool) *CreateDBInstanceInput { - s.MultiAZ = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *CreateDBInstanceInput) SetOptionGroupName(v string) *CreateDBInstanceInput { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateDBInstanceInput) SetPort(v int64) *CreateDBInstanceInput { - s.Port = &v - return s -} - -// SetPreferredBackupWindow sets the PreferredBackupWindow field's value. -func (s *CreateDBInstanceInput) SetPreferredBackupWindow(v string) *CreateDBInstanceInput { - s.PreferredBackupWindow = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CreateDBInstanceInput) SetPreferredMaintenanceWindow(v string) *CreateDBInstanceInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPromotionTier sets the PromotionTier field's value. -func (s *CreateDBInstanceInput) SetPromotionTier(v int64) *CreateDBInstanceInput { - s.PromotionTier = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *CreateDBInstanceInput) SetPubliclyAccessible(v bool) *CreateDBInstanceInput { - s.PubliclyAccessible = &v - return s -} - -// SetStorageEncrypted sets the StorageEncrypted field's value. -func (s *CreateDBInstanceInput) SetStorageEncrypted(v bool) *CreateDBInstanceInput { - s.StorageEncrypted = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *CreateDBInstanceInput) SetStorageType(v string) *CreateDBInstanceInput { - s.StorageType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBInstanceInput) SetTags(v []*Tag) *CreateDBInstanceInput { - s.Tags = v - return s -} - -// SetTdeCredentialArn sets the TdeCredentialArn field's value. -func (s *CreateDBInstanceInput) SetTdeCredentialArn(v string) *CreateDBInstanceInput { - s.TdeCredentialArn = &v - return s -} - -// SetTdeCredentialPassword sets the TdeCredentialPassword field's value. -func (s *CreateDBInstanceInput) SetTdeCredentialPassword(v string) *CreateDBInstanceInput { - s.TdeCredentialPassword = &v - return s -} - -// SetTimezone sets the Timezone field's value. -func (s *CreateDBInstanceInput) SetTimezone(v string) *CreateDBInstanceInput { - s.Timezone = &v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *CreateDBInstanceInput) SetVpcSecurityGroupIds(v []*string) *CreateDBInstanceInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstanceResult -type CreateDBInstanceOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBInstance - // - // * DeleteDBInstance - // - // * ModifyDBInstance - // - // This data type is used as a response element in the DescribeDBInstances action. - DBInstance *DBInstance `type:"structure"` -} - -// String returns the string representation -func (s CreateDBInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBInstanceOutput) GoString() string { - return s.String() -} - -// SetDBInstance sets the DBInstance field's value. -func (s *CreateDBInstanceOutput) SetDBInstance(v *DBInstance) *CreateDBInstanceOutput { - s.DBInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstanceReadReplicaMessage -type CreateDBInstanceReadReplicaInput struct { - _ struct{} `type:"structure"` - - // Indicates that minor engine upgrades will be applied automatically to the - // Read Replica during the maintenance window. - // - // Default: Inherits from the source DB instance - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The Amazon EC2 Availability Zone that the Read Replica will be created in. - // - // Default: A random, system-chosen Availability Zone in the endpoint's region. - // - // Example: us-east-1d - AvailabilityZone *string `type:"string"` - - // True to copy all tags from the Read Replica to snapshots of the Read Replica; - // otherwise false. The default is false. - CopyTagsToSnapshot *bool `type:"boolean"` - - // The compute and memory capacity of the Read Replica. Note that not all instance - // classes are available in all regions for all DB engines. - // - // Valid Values: db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge | db.m2.xlarge - // |db.m2.2xlarge | db.m2.4xlarge | db.m3.medium | db.m3.large | db.m3.xlarge - // | db.m3.2xlarge | db.m4.large | db.m4.xlarge | db.m4.2xlarge | db.m4.4xlarge - // | db.m4.10xlarge | db.r3.large | db.r3.xlarge | db.r3.2xlarge | db.r3.4xlarge - // | db.r3.8xlarge | db.t2.micro | db.t2.small | db.t2.medium | db.t2.large - // - // Default: Inherits from the source DB instance. - DBInstanceClass *string `type:"string"` - - // The DB instance identifier of the Read Replica. This identifier is the unique - // key that identifies a DB instance. This parameter is stored as a lowercase - // string. - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // Specifies a DB subnet group for the DB instance. The new DB instance will - // be created in the VPC associated with the DB subnet group. If no DB subnet - // group is specified, then the new DB instance is not created in a VPC. - // - // Constraints: - // - // * Can only be specified if the source DB instance identifier specifies - // a DB instance in another region. - // - // * The specified DB subnet group must be in the same region in which the - // operation is running. - // - // * All Read Replicas in one region that are created from the same source - // DB instance must either:> - // - // Specify DB subnet groups from the same VPC. All these Read Replicas will - // be created in the same VPC. - // - // Not specify a DB subnet group. All these Read Replicas will be created outside - // of any VPC. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - DBSubnetGroupName *string `type:"string"` - - // DestinationRegion is used for presigning the request to a given region. - DestinationRegion *string `type:"string"` - - // The amount of Provisioned IOPS (input/output operations per second) to be - // initially allocated for the DB instance. - Iops *int64 `type:"integer"` - - // The AWS KMS key ID for an encrypted Read Replica. The KMS key ID is the Amazon - // Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS - // encryption key. - // - // If you create an unencrypted Read Replica and specify a value for the KmsKeyId - // parameter, Amazon RDS encrypts the target Read Replica using the specified - // KMS encryption key. - // - // If you create an encrypted Read Replica from your AWS account, you can specify - // a value for KmsKeyId to encrypt the Read Replica with a new KMS encryption - // key. If you don't specify a value for KmsKeyId, then the Read Replica is - // encrypted with the same KMS key as the source DB instance. - // - // If you create an encrypted Read Replica in a different AWS region, then you - // must specify a KMS key for the destination AWS region. KMS encryption keys - // are specific to the region that they are created in, and you cannot use encryption - // keys from one region in another region. - KmsKeyId *string `type:"string"` - - // The interval, in seconds, between points when Enhanced Monitoring metrics - // are collected for the Read Replica. To disable collecting Enhanced Monitoring - // metrics, specify 0. The default is 0. - // - // If MonitoringRoleArn is specified, then you must also set MonitoringInterval - // to a value other than 0. - // - // Valid Values: 0, 1, 5, 10, 15, 30, 60 - MonitoringInterval *int64 `type:"integer"` - - // The ARN for the IAM role that permits RDS to send enhanced monitoring metrics - // to CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess. - // For information on creating a monitoring role, go to To create an IAM role - // for Amazon RDS Enhanced Monitoring (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html#USER_Monitoring.OS.IAMRole). - // - // If MonitoringInterval is set to a value other than 0, then you must supply - // a MonitoringRoleArn value. - MonitoringRoleArn *string `type:"string"` - - // The option group the DB instance will be associated with. If omitted, the - // default option group for the engine specified will be used. - OptionGroupName *string `type:"string"` - - // The port number that the DB instance uses for connections. - // - // Default: Inherits from the source DB instance - // - // Valid Values: 1150-65535 - Port *int64 `type:"integer"` - - // The URL that contains a Signature Version 4 signed request for the CreateDBInstanceReadReplica - // API action in the AWS region that contains the source DB instance. The PreSignedUrl - // parameter must be used when encrypting a Read Replica from another AWS region. - // - // The presigned URL must be a valid request for the CreateDBInstanceReadReplica - // API action that can be executed in the source region that contains the encrypted - // DB instance. The presigned URL request must contain the following parameter - // values: - // - // * DestinationRegion - The AWS Region that the Read Replica is created - // in. This region is the same one where the CreateDBInstanceReadReplica - // action is called that contains this presigned URL. - // - // For example, if you create an encrypted Read Replica in the us-east-1 region, - // and the source DB instance is in the west-2 region, then you call the - // CreateDBInstanceReadReplica action in the us-east-1 region and provide - // a presigned URL that contains a call to the CreateDBInstanceReadReplica - // action in the us-west-2 region. For this example, the DestinationRegion - // in the presigned URL must be set to the us-east-1 region. - // - // * KmsKeyId - The KMS key identifier for the key to use to encrypt the - // Read Replica in the destination region. This is the same identifier for - // both the CreateDBInstanceReadReplica action that is called in the destination - // region, and the action contained in the presigned URL. - // - // * SourceDBInstanceIdentifier - The DB instance identifier for the encrypted - // Read Replica to be created. This identifier must be in the Amazon Resource - // Name (ARN) format for the source region. For example, if you create an - // encrypted Read Replica from a DB instance in the us-west-2 region, then - // your SourceDBInstanceIdentifier would look like this example: arn:aws:rds:us-west-2:123456789012:instance:mysql-instance1-instance-20161115. - // - // To learn how to generate a Signature Version 4 signed request, see Authenticating - // Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) - // and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). - PreSignedUrl *string `type:"string"` - - // Specifies the accessibility options for the DB instance. A value of true - // specifies an Internet-facing instance with a publicly resolvable DNS name, - // which resolves to a public IP address. A value of false specifies an internal - // instance with a DNS name that resolves to a private IP address. - // - // Default: The default behavior varies depending on whether a VPC has been - // requested or not. The following list shows the default behavior in each case. - // - // * Default VPC:true - // - // * VPC:false - // - // If no DB subnet group has been specified as part of the request and the PubliclyAccessible - // value has not been set, the DB instance will be publicly accessible. If a - // specific DB subnet group has been specified as part of the request and the - // PubliclyAccessible value has not been set, the DB instance will be private. - PubliclyAccessible *bool `type:"boolean"` - - // The identifier of the DB instance that will act as the source for the Read - // Replica. Each DB instance can have up to five Read Replicas. - // - // Constraints: - // - // * Must be the identifier of an existing MySQL, MariaDB, or PostgreSQL - // DB instance. - // - // * Can specify a DB instance that is a MySQL Read Replica only if the source - // is running MySQL 5.6. - // - // * Can specify a DB instance that is a PostgreSQL DB instance only if the - // source is running PostgreSQL 9.3.5 or later. - // - // * The specified DB instance must have automatic backups enabled, its backup - // retention period must be greater than 0. - // - // * If the source DB instance is in the same region as the Read Replica, - // specify a valid DB instance identifier. - // - // * If the source DB instance is in a different region than the Read Replica, - // specify a valid DB instance ARN. For more information, go to Constructing - // a Amazon RDS Amazon Resource Name (ARN) (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing). - // - // SourceDBInstanceIdentifier is a required field - SourceDBInstanceIdentifier *string `type:"string" required:"true"` - - // SourceRegion is the source region where the resource exists. This is not - // sent over the wire and is only used for presigning. This value should always - // have the same region as the source ARN. - SourceRegion *string `type:"string" ignore:"true"` - - // Specifies the storage type to be associated with the Read Replica. - // - // Valid values: standard | gp2 | io1 - // - // If you specify io1, you must also include a value for the Iops parameter. - // - // Default: io1 if the Iops parameter is specified; otherwise standard - StorageType *string `type:"string"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateDBInstanceReadReplicaInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBInstanceReadReplicaInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBInstanceReadReplicaInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBInstanceReadReplicaInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - if s.SourceDBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDBInstanceIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *CreateDBInstanceReadReplicaInput) SetAutoMinorVersionUpgrade(v bool) *CreateDBInstanceReadReplicaInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateDBInstanceReadReplicaInput) SetAvailabilityZone(v string) *CreateDBInstanceReadReplicaInput { - s.AvailabilityZone = &v - return s -} - -// SetCopyTagsToSnapshot sets the CopyTagsToSnapshot field's value. -func (s *CreateDBInstanceReadReplicaInput) SetCopyTagsToSnapshot(v bool) *CreateDBInstanceReadReplicaInput { - s.CopyTagsToSnapshot = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *CreateDBInstanceReadReplicaInput) SetDBInstanceClass(v string) *CreateDBInstanceReadReplicaInput { - s.DBInstanceClass = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *CreateDBInstanceReadReplicaInput) SetDBInstanceIdentifier(v string) *CreateDBInstanceReadReplicaInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *CreateDBInstanceReadReplicaInput) SetDBSubnetGroupName(v string) *CreateDBInstanceReadReplicaInput { - s.DBSubnetGroupName = &v - return s -} - -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *CreateDBInstanceReadReplicaInput) SetDestinationRegion(v string) *CreateDBInstanceReadReplicaInput { - s.DestinationRegion = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *CreateDBInstanceReadReplicaInput) SetIops(v int64) *CreateDBInstanceReadReplicaInput { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateDBInstanceReadReplicaInput) SetKmsKeyId(v string) *CreateDBInstanceReadReplicaInput { - s.KmsKeyId = &v - return s -} - -// SetMonitoringInterval sets the MonitoringInterval field's value. -func (s *CreateDBInstanceReadReplicaInput) SetMonitoringInterval(v int64) *CreateDBInstanceReadReplicaInput { - s.MonitoringInterval = &v - return s -} - -// SetMonitoringRoleArn sets the MonitoringRoleArn field's value. -func (s *CreateDBInstanceReadReplicaInput) SetMonitoringRoleArn(v string) *CreateDBInstanceReadReplicaInput { - s.MonitoringRoleArn = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *CreateDBInstanceReadReplicaInput) SetOptionGroupName(v string) *CreateDBInstanceReadReplicaInput { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateDBInstanceReadReplicaInput) SetPort(v int64) *CreateDBInstanceReadReplicaInput { - s.Port = &v - return s -} - -// SetPreSignedUrl sets the PreSignedUrl field's value. -func (s *CreateDBInstanceReadReplicaInput) SetPreSignedUrl(v string) *CreateDBInstanceReadReplicaInput { - s.PreSignedUrl = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *CreateDBInstanceReadReplicaInput) SetPubliclyAccessible(v bool) *CreateDBInstanceReadReplicaInput { - s.PubliclyAccessible = &v - return s -} - -// SetSourceDBInstanceIdentifier sets the SourceDBInstanceIdentifier field's value. -func (s *CreateDBInstanceReadReplicaInput) SetSourceDBInstanceIdentifier(v string) *CreateDBInstanceReadReplicaInput { - s.SourceDBInstanceIdentifier = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CreateDBInstanceReadReplicaInput) SetSourceRegion(v string) *CreateDBInstanceReadReplicaInput { - s.SourceRegion = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *CreateDBInstanceReadReplicaInput) SetStorageType(v string) *CreateDBInstanceReadReplicaInput { - s.StorageType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBInstanceReadReplicaInput) SetTags(v []*Tag) *CreateDBInstanceReadReplicaInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBInstanceReadReplicaResult -type CreateDBInstanceReadReplicaOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBInstance - // - // * DeleteDBInstance - // - // * ModifyDBInstance - // - // This data type is used as a response element in the DescribeDBInstances action. - DBInstance *DBInstance `type:"structure"` -} - -// String returns the string representation -func (s CreateDBInstanceReadReplicaOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBInstanceReadReplicaOutput) GoString() string { - return s.String() -} - -// SetDBInstance sets the DBInstance field's value. -func (s *CreateDBInstanceReadReplicaOutput) SetDBInstance(v *DBInstance) *CreateDBInstanceReadReplicaOutput { - s.DBInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBParameterGroupMessage -type CreateDBParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The DB parameter group family name. A DB parameter group can be associated - // with one and only one DB parameter group family, and can be applied only - // to a DB instance running a database engine and engine version compatible - // with that DB parameter group family. - // - // DBParameterGroupFamily is a required field - DBParameterGroupFamily *string `type:"string" required:"true"` - - // The name of the DB parameter group. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // This value is stored as a lowercase string. - // - // DBParameterGroupName is a required field - DBParameterGroupName *string `type:"string" required:"true"` - - // The description for the DB parameter group. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateDBParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBParameterGroupInput"} - if s.DBParameterGroupFamily == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupFamily")) - } - if s.DBParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupName")) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *CreateDBParameterGroupInput) SetDBParameterGroupFamily(v string) *CreateDBParameterGroupInput { - s.DBParameterGroupFamily = &v - return s -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *CreateDBParameterGroupInput) SetDBParameterGroupName(v string) *CreateDBParameterGroupInput { - s.DBParameterGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDBParameterGroupInput) SetDescription(v string) *CreateDBParameterGroupInput { - s.Description = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBParameterGroupInput) SetTags(v []*Tag) *CreateDBParameterGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBParameterGroupResult -type CreateDBParameterGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the CreateDBParameterGroup - // action. - // - // This data type is used as a request parameter in the DeleteDBParameterGroup - // action, and as a response element in the DescribeDBParameterGroups action. - DBParameterGroup *DBParameterGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateDBParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBParameterGroupOutput) GoString() string { - return s.String() -} - -// SetDBParameterGroup sets the DBParameterGroup field's value. -func (s *CreateDBParameterGroupOutput) SetDBParameterGroup(v *DBParameterGroup) *CreateDBParameterGroupOutput { - s.DBParameterGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSecurityGroupMessage -type CreateDBSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // The description for the DB security group. - // - // DBSecurityGroupDescription is a required field - DBSecurityGroupDescription *string `type:"string" required:"true"` - - // The name for the DB security group. This value is stored as a lowercase string. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // * Must not be "Default" - // - // Example: mysecuritygroup - // - // DBSecurityGroupName is a required field - DBSecurityGroupName *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateDBSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBSecurityGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBSecurityGroupInput"} - if s.DBSecurityGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("DBSecurityGroupDescription")) - } - if s.DBSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBSecurityGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSecurityGroupDescription sets the DBSecurityGroupDescription field's value. -func (s *CreateDBSecurityGroupInput) SetDBSecurityGroupDescription(v string) *CreateDBSecurityGroupInput { - s.DBSecurityGroupDescription = &v - return s -} - -// SetDBSecurityGroupName sets the DBSecurityGroupName field's value. -func (s *CreateDBSecurityGroupInput) SetDBSecurityGroupName(v string) *CreateDBSecurityGroupInput { - s.DBSecurityGroupName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBSecurityGroupInput) SetTags(v []*Tag) *CreateDBSecurityGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSecurityGroupResult -type CreateDBSecurityGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * DescribeDBSecurityGroups - // - // * AuthorizeDBSecurityGroupIngress - // - // * CreateDBSecurityGroup - // - // * RevokeDBSecurityGroupIngress - // - // This data type is used as a response element in the DescribeDBSecurityGroups - // action. - DBSecurityGroup *DBSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateDBSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBSecurityGroupOutput) GoString() string { - return s.String() -} - -// SetDBSecurityGroup sets the DBSecurityGroup field's value. -func (s *CreateDBSecurityGroupOutput) SetDBSecurityGroup(v *DBSecurityGroup) *CreateDBSecurityGroupOutput { - s.DBSecurityGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSnapshotMessage -type CreateDBSnapshotInput struct { - _ struct{} `type:"structure"` - - // The DB instance identifier. This is the unique key that identifies a DB instance. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // The identifier for the DB snapshot. - // - // Constraints: - // - // * Cannot be null, empty, or blank - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-snapshot-id - // - // DBSnapshotIdentifier is a required field - DBSnapshotIdentifier *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateDBSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBSnapshotInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - if s.DBSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *CreateDBSnapshotInput) SetDBInstanceIdentifier(v string) *CreateDBSnapshotInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *CreateDBSnapshotInput) SetDBSnapshotIdentifier(v string) *CreateDBSnapshotInput { - s.DBSnapshotIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBSnapshotInput) SetTags(v []*Tag) *CreateDBSnapshotInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSnapshotResult -type CreateDBSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBSnapshot - // - // * DeleteDBSnapshot - // - // This data type is used as a response element in the DescribeDBSnapshots action. - DBSnapshot *DBSnapshot `type:"structure"` -} - -// String returns the string representation -func (s CreateDBSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBSnapshot sets the DBSnapshot field's value. -func (s *CreateDBSnapshotOutput) SetDBSnapshot(v *DBSnapshot) *CreateDBSnapshotOutput { - s.DBSnapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSubnetGroupMessage -type CreateDBSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The description for the DB subnet group. - // - // DBSubnetGroupDescription is a required field - DBSubnetGroupDescription *string `type:"string" required:"true"` - - // The name for the DB subnet group. This value is stored as a lowercase string. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - // - // DBSubnetGroupName is a required field - DBSubnetGroupName *string `type:"string" required:"true"` - - // The EC2 Subnet IDs for the DB subnet group. - // - // SubnetIds is a required field - SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateDBSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDBSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDBSubnetGroupInput"} - if s.DBSubnetGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("DBSubnetGroupDescription")) - } - if s.DBSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBSubnetGroupName")) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSubnetGroupDescription sets the DBSubnetGroupDescription field's value. -func (s *CreateDBSubnetGroupInput) SetDBSubnetGroupDescription(v string) *CreateDBSubnetGroupInput { - s.DBSubnetGroupDescription = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *CreateDBSubnetGroupInput) SetDBSubnetGroupName(v string) *CreateDBSubnetGroupInput { - s.DBSubnetGroupName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateDBSubnetGroupInput) SetSubnetIds(v []*string) *CreateDBSubnetGroupInput { - s.SubnetIds = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDBSubnetGroupInput) SetTags(v []*Tag) *CreateDBSubnetGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBSubnetGroupResult -type CreateDBSubnetGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBSubnetGroup - // - // * ModifyDBSubnetGroup - // - // * DescribeDBSubnetGroups - // - // * DeleteDBSubnetGroup - // - // This data type is used as a response element in the DescribeDBSubnetGroups - // action. - DBSubnetGroup *DBSubnetGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateDBSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDBSubnetGroupOutput) GoString() string { - return s.String() -} - -// SetDBSubnetGroup sets the DBSubnetGroup field's value. -func (s *CreateDBSubnetGroupOutput) SetDBSubnetGroup(v *DBSubnetGroup) *CreateDBSubnetGroupOutput { - s.DBSubnetGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateEventSubscriptionMessage -type CreateEventSubscriptionInput struct { - _ struct{} `type:"structure"` - - // A Boolean value; set to true to activate the subscription, set to false to - // create the subscription but not active it. - Enabled *bool `type:"boolean"` - - // A list of event categories for a SourceType that you want to subscribe to. - // You can see a list of the categories for a given SourceType in the Events - // (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) - // topic in the Amazon RDS User Guide or by using the DescribeEventCategories - // action. - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // The Amazon Resource Name (ARN) of the SNS topic created for event notification. - // The ARN is created by Amazon SNS when you create a topic and subscribe to - // it. - // - // SnsTopicArn is a required field - SnsTopicArn *string `type:"string" required:"true"` - - // The list of identifiers of the event sources for which events will be returned. - // If not specified, then all sources are included in the response. An identifier - // must begin with a letter and must contain only ASCII letters, digits, and - // hyphens; it cannot end with a hyphen or contain two consecutive hyphens. - // - // Constraints: - // - // * If SourceIds are supplied, SourceType must also be provided. - // - // * If the source type is a DB instance, then a DBInstanceIdentifier must - // be supplied. - // - // * If the source type is a DB security group, a DBSecurityGroupName must - // be supplied. - // - // * If the source type is a DB parameter group, a DBParameterGroupName must - // be supplied. - // - // * If the source type is a DB snapshot, a DBSnapshotIdentifier must be - // supplied. - SourceIds []*string `locationNameList:"SourceId" type:"list"` - - // The type of source that will be generating the events. For example, if you - // want to be notified of events generated by a DB instance, you would set this - // parameter to db-instance. if this value is not specified, all events are - // returned. - // - // Valid values: db-instance | db-cluster | db-parameter-group | db-security-group - // | db-snapshot | db-cluster-snapshot - SourceType *string `type:"string"` - - // The name of the subscription. - // - // Constraints: The name must be less than 255 characters. - // - // SubscriptionName is a required field - SubscriptionName *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateEventSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEventSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEventSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEventSubscriptionInput"} - if s.SnsTopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("SnsTopicArn")) - } - if s.SubscriptionName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *CreateEventSubscriptionInput) SetEnabled(v bool) *CreateEventSubscriptionInput { - s.Enabled = &v - return s -} - -// SetEventCategories sets the EventCategories field's value. -func (s *CreateEventSubscriptionInput) SetEventCategories(v []*string) *CreateEventSubscriptionInput { - s.EventCategories = v - return s -} - -// SetSnsTopicArn sets the SnsTopicArn field's value. -func (s *CreateEventSubscriptionInput) SetSnsTopicArn(v string) *CreateEventSubscriptionInput { - s.SnsTopicArn = &v - return s -} - -// SetSourceIds sets the SourceIds field's value. -func (s *CreateEventSubscriptionInput) SetSourceIds(v []*string) *CreateEventSubscriptionInput { - s.SourceIds = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *CreateEventSubscriptionInput) SetSourceType(v string) *CreateEventSubscriptionInput { - s.SourceType = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *CreateEventSubscriptionInput) SetSubscriptionName(v string) *CreateEventSubscriptionInput { - s.SubscriptionName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateEventSubscriptionInput) SetTags(v []*Tag) *CreateEventSubscriptionInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateEventSubscriptionResult -type CreateEventSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful invocation of the DescribeEventSubscriptions - // action. - EventSubscription *EventSubscription `type:"structure"` -} - -// String returns the string representation -func (s CreateEventSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEventSubscriptionOutput) GoString() string { - return s.String() -} - -// SetEventSubscription sets the EventSubscription field's value. -func (s *CreateEventSubscriptionOutput) SetEventSubscription(v *EventSubscription) *CreateEventSubscriptionOutput { - s.EventSubscription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateOptionGroupMessage -type CreateOptionGroupInput struct { - _ struct{} `type:"structure"` - - // Specifies the name of the engine that this option group should be associated - // with. - // - // EngineName is a required field - EngineName *string `type:"string" required:"true"` - - // Specifies the major version of the engine that this option group should be - // associated with. - // - // MajorEngineVersion is a required field - MajorEngineVersion *string `type:"string" required:"true"` - - // The description of the option group. - // - // OptionGroupDescription is a required field - OptionGroupDescription *string `type:"string" required:"true"` - - // Specifies the name of the option group to be created. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: myoptiongroup - // - // OptionGroupName is a required field - OptionGroupName *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateOptionGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateOptionGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateOptionGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateOptionGroupInput"} - if s.EngineName == nil { - invalidParams.Add(request.NewErrParamRequired("EngineName")) - } - if s.MajorEngineVersion == nil { - invalidParams.Add(request.NewErrParamRequired("MajorEngineVersion")) - } - if s.OptionGroupDescription == nil { - invalidParams.Add(request.NewErrParamRequired("OptionGroupDescription")) - } - if s.OptionGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("OptionGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEngineName sets the EngineName field's value. -func (s *CreateOptionGroupInput) SetEngineName(v string) *CreateOptionGroupInput { - s.EngineName = &v - return s -} - -// SetMajorEngineVersion sets the MajorEngineVersion field's value. -func (s *CreateOptionGroupInput) SetMajorEngineVersion(v string) *CreateOptionGroupInput { - s.MajorEngineVersion = &v - return s -} - -// SetOptionGroupDescription sets the OptionGroupDescription field's value. -func (s *CreateOptionGroupInput) SetOptionGroupDescription(v string) *CreateOptionGroupInput { - s.OptionGroupDescription = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *CreateOptionGroupInput) SetOptionGroupName(v string) *CreateOptionGroupInput { - s.OptionGroupName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateOptionGroupInput) SetTags(v []*Tag) *CreateOptionGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateOptionGroupResult -type CreateOptionGroupOutput struct { - _ struct{} `type:"structure"` - - OptionGroup *OptionGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateOptionGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateOptionGroupOutput) GoString() string { - return s.String() -} - -// SetOptionGroup sets the OptionGroup field's value. -func (s *CreateOptionGroupOutput) SetOptionGroup(v *OptionGroup) *CreateOptionGroupOutput { - s.OptionGroup = v - return s -} - -// Contains the result of a successful invocation of the following actions: -// -// * CreateDBCluster -// -// * DeleteDBCluster -// -// * FailoverDBCluster -// -// * ModifyDBCluster -// -// * RestoreDBClusterFromSnapshot -// -// * RestoreDBClusterToPointInTime -// -// This data type is used as a response element in the DescribeDBClusters action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBCluster -type DBCluster struct { - _ struct{} `type:"structure"` - - // Specifies the allocated storage size in gigabytes (GB). - AllocatedStorage *int64 `type:"integer"` - - // Provides a list of the AWS Identity and Access Management (IAM) roles that - // are associated with the DB cluster. IAM roles that are associated with a - // DB cluster grant permission for the DB cluster to access other AWS services - // on your behalf. - AssociatedRoles []*DBClusterRole `locationNameList:"DBClusterRole" type:"list"` - - // Provides the list of EC2 Availability Zones that instances in the DB cluster - // can be created in. - AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - - // Specifies the number of days for which automatic DB snapshots are retained. - BackupRetentionPeriod *int64 `type:"integer"` - - // If present, specifies the name of the character set that this cluster is - // associated with. - CharacterSetName *string `type:"string"` - - // Specifies the time when the DB cluster was created, in Universal Coordinated - // Time (UTC). - ClusterCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Resource Name (ARN) for the DB cluster. - DBClusterArn *string `type:"string"` - - // Contains a user-supplied DB cluster identifier. This identifier is the unique - // key that identifies a DB cluster. - DBClusterIdentifier *string `type:"string"` - - // Provides the list of instances that make up the DB cluster. - DBClusterMembers []*DBClusterMember `locationNameList:"DBClusterMember" type:"list"` - - // Provides the list of option group memberships for this DB cluster. - DBClusterOptionGroupMemberships []*DBClusterOptionGroupStatus `locationNameList:"DBClusterOptionGroup" type:"list"` - - // Specifies the name of the DB cluster parameter group for the DB cluster. - DBClusterParameterGroup *string `type:"string"` - - // Specifies information on the subnet group associated with the DB cluster, - // including the name, description, and subnets in the subnet group. - DBSubnetGroup *string `type:"string"` - - // Contains the name of the initial database of this DB cluster that was provided - // at create time, if one was specified when the DB cluster was created. This - // same name is returned for the life of the DB cluster. - DatabaseName *string `type:"string"` - - // The region-unique, immutable identifier for the DB cluster. This identifier - // is found in AWS CloudTrail log entries whenever the KMS key for the DB cluster - // is accessed. - DbClusterResourceId *string `type:"string"` - - // Specifies the earliest time to which a database can be restored with point-in-time - // restore. - EarliestRestorableTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the connection endpoint for the primary instance of the DB cluster. - Endpoint *string `type:"string"` - - // Provides the name of the database engine to be used for this DB cluster. - Engine *string `type:"string"` - - // Indicates the database engine version. - EngineVersion *string `type:"string"` - - // Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. - HostedZoneId *string `type:"string"` - - // If StorageEncrypted is true, the KMS key identifier for the encrypted DB - // cluster. - KmsKeyId *string `type:"string"` - - // Specifies the latest time to which a database can be restored with point-in-time - // restore. - LatestRestorableTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Contains the master username for the DB cluster. - MasterUsername *string `type:"string"` - - // Specifies whether the DB cluster has instances in multiple Availability Zones. - MultiAZ *bool `type:"boolean"` - - // Specifies the progress of the operation as a percentage. - PercentProgress *string `type:"string"` - - // Specifies the port that the database engine is listening on. - Port *int64 `type:"integer"` - - // Specifies the daily time range during which automated backups are created - // if automated backups are enabled, as determined by the BackupRetentionPeriod. - PreferredBackupWindow *string `type:"string"` - - // Specifies the weekly time range during which system maintenance can occur, - // in Universal Coordinated Time (UTC). - PreferredMaintenanceWindow *string `type:"string"` - - // Contains one or more identifiers of the Read Replicas associated with this - // DB cluster. - ReadReplicaIdentifiers []*string `locationNameList:"ReadReplicaIdentifier" type:"list"` - - // The reader endpoint for the DB cluster. The reader endpoint for a DB cluster - // load-balances connections across the Aurora Replicas that are available in - // a DB cluster. As clients request new connections to the reader endpoint, - // Aurora distributes the connection requests among the Aurora Replicas in the - // DB cluster. This functionality can help balance your read workload across - // multiple Aurora Replicas in your DB cluster. - // - // If a failover occurs, and the Aurora Replica that you are connected to is - // promoted to be the primary instance, your connection will be dropped. To - // continue sending your read workload to other Aurora Replicas in the cluster, - // you can then recoonect to the reader endpoint. - ReaderEndpoint *string `type:"string"` - - // Contains the identifier of the source DB cluster if this DB cluster is a - // Read Replica. - ReplicationSourceIdentifier *string `type:"string"` - - // Specifies the current state of this DB cluster. - Status *string `type:"string"` - - // Specifies whether the DB cluster is encrypted. - StorageEncrypted *bool `type:"boolean"` - - // Provides a list of VPC security groups that the DB cluster belongs to. - VpcSecurityGroups []*VpcSecurityGroupMembership `locationNameList:"VpcSecurityGroupMembership" type:"list"` -} - -// String returns the string representation -func (s DBCluster) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBCluster) GoString() string { - return s.String() -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *DBCluster) SetAllocatedStorage(v int64) *DBCluster { - s.AllocatedStorage = &v - return s -} - -// SetAssociatedRoles sets the AssociatedRoles field's value. -func (s *DBCluster) SetAssociatedRoles(v []*DBClusterRole) *DBCluster { - s.AssociatedRoles = v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DBCluster) SetAvailabilityZones(v []*string) *DBCluster { - s.AvailabilityZones = v - return s -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *DBCluster) SetBackupRetentionPeriod(v int64) *DBCluster { - s.BackupRetentionPeriod = &v - return s -} - -// SetCharacterSetName sets the CharacterSetName field's value. -func (s *DBCluster) SetCharacterSetName(v string) *DBCluster { - s.CharacterSetName = &v - return s -} - -// SetClusterCreateTime sets the ClusterCreateTime field's value. -func (s *DBCluster) SetClusterCreateTime(v time.Time) *DBCluster { - s.ClusterCreateTime = &v - return s -} - -// SetDBClusterArn sets the DBClusterArn field's value. -func (s *DBCluster) SetDBClusterArn(v string) *DBCluster { - s.DBClusterArn = &v - return s -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *DBCluster) SetDBClusterIdentifier(v string) *DBCluster { - s.DBClusterIdentifier = &v - return s -} - -// SetDBClusterMembers sets the DBClusterMembers field's value. -func (s *DBCluster) SetDBClusterMembers(v []*DBClusterMember) *DBCluster { - s.DBClusterMembers = v - return s -} - -// SetDBClusterOptionGroupMemberships sets the DBClusterOptionGroupMemberships field's value. -func (s *DBCluster) SetDBClusterOptionGroupMemberships(v []*DBClusterOptionGroupStatus) *DBCluster { - s.DBClusterOptionGroupMemberships = v - return s -} - -// SetDBClusterParameterGroup sets the DBClusterParameterGroup field's value. -func (s *DBCluster) SetDBClusterParameterGroup(v string) *DBCluster { - s.DBClusterParameterGroup = &v - return s -} - -// SetDBSubnetGroup sets the DBSubnetGroup field's value. -func (s *DBCluster) SetDBSubnetGroup(v string) *DBCluster { - s.DBSubnetGroup = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *DBCluster) SetDatabaseName(v string) *DBCluster { - s.DatabaseName = &v - return s -} - -// SetDbClusterResourceId sets the DbClusterResourceId field's value. -func (s *DBCluster) SetDbClusterResourceId(v string) *DBCluster { - s.DbClusterResourceId = &v - return s -} - -// SetEarliestRestorableTime sets the EarliestRestorableTime field's value. -func (s *DBCluster) SetEarliestRestorableTime(v time.Time) *DBCluster { - s.EarliestRestorableTime = &v - return s -} - -// SetEndpoint sets the Endpoint field's value. -func (s *DBCluster) SetEndpoint(v string) *DBCluster { - s.Endpoint = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *DBCluster) SetEngine(v string) *DBCluster { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *DBCluster) SetEngineVersion(v string) *DBCluster { - s.EngineVersion = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *DBCluster) SetHostedZoneId(v string) *DBCluster { - s.HostedZoneId = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *DBCluster) SetKmsKeyId(v string) *DBCluster { - s.KmsKeyId = &v - return s -} - -// SetLatestRestorableTime sets the LatestRestorableTime field's value. -func (s *DBCluster) SetLatestRestorableTime(v time.Time) *DBCluster { - s.LatestRestorableTime = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *DBCluster) SetMasterUsername(v string) *DBCluster { - s.MasterUsername = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *DBCluster) SetMultiAZ(v bool) *DBCluster { - s.MultiAZ = &v - return s -} - -// SetPercentProgress sets the PercentProgress field's value. -func (s *DBCluster) SetPercentProgress(v string) *DBCluster { - s.PercentProgress = &v - return s -} - -// SetPort sets the Port field's value. -func (s *DBCluster) SetPort(v int64) *DBCluster { - s.Port = &v - return s -} - -// SetPreferredBackupWindow sets the PreferredBackupWindow field's value. -func (s *DBCluster) SetPreferredBackupWindow(v string) *DBCluster { - s.PreferredBackupWindow = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *DBCluster) SetPreferredMaintenanceWindow(v string) *DBCluster { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetReadReplicaIdentifiers sets the ReadReplicaIdentifiers field's value. -func (s *DBCluster) SetReadReplicaIdentifiers(v []*string) *DBCluster { - s.ReadReplicaIdentifiers = v - return s -} - -// SetReaderEndpoint sets the ReaderEndpoint field's value. -func (s *DBCluster) SetReaderEndpoint(v string) *DBCluster { - s.ReaderEndpoint = &v - return s -} - -// SetReplicationSourceIdentifier sets the ReplicationSourceIdentifier field's value. -func (s *DBCluster) SetReplicationSourceIdentifier(v string) *DBCluster { - s.ReplicationSourceIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DBCluster) SetStatus(v string) *DBCluster { - s.Status = &v - return s -} - -// SetStorageEncrypted sets the StorageEncrypted field's value. -func (s *DBCluster) SetStorageEncrypted(v bool) *DBCluster { - s.StorageEncrypted = &v - return s -} - -// SetVpcSecurityGroups sets the VpcSecurityGroups field's value. -func (s *DBCluster) SetVpcSecurityGroups(v []*VpcSecurityGroupMembership) *DBCluster { - s.VpcSecurityGroups = v - return s -} - -// Contains information about an instance that is part of a DB cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterMember -type DBClusterMember struct { - _ struct{} `type:"structure"` - - // Specifies the status of the DB cluster parameter group for this member of - // the DB cluster. - DBClusterParameterGroupStatus *string `type:"string"` - - // Specifies the instance identifier for this member of the DB cluster. - DBInstanceIdentifier *string `type:"string"` - - // Value that is true if the cluster member is the primary instance for the - // DB cluster and false otherwise. - IsClusterWriter *bool `type:"boolean"` - - // A value that specifies the order in which an Aurora Replica is promoted to - // the primary instance after a failure of the existing primary instance. For - // more information, see Fault Tolerance for an Aurora DB Cluster (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html#Aurora.Managing.FaultTolerance). - PromotionTier *int64 `type:"integer"` -} - -// String returns the string representation -func (s DBClusterMember) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBClusterMember) GoString() string { - return s.String() -} - -// SetDBClusterParameterGroupStatus sets the DBClusterParameterGroupStatus field's value. -func (s *DBClusterMember) SetDBClusterParameterGroupStatus(v string) *DBClusterMember { - s.DBClusterParameterGroupStatus = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *DBClusterMember) SetDBInstanceIdentifier(v string) *DBClusterMember { - s.DBInstanceIdentifier = &v - return s -} - -// SetIsClusterWriter sets the IsClusterWriter field's value. -func (s *DBClusterMember) SetIsClusterWriter(v bool) *DBClusterMember { - s.IsClusterWriter = &v - return s -} - -// SetPromotionTier sets the PromotionTier field's value. -func (s *DBClusterMember) SetPromotionTier(v int64) *DBClusterMember { - s.PromotionTier = &v - return s -} - -// Contains status information for a DB cluster option group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterOptionGroupStatus -type DBClusterOptionGroupStatus struct { - _ struct{} `type:"structure"` - - // Specifies the name of the DB cluster option group. - DBClusterOptionGroupName *string `type:"string"` - - // Specifies the status of the DB cluster option group. - Status *string `type:"string"` -} - -// String returns the string representation -func (s DBClusterOptionGroupStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBClusterOptionGroupStatus) GoString() string { - return s.String() -} - -// SetDBClusterOptionGroupName sets the DBClusterOptionGroupName field's value. -func (s *DBClusterOptionGroupStatus) SetDBClusterOptionGroupName(v string) *DBClusterOptionGroupStatus { - s.DBClusterOptionGroupName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DBClusterOptionGroupStatus) SetStatus(v string) *DBClusterOptionGroupStatus { - s.Status = &v - return s -} - -// Contains the result of a successful invocation of the CreateDBClusterParameterGroup -// or CopyDBClusterParameterGroup action. -// -// This data type is used as a request parameter in the DeleteDBClusterParameterGroup -// action, and as a response element in the DescribeDBClusterParameterGroups -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterParameterGroup -type DBClusterParameterGroup struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the DB cluster parameter group. - DBClusterParameterGroupArn *string `type:"string"` - - // Provides the name of the DB cluster parameter group. - DBClusterParameterGroupName *string `type:"string"` - - // Provides the name of the DB parameter group family that this DB cluster parameter - // group is compatible with. - DBParameterGroupFamily *string `type:"string"` - - // Provides the customer-specified description for this DB cluster parameter - // group. - Description *string `type:"string"` -} - -// String returns the string representation -func (s DBClusterParameterGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBClusterParameterGroup) GoString() string { - return s.String() -} - -// SetDBClusterParameterGroupArn sets the DBClusterParameterGroupArn field's value. -func (s *DBClusterParameterGroup) SetDBClusterParameterGroupArn(v string) *DBClusterParameterGroup { - s.DBClusterParameterGroupArn = &v - return s -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *DBClusterParameterGroup) SetDBClusterParameterGroupName(v string) *DBClusterParameterGroup { - s.DBClusterParameterGroupName = &v - return s -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *DBClusterParameterGroup) SetDBParameterGroupFamily(v string) *DBClusterParameterGroup { - s.DBParameterGroupFamily = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DBClusterParameterGroup) SetDescription(v string) *DBClusterParameterGroup { - s.Description = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterParameterGroupNameMessage -type DBClusterParameterGroupNameMessage struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster parameter group. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // This value is stored as a lowercase string. - DBClusterParameterGroupName *string `type:"string"` -} - -// String returns the string representation -func (s DBClusterParameterGroupNameMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBClusterParameterGroupNameMessage) GoString() string { - return s.String() -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *DBClusterParameterGroupNameMessage) SetDBClusterParameterGroupName(v string) *DBClusterParameterGroupNameMessage { - s.DBClusterParameterGroupName = &v - return s -} - -// Describes an AWS Identity and Access Management (IAM) role that is associated -// with a DB cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterRole -type DBClusterRole struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM role that is associated with the - // DB cluster. - RoleArn *string `type:"string"` - - // Describes the state of association between the IAM role and the DB cluster. - // The Status property returns one of the following values: - // - // * ACTIVE - the IAM role ARN is associated with the DB cluster and can - // be used to access other AWS services on your behalf. - // - // * PENDING - the IAM role ARN is being associated with the DB cluster. - // - // * INVALID - the IAM role ARN is associated with the DB cluster, but the - // DB cluster is unable to assume the IAM role in order to access other AWS - // services on your behalf. - Status *string `type:"string"` -} - -// String returns the string representation -func (s DBClusterRole) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBClusterRole) GoString() string { - return s.String() -} - -// SetRoleArn sets the RoleArn field's value. -func (s *DBClusterRole) SetRoleArn(v string) *DBClusterRole { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DBClusterRole) SetStatus(v string) *DBClusterRole { - s.Status = &v - return s -} - -// Contains the result of a successful invocation of the following actions: -// -// * CreateDBClusterSnapshot -// -// * DeleteDBClusterSnapshot -// -// This data type is used as a response element in the DescribeDBClusterSnapshots -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterSnapshot -type DBClusterSnapshot struct { - _ struct{} `type:"structure"` - - // Specifies the allocated storage size in gigabytes (GB). - AllocatedStorage *int64 `type:"integer"` - - // Provides the list of EC2 Availability Zones that instances in the DB cluster - // snapshot can be restored in. - AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - - // Specifies the time when the DB cluster was created, in Universal Coordinated - // Time (UTC). - ClusterCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the DB cluster identifier of the DB cluster that this DB cluster - // snapshot was created from. - DBClusterIdentifier *string `type:"string"` - - // The Amazon Resource Name (ARN) for the DB cluster snapshot. - DBClusterSnapshotArn *string `type:"string"` - - // Specifies the identifier for the DB cluster snapshot. - DBClusterSnapshotIdentifier *string `type:"string"` - - // Specifies the name of the database engine. - Engine *string `type:"string"` - - // Provides the version of the database engine for this DB cluster snapshot. - EngineVersion *string `type:"string"` - - // If StorageEncrypted is true, the KMS key identifier for the encrypted DB - // cluster snapshot. - KmsKeyId *string `type:"string"` - - // Provides the license model information for this DB cluster snapshot. - LicenseModel *string `type:"string"` - - // Provides the master username for the DB cluster snapshot. - MasterUsername *string `type:"string"` - - // Specifies the percentage of the estimated data that has been transferred. - PercentProgress *int64 `type:"integer"` - - // Specifies the port that the DB cluster was listening on at the time of the - // snapshot. - Port *int64 `type:"integer"` - - // Provides the time when the snapshot was taken, in Universal Coordinated Time - // (UTC). - SnapshotCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Provides the type of the DB cluster snapshot. - SnapshotType *string `type:"string"` - - // Specifies the status of this DB cluster snapshot. - Status *string `type:"string"` - - // Specifies whether the DB cluster snapshot is encrypted. - StorageEncrypted *bool `type:"boolean"` - - // Provides the VPC ID associated with the DB cluster snapshot. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s DBClusterSnapshot) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBClusterSnapshot) GoString() string { - return s.String() -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *DBClusterSnapshot) SetAllocatedStorage(v int64) *DBClusterSnapshot { - s.AllocatedStorage = &v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DBClusterSnapshot) SetAvailabilityZones(v []*string) *DBClusterSnapshot { - s.AvailabilityZones = v - return s -} - -// SetClusterCreateTime sets the ClusterCreateTime field's value. -func (s *DBClusterSnapshot) SetClusterCreateTime(v time.Time) *DBClusterSnapshot { - s.ClusterCreateTime = &v - return s -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *DBClusterSnapshot) SetDBClusterIdentifier(v string) *DBClusterSnapshot { - s.DBClusterIdentifier = &v - return s -} - -// SetDBClusterSnapshotArn sets the DBClusterSnapshotArn field's value. -func (s *DBClusterSnapshot) SetDBClusterSnapshotArn(v string) *DBClusterSnapshot { - s.DBClusterSnapshotArn = &v - return s -} - -// SetDBClusterSnapshotIdentifier sets the DBClusterSnapshotIdentifier field's value. -func (s *DBClusterSnapshot) SetDBClusterSnapshotIdentifier(v string) *DBClusterSnapshot { - s.DBClusterSnapshotIdentifier = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *DBClusterSnapshot) SetEngine(v string) *DBClusterSnapshot { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *DBClusterSnapshot) SetEngineVersion(v string) *DBClusterSnapshot { - s.EngineVersion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *DBClusterSnapshot) SetKmsKeyId(v string) *DBClusterSnapshot { - s.KmsKeyId = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *DBClusterSnapshot) SetLicenseModel(v string) *DBClusterSnapshot { - s.LicenseModel = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *DBClusterSnapshot) SetMasterUsername(v string) *DBClusterSnapshot { - s.MasterUsername = &v - return s -} - -// SetPercentProgress sets the PercentProgress field's value. -func (s *DBClusterSnapshot) SetPercentProgress(v int64) *DBClusterSnapshot { - s.PercentProgress = &v - return s -} - -// SetPort sets the Port field's value. -func (s *DBClusterSnapshot) SetPort(v int64) *DBClusterSnapshot { - s.Port = &v - return s -} - -// SetSnapshotCreateTime sets the SnapshotCreateTime field's value. -func (s *DBClusterSnapshot) SetSnapshotCreateTime(v time.Time) *DBClusterSnapshot { - s.SnapshotCreateTime = &v - return s -} - -// SetSnapshotType sets the SnapshotType field's value. -func (s *DBClusterSnapshot) SetSnapshotType(v string) *DBClusterSnapshot { - s.SnapshotType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DBClusterSnapshot) SetStatus(v string) *DBClusterSnapshot { - s.Status = &v - return s -} - -// SetStorageEncrypted sets the StorageEncrypted field's value. -func (s *DBClusterSnapshot) SetStorageEncrypted(v bool) *DBClusterSnapshot { - s.StorageEncrypted = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DBClusterSnapshot) SetVpcId(v string) *DBClusterSnapshot { - s.VpcId = &v - return s -} - -// Contains the name and values of a manual DB cluster snapshot attribute. -// -// Manual DB cluster snapshot attributes are used to authorize other AWS accounts -// to restore a manual DB cluster snapshot. For more information, see the ModifyDBClusterSnapshotAttribute -// API action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterSnapshotAttribute -type DBClusterSnapshotAttribute struct { - _ struct{} `type:"structure"` - - // The name of the manual DB cluster snapshot attribute. - // - // The attribute named restore refers to the list of AWS accounts that have - // permission to copy or restore the manual DB cluster snapshot. For more information, - // see the ModifyDBClusterSnapshotAttribute API action. - AttributeName *string `type:"string"` - - // The value(s) for the manual DB cluster snapshot attribute. - // - // If the AttributeName field is set to restore, then this element returns a - // list of IDs of the AWS accounts that are authorized to copy or restore the - // manual DB cluster snapshot. If a value of all is in the list, then the manual - // DB cluster snapshot is public and available for any AWS account to copy or - // restore. - AttributeValues []*string `locationNameList:"AttributeValue" type:"list"` -} - -// String returns the string representation -func (s DBClusterSnapshotAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBClusterSnapshotAttribute) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *DBClusterSnapshotAttribute) SetAttributeName(v string) *DBClusterSnapshotAttribute { - s.AttributeName = &v - return s -} - -// SetAttributeValues sets the AttributeValues field's value. -func (s *DBClusterSnapshotAttribute) SetAttributeValues(v []*string) *DBClusterSnapshotAttribute { - s.AttributeValues = v - return s -} - -// Contains the results of a successful call to the DescribeDBClusterSnapshotAttributes -// API action. -// -// Manual DB cluster snapshot attributes are used to authorize other AWS accounts -// to copy or restore a manual DB cluster snapshot. For more information, see -// the ModifyDBClusterSnapshotAttribute API action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterSnapshotAttributesResult -type DBClusterSnapshotAttributesResult struct { - _ struct{} `type:"structure"` - - // The list of attributes and values for the manual DB cluster snapshot. - DBClusterSnapshotAttributes []*DBClusterSnapshotAttribute `locationNameList:"DBClusterSnapshotAttribute" type:"list"` - - // The identifier of the manual DB cluster snapshot that the attributes apply - // to. - DBClusterSnapshotIdentifier *string `type:"string"` -} - -// String returns the string representation -func (s DBClusterSnapshotAttributesResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBClusterSnapshotAttributesResult) GoString() string { - return s.String() -} - -// SetDBClusterSnapshotAttributes sets the DBClusterSnapshotAttributes field's value. -func (s *DBClusterSnapshotAttributesResult) SetDBClusterSnapshotAttributes(v []*DBClusterSnapshotAttribute) *DBClusterSnapshotAttributesResult { - s.DBClusterSnapshotAttributes = v - return s -} - -// SetDBClusterSnapshotIdentifier sets the DBClusterSnapshotIdentifier field's value. -func (s *DBClusterSnapshotAttributesResult) SetDBClusterSnapshotIdentifier(v string) *DBClusterSnapshotAttributesResult { - s.DBClusterSnapshotIdentifier = &v - return s -} - -// This data type is used as a response element in the action DescribeDBEngineVersions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBEngineVersion -type DBEngineVersion struct { - _ struct{} `type:"structure"` - - // The description of the database engine. - DBEngineDescription *string `type:"string"` - - // The description of the database engine version. - DBEngineVersionDescription *string `type:"string"` - - // The name of the DB parameter group family for the database engine. - DBParameterGroupFamily *string `type:"string"` - - // The default character set for new instances of this engine version, if the - // CharacterSetName parameter of the CreateDBInstance API is not specified. - DefaultCharacterSet *CharacterSet `type:"structure"` - - // The name of the database engine. - Engine *string `type:"string"` - - // The version number of the database engine. - EngineVersion *string `type:"string"` - - // A list of the character sets supported by this engine for the CharacterSetName - // parameter of the CreateDBInstance action. - SupportedCharacterSets []*CharacterSet `locationNameList:"CharacterSet" type:"list"` - - // A list of the time zones supported by this engine for the Timezone parameter - // of the CreateDBInstance action. - SupportedTimezones []*Timezone `locationNameList:"Timezone" type:"list"` - - // A list of engine versions that this database engine version can be upgraded - // to. - ValidUpgradeTarget []*UpgradeTarget `locationNameList:"UpgradeTarget" type:"list"` -} - -// String returns the string representation -func (s DBEngineVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBEngineVersion) GoString() string { - return s.String() -} - -// SetDBEngineDescription sets the DBEngineDescription field's value. -func (s *DBEngineVersion) SetDBEngineDescription(v string) *DBEngineVersion { - s.DBEngineDescription = &v - return s -} - -// SetDBEngineVersionDescription sets the DBEngineVersionDescription field's value. -func (s *DBEngineVersion) SetDBEngineVersionDescription(v string) *DBEngineVersion { - s.DBEngineVersionDescription = &v - return s -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *DBEngineVersion) SetDBParameterGroupFamily(v string) *DBEngineVersion { - s.DBParameterGroupFamily = &v - return s -} - -// SetDefaultCharacterSet sets the DefaultCharacterSet field's value. -func (s *DBEngineVersion) SetDefaultCharacterSet(v *CharacterSet) *DBEngineVersion { - s.DefaultCharacterSet = v - return s -} - -// SetEngine sets the Engine field's value. -func (s *DBEngineVersion) SetEngine(v string) *DBEngineVersion { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *DBEngineVersion) SetEngineVersion(v string) *DBEngineVersion { - s.EngineVersion = &v - return s -} - -// SetSupportedCharacterSets sets the SupportedCharacterSets field's value. -func (s *DBEngineVersion) SetSupportedCharacterSets(v []*CharacterSet) *DBEngineVersion { - s.SupportedCharacterSets = v - return s -} - -// SetSupportedTimezones sets the SupportedTimezones field's value. -func (s *DBEngineVersion) SetSupportedTimezones(v []*Timezone) *DBEngineVersion { - s.SupportedTimezones = v - return s -} - -// SetValidUpgradeTarget sets the ValidUpgradeTarget field's value. -func (s *DBEngineVersion) SetValidUpgradeTarget(v []*UpgradeTarget) *DBEngineVersion { - s.ValidUpgradeTarget = v - return s -} - -// Contains the result of a successful invocation of the following actions: -// -// * CreateDBInstance -// -// * DeleteDBInstance -// -// * ModifyDBInstance -// -// This data type is used as a response element in the DescribeDBInstances action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBInstance -type DBInstance struct { - _ struct{} `type:"structure"` - - // Specifies the allocated storage size specified in gigabytes. - AllocatedStorage *int64 `type:"integer"` - - // Indicates that minor version patches are applied automatically. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // Specifies the name of the Availability Zone the DB instance is located in. - AvailabilityZone *string `type:"string"` - - // Specifies the number of days for which automatic DB snapshots are retained. - BackupRetentionPeriod *int64 `type:"integer"` - - // The identifier of the CA certificate for this DB instance. - CACertificateIdentifier *string `type:"string"` - - // If present, specifies the name of the character set that this instance is - // associated with. - CharacterSetName *string `type:"string"` - - // Specifies whether tags are copied from the DB instance to snapshots of the - // DB instance. - CopyTagsToSnapshot *bool `type:"boolean"` - - // If the DB instance is a member of a DB cluster, contains the name of the - // DB cluster that the DB instance is a member of. - DBClusterIdentifier *string `type:"string"` - - // The Amazon Resource Name (ARN) for the DB instance. - DBInstanceArn *string `type:"string"` - - // Contains the name of the compute and memory capacity class of the DB instance. - DBInstanceClass *string `type:"string"` - - // Contains a user-supplied database identifier. This identifier is the unique - // key that identifies a DB instance. - DBInstanceIdentifier *string `type:"string"` - - // Specifies the current state of this database. - DBInstanceStatus *string `type:"string"` - - // The meaning of this parameter differs according to the database engine you - // use. For example, this value returns MySQL, MariaDB, or PostgreSQL information - // when returning values from CreateDBInstanceReadReplica since Read Replicas - // are only supported for these engines. - // - // MySQL, MariaDB, SQL Server, PostgreSQL, Amazon Aurora - // - // Contains the name of the initial database of this instance that was provided - // at create time, if one was specified when the DB instance was created. This - // same name is returned for the life of the DB instance. - // - // Type: String - // - // Oracle - // - // Contains the Oracle System ID (SID) of the created DB instance. Not shown - // when the returned parameters do not apply to an Oracle DB instance. - DBName *string `type:"string"` - - // Provides the list of DB parameter groups applied to this DB instance. - DBParameterGroups []*DBParameterGroupStatus `locationNameList:"DBParameterGroup" type:"list"` - - // Provides List of DB security group elements containing only DBSecurityGroup.Name - // and DBSecurityGroup.Status subelements. - DBSecurityGroups []*DBSecurityGroupMembership `locationNameList:"DBSecurityGroup" type:"list"` - - // Specifies information on the subnet group associated with the DB instance, - // including the name, description, and subnets in the subnet group. - DBSubnetGroup *DBSubnetGroup `type:"structure"` - - // Specifies the port that the DB instance listens on. If the DB instance is - // part of a DB cluster, this can be a different port than the DB cluster port. - DbInstancePort *int64 `type:"integer"` - - // The region-unique, immutable identifier for the DB instance. This identifier - // is found in AWS CloudTrail log entries whenever the KMS key for the DB instance - // is accessed. - DbiResourceId *string `type:"string"` - - // The Active Directory Domain membership records associated with the DB instance. - DomainMemberships []*DomainMembership `locationNameList:"DomainMembership" type:"list"` - - // Specifies the connection endpoint. - Endpoint *Endpoint `type:"structure"` - - // Provides the name of the database engine to be used for this DB instance. - Engine *string `type:"string"` - - // Indicates the database engine version. - EngineVersion *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log stream that - // receives the Enhanced Monitoring metrics data for the DB instance. - EnhancedMonitoringResourceArn *string `type:"string"` - - // Provides the date and time the DB instance was created. - InstanceCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the Provisioned IOPS (I/O operations per second) value. - Iops *int64 `type:"integer"` - - // If StorageEncrypted is true, the KMS key identifier for the encrypted DB - // instance. - KmsKeyId *string `type:"string"` - - // Specifies the latest time to which a database can be restored with point-in-time - // restore. - LatestRestorableTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // License model information for this DB instance. - LicenseModel *string `type:"string"` - - // Contains the master username for the DB instance. - MasterUsername *string `type:"string"` - - // The interval, in seconds, between points when Enhanced Monitoring metrics - // are collected for the DB instance. - MonitoringInterval *int64 `type:"integer"` - - // The ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics - // to CloudWatch Logs. - MonitoringRoleArn *string `type:"string"` - - // Specifies if the DB instance is a Multi-AZ deployment. - MultiAZ *bool `type:"boolean"` - - // Provides the list of option group memberships for this DB instance. - OptionGroupMemberships []*OptionGroupMembership `locationNameList:"OptionGroupMembership" type:"list"` - - // Specifies that changes to the DB instance are pending. This element is only - // included when changes are pending. Specific changes are identified by subelements. - PendingModifiedValues *PendingModifiedValues `type:"structure"` - - // Specifies the daily time range during which automated backups are created - // if automated backups are enabled, as determined by the BackupRetentionPeriod. - PreferredBackupWindow *string `type:"string"` - - // Specifies the weekly time range during which system maintenance can occur, - // in Universal Coordinated Time (UTC). - PreferredMaintenanceWindow *string `type:"string"` - - // A value that specifies the order in which an Aurora Replica is promoted to - // the primary instance after a failure of the existing primary instance. For - // more information, see Fault Tolerance for an Aurora DB Cluster (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html#Aurora.Managing.FaultTolerance). - PromotionTier *int64 `type:"integer"` - - // Specifies the accessibility options for the DB instance. A value of true - // specifies an Internet-facing instance with a publicly resolvable DNS name, - // which resolves to a public IP address. A value of false specifies an internal - // instance with a DNS name that resolves to a private IP address. - // - // Default: The default behavior varies depending on whether a VPC has been - // requested or not. The following list shows the default behavior in each case. - // - // * Default VPC:true - // - // * VPC:false - // - // If no DB subnet group has been specified as part of the request and the PubliclyAccessible - // value has not been set, the DB instance will be publicly accessible. If a - // specific DB subnet group has been specified as part of the request and the - // PubliclyAccessible value has not been set, the DB instance will be private. - PubliclyAccessible *bool `type:"boolean"` - - // Contains one or more identifiers of Aurora DB clusters that are Read Replicas - // of this DB instance. - ReadReplicaDBClusterIdentifiers []*string `locationNameList:"ReadReplicaDBClusterIdentifier" type:"list"` - - // Contains one or more identifiers of the Read Replicas associated with this - // DB instance. - ReadReplicaDBInstanceIdentifiers []*string `locationNameList:"ReadReplicaDBInstanceIdentifier" type:"list"` - - // Contains the identifier of the source DB instance if this DB instance is - // a Read Replica. - ReadReplicaSourceDBInstanceIdentifier *string `type:"string"` - - // If present, specifies the name of the secondary Availability Zone for a DB - // instance with multi-AZ support. - SecondaryAvailabilityZone *string `type:"string"` - - // The status of a Read Replica. If the instance is not a Read Replica, this - // will be blank. - StatusInfos []*DBInstanceStatusInfo `locationNameList:"DBInstanceStatusInfo" type:"list"` - - // Specifies whether the DB instance is encrypted. - StorageEncrypted *bool `type:"boolean"` - - // Specifies the storage type associated with DB instance. - StorageType *string `type:"string"` - - // The ARN from the key store with which the instance is associated for TDE - // encryption. - TdeCredentialArn *string `type:"string"` - - // The time zone of the DB instance. In most cases, the Timezone element is - // empty. Timezone content appears only for Microsoft SQL Server DB instances - // that were created with a time zone specified. - Timezone *string `type:"string"` - - // Provides a list of VPC security group elements that the DB instance belongs - // to. - VpcSecurityGroups []*VpcSecurityGroupMembership `locationNameList:"VpcSecurityGroupMembership" type:"list"` -} - -// String returns the string representation -func (s DBInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBInstance) GoString() string { - return s.String() -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *DBInstance) SetAllocatedStorage(v int64) *DBInstance { - s.AllocatedStorage = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *DBInstance) SetAutoMinorVersionUpgrade(v bool) *DBInstance { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *DBInstance) SetAvailabilityZone(v string) *DBInstance { - s.AvailabilityZone = &v - return s -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *DBInstance) SetBackupRetentionPeriod(v int64) *DBInstance { - s.BackupRetentionPeriod = &v - return s -} - -// SetCACertificateIdentifier sets the CACertificateIdentifier field's value. -func (s *DBInstance) SetCACertificateIdentifier(v string) *DBInstance { - s.CACertificateIdentifier = &v - return s -} - -// SetCharacterSetName sets the CharacterSetName field's value. -func (s *DBInstance) SetCharacterSetName(v string) *DBInstance { - s.CharacterSetName = &v - return s -} - -// SetCopyTagsToSnapshot sets the CopyTagsToSnapshot field's value. -func (s *DBInstance) SetCopyTagsToSnapshot(v bool) *DBInstance { - s.CopyTagsToSnapshot = &v - return s -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *DBInstance) SetDBClusterIdentifier(v string) *DBInstance { - s.DBClusterIdentifier = &v - return s -} - -// SetDBInstanceArn sets the DBInstanceArn field's value. -func (s *DBInstance) SetDBInstanceArn(v string) *DBInstance { - s.DBInstanceArn = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *DBInstance) SetDBInstanceClass(v string) *DBInstance { - s.DBInstanceClass = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *DBInstance) SetDBInstanceIdentifier(v string) *DBInstance { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBInstanceStatus sets the DBInstanceStatus field's value. -func (s *DBInstance) SetDBInstanceStatus(v string) *DBInstance { - s.DBInstanceStatus = &v - return s -} - -// SetDBName sets the DBName field's value. -func (s *DBInstance) SetDBName(v string) *DBInstance { - s.DBName = &v - return s -} - -// SetDBParameterGroups sets the DBParameterGroups field's value. -func (s *DBInstance) SetDBParameterGroups(v []*DBParameterGroupStatus) *DBInstance { - s.DBParameterGroups = v - return s -} - -// SetDBSecurityGroups sets the DBSecurityGroups field's value. -func (s *DBInstance) SetDBSecurityGroups(v []*DBSecurityGroupMembership) *DBInstance { - s.DBSecurityGroups = v - return s -} - -// SetDBSubnetGroup sets the DBSubnetGroup field's value. -func (s *DBInstance) SetDBSubnetGroup(v *DBSubnetGroup) *DBInstance { - s.DBSubnetGroup = v - return s -} - -// SetDbInstancePort sets the DbInstancePort field's value. -func (s *DBInstance) SetDbInstancePort(v int64) *DBInstance { - s.DbInstancePort = &v - return s -} - -// SetDbiResourceId sets the DbiResourceId field's value. -func (s *DBInstance) SetDbiResourceId(v string) *DBInstance { - s.DbiResourceId = &v - return s -} - -// SetDomainMemberships sets the DomainMemberships field's value. -func (s *DBInstance) SetDomainMemberships(v []*DomainMembership) *DBInstance { - s.DomainMemberships = v - return s -} - -// SetEndpoint sets the Endpoint field's value. -func (s *DBInstance) SetEndpoint(v *Endpoint) *DBInstance { - s.Endpoint = v - return s -} - -// SetEngine sets the Engine field's value. -func (s *DBInstance) SetEngine(v string) *DBInstance { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *DBInstance) SetEngineVersion(v string) *DBInstance { - s.EngineVersion = &v - return s -} - -// SetEnhancedMonitoringResourceArn sets the EnhancedMonitoringResourceArn field's value. -func (s *DBInstance) SetEnhancedMonitoringResourceArn(v string) *DBInstance { - s.EnhancedMonitoringResourceArn = &v - return s -} - -// SetInstanceCreateTime sets the InstanceCreateTime field's value. -func (s *DBInstance) SetInstanceCreateTime(v time.Time) *DBInstance { - s.InstanceCreateTime = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *DBInstance) SetIops(v int64) *DBInstance { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *DBInstance) SetKmsKeyId(v string) *DBInstance { - s.KmsKeyId = &v - return s -} - -// SetLatestRestorableTime sets the LatestRestorableTime field's value. -func (s *DBInstance) SetLatestRestorableTime(v time.Time) *DBInstance { - s.LatestRestorableTime = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *DBInstance) SetLicenseModel(v string) *DBInstance { - s.LicenseModel = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *DBInstance) SetMasterUsername(v string) *DBInstance { - s.MasterUsername = &v - return s -} - -// SetMonitoringInterval sets the MonitoringInterval field's value. -func (s *DBInstance) SetMonitoringInterval(v int64) *DBInstance { - s.MonitoringInterval = &v - return s -} - -// SetMonitoringRoleArn sets the MonitoringRoleArn field's value. -func (s *DBInstance) SetMonitoringRoleArn(v string) *DBInstance { - s.MonitoringRoleArn = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *DBInstance) SetMultiAZ(v bool) *DBInstance { - s.MultiAZ = &v - return s -} - -// SetOptionGroupMemberships sets the OptionGroupMemberships field's value. -func (s *DBInstance) SetOptionGroupMemberships(v []*OptionGroupMembership) *DBInstance { - s.OptionGroupMemberships = v - return s -} - -// SetPendingModifiedValues sets the PendingModifiedValues field's value. -func (s *DBInstance) SetPendingModifiedValues(v *PendingModifiedValues) *DBInstance { - s.PendingModifiedValues = v - return s -} - -// SetPreferredBackupWindow sets the PreferredBackupWindow field's value. -func (s *DBInstance) SetPreferredBackupWindow(v string) *DBInstance { - s.PreferredBackupWindow = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *DBInstance) SetPreferredMaintenanceWindow(v string) *DBInstance { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPromotionTier sets the PromotionTier field's value. -func (s *DBInstance) SetPromotionTier(v int64) *DBInstance { - s.PromotionTier = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *DBInstance) SetPubliclyAccessible(v bool) *DBInstance { - s.PubliclyAccessible = &v - return s -} - -// SetReadReplicaDBClusterIdentifiers sets the ReadReplicaDBClusterIdentifiers field's value. -func (s *DBInstance) SetReadReplicaDBClusterIdentifiers(v []*string) *DBInstance { - s.ReadReplicaDBClusterIdentifiers = v - return s -} - -// SetReadReplicaDBInstanceIdentifiers sets the ReadReplicaDBInstanceIdentifiers field's value. -func (s *DBInstance) SetReadReplicaDBInstanceIdentifiers(v []*string) *DBInstance { - s.ReadReplicaDBInstanceIdentifiers = v - return s -} - -// SetReadReplicaSourceDBInstanceIdentifier sets the ReadReplicaSourceDBInstanceIdentifier field's value. -func (s *DBInstance) SetReadReplicaSourceDBInstanceIdentifier(v string) *DBInstance { - s.ReadReplicaSourceDBInstanceIdentifier = &v - return s -} - -// SetSecondaryAvailabilityZone sets the SecondaryAvailabilityZone field's value. -func (s *DBInstance) SetSecondaryAvailabilityZone(v string) *DBInstance { - s.SecondaryAvailabilityZone = &v - return s -} - -// SetStatusInfos sets the StatusInfos field's value. -func (s *DBInstance) SetStatusInfos(v []*DBInstanceStatusInfo) *DBInstance { - s.StatusInfos = v - return s -} - -// SetStorageEncrypted sets the StorageEncrypted field's value. -func (s *DBInstance) SetStorageEncrypted(v bool) *DBInstance { - s.StorageEncrypted = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *DBInstance) SetStorageType(v string) *DBInstance { - s.StorageType = &v - return s -} - -// SetTdeCredentialArn sets the TdeCredentialArn field's value. -func (s *DBInstance) SetTdeCredentialArn(v string) *DBInstance { - s.TdeCredentialArn = &v - return s -} - -// SetTimezone sets the Timezone field's value. -func (s *DBInstance) SetTimezone(v string) *DBInstance { - s.Timezone = &v - return s -} - -// SetVpcSecurityGroups sets the VpcSecurityGroups field's value. -func (s *DBInstance) SetVpcSecurityGroups(v []*VpcSecurityGroupMembership) *DBInstance { - s.VpcSecurityGroups = v - return s -} - -// Provides a list of status information for a DB instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBInstanceStatusInfo -type DBInstanceStatusInfo struct { - _ struct{} `type:"structure"` - - // Details of the error if there is an error for the instance. If the instance - // is not in an error state, this value is blank. - Message *string `type:"string"` - - // Boolean value that is true if the instance is operating normally, or false - // if the instance is in an error state. - Normal *bool `type:"boolean"` - - // Status of the DB instance. For a StatusType of read replica, the values can - // be replicating, error, stopped, or terminated. - Status *string `type:"string"` - - // This value is currently "read replication." - StatusType *string `type:"string"` -} - -// String returns the string representation -func (s DBInstanceStatusInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBInstanceStatusInfo) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *DBInstanceStatusInfo) SetMessage(v string) *DBInstanceStatusInfo { - s.Message = &v - return s -} - -// SetNormal sets the Normal field's value. -func (s *DBInstanceStatusInfo) SetNormal(v bool) *DBInstanceStatusInfo { - s.Normal = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DBInstanceStatusInfo) SetStatus(v string) *DBInstanceStatusInfo { - s.Status = &v - return s -} - -// SetStatusType sets the StatusType field's value. -func (s *DBInstanceStatusInfo) SetStatusType(v string) *DBInstanceStatusInfo { - s.StatusType = &v - return s -} - -// Contains the result of a successful invocation of the CreateDBParameterGroup -// action. -// -// This data type is used as a request parameter in the DeleteDBParameterGroup -// action, and as a response element in the DescribeDBParameterGroups action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBParameterGroup -type DBParameterGroup struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the DB parameter group. - DBParameterGroupArn *string `type:"string"` - - // Provides the name of the DB parameter group family that this DB parameter - // group is compatible with. - DBParameterGroupFamily *string `type:"string"` - - // Provides the name of the DB parameter group. - DBParameterGroupName *string `type:"string"` - - // Provides the customer-specified description for this DB parameter group. - Description *string `type:"string"` -} - -// String returns the string representation -func (s DBParameterGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBParameterGroup) GoString() string { - return s.String() -} - -// SetDBParameterGroupArn sets the DBParameterGroupArn field's value. -func (s *DBParameterGroup) SetDBParameterGroupArn(v string) *DBParameterGroup { - s.DBParameterGroupArn = &v - return s -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *DBParameterGroup) SetDBParameterGroupFamily(v string) *DBParameterGroup { - s.DBParameterGroupFamily = &v - return s -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *DBParameterGroup) SetDBParameterGroupName(v string) *DBParameterGroup { - s.DBParameterGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DBParameterGroup) SetDescription(v string) *DBParameterGroup { - s.Description = &v - return s -} - -// Contains the result of a successful invocation of the ModifyDBParameterGroup -// or ResetDBParameterGroup action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBParameterGroupNameMessage -type DBParameterGroupNameMessage struct { - _ struct{} `type:"structure"` - - // Provides the name of the DB parameter group. - DBParameterGroupName *string `type:"string"` -} - -// String returns the string representation -func (s DBParameterGroupNameMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBParameterGroupNameMessage) GoString() string { - return s.String() -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *DBParameterGroupNameMessage) SetDBParameterGroupName(v string) *DBParameterGroupNameMessage { - s.DBParameterGroupName = &v - return s -} - -// The status of the DB parameter group. -// -// This data type is used as a response element in the following actions: -// -// * CreateDBInstance -// -// * CreateDBInstanceReadReplica -// -// * DeleteDBInstance -// -// * ModifyDBInstance -// -// * RebootDBInstance -// -// * RestoreDBInstanceFromDBSnapshot -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBParameterGroupStatus -type DBParameterGroupStatus struct { - _ struct{} `type:"structure"` - - // The name of the DP parameter group. - DBParameterGroupName *string `type:"string"` - - // The status of parameter updates. - ParameterApplyStatus *string `type:"string"` -} - -// String returns the string representation -func (s DBParameterGroupStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBParameterGroupStatus) GoString() string { - return s.String() -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *DBParameterGroupStatus) SetDBParameterGroupName(v string) *DBParameterGroupStatus { - s.DBParameterGroupName = &v - return s -} - -// SetParameterApplyStatus sets the ParameterApplyStatus field's value. -func (s *DBParameterGroupStatus) SetParameterApplyStatus(v string) *DBParameterGroupStatus { - s.ParameterApplyStatus = &v - return s -} - -// Contains the result of a successful invocation of the following actions: -// -// * DescribeDBSecurityGroups -// -// * AuthorizeDBSecurityGroupIngress -// -// * CreateDBSecurityGroup -// -// * RevokeDBSecurityGroupIngress -// -// This data type is used as a response element in the DescribeDBSecurityGroups -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSecurityGroup -type DBSecurityGroup struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the DB security group. - DBSecurityGroupArn *string `type:"string"` - - // Provides the description of the DB security group. - DBSecurityGroupDescription *string `type:"string"` - - // Specifies the name of the DB security group. - DBSecurityGroupName *string `type:"string"` - - // Contains a list of EC2SecurityGroup elements. - EC2SecurityGroups []*EC2SecurityGroup `locationNameList:"EC2SecurityGroup" type:"list"` - - // Contains a list of IPRange elements. - IPRanges []*IPRange `locationNameList:"IPRange" type:"list"` - - // Provides the AWS ID of the owner of a specific DB security group. - OwnerId *string `type:"string"` - - // Provides the VpcId of the DB security group. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s DBSecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBSecurityGroup) GoString() string { - return s.String() -} - -// SetDBSecurityGroupArn sets the DBSecurityGroupArn field's value. -func (s *DBSecurityGroup) SetDBSecurityGroupArn(v string) *DBSecurityGroup { - s.DBSecurityGroupArn = &v - return s -} - -// SetDBSecurityGroupDescription sets the DBSecurityGroupDescription field's value. -func (s *DBSecurityGroup) SetDBSecurityGroupDescription(v string) *DBSecurityGroup { - s.DBSecurityGroupDescription = &v - return s -} - -// SetDBSecurityGroupName sets the DBSecurityGroupName field's value. -func (s *DBSecurityGroup) SetDBSecurityGroupName(v string) *DBSecurityGroup { - s.DBSecurityGroupName = &v - return s -} - -// SetEC2SecurityGroups sets the EC2SecurityGroups field's value. -func (s *DBSecurityGroup) SetEC2SecurityGroups(v []*EC2SecurityGroup) *DBSecurityGroup { - s.EC2SecurityGroups = v - return s -} - -// SetIPRanges sets the IPRanges field's value. -func (s *DBSecurityGroup) SetIPRanges(v []*IPRange) *DBSecurityGroup { - s.IPRanges = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *DBSecurityGroup) SetOwnerId(v string) *DBSecurityGroup { - s.OwnerId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DBSecurityGroup) SetVpcId(v string) *DBSecurityGroup { - s.VpcId = &v - return s -} - -// This data type is used as a response element in the following actions: -// -// * ModifyDBInstance -// -// * RebootDBInstance -// -// * RestoreDBInstanceFromDBSnapshot -// -// * RestoreDBInstanceToPointInTime -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSecurityGroupMembership -type DBSecurityGroupMembership struct { - _ struct{} `type:"structure"` - - // The name of the DB security group. - DBSecurityGroupName *string `type:"string"` - - // The status of the DB security group. - Status *string `type:"string"` -} - -// String returns the string representation -func (s DBSecurityGroupMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBSecurityGroupMembership) GoString() string { - return s.String() -} - -// SetDBSecurityGroupName sets the DBSecurityGroupName field's value. -func (s *DBSecurityGroupMembership) SetDBSecurityGroupName(v string) *DBSecurityGroupMembership { - s.DBSecurityGroupName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DBSecurityGroupMembership) SetStatus(v string) *DBSecurityGroupMembership { - s.Status = &v - return s -} - -// Contains the result of a successful invocation of the following actions: -// -// * CreateDBSnapshot -// -// * DeleteDBSnapshot -// -// This data type is used as a response element in the DescribeDBSnapshots action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSnapshot -type DBSnapshot struct { - _ struct{} `type:"structure"` - - // Specifies the allocated storage size in gigabytes (GB). - AllocatedStorage *int64 `type:"integer"` - - // Specifies the name of the Availability Zone the DB instance was located in - // at the time of the DB snapshot. - AvailabilityZone *string `type:"string"` - - // Specifies the DB instance identifier of the DB instance this DB snapshot - // was created from. - DBInstanceIdentifier *string `type:"string"` - - // The Amazon Resource Name (ARN) for the DB snapshot. - DBSnapshotArn *string `type:"string"` - - // Specifies the identifier for the DB snapshot. - DBSnapshotIdentifier *string `type:"string"` - - // Specifies whether the DB snapshot is encrypted. - Encrypted *bool `type:"boolean"` - - // Specifies the name of the database engine. - Engine *string `type:"string"` - - // Specifies the version of the database engine. - EngineVersion *string `type:"string"` - - // Specifies the time when the snapshot was taken, in Universal Coordinated - // Time (UTC). - InstanceCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the Provisioned IOPS (I/O operations per second) value of the DB - // instance at the time of the snapshot. - Iops *int64 `type:"integer"` - - // If Encrypted is true, the KMS key identifier for the encrypted DB snapshot. - KmsKeyId *string `type:"string"` - - // License model information for the restored DB instance. - LicenseModel *string `type:"string"` - - // Provides the master username for the DB snapshot. - MasterUsername *string `type:"string"` - - // Provides the option group name for the DB snapshot. - OptionGroupName *string `type:"string"` - - // The percentage of the estimated data that has been transferred. - PercentProgress *int64 `type:"integer"` - - // Specifies the port that the database engine was listening on at the time - // of the snapshot. - Port *int64 `type:"integer"` - - // Provides the time when the snapshot was taken, in Universal Coordinated Time - // (UTC). - SnapshotCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Provides the type of the DB snapshot. - SnapshotType *string `type:"string"` - - // The DB snapshot Arn that the DB snapshot was copied from. It only has value - // in case of cross customer or cross region copy. - SourceDBSnapshotIdentifier *string `type:"string"` - - // The region that the DB snapshot was created in or copied from. - SourceRegion *string `type:"string"` - - // Specifies the status of this DB snapshot. - Status *string `type:"string"` - - // Specifies the storage type associated with DB snapshot. - StorageType *string `type:"string"` - - // The ARN from the key store with which to associate the instance for TDE encryption. - TdeCredentialArn *string `type:"string"` - - // The time zone of the DB snapshot. In most cases, the Timezone element is - // empty. Timezone content appears only for snapshots taken from Microsoft SQL - // Server DB instances that were created with a time zone specified. - Timezone *string `type:"string"` - - // Provides the VPC ID associated with the DB snapshot. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s DBSnapshot) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBSnapshot) GoString() string { - return s.String() -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *DBSnapshot) SetAllocatedStorage(v int64) *DBSnapshot { - s.AllocatedStorage = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *DBSnapshot) SetAvailabilityZone(v string) *DBSnapshot { - s.AvailabilityZone = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *DBSnapshot) SetDBInstanceIdentifier(v string) *DBSnapshot { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBSnapshotArn sets the DBSnapshotArn field's value. -func (s *DBSnapshot) SetDBSnapshotArn(v string) *DBSnapshot { - s.DBSnapshotArn = &v - return s -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *DBSnapshot) SetDBSnapshotIdentifier(v string) *DBSnapshot { - s.DBSnapshotIdentifier = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *DBSnapshot) SetEncrypted(v bool) *DBSnapshot { - s.Encrypted = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *DBSnapshot) SetEngine(v string) *DBSnapshot { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *DBSnapshot) SetEngineVersion(v string) *DBSnapshot { - s.EngineVersion = &v - return s -} - -// SetInstanceCreateTime sets the InstanceCreateTime field's value. -func (s *DBSnapshot) SetInstanceCreateTime(v time.Time) *DBSnapshot { - s.InstanceCreateTime = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *DBSnapshot) SetIops(v int64) *DBSnapshot { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *DBSnapshot) SetKmsKeyId(v string) *DBSnapshot { - s.KmsKeyId = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *DBSnapshot) SetLicenseModel(v string) *DBSnapshot { - s.LicenseModel = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *DBSnapshot) SetMasterUsername(v string) *DBSnapshot { - s.MasterUsername = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *DBSnapshot) SetOptionGroupName(v string) *DBSnapshot { - s.OptionGroupName = &v - return s -} - -// SetPercentProgress sets the PercentProgress field's value. -func (s *DBSnapshot) SetPercentProgress(v int64) *DBSnapshot { - s.PercentProgress = &v - return s -} - -// SetPort sets the Port field's value. -func (s *DBSnapshot) SetPort(v int64) *DBSnapshot { - s.Port = &v - return s -} - -// SetSnapshotCreateTime sets the SnapshotCreateTime field's value. -func (s *DBSnapshot) SetSnapshotCreateTime(v time.Time) *DBSnapshot { - s.SnapshotCreateTime = &v - return s -} - -// SetSnapshotType sets the SnapshotType field's value. -func (s *DBSnapshot) SetSnapshotType(v string) *DBSnapshot { - s.SnapshotType = &v - return s -} - -// SetSourceDBSnapshotIdentifier sets the SourceDBSnapshotIdentifier field's value. -func (s *DBSnapshot) SetSourceDBSnapshotIdentifier(v string) *DBSnapshot { - s.SourceDBSnapshotIdentifier = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *DBSnapshot) SetSourceRegion(v string) *DBSnapshot { - s.SourceRegion = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DBSnapshot) SetStatus(v string) *DBSnapshot { - s.Status = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *DBSnapshot) SetStorageType(v string) *DBSnapshot { - s.StorageType = &v - return s -} - -// SetTdeCredentialArn sets the TdeCredentialArn field's value. -func (s *DBSnapshot) SetTdeCredentialArn(v string) *DBSnapshot { - s.TdeCredentialArn = &v - return s -} - -// SetTimezone sets the Timezone field's value. -func (s *DBSnapshot) SetTimezone(v string) *DBSnapshot { - s.Timezone = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DBSnapshot) SetVpcId(v string) *DBSnapshot { - s.VpcId = &v - return s -} - -// Contains the name and values of a manual DB snapshot attribute -// -// Manual DB snapshot attributes are used to authorize other AWS accounts to -// restore a manual DB snapshot. For more information, see the ModifyDBSnapshotAttribute -// API. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSnapshotAttribute -type DBSnapshotAttribute struct { - _ struct{} `type:"structure"` - - // The name of the manual DB snapshot attribute. - // - // The attribute named restore refers to the list of AWS accounts that have - // permission to copy or restore the manual DB cluster snapshot. For more information, - // see the ModifyDBSnapshotAttribute API action. - AttributeName *string `type:"string"` - - // The value or values for the manual DB snapshot attribute. - // - // If the AttributeName field is set to restore, then this element returns a - // list of IDs of the AWS accounts that are authorized to copy or restore the - // manual DB snapshot. If a value of all is in the list, then the manual DB - // snapshot is public and available for any AWS account to copy or restore. - AttributeValues []*string `locationNameList:"AttributeValue" type:"list"` -} - -// String returns the string representation -func (s DBSnapshotAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBSnapshotAttribute) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *DBSnapshotAttribute) SetAttributeName(v string) *DBSnapshotAttribute { - s.AttributeName = &v - return s -} - -// SetAttributeValues sets the AttributeValues field's value. -func (s *DBSnapshotAttribute) SetAttributeValues(v []*string) *DBSnapshotAttribute { - s.AttributeValues = v - return s -} - -// Contains the results of a successful call to the DescribeDBSnapshotAttributes -// API action. -// -// Manual DB snapshot attributes are used to authorize other AWS accounts to -// copy or restore a manual DB snapshot. For more information, see the ModifyDBSnapshotAttribute -// API action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSnapshotAttributesResult -type DBSnapshotAttributesResult struct { - _ struct{} `type:"structure"` - - // The list of attributes and values for the manual DB snapshot. - DBSnapshotAttributes []*DBSnapshotAttribute `locationNameList:"DBSnapshotAttribute" type:"list"` - - // The identifier of the manual DB snapshot that the attributes apply to. - DBSnapshotIdentifier *string `type:"string"` -} - -// String returns the string representation -func (s DBSnapshotAttributesResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBSnapshotAttributesResult) GoString() string { - return s.String() -} - -// SetDBSnapshotAttributes sets the DBSnapshotAttributes field's value. -func (s *DBSnapshotAttributesResult) SetDBSnapshotAttributes(v []*DBSnapshotAttribute) *DBSnapshotAttributesResult { - s.DBSnapshotAttributes = v - return s -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *DBSnapshotAttributesResult) SetDBSnapshotIdentifier(v string) *DBSnapshotAttributesResult { - s.DBSnapshotIdentifier = &v - return s -} - -// Contains the result of a successful invocation of the following actions: -// -// * CreateDBSubnetGroup -// -// * ModifyDBSubnetGroup -// -// * DescribeDBSubnetGroups -// -// * DeleteDBSubnetGroup -// -// This data type is used as a response element in the DescribeDBSubnetGroups -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSubnetGroup -type DBSubnetGroup struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the DB subnet group. - DBSubnetGroupArn *string `type:"string"` - - // Provides the description of the DB subnet group. - DBSubnetGroupDescription *string `type:"string"` - - // The name of the DB subnet group. - DBSubnetGroupName *string `type:"string"` - - // Provides the status of the DB subnet group. - SubnetGroupStatus *string `type:"string"` - - // Contains a list of Subnet elements. - Subnets []*Subnet `locationNameList:"Subnet" type:"list"` - - // Provides the VpcId of the DB subnet group. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s DBSubnetGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DBSubnetGroup) GoString() string { - return s.String() -} - -// SetDBSubnetGroupArn sets the DBSubnetGroupArn field's value. -func (s *DBSubnetGroup) SetDBSubnetGroupArn(v string) *DBSubnetGroup { - s.DBSubnetGroupArn = &v - return s -} - -// SetDBSubnetGroupDescription sets the DBSubnetGroupDescription field's value. -func (s *DBSubnetGroup) SetDBSubnetGroupDescription(v string) *DBSubnetGroup { - s.DBSubnetGroupDescription = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *DBSubnetGroup) SetDBSubnetGroupName(v string) *DBSubnetGroup { - s.DBSubnetGroupName = &v - return s -} - -// SetSubnetGroupStatus sets the SubnetGroupStatus field's value. -func (s *DBSubnetGroup) SetSubnetGroupStatus(v string) *DBSubnetGroup { - s.SubnetGroupStatus = &v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *DBSubnetGroup) SetSubnets(v []*Subnet) *DBSubnetGroup { - s.Subnets = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DBSubnetGroup) SetVpcId(v string) *DBSubnetGroup { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterMessage -type DeleteDBClusterInput struct { - _ struct{} `type:"structure"` - - // The DB cluster identifier for the DB cluster to be deleted. This parameter - // isn't case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The DB cluster snapshot identifier of the new DB cluster snapshot created - // when SkipFinalSnapshot is set to false. - // - // Specifying this parameter and also setting the SkipFinalShapshot parameter - // to true results in an error. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - FinalDBSnapshotIdentifier *string `type:"string"` - - // Determines whether a final DB cluster snapshot is created before the DB cluster - // is deleted. If true is specified, no DB cluster snapshot is created. If false - // is specified, a DB cluster snapshot is created before the DB cluster is deleted. - // - // You must specify a FinalDBSnapshotIdentifier parameter if SkipFinalSnapshot - // is false. - // - // Default: false - SkipFinalSnapshot *bool `type:"boolean"` -} - -// String returns the string representation -func (s DeleteDBClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDBClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDBClusterInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *DeleteDBClusterInput) SetDBClusterIdentifier(v string) *DeleteDBClusterInput { - s.DBClusterIdentifier = &v - return s -} - -// SetFinalDBSnapshotIdentifier sets the FinalDBSnapshotIdentifier field's value. -func (s *DeleteDBClusterInput) SetFinalDBSnapshotIdentifier(v string) *DeleteDBClusterInput { - s.FinalDBSnapshotIdentifier = &v - return s -} - -// SetSkipFinalSnapshot sets the SkipFinalSnapshot field's value. -func (s *DeleteDBClusterInput) SetSkipFinalSnapshot(v bool) *DeleteDBClusterInput { - s.SkipFinalSnapshot = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterResult -type DeleteDBClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBCluster - // - // * DeleteDBCluster - // - // * FailoverDBCluster - // - // * ModifyDBCluster - // - // * RestoreDBClusterFromSnapshot - // - // * RestoreDBClusterToPointInTime - // - // This data type is used as a response element in the DescribeDBClusters action. - DBCluster *DBCluster `type:"structure"` -} - -// String returns the string representation -func (s DeleteDBClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBClusterOutput) GoString() string { - return s.String() -} - -// SetDBCluster sets the DBCluster field's value. -func (s *DeleteDBClusterOutput) SetDBCluster(v *DBCluster) *DeleteDBClusterOutput { - s.DBCluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterParameterGroupMessage -type DeleteDBClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster parameter group. - // - // Constraints: - // - // * Must be the name of an existing DB cluster parameter group. - // - // * You cannot delete a default DB cluster parameter group. - // - // * Cannot be associated with any DB clusters. - // - // DBClusterParameterGroupName is a required field - DBClusterParameterGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDBClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDBClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDBClusterParameterGroupInput"} - if s.DBClusterParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *DeleteDBClusterParameterGroupInput) SetDBClusterParameterGroupName(v string) *DeleteDBClusterParameterGroupInput { - s.DBClusterParameterGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterParameterGroupOutput -type DeleteDBClusterParameterGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDBClusterParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBClusterParameterGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterSnapshotMessage -type DeleteDBClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of the DB cluster snapshot to delete. - // - // Constraints: Must be the name of an existing DB cluster snapshot in the available - // state. - // - // DBClusterSnapshotIdentifier is a required field - DBClusterSnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDBClusterSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDBClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDBClusterSnapshotInput"} - if s.DBClusterSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterSnapshotIdentifier sets the DBClusterSnapshotIdentifier field's value. -func (s *DeleteDBClusterSnapshotInput) SetDBClusterSnapshotIdentifier(v string) *DeleteDBClusterSnapshotInput { - s.DBClusterSnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBClusterSnapshotResult -type DeleteDBClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBClusterSnapshot - // - // * DeleteDBClusterSnapshot - // - // This data type is used as a response element in the DescribeDBClusterSnapshots - // action. - DBClusterSnapshot *DBClusterSnapshot `type:"structure"` -} - -// String returns the string representation -func (s DeleteDBClusterSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBClusterSnapshot sets the DBClusterSnapshot field's value. -func (s *DeleteDBClusterSnapshotOutput) SetDBClusterSnapshot(v *DBClusterSnapshot) *DeleteDBClusterSnapshotOutput { - s.DBClusterSnapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBInstanceMessage -type DeleteDBInstanceInput struct { - _ struct{} `type:"structure"` - - // The DB instance identifier for the DB instance to be deleted. This parameter - // isn't case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // The DBSnapshotIdentifier of the new DBSnapshot created when SkipFinalSnapshot - // is set to false. - // - // Specifying this parameter and also setting the SkipFinalShapshot parameter - // to true results in an error. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // * Cannot be specified when deleting a Read Replica. - FinalDBSnapshotIdentifier *string `type:"string"` - - // Determines whether a final DB snapshot is created before the DB instance - // is deleted. If true is specified, no DBSnapshot is created. If false is specified, - // a DB snapshot is created before the DB instance is deleted. - // - // Note that when a DB instance is in a failure state and has a status of 'failed', - // 'incompatible-restore', or 'incompatible-network', it can only be deleted - // when the SkipFinalSnapshot parameter is set to "true". - // - // Specify true when deleting a Read Replica. - // - // The FinalDBSnapshotIdentifier parameter must be specified if SkipFinalSnapshot - // is false. - // - // Default: false - SkipFinalSnapshot *bool `type:"boolean"` -} - -// String returns the string representation -func (s DeleteDBInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDBInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDBInstanceInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *DeleteDBInstanceInput) SetDBInstanceIdentifier(v string) *DeleteDBInstanceInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetFinalDBSnapshotIdentifier sets the FinalDBSnapshotIdentifier field's value. -func (s *DeleteDBInstanceInput) SetFinalDBSnapshotIdentifier(v string) *DeleteDBInstanceInput { - s.FinalDBSnapshotIdentifier = &v - return s -} - -// SetSkipFinalSnapshot sets the SkipFinalSnapshot field's value. -func (s *DeleteDBInstanceInput) SetSkipFinalSnapshot(v bool) *DeleteDBInstanceInput { - s.SkipFinalSnapshot = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBInstanceResult -type DeleteDBInstanceOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBInstance - // - // * DeleteDBInstance - // - // * ModifyDBInstance - // - // This data type is used as a response element in the DescribeDBInstances action. - DBInstance *DBInstance `type:"structure"` -} - -// String returns the string representation -func (s DeleteDBInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBInstanceOutput) GoString() string { - return s.String() -} - -// SetDBInstance sets the DBInstance field's value. -func (s *DeleteDBInstanceOutput) SetDBInstance(v *DBInstance) *DeleteDBInstanceOutput { - s.DBInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBParameterGroupMessage -type DeleteDBParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the DB parameter group. - // - // Constraints: - // - // * Must be the name of an existing DB parameter group - // - // * You cannot delete a default DB parameter group - // - // * Cannot be associated with any DB instances - // - // DBParameterGroupName is a required field - DBParameterGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDBParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDBParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDBParameterGroupInput"} - if s.DBParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *DeleteDBParameterGroupInput) SetDBParameterGroupName(v string) *DeleteDBParameterGroupInput { - s.DBParameterGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBParameterGroupOutput -type DeleteDBParameterGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDBParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBParameterGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSecurityGroupMessage -type DeleteDBSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the DB security group to delete. - // - // You cannot delete the default DB security group. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // * Must not be "Default" - // - // DBSecurityGroupName is a required field - DBSecurityGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDBSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBSecurityGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDBSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDBSecurityGroupInput"} - if s.DBSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBSecurityGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSecurityGroupName sets the DBSecurityGroupName field's value. -func (s *DeleteDBSecurityGroupInput) SetDBSecurityGroupName(v string) *DeleteDBSecurityGroupInput { - s.DBSecurityGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSecurityGroupOutput -type DeleteDBSecurityGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDBSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBSecurityGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSnapshotMessage -type DeleteDBSnapshotInput struct { - _ struct{} `type:"structure"` - - // The DBSnapshot identifier. - // - // Constraints: Must be the name of an existing DB snapshot in the available - // state. - // - // DBSnapshotIdentifier is a required field - DBSnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDBSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDBSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDBSnapshotInput"} - if s.DBSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *DeleteDBSnapshotInput) SetDBSnapshotIdentifier(v string) *DeleteDBSnapshotInput { - s.DBSnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSnapshotResult -type DeleteDBSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBSnapshot - // - // * DeleteDBSnapshot - // - // This data type is used as a response element in the DescribeDBSnapshots action. - DBSnapshot *DBSnapshot `type:"structure"` -} - -// String returns the string representation -func (s DeleteDBSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBSnapshot sets the DBSnapshot field's value. -func (s *DeleteDBSnapshotOutput) SetDBSnapshot(v *DBSnapshot) *DeleteDBSnapshotOutput { - s.DBSnapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSubnetGroupMessage -type DeleteDBSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the database subnet group to delete. - // - // You cannot delete the default subnet group. - // - // Constraints: - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - // - // DBSubnetGroupName is a required field - DBSubnetGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDBSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDBSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDBSubnetGroupInput"} - if s.DBSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBSubnetGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *DeleteDBSubnetGroupInput) SetDBSubnetGroupName(v string) *DeleteDBSubnetGroupInput { - s.DBSubnetGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSubnetGroupOutput -type DeleteDBSubnetGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDBSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDBSubnetGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteEventSubscriptionMessage -type DeleteEventSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The name of the RDS event notification subscription you want to delete. - // - // SubscriptionName is a required field - SubscriptionName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEventSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEventSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEventSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEventSubscriptionInput"} - if s.SubscriptionName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *DeleteEventSubscriptionInput) SetSubscriptionName(v string) *DeleteEventSubscriptionInput { - s.SubscriptionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteEventSubscriptionResult -type DeleteEventSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful invocation of the DescribeEventSubscriptions - // action. - EventSubscription *EventSubscription `type:"structure"` -} - -// String returns the string representation -func (s DeleteEventSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEventSubscriptionOutput) GoString() string { - return s.String() -} - -// SetEventSubscription sets the EventSubscription field's value. -func (s *DeleteEventSubscriptionOutput) SetEventSubscription(v *EventSubscription) *DeleteEventSubscriptionOutput { - s.EventSubscription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteOptionGroupMessage -type DeleteOptionGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the option group to be deleted. - // - // You cannot delete default option groups. - // - // OptionGroupName is a required field - OptionGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteOptionGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteOptionGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteOptionGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteOptionGroupInput"} - if s.OptionGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("OptionGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *DeleteOptionGroupInput) SetOptionGroupName(v string) *DeleteOptionGroupInput { - s.OptionGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteOptionGroupOutput -type DeleteOptionGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteOptionGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteOptionGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeAccountAttributesMessage -type DescribeAccountAttributesInput struct { - _ struct{} `type:"structure"` -} - -// 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() -} - -// Data returned by the DescribeAccountAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AccountAttributesMessage -type DescribeAccountAttributesOutput struct { - _ struct{} `type:"structure"` - - // A list of AccountQuota objects. Within this list, each quota has a name, - // a count of usage toward the quota maximum, and a maximum value for the quota. - AccountQuotas []*AccountQuota `locationNameList:"AccountQuota" 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() -} - -// SetAccountQuotas sets the AccountQuotas field's value. -func (s *DescribeAccountAttributesOutput) SetAccountQuotas(v []*AccountQuota) *DescribeAccountAttributesOutput { - s.AccountQuotas = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeCertificatesMessage -type DescribeCertificatesInput struct { - _ struct{} `type:"structure"` - - // The user-supplied certificate identifier. If this parameter is specified, - // information for only the identified certificate is returned. This parameter - // isn't case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - CertificateIdentifier *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeCertificates - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeCertificatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCertificatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCertificatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCertificatesInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateIdentifier sets the CertificateIdentifier field's value. -func (s *DescribeCertificatesInput) SetCertificateIdentifier(v string) *DescribeCertificatesInput { - s.CertificateIdentifier = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeCertificatesInput) SetFilters(v []*Filter) *DescribeCertificatesInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCertificatesInput) SetMarker(v string) *DescribeCertificatesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeCertificatesInput) SetMaxRecords(v int64) *DescribeCertificatesInput { - s.MaxRecords = &v - return s -} - -// Data returned by the DescribeCertificates action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CertificateMessage -type DescribeCertificatesOutput struct { - _ struct{} `type:"structure"` - - // The list of Certificate objects for the AWS account. - Certificates []*Certificate `locationNameList:"Certificate" type:"list"` - - // An optional pagination token provided by a previous DescribeCertificates - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords . - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeCertificatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCertificatesOutput) GoString() string { - return s.String() -} - -// SetCertificates sets the Certificates field's value. -func (s *DescribeCertificatesOutput) SetCertificates(v []*Certificate) *DescribeCertificatesOutput { - s.Certificates = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeCertificatesOutput) SetMarker(v string) *DescribeCertificatesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterParameterGroupsMessage -type DescribeDBClusterParameterGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of a specific DB cluster parameter group to return details for. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBClusterParameterGroupName *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeDBClusterParameterGroups - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeDBClusterParameterGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClusterParameterGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBClusterParameterGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBClusterParameterGroupsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *DescribeDBClusterParameterGroupsInput) SetDBClusterParameterGroupName(v string) *DescribeDBClusterParameterGroupsInput { - s.DBClusterParameterGroupName = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBClusterParameterGroupsInput) SetFilters(v []*Filter) *DescribeDBClusterParameterGroupsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBClusterParameterGroupsInput) SetMarker(v string) *DescribeDBClusterParameterGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBClusterParameterGroupsInput) SetMaxRecords(v int64) *DescribeDBClusterParameterGroupsInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterParameterGroupsMessage -type DescribeDBClusterParameterGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of DB cluster parameter groups. - DBClusterParameterGroups []*DBClusterParameterGroup `locationNameList:"DBClusterParameterGroup" type:"list"` - - // An optional pagination token provided by a previous DescribeDBClusterParameterGroups - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBClusterParameterGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClusterParameterGroupsOutput) GoString() string { - return s.String() -} - -// SetDBClusterParameterGroups sets the DBClusterParameterGroups field's value. -func (s *DescribeDBClusterParameterGroupsOutput) SetDBClusterParameterGroups(v []*DBClusterParameterGroup) *DescribeDBClusterParameterGroupsOutput { - s.DBClusterParameterGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBClusterParameterGroupsOutput) SetMarker(v string) *DescribeDBClusterParameterGroupsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterParametersMessage -type DescribeDBClusterParametersInput struct { - _ struct{} `type:"structure"` - - // The name of a specific DB cluster parameter group to return parameter details - // for. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBClusterParameterGroupName is a required field - DBClusterParameterGroupName *string `type:"string" required:"true"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeDBClusterParameters - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // A value that indicates to return only parameters for a specific source. Parameter - // sources can be engine, service, or customer. - Source *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBClusterParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClusterParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBClusterParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBClusterParametersInput"} - if s.DBClusterParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterParameterGroupName")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *DescribeDBClusterParametersInput) SetDBClusterParameterGroupName(v string) *DescribeDBClusterParametersInput { - s.DBClusterParameterGroupName = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBClusterParametersInput) SetFilters(v []*Filter) *DescribeDBClusterParametersInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBClusterParametersInput) SetMarker(v string) *DescribeDBClusterParametersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBClusterParametersInput) SetMaxRecords(v int64) *DescribeDBClusterParametersInput { - s.MaxRecords = &v - return s -} - -// SetSource sets the Source field's value. -func (s *DescribeDBClusterParametersInput) SetSource(v string) *DescribeDBClusterParametersInput { - s.Source = &v - return s -} - -// Provides details about a DB cluster parameter group including the parameters -// in the DB cluster parameter group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterParameterGroupDetails -type DescribeDBClusterParametersOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous DescribeDBClusterParameters - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords . - Marker *string `type:"string"` - - // Provides a list of parameters for the DB cluster parameter group. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` -} - -// String returns the string representation -func (s DescribeDBClusterParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClusterParametersOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBClusterParametersOutput) SetMarker(v string) *DescribeDBClusterParametersOutput { - s.Marker = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DescribeDBClusterParametersOutput) SetParameters(v []*Parameter) *DescribeDBClusterParametersOutput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshotAttributesMessage -type DescribeDBClusterSnapshotAttributesInput struct { - _ struct{} `type:"structure"` - - // The identifier for the DB cluster snapshot to describe the attributes for. - // - // DBClusterSnapshotIdentifier is a required field - DBClusterSnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeDBClusterSnapshotAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClusterSnapshotAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBClusterSnapshotAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBClusterSnapshotAttributesInput"} - if s.DBClusterSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterSnapshotIdentifier sets the DBClusterSnapshotIdentifier field's value. -func (s *DescribeDBClusterSnapshotAttributesInput) SetDBClusterSnapshotIdentifier(v string) *DescribeDBClusterSnapshotAttributesInput { - s.DBClusterSnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshotAttributesResult -type DescribeDBClusterSnapshotAttributesOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful call to the DescribeDBClusterSnapshotAttributes - // API action. - // - // Manual DB cluster snapshot attributes are used to authorize other AWS accounts - // to copy or restore a manual DB cluster snapshot. For more information, see - // the ModifyDBClusterSnapshotAttribute API action. - DBClusterSnapshotAttributesResult *DBClusterSnapshotAttributesResult `type:"structure"` -} - -// String returns the string representation -func (s DescribeDBClusterSnapshotAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClusterSnapshotAttributesOutput) GoString() string { - return s.String() -} - -// SetDBClusterSnapshotAttributesResult sets the DBClusterSnapshotAttributesResult field's value. -func (s *DescribeDBClusterSnapshotAttributesOutput) SetDBClusterSnapshotAttributesResult(v *DBClusterSnapshotAttributesResult) *DescribeDBClusterSnapshotAttributesOutput { - s.DBClusterSnapshotAttributesResult = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClusterSnapshotsMessage -type DescribeDBClusterSnapshotsInput struct { - _ struct{} `type:"structure"` - - // The ID of the DB cluster to retrieve the list of DB cluster snapshots for. - // This parameter cannot be used in conjunction with the DBClusterSnapshotIdentifier - // parameter. This parameter is not case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBClusterIdentifier *string `type:"string"` - - // A specific DB cluster snapshot identifier to describe. This parameter cannot - // be used in conjunction with the DBClusterIdentifier parameter. This value - // is stored as a lowercase string. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // * If this identifier is for an automated snapshot, the SnapshotType parameter - // must also be specified. - DBClusterSnapshotIdentifier *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // Set this value to true to include manual DB cluster snapshots that are public - // and can be copied or restored by any AWS account, otherwise set this value - // to false. The default is false. The default is false. - // - // You can share a manual DB cluster snapshot as public by using the ModifyDBClusterSnapshotAttribute - // API action. - IncludePublic *bool `type:"boolean"` - - // Set this value to true to include shared manual DB cluster snapshots from - // other AWS accounts that this AWS account has been given permission to copy - // or restore, otherwise set this value to false. The default is false. - // - // You can give an AWS account permission to restore a manual DB cluster snapshot - // from another AWS account by the ModifyDBClusterSnapshotAttribute API action. - IncludeShared *bool `type:"boolean"` - - // An optional pagination token provided by a previous DescribeDBClusterSnapshots - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The type of DB cluster snapshots to be returned. You can specify one of the - // following values: - // - // * automated - Return all DB cluster snapshots that have been automatically - // taken by Amazon RDS for my AWS account. - // - // * manual - Return all DB cluster snapshots that have been taken by my - // AWS account. - // - // * shared - Return all manual DB cluster snapshots that have been shared - // to my AWS account. - // - // * public - Return all DB cluster snapshots that have been marked as public. - // - // If you don't specify a SnapshotType value, then both automated and manual - // DB cluster snapshots are returned. You can include shared DB cluster snapshots - // with these results by setting the IncludeShared parameter to true. You can - // include public DB cluster snapshots with these results by setting the IncludePublic - // parameter to true. - // - // The IncludeShared and IncludePublic parameters don't apply for SnapshotType - // values of manual or automated. The IncludePublic parameter doesn't apply - // when SnapshotType is set to shared. The IncludeShared parameter doesn't apply - // when SnapshotType is set to public. - SnapshotType *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBClusterSnapshotsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClusterSnapshotsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBClusterSnapshotsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBClusterSnapshotsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *DescribeDBClusterSnapshotsInput) SetDBClusterIdentifier(v string) *DescribeDBClusterSnapshotsInput { - s.DBClusterIdentifier = &v - return s -} - -// SetDBClusterSnapshotIdentifier sets the DBClusterSnapshotIdentifier field's value. -func (s *DescribeDBClusterSnapshotsInput) SetDBClusterSnapshotIdentifier(v string) *DescribeDBClusterSnapshotsInput { - s.DBClusterSnapshotIdentifier = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBClusterSnapshotsInput) SetFilters(v []*Filter) *DescribeDBClusterSnapshotsInput { - s.Filters = v - return s -} - -// SetIncludePublic sets the IncludePublic field's value. -func (s *DescribeDBClusterSnapshotsInput) SetIncludePublic(v bool) *DescribeDBClusterSnapshotsInput { - s.IncludePublic = &v - return s -} - -// SetIncludeShared sets the IncludeShared field's value. -func (s *DescribeDBClusterSnapshotsInput) SetIncludeShared(v bool) *DescribeDBClusterSnapshotsInput { - s.IncludeShared = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBClusterSnapshotsInput) SetMarker(v string) *DescribeDBClusterSnapshotsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBClusterSnapshotsInput) SetMaxRecords(v int64) *DescribeDBClusterSnapshotsInput { - s.MaxRecords = &v - return s -} - -// SetSnapshotType sets the SnapshotType field's value. -func (s *DescribeDBClusterSnapshotsInput) SetSnapshotType(v string) *DescribeDBClusterSnapshotsInput { - s.SnapshotType = &v - return s -} - -// Provides a list of DB cluster snapshots for the user as the result of a call -// to the DescribeDBClusterSnapshots action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterSnapshotMessage -type DescribeDBClusterSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // Provides a list of DB cluster snapshots for the user. - DBClusterSnapshots []*DBClusterSnapshot `locationNameList:"DBClusterSnapshot" type:"list"` - - // An optional pagination token provided by a previous DescribeDBClusterSnapshots - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBClusterSnapshotsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClusterSnapshotsOutput) GoString() string { - return s.String() -} - -// SetDBClusterSnapshots sets the DBClusterSnapshots field's value. -func (s *DescribeDBClusterSnapshotsOutput) SetDBClusterSnapshots(v []*DBClusterSnapshot) *DescribeDBClusterSnapshotsOutput { - s.DBClusterSnapshots = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBClusterSnapshotsOutput) SetMarker(v string) *DescribeDBClusterSnapshotsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBClustersMessage -type DescribeDBClustersInput struct { - _ struct{} `type:"structure"` - - // The user-supplied DB cluster identifier. If this parameter is specified, - // information from only the specific DB cluster is returned. This parameter - // isn't case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBClusterIdentifier *string `type:"string"` - - // A filter that specifies one or more DB clusters to describe. - // - // Supported filters: - // - // * db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon - // Resource Names (ARNs). The results list will only include information - // about the DB clusters identified by these ARNs. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeDBClusters request. - // If this parameter is specified, the response includes only records beyond - // the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeDBClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClustersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBClustersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBClustersInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *DescribeDBClustersInput) SetDBClusterIdentifier(v string) *DescribeDBClustersInput { - s.DBClusterIdentifier = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBClustersInput) SetFilters(v []*Filter) *DescribeDBClustersInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBClustersInput) SetMarker(v string) *DescribeDBClustersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBClustersInput) SetMaxRecords(v int64) *DescribeDBClustersInput { - s.MaxRecords = &v - return s -} - -// Contains the result of a successful invocation of the DescribeDBClusters -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBClusterMessage -type DescribeDBClustersOutput struct { - _ struct{} `type:"structure"` - - // Contains a list of DB clusters for the user. - DBClusters []*DBCluster `locationNameList:"DBCluster" type:"list"` - - // A pagination token that can be used in a subsequent DescribeDBClusters request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBClustersOutput) GoString() string { - return s.String() -} - -// SetDBClusters sets the DBClusters field's value. -func (s *DescribeDBClustersOutput) SetDBClusters(v []*DBCluster) *DescribeDBClustersOutput { - s.DBClusters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBClustersOutput) SetMarker(v string) *DescribeDBClustersOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBEngineVersionsMessage -type DescribeDBEngineVersionsInput struct { - _ struct{} `type:"structure"` - - // The name of a specific DB parameter group family to return details for. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBParameterGroupFamily *string `type:"string"` - - // Indicates that only the default version of the specified engine or engine - // and major version combination is returned. - DefaultOnly *bool `type:"boolean"` - - // The database engine to return. - Engine *string `type:"string"` - - // The database engine version to return. - // - // Example: 5.1.49 - EngineVersion *string `type:"string"` - - // Not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // If this parameter is specified and the requested engine supports the CharacterSetName - // parameter for CreateDBInstance, the response includes a list of supported - // character sets for each engine version. - ListSupportedCharacterSets *bool `type:"boolean"` - - // If this parameter is specified and the requested engine supports the TimeZone - // parameter for CreateDBInstance, the response includes a list of supported - // time zones for each engine version. - ListSupportedTimezones *bool `type:"boolean"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more than the - // MaxRecords value is available, a pagination token called a marker is included - // in the response so that the following results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeDBEngineVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBEngineVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBEngineVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBEngineVersionsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *DescribeDBEngineVersionsInput) SetDBParameterGroupFamily(v string) *DescribeDBEngineVersionsInput { - s.DBParameterGroupFamily = &v - return s -} - -// SetDefaultOnly sets the DefaultOnly field's value. -func (s *DescribeDBEngineVersionsInput) SetDefaultOnly(v bool) *DescribeDBEngineVersionsInput { - s.DefaultOnly = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *DescribeDBEngineVersionsInput) SetEngine(v string) *DescribeDBEngineVersionsInput { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *DescribeDBEngineVersionsInput) SetEngineVersion(v string) *DescribeDBEngineVersionsInput { - s.EngineVersion = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBEngineVersionsInput) SetFilters(v []*Filter) *DescribeDBEngineVersionsInput { - s.Filters = v - return s -} - -// SetListSupportedCharacterSets sets the ListSupportedCharacterSets field's value. -func (s *DescribeDBEngineVersionsInput) SetListSupportedCharacterSets(v bool) *DescribeDBEngineVersionsInput { - s.ListSupportedCharacterSets = &v - return s -} - -// SetListSupportedTimezones sets the ListSupportedTimezones field's value. -func (s *DescribeDBEngineVersionsInput) SetListSupportedTimezones(v bool) *DescribeDBEngineVersionsInput { - s.ListSupportedTimezones = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBEngineVersionsInput) SetMarker(v string) *DescribeDBEngineVersionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBEngineVersionsInput) SetMaxRecords(v int64) *DescribeDBEngineVersionsInput { - s.MaxRecords = &v - return s -} - -// Contains the result of a successful invocation of the DescribeDBEngineVersions -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBEngineVersionMessage -type DescribeDBEngineVersionsOutput struct { - _ struct{} `type:"structure"` - - // A list of DBEngineVersion elements. - DBEngineVersions []*DBEngineVersion `locationNameList:"DBEngineVersion" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBEngineVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBEngineVersionsOutput) GoString() string { - return s.String() -} - -// SetDBEngineVersions sets the DBEngineVersions field's value. -func (s *DescribeDBEngineVersionsOutput) SetDBEngineVersions(v []*DBEngineVersion) *DescribeDBEngineVersionsOutput { - s.DBEngineVersions = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBEngineVersionsOutput) SetMarker(v string) *DescribeDBEngineVersionsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBInstancesMessage -type DescribeDBInstancesInput struct { - _ struct{} `type:"structure"` - - // The user-supplied instance identifier. If this parameter is specified, information - // from only the specific DB instance is returned. This parameter isn't case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBInstanceIdentifier *string `type:"string"` - - // A filter that specifies one or more DB instances to describe. - // - // Supported filters: - // - // * db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon - // Resource Names (ARNs). The results list will only include information - // about the DB instances associated with the DB Clusters identified by these - // ARNs. - // - // * db-instance-id - Accepts DB instance identifiers and DB instance Amazon - // Resource Names (ARNs). The results list will only include information - // about the DB instances identified by these ARNs. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeDBInstances request. - // If this parameter is specified, the response includes only records beyond - // the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeDBInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBInstancesInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *DescribeDBInstancesInput) SetDBInstanceIdentifier(v string) *DescribeDBInstancesInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBInstancesInput) SetFilters(v []*Filter) *DescribeDBInstancesInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBInstancesInput) SetMarker(v string) *DescribeDBInstancesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBInstancesInput) SetMaxRecords(v int64) *DescribeDBInstancesInput { - s.MaxRecords = &v - return s -} - -// Contains the result of a successful invocation of the DescribeDBInstances -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBInstanceMessage -type DescribeDBInstancesOutput struct { - _ struct{} `type:"structure"` - - // A list of DBInstance instances. - DBInstances []*DBInstance `locationNameList:"DBInstance" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords . - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBInstancesOutput) GoString() string { - return s.String() -} - -// SetDBInstances sets the DBInstances field's value. -func (s *DescribeDBInstancesOutput) SetDBInstances(v []*DBInstance) *DescribeDBInstancesOutput { - s.DBInstances = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBInstancesOutput) SetMarker(v string) *DescribeDBInstancesOutput { - s.Marker = &v - return s -} - -// This data type is used as a response element to DescribeDBLogFiles. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBLogFilesDetails -type DescribeDBLogFilesDetails struct { - _ struct{} `type:"structure"` - - // A POSIX timestamp when the last log entry was written. - LastWritten *int64 `type:"long"` - - // The name of the log file for the specified DB instance. - LogFileName *string `type:"string"` - - // The size, in bytes, of the log file for the specified DB instance. - Size *int64 `type:"long"` -} - -// String returns the string representation -func (s DescribeDBLogFilesDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBLogFilesDetails) GoString() string { - return s.String() -} - -// SetLastWritten sets the LastWritten field's value. -func (s *DescribeDBLogFilesDetails) SetLastWritten(v int64) *DescribeDBLogFilesDetails { - s.LastWritten = &v - return s -} - -// SetLogFileName sets the LogFileName field's value. -func (s *DescribeDBLogFilesDetails) SetLogFileName(v string) *DescribeDBLogFilesDetails { - s.LogFileName = &v - return s -} - -// SetSize sets the Size field's value. -func (s *DescribeDBLogFilesDetails) SetSize(v int64) *DescribeDBLogFilesDetails { - s.Size = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBLogFilesMessage -type DescribeDBLogFilesInput struct { - _ struct{} `type:"structure"` - - // The customer-assigned name of the DB instance that contains the log files - // you want to list. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // Filters the available log files for files written since the specified date, - // in POSIX timestamp format with milliseconds. - FileLastWritten *int64 `type:"long"` - - // Filters the available log files for files larger than the specified size. - FileSize *int64 `type:"long"` - - // Filters the available log files for log file names that contain the specified - // string. - FilenameContains *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // The pagination token provided in the previous request. If this parameter - // is specified the response includes only records beyond the marker, up to - // MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeDBLogFilesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBLogFilesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBLogFilesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBLogFilesInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *DescribeDBLogFilesInput) SetDBInstanceIdentifier(v string) *DescribeDBLogFilesInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetFileLastWritten sets the FileLastWritten field's value. -func (s *DescribeDBLogFilesInput) SetFileLastWritten(v int64) *DescribeDBLogFilesInput { - s.FileLastWritten = &v - return s -} - -// SetFileSize sets the FileSize field's value. -func (s *DescribeDBLogFilesInput) SetFileSize(v int64) *DescribeDBLogFilesInput { - s.FileSize = &v - return s -} - -// SetFilenameContains sets the FilenameContains field's value. -func (s *DescribeDBLogFilesInput) SetFilenameContains(v string) *DescribeDBLogFilesInput { - s.FilenameContains = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBLogFilesInput) SetFilters(v []*Filter) *DescribeDBLogFilesInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBLogFilesInput) SetMarker(v string) *DescribeDBLogFilesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBLogFilesInput) SetMaxRecords(v int64) *DescribeDBLogFilesInput { - s.MaxRecords = &v - return s -} - -// The response from a call to DescribeDBLogFiles. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBLogFilesResponse -type DescribeDBLogFilesOutput struct { - _ struct{} `type:"structure"` - - // The DB log files returned. - DescribeDBLogFiles []*DescribeDBLogFilesDetails `locationNameList:"DescribeDBLogFilesDetails" type:"list"` - - // A pagination token that can be used in a subsequent DescribeDBLogFiles request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBLogFilesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBLogFilesOutput) GoString() string { - return s.String() -} - -// SetDescribeDBLogFiles sets the DescribeDBLogFiles field's value. -func (s *DescribeDBLogFilesOutput) SetDescribeDBLogFiles(v []*DescribeDBLogFilesDetails) *DescribeDBLogFilesOutput { - s.DescribeDBLogFiles = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBLogFilesOutput) SetMarker(v string) *DescribeDBLogFilesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBParameterGroupsMessage -type DescribeDBParameterGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of a specific DB parameter group to return details for. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBParameterGroupName *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeDBParameterGroups - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeDBParameterGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBParameterGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBParameterGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBParameterGroupsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *DescribeDBParameterGroupsInput) SetDBParameterGroupName(v string) *DescribeDBParameterGroupsInput { - s.DBParameterGroupName = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBParameterGroupsInput) SetFilters(v []*Filter) *DescribeDBParameterGroupsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBParameterGroupsInput) SetMarker(v string) *DescribeDBParameterGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBParameterGroupsInput) SetMaxRecords(v int64) *DescribeDBParameterGroupsInput { - s.MaxRecords = &v - return s -} - -// Contains the result of a successful invocation of the DescribeDBParameterGroups -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBParameterGroupsMessage -type DescribeDBParameterGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of DBParameterGroup instances. - DBParameterGroups []*DBParameterGroup `locationNameList:"DBParameterGroup" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBParameterGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBParameterGroupsOutput) GoString() string { - return s.String() -} - -// SetDBParameterGroups sets the DBParameterGroups field's value. -func (s *DescribeDBParameterGroupsOutput) SetDBParameterGroups(v []*DBParameterGroup) *DescribeDBParameterGroupsOutput { - s.DBParameterGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBParameterGroupsOutput) SetMarker(v string) *DescribeDBParameterGroupsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBParametersMessage -type DescribeDBParametersInput struct { - _ struct{} `type:"structure"` - - // The name of a specific DB parameter group to return details for. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBParameterGroupName is a required field - DBParameterGroupName *string `type:"string" required:"true"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeDBParameters - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The parameter types to return. - // - // Default: All parameter types returned - // - // Valid Values: user | system | engine-default - Source *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBParametersInput"} - if s.DBParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupName")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *DescribeDBParametersInput) SetDBParameterGroupName(v string) *DescribeDBParametersInput { - s.DBParameterGroupName = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBParametersInput) SetFilters(v []*Filter) *DescribeDBParametersInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBParametersInput) SetMarker(v string) *DescribeDBParametersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBParametersInput) SetMaxRecords(v int64) *DescribeDBParametersInput { - s.MaxRecords = &v - return s -} - -// SetSource sets the Source field's value. -func (s *DescribeDBParametersInput) SetSource(v string) *DescribeDBParametersInput { - s.Source = &v - return s -} - -// Contains the result of a successful invocation of the DescribeDBParameters -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBParameterGroupDetails -type DescribeDBParametersOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // A list of Parameter values. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` -} - -// String returns the string representation -func (s DescribeDBParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBParametersOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBParametersOutput) SetMarker(v string) *DescribeDBParametersOutput { - s.Marker = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DescribeDBParametersOutput) SetParameters(v []*Parameter) *DescribeDBParametersOutput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSecurityGroupsMessage -type DescribeDBSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of the DB security group to return details for. - DBSecurityGroupName *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeDBSecurityGroups - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeDBSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBSecurityGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBSecurityGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBSecurityGroupsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSecurityGroupName sets the DBSecurityGroupName field's value. -func (s *DescribeDBSecurityGroupsInput) SetDBSecurityGroupName(v string) *DescribeDBSecurityGroupsInput { - s.DBSecurityGroupName = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBSecurityGroupsInput) SetFilters(v []*Filter) *DescribeDBSecurityGroupsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBSecurityGroupsInput) SetMarker(v string) *DescribeDBSecurityGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBSecurityGroupsInput) SetMaxRecords(v int64) *DescribeDBSecurityGroupsInput { - s.MaxRecords = &v - return s -} - -// Contains the result of a successful invocation of the DescribeDBSecurityGroups -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSecurityGroupMessage -type DescribeDBSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of DBSecurityGroup instances. - DBSecurityGroups []*DBSecurityGroup `locationNameList:"DBSecurityGroup" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetDBSecurityGroups sets the DBSecurityGroups field's value. -func (s *DescribeDBSecurityGroupsOutput) SetDBSecurityGroups(v []*DBSecurityGroup) *DescribeDBSecurityGroupsOutput { - s.DBSecurityGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBSecurityGroupsOutput) SetMarker(v string) *DescribeDBSecurityGroupsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshotAttributesMessage -type DescribeDBSnapshotAttributesInput struct { - _ struct{} `type:"structure"` - - // The identifier for the DB snapshot to describe the attributes for. - // - // DBSnapshotIdentifier is a required field - DBSnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeDBSnapshotAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBSnapshotAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBSnapshotAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBSnapshotAttributesInput"} - if s.DBSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *DescribeDBSnapshotAttributesInput) SetDBSnapshotIdentifier(v string) *DescribeDBSnapshotAttributesInput { - s.DBSnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshotAttributesResult -type DescribeDBSnapshotAttributesOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful call to the DescribeDBSnapshotAttributes - // API action. - // - // Manual DB snapshot attributes are used to authorize other AWS accounts to - // copy or restore a manual DB snapshot. For more information, see the ModifyDBSnapshotAttribute - // API action. - DBSnapshotAttributesResult *DBSnapshotAttributesResult `type:"structure"` -} - -// String returns the string representation -func (s DescribeDBSnapshotAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBSnapshotAttributesOutput) GoString() string { - return s.String() -} - -// SetDBSnapshotAttributesResult sets the DBSnapshotAttributesResult field's value. -func (s *DescribeDBSnapshotAttributesOutput) SetDBSnapshotAttributesResult(v *DBSnapshotAttributesResult) *DescribeDBSnapshotAttributesOutput { - s.DBSnapshotAttributesResult = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSnapshotsMessage -type DescribeDBSnapshotsInput struct { - _ struct{} `type:"structure"` - - // The ID of the DB instance to retrieve the list of DB snapshots for. This - // parameter cannot be used in conjunction with DBSnapshotIdentifier. This parameter - // is not case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBInstanceIdentifier *string `type:"string"` - - // A specific DB snapshot identifier to describe. This parameter cannot be used - // in conjunction with DBInstanceIdentifier. This value is stored as a lowercase - // string. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // * If this identifier is for an automated snapshot, the SnapshotType parameter - // must also be specified. - DBSnapshotIdentifier *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // Set this value to true to include manual DB snapshots that are public and - // can be copied or restored by any AWS account, otherwise set this value to - // false. The default is false. - // - // You can share a manual DB snapshot as public by using the ModifyDBSnapshotAttribute - // API. - IncludePublic *bool `type:"boolean"` - - // Set this value to true to include shared manual DB snapshots from other AWS - // accounts that this AWS account has been given permission to copy or restore, - // otherwise set this value to false. The default is false. - // - // You can give an AWS account permission to restore a manual DB snapshot from - // another AWS account by using the ModifyDBSnapshotAttribute API action. - IncludeShared *bool `type:"boolean"` - - // An optional pagination token provided by a previous DescribeDBSnapshots request. - // If this parameter is specified, the response includes only records beyond - // the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The type of snapshots to be returned. You can specify one of the following - // values: - // - // * automated - Return all DB snapshots that have been automatically taken - // by Amazon RDS for my AWS account. - // - // * manual - Return all DB snapshots that have been taken by my AWS account. - // - // * shared - Return all manual DB snapshots that have been shared to my - // AWS account. - // - // * public - Return all DB snapshots that have been marked as public. - // - // If you don't specify a SnapshotType value, then both automated and manual - // snapshots are returned. Shared and public DB snapshots are not included in - // the returned results by default. You can include shared snapshots with these - // results by setting the IncludeShared parameter to true. You can include public - // snapshots with these results by setting the IncludePublic parameter to true. - // - // The IncludeShared and IncludePublic parameters don't apply for SnapshotType - // values of manual or automated. The IncludePublic parameter doesn't apply - // when SnapshotType is set to shared. The IncludeShared parameter doesn't apply - // when SnapshotType is set to public. - SnapshotType *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBSnapshotsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBSnapshotsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBSnapshotsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBSnapshotsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *DescribeDBSnapshotsInput) SetDBInstanceIdentifier(v string) *DescribeDBSnapshotsInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *DescribeDBSnapshotsInput) SetDBSnapshotIdentifier(v string) *DescribeDBSnapshotsInput { - s.DBSnapshotIdentifier = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBSnapshotsInput) SetFilters(v []*Filter) *DescribeDBSnapshotsInput { - s.Filters = v - return s -} - -// SetIncludePublic sets the IncludePublic field's value. -func (s *DescribeDBSnapshotsInput) SetIncludePublic(v bool) *DescribeDBSnapshotsInput { - s.IncludePublic = &v - return s -} - -// SetIncludeShared sets the IncludeShared field's value. -func (s *DescribeDBSnapshotsInput) SetIncludeShared(v bool) *DescribeDBSnapshotsInput { - s.IncludeShared = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBSnapshotsInput) SetMarker(v string) *DescribeDBSnapshotsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBSnapshotsInput) SetMaxRecords(v int64) *DescribeDBSnapshotsInput { - s.MaxRecords = &v - return s -} - -// SetSnapshotType sets the SnapshotType field's value. -func (s *DescribeDBSnapshotsInput) SetSnapshotType(v string) *DescribeDBSnapshotsInput { - s.SnapshotType = &v - return s -} - -// Contains the result of a successful invocation of the DescribeDBSnapshots -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSnapshotMessage -type DescribeDBSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // A list of DBSnapshot instances. - DBSnapshots []*DBSnapshot `locationNameList:"DBSnapshot" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBSnapshotsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBSnapshotsOutput) GoString() string { - return s.String() -} - -// SetDBSnapshots sets the DBSnapshots field's value. -func (s *DescribeDBSnapshotsOutput) SetDBSnapshots(v []*DBSnapshot) *DescribeDBSnapshotsOutput { - s.DBSnapshots = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBSnapshotsOutput) SetMarker(v string) *DescribeDBSnapshotsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBSubnetGroupsMessage -type DescribeDBSubnetGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of the DB subnet group to return details for. - DBSubnetGroupName *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeDBSubnetGroups - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeDBSubnetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBSubnetGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDBSubnetGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDBSubnetGroupsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *DescribeDBSubnetGroupsInput) SetDBSubnetGroupName(v string) *DescribeDBSubnetGroupsInput { - s.DBSubnetGroupName = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDBSubnetGroupsInput) SetFilters(v []*Filter) *DescribeDBSubnetGroupsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBSubnetGroupsInput) SetMarker(v string) *DescribeDBSubnetGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDBSubnetGroupsInput) SetMaxRecords(v int64) *DescribeDBSubnetGroupsInput { - s.MaxRecords = &v - return s -} - -// Contains the result of a successful invocation of the DescribeDBSubnetGroups -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBSubnetGroupMessage -type DescribeDBSubnetGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of DBSubnetGroup instances. - DBSubnetGroups []*DBSubnetGroup `locationNameList:"DBSubnetGroup" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDBSubnetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDBSubnetGroupsOutput) GoString() string { - return s.String() -} - -// SetDBSubnetGroups sets the DBSubnetGroups field's value. -func (s *DescribeDBSubnetGroupsOutput) SetDBSubnetGroups(v []*DBSubnetGroup) *DescribeDBSubnetGroupsOutput { - s.DBSubnetGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDBSubnetGroupsOutput) SetMarker(v string) *DescribeDBSubnetGroupsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultClusterParametersMessage -type DescribeEngineDefaultClusterParametersInput struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster parameter group family to return engine parameter - // information for. - // - // DBParameterGroupFamily is a required field - DBParameterGroupFamily *string `type:"string" required:"true"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeEngineDefaultClusterParameters - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeEngineDefaultClusterParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEngineDefaultClusterParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEngineDefaultClusterParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEngineDefaultClusterParametersInput"} - if s.DBParameterGroupFamily == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupFamily")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *DescribeEngineDefaultClusterParametersInput) SetDBParameterGroupFamily(v string) *DescribeEngineDefaultClusterParametersInput { - s.DBParameterGroupFamily = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeEngineDefaultClusterParametersInput) SetFilters(v []*Filter) *DescribeEngineDefaultClusterParametersInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEngineDefaultClusterParametersInput) SetMarker(v string) *DescribeEngineDefaultClusterParametersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEngineDefaultClusterParametersInput) SetMaxRecords(v int64) *DescribeEngineDefaultClusterParametersInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultClusterParametersResult -type DescribeEngineDefaultClusterParametersOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the DescribeEngineDefaultParameters - // action. - EngineDefaults *EngineDefaults `type:"structure"` -} - -// String returns the string representation -func (s DescribeEngineDefaultClusterParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEngineDefaultClusterParametersOutput) GoString() string { - return s.String() -} - -// SetEngineDefaults sets the EngineDefaults field's value. -func (s *DescribeEngineDefaultClusterParametersOutput) SetEngineDefaults(v *EngineDefaults) *DescribeEngineDefaultClusterParametersOutput { - s.EngineDefaults = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultParametersMessage -type DescribeEngineDefaultParametersInput struct { - _ struct{} `type:"structure"` - - // The name of the DB parameter group family. - // - // DBParameterGroupFamily is a required field - DBParameterGroupFamily *string `type:"string" required:"true"` - - // Not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeEngineDefaultParameters - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeEngineDefaultParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEngineDefaultParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEngineDefaultParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEngineDefaultParametersInput"} - if s.DBParameterGroupFamily == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupFamily")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *DescribeEngineDefaultParametersInput) SetDBParameterGroupFamily(v string) *DescribeEngineDefaultParametersInput { - s.DBParameterGroupFamily = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeEngineDefaultParametersInput) SetFilters(v []*Filter) *DescribeEngineDefaultParametersInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEngineDefaultParametersInput) SetMarker(v string) *DescribeEngineDefaultParametersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEngineDefaultParametersInput) SetMaxRecords(v int64) *DescribeEngineDefaultParametersInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEngineDefaultParametersResult -type DescribeEngineDefaultParametersOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the DescribeEngineDefaultParameters - // action. - EngineDefaults *EngineDefaults `type:"structure"` -} - -// String returns the string representation -func (s DescribeEngineDefaultParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEngineDefaultParametersOutput) GoString() string { - return s.String() -} - -// SetEngineDefaults sets the EngineDefaults field's value. -func (s *DescribeEngineDefaultParametersOutput) SetEngineDefaults(v *EngineDefaults) *DescribeEngineDefaultParametersOutput { - s.EngineDefaults = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventCategoriesMessage -type DescribeEventCategoriesInput struct { - _ struct{} `type:"structure"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // The type of source that will be generating the events. - // - // Valid values: db-instance | db-parameter-group | db-security-group | db-snapshot - SourceType *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventCategoriesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventCategoriesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEventCategoriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEventCategoriesInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeEventCategoriesInput) SetFilters(v []*Filter) *DescribeEventCategoriesInput { - s.Filters = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *DescribeEventCategoriesInput) SetSourceType(v string) *DescribeEventCategoriesInput { - s.SourceType = &v - return s -} - -// Data returned from the DescribeEventCategories action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/EventCategoriesMessage -type DescribeEventCategoriesOutput struct { - _ struct{} `type:"structure"` - - // A list of EventCategoriesMap data types. - EventCategoriesMapList []*EventCategoriesMap `locationNameList:"EventCategoriesMap" type:"list"` -} - -// String returns the string representation -func (s DescribeEventCategoriesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventCategoriesOutput) GoString() string { - return s.String() -} - -// SetEventCategoriesMapList sets the EventCategoriesMapList field's value. -func (s *DescribeEventCategoriesOutput) SetEventCategoriesMapList(v []*EventCategoriesMap) *DescribeEventCategoriesOutput { - s.EventCategoriesMapList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventSubscriptionsMessage -type DescribeEventSubscriptionsInput struct { - _ struct{} `type:"structure"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeOrderableDBInstanceOptions - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords . - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The name of the RDS event notification subscription you want to describe. - SubscriptionName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventSubscriptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventSubscriptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEventSubscriptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEventSubscriptionsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeEventSubscriptionsInput) SetFilters(v []*Filter) *DescribeEventSubscriptionsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventSubscriptionsInput) SetMarker(v string) *DescribeEventSubscriptionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEventSubscriptionsInput) SetMaxRecords(v int64) *DescribeEventSubscriptionsInput { - s.MaxRecords = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *DescribeEventSubscriptionsInput) SetSubscriptionName(v string) *DescribeEventSubscriptionsInput { - s.SubscriptionName = &v - return s -} - -// Data returned by the DescribeEventSubscriptions action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/EventSubscriptionsMessage -type DescribeEventSubscriptionsOutput struct { - _ struct{} `type:"structure"` - - // A list of EventSubscriptions data types. - EventSubscriptionsList []*EventSubscription `locationNameList:"EventSubscription" type:"list"` - - // An optional pagination token provided by a previous DescribeOrderableDBInstanceOptions - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventSubscriptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventSubscriptionsOutput) GoString() string { - return s.String() -} - -// SetEventSubscriptionsList sets the EventSubscriptionsList field's value. -func (s *DescribeEventSubscriptionsOutput) SetEventSubscriptionsList(v []*EventSubscription) *DescribeEventSubscriptionsOutput { - s.EventSubscriptionsList = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventSubscriptionsOutput) SetMarker(v string) *DescribeEventSubscriptionsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeEventsMessage -type DescribeEventsInput struct { - _ struct{} `type:"structure"` - - // The number of minutes to retrieve events for. - // - // Default: 60 - Duration *int64 `type:"integer"` - - // The end of the time interval for which to retrieve events, specified in ISO - // 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia - // page. (http://en.wikipedia.org/wiki/ISO_8601) - // - // Example: 2009-07-08T18:00Z - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A list of event categories that trigger notifications for a event notification - // subscription. - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeEvents request. - // If this parameter is specified, the response includes only records beyond - // the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The identifier of the event source for which events will be returned. If - // not specified, then all sources are included in the response. - // - // Constraints: - // - // * If SourceIdentifier is supplied, SourceType must also be provided. - // - // * If the source type is DBInstance, then a DBInstanceIdentifier must be - // supplied. - // - // * If the source type is DBSecurityGroup, a DBSecurityGroupName must be - // supplied. - // - // * If the source type is DBParameterGroup, a DBParameterGroupName must - // be supplied. - // - // * If the source type is DBSnapshot, a DBSnapshotIdentifier must be supplied. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - SourceIdentifier *string `type:"string"` - - // The event source to retrieve events for. If no value is specified, all events - // are returned. - SourceType *string `type:"string" enum:"SourceType"` - - // The beginning of the time interval to retrieve events for, specified in ISO - // 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia - // page. (http://en.wikipedia.org/wiki/ISO_8601) - // - // Example: 2009-07-08T18:00Z - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEventsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDuration sets the Duration field's value. -func (s *DescribeEventsInput) SetDuration(v int64) *DescribeEventsInput { - s.Duration = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeEventsInput) SetEndTime(v time.Time) *DescribeEventsInput { - s.EndTime = &v - return s -} - -// SetEventCategories sets the EventCategories field's value. -func (s *DescribeEventsInput) SetEventCategories(v []*string) *DescribeEventsInput { - s.EventCategories = v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeEventsInput) SetFilters(v []*Filter) *DescribeEventsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventsInput) SetMarker(v string) *DescribeEventsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEventsInput) SetMaxRecords(v int64) *DescribeEventsInput { - s.MaxRecords = &v - return s -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *DescribeEventsInput) SetSourceIdentifier(v string) *DescribeEventsInput { - s.SourceIdentifier = &v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *DescribeEventsInput) SetSourceType(v string) *DescribeEventsInput { - s.SourceType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeEventsInput) SetStartTime(v time.Time) *DescribeEventsInput { - s.StartTime = &v - return s -} - -// Contains the result of a successful invocation of the DescribeEvents action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/EventsMessage -type DescribeEventsOutput struct { - _ struct{} `type:"structure"` - - // A list of Event instances. - Events []*Event `locationNameList:"Event" type:"list"` - - // An optional pagination token provided by a previous Events request. If this - // parameter is specified, the response includes only records beyond the marker, - // up to the value specified by MaxRecords . - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *DescribeEventsOutput) SetEvents(v []*Event) *DescribeEventsOutput { - s.Events = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventsOutput) SetMarker(v string) *DescribeEventsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroupOptionsMessage -type DescribeOptionGroupOptionsInput struct { - _ struct{} `type:"structure"` - - // A required parameter. Options available for the given engine name will be - // described. - // - // EngineName is a required field - EngineName *string `type:"string" required:"true"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // If specified, filters the results to include only options for the specified - // major engine version. - MajorEngineVersion *string `type:"string"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeOptionGroupOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOptionGroupOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeOptionGroupOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeOptionGroupOptionsInput"} - if s.EngineName == nil { - invalidParams.Add(request.NewErrParamRequired("EngineName")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEngineName sets the EngineName field's value. -func (s *DescribeOptionGroupOptionsInput) SetEngineName(v string) *DescribeOptionGroupOptionsInput { - s.EngineName = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeOptionGroupOptionsInput) SetFilters(v []*Filter) *DescribeOptionGroupOptionsInput { - s.Filters = v - return s -} - -// SetMajorEngineVersion sets the MajorEngineVersion field's value. -func (s *DescribeOptionGroupOptionsInput) SetMajorEngineVersion(v string) *DescribeOptionGroupOptionsInput { - s.MajorEngineVersion = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOptionGroupOptionsInput) SetMarker(v string) *DescribeOptionGroupOptionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeOptionGroupOptionsInput) SetMaxRecords(v int64) *DescribeOptionGroupOptionsInput { - s.MaxRecords = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionGroupOptionsMessage -type DescribeOptionGroupOptionsOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // List of available option group options. - OptionGroupOptions []*OptionGroupOption `locationNameList:"OptionGroupOption" type:"list"` -} - -// String returns the string representation -func (s DescribeOptionGroupOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOptionGroupOptionsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOptionGroupOptionsOutput) SetMarker(v string) *DescribeOptionGroupOptionsOutput { - s.Marker = &v - return s -} - -// SetOptionGroupOptions sets the OptionGroupOptions field's value. -func (s *DescribeOptionGroupOptionsOutput) SetOptionGroupOptions(v []*OptionGroupOption) *DescribeOptionGroupOptionsOutput { - s.OptionGroupOptions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroupsMessage -type DescribeOptionGroupsInput struct { - _ struct{} `type:"structure"` - - // Filters the list of option groups to only include groups associated with - // a specific database engine. - EngineName *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // Filters the list of option groups to only include groups associated with - // a specific database engine version. If specified, then EngineName must also - // be specified. - MajorEngineVersion *string `type:"string"` - - // An optional pagination token provided by a previous DescribeOptionGroups - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The name of the option group to describe. Cannot be supplied together with - // EngineName or MajorEngineVersion. - OptionGroupName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeOptionGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOptionGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeOptionGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeOptionGroupsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEngineName sets the EngineName field's value. -func (s *DescribeOptionGroupsInput) SetEngineName(v string) *DescribeOptionGroupsInput { - s.EngineName = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeOptionGroupsInput) SetFilters(v []*Filter) *DescribeOptionGroupsInput { - s.Filters = v - return s -} - -// SetMajorEngineVersion sets the MajorEngineVersion field's value. -func (s *DescribeOptionGroupsInput) SetMajorEngineVersion(v string) *DescribeOptionGroupsInput { - s.MajorEngineVersion = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOptionGroupsInput) SetMarker(v string) *DescribeOptionGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeOptionGroupsInput) SetMaxRecords(v int64) *DescribeOptionGroupsInput { - s.MaxRecords = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *DescribeOptionGroupsInput) SetOptionGroupName(v string) *DescribeOptionGroupsInput { - s.OptionGroupName = &v - return s -} - -// List of option groups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionGroups -type DescribeOptionGroupsOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // List of option groups. - OptionGroupsList []*OptionGroup `locationNameList:"OptionGroup" type:"list"` -} - -// String returns the string representation -func (s DescribeOptionGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOptionGroupsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOptionGroupsOutput) SetMarker(v string) *DescribeOptionGroupsOutput { - s.Marker = &v - return s -} - -// SetOptionGroupsList sets the OptionGroupsList field's value. -func (s *DescribeOptionGroupsOutput) SetOptionGroupsList(v []*OptionGroup) *DescribeOptionGroupsOutput { - s.OptionGroupsList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOrderableDBInstanceOptionsMessage -type DescribeOrderableDBInstanceOptionsInput struct { - _ struct{} `type:"structure"` - - // The DB instance class filter value. Specify this parameter to show only the - // available offerings matching the specified DB instance class. - DBInstanceClass *string `type:"string"` - - // The name of the engine to retrieve DB instance options for. - // - // Engine is a required field - Engine *string `type:"string" required:"true"` - - // The engine version filter value. Specify this parameter to show only the - // available offerings matching the specified engine version. - EngineVersion *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // The license model filter value. Specify this parameter to show only the available - // offerings matching the specified license model. - LicenseModel *string `type:"string"` - - // An optional pagination token provided by a previous DescribeOrderableDBInstanceOptions - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords . - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The VPC filter value. Specify this parameter to show only the available VPC - // or non-VPC offerings. - Vpc *bool `type:"boolean"` -} - -// String returns the string representation -func (s DescribeOrderableDBInstanceOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOrderableDBInstanceOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeOrderableDBInstanceOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeOrderableDBInstanceOptionsInput"} - if s.Engine == nil { - invalidParams.Add(request.NewErrParamRequired("Engine")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *DescribeOrderableDBInstanceOptionsInput) SetDBInstanceClass(v string) *DescribeOrderableDBInstanceOptionsInput { - s.DBInstanceClass = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *DescribeOrderableDBInstanceOptionsInput) SetEngine(v string) *DescribeOrderableDBInstanceOptionsInput { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *DescribeOrderableDBInstanceOptionsInput) SetEngineVersion(v string) *DescribeOrderableDBInstanceOptionsInput { - s.EngineVersion = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeOrderableDBInstanceOptionsInput) SetFilters(v []*Filter) *DescribeOrderableDBInstanceOptionsInput { - s.Filters = v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *DescribeOrderableDBInstanceOptionsInput) SetLicenseModel(v string) *DescribeOrderableDBInstanceOptionsInput { - s.LicenseModel = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOrderableDBInstanceOptionsInput) SetMarker(v string) *DescribeOrderableDBInstanceOptionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeOrderableDBInstanceOptionsInput) SetMaxRecords(v int64) *DescribeOrderableDBInstanceOptionsInput { - s.MaxRecords = &v - return s -} - -// SetVpc sets the Vpc field's value. -func (s *DescribeOrderableDBInstanceOptionsInput) SetVpc(v bool) *DescribeOrderableDBInstanceOptionsInput { - s.Vpc = &v - return s -} - -// Contains the result of a successful invocation of the DescribeOrderableDBInstanceOptions -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OrderableDBInstanceOptionsMessage -type DescribeOrderableDBInstanceOptionsOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous OrderableDBInstanceOptions - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords . - Marker *string `type:"string"` - - // An OrderableDBInstanceOption structure containing information about orderable - // options for the DB instance. - OrderableDBInstanceOptions []*OrderableDBInstanceOption `locationNameList:"OrderableDBInstanceOption" type:"list"` -} - -// String returns the string representation -func (s DescribeOrderableDBInstanceOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOrderableDBInstanceOptionsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOrderableDBInstanceOptionsOutput) SetMarker(v string) *DescribeOrderableDBInstanceOptionsOutput { - s.Marker = &v - return s -} - -// SetOrderableDBInstanceOptions sets the OrderableDBInstanceOptions field's value. -func (s *DescribeOrderableDBInstanceOptionsOutput) SetOrderableDBInstanceOptions(v []*OrderableDBInstanceOption) *DescribeOrderableDBInstanceOptionsOutput { - s.OrderableDBInstanceOptions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribePendingMaintenanceActionsMessage -type DescribePendingMaintenanceActionsInput struct { - _ struct{} `type:"structure"` - - // A filter that specifies one or more resources to return pending maintenance - // actions for. - // - // Supported filters: - // - // * db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon - // Resource Names (ARNs). The results list will only include pending maintenance - // actions for the DB clusters identified by these ARNs. - // - // * db-instance-id - Accepts DB instance identifiers and DB instance ARNs. - // The results list will only include pending maintenance actions for the - // DB instances identified by these ARNs. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribePendingMaintenanceActions - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to a number of records specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The ARN of a resource to return pending maintenance actions for. - ResourceIdentifier *string `type:"string"` -} - -// String returns the string representation -func (s DescribePendingMaintenanceActionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePendingMaintenanceActionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribePendingMaintenanceActionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribePendingMaintenanceActionsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribePendingMaintenanceActionsInput) SetFilters(v []*Filter) *DescribePendingMaintenanceActionsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribePendingMaintenanceActionsInput) SetMarker(v string) *DescribePendingMaintenanceActionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribePendingMaintenanceActionsInput) SetMaxRecords(v int64) *DescribePendingMaintenanceActionsInput { - s.MaxRecords = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *DescribePendingMaintenanceActionsInput) SetResourceIdentifier(v string) *DescribePendingMaintenanceActionsInput { - s.ResourceIdentifier = &v - return s -} - -// Data returned from the DescribePendingMaintenanceActions action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PendingMaintenanceActionsMessage -type DescribePendingMaintenanceActionsOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous DescribePendingMaintenanceActions - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to a number of records specified by MaxRecords. - Marker *string `type:"string"` - - // A list of the pending maintenance actions for the resource. - PendingMaintenanceActions []*ResourcePendingMaintenanceActions `locationNameList:"ResourcePendingMaintenanceActions" type:"list"` -} - -// String returns the string representation -func (s DescribePendingMaintenanceActionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePendingMaintenanceActionsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribePendingMaintenanceActionsOutput) SetMarker(v string) *DescribePendingMaintenanceActionsOutput { - s.Marker = &v - return s -} - -// SetPendingMaintenanceActions sets the PendingMaintenanceActions field's value. -func (s *DescribePendingMaintenanceActionsOutput) SetPendingMaintenanceActions(v []*ResourcePendingMaintenanceActions) *DescribePendingMaintenanceActionsOutput { - s.PendingMaintenanceActions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeReservedDBInstancesMessage -type DescribeReservedDBInstancesInput struct { - _ struct{} `type:"structure"` - - // The DB instance class filter value. Specify this parameter to show only those - // reservations matching the specified DB instances class. - DBInstanceClass *string `type:"string"` - - // The duration filter value, specified in years or seconds. Specify this parameter - // to show only reservations for this duration. - // - // Valid Values: 1 | 3 | 31536000 | 94608000 - Duration *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more than the - // MaxRecords value is available, a pagination token called a marker is included - // in the response so that the following results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The Multi-AZ filter value. Specify this parameter to show only those reservations - // matching the specified Multi-AZ parameter. - MultiAZ *bool `type:"boolean"` - - // The offering type filter value. Specify this parameter to show only the available - // offerings matching the specified offering type. - // - // Valid Values: "Partial Upfront" | "All Upfront" | "No Upfront" - OfferingType *string `type:"string"` - - // The product description filter value. Specify this parameter to show only - // those reservations matching the specified product description. - ProductDescription *string `type:"string"` - - // The reserved DB instance identifier filter value. Specify this parameter - // to show only the reservation that matches the specified reservation ID. - ReservedDBInstanceId *string `type:"string"` - - // The offering identifier filter value. Specify this parameter to show only - // purchased reservations matching the specified offering identifier. - ReservedDBInstancesOfferingId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeReservedDBInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedDBInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeReservedDBInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeReservedDBInstancesInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *DescribeReservedDBInstancesInput) SetDBInstanceClass(v string) *DescribeReservedDBInstancesInput { - s.DBInstanceClass = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *DescribeReservedDBInstancesInput) SetDuration(v string) *DescribeReservedDBInstancesInput { - s.Duration = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedDBInstancesInput) SetFilters(v []*Filter) *DescribeReservedDBInstancesInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedDBInstancesInput) SetMarker(v string) *DescribeReservedDBInstancesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReservedDBInstancesInput) SetMaxRecords(v int64) *DescribeReservedDBInstancesInput { - s.MaxRecords = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *DescribeReservedDBInstancesInput) SetMultiAZ(v bool) *DescribeReservedDBInstancesInput { - s.MultiAZ = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservedDBInstancesInput) SetOfferingType(v string) *DescribeReservedDBInstancesInput { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *DescribeReservedDBInstancesInput) SetProductDescription(v string) *DescribeReservedDBInstancesInput { - s.ProductDescription = &v - return s -} - -// SetReservedDBInstanceId sets the ReservedDBInstanceId field's value. -func (s *DescribeReservedDBInstancesInput) SetReservedDBInstanceId(v string) *DescribeReservedDBInstancesInput { - s.ReservedDBInstanceId = &v - return s -} - -// SetReservedDBInstancesOfferingId sets the ReservedDBInstancesOfferingId field's value. -func (s *DescribeReservedDBInstancesInput) SetReservedDBInstancesOfferingId(v string) *DescribeReservedDBInstancesInput { - s.ReservedDBInstancesOfferingId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeReservedDBInstancesOfferingsMessage -type DescribeReservedDBInstancesOfferingsInput struct { - _ struct{} `type:"structure"` - - // The DB instance class filter value. Specify this parameter to show only the - // available offerings matching the specified DB instance class. - DBInstanceClass *string `type:"string"` - - // Duration filter value, specified in years or seconds. Specify this parameter - // to show only reservations for this duration. - // - // Valid Values: 1 | 3 | 31536000 | 94608000 - Duration *string `type:"string"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more than the - // MaxRecords value is available, a pagination token called a marker is included - // in the response so that the following results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The Multi-AZ filter value. Specify this parameter to show only the available - // offerings matching the specified Multi-AZ parameter. - MultiAZ *bool `type:"boolean"` - - // The offering type filter value. Specify this parameter to show only the available - // offerings matching the specified offering type. - // - // Valid Values: "Partial Upfront" | "All Upfront" | "No Upfront" - OfferingType *string `type:"string"` - - // Product description filter value. Specify this parameter to show only the - // available offerings matching the specified product description. - ProductDescription *string `type:"string"` - - // The offering identifier filter value. Specify this parameter to show only - // the available offering that matches the specified reservation identifier. - // - // Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706 - ReservedDBInstancesOfferingId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeReservedDBInstancesOfferingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedDBInstancesOfferingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeReservedDBInstancesOfferingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeReservedDBInstancesOfferingsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetDBInstanceClass(v string) *DescribeReservedDBInstancesOfferingsInput { - s.DBInstanceClass = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetDuration(v string) *DescribeReservedDBInstancesOfferingsInput { - s.Duration = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetFilters(v []*Filter) *DescribeReservedDBInstancesOfferingsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetMarker(v string) *DescribeReservedDBInstancesOfferingsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetMaxRecords(v int64) *DescribeReservedDBInstancesOfferingsInput { - s.MaxRecords = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetMultiAZ(v bool) *DescribeReservedDBInstancesOfferingsInput { - s.MultiAZ = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetOfferingType(v string) *DescribeReservedDBInstancesOfferingsInput { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetProductDescription(v string) *DescribeReservedDBInstancesOfferingsInput { - s.ProductDescription = &v - return s -} - -// SetReservedDBInstancesOfferingId sets the ReservedDBInstancesOfferingId field's value. -func (s *DescribeReservedDBInstancesOfferingsInput) SetReservedDBInstancesOfferingId(v string) *DescribeReservedDBInstancesOfferingsInput { - s.ReservedDBInstancesOfferingId = &v - return s -} - -// Contains the result of a successful invocation of the DescribeReservedDBInstancesOfferings -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ReservedDBInstancesOfferingMessage -type DescribeReservedDBInstancesOfferingsOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // A list of reserved DB instance offerings. - ReservedDBInstancesOfferings []*ReservedDBInstancesOffering `locationNameList:"ReservedDBInstancesOffering" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedDBInstancesOfferingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedDBInstancesOfferingsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedDBInstancesOfferingsOutput) SetMarker(v string) *DescribeReservedDBInstancesOfferingsOutput { - s.Marker = &v - return s -} - -// SetReservedDBInstancesOfferings sets the ReservedDBInstancesOfferings field's value. -func (s *DescribeReservedDBInstancesOfferingsOutput) SetReservedDBInstancesOfferings(v []*ReservedDBInstancesOffering) *DescribeReservedDBInstancesOfferingsOutput { - s.ReservedDBInstancesOfferings = v - return s -} - -// Contains the result of a successful invocation of the DescribeReservedDBInstances -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ReservedDBInstanceMessage -type DescribeReservedDBInstancesOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // A list of reserved DB instances. - ReservedDBInstances []*ReservedDBInstance `locationNameList:"ReservedDBInstance" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedDBInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedDBInstancesOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedDBInstancesOutput) SetMarker(v string) *DescribeReservedDBInstancesOutput { - s.Marker = &v - return s -} - -// SetReservedDBInstances sets the ReservedDBInstances field's value. -func (s *DescribeReservedDBInstancesOutput) SetReservedDBInstances(v []*ReservedDBInstance) *DescribeReservedDBInstancesOutput { - s.ReservedDBInstances = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeSourceRegionsMessage -type DescribeSourceRegionsInput struct { - _ struct{} `type:"structure"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // An optional pagination token provided by a previous DescribeSourceRegions - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by MaxRecords. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - // - // Default: 100 - // - // Constraints: Minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The source region name. For example, us-east-1. - // - // Constraints: - // - // * Must specify a valid AWS Region name. - RegionName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeSourceRegionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSourceRegionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSourceRegionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSourceRegionsInput"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSourceRegionsInput) SetFilters(v []*Filter) *DescribeSourceRegionsInput { - s.Filters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSourceRegionsInput) SetMarker(v string) *DescribeSourceRegionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeSourceRegionsInput) SetMaxRecords(v int64) *DescribeSourceRegionsInput { - s.MaxRecords = &v - return s -} - -// SetRegionName sets the RegionName field's value. -func (s *DescribeSourceRegionsInput) SetRegionName(v string) *DescribeSourceRegionsInput { - s.RegionName = &v - return s -} - -// Contains the result of a successful invocation of the DescribeSourceRegions -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/SourceRegionMessage -type DescribeSourceRegionsOutput struct { - _ struct{} `type:"structure"` - - // An optional pagination token provided by a previous request. If this parameter - // is specified, the response includes only records beyond the marker, up to - // the value specified by MaxRecords. - Marker *string `type:"string"` - - // A list of SourceRegion instances that contains each source AWS Region that - // the current region can get a Read Replica or a DB snapshot from. - SourceRegions []*SourceRegion `locationNameList:"SourceRegion" type:"list"` -} - -// String returns the string representation -func (s DescribeSourceRegionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSourceRegionsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSourceRegionsOutput) SetMarker(v string) *DescribeSourceRegionsOutput { - s.Marker = &v - return s -} - -// SetSourceRegions sets the SourceRegions field's value. -func (s *DescribeSourceRegionsOutput) SetSourceRegions(v []*SourceRegion) *DescribeSourceRegionsOutput { - s.SourceRegions = v - return s -} - -// An Active Directory Domain membership record associated with the DB instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DomainMembership -type DomainMembership struct { - _ struct{} `type:"structure"` - - // The identifier of the Active Directory Domain. - Domain *string `type:"string"` - - // The fully qualified domain name of the Active Directory Domain. - FQDN *string `type:"string"` - - // The name of the IAM role to be used when making API calls to the Directory - // Service. - IAMRoleName *string `type:"string"` - - // The status of the DB instance's Active Directory Domain membership, such - // as joined, pending-join, failed etc). - Status *string `type:"string"` -} - -// String returns the string representation -func (s DomainMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DomainMembership) GoString() string { - return s.String() -} - -// SetDomain sets the Domain field's value. -func (s *DomainMembership) SetDomain(v string) *DomainMembership { - s.Domain = &v - return s -} - -// SetFQDN sets the FQDN field's value. -func (s *DomainMembership) SetFQDN(v string) *DomainMembership { - s.FQDN = &v - return s -} - -// SetIAMRoleName sets the IAMRoleName field's value. -func (s *DomainMembership) SetIAMRoleName(v string) *DomainMembership { - s.IAMRoleName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DomainMembership) SetStatus(v string) *DomainMembership { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DownloadDBLogFilePortionMessage -type DownloadDBLogFilePortionInput struct { - _ struct{} `type:"structure"` - - // The customer-assigned name of the DB instance that contains the log files - // you want to list. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // The name of the log file to be downloaded. - // - // LogFileName is a required field - LogFileName *string `type:"string" required:"true"` - - // The pagination token provided in the previous request or "0". If the Marker - // parameter is specified the response includes only records beyond the marker - // until the end of the file or up to NumberOfLines. - Marker *string `type:"string"` - - // The number of lines to download. If the number of lines specified results - // in a file over 1 MB in size, the file will be truncated at 1 MB in size. - // - // If the NumberOfLines parameter is specified, then the block of lines returned - // can be from the beginning or the end of the log file, depending on the value - // of the Marker parameter. - // - // * If neither Marker or NumberOfLines are specified, the entire log file - // is returned up to a maximum of 10000 lines, starting with the most recent - // log entries first. - // - // * If NumberOfLines is specified and Marker is not specified, then the - // most recent lines from the end of the log file are returned. - // - // * If Marker is specified as "0", then the specified number of lines from - // the beginning of the log file are returned. - // - // * You can download the log file in blocks of lines by specifying the size - // of the block using the NumberOfLines parameter, and by specifying a value - // of "0" for the Marker parameter in your first request. Include the Marker - // value returned in the response as the Marker value for the next request, - // continuing until the AdditionalDataPending response element returns false. - NumberOfLines *int64 `type:"integer"` -} - -// String returns the string representation -func (s DownloadDBLogFilePortionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DownloadDBLogFilePortionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DownloadDBLogFilePortionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DownloadDBLogFilePortionInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - if s.LogFileName == nil { - invalidParams.Add(request.NewErrParamRequired("LogFileName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *DownloadDBLogFilePortionInput) SetDBInstanceIdentifier(v string) *DownloadDBLogFilePortionInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetLogFileName sets the LogFileName field's value. -func (s *DownloadDBLogFilePortionInput) SetLogFileName(v string) *DownloadDBLogFilePortionInput { - s.LogFileName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DownloadDBLogFilePortionInput) SetMarker(v string) *DownloadDBLogFilePortionInput { - s.Marker = &v - return s -} - -// SetNumberOfLines sets the NumberOfLines field's value. -func (s *DownloadDBLogFilePortionInput) SetNumberOfLines(v int64) *DownloadDBLogFilePortionInput { - s.NumberOfLines = &v - return s -} - -// This data type is used as a response element to DownloadDBLogFilePortion. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DownloadDBLogFilePortionDetails -type DownloadDBLogFilePortionOutput struct { - _ struct{} `type:"structure"` - - // Boolean value that if true, indicates there is more data to be downloaded. - AdditionalDataPending *bool `type:"boolean"` - - // Entries from the specified log file. - LogFileData *string `type:"string"` - - // A pagination token that can be used in a subsequent DownloadDBLogFilePortion - // request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DownloadDBLogFilePortionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DownloadDBLogFilePortionOutput) GoString() string { - return s.String() -} - -// SetAdditionalDataPending sets the AdditionalDataPending field's value. -func (s *DownloadDBLogFilePortionOutput) SetAdditionalDataPending(v bool) *DownloadDBLogFilePortionOutput { - s.AdditionalDataPending = &v - return s -} - -// SetLogFileData sets the LogFileData field's value. -func (s *DownloadDBLogFilePortionOutput) SetLogFileData(v string) *DownloadDBLogFilePortionOutput { - s.LogFileData = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DownloadDBLogFilePortionOutput) SetMarker(v string) *DownloadDBLogFilePortionOutput { - s.Marker = &v - return s -} - -// This data type is used as a response element in the following actions: -// -// * AuthorizeDBSecurityGroupIngress -// -// * DescribeDBSecurityGroups -// -// * RevokeDBSecurityGroupIngress -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/EC2SecurityGroup -type EC2SecurityGroup struct { - _ struct{} `type:"structure"` - - // Specifies the id of the EC2 security group. - EC2SecurityGroupId *string `type:"string"` - - // Specifies the name of the EC2 security group. - EC2SecurityGroupName *string `type:"string"` - - // Specifies the AWS ID of the owner of the EC2 security group specified in - // the EC2SecurityGroupName field. - EC2SecurityGroupOwnerId *string `type:"string"` - - // Provides the status of the EC2 security group. Status can be "authorizing", - // "authorized", "revoking", and "revoked". - Status *string `type:"string"` -} - -// String returns the string representation -func (s EC2SecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EC2SecurityGroup) GoString() string { - return s.String() -} - -// SetEC2SecurityGroupId sets the EC2SecurityGroupId field's value. -func (s *EC2SecurityGroup) SetEC2SecurityGroupId(v string) *EC2SecurityGroup { - s.EC2SecurityGroupId = &v - return s -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *EC2SecurityGroup) SetEC2SecurityGroupName(v string) *EC2SecurityGroup { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *EC2SecurityGroup) SetEC2SecurityGroupOwnerId(v string) *EC2SecurityGroup { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EC2SecurityGroup) SetStatus(v string) *EC2SecurityGroup { - s.Status = &v - return s -} - -// This data type is used as a response element in the following actions: -// -// * CreateDBInstance -// -// * DescribeDBInstances -// -// * DeleteDBInstance -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Endpoint -type Endpoint struct { - _ struct{} `type:"structure"` - - // Specifies the DNS address of the DB instance. - Address *string `type:"string"` - - // Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. - HostedZoneId *string `type:"string"` - - // Specifies the port that the database engine is listening on. - Port *int64 `type:"integer"` -} - -// String returns the string representation -func (s Endpoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Endpoint) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *Endpoint) SetAddress(v string) *Endpoint { - s.Address = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *Endpoint) SetHostedZoneId(v string) *Endpoint { - s.HostedZoneId = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Endpoint) SetPort(v int64) *Endpoint { - s.Port = &v - return s -} - -// Contains the result of a successful invocation of the DescribeEngineDefaultParameters -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/EngineDefaults -type EngineDefaults struct { - _ struct{} `type:"structure"` - - // Specifies the name of the DB parameter group family that the engine default - // parameters apply to. - DBParameterGroupFamily *string `type:"string"` - - // An optional pagination token provided by a previous EngineDefaults request. - // If this parameter is specified, the response includes only records beyond - // the marker, up to the value specified by MaxRecords . - Marker *string `type:"string"` - - // Contains a list of engine default parameters. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` -} - -// String returns the string representation -func (s EngineDefaults) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EngineDefaults) GoString() string { - return s.String() -} - -// SetDBParameterGroupFamily sets the DBParameterGroupFamily field's value. -func (s *EngineDefaults) SetDBParameterGroupFamily(v string) *EngineDefaults { - s.DBParameterGroupFamily = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *EngineDefaults) SetMarker(v string) *EngineDefaults { - s.Marker = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *EngineDefaults) SetParameters(v []*Parameter) *EngineDefaults { - s.Parameters = v - return s -} - -// This data type is used as a response element in the DescribeEvents action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Event -type Event struct { - _ struct{} `type:"structure"` - - // Specifies the date and time of the event. - Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the category for the event. - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // Provides the text of this event. - Message *string `type:"string"` - - // The Amazon Resource Name (ARN) for the event. - SourceArn *string `type:"string"` - - // Provides the identifier for the source of the event. - SourceIdentifier *string `type:"string"` - - // Specifies the source type for this event. - SourceType *string `type:"string" enum:"SourceType"` -} - -// String returns the string representation -func (s Event) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Event) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *Event) SetDate(v time.Time) *Event { - s.Date = &v - return s -} - -// SetEventCategories sets the EventCategories field's value. -func (s *Event) SetEventCategories(v []*string) *Event { - s.EventCategories = v - return s -} - -// SetMessage sets the Message field's value. -func (s *Event) SetMessage(v string) *Event { - s.Message = &v - return s -} - -// SetSourceArn sets the SourceArn field's value. -func (s *Event) SetSourceArn(v string) *Event { - s.SourceArn = &v - return s -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *Event) SetSourceIdentifier(v string) *Event { - s.SourceIdentifier = &v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *Event) SetSourceType(v string) *Event { - s.SourceType = &v - return s -} - -// Contains the results of a successful invocation of the DescribeEventCategories -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/EventCategoriesMap -type EventCategoriesMap struct { - _ struct{} `type:"structure"` - - // The event categories for the specified source type - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // The source type that the returned categories belong to - SourceType *string `type:"string"` -} - -// String returns the string representation -func (s EventCategoriesMap) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventCategoriesMap) GoString() string { - return s.String() -} - -// SetEventCategories sets the EventCategories field's value. -func (s *EventCategoriesMap) SetEventCategories(v []*string) *EventCategoriesMap { - s.EventCategories = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *EventCategoriesMap) SetSourceType(v string) *EventCategoriesMap { - s.SourceType = &v - return s -} - -// Contains the results of a successful invocation of the DescribeEventSubscriptions -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/EventSubscription -type EventSubscription struct { - _ struct{} `type:"structure"` - - // The RDS event notification subscription Id. - CustSubscriptionId *string `type:"string"` - - // The AWS customer account associated with the RDS event notification subscription. - CustomerAwsId *string `type:"string"` - - // A Boolean value indicating if the subscription is enabled. True indicates - // the subscription is enabled. - Enabled *bool `type:"boolean"` - - // A list of event categories for the RDS event notification subscription. - EventCategoriesList []*string `locationNameList:"EventCategory" type:"list"` - - // The Amazon Resource Name (ARN) for the event subscription. - EventSubscriptionArn *string `type:"string"` - - // The topic ARN of the RDS event notification subscription. - SnsTopicArn *string `type:"string"` - - // A list of source IDs for the RDS event notification subscription. - SourceIdsList []*string `locationNameList:"SourceId" type:"list"` - - // The source type for the RDS event notification subscription. - SourceType *string `type:"string"` - - // The status of the RDS event notification subscription. - // - // Constraints: - // - // Can be one of the following: creating | modifying | deleting | active | no-permission - // | topic-not-exist - // - // The status "no-permission" indicates that RDS no longer has permission to - // post to the SNS topic. The status "topic-not-exist" indicates that the topic - // was deleted after the subscription was created. - Status *string `type:"string"` - - // The time the RDS event notification subscription was created. - SubscriptionCreationTime *string `type:"string"` -} - -// String returns the string representation -func (s EventSubscription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventSubscription) GoString() string { - return s.String() -} - -// SetCustSubscriptionId sets the CustSubscriptionId field's value. -func (s *EventSubscription) SetCustSubscriptionId(v string) *EventSubscription { - s.CustSubscriptionId = &v - return s -} - -// SetCustomerAwsId sets the CustomerAwsId field's value. -func (s *EventSubscription) SetCustomerAwsId(v string) *EventSubscription { - s.CustomerAwsId = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *EventSubscription) SetEnabled(v bool) *EventSubscription { - s.Enabled = &v - return s -} - -// SetEventCategoriesList sets the EventCategoriesList field's value. -func (s *EventSubscription) SetEventCategoriesList(v []*string) *EventSubscription { - s.EventCategoriesList = v - return s -} - -// SetEventSubscriptionArn sets the EventSubscriptionArn field's value. -func (s *EventSubscription) SetEventSubscriptionArn(v string) *EventSubscription { - s.EventSubscriptionArn = &v - return s -} - -// SetSnsTopicArn sets the SnsTopicArn field's value. -func (s *EventSubscription) SetSnsTopicArn(v string) *EventSubscription { - s.SnsTopicArn = &v - return s -} - -// SetSourceIdsList sets the SourceIdsList field's value. -func (s *EventSubscription) SetSourceIdsList(v []*string) *EventSubscription { - s.SourceIdsList = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *EventSubscription) SetSourceType(v string) *EventSubscription { - s.SourceType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EventSubscription) SetStatus(v string) *EventSubscription { - s.Status = &v - return s -} - -// SetSubscriptionCreationTime sets the SubscriptionCreationTime field's value. -func (s *EventSubscription) SetSubscriptionCreationTime(v string) *EventSubscription { - s.SubscriptionCreationTime = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/FailoverDBClusterMessage -type FailoverDBClusterInput struct { - _ struct{} `type:"structure"` - - // A DB cluster identifier to force a failover for. This parameter is not case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBClusterIdentifier *string `type:"string"` - - // The name of the instance to promote to the primary instance. - // - // You must specify the instance identifier for an Aurora Replica in the DB - // cluster. For example, mydbcluster-replica1. - TargetDBInstanceIdentifier *string `type:"string"` -} - -// String returns the string representation -func (s FailoverDBClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FailoverDBClusterInput) GoString() string { - return s.String() -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *FailoverDBClusterInput) SetDBClusterIdentifier(v string) *FailoverDBClusterInput { - s.DBClusterIdentifier = &v - return s -} - -// SetTargetDBInstanceIdentifier sets the TargetDBInstanceIdentifier field's value. -func (s *FailoverDBClusterInput) SetTargetDBInstanceIdentifier(v string) *FailoverDBClusterInput { - s.TargetDBInstanceIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/FailoverDBClusterResult -type FailoverDBClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBCluster - // - // * DeleteDBCluster - // - // * FailoverDBCluster - // - // * ModifyDBCluster - // - // * RestoreDBClusterFromSnapshot - // - // * RestoreDBClusterToPointInTime - // - // This data type is used as a response element in the DescribeDBClusters action. - DBCluster *DBCluster `type:"structure"` -} - -// String returns the string representation -func (s FailoverDBClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FailoverDBClusterOutput) GoString() string { - return s.String() -} - -// SetDBCluster sets the DBCluster field's value. -func (s *FailoverDBClusterOutput) SetDBCluster(v *DBCluster) *FailoverDBClusterOutput { - s.DBCluster = v - return s -} - -// This type is not currently supported. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Filter -type Filter struct { - _ struct{} `type:"structure"` - - // This parameter is not currently supported. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // This parameter is not currently supported. - // - // Values is a required field - Values []*string `locationNameList:"Value" type:"list" required:"true"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Filter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Filter"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// 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 -} - -// This data type is used as a response element in the DescribeDBSecurityGroups -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/IPRange -type IPRange struct { - _ struct{} `type:"structure"` - - // Specifies the IP range. - CIDRIP *string `type:"string"` - - // Specifies the status of the IP range. Status can be "authorizing", "authorized", - // "revoking", and "revoked". - Status *string `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 -} - -// SetStatus sets the Status field's value. -func (s *IPRange) SetStatus(v string) *IPRange { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ListTagsForResourceMessage -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // This parameter is not currently supported. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // The Amazon RDS resource with tags to be listed. This value is an Amazon Resource - // Name (ARN). For information about creating an ARN, see Constructing an RDS - // Amazon Resource Name (ARN) (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing). - // - // ResourceName is a required field - ResourceName *string `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.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListTagsForResourceInput) SetFilters(v []*Filter) *ListTagsForResourceInput { - s.Filters = v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *ListTagsForResourceInput) SetResourceName(v string) *ListTagsForResourceInput { - s.ResourceName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/TagListMessage -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // List of tags returned by the ListTagsForResource operation. - TagList []*Tag `locationNameList:"Tag" type:"list"` -} - -// 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() -} - -// SetTagList sets the TagList field's value. -func (s *ListTagsForResourceOutput) SetTagList(v []*Tag) *ListTagsForResourceOutput { - s.TagList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterMessage -type ModifyDBClusterInput struct { - _ struct{} `type:"structure"` - - // A value that specifies whether the modifications in this request and any - // pending modifications are asynchronously applied as soon as possible, regardless - // of the PreferredMaintenanceWindow setting for the DB cluster. If this parameter - // is set to false, changes to the DB cluster are applied during the next maintenance - // window. - // - // The ApplyImmediately parameter only affects the NewDBClusterIdentifier and - // MasterUserPassword values. If you set the ApplyImmediately parameter value - // to false, then changes to the NewDBClusterIdentifier and MasterUserPassword - // values are applied during the next maintenance window. All other changes - // are applied immediately, regardless of the value of the ApplyImmediately - // parameter. - // - // Default: false - ApplyImmediately *bool `type:"boolean"` - - // The number of days for which automated backups are retained. You must specify - // a minimum value of 1. - // - // Default: 1 - // - // Constraints: - // - // * Must be a value from 1 to 35 - BackupRetentionPeriod *int64 `type:"integer"` - - // The DB cluster identifier for the cluster being modified. This parameter - // is not case-sensitive. - // - // Constraints: - // - // * Must be the identifier for an existing DB cluster. - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The name of the DB cluster parameter group to use for the DB cluster. - DBClusterParameterGroupName *string `type:"string"` - - // The new password for the master database user. This password can contain - // any printable ASCII character except "/", """, or "@". - // - // Constraints: Must contain from 8 to 41 characters. - MasterUserPassword *string `type:"string"` - - // The new DB cluster identifier for the DB cluster when renaming a DB cluster. - // This value is stored as a lowercase string. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-cluster2 - NewDBClusterIdentifier *string `type:"string"` - - // A value that indicates that the DB cluster should be associated with the - // specified option group. Changing this parameter does not result in an outage - // except in the following case, and the change is applied during the next maintenance - // window unless the ApplyImmediately parameter is set to true for this request. - // If the parameter change results in an option group that enables OEM, this - // change can cause a brief (sub-second) period during which new connections - // are rejected but existing connections are not interrupted. - // - // Permanent options cannot be removed from an option group. The option group - // cannot be removed from a DB cluster once it is associated with a DB cluster. - OptionGroupName *string `type:"string"` - - // The port number on which the DB cluster accepts connections. - // - // Constraints: Value must be 1150-65535 - // - // Default: The same port as the original DB cluster. - Port *int64 `type:"integer"` - - // The daily time range during which automated backups are created if automated - // backups are enabled, using the BackupRetentionPeriod parameter. - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region. To see the time blocks available, see Adjusting the Preferred - // Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Constraints: - // - // * Must be in the format hh24:mi-hh24:mi. - // - // * Times should be in Universal Coordinated Time (UTC). - // - // * Must not conflict with the preferred maintenance window. - // - // * Must be at least 30 minutes. - PreferredBackupWindow *string `type:"string"` - - // The weekly time range during which system maintenance can occur, in Universal - // Coordinated Time (UTC). - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region, occurring on a random day of the week. To see the time blocks - // available, see Adjusting the Preferred Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `type:"string"` - - // A lst of VPC security groups that the DB cluster will belong to. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s ModifyDBClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDBClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDBClusterInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyImmediately sets the ApplyImmediately field's value. -func (s *ModifyDBClusterInput) SetApplyImmediately(v bool) *ModifyDBClusterInput { - s.ApplyImmediately = &v - return s -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *ModifyDBClusterInput) SetBackupRetentionPeriod(v int64) *ModifyDBClusterInput { - s.BackupRetentionPeriod = &v - return s -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *ModifyDBClusterInput) SetDBClusterIdentifier(v string) *ModifyDBClusterInput { - s.DBClusterIdentifier = &v - return s -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *ModifyDBClusterInput) SetDBClusterParameterGroupName(v string) *ModifyDBClusterInput { - s.DBClusterParameterGroupName = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *ModifyDBClusterInput) SetMasterUserPassword(v string) *ModifyDBClusterInput { - s.MasterUserPassword = &v - return s -} - -// SetNewDBClusterIdentifier sets the NewDBClusterIdentifier field's value. -func (s *ModifyDBClusterInput) SetNewDBClusterIdentifier(v string) *ModifyDBClusterInput { - s.NewDBClusterIdentifier = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *ModifyDBClusterInput) SetOptionGroupName(v string) *ModifyDBClusterInput { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *ModifyDBClusterInput) SetPort(v int64) *ModifyDBClusterInput { - s.Port = &v - return s -} - -// SetPreferredBackupWindow sets the PreferredBackupWindow field's value. -func (s *ModifyDBClusterInput) SetPreferredBackupWindow(v string) *ModifyDBClusterInput { - s.PreferredBackupWindow = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *ModifyDBClusterInput) SetPreferredMaintenanceWindow(v string) *ModifyDBClusterInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *ModifyDBClusterInput) SetVpcSecurityGroupIds(v []*string) *ModifyDBClusterInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterResult -type ModifyDBClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBCluster - // - // * DeleteDBCluster - // - // * FailoverDBCluster - // - // * ModifyDBCluster - // - // * RestoreDBClusterFromSnapshot - // - // * RestoreDBClusterToPointInTime - // - // This data type is used as a response element in the DescribeDBClusters action. - DBCluster *DBCluster `type:"structure"` -} - -// String returns the string representation -func (s ModifyDBClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBClusterOutput) GoString() string { - return s.String() -} - -// SetDBCluster sets the DBCluster field's value. -func (s *ModifyDBClusterOutput) SetDBCluster(v *DBCluster) *ModifyDBClusterOutput { - s.DBCluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterParameterGroupMessage -type ModifyDBClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster parameter group to modify. - // - // DBClusterParameterGroupName is a required field - DBClusterParameterGroupName *string `type:"string" required:"true"` - - // A list of parameters in the DB cluster parameter group to modify. - // - // Parameters is a required field - Parameters []*Parameter `locationNameList:"Parameter" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyDBClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDBClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDBClusterParameterGroupInput"} - if s.DBClusterParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterParameterGroupName")) - } - if s.Parameters == nil { - invalidParams.Add(request.NewErrParamRequired("Parameters")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *ModifyDBClusterParameterGroupInput) SetDBClusterParameterGroupName(v string) *ModifyDBClusterParameterGroupInput { - s.DBClusterParameterGroupName = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ModifyDBClusterParameterGroupInput) SetParameters(v []*Parameter) *ModifyDBClusterParameterGroupInput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterSnapshotAttributeMessage -type ModifyDBClusterSnapshotAttributeInput struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster snapshot attribute to modify. - // - // To manage authorization for other AWS accounts to copy or restore a manual - // DB cluster snapshot, set this value to restore. - // - // AttributeName is a required field - AttributeName *string `type:"string" required:"true"` - - // The identifier for the DB cluster snapshot to modify the attributes for. - // - // DBClusterSnapshotIdentifier is a required field - DBClusterSnapshotIdentifier *string `type:"string" required:"true"` - - // A list of DB cluster snapshot attributes to add to the attribute specified - // by AttributeName. - // - // To authorize other AWS accounts to copy or restore a manual DB cluster snapshot, - // set this list to include one or more AWS account IDs, or all to make the - // manual DB cluster snapshot restorable by any AWS account. Do not add the - // all value for any manual DB cluster snapshots that contain private information - // that you don't want available to all AWS accounts. - ValuesToAdd []*string `locationNameList:"AttributeValue" type:"list"` - - // A list of DB cluster snapshot attributes to remove from the attribute specified - // by AttributeName. - // - // To remove authorization for other AWS accounts to copy or restore a manual - // DB cluster snapshot, set this list to include one or more AWS account identifiers, - // or all to remove authorization for any AWS account to copy or restore the - // DB cluster snapshot. If you specify all, an AWS account whose account ID - // is explicitly added to the restore attribute can still copy or restore a - // manual DB cluster snapshot. - ValuesToRemove []*string `locationNameList:"AttributeValue" type:"list"` -} - -// String returns the string representation -func (s ModifyDBClusterSnapshotAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBClusterSnapshotAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDBClusterSnapshotAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDBClusterSnapshotAttributeInput"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.DBClusterSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *ModifyDBClusterSnapshotAttributeInput) SetAttributeName(v string) *ModifyDBClusterSnapshotAttributeInput { - s.AttributeName = &v - return s -} - -// SetDBClusterSnapshotIdentifier sets the DBClusterSnapshotIdentifier field's value. -func (s *ModifyDBClusterSnapshotAttributeInput) SetDBClusterSnapshotIdentifier(v string) *ModifyDBClusterSnapshotAttributeInput { - s.DBClusterSnapshotIdentifier = &v - return s -} - -// SetValuesToAdd sets the ValuesToAdd field's value. -func (s *ModifyDBClusterSnapshotAttributeInput) SetValuesToAdd(v []*string) *ModifyDBClusterSnapshotAttributeInput { - s.ValuesToAdd = v - return s -} - -// SetValuesToRemove sets the ValuesToRemove field's value. -func (s *ModifyDBClusterSnapshotAttributeInput) SetValuesToRemove(v []*string) *ModifyDBClusterSnapshotAttributeInput { - s.ValuesToRemove = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterSnapshotAttributeResult -type ModifyDBClusterSnapshotAttributeOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful call to the DescribeDBClusterSnapshotAttributes - // API action. - // - // Manual DB cluster snapshot attributes are used to authorize other AWS accounts - // to copy or restore a manual DB cluster snapshot. For more information, see - // the ModifyDBClusterSnapshotAttribute API action. - DBClusterSnapshotAttributesResult *DBClusterSnapshotAttributesResult `type:"structure"` -} - -// String returns the string representation -func (s ModifyDBClusterSnapshotAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBClusterSnapshotAttributeOutput) GoString() string { - return s.String() -} - -// SetDBClusterSnapshotAttributesResult sets the DBClusterSnapshotAttributesResult field's value. -func (s *ModifyDBClusterSnapshotAttributeOutput) SetDBClusterSnapshotAttributesResult(v *DBClusterSnapshotAttributesResult) *ModifyDBClusterSnapshotAttributeOutput { - s.DBClusterSnapshotAttributesResult = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBInstanceMessage -type ModifyDBInstanceInput struct { - _ struct{} `type:"structure"` - - // The new storage capacity of the RDS instance. Changing this setting does - // not result in an outage and the change is applied during the next maintenance - // window unless ApplyImmediately is set to true for this request. - // - // MySQL - // - // Default: Uses existing setting - // - // Valid Values: 5-6144 - // - // Constraints: Value supplied must be at least 10% greater than the current - // value. Values that are not at least 10% greater than the existing value are - // rounded up so that they are 10% greater than the current value. - // - // Type: Integer - // - // MariaDB - // - // Default: Uses existing setting - // - // Valid Values: 5-6144 - // - // Constraints: Value supplied must be at least 10% greater than the current - // value. Values that are not at least 10% greater than the existing value are - // rounded up so that they are 10% greater than the current value. - // - // Type: Integer - // - // PostgreSQL - // - // Default: Uses existing setting - // - // Valid Values: 5-6144 - // - // Constraints: Value supplied must be at least 10% greater than the current - // value. Values that are not at least 10% greater than the existing value are - // rounded up so that they are 10% greater than the current value. - // - // Type: Integer - // - // Oracle - // - // Default: Uses existing setting - // - // Valid Values: 10-6144 - // - // Constraints: Value supplied must be at least 10% greater than the current - // value. Values that are not at least 10% greater than the existing value are - // rounded up so that they are 10% greater than the current value. - // - // SQL Server - // - // Cannot be modified. - // - // If you choose to migrate your DB instance from using standard storage to - // using Provisioned IOPS, or from using Provisioned IOPS to using standard - // storage, the process can take time. The duration of the migration depends - // on several factors such as database load, storage size, storage type (standard - // or Provisioned IOPS), amount of IOPS provisioned (if any), and the number - // of prior scale storage operations. Typical migration times are under 24 hours, - // but the process can take up to several days in some cases. During the migration, - // the DB instance will be available for use, but might experience performance - // degradation. While the migration takes place, nightly backups for the instance - // will be suspended. No other Amazon RDS operations can take place for the - // instance, including modifying the instance, rebooting the instance, deleting - // the instance, creating a Read Replica for the instance, and creating a DB - // snapshot of the instance. - AllocatedStorage *int64 `type:"integer"` - - // Indicates that major version upgrades are allowed. Changing this parameter - // does not result in an outage and the change is asynchronously applied as - // soon as possible. - // - // Constraints: This parameter must be set to true when specifying a value for - // the EngineVersion parameter that is a different major version than the DB - // instance's current version. - AllowMajorVersionUpgrade *bool `type:"boolean"` - - // Specifies whether the modifications in this request and any pending modifications - // are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow - // setting for the DB instance. - // - // If this parameter is set to false, changes to the DB instance are applied - // during the next maintenance window. Some parameter changes can cause an outage - // and will be applied on the next call to RebootDBInstance, or the next failure - // reboot. Review the table of parameters in Modifying a DB Instance and Using - // the Apply Immediately Parameter (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html) - // to see the impact that setting ApplyImmediately to true or false has for - // each modified parameter and to determine when the changes will be applied. - // - // Default: false - ApplyImmediately *bool `type:"boolean"` - - // Indicates that minor version upgrades will be applied automatically to the - // DB instance during the maintenance window. Changing this parameter does not - // result in an outage except in the following case and the change is asynchronously - // applied as soon as possible. An outage will result if this parameter is set - // to true during the maintenance window, and a newer minor version is available, - // and RDS has enabled auto patching for that engine version. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The number of days to retain automated backups. Setting this parameter to - // a positive number enables backups. Setting this parameter to 0 disables automated - // backups. - // - // Changing this parameter can result in an outage if you change from 0 to a - // non-zero value or from a non-zero value to 0. These changes are applied during - // the next maintenance window unless the ApplyImmediately parameter is set - // to true for this request. If you change the parameter from one non-zero value - // to another non-zero value, the change is asynchronously applied as soon as - // possible. - // - // Default: Uses existing setting - // - // Constraints: - // - // * Must be a value from 0 to 35 - // - // * Can be specified for a MySQL Read Replica only if the source is running - // MySQL 5.6 - // - // * Can be specified for a PostgreSQL Read Replica only if the source is - // running PostgreSQL 9.3.5 - // - // * Cannot be set to 0 if the DB instance is a source to Read Replicas - BackupRetentionPeriod *int64 `type:"integer"` - - // Indicates the certificate that needs to be associated with the instance. - CACertificateIdentifier *string `type:"string"` - - // True to copy all tags from the DB instance to snapshots of the DB instance; - // otherwise false. The default is false. - CopyTagsToSnapshot *bool `type:"boolean"` - - // The new compute and memory capacity of the DB instance. To determine the - // instance classes that are available for a particular DB engine, use the DescribeOrderableDBInstanceOptions - // action. Note that not all instance classes are available in all regions for - // all DB engines. - // - // Passing a value for this setting causes an outage during the change and is - // applied during the next maintenance window, unless ApplyImmediately is specified - // as true for this request. - // - // Default: Uses existing setting - // - // Valid Values: db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge - // | db.m2.xlarge | db.m2.2xlarge | db.m2.4xlarge | db.m3.medium | db.m3.large - // | db.m3.xlarge | db.m3.2xlarge | db.m4.large | db.m4.xlarge | db.m4.2xlarge - // | db.m4.4xlarge | db.m4.10xlarge | db.r3.large | db.r3.xlarge | db.r3.2xlarge - // | db.r3.4xlarge | db.r3.8xlarge | db.t2.micro | db.t2.small | db.t2.medium - // | db.t2.large - DBInstanceClass *string `type:"string"` - - // The DB instance identifier. This value is stored as a lowercase string. - // - // Constraints: - // - // * Must be the identifier for an existing DB instance - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // The name of the DB parameter group to apply to the DB instance. Changing - // this setting does not result in an outage. The parameter group name itself - // is changed immediately, but the actual parameter changes are not applied - // until you reboot the instance without failover. The db instance will NOT - // be rebooted automatically and the parameter changes will NOT be applied during - // the next maintenance window. - // - // Default: Uses existing setting - // - // Constraints: The DB parameter group must be in the same DB parameter group - // family as this DB instance. - DBParameterGroupName *string `type:"string"` - - // The port number on which the database accepts connections. - // - // The value of the DBPortNumber parameter must not match any of the port values - // specified for options in the option group for the DB instance. - // - // Your database will restart when you change the DBPortNumber value regardless - // of the value of the ApplyImmediately parameter. - // - // MySQL - // - // Default: 3306 - // - // Valid Values: 1150-65535 - // - // MariaDB - // - // Default: 3306 - // - // Valid Values: 1150-65535 - // - // PostgreSQL - // - // Default: 5432 - // - // Valid Values: 1150-65535 - // - // Type: Integer - // - // Oracle - // - // Default: 1521 - // - // Valid Values: 1150-65535 - // - // SQL Server - // - // Default: 1433 - // - // Valid Values: 1150-65535 except for 1434, 3389, 47001, 49152, and 49152 through - // 49156. - // - // Amazon Aurora - // - // Default: 3306 - // - // Valid Values: 1150-65535 - DBPortNumber *int64 `type:"integer"` - - // A list of DB security groups to authorize on this DB instance. Changing this - // setting does not result in an outage and the change is asynchronously applied - // as soon as possible. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBSecurityGroups []*string `locationNameList:"DBSecurityGroupName" type:"list"` - - // The new DB subnet group for the DB instance. You can use this parameter to - // move your DB instance to a different VPC. If your DB instance is not in a - // VPC, you can also use this parameter to move your DB instance into a VPC. - // For more information, see Updating the VPC for a DB Instance (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Non-VPC2VPC). - // - // Changing the subnet group causes an outage during the change. The change - // is applied during the next maintenance window, unless you specify true for - // the ApplyImmediately parameter. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. - // - // Example: mySubnetGroup - DBSubnetGroupName *string `type:"string"` - - // The Active Directory Domain to move the instance to. Specify none to remove - // the instance from its current domain. The domain must be created prior to - // this operation. Currently only a Microsoft SQL Server instance can be created - // in a Active Directory Domain. - Domain *string `type:"string"` - - // The name of the IAM role to use when making API calls to the Directory Service. - DomainIAMRoleName *string `type:"string"` - - // The version number of the database engine to upgrade to. Changing this parameter - // results in an outage and the change is applied during the next maintenance - // window unless the ApplyImmediately parameter is set to true for this request. - // - // For major version upgrades, if a non-default DB parameter group is currently - // in use, a new DB parameter group in the DB parameter group family for the - // new engine version must be specified. The new DB parameter group can be the - // default for that DB parameter group family. - // - // For a list of valid engine versions, see CreateDBInstance. - EngineVersion *string `type:"string"` - - // The new Provisioned IOPS (I/O operations per second) value for the RDS instance. - // Changing this setting does not result in an outage and the change is applied - // during the next maintenance window unless the ApplyImmediately parameter - // is set to true for this request. - // - // Default: Uses existing setting - // - // Constraints: Value supplied must be at least 10% greater than the current - // value. Values that are not at least 10% greater than the existing value are - // rounded up so that they are 10% greater than the current value. If you are - // migrating from Provisioned IOPS to standard storage, set this value to 0. - // The DB instance will require a reboot for the change in storage type to take - // effect. - // - // SQL Server - // - // Setting the IOPS value for the SQL Server database engine is not supported. - // - // Type: Integer - // - // If you choose to migrate your DB instance from using standard storage to - // using Provisioned IOPS, or from using Provisioned IOPS to using standard - // storage, the process can take time. The duration of the migration depends - // on several factors such as database load, storage size, storage type (standard - // or Provisioned IOPS), amount of IOPS provisioned (if any), and the number - // of prior scale storage operations. Typical migration times are under 24 hours, - // but the process can take up to several days in some cases. During the migration, - // the DB instance will be available for use, but might experience performance - // degradation. While the migration takes place, nightly backups for the instance - // will be suspended. No other Amazon RDS operations can take place for the - // instance, including modifying the instance, rebooting the instance, deleting - // the instance, creating a Read Replica for the instance, and creating a DB - // snapshot of the instance. - Iops *int64 `type:"integer"` - - // The license model for the DB instance. - // - // Valid values: license-included | bring-your-own-license | general-public-license - LicenseModel *string `type:"string"` - - // The new password for the DB instance master user. Can be any printable ASCII - // character except "/", """, or "@". - // - // Changing this parameter does not result in an outage and the change is asynchronously - // applied as soon as possible. Between the time of the request and the completion - // of the request, the MasterUserPassword element exists in the PendingModifiedValues - // element of the operation response. - // - // Default: Uses existing setting - // - // Constraints: Must be 8 to 41 alphanumeric characters (MySQL, MariaDB, and - // Amazon Aurora), 8 to 30 alphanumeric characters (Oracle), or 8 to 128 alphanumeric - // characters (SQL Server). - // - // Amazon RDS API actions never return the password, so this action provides - // a way to regain access to a primary instance user if the password is lost. - // This includes restoring privileges that might have been accidentally revoked. - MasterUserPassword *string `type:"string"` - - // The interval, in seconds, between points when Enhanced Monitoring metrics - // are collected for the DB instance. To disable collecting Enhanced Monitoring - // metrics, specify 0. The default is 0. - // - // If MonitoringRoleArn is specified, then you must also set MonitoringInterval - // to a value other than 0. - // - // Valid Values: 0, 1, 5, 10, 15, 30, 60 - MonitoringInterval *int64 `type:"integer"` - - // The ARN for the IAM role that permits RDS to send enhanced monitoring metrics - // to CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess. - // For information on creating a monitoring role, go to To create an IAM role - // for Amazon RDS Enhanced Monitoring (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html#USER_Monitoring.OS.IAMRole). - // - // If MonitoringInterval is set to a value other than 0, then you must supply - // a MonitoringRoleArn value. - MonitoringRoleArn *string `type:"string"` - - // Specifies if the DB instance is a Multi-AZ deployment. Changing this parameter - // does not result in an outage and the change is applied during the next maintenance - // window unless the ApplyImmediately parameter is set to true for this request. - // - // Constraints: Cannot be specified if the DB instance is a Read Replica. - MultiAZ *bool `type:"boolean"` - - // The new DB instance identifier for the DB instance when renaming a DB instance. - // When you change the DB instance identifier, an instance reboot will occur - // immediately if you set Apply Immediately to true, or will occur during the - // next maintenance window if Apply Immediately to false. This value is stored - // as a lowercase string. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - NewDBInstanceIdentifier *string `type:"string"` - - // Indicates that the DB instance should be associated with the specified option - // group. Changing this parameter does not result in an outage except in the - // following case and the change is applied during the next maintenance window - // unless the ApplyImmediately parameter is set to true for this request. If - // the parameter change results in an option group that enables OEM, this change - // can cause a brief (sub-second) period during which new connections are rejected - // but existing connections are not interrupted. - // - // Permanent options, such as the TDE option for Oracle Advanced Security TDE, - // cannot be removed from an option group, and that option group cannot be removed - // from a DB instance once it is associated with a DB instance - OptionGroupName *string `type:"string"` - - // The daily time range during which automated backups are created if automated - // backups are enabled, as determined by the BackupRetentionPeriod parameter. - // Changing this parameter does not result in an outage and the change is asynchronously - // applied as soon as possible. - // - // Constraints: - // - // * Must be in the format hh24:mi-hh24:mi - // - // * Times should be in Universal Time Coordinated (UTC) - // - // * Must not conflict with the preferred maintenance window - // - // * Must be at least 30 minutes - PreferredBackupWindow *string `type:"string"` - - // The weekly time range (in UTC) during which system maintenance can occur, - // which might result in an outage. Changing this parameter does not result - // in an outage, except in the following situation, and the change is asynchronously - // applied as soon as possible. If there are pending actions that cause a reboot, - // and the maintenance window is changed to include the current time, then changing - // this parameter will cause a reboot of the DB instance. If moving this window - // to the current time, there must be at least 30 minutes between the current - // time and end of the window to ensure pending changes are applied. - // - // Default: Uses existing setting - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun - // - // Constraints: Must be at least 30 minutes - PreferredMaintenanceWindow *string `type:"string"` - - // A value that specifies the order in which an Aurora Replica is promoted to - // the primary instance after a failure of the existing primary instance. For - // more information, see Fault Tolerance for an Aurora DB Cluster (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html#Aurora.Managing.FaultTolerance). - // - // Default: 1 - // - // Valid Values: 0 - 15 - PromotionTier *int64 `type:"integer"` - - // Boolean value that indicates if the DB instance has a publicly resolvable - // DNS name. Set to True to make the DB instance Internet-facing with a publicly - // resolvable DNS name, which resolves to a public IP address. Set to False - // to make the DB instance internal with a DNS name that resolves to a private - // IP address. - // - // PubliclyAccessible only applies to DB instances in a VPC. The DB instance - // must be part of a public subnet and PubliclyAccessible must be true in order - // for it to be publicly accessible. - // - // Changes to the PubliclyAccessible parameter are applied immediately regardless - // of the value of the ApplyImmediately parameter. - // - // Default: false - PubliclyAccessible *bool `type:"boolean"` - - // Specifies the storage type to be associated with the DB instance. - // - // Valid values: standard | gp2 | io1 - // - // If you specify io1, you must also include a value for the Iops parameter. - // - // Default: io1 if the Iops parameter is specified; otherwise standard - StorageType *string `type:"string"` - - // The ARN from the Key Store with which to associate the instance for TDE encryption. - TdeCredentialArn *string `type:"string"` - - // The password for the given ARN from the Key Store in order to access the - // device. - TdeCredentialPassword *string `type:"string"` - - // A list of EC2 VPC security groups to authorize on this DB instance. This - // change is asynchronously applied as soon as possible. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s ModifyDBInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDBInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDBInstanceInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *ModifyDBInstanceInput) SetAllocatedStorage(v int64) *ModifyDBInstanceInput { - s.AllocatedStorage = &v - return s -} - -// SetAllowMajorVersionUpgrade sets the AllowMajorVersionUpgrade field's value. -func (s *ModifyDBInstanceInput) SetAllowMajorVersionUpgrade(v bool) *ModifyDBInstanceInput { - s.AllowMajorVersionUpgrade = &v - return s -} - -// SetApplyImmediately sets the ApplyImmediately field's value. -func (s *ModifyDBInstanceInput) SetApplyImmediately(v bool) *ModifyDBInstanceInput { - s.ApplyImmediately = &v - return s -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *ModifyDBInstanceInput) SetAutoMinorVersionUpgrade(v bool) *ModifyDBInstanceInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *ModifyDBInstanceInput) SetBackupRetentionPeriod(v int64) *ModifyDBInstanceInput { - s.BackupRetentionPeriod = &v - return s -} - -// SetCACertificateIdentifier sets the CACertificateIdentifier field's value. -func (s *ModifyDBInstanceInput) SetCACertificateIdentifier(v string) *ModifyDBInstanceInput { - s.CACertificateIdentifier = &v - return s -} - -// SetCopyTagsToSnapshot sets the CopyTagsToSnapshot field's value. -func (s *ModifyDBInstanceInput) SetCopyTagsToSnapshot(v bool) *ModifyDBInstanceInput { - s.CopyTagsToSnapshot = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *ModifyDBInstanceInput) SetDBInstanceClass(v string) *ModifyDBInstanceInput { - s.DBInstanceClass = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *ModifyDBInstanceInput) SetDBInstanceIdentifier(v string) *ModifyDBInstanceInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *ModifyDBInstanceInput) SetDBParameterGroupName(v string) *ModifyDBInstanceInput { - s.DBParameterGroupName = &v - return s -} - -// SetDBPortNumber sets the DBPortNumber field's value. -func (s *ModifyDBInstanceInput) SetDBPortNumber(v int64) *ModifyDBInstanceInput { - s.DBPortNumber = &v - return s -} - -// SetDBSecurityGroups sets the DBSecurityGroups field's value. -func (s *ModifyDBInstanceInput) SetDBSecurityGroups(v []*string) *ModifyDBInstanceInput { - s.DBSecurityGroups = v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *ModifyDBInstanceInput) SetDBSubnetGroupName(v string) *ModifyDBInstanceInput { - s.DBSubnetGroupName = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *ModifyDBInstanceInput) SetDomain(v string) *ModifyDBInstanceInput { - s.Domain = &v - return s -} - -// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. -func (s *ModifyDBInstanceInput) SetDomainIAMRoleName(v string) *ModifyDBInstanceInput { - s.DomainIAMRoleName = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *ModifyDBInstanceInput) SetEngineVersion(v string) *ModifyDBInstanceInput { - s.EngineVersion = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *ModifyDBInstanceInput) SetIops(v int64) *ModifyDBInstanceInput { - s.Iops = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *ModifyDBInstanceInput) SetLicenseModel(v string) *ModifyDBInstanceInput { - s.LicenseModel = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *ModifyDBInstanceInput) SetMasterUserPassword(v string) *ModifyDBInstanceInput { - s.MasterUserPassword = &v - return s -} - -// SetMonitoringInterval sets the MonitoringInterval field's value. -func (s *ModifyDBInstanceInput) SetMonitoringInterval(v int64) *ModifyDBInstanceInput { - s.MonitoringInterval = &v - return s -} - -// SetMonitoringRoleArn sets the MonitoringRoleArn field's value. -func (s *ModifyDBInstanceInput) SetMonitoringRoleArn(v string) *ModifyDBInstanceInput { - s.MonitoringRoleArn = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *ModifyDBInstanceInput) SetMultiAZ(v bool) *ModifyDBInstanceInput { - s.MultiAZ = &v - return s -} - -// SetNewDBInstanceIdentifier sets the NewDBInstanceIdentifier field's value. -func (s *ModifyDBInstanceInput) SetNewDBInstanceIdentifier(v string) *ModifyDBInstanceInput { - s.NewDBInstanceIdentifier = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *ModifyDBInstanceInput) SetOptionGroupName(v string) *ModifyDBInstanceInput { - s.OptionGroupName = &v - return s -} - -// SetPreferredBackupWindow sets the PreferredBackupWindow field's value. -func (s *ModifyDBInstanceInput) SetPreferredBackupWindow(v string) *ModifyDBInstanceInput { - s.PreferredBackupWindow = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *ModifyDBInstanceInput) SetPreferredMaintenanceWindow(v string) *ModifyDBInstanceInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPromotionTier sets the PromotionTier field's value. -func (s *ModifyDBInstanceInput) SetPromotionTier(v int64) *ModifyDBInstanceInput { - s.PromotionTier = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *ModifyDBInstanceInput) SetPubliclyAccessible(v bool) *ModifyDBInstanceInput { - s.PubliclyAccessible = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *ModifyDBInstanceInput) SetStorageType(v string) *ModifyDBInstanceInput { - s.StorageType = &v - return s -} - -// SetTdeCredentialArn sets the TdeCredentialArn field's value. -func (s *ModifyDBInstanceInput) SetTdeCredentialArn(v string) *ModifyDBInstanceInput { - s.TdeCredentialArn = &v - return s -} - -// SetTdeCredentialPassword sets the TdeCredentialPassword field's value. -func (s *ModifyDBInstanceInput) SetTdeCredentialPassword(v string) *ModifyDBInstanceInput { - s.TdeCredentialPassword = &v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *ModifyDBInstanceInput) SetVpcSecurityGroupIds(v []*string) *ModifyDBInstanceInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBInstanceResult -type ModifyDBInstanceOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBInstance - // - // * DeleteDBInstance - // - // * ModifyDBInstance - // - // This data type is used as a response element in the DescribeDBInstances action. - DBInstance *DBInstance `type:"structure"` -} - -// String returns the string representation -func (s ModifyDBInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBInstanceOutput) GoString() string { - return s.String() -} - -// SetDBInstance sets the DBInstance field's value. -func (s *ModifyDBInstanceOutput) SetDBInstance(v *DBInstance) *ModifyDBInstanceOutput { - s.DBInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBParameterGroupMessage -type ModifyDBParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the DB parameter group. - // - // Constraints: - // - // * Must be the name of an existing DB parameter group - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBParameterGroupName is a required field - DBParameterGroupName *string `type:"string" required:"true"` - - // An array of parameter names, values, and the apply method for the parameter - // update. At least one parameter name, value, and apply method must be supplied; - // subsequent arguments are optional. A maximum of 20 parameters can be modified - // in a single request. - // - // Valid Values (for the application method): immediate | pending-reboot - // - // You can use the immediate value with dynamic parameters only. You can use - // the pending-reboot value for both dynamic and static parameters, and changes - // are applied when you reboot the DB instance without failover. - // - // Parameters is a required field - Parameters []*Parameter `locationNameList:"Parameter" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyDBParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDBParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDBParameterGroupInput"} - if s.DBParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupName")) - } - if s.Parameters == nil { - invalidParams.Add(request.NewErrParamRequired("Parameters")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *ModifyDBParameterGroupInput) SetDBParameterGroupName(v string) *ModifyDBParameterGroupInput { - s.DBParameterGroupName = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ModifyDBParameterGroupInput) SetParameters(v []*Parameter) *ModifyDBParameterGroupInput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshotAttributeMessage -type ModifyDBSnapshotAttributeInput struct { - _ struct{} `type:"structure"` - - // The name of the DB snapshot attribute to modify. - // - // To manage authorization for other AWS accounts to copy or restore a manual - // DB snapshot, set this value to restore. - // - // AttributeName is a required field - AttributeName *string `type:"string" required:"true"` - - // The identifier for the DB snapshot to modify the attributes for. - // - // DBSnapshotIdentifier is a required field - DBSnapshotIdentifier *string `type:"string" required:"true"` - - // A list of DB snapshot attributes to add to the attribute specified by AttributeName. - // - // To authorize other AWS accounts to copy or restore a manual snapshot, set - // this list to include one or more AWS account IDs, or all to make the manual - // DB snapshot restorable by any AWS account. Do not add the all value for any - // manual DB snapshots that contain private information that you don't want - // available to all AWS accounts. - ValuesToAdd []*string `locationNameList:"AttributeValue" type:"list"` - - // A list of DB snapshot attributes to remove from the attribute specified by - // AttributeName. - // - // To remove authorization for other AWS accounts to copy or restore a manual - // snapshot, set this list to include one or more AWS account identifiers, or - // all to remove authorization for any AWS account to copy or restore the DB - // snapshot. If you specify all, an AWS account whose account ID is explicitly - // added to the restore attribute can still copy or restore the manual DB snapshot. - ValuesToRemove []*string `locationNameList:"AttributeValue" type:"list"` -} - -// String returns the string representation -func (s ModifyDBSnapshotAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBSnapshotAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDBSnapshotAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDBSnapshotAttributeInput"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.DBSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *ModifyDBSnapshotAttributeInput) SetAttributeName(v string) *ModifyDBSnapshotAttributeInput { - s.AttributeName = &v - return s -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *ModifyDBSnapshotAttributeInput) SetDBSnapshotIdentifier(v string) *ModifyDBSnapshotAttributeInput { - s.DBSnapshotIdentifier = &v - return s -} - -// SetValuesToAdd sets the ValuesToAdd field's value. -func (s *ModifyDBSnapshotAttributeInput) SetValuesToAdd(v []*string) *ModifyDBSnapshotAttributeInput { - s.ValuesToAdd = v - return s -} - -// SetValuesToRemove sets the ValuesToRemove field's value. -func (s *ModifyDBSnapshotAttributeInput) SetValuesToRemove(v []*string) *ModifyDBSnapshotAttributeInput { - s.ValuesToRemove = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshotAttributeResult -type ModifyDBSnapshotAttributeOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful call to the DescribeDBSnapshotAttributes - // API action. - // - // Manual DB snapshot attributes are used to authorize other AWS accounts to - // copy or restore a manual DB snapshot. For more information, see the ModifyDBSnapshotAttribute - // API action. - DBSnapshotAttributesResult *DBSnapshotAttributesResult `type:"structure"` -} - -// String returns the string representation -func (s ModifyDBSnapshotAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBSnapshotAttributeOutput) GoString() string { - return s.String() -} - -// SetDBSnapshotAttributesResult sets the DBSnapshotAttributesResult field's value. -func (s *ModifyDBSnapshotAttributeOutput) SetDBSnapshotAttributesResult(v *DBSnapshotAttributesResult) *ModifyDBSnapshotAttributeOutput { - s.DBSnapshotAttributesResult = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshotMessage -type ModifyDBSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of the DB snapshot to modify. - // - // DBSnapshotIdentifier is a required field - DBSnapshotIdentifier *string `type:"string" required:"true"` - - // The engine version to update the DB snapshot to. - EngineVersion *string `type:"string"` -} - -// String returns the string representation -func (s ModifyDBSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDBSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDBSnapshotInput"} - if s.DBSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *ModifyDBSnapshotInput) SetDBSnapshotIdentifier(v string) *ModifyDBSnapshotInput { - s.DBSnapshotIdentifier = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *ModifyDBSnapshotInput) SetEngineVersion(v string) *ModifyDBSnapshotInput { - s.EngineVersion = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSnapshotResult -type ModifyDBSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBSnapshot - // - // * DeleteDBSnapshot - // - // This data type is used as a response element in the DescribeDBSnapshots action. - DBSnapshot *DBSnapshot `type:"structure"` -} - -// String returns the string representation -func (s ModifyDBSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBSnapshot sets the DBSnapshot field's value. -func (s *ModifyDBSnapshotOutput) SetDBSnapshot(v *DBSnapshot) *ModifyDBSnapshotOutput { - s.DBSnapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSubnetGroupMessage -type ModifyDBSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The description for the DB subnet group. - DBSubnetGroupDescription *string `type:"string"` - - // The name for the DB subnet group. This value is stored as a lowercase string. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - // - // DBSubnetGroupName is a required field - DBSubnetGroupName *string `type:"string" required:"true"` - - // The EC2 subnet IDs for the DB subnet group. - // - // SubnetIds is a required field - SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyDBSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDBSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDBSubnetGroupInput"} - if s.DBSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBSubnetGroupName")) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSubnetGroupDescription sets the DBSubnetGroupDescription field's value. -func (s *ModifyDBSubnetGroupInput) SetDBSubnetGroupDescription(v string) *ModifyDBSubnetGroupInput { - s.DBSubnetGroupDescription = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *ModifyDBSubnetGroupInput) SetDBSubnetGroupName(v string) *ModifyDBSubnetGroupInput { - s.DBSubnetGroupName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *ModifyDBSubnetGroupInput) SetSubnetIds(v []*string) *ModifyDBSubnetGroupInput { - s.SubnetIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBSubnetGroupResult -type ModifyDBSubnetGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBSubnetGroup - // - // * ModifyDBSubnetGroup - // - // * DescribeDBSubnetGroups - // - // * DeleteDBSubnetGroup - // - // This data type is used as a response element in the DescribeDBSubnetGroups - // action. - DBSubnetGroup *DBSubnetGroup `type:"structure"` -} - -// String returns the string representation -func (s ModifyDBSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDBSubnetGroupOutput) GoString() string { - return s.String() -} - -// SetDBSubnetGroup sets the DBSubnetGroup field's value. -func (s *ModifyDBSubnetGroupOutput) SetDBSubnetGroup(v *DBSubnetGroup) *ModifyDBSubnetGroupOutput { - s.DBSubnetGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyEventSubscriptionMessage -type ModifyEventSubscriptionInput struct { - _ struct{} `type:"structure"` - - // A Boolean value; set to true to activate the subscription. - Enabled *bool `type:"boolean"` - - // A list of event categories for a SourceType that you want to subscribe to. - // You can see a list of the categories for a given SourceType in the Events - // (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) - // topic in the Amazon RDS User Guide or by using the DescribeEventCategories - // action. - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // The Amazon Resource Name (ARN) of the SNS topic created for event notification. - // The ARN is created by Amazon SNS when you create a topic and subscribe to - // it. - SnsTopicArn *string `type:"string"` - - // The type of source that will be generating the events. For example, if you - // want to be notified of events generated by a DB instance, you would set this - // parameter to db-instance. if this value is not specified, all events are - // returned. - // - // Valid values: db-instance | db-parameter-group | db-security-group | db-snapshot - SourceType *string `type:"string"` - - // The name of the RDS event notification subscription. - // - // SubscriptionName is a required field - SubscriptionName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyEventSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyEventSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyEventSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyEventSubscriptionInput"} - if s.SubscriptionName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *ModifyEventSubscriptionInput) SetEnabled(v bool) *ModifyEventSubscriptionInput { - s.Enabled = &v - return s -} - -// SetEventCategories sets the EventCategories field's value. -func (s *ModifyEventSubscriptionInput) SetEventCategories(v []*string) *ModifyEventSubscriptionInput { - s.EventCategories = v - return s -} - -// SetSnsTopicArn sets the SnsTopicArn field's value. -func (s *ModifyEventSubscriptionInput) SetSnsTopicArn(v string) *ModifyEventSubscriptionInput { - s.SnsTopicArn = &v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *ModifyEventSubscriptionInput) SetSourceType(v string) *ModifyEventSubscriptionInput { - s.SourceType = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *ModifyEventSubscriptionInput) SetSubscriptionName(v string) *ModifyEventSubscriptionInput { - s.SubscriptionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyEventSubscriptionResult -type ModifyEventSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful invocation of the DescribeEventSubscriptions - // action. - EventSubscription *EventSubscription `type:"structure"` -} - -// String returns the string representation -func (s ModifyEventSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyEventSubscriptionOutput) GoString() string { - return s.String() -} - -// SetEventSubscription sets the EventSubscription field's value. -func (s *ModifyEventSubscriptionOutput) SetEventSubscription(v *EventSubscription) *ModifyEventSubscriptionOutput { - s.EventSubscription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyOptionGroupMessage -type ModifyOptionGroupInput struct { - _ struct{} `type:"structure"` - - // Indicates whether the changes should be applied immediately, or during the - // next maintenance window for each instance associated with the option group. - ApplyImmediately *bool `type:"boolean"` - - // The name of the option group to be modified. - // - // Permanent options, such as the TDE option for Oracle Advanced Security TDE, - // cannot be removed from an option group, and that option group cannot be removed - // from a DB instance once it is associated with a DB instance - // - // OptionGroupName is a required field - OptionGroupName *string `type:"string" required:"true"` - - // Options in this list are added to the option group or, if already present, - // the specified configuration is used to update the existing configuration. - OptionsToInclude []*OptionConfiguration `locationNameList:"OptionConfiguration" type:"list"` - - // Options in this list are removed from the option group. - OptionsToRemove []*string `type:"list"` -} - -// String returns the string representation -func (s ModifyOptionGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyOptionGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyOptionGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyOptionGroupInput"} - if s.OptionGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("OptionGroupName")) - } - if s.OptionsToInclude != nil { - for i, v := range s.OptionsToInclude { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OptionsToInclude", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyImmediately sets the ApplyImmediately field's value. -func (s *ModifyOptionGroupInput) SetApplyImmediately(v bool) *ModifyOptionGroupInput { - s.ApplyImmediately = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *ModifyOptionGroupInput) SetOptionGroupName(v string) *ModifyOptionGroupInput { - s.OptionGroupName = &v - return s -} - -// SetOptionsToInclude sets the OptionsToInclude field's value. -func (s *ModifyOptionGroupInput) SetOptionsToInclude(v []*OptionConfiguration) *ModifyOptionGroupInput { - s.OptionsToInclude = v - return s -} - -// SetOptionsToRemove sets the OptionsToRemove field's value. -func (s *ModifyOptionGroupInput) SetOptionsToRemove(v []*string) *ModifyOptionGroupInput { - s.OptionsToRemove = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyOptionGroupResult -type ModifyOptionGroupOutput struct { - _ struct{} `type:"structure"` - - OptionGroup *OptionGroup `type:"structure"` -} - -// String returns the string representation -func (s ModifyOptionGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyOptionGroupOutput) GoString() string { - return s.String() -} - -// SetOptionGroup sets the OptionGroup field's value. -func (s *ModifyOptionGroupOutput) SetOptionGroup(v *OptionGroup) *ModifyOptionGroupOutput { - s.OptionGroup = v - return s -} - -// Option details. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Option -type Option struct { - _ struct{} `type:"structure"` - - // If the option requires access to a port, then this DB security group allows - // access to the port. - DBSecurityGroupMemberships []*DBSecurityGroupMembership `locationNameList:"DBSecurityGroup" type:"list"` - - // The description of the option. - OptionDescription *string `type:"string"` - - // The name of the option. - OptionName *string `type:"string"` - - // The option settings for this option. - OptionSettings []*OptionSetting `locationNameList:"OptionSetting" type:"list"` - - // The version of the option. - OptionVersion *string `type:"string"` - - // Indicate if this option is permanent. - Permanent *bool `type:"boolean"` - - // Indicate if this option is persistent. - Persistent *bool `type:"boolean"` - - // If required, the port configured for this option to use. - Port *int64 `type:"integer"` - - // If the option requires access to a port, then this VPC security group allows - // access to the port. - VpcSecurityGroupMemberships []*VpcSecurityGroupMembership `locationNameList:"VpcSecurityGroupMembership" type:"list"` -} - -// String returns the string representation -func (s Option) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Option) GoString() string { - return s.String() -} - -// SetDBSecurityGroupMemberships sets the DBSecurityGroupMemberships field's value. -func (s *Option) SetDBSecurityGroupMemberships(v []*DBSecurityGroupMembership) *Option { - s.DBSecurityGroupMemberships = v - return s -} - -// SetOptionDescription sets the OptionDescription field's value. -func (s *Option) SetOptionDescription(v string) *Option { - s.OptionDescription = &v - return s -} - -// SetOptionName sets the OptionName field's value. -func (s *Option) SetOptionName(v string) *Option { - s.OptionName = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *Option) SetOptionSettings(v []*OptionSetting) *Option { - s.OptionSettings = v - return s -} - -// SetOptionVersion sets the OptionVersion field's value. -func (s *Option) SetOptionVersion(v string) *Option { - s.OptionVersion = &v - return s -} - -// SetPermanent sets the Permanent field's value. -func (s *Option) SetPermanent(v bool) *Option { - s.Permanent = &v - return s -} - -// SetPersistent sets the Persistent field's value. -func (s *Option) SetPersistent(v bool) *Option { - s.Persistent = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Option) SetPort(v int64) *Option { - s.Port = &v - return s -} - -// SetVpcSecurityGroupMemberships sets the VpcSecurityGroupMemberships field's value. -func (s *Option) SetVpcSecurityGroupMemberships(v []*VpcSecurityGroupMembership) *Option { - s.VpcSecurityGroupMemberships = v - return s -} - -// A list of all available options -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionConfiguration -type OptionConfiguration struct { - _ struct{} `type:"structure"` - - // A list of DBSecurityGroupMemebrship name strings used for this option. - DBSecurityGroupMemberships []*string `locationNameList:"DBSecurityGroupName" type:"list"` - - // The configuration of options to include in a group. - // - // OptionName is a required field - OptionName *string `type:"string" required:"true"` - - // The option settings to include in an option group. - OptionSettings []*OptionSetting `locationNameList:"OptionSetting" type:"list"` - - // The version for the option. - OptionVersion *string `type:"string"` - - // The optional port for the option. - Port *int64 `type:"integer"` - - // A list of VpcSecurityGroupMemebrship name strings used for this option. - VpcSecurityGroupMemberships []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s OptionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OptionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OptionConfiguration"} - if s.OptionName == nil { - invalidParams.Add(request.NewErrParamRequired("OptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBSecurityGroupMemberships sets the DBSecurityGroupMemberships field's value. -func (s *OptionConfiguration) SetDBSecurityGroupMemberships(v []*string) *OptionConfiguration { - s.DBSecurityGroupMemberships = v - return s -} - -// SetOptionName sets the OptionName field's value. -func (s *OptionConfiguration) SetOptionName(v string) *OptionConfiguration { - s.OptionName = &v - return s -} - -// SetOptionSettings sets the OptionSettings field's value. -func (s *OptionConfiguration) SetOptionSettings(v []*OptionSetting) *OptionConfiguration { - s.OptionSettings = v - return s -} - -// SetOptionVersion sets the OptionVersion field's value. -func (s *OptionConfiguration) SetOptionVersion(v string) *OptionConfiguration { - s.OptionVersion = &v - return s -} - -// SetPort sets the Port field's value. -func (s *OptionConfiguration) SetPort(v int64) *OptionConfiguration { - s.Port = &v - return s -} - -// SetVpcSecurityGroupMemberships sets the VpcSecurityGroupMemberships field's value. -func (s *OptionConfiguration) SetVpcSecurityGroupMemberships(v []*string) *OptionConfiguration { - s.VpcSecurityGroupMemberships = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionGroup -type OptionGroup struct { - _ struct{} `type:"structure"` - - // Indicates whether this option group can be applied to both VPC and non-VPC - // instances. The value true indicates the option group can be applied to both - // VPC and non-VPC instances. - AllowsVpcAndNonVpcInstanceMemberships *bool `type:"boolean"` - - // Indicates the name of the engine that this option group can be applied to. - EngineName *string `type:"string"` - - // Indicates the major engine version associated with this option group. - MajorEngineVersion *string `type:"string"` - - // The Amazon Resource Name (ARN) for the option group. - OptionGroupArn *string `type:"string"` - - // Provides a description of the option group. - OptionGroupDescription *string `type:"string"` - - // Specifies the name of the option group. - OptionGroupName *string `type:"string"` - - // Indicates what options are available in the option group. - Options []*Option `locationNameList:"Option" type:"list"` - - // If AllowsVpcAndNonVpcInstanceMemberships is false, this field is blank. If - // AllowsVpcAndNonVpcInstanceMemberships is true and this field is blank, then - // this option group can be applied to both VPC and non-VPC instances. If this - // field contains a value, then this option group can only be applied to instances - // that are in the VPC indicated by this field. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s OptionGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionGroup) GoString() string { - return s.String() -} - -// SetAllowsVpcAndNonVpcInstanceMemberships sets the AllowsVpcAndNonVpcInstanceMemberships field's value. -func (s *OptionGroup) SetAllowsVpcAndNonVpcInstanceMemberships(v bool) *OptionGroup { - s.AllowsVpcAndNonVpcInstanceMemberships = &v - return s -} - -// SetEngineName sets the EngineName field's value. -func (s *OptionGroup) SetEngineName(v string) *OptionGroup { - s.EngineName = &v - return s -} - -// SetMajorEngineVersion sets the MajorEngineVersion field's value. -func (s *OptionGroup) SetMajorEngineVersion(v string) *OptionGroup { - s.MajorEngineVersion = &v - return s -} - -// SetOptionGroupArn sets the OptionGroupArn field's value. -func (s *OptionGroup) SetOptionGroupArn(v string) *OptionGroup { - s.OptionGroupArn = &v - return s -} - -// SetOptionGroupDescription sets the OptionGroupDescription field's value. -func (s *OptionGroup) SetOptionGroupDescription(v string) *OptionGroup { - s.OptionGroupDescription = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *OptionGroup) SetOptionGroupName(v string) *OptionGroup { - s.OptionGroupName = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *OptionGroup) SetOptions(v []*Option) *OptionGroup { - s.Options = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *OptionGroup) SetVpcId(v string) *OptionGroup { - s.VpcId = &v - return s -} - -// Provides information on the option groups the DB instance is a member of. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionGroupMembership -type OptionGroupMembership struct { - _ struct{} `type:"structure"` - - // The name of the option group that the instance belongs to. - OptionGroupName *string `type:"string"` - - // The status of the DB instance's option group membership. Valid values are: - // in-sync, pending-apply, pending-removal, pending-maintenance-apply, pending-maintenance-removal, - // applying, removing, and failed. - Status *string `type:"string"` -} - -// String returns the string representation -func (s OptionGroupMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionGroupMembership) GoString() string { - return s.String() -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *OptionGroupMembership) SetOptionGroupName(v string) *OptionGroupMembership { - s.OptionGroupName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *OptionGroupMembership) SetStatus(v string) *OptionGroupMembership { - s.Status = &v - return s -} - -// Available option. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionGroupOption -type OptionGroupOption struct { - _ struct{} `type:"structure"` - - // If the option requires a port, specifies the default port for the option. - DefaultPort *int64 `type:"integer"` - - // The description of the option. - Description *string `type:"string"` - - // The name of the engine that this option can be applied to. - EngineName *string `type:"string"` - - // Indicates the major engine version that the option is available for. - MajorEngineVersion *string `type:"string"` - - // The minimum required engine version for the option to be applied. - MinimumRequiredMinorEngineVersion *string `type:"string"` - - // The name of the option. - Name *string `type:"string"` - - // The option settings that are available (and the default value) for each option - // in an option group. - OptionGroupOptionSettings []*OptionGroupOptionSetting `locationNameList:"OptionGroupOptionSetting" type:"list"` - - // The versions that are available for the option. - OptionGroupOptionVersions []*OptionVersion `locationNameList:"OptionVersion" type:"list"` - - // The options that conflict with this option. - OptionsConflictsWith []*string `locationNameList:"OptionConflictName" type:"list"` - - // The options that are prerequisites for this option. - OptionsDependedOn []*string `locationNameList:"OptionName" type:"list"` - - // Permanent options can never be removed from an option group. An option group - // containing a permanent option can't be removed from a DB instance. - Permanent *bool `type:"boolean"` - - // Persistent options can't be removed from an option group while DB instances - // are associated with the option group. If you disassociate all DB instances - // from the option group, your can remove the persistent option from the option - // group. - Persistent *bool `type:"boolean"` - - // Specifies whether the option requires a port. - PortRequired *bool `type:"boolean"` -} - -// String returns the string representation -func (s OptionGroupOption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionGroupOption) GoString() string { - return s.String() -} - -// SetDefaultPort sets the DefaultPort field's value. -func (s *OptionGroupOption) SetDefaultPort(v int64) *OptionGroupOption { - s.DefaultPort = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *OptionGroupOption) SetDescription(v string) *OptionGroupOption { - s.Description = &v - return s -} - -// SetEngineName sets the EngineName field's value. -func (s *OptionGroupOption) SetEngineName(v string) *OptionGroupOption { - s.EngineName = &v - return s -} - -// SetMajorEngineVersion sets the MajorEngineVersion field's value. -func (s *OptionGroupOption) SetMajorEngineVersion(v string) *OptionGroupOption { - s.MajorEngineVersion = &v - return s -} - -// SetMinimumRequiredMinorEngineVersion sets the MinimumRequiredMinorEngineVersion field's value. -func (s *OptionGroupOption) SetMinimumRequiredMinorEngineVersion(v string) *OptionGroupOption { - s.MinimumRequiredMinorEngineVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *OptionGroupOption) SetName(v string) *OptionGroupOption { - s.Name = &v - return s -} - -// SetOptionGroupOptionSettings sets the OptionGroupOptionSettings field's value. -func (s *OptionGroupOption) SetOptionGroupOptionSettings(v []*OptionGroupOptionSetting) *OptionGroupOption { - s.OptionGroupOptionSettings = v - return s -} - -// SetOptionGroupOptionVersions sets the OptionGroupOptionVersions field's value. -func (s *OptionGroupOption) SetOptionGroupOptionVersions(v []*OptionVersion) *OptionGroupOption { - s.OptionGroupOptionVersions = v - return s -} - -// SetOptionsConflictsWith sets the OptionsConflictsWith field's value. -func (s *OptionGroupOption) SetOptionsConflictsWith(v []*string) *OptionGroupOption { - s.OptionsConflictsWith = v - return s -} - -// SetOptionsDependedOn sets the OptionsDependedOn field's value. -func (s *OptionGroupOption) SetOptionsDependedOn(v []*string) *OptionGroupOption { - s.OptionsDependedOn = v - return s -} - -// SetPermanent sets the Permanent field's value. -func (s *OptionGroupOption) SetPermanent(v bool) *OptionGroupOption { - s.Permanent = &v - return s -} - -// SetPersistent sets the Persistent field's value. -func (s *OptionGroupOption) SetPersistent(v bool) *OptionGroupOption { - s.Persistent = &v - return s -} - -// SetPortRequired sets the PortRequired field's value. -func (s *OptionGroupOption) SetPortRequired(v bool) *OptionGroupOption { - s.PortRequired = &v - return s -} - -// Option group option settings are used to display settings available for each -// option with their default values and other information. These values are -// used with the DescribeOptionGroupOptions action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionGroupOptionSetting -type OptionGroupOptionSetting struct { - _ struct{} `type:"structure"` - - // Indicates the acceptable values for the option group option. - AllowedValues *string `type:"string"` - - // The DB engine specific parameter type for the option group option. - ApplyType *string `type:"string"` - - // The default value for the option group option. - DefaultValue *string `type:"string"` - - // Boolean value where true indicates that this option group option can be changed - // from the default value. - IsModifiable *bool `type:"boolean"` - - // The description of the option group option. - SettingDescription *string `type:"string"` - - // The name of the option group option. - SettingName *string `type:"string"` -} - -// String returns the string representation -func (s OptionGroupOptionSetting) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionGroupOptionSetting) GoString() string { - return s.String() -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *OptionGroupOptionSetting) SetAllowedValues(v string) *OptionGroupOptionSetting { - s.AllowedValues = &v - return s -} - -// SetApplyType sets the ApplyType field's value. -func (s *OptionGroupOptionSetting) SetApplyType(v string) *OptionGroupOptionSetting { - s.ApplyType = &v - return s -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *OptionGroupOptionSetting) SetDefaultValue(v string) *OptionGroupOptionSetting { - s.DefaultValue = &v - return s -} - -// SetIsModifiable sets the IsModifiable field's value. -func (s *OptionGroupOptionSetting) SetIsModifiable(v bool) *OptionGroupOptionSetting { - s.IsModifiable = &v - return s -} - -// SetSettingDescription sets the SettingDescription field's value. -func (s *OptionGroupOptionSetting) SetSettingDescription(v string) *OptionGroupOptionSetting { - s.SettingDescription = &v - return s -} - -// SetSettingName sets the SettingName field's value. -func (s *OptionGroupOptionSetting) SetSettingName(v string) *OptionGroupOptionSetting { - s.SettingName = &v - return s -} - -// Option settings are the actual settings being applied or configured for that -// option. It is used when you modify an option group or describe option groups. -// For example, the NATIVE_NETWORK_ENCRYPTION option has a setting called SQLNET.ENCRYPTION_SERVER -// that can have several different values. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionSetting -type OptionSetting struct { - _ struct{} `type:"structure"` - - // The allowed values of the option setting. - AllowedValues *string `type:"string"` - - // The DB engine specific parameter type. - ApplyType *string `type:"string"` - - // The data type of the option setting. - DataType *string `type:"string"` - - // The default value of the option setting. - DefaultValue *string `type:"string"` - - // The description of the option setting. - Description *string `type:"string"` - - // Indicates if the option setting is part of a collection. - IsCollection *bool `type:"boolean"` - - // A Boolean value that, when true, indicates the option setting can be modified - // from the default. - IsModifiable *bool `type:"boolean"` - - // The name of the option that has settings that you can set. - Name *string `type:"string"` - - // The current value of the option setting. - Value *string `type:"string"` -} - -// String returns the string representation -func (s OptionSetting) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionSetting) GoString() string { - return s.String() -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *OptionSetting) SetAllowedValues(v string) *OptionSetting { - s.AllowedValues = &v - return s -} - -// SetApplyType sets the ApplyType field's value. -func (s *OptionSetting) SetApplyType(v string) *OptionSetting { - s.ApplyType = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *OptionSetting) SetDataType(v string) *OptionSetting { - s.DataType = &v - return s -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *OptionSetting) SetDefaultValue(v string) *OptionSetting { - s.DefaultValue = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *OptionSetting) SetDescription(v string) *OptionSetting { - s.Description = &v - return s -} - -// SetIsCollection sets the IsCollection field's value. -func (s *OptionSetting) SetIsCollection(v bool) *OptionSetting { - s.IsCollection = &v - return s -} - -// SetIsModifiable sets the IsModifiable field's value. -func (s *OptionSetting) SetIsModifiable(v bool) *OptionSetting { - s.IsModifiable = &v - return s -} - -// SetName sets the Name field's value. -func (s *OptionSetting) SetName(v string) *OptionSetting { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *OptionSetting) SetValue(v string) *OptionSetting { - s.Value = &v - return s -} - -// The version for an option. Option group option versions are returned by the -// DescribeOptionGroupOptions action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OptionVersion -type OptionVersion struct { - _ struct{} `type:"structure"` - - // True if the version is the default version of the option; otherwise, false. - IsDefault *bool `type:"boolean"` - - // The version of the option. - Version *string `type:"string"` -} - -// String returns the string representation -func (s OptionVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptionVersion) GoString() string { - return s.String() -} - -// SetIsDefault sets the IsDefault field's value. -func (s *OptionVersion) SetIsDefault(v bool) *OptionVersion { - s.IsDefault = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *OptionVersion) SetVersion(v string) *OptionVersion { - s.Version = &v - return s -} - -// Contains a list of available options for a DB instance -// -// This data type is used as a response element in the DescribeOrderableDBInstanceOptions -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/OrderableDBInstanceOption -type OrderableDBInstanceOption struct { - _ struct{} `type:"structure"` - - // A list of Availability Zones for the orderable DB instance. - AvailabilityZones []*AvailabilityZone `locationNameList:"AvailabilityZone" type:"list"` - - // The DB instance class for the orderable DB instance. - DBInstanceClass *string `type:"string"` - - // The engine type of the orderable DB instance. - Engine *string `type:"string"` - - // The engine version of the orderable DB instance. - EngineVersion *string `type:"string"` - - // The license model for the orderable DB instance. - LicenseModel *string `type:"string"` - - // Indicates whether this orderable DB instance is multi-AZ capable. - MultiAZCapable *bool `type:"boolean"` - - // Indicates whether this orderable DB instance can have a Read Replica. - ReadReplicaCapable *bool `type:"boolean"` - - // Indicates the storage type for this orderable DB instance. - StorageType *string `type:"string"` - - // Indicates whether the DB instance supports enhanced monitoring at intervals - // from 1 to 60 seconds. - SupportsEnhancedMonitoring *bool `type:"boolean"` - - // Indicates whether this orderable DB instance supports provisioned IOPS. - SupportsIops *bool `type:"boolean"` - - // Indicates whether this orderable DB instance supports encrypted storage. - SupportsStorageEncryption *bool `type:"boolean"` - - // Indicates whether this is a VPC orderable DB instance. - Vpc *bool `type:"boolean"` -} - -// String returns the string representation -func (s OrderableDBInstanceOption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OrderableDBInstanceOption) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *OrderableDBInstanceOption) SetAvailabilityZones(v []*AvailabilityZone) *OrderableDBInstanceOption { - s.AvailabilityZones = v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *OrderableDBInstanceOption) SetDBInstanceClass(v string) *OrderableDBInstanceOption { - s.DBInstanceClass = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *OrderableDBInstanceOption) SetEngine(v string) *OrderableDBInstanceOption { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *OrderableDBInstanceOption) SetEngineVersion(v string) *OrderableDBInstanceOption { - s.EngineVersion = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *OrderableDBInstanceOption) SetLicenseModel(v string) *OrderableDBInstanceOption { - s.LicenseModel = &v - return s -} - -// SetMultiAZCapable sets the MultiAZCapable field's value. -func (s *OrderableDBInstanceOption) SetMultiAZCapable(v bool) *OrderableDBInstanceOption { - s.MultiAZCapable = &v - return s -} - -// SetReadReplicaCapable sets the ReadReplicaCapable field's value. -func (s *OrderableDBInstanceOption) SetReadReplicaCapable(v bool) *OrderableDBInstanceOption { - s.ReadReplicaCapable = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *OrderableDBInstanceOption) SetStorageType(v string) *OrderableDBInstanceOption { - s.StorageType = &v - return s -} - -// SetSupportsEnhancedMonitoring sets the SupportsEnhancedMonitoring field's value. -func (s *OrderableDBInstanceOption) SetSupportsEnhancedMonitoring(v bool) *OrderableDBInstanceOption { - s.SupportsEnhancedMonitoring = &v - return s -} - -// SetSupportsIops sets the SupportsIops field's value. -func (s *OrderableDBInstanceOption) SetSupportsIops(v bool) *OrderableDBInstanceOption { - s.SupportsIops = &v - return s -} - -// SetSupportsStorageEncryption sets the SupportsStorageEncryption field's value. -func (s *OrderableDBInstanceOption) SetSupportsStorageEncryption(v bool) *OrderableDBInstanceOption { - s.SupportsStorageEncryption = &v - return s -} - -// SetVpc sets the Vpc field's value. -func (s *OrderableDBInstanceOption) SetVpc(v bool) *OrderableDBInstanceOption { - s.Vpc = &v - return s -} - -// This data type is used as a request parameter in the ModifyDBParameterGroup -// and ResetDBParameterGroup actions. -// -// This data type is used as a response element in the DescribeEngineDefaultParameters -// and DescribeDBParameters actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Parameter -type Parameter struct { - _ struct{} `type:"structure"` - - // Specifies the valid range of values for the parameter. - AllowedValues *string `type:"string"` - - // Indicates when to apply parameter updates. - ApplyMethod *string `type:"string" enum:"ApplyMethod"` - - // Specifies the engine specific parameters type. - ApplyType *string `type:"string"` - - // Specifies the valid data type for the parameter. - DataType *string `type:"string"` - - // Provides a description of the parameter. - Description *string `type:"string"` - - // Indicates whether (true) or not (false) the parameter can be modified. Some - // parameters have security or operational implications that prevent them from - // being changed. - IsModifiable *bool `type:"boolean"` - - // The earliest engine version to which the parameter can apply. - MinimumEngineVersion *string `type:"string"` - - // Specifies the name of the parameter. - ParameterName *string `type:"string"` - - // Specifies the value of the parameter. - ParameterValue *string `type:"string"` - - // Indicates the source of the parameter value. - Source *string `type:"string"` -} - -// String returns the string representation -func (s Parameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Parameter) GoString() string { - return s.String() -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *Parameter) SetAllowedValues(v string) *Parameter { - s.AllowedValues = &v - return s -} - -// SetApplyMethod sets the ApplyMethod field's value. -func (s *Parameter) SetApplyMethod(v string) *Parameter { - s.ApplyMethod = &v - return s -} - -// SetApplyType sets the ApplyType field's value. -func (s *Parameter) SetApplyType(v string) *Parameter { - s.ApplyType = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *Parameter) SetDataType(v string) *Parameter { - s.DataType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Parameter) SetDescription(v string) *Parameter { - s.Description = &v - return s -} - -// SetIsModifiable sets the IsModifiable field's value. -func (s *Parameter) SetIsModifiable(v bool) *Parameter { - s.IsModifiable = &v - return s -} - -// SetMinimumEngineVersion sets the MinimumEngineVersion field's value. -func (s *Parameter) SetMinimumEngineVersion(v string) *Parameter { - s.MinimumEngineVersion = &v - return s -} - -// SetParameterName sets the ParameterName field's value. -func (s *Parameter) SetParameterName(v string) *Parameter { - s.ParameterName = &v - return s -} - -// SetParameterValue sets the ParameterValue field's value. -func (s *Parameter) SetParameterValue(v string) *Parameter { - s.ParameterValue = &v - return s -} - -// SetSource sets the Source field's value. -func (s *Parameter) SetSource(v string) *Parameter { - s.Source = &v - return s -} - -// Provides information about a pending maintenance action for a resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PendingMaintenanceAction -type PendingMaintenanceAction struct { - _ struct{} `type:"structure"` - - // The type of pending maintenance action that is available for the resource. - Action *string `type:"string"` - - // The date of the maintenance window when the action will be applied. The maintenance - // action will be applied to the resource during its first maintenance window - // after this date. If this date is specified, any next-maintenance opt-in requests - // are ignored. - AutoAppliedAfterDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The effective date when the pending maintenance action will be applied to - // the resource. This date takes into account opt-in requests received from - // the ApplyPendingMaintenanceAction API, the AutoAppliedAfterDate, and the - // ForcedApplyDate. This value is blank if an opt-in request has not been received - // and nothing has been specified as AutoAppliedAfterDate or ForcedApplyDate. - CurrentApplyDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A description providing more detail about the maintenance action. - Description *string `type:"string"` - - // The date when the maintenance action will be automatically applied. The maintenance - // action will be applied to the resource on this date regardless of the maintenance - // window for the resource. If this date is specified, any immediate opt-in - // requests are ignored. - ForcedApplyDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates the type of opt-in request that has been received for the resource. - OptInStatus *string `type:"string"` -} - -// String returns the string representation -func (s PendingMaintenanceAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PendingMaintenanceAction) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *PendingMaintenanceAction) SetAction(v string) *PendingMaintenanceAction { - s.Action = &v - return s -} - -// SetAutoAppliedAfterDate sets the AutoAppliedAfterDate field's value. -func (s *PendingMaintenanceAction) SetAutoAppliedAfterDate(v time.Time) *PendingMaintenanceAction { - s.AutoAppliedAfterDate = &v - return s -} - -// SetCurrentApplyDate sets the CurrentApplyDate field's value. -func (s *PendingMaintenanceAction) SetCurrentApplyDate(v time.Time) *PendingMaintenanceAction { - s.CurrentApplyDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *PendingMaintenanceAction) SetDescription(v string) *PendingMaintenanceAction { - s.Description = &v - return s -} - -// SetForcedApplyDate sets the ForcedApplyDate field's value. -func (s *PendingMaintenanceAction) SetForcedApplyDate(v time.Time) *PendingMaintenanceAction { - s.ForcedApplyDate = &v - return s -} - -// SetOptInStatus sets the OptInStatus field's value. -func (s *PendingMaintenanceAction) SetOptInStatus(v string) *PendingMaintenanceAction { - s.OptInStatus = &v - return s -} - -// This data type is used as a response element in the ModifyDBInstance action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PendingModifiedValues -type PendingModifiedValues struct { - _ struct{} `type:"structure"` - - // Contains the new AllocatedStorage size for the DB instance that will be applied - // or is in progress. - AllocatedStorage *int64 `type:"integer"` - - // Specifies the pending number of days for which automated backups are retained. - BackupRetentionPeriod *int64 `type:"integer"` - - // Specifies the identifier of the CA certificate for the DB instance. - CACertificateIdentifier *string `type:"string"` - - // Contains the new DBInstanceClass for the DB instance that will be applied - // or is in progress. - DBInstanceClass *string `type:"string"` - - // Contains the new DBInstanceIdentifier for the DB instance that will be applied - // or is in progress. - DBInstanceIdentifier *string `type:"string"` - - // The new DB subnet group for the DB instance. - DBSubnetGroupName *string `type:"string"` - - // Indicates the database engine version. - EngineVersion *string `type:"string"` - - // Specifies the new Provisioned IOPS value for the DB instance that will be - // applied or is being applied. - Iops *int64 `type:"integer"` - - // The license model for the DB instance. - // - // Valid values: license-included | bring-your-own-license | general-public-license - LicenseModel *string `type:"string"` - - // Contains the pending or in-progress change of the master credentials for - // the DB instance. - MasterUserPassword *string `type:"string"` - - // Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment. - MultiAZ *bool `type:"boolean"` - - // Specifies the pending port for the DB instance. - Port *int64 `type:"integer"` - - // Specifies the storage type to be associated with the DB instance. - StorageType *string `type:"string"` -} - -// String returns the string representation -func (s PendingModifiedValues) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PendingModifiedValues) GoString() string { - return s.String() -} - -// SetAllocatedStorage sets the AllocatedStorage field's value. -func (s *PendingModifiedValues) SetAllocatedStorage(v int64) *PendingModifiedValues { - s.AllocatedStorage = &v - return s -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *PendingModifiedValues) SetBackupRetentionPeriod(v int64) *PendingModifiedValues { - s.BackupRetentionPeriod = &v - return s -} - -// SetCACertificateIdentifier sets the CACertificateIdentifier field's value. -func (s *PendingModifiedValues) SetCACertificateIdentifier(v string) *PendingModifiedValues { - s.CACertificateIdentifier = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *PendingModifiedValues) SetDBInstanceClass(v string) *PendingModifiedValues { - s.DBInstanceClass = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *PendingModifiedValues) SetDBInstanceIdentifier(v string) *PendingModifiedValues { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *PendingModifiedValues) SetDBSubnetGroupName(v string) *PendingModifiedValues { - s.DBSubnetGroupName = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *PendingModifiedValues) SetEngineVersion(v string) *PendingModifiedValues { - s.EngineVersion = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *PendingModifiedValues) SetIops(v int64) *PendingModifiedValues { - s.Iops = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *PendingModifiedValues) SetLicenseModel(v string) *PendingModifiedValues { - s.LicenseModel = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *PendingModifiedValues) SetMasterUserPassword(v string) *PendingModifiedValues { - s.MasterUserPassword = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *PendingModifiedValues) SetMultiAZ(v bool) *PendingModifiedValues { - s.MultiAZ = &v - return s -} - -// SetPort sets the Port field's value. -func (s *PendingModifiedValues) SetPort(v int64) *PendingModifiedValues { - s.Port = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *PendingModifiedValues) SetStorageType(v string) *PendingModifiedValues { - s.StorageType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplicaDBClusterMessage -type PromoteReadReplicaDBClusterInput struct { - _ struct{} `type:"structure"` - - // The identifier of the DB cluster Read Replica to promote. This parameter - // is not case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: my-cluster-replica1 - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PromoteReadReplicaDBClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PromoteReadReplicaDBClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PromoteReadReplicaDBClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PromoteReadReplicaDBClusterInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *PromoteReadReplicaDBClusterInput) SetDBClusterIdentifier(v string) *PromoteReadReplicaDBClusterInput { - s.DBClusterIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplicaDBClusterResult -type PromoteReadReplicaDBClusterOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBCluster - // - // * DeleteDBCluster - // - // * FailoverDBCluster - // - // * ModifyDBCluster - // - // * RestoreDBClusterFromSnapshot - // - // * RestoreDBClusterToPointInTime - // - // This data type is used as a response element in the DescribeDBClusters action. - DBCluster *DBCluster `type:"structure"` -} - -// String returns the string representation -func (s PromoteReadReplicaDBClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PromoteReadReplicaDBClusterOutput) GoString() string { - return s.String() -} - -// SetDBCluster sets the DBCluster field's value. -func (s *PromoteReadReplicaDBClusterOutput) SetDBCluster(v *DBCluster) *PromoteReadReplicaDBClusterOutput { - s.DBCluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplicaMessage -type PromoteReadReplicaInput struct { - _ struct{} `type:"structure"` - - // The number of days to retain automated backups. Setting this parameter to - // a positive number enables backups. Setting this parameter to 0 disables automated - // backups. - // - // Default: 1 - // - // Constraints: - // - // * Must be a value from 0 to 8 - BackupRetentionPeriod *int64 `type:"integer"` - - // The DB instance identifier. This value is stored as a lowercase string. - // - // Constraints: - // - // * Must be the identifier for an existing Read Replica DB instance - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: mydbinstance - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // The daily time range during which automated backups are created if automated - // backups are enabled, using the BackupRetentionPeriod parameter. - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region. To see the time blocks available, see Adjusting the Preferred - // Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Constraints: - // - // * Must be in the format hh24:mi-hh24:mi. - // - // * Times should be in Universal Coordinated Time (UTC). - // - // * Must not conflict with the preferred maintenance window. - // - // * Must be at least 30 minutes. - PreferredBackupWindow *string `type:"string"` -} - -// String returns the string representation -func (s PromoteReadReplicaInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PromoteReadReplicaInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PromoteReadReplicaInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PromoteReadReplicaInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *PromoteReadReplicaInput) SetBackupRetentionPeriod(v int64) *PromoteReadReplicaInput { - s.BackupRetentionPeriod = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *PromoteReadReplicaInput) SetDBInstanceIdentifier(v string) *PromoteReadReplicaInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetPreferredBackupWindow sets the PreferredBackupWindow field's value. -func (s *PromoteReadReplicaInput) SetPreferredBackupWindow(v string) *PromoteReadReplicaInput { - s.PreferredBackupWindow = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplicaResult -type PromoteReadReplicaOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBInstance - // - // * DeleteDBInstance - // - // * ModifyDBInstance - // - // This data type is used as a response element in the DescribeDBInstances action. - DBInstance *DBInstance `type:"structure"` -} - -// String returns the string representation -func (s PromoteReadReplicaOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PromoteReadReplicaOutput) GoString() string { - return s.String() -} - -// SetDBInstance sets the DBInstance field's value. -func (s *PromoteReadReplicaOutput) SetDBInstance(v *DBInstance) *PromoteReadReplicaOutput { - s.DBInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PurchaseReservedDBInstancesOfferingMessage -type PurchaseReservedDBInstancesOfferingInput struct { - _ struct{} `type:"structure"` - - // The number of instances to reserve. - // - // Default: 1 - DBInstanceCount *int64 `type:"integer"` - - // Customer-specified identifier to track this reservation. - // - // Example: myreservationID - ReservedDBInstanceId *string `type:"string"` - - // The ID of the Reserved DB instance offering to purchase. - // - // Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706 - // - // ReservedDBInstancesOfferingId is a required field - ReservedDBInstancesOfferingId *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s PurchaseReservedDBInstancesOfferingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedDBInstancesOfferingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseReservedDBInstancesOfferingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseReservedDBInstancesOfferingInput"} - if s.ReservedDBInstancesOfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedDBInstancesOfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceCount sets the DBInstanceCount field's value. -func (s *PurchaseReservedDBInstancesOfferingInput) SetDBInstanceCount(v int64) *PurchaseReservedDBInstancesOfferingInput { - s.DBInstanceCount = &v - return s -} - -// SetReservedDBInstanceId sets the ReservedDBInstanceId field's value. -func (s *PurchaseReservedDBInstancesOfferingInput) SetReservedDBInstanceId(v string) *PurchaseReservedDBInstancesOfferingInput { - s.ReservedDBInstanceId = &v - return s -} - -// SetReservedDBInstancesOfferingId sets the ReservedDBInstancesOfferingId field's value. -func (s *PurchaseReservedDBInstancesOfferingInput) SetReservedDBInstancesOfferingId(v string) *PurchaseReservedDBInstancesOfferingInput { - s.ReservedDBInstancesOfferingId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *PurchaseReservedDBInstancesOfferingInput) SetTags(v []*Tag) *PurchaseReservedDBInstancesOfferingInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PurchaseReservedDBInstancesOfferingResult -type PurchaseReservedDBInstancesOfferingOutput struct { - _ struct{} `type:"structure"` - - // This data type is used as a response element in the DescribeReservedDBInstances - // and PurchaseReservedDBInstancesOffering actions. - ReservedDBInstance *ReservedDBInstance `type:"structure"` -} - -// String returns the string representation -func (s PurchaseReservedDBInstancesOfferingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedDBInstancesOfferingOutput) GoString() string { - return s.String() -} - -// SetReservedDBInstance sets the ReservedDBInstance field's value. -func (s *PurchaseReservedDBInstancesOfferingOutput) SetReservedDBInstance(v *ReservedDBInstance) *PurchaseReservedDBInstancesOfferingOutput { - s.ReservedDBInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RebootDBInstanceMessage -type RebootDBInstanceInput struct { - _ struct{} `type:"structure"` - - // The DB instance identifier. This parameter is stored as a lowercase string. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // When true, the reboot will be conducted through a MultiAZ failover. - // - // Constraint: You cannot specify true if the instance is not configured for - // MultiAZ. - ForceFailover *bool `type:"boolean"` -} - -// String returns the string representation -func (s RebootDBInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootDBInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootDBInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootDBInstanceInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *RebootDBInstanceInput) SetDBInstanceIdentifier(v string) *RebootDBInstanceInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetForceFailover sets the ForceFailover field's value. -func (s *RebootDBInstanceInput) SetForceFailover(v bool) *RebootDBInstanceInput { - s.ForceFailover = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RebootDBInstanceResult -type RebootDBInstanceOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBInstance - // - // * DeleteDBInstance - // - // * ModifyDBInstance - // - // This data type is used as a response element in the DescribeDBInstances action. - DBInstance *DBInstance `type:"structure"` -} - -// String returns the string representation -func (s RebootDBInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootDBInstanceOutput) GoString() string { - return s.String() -} - -// SetDBInstance sets the DBInstance field's value. -func (s *RebootDBInstanceOutput) SetDBInstance(v *DBInstance) *RebootDBInstanceOutput { - s.DBInstance = v - return s -} - -// This data type is used as a response element in the DescribeReservedDBInstances -// and DescribeReservedDBInstancesOfferings actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RecurringCharge -type RecurringCharge struct { - _ struct{} `type:"structure"` - - // The amount of the recurring charge. - RecurringChargeAmount *float64 `type:"double"` - - // The frequency of the recurring charge. - RecurringChargeFrequency *string `type:"string"` -} - -// 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() -} - -// SetRecurringChargeAmount sets the RecurringChargeAmount field's value. -func (s *RecurringCharge) SetRecurringChargeAmount(v float64) *RecurringCharge { - s.RecurringChargeAmount = &v - return s -} - -// SetRecurringChargeFrequency sets the RecurringChargeFrequency field's value. -func (s *RecurringCharge) SetRecurringChargeFrequency(v string) *RecurringCharge { - s.RecurringChargeFrequency = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveRoleFromDBClusterMessage -type RemoveRoleFromDBClusterInput struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster to disassociate the IAM role rom. - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role to disassociate from the Aurora - // DB cluster, for example arn:aws:iam::123456789012:role/AuroraAccessRole. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveRoleFromDBClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveRoleFromDBClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveRoleFromDBClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveRoleFromDBClusterInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *RemoveRoleFromDBClusterInput) SetDBClusterIdentifier(v string) *RemoveRoleFromDBClusterInput { - s.DBClusterIdentifier = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *RemoveRoleFromDBClusterInput) SetRoleArn(v string) *RemoveRoleFromDBClusterInput { - s.RoleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveRoleFromDBClusterOutput -type RemoveRoleFromDBClusterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveRoleFromDBClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveRoleFromDBClusterOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveSourceIdentifierFromSubscriptionMessage -type RemoveSourceIdentifierFromSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The source identifier to be removed from the subscription, such as the DB - // instance identifier for a DB instance or the name of a security group. - // - // SourceIdentifier is a required field - SourceIdentifier *string `type:"string" required:"true"` - - // The name of the RDS event notification subscription you want to remove a - // source identifier from. - // - // SubscriptionName is a required field - SubscriptionName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RemoveSourceIdentifierFromSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveSourceIdentifierFromSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveSourceIdentifierFromSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveSourceIdentifierFromSubscriptionInput"} - if s.SourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceIdentifier")) - } - if s.SubscriptionName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *RemoveSourceIdentifierFromSubscriptionInput) SetSourceIdentifier(v string) *RemoveSourceIdentifierFromSubscriptionInput { - s.SourceIdentifier = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *RemoveSourceIdentifierFromSubscriptionInput) SetSubscriptionName(v string) *RemoveSourceIdentifierFromSubscriptionInput { - s.SubscriptionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveSourceIdentifierFromSubscriptionResult -type RemoveSourceIdentifierFromSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Contains the results of a successful invocation of the DescribeEventSubscriptions - // action. - EventSubscription *EventSubscription `type:"structure"` -} - -// String returns the string representation -func (s RemoveSourceIdentifierFromSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveSourceIdentifierFromSubscriptionOutput) GoString() string { - return s.String() -} - -// SetEventSubscription sets the EventSubscription field's value. -func (s *RemoveSourceIdentifierFromSubscriptionOutput) SetEventSubscription(v *EventSubscription) *RemoveSourceIdentifierFromSubscriptionOutput { - s.EventSubscription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveTagsFromResourceMessage -type RemoveTagsFromResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon RDS resource the tags will be removed from. This value is an Amazon - // Resource Name (ARN). For information about creating an ARN, see Constructing - // an RDS Amazon Resource Name (ARN) (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing). - // - // ResourceName is a required field - ResourceName *string `type:"string" required:"true"` - - // The tag key (name) of the tag to be removed. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromResourceInput"} - if s.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceName sets the ResourceName field's value. -func (s *RemoveTagsFromResourceInput) SetResourceName(v string) *RemoveTagsFromResourceInput { - s.ResourceName = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsFromResourceInput) SetTagKeys(v []*string) *RemoveTagsFromResourceInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RemoveTagsFromResourceOutput -type RemoveTagsFromResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceOutput) GoString() string { - return s.String() -} - -// This data type is used as a response element in the DescribeReservedDBInstances -// and PurchaseReservedDBInstancesOffering actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ReservedDBInstance -type ReservedDBInstance struct { - _ struct{} `type:"structure"` - - // The currency code for the reserved DB instance. - CurrencyCode *string `type:"string"` - - // The DB instance class for the reserved DB instance. - DBInstanceClass *string `type:"string"` - - // The number of reserved DB instances. - DBInstanceCount *int64 `type:"integer"` - - // The duration of the reservation in seconds. - Duration *int64 `type:"integer"` - - // The fixed price charged for this reserved DB instance. - FixedPrice *float64 `type:"double"` - - // Indicates if the reservation applies to Multi-AZ deployments. - MultiAZ *bool `type:"boolean"` - - // The offering type of this reserved DB instance. - OfferingType *string `type:"string"` - - // The description of the reserved DB instance. - ProductDescription *string `type:"string"` - - // The recurring price charged to run this reserved DB instance. - RecurringCharges []*RecurringCharge `locationNameList:"RecurringCharge" type:"list"` - - // The Amazon Resource Name (ARN) for the reserved DB instance. - ReservedDBInstanceArn *string `type:"string"` - - // The unique identifier for the reservation. - ReservedDBInstanceId *string `type:"string"` - - // The offering identifier. - ReservedDBInstancesOfferingId *string `type:"string"` - - // The time the reservation started. - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The state of the reserved DB instance. - State *string `type:"string"` - - // The hourly price charged for this reserved DB instance. - UsagePrice *float64 `type:"double"` -} - -// String returns the string representation -func (s ReservedDBInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedDBInstance) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedDBInstance) SetCurrencyCode(v string) *ReservedDBInstance { - s.CurrencyCode = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *ReservedDBInstance) SetDBInstanceClass(v string) *ReservedDBInstance { - s.DBInstanceClass = &v - return s -} - -// SetDBInstanceCount sets the DBInstanceCount field's value. -func (s *ReservedDBInstance) SetDBInstanceCount(v int64) *ReservedDBInstance { - s.DBInstanceCount = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedDBInstance) SetDuration(v int64) *ReservedDBInstance { - s.Duration = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedDBInstance) SetFixedPrice(v float64) *ReservedDBInstance { - s.FixedPrice = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *ReservedDBInstance) SetMultiAZ(v bool) *ReservedDBInstance { - s.MultiAZ = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedDBInstance) SetOfferingType(v string) *ReservedDBInstance { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *ReservedDBInstance) SetProductDescription(v string) *ReservedDBInstance { - s.ProductDescription = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedDBInstance) SetRecurringCharges(v []*RecurringCharge) *ReservedDBInstance { - s.RecurringCharges = v - return s -} - -// SetReservedDBInstanceArn sets the ReservedDBInstanceArn field's value. -func (s *ReservedDBInstance) SetReservedDBInstanceArn(v string) *ReservedDBInstance { - s.ReservedDBInstanceArn = &v - return s -} - -// SetReservedDBInstanceId sets the ReservedDBInstanceId field's value. -func (s *ReservedDBInstance) SetReservedDBInstanceId(v string) *ReservedDBInstance { - s.ReservedDBInstanceId = &v - return s -} - -// SetReservedDBInstancesOfferingId sets the ReservedDBInstancesOfferingId field's value. -func (s *ReservedDBInstance) SetReservedDBInstancesOfferingId(v string) *ReservedDBInstance { - s.ReservedDBInstancesOfferingId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ReservedDBInstance) SetStartTime(v time.Time) *ReservedDBInstance { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *ReservedDBInstance) SetState(v string) *ReservedDBInstance { - s.State = &v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedDBInstance) SetUsagePrice(v float64) *ReservedDBInstance { - s.UsagePrice = &v - return s -} - -// This data type is used as a response element in the DescribeReservedDBInstancesOfferings -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ReservedDBInstancesOffering -type ReservedDBInstancesOffering struct { - _ struct{} `type:"structure"` - - // The currency code for the reserved DB instance offering. - CurrencyCode *string `type:"string"` - - // The DB instance class for the reserved DB instance. - DBInstanceClass *string `type:"string"` - - // The duration of the offering in seconds. - Duration *int64 `type:"integer"` - - // The fixed price charged for this offering. - FixedPrice *float64 `type:"double"` - - // Indicates if the offering applies to Multi-AZ deployments. - MultiAZ *bool `type:"boolean"` - - // The offering type. - OfferingType *string `type:"string"` - - // The database engine used by the offering. - ProductDescription *string `type:"string"` - - // The recurring price charged to run this reserved DB instance. - RecurringCharges []*RecurringCharge `locationNameList:"RecurringCharge" type:"list"` - - // The offering identifier. - ReservedDBInstancesOfferingId *string `type:"string"` - - // The hourly price charged for this offering. - UsagePrice *float64 `type:"double"` -} - -// String returns the string representation -func (s ReservedDBInstancesOffering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedDBInstancesOffering) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedDBInstancesOffering) SetCurrencyCode(v string) *ReservedDBInstancesOffering { - s.CurrencyCode = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *ReservedDBInstancesOffering) SetDBInstanceClass(v string) *ReservedDBInstancesOffering { - s.DBInstanceClass = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedDBInstancesOffering) SetDuration(v int64) *ReservedDBInstancesOffering { - s.Duration = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedDBInstancesOffering) SetFixedPrice(v float64) *ReservedDBInstancesOffering { - s.FixedPrice = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *ReservedDBInstancesOffering) SetMultiAZ(v bool) *ReservedDBInstancesOffering { - s.MultiAZ = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedDBInstancesOffering) SetOfferingType(v string) *ReservedDBInstancesOffering { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *ReservedDBInstancesOffering) SetProductDescription(v string) *ReservedDBInstancesOffering { - s.ProductDescription = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedDBInstancesOffering) SetRecurringCharges(v []*RecurringCharge) *ReservedDBInstancesOffering { - s.RecurringCharges = v - return s -} - -// SetReservedDBInstancesOfferingId sets the ReservedDBInstancesOfferingId field's value. -func (s *ReservedDBInstancesOffering) SetReservedDBInstancesOfferingId(v string) *ReservedDBInstancesOffering { - s.ReservedDBInstancesOfferingId = &v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedDBInstancesOffering) SetUsagePrice(v float64) *ReservedDBInstancesOffering { - s.UsagePrice = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResetDBClusterParameterGroupMessage -type ResetDBClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the DB cluster parameter group to reset. - // - // DBClusterParameterGroupName is a required field - DBClusterParameterGroupName *string `type:"string" required:"true"` - - // A list of parameter names in the DB cluster parameter group to reset to the - // default values. You cannot use this parameter if the ResetAllParameters parameter - // is set to true. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` - - // A value that is set to true to reset all parameters in the DB cluster parameter - // group to their default values, and false otherwise. You cannot use this parameter - // if there is a list of parameter names specified for the Parameters parameter. - ResetAllParameters *bool `type:"boolean"` -} - -// String returns the string representation -func (s ResetDBClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetDBClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetDBClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetDBClusterParameterGroupInput"} - if s.DBClusterParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *ResetDBClusterParameterGroupInput) SetDBClusterParameterGroupName(v string) *ResetDBClusterParameterGroupInput { - s.DBClusterParameterGroupName = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ResetDBClusterParameterGroupInput) SetParameters(v []*Parameter) *ResetDBClusterParameterGroupInput { - s.Parameters = v - return s -} - -// SetResetAllParameters sets the ResetAllParameters field's value. -func (s *ResetDBClusterParameterGroupInput) SetResetAllParameters(v bool) *ResetDBClusterParameterGroupInput { - s.ResetAllParameters = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResetDBParameterGroupMessage -type ResetDBParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the DB parameter group. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBParameterGroupName is a required field - DBParameterGroupName *string `type:"string" required:"true"` - - // An array of parameter names, values, and the apply method for the parameter - // update. At least one parameter name, value, and apply method must be supplied; - // subsequent arguments are optional. A maximum of 20 parameters can be modified - // in a single request. - // - // MySQL - // - // Valid Values (for Apply method): immediate | pending-reboot - // - // You can use the immediate value with dynamic parameters only. You can use - // the pending-reboot value for both dynamic and static parameters, and changes - // are applied when DB instance reboots. - // - // MariaDB - // - // Valid Values (for Apply method): immediate | pending-reboot - // - // You can use the immediate value with dynamic parameters only. You can use - // the pending-reboot value for both dynamic and static parameters, and changes - // are applied when DB instance reboots. - // - // Oracle - // - // Valid Values (for Apply method): pending-reboot - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` - - // Specifies whether (true) or not (false) to reset all parameters in the DB - // parameter group to default values. - // - // Default: true - ResetAllParameters *bool `type:"boolean"` -} - -// String returns the string representation -func (s ResetDBParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetDBParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetDBParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetDBParameterGroupInput"} - if s.DBParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBParameterGroupName sets the DBParameterGroupName field's value. -func (s *ResetDBParameterGroupInput) SetDBParameterGroupName(v string) *ResetDBParameterGroupInput { - s.DBParameterGroupName = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ResetDBParameterGroupInput) SetParameters(v []*Parameter) *ResetDBParameterGroupInput { - s.Parameters = v - return s -} - -// SetResetAllParameters sets the ResetAllParameters field's value. -func (s *ResetDBParameterGroupInput) SetResetAllParameters(v bool) *ResetDBParameterGroupInput { - s.ResetAllParameters = &v - return s -} - -// Describes the pending maintenance actions for a resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ResourcePendingMaintenanceActions -type ResourcePendingMaintenanceActions struct { - _ struct{} `type:"structure"` - - // A list that provides details about the pending maintenance actions for the - // resource. - PendingMaintenanceActionDetails []*PendingMaintenanceAction `locationNameList:"PendingMaintenanceAction" type:"list"` - - // The ARN of the resource that has pending maintenance actions. - ResourceIdentifier *string `type:"string"` -} - -// String returns the string representation -func (s ResourcePendingMaintenanceActions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourcePendingMaintenanceActions) GoString() string { - return s.String() -} - -// SetPendingMaintenanceActionDetails sets the PendingMaintenanceActionDetails field's value. -func (s *ResourcePendingMaintenanceActions) SetPendingMaintenanceActionDetails(v []*PendingMaintenanceAction) *ResourcePendingMaintenanceActions { - s.PendingMaintenanceActionDetails = v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *ResourcePendingMaintenanceActions) SetResourceIdentifier(v string) *ResourcePendingMaintenanceActions { - s.ResourceIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromS3Message -type RestoreDBClusterFromS3Input struct { - _ struct{} `type:"structure"` - - // A list of EC2 Availability Zones that instances in the restored DB cluster - // can be created in. - AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - - // The number of days for which automated backups of the restored DB cluster - // are retained. You must specify a minimum value of 1. - // - // Default: 1 - // - // Constraints: - // - // * Must be a value from 1 to 35 - BackupRetentionPeriod *int64 `type:"integer"` - - // A value that indicates that the restored DB cluster should be associated - // with the specified CharacterSet. - CharacterSetName *string `type:"string"` - - // The name of the DB cluster to create from the source data in the S3 bucket. - // This parameter is isn't case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: my-cluster1 - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The name of the DB cluster parameter group to associate with the restored - // DB cluster. If this argument is omitted, default.aurora5.6 will be used. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - DBClusterParameterGroupName *string `type:"string"` - - // A DB subnet group to associate with the restored DB cluster. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - DBSubnetGroupName *string `type:"string"` - - // The database name for the restored DB cluster. - DatabaseName *string `type:"string"` - - // The name of the database engine to be used for the restored DB cluster. - // - // Valid Values: aurora - // - // Engine is a required field - Engine *string `type:"string" required:"true"` - - // The version number of the database engine to use. - // - // Aurora - // - // Example: 5.6.10a - EngineVersion *string `type:"string"` - - // The KMS key identifier for an encrypted DB cluster. - // - // The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption - // key. If you are creating a DB cluster with the same AWS account that owns - // the KMS encryption key used to encrypt the new DB cluster, then you can use - // the KMS key alias instead of the ARN for the KM encryption key. - // - // If the StorageEncrypted parameter is true, and you do not specify a value - // for the KmsKeyId parameter, then Amazon RDS will use your default encryption - // key. AWS KMS creates the default encryption key for your AWS account. Your - // AWS account has a different default encryption key for each AWS region. - KmsKeyId *string `type:"string"` - - // The password for the master database user. This password can contain any - // printable ASCII character except "/", """, or "@". - // - // Constraints: Must contain from 8 to 41 characters. - // - // MasterUserPassword is a required field - MasterUserPassword *string `type:"string" required:"true"` - - // The name of the master user for the restored DB cluster. - // - // Constraints: - // - // * Must be 1 to 16 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot be a reserved word for the chosen database engine. - // - // MasterUsername is a required field - MasterUsername *string `type:"string" required:"true"` - - // A value that indicates that the restored DB cluster should be associated - // with the specified option group. - // - // Permanent options cannot be removed from an option group. An option group - // cannot be removed from a DB cluster once it is associated with a DB cluster. - OptionGroupName *string `type:"string"` - - // The port number on which the instances in the restored DB cluster accept - // connections. - // - // Default: 3306 - Port *int64 `type:"integer"` - - // The daily time range during which automated backups are created if automated - // backups are enabled using the BackupRetentionPeriod parameter. - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region. To see the time blocks available, see Adjusting the Preferred - // Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Constraints: - // - // * Must be in the format hh24:mi-hh24:mi. - // - // * Times should be in Universal Coordinated Time (UTC). - // - // * Must not conflict with the preferred maintenance window. - // - // * Must be at least 30 minutes. - PreferredBackupWindow *string `type:"string"` - - // The weekly time range during which system maintenance can occur, in Universal - // Coordinated Time (UTC). - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region, occurring on a random day of the week. To see the time blocks - // available, see Adjusting the Preferred Maintenance Window (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) - // in the Amazon RDS User Guide. - // - // Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `type:"string"` - - // The name of the Amazon S3 bucket that contains the data used to create the - // Amazon Aurora DB cluster. - // - // S3BucketName is a required field - S3BucketName *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the AWS Identity and Access Management - // (IAM) role that authorizes Amazon RDS to access the Amazon S3 bucket on your - // behalf. - // - // S3IngestionRoleArn is a required field - S3IngestionRoleArn *string `type:"string" required:"true"` - - // The prefix for all of the file names that contain the data used to create - // the Amazon Aurora DB cluster. If you do not specify a SourceS3Prefix value, - // then the Amazon Aurora DB cluster is created by using all of the files in - // the Amazon S3 bucket. - S3Prefix *string `type:"string"` - - // The identifier for the database engine that was backed up to create the files - // stored in the Amazon S3 bucket. - // - // Valid values: mysql - // - // SourceEngine is a required field - SourceEngine *string `type:"string" required:"true"` - - // The version of the database that the backup files were created from. - // - // MySQL version 5.5 and 5.6 are supported. - // - // Example: 5.6.22 - // - // SourceEngineVersion is a required field - SourceEngineVersion *string `type:"string" required:"true"` - - // Specifies whether the restored DB cluster is encrypted. - StorageEncrypted *bool `type:"boolean"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // A list of EC2 VPC security groups to associate with the restored DB cluster. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s RestoreDBClusterFromS3Input) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBClusterFromS3Input) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreDBClusterFromS3Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreDBClusterFromS3Input"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - if s.Engine == nil { - invalidParams.Add(request.NewErrParamRequired("Engine")) - } - if s.MasterUserPassword == nil { - invalidParams.Add(request.NewErrParamRequired("MasterUserPassword")) - } - if s.MasterUsername == nil { - invalidParams.Add(request.NewErrParamRequired("MasterUsername")) - } - if s.S3BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketName")) - } - if s.S3IngestionRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("S3IngestionRoleArn")) - } - if s.SourceEngine == nil { - invalidParams.Add(request.NewErrParamRequired("SourceEngine")) - } - if s.SourceEngineVersion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceEngineVersion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *RestoreDBClusterFromS3Input) SetAvailabilityZones(v []*string) *RestoreDBClusterFromS3Input { - s.AvailabilityZones = v - return s -} - -// SetBackupRetentionPeriod sets the BackupRetentionPeriod field's value. -func (s *RestoreDBClusterFromS3Input) SetBackupRetentionPeriod(v int64) *RestoreDBClusterFromS3Input { - s.BackupRetentionPeriod = &v - return s -} - -// SetCharacterSetName sets the CharacterSetName field's value. -func (s *RestoreDBClusterFromS3Input) SetCharacterSetName(v string) *RestoreDBClusterFromS3Input { - s.CharacterSetName = &v - return s -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *RestoreDBClusterFromS3Input) SetDBClusterIdentifier(v string) *RestoreDBClusterFromS3Input { - s.DBClusterIdentifier = &v - return s -} - -// SetDBClusterParameterGroupName sets the DBClusterParameterGroupName field's value. -func (s *RestoreDBClusterFromS3Input) SetDBClusterParameterGroupName(v string) *RestoreDBClusterFromS3Input { - s.DBClusterParameterGroupName = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *RestoreDBClusterFromS3Input) SetDBSubnetGroupName(v string) *RestoreDBClusterFromS3Input { - s.DBSubnetGroupName = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *RestoreDBClusterFromS3Input) SetDatabaseName(v string) *RestoreDBClusterFromS3Input { - s.DatabaseName = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *RestoreDBClusterFromS3Input) SetEngine(v string) *RestoreDBClusterFromS3Input { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *RestoreDBClusterFromS3Input) SetEngineVersion(v string) *RestoreDBClusterFromS3Input { - s.EngineVersion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *RestoreDBClusterFromS3Input) SetKmsKeyId(v string) *RestoreDBClusterFromS3Input { - s.KmsKeyId = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *RestoreDBClusterFromS3Input) SetMasterUserPassword(v string) *RestoreDBClusterFromS3Input { - s.MasterUserPassword = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *RestoreDBClusterFromS3Input) SetMasterUsername(v string) *RestoreDBClusterFromS3Input { - s.MasterUsername = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *RestoreDBClusterFromS3Input) SetOptionGroupName(v string) *RestoreDBClusterFromS3Input { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *RestoreDBClusterFromS3Input) SetPort(v int64) *RestoreDBClusterFromS3Input { - s.Port = &v - return s -} - -// SetPreferredBackupWindow sets the PreferredBackupWindow field's value. -func (s *RestoreDBClusterFromS3Input) SetPreferredBackupWindow(v string) *RestoreDBClusterFromS3Input { - s.PreferredBackupWindow = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *RestoreDBClusterFromS3Input) SetPreferredMaintenanceWindow(v string) *RestoreDBClusterFromS3Input { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *RestoreDBClusterFromS3Input) SetS3BucketName(v string) *RestoreDBClusterFromS3Input { - s.S3BucketName = &v - return s -} - -// SetS3IngestionRoleArn sets the S3IngestionRoleArn field's value. -func (s *RestoreDBClusterFromS3Input) SetS3IngestionRoleArn(v string) *RestoreDBClusterFromS3Input { - s.S3IngestionRoleArn = &v - return s -} - -// SetS3Prefix sets the S3Prefix field's value. -func (s *RestoreDBClusterFromS3Input) SetS3Prefix(v string) *RestoreDBClusterFromS3Input { - s.S3Prefix = &v - return s -} - -// SetSourceEngine sets the SourceEngine field's value. -func (s *RestoreDBClusterFromS3Input) SetSourceEngine(v string) *RestoreDBClusterFromS3Input { - s.SourceEngine = &v - return s -} - -// SetSourceEngineVersion sets the SourceEngineVersion field's value. -func (s *RestoreDBClusterFromS3Input) SetSourceEngineVersion(v string) *RestoreDBClusterFromS3Input { - s.SourceEngineVersion = &v - return s -} - -// SetStorageEncrypted sets the StorageEncrypted field's value. -func (s *RestoreDBClusterFromS3Input) SetStorageEncrypted(v bool) *RestoreDBClusterFromS3Input { - s.StorageEncrypted = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *RestoreDBClusterFromS3Input) SetTags(v []*Tag) *RestoreDBClusterFromS3Input { - s.Tags = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *RestoreDBClusterFromS3Input) SetVpcSecurityGroupIds(v []*string) *RestoreDBClusterFromS3Input { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromS3Result -type RestoreDBClusterFromS3Output struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBCluster - // - // * DeleteDBCluster - // - // * FailoverDBCluster - // - // * ModifyDBCluster - // - // * RestoreDBClusterFromSnapshot - // - // * RestoreDBClusterToPointInTime - // - // This data type is used as a response element in the DescribeDBClusters action. - DBCluster *DBCluster `type:"structure"` -} - -// String returns the string representation -func (s RestoreDBClusterFromS3Output) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBClusterFromS3Output) GoString() string { - return s.String() -} - -// SetDBCluster sets the DBCluster field's value. -func (s *RestoreDBClusterFromS3Output) SetDBCluster(v *DBCluster) *RestoreDBClusterFromS3Output { - s.DBCluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromSnapshotMessage -type RestoreDBClusterFromSnapshotInput struct { - _ struct{} `type:"structure"` - - // Provides the list of EC2 Availability Zones that instances in the restored - // DB cluster can be created in. - AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - - // The name of the DB cluster to create from the DB cluster snapshot. This parameter - // isn't case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-snapshot-id - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The name of the DB subnet group to use for the new DB cluster. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - DBSubnetGroupName *string `type:"string"` - - // The database name for the restored DB cluster. - DatabaseName *string `type:"string"` - - // The database engine to use for the new DB cluster. - // - // Default: The same as source - // - // Constraint: Must be compatible with the engine of the source - // - // Engine is a required field - Engine *string `type:"string" required:"true"` - - // The version of the database engine to use for the new DB cluster. - EngineVersion *string `type:"string"` - - // The KMS key identifier to use when restoring an encrypted DB cluster from - // a DB cluster snapshot. - // - // The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption - // key. If you are restoring a DB cluster with the same AWS account that owns - // the KMS encryption key used to encrypt the new DB cluster, then you can use - // the KMS key alias instead of the ARN for the KMS encryption key. - // - // If you do not specify a value for the KmsKeyId parameter, then the following - // will occur: - // - // * If the DB cluster snapshot is encrypted, then the restored DB cluster - // is encrypted using the KMS key that was used to encrypt the DB cluster - // snapshot. - // - // * If the DB cluster snapshot is not encrypted, then the restored DB cluster - // is encrypted using the specified encryption key. - KmsKeyId *string `type:"string"` - - // The name of the option group to use for the restored DB cluster. - OptionGroupName *string `type:"string"` - - // The port number on which the new DB cluster accepts connections. - // - // Constraints: Value must be 1150-65535 - // - // Default: The same port as the original DB cluster. - Port *int64 `type:"integer"` - - // The identifier for the DB cluster snapshot to restore from. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // SnapshotIdentifier is a required field - SnapshotIdentifier *string `type:"string" required:"true"` - - // The tags to be assigned to the restored DB cluster. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // A list of VPC security groups that the new DB cluster will belong to. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s RestoreDBClusterFromSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBClusterFromSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreDBClusterFromSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreDBClusterFromSnapshotInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - if s.Engine == nil { - invalidParams.Add(request.NewErrParamRequired("Engine")) - } - if s.SnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetAvailabilityZones(v []*string) *RestoreDBClusterFromSnapshotInput { - s.AvailabilityZones = v - return s -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetDBClusterIdentifier(v string) *RestoreDBClusterFromSnapshotInput { - s.DBClusterIdentifier = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetDBSubnetGroupName(v string) *RestoreDBClusterFromSnapshotInput { - s.DBSubnetGroupName = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetDatabaseName(v string) *RestoreDBClusterFromSnapshotInput { - s.DatabaseName = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetEngine(v string) *RestoreDBClusterFromSnapshotInput { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetEngineVersion(v string) *RestoreDBClusterFromSnapshotInput { - s.EngineVersion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetKmsKeyId(v string) *RestoreDBClusterFromSnapshotInput { - s.KmsKeyId = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetOptionGroupName(v string) *RestoreDBClusterFromSnapshotInput { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetPort(v int64) *RestoreDBClusterFromSnapshotInput { - s.Port = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetSnapshotIdentifier(v string) *RestoreDBClusterFromSnapshotInput { - s.SnapshotIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetTags(v []*Tag) *RestoreDBClusterFromSnapshotInput { - s.Tags = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *RestoreDBClusterFromSnapshotInput) SetVpcSecurityGroupIds(v []*string) *RestoreDBClusterFromSnapshotInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterFromSnapshotResult -type RestoreDBClusterFromSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBCluster - // - // * DeleteDBCluster - // - // * FailoverDBCluster - // - // * ModifyDBCluster - // - // * RestoreDBClusterFromSnapshot - // - // * RestoreDBClusterToPointInTime - // - // This data type is used as a response element in the DescribeDBClusters action. - DBCluster *DBCluster `type:"structure"` -} - -// String returns the string representation -func (s RestoreDBClusterFromSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBClusterFromSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBCluster sets the DBCluster field's value. -func (s *RestoreDBClusterFromSnapshotOutput) SetDBCluster(v *DBCluster) *RestoreDBClusterFromSnapshotOutput { - s.DBCluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterToPointInTimeMessage -type RestoreDBClusterToPointInTimeInput struct { - _ struct{} `type:"structure"` - - // The name of the new DB cluster to be created. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // DBClusterIdentifier is a required field - DBClusterIdentifier *string `type:"string" required:"true"` - - // The DB subnet group name to use for the new DB cluster. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - DBSubnetGroupName *string `type:"string"` - - // The KMS key identifier to use when restoring an encrypted DB cluster from - // an encrypted DB cluster. - // - // The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption - // key. If you are restoring a DB cluster with the same AWS account that owns - // the KMS encryption key used to encrypt the new DB cluster, then you can use - // the KMS key alias instead of the ARN for the KMS encryption key. - // - // You can restore to a new DB cluster and encrypt the new DB cluster with a - // KMS key that is different than the KMS key used to encrypt the source DB - // cluster. The new DB cluster will be encrypted with the KMS key identified - // by the KmsKeyId parameter. - // - // If you do not specify a value for the KmsKeyId parameter, then the following - // will occur: - // - // * If the DB cluster is encrypted, then the restored DB cluster is encrypted - // using the KMS key that was used to encrypt the source DB cluster. - // - // * If the DB cluster is not encrypted, then the restored DB cluster is - // not encrypted. - // - // If DBClusterIdentifier refers to a DB cluster that is note encrypted, then - // the restore request is rejected. - KmsKeyId *string `type:"string"` - - // The name of the option group for the new DB cluster. - OptionGroupName *string `type:"string"` - - // The port number on which the new DB cluster accepts connections. - // - // Constraints: Value must be 1150-65535 - // - // Default: The same port as the original DB cluster. - Port *int64 `type:"integer"` - - // The date and time to restore the DB cluster to. - // - // Valid Values: Value must be a time in Universal Coordinated Time (UTC) format - // - // Constraints: - // - // * Must be before the latest restorable time for the DB instance - // - // * Cannot be specified if UseLatestRestorableTime parameter is true - // - // Example: 2015-03-07T23:45:00Z - RestoreToTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The identifier of the source DB cluster from which to restore. - // - // Constraints: - // - // * Must be the identifier of an existing database instance - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // SourceDBClusterIdentifier is a required field - SourceDBClusterIdentifier *string `type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // A value that is set to true to restore the DB cluster to the latest restorable - // backup time, and false otherwise. - // - // Default: false - // - // Constraints: Cannot be specified if RestoreToTime parameter is provided. - UseLatestRestorableTime *bool `type:"boolean"` - - // A lst of VPC security groups that the new DB cluster belongs to. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s RestoreDBClusterToPointInTimeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBClusterToPointInTimeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreDBClusterToPointInTimeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreDBClusterToPointInTimeInput"} - if s.DBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBClusterIdentifier")) - } - if s.SourceDBClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDBClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetDBClusterIdentifier(v string) *RestoreDBClusterToPointInTimeInput { - s.DBClusterIdentifier = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetDBSubnetGroupName(v string) *RestoreDBClusterToPointInTimeInput { - s.DBSubnetGroupName = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetKmsKeyId(v string) *RestoreDBClusterToPointInTimeInput { - s.KmsKeyId = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetOptionGroupName(v string) *RestoreDBClusterToPointInTimeInput { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetPort(v int64) *RestoreDBClusterToPointInTimeInput { - s.Port = &v - return s -} - -// SetRestoreToTime sets the RestoreToTime field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetRestoreToTime(v time.Time) *RestoreDBClusterToPointInTimeInput { - s.RestoreToTime = &v - return s -} - -// SetSourceDBClusterIdentifier sets the SourceDBClusterIdentifier field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetSourceDBClusterIdentifier(v string) *RestoreDBClusterToPointInTimeInput { - s.SourceDBClusterIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetTags(v []*Tag) *RestoreDBClusterToPointInTimeInput { - s.Tags = v - return s -} - -// SetUseLatestRestorableTime sets the UseLatestRestorableTime field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetUseLatestRestorableTime(v bool) *RestoreDBClusterToPointInTimeInput { - s.UseLatestRestorableTime = &v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *RestoreDBClusterToPointInTimeInput) SetVpcSecurityGroupIds(v []*string) *RestoreDBClusterToPointInTimeInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBClusterToPointInTimeResult -type RestoreDBClusterToPointInTimeOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBCluster - // - // * DeleteDBCluster - // - // * FailoverDBCluster - // - // * ModifyDBCluster - // - // * RestoreDBClusterFromSnapshot - // - // * RestoreDBClusterToPointInTime - // - // This data type is used as a response element in the DescribeDBClusters action. - DBCluster *DBCluster `type:"structure"` -} - -// String returns the string representation -func (s RestoreDBClusterToPointInTimeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBClusterToPointInTimeOutput) GoString() string { - return s.String() -} - -// SetDBCluster sets the DBCluster field's value. -func (s *RestoreDBClusterToPointInTimeOutput) SetDBCluster(v *DBCluster) *RestoreDBClusterToPointInTimeOutput { - s.DBCluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceFromDBSnapshotMessage -type RestoreDBInstanceFromDBSnapshotInput struct { - _ struct{} `type:"structure"` - - // Indicates that minor version upgrades will be applied automatically to the - // DB instance during the maintenance window. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The EC2 Availability Zone that the database instance will be created in. - // - // Default: A random, system-chosen Availability Zone. - // - // Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ - // parameter is set to true. - // - // Example: us-east-1a - AvailabilityZone *string `type:"string"` - - // True to copy all tags from the restored DB instance to snapshots of the DB - // instance; otherwise false. The default is false. - CopyTagsToSnapshot *bool `type:"boolean"` - - // The compute and memory capacity of the Amazon RDS DB instance. - // - // Valid Values: db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge - // | db.m2.2xlarge | db.m2.4xlarge | db.m3.medium | db.m3.large | db.m3.xlarge - // | db.m3.2xlarge | db.m4.large | db.m4.xlarge | db.m4.2xlarge | db.m4.4xlarge - // | db.m4.10xlarge | db.r3.large | db.r3.xlarge | db.r3.2xlarge | db.r3.4xlarge - // | db.r3.8xlarge | db.t2.micro | db.t2.small | db.t2.medium | db.t2.large - DBInstanceClass *string `type:"string"` - - // Name of the DB instance to create from the DB snapshot. This parameter isn't - // case-sensitive. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens (1 to 15 - // for SQL Server) - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-snapshot-id - // - // DBInstanceIdentifier is a required field - DBInstanceIdentifier *string `type:"string" required:"true"` - - // The database name for the restored DB instance. - // - // This parameter doesn't apply to the MySQL, PostgreSQL, or MariaDB engines. - DBName *string `type:"string"` - - // The identifier for the DB snapshot to restore from. - // - // Constraints: - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // If you are restoring from a shared manual DB snapshot, the DBSnapshotIdentifier - // must be the ARN of the shared DB snapshot. - // - // DBSnapshotIdentifier is a required field - DBSnapshotIdentifier *string `type:"string" required:"true"` - - // The DB subnet group name to use for the new instance. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - DBSubnetGroupName *string `type:"string"` - - // Specify the Active Directory Domain to restore the instance in. - Domain *string `type:"string"` - - // Specify the name of the IAM role to be used when making API calls to the - // Directory Service. - DomainIAMRoleName *string `type:"string"` - - // The database engine to use for the new instance. - // - // Default: The same as source - // - // Constraint: Must be compatible with the engine of the source. You can restore - // a MariaDB 10.1 DB instance from a MySQL 5.6 snapshot. - // - // Valid Values: MySQL | mariadb | oracle-se1 | oracle-se | oracle-ee | sqlserver-ee - // | sqlserver-se | sqlserver-ex | sqlserver-web | postgres | aurora - Engine *string `type:"string"` - - // Specifies the amount of provisioned IOPS for the DB instance, expressed in - // I/O operations per second. If this parameter is not specified, the IOPS value - // will be taken from the backup. If this parameter is set to 0, the new instance - // will be converted to a non-PIOPS instance, which will take additional time, - // though your DB instance will be available for connections before the conversion - // starts. - // - // Constraints: Must be an integer greater than 1000. - // - // SQL Server - // - // Setting the IOPS value for the SQL Server database engine is not supported. - Iops *int64 `type:"integer"` - - // License model information for the restored DB instance. - // - // Default: Same as source. - // - // Valid values: license-included | bring-your-own-license | general-public-license - LicenseModel *string `type:"string"` - - // Specifies if the DB instance is a Multi-AZ deployment. - // - // Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ - // parameter is set to true. - MultiAZ *bool `type:"boolean"` - - // The name of the option group to be used for the restored DB instance. - // - // Permanent options, such as the TDE option for Oracle Advanced Security TDE, - // cannot be removed from an option group, and that option group cannot be removed - // from a DB instance once it is associated with a DB instance - OptionGroupName *string `type:"string"` - - // The port number on which the database accepts connections. - // - // Default: The same port as the original DB instance - // - // Constraints: Value must be 1150-65535 - Port *int64 `type:"integer"` - - // Specifies the accessibility options for the DB instance. A value of true - // specifies an Internet-facing instance with a publicly resolvable DNS name, - // which resolves to a public IP address. A value of false specifies an internal - // instance with a DNS name that resolves to a private IP address. - // - // Default: The default behavior varies depending on whether a VPC has been - // requested or not. The following list shows the default behavior in each case. - // - // * Default VPC: true - // - // * VPC: false - // - // If no DB subnet group has been specified as part of the request and the PubliclyAccessible - // value has not been set, the DB instance will be publicly accessible. If a - // specific DB subnet group has been specified as part of the request and the - // PubliclyAccessible value has not been set, the DB instance will be private. - PubliclyAccessible *bool `type:"boolean"` - - // Specifies the storage type to be associated with the DB instance. - // - // Valid values: standard | gp2 | io1 - // - // If you specify io1, you must also include a value for the Iops parameter. - // - // Default: io1 if the Iops parameter is specified; otherwise standard - StorageType *string `type:"string"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The ARN from the Key Store with which to associate the instance for TDE encryption. - TdeCredentialArn *string `type:"string"` - - // The password for the given ARN from the Key Store in order to access the - // device. - TdeCredentialPassword *string `type:"string"` -} - -// String returns the string representation -func (s RestoreDBInstanceFromDBSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBInstanceFromDBSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreDBInstanceFromDBSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreDBInstanceFromDBSnapshotInput"} - if s.DBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBInstanceIdentifier")) - } - if s.DBSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DBSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetAutoMinorVersionUpgrade(v bool) *RestoreDBInstanceFromDBSnapshotInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetAvailabilityZone(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.AvailabilityZone = &v - return s -} - -// SetCopyTagsToSnapshot sets the CopyTagsToSnapshot field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetCopyTagsToSnapshot(v bool) *RestoreDBInstanceFromDBSnapshotInput { - s.CopyTagsToSnapshot = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetDBInstanceClass(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.DBInstanceClass = &v - return s -} - -// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetDBInstanceIdentifier(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.DBInstanceIdentifier = &v - return s -} - -// SetDBName sets the DBName field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetDBName(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.DBName = &v - return s -} - -// SetDBSnapshotIdentifier sets the DBSnapshotIdentifier field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetDBSnapshotIdentifier(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.DBSnapshotIdentifier = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetDBSubnetGroupName(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.DBSubnetGroupName = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetDomain(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.Domain = &v - return s -} - -// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetDomainIAMRoleName(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.DomainIAMRoleName = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetEngine(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.Engine = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetIops(v int64) *RestoreDBInstanceFromDBSnapshotInput { - s.Iops = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetLicenseModel(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.LicenseModel = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetMultiAZ(v bool) *RestoreDBInstanceFromDBSnapshotInput { - s.MultiAZ = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetOptionGroupName(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetPort(v int64) *RestoreDBInstanceFromDBSnapshotInput { - s.Port = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetPubliclyAccessible(v bool) *RestoreDBInstanceFromDBSnapshotInput { - s.PubliclyAccessible = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetStorageType(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.StorageType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetTags(v []*Tag) *RestoreDBInstanceFromDBSnapshotInput { - s.Tags = v - return s -} - -// SetTdeCredentialArn sets the TdeCredentialArn field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetTdeCredentialArn(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.TdeCredentialArn = &v - return s -} - -// SetTdeCredentialPassword sets the TdeCredentialPassword field's value. -func (s *RestoreDBInstanceFromDBSnapshotInput) SetTdeCredentialPassword(v string) *RestoreDBInstanceFromDBSnapshotInput { - s.TdeCredentialPassword = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceFromDBSnapshotResult -type RestoreDBInstanceFromDBSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBInstance - // - // * DeleteDBInstance - // - // * ModifyDBInstance - // - // This data type is used as a response element in the DescribeDBInstances action. - DBInstance *DBInstance `type:"structure"` -} - -// String returns the string representation -func (s RestoreDBInstanceFromDBSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBInstanceFromDBSnapshotOutput) GoString() string { - return s.String() -} - -// SetDBInstance sets the DBInstance field's value. -func (s *RestoreDBInstanceFromDBSnapshotOutput) SetDBInstance(v *DBInstance) *RestoreDBInstanceFromDBSnapshotOutput { - s.DBInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceToPointInTimeMessage -type RestoreDBInstanceToPointInTimeInput struct { - _ struct{} `type:"structure"` - - // Indicates that minor version upgrades will be applied automatically to the - // DB instance during the maintenance window. - AutoMinorVersionUpgrade *bool `type:"boolean"` - - // The EC2 Availability Zone that the database instance will be created in. - // - // Default: A random, system-chosen Availability Zone. - // - // Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ - // parameter is set to true. - // - // Example: us-east-1a - AvailabilityZone *string `type:"string"` - - // True to copy all tags from the restored DB instance to snapshots of the DB - // instance; otherwise false. The default is false. - CopyTagsToSnapshot *bool `type:"boolean"` - - // The compute and memory capacity of the Amazon RDS DB instance. - // - // Valid Values: db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge - // | db.m2.2xlarge | db.m2.4xlarge | db.m3.medium | db.m3.large | db.m3.xlarge - // | db.m3.2xlarge | db.m4.large | db.m4.xlarge | db.m4.2xlarge | db.m4.4xlarge - // | db.m4.10xlarge | db.r3.large | db.r3.xlarge | db.r3.2xlarge | db.r3.4xlarge - // | db.r3.8xlarge | db.t2.micro | db.t2.small | db.t2.medium | db.t2.large - // - // Default: The same DBInstanceClass as the original DB instance. - DBInstanceClass *string `type:"string"` - - // The database name for the restored DB instance. - // - // This parameter is not used for the MySQL or MariaDB engines. - DBName *string `type:"string"` - - // The DB subnet group name to use for the new instance. - // - // Constraints: Must contain no more than 255 alphanumeric characters, periods, - // underscores, spaces, or hyphens. Must not be default. - // - // Example: mySubnetgroup - DBSubnetGroupName *string `type:"string"` - - // Specify the Active Directory Domain to restore the instance in. - Domain *string `type:"string"` - - // Specify the name of the IAM role to be used when making API calls to the - // Directory Service. - DomainIAMRoleName *string `type:"string"` - - // The database engine to use for the new instance. - // - // Default: The same as source - // - // Constraint: Must be compatible with the engine of the source - // - // Valid Values: MySQL | mariadb | oracle-se1 | oracle-se | oracle-ee | sqlserver-ee - // | sqlserver-se | sqlserver-ex | sqlserver-web | postgres | aurora - Engine *string `type:"string"` - - // The amount of Provisioned IOPS (input/output operations per second) to be - // initially allocated for the DB instance. - // - // Constraints: Must be an integer greater than 1000. - // - // SQL Server - // - // Setting the IOPS value for the SQL Server database engine is not supported. - Iops *int64 `type:"integer"` - - // License model information for the restored DB instance. - // - // Default: Same as source. - // - // Valid values: license-included | bring-your-own-license | general-public-license - LicenseModel *string `type:"string"` - - // Specifies if the DB instance is a Multi-AZ deployment. - // - // Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ - // parameter is set to true. - MultiAZ *bool `type:"boolean"` - - // The name of the option group to be used for the restored DB instance. - // - // Permanent options, such as the TDE option for Oracle Advanced Security TDE, - // cannot be removed from an option group, and that option group cannot be removed - // from a DB instance once it is associated with a DB instance - OptionGroupName *string `type:"string"` - - // The port number on which the database accepts connections. - // - // Constraints: Value must be 1150-65535 - // - // Default: The same port as the original DB instance. - Port *int64 `type:"integer"` - - // Specifies the accessibility options for the DB instance. A value of true - // specifies an Internet-facing instance with a publicly resolvable DNS name, - // which resolves to a public IP address. A value of false specifies an internal - // instance with a DNS name that resolves to a private IP address. - // - // Default: The default behavior varies depending on whether a VPC has been - // requested or not. The following list shows the default behavior in each case. - // - // * Default VPC:true - // - // * VPC:false - // - // If no DB subnet group has been specified as part of the request and the PubliclyAccessible - // value has not been set, the DB instance will be publicly accessible. If a - // specific DB subnet group has been specified as part of the request and the - // PubliclyAccessible value has not been set, the DB instance will be private. - PubliclyAccessible *bool `type:"boolean"` - - // The date and time to restore from. - // - // Valid Values: Value must be a time in Universal Coordinated Time (UTC) format - // - // Constraints: - // - // * Must be before the latest restorable time for the DB instance - // - // * Cannot be specified if UseLatestRestorableTime parameter is true - // - // Example: 2009-09-07T23:45:00Z - RestoreTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The identifier of the source DB instance from which to restore. - // - // Constraints: - // - // * Must be the identifier of an existing database instance - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // SourceDBInstanceIdentifier is a required field - SourceDBInstanceIdentifier *string `type:"string" required:"true"` - - // Specifies the storage type to be associated with the DB instance. - // - // Valid values: standard | gp2 | io1 - // - // If you specify io1, you must also include a value for the Iops parameter. - // - // Default: io1 if the Iops parameter is specified; otherwise standard - StorageType *string `type:"string"` - - // A list of tags. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The name of the new database instance to be created. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // TargetDBInstanceIdentifier is a required field - TargetDBInstanceIdentifier *string `type:"string" required:"true"` - - // The ARN from the Key Store with which to associate the instance for TDE encryption. - TdeCredentialArn *string `type:"string"` - - // The password for the given ARN from the Key Store in order to access the - // device. - TdeCredentialPassword *string `type:"string"` - - // Specifies whether (true) or not (false) the DB instance is restored from - // the latest backup time. - // - // Default: false - // - // Constraints: Cannot be specified if RestoreTime parameter is provided. - UseLatestRestorableTime *bool `type:"boolean"` -} - -// String returns the string representation -func (s RestoreDBInstanceToPointInTimeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBInstanceToPointInTimeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreDBInstanceToPointInTimeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreDBInstanceToPointInTimeInput"} - if s.SourceDBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDBInstanceIdentifier")) - } - if s.TargetDBInstanceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetDBInstanceIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetAutoMinorVersionUpgrade(v bool) *RestoreDBInstanceToPointInTimeInput { - s.AutoMinorVersionUpgrade = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetAvailabilityZone(v string) *RestoreDBInstanceToPointInTimeInput { - s.AvailabilityZone = &v - return s -} - -// SetCopyTagsToSnapshot sets the CopyTagsToSnapshot field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetCopyTagsToSnapshot(v bool) *RestoreDBInstanceToPointInTimeInput { - s.CopyTagsToSnapshot = &v - return s -} - -// SetDBInstanceClass sets the DBInstanceClass field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetDBInstanceClass(v string) *RestoreDBInstanceToPointInTimeInput { - s.DBInstanceClass = &v - return s -} - -// SetDBName sets the DBName field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetDBName(v string) *RestoreDBInstanceToPointInTimeInput { - s.DBName = &v - return s -} - -// SetDBSubnetGroupName sets the DBSubnetGroupName field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetDBSubnetGroupName(v string) *RestoreDBInstanceToPointInTimeInput { - s.DBSubnetGroupName = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetDomain(v string) *RestoreDBInstanceToPointInTimeInput { - s.Domain = &v - return s -} - -// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetDomainIAMRoleName(v string) *RestoreDBInstanceToPointInTimeInput { - s.DomainIAMRoleName = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetEngine(v string) *RestoreDBInstanceToPointInTimeInput { - s.Engine = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetIops(v int64) *RestoreDBInstanceToPointInTimeInput { - s.Iops = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetLicenseModel(v string) *RestoreDBInstanceToPointInTimeInput { - s.LicenseModel = &v - return s -} - -// SetMultiAZ sets the MultiAZ field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetMultiAZ(v bool) *RestoreDBInstanceToPointInTimeInput { - s.MultiAZ = &v - return s -} - -// SetOptionGroupName sets the OptionGroupName field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetOptionGroupName(v string) *RestoreDBInstanceToPointInTimeInput { - s.OptionGroupName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetPort(v int64) *RestoreDBInstanceToPointInTimeInput { - s.Port = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetPubliclyAccessible(v bool) *RestoreDBInstanceToPointInTimeInput { - s.PubliclyAccessible = &v - return s -} - -// SetRestoreTime sets the RestoreTime field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetRestoreTime(v time.Time) *RestoreDBInstanceToPointInTimeInput { - s.RestoreTime = &v - return s -} - -// SetSourceDBInstanceIdentifier sets the SourceDBInstanceIdentifier field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetSourceDBInstanceIdentifier(v string) *RestoreDBInstanceToPointInTimeInput { - s.SourceDBInstanceIdentifier = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetStorageType(v string) *RestoreDBInstanceToPointInTimeInput { - s.StorageType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetTags(v []*Tag) *RestoreDBInstanceToPointInTimeInput { - s.Tags = v - return s -} - -// SetTargetDBInstanceIdentifier sets the TargetDBInstanceIdentifier field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetTargetDBInstanceIdentifier(v string) *RestoreDBInstanceToPointInTimeInput { - s.TargetDBInstanceIdentifier = &v - return s -} - -// SetTdeCredentialArn sets the TdeCredentialArn field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetTdeCredentialArn(v string) *RestoreDBInstanceToPointInTimeInput { - s.TdeCredentialArn = &v - return s -} - -// SetTdeCredentialPassword sets the TdeCredentialPassword field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetTdeCredentialPassword(v string) *RestoreDBInstanceToPointInTimeInput { - s.TdeCredentialPassword = &v - return s -} - -// SetUseLatestRestorableTime sets the UseLatestRestorableTime field's value. -func (s *RestoreDBInstanceToPointInTimeInput) SetUseLatestRestorableTime(v bool) *RestoreDBInstanceToPointInTimeInput { - s.UseLatestRestorableTime = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RestoreDBInstanceToPointInTimeResult -type RestoreDBInstanceToPointInTimeOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * CreateDBInstance - // - // * DeleteDBInstance - // - // * ModifyDBInstance - // - // This data type is used as a response element in the DescribeDBInstances action. - DBInstance *DBInstance `type:"structure"` -} - -// String returns the string representation -func (s RestoreDBInstanceToPointInTimeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreDBInstanceToPointInTimeOutput) GoString() string { - return s.String() -} - -// SetDBInstance sets the DBInstance field's value. -func (s *RestoreDBInstanceToPointInTimeOutput) SetDBInstance(v *DBInstance) *RestoreDBInstanceToPointInTimeOutput { - s.DBInstance = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RevokeDBSecurityGroupIngressMessage -type RevokeDBSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The IP range to revoke access from. Must be a valid CIDR range. If CIDRIP - // is specified, EC2SecurityGroupName, EC2SecurityGroupId and EC2SecurityGroupOwnerId - // cannot be provided. - CIDRIP *string `type:"string"` - - // The name of the DB security group to revoke ingress from. - // - // DBSecurityGroupName is a required field - DBSecurityGroupName *string `type:"string" required:"true"` - - // The id of the EC2 security group to revoke access from. For VPC DB security - // groups, EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId - // and either EC2SecurityGroupName or EC2SecurityGroupId must be provided. - EC2SecurityGroupId *string `type:"string"` - - // The name of the EC2 security group to revoke access from. For VPC DB security - // groups, EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId - // and either EC2SecurityGroupName or EC2SecurityGroupId must be provided. - EC2SecurityGroupName *string `type:"string"` - - // The AWS Account Number of the owner of the EC2 security group specified in - // the EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable - // value. For VPC DB security groups, EC2SecurityGroupId must be provided. Otherwise, - // EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId - // must be provided. - EC2SecurityGroupOwnerId *string `type:"string"` -} - -// String returns the string representation -func (s RevokeDBSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeDBSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RevokeDBSecurityGroupIngressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RevokeDBSecurityGroupIngressInput"} - if s.DBSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("DBSecurityGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCIDRIP sets the CIDRIP field's value. -func (s *RevokeDBSecurityGroupIngressInput) SetCIDRIP(v string) *RevokeDBSecurityGroupIngressInput { - s.CIDRIP = &v - return s -} - -// SetDBSecurityGroupName sets the DBSecurityGroupName field's value. -func (s *RevokeDBSecurityGroupIngressInput) SetDBSecurityGroupName(v string) *RevokeDBSecurityGroupIngressInput { - s.DBSecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupId sets the EC2SecurityGroupId field's value. -func (s *RevokeDBSecurityGroupIngressInput) SetEC2SecurityGroupId(v string) *RevokeDBSecurityGroupIngressInput { - s.EC2SecurityGroupId = &v - return s -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *RevokeDBSecurityGroupIngressInput) SetEC2SecurityGroupName(v string) *RevokeDBSecurityGroupIngressInput { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *RevokeDBSecurityGroupIngressInput) SetEC2SecurityGroupOwnerId(v string) *RevokeDBSecurityGroupIngressInput { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RevokeDBSecurityGroupIngressResult -type RevokeDBSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` - - // Contains the result of a successful invocation of the following actions: - // - // * DescribeDBSecurityGroups - // - // * AuthorizeDBSecurityGroupIngress - // - // * CreateDBSecurityGroup - // - // * RevokeDBSecurityGroupIngress - // - // This data type is used as a response element in the DescribeDBSecurityGroups - // action. - DBSecurityGroup *DBSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s RevokeDBSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeDBSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// SetDBSecurityGroup sets the DBSecurityGroup field's value. -func (s *RevokeDBSecurityGroupIngressOutput) SetDBSecurityGroup(v *DBSecurityGroup) *RevokeDBSecurityGroupIngressOutput { - s.DBSecurityGroup = v - return s -} - -// Contains an AWS Region name as the result of a successful call to the DescribeSourceRegions -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/SourceRegion -type SourceRegion struct { - _ struct{} `type:"structure"` - - // The source region endpoint. - Endpoint *string `type:"string"` - - // The source region name. - RegionName *string `type:"string"` - - // The status of the source region. - Status *string `type:"string"` -} - -// String returns the string representation -func (s SourceRegion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceRegion) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *SourceRegion) SetEndpoint(v string) *SourceRegion { - s.Endpoint = &v - return s -} - -// SetRegionName sets the RegionName field's value. -func (s *SourceRegion) SetRegionName(v string) *SourceRegion { - s.RegionName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SourceRegion) SetStatus(v string) *SourceRegion { - s.Status = &v - return s -} - -// This data type is used as a response element in the DescribeDBSubnetGroups -// action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Subnet -type Subnet struct { - _ struct{} `type:"structure"` - - // Contains Availability Zone information. - // - // This data type is used as an element in the following data type: - // - // * OrderableDBInstanceOption - SubnetAvailabilityZone *AvailabilityZone `type:"structure"` - - // Specifies the identifier of the subnet. - SubnetIdentifier *string `type:"string"` - - // Specifies the status of the subnet. - SubnetStatus *string `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() -} - -// SetSubnetAvailabilityZone sets the SubnetAvailabilityZone field's value. -func (s *Subnet) SetSubnetAvailabilityZone(v *AvailabilityZone) *Subnet { - s.SubnetAvailabilityZone = v - return s -} - -// SetSubnetIdentifier sets the SubnetIdentifier field's value. -func (s *Subnet) SetSubnetIdentifier(v string) *Subnet { - s.SubnetIdentifier = &v - return s -} - -// SetSubnetStatus sets the SubnetStatus field's value. -func (s *Subnet) SetSubnetStatus(v string) *Subnet { - s.SubnetStatus = &v - return s -} - -// Metadata assigned to an Amazon RDS resource consisting of a key-value pair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // A key is the required name of the tag. The string value can be from 1 to - // 128 Unicode characters in length and cannot be prefixed with "aws:" or "rds:". - // The string can only contain only the set of Unicode letters, digits, white-space, - // '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"). - Key *string `type:"string"` - - // A value is the optional value of the tag. The string value can be from 1 - // to 256 Unicode characters in length and cannot be prefixed with "aws:" or - // "rds:". The string can only contain only the set of Unicode letters, digits, - // white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"). - 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 -} - -// A time zone associated with a DBInstance or a DBSnapshot. This data type -// is an element in the response to the DescribeDBInstances, the DescribeDBSnapshots, -// and the DescribeDBEngineVersions actions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/Timezone -type Timezone struct { - _ struct{} `type:"structure"` - - // The name of the time zone. - TimezoneName *string `type:"string"` -} - -// String returns the string representation -func (s Timezone) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Timezone) GoString() string { - return s.String() -} - -// SetTimezoneName sets the TimezoneName field's value. -func (s *Timezone) SetTimezoneName(v string) *Timezone { - s.TimezoneName = &v - return s -} - -// The version of the database engine that a DB instance can be upgraded to. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/UpgradeTarget -type UpgradeTarget struct { - _ struct{} `type:"structure"` - - // A value that indicates whether the target version will be applied to any - // source DB instances that have AutoMinorVersionUpgrade set to true. - AutoUpgrade *bool `type:"boolean"` - - // The version of the database engine that a DB instance can be upgraded to. - Description *string `type:"string"` - - // The name of the upgrade target database engine. - Engine *string `type:"string"` - - // The version number of the upgrade target database engine. - EngineVersion *string `type:"string"` - - // A value that indicates whether a database engine will be upgraded to a major - // version. - IsMajorVersionUpgrade *bool `type:"boolean"` -} - -// String returns the string representation -func (s UpgradeTarget) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpgradeTarget) GoString() string { - return s.String() -} - -// SetAutoUpgrade sets the AutoUpgrade field's value. -func (s *UpgradeTarget) SetAutoUpgrade(v bool) *UpgradeTarget { - s.AutoUpgrade = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpgradeTarget) SetDescription(v string) *UpgradeTarget { - s.Description = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *UpgradeTarget) SetEngine(v string) *UpgradeTarget { - s.Engine = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *UpgradeTarget) SetEngineVersion(v string) *UpgradeTarget { - s.EngineVersion = &v - return s -} - -// SetIsMajorVersionUpgrade sets the IsMajorVersionUpgrade field's value. -func (s *UpgradeTarget) SetIsMajorVersionUpgrade(v bool) *UpgradeTarget { - s.IsMajorVersionUpgrade = &v - return s -} - -// This data type is used as a response element for queries on VPC security -// group membership. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/VpcSecurityGroupMembership -type VpcSecurityGroupMembership struct { - _ struct{} `type:"structure"` - - // The status of the VPC security group. - Status *string `type:"string"` - - // The name of the VPC security group. - VpcSecurityGroupId *string `type:"string"` -} - -// String returns the string representation -func (s VpcSecurityGroupMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcSecurityGroupMembership) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *VpcSecurityGroupMembership) SetStatus(v string) *VpcSecurityGroupMembership { - s.Status = &v - return s -} - -// SetVpcSecurityGroupId sets the VpcSecurityGroupId field's value. -func (s *VpcSecurityGroupMembership) SetVpcSecurityGroupId(v string) *VpcSecurityGroupMembership { - s.VpcSecurityGroupId = &v - return s -} - -const ( - // ApplyMethodImmediate is a ApplyMethod enum value - ApplyMethodImmediate = "immediate" - - // ApplyMethodPendingReboot is a ApplyMethod enum value - ApplyMethodPendingReboot = "pending-reboot" -) - -const ( - // SourceTypeDbInstance is a SourceType enum value - SourceTypeDbInstance = "db-instance" - - // SourceTypeDbParameterGroup is a SourceType enum value - SourceTypeDbParameterGroup = "db-parameter-group" - - // SourceTypeDbSecurityGroup is a SourceType enum value - SourceTypeDbSecurityGroup = "db-security-group" - - // SourceTypeDbSnapshot is a SourceType enum value - SourceTypeDbSnapshot = "db-snapshot" - - // SourceTypeDbCluster is a SourceType enum value - SourceTypeDbCluster = "db-cluster" - - // SourceTypeDbClusterSnapshot is a SourceType enum value - SourceTypeDbClusterSnapshot = "db-cluster-snapshot" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/rds/customizations.go deleted file mode 100644 index d412fb2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/customizations.go +++ /dev/null @@ -1,125 +0,0 @@ -package rds - -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() { - ops := []string{ - opCopyDBSnapshot, - opCreateDBInstanceReadReplica, - opCopyDBClusterSnapshot, - opCreateDBCluster, - } - initRequest = func(r *request.Request) { - for _, operation := range ops { - if r.Operation.Name == operation { - r.Handlers.Build.PushFront(fillPresignedURL) - } - } - } -} - -func fillPresignedURL(r *request.Request) { - fns := map[string]func(r *request.Request){ - opCopyDBSnapshot: copyDBSnapshotPresign, - opCreateDBInstanceReadReplica: createDBInstanceReadReplicaPresign, - opCopyDBClusterSnapshot: copyDBClusterSnapshotPresign, - opCreateDBCluster: createDBClusterPresign, - } - if !r.ParamsFilled() { - return - } - if f, ok := fns[r.Operation.Name]; ok { - f(r) - } -} - -func copyDBSnapshotPresign(r *request.Request) { - originParams := r.Params.(*CopyDBSnapshotInput) - - if originParams.SourceRegion == nil || originParams.PreSignedUrl != nil || originParams.DestinationRegion != nil { - return - } - - originParams.DestinationRegion = r.Config.Region - newParams := awsutil.CopyOf(r.Params).(*CopyDBSnapshotInput) - originParams.PreSignedUrl = presignURL(r, originParams.SourceRegion, newParams) -} - -func createDBInstanceReadReplicaPresign(r *request.Request) { - originParams := r.Params.(*CreateDBInstanceReadReplicaInput) - - if originParams.SourceRegion == nil || originParams.PreSignedUrl != nil || originParams.DestinationRegion != nil { - return - } - - originParams.DestinationRegion = r.Config.Region - newParams := awsutil.CopyOf(r.Params).(*CreateDBInstanceReadReplicaInput) - originParams.PreSignedUrl = presignURL(r, originParams.SourceRegion, newParams) -} - -func copyDBClusterSnapshotPresign(r *request.Request) { - originParams := r.Params.(*CopyDBClusterSnapshotInput) - - if originParams.SourceRegion == nil || originParams.PreSignedUrl != nil || originParams.DestinationRegion != nil { - return - } - - originParams.DestinationRegion = r.Config.Region - newParams := awsutil.CopyOf(r.Params).(*CopyDBClusterSnapshotInput) - originParams.PreSignedUrl = presignURL(r, originParams.SourceRegion, newParams) -} - -func createDBClusterPresign(r *request.Request) { - originParams := r.Params.(*CreateDBClusterInput) - - if originParams.SourceRegion == nil || originParams.PreSignedUrl != nil || originParams.DestinationRegion != nil { - return - } - - originParams.DestinationRegion = r.Config.Region - newParams := awsutil.CopyOf(r.Params).(*CreateDBClusterInput) - originParams.PreSignedUrl = presignURL(r, originParams.SourceRegion, newParams) -} - -// presignURL will presign the request by using SoureRegion to sign with. SourceRegion is not -// sent to the service, and is only used to not have the SDKs parsing ARNs. -func presignURL(r *request.Request, sourceRegion *string, newParams interface{}) *string { - cfg := r.Config.Copy(aws.NewConfig(). - WithEndpoint(""). - WithRegion(aws.StringValue(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 nil - } - - clientInfo.Endpoint = resolved.URL - clientInfo.SigningRegion = resolved.SigningRegion - - // Presign a request with modified params - req := request.New(*cfg, clientInfo, r.Handlers, r.Retryer, r.Operation, newParams, r.Data) - req.Operation.HTTPMethod = "GET" - uri, 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 nil - } - - // We have our URL, set it on params - return &uri -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go b/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go deleted file mode 100644 index 1ffd1a0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go +++ /dev/null @@ -1,490 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package rds - -const ( - - // ErrCodeAuthorizationAlreadyExistsFault for service response error code - // "AuthorizationAlreadyExists". - // - // The specified CIDRIP or EC2 security group is already authorized for the - // specified DB security group. - ErrCodeAuthorizationAlreadyExistsFault = "AuthorizationAlreadyExists" - - // ErrCodeAuthorizationNotFoundFault for service response error code - // "AuthorizationNotFound". - // - // Specified CIDRIP or EC2 security group is not authorized for the specified - // DB security group. - // - // RDS may not also be authorized via IAM to perform necessary actions on your - // behalf. - ErrCodeAuthorizationNotFoundFault = "AuthorizationNotFound" - - // ErrCodeAuthorizationQuotaExceededFault for service response error code - // "AuthorizationQuotaExceeded". - // - // DB security group authorization quota has been reached. - ErrCodeAuthorizationQuotaExceededFault = "AuthorizationQuotaExceeded" - - // ErrCodeCertificateNotFoundFault for service response error code - // "CertificateNotFound". - // - // CertificateIdentifier does not refer to an existing certificate. - ErrCodeCertificateNotFoundFault = "CertificateNotFound" - - // ErrCodeDBClusterAlreadyExistsFault for service response error code - // "DBClusterAlreadyExistsFault". - // - // User already has a DB cluster with the given identifier. - ErrCodeDBClusterAlreadyExistsFault = "DBClusterAlreadyExistsFault" - - // ErrCodeDBClusterNotFoundFault for service response error code - // "DBClusterNotFoundFault". - // - // DBClusterIdentifier does not refer to an existing DB cluster. - ErrCodeDBClusterNotFoundFault = "DBClusterNotFoundFault" - - // ErrCodeDBClusterParameterGroupNotFoundFault for service response error code - // "DBClusterParameterGroupNotFound". - // - // DBClusterParameterGroupName does not refer to an existing DB Cluster parameter - // group. - ErrCodeDBClusterParameterGroupNotFoundFault = "DBClusterParameterGroupNotFound" - - // ErrCodeDBClusterQuotaExceededFault for service response error code - // "DBClusterQuotaExceededFault". - // - // User attempted to create a new DB cluster and the user has already reached - // the maximum allowed DB cluster quota. - ErrCodeDBClusterQuotaExceededFault = "DBClusterQuotaExceededFault" - - // ErrCodeDBClusterRoleAlreadyExistsFault for service response error code - // "DBClusterRoleAlreadyExists". - // - // The specified IAM role Amazon Resource Name (ARN) is already associated with - // the specified DB cluster. - ErrCodeDBClusterRoleAlreadyExistsFault = "DBClusterRoleAlreadyExists" - - // ErrCodeDBClusterRoleNotFoundFault for service response error code - // "DBClusterRoleNotFound". - // - // The specified IAM role Amazon Resource Name (ARN) is not associated with - // the specified DB cluster. - ErrCodeDBClusterRoleNotFoundFault = "DBClusterRoleNotFound" - - // ErrCodeDBClusterRoleQuotaExceededFault for service response error code - // "DBClusterRoleQuotaExceeded". - // - // You have exceeded the maximum number of IAM roles that can be associated - // with the specified DB cluster. - ErrCodeDBClusterRoleQuotaExceededFault = "DBClusterRoleQuotaExceeded" - - // ErrCodeDBClusterSnapshotAlreadyExistsFault for service response error code - // "DBClusterSnapshotAlreadyExistsFault". - // - // User already has a DB cluster snapshot with the given identifier. - ErrCodeDBClusterSnapshotAlreadyExistsFault = "DBClusterSnapshotAlreadyExistsFault" - - // ErrCodeDBClusterSnapshotNotFoundFault for service response error code - // "DBClusterSnapshotNotFoundFault". - // - // DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot. - ErrCodeDBClusterSnapshotNotFoundFault = "DBClusterSnapshotNotFoundFault" - - // ErrCodeDBInstanceAlreadyExistsFault for service response error code - // "DBInstanceAlreadyExists". - // - // User already has a DB instance with the given identifier. - ErrCodeDBInstanceAlreadyExistsFault = "DBInstanceAlreadyExists" - - // ErrCodeDBInstanceNotFoundFault for service response error code - // "DBInstanceNotFound". - // - // DBInstanceIdentifier does not refer to an existing DB instance. - ErrCodeDBInstanceNotFoundFault = "DBInstanceNotFound" - - // ErrCodeDBLogFileNotFoundFault for service response error code - // "DBLogFileNotFoundFault". - // - // LogFileName does not refer to an existing DB log file. - ErrCodeDBLogFileNotFoundFault = "DBLogFileNotFoundFault" - - // ErrCodeDBParameterGroupAlreadyExistsFault for service response error code - // "DBParameterGroupAlreadyExists". - // - // A DB parameter group with the same name exists. - ErrCodeDBParameterGroupAlreadyExistsFault = "DBParameterGroupAlreadyExists" - - // ErrCodeDBParameterGroupNotFoundFault for service response error code - // "DBParameterGroupNotFound". - // - // DBParameterGroupName does not refer to an existing DB parameter group. - ErrCodeDBParameterGroupNotFoundFault = "DBParameterGroupNotFound" - - // ErrCodeDBParameterGroupQuotaExceededFault for service response error code - // "DBParameterGroupQuotaExceeded". - // - // Request would result in user exceeding the allowed number of DB parameter - // groups. - ErrCodeDBParameterGroupQuotaExceededFault = "DBParameterGroupQuotaExceeded" - - // ErrCodeDBSecurityGroupAlreadyExistsFault for service response error code - // "DBSecurityGroupAlreadyExists". - // - // A DB security group with the name specified in DBSecurityGroupName already - // exists. - ErrCodeDBSecurityGroupAlreadyExistsFault = "DBSecurityGroupAlreadyExists" - - // ErrCodeDBSecurityGroupNotFoundFault for service response error code - // "DBSecurityGroupNotFound". - // - // DBSecurityGroupName does not refer to an existing DB security group. - ErrCodeDBSecurityGroupNotFoundFault = "DBSecurityGroupNotFound" - - // ErrCodeDBSecurityGroupNotSupportedFault for service response error code - // "DBSecurityGroupNotSupported". - // - // A DB security group is not allowed for this action. - ErrCodeDBSecurityGroupNotSupportedFault = "DBSecurityGroupNotSupported" - - // ErrCodeDBSecurityGroupQuotaExceededFault for service response error code - // "QuotaExceeded.DBSecurityGroup". - // - // Request would result in user exceeding the allowed number of DB security - // groups. - ErrCodeDBSecurityGroupQuotaExceededFault = "QuotaExceeded.DBSecurityGroup" - - // ErrCodeDBSnapshotAlreadyExistsFault for service response error code - // "DBSnapshotAlreadyExists". - // - // DBSnapshotIdentifier is already used by an existing snapshot. - ErrCodeDBSnapshotAlreadyExistsFault = "DBSnapshotAlreadyExists" - - // ErrCodeDBSnapshotNotFoundFault for service response error code - // "DBSnapshotNotFound". - // - // DBSnapshotIdentifier does not refer to an existing DB snapshot. - ErrCodeDBSnapshotNotFoundFault = "DBSnapshotNotFound" - - // ErrCodeDBSubnetGroupAlreadyExistsFault for service response error code - // "DBSubnetGroupAlreadyExists". - // - // DBSubnetGroupName is already used by an existing DB subnet group. - ErrCodeDBSubnetGroupAlreadyExistsFault = "DBSubnetGroupAlreadyExists" - - // ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs for service response error code - // "DBSubnetGroupDoesNotCoverEnoughAZs". - // - // Subnets in the DB subnet group should cover at least two Availability Zones - // unless there is only one Availability Zone. - ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs = "DBSubnetGroupDoesNotCoverEnoughAZs" - - // ErrCodeDBSubnetGroupNotAllowedFault for service response error code - // "DBSubnetGroupNotAllowedFault". - // - // Indicates that the DBSubnetGroup should not be specified while creating read - // replicas that lie in the same region as the source instance. - ErrCodeDBSubnetGroupNotAllowedFault = "DBSubnetGroupNotAllowedFault" - - // ErrCodeDBSubnetGroupNotFoundFault for service response error code - // "DBSubnetGroupNotFoundFault". - // - // DBSubnetGroupName does not refer to an existing DB subnet group. - ErrCodeDBSubnetGroupNotFoundFault = "DBSubnetGroupNotFoundFault" - - // ErrCodeDBSubnetGroupQuotaExceededFault for service response error code - // "DBSubnetGroupQuotaExceeded". - // - // Request would result in user exceeding the allowed number of DB subnet groups. - ErrCodeDBSubnetGroupQuotaExceededFault = "DBSubnetGroupQuotaExceeded" - - // ErrCodeDBSubnetQuotaExceededFault for service response error code - // "DBSubnetQuotaExceededFault". - // - // Request would result in user exceeding the allowed number of subnets in a - // DB subnet groups. - ErrCodeDBSubnetQuotaExceededFault = "DBSubnetQuotaExceededFault" - - // ErrCodeDBUpgradeDependencyFailureFault for service response error code - // "DBUpgradeDependencyFailure". - // - // The DB upgrade failed because a resource the DB depends on could not be modified. - ErrCodeDBUpgradeDependencyFailureFault = "DBUpgradeDependencyFailure" - - // ErrCodeDomainNotFoundFault for service response error code - // "DomainNotFoundFault". - // - // Domain does not refer to an existing Active Directory Domain. - ErrCodeDomainNotFoundFault = "DomainNotFoundFault" - - // ErrCodeEventSubscriptionQuotaExceededFault for service response error code - // "EventSubscriptionQuotaExceeded". - // - // You have reached the maximum number of event subscriptions. - ErrCodeEventSubscriptionQuotaExceededFault = "EventSubscriptionQuotaExceeded" - - // ErrCodeInstanceQuotaExceededFault for service response error code - // "InstanceQuotaExceeded". - // - // Request would result in user exceeding the allowed number of DB instances. - ErrCodeInstanceQuotaExceededFault = "InstanceQuotaExceeded" - - // ErrCodeInsufficientDBClusterCapacityFault for service response error code - // "InsufficientDBClusterCapacityFault". - // - // The DB cluster does not have enough capacity for the current operation. - ErrCodeInsufficientDBClusterCapacityFault = "InsufficientDBClusterCapacityFault" - - // ErrCodeInsufficientDBInstanceCapacityFault for service response error code - // "InsufficientDBInstanceCapacity". - // - // Specified DB instance class is not available in the specified Availability - // Zone. - ErrCodeInsufficientDBInstanceCapacityFault = "InsufficientDBInstanceCapacity" - - // ErrCodeInsufficientStorageClusterCapacityFault for service response error code - // "InsufficientStorageClusterCapacity". - // - // There is insufficient storage available for the current action. You may be - // able to resolve this error by updating your subnet group to use different - // Availability Zones that have more storage available. - ErrCodeInsufficientStorageClusterCapacityFault = "InsufficientStorageClusterCapacity" - - // ErrCodeInvalidDBClusterSnapshotStateFault for service response error code - // "InvalidDBClusterSnapshotStateFault". - // - // The supplied value is not a valid DB cluster snapshot state. - ErrCodeInvalidDBClusterSnapshotStateFault = "InvalidDBClusterSnapshotStateFault" - - // ErrCodeInvalidDBClusterStateFault for service response error code - // "InvalidDBClusterStateFault". - // - // The DB cluster is not in a valid state. - ErrCodeInvalidDBClusterStateFault = "InvalidDBClusterStateFault" - - // ErrCodeInvalidDBInstanceStateFault for service response error code - // "InvalidDBInstanceState". - // - // The specified DB instance is not in the available state. - ErrCodeInvalidDBInstanceStateFault = "InvalidDBInstanceState" - - // ErrCodeInvalidDBParameterGroupStateFault for service response error code - // "InvalidDBParameterGroupState". - // - // The DB parameter group cannot be deleted because it is in use. - ErrCodeInvalidDBParameterGroupStateFault = "InvalidDBParameterGroupState" - - // ErrCodeInvalidDBSecurityGroupStateFault for service response error code - // "InvalidDBSecurityGroupState". - // - // The state of the DB security group does not allow deletion. - ErrCodeInvalidDBSecurityGroupStateFault = "InvalidDBSecurityGroupState" - - // ErrCodeInvalidDBSnapshotStateFault for service response error code - // "InvalidDBSnapshotState". - // - // The state of the DB snapshot does not allow deletion. - ErrCodeInvalidDBSnapshotStateFault = "InvalidDBSnapshotState" - - // ErrCodeInvalidDBSubnetGroupFault for service response error code - // "InvalidDBSubnetGroupFault". - // - // Indicates the DBSubnetGroup does not belong to the same VPC as that of an - // existing cross region read replica of the same source instance. - ErrCodeInvalidDBSubnetGroupFault = "InvalidDBSubnetGroupFault" - - // ErrCodeInvalidDBSubnetGroupStateFault for service response error code - // "InvalidDBSubnetGroupStateFault". - // - // The DB subnet group cannot be deleted because it is in use. - ErrCodeInvalidDBSubnetGroupStateFault = "InvalidDBSubnetGroupStateFault" - - // ErrCodeInvalidDBSubnetStateFault for service response error code - // "InvalidDBSubnetStateFault". - // - // The DB subnet is not in the available state. - ErrCodeInvalidDBSubnetStateFault = "InvalidDBSubnetStateFault" - - // ErrCodeInvalidEventSubscriptionStateFault for service response error code - // "InvalidEventSubscriptionState". - // - // This error can occur if someone else is modifying a subscription. You should - // retry the action. - ErrCodeInvalidEventSubscriptionStateFault = "InvalidEventSubscriptionState" - - // ErrCodeInvalidOptionGroupStateFault for service response error code - // "InvalidOptionGroupStateFault". - // - // The option group is not in the available state. - ErrCodeInvalidOptionGroupStateFault = "InvalidOptionGroupStateFault" - - // ErrCodeInvalidRestoreFault for service response error code - // "InvalidRestoreFault". - // - // Cannot restore from vpc backup to non-vpc DB instance. - ErrCodeInvalidRestoreFault = "InvalidRestoreFault" - - // ErrCodeInvalidS3BucketFault for service response error code - // "InvalidS3BucketFault". - // - // The specified Amazon S3 bucket name could not be found or Amazon RDS is not - // authorized to access the specified Amazon S3 bucket. Verify the SourceS3BucketName - // and S3IngestionRoleArn values and try again. - ErrCodeInvalidS3BucketFault = "InvalidS3BucketFault" - - // ErrCodeInvalidSubnet for service response error code - // "InvalidSubnet". - // - // The requested subnet is invalid, or multiple subnets were requested that - // are not all in a common VPC. - ErrCodeInvalidSubnet = "InvalidSubnet" - - // ErrCodeInvalidVPCNetworkStateFault for service response error code - // "InvalidVPCNetworkStateFault". - // - // DB subnet group does not cover all Availability Zones after it is created - // because users' change. - ErrCodeInvalidVPCNetworkStateFault = "InvalidVPCNetworkStateFault" - - // ErrCodeKMSKeyNotAccessibleFault for service response error code - // "KMSKeyNotAccessibleFault". - // - // Error accessing KMS key. - ErrCodeKMSKeyNotAccessibleFault = "KMSKeyNotAccessibleFault" - - // ErrCodeOptionGroupAlreadyExistsFault for service response error code - // "OptionGroupAlreadyExistsFault". - // - // The option group you are trying to create already exists. - ErrCodeOptionGroupAlreadyExistsFault = "OptionGroupAlreadyExistsFault" - - // ErrCodeOptionGroupNotFoundFault for service response error code - // "OptionGroupNotFoundFault". - // - // The specified option group could not be found. - ErrCodeOptionGroupNotFoundFault = "OptionGroupNotFoundFault" - - // ErrCodeOptionGroupQuotaExceededFault for service response error code - // "OptionGroupQuotaExceededFault". - // - // The quota of 20 option groups was exceeded for this AWS account. - ErrCodeOptionGroupQuotaExceededFault = "OptionGroupQuotaExceededFault" - - // ErrCodePointInTimeRestoreNotEnabledFault for service response error code - // "PointInTimeRestoreNotEnabled". - // - // SourceDBInstanceIdentifier refers to a DB instance with BackupRetentionPeriod - // equal to 0. - ErrCodePointInTimeRestoreNotEnabledFault = "PointInTimeRestoreNotEnabled" - - // ErrCodeProvisionedIopsNotAvailableInAZFault for service response error code - // "ProvisionedIopsNotAvailableInAZFault". - // - // Provisioned IOPS not available in the specified Availability Zone. - ErrCodeProvisionedIopsNotAvailableInAZFault = "ProvisionedIopsNotAvailableInAZFault" - - // ErrCodeReservedDBInstanceAlreadyExistsFault for service response error code - // "ReservedDBInstanceAlreadyExists". - // - // User already has a reservation with the given identifier. - ErrCodeReservedDBInstanceAlreadyExistsFault = "ReservedDBInstanceAlreadyExists" - - // ErrCodeReservedDBInstanceNotFoundFault for service response error code - // "ReservedDBInstanceNotFound". - // - // The specified reserved DB Instance not found. - ErrCodeReservedDBInstanceNotFoundFault = "ReservedDBInstanceNotFound" - - // ErrCodeReservedDBInstanceQuotaExceededFault for service response error code - // "ReservedDBInstanceQuotaExceeded". - // - // Request would exceed the user's DB Instance quota. - ErrCodeReservedDBInstanceQuotaExceededFault = "ReservedDBInstanceQuotaExceeded" - - // ErrCodeReservedDBInstancesOfferingNotFoundFault for service response error code - // "ReservedDBInstancesOfferingNotFound". - // - // Specified offering does not exist. - ErrCodeReservedDBInstancesOfferingNotFoundFault = "ReservedDBInstancesOfferingNotFound" - - // ErrCodeResourceNotFoundFault for service response error code - // "ResourceNotFoundFault". - // - // The specified resource ID was not found. - ErrCodeResourceNotFoundFault = "ResourceNotFoundFault" - - // ErrCodeSNSInvalidTopicFault for service response error code - // "SNSInvalidTopic". - // - // SNS has responded that there is a problem with the SND topic specified. - ErrCodeSNSInvalidTopicFault = "SNSInvalidTopic" - - // ErrCodeSNSNoAuthorizationFault for service response error code - // "SNSNoAuthorization". - // - // You do not have permission to publish to the SNS topic ARN. - ErrCodeSNSNoAuthorizationFault = "SNSNoAuthorization" - - // ErrCodeSNSTopicArnNotFoundFault for service response error code - // "SNSTopicArnNotFound". - // - // The SNS topic ARN does not exist. - ErrCodeSNSTopicArnNotFoundFault = "SNSTopicArnNotFound" - - // ErrCodeSharedSnapshotQuotaExceededFault for service response error code - // "SharedSnapshotQuotaExceeded". - // - // You have exceeded the maximum number of accounts that you can share a manual - // DB snapshot with. - ErrCodeSharedSnapshotQuotaExceededFault = "SharedSnapshotQuotaExceeded" - - // ErrCodeSnapshotQuotaExceededFault for service response error code - // "SnapshotQuotaExceeded". - // - // Request would result in user exceeding the allowed number of DB snapshots. - ErrCodeSnapshotQuotaExceededFault = "SnapshotQuotaExceeded" - - // ErrCodeSourceNotFoundFault for service response error code - // "SourceNotFound". - // - // The requested source could not be found. - ErrCodeSourceNotFoundFault = "SourceNotFound" - - // ErrCodeStorageQuotaExceededFault for service response error code - // "StorageQuotaExceeded". - // - // Request would result in user exceeding the allowed amount of storage available - // across all DB instances. - ErrCodeStorageQuotaExceededFault = "StorageQuotaExceeded" - - // ErrCodeStorageTypeNotSupportedFault for service response error code - // "StorageTypeNotSupported". - // - // StorageType specified cannot be associated with the DB Instance. - ErrCodeStorageTypeNotSupportedFault = "StorageTypeNotSupported" - - // ErrCodeSubnetAlreadyInUse for service response error code - // "SubnetAlreadyInUse". - // - // The DB subnet is already in use in the Availability Zone. - ErrCodeSubnetAlreadyInUse = "SubnetAlreadyInUse" - - // ErrCodeSubscriptionAlreadyExistFault for service response error code - // "SubscriptionAlreadyExist". - // - // The supplied subscription name already exists. - ErrCodeSubscriptionAlreadyExistFault = "SubscriptionAlreadyExist" - - // ErrCodeSubscriptionCategoryNotFoundFault for service response error code - // "SubscriptionCategoryNotFound". - // - // The supplied category does not exist. - ErrCodeSubscriptionCategoryNotFoundFault = "SubscriptionCategoryNotFound" - - // ErrCodeSubscriptionNotFoundFault for service response error code - // "SubscriptionNotFound". - // - // The subscription name does not exist. - ErrCodeSubscriptionNotFoundFault = "SubscriptionNotFound" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/service.go b/vendor/github.com/aws/aws-sdk-go/service/rds/service.go deleted file mode 100644 index e81de91..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/service.go +++ /dev/null @@ -1,133 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package rds - -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" -) - -// -// Amazon Relational Database Service (Amazon RDS) is a web service that makes -// it easier to set up, operate, and scale a relational database in the cloud. -// It provides cost-efficient, resizeable capacity for an industry-standard -// relational database and manages common database administration tasks, freeing -// up developers to focus on what makes their applications and businesses unique. -// -// Amazon RDS gives you access to the capabilities of a MySQL, MariaDB, PostgreSQL, -// Microsoft SQL Server, Oracle, or Amazon Aurora database server. These capabilities -// mean that the code, applications, and tools you already use today with your -// existing databases work with Amazon RDS without modification. Amazon RDS -// automatically backs up your database and maintains the database software -// that powers your DB instance. Amazon RDS is flexible: you can scale your -// database instance's compute resources and storage capacity to meet your application's -// demand. As with all Amazon Web Services, there are no up-front investments, -// and you pay only for the resources you use. -// -// This interface reference for Amazon RDS contains documentation for a programming -// or command line interface you can use to manage Amazon RDS. Note that Amazon -// RDS is asynchronous, which means that some interfaces might require techniques -// such as polling or callback functions to determine when a command has been -// applied. In this reference, the parameter descriptions indicate whether a -// command is applied immediately, on the next instance reboot, or during the -// maintenance window. The reference structure is as follows, and we list following -// some related topics from the user guide. -// -// Amazon RDS API Reference -// -// * For the alphabetical list of API actions, see API Actions (http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_Operations.html). -// -// * For the alphabetical list of data types, see Data Types (http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_Types.html). -// -// * For a list of common query parameters, see Common Parameters (http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/CommonParameters.html). -// -// * For descriptions of the error codes, see Common Errors (http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/CommonErrors.html). -// -// Amazon RDS User Guide -// -// * For a summary of the Amazon RDS interfaces, see Available RDS Interfaces -// (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html#Welcome.Interfaces). -// -// * For more information about how to use the Query API, see Using the Query -// API (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Using_the_Query_API.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/rds-2014-10-31 -type RDS 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 = "rds" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the RDS 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 RDS client from just a session. -// svc := rds.New(mySession) -// -// // Create a RDS client with additional configuration -// svc := rds.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *RDS { - 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) *RDS { - svc := &RDS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-10-31", - }, - 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 RDS operation and runs any -// custom request initialization. -func (c *RDS) 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/rds/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/rds/waiters.go deleted file mode 100644 index 00f532a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/waiters.go +++ /dev/null @@ -1,121 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package rds - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilDBInstanceAvailable uses the Amazon RDS API operation -// DescribeDBInstances 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 *RDS) WaitUntilDBInstanceAvailable(input *DescribeDBInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeDBInstances", - Delay: 30, - MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "deleted", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "deleting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "incompatible-restore", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "incompatible-parameters", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilDBInstanceDeleted uses the Amazon RDS API operation -// DescribeDBInstances 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 *RDS) WaitUntilDBInstanceDeleted(input *DescribeDBInstancesInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeDBInstances", - Delay: 30, - MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "deleted", - }, - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "DBInstanceNotFound", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "creating", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "modifying", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "rebooting", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "DBInstances[].DBInstanceStatus", - Expected: "resetting-master-credentials", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go deleted file mode 100644 index 7a9a7cf..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go +++ /dev/null @@ -1,15551 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package redshift provides a client for Amazon Redshift. -package redshift - -import ( - "time" - - "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 opAuthorizeClusterSecurityGroupIngress = "AuthorizeClusterSecurityGroupIngress" - -// AuthorizeClusterSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the AuthorizeClusterSecurityGroupIngress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AuthorizeClusterSecurityGroupIngress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AuthorizeClusterSecurityGroupIngress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AuthorizeClusterSecurityGroupIngressRequest method. -// req, resp := client.AuthorizeClusterSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeClusterSecurityGroupIngress -func (c *Redshift) AuthorizeClusterSecurityGroupIngressRequest(input *AuthorizeClusterSecurityGroupIngressInput) (req *request.Request, output *AuthorizeClusterSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opAuthorizeClusterSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AuthorizeClusterSecurityGroupIngressInput{} - } - - output = &AuthorizeClusterSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - return -} - -// AuthorizeClusterSecurityGroupIngress API operation for Amazon Redshift. -// -// Adds an inbound (ingress) rule to an Amazon Redshift security group. Depending -// on whether the application accessing your cluster is running on the Internet -// or an Amazon EC2 instance, you can authorize inbound access to either a Classless -// Interdomain Routing (CIDR)/Internet Protocol (IP) range or to an Amazon EC2 -// security group. You can add as many as 20 ingress rules to an Amazon Redshift -// security group. -// -// If you authorize access to an Amazon EC2 security group, specify EC2SecurityGroupName -// and EC2SecurityGroupOwnerId. The Amazon EC2 security group and Amazon Redshift -// cluster must be in the same AWS region. -// -// If you authorize access to a CIDR/IP address range, specify CIDRIP. For an -// overview of CIDR blocks, see the Wikipedia article on Classless Inter-Domain -// Routing (http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). -// -// You must also associate the security group with a cluster so that clients -// running on these IP addresses or the EC2 instance are authorized to connect -// to the cluster. For information about managing security groups, go to Working -// with Security Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation AuthorizeClusterSecurityGroupIngress for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSecurityGroupNotFoundFault "ClusterSecurityGroupNotFound" -// The cluster security group name does not refer to an existing cluster security -// group. -// -// * ErrCodeInvalidClusterSecurityGroupStateFault "InvalidClusterSecurityGroupState" -// The state of the cluster security group is not available. -// -// * ErrCodeAuthorizationAlreadyExistsFault "AuthorizationAlreadyExists" -// The specified CIDR block or EC2 security group is already authorized for -// the specified cluster security group. -// -// * ErrCodeAuthorizationQuotaExceededFault "AuthorizationQuotaExceeded" -// The authorization quota for the cluster security group has been reached. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeClusterSecurityGroupIngress -func (c *Redshift) AuthorizeClusterSecurityGroupIngress(input *AuthorizeClusterSecurityGroupIngressInput) (*AuthorizeClusterSecurityGroupIngressOutput, error) { - req, out := c.AuthorizeClusterSecurityGroupIngressRequest(input) - err := req.Send() - return out, err -} - -const opAuthorizeSnapshotAccess = "AuthorizeSnapshotAccess" - -// AuthorizeSnapshotAccessRequest generates a "aws/request.Request" representing the -// client's request for the AuthorizeSnapshotAccess operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AuthorizeSnapshotAccess for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AuthorizeSnapshotAccess method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AuthorizeSnapshotAccessRequest method. -// req, resp := client.AuthorizeSnapshotAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeSnapshotAccess -func (c *Redshift) AuthorizeSnapshotAccessRequest(input *AuthorizeSnapshotAccessInput) (req *request.Request, output *AuthorizeSnapshotAccessOutput) { - op := &request.Operation{ - Name: opAuthorizeSnapshotAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AuthorizeSnapshotAccessInput{} - } - - output = &AuthorizeSnapshotAccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// AuthorizeSnapshotAccess API operation for Amazon Redshift. -// -// Authorizes the specified AWS customer account to restore the specified snapshot. -// -// For more information about working with snapshots, go to Amazon Redshift -// Snapshots (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation AuthorizeSnapshotAccess for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSnapshotNotFoundFault "ClusterSnapshotNotFound" -// The snapshot identifier does not refer to an existing cluster snapshot. -// -// * ErrCodeAuthorizationAlreadyExistsFault "AuthorizationAlreadyExists" -// The specified CIDR block or EC2 security group is already authorized for -// the specified cluster security group. -// -// * ErrCodeAuthorizationQuotaExceededFault "AuthorizationQuotaExceeded" -// The authorization quota for the cluster security group has been reached. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// * ErrCodeInvalidClusterSnapshotStateFault "InvalidClusterSnapshotState" -// The specified cluster snapshot is not in the available state, or other accounts -// are authorized to access the snapshot. -// -// * ErrCodeLimitExceededFault "LimitExceededFault" -// The encryption key has exceeded its grant limit in AWS KMS. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeSnapshotAccess -func (c *Redshift) AuthorizeSnapshotAccess(input *AuthorizeSnapshotAccessInput) (*AuthorizeSnapshotAccessOutput, error) { - req, out := c.AuthorizeSnapshotAccessRequest(input) - err := req.Send() - return out, err -} - -const opCopyClusterSnapshot = "CopyClusterSnapshot" - -// CopyClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CopyClusterSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopyClusterSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopyClusterSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopyClusterSnapshotRequest method. -// req, resp := client.CopyClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CopyClusterSnapshot -func (c *Redshift) CopyClusterSnapshotRequest(input *CopyClusterSnapshotInput) (req *request.Request, output *CopyClusterSnapshotOutput) { - op := &request.Operation{ - Name: opCopyClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyClusterSnapshotInput{} - } - - output = &CopyClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyClusterSnapshot API operation for Amazon Redshift. -// -// Copies the specified automated cluster snapshot to a new manual cluster snapshot. -// The source must be an automated snapshot and it must be in the available -// state. -// -// When you delete a cluster, Amazon Redshift deletes any automated snapshots -// of the cluster. Also, when the retention period of the snapshot expires, -// Amazon Redshift automatically deletes it. If you want to keep an automated -// snapshot for a longer period, you can make a manual copy of the snapshot. -// Manual snapshots are retained until you delete them. -// -// For more information about working with snapshots, go to Amazon Redshift -// Snapshots (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation CopyClusterSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSnapshotAlreadyExistsFault "ClusterSnapshotAlreadyExists" -// The value specified as a snapshot identifier is already used by an existing -// snapshot. -// -// * ErrCodeClusterSnapshotNotFoundFault "ClusterSnapshotNotFound" -// The snapshot identifier does not refer to an existing cluster snapshot. -// -// * ErrCodeInvalidClusterSnapshotStateFault "InvalidClusterSnapshotState" -// The specified cluster snapshot is not in the available state, or other accounts -// are authorized to access the snapshot. -// -// * ErrCodeClusterSnapshotQuotaExceededFault "ClusterSnapshotQuotaExceeded" -// The request would result in the user exceeding the allowed number of cluster -// snapshots. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CopyClusterSnapshot -func (c *Redshift) CopyClusterSnapshot(input *CopyClusterSnapshotInput) (*CopyClusterSnapshotOutput, error) { - req, out := c.CopyClusterSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCreateCluster = "CreateCluster" - -// CreateClusterRequest generates a "aws/request.Request" representing the -// client's request for the CreateCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateClusterRequest method. -// req, resp := client.CreateClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateCluster -func (c *Redshift) CreateClusterRequest(input *CreateClusterInput) (req *request.Request, output *CreateClusterOutput) { - op := &request.Operation{ - Name: opCreateCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateClusterInput{} - } - - output = &CreateClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCluster API operation for Amazon Redshift. -// -// Creates a new cluster. -// -// To create the cluster in Virtual Private Cloud (VPC), you must provide a -// cluster subnet group name. The cluster subnet group identifies the subnets -// of your VPC that Amazon Redshift uses when creating the cluster. For more -// information about managing clusters, go to Amazon Redshift Clusters (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation CreateCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterAlreadyExistsFault "ClusterAlreadyExists" -// The account already has a cluster with the given identifier. -// -// * ErrCodeInsufficientClusterCapacityFault "InsufficientClusterCapacity" -// The number of nodes specified exceeds the allotted capacity of the cluster. -// -// * ErrCodeClusterParameterGroupNotFoundFault "ClusterParameterGroupNotFound" -// The parameter group name does not refer to an existing parameter group. -// -// * ErrCodeClusterSecurityGroupNotFoundFault "ClusterSecurityGroupNotFound" -// The cluster security group name does not refer to an existing cluster security -// group. -// -// * ErrCodeClusterQuotaExceededFault "ClusterQuotaExceeded" -// The request would exceed the allowed number of cluster instances for this -// account. For information about increasing your quota, go to Limits in Amazon -// Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeNumberOfNodesQuotaExceededFault "NumberOfNodesQuotaExceeded" -// The operation would exceed the number of nodes allotted to the account. For -// information about increasing your quota, go to Limits in Amazon Redshift -// (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeNumberOfNodesPerClusterLimitExceededFault "NumberOfNodesPerClusterLimitExceeded" -// The operation would exceed the number of nodes allowed for a cluster. -// -// * ErrCodeClusterSubnetGroupNotFoundFault "ClusterSubnetGroupNotFoundFault" -// The cluster subnet group name does not refer to an existing cluster subnet -// group. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The cluster subnet group does not cover all Availability Zones. -// -// * ErrCodeInvalidClusterSubnetGroupStateFault "InvalidClusterSubnetGroupStateFault" -// The cluster subnet group cannot be deleted because it is in use. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is not valid, or not all of the subnets are in the same -// VPC. -// -// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" -// Your account is not authorized to perform the requested operation. -// -// * ErrCodeHsmClientCertificateNotFoundFault "HsmClientCertificateNotFoundFault" -// There is no Amazon Redshift HSM client certificate with the specified identifier. -// -// * ErrCodeHsmConfigurationNotFoundFault "HsmConfigurationNotFoundFault" -// There is no Amazon Redshift HSM configuration with the specified identifier. -// -// * ErrCodeInvalidElasticIpFault "InvalidElasticIpFault" -// The Elastic IP (EIP) is invalid or cannot be found. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// * ErrCodeLimitExceededFault "LimitExceededFault" -// The encryption key has exceeded its grant limit in AWS KMS. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateCluster -func (c *Redshift) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) { - req, out := c.CreateClusterRequest(input) - err := req.Send() - return out, err -} - -const opCreateClusterParameterGroup = "CreateClusterParameterGroup" - -// CreateClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateClusterParameterGroupRequest method. -// req, resp := client.CreateClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterParameterGroup -func (c *Redshift) CreateClusterParameterGroupRequest(input *CreateClusterParameterGroupInput) (req *request.Request, output *CreateClusterParameterGroupOutput) { - op := &request.Operation{ - Name: opCreateClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateClusterParameterGroupInput{} - } - - output = &CreateClusterParameterGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateClusterParameterGroup API operation for Amazon Redshift. -// -// Creates an Amazon Redshift parameter group. -// -// Creating parameter groups is independent of creating clusters. You can associate -// a cluster with a parameter group when you create the cluster. You can also -// associate an existing cluster with a parameter group after the cluster is -// created by using ModifyCluster. -// -// Parameters in the parameter group define specific behavior that applies to -// the databases you create on the cluster. For more information about parameters -// and parameter groups, go to Amazon Redshift Parameter Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation CreateClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterParameterGroupQuotaExceededFault "ClusterParameterGroupQuotaExceeded" -// The request would result in the user exceeding the allowed number of cluster -// parameter groups. For information about increasing your quota, go to Limits -// in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeClusterParameterGroupAlreadyExistsFault "ClusterParameterGroupAlreadyExists" -// A cluster parameter group with the same name already exists. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterParameterGroup -func (c *Redshift) CreateClusterParameterGroup(input *CreateClusterParameterGroupInput) (*CreateClusterParameterGroupOutput, error) { - req, out := c.CreateClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateClusterSecurityGroup = "CreateClusterSecurityGroup" - -// CreateClusterSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateClusterSecurityGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateClusterSecurityGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateClusterSecurityGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateClusterSecurityGroupRequest method. -// req, resp := client.CreateClusterSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSecurityGroup -func (c *Redshift) CreateClusterSecurityGroupRequest(input *CreateClusterSecurityGroupInput) (req *request.Request, output *CreateClusterSecurityGroupOutput) { - op := &request.Operation{ - Name: opCreateClusterSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateClusterSecurityGroupInput{} - } - - output = &CreateClusterSecurityGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateClusterSecurityGroup API operation for Amazon Redshift. -// -// Creates a new Amazon Redshift security group. You use security groups to -// control access to non-VPC clusters. -// -// For information about managing security groups, go to Amazon Redshift Cluster -// Security Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation CreateClusterSecurityGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSecurityGroupAlreadyExistsFault "ClusterSecurityGroupAlreadyExists" -// A cluster security group with the same name already exists. -// -// * ErrCodeClusterSecurityGroupQuotaExceededFault "QuotaExceeded.ClusterSecurityGroup" -// The request would result in the user exceeding the allowed number of cluster -// security groups. For information about increasing your quota, go to Limits -// in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSecurityGroup -func (c *Redshift) CreateClusterSecurityGroup(input *CreateClusterSecurityGroupInput) (*CreateClusterSecurityGroupOutput, error) { - req, out := c.CreateClusterSecurityGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateClusterSnapshot = "CreateClusterSnapshot" - -// CreateClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateClusterSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateClusterSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateClusterSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateClusterSnapshotRequest method. -// req, resp := client.CreateClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSnapshot -func (c *Redshift) CreateClusterSnapshotRequest(input *CreateClusterSnapshotInput) (req *request.Request, output *CreateClusterSnapshotOutput) { - op := &request.Operation{ - Name: opCreateClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateClusterSnapshotInput{} - } - - output = &CreateClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateClusterSnapshot API operation for Amazon Redshift. -// -// Creates a manual snapshot of the specified cluster. The cluster must be in -// the available state. -// -// For more information about working with snapshots, go to Amazon Redshift -// Snapshots (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation CreateClusterSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSnapshotAlreadyExistsFault "ClusterSnapshotAlreadyExists" -// The value specified as a snapshot identifier is already used by an existing -// snapshot. -// -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeClusterSnapshotQuotaExceededFault "ClusterSnapshotQuotaExceeded" -// The request would result in the user exceeding the allowed number of cluster -// snapshots. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSnapshot -func (c *Redshift) CreateClusterSnapshot(input *CreateClusterSnapshotInput) (*CreateClusterSnapshotOutput, error) { - req, out := c.CreateClusterSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opCreateClusterSubnetGroup = "CreateClusterSubnetGroup" - -// CreateClusterSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateClusterSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateClusterSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateClusterSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateClusterSubnetGroupRequest method. -// req, resp := client.CreateClusterSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSubnetGroup -func (c *Redshift) CreateClusterSubnetGroupRequest(input *CreateClusterSubnetGroupInput) (req *request.Request, output *CreateClusterSubnetGroupOutput) { - op := &request.Operation{ - Name: opCreateClusterSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateClusterSubnetGroupInput{} - } - - output = &CreateClusterSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateClusterSubnetGroup API operation for Amazon Redshift. -// -// Creates a new Amazon Redshift subnet group. You must provide a list of one -// or more subnets in your existing Amazon Virtual Private Cloud (Amazon VPC) -// when creating Amazon Redshift subnet group. -// -// For information about subnet groups, go to Amazon Redshift Cluster Subnet -// Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-cluster-subnet-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation CreateClusterSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSubnetGroupAlreadyExistsFault "ClusterSubnetGroupAlreadyExists" -// A ClusterSubnetGroupName is already used by an existing cluster subnet group. -// -// * ErrCodeClusterSubnetGroupQuotaExceededFault "ClusterSubnetGroupQuotaExceeded" -// The request would result in user exceeding the allowed number of cluster -// subnet groups. For information about increasing your quota, go to Limits -// in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeClusterSubnetQuotaExceededFault "ClusterSubnetQuotaExceededFault" -// The request would result in user exceeding the allowed number of subnets -// in a cluster subnet groups. For information about increasing your quota, -// go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is not valid, or not all of the subnets are in the same -// VPC. -// -// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" -// Your account is not authorized to perform the requested operation. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSubnetGroup -func (c *Redshift) CreateClusterSubnetGroup(input *CreateClusterSubnetGroupInput) (*CreateClusterSubnetGroupOutput, error) { - req, out := c.CreateClusterSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opCreateEventSubscription = "CreateEventSubscription" - -// CreateEventSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the CreateEventSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateEventSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateEventSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateEventSubscriptionRequest method. -// req, resp := client.CreateEventSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateEventSubscription -func (c *Redshift) CreateEventSubscriptionRequest(input *CreateEventSubscriptionInput) (req *request.Request, output *CreateEventSubscriptionOutput) { - op := &request.Operation{ - Name: opCreateEventSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateEventSubscriptionInput{} - } - - output = &CreateEventSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEventSubscription API operation for Amazon Redshift. -// -// Creates an Amazon Redshift event notification subscription. This action requires -// an ARN (Amazon Resource Name) of an Amazon SNS topic created by either the -// Amazon Redshift console, the Amazon SNS console, or the Amazon SNS API. To -// obtain an ARN with Amazon SNS, you must create a topic in Amazon SNS and -// subscribe to the topic. The ARN is displayed in the SNS console. -// -// You can specify the source type, and lists of Amazon Redshift source IDs, -// event categories, and event severities. Notifications will be sent for all -// events you want that match those criteria. For example, you can specify source -// type = cluster, source ID = my-cluster-1 and mycluster2, event categories -// = Availability, Backup, and severity = ERROR. The subscription will only -// send notifications for those ERROR events in the Availability and Backup -// categories for the specified clusters. -// -// If you specify both the source type and source IDs, such as source type = -// cluster and source identifier = my-cluster-1, notifications will be sent -// for all the cluster events for my-cluster-1. If you specify a source type -// but do not specify a source identifier, you will receive notice of the events -// for the objects of that type in your AWS account. If you do not specify either -// the SourceType nor the SourceIdentifier, you will be notified of events generated -// from all Amazon Redshift sources belonging to your AWS account. You must -// specify a source type if you specify a source 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 Redshift's -// API operation CreateEventSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeEventSubscriptionQuotaExceededFault "EventSubscriptionQuotaExceeded" -// The request would exceed the allowed number of event subscriptions for this -// account. For information about increasing your quota, go to Limits in Amazon -// Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeSubscriptionAlreadyExistFault "SubscriptionAlreadyExist" -// There is already an existing event notification subscription with the specified -// name. -// -// * ErrCodeSNSInvalidTopicFault "SNSInvalidTopic" -// Amazon SNS has responded that there is a problem with the specified Amazon -// SNS topic. -// -// * ErrCodeSNSNoAuthorizationFault "SNSNoAuthorization" -// You do not have permission to publish to the specified Amazon SNS topic. -// -// * ErrCodeSNSTopicArnNotFoundFault "SNSTopicArnNotFound" -// An Amazon SNS topic with the specified Amazon Resource Name (ARN) does not -// exist. -// -// * ErrCodeSubscriptionEventIdNotFoundFault "SubscriptionEventIdNotFound" -// An Amazon Redshift event with the specified event ID does not exist. -// -// * ErrCodeSubscriptionCategoryNotFoundFault "SubscriptionCategoryNotFound" -// The value specified for the event category was not one of the allowed values, -// or it specified a category that does not apply to the specified source type. -// The allowed values are Configuration, Management, Monitoring, and Security. -// -// * ErrCodeSubscriptionSeverityNotFoundFault "SubscriptionSeverityNotFound" -// The value specified for the event severity was not one of the allowed values, -// or it specified a severity that does not apply to the specified source type. -// The allowed values are ERROR and INFO. -// -// * ErrCodeSourceNotFoundFault "SourceNotFound" -// The specified Amazon Redshift event source could not be found. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateEventSubscription -func (c *Redshift) CreateEventSubscription(input *CreateEventSubscriptionInput) (*CreateEventSubscriptionOutput, error) { - req, out := c.CreateEventSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opCreateHsmClientCertificate = "CreateHsmClientCertificate" - -// CreateHsmClientCertificateRequest generates a "aws/request.Request" representing the -// client's request for the CreateHsmClientCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateHsmClientCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateHsmClientCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateHsmClientCertificateRequest method. -// req, resp := client.CreateHsmClientCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmClientCertificate -func (c *Redshift) CreateHsmClientCertificateRequest(input *CreateHsmClientCertificateInput) (req *request.Request, output *CreateHsmClientCertificateOutput) { - op := &request.Operation{ - Name: opCreateHsmClientCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateHsmClientCertificateInput{} - } - - output = &CreateHsmClientCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateHsmClientCertificate API operation for Amazon Redshift. -// -// Creates an HSM client certificate that an Amazon Redshift cluster will use -// to connect to the client's HSM in order to store and retrieve the keys used -// to encrypt the cluster databases. -// -// The command returns a public key, which you must store in the HSM. In addition -// to creating the HSM certificate, you must create an Amazon Redshift HSM configuration -// that provides a cluster the information needed to store and use encryption -// keys in the HSM. For more information, go to Hardware Security Modules (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-HSM.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation CreateHsmClientCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeHsmClientCertificateAlreadyExistsFault "HsmClientCertificateAlreadyExistsFault" -// There is already an existing Amazon Redshift HSM client certificate with -// the specified identifier. -// -// * ErrCodeHsmClientCertificateQuotaExceededFault "HsmClientCertificateQuotaExceededFault" -// The quota for HSM client certificates has been reached. For information about -// increasing your quota, go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmClientCertificate -func (c *Redshift) CreateHsmClientCertificate(input *CreateHsmClientCertificateInput) (*CreateHsmClientCertificateOutput, error) { - req, out := c.CreateHsmClientCertificateRequest(input) - err := req.Send() - return out, err -} - -const opCreateHsmConfiguration = "CreateHsmConfiguration" - -// CreateHsmConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the CreateHsmConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateHsmConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateHsmConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateHsmConfigurationRequest method. -// req, resp := client.CreateHsmConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmConfiguration -func (c *Redshift) CreateHsmConfigurationRequest(input *CreateHsmConfigurationInput) (req *request.Request, output *CreateHsmConfigurationOutput) { - op := &request.Operation{ - Name: opCreateHsmConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateHsmConfigurationInput{} - } - - output = &CreateHsmConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateHsmConfiguration API operation for Amazon Redshift. -// -// Creates an HSM configuration that contains the information required by an -// Amazon Redshift cluster to store and use database encryption keys in a Hardware -// Security Module (HSM). After creating the HSM configuration, you can specify -// it as a parameter when creating a cluster. The cluster will then store its -// encryption keys in the HSM. -// -// In addition to creating an HSM configuration, you must also create an HSM -// client certificate. For more information, go to Hardware Security Modules -// (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-HSM.html) in -// the Amazon Redshift Cluster Management 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 Redshift's -// API operation CreateHsmConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeHsmConfigurationAlreadyExistsFault "HsmConfigurationAlreadyExistsFault" -// There is already an existing Amazon Redshift HSM configuration with the specified -// identifier. -// -// * ErrCodeHsmConfigurationQuotaExceededFault "HsmConfigurationQuotaExceededFault" -// The quota for HSM configurations has been reached. For information about -// increasing your quota, go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmConfiguration -func (c *Redshift) CreateHsmConfiguration(input *CreateHsmConfigurationInput) (*CreateHsmConfigurationOutput, error) { - req, out := c.CreateHsmConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opCreateSnapshotCopyGrant = "CreateSnapshotCopyGrant" - -// CreateSnapshotCopyGrantRequest generates a "aws/request.Request" representing the -// client's request for the CreateSnapshotCopyGrant operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSnapshotCopyGrant for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSnapshotCopyGrant method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSnapshotCopyGrantRequest method. -// req, resp := client.CreateSnapshotCopyGrantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateSnapshotCopyGrant -func (c *Redshift) CreateSnapshotCopyGrantRequest(input *CreateSnapshotCopyGrantInput) (req *request.Request, output *CreateSnapshotCopyGrantOutput) { - op := &request.Operation{ - Name: opCreateSnapshotCopyGrant, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSnapshotCopyGrantInput{} - } - - output = &CreateSnapshotCopyGrantOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSnapshotCopyGrant API operation for Amazon Redshift. -// -// Creates a snapshot copy grant that permits Amazon Redshift to use a customer -// master key (CMK) from AWS Key Management Service (AWS KMS) to encrypt copied -// snapshots in a destination region. -// -// For more information about managing snapshot copy grants, go to Amazon Redshift -// Database Encryption (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation CreateSnapshotCopyGrant for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSnapshotCopyGrantAlreadyExistsFault "SnapshotCopyGrantAlreadyExistsFault" -// The snapshot copy grant can't be created because a grant with the same name -// already exists. -// -// * ErrCodeSnapshotCopyGrantQuotaExceededFault "SnapshotCopyGrantQuotaExceededFault" -// The AWS account has exceeded the maximum number of snapshot copy grants in -// this region. -// -// * ErrCodeLimitExceededFault "LimitExceededFault" -// The encryption key has exceeded its grant limit in AWS KMS. -// -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateSnapshotCopyGrant -func (c *Redshift) CreateSnapshotCopyGrant(input *CreateSnapshotCopyGrantInput) (*CreateSnapshotCopyGrantOutput, error) { - req, out := c.CreateSnapshotCopyGrantRequest(input) - err := req.Send() - return out, err -} - -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/redshift-2012-12-01/CreateTags -func (c *Redshift) 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(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateTags API operation for Amazon Redshift. -// -// Adds one or more tags to a specified resource. -// -// A resource can have up to 10 tags. If you try to create more than 10 tags -// for a resource, you will receive an error and the attempt will fail. -// -// If you specify a key that already exists for the resource, the value for -// that key will be updated with the new 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 Redshift's -// API operation CreateTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTagLimitExceededFault "TagLimitExceededFault" -// The request exceeds the limit of 10 tags for the resource. -// -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateTags -func (c *Redshift) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { - req, out := c.CreateTagsRequest(input) - err := req.Send() - return out, err -} - -const opDeleteCluster = "DeleteCluster" - -// DeleteClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteClusterRequest method. -// req, resp := client.DeleteClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteCluster -func (c *Redshift) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { - op := &request.Operation{ - Name: opDeleteCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteClusterInput{} - } - - output = &DeleteClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCluster API operation for Amazon Redshift. -// -// Deletes a previously provisioned cluster. A successful response from the -// web service indicates that the request was received correctly. Use DescribeClusters -// to monitor the status of the deletion. The delete operation cannot be canceled -// or reverted once submitted. For more information about managing clusters, -// go to Amazon Redshift Clusters (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management Guide. -// -// If you want to shut down the cluster and retain it for future use, set SkipFinalClusterSnapshot -// to false and specify a name for FinalClusterSnapshotIdentifier. You can later -// restore this snapshot to resume using the cluster. If a final cluster snapshot -// is requested, the status of the cluster will be "final-snapshot" while the -// snapshot is being taken, then it's "deleting" once Amazon Redshift begins -// deleting the cluster. -// -// For more information about managing clusters, go to Amazon Redshift Clusters -// (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation DeleteCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeClusterSnapshotAlreadyExistsFault "ClusterSnapshotAlreadyExists" -// The value specified as a snapshot identifier is already used by an existing -// snapshot. -// -// * ErrCodeClusterSnapshotQuotaExceededFault "ClusterSnapshotQuotaExceeded" -// The request would result in the user exceeding the allowed number of cluster -// snapshots. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteCluster -func (c *Redshift) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) - err := req.Send() - return out, err -} - -const opDeleteClusterParameterGroup = "DeleteClusterParameterGroup" - -// DeleteClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteClusterParameterGroupRequest method. -// req, resp := client.DeleteClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterParameterGroup -func (c *Redshift) DeleteClusterParameterGroupRequest(input *DeleteClusterParameterGroupInput) (req *request.Request, output *DeleteClusterParameterGroupOutput) { - op := &request.Operation{ - Name: opDeleteClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteClusterParameterGroupInput{} - } - - output = &DeleteClusterParameterGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteClusterParameterGroup API operation for Amazon Redshift. -// -// Deletes a specified Amazon Redshift parameter group. -// -// You cannot delete a parameter group if it is associated with a cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DeleteClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidClusterParameterGroupStateFault "InvalidClusterParameterGroupState" -// The cluster parameter group action can not be completed because another task -// is in progress that involves the parameter group. Wait a few moments and -// try the operation again. -// -// * ErrCodeClusterParameterGroupNotFoundFault "ClusterParameterGroupNotFound" -// The parameter group name does not refer to an existing parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterParameterGroup -func (c *Redshift) DeleteClusterParameterGroup(input *DeleteClusterParameterGroupInput) (*DeleteClusterParameterGroupOutput, error) { - req, out := c.DeleteClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteClusterSecurityGroup = "DeleteClusterSecurityGroup" - -// DeleteClusterSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteClusterSecurityGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteClusterSecurityGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteClusterSecurityGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteClusterSecurityGroupRequest method. -// req, resp := client.DeleteClusterSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSecurityGroup -func (c *Redshift) DeleteClusterSecurityGroupRequest(input *DeleteClusterSecurityGroupInput) (req *request.Request, output *DeleteClusterSecurityGroupOutput) { - op := &request.Operation{ - Name: opDeleteClusterSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteClusterSecurityGroupInput{} - } - - output = &DeleteClusterSecurityGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteClusterSecurityGroup API operation for Amazon Redshift. -// -// Deletes an Amazon Redshift security group. -// -// You cannot delete a security group that is associated with any clusters. -// You cannot delete the default security group. -// -// For information about managing security groups, go to Amazon Redshift Cluster -// Security Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation DeleteClusterSecurityGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidClusterSecurityGroupStateFault "InvalidClusterSecurityGroupState" -// The state of the cluster security group is not available. -// -// * ErrCodeClusterSecurityGroupNotFoundFault "ClusterSecurityGroupNotFound" -// The cluster security group name does not refer to an existing cluster security -// group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSecurityGroup -func (c *Redshift) DeleteClusterSecurityGroup(input *DeleteClusterSecurityGroupInput) (*DeleteClusterSecurityGroupOutput, error) { - req, out := c.DeleteClusterSecurityGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteClusterSnapshot = "DeleteClusterSnapshot" - -// DeleteClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeleteClusterSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteClusterSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteClusterSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteClusterSnapshotRequest method. -// req, resp := client.DeleteClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSnapshot -func (c *Redshift) DeleteClusterSnapshotRequest(input *DeleteClusterSnapshotInput) (req *request.Request, output *DeleteClusterSnapshotOutput) { - op := &request.Operation{ - Name: opDeleteClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteClusterSnapshotInput{} - } - - output = &DeleteClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteClusterSnapshot API operation for Amazon Redshift. -// -// Deletes the specified manual snapshot. The snapshot must be in the available -// state, with no other users authorized to access the snapshot. -// -// Unlike automated snapshots, manual snapshots are retained even after you -// delete your cluster. Amazon Redshift does not delete your manual snapshots. -// You must delete manual snapshot explicitly to avoid getting charged. If other -// accounts are authorized to access the snapshot, you must revoke all of the -// authorizations before you can delete the 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 Redshift's -// API operation DeleteClusterSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidClusterSnapshotStateFault "InvalidClusterSnapshotState" -// The specified cluster snapshot is not in the available state, or other accounts -// are authorized to access the snapshot. -// -// * ErrCodeClusterSnapshotNotFoundFault "ClusterSnapshotNotFound" -// The snapshot identifier does not refer to an existing cluster snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSnapshot -func (c *Redshift) DeleteClusterSnapshot(input *DeleteClusterSnapshotInput) (*DeleteClusterSnapshotOutput, error) { - req, out := c.DeleteClusterSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opDeleteClusterSubnetGroup = "DeleteClusterSubnetGroup" - -// DeleteClusterSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteClusterSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteClusterSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteClusterSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteClusterSubnetGroupRequest method. -// req, resp := client.DeleteClusterSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSubnetGroup -func (c *Redshift) DeleteClusterSubnetGroupRequest(input *DeleteClusterSubnetGroupInput) (req *request.Request, output *DeleteClusterSubnetGroupOutput) { - op := &request.Operation{ - Name: opDeleteClusterSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteClusterSubnetGroupInput{} - } - - output = &DeleteClusterSubnetGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteClusterSubnetGroup API operation for Amazon Redshift. -// -// Deletes the specified cluster subnet group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DeleteClusterSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidClusterSubnetGroupStateFault "InvalidClusterSubnetGroupStateFault" -// The cluster subnet group cannot be deleted because it is in use. -// -// * ErrCodeInvalidClusterSubnetStateFault "InvalidClusterSubnetStateFault" -// The state of the subnet is invalid. -// -// * ErrCodeClusterSubnetGroupNotFoundFault "ClusterSubnetGroupNotFoundFault" -// The cluster subnet group name does not refer to an existing cluster subnet -// group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSubnetGroup -func (c *Redshift) DeleteClusterSubnetGroup(input *DeleteClusterSubnetGroupInput) (*DeleteClusterSubnetGroupOutput, error) { - req, out := c.DeleteClusterSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeleteEventSubscription = "DeleteEventSubscription" - -// DeleteEventSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEventSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteEventSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteEventSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteEventSubscriptionRequest method. -// req, resp := client.DeleteEventSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteEventSubscription -func (c *Redshift) DeleteEventSubscriptionRequest(input *DeleteEventSubscriptionInput) (req *request.Request, output *DeleteEventSubscriptionOutput) { - op := &request.Operation{ - Name: opDeleteEventSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEventSubscriptionInput{} - } - - output = &DeleteEventSubscriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEventSubscription API operation for Amazon Redshift. -// -// Deletes an Amazon Redshift event notification subscription. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DeleteEventSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionNotFoundFault "SubscriptionNotFound" -// An Amazon Redshift event notification subscription with the specified name -// does not exist. -// -// * ErrCodeInvalidSubscriptionStateFault "InvalidSubscriptionStateFault" -// The subscription request is invalid because it is a duplicate request. This -// subscription request is already in progress. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteEventSubscription -func (c *Redshift) DeleteEventSubscription(input *DeleteEventSubscriptionInput) (*DeleteEventSubscriptionOutput, error) { - req, out := c.DeleteEventSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteHsmClientCertificate = "DeleteHsmClientCertificate" - -// DeleteHsmClientCertificateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteHsmClientCertificate operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteHsmClientCertificate for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteHsmClientCertificate method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteHsmClientCertificateRequest method. -// req, resp := client.DeleteHsmClientCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmClientCertificate -func (c *Redshift) DeleteHsmClientCertificateRequest(input *DeleteHsmClientCertificateInput) (req *request.Request, output *DeleteHsmClientCertificateOutput) { - op := &request.Operation{ - Name: opDeleteHsmClientCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteHsmClientCertificateInput{} - } - - output = &DeleteHsmClientCertificateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteHsmClientCertificate API operation for Amazon Redshift. -// -// Deletes the specified HSM client certificate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DeleteHsmClientCertificate for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidHsmClientCertificateStateFault "InvalidHsmClientCertificateStateFault" -// The specified HSM client certificate is not in the available state, or it -// is still in use by one or more Amazon Redshift clusters. -// -// * ErrCodeHsmClientCertificateNotFoundFault "HsmClientCertificateNotFoundFault" -// There is no Amazon Redshift HSM client certificate with the specified identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmClientCertificate -func (c *Redshift) DeleteHsmClientCertificate(input *DeleteHsmClientCertificateInput) (*DeleteHsmClientCertificateOutput, error) { - req, out := c.DeleteHsmClientCertificateRequest(input) - err := req.Send() - return out, err -} - -const opDeleteHsmConfiguration = "DeleteHsmConfiguration" - -// DeleteHsmConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteHsmConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteHsmConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteHsmConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteHsmConfigurationRequest method. -// req, resp := client.DeleteHsmConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmConfiguration -func (c *Redshift) DeleteHsmConfigurationRequest(input *DeleteHsmConfigurationInput) (req *request.Request, output *DeleteHsmConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteHsmConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteHsmConfigurationInput{} - } - - output = &DeleteHsmConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteHsmConfiguration API operation for Amazon Redshift. -// -// Deletes the specified Amazon Redshift HSM 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 Redshift's -// API operation DeleteHsmConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidHsmConfigurationStateFault "InvalidHsmConfigurationStateFault" -// The specified HSM configuration is not in the available state, or it is still -// in use by one or more Amazon Redshift clusters. -// -// * ErrCodeHsmConfigurationNotFoundFault "HsmConfigurationNotFoundFault" -// There is no Amazon Redshift HSM configuration with the specified identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmConfiguration -func (c *Redshift) DeleteHsmConfiguration(input *DeleteHsmConfigurationInput) (*DeleteHsmConfigurationOutput, error) { - req, out := c.DeleteHsmConfigurationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteSnapshotCopyGrant = "DeleteSnapshotCopyGrant" - -// DeleteSnapshotCopyGrantRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSnapshotCopyGrant operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSnapshotCopyGrant for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSnapshotCopyGrant method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSnapshotCopyGrantRequest method. -// req, resp := client.DeleteSnapshotCopyGrantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteSnapshotCopyGrant -func (c *Redshift) DeleteSnapshotCopyGrantRequest(input *DeleteSnapshotCopyGrantInput) (req *request.Request, output *DeleteSnapshotCopyGrantOutput) { - op := &request.Operation{ - Name: opDeleteSnapshotCopyGrant, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSnapshotCopyGrantInput{} - } - - output = &DeleteSnapshotCopyGrantOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSnapshotCopyGrant API operation for Amazon Redshift. -// -// Deletes the specified snapshot copy grant. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DeleteSnapshotCopyGrant for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidSnapshotCopyGrantStateFault "InvalidSnapshotCopyGrantStateFault" -// The snapshot copy grant can't be deleted because it is used by one or more -// clusters. -// -// * ErrCodeSnapshotCopyGrantNotFoundFault "SnapshotCopyGrantNotFoundFault" -// The specified snapshot copy grant can't be found. Make sure that the name -// is typed correctly and that the grant exists in the destination region. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteSnapshotCopyGrant -func (c *Redshift) DeleteSnapshotCopyGrant(input *DeleteSnapshotCopyGrantInput) (*DeleteSnapshotCopyGrantOutput, error) { - req, out := c.DeleteSnapshotCopyGrantRequest(input) - err := req.Send() - return out, err -} - -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/redshift-2012-12-01/DeleteTags -func (c *Redshift) 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(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTags API operation for Amazon Redshift. -// -// Deletes a tag or tags from a resource. You must provide the ARN of the resource -// from which you want to delete the tag or 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 Redshift's -// API operation DeleteTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteTags -func (c *Redshift) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeClusterParameterGroups = "DescribeClusterParameterGroups" - -// DescribeClusterParameterGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusterParameterGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClusterParameterGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClusterParameterGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClusterParameterGroupsRequest method. -// req, resp := client.DescribeClusterParameterGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterParameterGroups -func (c *Redshift) DescribeClusterParameterGroupsRequest(input *DescribeClusterParameterGroupsInput) (req *request.Request, output *DescribeClusterParameterGroupsOutput) { - op := &request.Operation{ - Name: opDescribeClusterParameterGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeClusterParameterGroupsInput{} - } - - output = &DescribeClusterParameterGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusterParameterGroups API operation for Amazon Redshift. -// -// Returns a list of Amazon Redshift parameter groups, including parameter groups -// you created and the default parameter group. For each parameter group, the -// response includes the parameter group name, description, and parameter group -// family name. You can optionally specify a name to retrieve the description -// of a specific parameter group. -// -// For more information about parameters and parameter groups, go to Amazon -// Redshift Parameter Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) -// in the Amazon Redshift Cluster Management Guide. -// -// If you specify both tag keys and tag values in the same request, Amazon Redshift -// returns all parameter groups that match any combination of the specified -// keys and values. For example, if you have owner and environment for tag keys, -// and admin and test for tag values, all parameter groups that have any combination -// of those values are returned. -// -// If both tag keys and values are omitted from the request, parameter groups -// are returned regardless of whether they have tag keys or values associated -// with them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeClusterParameterGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterParameterGroupNotFoundFault "ClusterParameterGroupNotFound" -// The parameter group name does not refer to an existing parameter group. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterParameterGroups -func (c *Redshift) DescribeClusterParameterGroups(input *DescribeClusterParameterGroupsInput) (*DescribeClusterParameterGroupsOutput, error) { - req, out := c.DescribeClusterParameterGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeClusterParameterGroupsPages iterates over the pages of a DescribeClusterParameterGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterParameterGroups 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 DescribeClusterParameterGroups operation. -// pageNum := 0 -// err := client.DescribeClusterParameterGroupsPages(params, -// func(page *DescribeClusterParameterGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterParameterGroupsPages(input *DescribeClusterParameterGroupsInput, fn func(p *DescribeClusterParameterGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterParameterGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterParameterGroupsOutput), lastPage) - }) -} - -const opDescribeClusterParameters = "DescribeClusterParameters" - -// DescribeClusterParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusterParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClusterParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClusterParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClusterParametersRequest method. -// req, resp := client.DescribeClusterParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterParameters -func (c *Redshift) DescribeClusterParametersRequest(input *DescribeClusterParametersInput) (req *request.Request, output *DescribeClusterParametersOutput) { - op := &request.Operation{ - Name: opDescribeClusterParameters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeClusterParametersInput{} - } - - output = &DescribeClusterParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusterParameters API operation for Amazon Redshift. -// -// Returns a detailed list of parameters contained within the specified Amazon -// Redshift parameter group. For each parameter the response includes information -// such as parameter name, description, data type, value, whether the parameter -// value is modifiable, and so on. -// -// You can specify source filter to retrieve parameters of only specific type. -// For example, to retrieve parameters that were modified by a user action such -// as from ModifyClusterParameterGroup, you can specify source equal to user. -// -// For more information about parameters and parameter groups, go to Amazon -// Redshift Parameter Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation DescribeClusterParameters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterParameterGroupNotFoundFault "ClusterParameterGroupNotFound" -// The parameter group name does not refer to an existing parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterParameters -func (c *Redshift) DescribeClusterParameters(input *DescribeClusterParametersInput) (*DescribeClusterParametersOutput, error) { - req, out := c.DescribeClusterParametersRequest(input) - err := req.Send() - return out, err -} - -// DescribeClusterParametersPages iterates over the pages of a DescribeClusterParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterParameters 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 DescribeClusterParameters operation. -// pageNum := 0 -// err := client.DescribeClusterParametersPages(params, -// func(page *DescribeClusterParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterParametersPages(input *DescribeClusterParametersInput, fn func(p *DescribeClusterParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterParametersOutput), lastPage) - }) -} - -const opDescribeClusterSecurityGroups = "DescribeClusterSecurityGroups" - -// DescribeClusterSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusterSecurityGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClusterSecurityGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClusterSecurityGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClusterSecurityGroupsRequest method. -// req, resp := client.DescribeClusterSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSecurityGroups -func (c *Redshift) DescribeClusterSecurityGroupsRequest(input *DescribeClusterSecurityGroupsInput) (req *request.Request, output *DescribeClusterSecurityGroupsOutput) { - op := &request.Operation{ - Name: opDescribeClusterSecurityGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeClusterSecurityGroupsInput{} - } - - output = &DescribeClusterSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusterSecurityGroups API operation for Amazon Redshift. -// -// Returns information about Amazon Redshift security groups. If the name of -// a security group is specified, the response will contain only information -// about only that security group. -// -// For information about managing security groups, go to Amazon Redshift Cluster -// Security Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html) -// in the Amazon Redshift Cluster Management Guide. -// -// If you specify both tag keys and tag values in the same request, Amazon Redshift -// returns all security groups that match any combination of the specified keys -// and values. For example, if you have owner and environment for tag keys, -// and admin and test for tag values, all security groups that have any combination -// of those values are returned. -// -// If both tag keys and values are omitted from the request, security groups -// are returned regardless of whether they have tag keys or values associated -// with them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeClusterSecurityGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSecurityGroupNotFoundFault "ClusterSecurityGroupNotFound" -// The cluster security group name does not refer to an existing cluster security -// group. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSecurityGroups -func (c *Redshift) DescribeClusterSecurityGroups(input *DescribeClusterSecurityGroupsInput) (*DescribeClusterSecurityGroupsOutput, error) { - req, out := c.DescribeClusterSecurityGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeClusterSecurityGroupsPages iterates over the pages of a DescribeClusterSecurityGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterSecurityGroups 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 DescribeClusterSecurityGroups operation. -// pageNum := 0 -// err := client.DescribeClusterSecurityGroupsPages(params, -// func(page *DescribeClusterSecurityGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterSecurityGroupsPages(input *DescribeClusterSecurityGroupsInput, fn func(p *DescribeClusterSecurityGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterSecurityGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterSecurityGroupsOutput), lastPage) - }) -} - -const opDescribeClusterSnapshots = "DescribeClusterSnapshots" - -// DescribeClusterSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusterSnapshots operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClusterSnapshots for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClusterSnapshots method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClusterSnapshotsRequest method. -// req, resp := client.DescribeClusterSnapshotsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSnapshots -func (c *Redshift) DescribeClusterSnapshotsRequest(input *DescribeClusterSnapshotsInput) (req *request.Request, output *DescribeClusterSnapshotsOutput) { - op := &request.Operation{ - Name: opDescribeClusterSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeClusterSnapshotsInput{} - } - - output = &DescribeClusterSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusterSnapshots API operation for Amazon Redshift. -// -// Returns one or more snapshot objects, which contain metadata about your cluster -// snapshots. By default, this operation returns information about all snapshots -// of all clusters that are owned by you AWS customer account. No information -// is returned for snapshots owned by inactive AWS customer accounts. -// -// If you specify both tag keys and tag values in the same request, Amazon Redshift -// returns all snapshots that match any combination of the specified keys and -// values. For example, if you have owner and environment for tag keys, and -// admin and test for tag values, all snapshots that have any combination of -// those values are returned. Only snapshots that you own are returned in the -// response; shared snapshots are not returned with the tag key and tag value -// request parameters. -// -// If both tag keys and values are omitted from the request, snapshots are returned -// regardless of whether they have tag keys or values associated with them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeClusterSnapshots for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSnapshotNotFoundFault "ClusterSnapshotNotFound" -// The snapshot identifier does not refer to an existing cluster snapshot. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSnapshots -func (c *Redshift) DescribeClusterSnapshots(input *DescribeClusterSnapshotsInput) (*DescribeClusterSnapshotsOutput, error) { - req, out := c.DescribeClusterSnapshotsRequest(input) - err := req.Send() - return out, err -} - -// DescribeClusterSnapshotsPages iterates over the pages of a DescribeClusterSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterSnapshots 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 DescribeClusterSnapshots operation. -// pageNum := 0 -// err := client.DescribeClusterSnapshotsPages(params, -// func(page *DescribeClusterSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterSnapshotsPages(input *DescribeClusterSnapshotsInput, fn func(p *DescribeClusterSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterSnapshotsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterSnapshotsOutput), lastPage) - }) -} - -const opDescribeClusterSubnetGroups = "DescribeClusterSubnetGroups" - -// DescribeClusterSubnetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusterSubnetGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClusterSubnetGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClusterSubnetGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClusterSubnetGroupsRequest method. -// req, resp := client.DescribeClusterSubnetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSubnetGroups -func (c *Redshift) DescribeClusterSubnetGroupsRequest(input *DescribeClusterSubnetGroupsInput) (req *request.Request, output *DescribeClusterSubnetGroupsOutput) { - op := &request.Operation{ - Name: opDescribeClusterSubnetGroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeClusterSubnetGroupsInput{} - } - - output = &DescribeClusterSubnetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusterSubnetGroups API operation for Amazon Redshift. -// -// Returns one or more cluster subnet group objects, which contain metadata -// about your cluster subnet groups. By default, this operation returns information -// about all cluster subnet groups that are defined in you AWS account. -// -// If you specify both tag keys and tag values in the same request, Amazon Redshift -// returns all subnet groups that match any combination of the specified keys -// and values. For example, if you have owner and environment for tag keys, -// and admin and test for tag values, all subnet groups that have any combination -// of those values are returned. -// -// If both tag keys and values are omitted from the request, subnet groups are -// returned regardless of whether they have tag keys or values associated with -// them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeClusterSubnetGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSubnetGroupNotFoundFault "ClusterSubnetGroupNotFoundFault" -// The cluster subnet group name does not refer to an existing cluster subnet -// group. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSubnetGroups -func (c *Redshift) DescribeClusterSubnetGroups(input *DescribeClusterSubnetGroupsInput) (*DescribeClusterSubnetGroupsOutput, error) { - req, out := c.DescribeClusterSubnetGroupsRequest(input) - err := req.Send() - return out, err -} - -// DescribeClusterSubnetGroupsPages iterates over the pages of a DescribeClusterSubnetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterSubnetGroups 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 DescribeClusterSubnetGroups operation. -// pageNum := 0 -// err := client.DescribeClusterSubnetGroupsPages(params, -// func(page *DescribeClusterSubnetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterSubnetGroupsPages(input *DescribeClusterSubnetGroupsInput, fn func(p *DescribeClusterSubnetGroupsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterSubnetGroupsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterSubnetGroupsOutput), lastPage) - }) -} - -const opDescribeClusterVersions = "DescribeClusterVersions" - -// DescribeClusterVersionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusterVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClusterVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClusterVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClusterVersionsRequest method. -// req, resp := client.DescribeClusterVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterVersions -func (c *Redshift) DescribeClusterVersionsRequest(input *DescribeClusterVersionsInput) (req *request.Request, output *DescribeClusterVersionsOutput) { - op := &request.Operation{ - Name: opDescribeClusterVersions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeClusterVersionsInput{} - } - - output = &DescribeClusterVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusterVersions API operation for Amazon Redshift. -// -// Returns descriptions of the available Amazon Redshift cluster versions. You -// can call this operation even before creating any clusters to learn more about -// the Amazon Redshift versions. For more information about managing clusters, -// go to Amazon Redshift Clusters (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation DescribeClusterVersions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterVersions -func (c *Redshift) DescribeClusterVersions(input *DescribeClusterVersionsInput) (*DescribeClusterVersionsOutput, error) { - req, out := c.DescribeClusterVersionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeClusterVersionsPages iterates over the pages of a DescribeClusterVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusterVersions 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 DescribeClusterVersions operation. -// pageNum := 0 -// err := client.DescribeClusterVersionsPages(params, -// func(page *DescribeClusterVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClusterVersionsPages(input *DescribeClusterVersionsInput, fn func(p *DescribeClusterVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClusterVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClusterVersionsOutput), lastPage) - }) -} - -const opDescribeClusters = "DescribeClusters" - -// DescribeClustersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClusters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClusters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClustersRequest method. -// req, resp := client.DescribeClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusters -func (c *Redshift) DescribeClustersRequest(input *DescribeClustersInput) (req *request.Request, output *DescribeClustersOutput) { - op := &request.Operation{ - Name: opDescribeClusters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeClustersInput{} - } - - output = &DescribeClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusters API operation for Amazon Redshift. -// -// Returns properties of provisioned clusters including general cluster properties, -// cluster database properties, maintenance and backup properties, and security -// and access properties. This operation supports pagination. For more information -// about managing clusters, go to Amazon Redshift Clusters (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management Guide. -// -// If you specify both tag keys and tag values in the same request, Amazon Redshift -// returns all clusters that match any combination of the specified keys and -// values. For example, if you have owner and environment for tag keys, and -// admin and test for tag values, all clusters that have any combination of -// those values are returned. -// -// If both tag keys and values are omitted from the request, clusters are returned -// regardless of whether they have tag keys or values associated with them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusters -func (c *Redshift) DescribeClusters(input *DescribeClustersInput) (*DescribeClustersOutput, error) { - req, out := c.DescribeClustersRequest(input) - err := req.Send() - return out, err -} - -// DescribeClustersPages iterates over the pages of a DescribeClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeClusters 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 DescribeClusters operation. -// pageNum := 0 -// err := client.DescribeClustersPages(params, -// func(page *DescribeClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeClustersPages(input *DescribeClustersInput, fn func(p *DescribeClustersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeClustersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeClustersOutput), lastPage) - }) -} - -const opDescribeDefaultClusterParameters = "DescribeDefaultClusterParameters" - -// DescribeDefaultClusterParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDefaultClusterParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDefaultClusterParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDefaultClusterParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDefaultClusterParametersRequest method. -// req, resp := client.DescribeDefaultClusterParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeDefaultClusterParameters -func (c *Redshift) DescribeDefaultClusterParametersRequest(input *DescribeDefaultClusterParametersInput) (req *request.Request, output *DescribeDefaultClusterParametersOutput) { - op := &request.Operation{ - Name: opDescribeDefaultClusterParameters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"DefaultClusterParameters.Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeDefaultClusterParametersInput{} - } - - output = &DescribeDefaultClusterParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDefaultClusterParameters API operation for Amazon Redshift. -// -// Returns a list of parameter settings for the specified parameter group family. -// -// For more information about parameters and parameter groups, go to Amazon -// Redshift Parameter Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation DescribeDefaultClusterParameters for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeDefaultClusterParameters -func (c *Redshift) DescribeDefaultClusterParameters(input *DescribeDefaultClusterParametersInput) (*DescribeDefaultClusterParametersOutput, error) { - req, out := c.DescribeDefaultClusterParametersRequest(input) - err := req.Send() - return out, err -} - -// DescribeDefaultClusterParametersPages iterates over the pages of a DescribeDefaultClusterParameters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeDefaultClusterParameters 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 DescribeDefaultClusterParameters operation. -// pageNum := 0 -// err := client.DescribeDefaultClusterParametersPages(params, -// func(page *DescribeDefaultClusterParametersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeDefaultClusterParametersPages(input *DescribeDefaultClusterParametersInput, fn func(p *DescribeDefaultClusterParametersOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeDefaultClusterParametersRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeDefaultClusterParametersOutput), lastPage) - }) -} - -const opDescribeEventCategories = "DescribeEventCategories" - -// DescribeEventCategoriesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEventCategories operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEventCategories for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEventCategories method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventCategoriesRequest method. -// req, resp := client.DescribeEventCategoriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventCategories -func (c *Redshift) DescribeEventCategoriesRequest(input *DescribeEventCategoriesInput) (req *request.Request, output *DescribeEventCategoriesOutput) { - op := &request.Operation{ - Name: opDescribeEventCategories, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEventCategoriesInput{} - } - - output = &DescribeEventCategoriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEventCategories API operation for Amazon Redshift. -// -// Displays a list of event categories for all event source types, or for a -// specified source type. For a list of the event categories and source types, -// go to Amazon Redshift Event Notifications (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-event-notifications.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 Redshift's -// API operation DescribeEventCategories for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventCategories -func (c *Redshift) DescribeEventCategories(input *DescribeEventCategoriesInput) (*DescribeEventCategoriesOutput, error) { - req, out := c.DescribeEventCategoriesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEventSubscriptions = "DescribeEventSubscriptions" - -// DescribeEventSubscriptionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEventSubscriptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEventSubscriptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEventSubscriptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventSubscriptionsRequest method. -// req, resp := client.DescribeEventSubscriptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventSubscriptions -func (c *Redshift) DescribeEventSubscriptionsRequest(input *DescribeEventSubscriptionsInput) (req *request.Request, output *DescribeEventSubscriptionsOutput) { - op := &request.Operation{ - Name: opDescribeEventSubscriptions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEventSubscriptionsInput{} - } - - output = &DescribeEventSubscriptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEventSubscriptions API operation for Amazon Redshift. -// -// Lists descriptions of all the Amazon Redshift event notifications subscription -// for a customer account. If you specify a subscription name, lists the description -// for that subscription. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeEventSubscriptions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionNotFoundFault "SubscriptionNotFound" -// An Amazon Redshift event notification subscription with the specified name -// does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventSubscriptions -func (c *Redshift) DescribeEventSubscriptions(input *DescribeEventSubscriptionsInput) (*DescribeEventSubscriptionsOutput, error) { - req, out := c.DescribeEventSubscriptionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeEventSubscriptionsPages iterates over the pages of a DescribeEventSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEventSubscriptions 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 DescribeEventSubscriptions operation. -// pageNum := 0 -// err := client.DescribeEventSubscriptionsPages(params, -// func(page *DescribeEventSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeEventSubscriptionsPages(input *DescribeEventSubscriptionsInput, fn func(p *DescribeEventSubscriptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventSubscriptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventSubscriptionsOutput), lastPage) - }) -} - -const opDescribeEvents = "DescribeEvents" - -// DescribeEventsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEvents operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEvents for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEvents method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEventsRequest method. -// req, resp := client.DescribeEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEvents -func (c *Redshift) DescribeEventsRequest(input *DescribeEventsInput) (req *request.Request, output *DescribeEventsOutput) { - op := &request.Operation{ - Name: opDescribeEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeEventsInput{} - } - - output = &DescribeEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEvents API operation for Amazon Redshift. -// -// Returns events related to clusters, security groups, snapshots, and parameter -// groups for the past 14 days. Events specific to a particular cluster, security -// group, snapshot or parameter group can be obtained by providing the name -// as a parameter. By default, the past hour of events 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 Redshift's -// API operation DescribeEvents for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEvents -func (c *Redshift) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error) { - req, out := c.DescribeEventsRequest(input) - err := req.Send() - return out, err -} - -// DescribeEventsPages iterates over the pages of a DescribeEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeEvents 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 DescribeEvents operation. -// pageNum := 0 -// err := client.DescribeEventsPages(params, -// func(page *DescribeEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeEventsPages(input *DescribeEventsInput, fn func(p *DescribeEventsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeEventsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeEventsOutput), lastPage) - }) -} - -const opDescribeHsmClientCertificates = "DescribeHsmClientCertificates" - -// DescribeHsmClientCertificatesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHsmClientCertificates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeHsmClientCertificates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeHsmClientCertificates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeHsmClientCertificatesRequest method. -// req, resp := client.DescribeHsmClientCertificatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeHsmClientCertificates -func (c *Redshift) DescribeHsmClientCertificatesRequest(input *DescribeHsmClientCertificatesInput) (req *request.Request, output *DescribeHsmClientCertificatesOutput) { - op := &request.Operation{ - Name: opDescribeHsmClientCertificates, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeHsmClientCertificatesInput{} - } - - output = &DescribeHsmClientCertificatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHsmClientCertificates API operation for Amazon Redshift. -// -// Returns information about the specified HSM client certificate. If no certificate -// ID is specified, returns information about all the HSM certificates owned -// by your AWS customer account. -// -// If you specify both tag keys and tag values in the same request, Amazon Redshift -// returns all HSM client certificates that match any combination of the specified -// keys and values. For example, if you have owner and environment for tag keys, -// and admin and test for tag values, all HSM client certificates that have -// any combination of those values are returned. -// -// If both tag keys and values are omitted from the request, HSM client certificates -// are returned regardless of whether they have tag keys or values associated -// with them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeHsmClientCertificates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeHsmClientCertificateNotFoundFault "HsmClientCertificateNotFoundFault" -// There is no Amazon Redshift HSM client certificate with the specified identifier. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeHsmClientCertificates -func (c *Redshift) DescribeHsmClientCertificates(input *DescribeHsmClientCertificatesInput) (*DescribeHsmClientCertificatesOutput, error) { - req, out := c.DescribeHsmClientCertificatesRequest(input) - err := req.Send() - return out, err -} - -// DescribeHsmClientCertificatesPages iterates over the pages of a DescribeHsmClientCertificates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeHsmClientCertificates 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 DescribeHsmClientCertificates operation. -// pageNum := 0 -// err := client.DescribeHsmClientCertificatesPages(params, -// func(page *DescribeHsmClientCertificatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeHsmClientCertificatesPages(input *DescribeHsmClientCertificatesInput, fn func(p *DescribeHsmClientCertificatesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeHsmClientCertificatesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeHsmClientCertificatesOutput), lastPage) - }) -} - -const opDescribeHsmConfigurations = "DescribeHsmConfigurations" - -// DescribeHsmConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHsmConfigurations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeHsmConfigurations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeHsmConfigurations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeHsmConfigurationsRequest method. -// req, resp := client.DescribeHsmConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeHsmConfigurations -func (c *Redshift) DescribeHsmConfigurationsRequest(input *DescribeHsmConfigurationsInput) (req *request.Request, output *DescribeHsmConfigurationsOutput) { - op := &request.Operation{ - Name: opDescribeHsmConfigurations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeHsmConfigurationsInput{} - } - - output = &DescribeHsmConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHsmConfigurations API operation for Amazon Redshift. -// -// Returns information about the specified Amazon Redshift HSM configuration. -// If no configuration ID is specified, returns information about all the HSM -// configurations owned by your AWS customer account. -// -// If you specify both tag keys and tag values in the same request, Amazon Redshift -// returns all HSM connections that match any combination of the specified keys -// and values. For example, if you have owner and environment for tag keys, -// and admin and test for tag values, all HSM connections that have any combination -// of those values are returned. -// -// If both tag keys and values are omitted from the request, HSM connections -// are returned regardless of whether they have tag keys or values associated -// with them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeHsmConfigurations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeHsmConfigurationNotFoundFault "HsmConfigurationNotFoundFault" -// There is no Amazon Redshift HSM configuration with the specified identifier. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeHsmConfigurations -func (c *Redshift) DescribeHsmConfigurations(input *DescribeHsmConfigurationsInput) (*DescribeHsmConfigurationsOutput, error) { - req, out := c.DescribeHsmConfigurationsRequest(input) - err := req.Send() - return out, err -} - -// DescribeHsmConfigurationsPages iterates over the pages of a DescribeHsmConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeHsmConfigurations 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 DescribeHsmConfigurations operation. -// pageNum := 0 -// err := client.DescribeHsmConfigurationsPages(params, -// func(page *DescribeHsmConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeHsmConfigurationsPages(input *DescribeHsmConfigurationsInput, fn func(p *DescribeHsmConfigurationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeHsmConfigurationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeHsmConfigurationsOutput), lastPage) - }) -} - -const opDescribeLoggingStatus = "DescribeLoggingStatus" - -// DescribeLoggingStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLoggingStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLoggingStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLoggingStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLoggingStatusRequest method. -// req, resp := client.DescribeLoggingStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeLoggingStatus -func (c *Redshift) DescribeLoggingStatusRequest(input *DescribeLoggingStatusInput) (req *request.Request, output *LoggingStatus) { - op := &request.Operation{ - Name: opDescribeLoggingStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLoggingStatusInput{} - } - - output = &LoggingStatus{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLoggingStatus API operation for Amazon Redshift. -// -// Describes whether information, such as queries and connection attempts, is -// being logged for the specified Amazon Redshift cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeLoggingStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeLoggingStatus -func (c *Redshift) DescribeLoggingStatus(input *DescribeLoggingStatusInput) (*LoggingStatus, error) { - req, out := c.DescribeLoggingStatusRequest(input) - err := req.Send() - return out, err -} - -const opDescribeOrderableClusterOptions = "DescribeOrderableClusterOptions" - -// DescribeOrderableClusterOptionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOrderableClusterOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeOrderableClusterOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeOrderableClusterOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeOrderableClusterOptionsRequest method. -// req, resp := client.DescribeOrderableClusterOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeOrderableClusterOptions -func (c *Redshift) DescribeOrderableClusterOptionsRequest(input *DescribeOrderableClusterOptionsInput) (req *request.Request, output *DescribeOrderableClusterOptionsOutput) { - op := &request.Operation{ - Name: opDescribeOrderableClusterOptions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeOrderableClusterOptionsInput{} - } - - output = &DescribeOrderableClusterOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeOrderableClusterOptions API operation for Amazon Redshift. -// -// Returns a list of orderable cluster options. Before you create a new cluster -// you can use this operation to find what options are available, such as the -// EC2 Availability Zones (AZ) in the specific AWS region that you can specify, -// and the node types you can request. The node types differ by available storage, -// memory, CPU and price. With the cost involved you might want to obtain a -// list of cluster options in the specific region and specify values when creating -// a cluster. For more information about managing clusters, go to Amazon Redshift -// Clusters (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation DescribeOrderableClusterOptions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeOrderableClusterOptions -func (c *Redshift) DescribeOrderableClusterOptions(input *DescribeOrderableClusterOptionsInput) (*DescribeOrderableClusterOptionsOutput, error) { - req, out := c.DescribeOrderableClusterOptionsRequest(input) - err := req.Send() - return out, err -} - -// DescribeOrderableClusterOptionsPages iterates over the pages of a DescribeOrderableClusterOptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeOrderableClusterOptions 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 DescribeOrderableClusterOptions operation. -// pageNum := 0 -// err := client.DescribeOrderableClusterOptionsPages(params, -// func(page *DescribeOrderableClusterOptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeOrderableClusterOptionsPages(input *DescribeOrderableClusterOptionsInput, fn func(p *DescribeOrderableClusterOptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeOrderableClusterOptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeOrderableClusterOptionsOutput), lastPage) - }) -} - -const opDescribeReservedNodeOfferings = "DescribeReservedNodeOfferings" - -// DescribeReservedNodeOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedNodeOfferings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedNodeOfferings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedNodeOfferings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedNodeOfferingsRequest method. -// req, resp := client.DescribeReservedNodeOfferingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeReservedNodeOfferings -func (c *Redshift) DescribeReservedNodeOfferingsRequest(input *DescribeReservedNodeOfferingsInput) (req *request.Request, output *DescribeReservedNodeOfferingsOutput) { - op := &request.Operation{ - Name: opDescribeReservedNodeOfferings, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedNodeOfferingsInput{} - } - - output = &DescribeReservedNodeOfferingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedNodeOfferings API operation for Amazon Redshift. -// -// Returns a list of the available reserved node offerings by Amazon Redshift -// with their descriptions including the node type, the fixed and recurring -// costs of reserving the node and duration the node will be reserved for you. -// These descriptions help you determine which reserve node offering you want -// to purchase. You then use the unique offering ID in you call to PurchaseReservedNodeOffering -// to reserve one or more nodes for your Amazon Redshift cluster. -// -// For more information about reserved node offerings, go to Purchasing Reserved -// Nodes (http://docs.aws.amazon.com/redshift/latest/mgmt/purchase-reserved-node-instance.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation DescribeReservedNodeOfferings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedNodeOfferingNotFoundFault "ReservedNodeOfferingNotFound" -// Specified offering does not exist. -// -// * ErrCodeUnsupportedOperationFault "UnsupportedOperation" -// The requested operation isn't supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeReservedNodeOfferings -func (c *Redshift) DescribeReservedNodeOfferings(input *DescribeReservedNodeOfferingsInput) (*DescribeReservedNodeOfferingsOutput, error) { - req, out := c.DescribeReservedNodeOfferingsRequest(input) - err := req.Send() - return out, err -} - -// DescribeReservedNodeOfferingsPages iterates over the pages of a DescribeReservedNodeOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedNodeOfferings 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 DescribeReservedNodeOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedNodeOfferingsPages(params, -// func(page *DescribeReservedNodeOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeReservedNodeOfferingsPages(input *DescribeReservedNodeOfferingsInput, fn func(p *DescribeReservedNodeOfferingsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedNodeOfferingsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedNodeOfferingsOutput), lastPage) - }) -} - -const opDescribeReservedNodes = "DescribeReservedNodes" - -// DescribeReservedNodesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedNodes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedNodes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedNodes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedNodesRequest method. -// req, resp := client.DescribeReservedNodesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeReservedNodes -func (c *Redshift) DescribeReservedNodesRequest(input *DescribeReservedNodesInput) (req *request.Request, output *DescribeReservedNodesOutput) { - op := &request.Operation{ - Name: opDescribeReservedNodes, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"Marker"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedNodesInput{} - } - - output = &DescribeReservedNodesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedNodes API operation for Amazon Redshift. -// -// Returns the descriptions of the reserved nodes. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeReservedNodes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedNodeNotFoundFault "ReservedNodeNotFound" -// The specified reserved compute node not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeReservedNodes -func (c *Redshift) DescribeReservedNodes(input *DescribeReservedNodesInput) (*DescribeReservedNodesOutput, error) { - req, out := c.DescribeReservedNodesRequest(input) - err := req.Send() - return out, err -} - -// DescribeReservedNodesPages iterates over the pages of a DescribeReservedNodes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedNodes 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 DescribeReservedNodes operation. -// pageNum := 0 -// err := client.DescribeReservedNodesPages(params, -// func(page *DescribeReservedNodesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Redshift) DescribeReservedNodesPages(input *DescribeReservedNodesInput, fn func(p *DescribeReservedNodesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeReservedNodesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeReservedNodesOutput), lastPage) - }) -} - -const opDescribeResize = "DescribeResize" - -// DescribeResizeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeResize operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeResize for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeResize method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeResizeRequest method. -// req, resp := client.DescribeResizeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeResize -func (c *Redshift) DescribeResizeRequest(input *DescribeResizeInput) (req *request.Request, output *DescribeResizeOutput) { - op := &request.Operation{ - Name: opDescribeResize, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeResizeInput{} - } - - output = &DescribeResizeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeResize API operation for Amazon Redshift. -// -// Returns information about the last resize operation for the specified cluster. -// If no resize operation has ever been initiated for the specified cluster, -// a HTTP 404 error is returned. If a resize operation was initiated and completed, -// the status of the resize remains as SUCCEEDED until the next resize. -// -// A resize operation can be requested using ModifyCluster and specifying a -// different number or type of nodes for the cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeResize for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeResizeNotFoundFault "ResizeNotFound" -// A resize operation for the specified cluster is not found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeResize -func (c *Redshift) DescribeResize(input *DescribeResizeInput) (*DescribeResizeOutput, error) { - req, out := c.DescribeResizeRequest(input) - err := req.Send() - return out, err -} - -const opDescribeSnapshotCopyGrants = "DescribeSnapshotCopyGrants" - -// DescribeSnapshotCopyGrantsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshotCopyGrants operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSnapshotCopyGrants for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSnapshotCopyGrants method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSnapshotCopyGrantsRequest method. -// req, resp := client.DescribeSnapshotCopyGrantsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeSnapshotCopyGrants -func (c *Redshift) DescribeSnapshotCopyGrantsRequest(input *DescribeSnapshotCopyGrantsInput) (req *request.Request, output *DescribeSnapshotCopyGrantsOutput) { - op := &request.Operation{ - Name: opDescribeSnapshotCopyGrants, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSnapshotCopyGrantsInput{} - } - - output = &DescribeSnapshotCopyGrantsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSnapshotCopyGrants API operation for Amazon Redshift. -// -// Returns a list of snapshot copy grants owned by the AWS account in the destination -// region. -// -// For more information about managing snapshot copy grants, go to Amazon Redshift -// Database Encryption (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation DescribeSnapshotCopyGrants for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSnapshotCopyGrantNotFoundFault "SnapshotCopyGrantNotFoundFault" -// The specified snapshot copy grant can't be found. Make sure that the name -// is typed correctly and that the grant exists in the destination region. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeSnapshotCopyGrants -func (c *Redshift) DescribeSnapshotCopyGrants(input *DescribeSnapshotCopyGrantsInput) (*DescribeSnapshotCopyGrantsOutput, error) { - req, out := c.DescribeSnapshotCopyGrantsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeTableRestoreStatus = "DescribeTableRestoreStatus" - -// DescribeTableRestoreStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTableRestoreStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTableRestoreStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTableRestoreStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTableRestoreStatusRequest method. -// req, resp := client.DescribeTableRestoreStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeTableRestoreStatus -func (c *Redshift) DescribeTableRestoreStatusRequest(input *DescribeTableRestoreStatusInput) (req *request.Request, output *DescribeTableRestoreStatusOutput) { - op := &request.Operation{ - Name: opDescribeTableRestoreStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTableRestoreStatusInput{} - } - - output = &DescribeTableRestoreStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTableRestoreStatus API operation for Amazon Redshift. -// -// Lists the status of one or more table restore requests made using the RestoreTableFromClusterSnapshot -// API action. If you don't specify a value for the TableRestoreRequestId parameter, -// then DescribeTableRestoreStatus returns the status of all table restore requests -// ordered by the date and time of the request in ascending order. Otherwise -// DescribeTableRestoreStatus returns the status of the table specified by TableRestoreRequestId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeTableRestoreStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTableRestoreNotFoundFault "TableRestoreNotFoundFault" -// The specified TableRestoreRequestId value was not found. -// -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeTableRestoreStatus -func (c *Redshift) DescribeTableRestoreStatus(input *DescribeTableRestoreStatusInput) (*DescribeTableRestoreStatusOutput, error) { - req, out := c.DescribeTableRestoreStatusRequest(input) - err := req.Send() - return out, err -} - -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/redshift-2012-12-01/DescribeTags -func (c *Redshift) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { - op := &request.Operation{ - Name: opDescribeTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTagsInput{} - } - - output = &DescribeTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTags API operation for Amazon Redshift. -// -// Returns a list of tags. You can return tags from a specific resource by specifying -// an ARN, or you can return all tags for a given type of resource, such as -// clusters, snapshots, and so on. -// -// The following are limitations for DescribeTags: -// -// * You cannot specify an ARN and a resource-type value together in the -// same request. -// -// * You cannot use the MaxRecords and Marker parameters together with the -// ARN parameter. -// -// * The MaxRecords parameter can be a range from 10 to 50 results to return -// in a request. -// -// If you specify both tag keys and tag values in the same request, Amazon Redshift -// returns all resources that match any combination of the specified keys and -// values. For example, if you have owner and environment for tag keys, and -// admin and test for tag values, all resources that have any combination of -// those values are returned. -// -// If both tag keys and values are omitted from the request, resources are returned -// regardless of whether they have tag keys or values associated with them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DescribeTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" -// The resource could not be found. -// -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeTags -func (c *Redshift) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - err := req.Send() - return out, err -} - -const opDisableLogging = "DisableLogging" - -// DisableLoggingRequest generates a "aws/request.Request" representing the -// client's request for the DisableLogging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableLogging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableLogging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableLoggingRequest method. -// req, resp := client.DisableLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableLogging -func (c *Redshift) DisableLoggingRequest(input *DisableLoggingInput) (req *request.Request, output *LoggingStatus) { - op := &request.Operation{ - Name: opDisableLogging, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableLoggingInput{} - } - - output = &LoggingStatus{} - req = c.newRequest(op, input, output) - return -} - -// DisableLogging API operation for Amazon Redshift. -// -// Stops logging information, such as queries and connection attempts, for the -// specified Amazon Redshift cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation DisableLogging for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableLogging -func (c *Redshift) DisableLogging(input *DisableLoggingInput) (*LoggingStatus, error) { - req, out := c.DisableLoggingRequest(input) - err := req.Send() - return out, err -} - -const opDisableSnapshotCopy = "DisableSnapshotCopy" - -// DisableSnapshotCopyRequest generates a "aws/request.Request" representing the -// client's request for the DisableSnapshotCopy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableSnapshotCopy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableSnapshotCopy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableSnapshotCopyRequest method. -// req, resp := client.DisableSnapshotCopyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableSnapshotCopy -func (c *Redshift) DisableSnapshotCopyRequest(input *DisableSnapshotCopyInput) (req *request.Request, output *DisableSnapshotCopyOutput) { - op := &request.Operation{ - Name: opDisableSnapshotCopy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableSnapshotCopyInput{} - } - - output = &DisableSnapshotCopyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableSnapshotCopy API operation for Amazon Redshift. -// -// Disables the automatic copying of snapshots from one region to another region -// for a specified cluster. -// -// If your cluster and its snapshots are encrypted using a customer master key -// (CMK) from AWS KMS, use DeleteSnapshotCopyGrant to delete the grant that -// grants Amazon Redshift permission to the CMK in the destination 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 Redshift's -// API operation DisableSnapshotCopy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeSnapshotCopyAlreadyDisabledFault "SnapshotCopyAlreadyDisabledFault" -// The cluster already has cross-region snapshot copy disabled. -// -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" -// Your account is not authorized to perform the requested operation. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableSnapshotCopy -func (c *Redshift) DisableSnapshotCopy(input *DisableSnapshotCopyInput) (*DisableSnapshotCopyOutput, error) { - req, out := c.DisableSnapshotCopyRequest(input) - err := req.Send() - return out, err -} - -const opEnableLogging = "EnableLogging" - -// EnableLoggingRequest generates a "aws/request.Request" representing the -// client's request for the EnableLogging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableLogging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableLogging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableLoggingRequest method. -// req, resp := client.EnableLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableLogging -func (c *Redshift) EnableLoggingRequest(input *EnableLoggingInput) (req *request.Request, output *LoggingStatus) { - op := &request.Operation{ - Name: opEnableLogging, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableLoggingInput{} - } - - output = &LoggingStatus{} - req = c.newRequest(op, input, output) - return -} - -// EnableLogging API operation for Amazon Redshift. -// -// Starts logging information, such as queries and connection attempts, for -// the specified Amazon Redshift cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation EnableLogging for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeBucketNotFoundFault "BucketNotFoundFault" -// Could not find the specified S3 bucket. -// -// * ErrCodeInsufficientS3BucketPolicyFault "InsufficientS3BucketPolicyFault" -// The cluster does not have read bucket or put object permissions on the S3 -// bucket specified when enabling logging. -// -// * ErrCodeInvalidS3KeyPrefixFault "InvalidS3KeyPrefixFault" -// The string specified for the logging S3 key prefix does not comply with the -// documented constraints. -// -// * ErrCodeInvalidS3BucketNameFault "InvalidS3BucketNameFault" -// The S3 bucket name is invalid. For more information about naming rules, go -// to Bucket Restrictions and Limitations (http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html) -// in the Amazon Simple Storage Service (S3) Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableLogging -func (c *Redshift) EnableLogging(input *EnableLoggingInput) (*LoggingStatus, error) { - req, out := c.EnableLoggingRequest(input) - err := req.Send() - return out, err -} - -const opEnableSnapshotCopy = "EnableSnapshotCopy" - -// EnableSnapshotCopyRequest generates a "aws/request.Request" representing the -// client's request for the EnableSnapshotCopy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableSnapshotCopy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableSnapshotCopy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableSnapshotCopyRequest method. -// req, resp := client.EnableSnapshotCopyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableSnapshotCopy -func (c *Redshift) EnableSnapshotCopyRequest(input *EnableSnapshotCopyInput) (req *request.Request, output *EnableSnapshotCopyOutput) { - op := &request.Operation{ - Name: opEnableSnapshotCopy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableSnapshotCopyInput{} - } - - output = &EnableSnapshotCopyOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableSnapshotCopy API operation for Amazon Redshift. -// -// Enables the automatic copy of snapshots from one region to another region -// for a specified cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation EnableSnapshotCopy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeIncompatibleOrderableOptions "IncompatibleOrderableOptions" -// The specified options are incompatible. -// -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeCopyToRegionDisabledFault "CopyToRegionDisabledFault" -// Cross-region snapshot copy was temporarily disabled. Try your request again. -// -// * ErrCodeSnapshotCopyAlreadyEnabledFault "SnapshotCopyAlreadyEnabledFault" -// The cluster already has cross-region snapshot copy enabled. -// -// * ErrCodeUnknownSnapshotCopyRegionFault "UnknownSnapshotCopyRegionFault" -// The specified region is incorrect or does not exist. -// -// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" -// Your account is not authorized to perform the requested operation. -// -// * ErrCodeSnapshotCopyGrantNotFoundFault "SnapshotCopyGrantNotFoundFault" -// The specified snapshot copy grant can't be found. Make sure that the name -// is typed correctly and that the grant exists in the destination region. -// -// * ErrCodeLimitExceededFault "LimitExceededFault" -// The encryption key has exceeded its grant limit in AWS KMS. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableSnapshotCopy -func (c *Redshift) EnableSnapshotCopy(input *EnableSnapshotCopyInput) (*EnableSnapshotCopyOutput, error) { - req, out := c.EnableSnapshotCopyRequest(input) - err := req.Send() - return out, err -} - -const opModifyCluster = "ModifyCluster" - -// ModifyClusterRequest generates a "aws/request.Request" representing the -// client's request for the ModifyCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyClusterRequest method. -// req, resp := client.ModifyClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyCluster -func (c *Redshift) ModifyClusterRequest(input *ModifyClusterInput) (req *request.Request, output *ModifyClusterOutput) { - op := &request.Operation{ - Name: opModifyCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyClusterInput{} - } - - output = &ModifyClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyCluster API operation for Amazon Redshift. -// -// Modifies the settings for a cluster. For example, you can add another security -// or parameter group, update the preferred maintenance window, or change the -// master user password. Resetting a cluster password or modifying the security -// groups associated with a cluster do not need a reboot. However, modifying -// a parameter group requires a reboot for parameters to take effect. For more -// information about managing clusters, go to Amazon Redshift Clusters (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management Guide. -// -// You can also change node type and the number of nodes to scale up or down -// the cluster. When resizing a cluster, you must specify both the number of -// nodes and the node type even if one of the parameters does not change. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation ModifyCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeInvalidClusterSecurityGroupStateFault "InvalidClusterSecurityGroupState" -// The state of the cluster security group is not available. -// -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeNumberOfNodesQuotaExceededFault "NumberOfNodesQuotaExceeded" -// The operation would exceed the number of nodes allotted to the account. For -// information about increasing your quota, go to Limits in Amazon Redshift -// (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeClusterSecurityGroupNotFoundFault "ClusterSecurityGroupNotFound" -// The cluster security group name does not refer to an existing cluster security -// group. -// -// * ErrCodeClusterParameterGroupNotFoundFault "ClusterParameterGroupNotFound" -// The parameter group name does not refer to an existing parameter group. -// -// * ErrCodeInsufficientClusterCapacityFault "InsufficientClusterCapacity" -// The number of nodes specified exceeds the allotted capacity of the cluster. -// -// * ErrCodeUnsupportedOptionFault "UnsupportedOptionFault" -// A request option was specified that is not supported. -// -// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" -// Your account is not authorized to perform the requested operation. -// -// * ErrCodeHsmClientCertificateNotFoundFault "HsmClientCertificateNotFoundFault" -// There is no Amazon Redshift HSM client certificate with the specified identifier. -// -// * ErrCodeHsmConfigurationNotFoundFault "HsmConfigurationNotFoundFault" -// There is no Amazon Redshift HSM configuration with the specified identifier. -// -// * ErrCodeClusterAlreadyExistsFault "ClusterAlreadyExists" -// The account already has a cluster with the given identifier. -// -// * ErrCodeLimitExceededFault "LimitExceededFault" -// The encryption key has exceeded its grant limit in AWS KMS. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// * ErrCodeInvalidElasticIpFault "InvalidElasticIpFault" -// The Elastic IP (EIP) is invalid or cannot be found. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyCluster -func (c *Redshift) ModifyCluster(input *ModifyClusterInput) (*ModifyClusterOutput, error) { - req, out := c.ModifyClusterRequest(input) - err := req.Send() - return out, err -} - -const opModifyClusterIamRoles = "ModifyClusterIamRoles" - -// ModifyClusterIamRolesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyClusterIamRoles operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyClusterIamRoles for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyClusterIamRoles method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyClusterIamRolesRequest method. -// req, resp := client.ModifyClusterIamRolesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterIamRoles -func (c *Redshift) ModifyClusterIamRolesRequest(input *ModifyClusterIamRolesInput) (req *request.Request, output *ModifyClusterIamRolesOutput) { - op := &request.Operation{ - Name: opModifyClusterIamRoles, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyClusterIamRolesInput{} - } - - output = &ModifyClusterIamRolesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyClusterIamRoles API operation for Amazon Redshift. -// -// Modifies the list of AWS Identity and Access Management (IAM) roles that -// can be used by the cluster to access other AWS services. -// -// A cluster can have up to 10 IAM roles associated at any 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 Redshift's -// API operation ModifyClusterIamRoles for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterIamRoles -func (c *Redshift) ModifyClusterIamRoles(input *ModifyClusterIamRolesInput) (*ModifyClusterIamRolesOutput, error) { - req, out := c.ModifyClusterIamRolesRequest(input) - err := req.Send() - return out, err -} - -const opModifyClusterParameterGroup = "ModifyClusterParameterGroup" - -// ModifyClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyClusterParameterGroupRequest method. -// req, resp := client.ModifyClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterParameterGroup -func (c *Redshift) ModifyClusterParameterGroupRequest(input *ModifyClusterParameterGroupInput) (req *request.Request, output *ClusterParameterGroupNameMessage) { - op := &request.Operation{ - Name: opModifyClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyClusterParameterGroupInput{} - } - - output = &ClusterParameterGroupNameMessage{} - req = c.newRequest(op, input, output) - return -} - -// ModifyClusterParameterGroup API operation for Amazon Redshift. -// -// Modifies the parameters of a parameter group. -// -// For more information about parameters and parameter groups, go to Amazon -// Redshift Parameter Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation ModifyClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterParameterGroupNotFoundFault "ClusterParameterGroupNotFound" -// The parameter group name does not refer to an existing parameter group. -// -// * ErrCodeInvalidClusterParameterGroupStateFault "InvalidClusterParameterGroupState" -// The cluster parameter group action can not be completed because another task -// is in progress that involves the parameter group. Wait a few moments and -// try the operation again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterParameterGroup -func (c *Redshift) ModifyClusterParameterGroup(input *ModifyClusterParameterGroupInput) (*ClusterParameterGroupNameMessage, error) { - req, out := c.ModifyClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyClusterSubnetGroup = "ModifyClusterSubnetGroup" - -// ModifyClusterSubnetGroupRequest generates a "aws/request.Request" representing the -// client's request for the ModifyClusterSubnetGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyClusterSubnetGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyClusterSubnetGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyClusterSubnetGroupRequest method. -// req, resp := client.ModifyClusterSubnetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterSubnetGroup -func (c *Redshift) ModifyClusterSubnetGroupRequest(input *ModifyClusterSubnetGroupInput) (req *request.Request, output *ModifyClusterSubnetGroupOutput) { - op := &request.Operation{ - Name: opModifyClusterSubnetGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyClusterSubnetGroupInput{} - } - - output = &ModifyClusterSubnetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyClusterSubnetGroup API operation for Amazon Redshift. -// -// Modifies a cluster subnet group to include the specified list of VPC subnets. -// The operation replaces the existing list of subnets with the new list of -// subnets. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation ModifyClusterSubnetGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSubnetGroupNotFoundFault "ClusterSubnetGroupNotFoundFault" -// The cluster subnet group name does not refer to an existing cluster subnet -// group. -// -// * ErrCodeClusterSubnetQuotaExceededFault "ClusterSubnetQuotaExceededFault" -// The request would result in user exceeding the allowed number of subnets -// in a cluster subnet groups. For information about increasing your quota, -// go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeSubnetAlreadyInUse "SubnetAlreadyInUse" -// A specified subnet is already in use by another cluster. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is not valid, or not all of the subnets are in the same -// VPC. -// -// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" -// Your account is not authorized to perform the requested operation. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterSubnetGroup -func (c *Redshift) ModifyClusterSubnetGroup(input *ModifyClusterSubnetGroupInput) (*ModifyClusterSubnetGroupOutput, error) { - req, out := c.ModifyClusterSubnetGroupRequest(input) - err := req.Send() - return out, err -} - -const opModifyEventSubscription = "ModifyEventSubscription" - -// ModifyEventSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the ModifyEventSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyEventSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyEventSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyEventSubscriptionRequest method. -// req, resp := client.ModifyEventSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyEventSubscription -func (c *Redshift) ModifyEventSubscriptionRequest(input *ModifyEventSubscriptionInput) (req *request.Request, output *ModifyEventSubscriptionOutput) { - op := &request.Operation{ - Name: opModifyEventSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyEventSubscriptionInput{} - } - - output = &ModifyEventSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyEventSubscription API operation for Amazon Redshift. -// -// Modifies an existing Amazon Redshift event notification subscription. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation ModifyEventSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionNotFoundFault "SubscriptionNotFound" -// An Amazon Redshift event notification subscription with the specified name -// does not exist. -// -// * ErrCodeSNSInvalidTopicFault "SNSInvalidTopic" -// Amazon SNS has responded that there is a problem with the specified Amazon -// SNS topic. -// -// * ErrCodeSNSNoAuthorizationFault "SNSNoAuthorization" -// You do not have permission to publish to the specified Amazon SNS topic. -// -// * ErrCodeSNSTopicArnNotFoundFault "SNSTopicArnNotFound" -// An Amazon SNS topic with the specified Amazon Resource Name (ARN) does not -// exist. -// -// * ErrCodeSubscriptionEventIdNotFoundFault "SubscriptionEventIdNotFound" -// An Amazon Redshift event with the specified event ID does not exist. -// -// * ErrCodeSubscriptionCategoryNotFoundFault "SubscriptionCategoryNotFound" -// The value specified for the event category was not one of the allowed values, -// or it specified a category that does not apply to the specified source type. -// The allowed values are Configuration, Management, Monitoring, and Security. -// -// * ErrCodeSubscriptionSeverityNotFoundFault "SubscriptionSeverityNotFound" -// The value specified for the event severity was not one of the allowed values, -// or it specified a severity that does not apply to the specified source type. -// The allowed values are ERROR and INFO. -// -// * ErrCodeSourceNotFoundFault "SourceNotFound" -// The specified Amazon Redshift event source could not be found. -// -// * ErrCodeInvalidSubscriptionStateFault "InvalidSubscriptionStateFault" -// The subscription request is invalid because it is a duplicate request. This -// subscription request is already in progress. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyEventSubscription -func (c *Redshift) ModifyEventSubscription(input *ModifyEventSubscriptionInput) (*ModifyEventSubscriptionOutput, error) { - req, out := c.ModifyEventSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opModifySnapshotCopyRetentionPeriod = "ModifySnapshotCopyRetentionPeriod" - -// ModifySnapshotCopyRetentionPeriodRequest generates a "aws/request.Request" representing the -// client's request for the ModifySnapshotCopyRetentionPeriod operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifySnapshotCopyRetentionPeriod for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifySnapshotCopyRetentionPeriod method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifySnapshotCopyRetentionPeriodRequest method. -// req, resp := client.ModifySnapshotCopyRetentionPeriodRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifySnapshotCopyRetentionPeriod -func (c *Redshift) ModifySnapshotCopyRetentionPeriodRequest(input *ModifySnapshotCopyRetentionPeriodInput) (req *request.Request, output *ModifySnapshotCopyRetentionPeriodOutput) { - op := &request.Operation{ - Name: opModifySnapshotCopyRetentionPeriod, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifySnapshotCopyRetentionPeriodInput{} - } - - output = &ModifySnapshotCopyRetentionPeriodOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifySnapshotCopyRetentionPeriod API operation for Amazon Redshift. -// -// Modifies the number of days to retain automated snapshots in the destination -// region after they are copied from the source 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 Redshift's -// API operation ModifySnapshotCopyRetentionPeriod for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeSnapshotCopyDisabledFault "SnapshotCopyDisabledFault" -// Cross-region snapshot copy was temporarily disabled. Try your request again. -// -// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" -// Your account is not authorized to perform the requested operation. -// -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifySnapshotCopyRetentionPeriod -func (c *Redshift) ModifySnapshotCopyRetentionPeriod(input *ModifySnapshotCopyRetentionPeriodInput) (*ModifySnapshotCopyRetentionPeriodOutput, error) { - req, out := c.ModifySnapshotCopyRetentionPeriodRequest(input) - err := req.Send() - return out, err -} - -const opPurchaseReservedNodeOffering = "PurchaseReservedNodeOffering" - -// PurchaseReservedNodeOfferingRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseReservedNodeOffering operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PurchaseReservedNodeOffering for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PurchaseReservedNodeOffering method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PurchaseReservedNodeOfferingRequest method. -// req, resp := client.PurchaseReservedNodeOfferingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/PurchaseReservedNodeOffering -func (c *Redshift) PurchaseReservedNodeOfferingRequest(input *PurchaseReservedNodeOfferingInput) (req *request.Request, output *PurchaseReservedNodeOfferingOutput) { - op := &request.Operation{ - Name: opPurchaseReservedNodeOffering, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseReservedNodeOfferingInput{} - } - - output = &PurchaseReservedNodeOfferingOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseReservedNodeOffering API operation for Amazon Redshift. -// -// Allows you to purchase reserved nodes. Amazon Redshift offers a predefined -// set of reserved node offerings. You can purchase one or more of the offerings. -// You can call the DescribeReservedNodeOfferings API to obtain the available -// reserved node offerings. You can call this API by providing a specific reserved -// node offering and the number of nodes you want to reserve. -// -// For more information about reserved node offerings, go to Purchasing Reserved -// Nodes (http://docs.aws.amazon.com/redshift/latest/mgmt/purchase-reserved-node-instance.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation PurchaseReservedNodeOffering for usage and error information. -// -// Returned Error Codes: -// * ErrCodeReservedNodeOfferingNotFoundFault "ReservedNodeOfferingNotFound" -// Specified offering does not exist. -// -// * ErrCodeReservedNodeAlreadyExistsFault "ReservedNodeAlreadyExists" -// User already has a reservation with the given identifier. -// -// * ErrCodeReservedNodeQuotaExceededFault "ReservedNodeQuotaExceeded" -// Request would exceed the user's compute node quota. For information about -// increasing your quota, go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeUnsupportedOperationFault "UnsupportedOperation" -// The requested operation isn't supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/PurchaseReservedNodeOffering -func (c *Redshift) PurchaseReservedNodeOffering(input *PurchaseReservedNodeOfferingInput) (*PurchaseReservedNodeOfferingOutput, error) { - req, out := c.PurchaseReservedNodeOfferingRequest(input) - err := req.Send() - return out, err -} - -const opRebootCluster = "RebootCluster" - -// RebootClusterRequest generates a "aws/request.Request" representing the -// client's request for the RebootCluster operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RebootCluster for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RebootCluster method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RebootClusterRequest method. -// req, resp := client.RebootClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RebootCluster -func (c *Redshift) RebootClusterRequest(input *RebootClusterInput) (req *request.Request, output *RebootClusterOutput) { - op := &request.Operation{ - Name: opRebootCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RebootClusterInput{} - } - - output = &RebootClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// RebootCluster API operation for Amazon Redshift. -// -// Reboots a cluster. This action is taken as soon as possible. It results in -// a momentary outage to the cluster, during which the cluster status is set -// to rebooting. A cluster event is created when the reboot is completed. Any -// pending cluster modifications (see ModifyCluster) are applied at this reboot. -// For more information about managing clusters, go to Amazon Redshift Clusters -// (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation RebootCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RebootCluster -func (c *Redshift) RebootCluster(input *RebootClusterInput) (*RebootClusterOutput, error) { - req, out := c.RebootClusterRequest(input) - err := req.Send() - return out, err -} - -const opResetClusterParameterGroup = "ResetClusterParameterGroup" - -// ResetClusterParameterGroupRequest generates a "aws/request.Request" representing the -// client's request for the ResetClusterParameterGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetClusterParameterGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetClusterParameterGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetClusterParameterGroupRequest method. -// req, resp := client.ResetClusterParameterGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ResetClusterParameterGroup -func (c *Redshift) ResetClusterParameterGroupRequest(input *ResetClusterParameterGroupInput) (req *request.Request, output *ClusterParameterGroupNameMessage) { - op := &request.Operation{ - Name: opResetClusterParameterGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetClusterParameterGroupInput{} - } - - output = &ClusterParameterGroupNameMessage{} - req = c.newRequest(op, input, output) - return -} - -// ResetClusterParameterGroup API operation for Amazon Redshift. -// -// Sets one or more parameters of the specified parameter group to their default -// values and sets the source values of the parameters to "engine-default". -// To reset the entire parameter group specify the ResetAllParameters parameter. -// For parameter changes to take effect you must reboot any associated clusters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation ResetClusterParameterGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidClusterParameterGroupStateFault "InvalidClusterParameterGroupState" -// The cluster parameter group action can not be completed because another task -// is in progress that involves the parameter group. Wait a few moments and -// try the operation again. -// -// * ErrCodeClusterParameterGroupNotFoundFault "ClusterParameterGroupNotFound" -// The parameter group name does not refer to an existing parameter group. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ResetClusterParameterGroup -func (c *Redshift) ResetClusterParameterGroup(input *ResetClusterParameterGroupInput) (*ClusterParameterGroupNameMessage, error) { - req, out := c.ResetClusterParameterGroupRequest(input) - err := req.Send() - return out, err -} - -const opRestoreFromClusterSnapshot = "RestoreFromClusterSnapshot" - -// RestoreFromClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the RestoreFromClusterSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreFromClusterSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreFromClusterSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreFromClusterSnapshotRequest method. -// req, resp := client.RestoreFromClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreFromClusterSnapshot -func (c *Redshift) RestoreFromClusterSnapshotRequest(input *RestoreFromClusterSnapshotInput) (req *request.Request, output *RestoreFromClusterSnapshotOutput) { - op := &request.Operation{ - Name: opRestoreFromClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreFromClusterSnapshotInput{} - } - - output = &RestoreFromClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreFromClusterSnapshot API operation for Amazon Redshift. -// -// Creates a new cluster from a snapshot. By default, Amazon Redshift creates -// the resulting cluster with the same configuration as the original cluster -// from which the snapshot was created, except that the new cluster is created -// with the default cluster security and parameter groups. After Amazon Redshift -// creates the cluster, you can use the ModifyCluster API to associate a different -// security group and different parameter group with the restored cluster. If -// you are using a DS node type, you can also choose to change to another DS -// node type of the same size during restore. -// -// If you restore a cluster into a VPC, you must provide a cluster subnet group -// where you want the cluster restored. -// -// For more information about working with snapshots, go to Amazon Redshift -// Snapshots (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation RestoreFromClusterSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessToSnapshotDeniedFault "AccessToSnapshotDenied" -// The owner of the specified snapshot has not authorized your account to access -// the snapshot. -// -// * ErrCodeClusterAlreadyExistsFault "ClusterAlreadyExists" -// The account already has a cluster with the given identifier. -// -// * ErrCodeClusterSnapshotNotFoundFault "ClusterSnapshotNotFound" -// The snapshot identifier does not refer to an existing cluster snapshot. -// -// * ErrCodeClusterQuotaExceededFault "ClusterQuotaExceeded" -// The request would exceed the allowed number of cluster instances for this -// account. For information about increasing your quota, go to Limits in Amazon -// Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeInsufficientClusterCapacityFault "InsufficientClusterCapacity" -// The number of nodes specified exceeds the allotted capacity of the cluster. -// -// * ErrCodeInvalidClusterSnapshotStateFault "InvalidClusterSnapshotState" -// The specified cluster snapshot is not in the available state, or other accounts -// are authorized to access the snapshot. -// -// * ErrCodeInvalidRestoreFault "InvalidRestore" -// The restore is invalid. -// -// * ErrCodeNumberOfNodesQuotaExceededFault "NumberOfNodesQuotaExceeded" -// The operation would exceed the number of nodes allotted to the account. For -// information about increasing your quota, go to Limits in Amazon Redshift -// (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) -// in the Amazon Redshift Cluster Management Guide. -// -// * ErrCodeNumberOfNodesPerClusterLimitExceededFault "NumberOfNodesPerClusterLimitExceeded" -// The operation would exceed the number of nodes allowed for a cluster. -// -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The cluster subnet group does not cover all Availability Zones. -// -// * ErrCodeInvalidClusterSubnetGroupStateFault "InvalidClusterSubnetGroupStateFault" -// The cluster subnet group cannot be deleted because it is in use. -// -// * ErrCodeInvalidSubnet "InvalidSubnet" -// The requested subnet is not valid, or not all of the subnets are in the same -// VPC. -// -// * ErrCodeClusterSubnetGroupNotFoundFault "ClusterSubnetGroupNotFoundFault" -// The cluster subnet group name does not refer to an existing cluster subnet -// group. -// -// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" -// Your account is not authorized to perform the requested operation. -// -// * ErrCodeHsmClientCertificateNotFoundFault "HsmClientCertificateNotFoundFault" -// There is no Amazon Redshift HSM client certificate with the specified identifier. -// -// * ErrCodeHsmConfigurationNotFoundFault "HsmConfigurationNotFoundFault" -// There is no Amazon Redshift HSM configuration with the specified identifier. -// -// * ErrCodeInvalidElasticIpFault "InvalidElasticIpFault" -// The Elastic IP (EIP) is invalid or cannot be found. -// -// * ErrCodeClusterParameterGroupNotFoundFault "ClusterParameterGroupNotFound" -// The parameter group name does not refer to an existing parameter group. -// -// * ErrCodeClusterSecurityGroupNotFoundFault "ClusterSecurityGroupNotFound" -// The cluster security group name does not refer to an existing cluster security -// group. -// -// * ErrCodeLimitExceededFault "LimitExceededFault" -// The encryption key has exceeded its grant limit in AWS KMS. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreFromClusterSnapshot -func (c *Redshift) RestoreFromClusterSnapshot(input *RestoreFromClusterSnapshotInput) (*RestoreFromClusterSnapshotOutput, error) { - req, out := c.RestoreFromClusterSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opRestoreTableFromClusterSnapshot = "RestoreTableFromClusterSnapshot" - -// RestoreTableFromClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the RestoreTableFromClusterSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreTableFromClusterSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreTableFromClusterSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreTableFromClusterSnapshotRequest method. -// req, resp := client.RestoreTableFromClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreTableFromClusterSnapshot -func (c *Redshift) RestoreTableFromClusterSnapshotRequest(input *RestoreTableFromClusterSnapshotInput) (req *request.Request, output *RestoreTableFromClusterSnapshotOutput) { - op := &request.Operation{ - Name: opRestoreTableFromClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreTableFromClusterSnapshotInput{} - } - - output = &RestoreTableFromClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreTableFromClusterSnapshot API operation for Amazon Redshift. -// -// Creates a new table from a table in an Amazon Redshift cluster snapshot. -// You must create the new table within the Amazon Redshift cluster that the -// snapshot was taken from. -// -// You cannot use RestoreTableFromClusterSnapshot to restore a table with the -// same name as an existing table in an Amazon Redshift cluster. That is, you -// cannot overwrite an existing table in a cluster with a restored table. If -// you want to replace your original table with a new, restored table, then -// rename or drop your original table before you call RestoreTableFromClusterSnapshot. -// When you have renamed your original table, then you can pass the original -// name of the table as the NewTableName parameter value in the call to RestoreTableFromClusterSnapshot. -// This way, you can replace the original table with the table created from -// the 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 Redshift's -// API operation RestoreTableFromClusterSnapshot for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSnapshotNotFoundFault "ClusterSnapshotNotFound" -// The snapshot identifier does not refer to an existing cluster snapshot. -// -// * ErrCodeInProgressTableRestoreQuotaExceededFault "InProgressTableRestoreQuotaExceededFault" -// You have exceeded the allowed number of table restore requests. Wait for -// your current table restore requests to complete before making a new request. -// -// * ErrCodeInvalidClusterSnapshotStateFault "InvalidClusterSnapshotState" -// The specified cluster snapshot is not in the available state, or other accounts -// are authorized to access the snapshot. -// -// * ErrCodeInvalidTableRestoreArgumentFault "InvalidTableRestoreArgument" -// The value specified for the sourceDatabaseName, sourceSchemaName, or sourceTableName -// parameter, or a combination of these, doesn't exist in the snapshot. -// -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeUnsupportedOperationFault "UnsupportedOperation" -// The requested operation isn't supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreTableFromClusterSnapshot -func (c *Redshift) RestoreTableFromClusterSnapshot(input *RestoreTableFromClusterSnapshotInput) (*RestoreTableFromClusterSnapshotOutput, error) { - req, out := c.RestoreTableFromClusterSnapshotRequest(input) - err := req.Send() - return out, err -} - -const opRevokeClusterSecurityGroupIngress = "RevokeClusterSecurityGroupIngress" - -// RevokeClusterSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeClusterSecurityGroupIngress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RevokeClusterSecurityGroupIngress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RevokeClusterSecurityGroupIngress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RevokeClusterSecurityGroupIngressRequest method. -// req, resp := client.RevokeClusterSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeClusterSecurityGroupIngress -func (c *Redshift) RevokeClusterSecurityGroupIngressRequest(input *RevokeClusterSecurityGroupIngressInput) (req *request.Request, output *RevokeClusterSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opRevokeClusterSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeClusterSecurityGroupIngressInput{} - } - - output = &RevokeClusterSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - return -} - -// RevokeClusterSecurityGroupIngress API operation for Amazon Redshift. -// -// Revokes an ingress rule in an Amazon Redshift security group for a previously -// authorized IP range or Amazon EC2 security group. To add an ingress rule, -// see AuthorizeClusterSecurityGroupIngress. For information about managing -// security groups, go to Amazon Redshift Cluster Security Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation RevokeClusterSecurityGroupIngress for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterSecurityGroupNotFoundFault "ClusterSecurityGroupNotFound" -// The cluster security group name does not refer to an existing cluster security -// group. -// -// * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDR IP range or EC2 security group is not authorized for the -// specified cluster security group. -// -// * ErrCodeInvalidClusterSecurityGroupStateFault "InvalidClusterSecurityGroupState" -// The state of the cluster security group is not available. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeClusterSecurityGroupIngress -func (c *Redshift) RevokeClusterSecurityGroupIngress(input *RevokeClusterSecurityGroupIngressInput) (*RevokeClusterSecurityGroupIngressOutput, error) { - req, out := c.RevokeClusterSecurityGroupIngressRequest(input) - err := req.Send() - return out, err -} - -const opRevokeSnapshotAccess = "RevokeSnapshotAccess" - -// RevokeSnapshotAccessRequest generates a "aws/request.Request" representing the -// client's request for the RevokeSnapshotAccess operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RevokeSnapshotAccess for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RevokeSnapshotAccess method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RevokeSnapshotAccessRequest method. -// req, resp := client.RevokeSnapshotAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeSnapshotAccess -func (c *Redshift) RevokeSnapshotAccessRequest(input *RevokeSnapshotAccessInput) (req *request.Request, output *RevokeSnapshotAccessOutput) { - op := &request.Operation{ - Name: opRevokeSnapshotAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeSnapshotAccessInput{} - } - - output = &RevokeSnapshotAccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// RevokeSnapshotAccess API operation for Amazon Redshift. -// -// Removes the ability of the specified AWS customer account to restore the -// specified snapshot. If the account is currently restoring the snapshot, the -// restore will run to completion. -// -// For more information about working with snapshots, go to Amazon Redshift -// Snapshots (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html) -// in the Amazon Redshift Cluster Management 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 Redshift's -// API operation RevokeSnapshotAccess for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessToSnapshotDeniedFault "AccessToSnapshotDenied" -// The owner of the specified snapshot has not authorized your account to access -// the snapshot. -// -// * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDR IP range or EC2 security group is not authorized for the -// specified cluster security group. -// -// * ErrCodeClusterSnapshotNotFoundFault "ClusterSnapshotNotFound" -// The snapshot identifier does not refer to an existing cluster snapshot. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeSnapshotAccess -func (c *Redshift) RevokeSnapshotAccess(input *RevokeSnapshotAccessInput) (*RevokeSnapshotAccessOutput, error) { - req, out := c.RevokeSnapshotAccessRequest(input) - err := req.Send() - return out, err -} - -const opRotateEncryptionKey = "RotateEncryptionKey" - -// RotateEncryptionKeyRequest generates a "aws/request.Request" representing the -// client's request for the RotateEncryptionKey operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RotateEncryptionKey for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RotateEncryptionKey method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RotateEncryptionKeyRequest method. -// req, resp := client.RotateEncryptionKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RotateEncryptionKey -func (c *Redshift) RotateEncryptionKeyRequest(input *RotateEncryptionKeyInput) (req *request.Request, output *RotateEncryptionKeyOutput) { - op := &request.Operation{ - Name: opRotateEncryptionKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RotateEncryptionKeyInput{} - } - - output = &RotateEncryptionKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// RotateEncryptionKey API operation for Amazon Redshift. -// -// Rotates the encryption keys for a cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Redshift's -// API operation RotateEncryptionKey for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFound" -// The ClusterIdentifier parameter does not refer to an existing cluster. -// -// * ErrCodeInvalidClusterStateFault "InvalidClusterState" -// The specified cluster is not in the available state. -// -// * ErrCodeDependentServiceRequestThrottlingFault "DependentServiceRequestThrottlingFault" -// The request cannot be completed because a dependent service is throttling -// requests made by Amazon Redshift on your behalf. Wait and retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RotateEncryptionKey -func (c *Redshift) RotateEncryptionKey(input *RotateEncryptionKeyInput) (*RotateEncryptionKeyOutput, error) { - req, out := c.RotateEncryptionKeyRequest(input) - err := req.Send() - return out, err -} - -// Describes an AWS customer account authorized to restore a snapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AccountWithRestoreAccess -type AccountWithRestoreAccess struct { - _ struct{} `type:"structure"` - - // The identifier of an AWS customer account authorized to restore a snapshot. - AccountId *string `type:"string"` -} - -// String returns the string representation -func (s AccountWithRestoreAccess) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountWithRestoreAccess) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *AccountWithRestoreAccess) SetAccountId(v string) *AccountWithRestoreAccess { - s.AccountId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeClusterSecurityGroupIngressMessage -type AuthorizeClusterSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The IP range to be added the Amazon Redshift security group. - CIDRIP *string `type:"string"` - - // The name of the security group to which the ingress rule is added. - // - // ClusterSecurityGroupName is a required field - ClusterSecurityGroupName *string `type:"string" required:"true"` - - // The EC2 security group to be added the Amazon Redshift security group. - EC2SecurityGroupName *string `type:"string"` - - // The AWS account number of the owner of the security group specified by the - // EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable - // value. - // - // Example: 111122223333 - EC2SecurityGroupOwnerId *string `type:"string"` -} - -// String returns the string representation -func (s AuthorizeClusterSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeClusterSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuthorizeClusterSecurityGroupIngressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthorizeClusterSecurityGroupIngressInput"} - if s.ClusterSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterSecurityGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCIDRIP sets the CIDRIP field's value. -func (s *AuthorizeClusterSecurityGroupIngressInput) SetCIDRIP(v string) *AuthorizeClusterSecurityGroupIngressInput { - s.CIDRIP = &v - return s -} - -// SetClusterSecurityGroupName sets the ClusterSecurityGroupName field's value. -func (s *AuthorizeClusterSecurityGroupIngressInput) SetClusterSecurityGroupName(v string) *AuthorizeClusterSecurityGroupIngressInput { - s.ClusterSecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *AuthorizeClusterSecurityGroupIngressInput) SetEC2SecurityGroupName(v string) *AuthorizeClusterSecurityGroupIngressInput { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *AuthorizeClusterSecurityGroupIngressInput) SetEC2SecurityGroupOwnerId(v string) *AuthorizeClusterSecurityGroupIngressInput { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeClusterSecurityGroupIngressResult -type AuthorizeClusterSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` - - // Describes a security group. - ClusterSecurityGroup *ClusterSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s AuthorizeClusterSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeClusterSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// SetClusterSecurityGroup sets the ClusterSecurityGroup field's value. -func (s *AuthorizeClusterSecurityGroupIngressOutput) SetClusterSecurityGroup(v *ClusterSecurityGroup) *AuthorizeClusterSecurityGroupIngressOutput { - s.ClusterSecurityGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeSnapshotAccessMessage -type AuthorizeSnapshotAccessInput struct { - _ struct{} `type:"structure"` - - // The identifier of the AWS customer account authorized to restore the specified - // snapshot. - // - // AccountWithRestoreAccess is a required field - AccountWithRestoreAccess *string `type:"string" required:"true"` - - // The identifier of the cluster the snapshot was created from. This parameter - // is required if your IAM user has a policy containing a snapshot resource - // element that specifies anything other than * for the cluster name. - SnapshotClusterIdentifier *string `type:"string"` - - // The identifier of the snapshot the account is authorized to restore. - // - // SnapshotIdentifier is a required field - SnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AuthorizeSnapshotAccessInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSnapshotAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuthorizeSnapshotAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthorizeSnapshotAccessInput"} - if s.AccountWithRestoreAccess == nil { - invalidParams.Add(request.NewErrParamRequired("AccountWithRestoreAccess")) - } - if s.SnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountWithRestoreAccess sets the AccountWithRestoreAccess field's value. -func (s *AuthorizeSnapshotAccessInput) SetAccountWithRestoreAccess(v string) *AuthorizeSnapshotAccessInput { - s.AccountWithRestoreAccess = &v - return s -} - -// SetSnapshotClusterIdentifier sets the SnapshotClusterIdentifier field's value. -func (s *AuthorizeSnapshotAccessInput) SetSnapshotClusterIdentifier(v string) *AuthorizeSnapshotAccessInput { - s.SnapshotClusterIdentifier = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *AuthorizeSnapshotAccessInput) SetSnapshotIdentifier(v string) *AuthorizeSnapshotAccessInput { - s.SnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AuthorizeSnapshotAccessResult -type AuthorizeSnapshotAccessOutput struct { - _ struct{} `type:"structure"` - - // Describes a snapshot. - Snapshot *Snapshot `type:"structure"` -} - -// String returns the string representation -func (s AuthorizeSnapshotAccessOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSnapshotAccessOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *AuthorizeSnapshotAccessOutput) SetSnapshot(v *Snapshot) *AuthorizeSnapshotAccessOutput { - s.Snapshot = v - return s -} - -// Describes an availability zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/AvailabilityZone -type AvailabilityZone struct { - _ struct{} `type:"structure"` - - // The name of the availability zone. - Name *string `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() -} - -// SetName sets the Name field's value. -func (s *AvailabilityZone) SetName(v string) *AvailabilityZone { - s.Name = &v - return s -} - -// Describes a cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/Cluster -type Cluster struct { - _ struct{} `type:"structure"` - - // A Boolean value that, if true, indicates that major version upgrades will - // be applied automatically to the cluster during the maintenance window. - AllowVersionUpgrade *bool `type:"boolean"` - - // The number of days that automatic cluster snapshots are retained. - AutomatedSnapshotRetentionPeriod *int64 `type:"integer"` - - // The name of the Availability Zone in which the cluster is located. - AvailabilityZone *string `type:"string"` - - // The date and time that the cluster was created. - ClusterCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The unique identifier of the cluster. - ClusterIdentifier *string `type:"string"` - - // The nodes in the cluster. - ClusterNodes []*ClusterNode `type:"list"` - - // The list of cluster parameter groups that are associated with this cluster. - // Each parameter group in the list is returned with its status. - ClusterParameterGroups []*ClusterParameterGroupStatus `locationNameList:"ClusterParameterGroup" type:"list"` - - // The public key for the cluster. - ClusterPublicKey *string `type:"string"` - - // The specific revision number of the database in the cluster. - ClusterRevisionNumber *string `type:"string"` - - // A list of cluster security group that are associated with the cluster. Each - // security group is represented by an element that contains ClusterSecurityGroup.Name - // and ClusterSecurityGroup.Status subelements. - // - // Cluster security groups are used when the cluster is not created in an Amazon - // Virtual Private Cloud (VPC). Clusters that are created in a VPC use VPC security - // groups, which are listed by the VpcSecurityGroups parameter. - ClusterSecurityGroups []*ClusterSecurityGroupMembership `locationNameList:"ClusterSecurityGroup" type:"list"` - - // A value that returns the destination region and retention period that are - // configured for cross-region snapshot copy. - ClusterSnapshotCopyStatus *ClusterSnapshotCopyStatus `type:"structure"` - - // The current state of the cluster. Possible values are the following: - // - // * available - // - // * creating - // - // * deleting - // - // * final-snapshot - // - // * hardware-failure - // - // * incompatible-hsm - // - // * incompatible-network - // - // * incompatible-parameters - // - // * incompatible-restore - // - // * modifying - // - // * rebooting - // - // * renaming - // - // * resizing - // - // * rotating-keys - // - // * storage-full - // - // * updating-hsm - ClusterStatus *string `type:"string"` - - // The name of the subnet group that is associated with the cluster. This parameter - // is valid only when the cluster is in a VPC. - ClusterSubnetGroupName *string `type:"string"` - - // The version ID of the Amazon Redshift engine that is running on the cluster. - ClusterVersion *string `type:"string"` - - // The name of the initial database that was created when the cluster was created. - // This same name is returned for the life of the cluster. If an initial database - // was not specified, a database named devdev was created by default. - DBName *string `type:"string"` - - // The status of the elastic IP (EIP) address. - ElasticIpStatus *ElasticIpStatus `type:"structure"` - - // A Boolean value that, if true, indicates that data in the cluster is encrypted - // at rest. - Encrypted *bool `type:"boolean"` - - // The connection endpoint. - Endpoint *Endpoint `type:"structure"` - - // An option that specifies whether to create the cluster with enhanced VPC - // routing enabled. To create a cluster that uses enhanced VPC routing, the - // cluster must be in a VPC. For more information, see Enhanced VPC Routing - // (http://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html) - // in the Amazon Redshift Cluster Management Guide. - // - // If this option is true, enhanced VPC routing is enabled. - // - // Default: false - EnhancedVpcRouting *bool `type:"boolean"` - - // A value that reports whether the Amazon Redshift cluster has finished applying - // any hardware security module (HSM) settings changes specified in a modify - // cluster command. - // - // Values: active, applying - HsmStatus *HsmStatus `type:"structure"` - - // A list of AWS Identity and Access Management (IAM) roles that can be used - // by the cluster to access other AWS services. - IamRoles []*ClusterIamRole `locationNameList:"ClusterIamRole" type:"list"` - - // The AWS Key Management Service (AWS KMS) key ID of the encryption key used - // to encrypt data in the cluster. - KmsKeyId *string `type:"string"` - - // The master user name for the cluster. This name is used to connect to the - // database that is specified in the DBName parameter. - MasterUsername *string `type:"string"` - - // The status of a modify operation, if any, initiated for the cluster. - ModifyStatus *string `type:"string"` - - // The node type for the nodes in the cluster. - NodeType *string `type:"string"` - - // The number of compute nodes in the cluster. - NumberOfNodes *int64 `type:"integer"` - - // A value that, if present, indicates that changes to the cluster are pending. - // Specific pending changes are identified by subelements. - PendingModifiedValues *PendingModifiedValues `type:"structure"` - - // The weekly time range, in Universal Coordinated Time (UTC), during which - // system maintenance can occur. - PreferredMaintenanceWindow *string `type:"string"` - - // A Boolean value that, if true, indicates that the cluster can be accessed - // from a public network. - PubliclyAccessible *bool `type:"boolean"` - - // A value that describes the status of a cluster restore action. This parameter - // returns null if the cluster was not created by restoring a snapshot. - RestoreStatus *RestoreStatus `type:"structure"` - - // The list of tags for the cluster. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The identifier of the VPC the cluster is in, if the cluster is in a VPC. - VpcId *string `type:"string"` - - // A list of Amazon Virtual Private Cloud (Amazon VPC) security groups that - // are associated with the cluster. This parameter is returned only if the cluster - // is in a VPC. - VpcSecurityGroups []*VpcSecurityGroupMembership `locationNameList:"VpcSecurityGroup" type:"list"` -} - -// String returns the string representation -func (s Cluster) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Cluster) GoString() string { - return s.String() -} - -// SetAllowVersionUpgrade sets the AllowVersionUpgrade field's value. -func (s *Cluster) SetAllowVersionUpgrade(v bool) *Cluster { - s.AllowVersionUpgrade = &v - return s -} - -// SetAutomatedSnapshotRetentionPeriod sets the AutomatedSnapshotRetentionPeriod field's value. -func (s *Cluster) SetAutomatedSnapshotRetentionPeriod(v int64) *Cluster { - s.AutomatedSnapshotRetentionPeriod = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Cluster) SetAvailabilityZone(v string) *Cluster { - s.AvailabilityZone = &v - return s -} - -// SetClusterCreateTime sets the ClusterCreateTime field's value. -func (s *Cluster) SetClusterCreateTime(v time.Time) *Cluster { - s.ClusterCreateTime = &v - return s -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *Cluster) SetClusterIdentifier(v string) *Cluster { - s.ClusterIdentifier = &v - return s -} - -// SetClusterNodes sets the ClusterNodes field's value. -func (s *Cluster) SetClusterNodes(v []*ClusterNode) *Cluster { - s.ClusterNodes = v - return s -} - -// SetClusterParameterGroups sets the ClusterParameterGroups field's value. -func (s *Cluster) SetClusterParameterGroups(v []*ClusterParameterGroupStatus) *Cluster { - s.ClusterParameterGroups = v - return s -} - -// SetClusterPublicKey sets the ClusterPublicKey field's value. -func (s *Cluster) SetClusterPublicKey(v string) *Cluster { - s.ClusterPublicKey = &v - return s -} - -// SetClusterRevisionNumber sets the ClusterRevisionNumber field's value. -func (s *Cluster) SetClusterRevisionNumber(v string) *Cluster { - s.ClusterRevisionNumber = &v - return s -} - -// SetClusterSecurityGroups sets the ClusterSecurityGroups field's value. -func (s *Cluster) SetClusterSecurityGroups(v []*ClusterSecurityGroupMembership) *Cluster { - s.ClusterSecurityGroups = v - return s -} - -// SetClusterSnapshotCopyStatus sets the ClusterSnapshotCopyStatus field's value. -func (s *Cluster) SetClusterSnapshotCopyStatus(v *ClusterSnapshotCopyStatus) *Cluster { - s.ClusterSnapshotCopyStatus = v - return s -} - -// SetClusterStatus sets the ClusterStatus field's value. -func (s *Cluster) SetClusterStatus(v string) *Cluster { - s.ClusterStatus = &v - return s -} - -// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. -func (s *Cluster) SetClusterSubnetGroupName(v string) *Cluster { - s.ClusterSubnetGroupName = &v - return s -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *Cluster) SetClusterVersion(v string) *Cluster { - s.ClusterVersion = &v - return s -} - -// SetDBName sets the DBName field's value. -func (s *Cluster) SetDBName(v string) *Cluster { - s.DBName = &v - return s -} - -// SetElasticIpStatus sets the ElasticIpStatus field's value. -func (s *Cluster) SetElasticIpStatus(v *ElasticIpStatus) *Cluster { - s.ElasticIpStatus = v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *Cluster) SetEncrypted(v bool) *Cluster { - s.Encrypted = &v - return s -} - -// SetEndpoint sets the Endpoint field's value. -func (s *Cluster) SetEndpoint(v *Endpoint) *Cluster { - s.Endpoint = v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *Cluster) SetEnhancedVpcRouting(v bool) *Cluster { - s.EnhancedVpcRouting = &v - return s -} - -// SetHsmStatus sets the HsmStatus field's value. -func (s *Cluster) SetHsmStatus(v *HsmStatus) *Cluster { - s.HsmStatus = v - return s -} - -// SetIamRoles sets the IamRoles field's value. -func (s *Cluster) SetIamRoles(v []*ClusterIamRole) *Cluster { - s.IamRoles = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Cluster) SetKmsKeyId(v string) *Cluster { - s.KmsKeyId = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *Cluster) SetMasterUsername(v string) *Cluster { - s.MasterUsername = &v - return s -} - -// SetModifyStatus sets the ModifyStatus field's value. -func (s *Cluster) SetModifyStatus(v string) *Cluster { - s.ModifyStatus = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *Cluster) SetNodeType(v string) *Cluster { - s.NodeType = &v - return s -} - -// SetNumberOfNodes sets the NumberOfNodes field's value. -func (s *Cluster) SetNumberOfNodes(v int64) *Cluster { - s.NumberOfNodes = &v - return s -} - -// SetPendingModifiedValues sets the PendingModifiedValues field's value. -func (s *Cluster) SetPendingModifiedValues(v *PendingModifiedValues) *Cluster { - s.PendingModifiedValues = v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *Cluster) SetPreferredMaintenanceWindow(v string) *Cluster { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *Cluster) SetPubliclyAccessible(v bool) *Cluster { - s.PubliclyAccessible = &v - return s -} - -// SetRestoreStatus sets the RestoreStatus field's value. -func (s *Cluster) SetRestoreStatus(v *RestoreStatus) *Cluster { - s.RestoreStatus = v - return s -} - -// SetTags sets the Tags field's value. -func (s *Cluster) SetTags(v []*Tag) *Cluster { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Cluster) SetVpcId(v string) *Cluster { - s.VpcId = &v - return s -} - -// SetVpcSecurityGroups sets the VpcSecurityGroups field's value. -func (s *Cluster) SetVpcSecurityGroups(v []*VpcSecurityGroupMembership) *Cluster { - s.VpcSecurityGroups = v - return s -} - -// An AWS Identity and Access Management (IAM) role that can be used by the -// associated Amazon Redshift cluster to access other AWS services. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterIamRole -type ClusterIamRole struct { - _ struct{} `type:"structure"` - - // A value that describes the status of the IAM role's association with an Amazon - // Redshift cluster. - // - // The following are possible statuses and descriptions. - // - // * in-sync: The role is available for use by the cluster. - // - // * adding: The role is in the process of being associated with the cluster. - // - // * removing: The role is in the process of being disassociated with the - // cluster. - ApplyStatus *string `type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role, for example, arn:aws:iam::123456789012:role/RedshiftCopyUnload. - IamRoleArn *string `type:"string"` -} - -// String returns the string representation -func (s ClusterIamRole) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterIamRole) GoString() string { - return s.String() -} - -// SetApplyStatus sets the ApplyStatus field's value. -func (s *ClusterIamRole) SetApplyStatus(v string) *ClusterIamRole { - s.ApplyStatus = &v - return s -} - -// SetIamRoleArn sets the IamRoleArn field's value. -func (s *ClusterIamRole) SetIamRoleArn(v string) *ClusterIamRole { - s.IamRoleArn = &v - return s -} - -// The identifier of a node in a cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterNode -type ClusterNode struct { - _ struct{} `type:"structure"` - - // Whether the node is a leader node or a compute node. - NodeRole *string `type:"string"` - - // The private IP address of a node within a cluster. - PrivateIPAddress *string `type:"string"` - - // The public IP address of a node within a cluster. - PublicIPAddress *string `type:"string"` -} - -// String returns the string representation -func (s ClusterNode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterNode) GoString() string { - return s.String() -} - -// SetNodeRole sets the NodeRole field's value. -func (s *ClusterNode) SetNodeRole(v string) *ClusterNode { - s.NodeRole = &v - return s -} - -// SetPrivateIPAddress sets the PrivateIPAddress field's value. -func (s *ClusterNode) SetPrivateIPAddress(v string) *ClusterNode { - s.PrivateIPAddress = &v - return s -} - -// SetPublicIPAddress sets the PublicIPAddress field's value. -func (s *ClusterNode) SetPublicIPAddress(v string) *ClusterNode { - s.PublicIPAddress = &v - return s -} - -// Describes a parameter group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterParameterGroup -type ClusterParameterGroup struct { - _ struct{} `type:"structure"` - - // The description of the parameter group. - Description *string `type:"string"` - - // The name of the cluster parameter group family that this cluster parameter - // group is compatible with. - ParameterGroupFamily *string `type:"string"` - - // The name of the cluster parameter group. - ParameterGroupName *string `type:"string"` - - // The list of tags for the cluster parameter group. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s ClusterParameterGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterParameterGroup) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ClusterParameterGroup) SetDescription(v string) *ClusterParameterGroup { - s.Description = &v - return s -} - -// SetParameterGroupFamily sets the ParameterGroupFamily field's value. -func (s *ClusterParameterGroup) SetParameterGroupFamily(v string) *ClusterParameterGroup { - s.ParameterGroupFamily = &v - return s -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *ClusterParameterGroup) SetParameterGroupName(v string) *ClusterParameterGroup { - s.ParameterGroupName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ClusterParameterGroup) SetTags(v []*Tag) *ClusterParameterGroup { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterParameterGroupNameMessage -type ClusterParameterGroupNameMessage struct { - _ struct{} `type:"structure"` - - // The name of the cluster parameter group. - ParameterGroupName *string `type:"string"` - - // The status of the parameter group. For example, if you made a change to a - // parameter group name-value pair, then the change could be pending a reboot - // of an associated cluster. - ParameterGroupStatus *string `type:"string"` -} - -// String returns the string representation -func (s ClusterParameterGroupNameMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterParameterGroupNameMessage) GoString() string { - return s.String() -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *ClusterParameterGroupNameMessage) SetParameterGroupName(v string) *ClusterParameterGroupNameMessage { - s.ParameterGroupName = &v - return s -} - -// SetParameterGroupStatus sets the ParameterGroupStatus field's value. -func (s *ClusterParameterGroupNameMessage) SetParameterGroupStatus(v string) *ClusterParameterGroupNameMessage { - s.ParameterGroupStatus = &v - return s -} - -// Describes the status of a parameter group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterParameterGroupStatus -type ClusterParameterGroupStatus struct { - _ struct{} `type:"structure"` - - // The list of parameter statuses. - // - // For more information about parameters and parameter groups, go to Amazon - // Redshift Parameter Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) - // in the Amazon Redshift Cluster Management Guide. - ClusterParameterStatusList []*ClusterParameterStatus `type:"list"` - - // The status of parameter updates. - ParameterApplyStatus *string `type:"string"` - - // The name of the cluster parameter group. - ParameterGroupName *string `type:"string"` -} - -// String returns the string representation -func (s ClusterParameterGroupStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterParameterGroupStatus) GoString() string { - return s.String() -} - -// SetClusterParameterStatusList sets the ClusterParameterStatusList field's value. -func (s *ClusterParameterGroupStatus) SetClusterParameterStatusList(v []*ClusterParameterStatus) *ClusterParameterGroupStatus { - s.ClusterParameterStatusList = v - return s -} - -// SetParameterApplyStatus sets the ParameterApplyStatus field's value. -func (s *ClusterParameterGroupStatus) SetParameterApplyStatus(v string) *ClusterParameterGroupStatus { - s.ParameterApplyStatus = &v - return s -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *ClusterParameterGroupStatus) SetParameterGroupName(v string) *ClusterParameterGroupStatus { - s.ParameterGroupName = &v - return s -} - -// Describes the status of a parameter group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterParameterStatus -type ClusterParameterStatus struct { - _ struct{} `type:"structure"` - - // The error that prevented the parameter from being applied to the database. - ParameterApplyErrorDescription *string `type:"string"` - - // The status of the parameter that indicates whether the parameter is in sync - // with the database, waiting for a cluster reboot, or encountered an error - // when being applied. - // - // The following are possible statuses and descriptions. - // - // * in-sync: The parameter value is in sync with the database. - // - // * pending-reboot: The parameter value will be applied after the cluster - // reboots. - // - // * applying: The parameter value is being applied to the database. - // - // * invalid-parameter: Cannot apply the parameter value because it has an - // invalid value or syntax. - // - // * apply-deferred: The parameter contains static property changes. The - // changes are deferred until the cluster reboots. - // - // * apply-error: Cannot connect to the cluster. The parameter change will - // be applied after the cluster reboots. - // - // * unknown-error: Cannot apply the parameter change right now. The change - // will be applied after the cluster reboots. - ParameterApplyStatus *string `type:"string"` - - // The name of the parameter. - ParameterName *string `type:"string"` -} - -// String returns the string representation -func (s ClusterParameterStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterParameterStatus) GoString() string { - return s.String() -} - -// SetParameterApplyErrorDescription sets the ParameterApplyErrorDescription field's value. -func (s *ClusterParameterStatus) SetParameterApplyErrorDescription(v string) *ClusterParameterStatus { - s.ParameterApplyErrorDescription = &v - return s -} - -// SetParameterApplyStatus sets the ParameterApplyStatus field's value. -func (s *ClusterParameterStatus) SetParameterApplyStatus(v string) *ClusterParameterStatus { - s.ParameterApplyStatus = &v - return s -} - -// SetParameterName sets the ParameterName field's value. -func (s *ClusterParameterStatus) SetParameterName(v string) *ClusterParameterStatus { - s.ParameterName = &v - return s -} - -// Describes a security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterSecurityGroup -type ClusterSecurityGroup struct { - _ struct{} `type:"structure"` - - // The name of the cluster security group to which the operation was applied. - ClusterSecurityGroupName *string `type:"string"` - - // A description of the security group. - Description *string `type:"string"` - - // A list of EC2 security groups that are permitted to access clusters associated - // with this cluster security group. - EC2SecurityGroups []*EC2SecurityGroup `locationNameList:"EC2SecurityGroup" type:"list"` - - // A list of IP ranges (CIDR blocks) that are permitted to access clusters associated - // with this cluster security group. - IPRanges []*IPRange `locationNameList:"IPRange" type:"list"` - - // The list of tags for the cluster security group. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s ClusterSecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterSecurityGroup) GoString() string { - return s.String() -} - -// SetClusterSecurityGroupName sets the ClusterSecurityGroupName field's value. -func (s *ClusterSecurityGroup) SetClusterSecurityGroupName(v string) *ClusterSecurityGroup { - s.ClusterSecurityGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ClusterSecurityGroup) SetDescription(v string) *ClusterSecurityGroup { - s.Description = &v - return s -} - -// SetEC2SecurityGroups sets the EC2SecurityGroups field's value. -func (s *ClusterSecurityGroup) SetEC2SecurityGroups(v []*EC2SecurityGroup) *ClusterSecurityGroup { - s.EC2SecurityGroups = v - return s -} - -// SetIPRanges sets the IPRanges field's value. -func (s *ClusterSecurityGroup) SetIPRanges(v []*IPRange) *ClusterSecurityGroup { - s.IPRanges = v - return s -} - -// SetTags sets the Tags field's value. -func (s *ClusterSecurityGroup) SetTags(v []*Tag) *ClusterSecurityGroup { - s.Tags = v - return s -} - -// Describes a cluster security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterSecurityGroupMembership -type ClusterSecurityGroupMembership struct { - _ struct{} `type:"structure"` - - // The name of the cluster security group. - ClusterSecurityGroupName *string `type:"string"` - - // The status of the cluster security group. - Status *string `type:"string"` -} - -// String returns the string representation -func (s ClusterSecurityGroupMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterSecurityGroupMembership) GoString() string { - return s.String() -} - -// SetClusterSecurityGroupName sets the ClusterSecurityGroupName field's value. -func (s *ClusterSecurityGroupMembership) SetClusterSecurityGroupName(v string) *ClusterSecurityGroupMembership { - s.ClusterSecurityGroupName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ClusterSecurityGroupMembership) SetStatus(v string) *ClusterSecurityGroupMembership { - s.Status = &v - return s -} - -// Returns the destination region and retention period that are configured for -// cross-region snapshot copy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterSnapshotCopyStatus -type ClusterSnapshotCopyStatus struct { - _ struct{} `type:"structure"` - - // The destination region that snapshots are automatically copied to when cross-region - // snapshot copy is enabled. - DestinationRegion *string `type:"string"` - - // The number of days that automated snapshots are retained in the destination - // region after they are copied from a source region. - RetentionPeriod *int64 `type:"long"` - - // The name of the snapshot copy grant. - SnapshotCopyGrantName *string `type:"string"` -} - -// String returns the string representation -func (s ClusterSnapshotCopyStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterSnapshotCopyStatus) GoString() string { - return s.String() -} - -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *ClusterSnapshotCopyStatus) SetDestinationRegion(v string) *ClusterSnapshotCopyStatus { - s.DestinationRegion = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *ClusterSnapshotCopyStatus) SetRetentionPeriod(v int64) *ClusterSnapshotCopyStatus { - s.RetentionPeriod = &v - return s -} - -// SetSnapshotCopyGrantName sets the SnapshotCopyGrantName field's value. -func (s *ClusterSnapshotCopyStatus) SetSnapshotCopyGrantName(v string) *ClusterSnapshotCopyStatus { - s.SnapshotCopyGrantName = &v - return s -} - -// Describes a subnet group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterSubnetGroup -type ClusterSubnetGroup struct { - _ struct{} `type:"structure"` - - // The name of the cluster subnet group. - ClusterSubnetGroupName *string `type:"string"` - - // The description of the cluster subnet group. - Description *string `type:"string"` - - // The status of the cluster subnet group. Possible values are Complete, Incomplete - // and Invalid. - SubnetGroupStatus *string `type:"string"` - - // A list of the VPC Subnet elements. - Subnets []*Subnet `locationNameList:"Subnet" type:"list"` - - // The list of tags for the cluster subnet group. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The VPC ID of the cluster subnet group. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s ClusterSubnetGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterSubnetGroup) GoString() string { - return s.String() -} - -// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. -func (s *ClusterSubnetGroup) SetClusterSubnetGroupName(v string) *ClusterSubnetGroup { - s.ClusterSubnetGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ClusterSubnetGroup) SetDescription(v string) *ClusterSubnetGroup { - s.Description = &v - return s -} - -// SetSubnetGroupStatus sets the SubnetGroupStatus field's value. -func (s *ClusterSubnetGroup) SetSubnetGroupStatus(v string) *ClusterSubnetGroup { - s.SubnetGroupStatus = &v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *ClusterSubnetGroup) SetSubnets(v []*Subnet) *ClusterSubnetGroup { - s.Subnets = v - return s -} - -// SetTags sets the Tags field's value. -func (s *ClusterSubnetGroup) SetTags(v []*Tag) *ClusterSubnetGroup { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ClusterSubnetGroup) SetVpcId(v string) *ClusterSubnetGroup { - s.VpcId = &v - return s -} - -// Describes a cluster version, including the parameter group family and description -// of the version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterVersion -type ClusterVersion struct { - _ struct{} `type:"structure"` - - // The name of the cluster parameter group family for the cluster. - ClusterParameterGroupFamily *string `type:"string"` - - // The version number used by the cluster. - ClusterVersion *string `type:"string"` - - // The description of the cluster version. - Description *string `type:"string"` -} - -// String returns the string representation -func (s ClusterVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClusterVersion) GoString() string { - return s.String() -} - -// SetClusterParameterGroupFamily sets the ClusterParameterGroupFamily field's value. -func (s *ClusterVersion) SetClusterParameterGroupFamily(v string) *ClusterVersion { - s.ClusterParameterGroupFamily = &v - return s -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *ClusterVersion) SetClusterVersion(v string) *ClusterVersion { - s.ClusterVersion = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ClusterVersion) SetDescription(v string) *ClusterVersion { - s.Description = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CopyClusterSnapshotMessage -type CopyClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster the source snapshot was created from. This - // parameter is required if your IAM user has a policy containing a snapshot - // resource element that specifies anything other than * for the cluster name. - // - // Constraints: - // - // * Must be the identifier for a valid cluster. - SourceSnapshotClusterIdentifier *string `type:"string"` - - // The identifier for the source snapshot. - // - // Constraints: - // - // * Must be the identifier for a valid automated snapshot whose state is - // available. - // - // SourceSnapshotIdentifier is a required field - SourceSnapshotIdentifier *string `type:"string" required:"true"` - - // The identifier given to the new manual snapshot. - // - // Constraints: - // - // * Cannot be null, empty, or blank. - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // * Must be unique for the AWS account that is making the request. - // - // TargetSnapshotIdentifier is a required field - TargetSnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyClusterSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyClusterSnapshotInput"} - if s.SourceSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceSnapshotIdentifier")) - } - if s.TargetSnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetSnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceSnapshotClusterIdentifier sets the SourceSnapshotClusterIdentifier field's value. -func (s *CopyClusterSnapshotInput) SetSourceSnapshotClusterIdentifier(v string) *CopyClusterSnapshotInput { - s.SourceSnapshotClusterIdentifier = &v - return s -} - -// SetSourceSnapshotIdentifier sets the SourceSnapshotIdentifier field's value. -func (s *CopyClusterSnapshotInput) SetSourceSnapshotIdentifier(v string) *CopyClusterSnapshotInput { - s.SourceSnapshotIdentifier = &v - return s -} - -// SetTargetSnapshotIdentifier sets the TargetSnapshotIdentifier field's value. -func (s *CopyClusterSnapshotInput) SetTargetSnapshotIdentifier(v string) *CopyClusterSnapshotInput { - s.TargetSnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CopyClusterSnapshotResult -type CopyClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Describes a snapshot. - Snapshot *Snapshot `type:"structure"` -} - -// String returns the string representation -func (s CopyClusterSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *CopyClusterSnapshotOutput) SetSnapshot(v *Snapshot) *CopyClusterSnapshotOutput { - s.Snapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterMessage -type CreateClusterInput struct { - _ struct{} `type:"structure"` - - // Reserved. - AdditionalInfo *string `type:"string"` - - // If true, major version upgrades can be applied during the maintenance window - // to the Amazon Redshift engine that is running on the cluster. - // - // When a new major version of the Amazon Redshift engine is released, you can - // request that the service automatically apply upgrades during the maintenance - // window to the Amazon Redshift engine that is running on your cluster. - // - // Default: true - AllowVersionUpgrade *bool `type:"boolean"` - - // The number of days that automated snapshots are retained. If the value is - // 0, automated snapshots are disabled. Even if automated snapshots are disabled, - // you can still create manual snapshots when you want with CreateClusterSnapshot. - // - // Default: 1 - // - // Constraints: Must be a value from 0 to 35. - AutomatedSnapshotRetentionPeriod *int64 `type:"integer"` - - // The EC2 Availability Zone (AZ) in which you want Amazon Redshift to provision - // the cluster. For example, if you have several EC2 instances running in a - // specific Availability Zone, then you might want the cluster to be provisioned - // in the same zone in order to decrease network latency. - // - // Default: A random, system-chosen Availability Zone in the region that is - // specified by the endpoint. - // - // Example: us-east-1d - // - // Constraint: The specified Availability Zone must be in the same region as - // the current endpoint. - AvailabilityZone *string `type:"string"` - - // A unique identifier for the cluster. You use this identifier to refer to - // the cluster for any subsequent cluster operations such as deleting or modifying. - // The identifier also appears in the Amazon Redshift console. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * Alphabetic characters must be lowercase. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // * Must be unique for all clusters within an AWS account. - // - // Example: myexamplecluster - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // The name of the parameter group to be associated with this cluster. - // - // Default: The default Amazon Redshift cluster parameter group. For information - // about the default parameter group, go to Working with Amazon Redshift Parameter - // Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - ClusterParameterGroupName *string `type:"string"` - - // A list of security groups to be associated with this cluster. - // - // Default: The default cluster security group for Amazon Redshift. - ClusterSecurityGroups []*string `locationNameList:"ClusterSecurityGroupName" type:"list"` - - // The name of a cluster subnet group to be associated with this cluster. - // - // If this parameter is not provided the resulting cluster will be deployed - // outside virtual private cloud (VPC). - ClusterSubnetGroupName *string `type:"string"` - - // The type of the cluster. When cluster type is specified as - // - // * single-node, the NumberOfNodes parameter is not required. - // - // * multi-node, the NumberOfNodes parameter is required. - // - // Valid Values: multi-node | single-node - // - // Default: multi-node - ClusterType *string `type:"string"` - - // The version of the Amazon Redshift engine software that you want to deploy - // on the cluster. - // - // The version selected runs on all the nodes in the cluster. - // - // Constraints: Only version 1.0 is currently available. - // - // Example: 1.0 - ClusterVersion *string `type:"string"` - - // The name of the first database to be created when the cluster is created. - // - // To create additional databases after the cluster is created, connect to the - // cluster with a SQL client and use SQL commands to create a database. For - // more information, go to Create a Database (http://docs.aws.amazon.com/redshift/latest/dg/t_creating_database.html) - // in the Amazon Redshift Database Developer Guide. - // - // Default: dev - // - // Constraints: - // - // * Must contain 1 to 64 alphanumeric characters. - // - // * Must contain only lowercase letters. - // - // * Cannot be a word that is reserved by the service. A list of reserved - // words can be found in Reserved Words (http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html) - // in the Amazon Redshift Database Developer Guide. - DBName *string `type:"string"` - - // The Elastic IP (EIP) address for the cluster. - // - // Constraints: The cluster must be provisioned in EC2-VPC and publicly-accessible - // through an Internet gateway. For more information about provisioning clusters - // in EC2-VPC, go to Supported Platforms to Launch Your Cluster (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#cluster-platforms) - // in the Amazon Redshift Cluster Management Guide. - ElasticIp *string `type:"string"` - - // If true, the data in the cluster is encrypted at rest. - // - // Default: false - Encrypted *bool `type:"boolean"` - - // An option that specifies whether to create the cluster with enhanced VPC - // routing enabled. To create a cluster that uses enhanced VPC routing, the - // cluster must be in a VPC. For more information, see Enhanced VPC Routing - // (http://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html) - // in the Amazon Redshift Cluster Management Guide. - // - // If this option is true, enhanced VPC routing is enabled. - // - // Default: false - EnhancedVpcRouting *bool `type:"boolean"` - - // Specifies the name of the HSM client certificate the Amazon Redshift cluster - // uses to retrieve the data encryption keys stored in an HSM. - HsmClientCertificateIdentifier *string `type:"string"` - - // Specifies the name of the HSM configuration that contains the information - // the Amazon Redshift cluster can use to retrieve and store keys in an HSM. - HsmConfigurationIdentifier *string `type:"string"` - - // A list of AWS Identity and Access Management (IAM) roles that can be used - // by the cluster to access other AWS services. You must supply the IAM roles - // in their Amazon Resource Name (ARN) format. You can supply up to 10 IAM roles - // in a single request. - // - // A cluster can have up to 10 IAM roles associated with it at any time. - IamRoles []*string `locationNameList:"IamRoleArn" type:"list"` - - // The AWS Key Management Service (KMS) key ID of the encryption key that you - // want to use to encrypt data in the cluster. - KmsKeyId *string `type:"string"` - - // The password associated with the master user account for the cluster that - // is being created. - // - // Constraints: - // - // * Must be between 8 and 64 characters in length. - // - // * Must contain at least one uppercase letter. - // - // * Must contain at least one lowercase letter. - // - // * Must contain one number. - // - // * Can be any printable ASCII character (ASCII code 33 to 126) except ' - // (single quote), " (double quote), \, /, @, or space. - // - // MasterUserPassword is a required field - MasterUserPassword *string `type:"string" required:"true"` - - // The user name associated with the master user account for the cluster that - // is being created. - // - // Constraints: - // - // * Must be 1 - 128 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot be a reserved word. A list of reserved words can be found in - // Reserved Words (http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html) - // in the Amazon Redshift Database Developer Guide. - // - // MasterUsername is a required field - MasterUsername *string `type:"string" required:"true"` - - // The node type to be provisioned for the cluster. For information about node - // types, go to Working with Clusters (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#how-many-nodes) - // in the Amazon Redshift Cluster Management Guide. - // - // Valid Values: ds1.xlarge | ds1.8xlarge | ds2.xlarge | ds2.8xlarge | dc1.large - // | dc1.8xlarge. - // - // NodeType is a required field - NodeType *string `type:"string" required:"true"` - - // The number of compute nodes in the cluster. This parameter is required when - // the ClusterType parameter is specified as multi-node. - // - // For information about determining how many nodes you need, go to Working - // with Clusters (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#how-many-nodes) - // in the Amazon Redshift Cluster Management Guide. - // - // If you don't specify this parameter, you get a single-node cluster. When - // requesting a multi-node cluster, you must specify the number of nodes that - // you want in the cluster. - // - // Default: 1 - // - // Constraints: Value must be at least 1 and no more than 100. - NumberOfNodes *int64 `type:"integer"` - - // The port number on which the cluster accepts incoming connections. - // - // The cluster is accessible only via the JDBC and ODBC connection strings. - // Part of the connection string requires the port on which the cluster will - // listen for incoming connections. - // - // Default: 5439 - // - // Valid Values: 1150-65535 - Port *int64 `type:"integer"` - - // The weekly time range (in UTC) during which automated cluster maintenance - // can occur. - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: A 30-minute window selected at random from an 8-hour block of time - // per region, occurring on a random day of the week. For more information about - // the time blocks for each region, see Maintenance Windows (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#rs-maintenance-windows) - // in Amazon Redshift Cluster Management Guide. - // - // Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `type:"string"` - - // If true, the cluster can be accessed from a public network. - PubliclyAccessible *bool `type:"boolean"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // A list of Virtual Private Cloud (VPC) security groups to be associated with - // the cluster. - // - // Default: The default VPC security group is associated with the cluster. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s CreateClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClusterInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - if s.MasterUserPassword == nil { - invalidParams.Add(request.NewErrParamRequired("MasterUserPassword")) - } - if s.MasterUsername == nil { - invalidParams.Add(request.NewErrParamRequired("MasterUsername")) - } - if s.NodeType == nil { - invalidParams.Add(request.NewErrParamRequired("NodeType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *CreateClusterInput) SetAdditionalInfo(v string) *CreateClusterInput { - s.AdditionalInfo = &v - return s -} - -// SetAllowVersionUpgrade sets the AllowVersionUpgrade field's value. -func (s *CreateClusterInput) SetAllowVersionUpgrade(v bool) *CreateClusterInput { - s.AllowVersionUpgrade = &v - return s -} - -// SetAutomatedSnapshotRetentionPeriod sets the AutomatedSnapshotRetentionPeriod field's value. -func (s *CreateClusterInput) SetAutomatedSnapshotRetentionPeriod(v int64) *CreateClusterInput { - s.AutomatedSnapshotRetentionPeriod = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateClusterInput) SetAvailabilityZone(v string) *CreateClusterInput { - s.AvailabilityZone = &v - return s -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *CreateClusterInput) SetClusterIdentifier(v string) *CreateClusterInput { - s.ClusterIdentifier = &v - return s -} - -// SetClusterParameterGroupName sets the ClusterParameterGroupName field's value. -func (s *CreateClusterInput) SetClusterParameterGroupName(v string) *CreateClusterInput { - s.ClusterParameterGroupName = &v - return s -} - -// SetClusterSecurityGroups sets the ClusterSecurityGroups field's value. -func (s *CreateClusterInput) SetClusterSecurityGroups(v []*string) *CreateClusterInput { - s.ClusterSecurityGroups = v - return s -} - -// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. -func (s *CreateClusterInput) SetClusterSubnetGroupName(v string) *CreateClusterInput { - s.ClusterSubnetGroupName = &v - return s -} - -// SetClusterType sets the ClusterType field's value. -func (s *CreateClusterInput) SetClusterType(v string) *CreateClusterInput { - s.ClusterType = &v - return s -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *CreateClusterInput) SetClusterVersion(v string) *CreateClusterInput { - s.ClusterVersion = &v - return s -} - -// SetDBName sets the DBName field's value. -func (s *CreateClusterInput) SetDBName(v string) *CreateClusterInput { - s.DBName = &v - return s -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *CreateClusterInput) SetElasticIp(v string) *CreateClusterInput { - s.ElasticIp = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *CreateClusterInput) SetEncrypted(v bool) *CreateClusterInput { - s.Encrypted = &v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *CreateClusterInput) SetEnhancedVpcRouting(v bool) *CreateClusterInput { - s.EnhancedVpcRouting = &v - return s -} - -// SetHsmClientCertificateIdentifier sets the HsmClientCertificateIdentifier field's value. -func (s *CreateClusterInput) SetHsmClientCertificateIdentifier(v string) *CreateClusterInput { - s.HsmClientCertificateIdentifier = &v - return s -} - -// SetHsmConfigurationIdentifier sets the HsmConfigurationIdentifier field's value. -func (s *CreateClusterInput) SetHsmConfigurationIdentifier(v string) *CreateClusterInput { - s.HsmConfigurationIdentifier = &v - return s -} - -// SetIamRoles sets the IamRoles field's value. -func (s *CreateClusterInput) SetIamRoles(v []*string) *CreateClusterInput { - s.IamRoles = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateClusterInput) SetKmsKeyId(v string) *CreateClusterInput { - s.KmsKeyId = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *CreateClusterInput) SetMasterUserPassword(v string) *CreateClusterInput { - s.MasterUserPassword = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *CreateClusterInput) SetMasterUsername(v string) *CreateClusterInput { - s.MasterUsername = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *CreateClusterInput) SetNodeType(v string) *CreateClusterInput { - s.NodeType = &v - return s -} - -// SetNumberOfNodes sets the NumberOfNodes field's value. -func (s *CreateClusterInput) SetNumberOfNodes(v int64) *CreateClusterInput { - s.NumberOfNodes = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateClusterInput) SetPort(v int64) *CreateClusterInput { - s.Port = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CreateClusterInput) SetPreferredMaintenanceWindow(v string) *CreateClusterInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *CreateClusterInput) SetPubliclyAccessible(v bool) *CreateClusterInput { - s.PubliclyAccessible = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateClusterInput) SetTags(v []*Tag) *CreateClusterInput { - s.Tags = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *CreateClusterInput) SetVpcSecurityGroupIds(v []*string) *CreateClusterInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterResult -type CreateClusterOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s CreateClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *CreateClusterOutput) SetCluster(v *Cluster) *CreateClusterOutput { - s.Cluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterParameterGroupMessage -type CreateClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // A description of the parameter group. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // The Amazon Redshift engine version to which the cluster parameter group applies. - // The cluster engine version determines the set of parameters. - // - // To get a list of valid parameter group family names, you can call DescribeClusterParameterGroups. - // By default, Amazon Redshift returns a list of all the parameter groups that - // are owned by your AWS account, including the default parameter groups for - // each Amazon Redshift engine version. The parameter group family names associated - // with the default parameter groups provide you the valid values. For example, - // a valid family name is "redshift-1.0". - // - // ParameterGroupFamily is a required field - ParameterGroupFamily *string `type:"string" required:"true"` - - // The name of the cluster parameter group. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // * Must be unique withing your AWS account. - // - // This value is stored as a lower-case string. - // - // ParameterGroupName is a required field - ParameterGroupName *string `type:"string" required:"true"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClusterParameterGroupInput"} - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.ParameterGroupFamily == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterGroupFamily")) - } - if s.ParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateClusterParameterGroupInput) SetDescription(v string) *CreateClusterParameterGroupInput { - s.Description = &v - return s -} - -// SetParameterGroupFamily sets the ParameterGroupFamily field's value. -func (s *CreateClusterParameterGroupInput) SetParameterGroupFamily(v string) *CreateClusterParameterGroupInput { - s.ParameterGroupFamily = &v - return s -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *CreateClusterParameterGroupInput) SetParameterGroupName(v string) *CreateClusterParameterGroupInput { - s.ParameterGroupName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateClusterParameterGroupInput) SetTags(v []*Tag) *CreateClusterParameterGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterParameterGroupResult -type CreateClusterParameterGroupOutput struct { - _ struct{} `type:"structure"` - - // Describes a parameter group. - ClusterParameterGroup *ClusterParameterGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateClusterParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterParameterGroupOutput) GoString() string { - return s.String() -} - -// SetClusterParameterGroup sets the ClusterParameterGroup field's value. -func (s *CreateClusterParameterGroupOutput) SetClusterParameterGroup(v *ClusterParameterGroup) *CreateClusterParameterGroupOutput { - s.ClusterParameterGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSecurityGroupMessage -type CreateClusterSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // The name for the security group. Amazon Redshift stores the value as a lowercase - // string. - // - // Constraints: - // - // * Must contain no more than 255 alphanumeric characters or hyphens. - // - // * Must not be "Default". - // - // * Must be unique for all security groups that are created by your AWS - // account. - // - // Example: examplesecuritygroup - // - // ClusterSecurityGroupName is a required field - ClusterSecurityGroupName *string `type:"string" required:"true"` - - // A description for the security group. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateClusterSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterSecurityGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClusterSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClusterSecurityGroupInput"} - if s.ClusterSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterSecurityGroupName")) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterSecurityGroupName sets the ClusterSecurityGroupName field's value. -func (s *CreateClusterSecurityGroupInput) SetClusterSecurityGroupName(v string) *CreateClusterSecurityGroupInput { - s.ClusterSecurityGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateClusterSecurityGroupInput) SetDescription(v string) *CreateClusterSecurityGroupInput { - s.Description = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateClusterSecurityGroupInput) SetTags(v []*Tag) *CreateClusterSecurityGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSecurityGroupResult -type CreateClusterSecurityGroupOutput struct { - _ struct{} `type:"structure"` - - // Describes a security group. - ClusterSecurityGroup *ClusterSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateClusterSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterSecurityGroupOutput) GoString() string { - return s.String() -} - -// SetClusterSecurityGroup sets the ClusterSecurityGroup field's value. -func (s *CreateClusterSecurityGroupOutput) SetClusterSecurityGroup(v *ClusterSecurityGroup) *CreateClusterSecurityGroupOutput { - s.ClusterSecurityGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSnapshotMessage -type CreateClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - // The cluster identifier for which you want a snapshot. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // A unique identifier for the snapshot that you are requesting. This identifier - // must be unique for all snapshots within the AWS account. - // - // Constraints: - // - // * Cannot be null, empty, or blank - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - // - // Example: my-snapshot-id - // - // SnapshotIdentifier is a required field - SnapshotIdentifier *string `type:"string" required:"true"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateClusterSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClusterSnapshotInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - if s.SnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *CreateClusterSnapshotInput) SetClusterIdentifier(v string) *CreateClusterSnapshotInput { - s.ClusterIdentifier = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *CreateClusterSnapshotInput) SetSnapshotIdentifier(v string) *CreateClusterSnapshotInput { - s.SnapshotIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateClusterSnapshotInput) SetTags(v []*Tag) *CreateClusterSnapshotInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSnapshotResult -type CreateClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Describes a snapshot. - Snapshot *Snapshot `type:"structure"` -} - -// String returns the string representation -func (s CreateClusterSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *CreateClusterSnapshotOutput) SetSnapshot(v *Snapshot) *CreateClusterSnapshotOutput { - s.Snapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSubnetGroupMessage -type CreateClusterSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The name for the subnet group. Amazon Redshift stores the value as a lowercase - // string. - // - // Constraints: - // - // * Must contain no more than 255 alphanumeric characters or hyphens. - // - // * Must not be "Default". - // - // * Must be unique for all subnet groups that are created by your AWS account. - // - // Example: examplesubnetgroup - // - // ClusterSubnetGroupName is a required field - ClusterSubnetGroupName *string `type:"string" required:"true"` - - // A description for the subnet group. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a - // single request. - // - // SubnetIds is a required field - SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateClusterSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClusterSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClusterSubnetGroupInput"} - if s.ClusterSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterSubnetGroupName")) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. -func (s *CreateClusterSubnetGroupInput) SetClusterSubnetGroupName(v string) *CreateClusterSubnetGroupInput { - s.ClusterSubnetGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateClusterSubnetGroupInput) SetDescription(v string) *CreateClusterSubnetGroupInput { - s.Description = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateClusterSubnetGroupInput) SetSubnetIds(v []*string) *CreateClusterSubnetGroupInput { - s.SubnetIds = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateClusterSubnetGroupInput) SetTags(v []*Tag) *CreateClusterSubnetGroupInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSubnetGroupResult -type CreateClusterSubnetGroupOutput struct { - _ struct{} `type:"structure"` - - // Describes a subnet group. - ClusterSubnetGroup *ClusterSubnetGroup `type:"structure"` -} - -// String returns the string representation -func (s CreateClusterSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterSubnetGroupOutput) GoString() string { - return s.String() -} - -// SetClusterSubnetGroup sets the ClusterSubnetGroup field's value. -func (s *CreateClusterSubnetGroupOutput) SetClusterSubnetGroup(v *ClusterSubnetGroup) *CreateClusterSubnetGroupOutput { - s.ClusterSubnetGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateEventSubscriptionMessage -type CreateEventSubscriptionInput struct { - _ struct{} `type:"structure"` - - // A Boolean value; set to true to activate the subscription, set to false to - // create the subscription but not active it. - Enabled *bool `type:"boolean"` - - // Specifies the Amazon Redshift event categories to be published by the event - // notification subscription. - // - // Values: Configuration, Management, Monitoring, Security - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // Specifies the Amazon Redshift event severity to be published by the event - // notification subscription. - // - // Values: ERROR, INFO - Severity *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic used to transmit the - // event notifications. The ARN is created by Amazon SNS when you create a topic - // and subscribe to it. - // - // SnsTopicArn is a required field - SnsTopicArn *string `type:"string" required:"true"` - - // A list of one or more identifiers of Amazon Redshift source objects. All - // of the objects must be of the same type as was specified in the source type - // parameter. The event subscription will return only events generated by the - // specified objects. If not specified, then events are returned for all objects - // within the source type specified. - // - // Example: my-cluster-1, my-cluster-2 - // - // Example: my-snapshot-20131010 - SourceIds []*string `locationNameList:"SourceId" type:"list"` - - // The type of source that will be generating the events. For example, if you - // want to be notified of events generated by a cluster, you would set this - // parameter to cluster. If this value is not specified, events are returned - // for all Amazon Redshift objects in your AWS account. You must specify a source - // type in order to specify source IDs. - // - // Valid values: cluster, cluster-parameter-group, cluster-security-group, and - // cluster-snapshot. - SourceType *string `type:"string"` - - // The name of the event subscription to be created. - // - // Constraints: - // - // * Cannot be null, empty, or blank. - // - // * Must contain from 1 to 255 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // SubscriptionName is a required field - SubscriptionName *string `type:"string" required:"true"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateEventSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEventSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEventSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEventSubscriptionInput"} - if s.SnsTopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("SnsTopicArn")) - } - if s.SubscriptionName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *CreateEventSubscriptionInput) SetEnabled(v bool) *CreateEventSubscriptionInput { - s.Enabled = &v - return s -} - -// SetEventCategories sets the EventCategories field's value. -func (s *CreateEventSubscriptionInput) SetEventCategories(v []*string) *CreateEventSubscriptionInput { - s.EventCategories = v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *CreateEventSubscriptionInput) SetSeverity(v string) *CreateEventSubscriptionInput { - s.Severity = &v - return s -} - -// SetSnsTopicArn sets the SnsTopicArn field's value. -func (s *CreateEventSubscriptionInput) SetSnsTopicArn(v string) *CreateEventSubscriptionInput { - s.SnsTopicArn = &v - return s -} - -// SetSourceIds sets the SourceIds field's value. -func (s *CreateEventSubscriptionInput) SetSourceIds(v []*string) *CreateEventSubscriptionInput { - s.SourceIds = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *CreateEventSubscriptionInput) SetSourceType(v string) *CreateEventSubscriptionInput { - s.SourceType = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *CreateEventSubscriptionInput) SetSubscriptionName(v string) *CreateEventSubscriptionInput { - s.SubscriptionName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateEventSubscriptionInput) SetTags(v []*Tag) *CreateEventSubscriptionInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateEventSubscriptionResult -type CreateEventSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Describes event subscriptions. - EventSubscription *EventSubscription `type:"structure"` -} - -// String returns the string representation -func (s CreateEventSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEventSubscriptionOutput) GoString() string { - return s.String() -} - -// SetEventSubscription sets the EventSubscription field's value. -func (s *CreateEventSubscriptionOutput) SetEventSubscription(v *EventSubscription) *CreateEventSubscriptionOutput { - s.EventSubscription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmClientCertificateMessage -type CreateHsmClientCertificateInput struct { - _ struct{} `type:"structure"` - - // The identifier to be assigned to the new HSM client certificate that the - // cluster will use to connect to the HSM to use the database encryption keys. - // - // HsmClientCertificateIdentifier is a required field - HsmClientCertificateIdentifier *string `type:"string" required:"true"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateHsmClientCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateHsmClientCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateHsmClientCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateHsmClientCertificateInput"} - if s.HsmClientCertificateIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("HsmClientCertificateIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHsmClientCertificateIdentifier sets the HsmClientCertificateIdentifier field's value. -func (s *CreateHsmClientCertificateInput) SetHsmClientCertificateIdentifier(v string) *CreateHsmClientCertificateInput { - s.HsmClientCertificateIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateHsmClientCertificateInput) SetTags(v []*Tag) *CreateHsmClientCertificateInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmClientCertificateResult -type CreateHsmClientCertificateOutput struct { - _ struct{} `type:"structure"` - - // Returns information about an HSM client certificate. The certificate is stored - // in a secure Hardware Storage Module (HSM), and used by the Amazon Redshift - // cluster to encrypt data files. - HsmClientCertificate *HsmClientCertificate `type:"structure"` -} - -// String returns the string representation -func (s CreateHsmClientCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateHsmClientCertificateOutput) GoString() string { - return s.String() -} - -// SetHsmClientCertificate sets the HsmClientCertificate field's value. -func (s *CreateHsmClientCertificateOutput) SetHsmClientCertificate(v *HsmClientCertificate) *CreateHsmClientCertificateOutput { - s.HsmClientCertificate = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmConfigurationMessage -type CreateHsmConfigurationInput struct { - _ struct{} `type:"structure"` - - // A text description of the HSM configuration to be created. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // The identifier to be assigned to the new Amazon Redshift HSM configuration. - // - // HsmConfigurationIdentifier is a required field - HsmConfigurationIdentifier *string `type:"string" required:"true"` - - // The IP address that the Amazon Redshift cluster must use to access the HSM. - // - // HsmIpAddress is a required field - HsmIpAddress *string `type:"string" required:"true"` - - // The name of the partition in the HSM where the Amazon Redshift clusters will - // store their database encryption keys. - // - // HsmPartitionName is a required field - HsmPartitionName *string `type:"string" required:"true"` - - // The password required to access the HSM partition. - // - // HsmPartitionPassword is a required field - HsmPartitionPassword *string `type:"string" required:"true"` - - // The HSMs public certificate file. When using Cloud HSM, the file name is - // server.pem. - // - // HsmServerPublicCertificate is a required field - HsmServerPublicCertificate *string `type:"string" required:"true"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateHsmConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateHsmConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateHsmConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateHsmConfigurationInput"} - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.HsmConfigurationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("HsmConfigurationIdentifier")) - } - if s.HsmIpAddress == nil { - invalidParams.Add(request.NewErrParamRequired("HsmIpAddress")) - } - if s.HsmPartitionName == nil { - invalidParams.Add(request.NewErrParamRequired("HsmPartitionName")) - } - if s.HsmPartitionPassword == nil { - invalidParams.Add(request.NewErrParamRequired("HsmPartitionPassword")) - } - if s.HsmServerPublicCertificate == nil { - invalidParams.Add(request.NewErrParamRequired("HsmServerPublicCertificate")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateHsmConfigurationInput) SetDescription(v string) *CreateHsmConfigurationInput { - s.Description = &v - return s -} - -// SetHsmConfigurationIdentifier sets the HsmConfigurationIdentifier field's value. -func (s *CreateHsmConfigurationInput) SetHsmConfigurationIdentifier(v string) *CreateHsmConfigurationInput { - s.HsmConfigurationIdentifier = &v - return s -} - -// SetHsmIpAddress sets the HsmIpAddress field's value. -func (s *CreateHsmConfigurationInput) SetHsmIpAddress(v string) *CreateHsmConfigurationInput { - s.HsmIpAddress = &v - return s -} - -// SetHsmPartitionName sets the HsmPartitionName field's value. -func (s *CreateHsmConfigurationInput) SetHsmPartitionName(v string) *CreateHsmConfigurationInput { - s.HsmPartitionName = &v - return s -} - -// SetHsmPartitionPassword sets the HsmPartitionPassword field's value. -func (s *CreateHsmConfigurationInput) SetHsmPartitionPassword(v string) *CreateHsmConfigurationInput { - s.HsmPartitionPassword = &v - return s -} - -// SetHsmServerPublicCertificate sets the HsmServerPublicCertificate field's value. -func (s *CreateHsmConfigurationInput) SetHsmServerPublicCertificate(v string) *CreateHsmConfigurationInput { - s.HsmServerPublicCertificate = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateHsmConfigurationInput) SetTags(v []*Tag) *CreateHsmConfigurationInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateHsmConfigurationResult -type CreateHsmConfigurationOutput struct { - _ struct{} `type:"structure"` - - // Returns information about an HSM configuration, which is an object that describes - // to Amazon Redshift clusters the information they require to connect to an - // HSM where they can store database encryption keys. - HsmConfiguration *HsmConfiguration `type:"structure"` -} - -// String returns the string representation -func (s CreateHsmConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateHsmConfigurationOutput) GoString() string { - return s.String() -} - -// SetHsmConfiguration sets the HsmConfiguration field's value. -func (s *CreateHsmConfigurationOutput) SetHsmConfiguration(v *HsmConfiguration) *CreateHsmConfigurationOutput { - s.HsmConfiguration = v - return s -} - -// The result of the CreateSnapshotCopyGrant action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateSnapshotCopyGrantMessage -type CreateSnapshotCopyGrantInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the customer master key (CMK) to which to grant - // Amazon Redshift permission. If no key is specified, the default key is used. - KmsKeyId *string `type:"string"` - - // The name of the snapshot copy grant. This name must be unique in the region - // for the AWS account. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * Alphabetic characters must be lowercase. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // * Must be unique for all clusters within an AWS account. - // - // SnapshotCopyGrantName is a required field - SnapshotCopyGrantName *string `type:"string" required:"true"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s CreateSnapshotCopyGrantInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSnapshotCopyGrantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSnapshotCopyGrantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotCopyGrantInput"} - if s.SnapshotCopyGrantName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotCopyGrantName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateSnapshotCopyGrantInput) SetKmsKeyId(v string) *CreateSnapshotCopyGrantInput { - s.KmsKeyId = &v - return s -} - -// SetSnapshotCopyGrantName sets the SnapshotCopyGrantName field's value. -func (s *CreateSnapshotCopyGrantInput) SetSnapshotCopyGrantName(v string) *CreateSnapshotCopyGrantInput { - s.SnapshotCopyGrantName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSnapshotCopyGrantInput) SetTags(v []*Tag) *CreateSnapshotCopyGrantInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateSnapshotCopyGrantResult -type CreateSnapshotCopyGrantOutput struct { - _ struct{} `type:"structure"` - - // The snapshot copy grant that grants Amazon Redshift permission to encrypt - // copied snapshots with the specified customer master key (CMK) from AWS KMS - // in the destination region. - // - // For more information about managing snapshot copy grants, go to Amazon Redshift - // Database Encryption (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html) - // in the Amazon Redshift Cluster Management Guide. - SnapshotCopyGrant *SnapshotCopyGrant `type:"structure"` -} - -// String returns the string representation -func (s CreateSnapshotCopyGrantOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSnapshotCopyGrantOutput) GoString() string { - return s.String() -} - -// SetSnapshotCopyGrant sets the SnapshotCopyGrant field's value. -func (s *CreateSnapshotCopyGrantOutput) SetSnapshotCopyGrant(v *SnapshotCopyGrant) *CreateSnapshotCopyGrantOutput { - s.SnapshotCopyGrant = v - return s -} - -// Contains the output from the CreateTags action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateTagsMessage -type CreateTagsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) to which you want to add the tag or tags. - // For example, arn:aws:redshift:us-east-1:123456789:cluster:t1. - // - // ResourceName is a required field - ResourceName *string `type:"string" required:"true"` - - // One or more name/value pairs to add as tags to the specified resource. Each - // tag name is passed in with the parameter Key and the corresponding value - // is passed in with the parameter Value. The Key and Value parameters are separated - // by a comma (,). Separate multiple tags with a space. For example, --tags - // "Key"="owner","Value"="admin" "Key"="environment","Value"="test" "Key"="version","Value"="1.0". - // - // Tags is a required field - Tags []*Tag `locationNameList:"Tag" 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.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceName sets the ResourceName field's value. -func (s *CreateTagsInput) SetResourceName(v string) *CreateTagsInput { - s.ResourceName = &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/redshift-2012-12-01/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() -} - -// Describes the default cluster parameters for a parameter group family. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DefaultClusterParameters -type DefaultClusterParameters struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // The name of the cluster parameter group family to which the engine default - // parameters apply. - ParameterGroupFamily *string `type:"string"` - - // The list of cluster default parameters. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` -} - -// String returns the string representation -func (s DefaultClusterParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DefaultClusterParameters) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DefaultClusterParameters) SetMarker(v string) *DefaultClusterParameters { - s.Marker = &v - return s -} - -// SetParameterGroupFamily sets the ParameterGroupFamily field's value. -func (s *DefaultClusterParameters) SetParameterGroupFamily(v string) *DefaultClusterParameters { - s.ParameterGroupFamily = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DefaultClusterParameters) SetParameters(v []*Parameter) *DefaultClusterParameters { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterMessage -type DeleteClusterInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster to be deleted. - // - // Constraints: - // - // * Must contain lowercase characters. - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // The identifier of the final snapshot that is to be created immediately before - // deleting the cluster. If this parameter is provided, SkipFinalClusterSnapshot - // must be false. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - FinalClusterSnapshotIdentifier *string `type:"string"` - - // Determines whether a final snapshot of the cluster is created before Amazon - // Redshift deletes the cluster. If true, a final cluster snapshot is not created. - // If false, a final cluster snapshot is created before the cluster is deleted. - // - // The FinalClusterSnapshotIdentifier parameter must be specified if SkipFinalClusterSnapshot - // is false. - // - // Default: false - SkipFinalClusterSnapshot *bool `type:"boolean"` -} - -// String returns the string representation -func (s DeleteClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *DeleteClusterInput) SetClusterIdentifier(v string) *DeleteClusterInput { - s.ClusterIdentifier = &v - return s -} - -// SetFinalClusterSnapshotIdentifier sets the FinalClusterSnapshotIdentifier field's value. -func (s *DeleteClusterInput) SetFinalClusterSnapshotIdentifier(v string) *DeleteClusterInput { - s.FinalClusterSnapshotIdentifier = &v - return s -} - -// SetSkipFinalClusterSnapshot sets the SkipFinalClusterSnapshot field's value. -func (s *DeleteClusterInput) SetSkipFinalClusterSnapshot(v bool) *DeleteClusterInput { - s.SkipFinalClusterSnapshot = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterResult -type DeleteClusterOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s DeleteClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteClusterOutput) SetCluster(v *Cluster) *DeleteClusterOutput { - s.Cluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterParameterGroupMessage -type DeleteClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the parameter group to be deleted. - // - // Constraints: - // - // * Must be the name of an existing cluster parameter group. - // - // * Cannot delete a default cluster parameter group. - // - // ParameterGroupName is a required field - ParameterGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterParameterGroupInput"} - if s.ParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *DeleteClusterParameterGroupInput) SetParameterGroupName(v string) *DeleteClusterParameterGroupInput { - s.ParameterGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterParameterGroupOutput -type DeleteClusterParameterGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteClusterParameterGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterParameterGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSecurityGroupMessage -type DeleteClusterSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cluster security group to be deleted. - // - // ClusterSecurityGroupName is a required field - ClusterSecurityGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteClusterSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterSecurityGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterSecurityGroupInput"} - if s.ClusterSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterSecurityGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterSecurityGroupName sets the ClusterSecurityGroupName field's value. -func (s *DeleteClusterSecurityGroupInput) SetClusterSecurityGroupName(v string) *DeleteClusterSecurityGroupInput { - s.ClusterSecurityGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSecurityGroupOutput -type DeleteClusterSecurityGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteClusterSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterSecurityGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSnapshotMessage -type DeleteClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the cluster the snapshot was created from. This - // parameter is required if your IAM user has a policy containing a snapshot - // resource element that specifies anything other than * for the cluster name. - // - // Constraints: Must be the name of valid cluster. - SnapshotClusterIdentifier *string `type:"string"` - - // The unique identifier of the manual snapshot to be deleted. - // - // Constraints: Must be the name of an existing snapshot that is in the available - // state. - // - // SnapshotIdentifier is a required field - SnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteClusterSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterSnapshotInput"} - if s.SnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSnapshotClusterIdentifier sets the SnapshotClusterIdentifier field's value. -func (s *DeleteClusterSnapshotInput) SetSnapshotClusterIdentifier(v string) *DeleteClusterSnapshotInput { - s.SnapshotClusterIdentifier = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *DeleteClusterSnapshotInput) SetSnapshotIdentifier(v string) *DeleteClusterSnapshotInput { - s.SnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSnapshotResult -type DeleteClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Describes a snapshot. - Snapshot *Snapshot `type:"structure"` -} - -// String returns the string representation -func (s DeleteClusterSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *DeleteClusterSnapshotOutput) SetSnapshot(v *Snapshot) *DeleteClusterSnapshotOutput { - s.Snapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSubnetGroupMessage -type DeleteClusterSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cluster subnet group name to be deleted. - // - // ClusterSubnetGroupName is a required field - ClusterSubnetGroupName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteClusterSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterSubnetGroupInput"} - if s.ClusterSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterSubnetGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. -func (s *DeleteClusterSubnetGroupInput) SetClusterSubnetGroupName(v string) *DeleteClusterSubnetGroupInput { - s.ClusterSubnetGroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteClusterSubnetGroupOutput -type DeleteClusterSubnetGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteClusterSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterSubnetGroupOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteEventSubscriptionMessage -type DeleteEventSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The name of the Amazon Redshift event notification subscription to be deleted. - // - // SubscriptionName is a required field - SubscriptionName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEventSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEventSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEventSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEventSubscriptionInput"} - if s.SubscriptionName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *DeleteEventSubscriptionInput) SetSubscriptionName(v string) *DeleteEventSubscriptionInput { - s.SubscriptionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteEventSubscriptionOutput -type DeleteEventSubscriptionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteEventSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEventSubscriptionOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmClientCertificateMessage -type DeleteHsmClientCertificateInput struct { - _ struct{} `type:"structure"` - - // The identifier of the HSM client certificate to be deleted. - // - // HsmClientCertificateIdentifier is a required field - HsmClientCertificateIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteHsmClientCertificateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteHsmClientCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteHsmClientCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteHsmClientCertificateInput"} - if s.HsmClientCertificateIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("HsmClientCertificateIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHsmClientCertificateIdentifier sets the HsmClientCertificateIdentifier field's value. -func (s *DeleteHsmClientCertificateInput) SetHsmClientCertificateIdentifier(v string) *DeleteHsmClientCertificateInput { - s.HsmClientCertificateIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmClientCertificateOutput -type DeleteHsmClientCertificateOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteHsmClientCertificateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteHsmClientCertificateOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmConfigurationMessage -type DeleteHsmConfigurationInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Redshift HSM configuration to be deleted. - // - // HsmConfigurationIdentifier is a required field - HsmConfigurationIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteHsmConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteHsmConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteHsmConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteHsmConfigurationInput"} - if s.HsmConfigurationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("HsmConfigurationIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHsmConfigurationIdentifier sets the HsmConfigurationIdentifier field's value. -func (s *DeleteHsmConfigurationInput) SetHsmConfigurationIdentifier(v string) *DeleteHsmConfigurationInput { - s.HsmConfigurationIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteHsmConfigurationOutput -type DeleteHsmConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteHsmConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteHsmConfigurationOutput) GoString() string { - return s.String() -} - -// The result of the DeleteSnapshotCopyGrant action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteSnapshotCopyGrantMessage -type DeleteSnapshotCopyGrantInput struct { - _ struct{} `type:"structure"` - - // The name of the snapshot copy grant to delete. - // - // SnapshotCopyGrantName is a required field - SnapshotCopyGrantName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSnapshotCopyGrantInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSnapshotCopyGrantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSnapshotCopyGrantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSnapshotCopyGrantInput"} - if s.SnapshotCopyGrantName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotCopyGrantName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSnapshotCopyGrantName sets the SnapshotCopyGrantName field's value. -func (s *DeleteSnapshotCopyGrantInput) SetSnapshotCopyGrantName(v string) *DeleteSnapshotCopyGrantInput { - s.SnapshotCopyGrantName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteSnapshotCopyGrantOutput -type DeleteSnapshotCopyGrantOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSnapshotCopyGrantOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSnapshotCopyGrantOutput) GoString() string { - return s.String() -} - -// Contains the output from the DeleteTags action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteTagsMessage -type DeleteTagsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) from which you want to remove the tag or tags. - // For example, arn:aws:redshift:us-east-1:123456789:cluster:t1. - // - // ResourceName is a required field - ResourceName *string `type:"string" required:"true"` - - // The tag key that you want to delete. - // - // TagKeys is a required field - TagKeys []*string `locationNameList:"TagKey" type:"list" required:"true"` -} - -// 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.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceName sets the ResourceName field's value. -func (s *DeleteTagsInput) SetResourceName(v string) *DeleteTagsInput { - s.ResourceName = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/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() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterParameterGroupsMessage -type DescribeClusterParameterGroupsInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeClusterParameterGroups request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The name of a specific parameter group for which to return details. By default, - // details about all parameter groups and the default parameter group are returned. - ParameterGroupName *string `type:"string"` - - // A tag key or keys for which you want to return all matching cluster parameter - // groups that are associated with the specified key or keys. For example, suppose - // that you have parameter groups that are tagged with keys called owner and - // environment. If you specify both of these tag keys in the request, Amazon - // Redshift returns a response with the parameter groups that have either or - // both of these tag keys associated with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching cluster parameter - // groups that are associated with the specified tag value or values. For example, - // suppose that you have parameter groups that are tagged with values called - // admin and test. If you specify both of these tag values in the request, Amazon - // Redshift returns a response with the parameter groups that have either or - // both of these tag values associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// String returns the string representation -func (s DescribeClusterParameterGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterParameterGroupsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterParameterGroupsInput) SetMarker(v string) *DescribeClusterParameterGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeClusterParameterGroupsInput) SetMaxRecords(v int64) *DescribeClusterParameterGroupsInput { - s.MaxRecords = &v - return s -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *DescribeClusterParameterGroupsInput) SetParameterGroupName(v string) *DescribeClusterParameterGroupsInput { - s.ParameterGroupName = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeClusterParameterGroupsInput) SetTagKeys(v []*string) *DescribeClusterParameterGroupsInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeClusterParameterGroupsInput) SetTagValues(v []*string) *DescribeClusterParameterGroupsInput { - s.TagValues = v - return s -} - -// Contains the output from the DescribeClusterParameterGroups action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterParameterGroupsMessage -type DescribeClusterParameterGroupsOutput struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // A list of ClusterParameterGroup instances. Each instance describes one cluster - // parameter group. - ParameterGroups []*ClusterParameterGroup `locationNameList:"ClusterParameterGroup" type:"list"` -} - -// String returns the string representation -func (s DescribeClusterParameterGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterParameterGroupsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterParameterGroupsOutput) SetMarker(v string) *DescribeClusterParameterGroupsOutput { - s.Marker = &v - return s -} - -// SetParameterGroups sets the ParameterGroups field's value. -func (s *DescribeClusterParameterGroupsOutput) SetParameterGroups(v []*ClusterParameterGroup) *DescribeClusterParameterGroupsOutput { - s.ParameterGroups = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterParametersMessage -type DescribeClusterParametersInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeClusterParameters request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The name of a cluster parameter group for which to return details. - // - // ParameterGroupName is a required field - ParameterGroupName *string `type:"string" required:"true"` - - // The parameter types to return. Specify user to show parameters that are different - // form the default. Similarly, specify engine-default to show parameters that - // are the same as the default parameter group. - // - // Default: All parameter types returned. - // - // Valid Values: user | engine-default - Source *string `type:"string"` -} - -// String returns the string representation -func (s DescribeClusterParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClusterParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClusterParametersInput"} - if s.ParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterParametersInput) SetMarker(v string) *DescribeClusterParametersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeClusterParametersInput) SetMaxRecords(v int64) *DescribeClusterParametersInput { - s.MaxRecords = &v - return s -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *DescribeClusterParametersInput) SetParameterGroupName(v string) *DescribeClusterParametersInput { - s.ParameterGroupName = &v - return s -} - -// SetSource sets the Source field's value. -func (s *DescribeClusterParametersInput) SetSource(v string) *DescribeClusterParametersInput { - s.Source = &v - return s -} - -// Contains the output from the DescribeClusterParameters action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterParameterGroupDetails -type DescribeClusterParametersOutput struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // A list of Parameter instances. Each instance lists the parameters of one - // cluster parameter group. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` -} - -// String returns the string representation -func (s DescribeClusterParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterParametersOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterParametersOutput) SetMarker(v string) *DescribeClusterParametersOutput { - s.Marker = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DescribeClusterParametersOutput) SetParameters(v []*Parameter) *DescribeClusterParametersOutput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSecurityGroupsMessage -type DescribeClusterSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of a cluster security group for which you are requesting details. - // You can specify either the Marker parameter or a ClusterSecurityGroupName - // parameter, but not both. - // - // Example: securitygroup1 - ClusterSecurityGroupName *string `type:"string"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeClusterSecurityGroups request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - // - // Constraints: You can specify either the ClusterSecurityGroupName parameter - // or the Marker parameter, but not both. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // A tag key or keys for which you want to return all matching cluster security - // groups that are associated with the specified key or keys. For example, suppose - // that you have security groups that are tagged with keys called owner and - // environment. If you specify both of these tag keys in the request, Amazon - // Redshift returns a response with the security groups that have either or - // both of these tag keys associated with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching cluster security - // groups that are associated with the specified tag value or values. For example, - // suppose that you have security groups that are tagged with values called - // admin and test. If you specify both of these tag values in the request, Amazon - // Redshift returns a response with the security groups that have either or - // both of these tag values associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// String returns the string representation -func (s DescribeClusterSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterSecurityGroupsInput) GoString() string { - return s.String() -} - -// SetClusterSecurityGroupName sets the ClusterSecurityGroupName field's value. -func (s *DescribeClusterSecurityGroupsInput) SetClusterSecurityGroupName(v string) *DescribeClusterSecurityGroupsInput { - s.ClusterSecurityGroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterSecurityGroupsInput) SetMarker(v string) *DescribeClusterSecurityGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeClusterSecurityGroupsInput) SetMaxRecords(v int64) *DescribeClusterSecurityGroupsInput { - s.MaxRecords = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeClusterSecurityGroupsInput) SetTagKeys(v []*string) *DescribeClusterSecurityGroupsInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeClusterSecurityGroupsInput) SetTagValues(v []*string) *DescribeClusterSecurityGroupsInput { - s.TagValues = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterSecurityGroupMessage -type DescribeClusterSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of ClusterSecurityGroup instances. - ClusterSecurityGroups []*ClusterSecurityGroup `locationNameList:"ClusterSecurityGroup" type:"list"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeClusterSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetClusterSecurityGroups sets the ClusterSecurityGroups field's value. -func (s *DescribeClusterSecurityGroupsOutput) SetClusterSecurityGroups(v []*ClusterSecurityGroup) *DescribeClusterSecurityGroupsOutput { - s.ClusterSecurityGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterSecurityGroupsOutput) SetMarker(v string) *DescribeClusterSecurityGroupsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSnapshotsMessage -type DescribeClusterSnapshotsInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster for which information about snapshots is requested. - ClusterIdentifier *string `type:"string"` - - // A time value that requests only snapshots created at or before the specified - // time. The time value is specified in ISO 8601 format. For more information - // about ISO 8601, go to the ISO8601 Wikipedia page. (http://en.wikipedia.org/wiki/ISO_8601) - // - // Example: 2012-07-16T18:00:00Z - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeClusterSnapshots request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The AWS customer account used to create or copy the snapshot. Use this field - // to filter the results to snapshots owned by a particular account. To describe - // snapshots you own, either specify your AWS customer account, or do not specify - // the parameter. - OwnerAccount *string `type:"string"` - - // The snapshot identifier of the snapshot about which to return information. - SnapshotIdentifier *string `type:"string"` - - // The type of snapshots for which you are requesting information. By default, - // snapshots of all types are returned. - // - // Valid Values: automated | manual - SnapshotType *string `type:"string"` - - // A value that requests only snapshots created at or after the specified time. - // The time value is specified in ISO 8601 format. For more information about - // ISO 8601, go to the ISO8601 Wikipedia page. (http://en.wikipedia.org/wiki/ISO_8601) - // - // Example: 2012-07-16T18:00:00Z - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A tag key or keys for which you want to return all matching cluster snapshots - // that are associated with the specified key or keys. For example, suppose - // that you have snapshots that are tagged with keys called owner and environment. - // If you specify both of these tag keys in the request, Amazon Redshift returns - // a response with the snapshots that have either or both of these tag keys - // associated with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching cluster snapshots - // that are associated with the specified tag value or values. For example, - // suppose that you have snapshots that are tagged with values called admin - // and test. If you specify both of these tag values in the request, Amazon - // Redshift returns a response with the snapshots that have either or both of - // these tag values associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// String returns the string representation -func (s DescribeClusterSnapshotsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterSnapshotsInput) GoString() string { - return s.String() -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *DescribeClusterSnapshotsInput) SetClusterIdentifier(v string) *DescribeClusterSnapshotsInput { - s.ClusterIdentifier = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeClusterSnapshotsInput) SetEndTime(v time.Time) *DescribeClusterSnapshotsInput { - s.EndTime = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterSnapshotsInput) SetMarker(v string) *DescribeClusterSnapshotsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeClusterSnapshotsInput) SetMaxRecords(v int64) *DescribeClusterSnapshotsInput { - s.MaxRecords = &v - return s -} - -// SetOwnerAccount sets the OwnerAccount field's value. -func (s *DescribeClusterSnapshotsInput) SetOwnerAccount(v string) *DescribeClusterSnapshotsInput { - s.OwnerAccount = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *DescribeClusterSnapshotsInput) SetSnapshotIdentifier(v string) *DescribeClusterSnapshotsInput { - s.SnapshotIdentifier = &v - return s -} - -// SetSnapshotType sets the SnapshotType field's value. -func (s *DescribeClusterSnapshotsInput) SetSnapshotType(v string) *DescribeClusterSnapshotsInput { - s.SnapshotType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeClusterSnapshotsInput) SetStartTime(v time.Time) *DescribeClusterSnapshotsInput { - s.StartTime = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeClusterSnapshotsInput) SetTagKeys(v []*string) *DescribeClusterSnapshotsInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeClusterSnapshotsInput) SetTagValues(v []*string) *DescribeClusterSnapshotsInput { - s.TagValues = v - return s -} - -// Contains the output from the DescribeClusterSnapshots action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/SnapshotMessage -type DescribeClusterSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // A list of Snapshot instances. - Snapshots []*Snapshot `locationNameList:"Snapshot" type:"list"` -} - -// String returns the string representation -func (s DescribeClusterSnapshotsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterSnapshotsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterSnapshotsOutput) SetMarker(v string) *DescribeClusterSnapshotsOutput { - s.Marker = &v - return s -} - -// SetSnapshots sets the Snapshots field's value. -func (s *DescribeClusterSnapshotsOutput) SetSnapshots(v []*Snapshot) *DescribeClusterSnapshotsOutput { - s.Snapshots = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterSubnetGroupsMessage -type DescribeClusterSubnetGroupsInput struct { - _ struct{} `type:"structure"` - - // The name of the cluster subnet group for which information is requested. - ClusterSubnetGroupName *string `type:"string"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeClusterSubnetGroups request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // A tag key or keys for which you want to return all matching cluster subnet - // groups that are associated with the specified key or keys. For example, suppose - // that you have subnet groups that are tagged with keys called owner and environment. - // If you specify both of these tag keys in the request, Amazon Redshift returns - // a response with the subnet groups that have either or both of these tag keys - // associated with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching cluster subnet - // groups that are associated with the specified tag value or values. For example, - // suppose that you have subnet groups that are tagged with values called admin - // and test. If you specify both of these tag values in the request, Amazon - // Redshift returns a response with the subnet groups that have either or both - // of these tag values associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// String returns the string representation -func (s DescribeClusterSubnetGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterSubnetGroupsInput) GoString() string { - return s.String() -} - -// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. -func (s *DescribeClusterSubnetGroupsInput) SetClusterSubnetGroupName(v string) *DescribeClusterSubnetGroupsInput { - s.ClusterSubnetGroupName = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterSubnetGroupsInput) SetMarker(v string) *DescribeClusterSubnetGroupsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeClusterSubnetGroupsInput) SetMaxRecords(v int64) *DescribeClusterSubnetGroupsInput { - s.MaxRecords = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeClusterSubnetGroupsInput) SetTagKeys(v []*string) *DescribeClusterSubnetGroupsInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeClusterSubnetGroupsInput) SetTagValues(v []*string) *DescribeClusterSubnetGroupsInput { - s.TagValues = v - return s -} - -// Contains the output from the DescribeClusterSubnetGroups action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterSubnetGroupMessage -type DescribeClusterSubnetGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of ClusterSubnetGroup instances. - ClusterSubnetGroups []*ClusterSubnetGroup `locationNameList:"ClusterSubnetGroup" type:"list"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeClusterSubnetGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterSubnetGroupsOutput) GoString() string { - return s.String() -} - -// SetClusterSubnetGroups sets the ClusterSubnetGroups field's value. -func (s *DescribeClusterSubnetGroupsOutput) SetClusterSubnetGroups(v []*ClusterSubnetGroup) *DescribeClusterSubnetGroupsOutput { - s.ClusterSubnetGroups = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterSubnetGroupsOutput) SetMarker(v string) *DescribeClusterSubnetGroupsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClusterVersionsMessage -type DescribeClusterVersionsInput struct { - _ struct{} `type:"structure"` - - // The name of a specific cluster parameter group family to return details for. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - ClusterParameterGroupFamily *string `type:"string"` - - // The specific cluster version to return. - // - // Example: 1.0 - ClusterVersion *string `type:"string"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeClusterVersions request exceed - // the value specified in MaxRecords, AWS returns a value in the Marker field - // of the response. You can retrieve the next set of response records by providing - // the returned marker value in the Marker parameter and retrying the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribeClusterVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterVersionsInput) GoString() string { - return s.String() -} - -// SetClusterParameterGroupFamily sets the ClusterParameterGroupFamily field's value. -func (s *DescribeClusterVersionsInput) SetClusterParameterGroupFamily(v string) *DescribeClusterVersionsInput { - s.ClusterParameterGroupFamily = &v - return s -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *DescribeClusterVersionsInput) SetClusterVersion(v string) *DescribeClusterVersionsInput { - s.ClusterVersion = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterVersionsInput) SetMarker(v string) *DescribeClusterVersionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeClusterVersionsInput) SetMaxRecords(v int64) *DescribeClusterVersionsInput { - s.MaxRecords = &v - return s -} - -// Contains the output from the DescribeClusterVersions action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClusterVersionsMessage -type DescribeClusterVersionsOutput struct { - _ struct{} `type:"structure"` - - // A list of Version elements. - ClusterVersions []*ClusterVersion `locationNameList:"ClusterVersion" type:"list"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeClusterVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClusterVersionsOutput) GoString() string { - return s.String() -} - -// SetClusterVersions sets the ClusterVersions field's value. -func (s *DescribeClusterVersionsOutput) SetClusterVersions(v []*ClusterVersion) *DescribeClusterVersionsOutput { - s.ClusterVersions = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClusterVersionsOutput) SetMarker(v string) *DescribeClusterVersionsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeClustersMessage -type DescribeClustersInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of a cluster whose properties you are requesting. This - // parameter is case sensitive. - // - // The default is that all clusters defined for an account are returned. - ClusterIdentifier *string `type:"string"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeClusters request exceed the - // value specified in MaxRecords, AWS returns a value in the Marker field of - // the response. You can retrieve the next set of response records by providing - // the returned marker value in the Marker parameter and retrying the request. - // - // Constraints: You can specify either the ClusterIdentifier parameter or the - // Marker parameter, but not both. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // A tag key or keys for which you want to return all matching clusters that - // are associated with the specified key or keys. For example, suppose that - // you have clusters that are tagged with keys called owner and environment. - // If you specify both of these tag keys in the request, Amazon Redshift returns - // a response with the clusters that have either or both of these tag keys associated - // with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching clusters - // that are associated with the specified tag value or values. For example, - // suppose that you have clusters that are tagged with values called admin and - // test. If you specify both of these tag values in the request, Amazon Redshift - // returns a response with the clusters that have either or both of these tag - // values associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// String returns the string representation -func (s DescribeClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClustersInput) GoString() string { - return s.String() -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *DescribeClustersInput) SetClusterIdentifier(v string) *DescribeClustersInput { - s.ClusterIdentifier = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClustersInput) SetMarker(v string) *DescribeClustersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeClustersInput) SetMaxRecords(v int64) *DescribeClustersInput { - s.MaxRecords = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeClustersInput) SetTagKeys(v []*string) *DescribeClustersInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeClustersInput) SetTagValues(v []*string) *DescribeClustersInput { - s.TagValues = v - return s -} - -// Contains the output from the DescribeClusters action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ClustersMessage -type DescribeClustersOutput struct { - _ struct{} `type:"structure"` - - // A list of Cluster objects, where each object describes one cluster. - Clusters []*Cluster `locationNameList:"Cluster" type:"list"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClustersOutput) GoString() string { - return s.String() -} - -// SetClusters sets the Clusters field's value. -func (s *DescribeClustersOutput) SetClusters(v []*Cluster) *DescribeClustersOutput { - s.Clusters = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeClustersOutput) SetMarker(v string) *DescribeClustersOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeDefaultClusterParametersMessage -type DescribeDefaultClusterParametersInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeDefaultClusterParameters - // request exceed the value specified in MaxRecords, AWS returns a value in - // the Marker field of the response. You can retrieve the next set of response - // records by providing the returned marker value in the Marker parameter and - // retrying the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The name of the cluster parameter group family. - // - // ParameterGroupFamily is a required field - ParameterGroupFamily *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeDefaultClusterParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDefaultClusterParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDefaultClusterParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDefaultClusterParametersInput"} - if s.ParameterGroupFamily == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterGroupFamily")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *DescribeDefaultClusterParametersInput) SetMarker(v string) *DescribeDefaultClusterParametersInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeDefaultClusterParametersInput) SetMaxRecords(v int64) *DescribeDefaultClusterParametersInput { - s.MaxRecords = &v - return s -} - -// SetParameterGroupFamily sets the ParameterGroupFamily field's value. -func (s *DescribeDefaultClusterParametersInput) SetParameterGroupFamily(v string) *DescribeDefaultClusterParametersInput { - s.ParameterGroupFamily = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeDefaultClusterParametersResult -type DescribeDefaultClusterParametersOutput struct { - _ struct{} `type:"structure"` - - // Describes the default cluster parameters for a parameter group family. - DefaultClusterParameters *DefaultClusterParameters `type:"structure"` -} - -// String returns the string representation -func (s DescribeDefaultClusterParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDefaultClusterParametersOutput) GoString() string { - return s.String() -} - -// SetDefaultClusterParameters sets the DefaultClusterParameters field's value. -func (s *DescribeDefaultClusterParametersOutput) SetDefaultClusterParameters(v *DefaultClusterParameters) *DescribeDefaultClusterParametersOutput { - s.DefaultClusterParameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventCategoriesMessage -type DescribeEventCategoriesInput struct { - _ struct{} `type:"structure"` - - // The source type, such as cluster or parameter group, to which the described - // event categories apply. - // - // Valid values: cluster, cluster-snapshot, cluster-parameter-group, and cluster-security-group. - SourceType *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventCategoriesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventCategoriesInput) GoString() string { - return s.String() -} - -// SetSourceType sets the SourceType field's value. -func (s *DescribeEventCategoriesInput) SetSourceType(v string) *DescribeEventCategoriesInput { - s.SourceType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EventCategoriesMessage -type DescribeEventCategoriesOutput struct { - _ struct{} `type:"structure"` - - // A list of event categories descriptions. - EventCategoriesMapList []*EventCategoriesMap `locationNameList:"EventCategoriesMap" type:"list"` -} - -// String returns the string representation -func (s DescribeEventCategoriesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventCategoriesOutput) GoString() string { - return s.String() -} - -// SetEventCategoriesMapList sets the EventCategoriesMapList field's value. -func (s *DescribeEventCategoriesOutput) SetEventCategoriesMapList(v []*EventCategoriesMap) *DescribeEventCategoriesOutput { - s.EventCategoriesMapList = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventSubscriptionsMessage -type DescribeEventSubscriptionsInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeEventSubscriptions request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The name of the Amazon Redshift event notification subscription to be described. - SubscriptionName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventSubscriptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventSubscriptionsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventSubscriptionsInput) SetMarker(v string) *DescribeEventSubscriptionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEventSubscriptionsInput) SetMaxRecords(v int64) *DescribeEventSubscriptionsInput { - s.MaxRecords = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *DescribeEventSubscriptionsInput) SetSubscriptionName(v string) *DescribeEventSubscriptionsInput { - s.SubscriptionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EventSubscriptionsMessage -type DescribeEventSubscriptionsOutput struct { - _ struct{} `type:"structure"` - - // A list of event subscriptions. - EventSubscriptionsList []*EventSubscription `locationNameList:"EventSubscription" type:"list"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventSubscriptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventSubscriptionsOutput) GoString() string { - return s.String() -} - -// SetEventSubscriptionsList sets the EventSubscriptionsList field's value. -func (s *DescribeEventSubscriptionsOutput) SetEventSubscriptionsList(v []*EventSubscription) *DescribeEventSubscriptionsOutput { - s.EventSubscriptionsList = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventSubscriptionsOutput) SetMarker(v string) *DescribeEventSubscriptionsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEventsMessage -type DescribeEventsInput struct { - _ struct{} `type:"structure"` - - // The number of minutes prior to the time of the request for which to retrieve - // events. For example, if the request is sent at 18:00 and you specify a duration - // of 60, then only events which have occurred after 17:00 will be returned. - // - // Default: 60 - Duration *int64 `type:"integer"` - - // The end of the time interval for which to retrieve events, specified in ISO - // 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia - // page. (http://en.wikipedia.org/wiki/ISO_8601) - // - // Example: 2009-07-08T18:00Z - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeEvents request exceed the - // value specified in MaxRecords, AWS returns a value in the Marker field of - // the response. You can retrieve the next set of response records by providing - // the returned marker value in the Marker parameter and retrying the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The identifier of the event source for which events will be returned. If - // this parameter is not specified, then all sources are included in the response. - // - // Constraints: - // - // If SourceIdentifier is supplied, SourceType must also be provided. - // - // * Specify a cluster identifier when SourceType is cluster. - // - // * Specify a cluster security group name when SourceType is cluster-security-group. - // - // * Specify a cluster parameter group name when SourceType is cluster-parameter-group. - // - // * Specify a cluster snapshot identifier when SourceType is cluster-snapshot. - SourceIdentifier *string `type:"string"` - - // The event source to retrieve events for. If no value is specified, all events - // are returned. - // - // Constraints: - // - // If SourceType is supplied, SourceIdentifier must also be provided. - // - // * Specify cluster when SourceIdentifier is a cluster identifier. - // - // * Specify cluster-security-group when SourceIdentifier is a cluster security - // group name. - // - // * Specify cluster-parameter-group when SourceIdentifier is a cluster parameter - // group name. - // - // * Specify cluster-snapshot when SourceIdentifier is a cluster snapshot - // identifier. - SourceType *string `type:"string" enum:"SourceType"` - - // The beginning of the time interval to retrieve events for, specified in ISO - // 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia - // page. (http://en.wikipedia.org/wiki/ISO_8601) - // - // Example: 2009-07-08T18:00Z - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventsInput) GoString() string { - return s.String() -} - -// SetDuration sets the Duration field's value. -func (s *DescribeEventsInput) SetDuration(v int64) *DescribeEventsInput { - s.Duration = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeEventsInput) SetEndTime(v time.Time) *DescribeEventsInput { - s.EndTime = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventsInput) SetMarker(v string) *DescribeEventsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeEventsInput) SetMaxRecords(v int64) *DescribeEventsInput { - s.MaxRecords = &v - return s -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *DescribeEventsInput) SetSourceIdentifier(v string) *DescribeEventsInput { - s.SourceIdentifier = &v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *DescribeEventsInput) SetSourceType(v string) *DescribeEventsInput { - s.SourceType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeEventsInput) SetStartTime(v time.Time) *DescribeEventsInput { - s.StartTime = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EventsMessage -type DescribeEventsOutput struct { - _ struct{} `type:"structure"` - - // A list of Event instances. - Events []*Event `locationNameList:"Event" type:"list"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *DescribeEventsOutput) SetEvents(v []*Event) *DescribeEventsOutput { - s.Events = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeEventsOutput) SetMarker(v string) *DescribeEventsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeHsmClientCertificatesMessage -type DescribeHsmClientCertificatesInput struct { - _ struct{} `type:"structure"` - - // The identifier of a specific HSM client certificate for which you want information. - // If no identifier is specified, information is returned for all HSM client - // certificates owned by your AWS customer account. - HsmClientCertificateIdentifier *string `type:"string"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeHsmClientCertificates request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // A tag key or keys for which you want to return all matching HSM client certificates - // that are associated with the specified key or keys. For example, suppose - // that you have HSM client certificates that are tagged with keys called owner - // and environment. If you specify both of these tag keys in the request, Amazon - // Redshift returns a response with the HSM client certificates that have either - // or both of these tag keys associated with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching HSM client - // certificates that are associated with the specified tag value or values. - // For example, suppose that you have HSM client certificates that are tagged - // with values called admin and test. If you specify both of these tag values - // in the request, Amazon Redshift returns a response with the HSM client certificates - // that have either or both of these tag values associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// String returns the string representation -func (s DescribeHsmClientCertificatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHsmClientCertificatesInput) GoString() string { - return s.String() -} - -// SetHsmClientCertificateIdentifier sets the HsmClientCertificateIdentifier field's value. -func (s *DescribeHsmClientCertificatesInput) SetHsmClientCertificateIdentifier(v string) *DescribeHsmClientCertificatesInput { - s.HsmClientCertificateIdentifier = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeHsmClientCertificatesInput) SetMarker(v string) *DescribeHsmClientCertificatesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeHsmClientCertificatesInput) SetMaxRecords(v int64) *DescribeHsmClientCertificatesInput { - s.MaxRecords = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeHsmClientCertificatesInput) SetTagKeys(v []*string) *DescribeHsmClientCertificatesInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeHsmClientCertificatesInput) SetTagValues(v []*string) *DescribeHsmClientCertificatesInput { - s.TagValues = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/HsmClientCertificateMessage -type DescribeHsmClientCertificatesOutput struct { - _ struct{} `type:"structure"` - - // A list of the identifiers for one or more HSM client certificates used by - // Amazon Redshift clusters to store and retrieve database encryption keys in - // an HSM. - HsmClientCertificates []*HsmClientCertificate `locationNameList:"HsmClientCertificate" type:"list"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeHsmClientCertificatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHsmClientCertificatesOutput) GoString() string { - return s.String() -} - -// SetHsmClientCertificates sets the HsmClientCertificates field's value. -func (s *DescribeHsmClientCertificatesOutput) SetHsmClientCertificates(v []*HsmClientCertificate) *DescribeHsmClientCertificatesOutput { - s.HsmClientCertificates = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeHsmClientCertificatesOutput) SetMarker(v string) *DescribeHsmClientCertificatesOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeHsmConfigurationsMessage -type DescribeHsmConfigurationsInput struct { - _ struct{} `type:"structure"` - - // The identifier of a specific Amazon Redshift HSM configuration to be described. - // If no identifier is specified, information is returned for all HSM configurations - // owned by your AWS customer account. - HsmConfigurationIdentifier *string `type:"string"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeHsmConfigurations request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // A tag key or keys for which you want to return all matching HSM configurations - // that are associated with the specified key or keys. For example, suppose - // that you have HSM configurations that are tagged with keys called owner and - // environment. If you specify both of these tag keys in the request, Amazon - // Redshift returns a response with the HSM configurations that have either - // or both of these tag keys associated with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching HSM configurations - // that are associated with the specified tag value or values. For example, - // suppose that you have HSM configurations that are tagged with values called - // admin and test. If you specify both of these tag values in the request, Amazon - // Redshift returns a response with the HSM configurations that have either - // or both of these tag values associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// String returns the string representation -func (s DescribeHsmConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHsmConfigurationsInput) GoString() string { - return s.String() -} - -// SetHsmConfigurationIdentifier sets the HsmConfigurationIdentifier field's value. -func (s *DescribeHsmConfigurationsInput) SetHsmConfigurationIdentifier(v string) *DescribeHsmConfigurationsInput { - s.HsmConfigurationIdentifier = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeHsmConfigurationsInput) SetMarker(v string) *DescribeHsmConfigurationsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeHsmConfigurationsInput) SetMaxRecords(v int64) *DescribeHsmConfigurationsInput { - s.MaxRecords = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeHsmConfigurationsInput) SetTagKeys(v []*string) *DescribeHsmConfigurationsInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeHsmConfigurationsInput) SetTagValues(v []*string) *DescribeHsmConfigurationsInput { - s.TagValues = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/HsmConfigurationMessage -type DescribeHsmConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // A list of HsmConfiguration objects. - HsmConfigurations []*HsmConfiguration `locationNameList:"HsmConfiguration" type:"list"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` -} - -// String returns the string representation -func (s DescribeHsmConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHsmConfigurationsOutput) GoString() string { - return s.String() -} - -// SetHsmConfigurations sets the HsmConfigurations field's value. -func (s *DescribeHsmConfigurationsOutput) SetHsmConfigurations(v []*HsmConfiguration) *DescribeHsmConfigurationsOutput { - s.HsmConfigurations = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeHsmConfigurationsOutput) SetMarker(v string) *DescribeHsmConfigurationsOutput { - s.Marker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeLoggingStatusMessage -type DescribeLoggingStatusInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster from which to get the logging status. - // - // Example: examplecluster - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeLoggingStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLoggingStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLoggingStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLoggingStatusInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *DescribeLoggingStatusInput) SetClusterIdentifier(v string) *DescribeLoggingStatusInput { - s.ClusterIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeOrderableClusterOptionsMessage -type DescribeOrderableClusterOptionsInput struct { - _ struct{} `type:"structure"` - - // The version filter value. Specify this parameter to show only the available - // offerings matching the specified version. - // - // Default: All versions. - // - // Constraints: Must be one of the version returned from DescribeClusterVersions. - ClusterVersion *string `type:"string"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeOrderableClusterOptions request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The node type filter value. Specify this parameter to show only the available - // offerings matching the specified node type. - NodeType *string `type:"string"` -} - -// String returns the string representation -func (s DescribeOrderableClusterOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOrderableClusterOptionsInput) GoString() string { - return s.String() -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *DescribeOrderableClusterOptionsInput) SetClusterVersion(v string) *DescribeOrderableClusterOptionsInput { - s.ClusterVersion = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOrderableClusterOptionsInput) SetMarker(v string) *DescribeOrderableClusterOptionsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeOrderableClusterOptionsInput) SetMaxRecords(v int64) *DescribeOrderableClusterOptionsInput { - s.MaxRecords = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *DescribeOrderableClusterOptionsInput) SetNodeType(v string) *DescribeOrderableClusterOptionsInput { - s.NodeType = &v - return s -} - -// Contains the output from the DescribeOrderableClusterOptions action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/OrderableClusterOptionsMessage -type DescribeOrderableClusterOptionsOutput struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // An OrderableClusterOption structure containing information about orderable - // options for the cluster. - OrderableClusterOptions []*OrderableClusterOption `locationNameList:"OrderableClusterOption" type:"list"` -} - -// String returns the string representation -func (s DescribeOrderableClusterOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeOrderableClusterOptionsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeOrderableClusterOptionsOutput) SetMarker(v string) *DescribeOrderableClusterOptionsOutput { - s.Marker = &v - return s -} - -// SetOrderableClusterOptions sets the OrderableClusterOptions field's value. -func (s *DescribeOrderableClusterOptionsOutput) SetOrderableClusterOptions(v []*OrderableClusterOption) *DescribeOrderableClusterOptionsOutput { - s.OrderableClusterOptions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeReservedNodeOfferingsMessage -type DescribeReservedNodeOfferingsInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeReservedNodeOfferings request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The unique identifier for the offering. - ReservedNodeOfferingId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeReservedNodeOfferingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedNodeOfferingsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedNodeOfferingsInput) SetMarker(v string) *DescribeReservedNodeOfferingsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReservedNodeOfferingsInput) SetMaxRecords(v int64) *DescribeReservedNodeOfferingsInput { - s.MaxRecords = &v - return s -} - -// SetReservedNodeOfferingId sets the ReservedNodeOfferingId field's value. -func (s *DescribeReservedNodeOfferingsInput) SetReservedNodeOfferingId(v string) *DescribeReservedNodeOfferingsInput { - s.ReservedNodeOfferingId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ReservedNodeOfferingsMessage -type DescribeReservedNodeOfferingsOutput struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // A list of ReservedNodeOffering objects. - ReservedNodeOfferings []*ReservedNodeOffering `locationNameList:"ReservedNodeOffering" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedNodeOfferingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedNodeOfferingsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedNodeOfferingsOutput) SetMarker(v string) *DescribeReservedNodeOfferingsOutput { - s.Marker = &v - return s -} - -// SetReservedNodeOfferings sets the ReservedNodeOfferings field's value. -func (s *DescribeReservedNodeOfferingsOutput) SetReservedNodeOfferings(v []*ReservedNodeOffering) *DescribeReservedNodeOfferingsOutput { - s.ReservedNodeOfferings = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeReservedNodesMessage -type DescribeReservedNodesInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeReservedNodes request exceed - // the value specified in MaxRecords, AWS returns a value in the Marker field - // of the response. You can retrieve the next set of response records by providing - // the returned marker value in the Marker parameter and retrying the request. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // Identifier for the node reservation. - ReservedNodeId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeReservedNodesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedNodesInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedNodesInput) SetMarker(v string) *DescribeReservedNodesInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeReservedNodesInput) SetMaxRecords(v int64) *DescribeReservedNodesInput { - s.MaxRecords = &v - return s -} - -// SetReservedNodeId sets the ReservedNodeId field's value. -func (s *DescribeReservedNodesInput) SetReservedNodeId(v string) *DescribeReservedNodesInput { - s.ReservedNodeId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ReservedNodesMessage -type DescribeReservedNodesOutput struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // The list of ReservedNode objects. - ReservedNodes []*ReservedNode `locationNameList:"ReservedNode" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedNodesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedNodesOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeReservedNodesOutput) SetMarker(v string) *DescribeReservedNodesOutput { - s.Marker = &v - return s -} - -// SetReservedNodes sets the ReservedNodes field's value. -func (s *DescribeReservedNodesOutput) SetReservedNodes(v []*ReservedNode) *DescribeReservedNodesOutput { - s.ReservedNodes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeResizeMessage -type DescribeResizeInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of a cluster whose resize progress you are requesting. - // This parameter is case-sensitive. - // - // By default, resize operations for all clusters defined for an AWS account - // are returned. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeResizeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeResizeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeResizeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeResizeInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *DescribeResizeInput) SetClusterIdentifier(v string) *DescribeResizeInput { - s.ClusterIdentifier = &v - return s -} - -// Describes the result of a cluster resize operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ResizeProgressMessage -type DescribeResizeOutput struct { - _ struct{} `type:"structure"` - - // The average rate of the resize operation over the last few minutes, measured - // in megabytes per second. After the resize operation completes, this value - // shows the average rate of the entire resize operation. - AvgResizeRateInMegaBytesPerSecond *float64 `type:"double"` - - // The amount of seconds that have elapsed since the resize operation began. - // After the resize operation completes, this value shows the total actual time, - // in seconds, for the resize operation. - ElapsedTimeInSeconds *int64 `type:"long"` - - // The estimated time remaining, in seconds, until the resize operation is complete. - // This value is calculated based on the average resize rate and the estimated - // amount of data remaining to be processed. Once the resize operation is complete, - // this value will be 0. - EstimatedTimeToCompletionInSeconds *int64 `type:"long"` - - // The names of tables that have been completely imported . - // - // Valid Values: List of table names. - ImportTablesCompleted []*string `type:"list"` - - // The names of tables that are being currently imported. - // - // Valid Values: List of table names. - ImportTablesInProgress []*string `type:"list"` - - // The names of tables that have not been yet imported. - // - // Valid Values: List of table names - ImportTablesNotStarted []*string `type:"list"` - - // While the resize operation is in progress, this value shows the current amount - // of data, in megabytes, that has been processed so far. When the resize operation - // is complete, this value shows the total amount of data, in megabytes, on - // the cluster, which may be more or less than TotalResizeDataInMegaBytes (the - // estimated total amount of data before resize). - ProgressInMegaBytes *int64 `type:"long"` - - // The status of the resize operation. - // - // Valid Values: NONE | IN_PROGRESS | FAILED | SUCCEEDED - Status *string `type:"string"` - - // The cluster type after the resize operation is complete. - // - // Valid Values: multi-node | single-node - TargetClusterType *string `type:"string"` - - // The node type that the cluster will have after the resize operation is complete. - TargetNodeType *string `type:"string"` - - // The number of nodes that the cluster will have after the resize operation - // is complete. - TargetNumberOfNodes *int64 `type:"integer"` - - // The estimated total amount of data, in megabytes, on the cluster before the - // resize operation began. - TotalResizeDataInMegaBytes *int64 `type:"long"` -} - -// String returns the string representation -func (s DescribeResizeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeResizeOutput) GoString() string { - return s.String() -} - -// SetAvgResizeRateInMegaBytesPerSecond sets the AvgResizeRateInMegaBytesPerSecond field's value. -func (s *DescribeResizeOutput) SetAvgResizeRateInMegaBytesPerSecond(v float64) *DescribeResizeOutput { - s.AvgResizeRateInMegaBytesPerSecond = &v - return s -} - -// SetElapsedTimeInSeconds sets the ElapsedTimeInSeconds field's value. -func (s *DescribeResizeOutput) SetElapsedTimeInSeconds(v int64) *DescribeResizeOutput { - s.ElapsedTimeInSeconds = &v - return s -} - -// SetEstimatedTimeToCompletionInSeconds sets the EstimatedTimeToCompletionInSeconds field's value. -func (s *DescribeResizeOutput) SetEstimatedTimeToCompletionInSeconds(v int64) *DescribeResizeOutput { - s.EstimatedTimeToCompletionInSeconds = &v - return s -} - -// SetImportTablesCompleted sets the ImportTablesCompleted field's value. -func (s *DescribeResizeOutput) SetImportTablesCompleted(v []*string) *DescribeResizeOutput { - s.ImportTablesCompleted = v - return s -} - -// SetImportTablesInProgress sets the ImportTablesInProgress field's value. -func (s *DescribeResizeOutput) SetImportTablesInProgress(v []*string) *DescribeResizeOutput { - s.ImportTablesInProgress = v - return s -} - -// SetImportTablesNotStarted sets the ImportTablesNotStarted field's value. -func (s *DescribeResizeOutput) SetImportTablesNotStarted(v []*string) *DescribeResizeOutput { - s.ImportTablesNotStarted = v - return s -} - -// SetProgressInMegaBytes sets the ProgressInMegaBytes field's value. -func (s *DescribeResizeOutput) SetProgressInMegaBytes(v int64) *DescribeResizeOutput { - s.ProgressInMegaBytes = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeResizeOutput) SetStatus(v string) *DescribeResizeOutput { - s.Status = &v - return s -} - -// SetTargetClusterType sets the TargetClusterType field's value. -func (s *DescribeResizeOutput) SetTargetClusterType(v string) *DescribeResizeOutput { - s.TargetClusterType = &v - return s -} - -// SetTargetNodeType sets the TargetNodeType field's value. -func (s *DescribeResizeOutput) SetTargetNodeType(v string) *DescribeResizeOutput { - s.TargetNodeType = &v - return s -} - -// SetTargetNumberOfNodes sets the TargetNumberOfNodes field's value. -func (s *DescribeResizeOutput) SetTargetNumberOfNodes(v int64) *DescribeResizeOutput { - s.TargetNumberOfNodes = &v - return s -} - -// SetTotalResizeDataInMegaBytes sets the TotalResizeDataInMegaBytes field's value. -func (s *DescribeResizeOutput) SetTotalResizeDataInMegaBytes(v int64) *DescribeResizeOutput { - s.TotalResizeDataInMegaBytes = &v - return s -} - -// The result of the DescribeSnapshotCopyGrants action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeSnapshotCopyGrantsMessage -type DescribeSnapshotCopyGrantsInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeSnapshotCopyGrant request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - // - // Constraints: You can specify either the SnapshotCopyGrantName parameter or - // the Marker parameter, but not both. - Marker *string `type:"string"` - - // The maximum number of response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - // - // Default: 100 - // - // Constraints: minimum 20, maximum 100. - MaxRecords *int64 `type:"integer"` - - // The name of the snapshot copy grant. - SnapshotCopyGrantName *string `type:"string"` - - // A tag key or keys for which you want to return all matching resources that - // are associated with the specified key or keys. For example, suppose that - // you have resources tagged with keys called owner and environment. If you - // specify both of these tag keys in the request, Amazon Redshift returns a - // response with all resources that have either or both of these tag keys associated - // with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching resources - // that are associated with the specified value or values. For example, suppose - // that you have resources tagged with values called admin and test. If you - // specify both of these tag values in the request, Amazon Redshift returns - // a response with all resources that have either or both of these tag values - // associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// String returns the string representation -func (s DescribeSnapshotCopyGrantsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotCopyGrantsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSnapshotCopyGrantsInput) SetMarker(v string) *DescribeSnapshotCopyGrantsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeSnapshotCopyGrantsInput) SetMaxRecords(v int64) *DescribeSnapshotCopyGrantsInput { - s.MaxRecords = &v - return s -} - -// SetSnapshotCopyGrantName sets the SnapshotCopyGrantName field's value. -func (s *DescribeSnapshotCopyGrantsInput) SetSnapshotCopyGrantName(v string) *DescribeSnapshotCopyGrantsInput { - s.SnapshotCopyGrantName = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeSnapshotCopyGrantsInput) SetTagKeys(v []*string) *DescribeSnapshotCopyGrantsInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeSnapshotCopyGrantsInput) SetTagValues(v []*string) *DescribeSnapshotCopyGrantsInput { - s.TagValues = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/SnapshotCopyGrantMessage -type DescribeSnapshotCopyGrantsOutput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeSnapshotCopyGrant request - // exceed the value specified in MaxRecords, AWS returns a value in the Marker - // field of the response. You can retrieve the next set of response records - // by providing the returned marker value in the Marker parameter and retrying - // the request. - // - // Constraints: You can specify either the SnapshotCopyGrantName parameter or - // the Marker parameter, but not both. - Marker *string `type:"string"` - - // The list of SnapshotCopyGrant objects. - SnapshotCopyGrants []*SnapshotCopyGrant `locationNameList:"SnapshotCopyGrant" type:"list"` -} - -// String returns the string representation -func (s DescribeSnapshotCopyGrantsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotCopyGrantsOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeSnapshotCopyGrantsOutput) SetMarker(v string) *DescribeSnapshotCopyGrantsOutput { - s.Marker = &v - return s -} - -// SetSnapshotCopyGrants sets the SnapshotCopyGrants field's value. -func (s *DescribeSnapshotCopyGrantsOutput) SetSnapshotCopyGrants(v []*SnapshotCopyGrant) *DescribeSnapshotCopyGrantsOutput { - s.SnapshotCopyGrants = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeTableRestoreStatusMessage -type DescribeTableRestoreStatusInput struct { - _ struct{} `type:"structure"` - - // The Amazon Redshift cluster that the table is being restored to. - ClusterIdentifier *string `type:"string"` - - // An optional pagination token provided by a previous DescribeTableRestoreStatus - // request. If this parameter is specified, the response includes only records - // beyond the marker, up to the value specified by the MaxRecords parameter. - Marker *string `type:"string"` - - // The maximum number of records to include in the response. If more records - // exist than the specified MaxRecords value, a pagination token called a marker - // is included in the response so that the remaining results can be retrieved. - MaxRecords *int64 `type:"integer"` - - // The identifier of the table restore request to return status for. If you - // don't specify a TableRestoreRequestId value, then DescribeTableRestoreStatus - // returns the status of all in-progress table restore requests. - TableRestoreRequestId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeTableRestoreStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTableRestoreStatusInput) GoString() string { - return s.String() -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *DescribeTableRestoreStatusInput) SetClusterIdentifier(v string) *DescribeTableRestoreStatusInput { - s.ClusterIdentifier = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTableRestoreStatusInput) SetMarker(v string) *DescribeTableRestoreStatusInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeTableRestoreStatusInput) SetMaxRecords(v int64) *DescribeTableRestoreStatusInput { - s.MaxRecords = &v - return s -} - -// SetTableRestoreRequestId sets the TableRestoreRequestId field's value. -func (s *DescribeTableRestoreStatusInput) SetTableRestoreRequestId(v string) *DescribeTableRestoreStatusInput { - s.TableRestoreRequestId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/TableRestoreStatusMessage -type DescribeTableRestoreStatusOutput struct { - _ struct{} `type:"structure"` - - // A pagination token that can be used in a subsequent DescribeTableRestoreStatus - // request. - Marker *string `type:"string"` - - // A list of status details for one or more table restore requests. - TableRestoreStatusDetails []*TableRestoreStatus `locationNameList:"TableRestoreStatus" type:"list"` -} - -// String returns the string representation -func (s DescribeTableRestoreStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTableRestoreStatusOutput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTableRestoreStatusOutput) SetMarker(v string) *DescribeTableRestoreStatusOutput { - s.Marker = &v - return s -} - -// SetTableRestoreStatusDetails sets the TableRestoreStatusDetails field's value. -func (s *DescribeTableRestoreStatusOutput) SetTableRestoreStatusDetails(v []*TableRestoreStatus) *DescribeTableRestoreStatusOutput { - s.TableRestoreStatusDetails = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeTagsMessage -type DescribeTagsInput struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the marker - // parameter and retrying the command. If the marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // The maximum number or response records to return in each call. If the number - // of remaining response records exceeds the specified MaxRecords value, a value - // is returned in a marker field of the response. You can retrieve the next - // set of records by retrying the command with the returned marker value. - MaxRecords *int64 `type:"integer"` - - // The Amazon Resource Name (ARN) for which you want to describe the tag or - // tags. For example, arn:aws:redshift:us-east-1:123456789:cluster:t1. - ResourceName *string `type:"string"` - - // The type of resource with which you want to view tags. Valid resource types - // are: - // - // * Cluster - // - // * CIDR/IP - // - // * EC2 security group - // - // * Snapshot - // - // * Cluster security group - // - // * Subnet group - // - // * HSM connection - // - // * HSM certificate - // - // * Parameter group - // - // * Snapshot copy grant - // - // For more information about Amazon Redshift resource types and constructing - // ARNs, go to Constructing an Amazon Redshift Amazon Resource Name (ARN) (http://docs.aws.amazon.com/redshift/latest/mgmt/constructing-redshift-arn.html) - // in the Amazon Redshift Cluster Management Guide. - ResourceType *string `type:"string"` - - // A tag key or keys for which you want to return all matching resources that - // are associated with the specified key or keys. For example, suppose that - // you have resources tagged with keys called owner and environment. If you - // specify both of these tag keys in the request, Amazon Redshift returns a - // response with all resources that have either or both of these tag keys associated - // with them. - TagKeys []*string `locationNameList:"TagKey" type:"list"` - - // A tag value or values for which you want to return all matching resources - // that are associated with the specified value or values. For example, suppose - // that you have resources tagged with values called admin and test. If you - // specify both of these tag values in the request, Amazon Redshift returns - // a response with all resources that have either or both of these tag values - // associated with them. - TagValues []*string `locationNameList:"TagValue" type:"list"` -} - -// 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() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTagsInput) SetMarker(v string) *DescribeTagsInput { - s.Marker = &v - return s -} - -// SetMaxRecords sets the MaxRecords field's value. -func (s *DescribeTagsInput) SetMaxRecords(v int64) *DescribeTagsInput { - s.MaxRecords = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *DescribeTagsInput) SetResourceName(v string) *DescribeTagsInput { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *DescribeTagsInput) SetResourceType(v string) *DescribeTagsInput { - s.ResourceType = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DescribeTagsInput) SetTagKeys(v []*string) *DescribeTagsInput { - s.TagKeys = v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *DescribeTagsInput) SetTagValues(v []*string) *DescribeTagsInput { - s.TagValues = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/TaggedResourceListMessage -type DescribeTagsOutput struct { - _ struct{} `type:"structure"` - - // A value that indicates the starting point for the next set of response records - // in a subsequent request. If a value is returned in a response, you can retrieve - // the next set of records by providing this returned marker value in the Marker - // parameter and retrying the command. If the Marker field is empty, all response - // records have been retrieved for the request. - Marker *string `type:"string"` - - // A list of tags with their associated resources. - TaggedResources []*TaggedResource `locationNameList:"TaggedResource" 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() -} - -// SetMarker sets the Marker field's value. -func (s *DescribeTagsOutput) SetMarker(v string) *DescribeTagsOutput { - s.Marker = &v - return s -} - -// SetTaggedResources sets the TaggedResources field's value. -func (s *DescribeTagsOutput) SetTaggedResources(v []*TaggedResource) *DescribeTagsOutput { - s.TaggedResources = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableLoggingMessage -type DisableLoggingInput struct { - _ struct{} `type:"structure"` - - // The identifier of the cluster on which logging is to be stopped. - // - // Example: examplecluster - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableLoggingInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *DisableLoggingInput) SetClusterIdentifier(v string) *DisableLoggingInput { - s.ClusterIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableSnapshotCopyMessage -type DisableSnapshotCopyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the source cluster that you want to disable copying - // of snapshots to a destination region. - // - // Constraints: Must be the valid name of an existing cluster that has cross-region - // snapshot copy enabled. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableSnapshotCopyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableSnapshotCopyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableSnapshotCopyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableSnapshotCopyInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *DisableSnapshotCopyInput) SetClusterIdentifier(v string) *DisableSnapshotCopyInput { - s.ClusterIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DisableSnapshotCopyResult -type DisableSnapshotCopyOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s DisableSnapshotCopyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableSnapshotCopyOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *DisableSnapshotCopyOutput) SetCluster(v *Cluster) *DisableSnapshotCopyOutput { - s.Cluster = v - return s -} - -// Describes an Amazon EC2 security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EC2SecurityGroup -type EC2SecurityGroup struct { - _ struct{} `type:"structure"` - - // The name of the EC2 Security Group. - EC2SecurityGroupName *string `type:"string"` - - // The AWS ID of the owner of the EC2 security group specified in the EC2SecurityGroupName - // field. - EC2SecurityGroupOwnerId *string `type:"string"` - - // The status of the EC2 security group. - Status *string `type:"string"` - - // The list of tags for the EC2 security group. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s EC2SecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EC2SecurityGroup) GoString() string { - return s.String() -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *EC2SecurityGroup) SetEC2SecurityGroupName(v string) *EC2SecurityGroup { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *EC2SecurityGroup) SetEC2SecurityGroupOwnerId(v string) *EC2SecurityGroup { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EC2SecurityGroup) SetStatus(v string) *EC2SecurityGroup { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *EC2SecurityGroup) SetTags(v []*Tag) *EC2SecurityGroup { - s.Tags = v - return s -} - -// Describes the status of the elastic IP (EIP) address. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ElasticIpStatus -type ElasticIpStatus struct { - _ struct{} `type:"structure"` - - // The elastic IP (EIP) address for the cluster. - ElasticIp *string `type:"string"` - - // The status of the elastic IP (EIP) address. - Status *string `type:"string"` -} - -// String returns the string representation -func (s ElasticIpStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticIpStatus) GoString() string { - return s.String() -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *ElasticIpStatus) SetElasticIp(v string) *ElasticIpStatus { - s.ElasticIp = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ElasticIpStatus) SetStatus(v string) *ElasticIpStatus { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableLoggingMessage -type EnableLoggingInput struct { - _ struct{} `type:"structure"` - - // The name of an existing S3 bucket where the log files are to be stored. - // - // Constraints: - // - // * Must be in the same region as the cluster - // - // * The cluster must have read bucket and put object permissions - // - // BucketName is a required field - BucketName *string `type:"string" required:"true"` - - // The identifier of the cluster on which logging is to be started. - // - // Example: examplecluster - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // The prefix applied to the log file names. - // - // Constraints: - // - // * Cannot exceed 512 characters - // - // * Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash - // (\), or control characters. The hexadecimal codes for invalid characters - // are: - // - // x00 to x20 - // - // x22 - // - // x27 - // - // x5c - // - // x7f or larger - S3KeyPrefix *string `type:"string"` -} - -// String returns the string representation -func (s EnableLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableLoggingInput"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *EnableLoggingInput) SetBucketName(v string) *EnableLoggingInput { - s.BucketName = &v - return s -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *EnableLoggingInput) SetClusterIdentifier(v string) *EnableLoggingInput { - s.ClusterIdentifier = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *EnableLoggingInput) SetS3KeyPrefix(v string) *EnableLoggingInput { - s.S3KeyPrefix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableSnapshotCopyMessage -type EnableSnapshotCopyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the source cluster to copy snapshots from. - // - // Constraints: Must be the valid name of an existing cluster that does not - // already have cross-region snapshot copy enabled. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // The destination region that you want to copy snapshots to. - // - // Constraints: Must be the name of a valid region. For more information, see - // Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region) - // in the Amazon Web Services General Reference. - // - // DestinationRegion is a required field - DestinationRegion *string `type:"string" required:"true"` - - // The number of days to retain automated snapshots in the destination region - // after they are copied from the source region. - // - // Default: 7. - // - // Constraints: Must be at least 1 and no more than 35. - RetentionPeriod *int64 `type:"integer"` - - // The name of the snapshot copy grant to use when snapshots of an AWS KMS-encrypted - // cluster are copied to the destination region. - SnapshotCopyGrantName *string `type:"string"` -} - -// String returns the string representation -func (s EnableSnapshotCopyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableSnapshotCopyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableSnapshotCopyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableSnapshotCopyInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - if s.DestinationRegion == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationRegion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *EnableSnapshotCopyInput) SetClusterIdentifier(v string) *EnableSnapshotCopyInput { - s.ClusterIdentifier = &v - return s -} - -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *EnableSnapshotCopyInput) SetDestinationRegion(v string) *EnableSnapshotCopyInput { - s.DestinationRegion = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *EnableSnapshotCopyInput) SetRetentionPeriod(v int64) *EnableSnapshotCopyInput { - s.RetentionPeriod = &v - return s -} - -// SetSnapshotCopyGrantName sets the SnapshotCopyGrantName field's value. -func (s *EnableSnapshotCopyInput) SetSnapshotCopyGrantName(v string) *EnableSnapshotCopyInput { - s.SnapshotCopyGrantName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EnableSnapshotCopyResult -type EnableSnapshotCopyOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s EnableSnapshotCopyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableSnapshotCopyOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *EnableSnapshotCopyOutput) SetCluster(v *Cluster) *EnableSnapshotCopyOutput { - s.Cluster = v - return s -} - -// Describes a connection endpoint. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/Endpoint -type Endpoint struct { - _ struct{} `type:"structure"` - - // The DNS address of the Cluster. - Address *string `type:"string"` - - // The port that the database engine is listening on. - Port *int64 `type:"integer"` -} - -// String returns the string representation -func (s Endpoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Endpoint) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *Endpoint) SetAddress(v string) *Endpoint { - s.Address = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Endpoint) SetPort(v int64) *Endpoint { - s.Port = &v - return s -} - -// Describes an event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/Event -type Event struct { - _ struct{} `type:"structure"` - - // The date and time of the event. - Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A list of the event categories. - // - // Values: Configuration, Management, Monitoring, Security - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // The identifier of the event. - EventId *string `type:"string"` - - // The text of this event. - Message *string `type:"string"` - - // The severity of the event. - // - // Values: ERROR, INFO - Severity *string `type:"string"` - - // The identifier for the source of the event. - SourceIdentifier *string `type:"string"` - - // The source type for this event. - SourceType *string `type:"string" enum:"SourceType"` -} - -// String returns the string representation -func (s Event) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Event) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *Event) SetDate(v time.Time) *Event { - s.Date = &v - return s -} - -// SetEventCategories sets the EventCategories field's value. -func (s *Event) SetEventCategories(v []*string) *Event { - s.EventCategories = v - return s -} - -// SetEventId sets the EventId field's value. -func (s *Event) SetEventId(v string) *Event { - s.EventId = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *Event) SetMessage(v string) *Event { - s.Message = &v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *Event) SetSeverity(v string) *Event { - s.Severity = &v - return s -} - -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *Event) SetSourceIdentifier(v string) *Event { - s.SourceIdentifier = &v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *Event) SetSourceType(v string) *Event { - s.SourceType = &v - return s -} - -// Describes event categories. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EventCategoriesMap -type EventCategoriesMap struct { - _ struct{} `type:"structure"` - - // The events in the event category. - Events []*EventInfoMap `locationNameList:"EventInfoMap" type:"list"` - - // The source type, such as cluster or cluster-snapshot, that the returned categories - // belong to. - SourceType *string `type:"string"` -} - -// String returns the string representation -func (s EventCategoriesMap) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventCategoriesMap) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *EventCategoriesMap) SetEvents(v []*EventInfoMap) *EventCategoriesMap { - s.Events = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *EventCategoriesMap) SetSourceType(v string) *EventCategoriesMap { - s.SourceType = &v - return s -} - -// Describes event information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EventInfoMap -type EventInfoMap struct { - _ struct{} `type:"structure"` - - // The category of an Amazon Redshift event. - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // The description of an Amazon Redshift event. - EventDescription *string `type:"string"` - - // The identifier of an Amazon Redshift event. - EventId *string `type:"string"` - - // The severity of the event. - // - // Values: ERROR, INFO - Severity *string `type:"string"` -} - -// String returns the string representation -func (s EventInfoMap) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventInfoMap) GoString() string { - return s.String() -} - -// SetEventCategories sets the EventCategories field's value. -func (s *EventInfoMap) SetEventCategories(v []*string) *EventInfoMap { - s.EventCategories = v - return s -} - -// SetEventDescription sets the EventDescription field's value. -func (s *EventInfoMap) SetEventDescription(v string) *EventInfoMap { - s.EventDescription = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *EventInfoMap) SetEventId(v string) *EventInfoMap { - s.EventId = &v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *EventInfoMap) SetSeverity(v string) *EventInfoMap { - s.Severity = &v - return s -} - -// Describes event subscriptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/EventSubscription -type EventSubscription struct { - _ struct{} `type:"structure"` - - // The name of the Amazon Redshift event notification subscription. - CustSubscriptionId *string `type:"string"` - - // The AWS customer account associated with the Amazon Redshift event notification - // subscription. - CustomerAwsId *string `type:"string"` - - // A Boolean value indicating whether the subscription is enabled. true indicates - // the subscription is enabled. - Enabled *bool `type:"boolean"` - - // The list of Amazon Redshift event categories specified in the event notification - // subscription. - // - // Values: Configuration, Management, Monitoring, Security - EventCategoriesList []*string `locationNameList:"EventCategory" type:"list"` - - // The event severity specified in the Amazon Redshift event notification subscription. - // - // Values: ERROR, INFO - Severity *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic used by the event - // notification subscription. - SnsTopicArn *string `type:"string"` - - // A list of the sources that publish events to the Amazon Redshift event notification - // subscription. - SourceIdsList []*string `locationNameList:"SourceId" type:"list"` - - // The source type of the events returned the Amazon Redshift event notification, - // such as cluster, or cluster-snapshot. - SourceType *string `type:"string"` - - // The status of the Amazon Redshift event notification subscription. - // - // Constraints: - // - // * Can be one of the following: active | no-permission | topic-not-exist - // - // * The status "no-permission" indicates that Amazon Redshift no longer - // has permission to post to the Amazon SNS topic. The status "topic-not-exist" - // indicates that the topic was deleted after the subscription was created. - Status *string `type:"string"` - - // The date and time the Amazon Redshift event notification subscription was - // created. - SubscriptionCreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The list of tags for the event subscription. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s EventSubscription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventSubscription) GoString() string { - return s.String() -} - -// SetCustSubscriptionId sets the CustSubscriptionId field's value. -func (s *EventSubscription) SetCustSubscriptionId(v string) *EventSubscription { - s.CustSubscriptionId = &v - return s -} - -// SetCustomerAwsId sets the CustomerAwsId field's value. -func (s *EventSubscription) SetCustomerAwsId(v string) *EventSubscription { - s.CustomerAwsId = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *EventSubscription) SetEnabled(v bool) *EventSubscription { - s.Enabled = &v - return s -} - -// SetEventCategoriesList sets the EventCategoriesList field's value. -func (s *EventSubscription) SetEventCategoriesList(v []*string) *EventSubscription { - s.EventCategoriesList = v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *EventSubscription) SetSeverity(v string) *EventSubscription { - s.Severity = &v - return s -} - -// SetSnsTopicArn sets the SnsTopicArn field's value. -func (s *EventSubscription) SetSnsTopicArn(v string) *EventSubscription { - s.SnsTopicArn = &v - return s -} - -// SetSourceIdsList sets the SourceIdsList field's value. -func (s *EventSubscription) SetSourceIdsList(v []*string) *EventSubscription { - s.SourceIdsList = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *EventSubscription) SetSourceType(v string) *EventSubscription { - s.SourceType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EventSubscription) SetStatus(v string) *EventSubscription { - s.Status = &v - return s -} - -// SetSubscriptionCreationTime sets the SubscriptionCreationTime field's value. -func (s *EventSubscription) SetSubscriptionCreationTime(v time.Time) *EventSubscription { - s.SubscriptionCreationTime = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *EventSubscription) SetTags(v []*Tag) *EventSubscription { - s.Tags = v - return s -} - -// Returns information about an HSM client certificate. The certificate is stored -// in a secure Hardware Storage Module (HSM), and used by the Amazon Redshift -// cluster to encrypt data files. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/HsmClientCertificate -type HsmClientCertificate struct { - _ struct{} `type:"structure"` - - // The identifier of the HSM client certificate. - HsmClientCertificateIdentifier *string `type:"string"` - - // The public key that the Amazon Redshift cluster will use to connect to the - // HSM. You must register the public key in the HSM. - HsmClientCertificatePublicKey *string `type:"string"` - - // The list of tags for the HSM client certificate. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s HsmClientCertificate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HsmClientCertificate) GoString() string { - return s.String() -} - -// SetHsmClientCertificateIdentifier sets the HsmClientCertificateIdentifier field's value. -func (s *HsmClientCertificate) SetHsmClientCertificateIdentifier(v string) *HsmClientCertificate { - s.HsmClientCertificateIdentifier = &v - return s -} - -// SetHsmClientCertificatePublicKey sets the HsmClientCertificatePublicKey field's value. -func (s *HsmClientCertificate) SetHsmClientCertificatePublicKey(v string) *HsmClientCertificate { - s.HsmClientCertificatePublicKey = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *HsmClientCertificate) SetTags(v []*Tag) *HsmClientCertificate { - s.Tags = v - return s -} - -// Returns information about an HSM configuration, which is an object that describes -// to Amazon Redshift clusters the information they require to connect to an -// HSM where they can store database encryption keys. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/HsmConfiguration -type HsmConfiguration struct { - _ struct{} `type:"structure"` - - // A text description of the HSM configuration. - Description *string `type:"string"` - - // The name of the Amazon Redshift HSM configuration. - HsmConfigurationIdentifier *string `type:"string"` - - // The IP address that the Amazon Redshift cluster must use to access the HSM. - HsmIpAddress *string `type:"string"` - - // The name of the partition in the HSM where the Amazon Redshift clusters will - // store their database encryption keys. - HsmPartitionName *string `type:"string"` - - // The list of tags for the HSM configuration. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s HsmConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HsmConfiguration) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *HsmConfiguration) SetDescription(v string) *HsmConfiguration { - s.Description = &v - return s -} - -// SetHsmConfigurationIdentifier sets the HsmConfigurationIdentifier field's value. -func (s *HsmConfiguration) SetHsmConfigurationIdentifier(v string) *HsmConfiguration { - s.HsmConfigurationIdentifier = &v - return s -} - -// SetHsmIpAddress sets the HsmIpAddress field's value. -func (s *HsmConfiguration) SetHsmIpAddress(v string) *HsmConfiguration { - s.HsmIpAddress = &v - return s -} - -// SetHsmPartitionName sets the HsmPartitionName field's value. -func (s *HsmConfiguration) SetHsmPartitionName(v string) *HsmConfiguration { - s.HsmPartitionName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *HsmConfiguration) SetTags(v []*Tag) *HsmConfiguration { - s.Tags = v - return s -} - -// Describes the status of changes to HSM settings. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/HsmStatus -type HsmStatus struct { - _ struct{} `type:"structure"` - - // Specifies the name of the HSM client certificate the Amazon Redshift cluster - // uses to retrieve the data encryption keys stored in an HSM. - HsmClientCertificateIdentifier *string `type:"string"` - - // Specifies the name of the HSM configuration that contains the information - // the Amazon Redshift cluster can use to retrieve and store keys in an HSM. - HsmConfigurationIdentifier *string `type:"string"` - - // Reports whether the Amazon Redshift cluster has finished applying any HSM - // settings changes specified in a modify cluster command. - // - // Values: active, applying - Status *string `type:"string"` -} - -// String returns the string representation -func (s HsmStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HsmStatus) GoString() string { - return s.String() -} - -// SetHsmClientCertificateIdentifier sets the HsmClientCertificateIdentifier field's value. -func (s *HsmStatus) SetHsmClientCertificateIdentifier(v string) *HsmStatus { - s.HsmClientCertificateIdentifier = &v - return s -} - -// SetHsmConfigurationIdentifier sets the HsmConfigurationIdentifier field's value. -func (s *HsmStatus) SetHsmConfigurationIdentifier(v string) *HsmStatus { - s.HsmConfigurationIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *HsmStatus) SetStatus(v string) *HsmStatus { - s.Status = &v - return s -} - -// Describes an IP range used in a security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/IPRange -type IPRange struct { - _ struct{} `type:"structure"` - - // The IP range in Classless Inter-Domain Routing (CIDR) notation. - CIDRIP *string `type:"string"` - - // The status of the IP range, for example, "authorized". - Status *string `type:"string"` - - // The list of tags for the IP range. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// 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 -} - -// SetStatus sets the Status field's value. -func (s *IPRange) SetStatus(v string) *IPRange { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *IPRange) SetTags(v []*Tag) *IPRange { - s.Tags = v - return s -} - -// Describes the status of logging for a cluster. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/LoggingStatus -type LoggingStatus struct { - _ struct{} `type:"structure"` - - // The name of the S3 bucket where the log files are stored. - BucketName *string `type:"string"` - - // The message indicating that logs failed to be delivered. - LastFailureMessage *string `type:"string"` - - // The last time when logs failed to be delivered. - LastFailureTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The last time that logs were delivered. - LastSuccessfulDeliveryTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // true if logging is on, false if logging is off. - LoggingEnabled *bool `type:"boolean"` - - // The prefix applied to the log file names. - S3KeyPrefix *string `type:"string"` -} - -// String returns the string representation -func (s LoggingStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoggingStatus) GoString() string { - return s.String() -} - -// SetBucketName sets the BucketName field's value. -func (s *LoggingStatus) SetBucketName(v string) *LoggingStatus { - s.BucketName = &v - return s -} - -// SetLastFailureMessage sets the LastFailureMessage field's value. -func (s *LoggingStatus) SetLastFailureMessage(v string) *LoggingStatus { - s.LastFailureMessage = &v - return s -} - -// SetLastFailureTime sets the LastFailureTime field's value. -func (s *LoggingStatus) SetLastFailureTime(v time.Time) *LoggingStatus { - s.LastFailureTime = &v - return s -} - -// SetLastSuccessfulDeliveryTime sets the LastSuccessfulDeliveryTime field's value. -func (s *LoggingStatus) SetLastSuccessfulDeliveryTime(v time.Time) *LoggingStatus { - s.LastSuccessfulDeliveryTime = &v - return s -} - -// SetLoggingEnabled sets the LoggingEnabled field's value. -func (s *LoggingStatus) SetLoggingEnabled(v bool) *LoggingStatus { - s.LoggingEnabled = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *LoggingStatus) SetS3KeyPrefix(v string) *LoggingStatus { - s.S3KeyPrefix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterIamRolesMessage -type ModifyClusterIamRolesInput struct { - _ struct{} `type:"structure"` - - // Zero or more IAM roles to associate with the cluster. The roles must be in - // their Amazon Resource Name (ARN) format. You can associate up to 10 IAM roles - // with a single cluster in a single request. - AddIamRoles []*string `locationNameList:"IamRoleArn" type:"list"` - - // The unique identifier of the cluster for which you want to associate or disassociate - // IAM roles. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // Zero or more IAM roles in ARN format to disassociate from the cluster. You - // can disassociate up to 10 IAM roles from a single cluster in a single request. - RemoveIamRoles []*string `locationNameList:"IamRoleArn" type:"list"` -} - -// String returns the string representation -func (s ModifyClusterIamRolesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyClusterIamRolesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyClusterIamRolesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyClusterIamRolesInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddIamRoles sets the AddIamRoles field's value. -func (s *ModifyClusterIamRolesInput) SetAddIamRoles(v []*string) *ModifyClusterIamRolesInput { - s.AddIamRoles = v - return s -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *ModifyClusterIamRolesInput) SetClusterIdentifier(v string) *ModifyClusterIamRolesInput { - s.ClusterIdentifier = &v - return s -} - -// SetRemoveIamRoles sets the RemoveIamRoles field's value. -func (s *ModifyClusterIamRolesInput) SetRemoveIamRoles(v []*string) *ModifyClusterIamRolesInput { - s.RemoveIamRoles = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterIamRolesResult -type ModifyClusterIamRolesOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s ModifyClusterIamRolesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyClusterIamRolesOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ModifyClusterIamRolesOutput) SetCluster(v *Cluster) *ModifyClusterIamRolesOutput { - s.Cluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterMessage -type ModifyClusterInput struct { - _ struct{} `type:"structure"` - - // If true, major version upgrades will be applied automatically to the cluster - // during the maintenance window. - // - // Default: false - AllowVersionUpgrade *bool `type:"boolean"` - - // The number of days that automated snapshots are retained. If the value is - // 0, automated snapshots are disabled. Even if automated snapshots are disabled, - // you can still create manual snapshots when you want with CreateClusterSnapshot. - // - // If you decrease the automated snapshot retention period from its current - // value, existing automated snapshots that fall outside of the new retention - // period will be immediately deleted. - // - // Default: Uses existing setting. - // - // Constraints: Must be a value from 0 to 35. - AutomatedSnapshotRetentionPeriod *int64 `type:"integer"` - - // The unique identifier of the cluster to be modified. - // - // Example: examplecluster - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // The name of the cluster parameter group to apply to this cluster. This change - // is applied only after the cluster is rebooted. To reboot a cluster use RebootCluster. - // - // Default: Uses existing setting. - // - // Constraints: The cluster parameter group must be in the same parameter group - // family that matches the cluster version. - ClusterParameterGroupName *string `type:"string"` - - // A list of cluster security groups to be authorized on this cluster. This - // change is asynchronously applied as soon as possible. - // - // Security groups currently associated with the cluster, and not in the list - // of groups to apply, will be revoked from the cluster. - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters or hyphens - // - // * First character must be a letter - // - // * Cannot end with a hyphen or contain two consecutive hyphens - ClusterSecurityGroups []*string `locationNameList:"ClusterSecurityGroupName" type:"list"` - - // The new cluster type. - // - // When you submit your cluster resize request, your existing cluster goes into - // a read-only mode. After Amazon Redshift provisions a new cluster based on - // your resize requirements, there will be outage for a period while the old - // cluster is deleted and your connection is switched to the new cluster. You - // can use DescribeResize to track the progress of the resize request. - // - // Valid Values: multi-node | single-node - ClusterType *string `type:"string"` - - // The new version number of the Amazon Redshift engine to upgrade to. - // - // For major version upgrades, if a non-default cluster parameter group is currently - // in use, a new cluster parameter group in the cluster parameter group family - // for the new version must be specified. The new cluster parameter group can - // be the default for that cluster parameter group family. For more information - // about parameters and parameter groups, go to Amazon Redshift Parameter Groups - // (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) - // in the Amazon Redshift Cluster Management Guide. - // - // Example: 1.0 - ClusterVersion *string `type:"string"` - - // The Elastic IP (EIP) address for the cluster. - // - // Constraints: The cluster must be provisioned in EC2-VPC and publicly-accessible - // through an Internet gateway. For more information about provisioning clusters - // in EC2-VPC, go to Supported Platforms to Launch Your Cluster (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#cluster-platforms) - // in the Amazon Redshift Cluster Management Guide. - ElasticIp *string `type:"string"` - - // An option that specifies whether to create the cluster with enhanced VPC - // routing enabled. To create a cluster that uses enhanced VPC routing, the - // cluster must be in a VPC. For more information, see Enhanced VPC Routing - // (http://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html) - // in the Amazon Redshift Cluster Management Guide. - // - // If this option is true, enhanced VPC routing is enabled. - // - // Default: false - EnhancedVpcRouting *bool `type:"boolean"` - - // Specifies the name of the HSM client certificate the Amazon Redshift cluster - // uses to retrieve the data encryption keys stored in an HSM. - HsmClientCertificateIdentifier *string `type:"string"` - - // Specifies the name of the HSM configuration that contains the information - // the Amazon Redshift cluster can use to retrieve and store keys in an HSM. - HsmConfigurationIdentifier *string `type:"string"` - - // The new password for the cluster master user. This change is asynchronously - // applied as soon as possible. Between the time of the request and the completion - // of the request, the MasterUserPassword element exists in the PendingModifiedValues - // element of the operation response. - // - // Operations never return the password, so this operation provides a way to - // regain access to the master user account for a cluster if the password is - // lost. - // - // Default: Uses existing setting. - // - // Constraints: - // - // * Must be between 8 and 64 characters in length. - // - // * Must contain at least one uppercase letter. - // - // * Must contain at least one lowercase letter. - // - // * Must contain one number. - // - // * Can be any printable ASCII character (ASCII code 33 to 126) except ' - // (single quote), " (double quote), \, /, @, or space. - MasterUserPassword *string `type:"string"` - - // The new identifier for the cluster. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * Alphabetic characters must be lowercase. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // * Must be unique for all clusters within an AWS account. - // - // Example: examplecluster - NewClusterIdentifier *string `type:"string"` - - // The new node type of the cluster. If you specify a new node type, you must - // also specify the number of nodes parameter. - // - // When you submit your request to resize a cluster, Amazon Redshift sets access - // permissions for the cluster to read-only. After Amazon Redshift provisions - // a new cluster according to your resize requirements, there will be a temporary - // outage while the old cluster is deleted and your connection is switched to - // the new cluster. When the new connection is complete, the original access - // permissions for the cluster are restored. You can use DescribeResize to track - // the progress of the resize request. - // - // Valid Values: ds1.xlarge | ds1.8xlarge | ds2.xlarge | ds2.8xlarge | dc1.large - // | dc1.8xlarge. - NodeType *string `type:"string"` - - // The new number of nodes of the cluster. If you specify a new number of nodes, - // you must also specify the node type parameter. - // - // When you submit your request to resize a cluster, Amazon Redshift sets access - // permissions for the cluster to read-only. After Amazon Redshift provisions - // a new cluster according to your resize requirements, there will be a temporary - // outage while the old cluster is deleted and your connection is switched to - // the new cluster. When the new connection is complete, the original access - // permissions for the cluster are restored. You can use DescribeResize to track - // the progress of the resize request. - // - // Valid Values: Integer greater than 0. - NumberOfNodes *int64 `type:"integer"` - - // The weekly time range (in UTC) during which system maintenance can occur, - // if necessary. If system maintenance is necessary during the window, it may - // result in an outage. - // - // This maintenance window change is made immediately. If the new maintenance - // window indicates the current time, there must be at least 120 minutes between - // the current time and end of the window in order to ensure that pending changes - // are applied. - // - // Default: Uses existing setting. - // - // Format: ddd:hh24:mi-ddd:hh24:mi, for example wed:07:30-wed:08:00. - // - // Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun - // - // Constraints: Must be at least 30 minutes. - PreferredMaintenanceWindow *string `type:"string"` - - // If true, the cluster can be accessed from a public network. Only clusters - // in VPCs can be set to be publicly available. - PubliclyAccessible *bool `type:"boolean"` - - // A list of virtual private cloud (VPC) security groups to be associated with - // the cluster. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s ModifyClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyClusterInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowVersionUpgrade sets the AllowVersionUpgrade field's value. -func (s *ModifyClusterInput) SetAllowVersionUpgrade(v bool) *ModifyClusterInput { - s.AllowVersionUpgrade = &v - return s -} - -// SetAutomatedSnapshotRetentionPeriod sets the AutomatedSnapshotRetentionPeriod field's value. -func (s *ModifyClusterInput) SetAutomatedSnapshotRetentionPeriod(v int64) *ModifyClusterInput { - s.AutomatedSnapshotRetentionPeriod = &v - return s -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *ModifyClusterInput) SetClusterIdentifier(v string) *ModifyClusterInput { - s.ClusterIdentifier = &v - return s -} - -// SetClusterParameterGroupName sets the ClusterParameterGroupName field's value. -func (s *ModifyClusterInput) SetClusterParameterGroupName(v string) *ModifyClusterInput { - s.ClusterParameterGroupName = &v - return s -} - -// SetClusterSecurityGroups sets the ClusterSecurityGroups field's value. -func (s *ModifyClusterInput) SetClusterSecurityGroups(v []*string) *ModifyClusterInput { - s.ClusterSecurityGroups = v - return s -} - -// SetClusterType sets the ClusterType field's value. -func (s *ModifyClusterInput) SetClusterType(v string) *ModifyClusterInput { - s.ClusterType = &v - return s -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *ModifyClusterInput) SetClusterVersion(v string) *ModifyClusterInput { - s.ClusterVersion = &v - return s -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *ModifyClusterInput) SetElasticIp(v string) *ModifyClusterInput { - s.ElasticIp = &v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *ModifyClusterInput) SetEnhancedVpcRouting(v bool) *ModifyClusterInput { - s.EnhancedVpcRouting = &v - return s -} - -// SetHsmClientCertificateIdentifier sets the HsmClientCertificateIdentifier field's value. -func (s *ModifyClusterInput) SetHsmClientCertificateIdentifier(v string) *ModifyClusterInput { - s.HsmClientCertificateIdentifier = &v - return s -} - -// SetHsmConfigurationIdentifier sets the HsmConfigurationIdentifier field's value. -func (s *ModifyClusterInput) SetHsmConfigurationIdentifier(v string) *ModifyClusterInput { - s.HsmConfigurationIdentifier = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *ModifyClusterInput) SetMasterUserPassword(v string) *ModifyClusterInput { - s.MasterUserPassword = &v - return s -} - -// SetNewClusterIdentifier sets the NewClusterIdentifier field's value. -func (s *ModifyClusterInput) SetNewClusterIdentifier(v string) *ModifyClusterInput { - s.NewClusterIdentifier = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *ModifyClusterInput) SetNodeType(v string) *ModifyClusterInput { - s.NodeType = &v - return s -} - -// SetNumberOfNodes sets the NumberOfNodes field's value. -func (s *ModifyClusterInput) SetNumberOfNodes(v int64) *ModifyClusterInput { - s.NumberOfNodes = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *ModifyClusterInput) SetPreferredMaintenanceWindow(v string) *ModifyClusterInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *ModifyClusterInput) SetPubliclyAccessible(v bool) *ModifyClusterInput { - s.PubliclyAccessible = &v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *ModifyClusterInput) SetVpcSecurityGroupIds(v []*string) *ModifyClusterInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterResult -type ModifyClusterOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s ModifyClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ModifyClusterOutput) SetCluster(v *Cluster) *ModifyClusterOutput { - s.Cluster = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterParameterGroupMessage -type ModifyClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the parameter group to be modified. - // - // ParameterGroupName is a required field - ParameterGroupName *string `type:"string" required:"true"` - - // An array of parameters to be modified. A maximum of 20 parameters can be - // modified in a single request. - // - // For each parameter to be modified, you must supply at least the parameter - // name and parameter value; other name-value pairs of the parameter are optional. - // - // For the workload management (WLM) configuration, you must supply all the - // name-value pairs in the wlm_json_configuration parameter. - // - // Parameters is a required field - Parameters []*Parameter `locationNameList:"Parameter" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyClusterParameterGroupInput"} - if s.ParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterGroupName")) - } - if s.Parameters == nil { - invalidParams.Add(request.NewErrParamRequired("Parameters")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *ModifyClusterParameterGroupInput) SetParameterGroupName(v string) *ModifyClusterParameterGroupInput { - s.ParameterGroupName = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ModifyClusterParameterGroupInput) SetParameters(v []*Parameter) *ModifyClusterParameterGroupInput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterSubnetGroupMessage -type ModifyClusterSubnetGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the subnet group to be modified. - // - // ClusterSubnetGroupName is a required field - ClusterSubnetGroupName *string `type:"string" required:"true"` - - // A text description of the subnet group to be modified. - Description *string `type:"string"` - - // An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a - // single request. - // - // SubnetIds is a required field - SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyClusterSubnetGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyClusterSubnetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyClusterSubnetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyClusterSubnetGroupInput"} - if s.ClusterSubnetGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterSubnetGroupName")) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. -func (s *ModifyClusterSubnetGroupInput) SetClusterSubnetGroupName(v string) *ModifyClusterSubnetGroupInput { - s.ClusterSubnetGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModifyClusterSubnetGroupInput) SetDescription(v string) *ModifyClusterSubnetGroupInput { - s.Description = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *ModifyClusterSubnetGroupInput) SetSubnetIds(v []*string) *ModifyClusterSubnetGroupInput { - s.SubnetIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyClusterSubnetGroupResult -type ModifyClusterSubnetGroupOutput struct { - _ struct{} `type:"structure"` - - // Describes a subnet group. - ClusterSubnetGroup *ClusterSubnetGroup `type:"structure"` -} - -// String returns the string representation -func (s ModifyClusterSubnetGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyClusterSubnetGroupOutput) GoString() string { - return s.String() -} - -// SetClusterSubnetGroup sets the ClusterSubnetGroup field's value. -func (s *ModifyClusterSubnetGroupOutput) SetClusterSubnetGroup(v *ClusterSubnetGroup) *ModifyClusterSubnetGroupOutput { - s.ClusterSubnetGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyEventSubscriptionMessage -type ModifyEventSubscriptionInput struct { - _ struct{} `type:"structure"` - - // A Boolean value indicating if the subscription is enabled. true indicates - // the subscription is enabled - Enabled *bool `type:"boolean"` - - // Specifies the Amazon Redshift event categories to be published by the event - // notification subscription. - // - // Values: Configuration, Management, Monitoring, Security - EventCategories []*string `locationNameList:"EventCategory" type:"list"` - - // Specifies the Amazon Redshift event severity to be published by the event - // notification subscription. - // - // Values: ERROR, INFO - Severity *string `type:"string"` - - // The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification - // subscription. - SnsTopicArn *string `type:"string"` - - // A list of one or more identifiers of Amazon Redshift source objects. All - // of the objects must be of the same type as was specified in the source type - // parameter. The event subscription will return only events generated by the - // specified objects. If not specified, then events are returned for all objects - // within the source type specified. - // - // Example: my-cluster-1, my-cluster-2 - // - // Example: my-snapshot-20131010 - SourceIds []*string `locationNameList:"SourceId" type:"list"` - - // The type of source that will be generating the events. For example, if you - // want to be notified of events generated by a cluster, you would set this - // parameter to cluster. If this value is not specified, events are returned - // for all Amazon Redshift objects in your AWS account. You must specify a source - // type in order to specify source IDs. - // - // Valid values: cluster, cluster-parameter-group, cluster-security-group, and - // cluster-snapshot. - SourceType *string `type:"string"` - - // The name of the modified Amazon Redshift event notification subscription. - // - // SubscriptionName is a required field - SubscriptionName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyEventSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyEventSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyEventSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyEventSubscriptionInput"} - if s.SubscriptionName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *ModifyEventSubscriptionInput) SetEnabled(v bool) *ModifyEventSubscriptionInput { - s.Enabled = &v - return s -} - -// SetEventCategories sets the EventCategories field's value. -func (s *ModifyEventSubscriptionInput) SetEventCategories(v []*string) *ModifyEventSubscriptionInput { - s.EventCategories = v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *ModifyEventSubscriptionInput) SetSeverity(v string) *ModifyEventSubscriptionInput { - s.Severity = &v - return s -} - -// SetSnsTopicArn sets the SnsTopicArn field's value. -func (s *ModifyEventSubscriptionInput) SetSnsTopicArn(v string) *ModifyEventSubscriptionInput { - s.SnsTopicArn = &v - return s -} - -// SetSourceIds sets the SourceIds field's value. -func (s *ModifyEventSubscriptionInput) SetSourceIds(v []*string) *ModifyEventSubscriptionInput { - s.SourceIds = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *ModifyEventSubscriptionInput) SetSourceType(v string) *ModifyEventSubscriptionInput { - s.SourceType = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *ModifyEventSubscriptionInput) SetSubscriptionName(v string) *ModifyEventSubscriptionInput { - s.SubscriptionName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyEventSubscriptionResult -type ModifyEventSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Describes event subscriptions. - EventSubscription *EventSubscription `type:"structure"` -} - -// String returns the string representation -func (s ModifyEventSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyEventSubscriptionOutput) GoString() string { - return s.String() -} - -// SetEventSubscription sets the EventSubscription field's value. -func (s *ModifyEventSubscriptionOutput) SetEventSubscription(v *EventSubscription) *ModifyEventSubscriptionOutput { - s.EventSubscription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifySnapshotCopyRetentionPeriodMessage -type ModifySnapshotCopyRetentionPeriodInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the cluster for which you want to change the retention - // period for automated snapshots that are copied to a destination region. - // - // Constraints: Must be the valid name of an existing cluster that has cross-region - // snapshot copy enabled. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // The number of days to retain automated snapshots in the destination region - // after they are copied from the source region. - // - // If you decrease the retention period for automated snapshots that are copied - // to a destination region, Amazon Redshift will delete any existing automated - // snapshots that were copied to the destination region and that fall outside - // of the new retention period. - // - // Constraints: Must be at least 1 and no more than 35. - // - // RetentionPeriod is a required field - RetentionPeriod *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s ModifySnapshotCopyRetentionPeriodInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySnapshotCopyRetentionPeriodInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifySnapshotCopyRetentionPeriodInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifySnapshotCopyRetentionPeriodInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - if s.RetentionPeriod == nil { - invalidParams.Add(request.NewErrParamRequired("RetentionPeriod")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *ModifySnapshotCopyRetentionPeriodInput) SetClusterIdentifier(v string) *ModifySnapshotCopyRetentionPeriodInput { - s.ClusterIdentifier = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *ModifySnapshotCopyRetentionPeriodInput) SetRetentionPeriod(v int64) *ModifySnapshotCopyRetentionPeriodInput { - s.RetentionPeriod = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifySnapshotCopyRetentionPeriodResult -type ModifySnapshotCopyRetentionPeriodOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s ModifySnapshotCopyRetentionPeriodOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySnapshotCopyRetentionPeriodOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ModifySnapshotCopyRetentionPeriodOutput) SetCluster(v *Cluster) *ModifySnapshotCopyRetentionPeriodOutput { - s.Cluster = v - return s -} - -// Describes an orderable cluster option. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/OrderableClusterOption -type OrderableClusterOption struct { - _ struct{} `type:"structure"` - - // A list of availability zones for the orderable cluster. - AvailabilityZones []*AvailabilityZone `locationNameList:"AvailabilityZone" type:"list"` - - // The cluster type, for example multi-node. - ClusterType *string `type:"string"` - - // The version of the orderable cluster. - ClusterVersion *string `type:"string"` - - // The node type for the orderable cluster. - NodeType *string `type:"string"` -} - -// String returns the string representation -func (s OrderableClusterOption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OrderableClusterOption) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *OrderableClusterOption) SetAvailabilityZones(v []*AvailabilityZone) *OrderableClusterOption { - s.AvailabilityZones = v - return s -} - -// SetClusterType sets the ClusterType field's value. -func (s *OrderableClusterOption) SetClusterType(v string) *OrderableClusterOption { - s.ClusterType = &v - return s -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *OrderableClusterOption) SetClusterVersion(v string) *OrderableClusterOption { - s.ClusterVersion = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *OrderableClusterOption) SetNodeType(v string) *OrderableClusterOption { - s.NodeType = &v - return s -} - -// Describes a parameter in a cluster parameter group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/Parameter -type Parameter struct { - _ struct{} `type:"structure"` - - // The valid range of values for the parameter. - AllowedValues *string `type:"string"` - - // Specifies how to apply the WLM configuration parameter. Some properties can - // be applied dynamically, while other properties require that any associated - // clusters be rebooted for the configuration changes to be applied. For more - // information about parameters and parameter groups, go to Amazon Redshift - // Parameter Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) - // in the Amazon Redshift Cluster Management Guide. - ApplyType *string `type:"string" enum:"ParameterApplyType"` - - // The data type of the parameter. - DataType *string `type:"string"` - - // A description of the parameter. - Description *string `type:"string"` - - // If true, the parameter can be modified. Some parameters have security or - // operational implications that prevent them from being changed. - IsModifiable *bool `type:"boolean"` - - // The earliest engine version to which the parameter can apply. - MinimumEngineVersion *string `type:"string"` - - // The name of the parameter. - ParameterName *string `type:"string"` - - // The value of the parameter. - ParameterValue *string `type:"string"` - - // The source of the parameter value, such as "engine-default" or "user". - Source *string `type:"string"` -} - -// String returns the string representation -func (s Parameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Parameter) GoString() string { - return s.String() -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *Parameter) SetAllowedValues(v string) *Parameter { - s.AllowedValues = &v - return s -} - -// SetApplyType sets the ApplyType field's value. -func (s *Parameter) SetApplyType(v string) *Parameter { - s.ApplyType = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *Parameter) SetDataType(v string) *Parameter { - s.DataType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Parameter) SetDescription(v string) *Parameter { - s.Description = &v - return s -} - -// SetIsModifiable sets the IsModifiable field's value. -func (s *Parameter) SetIsModifiable(v bool) *Parameter { - s.IsModifiable = &v - return s -} - -// SetMinimumEngineVersion sets the MinimumEngineVersion field's value. -func (s *Parameter) SetMinimumEngineVersion(v string) *Parameter { - s.MinimumEngineVersion = &v - return s -} - -// SetParameterName sets the ParameterName field's value. -func (s *Parameter) SetParameterName(v string) *Parameter { - s.ParameterName = &v - return s -} - -// SetParameterValue sets the ParameterValue field's value. -func (s *Parameter) SetParameterValue(v string) *Parameter { - s.ParameterValue = &v - return s -} - -// SetSource sets the Source field's value. -func (s *Parameter) SetSource(v string) *Parameter { - s.Source = &v - return s -} - -// Describes cluster attributes that are in a pending state. A change to one -// or more the attributes was requested and is in progress or will be applied. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/PendingModifiedValues -type PendingModifiedValues struct { - _ struct{} `type:"structure"` - - // The pending or in-progress change of the automated snapshot retention period. - AutomatedSnapshotRetentionPeriod *int64 `type:"integer"` - - // The pending or in-progress change of the new identifier for the cluster. - ClusterIdentifier *string `type:"string"` - - // The pending or in-progress change of the cluster type. - ClusterType *string `type:"string"` - - // The pending or in-progress change of the service version. - ClusterVersion *string `type:"string"` - - // An option that specifies whether to create the cluster with enhanced VPC - // routing enabled. To create a cluster that uses enhanced VPC routing, the - // cluster must be in a VPC. For more information, see Enhanced VPC Routing - // (http://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html) - // in the Amazon Redshift Cluster Management Guide. - // - // If this option is true, enhanced VPC routing is enabled. - // - // Default: false - EnhancedVpcRouting *bool `type:"boolean"` - - // The pending or in-progress change of the master user password for the cluster. - MasterUserPassword *string `type:"string"` - - // The pending or in-progress change of the cluster's node type. - NodeType *string `type:"string"` - - // The pending or in-progress change of the number of nodes in the cluster. - NumberOfNodes *int64 `type:"integer"` - - // The pending or in-progress change of the ability to connect to the cluster - // from the public network. - PubliclyAccessible *bool `type:"boolean"` -} - -// String returns the string representation -func (s PendingModifiedValues) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PendingModifiedValues) GoString() string { - return s.String() -} - -// SetAutomatedSnapshotRetentionPeriod sets the AutomatedSnapshotRetentionPeriod field's value. -func (s *PendingModifiedValues) SetAutomatedSnapshotRetentionPeriod(v int64) *PendingModifiedValues { - s.AutomatedSnapshotRetentionPeriod = &v - return s -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *PendingModifiedValues) SetClusterIdentifier(v string) *PendingModifiedValues { - s.ClusterIdentifier = &v - return s -} - -// SetClusterType sets the ClusterType field's value. -func (s *PendingModifiedValues) SetClusterType(v string) *PendingModifiedValues { - s.ClusterType = &v - return s -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *PendingModifiedValues) SetClusterVersion(v string) *PendingModifiedValues { - s.ClusterVersion = &v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *PendingModifiedValues) SetEnhancedVpcRouting(v bool) *PendingModifiedValues { - s.EnhancedVpcRouting = &v - return s -} - -// SetMasterUserPassword sets the MasterUserPassword field's value. -func (s *PendingModifiedValues) SetMasterUserPassword(v string) *PendingModifiedValues { - s.MasterUserPassword = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *PendingModifiedValues) SetNodeType(v string) *PendingModifiedValues { - s.NodeType = &v - return s -} - -// SetNumberOfNodes sets the NumberOfNodes field's value. -func (s *PendingModifiedValues) SetNumberOfNodes(v int64) *PendingModifiedValues { - s.NumberOfNodes = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *PendingModifiedValues) SetPubliclyAccessible(v bool) *PendingModifiedValues { - s.PubliclyAccessible = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/PurchaseReservedNodeOfferingMessage -type PurchaseReservedNodeOfferingInput struct { - _ struct{} `type:"structure"` - - // The number of reserved nodes that you want to purchase. - // - // Default: 1 - NodeCount *int64 `type:"integer"` - - // The unique identifier of the reserved node offering you want to purchase. - // - // ReservedNodeOfferingId is a required field - ReservedNodeOfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseReservedNodeOfferingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedNodeOfferingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseReservedNodeOfferingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseReservedNodeOfferingInput"} - if s.ReservedNodeOfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedNodeOfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNodeCount sets the NodeCount field's value. -func (s *PurchaseReservedNodeOfferingInput) SetNodeCount(v int64) *PurchaseReservedNodeOfferingInput { - s.NodeCount = &v - return s -} - -// SetReservedNodeOfferingId sets the ReservedNodeOfferingId field's value. -func (s *PurchaseReservedNodeOfferingInput) SetReservedNodeOfferingId(v string) *PurchaseReservedNodeOfferingInput { - s.ReservedNodeOfferingId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/PurchaseReservedNodeOfferingResult -type PurchaseReservedNodeOfferingOutput struct { - _ struct{} `type:"structure"` - - // Describes a reserved node. You can call the DescribeReservedNodeOfferings - // API to obtain the available reserved node offerings. - ReservedNode *ReservedNode `type:"structure"` -} - -// String returns the string representation -func (s PurchaseReservedNodeOfferingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedNodeOfferingOutput) GoString() string { - return s.String() -} - -// SetReservedNode sets the ReservedNode field's value. -func (s *PurchaseReservedNodeOfferingOutput) SetReservedNode(v *ReservedNode) *PurchaseReservedNodeOfferingOutput { - s.ReservedNode = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RebootClusterMessage -type RebootClusterInput struct { - _ struct{} `type:"structure"` - - // The cluster identifier. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RebootClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootClusterInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *RebootClusterInput) SetClusterIdentifier(v string) *RebootClusterInput { - s.ClusterIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RebootClusterResult -type RebootClusterOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s RebootClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *RebootClusterOutput) SetCluster(v *Cluster) *RebootClusterOutput { - s.Cluster = v - return s -} - -// Describes a recurring charge. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RecurringCharge -type RecurringCharge struct { - _ struct{} `type:"structure"` - - // The amount charged per the period of time specified by the recurring charge - // frequency. - RecurringChargeAmount *float64 `type:"double"` - - // The frequency at which the recurring charge amount is applied. - RecurringChargeFrequency *string `type:"string"` -} - -// 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() -} - -// SetRecurringChargeAmount sets the RecurringChargeAmount field's value. -func (s *RecurringCharge) SetRecurringChargeAmount(v float64) *RecurringCharge { - s.RecurringChargeAmount = &v - return s -} - -// SetRecurringChargeFrequency sets the RecurringChargeFrequency field's value. -func (s *RecurringCharge) SetRecurringChargeFrequency(v string) *RecurringCharge { - s.RecurringChargeFrequency = &v - return s -} - -// Describes a reserved node. You can call the DescribeReservedNodeOfferings -// API to obtain the available reserved node offerings. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ReservedNode -type ReservedNode struct { - _ struct{} `type:"structure"` - - // The currency code for the reserved cluster. - CurrencyCode *string `type:"string"` - - // The duration of the node reservation in seconds. - Duration *int64 `type:"integer"` - - // The fixed cost Amazon Redshift charges you for this reserved node. - FixedPrice *float64 `type:"double"` - - // The number of reserved compute nodes. - NodeCount *int64 `type:"integer"` - - // The node type of the reserved node. - NodeType *string `type:"string"` - - // The anticipated utilization of the reserved node, as defined in the reserved - // node offering. - OfferingType *string `type:"string"` - - // The recurring charges for the reserved node. - RecurringCharges []*RecurringCharge `locationNameList:"RecurringCharge" type:"list"` - - // The unique identifier for the reservation. - ReservedNodeId *string `type:"string"` - - // The identifier for the reserved node offering. - ReservedNodeOfferingId *string `type:"string"` - - // The time the reservation started. You purchase a reserved node offering for - // a duration. This is the start time of that duration. - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The state of the reserved compute node. - // - // Possible Values: - // - // * pending-payment-This reserved node has recently been purchased, and - // the sale has been approved, but payment has not yet been confirmed. - // - // * active-This reserved node is owned by the caller and is available for - // use. - // - // * payment-failed-Payment failed for the purchase attempt. - State *string `type:"string"` - - // The hourly rate Amazon Redshift charges you for this reserved node. - UsagePrice *float64 `type:"double"` -} - -// String returns the string representation -func (s ReservedNode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedNode) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedNode) SetCurrencyCode(v string) *ReservedNode { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedNode) SetDuration(v int64) *ReservedNode { - s.Duration = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedNode) SetFixedPrice(v float64) *ReservedNode { - s.FixedPrice = &v - return s -} - -// SetNodeCount sets the NodeCount field's value. -func (s *ReservedNode) SetNodeCount(v int64) *ReservedNode { - s.NodeCount = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *ReservedNode) SetNodeType(v string) *ReservedNode { - s.NodeType = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedNode) SetOfferingType(v string) *ReservedNode { - s.OfferingType = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedNode) SetRecurringCharges(v []*RecurringCharge) *ReservedNode { - s.RecurringCharges = v - return s -} - -// SetReservedNodeId sets the ReservedNodeId field's value. -func (s *ReservedNode) SetReservedNodeId(v string) *ReservedNode { - s.ReservedNodeId = &v - return s -} - -// SetReservedNodeOfferingId sets the ReservedNodeOfferingId field's value. -func (s *ReservedNode) SetReservedNodeOfferingId(v string) *ReservedNode { - s.ReservedNodeOfferingId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ReservedNode) SetStartTime(v time.Time) *ReservedNode { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *ReservedNode) SetState(v string) *ReservedNode { - s.State = &v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedNode) SetUsagePrice(v float64) *ReservedNode { - s.UsagePrice = &v - return s -} - -// Describes a reserved node offering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ReservedNodeOffering -type ReservedNodeOffering struct { - _ struct{} `type:"structure"` - - // The currency code for the compute nodes offering. - CurrencyCode *string `type:"string"` - - // The duration, in seconds, for which the offering will reserve the node. - Duration *int64 `type:"integer"` - - // The upfront fixed charge you will pay to purchase the specific reserved node - // offering. - FixedPrice *float64 `type:"double"` - - // The node type offered by the reserved node offering. - NodeType *string `type:"string"` - - // The anticipated utilization of the reserved node, as defined in the reserved - // node offering. - OfferingType *string `type:"string"` - - // The charge to your account regardless of whether you are creating any clusters - // using the node offering. Recurring charges are only in effect for heavy-utilization - // reserved nodes. - RecurringCharges []*RecurringCharge `locationNameList:"RecurringCharge" type:"list"` - - // The offering identifier. - ReservedNodeOfferingId *string `type:"string"` - - // The rate you are charged for each hour the cluster that is using the offering - // is running. - UsagePrice *float64 `type:"double"` -} - -// String returns the string representation -func (s ReservedNodeOffering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedNodeOffering) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedNodeOffering) SetCurrencyCode(v string) *ReservedNodeOffering { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedNodeOffering) SetDuration(v int64) *ReservedNodeOffering { - s.Duration = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedNodeOffering) SetFixedPrice(v float64) *ReservedNodeOffering { - s.FixedPrice = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *ReservedNodeOffering) SetNodeType(v string) *ReservedNodeOffering { - s.NodeType = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedNodeOffering) SetOfferingType(v string) *ReservedNodeOffering { - s.OfferingType = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedNodeOffering) SetRecurringCharges(v []*RecurringCharge) *ReservedNodeOffering { - s.RecurringCharges = v - return s -} - -// SetReservedNodeOfferingId sets the ReservedNodeOfferingId field's value. -func (s *ReservedNodeOffering) SetReservedNodeOfferingId(v string) *ReservedNodeOffering { - s.ReservedNodeOfferingId = &v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedNodeOffering) SetUsagePrice(v float64) *ReservedNodeOffering { - s.UsagePrice = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ResetClusterParameterGroupMessage -type ResetClusterParameterGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the cluster parameter group to be reset. - // - // ParameterGroupName is a required field - ParameterGroupName *string `type:"string" required:"true"` - - // An array of names of parameters to be reset. If ResetAllParameters option - // is not used, then at least one parameter name must be supplied. - // - // Constraints: A maximum of 20 parameters can be reset in a single request. - Parameters []*Parameter `locationNameList:"Parameter" type:"list"` - - // If true, all parameters in the specified parameter group will be reset to - // their default values. - // - // Default: true - ResetAllParameters *bool `type:"boolean"` -} - -// String returns the string representation -func (s ResetClusterParameterGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetClusterParameterGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetClusterParameterGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetClusterParameterGroupInput"} - if s.ParameterGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ParameterGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *ResetClusterParameterGroupInput) SetParameterGroupName(v string) *ResetClusterParameterGroupInput { - s.ParameterGroupName = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ResetClusterParameterGroupInput) SetParameters(v []*Parameter) *ResetClusterParameterGroupInput { - s.Parameters = v - return s -} - -// SetResetAllParameters sets the ResetAllParameters field's value. -func (s *ResetClusterParameterGroupInput) SetResetAllParameters(v bool) *ResetClusterParameterGroupInput { - s.ResetAllParameters = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreFromClusterSnapshotMessage -type RestoreFromClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - // Reserved. - AdditionalInfo *string `type:"string"` - - // If true, major version upgrades can be applied during the maintenance window - // to the Amazon Redshift engine that is running on the cluster. - // - // Default: true - AllowVersionUpgrade *bool `type:"boolean"` - - // The number of days that automated snapshots are retained. If the value is - // 0, automated snapshots are disabled. Even if automated snapshots are disabled, - // you can still create manual snapshots when you want with CreateClusterSnapshot. - // - // Default: The value selected for the cluster from which the snapshot was taken. - // - // Constraints: Must be a value from 0 to 35. - AutomatedSnapshotRetentionPeriod *int64 `type:"integer"` - - // The Amazon EC2 Availability Zone in which to restore the cluster. - // - // Default: A random, system-chosen Availability Zone. - // - // Example: us-east-1a - AvailabilityZone *string `type:"string"` - - // The identifier of the cluster that will be created from restoring the snapshot. - // - // Constraints: - // - // * Must contain from 1 to 63 alphanumeric characters or hyphens. - // - // * Alphabetic characters must be lowercase. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // * Must be unique for all clusters within an AWS account. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // The name of the parameter group to be associated with this cluster. - // - // Default: The default Amazon Redshift cluster parameter group. For information - // about the default parameter group, go to Working with Amazon Redshift Parameter - // Groups (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html). - // - // Constraints: - // - // * Must be 1 to 255 alphanumeric characters or hyphens. - // - // * First character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - ClusterParameterGroupName *string `type:"string"` - - // A list of security groups to be associated with this cluster. - // - // Default: The default cluster security group for Amazon Redshift. - // - // Cluster security groups only apply to clusters outside of VPCs. - ClusterSecurityGroups []*string `locationNameList:"ClusterSecurityGroupName" type:"list"` - - // The name of the subnet group where you want to cluster restored. - // - // A snapshot of cluster in VPC can be restored only in VPC. Therefore, you - // must provide subnet group name where you want the cluster restored. - ClusterSubnetGroupName *string `type:"string"` - - // The elastic IP (EIP) address for the cluster. - ElasticIp *string `type:"string"` - - // An option that specifies whether to create the cluster with enhanced VPC - // routing enabled. To create a cluster that uses enhanced VPC routing, the - // cluster must be in a VPC. For more information, see Enhanced VPC Routing - // (http://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html) - // in the Amazon Redshift Cluster Management Guide. - // - // If this option is true, enhanced VPC routing is enabled. - // - // Default: false - EnhancedVpcRouting *bool `type:"boolean"` - - // Specifies the name of the HSM client certificate the Amazon Redshift cluster - // uses to retrieve the data encryption keys stored in an HSM. - HsmClientCertificateIdentifier *string `type:"string"` - - // Specifies the name of the HSM configuration that contains the information - // the Amazon Redshift cluster can use to retrieve and store keys in an HSM. - HsmConfigurationIdentifier *string `type:"string"` - - // A list of AWS Identity and Access Management (IAM) roles that can be used - // by the cluster to access other AWS services. You must supply the IAM roles - // in their Amazon Resource Name (ARN) format. You can supply up to 10 IAM roles - // in a single request. - // - // A cluster can have up to 10 IAM roles associated at any time. - IamRoles []*string `locationNameList:"IamRoleArn" type:"list"` - - // The AWS Key Management Service (KMS) key ID of the encryption key that you - // want to use to encrypt data in the cluster that you restore from a shared - // snapshot. - KmsKeyId *string `type:"string"` - - // The node type that the restored cluster will be provisioned with. - // - // Default: The node type of the cluster from which the snapshot was taken. - // You can modify this if you are using any DS node type. In that case, you - // can choose to restore into another DS node type of the same size. For example, - // you can restore ds1.8xlarge into ds2.8xlarge, or ds2.xlarge into ds1.xlarge. - // If you have a DC instance type, you must restore into that same instance - // type and size. In other words, you can only restore a dc1.large instance - // type into another dc1.large instance type. For more information about node - // types, see About Clusters and Nodes (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#rs-about-clusters-and-nodes) - // in the Amazon Redshift Cluster Management Guide - NodeType *string `type:"string"` - - // The AWS customer account used to create or copy the snapshot. Required if - // you are restoring a snapshot you do not own, optional if you own the snapshot. - OwnerAccount *string `type:"string"` - - // The port number on which the cluster accepts connections. - // - // Default: The same port as the original cluster. - // - // Constraints: Must be between 1115 and 65535. - Port *int64 `type:"integer"` - - // The weekly time range (in UTC) during which automated cluster maintenance - // can occur. - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: The value selected for the cluster from which the snapshot was taken. - // For more information about the time blocks for each region, see Maintenance - // Windows (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#rs-maintenance-windows) - // in Amazon Redshift Cluster Management Guide. - // - // Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `type:"string"` - - // If true, the cluster can be accessed from a public network. - PubliclyAccessible *bool `type:"boolean"` - - // The name of the cluster the source snapshot was created from. This parameter - // is required if your IAM user has a policy containing a snapshot resource - // element that specifies anything other than * for the cluster name. - SnapshotClusterIdentifier *string `type:"string"` - - // The name of the snapshot from which to create the new cluster. This parameter - // isn't case sensitive. - // - // Example: my-snapshot-id - // - // SnapshotIdentifier is a required field - SnapshotIdentifier *string `type:"string" required:"true"` - - // A list of Virtual Private Cloud (VPC) security groups to be associated with - // the cluster. - // - // Default: The default VPC security group is associated with the cluster. - // - // VPC security groups only apply to clusters in VPCs. - VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` -} - -// String returns the string representation -func (s RestoreFromClusterSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreFromClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreFromClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreFromClusterSnapshotInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - if s.SnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *RestoreFromClusterSnapshotInput) SetAdditionalInfo(v string) *RestoreFromClusterSnapshotInput { - s.AdditionalInfo = &v - return s -} - -// SetAllowVersionUpgrade sets the AllowVersionUpgrade field's value. -func (s *RestoreFromClusterSnapshotInput) SetAllowVersionUpgrade(v bool) *RestoreFromClusterSnapshotInput { - s.AllowVersionUpgrade = &v - return s -} - -// SetAutomatedSnapshotRetentionPeriod sets the AutomatedSnapshotRetentionPeriod field's value. -func (s *RestoreFromClusterSnapshotInput) SetAutomatedSnapshotRetentionPeriod(v int64) *RestoreFromClusterSnapshotInput { - s.AutomatedSnapshotRetentionPeriod = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *RestoreFromClusterSnapshotInput) SetAvailabilityZone(v string) *RestoreFromClusterSnapshotInput { - s.AvailabilityZone = &v - return s -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *RestoreFromClusterSnapshotInput) SetClusterIdentifier(v string) *RestoreFromClusterSnapshotInput { - s.ClusterIdentifier = &v - return s -} - -// SetClusterParameterGroupName sets the ClusterParameterGroupName field's value. -func (s *RestoreFromClusterSnapshotInput) SetClusterParameterGroupName(v string) *RestoreFromClusterSnapshotInput { - s.ClusterParameterGroupName = &v - return s -} - -// SetClusterSecurityGroups sets the ClusterSecurityGroups field's value. -func (s *RestoreFromClusterSnapshotInput) SetClusterSecurityGroups(v []*string) *RestoreFromClusterSnapshotInput { - s.ClusterSecurityGroups = v - return s -} - -// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. -func (s *RestoreFromClusterSnapshotInput) SetClusterSubnetGroupName(v string) *RestoreFromClusterSnapshotInput { - s.ClusterSubnetGroupName = &v - return s -} - -// SetElasticIp sets the ElasticIp field's value. -func (s *RestoreFromClusterSnapshotInput) SetElasticIp(v string) *RestoreFromClusterSnapshotInput { - s.ElasticIp = &v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *RestoreFromClusterSnapshotInput) SetEnhancedVpcRouting(v bool) *RestoreFromClusterSnapshotInput { - s.EnhancedVpcRouting = &v - return s -} - -// SetHsmClientCertificateIdentifier sets the HsmClientCertificateIdentifier field's value. -func (s *RestoreFromClusterSnapshotInput) SetHsmClientCertificateIdentifier(v string) *RestoreFromClusterSnapshotInput { - s.HsmClientCertificateIdentifier = &v - return s -} - -// SetHsmConfigurationIdentifier sets the HsmConfigurationIdentifier field's value. -func (s *RestoreFromClusterSnapshotInput) SetHsmConfigurationIdentifier(v string) *RestoreFromClusterSnapshotInput { - s.HsmConfigurationIdentifier = &v - return s -} - -// SetIamRoles sets the IamRoles field's value. -func (s *RestoreFromClusterSnapshotInput) SetIamRoles(v []*string) *RestoreFromClusterSnapshotInput { - s.IamRoles = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *RestoreFromClusterSnapshotInput) SetKmsKeyId(v string) *RestoreFromClusterSnapshotInput { - s.KmsKeyId = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *RestoreFromClusterSnapshotInput) SetNodeType(v string) *RestoreFromClusterSnapshotInput { - s.NodeType = &v - return s -} - -// SetOwnerAccount sets the OwnerAccount field's value. -func (s *RestoreFromClusterSnapshotInput) SetOwnerAccount(v string) *RestoreFromClusterSnapshotInput { - s.OwnerAccount = &v - return s -} - -// SetPort sets the Port field's value. -func (s *RestoreFromClusterSnapshotInput) SetPort(v int64) *RestoreFromClusterSnapshotInput { - s.Port = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *RestoreFromClusterSnapshotInput) SetPreferredMaintenanceWindow(v string) *RestoreFromClusterSnapshotInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *RestoreFromClusterSnapshotInput) SetPubliclyAccessible(v bool) *RestoreFromClusterSnapshotInput { - s.PubliclyAccessible = &v - return s -} - -// SetSnapshotClusterIdentifier sets the SnapshotClusterIdentifier field's value. -func (s *RestoreFromClusterSnapshotInput) SetSnapshotClusterIdentifier(v string) *RestoreFromClusterSnapshotInput { - s.SnapshotClusterIdentifier = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *RestoreFromClusterSnapshotInput) SetSnapshotIdentifier(v string) *RestoreFromClusterSnapshotInput { - s.SnapshotIdentifier = &v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *RestoreFromClusterSnapshotInput) SetVpcSecurityGroupIds(v []*string) *RestoreFromClusterSnapshotInput { - s.VpcSecurityGroupIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreFromClusterSnapshotResult -type RestoreFromClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s RestoreFromClusterSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreFromClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *RestoreFromClusterSnapshotOutput) SetCluster(v *Cluster) *RestoreFromClusterSnapshotOutput { - s.Cluster = v - return s -} - -// Describes the status of a cluster restore action. Returns null if the cluster -// was not created by restoring a snapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreStatus -type RestoreStatus struct { - _ struct{} `type:"structure"` - - // The number of megabytes per second being transferred from the backup storage. - // Returns the average rate for a completed backup. - CurrentRestoreRateInMegaBytesPerSecond *float64 `type:"double"` - - // The amount of time an in-progress restore has been running, or the amount - // of time it took a completed restore to finish. - ElapsedTimeInSeconds *int64 `type:"long"` - - // The estimate of the time remaining before the restore will complete. Returns - // 0 for a completed restore. - EstimatedTimeToCompletionInSeconds *int64 `type:"long"` - - // The number of megabytes that have been transferred from snapshot storage. - ProgressInMegaBytes *int64 `type:"long"` - - // The size of the set of snapshot data used to restore the cluster. - SnapshotSizeInMegaBytes *int64 `type:"long"` - - // The status of the restore action. Returns starting, restoring, completed, - // or failed. - Status *string `type:"string"` -} - -// String returns the string representation -func (s RestoreStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreStatus) GoString() string { - return s.String() -} - -// SetCurrentRestoreRateInMegaBytesPerSecond sets the CurrentRestoreRateInMegaBytesPerSecond field's value. -func (s *RestoreStatus) SetCurrentRestoreRateInMegaBytesPerSecond(v float64) *RestoreStatus { - s.CurrentRestoreRateInMegaBytesPerSecond = &v - return s -} - -// SetElapsedTimeInSeconds sets the ElapsedTimeInSeconds field's value. -func (s *RestoreStatus) SetElapsedTimeInSeconds(v int64) *RestoreStatus { - s.ElapsedTimeInSeconds = &v - return s -} - -// SetEstimatedTimeToCompletionInSeconds sets the EstimatedTimeToCompletionInSeconds field's value. -func (s *RestoreStatus) SetEstimatedTimeToCompletionInSeconds(v int64) *RestoreStatus { - s.EstimatedTimeToCompletionInSeconds = &v - return s -} - -// SetProgressInMegaBytes sets the ProgressInMegaBytes field's value. -func (s *RestoreStatus) SetProgressInMegaBytes(v int64) *RestoreStatus { - s.ProgressInMegaBytes = &v - return s -} - -// SetSnapshotSizeInMegaBytes sets the SnapshotSizeInMegaBytes field's value. -func (s *RestoreStatus) SetSnapshotSizeInMegaBytes(v int64) *RestoreStatus { - s.SnapshotSizeInMegaBytes = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RestoreStatus) SetStatus(v string) *RestoreStatus { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreTableFromClusterSnapshotMessage -type RestoreTableFromClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Redshift cluster to restore the table to. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` - - // The name of the table to create as a result of the current request. - // - // NewTableName is a required field - NewTableName *string `type:"string" required:"true"` - - // The identifier of the snapshot to restore the table from. This snapshot must - // have been created from the Amazon Redshift cluster specified by the ClusterIdentifier - // parameter. - // - // SnapshotIdentifier is a required field - SnapshotIdentifier *string `type:"string" required:"true"` - - // The name of the source database that contains the table to restore from. - // - // SourceDatabaseName is a required field - SourceDatabaseName *string `type:"string" required:"true"` - - // The name of the source schema that contains the table to restore from. If - // you do not specify a SourceSchemaName value, the default is public. - SourceSchemaName *string `type:"string"` - - // The name of the source table to restore from. - // - // SourceTableName is a required field - SourceTableName *string `type:"string" required:"true"` - - // The name of the database to restore the table to. - TargetDatabaseName *string `type:"string"` - - // The name of the schema to restore the table to. - TargetSchemaName *string `type:"string"` -} - -// String returns the string representation -func (s RestoreTableFromClusterSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreTableFromClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreTableFromClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreTableFromClusterSnapshotInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - if s.NewTableName == nil { - invalidParams.Add(request.NewErrParamRequired("NewTableName")) - } - if s.SnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier")) - } - if s.SourceDatabaseName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDatabaseName")) - } - if s.SourceTableName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceTableName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *RestoreTableFromClusterSnapshotInput) SetClusterIdentifier(v string) *RestoreTableFromClusterSnapshotInput { - s.ClusterIdentifier = &v - return s -} - -// SetNewTableName sets the NewTableName field's value. -func (s *RestoreTableFromClusterSnapshotInput) SetNewTableName(v string) *RestoreTableFromClusterSnapshotInput { - s.NewTableName = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *RestoreTableFromClusterSnapshotInput) SetSnapshotIdentifier(v string) *RestoreTableFromClusterSnapshotInput { - s.SnapshotIdentifier = &v - return s -} - -// SetSourceDatabaseName sets the SourceDatabaseName field's value. -func (s *RestoreTableFromClusterSnapshotInput) SetSourceDatabaseName(v string) *RestoreTableFromClusterSnapshotInput { - s.SourceDatabaseName = &v - return s -} - -// SetSourceSchemaName sets the SourceSchemaName field's value. -func (s *RestoreTableFromClusterSnapshotInput) SetSourceSchemaName(v string) *RestoreTableFromClusterSnapshotInput { - s.SourceSchemaName = &v - return s -} - -// SetSourceTableName sets the SourceTableName field's value. -func (s *RestoreTableFromClusterSnapshotInput) SetSourceTableName(v string) *RestoreTableFromClusterSnapshotInput { - s.SourceTableName = &v - return s -} - -// SetTargetDatabaseName sets the TargetDatabaseName field's value. -func (s *RestoreTableFromClusterSnapshotInput) SetTargetDatabaseName(v string) *RestoreTableFromClusterSnapshotInput { - s.TargetDatabaseName = &v - return s -} - -// SetTargetSchemaName sets the TargetSchemaName field's value. -func (s *RestoreTableFromClusterSnapshotInput) SetTargetSchemaName(v string) *RestoreTableFromClusterSnapshotInput { - s.TargetSchemaName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RestoreTableFromClusterSnapshotResult -type RestoreTableFromClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Describes the status of a RestoreTableFromClusterSnapshot operation. - TableRestoreStatus *TableRestoreStatus `type:"structure"` -} - -// String returns the string representation -func (s RestoreTableFromClusterSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreTableFromClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetTableRestoreStatus sets the TableRestoreStatus field's value. -func (s *RestoreTableFromClusterSnapshotOutput) SetTableRestoreStatus(v *TableRestoreStatus) *RestoreTableFromClusterSnapshotOutput { - s.TableRestoreStatus = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeClusterSecurityGroupIngressMessage -type RevokeClusterSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The IP range for which to revoke access. This range must be a valid Classless - // Inter-Domain Routing (CIDR) block of IP addresses. If CIDRIP is specified, - // EC2SecurityGroupName and EC2SecurityGroupOwnerId cannot be provided. - CIDRIP *string `type:"string"` - - // The name of the security Group from which to revoke the ingress rule. - // - // ClusterSecurityGroupName is a required field - ClusterSecurityGroupName *string `type:"string" required:"true"` - - // The name of the EC2 Security Group whose access is to be revoked. If EC2SecurityGroupName - // is specified, EC2SecurityGroupOwnerId must also be provided and CIDRIP cannot - // be provided. - EC2SecurityGroupName *string `type:"string"` - - // The AWS account number of the owner of the security group specified in the - // EC2SecurityGroupName parameter. The AWS access key ID is not an acceptable - // value. If EC2SecurityGroupOwnerId is specified, EC2SecurityGroupName must - // also be provided. and CIDRIP cannot be provided. - // - // Example: 111122223333 - EC2SecurityGroupOwnerId *string `type:"string"` -} - -// String returns the string representation -func (s RevokeClusterSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeClusterSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RevokeClusterSecurityGroupIngressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RevokeClusterSecurityGroupIngressInput"} - if s.ClusterSecurityGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterSecurityGroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCIDRIP sets the CIDRIP field's value. -func (s *RevokeClusterSecurityGroupIngressInput) SetCIDRIP(v string) *RevokeClusterSecurityGroupIngressInput { - s.CIDRIP = &v - return s -} - -// SetClusterSecurityGroupName sets the ClusterSecurityGroupName field's value. -func (s *RevokeClusterSecurityGroupIngressInput) SetClusterSecurityGroupName(v string) *RevokeClusterSecurityGroupIngressInput { - s.ClusterSecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupName sets the EC2SecurityGroupName field's value. -func (s *RevokeClusterSecurityGroupIngressInput) SetEC2SecurityGroupName(v string) *RevokeClusterSecurityGroupIngressInput { - s.EC2SecurityGroupName = &v - return s -} - -// SetEC2SecurityGroupOwnerId sets the EC2SecurityGroupOwnerId field's value. -func (s *RevokeClusterSecurityGroupIngressInput) SetEC2SecurityGroupOwnerId(v string) *RevokeClusterSecurityGroupIngressInput { - s.EC2SecurityGroupOwnerId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeClusterSecurityGroupIngressResult -type RevokeClusterSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` - - // Describes a security group. - ClusterSecurityGroup *ClusterSecurityGroup `type:"structure"` -} - -// String returns the string representation -func (s RevokeClusterSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeClusterSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// SetClusterSecurityGroup sets the ClusterSecurityGroup field's value. -func (s *RevokeClusterSecurityGroupIngressOutput) SetClusterSecurityGroup(v *ClusterSecurityGroup) *RevokeClusterSecurityGroupIngressOutput { - s.ClusterSecurityGroup = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeSnapshotAccessMessage -type RevokeSnapshotAccessInput struct { - _ struct{} `type:"structure"` - - // The identifier of the AWS customer account that can no longer restore the - // specified snapshot. - // - // AccountWithRestoreAccess is a required field - AccountWithRestoreAccess *string `type:"string" required:"true"` - - // The identifier of the cluster the snapshot was created from. This parameter - // is required if your IAM user has a policy containing a snapshot resource - // element that specifies anything other than * for the cluster name. - SnapshotClusterIdentifier *string `type:"string"` - - // The identifier of the snapshot that the account can no longer access. - // - // SnapshotIdentifier is a required field - SnapshotIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RevokeSnapshotAccessInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSnapshotAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RevokeSnapshotAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RevokeSnapshotAccessInput"} - if s.AccountWithRestoreAccess == nil { - invalidParams.Add(request.NewErrParamRequired("AccountWithRestoreAccess")) - } - if s.SnapshotIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountWithRestoreAccess sets the AccountWithRestoreAccess field's value. -func (s *RevokeSnapshotAccessInput) SetAccountWithRestoreAccess(v string) *RevokeSnapshotAccessInput { - s.AccountWithRestoreAccess = &v - return s -} - -// SetSnapshotClusterIdentifier sets the SnapshotClusterIdentifier field's value. -func (s *RevokeSnapshotAccessInput) SetSnapshotClusterIdentifier(v string) *RevokeSnapshotAccessInput { - s.SnapshotClusterIdentifier = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *RevokeSnapshotAccessInput) SetSnapshotIdentifier(v string) *RevokeSnapshotAccessInput { - s.SnapshotIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RevokeSnapshotAccessResult -type RevokeSnapshotAccessOutput struct { - _ struct{} `type:"structure"` - - // Describes a snapshot. - Snapshot *Snapshot `type:"structure"` -} - -// String returns the string representation -func (s RevokeSnapshotAccessOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSnapshotAccessOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *RevokeSnapshotAccessOutput) SetSnapshot(v *Snapshot) *RevokeSnapshotAccessOutput { - s.Snapshot = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RotateEncryptionKeyMessage -type RotateEncryptionKeyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the cluster that you want to rotate the encryption - // keys for. - // - // Constraints: Must be the name of valid cluster that has encryption enabled. - // - // ClusterIdentifier is a required field - ClusterIdentifier *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RotateEncryptionKeyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RotateEncryptionKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RotateEncryptionKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RotateEncryptionKeyInput"} - if s.ClusterIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *RotateEncryptionKeyInput) SetClusterIdentifier(v string) *RotateEncryptionKeyInput { - s.ClusterIdentifier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/RotateEncryptionKeyResult -type RotateEncryptionKeyOutput struct { - _ struct{} `type:"structure"` - - // Describes a cluster. - Cluster *Cluster `type:"structure"` -} - -// String returns the string representation -func (s RotateEncryptionKeyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RotateEncryptionKeyOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *RotateEncryptionKeyOutput) SetCluster(v *Cluster) *RotateEncryptionKeyOutput { - s.Cluster = v - return s -} - -// Describes a snapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/Snapshot -type Snapshot struct { - _ struct{} `type:"structure"` - - // A list of the AWS customer accounts authorized to restore the snapshot. Returns - // null if no accounts are authorized. Visible only to the snapshot owner. - AccountsWithRestoreAccess []*AccountWithRestoreAccess `locationNameList:"AccountWithRestoreAccess" type:"list"` - - // The size of the incremental backup. - ActualIncrementalBackupSizeInMegaBytes *float64 `type:"double"` - - // The Availability Zone in which the cluster was created. - AvailabilityZone *string `type:"string"` - - // The number of megabytes that have been transferred to the snapshot backup. - BackupProgressInMegaBytes *float64 `type:"double"` - - // The time (UTC) when the cluster was originally created. - ClusterCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The identifier of the cluster for which the snapshot was taken. - ClusterIdentifier *string `type:"string"` - - // The version ID of the Amazon Redshift engine that is running on the cluster. - ClusterVersion *string `type:"string"` - - // The number of megabytes per second being transferred to the snapshot backup. - // Returns 0 for a completed backup. - CurrentBackupRateInMegaBytesPerSecond *float64 `type:"double"` - - // The name of the database that was created when the cluster was created. - DBName *string `type:"string"` - - // The amount of time an in-progress snapshot backup has been running, or the - // amount of time it took a completed backup to finish. - ElapsedTimeInSeconds *int64 `type:"long"` - - // If true, the data in the snapshot is encrypted at rest. - Encrypted *bool `type:"boolean"` - - // A boolean that indicates whether the snapshot data is encrypted using the - // HSM keys of the source cluster. true indicates that the data is encrypted - // using HSM keys. - EncryptedWithHSM *bool `type:"boolean"` - - // An option that specifies whether to create the cluster with enhanced VPC - // routing enabled. To create a cluster that uses enhanced VPC routing, the - // cluster must be in a VPC. For more information, see Enhanced VPC Routing - // (http://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html) - // in the Amazon Redshift Cluster Management Guide. - // - // If this option is true, enhanced VPC routing is enabled. - // - // Default: false - EnhancedVpcRouting *bool `type:"boolean"` - - // The estimate of the time remaining before the snapshot backup will complete. - // Returns 0 for a completed backup. - EstimatedSecondsToCompletion *int64 `type:"long"` - - // The AWS Key Management Service (KMS) key ID of the encryption key that was - // used to encrypt data in the cluster from which the snapshot was taken. - KmsKeyId *string `type:"string"` - - // The master user name for the cluster. - MasterUsername *string `type:"string"` - - // The node type of the nodes in the cluster. - NodeType *string `type:"string"` - - // The number of nodes in the cluster. - NumberOfNodes *int64 `type:"integer"` - - // For manual snapshots, the AWS customer account used to create or copy the - // snapshot. For automatic snapshots, the owner of the cluster. The owner can - // perform all snapshot actions, such as sharing a manual snapshot. - OwnerAccount *string `type:"string"` - - // The port that the cluster is listening on. - Port *int64 `type:"integer"` - - // The list of node types that this cluster snapshot is able to restore into. - RestorableNodeTypes []*string `locationNameList:"NodeType" type:"list"` - - // The time (UTC) when Amazon Redshift began the snapshot. A snapshot contains - // a copy of the cluster data as of this exact time. - SnapshotCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The snapshot identifier that is provided in the request. - SnapshotIdentifier *string `type:"string"` - - // The snapshot type. Snapshots created using CreateClusterSnapshot and CopyClusterSnapshot - // will be of type "manual". - SnapshotType *string `type:"string"` - - // The source region from which the snapshot was copied. - SourceRegion *string `type:"string"` - - // The snapshot status. The value of the status depends on the API operation - // used. - // - // * CreateClusterSnapshot and CopyClusterSnapshot returns status as "creating". - // - // - // * DescribeClusterSnapshots returns status as "creating", "available", - // "final snapshot", or "failed". - // - // * DeleteClusterSnapshot returns status as "deleted". - Status *string `type:"string"` - - // The list of tags for the cluster snapshot. - Tags []*Tag `locationNameList:"Tag" type:"list"` - - // The size of the complete set of backup data that would be used to restore - // the cluster. - TotalBackupSizeInMegaBytes *float64 `type:"double"` - - // The VPC identifier of the cluster if the snapshot is from a cluster in a - // VPC. Otherwise, this field is not in the output. - VpcId *string `type:"string"` -} - -// 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() -} - -// SetAccountsWithRestoreAccess sets the AccountsWithRestoreAccess field's value. -func (s *Snapshot) SetAccountsWithRestoreAccess(v []*AccountWithRestoreAccess) *Snapshot { - s.AccountsWithRestoreAccess = v - return s -} - -// SetActualIncrementalBackupSizeInMegaBytes sets the ActualIncrementalBackupSizeInMegaBytes field's value. -func (s *Snapshot) SetActualIncrementalBackupSizeInMegaBytes(v float64) *Snapshot { - s.ActualIncrementalBackupSizeInMegaBytes = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Snapshot) SetAvailabilityZone(v string) *Snapshot { - s.AvailabilityZone = &v - return s -} - -// SetBackupProgressInMegaBytes sets the BackupProgressInMegaBytes field's value. -func (s *Snapshot) SetBackupProgressInMegaBytes(v float64) *Snapshot { - s.BackupProgressInMegaBytes = &v - return s -} - -// SetClusterCreateTime sets the ClusterCreateTime field's value. -func (s *Snapshot) SetClusterCreateTime(v time.Time) *Snapshot { - s.ClusterCreateTime = &v - return s -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *Snapshot) SetClusterIdentifier(v string) *Snapshot { - s.ClusterIdentifier = &v - return s -} - -// SetClusterVersion sets the ClusterVersion field's value. -func (s *Snapshot) SetClusterVersion(v string) *Snapshot { - s.ClusterVersion = &v - return s -} - -// SetCurrentBackupRateInMegaBytesPerSecond sets the CurrentBackupRateInMegaBytesPerSecond field's value. -func (s *Snapshot) SetCurrentBackupRateInMegaBytesPerSecond(v float64) *Snapshot { - s.CurrentBackupRateInMegaBytesPerSecond = &v - return s -} - -// SetDBName sets the DBName field's value. -func (s *Snapshot) SetDBName(v string) *Snapshot { - s.DBName = &v - return s -} - -// SetElapsedTimeInSeconds sets the ElapsedTimeInSeconds field's value. -func (s *Snapshot) SetElapsedTimeInSeconds(v int64) *Snapshot { - s.ElapsedTimeInSeconds = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *Snapshot) SetEncrypted(v bool) *Snapshot { - s.Encrypted = &v - return s -} - -// SetEncryptedWithHSM sets the EncryptedWithHSM field's value. -func (s *Snapshot) SetEncryptedWithHSM(v bool) *Snapshot { - s.EncryptedWithHSM = &v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *Snapshot) SetEnhancedVpcRouting(v bool) *Snapshot { - s.EnhancedVpcRouting = &v - return s -} - -// SetEstimatedSecondsToCompletion sets the EstimatedSecondsToCompletion field's value. -func (s *Snapshot) SetEstimatedSecondsToCompletion(v int64) *Snapshot { - s.EstimatedSecondsToCompletion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Snapshot) SetKmsKeyId(v string) *Snapshot { - s.KmsKeyId = &v - return s -} - -// SetMasterUsername sets the MasterUsername field's value. -func (s *Snapshot) SetMasterUsername(v string) *Snapshot { - s.MasterUsername = &v - return s -} - -// SetNodeType sets the NodeType field's value. -func (s *Snapshot) SetNodeType(v string) *Snapshot { - s.NodeType = &v - return s -} - -// SetNumberOfNodes sets the NumberOfNodes field's value. -func (s *Snapshot) SetNumberOfNodes(v int64) *Snapshot { - s.NumberOfNodes = &v - return s -} - -// SetOwnerAccount sets the OwnerAccount field's value. -func (s *Snapshot) SetOwnerAccount(v string) *Snapshot { - s.OwnerAccount = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Snapshot) SetPort(v int64) *Snapshot { - s.Port = &v - return s -} - -// SetRestorableNodeTypes sets the RestorableNodeTypes field's value. -func (s *Snapshot) SetRestorableNodeTypes(v []*string) *Snapshot { - s.RestorableNodeTypes = v - return s -} - -// SetSnapshotCreateTime sets the SnapshotCreateTime field's value. -func (s *Snapshot) SetSnapshotCreateTime(v time.Time) *Snapshot { - s.SnapshotCreateTime = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *Snapshot) SetSnapshotIdentifier(v string) *Snapshot { - s.SnapshotIdentifier = &v - return s -} - -// SetSnapshotType sets the SnapshotType field's value. -func (s *Snapshot) SetSnapshotType(v string) *Snapshot { - s.SnapshotType = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *Snapshot) SetSourceRegion(v string) *Snapshot { - s.SourceRegion = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Snapshot) SetStatus(v string) *Snapshot { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Snapshot) SetTags(v []*Tag) *Snapshot { - s.Tags = v - return s -} - -// SetTotalBackupSizeInMegaBytes sets the TotalBackupSizeInMegaBytes field's value. -func (s *Snapshot) SetTotalBackupSizeInMegaBytes(v float64) *Snapshot { - s.TotalBackupSizeInMegaBytes = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Snapshot) SetVpcId(v string) *Snapshot { - s.VpcId = &v - return s -} - -// The snapshot copy grant that grants Amazon Redshift permission to encrypt -// copied snapshots with the specified customer master key (CMK) from AWS KMS -// in the destination region. -// -// For more information about managing snapshot copy grants, go to Amazon Redshift -// Database Encryption (http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html) -// in the Amazon Redshift Cluster Management Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/SnapshotCopyGrant -type SnapshotCopyGrant struct { - _ struct{} `type:"structure"` - - // The unique identifier of the customer master key (CMK) in AWS KMS to which - // Amazon Redshift is granted permission. - KmsKeyId *string `type:"string"` - - // The name of the snapshot copy grant. - SnapshotCopyGrantName *string `type:"string"` - - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s SnapshotCopyGrant) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotCopyGrant) GoString() string { - return s.String() -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *SnapshotCopyGrant) SetKmsKeyId(v string) *SnapshotCopyGrant { - s.KmsKeyId = &v - return s -} - -// SetSnapshotCopyGrantName sets the SnapshotCopyGrantName field's value. -func (s *SnapshotCopyGrant) SetSnapshotCopyGrantName(v string) *SnapshotCopyGrant { - s.SnapshotCopyGrantName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SnapshotCopyGrant) SetTags(v []*Tag) *SnapshotCopyGrant { - s.Tags = v - return s -} - -// Describes a subnet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/Subnet -type Subnet struct { - _ struct{} `type:"structure"` - - // Describes an availability zone. - SubnetAvailabilityZone *AvailabilityZone `type:"structure"` - - // The identifier of the subnet. - SubnetIdentifier *string `type:"string"` - - // The status of the subnet. - SubnetStatus *string `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() -} - -// SetSubnetAvailabilityZone sets the SubnetAvailabilityZone field's value. -func (s *Subnet) SetSubnetAvailabilityZone(v *AvailabilityZone) *Subnet { - s.SubnetAvailabilityZone = v - return s -} - -// SetSubnetIdentifier sets the SubnetIdentifier field's value. -func (s *Subnet) SetSubnetIdentifier(v string) *Subnet { - s.SubnetIdentifier = &v - return s -} - -// SetSubnetStatus sets the SubnetStatus field's value. -func (s *Subnet) SetSubnetStatus(v string) *Subnet { - s.SubnetStatus = &v - return s -} - -// Describes the status of a RestoreTableFromClusterSnapshot operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/TableRestoreStatus -type TableRestoreStatus struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Redshift cluster that the table is being restored - // to. - ClusterIdentifier *string `type:"string"` - - // A description of the status of the table restore request. Status values include - // SUCCEEDED, FAILED, CANCELED, PENDING, IN_PROGRESS. - Message *string `type:"string"` - - // The name of the table to create as a result of the table restore request. - NewTableName *string `type:"string"` - - // The amount of data restored to the new table so far, in megabytes (MB). - ProgressInMegaBytes *int64 `type:"long"` - - // The time that the table restore request was made, in Universal Coordinated - // Time (UTC). - RequestTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The identifier of the snapshot that the table is being restored from. - SnapshotIdentifier *string `type:"string"` - - // The name of the source database that contains the table being restored. - SourceDatabaseName *string `type:"string"` - - // The name of the source schema that contains the table being restored. - SourceSchemaName *string `type:"string"` - - // The name of the source table being restored. - SourceTableName *string `type:"string"` - - // A value that describes the current state of the table restore request. - // - // Valid Values: SUCCEEDED, FAILED, CANCELED, PENDING, IN_PROGRESS - Status *string `type:"string" enum:"TableRestoreStatusType"` - - // The unique identifier for the table restore request. - TableRestoreRequestId *string `type:"string"` - - // The name of the database to restore the table to. - TargetDatabaseName *string `type:"string"` - - // The name of the schema to restore the table to. - TargetSchemaName *string `type:"string"` - - // The total amount of data to restore to the new table, in megabytes (MB). - TotalDataInMegaBytes *int64 `type:"long"` -} - -// String returns the string representation -func (s TableRestoreStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TableRestoreStatus) GoString() string { - return s.String() -} - -// SetClusterIdentifier sets the ClusterIdentifier field's value. -func (s *TableRestoreStatus) SetClusterIdentifier(v string) *TableRestoreStatus { - s.ClusterIdentifier = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *TableRestoreStatus) SetMessage(v string) *TableRestoreStatus { - s.Message = &v - return s -} - -// SetNewTableName sets the NewTableName field's value. -func (s *TableRestoreStatus) SetNewTableName(v string) *TableRestoreStatus { - s.NewTableName = &v - return s -} - -// SetProgressInMegaBytes sets the ProgressInMegaBytes field's value. -func (s *TableRestoreStatus) SetProgressInMegaBytes(v int64) *TableRestoreStatus { - s.ProgressInMegaBytes = &v - return s -} - -// SetRequestTime sets the RequestTime field's value. -func (s *TableRestoreStatus) SetRequestTime(v time.Time) *TableRestoreStatus { - s.RequestTime = &v - return s -} - -// SetSnapshotIdentifier sets the SnapshotIdentifier field's value. -func (s *TableRestoreStatus) SetSnapshotIdentifier(v string) *TableRestoreStatus { - s.SnapshotIdentifier = &v - return s -} - -// SetSourceDatabaseName sets the SourceDatabaseName field's value. -func (s *TableRestoreStatus) SetSourceDatabaseName(v string) *TableRestoreStatus { - s.SourceDatabaseName = &v - return s -} - -// SetSourceSchemaName sets the SourceSchemaName field's value. -func (s *TableRestoreStatus) SetSourceSchemaName(v string) *TableRestoreStatus { - s.SourceSchemaName = &v - return s -} - -// SetSourceTableName sets the SourceTableName field's value. -func (s *TableRestoreStatus) SetSourceTableName(v string) *TableRestoreStatus { - s.SourceTableName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TableRestoreStatus) SetStatus(v string) *TableRestoreStatus { - s.Status = &v - return s -} - -// SetTableRestoreRequestId sets the TableRestoreRequestId field's value. -func (s *TableRestoreStatus) SetTableRestoreRequestId(v string) *TableRestoreStatus { - s.TableRestoreRequestId = &v - return s -} - -// SetTargetDatabaseName sets the TargetDatabaseName field's value. -func (s *TableRestoreStatus) SetTargetDatabaseName(v string) *TableRestoreStatus { - s.TargetDatabaseName = &v - return s -} - -// SetTargetSchemaName sets the TargetSchemaName field's value. -func (s *TableRestoreStatus) SetTargetSchemaName(v string) *TableRestoreStatus { - s.TargetSchemaName = &v - return s -} - -// SetTotalDataInMegaBytes sets the TotalDataInMegaBytes field's value. -func (s *TableRestoreStatus) SetTotalDataInMegaBytes(v int64) *TableRestoreStatus { - s.TotalDataInMegaBytes = &v - return s -} - -// A tag consisting of a name/value pair for a resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key, or name, for the resource tag. - Key *string `type:"string"` - - // The value for the resource 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 -} - -// A tag and its associated resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/TaggedResource -type TaggedResource struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) with which the tag is associated. For example, - // arn:aws:redshift:us-east-1:123456789:cluster:t1. - ResourceName *string `type:"string"` - - // The type of resource with which the tag is associated. Valid resource types - // are: - // - // * Cluster - // - // * CIDR/IP - // - // * EC2 security group - // - // * Snapshot - // - // * Cluster security group - // - // * Subnet group - // - // * HSM connection - // - // * HSM certificate - // - // * Parameter group - // - // For more information about Amazon Redshift resource types and constructing - // ARNs, go to Constructing an Amazon Redshift Amazon Resource Name (ARN) (http://docs.aws.amazon.com/redshift/latest/mgmt/constructing-redshift-arn.html) - // in the Amazon Redshift Cluster Management Guide. - ResourceType *string `type:"string"` - - // The tag for the resource. - Tag *Tag `type:"structure"` -} - -// String returns the string representation -func (s TaggedResource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TaggedResource) GoString() string { - return s.String() -} - -// SetResourceName sets the ResourceName field's value. -func (s *TaggedResource) SetResourceName(v string) *TaggedResource { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *TaggedResource) SetResourceType(v string) *TaggedResource { - s.ResourceType = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *TaggedResource) SetTag(v *Tag) *TaggedResource { - s.Tag = v - return s -} - -// Describes the members of a VPC security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/VpcSecurityGroupMembership -type VpcSecurityGroupMembership struct { - _ struct{} `type:"structure"` - - // The status of the VPC security group. - Status *string `type:"string"` - - // The identifier of the VPC security group. - VpcSecurityGroupId *string `type:"string"` -} - -// String returns the string representation -func (s VpcSecurityGroupMembership) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcSecurityGroupMembership) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *VpcSecurityGroupMembership) SetStatus(v string) *VpcSecurityGroupMembership { - s.Status = &v - return s -} - -// SetVpcSecurityGroupId sets the VpcSecurityGroupId field's value. -func (s *VpcSecurityGroupMembership) SetVpcSecurityGroupId(v string) *VpcSecurityGroupMembership { - s.VpcSecurityGroupId = &v - return s -} - -const ( - // ParameterApplyTypeStatic is a ParameterApplyType enum value - ParameterApplyTypeStatic = "static" - - // ParameterApplyTypeDynamic is a ParameterApplyType enum value - ParameterApplyTypeDynamic = "dynamic" -) - -const ( - // SourceTypeCluster is a SourceType enum value - SourceTypeCluster = "cluster" - - // SourceTypeClusterParameterGroup is a SourceType enum value - SourceTypeClusterParameterGroup = "cluster-parameter-group" - - // SourceTypeClusterSecurityGroup is a SourceType enum value - SourceTypeClusterSecurityGroup = "cluster-security-group" - - // SourceTypeClusterSnapshot is a SourceType enum value - SourceTypeClusterSnapshot = "cluster-snapshot" -) - -const ( - // TableRestoreStatusTypePending is a TableRestoreStatusType enum value - TableRestoreStatusTypePending = "PENDING" - - // TableRestoreStatusTypeInProgress is a TableRestoreStatusType enum value - TableRestoreStatusTypeInProgress = "IN_PROGRESS" - - // TableRestoreStatusTypeSucceeded is a TableRestoreStatusType enum value - TableRestoreStatusTypeSucceeded = "SUCCEEDED" - - // TableRestoreStatusTypeFailed is a TableRestoreStatusType enum value - TableRestoreStatusTypeFailed = "FAILED" - - // TableRestoreStatusTypeCanceled is a TableRestoreStatusType enum value - TableRestoreStatusTypeCanceled = "CANCELED" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go deleted file mode 100644 index b59f68d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go +++ /dev/null @@ -1,566 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package redshift - -const ( - - // ErrCodeAccessToSnapshotDeniedFault for service response error code - // "AccessToSnapshotDenied". - // - // The owner of the specified snapshot has not authorized your account to access - // the snapshot. - ErrCodeAccessToSnapshotDeniedFault = "AccessToSnapshotDenied" - - // ErrCodeAuthorizationAlreadyExistsFault for service response error code - // "AuthorizationAlreadyExists". - // - // The specified CIDR block or EC2 security group is already authorized for - // the specified cluster security group. - ErrCodeAuthorizationAlreadyExistsFault = "AuthorizationAlreadyExists" - - // ErrCodeAuthorizationNotFoundFault for service response error code - // "AuthorizationNotFound". - // - // The specified CIDR IP range or EC2 security group is not authorized for the - // specified cluster security group. - ErrCodeAuthorizationNotFoundFault = "AuthorizationNotFound" - - // ErrCodeAuthorizationQuotaExceededFault for service response error code - // "AuthorizationQuotaExceeded". - // - // The authorization quota for the cluster security group has been reached. - ErrCodeAuthorizationQuotaExceededFault = "AuthorizationQuotaExceeded" - - // ErrCodeBucketNotFoundFault for service response error code - // "BucketNotFoundFault". - // - // Could not find the specified S3 bucket. - ErrCodeBucketNotFoundFault = "BucketNotFoundFault" - - // ErrCodeClusterAlreadyExistsFault for service response error code - // "ClusterAlreadyExists". - // - // The account already has a cluster with the given identifier. - ErrCodeClusterAlreadyExistsFault = "ClusterAlreadyExists" - - // ErrCodeClusterNotFoundFault for service response error code - // "ClusterNotFound". - // - // The ClusterIdentifier parameter does not refer to an existing cluster. - ErrCodeClusterNotFoundFault = "ClusterNotFound" - - // ErrCodeClusterParameterGroupAlreadyExistsFault for service response error code - // "ClusterParameterGroupAlreadyExists". - // - // A cluster parameter group with the same name already exists. - ErrCodeClusterParameterGroupAlreadyExistsFault = "ClusterParameterGroupAlreadyExists" - - // ErrCodeClusterParameterGroupNotFoundFault for service response error code - // "ClusterParameterGroupNotFound". - // - // The parameter group name does not refer to an existing parameter group. - ErrCodeClusterParameterGroupNotFoundFault = "ClusterParameterGroupNotFound" - - // ErrCodeClusterParameterGroupQuotaExceededFault for service response error code - // "ClusterParameterGroupQuotaExceeded". - // - // The request would result in the user exceeding the allowed number of cluster - // parameter groups. For information about increasing your quota, go to Limits - // in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeClusterParameterGroupQuotaExceededFault = "ClusterParameterGroupQuotaExceeded" - - // ErrCodeClusterQuotaExceededFault for service response error code - // "ClusterQuotaExceeded". - // - // The request would exceed the allowed number of cluster instances for this - // account. For information about increasing your quota, go to Limits in Amazon - // Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeClusterQuotaExceededFault = "ClusterQuotaExceeded" - - // ErrCodeClusterSecurityGroupAlreadyExistsFault for service response error code - // "ClusterSecurityGroupAlreadyExists". - // - // A cluster security group with the same name already exists. - ErrCodeClusterSecurityGroupAlreadyExistsFault = "ClusterSecurityGroupAlreadyExists" - - // ErrCodeClusterSecurityGroupNotFoundFault for service response error code - // "ClusterSecurityGroupNotFound". - // - // The cluster security group name does not refer to an existing cluster security - // group. - ErrCodeClusterSecurityGroupNotFoundFault = "ClusterSecurityGroupNotFound" - - // ErrCodeClusterSecurityGroupQuotaExceededFault for service response error code - // "QuotaExceeded.ClusterSecurityGroup". - // - // The request would result in the user exceeding the allowed number of cluster - // security groups. For information about increasing your quota, go to Limits - // in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeClusterSecurityGroupQuotaExceededFault = "QuotaExceeded.ClusterSecurityGroup" - - // ErrCodeClusterSnapshotAlreadyExistsFault for service response error code - // "ClusterSnapshotAlreadyExists". - // - // The value specified as a snapshot identifier is already used by an existing - // snapshot. - ErrCodeClusterSnapshotAlreadyExistsFault = "ClusterSnapshotAlreadyExists" - - // ErrCodeClusterSnapshotNotFoundFault for service response error code - // "ClusterSnapshotNotFound". - // - // The snapshot identifier does not refer to an existing cluster snapshot. - ErrCodeClusterSnapshotNotFoundFault = "ClusterSnapshotNotFound" - - // ErrCodeClusterSnapshotQuotaExceededFault for service response error code - // "ClusterSnapshotQuotaExceeded". - // - // The request would result in the user exceeding the allowed number of cluster - // snapshots. - ErrCodeClusterSnapshotQuotaExceededFault = "ClusterSnapshotQuotaExceeded" - - // ErrCodeClusterSubnetGroupAlreadyExistsFault for service response error code - // "ClusterSubnetGroupAlreadyExists". - // - // A ClusterSubnetGroupName is already used by an existing cluster subnet group. - ErrCodeClusterSubnetGroupAlreadyExistsFault = "ClusterSubnetGroupAlreadyExists" - - // ErrCodeClusterSubnetGroupNotFoundFault for service response error code - // "ClusterSubnetGroupNotFoundFault". - // - // The cluster subnet group name does not refer to an existing cluster subnet - // group. - ErrCodeClusterSubnetGroupNotFoundFault = "ClusterSubnetGroupNotFoundFault" - - // ErrCodeClusterSubnetGroupQuotaExceededFault for service response error code - // "ClusterSubnetGroupQuotaExceeded". - // - // The request would result in user exceeding the allowed number of cluster - // subnet groups. For information about increasing your quota, go to Limits - // in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeClusterSubnetGroupQuotaExceededFault = "ClusterSubnetGroupQuotaExceeded" - - // ErrCodeClusterSubnetQuotaExceededFault for service response error code - // "ClusterSubnetQuotaExceededFault". - // - // The request would result in user exceeding the allowed number of subnets - // in a cluster subnet groups. For information about increasing your quota, - // go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeClusterSubnetQuotaExceededFault = "ClusterSubnetQuotaExceededFault" - - // ErrCodeCopyToRegionDisabledFault for service response error code - // "CopyToRegionDisabledFault". - // - // Cross-region snapshot copy was temporarily disabled. Try your request again. - ErrCodeCopyToRegionDisabledFault = "CopyToRegionDisabledFault" - - // ErrCodeDependentServiceRequestThrottlingFault for service response error code - // "DependentServiceRequestThrottlingFault". - // - // The request cannot be completed because a dependent service is throttling - // requests made by Amazon Redshift on your behalf. Wait and retry the request. - ErrCodeDependentServiceRequestThrottlingFault = "DependentServiceRequestThrottlingFault" - - // ErrCodeEventSubscriptionQuotaExceededFault for service response error code - // "EventSubscriptionQuotaExceeded". - // - // The request would exceed the allowed number of event subscriptions for this - // account. For information about increasing your quota, go to Limits in Amazon - // Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeEventSubscriptionQuotaExceededFault = "EventSubscriptionQuotaExceeded" - - // ErrCodeHsmClientCertificateAlreadyExistsFault for service response error code - // "HsmClientCertificateAlreadyExistsFault". - // - // There is already an existing Amazon Redshift HSM client certificate with - // the specified identifier. - ErrCodeHsmClientCertificateAlreadyExistsFault = "HsmClientCertificateAlreadyExistsFault" - - // ErrCodeHsmClientCertificateNotFoundFault for service response error code - // "HsmClientCertificateNotFoundFault". - // - // There is no Amazon Redshift HSM client certificate with the specified identifier. - ErrCodeHsmClientCertificateNotFoundFault = "HsmClientCertificateNotFoundFault" - - // ErrCodeHsmClientCertificateQuotaExceededFault for service response error code - // "HsmClientCertificateQuotaExceededFault". - // - // The quota for HSM client certificates has been reached. For information about - // increasing your quota, go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeHsmClientCertificateQuotaExceededFault = "HsmClientCertificateQuotaExceededFault" - - // ErrCodeHsmConfigurationAlreadyExistsFault for service response error code - // "HsmConfigurationAlreadyExistsFault". - // - // There is already an existing Amazon Redshift HSM configuration with the specified - // identifier. - ErrCodeHsmConfigurationAlreadyExistsFault = "HsmConfigurationAlreadyExistsFault" - - // ErrCodeHsmConfigurationNotFoundFault for service response error code - // "HsmConfigurationNotFoundFault". - // - // There is no Amazon Redshift HSM configuration with the specified identifier. - ErrCodeHsmConfigurationNotFoundFault = "HsmConfigurationNotFoundFault" - - // ErrCodeHsmConfigurationQuotaExceededFault for service response error code - // "HsmConfigurationQuotaExceededFault". - // - // The quota for HSM configurations has been reached. For information about - // increasing your quota, go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeHsmConfigurationQuotaExceededFault = "HsmConfigurationQuotaExceededFault" - - // ErrCodeInProgressTableRestoreQuotaExceededFault for service response error code - // "InProgressTableRestoreQuotaExceededFault". - // - // You have exceeded the allowed number of table restore requests. Wait for - // your current table restore requests to complete before making a new request. - ErrCodeInProgressTableRestoreQuotaExceededFault = "InProgressTableRestoreQuotaExceededFault" - - // ErrCodeIncompatibleOrderableOptions for service response error code - // "IncompatibleOrderableOptions". - // - // The specified options are incompatible. - ErrCodeIncompatibleOrderableOptions = "IncompatibleOrderableOptions" - - // ErrCodeInsufficientClusterCapacityFault for service response error code - // "InsufficientClusterCapacity". - // - // The number of nodes specified exceeds the allotted capacity of the cluster. - ErrCodeInsufficientClusterCapacityFault = "InsufficientClusterCapacity" - - // ErrCodeInsufficientS3BucketPolicyFault for service response error code - // "InsufficientS3BucketPolicyFault". - // - // The cluster does not have read bucket or put object permissions on the S3 - // bucket specified when enabling logging. - ErrCodeInsufficientS3BucketPolicyFault = "InsufficientS3BucketPolicyFault" - - // ErrCodeInvalidClusterParameterGroupStateFault for service response error code - // "InvalidClusterParameterGroupState". - // - // The cluster parameter group action can not be completed because another task - // is in progress that involves the parameter group. Wait a few moments and - // try the operation again. - ErrCodeInvalidClusterParameterGroupStateFault = "InvalidClusterParameterGroupState" - - // ErrCodeInvalidClusterSecurityGroupStateFault for service response error code - // "InvalidClusterSecurityGroupState". - // - // The state of the cluster security group is not available. - ErrCodeInvalidClusterSecurityGroupStateFault = "InvalidClusterSecurityGroupState" - - // ErrCodeInvalidClusterSnapshotStateFault for service response error code - // "InvalidClusterSnapshotState". - // - // The specified cluster snapshot is not in the available state, or other accounts - // are authorized to access the snapshot. - ErrCodeInvalidClusterSnapshotStateFault = "InvalidClusterSnapshotState" - - // ErrCodeInvalidClusterStateFault for service response error code - // "InvalidClusterState". - // - // The specified cluster is not in the available state. - ErrCodeInvalidClusterStateFault = "InvalidClusterState" - - // ErrCodeInvalidClusterSubnetGroupStateFault for service response error code - // "InvalidClusterSubnetGroupStateFault". - // - // The cluster subnet group cannot be deleted because it is in use. - ErrCodeInvalidClusterSubnetGroupStateFault = "InvalidClusterSubnetGroupStateFault" - - // ErrCodeInvalidClusterSubnetStateFault for service response error code - // "InvalidClusterSubnetStateFault". - // - // The state of the subnet is invalid. - ErrCodeInvalidClusterSubnetStateFault = "InvalidClusterSubnetStateFault" - - // ErrCodeInvalidElasticIpFault for service response error code - // "InvalidElasticIpFault". - // - // The Elastic IP (EIP) is invalid or cannot be found. - ErrCodeInvalidElasticIpFault = "InvalidElasticIpFault" - - // ErrCodeInvalidHsmClientCertificateStateFault for service response error code - // "InvalidHsmClientCertificateStateFault". - // - // The specified HSM client certificate is not in the available state, or it - // is still in use by one or more Amazon Redshift clusters. - ErrCodeInvalidHsmClientCertificateStateFault = "InvalidHsmClientCertificateStateFault" - - // ErrCodeInvalidHsmConfigurationStateFault for service response error code - // "InvalidHsmConfigurationStateFault". - // - // The specified HSM configuration is not in the available state, or it is still - // in use by one or more Amazon Redshift clusters. - ErrCodeInvalidHsmConfigurationStateFault = "InvalidHsmConfigurationStateFault" - - // ErrCodeInvalidRestoreFault for service response error code - // "InvalidRestore". - // - // The restore is invalid. - ErrCodeInvalidRestoreFault = "InvalidRestore" - - // ErrCodeInvalidS3BucketNameFault for service response error code - // "InvalidS3BucketNameFault". - // - // The S3 bucket name is invalid. For more information about naming rules, go - // to Bucket Restrictions and Limitations (http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html) - // in the Amazon Simple Storage Service (S3) Developer Guide. - ErrCodeInvalidS3BucketNameFault = "InvalidS3BucketNameFault" - - // ErrCodeInvalidS3KeyPrefixFault for service response error code - // "InvalidS3KeyPrefixFault". - // - // The string specified for the logging S3 key prefix does not comply with the - // documented constraints. - ErrCodeInvalidS3KeyPrefixFault = "InvalidS3KeyPrefixFault" - - // ErrCodeInvalidSnapshotCopyGrantStateFault for service response error code - // "InvalidSnapshotCopyGrantStateFault". - // - // The snapshot copy grant can't be deleted because it is used by one or more - // clusters. - ErrCodeInvalidSnapshotCopyGrantStateFault = "InvalidSnapshotCopyGrantStateFault" - - // ErrCodeInvalidSubnet for service response error code - // "InvalidSubnet". - // - // The requested subnet is not valid, or not all of the subnets are in the same - // VPC. - ErrCodeInvalidSubnet = "InvalidSubnet" - - // ErrCodeInvalidSubscriptionStateFault for service response error code - // "InvalidSubscriptionStateFault". - // - // The subscription request is invalid because it is a duplicate request. This - // subscription request is already in progress. - ErrCodeInvalidSubscriptionStateFault = "InvalidSubscriptionStateFault" - - // ErrCodeInvalidTableRestoreArgumentFault for service response error code - // "InvalidTableRestoreArgument". - // - // The value specified for the sourceDatabaseName, sourceSchemaName, or sourceTableName - // parameter, or a combination of these, doesn't exist in the snapshot. - ErrCodeInvalidTableRestoreArgumentFault = "InvalidTableRestoreArgument" - - // ErrCodeInvalidTagFault for service response error code - // "InvalidTagFault". - // - // The tag is invalid. - ErrCodeInvalidTagFault = "InvalidTagFault" - - // ErrCodeInvalidVPCNetworkStateFault for service response error code - // "InvalidVPCNetworkStateFault". - // - // The cluster subnet group does not cover all Availability Zones. - ErrCodeInvalidVPCNetworkStateFault = "InvalidVPCNetworkStateFault" - - // ErrCodeLimitExceededFault for service response error code - // "LimitExceededFault". - // - // The encryption key has exceeded its grant limit in AWS KMS. - ErrCodeLimitExceededFault = "LimitExceededFault" - - // ErrCodeNumberOfNodesPerClusterLimitExceededFault for service response error code - // "NumberOfNodesPerClusterLimitExceeded". - // - // The operation would exceed the number of nodes allowed for a cluster. - ErrCodeNumberOfNodesPerClusterLimitExceededFault = "NumberOfNodesPerClusterLimitExceeded" - - // ErrCodeNumberOfNodesQuotaExceededFault for service response error code - // "NumberOfNodesQuotaExceeded". - // - // The operation would exceed the number of nodes allotted to the account. For - // information about increasing your quota, go to Limits in Amazon Redshift - // (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeNumberOfNodesQuotaExceededFault = "NumberOfNodesQuotaExceeded" - - // ErrCodeReservedNodeAlreadyExistsFault for service response error code - // "ReservedNodeAlreadyExists". - // - // User already has a reservation with the given identifier. - ErrCodeReservedNodeAlreadyExistsFault = "ReservedNodeAlreadyExists" - - // ErrCodeReservedNodeNotFoundFault for service response error code - // "ReservedNodeNotFound". - // - // The specified reserved compute node not found. - ErrCodeReservedNodeNotFoundFault = "ReservedNodeNotFound" - - // ErrCodeReservedNodeOfferingNotFoundFault for service response error code - // "ReservedNodeOfferingNotFound". - // - // Specified offering does not exist. - ErrCodeReservedNodeOfferingNotFoundFault = "ReservedNodeOfferingNotFound" - - // ErrCodeReservedNodeQuotaExceededFault for service response error code - // "ReservedNodeQuotaExceeded". - // - // Request would exceed the user's compute node quota. For information about - // increasing your quota, go to Limits in Amazon Redshift (http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html) - // in the Amazon Redshift Cluster Management Guide. - ErrCodeReservedNodeQuotaExceededFault = "ReservedNodeQuotaExceeded" - - // ErrCodeResizeNotFoundFault for service response error code - // "ResizeNotFound". - // - // A resize operation for the specified cluster is not found. - ErrCodeResizeNotFoundFault = "ResizeNotFound" - - // ErrCodeResourceNotFoundFault for service response error code - // "ResourceNotFoundFault". - // - // The resource could not be found. - ErrCodeResourceNotFoundFault = "ResourceNotFoundFault" - - // ErrCodeSNSInvalidTopicFault for service response error code - // "SNSInvalidTopic". - // - // Amazon SNS has responded that there is a problem with the specified Amazon - // SNS topic. - ErrCodeSNSInvalidTopicFault = "SNSInvalidTopic" - - // ErrCodeSNSNoAuthorizationFault for service response error code - // "SNSNoAuthorization". - // - // You do not have permission to publish to the specified Amazon SNS topic. - ErrCodeSNSNoAuthorizationFault = "SNSNoAuthorization" - - // ErrCodeSNSTopicArnNotFoundFault for service response error code - // "SNSTopicArnNotFound". - // - // An Amazon SNS topic with the specified Amazon Resource Name (ARN) does not - // exist. - ErrCodeSNSTopicArnNotFoundFault = "SNSTopicArnNotFound" - - // ErrCodeSnapshotCopyAlreadyDisabledFault for service response error code - // "SnapshotCopyAlreadyDisabledFault". - // - // The cluster already has cross-region snapshot copy disabled. - ErrCodeSnapshotCopyAlreadyDisabledFault = "SnapshotCopyAlreadyDisabledFault" - - // ErrCodeSnapshotCopyAlreadyEnabledFault for service response error code - // "SnapshotCopyAlreadyEnabledFault". - // - // The cluster already has cross-region snapshot copy enabled. - ErrCodeSnapshotCopyAlreadyEnabledFault = "SnapshotCopyAlreadyEnabledFault" - - // ErrCodeSnapshotCopyDisabledFault for service response error code - // "SnapshotCopyDisabledFault". - // - // Cross-region snapshot copy was temporarily disabled. Try your request again. - ErrCodeSnapshotCopyDisabledFault = "SnapshotCopyDisabledFault" - - // ErrCodeSnapshotCopyGrantAlreadyExistsFault for service response error code - // "SnapshotCopyGrantAlreadyExistsFault". - // - // The snapshot copy grant can't be created because a grant with the same name - // already exists. - ErrCodeSnapshotCopyGrantAlreadyExistsFault = "SnapshotCopyGrantAlreadyExistsFault" - - // ErrCodeSnapshotCopyGrantNotFoundFault for service response error code - // "SnapshotCopyGrantNotFoundFault". - // - // The specified snapshot copy grant can't be found. Make sure that the name - // is typed correctly and that the grant exists in the destination region. - ErrCodeSnapshotCopyGrantNotFoundFault = "SnapshotCopyGrantNotFoundFault" - - // ErrCodeSnapshotCopyGrantQuotaExceededFault for service response error code - // "SnapshotCopyGrantQuotaExceededFault". - // - // The AWS account has exceeded the maximum number of snapshot copy grants in - // this region. - ErrCodeSnapshotCopyGrantQuotaExceededFault = "SnapshotCopyGrantQuotaExceededFault" - - // ErrCodeSourceNotFoundFault for service response error code - // "SourceNotFound". - // - // The specified Amazon Redshift event source could not be found. - ErrCodeSourceNotFoundFault = "SourceNotFound" - - // ErrCodeSubnetAlreadyInUse for service response error code - // "SubnetAlreadyInUse". - // - // A specified subnet is already in use by another cluster. - ErrCodeSubnetAlreadyInUse = "SubnetAlreadyInUse" - - // ErrCodeSubscriptionAlreadyExistFault for service response error code - // "SubscriptionAlreadyExist". - // - // There is already an existing event notification subscription with the specified - // name. - ErrCodeSubscriptionAlreadyExistFault = "SubscriptionAlreadyExist" - - // ErrCodeSubscriptionCategoryNotFoundFault for service response error code - // "SubscriptionCategoryNotFound". - // - // The value specified for the event category was not one of the allowed values, - // or it specified a category that does not apply to the specified source type. - // The allowed values are Configuration, Management, Monitoring, and Security. - ErrCodeSubscriptionCategoryNotFoundFault = "SubscriptionCategoryNotFound" - - // ErrCodeSubscriptionEventIdNotFoundFault for service response error code - // "SubscriptionEventIdNotFound". - // - // An Amazon Redshift event with the specified event ID does not exist. - ErrCodeSubscriptionEventIdNotFoundFault = "SubscriptionEventIdNotFound" - - // ErrCodeSubscriptionNotFoundFault for service response error code - // "SubscriptionNotFound". - // - // An Amazon Redshift event notification subscription with the specified name - // does not exist. - ErrCodeSubscriptionNotFoundFault = "SubscriptionNotFound" - - // ErrCodeSubscriptionSeverityNotFoundFault for service response error code - // "SubscriptionSeverityNotFound". - // - // The value specified for the event severity was not one of the allowed values, - // or it specified a severity that does not apply to the specified source type. - // The allowed values are ERROR and INFO. - ErrCodeSubscriptionSeverityNotFoundFault = "SubscriptionSeverityNotFound" - - // ErrCodeTableRestoreNotFoundFault for service response error code - // "TableRestoreNotFoundFault". - // - // The specified TableRestoreRequestId value was not found. - ErrCodeTableRestoreNotFoundFault = "TableRestoreNotFoundFault" - - // ErrCodeTagLimitExceededFault for service response error code - // "TagLimitExceededFault". - // - // The request exceeds the limit of 10 tags for the resource. - ErrCodeTagLimitExceededFault = "TagLimitExceededFault" - - // ErrCodeUnauthorizedOperation for service response error code - // "UnauthorizedOperation". - // - // Your account is not authorized to perform the requested operation. - ErrCodeUnauthorizedOperation = "UnauthorizedOperation" - - // ErrCodeUnknownSnapshotCopyRegionFault for service response error code - // "UnknownSnapshotCopyRegionFault". - // - // The specified region is incorrect or does not exist. - ErrCodeUnknownSnapshotCopyRegionFault = "UnknownSnapshotCopyRegionFault" - - // ErrCodeUnsupportedOperationFault for service response error code - // "UnsupportedOperation". - // - // The requested operation isn't supported. - ErrCodeUnsupportedOperationFault = "UnsupportedOperation" - - // ErrCodeUnsupportedOptionFault for service response error code - // "UnsupportedOptionFault". - // - // A request option was specified that is not supported. - ErrCodeUnsupportedOptionFault = "UnsupportedOptionFault" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go deleted file mode 100644 index 904e408..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go +++ /dev/null @@ -1,114 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package redshift - -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" -) - -// Overview -// -// This is an interface reference for Amazon Redshift. It contains documentation -// for one of the programming or command line interfaces you can use to manage -// Amazon Redshift clusters. Note that Amazon Redshift is asynchronous, which -// means that some interfaces may require techniques, such as polling or asynchronous -// callback handlers, to determine when a command has been applied. In this -// reference, the parameter descriptions indicate whether a change is applied -// immediately, on the next instance reboot, or during the next maintenance -// window. For a summary of the Amazon Redshift cluster management interfaces, -// go to Using the Amazon Redshift Management Interfaces (http://docs.aws.amazon.com/redshift/latest/mgmt/using-aws-sdk.html). -// -// Amazon Redshift manages all the work of setting up, operating, and scaling -// a data warehouse: provisioning capacity, monitoring and backing up the cluster, -// and applying patches and upgrades to the Amazon Redshift engine. You can -// focus on using your data to acquire new insights for your business and customers. -// -// If you are a first-time user of Amazon Redshift, we recommend that you begin -// by reading the Amazon Redshift Getting Started Guide (http://docs.aws.amazon.com/redshift/latest/gsg/getting-started.html). -// -// If you are a database developer, the Amazon Redshift Database Developer Guide -// (http://docs.aws.amazon.com/redshift/latest/dg/welcome.html) explains how -// to design, build, query, and maintain the databases that make up your data -// warehouse. -// 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/redshift-2012-12-01 -type Redshift 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 = "redshift" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the Redshift 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 Redshift client from just a session. -// svc := redshift.New(mySession) -// -// // Create a Redshift client with additional configuration -// svc := redshift.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Redshift { - 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) *Redshift { - svc := &Redshift{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2012-12-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Redshift operation and runs any -// custom request initialization. -func (c *Redshift) 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/redshift/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/waiters.go deleted file mode 100644 index 59e26ed..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/waiters.go +++ /dev/null @@ -1,157 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package redshift - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilClusterAvailable uses the Amazon Redshift API operation -// DescribeClusters 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 *Redshift) WaitUntilClusterAvailable(input *DescribeClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeClusters", - Delay: 60, - MaxAttempts: 30, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Clusters[].ClusterStatus", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Clusters[].ClusterStatus", - Expected: "deleting", - }, - { - State: "retry", - Matcher: "error", - Argument: "", - Expected: "ClusterNotFound", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilClusterDeleted uses the Amazon Redshift API operation -// DescribeClusters 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 *Redshift) WaitUntilClusterDeleted(input *DescribeClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeClusters", - Delay: 60, - MaxAttempts: 30, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "error", - Argument: "", - Expected: "ClusterNotFound", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Clusters[].ClusterStatus", - Expected: "creating", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Clusters[].ClusterStatus", - Expected: "modifying", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilClusterRestored uses the Amazon Redshift API operation -// DescribeClusters 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 *Redshift) WaitUntilClusterRestored(input *DescribeClustersInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeClusters", - Delay: 60, - MaxAttempts: 30, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Clusters[].RestoreStatus.Status", - Expected: "completed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Clusters[].ClusterStatus", - Expected: "deleting", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} - -// WaitUntilSnapshotAvailable uses the Amazon Redshift API operation -// DescribeClusterSnapshots 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 *Redshift) WaitUntilSnapshotAvailable(input *DescribeClusterSnapshotsInput) error { - waiterCfg := waiter.Config{ - Operation: "DescribeClusterSnapshots", - Delay: 15, - MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "Snapshots[].Status", - Expected: "available", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Snapshots[].Status", - Expected: "failed", - }, - { - State: "failure", - Matcher: "pathAny", - Argument: "Snapshots[].Status", - Expected: "deleted", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} 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 acbc1ea..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go +++ /dev/null @@ -1,12887 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package route53 provides a client for Amazon Route 53. -package route53 - -import ( - "fmt" - "time" - - "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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListHealthChecksOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListHealthChecksRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListHealthChecksOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListHostedZonesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListHostedZonesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListHostedZonesOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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(p *ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListResourceRecordSetsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListResourceRecordSetsOutput), lastPage) - }) -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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/errors.go b/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go deleted file mode 100644 index cbd875e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go +++ /dev/null @@ -1,321 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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/service.go b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go deleted file mode 100644 index 287e7db..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go +++ /dev/null @@ -1,91 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go deleted file mode 100644 index 85a70ab..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go +++ /dev/null @@ -1,34 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package route53 - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// 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 { - waiterCfg := waiter.Config{ - Operation: "GetChange", - Delay: 30, - MaxAttempts: 60, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "ChangeInfo.Status", - Expected: "INSYNC", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index 9b205f3..e65ef26 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -1,6 +1,5 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// 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 ( @@ -8,6 +7,7 @@ import ( "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" @@ -18,19 +18,18 @@ 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See AbortMultipartUpload 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 AbortMultipartUpload method directly -// instead. +// See AbortMultipartUpload for more information on using the AbortMultipartUpload +// 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 AbortMultipartUploadRequest method. // req, resp := client.AbortMultipartUploadRequest(params) @@ -79,27 +78,41 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See CompleteMultipartUpload 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 CompleteMultipartUpload method directly -// instead. +// See CompleteMultipartUpload for more information on using the CompleteMultipartUpload +// 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 CompleteMultipartUploadRequest method. // req, resp := client.CompleteMultipartUploadRequest(params) @@ -139,27 +152,41 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 CopyObject for usage and error information. +// See CopyObject for more information on using the CopyObject +// 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 CopyObject 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 CopyObjectRequest method. // req, resp := client.CopyObjectRequest(params) @@ -205,27 +232,41 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 CreateBucket for usage and error information. +// See CreateBucket for more information on using the CreateBucket +// 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 CreateBucket 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 CreateBucketRequest method. // req, resp := client.CreateBucketRequest(params) @@ -273,27 +314,41 @@ func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See CreateMultipartUpload 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 CreateMultipartUpload method directly -// instead. +// See CreateMultipartUpload for more information on using the CreateMultipartUpload +// 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 CreateMultipartUploadRequest method. // req, resp := client.CreateMultipartUploadRequest(params) @@ -339,27 +394,41 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See DeleteBucket 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 DeleteBucket method directly -// instead. +// See DeleteBucket for more information on using the DeleteBucket +// 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 DeleteBucketRequest method. // req, resp := client.DeleteBucketRequest(params) @@ -402,27 +471,41 @@ func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 DeleteBucketAnalyticsConfiguration for usage and error information. +// See DeleteBucketAnalyticsConfiguration for more information on using the DeleteBucketAnalyticsConfiguration +// 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 DeleteBucketAnalyticsConfiguration 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 DeleteBucketAnalyticsConfigurationRequest method. // req, resp := client.DeleteBucketAnalyticsConfigurationRequest(params) @@ -465,27 +548,41 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See DeleteBucketCors 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 DeleteBucketCors method directly -// instead. +// See DeleteBucketCors for more information on using the DeleteBucketCors +// 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 DeleteBucketCorsRequest method. // req, resp := client.DeleteBucketCorsRequest(params) @@ -527,27 +624,41 @@ func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See DeleteBucketInventoryConfiguration 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 DeleteBucketInventoryConfiguration method directly -// instead. +// See DeleteBucketInventoryConfiguration for more information on using the DeleteBucketInventoryConfiguration +// 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 DeleteBucketInventoryConfigurationRequest method. // req, resp := client.DeleteBucketInventoryConfigurationRequest(params) @@ -590,27 +701,41 @@ func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInvent // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 DeleteBucketLifecycle for usage and error information. +// See DeleteBucketLifecycle for more information on using the DeleteBucketLifecycle +// 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 DeleteBucketLifecycle 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 DeleteBucketLifecycleRequest method. // req, resp := client.DeleteBucketLifecycleRequest(params) @@ -652,27 +777,41 @@ func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (re // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 DeleteBucketMetricsConfiguration for usage and error information. +// See DeleteBucketMetricsConfiguration for more information on using the DeleteBucketMetricsConfiguration +// 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 DeleteBucketMetricsConfiguration 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 DeleteBucketMetricsConfigurationRequest method. // req, resp := client.DeleteBucketMetricsConfigurationRequest(params) @@ -715,27 +854,41 @@ func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsC // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See DeleteBucketPolicy 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 DeleteBucketPolicy method directly -// instead. +// See DeleteBucketPolicy for more information on using the DeleteBucketPolicy +// 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 DeleteBucketPolicyRequest method. // req, resp := client.DeleteBucketPolicyRequest(params) @@ -777,27 +930,41 @@ func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *req // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 DeleteBucketReplication for usage and error information. +// See DeleteBucketReplication for more information on using the DeleteBucketReplication +// 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 DeleteBucketReplication 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 DeleteBucketReplicationRequest method. // req, resp := client.DeleteBucketReplicationRequest(params) @@ -839,27 +1006,41 @@ func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See DeleteBucketTagging 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 DeleteBucketTagging method directly -// instead. +// See DeleteBucketTagging for more information on using the DeleteBucketTagging +// 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 DeleteBucketTaggingRequest method. // req, resp := client.DeleteBucketTaggingRequest(params) @@ -901,27 +1082,41 @@ func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *r // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 DeleteBucketWebsite for usage and error information. +// See DeleteBucketWebsite for more information on using the DeleteBucketWebsite +// 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 DeleteBucketWebsite 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 DeleteBucketWebsiteRequest method. // req, resp := client.DeleteBucketWebsiteRequest(params) @@ -963,27 +1158,41 @@ func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *r // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 DeleteObject for usage and error information. +// See DeleteObject for more information on using the DeleteObject +// 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 DeleteObject 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 DeleteObjectRequest method. // req, resp := client.DeleteObjectRequest(params) @@ -1025,27 +1234,41 @@ func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 DeleteObjectTagging for usage and error information. +// See DeleteObjectTagging for more information on using the DeleteObjectTagging +// 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 DeleteObjectTagging 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 DeleteObjectTaggingRequest method. // req, resp := client.DeleteObjectTaggingRequest(params) @@ -1085,27 +1308,41 @@ func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *r // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See DeleteObjects 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 DeleteObjects method directly -// instead. +// See DeleteObjects for more information on using the DeleteObjects +// 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 DeleteObjectsRequest method. // req, resp := client.DeleteObjectsRequest(params) @@ -1146,27 +1383,41 @@ func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Reque // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketAccelerateConfiguration for usage and error information. +// See GetBucketAccelerateConfiguration for more information on using the GetBucketAccelerateConfiguration +// 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 GetBucketAccelerateConfiguration 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 GetBucketAccelerateConfigurationRequest method. // req, resp := client.GetBucketAccelerateConfigurationRequest(params) @@ -1206,27 +1457,41 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See GetBucketAcl 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 GetBucketAcl method directly -// instead. +// See GetBucketAcl for more information on using the GetBucketAcl +// 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 GetBucketAclRequest method. // req, resp := client.GetBucketAclRequest(params) @@ -1266,27 +1531,41 @@ func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketAnalyticsConfiguration for usage and error information. +// See GetBucketAnalyticsConfiguration for more information on using the GetBucketAnalyticsConfiguration +// 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 GetBucketAnalyticsConfiguration 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 GetBucketAnalyticsConfigurationRequest method. // req, resp := client.GetBucketAnalyticsConfigurationRequest(params) @@ -1327,27 +1606,41 @@ func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsCon // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketCors for usage and error information. +// See GetBucketCors for more information on using the GetBucketCors +// 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 GetBucketCors 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 GetBucketCorsRequest method. // req, resp := client.GetBucketCorsRequest(params) @@ -1387,27 +1680,41 @@ func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Reque // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketInventoryConfiguration for usage and error information. +// See GetBucketInventoryConfiguration for more information on using the GetBucketInventoryConfiguration +// 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 GetBucketInventoryConfiguration 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 GetBucketInventoryConfigurationRequest method. // req, resp := client.GetBucketInventoryConfigurationRequest(params) @@ -1448,27 +1755,41 @@ func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryCon // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See GetBucketLifecycle 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 GetBucketLifecycle method directly -// instead. +// See GetBucketLifecycle for more information on using the GetBucketLifecycle +// 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 GetBucketLifecycleRequest method. // req, resp := client.GetBucketLifecycleRequest(params) @@ -1511,27 +1832,41 @@ func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *req // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketLifecycleConfiguration for usage and error information. +// See GetBucketLifecycleConfiguration for more information on using the GetBucketLifecycleConfiguration +// 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 GetBucketLifecycleConfiguration 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 GetBucketLifecycleConfigurationRequest method. // req, resp := client.GetBucketLifecycleConfigurationRequest(params) @@ -1571,27 +1906,41 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See GetBucketLocation 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 GetBucketLocation method directly -// instead. +// See GetBucketLocation for more information on using the GetBucketLocation +// 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 GetBucketLocationRequest method. // req, resp := client.GetBucketLocationRequest(params) @@ -1631,27 +1980,41 @@ func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *reque // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketLogging for usage and error information. +// See GetBucketLogging for more information on using the GetBucketLogging +// 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 GetBucketLogging 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 GetBucketLoggingRequest method. // req, resp := client.GetBucketLoggingRequest(params) @@ -1692,27 +2055,41 @@ func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketMetricsConfiguration for usage and error information. +// See GetBucketMetricsConfiguration for more information on using the GetBucketMetricsConfiguration +// 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 GetBucketMetricsConfiguration 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 GetBucketMetricsConfigurationRequest method. // req, resp := client.GetBucketMetricsConfigurationRequest(params) @@ -1753,27 +2130,41 @@ func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigu // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See GetBucketNotification 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 GetBucketNotification method directly -// instead. +// See GetBucketNotification for more information on using the GetBucketNotification +// 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 GetBucketNotificationRequest method. // req, resp := client.GetBucketNotificationRequest(params) @@ -1816,27 +2207,41 @@ func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurat // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See GetBucketNotificationConfiguration 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 GetBucketNotificationConfiguration method directly -// instead. +// See GetBucketNotificationConfiguration for more information on using the GetBucketNotificationConfiguration +// 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 GetBucketNotificationConfigurationRequest method. // req, resp := client.GetBucketNotificationConfigurationRequest(params) @@ -1876,27 +2281,41 @@ func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificat // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketPolicy for usage and error information. +// See GetBucketPolicy for more information on using the GetBucketPolicy +// 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 GetBucketPolicy 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 GetBucketPolicyRequest method. // req, resp := client.GetBucketPolicyRequest(params) @@ -1936,27 +2355,41 @@ func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.R // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See GetBucketReplication 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 GetBucketReplication method directly -// instead. +// See GetBucketReplication for more information on using the GetBucketReplication +// 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 GetBucketReplicationRequest method. // req, resp := client.GetBucketReplicationRequest(params) @@ -1996,27 +2429,41 @@ func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketRequestPayment for usage and error information. +// See GetBucketRequestPayment for more information on using the GetBucketRequestPayment +// 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 GetBucketRequestPayment 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 GetBucketRequestPaymentRequest method. // req, resp := client.GetBucketRequestPaymentRequest(params) @@ -2056,27 +2503,41 @@ func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketTagging for usage and error information. +// See GetBucketTagging for more information on using the GetBucketTagging +// 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 GetBucketTagging 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 GetBucketTaggingRequest method. // req, resp := client.GetBucketTaggingRequest(params) @@ -2116,27 +2577,41 @@ func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See GetBucketVersioning 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 GetBucketVersioning method directly -// instead. +// See GetBucketVersioning for more information on using the GetBucketVersioning +// 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 GetBucketVersioningRequest method. // req, resp := client.GetBucketVersioningRequest(params) @@ -2176,27 +2651,41 @@ func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *r // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetBucketWebsite for usage and error information. +// See GetBucketWebsite for more information on using the GetBucketWebsite +// 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 GetBucketWebsite 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 GetBucketWebsiteRequest method. // req, resp := client.GetBucketWebsiteRequest(params) @@ -2236,27 +2725,41 @@ func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetObject for usage and error information. +// See GetObject for more information on using the GetObject +// 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 GetObject 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 GetObjectRequest method. // req, resp := client.GetObjectRequest(params) @@ -2301,27 +2804,41 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See GetObjectAcl 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 GetObjectAcl method directly -// instead. +// See GetObjectAcl for more information on using the GetObjectAcl +// 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 GetObjectAclRequest method. // req, resp := client.GetObjectAclRequest(params) @@ -2366,27 +2883,41 @@ func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetObjectTagging for usage and error information. +// See GetObjectTagging for more information on using the GetObjectTagging +// 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 GetObjectTagging 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 GetObjectTaggingRequest method. // req, resp := client.GetObjectTaggingRequest(params) @@ -2426,27 +2957,41 @@ func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 GetObjectTorrent for usage and error information. +// See GetObjectTorrent for more information on using the GetObjectTorrent +// 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 GetObjectTorrent 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 GetObjectTorrentRequest method. // req, resp := client.GetObjectTorrentRequest(params) @@ -2486,27 +3031,41 @@ func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See HeadBucket 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 HeadBucket method directly -// instead. +// See HeadBucket for more information on using the HeadBucket +// 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 HeadBucketRequest method. // req, resp := client.HeadBucketRequest(params) @@ -2554,27 +3113,41 @@ func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, ou // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 HeadObject for usage and error information. +// See HeadObject for more information on using the HeadObject +// 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 HeadObject 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 HeadObjectRequest method. // req, resp := client.HeadObjectRequest(params) @@ -2607,41 +3180,53 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou // 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. // +// See http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses +// for more information on returned errors. +// // Returns awserr.Error for service API and SDK errors. Use runtime type 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See ListBucketAnalyticsConfigurations 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 ListBucketAnalyticsConfigurations method directly -// instead. +// See ListBucketAnalyticsConfigurations for more information on using the ListBucketAnalyticsConfigurations +// 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 ListBucketAnalyticsConfigurationsRequest method. // req, resp := client.ListBucketAnalyticsConfigurationsRequest(params) @@ -2681,27 +3266,41 @@ func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalytics // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 ListBucketInventoryConfigurations for usage and error information. +// See ListBucketInventoryConfigurations for more information on using the ListBucketInventoryConfigurations +// 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 ListBucketInventoryConfigurations 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 ListBucketInventoryConfigurationsRequest method. // req, resp := client.ListBucketInventoryConfigurationsRequest(params) @@ -2741,27 +3340,41 @@ func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventory // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 ListBucketMetricsConfigurations for usage and error information. +// See ListBucketMetricsConfigurations for more information on using the ListBucketMetricsConfigurations +// 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 ListBucketMetricsConfigurations 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 ListBucketMetricsConfigurationsRequest method. // req, resp := client.ListBucketMetricsConfigurationsRequest(params) @@ -2801,27 +3414,41 @@ func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConf // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See ListBuckets 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 ListBuckets method directly -// instead. +// See ListBuckets for more information on using the ListBuckets +// 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 ListBucketsRequest method. // req, resp := client.ListBucketsRequest(params) @@ -2861,27 +3488,41 @@ func (c *S3) ListBucketsRequest(input *ListBucketsInput) (req *request.Request, // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 ListMultipartUploads for usage and error information. +// See ListMultipartUploads for more information on using the ListMultipartUploads +// 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 ListMultipartUploads 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 ListMultipartUploadsRequest method. // req, resp := client.ListMultipartUploadsRequest(params) @@ -2927,8 +3568,23 @@ func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req // 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) - err := req.Send() - return out, err + 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, @@ -2948,31 +3604,55 @@ func (c *S3) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultip // return pageNum <= 3 // }) // -func (c *S3) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(p *ListMultipartUploadsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListMultipartUploadsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListMultipartUploadsOutput), lastPage) - }) +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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 ListObjectVersions for usage and error information. +// See ListObjectVersions for more information on using the ListObjectVersions +// 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 ListObjectVersions 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 ListObjectVersionsRequest method. // req, resp := client.ListObjectVersionsRequest(params) @@ -3018,8 +3698,23 @@ func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *req // 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) - err := req.Send() - return out, err + 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, @@ -3039,31 +3734,55 @@ func (c *S3) ListObjectVersions(input *ListObjectVersionsInput) (*ListObjectVers // return pageNum <= 3 // }) // -func (c *S3) ListObjectVersionsPages(input *ListObjectVersionsInput, fn func(p *ListObjectVersionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListObjectVersionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListObjectVersionsOutput), lastPage) - }) +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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 ListObjects for usage and error information. +// See ListObjects for more information on using the ListObjects +// 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 ListObjects 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 ListObjectsRequest method. // req, resp := client.ListObjectsRequest(params) @@ -3116,8 +3835,23 @@ func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, // 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) - err := req.Send() - return out, err + 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, @@ -3137,31 +3871,55 @@ func (c *S3) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error) { // return pageNum <= 3 // }) // -func (c *S3) ListObjectsPages(input *ListObjectsInput, fn func(p *ListObjectsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListObjectsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListObjectsOutput), lastPage) - }) +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. +// value will be populated with the request's response once the request complets +// successfuly. // -// See ListObjectsV2 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 ListObjectsV2 method directly -// instead. +// See ListObjectsV2 for more information on using the ListObjectsV2 +// 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 ListObjectsV2Request method. // req, resp := client.ListObjectsV2Request(params) @@ -3215,8 +3973,23 @@ func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Reque // 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) - err := req.Send() - return out, err + 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, @@ -3236,31 +4009,55 @@ func (c *S3) ListObjectsV2(input *ListObjectsV2Input) (*ListObjectsV2Output, err // return pageNum <= 3 // }) // -func (c *S3) ListObjectsV2Pages(input *ListObjectsV2Input, fn func(p *ListObjectsV2Output, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListObjectsV2Request(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListObjectsV2Output), lastPage) - }) +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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 ListParts for usage and error information. +// See ListParts for more information on using the ListParts +// 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 ListParts 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 ListPartsRequest method. // req, resp := client.ListPartsRequest(params) @@ -3306,8 +4103,23 @@ func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, outp // 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) - err := req.Send() - return out, err + 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, @@ -3327,31 +4139,55 @@ func (c *S3) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { // return pageNum <= 3 // }) // -func (c *S3) ListPartsPages(input *ListPartsInput, fn func(p *ListPartsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPartsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPartsOutput), lastPage) - }) +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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketAccelerateConfiguration for usage and error information. +// See PutBucketAccelerateConfiguration for more information on using the PutBucketAccelerateConfiguration +// 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 PutBucketAccelerateConfiguration 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 PutBucketAccelerateConfigurationRequest method. // req, resp := client.PutBucketAccelerateConfigurationRequest(params) @@ -3393,27 +4229,41 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketAcl for usage and error information. +// See PutBucketAcl for more information on using the PutBucketAcl +// 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 PutBucketAcl 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 PutBucketAclRequest method. // req, resp := client.PutBucketAclRequest(params) @@ -3455,27 +4305,41 @@ func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketAnalyticsConfiguration for usage and error information. +// See PutBucketAnalyticsConfiguration for more information on using the PutBucketAnalyticsConfiguration +// 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 PutBucketAnalyticsConfiguration 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 PutBucketAnalyticsConfigurationRequest method. // req, resp := client.PutBucketAnalyticsConfigurationRequest(params) @@ -3518,27 +4382,41 @@ func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsCon // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketCors for usage and error information. +// See PutBucketCors for more information on using the PutBucketCors +// 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 PutBucketCors 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 PutBucketCorsRequest method. // req, resp := client.PutBucketCorsRequest(params) @@ -3580,27 +4458,41 @@ func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Reque // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketInventoryConfiguration for usage and error information. +// See PutBucketInventoryConfiguration for more information on using the PutBucketInventoryConfiguration +// 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 PutBucketInventoryConfiguration 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 PutBucketInventoryConfigurationRequest method. // req, resp := client.PutBucketInventoryConfigurationRequest(params) @@ -3643,27 +4535,41 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketLifecycle for usage and error information. +// See PutBucketLifecycle for more information on using the PutBucketLifecycle +// 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 PutBucketLifecycle 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 PutBucketLifecycleRequest method. // req, resp := client.PutBucketLifecycleRequest(params) @@ -3708,27 +4614,41 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketLifecycleConfiguration for usage and error information. +// See PutBucketLifecycleConfiguration for more information on using the PutBucketLifecycleConfiguration +// 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 PutBucketLifecycleConfiguration 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 PutBucketLifecycleConfigurationRequest method. // req, resp := client.PutBucketLifecycleConfigurationRequest(params) @@ -3771,27 +4691,41 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketLogging for usage and error information. +// See PutBucketLogging for more information on using the PutBucketLogging +// 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 PutBucketLogging 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 PutBucketLoggingRequest method. // req, resp := client.PutBucketLoggingRequest(params) @@ -3835,27 +4769,41 @@ func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketMetricsConfiguration for usage and error information. +// See PutBucketMetricsConfiguration for more information on using the PutBucketMetricsConfiguration +// 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 PutBucketMetricsConfiguration 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 PutBucketMetricsConfigurationRequest method. // req, resp := client.PutBucketMetricsConfigurationRequest(params) @@ -3898,27 +4846,41 @@ func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigu // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketNotification for usage and error information. +// See PutBucketNotification for more information on using the PutBucketNotification +// 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 PutBucketNotification 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 PutBucketNotificationRequest method. // req, resp := client.PutBucketNotificationRequest(params) @@ -3963,27 +4925,41 @@ func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (re // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketNotificationConfiguration for usage and error information. +// See PutBucketNotificationConfiguration for more information on using the PutBucketNotificationConfiguration +// 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 PutBucketNotificationConfiguration 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 PutBucketNotificationConfigurationRequest method. // req, resp := client.PutBucketNotificationConfigurationRequest(params) @@ -4025,27 +5001,41 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketPolicy for usage and error information. +// See PutBucketPolicy for more information on using the PutBucketPolicy +// 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 PutBucketPolicy 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 PutBucketPolicyRequest method. // req, resp := client.PutBucketPolicyRequest(params) @@ -4088,27 +5078,41 @@ func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.R // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketReplication for usage and error information. +// See PutBucketReplication for more information on using the PutBucketReplication +// 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 PutBucketReplication 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 PutBucketReplicationRequest method. // req, resp := client.PutBucketReplicationRequest(params) @@ -4151,27 +5155,41 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketRequestPayment for usage and error information. +// See PutBucketRequestPayment for more information on using the PutBucketRequestPayment +// 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 PutBucketRequestPayment 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 PutBucketRequestPaymentRequest method. // req, resp := client.PutBucketRequestPaymentRequest(params) @@ -4217,27 +5235,41 @@ func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketTagging for usage and error information. +// See PutBucketTagging for more information on using the PutBucketTagging +// 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 PutBucketTagging 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 PutBucketTaggingRequest method. // req, resp := client.PutBucketTaggingRequest(params) @@ -4279,27 +5311,41 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketVersioning for usage and error information. +// See PutBucketVersioning for more information on using the PutBucketVersioning +// 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 PutBucketVersioning 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 PutBucketVersioningRequest method. // req, resp := client.PutBucketVersioningRequest(params) @@ -4342,27 +5388,41 @@ func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *r // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutBucketWebsite for usage and error information. +// See PutBucketWebsite for more information on using the PutBucketWebsite +// 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 PutBucketWebsite 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 PutBucketWebsiteRequest method. // req, resp := client.PutBucketWebsiteRequest(params) @@ -4404,27 +5464,41 @@ func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutObject for usage and error information. +// See PutObject for more information on using the PutObject +// 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 PutObject 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 PutObjectRequest method. // req, resp := client.PutObjectRequest(params) @@ -4464,27 +5538,41 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutObjectAcl for usage and error information. +// See PutObjectAcl for more information on using the PutObjectAcl +// 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 PutObjectAcl 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 PutObjectAclRequest method. // req, resp := client.PutObjectAclRequest(params) @@ -4530,27 +5618,41 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 PutObjectTagging for usage and error information. +// See PutObjectTagging for more information on using the PutObjectTagging +// 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 PutObjectTagging 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 PutObjectTaggingRequest method. // req, resp := client.PutObjectTaggingRequest(params) @@ -4590,27 +5692,41 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 RestoreObject for usage and error information. +// See RestoreObject for more information on using the RestoreObject +// 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 RestoreObject 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 RestoreObjectRequest method. // req, resp := client.RestoreObjectRequest(params) @@ -4655,27 +5771,41 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 UploadPart for usage and error information. +// See UploadPart for more information on using the UploadPart +// 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 UploadPart 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 UploadPartRequest method. // req, resp := client.UploadPartRequest(params) @@ -4721,27 +5851,41 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou // 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) - err := req.Send() - return out, err + 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. +// value will be populated with the request's response once the request complets +// successfuly. +// +// 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 UploadPartCopy for usage and error information. +// See UploadPartCopy for more information on using the UploadPartCopy +// 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 UploadPartCopy 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 UploadPartCopyRequest method. // req, resp := client.UploadPartCopyRequest(params) @@ -4781,8 +5925,23 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req // 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) - err := req.Send() - return out, err + 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 @@ -4870,6 +6029,13 @@ func (s *AbortMultipartUploadInput) SetBucket(v string) *AbortMultipartUploadInp return s } +func (s *AbortMultipartUploadInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *AbortMultipartUploadInput) SetKey(v string) *AbortMultipartUploadInput { s.Key = &v @@ -5279,6 +6445,13 @@ func (s *AnalyticsS3BucketDestination) SetBucket(v string) *AnalyticsS3BucketDes return s } +func (s *AnalyticsS3BucketDestination) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetBucketAccountId sets the BucketAccountId field's value. func (s *AnalyticsS3BucketDestination) SetBucketAccountId(v string) *AnalyticsS3BucketDestination { s.BucketAccountId = &v @@ -5637,7 +6810,7 @@ type CompleteMultipartUploadInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - MultipartUpload *CompletedMultipartUpload `locationName:"CompleteMultipartUpload" type:"structure"` + MultipartUpload *CompletedMultipartUpload `locationName:"CompleteMultipartUpload" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // Confirms that the requester knows that she or he will be charged for the // request. Bucket owners need not specify this parameter in their requests. @@ -5687,6 +6860,13 @@ func (s *CompleteMultipartUploadInput) SetBucket(v string) *CompleteMultipartUpl return s } +func (s *CompleteMultipartUploadInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *CompleteMultipartUploadInput) SetKey(v string) *CompleteMultipartUploadInput { s.Key = &v @@ -5760,6 +6940,13 @@ func (s *CompleteMultipartUploadOutput) SetBucket(v string) *CompleteMultipartUp return s } +func (s *CompleteMultipartUploadOutput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetETag sets the ETag field's value. func (s *CompleteMultipartUploadOutput) SetETag(v string) *CompleteMultipartUploadOutput { s.ETag = &v @@ -6085,6 +7272,13 @@ func (s *CopyObjectInput) SetBucket(v string) *CopyObjectInput { return s } +func (s *CopyObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetCacheControl sets the CacheControl field's value. func (s *CopyObjectInput) SetCacheControl(v string) *CopyObjectInput { s.CacheControl = &v @@ -6157,6 +7351,13 @@ func (s *CopyObjectInput) SetCopySourceSSECustomerKey(v string) *CopyObjectInput return s } +func (s *CopyObjectInput) getCopySourceSSECustomerKey() (v string) { + if s.CopySourceSSECustomerKey == nil { + return v + } + return *s.CopySourceSSECustomerKey +} + // SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. func (s *CopyObjectInput) SetCopySourceSSECustomerKeyMD5(v string) *CopyObjectInput { s.CopySourceSSECustomerKeyMD5 = &v @@ -6229,6 +7430,13 @@ func (s *CopyObjectInput) SetSSECustomerKey(v string) *CopyObjectInput { return s } +func (s *CopyObjectInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. func (s *CopyObjectInput) SetSSECustomerKeyMD5(v string) *CopyObjectInput { s.SSECustomerKeyMD5 = &v @@ -6471,7 +7679,7 @@ type CreateBucketInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - CreateBucketConfiguration *CreateBucketConfiguration `locationName:"CreateBucketConfiguration" type:"structure"` + CreateBucketConfiguration *CreateBucketConfiguration `locationName:"CreateBucketConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // Allows grantee the read, write, read ACP, and write ACP permissions on the // bucket. @@ -6525,6 +7733,13 @@ func (s *CreateBucketInput) SetBucket(v string) *CreateBucketInput { return s } +func (s *CreateBucketInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetCreateBucketConfiguration sets the CreateBucketConfiguration field's value. func (s *CreateBucketInput) SetCreateBucketConfiguration(v *CreateBucketConfiguration) *CreateBucketInput { s.CreateBucketConfiguration = v @@ -6666,6 +7881,9 @@ type CreateMultipartUploadInput struct { // 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. @@ -6713,6 +7931,13 @@ func (s *CreateMultipartUploadInput) SetBucket(v string) *CreateMultipartUploadI return s } +func (s *CreateMultipartUploadInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetCacheControl sets the CacheControl field's value. func (s *CreateMultipartUploadInput) SetCacheControl(v string) *CreateMultipartUploadInput { s.CacheControl = &v @@ -6803,6 +8028,13 @@ func (s *CreateMultipartUploadInput) SetSSECustomerKey(v string) *CreateMultipar return s } +func (s *CreateMultipartUploadInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. func (s *CreateMultipartUploadInput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadInput { s.SSECustomerKeyMD5 = &v @@ -6827,6 +8059,12 @@ func (s *CreateMultipartUploadInput) SetStorageClass(v string) *CreateMultipartU return s } +// SetTagging sets the Tagging field's value. +func (s *CreateMultipartUploadInput) SetTagging(v string) *CreateMultipartUploadInput { + s.Tagging = &v + return s +} + // SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. func (s *CreateMultipartUploadInput) SetWebsiteRedirectLocation(v string) *CreateMultipartUploadInput { s.WebsiteRedirectLocation = &v @@ -6904,6 +8142,13 @@ func (s *CreateMultipartUploadOutput) SetBucket(v string) *CreateMultipartUpload return s } +func (s *CreateMultipartUploadOutput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *CreateMultipartUploadOutput) SetKey(v string) *CreateMultipartUploadOutput { s.Key = &v @@ -7050,6 +8295,13 @@ func (s *DeleteBucketAnalyticsConfigurationInput) SetBucket(v string) *DeleteBuc return s } +func (s *DeleteBucketAnalyticsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *DeleteBucketAnalyticsConfigurationInput) SetId(v string) *DeleteBucketAnalyticsConfigurationInput { s.Id = &v @@ -7108,6 +8360,13 @@ func (s *DeleteBucketCorsInput) SetBucket(v string) *DeleteBucketCorsInput { return s } +func (s *DeleteBucketCorsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCorsOutput type DeleteBucketCorsOutput struct { _ struct{} `type:"structure"` @@ -7160,6 +8419,13 @@ func (s *DeleteBucketInput) SetBucket(v string) *DeleteBucketInput { return s } +func (s *DeleteBucketInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfigurationRequest type DeleteBucketInventoryConfigurationInput struct { _ struct{} `type:"structure"` @@ -7207,6 +8473,13 @@ func (s *DeleteBucketInventoryConfigurationInput) SetBucket(v string) *DeleteBuc return s } +func (s *DeleteBucketInventoryConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *DeleteBucketInventoryConfigurationInput) SetId(v string) *DeleteBucketInventoryConfigurationInput { s.Id = &v @@ -7265,6 +8538,13 @@ func (s *DeleteBucketLifecycleInput) SetBucket(v string) *DeleteBucketLifecycleI return s } +func (s *DeleteBucketLifecycleInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycleOutput type DeleteBucketLifecycleOutput struct { _ struct{} `type:"structure"` @@ -7327,6 +8607,13 @@ func (s *DeleteBucketMetricsConfigurationInput) SetBucket(v string) *DeleteBucke return s } +func (s *DeleteBucketMetricsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *DeleteBucketMetricsConfigurationInput) SetId(v string) *DeleteBucketMetricsConfigurationInput { s.Id = &v @@ -7400,6 +8687,13 @@ func (s *DeleteBucketPolicyInput) SetBucket(v string) *DeleteBucketPolicyInput { return s } +func (s *DeleteBucketPolicyInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicyOutput type DeleteBucketPolicyOutput struct { _ struct{} `type:"structure"` @@ -7452,6 +8746,13 @@ func (s *DeleteBucketReplicationInput) SetBucket(v string) *DeleteBucketReplicat return s } +func (s *DeleteBucketReplicationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplicationOutput type DeleteBucketReplicationOutput struct { _ struct{} `type:"structure"` @@ -7504,6 +8805,13 @@ func (s *DeleteBucketTaggingInput) SetBucket(v string) *DeleteBucketTaggingInput return s } +func (s *DeleteBucketTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTaggingOutput type DeleteBucketTaggingOutput struct { _ struct{} `type:"structure"` @@ -7556,6 +8864,13 @@ func (s *DeleteBucketWebsiteInput) SetBucket(v string) *DeleteBucketWebsiteInput return s } +func (s *DeleteBucketWebsiteInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsiteOutput type DeleteBucketWebsiteOutput struct { _ struct{} `type:"structure"` @@ -7690,6 +9005,13 @@ func (s *DeleteObjectInput) SetBucket(v string) *DeleteObjectInput { return s } +func (s *DeleteObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *DeleteObjectInput) SetKey(v string) *DeleteObjectInput { s.Key = &v @@ -7808,6 +9130,13 @@ func (s *DeleteObjectTaggingInput) SetBucket(v string) *DeleteObjectTaggingInput return s } +func (s *DeleteObjectTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *DeleteObjectTaggingInput) SetKey(v string) *DeleteObjectTaggingInput { s.Key = &v @@ -7852,7 +9181,7 @@ type DeleteObjectsInput struct { Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // Delete is a required field - Delete *Delete `locationName:"Delete" type:"structure" required:"true"` + Delete *Delete `locationName:"Delete" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // The concatenation of the authentication device's serial number, a space, // and the value that is displayed on your authentication device. @@ -7902,6 +9231,13 @@ func (s *DeleteObjectsInput) SetBucket(v string) *DeleteObjectsInput { return s } +func (s *DeleteObjectsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetDelete sets the Delete field's value. func (s *DeleteObjectsInput) SetDelete(v *Delete) *DeleteObjectsInput { s.Delete = v @@ -8051,6 +9387,13 @@ func (s *Destination) SetBucket(v string) *Destination { return s } +func (s *Destination) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetStorageClass sets the StorageClass field's value. func (s *Destination) SetStorageClass(v string) *Destination { s.StorageClass = &v @@ -8221,6 +9564,13 @@ func (s *GetBucketAccelerateConfigurationInput) SetBucket(v string) *GetBucketAc return s } +func (s *GetBucketAccelerateConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfigurationOutput type GetBucketAccelerateConfigurationOutput struct { _ struct{} `type:"structure"` @@ -8282,6 +9632,13 @@ func (s *GetBucketAclInput) SetBucket(v string) *GetBucketAclInput { return s } +func (s *GetBucketAclInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAclOutput type GetBucketAclOutput struct { _ struct{} `type:"structure"` @@ -8361,6 +9718,13 @@ func (s *GetBucketAnalyticsConfigurationInput) SetBucket(v string) *GetBucketAna return s } +func (s *GetBucketAnalyticsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyticsConfigurationInput { s.Id = &v @@ -8428,6 +9792,13 @@ func (s *GetBucketCorsInput) SetBucket(v string) *GetBucketCorsInput { return s } +func (s *GetBucketCorsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCorsOutput type GetBucketCorsOutput struct { _ struct{} `type:"structure"` @@ -8498,6 +9869,13 @@ func (s *GetBucketInventoryConfigurationInput) SetBucket(v string) *GetBucketInv return s } +func (s *GetBucketInventoryConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *GetBucketInventoryConfigurationInput) SetId(v string) *GetBucketInventoryConfigurationInput { s.Id = &v @@ -8565,6 +9943,13 @@ func (s *GetBucketLifecycleConfigurationInput) SetBucket(v string) *GetBucketLif return s } +func (s *GetBucketLifecycleConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfigurationOutput type GetBucketLifecycleConfigurationOutput struct { _ struct{} `type:"structure"` @@ -8625,6 +10010,13 @@ func (s *GetBucketLifecycleInput) SetBucket(v string) *GetBucketLifecycleInput { return s } +func (s *GetBucketLifecycleInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleOutput type GetBucketLifecycleOutput struct { _ struct{} `type:"structure"` @@ -8685,6 +10077,13 @@ func (s *GetBucketLocationInput) SetBucket(v string) *GetBucketLocationInput { return s } +func (s *GetBucketLocationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocationOutput type GetBucketLocationOutput struct { _ struct{} `type:"structure"` @@ -8745,6 +10144,13 @@ func (s *GetBucketLoggingInput) SetBucket(v string) *GetBucketLoggingInput { return s } +func (s *GetBucketLoggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLoggingOutput type GetBucketLoggingOutput struct { _ struct{} `type:"structure"` @@ -8815,6 +10221,13 @@ func (s *GetBucketMetricsConfigurationInput) SetBucket(v string) *GetBucketMetri return s } +func (s *GetBucketMetricsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *GetBucketMetricsConfigurationInput) SetId(v string) *GetBucketMetricsConfigurationInput { s.Id = &v @@ -8884,6 +10297,13 @@ func (s *GetBucketNotificationConfigurationRequest) SetBucket(v string) *GetBuck return s } +func (s *GetBucketNotificationConfigurationRequest) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyRequest type GetBucketPolicyInput struct { _ struct{} `type:"structure"` @@ -8921,6 +10341,13 @@ func (s *GetBucketPolicyInput) SetBucket(v string) *GetBucketPolicyInput { return s } +func (s *GetBucketPolicyInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyOutput type GetBucketPolicyOutput struct { _ struct{} `type:"structure" payload:"Policy"` @@ -8982,6 +10409,13 @@ func (s *GetBucketReplicationInput) SetBucket(v string) *GetBucketReplicationInp return s } +func (s *GetBucketReplicationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplicationOutput type GetBucketReplicationOutput struct { _ struct{} `type:"structure" payload:"ReplicationConfiguration"` @@ -9044,6 +10478,13 @@ func (s *GetBucketRequestPaymentInput) SetBucket(v string) *GetBucketRequestPaym return s } +func (s *GetBucketRequestPaymentInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPaymentOutput type GetBucketRequestPaymentOutput struct { _ struct{} `type:"structure"` @@ -9105,6 +10546,13 @@ func (s *GetBucketTaggingInput) SetBucket(v string) *GetBucketTaggingInput { return s } +func (s *GetBucketTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTaggingOutput type GetBucketTaggingOutput struct { _ struct{} `type:"structure"` @@ -9166,6 +10614,13 @@ func (s *GetBucketVersioningInput) SetBucket(v string) *GetBucketVersioningInput return s } +func (s *GetBucketVersioningInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioningOutput type GetBucketVersioningOutput struct { _ struct{} `type:"structure"` @@ -9238,6 +10693,13 @@ func (s *GetBucketWebsiteInput) SetBucket(v string) *GetBucketWebsiteInput { return s } +func (s *GetBucketWebsiteInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsiteOutput type GetBucketWebsiteOutput struct { _ struct{} `type:"structure"` @@ -9340,6 +10802,13 @@ func (s *GetObjectAclInput) SetBucket(v string) *GetObjectAclInput { return s } +func (s *GetObjectAclInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *GetObjectAclInput) SetKey(v string) *GetObjectAclInput { s.Key = &v @@ -9513,6 +10982,13 @@ func (s *GetObjectInput) SetBucket(v string) *GetObjectInput { return s } +func (s *GetObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetIfMatch sets the IfMatch field's value. func (s *GetObjectInput) SetIfMatch(v string) *GetObjectInput { s.IfMatch = &v @@ -9609,6 +11085,13 @@ func (s *GetObjectInput) SetSSECustomerKey(v string) *GetObjectInput { return s } +func (s *GetObjectInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. func (s *GetObjectInput) SetSSECustomerKeyMD5(v string) *GetObjectInput { s.SSECustomerKeyMD5 = &v @@ -9953,6 +11436,13 @@ func (s *GetObjectTaggingInput) SetBucket(v string) *GetObjectTaggingInput { return s } +func (s *GetObjectTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *GetObjectTaggingInput) SetKey(v string) *GetObjectTaggingInput { s.Key = &v @@ -10049,6 +11539,13 @@ func (s *GetObjectTorrentInput) SetBucket(v string) *GetObjectTorrentInput { return s } +func (s *GetObjectTorrentInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *GetObjectTorrentInput) SetKey(v string) *GetObjectTorrentInput { s.Key = &v @@ -10137,7 +11634,7 @@ func (s *GlacierJobParameters) SetTier(v string) *GlacierJobParameters { type Grant struct { _ struct{} `type:"structure"` - Grantee *Grantee `type:"structure"` + Grantee *Grantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` // Specifies the permission given to the grantee. Permission *string `type:"string" enum:"Permission"` @@ -10292,6 +11789,13 @@ func (s *HeadBucketInput) SetBucket(v string) *HeadBucketInput { return s } +func (s *HeadBucketInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucketOutput type HeadBucketOutput struct { _ struct{} `type:"structure"` @@ -10403,6 +11907,13 @@ func (s *HeadObjectInput) SetBucket(v string) *HeadObjectInput { return s } +func (s *HeadObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetIfMatch sets the IfMatch field's value. func (s *HeadObjectInput) SetIfMatch(v string) *HeadObjectInput { s.IfMatch = &v @@ -10463,6 +11974,13 @@ func (s *HeadObjectInput) SetSSECustomerKey(v string) *HeadObjectInput { return s } +func (s *HeadObjectInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. func (s *HeadObjectInput) SetSSECustomerKeyMD5(v string) *HeadObjectInput { s.SSECustomerKeyMD5 = &v @@ -11081,6 +12599,13 @@ func (s *InventoryS3BucketDestination) SetBucket(v string) *InventoryS3BucketDes return s } +func (s *InventoryS3BucketDestination) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetFormat sets the Format field's value. func (s *InventoryS3BucketDestination) SetFormat(v string) *InventoryS3BucketDestination { s.Format = &v @@ -11611,6 +13136,13 @@ func (s *ListBucketAnalyticsConfigurationsInput) SetBucket(v string) *ListBucket return s } +func (s *ListBucketAnalyticsConfigurationsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetContinuationToken sets the ContinuationToken field's value. func (s *ListBucketAnalyticsConfigurationsInput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsInput { s.ContinuationToken = &v @@ -11717,6 +13249,13 @@ func (s *ListBucketInventoryConfigurationsInput) SetBucket(v string) *ListBucket return s } +func (s *ListBucketInventoryConfigurationsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetContinuationToken sets the ContinuationToken field's value. func (s *ListBucketInventoryConfigurationsInput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsInput { s.ContinuationToken = &v @@ -11823,6 +13362,13 @@ func (s *ListBucketMetricsConfigurationsInput) SetBucket(v string) *ListBucketMe return s } +func (s *ListBucketMetricsConfigurationsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetContinuationToken sets the ContinuationToken field's value. func (s *ListBucketMetricsConfigurationsInput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsInput { s.ContinuationToken = &v @@ -11998,6 +13544,13 @@ func (s *ListMultipartUploadsInput) SetBucket(v string) *ListMultipartUploadsInp return s } +func (s *ListMultipartUploadsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetDelimiter sets the Delimiter field's value. func (s *ListMultipartUploadsInput) SetDelimiter(v string) *ListMultipartUploadsInput { s.Delimiter = &v @@ -12095,6 +13648,13 @@ func (s *ListMultipartUploadsOutput) SetBucket(v string) *ListMultipartUploadsOu return s } +func (s *ListMultipartUploadsOutput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetCommonPrefixes sets the CommonPrefixes field's value. func (s *ListMultipartUploadsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListMultipartUploadsOutput { s.CommonPrefixes = v @@ -12222,6 +13782,13 @@ func (s *ListObjectVersionsInput) SetBucket(v string) *ListObjectVersionsInput { return s } +func (s *ListObjectVersionsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetDelimiter sets the Delimiter field's value. func (s *ListObjectVersionsInput) SetDelimiter(v string) *ListObjectVersionsInput { s.Delimiter = &v @@ -12449,6 +14016,13 @@ func (s *ListObjectsInput) SetBucket(v string) *ListObjectsInput { return s } +func (s *ListObjectsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetDelimiter sets the Delimiter field's value. func (s *ListObjectsInput) SetDelimiter(v string) *ListObjectsInput { s.Delimiter = &v @@ -12661,6 +14235,13 @@ func (s *ListObjectsV2Input) SetBucket(v string) *ListObjectsV2Input { return s } +func (s *ListObjectsV2Input) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetContinuationToken sets the ContinuationToken field's value. func (s *ListObjectsV2Input) SetContinuationToken(v string) *ListObjectsV2Input { s.ContinuationToken = &v @@ -12910,6 +14491,13 @@ func (s *ListPartsInput) SetBucket(v string) *ListPartsInput { return s } +func (s *ListPartsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *ListPartsInput) SetKey(v string) *ListPartsInput { s.Key = &v @@ -13017,6 +14605,13 @@ func (s *ListPartsOutput) SetBucket(v string) *ListPartsOutput { return s } +func (s *ListPartsOutput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetInitiator sets the Initiator field's value. func (s *ListPartsOutput) SetInitiator(v *Initiator) *ListPartsOutput { s.Initiator = v @@ -13900,7 +15495,7 @@ type PutBucketAccelerateConfigurationInput struct { // Specifies the Accelerate Configuration you want to set for the bucket. // // AccelerateConfiguration is a required field - AccelerateConfiguration *AccelerateConfiguration `locationName:"AccelerateConfiguration" type:"structure" required:"true"` + AccelerateConfiguration *AccelerateConfiguration `locationName:"AccelerateConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // Name of the bucket for which the accelerate configuration is set. // @@ -13946,6 +15541,13 @@ func (s *PutBucketAccelerateConfigurationInput) SetBucket(v string) *PutBucketAc return s } +func (s *PutBucketAccelerateConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfigurationOutput type PutBucketAccelerateConfigurationOutput struct { _ struct{} `type:"structure"` @@ -13968,7 +15570,7 @@ type PutBucketAclInput struct { // 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"` + AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -14036,6 +15638,13 @@ func (s *PutBucketAclInput) SetBucket(v string) *PutBucketAclInput { return s } +func (s *PutBucketAclInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetGrantFullControl sets the GrantFullControl field's value. func (s *PutBucketAclInput) SetGrantFullControl(v string) *PutBucketAclInput { s.GrantFullControl = &v @@ -14088,7 +15697,7 @@ type PutBucketAnalyticsConfigurationInput struct { // The configuration and any analyses for the analytics filter. // // AnalyticsConfiguration is a required field - AnalyticsConfiguration *AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"structure" required:"true"` + AnalyticsConfiguration *AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // The name of the bucket to which an analytics configuration is stored. // @@ -14147,6 +15756,13 @@ func (s *PutBucketAnalyticsConfigurationInput) SetBucket(v string) *PutBucketAna return s } +func (s *PutBucketAnalyticsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *PutBucketAnalyticsConfigurationInput) SetId(v string) *PutBucketAnalyticsConfigurationInput { s.Id = &v @@ -14176,7 +15792,7 @@ type PutBucketCorsInput struct { Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // CORSConfiguration is a required field - CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true"` + CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14216,6 +15832,13 @@ func (s *PutBucketCorsInput) SetBucket(v string) *PutBucketCorsInput { return s } +func (s *PutBucketCorsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetCORSConfiguration sets the CORSConfiguration field's value. func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBucketCorsInput { s.CORSConfiguration = v @@ -14254,7 +15877,7 @@ type PutBucketInventoryConfigurationInput struct { // Specifies the inventory configuration. // // InventoryConfiguration is a required field - InventoryConfiguration *InventoryConfiguration `locationName:"InventoryConfiguration" type:"structure" required:"true"` + InventoryConfiguration *InventoryConfiguration `locationName:"InventoryConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14297,6 +15920,13 @@ func (s *PutBucketInventoryConfigurationInput) SetBucket(v string) *PutBucketInv return s } +func (s *PutBucketInventoryConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *PutBucketInventoryConfigurationInput) SetId(v string) *PutBucketInventoryConfigurationInput { s.Id = &v @@ -14331,7 +15961,7 @@ type PutBucketLifecycleConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure"` + LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14368,6 +15998,13 @@ func (s *PutBucketLifecycleConfigurationInput) SetBucket(v string) *PutBucketLif return s } +func (s *PutBucketLifecycleConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetLifecycleConfiguration sets the LifecycleConfiguration field's value. func (s *PutBucketLifecycleConfigurationInput) SetLifecycleConfiguration(v *BucketLifecycleConfiguration) *PutBucketLifecycleConfigurationInput { s.LifecycleConfiguration = v @@ -14396,7 +16033,7 @@ type PutBucketLifecycleInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - LifecycleConfiguration *LifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure"` + LifecycleConfiguration *LifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14433,6 +16070,13 @@ func (s *PutBucketLifecycleInput) SetBucket(v string) *PutBucketLifecycleInput { return s } +func (s *PutBucketLifecycleInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetLifecycleConfiguration sets the LifecycleConfiguration field's value. func (s *PutBucketLifecycleInput) SetLifecycleConfiguration(v *LifecycleConfiguration) *PutBucketLifecycleInput { s.LifecycleConfiguration = v @@ -14462,7 +16106,7 @@ type PutBucketLoggingInput struct { Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // BucketLoggingStatus is a required field - BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true"` + BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14502,6 +16146,13 @@ func (s *PutBucketLoggingInput) SetBucket(v string) *PutBucketLoggingInput { return s } +func (s *PutBucketLoggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetBucketLoggingStatus sets the BucketLoggingStatus field's value. func (s *PutBucketLoggingInput) SetBucketLoggingStatus(v *BucketLoggingStatus) *PutBucketLoggingInput { s.BucketLoggingStatus = v @@ -14540,7 +16191,7 @@ type PutBucketMetricsConfigurationInput struct { // Specifies the metrics configuration. // // MetricsConfiguration is a required field - MetricsConfiguration *MetricsConfiguration `locationName:"MetricsConfiguration" type:"structure" required:"true"` + MetricsConfiguration *MetricsConfiguration `locationName:"MetricsConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14583,6 +16234,13 @@ func (s *PutBucketMetricsConfigurationInput) SetBucket(v string) *PutBucketMetri return s } +func (s *PutBucketMetricsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetId sets the Id field's value. func (s *PutBucketMetricsConfigurationInput) SetId(v string) *PutBucketMetricsConfigurationInput { s.Id = &v @@ -14621,7 +16279,7 @@ type PutBucketNotificationConfigurationInput struct { // this element is empty, notifications are turned off on the bucket. // // NotificationConfiguration is a required field - NotificationConfiguration *NotificationConfiguration `locationName:"NotificationConfiguration" type:"structure" required:"true"` + NotificationConfiguration *NotificationConfiguration `locationName:"NotificationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14661,6 +16319,13 @@ func (s *PutBucketNotificationConfigurationInput) SetBucket(v string) *PutBucket return s } +func (s *PutBucketNotificationConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetNotificationConfiguration sets the NotificationConfiguration field's value. func (s *PutBucketNotificationConfigurationInput) SetNotificationConfiguration(v *NotificationConfiguration) *PutBucketNotificationConfigurationInput { s.NotificationConfiguration = v @@ -14690,7 +16355,7 @@ type PutBucketNotificationInput struct { Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // NotificationConfiguration is a required field - NotificationConfiguration *NotificationConfigurationDeprecated `locationName:"NotificationConfiguration" type:"structure" required:"true"` + NotificationConfiguration *NotificationConfigurationDeprecated `locationName:"NotificationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14725,6 +16390,13 @@ func (s *PutBucketNotificationInput) SetBucket(v string) *PutBucketNotificationI return s } +func (s *PutBucketNotificationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetNotificationConfiguration sets the NotificationConfiguration field's value. func (s *PutBucketNotificationInput) SetNotificationConfiguration(v *NotificationConfigurationDeprecated) *PutBucketNotificationInput { s.NotificationConfiguration = v @@ -14791,6 +16463,13 @@ func (s *PutBucketPolicyInput) SetBucket(v string) *PutBucketPolicyInput { return s } +func (s *PutBucketPolicyInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetPolicy sets the Policy field's value. func (s *PutBucketPolicyInput) SetPolicy(v string) *PutBucketPolicyInput { s.Policy = &v @@ -14823,7 +16502,7 @@ type PutBucketReplicationInput struct { // replication configuration size can be up to 2 MB. // // ReplicationConfiguration is a required field - ReplicationConfiguration *ReplicationConfiguration `locationName:"ReplicationConfiguration" type:"structure" required:"true"` + ReplicationConfiguration *ReplicationConfiguration `locationName:"ReplicationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14863,6 +16542,13 @@ func (s *PutBucketReplicationInput) SetBucket(v string) *PutBucketReplicationInp return s } +func (s *PutBucketReplicationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetReplicationConfiguration sets the ReplicationConfiguration field's value. func (s *PutBucketReplicationInput) SetReplicationConfiguration(v *ReplicationConfiguration) *PutBucketReplicationInput { s.ReplicationConfiguration = v @@ -14892,7 +16578,7 @@ type PutBucketRequestPaymentInput struct { Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // RequestPaymentConfiguration is a required field - RequestPaymentConfiguration *RequestPaymentConfiguration `locationName:"RequestPaymentConfiguration" type:"structure" required:"true"` + RequestPaymentConfiguration *RequestPaymentConfiguration `locationName:"RequestPaymentConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -14932,6 +16618,13 @@ func (s *PutBucketRequestPaymentInput) SetBucket(v string) *PutBucketRequestPaym return s } +func (s *PutBucketRequestPaymentInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetRequestPaymentConfiguration sets the RequestPaymentConfiguration field's value. func (s *PutBucketRequestPaymentInput) SetRequestPaymentConfiguration(v *RequestPaymentConfiguration) *PutBucketRequestPaymentInput { s.RequestPaymentConfiguration = v @@ -14961,7 +16654,7 @@ type PutBucketTaggingInput struct { Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // Tagging is a required field - Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true"` + Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -15001,6 +16694,13 @@ func (s *PutBucketTaggingInput) SetBucket(v string) *PutBucketTaggingInput { return s } +func (s *PutBucketTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetTagging sets the Tagging field's value. func (s *PutBucketTaggingInput) SetTagging(v *Tagging) *PutBucketTaggingInput { s.Tagging = v @@ -15034,7 +16734,7 @@ type PutBucketVersioningInput struct { MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` // VersioningConfiguration is a required field - VersioningConfiguration *VersioningConfiguration `locationName:"VersioningConfiguration" type:"structure" required:"true"` + VersioningConfiguration *VersioningConfiguration `locationName:"VersioningConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -15069,6 +16769,13 @@ func (s *PutBucketVersioningInput) SetBucket(v string) *PutBucketVersioningInput return s } +func (s *PutBucketVersioningInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetMFA sets the MFA field's value. func (s *PutBucketVersioningInput) SetMFA(v string) *PutBucketVersioningInput { s.MFA = &v @@ -15104,7 +16811,7 @@ type PutBucketWebsiteInput struct { Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // WebsiteConfiguration is a required field - WebsiteConfiguration *WebsiteConfiguration `locationName:"WebsiteConfiguration" type:"structure" required:"true"` + WebsiteConfiguration *WebsiteConfiguration `locationName:"WebsiteConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } // String returns the string representation @@ -15144,6 +16851,13 @@ func (s *PutBucketWebsiteInput) SetBucket(v string) *PutBucketWebsiteInput { return s } +func (s *PutBucketWebsiteInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetWebsiteConfiguration sets the WebsiteConfiguration field's value. func (s *PutBucketWebsiteInput) SetWebsiteConfiguration(v *WebsiteConfiguration) *PutBucketWebsiteInput { s.WebsiteConfiguration = v @@ -15172,7 +16886,7 @@ type PutObjectAclInput struct { // 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"` + AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -15258,6 +16972,13 @@ func (s *PutObjectAclInput) SetBucket(v string) *PutObjectAclInput { return s } +func (s *PutObjectAclInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetGrantFullControl sets the GrantFullControl field's value. func (s *PutObjectAclInput) SetGrantFullControl(v string) *PutObjectAclInput { s.GrantFullControl = &v @@ -15480,6 +17201,13 @@ func (s *PutObjectInput) SetBucket(v string) *PutObjectInput { return s } +func (s *PutObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetCacheControl sets the CacheControl field's value. func (s *PutObjectInput) SetCacheControl(v string) *PutObjectInput { s.CacheControl = &v @@ -15576,6 +17304,13 @@ func (s *PutObjectInput) SetSSECustomerKey(v string) *PutObjectInput { return s } +func (s *PutObjectInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. func (s *PutObjectInput) SetSSECustomerKeyMD5(v string) *PutObjectInput { s.SSECustomerKeyMD5 = &v @@ -15718,7 +17453,7 @@ type PutObjectTaggingInput struct { 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"` + Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` VersionId *string `location:"querystring" locationName:"versionId" type:"string"` } @@ -15766,6 +17501,13 @@ func (s *PutObjectTaggingInput) SetBucket(v string) *PutObjectTaggingInput { return s } +func (s *PutObjectTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *PutObjectTaggingInput) SetKey(v string) *PutObjectTaggingInput { s.Key = &v @@ -16252,7 +17994,7 @@ type RestoreObjectInput struct { // 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"` + RestoreRequest *RestoreRequest `locationName:"RestoreRequest" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` VersionId *string `location:"querystring" locationName:"versionId" type:"string"` } @@ -16297,6 +18039,13 @@ func (s *RestoreObjectInput) SetBucket(v string) *RestoreObjectInput { return s } +func (s *RestoreObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetKey sets the Key field's value. func (s *RestoreObjectInput) SetKey(v string) *RestoreObjectInput { s.Key = &v @@ -16772,7 +18521,7 @@ func (s *Tagging) SetTagSet(v []*Tag) *Tagging { type TargetGrant struct { _ struct{} `type:"structure"` - Grantee *Grantee `type:"structure"` + Grantee *Grantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` // Logging permissions assigned to the Grantee for the bucket. Permission *string `type:"string" enum:"BucketLogsPermission"` @@ -17112,6 +18861,13 @@ func (s *UploadPartCopyInput) SetBucket(v string) *UploadPartCopyInput { return s } +func (s *UploadPartCopyInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetCopySource sets the CopySource field's value. func (s *UploadPartCopyInput) SetCopySource(v string) *UploadPartCopyInput { s.CopySource = &v @@ -17160,6 +18916,13 @@ func (s *UploadPartCopyInput) SetCopySourceSSECustomerKey(v string) *UploadPartC return s } +func (s *UploadPartCopyInput) getCopySourceSSECustomerKey() (v string) { + if s.CopySourceSSECustomerKey == nil { + return v + } + return *s.CopySourceSSECustomerKey +} + // SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. func (s *UploadPartCopyInput) SetCopySourceSSECustomerKeyMD5(v string) *UploadPartCopyInput { s.CopySourceSSECustomerKeyMD5 = &v @@ -17196,6 +18959,13 @@ func (s *UploadPartCopyInput) SetSSECustomerKey(v string) *UploadPartCopyInput { return s } +func (s *UploadPartCopyInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. func (s *UploadPartCopyInput) SetSSECustomerKeyMD5(v string) *UploadPartCopyInput { s.SSECustomerKeyMD5 = &v @@ -17395,6 +19165,13 @@ func (s *UploadPartInput) SetBucket(v string) *UploadPartInput { return s } +func (s *UploadPartInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + // SetContentLength sets the ContentLength field's value. func (s *UploadPartInput) SetContentLength(v int64) *UploadPartInput { s.ContentLength = &v @@ -17431,6 +19208,13 @@ func (s *UploadPartInput) SetSSECustomerKey(v string) *UploadPartInput { return s } +func (s *UploadPartInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. func (s *UploadPartInput) SetSSECustomerKeyMD5(v string) *UploadPartInput { s.SSECustomerKeyMD5 = &v 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 index c3a2702..bc68a46 100644 --- 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 @@ -12,6 +12,69 @@ import ( var reBucketLocation = regexp.MustCompile(`>([^<>]+)<\/Location`) +// NormalizeBucketLocation is a utility function which will update the +// passed in value to always be a region ID. Generally this would be used +// with GetBucketLocation API operation. +// +// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". +// +// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html +// for more information on the values that can be returned. +func NormalizeBucketLocation(loc string) string { + switch loc { + case "": + loc = "us-east-1" + case "EU": + loc = "eu-west-1" + } + + return loc +} + +// NormalizeBucketLocationHandler is a request handler which will update the +// GetBucketLocation's result LocationConstraint value to always be a region ID. +// +// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". +// +// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html +// for more information on the values that can be returned. +// +// req, result := svc.GetBucketLocationRequest(&s3.GetBucketLocationInput{ +// Bucket: aws.String(bucket), +// }) +// req.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) +// err := req.Send() +var NormalizeBucketLocationHandler = request.NamedHandler{ + Name: "awssdk.s3.NormalizeBucketLocation", + Fn: func(req *request.Request) { + if req.Error != nil { + return + } + + out := req.Data.(*GetBucketLocationOutput) + loc := NormalizeBucketLocation(aws.StringValue(out.LocationConstraint)) + out.LocationConstraint = aws.String(loc) + }, +} + +// WithNormalizeBucketLocation is a request option which will update the +// GetBucketLocation's result LocationConstraint value to always be a region ID. +// +// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". +// +// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html +// for more information on the values that can be returned. +// +// result, err := svc.GetBucketLocationWithContext(ctx, +// &s3.GetBucketLocationInput{ +// Bucket: aws.String(bucket), +// }, +// s3.WithNormalizeBucketLocation, +// ) +func WithNormalizeBucketLocation(r *request.Request) { + r.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) +} + func buildGetBucketLocation(r *request.Request) { if r.DataFilled() { out := r.Data.(*GetBucketLocationOutput) @@ -24,7 +87,7 @@ func buildGetBucketLocation(r *request.Request) { match := reBucketLocation.FindSubmatch(b) if len(match) > 1 { loc := string(match[1]) - out.LocationConstraint = &loc + out.LocationConstraint = aws.String(loc) } } } 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 index 8463347..899d5e8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go @@ -44,3 +44,21 @@ func defaultInitRequestFn(r *request.Request) { r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarhsalError) } } + +// bucketGetter is an accessor interface to grab the "Bucket" field from +// an S3 type. +type bucketGetter interface { + getBucket() string +} + +// sseCustomerKeyGetter is an accessor interface to grab the "SSECustomerKey" +// field from an S3 type. +type sseCustomerKeyGetter interface { + getSSECustomerKey() string +} + +// copySourceSSECustomerKeyGetter is an accessor interface to grab the +// "CopySourceSSECustomerKey" field from an S3 type. +type copySourceSSECustomerKeyGetter interface { + getCopySourceSSECustomerKey() string +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go new file mode 100644 index 0000000..30068d1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go @@ -0,0 +1,26 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package s3 provides the client and types for making API +// requests to Amazon Simple Storage Service. +// +// See https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01 for more information on this service. +// +// See s3 package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/ +// +// Using the Client +// +// To Amazon Simple Storage 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 Amazon Simple Storage Service client S3 for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/#New +package s3 diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go new file mode 100644 index 0000000..b794a63 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go @@ -0,0 +1,109 @@ +// Upload Managers +// +// The s3manager package's Uploader provides concurrent upload of content to S3 +// by taking advantage of S3's Multipart APIs. The Uploader also supports both +// io.Reader for streaming uploads, and will also take advantage of io.ReadSeeker +// for optimizations if the Body satisfies that type. Once the Uploader instance +// is created you can call Upload concurrently from multiple goroutines safely. +// +// // The session the S3 Uploader will use +// sess := session.Must(session.NewSession()) +// +// // Create an uploader with the session and default options +// uploader := s3manager.NewUploader(sess) +// +// f, err := os.Open(filename) +// if err != nil { +// return fmt.Errorf("failed to open file %q, %v", filename, err) +// } +// +// // Upload the file to S3. +// result, err := uploader.Upload(&s3manager.UploadInput{ +// Bucket: aws.String(myBucket), +// Key: aws.String(myString), +// Body: f, +// }) +// if err != nil { +// return fmt.Errorf("failed to upload file, %v", err) +// } +// fmt.Printf("file uploaded to, %s\n", aws.StringValue(result.Location)) +// +// See the s3manager package's Uploader type documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Uploader +// +// Download Manager +// +// The s3manager package's Downloader provides concurrently downloading of Objects +// from S3. The Downloader will write S3 Object content with an io.WriterAt. +// Once the Downloader instance is created you can call Upload concurrently from +// multiple goroutines safely. +// +// // The session the S3 Downloader will use +// sess := session.Must(session.NewSession()) +// +// // Create a downloader with the session and default options +// downloader := s3manager.NewDownloader(sess) +// +// // Create a file to write the S3 Object contents to. +// f, err := os.Create(filename) +// if err != nil { +// return fmt.Errorf("failed to create file %q, %v", filename, err) +// } +// +// // Write the contents of S3 Object to the file +// n, err := downloader.Download(f, &s3.GetObjectInput{ +// Bucket: aws.String(myBucket), +// Key: aws.String(myString), +// }) +// if err != nil { +// return fmt.Errorf("failed to upload file, %v", err) +// } +// fmt.Printf("file downloaded, %d bytes\n", n) +// +// See the s3manager package's Downloader type documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Downloader +// +// Get Bucket Region +// +// GetBucketRegion will attempt to get the region for a bucket using a region +// hint to determine which AWS partition to perform the query on. Use this utility +// to determine the region a bucket is in. +// +// sess := session.Must(session.NewSession()) +// +// bucket := "my-bucket" +// region, err := s3manager.GetBucketRegion(ctx, sess, bucket, "us-west-2") +// if err != nil { +// if aerr, ok := err.(awserr.Error); ok && aerr.Code() == "NotFound" { +// fmt.Fprintf(os.Stderr, "unable to find bucket %s's region not found\n", bucket) +// } +// return err +// } +// fmt.Printf("Bucket %s is in %s region\n", bucket, region) +// +// See the s3manager package's GetBucketRegion function documentation for more information +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#GetBucketRegion +// +// S3 Crypto Client +// +// The s3crypto package provides the tools to upload and download encrypted +// content from S3. The Encryption and Decryption clients can be used concurrently +// once the client is created. +// +// sess := session.Must(session.NewSession()) +// +// // Create the decryption client. +// svc := s3crypto.NewDecryptionClient(sess) +// +// // The object will be downloaded from S3 and decrypted locally. By metadata +// // about the object's encryption will instruct the decryption client how +// // decrypt the content of the object. By default KMS is used for keys. +// result, err := svc.GetObject(&s3.GetObjectInput { +// Bucket: aws.String(myBucket), +// Key: aws.String(myKey), +// }) +// +// See the s3crypto package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3crypto/ +// +package s3 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 index 13ebbda..931cb17 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package s3 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 index ec3ffe4..a7fbc2d 100644 --- 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 @@ -8,7 +8,6 @@ import ( "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" ) @@ -113,15 +112,9 @@ func updateEndpointForAccelerate(r *request.Request) { // 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 - } + if iface, ok := params.(bucketGetter); ok { + b := iface.getBucket() + return b, len(b) > 0 } return "", false diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go index 5e6f229..614e477 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package s3 @@ -11,10 +11,12 @@ import ( "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 +// S3 provides the API operation methods for making requests to +// Amazon Simple Storage Service. See this package's package overview docs +// for details on the service. +// +// S3 methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. type S3 struct { *client.Client } 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 index 268ea2f..8010c4f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go @@ -5,17 +5,27 @@ import ( "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 { + if r.HTTPRequest.URL.Scheme == "https" { + return + } + + if iface, ok := r.Params.(sseCustomerKeyGetter); ok { + if len(iface.getSSECustomerKey()) > 0 { + r.Error = errSSERequiresSSL + return + } + } + + if iface, ok := r.Params.(copySourceSSECustomerKeyGetter); ok { + if len(iface.getCopySourceSSECustomerKey()) > 0 { r.Error = errSSERequiresSSL + return } } } 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 index ed91c58..bcca862 100644 --- 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 @@ -23,17 +23,22 @@ 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 = 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, - ) + 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 } @@ -48,6 +53,7 @@ func unmarshalError(r *request.Request) { } else { errCode = resp.Code errMsg = resp.Message + err = nil } // Fallback to status code converted to message if still no error code @@ -57,9 +63,41 @@ func unmarshalError(r *request.Request) { errMsg = statusText } - r.Error = awserr.NewRequestFailure( - awserr.New(errCode, errMsg, nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) + 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/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go index 5e16be4..2596c69 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go @@ -1,139 +1,214 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package s3 import ( - "github.com/aws/aws-sdk-go/private/waiter" + "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 +// If the condition is not met within the max attempt window, an error will // be returned. func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error { - waiterCfg := waiter.Config{ - Operation: "HeadBucket", - Delay: 5, + 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, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 301, }, { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 403, }, { - State: "retry", - Matcher: "status", - Argument: "", + 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...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + 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 +// If the condition is not met within the max attempt window, an error will // be returned. func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error { - waiterCfg := waiter.Config{ - Operation: "HeadBucket", - Delay: 5, + 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, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + 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...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + 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 +// If the condition is not met within the max attempt window, an error will // be returned. func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error { - waiterCfg := waiter.Config{ - Operation: "HeadObject", - Delay: 5, + 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, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, Expected: 200, }, { - State: "retry", - Matcher: "status", - Argument: "", + 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...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + 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 +// If the condition is not met within the max attempt window, an error will // be returned. func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error { - waiterCfg := waiter.Config{ - Operation: "HeadObject", - Delay: 5, + 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, - Acceptors: []waiter.WaitAcceptor{ + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ { - State: "success", - Matcher: "status", - Argument: "", + 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...) - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() + return w.WaitWithContext(ctx) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/ses/api.go b/vendor/github.com/aws/aws-sdk-go/service/ses/api.go deleted file mode 100644 index 7925378..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/api.go +++ /dev/null @@ -1,9998 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package ses provides a client for Amazon Simple Email Service. -package ses - -import ( - "fmt" - "time" - - "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 opCloneReceiptRuleSet = "CloneReceiptRuleSet" - -// CloneReceiptRuleSetRequest generates a "aws/request.Request" representing the -// client's request for the CloneReceiptRuleSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CloneReceiptRuleSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CloneReceiptRuleSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CloneReceiptRuleSetRequest method. -// req, resp := client.CloneReceiptRuleSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CloneReceiptRuleSet -func (c *SES) CloneReceiptRuleSetRequest(input *CloneReceiptRuleSetInput) (req *request.Request, output *CloneReceiptRuleSetOutput) { - op := &request.Operation{ - Name: opCloneReceiptRuleSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CloneReceiptRuleSetInput{} - } - - output = &CloneReceiptRuleSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CloneReceiptRuleSet API operation for Amazon Simple Email Service. -// -// Creates a receipt rule set by cloning an existing one. All receipt rules -// and configurations are copied to the new receipt rule set and are completely -// independent of the source rule set. -// -// For information about setting up rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rule-set.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation CloneReceiptRuleSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// * ErrCodeAlreadyExistsException "AlreadyExists" -// Indicates that a resource could not be created because of a naming conflict. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// Indicates that a resource could not be created because of service limits. -// For a list of Amazon SES limits, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CloneReceiptRuleSet -func (c *SES) CloneReceiptRuleSet(input *CloneReceiptRuleSetInput) (*CloneReceiptRuleSetOutput, error) { - req, out := c.CloneReceiptRuleSetRequest(input) - err := req.Send() - return out, err -} - -const opCreateConfigurationSet = "CreateConfigurationSet" - -// CreateConfigurationSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateConfigurationSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateConfigurationSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateConfigurationSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateConfigurationSetRequest method. -// req, resp := client.CreateConfigurationSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSet -func (c *SES) CreateConfigurationSetRequest(input *CreateConfigurationSetInput) (req *request.Request, output *CreateConfigurationSetOutput) { - op := &request.Operation{ - Name: opCreateConfigurationSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateConfigurationSetInput{} - } - - output = &CreateConfigurationSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateConfigurationSet API operation for Amazon Simple Email Service. -// -// Creates a configuration set. -// -// Configuration sets enable you to publish email sending events. For information -// about using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation CreateConfigurationSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConfigurationSetAlreadyExistsException "ConfigurationSetAlreadyExists" -// Indicates that the configuration set could not be created because of a naming -// conflict. -// -// * ErrCodeInvalidConfigurationSetException "InvalidConfigurationSet" -// Indicates that the configuration set is invalid. See the error message for -// details. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// Indicates that a resource could not be created because of service limits. -// For a list of Amazon SES limits, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSet -func (c *SES) CreateConfigurationSet(input *CreateConfigurationSetInput) (*CreateConfigurationSetOutput, error) { - req, out := c.CreateConfigurationSetRequest(input) - err := req.Send() - return out, err -} - -const opCreateConfigurationSetEventDestination = "CreateConfigurationSetEventDestination" - -// CreateConfigurationSetEventDestinationRequest generates a "aws/request.Request" representing the -// client's request for the CreateConfigurationSetEventDestination operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateConfigurationSetEventDestination for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateConfigurationSetEventDestination method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateConfigurationSetEventDestinationRequest method. -// req, resp := client.CreateConfigurationSetEventDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSetEventDestination -func (c *SES) CreateConfigurationSetEventDestinationRequest(input *CreateConfigurationSetEventDestinationInput) (req *request.Request, output *CreateConfigurationSetEventDestinationOutput) { - op := &request.Operation{ - Name: opCreateConfigurationSetEventDestination, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateConfigurationSetEventDestinationInput{} - } - - output = &CreateConfigurationSetEventDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateConfigurationSetEventDestination API operation for Amazon Simple Email Service. -// -// Creates a configuration set event destination. -// -// When you create or update an event destination, you must provide one, and -// only one, destination. The destination can be either Amazon CloudWatch or -// Amazon Kinesis Firehose. -// -// An event destination is the AWS service to which Amazon SES publishes the -// email sending events associated with a configuration set. For information -// about using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation CreateConfigurationSetEventDestination for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConfigurationSetDoesNotExistException "ConfigurationSetDoesNotExist" -// Indicates that the configuration set does not exist. -// -// * ErrCodeEventDestinationAlreadyExistsException "EventDestinationAlreadyExists" -// Indicates that the event destination could not be created because of a naming -// conflict. -// -// * ErrCodeInvalidCloudWatchDestinationException "InvalidCloudWatchDestination" -// Indicates that the Amazon CloudWatch destination is invalid. See the error -// message for details. -// -// * ErrCodeInvalidFirehoseDestinationException "InvalidFirehoseDestination" -// Indicates that the Amazon Kinesis Firehose destination is invalid. See the -// error message for details. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// Indicates that a resource could not be created because of service limits. -// For a list of Amazon SES limits, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSetEventDestination -func (c *SES) CreateConfigurationSetEventDestination(input *CreateConfigurationSetEventDestinationInput) (*CreateConfigurationSetEventDestinationOutput, error) { - req, out := c.CreateConfigurationSetEventDestinationRequest(input) - err := req.Send() - return out, err -} - -const opCreateReceiptFilter = "CreateReceiptFilter" - -// CreateReceiptFilterRequest generates a "aws/request.Request" representing the -// client's request for the CreateReceiptFilter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReceiptFilter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReceiptFilter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReceiptFilterRequest method. -// req, resp := client.CreateReceiptFilterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptFilter -func (c *SES) CreateReceiptFilterRequest(input *CreateReceiptFilterInput) (req *request.Request, output *CreateReceiptFilterOutput) { - op := &request.Operation{ - Name: opCreateReceiptFilter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReceiptFilterInput{} - } - - output = &CreateReceiptFilterOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReceiptFilter API operation for Amazon Simple Email Service. -// -// Creates a new IP address filter. -// -// For information about setting up IP address filters, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-ip-filters.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation CreateReceiptFilter for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceeded" -// Indicates that a resource could not be created because of service limits. -// For a list of Amazon SES limits, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). -// -// * ErrCodeAlreadyExistsException "AlreadyExists" -// Indicates that a resource could not be created because of a naming conflict. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptFilter -func (c *SES) CreateReceiptFilter(input *CreateReceiptFilterInput) (*CreateReceiptFilterOutput, error) { - req, out := c.CreateReceiptFilterRequest(input) - err := req.Send() - return out, err -} - -const opCreateReceiptRule = "CreateReceiptRule" - -// CreateReceiptRuleRequest generates a "aws/request.Request" representing the -// client's request for the CreateReceiptRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReceiptRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReceiptRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReceiptRuleRequest method. -// req, resp := client.CreateReceiptRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRule -func (c *SES) CreateReceiptRuleRequest(input *CreateReceiptRuleInput) (req *request.Request, output *CreateReceiptRuleOutput) { - op := &request.Operation{ - Name: opCreateReceiptRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReceiptRuleInput{} - } - - output = &CreateReceiptRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReceiptRule API operation for Amazon Simple Email Service. -// -// Creates a receipt rule. -// -// For information about setting up receipt rules, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rules.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation CreateReceiptRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidSnsTopicException "InvalidSnsTopic" -// Indicates that the provided Amazon SNS topic is invalid, or that Amazon SES -// could not publish to the topic, possibly due to permissions issues. For information -// about giving permissions, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// * ErrCodeInvalidS3ConfigurationException "InvalidS3Configuration" -// Indicates that the provided Amazon S3 bucket or AWS KMS encryption key is -// invalid, or that Amazon SES could not publish to the bucket, possibly due -// to permissions issues. For information about giving permissions, see the -// Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// * ErrCodeInvalidLambdaFunctionException "InvalidLambdaFunction" -// Indicates that the provided AWS Lambda function is invalid, or that Amazon -// SES could not execute the provided function, possibly due to permissions -// issues. For information about giving permissions, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// * ErrCodeAlreadyExistsException "AlreadyExists" -// Indicates that a resource could not be created because of a naming conflict. -// -// * ErrCodeRuleDoesNotExistException "RuleDoesNotExist" -// Indicates that the provided receipt rule does not exist. -// -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// Indicates that a resource could not be created because of service limits. -// For a list of Amazon SES limits, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRule -func (c *SES) CreateReceiptRule(input *CreateReceiptRuleInput) (*CreateReceiptRuleOutput, error) { - req, out := c.CreateReceiptRuleRequest(input) - err := req.Send() - return out, err -} - -const opCreateReceiptRuleSet = "CreateReceiptRuleSet" - -// CreateReceiptRuleSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateReceiptRuleSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReceiptRuleSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReceiptRuleSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReceiptRuleSetRequest method. -// req, resp := client.CreateReceiptRuleSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRuleSet -func (c *SES) CreateReceiptRuleSetRequest(input *CreateReceiptRuleSetInput) (req *request.Request, output *CreateReceiptRuleSetOutput) { - op := &request.Operation{ - Name: opCreateReceiptRuleSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReceiptRuleSetInput{} - } - - output = &CreateReceiptRuleSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReceiptRuleSet API operation for Amazon Simple Email Service. -// -// Creates an empty receipt rule set. -// -// For information about setting up receipt rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rule-set.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation CreateReceiptRuleSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExists" -// Indicates that a resource could not be created because of a naming conflict. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// Indicates that a resource could not be created because of service limits. -// For a list of Amazon SES limits, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRuleSet -func (c *SES) CreateReceiptRuleSet(input *CreateReceiptRuleSetInput) (*CreateReceiptRuleSetOutput, error) { - req, out := c.CreateReceiptRuleSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteConfigurationSet = "DeleteConfigurationSet" - -// DeleteConfigurationSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConfigurationSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteConfigurationSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteConfigurationSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteConfigurationSetRequest method. -// req, resp := client.DeleteConfigurationSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSet -func (c *SES) DeleteConfigurationSetRequest(input *DeleteConfigurationSetInput) (req *request.Request, output *DeleteConfigurationSetOutput) { - op := &request.Operation{ - Name: opDeleteConfigurationSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteConfigurationSetInput{} - } - - output = &DeleteConfigurationSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteConfigurationSet API operation for Amazon Simple Email Service. -// -// Deletes a configuration set. -// -// Configuration sets enable you to publish email sending events. For information -// about using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DeleteConfigurationSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConfigurationSetDoesNotExistException "ConfigurationSetDoesNotExist" -// Indicates that the configuration set does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSet -func (c *SES) DeleteConfigurationSet(input *DeleteConfigurationSetInput) (*DeleteConfigurationSetOutput, error) { - req, out := c.DeleteConfigurationSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteConfigurationSetEventDestination = "DeleteConfigurationSetEventDestination" - -// DeleteConfigurationSetEventDestinationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConfigurationSetEventDestination operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteConfigurationSetEventDestination for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteConfigurationSetEventDestination method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteConfigurationSetEventDestinationRequest method. -// req, resp := client.DeleteConfigurationSetEventDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSetEventDestination -func (c *SES) DeleteConfigurationSetEventDestinationRequest(input *DeleteConfigurationSetEventDestinationInput) (req *request.Request, output *DeleteConfigurationSetEventDestinationOutput) { - op := &request.Operation{ - Name: opDeleteConfigurationSetEventDestination, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteConfigurationSetEventDestinationInput{} - } - - output = &DeleteConfigurationSetEventDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteConfigurationSetEventDestination API operation for Amazon Simple Email Service. -// -// Deletes a configuration set event destination. -// -// Configuration set event destinations are associated with configuration sets, -// which enable you to publish email sending events. For information about using -// configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DeleteConfigurationSetEventDestination for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConfigurationSetDoesNotExistException "ConfigurationSetDoesNotExist" -// Indicates that the configuration set does not exist. -// -// * ErrCodeEventDestinationDoesNotExistException "EventDestinationDoesNotExist" -// Indicates that the event destination does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSetEventDestination -func (c *SES) DeleteConfigurationSetEventDestination(input *DeleteConfigurationSetEventDestinationInput) (*DeleteConfigurationSetEventDestinationOutput, error) { - req, out := c.DeleteConfigurationSetEventDestinationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteIdentity = "DeleteIdentity" - -// DeleteIdentityRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteIdentity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteIdentity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteIdentityRequest method. -// req, resp := client.DeleteIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentity -func (c *SES) DeleteIdentityRequest(input *DeleteIdentityInput) (req *request.Request, output *DeleteIdentityOutput) { - op := &request.Operation{ - Name: opDeleteIdentity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteIdentityInput{} - } - - output = &DeleteIdentityOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteIdentity API operation for Amazon Simple Email Service. -// -// Deletes the specified identity (an email address or a domain) from the list -// of verified identities. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DeleteIdentity for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentity -func (c *SES) DeleteIdentity(input *DeleteIdentityInput) (*DeleteIdentityOutput, error) { - req, out := c.DeleteIdentityRequest(input) - err := req.Send() - return out, err -} - -const opDeleteIdentityPolicy = "DeleteIdentityPolicy" - -// DeleteIdentityPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIdentityPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteIdentityPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteIdentityPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteIdentityPolicyRequest method. -// req, resp := client.DeleteIdentityPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentityPolicy -func (c *SES) DeleteIdentityPolicyRequest(input *DeleteIdentityPolicyInput) (req *request.Request, output *DeleteIdentityPolicyOutput) { - op := &request.Operation{ - Name: opDeleteIdentityPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteIdentityPolicyInput{} - } - - output = &DeleteIdentityPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteIdentityPolicy API operation for Amazon Simple Email Service. -// -// Deletes the specified sending authorization policy for the given identity -// (an email address or a domain). This API returns successfully even if a policy -// with the specified name does not exist. -// -// This API is for the identity owner only. If you have not verified the identity, -// this API will return an error. -// -// Sending authorization is a feature that enables an identity owner to authorize -// other senders to use its identities. For information about using sending -// authorization, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DeleteIdentityPolicy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentityPolicy -func (c *SES) DeleteIdentityPolicy(input *DeleteIdentityPolicyInput) (*DeleteIdentityPolicyOutput, error) { - req, out := c.DeleteIdentityPolicyRequest(input) - err := req.Send() - return out, err -} - -const opDeleteReceiptFilter = "DeleteReceiptFilter" - -// DeleteReceiptFilterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReceiptFilter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteReceiptFilter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteReceiptFilter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteReceiptFilterRequest method. -// req, resp := client.DeleteReceiptFilterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptFilter -func (c *SES) DeleteReceiptFilterRequest(input *DeleteReceiptFilterInput) (req *request.Request, output *DeleteReceiptFilterOutput) { - op := &request.Operation{ - Name: opDeleteReceiptFilter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteReceiptFilterInput{} - } - - output = &DeleteReceiptFilterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteReceiptFilter API operation for Amazon Simple Email Service. -// -// Deletes the specified IP address filter. -// -// For information about managing IP address filters, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-ip-filters.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DeleteReceiptFilter for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptFilter -func (c *SES) DeleteReceiptFilter(input *DeleteReceiptFilterInput) (*DeleteReceiptFilterOutput, error) { - req, out := c.DeleteReceiptFilterRequest(input) - err := req.Send() - return out, err -} - -const opDeleteReceiptRule = "DeleteReceiptRule" - -// DeleteReceiptRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReceiptRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteReceiptRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteReceiptRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteReceiptRuleRequest method. -// req, resp := client.DeleteReceiptRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRule -func (c *SES) DeleteReceiptRuleRequest(input *DeleteReceiptRuleInput) (req *request.Request, output *DeleteReceiptRuleOutput) { - op := &request.Operation{ - Name: opDeleteReceiptRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteReceiptRuleInput{} - } - - output = &DeleteReceiptRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteReceiptRule API operation for Amazon Simple Email Service. -// -// Deletes the specified receipt rule. -// -// For information about managing receipt rules, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-receipt-rules.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DeleteReceiptRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRule -func (c *SES) DeleteReceiptRule(input *DeleteReceiptRuleInput) (*DeleteReceiptRuleOutput, error) { - req, out := c.DeleteReceiptRuleRequest(input) - err := req.Send() - return out, err -} - -const opDeleteReceiptRuleSet = "DeleteReceiptRuleSet" - -// DeleteReceiptRuleSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReceiptRuleSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteReceiptRuleSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteReceiptRuleSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteReceiptRuleSetRequest method. -// req, resp := client.DeleteReceiptRuleSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRuleSet -func (c *SES) DeleteReceiptRuleSetRequest(input *DeleteReceiptRuleSetInput) (req *request.Request, output *DeleteReceiptRuleSetOutput) { - op := &request.Operation{ - Name: opDeleteReceiptRuleSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteReceiptRuleSetInput{} - } - - output = &DeleteReceiptRuleSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteReceiptRuleSet API operation for Amazon Simple Email Service. -// -// Deletes the specified receipt rule set and all of the receipt rules it contains. -// -// The currently active rule set cannot be deleted. -// -// For information about managing receipt rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-receipt-rule-sets.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DeleteReceiptRuleSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCannotDeleteException "CannotDelete" -// Indicates that the delete operation could not be completed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRuleSet -func (c *SES) DeleteReceiptRuleSet(input *DeleteReceiptRuleSetInput) (*DeleteReceiptRuleSetOutput, error) { - req, out := c.DeleteReceiptRuleSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVerifiedEmailAddress = "DeleteVerifiedEmailAddress" - -// DeleteVerifiedEmailAddressRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVerifiedEmailAddress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVerifiedEmailAddress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVerifiedEmailAddress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVerifiedEmailAddressRequest method. -// req, resp := client.DeleteVerifiedEmailAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteVerifiedEmailAddress -func (c *SES) DeleteVerifiedEmailAddressRequest(input *DeleteVerifiedEmailAddressInput) (req *request.Request, output *DeleteVerifiedEmailAddressOutput) { - op := &request.Operation{ - Name: opDeleteVerifiedEmailAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVerifiedEmailAddressInput{} - } - - output = &DeleteVerifiedEmailAddressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVerifiedEmailAddress API operation for Amazon Simple Email Service. -// -// Deletes the specified email address from the list of verified addresses. -// -// The DeleteVerifiedEmailAddress action is deprecated as of the May 15, 2012 -// release of Domain Verification. The DeleteIdentity action is now preferred. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DeleteVerifiedEmailAddress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteVerifiedEmailAddress -func (c *SES) DeleteVerifiedEmailAddress(input *DeleteVerifiedEmailAddressInput) (*DeleteVerifiedEmailAddressOutput, error) { - req, out := c.DeleteVerifiedEmailAddressRequest(input) - err := req.Send() - return out, err -} - -const opDescribeActiveReceiptRuleSet = "DescribeActiveReceiptRuleSet" - -// DescribeActiveReceiptRuleSetRequest generates a "aws/request.Request" representing the -// client's request for the DescribeActiveReceiptRuleSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeActiveReceiptRuleSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeActiveReceiptRuleSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeActiveReceiptRuleSetRequest method. -// req, resp := client.DescribeActiveReceiptRuleSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeActiveReceiptRuleSet -func (c *SES) DescribeActiveReceiptRuleSetRequest(input *DescribeActiveReceiptRuleSetInput) (req *request.Request, output *DescribeActiveReceiptRuleSetOutput) { - op := &request.Operation{ - Name: opDescribeActiveReceiptRuleSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeActiveReceiptRuleSetInput{} - } - - output = &DescribeActiveReceiptRuleSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeActiveReceiptRuleSet API operation for Amazon Simple Email Service. -// -// Returns the metadata and receipt rules for the receipt rule set that is currently -// active. -// -// For information about setting up receipt rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rule-set.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DescribeActiveReceiptRuleSet for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeActiveReceiptRuleSet -func (c *SES) DescribeActiveReceiptRuleSet(input *DescribeActiveReceiptRuleSetInput) (*DescribeActiveReceiptRuleSetOutput, error) { - req, out := c.DescribeActiveReceiptRuleSetRequest(input) - err := req.Send() - return out, err -} - -const opDescribeConfigurationSet = "DescribeConfigurationSet" - -// DescribeConfigurationSetRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConfigurationSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConfigurationSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConfigurationSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConfigurationSetRequest method. -// req, resp := client.DescribeConfigurationSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeConfigurationSet -func (c *SES) DescribeConfigurationSetRequest(input *DescribeConfigurationSetInput) (req *request.Request, output *DescribeConfigurationSetOutput) { - op := &request.Operation{ - Name: opDescribeConfigurationSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConfigurationSetInput{} - } - - output = &DescribeConfigurationSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConfigurationSet API operation for Amazon Simple Email Service. -// -// Returns the details of the specified configuration set. -// -// Configuration sets enable you to publish email sending events. For information -// about using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DescribeConfigurationSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConfigurationSetDoesNotExistException "ConfigurationSetDoesNotExist" -// Indicates that the configuration set does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeConfigurationSet -func (c *SES) DescribeConfigurationSet(input *DescribeConfigurationSetInput) (*DescribeConfigurationSetOutput, error) { - req, out := c.DescribeConfigurationSetRequest(input) - err := req.Send() - return out, err -} - -const opDescribeReceiptRule = "DescribeReceiptRule" - -// DescribeReceiptRuleRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReceiptRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReceiptRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReceiptRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReceiptRuleRequest method. -// req, resp := client.DescribeReceiptRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRule -func (c *SES) DescribeReceiptRuleRequest(input *DescribeReceiptRuleInput) (req *request.Request, output *DescribeReceiptRuleOutput) { - op := &request.Operation{ - Name: opDescribeReceiptRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReceiptRuleInput{} - } - - output = &DescribeReceiptRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReceiptRule API operation for Amazon Simple Email Service. -// -// Returns the details of the specified receipt rule. -// -// For information about setting up receipt rules, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rules.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DescribeReceiptRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleDoesNotExistException "RuleDoesNotExist" -// Indicates that the provided receipt rule does not exist. -// -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRule -func (c *SES) DescribeReceiptRule(input *DescribeReceiptRuleInput) (*DescribeReceiptRuleOutput, error) { - req, out := c.DescribeReceiptRuleRequest(input) - err := req.Send() - return out, err -} - -const opDescribeReceiptRuleSet = "DescribeReceiptRuleSet" - -// DescribeReceiptRuleSetRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReceiptRuleSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReceiptRuleSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReceiptRuleSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReceiptRuleSetRequest method. -// req, resp := client.DescribeReceiptRuleSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRuleSet -func (c *SES) DescribeReceiptRuleSetRequest(input *DescribeReceiptRuleSetInput) (req *request.Request, output *DescribeReceiptRuleSetOutput) { - op := &request.Operation{ - Name: opDescribeReceiptRuleSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReceiptRuleSetInput{} - } - - output = &DescribeReceiptRuleSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReceiptRuleSet API operation for Amazon Simple Email Service. -// -// Returns the details of the specified receipt rule set. -// -// For information about managing receipt rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-receipt-rule-sets.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation DescribeReceiptRuleSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRuleSet -func (c *SES) DescribeReceiptRuleSet(input *DescribeReceiptRuleSetInput) (*DescribeReceiptRuleSetOutput, error) { - req, out := c.DescribeReceiptRuleSetRequest(input) - err := req.Send() - return out, err -} - -const opGetIdentityDkimAttributes = "GetIdentityDkimAttributes" - -// GetIdentityDkimAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetIdentityDkimAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetIdentityDkimAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetIdentityDkimAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetIdentityDkimAttributesRequest method. -// req, resp := client.GetIdentityDkimAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityDkimAttributes -func (c *SES) GetIdentityDkimAttributesRequest(input *GetIdentityDkimAttributesInput) (req *request.Request, output *GetIdentityDkimAttributesOutput) { - op := &request.Operation{ - Name: opGetIdentityDkimAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetIdentityDkimAttributesInput{} - } - - output = &GetIdentityDkimAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIdentityDkimAttributes API operation for Amazon Simple Email Service. -// -// Returns the current status of Easy DKIM signing for an entity. For domain -// name identities, this action also returns the DKIM tokens that are required -// for Easy DKIM signing, and whether Amazon SES has successfully verified that -// these tokens have been published. -// -// This action takes a list of identities as input and returns the following -// information for each: -// -// * Whether Easy DKIM signing is enabled or disabled. -// -// * A set of DKIM tokens that represent the identity. If the identity is -// an email address, the tokens represent the domain of that address. -// -// * Whether Amazon SES has successfully verified the DKIM tokens published -// in the domain's DNS. This information is only returned for domain name -// identities, not for email addresses. -// -// This action is throttled at one request per second and can only get DKIM -// attributes for up to 100 identities at a time. -// -// For more information about creating DNS records using DKIM tokens, go to -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim-dns-records.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 Email Service's -// API operation GetIdentityDkimAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityDkimAttributes -func (c *SES) GetIdentityDkimAttributes(input *GetIdentityDkimAttributesInput) (*GetIdentityDkimAttributesOutput, error) { - req, out := c.GetIdentityDkimAttributesRequest(input) - err := req.Send() - return out, err -} - -const opGetIdentityMailFromDomainAttributes = "GetIdentityMailFromDomainAttributes" - -// GetIdentityMailFromDomainAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetIdentityMailFromDomainAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetIdentityMailFromDomainAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetIdentityMailFromDomainAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetIdentityMailFromDomainAttributesRequest method. -// req, resp := client.GetIdentityMailFromDomainAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityMailFromDomainAttributes -func (c *SES) GetIdentityMailFromDomainAttributesRequest(input *GetIdentityMailFromDomainAttributesInput) (req *request.Request, output *GetIdentityMailFromDomainAttributesOutput) { - op := &request.Operation{ - Name: opGetIdentityMailFromDomainAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetIdentityMailFromDomainAttributesInput{} - } - - output = &GetIdentityMailFromDomainAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIdentityMailFromDomainAttributes API operation for Amazon Simple Email Service. -// -// Returns the custom MAIL FROM attributes for a list of identities (email addresses -// and/or domains). -// -// This action is throttled at one request per second and can only get custom -// MAIL FROM attributes for up to 100 identities 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 Simple Email Service's -// API operation GetIdentityMailFromDomainAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityMailFromDomainAttributes -func (c *SES) GetIdentityMailFromDomainAttributes(input *GetIdentityMailFromDomainAttributesInput) (*GetIdentityMailFromDomainAttributesOutput, error) { - req, out := c.GetIdentityMailFromDomainAttributesRequest(input) - err := req.Send() - return out, err -} - -const opGetIdentityNotificationAttributes = "GetIdentityNotificationAttributes" - -// GetIdentityNotificationAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetIdentityNotificationAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetIdentityNotificationAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetIdentityNotificationAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetIdentityNotificationAttributesRequest method. -// req, resp := client.GetIdentityNotificationAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityNotificationAttributes -func (c *SES) GetIdentityNotificationAttributesRequest(input *GetIdentityNotificationAttributesInput) (req *request.Request, output *GetIdentityNotificationAttributesOutput) { - op := &request.Operation{ - Name: opGetIdentityNotificationAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetIdentityNotificationAttributesInput{} - } - - output = &GetIdentityNotificationAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIdentityNotificationAttributes API operation for Amazon Simple Email Service. -// -// Given a list of verified identities (email addresses and/or domains), returns -// a structure describing identity notification attributes. -// -// This action is throttled at one request per second and can only get notification -// attributes for up to 100 identities at a time. -// -// For more information about using notifications with Amazon SES, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.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 Email Service's -// API operation GetIdentityNotificationAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityNotificationAttributes -func (c *SES) GetIdentityNotificationAttributes(input *GetIdentityNotificationAttributesInput) (*GetIdentityNotificationAttributesOutput, error) { - req, out := c.GetIdentityNotificationAttributesRequest(input) - err := req.Send() - return out, err -} - -const opGetIdentityPolicies = "GetIdentityPolicies" - -// GetIdentityPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the GetIdentityPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetIdentityPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetIdentityPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetIdentityPoliciesRequest method. -// req, resp := client.GetIdentityPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityPolicies -func (c *SES) GetIdentityPoliciesRequest(input *GetIdentityPoliciesInput) (req *request.Request, output *GetIdentityPoliciesOutput) { - op := &request.Operation{ - Name: opGetIdentityPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetIdentityPoliciesInput{} - } - - output = &GetIdentityPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIdentityPolicies API operation for Amazon Simple Email Service. -// -// Returns the requested sending authorization policies for the given identity -// (an email address or a domain). The policies are returned as a map of policy -// names to policy contents. You can retrieve a maximum of 20 policies at a -// time. -// -// This API is for the identity owner only. If you have not verified the identity, -// this API will return an error. -// -// Sending authorization is a feature that enables an identity owner to authorize -// other senders to use its identities. For information about using sending -// authorization, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation GetIdentityPolicies for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityPolicies -func (c *SES) GetIdentityPolicies(input *GetIdentityPoliciesInput) (*GetIdentityPoliciesOutput, error) { - req, out := c.GetIdentityPoliciesRequest(input) - err := req.Send() - return out, err -} - -const opGetIdentityVerificationAttributes = "GetIdentityVerificationAttributes" - -// GetIdentityVerificationAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetIdentityVerificationAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetIdentityVerificationAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetIdentityVerificationAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetIdentityVerificationAttributesRequest method. -// req, resp := client.GetIdentityVerificationAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityVerificationAttributes -func (c *SES) GetIdentityVerificationAttributesRequest(input *GetIdentityVerificationAttributesInput) (req *request.Request, output *GetIdentityVerificationAttributesOutput) { - op := &request.Operation{ - Name: opGetIdentityVerificationAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetIdentityVerificationAttributesInput{} - } - - output = &GetIdentityVerificationAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIdentityVerificationAttributes API operation for Amazon Simple Email Service. -// -// Given a list of identities (email addresses and/or domains), returns the -// verification status and (for domain identities) the verification token for -// each identity. -// -// This action is throttled at one request per second and can only get verification -// attributes for up to 100 identities 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 Simple Email Service's -// API operation GetIdentityVerificationAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityVerificationAttributes -func (c *SES) GetIdentityVerificationAttributes(input *GetIdentityVerificationAttributesInput) (*GetIdentityVerificationAttributesOutput, error) { - req, out := c.GetIdentityVerificationAttributesRequest(input) - err := req.Send() - return out, err -} - -const opGetSendQuota = "GetSendQuota" - -// GetSendQuotaRequest generates a "aws/request.Request" representing the -// client's request for the GetSendQuota operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSendQuota for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSendQuota method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSendQuotaRequest method. -// req, resp := client.GetSendQuotaRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendQuota -func (c *SES) GetSendQuotaRequest(input *GetSendQuotaInput) (req *request.Request, output *GetSendQuotaOutput) { - op := &request.Operation{ - Name: opGetSendQuota, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSendQuotaInput{} - } - - output = &GetSendQuotaOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSendQuota API operation for Amazon Simple Email Service. -// -// Returns the user's current sending limits. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation GetSendQuota for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendQuota -func (c *SES) GetSendQuota(input *GetSendQuotaInput) (*GetSendQuotaOutput, error) { - req, out := c.GetSendQuotaRequest(input) - err := req.Send() - return out, err -} - -const opGetSendStatistics = "GetSendStatistics" - -// GetSendStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the GetSendStatistics operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSendStatistics for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSendStatistics method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSendStatisticsRequest method. -// req, resp := client.GetSendStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendStatistics -func (c *SES) GetSendStatisticsRequest(input *GetSendStatisticsInput) (req *request.Request, output *GetSendStatisticsOutput) { - op := &request.Operation{ - Name: opGetSendStatistics, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSendStatisticsInput{} - } - - output = &GetSendStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSendStatistics API operation for Amazon Simple Email Service. -// -// Returns the user's sending statistics. The result is a list of data points, -// representing the last two weeks of sending activity. -// -// Each data point in the list contains statistics for a 15-minute interval. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation GetSendStatistics for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendStatistics -func (c *SES) GetSendStatistics(input *GetSendStatisticsInput) (*GetSendStatisticsOutput, error) { - req, out := c.GetSendStatisticsRequest(input) - err := req.Send() - return out, err -} - -const opListConfigurationSets = "ListConfigurationSets" - -// ListConfigurationSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListConfigurationSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListConfigurationSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListConfigurationSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListConfigurationSetsRequest method. -// req, resp := client.ListConfigurationSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListConfigurationSets -func (c *SES) ListConfigurationSetsRequest(input *ListConfigurationSetsInput) (req *request.Request, output *ListConfigurationSetsOutput) { - op := &request.Operation{ - Name: opListConfigurationSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListConfigurationSetsInput{} - } - - output = &ListConfigurationSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListConfigurationSets API operation for Amazon Simple Email Service. -// -// Lists the configuration sets associated with your AWS account. -// -// Configuration sets enable you to publish email sending events. For information -// about using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// -// This action is throttled at one request per second and can return up to 50 -// configuration sets 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 Simple Email Service's -// API operation ListConfigurationSets for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListConfigurationSets -func (c *SES) ListConfigurationSets(input *ListConfigurationSetsInput) (*ListConfigurationSetsOutput, error) { - req, out := c.ListConfigurationSetsRequest(input) - err := req.Send() - return out, err -} - -const opListIdentities = "ListIdentities" - -// ListIdentitiesRequest generates a "aws/request.Request" representing the -// client's request for the ListIdentities operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListIdentities for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListIdentities method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListIdentitiesRequest method. -// req, resp := client.ListIdentitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentities -func (c *SES) ListIdentitiesRequest(input *ListIdentitiesInput) (req *request.Request, output *ListIdentitiesOutput) { - op := &request.Operation{ - Name: opListIdentities, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxItems", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIdentitiesInput{} - } - - output = &ListIdentitiesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIdentities API operation for Amazon Simple Email Service. -// -// Returns a list containing all of the identities (email addresses and domains) -// for your AWS account, regardless of verification status. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation ListIdentities for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentities -func (c *SES) ListIdentities(input *ListIdentitiesInput) (*ListIdentitiesOutput, error) { - req, out := c.ListIdentitiesRequest(input) - err := req.Send() - return out, err -} - -// ListIdentitiesPages iterates over the pages of a ListIdentities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIdentities 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 ListIdentities operation. -// pageNum := 0 -// err := client.ListIdentitiesPages(params, -// func(page *ListIdentitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SES) ListIdentitiesPages(input *ListIdentitiesInput, fn func(p *ListIdentitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListIdentitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListIdentitiesOutput), lastPage) - }) -} - -const opListIdentityPolicies = "ListIdentityPolicies" - -// ListIdentityPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListIdentityPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListIdentityPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListIdentityPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListIdentityPoliciesRequest method. -// req, resp := client.ListIdentityPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentityPolicies -func (c *SES) ListIdentityPoliciesRequest(input *ListIdentityPoliciesInput) (req *request.Request, output *ListIdentityPoliciesOutput) { - op := &request.Operation{ - Name: opListIdentityPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListIdentityPoliciesInput{} - } - - output = &ListIdentityPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIdentityPolicies API operation for Amazon Simple Email Service. -// -// Returns a list of sending authorization policies that are attached to the -// given identity (an email address or a domain). This API returns only a list. -// If you want the actual policy content, you can use GetIdentityPolicies. -// -// This API is for the identity owner only. If you have not verified the identity, -// this API will return an error. -// -// Sending authorization is a feature that enables an identity owner to authorize -// other senders to use its identities. For information about using sending -// authorization, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation ListIdentityPolicies for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentityPolicies -func (c *SES) ListIdentityPolicies(input *ListIdentityPoliciesInput) (*ListIdentityPoliciesOutput, error) { - req, out := c.ListIdentityPoliciesRequest(input) - err := req.Send() - return out, err -} - -const opListReceiptFilters = "ListReceiptFilters" - -// ListReceiptFiltersRequest generates a "aws/request.Request" representing the -// client's request for the ListReceiptFilters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListReceiptFilters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListReceiptFilters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListReceiptFiltersRequest method. -// req, resp := client.ListReceiptFiltersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptFilters -func (c *SES) ListReceiptFiltersRequest(input *ListReceiptFiltersInput) (req *request.Request, output *ListReceiptFiltersOutput) { - op := &request.Operation{ - Name: opListReceiptFilters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListReceiptFiltersInput{} - } - - output = &ListReceiptFiltersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListReceiptFilters API operation for Amazon Simple Email Service. -// -// Lists the IP address filters associated with your AWS account. -// -// For information about managing IP address filters, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-ip-filters.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation ListReceiptFilters for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptFilters -func (c *SES) ListReceiptFilters(input *ListReceiptFiltersInput) (*ListReceiptFiltersOutput, error) { - req, out := c.ListReceiptFiltersRequest(input) - err := req.Send() - return out, err -} - -const opListReceiptRuleSets = "ListReceiptRuleSets" - -// ListReceiptRuleSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListReceiptRuleSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListReceiptRuleSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListReceiptRuleSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListReceiptRuleSetsRequest method. -// req, resp := client.ListReceiptRuleSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptRuleSets -func (c *SES) ListReceiptRuleSetsRequest(input *ListReceiptRuleSetsInput) (req *request.Request, output *ListReceiptRuleSetsOutput) { - op := &request.Operation{ - Name: opListReceiptRuleSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListReceiptRuleSetsInput{} - } - - output = &ListReceiptRuleSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListReceiptRuleSets API operation for Amazon Simple Email Service. -// -// Lists the receipt rule sets that exist under your AWS account. If there are -// additional receipt rule sets to be retrieved, you will receive a NextToken -// that you can provide to the next call to ListReceiptRuleSets to retrieve -// the additional entries. -// -// For information about managing receipt rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-receipt-rule-sets.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation ListReceiptRuleSets for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptRuleSets -func (c *SES) ListReceiptRuleSets(input *ListReceiptRuleSetsInput) (*ListReceiptRuleSetsOutput, error) { - req, out := c.ListReceiptRuleSetsRequest(input) - err := req.Send() - return out, err -} - -const opListVerifiedEmailAddresses = "ListVerifiedEmailAddresses" - -// ListVerifiedEmailAddressesRequest generates a "aws/request.Request" representing the -// client's request for the ListVerifiedEmailAddresses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListVerifiedEmailAddresses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListVerifiedEmailAddresses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListVerifiedEmailAddressesRequest method. -// req, resp := client.ListVerifiedEmailAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListVerifiedEmailAddresses -func (c *SES) ListVerifiedEmailAddressesRequest(input *ListVerifiedEmailAddressesInput) (req *request.Request, output *ListVerifiedEmailAddressesOutput) { - op := &request.Operation{ - Name: opListVerifiedEmailAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListVerifiedEmailAddressesInput{} - } - - output = &ListVerifiedEmailAddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVerifiedEmailAddresses API operation for Amazon Simple Email Service. -// -// Returns a list containing all of the email addresses that have been verified. -// -// The ListVerifiedEmailAddresses action is deprecated as of the May 15, 2012 -// release of Domain Verification. The ListIdentities action is now preferred. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation ListVerifiedEmailAddresses for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListVerifiedEmailAddresses -func (c *SES) ListVerifiedEmailAddresses(input *ListVerifiedEmailAddressesInput) (*ListVerifiedEmailAddressesOutput, error) { - req, out := c.ListVerifiedEmailAddressesRequest(input) - err := req.Send() - return out, err -} - -const opPutIdentityPolicy = "PutIdentityPolicy" - -// PutIdentityPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutIdentityPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutIdentityPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutIdentityPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutIdentityPolicyRequest method. -// req, resp := client.PutIdentityPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/PutIdentityPolicy -func (c *SES) PutIdentityPolicyRequest(input *PutIdentityPolicyInput) (req *request.Request, output *PutIdentityPolicyOutput) { - op := &request.Operation{ - Name: opPutIdentityPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutIdentityPolicyInput{} - } - - output = &PutIdentityPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutIdentityPolicy API operation for Amazon Simple Email Service. -// -// Adds or updates a sending authorization policy for the specified identity -// (an email address or a domain). -// -// This API is for the identity owner only. If you have not verified the identity, -// this API will return an error. -// -// Sending authorization is a feature that enables an identity owner to authorize -// other senders to use its identities. For information about using sending -// authorization, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation PutIdentityPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidPolicyException "InvalidPolicy" -// Indicates that the provided policy is invalid. Check the error stack for -// more information about what caused the error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/PutIdentityPolicy -func (c *SES) PutIdentityPolicy(input *PutIdentityPolicyInput) (*PutIdentityPolicyOutput, error) { - req, out := c.PutIdentityPolicyRequest(input) - err := req.Send() - return out, err -} - -const opReorderReceiptRuleSet = "ReorderReceiptRuleSet" - -// ReorderReceiptRuleSetRequest generates a "aws/request.Request" representing the -// client's request for the ReorderReceiptRuleSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReorderReceiptRuleSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReorderReceiptRuleSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReorderReceiptRuleSetRequest method. -// req, resp := client.ReorderReceiptRuleSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReorderReceiptRuleSet -func (c *SES) ReorderReceiptRuleSetRequest(input *ReorderReceiptRuleSetInput) (req *request.Request, output *ReorderReceiptRuleSetOutput) { - op := &request.Operation{ - Name: opReorderReceiptRuleSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReorderReceiptRuleSetInput{} - } - - output = &ReorderReceiptRuleSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReorderReceiptRuleSet API operation for Amazon Simple Email Service. -// -// Reorders the receipt rules within a receipt rule set. -// -// All of the rules in the rule set must be represented in this request. That -// is, this API will return an error if the reorder request doesn't explicitly -// position all of the rules. -// -// For information about managing receipt rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-receipt-rule-sets.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation ReorderReceiptRuleSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// * ErrCodeRuleDoesNotExistException "RuleDoesNotExist" -// Indicates that the provided receipt rule does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReorderReceiptRuleSet -func (c *SES) ReorderReceiptRuleSet(input *ReorderReceiptRuleSetInput) (*ReorderReceiptRuleSetOutput, error) { - req, out := c.ReorderReceiptRuleSetRequest(input) - err := req.Send() - return out, err -} - -const opSendBounce = "SendBounce" - -// SendBounceRequest generates a "aws/request.Request" representing the -// client's request for the SendBounce operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendBounce for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendBounce method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendBounceRequest method. -// req, resp := client.SendBounceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendBounce -func (c *SES) SendBounceRequest(input *SendBounceInput) (req *request.Request, output *SendBounceOutput) { - op := &request.Operation{ - Name: opSendBounce, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendBounceInput{} - } - - output = &SendBounceOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendBounce API operation for Amazon Simple Email Service. -// -// Generates and sends a bounce message to the sender of an email you received -// through Amazon SES. You can only use this API on an email up to 24 hours -// after you receive it. -// -// You cannot use this API to send generic bounces for mail that was not received -// by Amazon SES. -// -// For information about receiving email through Amazon SES, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation SendBounce for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMessageRejected "MessageRejected" -// Indicates that the action failed, and the message could not be sent. Check -// the error stack for more information about what caused the error. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendBounce -func (c *SES) SendBounce(input *SendBounceInput) (*SendBounceOutput, error) { - req, out := c.SendBounceRequest(input) - err := req.Send() - return out, err -} - -const opSendEmail = "SendEmail" - -// SendEmailRequest generates a "aws/request.Request" representing the -// client's request for the SendEmail operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendEmail for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendEmail method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendEmailRequest method. -// req, resp := client.SendEmailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendEmail -func (c *SES) SendEmailRequest(input *SendEmailInput) (req *request.Request, output *SendEmailOutput) { - op := &request.Operation{ - Name: opSendEmail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendEmailInput{} - } - - output = &SendEmailOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendEmail API operation for Amazon Simple Email Service. -// -// Composes an email message based on input data, and then immediately queues -// the message for sending. -// -// There are several important points to know about SendEmail: -// -// * You can only send email from verified email addresses and domains; otherwise, -// you will get an "Email address not verified" error. If your account is -// still in the Amazon SES sandbox, you must also verify every recipient -// email address except for the recipients provided by the Amazon SES mailbox -// simulator. For more information, go to the Amazon SES Developer Guide -// (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html). -// -// * The total size of the message cannot exceed 10 MB. This includes any -// attachments that are part of the message. -// -// * Amazon SES has a limit on the total number of recipients per message. -// The combined number of To:, CC: and BCC: email addresses cannot exceed -// 50. If you need to send an email message to a larger audience, you can -// divide your recipient list into groups of 50 or fewer, and then call Amazon -// SES repeatedly to send the message to each group. -// -// * For every message that you send, the total number of recipients (To:, -// CC: and BCC:) is counted against your sending quota - the maximum number -// of emails you can send in a 24-hour period. For information about your -// sending quota, go to the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/manage-sending-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 Simple Email Service's -// API operation SendEmail for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMessageRejected "MessageRejected" -// Indicates that the action failed, and the message could not be sent. Check -// the error stack for more information about what caused the error. -// -// * ErrCodeMailFromDomainNotVerifiedException "MailFromDomainNotVerifiedException" -// Indicates that the message could not be sent because Amazon SES could not -// read the MX record required to use the specified MAIL FROM domain. For information -// about editing the custom MAIL FROM domain settings for an identity, see the -// Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from-edit.html). -// -// * ErrCodeConfigurationSetDoesNotExistException "ConfigurationSetDoesNotExist" -// Indicates that the configuration set does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendEmail -func (c *SES) SendEmail(input *SendEmailInput) (*SendEmailOutput, error) { - req, out := c.SendEmailRequest(input) - err := req.Send() - return out, err -} - -const opSendRawEmail = "SendRawEmail" - -// SendRawEmailRequest generates a "aws/request.Request" representing the -// client's request for the SendRawEmail operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendRawEmail for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendRawEmail method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendRawEmailRequest method. -// req, resp := client.SendRawEmailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendRawEmail -func (c *SES) SendRawEmailRequest(input *SendRawEmailInput) (req *request.Request, output *SendRawEmailOutput) { - op := &request.Operation{ - Name: opSendRawEmail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendRawEmailInput{} - } - - output = &SendRawEmailOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendRawEmail API operation for Amazon Simple Email Service. -// -// Sends an email message, with header and content specified by the client. -// The SendRawEmail action is useful for sending multipart MIME emails. The -// raw text of the message must comply with Internet email standards; otherwise, -// the message cannot be sent. -// -// There are several important points to know about SendRawEmail: -// -// * You can only send email from verified email addresses and domains; otherwise, -// you will get an "Email address not verified" error. If your account is -// still in the Amazon SES sandbox, you must also verify every recipient -// email address except for the recipients provided by the Amazon SES mailbox -// simulator. For more information, go to the Amazon SES Developer Guide -// (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html). -// -// * The total size of the message cannot exceed 10 MB. This includes any -// attachments that are part of the message. -// -// * Amazon SES has a limit on the total number of recipients per message. -// The combined number of To:, CC: and BCC: email addresses cannot exceed -// 50. If you need to send an email message to a larger audience, you can -// divide your recipient list into groups of 50 or fewer, and then call Amazon -// SES repeatedly to send the message to each group. -// -// * The To:, CC:, and BCC: headers in the raw message can contain a group -// list. Note that each recipient in a group list counts towards the 50-recipient -// limit. -// -// * Amazon SES overrides any Message-ID and Date headers you provide. -// -// * For every message that you send, the total number of recipients (To:, -// CC: and BCC:) is counted against your sending quota - the maximum number -// of emails you can send in a 24-hour period. For information about your -// sending quota, go to the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/manage-sending-limits.html). -// -// * If you are using sending authorization to send on behalf of another -// user, SendRawEmail enables you to specify the cross-account identity for -// the email's "Source," "From," and "Return-Path" parameters in one of two -// ways: you can pass optional parameters SourceArn, FromArn, and/or ReturnPathArn -// to the API, or you can include the following X-headers in the header of -// your raw email: -// -// X-SES-SOURCE-ARN -// -// X-SES-FROM-ARN -// -// X-SES-RETURN-PATH-ARN -// -// Do not include these X-headers in the DKIM signature, because they are removed -// by Amazon SES before sending the email. -// -// For the most common sending authorization use case, we recommend that you -// specify the SourceIdentityArn and do not specify either the FromIdentityArn -// or ReturnPathIdentityArn. (The same note applies to the corresponding -// X-headers.) If you only specify the SourceIdentityArn, Amazon SES will -// simply set the "From" address and the "Return Path" address to the identity -// specified in SourceIdentityArn. For more information about sending authorization, -// see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.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 Email Service's -// API operation SendRawEmail for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMessageRejected "MessageRejected" -// Indicates that the action failed, and the message could not be sent. Check -// the error stack for more information about what caused the error. -// -// * ErrCodeMailFromDomainNotVerifiedException "MailFromDomainNotVerifiedException" -// Indicates that the message could not be sent because Amazon SES could not -// read the MX record required to use the specified MAIL FROM domain. For information -// about editing the custom MAIL FROM domain settings for an identity, see the -// Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from-edit.html). -// -// * ErrCodeConfigurationSetDoesNotExistException "ConfigurationSetDoesNotExist" -// Indicates that the configuration set does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendRawEmail -func (c *SES) SendRawEmail(input *SendRawEmailInput) (*SendRawEmailOutput, error) { - req, out := c.SendRawEmailRequest(input) - err := req.Send() - return out, err -} - -const opSetActiveReceiptRuleSet = "SetActiveReceiptRuleSet" - -// SetActiveReceiptRuleSetRequest generates a "aws/request.Request" representing the -// client's request for the SetActiveReceiptRuleSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetActiveReceiptRuleSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetActiveReceiptRuleSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetActiveReceiptRuleSetRequest method. -// req, resp := client.SetActiveReceiptRuleSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetActiveReceiptRuleSet -func (c *SES) SetActiveReceiptRuleSetRequest(input *SetActiveReceiptRuleSetInput) (req *request.Request, output *SetActiveReceiptRuleSetOutput) { - op := &request.Operation{ - Name: opSetActiveReceiptRuleSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetActiveReceiptRuleSetInput{} - } - - output = &SetActiveReceiptRuleSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetActiveReceiptRuleSet API operation for Amazon Simple Email Service. -// -// Sets the specified receipt rule set as the active receipt rule set. -// -// To disable your email-receiving through Amazon SES completely, you can call -// this API with RuleSetName set to null. -// -// For information about managing receipt rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-receipt-rule-sets.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation SetActiveReceiptRuleSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetActiveReceiptRuleSet -func (c *SES) SetActiveReceiptRuleSet(input *SetActiveReceiptRuleSetInput) (*SetActiveReceiptRuleSetOutput, error) { - req, out := c.SetActiveReceiptRuleSetRequest(input) - err := req.Send() - return out, err -} - -const opSetIdentityDkimEnabled = "SetIdentityDkimEnabled" - -// SetIdentityDkimEnabledRequest generates a "aws/request.Request" representing the -// client's request for the SetIdentityDkimEnabled operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetIdentityDkimEnabled for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetIdentityDkimEnabled method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetIdentityDkimEnabledRequest method. -// req, resp := client.SetIdentityDkimEnabledRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityDkimEnabled -func (c *SES) SetIdentityDkimEnabledRequest(input *SetIdentityDkimEnabledInput) (req *request.Request, output *SetIdentityDkimEnabledOutput) { - op := &request.Operation{ - Name: opSetIdentityDkimEnabled, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetIdentityDkimEnabledInput{} - } - - output = &SetIdentityDkimEnabledOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetIdentityDkimEnabled API operation for Amazon Simple Email Service. -// -// Enables or disables Easy DKIM signing of email sent from an identity: -// -// * If Easy DKIM signing is enabled for a domain name identity (e.g., example.com), -// then Amazon SES will DKIM-sign all email sent by addresses under that -// domain name (e.g., user@example.com). -// -// * If Easy DKIM signing is enabled for an email address, then Amazon SES -// will DKIM-sign all email sent by that email address. -// -// For email addresses (e.g., user@example.com), you can only enable Easy DKIM -// signing if the corresponding domain (e.g., example.com) has been set up for -// Easy DKIM using the AWS Console or the VerifyDomainDkim action. -// -// This action is throttled at one request per second. -// -// For more information about Easy DKIM signing, go to the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.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 Email Service's -// API operation SetIdentityDkimEnabled for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityDkimEnabled -func (c *SES) SetIdentityDkimEnabled(input *SetIdentityDkimEnabledInput) (*SetIdentityDkimEnabledOutput, error) { - req, out := c.SetIdentityDkimEnabledRequest(input) - err := req.Send() - return out, err -} - -const opSetIdentityFeedbackForwardingEnabled = "SetIdentityFeedbackForwardingEnabled" - -// SetIdentityFeedbackForwardingEnabledRequest generates a "aws/request.Request" representing the -// client's request for the SetIdentityFeedbackForwardingEnabled operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetIdentityFeedbackForwardingEnabled for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetIdentityFeedbackForwardingEnabled method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetIdentityFeedbackForwardingEnabledRequest method. -// req, resp := client.SetIdentityFeedbackForwardingEnabledRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityFeedbackForwardingEnabled -func (c *SES) SetIdentityFeedbackForwardingEnabledRequest(input *SetIdentityFeedbackForwardingEnabledInput) (req *request.Request, output *SetIdentityFeedbackForwardingEnabledOutput) { - op := &request.Operation{ - Name: opSetIdentityFeedbackForwardingEnabled, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetIdentityFeedbackForwardingEnabledInput{} - } - - output = &SetIdentityFeedbackForwardingEnabledOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetIdentityFeedbackForwardingEnabled API operation for Amazon Simple Email Service. -// -// Given an identity (an email address or a domain), enables or disables whether -// Amazon SES forwards bounce and complaint notifications as email. Feedback -// forwarding can only be disabled when Amazon Simple Notification Service (Amazon -// SNS) topics are specified for both bounces and complaints. -// -// Feedback forwarding does not apply to delivery notifications. Delivery notifications -// are only available through Amazon SNS. -// -// This action is throttled at one request per second. -// -// For more information about using notifications with Amazon SES, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.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 Email Service's -// API operation SetIdentityFeedbackForwardingEnabled for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityFeedbackForwardingEnabled -func (c *SES) SetIdentityFeedbackForwardingEnabled(input *SetIdentityFeedbackForwardingEnabledInput) (*SetIdentityFeedbackForwardingEnabledOutput, error) { - req, out := c.SetIdentityFeedbackForwardingEnabledRequest(input) - err := req.Send() - return out, err -} - -const opSetIdentityHeadersInNotificationsEnabled = "SetIdentityHeadersInNotificationsEnabled" - -// SetIdentityHeadersInNotificationsEnabledRequest generates a "aws/request.Request" representing the -// client's request for the SetIdentityHeadersInNotificationsEnabled operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetIdentityHeadersInNotificationsEnabled for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetIdentityHeadersInNotificationsEnabled method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetIdentityHeadersInNotificationsEnabledRequest method. -// req, resp := client.SetIdentityHeadersInNotificationsEnabledRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityHeadersInNotificationsEnabled -func (c *SES) SetIdentityHeadersInNotificationsEnabledRequest(input *SetIdentityHeadersInNotificationsEnabledInput) (req *request.Request, output *SetIdentityHeadersInNotificationsEnabledOutput) { - op := &request.Operation{ - Name: opSetIdentityHeadersInNotificationsEnabled, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetIdentityHeadersInNotificationsEnabledInput{} - } - - output = &SetIdentityHeadersInNotificationsEnabledOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetIdentityHeadersInNotificationsEnabled API operation for Amazon Simple Email Service. -// -// Given an identity (an email address or a domain), sets whether Amazon SES -// includes the original email headers in the Amazon Simple Notification Service -// (Amazon SNS) notifications of a specified type. -// -// This action is throttled at one request per second. -// -// For more information about using notifications with Amazon SES, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.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 Email Service's -// API operation SetIdentityHeadersInNotificationsEnabled for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityHeadersInNotificationsEnabled -func (c *SES) SetIdentityHeadersInNotificationsEnabled(input *SetIdentityHeadersInNotificationsEnabledInput) (*SetIdentityHeadersInNotificationsEnabledOutput, error) { - req, out := c.SetIdentityHeadersInNotificationsEnabledRequest(input) - err := req.Send() - return out, err -} - -const opSetIdentityMailFromDomain = "SetIdentityMailFromDomain" - -// SetIdentityMailFromDomainRequest generates a "aws/request.Request" representing the -// client's request for the SetIdentityMailFromDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetIdentityMailFromDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetIdentityMailFromDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetIdentityMailFromDomainRequest method. -// req, resp := client.SetIdentityMailFromDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityMailFromDomain -func (c *SES) SetIdentityMailFromDomainRequest(input *SetIdentityMailFromDomainInput) (req *request.Request, output *SetIdentityMailFromDomainOutput) { - op := &request.Operation{ - Name: opSetIdentityMailFromDomain, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetIdentityMailFromDomainInput{} - } - - output = &SetIdentityMailFromDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetIdentityMailFromDomain API operation for Amazon Simple Email Service. -// -// Enables or disables the custom MAIL FROM domain setup for a verified identity -// (an email address or a domain). -// -// To send emails using the specified MAIL FROM domain, you must add an MX record -// to your MAIL FROM domain's DNS settings. If you want your emails to pass -// Sender Policy Framework (SPF) checks, you must also add or update an SPF -// record. For more information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from-set.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation SetIdentityMailFromDomain for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityMailFromDomain -func (c *SES) SetIdentityMailFromDomain(input *SetIdentityMailFromDomainInput) (*SetIdentityMailFromDomainOutput, error) { - req, out := c.SetIdentityMailFromDomainRequest(input) - err := req.Send() - return out, err -} - -const opSetIdentityNotificationTopic = "SetIdentityNotificationTopic" - -// SetIdentityNotificationTopicRequest generates a "aws/request.Request" representing the -// client's request for the SetIdentityNotificationTopic operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetIdentityNotificationTopic for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetIdentityNotificationTopic method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetIdentityNotificationTopicRequest method. -// req, resp := client.SetIdentityNotificationTopicRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityNotificationTopic -func (c *SES) SetIdentityNotificationTopicRequest(input *SetIdentityNotificationTopicInput) (req *request.Request, output *SetIdentityNotificationTopicOutput) { - op := &request.Operation{ - Name: opSetIdentityNotificationTopic, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetIdentityNotificationTopicInput{} - } - - output = &SetIdentityNotificationTopicOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetIdentityNotificationTopic API operation for Amazon Simple Email Service. -// -// Given an identity (an email address or a domain), sets the Amazon Simple -// Notification Service (Amazon SNS) topic to which Amazon SES will publish -// bounce, complaint, and/or delivery notifications for emails sent with that -// identity as the Source. -// -// Unless feedback forwarding is enabled, you must specify Amazon SNS topics -// for bounce and complaint notifications. For more information, see SetIdentityFeedbackForwardingEnabled. -// -// This action is throttled at one request per second. -// -// For more information about feedback notification, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.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 Email Service's -// API operation SetIdentityNotificationTopic for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityNotificationTopic -func (c *SES) SetIdentityNotificationTopic(input *SetIdentityNotificationTopicInput) (*SetIdentityNotificationTopicOutput, error) { - req, out := c.SetIdentityNotificationTopicRequest(input) - err := req.Send() - return out, err -} - -const opSetReceiptRulePosition = "SetReceiptRulePosition" - -// SetReceiptRulePositionRequest generates a "aws/request.Request" representing the -// client's request for the SetReceiptRulePosition operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetReceiptRulePosition for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetReceiptRulePosition method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetReceiptRulePositionRequest method. -// req, resp := client.SetReceiptRulePositionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetReceiptRulePosition -func (c *SES) SetReceiptRulePositionRequest(input *SetReceiptRulePositionInput) (req *request.Request, output *SetReceiptRulePositionOutput) { - op := &request.Operation{ - Name: opSetReceiptRulePosition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetReceiptRulePositionInput{} - } - - output = &SetReceiptRulePositionOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetReceiptRulePosition API operation for Amazon Simple Email Service. -// -// Sets the position of the specified receipt rule in the receipt rule set. -// -// For information about managing receipt rules, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-receipt-rules.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation SetReceiptRulePosition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// * ErrCodeRuleDoesNotExistException "RuleDoesNotExist" -// Indicates that the provided receipt rule does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetReceiptRulePosition -func (c *SES) SetReceiptRulePosition(input *SetReceiptRulePositionInput) (*SetReceiptRulePositionOutput, error) { - req, out := c.SetReceiptRulePositionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateConfigurationSetEventDestination = "UpdateConfigurationSetEventDestination" - -// UpdateConfigurationSetEventDestinationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateConfigurationSetEventDestination operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateConfigurationSetEventDestination for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateConfigurationSetEventDestination method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateConfigurationSetEventDestinationRequest method. -// req, resp := client.UpdateConfigurationSetEventDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateConfigurationSetEventDestination -func (c *SES) UpdateConfigurationSetEventDestinationRequest(input *UpdateConfigurationSetEventDestinationInput) (req *request.Request, output *UpdateConfigurationSetEventDestinationOutput) { - op := &request.Operation{ - Name: opUpdateConfigurationSetEventDestination, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateConfigurationSetEventDestinationInput{} - } - - output = &UpdateConfigurationSetEventDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateConfigurationSetEventDestination API operation for Amazon Simple Email Service. -// -// Updates the event destination of a configuration set. -// -// When you create or update an event destination, you must provide one, and -// only one, destination. The destination can be either Amazon CloudWatch or -// Amazon Kinesis Firehose. -// -// Event destinations are associated with configuration sets, which enable you -// to publish email sending events to Amazon CloudWatch or Amazon Kinesis Firehose. -// For information about using configuration sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation UpdateConfigurationSetEventDestination for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConfigurationSetDoesNotExistException "ConfigurationSetDoesNotExist" -// Indicates that the configuration set does not exist. -// -// * ErrCodeEventDestinationDoesNotExistException "EventDestinationDoesNotExist" -// Indicates that the event destination does not exist. -// -// * ErrCodeInvalidCloudWatchDestinationException "InvalidCloudWatchDestination" -// Indicates that the Amazon CloudWatch destination is invalid. See the error -// message for details. -// -// * ErrCodeInvalidFirehoseDestinationException "InvalidFirehoseDestination" -// Indicates that the Amazon Kinesis Firehose destination is invalid. See the -// error message for details. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateConfigurationSetEventDestination -func (c *SES) UpdateConfigurationSetEventDestination(input *UpdateConfigurationSetEventDestinationInput) (*UpdateConfigurationSetEventDestinationOutput, error) { - req, out := c.UpdateConfigurationSetEventDestinationRequest(input) - err := req.Send() - return out, err -} - -const opUpdateReceiptRule = "UpdateReceiptRule" - -// UpdateReceiptRuleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateReceiptRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateReceiptRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateReceiptRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateReceiptRuleRequest method. -// req, resp := client.UpdateReceiptRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateReceiptRule -func (c *SES) UpdateReceiptRuleRequest(input *UpdateReceiptRuleInput) (req *request.Request, output *UpdateReceiptRuleOutput) { - op := &request.Operation{ - Name: opUpdateReceiptRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateReceiptRuleInput{} - } - - output = &UpdateReceiptRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateReceiptRule API operation for Amazon Simple Email Service. -// -// Updates a receipt rule. -// -// For information about managing receipt rules, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-managing-receipt-rules.html). -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation UpdateReceiptRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidSnsTopicException "InvalidSnsTopic" -// Indicates that the provided Amazon SNS topic is invalid, or that Amazon SES -// could not publish to the topic, possibly due to permissions issues. For information -// about giving permissions, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// * ErrCodeInvalidS3ConfigurationException "InvalidS3Configuration" -// Indicates that the provided Amazon S3 bucket or AWS KMS encryption key is -// invalid, or that Amazon SES could not publish to the bucket, possibly due -// to permissions issues. For information about giving permissions, see the -// Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// * ErrCodeInvalidLambdaFunctionException "InvalidLambdaFunction" -// Indicates that the provided AWS Lambda function is invalid, or that Amazon -// SES could not execute the provided function, possibly due to permissions -// issues. For information about giving permissions, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// * ErrCodeRuleSetDoesNotExistException "RuleSetDoesNotExist" -// Indicates that the provided receipt rule set does not exist. -// -// * ErrCodeRuleDoesNotExistException "RuleDoesNotExist" -// Indicates that the provided receipt rule does not exist. -// -// * ErrCodeLimitExceededException "LimitExceeded" -// Indicates that a resource could not be created because of service limits. -// For a list of Amazon SES limits, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateReceiptRule -func (c *SES) UpdateReceiptRule(input *UpdateReceiptRuleInput) (*UpdateReceiptRuleOutput, error) { - req, out := c.UpdateReceiptRuleRequest(input) - err := req.Send() - return out, err -} - -const opVerifyDomainDkim = "VerifyDomainDkim" - -// VerifyDomainDkimRequest generates a "aws/request.Request" representing the -// client's request for the VerifyDomainDkim operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See VerifyDomainDkim for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the VerifyDomainDkim method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the VerifyDomainDkimRequest method. -// req, resp := client.VerifyDomainDkimRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainDkim -func (c *SES) VerifyDomainDkimRequest(input *VerifyDomainDkimInput) (req *request.Request, output *VerifyDomainDkimOutput) { - op := &request.Operation{ - Name: opVerifyDomainDkim, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &VerifyDomainDkimInput{} - } - - output = &VerifyDomainDkimOutput{} - req = c.newRequest(op, input, output) - return -} - -// VerifyDomainDkim API operation for Amazon Simple Email Service. -// -// Returns a set of DKIM tokens for a domain. DKIM tokens are character strings -// that represent your domain's identity. Using these tokens, you will need -// to create DNS CNAME records that point to DKIM public keys hosted by Amazon -// SES. Amazon Web Services will eventually detect that you have updated your -// DNS records; this detection process may take up to 72 hours. Upon successful -// detection, Amazon SES will be able to DKIM-sign email originating from that -// domain. -// -// This action is throttled at one request per second. -// -// To enable or disable Easy DKIM signing for a domain, use the SetIdentityDkimEnabled -// action. -// -// For more information about creating DNS records using DKIM tokens, go to -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim-dns-records.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 Email Service's -// API operation VerifyDomainDkim for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainDkim -func (c *SES) VerifyDomainDkim(input *VerifyDomainDkimInput) (*VerifyDomainDkimOutput, error) { - req, out := c.VerifyDomainDkimRequest(input) - err := req.Send() - return out, err -} - -const opVerifyDomainIdentity = "VerifyDomainIdentity" - -// VerifyDomainIdentityRequest generates a "aws/request.Request" representing the -// client's request for the VerifyDomainIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See VerifyDomainIdentity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the VerifyDomainIdentity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the VerifyDomainIdentityRequest method. -// req, resp := client.VerifyDomainIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainIdentity -func (c *SES) VerifyDomainIdentityRequest(input *VerifyDomainIdentityInput) (req *request.Request, output *VerifyDomainIdentityOutput) { - op := &request.Operation{ - Name: opVerifyDomainIdentity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &VerifyDomainIdentityInput{} - } - - output = &VerifyDomainIdentityOutput{} - req = c.newRequest(op, input, output) - return -} - -// VerifyDomainIdentity API operation for Amazon Simple Email Service. -// -// Verifies a domain. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation VerifyDomainIdentity for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainIdentity -func (c *SES) VerifyDomainIdentity(input *VerifyDomainIdentityInput) (*VerifyDomainIdentityOutput, error) { - req, out := c.VerifyDomainIdentityRequest(input) - err := req.Send() - return out, err -} - -const opVerifyEmailAddress = "VerifyEmailAddress" - -// VerifyEmailAddressRequest generates a "aws/request.Request" representing the -// client's request for the VerifyEmailAddress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See VerifyEmailAddress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the VerifyEmailAddress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the VerifyEmailAddressRequest method. -// req, resp := client.VerifyEmailAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailAddress -func (c *SES) VerifyEmailAddressRequest(input *VerifyEmailAddressInput) (req *request.Request, output *VerifyEmailAddressOutput) { - op := &request.Operation{ - Name: opVerifyEmailAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &VerifyEmailAddressInput{} - } - - output = &VerifyEmailAddressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// VerifyEmailAddress API operation for Amazon Simple Email Service. -// -// Verifies an email address. This action causes a confirmation email message -// to be sent to the specified address. -// -// The VerifyEmailAddress action is deprecated as of the May 15, 2012 release -// of Domain Verification. The VerifyEmailIdentity action is now preferred. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation VerifyEmailAddress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailAddress -func (c *SES) VerifyEmailAddress(input *VerifyEmailAddressInput) (*VerifyEmailAddressOutput, error) { - req, out := c.VerifyEmailAddressRequest(input) - err := req.Send() - return out, err -} - -const opVerifyEmailIdentity = "VerifyEmailIdentity" - -// VerifyEmailIdentityRequest generates a "aws/request.Request" representing the -// client's request for the VerifyEmailIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See VerifyEmailIdentity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the VerifyEmailIdentity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the VerifyEmailIdentityRequest method. -// req, resp := client.VerifyEmailIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailIdentity -func (c *SES) VerifyEmailIdentityRequest(input *VerifyEmailIdentityInput) (req *request.Request, output *VerifyEmailIdentityOutput) { - op := &request.Operation{ - Name: opVerifyEmailIdentity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &VerifyEmailIdentityInput{} - } - - output = &VerifyEmailIdentityOutput{} - req = c.newRequest(op, input, output) - return -} - -// VerifyEmailIdentity API operation for Amazon Simple Email Service. -// -// Verifies an email address. This action causes a confirmation email message -// to be sent to the specified address. -// -// This action is throttled at one request per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Email Service's -// API operation VerifyEmailIdentity for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailIdentity -func (c *SES) VerifyEmailIdentity(input *VerifyEmailIdentityInput) (*VerifyEmailIdentityOutput, error) { - req, out := c.VerifyEmailIdentityRequest(input) - err := req.Send() - return out, err -} - -// When included in a receipt rule, this action adds a header to the received -// email. -// -// For information about adding a header using a receipt rule, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-add-header.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/AddHeaderAction -type AddHeaderAction struct { - _ struct{} `type:"structure"` - - // The name of the header to add. Must be between 1 and 50 characters, inclusive, - // and consist of alphanumeric (a-z, A-Z, 0-9) characters and dashes only. - // - // HeaderName is a required field - HeaderName *string `type:"string" required:"true"` - - // Must be less than 2048 characters, and must not contain newline characters - // ("\r" or "\n"). - // - // HeaderValue is a required field - HeaderValue *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AddHeaderAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddHeaderAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddHeaderAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddHeaderAction"} - 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 *AddHeaderAction) SetHeaderName(v string) *AddHeaderAction { - s.HeaderName = &v - return s -} - -// SetHeaderValue sets the HeaderValue field's value. -func (s *AddHeaderAction) SetHeaderValue(v string) *AddHeaderAction { - s.HeaderValue = &v - return s -} - -// Represents the body of the message. You can specify text, HTML, or both. -// If you use both, then the message should display correctly in the widest -// variety of email clients. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/Body -type Body struct { - _ struct{} `type:"structure"` - - // The content of the message, in HTML format. Use this for email clients that - // can process HTML. You can include clickable links, formatted text, and much - // more in an HTML message. - Html *Content `type:"structure"` - - // The content of the message, in text format. Use this for text-based email - // clients, or clients on high-latency networks (such as mobile devices). - Text *Content `type:"structure"` -} - -// String returns the string representation -func (s Body) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Body) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Body) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Body"} - if s.Html != nil { - if err := s.Html.Validate(); err != nil { - invalidParams.AddNested("Html", err.(request.ErrInvalidParams)) - } - } - if s.Text != nil { - if err := s.Text.Validate(); err != nil { - invalidParams.AddNested("Text", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHtml sets the Html field's value. -func (s *Body) SetHtml(v *Content) *Body { - s.Html = v - return s -} - -// SetText sets the Text field's value. -func (s *Body) SetText(v *Content) *Body { - s.Text = v - return s -} - -// When included in a receipt rule, this action rejects the received email by -// returning a bounce response to the sender and, optionally, publishes a notification -// to Amazon Simple Notification Service (Amazon SNS). -// -// For information about sending a bounce message in response to a received -// email, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-bounce.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/BounceAction -type BounceAction struct { - _ struct{} `type:"structure"` - - // Human-readable text to include in the bounce message. - // - // Message is a required field - Message *string `type:"string" required:"true"` - - // The email address of the sender of the bounced email. This is the address - // from which the bounce message will be sent. - // - // Sender is a required field - Sender *string `type:"string" required:"true"` - - // The SMTP reply code, as defined by RFC 5321 (https://tools.ietf.org/html/rfc5321). - // - // SmtpReplyCode is a required field - SmtpReplyCode *string `type:"string" required:"true"` - - // The SMTP enhanced status code, as defined by RFC 3463 (https://tools.ietf.org/html/rfc3463). - StatusCode *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the - // bounce action is taken. An example of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic. - // For more information about Amazon SNS topics, see the Amazon SNS Developer - // Guide (http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html). - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s BounceAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BounceAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BounceAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BounceAction"} - if s.Message == nil { - invalidParams.Add(request.NewErrParamRequired("Message")) - } - if s.Sender == nil { - invalidParams.Add(request.NewErrParamRequired("Sender")) - } - if s.SmtpReplyCode == nil { - invalidParams.Add(request.NewErrParamRequired("SmtpReplyCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMessage sets the Message field's value. -func (s *BounceAction) SetMessage(v string) *BounceAction { - s.Message = &v - return s -} - -// SetSender sets the Sender field's value. -func (s *BounceAction) SetSender(v string) *BounceAction { - s.Sender = &v - return s -} - -// SetSmtpReplyCode sets the SmtpReplyCode field's value. -func (s *BounceAction) SetSmtpReplyCode(v string) *BounceAction { - s.SmtpReplyCode = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *BounceAction) SetStatusCode(v string) *BounceAction { - s.StatusCode = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *BounceAction) SetTopicArn(v string) *BounceAction { - s.TopicArn = &v - return s -} - -// Recipient-related information to include in the Delivery Status Notification -// (DSN) when an email that Amazon SES receives on your behalf bounces. -// -// For information about receiving email through Amazon SES, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/BouncedRecipientInfo -type BouncedRecipientInfo struct { - _ struct{} `type:"structure"` - - // The reason for the bounce. You must provide either this parameter or RecipientDsnFields. - BounceType *string `type:"string" enum:"BounceType"` - - // The email address of the recipient of the bounced email. - // - // Recipient is a required field - Recipient *string `type:"string" required:"true"` - - // This parameter is used only for sending authorization. It is the ARN of the - // identity that is associated with the sending authorization policy that permits - // you to receive email for the recipient of the bounced email. For more information - // about sending authorization, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). - RecipientArn *string `type:"string"` - - // Recipient-related DSN fields, most of which would normally be filled in automatically - // when provided with a BounceType. You must provide either this parameter or - // BounceType. - RecipientDsnFields *RecipientDsnFields `type:"structure"` -} - -// String returns the string representation -func (s BouncedRecipientInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BouncedRecipientInfo) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BouncedRecipientInfo) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BouncedRecipientInfo"} - if s.Recipient == nil { - invalidParams.Add(request.NewErrParamRequired("Recipient")) - } - if s.RecipientDsnFields != nil { - if err := s.RecipientDsnFields.Validate(); err != nil { - invalidParams.AddNested("RecipientDsnFields", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBounceType sets the BounceType field's value. -func (s *BouncedRecipientInfo) SetBounceType(v string) *BouncedRecipientInfo { - s.BounceType = &v - return s -} - -// SetRecipient sets the Recipient field's value. -func (s *BouncedRecipientInfo) SetRecipient(v string) *BouncedRecipientInfo { - s.Recipient = &v - return s -} - -// SetRecipientArn sets the RecipientArn field's value. -func (s *BouncedRecipientInfo) SetRecipientArn(v string) *BouncedRecipientInfo { - s.RecipientArn = &v - return s -} - -// SetRecipientDsnFields sets the RecipientDsnFields field's value. -func (s *BouncedRecipientInfo) SetRecipientDsnFields(v *RecipientDsnFields) *BouncedRecipientInfo { - s.RecipientDsnFields = v - return s -} - -// Represents a request to create a receipt rule set by cloning an existing -// one. You use receipt rule sets to receive email with Amazon SES. For more -// information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CloneReceiptRuleSetRequest -type CloneReceiptRuleSetInput struct { - _ struct{} `type:"structure"` - - // The name of the rule set to clone. - // - // OriginalRuleSetName is a required field - OriginalRuleSetName *string `type:"string" required:"true"` - - // The name of the rule set to create. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-). - // - // * Start and end with a letter or number. - // - // * Contain less than 64 characters. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CloneReceiptRuleSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloneReceiptRuleSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloneReceiptRuleSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloneReceiptRuleSetInput"} - if s.OriginalRuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("OriginalRuleSetName")) - } - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOriginalRuleSetName sets the OriginalRuleSetName field's value. -func (s *CloneReceiptRuleSetInput) SetOriginalRuleSetName(v string) *CloneReceiptRuleSetInput { - s.OriginalRuleSetName = &v - return s -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *CloneReceiptRuleSetInput) SetRuleSetName(v string) *CloneReceiptRuleSetInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CloneReceiptRuleSetResponse -type CloneReceiptRuleSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CloneReceiptRuleSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloneReceiptRuleSetOutput) GoString() string { - return s.String() -} - -// Contains information associated with an Amazon CloudWatch event destination -// to which email sending events are published. -// -// Event destinations, such as Amazon CloudWatch, are associated with configuration -// sets, which enable you to publish email sending events. For information about -// using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CloudWatchDestination -type CloudWatchDestination struct { - _ struct{} `type:"structure"` - - // A list of dimensions upon which to categorize your emails when you publish - // email sending events to Amazon CloudWatch. - // - // DimensionConfigurations is a required field - DimensionConfigurations []*CloudWatchDimensionConfiguration `type:"list" required:"true"` -} - -// String returns the string representation -func (s CloudWatchDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloudWatchDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloudWatchDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudWatchDestination"} - if s.DimensionConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("DimensionConfigurations")) - } - if s.DimensionConfigurations != nil { - for i, v := range s.DimensionConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DimensionConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDimensionConfigurations sets the DimensionConfigurations field's value. -func (s *CloudWatchDestination) SetDimensionConfigurations(v []*CloudWatchDimensionConfiguration) *CloudWatchDestination { - s.DimensionConfigurations = v - return s -} - -// Contains the dimension configuration to use when you publish email sending -// events to Amazon CloudWatch. -// -// For information about publishing email sending events to Amazon CloudWatch, -// see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CloudWatchDimensionConfiguration -type CloudWatchDimensionConfiguration struct { - _ struct{} `type:"structure"` - - // The default value of the dimension that is published to Amazon CloudWatch - // if you do not provide the value of the dimension when you send an email. - // The default value must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), - // or dashes (-). - // - // * Contain less than 256 characters. - // - // DefaultDimensionValue is a required field - DefaultDimensionValue *string `type:"string" required:"true"` - - // The name of an Amazon CloudWatch dimension associated with an email sending - // metric. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), - // or dashes (-). - // - // * Contain less than 256 characters. - // - // DimensionName is a required field - DimensionName *string `type:"string" required:"true"` - - // The place where Amazon SES finds the value of a dimension to publish to Amazon - // CloudWatch. If you want Amazon SES to use the message tags that you specify - // using an X-SES-MESSAGE-TAGS header or a parameter to the SendEmail/SendRawEmail - // API, choose messageTag. If you want Amazon SES to use your own email headers, - // choose emailHeader. - // - // DimensionValueSource is a required field - DimensionValueSource *string `type:"string" required:"true" enum:"DimensionValueSource"` -} - -// String returns the string representation -func (s CloudWatchDimensionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloudWatchDimensionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloudWatchDimensionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudWatchDimensionConfiguration"} - if s.DefaultDimensionValue == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultDimensionValue")) - } - if s.DimensionName == nil { - invalidParams.Add(request.NewErrParamRequired("DimensionName")) - } - if s.DimensionValueSource == nil { - invalidParams.Add(request.NewErrParamRequired("DimensionValueSource")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultDimensionValue sets the DefaultDimensionValue field's value. -func (s *CloudWatchDimensionConfiguration) SetDefaultDimensionValue(v string) *CloudWatchDimensionConfiguration { - s.DefaultDimensionValue = &v - return s -} - -// SetDimensionName sets the DimensionName field's value. -func (s *CloudWatchDimensionConfiguration) SetDimensionName(v string) *CloudWatchDimensionConfiguration { - s.DimensionName = &v - return s -} - -// SetDimensionValueSource sets the DimensionValueSource field's value. -func (s *CloudWatchDimensionConfiguration) SetDimensionValueSource(v string) *CloudWatchDimensionConfiguration { - s.DimensionValueSource = &v - return s -} - -// The name of the configuration set. -// -// Configuration sets enable you to publish email sending events. For information -// about using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ConfigurationSet -type ConfigurationSet struct { - _ struct{} `type:"structure"` - - // The name of the configuration set. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), - // or dashes (-). - // - // * Contain less than 64 characters. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ConfigurationSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfigurationSet) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfigurationSet) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfigurationSet"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *ConfigurationSet) SetName(v string) *ConfigurationSet { - s.Name = &v - return s -} - -// Represents textual data, plus an optional character set specification. -// -// By default, the text must be 7-bit ASCII, due to the constraints of the SMTP -// protocol. If the text must contain any other characters, then you must also -// specify a character set. Examples include UTF-8, ISO-8859-1, and Shift_JIS. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/Content -type Content struct { - _ struct{} `type:"structure"` - - // The character set of the content. - Charset *string `type:"string"` - - // The textual data of the content. - // - // Data is a required field - Data *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Content) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Content) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Content) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Content"} - if s.Data == nil { - invalidParams.Add(request.NewErrParamRequired("Data")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCharset sets the Charset field's value. -func (s *Content) SetCharset(v string) *Content { - s.Charset = &v - return s -} - -// SetData sets the Data field's value. -func (s *Content) SetData(v string) *Content { - s.Data = &v - return s -} - -// Represents a request to create a configuration set event destination. A configuration -// set event destination, which can be either Amazon CloudWatch or Amazon Kinesis -// Firehose, describes an AWS service in which Amazon SES publishes the email -// sending events associated with a configuration set. For information about -// using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSetEventDestinationRequest -type CreateConfigurationSetEventDestinationInput struct { - _ struct{} `type:"structure"` - - // The name of the configuration set to which to apply the event destination. - // - // ConfigurationSetName is a required field - ConfigurationSetName *string `type:"string" required:"true"` - - // An object that describes the AWS service to which Amazon SES will publish - // the email sending events associated with the specified configuration set. - // - // EventDestination is a required field - EventDestination *EventDestination `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateConfigurationSetEventDestinationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateConfigurationSetEventDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateConfigurationSetEventDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateConfigurationSetEventDestinationInput"} - if s.ConfigurationSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationSetName")) - } - if s.EventDestination == nil { - invalidParams.Add(request.NewErrParamRequired("EventDestination")) - } - if s.EventDestination != nil { - if err := s.EventDestination.Validate(); err != nil { - invalidParams.AddNested("EventDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationSetName sets the ConfigurationSetName field's value. -func (s *CreateConfigurationSetEventDestinationInput) SetConfigurationSetName(v string) *CreateConfigurationSetEventDestinationInput { - s.ConfigurationSetName = &v - return s -} - -// SetEventDestination sets the EventDestination field's value. -func (s *CreateConfigurationSetEventDestinationInput) SetEventDestination(v *EventDestination) *CreateConfigurationSetEventDestinationInput { - s.EventDestination = v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSetEventDestinationResponse -type CreateConfigurationSetEventDestinationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateConfigurationSetEventDestinationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateConfigurationSetEventDestinationOutput) GoString() string { - return s.String() -} - -// Represents a request to create a configuration set. Configuration sets enable -// you to publish email sending events. For information about using configuration -// sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSetRequest -type CreateConfigurationSetInput struct { - _ struct{} `type:"structure"` - - // A data structure that contains the name of the configuration set. - // - // ConfigurationSet is a required field - ConfigurationSet *ConfigurationSet `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateConfigurationSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateConfigurationSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateConfigurationSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateConfigurationSetInput"} - if s.ConfigurationSet == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationSet")) - } - if s.ConfigurationSet != nil { - if err := s.ConfigurationSet.Validate(); err != nil { - invalidParams.AddNested("ConfigurationSet", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationSet sets the ConfigurationSet field's value. -func (s *CreateConfigurationSetInput) SetConfigurationSet(v *ConfigurationSet) *CreateConfigurationSetInput { - s.ConfigurationSet = v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateConfigurationSetResponse -type CreateConfigurationSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateConfigurationSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateConfigurationSetOutput) GoString() string { - return s.String() -} - -// Represents a request to create a new IP address filter. You use IP address -// filters when you receive email with Amazon SES. For more information, see -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptFilterRequest -type CreateReceiptFilterInput struct { - _ struct{} `type:"structure"` - - // A data structure that describes the IP address filter to create, which consists - // of a name, an IP address range, and whether to allow or block mail from it. - // - // Filter is a required field - Filter *ReceiptFilter `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateReceiptFilterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReceiptFilterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReceiptFilterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReceiptFilterInput"} - if s.Filter == nil { - invalidParams.Add(request.NewErrParamRequired("Filter")) - } - 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 *CreateReceiptFilterInput) SetFilter(v *ReceiptFilter) *CreateReceiptFilterInput { - s.Filter = v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptFilterResponse -type CreateReceiptFilterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateReceiptFilterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReceiptFilterOutput) GoString() string { - return s.String() -} - -// Represents a request to create a receipt rule. You use receipt rules to receive -// email with Amazon SES. For more information, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRuleRequest -type CreateReceiptRuleInput struct { - _ struct{} `type:"structure"` - - // The name of an existing rule after which the new rule will be placed. If - // this parameter is null, the new rule will be inserted at the beginning of - // the rule list. - After *string `type:"string"` - - // A data structure that contains the specified rule's name, actions, recipients, - // domains, enabled status, scan status, and TLS policy. - // - // Rule is a required field - Rule *ReceiptRule `type:"structure" required:"true"` - - // The name of the rule set to which to add the rule. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateReceiptRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReceiptRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReceiptRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReceiptRuleInput"} - if s.Rule == nil { - invalidParams.Add(request.NewErrParamRequired("Rule")) - } - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - if s.Rule != nil { - if err := s.Rule.Validate(); err != nil { - invalidParams.AddNested("Rule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAfter sets the After field's value. -func (s *CreateReceiptRuleInput) SetAfter(v string) *CreateReceiptRuleInput { - s.After = &v - return s -} - -// SetRule sets the Rule field's value. -func (s *CreateReceiptRuleInput) SetRule(v *ReceiptRule) *CreateReceiptRuleInput { - s.Rule = v - return s -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *CreateReceiptRuleInput) SetRuleSetName(v string) *CreateReceiptRuleInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRuleResponse -type CreateReceiptRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateReceiptRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReceiptRuleOutput) GoString() string { - return s.String() -} - -// Represents a request to create an empty receipt rule set. You use receipt -// rule sets to receive email with Amazon SES. For more information, see the -// Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRuleSetRequest -type CreateReceiptRuleSetInput struct { - _ struct{} `type:"structure"` - - // The name of the rule set to create. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-). - // - // * Start and end with a letter or number. - // - // * Contain less than 64 characters. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateReceiptRuleSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReceiptRuleSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReceiptRuleSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReceiptRuleSetInput"} - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *CreateReceiptRuleSetInput) SetRuleSetName(v string) *CreateReceiptRuleSetInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/CreateReceiptRuleSetResponse -type CreateReceiptRuleSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateReceiptRuleSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReceiptRuleSetOutput) GoString() string { - return s.String() -} - -// Represents a request to delete a configuration set event destination. Configuration -// set event destinations are associated with configuration sets, which enable -// you to publish email sending events. For information about using configuration -// sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSetEventDestinationRequest -type DeleteConfigurationSetEventDestinationInput struct { - _ struct{} `type:"structure"` - - // The name of the configuration set from which to delete the event destination. - // - // ConfigurationSetName is a required field - ConfigurationSetName *string `type:"string" required:"true"` - - // The name of the event destination to delete. - // - // EventDestinationName is a required field - EventDestinationName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteConfigurationSetEventDestinationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigurationSetEventDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfigurationSetEventDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfigurationSetEventDestinationInput"} - if s.ConfigurationSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationSetName")) - } - if s.EventDestinationName == nil { - invalidParams.Add(request.NewErrParamRequired("EventDestinationName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationSetName sets the ConfigurationSetName field's value. -func (s *DeleteConfigurationSetEventDestinationInput) SetConfigurationSetName(v string) *DeleteConfigurationSetEventDestinationInput { - s.ConfigurationSetName = &v - return s -} - -// SetEventDestinationName sets the EventDestinationName field's value. -func (s *DeleteConfigurationSetEventDestinationInput) SetEventDestinationName(v string) *DeleteConfigurationSetEventDestinationInput { - s.EventDestinationName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSetEventDestinationResponse -type DeleteConfigurationSetEventDestinationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteConfigurationSetEventDestinationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigurationSetEventDestinationOutput) GoString() string { - return s.String() -} - -// Represents a request to delete a configuration set. Configuration sets enable -// you to publish email sending events. For information about using configuration -// sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSetRequest -type DeleteConfigurationSetInput struct { - _ struct{} `type:"structure"` - - // The name of the configuration set to delete. - // - // ConfigurationSetName is a required field - ConfigurationSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteConfigurationSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigurationSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfigurationSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfigurationSetInput"} - if s.ConfigurationSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationSetName sets the ConfigurationSetName field's value. -func (s *DeleteConfigurationSetInput) SetConfigurationSetName(v string) *DeleteConfigurationSetInput { - s.ConfigurationSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteConfigurationSetResponse -type DeleteConfigurationSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteConfigurationSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteConfigurationSetOutput) GoString() string { - return s.String() -} - -// Represents a request to delete one of your Amazon SES identities (an email -// address or domain). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentityRequest -type DeleteIdentityInput struct { - _ struct{} `type:"structure"` - - // The identity to be removed from the list of identities for the AWS Account. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIdentityInput"} - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentity sets the Identity field's value. -func (s *DeleteIdentityInput) SetIdentity(v string) *DeleteIdentityInput { - s.Identity = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentityResponse -type DeleteIdentityOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIdentityOutput) GoString() string { - return s.String() -} - -// Represents a request to delete a sending authorization policy for an identity. -// Sending authorization is an Amazon SES feature that enables you to authorize -// other senders to use your identities. For information, see the Amazon SES -// Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentityPolicyRequest -type DeleteIdentityPolicyInput struct { - _ struct{} `type:"structure"` - - // The identity that is associated with the policy that you want to delete. - // You can specify the identity by using its name or by using its Amazon Resource - // Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com. - // - // To successfully call this API, you must own the identity. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` - - // The name of the policy to be deleted. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteIdentityPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIdentityPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIdentityPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIdentityPolicyInput"} - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentity sets the Identity field's value. -func (s *DeleteIdentityPolicyInput) SetIdentity(v string) *DeleteIdentityPolicyInput { - s.Identity = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *DeleteIdentityPolicyInput) SetPolicyName(v string) *DeleteIdentityPolicyInput { - s.PolicyName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteIdentityPolicyResponse -type DeleteIdentityPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteIdentityPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIdentityPolicyOutput) GoString() string { - return s.String() -} - -// Represents a request to delete an IP address filter. You use IP address filters -// when you receive email with Amazon SES. For more information, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptFilterRequest -type DeleteReceiptFilterInput struct { - _ struct{} `type:"structure"` - - // The name of the IP address filter to delete. - // - // FilterName is a required field - FilterName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteReceiptFilterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReceiptFilterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReceiptFilterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReceiptFilterInput"} - if s.FilterName == nil { - invalidParams.Add(request.NewErrParamRequired("FilterName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterName sets the FilterName field's value. -func (s *DeleteReceiptFilterInput) SetFilterName(v string) *DeleteReceiptFilterInput { - s.FilterName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptFilterResponse -type DeleteReceiptFilterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteReceiptFilterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReceiptFilterOutput) GoString() string { - return s.String() -} - -// Represents a request to delete a receipt rule. You use receipt rules to receive -// email with Amazon SES. For more information, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRuleRequest -type DeleteReceiptRuleInput struct { - _ struct{} `type:"structure"` - - // The name of the receipt rule to delete. - // - // RuleName is a required field - RuleName *string `type:"string" required:"true"` - - // The name of the receipt rule set that contains the receipt rule to delete. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteReceiptRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReceiptRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReceiptRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReceiptRuleInput"} - if s.RuleName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleName")) - } - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRuleName sets the RuleName field's value. -func (s *DeleteReceiptRuleInput) SetRuleName(v string) *DeleteReceiptRuleInput { - s.RuleName = &v - return s -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *DeleteReceiptRuleInput) SetRuleSetName(v string) *DeleteReceiptRuleInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRuleResponse -type DeleteReceiptRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteReceiptRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReceiptRuleOutput) GoString() string { - return s.String() -} - -// Represents a request to delete a receipt rule set and all of the receipt -// rules it contains. You use receipt rule sets to receive email with Amazon -// SES. For more information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRuleSetRequest -type DeleteReceiptRuleSetInput struct { - _ struct{} `type:"structure"` - - // The name of the receipt rule set to delete. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteReceiptRuleSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReceiptRuleSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReceiptRuleSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReceiptRuleSetInput"} - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *DeleteReceiptRuleSetInput) SetRuleSetName(v string) *DeleteReceiptRuleSetInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteReceiptRuleSetResponse -type DeleteReceiptRuleSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteReceiptRuleSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReceiptRuleSetOutput) GoString() string { - return s.String() -} - -// Represents a request to delete an email address from the list of email addresses -// you have attempted to verify under your AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteVerifiedEmailAddressRequest -type DeleteVerifiedEmailAddressInput struct { - _ struct{} `type:"structure"` - - // An email address to be removed from the list of verified addresses. - // - // EmailAddress is a required field - EmailAddress *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVerifiedEmailAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVerifiedEmailAddressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVerifiedEmailAddressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVerifiedEmailAddressInput"} - if s.EmailAddress == nil { - invalidParams.Add(request.NewErrParamRequired("EmailAddress")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEmailAddress sets the EmailAddress field's value. -func (s *DeleteVerifiedEmailAddressInput) SetEmailAddress(v string) *DeleteVerifiedEmailAddressInput { - s.EmailAddress = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DeleteVerifiedEmailAddressOutput -type DeleteVerifiedEmailAddressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVerifiedEmailAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVerifiedEmailAddressOutput) GoString() string { - return s.String() -} - -// Represents a request to return the metadata and receipt rules for the receipt -// rule set that is currently active. You use receipt rule sets to receive email -// with Amazon SES. For more information, see the Amazon SES Developer Guide -// (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeActiveReceiptRuleSetRequest -type DescribeActiveReceiptRuleSetInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeActiveReceiptRuleSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeActiveReceiptRuleSetInput) GoString() string { - return s.String() -} - -// Represents the metadata and receipt rules for the receipt rule set that is -// currently active. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeActiveReceiptRuleSetResponse -type DescribeActiveReceiptRuleSetOutput struct { - _ struct{} `type:"structure"` - - // The metadata for the currently active receipt rule set. The metadata consists - // of the rule set name and a timestamp of when the rule set was created. - Metadata *ReceiptRuleSetMetadata `type:"structure"` - - // The receipt rules that belong to the active rule set. - Rules []*ReceiptRule `type:"list"` -} - -// String returns the string representation -func (s DescribeActiveReceiptRuleSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeActiveReceiptRuleSetOutput) GoString() string { - return s.String() -} - -// SetMetadata sets the Metadata field's value. -func (s *DescribeActiveReceiptRuleSetOutput) SetMetadata(v *ReceiptRuleSetMetadata) *DescribeActiveReceiptRuleSetOutput { - s.Metadata = v - return s -} - -// SetRules sets the Rules field's value. -func (s *DescribeActiveReceiptRuleSetOutput) SetRules(v []*ReceiptRule) *DescribeActiveReceiptRuleSetOutput { - s.Rules = v - return s -} - -// Represents a request to return the details of a configuration set. Configuration -// sets enable you to publish email sending events. For information about using -// configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeConfigurationSetRequest -type DescribeConfigurationSetInput struct { - _ struct{} `type:"structure"` - - // A list of configuration set attributes to return. - ConfigurationSetAttributeNames []*string `type:"list"` - - // The name of the configuration set to describe. - // - // ConfigurationSetName is a required field - ConfigurationSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeConfigurationSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeConfigurationSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeConfigurationSetInput"} - if s.ConfigurationSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationSetAttributeNames sets the ConfigurationSetAttributeNames field's value. -func (s *DescribeConfigurationSetInput) SetConfigurationSetAttributeNames(v []*string) *DescribeConfigurationSetInput { - s.ConfigurationSetAttributeNames = v - return s -} - -// SetConfigurationSetName sets the ConfigurationSetName field's value. -func (s *DescribeConfigurationSetInput) SetConfigurationSetName(v string) *DescribeConfigurationSetInput { - s.ConfigurationSetName = &v - return s -} - -// Represents the details of a configuration set. Configuration sets enable -// you to publish email sending events. For information about using configuration -// sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeConfigurationSetResponse -type DescribeConfigurationSetOutput struct { - _ struct{} `type:"structure"` - - // The configuration set object associated with the specified configuration - // set. - ConfigurationSet *ConfigurationSet `type:"structure"` - - // A list of event destinations associated with the configuration set. - EventDestinations []*EventDestination `type:"list"` -} - -// String returns the string representation -func (s DescribeConfigurationSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConfigurationSetOutput) GoString() string { - return s.String() -} - -// SetConfigurationSet sets the ConfigurationSet field's value. -func (s *DescribeConfigurationSetOutput) SetConfigurationSet(v *ConfigurationSet) *DescribeConfigurationSetOutput { - s.ConfigurationSet = v - return s -} - -// SetEventDestinations sets the EventDestinations field's value. -func (s *DescribeConfigurationSetOutput) SetEventDestinations(v []*EventDestination) *DescribeConfigurationSetOutput { - s.EventDestinations = v - return s -} - -// Represents a request to return the details of a receipt rule. You use receipt -// rules to receive email with Amazon SES. For more information, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRuleRequest -type DescribeReceiptRuleInput struct { - _ struct{} `type:"structure"` - - // The name of the receipt rule. - // - // RuleName is a required field - RuleName *string `type:"string" required:"true"` - - // The name of the receipt rule set to which the receipt rule belongs. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeReceiptRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReceiptRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeReceiptRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeReceiptRuleInput"} - if s.RuleName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleName")) - } - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRuleName sets the RuleName field's value. -func (s *DescribeReceiptRuleInput) SetRuleName(v string) *DescribeReceiptRuleInput { - s.RuleName = &v - return s -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *DescribeReceiptRuleInput) SetRuleSetName(v string) *DescribeReceiptRuleInput { - s.RuleSetName = &v - return s -} - -// Represents the details of a receipt rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRuleResponse -type DescribeReceiptRuleOutput struct { - _ struct{} `type:"structure"` - - // A data structure that contains the specified receipt rule's name, actions, - // recipients, domains, enabled status, scan status, and Transport Layer Security - // (TLS) policy. - Rule *ReceiptRule `type:"structure"` -} - -// String returns the string representation -func (s DescribeReceiptRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReceiptRuleOutput) GoString() string { - return s.String() -} - -// SetRule sets the Rule field's value. -func (s *DescribeReceiptRuleOutput) SetRule(v *ReceiptRule) *DescribeReceiptRuleOutput { - s.Rule = v - return s -} - -// Represents a request to return the details of a receipt rule set. You use -// receipt rule sets to receive email with Amazon SES. For more information, -// see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRuleSetRequest -type DescribeReceiptRuleSetInput struct { - _ struct{} `type:"structure"` - - // The name of the receipt rule set to describe. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeReceiptRuleSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReceiptRuleSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeReceiptRuleSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeReceiptRuleSetInput"} - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *DescribeReceiptRuleSetInput) SetRuleSetName(v string) *DescribeReceiptRuleSetInput { - s.RuleSetName = &v - return s -} - -// Represents the details of the specified receipt rule set. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/DescribeReceiptRuleSetResponse -type DescribeReceiptRuleSetOutput struct { - _ struct{} `type:"structure"` - - // The metadata for the receipt rule set, which consists of the rule set name - // and the timestamp of when the rule set was created. - Metadata *ReceiptRuleSetMetadata `type:"structure"` - - // A list of the receipt rules that belong to the specified receipt rule set. - Rules []*ReceiptRule `type:"list"` -} - -// String returns the string representation -func (s DescribeReceiptRuleSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReceiptRuleSetOutput) GoString() string { - return s.String() -} - -// SetMetadata sets the Metadata field's value. -func (s *DescribeReceiptRuleSetOutput) SetMetadata(v *ReceiptRuleSetMetadata) *DescribeReceiptRuleSetOutput { - s.Metadata = v - return s -} - -// SetRules sets the Rules field's value. -func (s *DescribeReceiptRuleSetOutput) SetRules(v []*ReceiptRule) *DescribeReceiptRuleSetOutput { - s.Rules = v - return s -} - -// Represents the destination of the message, consisting of To:, CC:, and BCC: -// fields. -// -// By default, the string must be 7-bit ASCII. If the text must contain any -// other characters, then you must use MIME encoded-word syntax (RFC 2047) instead -// of a literal string. MIME encoded-word syntax uses the following form: =?charset?encoding?encoded-text?=. -// For more information, see RFC 2047 (http://tools.ietf.org/html/rfc2047). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/Destination -type Destination struct { - _ struct{} `type:"structure"` - - // The BCC: field(s) of the message. - BccAddresses []*string `type:"list"` - - // The CC: field(s) of the message. - CcAddresses []*string `type:"list"` - - // The To: field(s) of the message. - ToAddresses []*string `type:"list"` -} - -// 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() -} - -// SetBccAddresses sets the BccAddresses field's value. -func (s *Destination) SetBccAddresses(v []*string) *Destination { - s.BccAddresses = v - return s -} - -// SetCcAddresses sets the CcAddresses field's value. -func (s *Destination) SetCcAddresses(v []*string) *Destination { - s.CcAddresses = v - return s -} - -// SetToAddresses sets the ToAddresses field's value. -func (s *Destination) SetToAddresses(v []*string) *Destination { - s.ToAddresses = v - return s -} - -// Contains information about the event destination to which the specified email -// sending events are published. -// -// When you create or update an event destination, you must provide one, and -// only one, destination. The destination can be either Amazon CloudWatch or -// Amazon Kinesis Firehose. -// -// Event destinations are associated with configuration sets, which enable you -// to publish email sending events to Amazon CloudWatch or Amazon Kinesis Firehose. -// For information about using configuration sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/EventDestination -type EventDestination struct { - _ struct{} `type:"structure"` - - // An object that contains the names, default values, and sources of the dimensions - // associated with an Amazon CloudWatch event destination. - CloudWatchDestination *CloudWatchDestination `type:"structure"` - - // Sets whether Amazon SES publishes events to this destination when you send - // an email with the associated configuration set. Set to true to enable publishing - // to this destination; set to false to prevent publishing to this destination. - // The default value is false. - Enabled *bool `type:"boolean"` - - // An object that contains the delivery stream ARN and the IAM role ARN associated - // with an Amazon Kinesis Firehose event destination. - KinesisFirehoseDestination *KinesisFirehoseDestination `type:"structure"` - - // The type of email sending events to publish to the event destination. - // - // MatchingEventTypes is a required field - MatchingEventTypes []*string `type:"list" required:"true"` - - // The name of the event destination. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), - // or dashes (-). - // - // * Contain less than 64 characters. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s EventDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EventDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EventDestination"} - if s.MatchingEventTypes == nil { - invalidParams.Add(request.NewErrParamRequired("MatchingEventTypes")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.CloudWatchDestination != nil { - if err := s.CloudWatchDestination.Validate(); err != nil { - invalidParams.AddNested("CloudWatchDestination", err.(request.ErrInvalidParams)) - } - } - if s.KinesisFirehoseDestination != nil { - if err := s.KinesisFirehoseDestination.Validate(); err != nil { - invalidParams.AddNested("KinesisFirehoseDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchDestination sets the CloudWatchDestination field's value. -func (s *EventDestination) SetCloudWatchDestination(v *CloudWatchDestination) *EventDestination { - s.CloudWatchDestination = v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *EventDestination) SetEnabled(v bool) *EventDestination { - s.Enabled = &v - return s -} - -// SetKinesisFirehoseDestination sets the KinesisFirehoseDestination field's value. -func (s *EventDestination) SetKinesisFirehoseDestination(v *KinesisFirehoseDestination) *EventDestination { - s.KinesisFirehoseDestination = v - return s -} - -// SetMatchingEventTypes sets the MatchingEventTypes field's value. -func (s *EventDestination) SetMatchingEventTypes(v []*string) *EventDestination { - s.MatchingEventTypes = v - return s -} - -// SetName sets the Name field's value. -func (s *EventDestination) SetName(v string) *EventDestination { - s.Name = &v - return s -} - -// Additional X-headers to include in the Delivery Status Notification (DSN) -// when an email that Amazon SES receives on your behalf bounces. -// -// For information about receiving email through Amazon SES, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ExtensionField -type ExtensionField struct { - _ struct{} `type:"structure"` - - // The name of the header to add. Must be between 1 and 50 characters, inclusive, - // and consist of alphanumeric (a-z, A-Z, 0-9) characters and dashes only. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The value of the header to add. Must be less than 2048 characters, and must - // not contain newline characters ("\r" or "\n"). - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ExtensionField) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExtensionField) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExtensionField) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExtensionField"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *ExtensionField) SetName(v string) *ExtensionField { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ExtensionField) SetValue(v string) *ExtensionField { - s.Value = &v - return s -} - -// Represents a request for the status of Amazon SES Easy DKIM signing for an -// identity. For domain identities, this request also returns the DKIM tokens -// that are required for Easy DKIM signing, and whether Amazon SES successfully -// verified that these tokens were published. For more information about Easy -// DKIM, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityDkimAttributesRequest -type GetIdentityDkimAttributesInput struct { - _ struct{} `type:"structure"` - - // A list of one or more verified identities - email addresses, domains, or - // both. - // - // Identities is a required field - Identities []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetIdentityDkimAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityDkimAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIdentityDkimAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIdentityDkimAttributesInput"} - if s.Identities == nil { - invalidParams.Add(request.NewErrParamRequired("Identities")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentities sets the Identities field's value. -func (s *GetIdentityDkimAttributesInput) SetIdentities(v []*string) *GetIdentityDkimAttributesInput { - s.Identities = v - return s -} - -// Represents the status of Amazon SES Easy DKIM signing for an identity. For -// domain identities, this response also contains the DKIM tokens that are required -// for Easy DKIM signing, and whether Amazon SES successfully verified that -// these tokens were published. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityDkimAttributesResponse -type GetIdentityDkimAttributesOutput struct { - _ struct{} `type:"structure"` - - // The DKIM attributes for an email address or a domain. - // - // DkimAttributes is a required field - DkimAttributes map[string]*IdentityDkimAttributes `type:"map" required:"true"` -} - -// String returns the string representation -func (s GetIdentityDkimAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityDkimAttributesOutput) GoString() string { - return s.String() -} - -// SetDkimAttributes sets the DkimAttributes field's value. -func (s *GetIdentityDkimAttributesOutput) SetDkimAttributes(v map[string]*IdentityDkimAttributes) *GetIdentityDkimAttributesOutput { - s.DkimAttributes = v - return s -} - -// Represents a request to return the Amazon SES custom MAIL FROM attributes -// for a list of identities. For information about using a custom MAIL FROM -// domain, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityMailFromDomainAttributesRequest -type GetIdentityMailFromDomainAttributesInput struct { - _ struct{} `type:"structure"` - - // A list of one or more identities. - // - // Identities is a required field - Identities []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetIdentityMailFromDomainAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityMailFromDomainAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIdentityMailFromDomainAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIdentityMailFromDomainAttributesInput"} - if s.Identities == nil { - invalidParams.Add(request.NewErrParamRequired("Identities")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentities sets the Identities field's value. -func (s *GetIdentityMailFromDomainAttributesInput) SetIdentities(v []*string) *GetIdentityMailFromDomainAttributesInput { - s.Identities = v - return s -} - -// Represents the custom MAIL FROM attributes for a list of identities. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityMailFromDomainAttributesResponse -type GetIdentityMailFromDomainAttributesOutput struct { - _ struct{} `type:"structure"` - - // A map of identities to custom MAIL FROM attributes. - // - // MailFromDomainAttributes is a required field - MailFromDomainAttributes map[string]*IdentityMailFromDomainAttributes `type:"map" required:"true"` -} - -// String returns the string representation -func (s GetIdentityMailFromDomainAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityMailFromDomainAttributesOutput) GoString() string { - return s.String() -} - -// SetMailFromDomainAttributes sets the MailFromDomainAttributes field's value. -func (s *GetIdentityMailFromDomainAttributesOutput) SetMailFromDomainAttributes(v map[string]*IdentityMailFromDomainAttributes) *GetIdentityMailFromDomainAttributesOutput { - s.MailFromDomainAttributes = v - return s -} - -// Represents a request to return the notification attributes for a list of -// identities you verified with Amazon SES. For information about Amazon SES -// notifications, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityNotificationAttributesRequest -type GetIdentityNotificationAttributesInput struct { - _ struct{} `type:"structure"` - - // A list of one or more identities. You can specify an identity by using its - // name or by using its Amazon Resource Name (ARN). Examples: user@example.com, - // example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com. - // - // Identities is a required field - Identities []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetIdentityNotificationAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityNotificationAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIdentityNotificationAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIdentityNotificationAttributesInput"} - if s.Identities == nil { - invalidParams.Add(request.NewErrParamRequired("Identities")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentities sets the Identities field's value. -func (s *GetIdentityNotificationAttributesInput) SetIdentities(v []*string) *GetIdentityNotificationAttributesInput { - s.Identities = v - return s -} - -// Represents the notification attributes for a list of identities. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityNotificationAttributesResponse -type GetIdentityNotificationAttributesOutput struct { - _ struct{} `type:"structure"` - - // A map of Identity to IdentityNotificationAttributes. - // - // NotificationAttributes is a required field - NotificationAttributes map[string]*IdentityNotificationAttributes `type:"map" required:"true"` -} - -// String returns the string representation -func (s GetIdentityNotificationAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityNotificationAttributesOutput) GoString() string { - return s.String() -} - -// SetNotificationAttributes sets the NotificationAttributes field's value. -func (s *GetIdentityNotificationAttributesOutput) SetNotificationAttributes(v map[string]*IdentityNotificationAttributes) *GetIdentityNotificationAttributesOutput { - s.NotificationAttributes = v - return s -} - -// Represents a request to return the requested sending authorization policies -// for an identity. Sending authorization is an Amazon SES feature that enables -// you to authorize other senders to use your identities. For information, see -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityPoliciesRequest -type GetIdentityPoliciesInput struct { - _ struct{} `type:"structure"` - - // The identity for which the policies will be retrieved. You can specify an - // identity by using its name or by using its Amazon Resource Name (ARN). Examples: - // user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com. - // - // To successfully call this API, you must own the identity. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` - - // A list of the names of policies to be retrieved. You can retrieve a maximum - // of 20 policies at a time. If you do not know the names of the policies that - // are attached to the identity, you can use ListIdentityPolicies. - // - // PolicyNames is a required field - PolicyNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetIdentityPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIdentityPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIdentityPoliciesInput"} - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - if s.PolicyNames == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentity sets the Identity field's value. -func (s *GetIdentityPoliciesInput) SetIdentity(v string) *GetIdentityPoliciesInput { - s.Identity = &v - return s -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *GetIdentityPoliciesInput) SetPolicyNames(v []*string) *GetIdentityPoliciesInput { - s.PolicyNames = v - return s -} - -// Represents the requested sending authorization policies. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityPoliciesResponse -type GetIdentityPoliciesOutput struct { - _ struct{} `type:"structure"` - - // A map of policy names to policies. - // - // Policies is a required field - Policies map[string]*string `type:"map" required:"true"` -} - -// String returns the string representation -func (s GetIdentityPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityPoliciesOutput) GoString() string { - return s.String() -} - -// SetPolicies sets the Policies field's value. -func (s *GetIdentityPoliciesOutput) SetPolicies(v map[string]*string) *GetIdentityPoliciesOutput { - s.Policies = v - return s -} - -// Represents a request to return the Amazon SES verification status of a list -// of identities. For domain identities, this request also returns the verification -// token. For information about verifying identities with Amazon SES, see the -// Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityVerificationAttributesRequest -type GetIdentityVerificationAttributesInput struct { - _ struct{} `type:"structure"` - - // A list of identities. - // - // Identities is a required field - Identities []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetIdentityVerificationAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityVerificationAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIdentityVerificationAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIdentityVerificationAttributesInput"} - if s.Identities == nil { - invalidParams.Add(request.NewErrParamRequired("Identities")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentities sets the Identities field's value. -func (s *GetIdentityVerificationAttributesInput) SetIdentities(v []*string) *GetIdentityVerificationAttributesInput { - s.Identities = v - return s -} - -// The Amazon SES verification status of a list of identities. For domain identities, -// this response also contains the verification token. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetIdentityVerificationAttributesResponse -type GetIdentityVerificationAttributesOutput struct { - _ struct{} `type:"structure"` - - // A map of Identities to IdentityVerificationAttributes objects. - // - // VerificationAttributes is a required field - VerificationAttributes map[string]*IdentityVerificationAttributes `type:"map" required:"true"` -} - -// String returns the string representation -func (s GetIdentityVerificationAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIdentityVerificationAttributesOutput) GoString() string { - return s.String() -} - -// SetVerificationAttributes sets the VerificationAttributes field's value. -func (s *GetIdentityVerificationAttributesOutput) SetVerificationAttributes(v map[string]*IdentityVerificationAttributes) *GetIdentityVerificationAttributesOutput { - s.VerificationAttributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendQuotaInput -type GetSendQuotaInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetSendQuotaInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSendQuotaInput) GoString() string { - return s.String() -} - -// Represents your Amazon SES daily sending quota, maximum send rate, and the -// number of emails you have sent in the last 24 hours. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendQuotaResponse -type GetSendQuotaOutput struct { - _ struct{} `type:"structure"` - - // The maximum number of emails the user is allowed to send in a 24-hour interval. - // A value of -1 signifies an unlimited quota. - Max24HourSend *float64 `type:"double"` - - // The maximum number of emails that Amazon SES can accept from the user's account - // per second. - // - // The rate at which Amazon SES accepts the user's messages might be less than - // the maximum send rate. - MaxSendRate *float64 `type:"double"` - - // The number of emails sent during the previous 24 hours. - SentLast24Hours *float64 `type:"double"` -} - -// String returns the string representation -func (s GetSendQuotaOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSendQuotaOutput) GoString() string { - return s.String() -} - -// SetMax24HourSend sets the Max24HourSend field's value. -func (s *GetSendQuotaOutput) SetMax24HourSend(v float64) *GetSendQuotaOutput { - s.Max24HourSend = &v - return s -} - -// SetMaxSendRate sets the MaxSendRate field's value. -func (s *GetSendQuotaOutput) SetMaxSendRate(v float64) *GetSendQuotaOutput { - s.MaxSendRate = &v - return s -} - -// SetSentLast24Hours sets the SentLast24Hours field's value. -func (s *GetSendQuotaOutput) SetSentLast24Hours(v float64) *GetSendQuotaOutput { - s.SentLast24Hours = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendStatisticsInput -type GetSendStatisticsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetSendStatisticsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSendStatisticsInput) GoString() string { - return s.String() -} - -// Represents a list of data points. This list contains aggregated data from -// the previous two weeks of your sending activity with Amazon SES. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/GetSendStatisticsResponse -type GetSendStatisticsOutput struct { - _ struct{} `type:"structure"` - - // A list of data points, each of which represents 15 minutes of activity. - SendDataPoints []*SendDataPoint `type:"list"` -} - -// String returns the string representation -func (s GetSendStatisticsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSendStatisticsOutput) GoString() string { - return s.String() -} - -// SetSendDataPoints sets the SendDataPoints field's value. -func (s *GetSendStatisticsOutput) SetSendDataPoints(v []*SendDataPoint) *GetSendStatisticsOutput { - s.SendDataPoints = v - return s -} - -// Represents the DKIM attributes of a verified email address or a domain. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/IdentityDkimAttributes -type IdentityDkimAttributes struct { - _ struct{} `type:"structure"` - - // True if DKIM signing is enabled for email sent from the identity; false otherwise. - // The default value is true. - // - // DkimEnabled is a required field - DkimEnabled *bool `type:"boolean" required:"true"` - - // A set of character strings that represent the domain's identity. Using these - // tokens, you will need to create DNS CNAME records that point to DKIM public - // keys hosted by Amazon SES. Amazon Web Services will eventually detect that - // you have updated your DNS records; this detection process may take up to - // 72 hours. Upon successful detection, Amazon SES will be able to DKIM-sign - // email originating from that domain. (This only applies to domain identities, - // not email address identities.) - // - // For more information about creating DNS records using DKIM tokens, go to - // the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim-dns-records.html). - DkimTokens []*string `type:"list"` - - // Describes whether Amazon SES has successfully verified the DKIM DNS records - // (tokens) published in the domain name's DNS. (This only applies to domain - // identities, not email address identities.) - // - // DkimVerificationStatus is a required field - DkimVerificationStatus *string `type:"string" required:"true" enum:"VerificationStatus"` -} - -// String returns the string representation -func (s IdentityDkimAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IdentityDkimAttributes) GoString() string { - return s.String() -} - -// SetDkimEnabled sets the DkimEnabled field's value. -func (s *IdentityDkimAttributes) SetDkimEnabled(v bool) *IdentityDkimAttributes { - s.DkimEnabled = &v - return s -} - -// SetDkimTokens sets the DkimTokens field's value. -func (s *IdentityDkimAttributes) SetDkimTokens(v []*string) *IdentityDkimAttributes { - s.DkimTokens = v - return s -} - -// SetDkimVerificationStatus sets the DkimVerificationStatus field's value. -func (s *IdentityDkimAttributes) SetDkimVerificationStatus(v string) *IdentityDkimAttributes { - s.DkimVerificationStatus = &v - return s -} - -// Represents the custom MAIL FROM domain attributes of a verified identity -// (email address or domain). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/IdentityMailFromDomainAttributes -type IdentityMailFromDomainAttributes struct { - _ struct{} `type:"structure"` - - // The action that Amazon SES takes if it cannot successfully read the required - // MX record when you send an email. A value of UseDefaultValue indicates that - // if Amazon SES cannot read the required MX record, it uses amazonses.com (or - // a subdomain of that) as the MAIL FROM domain. A value of RejectMessage indicates - // that if Amazon SES cannot read the required MX record, Amazon SES returns - // a MailFromDomainNotVerified error and does not send the email. - // - // The custom MAIL FROM setup states that result in this behavior are Pending, - // Failed, and TemporaryFailure. - // - // BehaviorOnMXFailure is a required field - BehaviorOnMXFailure *string `type:"string" required:"true" enum:"BehaviorOnMXFailure"` - - // The custom MAIL FROM domain that the identity is configured to use. - // - // MailFromDomain is a required field - MailFromDomain *string `type:"string" required:"true"` - - // The state that indicates whether Amazon SES has successfully read the MX - // record required for custom MAIL FROM domain setup. If the state is Success, - // Amazon SES uses the specified custom MAIL FROM domain when the verified identity - // sends an email. All other states indicate that Amazon SES takes the action - // described by BehaviorOnMXFailure. - // - // MailFromDomainStatus is a required field - MailFromDomainStatus *string `type:"string" required:"true" enum:"CustomMailFromStatus"` -} - -// String returns the string representation -func (s IdentityMailFromDomainAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IdentityMailFromDomainAttributes) GoString() string { - return s.String() -} - -// SetBehaviorOnMXFailure sets the BehaviorOnMXFailure field's value. -func (s *IdentityMailFromDomainAttributes) SetBehaviorOnMXFailure(v string) *IdentityMailFromDomainAttributes { - s.BehaviorOnMXFailure = &v - return s -} - -// SetMailFromDomain sets the MailFromDomain field's value. -func (s *IdentityMailFromDomainAttributes) SetMailFromDomain(v string) *IdentityMailFromDomainAttributes { - s.MailFromDomain = &v - return s -} - -// SetMailFromDomainStatus sets the MailFromDomainStatus field's value. -func (s *IdentityMailFromDomainAttributes) SetMailFromDomainStatus(v string) *IdentityMailFromDomainAttributes { - s.MailFromDomainStatus = &v - return s -} - -// Represents the notification attributes of an identity, including whether -// an identity has Amazon Simple Notification Service (Amazon SNS) topics set -// for bounce, complaint, and/or delivery notifications, and whether feedback -// forwarding is enabled for bounce and complaint notifications. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/IdentityNotificationAttributes -type IdentityNotificationAttributes struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES will - // publish bounce notifications. - // - // BounceTopic is a required field - BounceTopic *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES will - // publish complaint notifications. - // - // ComplaintTopic is a required field - ComplaintTopic *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES will - // publish delivery notifications. - // - // DeliveryTopic is a required field - DeliveryTopic *string `type:"string" required:"true"` - - // Describes whether Amazon SES will forward bounce and complaint notifications - // as email. true indicates that Amazon SES will forward bounce and complaint - // notifications as email, while false indicates that bounce and complaint notifications - // will be published only to the specified bounce and complaint Amazon SNS topics. - // - // ForwardingEnabled is a required field - ForwardingEnabled *bool `type:"boolean" required:"true"` - - // Describes whether Amazon SES includes the original email headers in Amazon - // SNS notifications of type Bounce. A value of true specifies that Amazon SES - // will include headers in bounce notifications, and a value of false specifies - // that Amazon SES will not include headers in bounce notifications. - HeadersInBounceNotificationsEnabled *bool `type:"boolean"` - - // Describes whether Amazon SES includes the original email headers in Amazon - // SNS notifications of type Complaint. A value of true specifies that Amazon - // SES will include headers in complaint notifications, and a value of false - // specifies that Amazon SES will not include headers in complaint notifications. - HeadersInComplaintNotificationsEnabled *bool `type:"boolean"` - - // Describes whether Amazon SES includes the original email headers in Amazon - // SNS notifications of type Delivery. A value of true specifies that Amazon - // SES will include headers in delivery notifications, and a value of false - // specifies that Amazon SES will not include headers in delivery notifications. - HeadersInDeliveryNotificationsEnabled *bool `type:"boolean"` -} - -// String returns the string representation -func (s IdentityNotificationAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IdentityNotificationAttributes) GoString() string { - return s.String() -} - -// SetBounceTopic sets the BounceTopic field's value. -func (s *IdentityNotificationAttributes) SetBounceTopic(v string) *IdentityNotificationAttributes { - s.BounceTopic = &v - return s -} - -// SetComplaintTopic sets the ComplaintTopic field's value. -func (s *IdentityNotificationAttributes) SetComplaintTopic(v string) *IdentityNotificationAttributes { - s.ComplaintTopic = &v - return s -} - -// SetDeliveryTopic sets the DeliveryTopic field's value. -func (s *IdentityNotificationAttributes) SetDeliveryTopic(v string) *IdentityNotificationAttributes { - s.DeliveryTopic = &v - return s -} - -// SetForwardingEnabled sets the ForwardingEnabled field's value. -func (s *IdentityNotificationAttributes) SetForwardingEnabled(v bool) *IdentityNotificationAttributes { - s.ForwardingEnabled = &v - return s -} - -// SetHeadersInBounceNotificationsEnabled sets the HeadersInBounceNotificationsEnabled field's value. -func (s *IdentityNotificationAttributes) SetHeadersInBounceNotificationsEnabled(v bool) *IdentityNotificationAttributes { - s.HeadersInBounceNotificationsEnabled = &v - return s -} - -// SetHeadersInComplaintNotificationsEnabled sets the HeadersInComplaintNotificationsEnabled field's value. -func (s *IdentityNotificationAttributes) SetHeadersInComplaintNotificationsEnabled(v bool) *IdentityNotificationAttributes { - s.HeadersInComplaintNotificationsEnabled = &v - return s -} - -// SetHeadersInDeliveryNotificationsEnabled sets the HeadersInDeliveryNotificationsEnabled field's value. -func (s *IdentityNotificationAttributes) SetHeadersInDeliveryNotificationsEnabled(v bool) *IdentityNotificationAttributes { - s.HeadersInDeliveryNotificationsEnabled = &v - return s -} - -// Represents the verification attributes of a single identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/IdentityVerificationAttributes -type IdentityVerificationAttributes struct { - _ struct{} `type:"structure"` - - // The verification status of the identity: "Pending", "Success", "Failed", - // or "TemporaryFailure". - // - // VerificationStatus is a required field - VerificationStatus *string `type:"string" required:"true" enum:"VerificationStatus"` - - // The verification token for a domain identity. Null for email address identities. - VerificationToken *string `type:"string"` -} - -// String returns the string representation -func (s IdentityVerificationAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IdentityVerificationAttributes) GoString() string { - return s.String() -} - -// SetVerificationStatus sets the VerificationStatus field's value. -func (s *IdentityVerificationAttributes) SetVerificationStatus(v string) *IdentityVerificationAttributes { - s.VerificationStatus = &v - return s -} - -// SetVerificationToken sets the VerificationToken field's value. -func (s *IdentityVerificationAttributes) SetVerificationToken(v string) *IdentityVerificationAttributes { - s.VerificationToken = &v - return s -} - -// Contains the delivery stream ARN and the IAM role ARN associated with an -// Amazon Kinesis Firehose event destination. -// -// Event destinations, such as Amazon Kinesis Firehose, are associated with -// configuration sets, which enable you to publish email sending events. For -// information about using configuration sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/KinesisFirehoseDestination -type KinesisFirehoseDestination struct { - _ struct{} `type:"structure"` - - // The ARN of the Amazon Kinesis Firehose stream to which to publish email sending - // events. - // - // DeliveryStreamARN is a required field - DeliveryStreamARN *string `type:"string" required:"true"` - - // The ARN of the IAM role under which Amazon SES publishes email sending events - // to the Amazon Kinesis Firehose stream. - // - // IAMRoleARN is a required field - IAMRoleARN *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s KinesisFirehoseDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KinesisFirehoseDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KinesisFirehoseDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KinesisFirehoseDestination"} - if s.DeliveryStreamARN == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryStreamARN")) - } - if s.IAMRoleARN == nil { - invalidParams.Add(request.NewErrParamRequired("IAMRoleARN")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryStreamARN sets the DeliveryStreamARN field's value. -func (s *KinesisFirehoseDestination) SetDeliveryStreamARN(v string) *KinesisFirehoseDestination { - s.DeliveryStreamARN = &v - return s -} - -// SetIAMRoleARN sets the IAMRoleARN field's value. -func (s *KinesisFirehoseDestination) SetIAMRoleARN(v string) *KinesisFirehoseDestination { - s.IAMRoleARN = &v - return s -} - -// When included in a receipt rule, this action calls an AWS Lambda function -// and, optionally, publishes a notification to Amazon Simple Notification Service -// (Amazon SNS). -// -// To enable Amazon SES to call your AWS Lambda function or to publish to an -// Amazon SNS topic of another account, Amazon SES must have permission to access -// those resources. For information about giving permissions, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// For information about using AWS Lambda actions in receipt rules, see the -// Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-lambda.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/LambdaAction -type LambdaAction struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the AWS Lambda function. An example of - // an AWS Lambda function ARN is arn:aws:lambda:us-west-2:account-id:function:MyFunction. - // For more information about AWS Lambda, see the AWS Lambda Developer Guide - // (http://docs.aws.amazon.com/lambda/latest/dg/welcome.html). - // - // FunctionArn is a required field - FunctionArn *string `type:"string" required:"true"` - - // The invocation type of the AWS Lambda function. An invocation type of RequestResponse - // means that the execution of the function will immediately result in a response, - // and a value of Event means that the function will be invoked asynchronously. - // The default value is Event. For information about AWS Lambda invocation types, - // see the AWS Lambda Developer Guide (http://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html). - // - // There is a 30-second timeout on RequestResponse invocations. You should use - // Event invocation in most cases. Use RequestResponse only when you want to - // make a mail flow decision, such as whether to stop the receipt rule or the - // receipt rule set. - InvocationType *string `type:"string" enum:"InvocationType"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the - // Lambda action is taken. An example of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic. - // For more information about Amazon SNS topics, see the Amazon SNS Developer - // Guide (http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html). - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s LambdaAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LambdaAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LambdaAction"} - if s.FunctionArn == nil { - invalidParams.Add(request.NewErrParamRequired("FunctionArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFunctionArn sets the FunctionArn field's value. -func (s *LambdaAction) SetFunctionArn(v string) *LambdaAction { - s.FunctionArn = &v - return s -} - -// SetInvocationType sets the InvocationType field's value. -func (s *LambdaAction) SetInvocationType(v string) *LambdaAction { - s.InvocationType = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *LambdaAction) SetTopicArn(v string) *LambdaAction { - s.TopicArn = &v - return s -} - -// Represents a request to list the configuration sets associated with your -// AWS account. Configuration sets enable you to publish email sending events. -// For information about using configuration sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListConfigurationSetsRequest -type ListConfigurationSetsInput struct { - _ struct{} `type:"structure"` - - // The number of configuration sets to return. - MaxItems *int64 `type:"integer"` - - // A token returned from a previous call to ListConfigurationSets to indicate - // the position of the configuration set in the configuration set list. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListConfigurationSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListConfigurationSetsInput) GoString() string { - return s.String() -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListConfigurationSetsInput) SetMaxItems(v int64) *ListConfigurationSetsInput { - s.MaxItems = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConfigurationSetsInput) SetNextToken(v string) *ListConfigurationSetsInput { - s.NextToken = &v - return s -} - -// A list of configuration sets associated with your AWS account. Configuration -// sets enable you to publish email sending events. For information about using -// configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListConfigurationSetsResponse -type ListConfigurationSetsOutput struct { - _ struct{} `type:"structure"` - - // A list of configuration sets. - ConfigurationSets []*ConfigurationSet `type:"list"` - - // A token indicating that there are additional configuration sets available - // to be listed. Pass this token to successive calls of ListConfigurationSets. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListConfigurationSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListConfigurationSetsOutput) GoString() string { - return s.String() -} - -// SetConfigurationSets sets the ConfigurationSets field's value. -func (s *ListConfigurationSetsOutput) SetConfigurationSets(v []*ConfigurationSet) *ListConfigurationSetsOutput { - s.ConfigurationSets = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConfigurationSetsOutput) SetNextToken(v string) *ListConfigurationSetsOutput { - s.NextToken = &v - return s -} - -// Represents a request to return a list of all identities (email addresses -// and domains) that you have attempted to verify under your AWS account, regardless -// of verification status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentitiesRequest -type ListIdentitiesInput struct { - _ struct{} `type:"structure"` - - // The type of the identities to list. Possible values are "EmailAddress" and - // "Domain". If this parameter is omitted, then all identities will be listed. - IdentityType *string `type:"string" enum:"IdentityType"` - - // The maximum number of identities per page. Possible values are 1-1000 inclusive. - MaxItems *int64 `type:"integer"` - - // The token to use for pagination. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListIdentitiesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListIdentitiesInput) GoString() string { - return s.String() -} - -// SetIdentityType sets the IdentityType field's value. -func (s *ListIdentitiesInput) SetIdentityType(v string) *ListIdentitiesInput { - s.IdentityType = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListIdentitiesInput) SetMaxItems(v int64) *ListIdentitiesInput { - s.MaxItems = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdentitiesInput) SetNextToken(v string) *ListIdentitiesInput { - s.NextToken = &v - return s -} - -// A list of all identities that you have attempted to verify under your AWS -// account, regardless of verification status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentitiesResponse -type ListIdentitiesOutput struct { - _ struct{} `type:"structure"` - - // A list of identities. - // - // Identities is a required field - Identities []*string `type:"list" required:"true"` - - // The token used for pagination. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListIdentitiesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListIdentitiesOutput) GoString() string { - return s.String() -} - -// SetIdentities sets the Identities field's value. -func (s *ListIdentitiesOutput) SetIdentities(v []*string) *ListIdentitiesOutput { - s.Identities = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdentitiesOutput) SetNextToken(v string) *ListIdentitiesOutput { - s.NextToken = &v - return s -} - -// Represents a request to return a list of sending authorization policies that -// are attached to an identity. Sending authorization is an Amazon SES feature -// that enables you to authorize other senders to use your identities. For information, -// see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentityPoliciesRequest -type ListIdentityPoliciesInput struct { - _ struct{} `type:"structure"` - - // The identity that is associated with the policy for which the policies will - // be listed. You can specify an identity by using its name or by using its - // Amazon Resource Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com. - // - // To successfully call this API, you must own the identity. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ListIdentityPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListIdentityPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIdentityPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIdentityPoliciesInput"} - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentity sets the Identity field's value. -func (s *ListIdentityPoliciesInput) SetIdentity(v string) *ListIdentityPoliciesInput { - s.Identity = &v - return s -} - -// A list of names of sending authorization policies that apply to an identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListIdentityPoliciesResponse -type ListIdentityPoliciesOutput struct { - _ struct{} `type:"structure"` - - // A list of names of policies that apply to the specified identity. - // - // PolicyNames is a required field - PolicyNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListIdentityPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListIdentityPoliciesOutput) GoString() string { - return s.String() -} - -// SetPolicyNames sets the PolicyNames field's value. -func (s *ListIdentityPoliciesOutput) SetPolicyNames(v []*string) *ListIdentityPoliciesOutput { - s.PolicyNames = v - return s -} - -// Represents a request to list the IP address filters that exist under your -// AWS account. You use IP address filters when you receive email with Amazon -// SES. For more information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptFiltersRequest -type ListReceiptFiltersInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ListReceiptFiltersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListReceiptFiltersInput) GoString() string { - return s.String() -} - -// A list of IP address filters that exist under your AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptFiltersResponse -type ListReceiptFiltersOutput struct { - _ struct{} `type:"structure"` - - // A list of IP address filter data structures, which each consist of a name, - // an IP address range, and whether to allow or block mail from it. - Filters []*ReceiptFilter `type:"list"` -} - -// String returns the string representation -func (s ListReceiptFiltersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListReceiptFiltersOutput) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *ListReceiptFiltersOutput) SetFilters(v []*ReceiptFilter) *ListReceiptFiltersOutput { - s.Filters = v - return s -} - -// Represents a request to list the receipt rule sets that exist under your -// AWS account. You use receipt rule sets to receive email with Amazon SES. -// For more information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptRuleSetsRequest -type ListReceiptRuleSetsInput struct { - _ struct{} `type:"structure"` - - // A token returned from a previous call to ListReceiptRuleSets to indicate - // the position in the receipt rule set list. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListReceiptRuleSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListReceiptRuleSetsInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReceiptRuleSetsInput) SetNextToken(v string) *ListReceiptRuleSetsInput { - s.NextToken = &v - return s -} - -// A list of receipt rule sets that exist under your AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListReceiptRuleSetsResponse -type ListReceiptRuleSetsOutput struct { - _ struct{} `type:"structure"` - - // A token indicating that there are additional receipt rule sets available - // to be listed. Pass this token to successive calls of ListReceiptRuleSets - // to retrieve up to 100 receipt rule sets at a time. - NextToken *string `type:"string"` - - // The metadata for the currently active receipt rule set. The metadata consists - // of the rule set name and the timestamp of when the rule set was created. - RuleSets []*ReceiptRuleSetMetadata `type:"list"` -} - -// String returns the string representation -func (s ListReceiptRuleSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListReceiptRuleSetsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReceiptRuleSetsOutput) SetNextToken(v string) *ListReceiptRuleSetsOutput { - s.NextToken = &v - return s -} - -// SetRuleSets sets the RuleSets field's value. -func (s *ListReceiptRuleSetsOutput) SetRuleSets(v []*ReceiptRuleSetMetadata) *ListReceiptRuleSetsOutput { - s.RuleSets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListVerifiedEmailAddressesInput -type ListVerifiedEmailAddressesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ListVerifiedEmailAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVerifiedEmailAddressesInput) GoString() string { - return s.String() -} - -// A list of email addresses that you have verified with Amazon SES under your -// AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ListVerifiedEmailAddressesResponse -type ListVerifiedEmailAddressesOutput struct { - _ struct{} `type:"structure"` - - // A list of email addresses that have been verified. - VerifiedEmailAddresses []*string `type:"list"` -} - -// String returns the string representation -func (s ListVerifiedEmailAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVerifiedEmailAddressesOutput) GoString() string { - return s.String() -} - -// SetVerifiedEmailAddresses sets the VerifiedEmailAddresses field's value. -func (s *ListVerifiedEmailAddressesOutput) SetVerifiedEmailAddresses(v []*string) *ListVerifiedEmailAddressesOutput { - s.VerifiedEmailAddresses = v - return s -} - -// Represents the message to be sent, composed of a subject and a body. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/Message -type Message struct { - _ struct{} `type:"structure"` - - // The message body. - // - // Body is a required field - Body *Body `type:"structure" required:"true"` - - // The subject of the message: A short summary of the content, which will appear - // in the recipient's inbox. - // - // Subject is a required field - Subject *Content `type:"structure" required:"true"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Message) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Message"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.Subject == nil { - invalidParams.Add(request.NewErrParamRequired("Subject")) - } - if s.Body != nil { - if err := s.Body.Validate(); err != nil { - invalidParams.AddNested("Body", err.(request.ErrInvalidParams)) - } - } - if s.Subject != nil { - if err := s.Subject.Validate(); err != nil { - invalidParams.AddNested("Subject", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *Message) SetBody(v *Body) *Message { - s.Body = v - return s -} - -// SetSubject sets the Subject field's value. -func (s *Message) SetSubject(v *Content) *Message { - s.Subject = v - return s -} - -// Message-related information to include in the Delivery Status Notification -// (DSN) when an email that Amazon SES receives on your behalf bounces. -// -// For information about receiving email through Amazon SES, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/MessageDsn -type MessageDsn struct { - _ struct{} `type:"structure"` - - // When the message was received by the reporting mail transfer agent (MTA), - // in RFC 822 (https://www.ietf.org/rfc/rfc0822.txt) date-time format. - ArrivalDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Additional X-headers to include in the DSN. - ExtensionFields []*ExtensionField `type:"list"` - - // The reporting MTA that attempted to deliver the message, formatted as specified - // in RFC 3464 (https://tools.ietf.org/html/rfc3464) (mta-name-type; mta-name). - // The default value is dns; inbound-smtp.[region].amazonaws.com. - // - // ReportingMta is a required field - ReportingMta *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s MessageDsn) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MessageDsn) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MessageDsn) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MessageDsn"} - if s.ReportingMta == nil { - invalidParams.Add(request.NewErrParamRequired("ReportingMta")) - } - if s.ExtensionFields != nil { - for i, v := range s.ExtensionFields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ExtensionFields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArrivalDate sets the ArrivalDate field's value. -func (s *MessageDsn) SetArrivalDate(v time.Time) *MessageDsn { - s.ArrivalDate = &v - return s -} - -// SetExtensionFields sets the ExtensionFields field's value. -func (s *MessageDsn) SetExtensionFields(v []*ExtensionField) *MessageDsn { - s.ExtensionFields = v - return s -} - -// SetReportingMta sets the ReportingMta field's value. -func (s *MessageDsn) SetReportingMta(v string) *MessageDsn { - s.ReportingMta = &v - return s -} - -// Contains the name and value of a tag that you can provide to SendEmail or -// SendRawEmail to apply to an email. -// -// Message tags, which you use with configuration sets, enable you to publish -// email sending events. For information about using configuration sets, see -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/MessageTag -type MessageTag struct { - _ struct{} `type:"structure"` - - // The name of the tag. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), - // or dashes (-). - // - // * Contain less than 256 characters. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The value of the tag. The value must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), - // or dashes (-). - // - // * Contain less than 256 characters. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s MessageTag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MessageTag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MessageTag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MessageTag"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *MessageTag) SetName(v string) *MessageTag { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *MessageTag) SetValue(v string) *MessageTag { - s.Value = &v - return s -} - -// Represents a request to add or update a sending authorization policy for -// an identity. Sending authorization is an Amazon SES feature that enables -// you to authorize other senders to use your identities. For information, see -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/PutIdentityPolicyRequest -type PutIdentityPolicyInput struct { - _ struct{} `type:"structure"` - - // The identity to which the policy will apply. You can specify an identity - // by using its name or by using its Amazon Resource Name (ARN). Examples: user@example.com, - // example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com. - // - // To successfully call this API, you must own the identity. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` - - // The text of the policy in JSON format. The policy cannot exceed 4 KB. - // - // For information about the syntax of sending authorization policies, see the - // Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-policies.html). - // - // Policy is a required field - Policy *string `min:"1" type:"string" required:"true"` - - // The name of the policy. - // - // The policy name cannot exceed 64 characters and can only include alphanumeric - // characters, dashes, and underscores. - // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutIdentityPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutIdentityPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutIdentityPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutIdentityPolicyInput"} - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.PolicyName == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyName")) - } - if s.PolicyName != nil && len(*s.PolicyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentity sets the Identity field's value. -func (s *PutIdentityPolicyInput) SetIdentity(v string) *PutIdentityPolicyInput { - s.Identity = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *PutIdentityPolicyInput) SetPolicy(v string) *PutIdentityPolicyInput { - s.Policy = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *PutIdentityPolicyInput) SetPolicyName(v string) *PutIdentityPolicyInput { - s.PolicyName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/PutIdentityPolicyResponse -type PutIdentityPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutIdentityPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutIdentityPolicyOutput) GoString() string { - return s.String() -} - -// Represents the raw data of the message. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/RawMessage -type RawMessage struct { - _ struct{} `type:"structure"` - - // The raw data of the message. The client must ensure that the message format - // complies with Internet email standards regarding email header fields, MIME - // types, MIME encoding, and base64 encoding. - // - // The To:, CC:, and BCC: headers in the raw message can contain a group list. - // - // If you are using SendRawEmail with sending authorization, you can include - // X-headers in the raw message to specify the "Source," "From," and "Return-Path" - // addresses. For more information, see the documentation for SendRawEmail. - // - // Do not include these X-headers in the DKIM signature, because they are removed - // by Amazon SES before sending the email. - // - // For more information, go to the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html). - // - // Data is automatically base64 encoded/decoded by the SDK. - // - // Data is a required field - Data []byte `type:"blob" required:"true"` -} - -// String returns the string representation -func (s RawMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RawMessage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RawMessage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RawMessage"} - if s.Data == nil { - invalidParams.Add(request.NewErrParamRequired("Data")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetData sets the Data field's value. -func (s *RawMessage) SetData(v []byte) *RawMessage { - s.Data = v - return s -} - -// An action that Amazon SES can take when it receives an email on behalf of -// one or more email addresses or domains that you own. An instance of this -// data type can represent only one action. -// -// For information about setting up receipt rules, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rules.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReceiptAction -type ReceiptAction struct { - _ struct{} `type:"structure"` - - // Adds a header to the received email. - AddHeaderAction *AddHeaderAction `type:"structure"` - - // Rejects the received email by returning a bounce response to the sender and, - // optionally, publishes a notification to Amazon Simple Notification Service - // (Amazon SNS). - BounceAction *BounceAction `type:"structure"` - - // Calls an AWS Lambda function, and optionally, publishes a notification to - // Amazon SNS. - LambdaAction *LambdaAction `type:"structure"` - - // Saves the received message to an Amazon Simple Storage Service (Amazon S3) - // bucket and, optionally, publishes a notification to Amazon SNS. - S3Action *S3Action `type:"structure"` - - // Publishes the email content within a notification to Amazon SNS. - SNSAction *SNSAction `type:"structure"` - - // Terminates the evaluation of the receipt rule set and optionally publishes - // a notification to Amazon SNS. - StopAction *StopAction `type:"structure"` - - // Calls Amazon WorkMail and, optionally, publishes a notification to Amazon - // SNS. - WorkmailAction *WorkmailAction `type:"structure"` -} - -// String returns the string representation -func (s ReceiptAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReceiptAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReceiptAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReceiptAction"} - if s.AddHeaderAction != nil { - if err := s.AddHeaderAction.Validate(); err != nil { - invalidParams.AddNested("AddHeaderAction", err.(request.ErrInvalidParams)) - } - } - if s.BounceAction != nil { - if err := s.BounceAction.Validate(); err != nil { - invalidParams.AddNested("BounceAction", err.(request.ErrInvalidParams)) - } - } - if s.LambdaAction != nil { - if err := s.LambdaAction.Validate(); err != nil { - invalidParams.AddNested("LambdaAction", err.(request.ErrInvalidParams)) - } - } - if s.S3Action != nil { - if err := s.S3Action.Validate(); err != nil { - invalidParams.AddNested("S3Action", err.(request.ErrInvalidParams)) - } - } - if s.SNSAction != nil { - if err := s.SNSAction.Validate(); err != nil { - invalidParams.AddNested("SNSAction", err.(request.ErrInvalidParams)) - } - } - if s.StopAction != nil { - if err := s.StopAction.Validate(); err != nil { - invalidParams.AddNested("StopAction", err.(request.ErrInvalidParams)) - } - } - if s.WorkmailAction != nil { - if err := s.WorkmailAction.Validate(); err != nil { - invalidParams.AddNested("WorkmailAction", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddHeaderAction sets the AddHeaderAction field's value. -func (s *ReceiptAction) SetAddHeaderAction(v *AddHeaderAction) *ReceiptAction { - s.AddHeaderAction = v - return s -} - -// SetBounceAction sets the BounceAction field's value. -func (s *ReceiptAction) SetBounceAction(v *BounceAction) *ReceiptAction { - s.BounceAction = v - return s -} - -// SetLambdaAction sets the LambdaAction field's value. -func (s *ReceiptAction) SetLambdaAction(v *LambdaAction) *ReceiptAction { - s.LambdaAction = v - return s -} - -// SetS3Action sets the S3Action field's value. -func (s *ReceiptAction) SetS3Action(v *S3Action) *ReceiptAction { - s.S3Action = v - return s -} - -// SetSNSAction sets the SNSAction field's value. -func (s *ReceiptAction) SetSNSAction(v *SNSAction) *ReceiptAction { - s.SNSAction = v - return s -} - -// SetStopAction sets the StopAction field's value. -func (s *ReceiptAction) SetStopAction(v *StopAction) *ReceiptAction { - s.StopAction = v - return s -} - -// SetWorkmailAction sets the WorkmailAction field's value. -func (s *ReceiptAction) SetWorkmailAction(v *WorkmailAction) *ReceiptAction { - s.WorkmailAction = v - return s -} - -// A receipt IP address filter enables you to specify whether to accept or reject -// mail originating from an IP address or range of IP addresses. -// -// For information about setting up IP address filters, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-ip-filters.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReceiptFilter -type ReceiptFilter struct { - _ struct{} `type:"structure"` - - // A structure that provides the IP addresses to block or allow, and whether - // to block or allow incoming mail from them. - // - // IpFilter is a required field - IpFilter *ReceiptIpFilter `type:"structure" required:"true"` - - // The name of the IP address filter. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-). - // - // * Start and end with a letter or number. - // - // * Contain less than 64 characters. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ReceiptFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReceiptFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReceiptFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReceiptFilter"} - if s.IpFilter == nil { - invalidParams.Add(request.NewErrParamRequired("IpFilter")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.IpFilter != nil { - if err := s.IpFilter.Validate(); err != nil { - invalidParams.AddNested("IpFilter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIpFilter sets the IpFilter field's value. -func (s *ReceiptFilter) SetIpFilter(v *ReceiptIpFilter) *ReceiptFilter { - s.IpFilter = v - return s -} - -// SetName sets the Name field's value. -func (s *ReceiptFilter) SetName(v string) *ReceiptFilter { - s.Name = &v - return s -} - -// A receipt IP address filter enables you to specify whether to accept or reject -// mail originating from an IP address or range of IP addresses. -// -// For information about setting up IP address filters, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-ip-filters.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReceiptIpFilter -type ReceiptIpFilter struct { - _ struct{} `type:"structure"` - - // A single IP address or a range of IP addresses that you want to block or - // allow, specified in Classless Inter-Domain Routing (CIDR) notation. An example - // of a single email address is 10.0.0.1. An example of a range of IP addresses - // is 10.0.0.1/24. For more information about CIDR notation, see RFC 2317 (https://tools.ietf.org/html/rfc2317). - // - // Cidr is a required field - Cidr *string `type:"string" required:"true"` - - // Indicates whether to block or allow incoming mail from the specified IP addresses. - // - // Policy is a required field - Policy *string `type:"string" required:"true" enum:"ReceiptFilterPolicy"` -} - -// String returns the string representation -func (s ReceiptIpFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReceiptIpFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReceiptIpFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReceiptIpFilter"} - if s.Cidr == nil { - invalidParams.Add(request.NewErrParamRequired("Cidr")) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidr sets the Cidr field's value. -func (s *ReceiptIpFilter) SetCidr(v string) *ReceiptIpFilter { - s.Cidr = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *ReceiptIpFilter) SetPolicy(v string) *ReceiptIpFilter { - s.Policy = &v - return s -} - -// Receipt rules enable you to specify which actions Amazon SES should take -// when it receives mail on behalf of one or more email addresses or domains -// that you own. -// -// Each receipt rule defines a set of email addresses or domains to which it -// applies. If the email addresses or domains match at least one recipient address -// of the message, Amazon SES executes all of the receipt rule's actions on -// the message. -// -// For information about setting up receipt rules, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rules.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReceiptRule -type ReceiptRule struct { - _ struct{} `type:"structure"` - - // An ordered list of actions to perform on messages that match at least one - // of the recipient email addresses or domains specified in the receipt rule. - Actions []*ReceiptAction `type:"list"` - - // If true, the receipt rule is active. The default value is false. - Enabled *bool `type:"boolean"` - - // The name of the receipt rule. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-). - // - // * Start and end with a letter or number. - // - // * Contain less than 64 characters. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The recipient domains and email addresses to which the receipt rule applies. - // If this field is not specified, this rule will match all recipients under - // all verified domains. - Recipients []*string `type:"list"` - - // If true, then messages to which this receipt rule applies are scanned for - // spam and viruses. The default value is false. - ScanEnabled *bool `type:"boolean"` - - // Specifies whether Amazon SES should require that incoming email is delivered - // over a connection encrypted with Transport Layer Security (TLS). If this - // parameter is set to Require, Amazon SES will bounce emails that are not received - // over TLS. The default is Optional. - TlsPolicy *string `type:"string" enum:"TlsPolicy"` -} - -// String returns the string representation -func (s ReceiptRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReceiptRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReceiptRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReceiptRule"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Actions != nil { - for i, v := range s.Actions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Actions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActions sets the Actions field's value. -func (s *ReceiptRule) SetActions(v []*ReceiptAction) *ReceiptRule { - s.Actions = v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *ReceiptRule) SetEnabled(v bool) *ReceiptRule { - s.Enabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReceiptRule) SetName(v string) *ReceiptRule { - s.Name = &v - return s -} - -// SetRecipients sets the Recipients field's value. -func (s *ReceiptRule) SetRecipients(v []*string) *ReceiptRule { - s.Recipients = v - return s -} - -// SetScanEnabled sets the ScanEnabled field's value. -func (s *ReceiptRule) SetScanEnabled(v bool) *ReceiptRule { - s.ScanEnabled = &v - return s -} - -// SetTlsPolicy sets the TlsPolicy field's value. -func (s *ReceiptRule) SetTlsPolicy(v string) *ReceiptRule { - s.TlsPolicy = &v - return s -} - -// Information about a receipt rule set. -// -// A receipt rule set is a collection of rules that specify what Amazon SES -// should do with mail it receives on behalf of your account's verified domains. -// -// For information about setting up receipt rule sets, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rule-set.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReceiptRuleSetMetadata -type ReceiptRuleSetMetadata struct { - _ struct{} `type:"structure"` - - // The date and time the receipt rule set was created. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The name of the receipt rule set. The name must: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-). - // - // * Start and end with a letter or number. - // - // * Contain less than 64 characters. - Name *string `type:"string"` -} - -// String returns the string representation -func (s ReceiptRuleSetMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReceiptRuleSetMetadata) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *ReceiptRuleSetMetadata) SetCreatedTimestamp(v time.Time) *ReceiptRuleSetMetadata { - s.CreatedTimestamp = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReceiptRuleSetMetadata) SetName(v string) *ReceiptRuleSetMetadata { - s.Name = &v - return s -} - -// Recipient-related information to include in the Delivery Status Notification -// (DSN) when an email that Amazon SES receives on your behalf bounces. -// -// For information about receiving email through Amazon SES, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/RecipientDsnFields -type RecipientDsnFields struct { - _ struct{} `type:"structure"` - - // The action performed by the reporting mail transfer agent (MTA) as a result - // of its attempt to deliver the message to the recipient address. This is required - // by RFC 3464 (https://tools.ietf.org/html/rfc3464). - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"DsnAction"` - - // An extended explanation of what went wrong; this is usually an SMTP response. - // See RFC 3463 (https://tools.ietf.org/html/rfc3463) for the correct formatting - // of this parameter. - DiagnosticCode *string `type:"string"` - - // Additional X-headers to include in the DSN. - ExtensionFields []*ExtensionField `type:"list"` - - // The email address to which the message was ultimately delivered. This corresponds - // to the Final-Recipient in the DSN. If not specified, FinalRecipient will - // be set to the Recipient specified in the BouncedRecipientInfo structure. - // Either FinalRecipient or the recipient in BouncedRecipientInfo must be a - // recipient of the original bounced message. - // - // Do not prepend the FinalRecipient email address with rfc 822;, as described - // in RFC 3798 (https://tools.ietf.org/html/rfc3798). - FinalRecipient *string `type:"string"` - - // The time the final delivery attempt was made, in RFC 822 (https://www.ietf.org/rfc/rfc0822.txt) - // date-time format. - LastAttemptDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The MTA to which the remote MTA attempted to deliver the message, formatted - // as specified in RFC 3464 (https://tools.ietf.org/html/rfc3464) (mta-name-type; - // mta-name). This parameter typically applies only to propagating synchronous - // bounces. - RemoteMta *string `type:"string"` - - // The status code that indicates what went wrong. This is required by RFC 3464 - // (https://tools.ietf.org/html/rfc3464). - // - // Status is a required field - Status *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RecipientDsnFields) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RecipientDsnFields) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RecipientDsnFields) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RecipientDsnFields"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.ExtensionFields != nil { - for i, v := range s.ExtensionFields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ExtensionFields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *RecipientDsnFields) SetAction(v string) *RecipientDsnFields { - s.Action = &v - return s -} - -// SetDiagnosticCode sets the DiagnosticCode field's value. -func (s *RecipientDsnFields) SetDiagnosticCode(v string) *RecipientDsnFields { - s.DiagnosticCode = &v - return s -} - -// SetExtensionFields sets the ExtensionFields field's value. -func (s *RecipientDsnFields) SetExtensionFields(v []*ExtensionField) *RecipientDsnFields { - s.ExtensionFields = v - return s -} - -// SetFinalRecipient sets the FinalRecipient field's value. -func (s *RecipientDsnFields) SetFinalRecipient(v string) *RecipientDsnFields { - s.FinalRecipient = &v - return s -} - -// SetLastAttemptDate sets the LastAttemptDate field's value. -func (s *RecipientDsnFields) SetLastAttemptDate(v time.Time) *RecipientDsnFields { - s.LastAttemptDate = &v - return s -} - -// SetRemoteMta sets the RemoteMta field's value. -func (s *RecipientDsnFields) SetRemoteMta(v string) *RecipientDsnFields { - s.RemoteMta = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RecipientDsnFields) SetStatus(v string) *RecipientDsnFields { - s.Status = &v - return s -} - -// Represents a request to reorder the receipt rules within a receipt rule set. -// You use receipt rule sets to receive email with Amazon SES. For more information, -// see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReorderReceiptRuleSetRequest -type ReorderReceiptRuleSetInput struct { - _ struct{} `type:"structure"` - - // A list of the specified receipt rule set's receipt rules in the order that - // you want to put them. - // - // RuleNames is a required field - RuleNames []*string `type:"list" required:"true"` - - // The name of the receipt rule set to reorder. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ReorderReceiptRuleSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReorderReceiptRuleSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReorderReceiptRuleSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReorderReceiptRuleSetInput"} - if s.RuleNames == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNames")) - } - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRuleNames sets the RuleNames field's value. -func (s *ReorderReceiptRuleSetInput) SetRuleNames(v []*string) *ReorderReceiptRuleSetInput { - s.RuleNames = v - return s -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *ReorderReceiptRuleSetInput) SetRuleSetName(v string) *ReorderReceiptRuleSetInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/ReorderReceiptRuleSetResponse -type ReorderReceiptRuleSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReorderReceiptRuleSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReorderReceiptRuleSetOutput) GoString() string { - return s.String() -} - -// When included in a receipt rule, this action saves the received message to -// an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes -// a notification to Amazon Simple Notification Service (Amazon SNS). -// -// To enable Amazon SES to write emails to your Amazon S3 bucket, use an AWS -// KMS key to encrypt your emails, or publish to an Amazon SNS topic of another -// account, Amazon SES must have permission to access those resources. For information -// about giving permissions, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// When you save your emails to an Amazon S3 bucket, the maximum email size -// (including headers) is 30 MB. Emails larger than that will bounce. -// -// For information about specifying Amazon S3 actions in receipt rules, see -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-s3.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/S3Action -type S3Action struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket to which to save the received email. - // - // BucketName is a required field - BucketName *string `type:"string" required:"true"` - - // The customer master key that Amazon SES should use to encrypt your emails - // before saving them to the Amazon S3 bucket. You can use the default master - // key or a custom master key you created in AWS KMS as follows: - // - // * To use the default master key, provide an ARN in the form of arn:aws:kms:REGION:ACCOUNT-ID-WITHOUT-HYPHENS:alias/aws/ses. - // For example, if your AWS account ID is 123456789012 and you want to use - // the default master key in the US West (Oregon) region, the ARN of the - // default master key would be arn:aws:kms:us-west-2:123456789012:alias/aws/ses. - // If you use the default master key, you don't need to perform any extra - // steps to give Amazon SES permission to use the key. - // - // * To use a custom master key you created in AWS KMS, provide the ARN of - // the master key and ensure that you add a statement to your key's policy - // to give Amazon SES permission to use it. For more information about giving - // permissions, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). - // - // For more information about key policies, see the AWS KMS Developer Guide - // (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html). If - // you do not specify a master key, Amazon SES will not encrypt your emails. - // - // Your mail is encrypted by Amazon SES using the Amazon S3 encryption client - // before the mail is submitted to Amazon S3 for storage. It is not encrypted - // using Amazon S3 server-side encryption. This means that you must use the - // Amazon S3 encryption client to decrypt the email after retrieving it from - // Amazon S3, as the service has no access to use your AWS KMS keys for decryption. - // This encryption client is currently available with the AWS Java SDK (http://aws.amazon.com/sdk-for-java/) - // and AWS Ruby SDK (http://aws.amazon.com/sdk-for-ruby/) only. For more information - // about client-side encryption using AWS KMS master keys, see the Amazon S3 - // Developer Guide (http://alpha-docs-aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html). - KmsKeyArn *string `type:"string"` - - // The key prefix of the Amazon S3 bucket. The key prefix is similar to a directory - // name that enables you to store similar data under the same directory in a - // bucket. - ObjectKeyPrefix *string `type:"string"` - - // The ARN of the Amazon SNS topic to notify when the message is saved to the - // Amazon S3 bucket. An example of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic. - // For more information about Amazon SNS topics, see the Amazon SNS Developer - // Guide (http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html). - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s S3Action) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3Action) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Action) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Action"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3Action) SetBucketName(v string) *S3Action { - s.BucketName = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *S3Action) SetKmsKeyArn(v string) *S3Action { - s.KmsKeyArn = &v - return s -} - -// SetObjectKeyPrefix sets the ObjectKeyPrefix field's value. -func (s *S3Action) SetObjectKeyPrefix(v string) *S3Action { - s.ObjectKeyPrefix = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *S3Action) SetTopicArn(v string) *S3Action { - s.TopicArn = &v - return s -} - -// When included in a receipt rule, this action publishes a notification to -// Amazon Simple Notification Service (Amazon SNS). This action includes a complete -// copy of the email content in the Amazon SNS notifications. Amazon SNS notifications -// for all other actions simply provide information about the email. They do -// not include the email content itself. -// -// If you own the Amazon SNS topic, you don't need to do anything to give Amazon -// SES permission to publish emails to it. However, if you don't own the Amazon -// SNS topic, you need to attach a policy to the topic to give Amazon SES permissions -// to access it. For information about giving permissions, see the Amazon SES -// Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). -// -// You can only publish emails that are 150 KB or less (including the header) -// to Amazon SNS. Larger emails will bounce. If you anticipate emails larger -// than 150 KB, use the S3 action instead. -// -// For information about using a receipt rule to publish an Amazon SNS notification, -// see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-sns.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SNSAction -type SNSAction struct { - _ struct{} `type:"structure"` - - // The encoding to use for the email within the Amazon SNS notification. UTF-8 - // is easier to use, but may not preserve all special characters when a message - // was encoded with a different encoding format. Base64 preserves all special - // characters. The default value is UTF-8. - Encoding *string `type:"string" enum:"SNSActionEncoding"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify. An example - // of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic. - // For more information about Amazon SNS topics, see the Amazon SNS Developer - // Guide (http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html). - // - // TopicArn is a required field - TopicArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SNSAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SNSAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SNSAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SNSAction"} - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncoding sets the Encoding field's value. -func (s *SNSAction) SetEncoding(v string) *SNSAction { - s.Encoding = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *SNSAction) SetTopicArn(v string) *SNSAction { - s.TopicArn = &v - return s -} - -// Represents a request to send a bounce message to the sender of an email you -// received through Amazon SES. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendBounceRequest -type SendBounceInput struct { - _ struct{} `type:"structure"` - - // The address to use in the "From" header of the bounce message. This must - // be an identity that you have verified with Amazon SES. - // - // BounceSender is a required field - BounceSender *string `type:"string" required:"true"` - - // This parameter is used only for sending authorization. It is the ARN of the - // identity that is associated with the sending authorization policy that permits - // you to use the address in the "From" header of the bounce. For more information - // about sending authorization, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). - BounceSenderArn *string `type:"string"` - - // A list of recipients of the bounced message, including the information required - // to create the Delivery Status Notifications (DSNs) for the recipients. You - // must specify at least one BouncedRecipientInfo in the list. - // - // BouncedRecipientInfoList is a required field - BouncedRecipientInfoList []*BouncedRecipientInfo `type:"list" required:"true"` - - // Human-readable text for the bounce message to explain the failure. If not - // specified, the text will be auto-generated based on the bounced recipient - // information. - Explanation *string `type:"string"` - - // Message-related DSN fields. If not specified, Amazon SES will choose the - // values. - MessageDsn *MessageDsn `type:"structure"` - - // The message ID of the message to be bounced. - // - // OriginalMessageId is a required field - OriginalMessageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SendBounceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendBounceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendBounceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendBounceInput"} - if s.BounceSender == nil { - invalidParams.Add(request.NewErrParamRequired("BounceSender")) - } - if s.BouncedRecipientInfoList == nil { - invalidParams.Add(request.NewErrParamRequired("BouncedRecipientInfoList")) - } - if s.OriginalMessageId == nil { - invalidParams.Add(request.NewErrParamRequired("OriginalMessageId")) - } - if s.BouncedRecipientInfoList != nil { - for i, v := range s.BouncedRecipientInfoList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "BouncedRecipientInfoList", i), err.(request.ErrInvalidParams)) - } - } - } - if s.MessageDsn != nil { - if err := s.MessageDsn.Validate(); err != nil { - invalidParams.AddNested("MessageDsn", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBounceSender sets the BounceSender field's value. -func (s *SendBounceInput) SetBounceSender(v string) *SendBounceInput { - s.BounceSender = &v - return s -} - -// SetBounceSenderArn sets the BounceSenderArn field's value. -func (s *SendBounceInput) SetBounceSenderArn(v string) *SendBounceInput { - s.BounceSenderArn = &v - return s -} - -// SetBouncedRecipientInfoList sets the BouncedRecipientInfoList field's value. -func (s *SendBounceInput) SetBouncedRecipientInfoList(v []*BouncedRecipientInfo) *SendBounceInput { - s.BouncedRecipientInfoList = v - return s -} - -// SetExplanation sets the Explanation field's value. -func (s *SendBounceInput) SetExplanation(v string) *SendBounceInput { - s.Explanation = &v - return s -} - -// SetMessageDsn sets the MessageDsn field's value. -func (s *SendBounceInput) SetMessageDsn(v *MessageDsn) *SendBounceInput { - s.MessageDsn = v - return s -} - -// SetOriginalMessageId sets the OriginalMessageId field's value. -func (s *SendBounceInput) SetOriginalMessageId(v string) *SendBounceInput { - s.OriginalMessageId = &v - return s -} - -// Represents a unique message ID. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendBounceResponse -type SendBounceOutput struct { - _ struct{} `type:"structure"` - - // The message ID of the bounce message. - MessageId *string `type:"string"` -} - -// String returns the string representation -func (s SendBounceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendBounceOutput) GoString() string { - return s.String() -} - -// SetMessageId sets the MessageId field's value. -func (s *SendBounceOutput) SetMessageId(v string) *SendBounceOutput { - s.MessageId = &v - return s -} - -// Represents sending statistics data. Each SendDataPoint contains statistics -// for a 15-minute period of sending activity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendDataPoint -type SendDataPoint struct { - _ struct{} `type:"structure"` - - // Number of emails that have bounced. - Bounces *int64 `type:"long"` - - // Number of unwanted emails that were rejected by recipients. - Complaints *int64 `type:"long"` - - // Number of emails that have been sent. - DeliveryAttempts *int64 `type:"long"` - - // Number of emails rejected by Amazon SES. - Rejects *int64 `type:"long"` - - // Time of the data point. - Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SendDataPoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendDataPoint) GoString() string { - return s.String() -} - -// SetBounces sets the Bounces field's value. -func (s *SendDataPoint) SetBounces(v int64) *SendDataPoint { - s.Bounces = &v - return s -} - -// SetComplaints sets the Complaints field's value. -func (s *SendDataPoint) SetComplaints(v int64) *SendDataPoint { - s.Complaints = &v - return s -} - -// SetDeliveryAttempts sets the DeliveryAttempts field's value. -func (s *SendDataPoint) SetDeliveryAttempts(v int64) *SendDataPoint { - s.DeliveryAttempts = &v - return s -} - -// SetRejects sets the Rejects field's value. -func (s *SendDataPoint) SetRejects(v int64) *SendDataPoint { - s.Rejects = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *SendDataPoint) SetTimestamp(v time.Time) *SendDataPoint { - s.Timestamp = &v - return s -} - -// Represents a request to send a single formatted email using Amazon SES. For -// more information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-formatted.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendEmailRequest -type SendEmailInput struct { - _ struct{} `type:"structure"` - - // The name of the configuration set to use when you send an email using SendEmail. - ConfigurationSetName *string `type:"string"` - - // The destination for this email, composed of To:, CC:, and BCC: fields. - // - // Destination is a required field - Destination *Destination `type:"structure" required:"true"` - - // The message to be sent. - // - // Message is a required field - Message *Message `type:"structure" required:"true"` - - // The reply-to email address(es) for the message. If the recipient replies - // to the message, each reply-to address will receive the reply. - ReplyToAddresses []*string `type:"list"` - - // The email address to which bounces and complaints are to be forwarded when - // feedback forwarding is enabled. If the message cannot be delivered to the - // recipient, then an error message will be returned from the recipient's ISP; - // this message will then be forwarded to the email address specified by the - // ReturnPath parameter. The ReturnPath parameter is never overwritten. This - // email address must be either individually verified with Amazon SES, or from - // a domain that has been verified with Amazon SES. - ReturnPath *string `type:"string"` - - // This parameter is used only for sending authorization. It is the ARN of the - // identity that is associated with the sending authorization policy that permits - // you to use the email address specified in the ReturnPath parameter. - // - // For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) - // attaches a policy to it that authorizes you to use feedback@example.com, - // then you would specify the ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, - // and the ReturnPath to be feedback@example.com. - // - // For more information about sending authorization, see the Amazon SES Developer - // Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). - ReturnPathArn *string `type:"string"` - - // The email address that is sending the email. This email address must be either - // individually verified with Amazon SES, or from a domain that has been verified - // with Amazon SES. For information about verifying identities, see the Amazon - // SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html). - // - // If you are sending on behalf of another user and have been permitted to do - // so by a sending authorization policy, then you must also specify the SourceArn - // parameter. For more information about sending authorization, see the Amazon - // SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). - // - // In all cases, the email address must be 7-bit ASCII. If the text must contain - // any other characters, then you must use MIME encoded-word syntax (RFC 2047) - // instead of a literal string. MIME encoded-word syntax uses the following - // form: =?charset?encoding?encoded-text?=. For more information, see RFC 2047 - // (http://tools.ietf.org/html/rfc2047). - // - // Source is a required field - Source *string `type:"string" required:"true"` - - // This parameter is used only for sending authorization. It is the ARN of the - // identity that is associated with the sending authorization policy that permits - // you to send for the email address specified in the Source parameter. - // - // For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) - // attaches a policy to it that authorizes you to send from user@example.com, - // then you would specify the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, - // and the Source to be user@example.com. - // - // For more information about sending authorization, see the Amazon SES Developer - // Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). - SourceArn *string `type:"string"` - - // A list of tags, in the form of name/value pairs, to apply to an email that - // you send using SendEmail. Tags correspond to characteristics of the email - // that you define, so that you can publish email sending events. - Tags []*MessageTag `type:"list"` -} - -// String returns the string representation -func (s SendEmailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendEmailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendEmailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendEmailInput"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.Message == nil { - invalidParams.Add(request.NewErrParamRequired("Message")) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.Message != nil { - if err := s.Message.Validate(); err != nil { - invalidParams.AddNested("Message", 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 - } - return nil -} - -// SetConfigurationSetName sets the ConfigurationSetName field's value. -func (s *SendEmailInput) SetConfigurationSetName(v string) *SendEmailInput { - s.ConfigurationSetName = &v - return s -} - -// SetDestination sets the Destination field's value. -func (s *SendEmailInput) SetDestination(v *Destination) *SendEmailInput { - s.Destination = v - return s -} - -// SetMessage sets the Message field's value. -func (s *SendEmailInput) SetMessage(v *Message) *SendEmailInput { - s.Message = v - return s -} - -// SetReplyToAddresses sets the ReplyToAddresses field's value. -func (s *SendEmailInput) SetReplyToAddresses(v []*string) *SendEmailInput { - s.ReplyToAddresses = v - return s -} - -// SetReturnPath sets the ReturnPath field's value. -func (s *SendEmailInput) SetReturnPath(v string) *SendEmailInput { - s.ReturnPath = &v - return s -} - -// SetReturnPathArn sets the ReturnPathArn field's value. -func (s *SendEmailInput) SetReturnPathArn(v string) *SendEmailInput { - s.ReturnPathArn = &v - return s -} - -// SetSource sets the Source field's value. -func (s *SendEmailInput) SetSource(v string) *SendEmailInput { - s.Source = &v - return s -} - -// SetSourceArn sets the SourceArn field's value. -func (s *SendEmailInput) SetSourceArn(v string) *SendEmailInput { - s.SourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SendEmailInput) SetTags(v []*MessageTag) *SendEmailInput { - s.Tags = v - return s -} - -// Represents a unique message ID. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendEmailResponse -type SendEmailOutput struct { - _ struct{} `type:"structure"` - - // The unique message identifier returned from the SendEmail action. - // - // MessageId is a required field - MessageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SendEmailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendEmailOutput) GoString() string { - return s.String() -} - -// SetMessageId sets the MessageId field's value. -func (s *SendEmailOutput) SetMessageId(v string) *SendEmailOutput { - s.MessageId = &v - return s -} - -// Represents a request to send a single raw email using Amazon SES. For more -// information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendRawEmailRequest -type SendRawEmailInput struct { - _ struct{} `type:"structure"` - - // The name of the configuration set to use when you send an email using SendRawEmail. - ConfigurationSetName *string `type:"string"` - - // A list of destinations for the message, consisting of To:, CC:, and BCC: - // addresses. - Destinations []*string `type:"list"` - - // This parameter is used only for sending authorization. It is the ARN of the - // identity that is associated with the sending authorization policy that permits - // you to specify a particular "From" address in the header of the raw email. - // - // Instead of using this parameter, you can use the X-header X-SES-FROM-ARN - // in the raw message of the email. If you use both the FromArn parameter and - // the corresponding X-header, Amazon SES uses the value of the FromArn parameter. - // - // For information about when to use this parameter, see the description of - // SendRawEmail in this guide, or see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html). - FromArn *string `type:"string"` - - // The raw text of the message. The client is responsible for ensuring the following: - // - // * Message must contain a header and a body, separated by a blank line. - // - // * All required header fields must be present. - // - // * Each part of a multipart MIME message must be formatted properly. - // - // * MIME content types must be among those supported by Amazon SES. For - // more information, go to the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types.html). - // - // * Must be base64-encoded. - // - // RawMessage is a required field - RawMessage *RawMessage `type:"structure" required:"true"` - - // This parameter is used only for sending authorization. It is the ARN of the - // identity that is associated with the sending authorization policy that permits - // you to use the email address specified in the ReturnPath parameter. - // - // For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) - // attaches a policy to it that authorizes you to use feedback@example.com, - // then you would specify the ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, - // and the ReturnPath to be feedback@example.com. - // - // Instead of using this parameter, you can use the X-header X-SES-RETURN-PATH-ARN - // in the raw message of the email. If you use both the ReturnPathArn parameter - // and the corresponding X-header, Amazon SES uses the value of the ReturnPathArn - // parameter. - // - // For information about when to use this parameter, see the description of - // SendRawEmail in this guide, or see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html). - ReturnPathArn *string `type:"string"` - - // The identity's email address. If you do not provide a value for this parameter, - // you must specify a "From" address in the raw text of the message. (You can - // also specify both.) - // - // By default, the string must be 7-bit ASCII. If the text must contain any - // other characters, then you must use MIME encoded-word syntax (RFC 2047) instead - // of a literal string. MIME encoded-word syntax uses the following form: =?charset?encoding?encoded-text?=. - // For more information, see RFC 2047 (http://tools.ietf.org/html/rfc2047). - // - // If you specify the Source parameter and have feedback forwarding enabled, - // then bounces and complaints will be sent to this email address. This takes - // precedence over any Return-Path header that you might include in the raw - // text of the message. - Source *string `type:"string"` - - // This parameter is used only for sending authorization. It is the ARN of the - // identity that is associated with the sending authorization policy that permits - // you to send for the email address specified in the Source parameter. - // - // For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) - // attaches a policy to it that authorizes you to send from user@example.com, - // then you would specify the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, - // and the Source to be user@example.com. - // - // Instead of using this parameter, you can use the X-header X-SES-SOURCE-ARN - // in the raw message of the email. If you use both the SourceArn parameter - // and the corresponding X-header, Amazon SES uses the value of the SourceArn - // parameter. - // - // For information about when to use this parameter, see the description of - // SendRawEmail in this guide, or see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html). - SourceArn *string `type:"string"` - - // A list of tags, in the form of name/value pairs, to apply to an email that - // you send using SendRawEmail. Tags correspond to characteristics of the email - // that you define, so that you can publish email sending events. - Tags []*MessageTag `type:"list"` -} - -// String returns the string representation -func (s SendRawEmailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendRawEmailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendRawEmailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendRawEmailInput"} - if s.RawMessage == nil { - invalidParams.Add(request.NewErrParamRequired("RawMessage")) - } - if s.RawMessage != nil { - if err := s.RawMessage.Validate(); err != nil { - invalidParams.AddNested("RawMessage", 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 - } - return nil -} - -// SetConfigurationSetName sets the ConfigurationSetName field's value. -func (s *SendRawEmailInput) SetConfigurationSetName(v string) *SendRawEmailInput { - s.ConfigurationSetName = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *SendRawEmailInput) SetDestinations(v []*string) *SendRawEmailInput { - s.Destinations = v - return s -} - -// SetFromArn sets the FromArn field's value. -func (s *SendRawEmailInput) SetFromArn(v string) *SendRawEmailInput { - s.FromArn = &v - return s -} - -// SetRawMessage sets the RawMessage field's value. -func (s *SendRawEmailInput) SetRawMessage(v *RawMessage) *SendRawEmailInput { - s.RawMessage = v - return s -} - -// SetReturnPathArn sets the ReturnPathArn field's value. -func (s *SendRawEmailInput) SetReturnPathArn(v string) *SendRawEmailInput { - s.ReturnPathArn = &v - return s -} - -// SetSource sets the Source field's value. -func (s *SendRawEmailInput) SetSource(v string) *SendRawEmailInput { - s.Source = &v - return s -} - -// SetSourceArn sets the SourceArn field's value. -func (s *SendRawEmailInput) SetSourceArn(v string) *SendRawEmailInput { - s.SourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SendRawEmailInput) SetTags(v []*MessageTag) *SendRawEmailInput { - s.Tags = v - return s -} - -// Represents a unique message ID. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SendRawEmailResponse -type SendRawEmailOutput struct { - _ struct{} `type:"structure"` - - // The unique message identifier returned from the SendRawEmail action. - // - // MessageId is a required field - MessageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SendRawEmailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendRawEmailOutput) GoString() string { - return s.String() -} - -// SetMessageId sets the MessageId field's value. -func (s *SendRawEmailOutput) SetMessageId(v string) *SendRawEmailOutput { - s.MessageId = &v - return s -} - -// Represents a request to set a receipt rule set as the active receipt rule -// set. You use receipt rule sets to receive email with Amazon SES. For more -// information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetActiveReceiptRuleSetRequest -type SetActiveReceiptRuleSetInput struct { - _ struct{} `type:"structure"` - - // The name of the receipt rule set to make active. Setting this value to null - // disables all email receiving. - RuleSetName *string `type:"string"` -} - -// String returns the string representation -func (s SetActiveReceiptRuleSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetActiveReceiptRuleSetInput) GoString() string { - return s.String() -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *SetActiveReceiptRuleSetInput) SetRuleSetName(v string) *SetActiveReceiptRuleSetInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetActiveReceiptRuleSetResponse -type SetActiveReceiptRuleSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetActiveReceiptRuleSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetActiveReceiptRuleSetOutput) GoString() string { - return s.String() -} - -// Represents a request to enable or disable Amazon SES Easy DKIM signing for -// an identity. For more information about setting up Easy DKIM, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityDkimEnabledRequest -type SetIdentityDkimEnabledInput struct { - _ struct{} `type:"structure"` - - // Sets whether DKIM signing is enabled for an identity. Set to true to enable - // DKIM signing for this identity; false to disable it. - // - // DkimEnabled is a required field - DkimEnabled *bool `type:"boolean" required:"true"` - - // The identity for which DKIM signing should be enabled or disabled. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetIdentityDkimEnabledInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityDkimEnabledInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetIdentityDkimEnabledInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetIdentityDkimEnabledInput"} - if s.DkimEnabled == nil { - invalidParams.Add(request.NewErrParamRequired("DkimEnabled")) - } - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDkimEnabled sets the DkimEnabled field's value. -func (s *SetIdentityDkimEnabledInput) SetDkimEnabled(v bool) *SetIdentityDkimEnabledInput { - s.DkimEnabled = &v - return s -} - -// SetIdentity sets the Identity field's value. -func (s *SetIdentityDkimEnabledInput) SetIdentity(v string) *SetIdentityDkimEnabledInput { - s.Identity = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityDkimEnabledResponse -type SetIdentityDkimEnabledOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetIdentityDkimEnabledOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityDkimEnabledOutput) GoString() string { - return s.String() -} - -// Represents a request to enable or disable whether Amazon SES forwards you -// bounce and complaint notifications through email. For information about email -// feedback forwarding, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications-via-email.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityFeedbackForwardingEnabledRequest -type SetIdentityFeedbackForwardingEnabledInput struct { - _ struct{} `type:"structure"` - - // Sets whether Amazon SES will forward bounce and complaint notifications as - // email. true specifies that Amazon SES will forward bounce and complaint notifications - // as email, in addition to any Amazon SNS topic publishing otherwise specified. - // false specifies that Amazon SES will publish bounce and complaint notifications - // only through Amazon SNS. This value can only be set to false when Amazon - // SNS topics are set for both Bounce and Complaint notification types. - // - // ForwardingEnabled is a required field - ForwardingEnabled *bool `type:"boolean" required:"true"` - - // The identity for which to set bounce and complaint notification forwarding. - // Examples: user@example.com, example.com. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetIdentityFeedbackForwardingEnabledInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityFeedbackForwardingEnabledInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetIdentityFeedbackForwardingEnabledInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetIdentityFeedbackForwardingEnabledInput"} - if s.ForwardingEnabled == nil { - invalidParams.Add(request.NewErrParamRequired("ForwardingEnabled")) - } - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetForwardingEnabled sets the ForwardingEnabled field's value. -func (s *SetIdentityFeedbackForwardingEnabledInput) SetForwardingEnabled(v bool) *SetIdentityFeedbackForwardingEnabledInput { - s.ForwardingEnabled = &v - return s -} - -// SetIdentity sets the Identity field's value. -func (s *SetIdentityFeedbackForwardingEnabledInput) SetIdentity(v string) *SetIdentityFeedbackForwardingEnabledInput { - s.Identity = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityFeedbackForwardingEnabledResponse -type SetIdentityFeedbackForwardingEnabledOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetIdentityFeedbackForwardingEnabledOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityFeedbackForwardingEnabledOutput) GoString() string { - return s.String() -} - -// Represents a request to set whether Amazon SES includes the original email -// headers in the Amazon SNS notifications of a specified type. For information -// about notifications, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications-via-sns.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityHeadersInNotificationsEnabledRequest -type SetIdentityHeadersInNotificationsEnabledInput struct { - _ struct{} `type:"structure"` - - // Sets whether Amazon SES includes the original email headers in Amazon SNS - // notifications of the specified notification type. A value of true specifies - // that Amazon SES will include headers in notifications, and a value of false - // specifies that Amazon SES will not include headers in notifications. - // - // This value can only be set when NotificationType is already set to use a - // particular Amazon SNS topic. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // The identity for which to enable or disable headers in notifications. Examples: - // user@example.com, example.com. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` - - // The notification type for which to enable or disable headers in notifications. - // - // NotificationType is a required field - NotificationType *string `type:"string" required:"true" enum:"NotificationType"` -} - -// String returns the string representation -func (s SetIdentityHeadersInNotificationsEnabledInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityHeadersInNotificationsEnabledInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetIdentityHeadersInNotificationsEnabledInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetIdentityHeadersInNotificationsEnabledInput"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - if s.NotificationType == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *SetIdentityHeadersInNotificationsEnabledInput) SetEnabled(v bool) *SetIdentityHeadersInNotificationsEnabledInput { - s.Enabled = &v - return s -} - -// SetIdentity sets the Identity field's value. -func (s *SetIdentityHeadersInNotificationsEnabledInput) SetIdentity(v string) *SetIdentityHeadersInNotificationsEnabledInput { - s.Identity = &v - return s -} - -// SetNotificationType sets the NotificationType field's value. -func (s *SetIdentityHeadersInNotificationsEnabledInput) SetNotificationType(v string) *SetIdentityHeadersInNotificationsEnabledInput { - s.NotificationType = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityHeadersInNotificationsEnabledResponse -type SetIdentityHeadersInNotificationsEnabledOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetIdentityHeadersInNotificationsEnabledOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityHeadersInNotificationsEnabledOutput) GoString() string { - return s.String() -} - -// Represents a request to enable or disable the Amazon SES custom MAIL FROM -// domain setup for a verified identity. For information about using a custom -// MAIL FROM domain, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityMailFromDomainRequest -type SetIdentityMailFromDomainInput struct { - _ struct{} `type:"structure"` - - // The action that you want Amazon SES to take if it cannot successfully read - // the required MX record when you send an email. If you choose UseDefaultValue, - // Amazon SES will use amazonses.com (or a subdomain of that) as the MAIL FROM - // domain. If you choose RejectMessage, Amazon SES will return a MailFromDomainNotVerified - // error and not send the email. - // - // The action specified in BehaviorOnMXFailure is taken when the custom MAIL - // FROM domain setup is in the Pending, Failed, and TemporaryFailure states. - BehaviorOnMXFailure *string `type:"string" enum:"BehaviorOnMXFailure"` - - // The verified identity for which you want to enable or disable the specified - // custom MAIL FROM domain. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` - - // The custom MAIL FROM domain that you want the verified identity to use. The - // MAIL FROM domain must 1) be a subdomain of the verified identity, 2) not - // be used in a "From" address if the MAIL FROM domain is the destination of - // email feedback forwarding (for more information, see the Amazon SES Developer - // Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from.html)), - // and 3) not be used to receive emails. A value of null disables the custom - // MAIL FROM setting for the identity. - MailFromDomain *string `type:"string"` -} - -// String returns the string representation -func (s SetIdentityMailFromDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityMailFromDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetIdentityMailFromDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetIdentityMailFromDomainInput"} - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBehaviorOnMXFailure sets the BehaviorOnMXFailure field's value. -func (s *SetIdentityMailFromDomainInput) SetBehaviorOnMXFailure(v string) *SetIdentityMailFromDomainInput { - s.BehaviorOnMXFailure = &v - return s -} - -// SetIdentity sets the Identity field's value. -func (s *SetIdentityMailFromDomainInput) SetIdentity(v string) *SetIdentityMailFromDomainInput { - s.Identity = &v - return s -} - -// SetMailFromDomain sets the MailFromDomain field's value. -func (s *SetIdentityMailFromDomainInput) SetMailFromDomain(v string) *SetIdentityMailFromDomainInput { - s.MailFromDomain = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityMailFromDomainResponse -type SetIdentityMailFromDomainOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetIdentityMailFromDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityMailFromDomainOutput) GoString() string { - return s.String() -} - -// Represents a request to specify the Amazon SNS topic to which Amazon SES -// will publish bounce, complaint, or delivery notifications for emails sent -// with that identity as the Source. For information about Amazon SES notifications, -// see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications-via-sns.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityNotificationTopicRequest -type SetIdentityNotificationTopicInput struct { - _ struct{} `type:"structure"` - - // The identity for which the Amazon SNS topic will be set. You can specify - // an identity by using its name or by using its Amazon Resource Name (ARN). - // Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` - - // The type of notifications that will be published to the specified Amazon - // SNS topic. - // - // NotificationType is a required field - NotificationType *string `type:"string" required:"true" enum:"NotificationType"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic. If the parameter - // is omitted from the request or a null value is passed, SnsTopic is cleared - // and publishing is disabled. - SnsTopic *string `type:"string"` -} - -// String returns the string representation -func (s SetIdentityNotificationTopicInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityNotificationTopicInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetIdentityNotificationTopicInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetIdentityNotificationTopicInput"} - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) - } - if s.NotificationType == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentity sets the Identity field's value. -func (s *SetIdentityNotificationTopicInput) SetIdentity(v string) *SetIdentityNotificationTopicInput { - s.Identity = &v - return s -} - -// SetNotificationType sets the NotificationType field's value. -func (s *SetIdentityNotificationTopicInput) SetNotificationType(v string) *SetIdentityNotificationTopicInput { - s.NotificationType = &v - return s -} - -// SetSnsTopic sets the SnsTopic field's value. -func (s *SetIdentityNotificationTopicInput) SetSnsTopic(v string) *SetIdentityNotificationTopicInput { - s.SnsTopic = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetIdentityNotificationTopicResponse -type SetIdentityNotificationTopicOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetIdentityNotificationTopicOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetIdentityNotificationTopicOutput) GoString() string { - return s.String() -} - -// Represents a request to set the position of a receipt rule in a receipt rule -// set. You use receipt rule sets to receive email with Amazon SES. For more -// information, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetReceiptRulePositionRequest -type SetReceiptRulePositionInput struct { - _ struct{} `type:"structure"` - - // The name of the receipt rule after which to place the specified receipt rule. - After *string `type:"string"` - - // The name of the receipt rule to reposition. - // - // RuleName is a required field - RuleName *string `type:"string" required:"true"` - - // The name of the receipt rule set that contains the receipt rule to reposition. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetReceiptRulePositionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetReceiptRulePositionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetReceiptRulePositionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetReceiptRulePositionInput"} - if s.RuleName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleName")) - } - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAfter sets the After field's value. -func (s *SetReceiptRulePositionInput) SetAfter(v string) *SetReceiptRulePositionInput { - s.After = &v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *SetReceiptRulePositionInput) SetRuleName(v string) *SetReceiptRulePositionInput { - s.RuleName = &v - return s -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *SetReceiptRulePositionInput) SetRuleSetName(v string) *SetReceiptRulePositionInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/SetReceiptRulePositionResponse -type SetReceiptRulePositionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetReceiptRulePositionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetReceiptRulePositionOutput) GoString() string { - return s.String() -} - -// When included in a receipt rule, this action terminates the evaluation of -// the receipt rule set and, optionally, publishes a notification to Amazon -// Simple Notification Service (Amazon SNS). -// -// For information about setting a stop action in a receipt rule, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-stop.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/StopAction -type StopAction struct { - _ struct{} `type:"structure"` - - // The scope to which the Stop action applies. That is, what is being stopped. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"StopScope"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the - // stop action is taken. An example of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic. - // For more information about Amazon SNS topics, see the Amazon SNS Developer - // Guide (http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html). - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s StopAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopAction"} - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetScope sets the Scope field's value. -func (s *StopAction) SetScope(v string) *StopAction { - s.Scope = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *StopAction) SetTopicArn(v string) *StopAction { - s.TopicArn = &v - return s -} - -// Represents a request to update the event destination of a configuration set. -// Configuration sets enable you to publish email sending events. For information -// about using configuration sets, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateConfigurationSetEventDestinationRequest -type UpdateConfigurationSetEventDestinationInput struct { - _ struct{} `type:"structure"` - - // The name of the configuration set that you want to update. - // - // ConfigurationSetName is a required field - ConfigurationSetName *string `type:"string" required:"true"` - - // The event destination object that you want to apply to the specified configuration - // set. - // - // EventDestination is a required field - EventDestination *EventDestination `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateConfigurationSetEventDestinationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateConfigurationSetEventDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateConfigurationSetEventDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateConfigurationSetEventDestinationInput"} - if s.ConfigurationSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationSetName")) - } - if s.EventDestination == nil { - invalidParams.Add(request.NewErrParamRequired("EventDestination")) - } - if s.EventDestination != nil { - if err := s.EventDestination.Validate(); err != nil { - invalidParams.AddNested("EventDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationSetName sets the ConfigurationSetName field's value. -func (s *UpdateConfigurationSetEventDestinationInput) SetConfigurationSetName(v string) *UpdateConfigurationSetEventDestinationInput { - s.ConfigurationSetName = &v - return s -} - -// SetEventDestination sets the EventDestination field's value. -func (s *UpdateConfigurationSetEventDestinationInput) SetEventDestination(v *EventDestination) *UpdateConfigurationSetEventDestinationInput { - s.EventDestination = v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateConfigurationSetEventDestinationResponse -type UpdateConfigurationSetEventDestinationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateConfigurationSetEventDestinationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateConfigurationSetEventDestinationOutput) GoString() string { - return s.String() -} - -// Represents a request to update a receipt rule. You use receipt rules to receive -// email with Amazon SES. For more information, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateReceiptRuleRequest -type UpdateReceiptRuleInput struct { - _ struct{} `type:"structure"` - - // A data structure that contains the updated receipt rule information. - // - // Rule is a required field - Rule *ReceiptRule `type:"structure" required:"true"` - - // The name of the receipt rule set to which the receipt rule belongs. - // - // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateReceiptRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateReceiptRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateReceiptRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateReceiptRuleInput"} - if s.Rule == nil { - invalidParams.Add(request.NewErrParamRequired("Rule")) - } - if s.RuleSetName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleSetName")) - } - if s.Rule != nil { - if err := s.Rule.Validate(); err != nil { - invalidParams.AddNested("Rule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRule sets the Rule field's value. -func (s *UpdateReceiptRuleInput) SetRule(v *ReceiptRule) *UpdateReceiptRuleInput { - s.Rule = v - return s -} - -// SetRuleSetName sets the RuleSetName field's value. -func (s *UpdateReceiptRuleInput) SetRuleSetName(v string) *UpdateReceiptRuleInput { - s.RuleSetName = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/UpdateReceiptRuleResponse -type UpdateReceiptRuleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateReceiptRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateReceiptRuleOutput) GoString() string { - return s.String() -} - -// Represents a request to generate the CNAME records needed to set up Easy -// DKIM with Amazon SES. For more information about setting up Easy DKIM, see -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainDkimRequest -type VerifyDomainDkimInput struct { - _ struct{} `type:"structure"` - - // The name of the domain to be verified for Easy DKIM signing. - // - // Domain is a required field - Domain *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s VerifyDomainDkimInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyDomainDkimInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyDomainDkimInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyDomainDkimInput"} - if s.Domain == nil { - invalidParams.Add(request.NewErrParamRequired("Domain")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomain sets the Domain field's value. -func (s *VerifyDomainDkimInput) SetDomain(v string) *VerifyDomainDkimInput { - s.Domain = &v - return s -} - -// Returns CNAME records that you must publish to the DNS server of your domain -// to set up Easy DKIM with Amazon SES. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainDkimResponse -type VerifyDomainDkimOutput struct { - _ struct{} `type:"structure"` - - // A set of character strings that represent the domain's identity. If the identity - // is an email address, the tokens represent the domain of that address. - // - // Using these tokens, you will need to create DNS CNAME records that point - // to DKIM public keys hosted by Amazon SES. Amazon Web Services will eventually - // detect that you have updated your DNS records; this detection process may - // take up to 72 hours. Upon successful detection, Amazon SES will be able to - // DKIM-sign emails originating from that domain. - // - // For more information about creating DNS records using DKIM tokens, go to - // the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim-dns-records.html). - // - // DkimTokens is a required field - DkimTokens []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s VerifyDomainDkimOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyDomainDkimOutput) GoString() string { - return s.String() -} - -// SetDkimTokens sets the DkimTokens field's value. -func (s *VerifyDomainDkimOutput) SetDkimTokens(v []*string) *VerifyDomainDkimOutput { - s.DkimTokens = v - return s -} - -// Represents a request to begin Amazon SES domain verification and to generate -// the TXT records that you must publish to the DNS server of your domain to -// complete the verification. For information about domain verification, see -// the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainIdentityRequest -type VerifyDomainIdentityInput struct { - _ struct{} `type:"structure"` - - // The domain to be verified. - // - // Domain is a required field - Domain *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s VerifyDomainIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyDomainIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyDomainIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyDomainIdentityInput"} - if s.Domain == nil { - invalidParams.Add(request.NewErrParamRequired("Domain")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomain sets the Domain field's value. -func (s *VerifyDomainIdentityInput) SetDomain(v string) *VerifyDomainIdentityInput { - s.Domain = &v - return s -} - -// Returns a TXT record that you must publish to the DNS server of your domain -// to complete domain verification with Amazon SES. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyDomainIdentityResponse -type VerifyDomainIdentityOutput struct { - _ struct{} `type:"structure"` - - // A TXT record that must be placed in the DNS settings for the domain, in order - // to complete domain verification. - // - // VerificationToken is a required field - VerificationToken *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s VerifyDomainIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyDomainIdentityOutput) GoString() string { - return s.String() -} - -// SetVerificationToken sets the VerificationToken field's value. -func (s *VerifyDomainIdentityOutput) SetVerificationToken(v string) *VerifyDomainIdentityOutput { - s.VerificationToken = &v - return s -} - -// Represents a request to begin email address verification with Amazon SES. -// For information about email address verification, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailAddressRequest -type VerifyEmailAddressInput struct { - _ struct{} `type:"structure"` - - // The email address to be verified. - // - // EmailAddress is a required field - EmailAddress *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s VerifyEmailAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyEmailAddressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyEmailAddressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyEmailAddressInput"} - if s.EmailAddress == nil { - invalidParams.Add(request.NewErrParamRequired("EmailAddress")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEmailAddress sets the EmailAddress field's value. -func (s *VerifyEmailAddressInput) SetEmailAddress(v string) *VerifyEmailAddressInput { - s.EmailAddress = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailAddressOutput -type VerifyEmailAddressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s VerifyEmailAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyEmailAddressOutput) GoString() string { - return s.String() -} - -// Represents a request to begin email address verification with Amazon SES. -// For information about email address verification, see the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailIdentityRequest -type VerifyEmailIdentityInput struct { - _ struct{} `type:"structure"` - - // The email address to be verified. - // - // EmailAddress is a required field - EmailAddress *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s VerifyEmailIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyEmailIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyEmailIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyEmailIdentityInput"} - if s.EmailAddress == nil { - invalidParams.Add(request.NewErrParamRequired("EmailAddress")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEmailAddress sets the EmailAddress field's value. -func (s *VerifyEmailIdentityInput) SetEmailAddress(v string) *VerifyEmailIdentityInput { - s.EmailAddress = &v - return s -} - -// An empty element returned on a successful request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/VerifyEmailIdentityResponse -type VerifyEmailIdentityOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s VerifyEmailIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VerifyEmailIdentityOutput) GoString() string { - return s.String() -} - -// When included in a receipt rule, this action calls Amazon WorkMail and, optionally, -// publishes a notification to Amazon Simple Notification Service (Amazon SNS). -// You will typically not use this action directly because Amazon WorkMail adds -// the rule automatically during its setup procedure. -// -// For information using a receipt rule to call Amazon WorkMail, see the Amazon -// SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-workmail.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/WorkmailAction -type WorkmailAction struct { - _ struct{} `type:"structure"` - - // The ARN of the Amazon WorkMail organization. An example of an Amazon WorkMail - // organization ARN is arn:aws:workmail:us-west-2:123456789012:organization/m-68755160c4cb4e29a2b2f8fb58f359d7. - // For information about Amazon WorkMail organizations, see the Amazon WorkMail - // Administrator Guide (http://docs.aws.amazon.com/workmail/latest/adminguide/organizations_overview.html). - // - // OrganizationArn is a required field - OrganizationArn *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the - // WorkMail action is called. An example of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic. - // For more information about Amazon SNS topics, see the Amazon SNS Developer - // Guide (http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html). - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s WorkmailAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WorkmailAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WorkmailAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WorkmailAction"} - if s.OrganizationArn == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOrganizationArn sets the OrganizationArn field's value. -func (s *WorkmailAction) SetOrganizationArn(v string) *WorkmailAction { - s.OrganizationArn = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *WorkmailAction) SetTopicArn(v string) *WorkmailAction { - s.TopicArn = &v - return s -} - -const ( - // BehaviorOnMXFailureUseDefaultValue is a BehaviorOnMXFailure enum value - BehaviorOnMXFailureUseDefaultValue = "UseDefaultValue" - - // BehaviorOnMXFailureRejectMessage is a BehaviorOnMXFailure enum value - BehaviorOnMXFailureRejectMessage = "RejectMessage" -) - -const ( - // BounceTypeDoesNotExist is a BounceType enum value - BounceTypeDoesNotExist = "DoesNotExist" - - // BounceTypeMessageTooLarge is a BounceType enum value - BounceTypeMessageTooLarge = "MessageTooLarge" - - // BounceTypeExceededQuota is a BounceType enum value - BounceTypeExceededQuota = "ExceededQuota" - - // BounceTypeContentRejected is a BounceType enum value - BounceTypeContentRejected = "ContentRejected" - - // BounceTypeUndefined is a BounceType enum value - BounceTypeUndefined = "Undefined" - - // BounceTypeTemporaryFailure is a BounceType enum value - BounceTypeTemporaryFailure = "TemporaryFailure" -) - -const ( - // ConfigurationSetAttributeEventDestinations is a ConfigurationSetAttribute enum value - ConfigurationSetAttributeEventDestinations = "eventDestinations" -) - -const ( - // CustomMailFromStatusPending is a CustomMailFromStatus enum value - CustomMailFromStatusPending = "Pending" - - // CustomMailFromStatusSuccess is a CustomMailFromStatus enum value - CustomMailFromStatusSuccess = "Success" - - // CustomMailFromStatusFailed is a CustomMailFromStatus enum value - CustomMailFromStatusFailed = "Failed" - - // CustomMailFromStatusTemporaryFailure is a CustomMailFromStatus enum value - CustomMailFromStatusTemporaryFailure = "TemporaryFailure" -) - -const ( - // DimensionValueSourceMessageTag is a DimensionValueSource enum value - DimensionValueSourceMessageTag = "messageTag" - - // DimensionValueSourceEmailHeader is a DimensionValueSource enum value - DimensionValueSourceEmailHeader = "emailHeader" -) - -const ( - // DsnActionFailed is a DsnAction enum value - DsnActionFailed = "failed" - - // DsnActionDelayed is a DsnAction enum value - DsnActionDelayed = "delayed" - - // DsnActionDelivered is a DsnAction enum value - DsnActionDelivered = "delivered" - - // DsnActionRelayed is a DsnAction enum value - DsnActionRelayed = "relayed" - - // DsnActionExpanded is a DsnAction enum value - DsnActionExpanded = "expanded" -) - -const ( - // EventTypeSend is a EventType enum value - EventTypeSend = "send" - - // EventTypeReject is a EventType enum value - EventTypeReject = "reject" - - // EventTypeBounce is a EventType enum value - EventTypeBounce = "bounce" - - // EventTypeComplaint is a EventType enum value - EventTypeComplaint = "complaint" - - // EventTypeDelivery is a EventType enum value - EventTypeDelivery = "delivery" -) - -const ( - // IdentityTypeEmailAddress is a IdentityType enum value - IdentityTypeEmailAddress = "EmailAddress" - - // IdentityTypeDomain is a IdentityType enum value - IdentityTypeDomain = "Domain" -) - -const ( - // InvocationTypeEvent is a InvocationType enum value - InvocationTypeEvent = "Event" - - // InvocationTypeRequestResponse is a InvocationType enum value - InvocationTypeRequestResponse = "RequestResponse" -) - -const ( - // NotificationTypeBounce is a NotificationType enum value - NotificationTypeBounce = "Bounce" - - // NotificationTypeComplaint is a NotificationType enum value - NotificationTypeComplaint = "Complaint" - - // NotificationTypeDelivery is a NotificationType enum value - NotificationTypeDelivery = "Delivery" -) - -const ( - // ReceiptFilterPolicyBlock is a ReceiptFilterPolicy enum value - ReceiptFilterPolicyBlock = "Block" - - // ReceiptFilterPolicyAllow is a ReceiptFilterPolicy enum value - ReceiptFilterPolicyAllow = "Allow" -) - -const ( - // SNSActionEncodingUtf8 is a SNSActionEncoding enum value - SNSActionEncodingUtf8 = "UTF-8" - - // SNSActionEncodingBase64 is a SNSActionEncoding enum value - SNSActionEncodingBase64 = "Base64" -) - -const ( - // StopScopeRuleSet is a StopScope enum value - StopScopeRuleSet = "RuleSet" -) - -const ( - // TlsPolicyRequire is a TlsPolicy enum value - TlsPolicyRequire = "Require" - - // TlsPolicyOptional is a TlsPolicy enum value - TlsPolicyOptional = "Optional" -) - -const ( - // VerificationStatusPending is a VerificationStatus enum value - VerificationStatusPending = "Pending" - - // VerificationStatusSuccess is a VerificationStatus enum value - VerificationStatusSuccess = "Success" - - // VerificationStatusFailed is a VerificationStatus enum value - VerificationStatusFailed = "Failed" - - // VerificationStatusTemporaryFailure is a VerificationStatus enum value - VerificationStatusTemporaryFailure = "TemporaryFailure" - - // VerificationStatusNotStarted is a VerificationStatus enum value - VerificationStatusNotStarted = "NotStarted" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ses/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ses/errors.go deleted file mode 100644 index 704f87e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/errors.go +++ /dev/null @@ -1,133 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ses - -const ( - - // ErrCodeAlreadyExistsException for service response error code - // "AlreadyExists". - // - // Indicates that a resource could not be created because of a naming conflict. - ErrCodeAlreadyExistsException = "AlreadyExists" - - // ErrCodeCannotDeleteException for service response error code - // "CannotDelete". - // - // Indicates that the delete operation could not be completed. - ErrCodeCannotDeleteException = "CannotDelete" - - // ErrCodeConfigurationSetAlreadyExistsException for service response error code - // "ConfigurationSetAlreadyExists". - // - // Indicates that the configuration set could not be created because of a naming - // conflict. - ErrCodeConfigurationSetAlreadyExistsException = "ConfigurationSetAlreadyExists" - - // ErrCodeConfigurationSetDoesNotExistException for service response error code - // "ConfigurationSetDoesNotExist". - // - // Indicates that the configuration set does not exist. - ErrCodeConfigurationSetDoesNotExistException = "ConfigurationSetDoesNotExist" - - // ErrCodeEventDestinationAlreadyExistsException for service response error code - // "EventDestinationAlreadyExists". - // - // Indicates that the event destination could not be created because of a naming - // conflict. - ErrCodeEventDestinationAlreadyExistsException = "EventDestinationAlreadyExists" - - // ErrCodeEventDestinationDoesNotExistException for service response error code - // "EventDestinationDoesNotExist". - // - // Indicates that the event destination does not exist. - ErrCodeEventDestinationDoesNotExistException = "EventDestinationDoesNotExist" - - // ErrCodeInvalidCloudWatchDestinationException for service response error code - // "InvalidCloudWatchDestination". - // - // Indicates that the Amazon CloudWatch destination is invalid. See the error - // message for details. - ErrCodeInvalidCloudWatchDestinationException = "InvalidCloudWatchDestination" - - // ErrCodeInvalidConfigurationSetException for service response error code - // "InvalidConfigurationSet". - // - // Indicates that the configuration set is invalid. See the error message for - // details. - ErrCodeInvalidConfigurationSetException = "InvalidConfigurationSet" - - // ErrCodeInvalidFirehoseDestinationException for service response error code - // "InvalidFirehoseDestination". - // - // Indicates that the Amazon Kinesis Firehose destination is invalid. See the - // error message for details. - ErrCodeInvalidFirehoseDestinationException = "InvalidFirehoseDestination" - - // ErrCodeInvalidLambdaFunctionException for service response error code - // "InvalidLambdaFunction". - // - // Indicates that the provided AWS Lambda function is invalid, or that Amazon - // SES could not execute the provided function, possibly due to permissions - // issues. For information about giving permissions, see the Amazon SES Developer - // Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). - ErrCodeInvalidLambdaFunctionException = "InvalidLambdaFunction" - - // ErrCodeInvalidPolicyException for service response error code - // "InvalidPolicy". - // - // Indicates that the provided policy is invalid. Check the error stack for - // more information about what caused the error. - ErrCodeInvalidPolicyException = "InvalidPolicy" - - // ErrCodeInvalidS3ConfigurationException for service response error code - // "InvalidS3Configuration". - // - // Indicates that the provided Amazon S3 bucket or AWS KMS encryption key is - // invalid, or that Amazon SES could not publish to the bucket, possibly due - // to permissions issues. For information about giving permissions, see the - // Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). - ErrCodeInvalidS3ConfigurationException = "InvalidS3Configuration" - - // ErrCodeInvalidSnsTopicException for service response error code - // "InvalidSnsTopic". - // - // Indicates that the provided Amazon SNS topic is invalid, or that Amazon SES - // could not publish to the topic, possibly due to permissions issues. For information - // about giving permissions, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html). - ErrCodeInvalidSnsTopicException = "InvalidSnsTopic" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceeded". - // - // Indicates that a resource could not be created because of service limits. - // For a list of Amazon SES limits, see the Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). - ErrCodeLimitExceededException = "LimitExceeded" - - // ErrCodeMailFromDomainNotVerifiedException for service response error code - // "MailFromDomainNotVerifiedException". - // - // Indicates that the message could not be sent because Amazon SES could not - // read the MX record required to use the specified MAIL FROM domain. For information - // about editing the custom MAIL FROM domain settings for an identity, see the - // Amazon SES Developer Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from-edit.html). - ErrCodeMailFromDomainNotVerifiedException = "MailFromDomainNotVerifiedException" - - // ErrCodeMessageRejected for service response error code - // "MessageRejected". - // - // Indicates that the action failed, and the message could not be sent. Check - // the error stack for more information about what caused the error. - ErrCodeMessageRejected = "MessageRejected" - - // ErrCodeRuleDoesNotExistException for service response error code - // "RuleDoesNotExist". - // - // Indicates that the provided receipt rule does not exist. - ErrCodeRuleDoesNotExistException = "RuleDoesNotExist" - - // ErrCodeRuleSetDoesNotExistException for service response error code - // "RuleSetDoesNotExist". - // - // Indicates that the provided receipt rule set does not exist. - ErrCodeRuleSetDoesNotExistException = "RuleSetDoesNotExist" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ses/service.go b/vendor/github.com/aws/aws-sdk-go/service/ses/service.go deleted file mode 100644 index 187c1d6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/service.go +++ /dev/null @@ -1,100 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ses - -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" -) - -// This is the API Reference for Amazon Simple Email Service (Amazon SES). This -// documentation is intended to be used in conjunction with the Amazon SES Developer -// Guide (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/Welcome.html). -// -// For a list of Amazon SES endpoints to use in service requests, see Regions -// and Amazon SES (http://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html) -// in the Amazon SES 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/email-2010-12-01 -type SES 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 = "email" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the SES 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 SES client from just a session. -// svc := ses.New(mySession) -// -// // Create a SES client with additional configuration -// svc := ses.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SES { - 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) *SES { - if len(signingName) == 0 { - signingName = "ses" - } - svc := &SES{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2010-12-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SES operation and runs any -// custom request initialization. -func (c *SES) 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/ses/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ses/waiters.go deleted file mode 100644 index bf79344..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/waiters.go +++ /dev/null @@ -1,34 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ses - -import ( - "github.com/aws/aws-sdk-go/private/waiter" -) - -// WaitUntilIdentityExists uses the Amazon SES API operation -// GetIdentityVerificationAttributes 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 *SES) WaitUntilIdentityExists(input *GetIdentityVerificationAttributesInput) error { - waiterCfg := waiter.Config{ - Operation: "GetIdentityVerificationAttributes", - Delay: 3, - MaxAttempts: 20, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "VerificationAttributes.*.VerificationStatus", - Expected: "Success", - }, - }, - } - - w := waiter.Waiter{ - Client: c, - Input: input, - Config: waiterCfg, - } - return w.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go b/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go deleted file mode 100644 index c6b207e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go +++ /dev/null @@ -1,4070 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package sfn provides a client for AWS Step Functions. -package sfn - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opCreateActivity = "CreateActivity" - -// CreateActivityRequest generates a "aws/request.Request" representing the -// client's request for the CreateActivity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateActivity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateActivity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateActivityRequest method. -// req, resp := client.CreateActivityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateActivity -func (c *SFN) CreateActivityRequest(input *CreateActivityInput) (req *request.Request, output *CreateActivityOutput) { - op := &request.Operation{ - Name: opCreateActivity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateActivityInput{} - } - - output = &CreateActivityOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateActivity API operation for AWS Step Functions. -// -// Creates an activity. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation CreateActivity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeActivityLimitExceeded "ActivityLimitExceeded" -// The maximum number of activities has been reached. Existing activities must -// be deleted before a new activity can be created. -// -// * ErrCodeInvalidName "InvalidName" -// The provided name is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateActivity -func (c *SFN) CreateActivity(input *CreateActivityInput) (*CreateActivityOutput, error) { - req, out := c.CreateActivityRequest(input) - err := req.Send() - return out, err -} - -const opCreateStateMachine = "CreateStateMachine" - -// CreateStateMachineRequest generates a "aws/request.Request" representing the -// client's request for the CreateStateMachine operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateStateMachine for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateStateMachine method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateStateMachineRequest method. -// req, resp := client.CreateStateMachineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateStateMachine -func (c *SFN) CreateStateMachineRequest(input *CreateStateMachineInput) (req *request.Request, output *CreateStateMachineOutput) { - op := &request.Operation{ - Name: opCreateStateMachine, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateStateMachineInput{} - } - - output = &CreateStateMachineOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateStateMachine API operation for AWS Step Functions. -// -// Creates a state machine. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation CreateStateMachine for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// * ErrCodeInvalidDefinition "InvalidDefinition" -// The provided Amazon States Language definition is invalid. -// -// * ErrCodeInvalidName "InvalidName" -// The provided name is invalid. -// -// * ErrCodeStateMachineAlreadyExists "StateMachineAlreadyExists" -// A state machine with the same name but a different definition or role ARN -// already exists. -// -// * ErrCodeStateMachineDeleting "StateMachineDeleting" -// The specified state machine is being deleted. -// -// * ErrCodeStateMachineLimitExceeded "StateMachineLimitExceeded" -// The maximum number of state machines has been reached. Existing state machines -// must be deleted before a new state machine can be created. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateStateMachine -func (c *SFN) CreateStateMachine(input *CreateStateMachineInput) (*CreateStateMachineOutput, error) { - req, out := c.CreateStateMachineRequest(input) - err := req.Send() - return out, err -} - -const opDeleteActivity = "DeleteActivity" - -// DeleteActivityRequest generates a "aws/request.Request" representing the -// client's request for the DeleteActivity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteActivity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteActivity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteActivityRequest method. -// req, resp := client.DeleteActivityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteActivity -func (c *SFN) DeleteActivityRequest(input *DeleteActivityInput) (req *request.Request, output *DeleteActivityOutput) { - op := &request.Operation{ - Name: opDeleteActivity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteActivityInput{} - } - - output = &DeleteActivityOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteActivity API operation for AWS Step Functions. -// -// Deletes an activity. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation DeleteActivity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteActivity -func (c *SFN) DeleteActivity(input *DeleteActivityInput) (*DeleteActivityOutput, error) { - req, out := c.DeleteActivityRequest(input) - err := req.Send() - return out, err -} - -const opDeleteStateMachine = "DeleteStateMachine" - -// DeleteStateMachineRequest generates a "aws/request.Request" representing the -// client's request for the DeleteStateMachine operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteStateMachine for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteStateMachine method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteStateMachineRequest method. -// req, resp := client.DeleteStateMachineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteStateMachine -func (c *SFN) DeleteStateMachineRequest(input *DeleteStateMachineInput) (req *request.Request, output *DeleteStateMachineOutput) { - op := &request.Operation{ - Name: opDeleteStateMachine, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteStateMachineInput{} - } - - output = &DeleteStateMachineOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteStateMachine API operation for AWS Step Functions. -// -// Deletes a state machine. This is an asynchronous operation-- it sets the -// state machine's status to "DELETING" and begins the delete process. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation DeleteStateMachine for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteStateMachine -func (c *SFN) DeleteStateMachine(input *DeleteStateMachineInput) (*DeleteStateMachineOutput, error) { - req, out := c.DeleteStateMachineRequest(input) - err := req.Send() - return out, err -} - -const opDescribeActivity = "DescribeActivity" - -// DescribeActivityRequest generates a "aws/request.Request" representing the -// client's request for the DescribeActivity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeActivity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeActivity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeActivityRequest method. -// req, resp := client.DescribeActivityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeActivity -func (c *SFN) DescribeActivityRequest(input *DescribeActivityInput) (req *request.Request, output *DescribeActivityOutput) { - op := &request.Operation{ - Name: opDescribeActivity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeActivityInput{} - } - - output = &DescribeActivityOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeActivity API operation for AWS Step Functions. -// -// Describes an activity. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation DescribeActivity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeActivityDoesNotExist "ActivityDoesNotExist" -// The specified activity does not exist. -// -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeActivity -func (c *SFN) DescribeActivity(input *DescribeActivityInput) (*DescribeActivityOutput, error) { - req, out := c.DescribeActivityRequest(input) - err := req.Send() - return out, err -} - -const opDescribeExecution = "DescribeExecution" - -// DescribeExecutionRequest generates a "aws/request.Request" representing the -// client's request for the DescribeExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeExecutionRequest method. -// req, resp := client.DescribeExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeExecution -func (c *SFN) DescribeExecutionRequest(input *DescribeExecutionInput) (req *request.Request, output *DescribeExecutionOutput) { - op := &request.Operation{ - Name: opDescribeExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeExecutionInput{} - } - - output = &DescribeExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeExecution API operation for AWS Step Functions. -// -// Describes an execution. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation DescribeExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeExecutionDoesNotExist "ExecutionDoesNotExist" -// The specified execution does not exist. -// -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeExecution -func (c *SFN) DescribeExecution(input *DescribeExecutionInput) (*DescribeExecutionOutput, error) { - req, out := c.DescribeExecutionRequest(input) - err := req.Send() - return out, err -} - -const opDescribeStateMachine = "DescribeStateMachine" - -// DescribeStateMachineRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStateMachine operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStateMachine for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStateMachine method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStateMachineRequest method. -// req, resp := client.DescribeStateMachineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeStateMachine -func (c *SFN) DescribeStateMachineRequest(input *DescribeStateMachineInput) (req *request.Request, output *DescribeStateMachineOutput) { - op := &request.Operation{ - Name: opDescribeStateMachine, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStateMachineInput{} - } - - output = &DescribeStateMachineOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStateMachine API operation for AWS Step Functions. -// -// Describes a state machine. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation DescribeStateMachine for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// * ErrCodeStateMachineDoesNotExist "StateMachineDoesNotExist" -// The specified state machine does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeStateMachine -func (c *SFN) DescribeStateMachine(input *DescribeStateMachineInput) (*DescribeStateMachineOutput, error) { - req, out := c.DescribeStateMachineRequest(input) - err := req.Send() - return out, err -} - -const opGetActivityTask = "GetActivityTask" - -// GetActivityTaskRequest generates a "aws/request.Request" representing the -// client's request for the GetActivityTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetActivityTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetActivityTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetActivityTaskRequest method. -// req, resp := client.GetActivityTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetActivityTask -func (c *SFN) GetActivityTaskRequest(input *GetActivityTaskInput) (req *request.Request, output *GetActivityTaskOutput) { - op := &request.Operation{ - Name: opGetActivityTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetActivityTaskInput{} - } - - output = &GetActivityTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetActivityTask API operation for AWS Step Functions. -// -// Used by workers to retrieve a task (with the specified activity ARN) scheduled -// for execution by a running state machine. This initiates a long poll, where -// the service holds the HTTP connection open and responds as soon as a task -// becomes available (i.e. an execution of a task of this type is needed.) The -// maximum time the service holds on to the request before responding is 60 -// seconds. If no task is available within 60 seconds, the poll will return -// an empty result, that is, the taskToken returned is an empty string. -// -// Workers should set their client side socket timeout to at least 65 seconds -// (5 seconds higher than the maximum time the service may hold the poll 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 AWS Step Functions's -// API operation GetActivityTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeActivityDoesNotExist "ActivityDoesNotExist" -// The specified activity does not exist. -// -// * ErrCodeActivityWorkerLimitExceeded "ActivityWorkerLimitExceeded" -// The maximum number of workers concurrently polling for activity tasks has -// been reached. -// -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetActivityTask -func (c *SFN) GetActivityTask(input *GetActivityTaskInput) (*GetActivityTaskOutput, error) { - req, out := c.GetActivityTaskRequest(input) - err := req.Send() - return out, err -} - -const opGetExecutionHistory = "GetExecutionHistory" - -// GetExecutionHistoryRequest generates a "aws/request.Request" representing the -// client's request for the GetExecutionHistory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetExecutionHistory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetExecutionHistory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetExecutionHistoryRequest method. -// req, resp := client.GetExecutionHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetExecutionHistory -func (c *SFN) GetExecutionHistoryRequest(input *GetExecutionHistoryInput) (req *request.Request, output *GetExecutionHistoryOutput) { - op := &request.Operation{ - Name: opGetExecutionHistory, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetExecutionHistoryInput{} - } - - output = &GetExecutionHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetExecutionHistory API operation for AWS Step Functions. -// -// Returns the history of the specified execution as a list of events. By default, -// the results are returned in ascending order of the timeStamp of the events. -// Use the reverseOrder parameter to get the latest events first. The results -// may be split into multiple pages. To retrieve subsequent pages, make the -// call again using the nextToken returned by the previous 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 AWS Step Functions's -// API operation GetExecutionHistory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeExecutionDoesNotExist "ExecutionDoesNotExist" -// The specified execution does not exist. -// -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// * ErrCodeInvalidToken "InvalidToken" -// The provided token is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetExecutionHistory -func (c *SFN) GetExecutionHistory(input *GetExecutionHistoryInput) (*GetExecutionHistoryOutput, error) { - req, out := c.GetExecutionHistoryRequest(input) - err := req.Send() - return out, err -} - -// GetExecutionHistoryPages iterates over the pages of a GetExecutionHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetExecutionHistory 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 GetExecutionHistory operation. -// pageNum := 0 -// err := client.GetExecutionHistoryPages(params, -// func(page *GetExecutionHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SFN) GetExecutionHistoryPages(input *GetExecutionHistoryInput, fn func(p *GetExecutionHistoryOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.GetExecutionHistoryRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*GetExecutionHistoryOutput), lastPage) - }) -} - -const opListActivities = "ListActivities" - -// ListActivitiesRequest generates a "aws/request.Request" representing the -// client's request for the ListActivities operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListActivities for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListActivities method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListActivitiesRequest method. -// req, resp := client.ListActivitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListActivities -func (c *SFN) ListActivitiesRequest(input *ListActivitiesInput) (req *request.Request, output *ListActivitiesOutput) { - op := &request.Operation{ - Name: opListActivities, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListActivitiesInput{} - } - - output = &ListActivitiesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListActivities API operation for AWS Step Functions. -// -// Lists the existing activities. The results may be split into multiple pages. -// To retrieve subsequent pages, make the call again using the nextToken returned -// by the previous 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 AWS Step Functions's -// API operation ListActivities for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidToken "InvalidToken" -// The provided token is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListActivities -func (c *SFN) ListActivities(input *ListActivitiesInput) (*ListActivitiesOutput, error) { - req, out := c.ListActivitiesRequest(input) - err := req.Send() - return out, err -} - -// ListActivitiesPages iterates over the pages of a ListActivities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListActivities 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 ListActivities operation. -// pageNum := 0 -// err := client.ListActivitiesPages(params, -// func(page *ListActivitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SFN) ListActivitiesPages(input *ListActivitiesInput, fn func(p *ListActivitiesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListActivitiesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListActivitiesOutput), lastPage) - }) -} - -const opListExecutions = "ListExecutions" - -// ListExecutionsRequest generates a "aws/request.Request" representing the -// client's request for the ListExecutions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListExecutions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListExecutions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListExecutionsRequest method. -// req, resp := client.ListExecutionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListExecutions -func (c *SFN) ListExecutionsRequest(input *ListExecutionsInput) (req *request.Request, output *ListExecutionsOutput) { - op := &request.Operation{ - Name: opListExecutions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListExecutionsInput{} - } - - output = &ListExecutionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListExecutions API operation for AWS Step Functions. -// -// Lists the executions of a state machine that meet the filtering criteria. -// The results may be split into multiple pages. To retrieve subsequent pages, -// make the call again using the nextToken returned by the previous 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 AWS Step Functions's -// API operation ListExecutions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// * ErrCodeInvalidToken "InvalidToken" -// The provided token is invalid. -// -// * ErrCodeStateMachineDoesNotExist "StateMachineDoesNotExist" -// The specified state machine does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListExecutions -func (c *SFN) ListExecutions(input *ListExecutionsInput) (*ListExecutionsOutput, error) { - req, out := c.ListExecutionsRequest(input) - err := req.Send() - return out, err -} - -// ListExecutionsPages iterates over the pages of a ListExecutions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListExecutions 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 ListExecutions operation. -// pageNum := 0 -// err := client.ListExecutionsPages(params, -// func(page *ListExecutionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SFN) ListExecutionsPages(input *ListExecutionsInput, fn func(p *ListExecutionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListExecutionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListExecutionsOutput), lastPage) - }) -} - -const opListStateMachines = "ListStateMachines" - -// ListStateMachinesRequest generates a "aws/request.Request" representing the -// client's request for the ListStateMachines operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListStateMachines for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListStateMachines method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListStateMachinesRequest method. -// req, resp := client.ListStateMachinesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListStateMachines -func (c *SFN) ListStateMachinesRequest(input *ListStateMachinesInput) (req *request.Request, output *ListStateMachinesOutput) { - op := &request.Operation{ - Name: opListStateMachines, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListStateMachinesInput{} - } - - output = &ListStateMachinesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListStateMachines API operation for AWS Step Functions. -// -// Lists the existing state machines. The results may be split into multiple -// pages. To retrieve subsequent pages, make the call again using the nextToken -// returned by the previous 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 AWS Step Functions's -// API operation ListStateMachines for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidToken "InvalidToken" -// The provided token is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListStateMachines -func (c *SFN) ListStateMachines(input *ListStateMachinesInput) (*ListStateMachinesOutput, error) { - req, out := c.ListStateMachinesRequest(input) - err := req.Send() - return out, err -} - -// ListStateMachinesPages iterates over the pages of a ListStateMachines operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStateMachines 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 ListStateMachines operation. -// pageNum := 0 -// err := client.ListStateMachinesPages(params, -// func(page *ListStateMachinesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SFN) ListStateMachinesPages(input *ListStateMachinesInput, fn func(p *ListStateMachinesOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListStateMachinesRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListStateMachinesOutput), lastPage) - }) -} - -const opSendTaskFailure = "SendTaskFailure" - -// SendTaskFailureRequest generates a "aws/request.Request" representing the -// client's request for the SendTaskFailure operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendTaskFailure for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendTaskFailure method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendTaskFailureRequest method. -// req, resp := client.SendTaskFailureRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskFailure -func (c *SFN) SendTaskFailureRequest(input *SendTaskFailureInput) (req *request.Request, output *SendTaskFailureOutput) { - op := &request.Operation{ - Name: opSendTaskFailure, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendTaskFailureInput{} - } - - output = &SendTaskFailureOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendTaskFailure API operation for AWS Step Functions. -// -// Used by workers to report that the task identified by the taskToken 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 AWS Step Functions's -// API operation SendTaskFailure for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTaskDoesNotExist "TaskDoesNotExist" -// -// * ErrCodeInvalidToken "InvalidToken" -// The provided token is invalid. -// -// * ErrCodeTaskTimedOut "TaskTimedOut" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskFailure -func (c *SFN) SendTaskFailure(input *SendTaskFailureInput) (*SendTaskFailureOutput, error) { - req, out := c.SendTaskFailureRequest(input) - err := req.Send() - return out, err -} - -const opSendTaskHeartbeat = "SendTaskHeartbeat" - -// SendTaskHeartbeatRequest generates a "aws/request.Request" representing the -// client's request for the SendTaskHeartbeat operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendTaskHeartbeat for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendTaskHeartbeat method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendTaskHeartbeatRequest method. -// req, resp := client.SendTaskHeartbeatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskHeartbeat -func (c *SFN) SendTaskHeartbeatRequest(input *SendTaskHeartbeatInput) (req *request.Request, output *SendTaskHeartbeatOutput) { - op := &request.Operation{ - Name: opSendTaskHeartbeat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendTaskHeartbeatInput{} - } - - output = &SendTaskHeartbeatOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendTaskHeartbeat API operation for AWS Step Functions. -// -// Used by workers to report to the service that the task represented by the -// specified taskToken is still making progress. This action resets the Heartbeat -// clock. The Heartbeat threshold is specified in the state machine's Amazon -// States Language definition. This action does not in itself create an event -// in the execution history. However, if the task times out, the execution history -// will contain an ActivityTimedOut event. -// -// The Timeout of a task, defined in the state machine's Amazon States Language -// definition, is its maximum allowed duration, regardless of the number of -// SendTaskHeartbeat requests received. -// -// This operation is only useful for long-lived tasks to report the liveliness -// of the 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 AWS Step Functions's -// API operation SendTaskHeartbeat for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTaskDoesNotExist "TaskDoesNotExist" -// -// * ErrCodeInvalidToken "InvalidToken" -// The provided token is invalid. -// -// * ErrCodeTaskTimedOut "TaskTimedOut" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskHeartbeat -func (c *SFN) SendTaskHeartbeat(input *SendTaskHeartbeatInput) (*SendTaskHeartbeatOutput, error) { - req, out := c.SendTaskHeartbeatRequest(input) - err := req.Send() - return out, err -} - -const opSendTaskSuccess = "SendTaskSuccess" - -// SendTaskSuccessRequest generates a "aws/request.Request" representing the -// client's request for the SendTaskSuccess operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendTaskSuccess for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendTaskSuccess method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendTaskSuccessRequest method. -// req, resp := client.SendTaskSuccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskSuccess -func (c *SFN) SendTaskSuccessRequest(input *SendTaskSuccessInput) (req *request.Request, output *SendTaskSuccessOutput) { - op := &request.Operation{ - Name: opSendTaskSuccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendTaskSuccessInput{} - } - - output = &SendTaskSuccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendTaskSuccess API operation for AWS Step Functions. -// -// Used by workers to report that the task identified by the taskToken completed -// successfully. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation SendTaskSuccess for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTaskDoesNotExist "TaskDoesNotExist" -// -// * ErrCodeInvalidOutput "InvalidOutput" -// The provided JSON output data is invalid. -// -// * ErrCodeInvalidToken "InvalidToken" -// The provided token is invalid. -// -// * ErrCodeTaskTimedOut "TaskTimedOut" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskSuccess -func (c *SFN) SendTaskSuccess(input *SendTaskSuccessInput) (*SendTaskSuccessOutput, error) { - req, out := c.SendTaskSuccessRequest(input) - err := req.Send() - return out, err -} - -const opStartExecution = "StartExecution" - -// StartExecutionRequest generates a "aws/request.Request" representing the -// client's request for the StartExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartExecutionRequest method. -// req, resp := client.StartExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StartExecution -func (c *SFN) StartExecutionRequest(input *StartExecutionInput) (req *request.Request, output *StartExecutionOutput) { - op := &request.Operation{ - Name: opStartExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartExecutionInput{} - } - - output = &StartExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartExecution API operation for AWS Step Functions. -// -// Starts a state machine execution. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation StartExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeExecutionLimitExceeded "ExecutionLimitExceeded" -// The maximum number of running executions has been reached. Running executions -// must end or be stopped before a new execution can be started. -// -// * ErrCodeExecutionAlreadyExists "ExecutionAlreadyExists" -// An execution with the same name already exists. -// -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// * ErrCodeInvalidExecutionInput "InvalidExecutionInput" -// The provided JSON input data is invalid. -// -// * ErrCodeInvalidName "InvalidName" -// The provided name is invalid. -// -// * ErrCodeStateMachineDoesNotExist "StateMachineDoesNotExist" -// The specified state machine does not exist. -// -// * ErrCodeStateMachineDeleting "StateMachineDeleting" -// The specified state machine is being deleted. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StartExecution -func (c *SFN) StartExecution(input *StartExecutionInput) (*StartExecutionOutput, error) { - req, out := c.StartExecutionRequest(input) - err := req.Send() - return out, err -} - -const opStopExecution = "StopExecution" - -// StopExecutionRequest generates a "aws/request.Request" representing the -// client's request for the StopExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopExecutionRequest method. -// req, resp := client.StopExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StopExecution -func (c *SFN) StopExecutionRequest(input *StopExecutionInput) (req *request.Request, output *StopExecutionOutput) { - op := &request.Operation{ - Name: opStopExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopExecutionInput{} - } - - output = &StopExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopExecution API operation for AWS Step Functions. -// -// Stops an execution. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 Step Functions's -// API operation StopExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeExecutionDoesNotExist "ExecutionDoesNotExist" -// The specified execution does not exist. -// -// * ErrCodeInvalidArn "InvalidArn" -// The provided Amazon Resource Name (ARN) is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StopExecution -func (c *SFN) StopExecution(input *StopExecutionInput) (*StopExecutionOutput, error) { - req, out := c.StopExecutionRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ActivityFailedEventDetails -type ActivityFailedEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s ActivityFailedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActivityFailedEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *ActivityFailedEventDetails) SetCause(v string) *ActivityFailedEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *ActivityFailedEventDetails) SetError(v string) *ActivityFailedEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ActivityListItem -type ActivityListItem struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that identifies the activity. - // - // ActivityArn is a required field - ActivityArn *string `locationName:"activityArn" min:"1" type:"string" required:"true"` - - // The date the activity was created. - // - // CreationDate is a required field - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The name of the activity. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ActivityListItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActivityListItem) GoString() string { - return s.String() -} - -// SetActivityArn sets the ActivityArn field's value. -func (s *ActivityListItem) SetActivityArn(v string) *ActivityListItem { - s.ActivityArn = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *ActivityListItem) SetCreationDate(v time.Time) *ActivityListItem { - s.CreationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *ActivityListItem) SetName(v string) *ActivityListItem { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ActivityScheduleFailedEventDetails -type ActivityScheduleFailedEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s ActivityScheduleFailedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActivityScheduleFailedEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *ActivityScheduleFailedEventDetails) SetCause(v string) *ActivityScheduleFailedEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *ActivityScheduleFailedEventDetails) SetError(v string) *ActivityScheduleFailedEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ActivityScheduledEventDetails -type ActivityScheduledEventDetails struct { - _ struct{} `type:"structure"` - - // The maximum allowed duration between two heartbeats for the activity task. - HeartbeatInSeconds *int64 `locationName:"heartbeatInSeconds" type:"long"` - - // The JSON data input to the activity task. - Input *string `locationName:"input" type:"string"` - - // The Amazon Resource Name (ARN) of the scheduled activity. - // - // Resource is a required field - Resource *string `locationName:"resource" min:"1" type:"string" required:"true"` - - // The maximum allowed duration of the activity task. - TimeoutInSeconds *int64 `locationName:"timeoutInSeconds" type:"long"` -} - -// String returns the string representation -func (s ActivityScheduledEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActivityScheduledEventDetails) GoString() string { - return s.String() -} - -// SetHeartbeatInSeconds sets the HeartbeatInSeconds field's value. -func (s *ActivityScheduledEventDetails) SetHeartbeatInSeconds(v int64) *ActivityScheduledEventDetails { - s.HeartbeatInSeconds = &v - return s -} - -// SetInput sets the Input field's value. -func (s *ActivityScheduledEventDetails) SetInput(v string) *ActivityScheduledEventDetails { - s.Input = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *ActivityScheduledEventDetails) SetResource(v string) *ActivityScheduledEventDetails { - s.Resource = &v - return s -} - -// SetTimeoutInSeconds sets the TimeoutInSeconds field's value. -func (s *ActivityScheduledEventDetails) SetTimeoutInSeconds(v int64) *ActivityScheduledEventDetails { - s.TimeoutInSeconds = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ActivityStartedEventDetails -type ActivityStartedEventDetails struct { - _ struct{} `type:"structure"` - - // The name of the worker that the task was assigned to. These names are provided - // by the workers when calling GetActivityTask. - WorkerName *string `locationName:"workerName" type:"string"` -} - -// String returns the string representation -func (s ActivityStartedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActivityStartedEventDetails) GoString() string { - return s.String() -} - -// SetWorkerName sets the WorkerName field's value. -func (s *ActivityStartedEventDetails) SetWorkerName(v string) *ActivityStartedEventDetails { - s.WorkerName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ActivitySucceededEventDetails -type ActivitySucceededEventDetails struct { - _ struct{} `type:"structure"` - - // The JSON data output by the activity task. - Output *string `locationName:"output" type:"string"` -} - -// String returns the string representation -func (s ActivitySucceededEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActivitySucceededEventDetails) GoString() string { - return s.String() -} - -// SetOutput sets the Output field's value. -func (s *ActivitySucceededEventDetails) SetOutput(v string) *ActivitySucceededEventDetails { - s.Output = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ActivityTimedOutEventDetails -type ActivityTimedOutEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the timeout. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s ActivityTimedOutEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActivityTimedOutEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *ActivityTimedOutEventDetails) SetCause(v string) *ActivityTimedOutEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *ActivityTimedOutEventDetails) SetError(v string) *ActivityTimedOutEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateActivityInput -type CreateActivityInput struct { - _ struct{} `type:"structure"` - - // The name of the activity to create. This name must be unique for your AWS - // account and region. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateActivityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateActivityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateActivityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateActivityInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateActivityInput) SetName(v string) *CreateActivityInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateActivityOutput -type CreateActivityOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that identifies the created activity. - // - // ActivityArn is a required field - ActivityArn *string `locationName:"activityArn" min:"1" type:"string" required:"true"` - - // The date the activity was created. - // - // CreationDate is a required field - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix" required:"true"` -} - -// String returns the string representation -func (s CreateActivityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateActivityOutput) GoString() string { - return s.String() -} - -// SetActivityArn sets the ActivityArn field's value. -func (s *CreateActivityOutput) SetActivityArn(v string) *CreateActivityOutput { - s.ActivityArn = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *CreateActivityOutput) SetCreationDate(v time.Time) *CreateActivityOutput { - s.CreationDate = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateStateMachineInput -type CreateStateMachineInput struct { - _ struct{} `type:"structure"` - - // The Amazon States Language definition of the state machine. - // - // Definition is a required field - Definition *string `locationName:"definition" min:"1" type:"string" required:"true"` - - // The name of the state machine. This name must be unique for your AWS account - // and region. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role to use for this state machine. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateStateMachineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStateMachineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStateMachineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStateMachineInput"} - if s.Definition == nil { - invalidParams.Add(request.NewErrParamRequired("Definition")) - } - if s.Definition != nil && len(*s.Definition) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Definition", 1)) - } - 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.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefinition sets the Definition field's value. -func (s *CreateStateMachineInput) SetDefinition(v string) *CreateStateMachineInput { - s.Definition = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateStateMachineInput) SetName(v string) *CreateStateMachineInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateStateMachineInput) SetRoleArn(v string) *CreateStateMachineInput { - s.RoleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/CreateStateMachineOutput -type CreateStateMachineOutput struct { - _ struct{} `type:"structure"` - - // The date the state machine was created. - // - // CreationDate is a required field - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The Amazon Resource Name (ARN) that identifies the created state machine. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateStateMachineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStateMachineOutput) GoString() string { - return s.String() -} - -// SetCreationDate sets the CreationDate field's value. -func (s *CreateStateMachineOutput) SetCreationDate(v time.Time) *CreateStateMachineOutput { - s.CreationDate = &v - return s -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *CreateStateMachineOutput) SetStateMachineArn(v string) *CreateStateMachineOutput { - s.StateMachineArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteActivityInput -type DeleteActivityInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the activity to delete. - // - // ActivityArn is a required field - ActivityArn *string `locationName:"activityArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteActivityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteActivityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteActivityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteActivityInput"} - if s.ActivityArn == nil { - invalidParams.Add(request.NewErrParamRequired("ActivityArn")) - } - if s.ActivityArn != nil && len(*s.ActivityArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActivityArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActivityArn sets the ActivityArn field's value. -func (s *DeleteActivityInput) SetActivityArn(v string) *DeleteActivityInput { - s.ActivityArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteActivityOutput -type DeleteActivityOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteActivityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteActivityOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteStateMachineInput -type DeleteStateMachineInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the state machine to delete. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteStateMachineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStateMachineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStateMachineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStateMachineInput"} - if s.StateMachineArn == nil { - invalidParams.Add(request.NewErrParamRequired("StateMachineArn")) - } - if s.StateMachineArn != nil && len(*s.StateMachineArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StateMachineArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *DeleteStateMachineInput) SetStateMachineArn(v string) *DeleteStateMachineInput { - s.StateMachineArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteStateMachineOutput -type DeleteStateMachineOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteStateMachineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStateMachineOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeActivityInput -type DescribeActivityInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the activity to describe. - // - // ActivityArn is a required field - ActivityArn *string `locationName:"activityArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeActivityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeActivityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeActivityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeActivityInput"} - if s.ActivityArn == nil { - invalidParams.Add(request.NewErrParamRequired("ActivityArn")) - } - if s.ActivityArn != nil && len(*s.ActivityArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActivityArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActivityArn sets the ActivityArn field's value. -func (s *DescribeActivityInput) SetActivityArn(v string) *DescribeActivityInput { - s.ActivityArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeActivityOutput -type DescribeActivityOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that identifies the activity. - // - // ActivityArn is a required field - ActivityArn *string `locationName:"activityArn" min:"1" type:"string" required:"true"` - - // The date the activity was created. - // - // CreationDate is a required field - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The name of the activity. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeActivityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeActivityOutput) GoString() string { - return s.String() -} - -// SetActivityArn sets the ActivityArn field's value. -func (s *DescribeActivityOutput) SetActivityArn(v string) *DescribeActivityOutput { - s.ActivityArn = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *DescribeActivityOutput) SetCreationDate(v time.Time) *DescribeActivityOutput { - s.CreationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeActivityOutput) SetName(v string) *DescribeActivityOutput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeExecutionInput -type DescribeExecutionInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the execution to describe. - // - // ExecutionArn is a required field - ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeExecutionInput"} - if s.ExecutionArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionArn")) - } - if s.ExecutionArn != nil && len(*s.ExecutionArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExecutionArn sets the ExecutionArn field's value. -func (s *DescribeExecutionInput) SetExecutionArn(v string) *DescribeExecutionInput { - s.ExecutionArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeExecutionOutput -type DescribeExecutionOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that identifies the execution. - // - // ExecutionArn is a required field - ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` - - // The JSON input data of the execution. - // - // Input is a required field - Input *string `locationName:"input" type:"string" required:"true"` - - // The name of the execution. - Name *string `locationName:"name" min:"1" type:"string"` - - // The JSON output data of the execution. - Output *string `locationName:"output" type:"string"` - - // The date the execution was started. - // - // StartDate is a required field - StartDate *time.Time `locationName:"startDate" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The Amazon Resource Name (ARN) of the executed stated machine. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` - - // The current status of the execution. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ExecutionStatus"` - - // If the execution has already ended, the date the execution stopped. - StopDate *time.Time `locationName:"stopDate" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s DescribeExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeExecutionOutput) GoString() string { - return s.String() -} - -// SetExecutionArn sets the ExecutionArn field's value. -func (s *DescribeExecutionOutput) SetExecutionArn(v string) *DescribeExecutionOutput { - s.ExecutionArn = &v - return s -} - -// SetInput sets the Input field's value. -func (s *DescribeExecutionOutput) SetInput(v string) *DescribeExecutionOutput { - s.Input = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeExecutionOutput) SetName(v string) *DescribeExecutionOutput { - s.Name = &v - return s -} - -// SetOutput sets the Output field's value. -func (s *DescribeExecutionOutput) SetOutput(v string) *DescribeExecutionOutput { - s.Output = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *DescribeExecutionOutput) SetStartDate(v time.Time) *DescribeExecutionOutput { - s.StartDate = &v - return s -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *DescribeExecutionOutput) SetStateMachineArn(v string) *DescribeExecutionOutput { - s.StateMachineArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeExecutionOutput) SetStatus(v string) *DescribeExecutionOutput { - s.Status = &v - return s -} - -// SetStopDate sets the StopDate field's value. -func (s *DescribeExecutionOutput) SetStopDate(v time.Time) *DescribeExecutionOutput { - s.StopDate = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeStateMachineInput -type DescribeStateMachineInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the state machine to describe. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeStateMachineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStateMachineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStateMachineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStateMachineInput"} - if s.StateMachineArn == nil { - invalidParams.Add(request.NewErrParamRequired("StateMachineArn")) - } - if s.StateMachineArn != nil && len(*s.StateMachineArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StateMachineArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *DescribeStateMachineInput) SetStateMachineArn(v string) *DescribeStateMachineInput { - s.StateMachineArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeStateMachineOutput -type DescribeStateMachineOutput struct { - _ struct{} `type:"structure"` - - // The date the state machine was created. - // - // CreationDate is a required field - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The Amazon States Language definition of the state machine. - // - // Definition is a required field - Definition *string `locationName:"definition" min:"1" type:"string" required:"true"` - - // The name of the state machine. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role used for executing this state - // machine. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that identifies the state machine. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` - - // The current status of the state machine. - Status *string `locationName:"status" type:"string" enum:"StateMachineStatus"` -} - -// String returns the string representation -func (s DescribeStateMachineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStateMachineOutput) GoString() string { - return s.String() -} - -// SetCreationDate sets the CreationDate field's value. -func (s *DescribeStateMachineOutput) SetCreationDate(v time.Time) *DescribeStateMachineOutput { - s.CreationDate = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *DescribeStateMachineOutput) SetDefinition(v string) *DescribeStateMachineOutput { - s.Definition = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeStateMachineOutput) SetName(v string) *DescribeStateMachineOutput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeStateMachineOutput) SetRoleArn(v string) *DescribeStateMachineOutput { - s.RoleArn = &v - return s -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *DescribeStateMachineOutput) SetStateMachineArn(v string) *DescribeStateMachineOutput { - s.StateMachineArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeStateMachineOutput) SetStatus(v string) *DescribeStateMachineOutput { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ExecutionAbortedEventDetails -type ExecutionAbortedEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s ExecutionAbortedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutionAbortedEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *ExecutionAbortedEventDetails) SetCause(v string) *ExecutionAbortedEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *ExecutionAbortedEventDetails) SetError(v string) *ExecutionAbortedEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ExecutionFailedEventDetails -type ExecutionFailedEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s ExecutionFailedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutionFailedEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *ExecutionFailedEventDetails) SetCause(v string) *ExecutionFailedEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *ExecutionFailedEventDetails) SetError(v string) *ExecutionFailedEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ExecutionListItem -type ExecutionListItem struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that identifies the execution. - // - // ExecutionArn is a required field - ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` - - // The name of the execution. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The date the execution started. - // - // StartDate is a required field - StartDate *time.Time `locationName:"startDate" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The Amazon Resource Name (ARN) of the executed state machine. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` - - // The current status of the execution. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ExecutionStatus"` - - // If the execution already ended, the date the execution stopped. - StopDate *time.Time `locationName:"stopDate" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s ExecutionListItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutionListItem) GoString() string { - return s.String() -} - -// SetExecutionArn sets the ExecutionArn field's value. -func (s *ExecutionListItem) SetExecutionArn(v string) *ExecutionListItem { - s.ExecutionArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *ExecutionListItem) SetName(v string) *ExecutionListItem { - s.Name = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *ExecutionListItem) SetStartDate(v time.Time) *ExecutionListItem { - s.StartDate = &v - return s -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *ExecutionListItem) SetStateMachineArn(v string) *ExecutionListItem { - s.StateMachineArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ExecutionListItem) SetStatus(v string) *ExecutionListItem { - s.Status = &v - return s -} - -// SetStopDate sets the StopDate field's value. -func (s *ExecutionListItem) SetStopDate(v time.Time) *ExecutionListItem { - s.StopDate = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ExecutionStartedEventDetails -type ExecutionStartedEventDetails struct { - _ struct{} `type:"structure"` - - // The JSON data input to the execution. - Input *string `locationName:"input" type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role used for executing AWS Lambda - // tasks. - RoleArn *string `locationName:"roleArn" min:"1" type:"string"` -} - -// String returns the string representation -func (s ExecutionStartedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutionStartedEventDetails) GoString() string { - return s.String() -} - -// SetInput sets the Input field's value. -func (s *ExecutionStartedEventDetails) SetInput(v string) *ExecutionStartedEventDetails { - s.Input = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *ExecutionStartedEventDetails) SetRoleArn(v string) *ExecutionStartedEventDetails { - s.RoleArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ExecutionSucceededEventDetails -type ExecutionSucceededEventDetails struct { - _ struct{} `type:"structure"` - - // The JSON data output by the execution. - Output *string `locationName:"output" type:"string"` -} - -// String returns the string representation -func (s ExecutionSucceededEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutionSucceededEventDetails) GoString() string { - return s.String() -} - -// SetOutput sets the Output field's value. -func (s *ExecutionSucceededEventDetails) SetOutput(v string) *ExecutionSucceededEventDetails { - s.Output = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ExecutionTimedOutEventDetails -type ExecutionTimedOutEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the timeout. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s ExecutionTimedOutEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecutionTimedOutEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *ExecutionTimedOutEventDetails) SetCause(v string) *ExecutionTimedOutEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *ExecutionTimedOutEventDetails) SetError(v string) *ExecutionTimedOutEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetActivityTaskInput -type GetActivityTaskInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the activity to retrieve tasks from. - // - // ActivityArn is a required field - ActivityArn *string `locationName:"activityArn" min:"1" type:"string" required:"true"` - - // An arbitrary name may be provided in order to identify the worker that the - // task is assigned to. This name will be used when it is logged in the execution - // history. - WorkerName *string `locationName:"workerName" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetActivityTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetActivityTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetActivityTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetActivityTaskInput"} - if s.ActivityArn == nil { - invalidParams.Add(request.NewErrParamRequired("ActivityArn")) - } - if s.ActivityArn != nil && len(*s.ActivityArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActivityArn", 1)) - } - if s.WorkerName != nil && len(*s.WorkerName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkerName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActivityArn sets the ActivityArn field's value. -func (s *GetActivityTaskInput) SetActivityArn(v string) *GetActivityTaskInput { - s.ActivityArn = &v - return s -} - -// SetWorkerName sets the WorkerName field's value. -func (s *GetActivityTaskInput) SetWorkerName(v string) *GetActivityTaskInput { - s.WorkerName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetActivityTaskOutput -type GetActivityTaskOutput struct { - _ struct{} `type:"structure"` - - // The JSON input data for the task. - Input *string `locationName:"input" type:"string"` - - // A token that identifies the scheduled task. This token must be copied and - // included in subsequent calls to SendTaskHeartbeat, SendTaskSuccess or SendTaskFailure - // in order to report the progress or completion of the task. - TaskToken *string `locationName:"taskToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetActivityTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetActivityTaskOutput) GoString() string { - return s.String() -} - -// SetInput sets the Input field's value. -func (s *GetActivityTaskOutput) SetInput(v string) *GetActivityTaskOutput { - s.Input = &v - return s -} - -// SetTaskToken sets the TaskToken field's value. -func (s *GetActivityTaskOutput) SetTaskToken(v string) *GetActivityTaskOutput { - s.TaskToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetExecutionHistoryInput -type GetExecutionHistoryInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the execution. - // - // ExecutionArn is a required field - ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` - - // The maximum number of results that will be returned per call. nextToken can - // be used to obtain further pages of results. The default is 100 and the maximum - // allowed page size is 1000. - // - // This is an upper limit only; the actual number of results returned per call - // may be fewer than the specified maximum. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // If a nextToken was returned by a previous call, there are more results available. - // To retrieve the next page of results, make the call again using the returned - // token in nextToken. Keep all other arguments unchanged. - // - // The configured maxResults determines how many results can be returned in - // a single call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Lists events in descending order of their timeStamp. - ReverseOrder *bool `locationName:"reverseOrder" type:"boolean"` -} - -// String returns the string representation -func (s GetExecutionHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetExecutionHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetExecutionHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetExecutionHistoryInput"} - if s.ExecutionArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionArn")) - } - if s.ExecutionArn != nil && len(*s.ExecutionArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionArn", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExecutionArn sets the ExecutionArn field's value. -func (s *GetExecutionHistoryInput) SetExecutionArn(v string) *GetExecutionHistoryInput { - s.ExecutionArn = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetExecutionHistoryInput) SetMaxResults(v int64) *GetExecutionHistoryInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetExecutionHistoryInput) SetNextToken(v string) *GetExecutionHistoryInput { - s.NextToken = &v - return s -} - -// SetReverseOrder sets the ReverseOrder field's value. -func (s *GetExecutionHistoryInput) SetReverseOrder(v bool) *GetExecutionHistoryInput { - s.ReverseOrder = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetExecutionHistoryOutput -type GetExecutionHistoryOutput struct { - _ struct{} `type:"structure"` - - // The list of events that occurred in the execution. - // - // Events is a required field - Events []*HistoryEvent `locationName:"events" type:"list" required:"true"` - - // If a nextToken is returned, there are more results available. To retrieve - // the next page of results, make the call again using the returned token in - // nextToken. Keep all other arguments unchanged. - // - // The configured maxResults determines how many results can be returned in - // a single call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetExecutionHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetExecutionHistoryOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *GetExecutionHistoryOutput) SetEvents(v []*HistoryEvent) *GetExecutionHistoryOutput { - s.Events = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetExecutionHistoryOutput) SetNextToken(v string) *GetExecutionHistoryOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/HistoryEvent -type HistoryEvent struct { - _ struct{} `type:"structure"` - - ActivityFailedEventDetails *ActivityFailedEventDetails `locationName:"activityFailedEventDetails" type:"structure"` - - ActivityScheduleFailedEventDetails *ActivityScheduleFailedEventDetails `locationName:"activityScheduleFailedEventDetails" type:"structure"` - - ActivityScheduledEventDetails *ActivityScheduledEventDetails `locationName:"activityScheduledEventDetails" type:"structure"` - - ActivityStartedEventDetails *ActivityStartedEventDetails `locationName:"activityStartedEventDetails" type:"structure"` - - ActivitySucceededEventDetails *ActivitySucceededEventDetails `locationName:"activitySucceededEventDetails" type:"structure"` - - ActivityTimedOutEventDetails *ActivityTimedOutEventDetails `locationName:"activityTimedOutEventDetails" type:"structure"` - - ExecutionAbortedEventDetails *ExecutionAbortedEventDetails `locationName:"executionAbortedEventDetails" type:"structure"` - - ExecutionFailedEventDetails *ExecutionFailedEventDetails `locationName:"executionFailedEventDetails" type:"structure"` - - ExecutionStartedEventDetails *ExecutionStartedEventDetails `locationName:"executionStartedEventDetails" type:"structure"` - - ExecutionSucceededEventDetails *ExecutionSucceededEventDetails `locationName:"executionSucceededEventDetails" type:"structure"` - - ExecutionTimedOutEventDetails *ExecutionTimedOutEventDetails `locationName:"executionTimedOutEventDetails" type:"structure"` - - // The id of the event. Events are numbered sequentially, starting at one. - // - // Id is a required field - Id *int64 `locationName:"id" type:"long" required:"true"` - - LambdaFunctionFailedEventDetails *LambdaFunctionFailedEventDetails `locationName:"lambdaFunctionFailedEventDetails" type:"structure"` - - LambdaFunctionScheduleFailedEventDetails *LambdaFunctionScheduleFailedEventDetails `locationName:"lambdaFunctionScheduleFailedEventDetails" type:"structure"` - - LambdaFunctionScheduledEventDetails *LambdaFunctionScheduledEventDetails `locationName:"lambdaFunctionScheduledEventDetails" type:"structure"` - - LambdaFunctionStartFailedEventDetails *LambdaFunctionStartFailedEventDetails `locationName:"lambdaFunctionStartFailedEventDetails" type:"structure"` - - LambdaFunctionSucceededEventDetails *LambdaFunctionSucceededEventDetails `locationName:"lambdaFunctionSucceededEventDetails" type:"structure"` - - LambdaFunctionTimedOutEventDetails *LambdaFunctionTimedOutEventDetails `locationName:"lambdaFunctionTimedOutEventDetails" type:"structure"` - - // The id of the previous event. - PreviousEventId *int64 `locationName:"previousEventId" type:"long"` - - StateEnteredEventDetails *StateEnteredEventDetails `locationName:"stateEnteredEventDetails" type:"structure"` - - StateExitedEventDetails *StateExitedEventDetails `locationName:"stateExitedEventDetails" type:"structure"` - - // The date the event occured. - // - // Timestamp is a required field - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The type of the event. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"HistoryEventType"` -} - -// String returns the string representation -func (s HistoryEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HistoryEvent) GoString() string { - return s.String() -} - -// SetActivityFailedEventDetails sets the ActivityFailedEventDetails field's value. -func (s *HistoryEvent) SetActivityFailedEventDetails(v *ActivityFailedEventDetails) *HistoryEvent { - s.ActivityFailedEventDetails = v - return s -} - -// SetActivityScheduleFailedEventDetails sets the ActivityScheduleFailedEventDetails field's value. -func (s *HistoryEvent) SetActivityScheduleFailedEventDetails(v *ActivityScheduleFailedEventDetails) *HistoryEvent { - s.ActivityScheduleFailedEventDetails = v - return s -} - -// SetActivityScheduledEventDetails sets the ActivityScheduledEventDetails field's value. -func (s *HistoryEvent) SetActivityScheduledEventDetails(v *ActivityScheduledEventDetails) *HistoryEvent { - s.ActivityScheduledEventDetails = v - return s -} - -// SetActivityStartedEventDetails sets the ActivityStartedEventDetails field's value. -func (s *HistoryEvent) SetActivityStartedEventDetails(v *ActivityStartedEventDetails) *HistoryEvent { - s.ActivityStartedEventDetails = v - return s -} - -// SetActivitySucceededEventDetails sets the ActivitySucceededEventDetails field's value. -func (s *HistoryEvent) SetActivitySucceededEventDetails(v *ActivitySucceededEventDetails) *HistoryEvent { - s.ActivitySucceededEventDetails = v - return s -} - -// SetActivityTimedOutEventDetails sets the ActivityTimedOutEventDetails field's value. -func (s *HistoryEvent) SetActivityTimedOutEventDetails(v *ActivityTimedOutEventDetails) *HistoryEvent { - s.ActivityTimedOutEventDetails = v - return s -} - -// SetExecutionAbortedEventDetails sets the ExecutionAbortedEventDetails field's value. -func (s *HistoryEvent) SetExecutionAbortedEventDetails(v *ExecutionAbortedEventDetails) *HistoryEvent { - s.ExecutionAbortedEventDetails = v - return s -} - -// SetExecutionFailedEventDetails sets the ExecutionFailedEventDetails field's value. -func (s *HistoryEvent) SetExecutionFailedEventDetails(v *ExecutionFailedEventDetails) *HistoryEvent { - s.ExecutionFailedEventDetails = v - return s -} - -// SetExecutionStartedEventDetails sets the ExecutionStartedEventDetails field's value. -func (s *HistoryEvent) SetExecutionStartedEventDetails(v *ExecutionStartedEventDetails) *HistoryEvent { - s.ExecutionStartedEventDetails = v - return s -} - -// SetExecutionSucceededEventDetails sets the ExecutionSucceededEventDetails field's value. -func (s *HistoryEvent) SetExecutionSucceededEventDetails(v *ExecutionSucceededEventDetails) *HistoryEvent { - s.ExecutionSucceededEventDetails = v - return s -} - -// SetExecutionTimedOutEventDetails sets the ExecutionTimedOutEventDetails field's value. -func (s *HistoryEvent) SetExecutionTimedOutEventDetails(v *ExecutionTimedOutEventDetails) *HistoryEvent { - s.ExecutionTimedOutEventDetails = v - return s -} - -// SetId sets the Id field's value. -func (s *HistoryEvent) SetId(v int64) *HistoryEvent { - s.Id = &v - return s -} - -// SetLambdaFunctionFailedEventDetails sets the LambdaFunctionFailedEventDetails field's value. -func (s *HistoryEvent) SetLambdaFunctionFailedEventDetails(v *LambdaFunctionFailedEventDetails) *HistoryEvent { - s.LambdaFunctionFailedEventDetails = v - return s -} - -// SetLambdaFunctionScheduleFailedEventDetails sets the LambdaFunctionScheduleFailedEventDetails field's value. -func (s *HistoryEvent) SetLambdaFunctionScheduleFailedEventDetails(v *LambdaFunctionScheduleFailedEventDetails) *HistoryEvent { - s.LambdaFunctionScheduleFailedEventDetails = v - return s -} - -// SetLambdaFunctionScheduledEventDetails sets the LambdaFunctionScheduledEventDetails field's value. -func (s *HistoryEvent) SetLambdaFunctionScheduledEventDetails(v *LambdaFunctionScheduledEventDetails) *HistoryEvent { - s.LambdaFunctionScheduledEventDetails = v - return s -} - -// SetLambdaFunctionStartFailedEventDetails sets the LambdaFunctionStartFailedEventDetails field's value. -func (s *HistoryEvent) SetLambdaFunctionStartFailedEventDetails(v *LambdaFunctionStartFailedEventDetails) *HistoryEvent { - s.LambdaFunctionStartFailedEventDetails = v - return s -} - -// SetLambdaFunctionSucceededEventDetails sets the LambdaFunctionSucceededEventDetails field's value. -func (s *HistoryEvent) SetLambdaFunctionSucceededEventDetails(v *LambdaFunctionSucceededEventDetails) *HistoryEvent { - s.LambdaFunctionSucceededEventDetails = v - return s -} - -// SetLambdaFunctionTimedOutEventDetails sets the LambdaFunctionTimedOutEventDetails field's value. -func (s *HistoryEvent) SetLambdaFunctionTimedOutEventDetails(v *LambdaFunctionTimedOutEventDetails) *HistoryEvent { - s.LambdaFunctionTimedOutEventDetails = v - return s -} - -// SetPreviousEventId sets the PreviousEventId field's value. -func (s *HistoryEvent) SetPreviousEventId(v int64) *HistoryEvent { - s.PreviousEventId = &v - return s -} - -// SetStateEnteredEventDetails sets the StateEnteredEventDetails field's value. -func (s *HistoryEvent) SetStateEnteredEventDetails(v *StateEnteredEventDetails) *HistoryEvent { - s.StateEnteredEventDetails = v - return s -} - -// SetStateExitedEventDetails sets the StateExitedEventDetails field's value. -func (s *HistoryEvent) SetStateExitedEventDetails(v *StateExitedEventDetails) *HistoryEvent { - s.StateExitedEventDetails = v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *HistoryEvent) SetTimestamp(v time.Time) *HistoryEvent { - s.Timestamp = &v - return s -} - -// SetType sets the Type field's value. -func (s *HistoryEvent) SetType(v string) *HistoryEvent { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/LambdaFunctionFailedEventDetails -type LambdaFunctionFailedEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s LambdaFunctionFailedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionFailedEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *LambdaFunctionFailedEventDetails) SetCause(v string) *LambdaFunctionFailedEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *LambdaFunctionFailedEventDetails) SetError(v string) *LambdaFunctionFailedEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/LambdaFunctionScheduleFailedEventDetails -type LambdaFunctionScheduleFailedEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s LambdaFunctionScheduleFailedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionScheduleFailedEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *LambdaFunctionScheduleFailedEventDetails) SetCause(v string) *LambdaFunctionScheduleFailedEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *LambdaFunctionScheduleFailedEventDetails) SetError(v string) *LambdaFunctionScheduleFailedEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/LambdaFunctionScheduledEventDetails -type LambdaFunctionScheduledEventDetails struct { - _ struct{} `type:"structure"` - - // The JSON data input to the lambda function. - Input *string `locationName:"input" type:"string"` - - // The Amazon Resource Name (ARN) of the scheduled lambda function. - // - // Resource is a required field - Resource *string `locationName:"resource" min:"1" type:"string" required:"true"` - - // The maximum allowed duration of the lambda function. - TimeoutInSeconds *int64 `locationName:"timeoutInSeconds" type:"long"` -} - -// String returns the string representation -func (s LambdaFunctionScheduledEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionScheduledEventDetails) GoString() string { - return s.String() -} - -// SetInput sets the Input field's value. -func (s *LambdaFunctionScheduledEventDetails) SetInput(v string) *LambdaFunctionScheduledEventDetails { - s.Input = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *LambdaFunctionScheduledEventDetails) SetResource(v string) *LambdaFunctionScheduledEventDetails { - s.Resource = &v - return s -} - -// SetTimeoutInSeconds sets the TimeoutInSeconds field's value. -func (s *LambdaFunctionScheduledEventDetails) SetTimeoutInSeconds(v int64) *LambdaFunctionScheduledEventDetails { - s.TimeoutInSeconds = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/LambdaFunctionStartFailedEventDetails -type LambdaFunctionStartFailedEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s LambdaFunctionStartFailedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionStartFailedEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *LambdaFunctionStartFailedEventDetails) SetCause(v string) *LambdaFunctionStartFailedEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *LambdaFunctionStartFailedEventDetails) SetError(v string) *LambdaFunctionStartFailedEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/LambdaFunctionSucceededEventDetails -type LambdaFunctionSucceededEventDetails struct { - _ struct{} `type:"structure"` - - // The JSON data output by the lambda function. - Output *string `locationName:"output" type:"string"` -} - -// String returns the string representation -func (s LambdaFunctionSucceededEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionSucceededEventDetails) GoString() string { - return s.String() -} - -// SetOutput sets the Output field's value. -func (s *LambdaFunctionSucceededEventDetails) SetOutput(v string) *LambdaFunctionSucceededEventDetails { - s.Output = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/LambdaFunctionTimedOutEventDetails -type LambdaFunctionTimedOutEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the timeout. - Cause *string `locationName:"cause" type:"string"` - - // The error code of the failure. - Error *string `locationName:"error" type:"string"` -} - -// String returns the string representation -func (s LambdaFunctionTimedOutEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionTimedOutEventDetails) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *LambdaFunctionTimedOutEventDetails) SetCause(v string) *LambdaFunctionTimedOutEventDetails { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *LambdaFunctionTimedOutEventDetails) SetError(v string) *LambdaFunctionTimedOutEventDetails { - s.Error = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListActivitiesInput -type ListActivitiesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results that will be returned per call. nextToken can - // be used to obtain further pages of results. The default is 100 and the maximum - // allowed page size is 1000. - // - // This is an upper limit only; the actual number of results returned per call - // may be fewer than the specified maximum. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // If a nextToken was returned by a previous call, there are more results available. - // To retrieve the next page of results, make the call again using the returned - // token in nextToken. Keep all other arguments unchanged. - // - // The configured maxResults determines how many results can be returned in - // a single call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListActivitiesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListActivitiesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListActivitiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListActivitiesInput"} - 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 *ListActivitiesInput) SetMaxResults(v int64) *ListActivitiesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListActivitiesInput) SetNextToken(v string) *ListActivitiesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListActivitiesOutput -type ListActivitiesOutput struct { - _ struct{} `type:"structure"` - - // The list of activities. - // - // Activities is a required field - Activities []*ActivityListItem `locationName:"activities" type:"list" required:"true"` - - // If a nextToken is returned, there are more results available. To retrieve - // the next page of results, make the call again using the returned token in - // nextToken. Keep all other arguments unchanged. - // - // The configured maxResults determines how many results can be returned in - // a single call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListActivitiesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListActivitiesOutput) GoString() string { - return s.String() -} - -// SetActivities sets the Activities field's value. -func (s *ListActivitiesOutput) SetActivities(v []*ActivityListItem) *ListActivitiesOutput { - s.Activities = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListActivitiesOutput) SetNextToken(v string) *ListActivitiesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListExecutionsInput -type ListExecutionsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results that will be returned per call. nextToken can - // be used to obtain further pages of results. The default is 100 and the maximum - // allowed page size is 1000. - // - // This is an upper limit only; the actual number of results returned per call - // may be fewer than the specified maximum. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // If a nextToken was returned by a previous call, there are more results available. - // To retrieve the next page of results, make the call again using the returned - // token in nextToken. Keep all other arguments unchanged. - // - // The configured maxResults determines how many results can be returned in - // a single call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the state machine whose executions will - // be listed. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` - - // If specified, only list the executions whose current execution status matches - // the given filter. - StatusFilter *string `locationName:"statusFilter" type:"string" enum:"ExecutionStatus"` -} - -// String returns the string representation -func (s ListExecutionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListExecutionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListExecutionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListExecutionsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.StateMachineArn == nil { - invalidParams.Add(request.NewErrParamRequired("StateMachineArn")) - } - if s.StateMachineArn != nil && len(*s.StateMachineArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StateMachineArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListExecutionsInput) SetMaxResults(v int64) *ListExecutionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListExecutionsInput) SetNextToken(v string) *ListExecutionsInput { - s.NextToken = &v - return s -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *ListExecutionsInput) SetStateMachineArn(v string) *ListExecutionsInput { - s.StateMachineArn = &v - return s -} - -// SetStatusFilter sets the StatusFilter field's value. -func (s *ListExecutionsInput) SetStatusFilter(v string) *ListExecutionsInput { - s.StatusFilter = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListExecutionsOutput -type ListExecutionsOutput struct { - _ struct{} `type:"structure"` - - // The list of matching executions. - // - // Executions is a required field - Executions []*ExecutionListItem `locationName:"executions" type:"list" required:"true"` - - // If a nextToken is returned, there are more results available. To retrieve - // the next page of results, make the call again using the returned token in - // nextToken. Keep all other arguments unchanged. - // - // The configured maxResults determines how many results can be returned in - // a single call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListExecutionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListExecutionsOutput) GoString() string { - return s.String() -} - -// SetExecutions sets the Executions field's value. -func (s *ListExecutionsOutput) SetExecutions(v []*ExecutionListItem) *ListExecutionsOutput { - s.Executions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListExecutionsOutput) SetNextToken(v string) *ListExecutionsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListStateMachinesInput -type ListStateMachinesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results that will be returned per call. nextToken can - // be used to obtain further pages of results. The default is 100 and the maximum - // allowed page size is 1000. - // - // This is an upper limit only; the actual number of results returned per call - // may be fewer than the specified maximum. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // If a nextToken was returned by a previous call, there are more results available. - // To retrieve the next page of results, make the call again using the returned - // token in nextToken. Keep all other arguments unchanged. - // - // The configured maxResults determines how many results can be returned in - // a single call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListStateMachinesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStateMachinesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListStateMachinesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStateMachinesInput"} - 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 *ListStateMachinesInput) SetMaxResults(v int64) *ListStateMachinesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStateMachinesInput) SetNextToken(v string) *ListStateMachinesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListStateMachinesOutput -type ListStateMachinesOutput struct { - _ struct{} `type:"structure"` - - // If a nextToken is returned, there are more results available. To retrieve - // the next page of results, make the call again using the returned token in - // nextToken. Keep all other arguments unchanged. - // - // The configured maxResults determines how many results can be returned in - // a single call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // StateMachines is a required field - StateMachines []*StateMachineListItem `locationName:"stateMachines" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListStateMachinesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStateMachinesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStateMachinesOutput) SetNextToken(v string) *ListStateMachinesOutput { - s.NextToken = &v - return s -} - -// SetStateMachines sets the StateMachines field's value. -func (s *ListStateMachinesOutput) SetStateMachines(v []*StateMachineListItem) *ListStateMachinesOutput { - s.StateMachines = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskFailureInput -type SendTaskFailureInput struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string"` - - // An arbitrary error code that identifies the cause of the failure. - Error *string `locationName:"error" type:"string"` - - // The token that represents this task. Task tokens are generated by the service - // when the tasks are assigned to a worker (see GetActivityTask::taskToken). - // - // TaskToken is a required field - TaskToken *string `locationName:"taskToken" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SendTaskFailureInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendTaskFailureInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendTaskFailureInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendTaskFailureInput"} - if s.TaskToken == nil { - invalidParams.Add(request.NewErrParamRequired("TaskToken")) - } - if s.TaskToken != nil && len(*s.TaskToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCause sets the Cause field's value. -func (s *SendTaskFailureInput) SetCause(v string) *SendTaskFailureInput { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *SendTaskFailureInput) SetError(v string) *SendTaskFailureInput { - s.Error = &v - return s -} - -// SetTaskToken sets the TaskToken field's value. -func (s *SendTaskFailureInput) SetTaskToken(v string) *SendTaskFailureInput { - s.TaskToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskFailureOutput -type SendTaskFailureOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SendTaskFailureOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendTaskFailureOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskHeartbeatInput -type SendTaskHeartbeatInput struct { - _ struct{} `type:"structure"` - - // The token that represents this task. Task tokens are generated by the service - // when the tasks are assigned to a worker (see GetActivityTask::taskToken). - // - // TaskToken is a required field - TaskToken *string `locationName:"taskToken" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SendTaskHeartbeatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendTaskHeartbeatInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendTaskHeartbeatInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendTaskHeartbeatInput"} - if s.TaskToken == nil { - invalidParams.Add(request.NewErrParamRequired("TaskToken")) - } - if s.TaskToken != nil && len(*s.TaskToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTaskToken sets the TaskToken field's value. -func (s *SendTaskHeartbeatInput) SetTaskToken(v string) *SendTaskHeartbeatInput { - s.TaskToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskHeartbeatOutput -type SendTaskHeartbeatOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SendTaskHeartbeatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendTaskHeartbeatOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskSuccessInput -type SendTaskSuccessInput struct { - _ struct{} `type:"structure"` - - // The JSON output of the task. - // - // Output is a required field - Output *string `locationName:"output" type:"string" required:"true"` - - // The token that represents this task. Task tokens are generated by the service - // when the tasks are assigned to a worker (see GetActivityTask::taskToken). - // - // TaskToken is a required field - TaskToken *string `locationName:"taskToken" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SendTaskSuccessInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendTaskSuccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendTaskSuccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendTaskSuccessInput"} - if s.Output == nil { - invalidParams.Add(request.NewErrParamRequired("Output")) - } - if s.TaskToken == nil { - invalidParams.Add(request.NewErrParamRequired("TaskToken")) - } - if s.TaskToken != nil && len(*s.TaskToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOutput sets the Output field's value. -func (s *SendTaskSuccessInput) SetOutput(v string) *SendTaskSuccessInput { - s.Output = &v - return s -} - -// SetTaskToken sets the TaskToken field's value. -func (s *SendTaskSuccessInput) SetTaskToken(v string) *SendTaskSuccessInput { - s.TaskToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskSuccessOutput -type SendTaskSuccessOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SendTaskSuccessOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendTaskSuccessOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StartExecutionInput -type StartExecutionInput struct { - _ struct{} `type:"structure"` - - // The JSON input data for the execution. - Input *string `locationName:"input" type:"string"` - - // The name of the execution. This name must be unique for your AWS account - // and region. - Name *string `locationName:"name" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the state machine to execute. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartExecutionInput"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.StateMachineArn == nil { - invalidParams.Add(request.NewErrParamRequired("StateMachineArn")) - } - if s.StateMachineArn != nil && len(*s.StateMachineArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StateMachineArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInput sets the Input field's value. -func (s *StartExecutionInput) SetInput(v string) *StartExecutionInput { - s.Input = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartExecutionInput) SetName(v string) *StartExecutionInput { - s.Name = &v - return s -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *StartExecutionInput) SetStateMachineArn(v string) *StartExecutionInput { - s.StateMachineArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StartExecutionOutput -type StartExecutionOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that identifies the execution. - // - // ExecutionArn is a required field - ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` - - // The date the execution was started. - // - // StartDate is a required field - StartDate *time.Time `locationName:"startDate" type:"timestamp" timestampFormat:"unix" required:"true"` -} - -// String returns the string representation -func (s StartExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartExecutionOutput) GoString() string { - return s.String() -} - -// SetExecutionArn sets the ExecutionArn field's value. -func (s *StartExecutionOutput) SetExecutionArn(v string) *StartExecutionOutput { - s.ExecutionArn = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *StartExecutionOutput) SetStartDate(v time.Time) *StartExecutionOutput { - s.StartDate = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StateEnteredEventDetails -type StateEnteredEventDetails struct { - _ struct{} `type:"structure"` - - // The JSON input data to the state. - Input *string `locationName:"input" type:"string"` - - // The name of the state. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StateEnteredEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StateEnteredEventDetails) GoString() string { - return s.String() -} - -// SetInput sets the Input field's value. -func (s *StateEnteredEventDetails) SetInput(v string) *StateEnteredEventDetails { - s.Input = &v - return s -} - -// SetName sets the Name field's value. -func (s *StateEnteredEventDetails) SetName(v string) *StateEnteredEventDetails { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StateExitedEventDetails -type StateExitedEventDetails struct { - _ struct{} `type:"structure"` - - // The name of the state. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The JSON output data of the state. - Output *string `locationName:"output" type:"string"` -} - -// String returns the string representation -func (s StateExitedEventDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StateExitedEventDetails) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *StateExitedEventDetails) SetName(v string) *StateExitedEventDetails { - s.Name = &v - return s -} - -// SetOutput sets the Output field's value. -func (s *StateExitedEventDetails) SetOutput(v string) *StateExitedEventDetails { - s.Output = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StateMachineListItem -type StateMachineListItem struct { - _ struct{} `type:"structure"` - - // The date the state machine was created. - // - // CreationDate is a required field - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix" required:"true"` - - // The name of the state machine. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that identifies the state machine. - // - // StateMachineArn is a required field - StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StateMachineListItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StateMachineListItem) GoString() string { - return s.String() -} - -// SetCreationDate sets the CreationDate field's value. -func (s *StateMachineListItem) SetCreationDate(v time.Time) *StateMachineListItem { - s.CreationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *StateMachineListItem) SetName(v string) *StateMachineListItem { - s.Name = &v - return s -} - -// SetStateMachineArn sets the StateMachineArn field's value. -func (s *StateMachineListItem) SetStateMachineArn(v string) *StateMachineListItem { - s.StateMachineArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StopExecutionInput -type StopExecutionInput struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the termination. - Cause *string `locationName:"cause" type:"string"` - - // An arbitrary error code that identifies the cause of the termination. - Error *string `locationName:"error" type:"string"` - - // The Amazon Resource Name (ARN) of the execution to stop. - // - // ExecutionArn is a required field - ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopExecutionInput"} - if s.ExecutionArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionArn")) - } - if s.ExecutionArn != nil && len(*s.ExecutionArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCause sets the Cause field's value. -func (s *StopExecutionInput) SetCause(v string) *StopExecutionInput { - s.Cause = &v - return s -} - -// SetError sets the Error field's value. -func (s *StopExecutionInput) SetError(v string) *StopExecutionInput { - s.Error = &v - return s -} - -// SetExecutionArn sets the ExecutionArn field's value. -func (s *StopExecutionInput) SetExecutionArn(v string) *StopExecutionInput { - s.ExecutionArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StopExecutionOutput -type StopExecutionOutput struct { - _ struct{} `type:"structure"` - - // The date the execution was stopped. - // - // StopDate is a required field - StopDate *time.Time `locationName:"stopDate" type:"timestamp" timestampFormat:"unix" required:"true"` -} - -// String returns the string representation -func (s StopExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopExecutionOutput) GoString() string { - return s.String() -} - -// SetStopDate sets the StopDate field's value. -func (s *StopExecutionOutput) SetStopDate(v time.Time) *StopExecutionOutput { - s.StopDate = &v - return s -} - -const ( - // ExecutionStatusRunning is a ExecutionStatus enum value - ExecutionStatusRunning = "RUNNING" - - // ExecutionStatusSucceeded is a ExecutionStatus enum value - ExecutionStatusSucceeded = "SUCCEEDED" - - // ExecutionStatusFailed is a ExecutionStatus enum value - ExecutionStatusFailed = "FAILED" - - // ExecutionStatusTimedOut is a ExecutionStatus enum value - ExecutionStatusTimedOut = "TIMED_OUT" - - // ExecutionStatusAborted is a ExecutionStatus enum value - ExecutionStatusAborted = "ABORTED" -) - -const ( - // HistoryEventTypeActivityFailed is a HistoryEventType enum value - HistoryEventTypeActivityFailed = "ActivityFailed" - - // HistoryEventTypeActivityScheduleFailed is a HistoryEventType enum value - HistoryEventTypeActivityScheduleFailed = "ActivityScheduleFailed" - - // HistoryEventTypeActivityScheduled is a HistoryEventType enum value - HistoryEventTypeActivityScheduled = "ActivityScheduled" - - // HistoryEventTypeActivityStarted is a HistoryEventType enum value - HistoryEventTypeActivityStarted = "ActivityStarted" - - // HistoryEventTypeActivitySucceeded is a HistoryEventType enum value - HistoryEventTypeActivitySucceeded = "ActivitySucceeded" - - // HistoryEventTypeActivityTimedOut is a HistoryEventType enum value - HistoryEventTypeActivityTimedOut = "ActivityTimedOut" - - // HistoryEventTypeChoiceStateEntered is a HistoryEventType enum value - HistoryEventTypeChoiceStateEntered = "ChoiceStateEntered" - - // HistoryEventTypeChoiceStateExited is a HistoryEventType enum value - HistoryEventTypeChoiceStateExited = "ChoiceStateExited" - - // HistoryEventTypeExecutionFailed is a HistoryEventType enum value - HistoryEventTypeExecutionFailed = "ExecutionFailed" - - // HistoryEventTypeExecutionStarted is a HistoryEventType enum value - HistoryEventTypeExecutionStarted = "ExecutionStarted" - - // HistoryEventTypeExecutionSucceeded is a HistoryEventType enum value - HistoryEventTypeExecutionSucceeded = "ExecutionSucceeded" - - // HistoryEventTypeExecutionAborted is a HistoryEventType enum value - HistoryEventTypeExecutionAborted = "ExecutionAborted" - - // HistoryEventTypeExecutionTimedOut is a HistoryEventType enum value - HistoryEventTypeExecutionTimedOut = "ExecutionTimedOut" - - // HistoryEventTypeFailStateEntered is a HistoryEventType enum value - HistoryEventTypeFailStateEntered = "FailStateEntered" - - // HistoryEventTypeLambdaFunctionFailed is a HistoryEventType enum value - HistoryEventTypeLambdaFunctionFailed = "LambdaFunctionFailed" - - // HistoryEventTypeLambdaFunctionScheduleFailed is a HistoryEventType enum value - HistoryEventTypeLambdaFunctionScheduleFailed = "LambdaFunctionScheduleFailed" - - // HistoryEventTypeLambdaFunctionScheduled is a HistoryEventType enum value - HistoryEventTypeLambdaFunctionScheduled = "LambdaFunctionScheduled" - - // HistoryEventTypeLambdaFunctionStartFailed is a HistoryEventType enum value - HistoryEventTypeLambdaFunctionStartFailed = "LambdaFunctionStartFailed" - - // HistoryEventTypeLambdaFunctionStarted is a HistoryEventType enum value - HistoryEventTypeLambdaFunctionStarted = "LambdaFunctionStarted" - - // HistoryEventTypeLambdaFunctionSucceeded is a HistoryEventType enum value - HistoryEventTypeLambdaFunctionSucceeded = "LambdaFunctionSucceeded" - - // HistoryEventTypeLambdaFunctionTimedOut is a HistoryEventType enum value - HistoryEventTypeLambdaFunctionTimedOut = "LambdaFunctionTimedOut" - - // HistoryEventTypeSucceedStateEntered is a HistoryEventType enum value - HistoryEventTypeSucceedStateEntered = "SucceedStateEntered" - - // HistoryEventTypeSucceedStateExited is a HistoryEventType enum value - HistoryEventTypeSucceedStateExited = "SucceedStateExited" - - // HistoryEventTypeTaskStateEntered is a HistoryEventType enum value - HistoryEventTypeTaskStateEntered = "TaskStateEntered" - - // HistoryEventTypeTaskStateExited is a HistoryEventType enum value - HistoryEventTypeTaskStateExited = "TaskStateExited" - - // HistoryEventTypePassStateEntered is a HistoryEventType enum value - HistoryEventTypePassStateEntered = "PassStateEntered" - - // HistoryEventTypePassStateExited is a HistoryEventType enum value - HistoryEventTypePassStateExited = "PassStateExited" - - // HistoryEventTypeParallelStateEntered is a HistoryEventType enum value - HistoryEventTypeParallelStateEntered = "ParallelStateEntered" - - // HistoryEventTypeParallelStateExited is a HistoryEventType enum value - HistoryEventTypeParallelStateExited = "ParallelStateExited" - - // HistoryEventTypeWaitStateEntered is a HistoryEventType enum value - HistoryEventTypeWaitStateEntered = "WaitStateEntered" - - // HistoryEventTypeWaitStateExited is a HistoryEventType enum value - HistoryEventTypeWaitStateExited = "WaitStateExited" -) - -const ( - // StateMachineStatusActive is a StateMachineStatus enum value - StateMachineStatusActive = "ACTIVE" - - // StateMachineStatusDeleting is a StateMachineStatus enum value - StateMachineStatusDeleting = "DELETING" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go deleted file mode 100644 index 2a438eb..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go +++ /dev/null @@ -1,115 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package sfn - -const ( - - // ErrCodeActivityDoesNotExist for service response error code - // "ActivityDoesNotExist". - // - // The specified activity does not exist. - ErrCodeActivityDoesNotExist = "ActivityDoesNotExist" - - // ErrCodeActivityLimitExceeded for service response error code - // "ActivityLimitExceeded". - // - // The maximum number of activities has been reached. Existing activities must - // be deleted before a new activity can be created. - ErrCodeActivityLimitExceeded = "ActivityLimitExceeded" - - // ErrCodeActivityWorkerLimitExceeded for service response error code - // "ActivityWorkerLimitExceeded". - // - // The maximum number of workers concurrently polling for activity tasks has - // been reached. - ErrCodeActivityWorkerLimitExceeded = "ActivityWorkerLimitExceeded" - - // ErrCodeExecutionAlreadyExists for service response error code - // "ExecutionAlreadyExists". - // - // An execution with the same name already exists. - ErrCodeExecutionAlreadyExists = "ExecutionAlreadyExists" - - // ErrCodeExecutionDoesNotExist for service response error code - // "ExecutionDoesNotExist". - // - // The specified execution does not exist. - ErrCodeExecutionDoesNotExist = "ExecutionDoesNotExist" - - // ErrCodeExecutionLimitExceeded for service response error code - // "ExecutionLimitExceeded". - // - // The maximum number of running executions has been reached. Running executions - // must end or be stopped before a new execution can be started. - ErrCodeExecutionLimitExceeded = "ExecutionLimitExceeded" - - // ErrCodeInvalidArn for service response error code - // "InvalidArn". - // - // The provided Amazon Resource Name (ARN) is invalid. - ErrCodeInvalidArn = "InvalidArn" - - // ErrCodeInvalidDefinition for service response error code - // "InvalidDefinition". - // - // The provided Amazon States Language definition is invalid. - ErrCodeInvalidDefinition = "InvalidDefinition" - - // ErrCodeInvalidExecutionInput for service response error code - // "InvalidExecutionInput". - // - // The provided JSON input data is invalid. - ErrCodeInvalidExecutionInput = "InvalidExecutionInput" - - // ErrCodeInvalidName for service response error code - // "InvalidName". - // - // The provided name is invalid. - ErrCodeInvalidName = "InvalidName" - - // ErrCodeInvalidOutput for service response error code - // "InvalidOutput". - // - // The provided JSON output data is invalid. - ErrCodeInvalidOutput = "InvalidOutput" - - // ErrCodeInvalidToken for service response error code - // "InvalidToken". - // - // The provided token is invalid. - ErrCodeInvalidToken = "InvalidToken" - - // ErrCodeStateMachineAlreadyExists for service response error code - // "StateMachineAlreadyExists". - // - // A state machine with the same name but a different definition or role ARN - // already exists. - ErrCodeStateMachineAlreadyExists = "StateMachineAlreadyExists" - - // ErrCodeStateMachineDeleting for service response error code - // "StateMachineDeleting". - // - // The specified state machine is being deleted. - ErrCodeStateMachineDeleting = "StateMachineDeleting" - - // ErrCodeStateMachineDoesNotExist for service response error code - // "StateMachineDoesNotExist". - // - // The specified state machine does not exist. - ErrCodeStateMachineDoesNotExist = "StateMachineDoesNotExist" - - // ErrCodeStateMachineLimitExceeded for service response error code - // "StateMachineLimitExceeded". - // - // The maximum number of state machines has been reached. Existing state machines - // must be deleted before a new state machine can be created. - ErrCodeStateMachineLimitExceeded = "StateMachineLimitExceeded" - - // ErrCodeTaskDoesNotExist for service response error code - // "TaskDoesNotExist". - ErrCodeTaskDoesNotExist = "TaskDoesNotExist" - - // ErrCodeTaskTimedOut for service response error code - // "TaskTimedOut". - ErrCodeTaskTimedOut = "TaskTimedOut" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go b/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go deleted file mode 100644 index 77bf817..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package sfn - -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" -) - -// AWS Step Functions is a web service that enables you to coordinate the components -// of distributed applications and microservices using visual workflows. You -// build applications from individual components that each perform a discrete -// function, or task, allowing you to scale and change applications quickly. -// Step Functions provides a graphical console to visualize the components of -// your application as a series of steps. It automatically triggers and tracks -// each step, and retries when there are errors, so your application executes -// in order and as expected, every time. Step Functions logs the state of each -// step, so when things do go wrong, you can diagnose and debug problems quickly. -// -// Step Functions manages the operations and underlying infrastructure for you -// to ensure your application is available at any scale. You can run tasks on -// the AWS cloud, on your own servers, or an any system that has access to AWS. -// Step Functions can be accessed and used with the Step Functions console, -// the AWS SDKs (included with your Beta release invitation email), or an HTTP -// API (the subject of this document). -// 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/states-2016-11-23 -type SFN 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 = "states" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the SFN 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 SFN client from just a session. -// svc := sfn.New(mySession) -// -// // Create a SFN client with additional configuration -// svc := sfn.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SFN { - 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) *SFN { - svc := &SFN{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-11-23", - JSONVersion: "1.0", - TargetPrefix: "AWSStepFunctions", - }, - 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 SFN operation and runs any -// custom request initialization. -func (c *SFN) 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/simpledb/api.go b/vendor/github.com/aws/aws-sdk-go/service/simpledb/api.go deleted file mode 100644 index 9308ec3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/api.go +++ /dev/null @@ -1,2189 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package simpledb provides a client for Amazon SimpleDB. -package simpledb - -import ( - "fmt" - - "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 opBatchDeleteAttributes = "BatchDeleteAttributes" - -// BatchDeleteAttributesRequest generates a "aws/request.Request" representing the -// client's request for the BatchDeleteAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchDeleteAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchDeleteAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchDeleteAttributesRequest method. -// req, resp := client.BatchDeleteAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchDeleteAttributes -func (c *SimpleDB) BatchDeleteAttributesRequest(input *BatchDeleteAttributesInput) (req *request.Request, output *BatchDeleteAttributesOutput) { - op := &request.Operation{ - Name: opBatchDeleteAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchDeleteAttributesInput{} - } - - output = &BatchDeleteAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// BatchDeleteAttributes API operation for Amazon SimpleDB. -// -// Performs multiple DeleteAttributes operations in a single call, which reduces -// round trips and latencies. This enables Amazon SimpleDB to optimize requests, -// which generally yields better throughput. -// -// If you specify BatchDeleteAttributes without attributes or values, all the -// attributes for the item are deleted. -// -// BatchDeleteAttributes is an idempotent operation; running it multiple times -// on the same item or attribute doesn't result in an error. -// -// The BatchDeleteAttributes operation succeeds or fails in its entirety. There -// are no partial deletes. You can execute multiple BatchDeleteAttributes operations -// and other operations in parallel. However, large numbers of concurrent BatchDeleteAttributes -// calls can result in Service Unavailable (503) responses. -// -// This operation is vulnerable to exceeding the maximum URL size when making -// a REST request using the HTTP GET method. -// -// This operation does not support conditions using Expected.X.Name, Expected.X.Value, -// or Expected.X.Exists. -// -// The following limitations are enforced for this operation: 1 MB request size -// -// 25 item limit per BatchDeleteAttributes 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 SimpleDB's -// API operation BatchDeleteAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchDeleteAttributes -func (c *SimpleDB) BatchDeleteAttributes(input *BatchDeleteAttributesInput) (*BatchDeleteAttributesOutput, error) { - req, out := c.BatchDeleteAttributesRequest(input) - err := req.Send() - return out, err -} - -const opBatchPutAttributes = "BatchPutAttributes" - -// BatchPutAttributesRequest generates a "aws/request.Request" representing the -// client's request for the BatchPutAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchPutAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchPutAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchPutAttributesRequest method. -// req, resp := client.BatchPutAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchPutAttributes -func (c *SimpleDB) BatchPutAttributesRequest(input *BatchPutAttributesInput) (req *request.Request, output *BatchPutAttributesOutput) { - op := &request.Operation{ - Name: opBatchPutAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchPutAttributesInput{} - } - - output = &BatchPutAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// BatchPutAttributes API operation for Amazon SimpleDB. -// -// The BatchPutAttributes operation creates or replaces attributes within one -// or more items. By using this operation, the client can perform multiple PutAttribute -// operation with a single call. This helps yield savings in round trips and -// latencies, enabling Amazon SimpleDB to optimize requests and generally produce -// better throughput. -// -// The client may specify the item name with the Item.X.ItemName parameter. -// The client may specify new attributes using a combination of the Item.X.Attribute.Y.Name -// and Item.X.Attribute.Y.Value parameters. The client may specify the first -// attribute for the first item using the parameters Item.0.Attribute.0.Name -// and Item.0.Attribute.0.Value, and for the second attribute for the first -// item by the parameters Item.0.Attribute.1.Name and Item.0.Attribute.1.Value, -// and so on. -// -// Attributes are uniquely identified within an item by their name/value combination. -// For example, a single item can have the attributes { "first_name", "first_value" -// } and { "first_name", "second_value" }. However, it cannot have two attribute -// instances where both the Item.X.Attribute.Y.Name and Item.X.Attribute.Y.Value -// are the same. -// -// Optionally, the requester can supply the Replace parameter for each individual -// value. Setting this value to true will cause the new attribute values to -// replace the existing attribute values. For example, if an item I has the -// attributes { 'a', '1' }, { 'b', '2'} and { 'b', '3' } and the requester does -// a BatchPutAttributes of {'I', 'b', '4' } with the Replace parameter set to -// true, the final attributes of the item will be { 'a', '1' } and { 'b', '4' -// }, replacing the previous values of the 'b' attribute with the new value. -// -// You cannot specify an empty string as an item or as an attribute name. The -// BatchPutAttributes operation succeeds or fails in its entirety. There are -// no partial puts. This operation is vulnerable to exceeding the maximum URL size when making -// a REST request using the HTTP GET method. This operation does not support -// conditions using Expected.X.Name, Expected.X.Value, or Expected.X.Exists. -// You can execute multiple BatchPutAttributes operations and other operations -// in parallel. However, large numbers of concurrent BatchPutAttributes calls -// can result in Service Unavailable (503) responses. -// -// The following limitations are enforced for this operation: 256 attribute -// name-value pairs per item -// 1 MB request size -// 1 billion attributes per domain -// 10 GB of total user data storage per domain -// 25 item limit per BatchPutAttributes 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 SimpleDB's -// API operation BatchPutAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDuplicateItemName "DuplicateItemName" -// The item name was specified more than once. -// -// * ErrCodeInvalidParameterValue "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeMissingParameter "MissingParameter" -// The request must contain the specified missing parameter. -// -// * ErrCodeNoSuchDomain "NoSuchDomain" -// The specified domain does not exist. -// -// * ErrCodeNumberItemAttributesExceeded "NumberItemAttributesExceeded" -// Too many attributes in this item. -// -// * ErrCodeNumberDomainAttributesExceeded "NumberDomainAttributesExceeded" -// Too many attributes in this domain. -// -// * ErrCodeNumberDomainBytesExceeded "NumberDomainBytesExceeded" -// Too many bytes in this domain. -// -// * ErrCodeNumberSubmittedItemsExceeded "NumberSubmittedItemsExceeded" -// Too many items exist in a single call. -// -// * ErrCodeNumberSubmittedAttributesExceeded "NumberSubmittedAttributesExceeded" -// Too many attributes exist in a single call. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchPutAttributes -func (c *SimpleDB) BatchPutAttributes(input *BatchPutAttributesInput) (*BatchPutAttributesOutput, error) { - req, out := c.BatchPutAttributesRequest(input) - err := req.Send() - return out, err -} - -const opCreateDomain = "CreateDomain" - -// CreateDomainRequest generates a "aws/request.Request" representing the -// client's request for the CreateDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDomainRequest method. -// req, resp := client.CreateDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//CreateDomain -func (c *SimpleDB) CreateDomainRequest(input *CreateDomainInput) (req *request.Request, output *CreateDomainOutput) { - op := &request.Operation{ - Name: opCreateDomain, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDomainInput{} - } - - output = &CreateDomainOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateDomain API operation for Amazon SimpleDB. -// -// The CreateDomain operation creates a new domain. The domain name should be -// unique among the domains associated with the Access Key ID provided in the -// request. The CreateDomain operation may take 10 or more seconds to complete. -// -// CreateDomain is an idempotent operation; running it multiple times using -// the same domain name will not result in an error response. The client can create up to 100 domains per account. -// -// If the client requires additional domains, go to http://aws.amazon.com/contact-us/simpledb-limit-request/ -// (http://aws.amazon.com/contact-us/simpledb-limit-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 SimpleDB's -// API operation CreateDomain for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValue "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeMissingParameter "MissingParameter" -// The request must contain the specified missing parameter. -// -// * ErrCodeNumberDomainsExceeded "NumberDomainsExceeded" -// Too many domains exist per this account. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//CreateDomain -func (c *SimpleDB) CreateDomain(input *CreateDomainInput) (*CreateDomainOutput, error) { - req, out := c.CreateDomainRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAttributes = "DeleteAttributes" - -// DeleteAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAttributesRequest method. -// req, resp := client.DeleteAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteAttributes -func (c *SimpleDB) DeleteAttributesRequest(input *DeleteAttributesInput) (req *request.Request, output *DeleteAttributesOutput) { - op := &request.Operation{ - Name: opDeleteAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAttributesInput{} - } - - output = &DeleteAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAttributes API operation for Amazon SimpleDB. -// -// Deletes one or more attributes associated with an item. If all attributes -// of the item are deleted, the item is deleted. -// -// If DeleteAttributes is called without being passed any attributes or values -// specified, all the attributes for the item are deleted. DeleteAttributes is an idempotent operation; running it multiple times on -// the same item or attribute does not result in an error response. -// -// Because Amazon SimpleDB makes multiple copies of item data and uses an eventual -// consistency update model, performing a GetAttributes or Select operation -// (read) immediately after a DeleteAttributes or PutAttributes operation (write) -// might not return updated item data. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon SimpleDB's -// API operation DeleteAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValue "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeMissingParameter "MissingParameter" -// The request must contain the specified missing parameter. -// -// * ErrCodeNoSuchDomain "NoSuchDomain" -// The specified domain does not exist. -// -// * ErrCodeAttributeDoesNotExist "AttributeDoesNotExist" -// The specified attribute does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteAttributes -func (c *SimpleDB) DeleteAttributes(input *DeleteAttributesInput) (*DeleteAttributesOutput, error) { - req, out := c.DeleteAttributesRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDomain = "DeleteDomain" - -// DeleteDomainRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDomain operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDomain for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDomain method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDomainRequest method. -// req, resp := client.DeleteDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteDomain -func (c *SimpleDB) DeleteDomainRequest(input *DeleteDomainInput) (req *request.Request, output *DeleteDomainOutput) { - op := &request.Operation{ - Name: opDeleteDomain, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDomainInput{} - } - - output = &DeleteDomainOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDomain API operation for Amazon SimpleDB. -// -// The DeleteDomain operation deletes a domain. Any items (and their attributes) -// in the domain are deleted as well. The DeleteDomain operation might take -// 10 or more seconds to complete. -// -// Running DeleteDomain on a domain that does not exist or running the function -// multiple times using the same domain name will not result in an error 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 SimpleDB's -// API operation DeleteDomain for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMissingParameter "MissingParameter" -// The request must contain the specified missing parameter. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteDomain -func (c *SimpleDB) DeleteDomain(input *DeleteDomainInput) (*DeleteDomainOutput, error) { - req, out := c.DeleteDomainRequest(input) - err := req.Send() - return out, err -} - -const opDomainMetadata = "DomainMetadata" - -// DomainMetadataRequest generates a "aws/request.Request" representing the -// client's request for the DomainMetadata operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DomainMetadata for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DomainMetadata method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DomainMetadataRequest method. -// req, resp := client.DomainMetadataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DomainMetadata -func (c *SimpleDB) DomainMetadataRequest(input *DomainMetadataInput) (req *request.Request, output *DomainMetadataOutput) { - op := &request.Operation{ - Name: opDomainMetadata, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DomainMetadataInput{} - } - - output = &DomainMetadataOutput{} - req = c.newRequest(op, input, output) - return -} - -// DomainMetadata API operation for Amazon SimpleDB. -// -// Returns information about the domain, including when the domain was created, -// the number of items and attributes in the domain, and the size of the attribute -// names and values. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon SimpleDB's -// API operation DomainMetadata for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMissingParameter "MissingParameter" -// The request must contain the specified missing parameter. -// -// * ErrCodeNoSuchDomain "NoSuchDomain" -// The specified domain does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DomainMetadata -func (c *SimpleDB) DomainMetadata(input *DomainMetadataInput) (*DomainMetadataOutput, error) { - req, out := c.DomainMetadataRequest(input) - err := req.Send() - return out, err -} - -const opGetAttributes = "GetAttributes" - -// GetAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAttributesRequest method. -// req, resp := client.GetAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//GetAttributes -func (c *SimpleDB) GetAttributesRequest(input *GetAttributesInput) (req *request.Request, output *GetAttributesOutput) { - op := &request.Operation{ - Name: opGetAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAttributesInput{} - } - - output = &GetAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAttributes API operation for Amazon SimpleDB. -// -// Returns all of the attributes associated with the specified item. Optionally, -// the attributes returned can be limited to one or more attributes by specifying -// an attribute name parameter. -// -// If the item does not exist on the replica that was accessed for this operation, -// an empty set is returned. The system does not return an error as it cannot -// guarantee the item does not exist on other replicas. -// -// If GetAttributes is called without being passed any attribute names, all -// the attributes for the item 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 SimpleDB's -// API operation GetAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValue "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeMissingParameter "MissingParameter" -// The request must contain the specified missing parameter. -// -// * ErrCodeNoSuchDomain "NoSuchDomain" -// The specified domain does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//GetAttributes -func (c *SimpleDB) GetAttributes(input *GetAttributesInput) (*GetAttributesOutput, error) { - req, out := c.GetAttributesRequest(input) - err := req.Send() - return out, err -} - -const opListDomains = "ListDomains" - -// ListDomainsRequest generates a "aws/request.Request" representing the -// client's request for the ListDomains operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDomains for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDomains method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDomainsRequest method. -// req, resp := client.ListDomainsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ListDomains -func (c *SimpleDB) ListDomainsRequest(input *ListDomainsInput) (req *request.Request, output *ListDomainsOutput) { - op := &request.Operation{ - Name: opListDomains, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxNumberOfDomains", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDomainsInput{} - } - - output = &ListDomainsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDomains API operation for Amazon SimpleDB. -// -// The ListDomains operation lists all domains associated with the Access Key -// ID. It returns domain names up to the limit set by MaxNumberOfDomains (#MaxNumberOfDomains). -// A NextToken (#NextToken) is returned if there are more than MaxNumberOfDomains -// domains. Calling ListDomains successive times with the NextToken provided -// by the operation returns up to MaxNumberOfDomains more domain names with -// each successive operation 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 SimpleDB's -// API operation ListDomains for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValue "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified NextToken is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ListDomains -func (c *SimpleDB) ListDomains(input *ListDomainsInput) (*ListDomainsOutput, error) { - req, out := c.ListDomainsRequest(input) - err := req.Send() - return out, err -} - -// ListDomainsPages iterates over the pages of a ListDomains operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDomains 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 ListDomains operation. -// pageNum := 0 -// err := client.ListDomainsPages(params, -// func(page *ListDomainsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SimpleDB) ListDomainsPages(input *ListDomainsInput, fn func(p *ListDomainsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDomainsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDomainsOutput), lastPage) - }) -} - -const opPutAttributes = "PutAttributes" - -// PutAttributesRequest generates a "aws/request.Request" representing the -// client's request for the PutAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutAttributesRequest method. -// req, resp := client.PutAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//PutAttributes -func (c *SimpleDB) PutAttributesRequest(input *PutAttributesInput) (req *request.Request, output *PutAttributesOutput) { - op := &request.Operation{ - Name: opPutAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutAttributesInput{} - } - - output = &PutAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutAttributes API operation for Amazon SimpleDB. -// -// The PutAttributes operation creates or replaces attributes in an item. The -// client may specify new attributes using a combination of the Attribute.X.Name -// and Attribute.X.Value parameters. The client specifies the first attribute -// by the parameters Attribute.0.Name and Attribute.0.Value, the second attribute -// by the parameters Attribute.1.Name and Attribute.1.Value, and so on. -// -// Attributes are uniquely identified in an item by their name/value combination. -// For example, a single item can have the attributes { "first_name", "first_value" -// } and { "first_name", second_value" }. However, it cannot have two attribute -// instances where both the Attribute.X.Name and Attribute.X.Value are the same. -// -// Optionally, the requestor can supply the Replace parameter for each individual -// attribute. Setting this value to true causes the new attribute value to replace -// the existing attribute value(s). For example, if an item has the attributes -// { 'a', '1' }, { 'b', '2'} and { 'b', '3' } and the requestor calls PutAttributes -// using the attributes { 'b', '4' } with the Replace parameter set to true, -// the final attributes of the item are changed to { 'a', '1' } and { 'b', '4' -// }, which replaces the previous values of the 'b' attribute with the new value. -// -// Using PutAttributes to replace attribute values that do not exist will not -// result in an error response. You cannot specify an empty string as an attribute name. -// -// Because Amazon SimpleDB makes multiple copies of client data and uses an -// eventual consistency update model, an immediate GetAttributes or Select operation -// (read) immediately after a PutAttributes or DeleteAttributes operation (write) -// might not return the updated data. -// -// The following limitations are enforced for this operation: 256 total attribute -// name-value pairs per item -// One billion attributes per domain -// 10 GB of total user data storage per domain -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon SimpleDB's -// API operation PutAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValue "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeMissingParameter "MissingParameter" -// The request must contain the specified missing parameter. -// -// * ErrCodeNoSuchDomain "NoSuchDomain" -// The specified domain does not exist. -// -// * ErrCodeNumberDomainAttributesExceeded "NumberDomainAttributesExceeded" -// Too many attributes in this domain. -// -// * ErrCodeNumberDomainBytesExceeded "NumberDomainBytesExceeded" -// Too many bytes in this domain. -// -// * ErrCodeNumberItemAttributesExceeded "NumberItemAttributesExceeded" -// Too many attributes in this item. -// -// * ErrCodeAttributeDoesNotExist "AttributeDoesNotExist" -// The specified attribute does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//PutAttributes -func (c *SimpleDB) PutAttributes(input *PutAttributesInput) (*PutAttributesOutput, error) { - req, out := c.PutAttributesRequest(input) - err := req.Send() - return out, err -} - -const opSelect = "Select" - -// SelectRequest generates a "aws/request.Request" representing the -// client's request for the Select operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Select for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Select method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SelectRequest method. -// req, resp := client.SelectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//Select -func (c *SimpleDB) SelectRequest(input *SelectInput) (req *request.Request, output *SelectOutput) { - op := &request.Operation{ - Name: opSelect, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &SelectInput{} - } - - output = &SelectOutput{} - req = c.newRequest(op, input, output) - return -} - -// Select API operation for Amazon SimpleDB. -// -// The Select operation returns a set of attributes for ItemNames that match -// the select expression. Select is similar to the standard SQL SELECT statement. -// -// The total size of the response cannot exceed 1 MB in total size. Amazon SimpleDB -// automatically adjusts the number of items returned per page to enforce this -// limit. For example, if the client asks to retrieve 2500 items, but each individual -// item is 10 kB in size, the system returns 100 items and an appropriate NextToken -// so the client can access the next page of results. -// -// For information on how to construct select expressions, see Using Select -// to Create Amazon SimpleDB Queries in the 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 SimpleDB's -// API operation Select for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValue "InvalidParameterValue" -// The value for a parameter is invalid. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified NextToken is not valid. -// -// * ErrCodeInvalidNumberPredicates "InvalidNumberPredicates" -// Too many predicates exist in the query expression. -// -// * ErrCodeInvalidNumberValueTests "InvalidNumberValueTests" -// Too many predicates exist in the query expression. -// -// * ErrCodeInvalidQueryExpression "InvalidQueryExpression" -// The specified query expression syntax is not valid. -// -// * ErrCodeMissingParameter "MissingParameter" -// The request must contain the specified missing parameter. -// -// * ErrCodeNoSuchDomain "NoSuchDomain" -// The specified domain does not exist. -// -// * ErrCodeRequestTimeout "RequestTimeout" -// A timeout occurred when attempting to query the specified domain with specified -// query expression. -// -// * ErrCodeTooManyRequestedAttributes "TooManyRequestedAttributes" -// Too many attributes requested. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI//Select -func (c *SimpleDB) Select(input *SelectInput) (*SelectOutput, error) { - req, out := c.SelectRequest(input) - err := req.Send() - return out, err -} - -// SelectPages iterates over the pages of a Select operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Select 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 Select operation. -// pageNum := 0 -// err := client.SelectPages(params, -// func(page *SelectOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SimpleDB) SelectPages(input *SelectInput, fn func(p *SelectOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.SelectRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*SelectOutput), lastPage) - }) -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//Attribute -type Attribute struct { - _ struct{} `type:"structure"` - - AlternateNameEncoding *string `type:"string"` - - AlternateValueEncoding *string `type:"string"` - - // The name of the attribute. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The value of the attribute. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Attribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Attribute) GoString() string { - return s.String() -} - -// SetAlternateNameEncoding sets the AlternateNameEncoding field's value. -func (s *Attribute) SetAlternateNameEncoding(v string) *Attribute { - s.AlternateNameEncoding = &v - return s -} - -// SetAlternateValueEncoding sets the AlternateValueEncoding field's value. -func (s *Attribute) SetAlternateValueEncoding(v string) *Attribute { - s.AlternateValueEncoding = &v - return s -} - -// SetName sets the Name field's value. -func (s *Attribute) SetName(v string) *Attribute { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Attribute) SetValue(v string) *Attribute { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchDeleteAttributesRequest -type BatchDeleteAttributesInput struct { - _ struct{} `type:"structure"` - - // The name of the domain in which the attributes are being deleted. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // A list of items on which to perform the operation. - // - // Items is a required field - Items []*DeletableItem `locationNameList:"Item" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s BatchDeleteAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchDeleteAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchDeleteAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchDeleteAttributesInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.Items == nil { - invalidParams.Add(request.NewErrParamRequired("Items")) - } - 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 -} - -// SetDomainName sets the DomainName field's value. -func (s *BatchDeleteAttributesInput) SetDomainName(v string) *BatchDeleteAttributesInput { - s.DomainName = &v - return s -} - -// SetItems sets the Items field's value. -func (s *BatchDeleteAttributesInput) SetItems(v []*DeletableItem) *BatchDeleteAttributesInput { - s.Items = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchDeleteAttributesOutput -type BatchDeleteAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s BatchDeleteAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchDeleteAttributesOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchPutAttributesRequest -type BatchPutAttributesInput struct { - _ struct{} `type:"structure"` - - // The name of the domain in which the attributes are being stored. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // A list of items on which to perform the operation. - // - // Items is a required field - Items []*ReplaceableItem `locationNameList:"Item" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s BatchPutAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchPutAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchPutAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchPutAttributesInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.Items == nil { - invalidParams.Add(request.NewErrParamRequired("Items")) - } - 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 -} - -// SetDomainName sets the DomainName field's value. -func (s *BatchPutAttributesInput) SetDomainName(v string) *BatchPutAttributesInput { - s.DomainName = &v - return s -} - -// SetItems sets the Items field's value. -func (s *BatchPutAttributesInput) SetItems(v []*ReplaceableItem) *BatchPutAttributesInput { - s.Items = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//BatchPutAttributesOutput -type BatchPutAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s BatchPutAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchPutAttributesOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//CreateDomainRequest -type CreateDomainInput struct { - _ struct{} `type:"structure"` - - // The name of the domain to create. The name can range between 3 and 255 characters - // and can contain the following characters: a-z, A-Z, 0-9, '_', '-', and '.'. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDomainInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *CreateDomainInput) SetDomainName(v string) *CreateDomainInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//CreateDomainOutput -type CreateDomainOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDomainOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeletableAttribute -type DeletableAttribute struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The value of the attribute. - Value *string `type:"string"` -} - -// String returns the string representation -func (s DeletableAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletableAttribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletableAttribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletableAttribute"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeletableAttribute) SetName(v string) *DeletableAttribute { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *DeletableAttribute) SetValue(v string) *DeletableAttribute { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeletableItem -type DeletableItem struct { - _ struct{} `type:"structure"` - - Attributes []*DeletableAttribute `locationNameList:"Attribute" type:"list" flattened:"true"` - - // Name is a required field - Name *string `locationName:"ItemName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletableItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletableItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletableItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletableItem"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *DeletableItem) SetAttributes(v []*DeletableAttribute) *DeletableItem { - s.Attributes = v - return s -} - -// SetName sets the Name field's value. -func (s *DeletableItem) SetName(v string) *DeletableItem { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteAttributesRequest -type DeleteAttributesInput struct { - _ struct{} `type:"structure"` - - // A list of Attributes. Similar to columns on a spreadsheet, attributes represent - // categories of data that can be assigned to items. - Attributes []*DeletableAttribute `locationNameList:"Attribute" type:"list" flattened:"true"` - - // The name of the domain in which to perform the operation. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // The update condition which, if specified, determines whether the specified - // attributes will be deleted or not. The update condition must be satisfied - // in order for this request to be processed and the attributes to be deleted. - Expected *UpdateCondition `type:"structure"` - - // The name of the item. Similar to rows on a spreadsheet, items represent individual - // objects that contain one or more value-attribute pairs. - // - // ItemName is a required field - ItemName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAttributesInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.ItemName == nil { - invalidParams.Add(request.NewErrParamRequired("ItemName")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *DeleteAttributesInput) SetAttributes(v []*DeletableAttribute) *DeleteAttributesInput { - s.Attributes = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *DeleteAttributesInput) SetDomainName(v string) *DeleteAttributesInput { - s.DomainName = &v - return s -} - -// SetExpected sets the Expected field's value. -func (s *DeleteAttributesInput) SetExpected(v *UpdateCondition) *DeleteAttributesInput { - s.Expected = v - return s -} - -// SetItemName sets the ItemName field's value. -func (s *DeleteAttributesInput) SetItemName(v string) *DeleteAttributesInput { - s.ItemName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteAttributesOutput -type DeleteAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAttributesOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteDomainRequest -type DeleteDomainInput struct { - _ struct{} `type:"structure"` - - // The name of the domain to delete. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDomainInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDomainInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DeleteDomainInput) SetDomainName(v string) *DeleteDomainInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DeleteDomainOutput -type DeleteDomainOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDomainOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDomainOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DomainMetadataRequest -type DomainMetadataInput struct { - _ struct{} `type:"structure"` - - // The name of the domain for which to display the metadata of. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DomainMetadataInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DomainMetadataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DomainMetadataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DomainMetadataInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *DomainMetadataInput) SetDomainName(v string) *DomainMetadataInput { - s.DomainName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//DomainMetadataResult -type DomainMetadataOutput struct { - _ struct{} `type:"structure"` - - // The number of unique attribute names in the domain. - AttributeNameCount *int64 `type:"integer"` - - // The total size of all unique attribute names in the domain, in bytes. - AttributeNamesSizeBytes *int64 `type:"long"` - - // The number of all attribute name/value pairs in the domain. - AttributeValueCount *int64 `type:"integer"` - - // The total size of all attribute values in the domain, in bytes. - AttributeValuesSizeBytes *int64 `type:"long"` - - // The number of all items in the domain. - ItemCount *int64 `type:"integer"` - - // The total size of all item names in the domain, in bytes. - ItemNamesSizeBytes *int64 `type:"long"` - - // The data and time when metadata was calculated, in Epoch (UNIX) seconds. - Timestamp *int64 `type:"integer"` -} - -// String returns the string representation -func (s DomainMetadataOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DomainMetadataOutput) GoString() string { - return s.String() -} - -// SetAttributeNameCount sets the AttributeNameCount field's value. -func (s *DomainMetadataOutput) SetAttributeNameCount(v int64) *DomainMetadataOutput { - s.AttributeNameCount = &v - return s -} - -// SetAttributeNamesSizeBytes sets the AttributeNamesSizeBytes field's value. -func (s *DomainMetadataOutput) SetAttributeNamesSizeBytes(v int64) *DomainMetadataOutput { - s.AttributeNamesSizeBytes = &v - return s -} - -// SetAttributeValueCount sets the AttributeValueCount field's value. -func (s *DomainMetadataOutput) SetAttributeValueCount(v int64) *DomainMetadataOutput { - s.AttributeValueCount = &v - return s -} - -// SetAttributeValuesSizeBytes sets the AttributeValuesSizeBytes field's value. -func (s *DomainMetadataOutput) SetAttributeValuesSizeBytes(v int64) *DomainMetadataOutput { - s.AttributeValuesSizeBytes = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *DomainMetadataOutput) SetItemCount(v int64) *DomainMetadataOutput { - s.ItemCount = &v - return s -} - -// SetItemNamesSizeBytes sets the ItemNamesSizeBytes field's value. -func (s *DomainMetadataOutput) SetItemNamesSizeBytes(v int64) *DomainMetadataOutput { - s.ItemNamesSizeBytes = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *DomainMetadataOutput) SetTimestamp(v int64) *DomainMetadataOutput { - s.Timestamp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//GetAttributesRequest -type GetAttributesInput struct { - _ struct{} `type:"structure"` - - // The names of the attributes. - AttributeNames []*string `locationNameList:"AttributeName" type:"list" flattened:"true"` - - // Determines whether or not strong consistency should be enforced when data - // is read from SimpleDB. If true - ConsistentRead *bool `type:"boolean"` - - // The name of the domain in which to perform the operation. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // The name of the item. - // - // ItemName is a required field - ItemName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAttributesInput"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.ItemName == nil { - invalidParams.Add(request.NewErrParamRequired("ItemName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeNames sets the AttributeNames field's value. -func (s *GetAttributesInput) SetAttributeNames(v []*string) *GetAttributesInput { - s.AttributeNames = v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *GetAttributesInput) SetConsistentRead(v bool) *GetAttributesInput { - s.ConsistentRead = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *GetAttributesInput) SetDomainName(v string) *GetAttributesInput { - s.DomainName = &v - return s -} - -// SetItemName sets the ItemName field's value. -func (s *GetAttributesInput) SetItemName(v string) *GetAttributesInput { - s.ItemName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//GetAttributesResult -type GetAttributesOutput struct { - _ struct{} `type:"structure"` - - // The list of attributes returned by the operation. - Attributes []*Attribute `locationNameList:"Attribute" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s GetAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *GetAttributesOutput) SetAttributes(v []*Attribute) *GetAttributesOutput { - s.Attributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//Item -type Item struct { - _ struct{} `type:"structure"` - - AlternateNameEncoding *string `type:"string"` - - // A list of attributes. - // - // Attributes is a required field - Attributes []*Attribute `locationNameList:"Attribute" type:"list" flattened:"true" required:"true"` - - // The name of the item. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Item) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Item) GoString() string { - return s.String() -} - -// SetAlternateNameEncoding sets the AlternateNameEncoding field's value. -func (s *Item) SetAlternateNameEncoding(v string) *Item { - s.AlternateNameEncoding = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *Item) SetAttributes(v []*Attribute) *Item { - s.Attributes = v - return s -} - -// SetName sets the Name field's value. -func (s *Item) SetName(v string) *Item { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ListDomainsRequest -type ListDomainsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of domain names you want returned. The range is 1 to 100. - // The default setting is 100. - MaxNumberOfDomains *int64 `type:"integer"` - - // A string informing Amazon SimpleDB where to start the next list of domain - // names. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListDomainsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDomainsInput) GoString() string { - return s.String() -} - -// SetMaxNumberOfDomains sets the MaxNumberOfDomains field's value. -func (s *ListDomainsInput) SetMaxNumberOfDomains(v int64) *ListDomainsInput { - s.MaxNumberOfDomains = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDomainsInput) SetNextToken(v string) *ListDomainsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ListDomainsResult -type ListDomainsOutput struct { - _ struct{} `type:"structure"` - - // A list of domain names that match the expression. - DomainNames []*string `locationNameList:"DomainName" type:"list" flattened:"true"` - - // An opaque token indicating that there are more domains than the specified - // MaxNumberOfDomains - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListDomainsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDomainsOutput) GoString() string { - return s.String() -} - -// SetDomainNames sets the DomainNames field's value. -func (s *ListDomainsOutput) SetDomainNames(v []*string) *ListDomainsOutput { - s.DomainNames = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDomainsOutput) SetNextToken(v string) *ListDomainsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//PutAttributesRequest -type PutAttributesInput struct { - _ struct{} `type:"structure"` - - // The list of attributes. - // - // Attributes is a required field - Attributes []*ReplaceableAttribute `locationNameList:"Attribute" type:"list" flattened:"true" required:"true"` - - // The name of the domain in which to perform the operation. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // The update condition which, if specified, determines whether the specified - // attributes will be updated or not. The update condition must be satisfied - // in order for this request to be processed and the attributes to be updated. - Expected *UpdateCondition `type:"structure"` - - // The name of the item. - // - // ItemName is a required field - ItemName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PutAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.ItemName == nil { - invalidParams.Add(request.NewErrParamRequired("ItemName")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *PutAttributesInput) SetAttributes(v []*ReplaceableAttribute) *PutAttributesInput { - s.Attributes = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *PutAttributesInput) SetDomainName(v string) *PutAttributesInput { - s.DomainName = &v - return s -} - -// SetExpected sets the Expected field's value. -func (s *PutAttributesInput) SetExpected(v *UpdateCondition) *PutAttributesInput { - s.Expected = v - return s -} - -// SetItemName sets the ItemName field's value. -func (s *PutAttributesInput) SetItemName(v string) *PutAttributesInput { - s.ItemName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//PutAttributesOutput -type PutAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutAttributesOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ReplaceableAttribute -type ReplaceableAttribute struct { - _ struct{} `type:"structure"` - - // The name of the replaceable attribute. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // A flag specifying whether or not to replace the attribute/value pair or to - // add a new attribute/value pair. The default setting is false - Replace *bool `type:"boolean"` - - // The value of the replaceable attribute. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ReplaceableAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceableAttribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceableAttribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceableAttribute"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *ReplaceableAttribute) SetName(v string) *ReplaceableAttribute { - s.Name = &v - return s -} - -// SetReplace sets the Replace field's value. -func (s *ReplaceableAttribute) SetReplace(v bool) *ReplaceableAttribute { - s.Replace = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ReplaceableAttribute) SetValue(v string) *ReplaceableAttribute { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//ReplaceableItem -type ReplaceableItem struct { - _ struct{} `type:"structure"` - - // The list of attributes for a replaceable item. - // - // Attributes is a required field - Attributes []*ReplaceableAttribute `locationNameList:"Attribute" type:"list" flattened:"true" required:"true"` - - // The name of the replaceable item. - // - // Name is a required field - Name *string `locationName:"ItemName" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReplaceableItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceableItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceableItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceableItem"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *ReplaceableItem) SetAttributes(v []*ReplaceableAttribute) *ReplaceableItem { - s.Attributes = v - return s -} - -// SetName sets the Name field's value. -func (s *ReplaceableItem) SetName(v string) *ReplaceableItem { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//SelectRequest -type SelectInput struct { - _ struct{} `type:"structure"` - - // Determines whether or not strong consistency should be enforced when data - // is read from SimpleDB. If true - ConsistentRead *bool `type:"boolean"` - - // A string informing Amazon SimpleDB where to start the next list of ItemNames - NextToken *string `type:"string"` - - // The expression used to query the domain. - // - // SelectExpression is a required field - SelectExpression *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SelectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SelectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SelectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SelectInput"} - if s.SelectExpression == nil { - invalidParams.Add(request.NewErrParamRequired("SelectExpression")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *SelectInput) SetConsistentRead(v bool) *SelectInput { - s.ConsistentRead = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SelectInput) SetNextToken(v string) *SelectInput { - s.NextToken = &v - return s -} - -// SetSelectExpression sets the SelectExpression field's value. -func (s *SelectInput) SetSelectExpression(v string) *SelectInput { - s.SelectExpression = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI//SelectResult -type SelectOutput struct { - _ struct{} `type:"structure"` - - // A list of items that match the select expression. - Items []*Item `locationNameList:"Item" type:"list" flattened:"true"` - - // An opaque token indicating that more items than MaxNumberOfItems - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s SelectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SelectOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *SelectOutput) SetItems(v []*Item) *SelectOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SelectOutput) SetNextToken(v string) *SelectOutput { - s.NextToken = &v - return s -} - -// Specifies the conditions under which data should be updated. If an update -// condition is specified for a request, the data will only be updated if the -// condition is satisfied. For example, if an attribute with a specific name -// and value exists, or if a specific attribute doesn't exist. -// Please also see https://docs.aws.amazon.com/goto/WebAPI//UpdateCondition -type UpdateCondition struct { - _ struct{} `type:"structure"` - - // A value specifying whether or not the specified attribute must exist with - // the specified value in order for the update condition to be satisfied. Specify - // true if the attribute must exist for the update condition to be satisfied. - // Specify false if the attribute should not exist in order for the update condition - // to be satisfied. - Exists *bool `type:"boolean"` - - // The name of the attribute involved in the condition. - Name *string `type:"string"` - - // The value of an attribute. This value can only be specified when the Exists - // parameter is equal to true. - Value *string `type:"string"` -} - -// String returns the string representation -func (s UpdateCondition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateCondition) GoString() string { - return s.String() -} - -// SetExists sets the Exists field's value. -func (s *UpdateCondition) SetExists(v bool) *UpdateCondition { - s.Exists = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCondition) SetName(v string) *UpdateCondition { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *UpdateCondition) SetValue(v string) *UpdateCondition { - s.Value = &v - return s -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/simpledb/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/simpledb/customizations.go deleted file mode 100644 index a0dcce5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/customizations.go +++ /dev/null @@ -1,11 +0,0 @@ -package simpledb - -import "github.com/aws/aws-sdk-go/aws/client" - -func init() { - initClient = func(c *client.Client) { - // SimpleDB uses custom error unmarshaling logic - c.Handlers.UnmarshalError.Clear() - c.Handlers.UnmarshalError.PushBack(unmarshalError) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/simpledb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/simpledb/errors.go deleted file mode 100644 index f12143a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/errors.go +++ /dev/null @@ -1,109 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package simpledb - -const ( - - // ErrCodeAttributeDoesNotExist for service response error code - // "AttributeDoesNotExist". - // - // The specified attribute does not exist. - ErrCodeAttributeDoesNotExist = "AttributeDoesNotExist" - - // ErrCodeDuplicateItemName for service response error code - // "DuplicateItemName". - // - // The item name was specified more than once. - ErrCodeDuplicateItemName = "DuplicateItemName" - - // ErrCodeInvalidNextToken for service response error code - // "InvalidNextToken". - // - // The specified NextToken is not valid. - ErrCodeInvalidNextToken = "InvalidNextToken" - - // ErrCodeInvalidNumberPredicates for service response error code - // "InvalidNumberPredicates". - // - // Too many predicates exist in the query expression. - ErrCodeInvalidNumberPredicates = "InvalidNumberPredicates" - - // ErrCodeInvalidNumberValueTests for service response error code - // "InvalidNumberValueTests". - // - // Too many predicates exist in the query expression. - ErrCodeInvalidNumberValueTests = "InvalidNumberValueTests" - - // ErrCodeInvalidParameterValue for service response error code - // "InvalidParameterValue". - // - // The value for a parameter is invalid. - ErrCodeInvalidParameterValue = "InvalidParameterValue" - - // ErrCodeInvalidQueryExpression for service response error code - // "InvalidQueryExpression". - // - // The specified query expression syntax is not valid. - ErrCodeInvalidQueryExpression = "InvalidQueryExpression" - - // ErrCodeMissingParameter for service response error code - // "MissingParameter". - // - // The request must contain the specified missing parameter. - ErrCodeMissingParameter = "MissingParameter" - - // ErrCodeNoSuchDomain for service response error code - // "NoSuchDomain". - // - // The specified domain does not exist. - ErrCodeNoSuchDomain = "NoSuchDomain" - - // ErrCodeNumberDomainAttributesExceeded for service response error code - // "NumberDomainAttributesExceeded". - // - // Too many attributes in this domain. - ErrCodeNumberDomainAttributesExceeded = "NumberDomainAttributesExceeded" - - // ErrCodeNumberDomainBytesExceeded for service response error code - // "NumberDomainBytesExceeded". - // - // Too many bytes in this domain. - ErrCodeNumberDomainBytesExceeded = "NumberDomainBytesExceeded" - - // ErrCodeNumberDomainsExceeded for service response error code - // "NumberDomainsExceeded". - // - // Too many domains exist per this account. - ErrCodeNumberDomainsExceeded = "NumberDomainsExceeded" - - // ErrCodeNumberItemAttributesExceeded for service response error code - // "NumberItemAttributesExceeded". - // - // Too many attributes in this item. - ErrCodeNumberItemAttributesExceeded = "NumberItemAttributesExceeded" - - // ErrCodeNumberSubmittedAttributesExceeded for service response error code - // "NumberSubmittedAttributesExceeded". - // - // Too many attributes exist in a single call. - ErrCodeNumberSubmittedAttributesExceeded = "NumberSubmittedAttributesExceeded" - - // ErrCodeNumberSubmittedItemsExceeded for service response error code - // "NumberSubmittedItemsExceeded". - // - // Too many items exist in a single call. - ErrCodeNumberSubmittedItemsExceeded = "NumberSubmittedItemsExceeded" - - // ErrCodeRequestTimeout for service response error code - // "RequestTimeout". - // - // A timeout occurred when attempting to query the specified domain with specified - // query expression. - ErrCodeRequestTimeout = "RequestTimeout" - - // ErrCodeTooManyRequestedAttributes for service response error code - // "TooManyRequestedAttributes". - // - // Too many attributes requested. - ErrCodeTooManyRequestedAttributes = "TooManyRequestedAttributes" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go b/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go deleted file mode 100644 index dd5bf1d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go +++ /dev/null @@ -1,107 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package simpledb - -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/corehandlers" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v2" -) - -// Amazon SimpleDB is a web service providing the core database functions of -// data indexing and querying in the cloud. By offloading the time and effort -// associated with building and operating a web-scale database, SimpleDB provides -// developers the freedom to focus on application development. A traditional, -// clustered relational database requires a sizable upfront capital outlay, -// is complex to design, and often requires extensive and repetitive database -// administration. Amazon SimpleDB is dramatically simpler, requiring no schema, -// automatically indexing your data and providing a simple API for storage and -// access. This approach eliminates the administrative burden of data modeling, -// index maintenance, and performance tuning. Developers gain access to this -// functionality within Amazon's proven computing environment, are able to scale -// instantly, and pay only for what they use. -// -// Visit http://aws.amazon.com/simpledb/ (http://aws.amazon.com/simpledb/) for -// more information. -// 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/ -type SimpleDB 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 = "sdb" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the SimpleDB 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 SimpleDB client from just a session. -// svc := simpledb.New(mySession) -// -// // Create a SimpleDB client with additional configuration -// svc := simpledb.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SimpleDB { - 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) *SimpleDB { - svc := &SimpleDB{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2009-04-15", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v2.SignRequestHandler) - svc.Handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) - 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 SimpleDB operation and runs any -// custom request initialization. -func (c *SimpleDB) 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/simpledb/unmarshall_error.go b/vendor/github.com/aws/aws-sdk-go/service/simpledb/unmarshall_error.go deleted file mode 100644 index acc8a86..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/unmarshall_error.go +++ /dev/null @@ -1,53 +0,0 @@ -package simpledb - -import ( - "encoding/xml" - "io" - "io/ioutil" - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -type xmlErrorDetail struct { - Code string `xml:"Code"` - Message string `xml:"Message"` -} - -type xmlErrorResponse struct { - XMLName xml.Name `xml:"Response"` - Errors []xmlErrorDetail `xml:"Errors>Error"` - RequestID string `xml:"RequestID"` -} - -func unmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - defer io.Copy(ioutil.Discard, r.HTTPResponse.Body) - - if r.HTTPResponse.ContentLength == int64(0) { - // No body, use status code to generate an awserr.Error - r.Error = awserr.NewRequestFailure( - awserr.New(strings.Replace(r.HTTPResponse.Status, " ", "", -1), r.HTTPResponse.Status, nil), - r.HTTPResponse.StatusCode, - "", - ) - return - } - - resp := &xmlErrorResponse{} - err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) - if err != nil && err != io.EOF { - r.Error = awserr.New("SerializationError", "failed to decode SimpleDB XML error response", nil) - } else if len(resp.Errors) == 0 { - r.Error = awserr.New("MissingError", "missing error code in SimpleDB XML error response", nil) - } else { - // If there are multiple error codes, return only the first as the aws.Error interface only supports - // one error code. - r.Error = awserr.NewRequestFailure( - awserr.New(resp.Errors[0].Code, resp.Errors[0].Message, nil), - r.HTTPResponse.StatusCode, - resp.RequestID, - ) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sns/api.go b/vendor/github.com/aws/aws-sdk-go/service/sns/api.go deleted file mode 100644 index ee7f647..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/api.go +++ /dev/null @@ -1,5233 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package sns provides a client for Amazon Simple Notification Service. -package sns - -import ( - "fmt" - - "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/sns-2010-03-31/AddPermission -func (c *SNS) 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 Notification Service. -// -// Adds a statement to a topic's access control policy, granting access for -// the specified AWS accounts to the specified actions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation AddPermission for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermission -func (c *SNS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) { - req, out := c.AddPermissionRequest(input) - err := req.Send() - return out, err -} - -const opCheckIfPhoneNumberIsOptedOut = "CheckIfPhoneNumberIsOptedOut" - -// CheckIfPhoneNumberIsOptedOutRequest generates a "aws/request.Request" representing the -// client's request for the CheckIfPhoneNumberIsOptedOut operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CheckIfPhoneNumberIsOptedOut for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CheckIfPhoneNumberIsOptedOut method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CheckIfPhoneNumberIsOptedOutRequest method. -// req, resp := client.CheckIfPhoneNumberIsOptedOutRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOut -func (c *SNS) CheckIfPhoneNumberIsOptedOutRequest(input *CheckIfPhoneNumberIsOptedOutInput) (req *request.Request, output *CheckIfPhoneNumberIsOptedOutOutput) { - op := &request.Operation{ - Name: opCheckIfPhoneNumberIsOptedOut, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CheckIfPhoneNumberIsOptedOutInput{} - } - - output = &CheckIfPhoneNumberIsOptedOutOutput{} - req = c.newRequest(op, input, output) - return -} - -// CheckIfPhoneNumberIsOptedOut API operation for Amazon Simple Notification Service. -// -// Accepts a phone number and indicates whether the phone holder has opted out -// of receiving SMS messages from your account. You cannot send SMS messages -// to a number that is opted out. -// -// To resume sending messages, you can opt in the number by using the OptInPhoneNumber -// action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation CheckIfPhoneNumberIsOptedOut for usage and error information. -// -// Returned Error Codes: -// * ErrCodeThrottledException "Throttled" -// Indicates that the rate at which requests have been submitted for this action -// exceeds the limit for your account. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOut -func (c *SNS) CheckIfPhoneNumberIsOptedOut(input *CheckIfPhoneNumberIsOptedOutInput) (*CheckIfPhoneNumberIsOptedOutOutput, error) { - req, out := c.CheckIfPhoneNumberIsOptedOutRequest(input) - err := req.Send() - return out, err -} - -const opConfirmSubscription = "ConfirmSubscription" - -// ConfirmSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the ConfirmSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ConfirmSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ConfirmSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ConfirmSubscriptionRequest method. -// req, resp := client.ConfirmSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscription -func (c *SNS) ConfirmSubscriptionRequest(input *ConfirmSubscriptionInput) (req *request.Request, output *ConfirmSubscriptionOutput) { - op := &request.Operation{ - Name: opConfirmSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ConfirmSubscriptionInput{} - } - - output = &ConfirmSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// ConfirmSubscription API operation for Amazon Simple Notification Service. -// -// Verifies an endpoint owner's intent to receive messages by validating the -// token sent to the endpoint by an earlier Subscribe action. If the token is -// valid, the action creates a new subscription and returns its Amazon Resource -// Name (ARN). This call requires an AWS signature only when the AuthenticateOnUnsubscribe -// flag is set 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 Simple Notification Service's -// API operation ConfirmSubscription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionLimitExceededException "SubscriptionLimitExceeded" -// Indicates that the customer already owns the maximum allowed number of subscriptions. -// -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscription -func (c *SNS) ConfirmSubscription(input *ConfirmSubscriptionInput) (*ConfirmSubscriptionOutput, error) { - req, out := c.ConfirmSubscriptionRequest(input) - err := req.Send() - return out, err -} - -const opCreatePlatformApplication = "CreatePlatformApplication" - -// CreatePlatformApplicationRequest generates a "aws/request.Request" representing the -// client's request for the CreatePlatformApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePlatformApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePlatformApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePlatformApplicationRequest method. -// req, resp := client.CreatePlatformApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplication -func (c *SNS) CreatePlatformApplicationRequest(input *CreatePlatformApplicationInput) (req *request.Request, output *CreatePlatformApplicationOutput) { - op := &request.Operation{ - Name: opCreatePlatformApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePlatformApplicationInput{} - } - - output = &CreatePlatformApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePlatformApplication API operation for Amazon Simple Notification Service. -// -// Creates a platform application object for one of the supported push notification -// services, such as APNS and GCM, to which devices and mobile apps may register. -// You must specify PlatformPrincipal and PlatformCredential attributes when -// using the CreatePlatformApplication action. The PlatformPrincipal is received -// from the notification service. For APNS/APNS_SANDBOX, PlatformPrincipal is -// "SSL certificate". For GCM, PlatformPrincipal is not applicable. For ADM, -// PlatformPrincipal is "client id". The PlatformCredential is also received -// from the notification service. For WNS, PlatformPrincipal is "Package Security -// Identifier". For MPNS, PlatformPrincipal is "TLS certificate". For Baidu, -// PlatformPrincipal is "API key". -// -// For APNS/APNS_SANDBOX, PlatformCredential is "private key". For GCM, PlatformCredential -// is "API key". For ADM, PlatformCredential is "client secret". For WNS, PlatformCredential -// is "secret key". For MPNS, PlatformCredential is "private key". For Baidu, -// PlatformCredential is "secret key". The PlatformApplicationArn that is returned -// when using CreatePlatformApplication is then used as an attribute for the -// CreatePlatformEndpoint action. For more information, see Using Amazon SNS -// Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). -// For more information about obtaining the PlatformPrincipal and PlatformCredential -// for each of the supported push notification services, see Getting Started -// with Apple Push Notification Service (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html), -// Getting Started with Amazon Device Messaging (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-adm.html), -// Getting Started with Baidu Cloud Push (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-baidu.html), -// Getting Started with Google Cloud Messaging for Android (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html), -// Getting Started with MPNS (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-mpns.html), -// or Getting Started with WNS (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-wns.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 Notification Service's -// API operation CreatePlatformApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplication -func (c *SNS) CreatePlatformApplication(input *CreatePlatformApplicationInput) (*CreatePlatformApplicationOutput, error) { - req, out := c.CreatePlatformApplicationRequest(input) - err := req.Send() - return out, err -} - -const opCreatePlatformEndpoint = "CreatePlatformEndpoint" - -// CreatePlatformEndpointRequest generates a "aws/request.Request" representing the -// client's request for the CreatePlatformEndpoint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePlatformEndpoint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePlatformEndpoint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePlatformEndpointRequest method. -// req, resp := client.CreatePlatformEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformEndpoint -func (c *SNS) CreatePlatformEndpointRequest(input *CreatePlatformEndpointInput) (req *request.Request, output *CreatePlatformEndpointOutput) { - op := &request.Operation{ - Name: opCreatePlatformEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePlatformEndpointInput{} - } - - output = &CreatePlatformEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePlatformEndpoint API operation for Amazon Simple Notification Service. -// -// Creates an endpoint for a device and mobile app on one of the supported push -// notification services, such as GCM and APNS. CreatePlatformEndpoint requires -// the PlatformApplicationArn that is returned from CreatePlatformApplication. -// The EndpointArn that is returned when using CreatePlatformEndpoint can then -// be used by the Publish action to send a message to a mobile app or by the -// Subscribe action for subscription to a topic. The CreatePlatformEndpoint -// action is idempotent, so if the requester already owns an endpoint with the -// same device token and attributes, that endpoint's ARN is returned without -// creating a new endpoint. For more information, see Using Amazon SNS Mobile -// Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). -// -// When using CreatePlatformEndpoint with Baidu, two attributes must be provided: -// ChannelId and UserId. The token field must also contain the ChannelId. For -// more information, see Creating an Amazon SNS Endpoint for Baidu (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePushBaiduEndpoint.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 Notification Service's -// API operation CreatePlatformEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformEndpoint -func (c *SNS) CreatePlatformEndpoint(input *CreatePlatformEndpointInput) (*CreatePlatformEndpointOutput, error) { - req, out := c.CreatePlatformEndpointRequest(input) - err := req.Send() - return out, err -} - -const opCreateTopic = "CreateTopic" - -// CreateTopicRequest generates a "aws/request.Request" representing the -// client's request for the CreateTopic operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTopic for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTopic method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTopicRequest method. -// req, resp := client.CreateTopicRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopic -func (c *SNS) CreateTopicRequest(input *CreateTopicInput) (req *request.Request, output *CreateTopicOutput) { - op := &request.Operation{ - Name: opCreateTopic, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTopicInput{} - } - - output = &CreateTopicOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTopic API operation for Amazon Simple Notification Service. -// -// Creates a topic to which notifications can be published. Users can create -// at most 100,000 topics. For more information, see http://aws.amazon.com/sns -// (http://aws.amazon.com/sns/). This action is idempotent, so if the requester -// already owns a topic with the specified name, that topic's ARN is returned -// without creating a new topic. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation CreateTopic for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeTopicLimitExceededException "TopicLimitExceeded" -// Indicates that the customer already owns the maximum allowed number of topics. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopic -func (c *SNS) CreateTopic(input *CreateTopicInput) (*CreateTopicOutput, error) { - req, out := c.CreateTopicRequest(input) - err := req.Send() - return out, err -} - -const opDeleteEndpoint = "DeleteEndpoint" - -// DeleteEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEndpoint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteEndpoint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteEndpoint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteEndpointRequest method. -// req, resp := client.DeleteEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpoint -func (c *SNS) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) { - op := &request.Operation{ - Name: opDeleteEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEndpointInput{} - } - - output = &DeleteEndpointOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEndpoint API operation for Amazon Simple Notification Service. -// -// Deletes the endpoint for a device and mobile app from Amazon SNS. This action -// is idempotent. For more information, see Using Amazon SNS Mobile Push Notifications -// (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). -// -// When you delete an endpoint that is also subscribed to a topic, then you -// must also unsubscribe the endpoint from the topic. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation DeleteEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpoint -func (c *SNS) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { - req, out := c.DeleteEndpointRequest(input) - err := req.Send() - return out, err -} - -const opDeletePlatformApplication = "DeletePlatformApplication" - -// DeletePlatformApplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeletePlatformApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePlatformApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePlatformApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePlatformApplicationRequest method. -// req, resp := client.DeletePlatformApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplication -func (c *SNS) DeletePlatformApplicationRequest(input *DeletePlatformApplicationInput) (req *request.Request, output *DeletePlatformApplicationOutput) { - op := &request.Operation{ - Name: opDeletePlatformApplication, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePlatformApplicationInput{} - } - - output = &DeletePlatformApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePlatformApplication API operation for Amazon Simple Notification Service. -// -// Deletes a platform application object for one of the supported push notification -// services, such as APNS and GCM. For more information, see Using Amazon SNS -// Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.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 Notification Service's -// API operation DeletePlatformApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplication -func (c *SNS) DeletePlatformApplication(input *DeletePlatformApplicationInput) (*DeletePlatformApplicationOutput, error) { - req, out := c.DeletePlatformApplicationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteTopic = "DeleteTopic" - -// DeleteTopicRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTopic operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteTopic for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteTopic method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteTopicRequest method. -// req, resp := client.DeleteTopicRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopic -func (c *SNS) DeleteTopicRequest(input *DeleteTopicInput) (req *request.Request, output *DeleteTopicOutput) { - op := &request.Operation{ - Name: opDeleteTopic, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTopicInput{} - } - - output = &DeleteTopicOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTopic API operation for Amazon Simple Notification Service. -// -// Deletes a topic and all its subscriptions. Deleting a topic might prevent -// some messages previously sent to the topic from being delivered to subscribers. -// This action is idempotent, so deleting a topic that does not exist does not -// result in 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 Simple Notification Service's -// API operation DeleteTopic for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopic -func (c *SNS) DeleteTopic(input *DeleteTopicInput) (*DeleteTopicOutput, error) { - req, out := c.DeleteTopicRequest(input) - err := req.Send() - return out, err -} - -const opGetEndpointAttributes = "GetEndpointAttributes" - -// GetEndpointAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetEndpointAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetEndpointAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetEndpointAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetEndpointAttributesRequest method. -// req, resp := client.GetEndpointAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributes -func (c *SNS) GetEndpointAttributesRequest(input *GetEndpointAttributesInput) (req *request.Request, output *GetEndpointAttributesOutput) { - op := &request.Operation{ - Name: opGetEndpointAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetEndpointAttributesInput{} - } - - output = &GetEndpointAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEndpointAttributes API operation for Amazon Simple Notification Service. -// -// Retrieves the endpoint attributes for a device on one of the supported push -// notification services, such as GCM and APNS. For more information, see Using -// Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.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 Notification Service's -// API operation GetEndpointAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributes -func (c *SNS) GetEndpointAttributes(input *GetEndpointAttributesInput) (*GetEndpointAttributesOutput, error) { - req, out := c.GetEndpointAttributesRequest(input) - err := req.Send() - return out, err -} - -const opGetPlatformApplicationAttributes = "GetPlatformApplicationAttributes" - -// GetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetPlatformApplicationAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPlatformApplicationAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPlatformApplicationAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPlatformApplicationAttributesRequest method. -// req, resp := client.GetPlatformApplicationAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetPlatformApplicationAttributes -func (c *SNS) GetPlatformApplicationAttributesRequest(input *GetPlatformApplicationAttributesInput) (req *request.Request, output *GetPlatformApplicationAttributesOutput) { - op := &request.Operation{ - Name: opGetPlatformApplicationAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPlatformApplicationAttributesInput{} - } - - output = &GetPlatformApplicationAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPlatformApplicationAttributes API operation for Amazon Simple Notification Service. -// -// Retrieves the attributes of the platform application object for the supported -// push notification services, such as APNS and GCM. For more information, see -// Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.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 Notification Service's -// API operation GetPlatformApplicationAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetPlatformApplicationAttributes -func (c *SNS) GetPlatformApplicationAttributes(input *GetPlatformApplicationAttributesInput) (*GetPlatformApplicationAttributesOutput, error) { - req, out := c.GetPlatformApplicationAttributesRequest(input) - err := req.Send() - return out, err -} - -const opGetSMSAttributes = "GetSMSAttributes" - -// GetSMSAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetSMSAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSMSAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSMSAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSMSAttributesRequest method. -// req, resp := client.GetSMSAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSMSAttributes -func (c *SNS) GetSMSAttributesRequest(input *GetSMSAttributesInput) (req *request.Request, output *GetSMSAttributesOutput) { - op := &request.Operation{ - Name: opGetSMSAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSMSAttributesInput{} - } - - output = &GetSMSAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSMSAttributes API operation for Amazon Simple Notification Service. -// -// Returns the settings for sending SMS messages from your account. -// -// These settings are set with the SetSMSAttributes action. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation GetSMSAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeThrottledException "Throttled" -// Indicates that the rate at which requests have been submitted for this action -// exceeds the limit for your account. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSMSAttributes -func (c *SNS) GetSMSAttributes(input *GetSMSAttributesInput) (*GetSMSAttributesOutput, error) { - req, out := c.GetSMSAttributesRequest(input) - err := req.Send() - return out, err -} - -const opGetSubscriptionAttributes = "GetSubscriptionAttributes" - -// GetSubscriptionAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetSubscriptionAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSubscriptionAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSubscriptionAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSubscriptionAttributesRequest method. -// req, resp := client.GetSubscriptionAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSubscriptionAttributes -func (c *SNS) GetSubscriptionAttributesRequest(input *GetSubscriptionAttributesInput) (req *request.Request, output *GetSubscriptionAttributesOutput) { - op := &request.Operation{ - Name: opGetSubscriptionAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSubscriptionAttributesInput{} - } - - output = &GetSubscriptionAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSubscriptionAttributes API operation for Amazon Simple Notification Service. -// -// Returns all of the properties of a subscription. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation GetSubscriptionAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSubscriptionAttributes -func (c *SNS) GetSubscriptionAttributes(input *GetSubscriptionAttributesInput) (*GetSubscriptionAttributesOutput, error) { - req, out := c.GetSubscriptionAttributesRequest(input) - err := req.Send() - return out, err -} - -const opGetTopicAttributes = "GetTopicAttributes" - -// GetTopicAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetTopicAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetTopicAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetTopicAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetTopicAttributesRequest method. -// req, resp := client.GetTopicAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetTopicAttributes -func (c *SNS) GetTopicAttributesRequest(input *GetTopicAttributesInput) (req *request.Request, output *GetTopicAttributesOutput) { - op := &request.Operation{ - Name: opGetTopicAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTopicAttributesInput{} - } - - output = &GetTopicAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTopicAttributes API operation for Amazon Simple Notification Service. -// -// Returns all of the properties of a topic. Topic properties returned might -// differ based on the authorization of the user. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation GetTopicAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetTopicAttributes -func (c *SNS) GetTopicAttributes(input *GetTopicAttributesInput) (*GetTopicAttributesOutput, error) { - req, out := c.GetTopicAttributesRequest(input) - err := req.Send() - return out, err -} - -const opListEndpointsByPlatformApplication = "ListEndpointsByPlatformApplication" - -// ListEndpointsByPlatformApplicationRequest generates a "aws/request.Request" representing the -// client's request for the ListEndpointsByPlatformApplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListEndpointsByPlatformApplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListEndpointsByPlatformApplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListEndpointsByPlatformApplicationRequest method. -// req, resp := client.ListEndpointsByPlatformApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListEndpointsByPlatformApplication -func (c *SNS) ListEndpointsByPlatformApplicationRequest(input *ListEndpointsByPlatformApplicationInput) (req *request.Request, output *ListEndpointsByPlatformApplicationOutput) { - op := &request.Operation{ - Name: opListEndpointsByPlatformApplication, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEndpointsByPlatformApplicationInput{} - } - - output = &ListEndpointsByPlatformApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEndpointsByPlatformApplication API operation for Amazon Simple Notification Service. -// -// Lists the endpoints and endpoint attributes for devices in a supported push -// notification service, such as GCM and APNS. The results for ListEndpointsByPlatformApplication -// are paginated and return a limited list of endpoints, up to 100. If additional -// records are available after the first page results, then a NextToken string -// will be returned. To receive the next page, you call ListEndpointsByPlatformApplication -// again using the NextToken string received from the previous call. When there -// are no more records to return, NextToken will be null. For more information, -// see Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.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 Notification Service's -// API operation ListEndpointsByPlatformApplication for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListEndpointsByPlatformApplication -func (c *SNS) ListEndpointsByPlatformApplication(input *ListEndpointsByPlatformApplicationInput) (*ListEndpointsByPlatformApplicationOutput, error) { - req, out := c.ListEndpointsByPlatformApplicationRequest(input) - err := req.Send() - return out, err -} - -// ListEndpointsByPlatformApplicationPages iterates over the pages of a ListEndpointsByPlatformApplication operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEndpointsByPlatformApplication 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 ListEndpointsByPlatformApplication operation. -// pageNum := 0 -// err := client.ListEndpointsByPlatformApplicationPages(params, -// func(page *ListEndpointsByPlatformApplicationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SNS) ListEndpointsByPlatformApplicationPages(input *ListEndpointsByPlatformApplicationInput, fn func(p *ListEndpointsByPlatformApplicationOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListEndpointsByPlatformApplicationRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListEndpointsByPlatformApplicationOutput), lastPage) - }) -} - -const opListPhoneNumbersOptedOut = "ListPhoneNumbersOptedOut" - -// ListPhoneNumbersOptedOutRequest generates a "aws/request.Request" representing the -// client's request for the ListPhoneNumbersOptedOut operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListPhoneNumbersOptedOut for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListPhoneNumbersOptedOut method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPhoneNumbersOptedOutRequest method. -// req, resp := client.ListPhoneNumbersOptedOutRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPhoneNumbersOptedOut -func (c *SNS) ListPhoneNumbersOptedOutRequest(input *ListPhoneNumbersOptedOutInput) (req *request.Request, output *ListPhoneNumbersOptedOutOutput) { - op := &request.Operation{ - Name: opListPhoneNumbersOptedOut, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListPhoneNumbersOptedOutInput{} - } - - output = &ListPhoneNumbersOptedOutOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPhoneNumbersOptedOut API operation for Amazon Simple Notification Service. -// -// Returns a list of phone numbers that are opted out, meaning you cannot send -// SMS messages to them. -// -// The results for ListPhoneNumbersOptedOut are paginated, and each page returns -// up to 100 phone numbers. If additional phone numbers are available after -// the first page of results, then a NextToken string will be returned. To receive -// the next page, you call ListPhoneNumbersOptedOut again using the NextToken -// string received from the previous call. When there are no more records to -// return, NextToken will be null. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation ListPhoneNumbersOptedOut for usage and error information. -// -// Returned Error Codes: -// * ErrCodeThrottledException "Throttled" -// Indicates that the rate at which requests have been submitted for this action -// exceeds the limit for your account. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPhoneNumbersOptedOut -func (c *SNS) ListPhoneNumbersOptedOut(input *ListPhoneNumbersOptedOutInput) (*ListPhoneNumbersOptedOutOutput, error) { - req, out := c.ListPhoneNumbersOptedOutRequest(input) - err := req.Send() - return out, err -} - -const opListPlatformApplications = "ListPlatformApplications" - -// ListPlatformApplicationsRequest generates a "aws/request.Request" representing the -// client's request for the ListPlatformApplications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListPlatformApplications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListPlatformApplications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPlatformApplicationsRequest method. -// req, resp := client.ListPlatformApplicationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPlatformApplications -func (c *SNS) ListPlatformApplicationsRequest(input *ListPlatformApplicationsInput) (req *request.Request, output *ListPlatformApplicationsOutput) { - op := &request.Operation{ - Name: opListPlatformApplications, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPlatformApplicationsInput{} - } - - output = &ListPlatformApplicationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPlatformApplications API operation for Amazon Simple Notification Service. -// -// Lists the platform application objects for the supported push notification -// services, such as APNS and GCM. The results for ListPlatformApplications -// are paginated and return a limited list of applications, up to 100. If additional -// records are available after the first page results, then a NextToken string -// will be returned. To receive the next page, you call ListPlatformApplications -// using the NextToken string received from the previous call. When there are -// no more records to return, NextToken will be null. For more information, -// see Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.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 Notification Service's -// API operation ListPlatformApplications for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPlatformApplications -func (c *SNS) ListPlatformApplications(input *ListPlatformApplicationsInput) (*ListPlatformApplicationsOutput, error) { - req, out := c.ListPlatformApplicationsRequest(input) - err := req.Send() - return out, err -} - -// ListPlatformApplicationsPages iterates over the pages of a ListPlatformApplications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPlatformApplications 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 ListPlatformApplications operation. -// pageNum := 0 -// err := client.ListPlatformApplicationsPages(params, -// func(page *ListPlatformApplicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SNS) ListPlatformApplicationsPages(input *ListPlatformApplicationsInput, fn func(p *ListPlatformApplicationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListPlatformApplicationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListPlatformApplicationsOutput), lastPage) - }) -} - -const opListSubscriptions = "ListSubscriptions" - -// ListSubscriptionsRequest generates a "aws/request.Request" representing the -// client's request for the ListSubscriptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSubscriptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSubscriptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSubscriptionsRequest method. -// req, resp := client.ListSubscriptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptions -func (c *SNS) ListSubscriptionsRequest(input *ListSubscriptionsInput) (req *request.Request, output *ListSubscriptionsOutput) { - op := &request.Operation{ - Name: opListSubscriptions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSubscriptionsInput{} - } - - output = &ListSubscriptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSubscriptions API operation for Amazon Simple Notification Service. -// -// Returns a list of the requester's subscriptions. Each call returns a limited -// list of subscriptions, up to 100. If there are more subscriptions, a NextToken -// is also returned. Use the NextToken parameter in a new ListSubscriptions -// call to get further results. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation ListSubscriptions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptions -func (c *SNS) ListSubscriptions(input *ListSubscriptionsInput) (*ListSubscriptionsOutput, error) { - req, out := c.ListSubscriptionsRequest(input) - err := req.Send() - return out, err -} - -// ListSubscriptionsPages iterates over the pages of a ListSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscriptions 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 ListSubscriptions operation. -// pageNum := 0 -// err := client.ListSubscriptionsPages(params, -// func(page *ListSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SNS) ListSubscriptionsPages(input *ListSubscriptionsInput, fn func(p *ListSubscriptionsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListSubscriptionsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListSubscriptionsOutput), lastPage) - }) -} - -const opListSubscriptionsByTopic = "ListSubscriptionsByTopic" - -// ListSubscriptionsByTopicRequest generates a "aws/request.Request" representing the -// client's request for the ListSubscriptionsByTopic operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSubscriptionsByTopic for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSubscriptionsByTopic method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSubscriptionsByTopicRequest method. -// req, resp := client.ListSubscriptionsByTopicRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsByTopic -func (c *SNS) ListSubscriptionsByTopicRequest(input *ListSubscriptionsByTopicInput) (req *request.Request, output *ListSubscriptionsByTopicOutput) { - op := &request.Operation{ - Name: opListSubscriptionsByTopic, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSubscriptionsByTopicInput{} - } - - output = &ListSubscriptionsByTopicOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSubscriptionsByTopic API operation for Amazon Simple Notification Service. -// -// Returns a list of the subscriptions to a specific topic. Each call returns -// a limited list of subscriptions, up to 100. If there are more subscriptions, -// a NextToken is also returned. Use the NextToken parameter in a new ListSubscriptionsByTopic -// call to get further results. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation ListSubscriptionsByTopic for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsByTopic -func (c *SNS) ListSubscriptionsByTopic(input *ListSubscriptionsByTopicInput) (*ListSubscriptionsByTopicOutput, error) { - req, out := c.ListSubscriptionsByTopicRequest(input) - err := req.Send() - return out, err -} - -// ListSubscriptionsByTopicPages iterates over the pages of a ListSubscriptionsByTopic operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscriptionsByTopic 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 ListSubscriptionsByTopic operation. -// pageNum := 0 -// err := client.ListSubscriptionsByTopicPages(params, -// func(page *ListSubscriptionsByTopicOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SNS) ListSubscriptionsByTopicPages(input *ListSubscriptionsByTopicInput, fn func(p *ListSubscriptionsByTopicOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListSubscriptionsByTopicRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListSubscriptionsByTopicOutput), lastPage) - }) -} - -const opListTopics = "ListTopics" - -// ListTopicsRequest generates a "aws/request.Request" representing the -// client's request for the ListTopics operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTopics for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTopics method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTopicsRequest method. -// req, resp := client.ListTopicsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTopics -func (c *SNS) ListTopicsRequest(input *ListTopicsInput) (req *request.Request, output *ListTopicsOutput) { - op := &request.Operation{ - Name: opListTopics, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTopicsInput{} - } - - output = &ListTopicsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTopics API operation for Amazon Simple Notification Service. -// -// Returns a list of the requester's topics. Each call returns a limited list -// of topics, up to 100. If there are more topics, a NextToken is also returned. -// Use the NextToken parameter in a new ListTopics call to get further results. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation ListTopics for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTopics -func (c *SNS) ListTopics(input *ListTopicsInput) (*ListTopicsOutput, error) { - req, out := c.ListTopicsRequest(input) - err := req.Send() - return out, err -} - -// ListTopicsPages iterates over the pages of a ListTopics operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTopics 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 ListTopics operation. -// pageNum := 0 -// err := client.ListTopicsPages(params, -// func(page *ListTopicsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(p *ListTopicsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListTopicsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListTopicsOutput), lastPage) - }) -} - -const opOptInPhoneNumber = "OptInPhoneNumber" - -// OptInPhoneNumberRequest generates a "aws/request.Request" representing the -// client's request for the OptInPhoneNumber operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See OptInPhoneNumber for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OptInPhoneNumber method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the OptInPhoneNumberRequest method. -// req, resp := client.OptInPhoneNumberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/OptInPhoneNumber -func (c *SNS) OptInPhoneNumberRequest(input *OptInPhoneNumberInput) (req *request.Request, output *OptInPhoneNumberOutput) { - op := &request.Operation{ - Name: opOptInPhoneNumber, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &OptInPhoneNumberInput{} - } - - output = &OptInPhoneNumberOutput{} - req = c.newRequest(op, input, output) - return -} - -// OptInPhoneNumber API operation for Amazon Simple Notification Service. -// -// Use this request to opt in a phone number that is opted out, which enables -// you to resume sending SMS messages to the number. -// -// You can opt in a phone number only once every 30 days. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation OptInPhoneNumber for usage and error information. -// -// Returned Error Codes: -// * ErrCodeThrottledException "Throttled" -// Indicates that the rate at which requests have been submitted for this action -// exceeds the limit for your account. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/OptInPhoneNumber -func (c *SNS) OptInPhoneNumber(input *OptInPhoneNumberInput) (*OptInPhoneNumberOutput, error) { - req, out := c.OptInPhoneNumberRequest(input) - err := req.Send() - return out, err -} - -const opPublish = "Publish" - -// PublishRequest generates a "aws/request.Request" representing the -// client's request for the Publish operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Publish for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Publish method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PublishRequest method. -// req, resp := client.PublishRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Publish -func (c *SNS) PublishRequest(input *PublishInput) (req *request.Request, output *PublishOutput) { - op := &request.Operation{ - Name: opPublish, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PublishInput{} - } - - output = &PublishOutput{} - req = c.newRequest(op, input, output) - return -} - -// Publish API operation for Amazon Simple Notification Service. -// -// Sends a message to all of a topic's subscribed endpoints. When a messageId -// is returned, the message has been saved and Amazon SNS will attempt to deliver -// it to the topic's subscribers shortly. The format of the outgoing message -// to each subscribed endpoint depends on the notification protocol. -// -// To use the Publish action for sending a message to a mobile endpoint, such -// as an app on a Kindle device or mobile phone, you must specify the EndpointArn -// for the TargetArn parameter. The EndpointArn is returned when making a call -// with the CreatePlatformEndpoint action. -// -// For more information about formatting messages, see Send Custom Platform-Specific -// Payloads in Messages to Mobile Devices (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.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 Notification Service's -// API operation Publish for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInvalidParameterValueException "ParameterValueInvalid" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// * ErrCodeEndpointDisabledException "EndpointDisabled" -// Exception error indicating endpoint disabled. -// -// * ErrCodePlatformApplicationDisabledException "PlatformApplicationDisabled" -// Exception error indicating platform application disabled. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Publish -func (c *SNS) Publish(input *PublishInput) (*PublishOutput, error) { - req, out := c.PublishRequest(input) - err := req.Send() - return out, err -} - -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/sns-2010-03-31/RemovePermission -func (c *SNS) 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 Notification Service. -// -// Removes a statement from a topic's access control 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 Simple Notification Service's -// API operation RemovePermission for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/RemovePermission -func (c *SNS) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { - req, out := c.RemovePermissionRequest(input) - err := req.Send() - return out, err -} - -const opSetEndpointAttributes = "SetEndpointAttributes" - -// SetEndpointAttributesRequest generates a "aws/request.Request" representing the -// client's request for the SetEndpointAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetEndpointAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetEndpointAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetEndpointAttributesRequest method. -// req, resp := client.SetEndpointAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetEndpointAttributes -func (c *SNS) SetEndpointAttributesRequest(input *SetEndpointAttributesInput) (req *request.Request, output *SetEndpointAttributesOutput) { - op := &request.Operation{ - Name: opSetEndpointAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetEndpointAttributesInput{} - } - - output = &SetEndpointAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetEndpointAttributes API operation for Amazon Simple Notification Service. -// -// Sets the attributes for an endpoint for a device on one of the supported -// push notification services, such as GCM and APNS. For more information, see -// Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.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 Notification Service's -// API operation SetEndpointAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetEndpointAttributes -func (c *SNS) SetEndpointAttributes(input *SetEndpointAttributesInput) (*SetEndpointAttributesOutput, error) { - req, out := c.SetEndpointAttributesRequest(input) - err := req.Send() - return out, err -} - -const opSetPlatformApplicationAttributes = "SetPlatformApplicationAttributes" - -// SetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the -// client's request for the SetPlatformApplicationAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetPlatformApplicationAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetPlatformApplicationAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetPlatformApplicationAttributesRequest method. -// req, resp := client.SetPlatformApplicationAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetPlatformApplicationAttributes -func (c *SNS) SetPlatformApplicationAttributesRequest(input *SetPlatformApplicationAttributesInput) (req *request.Request, output *SetPlatformApplicationAttributesOutput) { - op := &request.Operation{ - Name: opSetPlatformApplicationAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetPlatformApplicationAttributesInput{} - } - - output = &SetPlatformApplicationAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetPlatformApplicationAttributes API operation for Amazon Simple Notification Service. -// -// Sets the attributes of the platform application object for the supported -// push notification services, such as APNS and GCM. For more information, see -// Using Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). -// For information on configuring attributes for message delivery status, see -// Using Amazon SNS Application Attributes for Message Delivery Status (http://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.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 Notification Service's -// API operation SetPlatformApplicationAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetPlatformApplicationAttributes -func (c *SNS) SetPlatformApplicationAttributes(input *SetPlatformApplicationAttributesInput) (*SetPlatformApplicationAttributesOutput, error) { - req, out := c.SetPlatformApplicationAttributesRequest(input) - err := req.Send() - return out, err -} - -const opSetSMSAttributes = "SetSMSAttributes" - -// SetSMSAttributesRequest generates a "aws/request.Request" representing the -// client's request for the SetSMSAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetSMSAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetSMSAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetSMSAttributesRequest method. -// req, resp := client.SetSMSAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSMSAttributes -func (c *SNS) SetSMSAttributesRequest(input *SetSMSAttributesInput) (req *request.Request, output *SetSMSAttributesOutput) { - op := &request.Operation{ - Name: opSetSMSAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetSMSAttributesInput{} - } - - output = &SetSMSAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// SetSMSAttributes API operation for Amazon Simple Notification Service. -// -// Use this request to set the default settings for sending SMS messages and -// receiving daily SMS usage reports. -// -// You can override some of these settings for a single message when you use -// the Publish action with the MessageAttributes.entry.N parameter. For more -// information, see Sending an SMS Message (http://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html) -// in the Amazon SNS 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 Notification Service's -// API operation SetSMSAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeThrottledException "Throttled" -// Indicates that the rate at which requests have been submitted for this action -// exceeds the limit for your account. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSMSAttributes -func (c *SNS) SetSMSAttributes(input *SetSMSAttributesInput) (*SetSMSAttributesOutput, error) { - req, out := c.SetSMSAttributesRequest(input) - err := req.Send() - return out, err -} - -const opSetSubscriptionAttributes = "SetSubscriptionAttributes" - -// SetSubscriptionAttributesRequest generates a "aws/request.Request" representing the -// client's request for the SetSubscriptionAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetSubscriptionAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetSubscriptionAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetSubscriptionAttributesRequest method. -// req, resp := client.SetSubscriptionAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSubscriptionAttributes -func (c *SNS) SetSubscriptionAttributesRequest(input *SetSubscriptionAttributesInput) (req *request.Request, output *SetSubscriptionAttributesOutput) { - op := &request.Operation{ - Name: opSetSubscriptionAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetSubscriptionAttributesInput{} - } - - output = &SetSubscriptionAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetSubscriptionAttributes API operation for Amazon Simple Notification Service. -// -// Allows a subscription owner to set an attribute of the topic to a new 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 Simple Notification Service's -// API operation SetSubscriptionAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSubscriptionAttributes -func (c *SNS) SetSubscriptionAttributes(input *SetSubscriptionAttributesInput) (*SetSubscriptionAttributesOutput, error) { - req, out := c.SetSubscriptionAttributesRequest(input) - err := req.Send() - return out, err -} - -const opSetTopicAttributes = "SetTopicAttributes" - -// SetTopicAttributesRequest generates a "aws/request.Request" representing the -// client's request for the SetTopicAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetTopicAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetTopicAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetTopicAttributesRequest method. -// req, resp := client.SetTopicAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetTopicAttributes -func (c *SNS) SetTopicAttributesRequest(input *SetTopicAttributesInput) (req *request.Request, output *SetTopicAttributesOutput) { - op := &request.Operation{ - Name: opSetTopicAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetTopicAttributesInput{} - } - - output = &SetTopicAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetTopicAttributes API operation for Amazon Simple Notification Service. -// -// Allows a topic owner to set an attribute of the topic to a new 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 Simple Notification Service's -// API operation SetTopicAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetTopicAttributes -func (c *SNS) SetTopicAttributes(input *SetTopicAttributesInput) (*SetTopicAttributesOutput, error) { - req, out := c.SetTopicAttributesRequest(input) - err := req.Send() - return out, err -} - -const opSubscribe = "Subscribe" - -// SubscribeRequest generates a "aws/request.Request" representing the -// client's request for the Subscribe operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Subscribe for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Subscribe method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SubscribeRequest method. -// req, resp := client.SubscribeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Subscribe -func (c *SNS) SubscribeRequest(input *SubscribeInput) (req *request.Request, output *SubscribeOutput) { - op := &request.Operation{ - Name: opSubscribe, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SubscribeInput{} - } - - output = &SubscribeOutput{} - req = c.newRequest(op, input, output) - return -} - -// Subscribe API operation for Amazon Simple Notification Service. -// -// Prepares to subscribe an endpoint by sending the endpoint a confirmation -// message. To actually create a subscription, the endpoint owner must call -// the ConfirmSubscription action with the token from the confirmation message. -// Confirmation tokens are valid for three days. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation Subscribe for usage and error information. -// -// Returned Error Codes: -// * ErrCodeSubscriptionLimitExceededException "SubscriptionLimitExceeded" -// Indicates that the customer already owns the maximum allowed number of subscriptions. -// -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Subscribe -func (c *SNS) Subscribe(input *SubscribeInput) (*SubscribeOutput, error) { - req, out := c.SubscribeRequest(input) - err := req.Send() - return out, err -} - -const opUnsubscribe = "Unsubscribe" - -// UnsubscribeRequest generates a "aws/request.Request" representing the -// client's request for the Unsubscribe operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Unsubscribe for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Unsubscribe method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UnsubscribeRequest method. -// req, resp := client.UnsubscribeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Unsubscribe -func (c *SNS) UnsubscribeRequest(input *UnsubscribeInput) (req *request.Request, output *UnsubscribeOutput) { - op := &request.Operation{ - Name: opUnsubscribe, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnsubscribeInput{} - } - - output = &UnsubscribeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// Unsubscribe API operation for Amazon Simple Notification Service. -// -// Deletes a subscription. If the subscription requires authentication for deletion, -// only the owner of the subscription or the topic's owner can unsubscribe, -// and an AWS signature is required. If the Unsubscribe call does not require -// authentication and the requester is not the subscription owner, a final cancellation -// message is delivered to the endpoint, so that the endpoint owner can easily -// resubscribe to the topic if the Unsubscribe request was unintended. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Notification Service's -// API operation Unsubscribe for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameter" -// Indicates that a request parameter does not comply with the associated constraints. -// -// * ErrCodeInternalErrorException "InternalError" -// Indicates an internal service error. -// -// * ErrCodeAuthorizationErrorException "AuthorizationError" -// Indicates that the user has been denied access to the requested resource. -// -// * ErrCodeNotFoundException "NotFound" -// Indicates that the requested resource does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Unsubscribe -func (c *SNS) Unsubscribe(input *UnsubscribeInput) (*UnsubscribeOutput, error) { - req, out := c.UnsubscribeRequest(input) - err := req.Send() - return out, err -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermissionInput -type AddPermissionInput struct { - _ struct{} `type:"structure"` - - // The AWS account IDs of the users (principals) who will be given access to - // the specified actions. The users must have AWS accounts, but do not need - // to be signed up for this service. - // - // AWSAccountId is a required field - AWSAccountId []*string `type:"list" required:"true"` - - // The action you want to allow for the specified principal(s). - // - // Valid values: any Amazon SNS action name. - // - // ActionName is a required field - ActionName []*string `type:"list" required:"true"` - - // A unique identifier for the new policy statement. - // - // Label is a required field - Label *string `type:"string" required:"true"` - - // The ARN of the topic whose access control policy you wish to modify. - // - // TopicArn is a required field - TopicArn *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.AWSAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AWSAccountId")) - } - if s.ActionName == nil { - invalidParams.Add(request.NewErrParamRequired("ActionName")) - } - if s.Label == nil { - invalidParams.Add(request.NewErrParamRequired("Label")) - } - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAWSAccountId sets the AWSAccountId field's value. -func (s *AddPermissionInput) SetAWSAccountId(v []*string) *AddPermissionInput { - s.AWSAccountId = v - return s -} - -// SetActionName sets the ActionName field's value. -func (s *AddPermissionInput) SetActionName(v []*string) *AddPermissionInput { - s.ActionName = v - return s -} - -// SetLabel sets the Label field's value. -func (s *AddPermissionInput) SetLabel(v string) *AddPermissionInput { - s.Label = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *AddPermissionInput) SetTopicArn(v string) *AddPermissionInput { - s.TopicArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/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() -} - -// The input for the CheckIfPhoneNumberIsOptedOut action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOutInput -type CheckIfPhoneNumberIsOptedOutInput struct { - _ struct{} `type:"structure"` - - // The phone number for which you want to check the opt out status. - // - // PhoneNumber is a required field - PhoneNumber *string `locationName:"phoneNumber" type:"string" required:"true"` -} - -// String returns the string representation -func (s CheckIfPhoneNumberIsOptedOutInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CheckIfPhoneNumberIsOptedOutInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CheckIfPhoneNumberIsOptedOutInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CheckIfPhoneNumberIsOptedOutInput"} - if s.PhoneNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *CheckIfPhoneNumberIsOptedOutInput) SetPhoneNumber(v string) *CheckIfPhoneNumberIsOptedOutInput { - s.PhoneNumber = &v - return s -} - -// The response from the CheckIfPhoneNumberIsOptedOut action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOutResponse -type CheckIfPhoneNumberIsOptedOutOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the phone number is opted out: - // - // * true – The phone number is opted out, meaning you cannot publish SMS - // messages to it. - // - // * false – The phone number is opted in, meaning you can publish SMS messages - // to it. - IsOptedOut *bool `locationName:"isOptedOut" type:"boolean"` -} - -// String returns the string representation -func (s CheckIfPhoneNumberIsOptedOutOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CheckIfPhoneNumberIsOptedOutOutput) GoString() string { - return s.String() -} - -// SetIsOptedOut sets the IsOptedOut field's value. -func (s *CheckIfPhoneNumberIsOptedOutOutput) SetIsOptedOut(v bool) *CheckIfPhoneNumberIsOptedOutOutput { - s.IsOptedOut = &v - return s -} - -// Input for ConfirmSubscription action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscriptionInput -type ConfirmSubscriptionInput struct { - _ struct{} `type:"structure"` - - // Disallows unauthenticated unsubscribes of the subscription. If the value - // of this parameter is true and the request has an AWS signature, then only - // the topic owner and the subscription owner can unsubscribe the endpoint. - // The unsubscribe action requires AWS authentication. - AuthenticateOnUnsubscribe *string `type:"string"` - - // Short-lived token sent to an endpoint during the Subscribe action. - // - // Token is a required field - Token *string `type:"string" required:"true"` - - // The ARN of the topic for which you wish to confirm a subscription. - // - // TopicArn is a required field - TopicArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ConfirmSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfirmSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfirmSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfirmSubscriptionInput"} - if s.Token == nil { - invalidParams.Add(request.NewErrParamRequired("Token")) - } - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthenticateOnUnsubscribe sets the AuthenticateOnUnsubscribe field's value. -func (s *ConfirmSubscriptionInput) SetAuthenticateOnUnsubscribe(v string) *ConfirmSubscriptionInput { - s.AuthenticateOnUnsubscribe = &v - return s -} - -// SetToken sets the Token field's value. -func (s *ConfirmSubscriptionInput) SetToken(v string) *ConfirmSubscriptionInput { - s.Token = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *ConfirmSubscriptionInput) SetTopicArn(v string) *ConfirmSubscriptionInput { - s.TopicArn = &v - return s -} - -// Response for ConfirmSubscriptions action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscriptionResponse -type ConfirmSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the created subscription. - SubscriptionArn *string `type:"string"` -} - -// String returns the string representation -func (s ConfirmSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfirmSubscriptionOutput) GoString() string { - return s.String() -} - -// SetSubscriptionArn sets the SubscriptionArn field's value. -func (s *ConfirmSubscriptionOutput) SetSubscriptionArn(v string) *ConfirmSubscriptionOutput { - s.SubscriptionArn = &v - return s -} - -// Input for CreatePlatformApplication action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplicationInput -type CreatePlatformApplicationInput struct { - _ struct{} `type:"structure"` - - // For a list of attributes, see SetPlatformApplicationAttributes (http://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html) - // - // Attributes is a required field - Attributes map[string]*string `type:"map" required:"true"` - - // Application names must be made up of only uppercase and lowercase ASCII letters, - // numbers, underscores, hyphens, and periods, and must be between 1 and 256 - // characters long. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The following platforms are supported: ADM (Amazon Device Messaging), APNS - // (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google Cloud Messaging). - // - // Platform is a required field - Platform *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreatePlatformApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlatformApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePlatformApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePlatformApplicationInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Platform == nil { - invalidParams.Add(request.NewErrParamRequired("Platform")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *CreatePlatformApplicationInput) SetAttributes(v map[string]*string) *CreatePlatformApplicationInput { - s.Attributes = v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePlatformApplicationInput) SetName(v string) *CreatePlatformApplicationInput { - s.Name = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *CreatePlatformApplicationInput) SetPlatform(v string) *CreatePlatformApplicationInput { - s.Platform = &v - return s -} - -// Response from CreatePlatformApplication action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplicationResponse -type CreatePlatformApplicationOutput struct { - _ struct{} `type:"structure"` - - // PlatformApplicationArn is returned. - PlatformApplicationArn *string `type:"string"` -} - -// String returns the string representation -func (s CreatePlatformApplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlatformApplicationOutput) GoString() string { - return s.String() -} - -// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. -func (s *CreatePlatformApplicationOutput) SetPlatformApplicationArn(v string) *CreatePlatformApplicationOutput { - s.PlatformApplicationArn = &v - return s -} - -// Input for CreatePlatformEndpoint action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformEndpointInput -type CreatePlatformEndpointInput struct { - _ struct{} `type:"structure"` - - // For a list of attributes, see SetEndpointAttributes (http://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html). - Attributes map[string]*string `type:"map"` - - // Arbitrary user data to associate with the endpoint. Amazon SNS does not use - // this data. The data must be in UTF-8 format and less than 2KB. - CustomUserData *string `type:"string"` - - // PlatformApplicationArn returned from CreatePlatformApplication is used to - // create a an endpoint. - // - // PlatformApplicationArn is a required field - PlatformApplicationArn *string `type:"string" required:"true"` - - // Unique identifier created by the notification service for an app on a device. - // The specific name for Token will vary, depending on which notification service - // is being used. For example, when using APNS as the notification service, - // you need the device token. Alternatively, when using GCM or ADM, the device - // token equivalent is called the registration ID. - // - // Token is a required field - Token *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreatePlatformEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlatformEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePlatformEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePlatformEndpointInput"} - if s.PlatformApplicationArn == nil { - invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) - } - if s.Token == nil { - invalidParams.Add(request.NewErrParamRequired("Token")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *CreatePlatformEndpointInput) SetAttributes(v map[string]*string) *CreatePlatformEndpointInput { - s.Attributes = v - return s -} - -// SetCustomUserData sets the CustomUserData field's value. -func (s *CreatePlatformEndpointInput) SetCustomUserData(v string) *CreatePlatformEndpointInput { - s.CustomUserData = &v - return s -} - -// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. -func (s *CreatePlatformEndpointInput) SetPlatformApplicationArn(v string) *CreatePlatformEndpointInput { - s.PlatformApplicationArn = &v - return s -} - -// SetToken sets the Token field's value. -func (s *CreatePlatformEndpointInput) SetToken(v string) *CreatePlatformEndpointInput { - s.Token = &v - return s -} - -// Response from CreateEndpoint action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateEndpointResponse -type CreatePlatformEndpointOutput struct { - _ struct{} `type:"structure"` - - // EndpointArn returned from CreateEndpoint action. - EndpointArn *string `type:"string"` -} - -// String returns the string representation -func (s CreatePlatformEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlatformEndpointOutput) GoString() string { - return s.String() -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *CreatePlatformEndpointOutput) SetEndpointArn(v string) *CreatePlatformEndpointOutput { - s.EndpointArn = &v - return s -} - -// Input for CreateTopic action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopicInput -type CreateTopicInput struct { - _ struct{} `type:"structure"` - - // The name of the topic you want to create. - // - // Constraints: Topic names must be made up of only uppercase and lowercase - // ASCII letters, numbers, underscores, and hyphens, and must be between 1 and - // 256 characters long. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateTopicInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTopicInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTopicInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTopicInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateTopicInput) SetName(v string) *CreateTopicInput { - s.Name = &v - return s -} - -// Response from CreateTopic action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopicResponse -type CreateTopicOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) assigned to the created topic. - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s CreateTopicOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTopicOutput) GoString() string { - return s.String() -} - -// SetTopicArn sets the TopicArn field's value. -func (s *CreateTopicOutput) SetTopicArn(v string) *CreateTopicOutput { - s.TopicArn = &v - return s -} - -// Input for DeleteEndpoint action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpointInput -type DeleteEndpointInput struct { - _ struct{} `type:"structure"` - - // EndpointArn of endpoint to delete. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointInput"} - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *DeleteEndpointInput) SetEndpointArn(v string) *DeleteEndpointInput { - s.EndpointArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpointOutput -type DeleteEndpointOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEndpointOutput) GoString() string { - return s.String() -} - -// Input for DeletePlatformApplication action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplicationInput -type DeletePlatformApplicationInput struct { - _ struct{} `type:"structure"` - - // PlatformApplicationArn of platform application object to delete. - // - // PlatformApplicationArn is a required field - PlatformApplicationArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePlatformApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePlatformApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePlatformApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePlatformApplicationInput"} - if s.PlatformApplicationArn == nil { - invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. -func (s *DeletePlatformApplicationInput) SetPlatformApplicationArn(v string) *DeletePlatformApplicationInput { - s.PlatformApplicationArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplicationOutput -type DeletePlatformApplicationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeletePlatformApplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePlatformApplicationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopicInput -type DeleteTopicInput struct { - _ struct{} `type:"structure"` - - // The ARN of the topic you want to delete. - // - // TopicArn is a required field - TopicArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteTopicInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTopicInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTopicInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTopicInput"} - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTopicArn sets the TopicArn field's value. -func (s *DeleteTopicInput) SetTopicArn(v string) *DeleteTopicInput { - s.TopicArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopicOutput -type DeleteTopicOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteTopicOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTopicOutput) GoString() string { - return s.String() -} - -// Endpoint for mobile app and device. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Endpoint -type Endpoint struct { - _ struct{} `type:"structure"` - - // Attributes for endpoint. - Attributes map[string]*string `type:"map"` - - // EndpointArn for mobile app and device. - EndpointArn *string `type:"string"` -} - -// String returns the string representation -func (s Endpoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Endpoint) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *Endpoint) SetAttributes(v map[string]*string) *Endpoint { - s.Attributes = v - return s -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *Endpoint) SetEndpointArn(v string) *Endpoint { - s.EndpointArn = &v - return s -} - -// Input for GetEndpointAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributesInput -type GetEndpointAttributesInput struct { - _ struct{} `type:"structure"` - - // EndpointArn for GetEndpointAttributes input. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetEndpointAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetEndpointAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEndpointAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEndpointAttributesInput"} - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *GetEndpointAttributesInput) SetEndpointArn(v string) *GetEndpointAttributesInput { - s.EndpointArn = &v - return s -} - -// Response from GetEndpointAttributes of the EndpointArn. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributesResponse -type GetEndpointAttributesOutput struct { - _ struct{} `type:"structure"` - - // Attributes include the following: - // - // * CustomUserData -- arbitrary user data to associate with the endpoint. - // Amazon SNS does not use this data. The data must be in UTF-8 format and - // less than 2KB. - // - // * Enabled -- flag that enables/disables delivery to the endpoint. Amazon - // SNS will set this to false when a notification service indicates to Amazon - // SNS that the endpoint is invalid. Users can set it back to true, typically - // after updating Token. - // - // * Token -- device token, also referred to as a registration id, for an - // app and mobile device. This is returned from the notification service - // when an app and mobile device are registered with the notification service. - Attributes map[string]*string `type:"map"` -} - -// String returns the string representation -func (s GetEndpointAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetEndpointAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *GetEndpointAttributesOutput) SetAttributes(v map[string]*string) *GetEndpointAttributesOutput { - s.Attributes = v - return s -} - -// Input for GetPlatformApplicationAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetPlatformApplicationAttributesInput -type GetPlatformApplicationAttributesInput struct { - _ struct{} `type:"structure"` - - // PlatformApplicationArn for GetPlatformApplicationAttributesInput. - // - // PlatformApplicationArn is a required field - PlatformApplicationArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPlatformApplicationAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPlatformApplicationAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPlatformApplicationAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPlatformApplicationAttributesInput"} - if s.PlatformApplicationArn == nil { - invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. -func (s *GetPlatformApplicationAttributesInput) SetPlatformApplicationArn(v string) *GetPlatformApplicationAttributesInput { - s.PlatformApplicationArn = &v - return s -} - -// Response for GetPlatformApplicationAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetPlatformApplicationAttributesResponse -type GetPlatformApplicationAttributesOutput struct { - _ struct{} `type:"structure"` - - // Attributes include the following: - // - // * EventEndpointCreated -- Topic ARN to which EndpointCreated event notifications - // should be sent. - // - // * EventEndpointDeleted -- Topic ARN to which EndpointDeleted event notifications - // should be sent. - // - // * EventEndpointUpdated -- Topic ARN to which EndpointUpdate event notifications - // should be sent. - // - // * EventDeliveryFailure -- Topic ARN to which DeliveryFailure event notifications - // should be sent upon Direct Publish delivery failure (permanent) to one - // of the application's endpoints. - Attributes map[string]*string `type:"map"` -} - -// String returns the string representation -func (s GetPlatformApplicationAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPlatformApplicationAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *GetPlatformApplicationAttributesOutput) SetAttributes(v map[string]*string) *GetPlatformApplicationAttributesOutput { - s.Attributes = v - return s -} - -// The input for the GetSMSAttributes request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSMSAttributesInput -type GetSMSAttributesInput struct { - _ struct{} `type:"structure"` - - // A list of the individual attribute names, such as MonthlySpendLimit, for - // which you want values. - // - // For all attribute names, see SetSMSAttributes (http://docs.aws.amazon.com/sns/latest/api/API_SetSMSAttributes.html). - // - // If you don't use this parameter, Amazon SNS returns all SMS attributes. - Attributes []*string `locationName:"attributes" type:"list"` -} - -// String returns the string representation -func (s GetSMSAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSMSAttributesInput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *GetSMSAttributesInput) SetAttributes(v []*string) *GetSMSAttributesInput { - s.Attributes = v - return s -} - -// The response from the GetSMSAttributes request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSMSAttributesResponse -type GetSMSAttributesOutput struct { - _ struct{} `type:"structure"` - - // The SMS attribute names and their values. - Attributes map[string]*string `locationName:"attributes" type:"map"` -} - -// String returns the string representation -func (s GetSMSAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSMSAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *GetSMSAttributesOutput) SetAttributes(v map[string]*string) *GetSMSAttributesOutput { - s.Attributes = v - return s -} - -// Input for GetSubscriptionAttributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSubscriptionAttributesInput -type GetSubscriptionAttributesInput struct { - _ struct{} `type:"structure"` - - // The ARN of the subscription whose properties you want to get. - // - // SubscriptionArn is a required field - SubscriptionArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSubscriptionAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSubscriptionAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSubscriptionAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionAttributesInput"} - if s.SubscriptionArn == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubscriptionArn sets the SubscriptionArn field's value. -func (s *GetSubscriptionAttributesInput) SetSubscriptionArn(v string) *GetSubscriptionAttributesInput { - s.SubscriptionArn = &v - return s -} - -// Response for GetSubscriptionAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSubscriptionAttributesResponse -type GetSubscriptionAttributesOutput struct { - _ struct{} `type:"structure"` - - // A map of the subscription's attributes. Attributes in this map include the - // following: - // - // * SubscriptionArn -- the subscription's ARN - // - // * TopicArn -- the topic ARN that the subscription is associated with - // - // * Owner -- the AWS account ID of the subscription's owner - // - // * ConfirmationWasAuthenticated -- true if the subscription confirmation - // request was authenticated - // - // * DeliveryPolicy -- the JSON serialization of the subscription's delivery - // policy - // - // * EffectiveDeliveryPolicy -- the JSON serialization of the effective delivery - // policy that takes into account the topic delivery policy and account system - // defaults - Attributes map[string]*string `type:"map"` -} - -// String returns the string representation -func (s GetSubscriptionAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSubscriptionAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *GetSubscriptionAttributesOutput) SetAttributes(v map[string]*string) *GetSubscriptionAttributesOutput { - s.Attributes = v - return s -} - -// Input for GetTopicAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetTopicAttributesInput -type GetTopicAttributesInput struct { - _ struct{} `type:"structure"` - - // The ARN of the topic whose properties you want to get. - // - // TopicArn is a required field - TopicArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetTopicAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTopicAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTopicAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTopicAttributesInput"} - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTopicArn sets the TopicArn field's value. -func (s *GetTopicAttributesInput) SetTopicArn(v string) *GetTopicAttributesInput { - s.TopicArn = &v - return s -} - -// Response for GetTopicAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetTopicAttributesResponse -type GetTopicAttributesOutput struct { - _ struct{} `type:"structure"` - - // A map of the topic's attributes. Attributes in this map include the following: - // - // * TopicArn -- the topic's ARN - // - // * Owner -- the AWS account ID of the topic's owner - // - // * Policy -- the JSON serialization of the topic's access control policy - // - // * DisplayName -- the human-readable name used in the "From" field for - // notifications to email and email-json endpoints - // - // * SubscriptionsPending -- the number of subscriptions pending confirmation - // on this topic - // - // * SubscriptionsConfirmed -- the number of confirmed subscriptions on this - // topic - // - // * SubscriptionsDeleted -- the number of deleted subscriptions on this - // topic - // - // * DeliveryPolicy -- the JSON serialization of the topic's delivery policy - // - // * EffectiveDeliveryPolicy -- the JSON serialization of the effective delivery - // policy that takes into account system defaults - Attributes map[string]*string `type:"map"` -} - -// String returns the string representation -func (s GetTopicAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTopicAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *GetTopicAttributesOutput) SetAttributes(v map[string]*string) *GetTopicAttributesOutput { - s.Attributes = v - return s -} - -// Input for ListEndpointsByPlatformApplication action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListEndpointsByPlatformApplicationInput -type ListEndpointsByPlatformApplicationInput struct { - _ struct{} `type:"structure"` - - // NextToken string is used when calling ListEndpointsByPlatformApplication - // action to retrieve additional records that are available after the first - // page results. - NextToken *string `type:"string"` - - // PlatformApplicationArn for ListEndpointsByPlatformApplicationInput action. - // - // PlatformApplicationArn is a required field - PlatformApplicationArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ListEndpointsByPlatformApplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListEndpointsByPlatformApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEndpointsByPlatformApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEndpointsByPlatformApplicationInput"} - if s.PlatformApplicationArn == nil { - invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointsByPlatformApplicationInput) SetNextToken(v string) *ListEndpointsByPlatformApplicationInput { - s.NextToken = &v - return s -} - -// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. -func (s *ListEndpointsByPlatformApplicationInput) SetPlatformApplicationArn(v string) *ListEndpointsByPlatformApplicationInput { - s.PlatformApplicationArn = &v - return s -} - -// Response for ListEndpointsByPlatformApplication action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListEndpointsByPlatformApplicationResponse -type ListEndpointsByPlatformApplicationOutput struct { - _ struct{} `type:"structure"` - - // Endpoints returned for ListEndpointsByPlatformApplication action. - Endpoints []*Endpoint `type:"list"` - - // NextToken string is returned when calling ListEndpointsByPlatformApplication - // action if additional records are available after the first page results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListEndpointsByPlatformApplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListEndpointsByPlatformApplicationOutput) GoString() string { - return s.String() -} - -// SetEndpoints sets the Endpoints field's value. -func (s *ListEndpointsByPlatformApplicationOutput) SetEndpoints(v []*Endpoint) *ListEndpointsByPlatformApplicationOutput { - s.Endpoints = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointsByPlatformApplicationOutput) SetNextToken(v string) *ListEndpointsByPlatformApplicationOutput { - s.NextToken = &v - return s -} - -// The input for the ListPhoneNumbersOptedOut action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPhoneNumbersOptedOutInput -type ListPhoneNumbersOptedOutInput struct { - _ struct{} `type:"structure"` - - // A NextToken string is used when you call the ListPhoneNumbersOptedOut action - // to retrieve additional records that are available after the first page of - // results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListPhoneNumbersOptedOutInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPhoneNumbersOptedOutInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPhoneNumbersOptedOutInput) SetNextToken(v string) *ListPhoneNumbersOptedOutInput { - s.NextToken = &v - return s -} - -// The response from the ListPhoneNumbersOptedOut action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPhoneNumbersOptedOutResponse -type ListPhoneNumbersOptedOutOutput struct { - _ struct{} `type:"structure"` - - // A NextToken string is returned when you call the ListPhoneNumbersOptedOut - // action if additional records are available after the first page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of phone numbers that are opted out of receiving SMS messages. The - // list is paginated, and each page can contain up to 100 phone numbers. - PhoneNumbers []*string `locationName:"phoneNumbers" type:"list"` -} - -// String returns the string representation -func (s ListPhoneNumbersOptedOutOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPhoneNumbersOptedOutOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPhoneNumbersOptedOutOutput) SetNextToken(v string) *ListPhoneNumbersOptedOutOutput { - s.NextToken = &v - return s -} - -// SetPhoneNumbers sets the PhoneNumbers field's value. -func (s *ListPhoneNumbersOptedOutOutput) SetPhoneNumbers(v []*string) *ListPhoneNumbersOptedOutOutput { - s.PhoneNumbers = v - return s -} - -// Input for ListPlatformApplications action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPlatformApplicationsInput -type ListPlatformApplicationsInput struct { - _ struct{} `type:"structure"` - - // NextToken string is used when calling ListPlatformApplications action to - // retrieve additional records that are available after the first page results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListPlatformApplicationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPlatformApplicationsInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPlatformApplicationsInput) SetNextToken(v string) *ListPlatformApplicationsInput { - s.NextToken = &v - return s -} - -// Response for ListPlatformApplications action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPlatformApplicationsResponse -type ListPlatformApplicationsOutput struct { - _ struct{} `type:"structure"` - - // NextToken string is returned when calling ListPlatformApplications action - // if additional records are available after the first page results. - NextToken *string `type:"string"` - - // Platform applications returned when calling ListPlatformApplications action. - PlatformApplications []*PlatformApplication `type:"list"` -} - -// String returns the string representation -func (s ListPlatformApplicationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPlatformApplicationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPlatformApplicationsOutput) SetNextToken(v string) *ListPlatformApplicationsOutput { - s.NextToken = &v - return s -} - -// SetPlatformApplications sets the PlatformApplications field's value. -func (s *ListPlatformApplicationsOutput) SetPlatformApplications(v []*PlatformApplication) *ListPlatformApplicationsOutput { - s.PlatformApplications = v - return s -} - -// Input for ListSubscriptionsByTopic action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsByTopicInput -type ListSubscriptionsByTopicInput struct { - _ struct{} `type:"structure"` - - // Token returned by the previous ListSubscriptionsByTopic request. - NextToken *string `type:"string"` - - // The ARN of the topic for which you wish to find subscriptions. - // - // TopicArn is a required field - TopicArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ListSubscriptionsByTopicInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSubscriptionsByTopicInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSubscriptionsByTopicInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionsByTopicInput"} - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionsByTopicInput) SetNextToken(v string) *ListSubscriptionsByTopicInput { - s.NextToken = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *ListSubscriptionsByTopicInput) SetTopicArn(v string) *ListSubscriptionsByTopicInput { - s.TopicArn = &v - return s -} - -// Response for ListSubscriptionsByTopic action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsByTopicResponse -type ListSubscriptionsByTopicOutput struct { - _ struct{} `type:"structure"` - - // Token to pass along to the next ListSubscriptionsByTopic request. This element - // is returned if there are more subscriptions to retrieve. - NextToken *string `type:"string"` - - // A list of subscriptions. - Subscriptions []*Subscription `type:"list"` -} - -// String returns the string representation -func (s ListSubscriptionsByTopicOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSubscriptionsByTopicOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionsByTopicOutput) SetNextToken(v string) *ListSubscriptionsByTopicOutput { - s.NextToken = &v - return s -} - -// SetSubscriptions sets the Subscriptions field's value. -func (s *ListSubscriptionsByTopicOutput) SetSubscriptions(v []*Subscription) *ListSubscriptionsByTopicOutput { - s.Subscriptions = v - return s -} - -// Input for ListSubscriptions action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsInput -type ListSubscriptionsInput struct { - _ struct{} `type:"structure"` - - // Token returned by the previous ListSubscriptions request. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListSubscriptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSubscriptionsInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionsInput) SetNextToken(v string) *ListSubscriptionsInput { - s.NextToken = &v - return s -} - -// Response for ListSubscriptions action -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsResponse -type ListSubscriptionsOutput struct { - _ struct{} `type:"structure"` - - // Token to pass along to the next ListSubscriptions request. This element is - // returned if there are more subscriptions to retrieve. - NextToken *string `type:"string"` - - // A list of subscriptions. - Subscriptions []*Subscription `type:"list"` -} - -// String returns the string representation -func (s ListSubscriptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSubscriptionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionsOutput) SetNextToken(v string) *ListSubscriptionsOutput { - s.NextToken = &v - return s -} - -// SetSubscriptions sets the Subscriptions field's value. -func (s *ListSubscriptionsOutput) SetSubscriptions(v []*Subscription) *ListSubscriptionsOutput { - s.Subscriptions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTopicsInput -type ListTopicsInput struct { - _ struct{} `type:"structure"` - - // Token returned by the previous ListTopics request. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListTopicsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTopicsInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTopicsInput) SetNextToken(v string) *ListTopicsInput { - s.NextToken = &v - return s -} - -// Response for ListTopics action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTopicsResponse -type ListTopicsOutput struct { - _ struct{} `type:"structure"` - - // Token to pass along to the next ListTopics request. This element is returned - // if there are additional topics to retrieve. - NextToken *string `type:"string"` - - // A list of topic ARNs. - Topics []*Topic `type:"list"` -} - -// String returns the string representation -func (s ListTopicsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTopicsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTopicsOutput) SetNextToken(v string) *ListTopicsOutput { - s.NextToken = &v - return s -} - -// SetTopics sets the Topics field's value. -func (s *ListTopicsOutput) SetTopics(v []*Topic) *ListTopicsOutput { - s.Topics = 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 Publish (http://docs.aws.amazon.com/sns/latest/api/API_Publish.html). -// -// Name, type, and value must not be empty or null. In addition, the message -// body should not be empty or null. All parts of the message attribute, including -// name, type, and value, are included in the message size restriction, which -// is currently 256 KB (262,144 bytes). For more information, see Using Amazon -// SNS Message Attributes (http://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/MessageAttributeValue -type MessageAttributeValue struct { - _ struct{} `type:"structure"` - - // Binary type attributes can store any binary data, for example, compressed - // data, encrypted data, or images. - // - // BinaryValue is automatically base64 encoded/decoded by the SDK. - BinaryValue []byte `type:"blob"` - - // Amazon SNS supports the following logical data types: String, Number, and - // Binary. For more information, see Message Attribute Data Types (http://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html#SNSMessageAttributes.DataTypes). - // - // DataType is a required field - DataType *string `type:"string" required:"true"` - - // Strings are Unicode with UTF8 binary encoding. 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). - 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 -} - -// 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 -} - -// SetStringValue sets the StringValue field's value. -func (s *MessageAttributeValue) SetStringValue(v string) *MessageAttributeValue { - s.StringValue = &v - return s -} - -// Input for the OptInPhoneNumber action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/OptInPhoneNumberInput -type OptInPhoneNumberInput struct { - _ struct{} `type:"structure"` - - // The phone number to opt in. - // - // PhoneNumber is a required field - PhoneNumber *string `locationName:"phoneNumber" type:"string" required:"true"` -} - -// String returns the string representation -func (s OptInPhoneNumberInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptInPhoneNumberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OptInPhoneNumberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OptInPhoneNumberInput"} - if s.PhoneNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *OptInPhoneNumberInput) SetPhoneNumber(v string) *OptInPhoneNumberInput { - s.PhoneNumber = &v - return s -} - -// The response for the OptInPhoneNumber action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/OptInPhoneNumberResponse -type OptInPhoneNumberOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s OptInPhoneNumberOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OptInPhoneNumberOutput) GoString() string { - return s.String() -} - -// Platform application object. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/PlatformApplication -type PlatformApplication struct { - _ struct{} `type:"structure"` - - // Attributes for platform application object. - Attributes map[string]*string `type:"map"` - - // PlatformApplicationArn for platform application object. - PlatformApplicationArn *string `type:"string"` -} - -// String returns the string representation -func (s PlatformApplication) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlatformApplication) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *PlatformApplication) SetAttributes(v map[string]*string) *PlatformApplication { - s.Attributes = v - return s -} - -// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. -func (s *PlatformApplication) SetPlatformApplicationArn(v string) *PlatformApplication { - s.PlatformApplicationArn = &v - return s -} - -// Input for Publish action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/PublishInput -type PublishInput struct { - _ struct{} `type:"structure"` - - // The message you want to send to the topic. - // - // If you want to send the same message to all transport protocols, include - // the text of the message as a String value. - // - // If you want to send different messages for each transport protocol, set the - // value of the MessageStructure parameter to json and use a JSON object for - // the Message parameter. - // - // Constraints: Messages must be UTF-8 encoded strings at most 256 KB in size - // (262144 bytes, not 262144 characters). - // - // JSON-specific constraints: - // - // * Keys in the JSON object that correspond to supported transport protocols - // must have simple JSON string values. - // - // * The values will be parsed (unescaped) before they are used in outgoing - // messages. - // - // * Outbound notifications are JSON encoded (meaning that the characters - // will be reescaped for sending). - // - // * Values have a minimum length of 0 (the empty string, "", is allowed). - // - // * Values have a maximum length bounded by the overall message size (so, - // including multiple protocols may limit message sizes). - // - // * Non-string values will cause the key to be ignored. - // - // * Keys that do not correspond to supported transport protocols are ignored. - // - // * Duplicate keys are not allowed. - // - // * Failure to parse or validate any key or value in the message will cause - // the Publish call to return an error (no partial delivery). - // - // Message is a required field - Message *string `type:"string" required:"true"` - - // Message attributes for Publish action. - MessageAttributes map[string]*MessageAttributeValue `locationNameKey:"Name" locationNameValue:"Value" type:"map"` - - // Set MessageStructure to json if you want to send a different message for - // each protocol. For example, using one publish action, you can send a short - // message to your SMS subscribers and a longer message to your email subscribers. - // If you set MessageStructure to json, the value of the Message parameter must: - // - // * be a syntactically valid JSON object; and - // - // * contain at least a top-level JSON key of "default" with a value that - // is a string. - // - // You can define other top-level keys that define the message you want to send - // to a specific transport protocol (e.g., "http"). - // - // For information about sending different messages for each protocol using - // the AWS Management Console, go to Create Different Messages for Each Protocol - // (http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol) - // in the Amazon Simple Notification Service Getting Started Guide. - // - // Valid value: json - MessageStructure *string `type:"string"` - - // The phone number to which you want to deliver an SMS message. Use E.164 format. - // - // If you don't specify a value for the PhoneNumber parameter, you must specify - // a value for the TargetArn or TopicArn parameters. - PhoneNumber *string `type:"string"` - - // Optional parameter to be used as the "Subject" line when the message is delivered - // to email endpoints. This field will also be included, if present, in the - // standard JSON messages delivered to other endpoints. - // - // Constraints: Subjects must be ASCII text that begins with a letter, number, - // or punctuation mark; must not include line breaks or control characters; - // and must be less than 100 characters long. - Subject *string `type:"string"` - - // Either TopicArn or EndpointArn, but not both. - // - // If you don't specify a value for the TargetArn parameter, you must specify - // a value for the PhoneNumber or TopicArn parameters. - TargetArn *string `type:"string"` - - // The topic you want to publish to. - // - // If you don't specify a value for the TopicArn parameter, you must specify - // a value for the PhoneNumber or TargetArn parameters. - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s PublishInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PublishInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PublishInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PublishInput"} - if s.Message == nil { - invalidParams.Add(request.NewErrParamRequired("Message")) - } - 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 -} - -// SetMessage sets the Message field's value. -func (s *PublishInput) SetMessage(v string) *PublishInput { - s.Message = &v - return s -} - -// SetMessageAttributes sets the MessageAttributes field's value. -func (s *PublishInput) SetMessageAttributes(v map[string]*MessageAttributeValue) *PublishInput { - s.MessageAttributes = v - return s -} - -// SetMessageStructure sets the MessageStructure field's value. -func (s *PublishInput) SetMessageStructure(v string) *PublishInput { - s.MessageStructure = &v - return s -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *PublishInput) SetPhoneNumber(v string) *PublishInput { - s.PhoneNumber = &v - return s -} - -// SetSubject sets the Subject field's value. -func (s *PublishInput) SetSubject(v string) *PublishInput { - s.Subject = &v - return s -} - -// SetTargetArn sets the TargetArn field's value. -func (s *PublishInput) SetTargetArn(v string) *PublishInput { - s.TargetArn = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *PublishInput) SetTopicArn(v string) *PublishInput { - s.TopicArn = &v - return s -} - -// Response for Publish action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/PublishResponse -type PublishOutput struct { - _ struct{} `type:"structure"` - - // Unique identifier assigned to the published message. - // - // Length Constraint: Maximum 100 characters - MessageId *string `type:"string"` -} - -// String returns the string representation -func (s PublishOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PublishOutput) GoString() string { - return s.String() -} - -// SetMessageId sets the MessageId field's value. -func (s *PublishOutput) SetMessageId(v string) *PublishOutput { - s.MessageId = &v - return s -} - -// Input for RemovePermission action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/RemovePermissionInput -type RemovePermissionInput struct { - _ struct{} `type:"structure"` - - // The unique label of the statement you want to remove. - // - // Label is a required field - Label *string `type:"string" required:"true"` - - // The ARN of the topic whose access control policy you wish to modify. - // - // TopicArn is a required field - TopicArn *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.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - 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 -} - -// SetTopicArn sets the TopicArn field's value. -func (s *RemovePermissionInput) SetTopicArn(v string) *RemovePermissionInput { - s.TopicArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/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() -} - -// Input for SetEndpointAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetEndpointAttributesInput -type SetEndpointAttributesInput struct { - _ struct{} `type:"structure"` - - // A map of the endpoint attributes. Attributes in this map include the following: - // - // * CustomUserData -- arbitrary user data to associate with the endpoint. - // Amazon SNS does not use this data. The data must be in UTF-8 format and - // less than 2KB. - // - // * Enabled -- flag that enables/disables delivery to the endpoint. Amazon - // SNS will set this to false when a notification service indicates to Amazon - // SNS that the endpoint is invalid. Users can set it back to true, typically - // after updating Token. - // - // * Token -- device token, also referred to as a registration id, for an - // app and mobile device. This is returned from the notification service - // when an app and mobile device are registered with the notification service. - // - // Attributes is a required field - Attributes map[string]*string `type:"map" required:"true"` - - // EndpointArn used for SetEndpointAttributes action. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetEndpointAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetEndpointAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetEndpointAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetEndpointAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.EndpointArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *SetEndpointAttributesInput) SetAttributes(v map[string]*string) *SetEndpointAttributesInput { - s.Attributes = v - return s -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *SetEndpointAttributesInput) SetEndpointArn(v string) *SetEndpointAttributesInput { - s.EndpointArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetEndpointAttributesOutput -type SetEndpointAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetEndpointAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetEndpointAttributesOutput) GoString() string { - return s.String() -} - -// Input for SetPlatformApplicationAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetPlatformApplicationAttributesInput -type SetPlatformApplicationAttributesInput struct { - _ struct{} `type:"structure"` - - // A map of the platform application attributes. Attributes in this map include - // the following: - // - // * PlatformCredential -- The credential received from the notification - // service. For APNS/APNS_SANDBOX, PlatformCredential is private key. For - // GCM, PlatformCredential is "API key". For ADM, PlatformCredential is "client - // secret". - // - // * PlatformPrincipal -- The principal received from the notification service. - // For APNS/APNS_SANDBOX, PlatformPrincipal is SSL certificate. For GCM, - // PlatformPrincipal is not applicable. For ADM, PlatformPrincipal is "client - // id". - // - // * EventEndpointCreated -- Topic ARN to which EndpointCreated event notifications - // should be sent. - // - // * EventEndpointDeleted -- Topic ARN to which EndpointDeleted event notifications - // should be sent. - // - // * EventEndpointUpdated -- Topic ARN to which EndpointUpdate event notifications - // should be sent. - // - // * EventDeliveryFailure -- Topic ARN to which DeliveryFailure event notifications - // should be sent upon Direct Publish delivery failure (permanent) to one - // of the application's endpoints. - // - // * SuccessFeedbackRoleArn -- IAM role ARN used to give Amazon SNS write - // access to use CloudWatch Logs on your behalf. - // - // * FailureFeedbackRoleArn -- IAM role ARN used to give Amazon SNS write - // access to use CloudWatch Logs on your behalf. - // - // * SuccessFeedbackSampleRate -- Sample rate percentage (0-100) of successfully - // delivered messages. - // - // Attributes is a required field - Attributes map[string]*string `type:"map" required:"true"` - - // PlatformApplicationArn for SetPlatformApplicationAttributes action. - // - // PlatformApplicationArn is a required field - PlatformApplicationArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetPlatformApplicationAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetPlatformApplicationAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetPlatformApplicationAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetPlatformApplicationAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.PlatformApplicationArn == nil { - invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *SetPlatformApplicationAttributesInput) SetAttributes(v map[string]*string) *SetPlatformApplicationAttributesInput { - s.Attributes = v - return s -} - -// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. -func (s *SetPlatformApplicationAttributesInput) SetPlatformApplicationArn(v string) *SetPlatformApplicationAttributesInput { - s.PlatformApplicationArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetPlatformApplicationAttributesOutput -type SetPlatformApplicationAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetPlatformApplicationAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetPlatformApplicationAttributesOutput) GoString() string { - return s.String() -} - -// The input for the SetSMSAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSMSAttributesInput -type SetSMSAttributesInput struct { - _ struct{} `type:"structure"` - - // The default settings for sending SMS messages from your account. You can - // set values for the following attribute names: - // - // MonthlySpendLimit – The maximum amount in USD that you are willing to spend - // each month to send SMS messages. When Amazon SNS determines that sending - // an SMS message would incur a cost that exceeds this limit, it stops sending - // SMS messages within minutes. - // - // Amazon SNS stops sending SMS messages within minutes of the limit being crossed. - // During that interval, if you continue to send SMS messages, you will incur - // costs that exceed your limit. - // - // By default, the spend limit is set to the maximum allowed by Amazon SNS. - // If you want to exceed the maximum, contact AWS Support (https://aws.amazon.com/premiumsupport/) - // or your AWS sales representative for a service limit increase. - // - // DeliveryStatusIAMRole – The ARN of the IAM role that allows Amazon SNS to - // write logs about SMS deliveries in CloudWatch Logs. For each SMS message - // that you send, Amazon SNS writes a log that includes the message price, the - // success or failure status, the reason for failure (if the message failed), - // the message dwell time, and other information. - // - // DeliveryStatusSuccessSamplingRate – The percentage of successful SMS deliveries - // for which Amazon SNS will write logs in CloudWatch Logs. The value can be - // an integer from 0 - 100. For example, to write logs only for failed deliveries, - // set this value to 0. To write logs for 10% of your successful deliveries, - // set it to 10. - // - // DefaultSenderID – A string, such as your business brand, that is displayed - // as the sender on the receiving device. Support for sender IDs varies by country. - // The sender ID can be 1 - 11 alphanumeric characters, and it must contain - // at least one letter. - // - // DefaultSMSType – The type of SMS message that you will send by default. You - // can assign the following values: - // - // * Promotional – (Default) Noncritical messages, such as marketing messages. - // Amazon SNS optimizes the message delivery to incur the lowest cost. - // - // * Transactional – Critical messages that support customer transactions, - // such as one-time passcodes for multi-factor authentication. Amazon SNS - // optimizes the message delivery to achieve the highest reliability. - // - // UsageReportS3Bucket – The name of the Amazon S3 bucket to receive daily SMS - // usage reports from Amazon SNS. Each day, Amazon SNS will deliver a usage - // report as a CSV file to the bucket. The report includes the following information - // for each SMS message that was successfully delivered by your account: - // - // * Time that the message was published (in UTC) - // - // * Message ID - // - // * Destination phone number - // - // * Message type - // - // * Delivery status - // - // * Message price (in USD) - // - // * Part number (a message is split into multiple parts if it is too long - // for a single message) - // - // * Total number of parts - // - // To receive the report, the bucket must have a policy that allows the Amazon - // SNS service principle to perform the s3:PutObject and s3:GetBucketLocation - // actions. - // - // For an example bucket policy and usage report, see Monitoring SMS Activity - // (http://docs.aws.amazon.com/sns/latest/dg/sms_stats.html) in the Amazon SNS - // Developer Guide. - // - // Attributes is a required field - Attributes map[string]*string `locationName:"attributes" type:"map" required:"true"` -} - -// String returns the string representation -func (s SetSMSAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetSMSAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetSMSAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetSMSAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *SetSMSAttributesInput) SetAttributes(v map[string]*string) *SetSMSAttributesInput { - s.Attributes = v - return s -} - -// The response for the SetSMSAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSMSAttributesResponse -type SetSMSAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetSMSAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetSMSAttributesOutput) GoString() string { - return s.String() -} - -// Input for SetSubscriptionAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSubscriptionAttributesInput -type SetSubscriptionAttributesInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute you want to set. Only a subset of the subscriptions - // attributes are mutable. - // - // Valid values: DeliveryPolicy | RawMessageDelivery - // - // AttributeName is a required field - AttributeName *string `type:"string" required:"true"` - - // The new value for the attribute in JSON format. - AttributeValue *string `type:"string"` - - // The ARN of the subscription to modify. - // - // SubscriptionArn is a required field - SubscriptionArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetSubscriptionAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetSubscriptionAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetSubscriptionAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetSubscriptionAttributesInput"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.SubscriptionArn == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *SetSubscriptionAttributesInput) SetAttributeName(v string) *SetSubscriptionAttributesInput { - s.AttributeName = &v - return s -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *SetSubscriptionAttributesInput) SetAttributeValue(v string) *SetSubscriptionAttributesInput { - s.AttributeValue = &v - return s -} - -// SetSubscriptionArn sets the SubscriptionArn field's value. -func (s *SetSubscriptionAttributesInput) SetSubscriptionArn(v string) *SetSubscriptionAttributesInput { - s.SubscriptionArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSubscriptionAttributesOutput -type SetSubscriptionAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetSubscriptionAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetSubscriptionAttributesOutput) GoString() string { - return s.String() -} - -// Input for SetTopicAttributes action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetTopicAttributesInput -type SetTopicAttributesInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute you want to set. Only a subset of the topic's attributes - // are mutable. - // - // Valid values: Policy | DisplayName | DeliveryPolicy - // - // AttributeName is a required field - AttributeName *string `type:"string" required:"true"` - - // The new value for the attribute. - AttributeValue *string `type:"string"` - - // The ARN of the topic to modify. - // - // TopicArn is a required field - TopicArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetTopicAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetTopicAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetTopicAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetTopicAttributesInput"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *SetTopicAttributesInput) SetAttributeName(v string) *SetTopicAttributesInput { - s.AttributeName = &v - return s -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *SetTopicAttributesInput) SetAttributeValue(v string) *SetTopicAttributesInput { - s.AttributeValue = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *SetTopicAttributesInput) SetTopicArn(v string) *SetTopicAttributesInput { - s.TopicArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetTopicAttributesOutput -type SetTopicAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetTopicAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetTopicAttributesOutput) GoString() string { - return s.String() -} - -// Input for Subscribe action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SubscribeInput -type SubscribeInput struct { - _ struct{} `type:"structure"` - - // The endpoint that you want to receive notifications. Endpoints vary by protocol: - // - // * For the http protocol, the endpoint is an URL beginning with "http://" - // - // * For the https protocol, the endpoint is a URL beginning with "https://" - // - // * For the email protocol, the endpoint is an email address - // - // * For the email-json protocol, the endpoint is an email address - // - // * For the sms protocol, the endpoint is a phone number of an SMS-enabled - // device - // - // * For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue - // - // * For the application protocol, the endpoint is the EndpointArn of a mobile - // app and device. - // - // * For the lambda protocol, the endpoint is the ARN of an AWS Lambda function. - Endpoint *string `type:"string"` - - // The protocol you want to use. Supported protocols include: - // - // * http -- delivery of JSON-encoded message via HTTP POST - // - // * https -- delivery of JSON-encoded message via HTTPS POST - // - // * email -- delivery of message via SMTP - // - // * email-json -- delivery of JSON-encoded message via SMTP - // - // * sms -- delivery of message via SMS - // - // * sqs -- delivery of JSON-encoded message to an Amazon SQS queue - // - // * application -- delivery of JSON-encoded message to an EndpointArn for - // a mobile app and device. - // - // * lambda -- delivery of JSON-encoded message to an AWS Lambda function. - // - // Protocol is a required field - Protocol *string `type:"string" required:"true"` - - // The ARN of the topic you want to subscribe to. - // - // TopicArn is a required field - TopicArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SubscribeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubscribeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SubscribeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SubscribeInput"} - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpoint sets the Endpoint field's value. -func (s *SubscribeInput) SetEndpoint(v string) *SubscribeInput { - s.Endpoint = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *SubscribeInput) SetProtocol(v string) *SubscribeInput { - s.Protocol = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *SubscribeInput) SetTopicArn(v string) *SubscribeInput { - s.TopicArn = &v - return s -} - -// Response for Subscribe action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SubscribeResponse -type SubscribeOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the subscription, if the service was able to create a subscription - // immediately (without requiring endpoint owner confirmation). - SubscriptionArn *string `type:"string"` -} - -// String returns the string representation -func (s SubscribeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubscribeOutput) GoString() string { - return s.String() -} - -// SetSubscriptionArn sets the SubscriptionArn field's value. -func (s *SubscribeOutput) SetSubscriptionArn(v string) *SubscribeOutput { - s.SubscriptionArn = &v - return s -} - -// A wrapper type for the attributes of an Amazon SNS subscription. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Subscription -type Subscription struct { - _ struct{} `type:"structure"` - - // The subscription's endpoint (format depends on the protocol). - Endpoint *string `type:"string"` - - // The subscription's owner. - Owner *string `type:"string"` - - // The subscription's protocol. - Protocol *string `type:"string"` - - // The subscription's ARN. - SubscriptionArn *string `type:"string"` - - // The ARN of the subscription's topic. - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s Subscription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Subscription) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *Subscription) SetEndpoint(v string) *Subscription { - s.Endpoint = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *Subscription) SetOwner(v string) *Subscription { - s.Owner = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *Subscription) SetProtocol(v string) *Subscription { - s.Protocol = &v - return s -} - -// SetSubscriptionArn sets the SubscriptionArn field's value. -func (s *Subscription) SetSubscriptionArn(v string) *Subscription { - s.SubscriptionArn = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *Subscription) SetTopicArn(v string) *Subscription { - s.TopicArn = &v - return s -} - -// A wrapper type for the topic's Amazon Resource Name (ARN). To retrieve a -// topic's attributes, use GetTopicAttributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Topic -type Topic struct { - _ struct{} `type:"structure"` - - // The topic's ARN. - TopicArn *string `type:"string"` -} - -// String returns the string representation -func (s Topic) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Topic) GoString() string { - return s.String() -} - -// SetTopicArn sets the TopicArn field's value. -func (s *Topic) SetTopicArn(v string) *Topic { - s.TopicArn = &v - return s -} - -// Input for Unsubscribe action. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/UnsubscribeInput -type UnsubscribeInput struct { - _ struct{} `type:"structure"` - - // The ARN of the subscription to be deleted. - // - // SubscriptionArn is a required field - SubscriptionArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UnsubscribeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsubscribeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnsubscribeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnsubscribeInput"} - if s.SubscriptionArn == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubscriptionArn sets the SubscriptionArn field's value. -func (s *UnsubscribeInput) SetSubscriptionArn(v string) *UnsubscribeInput { - s.SubscriptionArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/UnsubscribeOutput -type UnsubscribeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UnsubscribeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsubscribeOutput) GoString() string { - return s.String() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sns/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sns/errors.go deleted file mode 100644 index c6e3dbe..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/errors.go +++ /dev/null @@ -1,67 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package sns - -const ( - - // ErrCodeAuthorizationErrorException for service response error code - // "AuthorizationError". - // - // Indicates that the user has been denied access to the requested resource. - ErrCodeAuthorizationErrorException = "AuthorizationError" - - // ErrCodeEndpointDisabledException for service response error code - // "EndpointDisabled". - // - // Exception error indicating endpoint disabled. - ErrCodeEndpointDisabledException = "EndpointDisabled" - - // ErrCodeInternalErrorException for service response error code - // "InternalError". - // - // Indicates an internal service error. - ErrCodeInternalErrorException = "InternalError" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameter". - // - // Indicates that a request parameter does not comply with the associated constraints. - ErrCodeInvalidParameterException = "InvalidParameter" - - // ErrCodeInvalidParameterValueException for service response error code - // "ParameterValueInvalid". - // - // Indicates that a request parameter does not comply with the associated constraints. - ErrCodeInvalidParameterValueException = "ParameterValueInvalid" - - // ErrCodeNotFoundException for service response error code - // "NotFound". - // - // Indicates that the requested resource does not exist. - ErrCodeNotFoundException = "NotFound" - - // ErrCodePlatformApplicationDisabledException for service response error code - // "PlatformApplicationDisabled". - // - // Exception error indicating platform application disabled. - ErrCodePlatformApplicationDisabledException = "PlatformApplicationDisabled" - - // ErrCodeSubscriptionLimitExceededException for service response error code - // "SubscriptionLimitExceeded". - // - // Indicates that the customer already owns the maximum allowed number of subscriptions. - ErrCodeSubscriptionLimitExceededException = "SubscriptionLimitExceeded" - - // ErrCodeThrottledException for service response error code - // "Throttled". - // - // Indicates that the rate at which requests have been submitted for this action - // exceeds the limit for your account. - ErrCodeThrottledException = "Throttled" - - // ErrCodeTopicLimitExceededException for service response error code - // "TopicLimitExceeded". - // - // Indicates that the customer already owns the maximum allowed number of topics. - ErrCodeTopicLimitExceededException = "TopicLimitExceeded" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sns/service.go b/vendor/github.com/aws/aws-sdk-go/service/sns/service.go deleted file mode 100644 index 6bb73fa..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/service.go +++ /dev/null @@ -1,103 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package sns - -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" -) - -// Amazon Simple Notification Service (Amazon SNS) is a web service that enables -// you to build distributed web-enabled applications. Applications can use Amazon -// SNS to easily push real-time notification messages to interested subscribers -// over multiple delivery protocols. For more information about this product -// see http://aws.amazon.com/sns (http://aws.amazon.com/sns/). For detailed -// information about Amazon SNS features and their associated API calls, see -// the Amazon SNS Developer Guide (http://docs.aws.amazon.com/sns/latest/dg/). -// -// We also provide SDKs that enable you to access Amazon SNS from your preferred -// programming language. The SDKs contain functionality that automatically takes -// care of tasks such as: cryptographically signing your service requests, retrying -// requests, and handling error responses. For a list of available SDKs, go -// to Tools for Amazon Web Services (http://aws.amazon.com/tools/). -// 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/sns-2010-03-31 -type SNS 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 = "sns" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the SNS 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 SNS client from just a session. -// svc := sns.New(mySession) -// -// // Create a SNS client with additional configuration -// svc := sns.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SNS { - 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) *SNS { - svc := &SNS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2010-03-31", - }, - 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 SNS operation and runs any -// custom request initialization. -func (c *SNS) 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/sqs/api.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go deleted file mode 100644 index 207ef6d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go +++ /dev/null @@ -1,4200 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package sqs provides a client for Amazon Simple Queue Service. -package sqs - -import ( - "fmt" - - "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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -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) - err := req.Send() - return out, err -} - -// 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/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/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 d4f394e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go +++ /dev/null @@ -1,110 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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/service.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go deleted file mode 100644 index 7df1fbc..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go +++ /dev/null @@ -1,126 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. 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/ssm/api.go b/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go deleted file mode 100644 index 56bbee8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go +++ /dev/null @@ -1,20630 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package ssm provides a client for Amazon Simple Systems Manager (SSM). -package ssm - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAddTagsToResource = "AddTagsToResource" - -// AddTagsToResourceRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToResourceRequest method. -// req, resp := client.AddTagsToResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AddTagsToResource -func (c *SSM) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *request.Request, output *AddTagsToResourceOutput) { - op := &request.Operation{ - Name: opAddTagsToResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsToResourceInput{} - } - - output = &AddTagsToResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// AddTagsToResource API operation for Amazon Simple Systems Manager (SSM). -// -// Adds or overwrites one or more tags for the specified resource. Tags are -// metadata that you assign to your managed instances. Tags enable you to categorize -// your managed instances in different ways, for example, by purpose, owner, -// or environment. Each tag consists of a key and an optional value, both of -// which you define. For example, you could define a set of tags for your account's -// managed instances that helps you track each instance's owner and stack level. -// For example: Key=Owner and Value=DbAdmin, SysAdmin, or Dev. Or Key=Stack -// and Value=Production, Pre-Production, or Test. Each resource can have a maximum -// of 10 tags. -// -// We recommend that you devise a set of tag keys that meets your needs for -// each resource type. Using a consistent set of tag keys makes it easier for -// you to manage your resources. You can search and filter the resources based -// on the tags you add. Tags don't have any semantic meaning to Amazon EC2 and -// are interpreted strictly as a string of characters. -// -// For more information about tags, see Tagging Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) -// in the Amazon EC2 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 Simple Systems Manager (SSM)'s -// API operation AddTagsToResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceType "InvalidResourceType" -// The resource type is not valid. If you are attempting to tag an instance, -// the instance must be a registered, managed instance. -// -// * ErrCodeInvalidResourceId "InvalidResourceId" -// The resource ID is not valid. Verify that you entered the correct ID and -// try again. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeTooManyTagsError "TooManyTagsError" -// The Targets parameter includes too many tags. Remove one or more tags and -// try the command again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AddTagsToResource -func (c *SSM) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { - req, out := c.AddTagsToResourceRequest(input) - err := req.Send() - return out, err -} - -const opCancelCommand = "CancelCommand" - -// CancelCommandRequest generates a "aws/request.Request" representing the -// client's request for the CancelCommand operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelCommand for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelCommand method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelCommandRequest method. -// req, resp := client.CancelCommandRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelCommand -func (c *SSM) CancelCommandRequest(input *CancelCommandInput) (req *request.Request, output *CancelCommandOutput) { - op := &request.Operation{ - Name: opCancelCommand, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelCommandInput{} - } - - output = &CancelCommandOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelCommand API operation for Amazon Simple Systems Manager (SSM). -// -// Attempts to cancel the command specified by the Command ID. There is no guarantee -// that the command will be terminated and the underlying process 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 Simple Systems Manager (SSM)'s -// API operation CancelCommand for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidCommandId "InvalidCommandId" -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeDuplicateInstanceId "DuplicateInstanceId" -// You cannot specify an instance ID in more than one association. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelCommand -func (c *SSM) CancelCommand(input *CancelCommandInput) (*CancelCommandOutput, error) { - req, out := c.CancelCommandRequest(input) - err := req.Send() - return out, err -} - -const opCreateActivation = "CreateActivation" - -// CreateActivationRequest generates a "aws/request.Request" representing the -// client's request for the CreateActivation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateActivation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateActivation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateActivationRequest method. -// req, resp := client.CreateActivationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateActivation -func (c *SSM) CreateActivationRequest(input *CreateActivationInput) (req *request.Request, output *CreateActivationOutput) { - op := &request.Operation{ - Name: opCreateActivation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateActivationInput{} - } - - output = &CreateActivationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateActivation API operation for Amazon Simple Systems Manager (SSM). -// -// Registers your on-premises server or virtual machine with Amazon EC2 so that -// you can manage these resources using Run Command. An on-premises server or -// virtual machine that has been registered with EC2 is called a managed instance. -// For more information about activations, see Setting Up Managed Instances -// (Linux) (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managed-instances.html) -// or Setting Up Managed Instances (Windows) (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/managed-instances.html) -// in the Amazon EC2 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 Simple Systems Manager (SSM)'s -// API operation CreateActivation 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/ssm-2014-11-06/CreateActivation -func (c *SSM) CreateActivation(input *CreateActivationInput) (*CreateActivationOutput, error) { - req, out := c.CreateActivationRequest(input) - err := req.Send() - return out, err -} - -const opCreateAssociation = "CreateAssociation" - -// CreateAssociationRequest generates a "aws/request.Request" representing the -// client's request for the CreateAssociation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAssociation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAssociation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAssociationRequest method. -// req, resp := client.CreateAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociation -func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *request.Request, output *CreateAssociationOutput) { - op := &request.Operation{ - Name: opCreateAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAssociationInput{} - } - - output = &CreateAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAssociation API operation for Amazon Simple Systems Manager (SSM). -// -// Associates the specified SSM document with the specified instances or targets. -// -// When you associate an SSM document with one or more instances using instance -// IDs or tags, the SSM agent running on the instance processes the document -// and configures the instance as specified. -// -// If you associate a document with an instance that already has an associated -// document, the system throws the AssociationAlreadyExists exception. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation CreateAssociation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAssociationAlreadyExists "AssociationAlreadyExists" -// The specified association already exists. -// -// * ErrCodeAssociationLimitExceeded "AssociationLimitExceeded" -// You can have at most 2,000 active associations. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" -// The document version is not valid or does not exist. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" -// The document does not support the platform type of the given instance ID(s). -// For example, you sent an SSM document for a Windows instance to a Linux instance. -// -// * ErrCodeInvalidOutputLocation "InvalidOutputLocation" -// The output location is not valid or does not exist. -// -// * ErrCodeInvalidParameters "InvalidParameters" -// You must specify values for all required parameters in the SSM document. -// You can only supply values to parameters defined in the SSM document. -// -// * ErrCodeInvalidTarget "InvalidTarget" -// The target is not valid or does not exist. It might not be configured for -// EC2 Systems Manager or you might not have permission to perform the operation. -// -// * ErrCodeInvalidSchedule "InvalidSchedule" -// The schedule is invalid. Verify your cron or rate expression and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociation -func (c *SSM) CreateAssociation(input *CreateAssociationInput) (*CreateAssociationOutput, error) { - req, out := c.CreateAssociationRequest(input) - err := req.Send() - return out, err -} - -const opCreateAssociationBatch = "CreateAssociationBatch" - -// CreateAssociationBatchRequest generates a "aws/request.Request" representing the -// client's request for the CreateAssociationBatch operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateAssociationBatch for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateAssociationBatch method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateAssociationBatchRequest method. -// req, resp := client.CreateAssociationBatchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatch -func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) (req *request.Request, output *CreateAssociationBatchOutput) { - op := &request.Operation{ - Name: opCreateAssociationBatch, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAssociationBatchInput{} - } - - output = &CreateAssociationBatchOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAssociationBatch API operation for Amazon Simple Systems Manager (SSM). -// -// Associates the specified SSM document with the specified instances or targets. -// -// When you associate an SSM document with one or more instances using instance -// IDs or tags, the SSM agent running on the instance processes the document -// and configures the instance as specified. -// -// If you associate a document with an instance that already has an associated -// document, the system throws the AssociationAlreadyExists exception. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation CreateAssociationBatch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" -// The document version is not valid or does not exist. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidParameters "InvalidParameters" -// You must specify values for all required parameters in the SSM document. -// You can only supply values to parameters defined in the SSM document. -// -// * ErrCodeDuplicateInstanceId "DuplicateInstanceId" -// You cannot specify an instance ID in more than one association. -// -// * ErrCodeAssociationLimitExceeded "AssociationLimitExceeded" -// You can have at most 2,000 active associations. -// -// * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" -// The document does not support the platform type of the given instance ID(s). -// For example, you sent an SSM document for a Windows instance to a Linux instance. -// -// * ErrCodeInvalidOutputLocation "InvalidOutputLocation" -// The output location is not valid or does not exist. -// -// * ErrCodeInvalidTarget "InvalidTarget" -// The target is not valid or does not exist. It might not be configured for -// EC2 Systems Manager or you might not have permission to perform the operation. -// -// * ErrCodeInvalidSchedule "InvalidSchedule" -// The schedule is invalid. Verify your cron or rate expression and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatch -func (c *SSM) CreateAssociationBatch(input *CreateAssociationBatchInput) (*CreateAssociationBatchOutput, error) { - req, out := c.CreateAssociationBatchRequest(input) - err := req.Send() - return out, err -} - -const opCreateDocument = "CreateDocument" - -// CreateDocumentRequest generates a "aws/request.Request" representing the -// client's request for the CreateDocument operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDocument for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDocument method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDocumentRequest method. -// req, resp := client.CreateDocumentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateDocument -func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *request.Request, output *CreateDocumentOutput) { - op := &request.Operation{ - Name: opCreateDocument, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDocumentInput{} - } - - output = &CreateDocumentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDocument API operation for Amazon Simple Systems Manager (SSM). -// -// Creates an SSM document. -// -// After you create an SSM document, you can use CreateAssociation to associate -// it with one or more running 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 Simple Systems Manager (SSM)'s -// API operation CreateDocument for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDocumentAlreadyExists "DocumentAlreadyExists" -// The specified SSM document already exists. -// -// * ErrCodeMaxDocumentSizeExceeded "MaxDocumentSizeExceeded" -// The size limit of an SSM document is 64 KB. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocumentContent "InvalidDocumentContent" -// The content for the SSM document is not valid. -// -// * ErrCodeDocumentLimitExceeded "DocumentLimitExceeded" -// You can have at most 200 active SSM documents. -// -// * ErrCodeInvalidDocumentSchemaVersion "InvalidDocumentSchemaVersion" -// The version of the document schema is not supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateDocument -func (c *SSM) CreateDocument(input *CreateDocumentInput) (*CreateDocumentOutput, error) { - req, out := c.CreateDocumentRequest(input) - err := req.Send() - return out, err -} - -const opCreateMaintenanceWindow = "CreateMaintenanceWindow" - -// CreateMaintenanceWindowRequest generates a "aws/request.Request" representing the -// client's request for the CreateMaintenanceWindow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateMaintenanceWindow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateMaintenanceWindow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateMaintenanceWindowRequest method. -// req, resp := client.CreateMaintenanceWindowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateMaintenanceWindow -func (c *SSM) CreateMaintenanceWindowRequest(input *CreateMaintenanceWindowInput) (req *request.Request, output *CreateMaintenanceWindowOutput) { - op := &request.Operation{ - Name: opCreateMaintenanceWindow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateMaintenanceWindowInput{} - } - - output = &CreateMaintenanceWindowOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateMaintenanceWindow API operation for Amazon Simple Systems Manager (SSM). -// -// Creates a new Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation CreateMaintenanceWindow for usage and error information. -// -// Returned Error Codes: -// * ErrCodeIdempotentParameterMismatch "IdempotentParameterMismatch" -// Error returned when an idempotent operation is retried and the parameters -// don’t match the original call to the API with the same idempotency token. -// -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" -// Error returned when the caller has exceeded the default resource limits (e.g. -// too many Maintenance Windows have been created). -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateMaintenanceWindow -func (c *SSM) CreateMaintenanceWindow(input *CreateMaintenanceWindowInput) (*CreateMaintenanceWindowOutput, error) { - req, out := c.CreateMaintenanceWindowRequest(input) - err := req.Send() - return out, err -} - -const opCreatePatchBaseline = "CreatePatchBaseline" - -// CreatePatchBaselineRequest generates a "aws/request.Request" representing the -// client's request for the CreatePatchBaseline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePatchBaseline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePatchBaseline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePatchBaselineRequest method. -// req, resp := client.CreatePatchBaselineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreatePatchBaseline -func (c *SSM) CreatePatchBaselineRequest(input *CreatePatchBaselineInput) (req *request.Request, output *CreatePatchBaselineOutput) { - op := &request.Operation{ - Name: opCreatePatchBaseline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePatchBaselineInput{} - } - - output = &CreatePatchBaselineOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePatchBaseline API operation for Amazon Simple Systems Manager (SSM). -// -// Creates a patch baseline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation CreatePatchBaseline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeIdempotentParameterMismatch "IdempotentParameterMismatch" -// Error returned when an idempotent operation is retried and the parameters -// don’t match the original call to the API with the same idempotency token. -// -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" -// Error returned when the caller has exceeded the default resource limits (e.g. -// too many Maintenance Windows have been created). -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreatePatchBaseline -func (c *SSM) CreatePatchBaseline(input *CreatePatchBaselineInput) (*CreatePatchBaselineOutput, error) { - req, out := c.CreatePatchBaselineRequest(input) - err := req.Send() - return out, err -} - -const opDeleteActivation = "DeleteActivation" - -// DeleteActivationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteActivation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteActivation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteActivation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteActivationRequest method. -// req, resp := client.DeleteActivationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteActivation -func (c *SSM) DeleteActivationRequest(input *DeleteActivationInput) (req *request.Request, output *DeleteActivationOutput) { - op := &request.Operation{ - Name: opDeleteActivation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteActivationInput{} - } - - output = &DeleteActivationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteActivation API operation for Amazon Simple Systems Manager (SSM). -// -// Deletes an activation. You are not required to delete an activation. If you -// delete an activation, you can no longer use it to register additional managed -// instances. Deleting an activation does not de-register managed instances. -// You must manually de-register managed 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 Simple Systems Manager (SSM)'s -// API operation DeleteActivation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidActivationId "InvalidActivationId" -// The activation ID is not valid. Verify the you entered the correct ActivationId -// or ActivationCode and try again. -// -// * ErrCodeInvalidActivation "InvalidActivation" -// The activation is not valid. The activation might have been deleted, or the -// ActivationId and the ActivationCode do not match. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteActivation -func (c *SSM) DeleteActivation(input *DeleteActivationInput) (*DeleteActivationOutput, error) { - req, out := c.DeleteActivationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteAssociation = "DeleteAssociation" - -// DeleteAssociationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAssociation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteAssociation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteAssociation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteAssociationRequest method. -// req, resp := client.DeleteAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteAssociation -func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *request.Request, output *DeleteAssociationOutput) { - op := &request.Operation{ - Name: opDeleteAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAssociationInput{} - } - - output = &DeleteAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteAssociation API operation for Amazon Simple Systems Manager (SSM). -// -// Disassociates the specified SSM document from the specified instance. -// -// When you disassociate an SSM document from an instance, it does not change -// the configuration of the instance. To change the configuration state of an -// instance after you disassociate a document, you must create a new document -// with the desired configuration and associate it with the 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 Simple Systems Manager (SSM)'s -// API operation DeleteAssociation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" -// The specified association does not exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeTooManyUpdates "TooManyUpdates" -// There are concurrent updates for a resource that supports one update at a -// time. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteAssociation -func (c *SSM) DeleteAssociation(input *DeleteAssociationInput) (*DeleteAssociationOutput, error) { - req, out := c.DeleteAssociationRequest(input) - err := req.Send() - return out, err -} - -const opDeleteDocument = "DeleteDocument" - -// DeleteDocumentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDocument operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDocument for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDocument method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDocumentRequest method. -// req, resp := client.DeleteDocumentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteDocument -func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) (req *request.Request, output *DeleteDocumentOutput) { - op := &request.Operation{ - Name: opDeleteDocument, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDocumentInput{} - } - - output = &DeleteDocumentOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDocument API operation for Amazon Simple Systems Manager (SSM). -// -// Deletes the SSM document and all instance associations to the document. -// -// Before you delete the SSM document, we recommend that you use DeleteAssociation -// to disassociate all instances that are associated with the document. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DeleteDocument for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidDocumentOperation "InvalidDocumentOperation" -// You attempted to delete a document while it is still shared. You must stop -// sharing the document before you can delete it. -// -// * ErrCodeAssociatedInstances "AssociatedInstances" -// You must disassociate an SSM document from all instances before you can delete -// it. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteDocument -func (c *SSM) DeleteDocument(input *DeleteDocumentInput) (*DeleteDocumentOutput, error) { - req, out := c.DeleteDocumentRequest(input) - err := req.Send() - return out, err -} - -const opDeleteMaintenanceWindow = "DeleteMaintenanceWindow" - -// DeleteMaintenanceWindowRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMaintenanceWindow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteMaintenanceWindow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteMaintenanceWindow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteMaintenanceWindowRequest method. -// req, resp := client.DeleteMaintenanceWindowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteMaintenanceWindow -func (c *SSM) DeleteMaintenanceWindowRequest(input *DeleteMaintenanceWindowInput) (req *request.Request, output *DeleteMaintenanceWindowOutput) { - op := &request.Operation{ - Name: opDeleteMaintenanceWindow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteMaintenanceWindowInput{} - } - - output = &DeleteMaintenanceWindowOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteMaintenanceWindow API operation for Amazon Simple Systems Manager (SSM). -// -// Deletes a Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DeleteMaintenanceWindow 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/ssm-2014-11-06/DeleteMaintenanceWindow -func (c *SSM) DeleteMaintenanceWindow(input *DeleteMaintenanceWindowInput) (*DeleteMaintenanceWindowOutput, error) { - req, out := c.DeleteMaintenanceWindowRequest(input) - err := req.Send() - return out, err -} - -const opDeleteParameter = "DeleteParameter" - -// DeleteParameterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteParameter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteParameter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteParameter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteParameterRequest method. -// req, resp := client.DeleteParameterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameter -func (c *SSM) DeleteParameterRequest(input *DeleteParameterInput) (req *request.Request, output *DeleteParameterOutput) { - op := &request.Operation{ - Name: opDeleteParameter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteParameterInput{} - } - - output = &DeleteParameterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteParameter API operation for Amazon Simple Systems Manager (SSM). -// -// Delete a parameter from the system. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DeleteParameter for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeParameterNotFound "ParameterNotFound" -// The parameter could not be found. Verify the name and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameter -func (c *SSM) DeleteParameter(input *DeleteParameterInput) (*DeleteParameterOutput, error) { - req, out := c.DeleteParameterRequest(input) - err := req.Send() - return out, err -} - -const opDeletePatchBaseline = "DeletePatchBaseline" - -// DeletePatchBaselineRequest generates a "aws/request.Request" representing the -// client's request for the DeletePatchBaseline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePatchBaseline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePatchBaseline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePatchBaselineRequest method. -// req, resp := client.DeletePatchBaselineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeletePatchBaseline -func (c *SSM) DeletePatchBaselineRequest(input *DeletePatchBaselineInput) (req *request.Request, output *DeletePatchBaselineOutput) { - op := &request.Operation{ - Name: opDeletePatchBaseline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePatchBaselineInput{} - } - - output = &DeletePatchBaselineOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeletePatchBaseline API operation for Amazon Simple Systems Manager (SSM). -// -// Deletes a patch baseline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DeletePatchBaseline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// Error returned if an attempt is made to delete a patch baseline that is registered -// for a patch group. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeletePatchBaseline -func (c *SSM) DeletePatchBaseline(input *DeletePatchBaselineInput) (*DeletePatchBaselineOutput, error) { - req, out := c.DeletePatchBaselineRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterManagedInstance = "DeregisterManagedInstance" - -// DeregisterManagedInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterManagedInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterManagedInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterManagedInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterManagedInstanceRequest method. -// req, resp := client.DeregisterManagedInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterManagedInstance -func (c *SSM) DeregisterManagedInstanceRequest(input *DeregisterManagedInstanceInput) (req *request.Request, output *DeregisterManagedInstanceOutput) { - op := &request.Operation{ - Name: opDeregisterManagedInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterManagedInstanceInput{} - } - - output = &DeregisterManagedInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterManagedInstance API operation for Amazon Simple Systems Manager (SSM). -// -// Removes the server or virtual machine from the list of registered servers. -// You can reregister the instance again at any time. If you don’t plan to use -// Run Command on the server, we suggest uninstalling the SSM agent first. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DeregisterManagedInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterManagedInstance -func (c *SSM) DeregisterManagedInstance(input *DeregisterManagedInstanceInput) (*DeregisterManagedInstanceOutput, error) { - req, out := c.DeregisterManagedInstanceRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterPatchBaselineForPatchGroup = "DeregisterPatchBaselineForPatchGroup" - -// DeregisterPatchBaselineForPatchGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterPatchBaselineForPatchGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterPatchBaselineForPatchGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterPatchBaselineForPatchGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterPatchBaselineForPatchGroupRequest method. -// req, resp := client.DeregisterPatchBaselineForPatchGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterPatchBaselineForPatchGroup -func (c *SSM) DeregisterPatchBaselineForPatchGroupRequest(input *DeregisterPatchBaselineForPatchGroupInput) (req *request.Request, output *DeregisterPatchBaselineForPatchGroupOutput) { - op := &request.Operation{ - Name: opDeregisterPatchBaselineForPatchGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterPatchBaselineForPatchGroupInput{} - } - - output = &DeregisterPatchBaselineForPatchGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterPatchBaselineForPatchGroup API operation for Amazon Simple Systems Manager (SSM). -// -// Removes a patch group from a patch baseline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DeregisterPatchBaselineForPatchGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceId "InvalidResourceId" -// The resource ID is not valid. Verify that you entered the correct ID and -// try again. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterPatchBaselineForPatchGroup -func (c *SSM) DeregisterPatchBaselineForPatchGroup(input *DeregisterPatchBaselineForPatchGroupInput) (*DeregisterPatchBaselineForPatchGroupOutput, error) { - req, out := c.DeregisterPatchBaselineForPatchGroupRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterTargetFromMaintenanceWindow = "DeregisterTargetFromMaintenanceWindow" - -// DeregisterTargetFromMaintenanceWindowRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterTargetFromMaintenanceWindow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterTargetFromMaintenanceWindow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterTargetFromMaintenanceWindow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterTargetFromMaintenanceWindowRequest method. -// req, resp := client.DeregisterTargetFromMaintenanceWindowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTargetFromMaintenanceWindow -func (c *SSM) DeregisterTargetFromMaintenanceWindowRequest(input *DeregisterTargetFromMaintenanceWindowInput) (req *request.Request, output *DeregisterTargetFromMaintenanceWindowOutput) { - op := &request.Operation{ - Name: opDeregisterTargetFromMaintenanceWindow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterTargetFromMaintenanceWindowInput{} - } - - output = &DeregisterTargetFromMaintenanceWindowOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterTargetFromMaintenanceWindow API operation for Amazon Simple Systems Manager (SSM). -// -// Removes a target from a Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DeregisterTargetFromMaintenanceWindow for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTargetFromMaintenanceWindow -func (c *SSM) DeregisterTargetFromMaintenanceWindow(input *DeregisterTargetFromMaintenanceWindowInput) (*DeregisterTargetFromMaintenanceWindowOutput, error) { - req, out := c.DeregisterTargetFromMaintenanceWindowRequest(input) - err := req.Send() - return out, err -} - -const opDeregisterTaskFromMaintenanceWindow = "DeregisterTaskFromMaintenanceWindow" - -// DeregisterTaskFromMaintenanceWindowRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterTaskFromMaintenanceWindow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterTaskFromMaintenanceWindow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterTaskFromMaintenanceWindow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterTaskFromMaintenanceWindowRequest method. -// req, resp := client.DeregisterTaskFromMaintenanceWindowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTaskFromMaintenanceWindow -func (c *SSM) DeregisterTaskFromMaintenanceWindowRequest(input *DeregisterTaskFromMaintenanceWindowInput) (req *request.Request, output *DeregisterTaskFromMaintenanceWindowOutput) { - op := &request.Operation{ - Name: opDeregisterTaskFromMaintenanceWindow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterTaskFromMaintenanceWindowInput{} - } - - output = &DeregisterTaskFromMaintenanceWindowOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterTaskFromMaintenanceWindow API operation for Amazon Simple Systems Manager (SSM). -// -// Removes a task from a Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DeregisterTaskFromMaintenanceWindow for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTaskFromMaintenanceWindow -func (c *SSM) DeregisterTaskFromMaintenanceWindow(input *DeregisterTaskFromMaintenanceWindowInput) (*DeregisterTaskFromMaintenanceWindowOutput, error) { - req, out := c.DeregisterTaskFromMaintenanceWindowRequest(input) - err := req.Send() - return out, err -} - -const opDescribeActivations = "DescribeActivations" - -// DescribeActivationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeActivations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeActivations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeActivations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeActivationsRequest method. -// req, resp := client.DescribeActivationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeActivations -func (c *SSM) DescribeActivationsRequest(input *DescribeActivationsInput) (req *request.Request, output *DescribeActivationsOutput) { - op := &request.Operation{ - Name: opDescribeActivations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeActivationsInput{} - } - - output = &DescribeActivationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeActivations API operation for Amazon Simple Systems Manager (SSM). -// -// Details about the activation, including: the date and time the activation -// was created, the expiration date, the IAM role assigned to the instances -// in the activation, and the number of instances activated by this registration. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeActivations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidFilter "InvalidFilter" -// The filter name is not valid. Verify the you entered the correct name and -// try again. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeActivations -func (c *SSM) DescribeActivations(input *DescribeActivationsInput) (*DescribeActivationsOutput, error) { - req, out := c.DescribeActivationsRequest(input) - err := req.Send() - return out, err -} - -// DescribeActivationsPages iterates over the pages of a DescribeActivations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeActivations 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 DescribeActivations operation. -// pageNum := 0 -// err := client.DescribeActivationsPages(params, -// func(page *DescribeActivationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) DescribeActivationsPages(input *DescribeActivationsInput, fn func(p *DescribeActivationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeActivationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeActivationsOutput), lastPage) - }) -} - -const opDescribeAssociation = "DescribeAssociation" - -// DescribeAssociationRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAssociation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAssociation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAssociation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAssociationRequest method. -// req, resp := client.DescribeAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociation -func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req *request.Request, output *DescribeAssociationOutput) { - op := &request.Operation{ - Name: opDescribeAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAssociationInput{} - } - - output = &DescribeAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAssociation API operation for Amazon Simple Systems Manager (SSM). -// -// Describes the associations for the specified SSM document or 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 Simple Systems Manager (SSM)'s -// API operation DescribeAssociation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" -// The specified association does not exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociation -func (c *SSM) DescribeAssociation(input *DescribeAssociationInput) (*DescribeAssociationOutput, error) { - req, out := c.DescribeAssociationRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAutomationExecutions = "DescribeAutomationExecutions" - -// DescribeAutomationExecutionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAutomationExecutions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAutomationExecutions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAutomationExecutions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAutomationExecutionsRequest method. -// req, resp := client.DescribeAutomationExecutionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationExecutions -func (c *SSM) DescribeAutomationExecutionsRequest(input *DescribeAutomationExecutionsInput) (req *request.Request, output *DescribeAutomationExecutionsOutput) { - op := &request.Operation{ - Name: opDescribeAutomationExecutions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAutomationExecutionsInput{} - } - - output = &DescribeAutomationExecutionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAutomationExecutions API operation for Amazon Simple Systems Manager (SSM). -// -// Provides details about all active and terminated Automation executions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeAutomationExecutions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationExecutions -func (c *SSM) DescribeAutomationExecutions(input *DescribeAutomationExecutionsInput) (*DescribeAutomationExecutionsOutput, error) { - req, out := c.DescribeAutomationExecutionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeAvailablePatches = "DescribeAvailablePatches" - -// DescribeAvailablePatchesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAvailablePatches operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAvailablePatches for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAvailablePatches method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAvailablePatchesRequest method. -// req, resp := client.DescribeAvailablePatchesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAvailablePatches -func (c *SSM) DescribeAvailablePatchesRequest(input *DescribeAvailablePatchesInput) (req *request.Request, output *DescribeAvailablePatchesOutput) { - op := &request.Operation{ - Name: opDescribeAvailablePatches, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAvailablePatchesInput{} - } - - output = &DescribeAvailablePatchesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAvailablePatches API operation for Amazon Simple Systems Manager (SSM). -// -// Lists all patches that could possibly be included in a patch baseline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeAvailablePatches 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/ssm-2014-11-06/DescribeAvailablePatches -func (c *SSM) DescribeAvailablePatches(input *DescribeAvailablePatchesInput) (*DescribeAvailablePatchesOutput, error) { - req, out := c.DescribeAvailablePatchesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDocument = "DescribeDocument" - -// DescribeDocumentRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDocument operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDocument for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDocument method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDocumentRequest method. -// req, resp := client.DescribeDocumentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocument -func (c *SSM) DescribeDocumentRequest(input *DescribeDocumentInput) (req *request.Request, output *DescribeDocumentOutput) { - op := &request.Operation{ - Name: opDescribeDocument, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDocumentInput{} - } - - output = &DescribeDocumentOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDocument API operation for Amazon Simple Systems Manager (SSM). -// -// Describes the specified SSM document. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeDocument for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" -// The document version is not valid or does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocument -func (c *SSM) DescribeDocument(input *DescribeDocumentInput) (*DescribeDocumentOutput, error) { - req, out := c.DescribeDocumentRequest(input) - err := req.Send() - return out, err -} - -const opDescribeDocumentPermission = "DescribeDocumentPermission" - -// DescribeDocumentPermissionRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDocumentPermission operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDocumentPermission for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDocumentPermission method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDocumentPermissionRequest method. -// req, resp := client.DescribeDocumentPermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocumentPermission -func (c *SSM) DescribeDocumentPermissionRequest(input *DescribeDocumentPermissionInput) (req *request.Request, output *DescribeDocumentPermissionOutput) { - op := &request.Operation{ - Name: opDescribeDocumentPermission, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDocumentPermissionInput{} - } - - output = &DescribeDocumentPermissionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDocumentPermission API operation for Amazon Simple Systems Manager (SSM). -// -// Describes the permissions for an SSM document. If you created the document, -// you are the owner. If a document is shared, it can either be shared privately -// (by specifying a user’s AWS account ID) or publicly (All). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeDocumentPermission for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidPermissionType "InvalidPermissionType" -// The permission type is not supported. Share is the only supported permission -// type. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocumentPermission -func (c *SSM) DescribeDocumentPermission(input *DescribeDocumentPermissionInput) (*DescribeDocumentPermissionOutput, error) { - req, out := c.DescribeDocumentPermissionRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEffectiveInstanceAssociations = "DescribeEffectiveInstanceAssociations" - -// DescribeEffectiveInstanceAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEffectiveInstanceAssociations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEffectiveInstanceAssociations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEffectiveInstanceAssociations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEffectiveInstanceAssociationsRequest method. -// req, resp := client.DescribeEffectiveInstanceAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectiveInstanceAssociations -func (c *SSM) DescribeEffectiveInstanceAssociationsRequest(input *DescribeEffectiveInstanceAssociationsInput) (req *request.Request, output *DescribeEffectiveInstanceAssociationsOutput) { - op := &request.Operation{ - Name: opDescribeEffectiveInstanceAssociations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEffectiveInstanceAssociationsInput{} - } - - output = &DescribeEffectiveInstanceAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEffectiveInstanceAssociations API operation for Amazon Simple Systems Manager (SSM). -// -// All associations for the instance(s). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeEffectiveInstanceAssociations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectiveInstanceAssociations -func (c *SSM) DescribeEffectiveInstanceAssociations(input *DescribeEffectiveInstanceAssociationsInput) (*DescribeEffectiveInstanceAssociationsOutput, error) { - req, out := c.DescribeEffectiveInstanceAssociationsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeEffectivePatchesForPatchBaseline = "DescribeEffectivePatchesForPatchBaseline" - -// DescribeEffectivePatchesForPatchBaselineRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEffectivePatchesForPatchBaseline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEffectivePatchesForPatchBaseline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEffectivePatchesForPatchBaseline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEffectivePatchesForPatchBaselineRequest method. -// req, resp := client.DescribeEffectivePatchesForPatchBaselineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectivePatchesForPatchBaseline -func (c *SSM) DescribeEffectivePatchesForPatchBaselineRequest(input *DescribeEffectivePatchesForPatchBaselineInput) (req *request.Request, output *DescribeEffectivePatchesForPatchBaselineOutput) { - op := &request.Operation{ - Name: opDescribeEffectivePatchesForPatchBaseline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEffectivePatchesForPatchBaselineInput{} - } - - output = &DescribeEffectivePatchesForPatchBaselineOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEffectivePatchesForPatchBaseline API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the current effective patches (the patch and the approval state) -// for the specified patch baseline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeEffectivePatchesForPatchBaseline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceId "InvalidResourceId" -// The resource ID is not valid. Verify that you entered the correct ID and -// try again. -// -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectivePatchesForPatchBaseline -func (c *SSM) DescribeEffectivePatchesForPatchBaseline(input *DescribeEffectivePatchesForPatchBaselineInput) (*DescribeEffectivePatchesForPatchBaselineOutput, error) { - req, out := c.DescribeEffectivePatchesForPatchBaselineRequest(input) - err := req.Send() - return out, err -} - -const opDescribeInstanceAssociationsStatus = "DescribeInstanceAssociationsStatus" - -// DescribeInstanceAssociationsStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstanceAssociationsStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstanceAssociationsStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstanceAssociationsStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstanceAssociationsStatusRequest method. -// req, resp := client.DescribeInstanceAssociationsStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceAssociationsStatus -func (c *SSM) DescribeInstanceAssociationsStatusRequest(input *DescribeInstanceAssociationsStatusInput) (req *request.Request, output *DescribeInstanceAssociationsStatusOutput) { - op := &request.Operation{ - Name: opDescribeInstanceAssociationsStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceAssociationsStatusInput{} - } - - output = &DescribeInstanceAssociationsStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstanceAssociationsStatus API operation for Amazon Simple Systems Manager (SSM). -// -// The status of the associations for the instance(s). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeInstanceAssociationsStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceAssociationsStatus -func (c *SSM) DescribeInstanceAssociationsStatus(input *DescribeInstanceAssociationsStatusInput) (*DescribeInstanceAssociationsStatusOutput, error) { - req, out := c.DescribeInstanceAssociationsStatusRequest(input) - err := req.Send() - return out, err -} - -const opDescribeInstanceInformation = "DescribeInstanceInformation" - -// DescribeInstanceInformationRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstanceInformation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstanceInformation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstanceInformation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstanceInformationRequest method. -// req, resp := client.DescribeInstanceInformationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceInformation -func (c *SSM) DescribeInstanceInformationRequest(input *DescribeInstanceInformationInput) (req *request.Request, output *DescribeInstanceInformationOutput) { - op := &request.Operation{ - Name: opDescribeInstanceInformation, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeInstanceInformationInput{} - } - - output = &DescribeInstanceInformationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstanceInformation API operation for Amazon Simple Systems Manager (SSM). -// -// Describes one or more of your instances. You can use this to get information -// about instances like the operating system platform, the SSM agent version -// (Linux), status etc. If you specify one or more instance IDs, it returns -// information for those instances. If you do not specify instance IDs, it returns -// information for all your instances. If you specify an instance ID that is -// not valid or an instance that you do not own, you receive 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 Simple Systems Manager (SSM)'s -// API operation DescribeInstanceInformation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// * ErrCodeInvalidInstanceInformationFilterValue "InvalidInstanceInformationFilterValue" -// The specified filter value is not valid. -// -// * ErrCodeInvalidFilterKey "InvalidFilterKey" -// The specified key is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceInformation -func (c *SSM) DescribeInstanceInformation(input *DescribeInstanceInformationInput) (*DescribeInstanceInformationOutput, error) { - req, out := c.DescribeInstanceInformationRequest(input) - err := req.Send() - return out, err -} - -// DescribeInstanceInformationPages iterates over the pages of a DescribeInstanceInformation operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeInstanceInformation 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 DescribeInstanceInformation operation. -// pageNum := 0 -// err := client.DescribeInstanceInformationPages(params, -// func(page *DescribeInstanceInformationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) DescribeInstanceInformationPages(input *DescribeInstanceInformationInput, fn func(p *DescribeInstanceInformationOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.DescribeInstanceInformationRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*DescribeInstanceInformationOutput), lastPage) - }) -} - -const opDescribeInstancePatchStates = "DescribeInstancePatchStates" - -// DescribeInstancePatchStatesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstancePatchStates operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstancePatchStates for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstancePatchStates method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstancePatchStatesRequest method. -// req, resp := client.DescribeInstancePatchStatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStates -func (c *SSM) DescribeInstancePatchStatesRequest(input *DescribeInstancePatchStatesInput) (req *request.Request, output *DescribeInstancePatchStatesOutput) { - op := &request.Operation{ - Name: opDescribeInstancePatchStates, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstancePatchStatesInput{} - } - - output = &DescribeInstancePatchStatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstancePatchStates API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the high-level patch state of one or more 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 Simple Systems Manager (SSM)'s -// API operation DescribeInstancePatchStates for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStates -func (c *SSM) DescribeInstancePatchStates(input *DescribeInstancePatchStatesInput) (*DescribeInstancePatchStatesOutput, error) { - req, out := c.DescribeInstancePatchStatesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeInstancePatchStatesForPatchGroup = "DescribeInstancePatchStatesForPatchGroup" - -// DescribeInstancePatchStatesForPatchGroupRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstancePatchStatesForPatchGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstancePatchStatesForPatchGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstancePatchStatesForPatchGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstancePatchStatesForPatchGroupRequest method. -// req, resp := client.DescribeInstancePatchStatesForPatchGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesForPatchGroup -func (c *SSM) DescribeInstancePatchStatesForPatchGroupRequest(input *DescribeInstancePatchStatesForPatchGroupInput) (req *request.Request, output *DescribeInstancePatchStatesForPatchGroupOutput) { - op := &request.Operation{ - Name: opDescribeInstancePatchStatesForPatchGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstancePatchStatesForPatchGroupInput{} - } - - output = &DescribeInstancePatchStatesForPatchGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstancePatchStatesForPatchGroup API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the high-level patch state for the instances in the specified patch -// group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeInstancePatchStatesForPatchGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidFilter "InvalidFilter" -// The filter name is not valid. Verify the you entered the correct name and -// try again. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesForPatchGroup -func (c *SSM) DescribeInstancePatchStatesForPatchGroup(input *DescribeInstancePatchStatesForPatchGroupInput) (*DescribeInstancePatchStatesForPatchGroupOutput, error) { - req, out := c.DescribeInstancePatchStatesForPatchGroupRequest(input) - err := req.Send() - return out, err -} - -const opDescribeInstancePatches = "DescribeInstancePatches" - -// DescribeInstancePatchesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstancePatches operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstancePatches for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstancePatches method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstancePatchesRequest method. -// req, resp := client.DescribeInstancePatchesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatches -func (c *SSM) DescribeInstancePatchesRequest(input *DescribeInstancePatchesInput) (req *request.Request, output *DescribeInstancePatchesOutput) { - op := &request.Operation{ - Name: opDescribeInstancePatches, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstancePatchesInput{} - } - - output = &DescribeInstancePatchesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstancePatches API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves information about the patches on the specified instance and their -// state relative to the patch baseline being used for the 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 Simple Systems Manager (SSM)'s -// API operation DescribeInstancePatches for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidFilter "InvalidFilter" -// The filter name is not valid. Verify the you entered the correct name and -// try again. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatches -func (c *SSM) DescribeInstancePatches(input *DescribeInstancePatchesInput) (*DescribeInstancePatchesOutput, error) { - req, out := c.DescribeInstancePatchesRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMaintenanceWindowExecutionTaskInvocations = "DescribeMaintenanceWindowExecutionTaskInvocations" - -// DescribeMaintenanceWindowExecutionTaskInvocationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMaintenanceWindowExecutionTaskInvocations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMaintenanceWindowExecutionTaskInvocations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMaintenanceWindowExecutionTaskInvocations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMaintenanceWindowExecutionTaskInvocationsRequest method. -// req, resp := client.DescribeMaintenanceWindowExecutionTaskInvocationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTaskInvocations -func (c *SSM) DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input *DescribeMaintenanceWindowExecutionTaskInvocationsInput) (req *request.Request, output *DescribeMaintenanceWindowExecutionTaskInvocationsOutput) { - op := &request.Operation{ - Name: opDescribeMaintenanceWindowExecutionTaskInvocations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{} - } - - output = &DescribeMaintenanceWindowExecutionTaskInvocationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMaintenanceWindowExecutionTaskInvocations API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the individual task executions (one per target) for a particular -// task executed as part of a Maintenance Window execution. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeMaintenanceWindowExecutionTaskInvocations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTaskInvocations -func (c *SSM) DescribeMaintenanceWindowExecutionTaskInvocations(input *DescribeMaintenanceWindowExecutionTaskInvocationsInput) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) { - req, out := c.DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMaintenanceWindowExecutionTasks = "DescribeMaintenanceWindowExecutionTasks" - -// DescribeMaintenanceWindowExecutionTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMaintenanceWindowExecutionTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMaintenanceWindowExecutionTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMaintenanceWindowExecutionTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMaintenanceWindowExecutionTasksRequest method. -// req, resp := client.DescribeMaintenanceWindowExecutionTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTasks -func (c *SSM) DescribeMaintenanceWindowExecutionTasksRequest(input *DescribeMaintenanceWindowExecutionTasksInput) (req *request.Request, output *DescribeMaintenanceWindowExecutionTasksOutput) { - op := &request.Operation{ - Name: opDescribeMaintenanceWindowExecutionTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMaintenanceWindowExecutionTasksInput{} - } - - output = &DescribeMaintenanceWindowExecutionTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMaintenanceWindowExecutionTasks API operation for Amazon Simple Systems Manager (SSM). -// -// For a given Maintenance Window execution, lists the tasks that were executed. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeMaintenanceWindowExecutionTasks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTasks -func (c *SSM) DescribeMaintenanceWindowExecutionTasks(input *DescribeMaintenanceWindowExecutionTasksInput) (*DescribeMaintenanceWindowExecutionTasksOutput, error) { - req, out := c.DescribeMaintenanceWindowExecutionTasksRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMaintenanceWindowExecutions = "DescribeMaintenanceWindowExecutions" - -// DescribeMaintenanceWindowExecutionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMaintenanceWindowExecutions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMaintenanceWindowExecutions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMaintenanceWindowExecutions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMaintenanceWindowExecutionsRequest method. -// req, resp := client.DescribeMaintenanceWindowExecutionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutions -func (c *SSM) DescribeMaintenanceWindowExecutionsRequest(input *DescribeMaintenanceWindowExecutionsInput) (req *request.Request, output *DescribeMaintenanceWindowExecutionsOutput) { - op := &request.Operation{ - Name: opDescribeMaintenanceWindowExecutions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMaintenanceWindowExecutionsInput{} - } - - output = &DescribeMaintenanceWindowExecutionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMaintenanceWindowExecutions API operation for Amazon Simple Systems Manager (SSM). -// -// Lists the executions of a Maintenance Window (meaning, information about -// when the Maintenance Window was scheduled to be active and information about -// tasks registered and run with the Maintenance Window). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeMaintenanceWindowExecutions 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/ssm-2014-11-06/DescribeMaintenanceWindowExecutions -func (c *SSM) DescribeMaintenanceWindowExecutions(input *DescribeMaintenanceWindowExecutionsInput) (*DescribeMaintenanceWindowExecutionsOutput, error) { - req, out := c.DescribeMaintenanceWindowExecutionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMaintenanceWindowTargets = "DescribeMaintenanceWindowTargets" - -// DescribeMaintenanceWindowTargetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMaintenanceWindowTargets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMaintenanceWindowTargets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMaintenanceWindowTargets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMaintenanceWindowTargetsRequest method. -// req, resp := client.DescribeMaintenanceWindowTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTargets -func (c *SSM) DescribeMaintenanceWindowTargetsRequest(input *DescribeMaintenanceWindowTargetsInput) (req *request.Request, output *DescribeMaintenanceWindowTargetsOutput) { - op := &request.Operation{ - Name: opDescribeMaintenanceWindowTargets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMaintenanceWindowTargetsInput{} - } - - output = &DescribeMaintenanceWindowTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMaintenanceWindowTargets API operation for Amazon Simple Systems Manager (SSM). -// -// Lists the targets registered with the Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeMaintenanceWindowTargets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTargets -func (c *SSM) DescribeMaintenanceWindowTargets(input *DescribeMaintenanceWindowTargetsInput) (*DescribeMaintenanceWindowTargetsOutput, error) { - req, out := c.DescribeMaintenanceWindowTargetsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMaintenanceWindowTasks = "DescribeMaintenanceWindowTasks" - -// DescribeMaintenanceWindowTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMaintenanceWindowTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMaintenanceWindowTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMaintenanceWindowTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMaintenanceWindowTasksRequest method. -// req, resp := client.DescribeMaintenanceWindowTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTasks -func (c *SSM) DescribeMaintenanceWindowTasksRequest(input *DescribeMaintenanceWindowTasksInput) (req *request.Request, output *DescribeMaintenanceWindowTasksOutput) { - op := &request.Operation{ - Name: opDescribeMaintenanceWindowTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMaintenanceWindowTasksInput{} - } - - output = &DescribeMaintenanceWindowTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMaintenanceWindowTasks API operation for Amazon Simple Systems Manager (SSM). -// -// Lists the tasks in a Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribeMaintenanceWindowTasks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTasks -func (c *SSM) DescribeMaintenanceWindowTasks(input *DescribeMaintenanceWindowTasksInput) (*DescribeMaintenanceWindowTasksOutput, error) { - req, out := c.DescribeMaintenanceWindowTasksRequest(input) - err := req.Send() - return out, err -} - -const opDescribeMaintenanceWindows = "DescribeMaintenanceWindows" - -// DescribeMaintenanceWindowsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMaintenanceWindows operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMaintenanceWindows for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMaintenanceWindows method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMaintenanceWindowsRequest method. -// req, resp := client.DescribeMaintenanceWindowsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindows -func (c *SSM) DescribeMaintenanceWindowsRequest(input *DescribeMaintenanceWindowsInput) (req *request.Request, output *DescribeMaintenanceWindowsOutput) { - op := &request.Operation{ - Name: opDescribeMaintenanceWindows, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMaintenanceWindowsInput{} - } - - output = &DescribeMaintenanceWindowsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMaintenanceWindows API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the Maintenance Windows in an 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 Simple Systems Manager (SSM)'s -// API operation DescribeMaintenanceWindows 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/ssm-2014-11-06/DescribeMaintenanceWindows -func (c *SSM) DescribeMaintenanceWindows(input *DescribeMaintenanceWindowsInput) (*DescribeMaintenanceWindowsOutput, error) { - req, out := c.DescribeMaintenanceWindowsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeParameters = "DescribeParameters" - -// DescribeParametersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeParametersRequest method. -// req, resp := client.DescribeParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeParameters -func (c *SSM) DescribeParametersRequest(input *DescribeParametersInput) (req *request.Request, output *DescribeParametersOutput) { - op := &request.Operation{ - Name: opDescribeParameters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeParametersInput{} - } - - output = &DescribeParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeParameters API operation for Amazon Simple Systems Manager (SSM). -// -// Get information about a 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 Simple Systems Manager (SSM)'s -// API operation DescribeParameters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidFilterValue "InvalidFilterValue" -// The filter value is not valid. Verify the value and try again. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeParameters -func (c *SSM) DescribeParameters(input *DescribeParametersInput) (*DescribeParametersOutput, error) { - req, out := c.DescribeParametersRequest(input) - err := req.Send() - return out, err -} - -const opDescribePatchBaselines = "DescribePatchBaselines" - -// DescribePatchBaselinesRequest generates a "aws/request.Request" representing the -// client's request for the DescribePatchBaselines operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePatchBaselines for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePatchBaselines method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePatchBaselinesRequest method. -// req, resp := client.DescribePatchBaselinesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchBaselines -func (c *SSM) DescribePatchBaselinesRequest(input *DescribePatchBaselinesInput) (req *request.Request, output *DescribePatchBaselinesOutput) { - op := &request.Operation{ - Name: opDescribePatchBaselines, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePatchBaselinesInput{} - } - - output = &DescribePatchBaselinesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePatchBaselines API operation for Amazon Simple Systems Manager (SSM). -// -// Lists the patch baselines in your 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 Simple Systems Manager (SSM)'s -// API operation DescribePatchBaselines 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/ssm-2014-11-06/DescribePatchBaselines -func (c *SSM) DescribePatchBaselines(input *DescribePatchBaselinesInput) (*DescribePatchBaselinesOutput, error) { - req, out := c.DescribePatchBaselinesRequest(input) - err := req.Send() - return out, err -} - -const opDescribePatchGroupState = "DescribePatchGroupState" - -// DescribePatchGroupStateRequest generates a "aws/request.Request" representing the -// client's request for the DescribePatchGroupState operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePatchGroupState for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePatchGroupState method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePatchGroupStateRequest method. -// req, resp := client.DescribePatchGroupStateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupState -func (c *SSM) DescribePatchGroupStateRequest(input *DescribePatchGroupStateInput) (req *request.Request, output *DescribePatchGroupStateOutput) { - op := &request.Operation{ - Name: opDescribePatchGroupState, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePatchGroupStateInput{} - } - - output = &DescribePatchGroupStateOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePatchGroupState API operation for Amazon Simple Systems Manager (SSM). -// -// Returns high-level aggregated patch compliance state for a patch group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribePatchGroupState for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupState -func (c *SSM) DescribePatchGroupState(input *DescribePatchGroupStateInput) (*DescribePatchGroupStateOutput, error) { - req, out := c.DescribePatchGroupStateRequest(input) - err := req.Send() - return out, err -} - -const opDescribePatchGroups = "DescribePatchGroups" - -// DescribePatchGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePatchGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePatchGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePatchGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePatchGroupsRequest method. -// req, resp := client.DescribePatchGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroups -func (c *SSM) DescribePatchGroupsRequest(input *DescribePatchGroupsInput) (req *request.Request, output *DescribePatchGroupsOutput) { - op := &request.Operation{ - Name: opDescribePatchGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePatchGroupsInput{} - } - - output = &DescribePatchGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePatchGroups API operation for Amazon Simple Systems Manager (SSM). -// -// Lists all patch groups that have been registered with patch baselines. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation DescribePatchGroups 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/ssm-2014-11-06/DescribePatchGroups -func (c *SSM) DescribePatchGroups(input *DescribePatchGroupsInput) (*DescribePatchGroupsOutput, error) { - req, out := c.DescribePatchGroupsRequest(input) - err := req.Send() - return out, err -} - -const opGetAutomationExecution = "GetAutomationExecution" - -// GetAutomationExecutionRequest generates a "aws/request.Request" representing the -// client's request for the GetAutomationExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetAutomationExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetAutomationExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetAutomationExecutionRequest method. -// req, resp := client.GetAutomationExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetAutomationExecution -func (c *SSM) GetAutomationExecutionRequest(input *GetAutomationExecutionInput) (req *request.Request, output *GetAutomationExecutionOutput) { - op := &request.Operation{ - Name: opGetAutomationExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAutomationExecutionInput{} - } - - output = &GetAutomationExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAutomationExecution API operation for Amazon Simple Systems Manager (SSM). -// -// Get detailed information about a particular Automation execution. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetAutomationExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAutomationExecutionNotFoundException "AutomationExecutionNotFoundException" -// There is no automation execution information for the requested automation -// execution ID. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetAutomationExecution -func (c *SSM) GetAutomationExecution(input *GetAutomationExecutionInput) (*GetAutomationExecutionOutput, error) { - req, out := c.GetAutomationExecutionRequest(input) - err := req.Send() - return out, err -} - -const opGetCommandInvocation = "GetCommandInvocation" - -// GetCommandInvocationRequest generates a "aws/request.Request" representing the -// client's request for the GetCommandInvocation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetCommandInvocation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetCommandInvocation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetCommandInvocationRequest method. -// req, resp := client.GetCommandInvocationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetCommandInvocation -func (c *SSM) GetCommandInvocationRequest(input *GetCommandInvocationInput) (req *request.Request, output *GetCommandInvocationOutput) { - op := &request.Operation{ - Name: opGetCommandInvocation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCommandInvocationInput{} - } - - output = &GetCommandInvocationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCommandInvocation API operation for Amazon Simple Systems Manager (SSM). -// -// Returns detailed information about command execution for an invocation or -// plugin. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetCommandInvocation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidCommandId "InvalidCommandId" -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidPluginName "InvalidPluginName" -// The plugin name is not valid. -// -// * ErrCodeInvocationDoesNotExist "InvocationDoesNotExist" -// The command ID and instance ID you specified did not match any invocations. -// Verify the command ID adn the instance ID and try again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetCommandInvocation -func (c *SSM) GetCommandInvocation(input *GetCommandInvocationInput) (*GetCommandInvocationOutput, error) { - req, out := c.GetCommandInvocationRequest(input) - err := req.Send() - return out, err -} - -const opGetDefaultPatchBaseline = "GetDefaultPatchBaseline" - -// GetDefaultPatchBaselineRequest generates a "aws/request.Request" representing the -// client's request for the GetDefaultPatchBaseline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDefaultPatchBaseline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDefaultPatchBaseline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDefaultPatchBaselineRequest method. -// req, resp := client.GetDefaultPatchBaselineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDefaultPatchBaseline -func (c *SSM) GetDefaultPatchBaselineRequest(input *GetDefaultPatchBaselineInput) (req *request.Request, output *GetDefaultPatchBaselineOutput) { - op := &request.Operation{ - Name: opGetDefaultPatchBaseline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDefaultPatchBaselineInput{} - } - - output = &GetDefaultPatchBaselineOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDefaultPatchBaseline API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the default patch baseline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetDefaultPatchBaseline 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/ssm-2014-11-06/GetDefaultPatchBaseline -func (c *SSM) GetDefaultPatchBaseline(input *GetDefaultPatchBaselineInput) (*GetDefaultPatchBaselineOutput, error) { - req, out := c.GetDefaultPatchBaselineRequest(input) - err := req.Send() - return out, err -} - -const opGetDeployablePatchSnapshotForInstance = "GetDeployablePatchSnapshotForInstance" - -// GetDeployablePatchSnapshotForInstanceRequest generates a "aws/request.Request" representing the -// client's request for the GetDeployablePatchSnapshotForInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDeployablePatchSnapshotForInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDeployablePatchSnapshotForInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDeployablePatchSnapshotForInstanceRequest method. -// req, resp := client.GetDeployablePatchSnapshotForInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDeployablePatchSnapshotForInstance -func (c *SSM) GetDeployablePatchSnapshotForInstanceRequest(input *GetDeployablePatchSnapshotForInstanceInput) (req *request.Request, output *GetDeployablePatchSnapshotForInstanceOutput) { - op := &request.Operation{ - Name: opGetDeployablePatchSnapshotForInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDeployablePatchSnapshotForInstanceInput{} - } - - output = &GetDeployablePatchSnapshotForInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeployablePatchSnapshotForInstance API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the current snapshot for the patch baseline the instance uses. -// This API is primarily used by the AWS-ApplyPatchBaseline Systems Manager -// document. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetDeployablePatchSnapshotForInstance 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/ssm-2014-11-06/GetDeployablePatchSnapshotForInstance -func (c *SSM) GetDeployablePatchSnapshotForInstance(input *GetDeployablePatchSnapshotForInstanceInput) (*GetDeployablePatchSnapshotForInstanceOutput, error) { - req, out := c.GetDeployablePatchSnapshotForInstanceRequest(input) - err := req.Send() - return out, err -} - -const opGetDocument = "GetDocument" - -// GetDocumentRequest generates a "aws/request.Request" representing the -// client's request for the GetDocument operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDocument for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDocument method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDocumentRequest method. -// req, resp := client.GetDocumentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDocument -func (c *SSM) GetDocumentRequest(input *GetDocumentInput) (req *request.Request, output *GetDocumentOutput) { - op := &request.Operation{ - Name: opGetDocument, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDocumentInput{} - } - - output = &GetDocumentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDocument API operation for Amazon Simple Systems Manager (SSM). -// -// Gets the contents of the specified SSM document. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetDocument for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" -// The document version is not valid or does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDocument -func (c *SSM) GetDocument(input *GetDocumentInput) (*GetDocumentOutput, error) { - req, out := c.GetDocumentRequest(input) - err := req.Send() - return out, err -} - -const opGetInventory = "GetInventory" - -// GetInventoryRequest generates a "aws/request.Request" representing the -// client's request for the GetInventory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInventory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInventory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInventoryRequest method. -// req, resp := client.GetInventoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventory -func (c *SSM) GetInventoryRequest(input *GetInventoryInput) (req *request.Request, output *GetInventoryOutput) { - op := &request.Operation{ - Name: opGetInventory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInventoryInput{} - } - - output = &GetInventoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInventory API operation for Amazon Simple Systems Manager (SSM). -// -// Query inventory information. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetInventory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidFilter "InvalidFilter" -// The filter name is not valid. Verify the you entered the correct name and -// try again. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" -// The parameter type name is not valid. -// -// * ErrCodeInvalidResultAttributeException "InvalidResultAttributeException" -// The specified inventory item result attribute is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventory -func (c *SSM) GetInventory(input *GetInventoryInput) (*GetInventoryOutput, error) { - req, out := c.GetInventoryRequest(input) - err := req.Send() - return out, err -} - -const opGetInventorySchema = "GetInventorySchema" - -// GetInventorySchemaRequest generates a "aws/request.Request" representing the -// client's request for the GetInventorySchema operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInventorySchema for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInventorySchema method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInventorySchemaRequest method. -// req, resp := client.GetInventorySchemaRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventorySchema -func (c *SSM) GetInventorySchemaRequest(input *GetInventorySchemaInput) (req *request.Request, output *GetInventorySchemaOutput) { - op := &request.Operation{ - Name: opGetInventorySchema, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInventorySchemaInput{} - } - - output = &GetInventorySchemaOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInventorySchema API operation for Amazon Simple Systems Manager (SSM). -// -// Return a list of inventory type names for the account, or return a list of -// attribute names for a specific Inventory item 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 Simple Systems Manager (SSM)'s -// API operation GetInventorySchema for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" -// The parameter type name is not valid. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventorySchema -func (c *SSM) GetInventorySchema(input *GetInventorySchemaInput) (*GetInventorySchemaOutput, error) { - req, out := c.GetInventorySchemaRequest(input) - err := req.Send() - return out, err -} - -const opGetMaintenanceWindow = "GetMaintenanceWindow" - -// GetMaintenanceWindowRequest generates a "aws/request.Request" representing the -// client's request for the GetMaintenanceWindow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetMaintenanceWindow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetMaintenanceWindow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetMaintenanceWindowRequest method. -// req, resp := client.GetMaintenanceWindowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindow -func (c *SSM) GetMaintenanceWindowRequest(input *GetMaintenanceWindowInput) (req *request.Request, output *GetMaintenanceWindowOutput) { - op := &request.Operation{ - Name: opGetMaintenanceWindow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetMaintenanceWindowInput{} - } - - output = &GetMaintenanceWindowOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMaintenanceWindow API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves a Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetMaintenanceWindow for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindow -func (c *SSM) GetMaintenanceWindow(input *GetMaintenanceWindowInput) (*GetMaintenanceWindowOutput, error) { - req, out := c.GetMaintenanceWindowRequest(input) - err := req.Send() - return out, err -} - -const opGetMaintenanceWindowExecution = "GetMaintenanceWindowExecution" - -// GetMaintenanceWindowExecutionRequest generates a "aws/request.Request" representing the -// client's request for the GetMaintenanceWindowExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetMaintenanceWindowExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetMaintenanceWindowExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetMaintenanceWindowExecutionRequest method. -// req, resp := client.GetMaintenanceWindowExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecution -func (c *SSM) GetMaintenanceWindowExecutionRequest(input *GetMaintenanceWindowExecutionInput) (req *request.Request, output *GetMaintenanceWindowExecutionOutput) { - op := &request.Operation{ - Name: opGetMaintenanceWindowExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetMaintenanceWindowExecutionInput{} - } - - output = &GetMaintenanceWindowExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMaintenanceWindowExecution API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves details about a specific task executed as part of a Maintenance -// Window execution. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetMaintenanceWindowExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecution -func (c *SSM) GetMaintenanceWindowExecution(input *GetMaintenanceWindowExecutionInput) (*GetMaintenanceWindowExecutionOutput, error) { - req, out := c.GetMaintenanceWindowExecutionRequest(input) - err := req.Send() - return out, err -} - -const opGetMaintenanceWindowExecutionTask = "GetMaintenanceWindowExecutionTask" - -// GetMaintenanceWindowExecutionTaskRequest generates a "aws/request.Request" representing the -// client's request for the GetMaintenanceWindowExecutionTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetMaintenanceWindowExecutionTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetMaintenanceWindowExecutionTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetMaintenanceWindowExecutionTaskRequest method. -// req, resp := client.GetMaintenanceWindowExecutionTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTask -func (c *SSM) GetMaintenanceWindowExecutionTaskRequest(input *GetMaintenanceWindowExecutionTaskInput) (req *request.Request, output *GetMaintenanceWindowExecutionTaskOutput) { - op := &request.Operation{ - Name: opGetMaintenanceWindowExecutionTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetMaintenanceWindowExecutionTaskInput{} - } - - output = &GetMaintenanceWindowExecutionTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMaintenanceWindowExecutionTask API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the details about a specific task executed as part of a Maintenance -// Window execution. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetMaintenanceWindowExecutionTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTask -func (c *SSM) GetMaintenanceWindowExecutionTask(input *GetMaintenanceWindowExecutionTaskInput) (*GetMaintenanceWindowExecutionTaskOutput, error) { - req, out := c.GetMaintenanceWindowExecutionTaskRequest(input) - err := req.Send() - return out, err -} - -const opGetParameterHistory = "GetParameterHistory" - -// GetParameterHistoryRequest generates a "aws/request.Request" representing the -// client's request for the GetParameterHistory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetParameterHistory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetParameterHistory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetParameterHistoryRequest method. -// req, resp := client.GetParameterHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameterHistory -func (c *SSM) GetParameterHistoryRequest(input *GetParameterHistoryInput) (req *request.Request, output *GetParameterHistoryOutput) { - op := &request.Operation{ - Name: opGetParameterHistory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetParameterHistoryInput{} - } - - output = &GetParameterHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetParameterHistory API operation for Amazon Simple Systems Manager (SSM). -// -// Query a list of all parameters used by the 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 Simple Systems Manager (SSM)'s -// API operation GetParameterHistory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeParameterNotFound "ParameterNotFound" -// The parameter could not be found. Verify the name and try again. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameterHistory -func (c *SSM) GetParameterHistory(input *GetParameterHistoryInput) (*GetParameterHistoryOutput, error) { - req, out := c.GetParameterHistoryRequest(input) - err := req.Send() - return out, err -} - -const opGetParameters = "GetParameters" - -// GetParametersRequest generates a "aws/request.Request" representing the -// client's request for the GetParameters operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetParameters for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetParameters method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetParametersRequest method. -// req, resp := client.GetParametersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameters -func (c *SSM) GetParametersRequest(input *GetParametersInput) (req *request.Request, output *GetParametersOutput) { - op := &request.Operation{ - Name: opGetParameters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetParametersInput{} - } - - output = &GetParametersOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetParameters API operation for Amazon Simple Systems Manager (SSM). -// -// Get a list of parameters used by the 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 Simple Systems Manager (SSM)'s -// API operation GetParameters 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/ssm-2014-11-06/GetParameters -func (c *SSM) GetParameters(input *GetParametersInput) (*GetParametersOutput, error) { - req, out := c.GetParametersRequest(input) - err := req.Send() - return out, err -} - -const opGetPatchBaseline = "GetPatchBaseline" - -// GetPatchBaselineRequest generates a "aws/request.Request" representing the -// client's request for the GetPatchBaseline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPatchBaseline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPatchBaseline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPatchBaselineRequest method. -// req, resp := client.GetPatchBaselineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaseline -func (c *SSM) GetPatchBaselineRequest(input *GetPatchBaselineInput) (req *request.Request, output *GetPatchBaselineOutput) { - op := &request.Operation{ - Name: opGetPatchBaseline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPatchBaselineInput{} - } - - output = &GetPatchBaselineOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPatchBaseline API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves information about a patch baseline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetPatchBaseline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInvalidResourceId "InvalidResourceId" -// The resource ID is not valid. Verify that you entered the correct ID and -// try again. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaseline -func (c *SSM) GetPatchBaseline(input *GetPatchBaselineInput) (*GetPatchBaselineOutput, error) { - req, out := c.GetPatchBaselineRequest(input) - err := req.Send() - return out, err -} - -const opGetPatchBaselineForPatchGroup = "GetPatchBaselineForPatchGroup" - -// GetPatchBaselineForPatchGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetPatchBaselineForPatchGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPatchBaselineForPatchGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPatchBaselineForPatchGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPatchBaselineForPatchGroupRequest method. -// req, resp := client.GetPatchBaselineForPatchGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaselineForPatchGroup -func (c *SSM) GetPatchBaselineForPatchGroupRequest(input *GetPatchBaselineForPatchGroupInput) (req *request.Request, output *GetPatchBaselineForPatchGroupOutput) { - op := &request.Operation{ - Name: opGetPatchBaselineForPatchGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPatchBaselineForPatchGroupInput{} - } - - output = &GetPatchBaselineForPatchGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPatchBaselineForPatchGroup API operation for Amazon Simple Systems Manager (SSM). -// -// Retrieves the patch baseline that should be used for the specified patch -// group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation GetPatchBaselineForPatchGroup 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/ssm-2014-11-06/GetPatchBaselineForPatchGroup -func (c *SSM) GetPatchBaselineForPatchGroup(input *GetPatchBaselineForPatchGroupInput) (*GetPatchBaselineForPatchGroupOutput, error) { - req, out := c.GetPatchBaselineForPatchGroupRequest(input) - err := req.Send() - return out, err -} - -const opListAssociations = "ListAssociations" - -// ListAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the ListAssociations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListAssociations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListAssociations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListAssociationsRequest method. -// req, resp := client.ListAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociations -func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *request.Request, output *ListAssociationsOutput) { - op := &request.Operation{ - Name: opListAssociations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAssociationsInput{} - } - - output = &ListAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssociations API operation for Amazon Simple Systems Manager (SSM). -// -// Lists the associations for the specified SSM document or 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 Simple Systems Manager (SSM)'s -// API operation ListAssociations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociations -func (c *SSM) ListAssociations(input *ListAssociationsInput) (*ListAssociationsOutput, error) { - req, out := c.ListAssociationsRequest(input) - err := req.Send() - return out, err -} - -// ListAssociationsPages iterates over the pages of a ListAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssociations 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 ListAssociations operation. -// pageNum := 0 -// err := client.ListAssociationsPages(params, -// func(page *ListAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) ListAssociationsPages(input *ListAssociationsInput, fn func(p *ListAssociationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListAssociationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListAssociationsOutput), lastPage) - }) -} - -const opListCommandInvocations = "ListCommandInvocations" - -// ListCommandInvocationsRequest generates a "aws/request.Request" representing the -// client's request for the ListCommandInvocations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListCommandInvocations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListCommandInvocations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListCommandInvocationsRequest method. -// req, resp := client.ListCommandInvocationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandInvocations -func (c *SSM) ListCommandInvocationsRequest(input *ListCommandInvocationsInput) (req *request.Request, output *ListCommandInvocationsOutput) { - op := &request.Operation{ - Name: opListCommandInvocations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCommandInvocationsInput{} - } - - output = &ListCommandInvocationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCommandInvocations API operation for Amazon Simple Systems Manager (SSM). -// -// An invocation is copy of a command sent to a specific instance. A command -// can apply to one or more instances. A command invocation applies to one instance. -// For example, if a user executes SendCommand against three instances, then -// a command invocation is created for each requested instance ID. ListCommandInvocations -// provide status about command execution. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation ListCommandInvocations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidCommandId "InvalidCommandId" -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidFilterKey "InvalidFilterKey" -// The specified key is not valid. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandInvocations -func (c *SSM) ListCommandInvocations(input *ListCommandInvocationsInput) (*ListCommandInvocationsOutput, error) { - req, out := c.ListCommandInvocationsRequest(input) - err := req.Send() - return out, err -} - -// ListCommandInvocationsPages iterates over the pages of a ListCommandInvocations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCommandInvocations 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 ListCommandInvocations operation. -// pageNum := 0 -// err := client.ListCommandInvocationsPages(params, -// func(page *ListCommandInvocationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) ListCommandInvocationsPages(input *ListCommandInvocationsInput, fn func(p *ListCommandInvocationsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListCommandInvocationsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListCommandInvocationsOutput), lastPage) - }) -} - -const opListCommands = "ListCommands" - -// ListCommandsRequest generates a "aws/request.Request" representing the -// client's request for the ListCommands operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListCommands for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListCommands method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListCommandsRequest method. -// req, resp := client.ListCommandsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommands -func (c *SSM) ListCommandsRequest(input *ListCommandsInput) (req *request.Request, output *ListCommandsOutput) { - op := &request.Operation{ - Name: opListCommands, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCommandsInput{} - } - - output = &ListCommandsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCommands API operation for Amazon Simple Systems Manager (SSM). -// -// Lists the commands requested by users of the 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 Simple Systems Manager (SSM)'s -// API operation ListCommands for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidCommandId "InvalidCommandId" -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidFilterKey "InvalidFilterKey" -// The specified key is not valid. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommands -func (c *SSM) ListCommands(input *ListCommandsInput) (*ListCommandsOutput, error) { - req, out := c.ListCommandsRequest(input) - err := req.Send() - return out, err -} - -// ListCommandsPages iterates over the pages of a ListCommands operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCommands 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 ListCommands operation. -// pageNum := 0 -// err := client.ListCommandsPages(params, -// func(page *ListCommandsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) ListCommandsPages(input *ListCommandsInput, fn func(p *ListCommandsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListCommandsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListCommandsOutput), lastPage) - }) -} - -const opListDocumentVersions = "ListDocumentVersions" - -// ListDocumentVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListDocumentVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDocumentVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDocumentVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDocumentVersionsRequest method. -// req, resp := client.ListDocumentVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentVersions -func (c *SSM) ListDocumentVersionsRequest(input *ListDocumentVersionsInput) (req *request.Request, output *ListDocumentVersionsOutput) { - op := &request.Operation{ - Name: opListDocumentVersions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListDocumentVersionsInput{} - } - - output = &ListDocumentVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDocumentVersions API operation for Amazon Simple Systems Manager (SSM). -// -// List all versions for a document. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation ListDocumentVersions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentVersions -func (c *SSM) ListDocumentVersions(input *ListDocumentVersionsInput) (*ListDocumentVersionsOutput, error) { - req, out := c.ListDocumentVersionsRequest(input) - err := req.Send() - return out, err -} - -const opListDocuments = "ListDocuments" - -// ListDocumentsRequest generates a "aws/request.Request" representing the -// client's request for the ListDocuments operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDocuments for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDocuments method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDocumentsRequest method. -// req, resp := client.ListDocumentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocuments -func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) (req *request.Request, output *ListDocumentsOutput) { - op := &request.Operation{ - Name: opListDocuments, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDocumentsInput{} - } - - output = &ListDocumentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDocuments API operation for Amazon Simple Systems Manager (SSM). -// -// Describes one or more of your SSM documents. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation ListDocuments for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// * ErrCodeInvalidFilterKey "InvalidFilterKey" -// The specified key is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocuments -func (c *SSM) ListDocuments(input *ListDocumentsInput) (*ListDocumentsOutput, error) { - req, out := c.ListDocumentsRequest(input) - err := req.Send() - return out, err -} - -// ListDocumentsPages iterates over the pages of a ListDocuments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDocuments 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 ListDocuments operation. -// pageNum := 0 -// err := client.ListDocumentsPages(params, -// func(page *ListDocumentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSM) ListDocumentsPages(input *ListDocumentsInput, fn func(p *ListDocumentsOutput, lastPage bool) (shouldContinue bool)) error { - page, _ := c.ListDocumentsRequest(input) - page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) - return page.EachPage(func(p interface{}, lastPage bool) bool { - return fn(p.(*ListDocumentsOutput), lastPage) - }) -} - -const opListInventoryEntries = "ListInventoryEntries" - -// ListInventoryEntriesRequest generates a "aws/request.Request" representing the -// client's request for the ListInventoryEntries operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListInventoryEntries for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListInventoryEntries method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListInventoryEntriesRequest method. -// req, resp := client.ListInventoryEntriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListInventoryEntries -func (c *SSM) ListInventoryEntriesRequest(input *ListInventoryEntriesInput) (req *request.Request, output *ListInventoryEntriesOutput) { - op := &request.Operation{ - Name: opListInventoryEntries, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListInventoryEntriesInput{} - } - - output = &ListInventoryEntriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListInventoryEntries API operation for Amazon Simple Systems Manager (SSM). -// -// A list of inventory items returned by 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 Systems Manager (SSM)'s -// API operation ListInventoryEntries for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" -// The parameter type name is not valid. -// -// * ErrCodeInvalidFilter "InvalidFilter" -// The filter name is not valid. Verify the you entered the correct name and -// try again. -// -// * ErrCodeInvalidNextToken "InvalidNextToken" -// The specified token is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListInventoryEntries -func (c *SSM) ListInventoryEntries(input *ListInventoryEntriesInput) (*ListInventoryEntriesOutput, error) { - req, out := c.ListInventoryEntriesRequest(input) - err := req.Send() - return out, err -} - -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/ssm-2014-11-06/ListTagsForResource -func (c *SSM) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Simple Systems Manager (SSM). -// -// Returns a list of the tags assigned to the specified 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 Simple Systems Manager (SSM)'s -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceType "InvalidResourceType" -// The resource type is not valid. If you are attempting to tag an instance, -// the instance must be a registered, managed instance. -// -// * ErrCodeInvalidResourceId "InvalidResourceId" -// The resource ID is not valid. Verify that you entered the correct ID and -// try again. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListTagsForResource -func (c *SSM) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - err := req.Send() - return out, err -} - -const opModifyDocumentPermission = "ModifyDocumentPermission" - -// ModifyDocumentPermissionRequest generates a "aws/request.Request" representing the -// client's request for the ModifyDocumentPermission operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyDocumentPermission for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyDocumentPermission method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyDocumentPermissionRequest method. -// req, resp := client.ModifyDocumentPermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ModifyDocumentPermission -func (c *SSM) ModifyDocumentPermissionRequest(input *ModifyDocumentPermissionInput) (req *request.Request, output *ModifyDocumentPermissionOutput) { - op := &request.Operation{ - Name: opModifyDocumentPermission, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDocumentPermissionInput{} - } - - output = &ModifyDocumentPermissionOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyDocumentPermission API operation for Amazon Simple Systems Manager (SSM). -// -// Share a document publicly or privately. If you share a document privately, -// you must specify the AWS user account IDs for those people who can use the -// document. If you share a document publicly, you must specify All as the account -// 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 Systems Manager (SSM)'s -// API operation ModifyDocumentPermission for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidPermissionType "InvalidPermissionType" -// The permission type is not supported. Share is the only supported permission -// type. -// -// * ErrCodeDocumentPermissionLimit "DocumentPermissionLimit" -// The document cannot be shared with more AWS user accounts. You can share -// a document with a maximum of 20 accounts. You can publicly share up to five -// documents. If you need to increase this limit, contact AWS Support. -// -// * ErrCodeDocumentLimitExceeded "DocumentLimitExceeded" -// You can have at most 200 active SSM documents. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ModifyDocumentPermission -func (c *SSM) ModifyDocumentPermission(input *ModifyDocumentPermissionInput) (*ModifyDocumentPermissionOutput, error) { - req, out := c.ModifyDocumentPermissionRequest(input) - err := req.Send() - return out, err -} - -const opPutInventory = "PutInventory" - -// PutInventoryRequest generates a "aws/request.Request" representing the -// client's request for the PutInventory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutInventory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutInventory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutInventoryRequest method. -// req, resp := client.PutInventoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutInventory -func (c *SSM) PutInventoryRequest(input *PutInventoryInput) (req *request.Request, output *PutInventoryOutput) { - op := &request.Operation{ - Name: opPutInventory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutInventoryInput{} - } - - output = &PutInventoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutInventory API operation for Amazon Simple Systems Manager (SSM). -// -// Bulk update custom inventory items on one more instance. The request adds -// an inventory item, if it doesn't already exist, or updates an inventory item, -// if it does 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 Amazon Simple Systems Manager (SSM)'s -// API operation PutInventory for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" -// The parameter type name is not valid. -// -// * ErrCodeInvalidItemContentException "InvalidItemContentException" -// One or more content items is not valid. -// -// * ErrCodeTotalSizeLimitExceededException "TotalSizeLimitExceededException" -// The size of inventory data has exceeded the total size limit for the resource. -// -// * ErrCodeItemSizeLimitExceededException "ItemSizeLimitExceededException" -// The inventory item size has exceeded the size limit. -// -// * ErrCodeItemContentMismatchException "ItemContentMismatchException" -// The inventory item has invalid content. -// -// * ErrCodeCustomSchemaCountLimitExceededException "CustomSchemaCountLimitExceededException" -// You have exceeded the limit for custom schemas. Delete one or more custom -// schemas and try again. -// -// * ErrCodeUnsupportedInventorySchemaVersionException "UnsupportedInventorySchemaVersionException" -// Inventory item type schema version has to match supported versions in the -// service. Check output of GetInventorySchema to see the available schema version -// for each type. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutInventory -func (c *SSM) PutInventory(input *PutInventoryInput) (*PutInventoryOutput, error) { - req, out := c.PutInventoryRequest(input) - err := req.Send() - return out, err -} - -const opPutParameter = "PutParameter" - -// PutParameterRequest generates a "aws/request.Request" representing the -// client's request for the PutParameter operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutParameter for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutParameter method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutParameterRequest method. -// req, resp := client.PutParameterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutParameter -func (c *SSM) PutParameterRequest(input *PutParameterInput) (req *request.Request, output *PutParameterOutput) { - op := &request.Operation{ - Name: opPutParameter, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutParameterInput{} - } - - output = &PutParameterOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutParameter API operation for Amazon Simple Systems Manager (SSM). -// -// Add one or more paramaters to the system. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation PutParameter for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidKeyId "InvalidKeyId" -// The query key ID is not valid. -// -// * ErrCodeParameterLimitExceeded "ParameterLimitExceeded" -// You have exceeded the number of parameters for this AWS account. Delete one -// or more parameters and try again. -// -// * ErrCodeTooManyUpdates "TooManyUpdates" -// There are concurrent updates for a resource that supports one update at a -// time. -// -// * ErrCodeParameterAlreadyExists "ParameterAlreadyExists" -// The parameter already exists. You can't create duplicate parameters. -// -// * ErrCodeUnsupportedParameterType "UnsupportedParameterType" -// The parameter type is not supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutParameter -func (c *SSM) PutParameter(input *PutParameterInput) (*PutParameterOutput, error) { - req, out := c.PutParameterRequest(input) - err := req.Send() - return out, err -} - -const opRegisterDefaultPatchBaseline = "RegisterDefaultPatchBaseline" - -// RegisterDefaultPatchBaselineRequest generates a "aws/request.Request" representing the -// client's request for the RegisterDefaultPatchBaseline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterDefaultPatchBaseline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterDefaultPatchBaseline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterDefaultPatchBaselineRequest method. -// req, resp := client.RegisterDefaultPatchBaselineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterDefaultPatchBaseline -func (c *SSM) RegisterDefaultPatchBaselineRequest(input *RegisterDefaultPatchBaselineInput) (req *request.Request, output *RegisterDefaultPatchBaselineOutput) { - op := &request.Operation{ - Name: opRegisterDefaultPatchBaseline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterDefaultPatchBaselineInput{} - } - - output = &RegisterDefaultPatchBaselineOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterDefaultPatchBaseline API operation for Amazon Simple Systems Manager (SSM). -// -// Defines the default patch baseline. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation RegisterDefaultPatchBaseline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceId "InvalidResourceId" -// The resource ID is not valid. Verify that you entered the correct ID and -// try again. -// -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterDefaultPatchBaseline -func (c *SSM) RegisterDefaultPatchBaseline(input *RegisterDefaultPatchBaselineInput) (*RegisterDefaultPatchBaselineOutput, error) { - req, out := c.RegisterDefaultPatchBaselineRequest(input) - err := req.Send() - return out, err -} - -const opRegisterPatchBaselineForPatchGroup = "RegisterPatchBaselineForPatchGroup" - -// RegisterPatchBaselineForPatchGroupRequest generates a "aws/request.Request" representing the -// client's request for the RegisterPatchBaselineForPatchGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterPatchBaselineForPatchGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterPatchBaselineForPatchGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterPatchBaselineForPatchGroupRequest method. -// req, resp := client.RegisterPatchBaselineForPatchGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterPatchBaselineForPatchGroup -func (c *SSM) RegisterPatchBaselineForPatchGroupRequest(input *RegisterPatchBaselineForPatchGroupInput) (req *request.Request, output *RegisterPatchBaselineForPatchGroupOutput) { - op := &request.Operation{ - Name: opRegisterPatchBaselineForPatchGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterPatchBaselineForPatchGroupInput{} - } - - output = &RegisterPatchBaselineForPatchGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterPatchBaselineForPatchGroup API operation for Amazon Simple Systems Manager (SSM). -// -// Registers a patch baseline for a patch group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation RegisterPatchBaselineForPatchGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" -// Error returned if an attempt is made to register a patch group with a patch -// baseline that is already registered with a different patch baseline. -// -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInvalidResourceId "InvalidResourceId" -// The resource ID is not valid. Verify that you entered the correct ID and -// try again. -// -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" -// Error returned when the caller has exceeded the default resource limits (e.g. -// too many Maintenance Windows have been created). -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterPatchBaselineForPatchGroup -func (c *SSM) RegisterPatchBaselineForPatchGroup(input *RegisterPatchBaselineForPatchGroupInput) (*RegisterPatchBaselineForPatchGroupOutput, error) { - req, out := c.RegisterPatchBaselineForPatchGroupRequest(input) - err := req.Send() - return out, err -} - -const opRegisterTargetWithMaintenanceWindow = "RegisterTargetWithMaintenanceWindow" - -// RegisterTargetWithMaintenanceWindowRequest generates a "aws/request.Request" representing the -// client's request for the RegisterTargetWithMaintenanceWindow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterTargetWithMaintenanceWindow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterTargetWithMaintenanceWindow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterTargetWithMaintenanceWindowRequest method. -// req, resp := client.RegisterTargetWithMaintenanceWindowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTargetWithMaintenanceWindow -func (c *SSM) RegisterTargetWithMaintenanceWindowRequest(input *RegisterTargetWithMaintenanceWindowInput) (req *request.Request, output *RegisterTargetWithMaintenanceWindowOutput) { - op := &request.Operation{ - Name: opRegisterTargetWithMaintenanceWindow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterTargetWithMaintenanceWindowInput{} - } - - output = &RegisterTargetWithMaintenanceWindowOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterTargetWithMaintenanceWindow API operation for Amazon Simple Systems Manager (SSM). -// -// Registers a target with a Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation RegisterTargetWithMaintenanceWindow for usage and error information. -// -// Returned Error Codes: -// * ErrCodeIdempotentParameterMismatch "IdempotentParameterMismatch" -// Error returned when an idempotent operation is retried and the parameters -// don’t match the original call to the API with the same idempotency token. -// -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" -// Error returned when the caller has exceeded the default resource limits (e.g. -// too many Maintenance Windows have been created). -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTargetWithMaintenanceWindow -func (c *SSM) RegisterTargetWithMaintenanceWindow(input *RegisterTargetWithMaintenanceWindowInput) (*RegisterTargetWithMaintenanceWindowOutput, error) { - req, out := c.RegisterTargetWithMaintenanceWindowRequest(input) - err := req.Send() - return out, err -} - -const opRegisterTaskWithMaintenanceWindow = "RegisterTaskWithMaintenanceWindow" - -// RegisterTaskWithMaintenanceWindowRequest generates a "aws/request.Request" representing the -// client's request for the RegisterTaskWithMaintenanceWindow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterTaskWithMaintenanceWindow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterTaskWithMaintenanceWindow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterTaskWithMaintenanceWindowRequest method. -// req, resp := client.RegisterTaskWithMaintenanceWindowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTaskWithMaintenanceWindow -func (c *SSM) RegisterTaskWithMaintenanceWindowRequest(input *RegisterTaskWithMaintenanceWindowInput) (req *request.Request, output *RegisterTaskWithMaintenanceWindowOutput) { - op := &request.Operation{ - Name: opRegisterTaskWithMaintenanceWindow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterTaskWithMaintenanceWindowInput{} - } - - output = &RegisterTaskWithMaintenanceWindowOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterTaskWithMaintenanceWindow API operation for Amazon Simple Systems Manager (SSM). -// -// Adds a new task to a Maintenance Window. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation RegisterTaskWithMaintenanceWindow for usage and error information. -// -// Returned Error Codes: -// * ErrCodeIdempotentParameterMismatch "IdempotentParameterMismatch" -// Error returned when an idempotent operation is retried and the parameters -// don’t match the original call to the API with the same idempotency token. -// -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" -// Error returned when the caller has exceeded the default resource limits (e.g. -// too many Maintenance Windows have been created). -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTaskWithMaintenanceWindow -func (c *SSM) RegisterTaskWithMaintenanceWindow(input *RegisterTaskWithMaintenanceWindowInput) (*RegisterTaskWithMaintenanceWindowOutput, error) { - req, out := c.RegisterTaskWithMaintenanceWindowRequest(input) - err := req.Send() - return out, err -} - -const opRemoveTagsFromResource = "RemoveTagsFromResource" - -// RemoveTagsFromResourceRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromResourceRequest method. -// req, resp := client.RemoveTagsFromResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RemoveTagsFromResource -func (c *SSM) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) (req *request.Request, output *RemoveTagsFromResourceOutput) { - op := &request.Operation{ - Name: opRemoveTagsFromResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsFromResourceInput{} - } - - output = &RemoveTagsFromResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// RemoveTagsFromResource API operation for Amazon Simple Systems Manager (SSM). -// -// Removes all tags from the specified 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 Simple Systems Manager (SSM)'s -// API operation RemoveTagsFromResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidResourceType "InvalidResourceType" -// The resource type is not valid. If you are attempting to tag an instance, -// the instance must be a registered, managed instance. -// -// * ErrCodeInvalidResourceId "InvalidResourceId" -// The resource ID is not valid. Verify that you entered the correct ID and -// try again. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RemoveTagsFromResource -func (c *SSM) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { - req, out := c.RemoveTagsFromResourceRequest(input) - err := req.Send() - return out, err -} - -const opSendCommand = "SendCommand" - -// SendCommandRequest generates a "aws/request.Request" representing the -// client's request for the SendCommand operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendCommand for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendCommand method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendCommandRequest method. -// req, resp := client.SendCommandRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/SendCommand -func (c *SSM) SendCommandRequest(input *SendCommandInput) (req *request.Request, output *SendCommandOutput) { - op := &request.Operation{ - Name: opSendCommand, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendCommandInput{} - } - - output = &SendCommandOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendCommand API operation for Amazon Simple Systems Manager (SSM). -// -// Executes commands on one or more remote 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 Simple Systems Manager (SSM)'s -// API operation SendCommand for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDuplicateInstanceId "DuplicateInstanceId" -// You cannot specify an instance ID in more than one association. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidOutputFolder "InvalidOutputFolder" -// The S3 bucket does not exist. -// -// * ErrCodeInvalidParameters "InvalidParameters" -// You must specify values for all required parameters in the SSM document. -// You can only supply values to parameters defined in the SSM document. -// -// * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" -// The document does not support the platform type of the given instance ID(s). -// For example, you sent an SSM document for a Windows instance to a Linux instance. -// -// * ErrCodeMaxDocumentSizeExceeded "MaxDocumentSizeExceeded" -// The size limit of an SSM document is 64 KB. -// -// * ErrCodeInvalidRole "InvalidRole" -// The role name can't contain invalid characters. Also verify that you specified -// an IAM role for notifications that includes the required trust policy. For -// information about configuring the IAM role for Run Command notifications, -// see Getting Amazon SNS Notifications When a Command Changes Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/rc-sns.html) -// in the Amazon Elastic Compute Cloud User Guide . -// -// * ErrCodeInvalidNotificationConfig "InvalidNotificationConfig" -// One or more configuration items is not valid. Verify that a valid Amazon -// Resource Name (ARN) was provided for an Amazon SNS topic. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/SendCommand -func (c *SSM) SendCommand(input *SendCommandInput) (*SendCommandOutput, error) { - req, out := c.SendCommandRequest(input) - err := req.Send() - return out, err -} - -const opStartAutomationExecution = "StartAutomationExecution" - -// StartAutomationExecutionRequest generates a "aws/request.Request" representing the -// client's request for the StartAutomationExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartAutomationExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartAutomationExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartAutomationExecutionRequest method. -// req, resp := client.StartAutomationExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAutomationExecution -func (c *SSM) StartAutomationExecutionRequest(input *StartAutomationExecutionInput) (req *request.Request, output *StartAutomationExecutionOutput) { - op := &request.Operation{ - Name: opStartAutomationExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartAutomationExecutionInput{} - } - - output = &StartAutomationExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartAutomationExecution API operation for Amazon Simple Systems Manager (SSM). -// -// Initiates execution of an Automation document. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation StartAutomationExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAutomationDefinitionNotFoundException "AutomationDefinitionNotFoundException" -// An Automation document with the specified name could not be found. -// -// * ErrCodeInvalidAutomationExecutionParametersException "InvalidAutomationExecutionParametersException" -// The supplied parameters for invoking the specified Automation document are -// incorrect. For example, they may not match the set of parameters permitted -// for the specified Automation document. -// -// * ErrCodeAutomationExecutionLimitExceededException "AutomationExecutionLimitExceededException" -// The number of simultaneously running Automation executions exceeded the allowable -// limit. -// -// * ErrCodeAutomationDefinitionVersionNotFoundException "AutomationDefinitionVersionNotFoundException" -// An Automation document with the specified name and version could not be found. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAutomationExecution -func (c *SSM) StartAutomationExecution(input *StartAutomationExecutionInput) (*StartAutomationExecutionOutput, error) { - req, out := c.StartAutomationExecutionRequest(input) - err := req.Send() - return out, err -} - -const opStopAutomationExecution = "StopAutomationExecution" - -// StopAutomationExecutionRequest generates a "aws/request.Request" representing the -// client's request for the StopAutomationExecution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopAutomationExecution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopAutomationExecution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopAutomationExecutionRequest method. -// req, resp := client.StopAutomationExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StopAutomationExecution -func (c *SSM) StopAutomationExecutionRequest(input *StopAutomationExecutionInput) (req *request.Request, output *StopAutomationExecutionOutput) { - op := &request.Operation{ - Name: opStopAutomationExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopAutomationExecutionInput{} - } - - output = &StopAutomationExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopAutomationExecution API operation for Amazon Simple Systems Manager (SSM). -// -// Stop an Automation that is currently executing. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation StopAutomationExecution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAutomationExecutionNotFoundException "AutomationExecutionNotFoundException" -// There is no automation execution information for the requested automation -// execution ID. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StopAutomationExecution -func (c *SSM) StopAutomationExecution(input *StopAutomationExecutionInput) (*StopAutomationExecutionOutput, error) { - req, out := c.StopAutomationExecutionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAssociation = "UpdateAssociation" - -// UpdateAssociationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAssociation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAssociation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAssociation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAssociationRequest method. -// req, resp := client.UpdateAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociation -func (c *SSM) UpdateAssociationRequest(input *UpdateAssociationInput) (req *request.Request, output *UpdateAssociationOutput) { - op := &request.Operation{ - Name: opUpdateAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAssociationInput{} - } - - output = &UpdateAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAssociation API operation for Amazon Simple Systems Manager (SSM). -// -// Updates an association. You can only update the document version, schedule, -// parameters, and Amazon S3 output of an association. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation UpdateAssociation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidSchedule "InvalidSchedule" -// The schedule is invalid. Verify your cron or rate expression and try again. -// -// * ErrCodeInvalidParameters "InvalidParameters" -// You must specify values for all required parameters in the SSM document. -// You can only supply values to parameters defined in the SSM document. -// -// * ErrCodeInvalidOutputLocation "InvalidOutputLocation" -// The output location is not valid or does not exist. -// -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" -// The document version is not valid or does not exist. -// -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" -// The specified association does not exist. -// -// * ErrCodeInvalidUpdate "InvalidUpdate" -// The update is not valid. -// -// * ErrCodeTooManyUpdates "TooManyUpdates" -// There are concurrent updates for a resource that supports one update at a -// time. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociation -func (c *SSM) UpdateAssociation(input *UpdateAssociationInput) (*UpdateAssociationOutput, error) { - req, out := c.UpdateAssociationRequest(input) - err := req.Send() - return out, err -} - -const opUpdateAssociationStatus = "UpdateAssociationStatus" - -// UpdateAssociationStatusRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAssociationStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateAssociationStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateAssociationStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateAssociationStatusRequest method. -// req, resp := client.UpdateAssociationStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociationStatus -func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput) (req *request.Request, output *UpdateAssociationStatusOutput) { - op := &request.Operation{ - Name: opUpdateAssociationStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAssociationStatusInput{} - } - - output = &UpdateAssociationStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAssociationStatus API operation for Amazon Simple Systems Manager (SSM). -// -// Updates the status of the SSM document associated with the specified 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 Simple Systems Manager (SSM)'s -// API operation UpdateAssociationStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" -// The specified association does not exist. -// -// * ErrCodeStatusUnchanged "StatusUnchanged" -// The updated status is the same as the current status. -// -// * ErrCodeTooManyUpdates "TooManyUpdates" -// There are concurrent updates for a resource that supports one update at a -// time. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociationStatus -func (c *SSM) UpdateAssociationStatus(input *UpdateAssociationStatusInput) (*UpdateAssociationStatusOutput, error) { - req, out := c.UpdateAssociationStatusRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDocument = "UpdateDocument" - -// UpdateDocumentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDocument operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDocument for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDocument method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDocumentRequest method. -// req, resp := client.UpdateDocumentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocument -func (c *SSM) UpdateDocumentRequest(input *UpdateDocumentInput) (req *request.Request, output *UpdateDocumentOutput) { - op := &request.Operation{ - Name: opUpdateDocument, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateDocumentInput{} - } - - output = &UpdateDocumentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDocument API operation for Amazon Simple Systems Manager (SSM). -// -// The document you want to update. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation UpdateDocument for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMaxDocumentSizeExceeded "MaxDocumentSizeExceeded" -// The size limit of an SSM document is 64 KB. -// -// * ErrCodeDocumentVersionLimitExceeded "DocumentVersionLimitExceeded" -// The document has too many versions. Delete one or more document versions -// and try again. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeDuplicateDocumentContent "DuplicateDocumentContent" -// The content of the association document matches another document. Change -// the content of the document and try again. -// -// * ErrCodeInvalidDocumentContent "InvalidDocumentContent" -// The content for the SSM document is not valid. -// -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" -// The document version is not valid or does not exist. -// -// * ErrCodeInvalidDocumentSchemaVersion "InvalidDocumentSchemaVersion" -// The version of the document schema is not supported. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocument -func (c *SSM) UpdateDocument(input *UpdateDocumentInput) (*UpdateDocumentOutput, error) { - req, out := c.UpdateDocumentRequest(input) - err := req.Send() - return out, err -} - -const opUpdateDocumentDefaultVersion = "UpdateDocumentDefaultVersion" - -// UpdateDocumentDefaultVersionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDocumentDefaultVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDocumentDefaultVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDocumentDefaultVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDocumentDefaultVersionRequest method. -// req, resp := client.UpdateDocumentDefaultVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentDefaultVersion -func (c *SSM) UpdateDocumentDefaultVersionRequest(input *UpdateDocumentDefaultVersionInput) (req *request.Request, output *UpdateDocumentDefaultVersionOutput) { - op := &request.Operation{ - Name: opUpdateDocumentDefaultVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateDocumentDefaultVersionInput{} - } - - output = &UpdateDocumentDefaultVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDocumentDefaultVersion API operation for Amazon Simple Systems Manager (SSM). -// -// Set the default version of a document. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation UpdateDocumentDefaultVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeInvalidDocument "InvalidDocument" -// The specified document does not exist. -// -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" -// The document version is not valid or does not exist. -// -// * ErrCodeInvalidDocumentSchemaVersion "InvalidDocumentSchemaVersion" -// The version of the document schema is not supported. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentDefaultVersion -func (c *SSM) UpdateDocumentDefaultVersion(input *UpdateDocumentDefaultVersionInput) (*UpdateDocumentDefaultVersionOutput, error) { - req, out := c.UpdateDocumentDefaultVersionRequest(input) - err := req.Send() - return out, err -} - -const opUpdateMaintenanceWindow = "UpdateMaintenanceWindow" - -// UpdateMaintenanceWindowRequest generates a "aws/request.Request" representing the -// client's request for the UpdateMaintenanceWindow operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateMaintenanceWindow for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateMaintenanceWindow method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateMaintenanceWindowRequest method. -// req, resp := client.UpdateMaintenanceWindowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindow -func (c *SSM) UpdateMaintenanceWindowRequest(input *UpdateMaintenanceWindowInput) (req *request.Request, output *UpdateMaintenanceWindowOutput) { - op := &request.Operation{ - Name: opUpdateMaintenanceWindow, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateMaintenanceWindowInput{} - } - - output = &UpdateMaintenanceWindowOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateMaintenanceWindow API operation for Amazon Simple Systems Manager (SSM). -// -// Updates an existing Maintenance Window. Only specified parameters are modified. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation UpdateMaintenanceWindow for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindow -func (c *SSM) UpdateMaintenanceWindow(input *UpdateMaintenanceWindowInput) (*UpdateMaintenanceWindowOutput, error) { - req, out := c.UpdateMaintenanceWindowRequest(input) - err := req.Send() - return out, err -} - -const opUpdateManagedInstanceRole = "UpdateManagedInstanceRole" - -// UpdateManagedInstanceRoleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateManagedInstanceRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateManagedInstanceRole for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateManagedInstanceRole method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateManagedInstanceRoleRequest method. -// req, resp := client.UpdateManagedInstanceRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateManagedInstanceRole -func (c *SSM) UpdateManagedInstanceRoleRequest(input *UpdateManagedInstanceRoleInput) (req *request.Request, output *UpdateManagedInstanceRoleOutput) { - op := &request.Operation{ - Name: opUpdateManagedInstanceRole, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateManagedInstanceRoleInput{} - } - - output = &UpdateManagedInstanceRoleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateManagedInstanceRole API operation for Amazon Simple Systems Manager (SSM). -// -// Assigns or changes an Amazon Identity and Access Management (IAM) role to -// the managed 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 Simple Systems Manager (SSM)'s -// API operation UpdateManagedInstanceRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInstanceId "InvalidInstanceId" -// The following problems can cause this exception: -// -// You do not have permission to access the instance. -// -// The SSM agent is not running. On managed instances and Linux instances, verify -// that the SSM agent is running. On EC2 Windows instances, verify that the -// EC2Config service is running. -// -// The SSM agent or EC2Config service is not registered to the SSM endpoint. -// Try reinstalling the SSM agent or EC2Config service. -// -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateManagedInstanceRole -func (c *SSM) UpdateManagedInstanceRole(input *UpdateManagedInstanceRoleInput) (*UpdateManagedInstanceRoleOutput, error) { - req, out := c.UpdateManagedInstanceRoleRequest(input) - err := req.Send() - return out, err -} - -const opUpdatePatchBaseline = "UpdatePatchBaseline" - -// UpdatePatchBaselineRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePatchBaseline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdatePatchBaseline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdatePatchBaseline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdatePatchBaselineRequest method. -// req, resp := client.UpdatePatchBaselineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdatePatchBaseline -func (c *SSM) UpdatePatchBaselineRequest(input *UpdatePatchBaselineInput) (req *request.Request, output *UpdatePatchBaselineOutput) { - op := &request.Operation{ - Name: opUpdatePatchBaseline, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdatePatchBaselineInput{} - } - - output = &UpdatePatchBaselineOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePatchBaseline API operation for Amazon Simple Systems Manager (SSM). -// -// Modifies an existing patch baseline. Fields not specified in the request -// are left unchanged. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Systems Manager (SSM)'s -// API operation UpdatePatchBaseline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" -// Error returned when the ID specified for a resource (e.g. a Maintenance Window) -// doesn’t exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdatePatchBaseline -func (c *SSM) UpdatePatchBaseline(input *UpdatePatchBaselineInput) (*UpdatePatchBaselineOutput, error) { - req, out := c.UpdatePatchBaselineRequest(input) - err := req.Send() - return out, err -} - -// An activation registers one or more on-premises servers or virtual machines -// (VMs) with AWS so that you can configure those servers or VMs using Run Command. -// A server or VM that has been registered with AWS is called a managed instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Activation -type Activation struct { - _ struct{} `type:"structure"` - - // The ID created by Systems Manager when you submitted the activation. - ActivationId *string `type:"string"` - - // The date the activation was created. - CreatedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // A name for the managed instance when it is created. - DefaultInstanceName *string `type:"string"` - - // A user defined description of the activation. - Description *string `type:"string"` - - // The date when this activation can no longer be used to register managed instances. - ExpirationDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Whether or not the activation is expired. - Expired *bool `type:"boolean"` - - // The Amazon Identity and Access Management (IAM) role to assign to the managed - // instance. - IamRole *string `type:"string"` - - // The maximum number of managed instances that can be registered using this - // activation. - RegistrationLimit *int64 `min:"1" type:"integer"` - - // The number of managed instances already registered with this activation. - RegistrationsCount *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s Activation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Activation) GoString() string { - return s.String() -} - -// SetActivationId sets the ActivationId field's value. -func (s *Activation) SetActivationId(v string) *Activation { - s.ActivationId = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *Activation) SetCreatedDate(v time.Time) *Activation { - s.CreatedDate = &v - return s -} - -// SetDefaultInstanceName sets the DefaultInstanceName field's value. -func (s *Activation) SetDefaultInstanceName(v string) *Activation { - s.DefaultInstanceName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Activation) SetDescription(v string) *Activation { - s.Description = &v - return s -} - -// SetExpirationDate sets the ExpirationDate field's value. -func (s *Activation) SetExpirationDate(v time.Time) *Activation { - s.ExpirationDate = &v - return s -} - -// SetExpired sets the Expired field's value. -func (s *Activation) SetExpired(v bool) *Activation { - s.Expired = &v - return s -} - -// SetIamRole sets the IamRole field's value. -func (s *Activation) SetIamRole(v string) *Activation { - s.IamRole = &v - return s -} - -// SetRegistrationLimit sets the RegistrationLimit field's value. -func (s *Activation) SetRegistrationLimit(v int64) *Activation { - s.RegistrationLimit = &v - return s -} - -// SetRegistrationsCount sets the RegistrationsCount field's value. -func (s *Activation) SetRegistrationsCount(v int64) *Activation { - s.RegistrationsCount = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AddTagsToResourceRequest -type AddTagsToResourceInput struct { - _ struct{} `type:"structure"` - - // The resource ID you want to tag. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // Specifies the type of resource you are tagging. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"ResourceTypeForTagging"` - - // 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 `type:"list" required:"true"` -} - -// String returns the string representation -func (s AddTagsToResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - 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 -} - -// SetResourceId sets the ResourceId field's value. -func (s *AddTagsToResourceInput) SetResourceId(v string) *AddTagsToResourceInput { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *AddTagsToResourceInput) SetResourceType(v string) *AddTagsToResourceInput { - s.ResourceType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToResourceInput) SetTags(v []*Tag) *AddTagsToResourceInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AddTagsToResourceResult -type AddTagsToResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsToResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToResourceOutput) GoString() string { - return s.String() -} - -// Describes an association of an SSM document and an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Association -type Association struct { - _ struct{} `type:"structure"` - - // The ID created by the system when you create an association. An association - // is a binding between a document and a set of targets with a schedule. - AssociationId *string `type:"string"` - - // The version of the document used in the association. - DocumentVersion *string `type:"string"` - - // The ID of the instance. - InstanceId *string `type:"string"` - - // The date on which the association was last run. - LastExecutionDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the SSM document. - Name *string `type:"string"` - - // Information about the association. - Overview *AssociationOverview `type:"structure"` - - // A cron expression that specifies a schedule when the association runs. - ScheduleExpression *string `min:"1" type:"string"` - - // The instances targeted by the request to create an association. - Targets []*Target `type:"list"` -} - -// String returns the string representation -func (s Association) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Association) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *Association) SetAssociationId(v string) *Association { - s.AssociationId = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *Association) SetDocumentVersion(v string) *Association { - s.DocumentVersion = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Association) SetInstanceId(v string) *Association { - s.InstanceId = &v - return s -} - -// SetLastExecutionDate sets the LastExecutionDate field's value. -func (s *Association) SetLastExecutionDate(v time.Time) *Association { - s.LastExecutionDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *Association) SetName(v string) *Association { - s.Name = &v - return s -} - -// SetOverview sets the Overview field's value. -func (s *Association) SetOverview(v *AssociationOverview) *Association { - s.Overview = v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *Association) SetScheduleExpression(v string) *Association { - s.ScheduleExpression = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *Association) SetTargets(v []*Target) *Association { - s.Targets = v - return s -} - -// Describes the parameters for a document. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AssociationDescription -type AssociationDescription struct { - _ struct{} `type:"structure"` - - // The association ID. - AssociationId *string `type:"string"` - - // The date when the association was made. - Date *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The document version. - DocumentVersion *string `type:"string"` - - // The ID of the instance. - InstanceId *string `type:"string"` - - // The date on which the association was last run. - LastExecutionDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The last date on which the association was successfully run. - LastSuccessfulExecutionDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date when the association was last updated. - LastUpdateAssociationDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the SSM document. - Name *string `type:"string"` - - // An Amazon S3 bucket where you want to store the output details of the request. - OutputLocation *InstanceAssociationOutputLocation `type:"structure"` - - // Information about the association. - Overview *AssociationOverview `type:"structure"` - - // A description of the parameters for a document. - Parameters map[string][]*string `type:"map"` - - // A cron expression that specifies a schedule when the association runs. - ScheduleExpression *string `min:"1" type:"string"` - - // The association status. - Status *AssociationStatus `type:"structure"` - - // The instances targeted by the request. - Targets []*Target `type:"list"` -} - -// String returns the string representation -func (s AssociationDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociationDescription) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *AssociationDescription) SetAssociationId(v string) *AssociationDescription { - s.AssociationId = &v - return s -} - -// SetDate sets the Date field's value. -func (s *AssociationDescription) SetDate(v time.Time) *AssociationDescription { - s.Date = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *AssociationDescription) SetDocumentVersion(v string) *AssociationDescription { - s.DocumentVersion = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssociationDescription) SetInstanceId(v string) *AssociationDescription { - s.InstanceId = &v - return s -} - -// SetLastExecutionDate sets the LastExecutionDate field's value. -func (s *AssociationDescription) SetLastExecutionDate(v time.Time) *AssociationDescription { - s.LastExecutionDate = &v - return s -} - -// SetLastSuccessfulExecutionDate sets the LastSuccessfulExecutionDate field's value. -func (s *AssociationDescription) SetLastSuccessfulExecutionDate(v time.Time) *AssociationDescription { - s.LastSuccessfulExecutionDate = &v - return s -} - -// SetLastUpdateAssociationDate sets the LastUpdateAssociationDate field's value. -func (s *AssociationDescription) SetLastUpdateAssociationDate(v time.Time) *AssociationDescription { - s.LastUpdateAssociationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *AssociationDescription) SetName(v string) *AssociationDescription { - s.Name = &v - return s -} - -// SetOutputLocation sets the OutputLocation field's value. -func (s *AssociationDescription) SetOutputLocation(v *InstanceAssociationOutputLocation) *AssociationDescription { - s.OutputLocation = v - return s -} - -// SetOverview sets the Overview field's value. -func (s *AssociationDescription) SetOverview(v *AssociationOverview) *AssociationDescription { - s.Overview = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *AssociationDescription) SetParameters(v map[string][]*string) *AssociationDescription { - s.Parameters = v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *AssociationDescription) SetScheduleExpression(v string) *AssociationDescription { - s.ScheduleExpression = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AssociationDescription) SetStatus(v *AssociationStatus) *AssociationDescription { - s.Status = v - return s -} - -// SetTargets sets the Targets field's value. -func (s *AssociationDescription) SetTargets(v []*Target) *AssociationDescription { - s.Targets = v - return s -} - -// Describes a filter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AssociationFilter -type AssociationFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter. - // - // Key is a required field - Key *string `locationName:"key" type:"string" required:"true" enum:"AssociationFilterKey"` - - // The filter value. - // - // Value is a required field - Value *string `locationName:"value" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociationFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociationFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociationFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociationFilter"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *AssociationFilter) SetKey(v string) *AssociationFilter { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *AssociationFilter) SetValue(v string) *AssociationFilter { - s.Value = &v - return s -} - -// Information about the association. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AssociationOverview -type AssociationOverview struct { - _ struct{} `type:"structure"` - - // Returns the number of targets for the association status. For example, if - // you created an association with two instances, and one of them was successful, - // this would return the count of instances by status. - AssociationStatusAggregatedCount map[string]*int64 `type:"map"` - - // A detailed status of the association. - DetailedStatus *string `type:"string"` - - // The status of the association. Status can be: Pending, Success, or Failed. - Status *string `type:"string"` -} - -// String returns the string representation -func (s AssociationOverview) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociationOverview) GoString() string { - return s.String() -} - -// SetAssociationStatusAggregatedCount sets the AssociationStatusAggregatedCount field's value. -func (s *AssociationOverview) SetAssociationStatusAggregatedCount(v map[string]*int64) *AssociationOverview { - s.AssociationStatusAggregatedCount = v - return s -} - -// SetDetailedStatus sets the DetailedStatus field's value. -func (s *AssociationOverview) SetDetailedStatus(v string) *AssociationOverview { - s.DetailedStatus = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AssociationOverview) SetStatus(v string) *AssociationOverview { - s.Status = &v - return s -} - -// Describes an association status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AssociationStatus -type AssociationStatus struct { - _ struct{} `type:"structure"` - - // A user-defined string. - AdditionalInfo *string `type:"string"` - - // The date when the status changed. - // - // Date is a required field - Date *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The reason for the status. - // - // Message is a required field - Message *string `min:"1" type:"string" required:"true"` - - // The status. - // - // Name is a required field - Name *string `type:"string" required:"true" enum:"AssociationStatusName"` -} - -// String returns the string representation -func (s AssociationStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociationStatus) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociationStatus) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociationStatus"} - if s.Date == nil { - invalidParams.Add(request.NewErrParamRequired("Date")) - } - if s.Message == nil { - invalidParams.Add(request.NewErrParamRequired("Message")) - } - if s.Message != nil && len(*s.Message) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Message", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *AssociationStatus) SetAdditionalInfo(v string) *AssociationStatus { - s.AdditionalInfo = &v - return s -} - -// SetDate sets the Date field's value. -func (s *AssociationStatus) SetDate(v time.Time) *AssociationStatus { - s.Date = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *AssociationStatus) SetMessage(v string) *AssociationStatus { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *AssociationStatus) SetName(v string) *AssociationStatus { - s.Name = &v - return s -} - -// Detailed information about the current state of an individual Automation -// execution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AutomationExecution -type AutomationExecution struct { - _ struct{} `type:"structure"` - - // The execution ID. - AutomationExecutionId *string `min:"36" type:"string"` - - // The execution status of the Automation. - AutomationExecutionStatus *string `type:"string" enum:"AutomationExecutionStatus"` - - // The name of the Automation document used during the execution. - DocumentName *string `type:"string"` - - // The version of the document to use during execution. - DocumentVersion *string `type:"string"` - - // The time the execution finished. - ExecutionEndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time the execution started. - ExecutionStartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // A message describing why an execution has failed, if the status is set to - // Failed. - FailureMessage *string `type:"string"` - - // The list of execution outputs as defined in the automation document. - Outputs map[string][]*string `min:"1" type:"map"` - - // The key-value map of execution parameters, which were supplied when calling - // StartAutomationExecution. - Parameters map[string][]*string `min:"1" type:"map"` - - // A list of details about the current state of all steps that comprise an execution. - // An Automation document contains a list of steps that are executed in order. - StepExecutions []*StepExecution `type:"list"` -} - -// String returns the string representation -func (s AutomationExecution) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutomationExecution) GoString() string { - return s.String() -} - -// SetAutomationExecutionId sets the AutomationExecutionId field's value. -func (s *AutomationExecution) SetAutomationExecutionId(v string) *AutomationExecution { - s.AutomationExecutionId = &v - return s -} - -// SetAutomationExecutionStatus sets the AutomationExecutionStatus field's value. -func (s *AutomationExecution) SetAutomationExecutionStatus(v string) *AutomationExecution { - s.AutomationExecutionStatus = &v - return s -} - -// SetDocumentName sets the DocumentName field's value. -func (s *AutomationExecution) SetDocumentName(v string) *AutomationExecution { - s.DocumentName = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *AutomationExecution) SetDocumentVersion(v string) *AutomationExecution { - s.DocumentVersion = &v - return s -} - -// SetExecutionEndTime sets the ExecutionEndTime field's value. -func (s *AutomationExecution) SetExecutionEndTime(v time.Time) *AutomationExecution { - s.ExecutionEndTime = &v - return s -} - -// SetExecutionStartTime sets the ExecutionStartTime field's value. -func (s *AutomationExecution) SetExecutionStartTime(v time.Time) *AutomationExecution { - s.ExecutionStartTime = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *AutomationExecution) SetFailureMessage(v string) *AutomationExecution { - s.FailureMessage = &v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *AutomationExecution) SetOutputs(v map[string][]*string) *AutomationExecution { - s.Outputs = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *AutomationExecution) SetParameters(v map[string][]*string) *AutomationExecution { - s.Parameters = v - return s -} - -// SetStepExecutions sets the StepExecutions field's value. -func (s *AutomationExecution) SetStepExecutions(v []*StepExecution) *AutomationExecution { - s.StepExecutions = v - return s -} - -// A filter used to match specific automation executions. This is used to limit -// the scope of Automation execution information returned. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AutomationExecutionFilter -type AutomationExecutionFilter struct { - _ struct{} `type:"structure"` - - // The aspect of the Automation execution information that should be limited. - // - // Key is a required field - Key *string `type:"string" required:"true" enum:"AutomationExecutionFilterKey"` - - // The values used to limit the execution information associated with the filter's - // key. - // - // Values is a required field - Values []*string `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s AutomationExecutionFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutomationExecutionFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AutomationExecutionFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AutomationExecutionFilter"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *AutomationExecutionFilter) SetKey(v string) *AutomationExecutionFilter { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *AutomationExecutionFilter) SetValues(v []*string) *AutomationExecutionFilter { - s.Values = v - return s -} - -// Details about a specific Automation execution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AutomationExecutionMetadata -type AutomationExecutionMetadata struct { - _ struct{} `type:"structure"` - - // The execution ID. - AutomationExecutionId *string `min:"36" type:"string"` - - // The status of the execution. Valid values include: Running, Succeeded, Failed, - // Timed out, or Cancelled. - AutomationExecutionStatus *string `type:"string" enum:"AutomationExecutionStatus"` - - // The name of the Automation document used during execution. - DocumentName *string `type:"string"` - - // The document version used during the execution. - DocumentVersion *string `type:"string"` - - // The IAM role ARN of the user who executed the Automation. - ExecutedBy *string `type:"string"` - - // The time the execution finished. This is not populated if the execution is - // still in progress. - ExecutionEndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time the execution started.> - ExecutionStartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // An Amazon S3 bucket where execution information is stored. - LogFile *string `type:"string"` - - // The list of execution outputs as defined in the Automation document. - Outputs map[string][]*string `min:"1" type:"map"` -} - -// String returns the string representation -func (s AutomationExecutionMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AutomationExecutionMetadata) GoString() string { - return s.String() -} - -// SetAutomationExecutionId sets the AutomationExecutionId field's value. -func (s *AutomationExecutionMetadata) SetAutomationExecutionId(v string) *AutomationExecutionMetadata { - s.AutomationExecutionId = &v - return s -} - -// SetAutomationExecutionStatus sets the AutomationExecutionStatus field's value. -func (s *AutomationExecutionMetadata) SetAutomationExecutionStatus(v string) *AutomationExecutionMetadata { - s.AutomationExecutionStatus = &v - return s -} - -// SetDocumentName sets the DocumentName field's value. -func (s *AutomationExecutionMetadata) SetDocumentName(v string) *AutomationExecutionMetadata { - s.DocumentName = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *AutomationExecutionMetadata) SetDocumentVersion(v string) *AutomationExecutionMetadata { - s.DocumentVersion = &v - return s -} - -// SetExecutedBy sets the ExecutedBy field's value. -func (s *AutomationExecutionMetadata) SetExecutedBy(v string) *AutomationExecutionMetadata { - s.ExecutedBy = &v - return s -} - -// SetExecutionEndTime sets the ExecutionEndTime field's value. -func (s *AutomationExecutionMetadata) SetExecutionEndTime(v time.Time) *AutomationExecutionMetadata { - s.ExecutionEndTime = &v - return s -} - -// SetExecutionStartTime sets the ExecutionStartTime field's value. -func (s *AutomationExecutionMetadata) SetExecutionStartTime(v time.Time) *AutomationExecutionMetadata { - s.ExecutionStartTime = &v - return s -} - -// SetLogFile sets the LogFile field's value. -func (s *AutomationExecutionMetadata) SetLogFile(v string) *AutomationExecutionMetadata { - s.LogFile = &v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *AutomationExecutionMetadata) SetOutputs(v map[string][]*string) *AutomationExecutionMetadata { - s.Outputs = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelCommandRequest -type CancelCommandInput struct { - _ struct{} `type:"structure"` - - // The ID of the command you want to cancel. - // - // CommandId is a required field - CommandId *string `min:"36" type:"string" required:"true"` - - // (Optional) A list of instance IDs on which you want to cancel the command. - // If not provided, the command is canceled on every instance on which it was - // requested. - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s CancelCommandInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelCommandInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelCommandInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelCommandInput"} - if s.CommandId == nil { - invalidParams.Add(request.NewErrParamRequired("CommandId")) - } - if s.CommandId != nil && len(*s.CommandId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CommandId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommandId sets the CommandId field's value. -func (s *CancelCommandInput) SetCommandId(v string) *CancelCommandInput { - s.CommandId = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *CancelCommandInput) SetInstanceIds(v []*string) *CancelCommandInput { - s.InstanceIds = v - return s -} - -// Whether or not the command was successfully canceled. There is no guarantee -// that a request can be canceled. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelCommandResult -type CancelCommandOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CancelCommandOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelCommandOutput) GoString() string { - return s.String() -} - -// Describes a command request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Command -type Command struct { - _ struct{} `type:"structure"` - - // A unique identifier for this command. - CommandId *string `min:"36" type:"string"` - - // User-specified information about the command, such as a brief description - // of what the command should do. - Comment *string `type:"string"` - - // The number of targets for which the command invocation reached a terminal - // state. Terminal states include the following: Success, Failed, Execution - // Timed Out, Delivery Timed Out, Canceled, Terminated, or Undeliverable. - CompletedCount *int64 `type:"integer"` - - // The name of the SSM document requested for execution. - DocumentName *string `type:"string"` - - // The number of targets for which the status is Failed or Execution Timed Out. - ErrorCount *int64 `type:"integer"` - - // If this time is reached and the command has not already started executing, - // it will not execute. Calculated based on the ExpiresAfter user input provided - // as part of the SendCommand API. - ExpiresAfter *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The instance IDs against which this command was requested. - InstanceIds []*string `type:"list"` - - // The maximum number of instances that are allowed to execute the command at - // the same time. You can specify a number of instances, such as 10, or a percentage - // of instances, such as 10%. The default value is 50. For more information - // about how to use MaxConcurrency, see Executing a Command Using Amazon EC2 - // Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). - MaxConcurrency *string `min:"1" type:"string"` - - // The maximum number of errors allowed before the system stops sending the - // command to additional targets. You can specify a number of errors, such as - // 10, or a percentage or errors, such as 10%. The default value is 50. For - // more information about how to use MaxErrors, see Executing a Command Using - // Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). - MaxErrors *string `min:"1" type:"string"` - - // Configurations for sending notifications about command status changes. - NotificationConfig *NotificationConfig `type:"structure"` - - // The S3 bucket where the responses to the command executions should be stored. - // This was requested when issuing the command. - OutputS3BucketName *string `min:"3" type:"string"` - - // The S3 directory path inside the bucket where the responses to the command - // executions should be stored. This was requested when issuing the command. - OutputS3KeyPrefix *string `type:"string"` - - // The region where the Amazon Simple Storage Service (Amazon S3) output bucket - // is located. The default value is the region where Run Command is being called. - OutputS3Region *string `min:"3" type:"string"` - - // The parameter values to be inserted in the SSM document when executing the - // command. - Parameters map[string][]*string `type:"map"` - - // The date and time the command was requested. - RequestedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The IAM service role that Run Command uses to act on your behalf when sending - // notifications about command status changes. - ServiceRole *string `type:"string"` - - // The status of the command. - Status *string `type:"string" enum:"CommandStatus"` - - // A detailed status of the command execution. StatusDetails includes more information - // than Status because it includes states resulting from error and concurrency - // control parameters. StatusDetails can show different results than Status. - // For more information about these statuses, see Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // (Linux) or Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/monitor-commands.html) - // (Windows). StatusDetails can be one of the following values: - // - // * Pending – The command has not been sent to any instances. - // - // * In Progress – The command has been sent to at least one instance but - // has not reached a final state on all instances. - // - // * Success – The command successfully executed on all invocations. This - // is a terminal state. - // - // * Delivery Timed Out – The value of MaxErrors or more command invocations - // shows a status of Delivery Timed Out. This is a terminal state. - // - // * Execution Timed Out – The value of MaxErrors or more command invocations - // shows a status of Execution Timed Out. This is a terminal state. - // - // * Failed – The value of MaxErrors or more command invocations shows a - // status of Failed. This is a terminal state. - // - // * Incomplete – The command was attempted on all instances and one or more - // invocations does not have a value of Success but not enough invocations - // failed for the status to be Failed. This is a terminal state. - // - // * Canceled – The command was terminated before it was completed. This - // is a terminal state. - // - // * Rate Exceeded – The number of instances targeted by the command exceeded - // the account limit for pending invocations. The system has canceled the - // command before executing it on any instance. This is a terminal state. - StatusDetails *string `type:"string"` - - // The number of targets for the command. - TargetCount *int64 `type:"integer"` - - // An array of search criteria that targets instances using a Key;Value combination - // that you specify. Targets is required if you don't provide one or more instance - // IDs in the call. - Targets []*Target `type:"list"` -} - -// String returns the string representation -func (s Command) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Command) GoString() string { - return s.String() -} - -// SetCommandId sets the CommandId field's value. -func (s *Command) SetCommandId(v string) *Command { - s.CommandId = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *Command) SetComment(v string) *Command { - s.Comment = &v - return s -} - -// SetCompletedCount sets the CompletedCount field's value. -func (s *Command) SetCompletedCount(v int64) *Command { - s.CompletedCount = &v - return s -} - -// SetDocumentName sets the DocumentName field's value. -func (s *Command) SetDocumentName(v string) *Command { - s.DocumentName = &v - return s -} - -// SetErrorCount sets the ErrorCount field's value. -func (s *Command) SetErrorCount(v int64) *Command { - s.ErrorCount = &v - return s -} - -// SetExpiresAfter sets the ExpiresAfter field's value. -func (s *Command) SetExpiresAfter(v time.Time) *Command { - s.ExpiresAfter = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *Command) SetInstanceIds(v []*string) *Command { - s.InstanceIds = v - return s -} - -// SetMaxConcurrency sets the MaxConcurrency field's value. -func (s *Command) SetMaxConcurrency(v string) *Command { - s.MaxConcurrency = &v - return s -} - -// SetMaxErrors sets the MaxErrors field's value. -func (s *Command) SetMaxErrors(v string) *Command { - s.MaxErrors = &v - return s -} - -// SetNotificationConfig sets the NotificationConfig field's value. -func (s *Command) SetNotificationConfig(v *NotificationConfig) *Command { - s.NotificationConfig = v - return s -} - -// SetOutputS3BucketName sets the OutputS3BucketName field's value. -func (s *Command) SetOutputS3BucketName(v string) *Command { - s.OutputS3BucketName = &v - return s -} - -// SetOutputS3KeyPrefix sets the OutputS3KeyPrefix field's value. -func (s *Command) SetOutputS3KeyPrefix(v string) *Command { - s.OutputS3KeyPrefix = &v - return s -} - -// SetOutputS3Region sets the OutputS3Region field's value. -func (s *Command) SetOutputS3Region(v string) *Command { - s.OutputS3Region = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *Command) SetParameters(v map[string][]*string) *Command { - s.Parameters = v - return s -} - -// SetRequestedDateTime sets the RequestedDateTime field's value. -func (s *Command) SetRequestedDateTime(v time.Time) *Command { - s.RequestedDateTime = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *Command) SetServiceRole(v string) *Command { - s.ServiceRole = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Command) SetStatus(v string) *Command { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *Command) SetStatusDetails(v string) *Command { - s.StatusDetails = &v - return s -} - -// SetTargetCount sets the TargetCount field's value. -func (s *Command) SetTargetCount(v int64) *Command { - s.TargetCount = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *Command) SetTargets(v []*Target) *Command { - s.Targets = v - return s -} - -// Describes a command filter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CommandFilter -type CommandFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter. For example, requested date and time. - // - // Key is a required field - Key *string `locationName:"key" type:"string" required:"true" enum:"CommandFilterKey"` - - // The filter value. For example: June 30, 2015. - // - // Value is a required field - Value *string `locationName:"value" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CommandFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CommandFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CommandFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CommandFilter"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *CommandFilter) SetKey(v string) *CommandFilter { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *CommandFilter) SetValue(v string) *CommandFilter { - s.Value = &v - return s -} - -// An invocation is copy of a command sent to a specific instance. A command -// can apply to one or more instances. A command invocation applies to one instance. -// For example, if a user executes SendCommand against three instances, then -// a command invocation is created for each requested instance ID. A command -// invocation returns status and detail information about a command you executed. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CommandInvocation -type CommandInvocation struct { - _ struct{} `type:"structure"` - - // The command against which this invocation was requested. - CommandId *string `min:"36" type:"string"` - - CommandPlugins []*CommandPlugin `type:"list"` - - // User-specified information about the command, such as a brief description - // of what the command should do. - Comment *string `type:"string"` - - // The document name that was requested for execution. - DocumentName *string `type:"string"` - - // The instance ID in which this invocation was requested. - InstanceId *string `type:"string"` - - // The name of the invocation target. For Amazon EC2 instances this is the value - // for the aws:Name tag. For on-premises instances, this is the name of the - // instance. - InstanceName *string `type:"string"` - - // Configurations for sending notifications about command status changes on - // a per instance basis. - NotificationConfig *NotificationConfig `type:"structure"` - - // The time and date the request was sent to this instance. - RequestedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The IAM service role that Run Command uses to act on your behalf when sending - // notifications about command status changes on a per instance basis. - ServiceRole *string `type:"string"` - - // The URL to the plugin’s StdErr file in Amazon S3, if the Amazon S3 bucket - // was defined for the parent command. For an invocation, StandardErrorUrl is - // populated if there is just one plugin defined for the command, and the Amazon - // S3 bucket was defined for the command. - StandardErrorUrl *string `type:"string"` - - // The URL to the plugin’s StdOut file in Amazon S3, if the Amazon S3 bucket - // was defined for the parent command. For an invocation, StandardOutputUrl - // is populated if there is just one plugin defined for the command, and the - // Amazon S3 bucket was defined for the command. - StandardOutputUrl *string `type:"string"` - - // Whether or not the invocation succeeded, failed, or is pending. - Status *string `type:"string" enum:"CommandInvocationStatus"` - - // A detailed status of the command execution for each invocation (each instance - // targeted by the command). StatusDetails includes more information than Status - // because it includes states resulting from error and concurrency control parameters. - // StatusDetails can show different results than Status. For more information - // about these statuses, see Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // (Linux) or Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/monitor-commands.html) - // (Windows). StatusDetails can be one of the following values: - // - // * Pending – The command has not been sent to the instance. - // - // * In Progress – The command has been sent to the instance but has not - // reached a terminal state. - // - // * Success – The execution of the command or plugin was successfully completed. - // This is a terminal state. - // - // * Delivery Timed Out – The command was not delivered to the instance before - // the delivery timeout expired. Delivery timeouts do not count against the - // parent command’s MaxErrors limit, but they do contribute to whether the - // parent command status is Success or Incomplete. This is a terminal state. - // - // * Execution Timed Out – Command execution started on the instance, but - // the execution was not complete before the execution timeout expired. Execution - // timeouts count against the MaxErrors limit of the parent command. This - // is a terminal state. - // - // * Failed – The command was not successful on the instance. For a plugin, - // this indicates that the result code was not zero. For a command invocation, - // this indicates that the result code for one or more plugins was not zero. - // Invocation failures count against the MaxErrors limit of the parent command. - // This is a terminal state. - // - // * Canceled – The command was terminated before it was completed. This - // is a terminal state. - // - // * Undeliverable – The command can't be delivered to the instance. The - // instance might not exist or might not be responding. Undeliverable invocations - // don't count against the parent command’s MaxErrors limit and don't contribute - // to whether the parent command status is Success or Incomplete. This is - // a terminal state. - // - // * Terminated – The parent command exceeded its MaxErrors limit and subsequent - // command invocations were canceled by the system. This is a terminal state. - StatusDetails *string `type:"string"` - - // Gets the trace output sent by the agent. - TraceOutput *string `type:"string"` -} - -// String returns the string representation -func (s CommandInvocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CommandInvocation) GoString() string { - return s.String() -} - -// SetCommandId sets the CommandId field's value. -func (s *CommandInvocation) SetCommandId(v string) *CommandInvocation { - s.CommandId = &v - return s -} - -// SetCommandPlugins sets the CommandPlugins field's value. -func (s *CommandInvocation) SetCommandPlugins(v []*CommandPlugin) *CommandInvocation { - s.CommandPlugins = v - return s -} - -// SetComment sets the Comment field's value. -func (s *CommandInvocation) SetComment(v string) *CommandInvocation { - s.Comment = &v - return s -} - -// SetDocumentName sets the DocumentName field's value. -func (s *CommandInvocation) SetDocumentName(v string) *CommandInvocation { - s.DocumentName = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CommandInvocation) SetInstanceId(v string) *CommandInvocation { - s.InstanceId = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *CommandInvocation) SetInstanceName(v string) *CommandInvocation { - s.InstanceName = &v - return s -} - -// SetNotificationConfig sets the NotificationConfig field's value. -func (s *CommandInvocation) SetNotificationConfig(v *NotificationConfig) *CommandInvocation { - s.NotificationConfig = v - return s -} - -// SetRequestedDateTime sets the RequestedDateTime field's value. -func (s *CommandInvocation) SetRequestedDateTime(v time.Time) *CommandInvocation { - s.RequestedDateTime = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *CommandInvocation) SetServiceRole(v string) *CommandInvocation { - s.ServiceRole = &v - return s -} - -// SetStandardErrorUrl sets the StandardErrorUrl field's value. -func (s *CommandInvocation) SetStandardErrorUrl(v string) *CommandInvocation { - s.StandardErrorUrl = &v - return s -} - -// SetStandardOutputUrl sets the StandardOutputUrl field's value. -func (s *CommandInvocation) SetStandardOutputUrl(v string) *CommandInvocation { - s.StandardOutputUrl = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CommandInvocation) SetStatus(v string) *CommandInvocation { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *CommandInvocation) SetStatusDetails(v string) *CommandInvocation { - s.StatusDetails = &v - return s -} - -// SetTraceOutput sets the TraceOutput field's value. -func (s *CommandInvocation) SetTraceOutput(v string) *CommandInvocation { - s.TraceOutput = &v - return s -} - -// Describes plugin details. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CommandPlugin -type CommandPlugin struct { - _ struct{} `type:"structure"` - - // The name of the plugin. Must be one of the following: aws:updateAgent, aws:domainjoin, - // aws:applications, aws:runPowerShellScript, aws:psmodule, aws:cloudWatch, - // aws:runShellScript, or aws:updateSSMAgent. - Name *string `min:"4" type:"string"` - - // Output of the plugin execution. - Output *string `type:"string"` - - // The S3 bucket where the responses to the command executions should be stored. - // This was requested when issuing the command. For example, in the following - // response: - // - // test_folder/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix/i-1234567876543/awsrunShellScript - // - // test_folder is the name of the Amazon S3 bucket; - // - // ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix is the name of the S3 prefix; - // - // i-1234567876543 is the instance ID; - // - // awsrunShellScript is the name of the plugin. - OutputS3BucketName *string `min:"3" type:"string"` - - // The S3 directory path inside the bucket where the responses to the command - // executions should be stored. This was requested when issuing the command. - // For example, in the following response: - // - // test_folder/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix/i-1234567876543/awsrunShellScript - // - // test_folder is the name of the Amazon S3 bucket; - // - // ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix is the name of the S3 prefix; - // - // i-1234567876543 is the instance ID; - // - // awsrunShellScript is the name of the plugin. - OutputS3KeyPrefix *string `type:"string"` - - // The name of the region where the output is stored in Amazon S3. - OutputS3Region *string `min:"3" type:"string"` - - // A numeric response code generated after executing the plugin. - ResponseCode *int64 `type:"integer"` - - // The time the plugin stopped executing. Could stop prematurely if, for example, - // a cancel command was sent. - ResponseFinishDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time the plugin started executing. - ResponseStartDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The URL for the complete text written by the plugin to stderr. If execution - // is not yet complete, then this string is empty. - StandardErrorUrl *string `type:"string"` - - // The URL for the complete text written by the plugin to stdout in Amazon S3. - // If the Amazon S3 bucket for the command was not specified, then this string - // is empty. - StandardOutputUrl *string `type:"string"` - - // The status of this plugin. You can execute a document with multiple plugins. - Status *string `type:"string" enum:"CommandPluginStatus"` - - // A detailed status of the plugin execution. StatusDetails includes more information - // than Status because it includes states resulting from error and concurrency - // control parameters. StatusDetails can show different results than Status. - // For more information about these statuses, see Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // (Linux) or Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/monitor-commands.html) - // (Windows). StatusDetails can be one of the following values: - // - // * Pending – The command has not been sent to the instance. - // - // * In Progress – The command has been sent to the instance but has not - // reached a terminal state. - // - // * Success – The execution of the command or plugin was successfully completed. - // This is a terminal state. - // - // * Delivery Timed Out – The command was not delivered to the instance before - // the delivery timeout expired. Delivery timeouts do not count against the - // parent command’s MaxErrors limit, but they do contribute to whether the - // parent command status is Success or Incomplete. This is a terminal state. - // - // * Execution Timed Out – Command execution started on the instance, but - // the execution was not complete before the execution timeout expired. Execution - // timeouts count against the MaxErrors limit of the parent command. This - // is a terminal state. - // - // * Failed – The command was not successful on the instance. For a plugin, - // this indicates that the result code was not zero. For a command invocation, - // this indicates that the result code for one or more plugins was not zero. - // Invocation failures count against the MaxErrors limit of the parent command. - // This is a terminal state. - // - // * Canceled – The command was terminated before it was completed. This - // is a terminal state. - // - // * Undeliverable – The command can't be delivered to the instance. The - // instance might not exist, or it might not be responding. Undeliverable - // invocations don't count against the parent command’s MaxErrors limit, - // and they don't contribute to whether the parent command status is Success - // or Incomplete. This is a terminal state. - // - // * Terminated – The parent command exceeded its MaxErrors limit and subsequent - // command invocations were canceled by the system. This is a terminal state. - StatusDetails *string `type:"string"` -} - -// String returns the string representation -func (s CommandPlugin) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CommandPlugin) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *CommandPlugin) SetName(v string) *CommandPlugin { - s.Name = &v - return s -} - -// SetOutput sets the Output field's value. -func (s *CommandPlugin) SetOutput(v string) *CommandPlugin { - s.Output = &v - return s -} - -// SetOutputS3BucketName sets the OutputS3BucketName field's value. -func (s *CommandPlugin) SetOutputS3BucketName(v string) *CommandPlugin { - s.OutputS3BucketName = &v - return s -} - -// SetOutputS3KeyPrefix sets the OutputS3KeyPrefix field's value. -func (s *CommandPlugin) SetOutputS3KeyPrefix(v string) *CommandPlugin { - s.OutputS3KeyPrefix = &v - return s -} - -// SetOutputS3Region sets the OutputS3Region field's value. -func (s *CommandPlugin) SetOutputS3Region(v string) *CommandPlugin { - s.OutputS3Region = &v - return s -} - -// SetResponseCode sets the ResponseCode field's value. -func (s *CommandPlugin) SetResponseCode(v int64) *CommandPlugin { - s.ResponseCode = &v - return s -} - -// SetResponseFinishDateTime sets the ResponseFinishDateTime field's value. -func (s *CommandPlugin) SetResponseFinishDateTime(v time.Time) *CommandPlugin { - s.ResponseFinishDateTime = &v - return s -} - -// SetResponseStartDateTime sets the ResponseStartDateTime field's value. -func (s *CommandPlugin) SetResponseStartDateTime(v time.Time) *CommandPlugin { - s.ResponseStartDateTime = &v - return s -} - -// SetStandardErrorUrl sets the StandardErrorUrl field's value. -func (s *CommandPlugin) SetStandardErrorUrl(v string) *CommandPlugin { - s.StandardErrorUrl = &v - return s -} - -// SetStandardOutputUrl sets the StandardOutputUrl field's value. -func (s *CommandPlugin) SetStandardOutputUrl(v string) *CommandPlugin { - s.StandardOutputUrl = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CommandPlugin) SetStatus(v string) *CommandPlugin { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *CommandPlugin) SetStatusDetails(v string) *CommandPlugin { - s.StatusDetails = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateActivationRequest -type CreateActivationInput struct { - _ struct{} `type:"structure"` - - // The name of the registered, managed instance as it will appear in the Amazon - // EC2 console or when you use the AWS command line tools to list EC2 resources. - DefaultInstanceName *string `type:"string"` - - // A user-defined description of the resource that you want to register with - // Amazon EC2. - Description *string `type:"string"` - - // The date by which this activation request should expire. The default value - // is 24 hours. - ExpirationDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The Amazon Identity and Access Management (IAM) role that you want to assign - // to the managed instance. - // - // IamRole is a required field - IamRole *string `type:"string" required:"true"` - - // Specify the maximum number of managed instances you want to register. The - // default value is 1 instance. - RegistrationLimit *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s CreateActivationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateActivationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateActivationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateActivationInput"} - if s.IamRole == nil { - invalidParams.Add(request.NewErrParamRequired("IamRole")) - } - if s.RegistrationLimit != nil && *s.RegistrationLimit < 1 { - invalidParams.Add(request.NewErrParamMinValue("RegistrationLimit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultInstanceName sets the DefaultInstanceName field's value. -func (s *CreateActivationInput) SetDefaultInstanceName(v string) *CreateActivationInput { - s.DefaultInstanceName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateActivationInput) SetDescription(v string) *CreateActivationInput { - s.Description = &v - return s -} - -// SetExpirationDate sets the ExpirationDate field's value. -func (s *CreateActivationInput) SetExpirationDate(v time.Time) *CreateActivationInput { - s.ExpirationDate = &v - return s -} - -// SetIamRole sets the IamRole field's value. -func (s *CreateActivationInput) SetIamRole(v string) *CreateActivationInput { - s.IamRole = &v - return s -} - -// SetRegistrationLimit sets the RegistrationLimit field's value. -func (s *CreateActivationInput) SetRegistrationLimit(v int64) *CreateActivationInput { - s.RegistrationLimit = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateActivationResult -type CreateActivationOutput struct { - _ struct{} `type:"structure"` - - // The code the system generates when it processes the activation. The activation - // code functions like a password to validate the activation ID. - ActivationCode *string `min:"20" type:"string"` - - // The ID number generated by the system when it processed the activation. The - // activation ID functions like a user name. - ActivationId *string `type:"string"` -} - -// String returns the string representation -func (s CreateActivationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateActivationOutput) GoString() string { - return s.String() -} - -// SetActivationCode sets the ActivationCode field's value. -func (s *CreateActivationOutput) SetActivationCode(v string) *CreateActivationOutput { - s.ActivationCode = &v - return s -} - -// SetActivationId sets the ActivationId field's value. -func (s *CreateActivationOutput) SetActivationId(v string) *CreateActivationOutput { - s.ActivationId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatchRequest -type CreateAssociationBatchInput struct { - _ struct{} `type:"structure"` - - // One or more associations. - // - // Entries is a required field - Entries []*CreateAssociationBatchRequestEntry `locationNameList:"entries" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s CreateAssociationBatchInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssociationBatchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssociationBatchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssociationBatchInput"} - if s.Entries == nil { - invalidParams.Add(request.NewErrParamRequired("Entries")) - } - if s.Entries != nil && len(s.Entries) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Entries", 1)) - } - 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 *CreateAssociationBatchInput) SetEntries(v []*CreateAssociationBatchRequestEntry) *CreateAssociationBatchInput { - s.Entries = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatchResult -type CreateAssociationBatchOutput struct { - _ struct{} `type:"structure"` - - // Information about the associations that failed. - Failed []*FailedCreateAssociation `locationNameList:"FailedCreateAssociationEntry" type:"list"` - - // Information about the associations that succeeded. - Successful []*AssociationDescription `locationNameList:"AssociationDescription" type:"list"` -} - -// String returns the string representation -func (s CreateAssociationBatchOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssociationBatchOutput) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *CreateAssociationBatchOutput) SetFailed(v []*FailedCreateAssociation) *CreateAssociationBatchOutput { - s.Failed = v - return s -} - -// SetSuccessful sets the Successful field's value. -func (s *CreateAssociationBatchOutput) SetSuccessful(v []*AssociationDescription) *CreateAssociationBatchOutput { - s.Successful = v - return s -} - -// Describes the association of an SSM document and an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatchRequestEntry -type CreateAssociationBatchRequestEntry struct { - _ struct{} `type:"structure"` - - // The document version. - DocumentVersion *string `type:"string"` - - // The ID of the instance. - InstanceId *string `type:"string"` - - // The name of the configuration document. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // An Amazon S3 bucket where you want to store the results of this request. - OutputLocation *InstanceAssociationOutputLocation `type:"structure"` - - // A description of the parameters for a document. - Parameters map[string][]*string `type:"map"` - - // A cron expression that specifies a schedule when the association runs. - ScheduleExpression *string `min:"1" type:"string"` - - // The instances targeted by the request. - Targets []*Target `type:"list"` -} - -// String returns the string representation -func (s CreateAssociationBatchRequestEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssociationBatchRequestEntry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssociationBatchRequestEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssociationBatchRequestEntry"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.ScheduleExpression != nil && len(*s.ScheduleExpression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduleExpression", 1)) - } - if s.OutputLocation != nil { - if err := s.OutputLocation.Validate(); err != nil { - invalidParams.AddNested("OutputLocation", err.(request.ErrInvalidParams)) - } - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *CreateAssociationBatchRequestEntry) SetDocumentVersion(v string) *CreateAssociationBatchRequestEntry { - s.DocumentVersion = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateAssociationBatchRequestEntry) SetInstanceId(v string) *CreateAssociationBatchRequestEntry { - s.InstanceId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssociationBatchRequestEntry) SetName(v string) *CreateAssociationBatchRequestEntry { - s.Name = &v - return s -} - -// SetOutputLocation sets the OutputLocation field's value. -func (s *CreateAssociationBatchRequestEntry) SetOutputLocation(v *InstanceAssociationOutputLocation) *CreateAssociationBatchRequestEntry { - s.OutputLocation = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *CreateAssociationBatchRequestEntry) SetParameters(v map[string][]*string) *CreateAssociationBatchRequestEntry { - s.Parameters = v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *CreateAssociationBatchRequestEntry) SetScheduleExpression(v string) *CreateAssociationBatchRequestEntry { - s.ScheduleExpression = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *CreateAssociationBatchRequestEntry) SetTargets(v []*Target) *CreateAssociationBatchRequestEntry { - s.Targets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationRequest -type CreateAssociationInput struct { - _ struct{} `type:"structure"` - - // The document version you want to associate with the target(s). Can be a specific - // version or the default version. - DocumentVersion *string `type:"string"` - - // The instance ID. - InstanceId *string `type:"string"` - - // The name of the SSM document. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // An Amazon S3 bucket where you want to store the output details of the request. - // For example: - // - // "{ \"S3Location\": { \"OutputS3Region\": \"\", \"OutputS3BucketName\": - // \"bucket name\", \"OutputS3KeyPrefix\": \"folder name\" } }" - OutputLocation *InstanceAssociationOutputLocation `type:"structure"` - - // The parameters for the documents runtime configuration. - Parameters map[string][]*string `type:"map"` - - // A cron expression when the association will be applied to the target(s). - // Supported expressions are every half, 1, 2, 4, 8 or 12 hour(s); every specified - // day and time of the week. For example: cron(0 0/30 * 1/1 * ? *) to run every - // thirty minutes; cron(0 0 0/4 1/1 * ? *) to run every four hours; and cron(0 - // 0 10 ? * SUN *) to run every Sunday at 10 a.m. - ScheduleExpression *string `min:"1" type:"string"` - - // The targets (either instances or tags) for the association. Instances are - // specified using Key=instanceids,Values=,. Tags - // are specified using Key=,Values=. - Targets []*Target `type:"list"` -} - -// String returns the string representation -func (s CreateAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssociationInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.ScheduleExpression != nil && len(*s.ScheduleExpression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduleExpression", 1)) - } - if s.OutputLocation != nil { - if err := s.OutputLocation.Validate(); err != nil { - invalidParams.AddNested("OutputLocation", err.(request.ErrInvalidParams)) - } - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *CreateAssociationInput) SetDocumentVersion(v string) *CreateAssociationInput { - s.DocumentVersion = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateAssociationInput) SetInstanceId(v string) *CreateAssociationInput { - s.InstanceId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssociationInput) SetName(v string) *CreateAssociationInput { - s.Name = &v - return s -} - -// SetOutputLocation sets the OutputLocation field's value. -func (s *CreateAssociationInput) SetOutputLocation(v *InstanceAssociationOutputLocation) *CreateAssociationInput { - s.OutputLocation = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *CreateAssociationInput) SetParameters(v map[string][]*string) *CreateAssociationInput { - s.Parameters = v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *CreateAssociationInput) SetScheduleExpression(v string) *CreateAssociationInput { - s.ScheduleExpression = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *CreateAssociationInput) SetTargets(v []*Target) *CreateAssociationInput { - s.Targets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationResult -type CreateAssociationOutput struct { - _ struct{} `type:"structure"` - - // Information about the association. - AssociationDescription *AssociationDescription `type:"structure"` -} - -// String returns the string representation -func (s CreateAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAssociationOutput) GoString() string { - return s.String() -} - -// SetAssociationDescription sets the AssociationDescription field's value. -func (s *CreateAssociationOutput) SetAssociationDescription(v *AssociationDescription) *CreateAssociationOutput { - s.AssociationDescription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateDocumentRequest -type CreateDocumentInput struct { - _ struct{} `type:"structure"` - - // A valid JSON string. - // - // Content is a required field - Content *string `min:"1" type:"string" required:"true"` - - // The type of document to create. Valid document types include: Policy, Automation, - // and Command. - DocumentType *string `type:"string" enum:"DocumentType"` - - // A name for the SSM document. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateDocumentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDocumentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDocumentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDocumentInput"} - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *CreateDocumentInput) SetContent(v string) *CreateDocumentInput { - s.Content = &v - return s -} - -// SetDocumentType sets the DocumentType field's value. -func (s *CreateDocumentInput) SetDocumentType(v string) *CreateDocumentInput { - s.DocumentType = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDocumentInput) SetName(v string) *CreateDocumentInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateDocumentResult -type CreateDocumentOutput struct { - _ struct{} `type:"structure"` - - // Information about the SSM document. - DocumentDescription *DocumentDescription `type:"structure"` -} - -// String returns the string representation -func (s CreateDocumentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDocumentOutput) GoString() string { - return s.String() -} - -// SetDocumentDescription sets the DocumentDescription field's value. -func (s *CreateDocumentOutput) SetDocumentDescription(v *DocumentDescription) *CreateDocumentOutput { - s.DocumentDescription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateMaintenanceWindowRequest -type CreateMaintenanceWindowInput struct { - _ struct{} `type:"structure"` - - // Whether targets must be registered with the Maintenance Window before tasks - // can be defined for those targets. - // - // AllowUnassociatedTargets is a required field - AllowUnassociatedTargets *bool `type:"boolean" required:"true"` - - // User-provided idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // The number of hours before the end of the Maintenance Window that Systems - // Manager stops scheduling new tasks for execution. - // - // Cutoff is a required field - Cutoff *int64 `type:"integer" required:"true"` - - // The duration of the Maintenance Window in hours. - // - // Duration is a required field - Duration *int64 `min:"1" type:"integer" required:"true"` - - // The name of the Maintenance Window. - // - // Name is a required field - Name *string `min:"3" type:"string" required:"true"` - - // The schedule of the Maintenance Window in the form of a cron or rate expression. - // - // Schedule is a required field - Schedule *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateMaintenanceWindowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateMaintenanceWindowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMaintenanceWindowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMaintenanceWindowInput"} - if s.AllowUnassociatedTargets == nil { - invalidParams.Add(request.NewErrParamRequired("AllowUnassociatedTargets")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Cutoff == nil { - invalidParams.Add(request.NewErrParamRequired("Cutoff")) - } - if s.Duration == nil { - invalidParams.Add(request.NewErrParamRequired("Duration")) - } - if s.Duration != nil && *s.Duration < 1 { - invalidParams.Add(request.NewErrParamMinValue("Duration", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Schedule == nil { - invalidParams.Add(request.NewErrParamRequired("Schedule")) - } - if s.Schedule != nil && len(*s.Schedule) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Schedule", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowUnassociatedTargets sets the AllowUnassociatedTargets field's value. -func (s *CreateMaintenanceWindowInput) SetAllowUnassociatedTargets(v bool) *CreateMaintenanceWindowInput { - s.AllowUnassociatedTargets = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateMaintenanceWindowInput) SetClientToken(v string) *CreateMaintenanceWindowInput { - s.ClientToken = &v - return s -} - -// SetCutoff sets the Cutoff field's value. -func (s *CreateMaintenanceWindowInput) SetCutoff(v int64) *CreateMaintenanceWindowInput { - s.Cutoff = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *CreateMaintenanceWindowInput) SetDuration(v int64) *CreateMaintenanceWindowInput { - s.Duration = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateMaintenanceWindowInput) SetName(v string) *CreateMaintenanceWindowInput { - s.Name = &v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *CreateMaintenanceWindowInput) SetSchedule(v string) *CreateMaintenanceWindowInput { - s.Schedule = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateMaintenanceWindowResult -type CreateMaintenanceWindowOutput struct { - _ struct{} `type:"structure"` - - // The ID of the created Maintenance Window. - WindowId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s CreateMaintenanceWindowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateMaintenanceWindowOutput) GoString() string { - return s.String() -} - -// SetWindowId sets the WindowId field's value. -func (s *CreateMaintenanceWindowOutput) SetWindowId(v string) *CreateMaintenanceWindowOutput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreatePatchBaselineRequest -type CreatePatchBaselineInput struct { - _ struct{} `type:"structure"` - - // A set of rules used to include patches in the baseline. - ApprovalRules *PatchRuleGroup `type:"structure"` - - // A list of explicitly approved patches for the baseline. - ApprovedPatches []*string `type:"list"` - - // Caller-provided idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // A description of the patch baseline. - Description *string `min:"1" type:"string"` - - // A set of global filters used to exclude patches from the baseline. - GlobalFilters *PatchFilterGroup `type:"structure"` - - // The name of the patch baseline. - // - // Name is a required field - Name *string `min:"3" type:"string" required:"true"` - - // A list of explicitly rejected patches for the baseline. - RejectedPatches []*string `type:"list"` -} - -// String returns the string representation -func (s CreatePatchBaselineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePatchBaselineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePatchBaselineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePatchBaselineInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.ApprovalRules != nil { - if err := s.ApprovalRules.Validate(); err != nil { - invalidParams.AddNested("ApprovalRules", err.(request.ErrInvalidParams)) - } - } - if s.GlobalFilters != nil { - if err := s.GlobalFilters.Validate(); err != nil { - invalidParams.AddNested("GlobalFilters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApprovalRules sets the ApprovalRules field's value. -func (s *CreatePatchBaselineInput) SetApprovalRules(v *PatchRuleGroup) *CreatePatchBaselineInput { - s.ApprovalRules = v - return s -} - -// SetApprovedPatches sets the ApprovedPatches field's value. -func (s *CreatePatchBaselineInput) SetApprovedPatches(v []*string) *CreatePatchBaselineInput { - s.ApprovedPatches = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreatePatchBaselineInput) SetClientToken(v string) *CreatePatchBaselineInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreatePatchBaselineInput) SetDescription(v string) *CreatePatchBaselineInput { - s.Description = &v - return s -} - -// SetGlobalFilters sets the GlobalFilters field's value. -func (s *CreatePatchBaselineInput) SetGlobalFilters(v *PatchFilterGroup) *CreatePatchBaselineInput { - s.GlobalFilters = v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePatchBaselineInput) SetName(v string) *CreatePatchBaselineInput { - s.Name = &v - return s -} - -// SetRejectedPatches sets the RejectedPatches field's value. -func (s *CreatePatchBaselineInput) SetRejectedPatches(v []*string) *CreatePatchBaselineInput { - s.RejectedPatches = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreatePatchBaselineResult -type CreatePatchBaselineOutput struct { - _ struct{} `type:"structure"` - - // The ID of the created patch baseline. - BaselineId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s CreatePatchBaselineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePatchBaselineOutput) GoString() string { - return s.String() -} - -// SetBaselineId sets the BaselineId field's value. -func (s *CreatePatchBaselineOutput) SetBaselineId(v string) *CreatePatchBaselineOutput { - s.BaselineId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteActivationRequest -type DeleteActivationInput struct { - _ struct{} `type:"structure"` - - // The ID of the activation that you want to delete. - // - // ActivationId is a required field - ActivationId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteActivationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteActivationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteActivationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteActivationInput"} - if s.ActivationId == nil { - invalidParams.Add(request.NewErrParamRequired("ActivationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActivationId sets the ActivationId field's value. -func (s *DeleteActivationInput) SetActivationId(v string) *DeleteActivationInput { - s.ActivationId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteActivationResult -type DeleteActivationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteActivationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteActivationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteAssociationRequest -type DeleteAssociationInput struct { - _ struct{} `type:"structure"` - - // The association ID that you want to delete. - AssociationId *string `type:"string"` - - // The ID of the instance. - InstanceId *string `type:"string"` - - // The name of the SSM document. - Name *string `type:"string"` -} - -// String returns the string representation -func (s DeleteAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAssociationInput) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DeleteAssociationInput) SetAssociationId(v string) *DeleteAssociationInput { - s.AssociationId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DeleteAssociationInput) SetInstanceId(v string) *DeleteAssociationInput { - s.InstanceId = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteAssociationInput) SetName(v string) *DeleteAssociationInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteAssociationResult -type DeleteAssociationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAssociationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteDocumentRequest -type DeleteDocumentInput struct { - _ struct{} `type:"structure"` - - // The name of the SSM document. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteDocumentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDocumentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDocumentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDocumentInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteDocumentInput) SetName(v string) *DeleteDocumentInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteDocumentResult -type DeleteDocumentOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDocumentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDocumentOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteMaintenanceWindowRequest -type DeleteMaintenanceWindowInput struct { - _ struct{} `type:"structure"` - - // The ID of the Maintenance Window to delete. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMaintenanceWindowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMaintenanceWindowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMaintenanceWindowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMaintenanceWindowInput"} - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWindowId sets the WindowId field's value. -func (s *DeleteMaintenanceWindowInput) SetWindowId(v string) *DeleteMaintenanceWindowInput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteMaintenanceWindowResult -type DeleteMaintenanceWindowOutput struct { - _ struct{} `type:"structure"` - - // The ID of the deleted Maintenance Window. - WindowId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s DeleteMaintenanceWindowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMaintenanceWindowOutput) GoString() string { - return s.String() -} - -// SetWindowId sets the WindowId field's value. -func (s *DeleteMaintenanceWindowOutput) SetWindowId(v string) *DeleteMaintenanceWindowOutput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameterRequest -type DeleteParameterInput struct { - _ struct{} `type:"structure"` - - // The name of the parameter to delete. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteParameterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteParameterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteParameterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteParameterInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteParameterInput) SetName(v string) *DeleteParameterInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameterResult -type DeleteParameterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteParameterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteParameterOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeletePatchBaselineRequest -type DeletePatchBaselineInput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline to delete. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePatchBaselineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePatchBaselineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePatchBaselineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePatchBaselineInput"} - if s.BaselineId == nil { - invalidParams.Add(request.NewErrParamRequired("BaselineId")) - } - if s.BaselineId != nil && len(*s.BaselineId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("BaselineId", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaselineId sets the BaselineId field's value. -func (s *DeletePatchBaselineInput) SetBaselineId(v string) *DeletePatchBaselineInput { - s.BaselineId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeletePatchBaselineResult -type DeletePatchBaselineOutput struct { - _ struct{} `type:"structure"` - - // The ID of the deleted patch baseline. - BaselineId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s DeletePatchBaselineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePatchBaselineOutput) GoString() string { - return s.String() -} - -// SetBaselineId sets the BaselineId field's value. -func (s *DeletePatchBaselineOutput) SetBaselineId(v string) *DeletePatchBaselineOutput { - s.BaselineId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterManagedInstanceRequest -type DeregisterManagedInstanceInput struct { - _ struct{} `type:"structure"` - - // The ID assigned to the managed instance when you registered it using the - // activation process. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterManagedInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterManagedInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterManagedInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterManagedInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DeregisterManagedInstanceInput) SetInstanceId(v string) *DeregisterManagedInstanceInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterManagedInstanceResult -type DeregisterManagedInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterManagedInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterManagedInstanceOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterPatchBaselineForPatchGroupRequest -type DeregisterPatchBaselineForPatchGroupInput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline to deregister the patch group from. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` - - // The name of the patch group that should be deregistered from the patch baseline. - // - // PatchGroup is a required field - PatchGroup *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterPatchBaselineForPatchGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterPatchBaselineForPatchGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterPatchBaselineForPatchGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterPatchBaselineForPatchGroupInput"} - if s.BaselineId == nil { - invalidParams.Add(request.NewErrParamRequired("BaselineId")) - } - if s.BaselineId != nil && len(*s.BaselineId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("BaselineId", 20)) - } - if s.PatchGroup == nil { - invalidParams.Add(request.NewErrParamRequired("PatchGroup")) - } - if s.PatchGroup != nil && len(*s.PatchGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PatchGroup", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaselineId sets the BaselineId field's value. -func (s *DeregisterPatchBaselineForPatchGroupInput) SetBaselineId(v string) *DeregisterPatchBaselineForPatchGroupInput { - s.BaselineId = &v - return s -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *DeregisterPatchBaselineForPatchGroupInput) SetPatchGroup(v string) *DeregisterPatchBaselineForPatchGroupInput { - s.PatchGroup = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterPatchBaselineForPatchGroupResult -type DeregisterPatchBaselineForPatchGroupOutput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline the patch group was deregistered from. - BaselineId *string `min:"20" type:"string"` - - // The name of the patch group deregistered from the patch baseline. - PatchGroup *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeregisterPatchBaselineForPatchGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterPatchBaselineForPatchGroupOutput) GoString() string { - return s.String() -} - -// SetBaselineId sets the BaselineId field's value. -func (s *DeregisterPatchBaselineForPatchGroupOutput) SetBaselineId(v string) *DeregisterPatchBaselineForPatchGroupOutput { - s.BaselineId = &v - return s -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *DeregisterPatchBaselineForPatchGroupOutput) SetPatchGroup(v string) *DeregisterPatchBaselineForPatchGroupOutput { - s.PatchGroup = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTargetFromMaintenanceWindowRequest -type DeregisterTargetFromMaintenanceWindowInput struct { - _ struct{} `type:"structure"` - - // The ID of the Maintenance Window the target should be removed from. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` - - // The ID of the target definition to remove. - // - // WindowTargetId is a required field - WindowTargetId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterTargetFromMaintenanceWindowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTargetFromMaintenanceWindowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterTargetFromMaintenanceWindowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterTargetFromMaintenanceWindowInput"} - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - if s.WindowTargetId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowTargetId")) - } - if s.WindowTargetId != nil && len(*s.WindowTargetId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WindowTargetId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWindowId sets the WindowId field's value. -func (s *DeregisterTargetFromMaintenanceWindowInput) SetWindowId(v string) *DeregisterTargetFromMaintenanceWindowInput { - s.WindowId = &v - return s -} - -// SetWindowTargetId sets the WindowTargetId field's value. -func (s *DeregisterTargetFromMaintenanceWindowInput) SetWindowTargetId(v string) *DeregisterTargetFromMaintenanceWindowInput { - s.WindowTargetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTargetFromMaintenanceWindowResult -type DeregisterTargetFromMaintenanceWindowOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Maintenance Window the target was removed from. - WindowId *string `min:"20" type:"string"` - - // The ID of the removed target definition. - WindowTargetId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s DeregisterTargetFromMaintenanceWindowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTargetFromMaintenanceWindowOutput) GoString() string { - return s.String() -} - -// SetWindowId sets the WindowId field's value. -func (s *DeregisterTargetFromMaintenanceWindowOutput) SetWindowId(v string) *DeregisterTargetFromMaintenanceWindowOutput { - s.WindowId = &v - return s -} - -// SetWindowTargetId sets the WindowTargetId field's value. -func (s *DeregisterTargetFromMaintenanceWindowOutput) SetWindowTargetId(v string) *DeregisterTargetFromMaintenanceWindowOutput { - s.WindowTargetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTaskFromMaintenanceWindowRequest -type DeregisterTaskFromMaintenanceWindowInput struct { - _ struct{} `type:"structure"` - - // The ID of the Maintenance Window the task should be removed from. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` - - // The ID of the task to remove from the Maintenance Window. - // - // WindowTaskId is a required field - WindowTaskId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterTaskFromMaintenanceWindowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTaskFromMaintenanceWindowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterTaskFromMaintenanceWindowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterTaskFromMaintenanceWindowInput"} - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - if s.WindowTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowTaskId")) - } - if s.WindowTaskId != nil && len(*s.WindowTaskId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WindowTaskId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWindowId sets the WindowId field's value. -func (s *DeregisterTaskFromMaintenanceWindowInput) SetWindowId(v string) *DeregisterTaskFromMaintenanceWindowInput { - s.WindowId = &v - return s -} - -// SetWindowTaskId sets the WindowTaskId field's value. -func (s *DeregisterTaskFromMaintenanceWindowInput) SetWindowTaskId(v string) *DeregisterTaskFromMaintenanceWindowInput { - s.WindowTaskId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTaskFromMaintenanceWindowResult -type DeregisterTaskFromMaintenanceWindowOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Maintenance Window the task was removed from. - WindowId *string `min:"20" type:"string"` - - // The ID of the task removed from the Maintenance Window. - WindowTaskId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s DeregisterTaskFromMaintenanceWindowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTaskFromMaintenanceWindowOutput) GoString() string { - return s.String() -} - -// SetWindowId sets the WindowId field's value. -func (s *DeregisterTaskFromMaintenanceWindowOutput) SetWindowId(v string) *DeregisterTaskFromMaintenanceWindowOutput { - s.WindowId = &v - return s -} - -// SetWindowTaskId sets the WindowTaskId field's value. -func (s *DeregisterTaskFromMaintenanceWindowOutput) SetWindowTaskId(v string) *DeregisterTaskFromMaintenanceWindowOutput { - s.WindowTaskId = &v - return s -} - -// Filter for the DescribeActivation API. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeActivationsFilter -type DescribeActivationsFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter. - FilterKey *string `type:"string" enum:"DescribeActivationsFilterKeys"` - - // The filter values. - FilterValues []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeActivationsFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeActivationsFilter) GoString() string { - return s.String() -} - -// SetFilterKey sets the FilterKey field's value. -func (s *DescribeActivationsFilter) SetFilterKey(v string) *DescribeActivationsFilter { - s.FilterKey = &v - return s -} - -// SetFilterValues sets the FilterValues field's value. -func (s *DescribeActivationsFilter) SetFilterValues(v []*string) *DescribeActivationsFilter { - s.FilterValues = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeActivationsRequest -type DescribeActivationsInput struct { - _ struct{} `type:"structure"` - - // A filter to view information about your activations. - Filters []*DescribeActivationsFilter `type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // A token to start the list. Use this token to get the next set of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeActivationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeActivationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeActivationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeActivationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeActivationsInput) SetFilters(v []*DescribeActivationsFilter) *DescribeActivationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeActivationsInput) SetMaxResults(v int64) *DescribeActivationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeActivationsInput) SetNextToken(v string) *DescribeActivationsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeActivationsResult -type DescribeActivationsOutput struct { - _ struct{} `type:"structure"` - - // A list of activations for your AWS account. - ActivationList []*Activation `type:"list"` - - // The token for the next set of items to return. Use this token to get the - // next set of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeActivationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeActivationsOutput) GoString() string { - return s.String() -} - -// SetActivationList sets the ActivationList field's value. -func (s *DescribeActivationsOutput) SetActivationList(v []*Activation) *DescribeActivationsOutput { - s.ActivationList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeActivationsOutput) SetNextToken(v string) *DescribeActivationsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociationRequest -type DescribeAssociationInput struct { - _ struct{} `type:"structure"` - - // The association ID for which you want information. - AssociationId *string `type:"string"` - - // The instance ID. - InstanceId *string `type:"string"` - - // The name of the SSM document. - Name *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAssociationInput) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DescribeAssociationInput) SetAssociationId(v string) *DescribeAssociationInput { - s.AssociationId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeAssociationInput) SetInstanceId(v string) *DescribeAssociationInput { - s.InstanceId = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeAssociationInput) SetName(v string) *DescribeAssociationInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociationResult -type DescribeAssociationOutput struct { - _ struct{} `type:"structure"` - - // Information about the association. - AssociationDescription *AssociationDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAssociationOutput) GoString() string { - return s.String() -} - -// SetAssociationDescription sets the AssociationDescription field's value. -func (s *DescribeAssociationOutput) SetAssociationDescription(v *AssociationDescription) *DescribeAssociationOutput { - s.AssociationDescription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationExecutionsRequest -type DescribeAutomationExecutionsInput struct { - _ struct{} `type:"structure"` - - // Filters used to limit the scope of executions that are requested. - Filters []*AutomationExecutionFilter `min:"1" type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAutomationExecutionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAutomationExecutionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAutomationExecutionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAutomationExecutionsInput"} - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeAutomationExecutionsInput) SetFilters(v []*AutomationExecutionFilter) *DescribeAutomationExecutionsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeAutomationExecutionsInput) SetMaxResults(v int64) *DescribeAutomationExecutionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAutomationExecutionsInput) SetNextToken(v string) *DescribeAutomationExecutionsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationExecutionsResult -type DescribeAutomationExecutionsOutput struct { - _ struct{} `type:"structure"` - - // The list of details about each automation execution which has occurred which - // matches the filter specification, if any. - AutomationExecutionMetadataList []*AutomationExecutionMetadata `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeAutomationExecutionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAutomationExecutionsOutput) GoString() string { - return s.String() -} - -// SetAutomationExecutionMetadataList sets the AutomationExecutionMetadataList field's value. -func (s *DescribeAutomationExecutionsOutput) SetAutomationExecutionMetadataList(v []*AutomationExecutionMetadata) *DescribeAutomationExecutionsOutput { - s.AutomationExecutionMetadataList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAutomationExecutionsOutput) SetNextToken(v string) *DescribeAutomationExecutionsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAvailablePatchesRequest -type DescribeAvailablePatchesInput struct { - _ struct{} `type:"structure"` - - // Filters used to scope down the returned patches. - Filters []*PatchOrchestratorFilter `type:"list"` - - // The maximum number of patches to return (per page). - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAvailablePatchesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAvailablePatchesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAvailablePatchesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAvailablePatchesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeAvailablePatchesInput) SetFilters(v []*PatchOrchestratorFilter) *DescribeAvailablePatchesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeAvailablePatchesInput) SetMaxResults(v int64) *DescribeAvailablePatchesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAvailablePatchesInput) SetNextToken(v string) *DescribeAvailablePatchesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAvailablePatchesResult -type DescribeAvailablePatchesOutput 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 `type:"string"` - - // An array of patches. Each entry in the array is a patch structure. - Patches []*Patch `type:"list"` -} - -// String returns the string representation -func (s DescribeAvailablePatchesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAvailablePatchesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAvailablePatchesOutput) SetNextToken(v string) *DescribeAvailablePatchesOutput { - s.NextToken = &v - return s -} - -// SetPatches sets the Patches field's value. -func (s *DescribeAvailablePatchesOutput) SetPatches(v []*Patch) *DescribeAvailablePatchesOutput { - s.Patches = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocumentRequest -type DescribeDocumentInput struct { - _ struct{} `type:"structure"` - - // The document version for which you want information. Can be a specific version - // or the default version. - DocumentVersion *string `type:"string"` - - // The name of the SSM document. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeDocumentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDocumentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDocumentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDocumentInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *DescribeDocumentInput) SetDocumentVersion(v string) *DescribeDocumentInput { - s.DocumentVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeDocumentInput) SetName(v string) *DescribeDocumentInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocumentResult -type DescribeDocumentOutput struct { - _ struct{} `type:"structure"` - - // Information about the SSM document. - Document *DocumentDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeDocumentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDocumentOutput) GoString() string { - return s.String() -} - -// SetDocument sets the Document field's value. -func (s *DescribeDocumentOutput) SetDocument(v *DocumentDescription) *DescribeDocumentOutput { - s.Document = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocumentPermissionRequest -type DescribeDocumentPermissionInput struct { - _ struct{} `type:"structure"` - - // The name of the document for which you are the owner. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The permission type for the document. The permission type can be Share. - // - // PermissionType is a required field - PermissionType *string `type:"string" required:"true" enum:"DocumentPermissionType"` -} - -// String returns the string representation -func (s DescribeDocumentPermissionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDocumentPermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDocumentPermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDocumentPermissionInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.PermissionType == nil { - invalidParams.Add(request.NewErrParamRequired("PermissionType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DescribeDocumentPermissionInput) SetName(v string) *DescribeDocumentPermissionInput { - s.Name = &v - return s -} - -// SetPermissionType sets the PermissionType field's value. -func (s *DescribeDocumentPermissionInput) SetPermissionType(v string) *DescribeDocumentPermissionInput { - s.PermissionType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocumentPermissionResponse -type DescribeDocumentPermissionOutput struct { - _ struct{} `type:"structure"` - - // The account IDs that have permission to use this document. The ID can be - // either an AWS account or All. - AccountIds []*string `locationNameList:"AccountId" type:"list"` -} - -// String returns the string representation -func (s DescribeDocumentPermissionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDocumentPermissionOutput) GoString() string { - return s.String() -} - -// SetAccountIds sets the AccountIds field's value. -func (s *DescribeDocumentPermissionOutput) SetAccountIds(v []*string) *DescribeDocumentPermissionOutput { - s.AccountIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectiveInstanceAssociationsRequest -type DescribeEffectiveInstanceAssociationsInput struct { - _ struct{} `type:"structure"` - - // The instance ID for which you want to view all associations. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEffectiveInstanceAssociationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEffectiveInstanceAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEffectiveInstanceAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEffectiveInstanceAssociationsInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeEffectiveInstanceAssociationsInput) SetInstanceId(v string) *DescribeEffectiveInstanceAssociationsInput { - s.InstanceId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeEffectiveInstanceAssociationsInput) SetMaxResults(v int64) *DescribeEffectiveInstanceAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEffectiveInstanceAssociationsInput) SetNextToken(v string) *DescribeEffectiveInstanceAssociationsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectiveInstanceAssociationsResult -type DescribeEffectiveInstanceAssociationsOutput struct { - _ struct{} `type:"structure"` - - // The associations for the requested instance. - Associations []*InstanceAssociation `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeEffectiveInstanceAssociationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEffectiveInstanceAssociationsOutput) GoString() string { - return s.String() -} - -// SetAssociations sets the Associations field's value. -func (s *DescribeEffectiveInstanceAssociationsOutput) SetAssociations(v []*InstanceAssociation) *DescribeEffectiveInstanceAssociationsOutput { - s.Associations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEffectiveInstanceAssociationsOutput) SetNextToken(v string) *DescribeEffectiveInstanceAssociationsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectivePatchesForPatchBaselineRequest -type DescribeEffectivePatchesForPatchBaselineInput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline to retrieve the effective patches for. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` - - // The maximum number of patches to return (per page). - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEffectivePatchesForPatchBaselineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEffectivePatchesForPatchBaselineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEffectivePatchesForPatchBaselineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEffectivePatchesForPatchBaselineInput"} - if s.BaselineId == nil { - invalidParams.Add(request.NewErrParamRequired("BaselineId")) - } - if s.BaselineId != nil && len(*s.BaselineId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("BaselineId", 20)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaselineId sets the BaselineId field's value. -func (s *DescribeEffectivePatchesForPatchBaselineInput) SetBaselineId(v string) *DescribeEffectivePatchesForPatchBaselineInput { - s.BaselineId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeEffectivePatchesForPatchBaselineInput) SetMaxResults(v int64) *DescribeEffectivePatchesForPatchBaselineInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEffectivePatchesForPatchBaselineInput) SetNextToken(v string) *DescribeEffectivePatchesForPatchBaselineInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectivePatchesForPatchBaselineResult -type DescribeEffectivePatchesForPatchBaselineOutput struct { - _ struct{} `type:"structure"` - - // An array of patches and patch status. - EffectivePatches []*EffectivePatch `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeEffectivePatchesForPatchBaselineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEffectivePatchesForPatchBaselineOutput) GoString() string { - return s.String() -} - -// SetEffectivePatches sets the EffectivePatches field's value. -func (s *DescribeEffectivePatchesForPatchBaselineOutput) SetEffectivePatches(v []*EffectivePatch) *DescribeEffectivePatchesForPatchBaselineOutput { - s.EffectivePatches = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEffectivePatchesForPatchBaselineOutput) SetNextToken(v string) *DescribeEffectivePatchesForPatchBaselineOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceAssociationsStatusRequest -type DescribeInstanceAssociationsStatusInput struct { - _ struct{} `type:"structure"` - - // The instance IDs for which you want association status information. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceAssociationsStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceAssociationsStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstanceAssociationsStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceAssociationsStatusInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceAssociationsStatusInput) SetInstanceId(v string) *DescribeInstanceAssociationsStatusInput { - s.InstanceId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstanceAssociationsStatusInput) SetMaxResults(v int64) *DescribeInstanceAssociationsStatusInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceAssociationsStatusInput) SetNextToken(v string) *DescribeInstanceAssociationsStatusInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceAssociationsStatusResult -type DescribeInstanceAssociationsStatusOutput struct { - _ struct{} `type:"structure"` - - // Status information about the association. - InstanceAssociationStatusInfos []*InstanceAssociationStatusInfo `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceAssociationsStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceAssociationsStatusOutput) GoString() string { - return s.String() -} - -// SetInstanceAssociationStatusInfos sets the InstanceAssociationStatusInfos field's value. -func (s *DescribeInstanceAssociationsStatusOutput) SetInstanceAssociationStatusInfos(v []*InstanceAssociationStatusInfo) *DescribeInstanceAssociationsStatusOutput { - s.InstanceAssociationStatusInfos = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceAssociationsStatusOutput) SetNextToken(v string) *DescribeInstanceAssociationsStatusOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceInformationRequest -type DescribeInstanceInformationInput struct { - _ struct{} `type:"structure"` - - // One or more filters. Use a filter to return a more specific list of instances. - Filters []*InstanceInformationStringFilter `locationNameList:"InstanceInformationStringFilter" type:"list"` - - // One or more filters. Use a filter to return a more specific list of instances. - InstanceInformationFilterList []*InstanceInformationFilter `locationNameList:"InstanceInformationFilter" type:"list"` - - // The maximum number of items to return for this call. The call also 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 previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceInformationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceInformationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstanceInformationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceInformationInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - if s.InstanceInformationFilterList != nil { - for i, v := range s.InstanceInformationFilterList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InstanceInformationFilterList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInstanceInformationInput) SetFilters(v []*InstanceInformationStringFilter) *DescribeInstanceInformationInput { - s.Filters = v - return s -} - -// SetInstanceInformationFilterList sets the InstanceInformationFilterList field's value. -func (s *DescribeInstanceInformationInput) SetInstanceInformationFilterList(v []*InstanceInformationFilter) *DescribeInstanceInformationInput { - s.InstanceInformationFilterList = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstanceInformationInput) SetMaxResults(v int64) *DescribeInstanceInformationInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceInformationInput) SetNextToken(v string) *DescribeInstanceInformationInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceInformationResult -type DescribeInstanceInformationOutput struct { - _ struct{} `type:"structure"` - - // The instance information list. - InstanceInformationList []*InstanceInformation `locationNameList:"InstanceInformation" type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceInformationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceInformationOutput) GoString() string { - return s.String() -} - -// SetInstanceInformationList sets the InstanceInformationList field's value. -func (s *DescribeInstanceInformationOutput) SetInstanceInformationList(v []*InstanceInformation) *DescribeInstanceInformationOutput { - s.InstanceInformationList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceInformationOutput) SetNextToken(v string) *DescribeInstanceInformationOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesForPatchGroupRequest -type DescribeInstancePatchStatesForPatchGroupInput struct { - _ struct{} `type:"structure"` - - // Each entry in the array is a structure containing: - // - // Key (string 1 ≤ length ≤ 200) - // - // Values (array containing a single string) - // - // Type (string “Equal”, “NotEqual”, “LessThan”, “GreaterThan”) - Filters []*InstancePatchStateFilter `type:"list"` - - // The maximum number of patches to return (per page). - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The name of the patch group for which the patch state information should - // be retrieved. - // - // PatchGroup is a required field - PatchGroup *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeInstancePatchStatesForPatchGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancePatchStatesForPatchGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstancePatchStatesForPatchGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstancePatchStatesForPatchGroupInput"} - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - if s.PatchGroup == nil { - invalidParams.Add(request.NewErrParamRequired("PatchGroup")) - } - if s.PatchGroup != nil && len(*s.PatchGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PatchGroup", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInstancePatchStatesForPatchGroupInput) SetFilters(v []*InstancePatchStateFilter) *DescribeInstancePatchStatesForPatchGroupInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstancePatchStatesForPatchGroupInput) SetMaxResults(v int64) *DescribeInstancePatchStatesForPatchGroupInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancePatchStatesForPatchGroupInput) SetNextToken(v string) *DescribeInstancePatchStatesForPatchGroupInput { - s.NextToken = &v - return s -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *DescribeInstancePatchStatesForPatchGroupInput) SetPatchGroup(v string) *DescribeInstancePatchStatesForPatchGroupInput { - s.PatchGroup = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesForPatchGroupResult -type DescribeInstancePatchStatesForPatchGroupOutput struct { - _ struct{} `type:"structure"` - - // The high-level patch state for the requested instances. - InstancePatchStates []*InstancePatchState `min:"1" type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeInstancePatchStatesForPatchGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancePatchStatesForPatchGroupOutput) GoString() string { - return s.String() -} - -// SetInstancePatchStates sets the InstancePatchStates field's value. -func (s *DescribeInstancePatchStatesForPatchGroupOutput) SetInstancePatchStates(v []*InstancePatchState) *DescribeInstancePatchStatesForPatchGroupOutput { - s.InstancePatchStates = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancePatchStatesForPatchGroupOutput) SetNextToken(v string) *DescribeInstancePatchStatesForPatchGroupOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesRequest -type DescribeInstancePatchStatesInput struct { - _ struct{} `type:"structure"` - - // The ID of the instance whose patch state information should be retrieved. - // - // InstanceIds is a required field - InstanceIds []*string `type:"list" required:"true"` - - // The maximum number of instances to return (per page). - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstancePatchStatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancePatchStatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstancePatchStatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstancePatchStatesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstancePatchStatesInput) SetInstanceIds(v []*string) *DescribeInstancePatchStatesInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstancePatchStatesInput) SetMaxResults(v int64) *DescribeInstancePatchStatesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancePatchStatesInput) SetNextToken(v string) *DescribeInstancePatchStatesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesResult -type DescribeInstancePatchStatesOutput struct { - _ struct{} `type:"structure"` - - // The high-level patch state for the requested instances. - InstancePatchStates []*InstancePatchState `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribeInstancePatchStatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancePatchStatesOutput) GoString() string { - return s.String() -} - -// SetInstancePatchStates sets the InstancePatchStates field's value. -func (s *DescribeInstancePatchStatesOutput) SetInstancePatchStates(v []*InstancePatchState) *DescribeInstancePatchStatesOutput { - s.InstancePatchStates = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancePatchStatesOutput) SetNextToken(v string) *DescribeInstancePatchStatesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchesRequest -type DescribeInstancePatchesInput struct { - _ struct{} `type:"structure"` - - // Each entry in the array is a structure containing: - // - // Key (string, 1 ≤ length ≤ 128) - // - // Values (array of strings 1 ≤ length ≤ 256) - Filters []*PatchOrchestratorFilter `type:"list"` - - // The ID of the instance whose patch state information should be retrieved. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The maximum number of patches to return (per page). - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstancePatchesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancePatchesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstancePatchesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstancePatchesInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInstancePatchesInput) SetFilters(v []*PatchOrchestratorFilter) *DescribeInstancePatchesInput { - s.Filters = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstancePatchesInput) SetInstanceId(v string) *DescribeInstancePatchesInput { - s.InstanceId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstancePatchesInput) SetMaxResults(v int64) *DescribeInstancePatchesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancePatchesInput) SetNextToken(v string) *DescribeInstancePatchesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchesResult -type DescribeInstancePatchesOutput 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 `type:"string"` - - // Each entry in the array is a structure containing: - // - // Title (string) - // - // KBId (string) - // - // Classification (string) - // - // Severity (string) - // - // State (string – “INSTALLED”, “INSTALLED_OTHER”, “MISSING”, “NOT_APPLICABLE”, - // “FAILED”) - // - // InstalledTime (DateTime) - // - // InstalledBy (string) - Patches []*PatchComplianceData `type:"list"` -} - -// String returns the string representation -func (s DescribeInstancePatchesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancePatchesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancePatchesOutput) SetNextToken(v string) *DescribeInstancePatchesOutput { - s.NextToken = &v - return s -} - -// SetPatches sets the Patches field's value. -func (s *DescribeInstancePatchesOutput) SetPatches(v []*PatchComplianceData) *DescribeInstancePatchesOutput { - s.Patches = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTaskInvocationsRequest -type DescribeMaintenanceWindowExecutionTaskInvocationsInput struct { - _ struct{} `type:"structure"` - - // Optional filters used to scope down the returned task invocations. The supported - // filter key is STATUS with the corresponding values PENDING, IN_PROGRESS, - // SUCCESS, FAILED, TIMED_OUT, CANCELLING, and CANCELLED. - Filters []*MaintenanceWindowFilter `type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The ID of the specific task in the Maintenance Window task that should be - // retrieved. - // - // TaskId is a required field - TaskId *string `min:"36" type:"string" required:"true"` - - // The ID of the Maintenance Window execution the task is part of. - // - // WindowExecutionId is a required field - WindowExecutionId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowExecutionTaskInvocationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowExecutionTaskInvocationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMaintenanceWindowExecutionTaskInvocationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMaintenanceWindowExecutionTaskInvocationsInput"} - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - if s.TaskId == nil { - invalidParams.Add(request.NewErrParamRequired("TaskId")) - } - if s.TaskId != nil && len(*s.TaskId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TaskId", 36)) - } - if s.WindowExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowExecutionId")) - } - if s.WindowExecutionId != nil && len(*s.WindowExecutionId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WindowExecutionId", 36)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeMaintenanceWindowExecutionTaskInvocationsInput) SetFilters(v []*MaintenanceWindowFilter) *DescribeMaintenanceWindowExecutionTaskInvocationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeMaintenanceWindowExecutionTaskInvocationsInput) SetMaxResults(v int64) *DescribeMaintenanceWindowExecutionTaskInvocationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowExecutionTaskInvocationsInput) SetNextToken(v string) *DescribeMaintenanceWindowExecutionTaskInvocationsInput { - s.NextToken = &v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *DescribeMaintenanceWindowExecutionTaskInvocationsInput) SetTaskId(v string) *DescribeMaintenanceWindowExecutionTaskInvocationsInput { - s.TaskId = &v - return s -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *DescribeMaintenanceWindowExecutionTaskInvocationsInput) SetWindowExecutionId(v string) *DescribeMaintenanceWindowExecutionTaskInvocationsInput { - s.WindowExecutionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTaskInvocationsResult -type DescribeMaintenanceWindowExecutionTaskInvocationsOutput 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 `type:"string"` - - // Information about the task invocation results per invocation. - WindowExecutionTaskInvocationIdentities []*MaintenanceWindowExecutionTaskInvocationIdentity `type:"list"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowExecutionTaskInvocationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowExecutionTaskInvocationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowExecutionTaskInvocationsOutput) SetNextToken(v string) *DescribeMaintenanceWindowExecutionTaskInvocationsOutput { - s.NextToken = &v - return s -} - -// SetWindowExecutionTaskInvocationIdentities sets the WindowExecutionTaskInvocationIdentities field's value. -func (s *DescribeMaintenanceWindowExecutionTaskInvocationsOutput) SetWindowExecutionTaskInvocationIdentities(v []*MaintenanceWindowExecutionTaskInvocationIdentity) *DescribeMaintenanceWindowExecutionTaskInvocationsOutput { - s.WindowExecutionTaskInvocationIdentities = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTasksRequest -type DescribeMaintenanceWindowExecutionTasksInput struct { - _ struct{} `type:"structure"` - - // Optional filters used to scope down the returned tasks. The supported filter - // key is STATUS with the corresponding values PENDING, IN_PROGRESS, SUCCESS, - // FAILED, TIMED_OUT, CANCELLING, and CANCELLED. - Filters []*MaintenanceWindowFilter `type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The ID of the Maintenance Window execution whose task executions should be - // retrieved. - // - // WindowExecutionId is a required field - WindowExecutionId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowExecutionTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowExecutionTasksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMaintenanceWindowExecutionTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMaintenanceWindowExecutionTasksInput"} - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - if s.WindowExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowExecutionId")) - } - if s.WindowExecutionId != nil && len(*s.WindowExecutionId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WindowExecutionId", 36)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeMaintenanceWindowExecutionTasksInput) SetFilters(v []*MaintenanceWindowFilter) *DescribeMaintenanceWindowExecutionTasksInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeMaintenanceWindowExecutionTasksInput) SetMaxResults(v int64) *DescribeMaintenanceWindowExecutionTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowExecutionTasksInput) SetNextToken(v string) *DescribeMaintenanceWindowExecutionTasksInput { - s.NextToken = &v - return s -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *DescribeMaintenanceWindowExecutionTasksInput) SetWindowExecutionId(v string) *DescribeMaintenanceWindowExecutionTasksInput { - s.WindowExecutionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTasksResult -type DescribeMaintenanceWindowExecutionTasksOutput 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 `type:"string"` - - // Information about the task executions. - WindowExecutionTaskIdentities []*MaintenanceWindowExecutionTaskIdentity `type:"list"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowExecutionTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowExecutionTasksOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowExecutionTasksOutput) SetNextToken(v string) *DescribeMaintenanceWindowExecutionTasksOutput { - s.NextToken = &v - return s -} - -// SetWindowExecutionTaskIdentities sets the WindowExecutionTaskIdentities field's value. -func (s *DescribeMaintenanceWindowExecutionTasksOutput) SetWindowExecutionTaskIdentities(v []*MaintenanceWindowExecutionTaskIdentity) *DescribeMaintenanceWindowExecutionTasksOutput { - s.WindowExecutionTaskIdentities = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionsRequest -type DescribeMaintenanceWindowExecutionsInput struct { - _ struct{} `type:"structure"` - - // Each entry in the array is a structure containing: - // - // Key (string, 1 ≤ length ≤ 128) - // - // Values (array of strings 1 ≤ length ≤ 256) - // - // The supported Keys are ExecutedBefore and ExecutedAfter with the value being - // a date/time string such as 2016-11-04T05:00:00Z. - Filters []*MaintenanceWindowFilter `type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The ID of the Maintenance Window whose executions should be retrieved. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowExecutionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowExecutionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMaintenanceWindowExecutionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMaintenanceWindowExecutionsInput"} - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeMaintenanceWindowExecutionsInput) SetFilters(v []*MaintenanceWindowFilter) *DescribeMaintenanceWindowExecutionsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeMaintenanceWindowExecutionsInput) SetMaxResults(v int64) *DescribeMaintenanceWindowExecutionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowExecutionsInput) SetNextToken(v string) *DescribeMaintenanceWindowExecutionsInput { - s.NextToken = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *DescribeMaintenanceWindowExecutionsInput) SetWindowId(v string) *DescribeMaintenanceWindowExecutionsInput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionsResult -type DescribeMaintenanceWindowExecutionsOutput 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 `type:"string"` - - // Information about the Maintenance Windows execution. - WindowExecutions []*MaintenanceWindowExecution `type:"list"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowExecutionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowExecutionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowExecutionsOutput) SetNextToken(v string) *DescribeMaintenanceWindowExecutionsOutput { - s.NextToken = &v - return s -} - -// SetWindowExecutions sets the WindowExecutions field's value. -func (s *DescribeMaintenanceWindowExecutionsOutput) SetWindowExecutions(v []*MaintenanceWindowExecution) *DescribeMaintenanceWindowExecutionsOutput { - s.WindowExecutions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTargetsRequest -type DescribeMaintenanceWindowTargetsInput struct { - _ struct{} `type:"structure"` - - // Optional filters that can be used to narrow down the scope of the returned - // window targets. The supported filter keys are Type, WindowTargetId and OwnerInformation. - Filters []*MaintenanceWindowFilter `type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The ID of the Maintenance Window whose targets should be retrieved. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowTargetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMaintenanceWindowTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMaintenanceWindowTargetsInput"} - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeMaintenanceWindowTargetsInput) SetFilters(v []*MaintenanceWindowFilter) *DescribeMaintenanceWindowTargetsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeMaintenanceWindowTargetsInput) SetMaxResults(v int64) *DescribeMaintenanceWindowTargetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowTargetsInput) SetNextToken(v string) *DescribeMaintenanceWindowTargetsInput { - s.NextToken = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *DescribeMaintenanceWindowTargetsInput) SetWindowId(v string) *DescribeMaintenanceWindowTargetsInput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTargetsResult -type DescribeMaintenanceWindowTargetsOutput 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 `type:"string"` - - // Information about the targets in the Maintenance Window. - Targets []*MaintenanceWindowTarget `type:"list"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowTargetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowTargetsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowTargetsOutput) SetNextToken(v string) *DescribeMaintenanceWindowTargetsOutput { - s.NextToken = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *DescribeMaintenanceWindowTargetsOutput) SetTargets(v []*MaintenanceWindowTarget) *DescribeMaintenanceWindowTargetsOutput { - s.Targets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTasksRequest -type DescribeMaintenanceWindowTasksInput struct { - _ struct{} `type:"structure"` - - // Optional filters used to narrow down the scope of the returned tasks. The - // supported filter keys are WindowTaskId, TaskArn, Priority, and TaskType. - Filters []*MaintenanceWindowFilter `type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The ID of the Maintenance Window whose tasks should be retrieved. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowTasksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMaintenanceWindowTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMaintenanceWindowTasksInput"} - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeMaintenanceWindowTasksInput) SetFilters(v []*MaintenanceWindowFilter) *DescribeMaintenanceWindowTasksInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeMaintenanceWindowTasksInput) SetMaxResults(v int64) *DescribeMaintenanceWindowTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowTasksInput) SetNextToken(v string) *DescribeMaintenanceWindowTasksInput { - s.NextToken = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *DescribeMaintenanceWindowTasksInput) SetWindowId(v string) *DescribeMaintenanceWindowTasksInput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTasksResult -type DescribeMaintenanceWindowTasksOutput 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 `type:"string"` - - // Information about the tasks in the Maintenance Window. - Tasks []*MaintenanceWindowTask `type:"list"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowTasksOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowTasksOutput) SetNextToken(v string) *DescribeMaintenanceWindowTasksOutput { - s.NextToken = &v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *DescribeMaintenanceWindowTasksOutput) SetTasks(v []*MaintenanceWindowTask) *DescribeMaintenanceWindowTasksOutput { - s.Tasks = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowsRequest -type DescribeMaintenanceWindowsInput struct { - _ struct{} `type:"structure"` - - // Optional filters used to narrow down the scope of the returned Maintenance - // Windows. Supported filter keys are Name and Enabled. - Filters []*MaintenanceWindowFilter `type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"10" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMaintenanceWindowsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMaintenanceWindowsInput"} - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeMaintenanceWindowsInput) SetFilters(v []*MaintenanceWindowFilter) *DescribeMaintenanceWindowsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeMaintenanceWindowsInput) SetMaxResults(v int64) *DescribeMaintenanceWindowsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowsInput) SetNextToken(v string) *DescribeMaintenanceWindowsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowsResult -type DescribeMaintenanceWindowsOutput 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 `type:"string"` - - // Information about the Maintenance Windows. - WindowIdentities []*MaintenanceWindowIdentity `type:"list"` -} - -// String returns the string representation -func (s DescribeMaintenanceWindowsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMaintenanceWindowsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMaintenanceWindowsOutput) SetNextToken(v string) *DescribeMaintenanceWindowsOutput { - s.NextToken = &v - return s -} - -// SetWindowIdentities sets the WindowIdentities field's value. -func (s *DescribeMaintenanceWindowsOutput) SetWindowIdentities(v []*MaintenanceWindowIdentity) *DescribeMaintenanceWindowsOutput { - s.WindowIdentities = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeParametersRequest -type DescribeParametersInput struct { - _ struct{} `type:"structure"` - - // One or more filters. Use a filter to return a more specific list of results. - Filters []*ParametersFilter `type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeParametersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribeParametersInput) SetFilters(v []*ParametersFilter) *DescribeParametersInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeParametersInput) SetMaxResults(v int64) *DescribeParametersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeParametersInput) SetNextToken(v string) *DescribeParametersInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeParametersResult -type DescribeParametersOutput 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 `type:"string"` - - // Parameters returned by the request. - Parameters []*ParameterMetadata `type:"list"` -} - -// String returns the string representation -func (s DescribeParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeParametersOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeParametersOutput) SetNextToken(v string) *DescribeParametersOutput { - s.NextToken = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DescribeParametersOutput) SetParameters(v []*ParameterMetadata) *DescribeParametersOutput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchBaselinesRequest -type DescribePatchBaselinesInput struct { - _ struct{} `type:"structure"` - - // Each element in the array is a structure containing: - // - // Key: (string, “NAME_PREFIX” or “OWNER”) - // - // Value: (array of strings, exactly 1 entry, 1 ≤ length ≤ 255) - Filters []*PatchOrchestratorFilter `type:"list"` - - // The maximum number of patch baselines to return (per page). - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribePatchBaselinesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePatchBaselinesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribePatchBaselinesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribePatchBaselinesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *DescribePatchBaselinesInput) SetFilters(v []*PatchOrchestratorFilter) *DescribePatchBaselinesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribePatchBaselinesInput) SetMaxResults(v int64) *DescribePatchBaselinesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePatchBaselinesInput) SetNextToken(v string) *DescribePatchBaselinesInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchBaselinesResult -type DescribePatchBaselinesOutput struct { - _ struct{} `type:"structure"` - - // An array of PatchBaselineIdentity elements. - BaselineIdentities []*PatchBaselineIdentity `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribePatchBaselinesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePatchBaselinesOutput) GoString() string { - return s.String() -} - -// SetBaselineIdentities sets the BaselineIdentities field's value. -func (s *DescribePatchBaselinesOutput) SetBaselineIdentities(v []*PatchBaselineIdentity) *DescribePatchBaselinesOutput { - s.BaselineIdentities = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePatchBaselinesOutput) SetNextToken(v string) *DescribePatchBaselinesOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupStateRequest -type DescribePatchGroupStateInput struct { - _ struct{} `type:"structure"` - - // The name of the patch group whose patch snapshot should be retrieved. - // - // PatchGroup is a required field - PatchGroup *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribePatchGroupStateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePatchGroupStateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribePatchGroupStateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribePatchGroupStateInput"} - if s.PatchGroup == nil { - invalidParams.Add(request.NewErrParamRequired("PatchGroup")) - } - if s.PatchGroup != nil && len(*s.PatchGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PatchGroup", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *DescribePatchGroupStateInput) SetPatchGroup(v string) *DescribePatchGroupStateInput { - s.PatchGroup = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupStateResult -type DescribePatchGroupStateOutput struct { - _ struct{} `type:"structure"` - - // The number of instances in the patch group. - Instances *int64 `type:"integer"` - - // The number of instances with patches from the patch baseline that failed - // to install. - InstancesWithFailedPatches *int64 `type:"integer"` - - // The number of instances with patches installed that aren’t defined in the - // patch baseline. - InstancesWithInstalledOtherPatches *int64 `type:"integer"` - - // The number of instances with installed patches. - InstancesWithInstalledPatches *int64 `type:"integer"` - - // The number of instances with missing patches from the patch baseline. - InstancesWithMissingPatches *int64 `type:"integer"` - - // The number of instances with patches that aren’t applicable. - InstancesWithNotApplicablePatches *int64 `type:"integer"` -} - -// String returns the string representation -func (s DescribePatchGroupStateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePatchGroupStateOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *DescribePatchGroupStateOutput) SetInstances(v int64) *DescribePatchGroupStateOutput { - s.Instances = &v - return s -} - -// SetInstancesWithFailedPatches sets the InstancesWithFailedPatches field's value. -func (s *DescribePatchGroupStateOutput) SetInstancesWithFailedPatches(v int64) *DescribePatchGroupStateOutput { - s.InstancesWithFailedPatches = &v - return s -} - -// SetInstancesWithInstalledOtherPatches sets the InstancesWithInstalledOtherPatches field's value. -func (s *DescribePatchGroupStateOutput) SetInstancesWithInstalledOtherPatches(v int64) *DescribePatchGroupStateOutput { - s.InstancesWithInstalledOtherPatches = &v - return s -} - -// SetInstancesWithInstalledPatches sets the InstancesWithInstalledPatches field's value. -func (s *DescribePatchGroupStateOutput) SetInstancesWithInstalledPatches(v int64) *DescribePatchGroupStateOutput { - s.InstancesWithInstalledPatches = &v - return s -} - -// SetInstancesWithMissingPatches sets the InstancesWithMissingPatches field's value. -func (s *DescribePatchGroupStateOutput) SetInstancesWithMissingPatches(v int64) *DescribePatchGroupStateOutput { - s.InstancesWithMissingPatches = &v - return s -} - -// SetInstancesWithNotApplicablePatches sets the InstancesWithNotApplicablePatches field's value. -func (s *DescribePatchGroupStateOutput) SetInstancesWithNotApplicablePatches(v int64) *DescribePatchGroupStateOutput { - s.InstancesWithNotApplicablePatches = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupsRequest -type DescribePatchGroupsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of patch groups to return (per page). - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribePatchGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePatchGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribePatchGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribePatchGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribePatchGroupsInput) SetMaxResults(v int64) *DescribePatchGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePatchGroupsInput) SetNextToken(v string) *DescribePatchGroupsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupsResult -type DescribePatchGroupsOutput struct { - _ struct{} `type:"structure"` - - // Each entry in the array contains: - // - // PatchGroup: string (1 ≤ length ≤ 256, Regex: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$) - // - // PatchBaselineIdentity: A PatchBaselineIdentity element. - Mappings []*PatchGroupPatchBaselineMapping `type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s DescribePatchGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePatchGroupsOutput) GoString() string { - return s.String() -} - -// SetMappings sets the Mappings field's value. -func (s *DescribePatchGroupsOutput) SetMappings(v []*PatchGroupPatchBaselineMapping) *DescribePatchGroupsOutput { - s.Mappings = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePatchGroupsOutput) SetNextToken(v string) *DescribePatchGroupsOutput { - s.NextToken = &v - return s -} - -// A default version of a document. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DocumentDefaultVersionDescription -type DocumentDefaultVersionDescription struct { - _ struct{} `type:"structure"` - - // The default version of the document. - DefaultVersion *string `type:"string"` - - // The name of the document. - Name *string `type:"string"` -} - -// String returns the string representation -func (s DocumentDefaultVersionDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentDefaultVersionDescription) GoString() string { - return s.String() -} - -// SetDefaultVersion sets the DefaultVersion field's value. -func (s *DocumentDefaultVersionDescription) SetDefaultVersion(v string) *DocumentDefaultVersionDescription { - s.DefaultVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *DocumentDefaultVersionDescription) SetName(v string) *DocumentDefaultVersionDescription { - s.Name = &v - return s -} - -// Describes an SSM document. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DocumentDescription -type DocumentDescription struct { - _ struct{} `type:"structure"` - - // The date when the SSM document was created. - CreatedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The default version. - DefaultVersion *string `type:"string"` - - // A description of the document. - Description *string `type:"string"` - - // The type of document. - DocumentType *string `type:"string" enum:"DocumentType"` - - // The document version. - DocumentVersion *string `type:"string"` - - // The Sha256 or Sha1 hash created by the system when the document was created. - // - // Sha1 hashes have been deprecated. - Hash *string `type:"string"` - - // Sha256 or Sha1. - // - // Sha1 hashes have been deprecated. - HashType *string `type:"string" enum:"DocumentHashType"` - - // The latest version of the document. - LatestVersion *string `type:"string"` - - // The name of the SSM document. - Name *string `type:"string"` - - // The AWS user account of the person who created the document. - Owner *string `type:"string"` - - // A description of the parameters for a document. - Parameters []*DocumentParameter `locationNameList:"DocumentParameter" type:"list"` - - // The list of OS platforms compatible with this SSM document. - PlatformTypes []*string `locationNameList:"PlatformType" type:"list"` - - // The schema version. - SchemaVersion *string `type:"string"` - - // The SHA1 hash of the document, which you can use for verification purposes. - Sha1 *string `type:"string"` - - // The status of the SSM document. - Status *string `type:"string" enum:"DocumentStatus"` -} - -// String returns the string representation -func (s DocumentDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentDescription) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *DocumentDescription) SetCreatedDate(v time.Time) *DocumentDescription { - s.CreatedDate = &v - return s -} - -// SetDefaultVersion sets the DefaultVersion field's value. -func (s *DocumentDescription) SetDefaultVersion(v string) *DocumentDescription { - s.DefaultVersion = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DocumentDescription) SetDescription(v string) *DocumentDescription { - s.Description = &v - return s -} - -// SetDocumentType sets the DocumentType field's value. -func (s *DocumentDescription) SetDocumentType(v string) *DocumentDescription { - s.DocumentType = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *DocumentDescription) SetDocumentVersion(v string) *DocumentDescription { - s.DocumentVersion = &v - return s -} - -// SetHash sets the Hash field's value. -func (s *DocumentDescription) SetHash(v string) *DocumentDescription { - s.Hash = &v - return s -} - -// SetHashType sets the HashType field's value. -func (s *DocumentDescription) SetHashType(v string) *DocumentDescription { - s.HashType = &v - return s -} - -// SetLatestVersion sets the LatestVersion field's value. -func (s *DocumentDescription) SetLatestVersion(v string) *DocumentDescription { - s.LatestVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *DocumentDescription) SetName(v string) *DocumentDescription { - s.Name = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *DocumentDescription) SetOwner(v string) *DocumentDescription { - s.Owner = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *DocumentDescription) SetParameters(v []*DocumentParameter) *DocumentDescription { - s.Parameters = v - return s -} - -// SetPlatformTypes sets the PlatformTypes field's value. -func (s *DocumentDescription) SetPlatformTypes(v []*string) *DocumentDescription { - s.PlatformTypes = v - return s -} - -// SetSchemaVersion sets the SchemaVersion field's value. -func (s *DocumentDescription) SetSchemaVersion(v string) *DocumentDescription { - s.SchemaVersion = &v - return s -} - -// SetSha1 sets the Sha1 field's value. -func (s *DocumentDescription) SetSha1(v string) *DocumentDescription { - s.Sha1 = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DocumentDescription) SetStatus(v string) *DocumentDescription { - s.Status = &v - return s -} - -// Describes a filter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DocumentFilter -type DocumentFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter. - // - // Key is a required field - Key *string `locationName:"key" type:"string" required:"true" enum:"DocumentFilterKey"` - - // The value of the filter. - // - // Value is a required field - Value *string `locationName:"value" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DocumentFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DocumentFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DocumentFilter"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *DocumentFilter) SetKey(v string) *DocumentFilter { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *DocumentFilter) SetValue(v string) *DocumentFilter { - s.Value = &v - return s -} - -// Describes the name of an SSM document. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DocumentIdentifier -type DocumentIdentifier struct { - _ struct{} `type:"structure"` - - // The document type. - DocumentType *string `type:"string" enum:"DocumentType"` - - // The document version. - DocumentVersion *string `type:"string"` - - // The name of the SSM document. - Name *string `type:"string"` - - // The AWS user account of the person who created the document. - Owner *string `type:"string"` - - // The operating system platform. - PlatformTypes []*string `locationNameList:"PlatformType" type:"list"` - - // The schema version. - SchemaVersion *string `type:"string"` -} - -// String returns the string representation -func (s DocumentIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentIdentifier) GoString() string { - return s.String() -} - -// SetDocumentType sets the DocumentType field's value. -func (s *DocumentIdentifier) SetDocumentType(v string) *DocumentIdentifier { - s.DocumentType = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *DocumentIdentifier) SetDocumentVersion(v string) *DocumentIdentifier { - s.DocumentVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *DocumentIdentifier) SetName(v string) *DocumentIdentifier { - s.Name = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *DocumentIdentifier) SetOwner(v string) *DocumentIdentifier { - s.Owner = &v - return s -} - -// SetPlatformTypes sets the PlatformTypes field's value. -func (s *DocumentIdentifier) SetPlatformTypes(v []*string) *DocumentIdentifier { - s.PlatformTypes = v - return s -} - -// SetSchemaVersion sets the SchemaVersion field's value. -func (s *DocumentIdentifier) SetSchemaVersion(v string) *DocumentIdentifier { - s.SchemaVersion = &v - return s -} - -// Parameters specified in the SSM document that execute on the server when -// the command is run. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DocumentParameter -type DocumentParameter struct { - _ struct{} `type:"structure"` - - // If specified, the default values for the parameters. Parameters without a - // default value are required. Parameters with a default value are optional. - DefaultValue *string `type:"string"` - - // A description of what the parameter does, how to use it, the default value, - // and whether or not the parameter is optional. - Description *string `type:"string"` - - // The name of the parameter. - Name *string `type:"string"` - - // The type of parameter. The type can be either “String” or “StringList”. - Type *string `type:"string" enum:"DocumentParameterType"` -} - -// String returns the string representation -func (s DocumentParameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentParameter) GoString() string { - return s.String() -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *DocumentParameter) SetDefaultValue(v string) *DocumentParameter { - s.DefaultValue = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DocumentParameter) SetDescription(v string) *DocumentParameter { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *DocumentParameter) SetName(v string) *DocumentParameter { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *DocumentParameter) SetType(v string) *DocumentParameter { - s.Type = &v - return s -} - -// Version information about the document. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DocumentVersionInfo -type DocumentVersionInfo struct { - _ struct{} `type:"structure"` - - // The date the document was created. - CreatedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The document version. - DocumentVersion *string `type:"string"` - - // An identifier for the default version of the document. - IsDefaultVersion *bool `type:"boolean"` - - // The document name. - Name *string `type:"string"` -} - -// String returns the string representation -func (s DocumentVersionInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DocumentVersionInfo) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *DocumentVersionInfo) SetCreatedDate(v time.Time) *DocumentVersionInfo { - s.CreatedDate = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *DocumentVersionInfo) SetDocumentVersion(v string) *DocumentVersionInfo { - s.DocumentVersion = &v - return s -} - -// SetIsDefaultVersion sets the IsDefaultVersion field's value. -func (s *DocumentVersionInfo) SetIsDefaultVersion(v bool) *DocumentVersionInfo { - s.IsDefaultVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *DocumentVersionInfo) SetName(v string) *DocumentVersionInfo { - s.Name = &v - return s -} - -// The EffectivePatch structure defines metadata about a patch along with the -// approval state of the patch in a particular patch baseline. The approval -// state includes information about whether the patch is currently approved, -// due to be approved by a rule, explicitly approved, or explicitly rejected -// and the date the patch was or will be approved. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/EffectivePatch -type EffectivePatch struct { - _ struct{} `type:"structure"` - - // Provides metadata for a patch, including information such as the KB ID, severity, - // classification and a URL for where more information can be obtained about - // the patch. - Patch *Patch `type:"structure"` - - // The status of the patch in a patch baseline. This includes information about - // whether the patch is currently approved, due to be approved by a rule, explicitly - // approved, or explicitly rejected and the date the patch was or will be approved. - PatchStatus *PatchStatus `type:"structure"` -} - -// String returns the string representation -func (s EffectivePatch) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EffectivePatch) GoString() string { - return s.String() -} - -// SetPatch sets the Patch field's value. -func (s *EffectivePatch) SetPatch(v *Patch) *EffectivePatch { - s.Patch = v - return s -} - -// SetPatchStatus sets the PatchStatus field's value. -func (s *EffectivePatch) SetPatchStatus(v *PatchStatus) *EffectivePatch { - s.PatchStatus = v - return s -} - -// Describes a failed association. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/FailedCreateAssociation -type FailedCreateAssociation struct { - _ struct{} `type:"structure"` - - // The association. - Entry *CreateAssociationBatchRequestEntry `type:"structure"` - - // The source of the failure. - Fault *string `type:"string" enum:"Fault"` - - // A description of the failure. - Message *string `type:"string"` -} - -// String returns the string representation -func (s FailedCreateAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FailedCreateAssociation) GoString() string { - return s.String() -} - -// SetEntry sets the Entry field's value. -func (s *FailedCreateAssociation) SetEntry(v *CreateAssociationBatchRequestEntry) *FailedCreateAssociation { - s.Entry = v - return s -} - -// SetFault sets the Fault field's value. -func (s *FailedCreateAssociation) SetFault(v string) *FailedCreateAssociation { - s.Fault = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *FailedCreateAssociation) SetMessage(v string) *FailedCreateAssociation { - s.Message = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetAutomationExecutionRequest -type GetAutomationExecutionInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for an existing automation execution to examine. The - // execution ID is returned by StartAutomationExecution when the execution of - // an Automation document is initiated. - // - // AutomationExecutionId is a required field - AutomationExecutionId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetAutomationExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAutomationExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAutomationExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAutomationExecutionInput"} - if s.AutomationExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("AutomationExecutionId")) - } - if s.AutomationExecutionId != nil && len(*s.AutomationExecutionId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("AutomationExecutionId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutomationExecutionId sets the AutomationExecutionId field's value. -func (s *GetAutomationExecutionInput) SetAutomationExecutionId(v string) *GetAutomationExecutionInput { - s.AutomationExecutionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetAutomationExecutionResult -type GetAutomationExecutionOutput struct { - _ struct{} `type:"structure"` - - // Detailed information about the current state of an automation execution. - AutomationExecution *AutomationExecution `type:"structure"` -} - -// String returns the string representation -func (s GetAutomationExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAutomationExecutionOutput) GoString() string { - return s.String() -} - -// SetAutomationExecution sets the AutomationExecution field's value. -func (s *GetAutomationExecutionOutput) SetAutomationExecution(v *AutomationExecution) *GetAutomationExecutionOutput { - s.AutomationExecution = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetCommandInvocationRequest -type GetCommandInvocationInput struct { - _ struct{} `type:"structure"` - - // (Required) The parent command ID of the invocation plugin. - // - // CommandId is a required field - CommandId *string `min:"36" type:"string" required:"true"` - - // (Required) The ID of the managed instance targeted by the command. A managed - // instance can be an Amazon EC2 instance or an instance in your hybrid environment - // that is configured for Systems Manager. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // (Optional) The name of the plugin for which you want detailed results. If - // the SSM document contains only one plugin, the name can be omitted and the - // details will be returned. - PluginName *string `min:"4" type:"string"` -} - -// String returns the string representation -func (s GetCommandInvocationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCommandInvocationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCommandInvocationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCommandInvocationInput"} - if s.CommandId == nil { - invalidParams.Add(request.NewErrParamRequired("CommandId")) - } - if s.CommandId != nil && len(*s.CommandId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CommandId", 36)) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.PluginName != nil && len(*s.PluginName) < 4 { - invalidParams.Add(request.NewErrParamMinLen("PluginName", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommandId sets the CommandId field's value. -func (s *GetCommandInvocationInput) SetCommandId(v string) *GetCommandInvocationInput { - s.CommandId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetCommandInvocationInput) SetInstanceId(v string) *GetCommandInvocationInput { - s.InstanceId = &v - return s -} - -// SetPluginName sets the PluginName field's value. -func (s *GetCommandInvocationInput) SetPluginName(v string) *GetCommandInvocationInput { - s.PluginName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetCommandInvocationResult -type GetCommandInvocationOutput struct { - _ struct{} `type:"structure"` - - // The parent command ID of the invocation plugin. - CommandId *string `min:"36" type:"string"` - - // The comment text for the command. - Comment *string `type:"string"` - - // The name of the SSM document that was executed. For example, AWS-RunShellScript - // is an SSM document. - DocumentName *string `type:"string"` - - // Duration since ExecutionStartDateTime. - ExecutionElapsedTime *string `type:"string"` - - // The date and time the plugin was finished executing. Date and time are written - // in ISO 8601 format. For example, August 28, 2016 is represented as 2016-08-28. - // If the plugin has not started to execute, the string is empty. - ExecutionEndDateTime *string `type:"string"` - - // The date and time the plugin started executing. Date and time are written - // in ISO 8601 format. For example, August 28, 2016 is represented as 2016-08-28. - // If the plugin has not started to execute, the string is empty. - ExecutionStartDateTime *string `type:"string"` - - // The ID of the managed instance targeted by the command. A managed instance - // can be an Amazon EC2 instance or an instance in your hybrid environment that - // is configured for Systems Manager. - InstanceId *string `type:"string"` - - // The name of the plugin for which you want detailed results. For example, - // aws:RunShellScript is a plugin. - PluginName *string `min:"4" type:"string"` - - // The error level response code for the plugin script. If the response code - // is -1, then the command has not started executing on the instance, or it - // was not received by the instance. - ResponseCode *int64 `type:"integer"` - - // The first 8,000 characters written by the plugin to stderr. If the command - // has not finished executing, then this string is empty. - StandardErrorContent *string `type:"string"` - - // The URL for the complete text written by the plugin to stderr. If the command - // has not finished executing, then this string is empty. - StandardErrorUrl *string `type:"string"` - - // The first 24,000 characters written by the plugin to stdout. If the command - // has not finished executing, if ExecutionStatus is neither Succeeded nor Failed, - // then this string is empty. - StandardOutputContent *string `type:"string"` - - // The URL for the complete text written by the plugin to stdout in Amazon S3. - // If an Amazon S3 bucket was not specified, then this string is empty. - StandardOutputUrl *string `type:"string"` - - // The status of the parent command for this invocation. This status can be - // different than StatusDetails. - Status *string `type:"string" enum:"CommandInvocationStatus"` - - // A detailed status of the command execution for an invocation. StatusDetails - // includes more information than Status because it includes states resulting - // from error and concurrency control parameters. StatusDetails can show different - // results than Status. For more information about these statuses, see Monitor - // Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // (Linux) or Monitor Commands (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/monitor-commands.html) - // (Windows). StatusDetails can be one of the following values: - // - // * Pending – The command has not been sent to the instance. - // - // * In Progress – The command has been sent to the instance but has not - // reached a terminal state. - // - // * Delayed – The system attempted to send the command to the target, but - // the target was not available. The instance might not be available because - // of network issues, the instance was stopped, etc. The system will try - // to deliver the command again. - // - // * Success – The command or plugin was executed successfully. This is a - // terminal state. - // - // * Delivery Timed Out – The command was not delivered to the instance before - // the delivery timeout expired. Delivery timeouts do not count against the - // parent command’s MaxErrors limit, but they do contribute to whether the - // parent command status is Success or Incomplete. This is a terminal state. - // - // * Execution Timed Out – The command started to execute on the instance, - // but the execution was not complete before the timeout expired. Execution - // timeouts count against the MaxErrors limit of the parent command. This - // is a terminal state. - // - // * Failed – The command wasn't executed successfully on the instance. For - // a plugin, this indicates that the result code was not zero. For a command - // invocation, this indicates that the result code for one or more plugins - // was not zero. Invocation failures count against the MaxErrors limit of - // the parent command. This is a terminal state. - // - // * Canceled – The command was terminated before it was completed. This - // is a terminal state. - // - // * Undeliverable – The command can't be delivered to the instance. The - // instance might not exist or might not be responding. Undeliverable invocations - // don't count against the parent command’s MaxErrors limit and don't contribute - // to whether the parent command status is Success or Incomplete. This is - // a terminal state. - // - // * Terminated – The parent command exceeded its MaxErrors limit and subsequent - // command invocations were canceled by the system. This is a terminal state. - StatusDetails *string `type:"string"` -} - -// String returns the string representation -func (s GetCommandInvocationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCommandInvocationOutput) GoString() string { - return s.String() -} - -// SetCommandId sets the CommandId field's value. -func (s *GetCommandInvocationOutput) SetCommandId(v string) *GetCommandInvocationOutput { - s.CommandId = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *GetCommandInvocationOutput) SetComment(v string) *GetCommandInvocationOutput { - s.Comment = &v - return s -} - -// SetDocumentName sets the DocumentName field's value. -func (s *GetCommandInvocationOutput) SetDocumentName(v string) *GetCommandInvocationOutput { - s.DocumentName = &v - return s -} - -// SetExecutionElapsedTime sets the ExecutionElapsedTime field's value. -func (s *GetCommandInvocationOutput) SetExecutionElapsedTime(v string) *GetCommandInvocationOutput { - s.ExecutionElapsedTime = &v - return s -} - -// SetExecutionEndDateTime sets the ExecutionEndDateTime field's value. -func (s *GetCommandInvocationOutput) SetExecutionEndDateTime(v string) *GetCommandInvocationOutput { - s.ExecutionEndDateTime = &v - return s -} - -// SetExecutionStartDateTime sets the ExecutionStartDateTime field's value. -func (s *GetCommandInvocationOutput) SetExecutionStartDateTime(v string) *GetCommandInvocationOutput { - s.ExecutionStartDateTime = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetCommandInvocationOutput) SetInstanceId(v string) *GetCommandInvocationOutput { - s.InstanceId = &v - return s -} - -// SetPluginName sets the PluginName field's value. -func (s *GetCommandInvocationOutput) SetPluginName(v string) *GetCommandInvocationOutput { - s.PluginName = &v - return s -} - -// SetResponseCode sets the ResponseCode field's value. -func (s *GetCommandInvocationOutput) SetResponseCode(v int64) *GetCommandInvocationOutput { - s.ResponseCode = &v - return s -} - -// SetStandardErrorContent sets the StandardErrorContent field's value. -func (s *GetCommandInvocationOutput) SetStandardErrorContent(v string) *GetCommandInvocationOutput { - s.StandardErrorContent = &v - return s -} - -// SetStandardErrorUrl sets the StandardErrorUrl field's value. -func (s *GetCommandInvocationOutput) SetStandardErrorUrl(v string) *GetCommandInvocationOutput { - s.StandardErrorUrl = &v - return s -} - -// SetStandardOutputContent sets the StandardOutputContent field's value. -func (s *GetCommandInvocationOutput) SetStandardOutputContent(v string) *GetCommandInvocationOutput { - s.StandardOutputContent = &v - return s -} - -// SetStandardOutputUrl sets the StandardOutputUrl field's value. -func (s *GetCommandInvocationOutput) SetStandardOutputUrl(v string) *GetCommandInvocationOutput { - s.StandardOutputUrl = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetCommandInvocationOutput) SetStatus(v string) *GetCommandInvocationOutput { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *GetCommandInvocationOutput) SetStatusDetails(v string) *GetCommandInvocationOutput { - s.StatusDetails = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDefaultPatchBaselineRequest -type GetDefaultPatchBaselineInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetDefaultPatchBaselineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDefaultPatchBaselineInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDefaultPatchBaselineResult -type GetDefaultPatchBaselineOutput struct { - _ struct{} `type:"structure"` - - // The ID of the default patch baseline. - BaselineId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s GetDefaultPatchBaselineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDefaultPatchBaselineOutput) GoString() string { - return s.String() -} - -// SetBaselineId sets the BaselineId field's value. -func (s *GetDefaultPatchBaselineOutput) SetBaselineId(v string) *GetDefaultPatchBaselineOutput { - s.BaselineId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDeployablePatchSnapshotForInstanceRequest -type GetDeployablePatchSnapshotForInstanceInput struct { - _ struct{} `type:"structure"` - - // The ID of the instance for which the appropriate patch snapshot should be - // retrieved. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The user-defined snapshot ID. - // - // SnapshotId is a required field - SnapshotId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDeployablePatchSnapshotForInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeployablePatchSnapshotForInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeployablePatchSnapshotForInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeployablePatchSnapshotForInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - if s.SnapshotId != nil && len(*s.SnapshotId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("SnapshotId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetDeployablePatchSnapshotForInstanceInput) SetInstanceId(v string) *GetDeployablePatchSnapshotForInstanceInput { - s.InstanceId = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *GetDeployablePatchSnapshotForInstanceInput) SetSnapshotId(v string) *GetDeployablePatchSnapshotForInstanceInput { - s.SnapshotId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDeployablePatchSnapshotForInstanceResult -type GetDeployablePatchSnapshotForInstanceOutput struct { - _ struct{} `type:"structure"` - - // The ID of the instance. - InstanceId *string `type:"string"` - - // A pre-signed Amazon S3 URL that can be used to download the patch snapshot. - SnapshotDownloadUrl *string `type:"string"` - - // The user-defined snapshot ID. - SnapshotId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s GetDeployablePatchSnapshotForInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDeployablePatchSnapshotForInstanceOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetDeployablePatchSnapshotForInstanceOutput) SetInstanceId(v string) *GetDeployablePatchSnapshotForInstanceOutput { - s.InstanceId = &v - return s -} - -// SetSnapshotDownloadUrl sets the SnapshotDownloadUrl field's value. -func (s *GetDeployablePatchSnapshotForInstanceOutput) SetSnapshotDownloadUrl(v string) *GetDeployablePatchSnapshotForInstanceOutput { - s.SnapshotDownloadUrl = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *GetDeployablePatchSnapshotForInstanceOutput) SetSnapshotId(v string) *GetDeployablePatchSnapshotForInstanceOutput { - s.SnapshotId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDocumentRequest -type GetDocumentInput struct { - _ struct{} `type:"structure"` - - // The document version for which you want information. - DocumentVersion *string `type:"string"` - - // The name of the SSM document. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDocumentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDocumentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDocumentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDocumentInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *GetDocumentInput) SetDocumentVersion(v string) *GetDocumentInput { - s.DocumentVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetDocumentInput) SetName(v string) *GetDocumentInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDocumentResult -type GetDocumentOutput struct { - _ struct{} `type:"structure"` - - // The contents of the SSM document. - Content *string `min:"1" type:"string"` - - // The document type. - DocumentType *string `type:"string" enum:"DocumentType"` - - // The document version. - DocumentVersion *string `type:"string"` - - // The name of the SSM document. - Name *string `type:"string"` -} - -// String returns the string representation -func (s GetDocumentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDocumentOutput) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *GetDocumentOutput) SetContent(v string) *GetDocumentOutput { - s.Content = &v - return s -} - -// SetDocumentType sets the DocumentType field's value. -func (s *GetDocumentOutput) SetDocumentType(v string) *GetDocumentOutput { - s.DocumentType = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *GetDocumentOutput) SetDocumentVersion(v string) *GetDocumentOutput { - s.DocumentVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetDocumentOutput) SetName(v string) *GetDocumentOutput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventoryRequest -type GetInventoryInput struct { - _ struct{} `type:"structure"` - - // One or more filters. Use a filter to return a more specific list of results. - Filters []*InventoryFilter `locationNameList:"InventoryFilter" min:"1" type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The list of inventory item types to return. - ResultAttributes []*ResultAttribute `locationNameList:"ResultAttribute" min:"1" type:"list"` -} - -// String returns the string representation -func (s GetInventoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInventoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInventoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInventoryInput"} - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ResultAttributes != nil && len(s.ResultAttributes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResultAttributes", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ResultAttributes != nil { - for i, v := range s.ResultAttributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResultAttributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *GetInventoryInput) SetFilters(v []*InventoryFilter) *GetInventoryInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetInventoryInput) SetMaxResults(v int64) *GetInventoryInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetInventoryInput) SetNextToken(v string) *GetInventoryInput { - s.NextToken = &v - return s -} - -// SetResultAttributes sets the ResultAttributes field's value. -func (s *GetInventoryInput) SetResultAttributes(v []*ResultAttribute) *GetInventoryInput { - s.ResultAttributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventoryResult -type GetInventoryOutput struct { - _ struct{} `type:"structure"` - - // Collection of inventory entities such as a collection of instance inventory. - Entities []*InventoryResultEntity `locationNameList:"Entity" type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s GetInventoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInventoryOutput) GoString() string { - return s.String() -} - -// SetEntities sets the Entities field's value. -func (s *GetInventoryOutput) SetEntities(v []*InventoryResultEntity) *GetInventoryOutput { - s.Entities = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetInventoryOutput) SetNextToken(v string) *GetInventoryOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventorySchemaRequest -type GetInventorySchemaInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"50" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The type of inventory item to return. - TypeName *string `type:"string"` -} - -// String returns the string representation -func (s GetInventorySchemaInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInventorySchemaInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInventorySchemaInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInventorySchemaInput"} - if s.MaxResults != nil && *s.MaxResults < 50 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 50)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetInventorySchemaInput) SetMaxResults(v int64) *GetInventorySchemaInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetInventorySchemaInput) SetNextToken(v string) *GetInventorySchemaInput { - s.NextToken = &v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *GetInventorySchemaInput) SetTypeName(v string) *GetInventorySchemaInput { - s.TypeName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventorySchemaResult -type GetInventorySchemaOutput 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 `type:"string"` - - // Inventory schemas returned by the request. - Schemas []*InventoryItemSchema `type:"list"` -} - -// String returns the string representation -func (s GetInventorySchemaOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInventorySchemaOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *GetInventorySchemaOutput) SetNextToken(v string) *GetInventorySchemaOutput { - s.NextToken = &v - return s -} - -// SetSchemas sets the Schemas field's value. -func (s *GetInventorySchemaOutput) SetSchemas(v []*InventoryItemSchema) *GetInventorySchemaOutput { - s.Schemas = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionRequest -type GetMaintenanceWindowExecutionInput struct { - _ struct{} `type:"structure"` - - // The ID of the Maintenance Window execution that includes the task. - // - // WindowExecutionId is a required field - WindowExecutionId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetMaintenanceWindowExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMaintenanceWindowExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMaintenanceWindowExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMaintenanceWindowExecutionInput"} - if s.WindowExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowExecutionId")) - } - if s.WindowExecutionId != nil && len(*s.WindowExecutionId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WindowExecutionId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *GetMaintenanceWindowExecutionInput) SetWindowExecutionId(v string) *GetMaintenanceWindowExecutionInput { - s.WindowExecutionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionResult -type GetMaintenanceWindowExecutionOutput struct { - _ struct{} `type:"structure"` - - // The time the Maintenance Window finished executing. - EndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time the Maintenance Window started executing. - StartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The status of the Maintenance Window execution. - Status *string `type:"string" enum:"MaintenanceWindowExecutionStatus"` - - // The details explaining the Status. Only available for certain status values. - StatusDetails *string `type:"string"` - - // The ID of the task executions from the Maintenance Window execution. - TaskIds []*string `type:"list"` - - // The ID of the Maintenance Window execution. - WindowExecutionId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s GetMaintenanceWindowExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMaintenanceWindowExecutionOutput) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *GetMaintenanceWindowExecutionOutput) SetEndTime(v time.Time) *GetMaintenanceWindowExecutionOutput { - s.EndTime = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetMaintenanceWindowExecutionOutput) SetStartTime(v time.Time) *GetMaintenanceWindowExecutionOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetMaintenanceWindowExecutionOutput) SetStatus(v string) *GetMaintenanceWindowExecutionOutput { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *GetMaintenanceWindowExecutionOutput) SetStatusDetails(v string) *GetMaintenanceWindowExecutionOutput { - s.StatusDetails = &v - return s -} - -// SetTaskIds sets the TaskIds field's value. -func (s *GetMaintenanceWindowExecutionOutput) SetTaskIds(v []*string) *GetMaintenanceWindowExecutionOutput { - s.TaskIds = v - return s -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *GetMaintenanceWindowExecutionOutput) SetWindowExecutionId(v string) *GetMaintenanceWindowExecutionOutput { - s.WindowExecutionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTaskRequest -type GetMaintenanceWindowExecutionTaskInput struct { - _ struct{} `type:"structure"` - - // The ID of the specific task execution in the Maintenance Window task that - // should be retrieved. - // - // TaskId is a required field - TaskId *string `min:"36" type:"string" required:"true"` - - // The ID of the Maintenance Window execution that includes the task. - // - // WindowExecutionId is a required field - WindowExecutionId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetMaintenanceWindowExecutionTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMaintenanceWindowExecutionTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMaintenanceWindowExecutionTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMaintenanceWindowExecutionTaskInput"} - if s.TaskId == nil { - invalidParams.Add(request.NewErrParamRequired("TaskId")) - } - if s.TaskId != nil && len(*s.TaskId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TaskId", 36)) - } - if s.WindowExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowExecutionId")) - } - if s.WindowExecutionId != nil && len(*s.WindowExecutionId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WindowExecutionId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTaskId sets the TaskId field's value. -func (s *GetMaintenanceWindowExecutionTaskInput) SetTaskId(v string) *GetMaintenanceWindowExecutionTaskInput { - s.TaskId = &v - return s -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *GetMaintenanceWindowExecutionTaskInput) SetWindowExecutionId(v string) *GetMaintenanceWindowExecutionTaskInput { - s.WindowExecutionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTaskResult -type GetMaintenanceWindowExecutionTaskOutput struct { - _ struct{} `type:"structure"` - - // The time the task execution completed. - EndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The defined maximum number of task executions that could be run in parallel. - MaxConcurrency *string `min:"1" type:"string"` - - // The defined maximum number of task execution errors allowed before scheduling - // of the task execution would have been stopped. - MaxErrors *string `min:"1" type:"string"` - - // The priority of the task. - Priority *int64 `type:"integer"` - - // The role that was assumed when executing the task. - ServiceRole *string `type:"string"` - - // The time the task execution started. - StartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The status of the task. - Status *string `type:"string" enum:"MaintenanceWindowExecutionStatus"` - - // The details explaining the Status. Only available for certain status values. - StatusDetails *string `type:"string"` - - // The ARN of the executed task. - TaskArn *string `min:"1" type:"string"` - - // The ID of the specific task execution in the Maintenance Window task that - // was retrieved. - TaskExecutionId *string `min:"36" type:"string"` - - // The parameters passed to the task when it was executed. The map has the following - // format: - // - // Key: string, 1 ≤ length ≤ 255 - // - // Value: an array of strings where each string 1 ≤ length ≤ 255 - TaskParameters []map[string]*MaintenanceWindowTaskParameterValueExpression `type:"list"` - - // The type of task executed. - Type *string `type:"string" enum:"MaintenanceWindowTaskType"` - - // The ID of the Maintenance Window execution that includes the task. - WindowExecutionId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s GetMaintenanceWindowExecutionTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMaintenanceWindowExecutionTaskOutput) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetEndTime(v time.Time) *GetMaintenanceWindowExecutionTaskOutput { - s.EndTime = &v - return s -} - -// SetMaxConcurrency sets the MaxConcurrency field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetMaxConcurrency(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.MaxConcurrency = &v - return s -} - -// SetMaxErrors sets the MaxErrors field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetMaxErrors(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.MaxErrors = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetPriority(v int64) *GetMaintenanceWindowExecutionTaskOutput { - s.Priority = &v - return s -} - -// SetServiceRole sets the ServiceRole field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetServiceRole(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.ServiceRole = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetStartTime(v time.Time) *GetMaintenanceWindowExecutionTaskOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetStatus(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetStatusDetails(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.StatusDetails = &v - return s -} - -// SetTaskArn sets the TaskArn field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetTaskArn(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.TaskArn = &v - return s -} - -// SetTaskExecutionId sets the TaskExecutionId field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetTaskExecutionId(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.TaskExecutionId = &v - return s -} - -// SetTaskParameters sets the TaskParameters field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetTaskParameters(v []map[string]*MaintenanceWindowTaskParameterValueExpression) *GetMaintenanceWindowExecutionTaskOutput { - s.TaskParameters = v - return s -} - -// SetType sets the Type field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetType(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.Type = &v - return s -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *GetMaintenanceWindowExecutionTaskOutput) SetWindowExecutionId(v string) *GetMaintenanceWindowExecutionTaskOutput { - s.WindowExecutionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowRequest -type GetMaintenanceWindowInput struct { - _ struct{} `type:"structure"` - - // The ID of the desired Maintenance Window. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetMaintenanceWindowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMaintenanceWindowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMaintenanceWindowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMaintenanceWindowInput"} - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWindowId sets the WindowId field's value. -func (s *GetMaintenanceWindowInput) SetWindowId(v string) *GetMaintenanceWindowInput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowResult -type GetMaintenanceWindowOutput struct { - _ struct{} `type:"structure"` - - // Whether targets must be registered with the Maintenance Window before tasks - // can be defined for those targets. - AllowUnassociatedTargets *bool `type:"boolean"` - - // The date the Maintenance Window was created. - CreatedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The number of hours before the end of the Maintenance Window that Systems - // Manager stops scheduling new tasks for execution. - Cutoff *int64 `type:"integer"` - - // The duration of the Maintenance Window in hours. - Duration *int64 `min:"1" type:"integer"` - - // Whether the Maintenance Windows is enabled. - Enabled *bool `type:"boolean"` - - // The date the Maintenance Window was last modified. - ModifiedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the Maintenance Window. - Name *string `min:"3" type:"string"` - - // The schedule of the Maintenance Window in the form of a cron or rate expression. - Schedule *string `min:"1" type:"string"` - - // The ID of the created Maintenance Window. - WindowId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s GetMaintenanceWindowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetMaintenanceWindowOutput) GoString() string { - return s.String() -} - -// SetAllowUnassociatedTargets sets the AllowUnassociatedTargets field's value. -func (s *GetMaintenanceWindowOutput) SetAllowUnassociatedTargets(v bool) *GetMaintenanceWindowOutput { - s.AllowUnassociatedTargets = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *GetMaintenanceWindowOutput) SetCreatedDate(v time.Time) *GetMaintenanceWindowOutput { - s.CreatedDate = &v - return s -} - -// SetCutoff sets the Cutoff field's value. -func (s *GetMaintenanceWindowOutput) SetCutoff(v int64) *GetMaintenanceWindowOutput { - s.Cutoff = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *GetMaintenanceWindowOutput) SetDuration(v int64) *GetMaintenanceWindowOutput { - s.Duration = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *GetMaintenanceWindowOutput) SetEnabled(v bool) *GetMaintenanceWindowOutput { - s.Enabled = &v - return s -} - -// SetModifiedDate sets the ModifiedDate field's value. -func (s *GetMaintenanceWindowOutput) SetModifiedDate(v time.Time) *GetMaintenanceWindowOutput { - s.ModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetMaintenanceWindowOutput) SetName(v string) *GetMaintenanceWindowOutput { - s.Name = &v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *GetMaintenanceWindowOutput) SetSchedule(v string) *GetMaintenanceWindowOutput { - s.Schedule = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *GetMaintenanceWindowOutput) SetWindowId(v string) *GetMaintenanceWindowOutput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameterHistoryRequest -type GetParameterHistoryInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The name of a parameter you want to query. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // Return decrypted values for secure string parameters. This flag is ignored - // for String and StringList parameter types. - WithDecryption *bool `type:"boolean"` -} - -// String returns the string representation -func (s GetParameterHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetParameterHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetParameterHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetParameterHistoryInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetParameterHistoryInput) SetMaxResults(v int64) *GetParameterHistoryInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetParameterHistoryInput) SetName(v string) *GetParameterHistoryInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetParameterHistoryInput) SetNextToken(v string) *GetParameterHistoryInput { - s.NextToken = &v - return s -} - -// SetWithDecryption sets the WithDecryption field's value. -func (s *GetParameterHistoryInput) SetWithDecryption(v bool) *GetParameterHistoryInput { - s.WithDecryption = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameterHistoryResult -type GetParameterHistoryOutput 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 `type:"string"` - - // A list of parameters returned by the request. - Parameters []*ParameterHistory `type:"list"` -} - -// String returns the string representation -func (s GetParameterHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetParameterHistoryOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *GetParameterHistoryOutput) SetNextToken(v string) *GetParameterHistoryOutput { - s.NextToken = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *GetParameterHistoryOutput) SetParameters(v []*ParameterHistory) *GetParameterHistoryOutput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParametersRequest -type GetParametersInput struct { - _ struct{} `type:"structure"` - - // Names of the parameters for which you want to query information. - // - // Names is a required field - Names []*string `min:"1" type:"list" required:"true"` - - // Return decrypted secure string value. Return decrypted values for secure - // string parameters. This flag is ignored for String and StringList parameter - // types. - WithDecryption *bool `type:"boolean"` -} - -// String returns the string representation -func (s GetParametersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetParametersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetParametersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetParametersInput"} - if s.Names == nil { - invalidParams.Add(request.NewErrParamRequired("Names")) - } - if s.Names != nil && len(s.Names) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Names", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNames sets the Names field's value. -func (s *GetParametersInput) SetNames(v []*string) *GetParametersInput { - s.Names = v - return s -} - -// SetWithDecryption sets the WithDecryption field's value. -func (s *GetParametersInput) SetWithDecryption(v bool) *GetParametersInput { - s.WithDecryption = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParametersResult -type GetParametersOutput struct { - _ struct{} `type:"structure"` - - // A list of parameters that are not formatted correctly or do not run when - // executed. - InvalidParameters []*string `min:"1" type:"list"` - - // A list of parameters used by the AWS account. - Parameters []*Parameter `type:"list"` -} - -// String returns the string representation -func (s GetParametersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetParametersOutput) GoString() string { - return s.String() -} - -// SetInvalidParameters sets the InvalidParameters field's value. -func (s *GetParametersOutput) SetInvalidParameters(v []*string) *GetParametersOutput { - s.InvalidParameters = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *GetParametersOutput) SetParameters(v []*Parameter) *GetParametersOutput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaselineForPatchGroupRequest -type GetPatchBaselineForPatchGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the patch group whose patch baseline should be retrieved. - // - // PatchGroup is a required field - PatchGroup *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPatchBaselineForPatchGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPatchBaselineForPatchGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPatchBaselineForPatchGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPatchBaselineForPatchGroupInput"} - if s.PatchGroup == nil { - invalidParams.Add(request.NewErrParamRequired("PatchGroup")) - } - if s.PatchGroup != nil && len(*s.PatchGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PatchGroup", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *GetPatchBaselineForPatchGroupInput) SetPatchGroup(v string) *GetPatchBaselineForPatchGroupInput { - s.PatchGroup = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaselineForPatchGroupResult -type GetPatchBaselineForPatchGroupOutput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline that should be used for the patch group. - BaselineId *string `min:"20" type:"string"` - - // The name of the patch group. - PatchGroup *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetPatchBaselineForPatchGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPatchBaselineForPatchGroupOutput) GoString() string { - return s.String() -} - -// SetBaselineId sets the BaselineId field's value. -func (s *GetPatchBaselineForPatchGroupOutput) SetBaselineId(v string) *GetPatchBaselineForPatchGroupOutput { - s.BaselineId = &v - return s -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *GetPatchBaselineForPatchGroupOutput) SetPatchGroup(v string) *GetPatchBaselineForPatchGroupOutput { - s.PatchGroup = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaselineRequest -type GetPatchBaselineInput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline to retrieve. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPatchBaselineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPatchBaselineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPatchBaselineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPatchBaselineInput"} - if s.BaselineId == nil { - invalidParams.Add(request.NewErrParamRequired("BaselineId")) - } - if s.BaselineId != nil && len(*s.BaselineId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("BaselineId", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaselineId sets the BaselineId field's value. -func (s *GetPatchBaselineInput) SetBaselineId(v string) *GetPatchBaselineInput { - s.BaselineId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaselineResult -type GetPatchBaselineOutput struct { - _ struct{} `type:"structure"` - - // A set of rules used to include patches in the baseline. - ApprovalRules *PatchRuleGroup `type:"structure"` - - // A list of explicitly approved patches for the baseline. - ApprovedPatches []*string `type:"list"` - - // The ID of the retrieved patch baseline. - BaselineId *string `min:"20" type:"string"` - - // The date the patch baseline was created. - CreatedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // A description of the patch baseline. - Description *string `min:"1" type:"string"` - - // A set of global filters used to exclude patches from the baseline. - GlobalFilters *PatchFilterGroup `type:"structure"` - - // The date the patch baseline was last modified. - ModifiedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the patch baseline. - Name *string `min:"3" type:"string"` - - // Patch groups included in the patch baseline. - PatchGroups []*string `type:"list"` - - // A list of explicitly rejected patches for the baseline. - RejectedPatches []*string `type:"list"` -} - -// String returns the string representation -func (s GetPatchBaselineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPatchBaselineOutput) GoString() string { - return s.String() -} - -// SetApprovalRules sets the ApprovalRules field's value. -func (s *GetPatchBaselineOutput) SetApprovalRules(v *PatchRuleGroup) *GetPatchBaselineOutput { - s.ApprovalRules = v - return s -} - -// SetApprovedPatches sets the ApprovedPatches field's value. -func (s *GetPatchBaselineOutput) SetApprovedPatches(v []*string) *GetPatchBaselineOutput { - s.ApprovedPatches = v - return s -} - -// SetBaselineId sets the BaselineId field's value. -func (s *GetPatchBaselineOutput) SetBaselineId(v string) *GetPatchBaselineOutput { - s.BaselineId = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *GetPatchBaselineOutput) SetCreatedDate(v time.Time) *GetPatchBaselineOutput { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetPatchBaselineOutput) SetDescription(v string) *GetPatchBaselineOutput { - s.Description = &v - return s -} - -// SetGlobalFilters sets the GlobalFilters field's value. -func (s *GetPatchBaselineOutput) SetGlobalFilters(v *PatchFilterGroup) *GetPatchBaselineOutput { - s.GlobalFilters = v - return s -} - -// SetModifiedDate sets the ModifiedDate field's value. -func (s *GetPatchBaselineOutput) SetModifiedDate(v time.Time) *GetPatchBaselineOutput { - s.ModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetPatchBaselineOutput) SetName(v string) *GetPatchBaselineOutput { - s.Name = &v - return s -} - -// SetPatchGroups sets the PatchGroups field's value. -func (s *GetPatchBaselineOutput) SetPatchGroups(v []*string) *GetPatchBaselineOutput { - s.PatchGroups = v - return s -} - -// SetRejectedPatches sets the RejectedPatches field's value. -func (s *GetPatchBaselineOutput) SetRejectedPatches(v []*string) *GetPatchBaselineOutput { - s.RejectedPatches = v - return s -} - -// Status information about the aggregated associations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceAggregatedAssociationOverview -type InstanceAggregatedAssociationOverview struct { - _ struct{} `type:"structure"` - - // Detailed status information about the aggregated associations. - DetailedStatus *string `type:"string"` - - // The number of associations for the instance(s). - InstanceAssociationStatusAggregatedCount map[string]*int64 `type:"map"` -} - -// String returns the string representation -func (s InstanceAggregatedAssociationOverview) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceAggregatedAssociationOverview) GoString() string { - return s.String() -} - -// SetDetailedStatus sets the DetailedStatus field's value. -func (s *InstanceAggregatedAssociationOverview) SetDetailedStatus(v string) *InstanceAggregatedAssociationOverview { - s.DetailedStatus = &v - return s -} - -// SetInstanceAssociationStatusAggregatedCount sets the InstanceAssociationStatusAggregatedCount field's value. -func (s *InstanceAggregatedAssociationOverview) SetInstanceAssociationStatusAggregatedCount(v map[string]*int64) *InstanceAggregatedAssociationOverview { - s.InstanceAssociationStatusAggregatedCount = v - return s -} - -// One or more association documents on the instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceAssociation -type InstanceAssociation struct { - _ struct{} `type:"structure"` - - // The association ID. - AssociationId *string `type:"string"` - - // The content of the association document for the instance(s). - Content *string `min:"1" type:"string"` - - // The instance ID. - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s InstanceAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceAssociation) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *InstanceAssociation) SetAssociationId(v string) *InstanceAssociation { - s.AssociationId = &v - return s -} - -// SetContent sets the Content field's value. -func (s *InstanceAssociation) SetContent(v string) *InstanceAssociation { - s.Content = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceAssociation) SetInstanceId(v string) *InstanceAssociation { - s.InstanceId = &v - return s -} - -// An Amazon S3 bucket where you want to store the results of this request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceAssociationOutputLocation -type InstanceAssociationOutputLocation struct { - _ struct{} `type:"structure"` - - // An Amazon S3 bucket where you want to store the results of this request. - S3Location *S3OutputLocation `type:"structure"` -} - -// String returns the string representation -func (s InstanceAssociationOutputLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceAssociationOutputLocation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceAssociationOutputLocation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceAssociationOutputLocation"} - if s.S3Location != nil { - if err := s.S3Location.Validate(); err != nil { - invalidParams.AddNested("S3Location", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Location sets the S3Location field's value. -func (s *InstanceAssociationOutputLocation) SetS3Location(v *S3OutputLocation) *InstanceAssociationOutputLocation { - s.S3Location = v - return s -} - -// The URL of Amazon S3 bucket where you want to store the results of this request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceAssociationOutputUrl -type InstanceAssociationOutputUrl struct { - _ struct{} `type:"structure"` - - // The URL of Amazon S3 bucket where you want to store the results of this request. - S3OutputUrl *S3OutputUrl `type:"structure"` -} - -// String returns the string representation -func (s InstanceAssociationOutputUrl) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceAssociationOutputUrl) GoString() string { - return s.String() -} - -// SetS3OutputUrl sets the S3OutputUrl field's value. -func (s *InstanceAssociationOutputUrl) SetS3OutputUrl(v *S3OutputUrl) *InstanceAssociationOutputUrl { - s.S3OutputUrl = v - return s -} - -// Status information about the instance association. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceAssociationStatusInfo -type InstanceAssociationStatusInfo struct { - _ struct{} `type:"structure"` - - // The association ID. - AssociationId *string `type:"string"` - - // Detailed status information about the instance association. - DetailedStatus *string `type:"string"` - - // The association document verions. - DocumentVersion *string `type:"string"` - - // An error code returned by the request to create the association. - ErrorCode *string `type:"string"` - - // The date the instance association executed. - ExecutionDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Summary information about association execution. - ExecutionSummary *string `min:"1" type:"string"` - - // The instance ID where the association was created. - InstanceId *string `type:"string"` - - // The name of the association. - Name *string `type:"string"` - - // A URL for an Amazon S3 bucket where you want to store the results of this - // request. - OutputUrl *InstanceAssociationOutputUrl `type:"structure"` - - // Status information about the instance association. - Status *string `type:"string"` -} - -// String returns the string representation -func (s InstanceAssociationStatusInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceAssociationStatusInfo) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *InstanceAssociationStatusInfo) SetAssociationId(v string) *InstanceAssociationStatusInfo { - s.AssociationId = &v - return s -} - -// SetDetailedStatus sets the DetailedStatus field's value. -func (s *InstanceAssociationStatusInfo) SetDetailedStatus(v string) *InstanceAssociationStatusInfo { - s.DetailedStatus = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *InstanceAssociationStatusInfo) SetDocumentVersion(v string) *InstanceAssociationStatusInfo { - s.DocumentVersion = &v - return s -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *InstanceAssociationStatusInfo) SetErrorCode(v string) *InstanceAssociationStatusInfo { - s.ErrorCode = &v - return s -} - -// SetExecutionDate sets the ExecutionDate field's value. -func (s *InstanceAssociationStatusInfo) SetExecutionDate(v time.Time) *InstanceAssociationStatusInfo { - s.ExecutionDate = &v - return s -} - -// SetExecutionSummary sets the ExecutionSummary field's value. -func (s *InstanceAssociationStatusInfo) SetExecutionSummary(v string) *InstanceAssociationStatusInfo { - s.ExecutionSummary = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceAssociationStatusInfo) SetInstanceId(v string) *InstanceAssociationStatusInfo { - s.InstanceId = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceAssociationStatusInfo) SetName(v string) *InstanceAssociationStatusInfo { - s.Name = &v - return s -} - -// SetOutputUrl sets the OutputUrl field's value. -func (s *InstanceAssociationStatusInfo) SetOutputUrl(v *InstanceAssociationOutputUrl) *InstanceAssociationStatusInfo { - s.OutputUrl = v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceAssociationStatusInfo) SetStatus(v string) *InstanceAssociationStatusInfo { - s.Status = &v - return s -} - -// Describes a filter for a specific list of instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceInformation -type InstanceInformation struct { - _ struct{} `type:"structure"` - - // The activation ID created by Systems Manager when the server or VM was registered. - ActivationId *string `type:"string"` - - // The version of the SSM agent running on your Linux instance. - AgentVersion *string `type:"string"` - - // Information about the association. - AssociationOverview *InstanceAggregatedAssociationOverview `type:"structure"` - - // The status of the association. - AssociationStatus *string `type:"string"` - - // The fully qualified host name of the managed instance. - ComputerName *string `min:"1" type:"string"` - - // The IP address of the managed instance. - IPAddress *string `min:"1" type:"string"` - - // The Amazon Identity and Access Management (IAM) role assigned to EC2 instances - // or managed instances. - IamRole *string `type:"string"` - - // The instance ID. - InstanceId *string `type:"string"` - - // Indicates whether latest version of the SSM agent is running on your instance. - IsLatestVersion *bool `type:"boolean"` - - // The date the association was last executed. - LastAssociationExecutionDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time when agent last pinged Systems Manager service. - LastPingDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The last date the association was successfully run. - LastSuccessfulAssociationExecutionDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the managed instance. - Name *string `type:"string"` - - // Connection status of the SSM agent. - PingStatus *string `type:"string" enum:"PingStatus"` - - // The name of the operating system platform running on your instance. - PlatformName *string `type:"string"` - - // The operating system platform type. - PlatformType *string `type:"string" enum:"PlatformType"` - - // The version of the OS platform running on your instance. - PlatformVersion *string `type:"string"` - - // The date the server or VM was registered with AWS as a managed instance. - RegistrationDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The type of instance. Instances are either EC2 instances or managed instances. - ResourceType *string `type:"string" enum:"ResourceType"` -} - -// String returns the string representation -func (s InstanceInformation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceInformation) GoString() string { - return s.String() -} - -// SetActivationId sets the ActivationId field's value. -func (s *InstanceInformation) SetActivationId(v string) *InstanceInformation { - s.ActivationId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *InstanceInformation) SetAgentVersion(v string) *InstanceInformation { - s.AgentVersion = &v - return s -} - -// SetAssociationOverview sets the AssociationOverview field's value. -func (s *InstanceInformation) SetAssociationOverview(v *InstanceAggregatedAssociationOverview) *InstanceInformation { - s.AssociationOverview = v - return s -} - -// SetAssociationStatus sets the AssociationStatus field's value. -func (s *InstanceInformation) SetAssociationStatus(v string) *InstanceInformation { - s.AssociationStatus = &v - return s -} - -// SetComputerName sets the ComputerName field's value. -func (s *InstanceInformation) SetComputerName(v string) *InstanceInformation { - s.ComputerName = &v - return s -} - -// SetIPAddress sets the IPAddress field's value. -func (s *InstanceInformation) SetIPAddress(v string) *InstanceInformation { - s.IPAddress = &v - return s -} - -// SetIamRole sets the IamRole field's value. -func (s *InstanceInformation) SetIamRole(v string) *InstanceInformation { - s.IamRole = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceInformation) SetInstanceId(v string) *InstanceInformation { - s.InstanceId = &v - return s -} - -// SetIsLatestVersion sets the IsLatestVersion field's value. -func (s *InstanceInformation) SetIsLatestVersion(v bool) *InstanceInformation { - s.IsLatestVersion = &v - return s -} - -// SetLastAssociationExecutionDate sets the LastAssociationExecutionDate field's value. -func (s *InstanceInformation) SetLastAssociationExecutionDate(v time.Time) *InstanceInformation { - s.LastAssociationExecutionDate = &v - return s -} - -// SetLastPingDateTime sets the LastPingDateTime field's value. -func (s *InstanceInformation) SetLastPingDateTime(v time.Time) *InstanceInformation { - s.LastPingDateTime = &v - return s -} - -// SetLastSuccessfulAssociationExecutionDate sets the LastSuccessfulAssociationExecutionDate field's value. -func (s *InstanceInformation) SetLastSuccessfulAssociationExecutionDate(v time.Time) *InstanceInformation { - s.LastSuccessfulAssociationExecutionDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceInformation) SetName(v string) *InstanceInformation { - s.Name = &v - return s -} - -// SetPingStatus sets the PingStatus field's value. -func (s *InstanceInformation) SetPingStatus(v string) *InstanceInformation { - s.PingStatus = &v - return s -} - -// SetPlatformName sets the PlatformName field's value. -func (s *InstanceInformation) SetPlatformName(v string) *InstanceInformation { - s.PlatformName = &v - return s -} - -// SetPlatformType sets the PlatformType field's value. -func (s *InstanceInformation) SetPlatformType(v string) *InstanceInformation { - s.PlatformType = &v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *InstanceInformation) SetPlatformVersion(v string) *InstanceInformation { - s.PlatformVersion = &v - return s -} - -// SetRegistrationDate sets the RegistrationDate field's value. -func (s *InstanceInformation) SetRegistrationDate(v time.Time) *InstanceInformation { - s.RegistrationDate = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *InstanceInformation) SetResourceType(v string) *InstanceInformation { - s.ResourceType = &v - return s -} - -// Describes a filter for a specific list of instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceInformationFilter -type InstanceInformationFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter. - // - // Key is a required field - Key *string `locationName:"key" type:"string" required:"true" enum:"InstanceInformationFilterKey"` - - // The filter values. - // - // ValueSet is a required field - ValueSet []*string `locationName:"valueSet" locationNameList:"InstanceInformationFilterValue" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s InstanceInformationFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceInformationFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceInformationFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceInformationFilter"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.ValueSet == nil { - invalidParams.Add(request.NewErrParamRequired("ValueSet")) - } - if s.ValueSet != nil && len(s.ValueSet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ValueSet", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *InstanceInformationFilter) SetKey(v string) *InstanceInformationFilter { - s.Key = &v - return s -} - -// SetValueSet sets the ValueSet field's value. -func (s *InstanceInformationFilter) SetValueSet(v []*string) *InstanceInformationFilter { - s.ValueSet = v - return s -} - -// The filters to describe or get information about your managed instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceInformationStringFilter -type InstanceInformationStringFilter struct { - _ struct{} `type:"structure"` - - // The filter key name to describe your instances. For example: - // - // "InstanceIds"|"AgentVersion"|"PingStatus"|"PlatformTypes"|"ActivationIds"|"IamRole"|"ResourceType"|”AssociationStatus”|”Tag - // Key” - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The filter values. - // - // Values is a required field - Values []*string `locationNameList:"InstanceInformationFilterValue" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s InstanceInformationStringFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceInformationStringFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceInformationStringFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceInformationStringFilter"} - 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.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *InstanceInformationStringFilter) SetKey(v string) *InstanceInformationStringFilter { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *InstanceInformationStringFilter) SetValues(v []*string) *InstanceInformationStringFilter { - s.Values = v - return s -} - -// Defines the high-level patch compliance state for a managed instance, providing -// information about the number of installed, missing, not applicable, and failed -// patches along with metadata about the operation when this information was -// gathered for the instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstancePatchState -type InstancePatchState struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline used to patch the instance. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` - - // The number of patches from the patch baseline that were attempted to be installed - // during the last patching operation, but failed to install. - FailedCount *int64 `type:"integer"` - - // The number of patches from the patch baseline that are installed on the instance. - InstalledCount *int64 `type:"integer"` - - // The number of patches not specified in the patch baseline that are installed - // on the instance. - InstalledOtherCount *int64 `type:"integer"` - - // The ID of the managed instance the high-level patch compliance information - // was collected for. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The number of patches from the patch baseline that are applicable for the - // instance but aren’t currently installed. - MissingCount *int64 `type:"integer"` - - // The number of patches from the patch baseline that aren’t applicable for - // the instance and hence aren’t installed on the instance. - NotApplicableCount *int64 `type:"integer"` - - // The type of patching operation that was performed: SCAN (assess patch compliance - // state) or INSTALL (install missing patches). - // - // Operation is a required field - Operation *string `type:"string" required:"true" enum:"PatchOperationType"` - - // The time the most recent patching operation completed on the instance. - // - // OperationEndTime is a required field - OperationEndTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The time the most recent patching operation was started on the instance. - // - // OperationStartTime is a required field - OperationStartTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // Placeholder information, this field will always be empty in the current release - // of the service. - OwnerInformation *string `min:"1" type:"string"` - - // The name of the patch group the managed instance belongs to. - // - // PatchGroup is a required field - PatchGroup *string `min:"1" type:"string" required:"true"` - - // The ID of the patch baseline snapshot used during the patching operation - // when this compliance data was collected. - SnapshotId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s InstancePatchState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstancePatchState) GoString() string { - return s.String() -} - -// SetBaselineId sets the BaselineId field's value. -func (s *InstancePatchState) SetBaselineId(v string) *InstancePatchState { - s.BaselineId = &v - return s -} - -// SetFailedCount sets the FailedCount field's value. -func (s *InstancePatchState) SetFailedCount(v int64) *InstancePatchState { - s.FailedCount = &v - return s -} - -// SetInstalledCount sets the InstalledCount field's value. -func (s *InstancePatchState) SetInstalledCount(v int64) *InstancePatchState { - s.InstalledCount = &v - return s -} - -// SetInstalledOtherCount sets the InstalledOtherCount field's value. -func (s *InstancePatchState) SetInstalledOtherCount(v int64) *InstancePatchState { - s.InstalledOtherCount = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstancePatchState) SetInstanceId(v string) *InstancePatchState { - s.InstanceId = &v - return s -} - -// SetMissingCount sets the MissingCount field's value. -func (s *InstancePatchState) SetMissingCount(v int64) *InstancePatchState { - s.MissingCount = &v - return s -} - -// SetNotApplicableCount sets the NotApplicableCount field's value. -func (s *InstancePatchState) SetNotApplicableCount(v int64) *InstancePatchState { - s.NotApplicableCount = &v - return s -} - -// SetOperation sets the Operation field's value. -func (s *InstancePatchState) SetOperation(v string) *InstancePatchState { - s.Operation = &v - return s -} - -// SetOperationEndTime sets the OperationEndTime field's value. -func (s *InstancePatchState) SetOperationEndTime(v time.Time) *InstancePatchState { - s.OperationEndTime = &v - return s -} - -// SetOperationStartTime sets the OperationStartTime field's value. -func (s *InstancePatchState) SetOperationStartTime(v time.Time) *InstancePatchState { - s.OperationStartTime = &v - return s -} - -// SetOwnerInformation sets the OwnerInformation field's value. -func (s *InstancePatchState) SetOwnerInformation(v string) *InstancePatchState { - s.OwnerInformation = &v - return s -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *InstancePatchState) SetPatchGroup(v string) *InstancePatchState { - s.PatchGroup = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *InstancePatchState) SetSnapshotId(v string) *InstancePatchState { - s.SnapshotId = &v - return s -} - -// Defines a filter used in DescribeInstancePatchStatesForPatchGroup used to -// scope down the information returned by the API. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstancePatchStateFilter -type InstancePatchStateFilter struct { - _ struct{} `type:"structure"` - - // The key for the filter. Supported values are FailedCount, InstalledCount, - // InstalledOtherCount, MissingCount and NotApplicableCount. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The type of comparison that should be performed for the value: Equal, NotEqual, - // LessThan or GreaterThan. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"InstancePatchStateOperatorType"` - - // The value for the filter, must be an integer greater than or equal to 0. - // - // Values is a required field - Values []*string `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s InstancePatchStateFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstancePatchStateFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstancePatchStateFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstancePatchStateFilter"} - 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.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *InstancePatchStateFilter) SetKey(v string) *InstancePatchStateFilter { - s.Key = &v - return s -} - -// SetType sets the Type field's value. -func (s *InstancePatchStateFilter) SetType(v string) *InstancePatchStateFilter { - s.Type = &v - return s -} - -// SetValues sets the Values field's value. -func (s *InstancePatchStateFilter) SetValues(v []*string) *InstancePatchStateFilter { - s.Values = v - return s -} - -// One or more filters. Use a filter to return a more specific list of results. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InventoryFilter -type InventoryFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter key. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The type of filter. Valid values include the following: "Equal"|"NotEqual"|"BeginWith"|"LessThan"|"GreaterThan" - Type *string `type:"string" enum:"InventoryQueryOperatorType"` - - // Inventory filter values. Example: inventory filter where instance IDs are - // specified as values Key=AWS:InstanceInformation.InstanceId,Values= i-a12b3c4d5e6g, - // i-1a2b3c4d5e6,Type=Equal - // - // Values is a required field - Values []*string `locationNameList:"FilterValue" min:"1" type:"list" 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.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *InventoryFilter) SetKey(v string) *InventoryFilter { - s.Key = &v - return s -} - -// SetType sets the Type field's value. -func (s *InventoryFilter) SetType(v string) *InventoryFilter { - s.Type = &v - return s -} - -// SetValues sets the Values field's value. -func (s *InventoryFilter) SetValues(v []*string) *InventoryFilter { - s.Values = v - return s -} - -// Information collected from managed instances based on your inventory policy -// document -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InventoryItem -type InventoryItem struct { - _ struct{} `type:"structure"` - - // The time the inventory information was collected. - // - // CaptureTime is a required field - CaptureTime *string `type:"string" required:"true"` - - // The inventory data of the inventory type. - Content []map[string]*string `type:"list"` - - // MD5 hash of the inventory item type contents. The content hash is used to - // determine whether to update inventory information. The PutInventory API does - // not update the inventory item type contents if the MD5 hash has not changed - // since last update. - ContentHash *string `type:"string"` - - // The schema version for the inventory item. - // - // SchemaVersion is a required field - SchemaVersion *string `type:"string" required:"true"` - - // The name of the inventory type. Default inventory item type names start with - // AWS. Custom inventory type names will start with Custom. Default inventory - // item types include the following: AWS:AWSComponent, AWS:Application, AWS:InstanceInformation, - // AWS:Network, and AWS:WindowsUpdate. - // - // TypeName is a required field - TypeName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s InventoryItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryItem"} - if s.CaptureTime == nil { - invalidParams.Add(request.NewErrParamRequired("CaptureTime")) - } - if s.SchemaVersion == nil { - invalidParams.Add(request.NewErrParamRequired("SchemaVersion")) - } - if s.TypeName == nil { - invalidParams.Add(request.NewErrParamRequired("TypeName")) - } - if s.TypeName != nil && len(*s.TypeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaptureTime sets the CaptureTime field's value. -func (s *InventoryItem) SetCaptureTime(v string) *InventoryItem { - s.CaptureTime = &v - return s -} - -// SetContent sets the Content field's value. -func (s *InventoryItem) SetContent(v []map[string]*string) *InventoryItem { - s.Content = v - return s -} - -// SetContentHash sets the ContentHash field's value. -func (s *InventoryItem) SetContentHash(v string) *InventoryItem { - s.ContentHash = &v - return s -} - -// SetSchemaVersion sets the SchemaVersion field's value. -func (s *InventoryItem) SetSchemaVersion(v string) *InventoryItem { - s.SchemaVersion = &v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *InventoryItem) SetTypeName(v string) *InventoryItem { - s.TypeName = &v - return s -} - -// Attributes are the entries within the inventory item content. It contains -// name and value. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InventoryItemAttribute -type InventoryItemAttribute struct { - _ struct{} `type:"structure"` - - // The data type of the inventory item attribute. - // - // DataType is a required field - DataType *string `type:"string" required:"true" enum:"InventoryAttributeDataType"` - - // Name of the inventory item attribute. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s InventoryItemAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryItemAttribute) GoString() string { - return s.String() -} - -// SetDataType sets the DataType field's value. -func (s *InventoryItemAttribute) SetDataType(v string) *InventoryItemAttribute { - s.DataType = &v - return s -} - -// SetName sets the Name field's value. -func (s *InventoryItemAttribute) SetName(v string) *InventoryItemAttribute { - s.Name = &v - return s -} - -// The inventory item schema definition. Users can use this to compose inventory -// query filters. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InventoryItemSchema -type InventoryItemSchema struct { - _ struct{} `type:"structure"` - - // The schema attributes for inventory. This contains data type and attribute - // name. - // - // Attributes is a required field - Attributes []*InventoryItemAttribute `locationNameList:"Attribute" min:"1" type:"list" required:"true"` - - // The name of the inventory type. Default inventory item type names start with - // AWS. Custom inventory type names will start with Custom. Default inventory - // item types include the following: AWS:AWSComponent, AWS:Application, AWS:InstanceInformation, - // AWS:Network, and AWS:WindowsUpdate. - // - // TypeName is a required field - TypeName *string `min:"1" type:"string" required:"true"` - - // The schema version for the inventory item. - Version *string `type:"string"` -} - -// String returns the string representation -func (s InventoryItemSchema) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryItemSchema) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *InventoryItemSchema) SetAttributes(v []*InventoryItemAttribute) *InventoryItemSchema { - s.Attributes = v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *InventoryItemSchema) SetTypeName(v string) *InventoryItemSchema { - s.TypeName = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *InventoryItemSchema) SetVersion(v string) *InventoryItemSchema { - s.Version = &v - return s -} - -// Inventory query results. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InventoryResultEntity -type InventoryResultEntity struct { - _ struct{} `type:"structure"` - - // The data section in the inventory result entity json. - Data map[string]*InventoryResultItem `type:"map"` - - // ID of the inventory result entity. For example, for managed instance inventory - // the result will be the managed instance ID. For EC2 instance inventory, the - // result will be the instance ID. - Id *string `type:"string"` -} - -// String returns the string representation -func (s InventoryResultEntity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryResultEntity) GoString() string { - return s.String() -} - -// SetData sets the Data field's value. -func (s *InventoryResultEntity) SetData(v map[string]*InventoryResultItem) *InventoryResultEntity { - s.Data = v - return s -} - -// SetId sets the Id field's value. -func (s *InventoryResultEntity) SetId(v string) *InventoryResultEntity { - s.Id = &v - return s -} - -// The inventory result item. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InventoryResultItem -type InventoryResultItem struct { - _ struct{} `type:"structure"` - - // The time inventory item data was captured. - CaptureTime *string `type:"string"` - - // Contains all the inventory data of the item type. Results include attribute - // names and values. - // - // Content is a required field - Content []map[string]*string `type:"list" required:"true"` - - // MD5 hash of the inventory item type contents. The content hash is used to - // determine whether to update inventory information. The PutInventory API does - // not update the inventory item type contents if the MD5 hash has not changed - // since last update. - ContentHash *string `type:"string"` - - // The schema version for the inventory result item/ - // - // SchemaVersion is a required field - SchemaVersion *string `type:"string" required:"true"` - - // The name of the inventory result item type. - // - // TypeName is a required field - TypeName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s InventoryResultItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryResultItem) GoString() string { - return s.String() -} - -// SetCaptureTime sets the CaptureTime field's value. -func (s *InventoryResultItem) SetCaptureTime(v string) *InventoryResultItem { - s.CaptureTime = &v - return s -} - -// SetContent sets the Content field's value. -func (s *InventoryResultItem) SetContent(v []map[string]*string) *InventoryResultItem { - s.Content = v - return s -} - -// SetContentHash sets the ContentHash field's value. -func (s *InventoryResultItem) SetContentHash(v string) *InventoryResultItem { - s.ContentHash = &v - return s -} - -// SetSchemaVersion sets the SchemaVersion field's value. -func (s *InventoryResultItem) SetSchemaVersion(v string) *InventoryResultItem { - s.SchemaVersion = &v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *InventoryResultItem) SetTypeName(v string) *InventoryResultItem { - s.TypeName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociationsRequest -type ListAssociationsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. Use a filter to return a more specific list of results. - AssociationFilterList []*AssociationFilter `locationNameList:"AssociationFilter" min:"1" type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListAssociationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssociationsInput"} - if s.AssociationFilterList != nil && len(s.AssociationFilterList) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssociationFilterList", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.AssociationFilterList != nil { - for i, v := range s.AssociationFilterList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AssociationFilterList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationFilterList sets the AssociationFilterList field's value. -func (s *ListAssociationsInput) SetAssociationFilterList(v []*AssociationFilter) *ListAssociationsInput { - s.AssociationFilterList = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssociationsInput) SetMaxResults(v int64) *ListAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssociationsInput) SetNextToken(v string) *ListAssociationsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociationsResult -type ListAssociationsOutput struct { - _ struct{} `type:"structure"` - - // The associations. - Associations []*Association `locationNameList:"Association" type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s ListAssociationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAssociationsOutput) GoString() string { - return s.String() -} - -// SetAssociations sets the Associations field's value. -func (s *ListAssociationsOutput) SetAssociations(v []*Association) *ListAssociationsOutput { - s.Associations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssociationsOutput) SetNextToken(v string) *ListAssociationsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandInvocationsRequest -type ListCommandInvocationsInput struct { - _ struct{} `type:"structure"` - - // (Optional) The invocations for a specific command ID. - CommandId *string `min:"36" type:"string"` - - // (Optional) If set this returns the response of the command executions and - // any command output. By default this is set to False. - Details *bool `type:"boolean"` - - // (Optional) One or more filters. Use a filter to return a more specific list - // of results. - Filters []*CommandFilter `min:"1" type:"list"` - - // (Optional) The command execution details for a specific instance ID. - InstanceId *string `type:"string"` - - // (Optional) The maximum number of items to return for this call. The call - // also returns a token that you can specify in a subsequent call to get the - // next set of results. - MaxResults *int64 `min:"1" type:"integer"` - - // (Optional) The token for the next set of items to return. (You received this - // token from a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListCommandInvocationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCommandInvocationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCommandInvocationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCommandInvocationsInput"} - if s.CommandId != nil && len(*s.CommandId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CommandId", 36)) - } - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommandId sets the CommandId field's value. -func (s *ListCommandInvocationsInput) SetCommandId(v string) *ListCommandInvocationsInput { - s.CommandId = &v - return s -} - -// SetDetails sets the Details field's value. -func (s *ListCommandInvocationsInput) SetDetails(v bool) *ListCommandInvocationsInput { - s.Details = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *ListCommandInvocationsInput) SetFilters(v []*CommandFilter) *ListCommandInvocationsInput { - s.Filters = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ListCommandInvocationsInput) SetInstanceId(v string) *ListCommandInvocationsInput { - s.InstanceId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCommandInvocationsInput) SetMaxResults(v int64) *ListCommandInvocationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCommandInvocationsInput) SetNextToken(v string) *ListCommandInvocationsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandInvocationsResult -type ListCommandInvocationsOutput struct { - _ struct{} `type:"structure"` - - // (Optional) A list of all invocations. - CommandInvocations []*CommandInvocation `type:"list"` - - // (Optional) The token for the next set of items to return. (You received this - // token from a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListCommandInvocationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCommandInvocationsOutput) GoString() string { - return s.String() -} - -// SetCommandInvocations sets the CommandInvocations field's value. -func (s *ListCommandInvocationsOutput) SetCommandInvocations(v []*CommandInvocation) *ListCommandInvocationsOutput { - s.CommandInvocations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCommandInvocationsOutput) SetNextToken(v string) *ListCommandInvocationsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandsRequest -type ListCommandsInput struct { - _ struct{} `type:"structure"` - - // (Optional) If provided, lists only the specified command. - CommandId *string `min:"36" type:"string"` - - // (Optional) One or more filters. Use a filter to return a more specific list - // of results. - Filters []*CommandFilter `min:"1" type:"list"` - - // (Optional) Lists commands issued against this instance ID. - InstanceId *string `type:"string"` - - // (Optional) The maximum number of items to return for this call. The call - // also returns a token that you can specify in a subsequent call to get the - // next set of results. - MaxResults *int64 `min:"1" type:"integer"` - - // (Optional) The token for the next set of items to return. (You received this - // token from a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListCommandsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCommandsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCommandsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCommandsInput"} - if s.CommandId != nil && len(*s.CommandId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CommandId", 36)) - } - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommandId sets the CommandId field's value. -func (s *ListCommandsInput) SetCommandId(v string) *ListCommandsInput { - s.CommandId = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *ListCommandsInput) SetFilters(v []*CommandFilter) *ListCommandsInput { - s.Filters = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ListCommandsInput) SetInstanceId(v string) *ListCommandsInput { - s.InstanceId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCommandsInput) SetMaxResults(v int64) *ListCommandsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCommandsInput) SetNextToken(v string) *ListCommandsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandsResult -type ListCommandsOutput struct { - _ struct{} `type:"structure"` - - // (Optional) The list of commands requested by the user. - Commands []*Command `type:"list"` - - // (Optional) The token for the next set of items to return. (You received this - // token from a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListCommandsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCommandsOutput) GoString() string { - return s.String() -} - -// SetCommands sets the Commands field's value. -func (s *ListCommandsOutput) SetCommands(v []*Command) *ListCommandsOutput { - s.Commands = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCommandsOutput) SetNextToken(v string) *ListCommandsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentVersionsRequest -type ListDocumentVersionsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The name of the document about which you want version information. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListDocumentVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDocumentVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDocumentVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDocumentVersionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDocumentVersionsInput) SetMaxResults(v int64) *ListDocumentVersionsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListDocumentVersionsInput) SetName(v string) *ListDocumentVersionsInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDocumentVersionsInput) SetNextToken(v string) *ListDocumentVersionsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentVersionsResult -type ListDocumentVersionsOutput struct { - _ struct{} `type:"structure"` - - // The document versions. - DocumentVersions []*DocumentVersionInfo `min:"1" type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s ListDocumentVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDocumentVersionsOutput) GoString() string { - return s.String() -} - -// SetDocumentVersions sets the DocumentVersions field's value. -func (s *ListDocumentVersionsOutput) SetDocumentVersions(v []*DocumentVersionInfo) *ListDocumentVersionsOutput { - s.DocumentVersions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDocumentVersionsOutput) SetNextToken(v string) *ListDocumentVersionsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentsRequest -type ListDocumentsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. Use a filter to return a more specific list of results. - DocumentFilterList []*DocumentFilter `locationNameList:"DocumentFilter" min:"1" type:"list"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s ListDocumentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDocumentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDocumentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDocumentsInput"} - if s.DocumentFilterList != nil && len(s.DocumentFilterList) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DocumentFilterList", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.DocumentFilterList != nil { - for i, v := range s.DocumentFilterList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DocumentFilterList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentFilterList sets the DocumentFilterList field's value. -func (s *ListDocumentsInput) SetDocumentFilterList(v []*DocumentFilter) *ListDocumentsInput { - s.DocumentFilterList = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDocumentsInput) SetMaxResults(v int64) *ListDocumentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDocumentsInput) SetNextToken(v string) *ListDocumentsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentsResult -type ListDocumentsOutput struct { - _ struct{} `type:"structure"` - - // The names of the SSM documents. - DocumentIdentifiers []*DocumentIdentifier `locationNameList:"DocumentIdentifier" type:"list"` - - // 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 `type:"string"` -} - -// String returns the string representation -func (s ListDocumentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDocumentsOutput) GoString() string { - return s.String() -} - -// SetDocumentIdentifiers sets the DocumentIdentifiers field's value. -func (s *ListDocumentsOutput) SetDocumentIdentifiers(v []*DocumentIdentifier) *ListDocumentsOutput { - s.DocumentIdentifiers = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDocumentsOutput) SetNextToken(v string) *ListDocumentsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListInventoryEntriesRequest -type ListInventoryEntriesInput struct { - _ struct{} `type:"structure"` - - // One or more filters. Use a filter to return a more specific list of results. - Filters []*InventoryFilter `locationNameList:"InventoryFilter" min:"1" type:"list"` - - // The instance ID for which you want inventory information. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The maximum number of items to return for this call. The call also returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a previous call.) - NextToken *string `type:"string"` - - // The type of inventory item for which you want information. - // - // TypeName is a required field - TypeName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListInventoryEntriesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInventoryEntriesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInventoryEntriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInventoryEntriesInput"} - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.TypeName == nil { - invalidParams.Add(request.NewErrParamRequired("TypeName")) - } - if s.TypeName != nil && len(*s.TypeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeName", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListInventoryEntriesInput) SetFilters(v []*InventoryFilter) *ListInventoryEntriesInput { - s.Filters = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ListInventoryEntriesInput) SetInstanceId(v string) *ListInventoryEntriesInput { - s.InstanceId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListInventoryEntriesInput) SetMaxResults(v int64) *ListInventoryEntriesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListInventoryEntriesInput) SetNextToken(v string) *ListInventoryEntriesInput { - s.NextToken = &v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *ListInventoryEntriesInput) SetTypeName(v string) *ListInventoryEntriesInput { - s.TypeName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListInventoryEntriesResult -type ListInventoryEntriesOutput struct { - _ struct{} `type:"structure"` - - // The time that inventory information was collected for the instance(s). - CaptureTime *string `type:"string"` - - // A list of inventory items on the instance(s). - Entries []map[string]*string `type:"list"` - - // The instance ID targeted by the request to query inventory information. - InstanceId *string `type:"string"` - - // 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 `type:"string"` - - // The inventory schema version used by the instance(s). - SchemaVersion *string `type:"string"` - - // The type of inventory item returned by the request. - TypeName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListInventoryEntriesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInventoryEntriesOutput) GoString() string { - return s.String() -} - -// SetCaptureTime sets the CaptureTime field's value. -func (s *ListInventoryEntriesOutput) SetCaptureTime(v string) *ListInventoryEntriesOutput { - s.CaptureTime = &v - return s -} - -// SetEntries sets the Entries field's value. -func (s *ListInventoryEntriesOutput) SetEntries(v []map[string]*string) *ListInventoryEntriesOutput { - s.Entries = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ListInventoryEntriesOutput) SetInstanceId(v string) *ListInventoryEntriesOutput { - s.InstanceId = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListInventoryEntriesOutput) SetNextToken(v string) *ListInventoryEntriesOutput { - s.NextToken = &v - return s -} - -// SetSchemaVersion sets the SchemaVersion field's value. -func (s *ListInventoryEntriesOutput) SetSchemaVersion(v string) *ListInventoryEntriesOutput { - s.SchemaVersion = &v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *ListInventoryEntriesOutput) SetTypeName(v string) *ListInventoryEntriesOutput { - s.TypeName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListTagsForResourceRequest -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The resource ID for which you want to see a list of tags. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // Returns a list of tags for a specific resource type. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"ResourceTypeForTagging"` -} - -// 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 -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListTagsForResourceResult -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of tags. - TagList []*Tag `type:"list"` -} - -// 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() -} - -// SetTagList sets the TagList field's value. -func (s *ListTagsForResourceOutput) SetTagList(v []*Tag) *ListTagsForResourceOutput { - s.TagList = v - return s -} - -// Information about an Amazon S3 bucket to write instance-level logs to. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/LoggingInfo -type LoggingInfo struct { - _ struct{} `type:"structure"` - - // The name of an Amazon S3 bucket where execution logs are stored . - // - // S3BucketName is a required field - S3BucketName *string `min:"3" type:"string" required:"true"` - - // (Optional) The Amazon S3 bucket subfolder. - S3KeyPrefix *string `type:"string"` - - // The region where the Amazon S3 bucket is located. - // - // S3Region is a required field - S3Region *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s LoggingInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoggingInfo) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LoggingInfo) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LoggingInfo"} - if s.S3BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketName")) - } - if s.S3BucketName != nil && len(*s.S3BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("S3BucketName", 3)) - } - if s.S3Region == nil { - invalidParams.Add(request.NewErrParamRequired("S3Region")) - } - if s.S3Region != nil && len(*s.S3Region) < 3 { - invalidParams.Add(request.NewErrParamMinLen("S3Region", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *LoggingInfo) SetS3BucketName(v string) *LoggingInfo { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *LoggingInfo) SetS3KeyPrefix(v string) *LoggingInfo { - s.S3KeyPrefix = &v - return s -} - -// SetS3Region sets the S3Region field's value. -func (s *LoggingInfo) SetS3Region(v string) *LoggingInfo { - s.S3Region = &v - return s -} - -// Describes the information about an execution of a Maintenance Window. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/MaintenanceWindowExecution -type MaintenanceWindowExecution struct { - _ struct{} `type:"structure"` - - // The time the execution finished. - EndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time the execution started. - StartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The status of the execution. - Status *string `type:"string" enum:"MaintenanceWindowExecutionStatus"` - - // The details explaining the Status. Only available for certain status values. - StatusDetails *string `type:"string"` - - // The ID of the Maintenance Window execution. - WindowExecutionId *string `min:"36" type:"string"` - - // The ID of the Maintenance Window. - WindowId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s MaintenanceWindowExecution) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaintenanceWindowExecution) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *MaintenanceWindowExecution) SetEndTime(v time.Time) *MaintenanceWindowExecution { - s.EndTime = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *MaintenanceWindowExecution) SetStartTime(v time.Time) *MaintenanceWindowExecution { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *MaintenanceWindowExecution) SetStatus(v string) *MaintenanceWindowExecution { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *MaintenanceWindowExecution) SetStatusDetails(v string) *MaintenanceWindowExecution { - s.StatusDetails = &v - return s -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *MaintenanceWindowExecution) SetWindowExecutionId(v string) *MaintenanceWindowExecution { - s.WindowExecutionId = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *MaintenanceWindowExecution) SetWindowId(v string) *MaintenanceWindowExecution { - s.WindowId = &v - return s -} - -// Information about a task execution performed as part of a Maintenance Window -// execution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/MaintenanceWindowExecutionTaskIdentity -type MaintenanceWindowExecutionTaskIdentity struct { - _ struct{} `type:"structure"` - - // The time the task execution finished. - EndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The time the task execution started. - StartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The status of the task execution. - Status *string `type:"string" enum:"MaintenanceWindowExecutionStatus"` - - // The details explaining the status of the task execution. Only available for - // certain status values. - StatusDetails *string `type:"string"` - - // The ARN of the executed task. - TaskArn *string `min:"1" type:"string"` - - // The ID of the specific task execution in the Maintenance Window execution. - TaskExecutionId *string `min:"36" type:"string"` - - // The type of executed task. - TaskType *string `type:"string" enum:"MaintenanceWindowTaskType"` - - // The ID of the Maintenance Window execution that ran the task. - WindowExecutionId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s MaintenanceWindowExecutionTaskIdentity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaintenanceWindowExecutionTaskIdentity) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *MaintenanceWindowExecutionTaskIdentity) SetEndTime(v time.Time) *MaintenanceWindowExecutionTaskIdentity { - s.EndTime = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *MaintenanceWindowExecutionTaskIdentity) SetStartTime(v time.Time) *MaintenanceWindowExecutionTaskIdentity { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *MaintenanceWindowExecutionTaskIdentity) SetStatus(v string) *MaintenanceWindowExecutionTaskIdentity { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *MaintenanceWindowExecutionTaskIdentity) SetStatusDetails(v string) *MaintenanceWindowExecutionTaskIdentity { - s.StatusDetails = &v - return s -} - -// SetTaskArn sets the TaskArn field's value. -func (s *MaintenanceWindowExecutionTaskIdentity) SetTaskArn(v string) *MaintenanceWindowExecutionTaskIdentity { - s.TaskArn = &v - return s -} - -// SetTaskExecutionId sets the TaskExecutionId field's value. -func (s *MaintenanceWindowExecutionTaskIdentity) SetTaskExecutionId(v string) *MaintenanceWindowExecutionTaskIdentity { - s.TaskExecutionId = &v - return s -} - -// SetTaskType sets the TaskType field's value. -func (s *MaintenanceWindowExecutionTaskIdentity) SetTaskType(v string) *MaintenanceWindowExecutionTaskIdentity { - s.TaskType = &v - return s -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *MaintenanceWindowExecutionTaskIdentity) SetWindowExecutionId(v string) *MaintenanceWindowExecutionTaskIdentity { - s.WindowExecutionId = &v - return s -} - -// Describes the information about a task invocation for a particular target -// as part of a task execution performed as part of a Maintenance Window execution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/MaintenanceWindowExecutionTaskInvocationIdentity -type MaintenanceWindowExecutionTaskInvocationIdentity struct { - _ struct{} `type:"structure"` - - // The time the invocation finished. - EndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The ID of the action performed in the service that actually handled the task - // invocation. If the task type is RUN_COMMAND, this value is the command ID. - ExecutionId *string `type:"string"` - - // The ID of the task invocation. - InvocationId *string `min:"36" type:"string"` - - // User-provided value that was specified when the target was registered with - // the Maintenance Window. This was also included in any CloudWatch events raised - // during the task invocation. - OwnerInformation *string `min:"1" type:"string"` - - // The parameters that were provided for the invocation when it was executed. - Parameters *string `type:"string"` - - // The time the invocation started. - StartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The status of the task invocation. - Status *string `type:"string" enum:"MaintenanceWindowExecutionStatus"` - - // The details explaining the status of the task invocation. Only available - // for certain Status values. - StatusDetails *string `type:"string"` - - // The ID of the specific task execution in the Maintenance Window execution. - TaskExecutionId *string `min:"36" type:"string"` - - // The ID of the Maintenance Window execution that ran the task. - WindowExecutionId *string `min:"36" type:"string"` - - // The ID of the target definition in this Maintenance Window the invocation - // was performed for. - WindowTargetId *string `type:"string"` -} - -// String returns the string representation -func (s MaintenanceWindowExecutionTaskInvocationIdentity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaintenanceWindowExecutionTaskInvocationIdentity) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetEndTime(v time.Time) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.EndTime = &v - return s -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetExecutionId(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.ExecutionId = &v - return s -} - -// SetInvocationId sets the InvocationId field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetInvocationId(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.InvocationId = &v - return s -} - -// SetOwnerInformation sets the OwnerInformation field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetOwnerInformation(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.OwnerInformation = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetParameters(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.Parameters = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetStartTime(v time.Time) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetStatus(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.Status = &v - return s -} - -// SetStatusDetails sets the StatusDetails field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetStatusDetails(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.StatusDetails = &v - return s -} - -// SetTaskExecutionId sets the TaskExecutionId field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetTaskExecutionId(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.TaskExecutionId = &v - return s -} - -// SetWindowExecutionId sets the WindowExecutionId field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetWindowExecutionId(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.WindowExecutionId = &v - return s -} - -// SetWindowTargetId sets the WindowTargetId field's value. -func (s *MaintenanceWindowExecutionTaskInvocationIdentity) SetWindowTargetId(v string) *MaintenanceWindowExecutionTaskInvocationIdentity { - s.WindowTargetId = &v - return s -} - -// Filter used in the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/MaintenanceWindowFilter -type MaintenanceWindowFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter. - Key *string `min:"1" type:"string"` - - // The filter values. - Values []*string `type:"list"` -} - -// String returns the string representation -func (s MaintenanceWindowFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaintenanceWindowFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MaintenanceWindowFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MaintenanceWindowFilter"} - 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 *MaintenanceWindowFilter) SetKey(v string) *MaintenanceWindowFilter { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *MaintenanceWindowFilter) SetValues(v []*string) *MaintenanceWindowFilter { - s.Values = v - return s -} - -// Information about the Maintenance Window. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/MaintenanceWindowIdentity -type MaintenanceWindowIdentity struct { - _ struct{} `type:"structure"` - - // The number of hours before the end of the Maintenance Window that Systems - // Manager stops scheduling new tasks for execution. - Cutoff *int64 `type:"integer"` - - // The duration of the Maintenance Window in hours. - Duration *int64 `min:"1" type:"integer"` - - // Whether the Maintenance Window is enabled. - Enabled *bool `type:"boolean"` - - // The name of the Maintenance Window. - Name *string `min:"3" type:"string"` - - // The ID of the Maintenance Window. - WindowId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s MaintenanceWindowIdentity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaintenanceWindowIdentity) GoString() string { - return s.String() -} - -// SetCutoff sets the Cutoff field's value. -func (s *MaintenanceWindowIdentity) SetCutoff(v int64) *MaintenanceWindowIdentity { - s.Cutoff = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *MaintenanceWindowIdentity) SetDuration(v int64) *MaintenanceWindowIdentity { - s.Duration = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *MaintenanceWindowIdentity) SetEnabled(v bool) *MaintenanceWindowIdentity { - s.Enabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *MaintenanceWindowIdentity) SetName(v string) *MaintenanceWindowIdentity { - s.Name = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *MaintenanceWindowIdentity) SetWindowId(v string) *MaintenanceWindowIdentity { - s.WindowId = &v - return s -} - -// The target registered with the Maintenance Window. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/MaintenanceWindowTarget -type MaintenanceWindowTarget struct { - _ struct{} `type:"structure"` - - // User-provided value that will be included in any CloudWatch events raised - // while running tasks for these targets in this Maintenance Window. - OwnerInformation *string `min:"1" type:"string"` - - // The type of target. - ResourceType *string `type:"string" enum:"MaintenanceWindowResourceType"` - - // The targets (either instances or tags). Instances are specified using Key=instanceids,Values=,. - // Tags are specified using Key=,Values=. - Targets []*Target `type:"list"` - - // The Maintenance Window ID where the target is registered. - WindowId *string `min:"20" type:"string"` - - // The ID of the target. - WindowTargetId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s MaintenanceWindowTarget) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaintenanceWindowTarget) GoString() string { - return s.String() -} - -// SetOwnerInformation sets the OwnerInformation field's value. -func (s *MaintenanceWindowTarget) SetOwnerInformation(v string) *MaintenanceWindowTarget { - s.OwnerInformation = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *MaintenanceWindowTarget) SetResourceType(v string) *MaintenanceWindowTarget { - s.ResourceType = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *MaintenanceWindowTarget) SetTargets(v []*Target) *MaintenanceWindowTarget { - s.Targets = v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *MaintenanceWindowTarget) SetWindowId(v string) *MaintenanceWindowTarget { - s.WindowId = &v - return s -} - -// SetWindowTargetId sets the WindowTargetId field's value. -func (s *MaintenanceWindowTarget) SetWindowTargetId(v string) *MaintenanceWindowTarget { - s.WindowTargetId = &v - return s -} - -// Information about a task defined for a Maintenance Window. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/MaintenanceWindowTask -type MaintenanceWindowTask struct { - _ struct{} `type:"structure"` - - // Information about an Amazon S3 bucket to write task-level logs to. - LoggingInfo *LoggingInfo `type:"structure"` - - // The maximum number of targets this task can be run for in parallel. - MaxConcurrency *string `min:"1" type:"string"` - - // The maximum number of errors allowed before this task stops being scheduled. - MaxErrors *string `min:"1" type:"string"` - - // The priority of the task in the Maintenance Window, the lower the number - // the higher the priority. Tasks in a Maintenance Window are scheduled in priority - // order with tasks that have the same priority scheduled in parallel. - Priority *int64 `type:"integer"` - - // The role that should be assumed when executing the task - ServiceRoleArn *string `type:"string"` - - // The targets (either instances or tags). Instances are specified using Key=instanceids,Values=,. - // Tags are specified using Key=,Values=. - Targets []*Target `type:"list"` - - // The ARN of the task to execute. - TaskArn *string `min:"1" type:"string"` - - // The parameters that should be passed to the task when it is executed. - TaskParameters map[string]*MaintenanceWindowTaskParameterValueExpression `type:"map"` - - // The type of task. - Type *string `type:"string" enum:"MaintenanceWindowTaskType"` - - // The Maintenance Window ID where the task is registered. - WindowId *string `min:"20" type:"string"` - - // The task ID. - WindowTaskId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s MaintenanceWindowTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaintenanceWindowTask) GoString() string { - return s.String() -} - -// SetLoggingInfo sets the LoggingInfo field's value. -func (s *MaintenanceWindowTask) SetLoggingInfo(v *LoggingInfo) *MaintenanceWindowTask { - s.LoggingInfo = v - return s -} - -// SetMaxConcurrency sets the MaxConcurrency field's value. -func (s *MaintenanceWindowTask) SetMaxConcurrency(v string) *MaintenanceWindowTask { - s.MaxConcurrency = &v - return s -} - -// SetMaxErrors sets the MaxErrors field's value. -func (s *MaintenanceWindowTask) SetMaxErrors(v string) *MaintenanceWindowTask { - s.MaxErrors = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *MaintenanceWindowTask) SetPriority(v int64) *MaintenanceWindowTask { - s.Priority = &v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *MaintenanceWindowTask) SetServiceRoleArn(v string) *MaintenanceWindowTask { - s.ServiceRoleArn = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *MaintenanceWindowTask) SetTargets(v []*Target) *MaintenanceWindowTask { - s.Targets = v - return s -} - -// SetTaskArn sets the TaskArn field's value. -func (s *MaintenanceWindowTask) SetTaskArn(v string) *MaintenanceWindowTask { - s.TaskArn = &v - return s -} - -// SetTaskParameters sets the TaskParameters field's value. -func (s *MaintenanceWindowTask) SetTaskParameters(v map[string]*MaintenanceWindowTaskParameterValueExpression) *MaintenanceWindowTask { - s.TaskParameters = v - return s -} - -// SetType sets the Type field's value. -func (s *MaintenanceWindowTask) SetType(v string) *MaintenanceWindowTask { - s.Type = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *MaintenanceWindowTask) SetWindowId(v string) *MaintenanceWindowTask { - s.WindowId = &v - return s -} - -// SetWindowTaskId sets the WindowTaskId field's value. -func (s *MaintenanceWindowTask) SetWindowTaskId(v string) *MaintenanceWindowTask { - s.WindowTaskId = &v - return s -} - -// Defines the values for a task parameter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/MaintenanceWindowTaskParameterValueExpression -type MaintenanceWindowTaskParameterValueExpression struct { - _ struct{} `type:"structure"` - - // This field contains an array of 0 or more strings, each 1 to 255 characters - // in length. - Values []*string `type:"list"` -} - -// String returns the string representation -func (s MaintenanceWindowTaskParameterValueExpression) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MaintenanceWindowTaskParameterValueExpression) GoString() string { - return s.String() -} - -// SetValues sets the Values field's value. -func (s *MaintenanceWindowTaskParameterValueExpression) SetValues(v []*string) *MaintenanceWindowTaskParameterValueExpression { - s.Values = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ModifyDocumentPermissionRequest -type ModifyDocumentPermissionInput struct { - _ struct{} `type:"structure"` - - // The AWS user accounts that should have access to the document. The account - // IDs can either be a group of account IDs or All. - AccountIdsToAdd []*string `locationNameList:"AccountId" type:"list"` - - // The AWS user accounts that should no longer have access to the document. - // The AWS user account can either be a group of account IDs or All. This action - // has a higher priority than AccountIdsToAdd. If you specify an account ID - // to add and the same ID to remove, the system removes access to the document. - AccountIdsToRemove []*string `locationNameList:"AccountId" type:"list"` - - // The name of the document that you want to share. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The permission type for the document. The permission type can be Share. - // - // PermissionType is a required field - PermissionType *string `type:"string" required:"true" enum:"DocumentPermissionType"` -} - -// String returns the string representation -func (s ModifyDocumentPermissionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDocumentPermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyDocumentPermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyDocumentPermissionInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.PermissionType == nil { - invalidParams.Add(request.NewErrParamRequired("PermissionType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountIdsToAdd sets the AccountIdsToAdd field's value. -func (s *ModifyDocumentPermissionInput) SetAccountIdsToAdd(v []*string) *ModifyDocumentPermissionInput { - s.AccountIdsToAdd = v - return s -} - -// SetAccountIdsToRemove sets the AccountIdsToRemove field's value. -func (s *ModifyDocumentPermissionInput) SetAccountIdsToRemove(v []*string) *ModifyDocumentPermissionInput { - s.AccountIdsToRemove = v - return s -} - -// SetName sets the Name field's value. -func (s *ModifyDocumentPermissionInput) SetName(v string) *ModifyDocumentPermissionInput { - s.Name = &v - return s -} - -// SetPermissionType sets the PermissionType field's value. -func (s *ModifyDocumentPermissionInput) SetPermissionType(v string) *ModifyDocumentPermissionInput { - s.PermissionType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ModifyDocumentPermissionResponse -type ModifyDocumentPermissionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyDocumentPermissionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDocumentPermissionOutput) GoString() string { - return s.String() -} - -// Configurations for sending notifications. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/NotificationConfig -type NotificationConfig struct { - _ struct{} `type:"structure"` - - // An Amazon Resource Name (ARN) for a Simple Notification Service (SNS) topic. - // Run Command pushes notifications about command status changes to this topic. - NotificationArn *string `type:"string"` - - // The different events for which you can receive notifications. These events - // include the following: All (events), InProgress, Success, TimedOut, Cancelled, - // Failed. To learn more about these events, see Monitoring Commands (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-commands.html) - // in the Amazon Elastic Compute Cloud User Guide . - NotificationEvents []*string `type:"list"` - - // Command: Receive notification when the status of a command changes. Invocation: - // For commands sent to multiple instances, receive notification on a per-instance - // basis when the status of a command changes. - NotificationType *string `type:"string" enum:"NotificationType"` -} - -// String returns the string representation -func (s NotificationConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NotificationConfig) GoString() string { - return s.String() -} - -// SetNotificationArn sets the NotificationArn field's value. -func (s *NotificationConfig) SetNotificationArn(v string) *NotificationConfig { - s.NotificationArn = &v - return s -} - -// SetNotificationEvents sets the NotificationEvents field's value. -func (s *NotificationConfig) SetNotificationEvents(v []*string) *NotificationConfig { - s.NotificationEvents = v - return s -} - -// SetNotificationType sets the NotificationType field's value. -func (s *NotificationConfig) SetNotificationType(v string) *NotificationConfig { - s.NotificationType = &v - return s -} - -// An Amazon EC2 Systems Manager parameter in Parameter Store. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Parameter -type Parameter struct { - _ struct{} `type:"structure"` - - // The name of the parameter. - Name *string `min:"1" type:"string"` - - // The type of parameter. Valid values include the following: String, String - // list, Secure string. - Type *string `type:"string" enum:"ParameterType"` - - // The parameter value. - Value *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s Parameter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Parameter) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Parameter) SetName(v string) *Parameter { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *Parameter) SetType(v string) *Parameter { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Parameter) SetValue(v string) *Parameter { - s.Value = &v - return s -} - -// Information about parameter usage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ParameterHistory -type ParameterHistory struct { - _ struct{} `type:"structure"` - - // Information about the parameter. - Description *string `min:"1" type:"string"` - - // The ID of the query key used for this parameter. - KeyId *string `min:"1" type:"string"` - - // Date the parameter was last changed or updated. - LastModifiedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Amazon Resource Name (ARN) of the AWS user who last changed the parameter. - LastModifiedUser *string `type:"string"` - - // The name of the parameter. - Name *string `min:"1" type:"string"` - - // The type of parameter used. - Type *string `type:"string" enum:"ParameterType"` - - // The parameter value. - Value *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ParameterHistory) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ParameterHistory) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ParameterHistory) SetDescription(v string) *ParameterHistory { - s.Description = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *ParameterHistory) SetKeyId(v string) *ParameterHistory { - s.KeyId = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *ParameterHistory) SetLastModifiedDate(v time.Time) *ParameterHistory { - s.LastModifiedDate = &v - return s -} - -// SetLastModifiedUser sets the LastModifiedUser field's value. -func (s *ParameterHistory) SetLastModifiedUser(v string) *ParameterHistory { - s.LastModifiedUser = &v - return s -} - -// SetName sets the Name field's value. -func (s *ParameterHistory) SetName(v string) *ParameterHistory { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *ParameterHistory) SetType(v string) *ParameterHistory { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ParameterHistory) SetValue(v string) *ParameterHistory { - s.Value = &v - return s -} - -// Metada includes information like the ARN of the last user and the date/time -// the parameter was last used. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ParameterMetadata -type ParameterMetadata struct { - _ struct{} `type:"structure"` - - // Description of the parameter actions. - Description *string `min:"1" type:"string"` - - // The ID of the query key used for this parameter. - KeyId *string `min:"1" type:"string"` - - // Date the parameter was last changed or updated. - LastModifiedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Amazon Resource Name (ARN) of the AWS user who last changed the parameter. - LastModifiedUser *string `type:"string"` - - // The parameter name. - Name *string `min:"1" type:"string"` - - // The type of parameter. Valid parameter types include the following: String, - // String list, Secure string. - Type *string `type:"string" enum:"ParameterType"` -} - -// String returns the string representation -func (s ParameterMetadata) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ParameterMetadata) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ParameterMetadata) SetDescription(v string) *ParameterMetadata { - s.Description = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *ParameterMetadata) SetKeyId(v string) *ParameterMetadata { - s.KeyId = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *ParameterMetadata) SetLastModifiedDate(v time.Time) *ParameterMetadata { - s.LastModifiedDate = &v - return s -} - -// SetLastModifiedUser sets the LastModifiedUser field's value. -func (s *ParameterMetadata) SetLastModifiedUser(v string) *ParameterMetadata { - s.LastModifiedUser = &v - return s -} - -// SetName sets the Name field's value. -func (s *ParameterMetadata) SetName(v string) *ParameterMetadata { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *ParameterMetadata) SetType(v string) *ParameterMetadata { - s.Type = &v - return s -} - -// One or more filters. Use a filter to return a more specific list of results. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ParametersFilter -type ParametersFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter. - Key *string `type:"string" enum:"ParametersFilterKey"` - - // The filter values. - // - // Values is a required field - Values []*string `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s ParametersFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ParametersFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ParametersFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ParametersFilter"} - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *ParametersFilter) SetKey(v string) *ParametersFilter { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *ParametersFilter) SetValues(v []*string) *ParametersFilter { - s.Values = v - return s -} - -// Represents metadata about a patch. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Patch -type Patch struct { - _ struct{} `type:"structure"` - - // The classification of the patch (for example, SecurityUpdates, Updates, CriticalUpdates). - Classification *string `type:"string"` - - // The URL where more information can be obtained about the patch. - ContentUrl *string `type:"string"` - - // The description of the patch. - Description *string `type:"string"` - - // The ID of the patch (this is different than the Microsoft Knowledge Base - // ID). - Id *string `type:"string"` - - // The Microsoft Knowledge Base ID of the patch. - KbNumber *string `type:"string"` - - // The language of the patch if it’s language-specific. - Language *string `type:"string"` - - // The ID of the MSRC bulletin the patch is related to. - MsrcNumber *string `type:"string"` - - // The severity of the patch (for example Critical, Important, Moderate). - MsrcSeverity *string `type:"string"` - - // The specific product the patch is applicable for (for example, WindowsServer2016). - Product *string `type:"string"` - - // The product family the patch is applicable for (for example, Windows). - ProductFamily *string `type:"string"` - - // The date the patch was released. - ReleaseDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The title of the patch. - Title *string `type:"string"` - - // The name of the vendor providing the patch. - Vendor *string `type:"string"` -} - -// String returns the string representation -func (s Patch) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Patch) GoString() string { - return s.String() -} - -// SetClassification sets the Classification field's value. -func (s *Patch) SetClassification(v string) *Patch { - s.Classification = &v - return s -} - -// SetContentUrl sets the ContentUrl field's value. -func (s *Patch) SetContentUrl(v string) *Patch { - s.ContentUrl = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Patch) SetDescription(v string) *Patch { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *Patch) SetId(v string) *Patch { - s.Id = &v - return s -} - -// SetKbNumber sets the KbNumber field's value. -func (s *Patch) SetKbNumber(v string) *Patch { - s.KbNumber = &v - return s -} - -// SetLanguage sets the Language field's value. -func (s *Patch) SetLanguage(v string) *Patch { - s.Language = &v - return s -} - -// SetMsrcNumber sets the MsrcNumber field's value. -func (s *Patch) SetMsrcNumber(v string) *Patch { - s.MsrcNumber = &v - return s -} - -// SetMsrcSeverity sets the MsrcSeverity field's value. -func (s *Patch) SetMsrcSeverity(v string) *Patch { - s.MsrcSeverity = &v - return s -} - -// SetProduct sets the Product field's value. -func (s *Patch) SetProduct(v string) *Patch { - s.Product = &v - return s -} - -// SetProductFamily sets the ProductFamily field's value. -func (s *Patch) SetProductFamily(v string) *Patch { - s.ProductFamily = &v - return s -} - -// SetReleaseDate sets the ReleaseDate field's value. -func (s *Patch) SetReleaseDate(v time.Time) *Patch { - s.ReleaseDate = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *Patch) SetTitle(v string) *Patch { - s.Title = &v - return s -} - -// SetVendor sets the Vendor field's value. -func (s *Patch) SetVendor(v string) *Patch { - s.Vendor = &v - return s -} - -// Defines the basic information about a patch baseline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchBaselineIdentity -type PatchBaselineIdentity struct { - _ struct{} `type:"structure"` - - // The description of the patch baseline. - BaselineDescription *string `min:"1" type:"string"` - - // The ID of the patch baseline. - BaselineId *string `min:"20" type:"string"` - - // The name of the patch baseline. - BaselineName *string `min:"3" type:"string"` - - // Whether this is the default baseline. - DefaultBaseline *bool `type:"boolean"` -} - -// String returns the string representation -func (s PatchBaselineIdentity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchBaselineIdentity) GoString() string { - return s.String() -} - -// SetBaselineDescription sets the BaselineDescription field's value. -func (s *PatchBaselineIdentity) SetBaselineDescription(v string) *PatchBaselineIdentity { - s.BaselineDescription = &v - return s -} - -// SetBaselineId sets the BaselineId field's value. -func (s *PatchBaselineIdentity) SetBaselineId(v string) *PatchBaselineIdentity { - s.BaselineId = &v - return s -} - -// SetBaselineName sets the BaselineName field's value. -func (s *PatchBaselineIdentity) SetBaselineName(v string) *PatchBaselineIdentity { - s.BaselineName = &v - return s -} - -// SetDefaultBaseline sets the DefaultBaseline field's value. -func (s *PatchBaselineIdentity) SetDefaultBaseline(v bool) *PatchBaselineIdentity { - s.DefaultBaseline = &v - return s -} - -// Information about the state of a patch on a particular instance as it relates -// to the patch baseline used to patch the instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchComplianceData -type PatchComplianceData struct { - _ struct{} `type:"structure"` - - // The classification of the patch (for example, SecurityUpdates, Updates, CriticalUpdates). - // - // Classification is a required field - Classification *string `type:"string" required:"true"` - - // The date/time the patch was installed on the instance. - // - // InstalledTime is a required field - InstalledTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The Microsoft Knowledge Base ID of the patch. - // - // KBId is a required field - KBId *string `type:"string" required:"true"` - - // The severity of the patch (for example, Critical, Important, Moderate). - // - // Severity is a required field - Severity *string `type:"string" required:"true"` - - // The state of the patch on the instance (INSTALLED, INSTALLED_OTHER, MISSING, - // NOT_APPLICABLE or FAILED). - // - // State is a required field - State *string `type:"string" required:"true" enum:"PatchComplianceDataState"` - - // The title of the patch. - // - // Title is a required field - Title *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PatchComplianceData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchComplianceData) GoString() string { - return s.String() -} - -// SetClassification sets the Classification field's value. -func (s *PatchComplianceData) SetClassification(v string) *PatchComplianceData { - s.Classification = &v - return s -} - -// SetInstalledTime sets the InstalledTime field's value. -func (s *PatchComplianceData) SetInstalledTime(v time.Time) *PatchComplianceData { - s.InstalledTime = &v - return s -} - -// SetKBId sets the KBId field's value. -func (s *PatchComplianceData) SetKBId(v string) *PatchComplianceData { - s.KBId = &v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *PatchComplianceData) SetSeverity(v string) *PatchComplianceData { - s.Severity = &v - return s -} - -// SetState sets the State field's value. -func (s *PatchComplianceData) SetState(v string) *PatchComplianceData { - s.State = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *PatchComplianceData) SetTitle(v string) *PatchComplianceData { - s.Title = &v - return s -} - -// Defines a patch filter. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchFilter -type PatchFilter struct { - _ struct{} `type:"structure"` - - // The key for the filter (PRODUCT, CLASSIFICATION, MSRC_SEVERITY, PATCH_ID) - // - // Key is a required field - Key *string `type:"string" required:"true" enum:"PatchFilterKey"` - - // The value for the filter key. - // - // Values is a required field - Values []*string `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PatchFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PatchFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PatchFilter"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *PatchFilter) SetKey(v string) *PatchFilter { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *PatchFilter) SetValues(v []*string) *PatchFilter { - s.Values = v - return s -} - -// A set of patch filters, typically used for approval rules. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchFilterGroup -type PatchFilterGroup struct { - _ struct{} `type:"structure"` - - // The set of patch filters that make up the group. - // - // PatchFilters is a required field - PatchFilters []*PatchFilter `type:"list" required:"true"` -} - -// String returns the string representation -func (s PatchFilterGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchFilterGroup) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PatchFilterGroup) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PatchFilterGroup"} - if s.PatchFilters == nil { - invalidParams.Add(request.NewErrParamRequired("PatchFilters")) - } - if s.PatchFilters != nil { - for i, v := range s.PatchFilters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PatchFilters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPatchFilters sets the PatchFilters field's value. -func (s *PatchFilterGroup) SetPatchFilters(v []*PatchFilter) *PatchFilterGroup { - s.PatchFilters = v - return s -} - -// The mapping between a patch group and the patch baseline the patch group -// is registered with. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchGroupPatchBaselineMapping -type PatchGroupPatchBaselineMapping struct { - _ struct{} `type:"structure"` - - // The patch baseline the patch group is registered with. - BaselineIdentity *PatchBaselineIdentity `type:"structure"` - - // The name of the patch group registered with the patch baseline. - PatchGroup *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PatchGroupPatchBaselineMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchGroupPatchBaselineMapping) GoString() string { - return s.String() -} - -// SetBaselineIdentity sets the BaselineIdentity field's value. -func (s *PatchGroupPatchBaselineMapping) SetBaselineIdentity(v *PatchBaselineIdentity) *PatchGroupPatchBaselineMapping { - s.BaselineIdentity = v - return s -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *PatchGroupPatchBaselineMapping) SetPatchGroup(v string) *PatchGroupPatchBaselineMapping { - s.PatchGroup = &v - return s -} - -// Defines a filter used in Patch Manager APIs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchOrchestratorFilter -type PatchOrchestratorFilter struct { - _ struct{} `type:"structure"` - - // The key for the filter. - Key *string `min:"1" type:"string"` - - // The value for the filter. - Values []*string `type:"list"` -} - -// String returns the string representation -func (s PatchOrchestratorFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchOrchestratorFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PatchOrchestratorFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PatchOrchestratorFilter"} - 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 *PatchOrchestratorFilter) SetKey(v string) *PatchOrchestratorFilter { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *PatchOrchestratorFilter) SetValues(v []*string) *PatchOrchestratorFilter { - s.Values = v - return s -} - -// Defines an approval rule for a patch baseline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchRule -type PatchRule struct { - _ struct{} `type:"structure"` - - // The number of days after the release date of each patch matched by the rule - // the patch is marked as approved in the patch baseline. - // - // ApproveAfterDays is a required field - ApproveAfterDays *int64 `type:"integer" required:"true"` - - // The patch filter group that defines the criteria for the rule. - // - // PatchFilterGroup is a required field - PatchFilterGroup *PatchFilterGroup `type:"structure" required:"true"` -} - -// String returns the string representation -func (s PatchRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PatchRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PatchRule"} - if s.ApproveAfterDays == nil { - invalidParams.Add(request.NewErrParamRequired("ApproveAfterDays")) - } - if s.PatchFilterGroup == nil { - invalidParams.Add(request.NewErrParamRequired("PatchFilterGroup")) - } - if s.PatchFilterGroup != nil { - if err := s.PatchFilterGroup.Validate(); err != nil { - invalidParams.AddNested("PatchFilterGroup", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApproveAfterDays sets the ApproveAfterDays field's value. -func (s *PatchRule) SetApproveAfterDays(v int64) *PatchRule { - s.ApproveAfterDays = &v - return s -} - -// SetPatchFilterGroup sets the PatchFilterGroup field's value. -func (s *PatchRule) SetPatchFilterGroup(v *PatchFilterGroup) *PatchRule { - s.PatchFilterGroup = v - return s -} - -// A set of rules defining the approval rules for a patch baseline. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchRuleGroup -type PatchRuleGroup struct { - _ struct{} `type:"structure"` - - // The rules that make up the rule group. - // - // PatchRules is a required field - PatchRules []*PatchRule `type:"list" required:"true"` -} - -// String returns the string representation -func (s PatchRuleGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchRuleGroup) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PatchRuleGroup) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PatchRuleGroup"} - if s.PatchRules == nil { - invalidParams.Add(request.NewErrParamRequired("PatchRules")) - } - if s.PatchRules != nil { - for i, v := range s.PatchRules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PatchRules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPatchRules sets the PatchRules field's value. -func (s *PatchRuleGroup) SetPatchRules(v []*PatchRule) *PatchRuleGroup { - s.PatchRules = v - return s -} - -// Information about the approval status of a patch. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PatchStatus -type PatchStatus struct { - _ struct{} `type:"structure"` - - // The date the patch was approved (or will be approved if the status is PENDING_APPROVAL). - ApprovalDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The approval status of a patch (APPROVED, PENDING_APPROVAL, EXPLICIT_APPROVED, - // EXPLICIT_REJECTED). - DeploymentStatus *string `type:"string" enum:"PatchDeploymentStatus"` -} - -// String returns the string representation -func (s PatchStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PatchStatus) GoString() string { - return s.String() -} - -// SetApprovalDate sets the ApprovalDate field's value. -func (s *PatchStatus) SetApprovalDate(v time.Time) *PatchStatus { - s.ApprovalDate = &v - return s -} - -// SetDeploymentStatus sets the DeploymentStatus field's value. -func (s *PatchStatus) SetDeploymentStatus(v string) *PatchStatus { - s.DeploymentStatus = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutInventoryRequest -type PutInventoryInput struct { - _ struct{} `type:"structure"` - - // One or more instance IDs where you want to add or update inventory items. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The inventory items that you want to add or update on instances. - // - // Items is a required field - Items []*InventoryItem `locationNameList:"Item" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PutInventoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutInventoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutInventoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutInventoryInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.Items == nil { - invalidParams.Add(request.NewErrParamRequired("Items")) - } - if s.Items != nil && len(s.Items) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Items", 1)) - } - 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 -} - -// SetInstanceId sets the InstanceId field's value. -func (s *PutInventoryInput) SetInstanceId(v string) *PutInventoryInput { - s.InstanceId = &v - return s -} - -// SetItems sets the Items field's value. -func (s *PutInventoryInput) SetItems(v []*InventoryItem) *PutInventoryInput { - s.Items = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutInventoryResult -type PutInventoryOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutInventoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutInventoryOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutParameterRequest -type PutParameterInput struct { - _ struct{} `type:"structure"` - - // Information about the parameter that you want to add to the system - Description *string `min:"1" type:"string"` - - // The parameter key ID that you want to add to the system. - KeyId *string `min:"1" type:"string"` - - // The name of the parameter that you want to add to the system. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Overwrite an existing parameter. - Overwrite *bool `type:"boolean"` - - // The type of parameter that you want to add to the system. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"ParameterType"` - - // The parameter value that you want to add to the system. - // - // Value is a required field - Value *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutParameterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutParameterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutParameterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutParameterInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KeyId != nil && len(*s.KeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) - } - 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.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *PutParameterInput) SetDescription(v string) *PutParameterInput { - s.Description = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *PutParameterInput) SetKeyId(v string) *PutParameterInput { - s.KeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *PutParameterInput) SetName(v string) *PutParameterInput { - s.Name = &v - return s -} - -// SetOverwrite sets the Overwrite field's value. -func (s *PutParameterInput) SetOverwrite(v bool) *PutParameterInput { - s.Overwrite = &v - return s -} - -// SetType sets the Type field's value. -func (s *PutParameterInput) SetType(v string) *PutParameterInput { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *PutParameterInput) SetValue(v string) *PutParameterInput { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutParameterResult -type PutParameterOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutParameterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutParameterOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterDefaultPatchBaselineRequest -type RegisterDefaultPatchBaselineInput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline that should be the default patch baseline. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterDefaultPatchBaselineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterDefaultPatchBaselineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterDefaultPatchBaselineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterDefaultPatchBaselineInput"} - if s.BaselineId == nil { - invalidParams.Add(request.NewErrParamRequired("BaselineId")) - } - if s.BaselineId != nil && len(*s.BaselineId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("BaselineId", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaselineId sets the BaselineId field's value. -func (s *RegisterDefaultPatchBaselineInput) SetBaselineId(v string) *RegisterDefaultPatchBaselineInput { - s.BaselineId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterDefaultPatchBaselineResult -type RegisterDefaultPatchBaselineOutput struct { - _ struct{} `type:"structure"` - - // The ID of the default patch baseline. - BaselineId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s RegisterDefaultPatchBaselineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterDefaultPatchBaselineOutput) GoString() string { - return s.String() -} - -// SetBaselineId sets the BaselineId field's value. -func (s *RegisterDefaultPatchBaselineOutput) SetBaselineId(v string) *RegisterDefaultPatchBaselineOutput { - s.BaselineId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterPatchBaselineForPatchGroupRequest -type RegisterPatchBaselineForPatchGroupInput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline to register the patch group with. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` - - // The name of the patch group that should be registered with the patch baseline. - // - // PatchGroup is a required field - PatchGroup *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterPatchBaselineForPatchGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterPatchBaselineForPatchGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterPatchBaselineForPatchGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterPatchBaselineForPatchGroupInput"} - if s.BaselineId == nil { - invalidParams.Add(request.NewErrParamRequired("BaselineId")) - } - if s.BaselineId != nil && len(*s.BaselineId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("BaselineId", 20)) - } - if s.PatchGroup == nil { - invalidParams.Add(request.NewErrParamRequired("PatchGroup")) - } - if s.PatchGroup != nil && len(*s.PatchGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PatchGroup", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaselineId sets the BaselineId field's value. -func (s *RegisterPatchBaselineForPatchGroupInput) SetBaselineId(v string) *RegisterPatchBaselineForPatchGroupInput { - s.BaselineId = &v - return s -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *RegisterPatchBaselineForPatchGroupInput) SetPatchGroup(v string) *RegisterPatchBaselineForPatchGroupInput { - s.PatchGroup = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterPatchBaselineForPatchGroupResult -type RegisterPatchBaselineForPatchGroupOutput struct { - _ struct{} `type:"structure"` - - // The ID of the patch baseline the patch group was registered with. - BaselineId *string `min:"20" type:"string"` - - // The name of the patch group registered with the patch baseline. - PatchGroup *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s RegisterPatchBaselineForPatchGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterPatchBaselineForPatchGroupOutput) GoString() string { - return s.String() -} - -// SetBaselineId sets the BaselineId field's value. -func (s *RegisterPatchBaselineForPatchGroupOutput) SetBaselineId(v string) *RegisterPatchBaselineForPatchGroupOutput { - s.BaselineId = &v - return s -} - -// SetPatchGroup sets the PatchGroup field's value. -func (s *RegisterPatchBaselineForPatchGroupOutput) SetPatchGroup(v string) *RegisterPatchBaselineForPatchGroupOutput { - s.PatchGroup = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTargetWithMaintenanceWindowRequest -type RegisterTargetWithMaintenanceWindowInput struct { - _ struct{} `type:"structure"` - - // User-provided idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // User-provided value that will be included in any CloudWatch events raised - // while running tasks for these targets in this Maintenance Window. - OwnerInformation *string `min:"1" type:"string"` - - // The type of target being registered with the Maintenance Window. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"MaintenanceWindowResourceType"` - - // The targets (either instances or tags). Instances are specified using Key=instanceids,Values=,. - // Tags are specified using Key=,Values=. - // - // Targets is a required field - Targets []*Target `type:"list" required:"true"` - - // The ID of the Maintenance Window the target should be registered with. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterTargetWithMaintenanceWindowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTargetWithMaintenanceWindowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterTargetWithMaintenanceWindowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterTargetWithMaintenanceWindowInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.OwnerInformation != nil && len(*s.OwnerInformation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OwnerInformation", 1)) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - if s.Targets == nil { - invalidParams.Add(request.NewErrParamRequired("Targets")) - } - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *RegisterTargetWithMaintenanceWindowInput) SetClientToken(v string) *RegisterTargetWithMaintenanceWindowInput { - s.ClientToken = &v - return s -} - -// SetOwnerInformation sets the OwnerInformation field's value. -func (s *RegisterTargetWithMaintenanceWindowInput) SetOwnerInformation(v string) *RegisterTargetWithMaintenanceWindowInput { - s.OwnerInformation = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *RegisterTargetWithMaintenanceWindowInput) SetResourceType(v string) *RegisterTargetWithMaintenanceWindowInput { - s.ResourceType = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *RegisterTargetWithMaintenanceWindowInput) SetTargets(v []*Target) *RegisterTargetWithMaintenanceWindowInput { - s.Targets = v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *RegisterTargetWithMaintenanceWindowInput) SetWindowId(v string) *RegisterTargetWithMaintenanceWindowInput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTargetWithMaintenanceWindowResult -type RegisterTargetWithMaintenanceWindowOutput struct { - _ struct{} `type:"structure"` - - // The ID of the target definition in this Maintenance Window. - WindowTargetId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s RegisterTargetWithMaintenanceWindowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTargetWithMaintenanceWindowOutput) GoString() string { - return s.String() -} - -// SetWindowTargetId sets the WindowTargetId field's value. -func (s *RegisterTargetWithMaintenanceWindowOutput) SetWindowTargetId(v string) *RegisterTargetWithMaintenanceWindowOutput { - s.WindowTargetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTaskWithMaintenanceWindowRequest -type RegisterTaskWithMaintenanceWindowInput struct { - _ struct{} `type:"structure"` - - // User-provided idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // A structure containing information about an Amazon S3 bucket to write instance-level - // logs to. - LoggingInfo *LoggingInfo `type:"structure"` - - // The maximum number of targets this task can be run for in parallel. - // - // MaxConcurrency is a required field - MaxConcurrency *string `min:"1" type:"string" required:"true"` - - // The maximum number of errors allowed before this task stops being scheduled. - // - // MaxErrors is a required field - MaxErrors *string `min:"1" type:"string" required:"true"` - - // The priority of the task in the Maintenance Window, the lower the number - // the higher the priority. Tasks in a Maintenance Window are scheduled in priority - // order with tasks that have the same priority scheduled in parallel. - Priority *int64 `type:"integer"` - - // The role that should be assumed when executing the task. - // - // ServiceRoleArn is a required field - ServiceRoleArn *string `type:"string" required:"true"` - - // The targets (either instances or tags). Instances are specified using Key=instanceids,Values=,. - // Tags are specified using Key=,Values=. - // - // Targets is a required field - Targets []*Target `type:"list" required:"true"` - - // The ARN of the task to execute - // - // TaskArn is a required field - TaskArn *string `min:"1" type:"string" required:"true"` - - // The parameters that should be passed to the task when it is executed. - TaskParameters map[string]*MaintenanceWindowTaskParameterValueExpression `type:"map"` - - // The type of task being registered. - // - // TaskType is a required field - TaskType *string `type:"string" required:"true" enum:"MaintenanceWindowTaskType"` - - // The id of the Maintenance Window the task should be added to. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s RegisterTaskWithMaintenanceWindowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTaskWithMaintenanceWindowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterTaskWithMaintenanceWindowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterTaskWithMaintenanceWindowInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.MaxConcurrency == nil { - invalidParams.Add(request.NewErrParamRequired("MaxConcurrency")) - } - if s.MaxConcurrency != nil && len(*s.MaxConcurrency) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MaxConcurrency", 1)) - } - if s.MaxErrors == nil { - invalidParams.Add(request.NewErrParamRequired("MaxErrors")) - } - if s.MaxErrors != nil && len(*s.MaxErrors) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MaxErrors", 1)) - } - if s.ServiceRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceRoleArn")) - } - if s.Targets == nil { - invalidParams.Add(request.NewErrParamRequired("Targets")) - } - if s.TaskArn == nil { - invalidParams.Add(request.NewErrParamRequired("TaskArn")) - } - if s.TaskArn != nil && len(*s.TaskArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskArn", 1)) - } - if s.TaskType == nil { - invalidParams.Add(request.NewErrParamRequired("TaskType")) - } - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - if s.LoggingInfo != nil { - if err := s.LoggingInfo.Validate(); err != nil { - invalidParams.AddNested("LoggingInfo", err.(request.ErrInvalidParams)) - } - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetClientToken(v string) *RegisterTaskWithMaintenanceWindowInput { - s.ClientToken = &v - return s -} - -// SetLoggingInfo sets the LoggingInfo field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetLoggingInfo(v *LoggingInfo) *RegisterTaskWithMaintenanceWindowInput { - s.LoggingInfo = v - return s -} - -// SetMaxConcurrency sets the MaxConcurrency field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetMaxConcurrency(v string) *RegisterTaskWithMaintenanceWindowInput { - s.MaxConcurrency = &v - return s -} - -// SetMaxErrors sets the MaxErrors field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetMaxErrors(v string) *RegisterTaskWithMaintenanceWindowInput { - s.MaxErrors = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetPriority(v int64) *RegisterTaskWithMaintenanceWindowInput { - s.Priority = &v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetServiceRoleArn(v string) *RegisterTaskWithMaintenanceWindowInput { - s.ServiceRoleArn = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetTargets(v []*Target) *RegisterTaskWithMaintenanceWindowInput { - s.Targets = v - return s -} - -// SetTaskArn sets the TaskArn field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetTaskArn(v string) *RegisterTaskWithMaintenanceWindowInput { - s.TaskArn = &v - return s -} - -// SetTaskParameters sets the TaskParameters field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetTaskParameters(v map[string]*MaintenanceWindowTaskParameterValueExpression) *RegisterTaskWithMaintenanceWindowInput { - s.TaskParameters = v - return s -} - -// SetTaskType sets the TaskType field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetTaskType(v string) *RegisterTaskWithMaintenanceWindowInput { - s.TaskType = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *RegisterTaskWithMaintenanceWindowInput) SetWindowId(v string) *RegisterTaskWithMaintenanceWindowInput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTaskWithMaintenanceWindowResult -type RegisterTaskWithMaintenanceWindowOutput struct { - _ struct{} `type:"structure"` - - // The id of the task in the Maintenance Window. - WindowTaskId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s RegisterTaskWithMaintenanceWindowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTaskWithMaintenanceWindowOutput) GoString() string { - return s.String() -} - -// SetWindowTaskId sets the WindowTaskId field's value. -func (s *RegisterTaskWithMaintenanceWindowOutput) SetWindowTaskId(v string) *RegisterTaskWithMaintenanceWindowOutput { - s.WindowTaskId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RemoveTagsFromResourceRequest -type RemoveTagsFromResourceInput struct { - _ struct{} `type:"structure"` - - // The resource ID for which you want to remove tags. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // The type of resource of which you want to remove a tag. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"ResourceTypeForTagging"` - - // Tag keys that you want to remove from the specified resource. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *RemoveTagsFromResourceInput) SetResourceId(v string) *RemoveTagsFromResourceInput { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *RemoveTagsFromResourceInput) SetResourceType(v string) *RemoveTagsFromResourceInput { - s.ResourceType = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsFromResourceInput) SetTagKeys(v []*string) *RemoveTagsFromResourceInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RemoveTagsFromResourceResult -type RemoveTagsFromResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsFromResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromResourceOutput) GoString() string { - return s.String() -} - -// The inventory item result attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ResultAttribute -type ResultAttribute struct { - _ struct{} `type:"structure"` - - // Name of the inventory item type. Valid value: “AWS:InstanceInformation”. - // Default Value: “AWS:InstanceInformation”. - // - // TypeName is a required field - TypeName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ResultAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResultAttribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResultAttribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResultAttribute"} - if s.TypeName == nil { - invalidParams.Add(request.NewErrParamRequired("TypeName")) - } - if s.TypeName != nil && len(*s.TypeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTypeName sets the TypeName field's value. -func (s *ResultAttribute) SetTypeName(v string) *ResultAttribute { - s.TypeName = &v - return s -} - -// An Amazon S3 bucket where you want to store the results of this request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/S3OutputLocation -type S3OutputLocation struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket. - OutputS3BucketName *string `min:"3" type:"string"` - - // The Amazon S3 bucket subfolder. - OutputS3KeyPrefix *string `type:"string"` - - // The Amazon S3 region where the association information is stored. - OutputS3Region *string `min:"3" type:"string"` -} - -// String returns the string representation -func (s S3OutputLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3OutputLocation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3OutputLocation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3OutputLocation"} - if s.OutputS3BucketName != nil && len(*s.OutputS3BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("OutputS3BucketName", 3)) - } - if s.OutputS3Region != nil && len(*s.OutputS3Region) < 3 { - invalidParams.Add(request.NewErrParamMinLen("OutputS3Region", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOutputS3BucketName sets the OutputS3BucketName field's value. -func (s *S3OutputLocation) SetOutputS3BucketName(v string) *S3OutputLocation { - s.OutputS3BucketName = &v - return s -} - -// SetOutputS3KeyPrefix sets the OutputS3KeyPrefix field's value. -func (s *S3OutputLocation) SetOutputS3KeyPrefix(v string) *S3OutputLocation { - s.OutputS3KeyPrefix = &v - return s -} - -// SetOutputS3Region sets the OutputS3Region field's value. -func (s *S3OutputLocation) SetOutputS3Region(v string) *S3OutputLocation { - s.OutputS3Region = &v - return s -} - -// A URL for the Amazon S3 bucket where you want to store the results of this -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/S3OutputUrl -type S3OutputUrl struct { - _ struct{} `type:"structure"` - - // A URL for an Amazon S3 bucket where you want to store the results of this - // request. - OutputUrl *string `type:"string"` -} - -// String returns the string representation -func (s S3OutputUrl) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3OutputUrl) GoString() string { - return s.String() -} - -// SetOutputUrl sets the OutputUrl field's value. -func (s *S3OutputUrl) SetOutputUrl(v string) *S3OutputUrl { - s.OutputUrl = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/SendCommandRequest -type SendCommandInput struct { - _ struct{} `type:"structure"` - - // User-specified information about the command, such as a brief description - // of what the command should do. - Comment *string `type:"string"` - - // The Sha256 or Sha1 hash created by the system when the document was created. - // - // Sha1 hashes have been deprecated. - DocumentHash *string `type:"string"` - - // Sha256 or Sha1. - // - // Sha1 hashes have been deprecated. - DocumentHashType *string `type:"string" enum:"DocumentHashType"` - - // Required. The name of the SSM document to execute. This can be an SSM public - // document or a custom document. - // - // DocumentName is a required field - DocumentName *string `type:"string" required:"true"` - - // Required. The instance IDs where the command should execute. You can specify - // a maximum of 50 IDs. - InstanceIds []*string `type:"list"` - - // (Optional) The maximum number of instances that are allowed to execute the - // command at the same time. You can specify a number such as “10” or a percentage - // such as “10%”. The default value is 50. For more information about how to - // use MaxConcurrency, see Executing a Command Using Amazon EC2 Run Command - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) (Linux) - // or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). - MaxConcurrency *string `min:"1" type:"string"` - - // The maximum number of errors allowed without the command failing. When the - // command fails one more time beyond the value of MaxErrors, the systems stops - // sending the command to additional targets. You can specify a number like - // “10” or a percentage like “10%”. The default value is 50. For more information - // about how to use MaxErrors, see Executing a Command Using Amazon EC2 Run - // Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). - MaxErrors *string `min:"1" type:"string"` - - // Configurations for sending notifications. - NotificationConfig *NotificationConfig `type:"structure"` - - // The name of the S3 bucket where command execution responses should be stored. - OutputS3BucketName *string `min:"3" type:"string"` - - // The directory structure within the S3 bucket where the responses should be - // stored. - OutputS3KeyPrefix *string `type:"string"` - - // (Optional) The region where the Amazon Simple Storage Service (Amazon S3) - // output bucket is located. The default value is the region where Run Command - // is being called. - OutputS3Region *string `min:"3" type:"string"` - - // The required and optional parameters specified in the SSM document being - // executed. - Parameters map[string][]*string `type:"map"` - - // The IAM role that Systems Manager uses to send notifications. - ServiceRoleArn *string `type:"string"` - - // (Optional) An array of search criteria that targets instances using a Key;Value - // combination that you specify. Targets is required if you don't provide one - // or more instance IDs in the call. For more information about how to use Targets, - // see Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). - Targets []*Target `type:"list"` - - // If this time is reached and the command has not already started executing, - // it will not execute. - TimeoutSeconds *int64 `min:"30" type:"integer"` -} - -// String returns the string representation -func (s SendCommandInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendCommandInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendCommandInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendCommandInput"} - if s.DocumentName == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentName")) - } - if s.MaxConcurrency != nil && len(*s.MaxConcurrency) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MaxConcurrency", 1)) - } - if s.MaxErrors != nil && len(*s.MaxErrors) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MaxErrors", 1)) - } - if s.OutputS3BucketName != nil && len(*s.OutputS3BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("OutputS3BucketName", 3)) - } - if s.OutputS3Region != nil && len(*s.OutputS3Region) < 3 { - invalidParams.Add(request.NewErrParamMinLen("OutputS3Region", 3)) - } - if s.TimeoutSeconds != nil && *s.TimeoutSeconds < 30 { - invalidParams.Add(request.NewErrParamMinValue("TimeoutSeconds", 30)) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *SendCommandInput) SetComment(v string) *SendCommandInput { - s.Comment = &v - return s -} - -// SetDocumentHash sets the DocumentHash field's value. -func (s *SendCommandInput) SetDocumentHash(v string) *SendCommandInput { - s.DocumentHash = &v - return s -} - -// SetDocumentHashType sets the DocumentHashType field's value. -func (s *SendCommandInput) SetDocumentHashType(v string) *SendCommandInput { - s.DocumentHashType = &v - return s -} - -// SetDocumentName sets the DocumentName field's value. -func (s *SendCommandInput) SetDocumentName(v string) *SendCommandInput { - s.DocumentName = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *SendCommandInput) SetInstanceIds(v []*string) *SendCommandInput { - s.InstanceIds = v - return s -} - -// SetMaxConcurrency sets the MaxConcurrency field's value. -func (s *SendCommandInput) SetMaxConcurrency(v string) *SendCommandInput { - s.MaxConcurrency = &v - return s -} - -// SetMaxErrors sets the MaxErrors field's value. -func (s *SendCommandInput) SetMaxErrors(v string) *SendCommandInput { - s.MaxErrors = &v - return s -} - -// SetNotificationConfig sets the NotificationConfig field's value. -func (s *SendCommandInput) SetNotificationConfig(v *NotificationConfig) *SendCommandInput { - s.NotificationConfig = v - return s -} - -// SetOutputS3BucketName sets the OutputS3BucketName field's value. -func (s *SendCommandInput) SetOutputS3BucketName(v string) *SendCommandInput { - s.OutputS3BucketName = &v - return s -} - -// SetOutputS3KeyPrefix sets the OutputS3KeyPrefix field's value. -func (s *SendCommandInput) SetOutputS3KeyPrefix(v string) *SendCommandInput { - s.OutputS3KeyPrefix = &v - return s -} - -// SetOutputS3Region sets the OutputS3Region field's value. -func (s *SendCommandInput) SetOutputS3Region(v string) *SendCommandInput { - s.OutputS3Region = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *SendCommandInput) SetParameters(v map[string][]*string) *SendCommandInput { - s.Parameters = v - return s -} - -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *SendCommandInput) SetServiceRoleArn(v string) *SendCommandInput { - s.ServiceRoleArn = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *SendCommandInput) SetTargets(v []*Target) *SendCommandInput { - s.Targets = v - return s -} - -// SetTimeoutSeconds sets the TimeoutSeconds field's value. -func (s *SendCommandInput) SetTimeoutSeconds(v int64) *SendCommandInput { - s.TimeoutSeconds = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/SendCommandResult -type SendCommandOutput struct { - _ struct{} `type:"structure"` - - // The request as it was received by Systems Manager. Also provides the command - // ID which can be used future references to this request. - Command *Command `type:"structure"` -} - -// String returns the string representation -func (s SendCommandOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendCommandOutput) GoString() string { - return s.String() -} - -// SetCommand sets the Command field's value. -func (s *SendCommandOutput) SetCommand(v *Command) *SendCommandOutput { - s.Command = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAutomationExecutionRequest -type StartAutomationExecutionInput struct { - _ struct{} `type:"structure"` - - // The name of the Automation document to use for this execution. - // - // DocumentName is a required field - DocumentName *string `type:"string" required:"true"` - - // The version of the Automation document to use for this execution. - DocumentVersion *string `type:"string"` - - // A key-value map of execution parameters, which match the declared parameters - // in the Automation document. - Parameters map[string][]*string `min:"1" type:"map"` -} - -// String returns the string representation -func (s StartAutomationExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartAutomationExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartAutomationExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartAutomationExecutionInput"} - if s.DocumentName == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentName")) - } - if s.Parameters != nil && len(s.Parameters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Parameters", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentName sets the DocumentName field's value. -func (s *StartAutomationExecutionInput) SetDocumentName(v string) *StartAutomationExecutionInput { - s.DocumentName = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *StartAutomationExecutionInput) SetDocumentVersion(v string) *StartAutomationExecutionInput { - s.DocumentVersion = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *StartAutomationExecutionInput) SetParameters(v map[string][]*string) *StartAutomationExecutionInput { - s.Parameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAutomationExecutionResult -type StartAutomationExecutionOutput struct { - _ struct{} `type:"structure"` - - // The unique ID of a newly scheduled automation execution. - AutomationExecutionId *string `min:"36" type:"string"` -} - -// String returns the string representation -func (s StartAutomationExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartAutomationExecutionOutput) GoString() string { - return s.String() -} - -// SetAutomationExecutionId sets the AutomationExecutionId field's value. -func (s *StartAutomationExecutionOutput) SetAutomationExecutionId(v string) *StartAutomationExecutionOutput { - s.AutomationExecutionId = &v - return s -} - -// Detailed information about an the execution state of an Automation step. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StepExecution -type StepExecution struct { - _ struct{} `type:"structure"` - - // The action this step performs. The action determines the behavior of the - // step. - Action *string `type:"string"` - - // If a step has finished execution, this contains the time the execution ended. - // If the step has not yet concluded, this field is not populated. - ExecutionEndTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // If a step has begun execution, this contains the time the step started. If - // the step is in Pending status, this field is not populated. - ExecutionStartTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // If a step failed, this message explains why the execution failed. - FailureMessage *string `type:"string"` - - // Fully-resolved values passed into the step before execution. - Inputs map[string]*string `type:"map"` - - // Returned values from the execution of the step. - Outputs map[string][]*string `min:"1" type:"map"` - - // A message associated with the response code for an execution. - Response *string `type:"string"` - - // The response code returned by the execution of the step. - ResponseCode *string `type:"string"` - - // The name of this execution step. - StepName *string `type:"string"` - - // The execution status for this step. Valid values include: Pending, InProgress, - // Success, Cancelled, Failed, and TimedOut. - StepStatus *string `type:"string" enum:"AutomationExecutionStatus"` -} - -// String returns the string representation -func (s StepExecution) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StepExecution) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *StepExecution) SetAction(v string) *StepExecution { - s.Action = &v - return s -} - -// SetExecutionEndTime sets the ExecutionEndTime field's value. -func (s *StepExecution) SetExecutionEndTime(v time.Time) *StepExecution { - s.ExecutionEndTime = &v - return s -} - -// SetExecutionStartTime sets the ExecutionStartTime field's value. -func (s *StepExecution) SetExecutionStartTime(v time.Time) *StepExecution { - s.ExecutionStartTime = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *StepExecution) SetFailureMessage(v string) *StepExecution { - s.FailureMessage = &v - return s -} - -// SetInputs sets the Inputs field's value. -func (s *StepExecution) SetInputs(v map[string]*string) *StepExecution { - s.Inputs = v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *StepExecution) SetOutputs(v map[string][]*string) *StepExecution { - s.Outputs = v - return s -} - -// SetResponse sets the Response field's value. -func (s *StepExecution) SetResponse(v string) *StepExecution { - s.Response = &v - return s -} - -// SetResponseCode sets the ResponseCode field's value. -func (s *StepExecution) SetResponseCode(v string) *StepExecution { - s.ResponseCode = &v - return s -} - -// SetStepName sets the StepName field's value. -func (s *StepExecution) SetStepName(v string) *StepExecution { - s.StepName = &v - return s -} - -// SetStepStatus sets the StepStatus field's value. -func (s *StepExecution) SetStepStatus(v string) *StepExecution { - s.StepStatus = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StopAutomationExecutionRequest -type StopAutomationExecutionInput struct { - _ struct{} `type:"structure"` - - // The execution ID of the Automation to stop. - // - // AutomationExecutionId is a required field - AutomationExecutionId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopAutomationExecutionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopAutomationExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopAutomationExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopAutomationExecutionInput"} - if s.AutomationExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("AutomationExecutionId")) - } - if s.AutomationExecutionId != nil && len(*s.AutomationExecutionId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("AutomationExecutionId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutomationExecutionId sets the AutomationExecutionId field's value. -func (s *StopAutomationExecutionInput) SetAutomationExecutionId(v string) *StopAutomationExecutionInput { - s.AutomationExecutionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StopAutomationExecutionResult -type StopAutomationExecutionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StopAutomationExecutionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopAutomationExecutionOutput) GoString() string { - return s.String() -} - -// Metadata that you assign to your managed instances. Tags enable you to categorize -// your managed instances in different ways, for example, by purpose, owner, -// or environment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The name of the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value of the tag. - // - // Value is a required field - Value *string `min:"1" 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 s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 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 -} - -// An array of search criteria that targets instances using a Key;Value combination -// that you specify. Targets is required if you don't provide one or more instance -// IDs in the call. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/Target -type Target struct { - _ struct{} `type:"structure"` - - // User-defined criteria for sending commands that target instances that meet - // the criteria. Key can be tag: or name:. For example, tag:ServerRole or name:0123456789012345. For more information - // about how to send commands that target instances using Key;Value parameters, - // see Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). - Key *string `min:"1" type:"string"` - - // User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, - // you could specify value:WebServer to execute a command on instances that - // include Amazon EC2 tags of ServerRole;WebServer. For more information about - // how to send commands that target instances using Key;Value parameters, see - // Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/run-command.html) - // (Linux) or Executing a Command Using Amazon EC2 Run Command (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/run-command.html) - // (Windows). - Values []*string `type:"list"` -} - -// String returns the string representation -func (s Target) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Target) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Target) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Target"} - 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 *Target) SetKey(v string) *Target { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *Target) SetValues(v []*string) *Target { - s.Values = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociationRequest -type UpdateAssociationInput struct { - _ struct{} `type:"structure"` - - // The ID of the association you want to update. - // - // AssociationId is a required field - AssociationId *string `type:"string" required:"true"` - - // The document version you want update for the association. - DocumentVersion *string `type:"string"` - - // An Amazon S3 bucket where you want to store the results of this request. - // - // "{ \"S3Location\": { \"OutputS3Region\": \"\", \"OutputS3BucketName\": - // \"bucket name\", \"OutputS3KeyPrefix\": \"folder name\" } }" - OutputLocation *InstanceAssociationOutputLocation `type:"structure"` - - // The parameters you want to update for the association. If you create a parameter - // using Parameter Store, you can reference the parameter using {{ssm:parameter-name}} - Parameters map[string][]*string `type:"map"` - - // The cron expression used to schedule the association that you want to update. - // Supported expressions are every half, 1, 2, 4, 8 or 12 hour(s); every specified - // day and time of the week. For example: cron(0 0/30 * 1/1 * ? *) to run every - // thirty minutes; cron(0 0 0/4 1/1 * ? *) to run every four hours; and cron(0 - // 0 10 ? * SUN *) to run every Sunday at 10 a.m. - ScheduleExpression *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAssociationInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - if s.ScheduleExpression != nil && len(*s.ScheduleExpression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduleExpression", 1)) - } - if s.OutputLocation != nil { - if err := s.OutputLocation.Validate(); err != nil { - invalidParams.AddNested("OutputLocation", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *UpdateAssociationInput) SetAssociationId(v string) *UpdateAssociationInput { - s.AssociationId = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *UpdateAssociationInput) SetDocumentVersion(v string) *UpdateAssociationInput { - s.DocumentVersion = &v - return s -} - -// SetOutputLocation sets the OutputLocation field's value. -func (s *UpdateAssociationInput) SetOutputLocation(v *InstanceAssociationOutputLocation) *UpdateAssociationInput { - s.OutputLocation = v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *UpdateAssociationInput) SetParameters(v map[string][]*string) *UpdateAssociationInput { - s.Parameters = v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *UpdateAssociationInput) SetScheduleExpression(v string) *UpdateAssociationInput { - s.ScheduleExpression = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociationResult -type UpdateAssociationOutput struct { - _ struct{} `type:"structure"` - - // The description of the association that was updated. - AssociationDescription *AssociationDescription `type:"structure"` -} - -// String returns the string representation -func (s UpdateAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAssociationOutput) GoString() string { - return s.String() -} - -// SetAssociationDescription sets the AssociationDescription field's value. -func (s *UpdateAssociationOutput) SetAssociationDescription(v *AssociationDescription) *UpdateAssociationOutput { - s.AssociationDescription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociationStatusRequest -type UpdateAssociationStatusInput struct { - _ struct{} `type:"structure"` - - // The association status. - // - // AssociationStatus is a required field - AssociationStatus *AssociationStatus `type:"structure" required:"true"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The name of the SSM document. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateAssociationStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAssociationStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAssociationStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAssociationStatusInput"} - if s.AssociationStatus == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationStatus")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.AssociationStatus != nil { - if err := s.AssociationStatus.Validate(); err != nil { - invalidParams.AddNested("AssociationStatus", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationStatus sets the AssociationStatus field's value. -func (s *UpdateAssociationStatusInput) SetAssociationStatus(v *AssociationStatus) *UpdateAssociationStatusInput { - s.AssociationStatus = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *UpdateAssociationStatusInput) SetInstanceId(v string) *UpdateAssociationStatusInput { - s.InstanceId = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateAssociationStatusInput) SetName(v string) *UpdateAssociationStatusInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociationStatusResult -type UpdateAssociationStatusOutput struct { - _ struct{} `type:"structure"` - - // Information about the association. - AssociationDescription *AssociationDescription `type:"structure"` -} - -// String returns the string representation -func (s UpdateAssociationStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateAssociationStatusOutput) GoString() string { - return s.String() -} - -// SetAssociationDescription sets the AssociationDescription field's value. -func (s *UpdateAssociationStatusOutput) SetAssociationDescription(v *AssociationDescription) *UpdateAssociationStatusOutput { - s.AssociationDescription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentDefaultVersionRequest -type UpdateDocumentDefaultVersionInput struct { - _ struct{} `type:"structure"` - - // The version of a custom document that you want to set as the default version. - // - // DocumentVersion is a required field - DocumentVersion *string `type:"string" required:"true"` - - // The name of a custom document that you want to set as the default version. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateDocumentDefaultVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDocumentDefaultVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDocumentDefaultVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDocumentDefaultVersionInput"} - if s.DocumentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentVersion")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *UpdateDocumentDefaultVersionInput) SetDocumentVersion(v string) *UpdateDocumentDefaultVersionInput { - s.DocumentVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDocumentDefaultVersionInput) SetName(v string) *UpdateDocumentDefaultVersionInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentDefaultVersionResult -type UpdateDocumentDefaultVersionOutput struct { - _ struct{} `type:"structure"` - - // The description of a custom document that you want to set as the default - // version. - Description *DocumentDefaultVersionDescription `type:"structure"` -} - -// String returns the string representation -func (s UpdateDocumentDefaultVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDocumentDefaultVersionOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *UpdateDocumentDefaultVersionOutput) SetDescription(v *DocumentDefaultVersionDescription) *UpdateDocumentDefaultVersionOutput { - s.Description = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentRequest -type UpdateDocumentInput struct { - _ struct{} `type:"structure"` - - // The content in a document that you want to update. - // - // Content is a required field - Content *string `min:"1" type:"string" required:"true"` - - // The version of the document that you want to update. - DocumentVersion *string `type:"string"` - - // The name of the document that you want to update. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateDocumentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDocumentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDocumentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDocumentInput"} - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *UpdateDocumentInput) SetContent(v string) *UpdateDocumentInput { - s.Content = &v - return s -} - -// SetDocumentVersion sets the DocumentVersion field's value. -func (s *UpdateDocumentInput) SetDocumentVersion(v string) *UpdateDocumentInput { - s.DocumentVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDocumentInput) SetName(v string) *UpdateDocumentInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentResult -type UpdateDocumentOutput struct { - _ struct{} `type:"structure"` - - // A description of the document that was updated. - DocumentDescription *DocumentDescription `type:"structure"` -} - -// String returns the string representation -func (s UpdateDocumentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDocumentOutput) GoString() string { - return s.String() -} - -// SetDocumentDescription sets the DocumentDescription field's value. -func (s *UpdateDocumentOutput) SetDocumentDescription(v *DocumentDescription) *UpdateDocumentOutput { - s.DocumentDescription = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindowRequest -type UpdateMaintenanceWindowInput struct { - _ struct{} `type:"structure"` - - // Whether targets must be registered with the Maintenance Window before tasks - // can be defined for those targets. - AllowUnassociatedTargets *bool `type:"boolean"` - - // The number of hours before the end of the Maintenance Window that Systems - // Manager stops scheduling new tasks for execution. - Cutoff *int64 `type:"integer"` - - // The duration of the Maintenance Window in hours. - Duration *int64 `min:"1" type:"integer"` - - // Whether the Maintenance Window is enabled. - Enabled *bool `type:"boolean"` - - // The name of the Maintenance Window. - Name *string `min:"3" type:"string"` - - // The schedule of the Maintenance Window in the form of a cron or rate expression. - Schedule *string `min:"1" type:"string"` - - // The ID of the Maintenance Window to update. - // - // WindowId is a required field - WindowId *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateMaintenanceWindowInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateMaintenanceWindowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateMaintenanceWindowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateMaintenanceWindowInput"} - if s.Duration != nil && *s.Duration < 1 { - invalidParams.Add(request.NewErrParamMinValue("Duration", 1)) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Schedule != nil && len(*s.Schedule) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Schedule", 1)) - } - if s.WindowId == nil { - invalidParams.Add(request.NewErrParamRequired("WindowId")) - } - if s.WindowId != nil && len(*s.WindowId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WindowId", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowUnassociatedTargets sets the AllowUnassociatedTargets field's value. -func (s *UpdateMaintenanceWindowInput) SetAllowUnassociatedTargets(v bool) *UpdateMaintenanceWindowInput { - s.AllowUnassociatedTargets = &v - return s -} - -// SetCutoff sets the Cutoff field's value. -func (s *UpdateMaintenanceWindowInput) SetCutoff(v int64) *UpdateMaintenanceWindowInput { - s.Cutoff = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *UpdateMaintenanceWindowInput) SetDuration(v int64) *UpdateMaintenanceWindowInput { - s.Duration = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *UpdateMaintenanceWindowInput) SetEnabled(v bool) *UpdateMaintenanceWindowInput { - s.Enabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateMaintenanceWindowInput) SetName(v string) *UpdateMaintenanceWindowInput { - s.Name = &v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *UpdateMaintenanceWindowInput) SetSchedule(v string) *UpdateMaintenanceWindowInput { - s.Schedule = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *UpdateMaintenanceWindowInput) SetWindowId(v string) *UpdateMaintenanceWindowInput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindowResult -type UpdateMaintenanceWindowOutput struct { - _ struct{} `type:"structure"` - - // Whether targets must be registered with the Maintenance Window before tasks - // can be defined for those targets. - AllowUnassociatedTargets *bool `type:"boolean"` - - // The number of hours before the end of the Maintenance Window that Systems - // Manager stops scheduling new tasks for execution. - Cutoff *int64 `type:"integer"` - - // The duration of the Maintenance Window in hours. - Duration *int64 `min:"1" type:"integer"` - - // Whether the Maintenance Window is enabled. - Enabled *bool `type:"boolean"` - - // The name of the Maintenance Window. - Name *string `min:"3" type:"string"` - - // The schedule of the Maintenance Window in the form of a cron or rate expression. - Schedule *string `min:"1" type:"string"` - - // The ID of the created Maintenance Window. - WindowId *string `min:"20" type:"string"` -} - -// String returns the string representation -func (s UpdateMaintenanceWindowOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateMaintenanceWindowOutput) GoString() string { - return s.String() -} - -// SetAllowUnassociatedTargets sets the AllowUnassociatedTargets field's value. -func (s *UpdateMaintenanceWindowOutput) SetAllowUnassociatedTargets(v bool) *UpdateMaintenanceWindowOutput { - s.AllowUnassociatedTargets = &v - return s -} - -// SetCutoff sets the Cutoff field's value. -func (s *UpdateMaintenanceWindowOutput) SetCutoff(v int64) *UpdateMaintenanceWindowOutput { - s.Cutoff = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *UpdateMaintenanceWindowOutput) SetDuration(v int64) *UpdateMaintenanceWindowOutput { - s.Duration = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *UpdateMaintenanceWindowOutput) SetEnabled(v bool) *UpdateMaintenanceWindowOutput { - s.Enabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateMaintenanceWindowOutput) SetName(v string) *UpdateMaintenanceWindowOutput { - s.Name = &v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *UpdateMaintenanceWindowOutput) SetSchedule(v string) *UpdateMaintenanceWindowOutput { - s.Schedule = &v - return s -} - -// SetWindowId sets the WindowId field's value. -func (s *UpdateMaintenanceWindowOutput) SetWindowId(v string) *UpdateMaintenanceWindowOutput { - s.WindowId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateManagedInstanceRoleRequest -type UpdateManagedInstanceRoleInput struct { - _ struct{} `type:"structure"` - - // The IAM role you want to assign or change. - // - // IamRole is a required field - IamRole *string `type:"string" required:"true"` - - // The ID of the managed instance where you want to update the role. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateManagedInstanceRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateManagedInstanceRoleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateManagedInstanceRoleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateManagedInstanceRoleInput"} - if s.IamRole == nil { - invalidParams.Add(request.NewErrParamRequired("IamRole")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIamRole sets the IamRole field's value. -func (s *UpdateManagedInstanceRoleInput) SetIamRole(v string) *UpdateManagedInstanceRoleInput { - s.IamRole = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *UpdateManagedInstanceRoleInput) SetInstanceId(v string) *UpdateManagedInstanceRoleInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateManagedInstanceRoleResult -type UpdateManagedInstanceRoleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UpdateManagedInstanceRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateManagedInstanceRoleOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdatePatchBaselineRequest -type UpdatePatchBaselineInput struct { - _ struct{} `type:"structure"` - - // A set of rules used to include patches in the baseline. - ApprovalRules *PatchRuleGroup `type:"structure"` - - // A list of explicitly approved patches for the baseline. - ApprovedPatches []*string `type:"list"` - - // The ID of the patch baseline to update. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` - - // A description of the patch baseline. - Description *string `min:"1" type:"string"` - - // A set of global filters used to exclude patches from the baseline. - GlobalFilters *PatchFilterGroup `type:"structure"` - - // The name of the patch baseline. - Name *string `min:"3" type:"string"` - - // A list of explicitly rejected patches for the baseline. - RejectedPatches []*string `type:"list"` -} - -// String returns the string representation -func (s UpdatePatchBaselineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdatePatchBaselineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePatchBaselineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePatchBaselineInput"} - if s.BaselineId == nil { - invalidParams.Add(request.NewErrParamRequired("BaselineId")) - } - if s.BaselineId != nil && len(*s.BaselineId) < 20 { - invalidParams.Add(request.NewErrParamMinLen("BaselineId", 20)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.ApprovalRules != nil { - if err := s.ApprovalRules.Validate(); err != nil { - invalidParams.AddNested("ApprovalRules", err.(request.ErrInvalidParams)) - } - } - if s.GlobalFilters != nil { - if err := s.GlobalFilters.Validate(); err != nil { - invalidParams.AddNested("GlobalFilters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApprovalRules sets the ApprovalRules field's value. -func (s *UpdatePatchBaselineInput) SetApprovalRules(v *PatchRuleGroup) *UpdatePatchBaselineInput { - s.ApprovalRules = v - return s -} - -// SetApprovedPatches sets the ApprovedPatches field's value. -func (s *UpdatePatchBaselineInput) SetApprovedPatches(v []*string) *UpdatePatchBaselineInput { - s.ApprovedPatches = v - return s -} - -// SetBaselineId sets the BaselineId field's value. -func (s *UpdatePatchBaselineInput) SetBaselineId(v string) *UpdatePatchBaselineInput { - s.BaselineId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdatePatchBaselineInput) SetDescription(v string) *UpdatePatchBaselineInput { - s.Description = &v - return s -} - -// SetGlobalFilters sets the GlobalFilters field's value. -func (s *UpdatePatchBaselineInput) SetGlobalFilters(v *PatchFilterGroup) *UpdatePatchBaselineInput { - s.GlobalFilters = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePatchBaselineInput) SetName(v string) *UpdatePatchBaselineInput { - s.Name = &v - return s -} - -// SetRejectedPatches sets the RejectedPatches field's value. -func (s *UpdatePatchBaselineInput) SetRejectedPatches(v []*string) *UpdatePatchBaselineInput { - s.RejectedPatches = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdatePatchBaselineResult -type UpdatePatchBaselineOutput struct { - _ struct{} `type:"structure"` - - // A set of rules used to include patches in the baseline. - ApprovalRules *PatchRuleGroup `type:"structure"` - - // A list of explicitly approved patches for the baseline. - ApprovedPatches []*string `type:"list"` - - // The ID of the deleted patch baseline. - BaselineId *string `min:"20" type:"string"` - - // The date when the patch baseline was created. - CreatedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // A description of the Patch Baseline. - Description *string `min:"1" type:"string"` - - // A set of global filters used to exclude patches from the baseline. - GlobalFilters *PatchFilterGroup `type:"structure"` - - // The date when the patch baseline was last modified. - ModifiedDate *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The name of the patch baseline. - Name *string `min:"3" type:"string"` - - // A list of explicitly rejected patches for the baseline. - RejectedPatches []*string `type:"list"` -} - -// String returns the string representation -func (s UpdatePatchBaselineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdatePatchBaselineOutput) GoString() string { - return s.String() -} - -// SetApprovalRules sets the ApprovalRules field's value. -func (s *UpdatePatchBaselineOutput) SetApprovalRules(v *PatchRuleGroup) *UpdatePatchBaselineOutput { - s.ApprovalRules = v - return s -} - -// SetApprovedPatches sets the ApprovedPatches field's value. -func (s *UpdatePatchBaselineOutput) SetApprovedPatches(v []*string) *UpdatePatchBaselineOutput { - s.ApprovedPatches = v - return s -} - -// SetBaselineId sets the BaselineId field's value. -func (s *UpdatePatchBaselineOutput) SetBaselineId(v string) *UpdatePatchBaselineOutput { - s.BaselineId = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *UpdatePatchBaselineOutput) SetCreatedDate(v time.Time) *UpdatePatchBaselineOutput { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdatePatchBaselineOutput) SetDescription(v string) *UpdatePatchBaselineOutput { - s.Description = &v - return s -} - -// SetGlobalFilters sets the GlobalFilters field's value. -func (s *UpdatePatchBaselineOutput) SetGlobalFilters(v *PatchFilterGroup) *UpdatePatchBaselineOutput { - s.GlobalFilters = v - return s -} - -// SetModifiedDate sets the ModifiedDate field's value. -func (s *UpdatePatchBaselineOutput) SetModifiedDate(v time.Time) *UpdatePatchBaselineOutput { - s.ModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePatchBaselineOutput) SetName(v string) *UpdatePatchBaselineOutput { - s.Name = &v - return s -} - -// SetRejectedPatches sets the RejectedPatches field's value. -func (s *UpdatePatchBaselineOutput) SetRejectedPatches(v []*string) *UpdatePatchBaselineOutput { - s.RejectedPatches = v - return s -} - -const ( - // AssociationFilterKeyInstanceId is a AssociationFilterKey enum value - AssociationFilterKeyInstanceId = "InstanceId" - - // AssociationFilterKeyName is a AssociationFilterKey enum value - AssociationFilterKeyName = "Name" - - // AssociationFilterKeyAssociationId is a AssociationFilterKey enum value - AssociationFilterKeyAssociationId = "AssociationId" - - // AssociationFilterKeyAssociationStatusName is a AssociationFilterKey enum value - AssociationFilterKeyAssociationStatusName = "AssociationStatusName" - - // AssociationFilterKeyLastExecutedBefore is a AssociationFilterKey enum value - AssociationFilterKeyLastExecutedBefore = "LastExecutedBefore" - - // AssociationFilterKeyLastExecutedAfter is a AssociationFilterKey enum value - AssociationFilterKeyLastExecutedAfter = "LastExecutedAfter" -) - -const ( - // AssociationStatusNamePending is a AssociationStatusName enum value - AssociationStatusNamePending = "Pending" - - // AssociationStatusNameSuccess is a AssociationStatusName enum value - AssociationStatusNameSuccess = "Success" - - // AssociationStatusNameFailed is a AssociationStatusName enum value - AssociationStatusNameFailed = "Failed" -) - -const ( - // AutomationExecutionFilterKeyDocumentNamePrefix is a AutomationExecutionFilterKey enum value - AutomationExecutionFilterKeyDocumentNamePrefix = "DocumentNamePrefix" - - // AutomationExecutionFilterKeyExecutionStatus is a AutomationExecutionFilterKey enum value - AutomationExecutionFilterKeyExecutionStatus = "ExecutionStatus" -) - -const ( - // AutomationExecutionStatusPending is a AutomationExecutionStatus enum value - AutomationExecutionStatusPending = "Pending" - - // AutomationExecutionStatusInProgress is a AutomationExecutionStatus enum value - AutomationExecutionStatusInProgress = "InProgress" - - // AutomationExecutionStatusSuccess is a AutomationExecutionStatus enum value - AutomationExecutionStatusSuccess = "Success" - - // AutomationExecutionStatusTimedOut is a AutomationExecutionStatus enum value - AutomationExecutionStatusTimedOut = "TimedOut" - - // AutomationExecutionStatusCancelled is a AutomationExecutionStatus enum value - AutomationExecutionStatusCancelled = "Cancelled" - - // AutomationExecutionStatusFailed is a AutomationExecutionStatus enum value - AutomationExecutionStatusFailed = "Failed" -) - -const ( - // CommandFilterKeyInvokedAfter is a CommandFilterKey enum value - CommandFilterKeyInvokedAfter = "InvokedAfter" - - // CommandFilterKeyInvokedBefore is a CommandFilterKey enum value - CommandFilterKeyInvokedBefore = "InvokedBefore" - - // CommandFilterKeyStatus is a CommandFilterKey enum value - CommandFilterKeyStatus = "Status" -) - -const ( - // CommandInvocationStatusPending is a CommandInvocationStatus enum value - CommandInvocationStatusPending = "Pending" - - // CommandInvocationStatusInProgress is a CommandInvocationStatus enum value - CommandInvocationStatusInProgress = "InProgress" - - // CommandInvocationStatusDelayed is a CommandInvocationStatus enum value - CommandInvocationStatusDelayed = "Delayed" - - // CommandInvocationStatusSuccess is a CommandInvocationStatus enum value - CommandInvocationStatusSuccess = "Success" - - // CommandInvocationStatusCancelled is a CommandInvocationStatus enum value - CommandInvocationStatusCancelled = "Cancelled" - - // CommandInvocationStatusTimedOut is a CommandInvocationStatus enum value - CommandInvocationStatusTimedOut = "TimedOut" - - // CommandInvocationStatusFailed is a CommandInvocationStatus enum value - CommandInvocationStatusFailed = "Failed" - - // CommandInvocationStatusCancelling is a CommandInvocationStatus enum value - CommandInvocationStatusCancelling = "Cancelling" -) - -const ( - // CommandPluginStatusPending is a CommandPluginStatus enum value - CommandPluginStatusPending = "Pending" - - // CommandPluginStatusInProgress is a CommandPluginStatus enum value - CommandPluginStatusInProgress = "InProgress" - - // CommandPluginStatusSuccess is a CommandPluginStatus enum value - CommandPluginStatusSuccess = "Success" - - // CommandPluginStatusTimedOut is a CommandPluginStatus enum value - CommandPluginStatusTimedOut = "TimedOut" - - // CommandPluginStatusCancelled is a CommandPluginStatus enum value - CommandPluginStatusCancelled = "Cancelled" - - // CommandPluginStatusFailed is a CommandPluginStatus enum value - CommandPluginStatusFailed = "Failed" -) - -const ( - // CommandStatusPending is a CommandStatus enum value - CommandStatusPending = "Pending" - - // CommandStatusInProgress is a CommandStatus enum value - CommandStatusInProgress = "InProgress" - - // CommandStatusSuccess is a CommandStatus enum value - CommandStatusSuccess = "Success" - - // CommandStatusCancelled is a CommandStatus enum value - CommandStatusCancelled = "Cancelled" - - // CommandStatusFailed is a CommandStatus enum value - CommandStatusFailed = "Failed" - - // CommandStatusTimedOut is a CommandStatus enum value - CommandStatusTimedOut = "TimedOut" - - // CommandStatusCancelling is a CommandStatus enum value - CommandStatusCancelling = "Cancelling" -) - -const ( - // DescribeActivationsFilterKeysActivationIds is a DescribeActivationsFilterKeys enum value - DescribeActivationsFilterKeysActivationIds = "ActivationIds" - - // DescribeActivationsFilterKeysDefaultInstanceName is a DescribeActivationsFilterKeys enum value - DescribeActivationsFilterKeysDefaultInstanceName = "DefaultInstanceName" - - // DescribeActivationsFilterKeysIamRole is a DescribeActivationsFilterKeys enum value - DescribeActivationsFilterKeysIamRole = "IamRole" -) - -const ( - // DocumentFilterKeyName is a DocumentFilterKey enum value - DocumentFilterKeyName = "Name" - - // DocumentFilterKeyOwner is a DocumentFilterKey enum value - DocumentFilterKeyOwner = "Owner" - - // DocumentFilterKeyPlatformTypes is a DocumentFilterKey enum value - DocumentFilterKeyPlatformTypes = "PlatformTypes" - - // DocumentFilterKeyDocumentType is a DocumentFilterKey enum value - DocumentFilterKeyDocumentType = "DocumentType" -) - -const ( - // DocumentHashTypeSha256 is a DocumentHashType enum value - DocumentHashTypeSha256 = "Sha256" - - // DocumentHashTypeSha1 is a DocumentHashType enum value - DocumentHashTypeSha1 = "Sha1" -) - -const ( - // DocumentParameterTypeString is a DocumentParameterType enum value - DocumentParameterTypeString = "String" - - // DocumentParameterTypeStringList is a DocumentParameterType enum value - DocumentParameterTypeStringList = "StringList" -) - -const ( - // DocumentPermissionTypeShare is a DocumentPermissionType enum value - DocumentPermissionTypeShare = "Share" -) - -const ( - // DocumentStatusCreating is a DocumentStatus enum value - DocumentStatusCreating = "Creating" - - // DocumentStatusActive is a DocumentStatus enum value - DocumentStatusActive = "Active" - - // DocumentStatusUpdating is a DocumentStatus enum value - DocumentStatusUpdating = "Updating" - - // DocumentStatusDeleting is a DocumentStatus enum value - DocumentStatusDeleting = "Deleting" -) - -const ( - // DocumentTypeCommand is a DocumentType enum value - DocumentTypeCommand = "Command" - - // DocumentTypePolicy is a DocumentType enum value - DocumentTypePolicy = "Policy" - - // DocumentTypeAutomation is a DocumentType enum value - DocumentTypeAutomation = "Automation" -) - -const ( - // FaultClient is a Fault enum value - FaultClient = "Client" - - // FaultServer is a Fault enum value - FaultServer = "Server" - - // FaultUnknown is a Fault enum value - FaultUnknown = "Unknown" -) - -const ( - // InstanceInformationFilterKeyInstanceIds is a InstanceInformationFilterKey enum value - InstanceInformationFilterKeyInstanceIds = "InstanceIds" - - // InstanceInformationFilterKeyAgentVersion is a InstanceInformationFilterKey enum value - InstanceInformationFilterKeyAgentVersion = "AgentVersion" - - // InstanceInformationFilterKeyPingStatus is a InstanceInformationFilterKey enum value - InstanceInformationFilterKeyPingStatus = "PingStatus" - - // InstanceInformationFilterKeyPlatformTypes is a InstanceInformationFilterKey enum value - InstanceInformationFilterKeyPlatformTypes = "PlatformTypes" - - // InstanceInformationFilterKeyActivationIds is a InstanceInformationFilterKey enum value - InstanceInformationFilterKeyActivationIds = "ActivationIds" - - // InstanceInformationFilterKeyIamRole is a InstanceInformationFilterKey enum value - InstanceInformationFilterKeyIamRole = "IamRole" - - // InstanceInformationFilterKeyResourceType is a InstanceInformationFilterKey enum value - InstanceInformationFilterKeyResourceType = "ResourceType" - - // InstanceInformationFilterKeyAssociationStatus is a InstanceInformationFilterKey enum value - InstanceInformationFilterKeyAssociationStatus = "AssociationStatus" -) - -const ( - // InstancePatchStateOperatorTypeEqual is a InstancePatchStateOperatorType enum value - InstancePatchStateOperatorTypeEqual = "Equal" - - // InstancePatchStateOperatorTypeNotEqual is a InstancePatchStateOperatorType enum value - InstancePatchStateOperatorTypeNotEqual = "NotEqual" - - // InstancePatchStateOperatorTypeLessThan is a InstancePatchStateOperatorType enum value - InstancePatchStateOperatorTypeLessThan = "LessThan" - - // InstancePatchStateOperatorTypeGreaterThan is a InstancePatchStateOperatorType enum value - InstancePatchStateOperatorTypeGreaterThan = "GreaterThan" -) - -const ( - // InventoryAttributeDataTypeString is a InventoryAttributeDataType enum value - InventoryAttributeDataTypeString = "string" - - // InventoryAttributeDataTypeNumber is a InventoryAttributeDataType enum value - InventoryAttributeDataTypeNumber = "number" -) - -const ( - // InventoryQueryOperatorTypeEqual is a InventoryQueryOperatorType enum value - InventoryQueryOperatorTypeEqual = "Equal" - - // InventoryQueryOperatorTypeNotEqual is a InventoryQueryOperatorType enum value - InventoryQueryOperatorTypeNotEqual = "NotEqual" - - // InventoryQueryOperatorTypeBeginWith is a InventoryQueryOperatorType enum value - InventoryQueryOperatorTypeBeginWith = "BeginWith" - - // InventoryQueryOperatorTypeLessThan is a InventoryQueryOperatorType enum value - InventoryQueryOperatorTypeLessThan = "LessThan" - - // InventoryQueryOperatorTypeGreaterThan is a InventoryQueryOperatorType enum value - InventoryQueryOperatorTypeGreaterThan = "GreaterThan" -) - -const ( - // MaintenanceWindowExecutionStatusPending is a MaintenanceWindowExecutionStatus enum value - MaintenanceWindowExecutionStatusPending = "PENDING" - - // MaintenanceWindowExecutionStatusInProgress is a MaintenanceWindowExecutionStatus enum value - MaintenanceWindowExecutionStatusInProgress = "IN_PROGRESS" - - // MaintenanceWindowExecutionStatusSuccess is a MaintenanceWindowExecutionStatus enum value - MaintenanceWindowExecutionStatusSuccess = "SUCCESS" - - // MaintenanceWindowExecutionStatusFailed is a MaintenanceWindowExecutionStatus enum value - MaintenanceWindowExecutionStatusFailed = "FAILED" - - // MaintenanceWindowExecutionStatusTimedOut is a MaintenanceWindowExecutionStatus enum value - MaintenanceWindowExecutionStatusTimedOut = "TIMED_OUT" - - // MaintenanceWindowExecutionStatusCancelling is a MaintenanceWindowExecutionStatus enum value - MaintenanceWindowExecutionStatusCancelling = "CANCELLING" - - // MaintenanceWindowExecutionStatusCancelled is a MaintenanceWindowExecutionStatus enum value - MaintenanceWindowExecutionStatusCancelled = "CANCELLED" - - // MaintenanceWindowExecutionStatusSkippedOverlapping is a MaintenanceWindowExecutionStatus enum value - MaintenanceWindowExecutionStatusSkippedOverlapping = "SKIPPED_OVERLAPPING" -) - -const ( - // MaintenanceWindowResourceTypeInstance is a MaintenanceWindowResourceType enum value - MaintenanceWindowResourceTypeInstance = "INSTANCE" -) - -const ( - // MaintenanceWindowTaskTypeRunCommand is a MaintenanceWindowTaskType enum value - MaintenanceWindowTaskTypeRunCommand = "RUN_COMMAND" -) - -const ( - // NotificationEventAll is a NotificationEvent enum value - NotificationEventAll = "All" - - // NotificationEventInProgress is a NotificationEvent enum value - NotificationEventInProgress = "InProgress" - - // NotificationEventSuccess is a NotificationEvent enum value - NotificationEventSuccess = "Success" - - // NotificationEventTimedOut is a NotificationEvent enum value - NotificationEventTimedOut = "TimedOut" - - // NotificationEventCancelled is a NotificationEvent enum value - NotificationEventCancelled = "Cancelled" - - // NotificationEventFailed is a NotificationEvent enum value - NotificationEventFailed = "Failed" -) - -const ( - // NotificationTypeCommand is a NotificationType enum value - NotificationTypeCommand = "Command" - - // NotificationTypeInvocation is a NotificationType enum value - NotificationTypeInvocation = "Invocation" -) - -const ( - // ParameterTypeString is a ParameterType enum value - ParameterTypeString = "String" - - // ParameterTypeStringList is a ParameterType enum value - ParameterTypeStringList = "StringList" - - // ParameterTypeSecureString is a ParameterType enum value - ParameterTypeSecureString = "SecureString" -) - -const ( - // ParametersFilterKeyName is a ParametersFilterKey enum value - ParametersFilterKeyName = "Name" - - // ParametersFilterKeyType is a ParametersFilterKey enum value - ParametersFilterKeyType = "Type" - - // ParametersFilterKeyKeyId is a ParametersFilterKey enum value - ParametersFilterKeyKeyId = "KeyId" -) - -const ( - // PatchComplianceDataStateInstalled is a PatchComplianceDataState enum value - PatchComplianceDataStateInstalled = "INSTALLED" - - // PatchComplianceDataStateInstalledOther is a PatchComplianceDataState enum value - PatchComplianceDataStateInstalledOther = "INSTALLED_OTHER" - - // PatchComplianceDataStateMissing is a PatchComplianceDataState enum value - PatchComplianceDataStateMissing = "MISSING" - - // PatchComplianceDataStateNotApplicable is a PatchComplianceDataState enum value - PatchComplianceDataStateNotApplicable = "NOT_APPLICABLE" - - // PatchComplianceDataStateFailed is a PatchComplianceDataState enum value - PatchComplianceDataStateFailed = "FAILED" -) - -const ( - // PatchDeploymentStatusApproved is a PatchDeploymentStatus enum value - PatchDeploymentStatusApproved = "APPROVED" - - // PatchDeploymentStatusPendingApproval is a PatchDeploymentStatus enum value - PatchDeploymentStatusPendingApproval = "PENDING_APPROVAL" - - // PatchDeploymentStatusExplicitApproved is a PatchDeploymentStatus enum value - PatchDeploymentStatusExplicitApproved = "EXPLICIT_APPROVED" - - // PatchDeploymentStatusExplicitRejected is a PatchDeploymentStatus enum value - PatchDeploymentStatusExplicitRejected = "EXPLICIT_REJECTED" -) - -const ( - // PatchFilterKeyProduct is a PatchFilterKey enum value - PatchFilterKeyProduct = "PRODUCT" - - // PatchFilterKeyClassification is a PatchFilterKey enum value - PatchFilterKeyClassification = "CLASSIFICATION" - - // PatchFilterKeyMsrcSeverity is a PatchFilterKey enum value - PatchFilterKeyMsrcSeverity = "MSRC_SEVERITY" - - // PatchFilterKeyPatchId is a PatchFilterKey enum value - PatchFilterKeyPatchId = "PATCH_ID" -) - -const ( - // PatchOperationTypeScan is a PatchOperationType enum value - PatchOperationTypeScan = "Scan" - - // PatchOperationTypeInstall is a PatchOperationType enum value - PatchOperationTypeInstall = "Install" -) - -const ( - // PingStatusOnline is a PingStatus enum value - PingStatusOnline = "Online" - - // PingStatusConnectionLost is a PingStatus enum value - PingStatusConnectionLost = "ConnectionLost" - - // PingStatusInactive is a PingStatus enum value - PingStatusInactive = "Inactive" -) - -const ( - // PlatformTypeWindows is a PlatformType enum value - PlatformTypeWindows = "Windows" - - // PlatformTypeLinux is a PlatformType enum value - PlatformTypeLinux = "Linux" -) - -const ( - // ResourceTypeManagedInstance is a ResourceType enum value - ResourceTypeManagedInstance = "ManagedInstance" - - // ResourceTypeDocument is a ResourceType enum value - ResourceTypeDocument = "Document" - - // ResourceTypeEc2instance is a ResourceType enum value - ResourceTypeEc2instance = "EC2Instance" -) - -const ( - // ResourceTypeForTaggingManagedInstance is a ResourceTypeForTagging enum value - ResourceTypeForTaggingManagedInstance = "ManagedInstance" - - // ResourceTypeForTaggingMaintenanceWindow is a ResourceTypeForTagging enum value - ResourceTypeForTaggingMaintenanceWindow = "MaintenanceWindow" - - // ResourceTypeForTaggingParameter is a ResourceTypeForTagging enum value - ResourceTypeForTaggingParameter = "Parameter" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go deleted file mode 100644 index bea03cf..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go +++ /dev/null @@ -1,448 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ssm - -const ( - - // ErrCodeAlreadyExistsException for service response error code - // "AlreadyExistsException". - // - // Error returned if an attempt is made to register a patch group with a patch - // baseline that is already registered with a different patch baseline. - ErrCodeAlreadyExistsException = "AlreadyExistsException" - - // ErrCodeAssociatedInstances for service response error code - // "AssociatedInstances". - // - // You must disassociate an SSM document from all instances before you can delete - // it. - ErrCodeAssociatedInstances = "AssociatedInstances" - - // ErrCodeAssociationAlreadyExists for service response error code - // "AssociationAlreadyExists". - // - // The specified association already exists. - ErrCodeAssociationAlreadyExists = "AssociationAlreadyExists" - - // ErrCodeAssociationDoesNotExist for service response error code - // "AssociationDoesNotExist". - // - // The specified association does not exist. - ErrCodeAssociationDoesNotExist = "AssociationDoesNotExist" - - // ErrCodeAssociationLimitExceeded for service response error code - // "AssociationLimitExceeded". - // - // You can have at most 2,000 active associations. - ErrCodeAssociationLimitExceeded = "AssociationLimitExceeded" - - // ErrCodeAutomationDefinitionNotFoundException for service response error code - // "AutomationDefinitionNotFoundException". - // - // An Automation document with the specified name could not be found. - ErrCodeAutomationDefinitionNotFoundException = "AutomationDefinitionNotFoundException" - - // ErrCodeAutomationDefinitionVersionNotFoundException for service response error code - // "AutomationDefinitionVersionNotFoundException". - // - // An Automation document with the specified name and version could not be found. - ErrCodeAutomationDefinitionVersionNotFoundException = "AutomationDefinitionVersionNotFoundException" - - // ErrCodeAutomationExecutionLimitExceededException for service response error code - // "AutomationExecutionLimitExceededException". - // - // The number of simultaneously running Automation executions exceeded the allowable - // limit. - ErrCodeAutomationExecutionLimitExceededException = "AutomationExecutionLimitExceededException" - - // ErrCodeAutomationExecutionNotFoundException for service response error code - // "AutomationExecutionNotFoundException". - // - // There is no automation execution information for the requested automation - // execution ID. - ErrCodeAutomationExecutionNotFoundException = "AutomationExecutionNotFoundException" - - // ErrCodeCustomSchemaCountLimitExceededException for service response error code - // "CustomSchemaCountLimitExceededException". - // - // You have exceeded the limit for custom schemas. Delete one or more custom - // schemas and try again. - ErrCodeCustomSchemaCountLimitExceededException = "CustomSchemaCountLimitExceededException" - - // ErrCodeDocumentAlreadyExists for service response error code - // "DocumentAlreadyExists". - // - // The specified SSM document already exists. - ErrCodeDocumentAlreadyExists = "DocumentAlreadyExists" - - // ErrCodeDocumentLimitExceeded for service response error code - // "DocumentLimitExceeded". - // - // You can have at most 200 active SSM documents. - ErrCodeDocumentLimitExceeded = "DocumentLimitExceeded" - - // ErrCodeDocumentPermissionLimit for service response error code - // "DocumentPermissionLimit". - // - // The document cannot be shared with more AWS user accounts. You can share - // a document with a maximum of 20 accounts. You can publicly share up to five - // documents. If you need to increase this limit, contact AWS Support. - ErrCodeDocumentPermissionLimit = "DocumentPermissionLimit" - - // ErrCodeDocumentVersionLimitExceeded for service response error code - // "DocumentVersionLimitExceeded". - // - // The document has too many versions. Delete one or more document versions - // and try again. - ErrCodeDocumentVersionLimitExceeded = "DocumentVersionLimitExceeded" - - // ErrCodeDoesNotExistException for service response error code - // "DoesNotExistException". - // - // Error returned when the ID specified for a resource (e.g. a Maintenance Window) - // doesn’t exist. - ErrCodeDoesNotExistException = "DoesNotExistException" - - // ErrCodeDuplicateDocumentContent for service response error code - // "DuplicateDocumentContent". - // - // The content of the association document matches another document. Change - // the content of the document and try again. - ErrCodeDuplicateDocumentContent = "DuplicateDocumentContent" - - // ErrCodeDuplicateInstanceId for service response error code - // "DuplicateInstanceId". - // - // You cannot specify an instance ID in more than one association. - ErrCodeDuplicateInstanceId = "DuplicateInstanceId" - - // ErrCodeIdempotentParameterMismatch for service response error code - // "IdempotentParameterMismatch". - // - // Error returned when an idempotent operation is retried and the parameters - // don’t match the original call to the API with the same idempotency token. - ErrCodeIdempotentParameterMismatch = "IdempotentParameterMismatch" - - // ErrCodeInternalServerError for service response error code - // "InternalServerError". - // - // An error occurred on the server side. - ErrCodeInternalServerError = "InternalServerError" - - // ErrCodeInvalidActivation for service response error code - // "InvalidActivation". - // - // The activation is not valid. The activation might have been deleted, or the - // ActivationId and the ActivationCode do not match. - ErrCodeInvalidActivation = "InvalidActivation" - - // ErrCodeInvalidActivationId for service response error code - // "InvalidActivationId". - // - // The activation ID is not valid. Verify the you entered the correct ActivationId - // or ActivationCode and try again. - ErrCodeInvalidActivationId = "InvalidActivationId" - - // ErrCodeInvalidAutomationExecutionParametersException for service response error code - // "InvalidAutomationExecutionParametersException". - // - // The supplied parameters for invoking the specified Automation document are - // incorrect. For example, they may not match the set of parameters permitted - // for the specified Automation document. - ErrCodeInvalidAutomationExecutionParametersException = "InvalidAutomationExecutionParametersException" - - // ErrCodeInvalidCommandId for service response error code - // "InvalidCommandId". - ErrCodeInvalidCommandId = "InvalidCommandId" - - // ErrCodeInvalidDocument for service response error code - // "InvalidDocument". - // - // The specified document does not exist. - ErrCodeInvalidDocument = "InvalidDocument" - - // ErrCodeInvalidDocumentContent for service response error code - // "InvalidDocumentContent". - // - // The content for the SSM document is not valid. - ErrCodeInvalidDocumentContent = "InvalidDocumentContent" - - // ErrCodeInvalidDocumentOperation for service response error code - // "InvalidDocumentOperation". - // - // You attempted to delete a document while it is still shared. You must stop - // sharing the document before you can delete it. - ErrCodeInvalidDocumentOperation = "InvalidDocumentOperation" - - // ErrCodeInvalidDocumentSchemaVersion for service response error code - // "InvalidDocumentSchemaVersion". - // - // The version of the document schema is not supported. - ErrCodeInvalidDocumentSchemaVersion = "InvalidDocumentSchemaVersion" - - // ErrCodeInvalidDocumentVersion for service response error code - // "InvalidDocumentVersion". - // - // The document version is not valid or does not exist. - ErrCodeInvalidDocumentVersion = "InvalidDocumentVersion" - - // ErrCodeInvalidFilter for service response error code - // "InvalidFilter". - // - // The filter name is not valid. Verify the you entered the correct name and - // try again. - ErrCodeInvalidFilter = "InvalidFilter" - - // ErrCodeInvalidFilterKey for service response error code - // "InvalidFilterKey". - // - // The specified key is not valid. - ErrCodeInvalidFilterKey = "InvalidFilterKey" - - // ErrCodeInvalidFilterValue for service response error code - // "InvalidFilterValue". - // - // The filter value is not valid. Verify the value and try again. - ErrCodeInvalidFilterValue = "InvalidFilterValue" - - // ErrCodeInvalidInstanceId for service response error code - // "InvalidInstanceId". - // - // The following problems can cause this exception: - // - // You do not have permission to access the instance. - // - // The SSM agent is not running. On managed instances and Linux instances, verify - // that the SSM agent is running. On EC2 Windows instances, verify that the - // EC2Config service is running. - // - // The SSM agent or EC2Config service is not registered to the SSM endpoint. - // Try reinstalling the SSM agent or EC2Config service. - // - // The instance is not in valid state. Valid states are: Running, Pending, Stopped, - // Stopping. Invalid states are: Shutting-down and Terminated. - ErrCodeInvalidInstanceId = "InvalidInstanceId" - - // ErrCodeInvalidInstanceInformationFilterValue for service response error code - // "InvalidInstanceInformationFilterValue". - // - // The specified filter value is not valid. - ErrCodeInvalidInstanceInformationFilterValue = "InvalidInstanceInformationFilterValue" - - // ErrCodeInvalidItemContentException for service response error code - // "InvalidItemContentException". - // - // One or more content items is not valid. - ErrCodeInvalidItemContentException = "InvalidItemContentException" - - // ErrCodeInvalidKeyId for service response error code - // "InvalidKeyId". - // - // The query key ID is not valid. - ErrCodeInvalidKeyId = "InvalidKeyId" - - // ErrCodeInvalidNextToken for service response error code - // "InvalidNextToken". - // - // The specified token is not valid. - ErrCodeInvalidNextToken = "InvalidNextToken" - - // ErrCodeInvalidNotificationConfig for service response error code - // "InvalidNotificationConfig". - // - // One or more configuration items is not valid. Verify that a valid Amazon - // Resource Name (ARN) was provided for an Amazon SNS topic. - ErrCodeInvalidNotificationConfig = "InvalidNotificationConfig" - - // ErrCodeInvalidOutputFolder for service response error code - // "InvalidOutputFolder". - // - // The S3 bucket does not exist. - ErrCodeInvalidOutputFolder = "InvalidOutputFolder" - - // ErrCodeInvalidOutputLocation for service response error code - // "InvalidOutputLocation". - // - // The output location is not valid or does not exist. - ErrCodeInvalidOutputLocation = "InvalidOutputLocation" - - // ErrCodeInvalidParameters for service response error code - // "InvalidParameters". - // - // You must specify values for all required parameters in the SSM document. - // You can only supply values to parameters defined in the SSM document. - ErrCodeInvalidParameters = "InvalidParameters" - - // ErrCodeInvalidPermissionType for service response error code - // "InvalidPermissionType". - // - // The permission type is not supported. Share is the only supported permission - // type. - ErrCodeInvalidPermissionType = "InvalidPermissionType" - - // ErrCodeInvalidPluginName for service response error code - // "InvalidPluginName". - // - // The plugin name is not valid. - ErrCodeInvalidPluginName = "InvalidPluginName" - - // ErrCodeInvalidResourceId for service response error code - // "InvalidResourceId". - // - // The resource ID is not valid. Verify that you entered the correct ID and - // try again. - ErrCodeInvalidResourceId = "InvalidResourceId" - - // ErrCodeInvalidResourceType for service response error code - // "InvalidResourceType". - // - // The resource type is not valid. If you are attempting to tag an instance, - // the instance must be a registered, managed instance. - ErrCodeInvalidResourceType = "InvalidResourceType" - - // ErrCodeInvalidResultAttributeException for service response error code - // "InvalidResultAttributeException". - // - // The specified inventory item result attribute is not valid. - ErrCodeInvalidResultAttributeException = "InvalidResultAttributeException" - - // ErrCodeInvalidRole for service response error code - // "InvalidRole". - // - // The role name can't contain invalid characters. Also verify that you specified - // an IAM role for notifications that includes the required trust policy. For - // information about configuring the IAM role for Run Command notifications, - // see Getting Amazon SNS Notifications When a Command Changes Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/rc-sns.html) - // in the Amazon Elastic Compute Cloud User Guide . - ErrCodeInvalidRole = "InvalidRole" - - // ErrCodeInvalidSchedule for service response error code - // "InvalidSchedule". - // - // The schedule is invalid. Verify your cron or rate expression and try again. - ErrCodeInvalidSchedule = "InvalidSchedule" - - // ErrCodeInvalidTarget for service response error code - // "InvalidTarget". - // - // The target is not valid or does not exist. It might not be configured for - // EC2 Systems Manager or you might not have permission to perform the operation. - ErrCodeInvalidTarget = "InvalidTarget" - - // ErrCodeInvalidTypeNameException for service response error code - // "InvalidTypeNameException". - // - // The parameter type name is not valid. - ErrCodeInvalidTypeNameException = "InvalidTypeNameException" - - // ErrCodeInvalidUpdate for service response error code - // "InvalidUpdate". - // - // The update is not valid. - ErrCodeInvalidUpdate = "InvalidUpdate" - - // ErrCodeInvocationDoesNotExist for service response error code - // "InvocationDoesNotExist". - // - // The command ID and instance ID you specified did not match any invocations. - // Verify the command ID adn the instance ID and try again. - ErrCodeInvocationDoesNotExist = "InvocationDoesNotExist" - - // ErrCodeItemContentMismatchException for service response error code - // "ItemContentMismatchException". - // - // The inventory item has invalid content. - ErrCodeItemContentMismatchException = "ItemContentMismatchException" - - // ErrCodeItemSizeLimitExceededException for service response error code - // "ItemSizeLimitExceededException". - // - // The inventory item size has exceeded the size limit. - ErrCodeItemSizeLimitExceededException = "ItemSizeLimitExceededException" - - // ErrCodeMaxDocumentSizeExceeded for service response error code - // "MaxDocumentSizeExceeded". - // - // The size limit of an SSM document is 64 KB. - ErrCodeMaxDocumentSizeExceeded = "MaxDocumentSizeExceeded" - - // ErrCodeParameterAlreadyExists for service response error code - // "ParameterAlreadyExists". - // - // The parameter already exists. You can't create duplicate parameters. - ErrCodeParameterAlreadyExists = "ParameterAlreadyExists" - - // ErrCodeParameterLimitExceeded for service response error code - // "ParameterLimitExceeded". - // - // You have exceeded the number of parameters for this AWS account. Delete one - // or more parameters and try again. - ErrCodeParameterLimitExceeded = "ParameterLimitExceeded" - - // ErrCodeParameterNotFound for service response error code - // "ParameterNotFound". - // - // The parameter could not be found. Verify the name and try again. - ErrCodeParameterNotFound = "ParameterNotFound" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUseException". - // - // Error returned if an attempt is made to delete a patch baseline that is registered - // for a patch group. - ErrCodeResourceInUseException = "ResourceInUseException" - - // ErrCodeResourceLimitExceededException for service response error code - // "ResourceLimitExceededException". - // - // Error returned when the caller has exceeded the default resource limits (e.g. - // too many Maintenance Windows have been created). - ErrCodeResourceLimitExceededException = "ResourceLimitExceededException" - - // ErrCodeStatusUnchanged for service response error code - // "StatusUnchanged". - // - // The updated status is the same as the current status. - ErrCodeStatusUnchanged = "StatusUnchanged" - - // ErrCodeTooManyTagsError for service response error code - // "TooManyTagsError". - // - // The Targets parameter includes too many tags. Remove one or more tags and - // try the command again. - ErrCodeTooManyTagsError = "TooManyTagsError" - - // ErrCodeTooManyUpdates for service response error code - // "TooManyUpdates". - // - // There are concurrent updates for a resource that supports one update at a - // time. - ErrCodeTooManyUpdates = "TooManyUpdates" - - // ErrCodeTotalSizeLimitExceededException for service response error code - // "TotalSizeLimitExceededException". - // - // The size of inventory data has exceeded the total size limit for the resource. - ErrCodeTotalSizeLimitExceededException = "TotalSizeLimitExceededException" - - // ErrCodeUnsupportedInventorySchemaVersionException for service response error code - // "UnsupportedInventorySchemaVersionException". - // - // Inventory item type schema version has to match supported versions in the - // service. Check output of GetInventorySchema to see the available schema version - // for each type. - ErrCodeUnsupportedInventorySchemaVersionException = "UnsupportedInventorySchemaVersionException" - - // ErrCodeUnsupportedParameterType for service response error code - // "UnsupportedParameterType". - // - // The parameter type is not supported. - ErrCodeUnsupportedParameterType = "UnsupportedParameterType" - - // ErrCodeUnsupportedPlatformType for service response error code - // "UnsupportedPlatformType". - // - // The document does not support the platform type of the given instance ID(s). - // For example, you sent an SSM document for a Windows instance to a Linux instance. - ErrCodeUnsupportedPlatformType = "UnsupportedPlatformType" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go b/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go deleted file mode 100644 index 9e90268..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go +++ /dev/null @@ -1,107 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package ssm - -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 EC2 Systems Manager is a collection of capabilities that helps you -// automate management tasks such as collecting system inventory, applying operating -// system (OS) patches, automating the creation of Amazon Machine Images (AMIs), -// and configuring operating systems (OSs) and applications at scale. Systems -// Manager works with managed instances: Amazon EC2 instances and servers or -// virtual machines (VMs) in your on-premises environment that are configured -// for Systems Manager. -// -// This references is intended to be used with the EC2 Systems Manager User -// Guide (Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/systems-manager.html)) -// (Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/systems-manager.html)). -// -// To get started, verify prerequisites and configure managed instances (Linux -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/systems-manager-prereqs.html)) -// (Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/systems-manager-prereqs.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/ssm-2014-11-06 -type SSM 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 = "ssm" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the SSM 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 SSM client from just a session. -// svc := ssm.New(mySession) -// -// // Create a SSM client with additional configuration -// svc := ssm.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SSM { - 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) *SSM { - svc := &SSM{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-11-06", - JSONVersion: "1.1", - TargetPrefix: "AmazonSSM", - }, - 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 SSM operation and runs any -// custom request initialization. -func (c *SSM) 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 ad42b4c..3b8be43 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,11 +1,11 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// 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 ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -14,19 +14,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 complets +// successfuly. // -// 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) @@ -172,27 +171,41 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // Please also see 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) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssumeRoleWithContext is the same as AssumeRole with the addition of +// the ability to pass a context and additional request options. +// +// See AssumeRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssumeRoleWithContext(ctx aws.Context, input *AssumeRoleInput, opts ...request.Option) (*AssumeRoleOutput, error) { + req, out := c.AssumeRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } 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 complets +// successfuly. // -// See AssumeRoleWithSAML 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 AssumeRoleWithSAML method directly -// instead. +// See AssumeRoleWithSAML for more information on using the AssumeRoleWithSAML +// 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 AssumeRoleWithSAMLRequest method. // req, resp := client.AssumeRoleWithSAMLRequest(params) @@ -331,27 +344,41 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // Please also see 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) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssumeRoleWithSAMLWithContext is the same as AssumeRoleWithSAML with the addition of +// the ability to pass a context and additional request options. +// +// See AssumeRoleWithSAML for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssumeRoleWithSAMLWithContext(ctx aws.Context, input *AssumeRoleWithSAMLInput, opts ...request.Option) (*AssumeRoleWithSAMLOutput, error) { + req, out := c.AssumeRoleWithSAMLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } 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 complets +// successfuly. // -// See AssumeRoleWithWebIdentity 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 AssumeRoleWithWebIdentity method directly -// instead. +// See AssumeRoleWithWebIdentity for more information on using the AssumeRoleWithWebIdentity +// 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 AssumeRoleWithWebIdentityRequest method. // req, resp := client.AssumeRoleWithWebIdentityRequest(params) @@ -519,27 +546,41 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // Please also see 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) - err := req.Send() - return out, err + return out, req.Send() +} + +// AssumeRoleWithWebIdentityWithContext is the same as AssumeRoleWithWebIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See AssumeRoleWithWebIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) AssumeRoleWithWebIdentityWithContext(ctx aws.Context, input *AssumeRoleWithWebIdentityInput, opts ...request.Option) (*AssumeRoleWithWebIdentityOutput, error) { + req, out := c.AssumeRoleWithWebIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } 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 complets +// successfuly. // -// See DecodeAuthorizationMessage 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 DecodeAuthorizationMessage method directly -// instead. +// See DecodeAuthorizationMessage for more information on using the DecodeAuthorizationMessage +// 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 DecodeAuthorizationMessageRequest method. // req, resp := client.DecodeAuthorizationMessageRequest(params) @@ -617,27 +658,41 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag // Please also see 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) - err := req.Send() - return out, err + return out, req.Send() +} + +// DecodeAuthorizationMessageWithContext is the same as DecodeAuthorizationMessage with the addition of +// the ability to pass a context and additional request options. +// +// See DecodeAuthorizationMessage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *DecodeAuthorizationMessageInput, opts ...request.Option) (*DecodeAuthorizationMessageOutput, error) { + req, out := c.DecodeAuthorizationMessageRequest(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 complets +// successfuly. +// +// 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 GetCallerIdentity for usage and error information. +// See GetCallerIdentity for more information on using the GetCallerIdentity +// 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 GetCallerIdentity 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 GetCallerIdentityRequest method. // req, resp := client.GetCallerIdentityRequest(params) @@ -678,27 +733,41 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ // Please also see 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) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetCallerIdentityWithContext is the same as GetCallerIdentity with the addition of +// the ability to pass a context and additional request options. +// +// See GetCallerIdentity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetCallerIdentityWithContext(ctx aws.Context, input *GetCallerIdentityInput, opts ...request.Option) (*GetCallerIdentityOutput, error) { + req, out := c.GetCallerIdentityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } 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 complets +// successfuly. +// +// 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 GetFederationToken for usage and error information. +// See GetFederationToken for more information on using the GetFederationToken +// 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 GetFederationToken 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 GetFederationTokenRequest method. // req, resp := client.GetFederationTokenRequest(params) @@ -833,27 +902,41 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // Please also see 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) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetFederationTokenWithContext is the same as GetFederationToken with the addition of +// the ability to pass a context and additional request options. +// +// See GetFederationToken for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetFederationTokenWithContext(ctx aws.Context, input *GetFederationTokenInput, opts ...request.Option) (*GetFederationTokenOutput, error) { + req, out := c.GetFederationTokenRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } 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 complets +// successfuly. +// +// 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) @@ -947,8 +1030,23 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request. // Please also see 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) - err := req.Send() - return out, err + return out, req.Send() +} + +// GetSessionTokenWithContext is the same as GetSessionToken with the addition of +// the ability to pass a context and additional request options. +// +// See GetSessionToken for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) GetSessionTokenWithContext(ctx aws.Context, input *GetSessionTokenInput, opts ...request.Option) (*GetSessionTokenOutput, error) { + req, out := c.GetSessionTokenRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest @@ -980,7 +1078,7 @@ type AssumeRoleInput struct { // // The regex used to validated 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. @@ -2164,9 +2262,9 @@ type GetSessionTokenInput struct { // You can find the device for an IAM user by going to the AWS Management Console // and viewing the user's security credentials. // - // The regex used to validate this parameter is a string of characters consisting + // The regex used to validated 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 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..a43fa80 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go @@ -0,0 +1,72 @@ +// 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 (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html). +// +// 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). +// +// 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 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 dbcd667..e24884e 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 @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sts 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 9c4bfb8..1ee5839 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 @@ -1,4 +1,4 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sts @@ -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 } diff --git a/vendor/github.com/aws/aws-sdk-go/service/waf/api.go b/vendor/github.com/aws/aws-sdk-go/service/waf/api.go deleted file mode 100644 index 153e3a7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/api.go +++ /dev/null @@ -1,10579 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package waf provides a client for AWS WAF. -package waf - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opCreateByteMatchSet = "CreateByteMatchSet" - -// CreateByteMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateByteMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateByteMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateByteMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateByteMatchSetRequest method. -// req, resp := client.CreateByteMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSet -func (c *WAF) CreateByteMatchSetRequest(input *CreateByteMatchSetInput) (req *request.Request, output *CreateByteMatchSetOutput) { - op := &request.Operation{ - Name: opCreateByteMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateByteMatchSetInput{} - } - - output = &CreateByteMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateByteMatchSet API operation for AWS WAF. -// -// Creates a ByteMatchSet. You then use UpdateByteMatchSet to identify the part -// of a web request that you want AWS WAF to inspect, such as the values of -// the User-Agent header or the query string. For example, you can create a -// ByteMatchSet that matches any requests with User-Agent headers that contain -// the string BadBot. You can then configure AWS WAF to reject those requests. -// -// To create and configure a ByteMatchSet, perform the following steps: -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a CreateByteMatchSet request. -// -// Submit a CreateByteMatchSet request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateByteMatchSet request. -// -// Submit an UpdateByteMatchSet request to specify the part of the request that -// you want AWS WAF to inspect (for example, the header or the URI) and the -// value that you want AWS WAF to watch for. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation CreateByteMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDisallowedNameException "DisallowedNameException" -// The name specified is invalid. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSet -func (c *WAF) CreateByteMatchSet(input *CreateByteMatchSetInput) (*CreateByteMatchSetOutput, error) { - req, out := c.CreateByteMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opCreateIPSet = "CreateIPSet" - -// CreateIPSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateIPSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateIPSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateIPSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateIPSetRequest method. -// req, resp := client.CreateIPSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSet -func (c *WAF) CreateIPSetRequest(input *CreateIPSetInput) (req *request.Request, output *CreateIPSetOutput) { - op := &request.Operation{ - Name: opCreateIPSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateIPSetInput{} - } - - output = &CreateIPSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateIPSet API operation for AWS WAF. -// -// Creates an IPSet, which you use to specify which web requests you want to -// allow or block based on the IP addresses that the requests originate from. -// For example, if you're receiving a lot of requests from one or more individual -// IP addresses or one or more ranges of IP addresses and you want to block -// the requests, you can create an IPSet that contains those IP addresses and -// then configure AWS WAF to block the requests. -// -// To create and configure an IPSet, perform the following steps: -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a CreateIPSet request. -// -// Submit a CreateIPSet request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateIPSet request. -// -// Submit an UpdateIPSet request to specify the IP addresses that you want AWS -// WAF to watch for. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation CreateIPSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeDisallowedNameException "DisallowedNameException" -// The name specified is invalid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSet -func (c *WAF) CreateIPSet(input *CreateIPSetInput) (*CreateIPSetOutput, error) { - req, out := c.CreateIPSetRequest(input) - err := req.Send() - return out, err -} - -const opCreateRule = "CreateRule" - -// CreateRuleRequest generates a "aws/request.Request" representing the -// client's request for the CreateRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateRuleRequest method. -// req, resp := client.CreateRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRule -func (c *WAF) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, output *CreateRuleOutput) { - op := &request.Operation{ - Name: opCreateRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRuleInput{} - } - - output = &CreateRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRule API operation for AWS WAF. -// -// Creates a Rule, which contains the IPSet objects, ByteMatchSet objects, and -// other predicates that identify the requests that you want to block. If you -// add more than one predicate to a Rule, a request must match all of the specifications -// to be allowed or blocked. For example, suppose you add the following to a -// Rule: -// -// * An IPSet that matches the IP address 192.0.2.44/32 -// -// * A ByteMatchSet that matches BadBot in the User-Agent header -// -// You then add the Rule to a WebACL and specify that you want to blocks requests -// that satisfy the Rule. For a request to be blocked, it must come from the -// IP address 192.0.2.44 and the User-Agent header in the request must contain -// the value BadBot. -// -// To create and configure a Rule, perform the following steps: -// -// Create and update the predicates that you want to include in the Rule. For -// more information, see CreateByteMatchSet, CreateIPSet, and CreateSqlInjectionMatchSet. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a CreateRule request. -// -// Submit a CreateRule request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateRule request. -// -// Submit an UpdateRule request to specify the predicates that you want to include -// in the Rule. -// -// Create and update a WebACL that contains the Rule. For more information, -// see CreateWebACL. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation CreateRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeDisallowedNameException "DisallowedNameException" -// The name specified is invalid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRule -func (c *WAF) CreateRule(input *CreateRuleInput) (*CreateRuleOutput, error) { - req, out := c.CreateRuleRequest(input) - err := req.Send() - return out, err -} - -const opCreateSizeConstraintSet = "CreateSizeConstraintSet" - -// CreateSizeConstraintSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateSizeConstraintSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSizeConstraintSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSizeConstraintSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSizeConstraintSetRequest method. -// req, resp := client.CreateSizeConstraintSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSizeConstraintSet -func (c *WAF) CreateSizeConstraintSetRequest(input *CreateSizeConstraintSetInput) (req *request.Request, output *CreateSizeConstraintSetOutput) { - op := &request.Operation{ - Name: opCreateSizeConstraintSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSizeConstraintSetInput{} - } - - output = &CreateSizeConstraintSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSizeConstraintSet API operation for AWS WAF. -// -// Creates a SizeConstraintSet. You then use UpdateSizeConstraintSet to identify -// the part of a web request that you want AWS WAF to check for length, such -// as the length of the User-Agent header or the length of the query string. -// For example, you can create a SizeConstraintSet that matches any requests -// that have a query string that is longer than 100 bytes. You can then configure -// AWS WAF to reject those requests. -// -// To create and configure a SizeConstraintSet, perform the following steps: -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a CreateSizeConstraintSet request. -// -// Submit a CreateSizeConstraintSet request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateSizeConstraintSet request. -// -// Submit an UpdateSizeConstraintSet request to specify the part of the request -// that you want AWS WAF to inspect (for example, the header or the URI) and -// the value that you want AWS WAF to watch for. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation CreateSizeConstraintSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeDisallowedNameException "DisallowedNameException" -// The name specified is invalid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSizeConstraintSet -func (c *WAF) CreateSizeConstraintSet(input *CreateSizeConstraintSetInput) (*CreateSizeConstraintSetOutput, error) { - req, out := c.CreateSizeConstraintSetRequest(input) - err := req.Send() - return out, err -} - -const opCreateSqlInjectionMatchSet = "CreateSqlInjectionMatchSet" - -// CreateSqlInjectionMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateSqlInjectionMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSqlInjectionMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSqlInjectionMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSqlInjectionMatchSetRequest method. -// req, resp := client.CreateSqlInjectionMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSet -func (c *WAF) CreateSqlInjectionMatchSetRequest(input *CreateSqlInjectionMatchSetInput) (req *request.Request, output *CreateSqlInjectionMatchSetOutput) { - op := &request.Operation{ - Name: opCreateSqlInjectionMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSqlInjectionMatchSetInput{} - } - - output = &CreateSqlInjectionMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSqlInjectionMatchSet API operation for AWS WAF. -// -// Creates a SqlInjectionMatchSet, which you use to allow, block, or count requests -// that contain snippets of SQL code in a specified part of web requests. AWS -// WAF searches for character sequences that are likely to be malicious strings. -// -// To create and configure a SqlInjectionMatchSet, perform the following steps: -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a CreateSqlInjectionMatchSet request. -// -// Submit a CreateSqlInjectionMatchSet request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateSqlInjectionMatchSet request. -// -// Submit an UpdateSqlInjectionMatchSet request to specify the parts of web -// requests in which you want to allow, block, or count malicious SQL code. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation CreateSqlInjectionMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDisallowedNameException "DisallowedNameException" -// The name specified is invalid. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSet -func (c *WAF) CreateSqlInjectionMatchSet(input *CreateSqlInjectionMatchSetInput) (*CreateSqlInjectionMatchSetOutput, error) { - req, out := c.CreateSqlInjectionMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opCreateWebACL = "CreateWebACL" - -// CreateWebACLRequest generates a "aws/request.Request" representing the -// client's request for the CreateWebACL operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateWebACL for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateWebACL method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateWebACLRequest method. -// req, resp := client.CreateWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACL -func (c *WAF) CreateWebACLRequest(input *CreateWebACLInput) (req *request.Request, output *CreateWebACLOutput) { - op := &request.Operation{ - Name: opCreateWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateWebACLInput{} - } - - output = &CreateWebACLOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWebACL API operation for AWS WAF. -// -// Creates a WebACL, which contains the Rules that identify the CloudFront web -// requests that you want to allow, block, or count. AWS WAF evaluates Rules -// in order based on the value of Priority for each Rule. -// -// You also specify a default action, either ALLOW or BLOCK. If a web request -// doesn't match any of the Rules in a WebACL, AWS WAF responds to the request -// with the default action. -// -// To create and configure a WebACL, perform the following steps: -// -// Create and update the ByteMatchSet objects and other predicates that you -// want to include in Rules. For more information, see CreateByteMatchSet, UpdateByteMatchSet, -// CreateIPSet, UpdateIPSet, CreateSqlInjectionMatchSet, and UpdateSqlInjectionMatchSet. -// -// Create and update the Rules that you want to include in the WebACL. For more -// information, see CreateRule and UpdateRule. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a CreateWebACL request. -// -// Submit a CreateWebACL request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateWebACL request. -// -// Submit an UpdateWebACL request to specify the Rules that you want to include -// in the WebACL, to specify the default action, and to associate the WebACL -// with a CloudFront distribution. -// -// For more information about how to use the AWS WAF API, see the AWS WAF Developer -// Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation CreateWebACL for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeDisallowedNameException "DisallowedNameException" -// The name specified is invalid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACL -func (c *WAF) CreateWebACL(input *CreateWebACLInput) (*CreateWebACLOutput, error) { - req, out := c.CreateWebACLRequest(input) - err := req.Send() - return out, err -} - -const opCreateXssMatchSet = "CreateXssMatchSet" - -// CreateXssMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateXssMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateXssMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateXssMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateXssMatchSetRequest method. -// req, resp := client.CreateXssMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateXssMatchSet -func (c *WAF) CreateXssMatchSetRequest(input *CreateXssMatchSetInput) (req *request.Request, output *CreateXssMatchSetOutput) { - op := &request.Operation{ - Name: opCreateXssMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateXssMatchSetInput{} - } - - output = &CreateXssMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateXssMatchSet API operation for AWS WAF. -// -// Creates an XssMatchSet, which you use to allow, block, or count requests -// that contain cross-site scripting attacks in the specified part of web requests. -// AWS WAF searches for character sequences that are likely to be malicious -// strings. -// -// To create and configure an XssMatchSet, perform the following steps: -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a CreateXssMatchSet request. -// -// Submit a CreateXssMatchSet request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateXssMatchSet request. -// -// Submit an UpdateXssMatchSet request to specify the parts of web requests -// in which you want to allow, block, or count cross-site scripting attacks. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation CreateXssMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDisallowedNameException "DisallowedNameException" -// The name specified is invalid. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateXssMatchSet -func (c *WAF) CreateXssMatchSet(input *CreateXssMatchSetInput) (*CreateXssMatchSetOutput, error) { - req, out := c.CreateXssMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteByteMatchSet = "DeleteByteMatchSet" - -// DeleteByteMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteByteMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteByteMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteByteMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteByteMatchSetRequest method. -// req, resp := client.DeleteByteMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSet -func (c *WAF) DeleteByteMatchSetRequest(input *DeleteByteMatchSetInput) (req *request.Request, output *DeleteByteMatchSetOutput) { - op := &request.Operation{ - Name: opDeleteByteMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteByteMatchSetInput{} - } - - output = &DeleteByteMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteByteMatchSet API operation for AWS WAF. -// -// Permanently deletes a ByteMatchSet. You can't delete a ByteMatchSet if it's -// still used in any Rules or if it still includes any ByteMatchTuple objects -// (any filters). -// -// If you just want to remove a ByteMatchSet from a Rule, use UpdateRule. -// -// To permanently delete a ByteMatchSet, perform the following steps: -// -// Update the ByteMatchSet to remove filters, if any. For more information, -// see UpdateByteMatchSet. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a DeleteByteMatchSet request. -// -// Submit a DeleteByteMatchSet 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 AWS WAF's -// API operation DeleteByteMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeNonEmptyEntityException "NonEmptyEntityException" -// The operation failed because you tried to delete an object that isn't empty. -// For example: -// -// * You tried to delete a WebACL that still contains one or more Rule objects. -// -// * You tried to delete a Rule that still contains one or more ByteMatchSet -// objects or other predicates. -// -// * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple -// objects. -// -// * You tried to delete an IPSet that references one or more IP addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSet -func (c *WAF) DeleteByteMatchSet(input *DeleteByteMatchSetInput) (*DeleteByteMatchSetOutput, error) { - req, out := c.DeleteByteMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteIPSet = "DeleteIPSet" - -// DeleteIPSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIPSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteIPSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteIPSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteIPSetRequest method. -// req, resp := client.DeleteIPSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSet -func (c *WAF) DeleteIPSetRequest(input *DeleteIPSetInput) (req *request.Request, output *DeleteIPSetOutput) { - op := &request.Operation{ - Name: opDeleteIPSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteIPSetInput{} - } - - output = &DeleteIPSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteIPSet API operation for AWS WAF. -// -// Permanently deletes an IPSet. You can't delete an IPSet if it's still used -// in any Rules or if it still includes any IP addresses. -// -// If you just want to remove an IPSet from a Rule, use UpdateRule. -// -// To permanently delete an IPSet from AWS WAF, perform the following steps: -// -// Update the IPSet to remove IP address ranges, if any. For more information, -// see UpdateIPSet. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a DeleteIPSet request. -// -// Submit a DeleteIPSet 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 AWS WAF's -// API operation DeleteIPSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeNonEmptyEntityException "NonEmptyEntityException" -// The operation failed because you tried to delete an object that isn't empty. -// For example: -// -// * You tried to delete a WebACL that still contains one or more Rule objects. -// -// * You tried to delete a Rule that still contains one or more ByteMatchSet -// objects or other predicates. -// -// * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple -// objects. -// -// * You tried to delete an IPSet that references one or more IP addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSet -func (c *WAF) DeleteIPSet(input *DeleteIPSetInput) (*DeleteIPSetOutput, error) { - req, out := c.DeleteIPSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteRule = "DeleteRule" - -// DeleteRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRuleRequest method. -// req, resp := client.DeleteRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRule -func (c *WAF) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, output *DeleteRuleOutput) { - op := &request.Operation{ - Name: opDeleteRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRuleInput{} - } - - output = &DeleteRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteRule API operation for AWS WAF. -// -// Permanently deletes a Rule. You can't delete a Rule if it's still used in -// any WebACL objects or if it still includes any predicates, such as ByteMatchSet -// objects. -// -// If you just want to remove a Rule from a WebACL, use UpdateWebACL. -// -// To permanently delete a Rule from AWS WAF, perform the following steps: -// -// Update the Rule to remove predicates, if any. For more information, see UpdateRule. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a DeleteRule request. -// -// Submit a DeleteRule 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 AWS WAF's -// API operation DeleteRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeNonEmptyEntityException "NonEmptyEntityException" -// The operation failed because you tried to delete an object that isn't empty. -// For example: -// -// * You tried to delete a WebACL that still contains one or more Rule objects. -// -// * You tried to delete a Rule that still contains one or more ByteMatchSet -// objects or other predicates. -// -// * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple -// objects. -// -// * You tried to delete an IPSet that references one or more IP addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRule -func (c *WAF) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { - req, out := c.DeleteRuleRequest(input) - err := req.Send() - return out, err -} - -const opDeleteSizeConstraintSet = "DeleteSizeConstraintSet" - -// DeleteSizeConstraintSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSizeConstraintSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSizeConstraintSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSizeConstraintSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSizeConstraintSetRequest method. -// req, resp := client.DeleteSizeConstraintSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSizeConstraintSet -func (c *WAF) DeleteSizeConstraintSetRequest(input *DeleteSizeConstraintSetInput) (req *request.Request, output *DeleteSizeConstraintSetOutput) { - op := &request.Operation{ - Name: opDeleteSizeConstraintSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSizeConstraintSetInput{} - } - - output = &DeleteSizeConstraintSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSizeConstraintSet API operation for AWS WAF. -// -// Permanently deletes a SizeConstraintSet. You can't delete a SizeConstraintSet -// if it's still used in any Rules or if it still includes any SizeConstraint -// objects (any filters). -// -// If you just want to remove a SizeConstraintSet from a Rule, use UpdateRule. -// -// To permanently delete a SizeConstraintSet, perform the following steps: -// -// Update the SizeConstraintSet to remove filters, if any. For more information, -// see UpdateSizeConstraintSet. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a DeleteSizeConstraintSet request. -// -// Submit a DeleteSizeConstraintSet 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 AWS WAF's -// API operation DeleteSizeConstraintSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeNonEmptyEntityException "NonEmptyEntityException" -// The operation failed because you tried to delete an object that isn't empty. -// For example: -// -// * You tried to delete a WebACL that still contains one or more Rule objects. -// -// * You tried to delete a Rule that still contains one or more ByteMatchSet -// objects or other predicates. -// -// * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple -// objects. -// -// * You tried to delete an IPSet that references one or more IP addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSizeConstraintSet -func (c *WAF) DeleteSizeConstraintSet(input *DeleteSizeConstraintSetInput) (*DeleteSizeConstraintSetOutput, error) { - req, out := c.DeleteSizeConstraintSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteSqlInjectionMatchSet = "DeleteSqlInjectionMatchSet" - -// DeleteSqlInjectionMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSqlInjectionMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSqlInjectionMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSqlInjectionMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSqlInjectionMatchSetRequest method. -// req, resp := client.DeleteSqlInjectionMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSet -func (c *WAF) DeleteSqlInjectionMatchSetRequest(input *DeleteSqlInjectionMatchSetInput) (req *request.Request, output *DeleteSqlInjectionMatchSetOutput) { - op := &request.Operation{ - Name: opDeleteSqlInjectionMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSqlInjectionMatchSetInput{} - } - - output = &DeleteSqlInjectionMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSqlInjectionMatchSet API operation for AWS WAF. -// -// Permanently deletes a SqlInjectionMatchSet. You can't delete a SqlInjectionMatchSet -// if it's still used in any Rules or if it still contains any SqlInjectionMatchTuple -// objects. -// -// If you just want to remove a SqlInjectionMatchSet from a Rule, use UpdateRule. -// -// To permanently delete a SqlInjectionMatchSet from AWS WAF, perform the following -// steps: -// -// Update the SqlInjectionMatchSet to remove filters, if any. For more information, -// see UpdateSqlInjectionMatchSet. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a DeleteSqlInjectionMatchSet request. -// -// Submit a DeleteSqlInjectionMatchSet 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 AWS WAF's -// API operation DeleteSqlInjectionMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeNonEmptyEntityException "NonEmptyEntityException" -// The operation failed because you tried to delete an object that isn't empty. -// For example: -// -// * You tried to delete a WebACL that still contains one or more Rule objects. -// -// * You tried to delete a Rule that still contains one or more ByteMatchSet -// objects or other predicates. -// -// * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple -// objects. -// -// * You tried to delete an IPSet that references one or more IP addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSet -func (c *WAF) DeleteSqlInjectionMatchSet(input *DeleteSqlInjectionMatchSetInput) (*DeleteSqlInjectionMatchSetOutput, error) { - req, out := c.DeleteSqlInjectionMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opDeleteWebACL = "DeleteWebACL" - -// DeleteWebACLRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWebACL operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteWebACL for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteWebACL method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteWebACLRequest method. -// req, resp := client.DeleteWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACL -func (c *WAF) DeleteWebACLRequest(input *DeleteWebACLInput) (req *request.Request, output *DeleteWebACLOutput) { - op := &request.Operation{ - Name: opDeleteWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteWebACLInput{} - } - - output = &DeleteWebACLOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteWebACL API operation for AWS WAF. -// -// Permanently deletes a WebACL. You can't delete a WebACL if it still contains -// any Rules. -// -// To delete a WebACL, perform the following steps: -// -// Update the WebACL to remove Rules, if any. For more information, see UpdateWebACL. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a DeleteWebACL request. -// -// Submit a DeleteWebACL 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 AWS WAF's -// API operation DeleteWebACL for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeNonEmptyEntityException "NonEmptyEntityException" -// The operation failed because you tried to delete an object that isn't empty. -// For example: -// -// * You tried to delete a WebACL that still contains one or more Rule objects. -// -// * You tried to delete a Rule that still contains one or more ByteMatchSet -// objects or other predicates. -// -// * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple -// objects. -// -// * You tried to delete an IPSet that references one or more IP addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACL -func (c *WAF) DeleteWebACL(input *DeleteWebACLInput) (*DeleteWebACLOutput, error) { - req, out := c.DeleteWebACLRequest(input) - err := req.Send() - return out, err -} - -const opDeleteXssMatchSet = "DeleteXssMatchSet" - -// DeleteXssMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteXssMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteXssMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteXssMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteXssMatchSetRequest method. -// req, resp := client.DeleteXssMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteXssMatchSet -func (c *WAF) DeleteXssMatchSetRequest(input *DeleteXssMatchSetInput) (req *request.Request, output *DeleteXssMatchSetOutput) { - op := &request.Operation{ - Name: opDeleteXssMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteXssMatchSetInput{} - } - - output = &DeleteXssMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteXssMatchSet API operation for AWS WAF. -// -// Permanently deletes an XssMatchSet. You can't delete an XssMatchSet if it's -// still used in any Rules or if it still contains any XssMatchTuple objects. -// -// If you just want to remove an XssMatchSet from a Rule, use UpdateRule. -// -// To permanently delete an XssMatchSet from AWS WAF, perform the following -// steps: -// -// Update the XssMatchSet to remove filters, if any. For more information, see -// UpdateXssMatchSet. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of a DeleteXssMatchSet request. -// -// Submit a DeleteXssMatchSet 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 AWS WAF's -// API operation DeleteXssMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeNonEmptyEntityException "NonEmptyEntityException" -// The operation failed because you tried to delete an object that isn't empty. -// For example: -// -// * You tried to delete a WebACL that still contains one or more Rule objects. -// -// * You tried to delete a Rule that still contains one or more ByteMatchSet -// objects or other predicates. -// -// * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple -// objects. -// -// * You tried to delete an IPSet that references one or more IP addresses. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteXssMatchSet -func (c *WAF) DeleteXssMatchSet(input *DeleteXssMatchSetInput) (*DeleteXssMatchSetOutput, error) { - req, out := c.DeleteXssMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opGetByteMatchSet = "GetByteMatchSet" - -// GetByteMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the GetByteMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetByteMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetByteMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetByteMatchSetRequest method. -// req, resp := client.GetByteMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSet -func (c *WAF) GetByteMatchSetRequest(input *GetByteMatchSetInput) (req *request.Request, output *GetByteMatchSetOutput) { - op := &request.Operation{ - Name: opGetByteMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetByteMatchSetInput{} - } - - output = &GetByteMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetByteMatchSet API operation for AWS WAF. -// -// Returns the ByteMatchSet specified by ByteMatchSetId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation GetByteMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSet -func (c *WAF) GetByteMatchSet(input *GetByteMatchSetInput) (*GetByteMatchSetOutput, error) { - req, out := c.GetByteMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opGetChangeToken = "GetChangeToken" - -// GetChangeTokenRequest generates a "aws/request.Request" representing the -// client's request for the GetChangeToken operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetChangeToken for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetChangeToken method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetChangeTokenRequest method. -// req, resp := client.GetChangeTokenRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeToken -func (c *WAF) GetChangeTokenRequest(input *GetChangeTokenInput) (req *request.Request, output *GetChangeTokenOutput) { - op := &request.Operation{ - Name: opGetChangeToken, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetChangeTokenInput{} - } - - output = &GetChangeTokenOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChangeToken API operation for AWS WAF. -// -// When you want to create, update, or delete AWS WAF objects, get a change -// token and include the change token in the create, update, or delete request. -// Change tokens ensure that your application doesn't submit conflicting requests -// to AWS WAF. -// -// Each create, update, or delete request must use a unique change token. If -// your application submits a GetChangeToken request and then submits a second -// GetChangeToken request before submitting a create, update, or delete request, -// the second GetChangeToken request returns the same value as the first GetChangeToken -// request. -// -// When you use a change token in a create, update, or delete request, the status -// of the change token changes to PENDING, which indicates that AWS WAF is propagating -// the change to all AWS WAF servers. Use GetChangeTokenStatus to determine -// the status of your change token. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation GetChangeToken for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeToken -func (c *WAF) GetChangeToken(input *GetChangeTokenInput) (*GetChangeTokenOutput, error) { - req, out := c.GetChangeTokenRequest(input) - err := req.Send() - return out, err -} - -const opGetChangeTokenStatus = "GetChangeTokenStatus" - -// GetChangeTokenStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetChangeTokenStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetChangeTokenStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetChangeTokenStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetChangeTokenStatusRequest method. -// req, resp := client.GetChangeTokenStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatus -func (c *WAF) GetChangeTokenStatusRequest(input *GetChangeTokenStatusInput) (req *request.Request, output *GetChangeTokenStatusOutput) { - op := &request.Operation{ - Name: opGetChangeTokenStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetChangeTokenStatusInput{} - } - - output = &GetChangeTokenStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChangeTokenStatus API operation for AWS WAF. -// -// Returns the status of a ChangeToken that you got by calling GetChangeToken. -// ChangeTokenStatus is one of the following values: -// -// * PROVISIONED: You requested the change token by calling GetChangeToken, -// but you haven't used it yet in a call to create, update, or delete an -// AWS WAF object. -// -// * PENDING: AWS WAF is propagating the create, update, or delete request -// to all AWS WAF servers. -// -// * IN_SYNC: Propagation 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 AWS WAF's -// API operation GetChangeTokenStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatus -func (c *WAF) GetChangeTokenStatus(input *GetChangeTokenStatusInput) (*GetChangeTokenStatusOutput, error) { - req, out := c.GetChangeTokenStatusRequest(input) - err := req.Send() - return out, err -} - -const opGetIPSet = "GetIPSet" - -// GetIPSetRequest generates a "aws/request.Request" representing the -// client's request for the GetIPSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetIPSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetIPSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetIPSetRequest method. -// req, resp := client.GetIPSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSet -func (c *WAF) GetIPSetRequest(input *GetIPSetInput) (req *request.Request, output *GetIPSetOutput) { - op := &request.Operation{ - Name: opGetIPSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetIPSetInput{} - } - - output = &GetIPSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIPSet API operation for AWS WAF. -// -// Returns the IPSet that is specified by IPSetId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation GetIPSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSet -func (c *WAF) GetIPSet(input *GetIPSetInput) (*GetIPSetOutput, error) { - req, out := c.GetIPSetRequest(input) - err := req.Send() - return out, err -} - -const opGetRule = "GetRule" - -// GetRuleRequest generates a "aws/request.Request" representing the -// client's request for the GetRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRuleRequest method. -// req, resp := client.GetRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRule -func (c *WAF) GetRuleRequest(input *GetRuleInput) (req *request.Request, output *GetRuleOutput) { - op := &request.Operation{ - Name: opGetRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRuleInput{} - } - - output = &GetRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRule API operation for AWS WAF. -// -// Returns the Rule that is specified by the RuleId that you included in the -// GetRule 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 AWS WAF's -// API operation GetRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRule -func (c *WAF) GetRule(input *GetRuleInput) (*GetRuleOutput, error) { - req, out := c.GetRuleRequest(input) - err := req.Send() - return out, err -} - -const opGetSampledRequests = "GetSampledRequests" - -// GetSampledRequestsRequest generates a "aws/request.Request" representing the -// client's request for the GetSampledRequests operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSampledRequests for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSampledRequests method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSampledRequestsRequest method. -// req, resp := client.GetSampledRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSampledRequests -func (c *WAF) GetSampledRequestsRequest(input *GetSampledRequestsInput) (req *request.Request, output *GetSampledRequestsOutput) { - op := &request.Operation{ - Name: opGetSampledRequests, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSampledRequestsInput{} - } - - output = &GetSampledRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSampledRequests API operation for AWS WAF. -// -// Gets detailed information about a specified number of requests--a sample--that -// AWS WAF randomly selects from among the first 5,000 requests that your AWS -// resource received during a time range that you choose. You can specify a -// sample size of up to 500 requests, and you can specify any time range in -// the previous three hours. -// -// GetSampledRequests returns a time range, which is usually the time range -// that you specified. However, if your resource (such as a CloudFront distribution) -// received 5,000 requests before the specified time range elapsed, GetSampledRequests -// returns an updated time range. This new time range indicates the actual period -// during which AWS WAF selected the requests in the sample. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation GetSampledRequests for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSampledRequests -func (c *WAF) GetSampledRequests(input *GetSampledRequestsInput) (*GetSampledRequestsOutput, error) { - req, out := c.GetSampledRequestsRequest(input) - err := req.Send() - return out, err -} - -const opGetSizeConstraintSet = "GetSizeConstraintSet" - -// GetSizeConstraintSetRequest generates a "aws/request.Request" representing the -// client's request for the GetSizeConstraintSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSizeConstraintSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSizeConstraintSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSizeConstraintSetRequest method. -// req, resp := client.GetSizeConstraintSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSet -func (c *WAF) GetSizeConstraintSetRequest(input *GetSizeConstraintSetInput) (req *request.Request, output *GetSizeConstraintSetOutput) { - op := &request.Operation{ - Name: opGetSizeConstraintSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSizeConstraintSetInput{} - } - - output = &GetSizeConstraintSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSizeConstraintSet API operation for AWS WAF. -// -// Returns the SizeConstraintSet specified by SizeConstraintSetId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation GetSizeConstraintSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSet -func (c *WAF) GetSizeConstraintSet(input *GetSizeConstraintSetInput) (*GetSizeConstraintSetOutput, error) { - req, out := c.GetSizeConstraintSetRequest(input) - err := req.Send() - return out, err -} - -const opGetSqlInjectionMatchSet = "GetSqlInjectionMatchSet" - -// GetSqlInjectionMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the GetSqlInjectionMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetSqlInjectionMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSqlInjectionMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetSqlInjectionMatchSetRequest method. -// req, resp := client.GetSqlInjectionMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSet -func (c *WAF) GetSqlInjectionMatchSetRequest(input *GetSqlInjectionMatchSetInput) (req *request.Request, output *GetSqlInjectionMatchSetOutput) { - op := &request.Operation{ - Name: opGetSqlInjectionMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSqlInjectionMatchSetInput{} - } - - output = &GetSqlInjectionMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSqlInjectionMatchSet API operation for AWS WAF. -// -// Returns the SqlInjectionMatchSet that is specified by SqlInjectionMatchSetId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation GetSqlInjectionMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSet -func (c *WAF) GetSqlInjectionMatchSet(input *GetSqlInjectionMatchSetInput) (*GetSqlInjectionMatchSetOutput, error) { - req, out := c.GetSqlInjectionMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opGetWebACL = "GetWebACL" - -// GetWebACLRequest generates a "aws/request.Request" representing the -// client's request for the GetWebACL operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetWebACL for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetWebACL method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetWebACLRequest method. -// req, resp := client.GetWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACL -func (c *WAF) GetWebACLRequest(input *GetWebACLInput) (req *request.Request, output *GetWebACLOutput) { - op := &request.Operation{ - Name: opGetWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetWebACLInput{} - } - - output = &GetWebACLOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWebACL API operation for AWS WAF. -// -// Returns the WebACL that is specified by WebACLId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation GetWebACL for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACL -func (c *WAF) GetWebACL(input *GetWebACLInput) (*GetWebACLOutput, error) { - req, out := c.GetWebACLRequest(input) - err := req.Send() - return out, err -} - -const opGetXssMatchSet = "GetXssMatchSet" - -// GetXssMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the GetXssMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetXssMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetXssMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetXssMatchSetRequest method. -// req, resp := client.GetXssMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSet -func (c *WAF) GetXssMatchSetRequest(input *GetXssMatchSetInput) (req *request.Request, output *GetXssMatchSetOutput) { - op := &request.Operation{ - Name: opGetXssMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetXssMatchSetInput{} - } - - output = &GetXssMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetXssMatchSet API operation for AWS WAF. -// -// Returns the XssMatchSet that is specified by XssMatchSetId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation GetXssMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSet -func (c *WAF) GetXssMatchSet(input *GetXssMatchSetInput) (*GetXssMatchSetOutput, error) { - req, out := c.GetXssMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opListByteMatchSets = "ListByteMatchSets" - -// ListByteMatchSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListByteMatchSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListByteMatchSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListByteMatchSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListByteMatchSetsRequest method. -// req, resp := client.ListByteMatchSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListByteMatchSets -func (c *WAF) ListByteMatchSetsRequest(input *ListByteMatchSetsInput) (req *request.Request, output *ListByteMatchSetsOutput) { - op := &request.Operation{ - Name: opListByteMatchSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListByteMatchSetsInput{} - } - - output = &ListByteMatchSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListByteMatchSets API operation for AWS WAF. -// -// Returns an array of ByteMatchSetSummary 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 AWS WAF's -// API operation ListByteMatchSets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListByteMatchSets -func (c *WAF) ListByteMatchSets(input *ListByteMatchSetsInput) (*ListByteMatchSetsOutput, error) { - req, out := c.ListByteMatchSetsRequest(input) - err := req.Send() - return out, err -} - -const opListIPSets = "ListIPSets" - -// ListIPSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListIPSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListIPSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListIPSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListIPSetsRequest method. -// req, resp := client.ListIPSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListIPSets -func (c *WAF) ListIPSetsRequest(input *ListIPSetsInput) (req *request.Request, output *ListIPSetsOutput) { - op := &request.Operation{ - Name: opListIPSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListIPSetsInput{} - } - - output = &ListIPSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIPSets API operation for AWS WAF. -// -// Returns an array of IPSetSummary objects in 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 AWS WAF's -// API operation ListIPSets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListIPSets -func (c *WAF) ListIPSets(input *ListIPSetsInput) (*ListIPSetsOutput, error) { - req, out := c.ListIPSetsRequest(input) - err := req.Send() - return out, err -} - -const opListRules = "ListRules" - -// ListRulesRequest generates a "aws/request.Request" representing the -// client's request for the ListRules operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListRules for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListRules method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListRulesRequest method. -// req, resp := client.ListRulesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRules -func (c *WAF) ListRulesRequest(input *ListRulesInput) (req *request.Request, output *ListRulesOutput) { - op := &request.Operation{ - Name: opListRules, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListRulesInput{} - } - - output = &ListRulesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRules API operation for AWS WAF. -// -// Returns an array of RuleSummary 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 AWS WAF's -// API operation ListRules for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRules -func (c *WAF) ListRules(input *ListRulesInput) (*ListRulesOutput, error) { - req, out := c.ListRulesRequest(input) - err := req.Send() - return out, err -} - -const opListSizeConstraintSets = "ListSizeConstraintSets" - -// ListSizeConstraintSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListSizeConstraintSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSizeConstraintSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSizeConstraintSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSizeConstraintSetsRequest method. -// req, resp := client.ListSizeConstraintSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSizeConstraintSets -func (c *WAF) ListSizeConstraintSetsRequest(input *ListSizeConstraintSetsInput) (req *request.Request, output *ListSizeConstraintSetsOutput) { - op := &request.Operation{ - Name: opListSizeConstraintSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListSizeConstraintSetsInput{} - } - - output = &ListSizeConstraintSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSizeConstraintSets API operation for AWS WAF. -// -// Returns an array of SizeConstraintSetSummary 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 AWS WAF's -// API operation ListSizeConstraintSets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSizeConstraintSets -func (c *WAF) ListSizeConstraintSets(input *ListSizeConstraintSetsInput) (*ListSizeConstraintSetsOutput, error) { - req, out := c.ListSizeConstraintSetsRequest(input) - err := req.Send() - return out, err -} - -const opListSqlInjectionMatchSets = "ListSqlInjectionMatchSets" - -// ListSqlInjectionMatchSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListSqlInjectionMatchSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListSqlInjectionMatchSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListSqlInjectionMatchSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListSqlInjectionMatchSetsRequest method. -// req, resp := client.ListSqlInjectionMatchSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSqlInjectionMatchSets -func (c *WAF) ListSqlInjectionMatchSetsRequest(input *ListSqlInjectionMatchSetsInput) (req *request.Request, output *ListSqlInjectionMatchSetsOutput) { - op := &request.Operation{ - Name: opListSqlInjectionMatchSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListSqlInjectionMatchSetsInput{} - } - - output = &ListSqlInjectionMatchSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSqlInjectionMatchSets API operation for AWS WAF. -// -// Returns an array of SqlInjectionMatchSet 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 AWS WAF's -// API operation ListSqlInjectionMatchSets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSqlInjectionMatchSets -func (c *WAF) ListSqlInjectionMatchSets(input *ListSqlInjectionMatchSetsInput) (*ListSqlInjectionMatchSetsOutput, error) { - req, out := c.ListSqlInjectionMatchSetsRequest(input) - err := req.Send() - return out, err -} - -const opListWebACLs = "ListWebACLs" - -// ListWebACLsRequest generates a "aws/request.Request" representing the -// client's request for the ListWebACLs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListWebACLs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListWebACLs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListWebACLsRequest method. -// req, resp := client.ListWebACLsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListWebACLs -func (c *WAF) ListWebACLsRequest(input *ListWebACLsInput) (req *request.Request, output *ListWebACLsOutput) { - op := &request.Operation{ - Name: opListWebACLs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListWebACLsInput{} - } - - output = &ListWebACLsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWebACLs API operation for AWS WAF. -// -// Returns an array of WebACLSummary objects in 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 AWS WAF's -// API operation ListWebACLs for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListWebACLs -func (c *WAF) ListWebACLs(input *ListWebACLsInput) (*ListWebACLsOutput, error) { - req, out := c.ListWebACLsRequest(input) - err := req.Send() - return out, err -} - -const opListXssMatchSets = "ListXssMatchSets" - -// ListXssMatchSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListXssMatchSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListXssMatchSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListXssMatchSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListXssMatchSetsRequest method. -// req, resp := client.ListXssMatchSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListXssMatchSets -func (c *WAF) ListXssMatchSetsRequest(input *ListXssMatchSetsInput) (req *request.Request, output *ListXssMatchSetsOutput) { - op := &request.Operation{ - Name: opListXssMatchSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListXssMatchSetsInput{} - } - - output = &ListXssMatchSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListXssMatchSets API operation for AWS WAF. -// -// Returns an array of XssMatchSet 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 AWS WAF's -// API operation ListXssMatchSets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListXssMatchSets -func (c *WAF) ListXssMatchSets(input *ListXssMatchSetsInput) (*ListXssMatchSetsOutput, error) { - req, out := c.ListXssMatchSetsRequest(input) - err := req.Send() - return out, err -} - -const opUpdateByteMatchSet = "UpdateByteMatchSet" - -// UpdateByteMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateByteMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateByteMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateByteMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateByteMatchSetRequest method. -// req, resp := client.UpdateByteMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSet -func (c *WAF) UpdateByteMatchSetRequest(input *UpdateByteMatchSetInput) (req *request.Request, output *UpdateByteMatchSetOutput) { - op := &request.Operation{ - Name: opUpdateByteMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateByteMatchSetInput{} - } - - output = &UpdateByteMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateByteMatchSet API operation for AWS WAF. -// -// Inserts or deletes ByteMatchTuple objects (filters) in a ByteMatchSet. For -// each ByteMatchTuple object, you specify the following values: -// -// * Whether to insert or delete the object from the array. If you want to -// change a ByteMatchSetUpdate object, you delete the existing object and -// add a new one. -// -// * The part of a web request that you want AWS WAF to inspect, such as -// a query string or the value of the User-Agent header. -// -// * The bytes (typically a string that corresponds with ASCII characters) -// that you want AWS WAF to look for. For more information, including how -// you specify the values for the AWS WAF API and the AWS CLI or SDKs, see -// TargetString in the ByteMatchTuple data type. -// -// * Where to look, such as at the beginning or the end of a query string. -// -// * Whether to perform any conversions on the request, such as converting -// it to lowercase, before inspecting it for the specified string. -// -// For example, you can add a ByteMatchSetUpdate object that matches web requests -// in which User-Agent headers contain the string BadBot. You can then configure -// AWS WAF to block those requests. -// -// To create and configure a ByteMatchSet, perform the following steps: -// -// Create a ByteMatchSet. For more information, see CreateByteMatchSet. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateByteMatchSet request. -// -// Submit an UpdateByteMatchSet request to specify the part of the request that -// you want AWS WAF to inspect (for example, the header or the URI) and the -// value that you want AWS WAF to watch for. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation UpdateByteMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The operation failed because there was nothing to do. For example: -// -// * You tried to remove a Rule from a WebACL, but the Rule isn't in the -// specified WebACL. -// -// * You tried to remove an IP address from an IPSet, but the IP address -// isn't in the specified IPSet. -// -// * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple -// isn't in the specified WebACL. -// -// * You tried to add a Rule to a WebACL, but the Rule already exists in -// the specified WebACL. -// -// * You tried to add an IP address to an IPSet, but the IP address already -// exists in the specified IPSet. -// -// * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple -// already exists in the specified WebACL. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeNonexistentContainerException "NonexistentContainerException" -// The operation failed because you tried to add an object to or delete an object -// from another object that doesn't exist. For example: -// -// * You tried to add a Rule to or delete a Rule from a WebACL that doesn't -// exist. -// -// * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule -// that doesn't exist. -// -// * You tried to add an IP address to or delete an IP address from an IPSet -// that doesn't exist. -// -// * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from -// a ByteMatchSet that doesn't exist. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSet -func (c *WAF) UpdateByteMatchSet(input *UpdateByteMatchSetInput) (*UpdateByteMatchSetOutput, error) { - req, out := c.UpdateByteMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opUpdateIPSet = "UpdateIPSet" - -// UpdateIPSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIPSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateIPSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateIPSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateIPSetRequest method. -// req, resp := client.UpdateIPSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSet -func (c *WAF) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Request, output *UpdateIPSetOutput) { - op := &request.Operation{ - Name: opUpdateIPSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateIPSetInput{} - } - - output = &UpdateIPSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIPSet API operation for AWS WAF. -// -// Inserts or deletes IPSetDescriptor objects in an IPSet. For each IPSetDescriptor -// object, you specify the following values: -// -// * Whether to insert or delete the object from the array. If you want to -// change an IPSetDescriptor object, you delete the existing object and add -// a new one. -// -// * The IP address version, IPv4 or IPv6. -// -// * The IP address in CIDR notation, for example, 192.0.2.0/24 (for the -// range of IP addresses from 192.0.2.0 to 192.0.2.255) or 192.0.2.44/32 -// (for the individual IP address 192.0.2.44). -// -// AWS WAF supports /8, /16, /24, and /32 IP address ranges for IPv4, and /24, -// /32, /48, /56, /64 and /128 for IPv6. For more information about CIDR notation, -// see the Wikipedia entry Classless Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). -// -// IPv6 addresses can be represented using any of the following formats: -// -// * 1111:0000:0000:0000:0000:0000:0000:0111/128 -// -// * 1111:0:0:0:0:0:0:0111/128 -// -// * 1111::0111/128 -// -// * 1111::111/128 -// -// You use an IPSet to specify which web requests you want to allow or block -// based on the IP addresses that the requests originated from. For example, -// if you're receiving a lot of requests from one or a small number of IP addresses -// and you want to block the requests, you can create an IPSet that specifies -// those IP addresses, and then configure AWS WAF to block the requests. -// -// To create and configure an IPSet, perform the following steps: -// -// Submit a CreateIPSet request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateIPSet request. -// -// Submit an UpdateIPSet request to specify the IP addresses that you want AWS -// WAF to watch for. -// -// When you update an IPSet, you specify the IP addresses that you want to add -// and/or the IP addresses that you want to delete. If you want to change an -// IP address, you delete the existing IP address and add the new one. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation UpdateIPSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The operation failed because there was nothing to do. For example: -// -// * You tried to remove a Rule from a WebACL, but the Rule isn't in the -// specified WebACL. -// -// * You tried to remove an IP address from an IPSet, but the IP address -// isn't in the specified IPSet. -// -// * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple -// isn't in the specified WebACL. -// -// * You tried to add a Rule to a WebACL, but the Rule already exists in -// the specified WebACL. -// -// * You tried to add an IP address to an IPSet, but the IP address already -// exists in the specified IPSet. -// -// * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple -// already exists in the specified WebACL. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeNonexistentContainerException "NonexistentContainerException" -// The operation failed because you tried to add an object to or delete an object -// from another object that doesn't exist. For example: -// -// * You tried to add a Rule to or delete a Rule from a WebACL that doesn't -// exist. -// -// * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule -// that doesn't exist. -// -// * You tried to add an IP address to or delete an IP address from an IPSet -// that doesn't exist. -// -// * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from -// a ByteMatchSet that doesn't exist. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSet -func (c *WAF) UpdateIPSet(input *UpdateIPSetInput) (*UpdateIPSetOutput, error) { - req, out := c.UpdateIPSetRequest(input) - err := req.Send() - return out, err -} - -const opUpdateRule = "UpdateRule" - -// UpdateRuleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRule operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateRule for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateRule method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateRuleRequest method. -// req, resp := client.UpdateRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRule -func (c *WAF) UpdateRuleRequest(input *UpdateRuleInput) (req *request.Request, output *UpdateRuleOutput) { - op := &request.Operation{ - Name: opUpdateRule, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateRuleInput{} - } - - output = &UpdateRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateRule API operation for AWS WAF. -// -// Inserts or deletes Predicate objects in a Rule. Each Predicate object identifies -// a predicate, such as a ByteMatchSet or an IPSet, that specifies the web requests -// that you want to allow, block, or count. If you add more than one predicate -// to a Rule, a request must match all of the specifications to be allowed, -// blocked, or counted. For example, suppose you add the following to a Rule: -// -// * A ByteMatchSet that matches the value BadBot in the User-Agent header -// -// * An IPSet that matches the IP address 192.0.2.44 -// -// You then add the Rule to a WebACL and specify that you want to block requests -// that satisfy the Rule. For a request to be blocked, the User-Agent header -// in the request must contain the value BadBotand the request must originate -// from the IP address 192.0.2.44. -// -// To create and configure a Rule, perform the following steps: -// -// Create and update the predicates that you want to include in the Rule. -// -// Create the Rule. See CreateRule. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateRule request. -// -// Submit an UpdateRule request to add predicates to the Rule. -// -// Create and update a WebACL that contains the Rule. See CreateWebACL. -// -// If you want to replace one ByteMatchSet or IPSet with another, you delete -// the existing one and add the new one. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation UpdateRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The operation failed because there was nothing to do. For example: -// -// * You tried to remove a Rule from a WebACL, but the Rule isn't in the -// specified WebACL. -// -// * You tried to remove an IP address from an IPSet, but the IP address -// isn't in the specified IPSet. -// -// * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple -// isn't in the specified WebACL. -// -// * You tried to add a Rule to a WebACL, but the Rule already exists in -// the specified WebACL. -// -// * You tried to add an IP address to an IPSet, but the IP address already -// exists in the specified IPSet. -// -// * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple -// already exists in the specified WebACL. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeNonexistentContainerException "NonexistentContainerException" -// The operation failed because you tried to add an object to or delete an object -// from another object that doesn't exist. For example: -// -// * You tried to add a Rule to or delete a Rule from a WebACL that doesn't -// exist. -// -// * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule -// that doesn't exist. -// -// * You tried to add an IP address to or delete an IP address from an IPSet -// that doesn't exist. -// -// * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from -// a ByteMatchSet that doesn't exist. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRule -func (c *WAF) UpdateRule(input *UpdateRuleInput) (*UpdateRuleOutput, error) { - req, out := c.UpdateRuleRequest(input) - err := req.Send() - return out, err -} - -const opUpdateSizeConstraintSet = "UpdateSizeConstraintSet" - -// UpdateSizeConstraintSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSizeConstraintSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateSizeConstraintSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateSizeConstraintSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateSizeConstraintSetRequest method. -// req, resp := client.UpdateSizeConstraintSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSizeConstraintSet -func (c *WAF) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraintSetInput) (req *request.Request, output *UpdateSizeConstraintSetOutput) { - op := &request.Operation{ - Name: opUpdateSizeConstraintSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSizeConstraintSetInput{} - } - - output = &UpdateSizeConstraintSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSizeConstraintSet API operation for AWS WAF. -// -// Inserts or deletes SizeConstraint objects (filters) in a SizeConstraintSet. -// For each SizeConstraint object, you specify the following values: -// -// * Whether to insert or delete the object from the array. If you want to -// change a SizeConstraintSetUpdate object, you delete the existing object -// and add a new one. -// -// * The part of a web request that you want AWS WAF to evaluate, such as -// the length of a query string or the length of the User-Agent header. -// -// * Whether to perform any transformations on the request, such as converting -// it to lowercase, before checking its length. Note that transformations -// of the request body are not supported because the AWS resource forwards -// only the first 8192 bytes of your request to AWS WAF. -// -// * A ComparisonOperator used for evaluating the selected part of the request -// against the specified Size, such as equals, greater than, less than, and -// so on. -// -// * The length, in bytes, that you want AWS WAF to watch for in selected -// part of the request. The length is computed after applying the transformation. -// -// For example, you can add a SizeConstraintSetUpdate object that matches web -// requests in which the length of the User-Agent header is greater than 100 -// bytes. You can then configure AWS WAF to block those requests. -// -// To create and configure a SizeConstraintSet, perform the following steps: -// -// Create a SizeConstraintSet. For more information, see CreateSizeConstraintSet. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateSizeConstraintSet request. -// -// Submit an UpdateSizeConstraintSet request to specify the part of the request -// that you want AWS WAF to inspect (for example, the header or the URI) and -// the value that you want AWS WAF to watch for. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation UpdateSizeConstraintSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The operation failed because there was nothing to do. For example: -// -// * You tried to remove a Rule from a WebACL, but the Rule isn't in the -// specified WebACL. -// -// * You tried to remove an IP address from an IPSet, but the IP address -// isn't in the specified IPSet. -// -// * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple -// isn't in the specified WebACL. -// -// * You tried to add a Rule to a WebACL, but the Rule already exists in -// the specified WebACL. -// -// * You tried to add an IP address to an IPSet, but the IP address already -// exists in the specified IPSet. -// -// * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple -// already exists in the specified WebACL. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeNonexistentContainerException "NonexistentContainerException" -// The operation failed because you tried to add an object to or delete an object -// from another object that doesn't exist. For example: -// -// * You tried to add a Rule to or delete a Rule from a WebACL that doesn't -// exist. -// -// * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule -// that doesn't exist. -// -// * You tried to add an IP address to or delete an IP address from an IPSet -// that doesn't exist. -// -// * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from -// a ByteMatchSet that doesn't exist. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSizeConstraintSet -func (c *WAF) UpdateSizeConstraintSet(input *UpdateSizeConstraintSetInput) (*UpdateSizeConstraintSetOutput, error) { - req, out := c.UpdateSizeConstraintSetRequest(input) - err := req.Send() - return out, err -} - -const opUpdateSqlInjectionMatchSet = "UpdateSqlInjectionMatchSet" - -// UpdateSqlInjectionMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSqlInjectionMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateSqlInjectionMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateSqlInjectionMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateSqlInjectionMatchSetRequest method. -// req, resp := client.UpdateSqlInjectionMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSet -func (c *WAF) UpdateSqlInjectionMatchSetRequest(input *UpdateSqlInjectionMatchSetInput) (req *request.Request, output *UpdateSqlInjectionMatchSetOutput) { - op := &request.Operation{ - Name: opUpdateSqlInjectionMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSqlInjectionMatchSetInput{} - } - - output = &UpdateSqlInjectionMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSqlInjectionMatchSet API operation for AWS WAF. -// -// Inserts or deletes SqlInjectionMatchTuple objects (filters) in a SqlInjectionMatchSet. -// For each SqlInjectionMatchTuple object, you specify the following values: -// -// * Action: Whether to insert the object into or delete the object from -// the array. To change a SqlInjectionMatchTuple, you delete the existing -// object and add a new one. -// -// * FieldToMatch: The part of web requests that you want AWS WAF to inspect -// and, if you want AWS WAF to inspect a header, the name of the header. -// -// * TextTransformation: Which text transformation, if any, to perform on -// the web request before inspecting the request for snippets of malicious -// SQL code. -// -// You use SqlInjectionMatchSet objects to specify which CloudFront requests -// you want to allow, block, or count. For example, if you're receiving requests -// that contain snippets of SQL code in the query string and you want to block -// the requests, you can create a SqlInjectionMatchSet with the applicable settings, -// and then configure AWS WAF to block the requests. -// -// To create and configure a SqlInjectionMatchSet, perform the following steps: -// -// Submit a CreateSqlInjectionMatchSet request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateIPSet request. -// -// Submit an UpdateSqlInjectionMatchSet request to specify the parts of web -// requests that you want AWS WAF to inspect for snippets of SQL code. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation UpdateSqlInjectionMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The operation failed because there was nothing to do. For example: -// -// * You tried to remove a Rule from a WebACL, but the Rule isn't in the -// specified WebACL. -// -// * You tried to remove an IP address from an IPSet, but the IP address -// isn't in the specified IPSet. -// -// * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple -// isn't in the specified WebACL. -// -// * You tried to add a Rule to a WebACL, but the Rule already exists in -// the specified WebACL. -// -// * You tried to add an IP address to an IPSet, but the IP address already -// exists in the specified IPSet. -// -// * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple -// already exists in the specified WebACL. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeNonexistentContainerException "NonexistentContainerException" -// The operation failed because you tried to add an object to or delete an object -// from another object that doesn't exist. For example: -// -// * You tried to add a Rule to or delete a Rule from a WebACL that doesn't -// exist. -// -// * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule -// that doesn't exist. -// -// * You tried to add an IP address to or delete an IP address from an IPSet -// that doesn't exist. -// -// * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from -// a ByteMatchSet that doesn't exist. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSet -func (c *WAF) UpdateSqlInjectionMatchSet(input *UpdateSqlInjectionMatchSetInput) (*UpdateSqlInjectionMatchSetOutput, error) { - req, out := c.UpdateSqlInjectionMatchSetRequest(input) - err := req.Send() - return out, err -} - -const opUpdateWebACL = "UpdateWebACL" - -// UpdateWebACLRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWebACL operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateWebACL for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateWebACL method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateWebACLRequest method. -// req, resp := client.UpdateWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACL -func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Request, output *UpdateWebACLOutput) { - op := &request.Operation{ - Name: opUpdateWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateWebACLInput{} - } - - output = &UpdateWebACLOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateWebACL API operation for AWS WAF. -// -// Inserts or deletes ActivatedRule objects in a WebACL. Each Rule identifies -// web requests that you want to allow, block, or count. When you update a WebACL, -// you specify the following values: -// -// * A default action for the WebACL, either ALLOW or BLOCK. AWS WAF performs -// the default action if a request doesn't match the criteria in any of the -// Rules in a WebACL. -// -// * The Rules that you want to add and/or delete. If you want to replace -// one Rule with another, you delete the existing Rule and add the new one. -// -// * For each Rule, whether you want AWS WAF to allow requests, block requests, -// or count requests that match the conditions in the Rule. -// -// * The order in which you want AWS WAF to evaluate the Rules in a WebACL. -// If you add more than one Rule to a WebACL, AWS WAF evaluates each request -// against the Rules in order based on the value of Priority. (The Rule that -// has the lowest value for Priority is evaluated first.) When a web request -// matches all of the predicates (such as ByteMatchSets and IPSets) in a -// Rule, AWS WAF immediately takes the corresponding action, allow or block, -// and doesn't evaluate the request against the remaining Rules in the WebACL, -// if any. -// -// To create and configure a WebACL, perform the following steps: -// -// Create and update the predicates that you want to include in Rules. For more -// information, see CreateByteMatchSet, UpdateByteMatchSet, CreateIPSet, UpdateIPSet, -// CreateSqlInjectionMatchSet, and UpdateSqlInjectionMatchSet. -// -// Create and update the Rules that you want to include in the WebACL. For more -// information, see CreateRule and UpdateRule. -// -// Create a WebACL. See CreateWebACL. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateWebACL request. -// -// Submit an UpdateWebACL request to specify the Rules that you want to include -// in the WebACL, to specify the default action, and to associate the WebACL -// with a CloudFront distribution. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation UpdateWebACL for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The operation failed because there was nothing to do. For example: -// -// * You tried to remove a Rule from a WebACL, but the Rule isn't in the -// specified WebACL. -// -// * You tried to remove an IP address from an IPSet, but the IP address -// isn't in the specified IPSet. -// -// * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple -// isn't in the specified WebACL. -// -// * You tried to add a Rule to a WebACL, but the Rule already exists in -// the specified WebACL. -// -// * You tried to add an IP address to an IPSet, but the IP address already -// exists in the specified IPSet. -// -// * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple -// already exists in the specified WebACL. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeNonexistentContainerException "NonexistentContainerException" -// The operation failed because you tried to add an object to or delete an object -// from another object that doesn't exist. For example: -// -// * You tried to add a Rule to or delete a Rule from a WebACL that doesn't -// exist. -// -// * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule -// that doesn't exist. -// -// * You tried to add an IP address to or delete an IP address from an IPSet -// that doesn't exist. -// -// * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from -// a ByteMatchSet that doesn't exist. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeReferencedItemException "ReferencedItemException" -// The operation failed because you tried to delete an object that is still -// in use. For example: -// -// * You tried to delete a ByteMatchSet that is still referenced by a Rule. -// -// * You tried to delete a Rule that is still referenced by a WebACL. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACL -func (c *WAF) UpdateWebACL(input *UpdateWebACLInput) (*UpdateWebACLOutput, error) { - req, out := c.UpdateWebACLRequest(input) - err := req.Send() - return out, err -} - -const opUpdateXssMatchSet = "UpdateXssMatchSet" - -// UpdateXssMatchSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateXssMatchSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateXssMatchSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateXssMatchSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateXssMatchSetRequest method. -// req, resp := client.UpdateXssMatchSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateXssMatchSet -func (c *WAF) UpdateXssMatchSetRequest(input *UpdateXssMatchSetInput) (req *request.Request, output *UpdateXssMatchSetOutput) { - op := &request.Operation{ - Name: opUpdateXssMatchSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateXssMatchSetInput{} - } - - output = &UpdateXssMatchSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateXssMatchSet API operation for AWS WAF. -// -// Inserts or deletes XssMatchTuple objects (filters) in an XssMatchSet. For -// each XssMatchTuple object, you specify the following values: -// -// * Action: Whether to insert the object into or delete the object from -// the array. To change a XssMatchTuple, you delete the existing object and -// add a new one. -// -// * FieldToMatch: The part of web requests that you want AWS WAF to inspect -// and, if you want AWS WAF to inspect a header, the name of the header. -// -// * TextTransformation: Which text transformation, if any, to perform on -// the web request before inspecting the request for cross-site scripting -// attacks. -// -// You use XssMatchSet objects to specify which CloudFront requests you want -// to allow, block, or count. For example, if you're receiving requests that -// contain cross-site scripting attacks in the request body and you want to -// block the requests, you can create an XssMatchSet with the applicable settings, -// and then configure AWS WAF to block the requests. -// -// To create and configure an XssMatchSet, perform the following steps: -// -// Submit a CreateXssMatchSet request. -// -// Use GetChangeToken to get the change token that you provide in the ChangeToken -// parameter of an UpdateIPSet request. -// -// Submit an UpdateXssMatchSet request to specify the parts of web requests -// that you want AWS WAF to inspect for cross-site scripting attacks. -// -// For more information about how to use the AWS WAF API to allow or block HTTP -// requests, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime 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 WAF's -// API operation UpdateXssMatchSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" -// The operation failed because of a system problem, even though the request -// was valid. Retry your request. -// -// * ErrCodeInvalidAccountException "InvalidAccountException" -// The operation failed because you tried to create, update, or delete an object -// by using an invalid account identifier. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The operation failed because there was nothing to do. For example: -// -// * You tried to remove a Rule from a WebACL, but the Rule isn't in the -// specified WebACL. -// -// * You tried to remove an IP address from an IPSet, but the IP address -// isn't in the specified IPSet. -// -// * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple -// isn't in the specified WebACL. -// -// * You tried to add a Rule to a WebACL, but the Rule already exists in -// the specified WebACL. -// -// * You tried to add an IP address to an IPSet, but the IP address already -// exists in the specified IPSet. -// -// * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple -// already exists in the specified WebACL. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The operation failed because AWS WAF didn't recognize a parameter in the -// request. For example: -// -// * You specified an invalid parameter name. -// -// * You specified an invalid value. -// -// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) -// using an action other than INSERT or DELETE. -// -// * You tried to create a WebACL with a DefaultActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a WebACL with a WafActionType other than ALLOW, -// BLOCK, or COUNT. -// -// * You tried to update a ByteMatchSet with a FieldToMatchType other than -// HEADER, QUERY_STRING, or URI. -// -// * You tried to update a ByteMatchSet with a Field of HEADER but no value -// for Data. -// -// * Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL cannot be associated. -// -// * ErrCodeNonexistentContainerException "NonexistentContainerException" -// The operation failed because you tried to add an object to or delete an object -// from another object that doesn't exist. For example: -// -// * You tried to add a Rule to or delete a Rule from a WebACL that doesn't -// exist. -// -// * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule -// that doesn't exist. -// -// * You tried to add an IP address to or delete an IP address from an IPSet -// that doesn't exist. -// -// * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from -// a ByteMatchSet that doesn't exist. -// -// * ErrCodeNonexistentItemException "NonexistentItemException" -// The operation failed because the referenced object doesn't exist. -// -// * ErrCodeStaleDataException "StaleDataException" -// The operation failed because you tried to create, update, or delete an object -// by using a change token that has already been used. -// -// * ErrCodeLimitsExceededException "LimitsExceededException" -// The operation exceeds a resource limit, for example, the maximum number of -// WebACL objects that you can create for an AWS account. For more information, -// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the AWS WAF Developer Guide. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateXssMatchSet -func (c *WAF) UpdateXssMatchSet(input *UpdateXssMatchSetInput) (*UpdateXssMatchSetOutput, error) { - req, out := c.UpdateXssMatchSetRequest(input) - err := req.Send() - return out, err -} - -// The ActivatedRule object in an UpdateWebACL request specifies a Rule that -// you want to insert or delete, the priority of the Rule in the WebACL, and -// the action that you want AWS WAF to take when a web request matches the Rule -// (ALLOW, BLOCK, or COUNT). -// -// To specify whether to insert or delete a Rule, use the Action parameter in -// the WebACLUpdate data type. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ActivatedRule -type ActivatedRule struct { - _ struct{} `type:"structure"` - - // Specifies the action that CloudFront or AWS WAF takes when a web request - // matches the conditions in the Rule. Valid values for Action include the following: - // - // * ALLOW: CloudFront responds with the requested object. - // - // * BLOCK: CloudFront responds with an HTTP 403 (Forbidden) status code. - // - // * COUNT: AWS WAF increments a counter of requests that match the conditions - // in the rule and then continues to inspect the web request based on the - // remaining rules in the web ACL. - // - // Action is a required field - Action *WafAction `type:"structure" required:"true"` - - // Specifies the order in which the Rules in a WebACL are evaluated. Rules with - // a lower value for Priority are evaluated before Rules with a higher value. - // The value must be a unique integer. If you add multiple Rules to a WebACL, - // the values don't need to be consecutive. - // - // Priority is a required field - Priority *int64 `type:"integer" required:"true"` - - // The RuleId for a Rule. You use RuleId to get more information about a Rule - // (see GetRule), update a Rule (see UpdateRule), insert a Rule into a WebACL - // or delete a one from a WebACL (see UpdateWebACL), or delete a Rule from AWS - // WAF (see DeleteRule). - // - // RuleId is returned by CreateRule and by ListRules. - // - // RuleId is a required field - RuleId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ActivatedRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActivatedRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActivatedRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActivatedRule"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.Priority == nil { - invalidParams.Add(request.NewErrParamRequired("Priority")) - } - if s.RuleId == nil { - invalidParams.Add(request.NewErrParamRequired("RuleId")) - } - if s.RuleId != nil && len(*s.RuleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleId", 1)) - } - if s.Action != nil { - if err := s.Action.Validate(); err != nil { - invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *ActivatedRule) SetAction(v *WafAction) *ActivatedRule { - s.Action = v - return s -} - -// SetPriority sets the Priority field's value. -func (s *ActivatedRule) SetPriority(v int64) *ActivatedRule { - s.Priority = &v - return s -} - -// SetRuleId sets the RuleId field's value. -func (s *ActivatedRule) SetRuleId(v string) *ActivatedRule { - s.RuleId = &v - return s -} - -// In a GetByteMatchSet request, ByteMatchSet is a complex type that contains -// the ByteMatchSetId and Name of a ByteMatchSet, and the values that you specified -// when you updated the ByteMatchSet. -// -// A complex type that contains ByteMatchTuple objects, which specify the parts -// of web requests that you want AWS WAF to inspect and the values that you -// want AWS WAF to search for. If a ByteMatchSet contains more than one ByteMatchTuple -// object, a request needs to match the settings in only one ByteMatchTuple -// to be considered a match. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ByteMatchSet -type ByteMatchSet struct { - _ struct{} `type:"structure"` - - // The ByteMatchSetId for a ByteMatchSet. You use ByteMatchSetId to get information - // about a ByteMatchSet (see GetByteMatchSet), update a ByteMatchSet (see UpdateByteMatchSet), - // insert a ByteMatchSet into a Rule or delete one from a Rule (see UpdateRule), - // and delete a ByteMatchSet from AWS WAF (see DeleteByteMatchSet). - // - // ByteMatchSetId is returned by CreateByteMatchSet and by ListByteMatchSets. - // - // ByteMatchSetId is a required field - ByteMatchSetId *string `min:"1" type:"string" required:"true"` - - // Specifies the bytes (typically a string that corresponds with ASCII characters) - // that you want AWS WAF to search for in web requests, the location in requests - // that you want AWS WAF to search, and other settings. - // - // ByteMatchTuples is a required field - ByteMatchTuples []*ByteMatchTuple `type:"list" required:"true"` - - // A friendly name or description of the ByteMatchSet. You can't change Name - // after you create a ByteMatchSet. - Name *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ByteMatchSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ByteMatchSet) GoString() string { - return s.String() -} - -// SetByteMatchSetId sets the ByteMatchSetId field's value. -func (s *ByteMatchSet) SetByteMatchSetId(v string) *ByteMatchSet { - s.ByteMatchSetId = &v - return s -} - -// SetByteMatchTuples sets the ByteMatchTuples field's value. -func (s *ByteMatchSet) SetByteMatchTuples(v []*ByteMatchTuple) *ByteMatchSet { - s.ByteMatchTuples = v - return s -} - -// SetName sets the Name field's value. -func (s *ByteMatchSet) SetName(v string) *ByteMatchSet { - s.Name = &v - return s -} - -// Returned by ListByteMatchSets. Each ByteMatchSetSummary object includes the -// Name and ByteMatchSetId for one ByteMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ByteMatchSetSummary -type ByteMatchSetSummary struct { - _ struct{} `type:"structure"` - - // The ByteMatchSetId for a ByteMatchSet. You use ByteMatchSetId to get information - // about a ByteMatchSet, update a ByteMatchSet, remove a ByteMatchSet from a - // Rule, and delete a ByteMatchSet from AWS WAF. - // - // ByteMatchSetId is returned by CreateByteMatchSet and by ListByteMatchSets. - // - // ByteMatchSetId is a required field - ByteMatchSetId *string `min:"1" type:"string" required:"true"` - - // A friendly name or description of the ByteMatchSet. You can't change Name - // after you create a ByteMatchSet. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ByteMatchSetSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ByteMatchSetSummary) GoString() string { - return s.String() -} - -// SetByteMatchSetId sets the ByteMatchSetId field's value. -func (s *ByteMatchSetSummary) SetByteMatchSetId(v string) *ByteMatchSetSummary { - s.ByteMatchSetId = &v - return s -} - -// SetName sets the Name field's value. -func (s *ByteMatchSetSummary) SetName(v string) *ByteMatchSetSummary { - s.Name = &v - return s -} - -// In an UpdateByteMatchSet request, ByteMatchSetUpdate specifies whether to -// insert or delete a ByteMatchTuple and includes the settings for the ByteMatchTuple. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ByteMatchSetUpdate -type ByteMatchSetUpdate struct { - _ struct{} `type:"structure"` - - // Specifies whether to insert or delete a ByteMatchTuple. - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ChangeAction"` - - // Information about the part of a web request that you want AWS WAF to inspect - // and the value that you want AWS WAF to search for. If you specify DELETE - // for the value of Action, the ByteMatchTuple values must exactly match the - // values in the ByteMatchTuple that you want to delete from the ByteMatchSet. - // - // ByteMatchTuple is a required field - ByteMatchTuple *ByteMatchTuple `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ByteMatchSetUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ByteMatchSetUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ByteMatchSetUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ByteMatchSetUpdate"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.ByteMatchTuple == nil { - invalidParams.Add(request.NewErrParamRequired("ByteMatchTuple")) - } - if s.ByteMatchTuple != nil { - if err := s.ByteMatchTuple.Validate(); err != nil { - invalidParams.AddNested("ByteMatchTuple", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *ByteMatchSetUpdate) SetAction(v string) *ByteMatchSetUpdate { - s.Action = &v - return s -} - -// SetByteMatchTuple sets the ByteMatchTuple field's value. -func (s *ByteMatchSetUpdate) SetByteMatchTuple(v *ByteMatchTuple) *ByteMatchSetUpdate { - s.ByteMatchTuple = v - return s -} - -// The bytes (typically a string that corresponds with ASCII characters) that -// you want AWS WAF to search for in web requests, the location in requests -// that you want AWS WAF to search, and other settings. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ByteMatchTuple -type ByteMatchTuple struct { - _ struct{} `type:"structure"` - - // The part of a web request that you want AWS WAF to search, such as a specified - // header or a query string. For more information, see FieldToMatch. - // - // FieldToMatch is a required field - FieldToMatch *FieldToMatch `type:"structure" required:"true"` - - // Within the portion of a web request that you want to search (for example, - // in the query string, if any), specify where you want AWS WAF to search. Valid - // values include the following: - // - // CONTAINS - // - // The specified part of the web request must include the value of TargetString, - // but the location doesn't matter. - // - // CONTAINS_WORD - // - // The specified part of the web request must include the value of TargetString, - // and TargetString must contain only alphanumeric characters or underscore - // (A-Z, a-z, 0-9, or _). In addition, TargetString must be a word, which means - // one of the following: - // - // * TargetString exactly matches the value of the specified part of the - // web request, such as the value of a header. - // - // * TargetString is at the beginning of the specified part of the web request - // and is followed by a character other than an alphanumeric character or - // underscore (_), for example, BadBot;. - // - // * TargetString is at the end of the specified part of the web request - // and is preceded by a character other than an alphanumeric character or - // underscore (_), for example, ;BadBot. - // - // * TargetString is in the middle of the specified part of the web request - // and is preceded and followed by characters other than alphanumeric characters - // or underscore (_), for example, -BadBot;. - // - // EXACTLY - // - // The value of the specified part of the web request must exactly match the - // value of TargetString. - // - // STARTS_WITH - // - // The value of TargetString must appear at the beginning of the specified part - // of the web request. - // - // ENDS_WITH - // - // The value of TargetString must appear at the end of the specified part of - // the web request. - // - // PositionalConstraint is a required field - PositionalConstraint *string `type:"string" required:"true" enum:"PositionalConstraint"` - - // The value that you want AWS WAF to search for. AWS WAF searches for the specified - // string in the part of web requests that you specified in FieldToMatch. The - // maximum length of the value is 50 bytes. - // - // Valid values depend on the values that you specified for FieldToMatch: - // - // * HEADER: The value that you want AWS WAF to search for in the request - // header that you specified in FieldToMatch, for example, the value of the - // User-Agent or Referer header. - // - // * METHOD: The HTTP method, which indicates the type of operation specified - // in the request. CloudFront supports the following methods: DELETE, GET, - // HEAD, OPTIONS, PATCH, POST, and PUT. - // - // * QUERY_STRING: The value that you want AWS WAF to search for in the query - // string, which is the part of a URL that appears after a ? character. - // - // * URI: The value that you want AWS WAF to search for in the part of a - // URL that identifies a resource, for example, /images/daily-ad.jpg. - // - // * BODY: The part of a request that contains any additional data that you - // want to send to your web server as the HTTP request body, such as data - // from a form. The request body immediately follows the request headers. - // Note that only the first 8192 bytes of the request body are forwarded - // to AWS WAF for inspection. To allow or block requests based on the length - // of the body, you can create a size constraint set. For more information, - // see CreateSizeConstraintSet. - // - // If TargetString includes alphabetic characters A-Z and a-z, note that the - // value is case sensitive. - // - // If you're using the AWS WAF API - // - // Specify a base64-encoded version of the value. The maximum length of the - // value before you base64-encode it is 50 bytes. - // - // For example, suppose the value of Type is HEADER and the value of Data is - // User-Agent. If you want to search the User-Agent header for the value BadBot, - // you base64-encode BadBot using MIME base64 encoding and include the resulting - // value, QmFkQm90, in the value of TargetString. - // - // If you're using the AWS CLI or one of the AWS SDKs - // - // The value that you want AWS WAF to search for. The SDK automatically base64 - // encodes the value. - // - // TargetString is automatically base64 encoded/decoded by the SDK. - // - // TargetString is a required field - TargetString []byte `type:"blob" required:"true"` - - // Text transformations eliminate some of the unusual formatting that attackers - // use in web requests in an effort to bypass AWS WAF. If you specify a transformation, - // AWS WAF performs the transformation on TargetString before inspecting a request - // for a match. - // - // CMD_LINE - // - // When you're concerned that attackers are injecting an operating system commandline - // command and using unusual formatting to disguise some or all of the command, - // use this option to perform the following transformations: - // - // * Delete the following characters: \ " ' ^ - // - // * Delete spaces before the following characters: / ( - // - // * Replace the following characters with a space: , ; - // - // * Replace multiple spaces with one space - // - // * Convert uppercase letters (A-Z) to lowercase (a-z) - // - // COMPRESS_WHITE_SPACE - // - // Use this option to replace the following characters with a space character - // (decimal 32): - // - // * \f, formfeed, decimal 12 - // - // * \t, tab, decimal 9 - // - // * \n, newline, decimal 10 - // - // * \r, carriage return, decimal 13 - // - // * \v, vertical tab, decimal 11 - // - // * non-breaking space, decimal 160 - // - // COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. - // - // HTML_ENTITY_DECODE - // - // Use this option to replace HTML-encoded characters with unencoded characters. - // HTML_ENTITY_DECODE performs the following operations: - // - // * Replaces (ampersand)quot; with " - // - // * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 - // - // * Replaces (ampersand)lt; with a "less than" symbol - // - // * Replaces (ampersand)gt; with > - // - // * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, - // with the corresponding characters - // - // * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, - // with the corresponding characters - // - // LOWERCASE - // - // Use this option to convert uppercase letters (A-Z) to lowercase (a-z). - // - // URL_DECODE - // - // Use this option to decode a URL-encoded value. - // - // NONE - // - // Specify NONE if you don't want to perform any text transformations. - // - // TextTransformation is a required field - TextTransformation *string `type:"string" required:"true" enum:"TextTransformation"` -} - -// String returns the string representation -func (s ByteMatchTuple) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ByteMatchTuple) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ByteMatchTuple) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ByteMatchTuple"} - if s.FieldToMatch == nil { - invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) - } - if s.PositionalConstraint == nil { - invalidParams.Add(request.NewErrParamRequired("PositionalConstraint")) - } - if s.TargetString == nil { - invalidParams.Add(request.NewErrParamRequired("TargetString")) - } - if s.TextTransformation == nil { - invalidParams.Add(request.NewErrParamRequired("TextTransformation")) - } - if s.FieldToMatch != nil { - if err := s.FieldToMatch.Validate(); err != nil { - invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldToMatch sets the FieldToMatch field's value. -func (s *ByteMatchTuple) SetFieldToMatch(v *FieldToMatch) *ByteMatchTuple { - s.FieldToMatch = v - return s -} - -// SetPositionalConstraint sets the PositionalConstraint field's value. -func (s *ByteMatchTuple) SetPositionalConstraint(v string) *ByteMatchTuple { - s.PositionalConstraint = &v - return s -} - -// SetTargetString sets the TargetString field's value. -func (s *ByteMatchTuple) SetTargetString(v []byte) *ByteMatchTuple { - s.TargetString = v - return s -} - -// SetTextTransformation sets the TextTransformation field's value. -func (s *ByteMatchTuple) SetTextTransformation(v string) *ByteMatchTuple { - s.TextTransformation = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSetRequest -type CreateByteMatchSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // A friendly name or description of the ByteMatchSet. You can't change Name - // after you create a ByteMatchSet. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateByteMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateByteMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateByteMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateByteMatchSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateByteMatchSetInput) SetChangeToken(v string) *CreateByteMatchSetInput { - s.ChangeToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateByteMatchSetInput) SetName(v string) *CreateByteMatchSetInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSetResponse -type CreateByteMatchSetOutput struct { - _ struct{} `type:"structure"` - - // A ByteMatchSet that contains no ByteMatchTuple objects. - ByteMatchSet *ByteMatchSet `type:"structure"` - - // The ChangeToken that you used to submit the CreateByteMatchSet request. You - // can also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s CreateByteMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateByteMatchSetOutput) GoString() string { - return s.String() -} - -// SetByteMatchSet sets the ByteMatchSet field's value. -func (s *CreateByteMatchSetOutput) SetByteMatchSet(v *ByteMatchSet) *CreateByteMatchSetOutput { - s.ByteMatchSet = v - return s -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateByteMatchSetOutput) SetChangeToken(v string) *CreateByteMatchSetOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSetRequest -type CreateIPSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // A friendly name or description of the IPSet. You can't change Name after - // you create the IPSet. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateIPSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateIPSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateIPSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateIPSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateIPSetInput) SetChangeToken(v string) *CreateIPSetInput { - s.ChangeToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateIPSetInput) SetName(v string) *CreateIPSetInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSetResponse -type CreateIPSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the CreateIPSet request. You can - // also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` - - // The IPSet returned in the CreateIPSet response. - IPSet *IPSet `type:"structure"` -} - -// String returns the string representation -func (s CreateIPSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateIPSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateIPSetOutput) SetChangeToken(v string) *CreateIPSetOutput { - s.ChangeToken = &v - return s -} - -// SetIPSet sets the IPSet field's value. -func (s *CreateIPSetOutput) SetIPSet(v *IPSet) *CreateIPSetOutput { - s.IPSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRuleRequest -type CreateRuleInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // A friendly name or description for the metrics for this Rule. The name can - // contain only alphanumeric characters (A-Z, a-z, 0-9); the name can't contain - // whitespace. You can't change the name of the metric after you create the - // Rule. - // - // MetricName is a required field - MetricName *string `type:"string" required:"true"` - - // A friendly name or description of the Rule. You can't change the name of - // a Rule after you create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRuleInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateRuleInput) SetChangeToken(v string) *CreateRuleInput { - s.ChangeToken = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *CreateRuleInput) SetMetricName(v string) *CreateRuleInput { - s.MetricName = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateRuleInput) SetName(v string) *CreateRuleInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRuleResponse -type CreateRuleOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the CreateRule request. You can also - // use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` - - // The Rule returned in the CreateRule response. - Rule *Rule `type:"structure"` -} - -// String returns the string representation -func (s CreateRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRuleOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateRuleOutput) SetChangeToken(v string) *CreateRuleOutput { - s.ChangeToken = &v - return s -} - -// SetRule sets the Rule field's value. -func (s *CreateRuleOutput) SetRule(v *Rule) *CreateRuleOutput { - s.Rule = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSizeConstraintSetRequest -type CreateSizeConstraintSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // A friendly name or description of the SizeConstraintSet. You can't change - // Name after you create a SizeConstraintSet. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSizeConstraintSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSizeConstraintSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSizeConstraintSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSizeConstraintSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateSizeConstraintSetInput) SetChangeToken(v string) *CreateSizeConstraintSetInput { - s.ChangeToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSizeConstraintSetInput) SetName(v string) *CreateSizeConstraintSetInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSizeConstraintSetResponse -type CreateSizeConstraintSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the CreateSizeConstraintSet request. - // You can also use this value to query the status of the request. For more - // information, see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` - - // A SizeConstraintSet that contains no SizeConstraint objects. - SizeConstraintSet *SizeConstraintSet `type:"structure"` -} - -// String returns the string representation -func (s CreateSizeConstraintSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSizeConstraintSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateSizeConstraintSetOutput) SetChangeToken(v string) *CreateSizeConstraintSetOutput { - s.ChangeToken = &v - return s -} - -// SetSizeConstraintSet sets the SizeConstraintSet field's value. -func (s *CreateSizeConstraintSetOutput) SetSizeConstraintSet(v *SizeConstraintSet) *CreateSizeConstraintSetOutput { - s.SizeConstraintSet = v - return s -} - -// A request to create a SqlInjectionMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSetRequest -type CreateSqlInjectionMatchSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // A friendly name or description for the SqlInjectionMatchSet that you're creating. - // You can't change Name after you create the SqlInjectionMatchSet. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSqlInjectionMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSqlInjectionMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSqlInjectionMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSqlInjectionMatchSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateSqlInjectionMatchSetInput) SetChangeToken(v string) *CreateSqlInjectionMatchSetInput { - s.ChangeToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSqlInjectionMatchSetInput) SetName(v string) *CreateSqlInjectionMatchSetInput { - s.Name = &v - return s -} - -// The response to a CreateSqlInjectionMatchSet request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSetResponse -type CreateSqlInjectionMatchSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the CreateSqlInjectionMatchSet request. - // You can also use this value to query the status of the request. For more - // information, see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` - - // A SqlInjectionMatchSet. - SqlInjectionMatchSet *SqlInjectionMatchSet `type:"structure"` -} - -// String returns the string representation -func (s CreateSqlInjectionMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSqlInjectionMatchSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateSqlInjectionMatchSetOutput) SetChangeToken(v string) *CreateSqlInjectionMatchSetOutput { - s.ChangeToken = &v - return s -} - -// SetSqlInjectionMatchSet sets the SqlInjectionMatchSet field's value. -func (s *CreateSqlInjectionMatchSetOutput) SetSqlInjectionMatchSet(v *SqlInjectionMatchSet) *CreateSqlInjectionMatchSetOutput { - s.SqlInjectionMatchSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACLRequest -type CreateWebACLInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The action that you want AWS WAF to take when a request doesn't match the - // criteria specified in any of the Rule objects that are associated with the - // WebACL. - // - // DefaultAction is a required field - DefaultAction *WafAction `type:"structure" required:"true"` - - // A friendly name or description for the metrics for this WebACL. The name - // can contain only alphanumeric characters (A-Z, a-z, 0-9); the name can't - // contain whitespace. You can't change MetricName after you create the WebACL. - // - // MetricName is a required field - MetricName *string `type:"string" required:"true"` - - // A friendly name or description of the WebACL. You can't change Name after - // you create the WebACL. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateWebACLInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateWebACLInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWebACLInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWebACLInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.DefaultAction == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultAction")) - } - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - 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.DefaultAction != nil { - if err := s.DefaultAction.Validate(); err != nil { - invalidParams.AddNested("DefaultAction", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateWebACLInput) SetChangeToken(v string) *CreateWebACLInput { - s.ChangeToken = &v - return s -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *CreateWebACLInput) SetDefaultAction(v *WafAction) *CreateWebACLInput { - s.DefaultAction = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *CreateWebACLInput) SetMetricName(v string) *CreateWebACLInput { - s.MetricName = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWebACLInput) SetName(v string) *CreateWebACLInput { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACLResponse -type CreateWebACLOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the CreateWebACL request. You can - // also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` - - // The WebACL returned in the CreateWebACL response. - WebACL *WebACL `type:"structure"` -} - -// String returns the string representation -func (s CreateWebACLOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateWebACLOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateWebACLOutput) SetChangeToken(v string) *CreateWebACLOutput { - s.ChangeToken = &v - return s -} - -// SetWebACL sets the WebACL field's value. -func (s *CreateWebACLOutput) SetWebACL(v *WebACL) *CreateWebACLOutput { - s.WebACL = v - return s -} - -// A request to create an XssMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateXssMatchSetRequest -type CreateXssMatchSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // A friendly name or description for the XssMatchSet that you're creating. - // You can't change Name after you create the XssMatchSet. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateXssMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateXssMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateXssMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateXssMatchSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateXssMatchSetInput) SetChangeToken(v string) *CreateXssMatchSetInput { - s.ChangeToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateXssMatchSetInput) SetName(v string) *CreateXssMatchSetInput { - s.Name = &v - return s -} - -// The response to a CreateXssMatchSet request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateXssMatchSetResponse -type CreateXssMatchSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the CreateXssMatchSet request. You - // can also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` - - // An XssMatchSet. - XssMatchSet *XssMatchSet `type:"structure"` -} - -// String returns the string representation -func (s CreateXssMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateXssMatchSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *CreateXssMatchSetOutput) SetChangeToken(v string) *CreateXssMatchSetOutput { - s.ChangeToken = &v - return s -} - -// SetXssMatchSet sets the XssMatchSet field's value. -func (s *CreateXssMatchSetOutput) SetXssMatchSet(v *XssMatchSet) *CreateXssMatchSetOutput { - s.XssMatchSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSetRequest -type DeleteByteMatchSetInput struct { - _ struct{} `type:"structure"` - - // The ByteMatchSetId of the ByteMatchSet that you want to delete. ByteMatchSetId - // is returned by CreateByteMatchSet and by ListByteMatchSets. - // - // ByteMatchSetId is a required field - ByteMatchSetId *string `min:"1" type:"string" required:"true"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteByteMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteByteMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteByteMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteByteMatchSetInput"} - if s.ByteMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ByteMatchSetId")) - } - if s.ByteMatchSetId != nil && len(*s.ByteMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ByteMatchSetId", 1)) - } - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetByteMatchSetId sets the ByteMatchSetId field's value. -func (s *DeleteByteMatchSetInput) SetByteMatchSetId(v string) *DeleteByteMatchSetInput { - s.ByteMatchSetId = &v - return s -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteByteMatchSetInput) SetChangeToken(v string) *DeleteByteMatchSetInput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSetResponse -type DeleteByteMatchSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the DeleteByteMatchSet request. You - // can also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteByteMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteByteMatchSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteByteMatchSetOutput) SetChangeToken(v string) *DeleteByteMatchSetOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSetRequest -type DeleteIPSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The IPSetId of the IPSet that you want to delete. IPSetId is returned by - // CreateIPSet and by ListIPSets. - // - // IPSetId is a required field - IPSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteIPSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIPSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIPSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIPSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.IPSetId == nil { - invalidParams.Add(request.NewErrParamRequired("IPSetId")) - } - if s.IPSetId != nil && len(*s.IPSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IPSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteIPSetInput) SetChangeToken(v string) *DeleteIPSetInput { - s.ChangeToken = &v - return s -} - -// SetIPSetId sets the IPSetId field's value. -func (s *DeleteIPSetInput) SetIPSetId(v string) *DeleteIPSetInput { - s.IPSetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSetResponse -type DeleteIPSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the DeleteIPSet request. You can - // also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteIPSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteIPSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteIPSetOutput) SetChangeToken(v string) *DeleteIPSetOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRuleRequest -type DeleteRuleInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The RuleId of the Rule that you want to delete. RuleId is returned by CreateRule - // and by ListRules. - // - // RuleId is a required field - RuleId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRuleInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.RuleId == nil { - invalidParams.Add(request.NewErrParamRequired("RuleId")) - } - if s.RuleId != nil && len(*s.RuleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteRuleInput) SetChangeToken(v string) *DeleteRuleInput { - s.ChangeToken = &v - return s -} - -// SetRuleId sets the RuleId field's value. -func (s *DeleteRuleInput) SetRuleId(v string) *DeleteRuleInput { - s.RuleId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRuleResponse -type DeleteRuleOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the DeleteRule request. You can also - // use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRuleOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteRuleOutput) SetChangeToken(v string) *DeleteRuleOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSizeConstraintSetRequest -type DeleteSizeConstraintSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The SizeConstraintSetId of the SizeConstraintSet that you want to delete. - // SizeConstraintSetId is returned by CreateSizeConstraintSet and by ListSizeConstraintSets. - // - // SizeConstraintSetId is a required field - SizeConstraintSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSizeConstraintSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSizeConstraintSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSizeConstraintSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSizeConstraintSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.SizeConstraintSetId == nil { - invalidParams.Add(request.NewErrParamRequired("SizeConstraintSetId")) - } - if s.SizeConstraintSetId != nil && len(*s.SizeConstraintSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SizeConstraintSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteSizeConstraintSetInput) SetChangeToken(v string) *DeleteSizeConstraintSetInput { - s.ChangeToken = &v - return s -} - -// SetSizeConstraintSetId sets the SizeConstraintSetId field's value. -func (s *DeleteSizeConstraintSetInput) SetSizeConstraintSetId(v string) *DeleteSizeConstraintSetInput { - s.SizeConstraintSetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSizeConstraintSetResponse -type DeleteSizeConstraintSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the DeleteSizeConstraintSet request. - // You can also use this value to query the status of the request. For more - // information, see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteSizeConstraintSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSizeConstraintSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteSizeConstraintSetOutput) SetChangeToken(v string) *DeleteSizeConstraintSetOutput { - s.ChangeToken = &v - return s -} - -// A request to delete a SqlInjectionMatchSet from AWS WAF. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSetRequest -type DeleteSqlInjectionMatchSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The SqlInjectionMatchSetId of the SqlInjectionMatchSet that you want to delete. - // SqlInjectionMatchSetId is returned by CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets. - // - // SqlInjectionMatchSetId is a required field - SqlInjectionMatchSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSqlInjectionMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSqlInjectionMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSqlInjectionMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSqlInjectionMatchSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.SqlInjectionMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("SqlInjectionMatchSetId")) - } - if s.SqlInjectionMatchSetId != nil && len(*s.SqlInjectionMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SqlInjectionMatchSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteSqlInjectionMatchSetInput) SetChangeToken(v string) *DeleteSqlInjectionMatchSetInput { - s.ChangeToken = &v - return s -} - -// SetSqlInjectionMatchSetId sets the SqlInjectionMatchSetId field's value. -func (s *DeleteSqlInjectionMatchSetInput) SetSqlInjectionMatchSetId(v string) *DeleteSqlInjectionMatchSetInput { - s.SqlInjectionMatchSetId = &v - return s -} - -// The response to a request to delete a SqlInjectionMatchSet from AWS WAF. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSetResponse -type DeleteSqlInjectionMatchSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the DeleteSqlInjectionMatchSet request. - // You can also use this value to query the status of the request. For more - // information, see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteSqlInjectionMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSqlInjectionMatchSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteSqlInjectionMatchSetOutput) SetChangeToken(v string) *DeleteSqlInjectionMatchSetOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACLRequest -type DeleteWebACLInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The WebACLId of the WebACL that you want to delete. WebACLId is returned - // by CreateWebACL and by ListWebACLs. - // - // WebACLId is a required field - WebACLId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteWebACLInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteWebACLInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWebACLInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWebACLInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.WebACLId == nil { - invalidParams.Add(request.NewErrParamRequired("WebACLId")) - } - if s.WebACLId != nil && len(*s.WebACLId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WebACLId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteWebACLInput) SetChangeToken(v string) *DeleteWebACLInput { - s.ChangeToken = &v - return s -} - -// SetWebACLId sets the WebACLId field's value. -func (s *DeleteWebACLInput) SetWebACLId(v string) *DeleteWebACLInput { - s.WebACLId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACLResponse -type DeleteWebACLOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the DeleteWebACL request. You can - // also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteWebACLOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteWebACLOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteWebACLOutput) SetChangeToken(v string) *DeleteWebACLOutput { - s.ChangeToken = &v - return s -} - -// A request to delete an XssMatchSet from AWS WAF. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteXssMatchSetRequest -type DeleteXssMatchSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The XssMatchSetId of the XssMatchSet that you want to delete. XssMatchSetId - // is returned by CreateXssMatchSet and by ListXssMatchSets. - // - // XssMatchSetId is a required field - XssMatchSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteXssMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteXssMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteXssMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteXssMatchSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.XssMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("XssMatchSetId")) - } - if s.XssMatchSetId != nil && len(*s.XssMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("XssMatchSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteXssMatchSetInput) SetChangeToken(v string) *DeleteXssMatchSetInput { - s.ChangeToken = &v - return s -} - -// SetXssMatchSetId sets the XssMatchSetId field's value. -func (s *DeleteXssMatchSetInput) SetXssMatchSetId(v string) *DeleteXssMatchSetInput { - s.XssMatchSetId = &v - return s -} - -// The response to a request to delete an XssMatchSet from AWS WAF. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteXssMatchSetResponse -type DeleteXssMatchSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the DeleteXssMatchSet request. You - // can also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DeleteXssMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteXssMatchSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *DeleteXssMatchSetOutput) SetChangeToken(v string) *DeleteXssMatchSetOutput { - s.ChangeToken = &v - return s -} - -// Specifies where in a web request to look for TargetString. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/FieldToMatch -type FieldToMatch struct { - _ struct{} `type:"structure"` - - // When the value of Type is HEADER, enter the name of the header that you want - // AWS WAF to search, for example, User-Agent or Referer. If the value of Type - // is any other value, omit Data. - // - // The name of the header is not case sensitive. - Data *string `type:"string"` - - // The part of the web request that you want AWS WAF to search for a specified - // string. Parts of a request that you can search include the following: - // - // * HEADER: A specified request header, for example, the value of the User-Agent - // or Referer header. If you choose HEADER for the type, specify the name - // of the header in Data. - // - // * METHOD: The HTTP method, which indicated the type of operation that - // the request is asking the origin to perform. Amazon CloudFront supports - // the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT. - // - // * QUERY_STRING: A query string, which is the part of a URL that appears - // after a ? character, if any. - // - // * URI: The part of a web request that identifies a resource, for example, - // /images/daily-ad.jpg. - // - // * BODY: The part of a request that contains any additional data that you - // want to send to your web server as the HTTP request body, such as data - // from a form. The request body immediately follows the request headers. - // Note that only the first 8192 bytes of the request body are forwarded - // to AWS WAF for inspection. To allow or block requests based on the length - // of the body, you can create a size constraint set. For more information, - // see CreateSizeConstraintSet. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"MatchFieldType"` -} - -// String returns the string representation -func (s FieldToMatch) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FieldToMatch) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FieldToMatch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FieldToMatch"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetData sets the Data field's value. -func (s *FieldToMatch) SetData(v string) *FieldToMatch { - s.Data = &v - return s -} - -// SetType sets the Type field's value. -func (s *FieldToMatch) SetType(v string) *FieldToMatch { - s.Type = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSetRequest -type GetByteMatchSetInput struct { - _ struct{} `type:"structure"` - - // The ByteMatchSetId of the ByteMatchSet that you want to get. ByteMatchSetId - // is returned by CreateByteMatchSet and by ListByteMatchSets. - // - // ByteMatchSetId is a required field - ByteMatchSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetByteMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetByteMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetByteMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetByteMatchSetInput"} - if s.ByteMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ByteMatchSetId")) - } - if s.ByteMatchSetId != nil && len(*s.ByteMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ByteMatchSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetByteMatchSetId sets the ByteMatchSetId field's value. -func (s *GetByteMatchSetInput) SetByteMatchSetId(v string) *GetByteMatchSetInput { - s.ByteMatchSetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSetResponse -type GetByteMatchSetOutput struct { - _ struct{} `type:"structure"` - - // Information about the ByteMatchSet that you specified in the GetByteMatchSet - // request. For more information, see the following topics: - // - // * ByteMatchSet: Contains ByteMatchSetId, ByteMatchTuples, and Name - // - // * ByteMatchTuples: Contains an array of ByteMatchTuple objects. Each ByteMatchTuple - // object contains FieldToMatch, PositionalConstraint, TargetString, and - // TextTransformation - // - // * FieldToMatch: Contains Data and Type - ByteMatchSet *ByteMatchSet `type:"structure"` -} - -// String returns the string representation -func (s GetByteMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetByteMatchSetOutput) GoString() string { - return s.String() -} - -// SetByteMatchSet sets the ByteMatchSet field's value. -func (s *GetByteMatchSetOutput) SetByteMatchSet(v *ByteMatchSet) *GetByteMatchSetOutput { - s.ByteMatchSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenRequest -type GetChangeTokenInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetChangeTokenInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetChangeTokenInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenResponse -type GetChangeTokenOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used in the request. Use this value in a GetChangeTokenStatus - // request to get the current status of the request. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetChangeTokenOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetChangeTokenOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *GetChangeTokenOutput) SetChangeToken(v string) *GetChangeTokenOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatusRequest -type GetChangeTokenStatusInput struct { - _ struct{} `type:"structure"` - - // The change token for which you want to get the status. This change token - // was previously returned in the GetChangeToken response. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetChangeTokenStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetChangeTokenStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChangeTokenStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChangeTokenStatusInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *GetChangeTokenStatusInput) SetChangeToken(v string) *GetChangeTokenStatusInput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatusResponse -type GetChangeTokenStatusOutput struct { - _ struct{} `type:"structure"` - - // The status of the change token. - ChangeTokenStatus *string `type:"string" enum:"ChangeTokenStatus"` -} - -// String returns the string representation -func (s GetChangeTokenStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetChangeTokenStatusOutput) GoString() string { - return s.String() -} - -// SetChangeTokenStatus sets the ChangeTokenStatus field's value. -func (s *GetChangeTokenStatusOutput) SetChangeTokenStatus(v string) *GetChangeTokenStatusOutput { - s.ChangeTokenStatus = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSetRequest -type GetIPSetInput struct { - _ struct{} `type:"structure"` - - // The IPSetId of the IPSet that you want to get. IPSetId is returned by CreateIPSet - // and by ListIPSets. - // - // IPSetId is a required field - IPSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetIPSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIPSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIPSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIPSetInput"} - if s.IPSetId == nil { - invalidParams.Add(request.NewErrParamRequired("IPSetId")) - } - if s.IPSetId != nil && len(*s.IPSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IPSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIPSetId sets the IPSetId field's value. -func (s *GetIPSetInput) SetIPSetId(v string) *GetIPSetInput { - s.IPSetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSetResponse -type GetIPSetOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPSet that you specified in the GetIPSet request. For - // more information, see the following topics: - // - // * IPSet: Contains IPSetDescriptors, IPSetId, and Name - // - // * IPSetDescriptors: Contains an array of IPSetDescriptor objects. Each - // IPSetDescriptor object contains Type and Value - IPSet *IPSet `type:"structure"` -} - -// String returns the string representation -func (s GetIPSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetIPSetOutput) GoString() string { - return s.String() -} - -// SetIPSet sets the IPSet field's value. -func (s *GetIPSetOutput) SetIPSet(v *IPSet) *GetIPSetOutput { - s.IPSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRuleRequest -type GetRuleInput struct { - _ struct{} `type:"structure"` - - // The RuleId of the Rule that you want to get. RuleId is returned by CreateRule - // and by ListRules. - // - // RuleId is a required field - RuleId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRuleInput"} - if s.RuleId == nil { - invalidParams.Add(request.NewErrParamRequired("RuleId")) - } - if s.RuleId != nil && len(*s.RuleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRuleId sets the RuleId field's value. -func (s *GetRuleInput) SetRuleId(v string) *GetRuleInput { - s.RuleId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRuleResponse -type GetRuleOutput struct { - _ struct{} `type:"structure"` - - // Information about the Rule that you specified in the GetRule request. For - // more information, see the following topics: - // - // * Rule: Contains MetricName, Name, an array of Predicate objects, and - // RuleId - // - // * Predicate: Each Predicate object contains DataId, Negated, and Type - Rule *Rule `type:"structure"` -} - -// String returns the string representation -func (s GetRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRuleOutput) GoString() string { - return s.String() -} - -// SetRule sets the Rule field's value. -func (s *GetRuleOutput) SetRule(v *Rule) *GetRuleOutput { - s.Rule = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSampledRequestsRequest -type GetSampledRequestsInput struct { - _ struct{} `type:"structure"` - - // The number of requests that you want AWS WAF to return from among the first - // 5,000 requests that your AWS resource received during the time range. If - // your resource received fewer requests than the value of MaxItems, GetSampledRequests - // returns information about all of them. - // - // MaxItems is a required field - MaxItems *int64 `min:"1" type:"long" required:"true"` - - // RuleId is one of two values: - // - // * The RuleId of the Rule for which you want GetSampledRequests to return - // a sample of requests. - // - // * Default_Action, which causes GetSampledRequests to return a sample of - // the requests that didn't match any of the rules in the specified WebACL. - // - // RuleId is a required field - RuleId *string `min:"1" type:"string" required:"true"` - - // The start date and time and the end date and time of the range for which - // you want GetSampledRequests to return a sample of requests. Specify the date - // and time in the following format: "2016-09-27T14:50Z". You can specify any - // time range in the previous three hours. - // - // TimeWindow is a required field - TimeWindow *TimeWindow `type:"structure" required:"true"` - - // The WebACLId of the WebACL for which you want GetSampledRequests to return - // a sample of requests. - // - // WebAclId is a required field - WebAclId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSampledRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSampledRequestsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSampledRequestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSampledRequestsInput"} - if s.MaxItems == nil { - invalidParams.Add(request.NewErrParamRequired("MaxItems")) - } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - if s.RuleId == nil { - invalidParams.Add(request.NewErrParamRequired("RuleId")) - } - if s.RuleId != nil && len(*s.RuleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleId", 1)) - } - if s.TimeWindow == nil { - invalidParams.Add(request.NewErrParamRequired("TimeWindow")) - } - if s.WebAclId == nil { - invalidParams.Add(request.NewErrParamRequired("WebAclId")) - } - if s.WebAclId != nil && len(*s.WebAclId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WebAclId", 1)) - } - if s.TimeWindow != nil { - if err := s.TimeWindow.Validate(); err != nil { - invalidParams.AddNested("TimeWindow", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxItems sets the MaxItems field's value. -func (s *GetSampledRequestsInput) SetMaxItems(v int64) *GetSampledRequestsInput { - s.MaxItems = &v - return s -} - -// SetRuleId sets the RuleId field's value. -func (s *GetSampledRequestsInput) SetRuleId(v string) *GetSampledRequestsInput { - s.RuleId = &v - return s -} - -// SetTimeWindow sets the TimeWindow field's value. -func (s *GetSampledRequestsInput) SetTimeWindow(v *TimeWindow) *GetSampledRequestsInput { - s.TimeWindow = v - return s -} - -// SetWebAclId sets the WebAclId field's value. -func (s *GetSampledRequestsInput) SetWebAclId(v string) *GetSampledRequestsInput { - s.WebAclId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSampledRequestsResponse -type GetSampledRequestsOutput struct { - _ struct{} `type:"structure"` - - // The total number of requests from which GetSampledRequests got a sample of - // MaxItems requests. If PopulationSize is less than MaxItems, the sample includes - // every request that your AWS resource received during the specified time range. - PopulationSize *int64 `type:"long"` - - // A complex type that contains detailed information about each of the requests - // in the sample. - SampledRequests []*SampledHTTPRequest `type:"list"` - - // Usually, TimeWindow is the time range that you specified in the GetSampledRequests - // request. However, if your AWS resource received more than 5,000 requests - // during the time range that you specified in the request, GetSampledRequests - // returns the time range for the first 5,000 requests. - TimeWindow *TimeWindow `type:"structure"` -} - -// String returns the string representation -func (s GetSampledRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSampledRequestsOutput) GoString() string { - return s.String() -} - -// SetPopulationSize sets the PopulationSize field's value. -func (s *GetSampledRequestsOutput) SetPopulationSize(v int64) *GetSampledRequestsOutput { - s.PopulationSize = &v - return s -} - -// SetSampledRequests sets the SampledRequests field's value. -func (s *GetSampledRequestsOutput) SetSampledRequests(v []*SampledHTTPRequest) *GetSampledRequestsOutput { - s.SampledRequests = v - return s -} - -// SetTimeWindow sets the TimeWindow field's value. -func (s *GetSampledRequestsOutput) SetTimeWindow(v *TimeWindow) *GetSampledRequestsOutput { - s.TimeWindow = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSetRequest -type GetSizeConstraintSetInput struct { - _ struct{} `type:"structure"` - - // The SizeConstraintSetId of the SizeConstraintSet that you want to get. SizeConstraintSetId - // is returned by CreateSizeConstraintSet and by ListSizeConstraintSets. - // - // SizeConstraintSetId is a required field - SizeConstraintSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSizeConstraintSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSizeConstraintSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSizeConstraintSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSizeConstraintSetInput"} - if s.SizeConstraintSetId == nil { - invalidParams.Add(request.NewErrParamRequired("SizeConstraintSetId")) - } - if s.SizeConstraintSetId != nil && len(*s.SizeConstraintSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SizeConstraintSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSizeConstraintSetId sets the SizeConstraintSetId field's value. -func (s *GetSizeConstraintSetInput) SetSizeConstraintSetId(v string) *GetSizeConstraintSetInput { - s.SizeConstraintSetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSetResponse -type GetSizeConstraintSetOutput struct { - _ struct{} `type:"structure"` - - // Information about the SizeConstraintSet that you specified in the GetSizeConstraintSet - // request. For more information, see the following topics: - // - // * SizeConstraintSet: Contains SizeConstraintSetId, SizeConstraints, and - // Name - // - // * SizeConstraints: Contains an array of SizeConstraint objects. Each SizeConstraint - // object contains FieldToMatch, TextTransformation, ComparisonOperator, - // and Size - // - // * FieldToMatch: Contains Data and Type - SizeConstraintSet *SizeConstraintSet `type:"structure"` -} - -// String returns the string representation -func (s GetSizeConstraintSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSizeConstraintSetOutput) GoString() string { - return s.String() -} - -// SetSizeConstraintSet sets the SizeConstraintSet field's value. -func (s *GetSizeConstraintSetOutput) SetSizeConstraintSet(v *SizeConstraintSet) *GetSizeConstraintSetOutput { - s.SizeConstraintSet = v - return s -} - -// A request to get a SqlInjectionMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSetRequest -type GetSqlInjectionMatchSetInput struct { - _ struct{} `type:"structure"` - - // The SqlInjectionMatchSetId of the SqlInjectionMatchSet that you want to get. - // SqlInjectionMatchSetId is returned by CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets. - // - // SqlInjectionMatchSetId is a required field - SqlInjectionMatchSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetSqlInjectionMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSqlInjectionMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSqlInjectionMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSqlInjectionMatchSetInput"} - if s.SqlInjectionMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("SqlInjectionMatchSetId")) - } - if s.SqlInjectionMatchSetId != nil && len(*s.SqlInjectionMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SqlInjectionMatchSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSqlInjectionMatchSetId sets the SqlInjectionMatchSetId field's value. -func (s *GetSqlInjectionMatchSetInput) SetSqlInjectionMatchSetId(v string) *GetSqlInjectionMatchSetInput { - s.SqlInjectionMatchSetId = &v - return s -} - -// The response to a GetSqlInjectionMatchSet request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSetResponse -type GetSqlInjectionMatchSetOutput struct { - _ struct{} `type:"structure"` - - // Information about the SqlInjectionMatchSet that you specified in the GetSqlInjectionMatchSet - // request. For more information, see the following topics: - // - // * SqlInjectionMatchSet: Contains Name, SqlInjectionMatchSetId, and an - // array of SqlInjectionMatchTuple objects - // - // * SqlInjectionMatchTuple: Each SqlInjectionMatchTuple object contains - // FieldToMatch and TextTransformation - // - // * FieldToMatch: Contains Data and Type - SqlInjectionMatchSet *SqlInjectionMatchSet `type:"structure"` -} - -// String returns the string representation -func (s GetSqlInjectionMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSqlInjectionMatchSetOutput) GoString() string { - return s.String() -} - -// SetSqlInjectionMatchSet sets the SqlInjectionMatchSet field's value. -func (s *GetSqlInjectionMatchSetOutput) SetSqlInjectionMatchSet(v *SqlInjectionMatchSet) *GetSqlInjectionMatchSetOutput { - s.SqlInjectionMatchSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACLRequest -type GetWebACLInput struct { - _ struct{} `type:"structure"` - - // The WebACLId of the WebACL that you want to get. WebACLId is returned by - // CreateWebACL and by ListWebACLs. - // - // WebACLId is a required field - WebACLId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetWebACLInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetWebACLInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWebACLInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWebACLInput"} - if s.WebACLId == nil { - invalidParams.Add(request.NewErrParamRequired("WebACLId")) - } - if s.WebACLId != nil && len(*s.WebACLId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WebACLId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWebACLId sets the WebACLId field's value. -func (s *GetWebACLInput) SetWebACLId(v string) *GetWebACLInput { - s.WebACLId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACLResponse -type GetWebACLOutput struct { - _ struct{} `type:"structure"` - - // Information about the WebACL that you specified in the GetWebACL request. - // For more information, see the following topics: - // - // * WebACL: Contains DefaultAction, MetricName, Name, an array of Rule objects, - // and WebACLId - // - // * DefaultAction (Data type is WafAction): Contains Type - // - // * Rules: Contains an array of ActivatedRule objects, which contain Action, - // Priority, and RuleId - // - // * Action: Contains Type - WebACL *WebACL `type:"structure"` -} - -// String returns the string representation -func (s GetWebACLOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetWebACLOutput) GoString() string { - return s.String() -} - -// SetWebACL sets the WebACL field's value. -func (s *GetWebACLOutput) SetWebACL(v *WebACL) *GetWebACLOutput { - s.WebACL = v - return s -} - -// A request to get an XssMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSetRequest -type GetXssMatchSetInput struct { - _ struct{} `type:"structure"` - - // The XssMatchSetId of the XssMatchSet that you want to get. XssMatchSetId - // is returned by CreateXssMatchSet and by ListXssMatchSets. - // - // XssMatchSetId is a required field - XssMatchSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetXssMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetXssMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetXssMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetXssMatchSetInput"} - if s.XssMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("XssMatchSetId")) - } - if s.XssMatchSetId != nil && len(*s.XssMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("XssMatchSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetXssMatchSetId sets the XssMatchSetId field's value. -func (s *GetXssMatchSetInput) SetXssMatchSetId(v string) *GetXssMatchSetInput { - s.XssMatchSetId = &v - return s -} - -// The response to a GetXssMatchSet request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSetResponse -type GetXssMatchSetOutput struct { - _ struct{} `type:"structure"` - - // Information about the XssMatchSet that you specified in the GetXssMatchSet - // request. For more information, see the following topics: - // - // * XssMatchSet: Contains Name, XssMatchSetId, and an array of XssMatchTuple - // objects - // - // * XssMatchTuple: Each XssMatchTuple object contains FieldToMatch and TextTransformation - // - // * FieldToMatch: Contains Data and Type - XssMatchSet *XssMatchSet `type:"structure"` -} - -// String returns the string representation -func (s GetXssMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetXssMatchSetOutput) GoString() string { - return s.String() -} - -// SetXssMatchSet sets the XssMatchSet field's value. -func (s *GetXssMatchSetOutput) SetXssMatchSet(v *XssMatchSet) *GetXssMatchSetOutput { - s.XssMatchSet = v - return s -} - -// The response from a GetSampledRequests request includes an HTTPHeader complex -// type that appears as Headers in the response syntax. HTTPHeader contains -// the names and values of all of the headers that appear in one of the web -// requests that were returned by GetSampledRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/HTTPHeader -type HTTPHeader struct { - _ struct{} `type:"structure"` - - // The name of one of the headers in the sampled web request. - Name *string `type:"string"` - - // The value of one of the headers in the sampled web request. - Value *string `type:"string"` -} - -// String returns the string representation -func (s HTTPHeader) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HTTPHeader) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *HTTPHeader) SetName(v string) *HTTPHeader { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *HTTPHeader) SetValue(v string) *HTTPHeader { - s.Value = &v - return s -} - -// The response from a GetSampledRequests request includes an HTTPRequest complex -// type that appears as Request in the response syntax. HTTPRequest contains -// information about one of the web requests that were returned by GetSampledRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/HTTPRequest -type HTTPRequest struct { - _ struct{} `type:"structure"` - - // The IP address that the request originated from. If the WebACL is associated - // with a CloudFront distribution, this is the value of one of the following - // fields in CloudFront access logs: - // - // * c-ip, if the viewer did not use an HTTP proxy or a load balancer to - // send the request - // - // * x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer - // to send the request - ClientIP *string `type:"string"` - - // The two-letter country code for the country that the request originated from. - // For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2 - // (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). - Country *string `type:"string"` - - // The HTTP version specified in the sampled web request, for example, HTTP/1.1. - HTTPVersion *string `type:"string"` - - // A complex type that contains two values for each header in the sampled web - // request: the name of the header and the value of the header. - Headers []*HTTPHeader `type:"list"` - - // The HTTP method specified in the sampled web request. CloudFront supports - // the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT. - Method *string `type:"string"` - - // The part of a web request that identifies the resource, for example, /images/daily-ad.jpg. - URI *string `type:"string"` -} - -// String returns the string representation -func (s HTTPRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HTTPRequest) GoString() string { - return s.String() -} - -// SetClientIP sets the ClientIP field's value. -func (s *HTTPRequest) SetClientIP(v string) *HTTPRequest { - s.ClientIP = &v - return s -} - -// SetCountry sets the Country field's value. -func (s *HTTPRequest) SetCountry(v string) *HTTPRequest { - s.Country = &v - return s -} - -// SetHTTPVersion sets the HTTPVersion field's value. -func (s *HTTPRequest) SetHTTPVersion(v string) *HTTPRequest { - s.HTTPVersion = &v - return s -} - -// SetHeaders sets the Headers field's value. -func (s *HTTPRequest) SetHeaders(v []*HTTPHeader) *HTTPRequest { - s.Headers = v - return s -} - -// SetMethod sets the Method field's value. -func (s *HTTPRequest) SetMethod(v string) *HTTPRequest { - s.Method = &v - return s -} - -// SetURI sets the URI field's value. -func (s *HTTPRequest) SetURI(v string) *HTTPRequest { - s.URI = &v - return s -} - -// Contains one or more IP addresses or blocks of IP addresses specified in -// Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports /8, /16, -// /24, and /32 IP address ranges for IPv4, and /24, /32, /48, /56, /64 and -// /128 for IPv6. -// -// To specify an individual IP address, you specify the four-part IP address -// followed by a /32, for example, 192.0.2.0/31. To block a range of IP addresses, -// you can specify a /128, /64, /56, /48, /32, /24, /16, or /8 CIDR. For more -// information about CIDR notation, see the Wikipedia entry Classless Inter-Domain -// Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/IPSet -type IPSet struct { - _ struct{} `type:"structure"` - - // The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) - // that web requests originate from. If the WebACL is associated with a CloudFront - // distribution, this is the value of one of the following fields in CloudFront - // access logs: - // - // * c-ip, if the viewer did not use an HTTP proxy or a load balancer to - // send the request - // - // * x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer - // to send the request - // - // IPSetDescriptors is a required field - IPSetDescriptors []*IPSetDescriptor `type:"list" required:"true"` - - // The IPSetId for an IPSet. You use IPSetId to get information about an IPSet - // (see GetIPSet), update an IPSet (see UpdateIPSet), insert an IPSet into a - // Rule or delete one from a Rule (see UpdateRule), and delete an IPSet from - // AWS WAF (see DeleteIPSet). - // - // IPSetId is returned by CreateIPSet and by ListIPSets. - // - // IPSetId is a required field - IPSetId *string `min:"1" type:"string" required:"true"` - - // A friendly name or description of the IPSet. You can't change the name of - // an IPSet after you create it. - Name *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s IPSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IPSet) GoString() string { - return s.String() -} - -// SetIPSetDescriptors sets the IPSetDescriptors field's value. -func (s *IPSet) SetIPSetDescriptors(v []*IPSetDescriptor) *IPSet { - s.IPSetDescriptors = v - return s -} - -// SetIPSetId sets the IPSetId field's value. -func (s *IPSet) SetIPSetId(v string) *IPSet { - s.IPSetId = &v - return s -} - -// SetName sets the Name field's value. -func (s *IPSet) SetName(v string) *IPSet { - s.Name = &v - return s -} - -// Specifies the IP address type (IPV4 or IPV6) and the IP address range (in -// CIDR format) that web requests originate from. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/IPSetDescriptor -type IPSetDescriptor struct { - _ struct{} `type:"structure"` - - // Specify IPV4 or IPV6. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"IPSetDescriptorType"` - - // Specify an IPv4 address by using CIDR notation. For example: - // - // * To configure AWS WAF to allow, block, or count requests that originated - // from the IP address 192.0.2.44, specify 192.0.2.44/32. - // - // * To configure AWS WAF to allow, block, or count requests that originated - // from IP addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24. - // - // For more information about CIDR notation, see the Wikipedia entry Classless - // Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). - // - // Specify an IPv6 address by using CIDR notation. For example: - // - // * To configure AWS WAF to allow, block, or count requests that originated - // from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify 1111:0000:0000:0000:0000:0000:0000:0111/128. - // - // * To configure AWS WAF to allow, block, or count requests that originated - // from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, - // specify 1111:0000:0000:0000:0000:0000:0000:0000/64. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s IPSetDescriptor) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IPSetDescriptor) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IPSetDescriptor) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IPSetDescriptor"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetType sets the Type field's value. -func (s *IPSetDescriptor) SetType(v string) *IPSetDescriptor { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *IPSetDescriptor) SetValue(v string) *IPSetDescriptor { - s.Value = &v - return s -} - -// Contains the identifier and the name of the IPSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/IPSetSummary -type IPSetSummary struct { - _ struct{} `type:"structure"` - - // The IPSetId for an IPSet. You can use IPSetId in a GetIPSet request to get - // detailed information about an IPSet. - // - // IPSetId is a required field - IPSetId *string `min:"1" type:"string" required:"true"` - - // A friendly name or description of the IPSet. You can't change the name of - // an IPSet after you create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s IPSetSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IPSetSummary) GoString() string { - return s.String() -} - -// SetIPSetId sets the IPSetId field's value. -func (s *IPSetSummary) SetIPSetId(v string) *IPSetSummary { - s.IPSetId = &v - return s -} - -// SetName sets the Name field's value. -func (s *IPSetSummary) SetName(v string) *IPSetSummary { - s.Name = &v - return s -} - -// Specifies the type of update to perform to an IPSet with UpdateIPSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/IPSetUpdate -type IPSetUpdate struct { - _ struct{} `type:"structure"` - - // Specifies whether to insert or delete an IP address with UpdateIPSet. - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ChangeAction"` - - // The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) - // that web requests originate from. - // - // IPSetDescriptor is a required field - IPSetDescriptor *IPSetDescriptor `type:"structure" required:"true"` -} - -// String returns the string representation -func (s IPSetUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IPSetUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IPSetUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IPSetUpdate"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.IPSetDescriptor == nil { - invalidParams.Add(request.NewErrParamRequired("IPSetDescriptor")) - } - if s.IPSetDescriptor != nil { - if err := s.IPSetDescriptor.Validate(); err != nil { - invalidParams.AddNested("IPSetDescriptor", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *IPSetUpdate) SetAction(v string) *IPSetUpdate { - s.Action = &v - return s -} - -// SetIPSetDescriptor sets the IPSetDescriptor field's value. -func (s *IPSetUpdate) SetIPSetDescriptor(v *IPSetDescriptor) *IPSetUpdate { - s.IPSetDescriptor = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListByteMatchSetsRequest -type ListByteMatchSetsInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of ByteMatchSet objects that you want AWS WAF to return - // for this request. If you have more ByteMatchSets objects than the number - // you specify for Limit, the response includes a NextMarker value that you - // can use to get another batch of ByteMatchSet objects. - Limit *int64 `type:"integer"` - - // If you specify a value for Limit and you have more ByteMatchSets than the - // value of Limit, AWS WAF returns a NextMarker value in the response that allows - // you to list another group of ByteMatchSets. For the second and subsequent - // ListByteMatchSets requests, specify the value of NextMarker from the previous - // response to get information about another batch of ByteMatchSets. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListByteMatchSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListByteMatchSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListByteMatchSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListByteMatchSetsInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListByteMatchSetsInput) SetLimit(v int64) *ListByteMatchSetsInput { - s.Limit = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListByteMatchSetsInput) SetNextMarker(v string) *ListByteMatchSetsInput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListByteMatchSetsResponse -type ListByteMatchSetsOutput struct { - _ struct{} `type:"structure"` - - // An array of ByteMatchSetSummary objects. - ByteMatchSets []*ByteMatchSetSummary `type:"list"` - - // If you have more ByteMatchSet objects than the number that you specified - // for Limit in the request, the response includes a NextMarker value. To list - // more ByteMatchSet objects, submit another ListByteMatchSets request, and - // specify the NextMarker value from the response in the NextMarker value in - // the next request. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListByteMatchSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListByteMatchSetsOutput) GoString() string { - return s.String() -} - -// SetByteMatchSets sets the ByteMatchSets field's value. -func (s *ListByteMatchSetsOutput) SetByteMatchSets(v []*ByteMatchSetSummary) *ListByteMatchSetsOutput { - s.ByteMatchSets = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListByteMatchSetsOutput) SetNextMarker(v string) *ListByteMatchSetsOutput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListIPSetsRequest -type ListIPSetsInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of IPSet objects that you want AWS WAF to return for - // this request. If you have more IPSet objects than the number you specify - // for Limit, the response includes a NextMarker value that you can use to get - // another batch of IPSet objects. - Limit *int64 `type:"integer"` - - // If you specify a value for Limit and you have more IPSets than the value - // of Limit, AWS WAF returns a NextMarker value in the response that allows - // you to list another group of IPSets. For the second and subsequent ListIPSets - // requests, specify the value of NextMarker from the previous response to get - // information about another batch of ByteMatchSets. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListIPSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListIPSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIPSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIPSetsInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListIPSetsInput) SetLimit(v int64) *ListIPSetsInput { - s.Limit = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListIPSetsInput) SetNextMarker(v string) *ListIPSetsInput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListIPSetsResponse -type ListIPSetsOutput struct { - _ struct{} `type:"structure"` - - // An array of IPSetSummary objects. - IPSets []*IPSetSummary `type:"list"` - - // If you have more IPSet objects than the number that you specified for Limit - // in the request, the response includes a NextMarker value. To list more IPSet - // objects, submit another ListIPSets request, and specify the NextMarker value - // from the response in the NextMarker value in the next request. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListIPSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListIPSetsOutput) GoString() string { - return s.String() -} - -// SetIPSets sets the IPSets field's value. -func (s *ListIPSetsOutput) SetIPSets(v []*IPSetSummary) *ListIPSetsOutput { - s.IPSets = v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListIPSetsOutput) SetNextMarker(v string) *ListIPSetsOutput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRulesRequest -type ListRulesInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of Rules that you want AWS WAF to return for this request. - // If you have more Rules than the number that you specify for Limit, the response - // includes a NextMarker value that you can use to get another batch of Rules. - Limit *int64 `type:"integer"` - - // If you specify a value for Limit and you have more Rules than the value of - // Limit, AWS WAF returns a NextMarker value in the response that allows you - // to list another group of Rules. For the second and subsequent ListRules requests, - // specify the value of NextMarker from the previous response to get information - // about another batch of Rules. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListRulesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRulesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRulesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRulesInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListRulesInput) SetLimit(v int64) *ListRulesInput { - s.Limit = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListRulesInput) SetNextMarker(v string) *ListRulesInput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRulesResponse -type ListRulesOutput struct { - _ struct{} `type:"structure"` - - // If you have more Rules than the number that you specified for Limit in the - // request, the response includes a NextMarker value. To list more Rules, submit - // another ListRules request, and specify the NextMarker value from the response - // in the NextMarker value in the next request. - NextMarker *string `min:"1" type:"string"` - - // An array of RuleSummary objects. - Rules []*RuleSummary `type:"list"` -} - -// String returns the string representation -func (s ListRulesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListRulesOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListRulesOutput) SetNextMarker(v string) *ListRulesOutput { - s.NextMarker = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *ListRulesOutput) SetRules(v []*RuleSummary) *ListRulesOutput { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSizeConstraintSetsRequest -type ListSizeConstraintSetsInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of SizeConstraintSet objects that you want AWS WAF to - // return for this request. If you have more SizeConstraintSets objects than - // the number you specify for Limit, the response includes a NextMarker value - // that you can use to get another batch of SizeConstraintSet objects. - Limit *int64 `type:"integer"` - - // If you specify a value for Limit and you have more SizeConstraintSets than - // the value of Limit, AWS WAF returns a NextMarker value in the response that - // allows you to list another group of SizeConstraintSets. For the second and - // subsequent ListSizeConstraintSets requests, specify the value of NextMarker - // from the previous response to get information about another batch of SizeConstraintSets. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListSizeConstraintSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSizeConstraintSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSizeConstraintSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSizeConstraintSetsInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListSizeConstraintSetsInput) SetLimit(v int64) *ListSizeConstraintSetsInput { - s.Limit = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListSizeConstraintSetsInput) SetNextMarker(v string) *ListSizeConstraintSetsInput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSizeConstraintSetsResponse -type ListSizeConstraintSetsOutput struct { - _ struct{} `type:"structure"` - - // If you have more SizeConstraintSet objects than the number that you specified - // for Limit in the request, the response includes a NextMarker value. To list - // more SizeConstraintSet objects, submit another ListSizeConstraintSets request, - // and specify the NextMarker value from the response in the NextMarker value - // in the next request. - NextMarker *string `min:"1" type:"string"` - - // An array of SizeConstraintSetSummary objects. - SizeConstraintSets []*SizeConstraintSetSummary `type:"list"` -} - -// String returns the string representation -func (s ListSizeConstraintSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSizeConstraintSetsOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListSizeConstraintSetsOutput) SetNextMarker(v string) *ListSizeConstraintSetsOutput { - s.NextMarker = &v - return s -} - -// SetSizeConstraintSets sets the SizeConstraintSets field's value. -func (s *ListSizeConstraintSetsOutput) SetSizeConstraintSets(v []*SizeConstraintSetSummary) *ListSizeConstraintSetsOutput { - s.SizeConstraintSets = v - return s -} - -// A request to list the SqlInjectionMatchSet objects created by the current -// AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSqlInjectionMatchSetsRequest -type ListSqlInjectionMatchSetsInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of SqlInjectionMatchSet objects that you want AWS WAF - // to return for this request. If you have more SqlInjectionMatchSet objects - // than the number you specify for Limit, the response includes a NextMarker - // value that you can use to get another batch of Rules. - Limit *int64 `type:"integer"` - - // If you specify a value for Limit and you have more SqlInjectionMatchSet objects - // than the value of Limit, AWS WAF returns a NextMarker value in the response - // that allows you to list another group of SqlInjectionMatchSets. For the second - // and subsequent ListSqlInjectionMatchSets requests, specify the value of NextMarker - // from the previous response to get information about another batch of SqlInjectionMatchSets. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListSqlInjectionMatchSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSqlInjectionMatchSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSqlInjectionMatchSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSqlInjectionMatchSetsInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListSqlInjectionMatchSetsInput) SetLimit(v int64) *ListSqlInjectionMatchSetsInput { - s.Limit = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListSqlInjectionMatchSetsInput) SetNextMarker(v string) *ListSqlInjectionMatchSetsInput { - s.NextMarker = &v - return s -} - -// The response to a ListSqlInjectionMatchSets request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSqlInjectionMatchSetsResponse -type ListSqlInjectionMatchSetsOutput struct { - _ struct{} `type:"structure"` - - // If you have more SqlInjectionMatchSet objects than the number that you specified - // for Limit in the request, the response includes a NextMarker value. To list - // more SqlInjectionMatchSet objects, submit another ListSqlInjectionMatchSets - // request, and specify the NextMarker value from the response in the NextMarker - // value in the next request. - NextMarker *string `min:"1" type:"string"` - - // An array of SqlInjectionMatchSetSummary objects. - SqlInjectionMatchSets []*SqlInjectionMatchSetSummary `type:"list"` -} - -// String returns the string representation -func (s ListSqlInjectionMatchSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListSqlInjectionMatchSetsOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListSqlInjectionMatchSetsOutput) SetNextMarker(v string) *ListSqlInjectionMatchSetsOutput { - s.NextMarker = &v - return s -} - -// SetSqlInjectionMatchSets sets the SqlInjectionMatchSets field's value. -func (s *ListSqlInjectionMatchSetsOutput) SetSqlInjectionMatchSets(v []*SqlInjectionMatchSetSummary) *ListSqlInjectionMatchSetsOutput { - s.SqlInjectionMatchSets = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListWebACLsRequest -type ListWebACLsInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of WebACL objects that you want AWS WAF to return for - // this request. If you have more WebACL objects than the number that you specify - // for Limit, the response includes a NextMarker value that you can use to get - // another batch of WebACL objects. - Limit *int64 `type:"integer"` - - // If you specify a value for Limit and you have more WebACL objects than the - // number that you specify for Limit, AWS WAF returns a NextMarker value in - // the response that allows you to list another group of WebACL objects. For - // the second and subsequent ListWebACLs requests, specify the value of NextMarker - // from the previous response to get information about another batch of WebACL - // objects. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListWebACLsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListWebACLsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWebACLsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWebACLsInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListWebACLsInput) SetLimit(v int64) *ListWebACLsInput { - s.Limit = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListWebACLsInput) SetNextMarker(v string) *ListWebACLsInput { - s.NextMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListWebACLsResponse -type ListWebACLsOutput struct { - _ struct{} `type:"structure"` - - // If you have more WebACL objects than the number that you specified for Limit - // in the request, the response includes a NextMarker value. To list more WebACL - // objects, submit another ListWebACLs request, and specify the NextMarker value - // from the response in the NextMarker value in the next request. - NextMarker *string `min:"1" type:"string"` - - // An array of WebACLSummary objects. - WebACLs []*WebACLSummary `type:"list"` -} - -// String returns the string representation -func (s ListWebACLsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListWebACLsOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListWebACLsOutput) SetNextMarker(v string) *ListWebACLsOutput { - s.NextMarker = &v - return s -} - -// SetWebACLs sets the WebACLs field's value. -func (s *ListWebACLsOutput) SetWebACLs(v []*WebACLSummary) *ListWebACLsOutput { - s.WebACLs = v - return s -} - -// A request to list the XssMatchSet objects created by the current AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListXssMatchSetsRequest -type ListXssMatchSetsInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of XssMatchSet objects that you want AWS WAF to return - // for this request. If you have more XssMatchSet objects than the number you - // specify for Limit, the response includes a NextMarker value that you can - // use to get another batch of Rules. - Limit *int64 `type:"integer"` - - // If you specify a value for Limit and you have more XssMatchSet objects than - // the value of Limit, AWS WAF returns a NextMarker value in the response that - // allows you to list another group of XssMatchSets. For the second and subsequent - // ListXssMatchSets requests, specify the value of NextMarker from the previous - // response to get information about another batch of XssMatchSets. - NextMarker *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListXssMatchSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListXssMatchSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListXssMatchSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListXssMatchSetsInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *ListXssMatchSetsInput) SetLimit(v int64) *ListXssMatchSetsInput { - s.Limit = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListXssMatchSetsInput) SetNextMarker(v string) *ListXssMatchSetsInput { - s.NextMarker = &v - return s -} - -// The response to a ListXssMatchSets request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListXssMatchSetsResponse -type ListXssMatchSetsOutput struct { - _ struct{} `type:"structure"` - - // If you have more XssMatchSet objects than the number that you specified for - // Limit in the request, the response includes a NextMarker value. To list more - // XssMatchSet objects, submit another ListXssMatchSets request, and specify - // the NextMarker value from the response in the NextMarker value in the next - // request. - NextMarker *string `min:"1" type:"string"` - - // An array of XssMatchSetSummary objects. - XssMatchSets []*XssMatchSetSummary `type:"list"` -} - -// String returns the string representation -func (s ListXssMatchSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListXssMatchSetsOutput) GoString() string { - return s.String() -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListXssMatchSetsOutput) SetNextMarker(v string) *ListXssMatchSetsOutput { - s.NextMarker = &v - return s -} - -// SetXssMatchSets sets the XssMatchSets field's value. -func (s *ListXssMatchSetsOutput) SetXssMatchSets(v []*XssMatchSetSummary) *ListXssMatchSetsOutput { - s.XssMatchSets = v - return s -} - -// Specifies the ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, and -// SizeConstraintSet objects that you want to add to a Rule and, for each object, -// indicates whether you want to negate the settings, for example, requests -// that do NOT originate from the IP address 192.0.2.44. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/Predicate -type Predicate struct { - _ struct{} `type:"structure"` - - // A unique identifier for a predicate in a Rule, such as ByteMatchSetId or - // IPSetId. The ID is returned by the corresponding Create or List command. - // - // DataId is a required field - DataId *string `min:"1" type:"string" required:"true"` - - // Set Negated to False if you want AWS WAF to allow, block, or count requests - // based on the settings in the specified ByteMatchSet, IPSet, SqlInjectionMatchSet, - // XssMatchSet, or SizeConstraintSet. For example, if an IPSet includes the - // IP address 192.0.2.44, AWS WAF will allow or block requests based on that - // IP address. - // - // Set Negated to True if you want AWS WAF to allow or block a request based - // on the negation of the settings in the ByteMatchSet, IPSet, SqlInjectionMatchSet, - // XssMatchSet, or SizeConstraintSet. For example, if an IPSet includes the - // IP address 192.0.2.44, AWS WAF will allow, block, or count requests based - // on all IP addresses except192.0.2.44. - // - // Negated is a required field - Negated *bool `type:"boolean" required:"true"` - - // The type of predicate in a Rule, such as ByteMatchSet or IPSet. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"PredicateType"` -} - -// String returns the string representation -func (s Predicate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Predicate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Predicate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Predicate"} - if s.DataId == nil { - invalidParams.Add(request.NewErrParamRequired("DataId")) - } - if s.DataId != nil && len(*s.DataId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataId", 1)) - } - if s.Negated == nil { - invalidParams.Add(request.NewErrParamRequired("Negated")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataId sets the DataId field's value. -func (s *Predicate) SetDataId(v string) *Predicate { - s.DataId = &v - return s -} - -// SetNegated sets the Negated field's value. -func (s *Predicate) SetNegated(v bool) *Predicate { - s.Negated = &v - return s -} - -// SetType sets the Type field's value. -func (s *Predicate) SetType(v string) *Predicate { - s.Type = &v - return s -} - -// A combination of ByteMatchSet, IPSet, and/or SqlInjectionMatchSet objects -// that identify the web requests that you want to allow, block, or count. For -// example, you might create a Rule that includes the following predicates: -// -// * An IPSet that causes AWS WAF to search for web requests that originate -// from the IP address 192.0.2.44 -// -// * A ByteMatchSet that causes AWS WAF to search for web requests for which -// the value of the User-Agent header is BadBot. -// -// To match the settings in this Rule, a request must originate from 192.0.2.44 -// AND include a User-Agent header for which the value is BadBot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/Rule -type Rule struct { - _ struct{} `type:"structure"` - - // A friendly name or description for the metrics for this Rule. The name can - // contain only alphanumeric characters (A-Z, a-z, 0-9); the name can't contain - // whitespace. You can't change MetricName after you create the Rule. - MetricName *string `type:"string"` - - // The friendly name or description for the Rule. You can't change the name - // of a Rule after you create it. - Name *string `min:"1" type:"string"` - - // The Predicates object contains one Predicate element for each ByteMatchSet, - // IPSet, or SqlInjectionMatchSet object that you want to include in a Rule. - // - // Predicates is a required field - Predicates []*Predicate `type:"list" required:"true"` - - // A unique identifier for a Rule. You use RuleId to get more information about - // a Rule (see GetRule), update a Rule (see UpdateRule), insert a Rule into - // a WebACL or delete a one from a WebACL (see UpdateWebACL), or delete a Rule - // from AWS WAF (see DeleteRule). - // - // RuleId is returned by CreateRule and by ListRules. - // - // RuleId is a required field - RuleId *string `min:"1" type:"string" required:"true"` -} - -// 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() -} - -// SetMetricName sets the MetricName field's value. -func (s *Rule) SetMetricName(v string) *Rule { - s.MetricName = &v - return s -} - -// SetName sets the Name field's value. -func (s *Rule) SetName(v string) *Rule { - s.Name = &v - return s -} - -// SetPredicates sets the Predicates field's value. -func (s *Rule) SetPredicates(v []*Predicate) *Rule { - s.Predicates = v - return s -} - -// SetRuleId sets the RuleId field's value. -func (s *Rule) SetRuleId(v string) *Rule { - s.RuleId = &v - return s -} - -// Contains the identifier and the friendly name or description of the Rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/RuleSummary -type RuleSummary struct { - _ struct{} `type:"structure"` - - // A friendly name or description of the Rule. You can't change the name of - // a Rule after you create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A unique identifier for a Rule. You use RuleId to get more information about - // a Rule (see GetRule), update a Rule (see UpdateRule), insert a Rule into - // a WebACL or delete one from a WebACL (see UpdateWebACL), or delete a Rule - // from AWS WAF (see DeleteRule). - // - // RuleId is returned by CreateRule and by ListRules. - // - // RuleId is a required field - RuleId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s RuleSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RuleSummary) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *RuleSummary) SetName(v string) *RuleSummary { - s.Name = &v - return s -} - -// SetRuleId sets the RuleId field's value. -func (s *RuleSummary) SetRuleId(v string) *RuleSummary { - s.RuleId = &v - return s -} - -// Specifies a Predicate (such as an IPSet) and indicates whether you want to -// add it to a Rule or delete it from a Rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/RuleUpdate -type RuleUpdate struct { - _ struct{} `type:"structure"` - - // Specify INSERT to add a Predicate to a Rule. Use DELETE to remove a Predicate - // from a Rule. - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ChangeAction"` - - // The ID of the Predicate (such as an IPSet) that you want to add to a Rule. - // - // Predicate is a required field - Predicate *Predicate `type:"structure" required:"true"` -} - -// String returns the string representation -func (s RuleUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RuleUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RuleUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RuleUpdate"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.Predicate == nil { - invalidParams.Add(request.NewErrParamRequired("Predicate")) - } - if s.Predicate != nil { - if err := s.Predicate.Validate(); err != nil { - invalidParams.AddNested("Predicate", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *RuleUpdate) SetAction(v string) *RuleUpdate { - s.Action = &v - return s -} - -// SetPredicate sets the Predicate field's value. -func (s *RuleUpdate) SetPredicate(v *Predicate) *RuleUpdate { - s.Predicate = v - return s -} - -// The response from a GetSampledRequests request includes a SampledHTTPRequests -// complex type that appears as SampledRequests in the response syntax. SampledHTTPRequests -// contains one SampledHTTPRequest object for each web request that is returned -// by GetSampledRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SampledHTTPRequest -type SampledHTTPRequest struct { - _ struct{} `type:"structure"` - - // The action for the Rule that the request matched: ALLOW, BLOCK, or COUNT. - Action *string `type:"string"` - - // A complex type that contains detailed information about the request. - // - // Request is a required field - Request *HTTPRequest `type:"structure" required:"true"` - - // The time at which AWS WAF received the request from your AWS resource, in - // Unix time format (in seconds). - Timestamp *time.Time `type:"timestamp" timestampFormat:"unix"` - - // A value that indicates how one result in the response relates proportionally - // to other results in the response. A result that has a weight of 2 represents - // roughly twice as many CloudFront web requests as a result that has a weight - // of 1. - // - // Weight is a required field - Weight *int64 `type:"long" required:"true"` -} - -// String returns the string representation -func (s SampledHTTPRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SampledHTTPRequest) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *SampledHTTPRequest) SetAction(v string) *SampledHTTPRequest { - s.Action = &v - return s -} - -// SetRequest sets the Request field's value. -func (s *SampledHTTPRequest) SetRequest(v *HTTPRequest) *SampledHTTPRequest { - s.Request = v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *SampledHTTPRequest) SetTimestamp(v time.Time) *SampledHTTPRequest { - s.Timestamp = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *SampledHTTPRequest) SetWeight(v int64) *SampledHTTPRequest { - s.Weight = &v - return s -} - -// Specifies a constraint on the size of a part of the web request. AWS WAF -// uses the Size, ComparisonOperator, and FieldToMatch to build an expression -// in the form of "SizeComparisonOperator size in bytes of FieldToMatch". If -// that expression is true, the SizeConstraint is considered to match. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SizeConstraint -type SizeConstraint struct { - _ struct{} `type:"structure"` - - // The type of comparison you want AWS WAF to perform. AWS WAF uses this in - // combination with the provided Size and FieldToMatch to build an expression - // in the form of "SizeComparisonOperator size in bytes of FieldToMatch". If - // that expression is true, the SizeConstraint is considered to match. - // - // EQ: Used to test if the Size is equal to the size of the FieldToMatch - // - // NE: Used to test if the Size is not equal to the size of the FieldToMatch - // - // LE: Used to test if the Size is less than or equal to the size of the FieldToMatch - // - // LT: Used to test if the Size is strictly less than the size of the FieldToMatch - // - // GE: Used to test if the Size is greater than or equal to the size of the - // FieldToMatch - // - // GT: Used to test if the Size is strictly greater than the size of the FieldToMatch - // - // ComparisonOperator is a required field - ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` - - // Specifies where in a web request to look for the size constraint. - // - // FieldToMatch is a required field - FieldToMatch *FieldToMatch `type:"structure" required:"true"` - - // The size in bytes that you want AWS WAF to compare against the size of the - // specified FieldToMatch. AWS WAF uses this in combination with ComparisonOperator - // and FieldToMatch to build an expression in the form of "SizeComparisonOperator - // size in bytes of FieldToMatch". If that expression is true, the SizeConstraint - // is considered to match. - // - // Valid values for size are 0 - 21474836480 bytes (0 - 20 GB). - // - // If you specify URI for the value of Type, the / in the URI counts as one - // character. For example, the URI /logo.jpg is nine characters long. - // - // Size is a required field - Size *int64 `type:"long" required:"true"` - - // Text transformations eliminate some of the unusual formatting that attackers - // use in web requests in an effort to bypass AWS WAF. If you specify a transformation, - // AWS WAF performs the transformation on FieldToMatch before inspecting a request - // for a match. - // - // Note that if you choose BODY for the value of Type, you must choose NONE - // for TextTransformation because CloudFront forwards only the first 8192 bytes - // for inspection. - // - // NONE - // - // Specify NONE if you don't want to perform any text transformations. - // - // CMD_LINE - // - // When you're concerned that attackers are injecting an operating system command - // line command and using unusual formatting to disguise some or all of the - // command, use this option to perform the following transformations: - // - // * Delete the following characters: \ " ' ^ - // - // * Delete spaces before the following characters: / ( - // - // * Replace the following characters with a space: , ; - // - // * Replace multiple spaces with one space - // - // * Convert uppercase letters (A-Z) to lowercase (a-z) - // - // COMPRESS_WHITE_SPACE - // - // Use this option to replace the following characters with a space character - // (decimal 32): - // - // * \f, formfeed, decimal 12 - // - // * \t, tab, decimal 9 - // - // * \n, newline, decimal 10 - // - // * \r, carriage return, decimal 13 - // - // * \v, vertical tab, decimal 11 - // - // * non-breaking space, decimal 160 - // - // COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. - // - // HTML_ENTITY_DECODE - // - // Use this option to replace HTML-encoded characters with unencoded characters. - // HTML_ENTITY_DECODE performs the following operations: - // - // * Replaces (ampersand)quot; with " - // - // * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 - // - // * Replaces (ampersand)lt; with a "less than" symbol - // - // * Replaces (ampersand)gt; with > - // - // * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, - // with the corresponding characters - // - // * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, - // with the corresponding characters - // - // LOWERCASE - // - // Use this option to convert uppercase letters (A-Z) to lowercase (a-z). - // - // URL_DECODE - // - // Use this option to decode a URL-encoded value. - // - // TextTransformation is a required field - TextTransformation *string `type:"string" required:"true" enum:"TextTransformation"` -} - -// String returns the string representation -func (s SizeConstraint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SizeConstraint) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SizeConstraint) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SizeConstraint"} - if s.ComparisonOperator == nil { - invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) - } - if s.FieldToMatch == nil { - invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) - } - if s.Size == nil { - invalidParams.Add(request.NewErrParamRequired("Size")) - } - if s.TextTransformation == nil { - invalidParams.Add(request.NewErrParamRequired("TextTransformation")) - } - if s.FieldToMatch != nil { - if err := s.FieldToMatch.Validate(); err != nil { - invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *SizeConstraint) SetComparisonOperator(v string) *SizeConstraint { - s.ComparisonOperator = &v - return s -} - -// SetFieldToMatch sets the FieldToMatch field's value. -func (s *SizeConstraint) SetFieldToMatch(v *FieldToMatch) *SizeConstraint { - s.FieldToMatch = v - return s -} - -// SetSize sets the Size field's value. -func (s *SizeConstraint) SetSize(v int64) *SizeConstraint { - s.Size = &v - return s -} - -// SetTextTransformation sets the TextTransformation field's value. -func (s *SizeConstraint) SetTextTransformation(v string) *SizeConstraint { - s.TextTransformation = &v - return s -} - -// A complex type that contains SizeConstraint objects, which specify the parts -// of web requests that you want AWS WAF to inspect the size of. If a SizeConstraintSet -// contains more than one SizeConstraint object, a request only needs to match -// one constraint to be considered a match. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SizeConstraintSet -type SizeConstraintSet struct { - _ struct{} `type:"structure"` - - // The name, if any, of the SizeConstraintSet. - Name *string `min:"1" type:"string"` - - // A unique identifier for a SizeConstraintSet. You use SizeConstraintSetId - // to get information about a SizeConstraintSet (see GetSizeConstraintSet), - // update a SizeConstraintSet (see UpdateSizeConstraintSet), insert a SizeConstraintSet - // into a Rule or delete one from a Rule (see UpdateRule), and delete a SizeConstraintSet - // from AWS WAF (see DeleteSizeConstraintSet). - // - // SizeConstraintSetId is returned by CreateSizeConstraintSet and by ListSizeConstraintSets. - // - // SizeConstraintSetId is a required field - SizeConstraintSetId *string `min:"1" type:"string" required:"true"` - - // Specifies the parts of web requests that you want to inspect the size of. - // - // SizeConstraints is a required field - SizeConstraints []*SizeConstraint `type:"list" required:"true"` -} - -// String returns the string representation -func (s SizeConstraintSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SizeConstraintSet) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *SizeConstraintSet) SetName(v string) *SizeConstraintSet { - s.Name = &v - return s -} - -// SetSizeConstraintSetId sets the SizeConstraintSetId field's value. -func (s *SizeConstraintSet) SetSizeConstraintSetId(v string) *SizeConstraintSet { - s.SizeConstraintSetId = &v - return s -} - -// SetSizeConstraints sets the SizeConstraints field's value. -func (s *SizeConstraintSet) SetSizeConstraints(v []*SizeConstraint) *SizeConstraintSet { - s.SizeConstraints = v - return s -} - -// The Id and Name of a SizeConstraintSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SizeConstraintSetSummary -type SizeConstraintSetSummary struct { - _ struct{} `type:"structure"` - - // The name of the SizeConstraintSet, if any. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A unique identifier for a SizeConstraintSet. You use SizeConstraintSetId - // to get information about a SizeConstraintSet (see GetSizeConstraintSet), - // update a SizeConstraintSet (see UpdateSizeConstraintSet), insert a SizeConstraintSet - // into a Rule or delete one from a Rule (see UpdateRule), and delete a SizeConstraintSet - // from AWS WAF (see DeleteSizeConstraintSet). - // - // SizeConstraintSetId is returned by CreateSizeConstraintSet and by ListSizeConstraintSets. - // - // SizeConstraintSetId is a required field - SizeConstraintSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SizeConstraintSetSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SizeConstraintSetSummary) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *SizeConstraintSetSummary) SetName(v string) *SizeConstraintSetSummary { - s.Name = &v - return s -} - -// SetSizeConstraintSetId sets the SizeConstraintSetId field's value. -func (s *SizeConstraintSetSummary) SetSizeConstraintSetId(v string) *SizeConstraintSetSummary { - s.SizeConstraintSetId = &v - return s -} - -// Specifies the part of a web request that you want to inspect the size of -// and indicates whether you want to add the specification to a SizeConstraintSet -// or delete it from a SizeConstraintSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SizeConstraintSetUpdate -type SizeConstraintSetUpdate struct { - _ struct{} `type:"structure"` - - // Specify INSERT to add a SizeConstraintSetUpdate to a SizeConstraintSet. Use - // DELETE to remove a SizeConstraintSetUpdate from a SizeConstraintSet. - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ChangeAction"` - - // Specifies a constraint on the size of a part of the web request. AWS WAF - // uses the Size, ComparisonOperator, and FieldToMatch to build an expression - // in the form of "SizeComparisonOperator size in bytes of FieldToMatch". If - // that expression is true, the SizeConstraint is considered to match. - // - // SizeConstraint is a required field - SizeConstraint *SizeConstraint `type:"structure" required:"true"` -} - -// String returns the string representation -func (s SizeConstraintSetUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SizeConstraintSetUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SizeConstraintSetUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SizeConstraintSetUpdate"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.SizeConstraint == nil { - invalidParams.Add(request.NewErrParamRequired("SizeConstraint")) - } - if s.SizeConstraint != nil { - if err := s.SizeConstraint.Validate(); err != nil { - invalidParams.AddNested("SizeConstraint", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *SizeConstraintSetUpdate) SetAction(v string) *SizeConstraintSetUpdate { - s.Action = &v - return s -} - -// SetSizeConstraint sets the SizeConstraint field's value. -func (s *SizeConstraintSetUpdate) SetSizeConstraint(v *SizeConstraint) *SizeConstraintSetUpdate { - s.SizeConstraint = v - return s -} - -// A complex type that contains SqlInjectionMatchTuple objects, which specify -// the parts of web requests that you want AWS WAF to inspect for snippets of -// malicious SQL code and, if you want AWS WAF to inspect a header, the name -// of the header. If a SqlInjectionMatchSet contains more than one SqlInjectionMatchTuple -// object, a request needs to include snippets of SQL code in only one of the -// specified parts of the request to be considered a match. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SqlInjectionMatchSet -type SqlInjectionMatchSet struct { - _ struct{} `type:"structure"` - - // The name, if any, of the SqlInjectionMatchSet. - Name *string `min:"1" type:"string"` - - // A unique identifier for a SqlInjectionMatchSet. You use SqlInjectionMatchSetId - // to get information about a SqlInjectionMatchSet (see GetSqlInjectionMatchSet), - // update a SqlInjectionMatchSet (see UpdateSqlInjectionMatchSet), insert a - // SqlInjectionMatchSet into a Rule or delete one from a Rule (see UpdateRule), - // and delete a SqlInjectionMatchSet from AWS WAF (see DeleteSqlInjectionMatchSet). - // - // SqlInjectionMatchSetId is returned by CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets. - // - // SqlInjectionMatchSetId is a required field - SqlInjectionMatchSetId *string `min:"1" type:"string" required:"true"` - - // Specifies the parts of web requests that you want to inspect for snippets - // of malicious SQL code. - // - // SqlInjectionMatchTuples is a required field - SqlInjectionMatchTuples []*SqlInjectionMatchTuple `type:"list" required:"true"` -} - -// String returns the string representation -func (s SqlInjectionMatchSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SqlInjectionMatchSet) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *SqlInjectionMatchSet) SetName(v string) *SqlInjectionMatchSet { - s.Name = &v - return s -} - -// SetSqlInjectionMatchSetId sets the SqlInjectionMatchSetId field's value. -func (s *SqlInjectionMatchSet) SetSqlInjectionMatchSetId(v string) *SqlInjectionMatchSet { - s.SqlInjectionMatchSetId = &v - return s -} - -// SetSqlInjectionMatchTuples sets the SqlInjectionMatchTuples field's value. -func (s *SqlInjectionMatchSet) SetSqlInjectionMatchTuples(v []*SqlInjectionMatchTuple) *SqlInjectionMatchSet { - s.SqlInjectionMatchTuples = v - return s -} - -// The Id and Name of a SqlInjectionMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SqlInjectionMatchSetSummary -type SqlInjectionMatchSetSummary struct { - _ struct{} `type:"structure"` - - // The name of the SqlInjectionMatchSet, if any, specified by Id. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A unique identifier for a SqlInjectionMatchSet. You use SqlInjectionMatchSetId - // to get information about a SqlInjectionMatchSet (see GetSqlInjectionMatchSet), - // update a SqlInjectionMatchSet (see UpdateSqlInjectionMatchSet), insert a - // SqlInjectionMatchSet into a Rule or delete one from a Rule (see UpdateRule), - // and delete a SqlInjectionMatchSet from AWS WAF (see DeleteSqlInjectionMatchSet). - // - // SqlInjectionMatchSetId is returned by CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets. - // - // SqlInjectionMatchSetId is a required field - SqlInjectionMatchSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SqlInjectionMatchSetSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SqlInjectionMatchSetSummary) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *SqlInjectionMatchSetSummary) SetName(v string) *SqlInjectionMatchSetSummary { - s.Name = &v - return s -} - -// SetSqlInjectionMatchSetId sets the SqlInjectionMatchSetId field's value. -func (s *SqlInjectionMatchSetSummary) SetSqlInjectionMatchSetId(v string) *SqlInjectionMatchSetSummary { - s.SqlInjectionMatchSetId = &v - return s -} - -// Specifies the part of a web request that you want to inspect for snippets -// of malicious SQL code and indicates whether you want to add the specification -// to a SqlInjectionMatchSet or delete it from a SqlInjectionMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SqlInjectionMatchSetUpdate -type SqlInjectionMatchSetUpdate struct { - _ struct{} `type:"structure"` - - // Specify INSERT to add a SqlInjectionMatchSetUpdate to a SqlInjectionMatchSet. - // Use DELETE to remove a SqlInjectionMatchSetUpdate from a SqlInjectionMatchSet. - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ChangeAction"` - - // Specifies the part of a web request that you want AWS WAF to inspect for - // snippets of malicious SQL code and, if you want AWS WAF to inspect a header, - // the name of the header. - // - // SqlInjectionMatchTuple is a required field - SqlInjectionMatchTuple *SqlInjectionMatchTuple `type:"structure" required:"true"` -} - -// String returns the string representation -func (s SqlInjectionMatchSetUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SqlInjectionMatchSetUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SqlInjectionMatchSetUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SqlInjectionMatchSetUpdate"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.SqlInjectionMatchTuple == nil { - invalidParams.Add(request.NewErrParamRequired("SqlInjectionMatchTuple")) - } - if s.SqlInjectionMatchTuple != nil { - if err := s.SqlInjectionMatchTuple.Validate(); err != nil { - invalidParams.AddNested("SqlInjectionMatchTuple", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *SqlInjectionMatchSetUpdate) SetAction(v string) *SqlInjectionMatchSetUpdate { - s.Action = &v - return s -} - -// SetSqlInjectionMatchTuple sets the SqlInjectionMatchTuple field's value. -func (s *SqlInjectionMatchSetUpdate) SetSqlInjectionMatchTuple(v *SqlInjectionMatchTuple) *SqlInjectionMatchSetUpdate { - s.SqlInjectionMatchTuple = v - return s -} - -// Specifies the part of a web request that you want AWS WAF to inspect for -// snippets of malicious SQL code and, if you want AWS WAF to inspect a header, -// the name of the header. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SqlInjectionMatchTuple -type SqlInjectionMatchTuple struct { - _ struct{} `type:"structure"` - - // Specifies where in a web request to look for snippets of malicious SQL code. - // - // FieldToMatch is a required field - FieldToMatch *FieldToMatch `type:"structure" required:"true"` - - // Text transformations eliminate some of the unusual formatting that attackers - // use in web requests in an effort to bypass AWS WAF. If you specify a transformation, - // AWS WAF performs the transformation on FieldToMatch before inspecting a request - // for a match. - // - // CMD_LINE - // - // When you're concerned that attackers are injecting an operating system commandline - // command and using unusual formatting to disguise some or all of the command, - // use this option to perform the following transformations: - // - // * Delete the following characters: \ " ' ^ - // - // * Delete spaces before the following characters: / ( - // - // * Replace the following characters with a space: , ; - // - // * Replace multiple spaces with one space - // - // * Convert uppercase letters (A-Z) to lowercase (a-z) - // - // COMPRESS_WHITE_SPACE - // - // Use this option to replace the following characters with a space character - // (decimal 32): - // - // * \f, formfeed, decimal 12 - // - // * \t, tab, decimal 9 - // - // * \n, newline, decimal 10 - // - // * \r, carriage return, decimal 13 - // - // * \v, vertical tab, decimal 11 - // - // * non-breaking space, decimal 160 - // - // COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. - // - // HTML_ENTITY_DECODE - // - // Use this option to replace HTML-encoded characters with unencoded characters. - // HTML_ENTITY_DECODE performs the following operations: - // - // * Replaces (ampersand)quot; with " - // - // * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 - // - // * Replaces (ampersand)lt; with a "less than" symbol - // - // * Replaces (ampersand)gt; with > - // - // * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, - // with the corresponding characters - // - // * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, - // with the corresponding characters - // - // LOWERCASE - // - // Use this option to convert uppercase letters (A-Z) to lowercase (a-z). - // - // URL_DECODE - // - // Use this option to decode a URL-encoded value. - // - // NONE - // - // Specify NONE if you don't want to perform any text transformations. - // - // TextTransformation is a required field - TextTransformation *string `type:"string" required:"true" enum:"TextTransformation"` -} - -// String returns the string representation -func (s SqlInjectionMatchTuple) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SqlInjectionMatchTuple) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SqlInjectionMatchTuple) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SqlInjectionMatchTuple"} - if s.FieldToMatch == nil { - invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) - } - if s.TextTransformation == nil { - invalidParams.Add(request.NewErrParamRequired("TextTransformation")) - } - if s.FieldToMatch != nil { - if err := s.FieldToMatch.Validate(); err != nil { - invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldToMatch sets the FieldToMatch field's value. -func (s *SqlInjectionMatchTuple) SetFieldToMatch(v *FieldToMatch) *SqlInjectionMatchTuple { - s.FieldToMatch = v - return s -} - -// SetTextTransformation sets the TextTransformation field's value. -func (s *SqlInjectionMatchTuple) SetTextTransformation(v string) *SqlInjectionMatchTuple { - s.TextTransformation = &v - return s -} - -// In a GetSampledRequests request, the StartTime and EndTime objects specify -// the time range for which you want AWS WAF to return a sample of web requests. -// -// In a GetSampledRequests response, the StartTime and EndTime objects specify -// the time range for which AWS WAF actually returned a sample of web requests. -// AWS WAF gets the specified number of requests from among the first 5,000 -// requests that your AWS resource receives during the specified time period. -// If your resource receives more than 5,000 requests during that period, AWS -// WAF stops sampling after the 5,000th request. In that case, EndTime is the -// time that AWS WAF received the 5,000th request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/TimeWindow -type TimeWindow struct { - _ struct{} `type:"structure"` - - // The end of the time range from which you want GetSampledRequests to return - // a sample of the requests that your AWS resource received. Specify the date - // and time in the following format: "2016-09-27T14:50Z". You can specify any - // time range in the previous three hours. - // - // EndTime is a required field - EndTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The beginning of the time range from which you want GetSampledRequests to - // return a sample of the requests that your AWS resource received. Specify - // the date and time in the following format: "2016-09-27T14:50Z". You can specify - // any time range in the previous three hours. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` -} - -// String returns the string representation -func (s TimeWindow) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimeWindow) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TimeWindow) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TimeWindow"} - if s.EndTime == nil { - invalidParams.Add(request.NewErrParamRequired("EndTime")) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *TimeWindow) SetEndTime(v time.Time) *TimeWindow { - s.EndTime = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *TimeWindow) SetStartTime(v time.Time) *TimeWindow { - s.StartTime = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSetRequest -type UpdateByteMatchSetInput struct { - _ struct{} `type:"structure"` - - // The ByteMatchSetId of the ByteMatchSet that you want to update. ByteMatchSetId - // is returned by CreateByteMatchSet and by ListByteMatchSets. - // - // ByteMatchSetId is a required field - ByteMatchSetId *string `min:"1" type:"string" required:"true"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // An array of ByteMatchSetUpdate objects that you want to insert into or delete - // from a ByteMatchSet. For more information, see the applicable data types: - // - // * ByteMatchSetUpdate: Contains Action and ByteMatchTuple - // - // * ByteMatchTuple: Contains FieldToMatch, PositionalConstraint, TargetString, - // and TextTransformation - // - // * FieldToMatch: Contains Data and Type - // - // Updates is a required field - Updates []*ByteMatchSetUpdate `type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateByteMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateByteMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateByteMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateByteMatchSetInput"} - if s.ByteMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ByteMatchSetId")) - } - if s.ByteMatchSetId != nil && len(*s.ByteMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ByteMatchSetId", 1)) - } - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.Updates == nil { - invalidParams.Add(request.NewErrParamRequired("Updates")) - } - if s.Updates != nil { - for i, v := range s.Updates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Updates", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetByteMatchSetId sets the ByteMatchSetId field's value. -func (s *UpdateByteMatchSetInput) SetByteMatchSetId(v string) *UpdateByteMatchSetInput { - s.ByteMatchSetId = &v - return s -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateByteMatchSetInput) SetChangeToken(v string) *UpdateByteMatchSetInput { - s.ChangeToken = &v - return s -} - -// SetUpdates sets the Updates field's value. -func (s *UpdateByteMatchSetInput) SetUpdates(v []*ByteMatchSetUpdate) *UpdateByteMatchSetInput { - s.Updates = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSetResponse -type UpdateByteMatchSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the UpdateByteMatchSet request. You - // can also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateByteMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateByteMatchSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateByteMatchSetOutput) SetChangeToken(v string) *UpdateByteMatchSetOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSetRequest -type UpdateIPSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The IPSetId of the IPSet that you want to update. IPSetId is returned by - // CreateIPSet and by ListIPSets. - // - // IPSetId is a required field - IPSetId *string `min:"1" type:"string" required:"true"` - - // An array of IPSetUpdate objects that you want to insert into or delete from - // an IPSet. For more information, see the applicable data types: - // - // * IPSetUpdate: Contains Action and IPSetDescriptor - // - // * IPSetDescriptor: Contains Type and Value - // - // Updates is a required field - Updates []*IPSetUpdate `type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateIPSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateIPSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIPSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIPSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.IPSetId == nil { - invalidParams.Add(request.NewErrParamRequired("IPSetId")) - } - if s.IPSetId != nil && len(*s.IPSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IPSetId", 1)) - } - if s.Updates == nil { - invalidParams.Add(request.NewErrParamRequired("Updates")) - } - if s.Updates != nil { - for i, v := range s.Updates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Updates", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateIPSetInput) SetChangeToken(v string) *UpdateIPSetInput { - s.ChangeToken = &v - return s -} - -// SetIPSetId sets the IPSetId field's value. -func (s *UpdateIPSetInput) SetIPSetId(v string) *UpdateIPSetInput { - s.IPSetId = &v - return s -} - -// SetUpdates sets the Updates field's value. -func (s *UpdateIPSetInput) SetUpdates(v []*IPSetUpdate) *UpdateIPSetInput { - s.Updates = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSetResponse -type UpdateIPSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the UpdateIPSet request. You can - // also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateIPSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateIPSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateIPSetOutput) SetChangeToken(v string) *UpdateIPSetOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRuleRequest -type UpdateRuleInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The RuleId of the Rule that you want to update. RuleId is returned by CreateRule - // and by ListRules. - // - // RuleId is a required field - RuleId *string `min:"1" type:"string" required:"true"` - - // An array of RuleUpdate objects that you want to insert into or delete from - // a Rule. For more information, see the applicable data types: - // - // * RuleUpdate: Contains Action and Predicate - // - // * Predicate: Contains DataId, Negated, and Type - // - // * FieldToMatch: Contains Data and Type - // - // Updates is a required field - Updates []*RuleUpdate `type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateRuleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRuleInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.RuleId == nil { - invalidParams.Add(request.NewErrParamRequired("RuleId")) - } - if s.RuleId != nil && len(*s.RuleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleId", 1)) - } - if s.Updates == nil { - invalidParams.Add(request.NewErrParamRequired("Updates")) - } - if s.Updates != nil { - for i, v := range s.Updates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Updates", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateRuleInput) SetChangeToken(v string) *UpdateRuleInput { - s.ChangeToken = &v - return s -} - -// SetRuleId sets the RuleId field's value. -func (s *UpdateRuleInput) SetRuleId(v string) *UpdateRuleInput { - s.RuleId = &v - return s -} - -// SetUpdates sets the Updates field's value. -func (s *UpdateRuleInput) SetUpdates(v []*RuleUpdate) *UpdateRuleInput { - s.Updates = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRuleResponse -type UpdateRuleOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the UpdateRule request. You can also - // use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateRuleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateRuleOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateRuleOutput) SetChangeToken(v string) *UpdateRuleOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSizeConstraintSetRequest -type UpdateSizeConstraintSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The SizeConstraintSetId of the SizeConstraintSet that you want to update. - // SizeConstraintSetId is returned by CreateSizeConstraintSet and by ListSizeConstraintSets. - // - // SizeConstraintSetId is a required field - SizeConstraintSetId *string `min:"1" type:"string" required:"true"` - - // An array of SizeConstraintSetUpdate objects that you want to insert into - // or delete from a SizeConstraintSet. For more information, see the applicable - // data types: - // - // * SizeConstraintSetUpdate: Contains Action and SizeConstraint - // - // * SizeConstraint: Contains FieldToMatch, TextTransformation, ComparisonOperator, - // and Size - // - // * FieldToMatch: Contains Data and Type - // - // Updates is a required field - Updates []*SizeConstraintSetUpdate `type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateSizeConstraintSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSizeConstraintSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSizeConstraintSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSizeConstraintSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.SizeConstraintSetId == nil { - invalidParams.Add(request.NewErrParamRequired("SizeConstraintSetId")) - } - if s.SizeConstraintSetId != nil && len(*s.SizeConstraintSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SizeConstraintSetId", 1)) - } - if s.Updates == nil { - invalidParams.Add(request.NewErrParamRequired("Updates")) - } - if s.Updates != nil { - for i, v := range s.Updates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Updates", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateSizeConstraintSetInput) SetChangeToken(v string) *UpdateSizeConstraintSetInput { - s.ChangeToken = &v - return s -} - -// SetSizeConstraintSetId sets the SizeConstraintSetId field's value. -func (s *UpdateSizeConstraintSetInput) SetSizeConstraintSetId(v string) *UpdateSizeConstraintSetInput { - s.SizeConstraintSetId = &v - return s -} - -// SetUpdates sets the Updates field's value. -func (s *UpdateSizeConstraintSetInput) SetUpdates(v []*SizeConstraintSetUpdate) *UpdateSizeConstraintSetInput { - s.Updates = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSizeConstraintSetResponse -type UpdateSizeConstraintSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the UpdateSizeConstraintSet request. - // You can also use this value to query the status of the request. For more - // information, see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateSizeConstraintSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSizeConstraintSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateSizeConstraintSetOutput) SetChangeToken(v string) *UpdateSizeConstraintSetOutput { - s.ChangeToken = &v - return s -} - -// A request to update a SqlInjectionMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSetRequest -type UpdateSqlInjectionMatchSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // The SqlInjectionMatchSetId of the SqlInjectionMatchSet that you want to update. - // SqlInjectionMatchSetId is returned by CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets. - // - // SqlInjectionMatchSetId is a required field - SqlInjectionMatchSetId *string `min:"1" type:"string" required:"true"` - - // An array of SqlInjectionMatchSetUpdate objects that you want to insert into - // or delete from a SqlInjectionMatchSet. For more information, see the applicable - // data types: - // - // * SqlInjectionMatchSetUpdate: Contains Action and SqlInjectionMatchTuple - // - // * SqlInjectionMatchTuple: Contains FieldToMatch and TextTransformation - // - // * FieldToMatch: Contains Data and Type - // - // Updates is a required field - Updates []*SqlInjectionMatchSetUpdate `type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateSqlInjectionMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSqlInjectionMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSqlInjectionMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSqlInjectionMatchSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.SqlInjectionMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("SqlInjectionMatchSetId")) - } - if s.SqlInjectionMatchSetId != nil && len(*s.SqlInjectionMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SqlInjectionMatchSetId", 1)) - } - if s.Updates == nil { - invalidParams.Add(request.NewErrParamRequired("Updates")) - } - if s.Updates != nil { - for i, v := range s.Updates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Updates", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateSqlInjectionMatchSetInput) SetChangeToken(v string) *UpdateSqlInjectionMatchSetInput { - s.ChangeToken = &v - return s -} - -// SetSqlInjectionMatchSetId sets the SqlInjectionMatchSetId field's value. -func (s *UpdateSqlInjectionMatchSetInput) SetSqlInjectionMatchSetId(v string) *UpdateSqlInjectionMatchSetInput { - s.SqlInjectionMatchSetId = &v - return s -} - -// SetUpdates sets the Updates field's value. -func (s *UpdateSqlInjectionMatchSetInput) SetUpdates(v []*SqlInjectionMatchSetUpdate) *UpdateSqlInjectionMatchSetInput { - s.Updates = v - return s -} - -// The response to an UpdateSqlInjectionMatchSets request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSetResponse -type UpdateSqlInjectionMatchSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the UpdateSqlInjectionMatchSet request. - // You can also use this value to query the status of the request. For more - // information, see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateSqlInjectionMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSqlInjectionMatchSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateSqlInjectionMatchSetOutput) SetChangeToken(v string) *UpdateSqlInjectionMatchSetOutput { - s.ChangeToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACLRequest -type UpdateWebACLInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // A default action for the web ACL, either ALLOW or BLOCK. AWS WAF performs - // the default action if a request doesn't match the criteria in any of the - // rules in a web ACL. - DefaultAction *WafAction `type:"structure"` - - // An array of updates to make to the WebACL. - // - // An array of WebACLUpdate objects that you want to insert into or delete from - // a WebACL. For more information, see the applicable data types: - // - // * WebACLUpdate: Contains Action and ActivatedRule - // - // * ActivatedRule: Contains Action, Priority, and RuleId - // - // * WafAction: Contains Type - Updates []*WebACLUpdate `type:"list"` - - // The WebACLId of the WebACL that you want to update. WebACLId is returned - // by CreateWebACL and by ListWebACLs. - // - // WebACLId is a required field - WebACLId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateWebACLInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateWebACLInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWebACLInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWebACLInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.WebACLId == nil { - invalidParams.Add(request.NewErrParamRequired("WebACLId")) - } - if s.WebACLId != nil && len(*s.WebACLId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WebACLId", 1)) - } - if s.DefaultAction != nil { - if err := s.DefaultAction.Validate(); err != nil { - invalidParams.AddNested("DefaultAction", err.(request.ErrInvalidParams)) - } - } - if s.Updates != nil { - for i, v := range s.Updates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Updates", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateWebACLInput) SetChangeToken(v string) *UpdateWebACLInput { - s.ChangeToken = &v - return s -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *UpdateWebACLInput) SetDefaultAction(v *WafAction) *UpdateWebACLInput { - s.DefaultAction = v - return s -} - -// SetUpdates sets the Updates field's value. -func (s *UpdateWebACLInput) SetUpdates(v []*WebACLUpdate) *UpdateWebACLInput { - s.Updates = v - return s -} - -// SetWebACLId sets the WebACLId field's value. -func (s *UpdateWebACLInput) SetWebACLId(v string) *UpdateWebACLInput { - s.WebACLId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACLResponse -type UpdateWebACLOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the UpdateWebACL request. You can - // also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateWebACLOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateWebACLOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateWebACLOutput) SetChangeToken(v string) *UpdateWebACLOutput { - s.ChangeToken = &v - return s -} - -// A request to update an XssMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateXssMatchSetRequest -type UpdateXssMatchSetInput struct { - _ struct{} `type:"structure"` - - // The value returned by the most recent call to GetChangeToken. - // - // ChangeToken is a required field - ChangeToken *string `min:"1" type:"string" required:"true"` - - // An array of XssMatchSetUpdate objects that you want to insert into or delete - // from a XssMatchSet. For more information, see the applicable data types: - // - // * XssMatchSetUpdate: Contains Action and XssMatchTuple - // - // * XssMatchTuple: Contains FieldToMatch and TextTransformation - // - // * FieldToMatch: Contains Data and Type - // - // Updates is a required field - Updates []*XssMatchSetUpdate `type:"list" required:"true"` - - // The XssMatchSetId of the XssMatchSet that you want to update. XssMatchSetId - // is returned by CreateXssMatchSet and by ListXssMatchSets. - // - // XssMatchSetId is a required field - XssMatchSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateXssMatchSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateXssMatchSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateXssMatchSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateXssMatchSetInput"} - if s.ChangeToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeToken")) - } - if s.ChangeToken != nil && len(*s.ChangeToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeToken", 1)) - } - if s.Updates == nil { - invalidParams.Add(request.NewErrParamRequired("Updates")) - } - if s.XssMatchSetId == nil { - invalidParams.Add(request.NewErrParamRequired("XssMatchSetId")) - } - if s.XssMatchSetId != nil && len(*s.XssMatchSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("XssMatchSetId", 1)) - } - if s.Updates != nil { - for i, v := range s.Updates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Updates", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateXssMatchSetInput) SetChangeToken(v string) *UpdateXssMatchSetInput { - s.ChangeToken = &v - return s -} - -// SetUpdates sets the Updates field's value. -func (s *UpdateXssMatchSetInput) SetUpdates(v []*XssMatchSetUpdate) *UpdateXssMatchSetInput { - s.Updates = v - return s -} - -// SetXssMatchSetId sets the XssMatchSetId field's value. -func (s *UpdateXssMatchSetInput) SetXssMatchSetId(v string) *UpdateXssMatchSetInput { - s.XssMatchSetId = &v - return s -} - -// The response to an UpdateXssMatchSets request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateXssMatchSetResponse -type UpdateXssMatchSetOutput struct { - _ struct{} `type:"structure"` - - // The ChangeToken that you used to submit the UpdateXssMatchSet request. You - // can also use this value to query the status of the request. For more information, - // see GetChangeTokenStatus. - ChangeToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s UpdateXssMatchSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateXssMatchSetOutput) GoString() string { - return s.String() -} - -// SetChangeToken sets the ChangeToken field's value. -func (s *UpdateXssMatchSetOutput) SetChangeToken(v string) *UpdateXssMatchSetOutput { - s.ChangeToken = &v - return s -} - -// For the action that is associated with a rule in a WebACL, specifies the -// action that you want AWS WAF to perform when a web request matches all of -// the conditions in a rule. For the default action in a WebACL, specifies the -// action that you want AWS WAF to take when a web request doesn't match all -// of the conditions in any of the rules in a WebACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/WafAction -type WafAction struct { - _ struct{} `type:"structure"` - - // Specifies how you want AWS WAF to respond to requests that match the settings - // in a Rule. Valid settings include the following: - // - // * ALLOW: AWS WAF allows requests - // - // * BLOCK: AWS WAF blocks requests - // - // * COUNT: AWS WAF increments a counter of the requests that match all of - // the conditions in the rule. AWS WAF then continues to inspect the web - // request based on the remaining rules in the web ACL. You can't specify - // COUNT for the default action for a WebACL. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"WafActionType"` -} - -// String returns the string representation -func (s WafAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WafAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WafAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WafAction"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetType sets the Type field's value. -func (s *WafAction) SetType(v string) *WafAction { - s.Type = &v - return s -} - -// Contains the Rules that identify the requests that you want to allow, block, -// or count. In a WebACL, you also specify a default action (ALLOW or BLOCK), -// and the action for each Rule that you add to a WebACL, for example, block -// requests from specified IP addresses or block requests from specified referrers. -// You also associate the WebACL with a CloudFront distribution to identify -// the requests that you want AWS WAF to filter. If you add more than one Rule -// to a WebACL, a request needs to match only one of the specifications to be -// allowed, blocked, or counted. For more information, see UpdateWebACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/WebACL -type WebACL struct { - _ struct{} `type:"structure"` - - // The action to perform if none of the Rules contained in the WebACL match. - // The action is specified by the WafAction object. - // - // DefaultAction is a required field - DefaultAction *WafAction `type:"structure" required:"true"` - - // A friendly name or description for the metrics for this WebACL. The name - // can contain only alphanumeric characters (A-Z, a-z, 0-9); the name can't - // contain whitespace. You can't change MetricName after you create the WebACL. - MetricName *string `type:"string"` - - // A friendly name or description of the WebACL. You can't change the name of - // a WebACL after you create it. - Name *string `min:"1" type:"string"` - - // An array that contains the action for each Rule in a WebACL, the priority - // of the Rule, and the ID of the Rule. - // - // Rules is a required field - Rules []*ActivatedRule `type:"list" required:"true"` - - // A unique identifier for a WebACL. You use WebACLId to get information about - // a WebACL (see GetWebACL), update a WebACL (see UpdateWebACL), and delete - // a WebACL from AWS WAF (see DeleteWebACL). - // - // WebACLId is returned by CreateWebACL and by ListWebACLs. - // - // WebACLId is a required field - WebACLId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s WebACL) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WebACL) GoString() string { - return s.String() -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *WebACL) SetDefaultAction(v *WafAction) *WebACL { - s.DefaultAction = v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *WebACL) SetMetricName(v string) *WebACL { - s.MetricName = &v - return s -} - -// SetName sets the Name field's value. -func (s *WebACL) SetName(v string) *WebACL { - s.Name = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *WebACL) SetRules(v []*ActivatedRule) *WebACL { - s.Rules = v - return s -} - -// SetWebACLId sets the WebACLId field's value. -func (s *WebACL) SetWebACLId(v string) *WebACL { - s.WebACLId = &v - return s -} - -// Contains the identifier and the name or description of the WebACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/WebACLSummary -type WebACLSummary struct { - _ struct{} `type:"structure"` - - // A friendly name or description of the WebACL. You can't change the name of - // a WebACL after you create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A unique identifier for a WebACL. You use WebACLId to get information about - // a WebACL (see GetWebACL), update a WebACL (see UpdateWebACL), and delete - // a WebACL from AWS WAF (see DeleteWebACL). - // - // WebACLId is returned by CreateWebACL and by ListWebACLs. - // - // WebACLId is a required field - WebACLId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s WebACLSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WebACLSummary) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *WebACLSummary) SetName(v string) *WebACLSummary { - s.Name = &v - return s -} - -// SetWebACLId sets the WebACLId field's value. -func (s *WebACLSummary) SetWebACLId(v string) *WebACLSummary { - s.WebACLId = &v - return s -} - -// Specifies whether to insert a Rule into or delete a Rule from a WebACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/WebACLUpdate -type WebACLUpdate struct { - _ struct{} `type:"structure"` - - // Specifies whether to insert a Rule into or delete a Rule from a WebACL. - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ChangeAction"` - - // The ActivatedRule object in an UpdateWebACL request specifies a Rule that - // you want to insert or delete, the priority of the Rule in the WebACL, and - // the action that you want AWS WAF to take when a web request matches the Rule - // (ALLOW, BLOCK, or COUNT). - // - // ActivatedRule is a required field - ActivatedRule *ActivatedRule `type:"structure" required:"true"` -} - -// String returns the string representation -func (s WebACLUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WebACLUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WebACLUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WebACLUpdate"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.ActivatedRule == nil { - invalidParams.Add(request.NewErrParamRequired("ActivatedRule")) - } - if s.ActivatedRule != nil { - if err := s.ActivatedRule.Validate(); err != nil { - invalidParams.AddNested("ActivatedRule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *WebACLUpdate) SetAction(v string) *WebACLUpdate { - s.Action = &v - return s -} - -// SetActivatedRule sets the ActivatedRule field's value. -func (s *WebACLUpdate) SetActivatedRule(v *ActivatedRule) *WebACLUpdate { - s.ActivatedRule = v - return s -} - -// A complex type that contains XssMatchTuple objects, which specify the parts -// of web requests that you want AWS WAF to inspect for cross-site scripting -// attacks and, if you want AWS WAF to inspect a header, the name of the header. -// If a XssMatchSet contains more than one XssMatchTuple object, a request needs -// to include cross-site scripting attacks in only one of the specified parts -// of the request to be considered a match. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/XssMatchSet -type XssMatchSet struct { - _ struct{} `type:"structure"` - - // The name, if any, of the XssMatchSet. - Name *string `min:"1" type:"string"` - - // A unique identifier for an XssMatchSet. You use XssMatchSetId to get information - // about an XssMatchSet (see GetXssMatchSet), update an XssMatchSet (see UpdateXssMatchSet), - // insert an XssMatchSet into a Rule or delete one from a Rule (see UpdateRule), - // and delete an XssMatchSet from AWS WAF (see DeleteXssMatchSet). - // - // XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets. - // - // XssMatchSetId is a required field - XssMatchSetId *string `min:"1" type:"string" required:"true"` - - // Specifies the parts of web requests that you want to inspect for cross-site - // scripting attacks. - // - // XssMatchTuples is a required field - XssMatchTuples []*XssMatchTuple `type:"list" required:"true"` -} - -// String returns the string representation -func (s XssMatchSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s XssMatchSet) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *XssMatchSet) SetName(v string) *XssMatchSet { - s.Name = &v - return s -} - -// SetXssMatchSetId sets the XssMatchSetId field's value. -func (s *XssMatchSet) SetXssMatchSetId(v string) *XssMatchSet { - s.XssMatchSetId = &v - return s -} - -// SetXssMatchTuples sets the XssMatchTuples field's value. -func (s *XssMatchSet) SetXssMatchTuples(v []*XssMatchTuple) *XssMatchSet { - s.XssMatchTuples = v - return s -} - -// The Id and Name of an XssMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/XssMatchSetSummary -type XssMatchSetSummary struct { - _ struct{} `type:"structure"` - - // The name of the XssMatchSet, if any, specified by Id. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A unique identifier for an XssMatchSet. You use XssMatchSetId to get information - // about a XssMatchSet (see GetXssMatchSet), update an XssMatchSet (see UpdateXssMatchSet), - // insert an XssMatchSet into a Rule or delete one from a Rule (see UpdateRule), - // and delete an XssMatchSet from AWS WAF (see DeleteXssMatchSet). - // - // XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets. - // - // XssMatchSetId is a required field - XssMatchSetId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s XssMatchSetSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s XssMatchSetSummary) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *XssMatchSetSummary) SetName(v string) *XssMatchSetSummary { - s.Name = &v - return s -} - -// SetXssMatchSetId sets the XssMatchSetId field's value. -func (s *XssMatchSetSummary) SetXssMatchSetId(v string) *XssMatchSetSummary { - s.XssMatchSetId = &v - return s -} - -// Specifies the part of a web request that you want to inspect for cross-site -// scripting attacks and indicates whether you want to add the specification -// to an XssMatchSet or delete it from an XssMatchSet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/XssMatchSetUpdate -type XssMatchSetUpdate struct { - _ struct{} `type:"structure"` - - // Specify INSERT to add a XssMatchSetUpdate to an XssMatchSet. Use DELETE to - // remove a XssMatchSetUpdate from an XssMatchSet. - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ChangeAction"` - - // Specifies the part of a web request that you want AWS WAF to inspect for - // cross-site scripting attacks and, if you want AWS WAF to inspect a header, - // the name of the header. - // - // XssMatchTuple is a required field - XssMatchTuple *XssMatchTuple `type:"structure" required:"true"` -} - -// String returns the string representation -func (s XssMatchSetUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s XssMatchSetUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *XssMatchSetUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "XssMatchSetUpdate"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.XssMatchTuple == nil { - invalidParams.Add(request.NewErrParamRequired("XssMatchTuple")) - } - if s.XssMatchTuple != nil { - if err := s.XssMatchTuple.Validate(); err != nil { - invalidParams.AddNested("XssMatchTuple", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *XssMatchSetUpdate) SetAction(v string) *XssMatchSetUpdate { - s.Action = &v - return s -} - -// SetXssMatchTuple sets the XssMatchTuple field's value. -func (s *XssMatchSetUpdate) SetXssMatchTuple(v *XssMatchTuple) *XssMatchSetUpdate { - s.XssMatchTuple = v - return s -} - -// Specifies the part of a web request that you want AWS WAF to inspect for -// cross-site scripting attacks and, if you want AWS WAF to inspect a header, -// the name of the header. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/XssMatchTuple -type XssMatchTuple struct { - _ struct{} `type:"structure"` - - // Specifies where in a web request to look for cross-site scripting attacks. - // - // FieldToMatch is a required field - FieldToMatch *FieldToMatch `type:"structure" required:"true"` - - // Text transformations eliminate some of the unusual formatting that attackers - // use in web requests in an effort to bypass AWS WAF. If you specify a transformation, - // AWS WAF performs the transformation on FieldToMatch before inspecting a request - // for a match. - // - // CMD_LINE - // - // When you're concerned that attackers are injecting an operating system commandline - // command and using unusual formatting to disguise some or all of the command, - // use this option to perform the following transformations: - // - // * Delete the following characters: \ " ' ^ - // - // * Delete spaces before the following characters: / ( - // - // * Replace the following characters with a space: , ; - // - // * Replace multiple spaces with one space - // - // * Convert uppercase letters (A-Z) to lowercase (a-z) - // - // COMPRESS_WHITE_SPACE - // - // Use this option to replace the following characters with a space character - // (decimal 32): - // - // * \f, formfeed, decimal 12 - // - // * \t, tab, decimal 9 - // - // * \n, newline, decimal 10 - // - // * \r, carriage return, decimal 13 - // - // * \v, vertical tab, decimal 11 - // - // * non-breaking space, decimal 160 - // - // COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. - // - // HTML_ENTITY_DECODE - // - // Use this option to replace HTML-encoded characters with unencoded characters. - // HTML_ENTITY_DECODE performs the following operations: - // - // * Replaces (ampersand)quot; with " - // - // * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 - // - // * Replaces (ampersand)lt; with a "less than" symbol - // - // * Replaces (ampersand)gt; with > - // - // * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, - // with the corresponding characters - // - // * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, - // with the corresponding characters - // - // LOWERCASE - // - // Use this option to convert uppercase letters (A-Z) to lowercase (a-z). - // - // URL_DECODE - // - // Use this option to decode a URL-encoded value. - // - // NONE - // - // Specify NONE if you don't want to perform any text transformations. - // - // TextTransformation is a required field - TextTransformation *string `type:"string" required:"true" enum:"TextTransformation"` -} - -// String returns the string representation -func (s XssMatchTuple) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s XssMatchTuple) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *XssMatchTuple) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "XssMatchTuple"} - if s.FieldToMatch == nil { - invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) - } - if s.TextTransformation == nil { - invalidParams.Add(request.NewErrParamRequired("TextTransformation")) - } - if s.FieldToMatch != nil { - if err := s.FieldToMatch.Validate(); err != nil { - invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldToMatch sets the FieldToMatch field's value. -func (s *XssMatchTuple) SetFieldToMatch(v *FieldToMatch) *XssMatchTuple { - s.FieldToMatch = v - return s -} - -// SetTextTransformation sets the TextTransformation field's value. -func (s *XssMatchTuple) SetTextTransformation(v string) *XssMatchTuple { - s.TextTransformation = &v - return s -} - -const ( - // ChangeActionInsert is a ChangeAction enum value - ChangeActionInsert = "INSERT" - - // ChangeActionDelete is a ChangeAction enum value - ChangeActionDelete = "DELETE" -) - -const ( - // ChangeTokenStatusProvisioned is a ChangeTokenStatus enum value - ChangeTokenStatusProvisioned = "PROVISIONED" - - // ChangeTokenStatusPending is a ChangeTokenStatus enum value - ChangeTokenStatusPending = "PENDING" - - // ChangeTokenStatusInsync is a ChangeTokenStatus enum value - ChangeTokenStatusInsync = "INSYNC" -) - -const ( - // ComparisonOperatorEq is a ComparisonOperator enum value - ComparisonOperatorEq = "EQ" - - // ComparisonOperatorNe is a ComparisonOperator enum value - ComparisonOperatorNe = "NE" - - // 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" -) - -const ( - // IPSetDescriptorTypeIpv4 is a IPSetDescriptorType enum value - IPSetDescriptorTypeIpv4 = "IPV4" - - // IPSetDescriptorTypeIpv6 is a IPSetDescriptorType enum value - IPSetDescriptorTypeIpv6 = "IPV6" -) - -const ( - // MatchFieldTypeUri is a MatchFieldType enum value - MatchFieldTypeUri = "URI" - - // MatchFieldTypeQueryString is a MatchFieldType enum value - MatchFieldTypeQueryString = "QUERY_STRING" - - // MatchFieldTypeHeader is a MatchFieldType enum value - MatchFieldTypeHeader = "HEADER" - - // MatchFieldTypeMethod is a MatchFieldType enum value - MatchFieldTypeMethod = "METHOD" - - // MatchFieldTypeBody is a MatchFieldType enum value - MatchFieldTypeBody = "BODY" -) - -const ( - // ParameterExceptionFieldChangeAction is a ParameterExceptionField enum value - ParameterExceptionFieldChangeAction = "CHANGE_ACTION" - - // ParameterExceptionFieldWafAction is a ParameterExceptionField enum value - ParameterExceptionFieldWafAction = "WAF_ACTION" - - // ParameterExceptionFieldPredicateType is a ParameterExceptionField enum value - ParameterExceptionFieldPredicateType = "PREDICATE_TYPE" - - // ParameterExceptionFieldIpsetType is a ParameterExceptionField enum value - ParameterExceptionFieldIpsetType = "IPSET_TYPE" - - // ParameterExceptionFieldByteMatchFieldType is a ParameterExceptionField enum value - ParameterExceptionFieldByteMatchFieldType = "BYTE_MATCH_FIELD_TYPE" - - // ParameterExceptionFieldSqlInjectionMatchFieldType is a ParameterExceptionField enum value - ParameterExceptionFieldSqlInjectionMatchFieldType = "SQL_INJECTION_MATCH_FIELD_TYPE" - - // ParameterExceptionFieldByteMatchTextTransformation is a ParameterExceptionField enum value - ParameterExceptionFieldByteMatchTextTransformation = "BYTE_MATCH_TEXT_TRANSFORMATION" - - // ParameterExceptionFieldByteMatchPositionalConstraint is a ParameterExceptionField enum value - ParameterExceptionFieldByteMatchPositionalConstraint = "BYTE_MATCH_POSITIONAL_CONSTRAINT" - - // ParameterExceptionFieldSizeConstraintComparisonOperator is a ParameterExceptionField enum value - ParameterExceptionFieldSizeConstraintComparisonOperator = "SIZE_CONSTRAINT_COMPARISON_OPERATOR" -) - -const ( - // ParameterExceptionReasonInvalidOption is a ParameterExceptionReason enum value - ParameterExceptionReasonInvalidOption = "INVALID_OPTION" - - // ParameterExceptionReasonIllegalCombination is a ParameterExceptionReason enum value - ParameterExceptionReasonIllegalCombination = "ILLEGAL_COMBINATION" -) - -const ( - // PositionalConstraintExactly is a PositionalConstraint enum value - PositionalConstraintExactly = "EXACTLY" - - // PositionalConstraintStartsWith is a PositionalConstraint enum value - PositionalConstraintStartsWith = "STARTS_WITH" - - // PositionalConstraintEndsWith is a PositionalConstraint enum value - PositionalConstraintEndsWith = "ENDS_WITH" - - // PositionalConstraintContains is a PositionalConstraint enum value - PositionalConstraintContains = "CONTAINS" - - // PositionalConstraintContainsWord is a PositionalConstraint enum value - PositionalConstraintContainsWord = "CONTAINS_WORD" -) - -const ( - // PredicateTypeIpmatch is a PredicateType enum value - PredicateTypeIpmatch = "IPMatch" - - // PredicateTypeByteMatch is a PredicateType enum value - PredicateTypeByteMatch = "ByteMatch" - - // PredicateTypeSqlInjectionMatch is a PredicateType enum value - PredicateTypeSqlInjectionMatch = "SqlInjectionMatch" - - // PredicateTypeSizeConstraint is a PredicateType enum value - PredicateTypeSizeConstraint = "SizeConstraint" - - // PredicateTypeXssMatch is a PredicateType enum value - PredicateTypeXssMatch = "XssMatch" -) - -const ( - // TextTransformationNone is a TextTransformation enum value - TextTransformationNone = "NONE" - - // TextTransformationCompressWhiteSpace is a TextTransformation enum value - TextTransformationCompressWhiteSpace = "COMPRESS_WHITE_SPACE" - - // TextTransformationHtmlEntityDecode is a TextTransformation enum value - TextTransformationHtmlEntityDecode = "HTML_ENTITY_DECODE" - - // TextTransformationLowercase is a TextTransformation enum value - TextTransformationLowercase = "LOWERCASE" - - // TextTransformationCmdLine is a TextTransformation enum value - TextTransformationCmdLine = "CMD_LINE" - - // TextTransformationUrlDecode is a TextTransformation enum value - TextTransformationUrlDecode = "URL_DECODE" -) - -const ( - // WafActionTypeBlock is a WafActionType enum value - WafActionTypeBlock = "BLOCK" - - // WafActionTypeAllow is a WafActionType enum value - WafActionTypeAllow = "ALLOW" - - // WafActionTypeCount is a WafActionType enum value - WafActionTypeCount = "COUNT" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go b/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go deleted file mode 100644 index e5671e0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go +++ /dev/null @@ -1,148 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package waf - -const ( - - // ErrCodeDisallowedNameException for service response error code - // "DisallowedNameException". - // - // The name specified is invalid. - ErrCodeDisallowedNameException = "DisallowedNameException" - - // ErrCodeInternalErrorException for service response error code - // "InternalErrorException". - // - // The operation failed because of a system problem, even though the request - // was valid. Retry your request. - ErrCodeInternalErrorException = "InternalErrorException" - - // ErrCodeInvalidAccountException for service response error code - // "InvalidAccountException". - // - // The operation failed because you tried to create, update, or delete an object - // by using an invalid account identifier. - ErrCodeInvalidAccountException = "InvalidAccountException" - - // ErrCodeInvalidOperationException for service response error code - // "InvalidOperationException". - // - // The operation failed because there was nothing to do. For example: - // - // * You tried to remove a Rule from a WebACL, but the Rule isn't in the - // specified WebACL. - // - // * You tried to remove an IP address from an IPSet, but the IP address - // isn't in the specified IPSet. - // - // * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple - // isn't in the specified WebACL. - // - // * You tried to add a Rule to a WebACL, but the Rule already exists in - // the specified WebACL. - // - // * You tried to add an IP address to an IPSet, but the IP address already - // exists in the specified IPSet. - // - // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple - // already exists in the specified WebACL. - ErrCodeInvalidOperationException = "InvalidOperationException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // The operation failed because AWS WAF didn't recognize a parameter in the - // request. For example: - // - // * You specified an invalid parameter name. - // - // * You specified an invalid value. - // - // * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) - // using an action other than INSERT or DELETE. - // - // * You tried to create a WebACL with a DefaultActionType other than ALLOW, - // BLOCK, or COUNT. - // - // * You tried to update a WebACL with a WafActionType other than ALLOW, - // BLOCK, or COUNT. - // - // * You tried to update a ByteMatchSet with a FieldToMatchType other than - // HEADER, QUERY_STRING, or URI. - // - // * You tried to update a ByteMatchSet with a Field of HEADER but no value - // for Data. - // - // * Your request references an ARN that is malformed, or corresponds to - // a resource with which a web ACL cannot be associated. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeLimitsExceededException for service response error code - // "LimitsExceededException". - // - // The operation exceeds a resource limit, for example, the maximum number of - // WebACL objects that you can create for an AWS account. For more information, - // see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html) - // in the AWS WAF Developer Guide. - ErrCodeLimitsExceededException = "LimitsExceededException" - - // ErrCodeNonEmptyEntityException for service response error code - // "NonEmptyEntityException". - // - // The operation failed because you tried to delete an object that isn't empty. - // For example: - // - // * You tried to delete a WebACL that still contains one or more Rule objects. - // - // * You tried to delete a Rule that still contains one or more ByteMatchSet - // objects or other predicates. - // - // * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple - // objects. - // - // * You tried to delete an IPSet that references one or more IP addresses. - ErrCodeNonEmptyEntityException = "NonEmptyEntityException" - - // ErrCodeNonexistentContainerException for service response error code - // "NonexistentContainerException". - // - // The operation failed because you tried to add an object to or delete an object - // from another object that doesn't exist. For example: - // - // * You tried to add a Rule to or delete a Rule from a WebACL that doesn't - // exist. - // - // * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule - // that doesn't exist. - // - // * You tried to add an IP address to or delete an IP address from an IPSet - // that doesn't exist. - // - // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from - // a ByteMatchSet that doesn't exist. - ErrCodeNonexistentContainerException = "NonexistentContainerException" - - // ErrCodeNonexistentItemException for service response error code - // "NonexistentItemException". - // - // The operation failed because the referenced object doesn't exist. - ErrCodeNonexistentItemException = "NonexistentItemException" - - // ErrCodeReferencedItemException for service response error code - // "ReferencedItemException". - // - // The operation failed because you tried to delete an object that is still - // in use. For example: - // - // * You tried to delete a ByteMatchSet that is still referenced by a Rule. - // - // * You tried to delete a Rule that is still referenced by a WebACL. - ErrCodeReferencedItemException = "ReferencedItemException" - - // ErrCodeStaleDataException for service response error code - // "StaleDataException". - // - // The operation failed because you tried to create, update, or delete an object - // by using a change token that has already been used. - ErrCodeStaleDataException = "StaleDataException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/waf/service.go b/vendor/github.com/aws/aws-sdk-go/service/waf/service.go deleted file mode 100644 index 700ef9c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/service.go +++ /dev/null @@ -1,99 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package waf - -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" -) - -// This is the AWS WAF API Reference for using AWS WAF with Amazon CloudFront. -// The AWS WAF actions and data types listed in the reference are available -// for protecting Amazon CloudFront distributions. You can use these actions -// and data types via the endpoint waf.amazonaws.com. This guide is for developers -// who need detailed information about the AWS WAF API actions, data types, -// and errors. For detailed information about AWS WAF features and an overview -// of how to use the AWS WAF API, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/). -// 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/waf-2015-08-24 -type WAF 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 = "waf" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the WAF 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 WAF client from just a session. -// svc := waf.New(mySession) -// -// // Create a WAF client with additional configuration -// svc := waf.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *WAF { - 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) *WAF { - svc := &WAF{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2015-08-24", - JSONVersion: "1.1", - TargetPrefix: "AWSWAF_20150824", - }, - 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 WAF operation and runs any -// custom request initialization. -func (c *WAF) 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/bgentry/speakeasy/LICENSE b/vendor/github.com/bgentry/speakeasy/LICENSE new file mode 100644 index 0000000..37d60fc --- /dev/null +++ b/vendor/github.com/bgentry/speakeasy/LICENSE @@ -0,0 +1,24 @@ +MIT License + +Copyright (c) 2017 Blake Gentry + +This license applies to the non-Windows portions of this library. The Windows +portion maintains its own Apache 2.0 license. + +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/bgentry/speakeasy/LICENSE_WINDOWS b/vendor/github.com/bgentry/speakeasy/LICENSE_WINDOWS new file mode 100644 index 0000000..ff177f6 --- /dev/null +++ b/vendor/github.com/bgentry/speakeasy/LICENSE_WINDOWS @@ -0,0 +1,201 @@ + 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 [2013] [the CloudFoundry Authors] + +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/bgentry/speakeasy/Readme.md b/vendor/github.com/bgentry/speakeasy/Readme.md new file mode 100644 index 0000000..fceda75 --- /dev/null +++ b/vendor/github.com/bgentry/speakeasy/Readme.md @@ -0,0 +1,30 @@ +# Speakeasy + +This package provides cross-platform Go (#golang) helpers for taking user input +from the terminal while not echoing the input back (similar to `getpasswd`). The +package uses syscalls to avoid any dependence on cgo, and is therefore +compatible with cross-compiling. + +[![GoDoc](https://godoc.org/github.com/bgentry/speakeasy?status.png)][godoc] + +## Unicode + +Multi-byte unicode characters work successfully on Mac OS X. On Windows, +however, this may be problematic (as is UTF in general on Windows). Other +platforms have not been tested. + +## License + +The code herein was not written by me, but was compiled from two separate open +source packages. Unix portions were imported from [gopass][gopass], while +Windows portions were imported from the [CloudFoundry Go CLI][cf-cli]'s +[Windows terminal helpers][cf-ui-windows]. + +The [license for the windows portion](./LICENSE_WINDOWS) has been copied exactly +from the source (though I attempted to fill in the correct owner in the +boilerplate copyright notice). + +[cf-cli]: https://github.com/cloudfoundry/cli "CloudFoundry Go CLI" +[cf-ui-windows]: https://github.com/cloudfoundry/cli/blob/master/src/cf/terminal/ui_windows.go "CloudFoundry Go CLI Windows input helpers" +[godoc]: https://godoc.org/github.com/bgentry/speakeasy "speakeasy on Godoc.org" +[gopass]: https://code.google.com/p/gopass "gopass" diff --git a/vendor/github.com/bgentry/speakeasy/speakeasy.go b/vendor/github.com/bgentry/speakeasy/speakeasy.go new file mode 100644 index 0000000..71c1dd1 --- /dev/null +++ b/vendor/github.com/bgentry/speakeasy/speakeasy.go @@ -0,0 +1,49 @@ +package speakeasy + +import ( + "fmt" + "io" + "os" + "strings" +) + +// Ask the user to enter a password with input hidden. prompt is a string to +// display before the user's input. Returns the provided password, or an error +// if the command failed. +func Ask(prompt string) (password string, err error) { + return FAsk(os.Stdout, prompt) +} + +// FAsk is the same as Ask, except it is possible to specify the file to write +// the prompt to. If 'nil' is passed as the writer, no prompt will be written. +func FAsk(wr io.Writer, prompt string) (password string, err error) { + if wr != nil && prompt != "" { + fmt.Fprint(wr, prompt) // Display the prompt. + } + password, err = getPassword() + + // Carriage return after the user input. + if wr != nil { + fmt.Fprintln(wr, "") + } + return +} + +func readline() (value string, err error) { + var valb []byte + var n int + b := make([]byte, 1) + for { + // read one byte at a time so we don't accidentally read extra bytes + n, err = os.Stdin.Read(b) + if err != nil && err != io.EOF { + return "", err + } + if n == 0 || b[0] == '\n' { + break + } + valb = append(valb, b[0]) + } + + return strings.TrimSuffix(string(valb), "\r"), nil +} diff --git a/vendor/github.com/bgentry/speakeasy/speakeasy_unix.go b/vendor/github.com/bgentry/speakeasy/speakeasy_unix.go new file mode 100644 index 0000000..d99fda1 --- /dev/null +++ b/vendor/github.com/bgentry/speakeasy/speakeasy_unix.go @@ -0,0 +1,93 @@ +// based on https://code.google.com/p/gopass +// Author: johnsiilver@gmail.com (John Doak) +// +// Original code is based on code by RogerV in the golang-nuts thread: +// https://groups.google.com/group/golang-nuts/browse_thread/thread/40cc41e9d9fc9247 + +// +build darwin dragonfly freebsd linux netbsd openbsd solaris + +package speakeasy + +import ( + "fmt" + "os" + "os/signal" + "strings" + "syscall" +) + +const sttyArg0 = "/bin/stty" + +var ( + sttyArgvEOff = []string{"stty", "-echo"} + sttyArgvEOn = []string{"stty", "echo"} +) + +// getPassword gets input hidden from the terminal from a user. This is +// accomplished by turning off terminal echo, reading input from the user and +// finally turning on terminal echo. +func getPassword() (password string, err error) { + sig := make(chan os.Signal, 10) + brk := make(chan bool) + + // File descriptors for stdin, stdout, and stderr. + fd := []uintptr{os.Stdin.Fd(), os.Stdout.Fd(), os.Stderr.Fd()} + + // Setup notifications of termination signals to channel sig, create a process to + // watch for these signals so we can turn back on echo if need be. + signal.Notify(sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGKILL, syscall.SIGQUIT, + syscall.SIGTERM) + go catchSignal(fd, sig, brk) + + // Turn off the terminal echo. + pid, err := echoOff(fd) + if err != nil { + return "", err + } + + // Turn on the terminal echo and stop listening for signals. + defer signal.Stop(sig) + defer close(brk) + defer echoOn(fd) + + syscall.Wait4(pid, nil, 0, nil) + + line, err := readline() + if err == nil { + password = strings.TrimSpace(line) + } else { + err = fmt.Errorf("failed during password entry: %s", err) + } + + return password, err +} + +// echoOff turns off the terminal echo. +func echoOff(fd []uintptr) (int, error) { + pid, err := syscall.ForkExec(sttyArg0, sttyArgvEOff, &syscall.ProcAttr{Dir: "", Files: fd}) + if err != nil { + return 0, fmt.Errorf("failed turning off console echo for password entry:\n\t%s", err) + } + return pid, nil +} + +// echoOn turns back on the terminal echo. +func echoOn(fd []uintptr) { + // Turn on the terminal echo. + pid, e := syscall.ForkExec(sttyArg0, sttyArgvEOn, &syscall.ProcAttr{Dir: "", Files: fd}) + if e == nil { + syscall.Wait4(pid, nil, 0, nil) + } +} + +// catchSignal tries to catch SIGKILL, SIGQUIT and SIGINT so that we can turn +// terminal echo back on before the program ends. Otherwise the user is left +// with echo off on their terminal. +func catchSignal(fd []uintptr, sig chan os.Signal, brk chan bool) { + select { + case <-sig: + echoOn(fd) + os.Exit(-1) + case <-brk: + } +} diff --git a/vendor/github.com/bgentry/speakeasy/speakeasy_windows.go b/vendor/github.com/bgentry/speakeasy/speakeasy_windows.go new file mode 100644 index 0000000..c2093a8 --- /dev/null +++ b/vendor/github.com/bgentry/speakeasy/speakeasy_windows.go @@ -0,0 +1,41 @@ +// +build windows + +package speakeasy + +import ( + "syscall" +) + +// SetConsoleMode function can be used to change value of ENABLE_ECHO_INPUT: +// http://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx +const ENABLE_ECHO_INPUT = 0x0004 + +func getPassword() (password string, err error) { + var oldMode uint32 + + err = syscall.GetConsoleMode(syscall.Stdin, &oldMode) + if err != nil { + return + } + + var newMode uint32 = (oldMode &^ ENABLE_ECHO_INPUT) + + err = setConsoleMode(syscall.Stdin, newMode) + defer setConsoleMode(syscall.Stdin, oldMode) + if err != nil { + return + } + + return readline() +} + +func setConsoleMode(console syscall.Handle, mode uint32) (err error) { + dll := syscall.MustLoadDLL("kernel32") + proc := dll.MustFindProc("SetConsoleMode") + r, _, err := proc.Call(uintptr(console), uintptr(mode)) + + if r == 0 { + return err + } + return nil +} diff --git a/vendor/github.com/blang/semver/LICENSE b/vendor/github.com/blang/semver/LICENSE new file mode 100644 index 0000000..5ba5c86 --- /dev/null +++ b/vendor/github.com/blang/semver/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2014 Benedikt Lang + +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/blang/semver/README.md b/vendor/github.com/blang/semver/README.md new file mode 100644 index 0000000..08b2e4a --- /dev/null +++ b/vendor/github.com/blang/semver/README.md @@ -0,0 +1,194 @@ +semver for golang [![Build Status](https://travis-ci.org/blang/semver.svg?branch=master)](https://travis-ci.org/blang/semver) [![GoDoc](https://godoc.org/github.com/blang/semver?status.png)](https://godoc.org/github.com/blang/semver) [![Coverage Status](https://img.shields.io/coveralls/blang/semver.svg)](https://coveralls.io/r/blang/semver?branch=master) +====== + +semver is a [Semantic Versioning](http://semver.org/) library written in golang. It fully covers spec version `2.0.0`. + +Usage +----- +```bash +$ go get github.com/blang/semver +``` +Note: Always vendor your dependencies or fix on a specific version tag. + +```go +import github.com/blang/semver +v1, err := semver.Make("1.0.0-beta") +v2, err := semver.Make("2.0.0-beta") +v1.Compare(v2) +``` + +Also check the [GoDocs](http://godoc.org/github.com/blang/semver). + +Why should I use this lib? +----- + +- Fully spec compatible +- No reflection +- No regex +- Fully tested (Coverage >99%) +- Readable parsing/validation errors +- Fast (See [Benchmarks](#benchmarks)) +- Only Stdlib +- Uses values instead of pointers +- Many features, see below + + +Features +----- + +- Parsing and validation at all levels +- Comparator-like comparisons +- Compare Helper Methods +- InPlace manipulation +- Ranges `>=1.0.0 <2.0.0 || >=3.0.0 !3.0.1-beta.1` +- Wildcards `>=1.x`, `<=2.5.x` +- Sortable (implements sort.Interface) +- database/sql compatible (sql.Scanner/Valuer) +- encoding/json compatible (json.Marshaler/Unmarshaler) + +Ranges +------ + +A `Range` is a set of conditions which specify which versions satisfy the range. + +A condition is composed of an operator and a version. The supported operators are: + +- `<1.0.0` Less than `1.0.0` +- `<=1.0.0` Less than or equal to `1.0.0` +- `>1.0.0` Greater than `1.0.0` +- `>=1.0.0` Greater than or equal to `1.0.0` +- `1.0.0`, `=1.0.0`, `==1.0.0` Equal to `1.0.0` +- `!1.0.0`, `!=1.0.0` Not equal to `1.0.0`. Excludes version `1.0.0`. + +Note that spaces between the operator and the version will be gracefully tolerated. + +A `Range` can link multiple `Ranges` separated by space: + +Ranges can be linked by logical AND: + + - `>1.0.0 <2.0.0` would match between both ranges, so `1.1.1` and `1.8.7` but not `1.0.0` or `2.0.0` + - `>1.0.0 <3.0.0 !2.0.3-beta.2` would match every version between `1.0.0` and `3.0.0` except `2.0.3-beta.2` + +Ranges can also be linked by logical OR: + + - `<2.0.0 || >=3.0.0` would match `1.x.x` and `3.x.x` but not `2.x.x` + +AND has a higher precedence than OR. It's not possible to use brackets. + +Ranges can be combined by both AND and OR + + - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1` + +Range usage: + +``` +v, err := semver.Parse("1.2.3") +range, err := semver.ParseRange(">1.0.0 <2.0.0 || >=3.0.0") +if range(v) { + //valid +} + +``` + +Example +----- + +Have a look at full examples in [examples/main.go](examples/main.go) + +```go +import github.com/blang/semver + +v, err := semver.Make("0.0.1-alpha.preview+123.github") +fmt.Printf("Major: %d\n", v.Major) +fmt.Printf("Minor: %d\n", v.Minor) +fmt.Printf("Patch: %d\n", v.Patch) +fmt.Printf("Pre: %s\n", v.Pre) +fmt.Printf("Build: %s\n", v.Build) + +// Prerelease versions array +if len(v.Pre) > 0 { + fmt.Println("Prerelease versions:") + for i, pre := range v.Pre { + fmt.Printf("%d: %q\n", i, pre) + } +} + +// Build meta data array +if len(v.Build) > 0 { + fmt.Println("Build meta data:") + for i, build := range v.Build { + fmt.Printf("%d: %q\n", i, build) + } +} + +v001, err := semver.Make("0.0.1") +// Compare using helpers: v.GT(v2), v.LT, v.GTE, v.LTE +v001.GT(v) == true +v.LT(v001) == true +v.GTE(v) == true +v.LTE(v) == true + +// Or use v.Compare(v2) for comparisons (-1, 0, 1): +v001.Compare(v) == 1 +v.Compare(v001) == -1 +v.Compare(v) == 0 + +// Manipulate Version in place: +v.Pre[0], err = semver.NewPRVersion("beta") +if err != nil { + fmt.Printf("Error parsing pre release version: %q", err) +} + +fmt.Println("\nValidate versions:") +v.Build[0] = "?" + +err = v.Validate() +if err != nil { + fmt.Printf("Validation failed: %s\n", err) +} +``` + + +Benchmarks +----- + + BenchmarkParseSimple-4 5000000 390 ns/op 48 B/op 1 allocs/op + BenchmarkParseComplex-4 1000000 1813 ns/op 256 B/op 7 allocs/op + BenchmarkParseAverage-4 1000000 1171 ns/op 163 B/op 4 allocs/op + BenchmarkStringSimple-4 20000000 119 ns/op 16 B/op 1 allocs/op + BenchmarkStringLarger-4 10000000 206 ns/op 32 B/op 2 allocs/op + BenchmarkStringComplex-4 5000000 324 ns/op 80 B/op 3 allocs/op + BenchmarkStringAverage-4 5000000 273 ns/op 53 B/op 2 allocs/op + BenchmarkValidateSimple-4 200000000 9.33 ns/op 0 B/op 0 allocs/op + BenchmarkValidateComplex-4 3000000 469 ns/op 0 B/op 0 allocs/op + BenchmarkValidateAverage-4 5000000 256 ns/op 0 B/op 0 allocs/op + BenchmarkCompareSimple-4 100000000 11.8 ns/op 0 B/op 0 allocs/op + BenchmarkCompareComplex-4 50000000 30.8 ns/op 0 B/op 0 allocs/op + BenchmarkCompareAverage-4 30000000 41.5 ns/op 0 B/op 0 allocs/op + BenchmarkSort-4 3000000 419 ns/op 256 B/op 2 allocs/op + BenchmarkRangeParseSimple-4 2000000 850 ns/op 192 B/op 5 allocs/op + BenchmarkRangeParseAverage-4 1000000 1677 ns/op 400 B/op 10 allocs/op + BenchmarkRangeParseComplex-4 300000 5214 ns/op 1440 B/op 30 allocs/op + BenchmarkRangeMatchSimple-4 50000000 25.6 ns/op 0 B/op 0 allocs/op + BenchmarkRangeMatchAverage-4 30000000 56.4 ns/op 0 B/op 0 allocs/op + BenchmarkRangeMatchComplex-4 10000000 153 ns/op 0 B/op 0 allocs/op + +See benchmark cases at [semver_test.go](semver_test.go) + + +Motivation +----- + +I simply couldn't find any lib supporting the full spec. Others were just wrong or used reflection and regex which i don't like. + + +Contribution +----- + +Feel free to make a pull request. For bigger changes create a issue first to discuss about it. + + +License +----- + +See [LICENSE](LICENSE) file. diff --git a/vendor/github.com/blang/semver/json.go b/vendor/github.com/blang/semver/json.go new file mode 100644 index 0000000..a74bf7c --- /dev/null +++ b/vendor/github.com/blang/semver/json.go @@ -0,0 +1,23 @@ +package semver + +import ( + "encoding/json" +) + +// MarshalJSON implements the encoding/json.Marshaler interface. +func (v Version) MarshalJSON() ([]byte, error) { + return json.Marshal(v.String()) +} + +// UnmarshalJSON implements the encoding/json.Unmarshaler interface. +func (v *Version) UnmarshalJSON(data []byte) (err error) { + var versionString string + + if err = json.Unmarshal(data, &versionString); err != nil { + return + } + + *v, err = Parse(versionString) + + return +} diff --git a/vendor/github.com/blang/semver/package.json b/vendor/github.com/blang/semver/package.json new file mode 100644 index 0000000..1cf8ebd --- /dev/null +++ b/vendor/github.com/blang/semver/package.json @@ -0,0 +1,17 @@ +{ + "author": "blang", + "bugs": { + "URL": "https://github.com/blang/semver/issues", + "url": "https://github.com/blang/semver/issues" + }, + "gx": { + "dvcsimport": "github.com/blang/semver" + }, + "gxVersion": "0.10.0", + "language": "go", + "license": "MIT", + "name": "semver", + "releaseCmd": "git commit -a -m \"gx publish $VERSION\"", + "version": "3.5.1" +} + diff --git a/vendor/github.com/blang/semver/range.go b/vendor/github.com/blang/semver/range.go new file mode 100644 index 0000000..fca406d --- /dev/null +++ b/vendor/github.com/blang/semver/range.go @@ -0,0 +1,416 @@ +package semver + +import ( + "fmt" + "strconv" + "strings" + "unicode" +) + +type wildcardType int + +const ( + noneWildcard wildcardType = iota + majorWildcard wildcardType = 1 + minorWildcard wildcardType = 2 + patchWildcard wildcardType = 3 +) + +func wildcardTypefromInt(i int) wildcardType { + switch i { + case 1: + return majorWildcard + case 2: + return minorWildcard + case 3: + return patchWildcard + default: + return noneWildcard + } +} + +type comparator func(Version, Version) bool + +var ( + compEQ comparator = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) == 0 + } + compNE = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) != 0 + } + compGT = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) == 1 + } + compGE = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) >= 0 + } + compLT = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) == -1 + } + compLE = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) <= 0 + } +) + +type versionRange struct { + v Version + c comparator +} + +// rangeFunc creates a Range from the given versionRange. +func (vr *versionRange) rangeFunc() Range { + return Range(func(v Version) bool { + return vr.c(v, vr.v) + }) +} + +// Range represents a range of versions. +// A Range can be used to check if a Version satisfies it: +// +// range, err := semver.ParseRange(">1.0.0 <2.0.0") +// range(semver.MustParse("1.1.1") // returns true +type Range func(Version) bool + +// OR combines the existing Range with another Range using logical OR. +func (rf Range) OR(f Range) Range { + return Range(func(v Version) bool { + return rf(v) || f(v) + }) +} + +// AND combines the existing Range with another Range using logical AND. +func (rf Range) AND(f Range) Range { + return Range(func(v Version) bool { + return rf(v) && f(v) + }) +} + +// ParseRange parses a range and returns a Range. +// If the range could not be parsed an error is returned. +// +// Valid ranges are: +// - "<1.0.0" +// - "<=1.0.0" +// - ">1.0.0" +// - ">=1.0.0" +// - "1.0.0", "=1.0.0", "==1.0.0" +// - "!1.0.0", "!=1.0.0" +// +// A Range can consist of multiple ranges separated by space: +// Ranges can be linked by logical AND: +// - ">1.0.0 <2.0.0" would match between both ranges, so "1.1.1" and "1.8.7" but not "1.0.0" or "2.0.0" +// - ">1.0.0 <3.0.0 !2.0.3-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2 +// +// Ranges can also be linked by logical OR: +// - "<2.0.0 || >=3.0.0" would match "1.x.x" and "3.x.x" but not "2.x.x" +// +// AND has a higher precedence than OR. It's not possible to use brackets. +// +// Ranges can be combined by both AND and OR +// +// - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1` +func ParseRange(s string) (Range, error) { + parts := splitAndTrim(s) + orParts, err := splitORParts(parts) + if err != nil { + return nil, err + } + expandedParts, err := expandWildcardVersion(orParts) + if err != nil { + return nil, err + } + var orFn Range + for _, p := range expandedParts { + var andFn Range + for _, ap := range p { + opStr, vStr, err := splitComparatorVersion(ap) + if err != nil { + return nil, err + } + vr, err := buildVersionRange(opStr, vStr) + if err != nil { + return nil, fmt.Errorf("Could not parse Range %q: %s", ap, err) + } + rf := vr.rangeFunc() + + // Set function + if andFn == nil { + andFn = rf + } else { // Combine with existing function + andFn = andFn.AND(rf) + } + } + if orFn == nil { + orFn = andFn + } else { + orFn = orFn.OR(andFn) + } + + } + return orFn, nil +} + +// splitORParts splits the already cleaned parts by '||'. +// Checks for invalid positions of the operator and returns an +// error if found. +func splitORParts(parts []string) ([][]string, error) { + var ORparts [][]string + last := 0 + for i, p := range parts { + if p == "||" { + if i == 0 { + return nil, fmt.Errorf("First element in range is '||'") + } + ORparts = append(ORparts, parts[last:i]) + last = i + 1 + } + } + if last == len(parts) { + return nil, fmt.Errorf("Last element in range is '||'") + } + ORparts = append(ORparts, parts[last:]) + return ORparts, nil +} + +// buildVersionRange takes a slice of 2: operator and version +// and builds a versionRange, otherwise an error. +func buildVersionRange(opStr, vStr string) (*versionRange, error) { + c := parseComparator(opStr) + if c == nil { + return nil, fmt.Errorf("Could not parse comparator %q in %q", opStr, strings.Join([]string{opStr, vStr}, "")) + } + v, err := Parse(vStr) + if err != nil { + return nil, fmt.Errorf("Could not parse version %q in %q: %s", vStr, strings.Join([]string{opStr, vStr}, ""), err) + } + + return &versionRange{ + v: v, + c: c, + }, nil + +} + +// inArray checks if a byte is contained in an array of bytes +func inArray(s byte, list []byte) bool { + for _, el := range list { + if el == s { + return true + } + } + return false +} + +// splitAndTrim splits a range string by spaces and cleans whitespaces +func splitAndTrim(s string) (result []string) { + last := 0 + var lastChar byte + excludeFromSplit := []byte{'>', '<', '='} + for i := 0; i < len(s); i++ { + if s[i] == ' ' && !inArray(lastChar, excludeFromSplit) { + if last < i-1 { + result = append(result, s[last:i]) + } + last = i + 1 + } else if s[i] != ' ' { + lastChar = s[i] + } + } + if last < len(s)-1 { + result = append(result, s[last:]) + } + + for i, v := range result { + result[i] = strings.Replace(v, " ", "", -1) + } + + // parts := strings.Split(s, " ") + // for _, x := range parts { + // if s := strings.TrimSpace(x); len(s) != 0 { + // result = append(result, s) + // } + // } + return +} + +// splitComparatorVersion splits the comparator from the version. +// Input must be free of leading or trailing spaces. +func splitComparatorVersion(s string) (string, string, error) { + i := strings.IndexFunc(s, unicode.IsDigit) + if i == -1 { + return "", "", fmt.Errorf("Could not get version from string: %q", s) + } + return strings.TrimSpace(s[0:i]), s[i:], nil +} + +// getWildcardType will return the type of wildcard that the +// passed version contains +func getWildcardType(vStr string) wildcardType { + parts := strings.Split(vStr, ".") + nparts := len(parts) + wildcard := parts[nparts-1] + + possibleWildcardType := wildcardTypefromInt(nparts) + if wildcard == "x" { + return possibleWildcardType + } + + return noneWildcard +} + +// createVersionFromWildcard will convert a wildcard version +// into a regular version, replacing 'x's with '0's, handling +// special cases like '1.x.x' and '1.x' +func createVersionFromWildcard(vStr string) string { + // handle 1.x.x + vStr2 := strings.Replace(vStr, ".x.x", ".x", 1) + vStr2 = strings.Replace(vStr2, ".x", ".0", 1) + parts := strings.Split(vStr2, ".") + + // handle 1.x + if len(parts) == 2 { + return vStr2 + ".0" + } + + return vStr2 +} + +// incrementMajorVersion will increment the major version +// of the passed version +func incrementMajorVersion(vStr string) (string, error) { + parts := strings.Split(vStr, ".") + i, err := strconv.Atoi(parts[0]) + if err != nil { + return "", err + } + parts[0] = strconv.Itoa(i + 1) + + return strings.Join(parts, "."), nil +} + +// incrementMajorVersion will increment the minor version +// of the passed version +func incrementMinorVersion(vStr string) (string, error) { + parts := strings.Split(vStr, ".") + i, err := strconv.Atoi(parts[1]) + if err != nil { + return "", err + } + parts[1] = strconv.Itoa(i + 1) + + return strings.Join(parts, "."), nil +} + +// expandWildcardVersion will expand wildcards inside versions +// following these rules: +// +// * when dealing with patch wildcards: +// >= 1.2.x will become >= 1.2.0 +// <= 1.2.x will become < 1.3.0 +// > 1.2.x will become >= 1.3.0 +// < 1.2.x will become < 1.2.0 +// != 1.2.x will become < 1.2.0 >= 1.3.0 +// +// * when dealing with minor wildcards: +// >= 1.x will become >= 1.0.0 +// <= 1.x will become < 2.0.0 +// > 1.x will become >= 2.0.0 +// < 1.0 will become < 1.0.0 +// != 1.x will become < 1.0.0 >= 2.0.0 +// +// * when dealing with wildcards without +// version operator: +// 1.2.x will become >= 1.2.0 < 1.3.0 +// 1.x will become >= 1.0.0 < 2.0.0 +func expandWildcardVersion(parts [][]string) ([][]string, error) { + var expandedParts [][]string + for _, p := range parts { + var newParts []string + for _, ap := range p { + if strings.Index(ap, "x") != -1 { + opStr, vStr, err := splitComparatorVersion(ap) + if err != nil { + return nil, err + } + + versionWildcardType := getWildcardType(vStr) + flatVersion := createVersionFromWildcard(vStr) + + var resultOperator string + var shouldIncrementVersion bool + switch opStr { + case ">": + resultOperator = ">=" + shouldIncrementVersion = true + case ">=": + resultOperator = ">=" + case "<": + resultOperator = "<" + case "<=": + resultOperator = "<" + shouldIncrementVersion = true + case "", "=", "==": + newParts = append(newParts, ">="+flatVersion) + resultOperator = "<" + shouldIncrementVersion = true + case "!=", "!": + newParts = append(newParts, "<"+flatVersion) + resultOperator = ">=" + shouldIncrementVersion = true + } + + var resultVersion string + if shouldIncrementVersion { + switch versionWildcardType { + case patchWildcard: + resultVersion, _ = incrementMinorVersion(flatVersion) + case minorWildcard: + resultVersion, _ = incrementMajorVersion(flatVersion) + } + } else { + resultVersion = flatVersion + } + + ap = resultOperator + resultVersion + } + newParts = append(newParts, ap) + } + expandedParts = append(expandedParts, newParts) + } + + return expandedParts, nil +} + +func parseComparator(s string) comparator { + switch s { + case "==": + fallthrough + case "": + fallthrough + case "=": + return compEQ + case ">": + return compGT + case ">=": + return compGE + case "<": + return compLT + case "<=": + return compLE + case "!": + fallthrough + case "!=": + return compNE + } + + return nil +} + +// MustParseRange is like ParseRange but panics if the range cannot be parsed. +func MustParseRange(s string) Range { + r, err := ParseRange(s) + if err != nil { + panic(`semver: ParseRange(` + s + `): ` + err.Error()) + } + return r +} diff --git a/vendor/github.com/blang/semver/semver.go b/vendor/github.com/blang/semver/semver.go new file mode 100644 index 0000000..8ee0842 --- /dev/null +++ b/vendor/github.com/blang/semver/semver.go @@ -0,0 +1,418 @@ +package semver + +import ( + "errors" + "fmt" + "strconv" + "strings" +) + +const ( + numbers string = "0123456789" + alphas = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + alphanum = alphas + numbers +) + +// SpecVersion is the latest fully supported spec version of semver +var SpecVersion = Version{ + Major: 2, + Minor: 0, + Patch: 0, +} + +// Version represents a semver compatible version +type Version struct { + Major uint64 + Minor uint64 + Patch uint64 + Pre []PRVersion + Build []string //No Precendence +} + +// Version to string +func (v Version) String() string { + b := make([]byte, 0, 5) + b = strconv.AppendUint(b, v.Major, 10) + b = append(b, '.') + b = strconv.AppendUint(b, v.Minor, 10) + b = append(b, '.') + b = strconv.AppendUint(b, v.Patch, 10) + + if len(v.Pre) > 0 { + b = append(b, '-') + b = append(b, v.Pre[0].String()...) + + for _, pre := range v.Pre[1:] { + b = append(b, '.') + b = append(b, pre.String()...) + } + } + + if len(v.Build) > 0 { + b = append(b, '+') + b = append(b, v.Build[0]...) + + for _, build := range v.Build[1:] { + b = append(b, '.') + b = append(b, build...) + } + } + + return string(b) +} + +// Equals checks if v is equal to o. +func (v Version) Equals(o Version) bool { + return (v.Compare(o) == 0) +} + +// EQ checks if v is equal to o. +func (v Version) EQ(o Version) bool { + return (v.Compare(o) == 0) +} + +// NE checks if v is not equal to o. +func (v Version) NE(o Version) bool { + return (v.Compare(o) != 0) +} + +// GT checks if v is greater than o. +func (v Version) GT(o Version) bool { + return (v.Compare(o) == 1) +} + +// GTE checks if v is greater than or equal to o. +func (v Version) GTE(o Version) bool { + return (v.Compare(o) >= 0) +} + +// GE checks if v is greater than or equal to o. +func (v Version) GE(o Version) bool { + return (v.Compare(o) >= 0) +} + +// LT checks if v is less than o. +func (v Version) LT(o Version) bool { + return (v.Compare(o) == -1) +} + +// LTE checks if v is less than or equal to o. +func (v Version) LTE(o Version) bool { + return (v.Compare(o) <= 0) +} + +// LE checks if v is less than or equal to o. +func (v Version) LE(o Version) bool { + return (v.Compare(o) <= 0) +} + +// Compare compares Versions v to o: +// -1 == v is less than o +// 0 == v is equal to o +// 1 == v is greater than o +func (v Version) Compare(o Version) int { + if v.Major != o.Major { + if v.Major > o.Major { + return 1 + } + return -1 + } + if v.Minor != o.Minor { + if v.Minor > o.Minor { + return 1 + } + return -1 + } + if v.Patch != o.Patch { + if v.Patch > o.Patch { + return 1 + } + return -1 + } + + // Quick comparison if a version has no prerelease versions + if len(v.Pre) == 0 && len(o.Pre) == 0 { + return 0 + } else if len(v.Pre) == 0 && len(o.Pre) > 0 { + return 1 + } else if len(v.Pre) > 0 && len(o.Pre) == 0 { + return -1 + } + + i := 0 + for ; i < len(v.Pre) && i < len(o.Pre); i++ { + if comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 { + continue + } else if comp == 1 { + return 1 + } else { + return -1 + } + } + + // If all pr versions are the equal but one has further prversion, this one greater + if i == len(v.Pre) && i == len(o.Pre) { + return 0 + } else if i == len(v.Pre) && i < len(o.Pre) { + return -1 + } else { + return 1 + } + +} + +// Validate validates v and returns error in case +func (v Version) Validate() error { + // Major, Minor, Patch already validated using uint64 + + for _, pre := range v.Pre { + if !pre.IsNum { //Numeric prerelease versions already uint64 + if len(pre.VersionStr) == 0 { + return fmt.Errorf("Prerelease can not be empty %q", pre.VersionStr) + } + if !containsOnly(pre.VersionStr, alphanum) { + return fmt.Errorf("Invalid character(s) found in prerelease %q", pre.VersionStr) + } + } + } + + for _, build := range v.Build { + if len(build) == 0 { + return fmt.Errorf("Build meta data can not be empty %q", build) + } + if !containsOnly(build, alphanum) { + return fmt.Errorf("Invalid character(s) found in build meta data %q", build) + } + } + + return nil +} + +// New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error +func New(s string) (vp *Version, err error) { + v, err := Parse(s) + vp = &v + return +} + +// Make is an alias for Parse, parses version string and returns a validated Version or error +func Make(s string) (Version, error) { + return Parse(s) +} + +// ParseTolerant allows for certain version specifications that do not strictly adhere to semver +// specs to be parsed by this library. It does so by normalizing versions before passing them to +// Parse(). It currently trims spaces, removes a "v" prefix, and adds a 0 patch number to versions +// with only major and minor components specified +func ParseTolerant(s string) (Version, error) { + s = strings.TrimSpace(s) + s = strings.TrimPrefix(s, "v") + + // Split into major.minor.(patch+pr+meta) + parts := strings.SplitN(s, ".", 3) + if len(parts) < 3 { + if strings.ContainsAny(parts[len(parts)-1], "+-") { + return Version{}, errors.New("Short version cannot contain PreRelease/Build meta data") + } + for len(parts) < 3 { + parts = append(parts, "0") + } + s = strings.Join(parts, ".") + } + + return Parse(s) +} + +// Parse parses version string and returns a validated Version or error +func Parse(s string) (Version, error) { + if len(s) == 0 { + return Version{}, errors.New("Version string empty") + } + + // Split into major.minor.(patch+pr+meta) + parts := strings.SplitN(s, ".", 3) + if len(parts) != 3 { + return Version{}, errors.New("No Major.Minor.Patch elements found") + } + + // Major + if !containsOnly(parts[0], numbers) { + return Version{}, fmt.Errorf("Invalid character(s) found in major number %q", parts[0]) + } + if hasLeadingZeroes(parts[0]) { + return Version{}, fmt.Errorf("Major number must not contain leading zeroes %q", parts[0]) + } + major, err := strconv.ParseUint(parts[0], 10, 64) + if err != nil { + return Version{}, err + } + + // Minor + if !containsOnly(parts[1], numbers) { + return Version{}, fmt.Errorf("Invalid character(s) found in minor number %q", parts[1]) + } + if hasLeadingZeroes(parts[1]) { + return Version{}, fmt.Errorf("Minor number must not contain leading zeroes %q", parts[1]) + } + minor, err := strconv.ParseUint(parts[1], 10, 64) + if err != nil { + return Version{}, err + } + + v := Version{} + v.Major = major + v.Minor = minor + + var build, prerelease []string + patchStr := parts[2] + + if buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 { + build = strings.Split(patchStr[buildIndex+1:], ".") + patchStr = patchStr[:buildIndex] + } + + if preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 { + prerelease = strings.Split(patchStr[preIndex+1:], ".") + patchStr = patchStr[:preIndex] + } + + if !containsOnly(patchStr, numbers) { + return Version{}, fmt.Errorf("Invalid character(s) found in patch number %q", patchStr) + } + if hasLeadingZeroes(patchStr) { + return Version{}, fmt.Errorf("Patch number must not contain leading zeroes %q", patchStr) + } + patch, err := strconv.ParseUint(patchStr, 10, 64) + if err != nil { + return Version{}, err + } + + v.Patch = patch + + // Prerelease + for _, prstr := range prerelease { + parsedPR, err := NewPRVersion(prstr) + if err != nil { + return Version{}, err + } + v.Pre = append(v.Pre, parsedPR) + } + + // Build meta data + for _, str := range build { + if len(str) == 0 { + return Version{}, errors.New("Build meta data is empty") + } + if !containsOnly(str, alphanum) { + return Version{}, fmt.Errorf("Invalid character(s) found in build meta data %q", str) + } + v.Build = append(v.Build, str) + } + + return v, nil +} + +// MustParse is like Parse but panics if the version cannot be parsed. +func MustParse(s string) Version { + v, err := Parse(s) + if err != nil { + panic(`semver: Parse(` + s + `): ` + err.Error()) + } + return v +} + +// PRVersion represents a PreRelease Version +type PRVersion struct { + VersionStr string + VersionNum uint64 + IsNum bool +} + +// NewPRVersion creates a new valid prerelease version +func NewPRVersion(s string) (PRVersion, error) { + if len(s) == 0 { + return PRVersion{}, errors.New("Prerelease is empty") + } + v := PRVersion{} + if containsOnly(s, numbers) { + if hasLeadingZeroes(s) { + return PRVersion{}, fmt.Errorf("Numeric PreRelease version must not contain leading zeroes %q", s) + } + num, err := strconv.ParseUint(s, 10, 64) + + // Might never be hit, but just in case + if err != nil { + return PRVersion{}, err + } + v.VersionNum = num + v.IsNum = true + } else if containsOnly(s, alphanum) { + v.VersionStr = s + v.IsNum = false + } else { + return PRVersion{}, fmt.Errorf("Invalid character(s) found in prerelease %q", s) + } + return v, nil +} + +// IsNumeric checks if prerelease-version is numeric +func (v PRVersion) IsNumeric() bool { + return v.IsNum +} + +// Compare compares two PreRelease Versions v and o: +// -1 == v is less than o +// 0 == v is equal to o +// 1 == v is greater than o +func (v PRVersion) Compare(o PRVersion) int { + if v.IsNum && !o.IsNum { + return -1 + } else if !v.IsNum && o.IsNum { + return 1 + } else if v.IsNum && o.IsNum { + if v.VersionNum == o.VersionNum { + return 0 + } else if v.VersionNum > o.VersionNum { + return 1 + } else { + return -1 + } + } else { // both are Alphas + if v.VersionStr == o.VersionStr { + return 0 + } else if v.VersionStr > o.VersionStr { + return 1 + } else { + return -1 + } + } +} + +// PreRelease version to string +func (v PRVersion) String() string { + if v.IsNum { + return strconv.FormatUint(v.VersionNum, 10) + } + return v.VersionStr +} + +func containsOnly(s string, set string) bool { + return strings.IndexFunc(s, func(r rune) bool { + return !strings.ContainsRune(set, r) + }) == -1 +} + +func hasLeadingZeroes(s string) bool { + return len(s) > 1 && s[0] == '0' +} + +// NewBuildVersion creates a new valid build version +func NewBuildVersion(s string) (string, error) { + if len(s) == 0 { + return "", errors.New("Buildversion is empty") + } + if !containsOnly(s, alphanum) { + return "", fmt.Errorf("Invalid character(s) found in build meta data %q", s) + } + return s, nil +} diff --git a/vendor/github.com/blang/semver/sort.go b/vendor/github.com/blang/semver/sort.go new file mode 100644 index 0000000..e18f880 --- /dev/null +++ b/vendor/github.com/blang/semver/sort.go @@ -0,0 +1,28 @@ +package semver + +import ( + "sort" +) + +// Versions represents multiple versions. +type Versions []Version + +// Len returns length of version collection +func (s Versions) Len() int { + return len(s) +} + +// Swap swaps two versions inside the collection by its indices +func (s Versions) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +// Less checks if version at index i is less than version at index j +func (s Versions) Less(i, j int) bool { + return s[i].LT(s[j]) +} + +// Sort sorts a slice of versions +func Sort(versions []Version) { + sort.Sort(Versions(versions)) +} diff --git a/vendor/github.com/blang/semver/sql.go b/vendor/github.com/blang/semver/sql.go new file mode 100644 index 0000000..eb4d802 --- /dev/null +++ b/vendor/github.com/blang/semver/sql.go @@ -0,0 +1,30 @@ +package semver + +import ( + "database/sql/driver" + "fmt" +) + +// Scan implements the database/sql.Scanner interface. +func (v *Version) Scan(src interface{}) (err error) { + var str string + switch src := src.(type) { + case string: + str = src + case []byte: + str = string(src) + default: + return fmt.Errorf("Version.Scan: cannot convert %T to string.", src) + } + + if t, err := Parse(str); err == nil { + *v = t + } + + return +} + +// Value implements the database/sql/driver.Valuer interface. +func (v Version) Value() (driver.Value, error) { + return v.String(), nil +} diff --git a/vendor/github.com/golang/protobuf/proto/encode.go b/vendor/github.com/golang/protobuf/proto/encode.go index 2b30f84..8b84d1b 100644 --- a/vendor/github.com/golang/protobuf/proto/encode.go +++ b/vendor/github.com/golang/protobuf/proto/encode.go @@ -174,11 +174,11 @@ func sizeFixed32(x uint64) int { // This is the format used for the sint64 protocol buffer type. func (p *Buffer) EncodeZigzag64(x uint64) error { // use signed number to get arithmetic right shift. - return p.EncodeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return p.EncodeVarint((x << 1) ^ uint64((int64(x) >> 63))) } func sizeZigzag64(x uint64) int { - return sizeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return sizeVarint((x << 1) ^ uint64((int64(x) >> 63))) } // EncodeZigzag32 writes a zigzag-encoded 32-bit integer diff --git a/vendor/github.com/golang/protobuf/proto/lib.go b/vendor/github.com/golang/protobuf/proto/lib.go index ac4ddbc..1c22550 100644 --- a/vendor/github.com/golang/protobuf/proto/lib.go +++ b/vendor/github.com/golang/protobuf/proto/lib.go @@ -73,7 +73,6 @@ for a protocol buffer variable v: When the .proto file specifies `syntax="proto3"`, there are some differences: - Non-repeated fields of non-message type are values instead of pointers. - - Getters are only generated for message and oneof fields. - Enum types do not get an Enum method. The simplest way to describe this is to see an example. diff --git a/vendor/github.com/golang/protobuf/proto/text_parser.go b/vendor/github.com/golang/protobuf/proto/text_parser.go index 61f83c1..5e14513 100644 --- a/vendor/github.com/golang/protobuf/proto/text_parser.go +++ b/vendor/github.com/golang/protobuf/proto/text_parser.go @@ -865,7 +865,7 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error { return p.readStruct(fv, terminator) case reflect.Uint32: if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil { - fv.SetUint(uint64(x)) + fv.SetUint(x) return nil } case reflect.Uint64: diff --git a/vendor/github.com/golang/protobuf/ptypes/any.go b/vendor/github.com/golang/protobuf/ptypes/any.go new file mode 100644 index 0000000..b2af97f --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/any.go @@ -0,0 +1,139 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2016 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package ptypes + +// This file implements functions to marshal proto.Message to/from +// google.protobuf.Any message. + +import ( + "fmt" + "reflect" + "strings" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes/any" +) + +const googleApis = "type.googleapis.com/" + +// AnyMessageName returns the name of the message contained in a google.protobuf.Any message. +// +// Note that regular type assertions should be done using the Is +// function. AnyMessageName is provided for less common use cases like filtering a +// sequence of Any messages based on a set of allowed message type names. +func AnyMessageName(any *any.Any) (string, error) { + if any == nil { + return "", fmt.Errorf("message is nil") + } + slash := strings.LastIndex(any.TypeUrl, "/") + if slash < 0 { + return "", fmt.Errorf("message type url %q is invalid", any.TypeUrl) + } + return any.TypeUrl[slash+1:], nil +} + +// MarshalAny takes the protocol buffer and encodes it into google.protobuf.Any. +func MarshalAny(pb proto.Message) (*any.Any, error) { + value, err := proto.Marshal(pb) + if err != nil { + return nil, err + } + return &any.Any{TypeUrl: googleApis + proto.MessageName(pb), Value: value}, nil +} + +// DynamicAny is a value that can be passed to UnmarshalAny to automatically +// allocate a proto.Message for the type specified in a google.protobuf.Any +// message. The allocated message is stored in the embedded proto.Message. +// +// Example: +// +// var x ptypes.DynamicAny +// if err := ptypes.UnmarshalAny(a, &x); err != nil { ... } +// fmt.Printf("unmarshaled message: %v", x.Message) +type DynamicAny struct { + proto.Message +} + +// Empty returns a new proto.Message of the type specified in a +// google.protobuf.Any message. It returns an error if corresponding message +// type isn't linked in. +func Empty(any *any.Any) (proto.Message, error) { + aname, err := AnyMessageName(any) + if err != nil { + return nil, err + } + + t := proto.MessageType(aname) + if t == nil { + return nil, fmt.Errorf("any: message type %q isn't linked in", aname) + } + return reflect.New(t.Elem()).Interface().(proto.Message), nil +} + +// UnmarshalAny parses the protocol buffer representation in a google.protobuf.Any +// message and places the decoded result in pb. It returns an error if type of +// contents of Any message does not match type of pb message. +// +// pb can be a proto.Message, or a *DynamicAny. +func UnmarshalAny(any *any.Any, pb proto.Message) error { + if d, ok := pb.(*DynamicAny); ok { + if d.Message == nil { + var err error + d.Message, err = Empty(any) + if err != nil { + return err + } + } + return UnmarshalAny(any, d.Message) + } + + aname, err := AnyMessageName(any) + if err != nil { + return err + } + + mname := proto.MessageName(pb) + if aname != mname { + return fmt.Errorf("mismatched message type: got %q want %q", aname, mname) + } + return proto.Unmarshal(any.Value, pb) +} + +// Is returns true if any value contains a given message type. +func Is(any *any.Any, pb proto.Message) bool { + aname, err := AnyMessageName(any) + if err != nil { + return false + } + + return aname == proto.MessageName(pb) +} diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go new file mode 100644 index 0000000..f346017 --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/protobuf/any.proto + +/* +Package any is a generated protocol buffer package. + +It is generated from these files: + google/protobuf/any.proto + +It has these top-level messages: + Any +*/ +package any + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := ptypes.MarshalAny(foo) +// ... +// foo := &pb.Foo{} +// if err := ptypes.UnmarshalAny(any, foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +type Any struct { + // A URL/resource name whose content describes the type of the + // serialized protocol buffer message. + // + // For URLs which use the scheme `http`, `https`, or no scheme, the + // following restrictions and interpretations apply: + // + // * If no scheme is provided, `https` is assumed. + // * The last segment of the URL's path must represent the fully + // qualified name of the type (as in `path/google.protobuf.Duration`). + // The name should be in a canonical form (e.g., leading "." is + // not accepted). + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"` + // Must be a valid serialized protocol buffer of the above specified type. + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Any) Reset() { *m = Any{} } +func (m *Any) String() string { return proto.CompactTextString(m) } +func (*Any) ProtoMessage() {} +func (*Any) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*Any) XXX_WellKnownType() string { return "Any" } + +func (m *Any) GetTypeUrl() string { + if m != nil { + return m.TypeUrl + } + return "" +} + +func (m *Any) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func init() { + proto.RegisterType((*Any)(nil), "google.protobuf.Any") +} + +func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 185 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4, + 0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x25, 0x33, 0x2e, 0x66, 0xc7, 0xbc, 0x4a, + 0x21, 0x49, 0x2e, 0x8e, 0x92, 0xca, 0x82, 0xd4, 0xf8, 0xd2, 0xa2, 0x1c, 0x09, 0x46, 0x05, 0x46, + 0x0d, 0xce, 0x20, 0x76, 0x10, 0x3f, 0xb4, 0x28, 0x47, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, + 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc2, 0x71, 0xca, 0xe7, 0x12, 0x4e, 0xce, + 0xcf, 0xd5, 0x43, 0x33, 0xce, 0x89, 0xc3, 0x31, 0xaf, 0x32, 0x00, 0xc4, 0x09, 0x60, 0x8c, 0x52, + 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, + 0x4b, 0x47, 0xb8, 0xa8, 0x00, 0x64, 0x7a, 0x31, 0xc8, 0x61, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c, + 0x56, 0x31, 0xc9, 0xb9, 0x43, 0x8c, 0x0a, 0x80, 0x2a, 0xd1, 0x0b, 0x4f, 0xcd, 0xc9, 0xf1, 0xce, + 0xcb, 0x2f, 0xcf, 0x0b, 0x01, 0x29, 0x4d, 0x62, 0x03, 0xeb, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, + 0xff, 0x13, 0xf8, 0xe8, 0x42, 0xdd, 0x00, 0x00, 0x00, +} diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.proto b/vendor/github.com/golang/protobuf/ptypes/any/any.proto new file mode 100644 index 0000000..c748667 --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/any/any.proto @@ -0,0 +1,149 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/any"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := ptypes.MarshalAny(foo) +// ... +// foo := &pb.Foo{} +// if err := ptypes.UnmarshalAny(any, foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name whose content describes the type of the + // serialized protocol buffer message. + // + // For URLs which use the scheme `http`, `https`, or no scheme, the + // following restrictions and interpretations apply: + // + // * If no scheme is provided, `https` is assumed. + // * The last segment of the URL's path must represent the fully + // qualified name of the type (as in `path/google.protobuf.Duration`). + // The name should be in a canonical form (e.g., leading "." is + // not accepted). + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/vendor/github.com/golang/protobuf/ptypes/doc.go b/vendor/github.com/golang/protobuf/ptypes/doc.go new file mode 100644 index 0000000..c0d595d --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/doc.go @@ -0,0 +1,35 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2016 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Package ptypes contains code for interacting with well-known types. +*/ +package ptypes diff --git a/vendor/github.com/golang/protobuf/ptypes/duration.go b/vendor/github.com/golang/protobuf/ptypes/duration.go new file mode 100644 index 0000000..65cb0f8 --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/duration.go @@ -0,0 +1,102 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2016 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package ptypes + +// This file implements conversions between google.protobuf.Duration +// and time.Duration. + +import ( + "errors" + "fmt" + "time" + + durpb "github.com/golang/protobuf/ptypes/duration" +) + +const ( + // Range of a durpb.Duration in seconds, as specified in + // google/protobuf/duration.proto. This is about 10,000 years in seconds. + maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60) + minSeconds = -maxSeconds +) + +// validateDuration determines whether the durpb.Duration is valid according to the +// definition in google/protobuf/duration.proto. A valid durpb.Duration +// may still be too large to fit into a time.Duration (the range of durpb.Duration +// is about 10,000 years, and the range of time.Duration is about 290). +func validateDuration(d *durpb.Duration) error { + if d == nil { + return errors.New("duration: nil Duration") + } + if d.Seconds < minSeconds || d.Seconds > maxSeconds { + return fmt.Errorf("duration: %v: seconds out of range", d) + } + if d.Nanos <= -1e9 || d.Nanos >= 1e9 { + return fmt.Errorf("duration: %v: nanos out of range", d) + } + // Seconds and Nanos must have the same sign, unless d.Nanos is zero. + if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) { + return fmt.Errorf("duration: %v: seconds and nanos have different signs", d) + } + return nil +} + +// Duration converts a durpb.Duration to a time.Duration. Duration +// returns an error if the durpb.Duration is invalid or is too large to be +// represented in a time.Duration. +func Duration(p *durpb.Duration) (time.Duration, error) { + if err := validateDuration(p); err != nil { + return 0, err + } + d := time.Duration(p.Seconds) * time.Second + if int64(d/time.Second) != p.Seconds { + return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p) + } + if p.Nanos != 0 { + d += time.Duration(p.Nanos) + if (d < 0) != (p.Nanos < 0) { + return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p) + } + } + return d, nil +} + +// DurationProto converts a time.Duration to a durpb.Duration. +func DurationProto(d time.Duration) *durpb.Duration { + nanos := d.Nanoseconds() + secs := nanos / 1e9 + nanos -= secs * 1e9 + return &durpb.Duration{ + Seconds: secs, + Nanos: int32(nanos), + } +} diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go new file mode 100644 index 0000000..b2410a0 --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go @@ -0,0 +1,144 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/protobuf/duration.proto + +/* +Package duration is a generated protocol buffer package. + +It is generated from these files: + google/protobuf/duration.proto + +It has these top-level messages: + Duration +*/ +package duration + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (durations.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +// +type Duration struct { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"` + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"` +} + +func (m *Duration) Reset() { *m = Duration{} } +func (m *Duration) String() string { return proto.CompactTextString(m) } +func (*Duration) ProtoMessage() {} +func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*Duration) XXX_WellKnownType() string { return "Duration" } + +func (m *Duration) GetSeconds() int64 { + if m != nil { + return m.Seconds + } + return 0 +} + +func (m *Duration) GetNanos() int32 { + if m != nil { + return m.Nanos + } + return 0 +} + +func init() { + proto.RegisterType((*Duration)(nil), "google.protobuf.Duration") +} + +func init() { proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 190 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a, + 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0x56, + 0x5c, 0x1c, 0x2e, 0x50, 0x25, 0x42, 0x12, 0x5c, 0xec, 0xc5, 0xa9, 0xc9, 0xf9, 0x79, 0x29, 0xc5, + 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x30, 0xae, 0x90, 0x08, 0x17, 0x6b, 0x5e, 0x62, 0x5e, + 0x7e, 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x84, 0xe3, 0x54, 0xc3, 0x25, 0x9c, 0x9c, + 0x9f, 0xab, 0x87, 0x66, 0xa4, 0x13, 0x2f, 0xcc, 0xc0, 0x00, 0x90, 0x48, 0x00, 0x63, 0x94, 0x56, + 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7a, 0x7e, 0x4e, 0x62, 0x5e, + 0x3a, 0xc2, 0x7d, 0x05, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x70, 0x67, 0xfe, 0x60, 0x64, 0x5c, 0xc4, + 0xc4, 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x6e, 0x00, 0x54, 0xa9, 0x5e, 0x78, + 0x6a, 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x4b, 0x12, 0x1b, 0xd8, 0x0c, 0x63, + 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x84, 0x30, 0xff, 0xf3, 0x00, 0x00, 0x00, +} diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto b/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto new file mode 100644 index 0000000..975fce4 --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto @@ -0,0 +1,117 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/duration"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (durations.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +// +message Duration { + + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/vendor/github.com/golang/protobuf/ptypes/regen.sh b/vendor/github.com/golang/protobuf/ptypes/regen.sh new file mode 100755 index 0000000..b50a941 --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/regen.sh @@ -0,0 +1,43 @@ +#!/bin/bash -e +# +# This script fetches and rebuilds the "well-known types" protocol buffers. +# To run this you will need protoc and goprotobuf installed; +# see https://github.com/golang/protobuf for instructions. +# You also need Go and Git installed. + +PKG=github.com/golang/protobuf/ptypes +UPSTREAM=https://github.com/google/protobuf +UPSTREAM_SUBDIR=src/google/protobuf +PROTO_FILES=(any duration empty struct timestamp wrappers) + +function die() { + echo 1>&2 $* + exit 1 +} + +# Sanity check that the right tools are accessible. +for tool in go git protoc protoc-gen-go; do + q=$(which $tool) || die "didn't find $tool" + echo 1>&2 "$tool: $q" +done + +tmpdir=$(mktemp -d -t regen-wkt.XXXXXX) +trap 'rm -rf $tmpdir' EXIT + +echo -n 1>&2 "finding package dir... " +pkgdir=$(go list -f '{{.Dir}}' $PKG) +echo 1>&2 $pkgdir +base=$(echo $pkgdir | sed "s,/$PKG\$,,") +echo 1>&2 "base: $base" +cd "$base" + +echo 1>&2 "fetching latest protos... " +git clone -q $UPSTREAM $tmpdir + +for file in ${PROTO_FILES[@]}; do + echo 1>&2 "* $file" + protoc --go_out=. -I$tmpdir/src $tmpdir/src/google/protobuf/$file.proto || die + cp $tmpdir/src/google/protobuf/$file.proto $PKG/$file +done + +echo 1>&2 "All OK" diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp.go b/vendor/github.com/golang/protobuf/ptypes/timestamp.go new file mode 100644 index 0000000..47f10db --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/timestamp.go @@ -0,0 +1,134 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2016 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package ptypes + +// This file implements operations on google.protobuf.Timestamp. + +import ( + "errors" + "fmt" + "time" + + tspb "github.com/golang/protobuf/ptypes/timestamp" +) + +const ( + // Seconds field of the earliest valid Timestamp. + // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). + minValidSeconds = -62135596800 + // Seconds field just after the latest valid Timestamp. + // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). + maxValidSeconds = 253402300800 +) + +// validateTimestamp determines whether a Timestamp is valid. +// A valid timestamp represents a time in the range +// [0001-01-01, 10000-01-01) and has a Nanos field +// in the range [0, 1e9). +// +// If the Timestamp is valid, validateTimestamp returns nil. +// Otherwise, it returns an error that describes +// the problem. +// +// Every valid Timestamp can be represented by a time.Time, but the converse is not true. +func validateTimestamp(ts *tspb.Timestamp) error { + if ts == nil { + return errors.New("timestamp: nil Timestamp") + } + if ts.Seconds < minValidSeconds { + return fmt.Errorf("timestamp: %v before 0001-01-01", ts) + } + if ts.Seconds >= maxValidSeconds { + return fmt.Errorf("timestamp: %v after 10000-01-01", ts) + } + if ts.Nanos < 0 || ts.Nanos >= 1e9 { + return fmt.Errorf("timestamp: %v: nanos not in range [0, 1e9)", ts) + } + return nil +} + +// Timestamp converts a google.protobuf.Timestamp proto to a time.Time. +// It returns an error if the argument is invalid. +// +// Unlike most Go functions, if Timestamp returns an error, the first return value +// is not the zero time.Time. Instead, it is the value obtained from the +// time.Unix function when passed the contents of the Timestamp, in the UTC +// locale. This may or may not be a meaningful time; many invalid Timestamps +// do map to valid time.Times. +// +// A nil Timestamp returns an error. The first return value in that case is +// undefined. +func Timestamp(ts *tspb.Timestamp) (time.Time, error) { + // Don't return the zero value on error, because corresponds to a valid + // timestamp. Instead return whatever time.Unix gives us. + var t time.Time + if ts == nil { + t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp + } else { + t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC() + } + return t, validateTimestamp(ts) +} + +// TimestampNow returns a google.protobuf.Timestamp for the current time. +func TimestampNow() *tspb.Timestamp { + ts, err := TimestampProto(time.Now()) + if err != nil { + panic("ptypes: time.Now() out of Timestamp range") + } + return ts +} + +// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto. +// It returns an error if the resulting Timestamp is invalid. +func TimestampProto(t time.Time) (*tspb.Timestamp, error) { + seconds := t.Unix() + nanos := int32(t.Sub(time.Unix(seconds, 0))) + ts := &tspb.Timestamp{ + Seconds: seconds, + Nanos: nanos, + } + if err := validateTimestamp(ts); err != nil { + return nil, err + } + return ts, nil +} + +// TimestampString returns the RFC 3339 string for valid Timestamps. For invalid +// Timestamps, it returns an error message in parentheses. +func TimestampString(ts *tspb.Timestamp) string { + t, err := Timestamp(ts) + if err != nil { + return fmt.Sprintf("(%v)", err) + } + return t.Format(time.RFC3339Nano) +} diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go new file mode 100644 index 0000000..e23e4a2 --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go @@ -0,0 +1,160 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/protobuf/timestamp.proto + +/* +Package timestamp is a generated protocol buffer package. + +It is generated from these files: + google/protobuf/timestamp.proto + +It has these top-level messages: + Timestamp +*/ +package timestamp + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// A Timestamp represents a point in time independent of any time zone +// or calendar, represented as seconds and fractions of seconds at +// nanosecond resolution in UTC Epoch time. It is encoded using the +// Proleptic Gregorian Calendar which extends the Gregorian calendar +// backwards to year one. It is encoded assuming all minutes are 60 +// seconds long, i.e. leap seconds are "smeared" so that no leap second +// table is needed for interpretation. Range is from +// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. +// By restricting to that range, we ensure that we can convert to +// and from RFC 3339 date strings. +// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required, though only UTC (as indicated by "Z") is presently supported. +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) +// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one +// can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) +// to obtain a formatter capable of generating timestamps in this format. +// +// +type Timestamp struct { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"` + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"` +} + +func (m *Timestamp) Reset() { *m = Timestamp{} } +func (m *Timestamp) String() string { return proto.CompactTextString(m) } +func (*Timestamp) ProtoMessage() {} +func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" } + +func (m *Timestamp) GetSeconds() int64 { + if m != nil { + return m.Seconds + } + return 0 +} + +func (m *Timestamp) GetNanos() int32 { + if m != nil { + return m.Nanos + } + return 0 +} + +func init() { + proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp") +} + +func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 191 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d, + 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0xd0, 0x03, 0x0b, 0x09, 0xf1, 0x43, 0x14, 0xe8, 0xc1, 0x14, 0x28, + 0x59, 0x73, 0x71, 0x86, 0xc0, 0xd4, 0x08, 0x49, 0x70, 0xb1, 0x17, 0xa7, 0x26, 0xe7, 0xe7, 0xa5, + 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0xc1, 0xb8, 0x42, 0x22, 0x5c, 0xac, 0x79, 0x89, + 0x79, 0xf9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10, 0x8e, 0x53, 0x1d, 0x97, 0x70, + 0x72, 0x7e, 0xae, 0x1e, 0x9a, 0x99, 0x4e, 0x7c, 0x70, 0x13, 0x03, 0x40, 0x42, 0x01, 0x8c, 0x51, + 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0x39, 0x89, + 0x79, 0xe9, 0x08, 0x27, 0x16, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x23, 0x5c, 0xfa, 0x83, 0x91, 0x71, + 0x11, 0x13, 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88, 0xc9, 0x01, 0x50, 0xb5, 0x7a, + 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9, 0xe5, 0x79, 0x21, 0x20, 0x3d, 0x49, 0x6c, 0x60, 0x43, + 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x77, 0x4a, 0x07, 0xf7, 0x00, 0x00, 0x00, +} diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto new file mode 100644 index 0000000..b7cbd17 --- /dev/null +++ b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto @@ -0,0 +1,133 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/timestamp"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone +// or calendar, represented as seconds and fractions of seconds at +// nanosecond resolution in UTC Epoch time. It is encoded using the +// Proleptic Gregorian Calendar which extends the Gregorian calendar +// backwards to year one. It is encoded assuming all minutes are 60 +// seconds long, i.e. leap seconds are "smeared" so that no leap second +// table is needed for interpretation. Range is from +// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. +// By restricting to that range, we ensure that we can convert to +// and from RFC 3339 date strings. +// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required, though only UTC (as indicated by "Z") is presently supported. +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) +// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one +// can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) +// to obtain a formatter capable of generating timestamps in this format. +// +// +message Timestamp { + + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/vendor/github.com/googleapis/gax-go/CONTRIBUTING.md b/vendor/github.com/googleapis/gax-go/CONTRIBUTING.md deleted file mode 100644 index 2827b7d..0000000 --- a/vendor/github.com/googleapis/gax-go/CONTRIBUTING.md +++ /dev/null @@ -1,27 +0,0 @@ -Want to contribute? Great! First, read this page (including the small print at the end). - -### Before you contribute -Before we can use your code, you must sign the -[Google Individual Contributor License Agreement] -(https://cla.developers.google.com/about/google-individual) -(CLA), which you can do online. The CLA is necessary mainly because you own the -copyright to your changes, even after your contribution becomes part of our -codebase, so we need your permission to use and distribute your code. We also -need to be sure of various other things—for instance that you'll tell us if you -know that your code infringes on other people's patents. You don't have to sign -the CLA until after you've submitted your code for review and a member has -approved it, but you must do it before we can put your code into our codebase. -Before you start working on a larger contribution, you should get in touch with -us first through the issue tracker with your idea so that we can help out and -possibly guide you. Coordinating up front makes it much easier to avoid -frustration later on. - -### Code reviews -All submissions, including submissions by project members, require review. We -use Github pull requests for this purpose. - -### The small print -Contributions made by corporations are covered by a different agreement than -the one above, the -[Software Grant and Corporate Contributor License Agreement] -(https://cla.developers.google.com/about/google-corporate). diff --git a/vendor/github.com/googleapis/gax-go/LICENSE b/vendor/github.com/googleapis/gax-go/LICENSE deleted file mode 100644 index 6d16b65..0000000 --- a/vendor/github.com/googleapis/gax-go/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2016, Google Inc. -All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/googleapis/gax-go/README.md b/vendor/github.com/googleapis/gax-go/README.md deleted file mode 100644 index 3cedd5b..0000000 --- a/vendor/github.com/googleapis/gax-go/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Google API Extensions for Go -============================ - -[![Build Status](https://travis-ci.org/googleapis/gax-go.svg?branch=master)](https://travis-ci.org/googleapis/gax-go) -[![Code Coverage](https://img.shields.io/codecov/c/github/googleapis/gax-go.svg)](https://codecov.io/github/googleapis/gax-go) - -Google API Extensions for Go (gax-go) is a set of modules which aids the -development of APIs for clients and servers based on `gRPC` and Google API -conventions. - -Application code will rarely need to use this library directly, -but the code generated automatically from API definition files can use it -to simplify code generation and to provide more convenient and idiomatic API surface. - -**This project is currently experimental and not supported.** - -Go Versions -=========== -This library requires Go 1.6 or above. - -License -======= -BSD - please see [LICENSE](https://github.com/googleapis/gax-go/blob/master/LICENSE) -for more information. diff --git a/vendor/github.com/googleapis/gax-go/call_option.go b/vendor/github.com/googleapis/gax-go/call_option.go deleted file mode 100644 index 4ba1cdf..0000000 --- a/vendor/github.com/googleapis/gax-go/call_option.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gax - -import ( - "math/rand" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" -) - -// CallOption is an option used by Invoke to control behaviors of RPC calls. -// CallOption works by modifying relevant fields of CallSettings. -type CallOption interface { - // Resolve applies the option by modifying cs. - Resolve(cs *CallSettings) -} - -// Retryer is used by Invoke to determine retry behavior. -type Retryer interface { - // Retry reports whether a request should be retriedand how long to pause before retrying - // if the previous attempt returned with err. Invoke never calls Retry with nil error. - Retry(err error) (pause time.Duration, shouldRetry bool) -} - -type retryerOption func() Retryer - -func (o retryerOption) Resolve(s *CallSettings) { - s.Retry = o -} - -// WithRetry sets CallSettings.Retry to fn. -func WithRetry(fn func() Retryer) CallOption { - return retryerOption(fn) -} - -// OnCodes returns a Retryer that retries if and only if -// the previous attempt returns a GRPC error whose error code is stored in cc. -// Pause times between retries are specified by bo. -// -// bo is only used for its parameters; each Retryer has its own copy. -func OnCodes(cc []codes.Code, bo Backoff) Retryer { - return &boRetryer{ - backoff: bo, - codes: append([]codes.Code(nil), cc...), - } -} - -type boRetryer struct { - backoff Backoff - codes []codes.Code -} - -func (r *boRetryer) Retry(err error) (time.Duration, bool) { - c := grpc.Code(err) - for _, rc := range r.codes { - if c == rc { - return r.backoff.Pause(), true - } - } - return 0, false -} - -// Backoff implements exponential backoff. -// The wait time between retries is a random value between 0 and the "retry envelope". -// The envelope starts at Initial and increases by the factor of Multiplier every retry, -// but is capped at Max. -type Backoff struct { - // Initial is the initial value of the retry envelope, defaults to 1 second. - Initial time.Duration - - // Max is the maximum value of the retry envelope, defaults to 30 seconds. - Max time.Duration - - // Multiplier is the factor by which the retry envelope increases. - // It should be greater than 1 and defaults to 2. - Multiplier float64 - - // cur is the current retry envelope - cur time.Duration -} - -func (bo *Backoff) Pause() time.Duration { - if bo.Initial == 0 { - bo.Initial = time.Second - } - if bo.cur == 0 { - bo.cur = bo.Initial - } - if bo.Max == 0 { - bo.Max = 30 * time.Second - } - if bo.Multiplier < 1 { - bo.Multiplier = 2 - } - d := time.Duration(rand.Int63n(int64(bo.cur))) - bo.cur = time.Duration(float64(bo.cur) * bo.Multiplier) - if bo.cur > bo.Max { - bo.cur = bo.Max - } - return d -} - -type CallSettings struct { - // Retry returns a Retryer to be used to control retry logic of a method call. - // If Retry is nil or the returned Retryer is nil, the call will not be retried. - Retry func() Retryer -} diff --git a/vendor/github.com/googleapis/gax-go/gax.go b/vendor/github.com/googleapis/gax-go/gax.go deleted file mode 100644 index 5ebedff..0000000 --- a/vendor/github.com/googleapis/gax-go/gax.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Package gax contains a set of modules which aid the development of APIs -// for clients and servers based on gRPC and Google API conventions. -// -// Application code will rarely need to use this library directly. -// However, code generated automatically from API definition files can use it -// to simplify code generation and to provide more convenient and idiomatic API surfaces. -// -// This project is currently experimental and not supported. -package gax - -const Version = "0.1.0" diff --git a/vendor/github.com/googleapis/gax-go/invoke.go b/vendor/github.com/googleapis/gax-go/invoke.go deleted file mode 100644 index d2134e1..0000000 --- a/vendor/github.com/googleapis/gax-go/invoke.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gax - -import ( - "time" - - "golang.org/x/net/context" -) - -// A user defined call stub. -type APICall func(context.Context) error - -// Invoke calls the given APICall, -// performing retries as specified by opts, if any. -func Invoke(ctx context.Context, call APICall, opts ...CallOption) error { - var settings CallSettings - for _, opt := range opts { - opt.Resolve(&settings) - } - return invoke(ctx, call, settings, Sleep) -} - -// Sleep is similar to time.Sleep, but it can be interrupted by ctx.Done() closing. -// If interrupted, Sleep returns ctx.Err(). -func Sleep(ctx context.Context, d time.Duration) error { - t := time.NewTimer(d) - select { - case <-ctx.Done(): - t.Stop() - return ctx.Err() - case <-t.C: - return nil - } -} - -type sleeper func(ctx context.Context, d time.Duration) error - -// invoke implements Invoke, taking an additional sleeper argument for testing. -func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper) error { - var retryer Retryer - for { - err := call(ctx) - if err == nil { - return nil - } - if settings.Retry == nil { - return err - } - if retryer == nil { - if r := settings.Retry(); r != nil { - retryer = r - } else { - return err - } - } - if d, ok := retryer.Retry(err); !ok { - return err - } else if err = sp(ctx, d); err != nil { - return err - } - } -} diff --git a/vendor/github.com/googleapis/gax-go/path_template.go b/vendor/github.com/googleapis/gax-go/path_template.go deleted file mode 100644 index 41bda94..0000000 --- a/vendor/github.com/googleapis/gax-go/path_template.go +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gax - -import ( - "errors" - "fmt" - "strings" -) - -type matcher interface { - match([]string) (int, error) - String() string -} - -type segment struct { - matcher - name string -} - -type labelMatcher string - -func (ls labelMatcher) match(segments []string) (int, error) { - if len(segments) == 0 { - return 0, fmt.Errorf("expected %s but no more segments found", ls) - } - if segments[0] != string(ls) { - return 0, fmt.Errorf("expected %s but got %s", ls, segments[0]) - } - return 1, nil -} - -func (ls labelMatcher) String() string { - return string(ls) -} - -type wildcardMatcher int - -func (wm wildcardMatcher) match(segments []string) (int, error) { - if len(segments) == 0 { - return 0, errors.New("no more segments found") - } - return 1, nil -} - -func (wm wildcardMatcher) String() string { - return "*" -} - -type pathWildcardMatcher int - -func (pwm pathWildcardMatcher) match(segments []string) (int, error) { - length := len(segments) - int(pwm) - if length <= 0 { - return 0, errors.New("not sufficient segments are supplied for path wildcard") - } - return length, nil -} - -func (pwm pathWildcardMatcher) String() string { - return "**" -} - -type ParseError struct { - Pos int - Template string - Message string -} - -func (pe ParseError) Error() string { - return fmt.Sprintf("at %d of template '%s', %s", pe.Pos, pe.Template, pe.Message) -} - -// PathTemplate manages the template to build and match with paths used -// by API services. It holds a template and variable names in it, and -// it can extract matched patterns from a path string or build a path -// string from a binding. -// -// See http.proto in github.com/googleapis/googleapis/ for the details of -// the template syntax. -type PathTemplate struct { - segments []segment -} - -// NewPathTemplate parses a path template, and returns a PathTemplate -// instance if successful. -func NewPathTemplate(template string) (*PathTemplate, error) { - return parsePathTemplate(template) -} - -// MustCompilePathTemplate is like NewPathTemplate but panics if the -// expression cannot be parsed. It simplifies safe initialization of -// global variables holding compiled regular expressions. -func MustCompilePathTemplate(template string) *PathTemplate { - pt, err := NewPathTemplate(template) - if err != nil { - panic(err) - } - return pt -} - -// Match attempts to match the given path with the template, and returns -// the mapping of the variable name to the matched pattern string. -func (pt *PathTemplate) Match(path string) (map[string]string, error) { - paths := strings.Split(path, "/") - values := map[string]string{} - for _, segment := range pt.segments { - length, err := segment.match(paths) - if err != nil { - return nil, err - } - if segment.name != "" { - value := strings.Join(paths[:length], "/") - if oldValue, ok := values[segment.name]; ok { - values[segment.name] = oldValue + "/" + value - } else { - values[segment.name] = value - } - } - paths = paths[length:] - } - if len(paths) != 0 { - return nil, fmt.Errorf("Trailing path %s remains after the matching", strings.Join(paths, "/")) - } - return values, nil -} - -// Render creates a path string from its template and the binding from -// the variable name to the value. -func (pt *PathTemplate) Render(binding map[string]string) (string, error) { - result := make([]string, 0, len(pt.segments)) - var lastVariableName string - for _, segment := range pt.segments { - name := segment.name - if lastVariableName != "" && name == lastVariableName { - continue - } - lastVariableName = name - if name == "" { - result = append(result, segment.String()) - } else if value, ok := binding[name]; ok { - result = append(result, value) - } else { - return "", fmt.Errorf("%s is not found", name) - } - } - built := strings.Join(result, "/") - return built, nil -} diff --git a/vendor/github.com/googleapis/gax-go/path_template_parser.go b/vendor/github.com/googleapis/gax-go/path_template_parser.go deleted file mode 100644 index 79c8e75..0000000 --- a/vendor/github.com/googleapis/gax-go/path_template_parser.go +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gax - -import ( - "fmt" - "io" - "strings" -) - -// This parser follows the syntax of path templates, from -// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto. -// The differences are that there is no custom verb, we allow the initial slash -// to be absent, and that we are not strict as -// https://tools.ietf.org/html/rfc6570 about the characters in identifiers and -// literals. - -type pathTemplateParser struct { - r *strings.Reader - runeCount int // the number of the current rune in the original string - nextVar int // the number to use for the next unnamed variable - seenName map[string]bool // names we've seen already - seenPathWildcard bool // have we seen "**" already? -} - -func parsePathTemplate(template string) (pt *PathTemplate, err error) { - p := &pathTemplateParser{ - r: strings.NewReader(template), - seenName: map[string]bool{}, - } - - // Handle panics with strings like errors. - // See pathTemplateParser.error, below. - defer func() { - if x := recover(); x != nil { - errmsg, ok := x.(errString) - if !ok { - panic(x) - } - pt = nil - err = ParseError{p.runeCount, template, string(errmsg)} - } - }() - - segs := p.template() - // If there is a path wildcard, set its length. We can't do this - // until we know how many segments we've got all together. - for i, seg := range segs { - if _, ok := seg.matcher.(pathWildcardMatcher); ok { - segs[i].matcher = pathWildcardMatcher(len(segs) - i - 1) - break - } - } - return &PathTemplate{segments: segs}, nil - -} - -// Used to indicate errors "thrown" by this parser. We don't use string because -// many parts of the standard library panic with strings. -type errString string - -// Terminates parsing immediately with an error. -func (p *pathTemplateParser) error(msg string) { - panic(errString(msg)) -} - -// Template = [ "/" ] Segments -func (p *pathTemplateParser) template() []segment { - var segs []segment - if p.consume('/') { - // Initial '/' needs an initial empty matcher. - segs = append(segs, segment{matcher: labelMatcher("")}) - } - return append(segs, p.segments("")...) -} - -// Segments = Segment { "/" Segment } -func (p *pathTemplateParser) segments(name string) []segment { - var segs []segment - for { - subsegs := p.segment(name) - segs = append(segs, subsegs...) - if !p.consume('/') { - break - } - } - return segs -} - -// Segment = "*" | "**" | LITERAL | Variable -func (p *pathTemplateParser) segment(name string) []segment { - if p.consume('*') { - if name == "" { - name = fmt.Sprintf("$%d", p.nextVar) - p.nextVar++ - } - if p.consume('*') { - if p.seenPathWildcard { - p.error("multiple '**' disallowed") - } - p.seenPathWildcard = true - // We'll change 0 to the right number at the end. - return []segment{{name: name, matcher: pathWildcardMatcher(0)}} - } - return []segment{{name: name, matcher: wildcardMatcher(0)}} - } - if p.consume('{') { - if name != "" { - p.error("recursive named bindings are not allowed") - } - return p.variable() - } - return []segment{{name: name, matcher: labelMatcher(p.literal())}} -} - -// Variable = "{" FieldPath [ "=" Segments ] "}" -// "{" is already consumed. -func (p *pathTemplateParser) variable() []segment { - // Simplification: treat FieldPath as LITERAL, instead of IDENT { '.' IDENT } - name := p.literal() - if p.seenName[name] { - p.error(name + " appears multiple times") - } - p.seenName[name] = true - var segs []segment - if p.consume('=') { - segs = p.segments(name) - } else { - // "{var}" is equivalent to "{var=*}" - segs = []segment{{name: name, matcher: wildcardMatcher(0)}} - } - if !p.consume('}') { - p.error("expected '}'") - } - return segs -} - -// A literal is any sequence of characters other than a few special ones. -// The list of stop characters is not quite the same as in the template RFC. -func (p *pathTemplateParser) literal() string { - lit := p.consumeUntil("/*}{=") - if lit == "" { - p.error("empty literal") - } - return lit -} - -// Read runes until EOF or one of the runes in stopRunes is encountered. -// If the latter, unread the stop rune. Return the accumulated runes as a string. -func (p *pathTemplateParser) consumeUntil(stopRunes string) string { - var runes []rune - for { - r, ok := p.readRune() - if !ok { - break - } - if strings.IndexRune(stopRunes, r) >= 0 { - p.unreadRune() - break - } - runes = append(runes, r) - } - return string(runes) -} - -// If the next rune is r, consume it and return true. -// Otherwise, leave the input unchanged and return false. -func (p *pathTemplateParser) consume(r rune) bool { - rr, ok := p.readRune() - if !ok { - return false - } - if r == rr { - return true - } - p.unreadRune() - return false -} - -// Read the next rune from the input. Return it. -// The second return value is false at EOF. -func (p *pathTemplateParser) readRune() (rune, bool) { - r, _, err := p.r.ReadRune() - if err == io.EOF { - return r, false - } - if err != nil { - p.error(err.Error()) - } - p.runeCount++ - return r, true -} - -// Put the last rune that was read back on the input. -func (p *pathTemplateParser) unreadRune() { - if err := p.r.UnreadRune(); err != nil { - p.error(err.Error()) - } - p.runeCount-- -} diff --git a/vendor/github.com/hashicorp/go-getter/README.md b/vendor/github.com/hashicorp/go-getter/README.md index 4a0b6a6..a9eafd6 100644 --- a/vendor/github.com/hashicorp/go-getter/README.md +++ b/vendor/github.com/hashicorp/go-getter/README.md @@ -21,8 +21,7 @@ URLs. For example: "github.com/hashicorp/go-getter" would turn into a Git URL. Or "./foo" would turn into a file URL. These are extensible. This library is used by [Terraform](https://terraform.io) for -downloading modules, [Otto](https://ottoproject.io) for dependencies and -Appfile imports, and [Nomad](https://nomadproject.io) for downloading +downloading modules and [Nomad](https://nomadproject.io) for downloading binaries. ## Installation and Usage @@ -119,6 +118,37 @@ The protocol-specific options are documented below the URL format section. But because they are part of the URL, we point it out here so you know they exist. +### Subdirectories + +If you want to download only a specific subdirectory from a downloaded +directory, you can specify a subdirectory after a double-slash `//`. +go-getter will first download the URL specified _before_ the double-slash +(as if you didn't specify a double-slash), but will then copy the +path after the double slash into the target directory. + +For example, if you're downloading this GitHub repository, but you only +want to download the `test-fixtures` directory, you can do the following: + +``` +https://github.com/hashicorp/go-getter.git//test-fixtures +``` + +If you downloaded this to the `/tmp` directory, then the file +`/tmp/archive.gz` would exist. Notice that this file is in the `test-fixtures` +directory in this repository, but because we specified a subdirectory, +go-getter automatically copied only that directory contents. + +Subdirectory paths may contain may also use filesystem glob patterns. +The path must match _exactly one_ entry or go-getter will return an error. +This is useful if you're not sure the exact directory name but it follows +a predictable naming structure. + +For example, the following URL would also work: + +``` +https://github.com/hashicorp/go-getter.git//test-* +``` + ### Checksumming For file downloads of any protocol, go-getter can automatically verify @@ -154,9 +184,11 @@ The following archive formats are supported: * `tar.gz` and `tgz` * `tar.bz2` and `tbz2` + * `tar.xz` and `txz` * `zip` * `gz` * `bz2` + * `xz` For example, an example URL is shown below: @@ -222,13 +254,17 @@ None ### HTTP (`http`) -None +#### Basic Authentication + +To use HTTP basic authentication with go-getter, simply prepend `username:password@` to the +hostname in the URL such as `https://Aladdin:OpenSesame@www.example.com/index.html`. All special +characters, including the username and password, must be URL encoded. ### S3 (`s3`) S3 takes various access configurations in the URL. Note that it will also -read these from standard AWS environment variables if they're set. If -the query parameters are present, these take priority. +read these from standard AWS environment variables if they're set. S3 compliant servers like Minio +are also supported. If the query parameters are present, these take priority. * `aws_access_key_id` - AWS access key. * `aws_access_key_secret` - AWS access key secret. @@ -240,6 +276,14 @@ If you use go-getter and want to use an EC2 IAM Instance Profile to avoid using credentials, then just omit these and the profile, if available will be used automatically. +### Using S3 with Minio + If you use go-gitter for Minio support, you must consider the following: + + * `aws_access_key_id` (required) - Minio access key. + * `aws_access_key_secret` (required) - Minio access key secret. + * `region` (optional - defaults to us-east-1) - Region identifier to use. + * `version` (optional - fefaults to Minio default) - Configuration file format. + #### S3 Bucket Examples S3 has several addressing schemes used to reference your bucket. These are @@ -250,4 +294,5 @@ Some examples for these addressing schemes: - s3::https://s3-eu-west-1.amazonaws.com/bucket/foo - bucket.s3.amazonaws.com/foo - bucket.s3-eu-west-1.amazonaws.com/foo/bar +- "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=KEYID&aws_access_key_secret=SECRETKEY®ion=us-east-2" diff --git a/vendor/github.com/hashicorp/go-getter/appveyor.yml b/vendor/github.com/hashicorp/go-getter/appveyor.yml index 159dad4..ec48d45 100644 --- a/vendor/github.com/hashicorp/go-getter/appveyor.yml +++ b/vendor/github.com/hashicorp/go-getter/appveyor.yml @@ -1,5 +1,5 @@ version: "build-{branch}-{build}" -image: Visual Studio 2015 +image: Visual Studio 2017 clone_folder: c:\gopath\github.com\hashicorp\go-getter environment: GOPATH: c:\gopath diff --git a/vendor/github.com/hashicorp/go-getter/client.go b/vendor/github.com/hashicorp/go-getter/client.go index 876812a..b67bb64 100644 --- a/vendor/github.com/hashicorp/go-getter/client.go +++ b/vendor/github.com/hashicorp/go-getter/client.go @@ -305,7 +305,13 @@ func (c *Client) Get() error { return err } - return copyDir(realDst, filepath.Join(dst, subDir), false) + // Process any globs + subDir, err := SubdirGlob(dst, subDir) + if err != nil { + return err + } + + return copyDir(realDst, subDir, false) } return nil diff --git a/vendor/github.com/hashicorp/go-getter/decompress.go b/vendor/github.com/hashicorp/go-getter/decompress.go index d18174c..fc5681d 100644 --- a/vendor/github.com/hashicorp/go-getter/decompress.go +++ b/vendor/github.com/hashicorp/go-getter/decompress.go @@ -16,14 +16,18 @@ var Decompressors map[string]Decompressor func init() { tbzDecompressor := new(TarBzip2Decompressor) tgzDecompressor := new(TarGzipDecompressor) + txzDecompressor := new(TarXzDecompressor) Decompressors = map[string]Decompressor{ "bz2": new(Bzip2Decompressor), "gz": new(GzipDecompressor), + "xz": new(XzDecompressor), "tar.bz2": tbzDecompressor, "tar.gz": tgzDecompressor, + "tar.xz": txzDecompressor, "tbz2": tbzDecompressor, "tgz": tgzDecompressor, + "txz": txzDecompressor, "zip": new(ZipDecompressor), } } diff --git a/vendor/github.com/hashicorp/go-getter/decompress_gzip.go b/vendor/github.com/hashicorp/go-getter/decompress_gzip.go index 2001054..5ebf709 100644 --- a/vendor/github.com/hashicorp/go-getter/decompress_gzip.go +++ b/vendor/github.com/hashicorp/go-getter/decompress_gzip.go @@ -9,7 +9,7 @@ import ( ) // GzipDecompressor is an implementation of Decompressor that can -// decompress bz2 files. +// decompress gzip files. type GzipDecompressor struct{} func (d *GzipDecompressor) Decompress(dst, src string, dir bool) error { diff --git a/vendor/github.com/hashicorp/go-getter/decompress_tar.go b/vendor/github.com/hashicorp/go-getter/decompress_tar.go new file mode 100644 index 0000000..543c30d --- /dev/null +++ b/vendor/github.com/hashicorp/go-getter/decompress_tar.go @@ -0,0 +1,112 @@ +package getter + +import ( + "archive/tar" + "fmt" + "io" + "os" + "path/filepath" +) + +// untar is a shared helper for untarring an archive. The reader should provide +// an uncompressed view of the tar archive. +func untar(input io.Reader, dst, src string, dir bool) error { + tarR := tar.NewReader(input) + done := false + for { + hdr, err := tarR.Next() + if err == io.EOF { + if !done { + // Empty archive + return fmt.Errorf("empty archive: %s", src) + } + + return nil + } + if err != nil { + return err + } + + if hdr.Typeflag == tar.TypeXGlobalHeader || hdr.Typeflag == tar.TypeXHeader { + // don't unpack extended headers as files + continue + } + + path := dst + if dir { + path = filepath.Join(path, hdr.Name) + } + + if hdr.FileInfo().IsDir() { + if !dir { + return fmt.Errorf("expected a single file: %s", src) + } + + // A directory, just make the directory and continue unarchiving... + if err := os.MkdirAll(path, 0755); err != nil { + return err + } + + continue + } else { + // There is no ordering guarantee that a file in a directory is + // listed before the directory + dstPath := filepath.Dir(path) + + // Check that the directory exists, otherwise create it + if _, err := os.Stat(dstPath); os.IsNotExist(err) { + if err := os.MkdirAll(dstPath, 0755); err != nil { + return err + } + } + } + + // We have a file. If we already decoded, then it is an error + if !dir && done { + return fmt.Errorf("expected a single file, got multiple: %s", src) + } + + // Mark that we're done so future in single file mode errors + done = true + + // Open the file for writing + dstF, err := os.Create(path) + if err != nil { + return err + } + _, err = io.Copy(dstF, tarR) + dstF.Close() + if err != nil { + return err + } + + // Chmod the file + if err := os.Chmod(path, hdr.FileInfo().Mode()); err != nil { + return err + } + } +} + +// tarDecompressor is an implementation of Decompressor that can +// unpack tar files. +type tarDecompressor struct{} + +func (d *tarDecompressor) Decompress(dst, src string, dir bool) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, 0755); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + return untar(f, dst, src, dir) +} diff --git a/vendor/github.com/hashicorp/go-getter/decompress_tbz2.go b/vendor/github.com/hashicorp/go-getter/decompress_tbz2.go index c46ed44..5391b5c 100644 --- a/vendor/github.com/hashicorp/go-getter/decompress_tbz2.go +++ b/vendor/github.com/hashicorp/go-getter/decompress_tbz2.go @@ -1,10 +1,7 @@ package getter import ( - "archive/tar" "compress/bzip2" - "fmt" - "io" "os" "path/filepath" ) @@ -32,64 +29,5 @@ func (d *TarBzip2Decompressor) Decompress(dst, src string, dir bool) error { // Bzip2 compression is second bzipR := bzip2.NewReader(f) - - // Once bzip decompressed we have a tar format - tarR := tar.NewReader(bzipR) - done := false - for { - hdr, err := tarR.Next() - if err == io.EOF { - if !done { - // Empty archive - return fmt.Errorf("empty archive: %s", src) - } - - return nil - } - if err != nil { - return err - } - - path := dst - if dir { - path = filepath.Join(path, hdr.Name) - } - - if hdr.FileInfo().IsDir() { - if dir { - return fmt.Errorf("expected a single file: %s", src) - } - - // A directory, just make the directory and continue unarchiving... - if err := os.MkdirAll(path, 0755); err != nil { - return err - } - - continue - } - - // We have a file. If we already decoded, then it is an error - if !dir && done { - return fmt.Errorf("expected a single file, got multiple: %s", src) - } - - // Mark that we're done so future in single file mode errors - done = true - - // Open the file for writing - dstF, err := os.Create(path) - if err != nil { - return err - } - _, err = io.Copy(dstF, tarR) - dstF.Close() - if err != nil { - return err - } - - // Chmod the file - if err := os.Chmod(path, hdr.FileInfo().Mode()); err != nil { - return err - } - } + return untar(bzipR, dst, src, dir) } diff --git a/vendor/github.com/hashicorp/go-getter/decompress_testing.go b/vendor/github.com/hashicorp/go-getter/decompress_testing.go index 686d6c2..82b8ab4 100644 --- a/vendor/github.com/hashicorp/go-getter/decompress_testing.go +++ b/vendor/github.com/hashicorp/go-getter/decompress_testing.go @@ -11,7 +11,8 @@ import ( "runtime" "sort" "strings" - "testing" + + "github.com/mitchellh/go-testing-interface" ) // TestDecompressCase is a single test case for testing decompressors @@ -24,7 +25,7 @@ type TestDecompressCase struct { } // TestDecompressor is a helper function for testing generic decompressors. -func TestDecompressor(t *testing.T, d Decompressor, cases []TestDecompressCase) { +func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) { for _, tc := range cases { t.Logf("Testing: %s", tc.Input) @@ -87,7 +88,7 @@ func TestDecompressor(t *testing.T, d Decompressor, cases []TestDecompressCase) } } -func testListDir(t *testing.T, path string) []string { +func testListDir(t testing.T, path string) []string { var result []string err := filepath.Walk(path, func(sub string, info os.FileInfo, err error) error { if err != nil { @@ -102,7 +103,7 @@ func testListDir(t *testing.T, path string) []string { // If it is a dir, add trailing sep if info.IsDir() { - sub += "/" + sub += string(os.PathSeparator) } result = append(result, sub) @@ -116,7 +117,7 @@ func testListDir(t *testing.T, path string) []string { return result } -func testMD5(t *testing.T, path string) string { +func testMD5(t testing.T, path string) string { f, err := os.Open(path) if err != nil { t.Fatalf("err: %s", err) diff --git a/vendor/github.com/hashicorp/go-getter/decompress_tgz.go b/vendor/github.com/hashicorp/go-getter/decompress_tgz.go index e8b1c31..65eb70d 100644 --- a/vendor/github.com/hashicorp/go-getter/decompress_tgz.go +++ b/vendor/github.com/hashicorp/go-getter/decompress_tgz.go @@ -1,10 +1,8 @@ package getter import ( - "archive/tar" "compress/gzip" "fmt" - "io" "os" "path/filepath" ) @@ -37,63 +35,5 @@ func (d *TarGzipDecompressor) Decompress(dst, src string, dir bool) error { } defer gzipR.Close() - // Once gzip decompressed we have a tar format - tarR := tar.NewReader(gzipR) - done := false - for { - hdr, err := tarR.Next() - if err == io.EOF { - if !done { - // Empty archive - return fmt.Errorf("empty archive: %s", src) - } - - return nil - } - if err != nil { - return err - } - - path := dst - if dir { - path = filepath.Join(path, hdr.Name) - } - - if hdr.FileInfo().IsDir() { - if !dir { - return fmt.Errorf("expected a single file: %s", src) - } - - // A directory, just make the directory and continue unarchiving... - if err := os.MkdirAll(path, 0755); err != nil { - return err - } - - continue - } - - // We have a file. If we already decoded, then it is an error - if !dir && done { - return fmt.Errorf("expected a single file, got multiple: %s", src) - } - - // Mark that we're done so future in single file mode errors - done = true - - // Open the file for writing - dstF, err := os.Create(path) - if err != nil { - return err - } - _, err = io.Copy(dstF, tarR) - dstF.Close() - if err != nil { - return err - } - - // Chmod the file - if err := os.Chmod(path, hdr.FileInfo().Mode()); err != nil { - return err - } - } + return untar(gzipR, dst, src, dir) } diff --git a/vendor/github.com/hashicorp/go-getter/decompress_txz.go b/vendor/github.com/hashicorp/go-getter/decompress_txz.go new file mode 100644 index 0000000..5e151c1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-getter/decompress_txz.go @@ -0,0 +1,39 @@ +package getter + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/ulikunitz/xz" +) + +// TarXzDecompressor is an implementation of Decompressor that can +// decompress tar.xz files. +type TarXzDecompressor struct{} + +func (d *TarXzDecompressor) Decompress(dst, src string, dir bool) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, 0755); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // xz compression is second + txzR, err := xz.NewReader(f) + if err != nil { + return fmt.Errorf("Error opening an xz reader for %s: %s", src, err) + } + + return untar(txzR, dst, src, dir) +} diff --git a/vendor/github.com/hashicorp/go-getter/decompress_xz.go b/vendor/github.com/hashicorp/go-getter/decompress_xz.go new file mode 100644 index 0000000..4e37aba --- /dev/null +++ b/vendor/github.com/hashicorp/go-getter/decompress_xz.go @@ -0,0 +1,49 @@ +package getter + +import ( + "fmt" + "io" + "os" + "path/filepath" + + "github.com/ulikunitz/xz" +) + +// XzDecompressor is an implementation of Decompressor that can +// decompress xz files. +type XzDecompressor struct{} + +func (d *XzDecompressor) Decompress(dst, src string, dir bool) error { + // Directory isn't supported at all + if dir { + return fmt.Errorf("xz-compressed files can only unarchive to a single file") + } + + // If we're going into a directory we should make that first + if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // xz compression is second + xzR, err := xz.NewReader(f) + if err != nil { + return err + } + + // Copy it out + dstF, err := os.Create(dst) + if err != nil { + return err + } + defer dstF.Close() + + _, err = io.Copy(dstF, xzR) + return err +} diff --git a/vendor/github.com/hashicorp/go-getter/detect.go b/vendor/github.com/hashicorp/go-getter/detect.go index 481b737..c369551 100644 --- a/vendor/github.com/hashicorp/go-getter/detect.go +++ b/vendor/github.com/hashicorp/go-getter/detect.go @@ -72,12 +72,18 @@ func Detect(src string, pwd string, ds []Detector) (string, error) { subDir = detectSubdir } } + if subDir != "" { u, err := url.Parse(result) if err != nil { return "", fmt.Errorf("Error parsing URL: %s", err) } u.Path += "//" + subDir + + // a subdir may contain wildcards, but in order to support them we + // have to ensure the path isn't escaped. + u.RawPath = u.Path + result = u.String() } diff --git a/vendor/github.com/hashicorp/go-getter/detect_file.go b/vendor/github.com/hashicorp/go-getter/detect_file.go index 756ea43..4ef41ea 100644 --- a/vendor/github.com/hashicorp/go-getter/detect_file.go +++ b/vendor/github.com/hashicorp/go-getter/detect_file.go @@ -32,7 +32,7 @@ func (d *FileDetector) Detect(src, pwd string) (string, bool, error) { return "", true, err } if fi.Mode()&os.ModeSymlink != 0 { - pwd, err = os.Readlink(pwd) + pwd, err = filepath.EvalSymlinks(pwd) if err != nil { return "", true, err } diff --git a/vendor/github.com/hashicorp/go-getter/get.go b/vendor/github.com/hashicorp/go-getter/get.go index c3236f5..e6053d9 100644 --- a/vendor/github.com/hashicorp/go-getter/get.go +++ b/vendor/github.com/hashicorp/go-getter/get.go @@ -18,6 +18,8 @@ import ( "os/exec" "regexp" "syscall" + + cleanhttp "github.com/hashicorp/go-cleanhttp" ) // Getter defines the interface that schemes must implement to download @@ -49,8 +51,13 @@ var Getters map[string]Getter // syntax is schema::url, example: git::https://foo.com var forcedRegexp = regexp.MustCompile(`^([A-Za-z0-9]+)::(.+)$`) +// httpClient is the default client to be used by HttpGetters. +var httpClient = cleanhttp.DefaultClient() + func init() { - httpGetter := &HttpGetter{Netrc: true} + httpGetter := &HttpGetter{ + Netrc: true, + } Getters = map[string]Getter{ "file": new(FileGetter), diff --git a/vendor/github.com/hashicorp/go-getter/get_git.go b/vendor/github.com/hashicorp/go-getter/get_git.go index 0728139..6f5d914 100644 --- a/vendor/github.com/hashicorp/go-getter/get_git.go +++ b/vendor/github.com/hashicorp/go-getter/get_git.go @@ -180,17 +180,34 @@ func (g *GitGetter) fetchSubmodules(dst, sshKeyFile string) error { // setupGitEnv sets up the environment for the given command. This is used to // pass configuration data to git and ssh and enables advanced cloning methods. func setupGitEnv(cmd *exec.Cmd, sshKeyFile string) { - var sshOpts []string + const gitSSHCommand = "GIT_SSH_COMMAND=" + var sshCmd []string + + // If we have an existing GIT_SSH_COMMAND, we need to append our options. + // We will also remove our old entry to make sure the behavior is the same + // with versions of Go < 1.9. + env := os.Environ() + for i, v := range env { + if strings.HasPrefix(v, gitSSHCommand) { + sshCmd = []string{v} + + env[i], env[len(env)-1] = env[len(env)-1], env[i] + env = env[:len(env)-1] + break + } + } + + if len(sshCmd) == 0 { + sshCmd = []string{gitSSHCommand + "ssh"} + } if sshKeyFile != "" { // We have an SSH key temp file configured, tell ssh about this. - sshOpts = append(sshOpts, "-i", sshKeyFile) + sshCmd = append(sshCmd, "-i", sshKeyFile) } - cmd.Env = append(os.Environ(), - // Set the ssh command to use for clones. - "GIT_SSH_COMMAND=ssh "+strings.Join(sshOpts, " "), - ) + env = append(env, strings.Join(sshCmd, " ")) + cmd.Env = env } // checkGitVersion is used to check the version of git installed on the system diff --git a/vendor/github.com/hashicorp/go-getter/get_http.go b/vendor/github.com/hashicorp/go-getter/get_http.go index 3c02034..9acc72c 100644 --- a/vendor/github.com/hashicorp/go-getter/get_http.go +++ b/vendor/github.com/hashicorp/go-getter/get_http.go @@ -36,6 +36,10 @@ type HttpGetter struct { // Netrc, if true, will lookup and use auth information found // in the user's netrc file if available. Netrc bool + + // Client is the http.Client to use for Get requests. + // This defaults to a cleanhttp.DefaultClient if left unset. + Client *http.Client } func (g *HttpGetter) ClientMode(u *url.URL) (ClientMode, error) { @@ -57,13 +61,17 @@ func (g *HttpGetter) Get(dst string, u *url.URL) error { } } + if g.Client == nil { + g.Client = httpClient + } + // Add terraform-get to the parameter. q := u.Query() q.Add("terraform-get", "1") u.RawQuery = q.Encode() // Get the URL - resp, err := http.Get(u.String()) + resp, err := g.Client.Get(u.String()) if err != nil { return err } @@ -98,7 +106,18 @@ func (g *HttpGetter) Get(dst string, u *url.URL) error { } func (g *HttpGetter) GetFile(dst string, u *url.URL) error { - resp, err := http.Get(u.String()) + if g.Netrc { + // Add auth from netrc if we can + if err := addAuthFromNetrc(u); err != nil { + return err + } + } + + if g.Client == nil { + g.Client = httpClient + } + + resp, err := g.Client.Get(u.String()) if err != nil { return err } @@ -132,13 +151,22 @@ func (g *HttpGetter) getSubdir(dst, source, subDir string) error { } defer os.RemoveAll(td) + // We have to create a subdirectory that doesn't exist for the file + // getter to work. + td = filepath.Join(td, "data") + // Download that into the given directory if err := Get(td, source); err != nil { return err } + // Process any globbing + sourcePath, err := SubdirGlob(td, subDir) + if err != nil { + return err + } + // Make sure the subdir path actually exists - sourcePath := filepath.Join(td, subDir) if _, err := os.Stat(sourcePath); err != nil { return fmt.Errorf( "Error downloading %s: %s", source, err) diff --git a/vendor/github.com/hashicorp/go-getter/get_s3.go b/vendor/github.com/hashicorp/go-getter/get_s3.go index d3bffeb..ebb3217 100644 --- a/vendor/github.com/hashicorp/go-getter/get_s3.go +++ b/vendor/github.com/hashicorp/go-getter/get_s3.go @@ -28,7 +28,7 @@ func (g *S3Getter) ClientMode(u *url.URL) (ClientMode, error) { } // Create client config - config := g.getAWSConfig(region, creds) + config := g.getAWSConfig(region, u, creds) sess := session.New(config) client := s3.New(sess) @@ -84,7 +84,7 @@ func (g *S3Getter) Get(dst string, u *url.URL) error { return err } - config := g.getAWSConfig(region, creds) + config := g.getAWSConfig(region, u, creds) sess := session.New(config) client := s3.New(sess) @@ -139,7 +139,7 @@ func (g *S3Getter) GetFile(dst string, u *url.URL) error { return err } - config := g.getAWSConfig(region, creds) + config := g.getAWSConfig(region, u, creds) sess := session.New(config) client := s3.New(sess) return g.getObject(client, dst, bucket, path, version) @@ -174,7 +174,7 @@ func (g *S3Getter) getObject(client *s3.S3, dst, bucket, key, version string) er return err } -func (g *S3Getter) getAWSConfig(region string, creds *credentials.Credentials) *aws.Config { +func (g *S3Getter) getAWSConfig(region string, url *url.URL, creds *credentials.Credentials) *aws.Config { conf := &aws.Config{} if creds == nil { // Grab the metadata URL @@ -195,6 +195,14 @@ func (g *S3Getter) getAWSConfig(region string, creds *credentials.Credentials) * }) } + if creds != nil { + conf.Endpoint = &url.Host + conf.S3ForcePathStyle = aws.Bool(true) + if url.Scheme == "http" { + conf.DisableSSL = aws.Bool(true) + } + } + conf.Credentials = creds if region != "" { conf.Region = aws.String(region) @@ -204,29 +212,48 @@ func (g *S3Getter) getAWSConfig(region string, creds *credentials.Credentials) * } func (g *S3Getter) parseUrl(u *url.URL) (region, bucket, path, version string, creds *credentials.Credentials, err error) { - // Expected host style: s3.amazonaws.com. They always have 3 parts, - // although the first may differ if we're accessing a specific region. - hostParts := strings.Split(u.Host, ".") - if len(hostParts) != 3 { - err = fmt.Errorf("URL is not a valid S3 URL") - return - } + // This just check whether we are dealing with S3 or + // any other S3 compliant service. S3 has a predictable + // url as others do not + if strings.Contains(u.Host, "amazonaws.com") { + // Expected host style: s3.amazonaws.com. They always have 3 parts, + // although the first may differ if we're accessing a specific region. + hostParts := strings.Split(u.Host, ".") + if len(hostParts) != 3 { + err = fmt.Errorf("URL is not a valid S3 URL") + return + } - // Parse the region out of the first part of the host - region = strings.TrimPrefix(strings.TrimPrefix(hostParts[0], "s3-"), "s3") - if region == "" { - region = "us-east-1" - } + // Parse the region out of the first part of the host + region = strings.TrimPrefix(strings.TrimPrefix(hostParts[0], "s3-"), "s3") + if region == "" { + region = "us-east-1" + } - pathParts := strings.SplitN(u.Path, "/", 3) - if len(pathParts) != 3 { - err = fmt.Errorf("URL is not a valid S3 URL") - return - } + pathParts := strings.SplitN(u.Path, "/", 3) + if len(pathParts) != 3 { + err = fmt.Errorf("URL is not a valid S3 URL") + return + } + + bucket = pathParts[1] + path = pathParts[2] + version = u.Query().Get("version") - bucket = pathParts[1] - path = pathParts[2] - version = u.Query().Get("version") + } else { + pathParts := strings.SplitN(u.Path, "/", 3) + if len(pathParts) != 3 { + err = fmt.Errorf("URL is not a valid S3 complaint URL") + return + } + bucket = pathParts[1] + path = pathParts[2] + version = u.Query().Get("version") + region = u.Query().Get("region") + if region == "" { + region = "us-east-1" + } + } _, hasAwsId := u.Query()["aws_access_key_id"] _, hasAwsSecret := u.Query()["aws_access_key_secret"] diff --git a/vendor/github.com/hashicorp/go-getter/source.go b/vendor/github.com/hashicorp/go-getter/source.go index 4d5ee3c..47307ea 100644 --- a/vendor/github.com/hashicorp/go-getter/source.go +++ b/vendor/github.com/hashicorp/go-getter/source.go @@ -1,6 +1,8 @@ package getter import ( + "fmt" + "path/filepath" "strings" ) @@ -34,3 +36,22 @@ func SourceDirSubdir(src string) (string, string) { return src, subdir } + +// SubdirGlob returns the actual subdir with globbing processed. +// +// dst should be a destination directory that is already populated (the +// download is complete) and subDir should be the set subDir. If subDir +// is an empty string, this returns an empty string. +// +// The returned path is the full absolute path. +func SubdirGlob(dst, subDir string) (string, error) { + matches, err := filepath.Glob(filepath.Join(dst, subDir)) + if err != nil { + return "", err + } + if len(matches) > 1 { + return "", fmt.Errorf("subdir %q matches multiple paths", subDir) + } + + return matches[0], nil +} diff --git a/vendor/github.com/hashicorp/go-hclog/LICENSE b/vendor/github.com/hashicorp/go-hclog/LICENSE new file mode 100644 index 0000000..abaf1e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 HashiCorp + +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/hashicorp/go-hclog/README.md b/vendor/github.com/hashicorp/go-hclog/README.md new file mode 100644 index 0000000..614342b --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/README.md @@ -0,0 +1,123 @@ +# go-hclog + +[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] + +[godocs]: https://godoc.org/github.com/hashicorp/go-hclog + +`go-hclog` is a package for Go that provides a simple key/value logging +interface for use in development and production environments. + +It provides logging levels that provide decreased output based upon the +desired amount of output, unlike the standard library `log` package. + +It does not provide `Printf` style logging, only key/value logging that is +exposed as arguments to the logging functions for simplicity. + +It provides a human readable output mode for use in development as well as +JSON output mode for production. + +## Stability Note + +While this library is fully open source and HashiCorp will be maintaining it +(since we are and will be making extensive use of it), the API and output +format is subject to minor changes as we fully bake and vet it in our projects. +This notice will be removed once it's fully integrated into our major projects +and no further changes are anticipated. + +## Installation and Docs + +Install using `go get github.com/hashicorp/go-hclog`. + +Full documentation is available at +http://godoc.org/github.com/hashicorp/go-hclog + +## Usage + +### Use the global logger + +```go +hclog.Default().Info("hello world") +``` + +```text +2017-07-05T16:15:55.167-0700 [INFO ] hello world +``` + +(Note timestamps are removed in future examples for brevity.) + +### Create a new logger + +```go +appLogger := hclog.New(&hclog.LoggerOptions{ + Name: "my-app", + Level: hclog.LevelFromString("DEBUG"), +}) +``` + +### Emit an Info level message with 2 key/value pairs + +```go +input := "5.5" +_, err := strconv.ParseInt(input, 10, 32) +if err != nil { + appLogger.Info("Invalid input for ParseInt", "input", input, "error", err) +} +``` + +```text +... [INFO ] my-app: Invalid input for ParseInt: input=5.5 error="strconv.ParseInt: parsing "5.5": invalid syntax" +``` + +### Create a new Logger for a major subsystem + +```go +subsystemLogger := appLogger.Named("transport") +subsystemLogger.Info("we are transporting something") +``` + +```text +... [INFO ] my-app.transport: we are transporting something +``` + +Notice that logs emitted by `subsystemLogger` contain `my-app.transport`, +reflecting both the application and subsystem names. + +### Create a new Logger with fixed key/value pairs + +Using `With()` will include a specific key-value pair in all messages emitted +by that logger. + +```go +requestID := "5fb446b6-6eba-821d-df1b-cd7501b6a363" +requestLogger := subsystemLogger.With("request", requestID) +requestLogger.Info("we are transporting a request") +``` + +```text +... [INFO ] my-app.transport: we are transporting a request: request=5fb446b6-6eba-821d-df1b-cd7501b6a363 +``` + +This allows sub Loggers to be context specific without having to thread that +into all the callers. + +### Use this with code that uses the standard library logger + +If you want to use the standard library's `log.Logger` interface you can wrap +`hclog.Logger` by calling the `StandardLogger()` method. This allows you to use +it with the familiar `Println()`, `Printf()`, etc. For example: + +```go +stdLogger := appLogger.StandardLogger(&hclog.StandardLoggerOptions{ + InferLevels: true, +}) +// Printf() is provided by stdlib log.Logger interface, not hclog.Logger +stdLogger.Printf("[DEBUG] %+v", stdLogger) +``` + +```text +... [DEBUG] my-app: &{mu:{state:0 sema:0} prefix: flag:0 out:0xc42000a0a0 buf:[]} +``` + +Notice that if `appLogger` is initialized with the `INFO` log level _and_ you +specify `InferLevels: true`, you will not see any output here. You must change +`appLogger` to `DEBUG` to see output. See the docs for more information. diff --git a/vendor/github.com/hashicorp/go-hclog/global.go b/vendor/github.com/hashicorp/go-hclog/global.go new file mode 100644 index 0000000..55ce439 --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/global.go @@ -0,0 +1,34 @@ +package hclog + +import ( + "sync" +) + +var ( + protect sync.Once + def Logger + + // The options used to create the Default logger. These are + // read only when the Default logger is created, so set them + // as soon as the process starts. + DefaultOptions = &LoggerOptions{ + Level: DefaultLevel, + Output: DefaultOutput, + } +) + +// Return a logger that is held globally. This can be a good starting +// place, and then you can use .With() and .Name() to create sub-loggers +// to be used in more specific contexts. +func Default() Logger { + protect.Do(func() { + def = New(DefaultOptions) + }) + + return def +} + +// A short alias for Default() +func L() Logger { + return Default() +} diff --git a/vendor/github.com/hashicorp/go-hclog/int.go b/vendor/github.com/hashicorp/go-hclog/int.go new file mode 100644 index 0000000..c8609c3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/int.go @@ -0,0 +1,397 @@ +package hclog + +import ( + "bufio" + "encoding" + "encoding/json" + "fmt" + "log" + "os" + "runtime" + "strconv" + "strings" + "sync" + "time" +) + +var ( + _levelToBracket = map[Level]string{ + Debug: "[DEBUG]", + Trace: "[TRACE]", + Info: "[INFO ]", + Warn: "[WARN ]", + Error: "[ERROR]", + } +) + +// Given the options (nil for defaults), create a new Logger +func New(opts *LoggerOptions) Logger { + if opts == nil { + opts = &LoggerOptions{} + } + + output := opts.Output + if output == nil { + output = os.Stderr + } + + level := opts.Level + if level == NoLevel { + level = DefaultLevel + } + + return &intLogger{ + m: new(sync.Mutex), + json: opts.JSONFormat, + caller: opts.IncludeLocation, + name: opts.Name, + w: bufio.NewWriter(output), + level: level, + } +} + +// The internal logger implementation. Internal in that it is defined entirely +// by this package. +type intLogger struct { + json bool + caller bool + name string + + // this is a pointer so that it's shared by any derived loggers, since + // those derived loggers share the bufio.Writer as well. + m *sync.Mutex + w *bufio.Writer + level Level + + implied []interface{} +} + +// Make sure that intLogger is a Logger +var _ Logger = &intLogger{} + +// The time format to use for logging. This is a version of RFC3339 that +// contains millisecond precision +const TimeFormat = "2006-01-02T15:04:05.000Z0700" + +// Log a message and a set of key/value pairs if the given level is at +// or more severe that the threshold configured in the Logger. +func (z *intLogger) Log(level Level, msg string, args ...interface{}) { + if level < z.level { + return + } + + t := time.Now() + + z.m.Lock() + defer z.m.Unlock() + + if z.json { + z.logJson(t, level, msg, args...) + } else { + z.log(t, level, msg, args...) + } + + z.w.Flush() +} + +// Cleanup a path by returning the last 2 segments of the path only. +func trimCallerPath(path string) string { + // lovely borrowed from zap + // nb. To make sure we trim the path correctly on Windows too, we + // counter-intuitively need to use '/' and *not* os.PathSeparator here, + // because the path given originates from Go stdlib, specifically + // runtime.Caller() which (as of Mar/17) returns forward slashes even on + // Windows. + // + // See https://github.com/golang/go/issues/3335 + // and https://github.com/golang/go/issues/18151 + // + // for discussion on the issue on Go side. + // + + // Find the last separator. + // + idx := strings.LastIndexByte(path, '/') + if idx == -1 { + return path + } + + // Find the penultimate separator. + idx = strings.LastIndexByte(path[:idx], '/') + if idx == -1 { + return path + } + + return path[idx+1:] +} + +// Non-JSON logging format function +func (z *intLogger) log(t time.Time, level Level, msg string, args ...interface{}) { + z.w.WriteString(t.Format(TimeFormat)) + z.w.WriteByte(' ') + + s, ok := _levelToBracket[level] + if ok { + z.w.WriteString(s) + } else { + z.w.WriteString("[UNKN ]") + } + + if z.caller { + if _, file, line, ok := runtime.Caller(3); ok { + z.w.WriteByte(' ') + z.w.WriteString(trimCallerPath(file)) + z.w.WriteByte(':') + z.w.WriteString(strconv.Itoa(line)) + z.w.WriteByte(':') + } + } + + z.w.WriteByte(' ') + + if z.name != "" { + z.w.WriteString(z.name) + z.w.WriteString(": ") + } + + z.w.WriteString(msg) + + args = append(z.implied, args...) + + var stacktrace CapturedStacktrace + + if args != nil && len(args) > 0 { + if len(args)%2 != 0 { + cs, ok := args[len(args)-1].(CapturedStacktrace) + if ok { + args = args[:len(args)-1] + stacktrace = cs + } else { + args = append(args, "") + } + } + + z.w.WriteByte(':') + + FOR: + for i := 0; i < len(args); i = i + 2 { + var val string + + switch st := args[i+1].(type) { + case string: + val = st + case int: + val = strconv.FormatInt(int64(st), 10) + case int64: + val = strconv.FormatInt(int64(st), 10) + case int32: + val = strconv.FormatInt(int64(st), 10) + case int16: + val = strconv.FormatInt(int64(st), 10) + case int8: + val = strconv.FormatInt(int64(st), 10) + case uint: + val = strconv.FormatUint(uint64(st), 10) + case uint64: + val = strconv.FormatUint(uint64(st), 10) + case uint32: + val = strconv.FormatUint(uint64(st), 10) + case uint16: + val = strconv.FormatUint(uint64(st), 10) + case uint8: + val = strconv.FormatUint(uint64(st), 10) + case CapturedStacktrace: + stacktrace = st + continue FOR + default: + val = fmt.Sprintf("%v", st) + } + + z.w.WriteByte(' ') + z.w.WriteString(args[i].(string)) + z.w.WriteByte('=') + + if strings.ContainsAny(val, " \t\n\r") { + z.w.WriteByte('"') + z.w.WriteString(val) + z.w.WriteByte('"') + } else { + z.w.WriteString(val) + } + } + } + + z.w.WriteString("\n") + + if stacktrace != "" { + z.w.WriteString(string(stacktrace)) + } +} + +// JSON logging function +func (z *intLogger) logJson(t time.Time, level Level, msg string, args ...interface{}) { + vals := map[string]interface{}{ + "@message": msg, + "@timestamp": t.Format("2006-01-02T15:04:05.000000Z07:00"), + } + + var levelStr string + switch level { + case Error: + levelStr = "error" + case Warn: + levelStr = "warn" + case Info: + levelStr = "info" + case Debug: + levelStr = "debug" + case Trace: + levelStr = "trace" + default: + levelStr = "all" + } + + vals["@level"] = levelStr + + if z.name != "" { + vals["@module"] = z.name + } + + if z.caller { + if _, file, line, ok := runtime.Caller(3); ok { + vals["@caller"] = fmt.Sprintf("%s:%d", file, line) + } + } + + if args != nil && len(args) > 0 { + if len(args)%2 != 0 { + cs, ok := args[len(args)-1].(CapturedStacktrace) + if ok { + args = args[:len(args)-1] + vals["stacktrace"] = cs + } else { + args = append(args, "") + } + } + + for i := 0; i < len(args); i = i + 2 { + if _, ok := args[i].(string); !ok { + // As this is the logging function not much we can do here + // without injecting into logs... + continue + } + val := args[i+1] + // Check if val is of type error. If error type doesn't + // implement json.Marshaler or encoding.TextMarshaler + // then set val to err.Error() so that it gets marshaled + if err, ok := val.(error); ok { + switch err.(type) { + case json.Marshaler, encoding.TextMarshaler: + default: + val = err.Error() + } + } + vals[args[i].(string)] = val + } + } + + err := json.NewEncoder(z.w).Encode(vals) + if err != nil { + panic(err) + } +} + +// Emit the message and args at DEBUG level +func (z *intLogger) Debug(msg string, args ...interface{}) { + z.Log(Debug, msg, args...) +} + +// Emit the message and args at TRACE level +func (z *intLogger) Trace(msg string, args ...interface{}) { + z.Log(Trace, msg, args...) +} + +// Emit the message and args at INFO level +func (z *intLogger) Info(msg string, args ...interface{}) { + z.Log(Info, msg, args...) +} + +// Emit the message and args at WARN level +func (z *intLogger) Warn(msg string, args ...interface{}) { + z.Log(Warn, msg, args...) +} + +// Emit the message and args at ERROR level +func (z *intLogger) Error(msg string, args ...interface{}) { + z.Log(Error, msg, args...) +} + +// Indicate that the logger would emit TRACE level logs +func (z *intLogger) IsTrace() bool { + return z.level == Trace +} + +// Indicate that the logger would emit DEBUG level logs +func (z *intLogger) IsDebug() bool { + return z.level <= Debug +} + +// Indicate that the logger would emit INFO level logs +func (z *intLogger) IsInfo() bool { + return z.level <= Info +} + +// Indicate that the logger would emit WARN level logs +func (z *intLogger) IsWarn() bool { + return z.level <= Warn +} + +// Indicate that the logger would emit ERROR level logs +func (z *intLogger) IsError() bool { + return z.level <= Error +} + +// Return a sub-Logger for which every emitted log message will contain +// the given key/value pairs. This is used to create a context specific +// Logger. +func (z *intLogger) With(args ...interface{}) Logger { + var nz intLogger = *z + + nz.implied = append(nz.implied, args...) + + return &nz +} + +// Create a new sub-Logger that a name decending from the current name. +// This is used to create a subsystem specific Logger. +func (z *intLogger) Named(name string) Logger { + var nz intLogger = *z + + if nz.name != "" { + nz.name = nz.name + "." + name + } + + return &nz +} + +// Create a new sub-Logger with an explicit name. This ignores the current +// name. This is used to create a standalone logger that doesn't fall +// within the normal hierarchy. +func (z *intLogger) ResetNamed(name string) Logger { + var nz intLogger = *z + + nz.name = name + + return &nz +} + +// Create a *log.Logger that will send it's data through this Logger. This +// allows packages that expect to be using the standard library log to actually +// use this logger. +func (z *intLogger) StandardLogger(opts *StandardLoggerOptions) *log.Logger { + if opts == nil { + opts = &StandardLoggerOptions{} + } + + return log.New(&stdlogAdapter{z, opts.InferLevels}, "", 0) +} diff --git a/vendor/github.com/hashicorp/go-hclog/log.go b/vendor/github.com/hashicorp/go-hclog/log.go new file mode 100644 index 0000000..1b36f81 --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/log.go @@ -0,0 +1,138 @@ +package hclog + +import ( + "io" + "log" + "os" + "strings" +) + +var ( + DefaultOutput = os.Stderr + DefaultLevel = Info +) + +type Level int + +const ( + // This is a special level used to indicate that no level has been + // set and allow for a default to be used. + NoLevel Level = 0 + + // The most verbose level. Intended to be used for the tracing of actions + // in code, such as function enters/exits, etc. + Trace Level = 1 + + // For programmer lowlevel analysis. + Debug Level = 2 + + // For information about steady state operations. + Info Level = 3 + + // For information about rare but handled events. + Warn Level = 4 + + // For information about unrecoverable events. + Error Level = 5 +) + +// LevelFromString returns a Level type for the named log level, or "NoLevel" if +// the level string is invalid. This facilitates setting the log level via +// config or environment variable by name in a predictable way. +func LevelFromString(levelStr string) Level { + // We don't care about case. Accept "INFO" or "info" + levelStr = strings.ToLower(strings.TrimSpace(levelStr)) + switch levelStr { + case "trace": + return Trace + case "debug": + return Debug + case "info": + return Info + case "warn": + return Warn + case "error": + return Error + default: + return NoLevel + } +} + +// The main Logger interface. All code should code against this interface only. +type Logger interface { + // Args are alternating key, val pairs + // keys must be strings + // vals can be any type, but display is implementation specific + // Emit a message and key/value pairs at the TRACE level + Trace(msg string, args ...interface{}) + + // Emit a message and key/value pairs at the DEBUG level + Debug(msg string, args ...interface{}) + + // Emit a message and key/value pairs at the INFO level + Info(msg string, args ...interface{}) + + // Emit a message and key/value pairs at the WARN level + Warn(msg string, args ...interface{}) + + // Emit a message and key/value pairs at the ERROR level + Error(msg string, args ...interface{}) + + // Indicate if TRACE logs would be emitted. This and the other Is* guards + // are used to elide expensive logging code based on the current level. + IsTrace() bool + + // Indicate if DEBUG logs would be emitted. This and the other Is* guards + IsDebug() bool + + // Indicate if INFO logs would be emitted. This and the other Is* guards + IsInfo() bool + + // Indicate if WARN logs would be emitted. This and the other Is* guards + IsWarn() bool + + // Indicate if ERROR logs would be emitted. This and the other Is* guards + IsError() bool + + // Creates a sublogger that will always have the given key/value pairs + With(args ...interface{}) Logger + + // Create a logger that will prepend the name string on the front of all messages. + // If the logger already has a name, the new value will be appended to the current + // name. That way, a major subsystem can use this to decorate all it's own logs + // without losing context. + Named(name string) Logger + + // Create a logger that will prepend the name string on the front of all messages. + // This sets the name of the logger to the value directly, unlike Named which honor + // the current name as well. + ResetNamed(name string) Logger + + // Return a value that conforms to the stdlib log.Logger interface + StandardLogger(opts *StandardLoggerOptions) *log.Logger +} + +type StandardLoggerOptions struct { + // Indicate that some minimal parsing should be done on strings to try + // and detect their level and re-emit them. + // This supports the strings like [ERROR], [ERR] [TRACE], [WARN], [INFO], + // [DEBUG] and strip it off before reapplying it. + InferLevels bool +} + +type LoggerOptions struct { + // Name of the subsystem to prefix logs with + Name string + + // The threshold for the logger. Anything less severe is supressed + Level Level + + // Where to write the logs to. Defaults to os.Stdout if nil + Output io.Writer + + // Control if the output should be in JSON. + JSONFormat bool + + // Include file and line information in each log line + IncludeLocation bool +} diff --git a/vendor/github.com/hashicorp/go-hclog/stacktrace.go b/vendor/github.com/hashicorp/go-hclog/stacktrace.go new file mode 100644 index 0000000..8af1a3b --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/stacktrace.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016 Uber Technologies, Inc. +// +// 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. + +package hclog + +import ( + "bytes" + "runtime" + "strconv" + "strings" + "sync" +) + +var ( + _stacktraceIgnorePrefixes = []string{ + "runtime.goexit", + "runtime.main", + } + _stacktracePool = sync.Pool{ + New: func() interface{} { + return newProgramCounters(64) + }, + } +) + +// A stacktrace gathered by a previous call to log.Stacktrace. If passed +// to a logging function, the stacktrace will be appended. +type CapturedStacktrace string + +// Gather a stacktrace of the current goroutine and return it to be passed +// to a logging function. +func Stacktrace() CapturedStacktrace { + return CapturedStacktrace(takeStacktrace()) +} + +func takeStacktrace() string { + programCounters := _stacktracePool.Get().(*programCounters) + defer _stacktracePool.Put(programCounters) + + var buffer bytes.Buffer + + for { + // Skip the call to runtime.Counters and takeStacktrace so that the + // program counters start at the caller of takeStacktrace. + n := runtime.Callers(2, programCounters.pcs) + if n < cap(programCounters.pcs) { + programCounters.pcs = programCounters.pcs[:n] + break + } + // Don't put the too-short counter slice back into the pool; this lets + // the pool adjust if we consistently take deep stacktraces. + programCounters = newProgramCounters(len(programCounters.pcs) * 2) + } + + i := 0 + frames := runtime.CallersFrames(programCounters.pcs) + for frame, more := frames.Next(); more; frame, more = frames.Next() { + if shouldIgnoreStacktraceFunction(frame.Function) { + continue + } + if i != 0 { + buffer.WriteByte('\n') + } + i++ + buffer.WriteString(frame.Function) + buffer.WriteByte('\n') + buffer.WriteByte('\t') + buffer.WriteString(frame.File) + buffer.WriteByte(':') + buffer.WriteString(strconv.Itoa(int(frame.Line))) + } + + return buffer.String() +} + +func shouldIgnoreStacktraceFunction(function string) bool { + for _, prefix := range _stacktraceIgnorePrefixes { + if strings.HasPrefix(function, prefix) { + return true + } + } + return false +} + +type programCounters struct { + pcs []uintptr +} + +func newProgramCounters(size int) *programCounters { + return &programCounters{make([]uintptr, size)} +} diff --git a/vendor/github.com/hashicorp/go-hclog/stdlog.go b/vendor/github.com/hashicorp/go-hclog/stdlog.go new file mode 100644 index 0000000..2bb927f --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/stdlog.go @@ -0,0 +1,62 @@ +package hclog + +import ( + "bytes" + "strings" +) + +// Provides a io.Writer to shim the data out of *log.Logger +// and back into our Logger. This is basically the only way to +// build upon *log.Logger. +type stdlogAdapter struct { + hl Logger + inferLevels bool +} + +// Take the data, infer the levels if configured, and send it through +// a regular Logger +func (s *stdlogAdapter) Write(data []byte) (int, error) { + str := string(bytes.TrimRight(data, " \t\n")) + + if s.inferLevels { + level, str := s.pickLevel(str) + switch level { + case Trace: + s.hl.Trace(str) + case Debug: + s.hl.Debug(str) + case Info: + s.hl.Info(str) + case Warn: + s.hl.Warn(str) + case Error: + s.hl.Error(str) + default: + s.hl.Info(str) + } + } else { + s.hl.Info(str) + } + + return len(data), nil +} + +// Detect, based on conventions, what log level this is +func (s *stdlogAdapter) pickLevel(str string) (Level, string) { + switch { + case strings.HasPrefix(str, "[DEBUG]"): + return Debug, strings.TrimSpace(str[7:]) + case strings.HasPrefix(str, "[TRACE]"): + return Trace, strings.TrimSpace(str[7:]) + case strings.HasPrefix(str, "[INFO]"): + return Info, strings.TrimSpace(str[6:]) + case strings.HasPrefix(str, "[WARN]"): + return Warn, strings.TrimSpace(str[7:]) + case strings.HasPrefix(str, "[ERROR]"): + return Error, strings.TrimSpace(str[7:]) + case strings.HasPrefix(str, "[ERR]"): + return Error, strings.TrimSpace(str[5:]) + default: + return Info, str + } +} diff --git a/vendor/github.com/hashicorp/go-plugin/README.md b/vendor/github.com/hashicorp/go-plugin/README.md index 2058cfb..78d354e 100644 --- a/vendor/github.com/hashicorp/go-plugin/README.md +++ b/vendor/github.com/hashicorp/go-plugin/README.md @@ -1,10 +1,9 @@ # Go Plugin System over RPC `go-plugin` is a Go (golang) plugin system over RPC. It is the plugin system -that has been in use by HashiCorp tooling for over 3 years. While initially -created for [Packer](https://www.packer.io), it has since been used by -[Terraform](https://www.terraform.io) and [Otto](https://www.ottoproject.io), -with plans to also use it for [Nomad](https://www.nomadproject.io) and +that has been in use by HashiCorp tooling for over 4 years. While initially +created for [Packer](https://www.packer.io), it is additionally in use by +[Terraform](https://www.terraform.io), [Nomad](https://www.nomadproject.io), and [Vault](https://www.vaultproject.io). While the plugin system is over RPC, it is currently only designed to work @@ -24,6 +23,11 @@ interface as if it were going to run in the same process. For a plugin user: you just use and call functions on an interface as if it were in the same process. This plugin system handles the communication in between. +**Cross-language support.** Plugins can be written (and consumed) by +almost every major language. This library supports serving plugins via +[gRPC](http://www.grpc.io). gRPC-based plugins enable plugins to be written +in any language. + **Complex arguments and return values are supported.** This library provides APIs for handling complex arguments and return values such as interfaces, `io.Reader/Writer`, etc. We do this by giving you a library @@ -37,7 +41,10 @@ and the plugin can call back into the host process. **Built-in Logging.** Any plugins that use the `log` standard library will have log data automatically sent to the host process. The host process will mirror this output prefixed with the path to the plugin -binary. This makes debugging with plugins simple. +binary. This makes debugging with plugins simple. If the host system +uses [hclog](https://github.com/hashicorp/go-hclog) then the log data +will be structured. If the plugin also uses hclog, logs from the plugin +will be sent to the host hclog and be structured. **Protocol Versioning.** A very basic "protocol version" is supported that can be incremented to invalidate any previous plugins. This is useful when @@ -62,13 +69,18 @@ This requires the host/plugin to know this is possible and daemonize properly. `NewClient` takes a `ReattachConfig` to determine if and how to reattach. +**Cryptographically Secure Plugins.** Plugins can be verified with an expected +checksum and RPC communications can be configured to use TLS. The host process +must be properly secured to protect this configuration. + ## Architecture The HashiCorp plugin system works by launching subprocesses and communicating -over RPC (using standard `net/rpc`). A single connection is made between -any plugin and the host process, and we use a -[connection multiplexing](https://github.com/hashicorp/yamux) -library to multiplex any other connections on top. +over RPC (using standard `net/rpc` or [gRPC](http://www.grpc.io). A single +connection is made between any plugin and the host process. For net/rpc-based +plugins, we use a [connection multiplexing](https://github.com/hashicorp/yamux) +library to multiplex any other connections on top. For gRPC-based plugins, +the HTTP2 protocol handles multiplexing. This architecture has a number of benefits: @@ -76,8 +88,8 @@ This architecture has a number of benefits: panic the plugin user. * Plugins are very easy to write: just write a Go application and `go build`. - Theoretically you could also use another language as long as it can - communicate the Go `net/rpc` protocol but this hasn't yet been tried. + Or use any other language to write a gRPC server with a tiny amount of + boilerplate to support go-plugin. * Plugins are very easy to install: just put the binary in a location where the host will find it (depends on the host but this library also provides @@ -85,8 +97,8 @@ This architecture has a number of benefits: * Plugins can be relatively secure: The plugin only has access to the interfaces and args given to it, not to the entire memory space of the - process. More security features are planned (see the coming soon section - below). + process. Additionally, go-plugin can communicate with the plugin over + TLS. ## Usage @@ -97,10 +109,9 @@ high-level steps that must be done. Examples are available in the 1. Choose the interface(s) you want to expose for plugins. 2. For each interface, implement an implementation of that interface - that communicates over an `*rpc.Client` (from the standard `net/rpc` - package) for every function call. Likewise, implement the RPC server - struct this communicates to which is then communicating to a real, - concrete implementation. + that communicates over a `net/rpc` connection or other a + [gRPC](http://www.grpc.io) connection or both. You'll have to implement + both a client and server implementation. 3. Create a `Plugin` implementation that knows how to create the RPC client/server for a given plugin type. @@ -125,10 +136,6 @@ improvements we can make. At this point in time, the roadmap for the plugin system is: -**Cryptographically Secure Plugins.** We'll implement signing plugins -and loading signed plugins in order to allow Vault to make use of multi-process -in a secure way. - **Semantic Versioning.** Plugins will be able to implement a semantic version. This plugin system will give host processes a system for constraining versions. This is in addition to the protocol versioning already present diff --git a/vendor/github.com/hashicorp/go-plugin/client.go b/vendor/github.com/hashicorp/go-plugin/client.go index 3692736..b912826 100644 --- a/vendor/github.com/hashicorp/go-plugin/client.go +++ b/vendor/github.com/hashicorp/go-plugin/client.go @@ -2,8 +2,11 @@ package plugin import ( "bufio" + "crypto/subtle" + "crypto/tls" "errors" "fmt" + "hash" "io" "io/ioutil" "log" @@ -17,6 +20,8 @@ import ( "sync/atomic" "time" "unicode" + + hclog "github.com/hashicorp/go-hclog" ) // If this is 1, then we've called CleanupClients. This can be used @@ -28,12 +33,29 @@ var Killed uint32 = 0 // This is a slice of the "managed" clients which are cleaned up when // calling Cleanup var managedClients = make([]*Client, 0, 5) +var managedClientsLock sync.Mutex // Error types var ( // ErrProcessNotFound is returned when a client is instantiated to // reattach to an existing process and it isn't found. ErrProcessNotFound = errors.New("Reattachment process not found") + + // ErrChecksumsDoNotMatch is returned when binary's checksum doesn't match + // the one provided in the SecureConfig. + ErrChecksumsDoNotMatch = errors.New("checksums did not match") + + // ErrSecureNoChecksum is returned when an empty checksum is provided to the + // SecureConfig. + ErrSecureConfigNoChecksum = errors.New("no checksum provided") + + // ErrSecureNoHash is returned when a nil Hash object is provided to the + // SecureConfig. + ErrSecureConfigNoHash = errors.New("no hash implementation provided") + + // ErrSecureConfigAndReattach is returned when both Reattach and + // SecureConfig are set. + ErrSecureConfigAndReattach = errors.New("only one of Reattach or SecureConfig can be set") ) // Client handles the lifecycle of a plugin application. It launches @@ -54,7 +76,9 @@ type Client struct { l sync.Mutex address net.Addr process *os.Process - client *RPCClient + client ClientProtocol + protocol Protocol + logger hclog.Logger } // ClientConfig is the configuration used to initialize a new @@ -78,6 +102,13 @@ type ClientConfig struct { Cmd *exec.Cmd Reattach *ReattachConfig + // SecureConfig is configuration for verifying the integrity of the + // executable. It can not be used with Reattach. + SecureConfig *SecureConfig + + // TLSConfig is used to enable TLS on the RPC client. + TLSConfig *tls.Config + // Managed represents if the client should be managed by the // plugin package or not. If true, then by calling CleanupClients, // it will automatically be cleaned up. Otherwise, the client @@ -108,14 +139,74 @@ type ClientConfig struct { // sync any of these streams. SyncStdout io.Writer SyncStderr io.Writer + + // AllowedProtocols is a list of allowed protocols. If this isn't set, + // then only netrpc is allowed. This is so that older go-plugin systems + // can show friendly errors if they see a plugin with an unknown + // protocol. + // + // By setting this, you can cause an error immediately on plugin start + // if an unsupported protocol is used with a good error message. + // + // If this isn't set at all (nil value), then only net/rpc is accepted. + // This is done for legacy reasons. You must explicitly opt-in to + // new protocols. + AllowedProtocols []Protocol + + // Logger is the logger that the client will used. If none is provided, + // it will default to hclog's default logger. + Logger hclog.Logger } // ReattachConfig is used to configure a client to reattach to an // already-running plugin process. You can retrieve this information by // calling ReattachConfig on Client. type ReattachConfig struct { - Addr net.Addr - Pid int + Protocol Protocol + Addr net.Addr + Pid int +} + +// SecureConfig is used to configure a client to verify the integrity of an +// executable before running. It does this by verifying the checksum is +// expected. Hash is used to specify the hashing method to use when checksumming +// the file. The configuration is verified by the client by calling the +// SecureConfig.Check() function. +// +// The host process should ensure the checksum was provided by a trusted and +// authoritative source. The binary should be installed in such a way that it +// can not be modified by an unauthorized user between the time of this check +// and the time of execution. +type SecureConfig struct { + Checksum []byte + Hash hash.Hash +} + +// Check takes the filepath to an executable and returns true if the checksum of +// the file matches the checksum provided in the SecureConfig. +func (s *SecureConfig) Check(filePath string) (bool, error) { + if len(s.Checksum) == 0 { + return false, ErrSecureConfigNoChecksum + } + + if s.Hash == nil { + return false, ErrSecureConfigNoHash + } + + file, err := os.Open(filePath) + if err != nil { + return false, err + } + defer file.Close() + + _, err = io.Copy(s.Hash, file) + if err != nil { + return false, err + } + + sum := s.Hash.Sum(nil) + + return subtle.ConstantTimeCompare(sum, s.Checksum) == 1, nil } // This makes sure all the managed subprocesses are killed and properly @@ -130,6 +221,7 @@ func CleanupClients() { // Kill all the managed clients in parallel and use a WaitGroup // to wait for them all to finish up. var wg sync.WaitGroup + managedClientsLock.Lock() for _, client := range managedClients { wg.Add(1) @@ -138,6 +230,7 @@ func CleanupClients() { wg.Done() }(client) } + managedClientsLock.Unlock() log.Println("[DEBUG] plugin: waiting for all plugin processes to complete...") wg.Wait() @@ -171,19 +264,36 @@ func NewClient(config *ClientConfig) (c *Client) { config.SyncStderr = ioutil.Discard } - c = &Client{config: config} + if config.AllowedProtocols == nil { + config.AllowedProtocols = []Protocol{ProtocolNetRPC} + } + + if config.Logger == nil { + config.Logger = hclog.New(&hclog.LoggerOptions{ + Output: hclog.DefaultOutput, + Level: hclog.Trace, + Name: "plugin", + }) + } + + c = &Client{ + config: config, + logger: config.Logger, + } if config.Managed { + managedClientsLock.Lock() managedClients = append(managedClients, c) + managedClientsLock.Unlock() } return } -// Client returns an RPC client for the plugin. +// Client returns the protocol client for this connection. // -// Subsequent calls to this will return the same RPC client. -func (c *Client) Client() (*RPCClient, error) { - addr, err := c.Start() +// Subsequent calls to this will return the same client. +func (c *Client) Client() (ClientProtocol, error) { + _, err := c.Start() if err != nil { return nil, err } @@ -195,29 +305,18 @@ func (c *Client) Client() (*RPCClient, error) { return c.client, nil } - // Connect to the client - conn, err := net.Dial(addr.Network(), addr.String()) - if err != nil { - return nil, err - } - if tcpConn, ok := conn.(*net.TCPConn); ok { - // Make sure to set keep alive so that the connection doesn't die - tcpConn.SetKeepAlive(true) - } + switch c.protocol { + case ProtocolNetRPC: + c.client, err = newRPCClient(c) - // Create the actual RPC client - c.client, err = NewRPCClient(conn, c.config.Plugins) - if err != nil { - conn.Close() - return nil, err + case ProtocolGRPC: + c.client, err = newGRPCClient(c) + + default: + return nil, fmt.Errorf("unknown server protocol: %s", c.protocol) } - // Begin the stream syncing so that stdin, out, err work properly - err = c.client.SyncStreams( - c.config.SyncStdout, - c.config.SyncStderr) if err != nil { - c.client.Close() c.client = nil return nil, err } @@ -239,23 +338,57 @@ func (c *Client) Exited() bool { // // This method can safely be called multiple times. func (c *Client) Kill() { - if c.process == nil { + // Grab a lock to read some private fields. + c.l.Lock() + process := c.process + addr := c.address + doneCh := c.doneLogging + c.l.Unlock() + + // If there is no process, we never started anything. Nothing to kill. + if process == nil { return } - // Close the client to cleanly exit the process - client, err := c.Client() - if err == nil { - err = client.Close() + // We need to check for address here. It is possible that the plugin + // started (process != nil) but has no address (addr == nil) if the + // plugin failed at startup. If we do have an address, we need to close + // the plugin net connections. + graceful := false + if addr != nil { + // Close the client to cleanly exit the process. + client, err := c.Client() + if err == nil { + err = client.Close() + + // If there is no error, then we attempt to wait for a graceful + // exit. If there was an error, we assume that graceful cleanup + // won't happen and just force kill. + graceful = err == nil + if err != nil { + // If there was an error just log it. We're going to force + // kill in a moment anyways. + c.logger.Warn("error closing client during Kill", "err", err) + } + } } - if err != nil { - // If something went wrong somewhere gracefully quitting the - // plugin, we just force kill it. - c.process.Kill() + + // If we're attempting a graceful exit, then we wait for a short period + // of time to allow that to happen. To wait for this we just wait on the + // doneCh which would be closed if the process exits. + if graceful { + select { + case <-doneCh: + return + case <-time.After(250 * time.Millisecond): + } } + // If graceful exiting failed, just kill it + process.Kill() + // Wait for the client to finish logging so we have a complete log - <-c.doneLogging + <-doneCh } // Starts the underlying subprocess, communicating with it to negotiate @@ -278,9 +411,14 @@ func (c *Client) Start() (addr net.Addr, err error) { { cmdSet := c.config.Cmd != nil attachSet := c.config.Reattach != nil + secureSet := c.config.SecureConfig != nil if cmdSet == attachSet { return nil, fmt.Errorf("Only one of Cmd or Reattach must be set") } + + if secureSet && attachSet { + return nil, ErrSecureConfigAndReattach + } } // Create the logging channel for when we kill @@ -310,7 +448,7 @@ func (c *Client) Start() (addr net.Addr, err error) { pidWait(pid) // Log so we can see it - log.Printf("[DEBUG] plugin: reattached plugin process exited\n") + c.logger.Debug("reattached plugin process exited") // Mark it c.l.Lock() @@ -324,6 +462,11 @@ func (c *Client) Start() (addr net.Addr, err error) { // Set the address and process c.address = c.config.Reattach.Addr c.process = p + c.protocol = c.config.Reattach.Protocol + if c.protocol == "" { + // Default the protocol to net/rpc for backwards compatibility + c.protocol = ProtocolNetRPC + } return c.address, nil } @@ -344,7 +487,15 @@ func (c *Client) Start() (addr net.Addr, err error) { cmd.Stderr = stderr_w cmd.Stdout = stdout_w - log.Printf("[DEBUG] plugin: starting plugin: %s %#v", cmd.Path, cmd.Args) + if c.config.SecureConfig != nil { + if ok, err := c.config.SecureConfig.Check(cmd.Path); err != nil { + return nil, fmt.Errorf("error verifying checksum: %s", err) + } else if !ok { + return nil, ErrChecksumsDoNotMatch + } + } + + c.logger.Debug("starting plugin", "path", cmd.Path, "args", cmd.Args) err = cmd.Start() if err != nil { return @@ -378,7 +529,7 @@ func (c *Client) Start() (addr net.Addr, err error) { cmd.Wait() // Log and make sure to flush the logs write away - log.Printf("[DEBUG] plugin: %s: plugin process exited\n", cmd.Path) + c.logger.Debug("plugin process exited", "path", cmd.Path) os.Stderr.Sync() // Mark that we exited @@ -425,7 +576,7 @@ func (c *Client) Start() (addr net.Addr, err error) { timeout := time.After(c.config.StartTimeout) // Start looking for the address - log.Printf("[DEBUG] plugin: waiting for RPC address for: %s", cmd.Path) + c.logger.Debug("waiting for RPC address", "path", cmd.Path) select { case <-timeout: err = errors.New("timeout while waiting for plugin to start") @@ -435,7 +586,7 @@ func (c *Client) Start() (addr net.Addr, err error) { // Trim the line and split by "|" in order to get the parts of // the output. line := strings.TrimSpace(string(lineBytes)) - parts := strings.SplitN(line, "|", 4) + parts := strings.SplitN(line, "|", 6) if len(parts) < 4 { err = fmt.Errorf( "Unrecognized remote plugin message: %s\n\n"+ @@ -485,6 +636,27 @@ func (c *Client) Start() (addr net.Addr, err error) { default: err = fmt.Errorf("Unknown address type: %s", parts[3]) } + + // If we have a server type, then record that. We default to net/rpc + // for backwards compatibility. + c.protocol = ProtocolNetRPC + if len(parts) >= 5 { + c.protocol = Protocol(parts[4]) + } + + found := false + for _, p := range c.config.AllowedProtocols { + if p == c.protocol { + found = true + break + } + } + if !found { + err = fmt.Errorf("Unsupported plugin protocol %q. Supported: %v", + c.protocol, c.config.AllowedProtocols) + return + } + } c.address = addr @@ -515,20 +687,79 @@ func (c *Client) ReattachConfig() *ReattachConfig { } return &ReattachConfig{ - Addr: c.address, - Pid: c.config.Cmd.Process.Pid, + Protocol: c.protocol, + Addr: c.address, + Pid: c.config.Cmd.Process.Pid, } } +// Protocol returns the protocol of server on the remote end. This will +// start the plugin process if it isn't already started. Errors from +// starting the plugin are surpressed and ProtocolInvalid is returned. It +// is recommended you call Start explicitly before calling Protocol to ensure +// no errors occur. +func (c *Client) Protocol() Protocol { + _, err := c.Start() + if err != nil { + return ProtocolInvalid + } + + return c.protocol +} + +// dialer is compatible with grpc.WithDialer and creates the connection +// to the plugin. +func (c *Client) dialer(_ string, timeout time.Duration) (net.Conn, error) { + // Connect to the client + conn, err := net.Dial(c.address.Network(), c.address.String()) + if err != nil { + return nil, err + } + if tcpConn, ok := conn.(*net.TCPConn); ok { + // Make sure to set keep alive so that the connection doesn't die + tcpConn.SetKeepAlive(true) + } + + // If we have a TLS config we wrap our connection. We only do this + // for net/rpc since gRPC uses its own mechanism for TLS. + if c.protocol == ProtocolNetRPC && c.config.TLSConfig != nil { + conn = tls.Client(conn, c.config.TLSConfig) + } + + return conn, nil +} + func (c *Client) logStderr(r io.Reader) { bufR := bufio.NewReader(r) for { line, err := bufR.ReadString('\n') if line != "" { c.config.Stderr.Write([]byte(line)) - line = strings.TrimRightFunc(line, unicode.IsSpace) - log.Printf("[DEBUG] plugin: %s: %s", filepath.Base(c.config.Cmd.Path), line) + + l := c.logger.Named(filepath.Base(c.config.Cmd.Path)) + + entry, err := parseJSON(line) + // If output is not JSON format, print directly to Debug + if err != nil { + l.Debug(line) + } else { + out := flattenKVPairs(entry.KVPairs) + + l = l.With("timestamp", entry.Timestamp.Format(hclog.TimeFormat)) + switch hclog.LevelFromString(entry.Level) { + case hclog.Trace: + l.Trace(entry.Message, out...) + case hclog.Debug: + l.Debug(entry.Message, out...) + case hclog.Info: + l.Info(entry.Message, out...) + case hclog.Warn: + l.Warn(entry.Message, out...) + case hclog.Error: + l.Error(entry.Message, out...) + } + } } if err == io.EOF { diff --git a/vendor/github.com/hashicorp/go-plugin/grpc_client.go b/vendor/github.com/hashicorp/go-plugin/grpc_client.go new file mode 100644 index 0000000..3bcf95e --- /dev/null +++ b/vendor/github.com/hashicorp/go-plugin/grpc_client.go @@ -0,0 +1,83 @@ +package plugin + +import ( + "fmt" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/health/grpc_health_v1" +) + +// newGRPCClient creates a new GRPCClient. The Client argument is expected +// to be successfully started already with a lock held. +func newGRPCClient(c *Client) (*GRPCClient, error) { + // Build dialing options. + opts := make([]grpc.DialOption, 0, 5) + + // We use a custom dialer so that we can connect over unix domain sockets + opts = append(opts, grpc.WithDialer(c.dialer)) + + // go-plugin expects to block the connection + opts = append(opts, grpc.WithBlock()) + + // Fail right away + opts = append(opts, grpc.FailOnNonTempDialError(true)) + + // If we have no TLS configuration set, we need to explicitly tell grpc + // that we're connecting with an insecure connection. + if c.config.TLSConfig == nil { + opts = append(opts, grpc.WithInsecure()) + } else { + opts = append(opts, grpc.WithTransportCredentials( + credentials.NewTLS(c.config.TLSConfig))) + } + + // Connect. Note the first parameter is unused because we use a custom + // dialer that has the state to see the address. + conn, err := grpc.Dial("unused", opts...) + if err != nil { + return nil, err + } + + return &GRPCClient{ + Conn: conn, + Plugins: c.config.Plugins, + }, nil +} + +// GRPCClient connects to a GRPCServer over gRPC to dispense plugin types. +type GRPCClient struct { + Conn *grpc.ClientConn + Plugins map[string]Plugin +} + +// ClientProtocol impl. +func (c *GRPCClient) Close() error { + return c.Conn.Close() +} + +// ClientProtocol impl. +func (c *GRPCClient) Dispense(name string) (interface{}, error) { + raw, ok := c.Plugins[name] + if !ok { + return nil, fmt.Errorf("unknown plugin type: %s", name) + } + + p, ok := raw.(GRPCPlugin) + if !ok { + return nil, fmt.Errorf("plugin %q doesn't support gRPC", name) + } + + return p.GRPCClient(c.Conn) +} + +// ClientProtocol impl. +func (c *GRPCClient) Ping() error { + client := grpc_health_v1.NewHealthClient(c.Conn) + _, err := client.Check(context.Background(), &grpc_health_v1.HealthCheckRequest{ + Service: GRPCServiceName, + }) + + return err +} diff --git a/vendor/github.com/hashicorp/go-plugin/grpc_server.go b/vendor/github.com/hashicorp/go-plugin/grpc_server.go new file mode 100644 index 0000000..177a0cd --- /dev/null +++ b/vendor/github.com/hashicorp/go-plugin/grpc_server.go @@ -0,0 +1,115 @@ +package plugin + +import ( + "bytes" + "crypto/tls" + "encoding/json" + "fmt" + "io" + "net" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/health" + "google.golang.org/grpc/health/grpc_health_v1" +) + +// GRPCServiceName is the name of the service that the health check should +// return as passing. +const GRPCServiceName = "plugin" + +// DefaultGRPCServer can be used with the "GRPCServer" field for Server +// as a default factory method to create a gRPC server with no extra options. +func DefaultGRPCServer(opts []grpc.ServerOption) *grpc.Server { + return grpc.NewServer(opts...) +} + +// GRPCServer is a ServerType implementation that serves plugins over +// gRPC. This allows plugins to easily be written for other languages. +// +// The GRPCServer outputs a custom configuration as a base64-encoded +// JSON structure represented by the GRPCServerConfig config structure. +type GRPCServer struct { + // Plugins are the list of plugins to serve. + Plugins map[string]Plugin + + // Server is the actual server that will accept connections. This + // will be used for plugin registration as well. + Server func([]grpc.ServerOption) *grpc.Server + + // TLS should be the TLS configuration if available. If this is nil, + // the connection will not have transport security. + TLS *tls.Config + + // DoneCh is the channel that is closed when this server has exited. + DoneCh chan struct{} + + // Stdout/StderrLis are the readers for stdout/stderr that will be copied + // to the stdout/stderr connection that is output. + Stdout io.Reader + Stderr io.Reader + + config GRPCServerConfig + server *grpc.Server +} + +// ServerProtocol impl. +func (s *GRPCServer) Init() error { + // Create our server + var opts []grpc.ServerOption + if s.TLS != nil { + opts = append(opts, grpc.Creds(credentials.NewTLS(s.TLS))) + } + s.server = s.Server(opts) + + // Register the health service + healthCheck := health.NewServer() + healthCheck.SetServingStatus( + GRPCServiceName, grpc_health_v1.HealthCheckResponse_SERVING) + grpc_health_v1.RegisterHealthServer(s.server, healthCheck) + + // Register all our plugins onto the gRPC server. + for k, raw := range s.Plugins { + p, ok := raw.(GRPCPlugin) + if !ok { + return fmt.Errorf("%q is not a GRPC-compatibile plugin", k) + } + + if err := p.GRPCServer(s.server); err != nil { + return fmt.Errorf("error registring %q: %s", k, err) + } + } + + return nil +} + +// Config is the GRPCServerConfig encoded as JSON then base64. +func (s *GRPCServer) Config() string { + // Create a buffer that will contain our final contents + var buf bytes.Buffer + + // Wrap the base64 encoding with JSON encoding. + if err := json.NewEncoder(&buf).Encode(s.config); err != nil { + // We panic since ths shouldn't happen under any scenario. We + // carefully control the structure being encoded here and it should + // always be successful. + panic(err) + } + + return buf.String() +} + +func (s *GRPCServer) Serve(lis net.Listener) { + // Start serving in a goroutine + go s.server.Serve(lis) + + // Wait until graceful completion + <-s.DoneCh +} + +// GRPCServerConfig is the extra configuration passed along for consumers +// to facilitate using GRPC plugins. +type GRPCServerConfig struct { + StdoutAddr string `json:"stdout_addr"` + StderrAddr string `json:"stderr_addr"` +} diff --git a/vendor/github.com/hashicorp/go-plugin/log_entry.go b/vendor/github.com/hashicorp/go-plugin/log_entry.go new file mode 100644 index 0000000..2996c14 --- /dev/null +++ b/vendor/github.com/hashicorp/go-plugin/log_entry.go @@ -0,0 +1,73 @@ +package plugin + +import ( + "encoding/json" + "time" +) + +// logEntry is the JSON payload that gets sent to Stderr from the plugin to the host +type logEntry struct { + Message string `json:"@message"` + Level string `json:"@level"` + Timestamp time.Time `json:"timestamp"` + KVPairs []*logEntryKV `json:"kv_pairs"` +} + +// logEntryKV is a key value pair within the Output payload +type logEntryKV struct { + Key string `json:"key"` + Value interface{} `json:"value"` +} + +// flattenKVPairs is used to flatten KVPair slice into []interface{} +// for hclog consumption. +func flattenKVPairs(kvs []*logEntryKV) []interface{} { + var result []interface{} + for _, kv := range kvs { + result = append(result, kv.Key) + result = append(result, kv.Value) + } + + return result +} + +// parseJSON handles parsing JSON output +func parseJSON(input string) (*logEntry, error) { + var raw map[string]interface{} + entry := &logEntry{} + + err := json.Unmarshal([]byte(input), &raw) + if err != nil { + return nil, err + } + + // Parse hclog-specific objects + if v, ok := raw["@message"]; ok { + entry.Message = v.(string) + delete(raw, "@message") + } + + if v, ok := raw["@level"]; ok { + entry.Level = v.(string) + delete(raw, "@level") + } + + if v, ok := raw["@timestamp"]; ok { + t, err := time.Parse("2006-01-02T15:04:05.000000Z07:00", v.(string)) + if err != nil { + return nil, err + } + entry.Timestamp = t + delete(raw, "@timestamp") + } + + // Parse dynamic KV args from the hclog payload. + for k, v := range raw { + entry.KVPairs = append(entry.KVPairs, &logEntryKV{ + Key: k, + Value: v, + }) + } + + return entry, nil +} diff --git a/vendor/github.com/hashicorp/go-plugin/plugin.go b/vendor/github.com/hashicorp/go-plugin/plugin.go index 37c8fd6..6b7bdd1 100644 --- a/vendor/github.com/hashicorp/go-plugin/plugin.go +++ b/vendor/github.com/hashicorp/go-plugin/plugin.go @@ -9,7 +9,10 @@ package plugin import ( + "errors" "net/rpc" + + "google.golang.org/grpc" ) // Plugin is the interface that is implemented to serve/connect to an @@ -23,3 +26,31 @@ type Plugin interface { // serving that communicates to the server end of the plugin. Client(*MuxBroker, *rpc.Client) (interface{}, error) } + +// GRPCPlugin is the interface that is implemented to serve/connect to +// a plugin over gRPC. +type GRPCPlugin interface { + // GRPCServer should register this plugin for serving with the + // given GRPCServer. Unlike Plugin.Server, this is only called once + // since gRPC plugins serve singletons. + GRPCServer(*grpc.Server) error + + // GRPCClient should return the interface implementation for the plugin + // you're serving via gRPC. + GRPCClient(*grpc.ClientConn) (interface{}, error) +} + +// NetRPCUnsupportedPlugin implements Plugin but returns errors for the +// Server and Client functions. This will effectively disable support for +// net/rpc based plugins. +// +// This struct can be embedded in your struct. +type NetRPCUnsupportedPlugin struct{} + +func (p NetRPCUnsupportedPlugin) Server(*MuxBroker) (interface{}, error) { + return nil, errors.New("net/rpc plugin protocol not supported") +} + +func (p NetRPCUnsupportedPlugin) Client(*MuxBroker, *rpc.Client) (interface{}, error) { + return nil, errors.New("net/rpc plugin protocol not supported") +} diff --git a/vendor/github.com/hashicorp/go-plugin/protocol.go b/vendor/github.com/hashicorp/go-plugin/protocol.go new file mode 100644 index 0000000..0cfc19e --- /dev/null +++ b/vendor/github.com/hashicorp/go-plugin/protocol.go @@ -0,0 +1,45 @@ +package plugin + +import ( + "io" + "net" +) + +// Protocol is an enum representing the types of protocols. +type Protocol string + +const ( + ProtocolInvalid Protocol = "" + ProtocolNetRPC Protocol = "netrpc" + ProtocolGRPC Protocol = "grpc" +) + +// ServerProtocol is an interface that must be implemented for new plugin +// protocols to be servers. +type ServerProtocol interface { + // Init is called once to configure and initialize the protocol, but + // not start listening. This is the point at which all validation should + // be done and errors returned. + Init() error + + // Config is extra configuration to be outputted to stdout. This will + // be automatically base64 encoded to ensure it can be parsed properly. + // This can be an empty string if additional configuration is not needed. + Config() string + + // Serve is called to serve connections on the given listener. This should + // continue until the listener is closed. + Serve(net.Listener) +} + +// ClientProtocol is an interface that must be implemented for new plugin +// protocols to be clients. +type ClientProtocol interface { + io.Closer + + // Dispense dispenses a new instance of the plugin with the given name. + Dispense(string) (interface{}, error) + + // Ping checks that the client connection is still healthy. + Ping() error +} diff --git a/vendor/github.com/hashicorp/go-plugin/rpc_client.go b/vendor/github.com/hashicorp/go-plugin/rpc_client.go index 29f9bf0..f30a4b1 100644 --- a/vendor/github.com/hashicorp/go-plugin/rpc_client.go +++ b/vendor/github.com/hashicorp/go-plugin/rpc_client.go @@ -1,6 +1,7 @@ package plugin import ( + "crypto/tls" "fmt" "io" "net" @@ -19,6 +20,42 @@ type RPCClient struct { stdout, stderr net.Conn } +// newRPCClient creates a new RPCClient. The Client argument is expected +// to be successfully started already with a lock held. +func newRPCClient(c *Client) (*RPCClient, error) { + // Connect to the client + conn, err := net.Dial(c.address.Network(), c.address.String()) + if err != nil { + return nil, err + } + if tcpConn, ok := conn.(*net.TCPConn); ok { + // Make sure to set keep alive so that the connection doesn't die + tcpConn.SetKeepAlive(true) + } + + if c.config.TLSConfig != nil { + conn = tls.Client(conn, c.config.TLSConfig) + } + + // Create the actual RPC client + result, err := NewRPCClient(conn, c.config.Plugins) + if err != nil { + conn.Close() + return nil, err + } + + // Begin the stream syncing so that stdin, out, err work properly + err = result.SyncStreams( + c.config.SyncStdout, + c.config.SyncStderr) + if err != nil { + result.Close() + return nil, err + } + + return result, nil +} + // NewRPCClient creates a client from an already-open connection-like value. // Dial is typically used instead. func NewRPCClient(conn io.ReadWriteCloser, plugins map[string]Plugin) (*RPCClient, error) { @@ -121,3 +158,13 @@ func (c *RPCClient) Dispense(name string) (interface{}, error) { return p.Client(c.broker, rpc.NewClient(conn)) } + +// Ping pings the connection to ensure it is still alive. +// +// The error from the RPC call is returned exactly if you want to inspect +// it for further error analysis. Any error returned from here would indicate +// that the connection to the plugin is not healthy. +func (c *RPCClient) Ping() error { + var empty struct{} + return c.control.Call("Control.Ping", true, &empty) +} diff --git a/vendor/github.com/hashicorp/go-plugin/rpc_server.go b/vendor/github.com/hashicorp/go-plugin/rpc_server.go index 33601e2..5bb18dd 100644 --- a/vendor/github.com/hashicorp/go-plugin/rpc_server.go +++ b/vendor/github.com/hashicorp/go-plugin/rpc_server.go @@ -7,12 +7,16 @@ import ( "log" "net" "net/rpc" + "sync" "github.com/hashicorp/yamux" ) // RPCServer listens for network connections and then dispenses interface // implementations over net/rpc. +// +// After setting the fields below, they shouldn't be read again directly +// from the structure which may be reading/writing them concurrently. type RPCServer struct { Plugins map[string]Plugin @@ -26,12 +30,18 @@ type RPCServer struct { // DoneCh should be set to a non-nil channel that will be closed // when the control requests the RPC server to end. DoneCh chan<- struct{} + + lock sync.Mutex } -// Accept accepts connections on a listener and serves requests for -// each incoming connection. Accept blocks; the caller typically invokes -// it in a go statement. -func (s *RPCServer) Accept(lis net.Listener) { +// ServerProtocol impl. +func (s *RPCServer) Init() error { return nil } + +// ServerProtocol impl. +func (s *RPCServer) Config() string { return "" } + +// ServerProtocol impl. +func (s *RPCServer) Serve(lis net.Listener) { for { conn, err := lis.Accept() if err != nil { @@ -102,8 +112,12 @@ func (s *RPCServer) ServeConn(conn io.ReadWriteCloser) { // doneCh to close which is listened to by the main process to cleanly // exit. func (s *RPCServer) done() { + s.lock.Lock() + defer s.lock.Unlock() + if s.DoneCh != nil { close(s.DoneCh) + s.DoneCh = nil } } @@ -112,6 +126,14 @@ type controlServer struct { server *RPCServer } +// Ping can be called to verify the connection (and likely the binary) +// is still alive to a plugin. +func (c *controlServer) Ping( + null bool, response *struct{}) error { + *response = struct{}{} + return nil +} + func (c *controlServer) Quit( null bool, response *struct{}) error { // End the server diff --git a/vendor/github.com/hashicorp/go-plugin/server.go b/vendor/github.com/hashicorp/go-plugin/server.go index b5c5270..e154321 100644 --- a/vendor/github.com/hashicorp/go-plugin/server.go +++ b/vendor/github.com/hashicorp/go-plugin/server.go @@ -1,6 +1,8 @@ package plugin import ( + "crypto/tls" + "encoding/base64" "errors" "fmt" "io/ioutil" @@ -11,6 +13,10 @@ import ( "runtime" "strconv" "sync/atomic" + + "github.com/hashicorp/go-hclog" + + "google.golang.org/grpc" ) // CoreProtocolVersion is the ProtocolVersion of the plugin system itself. @@ -45,14 +51,37 @@ type ServeConfig struct { // HandshakeConfig is the configuration that must match clients. HandshakeConfig + // TLSProvider is a function that returns a configured tls.Config. + TLSProvider func() (*tls.Config, error) + // Plugins are the plugins that are served. Plugins map[string]Plugin + + // GRPCServer should be non-nil to enable serving the plugins over + // gRPC. This is a function to create the server when needed with the + // given server options. The server options populated by go-plugin will + // be for TLS if set. You may modify the input slice. + // + // Note that the grpc.Server will automatically be registered with + // the gRPC health checking service. This is not optional since go-plugin + // relies on this to implement Ping(). + GRPCServer func([]grpc.ServerOption) *grpc.Server +} + +// Protocol returns the protocol that this server should speak. +func (c *ServeConfig) Protocol() Protocol { + result := ProtocolNetRPC + if c.GRPCServer != nil { + result = ProtocolGRPC + } + + return result } // Serve serves the plugins given by ServeConfig. // // Serve doesn't return until the plugin is done being executed. Any -// errors will be outputted to the log. +// errors will be outputted to os.Stderr. // // This is the method that plugins should call in their main() functions. func Serve(opts *ServeConfig) { @@ -77,6 +106,13 @@ func Serve(opts *ServeConfig) { // Logging goes to the original stderr log.SetOutput(os.Stderr) + // internal logger to os.Stderr + logger := hclog.New(&hclog.LoggerOptions{ + Level: hclog.Trace, + Output: os.Stderr, + JSONFormat: true, + }) + // Create our new stdout, stderr files. These will override our built-in // stdout/stderr so that it works across the stream boundary. stdout_r, stdout_w, err := os.Pipe() @@ -93,30 +129,86 @@ func Serve(opts *ServeConfig) { // Register a listener so we can accept a connection listener, err := serverListener() if err != nil { - log.Printf("[ERR] plugin: plugin init: %s", err) + logger.Error("plugin init error", "error", err) return } - defer listener.Close() + + // Close the listener on return. We wrap this in a func() on purpose + // because the "listener" reference may change to TLS. + defer func() { + listener.Close() + }() + + var tlsConfig *tls.Config + if opts.TLSProvider != nil { + tlsConfig, err = opts.TLSProvider() + if err != nil { + logger.Error("plugin tls init", "error", err) + return + } + } // Create the channel to tell us when we're done doneCh := make(chan struct{}) - // Create the RPC server to dispense - server := &RPCServer{ - Plugins: opts.Plugins, - Stdout: stdout_r, - Stderr: stderr_r, - DoneCh: doneCh, + // Build the server type + var server ServerProtocol + switch opts.Protocol() { + case ProtocolNetRPC: + // If we have a TLS configuration then we wrap the listener + // ourselves and do it at that level. + if tlsConfig != nil { + listener = tls.NewListener(listener, tlsConfig) + } + + // Create the RPC server to dispense + server = &RPCServer{ + Plugins: opts.Plugins, + Stdout: stdout_r, + Stderr: stderr_r, + DoneCh: doneCh, + } + + case ProtocolGRPC: + // Create the gRPC server + server = &GRPCServer{ + Plugins: opts.Plugins, + Server: opts.GRPCServer, + TLS: tlsConfig, + Stdout: stdout_r, + Stderr: stderr_r, + DoneCh: doneCh, + } + + default: + panic("unknown server protocol: " + opts.Protocol()) + } + + // Initialize the servers + if err := server.Init(); err != nil { + logger.Error("protocol init", "error", err) + return } + // Build the extra configuration + extra := "" + if v := server.Config(); v != "" { + extra = base64.StdEncoding.EncodeToString([]byte(v)) + } + if extra != "" { + extra = "|" + extra + } + + logger.Debug("plugin address", "network", listener.Addr().Network(), "address", listener.Addr().String()) + // Output the address and service name to stdout so that core can bring it up. - log.Printf("[DEBUG] plugin: plugin address: %s %s\n", - listener.Addr().Network(), listener.Addr().String()) - fmt.Printf("%d|%d|%s|%s\n", + fmt.Printf("%d|%d|%s|%s|%s%s\n", CoreProtocolVersion, opts.ProtocolVersion, listener.Addr().Network(), - listener.Addr().String()) + listener.Addr().String(), + opts.Protocol(), + extra) os.Stdout.Sync() // Eat the interrupts @@ -127,9 +219,7 @@ func Serve(opts *ServeConfig) { for { <-ch newCount := atomic.AddInt32(&count, 1) - log.Printf( - "[DEBUG] plugin: received interrupt signal (count: %d). Ignoring.", - newCount) + logger.Debug("plugin received interrupt signal, ignoring", "count", newCount) } }() @@ -137,10 +227,8 @@ func Serve(opts *ServeConfig) { os.Stdout = stdout_w os.Stderr = stderr_w - // Serve - go server.Accept(listener) - - // Wait for the graceful exit + // Accept connections and wait for completion + go server.Serve(listener) <-doneCh } diff --git a/vendor/github.com/hashicorp/go-plugin/testing.go b/vendor/github.com/hashicorp/go-plugin/testing.go index 9086a1b..c6bf7c4 100644 --- a/vendor/github.com/hashicorp/go-plugin/testing.go +++ b/vendor/github.com/hashicorp/go-plugin/testing.go @@ -4,7 +4,9 @@ import ( "bytes" "net" "net/rpc" - "testing" + + "github.com/mitchellh/go-testing-interface" + "google.golang.org/grpc" ) // The testing file contains test helpers that you can use outside of @@ -12,7 +14,7 @@ import ( // TestConn is a helper function for returning a client and server // net.Conn connected to each other. -func TestConn(t *testing.T) (net.Conn, net.Conn) { +func TestConn(t testing.T) (net.Conn, net.Conn) { // Listen to any local port. This listener will be closed // after a single connection is established. l, err := net.Listen("tcp", "127.0.0.1:0") @@ -46,7 +48,7 @@ func TestConn(t *testing.T) (net.Conn, net.Conn) { } // TestRPCConn returns a rpc client and server connected to each other. -func TestRPCConn(t *testing.T) (*rpc.Client, *rpc.Server) { +func TestRPCConn(t testing.T) (*rpc.Client, *rpc.Server) { clientConn, serverConn := TestConn(t) server := rpc.NewServer() @@ -58,7 +60,7 @@ func TestRPCConn(t *testing.T) (*rpc.Client, *rpc.Server) { // TestPluginRPCConn returns a plugin RPC client and server that are connected // together and configured. -func TestPluginRPCConn(t *testing.T, ps map[string]Plugin) (*RPCClient, *RPCServer) { +func TestPluginRPCConn(t testing.T, ps map[string]Plugin) (*RPCClient, *RPCServer) { // Create two net.Conns we can use to shuttle our control connection clientConn, serverConn := TestConn(t) @@ -74,3 +76,45 @@ func TestPluginRPCConn(t *testing.T, ps map[string]Plugin) (*RPCClient, *RPCServ return client, server } + +// TestPluginGRPCConn returns a plugin gRPC client and server that are connected +// together and configured. This is used to test gRPC connections. +func TestPluginGRPCConn(t testing.T, ps map[string]Plugin) (*GRPCClient, *GRPCServer) { + // Create a listener + l, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + // Start up the server + server := &GRPCServer{ + Plugins: ps, + Server: DefaultGRPCServer, + Stdout: new(bytes.Buffer), + Stderr: new(bytes.Buffer), + } + if err := server.Init(); err != nil { + t.Fatalf("err: %s", err) + } + go server.Serve(l) + + // Connect to the server + conn, err := grpc.Dial( + l.Addr().String(), + grpc.WithBlock(), + grpc.WithInsecure()) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Connection successful, close the listener + l.Close() + + // Create the client + client := &GRPCClient{ + Conn: conn, + Plugins: ps, + } + + return client, server +} diff --git a/vendor/github.com/hashicorp/hcl/appveyor.yml b/vendor/github.com/hashicorp/hcl/appveyor.yml index 3c8cdf8..4db0b71 100644 --- a/vendor/github.com/hashicorp/hcl/appveyor.yml +++ b/vendor/github.com/hashicorp/hcl/appveyor.yml @@ -4,7 +4,7 @@ clone_folder: c:\gopath\src\github.com\hashicorp\hcl environment: GOPATH: c:\gopath init: - - git config --global core.autocrlf true + - git config --global core.autocrlf false install: - cmd: >- echo %Path% diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go b/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go index 6e54bed..b488180 100644 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go +++ b/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go @@ -3,6 +3,7 @@ package parser import ( + "bytes" "errors" "fmt" "strings" @@ -36,6 +37,11 @@ func newParser(src []byte) *Parser { // Parse returns the fully parsed source and returns the abstract syntax tree. func Parse(src []byte) (*ast.File, error) { + // normalize all line endings + // since the scanner and output only work with "\n" line endings, we may + // end up with dangling "\r" characters in the parsed data. + src = bytes.Replace(src, []byte("\r\n"), []byte("\n"), -1) + p := newParser(src) return p.Parse() } diff --git a/vendor/github.com/hashicorp/hcl/json/parser/parser.go b/vendor/github.com/hashicorp/hcl/json/parser/parser.go index 6f46085..125a5f0 100644 --- a/vendor/github.com/hashicorp/hcl/json/parser/parser.go +++ b/vendor/github.com/hashicorp/hcl/json/parser/parser.go @@ -147,7 +147,7 @@ func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { // Done return keys, nil case token.ILLEGAL: - fmt.Println("illegal") + return nil, errors.New("illegal") default: return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) } diff --git a/vendor/github.com/hashicorp/hil/ast/literal.go b/vendor/github.com/hashicorp/hil/ast/literal.go index 8149d49..da6014f 100644 --- a/vendor/github.com/hashicorp/hil/ast/literal.go +++ b/vendor/github.com/hashicorp/hil/ast/literal.go @@ -77,3 +77,12 @@ func (n *LiteralNode) String() string { func (n *LiteralNode) Type(Scope) (Type, error) { return n.Typex, nil } + +// IsUnknown returns true either if the node's value is itself unknown +// of if it is a collection containing any unknown elements, deeply. +func (n *LiteralNode) IsUnknown() bool { + return IsUnknown(Variable{ + Type: n.Typex, + Value: n.Value, + }) +} diff --git a/vendor/github.com/hashicorp/hil/ast/variables_helper.go b/vendor/github.com/hashicorp/hil/ast/variables_helper.go index 40aa534..06bd18d 100644 --- a/vendor/github.com/hashicorp/hil/ast/variables_helper.go +++ b/vendor/github.com/hashicorp/hil/ast/variables_helper.go @@ -3,54 +3,61 @@ package ast import "fmt" func VariableListElementTypesAreHomogenous(variableName string, list []Variable) (Type, error) { - listTypes := make(map[Type]struct{}) + if len(list) == 0 { + return TypeInvalid, fmt.Errorf("list %q does not have any elements so cannot determine type.", variableName) + } + + elemType := TypeUnknown for _, v := range list { - // Allow unknown if v.Type == TypeUnknown { continue } - if _, ok := listTypes[v.Type]; ok { + if elemType == TypeUnknown { + elemType = v.Type continue } - listTypes[v.Type] = struct{}{} - } - if len(listTypes) != 1 && len(list) != 0 { - return TypeInvalid, fmt.Errorf("list %q does not have homogenous types. found %s", variableName, reportTypes(listTypes)) - } + if v.Type != elemType { + return TypeInvalid, fmt.Errorf( + "list %q does not have homogenous types. found %s and then %s", + variableName, + elemType, v.Type, + ) + } - if len(list) > 0 { - return list[0].Type, nil + elemType = v.Type } - return TypeInvalid, fmt.Errorf("list %q does not have any elements so cannot determine type.", variableName) + return elemType, nil } func VariableMapValueTypesAreHomogenous(variableName string, vmap map[string]Variable) (Type, error) { - valueTypes := make(map[Type]struct{}) + if len(vmap) == 0 { + return TypeInvalid, fmt.Errorf("map %q does not have any elements so cannot determine type.", variableName) + } + + elemType := TypeUnknown for _, v := range vmap { - // Allow unknown if v.Type == TypeUnknown { continue } - if _, ok := valueTypes[v.Type]; ok { + if elemType == TypeUnknown { + elemType = v.Type continue } - valueTypes[v.Type] = struct{}{} - } - - if len(valueTypes) != 1 && len(vmap) != 0 { - return TypeInvalid, fmt.Errorf("map %q does not have homogenous value types. found %s", variableName, reportTypes(valueTypes)) - } + if v.Type != elemType { + return TypeInvalid, fmt.Errorf( + "map %q does not have homogenous types. found %s and then %s", + variableName, + elemType, v.Type, + ) + } - // For loop here is an easy way to get a single key, we return immediately. - for _, v := range vmap { - return v.Type, nil + elemType = v.Type } - // This means the map is empty - return TypeInvalid, fmt.Errorf("map %q does not have any elements so cannot determine type.", variableName) + return elemType, nil } diff --git a/vendor/github.com/hashicorp/hil/check_types.go b/vendor/github.com/hashicorp/hil/check_types.go index a8ca44e..f16da39 100644 --- a/vendor/github.com/hashicorp/hil/check_types.go +++ b/vendor/github.com/hashicorp/hil/check_types.go @@ -98,10 +98,6 @@ func (v *TypeCheck) visit(raw ast.Node) ast.Node { pos.Column, pos.Line, err) } - if v.StackPeek() == ast.TypeUnknown { - v.err = errExitUnknown - } - return result } @@ -116,6 +112,14 @@ func (tc *typeCheckArithmetic) TypeCheck(v *TypeCheck) (ast.Node, error) { exprs[len(tc.n.Exprs)-1-i] = v.StackPop() } + // If any operand is unknown then our result is automatically unknown + for _, ty := range exprs { + if ty == ast.TypeUnknown { + v.StackPush(ast.TypeUnknown) + return tc.n, nil + } + } + switch tc.n.Op { case ast.ArithmeticOpLogicalAnd, ast.ArithmeticOpLogicalOr: return tc.checkLogical(v, exprs) @@ -333,6 +337,11 @@ func (tc *typeCheckCall) TypeCheck(v *TypeCheck) (ast.Node, error) { continue } + if args[i] == ast.TypeUnknown { + v.StackPush(ast.TypeUnknown) + return tc.n, nil + } + if args[i] != expected { cn := v.ImplicitConversion(args[i], expected, tc.n.Args[i]) if cn != nil { @@ -350,6 +359,11 @@ func (tc *typeCheckCall) TypeCheck(v *TypeCheck) (ast.Node, error) { if function.Variadic && function.VariadicType != ast.TypeAny { args = args[len(function.ArgTypes):] for i, t := range args { + if t == ast.TypeUnknown { + v.StackPush(ast.TypeUnknown) + return tc.n, nil + } + if t != function.VariadicType { realI := i + len(function.ArgTypes) cn := v.ImplicitConversion( @@ -384,6 +398,11 @@ func (tc *typeCheckConditional) TypeCheck(v *TypeCheck) (ast.Node, error) { trueType := v.StackPop() condType := v.StackPop() + if condType == ast.TypeUnknown { + v.StackPush(ast.TypeUnknown) + return tc.n, nil + } + if condType != ast.TypeBool { cn := v.ImplicitConversion(condType, ast.TypeBool, tc.n.CondExpr) if cn == nil { @@ -395,7 +414,7 @@ func (tc *typeCheckConditional) TypeCheck(v *TypeCheck) (ast.Node, error) { } // The types of the true and false expression must match - if trueType != falseType { + if trueType != falseType && trueType != ast.TypeUnknown && falseType != ast.TypeUnknown { // Since passing around stringified versions of other types is // common, we pragmatically allow the false expression to dictate @@ -441,7 +460,13 @@ func (tc *typeCheckConditional) TypeCheck(v *TypeCheck) (ast.Node, error) { } // Result type (guaranteed to also match falseType due to the above) - v.StackPush(trueType) + if trueType == ast.TypeUnknown { + // falseType may also be unknown, but that's okay because two + // unknowns means our result is unknown anyway. + v.StackPush(falseType) + } else { + v.StackPush(trueType) + } return tc.n, nil } @@ -457,6 +482,13 @@ func (tc *typeCheckOutput) TypeCheck(v *TypeCheck) (ast.Node, error) { types[len(n.Exprs)-1-i] = v.StackPop() } + for _, ty := range types { + if ty == ast.TypeUnknown { + v.StackPush(ast.TypeUnknown) + return tc.n, nil + } + } + // If there is only one argument and it is a list, we evaluate to a list if len(types) == 1 { switch t := types[0]; t { @@ -469,7 +501,14 @@ func (tc *typeCheckOutput) TypeCheck(v *TypeCheck) (ast.Node, error) { } // Otherwise, all concat args must be strings, so validate that + resultType := ast.TypeString for i, t := range types { + + if t == ast.TypeUnknown { + resultType = ast.TypeUnknown + continue + } + if t != ast.TypeString { cn := v.ImplicitConversion(t, ast.TypeString, n.Exprs[i]) if cn != nil { @@ -482,8 +521,8 @@ func (tc *typeCheckOutput) TypeCheck(v *TypeCheck) (ast.Node, error) { } } - // This always results in type string - v.StackPush(ast.TypeString) + // This always results in type string, unless there are unknowns + v.StackPush(resultType) return n, nil } @@ -509,13 +548,6 @@ func (tc *typeCheckVariableAccess) TypeCheck(v *TypeCheck) (ast.Node, error) { "unknown variable accessed: %s", tc.n.Name) } - // Check if the variable contains any unknown types. If so, then - // mark it as unknown. - if ast.IsUnknown(variable) { - v.StackPush(ast.TypeUnknown) - return tc.n, nil - } - // Add the type to the stack v.StackPush(variable.Type) @@ -530,6 +562,11 @@ func (tc *typeCheckIndex) TypeCheck(v *TypeCheck) (ast.Node, error) { keyType := v.StackPop() targetType := v.StackPop() + if keyType == ast.TypeUnknown || targetType == ast.TypeUnknown { + v.StackPush(ast.TypeUnknown) + return tc.n, nil + } + // Ensure we have a VariableAccess as the target varAccessNode, ok := tc.n.Target.(*ast.VariableAccess) if !ok { diff --git a/vendor/github.com/hashicorp/hil/eval.go b/vendor/github.com/hashicorp/hil/eval.go index 5c7afb0..2782076 100644 --- a/vendor/github.com/hashicorp/hil/eval.go +++ b/vendor/github.com/hashicorp/hil/eval.go @@ -54,6 +54,14 @@ func Eval(root ast.Node, config *EvalConfig) (EvaluationResult, error) { return InvalidResult, err } + // If the result contains any nested unknowns then the result as a whole + // is unknown, so that callers only have to deal with "entirely known" + // or "entirely unknown" as outcomes. + if ast.IsUnknown(ast.Variable{Type: outputType, Value: output}) { + outputType = ast.TypeUnknown + output = UnknownValue + } + switch outputType { case ast.TypeList: val, err := VariableToInterface(ast.Variable{ @@ -264,6 +272,10 @@ func (v *evalCall) Eval(s ast.Scope, stack *ast.Stack) (interface{}, ast.Type, e args := make([]interface{}, len(v.Args)) for i, _ := range v.Args { node := stack.Pop().(*ast.LiteralNode) + if node.IsUnknown() { + // If any arguments are unknown then the result is automatically unknown + return UnknownValue, ast.TypeUnknown, nil + } args[len(v.Args)-1-i] = node.Value } @@ -286,6 +298,11 @@ func (v *evalConditional) Eval(s ast.Scope, stack *ast.Stack) (interface{}, ast. trueLit := stack.Pop().(*ast.LiteralNode) condLit := stack.Pop().(*ast.LiteralNode) + if condLit.IsUnknown() { + // If our conditional is unknown then our result is also unknown + return UnknownValue, ast.TypeUnknown, nil + } + if condLit.Value.(bool) { return trueLit.Value, trueLit.Typex, nil } else { @@ -301,6 +318,17 @@ func (v *evalIndex) Eval(scope ast.Scope, stack *ast.Stack) (interface{}, ast.Ty variableName := v.Index.Target.(*ast.VariableAccess).Name + if key.IsUnknown() { + // If our key is unknown then our result is also unknown + return UnknownValue, ast.TypeUnknown, nil + } + + // For target, we'll accept collections containing unknown values but + // we still need to catch when the collection itself is unknown, shallowly. + if target.Typex == ast.TypeUnknown { + return UnknownValue, ast.TypeUnknown, nil + } + switch target.Typex { case ast.TypeList: return v.evalListIndex(variableName, target.Value, key.Value) @@ -377,8 +405,22 @@ func (v *evalOutput) Eval(s ast.Scope, stack *ast.Stack) (interface{}, ast.Type, // The expressions should all be on the stack in reverse // order. So pop them off, reverse their order, and concatenate. nodes := make([]*ast.LiteralNode, 0, len(v.Exprs)) + haveUnknown := false for range v.Exprs { - nodes = append(nodes, stack.Pop().(*ast.LiteralNode)) + n := stack.Pop().(*ast.LiteralNode) + nodes = append(nodes, n) + + // If we have any unknowns then the whole result is unknown + // (we must deal with this first, because the type checker can + // skip type conversions in the presence of unknowns, and thus + // any of our other nodes may be incorrectly typed.) + if n.IsUnknown() { + haveUnknown = true + } + } + + if haveUnknown { + return UnknownValue, ast.TypeUnknown, nil } // Special case the single list and map @@ -396,6 +438,14 @@ func (v *evalOutput) Eval(s ast.Scope, stack *ast.Stack) (interface{}, ast.Type, // Otherwise concatenate the strings var buf bytes.Buffer for i := len(nodes) - 1; i >= 0; i-- { + if nodes[i].Typex != ast.TypeString { + return nil, ast.TypeInvalid, fmt.Errorf( + "invalid output with %s value at index %d: %#v", + nodes[i].Typex, + i, + nodes[i].Value, + ) + } buf.WriteString(nodes[i].Value.(string)) } @@ -418,11 +468,5 @@ func (v *evalVariableAccess) Eval(scope ast.Scope, _ *ast.Stack) (interface{}, a "unknown variable accessed: %s", v.Name) } - // Check if the variable contains any unknown types. If so, then - // mark it as unknown and return that type. - if ast.IsUnknown(variable) { - return nil, ast.TypeUnknown, nil - } - return variable.Value, variable.Type, nil } diff --git a/vendor/github.com/hashicorp/hil/scanner/scanner.go b/vendor/github.com/hashicorp/hil/scanner/scanner.go index bab86c6..86085de 100644 --- a/vendor/github.com/hashicorp/hil/scanner/scanner.go +++ b/vendor/github.com/hashicorp/hil/scanner/scanner.go @@ -395,6 +395,12 @@ func scanLiteral(s string, startPos ast.Pos, nested bool) (string, *Token) { pos.Column = pos.Column + 2 litLen = litLen + 2 continue + } else if follow == '\\' { + // \\ escapes \ + // so we will consume both characters here. + pos.Column = pos.Column + 2 + litLen = litLen + 2 + continue } } } diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/auth_helpers.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/auth_helpers.go deleted file mode 100644 index 3969175..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/auth_helpers.go +++ /dev/null @@ -1,217 +0,0 @@ -package aws - -import ( - "errors" - "fmt" - "log" - "os" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - awsCredentials "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/stscreds" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/aws/aws-sdk-go/service/sts" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/go-cleanhttp" -) - -func GetAccountInfo(iamconn *iam.IAM, stsconn *sts.STS, authProviderName string) (string, string, error) { - // If we have creds from instance profile, we can use metadata API - if authProviderName == ec2rolecreds.ProviderName { - log.Println("[DEBUG] Trying to get account ID via AWS Metadata API") - - cfg := &aws.Config{} - setOptionalEndpoint(cfg) - sess, err := session.NewSession(cfg) - if err != nil { - return "", "", errwrap.Wrapf("Error creating AWS session: {{err}}", err) - } - - metadataClient := ec2metadata.New(sess) - info, err := metadataClient.IAMInfo() - if err != nil { - // This can be triggered when no IAM Role is assigned - // or AWS just happens to return invalid response - return "", "", fmt.Errorf("Failed getting EC2 IAM info: %s", err) - } - - return parseAccountInfoFromArn(info.InstanceProfileArn) - } - - // Then try IAM GetUser - log.Println("[DEBUG] Trying to get account ID via iam:GetUser") - outUser, err := iamconn.GetUser(nil) - if err == nil { - return parseAccountInfoFromArn(*outUser.User.Arn) - } - - awsErr, ok := err.(awserr.Error) - // AccessDenied and ValidationError can be raised - // if credentials belong to federated profile, so we ignore these - if !ok || (awsErr.Code() != "AccessDenied" && awsErr.Code() != "ValidationError") { - return "", "", fmt.Errorf("Failed getting account ID via 'iam:GetUser': %s", err) - } - log.Printf("[DEBUG] Getting account ID via iam:GetUser failed: %s", err) - - // Then try STS GetCallerIdentity - log.Println("[DEBUG] Trying to get account ID via sts:GetCallerIdentity") - outCallerIdentity, err := stsconn.GetCallerIdentity(&sts.GetCallerIdentityInput{}) - if err == nil { - return parseAccountInfoFromArn(*outCallerIdentity.Arn) - } - log.Printf("[DEBUG] Getting account ID via sts:GetCallerIdentity failed: %s", err) - - // Then try IAM ListRoles - log.Println("[DEBUG] Trying to get account ID via iam:ListRoles") - outRoles, err := iamconn.ListRoles(&iam.ListRolesInput{ - MaxItems: aws.Int64(int64(1)), - }) - if err != nil { - return "", "", fmt.Errorf("Failed getting account ID via 'iam:ListRoles': %s", err) - } - - if len(outRoles.Roles) < 1 { - return "", "", errors.New("Failed getting account ID via 'iam:ListRoles': No roles available") - } - - return parseAccountInfoFromArn(*outRoles.Roles[0].Arn) -} - -func parseAccountInfoFromArn(arn string) (string, string, error) { - parts := strings.Split(arn, ":") - if len(parts) < 5 { - return "", "", fmt.Errorf("Unable to parse ID from invalid ARN: %q", arn) - } - return parts[1], parts[4], nil -} - -// This function is responsible for reading credentials from the -// environment in the case that they're not explicitly specified -// in the Terraform configuration. -func GetCredentials(c *Config) (*awsCredentials.Credentials, error) { - // build a chain provider, lazy-evaulated by aws-sdk - providers := []awsCredentials.Provider{ - &awsCredentials.StaticProvider{Value: awsCredentials.Value{ - AccessKeyID: c.AccessKey, - SecretAccessKey: c.SecretKey, - SessionToken: c.Token, - }}, - &awsCredentials.EnvProvider{}, - &awsCredentials.SharedCredentialsProvider{ - Filename: c.CredsFilename, - Profile: c.Profile, - }, - } - - // Build isolated HTTP client to avoid issues with globally-shared settings - client := cleanhttp.DefaultClient() - - // Keep the timeout low as we don't want to wait in non-EC2 environments - client.Timeout = 100 * time.Millisecond - cfg := &aws.Config{ - HTTPClient: client, - } - usedEndpoint := setOptionalEndpoint(cfg) - - if !c.SkipMetadataApiCheck { - // Real AWS should reply to a simple metadata request. - // We check it actually does to ensure something else didn't just - // happen to be listening on the same IP:Port - metadataClient := ec2metadata.New(session.New(cfg)) - if metadataClient.Available() { - providers = append(providers, &ec2rolecreds.EC2RoleProvider{ - Client: metadataClient, - }) - log.Print("[INFO] AWS EC2 instance detected via default metadata" + - " API endpoint, EC2RoleProvider added to the auth chain") - } else { - if usedEndpoint == "" { - usedEndpoint = "default location" - } - log.Printf("[WARN] Ignoring AWS metadata API endpoint at %s "+ - "as it doesn't return any instance-id", usedEndpoint) - } - } - - // This is the "normal" flow (i.e. not assuming a role) - if c.AssumeRoleARN == "" { - return awsCredentials.NewChainCredentials(providers), nil - } - - // Otherwise we need to construct and STS client with the main credentials, and verify - // that we can assume the defined role. - log.Printf("[INFO] Attempting to AssumeRole %s (SessionName: %q, ExternalId: %q, Policy: %q)", - c.AssumeRoleARN, c.AssumeRoleSessionName, c.AssumeRoleExternalID, c.AssumeRolePolicy) - - creds := awsCredentials.NewChainCredentials(providers) - cp, err := creds.Get() - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoCredentialProviders" { - return nil, errors.New(`No valid credential sources found for AWS Provider. - Please see https://terraform.io/docs/providers/aws/index.html for more information on - providing credentials for the AWS Provider`) - } - - return nil, fmt.Errorf("Error loading credentials for AWS Provider: %s", err) - } - - log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName) - - awsConfig := &aws.Config{ - Credentials: creds, - Region: aws.String(c.Region), - MaxRetries: aws.Int(c.MaxRetries), - HTTPClient: cleanhttp.DefaultClient(), - S3ForcePathStyle: aws.Bool(c.S3ForcePathStyle), - } - - stsclient := sts.New(session.New(awsConfig)) - assumeRoleProvider := &stscreds.AssumeRoleProvider{ - Client: stsclient, - RoleARN: c.AssumeRoleARN, - } - if c.AssumeRoleSessionName != "" { - assumeRoleProvider.RoleSessionName = c.AssumeRoleSessionName - } - if c.AssumeRoleExternalID != "" { - assumeRoleProvider.ExternalID = aws.String(c.AssumeRoleExternalID) - } - if c.AssumeRolePolicy != "" { - assumeRoleProvider.Policy = aws.String(c.AssumeRolePolicy) - } - - providers = []awsCredentials.Provider{assumeRoleProvider} - - assumeRoleCreds := awsCredentials.NewChainCredentials(providers) - _, err = assumeRoleCreds.Get() - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoCredentialProviders" { - return nil, fmt.Errorf("The role %q cannot be assumed.\n\n"+ - " There are a number of possible causes of this - the most common are:\n"+ - " * The credentials used in order to assume the role are invalid\n"+ - " * The credentials do not have appropriate permission to assume the role\n"+ - " * The role ARN is not valid", - c.AssumeRoleARN) - } - - return nil, fmt.Errorf("Error loading credentials for AWS Provider: %s", err) - } - - return assumeRoleCreds, nil -} - -func setOptionalEndpoint(cfg *aws.Config) string { - endpoint := os.Getenv("AWS_METADATA_URL") - if endpoint != "" { - log.Printf("[INFO] Setting custom metadata endpoint: %q", endpoint) - cfg.Endpoint = aws.String(endpoint) - return endpoint - } - return "" -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/autoscaling_tags.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/autoscaling_tags.go deleted file mode 100644 index e9ca853..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/autoscaling_tags.go +++ /dev/null @@ -1,202 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -// tagsSchema returns the schema to use for tags. -func autoscalingTagsSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "propagate_at_launch": &schema.Schema{ - Type: schema.TypeBool, - Required: true, - }, - }, - }, - Set: autoscalingTagsToHash, - } -} - -func autoscalingTagsToHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["key"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["value"].(string))) - buf.WriteString(fmt.Sprintf("%t-", m["propagate_at_launch"].(bool))) - - return hashcode.String(buf.String()) -} - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tag" -func setAutoscalingTags(conn *autoscaling.AutoScaling, d *schema.ResourceData) error { - if d.HasChange("tag") { - oraw, nraw := d.GetChange("tag") - o := setToMapByKey(oraw.(*schema.Set), "key") - n := setToMapByKey(nraw.(*schema.Set), "key") - - resourceID := d.Get("name").(string) - c, r := diffAutoscalingTags( - autoscalingTagsFromMap(o, resourceID), - autoscalingTagsFromMap(n, resourceID), - resourceID) - create := autoscaling.CreateOrUpdateTagsInput{ - Tags: c, - } - remove := autoscaling.DeleteTagsInput{ - Tags: r, - } - - // Set tags - if len(r) > 0 { - log.Printf("[DEBUG] Removing autoscaling tags: %#v", r) - if _, err := conn.DeleteTags(&remove); err != nil { - return err - } - } - if len(c) > 0 { - log.Printf("[DEBUG] Creating autoscaling tags: %#v", c) - if _, err := conn.CreateOrUpdateTags(&create); err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffAutoscalingTags(oldTags, newTags []*autoscaling.Tag, resourceID string) ([]*autoscaling.Tag, []*autoscaling.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - tag := map[string]interface{}{ - "value": *t.Value, - "propagate_at_launch": *t.PropagateAtLaunch, - } - create[*t.Key] = tag - } - - // Build the list of what to remove - var remove []*autoscaling.Tag - for _, t := range oldTags { - old, ok := create[*t.Key].(map[string]interface{}) - - if !ok || old["value"] != *t.Value || old["propagate_at_launch"] != *t.PropagateAtLaunch { - // Delete it! - remove = append(remove, t) - } - } - - return autoscalingTagsFromMap(create, resourceID), remove -} - -// tagsFromMap returns the tags for the given map of data. -func autoscalingTagsFromMap(m map[string]interface{}, resourceID string) []*autoscaling.Tag { - result := make([]*autoscaling.Tag, 0, len(m)) - for k, v := range m { - attr := v.(map[string]interface{}) - t := &autoscaling.Tag{ - Key: aws.String(k), - Value: aws.String(attr["value"].(string)), - PropagateAtLaunch: aws.Bool(attr["propagate_at_launch"].(bool)), - ResourceId: aws.String(resourceID), - ResourceType: aws.String("auto-scaling-group"), - } - if !tagIgnoredAutoscaling(t) { - result = append(result, t) - } - } - - return result -} - -// autoscalingTagsToMap turns the list of tags into a map. -func autoscalingTagsToMap(ts []*autoscaling.Tag) map[string]interface{} { - tags := make(map[string]interface{}) - for _, t := range ts { - tag := map[string]interface{}{ - "value": *t.Value, - "propagate_at_launch": *t.PropagateAtLaunch, - } - tags[*t.Key] = tag - } - - return tags -} - -// autoscalingTagDescriptionsToMap turns the list of tags into a map. -func autoscalingTagDescriptionsToMap(ts *[]*autoscaling.TagDescription) map[string]map[string]interface{} { - tags := make(map[string]map[string]interface{}) - for _, t := range *ts { - tag := map[string]interface{}{ - "value": *t.Value, - "propagate_at_launch": *t.PropagateAtLaunch, - } - tags[*t.Key] = tag - } - - return tags -} - -// autoscalingTagDescriptionsToSlice turns the list of tags into a slice. -func autoscalingTagDescriptionsToSlice(ts []*autoscaling.TagDescription) []map[string]interface{} { - tags := make([]map[string]interface{}, 0, len(ts)) - for _, t := range ts { - tags = append(tags, map[string]interface{}{ - "key": *t.Key, - "value": *t.Value, - "propagate_at_launch": *t.PropagateAtLaunch, - }) - } - - return tags -} - -func setToMapByKey(s *schema.Set, key string) map[string]interface{} { - result := make(map[string]interface{}) - for _, rawData := range s.List() { - data := rawData.(map[string]interface{}) - result[data[key].(string)] = data - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredAutoscaling(t *autoscaling.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/awserr.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/awserr.go deleted file mode 100644 index 8fc0568..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/awserr.go +++ /dev/null @@ -1,14 +0,0 @@ -package aws - -import ( - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -func isAWSErr(err error, code string, message string) bool { - if err, ok := err.(awserr.Error); ok { - return err.Code() == code && strings.Contains(err.Message(), message) - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/cloudfront_distribution_configuration_structure.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/cloudfront_distribution_configuration_structure.go deleted file mode 100644 index ccac0d9..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/cloudfront_distribution_configuration_structure.go +++ /dev/null @@ -1,1127 +0,0 @@ -// CloudFront DistributionConfig structure helpers. -// -// These functions assist in pulling in data from Terraform resource -// configuration for the aws_cloudfront_distribution resource, as there are -// several sub-fields that require their own data type, and do not necessarily -// 1-1 translate to resource configuration. - -package aws - -import ( - "bytes" - "fmt" - "reflect" - "sort" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/terraform/flatmap" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -// cloudFrontRoute53ZoneID defines the route 53 zone ID for CloudFront. This -// is used to set the zone_id attribute. -const cloudFrontRoute53ZoneID = "Z2FDTNDATAQYW2" - -// Define Sort interface for []*string so we can ensure the order of -// geo_restrictions.locations -type StringPtrSlice []*string - -func (p StringPtrSlice) Len() int { return len(p) } -func (p StringPtrSlice) Less(i, j int) bool { return *p[i] < *p[j] } -func (p StringPtrSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// Assemble the *cloudfront.DistributionConfig variable. Calls out to various -// expander functions to convert attributes and sub-attributes to the various -// complex structures which are necessary to properly build the -// DistributionConfig structure. -// -// Used by the aws_cloudfront_distribution Create and Update functions. -func expandDistributionConfig(d *schema.ResourceData) *cloudfront.DistributionConfig { - distributionConfig := &cloudfront.DistributionConfig{ - CacheBehaviors: expandCacheBehaviors(d.Get("cache_behavior").(*schema.Set)), - CustomErrorResponses: expandCustomErrorResponses(d.Get("custom_error_response").(*schema.Set)), - DefaultCacheBehavior: expandDefaultCacheBehavior(d.Get("default_cache_behavior").(*schema.Set).List()[0].(map[string]interface{})), - Enabled: aws.Bool(d.Get("enabled").(bool)), - IsIPV6Enabled: aws.Bool(d.Get("is_ipv6_enabled").(bool)), - HttpVersion: aws.String(d.Get("http_version").(string)), - Origins: expandOrigins(d.Get("origin").(*schema.Set)), - PriceClass: aws.String(d.Get("price_class").(string)), - } - // This sets CallerReference if it's still pending computation (ie: new resource) - if v, ok := d.GetOk("caller_reference"); ok == false { - distributionConfig.CallerReference = aws.String(time.Now().Format(time.RFC3339Nano)) - } else { - distributionConfig.CallerReference = aws.String(v.(string)) - } - if v, ok := d.GetOk("comment"); ok { - distributionConfig.Comment = aws.String(v.(string)) - } else { - distributionConfig.Comment = aws.String("") - } - if v, ok := d.GetOk("default_root_object"); ok { - distributionConfig.DefaultRootObject = aws.String(v.(string)) - } else { - distributionConfig.DefaultRootObject = aws.String("") - } - if v, ok := d.GetOk("logging_config"); ok { - distributionConfig.Logging = expandLoggingConfig(v.(*schema.Set).List()[0].(map[string]interface{})) - } else { - distributionConfig.Logging = expandLoggingConfig(nil) - } - if v, ok := d.GetOk("aliases"); ok { - distributionConfig.Aliases = expandAliases(v.(*schema.Set)) - } else { - distributionConfig.Aliases = expandAliases(schema.NewSet(aliasesHash, []interface{}{})) - } - if v, ok := d.GetOk("restrictions"); ok { - distributionConfig.Restrictions = expandRestrictions(v.(*schema.Set).List()[0].(map[string]interface{})) - } - if v, ok := d.GetOk("viewer_certificate"); ok { - distributionConfig.ViewerCertificate = expandViewerCertificate(v.(*schema.Set).List()[0].(map[string]interface{})) - } - if v, ok := d.GetOk("web_acl_id"); ok { - distributionConfig.WebACLId = aws.String(v.(string)) - } else { - distributionConfig.WebACLId = aws.String("") - } - - return distributionConfig -} - -// Unpack the *cloudfront.DistributionConfig variable and set resource data. -// Calls out to flatten functions to convert the DistributionConfig -// sub-structures to their respective attributes in the -// aws_cloudfront_distribution resource. -// -// Used by the aws_cloudfront_distribution Read function. -func flattenDistributionConfig(d *schema.ResourceData, distributionConfig *cloudfront.DistributionConfig) error { - var err error - - d.Set("enabled", distributionConfig.Enabled) - d.Set("is_ipv6_enabled", distributionConfig.IsIPV6Enabled) - d.Set("price_class", distributionConfig.PriceClass) - d.Set("hosted_zone_id", cloudFrontRoute53ZoneID) - - err = d.Set("default_cache_behavior", flattenDefaultCacheBehavior(distributionConfig.DefaultCacheBehavior)) - if err != nil { - return err - } - err = d.Set("viewer_certificate", flattenViewerCertificate(distributionConfig.ViewerCertificate)) - if err != nil { - return err - } - - if distributionConfig.CallerReference != nil { - d.Set("caller_reference", distributionConfig.CallerReference) - } - if distributionConfig.Comment != nil { - if *distributionConfig.Comment != "" { - d.Set("comment", distributionConfig.Comment) - } - } - if distributionConfig.DefaultRootObject != nil { - d.Set("default_root_object", distributionConfig.DefaultRootObject) - } - if distributionConfig.HttpVersion != nil { - d.Set("http_version", distributionConfig.HttpVersion) - } - if distributionConfig.WebACLId != nil { - d.Set("web_acl_id", distributionConfig.WebACLId) - } - - if distributionConfig.CustomErrorResponses != nil { - err = d.Set("custom_error_response", flattenCustomErrorResponses(distributionConfig.CustomErrorResponses)) - if err != nil { - return err - } - } - if distributionConfig.CacheBehaviors != nil { - err = d.Set("cache_behavior", flattenCacheBehaviors(distributionConfig.CacheBehaviors)) - if err != nil { - return err - } - } - - if distributionConfig.Logging != nil && *distributionConfig.Logging.Enabled { - err = d.Set("logging_config", flattenLoggingConfig(distributionConfig.Logging)) - } else { - err = d.Set("logging_config", schema.NewSet(loggingConfigHash, []interface{}{})) - } - if err != nil { - return err - } - - if distributionConfig.Aliases != nil { - err = d.Set("aliases", flattenAliases(distributionConfig.Aliases)) - if err != nil { - return err - } - } - if distributionConfig.Restrictions != nil { - err = d.Set("restrictions", flattenRestrictions(distributionConfig.Restrictions)) - if err != nil { - return err - } - } - if *distributionConfig.Origins.Quantity > 0 { - err = d.Set("origin", flattenOrigins(distributionConfig.Origins)) - if err != nil { - return err - } - } - - return nil -} - -func expandDefaultCacheBehavior(m map[string]interface{}) *cloudfront.DefaultCacheBehavior { - cb := expandCacheBehavior(m) - var dcb cloudfront.DefaultCacheBehavior - - simpleCopyStruct(cb, &dcb) - return &dcb -} - -func flattenDefaultCacheBehavior(dcb *cloudfront.DefaultCacheBehavior) *schema.Set { - m := make(map[string]interface{}) - var cb cloudfront.CacheBehavior - - simpleCopyStruct(dcb, &cb) - m = flattenCacheBehavior(&cb) - return schema.NewSet(defaultCacheBehaviorHash, []interface{}{m}) -} - -// Assemble the hash for the aws_cloudfront_distribution default_cache_behavior -// TypeSet attribute. -func defaultCacheBehaviorHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%t-", m["compress"].(bool))) - buf.WriteString(fmt.Sprintf("%s-", m["viewer_protocol_policy"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["target_origin_id"].(string))) - buf.WriteString(fmt.Sprintf("%d-", forwardedValuesHash(m["forwarded_values"].(*schema.Set).List()[0].(map[string]interface{})))) - buf.WriteString(fmt.Sprintf("%d-", m["min_ttl"].(int))) - if d, ok := m["trusted_signers"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - if d, ok := m["max_ttl"]; ok { - buf.WriteString(fmt.Sprintf("%d-", d.(int))) - } - if d, ok := m["smooth_streaming"]; ok { - buf.WriteString(fmt.Sprintf("%t-", d.(bool))) - } - if d, ok := m["default_ttl"]; ok { - buf.WriteString(fmt.Sprintf("%d-", d.(int))) - } - if d, ok := m["allowed_methods"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - if d, ok := m["cached_methods"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - if d, ok := m["lambda_function_association"]; ok { - var associations []interface{} - switch d.(type) { - case *schema.Set: - associations = d.(*schema.Set).List() - default: - associations = d.([]interface{}) - } - for _, lfa := range associations { - buf.WriteString(fmt.Sprintf("%d-", lambdaFunctionAssociationHash(lfa.(map[string]interface{})))) - } - } - return hashcode.String(buf.String()) -} - -func expandCacheBehaviors(s *schema.Set) *cloudfront.CacheBehaviors { - var qty int64 - var items []*cloudfront.CacheBehavior - for _, v := range s.List() { - items = append(items, expandCacheBehavior(v.(map[string]interface{}))) - qty++ - } - return &cloudfront.CacheBehaviors{ - Quantity: aws.Int64(qty), - Items: items, - } -} - -func flattenCacheBehaviors(cbs *cloudfront.CacheBehaviors) *schema.Set { - s := []interface{}{} - for _, v := range cbs.Items { - s = append(s, flattenCacheBehavior(v)) - } - return schema.NewSet(cacheBehaviorHash, s) -} - -func expandCacheBehavior(m map[string]interface{}) *cloudfront.CacheBehavior { - cb := &cloudfront.CacheBehavior{ - Compress: aws.Bool(m["compress"].(bool)), - ViewerProtocolPolicy: aws.String(m["viewer_protocol_policy"].(string)), - TargetOriginId: aws.String(m["target_origin_id"].(string)), - ForwardedValues: expandForwardedValues(m["forwarded_values"].(*schema.Set).List()[0].(map[string]interface{})), - MinTTL: aws.Int64(int64(m["min_ttl"].(int))), - MaxTTL: aws.Int64(int64(m["max_ttl"].(int))), - DefaultTTL: aws.Int64(int64(m["default_ttl"].(int))), - } - if v, ok := m["trusted_signers"]; ok { - cb.TrustedSigners = expandTrustedSigners(v.([]interface{})) - } else { - cb.TrustedSigners = expandTrustedSigners([]interface{}{}) - } - - if v, ok := m["lambda_function_association"]; ok { - cb.LambdaFunctionAssociations = expandLambdaFunctionAssociations(v.(*schema.Set).List()) - } - - if v, ok := m["smooth_streaming"]; ok { - cb.SmoothStreaming = aws.Bool(v.(bool)) - } - if v, ok := m["allowed_methods"]; ok { - cb.AllowedMethods = expandAllowedMethods(v.([]interface{})) - } - if v, ok := m["cached_methods"]; ok { - cb.AllowedMethods.CachedMethods = expandCachedMethods(v.([]interface{})) - } - if v, ok := m["path_pattern"]; ok { - cb.PathPattern = aws.String(v.(string)) - } - return cb -} - -func flattenCacheBehavior(cb *cloudfront.CacheBehavior) map[string]interface{} { - m := make(map[string]interface{}) - - m["compress"] = *cb.Compress - m["viewer_protocol_policy"] = *cb.ViewerProtocolPolicy - m["target_origin_id"] = *cb.TargetOriginId - m["forwarded_values"] = schema.NewSet(forwardedValuesHash, []interface{}{flattenForwardedValues(cb.ForwardedValues)}) - m["min_ttl"] = int(*cb.MinTTL) - - if len(cb.TrustedSigners.Items) > 0 { - m["trusted_signers"] = flattenTrustedSigners(cb.TrustedSigners) - } - if len(cb.LambdaFunctionAssociations.Items) > 0 { - m["lambda_function_association"] = flattenLambdaFunctionAssociations(cb.LambdaFunctionAssociations) - } - if cb.MaxTTL != nil { - m["max_ttl"] = int(*cb.MaxTTL) - } - if cb.SmoothStreaming != nil { - m["smooth_streaming"] = *cb.SmoothStreaming - } - if cb.DefaultTTL != nil { - m["default_ttl"] = int(*cb.DefaultTTL) - } - if cb.AllowedMethods != nil { - m["allowed_methods"] = flattenAllowedMethods(cb.AllowedMethods) - } - if cb.AllowedMethods.CachedMethods != nil { - m["cached_methods"] = flattenCachedMethods(cb.AllowedMethods.CachedMethods) - } - if cb.PathPattern != nil { - m["path_pattern"] = *cb.PathPattern - } - return m -} - -// Assemble the hash for the aws_cloudfront_distribution cache_behavior -// TypeSet attribute. -func cacheBehaviorHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%t-", m["compress"].(bool))) - buf.WriteString(fmt.Sprintf("%s-", m["viewer_protocol_policy"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["target_origin_id"].(string))) - buf.WriteString(fmt.Sprintf("%d-", forwardedValuesHash(m["forwarded_values"].(*schema.Set).List()[0].(map[string]interface{})))) - buf.WriteString(fmt.Sprintf("%d-", m["min_ttl"].(int))) - if d, ok := m["trusted_signers"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - if d, ok := m["max_ttl"]; ok { - buf.WriteString(fmt.Sprintf("%d-", d.(int))) - } - if d, ok := m["smooth_streaming"]; ok { - buf.WriteString(fmt.Sprintf("%t-", d.(bool))) - } - if d, ok := m["default_ttl"]; ok { - buf.WriteString(fmt.Sprintf("%d-", d.(int))) - } - if d, ok := m["allowed_methods"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - if d, ok := m["cached_methods"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - if d, ok := m["path_pattern"]; ok { - buf.WriteString(fmt.Sprintf("%s-", d)) - } - if d, ok := m["lambda_function_association"]; ok { - var associations []interface{} - switch d.(type) { - case *schema.Set: - associations = d.(*schema.Set).List() - default: - associations = d.([]interface{}) - } - for _, lfa := range associations { - buf.WriteString(fmt.Sprintf("%d-", lambdaFunctionAssociationHash(lfa.(map[string]interface{})))) - } - } - return hashcode.String(buf.String()) -} - -func expandTrustedSigners(s []interface{}) *cloudfront.TrustedSigners { - var ts cloudfront.TrustedSigners - if len(s) > 0 { - ts.Quantity = aws.Int64(int64(len(s))) - ts.Items = expandStringList(s) - ts.Enabled = aws.Bool(true) - } else { - ts.Quantity = aws.Int64(0) - ts.Enabled = aws.Bool(false) - } - return &ts -} - -func flattenTrustedSigners(ts *cloudfront.TrustedSigners) []interface{} { - if ts.Items != nil { - return flattenStringList(ts.Items) - } - return []interface{}{} -} - -func lambdaFunctionAssociationHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["event_type"].(string))) - buf.WriteString(fmt.Sprintf("%s", m["lambda_arn"].(string))) - return hashcode.String(buf.String()) -} - -func expandLambdaFunctionAssociations(v interface{}) *cloudfront.LambdaFunctionAssociations { - if v == nil { - return &cloudfront.LambdaFunctionAssociations{ - Quantity: aws.Int64(0), - } - } - - s := v.([]interface{}) - var lfa cloudfront.LambdaFunctionAssociations - lfa.Quantity = aws.Int64(int64(len(s))) - lfa.Items = make([]*cloudfront.LambdaFunctionAssociation, len(s)) - for i, lf := range s { - lfa.Items[i] = expandLambdaFunctionAssociation(lf.(map[string]interface{})) - } - return &lfa -} - -func expandLambdaFunctionAssociation(lf map[string]interface{}) *cloudfront.LambdaFunctionAssociation { - var lfa cloudfront.LambdaFunctionAssociation - if v, ok := lf["event_type"]; ok { - lfa.EventType = aws.String(v.(string)) - } - if v, ok := lf["lambda_arn"]; ok { - lfa.LambdaFunctionARN = aws.String(v.(string)) - } - return &lfa -} - -func flattenLambdaFunctionAssociations(lfa *cloudfront.LambdaFunctionAssociations) []interface{} { - s := make([]interface{}, len(lfa.Items)) - for i, v := range lfa.Items { - s[i] = flattenLambdaFunctionAssociation(v) - } - return s -} - -func flattenLambdaFunctionAssociation(lfa *cloudfront.LambdaFunctionAssociation) map[string]interface{} { - m := map[string]interface{}{} - if lfa != nil { - m["event_type"] = *lfa.EventType - m["lambda_arn"] = *lfa.LambdaFunctionARN - } - return m -} - -func expandForwardedValues(m map[string]interface{}) *cloudfront.ForwardedValues { - fv := &cloudfront.ForwardedValues{ - QueryString: aws.Bool(m["query_string"].(bool)), - } - if v, ok := m["cookies"]; ok && v.(*schema.Set).Len() > 0 { - fv.Cookies = expandCookiePreference(v.(*schema.Set).List()[0].(map[string]interface{})) - } - if v, ok := m["headers"]; ok { - fv.Headers = expandHeaders(v.([]interface{})) - } - if v, ok := m["query_string_cache_keys"]; ok { - fv.QueryStringCacheKeys = expandQueryStringCacheKeys(v.([]interface{})) - } - return fv -} - -func flattenForwardedValues(fv *cloudfront.ForwardedValues) map[string]interface{} { - m := make(map[string]interface{}) - m["query_string"] = *fv.QueryString - if fv.Cookies != nil { - m["cookies"] = schema.NewSet(cookiePreferenceHash, []interface{}{flattenCookiePreference(fv.Cookies)}) - } - if fv.Headers != nil { - m["headers"] = flattenHeaders(fv.Headers) - } - if fv.QueryStringCacheKeys != nil { - m["query_string_cache_keys"] = flattenQueryStringCacheKeys(fv.QueryStringCacheKeys) - } - return m -} - -// Assemble the hash for the aws_cloudfront_distribution forwarded_values -// TypeSet attribute. -func forwardedValuesHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%t-", m["query_string"].(bool))) - if d, ok := m["cookies"]; ok && d.(*schema.Set).Len() > 0 { - buf.WriteString(fmt.Sprintf("%d-", cookiePreferenceHash(d.(*schema.Set).List()[0].(map[string]interface{})))) - } - if d, ok := m["headers"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - if d, ok := m["query_string_cache_keys"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - return hashcode.String(buf.String()) -} - -func expandHeaders(d []interface{}) *cloudfront.Headers { - return &cloudfront.Headers{ - Quantity: aws.Int64(int64(len(d))), - Items: expandStringList(d), - } -} - -func flattenHeaders(h *cloudfront.Headers) []interface{} { - if h.Items != nil { - return flattenStringList(h.Items) - } - return []interface{}{} -} - -func expandQueryStringCacheKeys(d []interface{}) *cloudfront.QueryStringCacheKeys { - return &cloudfront.QueryStringCacheKeys{ - Quantity: aws.Int64(int64(len(d))), - Items: expandStringList(d), - } -} - -func flattenQueryStringCacheKeys(k *cloudfront.QueryStringCacheKeys) []interface{} { - if k.Items != nil { - return flattenStringList(k.Items) - } - return []interface{}{} -} - -func expandCookiePreference(m map[string]interface{}) *cloudfront.CookiePreference { - cp := &cloudfront.CookiePreference{ - Forward: aws.String(m["forward"].(string)), - } - if v, ok := m["whitelisted_names"]; ok { - cp.WhitelistedNames = expandCookieNames(v.([]interface{})) - } - return cp -} - -func flattenCookiePreference(cp *cloudfront.CookiePreference) map[string]interface{} { - m := make(map[string]interface{}) - m["forward"] = *cp.Forward - if cp.WhitelistedNames != nil { - m["whitelisted_names"] = flattenCookieNames(cp.WhitelistedNames) - } - return m -} - -// Assemble the hash for the aws_cloudfront_distribution cookies -// TypeSet attribute. -func cookiePreferenceHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["forward"].(string))) - if d, ok := m["whitelisted_names"]; ok { - for _, e := range sortInterfaceSlice(d.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", e.(string))) - } - } - return hashcode.String(buf.String()) -} - -func expandCookieNames(d []interface{}) *cloudfront.CookieNames { - return &cloudfront.CookieNames{ - Quantity: aws.Int64(int64(len(d))), - Items: expandStringList(d), - } -} - -func flattenCookieNames(cn *cloudfront.CookieNames) []interface{} { - if cn.Items != nil { - return flattenStringList(cn.Items) - } - return []interface{}{} -} - -func expandAllowedMethods(s []interface{}) *cloudfront.AllowedMethods { - return &cloudfront.AllowedMethods{ - Quantity: aws.Int64(int64(len(s))), - Items: expandStringList(s), - } -} - -func flattenAllowedMethods(am *cloudfront.AllowedMethods) []interface{} { - if am.Items != nil { - return flattenStringList(am.Items) - } - return []interface{}{} -} - -func expandCachedMethods(s []interface{}) *cloudfront.CachedMethods { - return &cloudfront.CachedMethods{ - Quantity: aws.Int64(int64(len(s))), - Items: expandStringList(s), - } -} - -func flattenCachedMethods(cm *cloudfront.CachedMethods) []interface{} { - if cm.Items != nil { - return flattenStringList(cm.Items) - } - return []interface{}{} -} - -func expandOrigins(s *schema.Set) *cloudfront.Origins { - qty := 0 - items := []*cloudfront.Origin{} - for _, v := range s.List() { - items = append(items, expandOrigin(v.(map[string]interface{}))) - qty++ - } - return &cloudfront.Origins{ - Quantity: aws.Int64(int64(qty)), - Items: items, - } -} - -func flattenOrigins(ors *cloudfront.Origins) *schema.Set { - s := []interface{}{} - for _, v := range ors.Items { - s = append(s, flattenOrigin(v)) - } - return schema.NewSet(originHash, s) -} - -func expandOrigin(m map[string]interface{}) *cloudfront.Origin { - origin := &cloudfront.Origin{ - Id: aws.String(m["origin_id"].(string)), - DomainName: aws.String(m["domain_name"].(string)), - } - if v, ok := m["custom_header"]; ok { - origin.CustomHeaders = expandCustomHeaders(v.(*schema.Set)) - } - if v, ok := m["custom_origin_config"]; ok { - if s := v.(*schema.Set).List(); len(s) > 0 { - origin.CustomOriginConfig = expandCustomOriginConfig(s[0].(map[string]interface{})) - } - } - if v, ok := m["origin_path"]; ok { - origin.OriginPath = aws.String(v.(string)) - } - if v, ok := m["s3_origin_config"]; ok { - if s := v.(*schema.Set).List(); len(s) > 0 { - origin.S3OriginConfig = expandS3OriginConfig(s[0].(map[string]interface{})) - } - } - - // if both custom and s3 origin are missing, add an empty s3 origin - // One or the other must be specified, but the S3 origin can be "empty" - if origin.S3OriginConfig == nil && origin.CustomOriginConfig == nil { - origin.S3OriginConfig = &cloudfront.S3OriginConfig{ - OriginAccessIdentity: aws.String(""), - } - } - - return origin -} - -func flattenOrigin(or *cloudfront.Origin) map[string]interface{} { - m := make(map[string]interface{}) - m["origin_id"] = *or.Id - m["domain_name"] = *or.DomainName - if or.CustomHeaders != nil { - m["custom_header"] = flattenCustomHeaders(or.CustomHeaders) - } - if or.CustomOriginConfig != nil { - m["custom_origin_config"] = schema.NewSet(customOriginConfigHash, []interface{}{flattenCustomOriginConfig(or.CustomOriginConfig)}) - } - if or.OriginPath != nil { - m["origin_path"] = *or.OriginPath - } - if or.S3OriginConfig != nil { - if or.S3OriginConfig.OriginAccessIdentity != nil && *or.S3OriginConfig.OriginAccessIdentity != "" { - m["s3_origin_config"] = schema.NewSet(s3OriginConfigHash, []interface{}{flattenS3OriginConfig(or.S3OriginConfig)}) - } - } - return m -} - -// Assemble the hash for the aws_cloudfront_distribution origin -// TypeSet attribute. -func originHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["origin_id"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["domain_name"].(string))) - if v, ok := m["custom_header"]; ok { - buf.WriteString(fmt.Sprintf("%d-", customHeadersHash(v.(*schema.Set)))) - } - if v, ok := m["custom_origin_config"]; ok { - if s := v.(*schema.Set).List(); len(s) > 0 { - buf.WriteString(fmt.Sprintf("%d-", customOriginConfigHash((s[0].(map[string]interface{}))))) - } - } - if v, ok := m["origin_path"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["s3_origin_config"]; ok { - if s := v.(*schema.Set).List(); len(s) > 0 { - buf.WriteString(fmt.Sprintf("%d-", s3OriginConfigHash((s[0].(map[string]interface{}))))) - } - } - return hashcode.String(buf.String()) -} - -func expandCustomHeaders(s *schema.Set) *cloudfront.CustomHeaders { - qty := 0 - items := []*cloudfront.OriginCustomHeader{} - for _, v := range s.List() { - items = append(items, expandOriginCustomHeader(v.(map[string]interface{}))) - qty++ - } - return &cloudfront.CustomHeaders{ - Quantity: aws.Int64(int64(qty)), - Items: items, - } -} - -func flattenCustomHeaders(chs *cloudfront.CustomHeaders) *schema.Set { - s := []interface{}{} - for _, v := range chs.Items { - s = append(s, flattenOriginCustomHeader(v)) - } - return schema.NewSet(originCustomHeaderHash, s) -} - -func expandOriginCustomHeader(m map[string]interface{}) *cloudfront.OriginCustomHeader { - return &cloudfront.OriginCustomHeader{ - HeaderName: aws.String(m["name"].(string)), - HeaderValue: aws.String(m["value"].(string)), - } -} - -func flattenOriginCustomHeader(och *cloudfront.OriginCustomHeader) map[string]interface{} { - return map[string]interface{}{ - "name": *och.HeaderName, - "value": *och.HeaderValue, - } -} - -// Helper function used by originHash to get a composite hash for all -// aws_cloudfront_distribution custom_header attributes. -func customHeadersHash(s *schema.Set) int { - var buf bytes.Buffer - for _, v := range s.List() { - buf.WriteString(fmt.Sprintf("%d-", originCustomHeaderHash(v))) - } - return hashcode.String(buf.String()) -} - -// Assemble the hash for the aws_cloudfront_distribution custom_header -// TypeSet attribute. -func originCustomHeaderHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["value"].(string))) - return hashcode.String(buf.String()) -} - -func expandCustomOriginConfig(m map[string]interface{}) *cloudfront.CustomOriginConfig { - return &cloudfront.CustomOriginConfig{ - OriginProtocolPolicy: aws.String(m["origin_protocol_policy"].(string)), - HTTPPort: aws.Int64(int64(m["http_port"].(int))), - HTTPSPort: aws.Int64(int64(m["https_port"].(int))), - OriginSslProtocols: expandCustomOriginConfigSSL(m["origin_ssl_protocols"].([]interface{})), - } -} - -func flattenCustomOriginConfig(cor *cloudfront.CustomOriginConfig) map[string]interface{} { - return map[string]interface{}{ - "origin_protocol_policy": *cor.OriginProtocolPolicy, - "http_port": int(*cor.HTTPPort), - "https_port": int(*cor.HTTPSPort), - "origin_ssl_protocols": flattenCustomOriginConfigSSL(cor.OriginSslProtocols), - } -} - -// Assemble the hash for the aws_cloudfront_distribution custom_origin_config -// TypeSet attribute. -func customOriginConfigHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["origin_protocol_policy"].(string))) - buf.WriteString(fmt.Sprintf("%d-", m["http_port"].(int))) - buf.WriteString(fmt.Sprintf("%d-", m["https_port"].(int))) - for _, v := range sortInterfaceSlice(m["origin_ssl_protocols"].([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - return hashcode.String(buf.String()) -} - -func expandCustomOriginConfigSSL(s []interface{}) *cloudfront.OriginSslProtocols { - items := expandStringList(s) - return &cloudfront.OriginSslProtocols{ - Quantity: aws.Int64(int64(len(items))), - Items: items, - } -} - -func flattenCustomOriginConfigSSL(osp *cloudfront.OriginSslProtocols) []interface{} { - return flattenStringList(osp.Items) -} - -func expandS3OriginConfig(m map[string]interface{}) *cloudfront.S3OriginConfig { - return &cloudfront.S3OriginConfig{ - OriginAccessIdentity: aws.String(m["origin_access_identity"].(string)), - } -} - -func flattenS3OriginConfig(s3o *cloudfront.S3OriginConfig) map[string]interface{} { - return map[string]interface{}{ - "origin_access_identity": *s3o.OriginAccessIdentity, - } -} - -// Assemble the hash for the aws_cloudfront_distribution s3_origin_config -// TypeSet attribute. -func s3OriginConfigHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["origin_access_identity"].(string))) - return hashcode.String(buf.String()) -} - -func expandCustomErrorResponses(s *schema.Set) *cloudfront.CustomErrorResponses { - qty := 0 - items := []*cloudfront.CustomErrorResponse{} - for _, v := range s.List() { - items = append(items, expandCustomErrorResponse(v.(map[string]interface{}))) - qty++ - } - return &cloudfront.CustomErrorResponses{ - Quantity: aws.Int64(int64(qty)), - Items: items, - } -} - -func flattenCustomErrorResponses(ers *cloudfront.CustomErrorResponses) *schema.Set { - s := []interface{}{} - for _, v := range ers.Items { - s = append(s, flattenCustomErrorResponse(v)) - } - return schema.NewSet(customErrorResponseHash, s) -} - -func expandCustomErrorResponse(m map[string]interface{}) *cloudfront.CustomErrorResponse { - er := cloudfront.CustomErrorResponse{ - ErrorCode: aws.Int64(int64(m["error_code"].(int))), - } - if v, ok := m["error_caching_min_ttl"]; ok { - er.ErrorCachingMinTTL = aws.Int64(int64(v.(int))) - } - if v, ok := m["response_code"]; ok && v.(int) != 0 { - er.ResponseCode = aws.String(strconv.Itoa(v.(int))) - } else { - er.ResponseCode = aws.String("") - } - if v, ok := m["response_page_path"]; ok { - er.ResponsePagePath = aws.String(v.(string)) - } - - return &er -} - -func flattenCustomErrorResponse(er *cloudfront.CustomErrorResponse) map[string]interface{} { - m := make(map[string]interface{}) - m["error_code"] = int(*er.ErrorCode) - if er.ErrorCachingMinTTL != nil { - m["error_caching_min_ttl"] = int(*er.ErrorCachingMinTTL) - } - if er.ResponseCode != nil { - m["response_code"], _ = strconv.Atoi(*er.ResponseCode) - } - if er.ResponsePagePath != nil { - m["response_page_path"] = *er.ResponsePagePath - } - return m -} - -// Assemble the hash for the aws_cloudfront_distribution custom_error_response -// TypeSet attribute. -func customErrorResponseHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%d-", m["error_code"].(int))) - if v, ok := m["error_caching_min_ttl"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(int))) - } - if v, ok := m["response_code"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(int))) - } - if v, ok := m["response_page_path"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - return hashcode.String(buf.String()) -} - -func expandLoggingConfig(m map[string]interface{}) *cloudfront.LoggingConfig { - var lc cloudfront.LoggingConfig - if m != nil { - lc.Prefix = aws.String(m["prefix"].(string)) - lc.Bucket = aws.String(m["bucket"].(string)) - lc.IncludeCookies = aws.Bool(m["include_cookies"].(bool)) - lc.Enabled = aws.Bool(true) - } else { - lc.Prefix = aws.String("") - lc.Bucket = aws.String("") - lc.IncludeCookies = aws.Bool(false) - lc.Enabled = aws.Bool(false) - } - return &lc -} - -func flattenLoggingConfig(lc *cloudfront.LoggingConfig) *schema.Set { - m := make(map[string]interface{}) - m["prefix"] = *lc.Prefix - m["bucket"] = *lc.Bucket - m["include_cookies"] = *lc.IncludeCookies - return schema.NewSet(loggingConfigHash, []interface{}{m}) -} - -// Assemble the hash for the aws_cloudfront_distribution logging_config -// TypeSet attribute. -func loggingConfigHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["prefix"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["bucket"].(string))) - buf.WriteString(fmt.Sprintf("%t-", m["include_cookies"].(bool))) - return hashcode.String(buf.String()) -} - -func expandAliases(as *schema.Set) *cloudfront.Aliases { - s := as.List() - var aliases cloudfront.Aliases - if len(s) > 0 { - aliases.Quantity = aws.Int64(int64(len(s))) - aliases.Items = expandStringList(s) - } else { - aliases.Quantity = aws.Int64(0) - } - return &aliases -} - -func flattenAliases(aliases *cloudfront.Aliases) *schema.Set { - if aliases.Items != nil { - return schema.NewSet(aliasesHash, flattenStringList(aliases.Items)) - } - return schema.NewSet(aliasesHash, []interface{}{}) -} - -// Assemble the hash for the aws_cloudfront_distribution aliases -// TypeSet attribute. -func aliasesHash(v interface{}) int { - return hashcode.String(v.(string)) -} - -func expandRestrictions(m map[string]interface{}) *cloudfront.Restrictions { - return &cloudfront.Restrictions{ - GeoRestriction: expandGeoRestriction(m["geo_restriction"].(*schema.Set).List()[0].(map[string]interface{})), - } -} - -func flattenRestrictions(r *cloudfront.Restrictions) *schema.Set { - m := make(map[string]interface{}) - s := schema.NewSet(geoRestrictionHash, []interface{}{flattenGeoRestriction(r.GeoRestriction)}) - m["geo_restriction"] = s - return schema.NewSet(restrictionsHash, []interface{}{m}) -} - -// Assemble the hash for the aws_cloudfront_distribution restrictions -// TypeSet attribute. -func restrictionsHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%d-", geoRestrictionHash(m["geo_restriction"].(*schema.Set).List()[0].(map[string]interface{})))) - return hashcode.String(buf.String()) -} - -func expandGeoRestriction(m map[string]interface{}) *cloudfront.GeoRestriction { - gr := cloudfront.GeoRestriction{ - RestrictionType: aws.String(m["restriction_type"].(string)), - } - if v, ok := m["locations"]; ok { - gr.Quantity = aws.Int64(int64(len(v.([]interface{})))) - gr.Items = expandStringList(v.([]interface{})) - sort.Sort(StringPtrSlice(gr.Items)) - } else { - gr.Quantity = aws.Int64(0) - } - return &gr -} - -func flattenGeoRestriction(gr *cloudfront.GeoRestriction) map[string]interface{} { - m := make(map[string]interface{}) - - m["restriction_type"] = *gr.RestrictionType - if gr.Items != nil { - sort.Sort(StringPtrSlice(gr.Items)) - m["locations"] = flattenStringList(gr.Items) - } - return m -} - -// Assemble the hash for the aws_cloudfront_distribution geo_restriction -// TypeSet attribute. -func geoRestrictionHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - // All keys added in alphabetical order. - buf.WriteString(fmt.Sprintf("%s-", m["restriction_type"].(string))) - if v, ok := m["locations"]; ok { - for _, w := range sortInterfaceSlice(v.([]interface{})) { - buf.WriteString(fmt.Sprintf("%s-", w.(string))) - } - } - return hashcode.String(buf.String()) -} - -func expandViewerCertificate(m map[string]interface{}) *cloudfront.ViewerCertificate { - var vc cloudfront.ViewerCertificate - if v, ok := m["iam_certificate_id"]; ok && v != "" { - vc.IAMCertificateId = aws.String(v.(string)) - vc.SSLSupportMethod = aws.String(m["ssl_support_method"].(string)) - } else if v, ok := m["acm_certificate_arn"]; ok && v != "" { - vc.ACMCertificateArn = aws.String(v.(string)) - vc.SSLSupportMethod = aws.String(m["ssl_support_method"].(string)) - } else { - vc.CloudFrontDefaultCertificate = aws.Bool(m["cloudfront_default_certificate"].(bool)) - } - if v, ok := m["minimum_protocol_version"]; ok && v != "" { - vc.MinimumProtocolVersion = aws.String(v.(string)) - } - return &vc -} - -func flattenViewerCertificate(vc *cloudfront.ViewerCertificate) *schema.Set { - m := make(map[string]interface{}) - - if vc.IAMCertificateId != nil { - m["iam_certificate_id"] = *vc.IAMCertificateId - m["ssl_support_method"] = *vc.SSLSupportMethod - } - if vc.ACMCertificateArn != nil { - m["acm_certificate_arn"] = *vc.ACMCertificateArn - m["ssl_support_method"] = *vc.SSLSupportMethod - } - if vc.CloudFrontDefaultCertificate != nil { - m["cloudfront_default_certificate"] = *vc.CloudFrontDefaultCertificate - } - if vc.MinimumProtocolVersion != nil { - m["minimum_protocol_version"] = *vc.MinimumProtocolVersion - } - return schema.NewSet(viewerCertificateHash, []interface{}{m}) -} - -// Assemble the hash for the aws_cloudfront_distribution viewer_certificate -// TypeSet attribute. -func viewerCertificateHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - if v, ok := m["iam_certificate_id"]; ok && v.(string) != "" { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - buf.WriteString(fmt.Sprintf("%s-", m["ssl_support_method"].(string))) - } else if v, ok := m["acm_certificate_arn"]; ok && v.(string) != "" { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - buf.WriteString(fmt.Sprintf("%s-", m["ssl_support_method"].(string))) - } else { - buf.WriteString(fmt.Sprintf("%t-", m["cloudfront_default_certificate"].(bool))) - } - if v, ok := m["minimum_protocol_version"]; ok && v.(string) != "" { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - return hashcode.String(buf.String()) -} - -// Do a top-level copy of struct fields from one struct to another. Used to -// copy fields between CacheBehavior and DefaultCacheBehavior structs. -func simpleCopyStruct(src, dst interface{}) { - s := reflect.ValueOf(src).Elem() - d := reflect.ValueOf(dst).Elem() - - for i := 0; i < s.NumField(); i++ { - if s.Field(i).CanSet() == true { - if s.Field(i).Interface() != nil { - for j := 0; j < d.NumField(); j++ { - if d.Type().Field(j).Name == s.Type().Field(i).Name { - d.Field(j).Set(s.Field(i)) - } - } - } - } - } -} - -// Convert *cloudfront.ActiveTrustedSigners to a flatmap.Map type, which ensures -// it can probably be inserted into the schema.TypeMap type used by the -// active_trusted_signers attribute. -func flattenActiveTrustedSigners(ats *cloudfront.ActiveTrustedSigners) flatmap.Map { - m := make(map[string]interface{}) - s := []interface{}{} - m["enabled"] = *ats.Enabled - - for _, v := range ats.Items { - signer := make(map[string]interface{}) - signer["aws_account_number"] = *v.AwsAccountNumber - signer["key_pair_ids"] = aws.StringValueSlice(v.KeyPairIds.Items) - s = append(s, signer) - } - m["items"] = s - return flatmap.Flatten(m) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/config.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/config.go deleted file mode 100644 index 7f2ee0d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/config.go +++ /dev/null @@ -1,421 +0,0 @@ -package aws - -import ( - "crypto/tls" - "errors" - "fmt" - "log" - "net/http" - "os" - "strings" - "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/acm" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/aws/aws-sdk-go/service/applicationautoscaling" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/aws/aws-sdk-go/service/cloudtrail" - "github.com/aws/aws-sdk-go/service/cloudwatch" - "github.com/aws/aws-sdk-go/service/cloudwatchevents" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - "github.com/aws/aws-sdk-go/service/codebuild" - "github.com/aws/aws-sdk-go/service/codecommit" - "github.com/aws/aws-sdk-go/service/codedeploy" - "github.com/aws/aws-sdk-go/service/codepipeline" - "github.com/aws/aws-sdk-go/service/configservice" - "github.com/aws/aws-sdk-go/service/databasemigrationservice" - "github.com/aws/aws-sdk-go/service/directoryservice" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/ecr" - "github.com/aws/aws-sdk-go/service/ecs" - "github.com/aws/aws-sdk-go/service/efs" - "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - "github.com/aws/aws-sdk-go/service/elastictranscoder" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/aws/aws-sdk-go/service/emr" - "github.com/aws/aws-sdk-go/service/firehose" - "github.com/aws/aws-sdk-go/service/glacier" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/aws/aws-sdk-go/service/inspector" - "github.com/aws/aws-sdk-go/service/kinesis" - "github.com/aws/aws-sdk-go/service/kms" - "github.com/aws/aws-sdk-go/service/lambda" - "github.com/aws/aws-sdk-go/service/lightsail" - "github.com/aws/aws-sdk-go/service/opsworks" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/ses" - "github.com/aws/aws-sdk-go/service/sfn" - "github.com/aws/aws-sdk-go/service/simpledb" - "github.com/aws/aws-sdk-go/service/sns" - "github.com/aws/aws-sdk-go/service/sqs" - "github.com/aws/aws-sdk-go/service/ssm" - "github.com/aws/aws-sdk-go/service/sts" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/go-cleanhttp" - "github.com/hashicorp/terraform/helper/logging" - "github.com/hashicorp/terraform/terraform" -) - -type Config struct { - AccessKey string - SecretKey string - CredsFilename string - Profile string - Token string - Region string - MaxRetries int - - AssumeRoleARN string - AssumeRoleExternalID string - AssumeRoleSessionName string - AssumeRolePolicy string - - AllowedAccountIds []interface{} - ForbiddenAccountIds []interface{} - - DynamoDBEndpoint string - KinesisEndpoint string - Ec2Endpoint string - IamEndpoint string - ElbEndpoint string - S3Endpoint string - Insecure bool - - SkipCredsValidation bool - SkipRegionValidation bool - SkipRequestingAccountId bool - SkipMetadataApiCheck bool - S3ForcePathStyle bool -} - -type AWSClient struct { - cfconn *cloudformation.CloudFormation - cloudfrontconn *cloudfront.CloudFront - cloudtrailconn *cloudtrail.CloudTrail - cloudwatchconn *cloudwatch.CloudWatch - cloudwatchlogsconn *cloudwatchlogs.CloudWatchLogs - cloudwatcheventsconn *cloudwatchevents.CloudWatchEvents - configconn *configservice.ConfigService - dmsconn *databasemigrationservice.DatabaseMigrationService - dsconn *directoryservice.DirectoryService - dynamodbconn *dynamodb.DynamoDB - ec2conn *ec2.EC2 - ecrconn *ecr.ECR - ecsconn *ecs.ECS - efsconn *efs.EFS - elbconn *elb.ELB - elbv2conn *elbv2.ELBV2 - emrconn *emr.EMR - esconn *elasticsearch.ElasticsearchService - acmconn *acm.ACM - apigateway *apigateway.APIGateway - appautoscalingconn *applicationautoscaling.ApplicationAutoScaling - autoscalingconn *autoscaling.AutoScaling - s3conn *s3.S3 - sesConn *ses.SES - simpledbconn *simpledb.SimpleDB - sqsconn *sqs.SQS - snsconn *sns.SNS - stsconn *sts.STS - redshiftconn *redshift.Redshift - r53conn *route53.Route53 - partition string - accountid string - region string - rdsconn *rds.RDS - iamconn *iam.IAM - kinesisconn *kinesis.Kinesis - kmsconn *kms.KMS - firehoseconn *firehose.Firehose - inspectorconn *inspector.Inspector - elasticacheconn *elasticache.ElastiCache - elasticbeanstalkconn *elasticbeanstalk.ElasticBeanstalk - elastictranscoderconn *elastictranscoder.ElasticTranscoder - lambdaconn *lambda.Lambda - lightsailconn *lightsail.Lightsail - opsworksconn *opsworks.OpsWorks - glacierconn *glacier.Glacier - codebuildconn *codebuild.CodeBuild - codedeployconn *codedeploy.CodeDeploy - codecommitconn *codecommit.CodeCommit - codepipelineconn *codepipeline.CodePipeline - sfnconn *sfn.SFN - ssmconn *ssm.SSM - wafconn *waf.WAF -} - -// Client configures and returns a fully initialized AWSClient -func (c *Config) Client() (interface{}, error) { - // Get the auth and region. This can fail if keys/regions were not - // specified and we're attempting to use the environment. - if c.SkipRegionValidation { - log.Println("[INFO] Skipping region validation") - } else { - log.Println("[INFO] Building AWS region structure") - err := c.ValidateRegion() - if err != nil { - return nil, err - } - } - - var client AWSClient - // store AWS region in client struct, for region specific operations such as - // bucket storage in S3 - client.region = c.Region - - log.Println("[INFO] Building AWS auth structure") - creds, err := GetCredentials(c) - if err != nil { - return nil, err - } - // Call Get to check for credential provider. If nothing found, we'll get an - // error, and we can present it nicely to the user - cp, err := creds.Get() - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoCredentialProviders" { - return nil, errors.New(`No valid credential sources found for AWS Provider. - Please see https://terraform.io/docs/providers/aws/index.html for more information on - providing credentials for the AWS Provider`) - } - - return nil, fmt.Errorf("Error loading credentials for AWS Provider: %s", err) - } - - log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName) - - awsConfig := &aws.Config{ - Credentials: creds, - Region: aws.String(c.Region), - MaxRetries: aws.Int(c.MaxRetries), - HTTPClient: cleanhttp.DefaultClient(), - S3ForcePathStyle: aws.Bool(c.S3ForcePathStyle), - } - - if logging.IsDebugOrHigher() { - awsConfig.LogLevel = aws.LogLevel(aws.LogDebugWithHTTPBody) - awsConfig.Logger = awsLogger{} - } - - if c.Insecure { - transport := awsConfig.HTTPClient.Transport.(*http.Transport) - transport.TLSClientConfig = &tls.Config{ - InsecureSkipVerify: true, - } - } - - // Set up base session - sess, err := session.NewSession(awsConfig) - if err != nil { - return nil, errwrap.Wrapf("Error creating AWS session: {{err}}", err) - } - - // Removes the SDK Version handler, so we only have the provider User-Agent - // Ex: "User-Agent: APN/1.0 HashiCorp/1.0 Terraform/0.7.9-dev" - sess.Handlers.Build.Remove(request.NamedHandler{Name: "core.SDKVersionUserAgentHandler"}) - sess.Handlers.Build.PushFrontNamed(addTerraformVersionToUserAgent) - - if extraDebug := os.Getenv("TERRAFORM_AWS_AUTHFAILURE_DEBUG"); extraDebug != "" { - sess.Handlers.UnmarshalError.PushFrontNamed(debugAuthFailure) - } - - // Some services exist only in us-east-1, e.g. because they manage - // resources that can span across multiple regions, or because - // signature format v4 requires region to be us-east-1 for global - // endpoints: - // http://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html - usEast1Sess := sess.Copy(&aws.Config{Region: aws.String("us-east-1")}) - - // Some services have user-configurable endpoints - awsEc2Sess := sess.Copy(&aws.Config{Endpoint: aws.String(c.Ec2Endpoint)}) - awsElbSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.ElbEndpoint)}) - awsIamSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.IamEndpoint)}) - awsS3Sess := sess.Copy(&aws.Config{Endpoint: aws.String(c.S3Endpoint)}) - dynamoSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.DynamoDBEndpoint)}) - kinesisSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.KinesisEndpoint)}) - - // These two services need to be set up early so we can check on AccountID - client.iamconn = iam.New(awsIamSess) - client.stsconn = sts.New(sess) - - if !c.SkipCredsValidation { - err = c.ValidateCredentials(client.stsconn) - if err != nil { - return nil, err - } - } - - if !c.SkipRequestingAccountId { - partition, accountId, err := GetAccountInfo(client.iamconn, client.stsconn, cp.ProviderName) - if err == nil { - client.partition = partition - client.accountid = accountId - } - } - - authErr := c.ValidateAccountId(client.accountid) - if authErr != nil { - return nil, authErr - } - - client.acmconn = acm.New(sess) - client.apigateway = apigateway.New(sess) - client.appautoscalingconn = applicationautoscaling.New(sess) - client.autoscalingconn = autoscaling.New(sess) - client.cfconn = cloudformation.New(sess) - client.cloudfrontconn = cloudfront.New(sess) - client.cloudtrailconn = cloudtrail.New(sess) - client.cloudwatchconn = cloudwatch.New(sess) - client.cloudwatcheventsconn = cloudwatchevents.New(sess) - client.cloudwatchlogsconn = cloudwatchlogs.New(sess) - client.codecommitconn = codecommit.New(sess) - client.codebuildconn = codebuild.New(sess) - client.codedeployconn = codedeploy.New(sess) - client.configconn = configservice.New(sess) - client.dmsconn = databasemigrationservice.New(sess) - client.codepipelineconn = codepipeline.New(sess) - client.dsconn = directoryservice.New(sess) - client.dynamodbconn = dynamodb.New(dynamoSess) - client.ec2conn = ec2.New(awsEc2Sess) - client.ecrconn = ecr.New(sess) - client.ecsconn = ecs.New(sess) - client.efsconn = efs.New(sess) - client.elasticacheconn = elasticache.New(sess) - client.elasticbeanstalkconn = elasticbeanstalk.New(sess) - client.elastictranscoderconn = elastictranscoder.New(sess) - client.elbconn = elb.New(awsElbSess) - client.elbv2conn = elbv2.New(awsElbSess) - client.emrconn = emr.New(sess) - client.esconn = elasticsearch.New(sess) - client.firehoseconn = firehose.New(sess) - client.inspectorconn = inspector.New(sess) - client.glacierconn = glacier.New(sess) - client.kinesisconn = kinesis.New(kinesisSess) - client.kmsconn = kms.New(sess) - client.lambdaconn = lambda.New(sess) - client.lightsailconn = lightsail.New(usEast1Sess) - client.opsworksconn = opsworks.New(sess) - client.r53conn = route53.New(usEast1Sess) - client.rdsconn = rds.New(sess) - client.redshiftconn = redshift.New(sess) - client.simpledbconn = simpledb.New(sess) - client.s3conn = s3.New(awsS3Sess) - client.sesConn = ses.New(sess) - client.sfnconn = sfn.New(sess) - client.snsconn = sns.New(sess) - client.sqsconn = sqs.New(sess) - client.ssmconn = ssm.New(sess) - client.wafconn = waf.New(sess) - - return &client, nil -} - -// ValidateRegion returns an error if the configured region is not a -// valid aws region and nil otherwise. -func (c *Config) ValidateRegion() error { - var regions = []string{ - "ap-northeast-1", - "ap-northeast-2", - "ap-south-1", - "ap-southeast-1", - "ap-southeast-2", - "ca-central-1", - "cn-north-1", - "eu-central-1", - "eu-west-1", - "eu-west-2", - "sa-east-1", - "us-east-1", - "us-east-2", - "us-gov-west-1", - "us-west-1", - "us-west-2", - } - - for _, valid := range regions { - if c.Region == valid { - return nil - } - } - return fmt.Errorf("Not a valid region: %s", c.Region) -} - -// Validate credentials early and fail before we do any graph walking. -func (c *Config) ValidateCredentials(stsconn *sts.STS) error { - _, err := stsconn.GetCallerIdentity(&sts.GetCallerIdentityInput{}) - return err -} - -// ValidateAccountId returns a context-specific error if the configured account -// id is explicitly forbidden or not authorised; and nil if it is authorised. -func (c *Config) ValidateAccountId(accountId string) error { - if c.AllowedAccountIds == nil && c.ForbiddenAccountIds == nil { - return nil - } - - log.Println("[INFO] Validating account ID") - - if c.ForbiddenAccountIds != nil { - for _, id := range c.ForbiddenAccountIds { - if id == accountId { - return fmt.Errorf("Forbidden account ID (%s)", id) - } - } - } - - if c.AllowedAccountIds != nil { - for _, id := range c.AllowedAccountIds { - if id == accountId { - return nil - } - } - return fmt.Errorf("Account ID not allowed (%s)", accountId) - } - - return nil -} - -// addTerraformVersionToUserAgent is a named handler that will add Terraform's -// version information to requests made by the AWS SDK. -var addTerraformVersionToUserAgent = request.NamedHandler{ - Name: "terraform.TerraformVersionUserAgentHandler", - Fn: request.MakeAddToUserAgentHandler( - "APN/1.0 HashiCorp/1.0 Terraform", terraform.VersionString()), -} - -var debugAuthFailure = request.NamedHandler{ - Name: "terraform.AuthFailureAdditionalDebugHandler", - Fn: func(req *request.Request) { - if isAWSErr(req.Error, "AuthFailure", "AWS was not able to validate the provided access credentials") { - log.Printf("[INFO] Additional AuthFailure Debugging Context") - log.Printf("[INFO] Current system UTC time: %s", time.Now().UTC()) - log.Printf("[INFO] Request object: %s", spew.Sdump(req)) - } - }, -} - -type awsLogger struct{} - -func (l awsLogger) Log(args ...interface{}) { - tokens := make([]string, 0, len(args)) - for _, arg := range args { - if token, ok := arg.(string); ok { - tokens = append(tokens, token) - } - } - log.Printf("[DEBUG] [aws-sdk-go] %s", strings.Join(tokens, " ")) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_acm_certificate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_acm_certificate.go deleted file mode 100644 index 68b2218..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_acm_certificate.go +++ /dev/null @@ -1,73 +0,0 @@ -package aws - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/acm" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsAcmCertificate() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsAcmCertificateRead, - Schema: map[string]*schema.Schema{ - "domain": { - Type: schema.TypeString, - Required: true, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "statuses": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - } -} - -func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).acmconn - params := &acm.ListCertificatesInput{} - - target := d.Get("domain") - - statuses, ok := d.GetOk("statuses") - if ok { - statusStrings := statuses.([]interface{}) - params.CertificateStatuses = expandStringList(statusStrings) - } else { - params.CertificateStatuses = []*string{aws.String("ISSUED")} - } - - var arns []string - err := conn.ListCertificatesPages(params, func(page *acm.ListCertificatesOutput, lastPage bool) bool { - for _, cert := range page.CertificateSummaryList { - if *cert.DomainName == target { - arns = append(arns, *cert.CertificateArn) - } - } - - return true - }) - if err != nil { - return errwrap.Wrapf("Error describing certificates: {{err}}", err) - } - - if len(arns) == 0 { - return fmt.Errorf("No certificate for domain %q found in this region.", target) - } - if len(arns) > 1 { - return fmt.Errorf("Multiple certificates for domain %q found in this region.", target) - } - - d.SetId(time.Now().UTC().String()) - d.Set("arn", arns[0]) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_alb.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_alb.go deleted file mode 100644 index d314e0e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_alb.go +++ /dev/null @@ -1,127 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsAlb() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsAlbRead, - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "arn_suffix": { - Type: schema.TypeString, - Computed: true, - }, - - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "internal": { - Type: schema.TypeBool, - Computed: true, - }, - - "security_groups": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, - Set: schema.HashString, - }, - - "subnets": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, - Set: schema.HashString, - }, - - "access_logs": { - Type: schema.TypeList, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Computed: true, - }, - "prefix": { - Type: schema.TypeString, - Computed: true, - }, - "enabled": { - Type: schema.TypeBool, - Computed: true, - }, - }, - }, - }, - - "enable_deletion_protection": { - Type: schema.TypeBool, - Computed: true, - }, - - "idle_timeout": { - Type: schema.TypeInt, - Computed: true, - }, - - "vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - - "zone_id": { - Type: schema.TypeString, - Computed: true, - }, - - "dns_name": { - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchemaComputed(), - }, - } -} - -func dataSourceAwsAlbRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - albArn := d.Get("arn").(string) - albName := d.Get("name").(string) - - describeAlbOpts := &elbv2.DescribeLoadBalancersInput{} - switch { - case albArn != "": - describeAlbOpts.LoadBalancerArns = []*string{aws.String(albArn)} - case albName != "": - describeAlbOpts.Names = []*string{aws.String(albName)} - } - - describeResp, err := elbconn.DescribeLoadBalancers(describeAlbOpts) - if err != nil { - return errwrap.Wrapf("Error retrieving ALB: {{err}}", err) - } - if len(describeResp.LoadBalancers) != 1 { - return fmt.Errorf("Search returned %d results, please revise so only one is returned", len(describeResp.LoadBalancers)) - } - d.SetId(*describeResp.LoadBalancers[0].LoadBalancerArn) - - return flattenAwsAlbResource(d, meta, describeResp.LoadBalancers[0]) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_alb_listener.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_alb_listener.go deleted file mode 100644 index 63ec4ed..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_alb_listener.go +++ /dev/null @@ -1,62 +0,0 @@ -package aws - -import "github.com/hashicorp/terraform/helper/schema" - -func dataSourceAwsAlbListener() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsAlbListenerRead, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Required: true, - }, - - "load_balancer_arn": { - Type: schema.TypeString, - Computed: true, - }, - "port": { - Type: schema.TypeInt, - Computed: true, - }, - - "protocol": { - Type: schema.TypeString, - Computed: true, - }, - - "ssl_policy": { - Type: schema.TypeString, - Computed: true, - }, - - "certificate_arn": { - Type: schema.TypeString, - Computed: true, - }, - - "default_action": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "target_group_arn": { - Type: schema.TypeString, - Computed: true, - }, - "type": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - }, - } -} - -func dataSourceAwsAlbListenerRead(d *schema.ResourceData, meta interface{}) error { - d.SetId(d.Get("arn").(string)) - return resourceAwsAlbListenerRead(d, meta) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ami.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ami.go deleted file mode 100644 index 877069a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ami.go +++ /dev/null @@ -1,437 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "sort" - "time" - - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsAmi() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsAmiRead, - - Schema: map[string]*schema.Schema{ - "filter": dataSourceFiltersSchema(), - "executable_users": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "name_regex": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validateNameRegex, - }, - "most_recent": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - "owners": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - // Computed values. - "architecture": { - Type: schema.TypeString, - Computed: true, - }, - "creation_date": { - Type: schema.TypeString, - Computed: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - "hypervisor": { - Type: schema.TypeString, - Computed: true, - }, - "image_id": { - Type: schema.TypeString, - Computed: true, - }, - "image_location": { - Type: schema.TypeString, - Computed: true, - }, - "image_owner_alias": { - Type: schema.TypeString, - Computed: true, - }, - "image_type": { - Type: schema.TypeString, - Computed: true, - }, - "kernel_id": { - Type: schema.TypeString, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Computed: true, - }, - "owner_id": { - Type: schema.TypeString, - Computed: true, - }, - "platform": { - Type: schema.TypeString, - Computed: true, - }, - "public": { - Type: schema.TypeBool, - Computed: true, - }, - "ramdisk_id": { - Type: schema.TypeString, - Computed: true, - }, - "root_device_name": { - Type: schema.TypeString, - Computed: true, - }, - "root_device_type": { - Type: schema.TypeString, - Computed: true, - }, - "sriov_net_support": { - Type: schema.TypeString, - Computed: true, - }, - "state": { - Type: schema.TypeString, - Computed: true, - }, - "virtualization_type": { - Type: schema.TypeString, - Computed: true, - }, - // Complex computed values - "block_device_mappings": { - Type: schema.TypeSet, - Computed: true, - Set: amiBlockDeviceMappingHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "device_name": { - Type: schema.TypeString, - Computed: true, - }, - "no_device": { - Type: schema.TypeString, - Computed: true, - }, - "virtual_name": { - Type: schema.TypeString, - Computed: true, - }, - "ebs": { - Type: schema.TypeMap, - Computed: true, - }, - }, - }, - }, - "product_codes": { - Type: schema.TypeSet, - Computed: true, - Set: amiProductCodesHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "product_code_id": { - Type: schema.TypeString, - Computed: true, - }, - "product_code_type": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - "state_reason": { - Type: schema.TypeMap, - Computed: true, - }, - "tags": dataSourceTagsSchema(), - }, - } -} - -// dataSourceAwsAmiDescriptionRead performs the AMI lookup. -func dataSourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - executableUsers, executableUsersOk := d.GetOk("executable_users") - filters, filtersOk := d.GetOk("filter") - nameRegex, nameRegexOk := d.GetOk("name_regex") - owners, ownersOk := d.GetOk("owners") - - if executableUsersOk == false && filtersOk == false && nameRegexOk == false && ownersOk == false { - return fmt.Errorf("One of executable_users, filters, name_regex, or owners must be assigned") - } - - params := &ec2.DescribeImagesInput{} - if executableUsersOk { - params.ExecutableUsers = expandStringList(executableUsers.([]interface{})) - } - if filtersOk { - params.Filters = buildAwsDataSourceFilters(filters.(*schema.Set)) - } - if ownersOk { - o := expandStringList(owners.([]interface{})) - - if len(o) > 0 { - params.Owners = o - } - } - - resp, err := conn.DescribeImages(params) - if err != nil { - return err - } - - var filteredImages []*ec2.Image - if nameRegexOk { - r := regexp.MustCompile(nameRegex.(string)) - for _, image := range resp.Images { - // Check for a very rare case where the response would include no - // image name. No name means nothing to attempt a match against, - // therefore we are skipping such image. - if image.Name == nil || *image.Name == "" { - log.Printf("[WARN] Unable to find AMI name to match against "+ - "for image ID %q owned by %q, nothing to do.", - *image.ImageId, *image.OwnerId) - continue - } - if r.MatchString(*image.Name) { - filteredImages = append(filteredImages, image) - } - } - } else { - filteredImages = resp.Images[:] - } - - var image *ec2.Image - if len(filteredImages) < 1 { - return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.") - } - - if len(filteredImages) > 1 { - recent := d.Get("most_recent").(bool) - log.Printf("[DEBUG] aws_ami - multiple results found and `most_recent` is set to: %t", recent) - if recent { - image = mostRecentAmi(filteredImages) - } else { - return fmt.Errorf("Your query returned more than one result. Please try a more " + - "specific search criteria, or set `most_recent` attribute to true.") - } - } else { - // Query returned single result. - image = filteredImages[0] - } - - log.Printf("[DEBUG] aws_ami - Single AMI found: %s", *image.ImageId) - return amiDescriptionAttributes(d, image) -} - -type imageSort []*ec2.Image - -func (a imageSort) Len() int { return len(a) } -func (a imageSort) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a imageSort) Less(i, j int) bool { - itime, _ := time.Parse(time.RFC3339, *a[i].CreationDate) - jtime, _ := time.Parse(time.RFC3339, *a[j].CreationDate) - return itime.Unix() < jtime.Unix() -} - -// Returns the most recent AMI out of a slice of images. -func mostRecentAmi(images []*ec2.Image) *ec2.Image { - sortedImages := images - sort.Sort(imageSort(sortedImages)) - return sortedImages[len(sortedImages)-1] -} - -// populate the numerous fields that the image description returns. -func amiDescriptionAttributes(d *schema.ResourceData, image *ec2.Image) error { - // Simple attributes first - d.SetId(*image.ImageId) - d.Set("architecture", image.Architecture) - d.Set("creation_date", image.CreationDate) - if image.Description != nil { - d.Set("description", image.Description) - } - d.Set("hypervisor", image.Hypervisor) - d.Set("image_id", image.ImageId) - d.Set("image_location", image.ImageLocation) - if image.ImageOwnerAlias != nil { - d.Set("image_owner_alias", image.ImageOwnerAlias) - } - d.Set("image_type", image.ImageType) - if image.KernelId != nil { - d.Set("kernel_id", image.KernelId) - } - d.Set("name", image.Name) - d.Set("owner_id", image.OwnerId) - if image.Platform != nil { - d.Set("platform", image.Platform) - } - d.Set("public", image.Public) - if image.RamdiskId != nil { - d.Set("ramdisk_id", image.RamdiskId) - } - if image.RootDeviceName != nil { - d.Set("root_device_name", image.RootDeviceName) - } - d.Set("root_device_type", image.RootDeviceType) - if image.SriovNetSupport != nil { - d.Set("sriov_net_support", image.SriovNetSupport) - } - d.Set("state", image.State) - d.Set("virtualization_type", image.VirtualizationType) - // Complex types get their own functions - if err := d.Set("block_device_mappings", amiBlockDeviceMappings(image.BlockDeviceMappings)); err != nil { - return err - } - if err := d.Set("product_codes", amiProductCodes(image.ProductCodes)); err != nil { - return err - } - if err := d.Set("state_reason", amiStateReason(image.StateReason)); err != nil { - return err - } - if err := d.Set("tags", dataSourceTags(image.Tags)); err != nil { - return err - } - return nil -} - -// Returns a set of block device mappings. -func amiBlockDeviceMappings(m []*ec2.BlockDeviceMapping) *schema.Set { - s := &schema.Set{ - F: amiBlockDeviceMappingHash, - } - for _, v := range m { - mapping := map[string]interface{}{ - "device_name": *v.DeviceName, - } - if v.Ebs != nil { - ebs := map[string]interface{}{ - "delete_on_termination": fmt.Sprintf("%t", *v.Ebs.DeleteOnTermination), - "encrypted": fmt.Sprintf("%t", *v.Ebs.Encrypted), - "volume_size": fmt.Sprintf("%d", *v.Ebs.VolumeSize), - "volume_type": *v.Ebs.VolumeType, - } - // Iops is not always set - if v.Ebs.Iops != nil { - ebs["iops"] = fmt.Sprintf("%d", *v.Ebs.Iops) - } else { - ebs["iops"] = "0" - } - // snapshot id may not be set - if v.Ebs.SnapshotId != nil { - ebs["snapshot_id"] = *v.Ebs.SnapshotId - } - - mapping["ebs"] = ebs - } - if v.VirtualName != nil { - mapping["virtual_name"] = *v.VirtualName - } - log.Printf("[DEBUG] aws_ami - adding block device mapping: %v", mapping) - s.Add(mapping) - } - return s -} - -// Returns a set of product codes. -func amiProductCodes(m []*ec2.ProductCode) *schema.Set { - s := &schema.Set{ - F: amiProductCodesHash, - } - for _, v := range m { - code := map[string]interface{}{ - "product_code_id": *v.ProductCodeId, - "product_code_type": *v.ProductCodeType, - } - s.Add(code) - } - return s -} - -// Returns the state reason. -func amiStateReason(m *ec2.StateReason) map[string]interface{} { - s := make(map[string]interface{}) - if m != nil { - s["code"] = *m.Code - s["message"] = *m.Message - } else { - s["code"] = "UNSET" - s["message"] = "UNSET" - } - return s -} - -// Generates a hash for the set hash function used by the block_device_mappings -// attribute. -func amiBlockDeviceMappingHash(v interface{}) int { - var buf bytes.Buffer - // All keys added in alphabetical order. - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - if d, ok := m["ebs"]; ok { - if len(d.(map[string]interface{})) > 0 { - e := d.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", e["delete_on_termination"].(string))) - buf.WriteString(fmt.Sprintf("%s-", e["encrypted"].(string))) - buf.WriteString(fmt.Sprintf("%s-", e["iops"].(string))) - buf.WriteString(fmt.Sprintf("%s-", e["volume_size"].(string))) - buf.WriteString(fmt.Sprintf("%s-", e["volume_type"].(string))) - } - } - if d, ok := m["no_device"]; ok { - buf.WriteString(fmt.Sprintf("%s-", d.(string))) - } - if d, ok := m["virtual_name"]; ok { - buf.WriteString(fmt.Sprintf("%s-", d.(string))) - } - if d, ok := m["snapshot_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", d.(string))) - } - return hashcode.String(buf.String()) -} - -// Generates a hash for the set hash function used by the product_codes -// attribute. -func amiProductCodesHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - // All keys added in alphabetical order. - buf.WriteString(fmt.Sprintf("%s-", m["product_code_id"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["product_code_type"].(string))) - return hashcode.String(buf.String()) -} - -func validateNameRegex(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if _, err := regexp.Compile(value); err != nil { - errors = append(errors, fmt.Errorf( - "%q contains an invalid regular expression: %s", - k, err)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_autoscaling_groups.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_autoscaling_groups.go deleted file mode 100644 index 3f23282..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_autoscaling_groups.go +++ /dev/null @@ -1,51 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "sort" - "time" - - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsAutoscalingGroups() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsAutoscalingGroupsRead, - - Schema: map[string]*schema.Schema{ - "names": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - } -} - -func dataSourceAwsAutoscalingGroupsRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - - log.Printf("[DEBUG] Reading Autoscaling Groups.") - d.SetId(time.Now().UTC().String()) - - resp, err := conn.DescribeAutoScalingGroups(&autoscaling.DescribeAutoScalingGroupsInput{}) - if err != nil { - return fmt.Errorf("Error fetching Autoscaling Groups: %s", err) - } - - raw := make([]string, len(resp.AutoScalingGroups)) - for i, v := range resp.AutoScalingGroups { - raw[i] = *v.AutoScalingGroupName - } - - sort.Strings(raw) - - if err := d.Set("names", raw); err != nil { - return fmt.Errorf("[WARN] Error setting Autoscaling Group Names: %s", err) - } - - return nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_availability_zone.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_availability_zone.go deleted file mode 100644 index edab7c9..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_availability_zone.go +++ /dev/null @@ -1,89 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsAvailabilityZone() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsAvailabilityZoneRead, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "region": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "name_suffix": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "state": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func dataSourceAwsAvailabilityZoneRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - req := &ec2.DescribeAvailabilityZonesInput{} - - if name := d.Get("name"); name != "" { - req.ZoneNames = []*string{aws.String(name.(string))} - } - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "state": d.Get("state").(string), - }, - ) - if len(req.Filters) == 0 { - // Don't send an empty filters list; the EC2 API won't accept it. - req.Filters = nil - } - - log.Printf("[DEBUG] DescribeAvailabilityZones %s\n", req) - resp, err := conn.DescribeAvailabilityZones(req) - if err != nil { - return err - } - if resp == nil || len(resp.AvailabilityZones) == 0 { - return fmt.Errorf("no matching AZ found") - } - if len(resp.AvailabilityZones) > 1 { - return fmt.Errorf("multiple AZs matched; use additional constraints to reduce matches to a single AZ") - } - - az := resp.AvailabilityZones[0] - - // As a convenience when working with AZs generically, we expose - // the AZ suffix alone, without the region name. - // This can be used e.g. to create lookup tables by AZ letter that - // work regardless of region. - nameSuffix := (*az.ZoneName)[len(*az.RegionName):] - - d.SetId(*az.ZoneName) - d.Set("id", az.ZoneName) - d.Set("name", az.ZoneName) - d.Set("name_suffix", nameSuffix) - d.Set("region", az.RegionName) - d.Set("state", az.State) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_availability_zones.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_availability_zones.go deleted file mode 100644 index dcc0943..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_availability_zones.go +++ /dev/null @@ -1,87 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "sort" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsAvailabilityZones() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsAvailabilityZonesRead, - - Schema: map[string]*schema.Schema{ - "names": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "state": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateStateType, - }, - }, - } -} - -func dataSourceAwsAvailabilityZonesRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[DEBUG] Reading Availability Zones.") - d.SetId(time.Now().UTC().String()) - - request := &ec2.DescribeAvailabilityZonesInput{} - - if v, ok := d.GetOk("state"); ok { - request.Filters = []*ec2.Filter{ - { - Name: aws.String("state"), - Values: []*string{aws.String(v.(string))}, - }, - } - } - - log.Printf("[DEBUG] Availability Zones request options: %#v", *request) - - resp, err := conn.DescribeAvailabilityZones(request) - if err != nil { - return fmt.Errorf("Error fetching Availability Zones: %s", err) - } - - raw := make([]string, len(resp.AvailabilityZones)) - for i, v := range resp.AvailabilityZones { - raw[i] = *v.ZoneName - } - - sort.Strings(raw) - - if err := d.Set("names", raw); err != nil { - return fmt.Errorf("[WARN] Error setting Availability Zones: %s", err) - } - - return nil -} - -func validateStateType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - validState := map[string]bool{ - "available": true, - "information": true, - "impaired": true, - "unavailable": true, - } - - if !validState[value] { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Availability Zone state %q. Valid states are: %q, %q, %q and %q.", - k, value, "available", "information", "impaired", "unavailable")) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_billing_service_account.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_billing_service_account.go deleted file mode 100644 index 23ec408..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_billing_service_account.go +++ /dev/null @@ -1,31 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/hashicorp/terraform/helper/schema" -) - -// See http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-getting-started.html#step-2 -var billingAccountId = "386209384616" - -func dataSourceAwsBillingServiceAccount() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsBillingServiceAccountRead, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsBillingServiceAccountRead(d *schema.ResourceData, meta interface{}) error { - d.SetId(billingAccountId) - - d.Set("arn", fmt.Sprintf("arn:%s:iam::%s:root", meta.(*AWSClient).partition, billingAccountId)) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_caller_identity.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_caller_identity.go deleted file mode 100644 index 05c0386..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_caller_identity.go +++ /dev/null @@ -1,40 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsCallerIdentity() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsCallerIdentityRead, - - Schema: map[string]*schema.Schema{ - "account_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsCallerIdentityRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient) - - log.Printf("[DEBUG] Reading Caller Identity.") - d.SetId(time.Now().UTC().String()) - - if client.accountid == "" { - log.Println("[DEBUG] No Account ID available, failing") - return fmt.Errorf("No AWS Account ID is available to the provider. Please ensure that\n" + - "skip_requesting_account_id is not set on the AWS provider.") - } - - log.Printf("[DEBUG] Setting AWS Account ID to %s.", client.accountid) - d.Set("account_id", meta.(*AWSClient).accountid) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_canonical_user_id.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_canonical_user_id.go deleted file mode 100644 index ba6a0b0..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_canonical_user_id.go +++ /dev/null @@ -1,48 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsCanonicalUserId() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsCanonicalUserIdRead, - - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "display_name": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsCanonicalUserIdRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).s3conn - - log.Printf("[DEBUG] Listing S3 buckets.") - - req := &s3.ListBucketsInput{} - resp, err := conn.ListBuckets(req) - if err != nil { - return err - } - if resp == nil || resp.Owner == nil { - return fmt.Errorf("no canonical user ID found") - } - - d.SetId(aws.StringValue(resp.Owner.ID)) - d.Set("id", resp.Owner.ID) - d.Set("display_name", resp.Owner.DisplayName) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_cloudformation_stack.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_cloudformation_stack.go deleted file mode 100644 index 0966ddb..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_cloudformation_stack.go +++ /dev/null @@ -1,117 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsCloudFormationStack() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsCloudFormationStackRead, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "template_body": { - Type: schema.TypeString, - Computed: true, - StateFunc: func(v interface{}) string { - template, _ := normalizeCloudFormationTemplate(v) - return template - }, - }, - "capabilities": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - "disable_rollback": { - Type: schema.TypeBool, - Computed: true, - }, - "notification_arns": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "parameters": { - Type: schema.TypeMap, - Computed: true, - }, - "outputs": { - Type: schema.TypeMap, - Computed: true, - }, - "timeout_in_minutes": { - Type: schema.TypeInt, - Computed: true, - }, - "tags": { - Type: schema.TypeMap, - Computed: true, - }, - }, - } -} - -func dataSourceAwsCloudFormationStackRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cfconn - name := d.Get("name").(string) - input := cloudformation.DescribeStacksInput{ - StackName: aws.String(name), - } - - out, err := conn.DescribeStacks(&input) - if err != nil { - return fmt.Errorf("Failed describing CloudFormation stack (%s): %s", name, err) - } - if l := len(out.Stacks); l != 1 { - return fmt.Errorf("Expected 1 CloudFormation stack (%s), found %d", name, l) - } - stack := out.Stacks[0] - d.SetId(*stack.StackId) - - d.Set("description", stack.Description) - d.Set("disable_rollback", stack.DisableRollback) - d.Set("timeout_in_minutes", stack.TimeoutInMinutes) - - if len(stack.NotificationARNs) > 0 { - d.Set("notification_arns", schema.NewSet(schema.HashString, flattenStringList(stack.NotificationARNs))) - } - - d.Set("parameters", flattenAllCloudFormationParameters(stack.Parameters)) - d.Set("tags", flattenCloudFormationTags(stack.Tags)) - d.Set("outputs", flattenCloudFormationOutputs(stack.Outputs)) - - if len(stack.Capabilities) > 0 { - d.Set("capabilities", schema.NewSet(schema.HashString, flattenStringList(stack.Capabilities))) - } - - tInput := cloudformation.GetTemplateInput{ - StackName: aws.String(name), - } - tOut, err := conn.GetTemplate(&tInput) - if err != nil { - return err - } - - template, err := normalizeCloudFormationTemplate(*tOut.TemplateBody) - if err != nil { - return errwrap.Wrapf("template body contains an invalid JSON or YAML: {{err}}", err) - } - d.Set("template_body", template) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_common_schema.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_common_schema.go deleted file mode 100644 index 839f8a6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_common_schema.go +++ /dev/null @@ -1,91 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceTagsHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["key"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["value"].(string))) - return hashcode.String(buf.String()) -} - -func dataSourceTags(m []*ec2.Tag) *schema.Set { - s := &schema.Set{ - F: dataSourceTagsHash, - } - for _, v := range m { - tag := map[string]interface{}{ - "key": *v.Key, - "value": *v.Value, - } - s.Add(tag) - } - return s -} - -func buildAwsDataSourceFilters(set *schema.Set) []*ec2.Filter { - var filters []*ec2.Filter - for _, v := range set.List() { - m := v.(map[string]interface{}) - var filterValues []*string - for _, e := range m["values"].([]interface{}) { - filterValues = append(filterValues, aws.String(e.(string))) - } - filters = append(filters, &ec2.Filter{ - Name: aws.String(m["name"].(string)), - Values: filterValues, - }) - } - return filters -} - -func dataSourceFiltersSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - - "values": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - } -} - -func dataSourceTagsSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - Computed: true, - Set: dataSourceTagsHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Computed: true, - }, - "value": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_db_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_db_instance.go deleted file mode 100644 index 8adec41..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_db_instance.go +++ /dev/null @@ -1,284 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsDbInstance() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsDbInstanceRead, - - Schema: map[string]*schema.Schema{ - "db_instance_identifier": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "address": { - Type: schema.TypeString, - Computed: true, - }, - - "allocated_storage": { - Type: schema.TypeInt, - Computed: true, - }, - - "auto_minor_version_upgrade": { - Type: schema.TypeBool, - Computed: true, - }, - - "availability_zone": { - Type: schema.TypeString, - Computed: true, - }, - - "backup_retention_period": { - Type: schema.TypeInt, - Computed: true, - }, - - "db_cluster_identifier": { - Type: schema.TypeString, - Computed: true, - }, - - "db_instance_arn": { - Type: schema.TypeString, - Computed: true, - }, - - "db_instance_class": { - Type: schema.TypeString, - Computed: true, - }, - - "db_name": { - Type: schema.TypeString, - Computed: true, - }, - - "db_parameter_groups": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "db_security_groups": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "db_subnet_group": { - Type: schema.TypeString, - Computed: true, - }, - - "db_instance_port": { - Type: schema.TypeInt, - Computed: true, - }, - - "endpoint": { - Type: schema.TypeString, - Computed: true, - }, - - "engine": { - Type: schema.TypeString, - Computed: true, - }, - - "engine_version": { - Type: schema.TypeString, - Computed: true, - }, - - "hosted_zone_id": { - Type: schema.TypeString, - Computed: true, - }, - - "iops": { - Type: schema.TypeInt, - Computed: true, - }, - - "kms_key_id": { - Type: schema.TypeString, - Computed: true, - }, - - "license_model": { - Type: schema.TypeString, - Computed: true, - }, - - "master_username": { - Type: schema.TypeString, - Computed: true, - }, - - "monitoring_interval": { - Type: schema.TypeInt, - Computed: true, - }, - - "monitoring_role_arn": { - Type: schema.TypeString, - Computed: true, - }, - - "multi_az": { - Type: schema.TypeBool, - Computed: true, - }, - - "option_group_memberships": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "port": { - Type: schema.TypeInt, - Computed: true, - }, - - "preferred_backup_window": { - Type: schema.TypeString, - Computed: true, - }, - - "preferred_maintenance_window": { - Type: schema.TypeString, - Computed: true, - }, - - "publicly_accessible": { - Type: schema.TypeBool, - Computed: true, - }, - - "storage_encrypted": { - Type: schema.TypeBool, - Computed: true, - }, - - "storage_type": { - Type: schema.TypeString, - Computed: true, - }, - - "timezone": { - Type: schema.TypeString, - Computed: true, - }, - - "vpc_security_groups": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - } -} - -func dataSourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - - opts := rds.DescribeDBInstancesInput{ - DBInstanceIdentifier: aws.String(d.Get("db_instance_identifier").(string)), - } - - log.Printf("[DEBUG] DB Instance describe configuration: %#v", opts) - - resp, err := conn.DescribeDBInstances(&opts) - if err != nil { - return err - } - - if len(resp.DBInstances) < 1 { - return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.") - } - if len(resp.DBInstances) > 1 { - return fmt.Errorf("Your query returned more than one result. Please try a more specific search criteria.") - } - - dbInstance := *resp.DBInstances[0] - - d.SetId(d.Get("db_instance_identifier").(string)) - - d.Set("allocated_storage", dbInstance.AllocatedStorage) - d.Set("auto_minor_upgrade_enabled", dbInstance.AutoMinorVersionUpgrade) - d.Set("availability_zone", dbInstance.AvailabilityZone) - d.Set("backup_retention_period", dbInstance.BackupRetentionPeriod) - d.Set("db_cluster_identifier", dbInstance.DBClusterIdentifier) - d.Set("db_instance_arn", dbInstance.DBClusterIdentifier) - d.Set("db_instance_class", dbInstance.DBInstanceClass) - d.Set("db_name", dbInstance.DBName) - - var parameterGroups []string - for _, v := range dbInstance.DBParameterGroups { - parameterGroups = append(parameterGroups, *v.DBParameterGroupName) - } - if err := d.Set("db_parameter_groups", parameterGroups); err != nil { - return fmt.Errorf("[DEBUG] Error setting db_parameter_groups attribute: %#v, error: %#v", parameterGroups, err) - } - - var dbSecurityGroups []string - for _, v := range dbInstance.DBSecurityGroups { - dbSecurityGroups = append(dbSecurityGroups, *v.DBSecurityGroupName) - } - if err := d.Set("db_security_groups", dbSecurityGroups); err != nil { - return fmt.Errorf("[DEBUG] Error setting db_security_groups attribute: %#v, error: %#v", dbSecurityGroups, err) - } - - d.Set("db_subnet_group", dbInstance.DBSubnetGroup) - d.Set("db_instance_port", dbInstance.DbInstancePort) - d.Set("engine", dbInstance.Engine) - d.Set("engine_version", dbInstance.EngineVersion) - d.Set("iops", dbInstance.Iops) - d.Set("kms_key_id", dbInstance.KmsKeyId) - d.Set("license_model", dbInstance.LicenseModel) - d.Set("master_username", dbInstance.MasterUsername) - d.Set("monitoring_interval", dbInstance.MonitoringInterval) - d.Set("monitoring_role_arn", dbInstance.MonitoringRoleArn) - d.Set("address", dbInstance.Endpoint.Address) - d.Set("port", dbInstance.Endpoint.Port) - d.Set("hosted_zone_id", dbInstance.Endpoint.HostedZoneId) - d.Set("endpoint", fmt.Sprintf("%s:%d", *dbInstance.Endpoint.Address, *dbInstance.Endpoint.Port)) - - var optionGroups []string - for _, v := range dbInstance.OptionGroupMemberships { - optionGroups = append(optionGroups, *v.OptionGroupName) - } - if err := d.Set("option_group_memberships", optionGroups); err != nil { - return fmt.Errorf("[DEBUG] Error setting option_group_memberships attribute: %#v, error: %#v", optionGroups, err) - } - - d.Set("preferred_backup_window", dbInstance.PreferredBackupWindow) - d.Set("preferred_maintenance_window", dbInstance.PreferredMaintenanceWindow) - d.Set("publicly_accessible", dbInstance.PubliclyAccessible) - d.Set("storage_encrypted", dbInstance.StorageEncrypted) - d.Set("storage_type", dbInstance.StorageType) - d.Set("timezone", dbInstance.Timezone) - - var vpcSecurityGroups []string - for _, v := range dbInstance.VpcSecurityGroups { - vpcSecurityGroups = append(vpcSecurityGroups, *v.VpcSecurityGroupId) - } - if err := d.Set("vpc_security_groups", vpcSecurityGroups); err != nil { - return fmt.Errorf("[DEBUG] Error setting vpc_security_groups attribute: %#v, error: %#v", vpcSecurityGroups, err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ebs_snapshot.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ebs_snapshot.go deleted file mode 100644 index b16f61f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ebs_snapshot.go +++ /dev/null @@ -1,175 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "sort" - - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsEbsSnapshot() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsEbsSnapshotRead, - - Schema: map[string]*schema.Schema{ - //selection criteria - "filter": dataSourceFiltersSchema(), - "most_recent": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - "owners": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "snapshot_ids": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "restorable_by_user_ids": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - //Computed values returned - "snapshot_id": { - Type: schema.TypeString, - Computed: true, - }, - "volume_id": { - Type: schema.TypeString, - Computed: true, - }, - "state": { - Type: schema.TypeString, - Computed: true, - }, - "owner_id": { - Type: schema.TypeString, - Computed: true, - }, - "owner_alias": { - Type: schema.TypeString, - Computed: true, - }, - "encrypted": { - Type: schema.TypeBool, - Computed: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - "volume_size": { - Type: schema.TypeInt, - Computed: true, - }, - "kms_key_id": { - Type: schema.TypeString, - Computed: true, - }, - "data_encryption_key_id": { - Type: schema.TypeString, - Computed: true, - }, - "tags": dataSourceTagsSchema(), - }, - } -} - -func dataSourceAwsEbsSnapshotRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - restorableUsers, restorableUsersOk := d.GetOk("restorable_by_user_ids") - filters, filtersOk := d.GetOk("filter") - snapshotIds, snapshotIdsOk := d.GetOk("snapshot_ids") - owners, ownersOk := d.GetOk("owners") - - if restorableUsers == false && filtersOk == false && snapshotIds == false && ownersOk == false { - return fmt.Errorf("One of snapshot_ids, filters, restorable_by_user_ids, or owners must be assigned") - } - - params := &ec2.DescribeSnapshotsInput{} - if restorableUsersOk { - params.RestorableByUserIds = expandStringList(restorableUsers.([]interface{})) - } - if filtersOk { - params.Filters = buildAwsDataSourceFilters(filters.(*schema.Set)) - } - if ownersOk { - params.OwnerIds = expandStringList(owners.([]interface{})) - } - if snapshotIdsOk { - params.SnapshotIds = expandStringList(snapshotIds.([]interface{})) - } - - resp, err := conn.DescribeSnapshots(params) - if err != nil { - return err - } - - var snapshot *ec2.Snapshot - if len(resp.Snapshots) < 1 { - return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.") - } - - if len(resp.Snapshots) > 1 { - recent := d.Get("most_recent").(bool) - log.Printf("[DEBUG] aws_ebs_snapshot - multiple results found and `most_recent` is set to: %t", recent) - if recent { - snapshot = mostRecentSnapshot(resp.Snapshots) - } else { - return fmt.Errorf("Your query returned more than one result. Please try a more specific search criteria.") - } - } else { - snapshot = resp.Snapshots[0] - } - - //Single Snapshot found so set to state - return snapshotDescriptionAttributes(d, snapshot) -} - -type snapshotSort []*ec2.Snapshot - -func (a snapshotSort) Len() int { return len(a) } -func (a snapshotSort) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a snapshotSort) Less(i, j int) bool { - itime := *a[i].StartTime - jtime := *a[j].StartTime - return itime.Unix() < jtime.Unix() -} - -func mostRecentSnapshot(snapshots []*ec2.Snapshot) *ec2.Snapshot { - sortedSnapshots := snapshots - sort.Sort(snapshotSort(sortedSnapshots)) - return sortedSnapshots[len(sortedSnapshots)-1] -} - -func snapshotDescriptionAttributes(d *schema.ResourceData, snapshot *ec2.Snapshot) error { - d.SetId(*snapshot.SnapshotId) - d.Set("snapshot_id", snapshot.SnapshotId) - d.Set("volume_id", snapshot.VolumeId) - d.Set("data_encryption_key_id", snapshot.DataEncryptionKeyId) - d.Set("description", snapshot.Description) - d.Set("encrypted", snapshot.Encrypted) - d.Set("kms_key_id", snapshot.KmsKeyId) - d.Set("volume_size", snapshot.VolumeSize) - d.Set("state", snapshot.State) - d.Set("owner_id", snapshot.OwnerId) - d.Set("owner_alias", snapshot.OwnerAlias) - - if err := d.Set("tags", dataSourceTags(snapshot.Tags)); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ebs_volume.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ebs_volume.go deleted file mode 100644 index 7794ecf..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ebs_volume.go +++ /dev/null @@ -1,136 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "sort" - - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsEbsVolume() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsEbsVolumeRead, - - Schema: map[string]*schema.Schema{ - "filter": dataSourceFiltersSchema(), - "most_recent": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - "availability_zone": { - Type: schema.TypeString, - Computed: true, - }, - "encrypted": { - Type: schema.TypeBool, - Computed: true, - }, - "iops": { - Type: schema.TypeInt, - Computed: true, - }, - "volume_type": { - Type: schema.TypeString, - Computed: true, - }, - "size": { - Type: schema.TypeInt, - Computed: true, - }, - "snapshot_id": { - Type: schema.TypeString, - Computed: true, - }, - "kms_key_id": { - Type: schema.TypeString, - Computed: true, - }, - "volume_id": { - Type: schema.TypeString, - Computed: true, - }, - "tags": dataSourceTagsSchema(), - }, - } -} - -func dataSourceAwsEbsVolumeRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - filters, filtersOk := d.GetOk("filter") - - params := &ec2.DescribeVolumesInput{} - if filtersOk { - params.Filters = buildAwsDataSourceFilters(filters.(*schema.Set)) - } - - resp, err := conn.DescribeVolumes(params) - if err != nil { - return err - } - - log.Printf("Found These Volumes %s", spew.Sdump(resp.Volumes)) - - filteredVolumes := resp.Volumes[:] - - var volume *ec2.Volume - if len(filteredVolumes) < 1 { - return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.") - } - - if len(filteredVolumes) > 1 { - recent := d.Get("most_recent").(bool) - log.Printf("[DEBUG] aws_ebs_volume - multiple results found and `most_recent` is set to: %t", recent) - if recent { - volume = mostRecentVolume(filteredVolumes) - } else { - return fmt.Errorf("Your query returned more than one result. Please try a more " + - "specific search criteria, or set `most_recent` attribute to true.") - } - } else { - // Query returned single result. - volume = filteredVolumes[0] - } - - log.Printf("[DEBUG] aws_ebs_volume - Single Volume found: %s", *volume.VolumeId) - return volumeDescriptionAttributes(d, volume) -} - -type volumeSort []*ec2.Volume - -func (a volumeSort) Len() int { return len(a) } -func (a volumeSort) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a volumeSort) Less(i, j int) bool { - itime := *a[i].CreateTime - jtime := *a[j].CreateTime - return itime.Unix() < jtime.Unix() -} - -func mostRecentVolume(volumes []*ec2.Volume) *ec2.Volume { - sortedVolumes := volumes - sort.Sort(volumeSort(sortedVolumes)) - return sortedVolumes[len(sortedVolumes)-1] -} - -func volumeDescriptionAttributes(d *schema.ResourceData, volume *ec2.Volume) error { - d.SetId(*volume.VolumeId) - d.Set("volume_id", volume.VolumeId) - d.Set("availability_zone", volume.AvailabilityZone) - d.Set("encrypted", volume.Encrypted) - d.Set("iops", volume.Iops) - d.Set("kms_key_id", volume.KmsKeyId) - d.Set("size", volume.Size) - d.Set("snapshot_id", volume.SnapshotId) - d.Set("volume_type", volume.VolumeType) - - if err := d.Set("tags", dataSourceTags(volume.Tags)); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_cluster.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_cluster.go deleted file mode 100644 index 2d8afee..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_cluster.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ecs" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsEcsCluster() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsEcsClusterRead, - - Schema: map[string]*schema.Schema{ - "cluster_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "status": { - Type: schema.TypeString, - Computed: true, - }, - - "pending_tasks_count": { - Type: schema.TypeInt, - Computed: true, - }, - - "running_tasks_count": { - Type: schema.TypeInt, - Computed: true, - }, - - "registered_container_instances_count": { - Type: schema.TypeInt, - Computed: true, - }, - }, - } -} - -func dataSourceAwsEcsClusterRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - desc, err := conn.DescribeClusters(&ecs.DescribeClustersInput{ - Clusters: []*string{aws.String(d.Get("cluster_name").(string))}, - }) - - if err != nil { - return err - } - - for _, cluster := range desc.Clusters { - if aws.StringValue(cluster.ClusterName) != d.Get("cluster_name").(string) { - continue - } - d.SetId(aws.StringValue(cluster.ClusterArn)) - d.Set("status", cluster.Status) - d.Set("pending_tasks_count", cluster.PendingTasksCount) - d.Set("running_tasks_count", cluster.RunningTasksCount) - d.Set("registered_container_instances_count", cluster.RegisteredContainerInstancesCount) - } - - if d.Id() == "" { - return fmt.Errorf("cluster with name %q not found", d.Get("cluster_name").(string)) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_container_definition.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_container_definition.go deleted file mode 100644 index 412019a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_container_definition.go +++ /dev/null @@ -1,107 +0,0 @@ -package aws - -import ( - "fmt" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ecs" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsEcsContainerDefinition() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsEcsContainerDefinitionRead, - - Schema: map[string]*schema.Schema{ - "task_definition": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "container_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - // Computed values. - "image": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "image_digest": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "cpu": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - "memory": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - "memory_reservation": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - "disable_networking": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - }, - "docker_labels": &schema.Schema{ - Type: schema.TypeMap, - Computed: true, - Elem: schema.TypeString, - }, - "environment": &schema.Schema{ - Type: schema.TypeMap, - Computed: true, - Elem: schema.TypeString, - }, - }, - } -} - -func dataSourceAwsEcsContainerDefinitionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - desc, err := conn.DescribeTaskDefinition(&ecs.DescribeTaskDefinitionInput{ - TaskDefinition: aws.String(d.Get("task_definition").(string)), - }) - - if err != nil { - return err - } - - taskDefinition := *desc.TaskDefinition - for _, def := range taskDefinition.ContainerDefinitions { - if aws.StringValue(def.Name) != d.Get("container_name").(string) { - continue - } - - d.SetId(fmt.Sprintf("%s/%s", aws.StringValue(taskDefinition.TaskDefinitionArn), d.Get("container_name").(string))) - d.Set("image", aws.StringValue(def.Image)) - image := aws.StringValue(def.Image) - if strings.Contains(image, ":") { - d.Set("image_digest", strings.Split(image, ":")[1]) - } - d.Set("cpu", aws.Int64Value(def.Cpu)) - d.Set("memory", aws.Int64Value(def.Memory)) - d.Set("memory_reservation", aws.Int64Value(def.MemoryReservation)) - d.Set("disable_networking", aws.BoolValue(def.DisableNetworking)) - d.Set("docker_labels", aws.StringValueMap(def.DockerLabels)) - - var environment = map[string]string{} - for _, keyValuePair := range def.Environment { - environment[aws.StringValue(keyValuePair.Name)] = aws.StringValue(keyValuePair.Value) - } - d.Set("environment", environment) - } - - if d.Id() == "" { - return fmt.Errorf("container with name %q not found in task definition %q", d.Get("container_name").(string), d.Get("task_definition").(string)) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_task_definition.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_task_definition.go deleted file mode 100644 index 3a5096a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ecs_task_definition.go +++ /dev/null @@ -1,71 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ecs" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsEcsTaskDefinition() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsEcsTaskDefinitionRead, - - Schema: map[string]*schema.Schema{ - "task_definition": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - // Computed values. - "family": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "network_mode": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "revision": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - "status": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "task_role_arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsEcsTaskDefinitionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - desc, err := conn.DescribeTaskDefinition(&ecs.DescribeTaskDefinitionInput{ - TaskDefinition: aws.String(d.Get("task_definition").(string)), - }) - - if err != nil { - return fmt.Errorf("Failed getting task definition %s %q", err, d.Get("task_definition").(string)) - } - - taskDefinition := *desc.TaskDefinition - - d.SetId(aws.StringValue(taskDefinition.TaskDefinitionArn)) - d.Set("family", aws.StringValue(taskDefinition.Family)) - d.Set("network_mode", aws.StringValue(taskDefinition.NetworkMode)) - d.Set("revision", aws.Int64Value(taskDefinition.Revision)) - d.Set("status", aws.StringValue(taskDefinition.Status)) - d.Set("task_role_arn", aws.StringValue(taskDefinition.TaskRoleArn)) - - if d.Id() == "" { - return fmt.Errorf("task definition %q not found", d.Get("task_definition").(string)) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_eip.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_eip.go deleted file mode 100644 index 0352f48..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_eip.go +++ /dev/null @@ -1,64 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsEip() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsEipRead, - - Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "public_ip": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func dataSourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - req := &ec2.DescribeAddressesInput{} - - if id := d.Get("id"); id != "" { - req.AllocationIds = []*string{aws.String(id.(string))} - } - - if public_ip := d.Get("public_ip"); public_ip != "" { - req.PublicIps = []*string{aws.String(public_ip.(string))} - } - - log.Printf("[DEBUG] DescribeAddresses %s\n", req) - resp, err := conn.DescribeAddresses(req) - if err != nil { - return err - } - if resp == nil || len(resp.Addresses) == 0 { - return fmt.Errorf("no matching Elastic IP found") - } - if len(resp.Addresses) > 1 { - return fmt.Errorf("multiple Elastic IPs matched; use additional constraints to reduce matches to a single Elastic IP") - } - - eip := resp.Addresses[0] - - d.SetId(*eip.AllocationId) - d.Set("id", eip.AllocationId) - d.Set("public_ip", eip.PublicIp) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_elb_hosted_zone_id.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_elb_hosted_zone_id.go deleted file mode 100644 index 879746b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_elb_hosted_zone_id.go +++ /dev/null @@ -1,54 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/hashicorp/terraform/helper/schema" -) - -// See https://github.com/fog/fog-aws/pull/332/files -// This list isn't exposed by AWS - it's been found through -// trouble solving -var elbHostedZoneIdPerRegionMap = map[string]string{ - "ap-northeast-1": "Z14GRHDCWA56QT", - "ap-northeast-2": "ZWKZPGTI48KDX", - "ap-south-1": "ZP97RAFLXTNZK", - "ap-southeast-1": "Z1LMS91P8CMLE5", - "ap-southeast-2": "Z1GM3OXH4ZPM65", - "ca-central-1": "ZQSVJUPU6J1EY", - "eu-central-1": "Z215JYRZR1TBD5", - "eu-west-1": "Z32O12XQLNTSW2", - "eu-west-2": "ZHURV8PSTC4K8", - "us-east-1": "Z35SXDOTRQ7X7K", - "us-east-2": "Z3AADJGX6KTTL2", - "us-west-1": "Z368ELLRRE2KJ0", - "us-west-2": "Z1H1FL5HABSF5", - "sa-east-1": "Z2P70J7HTTTPLU", -} - -func dataSourceAwsElbHostedZoneId() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsElbHostedZoneIdRead, - - Schema: map[string]*schema.Schema{ - "region": { - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func dataSourceAwsElbHostedZoneIdRead(d *schema.ResourceData, meta interface{}) error { - region := meta.(*AWSClient).region - if v, ok := d.GetOk("region"); ok { - region = v.(string) - } - - if zoneId, ok := elbHostedZoneIdPerRegionMap[region]; ok { - d.SetId(zoneId) - return nil - } - - return fmt.Errorf("Unknown region (%q)", region) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_elb_service_account.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_elb_service_account.go deleted file mode 100644 index a3d6cdd..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_elb_service_account.go +++ /dev/null @@ -1,61 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/hashicorp/terraform/helper/schema" -) - -// See http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html#attach-bucket-policy -var elbAccountIdPerRegionMap = map[string]string{ - "ap-northeast-1": "582318560864", - "ap-northeast-2": "600734575887", - "ap-south-1": "718504428378", - "ap-southeast-1": "114774131450", - "ap-southeast-2": "783225319266", - "ca-central-1": "985666609251", - "cn-north-1": "638102146993", - "eu-central-1": "054676820928", - "eu-west-1": "156460612806", - "eu-west-2": "652711504416", - "sa-east-1": "507241528517", - "us-east-1": "127311923021", - "us-east-2": "033677994240", - "us-gov-west": "048591011584", - "us-west-1": "027434742980", - "us-west-2": "797873946194", -} - -func dataSourceAwsElbServiceAccount() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsElbServiceAccountRead, - - Schema: map[string]*schema.Schema{ - "region": { - Type: schema.TypeString, - Optional: true, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsElbServiceAccountRead(d *schema.ResourceData, meta interface{}) error { - region := meta.(*AWSClient).region - if v, ok := d.GetOk("region"); ok { - region = v.(string) - } - - if accid, ok := elbAccountIdPerRegionMap[region]; ok { - d.SetId(accid) - - d.Set("arn", fmt.Sprintf("arn:%s:iam::%s:root", meta.(*AWSClient).partition, accid)) - - return nil - } - - return fmt.Errorf("Unknown region (%q)", region) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_account_alias.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_account_alias.go deleted file mode 100644 index c8b8378..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_account_alias.go +++ /dev/null @@ -1,47 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsIamAccountAlias() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsIamAccountAliasRead, - - Schema: map[string]*schema.Schema{ - "account_alias": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsIamAccountAliasRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - log.Printf("[DEBUG] Reading IAM Account Aliases.") - d.SetId(time.Now().UTC().String()) - - req := &iam.ListAccountAliasesInput{} - resp, err := conn.ListAccountAliases(req) - if err != nil { - return err - } - // 'AccountAliases': [] if there is no alias. - if resp == nil || len(resp.AccountAliases) == 0 { - return fmt.Errorf("no IAM account alias found") - } - - alias := aws.StringValue(resp.AccountAliases[0]) - log.Printf("[DEBUG] Setting AWS IAM Account Alias to %s.", alias) - d.Set("account_alias", alias) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_policy_document.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_policy_document.go deleted file mode 100644 index 2366ae4..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_policy_document.go +++ /dev/null @@ -1,232 +0,0 @@ -package aws - -import ( - "fmt" - - "encoding/json" - "strings" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" - "strconv" -) - -var dataSourceAwsIamPolicyDocumentVarReplacer = strings.NewReplacer("&{", "${") - -func dataSourceAwsIamPolicyDocument() *schema.Resource { - setOfString := &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - } - - return &schema.Resource{ - Read: dataSourceAwsIamPolicyDocumentRead, - - Schema: map[string]*schema.Schema{ - "policy_id": { - Type: schema.TypeString, - Optional: true, - }, - "statement": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "sid": { - Type: schema.TypeString, - Optional: true, - }, - "effect": { - Type: schema.TypeString, - Optional: true, - Default: "Allow", - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - switch v.(string) { - case "Allow", "Deny": - return - default: - es = append(es, fmt.Errorf("%q must be either \"Allow\" or \"Deny\"", k)) - return - } - }, - }, - "actions": setOfString, - "not_actions": setOfString, - "resources": setOfString, - "not_resources": setOfString, - "principals": dataSourceAwsIamPolicyPrincipalSchema(), - "not_principals": dataSourceAwsIamPolicyPrincipalSchema(), - "condition": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "test": { - Type: schema.TypeString, - Required: true, - }, - "variable": { - Type: schema.TypeString, - Required: true, - }, - "values": { - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - }, - }, - }, - }, - "json": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsIamPolicyDocumentRead(d *schema.ResourceData, meta interface{}) error { - doc := &IAMPolicyDoc{ - Version: "2012-10-17", - } - - if policyId, hasPolicyId := d.GetOk("policy_id"); hasPolicyId { - doc.Id = policyId.(string) - } - - var cfgStmts = d.Get("statement").([]interface{}) - stmts := make([]*IAMPolicyStatement, len(cfgStmts)) - doc.Statements = stmts - for i, stmtI := range cfgStmts { - cfgStmt := stmtI.(map[string]interface{}) - stmt := &IAMPolicyStatement{ - Effect: cfgStmt["effect"].(string), - } - - if sid, ok := cfgStmt["sid"]; ok { - stmt.Sid = sid.(string) - } - - if actions := cfgStmt["actions"].(*schema.Set).List(); len(actions) > 0 { - stmt.Actions = iamPolicyDecodeConfigStringList(actions) - } - if actions := cfgStmt["not_actions"].(*schema.Set).List(); len(actions) > 0 { - stmt.NotActions = iamPolicyDecodeConfigStringList(actions) - } - - if resources := cfgStmt["resources"].(*schema.Set).List(); len(resources) > 0 { - stmt.Resources = dataSourceAwsIamPolicyDocumentReplaceVarsInList( - iamPolicyDecodeConfigStringList(resources), - ) - } - if resources := cfgStmt["not_resources"].(*schema.Set).List(); len(resources) > 0 { - stmt.NotResources = dataSourceAwsIamPolicyDocumentReplaceVarsInList( - iamPolicyDecodeConfigStringList(resources), - ) - } - - if principals := cfgStmt["principals"].(*schema.Set).List(); len(principals) > 0 { - stmt.Principals = dataSourceAwsIamPolicyDocumentMakePrincipals(principals) - } - - if principals := cfgStmt["not_principals"].(*schema.Set).List(); len(principals) > 0 { - stmt.NotPrincipals = dataSourceAwsIamPolicyDocumentMakePrincipals(principals) - } - - if conditions := cfgStmt["condition"].(*schema.Set).List(); len(conditions) > 0 { - stmt.Conditions = dataSourceAwsIamPolicyDocumentMakeConditions(conditions) - } - - stmts[i] = stmt - } - - jsonDoc, err := json.MarshalIndent(doc, "", " ") - if err != nil { - // should never happen if the above code is correct - return err - } - jsonString := string(jsonDoc) - - d.Set("json", jsonString) - d.SetId(strconv.Itoa(hashcode.String(jsonString))) - - return nil -} - -func dataSourceAwsIamPolicyDocumentReplaceVarsInList(in interface{}) interface{} { - switch v := in.(type) { - case string: - return dataSourceAwsIamPolicyDocumentVarReplacer.Replace(v) - case []string: - out := make([]string, len(v)) - for i, item := range v { - out[i] = dataSourceAwsIamPolicyDocumentVarReplacer.Replace(item) - } - return out - default: - panic("dataSourceAwsIamPolicyDocumentReplaceVarsInList: input not string nor []string") - } -} - -func dataSourceAwsIamPolicyDocumentMakeConditions(in []interface{}) IAMPolicyStatementConditionSet { - out := make([]IAMPolicyStatementCondition, len(in)) - for i, itemI := range in { - item := itemI.(map[string]interface{}) - out[i] = IAMPolicyStatementCondition{ - Test: item["test"].(string), - Variable: item["variable"].(string), - Values: dataSourceAwsIamPolicyDocumentReplaceVarsInList( - iamPolicyDecodeConfigStringList( - item["values"].(*schema.Set).List(), - ), - ), - } - } - return IAMPolicyStatementConditionSet(out) -} - -func dataSourceAwsIamPolicyDocumentMakePrincipals(in []interface{}) IAMPolicyStatementPrincipalSet { - out := make([]IAMPolicyStatementPrincipal, len(in)) - for i, itemI := range in { - item := itemI.(map[string]interface{}) - out[i] = IAMPolicyStatementPrincipal{ - Type: item["type"].(string), - Identifiers: dataSourceAwsIamPolicyDocumentReplaceVarsInList( - iamPolicyDecodeConfigStringList( - item["identifiers"].(*schema.Set).List(), - ), - ), - } - } - return IAMPolicyStatementPrincipalSet(out) -} - -func dataSourceAwsIamPolicyPrincipalSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "identifiers": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_server_certificate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_server_certificate.go deleted file mode 100644 index c4bf8bd..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_iam_server_certificate.go +++ /dev/null @@ -1,140 +0,0 @@ -package aws - -import ( - "fmt" - "sort" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsIAMServerCertificate() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsIAMServerCertificateRead, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 128 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 128 characters", k)) - } - return - }, - }, - - "name_prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 30 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 30 characters, name is limited to 128", k)) - } - return - }, - }, - - "latest": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Default: false, - }, - - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "id": { - Type: schema.TypeString, - Computed: true, - }, - - "path": { - Type: schema.TypeString, - Computed: true, - }, - - "expiration_date": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -type certificateByExpiration []*iam.ServerCertificateMetadata - -func (m certificateByExpiration) Len() int { - return len(m) -} - -func (m certificateByExpiration) Swap(i, j int) { - m[i], m[j] = m[j], m[i] -} - -func (m certificateByExpiration) Less(i, j int) bool { - return m[i].Expiration.After(*m[j].Expiration) -} - -func dataSourceAwsIAMServerCertificateRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - var matcher = func(cert *iam.ServerCertificateMetadata) bool { - return strings.HasPrefix(aws.StringValue(cert.ServerCertificateName), d.Get("name_prefix").(string)) - } - if v, ok := d.GetOk("name"); ok { - matcher = func(cert *iam.ServerCertificateMetadata) bool { - return aws.StringValue(cert.ServerCertificateName) == v.(string) - } - } - - var metadatas = []*iam.ServerCertificateMetadata{} - err := iamconn.ListServerCertificatesPages(&iam.ListServerCertificatesInput{}, func(p *iam.ListServerCertificatesOutput, lastPage bool) bool { - for _, cert := range p.ServerCertificateMetadataList { - if matcher(cert) { - metadatas = append(metadatas, cert) - } - } - return true - }) - if err != nil { - return errwrap.Wrapf("Error describing certificates: {{err}}", err) - } - - if len(metadatas) == 0 { - return fmt.Errorf("Search for AWS IAM server certificate returned no results") - } - if len(metadatas) > 1 { - if !d.Get("latest").(bool) { - return fmt.Errorf("Search for AWS IAM server certificate returned too many results") - } - - sort.Sort(certificateByExpiration(metadatas)) - } - - metadata := metadatas[0] - d.SetId(*metadata.ServerCertificateId) - d.Set("arn", *metadata.Arn) - d.Set("path", *metadata.Path) - d.Set("id", *metadata.ServerCertificateId) - d.Set("name", *metadata.ServerCertificateName) - if metadata.Expiration != nil { - d.Set("expiration_date", metadata.Expiration.Format("2006-01-02T15:04:05")) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_instance.go deleted file mode 100644 index 617a5c2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_instance.go +++ /dev/null @@ -1,356 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsInstance() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsInstanceRead, - - Schema: map[string]*schema.Schema{ - "filter": dataSourceFiltersSchema(), - "tags": dataSourceTagsSchema(), - "instance_tags": tagsSchemaComputed(), - "instance_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "ami": { - Type: schema.TypeString, - Computed: true, - }, - "instance_type": { - Type: schema.TypeString, - Computed: true, - }, - "instance_state": { - Type: schema.TypeString, - Computed: true, - }, - "availability_zone": { - Type: schema.TypeString, - Computed: true, - }, - "tenancy": { - Type: schema.TypeString, - Computed: true, - }, - "key_name": { - Type: schema.TypeString, - Computed: true, - }, - "public_dns": { - Type: schema.TypeString, - Computed: true, - }, - "public_ip": { - Type: schema.TypeString, - Computed: true, - }, - "private_dns": { - Type: schema.TypeString, - Computed: true, - }, - "private_ip": { - Type: schema.TypeString, - Computed: true, - }, - "iam_instance_profile": { - Type: schema.TypeString, - Computed: true, - }, - "subnet_id": { - Type: schema.TypeString, - Computed: true, - }, - "network_interface_id": { - Type: schema.TypeString, - Computed: true, - }, - "associate_public_ip_address": { - Type: schema.TypeBool, - Computed: true, - }, - "ebs_optimized": { - Type: schema.TypeBool, - Computed: true, - }, - "source_dest_check": { - Type: schema.TypeBool, - Computed: true, - }, - "monitoring": { - Type: schema.TypeBool, - Computed: true, - }, - "user_data": { - Type: schema.TypeString, - Computed: true, - }, - "security_groups": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "vpc_security_group_ids": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "ephemeral_block_device": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "device_name": { - Type: schema.TypeString, - Required: true, - }, - - "virtual_name": { - Type: schema.TypeString, - Optional: true, - }, - - "no_device": { - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - }, - "ebs_block_device": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Computed: true, - }, - - "device_name": { - Type: schema.TypeString, - Computed: true, - }, - - "encrypted": { - Type: schema.TypeBool, - Computed: true, - }, - - "iops": { - Type: schema.TypeInt, - Computed: true, - }, - - "snapshot_id": { - Type: schema.TypeString, - Computed: true, - }, - - "volume_size": { - Type: schema.TypeInt, - Computed: true, - }, - - "volume_type": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - "root_block_device": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Computed: true, - }, - - "iops": { - Type: schema.TypeInt, - Computed: true, - }, - - "volume_size": { - Type: schema.TypeInt, - Computed: true, - }, - - "volume_type": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - }, - } -} - -// dataSourceAwsInstanceRead performs the instanceID lookup -func dataSourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - filters, filtersOk := d.GetOk("filter") - instanceID, instanceIDOk := d.GetOk("instance_id") - tags, tagsOk := d.GetOk("instance_tags") - - if filtersOk == false && instanceIDOk == false && tagsOk == false { - return fmt.Errorf("One of filters, instance_tags, or instance_id must be assigned") - } - - // Build up search parameters - params := &ec2.DescribeInstancesInput{} - if filtersOk { - params.Filters = buildAwsDataSourceFilters(filters.(*schema.Set)) - } - if instanceIDOk { - params.InstanceIds = []*string{aws.String(instanceID.(string))} - } - if tagsOk { - params.Filters = append(params.Filters, buildEC2TagFilterList( - tagsFromMap(tags.(map[string]interface{})), - )...) - } - - // Perform the lookup - resp, err := conn.DescribeInstances(params) - if err != nil { - return err - } - - // If no instances were returned, return - if len(resp.Reservations) == 0 { - return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.") - } - - var filteredInstances []*ec2.Instance - - // loop through reservations, and remove terminated instances, populate instance slice - for _, res := range resp.Reservations { - for _, instance := range res.Instances { - if instance.State != nil && *instance.State.Name != "terminated" { - filteredInstances = append(filteredInstances, instance) - } - } - } - - var instance *ec2.Instance - if len(filteredInstances) < 1 { - return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.") - } - - // (TODO: Support a list of instances to be returned) - // Possibly with a different data source that returns a list of individual instance data sources - if len(filteredInstances) > 1 { - return fmt.Errorf("Your query returned more than one result. Please try a more " + - "specific search criteria.") - } else { - instance = filteredInstances[0] - } - - log.Printf("[DEBUG] aws_instance - Single Instance ID found: %s", *instance.InstanceId) - return instanceDescriptionAttributes(d, instance, conn) -} - -// Populate instance attribute fields with the returned instance -func instanceDescriptionAttributes(d *schema.ResourceData, instance *ec2.Instance, conn *ec2.EC2) error { - d.SetId(*instance.InstanceId) - // Set the easy attributes - d.Set("instance_state", instance.State.Name) - if instance.Placement != nil { - d.Set("availability_zone", instance.Placement.AvailabilityZone) - } - if instance.Placement.Tenancy != nil { - d.Set("tenancy", instance.Placement.Tenancy) - } - d.Set("ami", instance.ImageId) - d.Set("instance_type", instance.InstanceType) - d.Set("key_name", instance.KeyName) - d.Set("public_dns", instance.PublicDnsName) - d.Set("public_ip", instance.PublicIpAddress) - d.Set("private_dns", instance.PrivateDnsName) - d.Set("private_ip", instance.PrivateIpAddress) - d.Set("iam_instance_profile", iamInstanceProfileArnToName(instance.IamInstanceProfile)) - - // iterate through network interfaces, and set subnet, network_interface, public_addr - if len(instance.NetworkInterfaces) > 0 { - for _, ni := range instance.NetworkInterfaces { - if *ni.Attachment.DeviceIndex == 0 { - d.Set("subnet_id", ni.SubnetId) - d.Set("network_interface_id", ni.NetworkInterfaceId) - d.Set("associate_public_ip_address", ni.Association != nil) - } - } - } else { - d.Set("subnet_id", instance.SubnetId) - d.Set("network_interface_id", "") - } - - d.Set("ebs_optimized", instance.EbsOptimized) - if instance.SubnetId != nil && *instance.SubnetId != "" { - d.Set("source_dest_check", instance.SourceDestCheck) - } - - if instance.Monitoring != nil && instance.Monitoring.State != nil { - monitoringState := *instance.Monitoring.State - d.Set("monitoring", monitoringState == "enabled" || monitoringState == "pending") - } - - d.Set("tags", dataSourceTags(instance.Tags)) - - // Security Groups - if err := readSecurityGroups(d, instance); err != nil { - return err - } - - // Block devices - if err := readBlockDevices(d, instance, conn); err != nil { - return err - } - if _, ok := d.GetOk("ephemeral_block_device"); !ok { - d.Set("ephemeral_block_device", []interface{}{}) - } - - // Lookup and Set Instance Attributes - { - attr, err := conn.DescribeInstanceAttribute(&ec2.DescribeInstanceAttributeInput{ - Attribute: aws.String("disableApiTermination"), - InstanceId: aws.String(d.Id()), - }) - if err != nil { - return err - } - d.Set("disable_api_termination", attr.DisableApiTermination.Value) - } - { - attr, err := conn.DescribeInstanceAttribute(&ec2.DescribeInstanceAttributeInput{ - Attribute: aws.String(ec2.InstanceAttributeNameUserData), - InstanceId: aws.String(d.Id()), - }) - if err != nil { - return err - } - if attr.UserData.Value != nil { - d.Set("user_data", userDataHashSum(*attr.UserData.Value)) - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ip_ranges.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ip_ranges.go deleted file mode 100644 index 32e9d89..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_ip_ranges.go +++ /dev/null @@ -1,151 +0,0 @@ -package aws - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "log" - "sort" - "strconv" - "strings" - - "github.com/hashicorp/go-cleanhttp" - "github.com/hashicorp/terraform/helper/schema" -) - -type dataSourceAwsIPRangesResult struct { - CreateDate string - Prefixes []dataSourceAwsIPRangesPrefix - SyncToken string -} - -type dataSourceAwsIPRangesPrefix struct { - IpPrefix string `json:"ip_prefix"` - Region string - Service string -} - -func dataSourceAwsIPRanges() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsIPRangesRead, - - Schema: map[string]*schema.Schema{ - "cidr_blocks": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "create_date": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "regions": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - }, - "services": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "sync_token": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - }, - } -} - -func dataSourceAwsIPRangesRead(d *schema.ResourceData, meta interface{}) error { - - conn := cleanhttp.DefaultClient() - - log.Printf("[DEBUG] Reading IP ranges") - - res, err := conn.Get("https://ip-ranges.amazonaws.com/ip-ranges.json") - - if err != nil { - return fmt.Errorf("Error listing IP ranges: %s", err) - } - - defer res.Body.Close() - - data, err := ioutil.ReadAll(res.Body) - - if err != nil { - return fmt.Errorf("Error reading response body: %s", err) - } - - result := new(dataSourceAwsIPRangesResult) - - if err := json.Unmarshal(data, result); err != nil { - return fmt.Errorf("Error parsing result: %s", err) - } - - if err := d.Set("create_date", result.CreateDate); err != nil { - return fmt.Errorf("Error setting create date: %s", err) - } - - syncToken, err := strconv.Atoi(result.SyncToken) - - if err != nil { - return fmt.Errorf("Error while converting sync token: %s", err) - } - - d.SetId(result.SyncToken) - - if err := d.Set("sync_token", syncToken); err != nil { - return fmt.Errorf("Error setting sync token: %s", err) - } - - get := func(key string) *schema.Set { - - set := d.Get(key).(*schema.Set) - - for _, e := range set.List() { - - s := e.(string) - - set.Remove(s) - set.Add(strings.ToLower(s)) - - } - - return set - - } - - var ( - regions = get("regions") - services = get("services") - noRegionFilter = regions.Len() == 0 - prefixes []string - ) - - for _, e := range result.Prefixes { - - var ( - matchRegion = noRegionFilter || regions.Contains(strings.ToLower(e.Region)) - matchService = services.Contains(strings.ToLower(e.Service)) - ) - - if matchRegion && matchService { - prefixes = append(prefixes, e.IpPrefix) - } - - } - - if len(prefixes) == 0 { - return fmt.Errorf(" No IP ranges result from filters") - } - - sort.Strings(prefixes) - - if err := d.Set("cidr_blocks", prefixes); err != nil { - return fmt.Errorf("Error setting ip ranges: %s", err) - } - - return nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_kms_secret.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_kms_secret.go deleted file mode 100644 index 92d5134..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_kms_secret.go +++ /dev/null @@ -1,99 +0,0 @@ -package aws - -import ( - "encoding/base64" - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kms" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsKmsSecret() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsKmsSecretRead, - - Schema: map[string]*schema.Schema{ - "secret": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "payload": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "context": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "grant_tokens": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - "__has_dynamic_attributes": { - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -// dataSourceAwsKmsSecretRead decrypts the specified secrets -func dataSourceAwsKmsSecretRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kmsconn - secrets := d.Get("secret").(*schema.Set) - - d.SetId(time.Now().UTC().String()) - - for _, v := range secrets.List() { - secret := v.(map[string]interface{}) - - // base64 decode the payload - payload, err := base64.StdEncoding.DecodeString(secret["payload"].(string)) - if err != nil { - return fmt.Errorf("Invalid base64 value for secret '%s': %v", secret["name"].(string), err) - } - - // build the kms decrypt params - params := &kms.DecryptInput{ - CiphertextBlob: []byte(payload), - } - if context, exists := secret["context"]; exists { - params.EncryptionContext = make(map[string]*string) - for k, v := range context.(map[string]interface{}) { - params.EncryptionContext[k] = aws.String(v.(string)) - } - } - if grant_tokens, exists := secret["grant_tokens"]; exists { - params.GrantTokens = make([]*string, 0) - for _, v := range grant_tokens.([]interface{}) { - params.GrantTokens = append(params.GrantTokens, aws.String(v.(string))) - } - } - - // decrypt - resp, err := conn.Decrypt(params) - if err != nil { - return fmt.Errorf("Failed to decrypt '%s': %s", secret["name"].(string), err) - } - - // Set the secret via the name - log.Printf("[DEBUG] aws_kms_secret - successfully decrypted secret: %s", secret["name"].(string)) - d.UnsafeSetFieldRaw(secret["name"].(string), string(resp.Plaintext)) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_partition.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_partition.go deleted file mode 100644 index d52f7ee..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_partition.go +++ /dev/null @@ -1,33 +0,0 @@ -package aws - -import ( - "log" - "time" - - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsPartition() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsPartitionRead, - - Schema: map[string]*schema.Schema{ - "partition": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsPartitionRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient) - - log.Printf("[DEBUG] Reading Partition.") - d.SetId(time.Now().UTC().String()) - - log.Printf("[DEBUG] Setting AWS Partition to %s.", client.partition) - d.Set("partition", meta.(*AWSClient).partition) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_prefix_list.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_prefix_list.go deleted file mode 100644 index 8bed855..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_prefix_list.go +++ /dev/null @@ -1,76 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsPrefixList() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsPrefixListRead, - - Schema: map[string]*schema.Schema{ - "prefix_list_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - // Computed values. - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "cidr_blocks": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - } -} - -func dataSourceAwsPrefixListRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - req := &ec2.DescribePrefixListsInput{} - - if prefixListID := d.Get("prefix_list_id"); prefixListID != "" { - req.PrefixListIds = aws.StringSlice([]string{prefixListID.(string)}) - } - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "prefix-list-name": d.Get("name").(string), - }, - ) - - log.Printf("[DEBUG] DescribePrefixLists %s\n", req) - resp, err := conn.DescribePrefixLists(req) - if err != nil { - return err - } - if resp == nil || len(resp.PrefixLists) == 0 { - return fmt.Errorf("no matching prefix list found; the prefix list ID or name may be invalid or not exist in the current region") - } - - pl := resp.PrefixLists[0] - - d.SetId(*pl.PrefixListId) - d.Set("id", pl.PrefixListId) - d.Set("name", pl.PrefixListName) - - cidrs := make([]string, len(pl.Cidrs)) - for i, v := range pl.Cidrs { - cidrs[i] = *v - } - d.Set("cidr_blocks", cidrs) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_redshift_service_account.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_redshift_service_account.go deleted file mode 100644 index faa210f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_redshift_service_account.go +++ /dev/null @@ -1,50 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/hashicorp/terraform/helper/schema" -) - -// See http://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-enable-logging -var redshiftServiceAccountPerRegionMap = map[string]string{ - "us-east-1": "193672423079", - "us-east-2": "391106570357", - "us-west-1": "262260360010", - "us-west-2": "902366379725", - "ap-south-1": "865932855811", - "ap-northeast-2": "760740231472", - "ap-southeast-1": "361669875840", - "ap-southeast-2": "762762565011", - "ap-northeast-1": "404641285394", - "ca-central-1": "907379612154", - "eu-central-1": "053454850223", - "eu-west-1": "210876761215", -} - -func dataSourceAwsRedshiftServiceAccount() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsRedshiftServiceAccountRead, - - Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func dataSourceAwsRedshiftServiceAccountRead(d *schema.ResourceData, meta interface{}) error { - region := meta.(*AWSClient).region - if v, ok := d.GetOk("region"); ok { - region = v.(string) - } - - if accid, ok := redshiftServiceAccountPerRegionMap[region]; ok { - d.SetId(accid) - return nil - } - - return fmt.Errorf("Unknown region (%q)", region) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_region.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_region.go deleted file mode 100644 index ed75f70..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_region.go +++ /dev/null @@ -1,84 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsRegion() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsRegionRead, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "current": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "endpoint": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func dataSourceAwsRegionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - currentRegion := meta.(*AWSClient).region - - req := &ec2.DescribeRegionsInput{} - - req.RegionNames = make([]*string, 0, 2) - if name := d.Get("name").(string); name != "" { - req.RegionNames = append(req.RegionNames, aws.String(name)) - } - - if d.Get("current").(bool) { - req.RegionNames = append(req.RegionNames, aws.String(currentRegion)) - } - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "endpoint": d.Get("endpoint").(string), - }, - ) - if len(req.Filters) == 0 { - // Don't send an empty filters list; the EC2 API won't accept it. - req.Filters = nil - } - - log.Printf("[DEBUG] DescribeRegions %s\n", req) - resp, err := conn.DescribeRegions(req) - if err != nil { - return err - } - if resp == nil || len(resp.Regions) == 0 { - return fmt.Errorf("no matching regions found") - } - if len(resp.Regions) > 1 { - return fmt.Errorf("multiple regions matched; use additional constraints to reduce matches to a single region") - } - - region := resp.Regions[0] - - d.SetId(*region.RegionName) - d.Set("id", region.RegionName) - d.Set("name", region.RegionName) - d.Set("endpoint", region.Endpoint) - d.Set("current", *region.RegionName == currentRegion) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_route53_zone.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_route53_zone.go deleted file mode 100644 index a4df2c7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_route53_zone.go +++ /dev/null @@ -1,176 +0,0 @@ -package aws - -import ( - "fmt" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsRoute53Zone() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsRoute53ZoneRead, - - Schema: map[string]*schema.Schema{ - "zone_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "private_zone": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "comment": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "caller_reference": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "vpc_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "tags": tagsSchemaComputed(), - "resource_record_set_count": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - }, - } -} - -func dataSourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).r53conn - name, nameExists := d.GetOk("name") - name = hostedZoneName(name.(string)) - id, idExists := d.GetOk("zone_id") - vpcId, vpcIdExists := d.GetOk("vpc_id") - tags := tagsFromMap(d.Get("tags").(map[string]interface{})) - if nameExists && idExists { - return fmt.Errorf("zone_id and name arguments can't be used together") - } else if !nameExists && !idExists { - return fmt.Errorf("Either name or zone_id must be set") - } - - var nextMarker *string - - var hostedZoneFound *route53.HostedZone - // We loop through all hostedzone - for allHostedZoneListed := false; !allHostedZoneListed; { - req := &route53.ListHostedZonesInput{} - if nextMarker != nil { - req.Marker = nextMarker - } - resp, err := conn.ListHostedZones(req) - - if err != nil { - return fmt.Errorf("Error finding Route 53 Hosted Zone: %v", err) - } - for _, hostedZone := range resp.HostedZones { - hostedZoneId := cleanZoneID(*hostedZone.Id) - if idExists && hostedZoneId == id.(string) { - hostedZoneFound = hostedZone - break - // we check if the name is the same as requested and if private zone field is the same as requested or if there is a vpc_id - } else if *hostedZone.Name == name && (*hostedZone.Config.PrivateZone == d.Get("private_zone").(bool) || (*hostedZone.Config.PrivateZone == true && vpcIdExists)) { - matchingVPC := false - if vpcIdExists { - reqHostedZone := &route53.GetHostedZoneInput{} - reqHostedZone.Id = aws.String(hostedZoneId) - - respHostedZone, errHostedZone := conn.GetHostedZone(reqHostedZone) - if errHostedZone != nil { - return fmt.Errorf("Error finding Route 53 Hosted Zone: %v", errHostedZone) - } - // we go through all VPCs - for _, vpc := range respHostedZone.VPCs { - if *vpc.VPCId == vpcId.(string) { - matchingVPC = true - break - } - } - } else { - matchingVPC = true - } - // we check if tags match - matchingTags := true - if len(tags) > 0 { - reqListTags := &route53.ListTagsForResourceInput{} - reqListTags.ResourceId = aws.String(hostedZoneId) - reqListTags.ResourceType = aws.String("hostedzone") - respListTags, errListTags := conn.ListTagsForResource(reqListTags) - - if errListTags != nil { - return fmt.Errorf("Error finding Route 53 Hosted Zone: %v", errListTags) - } - for _, tag := range tags { - found := false - for _, tagRequested := range respListTags.ResourceTagSet.Tags { - if *tag.Key == *tagRequested.Key && *tag.Value == *tagRequested.Value { - found = true - } - } - - if !found { - matchingTags = false - break - } - } - - } - - if matchingTags && matchingVPC { - if hostedZoneFound != nil { - return fmt.Errorf("multplie Route53Zone found please use vpc_id option to filter") - } else { - hostedZoneFound = hostedZone - } - } - } - - } - if *resp.IsTruncated { - - nextMarker = resp.NextMarker - } else { - allHostedZoneListed = true - } - } - if hostedZoneFound == nil { - return fmt.Errorf("no matching Route53Zone found") - } - - idHostedZone := cleanZoneID(*hostedZoneFound.Id) - d.SetId(idHostedZone) - d.Set("zone_id", idHostedZone) - d.Set("name", hostedZoneFound.Name) - d.Set("comment", hostedZoneFound.Config.Comment) - d.Set("private_zone", hostedZoneFound.Config.PrivateZone) - d.Set("caller_reference", hostedZoneFound.CallerReference) - d.Set("resource_record_set_count", hostedZoneFound.ResourceRecordSetCount) - return nil -} - -// used to manage trailing . -func hostedZoneName(name string) string { - if strings.HasSuffix(name, ".") { - return name - } else { - return name + "." - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_route_table.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_route_table.go deleted file mode 100644 index c332bdd..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_route_table.go +++ /dev/null @@ -1,233 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsRouteTable() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsRouteTableRead, - - Schema: map[string]*schema.Schema{ - "subnet_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "route_table_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "vpc_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "filter": ec2CustomFiltersSchema(), - "tags": tagsSchemaComputed(), - "routes": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cidr_block": { - Type: schema.TypeString, - Computed: true, - }, - - "ipv6_cidr_block": { - Type: schema.TypeString, - Computed: true, - }, - - "egress_only_gateway_id": { - Type: schema.TypeString, - Computed: true, - }, - - "gateway_id": { - Type: schema.TypeString, - Computed: true, - }, - - "instance_id": { - Type: schema.TypeString, - Computed: true, - }, - - "nat_gateway_id": { - Type: schema.TypeString, - Computed: true, - }, - - "vpc_peering_connection_id": { - Type: schema.TypeString, - Computed: true, - }, - - "network_interface_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - "associations": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "route_table_association_id": { - Type: schema.TypeString, - Computed: true, - }, - - "route_table_id": { - Type: schema.TypeString, - Computed: true, - }, - - "subnet_id": { - Type: schema.TypeString, - Computed: true, - }, - - "main": { - Type: schema.TypeBool, - Computed: true, - }, - }, - }, - }, - }, - } -} - -func dataSourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - req := &ec2.DescribeRouteTablesInput{} - vpcId, vpcIdOk := d.GetOk("vpc_id") - subnetId, subnetIdOk := d.GetOk("subnet_id") - rtbId, rtbOk := d.GetOk("route_table_id") - tags, tagsOk := d.GetOk("tags") - filter, filterOk := d.GetOk("filter") - - if !vpcIdOk && !subnetIdOk && !tagsOk && !filterOk && !rtbOk { - return fmt.Errorf("One of route_table_id, vpc_id, subnet_id, filters, or tags must be assigned") - } - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "route-table-id": rtbId.(string), - "vpc-id": vpcId.(string), - "association.subnet-id": subnetId.(string), - }, - ) - req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(tags.(map[string]interface{})), - )...) - req.Filters = append(req.Filters, buildEC2CustomFilterList( - filter.(*schema.Set), - )...) - - log.Printf("[DEBUG] Describe Route Tables %v\n", req) - resp, err := conn.DescribeRouteTables(req) - if err != nil { - return err - } - if resp == nil || len(resp.RouteTables) == 0 { - return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.") - } - if len(resp.RouteTables) > 1 { - return fmt.Errorf("Multiple Route Table matched; use additional constraints to reduce matches to a single Route Table") - } - - rt := resp.RouteTables[0] - - d.SetId(aws.StringValue(rt.RouteTableId)) - d.Set("route_table_id", rt.RouteTableId) - d.Set("vpc_id", rt.VpcId) - d.Set("tags", tagsToMap(rt.Tags)) - if err := d.Set("routes", dataSourceRoutesRead(rt.Routes)); err != nil { - return err - } - - if err := d.Set("associations", dataSourceAssociationsRead(rt.Associations)); err != nil { - return err - } - - return nil -} - -func dataSourceRoutesRead(ec2Routes []*ec2.Route) []map[string]interface{} { - routes := make([]map[string]interface{}, 0, len(ec2Routes)) - // Loop through the routes and add them to the set - for _, r := range ec2Routes { - if r.GatewayId != nil && *r.GatewayId == "local" { - continue - } - - if r.Origin != nil && *r.Origin == "EnableVgwRoutePropagation" { - continue - } - - if r.DestinationPrefixListId != nil { - // Skipping because VPC endpoint routes are handled separately - // See aws_vpc_endpoint - continue - } - - m := make(map[string]interface{}) - - if r.DestinationCidrBlock != nil { - m["cidr_block"] = *r.DestinationCidrBlock - } - if r.DestinationIpv6CidrBlock != nil { - m["ipv6_cidr_block"] = *r.DestinationIpv6CidrBlock - } - if r.EgressOnlyInternetGatewayId != nil { - m["egress_only_gateway_id"] = *r.EgressOnlyInternetGatewayId - } - if r.GatewayId != nil { - m["gateway_id"] = *r.GatewayId - } - if r.NatGatewayId != nil { - m["nat_gateway_id"] = *r.NatGatewayId - } - if r.InstanceId != nil { - m["instance_id"] = *r.InstanceId - } - if r.VpcPeeringConnectionId != nil { - m["vpc_peering_connection_id"] = *r.VpcPeeringConnectionId - } - if r.NetworkInterfaceId != nil { - m["network_interface_id"] = *r.NetworkInterfaceId - } - - routes = append(routes, m) - } - return routes -} - -func dataSourceAssociationsRead(ec2Assocations []*ec2.RouteTableAssociation) []map[string]interface{} { - associations := make([]map[string]interface{}, 0, len(ec2Assocations)) - // Loop through the routes and add them to the set - for _, a := range ec2Assocations { - - m := make(map[string]interface{}) - m["route_table_id"] = *a.RouteTableId - m["route_table_association_id"] = *a.RouteTableAssociationId - // GH[11134] - if a.SubnetId != nil { - m["subnet_id"] = *a.SubnetId - } - m["main"] = *a.Main - associations = append(associations, m) - } - return associations -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_s3_bucket_object.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_s3_bucket_object.go deleted file mode 100644 index 2eff5e6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_s3_bucket_object.go +++ /dev/null @@ -1,239 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsS3BucketObject() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsS3BucketObjectRead, - - Schema: map[string]*schema.Schema{ - "body": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "bucket": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "cache_control": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "content_disposition": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "content_encoding": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "content_language": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "content_length": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - "content_type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "etag": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "expiration": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "expires": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "key": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "last_modified": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "metadata": &schema.Schema{ - Type: schema.TypeMap, - Computed: true, - }, - "range": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "server_side_encryption": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "sse_kms_key_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "storage_class": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "version_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "website_redirect_location": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchemaComputed(), - }, - } -} - -func dataSourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).s3conn - - bucket := d.Get("bucket").(string) - key := d.Get("key").(string) - - input := s3.HeadObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - } - if v, ok := d.GetOk("range"); ok { - input.Range = aws.String(v.(string)) - } - if v, ok := d.GetOk("version_id"); ok { - input.VersionId = aws.String(v.(string)) - } - - versionText := "" - uniqueId := bucket + "/" + key - if v, ok := d.GetOk("version_id"); ok { - versionText = fmt.Sprintf(" of version %q", v.(string)) - uniqueId += "@" + v.(string) - } - - log.Printf("[DEBUG] Reading S3 object: %s", input) - out, err := conn.HeadObject(&input) - if err != nil { - return fmt.Errorf("Failed getting S3 object: %s Bucket: %q Object: %q", err, bucket, key) - } - if out.DeleteMarker != nil && *out.DeleteMarker == true { - return fmt.Errorf("Requested S3 object %q%s has been deleted", - bucket+key, versionText) - } - - log.Printf("[DEBUG] Received S3 object: %s", out) - - d.SetId(uniqueId) - - d.Set("cache_control", out.CacheControl) - d.Set("content_disposition", out.ContentDisposition) - d.Set("content_encoding", out.ContentEncoding) - d.Set("content_language", out.ContentLanguage) - d.Set("content_length", out.ContentLength) - d.Set("content_type", out.ContentType) - // See https://forums.aws.amazon.com/thread.jspa?threadID=44003 - d.Set("etag", strings.Trim(*out.ETag, `"`)) - d.Set("expiration", out.Expiration) - d.Set("expires", out.Expires) - d.Set("last_modified", out.LastModified.Format(time.RFC1123)) - d.Set("metadata", pointersMapToStringList(out.Metadata)) - d.Set("server_side_encryption", out.ServerSideEncryption) - d.Set("sse_kms_key_id", out.SSEKMSKeyId) - d.Set("version_id", out.VersionId) - d.Set("website_redirect_location", out.WebsiteRedirectLocation) - - // The "STANDARD" (which is also the default) storage - // class when set would not be included in the results. - d.Set("storage_class", s3.StorageClassStandard) - if out.StorageClass != nil { - d.Set("storage_class", out.StorageClass) - } - - if isContentTypeAllowed(out.ContentType) { - input := s3.GetObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - } - if v, ok := d.GetOk("range"); ok { - input.Range = aws.String(v.(string)) - } - if out.VersionId != nil { - input.VersionId = out.VersionId - } - out, err := conn.GetObject(&input) - if err != nil { - return fmt.Errorf("Failed getting S3 object: %s", err) - } - - buf := new(bytes.Buffer) - bytesRead, err := buf.ReadFrom(out.Body) - if err != nil { - return fmt.Errorf("Failed reading content of S3 object (%s): %s", - uniqueId, err) - } - log.Printf("[INFO] Saving %d bytes from S3 object %s", bytesRead, uniqueId) - d.Set("body", buf.String()) - } else { - contentType := "" - if out.ContentType == nil { - contentType = "" - } else { - contentType = *out.ContentType - } - - log.Printf("[INFO] Ignoring body of S3 object %s with Content-Type %q", - uniqueId, contentType) - } - - tagResp, err := conn.GetObjectTagging( - &s3.GetObjectTaggingInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - }) - if err != nil { - return err - } - d.Set("tags", tagsToMapS3(tagResp.TagSet)) - - return nil -} - -// This is to prevent potential issues w/ binary files -// and generally unprintable characters -// See https://github.com/hashicorp/terraform/pull/3858#issuecomment-156856738 -func isContentTypeAllowed(contentType *string) bool { - if contentType == nil { - return false - } - - allowedContentTypes := []*regexp.Regexp{ - regexp.MustCompile("^text/.+"), - regexp.MustCompile("^application/json$"), - } - - for _, r := range allowedContentTypes { - if r.MatchString(*contentType) { - return true - } - } - - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_security_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_security_group.go deleted file mode 100644 index 1ff1f17..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_security_group.go +++ /dev/null @@ -1,86 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsSecurityGroup() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsSecurityGroupRead, - - Schema: map[string]*schema.Schema{ - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "filter": ec2CustomFiltersSchema(), - - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "tags": tagsSchemaComputed(), - }, - } -} - -func dataSourceAwsSecurityGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - req := &ec2.DescribeSecurityGroupsInput{} - - if id, idExists := d.GetOk("id"); idExists { - req.GroupIds = []*string{aws.String(id.(string))} - } - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "group-name": d.Get("name").(string), - "vpc-id": d.Get("vpc_id").(string), - }, - ) - req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(d.Get("tags").(map[string]interface{})), - )...) - req.Filters = append(req.Filters, buildEC2CustomFilterList( - d.Get("filter").(*schema.Set), - )...) - if len(req.Filters) == 0 { - // Don't send an empty filters list; the EC2 API won't accept it. - req.Filters = nil - } - - log.Printf("[DEBUG] Describe Security Groups %v\n", req) - resp, err := conn.DescribeSecurityGroups(req) - if err != nil { - return err - } - if resp == nil || len(resp.SecurityGroups) == 0 { - return fmt.Errorf("no matching SecurityGroup found") - } - if len(resp.SecurityGroups) > 1 { - return fmt.Errorf("multiple Security Groups matched; use additional constraints to reduce matches to a single Security Group") - } - - sg := resp.SecurityGroups[0] - - d.SetId(*sg.GroupId) - d.Set("id", sg.VpcId) - d.Set("name", sg.GroupName) - d.Set("description", sg.Description) - d.Set("vpc_id", sg.VpcId) - d.Set("tags", tagsToMap(sg.Tags)) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_sns.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_sns.go deleted file mode 100644 index c02ec32..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_sns.go +++ /dev/null @@ -1,71 +0,0 @@ -package aws - -import ( - "fmt" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/service/sns" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsSnsTopic() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsSnsTopicsRead, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - validNamePattern := "^[A-Za-z0-9_-]+$" - validName, nameMatchErr := regexp.MatchString(validNamePattern, value) - if !validName || nameMatchErr != nil { - errors = append(errors, fmt.Errorf( - "%q must match regex '%v'", k, validNamePattern)) - } - return - }, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsSnsTopicsRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).snsconn - params := &sns.ListTopicsInput{} - - target := d.Get("name") - var arns []string - err := conn.ListTopicsPages(params, func(page *sns.ListTopicsOutput, lastPage bool) bool { - for _, topic := range page.Topics { - topicPattern := fmt.Sprintf(".*:%v$", target) - matched, regexpErr := regexp.MatchString(topicPattern, *topic.TopicArn) - if matched && regexpErr == nil { - arns = append(arns, *topic.TopicArn) - } - } - - return true - }) - if err != nil { - return errwrap.Wrapf("Error describing topics: {{err}}", err) - } - - if len(arns) == 0 { - return fmt.Errorf("No topic with name %q found in this region.", target) - } - if len(arns) > 1 { - return fmt.Errorf("Multiple topics with name %q found in this region.", target) - } - - d.SetId(time.Now().UTC().String()) - d.Set("arn", arns[0]) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_subnet.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_subnet.go deleted file mode 100644 index ddd178a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_subnet.go +++ /dev/null @@ -1,123 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsSubnet() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsSubnetRead, - - Schema: map[string]*schema.Schema{ - "availability_zone": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "cidr_block": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "default_for_az": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "filter": ec2CustomFiltersSchema(), - - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "state": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "tags": tagsSchemaComputed(), - - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func dataSourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - req := &ec2.DescribeSubnetsInput{} - - if id := d.Get("id"); id != "" { - req.SubnetIds = []*string{aws.String(id.(string))} - } - - // We specify default_for_az as boolean, but EC2 filters want - // it to be serialized as a string. Note that setting it to - // "false" here does not actually filter by it *not* being - // the default, because Terraform can't distinguish between - // "false" and "not set". - defaultForAzStr := "" - if d.Get("default_for_az").(bool) { - defaultForAzStr = "true" - } - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "availabilityZone": d.Get("availability_zone").(string), - "cidrBlock": d.Get("cidr_block").(string), - "defaultForAz": defaultForAzStr, - "state": d.Get("state").(string), - "vpc-id": d.Get("vpc_id").(string), - }, - ) - req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(d.Get("tags").(map[string]interface{})), - )...) - req.Filters = append(req.Filters, buildEC2CustomFilterList( - d.Get("filter").(*schema.Set), - )...) - if len(req.Filters) == 0 { - // Don't send an empty filters list; the EC2 API won't accept it. - req.Filters = nil - } - - log.Printf("[DEBUG] DescribeSubnets %s\n", req) - resp, err := conn.DescribeSubnets(req) - if err != nil { - return err - } - if resp == nil || len(resp.Subnets) == 0 { - return fmt.Errorf("no matching subnet found") - } - if len(resp.Subnets) > 1 { - return fmt.Errorf("multiple subnets matched; use additional constraints to reduce matches to a single subnet") - } - - subnet := resp.Subnets[0] - - d.SetId(*subnet.SubnetId) - d.Set("id", subnet.SubnetId) - d.Set("vpc_id", subnet.VpcId) - d.Set("availability_zone", subnet.AvailabilityZone) - d.Set("cidr_block", subnet.CidrBlock) - d.Set("default_for_az", subnet.DefaultForAz) - d.Set("state", subnet.State) - d.Set("tags", tagsToMap(subnet.Tags)) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc.go deleted file mode 100644 index 6e09e97..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc.go +++ /dev/null @@ -1,136 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsVpc() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsVpcRead, - - Schema: map[string]*schema.Schema{ - "cidr_block": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "dhcp_options_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "default": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "filter": ec2CustomFiltersSchema(), - - "id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "instance_tenancy": { - Type: schema.TypeString, - Computed: true, - }, - - "ipv6_cidr_block": { - Type: schema.TypeString, - Computed: true, - }, - - "ipv6_association_id": { - Type: schema.TypeString, - Computed: true, - }, - - "state": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "tags": tagsSchemaComputed(), - }, - } -} - -func dataSourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - req := &ec2.DescribeVpcsInput{} - - if id := d.Get("id"); id != "" { - req.VpcIds = []*string{aws.String(id.(string))} - } - - // We specify "default" as boolean, but EC2 filters want - // it to be serialized as a string. Note that setting it to - // "false" here does not actually filter by it *not* being - // the default, because Terraform can't distinguish between - // "false" and "not set". - isDefaultStr := "" - if d.Get("default").(bool) { - isDefaultStr = "true" - } - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "cidr": d.Get("cidr_block").(string), - "dhcp-options-id": d.Get("dhcp_options_id").(string), - "isDefault": isDefaultStr, - "state": d.Get("state").(string), - }, - ) - req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(d.Get("tags").(map[string]interface{})), - )...) - req.Filters = append(req.Filters, buildEC2CustomFilterList( - d.Get("filter").(*schema.Set), - )...) - if len(req.Filters) == 0 { - // Don't send an empty filters list; the EC2 API won't accept it. - req.Filters = nil - } - - log.Printf("[DEBUG] DescribeVpcs %s\n", req) - resp, err := conn.DescribeVpcs(req) - if err != nil { - return err - } - if resp == nil || len(resp.Vpcs) == 0 { - return fmt.Errorf("no matching VPC found") - } - if len(resp.Vpcs) > 1 { - return fmt.Errorf("multiple VPCs matched; use additional constraints to reduce matches to a single VPC") - } - - vpc := resp.Vpcs[0] - - d.SetId(*vpc.VpcId) - d.Set("id", vpc.VpcId) - d.Set("cidr_block", vpc.CidrBlock) - d.Set("dhcp_options_id", vpc.DhcpOptionsId) - d.Set("instance_tenancy", vpc.InstanceTenancy) - d.Set("default", vpc.IsDefault) - d.Set("state", vpc.State) - d.Set("tags", tagsToMap(vpc.Tags)) - - if vpc.Ipv6CidrBlockAssociationSet != nil { - d.Set("ipv6_association_id", vpc.Ipv6CidrBlockAssociationSet[0].AssociationId) - d.Set("ipv6_cidr_block", vpc.Ipv6CidrBlockAssociationSet[0].Ipv6CidrBlock) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_endpoint.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_endpoint.go deleted file mode 100644 index c159331..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_endpoint.go +++ /dev/null @@ -1,103 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsVpcEndpoint() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsVpcEndpointRead, - - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "state": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "vpc_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "service_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "policy": { - Type: schema.TypeString, - Computed: true, - }, - "route_table_ids": &schema.Schema{ - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - } -} - -func dataSourceAwsVpcEndpointRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[DEBUG] Reading VPC Endpoints.") - - req := &ec2.DescribeVpcEndpointsInput{} - - if id, ok := d.GetOk("id"); ok { - req.VpcEndpointIds = aws.StringSlice([]string{id.(string)}) - } - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "vpc-endpoint-state": d.Get("state").(string), - "vpc-id": d.Get("vpc_id").(string), - "service-name": d.Get("service_name").(string), - }, - ) - if len(req.Filters) == 0 { - // Don't send an empty filters list; the EC2 API won't accept it. - req.Filters = nil - } - - resp, err := conn.DescribeVpcEndpoints(req) - if err != nil { - return err - } - if resp == nil || len(resp.VpcEndpoints) == 0 { - return fmt.Errorf("no matching VPC endpoint found") - } - if len(resp.VpcEndpoints) > 1 { - return fmt.Errorf("multiple VPC endpoints matched; use additional constraints to reduce matches to a single VPC endpoint") - } - - vpce := resp.VpcEndpoints[0] - policy, err := normalizeJsonString(*vpce.PolicyDocument) - if err != nil { - return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) - } - - d.SetId(aws.StringValue(vpce.VpcEndpointId)) - d.Set("id", vpce.VpcEndpointId) - d.Set("state", vpce.State) - d.Set("vpc_id", vpce.VpcId) - d.Set("service_name", vpce.ServiceName) - d.Set("policy", policy) - if err := d.Set("route_table_ids", aws.StringValueSlice(vpce.RouteTableIds)); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_endpoint_service.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_endpoint_service.go deleted file mode 100644 index 8860b39..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_endpoint_service.go +++ /dev/null @@ -1,56 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsVpcEndpointService() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsVpcEndpointServiceRead, - - Schema: map[string]*schema.Schema{ - "service": { - Type: schema.TypeString, - Required: true, - }, - "service_name": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func dataSourceAwsVpcEndpointServiceRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - service := d.Get("service").(string) - - log.Printf("[DEBUG] Reading VPC Endpoint Services.") - - request := &ec2.DescribeVpcEndpointServicesInput{} - - resp, err := conn.DescribeVpcEndpointServices(request) - if err != nil { - return fmt.Errorf("Error fetching VPC Endpoint Services: %s", err) - } - - names := aws.StringValueSlice(resp.ServiceNames) - for _, name := range names { - if strings.HasSuffix(name, "."+service) { - d.SetId(strconv.Itoa(hashcode.String(name))) - d.Set("service_name", name) - return nil - } - } - - return fmt.Errorf("VPC Endpoint Service (%s) not found", service) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_peering_connection.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_peering_connection.go deleted file mode 100644 index 8d80075..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpc_peering_connection.go +++ /dev/null @@ -1,143 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsVpcPeeringConnection() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsVpcPeeringConnectionRead, - - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "status": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "vpc_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "owner_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "cidr_block": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "peer_vpc_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "peer_owner_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "peer_cidr_block": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "accepter": { - Type: schema.TypeMap, - Computed: true, - Elem: schema.TypeBool, - }, - "requester": { - Type: schema.TypeMap, - Computed: true, - Elem: schema.TypeBool, - }, - "filter": ec2CustomFiltersSchema(), - "tags": tagsSchemaComputed(), - }, - } -} - -func dataSourceAwsVpcPeeringConnectionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[DEBUG] Reading VPC Peering Connections.") - - req := &ec2.DescribeVpcPeeringConnectionsInput{} - - if id, ok := d.GetOk("id"); ok { - req.VpcPeeringConnectionIds = aws.StringSlice([]string{id.(string)}) - } - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "status-code": d.Get("status").(string), - "requester-vpc-info.vpc-id": d.Get("vpc_id").(string), - "requester-vpc-info.owner-id": d.Get("owner_id").(string), - "requester-vpc-info.cidr-block": d.Get("cidr_block").(string), - "accepter-vpc-info.vpc-id": d.Get("peer_vpc_id").(string), - "accepter-vpc-info.owner-id": d.Get("peer_owner_id").(string), - "accepter-vpc-info.cidr-block": d.Get("peer_cidr_block").(string), - }, - ) - req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(d.Get("tags").(map[string]interface{})), - )...) - req.Filters = append(req.Filters, buildEC2CustomFilterList( - d.Get("filter").(*schema.Set), - )...) - if len(req.Filters) == 0 { - // Don't send an empty filters list; the EC2 API won't accept it. - req.Filters = nil - } - - resp, err := conn.DescribeVpcPeeringConnections(req) - if err != nil { - return err - } - if resp == nil || len(resp.VpcPeeringConnections) == 0 { - return fmt.Errorf("no matching VPC peering connection found") - } - if len(resp.VpcPeeringConnections) > 1 { - return fmt.Errorf("multiple VPC peering connections matched; use additional constraints to reduce matches to a single VPC peering connection") - } - - pcx := resp.VpcPeeringConnections[0] - - d.SetId(aws.StringValue(pcx.VpcPeeringConnectionId)) - d.Set("id", pcx.VpcPeeringConnectionId) - d.Set("status", pcx.Status.Code) - d.Set("vpc_id", pcx.RequesterVpcInfo.VpcId) - d.Set("owner_id", pcx.RequesterVpcInfo.OwnerId) - d.Set("cidr_block", pcx.RequesterVpcInfo.CidrBlock) - d.Set("peer_vpc_id", pcx.AccepterVpcInfo.VpcId) - d.Set("peer_owner_id", pcx.AccepterVpcInfo.OwnerId) - d.Set("peer_cidr_block", pcx.AccepterVpcInfo.CidrBlock) - d.Set("tags", tagsToMap(pcx.Tags)) - - if pcx.AccepterVpcInfo.PeeringOptions != nil { - if err := d.Set("accepter", flattenPeeringOptions(pcx.AccepterVpcInfo.PeeringOptions)[0]); err != nil { - return err - } - } - - if pcx.RequesterVpcInfo.PeeringOptions != nil { - if err := d.Set("requester", flattenPeeringOptions(pcx.RequesterVpcInfo.PeeringOptions)[0]); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpn_gateway.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpn_gateway.go deleted file mode 100644 index 5d088e5..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/data_source_aws_vpn_gateway.go +++ /dev/null @@ -1,105 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func dataSourceAwsVpnGateway() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsVpnGatewayRead, - - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "state": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "attached_vpc_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "filter": ec2CustomFiltersSchema(), - "tags": tagsSchemaComputed(), - }, - } -} - -func dataSourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[DEBUG] Reading VPN Gateways.") - - req := &ec2.DescribeVpnGatewaysInput{} - - if id, ok := d.GetOk("id"); ok { - req.VpnGatewayIds = aws.StringSlice([]string{id.(string)}) - } - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "state": d.Get("state").(string), - "availability-zone": d.Get("availability_zone").(string), - }, - ) - if id, ok := d.GetOk("attached_vpc_id"); ok { - req.Filters = append(req.Filters, buildEC2AttributeFilterList( - map[string]string{ - "attachment.state": "attached", - "attachment.vpc-id": id.(string), - }, - )...) - } - req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(d.Get("tags").(map[string]interface{})), - )...) - req.Filters = append(req.Filters, buildEC2CustomFilterList( - d.Get("filter").(*schema.Set), - )...) - if len(req.Filters) == 0 { - // Don't send an empty filters list; the EC2 API won't accept it. - req.Filters = nil - } - - resp, err := conn.DescribeVpnGateways(req) - if err != nil { - return err - } - if resp == nil || len(resp.VpnGateways) == 0 { - return fmt.Errorf("no matching VPN gateway found: %#v", req) - } - if len(resp.VpnGateways) > 1 { - return fmt.Errorf("multiple VPN gateways matched; use additional constraints to reduce matches to a single VPN gateway") - } - - vgw := resp.VpnGateways[0] - - d.SetId(aws.StringValue(vgw.VpnGatewayId)) - d.Set("state", vgw.State) - d.Set("availability_zone", vgw.AvailabilityZone) - d.Set("tags", tagsToMap(vgw.Tags)) - - for _, attachment := range vgw.VpcAttachments { - if *attachment.State == "attached" { - d.Set("attached_vpc_id", attachment.VpcId) - break - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/diff_suppress_funcs.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/diff_suppress_funcs.go deleted file mode 100644 index 5c96c66..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/diff_suppress_funcs.go +++ /dev/null @@ -1,60 +0,0 @@ -package aws - -import ( - "bytes" - "encoding/json" - "log" - "strings" - - "github.com/hashicorp/terraform/helper/schema" - "github.com/jen20/awspolicyequivalence" -) - -func suppressEquivalentAwsPolicyDiffs(k, old, new string, d *schema.ResourceData) bool { - equivalent, err := awspolicy.PoliciesAreEquivalent(old, new) - if err != nil { - return false - } - - return equivalent -} - -// Suppresses minor version changes to the db_instance engine_version attribute -func suppressAwsDbEngineVersionDiffs(k, old, new string, d *schema.ResourceData) bool { - // First check if the old/new values are nil. - // If both are nil, we have no state to compare the values with, so register a diff. - // This populates the attribute field during a plan/apply with fresh state, allowing - // the attribute to still be used in future resources. - // See https://github.com/hashicorp/terraform/issues/11881 - if old == "" && new == "" { - return false - } - - if v, ok := d.GetOk("auto_minor_version_upgrade"); ok { - if v.(bool) { - // If we're set to auto upgrade minor versions - // ignore a minor version diff between versions - if strings.HasPrefix(old, new) { - log.Printf("[DEBUG] Ignoring minor version diff") - return true - } - } - } - - // Throw a diff by default - return false -} - -func suppressEquivalentJsonDiffs(k, old, new string, d *schema.ResourceData) bool { - ob := bytes.NewBufferString("") - if err := json.Compact(ob, []byte(old)); err != nil { - return false - } - - nb := bytes.NewBufferString("") - if err := json.Compact(nb, []byte(new)); err != nil { - return false - } - - return jsonBytesEqual(ob.Bytes(), nb.Bytes()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/ec2_filters.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/ec2_filters.go deleted file mode 100644 index 4263d6e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/ec2_filters.go +++ /dev/null @@ -1,163 +0,0 @@ -package aws - -import ( - "fmt" - "sort" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - - "github.com/hashicorp/terraform/helper/schema" -) - -// buildEC2AttributeFilterList takes a flat map of scalar attributes (most -// likely values extracted from a *schema.ResourceData on an EC2-querying -// data source) and produces a []*ec2.Filter representing an exact match -// for each of the given non-empty attributes. -// -// The keys of the given attributes map are the attribute names expected -// by the EC2 API, which are usually either in camelcase or with dash-separated -// words. We conventionally map these to underscore-separated identifiers -// with the same words when presenting these as data source query attributes -// in Terraform. -// -// It's the callers responsibility to transform any non-string values into -// the appropriate string serialization required by the AWS API when -// encoding the given filter. Any attributes given with empty string values -// are ignored, assuming that the user wishes to leave that attribute -// unconstrained while filtering. -// -// The purpose of this function is to create values to pass in -// for the "Filters" attribute on most of the "Describe..." API functions in -// the EC2 API, to aid in the implementation of Terraform data sources that -// retrieve data about EC2 objects. -func buildEC2AttributeFilterList(attrs map[string]string) []*ec2.Filter { - var filters []*ec2.Filter - - // sort the filters by name to make the output deterministic - var names []string - for filterName := range attrs { - names = append(names, filterName) - } - - sort.Strings(names) - - for _, filterName := range names { - value := attrs[filterName] - if value == "" { - continue - } - - filters = append(filters, &ec2.Filter{ - Name: aws.String(filterName), - Values: []*string{aws.String(value)}, - }) - } - - return filters -} - -// buildEC2TagFilterList takes a []*ec2.Tag and produces a []*ec2.Filter that -// represents exact matches for all of the tag key/value pairs given in -// the tag set. -// -// The purpose of this function is to create values to pass in for -// the "Filters" attribute on most of the "Describe..." API functions -// in the EC2 API, to implement filtering by tag values e.g. in Terraform -// data sources that retrieve data about EC2 objects. -// -// It is conventional for an EC2 data source to include an attribute called -// "tags" which conforms to the schema returned by the tagsSchema() function. -// The value of this can then be converted to a tags slice using tagsFromMap, -// and the result finally passed in to this function. -// -// In Terraform configuration this would then look like this, to constrain -// results by name: -// -// tags { -// Name = "my-awesome-subnet" -// } -func buildEC2TagFilterList(tags []*ec2.Tag) []*ec2.Filter { - filters := make([]*ec2.Filter, len(tags)) - - for i, tag := range tags { - filters[i] = &ec2.Filter{ - Name: aws.String(fmt.Sprintf("tag:%s", *tag.Key)), - Values: []*string{tag.Value}, - } - } - - return filters -} - -// ec2CustomFiltersSchema returns a *schema.Schema that represents -// a set of custom filtering criteria that a user can specify as input -// to a data source that wraps one of the many "Describe..." API calls -// in the EC2 API. -// -// It is conventional for an attribute of this type to be included -// as a top-level attribute called "filter". This is the "catch all" for -// filter combinations that are not possible to express using scalar -// attributes or tags. In Terraform configuration, the custom filter blocks -// then look like this: -// -// filter { -// name = "availabilityZone" -// values = ["us-west-2a", "us-west-2b"] -// } -func ec2CustomFiltersSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "values": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - } -} - -// buildEC2CustomFilterList takes the set value extracted from a schema -// attribute conforming to the schema returned by ec2CustomFiltersSchema, -// and transforms it into a []*ec2.Filter representing the same filter -// expressions which is ready to pass into the "Filters" attribute on most -// of the "Describe..." functions in the EC2 API. -// -// This function is intended only to be used in conjunction with -// ec2CustomFitlersSchema. See the docs on that function for more details -// on the configuration pattern this is intended to support. -func buildEC2CustomFilterList(filterSet *schema.Set) []*ec2.Filter { - if filterSet == nil { - return []*ec2.Filter{} - } - - customFilters := filterSet.List() - filters := make([]*ec2.Filter, len(customFilters)) - - for filterIdx, customFilterI := range customFilters { - customFilterMapI := customFilterI.(map[string]interface{}) - name := customFilterMapI["name"].(string) - valuesI := customFilterMapI["values"].(*schema.Set).List() - values := make([]*string, len(valuesI)) - for valueIdx, valueI := range valuesI { - values[valueIdx] = aws.String(valueI.(string)) - } - - filters[filterIdx] = &ec2.Filter{ - Name: &name, - Values: values, - } - } - - return filters -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/hosted_zones.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/hosted_zones.go deleted file mode 100644 index 131f03e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/hosted_zones.go +++ /dev/null @@ -1,28 +0,0 @@ -package aws - -// This list is copied from -// http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_website_region_endpoints -// It currently cannot be generated from the API json. -var hostedZoneIDsMap = map[string]string{ - "us-east-1": "Z3AQBSTGFYJSTF", - "us-east-2": "Z2O1EMRO9K5GLX", - "us-west-2": "Z3BJ6K6RIION7M", - "us-west-1": "Z2F56UZL2M1ACD", - "eu-west-1": "Z1BKCTXD74EZPE", - "eu-west-2": "Z3GKZC51ZF0DB4", - "eu-central-1": "Z21DNDUVLTQW6Q", - "ap-south-1": "Z11RGJOFQNVJUP", - "ap-southeast-1": "Z3O0J2DXBE1FTB", - "ap-southeast-2": "Z1WCIGYICN2BYD", - "ap-northeast-1": "Z2M4EHUR26P7ZW", - "ap-northeast-2": "Z3W03O7B5YMIYP", - "ca-central-1": "Z1QDHH18159H29", - "sa-east-1": "Z7KQH4QJS55SO", - "us-gov-west-1": "Z31GFT0UA1I2HV", -} - -// Returns the hosted zone ID for an S3 website endpoint region. This can be -// used as input to the aws_route53_record resource's zone_id argument. -func HostedZoneIDForRegion(region string) string { - return hostedZoneIDsMap[region] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/iam_policy_model.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/iam_policy_model.go deleted file mode 100644 index 8130697..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/iam_policy_model.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "encoding/json" - "sort" -) - -type IAMPolicyDoc struct { - Version string `json:",omitempty"` - Id string `json:",omitempty"` - Statements []*IAMPolicyStatement `json:"Statement"` -} - -type IAMPolicyStatement struct { - Sid string - Effect string `json:",omitempty"` - Actions interface{} `json:"Action,omitempty"` - NotActions interface{} `json:"NotAction,omitempty"` - Resources interface{} `json:"Resource,omitempty"` - NotResources interface{} `json:"NotResource,omitempty"` - Principals IAMPolicyStatementPrincipalSet `json:"Principal,omitempty"` - NotPrincipals IAMPolicyStatementPrincipalSet `json:"NotPrincipal,omitempty"` - Conditions IAMPolicyStatementConditionSet `json:"Condition,omitempty"` -} - -type IAMPolicyStatementPrincipal struct { - Type string - Identifiers interface{} -} - -type IAMPolicyStatementCondition struct { - Test string - Variable string - Values interface{} -} - -type IAMPolicyStatementPrincipalSet []IAMPolicyStatementPrincipal -type IAMPolicyStatementConditionSet []IAMPolicyStatementCondition - -func (ps IAMPolicyStatementPrincipalSet) MarshalJSON() ([]byte, error) { - raw := map[string]interface{}{} - - // As a special case, IAM considers the string value "*" to be - // equivalent to "AWS": "*", and normalizes policies as such. - // We'll follow their lead and do the same normalization here. - // IAM also considers {"*": "*"} to be equivalent to this. - if len(ps) == 1 { - p := ps[0] - if p.Type == "AWS" || p.Type == "*" { - if sv, ok := p.Identifiers.(string); ok && sv == "*" { - return []byte(`"*"`), nil - } - - if av, ok := p.Identifiers.([]string); ok && len(av) == 1 && av[0] == "*" { - return []byte(`"*"`), nil - } - } - } - - for _, p := range ps { - switch i := p.Identifiers.(type) { - case []string: - if _, ok := raw[p.Type]; !ok { - raw[p.Type] = make([]string, 0, len(i)) - } - sort.Sort(sort.Reverse(sort.StringSlice(i))) - raw[p.Type] = append(raw[p.Type].([]string), i...) - case string: - raw[p.Type] = i - default: - panic("Unsupported data type for IAMPolicyStatementPrincipalSet") - } - } - - return json.Marshal(&raw) -} - -func (cs IAMPolicyStatementConditionSet) MarshalJSON() ([]byte, error) { - raw := map[string]map[string]interface{}{} - - for _, c := range cs { - if _, ok := raw[c.Test]; !ok { - raw[c.Test] = map[string]interface{}{} - } - switch i := c.Values.(type) { - case []string: - if _, ok := raw[c.Test][c.Variable]; !ok { - raw[c.Test][c.Variable] = make([]string, 0, len(i)) - } - sort.Sort(sort.Reverse(sort.StringSlice(i))) - raw[c.Test][c.Variable] = append(raw[c.Test][c.Variable].([]string), i...) - case string: - raw[c.Test][c.Variable] = i - default: - panic("Unsupported data type for IAMPolicyStatementConditionSet") - } - } - - return json.Marshal(&raw) -} - -func iamPolicyDecodeConfigStringList(lI []interface{}) interface{} { - if len(lI) == 1 { - return lI[0].(string) - } - ret := make([]string, len(lI)) - for i, vI := range lI { - ret[i] = vI.(string) - } - sort.Sort(sort.Reverse(sort.StringSlice(ret))) - return ret -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_cloudfront_distribution.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_cloudfront_distribution.go deleted file mode 100644 index dcb8792..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_cloudfront_distribution.go +++ /dev/null @@ -1,28 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudFrontDistributionImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - conn := meta.(*AWSClient).cloudfrontconn - id := d.Id() - resp, err := conn.GetDistributionConfig(&cloudfront.GetDistributionConfigInput{ - Id: aws.String(id), - }) - - if err != nil { - return nil, err - } - - distConfig := resp.DistributionConfig - results := make([]*schema.ResourceData, 1) - err = flattenDistributionConfig(d, distConfig) - if err != nil { - return nil, err - } - results[0] = d - return results, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_db_event_subscription.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_db_event_subscription.go deleted file mode 100644 index 82e5317..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_db_event_subscription.go +++ /dev/null @@ -1,17 +0,0 @@ -package aws - -import "github.com/hashicorp/terraform/helper/schema" - -func resourceAwsDbEventSubscriptionImport( - d *schema.ResourceData, - meta interface{}) ([]*schema.ResourceData, error) { - - // The db event subscription Read function only needs the "name" of the event subscription - // in order to populate the necessary values. This takes the "id" from the supplied StateFunc - // and sets it as the "name" attribute, as described in the import documentation. This allows - // the Read function to actually succeed and set the ID of the resource - results := make([]*schema.ResourceData, 1, 1) - d.Set("name", d.Id()) - results[0] = d - return results, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_network_acl.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_network_acl.go deleted file mode 100644 index bcc221d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_network_acl.go +++ /dev/null @@ -1,95 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -// Network ACLs import their rules and associations -func resourceAwsNetworkAclImportState( - d *schema.ResourceData, - meta interface{}) ([]*schema.ResourceData, error) { - conn := meta.(*AWSClient).ec2conn - - // First query the resource itself - resp, err := conn.DescribeNetworkAcls(&ec2.DescribeNetworkAclsInput{ - NetworkAclIds: []*string{aws.String(d.Id())}, - }) - if err != nil { - return nil, err - } - if resp == nil || len(resp.NetworkAcls) < 1 || resp.NetworkAcls[0] == nil { - return nil, fmt.Errorf("network ACL %s is not found", d.Id()) - } - acl := resp.NetworkAcls[0] - - // Start building our results - results := make([]*schema.ResourceData, 1, - 2+len(acl.Associations)+len(acl.Entries)) - results[0] = d - - /* - { - // Construct the entries - subResource := resourceAwsNetworkAclRule() - for _, entry := range acl.Entries { - // Minimal data for route - d := subResource.Data(nil) - d.SetType("aws_network_acl_rule") - d.Set("network_acl_id", acl.NetworkAclId) - d.Set("rule_number", entry.RuleNumber) - d.Set("egress", entry.Egress) - d.Set("protocol", entry.Protocol) - d.SetId(networkAclIdRuleNumberEgressHash( - d.Get("network_acl_id").(string), - d.Get("rule_number").(int), - d.Get("egress").(bool), - d.Get("protocol").(string))) - results = append(results, d) - } - } - - { - // Construct the associations - subResource := resourceAwsRouteTableAssociation() - for _, assoc := range table.Associations { - if *assoc.Main { - // Ignore - continue - } - - // Minimal data for route - d := subResource.Data(nil) - d.SetType("aws_route_table_association") - d.Set("route_table_id", assoc.RouteTableId) - d.SetId(*assoc.RouteTableAssociationId) - results = append(results, d) - } - } - - { - // Construct the main associations. We could do this above but - // I keep this as a separate section since it is a separate resource. - subResource := resourceAwsMainRouteTableAssociation() - for _, assoc := range table.Associations { - if !*assoc.Main { - // Ignore - continue - } - - // Minimal data for route - d := subResource.Data(nil) - d.SetType("aws_main_route_table_association") - d.Set("route_table_id", id) - d.Set("vpc_id", table.VpcId) - d.SetId(*assoc.RouteTableAssociationId) - results = append(results, d) - } - } - */ - - return results, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_route_table.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_route_table.go deleted file mode 100644 index 185d994..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_route_table.go +++ /dev/null @@ -1,99 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -// Route table import also imports all the rules -func resourceAwsRouteTableImportState( - d *schema.ResourceData, - meta interface{}) ([]*schema.ResourceData, error) { - conn := meta.(*AWSClient).ec2conn - - // First query the resource itself - id := d.Id() - resp, err := conn.DescribeRouteTables(&ec2.DescribeRouteTablesInput{ - RouteTableIds: []*string{&id}, - }) - if err != nil { - return nil, err - } - if len(resp.RouteTables) < 1 || resp.RouteTables[0] == nil { - return nil, fmt.Errorf("route table %s is not found", id) - } - table := resp.RouteTables[0] - - // Start building our results - results := make([]*schema.ResourceData, 1, - 2+len(table.Associations)+len(table.Routes)) - results[0] = d - - { - // Construct the routes - subResource := resourceAwsRoute() - for _, route := range table.Routes { - // Ignore the local/default route - if route.GatewayId != nil && *route.GatewayId == "local" { - continue - } - - if route.DestinationPrefixListId != nil { - // Skipping because VPC endpoint routes are handled separately - // See aws_vpc_endpoint - continue - } - - // Minimal data for route - d := subResource.Data(nil) - d.SetType("aws_route") - d.Set("route_table_id", id) - d.Set("destination_cidr_block", route.DestinationCidrBlock) - d.Set("destination_ipv6_cidr_block", route.DestinationIpv6CidrBlock) - d.SetId(routeIDHash(d, route)) - results = append(results, d) - } - } - - { - // Construct the associations - subResource := resourceAwsRouteTableAssociation() - for _, assoc := range table.Associations { - if *assoc.Main { - // Ignore - continue - } - - // Minimal data for route - d := subResource.Data(nil) - d.SetType("aws_route_table_association") - d.Set("route_table_id", assoc.RouteTableId) - d.SetId(*assoc.RouteTableAssociationId) - results = append(results, d) - } - } - - { - // Construct the main associations. We could do this above but - // I keep this as a separate section since it is a separate resource. - subResource := resourceAwsMainRouteTableAssociation() - for _, assoc := range table.Associations { - if !*assoc.Main { - // Ignore - continue - } - - // Minimal data for route - d := subResource.Data(nil) - d.SetType("aws_main_route_table_association") - d.Set("route_table_id", id) - d.Set("vpc_id", table.VpcId) - d.SetId(*assoc.RouteTableAssociationId) - results = append(results, d) - } - } - - return results, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_s3_bucket.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_s3_bucket.go deleted file mode 100644 index ba2129e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_s3_bucket.go +++ /dev/null @@ -1,39 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsS3BucketImportState( - d *schema.ResourceData, - meta interface{}) ([]*schema.ResourceData, error) { - - results := make([]*schema.ResourceData, 1, 1) - results[0] = d - - conn := meta.(*AWSClient).s3conn - pol, err := conn.GetBucketPolicy(&s3.GetBucketPolicyInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchBucketPolicy" { - // Bucket without policy - return results, nil - } - return nil, errwrap.Wrapf("Error importing AWS S3 bucket policy: {{err}}", err) - } - - policy := resourceAwsS3BucketPolicy() - pData := policy.Data(nil) - pData.SetId(d.Id()) - pData.SetType("aws_s3_bucket_policy") - pData.Set("bucket", d.Id()) - pData.Set("policy", pol) - results = append(results, pData) - - return results, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_security_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_security_group.go deleted file mode 100644 index d802c75..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/import_aws_security_group.go +++ /dev/null @@ -1,139 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -// Security group import fans out to multiple resources due to the -// security group rules. Instead of creating one resource with nested -// rules, we use the best practices approach of one resource per rule. -func resourceAwsSecurityGroupImportState( - d *schema.ResourceData, - meta interface{}) ([]*schema.ResourceData, error) { - conn := meta.(*AWSClient).ec2conn - - // First query the security group - sgRaw, _, err := SGStateRefreshFunc(conn, d.Id())() - if err != nil { - return nil, err - } - if sgRaw == nil { - return nil, fmt.Errorf("security group not found") - } - sg := sgRaw.(*ec2.SecurityGroup) - - // Start building our results - results := make([]*schema.ResourceData, 1, - 1+len(sg.IpPermissions)+len(sg.IpPermissionsEgress)) - results[0] = d - - // Construct the rules - permMap := map[string][]*ec2.IpPermission{ - "ingress": sg.IpPermissions, - "egress": sg.IpPermissionsEgress, - } - for ruleType, perms := range permMap { - for _, perm := range perms { - ds, err := resourceAwsSecurityGroupImportStatePerm(sg, ruleType, perm) - if err != nil { - return nil, err - } - results = append(results, ds...) - } - } - - return results, nil -} - -func resourceAwsSecurityGroupImportStatePerm(sg *ec2.SecurityGroup, ruleType string, perm *ec2.IpPermission) ([]*schema.ResourceData, error) { - var result []*schema.ResourceData - - if len(perm.UserIdGroupPairs) == 0 { - r, err := resourceAwsSecurityGroupImportStatePermPair(sg, ruleType, perm) - if err != nil { - return nil, err - } - result = append(result, r) - } else { - // If the rule contained more than one source security group, this - // will iterate over them and create one rule for each - // source security group. - for _, pair := range perm.UserIdGroupPairs { - p := &ec2.IpPermission{ - FromPort: perm.FromPort, - IpProtocol: perm.IpProtocol, - PrefixListIds: perm.PrefixListIds, - ToPort: perm.ToPort, - - UserIdGroupPairs: []*ec2.UserIdGroupPair{pair}, - } - - if perm.Ipv6Ranges != nil { - p.Ipv6Ranges = perm.Ipv6Ranges - } - - if perm.IpRanges != nil { - p.IpRanges = perm.IpRanges - } - - r, err := resourceAwsSecurityGroupImportStatePermPair(sg, ruleType, p) - if err != nil { - return nil, err - } - result = append(result, r) - } - } - return result, nil -} - -func resourceAwsSecurityGroupImportStatePermPair(sg *ec2.SecurityGroup, ruleType string, perm *ec2.IpPermission) (*schema.ResourceData, error) { - // Construct the rule. We do this by populating the absolute - // minimum necessary for Refresh on the rule to work. This - // happens to be a lot of fields since they're almost all needed - // for de-dupping. - sgId := sg.GroupId - id := ipPermissionIDHash(*sgId, ruleType, perm) - ruleResource := resourceAwsSecurityGroupRule() - d := ruleResource.Data(nil) - d.SetId(id) - d.SetType("aws_security_group_rule") - d.Set("security_group_id", sgId) - d.Set("type", ruleType) - - // 'self' is false by default. Below, we range over the group ids and set true - // if the parent sg id is found - d.Set("self", false) - - if len(perm.UserIdGroupPairs) > 0 { - s := perm.UserIdGroupPairs[0] - - // Check for Pair that is the same as the Security Group, to denote self. - // Otherwise, mark the group id in source_security_group_id - isVPC := sg.VpcId != nil && *sg.VpcId != "" - if isVPC { - if *s.GroupId == *sg.GroupId { - d.Set("self", true) - // prune the self reference from the UserIdGroupPairs, so we don't - // have duplicate sg ids (both self and in source_security_group_id) - perm.UserIdGroupPairs = append(perm.UserIdGroupPairs[:0], perm.UserIdGroupPairs[0+1:]...) - } - } else { - if *s.GroupName == *sg.GroupName { - d.Set("self", true) - // prune the self reference from the UserIdGroupPairs, so we don't - // have duplicate sg ids (both self and in source_security_group_id) - perm.UserIdGroupPairs = append(perm.UserIdGroupPairs[:0], perm.UserIdGroupPairs[0+1:]...) - } - } - } - - if err := setFromIPPerm(d, sg, perm); err != nil { - return nil, errwrap.Wrapf("Error importing AWS Security Group: {{err}}", err) - } - - return d, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/network_acl_entry.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/network_acl_entry.go deleted file mode 100644 index c57f822..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/network_acl_entry.go +++ /dev/null @@ -1,141 +0,0 @@ -package aws - -import ( - "fmt" - "net" - "strconv" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" -) - -func expandNetworkAclEntries(configured []interface{}, entryType string) ([]*ec2.NetworkAclEntry, error) { - entries := make([]*ec2.NetworkAclEntry, 0, len(configured)) - for _, eRaw := range configured { - data := eRaw.(map[string]interface{}) - protocol := data["protocol"].(string) - p, err := strconv.Atoi(protocol) - if err != nil { - var ok bool - p, ok = protocolIntegers()[protocol] - if !ok { - return nil, fmt.Errorf("Invalid Protocol %s for rule %#v", protocol, data) - } - } - - e := &ec2.NetworkAclEntry{ - Protocol: aws.String(strconv.Itoa(p)), - PortRange: &ec2.PortRange{ - From: aws.Int64(int64(data["from_port"].(int))), - To: aws.Int64(int64(data["to_port"].(int))), - }, - Egress: aws.Bool(entryType == "egress"), - RuleAction: aws.String(data["action"].(string)), - RuleNumber: aws.Int64(int64(data["rule_no"].(int))), - } - - if v, ok := data["ipv6_cidr_block"]; ok { - e.Ipv6CidrBlock = aws.String(v.(string)) - } - - if v, ok := data["cidr_block"]; ok { - e.CidrBlock = aws.String(v.(string)) - } - - // Specify additional required fields for ICMP - if p == 1 { - e.IcmpTypeCode = &ec2.IcmpTypeCode{} - if v, ok := data["icmp_code"]; ok { - e.IcmpTypeCode.Code = aws.Int64(int64(v.(int))) - } - if v, ok := data["icmp_type"]; ok { - e.IcmpTypeCode.Type = aws.Int64(int64(v.(int))) - } - } - - entries = append(entries, e) - } - return entries, nil -} - -func flattenNetworkAclEntries(list []*ec2.NetworkAclEntry) []map[string]interface{} { - entries := make([]map[string]interface{}, 0, len(list)) - - for _, entry := range list { - - newEntry := map[string]interface{}{ - "from_port": *entry.PortRange.From, - "to_port": *entry.PortRange.To, - "action": *entry.RuleAction, - "rule_no": *entry.RuleNumber, - "protocol": *entry.Protocol, - } - - if entry.CidrBlock != nil { - newEntry["cidr_block"] = *entry.CidrBlock - } - - if entry.Ipv6CidrBlock != nil { - newEntry["ipv6_cidr_block"] = *entry.Ipv6CidrBlock - } - - entries = append(entries, newEntry) - } - - return entries - -} - -func protocolStrings(protocolIntegers map[string]int) map[int]string { - protocolStrings := make(map[int]string, len(protocolIntegers)) - for k, v := range protocolIntegers { - protocolStrings[v] = k - } - - return protocolStrings -} - -func protocolIntegers() map[string]int { - var protocolIntegers = make(map[string]int) - protocolIntegers = map[string]int{ - // defined at https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - "ah": 51, - "esp": 50, - "udp": 17, - "tcp": 6, - "icmp": 1, - "all": -1, - "vrrp": 112, - } - return protocolIntegers -} - -// expectedPortPair stores a pair of ports we expect to see together. -type expectedPortPair struct { - to_port int64 - from_port int64 -} - -// validatePorts ensures the ports and protocol match expected -// values. -func validatePorts(to int64, from int64, expected expectedPortPair) bool { - if to != expected.to_port || from != expected.from_port { - return false - } - - return true -} - -// validateCIDRBlock ensures the passed CIDR block represents an implied -// network, and not an overly-specified IP address. -func validateCIDRBlock(cidr string) error { - _, ipnet, err := net.ParseCIDR(cidr) - if err != nil { - return err - } - if ipnet.String() != cidr { - return fmt.Errorf("%s is not a valid mask; did you mean %s?", cidr, ipnet) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/opsworks_layers.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/opsworks_layers.go deleted file mode 100644 index c4bfeb6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/opsworks_layers.go +++ /dev/null @@ -1,645 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strconv" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/opsworks" -) - -// OpsWorks has a single concept of "layer" which represents several different -// layer types. The differences between these are in some extra properties that -// get packed into an "Attributes" map, but in the OpsWorks UI these are presented -// as first-class options, and so Terraform prefers to expose them this way and -// hide the implementation detail that they are all packed into a single type -// in the underlying API. -// -// This file contains utilities that are shared between all of the concrete -// layer resource types, which have names matching aws_opsworks_*_layer . - -type opsworksLayerTypeAttribute struct { - AttrName string - Type schema.ValueType - Default interface{} - Required bool - WriteOnly bool -} - -type opsworksLayerType struct { - TypeName string - DefaultLayerName string - Attributes map[string]*opsworksLayerTypeAttribute - CustomShortName bool -} - -var ( - opsworksTrueString = "true" - opsworksFalseString = "false" -) - -func (lt *opsworksLayerType) SchemaResource() *schema.Resource { - resourceSchema := map[string]*schema.Schema{ - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "auto_assign_elastic_ips": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "auto_assign_public_ips": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "custom_instance_profile_arn": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "elastic_load_balancer": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "custom_setup_recipes": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "custom_configure_recipes": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "custom_deploy_recipes": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "custom_undeploy_recipes": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "custom_shutdown_recipes": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "custom_security_group_ids": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "custom_json": &schema.Schema{ - Type: schema.TypeString, - StateFunc: normalizeJson, - Optional: true, - }, - - "auto_healing": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "install_updates_on_boot": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "instance_shutdown_timeout": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 120, - }, - - "drain_elb_on_shutdown": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "system_packages": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "stack_id": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - - "use_ebs_optimized_instances": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "ebs_volume": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - - "iops": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 0, - }, - - "mount_point": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "number_of_disks": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - - "raid_level": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "", - }, - - "size": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "standard", - }, - }, - }, - Set: func(v interface{}) int { - m := v.(map[string]interface{}) - return hashcode.String(m["mount_point"].(string)) - }, - }, - } - - if lt.CustomShortName { - resourceSchema["short_name"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - } - } - - if lt.DefaultLayerName != "" { - resourceSchema["name"] = &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: lt.DefaultLayerName, - } - } else { - resourceSchema["name"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - } - } - - for key, def := range lt.Attributes { - resourceSchema[key] = &schema.Schema{ - Type: def.Type, - Default: def.Default, - Required: def.Required, - Optional: !def.Required, - } - } - - return &schema.Resource{ - Read: func(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - return lt.Read(d, client) - }, - Create: func(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - return lt.Create(d, client) - }, - Update: func(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - return lt.Update(d, client) - }, - Delete: func(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - return lt.Delete(d, client) - }, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: resourceSchema, - } -} - -func (lt *opsworksLayerType) Read(d *schema.ResourceData, client *opsworks.OpsWorks) error { - - req := &opsworks.DescribeLayersInput{ - LayerIds: []*string{ - aws.String(d.Id()), - }, - } - - log.Printf("[DEBUG] Reading OpsWorks layer: %s", d.Id()) - - resp, err := client.DescribeLayers(req) - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "ResourceNotFoundException" { - d.SetId("") - return nil - } - } - return err - } - - layer := resp.Layers[0] - d.Set("id", layer.LayerId) - d.Set("auto_assign_elastic_ips", layer.AutoAssignElasticIps) - d.Set("auto_assign_public_ips", layer.AutoAssignPublicIps) - d.Set("custom_instance_profile_arn", layer.CustomInstanceProfileArn) - d.Set("custom_security_group_ids", flattenStringList(layer.CustomSecurityGroupIds)) - d.Set("auto_healing", layer.EnableAutoHealing) - d.Set("install_updates_on_boot", layer.InstallUpdatesOnBoot) - d.Set("name", layer.Name) - d.Set("system_packages", flattenStringList(layer.Packages)) - d.Set("stack_id", layer.StackId) - d.Set("use_ebs_optimized_instances", layer.UseEbsOptimizedInstances) - - if lt.CustomShortName { - d.Set("short_name", layer.Shortname) - } - - if v := layer.CustomJson; v == nil { - if err := d.Set("custom_json", ""); err != nil { - return err - } - } else if err := d.Set("custom_json", normalizeJson(*v)); err != nil { - return err - } - - lt.SetAttributeMap(d, layer.Attributes) - lt.SetLifecycleEventConfiguration(d, layer.LifecycleEventConfiguration) - lt.SetCustomRecipes(d, layer.CustomRecipes) - lt.SetVolumeConfigurations(d, layer.VolumeConfigurations) - - /* get ELB */ - ebsRequest := &opsworks.DescribeElasticLoadBalancersInput{ - LayerIds: []*string{ - aws.String(d.Id()), - }, - } - loadBalancers, err := client.DescribeElasticLoadBalancers(ebsRequest) - if err != nil { - return err - } - - if loadBalancers.ElasticLoadBalancers == nil || len(loadBalancers.ElasticLoadBalancers) == 0 { - d.Set("elastic_load_balancer", "") - } else { - loadBalancer := loadBalancers.ElasticLoadBalancers[0] - if loadBalancer != nil { - d.Set("elastic_load_balancer", loadBalancer.ElasticLoadBalancerName) - } - } - - return nil -} - -func (lt *opsworksLayerType) Create(d *schema.ResourceData, client *opsworks.OpsWorks) error { - - req := &opsworks.CreateLayerInput{ - AutoAssignElasticIps: aws.Bool(d.Get("auto_assign_elastic_ips").(bool)), - AutoAssignPublicIps: aws.Bool(d.Get("auto_assign_public_ips").(bool)), - CustomInstanceProfileArn: aws.String(d.Get("custom_instance_profile_arn").(string)), - CustomRecipes: lt.CustomRecipes(d), - CustomSecurityGroupIds: expandStringSet(d.Get("custom_security_group_ids").(*schema.Set)), - EnableAutoHealing: aws.Bool(d.Get("auto_healing").(bool)), - InstallUpdatesOnBoot: aws.Bool(d.Get("install_updates_on_boot").(bool)), - LifecycleEventConfiguration: lt.LifecycleEventConfiguration(d), - Name: aws.String(d.Get("name").(string)), - Packages: expandStringSet(d.Get("system_packages").(*schema.Set)), - Type: aws.String(lt.TypeName), - StackId: aws.String(d.Get("stack_id").(string)), - UseEbsOptimizedInstances: aws.Bool(d.Get("use_ebs_optimized_instances").(bool)), - Attributes: lt.AttributeMap(d), - VolumeConfigurations: lt.VolumeConfigurations(d), - } - - if lt.CustomShortName { - req.Shortname = aws.String(d.Get("short_name").(string)) - } else { - req.Shortname = aws.String(lt.TypeName) - } - - req.CustomJson = aws.String(d.Get("custom_json").(string)) - - log.Printf("[DEBUG] Creating OpsWorks layer: %s", d.Id()) - - resp, err := client.CreateLayer(req) - if err != nil { - return err - } - - layerId := *resp.LayerId - d.SetId(layerId) - d.Set("id", layerId) - - loadBalancer := aws.String(d.Get("elastic_load_balancer").(string)) - if loadBalancer != nil && *loadBalancer != "" { - log.Printf("[DEBUG] Attaching load balancer: %s", *loadBalancer) - _, err := client.AttachElasticLoadBalancer(&opsworks.AttachElasticLoadBalancerInput{ - ElasticLoadBalancerName: loadBalancer, - LayerId: &layerId, - }) - if err != nil { - return err - } - } - - return lt.Read(d, client) -} - -func (lt *opsworksLayerType) Update(d *schema.ResourceData, client *opsworks.OpsWorks) error { - - req := &opsworks.UpdateLayerInput{ - LayerId: aws.String(d.Id()), - AutoAssignElasticIps: aws.Bool(d.Get("auto_assign_elastic_ips").(bool)), - AutoAssignPublicIps: aws.Bool(d.Get("auto_assign_public_ips").(bool)), - CustomInstanceProfileArn: aws.String(d.Get("custom_instance_profile_arn").(string)), - CustomRecipes: lt.CustomRecipes(d), - CustomSecurityGroupIds: expandStringSet(d.Get("custom_security_group_ids").(*schema.Set)), - EnableAutoHealing: aws.Bool(d.Get("auto_healing").(bool)), - InstallUpdatesOnBoot: aws.Bool(d.Get("install_updates_on_boot").(bool)), - LifecycleEventConfiguration: lt.LifecycleEventConfiguration(d), - Name: aws.String(d.Get("name").(string)), - Packages: expandStringSet(d.Get("system_packages").(*schema.Set)), - UseEbsOptimizedInstances: aws.Bool(d.Get("use_ebs_optimized_instances").(bool)), - Attributes: lt.AttributeMap(d), - VolumeConfigurations: lt.VolumeConfigurations(d), - } - - if lt.CustomShortName { - req.Shortname = aws.String(d.Get("short_name").(string)) - } else { - req.Shortname = aws.String(lt.TypeName) - } - - req.CustomJson = aws.String(d.Get("custom_json").(string)) - - log.Printf("[DEBUG] Updating OpsWorks layer: %s", d.Id()) - - if d.HasChange("elastic_load_balancer") { - lbo, lbn := d.GetChange("elastic_load_balancer") - - loadBalancerOld := aws.String(lbo.(string)) - loadBalancerNew := aws.String(lbn.(string)) - - if loadBalancerOld != nil && *loadBalancerOld != "" { - log.Printf("[DEBUG] Dettaching load balancer: %s", *loadBalancerOld) - _, err := client.DetachElasticLoadBalancer(&opsworks.DetachElasticLoadBalancerInput{ - ElasticLoadBalancerName: loadBalancerOld, - LayerId: aws.String(d.Id()), - }) - if err != nil { - return err - } - } - - if loadBalancerNew != nil && *loadBalancerNew != "" { - log.Printf("[DEBUG] Attaching load balancer: %s", *loadBalancerNew) - _, err := client.AttachElasticLoadBalancer(&opsworks.AttachElasticLoadBalancerInput{ - ElasticLoadBalancerName: loadBalancerNew, - LayerId: aws.String(d.Id()), - }) - if err != nil { - return err - } - } - } - - _, err := client.UpdateLayer(req) - if err != nil { - return err - } - - return lt.Read(d, client) -} - -func (lt *opsworksLayerType) Delete(d *schema.ResourceData, client *opsworks.OpsWorks) error { - req := &opsworks.DeleteLayerInput{ - LayerId: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Deleting OpsWorks layer: %s", d.Id()) - - _, err := client.DeleteLayer(req) - return err -} - -func (lt *opsworksLayerType) AttributeMap(d *schema.ResourceData) map[string]*string { - attrs := map[string]*string{} - - for key, def := range lt.Attributes { - value := d.Get(key) - switch def.Type { - case schema.TypeString: - strValue := value.(string) - attrs[def.AttrName] = &strValue - case schema.TypeInt: - intValue := value.(int) - strValue := strconv.Itoa(intValue) - attrs[def.AttrName] = &strValue - case schema.TypeBool: - boolValue := value.(bool) - if boolValue { - attrs[def.AttrName] = &opsworksTrueString - } else { - attrs[def.AttrName] = &opsworksFalseString - } - default: - // should never happen - panic(fmt.Errorf("Unsupported OpsWorks layer attribute type")) - } - } - - return attrs -} - -func (lt *opsworksLayerType) SetAttributeMap(d *schema.ResourceData, attrs map[string]*string) { - for key, def := range lt.Attributes { - // Ignore write-only attributes; we'll just keep what we already have stored. - // (The AWS API returns garbage placeholder values for these.) - if def.WriteOnly { - continue - } - - if strPtr, ok := attrs[def.AttrName]; ok && strPtr != nil { - strValue := *strPtr - - switch def.Type { - case schema.TypeString: - d.Set(key, strValue) - case schema.TypeInt: - intValue, err := strconv.Atoi(strValue) - if err == nil { - d.Set(key, intValue) - } else { - // Got garbage from the AWS API - d.Set(key, nil) - } - case schema.TypeBool: - boolValue := true - if strValue == opsworksFalseString { - boolValue = false - } - d.Set(key, boolValue) - default: - // should never happen - panic(fmt.Errorf("Unsupported OpsWorks layer attribute type")) - } - return - - } else { - d.Set(key, nil) - } - } -} - -func (lt *opsworksLayerType) LifecycleEventConfiguration(d *schema.ResourceData) *opsworks.LifecycleEventConfiguration { - return &opsworks.LifecycleEventConfiguration{ - Shutdown: &opsworks.ShutdownEventConfiguration{ - DelayUntilElbConnectionsDrained: aws.Bool(d.Get("drain_elb_on_shutdown").(bool)), - ExecutionTimeout: aws.Int64(int64(d.Get("instance_shutdown_timeout").(int))), - }, - } -} - -func (lt *opsworksLayerType) SetLifecycleEventConfiguration(d *schema.ResourceData, v *opsworks.LifecycleEventConfiguration) { - if v == nil || v.Shutdown == nil { - d.Set("drain_elb_on_shutdown", nil) - d.Set("instance_shutdown_timeout", nil) - } else { - d.Set("drain_elb_on_shutdown", v.Shutdown.DelayUntilElbConnectionsDrained) - d.Set("instance_shutdown_timeout", v.Shutdown.ExecutionTimeout) - } -} - -func (lt *opsworksLayerType) CustomRecipes(d *schema.ResourceData) *opsworks.Recipes { - return &opsworks.Recipes{ - Configure: expandStringList(d.Get("custom_configure_recipes").([]interface{})), - Deploy: expandStringList(d.Get("custom_deploy_recipes").([]interface{})), - Setup: expandStringList(d.Get("custom_setup_recipes").([]interface{})), - Shutdown: expandStringList(d.Get("custom_shutdown_recipes").([]interface{})), - Undeploy: expandStringList(d.Get("custom_undeploy_recipes").([]interface{})), - } -} - -func (lt *opsworksLayerType) SetCustomRecipes(d *schema.ResourceData, v *opsworks.Recipes) { - // Null out everything first, and then we'll consider what to put back. - d.Set("custom_configure_recipes", nil) - d.Set("custom_deploy_recipes", nil) - d.Set("custom_setup_recipes", nil) - d.Set("custom_shutdown_recipes", nil) - d.Set("custom_undeploy_recipes", nil) - - if v == nil { - return - } - - d.Set("custom_configure_recipes", flattenStringList(v.Configure)) - d.Set("custom_deploy_recipes", flattenStringList(v.Deploy)) - d.Set("custom_setup_recipes", flattenStringList(v.Setup)) - d.Set("custom_shutdown_recipes", flattenStringList(v.Shutdown)) - d.Set("custom_undeploy_recipes", flattenStringList(v.Undeploy)) -} - -func (lt *opsworksLayerType) VolumeConfigurations(d *schema.ResourceData) []*opsworks.VolumeConfiguration { - configuredVolumes := d.Get("ebs_volume").(*schema.Set).List() - result := make([]*opsworks.VolumeConfiguration, len(configuredVolumes)) - - for i := 0; i < len(configuredVolumes); i++ { - volumeData := configuredVolumes[i].(map[string]interface{}) - - result[i] = &opsworks.VolumeConfiguration{ - MountPoint: aws.String(volumeData["mount_point"].(string)), - NumberOfDisks: aws.Int64(int64(volumeData["number_of_disks"].(int))), - Size: aws.Int64(int64(volumeData["size"].(int))), - VolumeType: aws.String(volumeData["type"].(string)), - } - iops := int64(volumeData["iops"].(int)) - if iops != 0 { - result[i].Iops = aws.Int64(iops) - } - - raidLevelStr := volumeData["raid_level"].(string) - if raidLevelStr != "" { - raidLevel, err := strconv.Atoi(raidLevelStr) - if err == nil { - result[i].RaidLevel = aws.Int64(int64(raidLevel)) - } - } - } - - return result -} - -func (lt *opsworksLayerType) SetVolumeConfigurations(d *schema.ResourceData, v []*opsworks.VolumeConfiguration) { - newValue := make([]*map[string]interface{}, len(v)) - - for i := 0; i < len(v); i++ { - config := v[i] - data := make(map[string]interface{}) - newValue[i] = &data - - if config.Iops != nil { - data["iops"] = int(*config.Iops) - } else { - data["iops"] = 0 - } - if config.MountPoint != nil { - data["mount_point"] = *config.MountPoint - } - if config.NumberOfDisks != nil { - data["number_of_disks"] = int(*config.NumberOfDisks) - } - if config.RaidLevel != nil { - data["raid_level"] = strconv.Itoa(int(*config.RaidLevel)) - } - if config.Size != nil { - data["size"] = int(*config.Size) - } - if config.VolumeType != nil { - data["type"] = *config.VolumeType - } - } - - d.Set("ebs_volume", newValue) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/provider.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/provider.go deleted file mode 100644 index 30c56fa..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/provider.go +++ /dev/null @@ -1,677 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/mutexkv" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/terraform" -) - -// Provider returns a terraform.ResourceProvider. -func Provider() terraform.ResourceProvider { - // TODO: Move the validation to this, requires conditional schemas - // TODO: Move the configuration to this, requires validation - - // The actual provider - return &schema.Provider{ - Schema: map[string]*schema.Schema{ - "access_key": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["access_key"], - }, - - "secret_key": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["secret_key"], - }, - - "profile": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["profile"], - }, - - "assume_role": assumeRoleSchema(), - - "shared_credentials_file": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["shared_credentials_file"], - }, - - "token": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["token"], - }, - - "region": { - Type: schema.TypeString, - Required: true, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "AWS_REGION", - "AWS_DEFAULT_REGION", - }, nil), - Description: descriptions["region"], - InputDefault: "us-east-1", - }, - - "max_retries": { - Type: schema.TypeInt, - Optional: true, - Default: 11, - Description: descriptions["max_retries"], - }, - - "allowed_account_ids": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - ConflictsWith: []string{"forbidden_account_ids"}, - Set: schema.HashString, - }, - - "forbidden_account_ids": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - ConflictsWith: []string{"allowed_account_ids"}, - Set: schema.HashString, - }, - - "dynamodb_endpoint": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["dynamodb_endpoint"], - Removed: "Use `dynamodb` inside `endpoints` block instead", - }, - - "kinesis_endpoint": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["kinesis_endpoint"], - Removed: "Use `kinesis` inside `endpoints` block instead", - }, - - "endpoints": endpointsSchema(), - - "insecure": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: descriptions["insecure"], - }, - - "skip_credentials_validation": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: descriptions["skip_credentials_validation"], - }, - - "skip_region_validation": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: descriptions["skip_region_validation"], - }, - - "skip_requesting_account_id": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: descriptions["skip_requesting_account_id"], - }, - - "skip_metadata_api_check": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: descriptions["skip_metadata_api_check"], - }, - - "s3_force_path_style": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: descriptions["s3_force_path_style"], - }, - }, - - DataSourcesMap: map[string]*schema.Resource{ - "aws_acm_certificate": dataSourceAwsAcmCertificate(), - "aws_alb": dataSourceAwsAlb(), - "aws_alb_listener": dataSourceAwsAlbListener(), - "aws_ami": dataSourceAwsAmi(), - "aws_autoscaling_groups": dataSourceAwsAutoscalingGroups(), - "aws_availability_zone": dataSourceAwsAvailabilityZone(), - "aws_availability_zones": dataSourceAwsAvailabilityZones(), - "aws_billing_service_account": dataSourceAwsBillingServiceAccount(), - "aws_caller_identity": dataSourceAwsCallerIdentity(), - "aws_canonical_user_id": dataSourceAwsCanonicalUserId(), - "aws_cloudformation_stack": dataSourceAwsCloudFormationStack(), - "aws_db_instance": dataSourceAwsDbInstance(), - "aws_ebs_snapshot": dataSourceAwsEbsSnapshot(), - "aws_ebs_volume": dataSourceAwsEbsVolume(), - "aws_ecs_cluster": dataSourceAwsEcsCluster(), - "aws_ecs_container_definition": dataSourceAwsEcsContainerDefinition(), - "aws_ecs_task_definition": dataSourceAwsEcsTaskDefinition(), - "aws_eip": dataSourceAwsEip(), - "aws_elb_hosted_zone_id": dataSourceAwsElbHostedZoneId(), - "aws_elb_service_account": dataSourceAwsElbServiceAccount(), - "aws_iam_account_alias": dataSourceAwsIamAccountAlias(), - "aws_iam_policy_document": dataSourceAwsIamPolicyDocument(), - "aws_iam_server_certificate": dataSourceAwsIAMServerCertificate(), - "aws_instance": dataSourceAwsInstance(), - "aws_ip_ranges": dataSourceAwsIPRanges(), - "aws_kms_secret": dataSourceAwsKmsSecret(), - "aws_partition": dataSourceAwsPartition(), - "aws_prefix_list": dataSourceAwsPrefixList(), - "aws_redshift_service_account": dataSourceAwsRedshiftServiceAccount(), - "aws_region": dataSourceAwsRegion(), - "aws_route_table": dataSourceAwsRouteTable(), - "aws_route53_zone": dataSourceAwsRoute53Zone(), - "aws_s3_bucket_object": dataSourceAwsS3BucketObject(), - "aws_sns_topic": dataSourceAwsSnsTopic(), - "aws_subnet": dataSourceAwsSubnet(), - "aws_security_group": dataSourceAwsSecurityGroup(), - "aws_vpc": dataSourceAwsVpc(), - "aws_vpc_endpoint": dataSourceAwsVpcEndpoint(), - "aws_vpc_endpoint_service": dataSourceAwsVpcEndpointService(), - "aws_vpc_peering_connection": dataSourceAwsVpcPeeringConnection(), - "aws_vpn_gateway": dataSourceAwsVpnGateway(), - }, - - ResourcesMap: map[string]*schema.Resource{ - "aws_alb": resourceAwsAlb(), - "aws_alb_listener": resourceAwsAlbListener(), - "aws_alb_listener_rule": resourceAwsAlbListenerRule(), - "aws_alb_target_group": resourceAwsAlbTargetGroup(), - "aws_alb_target_group_attachment": resourceAwsAlbTargetGroupAttachment(), - "aws_ami": resourceAwsAmi(), - "aws_ami_copy": resourceAwsAmiCopy(), - "aws_ami_from_instance": resourceAwsAmiFromInstance(), - "aws_ami_launch_permission": resourceAwsAmiLaunchPermission(), - "aws_api_gateway_account": resourceAwsApiGatewayAccount(), - "aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(), - "aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(), - "aws_api_gateway_base_path_mapping": resourceAwsApiGatewayBasePathMapping(), - "aws_api_gateway_client_certificate": resourceAwsApiGatewayClientCertificate(), - "aws_api_gateway_deployment": resourceAwsApiGatewayDeployment(), - "aws_api_gateway_domain_name": resourceAwsApiGatewayDomainName(), - "aws_api_gateway_integration": resourceAwsApiGatewayIntegration(), - "aws_api_gateway_integration_response": resourceAwsApiGatewayIntegrationResponse(), - "aws_api_gateway_method": resourceAwsApiGatewayMethod(), - "aws_api_gateway_method_response": resourceAwsApiGatewayMethodResponse(), - "aws_api_gateway_model": resourceAwsApiGatewayModel(), - "aws_api_gateway_resource": resourceAwsApiGatewayResource(), - "aws_api_gateway_rest_api": resourceAwsApiGatewayRestApi(), - "aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(), - "aws_appautoscaling_target": resourceAwsAppautoscalingTarget(), - "aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(), - "aws_autoscaling_attachment": resourceAwsAutoscalingAttachment(), - "aws_autoscaling_group": resourceAwsAutoscalingGroup(), - "aws_autoscaling_notification": resourceAwsAutoscalingNotification(), - "aws_autoscaling_policy": resourceAwsAutoscalingPolicy(), - "aws_autoscaling_schedule": resourceAwsAutoscalingSchedule(), - "aws_cloudformation_stack": resourceAwsCloudFormationStack(), - "aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(), - "aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(), - "aws_cloudtrail": resourceAwsCloudTrail(), - "aws_cloudwatch_event_rule": resourceAwsCloudWatchEventRule(), - "aws_cloudwatch_event_target": resourceAwsCloudWatchEventTarget(), - "aws_cloudwatch_log_destination": resourceAwsCloudWatchLogDestination(), - "aws_cloudwatch_log_destination_policy": resourceAwsCloudWatchLogDestinationPolicy(), - "aws_cloudwatch_log_group": resourceAwsCloudWatchLogGroup(), - "aws_cloudwatch_log_metric_filter": resourceAwsCloudWatchLogMetricFilter(), - "aws_cloudwatch_log_stream": resourceAwsCloudWatchLogStream(), - "aws_cloudwatch_log_subscription_filter": resourceAwsCloudwatchLogSubscriptionFilter(), - "aws_config_config_rule": resourceAwsConfigConfigRule(), - "aws_config_configuration_recorder": resourceAwsConfigConfigurationRecorder(), - "aws_config_configuration_recorder_status": resourceAwsConfigConfigurationRecorderStatus(), - "aws_config_delivery_channel": resourceAwsConfigDeliveryChannel(), - "aws_autoscaling_lifecycle_hook": resourceAwsAutoscalingLifecycleHook(), - "aws_cloudwatch_metric_alarm": resourceAwsCloudWatchMetricAlarm(), - "aws_codedeploy_app": resourceAwsCodeDeployApp(), - "aws_codedeploy_deployment_config": resourceAwsCodeDeployDeploymentConfig(), - "aws_codedeploy_deployment_group": resourceAwsCodeDeployDeploymentGroup(), - "aws_codecommit_repository": resourceAwsCodeCommitRepository(), - "aws_codecommit_trigger": resourceAwsCodeCommitTrigger(), - "aws_codebuild_project": resourceAwsCodeBuildProject(), - "aws_codepipeline": resourceAwsCodePipeline(), - "aws_customer_gateway": resourceAwsCustomerGateway(), - "aws_db_event_subscription": resourceAwsDbEventSubscription(), - "aws_db_instance": resourceAwsDbInstance(), - "aws_db_option_group": resourceAwsDbOptionGroup(), - "aws_db_parameter_group": resourceAwsDbParameterGroup(), - "aws_db_security_group": resourceAwsDbSecurityGroup(), - "aws_db_subnet_group": resourceAwsDbSubnetGroup(), - "aws_directory_service_directory": resourceAwsDirectoryServiceDirectory(), - "aws_dms_certificate": resourceAwsDmsCertificate(), - "aws_dms_endpoint": resourceAwsDmsEndpoint(), - "aws_dms_replication_instance": resourceAwsDmsReplicationInstance(), - "aws_dms_replication_subnet_group": resourceAwsDmsReplicationSubnetGroup(), - "aws_dms_replication_task": resourceAwsDmsReplicationTask(), - "aws_dynamodb_table": resourceAwsDynamoDbTable(), - "aws_ebs_snapshot": resourceAwsEbsSnapshot(), - "aws_ebs_volume": resourceAwsEbsVolume(), - "aws_ecr_repository": resourceAwsEcrRepository(), - "aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(), - "aws_ecs_cluster": resourceAwsEcsCluster(), - "aws_ecs_service": resourceAwsEcsService(), - "aws_ecs_task_definition": resourceAwsEcsTaskDefinition(), - "aws_efs_file_system": resourceAwsEfsFileSystem(), - "aws_efs_mount_target": resourceAwsEfsMountTarget(), - "aws_egress_only_internet_gateway": resourceAwsEgressOnlyInternetGateway(), - "aws_eip": resourceAwsEip(), - "aws_eip_association": resourceAwsEipAssociation(), - "aws_elasticache_cluster": resourceAwsElasticacheCluster(), - "aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(), - "aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(), - "aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(), - "aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(), - "aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(), - "aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(), - "aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(), - "aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(), - "aws_elasticsearch_domain": resourceAwsElasticSearchDomain(), - "aws_elasticsearch_domain_policy": resourceAwsElasticSearchDomainPolicy(), - "aws_elastictranscoder_pipeline": resourceAwsElasticTranscoderPipeline(), - "aws_elastictranscoder_preset": resourceAwsElasticTranscoderPreset(), - "aws_elb": resourceAwsElb(), - "aws_elb_attachment": resourceAwsElbAttachment(), - "aws_emr_cluster": resourceAwsEMRCluster(), - "aws_emr_instance_group": resourceAwsEMRInstanceGroup(), - "aws_flow_log": resourceAwsFlowLog(), - "aws_glacier_vault": resourceAwsGlacierVault(), - "aws_iam_access_key": resourceAwsIamAccessKey(), - "aws_iam_account_alias": resourceAwsIamAccountAlias(), - "aws_iam_account_password_policy": resourceAwsIamAccountPasswordPolicy(), - "aws_iam_group_policy": resourceAwsIamGroupPolicy(), - "aws_iam_group": resourceAwsIamGroup(), - "aws_iam_group_membership": resourceAwsIamGroupMembership(), - "aws_iam_group_policy_attachment": resourceAwsIamGroupPolicyAttachment(), - "aws_iam_instance_profile": resourceAwsIamInstanceProfile(), - "aws_iam_policy": resourceAwsIamPolicy(), - "aws_iam_policy_attachment": resourceAwsIamPolicyAttachment(), - "aws_iam_role_policy_attachment": resourceAwsIamRolePolicyAttachment(), - "aws_iam_role_policy": resourceAwsIamRolePolicy(), - "aws_iam_role": resourceAwsIamRole(), - "aws_iam_saml_provider": resourceAwsIamSamlProvider(), - "aws_iam_server_certificate": resourceAwsIAMServerCertificate(), - "aws_iam_user_policy_attachment": resourceAwsIamUserPolicyAttachment(), - "aws_iam_user_policy": resourceAwsIamUserPolicy(), - "aws_iam_user_ssh_key": resourceAwsIamUserSshKey(), - "aws_iam_user": resourceAwsIamUser(), - "aws_iam_user_login_profile": resourceAwsIamUserLoginProfile(), - "aws_inspector_assessment_target": resourceAWSInspectorAssessmentTarget(), - "aws_inspector_assessment_template": resourceAWSInspectorAssessmentTemplate(), - "aws_inspector_resource_group": resourceAWSInspectorResourceGroup(), - "aws_instance": resourceAwsInstance(), - "aws_internet_gateway": resourceAwsInternetGateway(), - "aws_key_pair": resourceAwsKeyPair(), - "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), - "aws_kinesis_stream": resourceAwsKinesisStream(), - "aws_kms_alias": resourceAwsKmsAlias(), - "aws_kms_key": resourceAwsKmsKey(), - "aws_lambda_function": resourceAwsLambdaFunction(), - "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), - "aws_lambda_alias": resourceAwsLambdaAlias(), - "aws_lambda_permission": resourceAwsLambdaPermission(), - "aws_launch_configuration": resourceAwsLaunchConfiguration(), - "aws_lightsail_domain": resourceAwsLightsailDomain(), - "aws_lightsail_instance": resourceAwsLightsailInstance(), - "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), - "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), - "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), - "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), - "aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(), - "aws_lb_ssl_negotiation_policy": resourceAwsLBSSLNegotiationPolicy(), - "aws_main_route_table_association": resourceAwsMainRouteTableAssociation(), - "aws_nat_gateway": resourceAwsNatGateway(), - "aws_network_acl": resourceAwsNetworkAcl(), - "aws_default_network_acl": resourceAwsDefaultNetworkAcl(), - "aws_default_route_table": resourceAwsDefaultRouteTable(), - "aws_network_acl_rule": resourceAwsNetworkAclRule(), - "aws_network_interface": resourceAwsNetworkInterface(), - "aws_opsworks_application": resourceAwsOpsworksApplication(), - "aws_opsworks_stack": resourceAwsOpsworksStack(), - "aws_opsworks_java_app_layer": resourceAwsOpsworksJavaAppLayer(), - "aws_opsworks_haproxy_layer": resourceAwsOpsworksHaproxyLayer(), - "aws_opsworks_static_web_layer": resourceAwsOpsworksStaticWebLayer(), - "aws_opsworks_php_app_layer": resourceAwsOpsworksPhpAppLayer(), - "aws_opsworks_rails_app_layer": resourceAwsOpsworksRailsAppLayer(), - "aws_opsworks_nodejs_app_layer": resourceAwsOpsworksNodejsAppLayer(), - "aws_opsworks_memcached_layer": resourceAwsOpsworksMemcachedLayer(), - "aws_opsworks_mysql_layer": resourceAwsOpsworksMysqlLayer(), - "aws_opsworks_ganglia_layer": resourceAwsOpsworksGangliaLayer(), - "aws_opsworks_custom_layer": resourceAwsOpsworksCustomLayer(), - "aws_opsworks_instance": resourceAwsOpsworksInstance(), - "aws_opsworks_user_profile": resourceAwsOpsworksUserProfile(), - "aws_opsworks_permission": resourceAwsOpsworksPermission(), - "aws_opsworks_rds_db_instance": resourceAwsOpsworksRdsDbInstance(), - "aws_placement_group": resourceAwsPlacementGroup(), - "aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(), - "aws_rds_cluster": resourceAwsRDSCluster(), - "aws_rds_cluster_instance": resourceAwsRDSClusterInstance(), - "aws_rds_cluster_parameter_group": resourceAwsRDSClusterParameterGroup(), - "aws_redshift_cluster": resourceAwsRedshiftCluster(), - "aws_redshift_security_group": resourceAwsRedshiftSecurityGroup(), - "aws_redshift_parameter_group": resourceAwsRedshiftParameterGroup(), - "aws_redshift_subnet_group": resourceAwsRedshiftSubnetGroup(), - "aws_route53_delegation_set": resourceAwsRoute53DelegationSet(), - "aws_route53_record": resourceAwsRoute53Record(), - "aws_route53_zone_association": resourceAwsRoute53ZoneAssociation(), - "aws_route53_zone": resourceAwsRoute53Zone(), - "aws_route53_health_check": resourceAwsRoute53HealthCheck(), - "aws_route": resourceAwsRoute(), - "aws_route_table": resourceAwsRouteTable(), - "aws_route_table_association": resourceAwsRouteTableAssociation(), - "aws_ses_active_receipt_rule_set": resourceAwsSesActiveReceiptRuleSet(), - "aws_ses_receipt_filter": resourceAwsSesReceiptFilter(), - "aws_ses_receipt_rule": resourceAwsSesReceiptRule(), - "aws_ses_receipt_rule_set": resourceAwsSesReceiptRuleSet(), - "aws_ses_configuration_set": resourceAwsSesConfigurationSet(), - "aws_ses_event_destination": resourceAwsSesEventDestination(), - "aws_s3_bucket": resourceAwsS3Bucket(), - "aws_s3_bucket_policy": resourceAwsS3BucketPolicy(), - "aws_s3_bucket_object": resourceAwsS3BucketObject(), - "aws_s3_bucket_notification": resourceAwsS3BucketNotification(), - "aws_default_security_group": resourceAwsDefaultSecurityGroup(), - "aws_security_group": resourceAwsSecurityGroup(), - "aws_security_group_rule": resourceAwsSecurityGroupRule(), - "aws_simpledb_domain": resourceAwsSimpleDBDomain(), - "aws_ssm_activation": resourceAwsSsmActivation(), - "aws_ssm_association": resourceAwsSsmAssociation(), - "aws_ssm_document": resourceAwsSsmDocument(), - "aws_spot_datafeed_subscription": resourceAwsSpotDataFeedSubscription(), - "aws_spot_instance_request": resourceAwsSpotInstanceRequest(), - "aws_spot_fleet_request": resourceAwsSpotFleetRequest(), - "aws_sqs_queue": resourceAwsSqsQueue(), - "aws_sqs_queue_policy": resourceAwsSqsQueuePolicy(), - "aws_snapshot_create_volume_permission": resourceAwsSnapshotCreateVolumePermission(), - "aws_sns_topic": resourceAwsSnsTopic(), - "aws_sns_topic_policy": resourceAwsSnsTopicPolicy(), - "aws_sns_topic_subscription": resourceAwsSnsTopicSubscription(), - "aws_sfn_activity": resourceAwsSfnActivity(), - "aws_sfn_state_machine": resourceAwsSfnStateMachine(), - "aws_subnet": resourceAwsSubnet(), - "aws_volume_attachment": resourceAwsVolumeAttachment(), - "aws_vpc_dhcp_options_association": resourceAwsVpcDhcpOptionsAssociation(), - "aws_vpc_dhcp_options": resourceAwsVpcDhcpOptions(), - "aws_vpc_peering_connection": resourceAwsVpcPeeringConnection(), - "aws_vpc_peering_connection_accepter": resourceAwsVpcPeeringConnectionAccepter(), - "aws_vpc": resourceAwsVpc(), - "aws_vpc_endpoint": resourceAwsVpcEndpoint(), - "aws_vpc_endpoint_route_table_association": resourceAwsVpcEndpointRouteTableAssociation(), - "aws_vpn_connection": resourceAwsVpnConnection(), - "aws_vpn_connection_route": resourceAwsVpnConnectionRoute(), - "aws_vpn_gateway": resourceAwsVpnGateway(), - "aws_vpn_gateway_attachment": resourceAwsVpnGatewayAttachment(), - "aws_waf_byte_match_set": resourceAwsWafByteMatchSet(), - "aws_waf_ipset": resourceAwsWafIPSet(), - "aws_waf_rule": resourceAwsWafRule(), - "aws_waf_size_constraint_set": resourceAwsWafSizeConstraintSet(), - "aws_waf_web_acl": resourceAwsWafWebAcl(), - "aws_waf_xss_match_set": resourceAwsWafXssMatchSet(), - "aws_waf_sql_injection_match_set": resourceAwsWafSqlInjectionMatchSet(), - }, - ConfigureFunc: providerConfigure, - } -} - -var descriptions map[string]string - -func init() { - descriptions = map[string]string{ - "region": "The region where AWS operations will take place. Examples\n" + - "are us-east-1, us-west-2, etc.", - - "access_key": "The access key for API operations. You can retrieve this\n" + - "from the 'Security & Credentials' section of the AWS console.", - - "secret_key": "The secret key for API operations. You can retrieve this\n" + - "from the 'Security & Credentials' section of the AWS console.", - - "profile": "The profile for API operations. If not set, the default profile\n" + - "created with `aws configure` will be used.", - - "shared_credentials_file": "The path to the shared credentials file. If not set\n" + - "this defaults to ~/.aws/credentials.", - - "token": "session token. A session token is only required if you are\n" + - "using temporary security credentials.", - - "max_retries": "The maximum number of times an AWS API request is\n" + - "being executed. If the API request still fails, an error is\n" + - "thrown.", - - "dynamodb_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n" + - "It's typically used to connect to dynamodb-local.", - - "kinesis_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n" + - "It's typically used to connect to kinesalite.", - - "iam_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", - - "ec2_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", - - "elb_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", - - "s3_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", - - "insecure": "Explicitly allow the provider to perform \"insecure\" SSL requests. If omitted," + - "default value is `false`", - - "skip_credentials_validation": "Skip the credentials validation via STS API. " + - "Used for AWS API implementations that do not have STS available/implemented.", - - "skip_region_validation": "Skip static validation of region name. " + - "Used by users of alternative AWS-like APIs or users w/ access to regions that are not public (yet).", - - "skip_requesting_account_id": "Skip requesting the account ID. " + - "Used for AWS API implementations that do not have IAM/STS API and/or metadata API.", - - "skip_medatadata_api_check": "Skip the AWS Metadata API check. " + - "Used for AWS API implementations that do not have a metadata api endpoint.", - - "s3_force_path_style": "Set this to true to force the request to use path-style addressing,\n" + - "i.e., http://s3.amazonaws.com/BUCKET/KEY. By default, the S3 client will\n" + - "use virtual hosted bucket addressing when possible\n" + - "(http://BUCKET.s3.amazonaws.com/KEY). Specific to the Amazon S3 service.", - - "assume_role_role_arn": "The ARN of an IAM role to assume prior to making API calls.", - - "assume_role_session_name": "The session name to use when assuming the role. If omitted," + - " no session name is passed to the AssumeRole call.", - - "assume_role_external_id": "The external ID to use when assuming the role. If omitted," + - " no external ID is passed to the AssumeRole call.", - - "assume_role_policy": "The permissions applied when assuming a role. You cannot use," + - " this policy to grant further permissions that are in excess to those of the, " + - " role that is being assumed.", - } -} - -func providerConfigure(d *schema.ResourceData) (interface{}, error) { - config := Config{ - AccessKey: d.Get("access_key").(string), - SecretKey: d.Get("secret_key").(string), - Profile: d.Get("profile").(string), - CredsFilename: d.Get("shared_credentials_file").(string), - Token: d.Get("token").(string), - Region: d.Get("region").(string), - MaxRetries: d.Get("max_retries").(int), - Insecure: d.Get("insecure").(bool), - SkipCredsValidation: d.Get("skip_credentials_validation").(bool), - SkipRegionValidation: d.Get("skip_region_validation").(bool), - SkipRequestingAccountId: d.Get("skip_requesting_account_id").(bool), - SkipMetadataApiCheck: d.Get("skip_metadata_api_check").(bool), - S3ForcePathStyle: d.Get("s3_force_path_style").(bool), - } - - assumeRoleList := d.Get("assume_role").(*schema.Set).List() - if len(assumeRoleList) == 1 { - assumeRole := assumeRoleList[0].(map[string]interface{}) - config.AssumeRoleARN = assumeRole["role_arn"].(string) - config.AssumeRoleSessionName = assumeRole["session_name"].(string) - config.AssumeRoleExternalID = assumeRole["external_id"].(string) - - if v := assumeRole["policy"].(string); v != "" { - config.AssumeRolePolicy = v - } - - log.Printf("[INFO] assume_role configuration set: (ARN: %q, SessionID: %q, ExternalID: %q, Policy: %q)", - config.AssumeRoleARN, config.AssumeRoleSessionName, config.AssumeRoleExternalID, config.AssumeRolePolicy) - } else { - log.Printf("[INFO] No assume_role block read from configuration") - } - - endpointsSet := d.Get("endpoints").(*schema.Set) - - for _, endpointsSetI := range endpointsSet.List() { - endpoints := endpointsSetI.(map[string]interface{}) - config.DynamoDBEndpoint = endpoints["dynamodb"].(string) - config.IamEndpoint = endpoints["iam"].(string) - config.Ec2Endpoint = endpoints["ec2"].(string) - config.ElbEndpoint = endpoints["elb"].(string) - config.KinesisEndpoint = endpoints["kinesis"].(string) - config.S3Endpoint = endpoints["s3"].(string) - } - - if v, ok := d.GetOk("allowed_account_ids"); ok { - config.AllowedAccountIds = v.(*schema.Set).List() - } - - if v, ok := d.GetOk("forbidden_account_ids"); ok { - config.ForbiddenAccountIds = v.(*schema.Set).List() - } - - return config.Client() -} - -// This is a global MutexKV for use within this plugin. -var awsMutexKV = mutexkv.NewMutexKV() - -func assumeRoleSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "role_arn": { - Type: schema.TypeString, - Optional: true, - Description: descriptions["assume_role_role_arn"], - }, - - "session_name": { - Type: schema.TypeString, - Optional: true, - Description: descriptions["assume_role_session_name"], - }, - - "external_id": { - Type: schema.TypeString, - Optional: true, - Description: descriptions["assume_role_external_id"], - }, - - "policy": { - Type: schema.TypeString, - Optional: true, - Description: descriptions["assume_role_policy"], - }, - }, - }, - Set: assumeRoleToHash, - } -} - -func assumeRoleToHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["role_arn"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["session_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["external_id"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["policy"].(string))) - return hashcode.String(buf.String()) -} - -func endpointsSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "dynamodb": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["dynamodb_endpoint"], - }, - "iam": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["iam_endpoint"], - }, - - "ec2": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["ec2_endpoint"], - }, - - "elb": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["elb_endpoint"], - }, - "kinesis": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["kinesis_endpoint"], - }, - "s3": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: descriptions["s3_endpoint"], - }, - }, - }, - Set: endpointsToHash, - } -} - -func endpointsToHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["dynamodb"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["iam"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["ec2"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["elb"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["kinesis"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["s3"].(string))) - - return hashcode.String(buf.String()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb.go deleted file mode 100644 index 0efe456..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb.go +++ /dev/null @@ -1,423 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAlb() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAlbCreate, - Read: resourceAwsAlbRead, - Update: resourceAwsAlbUpdate, - Delete: resourceAwsAlbDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "arn_suffix": { - Type: schema.TypeString, - Computed: true, - }, - - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: validateElbName, - }, - - "name_prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validateElbName, - }, - - "internal": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "security_groups": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, - Optional: true, - Set: schema.HashString, - }, - - "subnets": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - ForceNew: true, - Required: true, - Set: schema.HashString, - }, - - "access_logs": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Required: true, - }, - "prefix": { - Type: schema.TypeString, - Optional: true, - }, - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - }, - }, - }, - - "enable_deletion_protection": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "idle_timeout": { - Type: schema.TypeInt, - Optional: true, - Default: 60, - }, - - "vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - - "zone_id": { - Type: schema.TypeString, - Computed: true, - }, - - "dns_name": { - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsAlbCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - var name string - if v, ok := d.GetOk("name"); ok { - name = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - name = resource.PrefixedUniqueId(v.(string)) - } else { - name = resource.PrefixedUniqueId("tf-lb-") - } - d.Set("name", name) - - elbOpts := &elbv2.CreateLoadBalancerInput{ - Name: aws.String(name), - Tags: tagsFromMapELBv2(d.Get("tags").(map[string]interface{})), - } - - if scheme, ok := d.GetOk("internal"); ok && scheme.(bool) { - elbOpts.Scheme = aws.String("internal") - } - - if v, ok := d.GetOk("security_groups"); ok { - elbOpts.SecurityGroups = expandStringList(v.(*schema.Set).List()) - } - - if v, ok := d.GetOk("subnets"); ok { - elbOpts.Subnets = expandStringList(v.(*schema.Set).List()) - } - - log.Printf("[DEBUG] ALB create configuration: %#v", elbOpts) - - resp, err := elbconn.CreateLoadBalancer(elbOpts) - if err != nil { - return errwrap.Wrapf("Error creating Application Load Balancer: {{err}}", err) - } - - if len(resp.LoadBalancers) != 1 { - return fmt.Errorf("No load balancers returned following creation of %s", d.Get("name").(string)) - } - - lb := resp.LoadBalancers[0] - d.SetId(*lb.LoadBalancerArn) - log.Printf("[INFO] ALB ID: %s", d.Id()) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"active", "provisioning", "failed"}, - Target: []string{"active"}, - Refresh: func() (interface{}, string, error) { - describeResp, err := elbconn.DescribeLoadBalancers(&elbv2.DescribeLoadBalancersInput{ - LoadBalancerArns: []*string{lb.LoadBalancerArn}, - }) - if err != nil { - return nil, "", err - } - - if len(describeResp.LoadBalancers) != 1 { - return nil, "", fmt.Errorf("No load balancers returned for %s", *lb.LoadBalancerArn) - } - dLb := describeResp.LoadBalancers[0] - - log.Printf("[INFO] ALB state: %s", *dLb.State.Code) - - return describeResp, *dLb.State.Code, nil - }, - Timeout: 5 * time.Minute, - MinTimeout: 3 * time.Second, - } - _, err = stateConf.WaitForState() - if err != nil { - return err - } - - return resourceAwsAlbUpdate(d, meta) -} - -func resourceAwsAlbRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - albArn := d.Id() - - describeAlbOpts := &elbv2.DescribeLoadBalancersInput{ - LoadBalancerArns: []*string{aws.String(albArn)}, - } - - describeResp, err := elbconn.DescribeLoadBalancers(describeAlbOpts) - if err != nil { - if isLoadBalancerNotFound(err) { - // The ALB is gone now, so just remove it from the state - log.Printf("[WARN] ALB %s not found in AWS, removing from state", d.Id()) - d.SetId("") - return nil - } - - return errwrap.Wrapf("Error retrieving ALB: {{err}}", err) - } - if len(describeResp.LoadBalancers) != 1 { - return fmt.Errorf("Unable to find ALB: %#v", describeResp.LoadBalancers) - } - - return flattenAwsAlbResource(d, meta, describeResp.LoadBalancers[0]) -} - -func resourceAwsAlbUpdate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - if !d.IsNewResource() { - if err := setElbV2Tags(elbconn, d); err != nil { - return errwrap.Wrapf("Error Modifying Tags on ALB: {{err}}", err) - } - } - - attributes := make([]*elbv2.LoadBalancerAttribute, 0) - - if d.HasChange("access_logs") { - logs := d.Get("access_logs").([]interface{}) - if len(logs) == 1 { - log := logs[0].(map[string]interface{}) - - attributes = append(attributes, - &elbv2.LoadBalancerAttribute{ - Key: aws.String("access_logs.s3.enabled"), - Value: aws.String(strconv.FormatBool(log["enabled"].(bool))), - }, - &elbv2.LoadBalancerAttribute{ - Key: aws.String("access_logs.s3.bucket"), - Value: aws.String(log["bucket"].(string)), - }) - - if prefix, ok := log["prefix"]; ok { - attributes = append(attributes, &elbv2.LoadBalancerAttribute{ - Key: aws.String("access_logs.s3.prefix"), - Value: aws.String(prefix.(string)), - }) - } - } else if len(logs) == 0 { - attributes = append(attributes, &elbv2.LoadBalancerAttribute{ - Key: aws.String("access_logs.s3.enabled"), - Value: aws.String("false"), - }) - } - } - - if d.HasChange("enable_deletion_protection") { - attributes = append(attributes, &elbv2.LoadBalancerAttribute{ - Key: aws.String("deletion_protection.enabled"), - Value: aws.String(fmt.Sprintf("%t", d.Get("enable_deletion_protection").(bool))), - }) - } - - if d.HasChange("idle_timeout") { - attributes = append(attributes, &elbv2.LoadBalancerAttribute{ - Key: aws.String("idle_timeout.timeout_seconds"), - Value: aws.String(fmt.Sprintf("%d", d.Get("idle_timeout").(int))), - }) - } - - if len(attributes) != 0 { - input := &elbv2.ModifyLoadBalancerAttributesInput{ - LoadBalancerArn: aws.String(d.Id()), - Attributes: attributes, - } - - log.Printf("[DEBUG] ALB Modify Load Balancer Attributes Request: %#v", input) - _, err := elbconn.ModifyLoadBalancerAttributes(input) - if err != nil { - return fmt.Errorf("Failure configuring ALB attributes: %s", err) - } - } - - if d.HasChange("security_groups") { - sgs := expandStringList(d.Get("security_groups").(*schema.Set).List()) - - params := &elbv2.SetSecurityGroupsInput{ - LoadBalancerArn: aws.String(d.Id()), - SecurityGroups: sgs, - } - _, err := elbconn.SetSecurityGroups(params) - if err != nil { - return fmt.Errorf("Failure Setting ALB Security Groups: %s", err) - } - - } - - return resourceAwsAlbRead(d, meta) -} - -func resourceAwsAlbDelete(d *schema.ResourceData, meta interface{}) error { - albconn := meta.(*AWSClient).elbv2conn - - log.Printf("[INFO] Deleting ALB: %s", d.Id()) - - // Destroy the load balancer - deleteElbOpts := elbv2.DeleteLoadBalancerInput{ - LoadBalancerArn: aws.String(d.Id()), - } - if _, err := albconn.DeleteLoadBalancer(&deleteElbOpts); err != nil { - return fmt.Errorf("Error deleting ALB: %s", err) - } - - return nil -} - -// flattenSubnetsFromAvailabilityZones creates a slice of strings containing the subnet IDs -// for the ALB based on the AvailabilityZones structure returned by the API. -func flattenSubnetsFromAvailabilityZones(availabilityZones []*elbv2.AvailabilityZone) []string { - var result []string - for _, az := range availabilityZones { - result = append(result, *az.SubnetId) - } - return result -} - -func albSuffixFromARN(arn *string) string { - if arn == nil { - return "" - } - - if arnComponents := regexp.MustCompile(`arn:.*:loadbalancer/(.*)`).FindAllStringSubmatch(*arn, -1); len(arnComponents) == 1 { - if len(arnComponents[0]) == 2 { - return arnComponents[0][1] - } - } - - return "" -} - -// flattenAwsAlbResource takes a *elbv2.LoadBalancer and populates all respective resource fields. -func flattenAwsAlbResource(d *schema.ResourceData, meta interface{}, alb *elbv2.LoadBalancer) error { - elbconn := meta.(*AWSClient).elbv2conn - - d.Set("arn", alb.LoadBalancerArn) - d.Set("arn_suffix", albSuffixFromARN(alb.LoadBalancerArn)) - d.Set("name", alb.LoadBalancerName) - d.Set("internal", (alb.Scheme != nil && *alb.Scheme == "internal")) - d.Set("security_groups", flattenStringList(alb.SecurityGroups)) - d.Set("subnets", flattenSubnetsFromAvailabilityZones(alb.AvailabilityZones)) - d.Set("vpc_id", alb.VpcId) - d.Set("zone_id", alb.CanonicalHostedZoneId) - d.Set("dns_name", alb.DNSName) - - respTags, err := elbconn.DescribeTags(&elbv2.DescribeTagsInput{ - ResourceArns: []*string{alb.LoadBalancerArn}, - }) - if err != nil { - return errwrap.Wrapf("Error retrieving ALB Tags: {{err}}", err) - } - - var et []*elbv2.Tag - if len(respTags.TagDescriptions) > 0 { - et = respTags.TagDescriptions[0].Tags - } - d.Set("tags", tagsToMapELBv2(et)) - - attributesResp, err := elbconn.DescribeLoadBalancerAttributes(&elbv2.DescribeLoadBalancerAttributesInput{ - LoadBalancerArn: aws.String(d.Id()), - }) - if err != nil { - return errwrap.Wrapf("Error retrieving ALB Attributes: {{err}}", err) - } - - accessLogMap := map[string]interface{}{} - for _, attr := range attributesResp.Attributes { - switch *attr.Key { - case "access_logs.s3.enabled": - accessLogMap["enabled"] = *attr.Value - case "access_logs.s3.bucket": - accessLogMap["bucket"] = *attr.Value - case "access_logs.s3.prefix": - accessLogMap["prefix"] = *attr.Value - case "idle_timeout.timeout_seconds": - timeout, err := strconv.Atoi(*attr.Value) - if err != nil { - return errwrap.Wrapf("Error parsing ALB timeout: {{err}}", err) - } - log.Printf("[DEBUG] Setting ALB Timeout Seconds: %d", timeout) - d.Set("idle_timeout", timeout) - case "deletion_protection.enabled": - protectionEnabled := (*attr.Value) == "true" - log.Printf("[DEBUG] Setting ALB Deletion Protection Enabled: %t", protectionEnabled) - d.Set("enable_deletion_protection", protectionEnabled) - } - } - - log.Printf("[DEBUG] Setting ALB Access Logs: %#v", accessLogMap) - if accessLogMap["bucket"] != "" || accessLogMap["prefix"] != "" { - d.Set("access_logs", []interface{}{accessLogMap}) - } else { - d.Set("access_logs", []interface{}{}) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_listener.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_listener.go deleted file mode 100644 index f94e3b1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_listener.go +++ /dev/null @@ -1,284 +0,0 @@ -package aws - -import ( - "errors" - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAlbListener() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAlbListenerCreate, - Read: resourceAwsAlbListenerRead, - Update: resourceAwsAlbListenerUpdate, - Delete: resourceAwsAlbListenerDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "load_balancer_arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "port": { - Type: schema.TypeInt, - Required: true, - ValidateFunc: validateAwsAlbListenerPort, - }, - - "protocol": { - Type: schema.TypeString, - Optional: true, - Default: "HTTP", - StateFunc: func(v interface{}) string { - return strings.ToUpper(v.(string)) - }, - ValidateFunc: validateAwsAlbListenerProtocol, - }, - - "ssl_policy": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "certificate_arn": { - Type: schema.TypeString, - Optional: true, - }, - - "default_action": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "target_group_arn": { - Type: schema.TypeString, - Required: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsAlbListenerActionType, - }, - }, - }, - }, - }, - } -} - -func resourceAwsAlbListenerCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - albArn := d.Get("load_balancer_arn").(string) - - params := &elbv2.CreateListenerInput{ - LoadBalancerArn: aws.String(albArn), - Port: aws.Int64(int64(d.Get("port").(int))), - Protocol: aws.String(d.Get("protocol").(string)), - } - - if sslPolicy, ok := d.GetOk("ssl_policy"); ok { - params.SslPolicy = aws.String(sslPolicy.(string)) - } - - if certificateArn, ok := d.GetOk("certificate_arn"); ok { - params.Certificates = make([]*elbv2.Certificate, 1) - params.Certificates[0] = &elbv2.Certificate{ - CertificateArn: aws.String(certificateArn.(string)), - } - } - - if defaultActions := d.Get("default_action").([]interface{}); len(defaultActions) == 1 { - params.DefaultActions = make([]*elbv2.Action, len(defaultActions)) - - for i, defaultAction := range defaultActions { - defaultActionMap := defaultAction.(map[string]interface{}) - - params.DefaultActions[i] = &elbv2.Action{ - TargetGroupArn: aws.String(defaultActionMap["target_group_arn"].(string)), - Type: aws.String(defaultActionMap["type"].(string)), - } - } - } - - var resp *elbv2.CreateListenerOutput - - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - var err error - log.Printf("[DEBUG] Creating ALB listener for ARN: %s", d.Get("load_balancer_arn").(string)) - resp, err = elbconn.CreateListener(params) - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "CertificateNotFound" { - log.Printf("[WARN] Got an error while trying to create ALB listener for ARN: %s: %s", albArn, err) - return resource.RetryableError(err) - } - } - if err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) - - if err != nil { - return errwrap.Wrapf("Error creating ALB Listener: {{err}}", err) - } - - if len(resp.Listeners) == 0 { - return errors.New("Error creating ALB Listener: no listeners returned in response") - } - - d.SetId(*resp.Listeners[0].ListenerArn) - - return resourceAwsAlbListenerRead(d, meta) -} - -func resourceAwsAlbListenerRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - resp, err := elbconn.DescribeListeners(&elbv2.DescribeListenersInput{ - ListenerArns: []*string{aws.String(d.Id())}, - }) - if err != nil { - if isListenerNotFound(err) { - log.Printf("[WARN] DescribeListeners - removing %s from state", d.Id()) - d.SetId("") - return nil - } - return errwrap.Wrapf("Error retrieving Listener: {{err}}", err) - } - - if len(resp.Listeners) != 1 { - return fmt.Errorf("Error retrieving Listener %q", d.Id()) - } - - listener := resp.Listeners[0] - - d.Set("arn", listener.ListenerArn) - d.Set("load_balancer_arn", listener.LoadBalancerArn) - d.Set("port", listener.Port) - d.Set("protocol", listener.Protocol) - d.Set("ssl_policy", listener.SslPolicy) - - if listener.Certificates != nil && len(listener.Certificates) == 1 { - d.Set("certificate_arn", listener.Certificates[0].CertificateArn) - } - - defaultActions := make([]map[string]interface{}, 0) - if listener.DefaultActions != nil && len(listener.DefaultActions) > 0 { - for _, defaultAction := range listener.DefaultActions { - action := map[string]interface{}{ - "target_group_arn": *defaultAction.TargetGroupArn, - "type": *defaultAction.Type, - } - defaultActions = append(defaultActions, action) - } - } - d.Set("default_action", defaultActions) - - return nil -} - -func resourceAwsAlbListenerUpdate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - params := &elbv2.ModifyListenerInput{ - ListenerArn: aws.String(d.Id()), - Port: aws.Int64(int64(d.Get("port").(int))), - Protocol: aws.String(d.Get("protocol").(string)), - } - - if sslPolicy, ok := d.GetOk("ssl_policy"); ok { - params.SslPolicy = aws.String(sslPolicy.(string)) - } - - if certificateArn, ok := d.GetOk("certificate_arn"); ok { - params.Certificates = make([]*elbv2.Certificate, 1) - params.Certificates[0] = &elbv2.Certificate{ - CertificateArn: aws.String(certificateArn.(string)), - } - } - - if defaultActions := d.Get("default_action").([]interface{}); len(defaultActions) == 1 { - params.DefaultActions = make([]*elbv2.Action, len(defaultActions)) - - for i, defaultAction := range defaultActions { - defaultActionMap := defaultAction.(map[string]interface{}) - - params.DefaultActions[i] = &elbv2.Action{ - TargetGroupArn: aws.String(defaultActionMap["target_group_arn"].(string)), - Type: aws.String(defaultActionMap["type"].(string)), - } - } - } - - _, err := elbconn.ModifyListener(params) - if err != nil { - return errwrap.Wrapf("Error modifying ALB Listener: {{err}}", err) - } - - return resourceAwsAlbListenerRead(d, meta) -} - -func resourceAwsAlbListenerDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - _, err := elbconn.DeleteListener(&elbv2.DeleteListenerInput{ - ListenerArn: aws.String(d.Id()), - }) - if err != nil { - return errwrap.Wrapf("Error deleting Listener: {{err}}", err) - } - - return nil -} - -func validateAwsAlbListenerPort(v interface{}, k string) (ws []string, errors []error) { - port := v.(int) - if port < 1 || port > 65536 { - errors = append(errors, fmt.Errorf("%q must be a valid port number (1-65536)", k)) - } - return -} - -func validateAwsAlbListenerProtocol(v interface{}, k string) (ws []string, errors []error) { - value := strings.ToLower(v.(string)) - if value == "http" || value == "https" { - return - } - - errors = append(errors, fmt.Errorf("%q must be either %q or %q", k, "HTTP", "HTTPS")) - return -} - -func validateAwsAlbListenerActionType(v interface{}, k string) (ws []string, errors []error) { - value := strings.ToLower(v.(string)) - if value != "forward" { - errors = append(errors, fmt.Errorf("%q must have the value %q", k, "forward")) - } - return -} - -func isListenerNotFound(err error) bool { - elberr, ok := err.(awserr.Error) - return ok && elberr.Code() == "ListenerNotFound" -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_listener_rule.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_listener_rule.go deleted file mode 100644 index 1d5ba16..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_listener_rule.go +++ /dev/null @@ -1,257 +0,0 @@ -package aws - -import ( - "errors" - "fmt" - "log" - "strconv" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAlbListenerRule() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAlbListenerRuleCreate, - Read: resourceAwsAlbListenerRuleRead, - Update: resourceAwsAlbListenerRuleUpdate, - Delete: resourceAwsAlbListenerRuleDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "listener_arn": { - Type: schema.TypeString, - Required: true, - }, - "priority": { - Type: schema.TypeInt, - Required: true, - ValidateFunc: validateAwsAlbListenerRulePriority, - }, - "action": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "target_group_arn": { - Type: schema.TypeString, - Required: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsAlbListenerActionType, - }, - }, - }, - }, - "condition": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "field": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateAwsListenerRuleField, - }, - "values": { - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsAlbListenerRuleCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - params := &elbv2.CreateRuleInput{ - ListenerArn: aws.String(d.Get("listener_arn").(string)), - Priority: aws.Int64(int64(d.Get("priority").(int))), - } - - actions := d.Get("action").([]interface{}) - params.Actions = make([]*elbv2.Action, len(actions)) - for i, action := range actions { - actionMap := action.(map[string]interface{}) - params.Actions[i] = &elbv2.Action{ - TargetGroupArn: aws.String(actionMap["target_group_arn"].(string)), - Type: aws.String(actionMap["type"].(string)), - } - } - - conditions := d.Get("condition").([]interface{}) - params.Conditions = make([]*elbv2.RuleCondition, len(conditions)) - for i, condition := range conditions { - conditionMap := condition.(map[string]interface{}) - values := conditionMap["values"].([]interface{}) - params.Conditions[i] = &elbv2.RuleCondition{ - Field: aws.String(conditionMap["field"].(string)), - Values: make([]*string, len(values)), - } - for j, value := range values { - params.Conditions[i].Values[j] = aws.String(value.(string)) - } - } - - resp, err := elbconn.CreateRule(params) - if err != nil { - return errwrap.Wrapf("Error creating ALB Listener Rule: {{err}}", err) - } - - if len(resp.Rules) == 0 { - return errors.New("Error creating ALB Listener Rule: no rules returned in response") - } - - d.SetId(*resp.Rules[0].RuleArn) - - return resourceAwsAlbListenerRuleRead(d, meta) -} - -func resourceAwsAlbListenerRuleRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - resp, err := elbconn.DescribeRules(&elbv2.DescribeRulesInput{ - RuleArns: []*string{aws.String(d.Id())}, - }) - if err != nil { - if isRuleNotFound(err) { - log.Printf("[WARN] DescribeRules - removing %s from state", d.Id()) - d.SetId("") - return nil - } - return errwrap.Wrapf(fmt.Sprintf("Error retrieving Rules for listener %s: {{err}}", d.Id()), err) - } - - if len(resp.Rules) != 1 { - return fmt.Errorf("Error retrieving Rule %q", d.Id()) - } - - rule := resp.Rules[0] - - d.Set("arn", rule.RuleArn) - // Rules are evaluated in priority order, from the lowest value to the highest value. The default rule has the lowest priority. - if *rule.Priority == "default" { - d.Set("priority", 99999) - } else { - if priority, err := strconv.Atoi(*rule.Priority); err != nil { - return errwrap.Wrapf("Cannot convert rule priority %q to int: {{err}}", err) - } else { - d.Set("priority", priority) - } - } - - actions := make([]interface{}, len(rule.Actions)) - for i, action := range rule.Actions { - actionMap := make(map[string]interface{}) - actionMap["target_group_arn"] = *action.TargetGroupArn - actionMap["type"] = *action.Type - actions[i] = actionMap - } - d.Set("action", actions) - - conditions := make([]interface{}, len(rule.Conditions)) - for i, condition := range rule.Conditions { - conditionMap := make(map[string]interface{}) - conditionMap["field"] = *condition.Field - conditionValues := make([]string, len(condition.Values)) - for k, value := range condition.Values { - conditionValues[k] = *value - } - conditionMap["values"] = conditionValues - conditions[i] = conditionMap - } - d.Set("condition", conditions) - - return nil -} - -func resourceAwsAlbListenerRuleUpdate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - params := &elbv2.ModifyRuleInput{ - RuleArn: aws.String(d.Id()), - } - - actions := d.Get("action").([]interface{}) - params.Actions = make([]*elbv2.Action, len(actions)) - for i, action := range actions { - actionMap := action.(map[string]interface{}) - params.Actions[i] = &elbv2.Action{ - TargetGroupArn: aws.String(actionMap["target_group_arn"].(string)), - Type: aws.String(actionMap["type"].(string)), - } - } - - conditions := d.Get("condition").([]interface{}) - params.Conditions = make([]*elbv2.RuleCondition, len(conditions)) - for i, condition := range conditions { - conditionMap := condition.(map[string]interface{}) - values := conditionMap["values"].([]interface{}) - params.Conditions[i] = &elbv2.RuleCondition{ - Field: aws.String(conditionMap["field"].(string)), - Values: make([]*string, len(values)), - } - for j, value := range values { - params.Conditions[i].Values[j] = aws.String(value.(string)) - } - } - - resp, err := elbconn.ModifyRule(params) - if err != nil { - return errwrap.Wrapf("Error modifying ALB Listener Rule: {{err}}", err) - } - - if len(resp.Rules) == 0 { - return errors.New("Error modifying creating ALB Listener Rule: no rules returned in response") - } - - return resourceAwsAlbListenerRuleRead(d, meta) -} - -func resourceAwsAlbListenerRuleDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - _, err := elbconn.DeleteRule(&elbv2.DeleteRuleInput{ - RuleArn: aws.String(d.Id()), - }) - if err != nil && !isRuleNotFound(err) { - return errwrap.Wrapf("Error deleting ALB Listener Rule: {{err}}", err) - } - return nil -} - -func validateAwsAlbListenerRulePriority(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 1 || value > 99999 { - errors = append(errors, fmt.Errorf("%q must be in the range 1-99999", k)) - } - return -} - -func validateAwsListenerRuleField(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 64 { - errors = append(errors, fmt.Errorf("%q must be a maximum of 64 characters", k)) - } - return -} - -func isRuleNotFound(err error) bool { - elberr, ok := err.(awserr.Error) - return ok && elberr.Code() == "RuleNotFound" -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_target_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_target_group.go deleted file mode 100644 index 96ecd0d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_target_group.go +++ /dev/null @@ -1,502 +0,0 @@ -package aws - -import ( - "errors" - "fmt" - "log" - "regexp" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAlbTargetGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAlbTargetGroupCreate, - Read: resourceAwsAlbTargetGroupRead, - Update: resourceAwsAlbTargetGroupUpdate, - Delete: resourceAwsAlbTargetGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "arn_suffix": { - Type: schema.TypeString, - Computed: true, - }, - - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAwsAlbTargetGroupName, - }, - - "port": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - ValidateFunc: validateAwsAlbTargetGroupPort, - }, - - "protocol": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAwsAlbTargetGroupProtocol, - }, - - "vpc_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "deregistration_delay": { - Type: schema.TypeInt, - Optional: true, - Default: 300, - ValidateFunc: validateAwsAlbTargetGroupDeregistrationDelay, - }, - - "stickiness": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsAlbTargetGroupStickinessType, - }, - "cookie_duration": { - Type: schema.TypeInt, - Optional: true, - Default: 86400, - ValidateFunc: validateAwsAlbTargetGroupStickinessCookieDuration, - }, - }, - }, - }, - - "health_check": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "interval": { - Type: schema.TypeInt, - Optional: true, - Default: 30, - }, - - "path": { - Type: schema.TypeString, - Optional: true, - Default: "/", - ValidateFunc: validateAwsAlbTargetGroupHealthCheckPath, - }, - - "port": { - Type: schema.TypeString, - Optional: true, - Default: "traffic-port", - ValidateFunc: validateAwsAlbTargetGroupHealthCheckPort, - }, - - "protocol": { - Type: schema.TypeString, - Optional: true, - Default: "HTTP", - StateFunc: func(v interface{}) string { - return strings.ToUpper(v.(string)) - }, - ValidateFunc: validateAwsAlbTargetGroupHealthCheckProtocol, - }, - - "timeout": { - Type: schema.TypeInt, - Optional: true, - Default: 5, - ValidateFunc: validateAwsAlbTargetGroupHealthCheckTimeout, - }, - - "healthy_threshold": { - Type: schema.TypeInt, - Optional: true, - Default: 5, - ValidateFunc: validateAwsAlbTargetGroupHealthCheckHealthyThreshold, - }, - - "matcher": { - Type: schema.TypeString, - Optional: true, - Default: "200", - }, - - "unhealthy_threshold": { - Type: schema.TypeInt, - Optional: true, - Default: 2, - ValidateFunc: validateAwsAlbTargetGroupHealthCheckHealthyThreshold, - }, - }, - }, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsAlbTargetGroupCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - params := &elbv2.CreateTargetGroupInput{ - Name: aws.String(d.Get("name").(string)), - Port: aws.Int64(int64(d.Get("port").(int))), - Protocol: aws.String(d.Get("protocol").(string)), - VpcId: aws.String(d.Get("vpc_id").(string)), - } - - if healthChecks := d.Get("health_check").([]interface{}); len(healthChecks) == 1 { - healthCheck := healthChecks[0].(map[string]interface{}) - - params.HealthCheckIntervalSeconds = aws.Int64(int64(healthCheck["interval"].(int))) - params.HealthCheckPath = aws.String(healthCheck["path"].(string)) - params.HealthCheckPort = aws.String(healthCheck["port"].(string)) - params.HealthCheckProtocol = aws.String(healthCheck["protocol"].(string)) - params.HealthCheckTimeoutSeconds = aws.Int64(int64(healthCheck["timeout"].(int))) - params.HealthyThresholdCount = aws.Int64(int64(healthCheck["healthy_threshold"].(int))) - params.UnhealthyThresholdCount = aws.Int64(int64(healthCheck["unhealthy_threshold"].(int))) - params.Matcher = &elbv2.Matcher{ - HttpCode: aws.String(healthCheck["matcher"].(string)), - } - } - - resp, err := elbconn.CreateTargetGroup(params) - if err != nil { - return errwrap.Wrapf("Error creating ALB Target Group: {{err}}", err) - } - - if len(resp.TargetGroups) == 0 { - return errors.New("Error creating ALB Target Group: no groups returned in response") - } - - targetGroupArn := resp.TargetGroups[0].TargetGroupArn - d.SetId(*targetGroupArn) - - return resourceAwsAlbTargetGroupUpdate(d, meta) -} - -func resourceAwsAlbTargetGroupRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - resp, err := elbconn.DescribeTargetGroups(&elbv2.DescribeTargetGroupsInput{ - TargetGroupArns: []*string{aws.String(d.Id())}, - }) - if err != nil { - if isTargetGroupNotFound(err) { - log.Printf("[DEBUG] DescribeTargetGroups - removing %s from state", d.Id()) - d.SetId("") - return nil - } - return errwrap.Wrapf("Error retrieving Target Group: {{err}}", err) - } - - if len(resp.TargetGroups) != 1 { - return fmt.Errorf("Error retrieving Target Group %q", d.Id()) - } - - targetGroup := resp.TargetGroups[0] - - d.Set("arn", targetGroup.TargetGroupArn) - d.Set("arn_suffix", albTargetGroupSuffixFromARN(targetGroup.TargetGroupArn)) - d.Set("name", targetGroup.TargetGroupName) - d.Set("port", targetGroup.Port) - d.Set("protocol", targetGroup.Protocol) - d.Set("vpc_id", targetGroup.VpcId) - - healthCheck := make(map[string]interface{}) - healthCheck["interval"] = *targetGroup.HealthCheckIntervalSeconds - healthCheck["path"] = *targetGroup.HealthCheckPath - healthCheck["port"] = *targetGroup.HealthCheckPort - healthCheck["protocol"] = *targetGroup.HealthCheckProtocol - healthCheck["timeout"] = *targetGroup.HealthCheckTimeoutSeconds - healthCheck["healthy_threshold"] = *targetGroup.HealthyThresholdCount - healthCheck["unhealthy_threshold"] = *targetGroup.UnhealthyThresholdCount - healthCheck["matcher"] = *targetGroup.Matcher.HttpCode - d.Set("health_check", []interface{}{healthCheck}) - - attrResp, err := elbconn.DescribeTargetGroupAttributes(&elbv2.DescribeTargetGroupAttributesInput{ - TargetGroupArn: aws.String(d.Id()), - }) - if err != nil { - return errwrap.Wrapf("Error retrieving Target Group Attributes: {{err}}", err) - } - - stickinessMap := map[string]interface{}{} - for _, attr := range attrResp.Attributes { - switch *attr.Key { - case "stickiness.enabled": - stickinessMap["enabled"] = *attr.Value - case "stickiness.type": - stickinessMap["type"] = *attr.Value - case "stickiness.lb_cookie.duration_seconds": - stickinessMap["cookie_duration"] = *attr.Value - case "deregistration_delay.timeout_seconds": - timeout, err := strconv.Atoi(*attr.Value) - if err != nil { - return fmt.Errorf("Error converting deregistration_delay.timeout_seconds to int: %s", *attr.Value) - } - d.Set("deregistration_delay", timeout) - } - } - d.Set("stickiness", []interface{}{stickinessMap}) - - return nil -} - -func resourceAwsAlbTargetGroupUpdate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - if err := setElbV2Tags(elbconn, d); err != nil { - return errwrap.Wrapf("Error Modifying Tags on ALB Target Group: {{err}}", err) - } - - if d.HasChange("health_check") { - healthChecks := d.Get("health_check").([]interface{}) - - var params *elbv2.ModifyTargetGroupInput - if len(healthChecks) == 1 { - healthCheck := healthChecks[0].(map[string]interface{}) - - params = &elbv2.ModifyTargetGroupInput{ - TargetGroupArn: aws.String(d.Id()), - HealthCheckIntervalSeconds: aws.Int64(int64(healthCheck["interval"].(int))), - HealthCheckPath: aws.String(healthCheck["path"].(string)), - HealthCheckPort: aws.String(healthCheck["port"].(string)), - HealthCheckProtocol: aws.String(healthCheck["protocol"].(string)), - HealthCheckTimeoutSeconds: aws.Int64(int64(healthCheck["timeout"].(int))), - HealthyThresholdCount: aws.Int64(int64(healthCheck["healthy_threshold"].(int))), - UnhealthyThresholdCount: aws.Int64(int64(healthCheck["unhealthy_threshold"].(int))), - Matcher: &elbv2.Matcher{ - HttpCode: aws.String(healthCheck["matcher"].(string)), - }, - } - } else { - params = &elbv2.ModifyTargetGroupInput{ - TargetGroupArn: aws.String(d.Id()), - } - } - - _, err := elbconn.ModifyTargetGroup(params) - if err != nil { - return errwrap.Wrapf("Error modifying Target Group: {{err}}", err) - } - } - - var attrs []*elbv2.TargetGroupAttribute - - if d.HasChange("deregistration_delay") { - attrs = append(attrs, &elbv2.TargetGroupAttribute{ - Key: aws.String("deregistration_delay.timeout_seconds"), - Value: aws.String(fmt.Sprintf("%d", d.Get("deregistration_delay").(int))), - }) - } - - if d.HasChange("stickiness") { - stickinessBlocks := d.Get("stickiness").([]interface{}) - if len(stickinessBlocks) == 1 { - stickiness := stickinessBlocks[0].(map[string]interface{}) - - attrs = append(attrs, - &elbv2.TargetGroupAttribute{ - Key: aws.String("stickiness.enabled"), - Value: aws.String(strconv.FormatBool(stickiness["enabled"].(bool))), - }, - &elbv2.TargetGroupAttribute{ - Key: aws.String("stickiness.type"), - Value: aws.String(stickiness["type"].(string)), - }, - &elbv2.TargetGroupAttribute{ - Key: aws.String("stickiness.lb_cookie.duration_seconds"), - Value: aws.String(fmt.Sprintf("%d", stickiness["cookie_duration"].(int))), - }) - } else if len(stickinessBlocks) == 0 { - attrs = append(attrs, &elbv2.TargetGroupAttribute{ - Key: aws.String("stickiness.enabled"), - Value: aws.String("false"), - }) - } - } - - if len(attrs) > 0 { - params := &elbv2.ModifyTargetGroupAttributesInput{ - TargetGroupArn: aws.String(d.Id()), - Attributes: attrs, - } - - _, err := elbconn.ModifyTargetGroupAttributes(params) - if err != nil { - return errwrap.Wrapf("Error modifying Target Group Attributes: {{err}}", err) - } - } - - return resourceAwsAlbTargetGroupRead(d, meta) -} - -func resourceAwsAlbTargetGroupDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - _, err := elbconn.DeleteTargetGroup(&elbv2.DeleteTargetGroupInput{ - TargetGroupArn: aws.String(d.Id()), - }) - if err != nil { - return errwrap.Wrapf("Error deleting Target Group: {{err}}", err) - } - - return nil -} - -func isTargetGroupNotFound(err error) bool { - elberr, ok := err.(awserr.Error) - return ok && elberr.Code() == "TargetGroupNotFound" -} - -func validateAwsAlbTargetGroupHealthCheckPath(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 1024 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 1024 characters: %q", k, value)) - } - return -} - -func validateAwsAlbTargetGroupHealthCheckPort(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if value == "traffic-port" { - return - } - - port, err := strconv.Atoi(value) - if err != nil { - errors = append(errors, fmt.Errorf("%q must be a valid port number (1-65536) or %q", k, "traffic-port")) - } - - if port < 1 || port > 65536 { - errors = append(errors, fmt.Errorf("%q must be a valid port number (1-65536) or %q", k, "traffic-port")) - } - - return -} - -func validateAwsAlbTargetGroupHealthCheckHealthyThreshold(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 2 || value > 10 { - errors = append(errors, fmt.Errorf("%q must be an integer between 2 and 10", k)) - } - return -} - -func validateAwsAlbTargetGroupHealthCheckTimeout(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 2 || value > 60 { - errors = append(errors, fmt.Errorf("%q must be an integer between 2 and 60", k)) - } - return -} - -func validateAwsAlbTargetGroupHealthCheckProtocol(v interface{}, k string) (ws []string, errors []error) { - value := strings.ToLower(v.(string)) - if value == "http" || value == "https" { - return - } - - errors = append(errors, fmt.Errorf("%q must be either %q or %q", k, "HTTP", "HTTPS")) - return -} - -func validateAwsAlbTargetGroupName(v interface{}, k string) (ws []string, errors []error) { - name := v.(string) - if len(name) > 32 { - errors = append(errors, fmt.Errorf("%q (%q) cannot be longer than '32' characters", k, name)) - } - return -} - -func validateAwsAlbTargetGroupPort(v interface{}, k string) (ws []string, errors []error) { - port := v.(int) - if port < 1 || port > 65536 { - errors = append(errors, fmt.Errorf("%q must be a valid port number (1-65536)", k)) - } - return -} - -func validateAwsAlbTargetGroupProtocol(v interface{}, k string) (ws []string, errors []error) { - protocol := strings.ToLower(v.(string)) - if protocol == "http" || protocol == "https" { - return - } - - errors = append(errors, fmt.Errorf("%q must be either %q or %q", k, "HTTP", "HTTPS")) - return -} - -func validateAwsAlbTargetGroupDeregistrationDelay(v interface{}, k string) (ws []string, errors []error) { - delay := v.(int) - if delay < 0 || delay > 3600 { - errors = append(errors, fmt.Errorf("%q must be in the range 0-3600 seconds", k)) - } - return -} - -func validateAwsAlbTargetGroupStickinessType(v interface{}, k string) (ws []string, errors []error) { - stickinessType := v.(string) - if stickinessType != "lb_cookie" { - errors = append(errors, fmt.Errorf("%q must have the value %q", k, "lb_cookie")) - } - return -} - -func validateAwsAlbTargetGroupStickinessCookieDuration(v interface{}, k string) (ws []string, errors []error) { - duration := v.(int) - if duration < 1 || duration > 604800 { - errors = append(errors, fmt.Errorf("%q must be a between 1 second and 1 week (1-604800 seconds))", k)) - } - return -} - -func albTargetGroupSuffixFromARN(arn *string) string { - if arn == nil { - return "" - } - - if arnComponents := regexp.MustCompile(`arn:.*:targetgroup/(.*)`).FindAllStringSubmatch(*arn, -1); len(arnComponents) == 1 { - if len(arnComponents[0]) == 2 { - return fmt.Sprintf("targetgroup/%s", arnComponents[0][1]) - } - } - - return "" -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_target_group_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_target_group_attachment.go deleted file mode 100644 index e6ba35b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_alb_target_group_attachment.go +++ /dev/null @@ -1,131 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAlbTargetGroupAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAlbAttachmentCreate, - Read: resourceAwsAlbAttachmentRead, - Delete: resourceAwsAlbAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "target_group_arn": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - - "target_id": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - - "port": { - Type: schema.TypeInt, - ForceNew: true, - Required: true, - }, - }, - } -} - -func resourceAwsAlbAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - params := &elbv2.RegisterTargetsInput{ - TargetGroupArn: aws.String(d.Get("target_group_arn").(string)), - Targets: []*elbv2.TargetDescription{ - { - Id: aws.String(d.Get("target_id").(string)), - Port: aws.Int64(int64(d.Get("port").(int))), - }, - }, - } - - log.Printf("[INFO] Registering Target %s (%d) with Target Group %s", d.Get("target_id").(string), - d.Get("port").(int), d.Get("target_group_arn").(string)) - - _, err := elbconn.RegisterTargets(params) - if err != nil { - return errwrap.Wrapf("Error registering targets with target group: {{err}}", err) - } - - d.SetId(resource.PrefixedUniqueId(fmt.Sprintf("%s-", d.Get("target_group_arn")))) - - return nil -} - -func resourceAwsAlbAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - - params := &elbv2.DeregisterTargetsInput{ - TargetGroupArn: aws.String(d.Get("target_group_arn").(string)), - Targets: []*elbv2.TargetDescription{ - { - Id: aws.String(d.Get("target_id").(string)), - Port: aws.Int64(int64(d.Get("port").(int))), - }, - }, - } - - _, err := elbconn.DeregisterTargets(params) - if err != nil && !isTargetGroupNotFound(err) { - return errwrap.Wrapf("Error deregistering Targets: {{err}}", err) - } - - d.SetId("") - - return nil -} - -// resourceAwsAlbAttachmentRead requires all of the fields in order to describe the correct -// target, so there is no work to do beyond ensuring that the target and group still exist. -func resourceAwsAlbAttachmentRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbv2conn - resp, err := elbconn.DescribeTargetHealth(&elbv2.DescribeTargetHealthInput{ - TargetGroupArn: aws.String(d.Get("target_group_arn").(string)), - Targets: []*elbv2.TargetDescription{ - { - Id: aws.String(d.Get("target_id").(string)), - Port: aws.Int64(int64(d.Get("port").(int))), - }, - }, - }) - if err != nil { - if isTargetGroupNotFound(err) { - log.Printf("[WARN] Target group does not exist, removing target attachment %s", d.Id()) - d.SetId("") - return nil - } - if isInvalidTarget(err) { - log.Printf("[WARN] Target does not exist, removing target attachment %s", d.Id()) - d.SetId("") - return nil - } - return errwrap.Wrapf("Error reading Target Health: {{err}}", err) - } - - if len(resp.TargetHealthDescriptions) != 1 { - log.Printf("[WARN] Target does not exist, removing target attachment %s", d.Id()) - d.SetId("") - return nil - } - - return nil -} - -func isInvalidTarget(err error) bool { - elberr, ok := err.(awserr.Error) - return ok && elberr.Code() == "InvalidTarget" -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami.go deleted file mode 100644 index 2a5c2b3..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami.go +++ /dev/null @@ -1,536 +0,0 @@ -package aws - -import ( - "bytes" - "errors" - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAmi() *schema.Resource { - // Our schema is shared also with aws_ami_copy and aws_ami_from_instance - resourceSchema := resourceAwsAmiCommonSchema(false) - - return &schema.Resource{ - Create: resourceAwsAmiCreate, - - Schema: resourceSchema, - - // The Read, Update and Delete operations are shared with aws_ami_copy - // and aws_ami_from_instance, since they differ only in how the image - // is created. - Read: resourceAwsAmiRead, - Update: resourceAwsAmiUpdate, - Delete: resourceAwsAmiDelete, - } -} - -func resourceAwsAmiCreate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).ec2conn - - req := &ec2.RegisterImageInput{ - Name: aws.String(d.Get("name").(string)), - Description: aws.String(d.Get("description").(string)), - Architecture: aws.String(d.Get("architecture").(string)), - ImageLocation: aws.String(d.Get("image_location").(string)), - RootDeviceName: aws.String(d.Get("root_device_name").(string)), - SriovNetSupport: aws.String(d.Get("sriov_net_support").(string)), - VirtualizationType: aws.String(d.Get("virtualization_type").(string)), - } - - if kernelId := d.Get("kernel_id").(string); kernelId != "" { - req.KernelId = aws.String(kernelId) - } - if ramdiskId := d.Get("ramdisk_id").(string); ramdiskId != "" { - req.RamdiskId = aws.String(ramdiskId) - } - - ebsBlockDevsSet := d.Get("ebs_block_device").(*schema.Set) - ephemeralBlockDevsSet := d.Get("ephemeral_block_device").(*schema.Set) - for _, ebsBlockDevI := range ebsBlockDevsSet.List() { - ebsBlockDev := ebsBlockDevI.(map[string]interface{}) - blockDev := &ec2.BlockDeviceMapping{ - DeviceName: aws.String(ebsBlockDev["device_name"].(string)), - Ebs: &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(ebsBlockDev["delete_on_termination"].(bool)), - VolumeType: aws.String(ebsBlockDev["volume_type"].(string)), - }, - } - if iops, ok := ebsBlockDev["iops"]; ok { - if iop := iops.(int); iop != 0 { - blockDev.Ebs.Iops = aws.Int64(int64(iop)) - } - } - if size, ok := ebsBlockDev["volume_size"]; ok { - if s := size.(int); s != 0 { - blockDev.Ebs.VolumeSize = aws.Int64(int64(s)) - } - } - encrypted := ebsBlockDev["encrypted"].(bool) - if snapshotId := ebsBlockDev["snapshot_id"].(string); snapshotId != "" { - blockDev.Ebs.SnapshotId = aws.String(snapshotId) - if encrypted { - return errors.New("can't set both 'snapshot_id' and 'encrypted'") - } - } else if encrypted { - blockDev.Ebs.Encrypted = aws.Bool(true) - } - req.BlockDeviceMappings = append(req.BlockDeviceMappings, blockDev) - } - for _, ephemeralBlockDevI := range ephemeralBlockDevsSet.List() { - ephemeralBlockDev := ephemeralBlockDevI.(map[string]interface{}) - blockDev := &ec2.BlockDeviceMapping{ - DeviceName: aws.String(ephemeralBlockDev["device_name"].(string)), - VirtualName: aws.String(ephemeralBlockDev["virtual_name"].(string)), - } - req.BlockDeviceMappings = append(req.BlockDeviceMappings, blockDev) - } - - res, err := client.RegisterImage(req) - if err != nil { - return err - } - - id := *res.ImageId - d.SetId(id) - d.Partial(true) // make sure we record the id even if the rest of this gets interrupted - d.Set("id", id) - d.Set("manage_ebs_block_devices", false) - d.SetPartial("id") - d.SetPartial("manage_ebs_block_devices") - d.Partial(false) - - _, err = resourceAwsAmiWaitForAvailable(id, client) - if err != nil { - return err - } - - return resourceAwsAmiUpdate(d, meta) -} - -func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).ec2conn - id := d.Id() - - req := &ec2.DescribeImagesInput{ - ImageIds: []*string{aws.String(id)}, - } - - res, err := client.DescribeImages(req) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidAMIID.NotFound" { - log.Printf("[DEBUG] %s no longer exists, so we'll drop it from the state", id) - d.SetId("") - return nil - } - - return err - } - - if len(res.Images) != 1 { - d.SetId("") - return nil - } - - image := res.Images[0] - state := *image.State - - if state == "pending" { - // This could happen if a user manually adds an image we didn't create - // to the state. We'll wait for the image to become available - // before we continue. We should never take this branch in normal - // circumstances since we would've waited for availability during - // the "Create" step. - image, err = resourceAwsAmiWaitForAvailable(id, client) - if err != nil { - return err - } - state = *image.State - } - - if state == "deregistered" { - d.SetId("") - return nil - } - - if state != "available" { - return fmt.Errorf("AMI has become %s", state) - } - - d.Set("name", image.Name) - d.Set("description", image.Description) - d.Set("image_location", image.ImageLocation) - d.Set("architecture", image.Architecture) - d.Set("kernel_id", image.KernelId) - d.Set("ramdisk_id", image.RamdiskId) - d.Set("root_device_name", image.RootDeviceName) - d.Set("sriov_net_support", image.SriovNetSupport) - d.Set("virtualization_type", image.VirtualizationType) - - var ebsBlockDevs []map[string]interface{} - var ephemeralBlockDevs []map[string]interface{} - - for _, blockDev := range image.BlockDeviceMappings { - if blockDev.Ebs != nil { - ebsBlockDev := map[string]interface{}{ - "device_name": *blockDev.DeviceName, - "delete_on_termination": *blockDev.Ebs.DeleteOnTermination, - "encrypted": *blockDev.Ebs.Encrypted, - "iops": 0, - "volume_size": int(*blockDev.Ebs.VolumeSize), - "volume_type": *blockDev.Ebs.VolumeType, - } - if blockDev.Ebs.Iops != nil { - ebsBlockDev["iops"] = int(*blockDev.Ebs.Iops) - } - // The snapshot ID might not be set. - if blockDev.Ebs.SnapshotId != nil { - ebsBlockDev["snapshot_id"] = *blockDev.Ebs.SnapshotId - } - ebsBlockDevs = append(ebsBlockDevs, ebsBlockDev) - } else { - ephemeralBlockDevs = append(ephemeralBlockDevs, map[string]interface{}{ - "device_name": *blockDev.DeviceName, - "virtual_name": *blockDev.VirtualName, - }) - } - } - - d.Set("ebs_block_device", ebsBlockDevs) - d.Set("ephemeral_block_device", ephemeralBlockDevs) - - d.Set("tags", tagsToMap(image.Tags)) - - return nil -} - -func resourceAwsAmiUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).ec2conn - - d.Partial(true) - - if err := setTags(client, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - if d.Get("description").(string) != "" { - _, err := client.ModifyImageAttribute(&ec2.ModifyImageAttributeInput{ - ImageId: aws.String(d.Id()), - Description: &ec2.AttributeValue{ - Value: aws.String(d.Get("description").(string)), - }, - }) - if err != nil { - return err - } - d.SetPartial("description") - } - - d.Partial(false) - - return resourceAwsAmiRead(d, meta) -} - -func resourceAwsAmiDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).ec2conn - - req := &ec2.DeregisterImageInput{ - ImageId: aws.String(d.Id()), - } - - _, err := client.DeregisterImage(req) - if err != nil { - return err - } - - // If we're managing the EBS snapshots then we need to delete those too. - if d.Get("manage_ebs_snapshots").(bool) { - errs := map[string]error{} - ebsBlockDevsSet := d.Get("ebs_block_device").(*schema.Set) - req := &ec2.DeleteSnapshotInput{} - for _, ebsBlockDevI := range ebsBlockDevsSet.List() { - ebsBlockDev := ebsBlockDevI.(map[string]interface{}) - snapshotId := ebsBlockDev["snapshot_id"].(string) - if snapshotId != "" { - req.SnapshotId = aws.String(snapshotId) - _, err := client.DeleteSnapshot(req) - if err != nil { - errs[snapshotId] = err - } - } - } - - if len(errs) > 0 { - errParts := []string{"Errors while deleting associated EBS snapshots:"} - for snapshotId, err := range errs { - errParts = append(errParts, fmt.Sprintf("%s: %s", snapshotId, err)) - } - errParts = append(errParts, "These are no longer managed by Terraform and must be deleted manually.") - return errors.New(strings.Join(errParts, "\n")) - } - } - - d.SetId("") - - return nil -} - -func resourceAwsAmiWaitForAvailable(id string, client *ec2.EC2) (*ec2.Image, error) { - log.Printf("Waiting for AMI %s to become available...", id) - - req := &ec2.DescribeImagesInput{ - ImageIds: []*string{aws.String(id)}, - } - pollsWhereNotFound := 0 - for { - res, err := client.DescribeImages(req) - if err != nil { - // When using RegisterImage (for aws_ami) the AMI sometimes isn't available at all - // right after the API responds, so we need to tolerate a couple Not Found errors - // before an available AMI shows up. - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidAMIID.NotFound" { - pollsWhereNotFound++ - // We arbitrarily stop polling after getting a "not found" error five times, - // assuming that the AMI has been deleted by something other than Terraform. - if pollsWhereNotFound > 5 { - return nil, fmt.Errorf("gave up waiting for AMI to be created: %s", err) - } - time.Sleep(4 * time.Second) - continue - } - return nil, fmt.Errorf("error reading AMI: %s", err) - } - - if len(res.Images) != 1 { - return nil, fmt.Errorf("new AMI vanished while pending") - } - - state := *res.Images[0].State - - if state == "pending" { - // Give it a few seconds before we poll again. - time.Sleep(4 * time.Second) - continue - } - - if state == "available" { - // We're done! - return res.Images[0], nil - } - - // If we're not pending or available then we're in one of the invalid/error - // states, so stop polling and bail out. - stateReason := *res.Images[0].StateReason - return nil, fmt.Errorf("new AMI became %s while pending: %s", state, stateReason) - } -} - -func resourceAwsAmiCommonSchema(computed bool) map[string]*schema.Schema { - // The "computed" parameter controls whether we're making - // a schema for an AMI that's been implicitly registered (aws_ami_copy, aws_ami_from_instance) - // or whether we're making a schema for an explicit registration (aws_ami). - // When set, almost every attribute is marked as "computed". - // When not set, only the "id" attribute is computed. - // "name" and "description" are never computed, since they must always - // be provided by the user. - - var virtualizationTypeDefault interface{} - var deleteEbsOnTerminationDefault interface{} - var sriovNetSupportDefault interface{} - var architectureDefault interface{} - var volumeTypeDefault interface{} - if !computed { - virtualizationTypeDefault = "paravirtual" - deleteEbsOnTerminationDefault = true - sriovNetSupportDefault = "simple" - architectureDefault = "x86_64" - volumeTypeDefault = "standard" - } - - return map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "image_location": { - Type: schema.TypeString, - Optional: !computed, - Computed: true, - ForceNew: !computed, - }, - "architecture": { - Type: schema.TypeString, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - Default: architectureDefault, - }, - "description": { - Type: schema.TypeString, - Optional: true, - }, - "kernel_id": { - Type: schema.TypeString, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - }, - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "ramdisk_id": { - Type: schema.TypeString, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - }, - "root_device_name": { - Type: schema.TypeString, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - }, - "sriov_net_support": { - Type: schema.TypeString, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - Default: sriovNetSupportDefault, - }, - "virtualization_type": { - Type: schema.TypeString, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - Default: virtualizationTypeDefault, - }, - - // The following block device attributes intentionally mimick the - // corresponding attributes on aws_instance, since they have the - // same meaning. - // However, we don't use root_block_device here because the constraint - // on which root device attributes can be overridden for an instance to - // not apply when registering an AMI. - - "ebs_block_device": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Optional: !computed, - Default: deleteEbsOnTerminationDefault, - ForceNew: !computed, - Computed: computed, - }, - - "device_name": { - Type: schema.TypeString, - Required: !computed, - ForceNew: !computed, - Computed: computed, - }, - - "encrypted": { - Type: schema.TypeBool, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - }, - - "iops": { - Type: schema.TypeInt, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - }, - - "snapshot_id": { - Type: schema.TypeString, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - }, - - "volume_size": { - Type: schema.TypeInt, - Optional: !computed, - Computed: true, - ForceNew: !computed, - }, - - "volume_type": { - Type: schema.TypeString, - Optional: !computed, - Computed: computed, - ForceNew: !computed, - Default: volumeTypeDefault, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["snapshot_id"].(string))) - return hashcode.String(buf.String()) - }, - }, - - "ephemeral_block_device": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "device_name": { - Type: schema.TypeString, - Required: !computed, - Computed: computed, - }, - - "virtual_name": { - Type: schema.TypeString, - Required: !computed, - Computed: computed, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["virtual_name"].(string))) - return hashcode.String(buf.String()) - }, - }, - - "tags": tagsSchema(), - - // Not a public attribute; used to let the aws_ami_copy and aws_ami_from_instance - // resources record that they implicitly created new EBS snapshots that we should - // now manage. Not set by aws_ami, since the snapshots used there are presumed to - // be independently managed. - "manage_ebs_snapshots": { - Type: schema.TypeBool, - Computed: true, - ForceNew: true, - }, - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_copy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_copy.go deleted file mode 100644 index 3452d5b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_copy.go +++ /dev/null @@ -1,90 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAmiCopy() *schema.Resource { - // Inherit all of the common AMI attributes from aws_ami, since we're - // implicitly creating an aws_ami resource. - resourceSchema := resourceAwsAmiCommonSchema(true) - - // Additional attributes unique to the copy operation. - resourceSchema["source_ami_id"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - } - resourceSchema["source_ami_region"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - } - - resourceSchema["encrypted"] = &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - } - - resourceSchema["kms_key_id"] = &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateArn, - } - - return &schema.Resource{ - Create: resourceAwsAmiCopyCreate, - - Schema: resourceSchema, - - // The remaining operations are shared with the generic aws_ami resource, - // since the aws_ami_copy resource only differs in how it's created. - Read: resourceAwsAmiRead, - Update: resourceAwsAmiUpdate, - Delete: resourceAwsAmiDelete, - } -} - -func resourceAwsAmiCopyCreate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).ec2conn - - req := &ec2.CopyImageInput{ - Name: aws.String(d.Get("name").(string)), - Description: aws.String(d.Get("description").(string)), - SourceImageId: aws.String(d.Get("source_ami_id").(string)), - SourceRegion: aws.String(d.Get("source_ami_region").(string)), - Encrypted: aws.Bool(d.Get("encrypted").(bool)), - } - - if v, ok := d.GetOk("kms_key_id"); ok { - req.KmsKeyId = aws.String(v.(string)) - } - - res, err := client.CopyImage(req) - if err != nil { - return err - } - - id := *res.ImageId - d.SetId(id) - d.Partial(true) // make sure we record the id even if the rest of this gets interrupted - d.Set("id", id) - d.Set("manage_ebs_snapshots", true) - d.SetPartial("id") - d.SetPartial("manage_ebs_snapshots") - d.Partial(false) - - _, err = resourceAwsAmiWaitForAvailable(id, client) - if err != nil { - return err - } - - return resourceAwsAmiUpdate(d, meta) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_from_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_from_instance.go deleted file mode 100644 index cc272d3..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_from_instance.go +++ /dev/null @@ -1,70 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAmiFromInstance() *schema.Resource { - // Inherit all of the common AMI attributes from aws_ami, since we're - // implicitly creating an aws_ami resource. - resourceSchema := resourceAwsAmiCommonSchema(true) - - // Additional attributes unique to the copy operation. - resourceSchema["source_instance_id"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - } - resourceSchema["snapshot_without_reboot"] = &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - } - - return &schema.Resource{ - Create: resourceAwsAmiFromInstanceCreate, - - Schema: resourceSchema, - - // The remaining operations are shared with the generic aws_ami resource, - // since the aws_ami_copy resource only differs in how it's created. - Read: resourceAwsAmiRead, - Update: resourceAwsAmiUpdate, - Delete: resourceAwsAmiDelete, - } -} - -func resourceAwsAmiFromInstanceCreate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).ec2conn - - req := &ec2.CreateImageInput{ - Name: aws.String(d.Get("name").(string)), - Description: aws.String(d.Get("description").(string)), - InstanceId: aws.String(d.Get("source_instance_id").(string)), - NoReboot: aws.Bool(d.Get("snapshot_without_reboot").(bool)), - } - - res, err := client.CreateImage(req) - if err != nil { - return err - } - - id := *res.ImageId - d.SetId(id) - d.Partial(true) // make sure we record the id even if the rest of this gets interrupted - d.Set("id", id) - d.Set("manage_ebs_snapshots", true) - d.SetPartial("id") - d.SetPartial("manage_ebs_snapshots") - d.Partial(false) - - _, err = resourceAwsAmiWaitForAvailable(id, client) - if err != nil { - return err - } - - return resourceAwsAmiUpdate(d, meta) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_launch_permission.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_launch_permission.go deleted file mode 100644 index d1c738d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ami_launch_permission.go +++ /dev/null @@ -1,104 +0,0 @@ -package aws - -import ( - "fmt" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAmiLaunchPermission() *schema.Resource { - return &schema.Resource{ - Exists: resourceAwsAmiLaunchPermissionExists, - Create: resourceAwsAmiLaunchPermissionCreate, - Read: resourceAwsAmiLaunchPermissionRead, - Delete: resourceAwsAmiLaunchPermissionDelete, - - Schema: map[string]*schema.Schema{ - "image_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "account_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsAmiLaunchPermissionExists(d *schema.ResourceData, meta interface{}) (bool, error) { - conn := meta.(*AWSClient).ec2conn - - image_id := d.Get("image_id").(string) - account_id := d.Get("account_id").(string) - return hasLaunchPermission(conn, image_id, account_id) -} - -func resourceAwsAmiLaunchPermissionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - image_id := d.Get("image_id").(string) - account_id := d.Get("account_id").(string) - - _, err := conn.ModifyImageAttribute(&ec2.ModifyImageAttributeInput{ - ImageId: aws.String(image_id), - Attribute: aws.String("launchPermission"), - LaunchPermission: &ec2.LaunchPermissionModifications{ - Add: []*ec2.LaunchPermission{ - &ec2.LaunchPermission{UserId: aws.String(account_id)}, - }, - }, - }) - if err != nil { - return fmt.Errorf("error creating ami launch permission: %s", err) - } - - d.SetId(fmt.Sprintf("%s-%s", image_id, account_id)) - return nil -} - -func resourceAwsAmiLaunchPermissionRead(d *schema.ResourceData, meta interface{}) error { - return nil -} - -func resourceAwsAmiLaunchPermissionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - image_id := d.Get("image_id").(string) - account_id := d.Get("account_id").(string) - - _, err := conn.ModifyImageAttribute(&ec2.ModifyImageAttributeInput{ - ImageId: aws.String(image_id), - Attribute: aws.String("launchPermission"), - LaunchPermission: &ec2.LaunchPermissionModifications{ - Remove: []*ec2.LaunchPermission{ - &ec2.LaunchPermission{UserId: aws.String(account_id)}, - }, - }, - }) - if err != nil { - return fmt.Errorf("error removing ami launch permission: %s", err) - } - - return nil -} - -func hasLaunchPermission(conn *ec2.EC2, image_id string, account_id string) (bool, error) { - attrs, err := conn.DescribeImageAttribute(&ec2.DescribeImageAttributeInput{ - ImageId: aws.String(image_id), - Attribute: aws.String("launchPermission"), - }) - if err != nil { - return false, err - } - - for _, lp := range attrs.LaunchPermissions { - if *lp.UserId == account_id { - return true, nil - } - } - return false, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_account.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_account.go deleted file mode 100644 index 7b78627..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_account.go +++ /dev/null @@ -1,127 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayAccount() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayAccountUpdate, - Read: resourceAwsApiGatewayAccountRead, - Update: resourceAwsApiGatewayAccountUpdate, - Delete: resourceAwsApiGatewayAccountDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "cloudwatch_role_arn": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "throttle_settings": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "burst_limit": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - "rate_limit": &schema.Schema{ - Type: schema.TypeFloat, - Computed: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsApiGatewayAccountRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[INFO] Reading API Gateway Account %s", d.Id()) - account, err := conn.GetAccount(&apigateway.GetAccountInput{}) - if err != nil { - return err - } - - log.Printf("[DEBUG] Received API Gateway Account: %s", account) - - if _, ok := d.GetOk("cloudwatch_role_arn"); ok { - // CloudwatchRoleArn cannot be empty nor made empty via API - // This resource can however be useful w/out defining cloudwatch_role_arn - // (e.g. for referencing throttle_settings) - d.Set("cloudwatch_role_arn", account.CloudwatchRoleArn) - } - d.Set("throttle_settings", flattenApiGatewayThrottleSettings(account.ThrottleSettings)) - - return nil -} - -func resourceAwsApiGatewayAccountUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - input := apigateway.UpdateAccountInput{} - operations := make([]*apigateway.PatchOperation, 0) - - if d.HasChange("cloudwatch_role_arn") { - arn := d.Get("cloudwatch_role_arn").(string) - if len(arn) > 0 { - // Unfortunately AWS API doesn't allow empty ARNs, - // even though that's default settings for new AWS accounts - // BadRequestException: The role ARN is not well formed - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/cloudwatchRoleArn"), - Value: aws.String(arn), - }) - } - } - input.PatchOperations = operations - - log.Printf("[INFO] Updating API Gateway Account: %s", input) - - // Retry due to eventual consistency of IAM - expectedErrMsg := "The role ARN does not have required permissions set to API Gateway" - otherErrMsg := "API Gateway could not successfully write to CloudWatch Logs using the ARN specified" - var out *apigateway.Account - var err error - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - out, err = conn.UpdateAccount(&input) - - if err != nil { - if isAWSErr(err, "BadRequestException", expectedErrMsg) || - isAWSErr(err, "BadRequestException", otherErrMsg) { - log.Printf("[DEBUG] Retrying API Gateway Account update: %s", err) - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - - return nil - }) - if err != nil { - return fmt.Errorf("Updating API Gateway Account failed: %s", err) - } - log.Printf("[DEBUG] API Gateway Account updated: %s", out) - - d.SetId("api-gateway-account") - return resourceAwsApiGatewayAccountRead(d, meta) -} - -func resourceAwsApiGatewayAccountDelete(d *schema.ResourceData, meta interface{}) error { - // There is no API for "deleting" account or resetting it to "default" settings - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_api_key.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_api_key.go deleted file mode 100644 index fe606a5..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_api_key.go +++ /dev/null @@ -1,189 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayApiKey() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayApiKeyCreate, - Read: resourceAwsApiGatewayApiKeyRead, - Update: resourceAwsApiGatewayApiKeyUpdate, - Delete: resourceAwsApiGatewayApiKeyDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": { - Type: schema.TypeString, - Optional: true, - Default: "Managed by Terraform", - }, - - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "stage_key": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "rest_api_id": { - Type: schema.TypeString, - Required: true, - }, - - "stage_name": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - - "created_date": { - Type: schema.TypeString, - Computed: true, - }, - - "last_updated_date": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsApiGatewayApiKeyCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Creating API Gateway API Key") - - apiKey, err := conn.CreateApiKey(&apigateway.CreateApiKeyInput{ - Name: aws.String(d.Get("name").(string)), - Description: aws.String(d.Get("description").(string)), - Enabled: aws.Bool(d.Get("enabled").(bool)), - StageKeys: expandApiGatewayStageKeys(d), - }) - if err != nil { - return fmt.Errorf("Error creating API Gateway: %s", err) - } - - d.SetId(*apiKey.Id) - - return resourceAwsApiGatewayApiKeyRead(d, meta) -} - -func resourceAwsApiGatewayApiKeyRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Reading API Gateway API Key: %s", d.Id()) - - apiKey, err := conn.GetApiKey(&apigateway.GetApiKeyInput{ - ApiKey: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - - return err - } - - d.Set("name", apiKey.Name) - d.Set("description", apiKey.Description) - d.Set("enabled", apiKey.Enabled) - d.Set("stage_key", flattenApiGatewayStageKeys(apiKey.StageKeys)) - - if err := d.Set("created_date", apiKey.CreatedDate.Format(time.RFC3339)); err != nil { - log.Printf("[DEBUG] Error setting created_date: %s", err) - } - - if err := d.Set("last_updated_date", apiKey.LastUpdatedDate.Format(time.RFC3339)); err != nil { - log.Printf("[DEBUG] Error setting last_updated_date: %s", err) - } - - return nil -} - -func resourceAwsApiGatewayApiKeyUpdateOperations(d *schema.ResourceData) []*apigateway.PatchOperation { - operations := make([]*apigateway.PatchOperation, 0) - if d.HasChange("enabled") { - isEnabled := "false" - if d.Get("enabled").(bool) { - isEnabled = "true" - } - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/enabled"), - Value: aws.String(isEnabled), - }) - } - - if d.HasChange("description") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/description"), - Value: aws.String(d.Get("description").(string)), - }) - } - - if d.HasChange("stage_key") { - operations = append(operations, expandApiGatewayStageKeyOperations(d)...) - } - return operations -} - -func resourceAwsApiGatewayApiKeyUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Updating API Gateway API Key: %s", d.Id()) - - _, err := conn.UpdateApiKey(&apigateway.UpdateApiKeyInput{ - ApiKey: aws.String(d.Id()), - PatchOperations: resourceAwsApiGatewayApiKeyUpdateOperations(d), - }) - if err != nil { - return err - } - - return resourceAwsApiGatewayApiKeyRead(d, meta) -} - -func resourceAwsApiGatewayApiKeyDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway API Key: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteApiKey(&apigateway.DeleteApiKeyInput{ - ApiKey: aws.String(d.Id()), - }) - - if err == nil { - return nil - } - - if apigatewayErr, ok := err.(awserr.Error); ok && apigatewayErr.Code() == "NotFoundException" { - return nil - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_authorizer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_authorizer.go deleted file mode 100644 index 8f881e1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_authorizer.go +++ /dev/null @@ -1,212 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayAuthorizer() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayAuthorizerCreate, - Read: resourceAwsApiGatewayAuthorizerRead, - Update: resourceAwsApiGatewayAuthorizerUpdate, - Delete: resourceAwsApiGatewayAuthorizerDelete, - - Schema: map[string]*schema.Schema{ - "authorizer_uri": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "identity_source": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "method.request.header.Authorization", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "rest_api_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "TOKEN", - }, - "authorizer_credentials": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "authorizer_result_ttl_in_seconds": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ValidateFunc: validateIntegerInRange(0, 3600), - }, - "identity_validation_expression": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func resourceAwsApiGatewayAuthorizerCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - input := apigateway.CreateAuthorizerInput{ - AuthorizerUri: aws.String(d.Get("authorizer_uri").(string)), - IdentitySource: aws.String(d.Get("identity_source").(string)), - Name: aws.String(d.Get("name").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - Type: aws.String(d.Get("type").(string)), - } - - if v, ok := d.GetOk("authorizer_credentials"); ok { - input.AuthorizerCredentials = aws.String(v.(string)) - } - if v, ok := d.GetOk("authorizer_result_ttl_in_seconds"); ok { - input.AuthorizerResultTtlInSeconds = aws.Int64(int64(v.(int))) - } - if v, ok := d.GetOk("identity_validation_expression"); ok { - input.IdentityValidationExpression = aws.String(v.(string)) - } - - log.Printf("[INFO] Creating API Gateway Authorizer: %s", input) - out, err := conn.CreateAuthorizer(&input) - if err != nil { - return fmt.Errorf("Error creating API Gateway Authorizer: %s", err) - } - - d.SetId(*out.Id) - - return resourceAwsApiGatewayAuthorizerRead(d, meta) -} - -func resourceAwsApiGatewayAuthorizerRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[INFO] Reading API Gateway Authorizer %s", d.Id()) - input := apigateway.GetAuthorizerInput{ - AuthorizerId: aws.String(d.Id()), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - } - - authorizer, err := conn.GetAuthorizer(&input) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - log.Printf("[WARN] No API Gateway Authorizer found: %s", input) - d.SetId("") - return nil - } - return err - } - log.Printf("[DEBUG] Received API Gateway Authorizer: %s", authorizer) - - d.Set("authorizer_credentials", authorizer.AuthorizerCredentials) - d.Set("authorizer_result_ttl_in_seconds", authorizer.AuthorizerResultTtlInSeconds) - d.Set("authorizer_uri", authorizer.AuthorizerUri) - d.Set("identity_source", authorizer.IdentitySource) - d.Set("identity_validation_expression", authorizer.IdentityValidationExpression) - d.Set("name", authorizer.Name) - d.Set("type", authorizer.Type) - - return nil -} - -func resourceAwsApiGatewayAuthorizerUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - input := apigateway.UpdateAuthorizerInput{ - AuthorizerId: aws.String(d.Id()), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - } - - operations := make([]*apigateway.PatchOperation, 0) - - if d.HasChange("authorizer_uri") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/authorizerUri"), - Value: aws.String(d.Get("authorizer_uri").(string)), - }) - } - if d.HasChange("identity_source") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/identitySource"), - Value: aws.String(d.Get("identity_source").(string)), - }) - } - if d.HasChange("name") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/name"), - Value: aws.String(d.Get("name").(string)), - }) - } - if d.HasChange("type") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/type"), - Value: aws.String(d.Get("type").(string)), - }) - } - if d.HasChange("authorizer_credentials") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/authorizerCredentials"), - Value: aws.String(d.Get("authorizer_credentials").(string)), - }) - } - if d.HasChange("authorizer_result_ttl_in_seconds") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/authorizerResultTtlInSeconds"), - Value: aws.String(fmt.Sprintf("%d", d.Get("authorizer_result_ttl_in_seconds").(int))), - }) - } - if d.HasChange("identity_validation_expression") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/identityValidationExpression"), - Value: aws.String(d.Get("identity_validation_expression").(string)), - }) - } - input.PatchOperations = operations - - log.Printf("[INFO] Updating API Gateway Authorizer: %s", input) - _, err := conn.UpdateAuthorizer(&input) - if err != nil { - return fmt.Errorf("Updating API Gateway Authorizer failed: %s", err) - } - - return resourceAwsApiGatewayAuthorizerRead(d, meta) -} - -func resourceAwsApiGatewayAuthorizerDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - input := apigateway.DeleteAuthorizerInput{ - AuthorizerId: aws.String(d.Id()), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - } - log.Printf("[INFO] Deleting API Gateway Authorizer: %s", input) - _, err := conn.DeleteAuthorizer(&input) - if err != nil { - // XXX: Figure out a way to delete the method that depends on the authorizer first - // otherwise the authorizer will be dangling until the API is deleted - if !strings.Contains(err.Error(), "ConflictException") { - return fmt.Errorf("Deleting API Gateway Authorizer failed: %s", err) - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_base_path_mapping.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_base_path_mapping.go deleted file mode 100644 index a041719..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_base_path_mapping.go +++ /dev/null @@ -1,146 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -const emptyBasePathMappingValue = "(none)" - -func resourceAwsApiGatewayBasePathMapping() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayBasePathMappingCreate, - Read: resourceAwsApiGatewayBasePathMappingRead, - Delete: resourceAwsApiGatewayBasePathMappingDelete, - - Schema: map[string]*schema.Schema{ - "api_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "base_path": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "stage_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "domain_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsApiGatewayBasePathMappingCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - err := resource.Retry(30*time.Second, func() *resource.RetryError { - _, err := conn.CreateBasePathMapping(&apigateway.CreateBasePathMappingInput{ - RestApiId: aws.String(d.Get("api_id").(string)), - DomainName: aws.String(d.Get("domain_name").(string)), - BasePath: aws.String(d.Get("base_path").(string)), - Stage: aws.String(d.Get("stage_name").(string)), - }) - - if err != nil { - if err, ok := err.(awserr.Error); ok && err.Code() != "BadRequestException" { - return resource.NonRetryableError(err) - } - - return resource.RetryableError( - fmt.Errorf("Error creating Gateway base path mapping: %s", err), - ) - } - - return nil - }) - - if err != nil { - return fmt.Errorf("Error creating Gateway base path mapping: %s", err) - } - - id := fmt.Sprintf("%s/%s", d.Get("domain_name").(string), d.Get("base_path").(string)) - d.SetId(id) - - return resourceAwsApiGatewayBasePathMappingRead(d, meta) -} - -func resourceAwsApiGatewayBasePathMappingRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - domainName := d.Get("domain_name").(string) - basePath := d.Get("base_path").(string) - - if domainName == "" { - return nil - } - - if basePath == "" { - basePath = emptyBasePathMappingValue - } - - mapping, err := conn.GetBasePathMapping(&apigateway.GetBasePathMappingInput{ - DomainName: aws.String(domainName), - BasePath: aws.String(basePath), - }) - if err != nil { - if err, ok := err.(awserr.Error); ok && err.Code() == "NotFoundException" { - log.Printf("[WARN] API gateway base path mapping %s has vanished\n", d.Id()) - d.SetId("") - return nil - } - - return fmt.Errorf("Error reading Gateway base path mapping: %s", err) - } - - mappingBasePath := *mapping.BasePath - - if mappingBasePath == emptyBasePathMappingValue { - mappingBasePath = "" - } - - d.Set("base_path", mappingBasePath) - d.Set("api_id", mapping.RestApiId) - d.Set("stage_name", mapping.Stage) - - return nil -} - -func resourceAwsApiGatewayBasePathMappingDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - basePath := d.Get("base_path").(string) - - if basePath == "" { - basePath = emptyBasePathMappingValue - } - - _, err := conn.DeleteBasePathMapping(&apigateway.DeleteBasePathMappingInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - BasePath: aws.String(basePath), - }) - - if err != nil { - if err, ok := err.(awserr.Error); ok && err.Code() == "NotFoundException" { - return nil - } - - return err - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_client_certificate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_client_certificate.go deleted file mode 100644 index 77bb7f6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_client_certificate.go +++ /dev/null @@ -1,125 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayClientCertificate() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayClientCertificateCreate, - Read: resourceAwsApiGatewayClientCertificateRead, - Update: resourceAwsApiGatewayClientCertificateUpdate, - Delete: resourceAwsApiGatewayClientCertificateDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "description": { - Type: schema.TypeString, - Optional: true, - }, - "created_date": { - Type: schema.TypeString, - Computed: true, - }, - "expiration_date": { - Type: schema.TypeString, - Computed: true, - }, - "pem_encoded_certificate": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsApiGatewayClientCertificateCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - input := apigateway.GenerateClientCertificateInput{} - if v, ok := d.GetOk("description"); ok { - input.Description = aws.String(v.(string)) - } - log.Printf("[DEBUG] Generating API Gateway Client Certificate: %s", input) - out, err := conn.GenerateClientCertificate(&input) - if err != nil { - return fmt.Errorf("Failed to generate client certificate: %s", err) - } - - d.SetId(*out.ClientCertificateId) - - return resourceAwsApiGatewayClientCertificateRead(d, meta) -} - -func resourceAwsApiGatewayClientCertificateRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - input := apigateway.GetClientCertificateInput{ - ClientCertificateId: aws.String(d.Id()), - } - out, err := conn.GetClientCertificate(&input) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - log.Printf("[WARN] API Gateway Client Certificate %s not found, removing", d.Id()) - d.SetId("") - return nil - } - return err - } - log.Printf("[DEBUG] Received API Gateway Client Certificate: %s", out) - - d.Set("description", out.Description) - d.Set("created_date", out.CreatedDate) - d.Set("expiration_date", out.ExpirationDate) - d.Set("pem_encoded_certificate", out.PemEncodedCertificate) - - return nil -} - -func resourceAwsApiGatewayClientCertificateUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - operations := make([]*apigateway.PatchOperation, 0) - if d.HasChange("description") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/description"), - Value: aws.String(d.Get("description").(string)), - }) - } - - input := apigateway.UpdateClientCertificateInput{ - ClientCertificateId: aws.String(d.Id()), - PatchOperations: operations, - } - - log.Printf("[DEBUG] Updating API Gateway Client Certificate: %s", input) - _, err := conn.UpdateClientCertificate(&input) - if err != nil { - return fmt.Errorf("Updating API Gateway Client Certificate failed: %s", err) - } - - return resourceAwsApiGatewayClientCertificateRead(d, meta) -} - -func resourceAwsApiGatewayClientCertificateDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Client Certificate: %s", d.Id()) - input := apigateway.DeleteClientCertificateInput{ - ClientCertificateId: aws.String(d.Id()), - } - _, err := conn.DeleteClientCertificate(&input) - if err != nil { - return fmt.Errorf("Deleting API Gateway Client Certificate failed: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_deployment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_deployment.go deleted file mode 100644 index 4947762..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_deployment.go +++ /dev/null @@ -1,177 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayDeployment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayDeploymentCreate, - Read: resourceAwsApiGatewayDeploymentRead, - Update: resourceAwsApiGatewayDeploymentUpdate, - Delete: resourceAwsApiGatewayDeploymentDelete, - - Schema: map[string]*schema.Schema{ - "rest_api_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "stage_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": { - Type: schema.TypeString, - Optional: true, - }, - - "stage_description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "variables": { - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - Elem: schema.TypeString, - }, - - "created_date": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsApiGatewayDeploymentCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - // Create the gateway - log.Printf("[DEBUG] Creating API Gateway Deployment") - - variables := make(map[string]string) - for k, v := range d.Get("variables").(map[string]interface{}) { - variables[k] = v.(string) - } - - var err error - deployment, err := conn.CreateDeployment(&apigateway.CreateDeploymentInput{ - RestApiId: aws.String(d.Get("rest_api_id").(string)), - StageName: aws.String(d.Get("stage_name").(string)), - Description: aws.String(d.Get("description").(string)), - StageDescription: aws.String(d.Get("stage_description").(string)), - Variables: aws.StringMap(variables), - }) - if err != nil { - return fmt.Errorf("Error creating API Gateway Deployment: %s", err) - } - - d.SetId(*deployment.Id) - log.Printf("[DEBUG] API Gateway Deployment ID: %s", d.Id()) - - return resourceAwsApiGatewayDeploymentRead(d, meta) -} - -func resourceAwsApiGatewayDeploymentRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Deployment %s", d.Id()) - out, err := conn.GetDeployment(&apigateway.GetDeploymentInput{ - RestApiId: aws.String(d.Get("rest_api_id").(string)), - DeploymentId: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - log.Printf("[DEBUG] Received API Gateway Deployment: %s", out) - d.Set("description", out.Description) - - if err := d.Set("created_date", out.CreatedDate.Format(time.RFC3339)); err != nil { - log.Printf("[DEBUG] Error setting created_date: %s", err) - } - - return nil -} - -func resourceAwsApiGatewayDeploymentUpdateOperations(d *schema.ResourceData) []*apigateway.PatchOperation { - operations := make([]*apigateway.PatchOperation, 0) - - if d.HasChange("description") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/description"), - Value: aws.String(d.Get("description").(string)), - }) - } - - return operations -} - -func resourceAwsApiGatewayDeploymentUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Updating API Gateway API Key: %s", d.Id()) - - _, err := conn.UpdateDeployment(&apigateway.UpdateDeploymentInput{ - DeploymentId: aws.String(d.Id()), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - PatchOperations: resourceAwsApiGatewayDeploymentUpdateOperations(d), - }) - if err != nil { - return err - } - - return resourceAwsApiGatewayDeploymentRead(d, meta) -} - -func resourceAwsApiGatewayDeploymentDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Deployment: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] schema is %#v", d) - if _, err := conn.DeleteStage(&apigateway.DeleteStageInput{ - StageName: aws.String(d.Get("stage_name").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }); err == nil { - return nil - } - - _, err := conn.DeleteDeployment(&apigateway.DeleteDeploymentInput{ - DeploymentId: aws.String(d.Id()), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - if err == nil { - return nil - } - - apigatewayErr, ok := err.(awserr.Error) - if apigatewayErr.Code() == "NotFoundException" { - return nil - } - - if !ok { - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_domain_name.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_domain_name.go deleted file mode 100644 index 103f7be..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_domain_name.go +++ /dev/null @@ -1,209 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayDomainName() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayDomainNameCreate, - Read: resourceAwsApiGatewayDomainNameRead, - Update: resourceAwsApiGatewayDomainNameUpdate, - Delete: resourceAwsApiGatewayDomainNameDelete, - - Schema: map[string]*schema.Schema{ - - //According to AWS Documentation, ACM will be the only way to add certificates - //to ApiGateway DomainNames. When this happens, we will be deprecating all certificate methods - //except certificate_arn. We are not quite sure when this will happen. - "certificate_body": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - ConflictsWith: []string{"certificate_arn"}, - }, - - "certificate_chain": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - ConflictsWith: []string{"certificate_arn"}, - }, - - "certificate_name": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"certificate_arn"}, - }, - - "certificate_private_key": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - ConflictsWith: []string{"certificate_arn"}, - }, - - "domain_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "certificate_arn": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"certificate_body", "certificate_chain", "certificate_name", "certificate_private_key"}, - }, - - "cloudfront_domain_name": { - Type: schema.TypeString, - Computed: true, - }, - - "certificate_upload_date": { - Type: schema.TypeString, - Computed: true, - }, - - "cloudfront_zone_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsApiGatewayDomainNameCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Creating API Gateway Domain Name") - - params := &apigateway.CreateDomainNameInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - } - - if v, ok := d.GetOk("certificate_arn"); ok { - params.CertificateArn = aws.String(v.(string)) - } - - if v, ok := d.GetOk("certificate_name"); ok { - params.CertificateName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("certificate_body"); ok { - params.CertificateBody = aws.String(v.(string)) - } - - if v, ok := d.GetOk("certificate_chain"); ok { - params.CertificateChain = aws.String(v.(string)) - } - - if v, ok := d.GetOk("certificate_private_key"); ok { - params.CertificatePrivateKey = aws.String(v.(string)) - } - - domainName, err := conn.CreateDomainName(params) - if err != nil { - return fmt.Errorf("Error creating API Gateway Domain Name: %s", err) - } - - d.SetId(*domainName.DomainName) - d.Set("cloudfront_domain_name", domainName.DistributionDomainName) - d.Set("cloudfront_zone_id", cloudFrontRoute53ZoneID) - - return resourceAwsApiGatewayDomainNameRead(d, meta) -} - -func resourceAwsApiGatewayDomainNameRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Reading API Gateway Domain Name %s", d.Id()) - - domainName, err := conn.GetDomainName(&apigateway.GetDomainNameInput{ - DomainName: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - log.Printf("[WARN] API gateway domain name %s has vanished\n", d.Id()) - d.SetId("") - return nil - } - - return err - } - - d.Set("certificate_name", domainName.CertificateName) - if err := d.Set("certificate_upload_date", domainName.CertificateUploadDate.Format(time.RFC3339)); err != nil { - log.Printf("[DEBUG] Error setting certificate_upload_date: %s", err) - } - d.Set("cloudfront_domain_name", domainName.DistributionDomainName) - d.Set("domain_name", domainName.DomainName) - d.Set("certificate_arn", domainName.CertificateArn) - - return nil -} - -func resourceAwsApiGatewayDomainNameUpdateOperations(d *schema.ResourceData) []*apigateway.PatchOperation { - operations := make([]*apigateway.PatchOperation, 0) - - if d.HasChange("certificate_name") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/certificateName"), - Value: aws.String(d.Get("certificate_name").(string)), - }) - } - - if d.HasChange("certificate_arn") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/certificateArn"), - Value: aws.String(d.Get("certificate_arn").(string)), - }) - } - - return operations -} - -func resourceAwsApiGatewayDomainNameUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Updating API Gateway Domain Name %s", d.Id()) - - _, err := conn.UpdateDomainName(&apigateway.UpdateDomainNameInput{ - DomainName: aws.String(d.Id()), - PatchOperations: resourceAwsApiGatewayDomainNameUpdateOperations(d), - }) - - if err != nil { - return err - } - - return resourceAwsApiGatewayDomainNameRead(d, meta) -} - -func resourceAwsApiGatewayDomainNameDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Domain Name: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteDomainName(&apigateway.DeleteDomainNameInput{ - DomainName: aws.String(d.Id()), - }) - - if err == nil { - return nil - } - - if apigatewayErr, ok := err.(awserr.Error); ok && apigatewayErr.Code() == "NotFoundException" { - return nil - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_integration.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_integration.go deleted file mode 100644 index b069828..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_integration.go +++ /dev/null @@ -1,230 +0,0 @@ -package aws - -import ( - "encoding/json" - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayIntegration() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayIntegrationCreate, - Read: resourceAwsApiGatewayIntegrationRead, - Update: resourceAwsApiGatewayIntegrationCreate, - Delete: resourceAwsApiGatewayIntegrationDelete, - - Schema: map[string]*schema.Schema{ - "rest_api_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "resource_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "http_method": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateHTTPMethod, - }, - - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateApiGatewayIntegrationType, - }, - - "uri": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "credentials": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "integration_http_method": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateHTTPMethod, - }, - - "request_templates": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - Elem: schema.TypeString, - }, - - "request_parameters": &schema.Schema{ - Type: schema.TypeMap, - Elem: schema.TypeString, - Optional: true, - ConflictsWith: []string{"request_parameters_in_json"}, - }, - - "request_parameters_in_json": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"request_parameters"}, - Deprecated: "Use field request_parameters instead", - }, - - "content_handling": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateApiGatewayIntegrationContentHandling, - }, - - "passthrough_behavior": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateApiGatewayIntegrationPassthroughBehavior, - }, - }, - } -} - -func resourceAwsApiGatewayIntegrationCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - var integrationHttpMethod *string - if v, ok := d.GetOk("integration_http_method"); ok { - integrationHttpMethod = aws.String(v.(string)) - } - var uri *string - if v, ok := d.GetOk("uri"); ok { - uri = aws.String(v.(string)) - } - templates := make(map[string]string) - for k, v := range d.Get("request_templates").(map[string]interface{}) { - templates[k] = v.(string) - } - - parameters := make(map[string]string) - if kv, ok := d.GetOk("request_parameters"); ok { - for k, v := range kv.(map[string]interface{}) { - parameters[k] = v.(string) - } - } - - if v, ok := d.GetOk("request_parameters_in_json"); ok { - if err := json.Unmarshal([]byte(v.(string)), ¶meters); err != nil { - return fmt.Errorf("Error unmarshaling request_parameters_in_json: %s", err) - } - } - - var passthroughBehavior *string - if v, ok := d.GetOk("passthrough_behavior"); ok { - passthroughBehavior = aws.String(v.(string)) - } - - var credentials *string - if val, ok := d.GetOk("credentials"); ok { - credentials = aws.String(val.(string)) - } - - var contentHandling *string - if val, ok := d.GetOk("content_handling"); ok { - contentHandling = aws.String(val.(string)) - } - - _, err := conn.PutIntegration(&apigateway.PutIntegrationInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - Type: aws.String(d.Get("type").(string)), - IntegrationHttpMethod: integrationHttpMethod, - Uri: uri, - RequestParameters: aws.StringMap(parameters), - RequestTemplates: aws.StringMap(templates), - Credentials: credentials, - CacheNamespace: nil, - CacheKeyParameters: nil, - PassthroughBehavior: passthroughBehavior, - ContentHandling: contentHandling, - }) - if err != nil { - return fmt.Errorf("Error creating API Gateway Integration: %s", err) - } - - d.SetId(fmt.Sprintf("agi-%s-%s-%s", d.Get("rest_api_id").(string), d.Get("resource_id").(string), d.Get("http_method").(string))) - - return nil -} - -func resourceAwsApiGatewayIntegrationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Integration %s", d.Id()) - integration, err := conn.GetIntegration(&apigateway.GetIntegrationInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - log.Printf("[DEBUG] Received API Gateway Integration: %s", integration) - d.SetId(fmt.Sprintf("agi-%s-%s-%s", d.Get("rest_api_id").(string), d.Get("resource_id").(string), d.Get("http_method").(string))) - - // AWS converts "" to null on their side, convert it back - if v, ok := integration.RequestTemplates["application/json"]; ok && v == nil { - integration.RequestTemplates["application/json"] = aws.String("") - } - - d.Set("request_templates", aws.StringValueMap(integration.RequestTemplates)) - d.Set("credentials", integration.Credentials) - d.Set("type", integration.Type) - d.Set("uri", integration.Uri) - d.Set("request_parameters", aws.StringValueMap(integration.RequestParameters)) - d.Set("request_parameters_in_json", aws.StringValueMap(integration.RequestParameters)) - d.Set("passthrough_behavior", integration.PassthroughBehavior) - d.Set("content_handling", integration.ContentHandling) - - return nil -} - -func resourceAwsApiGatewayIntegrationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Integration: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteIntegration(&apigateway.DeleteIntegrationInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - if err == nil { - return nil - } - - apigatewayErr, ok := err.(awserr.Error) - if apigatewayErr.Code() == "NotFoundException" { - return nil - } - - if !ok { - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_integration_response.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_integration_response.go deleted file mode 100644 index 24c66f2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_integration_response.go +++ /dev/null @@ -1,184 +0,0 @@ -package aws - -import ( - "encoding/json" - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayIntegrationResponse() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayIntegrationResponseCreate, - Read: resourceAwsApiGatewayIntegrationResponseRead, - Update: resourceAwsApiGatewayIntegrationResponseCreate, - Delete: resourceAwsApiGatewayIntegrationResponseDelete, - - Schema: map[string]*schema.Schema{ - "rest_api_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "resource_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "http_method": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateHTTPMethod, - }, - - "status_code": { - Type: schema.TypeString, - Required: true, - }, - - "selection_pattern": { - Type: schema.TypeString, - Optional: true, - }, - - "response_templates": { - Type: schema.TypeMap, - Optional: true, - Elem: schema.TypeString, - }, - - "response_parameters": { - Type: schema.TypeMap, - Elem: schema.TypeString, - Optional: true, - ConflictsWith: []string{"response_parameters_in_json"}, - }, - - "response_parameters_in_json": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"response_parameters"}, - Deprecated: "Use field response_parameters instead", - }, - - "content_handling": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateApiGatewayIntegrationContentHandling, - }, - }, - } -} - -func resourceAwsApiGatewayIntegrationResponseCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - templates := make(map[string]string) - for k, v := range d.Get("response_templates").(map[string]interface{}) { - templates[k] = v.(string) - } - - parameters := make(map[string]string) - if kv, ok := d.GetOk("response_parameters"); ok { - for k, v := range kv.(map[string]interface{}) { - parameters[k] = v.(string) - } - } - if v, ok := d.GetOk("response_parameters_in_json"); ok { - if err := json.Unmarshal([]byte(v.(string)), ¶meters); err != nil { - return fmt.Errorf("Error unmarshaling response_parameters_in_json: %s", err) - } - } - var contentHandling *string - if val, ok := d.GetOk("content_handling"); ok { - contentHandling = aws.String(val.(string)) - } - - input := apigateway.PutIntegrationResponseInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - StatusCode: aws.String(d.Get("status_code").(string)), - ResponseTemplates: aws.StringMap(templates), - ResponseParameters: aws.StringMap(parameters), - ContentHandling: contentHandling, - } - if v, ok := d.GetOk("selection_pattern"); ok { - input.SelectionPattern = aws.String(v.(string)) - } - - _, err := conn.PutIntegrationResponse(&input) - if err != nil { - return fmt.Errorf("Error creating API Gateway Integration Response: %s", err) - } - - d.SetId(fmt.Sprintf("agir-%s-%s-%s-%s", d.Get("rest_api_id").(string), d.Get("resource_id").(string), d.Get("http_method").(string), d.Get("status_code").(string))) - log.Printf("[DEBUG] API Gateway Integration Response ID: %s", d.Id()) - - return resourceAwsApiGatewayIntegrationResponseRead(d, meta) -} - -func resourceAwsApiGatewayIntegrationResponseRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Integration Response %s", d.Id()) - integrationResponse, err := conn.GetIntegrationResponse(&apigateway.GetIntegrationResponseInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - StatusCode: aws.String(d.Get("status_code").(string)), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - - log.Printf("[DEBUG] Received API Gateway Integration Response: %s", integrationResponse) - - d.SetId(fmt.Sprintf("agir-%s-%s-%s-%s", d.Get("rest_api_id").(string), d.Get("resource_id").(string), d.Get("http_method").(string), d.Get("status_code").(string))) - d.Set("response_templates", integrationResponse.ResponseTemplates) - d.Set("selection_pattern", integrationResponse.SelectionPattern) - d.Set("response_parameters", aws.StringValueMap(integrationResponse.ResponseParameters)) - d.Set("response_parameters_in_json", aws.StringValueMap(integrationResponse.ResponseParameters)) - return nil -} - -func resourceAwsApiGatewayIntegrationResponseDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Integration Response: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteIntegrationResponse(&apigateway.DeleteIntegrationResponseInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - StatusCode: aws.String(d.Get("status_code").(string)), - }) - if err == nil { - return nil - } - - apigatewayErr, ok := err.(awserr.Error) - if apigatewayErr.Code() == "NotFoundException" { - return nil - } - - if !ok { - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_method.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_method.go deleted file mode 100644 index 577c44e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_method.go +++ /dev/null @@ -1,270 +0,0 @@ -package aws - -import ( - "encoding/json" - "fmt" - "log" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayMethod() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayMethodCreate, - Read: resourceAwsApiGatewayMethodRead, - Update: resourceAwsApiGatewayMethodUpdate, - Delete: resourceAwsApiGatewayMethodDelete, - - Schema: map[string]*schema.Schema{ - "rest_api_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "resource_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "http_method": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateHTTPMethod, - }, - - "authorization": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "authorizer_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "api_key_required": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "request_models": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - Elem: schema.TypeString, - }, - - "request_parameters": &schema.Schema{ - Type: schema.TypeMap, - Elem: schema.TypeBool, - Optional: true, - ConflictsWith: []string{"request_parameters_in_json"}, - }, - - "request_parameters_in_json": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"request_parameters"}, - Deprecated: "Use field request_parameters instead", - }, - }, - } -} - -func resourceAwsApiGatewayMethodCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - input := apigateway.PutMethodInput{ - AuthorizationType: aws.String(d.Get("authorization").(string)), - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - ApiKeyRequired: aws.Bool(d.Get("api_key_required").(bool)), - } - - models := make(map[string]string) - for k, v := range d.Get("request_models").(map[string]interface{}) { - models[k] = v.(string) - } - if len(models) > 0 { - input.RequestModels = aws.StringMap(models) - } - - parameters := make(map[string]bool) - if kv, ok := d.GetOk("request_parameters"); ok { - for k, v := range kv.(map[string]interface{}) { - parameters[k], ok = v.(bool) - if !ok { - value, _ := strconv.ParseBool(v.(string)) - parameters[k] = value - } - } - input.RequestParameters = aws.BoolMap(parameters) - } - if v, ok := d.GetOk("request_parameters_in_json"); ok { - if err := json.Unmarshal([]byte(v.(string)), ¶meters); err != nil { - return fmt.Errorf("Error unmarshaling request_parameters_in_json: %s", err) - } - input.RequestParameters = aws.BoolMap(parameters) - } - - if v, ok := d.GetOk("authorizer_id"); ok { - input.AuthorizerId = aws.String(v.(string)) - } - - _, err := conn.PutMethod(&input) - if err != nil { - return fmt.Errorf("Error creating API Gateway Method: %s", err) - } - - d.SetId(fmt.Sprintf("agm-%s-%s-%s", d.Get("rest_api_id").(string), d.Get("resource_id").(string), d.Get("http_method").(string))) - log.Printf("[DEBUG] API Gateway Method ID: %s", d.Id()) - - return nil -} - -func resourceAwsApiGatewayMethodRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Method %s", d.Id()) - out, err := conn.GetMethod(&apigateway.GetMethodInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - log.Printf("[DEBUG] Received API Gateway Method: %s", out) - d.SetId(fmt.Sprintf("agm-%s-%s-%s", d.Get("rest_api_id").(string), d.Get("resource_id").(string), d.Get("http_method").(string))) - d.Set("request_parameters", aws.BoolValueMap(out.RequestParameters)) - d.Set("request_parameters_in_json", aws.BoolValueMap(out.RequestParameters)) - d.Set("api_key_required", out.ApiKeyRequired) - d.Set("authorization_type", out.AuthorizationType) - d.Set("authorizer_id", out.AuthorizerId) - d.Set("request_models", aws.StringValueMap(out.RequestModels)) - - return nil -} - -func resourceAwsApiGatewayMethodUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Method %s", d.Id()) - operations := make([]*apigateway.PatchOperation, 0) - if d.HasChange("resource_id") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/resourceId"), - Value: aws.String(d.Get("resource_id").(string)), - }) - } - - if d.HasChange("request_models") { - operations = append(operations, expandApiGatewayRequestResponseModelOperations(d, "request_models", "requestModels")...) - } - - if d.HasChange("request_parameters_in_json") { - ops, err := deprecatedExpandApiGatewayMethodParametersJSONOperations(d, "request_parameters_in_json", "requestParameters") - if err != nil { - return err - } - operations = append(operations, ops...) - } - - if d.HasChange("request_parameters") { - parameters := make(map[string]bool) - var ok bool - for k, v := range d.Get("request_parameters").(map[string]interface{}) { - parameters[k], ok = v.(bool) - if !ok { - value, _ := strconv.ParseBool(v.(string)) - parameters[k] = value - } - } - ops, err := expandApiGatewayMethodParametersOperations(d, "request_parameters", "requestParameters") - if err != nil { - return err - } - operations = append(operations, ops...) - } - - if d.HasChange("authorization") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/authorizationType"), - Value: aws.String(d.Get("authorization").(string)), - }) - } - - if d.HasChange("authorizer_id") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/authorizerId"), - Value: aws.String(d.Get("authorizer_id").(string)), - }) - } - - if d.HasChange("api_key_required") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/apiKeyRequired"), - Value: aws.String(fmt.Sprintf("%t", d.Get("api_key_required").(bool))), - }) - } - - method, err := conn.UpdateMethod(&apigateway.UpdateMethodInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - PatchOperations: operations, - }) - - if err != nil { - return err - } - - log.Printf("[DEBUG] Received API Gateway Method: %s", method) - - return resourceAwsApiGatewayMethodRead(d, meta) -} - -func resourceAwsApiGatewayMethodDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Method: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteMethod(&apigateway.DeleteMethodInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - if err == nil { - return nil - } - - apigatewayErr, ok := err.(awserr.Error) - if apigatewayErr.Code() == "NotFoundException" { - return nil - } - - if !ok { - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_method_response.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_method_response.go deleted file mode 100644 index b0b929a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_method_response.go +++ /dev/null @@ -1,210 +0,0 @@ -package aws - -import ( - "encoding/json" - "fmt" - "log" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayMethodResponse() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayMethodResponseCreate, - Read: resourceAwsApiGatewayMethodResponseRead, - Update: resourceAwsApiGatewayMethodResponseUpdate, - Delete: resourceAwsApiGatewayMethodResponseDelete, - - Schema: map[string]*schema.Schema{ - "rest_api_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "resource_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "http_method": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateHTTPMethod, - }, - - "status_code": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "response_models": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - Elem: schema.TypeString, - }, - - "response_parameters": &schema.Schema{ - Type: schema.TypeMap, - Elem: schema.TypeBool, - Optional: true, - ConflictsWith: []string{"response_parameters_in_json"}, - }, - - "response_parameters_in_json": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"response_parameters"}, - Deprecated: "Use field response_parameters instead", - }, - }, - } -} - -func resourceAwsApiGatewayMethodResponseCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - models := make(map[string]string) - for k, v := range d.Get("response_models").(map[string]interface{}) { - models[k] = v.(string) - } - - parameters := make(map[string]bool) - if kv, ok := d.GetOk("response_parameters"); ok { - for k, v := range kv.(map[string]interface{}) { - parameters[k], ok = v.(bool) - if !ok { - value, _ := strconv.ParseBool(v.(string)) - parameters[k] = value - } - } - } - if v, ok := d.GetOk("response_parameters_in_json"); ok { - if err := json.Unmarshal([]byte(v.(string)), ¶meters); err != nil { - return fmt.Errorf("Error unmarshaling request_parameters_in_json: %s", err) - } - } - - _, err := conn.PutMethodResponse(&apigateway.PutMethodResponseInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - StatusCode: aws.String(d.Get("status_code").(string)), - ResponseModels: aws.StringMap(models), - ResponseParameters: aws.BoolMap(parameters), - }) - if err != nil { - return fmt.Errorf("Error creating API Gateway Method Response: %s", err) - } - - d.SetId(fmt.Sprintf("agmr-%s-%s-%s-%s", d.Get("rest_api_id").(string), d.Get("resource_id").(string), d.Get("http_method").(string), d.Get("status_code").(string))) - log.Printf("[DEBUG] API Gateway Method ID: %s", d.Id()) - - return nil -} - -func resourceAwsApiGatewayMethodResponseRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Method %s", d.Id()) - methodResponse, err := conn.GetMethodResponse(&apigateway.GetMethodResponseInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - StatusCode: aws.String(d.Get("status_code").(string)), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - - log.Printf("[DEBUG] Received API Gateway Method: %s", methodResponse) - d.Set("response_models", aws.StringValueMap(methodResponse.ResponseModels)) - d.Set("response_parameters", aws.BoolValueMap(methodResponse.ResponseParameters)) - d.Set("response_parameters_in_json", aws.BoolValueMap(methodResponse.ResponseParameters)) - d.SetId(fmt.Sprintf("agmr-%s-%s-%s-%s", d.Get("rest_api_id").(string), d.Get("resource_id").(string), d.Get("http_method").(string), d.Get("status_code").(string))) - - return nil -} - -func resourceAwsApiGatewayMethodResponseUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Updating API Gateway Method Response %s", d.Id()) - operations := make([]*apigateway.PatchOperation, 0) - - if d.HasChange("response_models") { - operations = append(operations, expandApiGatewayRequestResponseModelOperations(d, "response_models", "responseModels")...) - } - - if d.HasChange("response_parameters_in_json") { - ops, err := deprecatedExpandApiGatewayMethodParametersJSONOperations(d, "response_parameters_in_json", "responseParameters") - if err != nil { - return err - } - operations = append(operations, ops...) - } - - if d.HasChange("response_parameters") { - ops, err := expandApiGatewayMethodParametersOperations(d, "response_parameters", "responseParameters") - if err != nil { - return err - } - operations = append(operations, ops...) - } - - out, err := conn.UpdateMethodResponse(&apigateway.UpdateMethodResponseInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - StatusCode: aws.String(d.Get("status_code").(string)), - PatchOperations: operations, - }) - - if err != nil { - return err - } - - log.Printf("[DEBUG] Received API Gateway Method Response: %s", out) - - return resourceAwsApiGatewayMethodResponseRead(d, meta) -} - -func resourceAwsApiGatewayMethodResponseDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Method Response: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteMethodResponse(&apigateway.DeleteMethodResponseInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - StatusCode: aws.String(d.Get("status_code").(string)), - }) - if err == nil { - return nil - } - - apigatewayErr, ok := err.(awserr.Error) - if apigatewayErr.Code() == "NotFoundException" { - return nil - } - - if !ok { - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_model.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_model.go deleted file mode 100644 index 3f27218..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_model.go +++ /dev/null @@ -1,168 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayModel() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayModelCreate, - Read: resourceAwsApiGatewayModelRead, - Update: resourceAwsApiGatewayModelUpdate, - Delete: resourceAwsApiGatewayModelDelete, - - Schema: map[string]*schema.Schema{ - "rest_api_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "schema": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "content_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsApiGatewayModelCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Creating API Gateway Model") - - var description *string - if v, ok := d.GetOk("description"); ok { - description = aws.String(v.(string)) - } - var schema *string - if v, ok := d.GetOk("schema"); ok { - schema = aws.String(v.(string)) - } - - var err error - model, err := conn.CreateModel(&apigateway.CreateModelInput{ - Name: aws.String(d.Get("name").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - ContentType: aws.String(d.Get("content_type").(string)), - - Description: description, - Schema: schema, - }) - - if err != nil { - return fmt.Errorf("Error creating API Gateway Model: %s", err) - } - - d.SetId(*model.Id) - - return nil -} - -func resourceAwsApiGatewayModelRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Model %s", d.Id()) - out, err := conn.GetModel(&apigateway.GetModelInput{ - ModelName: aws.String(d.Get("name").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - log.Printf("[DEBUG] Received API Gateway Model: %s", out) - d.SetId(*out.Id) - d.Set("description", out.Description) - d.Set("schema", out.Schema) - d.Set("content_type", out.ContentType) - - return nil -} - -func resourceAwsApiGatewayModelUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Model %s", d.Id()) - operations := make([]*apigateway.PatchOperation, 0) - if d.HasChange("description") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/description"), - Value: aws.String(d.Get("description").(string)), - }) - } - if d.HasChange("schema") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/schema"), - Value: aws.String(d.Get("schema").(string)), - }) - } - - out, err := conn.UpdateModel(&apigateway.UpdateModelInput{ - ModelName: aws.String(d.Get("name").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - PatchOperations: operations, - }) - if err != nil { - return err - } - log.Printf("[DEBUG] Received API Gateway Model: %s", out) - - return resourceAwsApiGatewayModelRead(d, meta) -} - -func resourceAwsApiGatewayModelDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Model: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] schema is %#v", d) - _, err := conn.DeleteModel(&apigateway.DeleteModelInput{ - ModelName: aws.String(d.Get("name").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - if err == nil { - return nil - } - - apigatewayErr, ok := err.(awserr.Error) - if apigatewayErr.Code() == "NotFoundException" { - return nil - } - - if !ok { - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_resource.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_resource.go deleted file mode 100644 index 04f1361..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_resource.go +++ /dev/null @@ -1,149 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayResource() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayResourceCreate, - Read: resourceAwsApiGatewayResourceRead, - Update: resourceAwsApiGatewayResourceUpdate, - Delete: resourceAwsApiGatewayResourceDelete, - - Schema: map[string]*schema.Schema{ - "rest_api_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "parent_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "path_part": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "path": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsApiGatewayResourceCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Creating API Gateway Resource for API %s", d.Get("rest_api_id").(string)) - - var err error - resource, err := conn.CreateResource(&apigateway.CreateResourceInput{ - ParentId: aws.String(d.Get("parent_id").(string)), - PathPart: aws.String(d.Get("path_part").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - - if err != nil { - return fmt.Errorf("Error creating API Gateway Resource: %s", err) - } - - d.SetId(*resource.Id) - d.Set("path", resource.Path) - - return nil -} - -func resourceAwsApiGatewayResourceRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Reading API Gateway Resource %s", d.Id()) - resource, err := conn.GetResource(&apigateway.GetResourceInput{ - ResourceId: aws.String(d.Id()), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - - d.Set("parent_id", resource.ParentId) - d.Set("path_part", resource.PathPart) - d.Set("path", resource.Path) - - return nil -} - -func resourceAwsApiGatewayResourceUpdateOperations(d *schema.ResourceData) []*apigateway.PatchOperation { - operations := make([]*apigateway.PatchOperation, 0) - if d.HasChange("path_part") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/pathPart"), - Value: aws.String(d.Get("path_part").(string)), - }) - } - - if d.HasChange("parent_id") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/parentId"), - Value: aws.String(d.Get("parent_id").(string)), - }) - } - return operations -} - -func resourceAwsApiGatewayResourceUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - log.Printf("[DEBUG] Updating API Gateway Resource %s", d.Id()) - _, err := conn.UpdateResource(&apigateway.UpdateResourceInput{ - ResourceId: aws.String(d.Id()), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - PatchOperations: resourceAwsApiGatewayResourceUpdateOperations(d), - }) - - if err != nil { - return err - } - - return resourceAwsApiGatewayResourceRead(d, meta) -} - -func resourceAwsApiGatewayResourceDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway Resource: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] schema is %#v", d) - _, err := conn.DeleteResource(&apigateway.DeleteResourceInput{ - ResourceId: aws.String(d.Id()), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - }) - if err == nil { - return nil - } - - if apigatewayErr, ok := err.(awserr.Error); ok && apigatewayErr.Code() == "NotFoundException" { - return nil - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_rest_api.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_rest_api.go deleted file mode 100644 index db2cd6e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_api_gateway_rest_api.go +++ /dev/null @@ -1,189 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsApiGatewayRestApi() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsApiGatewayRestApiCreate, - Read: resourceAwsApiGatewayRestApiRead, - Update: resourceAwsApiGatewayRestApiUpdate, - Delete: resourceAwsApiGatewayRestApiDelete, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - - "description": { - Type: schema.TypeString, - Optional: true, - }, - - "binary_media_types": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "root_resource_id": { - Type: schema.TypeString, - Computed: true, - }, - - "created_date": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsApiGatewayRestApiCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Creating API Gateway") - - var description *string - if d.Get("description").(string) != "" { - description = aws.String(d.Get("description").(string)) - } - - params := &apigateway.CreateRestApiInput{ - Name: aws.String(d.Get("name").(string)), - Description: description, - } - - binaryMediaTypes, binaryMediaTypesOk := d.GetOk("binary_media_types") - if binaryMediaTypesOk { - params.BinaryMediaTypes = expandStringList(binaryMediaTypes.([]interface{})) - } - - gateway, err := conn.CreateRestApi(params) - if err != nil { - return fmt.Errorf("Error creating API Gateway: %s", err) - } - - d.SetId(*gateway.Id) - - if err = resourceAwsApiGatewayRestApiRefreshResources(d, meta); err != nil { - return err - } - - return resourceAwsApiGatewayRestApiRead(d, meta) -} - -func resourceAwsApiGatewayRestApiRefreshResources(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - - resp, err := conn.GetResources(&apigateway.GetResourcesInput{ - RestApiId: aws.String(d.Id()), - }) - if err != nil { - return err - } - - for _, item := range resp.Items { - if *item.Path == "/" { - d.Set("root_resource_id", item.Id) - break - } - } - - return nil -} - -func resourceAwsApiGatewayRestApiRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Reading API Gateway %s", d.Id()) - - api, err := conn.GetRestApi(&apigateway.GetRestApiInput{ - RestApiId: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - - d.Set("name", api.Name) - d.Set("description", api.Description) - d.Set("binary_media_types", api.BinaryMediaTypes) - - if err := d.Set("created_date", api.CreatedDate.Format(time.RFC3339)); err != nil { - log.Printf("[DEBUG] Error setting created_date: %s", err) - } - - return nil -} - -func resourceAwsApiGatewayRestApiUpdateOperations(d *schema.ResourceData) []*apigateway.PatchOperation { - operations := make([]*apigateway.PatchOperation, 0) - - if d.HasChange("name") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/name"), - Value: aws.String(d.Get("name").(string)), - }) - } - - if d.HasChange("description") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), - Path: aws.String("/description"), - Value: aws.String(d.Get("description").(string)), - }) - } - - return operations -} - -func resourceAwsApiGatewayRestApiUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Updating API Gateway %s", d.Id()) - - _, err := conn.UpdateRestApi(&apigateway.UpdateRestApiInput{ - RestApiId: aws.String(d.Id()), - PatchOperations: resourceAwsApiGatewayRestApiUpdateOperations(d), - }) - - if err != nil { - return err - } - log.Printf("[DEBUG] Updated API Gateway %s", d.Id()) - - return resourceAwsApiGatewayRestApiRead(d, meta) -} - -func resourceAwsApiGatewayRestApiDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).apigateway - log.Printf("[DEBUG] Deleting API Gateway: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteRestApi(&apigateway.DeleteRestApiInput{ - RestApiId: aws.String(d.Id()), - }) - if err == nil { - return nil - } - - if apigatewayErr, ok := err.(awserr.Error); ok && apigatewayErr.Code() == "NotFoundException" { - return nil - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_app_cookie_stickiness_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_app_cookie_stickiness_policy.go deleted file mode 100644 index ecdc8ef..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_app_cookie_stickiness_policy.go +++ /dev/null @@ -1,215 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAppCookieStickinessPolicy() *schema.Resource { - return &schema.Resource{ - // There is no concept of "updating" an App Stickiness policy in - // the AWS API. - Create: resourceAwsAppCookieStickinessPolicyCreate, - Read: resourceAwsAppCookieStickinessPolicyRead, - Delete: resourceAwsAppCookieStickinessPolicyDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) { - es = append(es, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q", k)) - } - return - }, - }, - - "load_balancer": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "lb_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - - "cookie_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsAppCookieStickinessPolicyCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - // Provision the AppStickinessPolicy - acspOpts := &elb.CreateAppCookieStickinessPolicyInput{ - CookieName: aws.String(d.Get("cookie_name").(string)), - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - PolicyName: aws.String(d.Get("name").(string)), - } - - if _, err := elbconn.CreateAppCookieStickinessPolicy(acspOpts); err != nil { - return fmt.Errorf("Error creating AppCookieStickinessPolicy: %s", err) - } - - setLoadBalancerOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - LoadBalancerPort: aws.Int64(int64(d.Get("lb_port").(int))), - PolicyNames: []*string{aws.String(d.Get("name").(string))}, - } - - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(setLoadBalancerOpts); err != nil { - return fmt.Errorf("Error setting AppCookieStickinessPolicy: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%d:%s", - *acspOpts.LoadBalancerName, - *setLoadBalancerOpts.LoadBalancerPort, - *acspOpts.PolicyName)) - return nil -} - -func resourceAwsAppCookieStickinessPolicyRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - lbName, lbPort, policyName := resourceAwsAppCookieStickinessPolicyParseId(d.Id()) - - request := &elb.DescribeLoadBalancerPoliciesInput{ - LoadBalancerName: aws.String(lbName), - PolicyNames: []*string{aws.String(policyName)}, - } - - getResp, err := elbconn.DescribeLoadBalancerPolicies(request) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "PolicyNotFound" || ec2err.Code() == "LoadBalancerNotFound" { - d.SetId("") - } - return nil - } - return fmt.Errorf("Error retrieving policy: %s", err) - } - if len(getResp.PolicyDescriptions) != 1 { - return fmt.Errorf("Unable to find policy %#v", getResp.PolicyDescriptions) - } - - // we know the policy exists now, but we have to check if it's assigned to a listener - assigned, err := resourceAwsELBSticknessPolicyAssigned(policyName, lbName, lbPort, elbconn) - if err != nil { - return err - } - if !assigned { - // policy exists, but isn't assigned to a listener - log.Printf("[DEBUG] policy '%s' exists, but isn't assigned to a listener", policyName) - d.SetId("") - return nil - } - - // We can get away with this because there's only one attribute, the - // cookie expiration, in these descriptions. - policyDesc := getResp.PolicyDescriptions[0] - cookieAttr := policyDesc.PolicyAttributeDescriptions[0] - if *cookieAttr.AttributeName != "CookieName" { - return fmt.Errorf("Unable to find cookie Name.") - } - d.Set("cookie_name", cookieAttr.AttributeValue) - - d.Set("name", policyName) - d.Set("load_balancer", lbName) - d.Set("lb_port", lbPort) - - return nil -} - -// Determine if a particular policy is assigned to an ELB listener -func resourceAwsELBSticknessPolicyAssigned(policyName, lbName, lbPort string, elbconn *elb.ELB) (bool, error) { - describeElbOpts := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{aws.String(lbName)}, - } - describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "LoadBalancerNotFound" { - return false, nil - } - } - return false, fmt.Errorf("Error retrieving ELB description: %s", err) - } - - if len(describeResp.LoadBalancerDescriptions) != 1 { - return false, fmt.Errorf("Unable to find ELB: %#v", describeResp.LoadBalancerDescriptions) - } - - lb := describeResp.LoadBalancerDescriptions[0] - assigned := false - for _, listener := range lb.ListenerDescriptions { - if lbPort != strconv.Itoa(int(*listener.Listener.LoadBalancerPort)) { - continue - } - - for _, name := range listener.PolicyNames { - if policyName == *name { - assigned = true - break - } - } - } - - return assigned, nil -} - -func resourceAwsAppCookieStickinessPolicyDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - lbName, _, policyName := resourceAwsAppCookieStickinessPolicyParseId(d.Id()) - - // Perversely, if we Set an empty list of PolicyNames, we detach the - // policies attached to a listener, which is required to delete the - // policy itself. - setLoadBalancerOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - LoadBalancerPort: aws.Int64(int64(d.Get("lb_port").(int))), - PolicyNames: []*string{}, - } - - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(setLoadBalancerOpts); err != nil { - return fmt.Errorf("Error removing AppCookieStickinessPolicy: %s", err) - } - - request := &elb.DeleteLoadBalancerPolicyInput{ - LoadBalancerName: aws.String(lbName), - PolicyName: aws.String(policyName), - } - - if _, err := elbconn.DeleteLoadBalancerPolicy(request); err != nil { - return fmt.Errorf("Error deleting App stickiness policy %s: %s", d.Id(), err) - } - return nil -} - -// resourceAwsAppCookieStickinessPolicyParseId takes an ID and parses it into -// it's constituent parts. You need three axes (LB name, policy name, and LB -// port) to create or identify a stickiness policy in AWS's API. -func resourceAwsAppCookieStickinessPolicyParseId(id string) (string, string, string) { - parts := strings.SplitN(id, ":", 3) - return parts[0], parts[1], parts[2] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_appautoscaling_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_appautoscaling_policy.go deleted file mode 100644 index e75e761..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_appautoscaling_policy.go +++ /dev/null @@ -1,327 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "strconv" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/applicationautoscaling" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAppautoscalingPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAppautoscalingPolicyCreate, - Read: resourceAwsAppautoscalingPolicyRead, - Update: resourceAwsAppautoscalingPolicyUpdate, - Delete: resourceAwsAppautoscalingPolicyDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1862-L1873 - value := v.(string) - if len(value) > 255 { - errors = append(errors, fmt.Errorf("%s cannot be longer than 255 characters", k)) - } - return - }, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "policy_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "StepScaling", - }, - "resource_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "scalable_dimension": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAppautoscalingScalableDimension, - }, - "service_namespace": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAppautoscalingServiceNamespace, - }, - "adjustment_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "cooldown": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "metric_aggregation_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "min_adjustment_magnitude": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "alarms": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "step_adjustment": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "metric_interval_lower_bound": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "metric_interval_upper_bound": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "scaling_adjustment": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: resourceAwsAppautoscalingAdjustmentHash, - }, - }, - } -} - -func resourceAwsAppautoscalingPolicyCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).appautoscalingconn - - params, err := getAwsAppautoscalingPutScalingPolicyInput(d) - if err != nil { - return err - } - - log.Printf("[DEBUG] ApplicationAutoScaling PutScalingPolicy: %#v", params) - resp, err := conn.PutScalingPolicy(¶ms) - if err != nil { - return fmt.Errorf("Error putting scaling policy: %s", err) - } - - d.Set("arn", resp.PolicyARN) - d.SetId(d.Get("name").(string)) - log.Printf("[INFO] ApplicationAutoScaling scaling PolicyARN: %s", d.Get("arn").(string)) - - return resourceAwsAppautoscalingPolicyRead(d, meta) -} - -func resourceAwsAppautoscalingPolicyRead(d *schema.ResourceData, meta interface{}) error { - p, err := getAwsAppautoscalingPolicy(d, meta) - if err != nil { - return err - } - if p == nil { - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Read ApplicationAutoScaling policy: %s, SP: %s, Obj: %s", d.Get("name"), d.Get("name"), p) - - d.Set("arn", p.PolicyARN) - d.Set("name", p.PolicyName) - d.Set("policy_type", p.PolicyType) - d.Set("resource_id", p.ResourceId) - d.Set("scalable_dimension", p.ScalableDimension) - d.Set("service_namespace", p.ServiceNamespace) - d.Set("alarms", p.Alarms) - d.Set("step_scaling_policy_configuration", p.StepScalingPolicyConfiguration) - - return nil -} - -func resourceAwsAppautoscalingPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).appautoscalingconn - - params, inputErr := getAwsAppautoscalingPutScalingPolicyInput(d) - if inputErr != nil { - return inputErr - } - - log.Printf("[DEBUG] Application Autoscaling Update Scaling Policy: %#v", params) - _, err := conn.PutScalingPolicy(¶ms) - if err != nil { - return err - } - - return resourceAwsAppautoscalingPolicyRead(d, meta) -} - -func resourceAwsAppautoscalingPolicyDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).appautoscalingconn - p, err := getAwsAppautoscalingPolicy(d, meta) - if err != nil { - return fmt.Errorf("Error getting policy: %s", err) - } - if p == nil { - return nil - } - - params := applicationautoscaling.DeleteScalingPolicyInput{ - PolicyName: aws.String(d.Get("name").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - ScalableDimension: aws.String(d.Get("scalable_dimension").(string)), - ServiceNamespace: aws.String(d.Get("service_namespace").(string)), - } - log.Printf("[DEBUG] Deleting Application AutoScaling Policy opts: %#v", params) - if _, err := conn.DeleteScalingPolicy(¶ms); err != nil { - return fmt.Errorf("Application AutoScaling Policy: %s", err) - } - - d.SetId("") - return nil -} - -// Takes the result of flatmap.Expand for an array of step adjustments and -// returns a []*applicationautoscaling.StepAdjustment. -func expandAppautoscalingStepAdjustments(configured []interface{}) ([]*applicationautoscaling.StepAdjustment, error) { - var adjustments []*applicationautoscaling.StepAdjustment - - // Loop over our configured step adjustments and create an array - // of aws-sdk-go compatible objects. We're forced to convert strings - // to floats here because there's no way to detect whether or not - // an uninitialized, optional schema element is "0.0" deliberately. - // With strings, we can test for "", which is definitely an empty - // struct value. - for _, raw := range configured { - data := raw.(map[string]interface{}) - a := &applicationautoscaling.StepAdjustment{ - ScalingAdjustment: aws.Int64(int64(data["scaling_adjustment"].(int))), - } - if data["metric_interval_lower_bound"] != "" { - bound := data["metric_interval_lower_bound"] - switch bound := bound.(type) { - case string: - f, err := strconv.ParseFloat(bound, 64) - if err != nil { - return nil, fmt.Errorf( - "metric_interval_lower_bound must be a float value represented as a string") - } - a.MetricIntervalLowerBound = aws.Float64(f) - default: - return nil, fmt.Errorf( - "metric_interval_lower_bound isn't a string. This is a bug. Please file an issue.") - } - } - if data["metric_interval_upper_bound"] != "" { - bound := data["metric_interval_upper_bound"] - switch bound := bound.(type) { - case string: - f, err := strconv.ParseFloat(bound, 64) - if err != nil { - return nil, fmt.Errorf( - "metric_interval_upper_bound must be a float value represented as a string") - } - a.MetricIntervalUpperBound = aws.Float64(f) - default: - return nil, fmt.Errorf( - "metric_interval_upper_bound isn't a string. This is a bug. Please file an issue.") - } - } - adjustments = append(adjustments, a) - } - - return adjustments, nil -} - -func getAwsAppautoscalingPutScalingPolicyInput(d *schema.ResourceData) (applicationautoscaling.PutScalingPolicyInput, error) { - var params = applicationautoscaling.PutScalingPolicyInput{ - PolicyName: aws.String(d.Get("name").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - } - - if v, ok := d.GetOk("policy_type"); ok { - params.PolicyType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("service_namespace"); ok { - params.ServiceNamespace = aws.String(v.(string)) - } - - if v, ok := d.GetOk("scalable_dimension"); ok { - params.ScalableDimension = aws.String(v.(string)) - } - - var adjustmentSteps []*applicationautoscaling.StepAdjustment - if v, ok := d.GetOk("step_adjustment"); ok { - steps, err := expandAppautoscalingStepAdjustments(v.(*schema.Set).List()) - if err != nil { - return params, fmt.Errorf("metric_interval_lower_bound and metric_interval_upper_bound must be strings!") - } - adjustmentSteps = steps - } - - // build StepScalingPolicyConfiguration - params.StepScalingPolicyConfiguration = &applicationautoscaling.StepScalingPolicyConfiguration{ - AdjustmentType: aws.String(d.Get("adjustment_type").(string)), - Cooldown: aws.Int64(int64(d.Get("cooldown").(int))), - MetricAggregationType: aws.String(d.Get("metric_aggregation_type").(string)), - StepAdjustments: adjustmentSteps, - } - - if v, ok := d.GetOk("min_adjustment_magnitude"); ok { - params.StepScalingPolicyConfiguration.MinAdjustmentMagnitude = aws.Int64(int64(v.(int))) - } - - return params, nil -} - -func getAwsAppautoscalingPolicy(d *schema.ResourceData, meta interface{}) (*applicationautoscaling.ScalingPolicy, error) { - conn := meta.(*AWSClient).appautoscalingconn - - params := applicationautoscaling.DescribeScalingPoliciesInput{ - PolicyNames: []*string{aws.String(d.Get("name").(string))}, - ServiceNamespace: aws.String(d.Get("service_namespace").(string)), - } - - log.Printf("[DEBUG] Application AutoScaling Policy Describe Params: %#v", params) - resp, err := conn.DescribeScalingPolicies(¶ms) - if err != nil { - return nil, fmt.Errorf("Error retrieving scaling policies: %s", err) - } - - // find scaling policy - name := d.Get("name") - for idx, sp := range resp.ScalingPolicies { - if *sp.PolicyName == name { - return resp.ScalingPolicies[idx], nil - } - } - - // policy not found - return nil, nil -} - -func resourceAwsAppautoscalingAdjustmentHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - if v, ok := m["metric_interval_lower_bound"]; ok { - buf.WriteString(fmt.Sprintf("%f-", v)) - } - if v, ok := m["metric_interval_upper_bound"]; ok { - buf.WriteString(fmt.Sprintf("%f-", v)) - } - buf.WriteString(fmt.Sprintf("%d-", m["scaling_adjustment"].(int))) - - return hashcode.String(buf.String()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_appautoscaling_target.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_appautoscaling_target.go deleted file mode 100644 index 90ef0c9..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_appautoscaling_target.go +++ /dev/null @@ -1,196 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/applicationautoscaling" -) - -func resourceAwsAppautoscalingTarget() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAppautoscalingTargetCreate, - Read: resourceAwsAppautoscalingTargetRead, - Delete: resourceAwsAppautoscalingTargetDelete, - - Schema: map[string]*schema.Schema{ - "max_capacity": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - "min_capacity": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - "resource_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "role_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "scalable_dimension": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAppautoscalingScalableDimension, - }, - "service_namespace": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAppautoscalingServiceNamespace, - }, - }, - } -} - -func resourceAwsAppautoscalingTargetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).appautoscalingconn - - var targetOpts applicationautoscaling.RegisterScalableTargetInput - - targetOpts.MaxCapacity = aws.Int64(int64(d.Get("max_capacity").(int))) - targetOpts.MinCapacity = aws.Int64(int64(d.Get("min_capacity").(int))) - targetOpts.ResourceId = aws.String(d.Get("resource_id").(string)) - targetOpts.RoleARN = aws.String(d.Get("role_arn").(string)) - targetOpts.ScalableDimension = aws.String(d.Get("scalable_dimension").(string)) - targetOpts.ServiceNamespace = aws.String(d.Get("service_namespace").(string)) - - log.Printf("[DEBUG] Application autoscaling target create configuration %#v", targetOpts) - var err error - err = resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err = conn.RegisterScalableTarget(&targetOpts) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ValidationException" { - log.Printf("[DEBUG] Retrying creation of Application Autoscaling Scalable Target due to possible issues with IAM: %s", awsErr) - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - - return nil - }) - if err != nil { - return fmt.Errorf("Error creating application autoscaling target: %s", err) - } - - d.SetId(d.Get("resource_id").(string)) - log.Printf("[INFO] Application AutoScaling Target ID: %s", d.Id()) - - return resourceAwsAppautoscalingTargetRead(d, meta) -} - -func resourceAwsAppautoscalingTargetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).appautoscalingconn - - t, err := getAwsAppautoscalingTarget(d, conn) - if err != nil { - return err - } - if t == nil { - log.Printf("[INFO] Application AutoScaling Target %q not found", d.Id()) - d.SetId("") - return nil - } - - d.Set("max_capacity", t.MaxCapacity) - d.Set("min_capacity", t.MinCapacity) - d.Set("resource_id", t.ResourceId) - d.Set("role_arn", t.RoleARN) - d.Set("scalable_dimension", t.ScalableDimension) - d.Set("service_namespace", t.ServiceNamespace) - - return nil -} - -// Updating Target is not supported -// func getAwsAppautoscalingTargetUpdate(d *schema.ResourceData, meta interface{}) error { -// conn := meta.(*AWSClient).appautoscalingconn - -// } - -func resourceAwsAppautoscalingTargetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).appautoscalingconn - - t, err := getAwsAppautoscalingTarget(d, conn) - if err != nil { - return err - } - if t == nil { - log.Printf("[INFO] Application AutoScaling Target %q not found", d.Id()) - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Application AutoScaling Target destroy: %#v", d.Id()) - deleteOpts := applicationautoscaling.DeregisterScalableTargetInput{ - ResourceId: aws.String(d.Get("resource_id").(string)), - ServiceNamespace: aws.String(d.Get("service_namespace").(string)), - ScalableDimension: aws.String(d.Get("scalable_dimension").(string)), - } - - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - if _, err := conn.DeregisterScalableTarget(&deleteOpts); err != nil { - if awserr, ok := err.(awserr.Error); ok { - // @TODO: We should do stuff here depending on the actual error returned - return resource.RetryableError(awserr) - } - // Non recognized error, no retry. - return resource.NonRetryableError(err) - } - // Successful delete - return nil - }) - if err != nil { - return err - } - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - if t, _ = getAwsAppautoscalingTarget(d, conn); t != nil { - return resource.RetryableError( - fmt.Errorf("Application AutoScaling Target still exists")) - } - return nil - }) -} - -func getAwsAppautoscalingTarget( - d *schema.ResourceData, - conn *applicationautoscaling.ApplicationAutoScaling) (*applicationautoscaling.ScalableTarget, error) { - - tgtName := d.Id() - describeOpts := applicationautoscaling.DescribeScalableTargetsInput{ - ResourceIds: []*string{aws.String(tgtName)}, - ServiceNamespace: aws.String(d.Get("service_namespace").(string)), - } - - log.Printf("[DEBUG] Application AutoScaling Target describe configuration: %#v", describeOpts) - describeTargets, err := conn.DescribeScalableTargets(&describeOpts) - if err != nil { - // @TODO: We should probably send something else back if we're trying to access an unknown Resource ID - // targetserr, ok := err.(awserr.Error) - // if ok && targetserr.Code() == "" - return nil, fmt.Errorf("Error retrieving Application AutoScaling Target: %s", err) - } - - for idx, tgt := range describeTargets.ScalableTargets { - if *tgt.ResourceId == tgtName { - return describeTargets.ScalableTargets[idx], nil - } - } - - return nil, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_attachment.go deleted file mode 100644 index d3921d9..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_attachment.go +++ /dev/null @@ -1,108 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAutoscalingAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAutoscalingAttachmentCreate, - Read: resourceAwsAutoscalingAttachmentRead, - Delete: resourceAwsAutoscalingAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "autoscaling_group_name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - - "elb": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - }, - } -} - -func resourceAwsAutoscalingAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - asgconn := meta.(*AWSClient).autoscalingconn - asgName := d.Get("autoscaling_group_name").(string) - elbName := d.Get("elb").(string) - - attachElbInput := &autoscaling.AttachLoadBalancersInput{ - AutoScalingGroupName: aws.String(asgName), - LoadBalancerNames: []*string{aws.String(elbName)}, - } - - log.Printf("[INFO] registering asg %s with ELBs %s", asgName, elbName) - - if _, err := asgconn.AttachLoadBalancers(attachElbInput); err != nil { - return errwrap.Wrapf(fmt.Sprintf("Failure attaching AutoScaling Group %s with Elastic Load Balancer: %s: {{err}}", asgName, elbName), err) - } - - d.SetId(resource.PrefixedUniqueId(fmt.Sprintf("%s-", asgName))) - - return resourceAwsAutoscalingAttachmentRead(d, meta) -} - -func resourceAwsAutoscalingAttachmentRead(d *schema.ResourceData, meta interface{}) error { - asgconn := meta.(*AWSClient).autoscalingconn - asgName := d.Get("autoscaling_group_name").(string) - elbName := d.Get("elb").(string) - - // Retrieve the ASG properites to get list of associated ELBs - asg, err := getAwsAutoscalingGroup(asgName, asgconn) - - if err != nil { - return err - } - if asg == nil { - log.Printf("[INFO] Autoscaling Group %q not found", asgName) - d.SetId("") - return nil - } - - found := false - for _, i := range asg.LoadBalancerNames { - if elbName == *i { - d.Set("elb", elbName) - found = true - break - } - } - - if !found { - log.Printf("[WARN] Association for %s was not found in ASG assocation", elbName) - d.SetId("") - } - - return nil -} - -func resourceAwsAutoscalingAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - asgconn := meta.(*AWSClient).autoscalingconn - asgName := d.Get("autoscaling_group_name").(string) - elbName := d.Get("elb").(string) - - log.Printf("[INFO] Deleting ELB %s association from: %s", elbName, asgName) - - detachOpts := &autoscaling.DetachLoadBalancersInput{ - AutoScalingGroupName: aws.String(asgName), - LoadBalancerNames: []*string{aws.String(elbName)}, - } - - if _, err := asgconn.DetachLoadBalancers(detachOpts); err != nil { - return errwrap.Wrapf(fmt.Sprintf("Failure detaching AutoScaling Group %s with Elastic Load Balancer: %s: {{err}}", asgName, elbName), err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_group.go deleted file mode 100644 index 6a35164..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_group.go +++ /dev/null @@ -1,946 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/aws/aws-sdk-go/service/elbv2" -) - -func resourceAwsAutoscalingGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAutoscalingGroupCreate, - Read: resourceAwsAutoscalingGroupRead, - Update: resourceAwsAutoscalingGroupUpdate, - Delete: resourceAwsAutoscalingGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1862-L1873 - value := v.(string) - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters", k)) - } - return - }, - }, - - "launch_configuration": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "desired_capacity": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - - "min_elb_capacity": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - - "min_size": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - - "max_size": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - - "default_cooldown": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - - "force_delete": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "health_check_grace_period": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 300, - }, - - "health_check_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "availability_zones": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "placement_group": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "load_balancers": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "vpc_zone_identifier": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "termination_policies": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "wait_for_capacity_timeout": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "10m", - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - duration, err := time.ParseDuration(value) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q cannot be parsed as a duration: %s", k, err)) - } - if duration < 0 { - errors = append(errors, fmt.Errorf( - "%q must be greater than zero", k)) - } - return - }, - }, - - "wait_for_elb_capacity": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - - "enabled_metrics": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "suspended_processes": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "metrics_granularity": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "1Minute", - }, - - "protect_from_scale_in": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "target_group_arns": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "initial_lifecycle_hook": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "default_result": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "heartbeat_timeout": { - Type: schema.TypeInt, - Optional: true, - }, - "lifecycle_transition": { - Type: schema.TypeString, - Required: true, - }, - "notification_metadata": { - Type: schema.TypeString, - Optional: true, - }, - "notification_target_arn": { - Type: schema.TypeString, - Optional: true, - }, - "role_arn": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - - "tag": autoscalingTagsSchema(), - }, - } -} - -func generatePutLifecycleHookInputs(asgName string, cfgs []interface{}) []autoscaling.PutLifecycleHookInput { - res := make([]autoscaling.PutLifecycleHookInput, 0, len(cfgs)) - - for _, raw := range cfgs { - cfg := raw.(map[string]interface{}) - - input := autoscaling.PutLifecycleHookInput{ - AutoScalingGroupName: &asgName, - LifecycleHookName: aws.String(cfg["name"].(string)), - } - - if v, ok := cfg["default_result"]; ok && v.(string) != "" { - input.DefaultResult = aws.String(v.(string)) - } - - if v, ok := cfg["heartbeat_timeout"]; ok && v.(int) > 0 { - input.HeartbeatTimeout = aws.Int64(int64(v.(int))) - } - - if v, ok := cfg["lifecycle_transition"]; ok && v.(string) != "" { - input.LifecycleTransition = aws.String(v.(string)) - } - - if v, ok := cfg["notification_metadata"]; ok && v.(string) != "" { - input.NotificationMetadata = aws.String(v.(string)) - } - - if v, ok := cfg["notification_target_arn"]; ok && v.(string) != "" { - input.NotificationTargetARN = aws.String(v.(string)) - } - - if v, ok := cfg["role_arn"]; ok && v.(string) != "" { - input.RoleARN = aws.String(v.(string)) - } - - res = append(res, input) - } - - return res -} - -func resourceAwsAutoscalingGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - - var asgName string - if v, ok := d.GetOk("name"); ok { - asgName = v.(string) - } else { - asgName = resource.PrefixedUniqueId("tf-asg-") - d.Set("name", asgName) - } - - createOpts := autoscaling.CreateAutoScalingGroupInput{ - AutoScalingGroupName: aws.String(asgName), - LaunchConfigurationName: aws.String(d.Get("launch_configuration").(string)), - NewInstancesProtectedFromScaleIn: aws.Bool(d.Get("protect_from_scale_in").(bool)), - } - updateOpts := autoscaling.UpdateAutoScalingGroupInput{ - AutoScalingGroupName: aws.String(asgName), - } - - initialLifecycleHooks := d.Get("initial_lifecycle_hook").(*schema.Set).List() - twoPhases := len(initialLifecycleHooks) > 0 - - minSize := aws.Int64(int64(d.Get("min_size").(int))) - maxSize := aws.Int64(int64(d.Get("max_size").(int))) - - if twoPhases { - createOpts.MinSize = aws.Int64(int64(0)) - createOpts.MaxSize = aws.Int64(int64(0)) - - updateOpts.MinSize = minSize - updateOpts.MaxSize = maxSize - - if v, ok := d.GetOk("desired_capacity"); ok { - updateOpts.DesiredCapacity = aws.Int64(int64(v.(int))) - } - } else { - createOpts.MinSize = minSize - createOpts.MaxSize = maxSize - - if v, ok := d.GetOk("desired_capacity"); ok { - createOpts.DesiredCapacity = aws.Int64(int64(v.(int))) - } - } - - // Availability Zones are optional if VPC Zone Identifer(s) are specified - if v, ok := d.GetOk("availability_zones"); ok && v.(*schema.Set).Len() > 0 { - createOpts.AvailabilityZones = expandStringList(v.(*schema.Set).List()) - } - - if v, ok := d.GetOk("tag"); ok { - createOpts.Tags = autoscalingTagsFromMap( - setToMapByKey(v.(*schema.Set), "key"), d.Get("name").(string)) - } - - if v, ok := d.GetOk("default_cooldown"); ok { - createOpts.DefaultCooldown = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("health_check_type"); ok && v.(string) != "" { - createOpts.HealthCheckType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("health_check_grace_period"); ok { - createOpts.HealthCheckGracePeriod = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("placement_group"); ok { - createOpts.PlacementGroup = aws.String(v.(string)) - } - - if v, ok := d.GetOk("load_balancers"); ok && v.(*schema.Set).Len() > 0 { - createOpts.LoadBalancerNames = expandStringList( - v.(*schema.Set).List()) - } - - if v, ok := d.GetOk("vpc_zone_identifier"); ok && v.(*schema.Set).Len() > 0 { - createOpts.VPCZoneIdentifier = expandVpcZoneIdentifiers(v.(*schema.Set).List()) - } - - if v, ok := d.GetOk("termination_policies"); ok && len(v.([]interface{})) > 0 { - createOpts.TerminationPolicies = expandStringList(v.([]interface{})) - } - - if v, ok := d.GetOk("target_group_arns"); ok && len(v.(*schema.Set).List()) > 0 { - createOpts.TargetGroupARNs = expandStringList(v.(*schema.Set).List()) - } - - log.Printf("[DEBUG] AutoScaling Group create configuration: %#v", createOpts) - _, err := conn.CreateAutoScalingGroup(&createOpts) - if err != nil { - return fmt.Errorf("Error creating AutoScaling Group: %s", err) - } - - d.SetId(d.Get("name").(string)) - log.Printf("[INFO] AutoScaling Group ID: %s", d.Id()) - - if twoPhases { - for _, hook := range generatePutLifecycleHookInputs(asgName, initialLifecycleHooks) { - if err = resourceAwsAutoscalingLifecycleHookPutOp(conn, &hook); err != nil { - return fmt.Errorf("Error creating initial lifecycle hooks: %s", err) - } - } - - _, err = conn.UpdateAutoScalingGroup(&updateOpts) - if err != nil { - return fmt.Errorf("Error setting AutoScaling Group initial capacity: %s", err) - } - } - - if err := waitForASGCapacity(d, meta, capacitySatisfiedCreate); err != nil { - return err - } - - if _, ok := d.GetOk("suspended_processes"); ok { - suspendedProcessesErr := enableASGSuspendedProcesses(d, conn) - if suspendedProcessesErr != nil { - return suspendedProcessesErr - } - } - - if _, ok := d.GetOk("enabled_metrics"); ok { - metricsErr := enableASGMetricsCollection(d, conn) - if metricsErr != nil { - return metricsErr - } - } - - return resourceAwsAutoscalingGroupRead(d, meta) -} - -func resourceAwsAutoscalingGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - - g, err := getAwsAutoscalingGroup(d.Id(), conn) - if err != nil { - return err - } - if g == nil { - log.Printf("[INFO] Autoscaling Group %q not found", d.Id()) - d.SetId("") - return nil - } - - d.Set("availability_zones", flattenStringList(g.AvailabilityZones)) - d.Set("default_cooldown", g.DefaultCooldown) - d.Set("arn", g.AutoScalingGroupARN) - d.Set("desired_capacity", g.DesiredCapacity) - d.Set("health_check_grace_period", g.HealthCheckGracePeriod) - d.Set("health_check_type", g.HealthCheckType) - d.Set("launch_configuration", g.LaunchConfigurationName) - d.Set("load_balancers", flattenStringList(g.LoadBalancerNames)) - if err := d.Set("suspended_processes", flattenAsgSuspendedProcesses(g.SuspendedProcesses)); err != nil { - log.Printf("[WARN] Error setting suspended_processes for %q: %s", d.Id(), err) - } - if err := d.Set("target_group_arns", flattenStringList(g.TargetGroupARNs)); err != nil { - log.Printf("[ERR] Error setting target groups: %s", err) - } - d.Set("min_size", g.MinSize) - d.Set("max_size", g.MaxSize) - d.Set("placement_group", g.PlacementGroup) - d.Set("name", g.AutoScalingGroupName) - d.Set("tag", autoscalingTagDescriptionsToSlice(g.Tags)) - d.Set("vpc_zone_identifier", strings.Split(*g.VPCZoneIdentifier, ",")) - d.Set("protect_from_scale_in", g.NewInstancesProtectedFromScaleIn) - - // If no termination polices are explicitly configured and the upstream state - // is only using the "Default" policy, clear the state to make it consistent - // with the default AWS create API behavior. - _, ok := d.GetOk("termination_policies") - if !ok && len(g.TerminationPolicies) == 1 && *g.TerminationPolicies[0] == "Default" { - d.Set("termination_policies", []interface{}{}) - } else { - d.Set("termination_policies", flattenStringList(g.TerminationPolicies)) - } - - if g.EnabledMetrics != nil { - if err := d.Set("enabled_metrics", flattenAsgEnabledMetrics(g.EnabledMetrics)); err != nil { - log.Printf("[WARN] Error setting metrics for (%s): %s", d.Id(), err) - } - d.Set("metrics_granularity", g.EnabledMetrics[0].Granularity) - } - - return nil -} - -func resourceAwsAutoscalingGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - shouldWaitForCapacity := false - - opts := autoscaling.UpdateAutoScalingGroupInput{ - AutoScalingGroupName: aws.String(d.Id()), - } - - opts.NewInstancesProtectedFromScaleIn = aws.Bool(d.Get("protect_from_scale_in").(bool)) - - if d.HasChange("default_cooldown") { - opts.DefaultCooldown = aws.Int64(int64(d.Get("default_cooldown").(int))) - } - - if d.HasChange("desired_capacity") { - opts.DesiredCapacity = aws.Int64(int64(d.Get("desired_capacity").(int))) - shouldWaitForCapacity = true - } - - if d.HasChange("launch_configuration") { - opts.LaunchConfigurationName = aws.String(d.Get("launch_configuration").(string)) - } - - if d.HasChange("min_size") { - opts.MinSize = aws.Int64(int64(d.Get("min_size").(int))) - shouldWaitForCapacity = true - } - - if d.HasChange("max_size") { - opts.MaxSize = aws.Int64(int64(d.Get("max_size").(int))) - } - - if d.HasChange("health_check_grace_period") { - opts.HealthCheckGracePeriod = aws.Int64(int64(d.Get("health_check_grace_period").(int))) - } - - if d.HasChange("health_check_type") { - opts.HealthCheckGracePeriod = aws.Int64(int64(d.Get("health_check_grace_period").(int))) - opts.HealthCheckType = aws.String(d.Get("health_check_type").(string)) - } - - if d.HasChange("vpc_zone_identifier") { - opts.VPCZoneIdentifier = expandVpcZoneIdentifiers(d.Get("vpc_zone_identifier").(*schema.Set).List()) - } - - if d.HasChange("availability_zones") { - if v, ok := d.GetOk("availability_zones"); ok && v.(*schema.Set).Len() > 0 { - opts.AvailabilityZones = expandStringList(v.(*schema.Set).List()) - } - } - - if d.HasChange("placement_group") { - opts.PlacementGroup = aws.String(d.Get("placement_group").(string)) - } - - if d.HasChange("termination_policies") { - // If the termination policy is set to null, we need to explicitly set - // it back to "Default", or the API won't reset it for us. - if v, ok := d.GetOk("termination_policies"); ok && len(v.([]interface{})) > 0 { - opts.TerminationPolicies = expandStringList(v.([]interface{})) - } else { - log.Printf("[DEBUG] Explicitly setting null termination policy to 'Default'") - opts.TerminationPolicies = aws.StringSlice([]string{"Default"}) - } - } - - if err := setAutoscalingTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tag") - } - - log.Printf("[DEBUG] AutoScaling Group update configuration: %#v", opts) - _, err := conn.UpdateAutoScalingGroup(&opts) - if err != nil { - d.Partial(true) - return fmt.Errorf("Error updating Autoscaling group: %s", err) - } - - if d.HasChange("load_balancers") { - - o, n := d.GetChange("load_balancers") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := expandStringList(os.Difference(ns).List()) - add := expandStringList(ns.Difference(os).List()) - - if len(remove) > 0 { - _, err := conn.DetachLoadBalancers(&autoscaling.DetachLoadBalancersInput{ - AutoScalingGroupName: aws.String(d.Id()), - LoadBalancerNames: remove, - }) - if err != nil { - return fmt.Errorf("[WARN] Error updating Load Balancers for AutoScaling Group (%s), error: %s", d.Id(), err) - } - } - - if len(add) > 0 { - _, err := conn.AttachLoadBalancers(&autoscaling.AttachLoadBalancersInput{ - AutoScalingGroupName: aws.String(d.Id()), - LoadBalancerNames: add, - }) - if err != nil { - return fmt.Errorf("[WARN] Error updating Load Balancers for AutoScaling Group (%s), error: %s", d.Id(), err) - } - } - } - - if d.HasChange("target_group_arns") { - - o, n := d.GetChange("target_group_arns") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := expandStringList(os.Difference(ns).List()) - add := expandStringList(ns.Difference(os).List()) - - if len(remove) > 0 { - _, err := conn.DetachLoadBalancerTargetGroups(&autoscaling.DetachLoadBalancerTargetGroupsInput{ - AutoScalingGroupName: aws.String(d.Id()), - TargetGroupARNs: remove, - }) - if err != nil { - return fmt.Errorf("[WARN] Error updating Load Balancers Target Groups for AutoScaling Group (%s), error: %s", d.Id(), err) - } - } - - if len(add) > 0 { - _, err := conn.AttachLoadBalancerTargetGroups(&autoscaling.AttachLoadBalancerTargetGroupsInput{ - AutoScalingGroupName: aws.String(d.Id()), - TargetGroupARNs: add, - }) - if err != nil { - return fmt.Errorf("[WARN] Error updating Load Balancers Target Groups for AutoScaling Group (%s), error: %s", d.Id(), err) - } - } - } - - if shouldWaitForCapacity { - if err := waitForASGCapacity(d, meta, capacitySatisfiedUpdate); err != nil { - return errwrap.Wrapf("Error waiting for AutoScaling Group Capacity: {{err}}", err) - } - } - - if d.HasChange("enabled_metrics") { - if err := updateASGMetricsCollection(d, conn); err != nil { - return errwrap.Wrapf("Error updating AutoScaling Group Metrics collection: {{err}}", err) - } - } - - if d.HasChange("suspended_processes") { - if err := updateASGSuspendedProcesses(d, conn); err != nil { - return errwrap.Wrapf("Error updating AutoScaling Group Suspended Processes: {{err}}", err) - } - } - - return resourceAwsAutoscalingGroupRead(d, meta) -} - -func resourceAwsAutoscalingGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - - // Read the autoscaling group first. If it doesn't exist, we're done. - // We need the group in order to check if there are instances attached. - // If so, we need to remove those first. - g, err := getAwsAutoscalingGroup(d.Id(), conn) - if err != nil { - return err - } - if g == nil { - log.Printf("[INFO] Autoscaling Group %q not found", d.Id()) - d.SetId("") - return nil - } - if len(g.Instances) > 0 || *g.DesiredCapacity > 0 { - if err := resourceAwsAutoscalingGroupDrain(d, meta); err != nil { - return err - } - } - - log.Printf("[DEBUG] AutoScaling Group destroy: %v", d.Id()) - deleteopts := autoscaling.DeleteAutoScalingGroupInput{ - AutoScalingGroupName: aws.String(d.Id()), - ForceDelete: aws.Bool(d.Get("force_delete").(bool)), - } - - // We retry the delete operation to handle InUse/InProgress errors coming - // from scaling operations. We should be able to sneak in a delete in between - // scaling operations within 5m. - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - if _, err := conn.DeleteAutoScalingGroup(&deleteopts); err != nil { - if awserr, ok := err.(awserr.Error); ok { - switch awserr.Code() { - case "InvalidGroup.NotFound": - // Already gone? Sure! - return nil - case "ResourceInUse", "ScalingActivityInProgress": - // These are retryable - return resource.RetryableError(awserr) - } - } - // Didn't recognize the error, so shouldn't retry. - return resource.NonRetryableError(err) - } - // Successful delete - return nil - }) - if err != nil { - return err - } - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - if g, _ = getAwsAutoscalingGroup(d.Id(), conn); g != nil { - return resource.RetryableError( - fmt.Errorf("Auto Scaling Group still exists")) - } - return nil - }) -} - -func getAwsAutoscalingGroup( - asgName string, - conn *autoscaling.AutoScaling) (*autoscaling.Group, error) { - - describeOpts := autoscaling.DescribeAutoScalingGroupsInput{ - AutoScalingGroupNames: []*string{aws.String(asgName)}, - } - - log.Printf("[DEBUG] AutoScaling Group describe configuration: %#v", describeOpts) - describeGroups, err := conn.DescribeAutoScalingGroups(&describeOpts) - if err != nil { - autoscalingerr, ok := err.(awserr.Error) - if ok && autoscalingerr.Code() == "InvalidGroup.NotFound" { - return nil, nil - } - - return nil, fmt.Errorf("Error retrieving AutoScaling groups: %s", err) - } - - // Search for the autoscaling group - for idx, asc := range describeGroups.AutoScalingGroups { - if *asc.AutoScalingGroupName == asgName { - return describeGroups.AutoScalingGroups[idx], nil - } - } - - return nil, nil -} - -func resourceAwsAutoscalingGroupDrain(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - - if d.Get("force_delete").(bool) { - log.Printf("[DEBUG] Skipping ASG drain, force_delete was set.") - return nil - } - - // First, set the capacity to zero so the group will drain - log.Printf("[DEBUG] Reducing autoscaling group capacity to zero") - opts := autoscaling.UpdateAutoScalingGroupInput{ - AutoScalingGroupName: aws.String(d.Id()), - DesiredCapacity: aws.Int64(0), - MinSize: aws.Int64(0), - MaxSize: aws.Int64(0), - } - if _, err := conn.UpdateAutoScalingGroup(&opts); err != nil { - return fmt.Errorf("Error setting capacity to zero to drain: %s", err) - } - - // Next, wait for the autoscale group to drain - log.Printf("[DEBUG] Waiting for group to have zero instances") - return resource.Retry(10*time.Minute, func() *resource.RetryError { - g, err := getAwsAutoscalingGroup(d.Id(), conn) - if err != nil { - return resource.NonRetryableError(err) - } - if g == nil { - log.Printf("[INFO] Autoscaling Group %q not found", d.Id()) - d.SetId("") - return nil - } - - if len(g.Instances) == 0 { - return nil - } - - return resource.RetryableError( - fmt.Errorf("group still has %d instances", len(g.Instances))) - }) -} - -func enableASGSuspendedProcesses(d *schema.ResourceData, conn *autoscaling.AutoScaling) error { - props := &autoscaling.ScalingProcessQuery{ - AutoScalingGroupName: aws.String(d.Id()), - ScalingProcesses: expandStringList(d.Get("suspended_processes").(*schema.Set).List()), - } - - _, err := conn.SuspendProcesses(props) - if err != nil { - return err - } - - return nil -} - -func enableASGMetricsCollection(d *schema.ResourceData, conn *autoscaling.AutoScaling) error { - props := &autoscaling.EnableMetricsCollectionInput{ - AutoScalingGroupName: aws.String(d.Id()), - Granularity: aws.String(d.Get("metrics_granularity").(string)), - Metrics: expandStringList(d.Get("enabled_metrics").(*schema.Set).List()), - } - - log.Printf("[INFO] Enabling metrics collection for the ASG: %s", d.Id()) - _, metricsErr := conn.EnableMetricsCollection(props) - if metricsErr != nil { - return metricsErr - } - - return nil -} - -func updateASGSuspendedProcesses(d *schema.ResourceData, conn *autoscaling.AutoScaling) error { - o, n := d.GetChange("suspended_processes") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - resumeProcesses := os.Difference(ns) - if resumeProcesses.Len() != 0 { - props := &autoscaling.ScalingProcessQuery{ - AutoScalingGroupName: aws.String(d.Id()), - ScalingProcesses: expandStringList(resumeProcesses.List()), - } - - _, err := conn.ResumeProcesses(props) - if err != nil { - return fmt.Errorf("Error Resuming Processes for ASG %q: %s", d.Id(), err) - } - } - - suspendedProcesses := ns.Difference(os) - if suspendedProcesses.Len() != 0 { - props := &autoscaling.ScalingProcessQuery{ - AutoScalingGroupName: aws.String(d.Id()), - ScalingProcesses: expandStringList(suspendedProcesses.List()), - } - - _, err := conn.SuspendProcesses(props) - if err != nil { - return fmt.Errorf("Error Suspending Processes for ASG %q: %s", d.Id(), err) - } - } - - return nil - -} - -func updateASGMetricsCollection(d *schema.ResourceData, conn *autoscaling.AutoScaling) error { - - o, n := d.GetChange("enabled_metrics") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - disableMetrics := os.Difference(ns) - if disableMetrics.Len() != 0 { - props := &autoscaling.DisableMetricsCollectionInput{ - AutoScalingGroupName: aws.String(d.Id()), - Metrics: expandStringList(disableMetrics.List()), - } - - _, err := conn.DisableMetricsCollection(props) - if err != nil { - return fmt.Errorf("Failure to Disable metrics collection types for ASG %s: %s", d.Id(), err) - } - } - - enabledMetrics := ns.Difference(os) - if enabledMetrics.Len() != 0 { - props := &autoscaling.EnableMetricsCollectionInput{ - AutoScalingGroupName: aws.String(d.Id()), - Metrics: expandStringList(enabledMetrics.List()), - Granularity: aws.String(d.Get("metrics_granularity").(string)), - } - - _, err := conn.EnableMetricsCollection(props) - if err != nil { - return fmt.Errorf("Failure to Enable metrics collection types for ASG %s: %s", d.Id(), err) - } - } - - return nil -} - -// getELBInstanceStates returns a mapping of the instance states of all the ELBs attached to the -// provided ASG. -// -// Note that this is the instance state function for ELB Classic. -// -// Nested like: lbName -> instanceId -> instanceState -func getELBInstanceStates(g *autoscaling.Group, meta interface{}) (map[string]map[string]string, error) { - lbInstanceStates := make(map[string]map[string]string) - elbconn := meta.(*AWSClient).elbconn - - for _, lbName := range g.LoadBalancerNames { - lbInstanceStates[*lbName] = make(map[string]string) - opts := &elb.DescribeInstanceHealthInput{LoadBalancerName: lbName} - r, err := elbconn.DescribeInstanceHealth(opts) - if err != nil { - return nil, err - } - for _, is := range r.InstanceStates { - if is.InstanceId == nil || is.State == nil { - continue - } - lbInstanceStates[*lbName][*is.InstanceId] = *is.State - } - } - - return lbInstanceStates, nil -} - -// getTargetGroupInstanceStates returns a mapping of the instance states of -// all the ALB target groups attached to the provided ASG. -// -// Note that this is the instance state function for Application Load -// Balancing (aka ELBv2). -// -// Nested like: targetGroupARN -> instanceId -> instanceState -func getTargetGroupInstanceStates(g *autoscaling.Group, meta interface{}) (map[string]map[string]string, error) { - targetInstanceStates := make(map[string]map[string]string) - elbv2conn := meta.(*AWSClient).elbv2conn - - for _, targetGroupARN := range g.TargetGroupARNs { - targetInstanceStates[*targetGroupARN] = make(map[string]string) - opts := &elbv2.DescribeTargetHealthInput{TargetGroupArn: targetGroupARN} - r, err := elbv2conn.DescribeTargetHealth(opts) - if err != nil { - return nil, err - } - for _, desc := range r.TargetHealthDescriptions { - if desc.Target == nil || desc.Target.Id == nil || desc.TargetHealth == nil || desc.TargetHealth.State == nil { - continue - } - targetInstanceStates[*targetGroupARN][*desc.Target.Id] = *desc.TargetHealth.State - } - } - - return targetInstanceStates, nil -} - -func expandVpcZoneIdentifiers(list []interface{}) *string { - strs := make([]string, len(list)) - for _, s := range list { - strs = append(strs, s.(string)) - } - return aws.String(strings.Join(strs, ",")) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_group_waiting.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_group_waiting.go deleted file mode 100644 index 22f97f6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_group_waiting.go +++ /dev/null @@ -1,139 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -// waitForASGCapacityTimeout gathers the current numbers of healthy instances -// in the ASG and its attached ELBs and yields these numbers to a -// capacitySatifiedFunction. Loops for up to wait_for_capacity_timeout until -// the capacitySatisfiedFunc returns true. -// -// See "Waiting for Capacity" in docs for more discussion of the feature. -func waitForASGCapacity( - d *schema.ResourceData, - meta interface{}, - satisfiedFunc capacitySatisfiedFunc) error { - wait, err := time.ParseDuration(d.Get("wait_for_capacity_timeout").(string)) - if err != nil { - return err - } - - if wait == 0 { - log.Printf("[DEBUG] Capacity timeout set to 0, skipping capacity waiting.") - return nil - } - - log.Printf("[DEBUG] Waiting on %s for capacity...", d.Id()) - - return resource.Retry(wait, func() *resource.RetryError { - g, err := getAwsAutoscalingGroup(d.Id(), meta.(*AWSClient).autoscalingconn) - if err != nil { - return resource.NonRetryableError(err) - } - if g == nil { - log.Printf("[INFO] Autoscaling Group %q not found", d.Id()) - d.SetId("") - return nil - } - elbis, err := getELBInstanceStates(g, meta) - albis, err := getTargetGroupInstanceStates(g, meta) - if err != nil { - return resource.NonRetryableError(err) - } - - haveASG := 0 - haveELB := 0 - - for _, i := range g.Instances { - if i.HealthStatus == nil || i.InstanceId == nil || i.LifecycleState == nil { - continue - } - - if !strings.EqualFold(*i.HealthStatus, "Healthy") { - continue - } - - if !strings.EqualFold(*i.LifecycleState, "InService") { - continue - } - - haveASG++ - - inAllLbs := true - for _, states := range elbis { - state, ok := states[*i.InstanceId] - if !ok || !strings.EqualFold(state, "InService") { - inAllLbs = false - } - } - for _, states := range albis { - state, ok := states[*i.InstanceId] - if !ok || !strings.EqualFold(state, "healthy") { - inAllLbs = false - } - } - if inAllLbs { - haveELB++ - } - } - - satisfied, reason := satisfiedFunc(d, haveASG, haveELB) - - log.Printf("[DEBUG] %q Capacity: %d ASG, %d ELB/ALB, satisfied: %t, reason: %q", - d.Id(), haveASG, haveELB, satisfied, reason) - - if satisfied { - return nil - } - - return resource.RetryableError( - fmt.Errorf("%q: Waiting up to %s: %s", d.Id(), wait, reason)) - }) -} - -type capacitySatisfiedFunc func(*schema.ResourceData, int, int) (bool, string) - -// capacitySatisfiedCreate treats all targets as minimums -func capacitySatisfiedCreate(d *schema.ResourceData, haveASG, haveELB int) (bool, string) { - minASG := d.Get("min_size").(int) - if wantASG := d.Get("desired_capacity").(int); wantASG > 0 { - minASG = wantASG - } - if haveASG < minASG { - return false, fmt.Sprintf( - "Need at least %d healthy instances in ASG, have %d", minASG, haveASG) - } - minELB := d.Get("min_elb_capacity").(int) - if wantELB := d.Get("wait_for_elb_capacity").(int); wantELB > 0 { - minELB = wantELB - } - if haveELB < minELB { - return false, fmt.Sprintf( - "Need at least %d healthy instances in ELB, have %d", minELB, haveELB) - } - return true, "" -} - -// capacitySatisfiedUpdate only cares about specific targets -func capacitySatisfiedUpdate(d *schema.ResourceData, haveASG, haveELB int) (bool, string) { - if wantASG := d.Get("desired_capacity").(int); wantASG > 0 { - if haveASG != wantASG { - return false, fmt.Sprintf( - "Need exactly %d healthy instances in ASG, have %d", wantASG, haveASG) - } - } - if wantELB := d.Get("wait_for_elb_capacity").(int); wantELB > 0 { - if haveELB != wantELB { - return false, fmt.Sprintf( - "Need exactly %d healthy instances in ELB, have %d", wantELB, haveELB) - } - } - return true, "" -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_lifecycle_hook.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_lifecycle_hook.go deleted file mode 100644 index 6062234..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_lifecycle_hook.go +++ /dev/null @@ -1,194 +0,0 @@ -package aws - -import ( - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAutoscalingLifecycleHook() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAutoscalingLifecycleHookPut, - Read: resourceAwsAutoscalingLifecycleHookRead, - Update: resourceAwsAutoscalingLifecycleHookPut, - Delete: resourceAwsAutoscalingLifecycleHookDelete, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "autoscaling_group_name": { - Type: schema.TypeString, - Required: true, - }, - "default_result": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "heartbeat_timeout": { - Type: schema.TypeInt, - Optional: true, - }, - "lifecycle_transition": { - Type: schema.TypeString, - Required: true, - }, - "notification_metadata": { - Type: schema.TypeString, - Optional: true, - }, - "notification_target_arn": { - Type: schema.TypeString, - Optional: true, - }, - "role_arn": { - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func resourceAwsAutoscalingLifecycleHookPutOp(conn *autoscaling.AutoScaling, params *autoscaling.PutLifecycleHookInput) error { - log.Printf("[DEBUG] AutoScaling PutLifecyleHook: %s", params) - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.PutLifecycleHook(params) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if strings.Contains(awsErr.Message(), "Unable to publish test message to notification target") { - return resource.RetryableError(errwrap.Wrapf("[DEBUG] Retrying AWS AutoScaling Lifecycle Hook: {{err}}", awsErr)) - } - } - return resource.NonRetryableError(errwrap.Wrapf("Error putting lifecycle hook: {{err}}", err)) - } - return nil - }) -} - -func resourceAwsAutoscalingLifecycleHookPut(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - params := getAwsAutoscalingPutLifecycleHookInput(d) - - if err := resourceAwsAutoscalingLifecycleHookPutOp(conn, ¶ms); err != nil { - return err - } - - d.SetId(d.Get("name").(string)) - - return resourceAwsAutoscalingLifecycleHookRead(d, meta) -} - -func resourceAwsAutoscalingLifecycleHookRead(d *schema.ResourceData, meta interface{}) error { - p, err := getAwsAutoscalingLifecycleHook(d, meta) - if err != nil { - return err - } - if p == nil { - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Read Lifecycle Hook: ASG: %s, SH: %s, Obj: %#v", d.Get("autoscaling_group_name"), d.Get("name"), p) - - d.Set("default_result", p.DefaultResult) - d.Set("heartbeat_timeout", p.HeartbeatTimeout) - d.Set("lifecycle_transition", p.LifecycleTransition) - d.Set("notification_metadata", p.NotificationMetadata) - d.Set("notification_target_arn", p.NotificationTargetARN) - d.Set("name", p.LifecycleHookName) - d.Set("role_arn", p.RoleARN) - - return nil -} - -func resourceAwsAutoscalingLifecycleHookDelete(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - p, err := getAwsAutoscalingLifecycleHook(d, meta) - if err != nil { - return err - } - if p == nil { - return nil - } - - params := autoscaling.DeleteLifecycleHookInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - LifecycleHookName: aws.String(d.Get("name").(string)), - } - if _, err := autoscalingconn.DeleteLifecycleHook(¶ms); err != nil { - return errwrap.Wrapf("Autoscaling Lifecycle Hook: {{err}}", err) - } - - d.SetId("") - return nil -} - -func getAwsAutoscalingPutLifecycleHookInput(d *schema.ResourceData) autoscaling.PutLifecycleHookInput { - var params = autoscaling.PutLifecycleHookInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - LifecycleHookName: aws.String(d.Get("name").(string)), - } - - if v, ok := d.GetOk("default_result"); ok { - params.DefaultResult = aws.String(v.(string)) - } - - if v, ok := d.GetOk("heartbeat_timeout"); ok { - params.HeartbeatTimeout = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("lifecycle_transition"); ok { - params.LifecycleTransition = aws.String(v.(string)) - } - - if v, ok := d.GetOk("notification_metadata"); ok { - params.NotificationMetadata = aws.String(v.(string)) - } - - if v, ok := d.GetOk("notification_target_arn"); ok { - params.NotificationTargetARN = aws.String(v.(string)) - } - - if v, ok := d.GetOk("role_arn"); ok { - params.RoleARN = aws.String(v.(string)) - } - - return params -} - -func getAwsAutoscalingLifecycleHook(d *schema.ResourceData, meta interface{}) (*autoscaling.LifecycleHook, error) { - autoscalingconn := meta.(*AWSClient).autoscalingconn - - params := autoscaling.DescribeLifecycleHooksInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - LifecycleHookNames: []*string{aws.String(d.Get("name").(string))}, - } - - log.Printf("[DEBUG] AutoScaling Lifecycle Hook Describe Params: %#v", params) - resp, err := autoscalingconn.DescribeLifecycleHooks(¶ms) - if err != nil { - return nil, errwrap.Wrapf("Error retrieving lifecycle hooks: {{err}}", err) - } - - // find lifecycle hooks - name := d.Get("name") - for idx, sp := range resp.LifecycleHooks { - if *sp.LifecycleHookName == name { - return resp.LifecycleHooks[idx], nil - } - } - - // lifecycle hook not found - return nil, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_notification.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_notification.go deleted file mode 100644 index 5afcc66..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_notification.go +++ /dev/null @@ -1,211 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAutoscalingNotification() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAutoscalingNotificationCreate, - Read: resourceAwsAutoscalingNotificationRead, - Update: resourceAwsAutoscalingNotificationUpdate, - Delete: resourceAwsAutoscalingNotificationDelete, - - Schema: map[string]*schema.Schema{ - "topic_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "group_names": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "notifications": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - } -} - -func resourceAwsAutoscalingNotificationCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - gl := convertSetToList(d.Get("group_names").(*schema.Set)) - nl := convertSetToList(d.Get("notifications").(*schema.Set)) - - topic := d.Get("topic_arn").(string) - if err := addNotificationConfigToGroupsWithTopic(conn, gl, nl, topic); err != nil { - return err - } - - // ARNs are unique, and these notifications are per ARN, so we re-use the ARN - // here as the ID - d.SetId(topic) - return resourceAwsAutoscalingNotificationRead(d, meta) -} - -func resourceAwsAutoscalingNotificationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - gl := convertSetToList(d.Get("group_names").(*schema.Set)) - - opts := &autoscaling.DescribeNotificationConfigurationsInput{ - AutoScalingGroupNames: gl, - } - - topic := d.Get("topic_arn").(string) - // Grab all applicable notifcation configurations for this Topic. - // Each NotificationType will have a record, so 1 Group with 3 Types results - // in 3 records, all with the same Group name - gRaw := make(map[string]bool) - nRaw := make(map[string]bool) - - i := 0 - err := conn.DescribeNotificationConfigurationsPages(opts, func(resp *autoscaling.DescribeNotificationConfigurationsOutput, lastPage bool) bool { - if resp != nil { - i++ - log.Printf("[DEBUG] Paging DescribeNotificationConfigurations for (%s), page: %d", d.Id(), i) - } else { - log.Printf("[DEBUG] Paging finished for DescribeNotificationConfigurations (%s)", d.Id()) - } - - for _, n := range resp.NotificationConfigurations { - if *n.TopicARN == topic { - gRaw[*n.AutoScalingGroupName] = true - nRaw[*n.NotificationType] = true - } - } - return true // return false to stop paging - }) - if err != nil { - return err - } - - // Grab the keys here as the list of Groups - var gList []string - for k, _ := range gRaw { - gList = append(gList, k) - } - - // Grab the keys here as the list of Types - var nList []string - for k, _ := range nRaw { - nList = append(nList, k) - } - - if err := d.Set("group_names", gList); err != nil { - return err - } - if err := d.Set("notifications", nList); err != nil { - return err - } - - return nil -} - -func resourceAwsAutoscalingNotificationUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - - // Notifications API call is a PUT, so we don't need to diff the list, just - // push whatever it is and AWS sorts it out - nl := convertSetToList(d.Get("notifications").(*schema.Set)) - - o, n := d.GetChange("group_names") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := convertSetToList(os.Difference(ns)) - add := convertSetToList(ns.Difference(os)) - - topic := d.Get("topic_arn").(string) - - if err := removeNotificationConfigToGroupsWithTopic(conn, remove, topic); err != nil { - return err - } - - var update []*string - if d.HasChange("notifications") { - update = convertSetToList(d.Get("group_names").(*schema.Set)) - } else { - update = add - } - - if err := addNotificationConfigToGroupsWithTopic(conn, update, nl, topic); err != nil { - return err - } - - return resourceAwsAutoscalingNotificationRead(d, meta) -} - -func addNotificationConfigToGroupsWithTopic(conn *autoscaling.AutoScaling, groups []*string, nl []*string, topic string) error { - for _, a := range groups { - opts := &autoscaling.PutNotificationConfigurationInput{ - AutoScalingGroupName: a, - NotificationTypes: nl, - TopicARN: aws.String(topic), - } - - _, err := conn.PutNotificationConfiguration(opts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - return fmt.Errorf("[WARN] Error creating Autoscaling Group Notification for Group %s, error: \"%s\", code: \"%s\"", *a, awsErr.Message(), awsErr.Code()) - } - return err - } - } - return nil -} - -func removeNotificationConfigToGroupsWithTopic(conn *autoscaling.AutoScaling, groups []*string, topic string) error { - for _, r := range groups { - opts := &autoscaling.DeleteNotificationConfigurationInput{ - AutoScalingGroupName: r, - TopicARN: aws.String(topic), - } - - _, err := conn.DeleteNotificationConfiguration(opts) - if err != nil { - return fmt.Errorf("[WARN] Error deleting notification configuration for ASG \"%s\", Topic ARN \"%s\"", *r, topic) - } - } - return nil -} - -func resourceAwsAutoscalingNotificationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).autoscalingconn - gl := convertSetToList(d.Get("group_names").(*schema.Set)) - - topic := d.Get("topic_arn").(string) - if err := removeNotificationConfigToGroupsWithTopic(conn, gl, topic); err != nil { - return err - } - - return nil -} - -func convertSetToList(s *schema.Set) (nl []*string) { - l := s.List() - for _, n := range l { - nl = append(nl, aws.String(n.(string))) - } - - return nl -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_policy.go deleted file mode 100644 index 6d24030..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_policy.go +++ /dev/null @@ -1,311 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsAutoscalingPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAutoscalingPolicyCreate, - Read: resourceAwsAutoscalingPolicyRead, - Update: resourceAwsAutoscalingPolicyUpdate, - Delete: resourceAwsAutoscalingPolicyDelete, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "adjustment_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "autoscaling_group_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "policy_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "SimpleScaling", // preserve AWS's default to make validation easier. - }, - "cooldown": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "estimated_instance_warmup": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "metric_aggregation_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "min_adjustment_magnitude": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "min_adjustment_step": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Deprecated: "Use min_adjustment_magnitude instead, otherwise you may see a perpetual diff on this resource.", - ConflictsWith: []string{"min_adjustment_magnitude"}, - }, - "scaling_adjustment": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ConflictsWith: []string{"step_adjustment"}, - }, - "step_adjustment": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ConflictsWith: []string{"scaling_adjustment"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "metric_interval_lower_bound": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "metric_interval_upper_bound": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "scaling_adjustment": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: resourceAwsAutoscalingScalingAdjustmentHash, - }, - }, - } -} - -func resourceAwsAutoscalingPolicyCreate(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - - params, err := getAwsAutoscalingPutScalingPolicyInput(d) - if err != nil { - return err - } - - log.Printf("[DEBUG] AutoScaling PutScalingPolicy: %#v", params) - resp, err := autoscalingconn.PutScalingPolicy(¶ms) - if err != nil { - return fmt.Errorf("Error putting scaling policy: %s", err) - } - - d.Set("arn", resp.PolicyARN) - d.SetId(d.Get("name").(string)) - log.Printf("[INFO] AutoScaling Scaling PolicyARN: %s", d.Get("arn").(string)) - - return resourceAwsAutoscalingPolicyRead(d, meta) -} - -func resourceAwsAutoscalingPolicyRead(d *schema.ResourceData, meta interface{}) error { - p, err := getAwsAutoscalingPolicy(d, meta) - if err != nil { - return err - } - if p == nil { - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Read Scaling Policy: ASG: %s, SP: %s, Obj: %s", d.Get("autoscaling_group_name"), d.Get("name"), p) - - d.Set("adjustment_type", p.AdjustmentType) - d.Set("autoscaling_group_name", p.AutoScalingGroupName) - d.Set("cooldown", p.Cooldown) - d.Set("estimated_instance_warmup", p.EstimatedInstanceWarmup) - d.Set("metric_aggregation_type", p.MetricAggregationType) - d.Set("policy_type", p.PolicyType) - if p.MinAdjustmentMagnitude != nil { - d.Set("min_adjustment_magnitude", p.MinAdjustmentMagnitude) - d.Set("min_adjustment_step", 0) - } else { - d.Set("min_adjustment_step", p.MinAdjustmentStep) - } - d.Set("arn", p.PolicyARN) - d.Set("name", p.PolicyName) - d.Set("scaling_adjustment", p.ScalingAdjustment) - d.Set("step_adjustment", flattenStepAdjustments(p.StepAdjustments)) - - return nil -} - -func resourceAwsAutoscalingPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - - params, inputErr := getAwsAutoscalingPutScalingPolicyInput(d) - if inputErr != nil { - return inputErr - } - - log.Printf("[DEBUG] Autoscaling Update Scaling Policy: %#v", params) - _, err := autoscalingconn.PutScalingPolicy(¶ms) - if err != nil { - return err - } - - return resourceAwsAutoscalingPolicyRead(d, meta) -} - -func resourceAwsAutoscalingPolicyDelete(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - p, err := getAwsAutoscalingPolicy(d, meta) - if err != nil { - return err - } - if p == nil { - return nil - } - - params := autoscaling.DeletePolicyInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - PolicyName: aws.String(d.Get("name").(string)), - } - log.Printf("[DEBUG] Deleting Autoscaling Policy opts: %s", params) - if _, err := autoscalingconn.DeletePolicy(¶ms); err != nil { - return fmt.Errorf("Autoscaling Scaling Policy: %s ", err) - } - - d.SetId("") - return nil -} - -// PutScalingPolicy can safely resend all parameters without destroying the -// resource, so create and update can share this common function. It will error -// if certain mutually exclusive values are set. -func getAwsAutoscalingPutScalingPolicyInput(d *schema.ResourceData) (autoscaling.PutScalingPolicyInput, error) { - var params = autoscaling.PutScalingPolicyInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - PolicyName: aws.String(d.Get("name").(string)), - } - - if v, ok := d.GetOk("adjustment_type"); ok { - params.AdjustmentType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("cooldown"); ok { - params.Cooldown = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("estimated_instance_warmup"); ok { - params.EstimatedInstanceWarmup = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("metric_aggregation_type"); ok { - params.MetricAggregationType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("policy_type"); ok { - params.PolicyType = aws.String(v.(string)) - } - - //if policy_type=="SimpleScaling" then scaling_adjustment is required and 0 is allowed - if v, ok := d.GetOk("scaling_adjustment"); ok || *params.PolicyType == "SimpleScaling" { - params.ScalingAdjustment = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("step_adjustment"); ok { - steps, err := expandStepAdjustments(v.(*schema.Set).List()) - if err != nil { - return params, fmt.Errorf("metric_interval_lower_bound and metric_interval_upper_bound must be strings!") - } - params.StepAdjustments = steps - } - - if v, ok := d.GetOk("min_adjustment_magnitude"); ok { - // params.MinAdjustmentMagnitude = aws.Int64(int64(d.Get("min_adjustment_magnitude").(int))) - params.MinAdjustmentMagnitude = aws.Int64(int64(v.(int))) - } else if v, ok := d.GetOk("min_adjustment_step"); ok { - // params.MinAdjustmentStep = aws.Int64(int64(d.Get("min_adjustment_step").(int))) - params.MinAdjustmentStep = aws.Int64(int64(v.(int))) - } - - // Validate our final input to confirm it won't error when sent to AWS. - // First, SimpleScaling policy types... - if *params.PolicyType == "SimpleScaling" && params.StepAdjustments != nil { - return params, fmt.Errorf("SimpleScaling policy types cannot use step_adjustments!") - } - if *params.PolicyType == "SimpleScaling" && params.MetricAggregationType != nil { - return params, fmt.Errorf("SimpleScaling policy types cannot use metric_aggregation_type!") - } - if *params.PolicyType == "SimpleScaling" && params.EstimatedInstanceWarmup != nil { - return params, fmt.Errorf("SimpleScaling policy types cannot use estimated_instance_warmup!") - } - - // Second, StepScaling policy types... - if *params.PolicyType == "StepScaling" && params.ScalingAdjustment != nil { - return params, fmt.Errorf("StepScaling policy types cannot use scaling_adjustment!") - } - if *params.PolicyType == "StepScaling" && params.Cooldown != nil { - return params, fmt.Errorf("StepScaling policy types cannot use cooldown!") - } - - return params, nil -} - -func getAwsAutoscalingPolicy(d *schema.ResourceData, meta interface{}) (*autoscaling.ScalingPolicy, error) { - autoscalingconn := meta.(*AWSClient).autoscalingconn - - params := autoscaling.DescribePoliciesInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - PolicyNames: []*string{aws.String(d.Get("name").(string))}, - } - - log.Printf("[DEBUG] AutoScaling Scaling Policy Describe Params: %#v", params) - resp, err := autoscalingconn.DescribePolicies(¶ms) - if err != nil { - //A ValidationError here can mean that either the Policy is missing OR the Autoscaling Group is missing - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "ValidationError" { - log.Printf("[WARNING] %s not found, removing from state", d.Id()) - d.SetId("") - - return nil, nil - } - return nil, fmt.Errorf("Error retrieving scaling policies: %s", err) - } - - // find scaling policy - name := d.Get("name") - for idx, sp := range resp.ScalingPolicies { - if *sp.PolicyName == name { - return resp.ScalingPolicies[idx], nil - } - } - - // policy not found - return nil, nil -} - -func resourceAwsAutoscalingScalingAdjustmentHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - if v, ok := m["metric_interval_lower_bound"]; ok { - buf.WriteString(fmt.Sprintf("%f-", v)) - } - if v, ok := m["metric_interval_upper_bound"]; ok { - buf.WriteString(fmt.Sprintf("%f-", v)) - } - buf.WriteString(fmt.Sprintf("%d-", m["scaling_adjustment"].(int))) - - return hashcode.String(buf.String()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_schedule.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_schedule.go deleted file mode 100644 index 5cfa1c7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_autoscaling_schedule.go +++ /dev/null @@ -1,190 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/terraform/helper/schema" -) - -const awsAutoscalingScheduleTimeLayout = "2006-01-02T15:04:05Z" - -func resourceAwsAutoscalingSchedule() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsAutoscalingScheduleCreate, - Read: resourceAwsAutoscalingScheduleRead, - Update: resourceAwsAutoscalingScheduleCreate, - Delete: resourceAwsAutoscalingScheduleDelete, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "scheduled_action_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "autoscaling_group_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "start_time": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateASGScheduleTimestamp, - }, - "end_time": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateASGScheduleTimestamp, - }, - "recurrence": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "min_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - "max_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - "desired_capacity": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsAutoscalingScheduleCreate(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - params := &autoscaling.PutScheduledUpdateGroupActionInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - ScheduledActionName: aws.String(d.Get("scheduled_action_name").(string)), - } - - if attr, ok := d.GetOk("start_time"); ok { - t, err := time.Parse(awsAutoscalingScheduleTimeLayout, attr.(string)) - if err != nil { - return fmt.Errorf("Error Parsing AWS Autoscaling Group Schedule Start Time: %s", err.Error()) - } - params.StartTime = aws.Time(t) - } - - if attr, ok := d.GetOk("end_time"); ok { - t, err := time.Parse(awsAutoscalingScheduleTimeLayout, attr.(string)) - if err != nil { - return fmt.Errorf("Error Parsing AWS Autoscaling Group Schedule End Time: %s", err.Error()) - } - params.EndTime = aws.Time(t) - } - - if attr, ok := d.GetOk("recurrence"); ok { - params.Recurrence = aws.String(attr.(string)) - } - - params.MinSize = aws.Int64(int64(d.Get("min_size").(int))) - params.MaxSize = aws.Int64(int64(d.Get("max_size").(int))) - params.DesiredCapacity = aws.Int64(int64(d.Get("desired_capacity").(int))) - - log.Printf("[INFO] Creating Autoscaling Scheduled Action: %s", d.Get("scheduled_action_name").(string)) - _, err := autoscalingconn.PutScheduledUpdateGroupAction(params) - if err != nil { - return fmt.Errorf("Error Creating Autoscaling Scheduled Action: %s", err.Error()) - } - - d.SetId(d.Get("scheduled_action_name").(string)) - - return resourceAwsAutoscalingScheduleRead(d, meta) -} - -func resourceAwsAutoscalingScheduleRead(d *schema.ResourceData, meta interface{}) error { - sa, err, exists := resourceAwsASGScheduledActionRetrieve(d, meta) - if err != nil { - return err - } - - if !exists { - log.Printf("Error retrieving Autoscaling Scheduled Actions. Removing from state") - d.SetId("") - return nil - } - - d.Set("autoscaling_group_name", sa.AutoScalingGroupName) - d.Set("arn", sa.ScheduledActionARN) - d.Set("desired_capacity", sa.DesiredCapacity) - d.Set("min_size", sa.MinSize) - d.Set("max_size", sa.MaxSize) - d.Set("recurrence", sa.Recurrence) - - if sa.StartTime != nil { - d.Set("start_time", sa.StartTime.Format(awsAutoscalingScheduleTimeLayout)) - } - - if sa.EndTime != nil { - d.Set("end_time", sa.EndTime.Format(awsAutoscalingScheduleTimeLayout)) - } - - return nil -} - -func resourceAwsAutoscalingScheduleDelete(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - - params := &autoscaling.DeleteScheduledActionInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - ScheduledActionName: aws.String(d.Id()), - } - - log.Printf("[INFO] Deleting Autoscaling Scheduled Action: %s", d.Id()) - _, err := autoscalingconn.DeleteScheduledAction(params) - if err != nil { - return fmt.Errorf("Error deleting Autoscaling Scheduled Action: %s", err.Error()) - } - - return nil -} - -func resourceAwsASGScheduledActionRetrieve(d *schema.ResourceData, meta interface{}) (*autoscaling.ScheduledUpdateGroupAction, error, bool) { - autoscalingconn := meta.(*AWSClient).autoscalingconn - - params := &autoscaling.DescribeScheduledActionsInput{ - AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)), - ScheduledActionNames: []*string{aws.String(d.Id())}, - } - - log.Printf("[INFO] Describing Autoscaling Scheduled Action: %+v", params) - actions, err := autoscalingconn.DescribeScheduledActions(params) - if err != nil { - //A ValidationError here can mean that either the Schedule is missing OR the Autoscaling Group is missing - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "ValidationError" { - log.Printf("[WARNING] %s not found, removing from state", d.Id()) - d.SetId("") - - return nil, nil, false - } - return nil, fmt.Errorf("Error retrieving Autoscaling Scheduled Actions: %s", err), false - } - - if len(actions.ScheduledUpdateGroupActions) != 1 || - *actions.ScheduledUpdateGroupActions[0].ScheduledActionName != d.Id() { - return nil, nil, false - } - - return actions.ScheduledUpdateGroupActions[0], nil, true -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudformation_stack.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudformation_stack.go deleted file mode 100644 index a4321d3..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudformation_stack.go +++ /dev/null @@ -1,628 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudFormationStack() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudFormationStackCreate, - Read: resourceAwsCloudFormationStackRead, - Update: resourceAwsCloudFormationStackUpdate, - Delete: resourceAwsCloudFormationStackDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "template_body": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateCloudFormationTemplate, - StateFunc: func(v interface{}) string { - template, _ := normalizeCloudFormationTemplate(v) - return template - }, - }, - "template_url": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "capabilities": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "disable_rollback": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - }, - "notification_arns": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "on_failure": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "parameters": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - Computed: true, - }, - "outputs": &schema.Schema{ - Type: schema.TypeMap, - Computed: true, - }, - "policy_body": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateJsonString, - StateFunc: func(v interface{}) string { - json, _ := normalizeJsonString(v) - return json - }, - }, - "policy_url": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "timeout_in_minutes": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - }, - "tags": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsCloudFormationStackCreate(d *schema.ResourceData, meta interface{}) error { - retryTimeout := int64(30) - conn := meta.(*AWSClient).cfconn - - input := cloudformation.CreateStackInput{ - StackName: aws.String(d.Get("name").(string)), - } - if v, ok := d.GetOk("template_body"); ok { - template, err := normalizeCloudFormationTemplate(v) - if err != nil { - return errwrap.Wrapf("template body contains an invalid JSON or YAML: {{err}}", err) - } - input.TemplateBody = aws.String(template) - } - if v, ok := d.GetOk("template_url"); ok { - input.TemplateURL = aws.String(v.(string)) - } - if v, ok := d.GetOk("capabilities"); ok { - input.Capabilities = expandStringList(v.(*schema.Set).List()) - } - if v, ok := d.GetOk("disable_rollback"); ok { - input.DisableRollback = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("notification_arns"); ok { - input.NotificationARNs = expandStringList(v.(*schema.Set).List()) - } - if v, ok := d.GetOk("on_failure"); ok { - input.OnFailure = aws.String(v.(string)) - } - if v, ok := d.GetOk("parameters"); ok { - input.Parameters = expandCloudFormationParameters(v.(map[string]interface{})) - } - if v, ok := d.GetOk("policy_body"); ok { - policy, err := normalizeJsonString(v) - if err != nil { - return errwrap.Wrapf("policy body contains an invalid JSON: {{err}}", err) - } - input.StackPolicyBody = aws.String(policy) - } - if v, ok := d.GetOk("policy_url"); ok { - input.StackPolicyURL = aws.String(v.(string)) - } - if v, ok := d.GetOk("tags"); ok { - input.Tags = expandCloudFormationTags(v.(map[string]interface{})) - } - if v, ok := d.GetOk("timeout_in_minutes"); ok { - m := int64(v.(int)) - input.TimeoutInMinutes = aws.Int64(m) - if m > retryTimeout { - retryTimeout = m + 5 - log.Printf("[DEBUG] CloudFormation timeout: %d", retryTimeout) - } - } - - log.Printf("[DEBUG] Creating CloudFormation Stack: %s", input) - resp, err := conn.CreateStack(&input) - if err != nil { - return fmt.Errorf("Creating CloudFormation stack failed: %s", err.Error()) - } - - d.SetId(*resp.StackId) - var lastStatus string - - wait := resource.StateChangeConf{ - Pending: []string{ - "CREATE_IN_PROGRESS", - "DELETE_IN_PROGRESS", - "ROLLBACK_IN_PROGRESS", - }, - Target: []string{ - "CREATE_COMPLETE", - "CREATE_FAILED", - "DELETE_COMPLETE", - "DELETE_FAILED", - "ROLLBACK_COMPLETE", - "ROLLBACK_FAILED", - }, - Timeout: time.Duration(retryTimeout) * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeStacks(&cloudformation.DescribeStacksInput{ - StackName: aws.String(d.Id()), - }) - if err != nil { - log.Printf("[ERROR] Failed to describe stacks: %s", err) - return nil, "", err - } - if len(resp.Stacks) == 0 { - // This shouldn't happen unless CloudFormation is inconsistent - // See https://github.com/hashicorp/terraform/issues/5487 - log.Printf("[WARN] CloudFormation stack %q not found.\nresponse: %q", - d.Id(), resp) - return resp, "", fmt.Errorf( - "CloudFormation stack %q vanished unexpectedly during creation.\n"+ - "Unless you knowingly manually deleted the stack "+ - "please report this as bug at https://github.com/hashicorp/terraform/issues\n"+ - "along with the config & Terraform version & the details below:\n"+ - "Full API response: %s\n", - d.Id(), resp) - } - - status := *resp.Stacks[0].StackStatus - lastStatus = status - log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) - - return resp, status, err - }, - } - - _, err = wait.WaitForState() - if err != nil { - return err - } - - if lastStatus == "ROLLBACK_COMPLETE" || lastStatus == "ROLLBACK_FAILED" { - reasons, err := getCloudFormationRollbackReasons(d.Id(), nil, conn) - if err != nil { - return fmt.Errorf("Failed getting rollback reasons: %q", err.Error()) - } - - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - if lastStatus == "DELETE_COMPLETE" || lastStatus == "DELETE_FAILED" { - reasons, err := getCloudFormationDeletionReasons(d.Id(), conn) - if err != nil { - return fmt.Errorf("Failed getting deletion reasons: %q", err.Error()) - } - - d.SetId("") - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - if lastStatus == "CREATE_FAILED" { - reasons, err := getCloudFormationFailures(d.Id(), conn) - if err != nil { - return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) - } - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - - log.Printf("[INFO] CloudFormation Stack %q created", d.Id()) - - return resourceAwsCloudFormationStackRead(d, meta) -} - -func resourceAwsCloudFormationStackRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cfconn - - input := &cloudformation.DescribeStacksInput{ - StackName: aws.String(d.Id()), - } - resp, err := conn.DescribeStacks(input) - if err != nil { - awsErr, ok := err.(awserr.Error) - // ValidationError: Stack with id % does not exist - if ok && awsErr.Code() == "ValidationError" { - log.Printf("[WARN] Removing CloudFormation stack %s as it's already gone", d.Id()) - d.SetId("") - return nil - } - - return err - } - - stacks := resp.Stacks - if len(stacks) < 1 { - log.Printf("[WARN] Removing CloudFormation stack %s as it's already gone", d.Id()) - d.SetId("") - return nil - } - for _, s := range stacks { - if *s.StackId == d.Id() && *s.StackStatus == "DELETE_COMPLETE" { - log.Printf("[DEBUG] Removing CloudFormation stack %s"+ - " as it has been already deleted", d.Id()) - d.SetId("") - return nil - } - } - - tInput := cloudformation.GetTemplateInput{ - StackName: aws.String(d.Id()), - } - out, err := conn.GetTemplate(&tInput) - if err != nil { - return err - } - - template, err := normalizeCloudFormationTemplate(*out.TemplateBody) - if err != nil { - return errwrap.Wrapf("template body contains an invalid JSON or YAML: {{err}}", err) - } - d.Set("template_body", template) - - stack := stacks[0] - log.Printf("[DEBUG] Received CloudFormation stack: %s", stack) - - d.Set("name", stack.StackName) - d.Set("arn", stack.StackId) - - if stack.TimeoutInMinutes != nil { - d.Set("timeout_in_minutes", int(*stack.TimeoutInMinutes)) - } - if stack.Description != nil { - d.Set("description", stack.Description) - } - if stack.DisableRollback != nil { - d.Set("disable_rollback", stack.DisableRollback) - } - if len(stack.NotificationARNs) > 0 { - err = d.Set("notification_arns", schema.NewSet(schema.HashString, flattenStringList(stack.NotificationARNs))) - if err != nil { - return err - } - } - - originalParams := d.Get("parameters").(map[string]interface{}) - err = d.Set("parameters", flattenCloudFormationParameters(stack.Parameters, originalParams)) - if err != nil { - return err - } - - err = d.Set("tags", flattenCloudFormationTags(stack.Tags)) - if err != nil { - return err - } - - err = d.Set("outputs", flattenCloudFormationOutputs(stack.Outputs)) - if err != nil { - return err - } - - if len(stack.Capabilities) > 0 { - err = d.Set("capabilities", schema.NewSet(schema.HashString, flattenStringList(stack.Capabilities))) - if err != nil { - return err - } - } - - return nil -} - -func resourceAwsCloudFormationStackUpdate(d *schema.ResourceData, meta interface{}) error { - retryTimeout := int64(30) - conn := meta.(*AWSClient).cfconn - - input := &cloudformation.UpdateStackInput{ - StackName: aws.String(d.Id()), - } - - // Either TemplateBody, TemplateURL or UsePreviousTemplate are required - if v, ok := d.GetOk("template_url"); ok { - input.TemplateURL = aws.String(v.(string)) - } - if v, ok := d.GetOk("template_body"); ok && input.TemplateURL == nil { - template, err := normalizeCloudFormationTemplate(v) - if err != nil { - return errwrap.Wrapf("template body contains an invalid JSON or YAML: {{err}}", err) - } - input.TemplateBody = aws.String(template) - } - - // Capabilities must be present whether they are changed or not - if v, ok := d.GetOk("capabilities"); ok { - input.Capabilities = expandStringList(v.(*schema.Set).List()) - } - - if d.HasChange("notification_arns") { - input.NotificationARNs = expandStringList(d.Get("notification_arns").(*schema.Set).List()) - } - - // Parameters must be present whether they are changed or not - if v, ok := d.GetOk("parameters"); ok { - input.Parameters = expandCloudFormationParameters(v.(map[string]interface{})) - } - - if d.HasChange("policy_body") { - policy, err := normalizeJsonString(d.Get("policy_body")) - if err != nil { - return errwrap.Wrapf("policy body contains an invalid JSON: {{err}}", err) - } - input.StackPolicyBody = aws.String(policy) - } - if d.HasChange("policy_url") { - input.StackPolicyURL = aws.String(d.Get("policy_url").(string)) - } - - log.Printf("[DEBUG] Updating CloudFormation stack: %s", input) - stack, err := conn.UpdateStack(input) - if err != nil { - return err - } - - lastUpdatedTime, err := getLastCfEventTimestamp(d.Id(), conn) - if err != nil { - return err - } - - if v, ok := d.GetOk("timeout_in_minutes"); ok { - m := int64(v.(int)) - if m > retryTimeout { - retryTimeout = m + 5 - log.Printf("[DEBUG] CloudFormation timeout: %d", retryTimeout) - } - } - var lastStatus string - wait := resource.StateChangeConf{ - Pending: []string{ - "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS", - "UPDATE_IN_PROGRESS", - "UPDATE_ROLLBACK_IN_PROGRESS", - "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS", - }, - Target: []string{ - "UPDATE_COMPLETE", - "UPDATE_ROLLBACK_COMPLETE", - "UPDATE_ROLLBACK_FAILED", - }, - Timeout: time.Duration(retryTimeout) * time.Minute, - MinTimeout: 5 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeStacks(&cloudformation.DescribeStacksInput{ - StackName: aws.String(d.Id()), - }) - if err != nil { - log.Printf("[ERROR] Failed to describe stacks: %s", err) - return nil, "", err - } - - status := *resp.Stacks[0].StackStatus - lastStatus = status - log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) - - return resp, status, err - }, - } - - _, err = wait.WaitForState() - if err != nil { - return err - } - - if lastStatus == "UPDATE_ROLLBACK_COMPLETE" || lastStatus == "UPDATE_ROLLBACK_FAILED" { - reasons, err := getCloudFormationRollbackReasons(*stack.StackId, lastUpdatedTime, conn) - if err != nil { - return fmt.Errorf("Failed getting details about rollback: %q", err.Error()) - } - - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - - log.Printf("[DEBUG] CloudFormation stack %q has been updated", *stack.StackId) - - return resourceAwsCloudFormationStackRead(d, meta) -} - -func resourceAwsCloudFormationStackDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cfconn - - input := &cloudformation.DeleteStackInput{ - StackName: aws.String(d.Id()), - } - log.Printf("[DEBUG] Deleting CloudFormation stack %s", input) - _, err := conn.DeleteStack(input) - if err != nil { - awsErr, ok := err.(awserr.Error) - if !ok { - return err - } - - if awsErr.Code() == "ValidationError" { - // Ignore stack which has been already deleted - return nil - } - return err - } - var lastStatus string - wait := resource.StateChangeConf{ - Pending: []string{ - "DELETE_IN_PROGRESS", - "ROLLBACK_IN_PROGRESS", - }, - Target: []string{ - "DELETE_COMPLETE", - "DELETE_FAILED", - }, - Timeout: 30 * time.Minute, - MinTimeout: 5 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeStacks(&cloudformation.DescribeStacksInput{ - StackName: aws.String(d.Id()), - }) - if err != nil { - awsErr, ok := err.(awserr.Error) - if !ok { - return nil, "", err - } - - log.Printf("[DEBUG] Error when deleting CloudFormation stack: %s: %s", - awsErr.Code(), awsErr.Message()) - - // ValidationError: Stack with id % does not exist - if awsErr.Code() == "ValidationError" { - return resp, "DELETE_COMPLETE", nil - } - return nil, "", err - } - - if len(resp.Stacks) == 0 { - log.Printf("[DEBUG] CloudFormation stack %q is already gone", d.Id()) - return resp, "DELETE_COMPLETE", nil - } - - status := *resp.Stacks[0].StackStatus - lastStatus = status - log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) - - return resp, status, err - }, - } - - _, err = wait.WaitForState() - if err != nil { - return err - } - - if lastStatus == "DELETE_FAILED" { - reasons, err := getCloudFormationFailures(d.Id(), conn) - if err != nil { - return fmt.Errorf("Failed getting reasons of failure: %q", err.Error()) - } - - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - - log.Printf("[DEBUG] CloudFormation stack %q has been deleted", d.Id()) - - d.SetId("") - - return nil -} - -// getLastCfEventTimestamp takes the first event in a list -// of events ordered from the newest to the oldest -// and extracts timestamp from it -// LastUpdatedTime only provides last >successful< updated time -func getLastCfEventTimestamp(stackName string, conn *cloudformation.CloudFormation) ( - *time.Time, error) { - output, err := conn.DescribeStackEvents(&cloudformation.DescribeStackEventsInput{ - StackName: aws.String(stackName), - }) - if err != nil { - return nil, err - } - - return output.StackEvents[0].Timestamp, nil -} - -func getCloudFormationRollbackReasons(stackId string, afterTime *time.Time, conn *cloudformation.CloudFormation) ([]string, error) { - var failures []string - - err := conn.DescribeStackEventsPages(&cloudformation.DescribeStackEventsInput{ - StackName: aws.String(stackId), - }, func(page *cloudformation.DescribeStackEventsOutput, lastPage bool) bool { - for _, e := range page.StackEvents { - if afterTime != nil && !e.Timestamp.After(*afterTime) { - continue - } - - if cfStackEventIsFailure(e) || cfStackEventIsRollback(e) { - failures = append(failures, *e.ResourceStatusReason) - } - } - return !lastPage - }) - - return failures, err -} - -func getCloudFormationDeletionReasons(stackId string, conn *cloudformation.CloudFormation) ([]string, error) { - var failures []string - - err := conn.DescribeStackEventsPages(&cloudformation.DescribeStackEventsInput{ - StackName: aws.String(stackId), - }, func(page *cloudformation.DescribeStackEventsOutput, lastPage bool) bool { - for _, e := range page.StackEvents { - if cfStackEventIsFailure(e) || cfStackEventIsStackDeletion(e) { - failures = append(failures, *e.ResourceStatusReason) - } - } - return !lastPage - }) - - return failures, err -} - -func getCloudFormationFailures(stackId string, conn *cloudformation.CloudFormation) ([]string, error) { - var failures []string - - err := conn.DescribeStackEventsPages(&cloudformation.DescribeStackEventsInput{ - StackName: aws.String(stackId), - }, func(page *cloudformation.DescribeStackEventsOutput, lastPage bool) bool { - for _, e := range page.StackEvents { - if cfStackEventIsFailure(e) { - failures = append(failures, *e.ResourceStatusReason) - } - } - return !lastPage - }) - - return failures, err -} - -func cfStackEventIsFailure(event *cloudformation.StackEvent) bool { - failRe := regexp.MustCompile("_FAILED$") - return failRe.MatchString(*event.ResourceStatus) && event.ResourceStatusReason != nil -} - -func cfStackEventIsRollback(event *cloudformation.StackEvent) bool { - rollbackRe := regexp.MustCompile("^ROLLBACK_") - return rollbackRe.MatchString(*event.ResourceStatus) && event.ResourceStatusReason != nil -} - -func cfStackEventIsStackDeletion(event *cloudformation.StackEvent) bool { - return *event.ResourceStatus == "DELETE_IN_PROGRESS" && - *event.ResourceType == "AWS::CloudFormation::Stack" && - event.ResourceStatusReason != nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudfront_distribution.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudfront_distribution.go deleted file mode 100644 index 480c020..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudfront_distribution.go +++ /dev/null @@ -1,719 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudFrontDistribution() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudFrontDistributionCreate, - Read: resourceAwsCloudFrontDistributionRead, - Update: resourceAwsCloudFrontDistributionUpdate, - Delete: resourceAwsCloudFrontDistributionDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsCloudFrontDistributionImport, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "aliases": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: aliasesHash, - }, - "cache_behavior": { - Type: schema.TypeSet, - Optional: true, - Set: cacheBehaviorHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "allowed_methods": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "cached_methods": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "compress": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "default_ttl": { - Type: schema.TypeInt, - Required: true, - }, - "forwarded_values": { - Type: schema.TypeSet, - Required: true, - Set: forwardedValuesHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cookies": { - Type: schema.TypeSet, - Required: true, - Set: cookiePreferenceHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "forward": { - Type: schema.TypeString, - Required: true, - }, - "whitelisted_names": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - "headers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "query_string": { - Type: schema.TypeBool, - Required: true, - }, - "query_string_cache_keys": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - "lambda_function_association": { - Type: schema.TypeSet, - Optional: true, - MaxItems: 4, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "event_type": { - Type: schema.TypeString, - Required: true, - }, - "lambda_arn": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: lambdaFunctionAssociationHash, - }, - "max_ttl": { - Type: schema.TypeInt, - Required: true, - }, - "min_ttl": { - Type: schema.TypeInt, - Required: true, - }, - "path_pattern": { - Type: schema.TypeString, - Required: true, - }, - "smooth_streaming": { - Type: schema.TypeBool, - Optional: true, - }, - "target_origin_id": { - Type: schema.TypeString, - Required: true, - }, - "trusted_signers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "viewer_protocol_policy": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "comment": { - Type: schema.TypeString, - Optional: true, - }, - "custom_error_response": { - Type: schema.TypeSet, - Optional: true, - Set: customErrorResponseHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "error_caching_min_ttl": { - Type: schema.TypeInt, - Optional: true, - }, - "error_code": { - Type: schema.TypeInt, - Required: true, - }, - "response_code": { - Type: schema.TypeInt, - Optional: true, - }, - "response_page_path": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - "default_cache_behavior": { - Type: schema.TypeSet, - Required: true, - Set: defaultCacheBehaviorHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "allowed_methods": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "cached_methods": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "compress": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "default_ttl": { - Type: schema.TypeInt, - Required: true, - }, - "forwarded_values": { - Type: schema.TypeSet, - Required: true, - Set: forwardedValuesHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cookies": { - Type: schema.TypeSet, - Optional: true, - Set: cookiePreferenceHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "forward": { - Type: schema.TypeString, - Required: true, - }, - "whitelisted_names": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - "headers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "query_string": { - Type: schema.TypeBool, - Required: true, - }, - "query_string_cache_keys": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - "lambda_function_association": { - Type: schema.TypeSet, - Optional: true, - MaxItems: 4, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "event_type": { - Type: schema.TypeString, - Required: true, - }, - "lambda_arn": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: lambdaFunctionAssociationHash, - }, - "max_ttl": { - Type: schema.TypeInt, - Required: true, - }, - "min_ttl": { - Type: schema.TypeInt, - Required: true, - }, - "smooth_streaming": { - Type: schema.TypeBool, - Optional: true, - }, - "target_origin_id": { - Type: schema.TypeString, - Required: true, - }, - "trusted_signers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "viewer_protocol_policy": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "default_root_object": { - Type: schema.TypeString, - Optional: true, - }, - "enabled": { - Type: schema.TypeBool, - Required: true, - }, - "http_version": { - Type: schema.TypeString, - Optional: true, - Default: "http2", - ValidateFunc: validateHTTP, - }, - "logging_config": { - Type: schema.TypeSet, - Optional: true, - Set: loggingConfigHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Required: true, - }, - "include_cookies": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "prefix": { - Type: schema.TypeString, - Optional: true, - Default: "", - }, - }, - }, - }, - "origin": { - Type: schema.TypeSet, - Required: true, - Set: originHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "custom_origin_config": { - Type: schema.TypeSet, - Optional: true, - ConflictsWith: []string{"origin.s3_origin_config"}, - Set: customOriginConfigHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "http_port": { - Type: schema.TypeInt, - Required: true, - }, - "https_port": { - Type: schema.TypeInt, - Required: true, - }, - "origin_protocol_policy": { - Type: schema.TypeString, - Required: true, - }, - "origin_ssl_protocols": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - "domain_name": { - Type: schema.TypeString, - Required: true, - }, - "custom_header": { - Type: schema.TypeSet, - Optional: true, - Set: originCustomHeaderHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "value": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "origin_id": { - Type: schema.TypeString, - Required: true, - }, - "origin_path": { - Type: schema.TypeString, - Optional: true, - }, - "s3_origin_config": { - Type: schema.TypeSet, - Optional: true, - ConflictsWith: []string{"origin.custom_origin_config"}, - Set: s3OriginConfigHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "origin_access_identity": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - }, - }, - "price_class": { - Type: schema.TypeString, - Optional: true, - Default: "PriceClass_All", - }, - "restrictions": { - Type: schema.TypeSet, - Required: true, - Set: restrictionsHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "geo_restriction": { - Type: schema.TypeSet, - Required: true, - Set: geoRestrictionHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "locations": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "restriction_type": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - }, - }, - "viewer_certificate": { - Type: schema.TypeSet, - Required: true, - Set: viewerCertificateHash, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "acm_certificate_arn": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"viewer_certificate.cloudfront_default_certificate", "viewer_certificate.iam_certificate_id"}, - }, - "cloudfront_default_certificate": { - Type: schema.TypeBool, - Optional: true, - ConflictsWith: []string{"viewer_certificate.acm_certificate_arn", "viewer_certificate.iam_certificate_id"}, - }, - "iam_certificate_id": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"viewer_certificate.acm_certificate_arn", "viewer_certificate.cloudfront_default_certificate"}, - }, - "minimum_protocol_version": { - Type: schema.TypeString, - Optional: true, - Default: "SSLv3", - }, - "ssl_support_method": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - "web_acl_id": { - Type: schema.TypeString, - Optional: true, - }, - "caller_reference": { - Type: schema.TypeString, - Computed: true, - }, - "status": { - Type: schema.TypeString, - Computed: true, - }, - "active_trusted_signers": { - Type: schema.TypeMap, - Computed: true, - }, - "domain_name": { - Type: schema.TypeString, - Computed: true, - }, - "last_modified_time": { - Type: schema.TypeString, - Computed: true, - }, - "in_progress_validation_batches": { - Type: schema.TypeInt, - Computed: true, - }, - "etag": { - Type: schema.TypeString, - Computed: true, - }, - "hosted_zone_id": { - Type: schema.TypeString, - Computed: true, - }, - // retain_on_delete is a non-API attribute that may help facilitate speedy - // deletion of a resoruce. It's mainly here for testing purposes, so - // enable at your own risk. - "retain_on_delete": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "is_ipv6_enabled": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsCloudFrontDistributionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudfrontconn - - params := &cloudfront.CreateDistributionWithTagsInput{ - DistributionConfigWithTags: &cloudfront.DistributionConfigWithTags{ - DistributionConfig: expandDistributionConfig(d), - Tags: tagsFromMapCloudFront(d.Get("tags").(map[string]interface{})), - }, - } - - resp, err := conn.CreateDistributionWithTags(params) - if err != nil { - return err - } - d.SetId(*resp.Distribution.Id) - return resourceAwsCloudFrontDistributionRead(d, meta) -} - -func resourceAwsCloudFrontDistributionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudfrontconn - params := &cloudfront.GetDistributionInput{ - Id: aws.String(d.Id()), - } - - resp, err := conn.GetDistribution(params) - if err != nil { - if errcode, ok := err.(awserr.Error); ok && errcode.Code() == "NoSuchDistribution" { - log.Printf("[WARN] No Distribution found: %s", d.Id()) - d.SetId("") - return nil - } - - return err - } - - // Update attributes from DistributionConfig - err = flattenDistributionConfig(d, resp.Distribution.DistributionConfig) - if err != nil { - return err - } - // Update other attributes outside of DistributionConfig - d.SetId(*resp.Distribution.Id) - err = d.Set("active_trusted_signers", flattenActiveTrustedSigners(resp.Distribution.ActiveTrustedSigners)) - if err != nil { - return err - } - d.Set("status", resp.Distribution.Status) - d.Set("domain_name", resp.Distribution.DomainName) - d.Set("last_modified_time", aws.String(resp.Distribution.LastModifiedTime.String())) - d.Set("in_progress_validation_batches", resp.Distribution.InProgressInvalidationBatches) - d.Set("etag", resp.ETag) - d.Set("arn", resp.Distribution.ARN) - - tagResp, err := conn.ListTagsForResource(&cloudfront.ListTagsForResourceInput{ - Resource: aws.String(d.Get("arn").(string)), - }) - - if err != nil { - return errwrap.Wrapf(fmt.Sprintf( - "Error retrieving EC2 tags for CloudFront Distribution %q (ARN: %q): {{err}}", - d.Id(), d.Get("arn").(string)), err) - } - - if err := d.Set("tags", tagsToMapCloudFront(tagResp.Tags)); err != nil { - return err - } - - return nil -} - -func resourceAwsCloudFrontDistributionUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudfrontconn - params := &cloudfront.UpdateDistributionInput{ - Id: aws.String(d.Id()), - DistributionConfig: expandDistributionConfig(d), - IfMatch: aws.String(d.Get("etag").(string)), - } - _, err := conn.UpdateDistribution(params) - if err != nil { - return err - } - - if err := setTagsCloudFront(conn, d, d.Get("arn").(string)); err != nil { - return err - } - - return resourceAwsCloudFrontDistributionRead(d, meta) -} - -func resourceAwsCloudFrontDistributionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudfrontconn - - // manually disable the distribution first - d.Set("enabled", false) - err := resourceAwsCloudFrontDistributionUpdate(d, meta) - if err != nil { - return err - } - - // skip delete if retain_on_delete is enabled - if d.Get("retain_on_delete").(bool) { - log.Printf("[WARN] Removing CloudFront Distribution ID %q with `retain_on_delete` set. Please delete this distribution manually.", d.Id()) - d.SetId("") - return nil - } - - // Distribution needs to be in deployed state again before it can be deleted. - err = resourceAwsCloudFrontDistributionWaitUntilDeployed(d.Id(), meta) - if err != nil { - return err - } - - // now delete - params := &cloudfront.DeleteDistributionInput{ - Id: aws.String(d.Id()), - IfMatch: aws.String(d.Get("etag").(string)), - } - - _, err = conn.DeleteDistribution(params) - if err != nil { - return err - } - - // Done - d.SetId("") - return nil -} - -// resourceAwsCloudFrontWebDistributionWaitUntilDeployed blocks until the -// distribution is deployed. It currently takes exactly 15 minutes to deploy -// but that might change in the future. -func resourceAwsCloudFrontDistributionWaitUntilDeployed(id string, meta interface{}) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"InProgress", "Deployed"}, - Target: []string{"Deployed"}, - Refresh: resourceAwsCloudFrontWebDistributionStateRefreshFunc(id, meta), - Timeout: 40 * time.Minute, - MinTimeout: 15 * time.Second, - Delay: 10 * time.Minute, - } - - _, err := stateConf.WaitForState() - return err -} - -// The refresh function for resourceAwsCloudFrontWebDistributionWaitUntilDeployed. -func resourceAwsCloudFrontWebDistributionStateRefreshFunc(id string, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - conn := meta.(*AWSClient).cloudfrontconn - params := &cloudfront.GetDistributionInput{ - Id: aws.String(id), - } - - resp, err := conn.GetDistribution(params) - if err != nil { - log.Printf("[WARN] Error retrieving CloudFront Distribution %q details: %s", id, err) - return nil, "", err - } - - if resp == nil { - return nil, "", nil - } - - return resp.Distribution, *resp.Distribution.Status, nil - } -} - -// validateHTTP ensures that the http_version resource parameter is -// correct. -func validateHTTP(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if value != "http1.1" && value != "http2" { - errors = append(errors, fmt.Errorf( - "%q contains an invalid HTTP version parameter %q. Valid parameters are either %q or %q.", - k, value, "http1.1", "http2")) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudfront_origin_access_identity.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudfront_origin_access_identity.go deleted file mode 100644 index 2c40537..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudfront_origin_access_identity.go +++ /dev/null @@ -1,139 +0,0 @@ -package aws - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudFrontOriginAccessIdentity() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudFrontOriginAccessIdentityCreate, - Read: resourceAwsCloudFrontOriginAccessIdentityRead, - Update: resourceAwsCloudFrontOriginAccessIdentityUpdate, - Delete: resourceAwsCloudFrontOriginAccessIdentityDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "comment": { - Type: schema.TypeString, - Optional: true, - Default: "", - }, - "caller_reference": { - Type: schema.TypeString, - Computed: true, - }, - "cloudfront_access_identity_path": { - Type: schema.TypeString, - Computed: true, - }, - "etag": { - Type: schema.TypeString, - Computed: true, - }, - "iam_arn": { - Type: schema.TypeString, - Computed: true, - }, - "s3_canonical_user_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsCloudFrontOriginAccessIdentityCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudfrontconn - params := &cloudfront.CreateCloudFrontOriginAccessIdentityInput{ - CloudFrontOriginAccessIdentityConfig: expandOriginAccessIdentityConfig(d), - } - - resp, err := conn.CreateCloudFrontOriginAccessIdentity(params) - if err != nil { - return err - } - d.SetId(*resp.CloudFrontOriginAccessIdentity.Id) - return resourceAwsCloudFrontOriginAccessIdentityRead(d, meta) -} - -func resourceAwsCloudFrontOriginAccessIdentityRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudfrontconn - params := &cloudfront.GetCloudFrontOriginAccessIdentityInput{ - Id: aws.String(d.Id()), - } - - resp, err := conn.GetCloudFrontOriginAccessIdentity(params) - if err != nil { - return err - } - - // Update attributes from DistributionConfig - flattenOriginAccessIdentityConfig(d, resp.CloudFrontOriginAccessIdentity.CloudFrontOriginAccessIdentityConfig) - // Update other attributes outside of DistributionConfig - d.SetId(*resp.CloudFrontOriginAccessIdentity.Id) - d.Set("etag", resp.ETag) - d.Set("s3_canonical_user_id", resp.CloudFrontOriginAccessIdentity.S3CanonicalUserId) - d.Set("cloudfront_access_identity_path", fmt.Sprintf("origin-access-identity/cloudfront/%s", *resp.CloudFrontOriginAccessIdentity.Id)) - d.Set("iam_arn", fmt.Sprintf("arn:%s:iam::cloudfront:user/CloudFront Origin Access Identity %s", - meta.(*AWSClient).partition, *resp.CloudFrontOriginAccessIdentity.Id)) - return nil -} - -func resourceAwsCloudFrontOriginAccessIdentityUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudfrontconn - params := &cloudfront.UpdateCloudFrontOriginAccessIdentityInput{ - Id: aws.String(d.Id()), - CloudFrontOriginAccessIdentityConfig: expandOriginAccessIdentityConfig(d), - IfMatch: aws.String(d.Get("etag").(string)), - } - _, err := conn.UpdateCloudFrontOriginAccessIdentity(params) - if err != nil { - return err - } - - return resourceAwsCloudFrontOriginAccessIdentityRead(d, meta) -} - -func resourceAwsCloudFrontOriginAccessIdentityDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudfrontconn - params := &cloudfront.DeleteCloudFrontOriginAccessIdentityInput{ - Id: aws.String(d.Id()), - IfMatch: aws.String(d.Get("etag").(string)), - } - - _, err := conn.DeleteCloudFrontOriginAccessIdentity(params) - if err != nil { - return err - } - - // Done - d.SetId("") - return nil -} - -func expandOriginAccessIdentityConfig(d *schema.ResourceData) *cloudfront.OriginAccessIdentityConfig { - originAccessIdentityConfig := &cloudfront.OriginAccessIdentityConfig{ - Comment: aws.String(d.Get("comment").(string)), - } - // This sets CallerReference if it's still pending computation (ie: new resource) - if v, ok := d.GetOk("caller_reference"); ok == false { - originAccessIdentityConfig.CallerReference = aws.String(time.Now().Format(time.RFC3339Nano)) - } else { - originAccessIdentityConfig.CallerReference = aws.String(v.(string)) - } - return originAccessIdentityConfig -} - -func flattenOriginAccessIdentityConfig(d *schema.ResourceData, originAccessIdentityConfig *cloudfront.OriginAccessIdentityConfig) { - if originAccessIdentityConfig.Comment != nil { - d.Set("comment", originAccessIdentityConfig.Comment) - } - d.Set("caller_reference", originAccessIdentityConfig.CallerReference) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudtrail.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudtrail.go deleted file mode 100644 index 8c59a5d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudtrail.go +++ /dev/null @@ -1,329 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudtrail" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudTrail() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudTrailCreate, - Read: resourceAwsCloudTrailRead, - Update: resourceAwsCloudTrailUpdate, - Delete: resourceAwsCloudTrailDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "enable_logging": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "s3_bucket_name": { - Type: schema.TypeString, - Required: true, - }, - "s3_key_prefix": { - Type: schema.TypeString, - Optional: true, - }, - "cloud_watch_logs_role_arn": { - Type: schema.TypeString, - Optional: true, - }, - "cloud_watch_logs_group_arn": { - Type: schema.TypeString, - Optional: true, - }, - "include_global_service_events": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "is_multi_region_trail": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "sns_topic_name": { - Type: schema.TypeString, - Optional: true, - }, - "enable_log_file_validation": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "kms_key_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateArn, - }, - "home_region": { - Type: schema.TypeString, - Computed: true, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "tags": tagsSchema(), - }, - } -} - -func resourceAwsCloudTrailCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudtrailconn - - input := cloudtrail.CreateTrailInput{ - Name: aws.String(d.Get("name").(string)), - S3BucketName: aws.String(d.Get("s3_bucket_name").(string)), - } - - if v, ok := d.GetOk("cloud_watch_logs_group_arn"); ok { - input.CloudWatchLogsLogGroupArn = aws.String(v.(string)) - } - if v, ok := d.GetOk("cloud_watch_logs_role_arn"); ok { - input.CloudWatchLogsRoleArn = aws.String(v.(string)) - } - if v, ok := d.GetOk("include_global_service_events"); ok { - input.IncludeGlobalServiceEvents = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("is_multi_region_trail"); ok { - input.IsMultiRegionTrail = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("enable_log_file_validation"); ok { - input.EnableLogFileValidation = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("kms_key_id"); ok { - input.KmsKeyId = aws.String(v.(string)) - } - if v, ok := d.GetOk("s3_key_prefix"); ok { - input.S3KeyPrefix = aws.String(v.(string)) - } - if v, ok := d.GetOk("sns_topic_name"); ok { - input.SnsTopicName = aws.String(v.(string)) - } - - t, err := conn.CreateTrail(&input) - if err != nil { - return err - } - - log.Printf("[DEBUG] CloudTrail created: %s", t) - - d.Set("arn", t.TrailARN) - d.SetId(*t.Name) - - // AWS CloudTrail sets newly-created trails to false. - if v, ok := d.GetOk("enable_logging"); ok && v.(bool) { - err := cloudTrailSetLogging(conn, v.(bool), d.Id()) - if err != nil { - return err - } - } - - return resourceAwsCloudTrailUpdate(d, meta) -} - -func resourceAwsCloudTrailRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudtrailconn - - input := cloudtrail.DescribeTrailsInput{ - TrailNameList: []*string{ - aws.String(d.Id()), - }, - } - resp, err := conn.DescribeTrails(&input) - if err != nil { - return err - } - - // CloudTrail does not return a NotFound error in the event that the Trail - // you're looking for is not found. Instead, it's simply not in the list. - var trail *cloudtrail.Trail - for _, c := range resp.TrailList { - if d.Id() == *c.Name { - trail = c - } - } - - if trail == nil { - log.Printf("[WARN] CloudTrail (%s) not found", d.Id()) - d.SetId("") - return nil - } - - log.Printf("[DEBUG] CloudTrail received: %s", trail) - - d.Set("name", trail.Name) - d.Set("s3_bucket_name", trail.S3BucketName) - d.Set("s3_key_prefix", trail.S3KeyPrefix) - d.Set("cloud_watch_logs_role_arn", trail.CloudWatchLogsRoleArn) - d.Set("cloud_watch_logs_group_arn", trail.CloudWatchLogsLogGroupArn) - d.Set("include_global_service_events", trail.IncludeGlobalServiceEvents) - d.Set("is_multi_region_trail", trail.IsMultiRegionTrail) - d.Set("sns_topic_name", trail.SnsTopicName) - d.Set("enable_log_file_validation", trail.LogFileValidationEnabled) - - // TODO: Make it possible to use KMS Key names, not just ARNs - // In order to test it properly this PR needs to be merged 1st: - // https://github.com/hashicorp/terraform/pull/3928 - d.Set("kms_key_id", trail.KmsKeyId) - - d.Set("arn", trail.TrailARN) - d.Set("home_region", trail.HomeRegion) - - // Get tags - req := &cloudtrail.ListTagsInput{ - ResourceIdList: []*string{trail.TrailARN}, - } - - tagsOut, err := conn.ListTags(req) - if err != nil { - return err - } - log.Printf("[DEBUG] Received CloudTrail tags: %s", tagsOut) - - var tags []*cloudtrail.Tag - if tagsOut.ResourceTagList != nil && len(tagsOut.ResourceTagList) > 0 { - tags = tagsOut.ResourceTagList[0].TagsList - } - - if err := d.Set("tags", tagsToMapCloudtrail(tags)); err != nil { - return err - } - - logstatus, err := cloudTrailGetLoggingStatus(conn, trail.Name) - if err != nil { - return err - } - d.Set("enable_logging", logstatus) - - return nil -} - -func resourceAwsCloudTrailUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudtrailconn - - input := cloudtrail.UpdateTrailInput{ - Name: aws.String(d.Id()), - } - - if d.HasChange("s3_bucket_name") { - input.S3BucketName = aws.String(d.Get("s3_bucket_name").(string)) - } - if d.HasChange("s3_key_prefix") { - input.S3KeyPrefix = aws.String(d.Get("s3_key_prefix").(string)) - } - if d.HasChange("cloud_watch_logs_role_arn") { - input.CloudWatchLogsRoleArn = aws.String(d.Get("cloud_watch_logs_role_arn").(string)) - } - if d.HasChange("cloud_watch_logs_group_arn") { - input.CloudWatchLogsLogGroupArn = aws.String(d.Get("cloud_watch_logs_group_arn").(string)) - } - if d.HasChange("include_global_service_events") { - input.IncludeGlobalServiceEvents = aws.Bool(d.Get("include_global_service_events").(bool)) - } - if d.HasChange("is_multi_region_trail") { - input.IsMultiRegionTrail = aws.Bool(d.Get("is_multi_region_trail").(bool)) - } - if d.HasChange("enable_log_file_validation") { - input.EnableLogFileValidation = aws.Bool(d.Get("enable_log_file_validation").(bool)) - } - if d.HasChange("kms_key_id") { - input.KmsKeyId = aws.String(d.Get("kms_key_id").(string)) - } - if d.HasChange("sns_topic_name") { - input.SnsTopicName = aws.String(d.Get("sns_topic_name").(string)) - } - - log.Printf("[DEBUG] Updating CloudTrail: %s", input) - t, err := conn.UpdateTrail(&input) - if err != nil { - return err - } - - if d.HasChange("tags") { - err := setTagsCloudtrail(conn, d) - if err != nil { - return err - } - } - - if d.HasChange("enable_logging") { - log.Printf("[DEBUG] Updating logging on CloudTrail: %s", input) - err := cloudTrailSetLogging(conn, d.Get("enable_logging").(bool), *input.Name) - if err != nil { - return err - } - } - - log.Printf("[DEBUG] CloudTrail updated: %s", t) - - return resourceAwsCloudTrailRead(d, meta) -} - -func resourceAwsCloudTrailDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudtrailconn - - log.Printf("[DEBUG] Deleting CloudTrail: %q", d.Id()) - _, err := conn.DeleteTrail(&cloudtrail.DeleteTrailInput{ - Name: aws.String(d.Id()), - }) - - return err -} - -func cloudTrailGetLoggingStatus(conn *cloudtrail.CloudTrail, id *string) (bool, error) { - GetTrailStatusOpts := &cloudtrail.GetTrailStatusInput{ - Name: id, - } - resp, err := conn.GetTrailStatus(GetTrailStatusOpts) - if err != nil { - return false, fmt.Errorf("Error retrieving logging status of CloudTrail (%s): %s", *id, err) - } - - return *resp.IsLogging, err -} - -func cloudTrailSetLogging(conn *cloudtrail.CloudTrail, enabled bool, id string) error { - if enabled { - log.Printf( - "[DEBUG] Starting logging on CloudTrail (%s)", - id) - StartLoggingOpts := &cloudtrail.StartLoggingInput{ - Name: aws.String(id), - } - if _, err := conn.StartLogging(StartLoggingOpts); err != nil { - return fmt.Errorf( - "Error starting logging on CloudTrail (%s): %s", - id, err) - } - } else { - log.Printf( - "[DEBUG] Stopping logging on CloudTrail (%s)", - id) - StopLoggingOpts := &cloudtrail.StopLoggingInput{ - Name: aws.String(id), - } - if _, err := conn.StopLogging(StopLoggingOpts); err != nil { - return fmt.Errorf( - "Error stopping logging on CloudTrail (%s): %s", - id, err) - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_event_rule.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_event_rule.go deleted file mode 100644 index e079a56..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_event_rule.go +++ /dev/null @@ -1,287 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - events "github.com/aws/aws-sdk-go/service/cloudwatchevents" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudWatchEventRule() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudWatchEventRuleCreate, - Read: resourceAwsCloudWatchEventRuleRead, - Update: resourceAwsCloudWatchEventRuleUpdate, - Delete: resourceAwsCloudWatchEventRuleDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateCloudWatchEventRuleName, - }, - "schedule_expression": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateMaxLength(256), - }, - "event_pattern": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateEventPatternValue(2048), - StateFunc: func(v interface{}) string { - json, _ := normalizeJsonString(v) - return json - }, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateMaxLength(512), - }, - "role_arn": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateMaxLength(1600), - }, - "is_enabled": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsCloudWatchEventRuleCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatcheventsconn - - input, err := buildPutRuleInputStruct(d) - if err != nil { - return errwrap.Wrapf("Creating CloudWatch Event Rule failed: {{err}}", err) - } - log.Printf("[DEBUG] Creating CloudWatch Event Rule: %s", input) - - // IAM Roles take some time to propagate - var out *events.PutRuleOutput - err = resource.Retry(30*time.Second, func() *resource.RetryError { - var err error - out, err = conn.PutRule(input) - pattern := regexp.MustCompile("cannot be assumed by principal '[a-z]+\\.amazonaws\\.com'\\.$") - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ValidationException" && pattern.MatchString(awsErr.Message()) { - log.Printf("[DEBUG] Retrying creation of CloudWatch Event Rule %q", *input.Name) - return resource.RetryableError(err) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return errwrap.Wrapf("Creating CloudWatch Event Rule failed: {{err}}", err) - } - - d.Set("arn", out.RuleArn) - d.SetId(d.Get("name").(string)) - - log.Printf("[INFO] CloudWatch Event Rule %q created", *out.RuleArn) - - return resourceAwsCloudWatchEventRuleUpdate(d, meta) -} - -func resourceAwsCloudWatchEventRuleRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatcheventsconn - - input := events.DescribeRuleInput{ - Name: aws.String(d.Id()), - } - log.Printf("[DEBUG] Reading CloudWatch Event Rule: %s", input) - out, err := conn.DescribeRule(&input) - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - log.Printf("[WARN] Removing CloudWatch Event Rule %q because it's gone.", d.Id()) - d.SetId("") - return nil - } - } - if err != nil { - return err - } - log.Printf("[DEBUG] Found Event Rule: %s", out) - - d.Set("arn", out.Arn) - d.Set("description", out.Description) - if out.EventPattern != nil { - pattern, err := normalizeJsonString(*out.EventPattern) - if err != nil { - return errwrap.Wrapf("event pattern contains an invalid JSON: {{err}}", err) - } - d.Set("event_pattern", pattern) - } - d.Set("name", out.Name) - d.Set("role_arn", out.RoleArn) - d.Set("schedule_expression", out.ScheduleExpression) - - boolState, err := getBooleanStateFromString(*out.State) - if err != nil { - return err - } - log.Printf("[DEBUG] Setting boolean state: %t", boolState) - d.Set("is_enabled", boolState) - - return nil -} - -func resourceAwsCloudWatchEventRuleUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatcheventsconn - - if d.HasChange("is_enabled") && d.Get("is_enabled").(bool) { - log.Printf("[DEBUG] Enabling CloudWatch Event Rule %q", d.Id()) - _, err := conn.EnableRule(&events.EnableRuleInput{ - Name: aws.String(d.Id()), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] CloudWatch Event Rule (%q) enabled", d.Id()) - } - - input, err := buildPutRuleInputStruct(d) - if err != nil { - return errwrap.Wrapf("Updating CloudWatch Event Rule failed: {{err}}", err) - } - log.Printf("[DEBUG] Updating CloudWatch Event Rule: %s", input) - - // IAM Roles take some time to propagate - err = resource.Retry(30*time.Second, func() *resource.RetryError { - _, err := conn.PutRule(input) - pattern := regexp.MustCompile("cannot be assumed by principal '[a-z]+\\.amazonaws\\.com'\\.$") - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ValidationException" && pattern.MatchString(awsErr.Message()) { - log.Printf("[DEBUG] Retrying update of CloudWatch Event Rule %q", *input.Name) - return resource.RetryableError(err) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return errwrap.Wrapf("Updating CloudWatch Event Rule failed: {{err}}", err) - } - - if d.HasChange("is_enabled") && !d.Get("is_enabled").(bool) { - log.Printf("[DEBUG] Disabling CloudWatch Event Rule %q", d.Id()) - _, err := conn.DisableRule(&events.DisableRuleInput{ - Name: aws.String(d.Id()), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] CloudWatch Event Rule (%q) disabled", d.Id()) - } - - return resourceAwsCloudWatchEventRuleRead(d, meta) -} - -func resourceAwsCloudWatchEventRuleDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatcheventsconn - - log.Printf("[INFO] Deleting CloudWatch Event Rule: %s", d.Id()) - _, err := conn.DeleteRule(&events.DeleteRuleInput{ - Name: aws.String(d.Id()), - }) - if err != nil { - return fmt.Errorf("Error deleting CloudWatch Event Rule: %s", err) - } - log.Println("[INFO] CloudWatch Event Rule deleted") - - d.SetId("") - - return nil -} - -func buildPutRuleInputStruct(d *schema.ResourceData) (*events.PutRuleInput, error) { - input := events.PutRuleInput{ - Name: aws.String(d.Get("name").(string)), - } - if v, ok := d.GetOk("description"); ok { - input.Description = aws.String(v.(string)) - } - if v, ok := d.GetOk("event_pattern"); ok { - pattern, err := normalizeJsonString(v) - if err != nil { - return nil, errwrap.Wrapf("event pattern contains an invalid JSON: {{err}}", err) - } - input.EventPattern = aws.String(pattern) - } - if v, ok := d.GetOk("role_arn"); ok { - input.RoleArn = aws.String(v.(string)) - } - if v, ok := d.GetOk("schedule_expression"); ok { - input.ScheduleExpression = aws.String(v.(string)) - } - - input.State = aws.String(getStringStateFromBoolean(d.Get("is_enabled").(bool))) - - return &input, nil -} - -// State is represented as (ENABLED|DISABLED) in the API -func getBooleanStateFromString(state string) (bool, error) { - if state == "ENABLED" { - return true, nil - } else if state == "DISABLED" { - return false, nil - } - // We don't just blindly trust AWS as they tend to return - // unexpected values in similar cases (different casing etc.) - return false, fmt.Errorf("Failed converting state %q into boolean", state) -} - -// State is represented as (ENABLED|DISABLED) in the API -func getStringStateFromBoolean(isEnabled bool) string { - if isEnabled { - return "ENABLED" - } - return "DISABLED" -} - -func validateEventPatternValue(length int) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - json, err := normalizeJsonString(v) - if err != nil { - errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) - - // Invalid JSON? Return immediately, - // there is no need to collect other - // errors. - return - } - - // Check whether the normalized JSON is within the given length. - if len(json) > length { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than %d characters: %q", k, length, json)) - } - return - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_event_target.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_event_target.go deleted file mode 100644 index 767b94b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_event_target.go +++ /dev/null @@ -1,212 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - events "github.com/aws/aws-sdk-go/service/cloudwatchevents" -) - -func resourceAwsCloudWatchEventTarget() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudWatchEventTargetCreate, - Read: resourceAwsCloudWatchEventTargetRead, - Update: resourceAwsCloudWatchEventTargetUpdate, - Delete: resourceAwsCloudWatchEventTargetDelete, - - Schema: map[string]*schema.Schema{ - "rule": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateCloudWatchEventRuleName, - }, - - "target_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateCloudWatchEventTargetId, - }, - - "arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "input": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"input_path"}, - // We could be normalizing the JSON here, - // but for built-in targets input may not be JSON - }, - - "input_path": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"input"}, - }, - }, - } -} - -func resourceAwsCloudWatchEventTargetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatcheventsconn - - rule := d.Get("rule").(string) - - var targetId string - if v, ok := d.GetOk("target_id"); ok { - targetId = v.(string) - } else { - targetId = resource.UniqueId() - d.Set("target_id", targetId) - } - - input := buildPutTargetInputStruct(d) - log.Printf("[DEBUG] Creating CloudWatch Event Target: %s", input) - out, err := conn.PutTargets(input) - if err != nil { - return fmt.Errorf("Creating CloudWatch Event Target failed: %s", err) - } - - if len(out.FailedEntries) > 0 { - return fmt.Errorf("Creating CloudWatch Event Target failed: %s", - out.FailedEntries) - } - - id := rule + "-" + targetId - d.SetId(id) - - log.Printf("[INFO] CloudWatch Event Target %q created", d.Id()) - - return resourceAwsCloudWatchEventTargetRead(d, meta) -} - -func resourceAwsCloudWatchEventTargetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatcheventsconn - - t, err := findEventTargetById( - d.Get("target_id").(string), - d.Get("rule").(string), - nil, conn) - if err != nil { - if regexp.MustCompile(" not found$").MatchString(err.Error()) { - log.Printf("[WARN] Removing CloudWatch Event Target %q because it's gone.", d.Id()) - d.SetId("") - return nil - } - if awsErr, ok := err.(awserr.Error); ok { - // This should never happen, but it's useful - // for recovering from https://github.com/hashicorp/terraform/issues/5389 - if awsErr.Code() == "ValidationException" { - log.Printf("[WARN] Removing CloudWatch Event Target %q because it never existed.", d.Id()) - d.SetId("") - return nil - } - - if awsErr.Code() == "ResourceNotFoundException" { - log.Printf("[WARN] CloudWatch Event Target (%q) not found. Removing it from state.", d.Id()) - d.SetId("") - return nil - } - - } - return err - } - log.Printf("[DEBUG] Found Event Target: %s", t) - - d.Set("arn", t.Arn) - d.Set("target_id", t.Id) - d.Set("input", t.Input) - d.Set("input_path", t.InputPath) - - return nil -} - -func findEventTargetById(id, rule string, nextToken *string, conn *events.CloudWatchEvents) ( - *events.Target, error) { - input := events.ListTargetsByRuleInput{ - Rule: aws.String(rule), - NextToken: nextToken, - Limit: aws.Int64(100), // Set limit to allowed maximum to prevent API throttling - } - log.Printf("[DEBUG] Reading CloudWatch Event Target: %s", input) - out, err := conn.ListTargetsByRule(&input) - if err != nil { - return nil, err - } - - for _, t := range out.Targets { - if *t.Id == id { - return t, nil - } - } - - if out.NextToken != nil { - return findEventTargetById(id, rule, nextToken, conn) - } - - return nil, fmt.Errorf("CloudWatch Event Target %q (%q) not found", id, rule) -} - -func resourceAwsCloudWatchEventTargetUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatcheventsconn - - input := buildPutTargetInputStruct(d) - log.Printf("[DEBUG] Updating CloudWatch Event Target: %s", input) - _, err := conn.PutTargets(input) - if err != nil { - return fmt.Errorf("Updating CloudWatch Event Target failed: %s", err) - } - - return resourceAwsCloudWatchEventTargetRead(d, meta) -} - -func resourceAwsCloudWatchEventTargetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatcheventsconn - - input := events.RemoveTargetsInput{ - Ids: []*string{aws.String(d.Get("target_id").(string))}, - Rule: aws.String(d.Get("rule").(string)), - } - log.Printf("[INFO] Deleting CloudWatch Event Target: %s", input) - _, err := conn.RemoveTargets(&input) - if err != nil { - return fmt.Errorf("Error deleting CloudWatch Event Target: %s", err) - } - log.Println("[INFO] CloudWatch Event Target deleted") - - d.SetId("") - - return nil -} - -func buildPutTargetInputStruct(d *schema.ResourceData) *events.PutTargetsInput { - e := &events.Target{ - Arn: aws.String(d.Get("arn").(string)), - Id: aws.String(d.Get("target_id").(string)), - } - - if v, ok := d.GetOk("input"); ok { - e.Input = aws.String(v.(string)) - } - if v, ok := d.GetOk("input_path"); ok { - e.InputPath = aws.String(v.(string)) - } - - input := events.PutTargetsInput{ - Rule: aws.String(d.Get("rule").(string)), - Targets: []*events.Target{e}, - } - - return &input -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_destination.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_destination.go deleted file mode 100644 index 1726306..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_destination.go +++ /dev/null @@ -1,150 +0,0 @@ -package aws - -import ( - "fmt" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudWatchLogDestination() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudWatchLogDestinationPut, - Update: resourceAwsCloudWatchLogDestinationPut, - Read: resourceAwsCloudWatchLogDestinationRead, - Delete: resourceAwsCloudWatchLogDestinationDelete, - - Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - d.Set("name", d.Id()) - return []*schema.ResourceData{d}, nil - }, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "role_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "target_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsCloudWatchLogDestinationPut(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - name := d.Get("name").(string) - role_arn := d.Get("role_arn").(string) - target_arn := d.Get("target_arn").(string) - - params := &cloudwatchlogs.PutDestinationInput{ - DestinationName: aws.String(name), - RoleArn: aws.String(role_arn), - TargetArn: aws.String(target_arn), - } - - return resource.Retry(3*time.Minute, func() *resource.RetryError { - resp, err := conn.PutDestination(params) - - if err == nil { - d.SetId(name) - d.Set("arn", *resp.Destination.Arn) - } - - awsErr, ok := err.(awserr.Error) - if !ok { - return resource.RetryableError(err) - } - - if awsErr.Code() == "InvalidParameterException" { - if strings.Contains(awsErr.Message(), "Could not deliver test message to specified") { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} - -func resourceAwsCloudWatchLogDestinationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - name := d.Get("name").(string) - destination, exists, err := lookupCloudWatchLogDestination(conn, name, nil) - if err != nil { - return err - } - - if !exists { - d.SetId("") - return nil - } - - d.SetId(name) - d.Set("arn", destination.Arn) - d.Set("role_arn", destination.RoleArn) - d.Set("target_arn", destination.TargetArn) - - return nil -} - -func resourceAwsCloudWatchLogDestinationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - name := d.Get("name").(string) - - params := &cloudwatchlogs.DeleteDestinationInput{ - DestinationName: aws.String(name), - } - _, err := conn.DeleteDestination(params) - if err != nil { - return fmt.Errorf("Error deleting Destination with name %s", name) - } - d.SetId("") - return nil -} - -func lookupCloudWatchLogDestination(conn *cloudwatchlogs.CloudWatchLogs, - name string, nextToken *string) (*cloudwatchlogs.Destination, bool, error) { - input := &cloudwatchlogs.DescribeDestinationsInput{ - DestinationNamePrefix: aws.String(name), - NextToken: nextToken, - } - resp, err := conn.DescribeDestinations(input) - if err != nil { - return nil, true, err - } - - for _, destination := range resp.Destinations { - if *destination.DestinationName == name { - return destination, true, nil - } - } - - if resp.NextToken != nil { - return lookupCloudWatchLogDestination(conn, name, resp.NextToken) - } - - return nil, false, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_destination_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_destination_policy.go deleted file mode 100644 index 704dacf..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_destination_policy.go +++ /dev/null @@ -1,88 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" -) - -func resourceAwsCloudWatchLogDestinationPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudWatchLogDestinationPolicyPut, - Update: resourceAwsCloudWatchLogDestinationPolicyPut, - Read: resourceAwsCloudWatchLogDestinationPolicyRead, - Delete: resourceAwsCloudWatchLogDestinationPolicyDelete, - - Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - d.Set("destination_name", d.Id()) - return []*schema.ResourceData{d}, nil - }, - }, - - Schema: map[string]*schema.Schema{ - "destination_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "access_policy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsCloudWatchLogDestinationPolicyPut(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - destination_name := d.Get("destination_name").(string) - access_policy := d.Get("access_policy").(string) - - params := &cloudwatchlogs.PutDestinationPolicyInput{ - DestinationName: aws.String(destination_name), - AccessPolicy: aws.String(access_policy), - } - - _, err := conn.PutDestinationPolicy(params) - - if err != nil { - return fmt.Errorf("Error creating DestinationPolicy with destination_name %s: %#v", destination_name, err) - } - - d.SetId(destination_name) - return resourceAwsCloudWatchLogDestinationPolicyRead(d, meta) -} - -func resourceAwsCloudWatchLogDestinationPolicyRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - destination_name := d.Get("destination_name").(string) - destination, exists, err := lookupCloudWatchLogDestination(conn, destination_name, nil) - if err != nil { - return err - } - - if !exists { - d.SetId("") - return nil - } - - if destination.AccessPolicy != nil { - d.SetId(destination_name) - d.Set("access_policy", *destination.AccessPolicy) - } else { - d.SetId("") - } - - return nil -} - -func resourceAwsCloudWatchLogDestinationPolicyDelete(d *schema.ResourceData, meta interface{}) error { - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_group.go deleted file mode 100644 index 7bbd306..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_group.go +++ /dev/null @@ -1,238 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - "github.com/hashicorp/errwrap" -) - -func resourceAwsCloudWatchLogGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudWatchLogGroupCreate, - Read: resourceAwsCloudWatchLogGroupRead, - Update: resourceAwsCloudWatchLogGroupUpdate, - Delete: resourceAwsCloudWatchLogGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateLogGroupName, - }, - - "retention_in_days": { - Type: schema.TypeInt, - Optional: true, - Default: 0, - }, - - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsCloudWatchLogGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - log.Printf("[DEBUG] Creating CloudWatch Log Group: %s", d.Get("name").(string)) - - _, err := conn.CreateLogGroup(&cloudwatchlogs.CreateLogGroupInput{ - LogGroupName: aws.String(d.Get("name").(string)), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceAlreadyExistsException" { - return fmt.Errorf("Creating CloudWatch Log Group failed: %s: The CloudWatch Log Group '%s' already exists.", err, d.Get("name").(string)) - } - return fmt.Errorf("Creating CloudWatch Log Group failed: %s '%s'", err, d.Get("name")) - } - - d.SetId(d.Get("name").(string)) - - log.Println("[INFO] CloudWatch Log Group created") - - return resourceAwsCloudWatchLogGroupUpdate(d, meta) -} - -func resourceAwsCloudWatchLogGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - log.Printf("[DEBUG] Reading CloudWatch Log Group: %q", d.Get("name").(string)) - lg, exists, err := lookupCloudWatchLogGroup(conn, d.Id(), nil) - if err != nil { - return err - } - - if !exists { - log.Printf("[DEBUG] CloudWatch Group %q Not Found", d.Id()) - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Found Log Group: %#v", *lg) - - d.Set("arn", lg.Arn) - d.Set("name", lg.LogGroupName) - - if lg.RetentionInDays != nil { - d.Set("retention_in_days", lg.RetentionInDays) - } - - tags, err := flattenCloudWatchTags(d, conn) - if err != nil { - return err - } - d.Set("tags", tags) - - return nil -} - -func lookupCloudWatchLogGroup(conn *cloudwatchlogs.CloudWatchLogs, - name string, nextToken *string) (*cloudwatchlogs.LogGroup, bool, error) { - input := &cloudwatchlogs.DescribeLogGroupsInput{ - LogGroupNamePrefix: aws.String(name), - NextToken: nextToken, - } - resp, err := conn.DescribeLogGroups(input) - if err != nil { - return nil, true, err - } - - for _, lg := range resp.LogGroups { - if *lg.LogGroupName == name { - return lg, true, nil - } - } - - if resp.NextToken != nil { - return lookupCloudWatchLogGroup(conn, name, resp.NextToken) - } - - return nil, false, nil -} - -func resourceAwsCloudWatchLogGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - name := d.Get("name").(string) - log.Printf("[DEBUG] Updating CloudWatch Log Group: %q", name) - - if d.HasChange("retention_in_days") { - var err error - - if v, ok := d.GetOk("retention_in_days"); ok { - input := cloudwatchlogs.PutRetentionPolicyInput{ - LogGroupName: aws.String(name), - RetentionInDays: aws.Int64(int64(v.(int))), - } - log.Printf("[DEBUG] Setting retention for CloudWatch Log Group: %q: %s", name, input) - _, err = conn.PutRetentionPolicy(&input) - } else { - log.Printf("[DEBUG] Deleting retention for CloudWatch Log Group: %q", name) - _, err = conn.DeleteRetentionPolicy(&cloudwatchlogs.DeleteRetentionPolicyInput{ - LogGroupName: aws.String(name), - }) - } - - if err != nil { - return err - } - } - - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffCloudWatchTags(o, n) - - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags from %s", name) - _, err := conn.UntagLogGroup(&cloudwatchlogs.UntagLogGroupInput{ - LogGroupName: aws.String(name), - Tags: remove, - }) - if err != nil { - return err - } - } - - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags on %s", name) - _, err := conn.TagLogGroup(&cloudwatchlogs.TagLogGroupInput{ - LogGroupName: aws.String(name), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return resourceAwsCloudWatchLogGroupRead(d, meta) -} - -func diffCloudWatchTags(oldTags map[string]interface{}, newTags map[string]interface{}) (map[string]*string, []*string) { - create := make(map[string]*string) - for k, v := range newTags { - create[k] = aws.String(v.(string)) - } - - var remove []*string - for _, t := range oldTags { - old, ok := create[t.(string)] - if !ok || *old != t.(string) { - remove = append(remove, aws.String(t.(string))) - } - } - - return create, remove -} - -func resourceAwsCloudWatchLogGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - log.Printf("[INFO] Deleting CloudWatch Log Group: %s", d.Id()) - _, err := conn.DeleteLogGroup(&cloudwatchlogs.DeleteLogGroupInput{ - LogGroupName: aws.String(d.Get("name").(string)), - }) - if err != nil { - return fmt.Errorf("Error deleting CloudWatch Log Group: %s", err) - } - log.Println("[INFO] CloudWatch Log Group deleted") - - d.SetId("") - - return nil -} - -func flattenCloudWatchTags(d *schema.ResourceData, conn *cloudwatchlogs.CloudWatchLogs) (map[string]interface{}, error) { - tagsOutput, err := conn.ListTagsLogGroup(&cloudwatchlogs.ListTagsLogGroupInput{ - LogGroupName: aws.String(d.Get("name").(string)), - }) - if err != nil { - return nil, errwrap.Wrapf("Error Getting CloudWatch Logs Tag List: {{err}}", err) - } - if tagsOutput != nil { - output := make(map[string]interface{}, len(tagsOutput.Tags)) - - for i, v := range tagsOutput.Tags { - output[i] = *v - } - - return output, nil - } - - return make(map[string]interface{}), nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_metric_filter.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_metric_filter.go deleted file mode 100644 index 943472f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_metric_filter.go +++ /dev/null @@ -1,187 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" -) - -func resourceAwsCloudWatchLogMetricFilter() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudWatchLogMetricFilterUpdate, - Read: resourceAwsCloudWatchLogMetricFilterRead, - Update: resourceAwsCloudWatchLogMetricFilterUpdate, - Delete: resourceAwsCloudWatchLogMetricFilterDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateLogMetricFilterName, - }, - - "pattern": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateMaxLength(512), - StateFunc: func(v interface{}) string { - s, ok := v.(string) - if !ok { - return "" - } - return strings.TrimSpace(s) - }, - }, - - "log_group_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateLogGroupName, - }, - - "metric_transformation": &schema.Schema{ - Type: schema.TypeList, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateLogMetricFilterTransformationName, - }, - "namespace": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateLogMetricFilterTransformationName, - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateMaxLength(100), - }, - }, - }, - }, - }, - } -} - -func resourceAwsCloudWatchLogMetricFilterUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - input := cloudwatchlogs.PutMetricFilterInput{ - FilterName: aws.String(d.Get("name").(string)), - FilterPattern: aws.String(strings.TrimSpace(d.Get("pattern").(string))), - LogGroupName: aws.String(d.Get("log_group_name").(string)), - } - - transformations := d.Get("metric_transformation").([]interface{}) - o := transformations[0].(map[string]interface{}) - input.MetricTransformations = expandCloudWachLogMetricTransformations(o) - - log.Printf("[DEBUG] Creating/Updating CloudWatch Log Metric Filter: %s", input) - _, err := conn.PutMetricFilter(&input) - if err != nil { - return fmt.Errorf("Creating/Updating CloudWatch Log Metric Filter failed: %s", err) - } - - d.SetId(d.Get("name").(string)) - - log.Println("[INFO] CloudWatch Log Metric Filter created/updated") - - return resourceAwsCloudWatchLogMetricFilterRead(d, meta) -} - -func resourceAwsCloudWatchLogMetricFilterRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - mf, err := lookupCloudWatchLogMetricFilter(conn, d.Get("name").(string), - d.Get("log_group_name").(string), nil) - if err != nil { - if _, ok := err.(*resource.NotFoundError); ok { - log.Printf("[WARN] Removing CloudWatch Log Metric Filter as it is gone") - d.SetId("") - return nil - } - - return fmt.Errorf("Failed reading CloudWatch Log Metric Filter: %s", err) - } - - log.Printf("[DEBUG] Found CloudWatch Log Metric Filter: %s", mf) - - d.Set("name", mf.FilterName) - d.Set("pattern", mf.FilterPattern) - d.Set("metric_transformation", flattenCloudWachLogMetricTransformations(mf.MetricTransformations)) - - return nil -} - -func lookupCloudWatchLogMetricFilter(conn *cloudwatchlogs.CloudWatchLogs, - name, logGroupName string, nextToken *string) (*cloudwatchlogs.MetricFilter, error) { - - input := cloudwatchlogs.DescribeMetricFiltersInput{ - FilterNamePrefix: aws.String(name), - LogGroupName: aws.String(logGroupName), - NextToken: nextToken, - } - log.Printf("[DEBUG] Reading CloudWatch Log Metric Filter: %s", input) - resp, err := conn.DescribeMetricFilters(&input) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" { - return nil, &resource.NotFoundError{ - Message: fmt.Sprintf("CloudWatch Log Metric Filter %q / %q not found via"+ - " initial DescribeMetricFilters call", name, logGroupName), - LastError: err, - LastRequest: input, - } - } - - return nil, fmt.Errorf("Failed describing CloudWatch Log Metric Filter: %s", err) - } - - for _, mf := range resp.MetricFilters { - if *mf.FilterName == name { - return mf, nil - } - } - - if resp.NextToken != nil { - return lookupCloudWatchLogMetricFilter(conn, name, logGroupName, resp.NextToken) - } - - return nil, &resource.NotFoundError{ - Message: fmt.Sprintf("CloudWatch Log Metric Filter %q / %q not found "+ - "in given results from DescribeMetricFilters", name, logGroupName), - LastResponse: resp, - LastRequest: input, - } -} - -func resourceAwsCloudWatchLogMetricFilterDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - input := cloudwatchlogs.DeleteMetricFilterInput{ - FilterName: aws.String(d.Get("name").(string)), - LogGroupName: aws.String(d.Get("log_group_name").(string)), - } - log.Printf("[INFO] Deleting CloudWatch Log Metric Filter: %s", d.Id()) - _, err := conn.DeleteMetricFilter(&input) - if err != nil { - return fmt.Errorf("Error deleting CloudWatch Log Metric Filter: %s", err) - } - log.Println("[INFO] CloudWatch Log Metric Filter deleted") - - d.SetId("") - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_stream.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_stream.go deleted file mode 100644 index 6557787..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_stream.go +++ /dev/null @@ -1,133 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudWatchLogStream() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudWatchLogStreamCreate, - Read: resourceAwsCloudWatchLogStreamRead, - Delete: resourceAwsCloudWatchLogStreamDelete, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateCloudWatchLogStreamName, - }, - - "log_group_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsCloudWatchLogStreamCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - log.Printf("[DEBUG] Creating CloudWatch Log Stream: %s", d.Get("name").(string)) - _, err := conn.CreateLogStream(&cloudwatchlogs.CreateLogStreamInput{ - LogGroupName: aws.String(d.Get("log_group_name").(string)), - LogStreamName: aws.String(d.Get("name").(string)), - }) - if err != nil { - return errwrap.Wrapf("Creating CloudWatch Log Stream failed: {{err}}", err) - } - - d.SetId(d.Get("name").(string)) - - return resourceAwsCloudWatchLogStreamRead(d, meta) -} - -func resourceAwsCloudWatchLogStreamRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - ls, exists, err := lookupCloudWatchLogStream(conn, d.Id(), d.Get("log_group_name").(string), nil) - if err != nil { - return err - } - - if !exists { - log.Printf("[DEBUG] CloudWatch Stream %q Not Found. Removing from state", d.Id()) - d.SetId("") - return nil - } - - d.Set("arn", ls.Arn) - d.Set("name", ls.LogStreamName) - - return nil -} - -func resourceAwsCloudWatchLogStreamDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - log.Printf("[INFO] Deleting CloudWatch Log Stream: %s", d.Id()) - params := &cloudwatchlogs.DeleteLogStreamInput{ - LogGroupName: aws.String(d.Get("log_group_name").(string)), - LogStreamName: aws.String(d.Id()), - } - _, err := conn.DeleteLogStream(params) - if err != nil { - return errwrap.Wrapf("Error deleting CloudWatch Log Stream: {{err}}", err) - } - - return nil -} - -func lookupCloudWatchLogStream(conn *cloudwatchlogs.CloudWatchLogs, - name string, logStreamName string, nextToken *string) (*cloudwatchlogs.LogStream, bool, error) { - input := &cloudwatchlogs.DescribeLogStreamsInput{ - LogStreamNamePrefix: aws.String(name), - LogGroupName: aws.String(logStreamName), - NextToken: nextToken, - } - resp, err := conn.DescribeLogStreams(input) - if err != nil { - return nil, true, err - } - - for _, ls := range resp.LogStreams { - if *ls.LogStreamName == name { - return ls, true, nil - } - } - - if resp.NextToken != nil { - return lookupCloudWatchLogStream(conn, name, logStreamName, resp.NextToken) - } - - return nil, false, nil -} - -func validateCloudWatchLogStreamName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if regexp.MustCompile(`:`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "colons not allowed in %q:", k)) - } - if len(value) < 1 || len(value) > 512 { - errors = append(errors, fmt.Errorf( - "%q must be between 1 and 512 characters: %q", k, value)) - } - - return - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter.go deleted file mode 100644 index f0fded0..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter.go +++ /dev/null @@ -1,177 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCloudwatchLogSubscriptionFilter() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudwatchLogSubscriptionFilterCreate, - Read: resourceAwsCloudwatchLogSubscriptionFilterRead, - Update: resourceAwsCloudwatchLogSubscriptionFilterUpdate, - Delete: resourceAwsCloudwatchLogSubscriptionFilterDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "destination_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "filter_pattern": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: false, - }, - "log_group_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "role_arn": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsCloudwatchLogSubscriptionFilterCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - params := getAwsCloudWatchLogsSubscriptionFilterInput(d) - log.Printf("[DEBUG] Creating SubscriptionFilter %#v", params) - - return resource.Retry(3*time.Minute, func() *resource.RetryError { - _, err := conn.PutSubscriptionFilter(¶ms) - - if err == nil { - d.SetId(cloudwatchLogsSubscriptionFilterId(d.Get("log_group_name").(string))) - log.Printf("[DEBUG] Cloudwatch logs subscription %q created", d.Id()) - } - - awsErr, ok := err.(awserr.Error) - if !ok { - return resource.RetryableError(err) - } - - if awsErr.Code() == "InvalidParameterException" { - log.Printf("[DEBUG] Caught message: %q, code: %q: Retrying", awsErr.Message(), awsErr.Code()) - if strings.Contains(awsErr.Message(), "Could not deliver test message to specified") { - return resource.RetryableError(err) - } - resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} - -func resourceAwsCloudwatchLogSubscriptionFilterUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - params := getAwsCloudWatchLogsSubscriptionFilterInput(d) - - log.Printf("[DEBUG] Update SubscriptionFilter %#v", params) - _, err := conn.PutSubscriptionFilter(¶ms) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - return fmt.Errorf("[WARN] Error updating SubscriptionFilter (%s) for LogGroup (%s), message: \"%s\", code: \"%s\"", - d.Get("name").(string), d.Get("log_group_name").(string), awsErr.Message(), awsErr.Code()) - } - return err - } - - d.SetId(cloudwatchLogsSubscriptionFilterId(d.Get("log_group_name").(string))) - return resourceAwsCloudwatchLogSubscriptionFilterRead(d, meta) -} - -func getAwsCloudWatchLogsSubscriptionFilterInput(d *schema.ResourceData) cloudwatchlogs.PutSubscriptionFilterInput { - name := d.Get("name").(string) - destination_arn := d.Get("destination_arn").(string) - filter_pattern := d.Get("filter_pattern").(string) - log_group_name := d.Get("log_group_name").(string) - - params := cloudwatchlogs.PutSubscriptionFilterInput{ - FilterName: aws.String(name), - DestinationArn: aws.String(destination_arn), - FilterPattern: aws.String(filter_pattern), - LogGroupName: aws.String(log_group_name), - } - - if _, ok := d.GetOk("role_arn"); ok { - params.RoleArn = aws.String(d.Get("role_arn").(string)) - } - - return params -} - -func resourceAwsCloudwatchLogSubscriptionFilterRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - - log_group_name := d.Get("log_group_name").(string) - name := d.Get("name").(string) // "name" is a required field in the schema - - req := &cloudwatchlogs.DescribeSubscriptionFiltersInput{ - LogGroupName: aws.String(log_group_name), - FilterNamePrefix: aws.String(name), - } - - resp, err := conn.DescribeSubscriptionFilters(req) - if err != nil { - return fmt.Errorf("Error reading SubscriptionFilters for log group %s with name prefix %s: %#v", log_group_name, d.Get("name").(string), err) - } - - for _, subscriptionFilter := range resp.SubscriptionFilters { - if *subscriptionFilter.LogGroupName == log_group_name { - d.SetId(cloudwatchLogsSubscriptionFilterId(log_group_name)) - return nil // OK, matching subscription filter found - } - } - - log.Printf("[DEBUG] Subscription Filter%q Not Found", name) - d.SetId("") - return nil -} - -func resourceAwsCloudwatchLogSubscriptionFilterDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchlogsconn - log.Printf("[INFO] Deleting CloudWatch Log Group Subscription: %s", d.Id()) - log_group_name := d.Get("log_group_name").(string) - name := d.Get("name").(string) - - params := &cloudwatchlogs.DeleteSubscriptionFilterInput{ - FilterName: aws.String(name), // Required - LogGroupName: aws.String(log_group_name), // Required - } - _, err := conn.DeleteSubscriptionFilter(params) - if err != nil { - return fmt.Errorf( - "Error deleting Subscription Filter from log group: %s with name filter name %s", log_group_name, name) - } - d.SetId("") - return nil -} - -func cloudwatchLogsSubscriptionFilterId(log_group_name string) string { - var buf bytes.Buffer - - buf.WriteString(fmt.Sprintf("%s-", log_group_name)) // only one filter allowed per log_group_name at the moment - - return fmt.Sprintf("cwlsf-%d", hashcode.String(buf.String())) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm.go deleted file mode 100644 index 9515303..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_cloudwatch_metric_alarm.go +++ /dev/null @@ -1,315 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudwatch" -) - -func resourceAwsCloudWatchMetricAlarm() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCloudWatchMetricAlarmCreate, - Read: resourceAwsCloudWatchMetricAlarmRead, - Update: resourceAwsCloudWatchMetricAlarmUpdate, - Delete: resourceAwsCloudWatchMetricAlarmDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "alarm_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "comparison_operator": { - Type: schema.TypeString, - Required: true, - }, - "evaluation_periods": { - Type: schema.TypeInt, - Required: true, - }, - "metric_name": { - Type: schema.TypeString, - Required: true, - }, - "namespace": { - Type: schema.TypeString, - Required: true, - }, - "period": { - Type: schema.TypeInt, - Required: true, - }, - "statistic": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"extended_statistic"}, - }, - "threshold": { - Type: schema.TypeFloat, - Required: true, - }, - "actions_enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "alarm_actions": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "alarm_description": { - Type: schema.TypeString, - Optional: true, - }, - "dimensions": { - Type: schema.TypeMap, - Optional: true, - }, - "insufficient_data_actions": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "ok_actions": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "unit": { - Type: schema.TypeString, - Optional: true, - }, - "extended_statistic": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"statistic"}, - }, - }, - } -} - -func resourceAwsCloudWatchMetricAlarmCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchconn - - _, statisticOk := d.GetOk("statistic") - _, extendedStatisticOk := d.GetOk("extended_statistic") - - if !statisticOk && !extendedStatisticOk { - return fmt.Errorf("One of `statistic` or `extended_statistic` must be set for a cloudwatch metric alarm") - } - - params := getAwsCloudWatchPutMetricAlarmInput(d) - - log.Printf("[DEBUG] Creating CloudWatch Metric Alarm: %#v", params) - _, err := conn.PutMetricAlarm(¶ms) - if err != nil { - return fmt.Errorf("Creating metric alarm failed: %s", err) - } - d.SetId(d.Get("alarm_name").(string)) - log.Println("[INFO] CloudWatch Metric Alarm created") - - return resourceAwsCloudWatchMetricAlarmRead(d, meta) -} - -func resourceAwsCloudWatchMetricAlarmRead(d *schema.ResourceData, meta interface{}) error { - a, err := getAwsCloudWatchMetricAlarm(d, meta) - if err != nil { - return err - } - if a == nil { - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Reading CloudWatch Metric Alarm: %s", d.Get("alarm_name")) - - d.Set("actions_enabled", a.ActionsEnabled) - - if err := d.Set("alarm_actions", _strArrPtrToList(a.AlarmActions)); err != nil { - log.Printf("[WARN] Error setting Alarm Actions: %s", err) - } - d.Set("alarm_description", a.AlarmDescription) - d.Set("alarm_name", a.AlarmName) - d.Set("comparison_operator", a.ComparisonOperator) - if err := d.Set("dimensions", flattenDimensions(a.Dimensions)); err != nil { - return err - } - d.Set("evaluation_periods", a.EvaluationPeriods) - - if err := d.Set("insufficient_data_actions", _strArrPtrToList(a.InsufficientDataActions)); err != nil { - log.Printf("[WARN] Error setting Insufficient Data Actions: %s", err) - } - d.Set("metric_name", a.MetricName) - d.Set("namespace", a.Namespace) - - if err := d.Set("ok_actions", _strArrPtrToList(a.OKActions)); err != nil { - log.Printf("[WARN] Error setting OK Actions: %s", err) - } - d.Set("period", a.Period) - d.Set("statistic", a.Statistic) - d.Set("threshold", a.Threshold) - d.Set("unit", a.Unit) - d.Set("extended_statistic", a.ExtendedStatistic) - - return nil -} - -func resourceAwsCloudWatchMetricAlarmUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cloudwatchconn - params := getAwsCloudWatchPutMetricAlarmInput(d) - - log.Printf("[DEBUG] Updating CloudWatch Metric Alarm: %#v", params) - _, err := conn.PutMetricAlarm(¶ms) - if err != nil { - return fmt.Errorf("Updating metric alarm failed: %s", err) - } - log.Println("[INFO] CloudWatch Metric Alarm updated") - - return resourceAwsCloudWatchMetricAlarmRead(d, meta) -} - -func resourceAwsCloudWatchMetricAlarmDelete(d *schema.ResourceData, meta interface{}) error { - p, err := getAwsCloudWatchMetricAlarm(d, meta) - if err != nil { - return err - } - if p == nil { - log.Printf("[DEBUG] CloudWatch Metric Alarm %s is already gone", d.Id()) - return nil - } - - log.Printf("[INFO] Deleting CloudWatch Metric Alarm: %s", d.Id()) - - conn := meta.(*AWSClient).cloudwatchconn - params := cloudwatch.DeleteAlarmsInput{ - AlarmNames: []*string{aws.String(d.Id())}, - } - - if _, err := conn.DeleteAlarms(¶ms); err != nil { - return fmt.Errorf("Error deleting CloudWatch Metric Alarm: %s", err) - } - log.Println("[INFO] CloudWatch Metric Alarm deleted") - - d.SetId("") - return nil -} - -func getAwsCloudWatchPutMetricAlarmInput(d *schema.ResourceData) cloudwatch.PutMetricAlarmInput { - params := cloudwatch.PutMetricAlarmInput{ - AlarmName: aws.String(d.Get("alarm_name").(string)), - ComparisonOperator: aws.String(d.Get("comparison_operator").(string)), - EvaluationPeriods: aws.Int64(int64(d.Get("evaluation_periods").(int))), - MetricName: aws.String(d.Get("metric_name").(string)), - Namespace: aws.String(d.Get("namespace").(string)), - Period: aws.Int64(int64(d.Get("period").(int))), - Threshold: aws.Float64(d.Get("threshold").(float64)), - } - - if v := d.Get("actions_enabled"); v != nil { - params.ActionsEnabled = aws.Bool(v.(bool)) - } - - if v, ok := d.GetOk("alarm_description"); ok { - params.AlarmDescription = aws.String(v.(string)) - } - - if v, ok := d.GetOk("unit"); ok { - params.Unit = aws.String(v.(string)) - } - - if v, ok := d.GetOk("statistic"); ok { - params.Statistic = aws.String(v.(string)) - } - - if v, ok := d.GetOk("extended_statistic"); ok { - params.ExtendedStatistic = aws.String(v.(string)) - } - - var alarmActions []*string - if v := d.Get("alarm_actions"); v != nil { - for _, v := range v.(*schema.Set).List() { - str := v.(string) - alarmActions = append(alarmActions, aws.String(str)) - } - params.AlarmActions = alarmActions - } - - var insufficientDataActions []*string - if v := d.Get("insufficient_data_actions"); v != nil { - for _, v := range v.(*schema.Set).List() { - str := v.(string) - insufficientDataActions = append(insufficientDataActions, aws.String(str)) - } - params.InsufficientDataActions = insufficientDataActions - } - - var okActions []*string - if v := d.Get("ok_actions"); v != nil { - for _, v := range v.(*schema.Set).List() { - str := v.(string) - okActions = append(okActions, aws.String(str)) - } - params.OKActions = okActions - } - - a := d.Get("dimensions").(map[string]interface{}) - dimensions := make([]*cloudwatch.Dimension, 0, len(a)) - for k, v := range a { - dimensions = append(dimensions, &cloudwatch.Dimension{ - Name: aws.String(k), - Value: aws.String(v.(string)), - }) - } - params.Dimensions = dimensions - - return params -} - -func getAwsCloudWatchMetricAlarm(d *schema.ResourceData, meta interface{}) (*cloudwatch.MetricAlarm, error) { - conn := meta.(*AWSClient).cloudwatchconn - - params := cloudwatch.DescribeAlarmsInput{ - AlarmNames: []*string{aws.String(d.Id())}, - } - - resp, err := conn.DescribeAlarms(¶ms) - if err != nil { - return nil, err - } - - // Find it and return it - for idx, ma := range resp.MetricAlarms { - if *ma.AlarmName == d.Id() { - return resp.MetricAlarms[idx], nil - } - } - - return nil, nil -} - -func _strArrPtrToList(strArrPtr []*string) []string { - var result []string - for _, elem := range strArrPtr { - result = append(result, *elem) - } - return result -} - -func flattenDimensions(dims []*cloudwatch.Dimension) map[string]interface{} { - flatDims := make(map[string]interface{}) - for _, d := range dims { - flatDims[*d.Name] = *d.Value - } - return flatDims -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codebuild_project.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codebuild_project.go deleted file mode 100644 index 3a19836..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codebuild_project.go +++ /dev/null @@ -1,746 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codebuild" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCodeBuildProject() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCodeBuildProjectCreate, - Read: resourceAwsCodeBuildProjectRead, - Update: resourceAwsCodeBuildProjectUpdate, - Delete: resourceAwsCodeBuildProjectDelete, - - Schema: map[string]*schema.Schema{ - "artifacts": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - }, - "location": { - Type: schema.TypeString, - Optional: true, - }, - "namespace_type": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateAwsCodeBuildArifactsNamespaceType, - }, - "packaging": { - Type: schema.TypeString, - Optional: true, - }, - "path": { - Type: schema.TypeString, - Optional: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodeBuildArifactsType, - }, - }, - }, - Set: resourceAwsCodeBuildProjectArtifactsHash, - }, - "description": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateAwsCodeBuildProjectDescription, - }, - "encryption_key": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "environment": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "compute_type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodeBuildEnvironmentComputeType, - }, - "environment_variable": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "value": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "image": { - Type: schema.TypeString, - Required: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodeBuildEnvironmentType, - }, - }, - }, - Set: resourceAwsCodeBuildProjectEnvironmentHash, - }, - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAwsCodeBuildProjectName, - }, - "service_role": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "source": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "auth": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "resource": { - Type: schema.TypeString, - Optional: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodeBuildSourceAuthType, - }, - }, - }, - Optional: true, - }, - "buildspec": { - Type: schema.TypeString, - Optional: true, - }, - "location": { - Type: schema.TypeString, - Optional: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodeBuildSourceType, - }, - }, - }, - Required: true, - MaxItems: 1, - }, - "timeout": { - Type: schema.TypeInt, - Optional: true, - ValidateFunc: validateAwsCodeBuildTimeout, - Removed: "This field has been removed. Please use build_timeout instead", - }, - "build_timeout": { - Type: schema.TypeInt, - Optional: true, - Default: "60", - ValidateFunc: validateAwsCodeBuildTimeout, - }, - "tags": tagsSchema(), - }, - } -} - -func resourceAwsCodeBuildProjectCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codebuildconn - - projectEnv := expandProjectEnvironment(d) - projectSource := expandProjectSource(d) - projectArtifacts := expandProjectArtifacts(d) - - params := &codebuild.CreateProjectInput{ - Environment: projectEnv, - Name: aws.String(d.Get("name").(string)), - Source: &projectSource, - Artifacts: &projectArtifacts, - } - - if v, ok := d.GetOk("description"); ok { - params.Description = aws.String(v.(string)) - } - - if v, ok := d.GetOk("encryption_key"); ok { - params.EncryptionKey = aws.String(v.(string)) - } - - if v, ok := d.GetOk("service_role"); ok { - params.ServiceRole = aws.String(v.(string)) - } - - if v, ok := d.GetOk("build_timeout"); ok { - params.TimeoutInMinutes = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("tags"); ok { - params.Tags = tagsFromMapCodeBuild(v.(map[string]interface{})) - } - - var resp *codebuild.CreateProjectOutput - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - var err error - - resp, err = conn.CreateProject(params) - - if err != nil { - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - }) - - if err != nil { - return fmt.Errorf("[ERROR] Error creating CodeBuild project: %s", err) - } - - d.SetId(*resp.Project.Arn) - - return resourceAwsCodeBuildProjectUpdate(d, meta) -} - -func expandProjectArtifacts(d *schema.ResourceData) codebuild.ProjectArtifacts { - configs := d.Get("artifacts").(*schema.Set).List() - data := configs[0].(map[string]interface{}) - - projectArtifacts := codebuild.ProjectArtifacts{ - Type: aws.String(data["type"].(string)), - } - - if data["location"].(string) != "" { - projectArtifacts.Location = aws.String(data["location"].(string)) - } - - if data["name"].(string) != "" { - projectArtifacts.Name = aws.String(data["name"].(string)) - } - - if data["namespace_type"].(string) != "" { - projectArtifacts.NamespaceType = aws.String(data["namespace_type"].(string)) - } - - if data["packaging"].(string) != "" { - projectArtifacts.Packaging = aws.String(data["packaging"].(string)) - } - - if data["path"].(string) != "" { - projectArtifacts.Path = aws.String(data["path"].(string)) - } - - return projectArtifacts -} - -func expandProjectEnvironment(d *schema.ResourceData) *codebuild.ProjectEnvironment { - configs := d.Get("environment").(*schema.Set).List() - projectEnv := &codebuild.ProjectEnvironment{} - - envConfig := configs[0].(map[string]interface{}) - - if v := envConfig["compute_type"]; v != nil { - projectEnv.ComputeType = aws.String(v.(string)) - } - - if v := envConfig["image"]; v != nil { - projectEnv.Image = aws.String(v.(string)) - } - - if v := envConfig["type"]; v != nil { - projectEnv.Type = aws.String(v.(string)) - } - - if v := envConfig["environment_variable"]; v != nil { - envVariables := v.([]interface{}) - if len(envVariables) > 0 { - projectEnvironmentVariables := make([]*codebuild.EnvironmentVariable, 0, len(envVariables)) - - for _, envVariablesConfig := range envVariables { - config := envVariablesConfig.(map[string]interface{}) - - projectEnvironmentVar := &codebuild.EnvironmentVariable{} - - if v := config["name"].(string); v != "" { - projectEnvironmentVar.Name = &v - } - - if v := config["value"].(string); v != "" { - projectEnvironmentVar.Value = &v - } - - projectEnvironmentVariables = append(projectEnvironmentVariables, projectEnvironmentVar) - } - - projectEnv.EnvironmentVariables = projectEnvironmentVariables - } - } - - return projectEnv -} - -func expandProjectSource(d *schema.ResourceData) codebuild.ProjectSource { - configs := d.Get("source").(*schema.Set).List() - projectSource := codebuild.ProjectSource{} - - for _, configRaw := range configs { - data := configRaw.(map[string]interface{}) - - sourceType := data["type"].(string) - location := data["location"].(string) - buildspec := data["buildspec"].(string) - - projectSource = codebuild.ProjectSource{ - Type: &sourceType, - Location: &location, - Buildspec: &buildspec, - } - - if v, ok := data["auth"]; ok { - if len(v.(*schema.Set).List()) > 0 { - auth := v.(*schema.Set).List()[0].(map[string]interface{}) - - projectSource.Auth = &codebuild.SourceAuth{ - Type: aws.String(auth["type"].(string)), - Resource: aws.String(auth["resource"].(string)), - } - } - } - } - - return projectSource -} - -func resourceAwsCodeBuildProjectRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codebuildconn - - resp, err := conn.BatchGetProjects(&codebuild.BatchGetProjectsInput{ - Names: []*string{ - aws.String(d.Id()), - }, - }) - - if err != nil { - return fmt.Errorf("[ERROR] Error retreiving Projects: %q", err) - } - - // if nothing was found, then return no state - if len(resp.Projects) == 0 { - log.Printf("[INFO]: No projects were found, removing from state") - d.SetId("") - return nil - } - - project := resp.Projects[0] - - if err := d.Set("artifacts", flattenAwsCodebuildProjectArtifacts(project.Artifacts)); err != nil { - return err - } - - if err := d.Set("environment", schema.NewSet(resourceAwsCodeBuildProjectEnvironmentHash, flattenAwsCodebuildProjectEnvironment(project.Environment))); err != nil { - return err - } - - if err := d.Set("source", flattenAwsCodebuildProjectSource(project.Source)); err != nil { - return err - } - - d.Set("description", project.Description) - d.Set("encryption_key", project.EncryptionKey) - d.Set("name", project.Name) - d.Set("service_role", project.ServiceRole) - d.Set("build_timeout", project.TimeoutInMinutes) - - if err := d.Set("tags", tagsToMapCodeBuild(project.Tags)); err != nil { - return err - } - - return nil -} - -func resourceAwsCodeBuildProjectUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codebuildconn - - params := &codebuild.UpdateProjectInput{ - Name: aws.String(d.Get("name").(string)), - } - - if d.HasChange("environment") { - projectEnv := expandProjectEnvironment(d) - params.Environment = projectEnv - } - - if d.HasChange("source") { - projectSource := expandProjectSource(d) - params.Source = &projectSource - } - - if d.HasChange("artifacts") { - projectArtifacts := expandProjectArtifacts(d) - params.Artifacts = &projectArtifacts - } - - if d.HasChange("description") { - params.Description = aws.String(d.Get("description").(string)) - } - - if d.HasChange("encryption_key") { - params.EncryptionKey = aws.String(d.Get("encryption_key").(string)) - } - - if d.HasChange("service_role") { - params.ServiceRole = aws.String(d.Get("service_role").(string)) - } - - if d.HasChange("build_timeout") { - params.TimeoutInMinutes = aws.Int64(int64(d.Get("build_timeout").(int))) - } - - // The documentation clearly says "The replacement set of tags for this build project." - // But its a slice of pointers so if not set for every update, they get removed. - params.Tags = tagsFromMapCodeBuild(d.Get("tags").(map[string]interface{})) - - _, err := conn.UpdateProject(params) - - if err != nil { - return fmt.Errorf( - "[ERROR] Error updating CodeBuild project (%s): %s", - d.Id(), err) - } - - return resourceAwsCodeBuildProjectRead(d, meta) -} - -func resourceAwsCodeBuildProjectDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codebuildconn - - _, err := conn.DeleteProject(&codebuild.DeleteProjectInput{ - Name: aws.String(d.Id()), - }) - - if err != nil { - return err - } - - d.SetId("") - - return nil -} - -func flattenAwsCodebuildProjectArtifacts(artifacts *codebuild.ProjectArtifacts) *schema.Set { - - artifactSet := schema.Set{ - F: resourceAwsCodeBuildProjectArtifactsHash, - } - - values := map[string]interface{}{} - - values["type"] = *artifacts.Type - - if artifacts.Location != nil { - values["location"] = *artifacts.Location - } - - if artifacts.Name != nil { - values["name"] = *artifacts.Name - } - - if artifacts.NamespaceType != nil { - values["namespace_type"] = *artifacts.NamespaceType - } - - if artifacts.Packaging != nil { - values["packaging"] = *artifacts.Packaging - } - - if artifacts.Path != nil { - values["path"] = *artifacts.Path - } - - artifactSet.Add(values) - - return &artifactSet -} - -func flattenAwsCodebuildProjectEnvironment(environment *codebuild.ProjectEnvironment) []interface{} { - envConfig := map[string]interface{}{} - - envConfig["type"] = *environment.Type - envConfig["compute_type"] = *environment.ComputeType - envConfig["image"] = *environment.Image - - if environment.EnvironmentVariables != nil { - envConfig["environment_variable"] = environmentVariablesToMap(environment.EnvironmentVariables) - } - - return []interface{}{envConfig} - -} - -func flattenAwsCodebuildProjectSource(source *codebuild.ProjectSource) *schema.Set { - - sourceSet := schema.Set{ - F: resourceAwsCodeBuildProjectSourceHash, - } - - authSet := schema.Set{ - F: resourceAwsCodeBuildProjectSourceAuthHash, - } - - sourceConfig := map[string]interface{}{} - - sourceConfig["type"] = *source.Type - - if source.Auth != nil { - authSet.Add(sourceAuthToMap(source.Auth)) - sourceConfig["auth"] = &authSet - } - - if source.Buildspec != nil { - sourceConfig["buildspec"] = *source.Buildspec - } - - if source.Location != nil { - sourceConfig["location"] = *source.Location - } - - sourceSet.Add(sourceConfig) - - return &sourceSet - -} - -func resourceAwsCodeBuildProjectArtifactsHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - artifactType := m["type"].(string) - - buf.WriteString(fmt.Sprintf("%s-", artifactType)) - - return hashcode.String(buf.String()) -} - -func resourceAwsCodeBuildProjectEnvironmentHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - environmentType := m["type"].(string) - computeType := m["compute_type"].(string) - image := m["image"].(string) - environmentVariables := m["environment_variable"].([]interface{}) - buf.WriteString(fmt.Sprintf("%s-", environmentType)) - buf.WriteString(fmt.Sprintf("%s-", computeType)) - buf.WriteString(fmt.Sprintf("%s-", image)) - for _, e := range environmentVariables { - if e != nil { // Old statefiles might have nil values in them - ev := e.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s:%s-", ev["name"].(string), ev["value"].(string))) - } - } - - return hashcode.String(buf.String()) -} - -func resourceAwsCodeBuildProjectSourceHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - sourceType := m["type"].(string) - buildspec := m["buildspec"].(string) - location := m["location"].(string) - - buf.WriteString(fmt.Sprintf("%s-", sourceType)) - buf.WriteString(fmt.Sprintf("%s-", buildspec)) - buf.WriteString(fmt.Sprintf("%s-", location)) - - return hashcode.String(buf.String()) -} - -func resourceAwsCodeBuildProjectSourceAuthHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - authType := m["type"].(string) - authResource := m["resource"].(string) - - buf.WriteString(fmt.Sprintf("%s-", authType)) - buf.WriteString(fmt.Sprintf("%s-", authResource)) - - return hashcode.String(buf.String()) -} - -func environmentVariablesToMap(environmentVariables []*codebuild.EnvironmentVariable) []interface{} { - - envVariables := []interface{}{} - if len(environmentVariables) > 0 { - for _, env := range environmentVariables { - item := map[string]interface{}{} - item["name"] = *env.Name - item["value"] = *env.Value - envVariables = append(envVariables, item) - } - } - - return envVariables -} - -func sourceAuthToMap(sourceAuth *codebuild.SourceAuth) map[string]interface{} { - - auth := map[string]interface{}{} - auth["type"] = *sourceAuth.Type - - if sourceAuth.Resource != nil { - auth["resource"] = *sourceAuth.Resource - } - - return auth -} - -func validateAwsCodeBuildArifactsType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "CODEPIPELINE": true, - "NO_ARTIFACTS": true, - "S3": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("CodeBuild: Arifacts Type can only be CODEPIPELINE / NO_ARTIFACTS / S3")) - } - return -} - -func validateAwsCodeBuildArifactsNamespaceType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "NONE": true, - "BUILD_ID": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("CodeBuild: Arifacts Namespace Type can only be NONE / BUILD_ID")) - } - return -} - -func validateAwsCodeBuildProjectName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[A-Za-z0-9]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter or number", value)) - } - - if !regexp.MustCompile(`^[A-Za-z0-9\-_]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters, hyphens and underscores allowed in %q", value)) - } - - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be greater than 255 characters", value)) - } - - return -} - -func validateAwsCodeBuildProjectDescription(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 255 { - errors = append(errors, fmt.Errorf("%q cannot be greater than 255 characters", value)) - } - return -} - -func validateAwsCodeBuildEnvironmentComputeType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "BUILD_GENERAL1_SMALL": true, - "BUILD_GENERAL1_MEDIUM": true, - "BUILD_GENERAL1_LARGE": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("CodeBuild: Environment Compute Type can only be BUILD_GENERAL1_SMALL / BUILD_GENERAL1_MEDIUM / BUILD_GENERAL1_LARGE")) - } - return -} - -func validateAwsCodeBuildEnvironmentType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "LINUX_CONTAINER": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("CodeBuild: Environment Type can only be LINUX_CONTAINER")) - } - return -} - -func validateAwsCodeBuildSourceType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "CODECOMMIT": true, - "CODEPIPELINE": true, - "GITHUB": true, - "S3": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("CodeBuild: Source Type can only be CODECOMMIT / CODEPIPELINE / GITHUB / S3")) - } - return -} - -func validateAwsCodeBuildSourceAuthType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "OAUTH": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("CodeBuild: Source Auth Type can only be OAUTH")) - } - return -} - -func validateAwsCodeBuildTimeout(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - - if value < 5 || value > 480 { - errors = append(errors, fmt.Errorf("%q must be greater than 5 minutes and less than 480 minutes (8 hours)", value)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codebuild_project_migrate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codebuild_project_migrate.go deleted file mode 100644 index 97d7a9f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codebuild_project_migrate.go +++ /dev/null @@ -1,36 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/hashicorp/terraform/terraform" -) - -func resourceAwsCodebuildMigrateState( - v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - switch v { - case 0: - log.Println("[INFO] Found AWS Codebuild State v0; migrating to v1") - return migrateCodebuildStateV0toV1(is) - default: - return is, fmt.Errorf("Unexpected schema version: %d", v) - } -} - -func migrateCodebuildStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() { - log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") - return is, nil - } - - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - - if is.Attributes["timeout"] != "" { - is.Attributes["build_timeout"] = strings.TrimSpace(is.Attributes["timeout"]) - } - - log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) - return is, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codecommit_repository.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codecommit_repository.go deleted file mode 100644 index c9b2bd2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codecommit_repository.go +++ /dev/null @@ -1,197 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codecommit" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCodeCommitRepository() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCodeCommitRepositoryCreate, - Update: resourceAwsCodeCommitRepositoryUpdate, - Read: resourceAwsCodeCommitRepositoryRead, - Delete: resourceAwsCodeCommitRepositoryDelete, - - Schema: map[string]*schema.Schema{ - "repository_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 100 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 100 characters", k)) - } - return - }, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 1000 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 1000 characters", k)) - } - return - }, - }, - - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "repository_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "clone_url_http": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "clone_url_ssh": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "default_branch": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func resourceAwsCodeCommitRepositoryCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codecommitconn - - input := &codecommit.CreateRepositoryInput{ - RepositoryName: aws.String(d.Get("repository_name").(string)), - RepositoryDescription: aws.String(d.Get("description").(string)), - } - - out, err := conn.CreateRepository(input) - if err != nil { - return fmt.Errorf("Error creating CodeCommit Repository: %s", err) - } - - d.SetId(d.Get("repository_name").(string)) - d.Set("repository_id", out.RepositoryMetadata.RepositoryId) - d.Set("arn", out.RepositoryMetadata.Arn) - d.Set("clone_url_http", out.RepositoryMetadata.CloneUrlHttp) - d.Set("clone_url_ssh", out.RepositoryMetadata.CloneUrlSsh) - - return resourceAwsCodeCommitRepositoryUpdate(d, meta) -} - -func resourceAwsCodeCommitRepositoryUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codecommitconn - - if _, ok := d.GetOk("default_branch"); ok { - if d.HasChange("default_branch") { - if err := resourceAwsCodeCommitUpdateDefaultBranch(conn, d); err != nil { - return err - } - } - } - - if d.HasChange("description") { - if err := resourceAwsCodeCommitUpdateDescription(conn, d); err != nil { - return err - } - } - - return resourceAwsCodeCommitRepositoryRead(d, meta) -} - -func resourceAwsCodeCommitRepositoryRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codecommitconn - - input := &codecommit.GetRepositoryInput{ - RepositoryName: aws.String(d.Id()), - } - - out, err := conn.GetRepository(input) - if err != nil { - return fmt.Errorf("Error reading CodeCommit Repository: %s", err.Error()) - } - - d.Set("repository_id", out.RepositoryMetadata.RepositoryId) - d.Set("arn", out.RepositoryMetadata.Arn) - d.Set("clone_url_http", out.RepositoryMetadata.CloneUrlHttp) - d.Set("clone_url_ssh", out.RepositoryMetadata.CloneUrlSsh) - - if _, ok := d.GetOk("default_branch"); ok { - if out.RepositoryMetadata.DefaultBranch != nil { - d.Set("default_branch", out.RepositoryMetadata.DefaultBranch) - } - } - - return nil -} - -func resourceAwsCodeCommitRepositoryDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codecommitconn - - log.Printf("[DEBUG] CodeCommit Delete Repository: %s", d.Id()) - _, err := conn.DeleteRepository(&codecommit.DeleteRepositoryInput{ - RepositoryName: aws.String(d.Id()), - }) - if err != nil { - return fmt.Errorf("Error deleting CodeCommit Repository: %s", err.Error()) - } - - return nil -} - -func resourceAwsCodeCommitUpdateDescription(conn *codecommit.CodeCommit, d *schema.ResourceData) error { - branchInput := &codecommit.UpdateRepositoryDescriptionInput{ - RepositoryName: aws.String(d.Id()), - RepositoryDescription: aws.String(d.Get("description").(string)), - } - - _, err := conn.UpdateRepositoryDescription(branchInput) - if err != nil { - return fmt.Errorf("Error Updating Repository Description for CodeCommit Repository: %s", err.Error()) - } - - return nil -} - -func resourceAwsCodeCommitUpdateDefaultBranch(conn *codecommit.CodeCommit, d *schema.ResourceData) error { - input := &codecommit.ListBranchesInput{ - RepositoryName: aws.String(d.Id()), - } - - out, err := conn.ListBranches(input) - if err != nil { - return fmt.Errorf("Error reading CodeCommit Repository branches: %s", err.Error()) - } - - if len(out.Branches) == 0 { - log.Printf("[WARN] Not setting Default Branch CodeCommit Repository that has no branches: %s", d.Id()) - return nil - } - - branchInput := &codecommit.UpdateDefaultBranchInput{ - RepositoryName: aws.String(d.Id()), - DefaultBranchName: aws.String(d.Get("default_branch").(string)), - } - - _, err = conn.UpdateDefaultBranch(branchInput) - if err != nil { - return fmt.Errorf("Error Updating Default Branch for CodeCommit Repository: %s", err.Error()) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codecommit_trigger.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codecommit_trigger.go deleted file mode 100644 index c21d55a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codecommit_trigger.go +++ /dev/null @@ -1,163 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codecommit" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCodeCommitTrigger() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCodeCommitTriggerCreate, - Read: resourceAwsCodeCommitTriggerRead, - Delete: resourceAwsCodeCommitTriggerDelete, - - Schema: map[string]*schema.Schema{ - "repository_name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "configuration_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "trigger": &schema.Schema{ - Type: schema.TypeSet, - ForceNew: true, - Required: true, - MaxItems: 10, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "destination_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "custom_data": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "branches": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "events": &schema.Schema{ - Type: schema.TypeList, - Required: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - }, - } -} - -func resourceAwsCodeCommitTriggerCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codecommitconn - - // Expand the "trigger" set to aws-sdk-go compat []*codecommit.RepositoryTrigger - triggers := expandAwsCodeCommitTriggers(d.Get("trigger").(*schema.Set).List()) - - input := &codecommit.PutRepositoryTriggersInput{ - RepositoryName: aws.String(d.Get("repository_name").(string)), - Triggers: triggers, - } - - resp, err := conn.PutRepositoryTriggers(input) - if err != nil { - return fmt.Errorf("Error creating CodeCommit Trigger: %s", err) - } - - log.Printf("[INFO] Code Commit Trigger Created %s input %s", resp, input) - - d.SetId(d.Get("repository_name").(string)) - d.Set("configuration_id", resp.ConfigurationId) - - return resourceAwsCodeCommitTriggerRead(d, meta) -} - -func resourceAwsCodeCommitTriggerRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codecommitconn - - input := &codecommit.GetRepositoryTriggersInput{ - RepositoryName: aws.String(d.Id()), - } - - resp, err := conn.GetRepositoryTriggers(input) - if err != nil { - return fmt.Errorf("Error reading CodeCommit Trigger: %s", err.Error()) - } - - log.Printf("[DEBUG] CodeCommit Trigger: %s", resp) - - return nil -} - -func resourceAwsCodeCommitTriggerDelete(d *schema.ResourceData, meta interface{}) error { - - conn := meta.(*AWSClient).codecommitconn - - log.Printf("[DEBUG] Deleting Trigger: %q", d.Id()) - - input := &codecommit.PutRepositoryTriggersInput{ - RepositoryName: aws.String(d.Get("repository_name").(string)), - Triggers: []*codecommit.RepositoryTrigger{}, - } - - _, err := conn.PutRepositoryTriggers(input) - - if err != nil { - return err - } - - return nil -} - -func expandAwsCodeCommitTriggers(configured []interface{}) []*codecommit.RepositoryTrigger { - triggers := make([]*codecommit.RepositoryTrigger, 0, len(configured)) - // Loop over our configured triggers and create - // an array of aws-sdk-go compatabile objects - for _, lRaw := range configured { - data := lRaw.(map[string]interface{}) - t := &codecommit.RepositoryTrigger{ - CustomData: aws.String(data["custom_data"].(string)), - DestinationArn: aws.String(data["destination_arn"].(string)), - Name: aws.String(data["name"].(string)), - } - - branches := make([]*string, len(data["branches"].([]interface{}))) - for i, vv := range data["branches"].([]interface{}) { - str := vv.(string) - branches[i] = aws.String(str) - } - t.Branches = branches - - events := make([]*string, len(data["events"].([]interface{}))) - for i, vv := range data["events"].([]interface{}) { - str := vv.(string) - events[i] = aws.String(str) - } - t.Events = events - - triggers = append(triggers, t) - } - return triggers -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_app.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_app.go deleted file mode 100644 index 706bd7a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_app.go +++ /dev/null @@ -1,127 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/codedeploy" -) - -func resourceAwsCodeDeployApp() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCodeDeployAppCreate, - Read: resourceAwsCodeDeployAppRead, - Update: resourceAwsCodeDeployUpdate, - Delete: resourceAwsCodeDeployAppDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - // The unique ID is set by AWS on create. - "unique_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsCodeDeployAppCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - application := d.Get("name").(string) - log.Printf("[DEBUG] Creating CodeDeploy application %s", application) - - resp, err := conn.CreateApplication(&codedeploy.CreateApplicationInput{ - ApplicationName: aws.String(application), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] CodeDeploy application %s created", *resp.ApplicationId) - - // Despite giving the application a unique ID, AWS doesn't actually use - // it in API calls. Use it and the app name to identify the resource in - // the state file. This allows us to reliably detect both when the TF - // config file changes and when the user deletes the app without removing - // it first from the TF config. - d.SetId(fmt.Sprintf("%s:%s", *resp.ApplicationId, application)) - - return resourceAwsCodeDeployAppRead(d, meta) -} - -func resourceAwsCodeDeployAppRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - _, application := resourceAwsCodeDeployAppParseId(d.Id()) - log.Printf("[DEBUG] Reading CodeDeploy application %s", application) - resp, err := conn.GetApplication(&codedeploy.GetApplicationInput{ - ApplicationName: aws.String(application), - }) - if err != nil { - if codedeployerr, ok := err.(awserr.Error); ok && codedeployerr.Code() == "ApplicationDoesNotExistException" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error finding CodeDeploy application: %s", err) - return err - } - } - - d.Set("name", resp.Application.ApplicationName) - - return nil -} - -func resourceAwsCodeDeployUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - o, n := d.GetChange("name") - - _, err := conn.UpdateApplication(&codedeploy.UpdateApplicationInput{ - ApplicationName: aws.String(o.(string)), - NewApplicationName: aws.String(n.(string)), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] CodeDeploy application %s updated", n) - - d.Set("name", n) - - return nil -} - -func resourceAwsCodeDeployAppDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - _, err := conn.DeleteApplication(&codedeploy.DeleteApplicationInput{ - ApplicationName: aws.String(d.Get("name").(string)), - }) - if err != nil { - if cderr, ok := err.(awserr.Error); ok && cderr.Code() == "InvalidApplicationNameException" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error deleting CodeDeploy application: %s", err) - return err - } - } - - return nil -} - -func resourceAwsCodeDeployAppParseId(id string) (string, string) { - parts := strings.SplitN(id, ":", 2) - return parts[0], parts[1] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_config.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_config.go deleted file mode 100644 index 10130dc..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_config.go +++ /dev/null @@ -1,152 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/codedeploy" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCodeDeployDeploymentConfig() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCodeDeployDeploymentConfigCreate, - Read: resourceAwsCodeDeployDeploymentConfigRead, - Delete: resourceAwsCodeDeployDeploymentConfigDelete, - - Schema: map[string]*schema.Schema{ - "deployment_config_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "minimum_healthy_hosts": { - Type: schema.TypeList, - Required: true, - ForceNew: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateMinimumHealtyHostsType, - }, - - "value": { - Type: schema.TypeInt, - Optional: true, - }, - }, - }, - }, - - "deployment_config_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsCodeDeployDeploymentConfigCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - input := &codedeploy.CreateDeploymentConfigInput{ - DeploymentConfigName: aws.String(d.Get("deployment_config_name").(string)), - MinimumHealthyHosts: expandAwsCodeDeployConfigMinimumHealthHosts(d), - } - - _, err := conn.CreateDeploymentConfig(input) - if err != nil { - return err - } - - d.SetId(d.Get("deployment_config_name").(string)) - - return resourceAwsCodeDeployDeploymentConfigRead(d, meta) -} - -func resourceAwsCodeDeployDeploymentConfigRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - input := &codedeploy.GetDeploymentConfigInput{ - DeploymentConfigName: aws.String(d.Id()), - } - - resp, err := conn.GetDeploymentConfig(input) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if "DeploymentConfigDoesNotExistException" == awsErr.Code() { - log.Printf("[DEBUG] CodeDeploy Deployment Config (%s) not found", d.Id()) - d.SetId("") - return nil - } - } - return err - } - - if resp.DeploymentConfigInfo == nil { - return fmt.Errorf("[ERROR] Cannot find DeploymentConfig %q", d.Id()) - } - - if err := d.Set("minimum_healthy_hosts", flattenAwsCodeDeployConfigMinimumHealthHosts(resp.DeploymentConfigInfo.MinimumHealthyHosts)); err != nil { - return err - } - d.Set("deployment_config_id", resp.DeploymentConfigInfo.DeploymentConfigId) - d.Set("deployment_config_name", resp.DeploymentConfigInfo.DeploymentConfigName) - - return nil -} - -func resourceAwsCodeDeployDeploymentConfigDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - input := &codedeploy.DeleteDeploymentConfigInput{ - DeploymentConfigName: aws.String(d.Id()), - } - - _, err := conn.DeleteDeploymentConfig(input) - if err != nil { - return err - } - - return nil -} - -func expandAwsCodeDeployConfigMinimumHealthHosts(d *schema.ResourceData) *codedeploy.MinimumHealthyHosts { - hosts := d.Get("minimum_healthy_hosts").([]interface{}) - host := hosts[0].(map[string]interface{}) - - minimumHealthyHost := codedeploy.MinimumHealthyHosts{ - Type: aws.String(host["type"].(string)), - Value: aws.Int64(int64(host["value"].(int))), - } - - return &minimumHealthyHost -} - -func flattenAwsCodeDeployConfigMinimumHealthHosts(hosts *codedeploy.MinimumHealthyHosts) []map[string]interface{} { - result := make([]map[string]interface{}, 0) - - item := make(map[string]interface{}) - - item["type"] = *hosts.Type - item["value"] = *hosts.Value - - result = append(result, item) - - return result -} - -func validateMinimumHealtyHostsType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "FLEET_PERCENT" && value != "HOST_COUNT" { - errors = append(errors, fmt.Errorf( - "%q must be one of \"FLEET_PERCENT\" or \"HOST_COUNT\"", k)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_group.go deleted file mode 100644 index 4a6d172..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_group.go +++ /dev/null @@ -1,690 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "sort" - "time" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/codedeploy" -) - -func resourceAwsCodeDeployDeploymentGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCodeDeployDeploymentGroupCreate, - Read: resourceAwsCodeDeployDeploymentGroupRead, - Update: resourceAwsCodeDeployDeploymentGroupUpdate, - Delete: resourceAwsCodeDeployDeploymentGroupDelete, - - Schema: map[string]*schema.Schema{ - "app_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 100 { - errors = append(errors, fmt.Errorf( - "%q cannot exceed 100 characters", k)) - } - return - }, - }, - - "deployment_group_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 100 { - errors = append(errors, fmt.Errorf( - "%q cannot exceed 100 characters", k)) - } - return - }, - }, - - "service_role_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "alarm_configuration": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "alarms": &schema.Schema{ - Type: schema.TypeSet, - MaxItems: 10, - Optional: true, - Set: schema.HashString, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "enabled": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - }, - - "ignore_poll_alarm_failure": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - }, - }, - - "auto_rollback_configuration": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "enabled": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - }, - - "events": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Set: schema.HashString, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - - "autoscaling_groups": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "deployment_config_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "CodeDeployDefault.OneAtATime", - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 100 { - errors = append(errors, fmt.Errorf( - "%q cannot exceed 100 characters", k)) - } - return - }, - }, - - "ec2_tag_filter": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateTagFilters, - }, - - "value": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - }, - Set: resourceAwsCodeDeployTagFilterHash, - }, - - "on_premises_instance_tag_filter": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateTagFilters, - }, - - "value": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - }, - Set: resourceAwsCodeDeployTagFilterHash, - }, - - "trigger_configuration": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "trigger_events": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Set: schema.HashString, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validateTriggerEvent, - }, - }, - - "trigger_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "trigger_target_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: resourceAwsCodeDeployTriggerConfigHash, - }, - }, - } -} - -func resourceAwsCodeDeployDeploymentGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - application := d.Get("app_name").(string) - deploymentGroup := d.Get("deployment_group_name").(string) - - input := codedeploy.CreateDeploymentGroupInput{ - ApplicationName: aws.String(application), - DeploymentGroupName: aws.String(deploymentGroup), - ServiceRoleArn: aws.String(d.Get("service_role_arn").(string)), - } - if attr, ok := d.GetOk("deployment_config_name"); ok { - input.DeploymentConfigName = aws.String(attr.(string)) - } - if attr, ok := d.GetOk("autoscaling_groups"); ok { - input.AutoScalingGroups = expandStringList(attr.(*schema.Set).List()) - } - if attr, ok := d.GetOk("on_premises_instance_tag_filter"); ok { - onPremFilters := buildOnPremTagFilters(attr.(*schema.Set).List()) - input.OnPremisesInstanceTagFilters = onPremFilters - } - if attr, ok := d.GetOk("ec2_tag_filter"); ok { - ec2TagFilters := buildEC2TagFilters(attr.(*schema.Set).List()) - input.Ec2TagFilters = ec2TagFilters - } - if attr, ok := d.GetOk("trigger_configuration"); ok { - triggerConfigs := buildTriggerConfigs(attr.(*schema.Set).List()) - input.TriggerConfigurations = triggerConfigs - } - - if attr, ok := d.GetOk("auto_rollback_configuration"); ok { - input.AutoRollbackConfiguration = buildAutoRollbackConfig(attr.([]interface{})) - } - - if attr, ok := d.GetOk("alarm_configuration"); ok { - input.AlarmConfiguration = buildAlarmConfig(attr.([]interface{})) - } - - // Retry to handle IAM role eventual consistency. - var resp *codedeploy.CreateDeploymentGroupOutput - var err error - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - resp, err = conn.CreateDeploymentGroup(&input) - if err != nil { - retry := false - codedeployErr, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - if codedeployErr.Code() == "InvalidRoleException" { - retry = true - } - if codedeployErr.Code() == "InvalidTriggerConfigException" { - r := regexp.MustCompile("^Topic ARN .+ is not valid$") - if r.MatchString(codedeployErr.Message()) { - retry = true - } - } - if retry { - log.Printf("[DEBUG] Trying to create deployment group again: %q", - codedeployErr.Message()) - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return err - } - - d.SetId(*resp.DeploymentGroupId) - - return resourceAwsCodeDeployDeploymentGroupRead(d, meta) -} - -func resourceAwsCodeDeployDeploymentGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - log.Printf("[DEBUG] Reading CodeDeploy DeploymentGroup %s", d.Id()) - resp, err := conn.GetDeploymentGroup(&codedeploy.GetDeploymentGroupInput{ - ApplicationName: aws.String(d.Get("app_name").(string)), - DeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)), - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "DeploymentGroupDoesNotExistException" { - log.Printf("[INFO] CodeDeployment DeploymentGroup %s not found", d.Get("deployment_group_name").(string)) - d.SetId("") - return nil - } - - return err - } - - d.Set("app_name", resp.DeploymentGroupInfo.ApplicationName) - d.Set("autoscaling_groups", resp.DeploymentGroupInfo.AutoScalingGroups) - d.Set("deployment_config_name", resp.DeploymentGroupInfo.DeploymentConfigName) - d.Set("deployment_group_name", resp.DeploymentGroupInfo.DeploymentGroupName) - d.Set("service_role_arn", resp.DeploymentGroupInfo.ServiceRoleArn) - if err := d.Set("ec2_tag_filter", ec2TagFiltersToMap(resp.DeploymentGroupInfo.Ec2TagFilters)); err != nil { - return err - } - if err := d.Set("on_premises_instance_tag_filter", onPremisesTagFiltersToMap(resp.DeploymentGroupInfo.OnPremisesInstanceTagFilters)); err != nil { - return err - } - if err := d.Set("trigger_configuration", triggerConfigsToMap(resp.DeploymentGroupInfo.TriggerConfigurations)); err != nil { - return err - } - - if err := d.Set("auto_rollback_configuration", autoRollbackConfigToMap(resp.DeploymentGroupInfo.AutoRollbackConfiguration)); err != nil { - return err - } - - if err := d.Set("alarm_configuration", alarmConfigToMap(resp.DeploymentGroupInfo.AlarmConfiguration)); err != nil { - return err - } - - return nil -} - -func resourceAwsCodeDeployDeploymentGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - input := codedeploy.UpdateDeploymentGroupInput{ - ApplicationName: aws.String(d.Get("app_name").(string)), - CurrentDeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)), - ServiceRoleArn: aws.String(d.Get("service_role_arn").(string)), - } - - if d.HasChange("autoscaling_groups") { - _, n := d.GetChange("autoscaling_groups") - input.AutoScalingGroups = expandStringList(n.(*schema.Set).List()) - } - if d.HasChange("deployment_config_name") { - _, n := d.GetChange("deployment_config_name") - input.DeploymentConfigName = aws.String(n.(string)) - } - if d.HasChange("deployment_group_name") { - _, n := d.GetChange("deployment_group_name") - input.NewDeploymentGroupName = aws.String(n.(string)) - } - - // TagFilters aren't like tags. They don't append. They simply replace. - if d.HasChange("on_premises_instance_tag_filter") { - _, n := d.GetChange("on_premises_instance_tag_filter") - onPremFilters := buildOnPremTagFilters(n.(*schema.Set).List()) - input.OnPremisesInstanceTagFilters = onPremFilters - } - if d.HasChange("ec2_tag_filter") { - _, n := d.GetChange("ec2_tag_filter") - ec2Filters := buildEC2TagFilters(n.(*schema.Set).List()) - input.Ec2TagFilters = ec2Filters - } - if d.HasChange("trigger_configuration") { - _, n := d.GetChange("trigger_configuration") - triggerConfigs := buildTriggerConfigs(n.(*schema.Set).List()) - input.TriggerConfigurations = triggerConfigs - } - - if d.HasChange("auto_rollback_configuration") { - _, n := d.GetChange("auto_rollback_configuration") - input.AutoRollbackConfiguration = buildAutoRollbackConfig(n.([]interface{})) - } - - if d.HasChange("alarm_configuration") { - _, n := d.GetChange("alarm_configuration") - input.AlarmConfiguration = buildAlarmConfig(n.([]interface{})) - } - - log.Printf("[DEBUG] Updating CodeDeploy DeploymentGroup %s", d.Id()) - // Retry to handle IAM role eventual consistency. - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.UpdateDeploymentGroup(&input) - if err != nil { - retry := false - codedeployErr, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - if codedeployErr.Code() == "InvalidRoleException" { - retry = true - } - if codedeployErr.Code() == "InvalidTriggerConfigException" { - r := regexp.MustCompile("^Topic ARN .+ is not valid$") - if r.MatchString(codedeployErr.Message()) { - retry = true - } - } - if retry { - log.Printf("[DEBUG] Retrying Code Deployment Group Update: %q", - codedeployErr.Message()) - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return err - } - - return resourceAwsCodeDeployDeploymentGroupRead(d, meta) -} - -func resourceAwsCodeDeployDeploymentGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codedeployconn - - log.Printf("[DEBUG] Deleting CodeDeploy DeploymentGroup %s", d.Id()) - _, err := conn.DeleteDeploymentGroup(&codedeploy.DeleteDeploymentGroupInput{ - ApplicationName: aws.String(d.Get("app_name").(string)), - DeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)), - }) - if err != nil { - return err - } - - d.SetId("") - - return nil -} - -// buildOnPremTagFilters converts raw schema lists into a list of -// codedeploy.TagFilters. -func buildOnPremTagFilters(configured []interface{}) []*codedeploy.TagFilter { - filters := make([]*codedeploy.TagFilter, 0) - for _, raw := range configured { - var filter codedeploy.TagFilter - m := raw.(map[string]interface{}) - - if v, ok := m["key"]; ok { - filter.Key = aws.String(v.(string)) - } - if v, ok := m["type"]; ok { - filter.Type = aws.String(v.(string)) - } - if v, ok := m["value"]; ok { - filter.Value = aws.String(v.(string)) - } - - filters = append(filters, &filter) - } - - return filters -} - -// buildEC2TagFilters converts raw schema lists into a list of -// codedeploy.EC2TagFilters. -func buildEC2TagFilters(configured []interface{}) []*codedeploy.EC2TagFilter { - filters := make([]*codedeploy.EC2TagFilter, 0) - for _, raw := range configured { - var filter codedeploy.EC2TagFilter - m := raw.(map[string]interface{}) - - filter.Key = aws.String(m["key"].(string)) - filter.Type = aws.String(m["type"].(string)) - filter.Value = aws.String(m["value"].(string)) - - filters = append(filters, &filter) - } - - return filters -} - -// buildTriggerConfigs converts a raw schema list into a list of -// codedeploy.TriggerConfig. -func buildTriggerConfigs(configured []interface{}) []*codedeploy.TriggerConfig { - configs := make([]*codedeploy.TriggerConfig, 0, len(configured)) - for _, raw := range configured { - var config codedeploy.TriggerConfig - m := raw.(map[string]interface{}) - - config.TriggerEvents = expandStringSet(m["trigger_events"].(*schema.Set)) - config.TriggerName = aws.String(m["trigger_name"].(string)) - config.TriggerTargetArn = aws.String(m["trigger_target_arn"].(string)) - - configs = append(configs, &config) - } - return configs -} - -// buildAutoRollbackConfig converts a raw schema list containing a map[string]interface{} -// into a single codedeploy.AutoRollbackConfiguration -func buildAutoRollbackConfig(configured []interface{}) *codedeploy.AutoRollbackConfiguration { - result := &codedeploy.AutoRollbackConfiguration{} - - if len(configured) == 1 { - config := configured[0].(map[string]interface{}) - result.Enabled = aws.Bool(config["enabled"].(bool)) - result.Events = expandStringSet(config["events"].(*schema.Set)) - } else { // delete the configuration - result.Enabled = aws.Bool(false) - result.Events = make([]*string, 0) - } - - return result -} - -// buildAlarmConfig converts a raw schema list containing a map[string]interface{} -// into a single codedeploy.AlarmConfiguration -func buildAlarmConfig(configured []interface{}) *codedeploy.AlarmConfiguration { - result := &codedeploy.AlarmConfiguration{} - - if len(configured) == 1 { - config := configured[0].(map[string]interface{}) - names := expandStringSet(config["alarms"].(*schema.Set)) - alarms := make([]*codedeploy.Alarm, 0, len(names)) - - for _, name := range names { - alarm := &codedeploy.Alarm{ - Name: name, - } - alarms = append(alarms, alarm) - } - - result.Alarms = alarms - result.Enabled = aws.Bool(config["enabled"].(bool)) - result.IgnorePollAlarmFailure = aws.Bool(config["ignore_poll_alarm_failure"].(bool)) - } else { // delete the configuration - result.Alarms = make([]*codedeploy.Alarm, 0) - result.Enabled = aws.Bool(false) - result.IgnorePollAlarmFailure = aws.Bool(false) - } - - return result -} - -// ec2TagFiltersToMap converts lists of tag filters into a []map[string]string. -func ec2TagFiltersToMap(list []*codedeploy.EC2TagFilter) []map[string]string { - result := make([]map[string]string, 0, len(list)) - for _, tf := range list { - l := make(map[string]string) - if tf.Key != nil && *tf.Key != "" { - l["key"] = *tf.Key - } - if tf.Value != nil && *tf.Value != "" { - l["value"] = *tf.Value - } - if tf.Type != nil && *tf.Type != "" { - l["type"] = *tf.Type - } - result = append(result, l) - } - return result -} - -// onPremisesTagFiltersToMap converts lists of on-prem tag filters into a []map[string]string. -func onPremisesTagFiltersToMap(list []*codedeploy.TagFilter) []map[string]string { - result := make([]map[string]string, 0, len(list)) - for _, tf := range list { - l := make(map[string]string) - if tf.Key != nil && *tf.Key != "" { - l["key"] = *tf.Key - } - if tf.Value != nil && *tf.Value != "" { - l["value"] = *tf.Value - } - if tf.Type != nil && *tf.Type != "" { - l["type"] = *tf.Type - } - result = append(result, l) - } - return result -} - -// triggerConfigsToMap converts a list of []*codedeploy.TriggerConfig into a []map[string]interface{} -func triggerConfigsToMap(list []*codedeploy.TriggerConfig) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(list)) - for _, tc := range list { - item := make(map[string]interface{}) - item["trigger_events"] = schema.NewSet(schema.HashString, flattenStringList(tc.TriggerEvents)) - item["trigger_name"] = *tc.TriggerName - item["trigger_target_arn"] = *tc.TriggerTargetArn - result = append(result, item) - } - return result -} - -// autoRollbackConfigToMap converts a codedeploy.AutoRollbackConfiguration -// into a []map[string]interface{} list containing a single item -func autoRollbackConfigToMap(config *codedeploy.AutoRollbackConfiguration) []map[string]interface{} { - result := make([]map[string]interface{}, 0, 1) - - // only create configurations that are enabled or temporarily disabled (retaining events) - // otherwise empty configurations will be created - if config != nil && (*config.Enabled == true || len(config.Events) > 0) { - item := make(map[string]interface{}) - item["enabled"] = *config.Enabled - item["events"] = schema.NewSet(schema.HashString, flattenStringList(config.Events)) - result = append(result, item) - } - - return result -} - -// alarmConfigToMap converts a codedeploy.AlarmConfiguration -// into a []map[string]interface{} list containing a single item -func alarmConfigToMap(config *codedeploy.AlarmConfiguration) []map[string]interface{} { - result := make([]map[string]interface{}, 0, 1) - - // only create configurations that are enabled or temporarily disabled (retaining alarms) - // otherwise empty configurations will be created - if config != nil && (*config.Enabled == true || len(config.Alarms) > 0) { - names := make([]*string, 0, len(config.Alarms)) - for _, alarm := range config.Alarms { - names = append(names, alarm.Name) - } - - item := make(map[string]interface{}) - item["alarms"] = schema.NewSet(schema.HashString, flattenStringList(names)) - item["enabled"] = *config.Enabled - item["ignore_poll_alarm_failure"] = *config.IgnorePollAlarmFailure - - result = append(result, item) - } - - return result -} - -func resourceAwsCodeDeployTagFilterHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - // Nothing's actually required in tag filters, so we must check the - // presence of all values before attempting a hash. - if v, ok := m["key"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["type"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["value"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - return hashcode.String(buf.String()) -} - -func resourceAwsCodeDeployTriggerConfigHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["trigger_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["trigger_target_arn"].(string))) - - if triggerEvents, ok := m["trigger_events"]; ok { - names := triggerEvents.(*schema.Set).List() - strings := make([]string, len(names)) - for i, raw := range names { - strings[i] = raw.(string) - } - sort.Strings(strings) - - for _, s := range strings { - buf.WriteString(fmt.Sprintf("%s-", s)) - } - } - return hashcode.String(buf.String()) -} - -func validateTriggerEvent(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - triggerEvents := map[string]bool{ - "DeploymentStart": true, - "DeploymentStop": true, - "DeploymentSuccess": true, - "DeploymentFailure": true, - "DeploymentRollback": true, - "InstanceStart": true, - "InstanceSuccess": true, - "InstanceFailure": true, - } - - if !triggerEvents[value] { - errors = append(errors, fmt.Errorf("%q must be a valid event type value: %q", k, value)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codepipeline.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codepipeline.go deleted file mode 100644 index 22a77cd..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codepipeline.go +++ /dev/null @@ -1,493 +0,0 @@ -package aws - -import ( - "fmt" - "os" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codepipeline" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCodePipeline() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCodePipelineCreate, - Read: resourceAwsCodePipelineRead, - Update: resourceAwsCodePipelineUpdate, - Delete: resourceAwsCodePipelineDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "role_arn": { - Type: schema.TypeString, - Required: true, - }, - - "artifact_store": { - Type: schema.TypeList, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "location": { - Type: schema.TypeString, - Required: true, - }, - - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodePipelineArtifactStoreType, - }, - - "encryption_key": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Required: true, - }, - - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodePipelineEncryptionKeyType, - }, - }, - }, - }, - }, - }, - }, - "stage": { - Type: schema.TypeList, - MinItems: 2, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "action": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "configuration": { - Type: schema.TypeMap, - Optional: true, - }, - "category": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodePipelineStageActionCategory, - }, - "owner": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsCodePipelineStageActionOwner, - }, - "provider": { - Type: schema.TypeString, - Required: true, - }, - "version": { - Type: schema.TypeString, - Required: true, - }, - "input_artifacts": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "output_artifacts": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "name": { - Type: schema.TypeString, - Required: true, - }, - "role_arn": { - Type: schema.TypeString, - Optional: true, - }, - "run_order": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - }, - }, - }, - }, - }, - }, - }, - } -} -func validateAwsCodePipelineEncryptionKeyType(v interface{}, k string) (ws []string, errors []error) { - if v.(string) != "KMS" { - errors = append(errors, fmt.Errorf("CodePipeline: encryption_key type can only be KMS")) - } - return -} - -func validateAwsCodePipelineArtifactStoreType(v interface{}, k string) (ws []string, errors []error) { - if v.(string) != "S3" { - errors = append(errors, fmt.Errorf("CodePipeline: artifact_store type can only be S3")) - } - return -} - -func validateAwsCodePipelineStageActionCategory(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "Source": true, - "Build": true, - "Deploy": true, - "Test": true, - "Invoke": true, - "Approval": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("CodePipeline: category can only be one of Source | Build | Deploy | Test | Invoke | Approval")) - } - return -} - -func validateAwsCodePipelineStageActionOwner(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "AWS": true, - "ThirdParty": true, - "Custom": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("CodePipeline: owner can only be one of AWS | ThirdParty | Custom")) - } - return -} - -func validateAwsCodePipelineStageActionConfiguration(v interface{}, k string) (ws []string, errors []error) { - for k := range v.(map[string]interface{}) { - if k == "OAuthToken" { - errors = append(errors, fmt.Errorf("CodePipeline: OAuthToken should be set as environment variable 'GITHUB_TOKEN'")) - } - } - return -} - -func resourceAwsCodePipelineCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codepipelineconn - params := &codepipeline.CreatePipelineInput{ - Pipeline: expandAwsCodePipeline(d), - } - - var resp *codepipeline.CreatePipelineOutput - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - var err error - - resp, err = conn.CreatePipeline(params) - - if err != nil { - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - }) - if err != nil { - return fmt.Errorf("[ERROR] Error creating CodePipeline: %s", err) - } - if resp.Pipeline == nil { - return fmt.Errorf("[ERROR] Error creating CodePipeline: invalid response from AWS") - } - - d.SetId(*resp.Pipeline.Name) - return resourceAwsCodePipelineRead(d, meta) -} - -func expandAwsCodePipeline(d *schema.ResourceData) *codepipeline.PipelineDeclaration { - pipelineArtifactStore := expandAwsCodePipelineArtifactStore(d) - pipelineStages := expandAwsCodePipelineStages(d) - - pipeline := codepipeline.PipelineDeclaration{ - Name: aws.String(d.Get("name").(string)), - RoleArn: aws.String(d.Get("role_arn").(string)), - ArtifactStore: pipelineArtifactStore, - Stages: pipelineStages, - } - return &pipeline -} -func expandAwsCodePipelineArtifactStore(d *schema.ResourceData) *codepipeline.ArtifactStore { - configs := d.Get("artifact_store").([]interface{}) - data := configs[0].(map[string]interface{}) - pipelineArtifactStore := codepipeline.ArtifactStore{ - Location: aws.String(data["location"].(string)), - Type: aws.String(data["type"].(string)), - } - tek := data["encryption_key"].([]interface{}) - if len(tek) > 0 { - vk := tek[0].(map[string]interface{}) - ek := codepipeline.EncryptionKey{ - Type: aws.String(vk["type"].(string)), - Id: aws.String(vk["id"].(string)), - } - pipelineArtifactStore.EncryptionKey = &ek - } - return &pipelineArtifactStore -} - -func flattenAwsCodePipelineArtifactStore(artifactStore *codepipeline.ArtifactStore) []interface{} { - values := map[string]interface{}{} - values["type"] = *artifactStore.Type - values["location"] = *artifactStore.Location - if artifactStore.EncryptionKey != nil { - as := map[string]interface{}{ - "id": *artifactStore.EncryptionKey.Id, - "type": *artifactStore.EncryptionKey.Type, - } - values["encryption_key"] = []interface{}{as} - } - return []interface{}{values} -} - -func expandAwsCodePipelineStages(d *schema.ResourceData) []*codepipeline.StageDeclaration { - configs := d.Get("stage").([]interface{}) - pipelineStages := []*codepipeline.StageDeclaration{} - - for _, stage := range configs { - data := stage.(map[string]interface{}) - a := data["action"].([]interface{}) - actions := expandAwsCodePipelineActions(a) - pipelineStages = append(pipelineStages, &codepipeline.StageDeclaration{ - Name: aws.String(data["name"].(string)), - Actions: actions, - }) - } - return pipelineStages -} - -func flattenAwsCodePipelineStages(stages []*codepipeline.StageDeclaration) []interface{} { - stagesList := []interface{}{} - for _, stage := range stages { - values := map[string]interface{}{} - values["name"] = *stage.Name - values["action"] = flattenAwsCodePipelineStageActions(stage.Actions) - stagesList = append(stagesList, values) - } - return stagesList - -} - -func expandAwsCodePipelineActions(s []interface{}) []*codepipeline.ActionDeclaration { - actions := []*codepipeline.ActionDeclaration{} - for _, config := range s { - data := config.(map[string]interface{}) - - conf := expandAwsCodePipelineStageActionConfiguration(data["configuration"].(map[string]interface{})) - if data["provider"].(string) == "GitHub" { - githubToken := os.Getenv("GITHUB_TOKEN") - if githubToken != "" { - conf["OAuthToken"] = aws.String(githubToken) - } - - } - - action := codepipeline.ActionDeclaration{ - ActionTypeId: &codepipeline.ActionTypeId{ - Category: aws.String(data["category"].(string)), - Owner: aws.String(data["owner"].(string)), - - Provider: aws.String(data["provider"].(string)), - Version: aws.String(data["version"].(string)), - }, - Name: aws.String(data["name"].(string)), - Configuration: conf, - } - - oa := data["output_artifacts"].([]interface{}) - if len(oa) > 0 { - outputArtifacts := expandAwsCodePipelineActionsOutputArtifacts(oa) - action.OutputArtifacts = outputArtifacts - - } - ia := data["input_artifacts"].([]interface{}) - if len(ia) > 0 { - inputArtifacts := expandAwsCodePipelineActionsInputArtifacts(ia) - action.InputArtifacts = inputArtifacts - - } - ro := data["run_order"].(int) - if ro > 0 { - action.RunOrder = aws.Int64(int64(ro)) - } - actions = append(actions, &action) - } - return actions -} - -func flattenAwsCodePipelineStageActions(actions []*codepipeline.ActionDeclaration) []interface{} { - actionsList := []interface{}{} - for _, action := range actions { - values := map[string]interface{}{ - "category": *action.ActionTypeId.Category, - "owner": *action.ActionTypeId.Owner, - "provider": *action.ActionTypeId.Provider, - "version": *action.ActionTypeId.Version, - "name": *action.Name, - } - if action.Configuration != nil { - config := flattenAwsCodePipelineStageActionConfiguration(action.Configuration) - _, ok := config["OAuthToken"] - actionProvider := *action.ActionTypeId.Provider - if ok && actionProvider == "GitHub" { - delete(config, "OAuthToken") - } - values["configuration"] = config - } - - if len(action.OutputArtifacts) > 0 { - values["output_artifacts"] = flattenAwsCodePipelineActionsOutputArtifacts(action.OutputArtifacts) - } - - if len(action.InputArtifacts) > 0 { - values["input_artifacts"] = flattenAwsCodePipelineActionsInputArtifacts(action.InputArtifacts) - } - - if action.RunOrder != nil { - values["run_order"] = int(*action.RunOrder) - } - - actionsList = append(actionsList, values) - } - return actionsList -} - -func expandAwsCodePipelineStageActionConfiguration(config map[string]interface{}) map[string]*string { - m := map[string]*string{} - for k, v := range config { - s := v.(string) - m[k] = &s - } - return m -} - -func flattenAwsCodePipelineStageActionConfiguration(config map[string]*string) map[string]string { - m := map[string]string{} - for k, v := range config { - m[k] = *v - } - return m -} - -func expandAwsCodePipelineActionsOutputArtifacts(s []interface{}) []*codepipeline.OutputArtifact { - outputArtifacts := []*codepipeline.OutputArtifact{} - for _, artifact := range s { - outputArtifacts = append(outputArtifacts, &codepipeline.OutputArtifact{ - Name: aws.String(artifact.(string)), - }) - } - return outputArtifacts -} - -func flattenAwsCodePipelineActionsOutputArtifacts(artifacts []*codepipeline.OutputArtifact) []string { - values := []string{} - for _, artifact := range artifacts { - values = append(values, *artifact.Name) - } - return values -} - -func expandAwsCodePipelineActionsInputArtifacts(s []interface{}) []*codepipeline.InputArtifact { - outputArtifacts := []*codepipeline.InputArtifact{} - for _, artifact := range s { - outputArtifacts = append(outputArtifacts, &codepipeline.InputArtifact{ - Name: aws.String(artifact.(string)), - }) - } - return outputArtifacts -} - -func flattenAwsCodePipelineActionsInputArtifacts(artifacts []*codepipeline.InputArtifact) []string { - values := []string{} - for _, artifact := range artifacts { - values = append(values, *artifact.Name) - } - return values -} - -func resourceAwsCodePipelineRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codepipelineconn - resp, err := conn.GetPipeline(&codepipeline.GetPipelineInput{ - Name: aws.String(d.Id()), - }) - - if err != nil { - return fmt.Errorf("[ERROR] Error retreiving Pipeline: %q", err) - } - pipeline := resp.Pipeline - - if err := d.Set("artifact_store", flattenAwsCodePipelineArtifactStore(pipeline.ArtifactStore)); err != nil { - return err - } - - if err := d.Set("stage", flattenAwsCodePipelineStages(pipeline.Stages)); err != nil { - return err - } - - d.Set("name", pipeline.Name) - d.Set("role_arn", pipeline.RoleArn) - return nil -} - -func resourceAwsCodePipelineUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codepipelineconn - - pipeline := expandAwsCodePipeline(d) - params := &codepipeline.UpdatePipelineInput{ - Pipeline: pipeline, - } - _, err := conn.UpdatePipeline(params) - - if err != nil { - return fmt.Errorf( - "[ERROR] Error updating CodePipeline (%s): %s", - d.Id(), err) - } - - return resourceAwsCodePipelineRead(d, meta) -} - -func resourceAwsCodePipelineDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).codepipelineconn - - _, err := conn.DeletePipeline(&codepipeline.DeletePipelineInput{ - Name: aws.String(d.Id()), - }) - - if err != nil { - return err - } - - d.SetId("") - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_config_rule.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_config_rule.go deleted file mode 100644 index e4f2e5c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_config_rule.go +++ /dev/null @@ -1,301 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/configservice" -) - -func resourceAwsConfigConfigRule() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsConfigConfigRulePut, - Read: resourceAwsConfigConfigRuleRead, - Update: resourceAwsConfigConfigRulePut, - Delete: resourceAwsConfigConfigRuleDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateMaxLength(64), - }, - "rule_id": { - Type: schema.TypeString, - Computed: true, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "description": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateMaxLength(256), - }, - "input_parameters": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateJsonString, - }, - "maximum_execution_frequency": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateConfigExecutionFrequency, - }, - "scope": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "compliance_resource_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateMaxLength(256), - }, - "compliance_resource_types": { - Type: schema.TypeSet, - Optional: true, - MaxItems: 100, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validateMaxLength(256), - }, - Set: schema.HashString, - }, - "tag_key": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateMaxLength(128), - }, - "tag_value": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateMaxLength(256), - }, - }, - }, - }, - "source": { - Type: schema.TypeList, - MaxItems: 1, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "owner": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateConfigRuleSourceOwner, - }, - "source_detail": { - Type: schema.TypeSet, - Set: configRuleSourceDetailsHash, - Optional: true, - MaxItems: 25, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "event_source": { - Type: schema.TypeString, - Optional: true, - }, - "maximum_execution_frequency": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateConfigExecutionFrequency, - }, - "message_type": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - "source_identifier": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateMaxLength(256), - }, - }, - }, - }, - }, - } -} - -func resourceAwsConfigConfigRulePut(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - name := d.Get("name").(string) - ruleInput := configservice.ConfigRule{ - ConfigRuleName: aws.String(name), - Source: expandConfigRuleSource(d.Get("source").([]interface{})), - } - - scopes := d.Get("scope").([]interface{}) - if len(scopes) > 0 { - ruleInput.Scope = expandConfigRuleScope(scopes[0].(map[string]interface{})) - } - - if v, ok := d.GetOk("description"); ok { - ruleInput.Description = aws.String(v.(string)) - } - if v, ok := d.GetOk("input_parameters"); ok { - ruleInput.InputParameters = aws.String(v.(string)) - } - if v, ok := d.GetOk("maximum_execution_frequency"); ok { - ruleInput.MaximumExecutionFrequency = aws.String(v.(string)) - } - - input := configservice.PutConfigRuleInput{ - ConfigRule: &ruleInput, - } - log.Printf("[DEBUG] Creating AWSConfig config rule: %s", input) - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - _, err := conn.PutConfigRule(&input) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "InsufficientPermissionsException" { - // IAM is eventually consistent - return resource.RetryableError(err) - } - } - - return resource.NonRetryableError(fmt.Errorf("Failed to create AWSConfig rule: %s", err)) - } - - return nil - }) - if err != nil { - return err - } - - d.SetId(name) - - log.Printf("[DEBUG] AWSConfig config rule %q created", name) - - return resourceAwsConfigConfigRuleRead(d, meta) -} - -func resourceAwsConfigConfigRuleRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - out, err := conn.DescribeConfigRules(&configservice.DescribeConfigRulesInput{ - ConfigRuleNames: []*string{aws.String(d.Id())}, - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchConfigRuleException" { - log.Printf("[WARN] Config Rule %q is gone (NoSuchConfigRuleException)", d.Id()) - d.SetId("") - return nil - } - return err - } - - numberOfRules := len(out.ConfigRules) - if numberOfRules < 1 { - log.Printf("[WARN] Config Rule %q is gone (no rules found)", d.Id()) - d.SetId("") - return nil - } - - if numberOfRules > 1 { - return fmt.Errorf("Expected exactly 1 Config Rule, received %d: %#v", - numberOfRules, out.ConfigRules) - } - - log.Printf("[DEBUG] AWS Config config rule received: %s", out) - - rule := out.ConfigRules[0] - d.Set("arn", rule.ConfigRuleArn) - d.Set("rule_id", rule.ConfigRuleId) - d.Set("name", rule.ConfigRuleName) - d.Set("description", rule.Description) - d.Set("input_parameters", rule.InputParameters) - d.Set("maximum_execution_frequency", rule.MaximumExecutionFrequency) - - if rule.Scope != nil { - d.Set("scope", flattenConfigRuleScope(rule.Scope)) - } - - d.Set("source", flattenConfigRuleSource(rule.Source)) - - return nil -} - -func resourceAwsConfigConfigRuleDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - name := d.Get("name").(string) - - log.Printf("[DEBUG] Deleting AWS Config config rule %q", name) - _, err := conn.DeleteConfigRule(&configservice.DeleteConfigRuleInput{ - ConfigRuleName: aws.String(name), - }) - if err != nil { - return fmt.Errorf("Deleting Config Rule failed: %s", err) - } - - conf := resource.StateChangeConf{ - Pending: []string{ - configservice.ConfigRuleStateActive, - configservice.ConfigRuleStateDeleting, - configservice.ConfigRuleStateDeletingResults, - configservice.ConfigRuleStateEvaluating, - }, - Target: []string{""}, - Timeout: 5 * time.Minute, - Refresh: func() (interface{}, string, error) { - out, err := conn.DescribeConfigRules(&configservice.DescribeConfigRulesInput{ - ConfigRuleNames: []*string{aws.String(d.Id())}, - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchConfigRuleException" { - return 42, "", nil - } - return 42, "", fmt.Errorf("Failed to describe config rule %q: %s", d.Id(), err) - } - if len(out.ConfigRules) < 1 { - return 42, "", nil - } - rule := out.ConfigRules[0] - return out, *rule.ConfigRuleState, nil - }, - } - _, err = conf.WaitForState() - if err != nil { - return err - } - - log.Printf("[DEBUG] AWS Config config rule %q deleted", name) - - d.SetId("") - return nil -} - -func configRuleSourceDetailsHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - if v, ok := m["message_type"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["event_source"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["maximum_execution_frequency"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - return hashcode.String(buf.String()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_configuration_recorder.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_configuration_recorder.go deleted file mode 100644 index c635d63..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_configuration_recorder.go +++ /dev/null @@ -1,148 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/configservice" -) - -func resourceAwsConfigConfigurationRecorder() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsConfigConfigurationRecorderPut, - Read: resourceAwsConfigConfigurationRecorderRead, - Update: resourceAwsConfigConfigurationRecorderPut, - Delete: resourceAwsConfigConfigurationRecorderDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - Default: "default", - ValidateFunc: validateMaxLength(256), - }, - "role_arn": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateArn, - }, - "recording_group": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "all_supported": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "include_global_resource_types": { - Type: schema.TypeBool, - Optional: true, - }, - "resource_types": { - Type: schema.TypeSet, - Set: schema.HashString, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - }, - }, - } -} - -func resourceAwsConfigConfigurationRecorderPut(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - name := d.Get("name").(string) - recorder := configservice.ConfigurationRecorder{ - Name: aws.String(name), - RoleARN: aws.String(d.Get("role_arn").(string)), - } - - if g, ok := d.GetOk("recording_group"); ok { - recorder.RecordingGroup = expandConfigRecordingGroup(g.([]interface{})) - } - - input := configservice.PutConfigurationRecorderInput{ - ConfigurationRecorder: &recorder, - } - _, err := conn.PutConfigurationRecorder(&input) - if err != nil { - return fmt.Errorf("Creating Configuration Recorder failed: %s", err) - } - - d.SetId(name) - - return resourceAwsConfigConfigurationRecorderRead(d, meta) -} - -func resourceAwsConfigConfigurationRecorderRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - input := configservice.DescribeConfigurationRecordersInput{ - ConfigurationRecorderNames: []*string{aws.String(d.Id())}, - } - out, err := conn.DescribeConfigurationRecorders(&input) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchConfigurationRecorderException" { - log.Printf("[WARN] Configuration Recorder %q is gone (NoSuchConfigurationRecorderException)", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Getting Configuration Recorder failed: %s", err) - } - - numberOfRecorders := len(out.ConfigurationRecorders) - if numberOfRecorders < 1 { - log.Printf("[WARN] Configuration Recorder %q is gone (no recorders found)", d.Id()) - d.SetId("") - return nil - } - - if numberOfRecorders > 1 { - return fmt.Errorf("Expected exactly 1 Configuration Recorder, received %d: %#v", - numberOfRecorders, out.ConfigurationRecorders) - } - - recorder := out.ConfigurationRecorders[0] - - d.Set("name", recorder.Name) - d.Set("role_arn", recorder.RoleARN) - - if recorder.RecordingGroup != nil { - flattened := flattenConfigRecordingGroup(recorder.RecordingGroup) - err = d.Set("recording_group", flattened) - if err != nil { - return fmt.Errorf("Failed to set recording_group: %s", err) - } - } - - return nil -} - -func resourceAwsConfigConfigurationRecorderDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - input := configservice.DeleteConfigurationRecorderInput{ - ConfigurationRecorderName: aws.String(d.Id()), - } - _, err := conn.DeleteConfigurationRecorder(&input) - if err != nil { - return fmt.Errorf("Deleting Configuration Recorder failed: %s", err) - } - - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_configuration_recorder_status.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_configuration_recorder_status.go deleted file mode 100644 index a2ba85b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_configuration_recorder_status.go +++ /dev/null @@ -1,122 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/configservice" -) - -func resourceAwsConfigConfigurationRecorderStatus() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsConfigConfigurationRecorderStatusPut, - Read: resourceAwsConfigConfigurationRecorderStatusRead, - Update: resourceAwsConfigConfigurationRecorderStatusPut, - Delete: resourceAwsConfigConfigurationRecorderStatusDelete, - - Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - d.Set("name", d.Id()) - return []*schema.ResourceData{d}, nil - }, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "is_enabled": { - Type: schema.TypeBool, - Required: true, - }, - }, - } -} - -func resourceAwsConfigConfigurationRecorderStatusPut(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - name := d.Get("name").(string) - d.SetId(name) - - if d.HasChange("is_enabled") { - isEnabled := d.Get("is_enabled").(bool) - if isEnabled { - log.Printf("[DEBUG] Starting AWSConfig Configuration recorder %q", name) - startInput := configservice.StartConfigurationRecorderInput{ - ConfigurationRecorderName: aws.String(name), - } - _, err := conn.StartConfigurationRecorder(&startInput) - if err != nil { - return fmt.Errorf("Failed to start Configuration Recorder: %s", err) - } - } else { - log.Printf("[DEBUG] Stopping AWSConfig Configuration recorder %q", name) - stopInput := configservice.StopConfigurationRecorderInput{ - ConfigurationRecorderName: aws.String(name), - } - _, err := conn.StopConfigurationRecorder(&stopInput) - if err != nil { - return fmt.Errorf("Failed to stop Configuration Recorder: %s", err) - } - } - } - - return resourceAwsConfigConfigurationRecorderStatusRead(d, meta) -} - -func resourceAwsConfigConfigurationRecorderStatusRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - name := d.Id() - statusInput := configservice.DescribeConfigurationRecorderStatusInput{ - ConfigurationRecorderNames: []*string{aws.String(name)}, - } - statusOut, err := conn.DescribeConfigurationRecorderStatus(&statusInput) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NoSuchConfigurationRecorderException" { - log.Printf("[WARN] Configuration Recorder (status) %q is gone (NoSuchConfigurationRecorderException)", name) - d.SetId("") - return nil - } - } - return fmt.Errorf("Failed describing Configuration Recorder %q status: %s", - name, err) - } - - numberOfStatuses := len(statusOut.ConfigurationRecordersStatus) - if numberOfStatuses < 1 { - log.Printf("[WARN] Configuration Recorder (status) %q is gone (no recorders found)", name) - d.SetId("") - return nil - } - - if numberOfStatuses > 1 { - return fmt.Errorf("Expected exactly 1 Configuration Recorder (status), received %d: %#v", - numberOfStatuses, statusOut.ConfigurationRecordersStatus) - } - - d.Set("is_enabled", statusOut.ConfigurationRecordersStatus[0].Recording) - - return nil -} - -func resourceAwsConfigConfigurationRecorderStatusDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - input := configservice.StopConfigurationRecorderInput{ - ConfigurationRecorderName: aws.String(d.Get("name").(string)), - } - _, err := conn.StopConfigurationRecorder(&input) - if err != nil { - return fmt.Errorf("Stopping Configuration Recorder failed: %s", err) - } - - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_delivery_channel.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_delivery_channel.go deleted file mode 100644 index e77836d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_config_delivery_channel.go +++ /dev/null @@ -1,171 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/configservice" -) - -func resourceAwsConfigDeliveryChannel() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsConfigDeliveryChannelPut, - Read: resourceAwsConfigDeliveryChannelRead, - Update: resourceAwsConfigDeliveryChannelPut, - Delete: resourceAwsConfigDeliveryChannelDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - Default: "default", - ValidateFunc: validateMaxLength(256), - }, - "s3_bucket_name": { - Type: schema.TypeString, - Required: true, - }, - "s3_key_prefix": { - Type: schema.TypeString, - Optional: true, - }, - "sns_topic_arn": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateArn, - }, - "snapshot_delivery_properties": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delivery_frequency": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateConfigExecutionFrequency, - }, - }, - }, - }, - }, - } -} - -func resourceAwsConfigDeliveryChannelPut(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - name := d.Get("name").(string) - channel := configservice.DeliveryChannel{ - Name: aws.String(name), - S3BucketName: aws.String(d.Get("s3_bucket_name").(string)), - } - - if v, ok := d.GetOk("s3_key_prefix"); ok { - channel.S3KeyPrefix = aws.String(v.(string)) - } - if v, ok := d.GetOk("sns_topic_arn"); ok { - channel.SnsTopicARN = aws.String(v.(string)) - } - - if p, ok := d.GetOk("snapshot_delivery_properties"); ok { - propertiesBlocks := p.([]interface{}) - block := propertiesBlocks[0].(map[string]interface{}) - - if v, ok := block["delivery_frequency"]; ok { - channel.ConfigSnapshotDeliveryProperties = &configservice.ConfigSnapshotDeliveryProperties{ - DeliveryFrequency: aws.String(v.(string)), - } - } - } - - input := configservice.PutDeliveryChannelInput{DeliveryChannel: &channel} - - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - _, err := conn.PutDeliveryChannel(&input) - if err == nil { - return nil - } - - awsErr, ok := err.(awserr.Error) - if ok && awsErr.Code() == "InsufficientDeliveryPolicyException" { - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - }) - if err != nil { - return fmt.Errorf("Creating Delivery Channel failed: %s", err) - } - - d.SetId(name) - - return resourceAwsConfigDeliveryChannelRead(d, meta) -} - -func resourceAwsConfigDeliveryChannelRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - - input := configservice.DescribeDeliveryChannelsInput{ - DeliveryChannelNames: []*string{aws.String(d.Id())}, - } - out, err := conn.DescribeDeliveryChannels(&input) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NoSuchDeliveryChannelException" { - log.Printf("[WARN] Delivery Channel %q is gone (NoSuchDeliveryChannelException)", d.Id()) - d.SetId("") - return nil - } - } - return fmt.Errorf("Getting Delivery Channel failed: %s", err) - } - - if len(out.DeliveryChannels) < 1 { - log.Printf("[WARN] Delivery Channel %q is gone (no channels found)", d.Id()) - d.SetId("") - return nil - } - - if len(out.DeliveryChannels) > 1 { - return fmt.Errorf("Received %d delivery channels under %s (expected exactly 1): %s", - len(out.DeliveryChannels), d.Id(), out.DeliveryChannels) - } - - channel := out.DeliveryChannels[0] - - d.Set("name", channel.Name) - d.Set("s3_bucket_name", channel.S3BucketName) - d.Set("s3_key_prefix", channel.S3KeyPrefix) - d.Set("sns_topic_arn", channel.SnsTopicARN) - - if channel.ConfigSnapshotDeliveryProperties != nil { - d.Set("snapshot_delivery_properties", flattenConfigSnapshotDeliveryProperties(channel.ConfigSnapshotDeliveryProperties)) - } - - return nil -} - -func resourceAwsConfigDeliveryChannelDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).configconn - input := configservice.DeleteDeliveryChannelInput{ - DeliveryChannelName: aws.String(d.Id()), - } - _, err := conn.DeleteDeliveryChannel(&input) - if err != nil { - return fmt.Errorf("Unable to delete delivery channel: %s", err) - } - - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_customer_gateway.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_customer_gateway.go deleted file mode 100644 index 668f8a8..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_customer_gateway.go +++ /dev/null @@ -1,283 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsCustomerGateway() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsCustomerGatewayCreate, - Read: resourceAwsCustomerGatewayRead, - Update: resourceAwsCustomerGatewayUpdate, - Delete: resourceAwsCustomerGatewayDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "bgp_asn": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - - "ip_address": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsCustomerGatewayCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - ipAddress := d.Get("ip_address").(string) - vpnType := d.Get("type").(string) - bgpAsn := d.Get("bgp_asn").(int) - - alreadyExists, err := resourceAwsCustomerGatewayExists(vpnType, ipAddress, bgpAsn, conn) - if err != nil { - return err - } - - if alreadyExists { - return fmt.Errorf("An existing customer gateway for IpAddress: %s, VpnType: %s, BGP ASN: %d has been found", ipAddress, vpnType, bgpAsn) - } - - createOpts := &ec2.CreateCustomerGatewayInput{ - BgpAsn: aws.Int64(int64(bgpAsn)), - PublicIp: aws.String(ipAddress), - Type: aws.String(vpnType), - } - - // Create the Customer Gateway. - log.Printf("[DEBUG] Creating customer gateway") - resp, err := conn.CreateCustomerGateway(createOpts) - if err != nil { - return fmt.Errorf("Error creating customer gateway: %s", err) - } - - // Store the ID - customerGateway := resp.CustomerGateway - d.SetId(*customerGateway.CustomerGatewayId) - log.Printf("[INFO] Customer gateway ID: %s", *customerGateway.CustomerGatewayId) - - // Wait for the CustomerGateway to be available. - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"available"}, - Refresh: customerGatewayRefreshFunc(conn, *customerGateway.CustomerGatewayId), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, stateErr := stateConf.WaitForState() - if stateErr != nil { - return fmt.Errorf( - "Error waiting for customer gateway (%s) to become ready: %s", - *customerGateway.CustomerGatewayId, err) - } - - // Create tags. - if err := setTags(conn, d); err != nil { - return err - } - - return nil -} - -func customerGatewayRefreshFunc(conn *ec2.EC2, gatewayId string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - gatewayFilter := &ec2.Filter{ - Name: aws.String("customer-gateway-id"), - Values: []*string{aws.String(gatewayId)}, - } - - resp, err := conn.DescribeCustomerGateways(&ec2.DescribeCustomerGatewaysInput{ - Filters: []*ec2.Filter{gatewayFilter}, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidCustomerGatewayID.NotFound" { - resp = nil - } else { - log.Printf("Error on CustomerGatewayRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil || len(resp.CustomerGateways) == 0 { - // handle consistency issues - return nil, "", nil - } - - gateway := resp.CustomerGateways[0] - return gateway, *gateway.State, nil - } -} - -func resourceAwsCustomerGatewayExists(vpnType, ipAddress string, bgpAsn int, conn *ec2.EC2) (bool, error) { - ipAddressFilter := &ec2.Filter{ - Name: aws.String("ip-address"), - Values: []*string{aws.String(ipAddress)}, - } - - typeFilter := &ec2.Filter{ - Name: aws.String("type"), - Values: []*string{aws.String(vpnType)}, - } - - bgp := strconv.Itoa(bgpAsn) - bgpAsnFilter := &ec2.Filter{ - Name: aws.String("bgp-asn"), - Values: []*string{aws.String(bgp)}, - } - - resp, err := conn.DescribeCustomerGateways(&ec2.DescribeCustomerGatewaysInput{ - Filters: []*ec2.Filter{ipAddressFilter, typeFilter, bgpAsnFilter}, - }) - if err != nil { - return false, err - } - - if len(resp.CustomerGateways) > 0 && *resp.CustomerGateways[0].State != "deleted" { - return true, nil - } - - return false, nil -} - -func resourceAwsCustomerGatewayRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - gatewayFilter := &ec2.Filter{ - Name: aws.String("customer-gateway-id"), - Values: []*string{aws.String(d.Id())}, - } - - resp, err := conn.DescribeCustomerGateways(&ec2.DescribeCustomerGatewaysInput{ - Filters: []*ec2.Filter{gatewayFilter}, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidCustomerGatewayID.NotFound" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error finding CustomerGateway: %s", err) - return err - } - } - - if len(resp.CustomerGateways) != 1 { - return fmt.Errorf("[ERROR] Error finding CustomerGateway: %s", d.Id()) - } - - if *resp.CustomerGateways[0].State == "deleted" { - log.Printf("[INFO] Customer Gateway is in `deleted` state: %s", d.Id()) - d.SetId("") - return nil - } - - customerGateway := resp.CustomerGateways[0] - d.Set("ip_address", customerGateway.IpAddress) - d.Set("type", customerGateway.Type) - d.Set("tags", tagsToMap(customerGateway.Tags)) - - if *customerGateway.BgpAsn != "" { - val, err := strconv.ParseInt(*customerGateway.BgpAsn, 0, 0) - if err != nil { - return fmt.Errorf("error parsing bgp_asn: %s", err) - } - - d.Set("bgp_asn", int(val)) - } - - return nil -} - -func resourceAwsCustomerGatewayUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Update tags if required. - if err := setTags(conn, d); err != nil { - return err - } - - d.SetPartial("tags") - - return resourceAwsCustomerGatewayRead(d, meta) -} - -func resourceAwsCustomerGatewayDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - _, err := conn.DeleteCustomerGateway(&ec2.DeleteCustomerGatewayInput{ - CustomerGatewayId: aws.String(d.Id()), - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidCustomerGatewayID.NotFound" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error deleting CustomerGateway: %s", err) - return err - } - } - - gatewayFilter := &ec2.Filter{ - Name: aws.String("customer-gateway-id"), - Values: []*string{aws.String(d.Id())}, - } - - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - resp, err := conn.DescribeCustomerGateways(&ec2.DescribeCustomerGatewaysInput{ - Filters: []*ec2.Filter{gatewayFilter}, - }) - - if err != nil { - if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "InvalidCustomerGatewayID.NotFound" { - return nil - } - return resource.NonRetryableError(err) - } - - if len(resp.CustomerGateways) != 1 { - return resource.RetryableError(fmt.Errorf("[ERROR] Error finding CustomerGateway for delete: %s", d.Id())) - } - - switch *resp.CustomerGateways[0].State { - case "pending", "available", "deleting": - return resource.RetryableError(fmt.Errorf("[DEBUG] Gateway (%s) in state (%s), retrying", d.Id(), *resp.CustomerGateways[0].State)) - case "deleted": - return nil - default: - return resource.RetryableError(fmt.Errorf("[DEBUG] Unrecognized state (%s) for Customer Gateway delete on (%s)", *resp.CustomerGateways[0].State, d.Id())) - } - }) - - if err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_event_subscription.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_event_subscription.go deleted file mode 100644 index 9e725ce..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_event_subscription.go +++ /dev/null @@ -1,385 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDbEventSubscription() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDbEventSubscriptionCreate, - Read: resourceAwsDbEventSubscriptionRead, - Update: resourceAwsDbEventSubscriptionUpdate, - Delete: resourceAwsDbEventSubscriptionDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsDbEventSubscriptionImport, - }, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateDbEventSubscriptionName, - }, - "sns_topic": { - Type: schema.TypeString, - Required: true, - }, - "event_categories": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "source_ids": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - // ValidateFunc: validateDbEventSubscriptionSourceIds, - // requires source_type to be set, does not seem to be a way to validate this - }, - "source_type": { - Type: schema.TypeString, - Optional: true, - }, - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "customer_aws_id": { - Type: schema.TypeString, - Computed: true, - }, - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDbEventSubscriptionCreate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - name := d.Get("name").(string) - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - sourceIdsSet := d.Get("source_ids").(*schema.Set) - sourceIds := make([]*string, sourceIdsSet.Len()) - for i, sourceId := range sourceIdsSet.List() { - sourceIds[i] = aws.String(sourceId.(string)) - } - - eventCategoriesSet := d.Get("event_categories").(*schema.Set) - eventCategories := make([]*string, eventCategoriesSet.Len()) - for i, eventCategory := range eventCategoriesSet.List() { - eventCategories[i] = aws.String(eventCategory.(string)) - } - - request := &rds.CreateEventSubscriptionInput{ - SubscriptionName: aws.String(name), - SnsTopicArn: aws.String(d.Get("sns_topic").(string)), - Enabled: aws.Bool(d.Get("enabled").(bool)), - SourceIds: sourceIds, - SourceType: aws.String(d.Get("source_type").(string)), - EventCategories: eventCategories, - Tags: tags, - } - - log.Println("[DEBUG] Create RDS Event Subscription:", request) - - _, err := rdsconn.CreateEventSubscription(request) - if err != nil { - return fmt.Errorf("Error creating RDS Event Subscription %s: %s", name, err) - } - - log.Println( - "[INFO] Waiting for RDS Event Subscription to be ready") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating"}, - Target: []string{"active"}, - Refresh: resourceAwsDbEventSubscriptionRefreshFunc(d, meta.(*AWSClient).rdsconn), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - // Wait, catching any errors - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Creating RDS Event Subscription %s failed: %s", d.Id(), err) - } - - return resourceAwsDbEventSubscriptionRead(d, meta) -} - -func resourceAwsDbEventSubscriptionRead(d *schema.ResourceData, meta interface{}) error { - sub, err := resourceAwsDbEventSubscriptionRetrieve(d.Get("name").(string), meta.(*AWSClient).rdsconn) - if err != nil { - return fmt.Errorf("Error retrieving RDS Event Subscription %s: %s", d.Id(), err) - } - if sub == nil { - d.SetId("") - return nil - } - - d.SetId(*sub.CustSubscriptionId) - if err := d.Set("name", sub.CustSubscriptionId); err != nil { - return err - } - if err := d.Set("sns_topic", sub.SnsTopicArn); err != nil { - return err - } - if err := d.Set("source_type", sub.SourceType); err != nil { - return err - } - if err := d.Set("enabled", sub.Enabled); err != nil { - return err - } - if err := d.Set("source_ids", flattenStringList(sub.SourceIdsList)); err != nil { - return err - } - if err := d.Set("event_categories", flattenStringList(sub.EventCategoriesList)); err != nil { - return err - } - if err := d.Set("customer_aws_id", sub.CustomerAwsId); err != nil { - return err - } - - // list tags for resource - // set tags - conn := meta.(*AWSClient).rdsconn - if arn, err := buildRDSEventSubscriptionARN(d.Get("customer_aws_id").(string), d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).region); err != nil { - log.Printf("[DEBUG] Error building ARN for RDS Event Subscription, not setting Tags for Event Subscription %s", *sub.CustSubscriptionId) - } else { - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) - } - - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - d.Set("tags", tagsToMapRDS(dt)) - } - - return nil -} - -func resourceAwsDbEventSubscriptionRetrieve( - name string, rdsconn *rds.RDS) (*rds.EventSubscription, error) { - - request := &rds.DescribeEventSubscriptionsInput{ - SubscriptionName: aws.String(name), - } - - describeResp, err := rdsconn.DescribeEventSubscriptions(request) - if err != nil { - if rdserr, ok := err.(awserr.Error); ok && rdserr.Code() == "SubscriptionNotFound" { - log.Printf("[WARN] No RDS Event Subscription by name (%s) found", name) - return nil, nil - } - return nil, fmt.Errorf("Error reading RDS Event Subscription %s: %s", name, err) - } - - if len(describeResp.EventSubscriptionsList) != 1 { - return nil, fmt.Errorf("Unable to find RDS Event Subscription: %#v", describeResp.EventSubscriptionsList) - } - - return describeResp.EventSubscriptionsList[0], nil -} - -func resourceAwsDbEventSubscriptionUpdate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - - d.Partial(true) - requestUpdate := false - - req := &rds.ModifyEventSubscriptionInput{ - SubscriptionName: aws.String(d.Id()), - } - - if d.HasChange("event_categories") { - eventCategoriesSet := d.Get("event_categories").(*schema.Set) - req.EventCategories = make([]*string, eventCategoriesSet.Len()) - for i, eventCategory := range eventCategoriesSet.List() { - req.EventCategories[i] = aws.String(eventCategory.(string)) - } - requestUpdate = true - } - - if d.HasChange("enabled") { - req.Enabled = aws.Bool(d.Get("enabled").(bool)) - requestUpdate = true - } - - if d.HasChange("sns_topic") { - req.SnsTopicArn = aws.String(d.Get("sns_topic").(string)) - requestUpdate = true - } - - if d.HasChange("source_type") { - req.SourceType = aws.String(d.Get("source_type").(string)) - requestUpdate = true - } - - log.Printf("[DEBUG] Send RDS Event Subscription modification request: %#v", requestUpdate) - if requestUpdate { - log.Printf("[DEBUG] RDS Event Subscription modification request: %#v", req) - _, err := rdsconn.ModifyEventSubscription(req) - if err != nil { - return fmt.Errorf("Modifying RDS Event Subscription %s failed: %s", d.Id(), err) - } - - log.Println( - "[INFO] Waiting for RDS Event Subscription modification to finish") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"modifying"}, - Target: []string{"active"}, - Refresh: resourceAwsDbEventSubscriptionRefreshFunc(d, meta.(*AWSClient).rdsconn), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - // Wait, catching any errors - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Modifying RDS Event Subscription %s failed: %s", d.Id(), err) - } - d.SetPartial("event_categories") - d.SetPartial("enabled") - d.SetPartial("sns_topic") - d.SetPartial("source_type") - } - - if arn, err := buildRDSEventSubscriptionARN(d.Get("customer_aws_id").(string), d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(rdsconn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - - if d.HasChange("source_ids") { - o, n := d.GetChange("source_ids") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := expandStringList(os.Difference(ns).List()) - add := expandStringList(ns.Difference(os).List()) - - if len(remove) > 0 { - for _, removing := range remove { - log.Printf("[INFO] Removing %s as a Source Identifier from %q", *removing, d.Id()) - _, err := rdsconn.RemoveSourceIdentifierFromSubscription(&rds.RemoveSourceIdentifierFromSubscriptionInput{ - SourceIdentifier: removing, - SubscriptionName: aws.String(d.Id()), - }) - if err != nil { - return err - } - } - } - - if len(add) > 0 { - for _, adding := range add { - log.Printf("[INFO] Adding %s as a Source Identifier to %q", *adding, d.Id()) - _, err := rdsconn.AddSourceIdentifierToSubscription(&rds.AddSourceIdentifierToSubscriptionInput{ - SourceIdentifier: adding, - SubscriptionName: aws.String(d.Id()), - }) - if err != nil { - return err - } - } - } - d.SetPartial("source_ids") - } - - d.Partial(false) - - return nil -} - -func resourceAwsDbEventSubscriptionDelete(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - deleteOpts := rds.DeleteEventSubscriptionInput{ - SubscriptionName: aws.String(d.Id()), - } - - if _, err := rdsconn.DeleteEventSubscription(&deleteOpts); err != nil { - rdserr, ok := err.(awserr.Error) - if !ok { - return fmt.Errorf("Error deleting RDS Event Subscription %s: %s", d.Id(), err) - } - - if rdserr.Code() != "DBEventSubscriptionNotFoundFault" { - log.Printf("[WARN] RDS Event Subscription %s missing during delete", d.Id()) - return fmt.Errorf("Error deleting RDS Event Subscription %s: %s", d.Id(), err) - } - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"deleting"}, - Target: []string{}, - Refresh: resourceAwsDbEventSubscriptionRefreshFunc(d, meta.(*AWSClient).rdsconn), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - _, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error deleting RDS Event Subscription %s: %s", d.Id(), err) - } - return err -} - -func resourceAwsDbEventSubscriptionRefreshFunc( - d *schema.ResourceData, - rdsconn *rds.RDS) resource.StateRefreshFunc { - - return func() (interface{}, string, error) { - sub, err := resourceAwsDbEventSubscriptionRetrieve(d.Get("name").(string), rdsconn) - - if err != nil { - log.Printf("Error on retrieving DB Event Subscription when waiting: %s", err) - return nil, "", err - } - - if sub == nil { - return nil, "", nil - } - - if sub.Status != nil { - log.Printf("[DEBUG] DB Event Subscription status for %s: %s", d.Id(), *sub.Status) - } - - return sub, *sub.Status, nil - } -} - -func buildRDSEventSubscriptionARN(customerAwsId, subscriptionId, partition, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS partition") - } - arn := fmt.Sprintf("arn:%s:rds:%s:%s:es:%s", partition, region, customerAwsId, subscriptionId) - return arn, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_instance.go deleted file mode 100644 index e944489..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_instance.go +++ /dev/null @@ -1,1110 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/rds" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDbInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDbInstanceCreate, - Read: resourceAwsDbInstanceRead, - Update: resourceAwsDbInstanceUpdate, - Delete: resourceAwsDbInstanceDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsDbInstanceImport, - }, - - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(40 * time.Minute), - Update: schema.DefaultTimeout(80 * time.Minute), - Delete: schema.DefaultTimeout(40 * time.Minute), - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "username": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - }, - - "engine": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - StateFunc: func(v interface{}) string { - value := v.(string) - return strings.ToLower(value) - }, - }, - - "engine_version": { - Type: schema.TypeString, - Optional: true, - Computed: true, - DiffSuppressFunc: suppressAwsDbEngineVersionDiffs, - }, - - "character_set_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "storage_encrypted": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - }, - - "allocated_storage": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - - "storage_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "identifier": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateRdsId, - }, - - "instance_class": { - Type: schema.TypeString, - Required: true, - }, - - "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "backup_retention_period": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - - "backup_window": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateOnceADayWindowFormat, - }, - - "iops": { - Type: schema.TypeInt, - Optional: true, - }, - - "license_model": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "maintenance_window": { - Type: schema.TypeString, - Optional: true, - Computed: true, - StateFunc: func(v interface{}) string { - if v != nil { - value := v.(string) - return strings.ToLower(value) - } - return "" - }, - ValidateFunc: validateOnceAWeekWindowFormat, - }, - - "multi_az": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "port": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - - "publicly_accessible": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "vpc_security_group_ids": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "security_group_names": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "final_snapshot_identifier": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) { - es = append(es, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - es = append(es, fmt.Errorf("%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - es = append(es, fmt.Errorf("%q cannot end in a hyphen", k)) - } - return - }, - }, - - "skip_final_snapshot": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "copy_tags_to_snapshot": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "db_subnet_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "parameter_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "address": { - Type: schema.TypeString, - Computed: true, - }, - - "endpoint": { - Type: schema.TypeString, - Computed: true, - }, - - "hosted_zone_id": { - Type: schema.TypeString, - Computed: true, - }, - - "status": { - Type: schema.TypeString, - Computed: true, - }, - - // apply_immediately is used to determine when the update modifications - // take place. - // See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html - "apply_immediately": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "replicate_source_db": { - Type: schema.TypeString, - Optional: true, - }, - - "replicas": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "snapshot_identifier": { - Type: schema.TypeString, - Computed: false, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "auto_minor_version_upgrade": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "allow_major_version_upgrade": { - Type: schema.TypeBool, - Computed: false, - Optional: true, - }, - - "monitoring_role_arn": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "monitoring_interval": { - Type: schema.TypeInt, - Optional: true, - Default: 0, - }, - - "option_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "kms_key_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - - "timezone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - identifier := d.Get("identifier").(string) - // Generate a unique ID for the user - if identifier == "" { - identifier = resource.PrefixedUniqueId("tf-") - // SQL Server identifier size is max 15 chars, so truncate - if engine := d.Get("engine").(string); engine != "" { - if strings.Contains(strings.ToLower(engine), "sqlserver") { - identifier = identifier[:15] - } - } - d.Set("identifier", identifier) - } - - if v, ok := d.GetOk("replicate_source_db"); ok { - opts := rds.CreateDBInstanceReadReplicaInput{ - SourceDBInstanceIdentifier: aws.String(v.(string)), - CopyTagsToSnapshot: aws.Bool(d.Get("copy_tags_to_snapshot").(bool)), - DBInstanceClass: aws.String(d.Get("instance_class").(string)), - DBInstanceIdentifier: aws.String(identifier), - PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), - Tags: tags, - } - if attr, ok := d.GetOk("iops"); ok { - opts.Iops = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("port"); ok { - opts.Port = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("availability_zone"); ok { - opts.AvailabilityZone = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("storage_type"); ok { - opts.StorageType = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("db_subnet_group_name"); ok { - opts.DBSubnetGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("monitoring_role_arn"); ok { - opts.MonitoringRoleArn = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("monitoring_interval"); ok { - opts.MonitoringInterval = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("option_group_name"); ok { - opts.OptionGroupName = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] DB Instance Replica create configuration: %#v", opts) - _, err := conn.CreateDBInstanceReadReplica(&opts) - if err != nil { - return fmt.Errorf("Error creating DB Instance: %s", err) - } - } else if _, ok := d.GetOk("snapshot_identifier"); ok { - opts := rds.RestoreDBInstanceFromDBSnapshotInput{ - DBInstanceClass: aws.String(d.Get("instance_class").(string)), - DBInstanceIdentifier: aws.String(d.Get("identifier").(string)), - DBSnapshotIdentifier: aws.String(d.Get("snapshot_identifier").(string)), - AutoMinorVersionUpgrade: aws.Bool(d.Get("auto_minor_version_upgrade").(bool)), - PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), - Tags: tags, - CopyTagsToSnapshot: aws.Bool(d.Get("copy_tags_to_snapshot").(bool)), - } - - if attr, ok := d.GetOk("name"); ok { - opts.DBName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("availability_zone"); ok { - opts.AvailabilityZone = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("db_subnet_group_name"); ok { - opts.DBSubnetGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("engine"); ok { - opts.Engine = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("iops"); ok { - opts.Iops = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("license_model"); ok { - opts.LicenseModel = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("multi_az"); ok { - opts.MultiAZ = aws.Bool(attr.(bool)) - } - - if attr, ok := d.GetOk("option_group_name"); ok { - opts.OptionGroupName = aws.String(attr.(string)) - - } - - if attr, ok := d.GetOk("port"); ok { - opts.Port = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("tde_credential_arn"); ok { - opts.TdeCredentialArn = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("storage_type"); ok { - opts.StorageType = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] DB Instance restore from snapshot configuration: %s", opts) - _, err := conn.RestoreDBInstanceFromDBSnapshot(&opts) - if err != nil { - return fmt.Errorf("Error creating DB Instance: %s", err) - } - - var sgUpdate bool - var passwordUpdate bool - - if _, ok := d.GetOk("password"); ok { - passwordUpdate = true - } - - if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 { - sgUpdate = true - } - if attr := d.Get("security_group_names").(*schema.Set); attr.Len() > 0 { - sgUpdate = true - } - if sgUpdate || passwordUpdate { - log.Printf("[INFO] DB is restoring from snapshot with default security, but custom security should be set, will now update after snapshot is restored!") - - // wait for instance to get up and then modify security - d.SetId(d.Get("identifier").(string)) - - log.Printf("[INFO] DB Instance ID: %s", d.Id()) - - log.Println( - "[INFO] Waiting for DB Instance to be available") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying", "resetting-master-credentials", - "maintenance", "renaming", "rebooting", "upgrading"}, - Target: []string{"available"}, - Refresh: resourceAwsDbInstanceStateRefreshFunc(d, meta), - Timeout: d.Timeout(schema.TimeoutCreate), - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - // Wait, catching any errors - _, err := stateConf.WaitForState() - if err != nil { - return err - } - - err = resourceAwsDbInstanceUpdate(d, meta) - if err != nil { - return err - } - - } - } else { - if _, ok := d.GetOk("allocated_storage"); !ok { - return fmt.Errorf(`provider.aws: aws_db_instance: %s: "allocated_storage": required field is not set`, d.Get("name").(string)) - } - if _, ok := d.GetOk("engine"); !ok { - return fmt.Errorf(`provider.aws: aws_db_instance: %s: "engine": required field is not set`, d.Get("name").(string)) - } - if _, ok := d.GetOk("password"); !ok { - return fmt.Errorf(`provider.aws: aws_db_instance: %s: "password": required field is not set`, d.Get("name").(string)) - } - if _, ok := d.GetOk("username"); !ok { - return fmt.Errorf(`provider.aws: aws_db_instance: %s: "username": required field is not set`, d.Get("name").(string)) - } - opts := rds.CreateDBInstanceInput{ - AllocatedStorage: aws.Int64(int64(d.Get("allocated_storage").(int))), - DBName: aws.String(d.Get("name").(string)), - DBInstanceClass: aws.String(d.Get("instance_class").(string)), - DBInstanceIdentifier: aws.String(d.Get("identifier").(string)), - MasterUsername: aws.String(d.Get("username").(string)), - MasterUserPassword: aws.String(d.Get("password").(string)), - Engine: aws.String(d.Get("engine").(string)), - EngineVersion: aws.String(d.Get("engine_version").(string)), - StorageEncrypted: aws.Bool(d.Get("storage_encrypted").(bool)), - AutoMinorVersionUpgrade: aws.Bool(d.Get("auto_minor_version_upgrade").(bool)), - PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), - Tags: tags, - CopyTagsToSnapshot: aws.Bool(d.Get("copy_tags_to_snapshot").(bool)), - } - - attr := d.Get("backup_retention_period") - opts.BackupRetentionPeriod = aws.Int64(int64(attr.(int))) - if attr, ok := d.GetOk("multi_az"); ok { - opts.MultiAZ = aws.Bool(attr.(bool)) - - } - - if attr, ok := d.GetOk("character_set_name"); ok { - opts.CharacterSetName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("timezone"); ok { - opts.Timezone = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("maintenance_window"); ok { - opts.PreferredMaintenanceWindow = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("backup_window"); ok { - opts.PreferredBackupWindow = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("license_model"); ok { - opts.LicenseModel = aws.String(attr.(string)) - } - if attr, ok := d.GetOk("parameter_group_name"); ok { - opts.DBParameterGroupName = aws.String(attr.(string)) - } - - if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 { - var s []*string - for _, v := range attr.List() { - s = append(s, aws.String(v.(string))) - } - opts.VpcSecurityGroupIds = s - } - - if attr := d.Get("security_group_names").(*schema.Set); attr.Len() > 0 { - var s []*string - for _, v := range attr.List() { - s = append(s, aws.String(v.(string))) - } - opts.DBSecurityGroups = s - } - if attr, ok := d.GetOk("storage_type"); ok { - opts.StorageType = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("db_subnet_group_name"); ok { - opts.DBSubnetGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("iops"); ok { - opts.Iops = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("port"); ok { - opts.Port = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("availability_zone"); ok { - opts.AvailabilityZone = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("monitoring_role_arn"); ok { - opts.MonitoringRoleArn = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("monitoring_interval"); ok { - opts.MonitoringInterval = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("option_group_name"); ok { - opts.OptionGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("kms_key_id"); ok { - opts.KmsKeyId = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] DB Instance create configuration: %#v", opts) - var err error - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err = conn.CreateDBInstance(&opts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "InvalidParameterValue" && strings.Contains(awsErr.Message(), "ENHANCED_MONITORING") { - return resource.RetryableError(awsErr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return fmt.Errorf("Error creating DB Instance: %s", err) - } - } - - d.SetId(d.Get("identifier").(string)) - - log.Printf("[INFO] DB Instance ID: %s", d.Id()) - - log.Println( - "[INFO] Waiting for DB Instance to be available") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying", "resetting-master-credentials", - "maintenance", "renaming", "rebooting", "upgrading", "configuring-enhanced-monitoring"}, - Target: []string{"available"}, - Refresh: resourceAwsDbInstanceStateRefreshFunc(d, meta), - Timeout: d.Timeout(schema.TimeoutCreate), - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - // Wait, catching any errors - _, err := stateConf.WaitForState() - if err != nil { - return err - } - - return resourceAwsDbInstanceRead(d, meta) -} - -func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error { - v, err := resourceAwsDbInstanceRetrieve(d, meta) - - if err != nil { - return err - } - if v == nil { - d.SetId("") - return nil - } - - d.Set("name", v.DBName) - d.Set("identifier", v.DBInstanceIdentifier) - d.Set("username", v.MasterUsername) - d.Set("engine", v.Engine) - d.Set("engine_version", v.EngineVersion) - d.Set("allocated_storage", v.AllocatedStorage) - d.Set("iops", v.Iops) - d.Set("copy_tags_to_snapshot", v.CopyTagsToSnapshot) - d.Set("auto_minor_version_upgrade", v.AutoMinorVersionUpgrade) - d.Set("storage_type", v.StorageType) - d.Set("instance_class", v.DBInstanceClass) - d.Set("availability_zone", v.AvailabilityZone) - d.Set("backup_retention_period", v.BackupRetentionPeriod) - d.Set("backup_window", v.PreferredBackupWindow) - d.Set("license_model", v.LicenseModel) - d.Set("maintenance_window", v.PreferredMaintenanceWindow) - d.Set("publicly_accessible", v.PubliclyAccessible) - d.Set("multi_az", v.MultiAZ) - d.Set("kms_key_id", v.KmsKeyId) - d.Set("port", v.DbInstancePort) - if v.DBSubnetGroup != nil { - d.Set("db_subnet_group_name", v.DBSubnetGroup.DBSubnetGroupName) - } - - if v.CharacterSetName != nil { - d.Set("character_set_name", v.CharacterSetName) - } - - d.Set("timezone", v.Timezone) - - if len(v.DBParameterGroups) > 0 { - d.Set("parameter_group_name", v.DBParameterGroups[0].DBParameterGroupName) - } - - if v.Endpoint != nil { - d.Set("port", v.Endpoint.Port) - d.Set("address", v.Endpoint.Address) - d.Set("hosted_zone_id", v.Endpoint.HostedZoneId) - if v.Endpoint.Address != nil && v.Endpoint.Port != nil { - d.Set("endpoint", - fmt.Sprintf("%s:%d", *v.Endpoint.Address, *v.Endpoint.Port)) - } - } - - d.Set("status", v.DBInstanceStatus) - d.Set("storage_encrypted", v.StorageEncrypted) - if v.OptionGroupMemberships != nil { - d.Set("option_group_name", v.OptionGroupMemberships[0].OptionGroupName) - } - - if v.MonitoringInterval != nil { - d.Set("monitoring_interval", v.MonitoringInterval) - } - - if v.MonitoringRoleArn != nil { - d.Set("monitoring_role_arn", v.MonitoringRoleArn) - } - - // list tags for resource - // set tags - conn := meta.(*AWSClient).rdsconn - arn, err := buildRDSARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - name := "" - if v.DBName != nil && *v.DBName != "" { - name = *v.DBName - } - log.Printf("[DEBUG] Error building ARN for DB Instance, not setting Tags for DB %s", name) - } else { - d.Set("arn", arn) - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) - } - - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - d.Set("tags", tagsToMapRDS(dt)) - } - - // Create an empty schema.Set to hold all vpc security group ids - ids := &schema.Set{ - F: schema.HashString, - } - for _, v := range v.VpcSecurityGroups { - ids.Add(*v.VpcSecurityGroupId) - } - d.Set("vpc_security_group_ids", ids) - - // Create an empty schema.Set to hold all security group names - sgn := &schema.Set{ - F: schema.HashString, - } - for _, v := range v.DBSecurityGroups { - sgn.Add(*v.DBSecurityGroupName) - } - d.Set("security_group_names", sgn) - - // replica things - - var replicas []string - for _, v := range v.ReadReplicaDBInstanceIdentifiers { - replicas = append(replicas, *v) - } - if err := d.Set("replicas", replicas); err != nil { - return fmt.Errorf("[DEBUG] Error setting replicas attribute: %#v, error: %#v", replicas, err) - } - - d.Set("replicate_source_db", v.ReadReplicaSourceDBInstanceIdentifier) - - return nil -} - -func resourceAwsDbInstanceDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - - log.Printf("[DEBUG] DB Instance destroy: %v", d.Id()) - - opts := rds.DeleteDBInstanceInput{DBInstanceIdentifier: aws.String(d.Id())} - - skipFinalSnapshot := d.Get("skip_final_snapshot").(bool) - opts.SkipFinalSnapshot = aws.Bool(skipFinalSnapshot) - - if skipFinalSnapshot == false { - if name, present := d.GetOk("final_snapshot_identifier"); present { - opts.FinalDBSnapshotIdentifier = aws.String(name.(string)) - } else { - return fmt.Errorf("DB Instance FinalSnapshotIdentifier is required when a final snapshot is required") - } - } - - log.Printf("[DEBUG] DB Instance destroy configuration: %v", opts) - if _, err := conn.DeleteDBInstance(&opts); err != nil { - return err - } - - log.Println( - "[INFO] Waiting for DB Instance to be destroyed") - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", - "modifying", "deleting", "available"}, - Target: []string{}, - Refresh: resourceAwsDbInstanceStateRefreshFunc(d, meta), - Timeout: d.Timeout(schema.TimeoutDelete), - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - if _, err := stateConf.WaitForState(); err != nil { - return err - } - - return nil -} - -func resourceAwsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - - d.Partial(true) - - req := &rds.ModifyDBInstanceInput{ - ApplyImmediately: aws.Bool(d.Get("apply_immediately").(bool)), - DBInstanceIdentifier: aws.String(d.Id()), - } - d.SetPartial("apply_immediately") - - if !d.Get("apply_immediately").(bool) { - log.Println("[INFO] Only settings updating, instance changes will be applied in next maintenance window") - } - - requestUpdate := false - if d.HasChange("allocated_storage") || d.HasChange("iops") { - d.SetPartial("allocated_storage") - d.SetPartial("iops") - req.Iops = aws.Int64(int64(d.Get("iops").(int))) - req.AllocatedStorage = aws.Int64(int64(d.Get("allocated_storage").(int))) - requestUpdate = true - } - if d.HasChange("allow_major_version_upgrade") { - d.SetPartial("allow_major_version_upgrade") - req.AllowMajorVersionUpgrade = aws.Bool(d.Get("allow_major_version_upgrade").(bool)) - requestUpdate = true - } - if d.HasChange("backup_retention_period") { - d.SetPartial("backup_retention_period") - req.BackupRetentionPeriod = aws.Int64(int64(d.Get("backup_retention_period").(int))) - requestUpdate = true - } - if d.HasChange("copy_tags_to_snapshot") { - d.SetPartial("copy_tags_to_snapshot") - req.CopyTagsToSnapshot = aws.Bool(d.Get("copy_tags_to_snapshot").(bool)) - requestUpdate = true - } - if d.HasChange("instance_class") { - d.SetPartial("instance_class") - req.DBInstanceClass = aws.String(d.Get("instance_class").(string)) - requestUpdate = true - } - if d.HasChange("parameter_group_name") { - d.SetPartial("parameter_group_name") - req.DBParameterGroupName = aws.String(d.Get("parameter_group_name").(string)) - requestUpdate = true - } - if d.HasChange("engine_version") { - d.SetPartial("engine_version") - req.EngineVersion = aws.String(d.Get("engine_version").(string)) - req.AllowMajorVersionUpgrade = aws.Bool(d.Get("allow_major_version_upgrade").(bool)) - requestUpdate = true - } - if d.HasChange("backup_window") { - d.SetPartial("backup_window") - req.PreferredBackupWindow = aws.String(d.Get("backup_window").(string)) - requestUpdate = true - } - if d.HasChange("maintenance_window") { - d.SetPartial("maintenance_window") - req.PreferredMaintenanceWindow = aws.String(d.Get("maintenance_window").(string)) - requestUpdate = true - } - if d.HasChange("password") { - d.SetPartial("password") - req.MasterUserPassword = aws.String(d.Get("password").(string)) - requestUpdate = true - } - if d.HasChange("multi_az") { - d.SetPartial("multi_az") - req.MultiAZ = aws.Bool(d.Get("multi_az").(bool)) - requestUpdate = true - } - if d.HasChange("publicly_accessible") { - d.SetPartial("publicly_accessible") - req.PubliclyAccessible = aws.Bool(d.Get("publicly_accessible").(bool)) - requestUpdate = true - } - if d.HasChange("storage_type") { - d.SetPartial("storage_type") - req.StorageType = aws.String(d.Get("storage_type").(string)) - requestUpdate = true - - if *req.StorageType == "io1" { - req.Iops = aws.Int64(int64(d.Get("iops").(int))) - } - } - if d.HasChange("auto_minor_version_upgrade") { - d.SetPartial("auto_minor_version_upgrade") - req.AutoMinorVersionUpgrade = aws.Bool(d.Get("auto_minor_version_upgrade").(bool)) - requestUpdate = true - } - - if d.HasChange("monitoring_role_arn") { - d.SetPartial("monitoring_role_arn") - req.MonitoringRoleArn = aws.String(d.Get("monitoring_role_arn").(string)) - requestUpdate = true - } - - if d.HasChange("monitoring_interval") { - d.SetPartial("monitoring_interval") - req.MonitoringInterval = aws.Int64(int64(d.Get("monitoring_interval").(int))) - requestUpdate = true - } - - if d.HasChange("vpc_security_group_ids") { - if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 { - var s []*string - for _, v := range attr.List() { - s = append(s, aws.String(v.(string))) - } - req.VpcSecurityGroupIds = s - } - requestUpdate = true - } - - if d.HasChange("security_group_names") { - if attr := d.Get("security_group_names").(*schema.Set); attr.Len() > 0 { - var s []*string - for _, v := range attr.List() { - s = append(s, aws.String(v.(string))) - } - req.DBSecurityGroups = s - } - requestUpdate = true - } - - if d.HasChange("option_group_name") { - d.SetPartial("option_group_name") - req.OptionGroupName = aws.String(d.Get("option_group_name").(string)) - requestUpdate = true - } - - if d.HasChange("port") { - d.SetPartial("port") - req.DBPortNumber = aws.Int64(int64(d.Get("port").(int))) - requestUpdate = true - } - if d.HasChange("db_subnet_group_name") && !d.IsNewResource() { - d.SetPartial("db_subnet_group_name") - req.DBSubnetGroupName = aws.String(d.Get("db_subnet_group_name").(string)) - requestUpdate = true - } - - log.Printf("[DEBUG] Send DB Instance Modification request: %t", requestUpdate) - if requestUpdate { - log.Printf("[DEBUG] DB Instance Modification request: %s", req) - _, err := conn.ModifyDBInstance(req) - if err != nil { - return fmt.Errorf("Error modifying DB Instance %s: %s", d.Id(), err) - } - - log.Println("[INFO] Waiting for DB Instance to be available") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying", "resetting-master-credentials", - "maintenance", "renaming", "rebooting", "upgrading", "configuring-enhanced-monitoring", "moving-to-vpc"}, - Target: []string{"available"}, - Refresh: resourceAwsDbInstanceStateRefreshFunc(d, meta), - Timeout: d.Timeout(schema.TimeoutUpdate), - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - // Wait, catching any errors - _, dbStateErr := stateConf.WaitForState() - if dbStateErr != nil { - return dbStateErr - } - } - - // separate request to promote a database - if d.HasChange("replicate_source_db") { - if d.Get("replicate_source_db").(string) == "" { - // promote - opts := rds.PromoteReadReplicaInput{ - DBInstanceIdentifier: aws.String(d.Id()), - } - attr := d.Get("backup_retention_period") - opts.BackupRetentionPeriod = aws.Int64(int64(attr.(int))) - if attr, ok := d.GetOk("backup_window"); ok { - opts.PreferredBackupWindow = aws.String(attr.(string)) - } - _, err := conn.PromoteReadReplica(&opts) - if err != nil { - return fmt.Errorf("Error promoting database: %#v", err) - } - d.Set("replicate_source_db", "") - } else { - return fmt.Errorf("cannot elect new source database for replication") - } - } - - if arn, err := buildRDSARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(conn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - d.Partial(false) - - return resourceAwsDbInstanceRead(d, meta) -} - -// resourceAwsDbInstanceRetrieve fetches DBInstance information from the AWS -// API. It returns an error if there is a communication problem or unexpected -// error with AWS. When the DBInstance is not found, it returns no error and a -// nil pointer. -func resourceAwsDbInstanceRetrieve( - d *schema.ResourceData, meta interface{}) (*rds.DBInstance, error) { - conn := meta.(*AWSClient).rdsconn - - opts := rds.DescribeDBInstancesInput{ - DBInstanceIdentifier: aws.String(d.Id()), - } - - log.Printf("[DEBUG] DB Instance describe configuration: %#v", opts) - - resp, err := conn.DescribeDBInstances(&opts) - if err != nil { - dbinstanceerr, ok := err.(awserr.Error) - if ok && dbinstanceerr.Code() == "DBInstanceNotFound" { - return nil, nil - } - return nil, fmt.Errorf("Error retrieving DB Instances: %s", err) - } - - if len(resp.DBInstances) != 1 || - *resp.DBInstances[0].DBInstanceIdentifier != d.Id() { - if err != nil { - return nil, nil - } - } - - return resp.DBInstances[0], nil -} - -func resourceAwsDbInstanceImport( - d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - // Neither skip_final_snapshot nor final_snapshot_identifier can be fetched - // from any API call, so we need to default skip_final_snapshot to true so - // that final_snapshot_identifier is not required - d.Set("skip_final_snapshot", true) - return []*schema.ResourceData{d}, nil -} - -func resourceAwsDbInstanceStateRefreshFunc( - d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - v, err := resourceAwsDbInstanceRetrieve(d, meta) - - if err != nil { - log.Printf("Error on retrieving DB Instance when waiting: %s", err) - return nil, "", err - } - - if v == nil { - return nil, "", nil - } - - if v.DBInstanceStatus != nil { - log.Printf("[DEBUG] DB Instance status for instance %s: %s", d.Id(), *v.DBInstanceStatus) - } - - return v, *v.DBInstanceStatus, nil - } -} - -func buildRDSARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:rds:%s:%s:db:%s", partition, region, accountid, identifier) - return arn, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_option_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_option_group.go deleted file mode 100644 index 5c68e7b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_option_group.go +++ /dev/null @@ -1,370 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDbOptionGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDbOptionGroupCreate, - Read: resourceAwsDbOptionGroupRead, - Update: resourceAwsDbOptionGroupUpdate, - Delete: resourceAwsDbOptionGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - ValidateFunc: validateDbOptionGroupName, - }, - "engine_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "major_engine_version": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "option_group_description": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "option": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "option_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "option_settings": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "port": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "db_security_group_memberships": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "vpc_security_group_memberships": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - }, - Set: resourceAwsDbOptionHash, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDbOptionGroupCreate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - createOpts := &rds.CreateOptionGroupInput{ - EngineName: aws.String(d.Get("engine_name").(string)), - MajorEngineVersion: aws.String(d.Get("major_engine_version").(string)), - OptionGroupDescription: aws.String(d.Get("option_group_description").(string)), - OptionGroupName: aws.String(d.Get("name").(string)), - Tags: tags, - } - - log.Printf("[DEBUG] Create DB Option Group: %#v", createOpts) - _, err := rdsconn.CreateOptionGroup(createOpts) - if err != nil { - return fmt.Errorf("Error creating DB Option Group: %s", err) - } - - d.SetId(d.Get("name").(string)) - log.Printf("[INFO] DB Option Group ID: %s", d.Id()) - - return resourceAwsDbOptionGroupUpdate(d, meta) -} - -func resourceAwsDbOptionGroupRead(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - params := &rds.DescribeOptionGroupsInput{ - OptionGroupName: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Describe DB Option Group: %#v", params) - options, err := rdsconn.DescribeOptionGroups(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if "OptionGroupNotFoundFault" == awsErr.Code() { - d.SetId("") - log.Printf("[DEBUG] DB Option Group (%s) not found", d.Get("name").(string)) - return nil - } - } - return fmt.Errorf("Error Describing DB Option Group: %s", err) - } - - var option *rds.OptionGroup - for _, ogl := range options.OptionGroupsList { - if *ogl.OptionGroupName == d.Id() { - option = ogl - break - } - } - - if option == nil { - return fmt.Errorf("Unable to find Option Group: %#v", options.OptionGroupsList) - } - - d.Set("name", option.OptionGroupName) - d.Set("major_engine_version", option.MajorEngineVersion) - d.Set("engine_name", option.EngineName) - d.Set("option_group_description", option.OptionGroupDescription) - if len(option.Options) != 0 { - d.Set("option", flattenOptions(option.Options)) - } - - optionGroup := options.OptionGroupsList[0] - arn, err := buildRDSOptionGroupARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - name := "" - if optionGroup.OptionGroupName != nil && *optionGroup.OptionGroupName != "" { - name = *optionGroup.OptionGroupName - } - log.Printf("[DEBUG] Error building ARN for DB Option Group, not setting Tags for Option Group %s", name) - } else { - d.Set("arn", arn) - resp, err := rdsconn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) - } - - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - d.Set("tags", tagsToMapRDS(dt)) - } - - return nil -} - -func optionInList(optionName string, list []*string) bool { - for _, opt := range list { - if *opt == optionName { - return true - } - } - return false -} - -func resourceAwsDbOptionGroupUpdate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - if d.HasChange("option") { - o, n := d.GetChange("option") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - addOptions, addErr := expandOptionConfiguration(ns.Difference(os).List()) - if addErr != nil { - return addErr - } - - addingOptionNames, err := flattenOptionNames(ns.Difference(os).List()) - if err != nil { - return err - } - - removeOptions := []*string{} - opts, err := flattenOptionNames(os.Difference(ns).List()) - if err != nil { - return err - } - - for _, optionName := range opts { - if optionInList(*optionName, addingOptionNames) { - continue - } - removeOptions = append(removeOptions, optionName) - } - - modifyOpts := &rds.ModifyOptionGroupInput{ - OptionGroupName: aws.String(d.Id()), - ApplyImmediately: aws.Bool(true), - } - - if len(addOptions) > 0 { - modifyOpts.OptionsToInclude = addOptions - } - - if len(removeOptions) > 0 { - modifyOpts.OptionsToRemove = removeOptions - } - - log.Printf("[DEBUG] Modify DB Option Group: %s", modifyOpts) - _, err = rdsconn.ModifyOptionGroup(modifyOpts) - if err != nil { - return fmt.Errorf("Error modifying DB Option Group: %s", err) - } - d.SetPartial("option") - - } - - if arn, err := buildRDSOptionGroupARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(rdsconn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - - return resourceAwsDbOptionGroupRead(d, meta) -} - -func resourceAwsDbOptionGroupDelete(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - - deleteOpts := &rds.DeleteOptionGroupInput{ - OptionGroupName: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Delete DB Option Group: %#v", deleteOpts) - ret := resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := rdsconn.DeleteOptionGroup(deleteOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "InvalidOptionGroupStateFault" { - log.Printf("[DEBUG] AWS believes the RDS Option Group is still in use, retrying") - return resource.RetryableError(awsErr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - if ret != nil { - return fmt.Errorf("Error Deleting DB Option Group: %s", ret) - } - return nil -} - -func flattenOptionNames(configured []interface{}) ([]*string, error) { - var optionNames []*string - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - optionNames = append(optionNames, aws.String(data["option_name"].(string))) - } - - return optionNames, nil -} - -func resourceAwsDbOptionHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["option_name"].(string))) - if _, ok := m["port"]; ok { - buf.WriteString(fmt.Sprintf("%d-", m["port"].(int))) - } - - for _, oRaw := range m["option_settings"].(*schema.Set).List() { - o := oRaw.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", o["name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", o["value"].(string))) - } - - for _, vpcRaw := range m["vpc_security_group_memberships"].(*schema.Set).List() { - buf.WriteString(fmt.Sprintf("%s-", vpcRaw.(string))) - } - - for _, sgRaw := range m["db_security_group_memberships"].(*schema.Set).List() { - buf.WriteString(fmt.Sprintf("%s-", sgRaw.(string))) - } - return hashcode.String(buf.String()) -} - -func buildRDSOptionGroupARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct RDS Option Group ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct RDS Option Group ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:rds:%s:%s:og:%s", partition, region, accountid, identifier) - return arn, nil -} - -func validateDbOptionGroupName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[a-z]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter", k)) - } - if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot end with a hyphen", k)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be greater than 255 characters", k)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_parameter_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_parameter_group.go deleted file mode 100644 index b182827..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_parameter_group.go +++ /dev/null @@ -1,291 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "strings" - "time" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/rds" -) - -func resourceAwsDbParameterGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDbParameterGroupCreate, - Read: resourceAwsDbParameterGroupRead, - Update: resourceAwsDbParameterGroupUpdate, - Delete: resourceAwsDbParameterGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - ValidateFunc: validateDbParamGroupName, - }, - "family": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - "parameter": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: false, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "apply_method": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "immediate", - }, - }, - }, - Set: resourceAwsDbParameterHash, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDbParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - createOpts := rds.CreateDBParameterGroupInput{ - DBParameterGroupName: aws.String(d.Get("name").(string)), - DBParameterGroupFamily: aws.String(d.Get("family").(string)), - Description: aws.String(d.Get("description").(string)), - Tags: tags, - } - - log.Printf("[DEBUG] Create DB Parameter Group: %#v", createOpts) - _, err := rdsconn.CreateDBParameterGroup(&createOpts) - if err != nil { - return fmt.Errorf("Error creating DB Parameter Group: %s", err) - } - - d.Partial(true) - d.SetPartial("name") - d.SetPartial("family") - d.SetPartial("description") - d.Partial(false) - - d.SetId(*createOpts.DBParameterGroupName) - log.Printf("[INFO] DB Parameter Group ID: %s", d.Id()) - - return resourceAwsDbParameterGroupUpdate(d, meta) -} - -func resourceAwsDbParameterGroupRead(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - - describeOpts := rds.DescribeDBParameterGroupsInput{ - DBParameterGroupName: aws.String(d.Id()), - } - - describeResp, err := rdsconn.DescribeDBParameterGroups(&describeOpts) - if err != nil { - return err - } - - if len(describeResp.DBParameterGroups) != 1 || - *describeResp.DBParameterGroups[0].DBParameterGroupName != d.Id() { - return fmt.Errorf("Unable to find Parameter Group: %#v", describeResp.DBParameterGroups) - } - - d.Set("name", describeResp.DBParameterGroups[0].DBParameterGroupName) - d.Set("family", describeResp.DBParameterGroups[0].DBParameterGroupFamily) - d.Set("description", describeResp.DBParameterGroups[0].Description) - - // Only include user customized parameters as there's hundreds of system/default ones - describeParametersOpts := rds.DescribeDBParametersInput{ - DBParameterGroupName: aws.String(d.Id()), - Source: aws.String("user"), - } - - describeParametersResp, err := rdsconn.DescribeDBParameters(&describeParametersOpts) - if err != nil { - return err - } - - d.Set("parameter", flattenParameters(describeParametersResp.Parameters)) - - paramGroup := describeResp.DBParameterGroups[0] - arn, err := buildRDSPGARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - name := "" - if paramGroup.DBParameterGroupName != nil && *paramGroup.DBParameterGroupName != "" { - name = *paramGroup.DBParameterGroupName - } - log.Printf("[DEBUG] Error building ARN for DB Parameter Group, not setting Tags for Param Group %s", name) - } else { - d.Set("arn", arn) - resp, err := rdsconn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) - } - - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - d.Set("tags", tagsToMapRDS(dt)) - } - - return nil -} - -func resourceAwsDbParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - - d.Partial(true) - - if d.HasChange("parameter") { - o, n := d.GetChange("parameter") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - // Expand the "parameter" set to aws-sdk-go compat []rds.Parameter - parameters, err := expandParameters(ns.Difference(os).List()) - if err != nil { - return err - } - - if len(parameters) > 0 { - // We can only modify 20 parameters at a time, so walk them until - // we've got them all. - maxParams := 20 - for parameters != nil { - paramsToModify := make([]*rds.Parameter, 0) - if len(parameters) <= maxParams { - paramsToModify, parameters = parameters[:], nil - } else { - paramsToModify, parameters = parameters[:maxParams], parameters[maxParams:] - } - modifyOpts := rds.ModifyDBParameterGroupInput{ - DBParameterGroupName: aws.String(d.Get("name").(string)), - Parameters: paramsToModify, - } - - log.Printf("[DEBUG] Modify DB Parameter Group: %s", modifyOpts) - _, err = rdsconn.ModifyDBParameterGroup(&modifyOpts) - if err != nil { - return fmt.Errorf("Error modifying DB Parameter Group: %s", err) - } - } - d.SetPartial("parameter") - } - } - - if arn, err := buildRDSPGARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(rdsconn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - - d.Partial(false) - - return resourceAwsDbParameterGroupRead(d, meta) -} - -func resourceAwsDbParameterGroupDelete(d *schema.ResourceData, meta interface{}) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"destroyed"}, - Refresh: resourceAwsDbParameterGroupDeleteRefreshFunc(d, meta), - Timeout: 3 * time.Minute, - MinTimeout: 1 * time.Second, - } - _, err := stateConf.WaitForState() - return err -} - -func resourceAwsDbParameterGroupDeleteRefreshFunc( - d *schema.ResourceData, - meta interface{}) resource.StateRefreshFunc { - rdsconn := meta.(*AWSClient).rdsconn - - return func() (interface{}, string, error) { - - deleteOpts := rds.DeleteDBParameterGroupInput{ - DBParameterGroupName: aws.String(d.Id()), - } - - if _, err := rdsconn.DeleteDBParameterGroup(&deleteOpts); err != nil { - rdserr, ok := err.(awserr.Error) - if !ok { - return d, "error", err - } - - if rdserr.Code() != "DBParameterGroupNotFoundFault" { - return d, "error", err - } - } - - return d, "destroyed", nil - } -} - -func resourceAwsDbParameterHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - // Store the value as a lower case string, to match how we store them in flattenParameters - buf.WriteString(fmt.Sprintf("%s-", strings.ToLower(m["value"].(string)))) - - return hashcode.String(buf.String()) -} - -func buildRDSPGARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:rds:%s:%s:pg:%s", partition, region, accountid, identifier) - return arn, nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_security_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_security_group.go deleted file mode 100644 index b9e73f2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_security_group.go +++ /dev/null @@ -1,434 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDbSecurityGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDbSecurityGroupCreate, - Read: resourceAwsDbSecurityGroupRead, - Update: resourceAwsDbSecurityGroupUpdate, - Delete: resourceAwsDbSecurityGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - - "ingress": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cidr": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "security_group_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "security_group_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "security_group_owner_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - }, - Set: resourceAwsDbSecurityGroupIngressHash, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDbSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - var err error - var errs []error - - opts := rds.CreateDBSecurityGroupInput{ - DBSecurityGroupName: aws.String(d.Get("name").(string)), - DBSecurityGroupDescription: aws.String(d.Get("description").(string)), - Tags: tags, - } - - log.Printf("[DEBUG] DB Security Group create configuration: %#v", opts) - _, err = conn.CreateDBSecurityGroup(&opts) - if err != nil { - return fmt.Errorf("Error creating DB Security Group: %s", err) - } - - d.SetId(d.Get("name").(string)) - - log.Printf("[INFO] DB Security Group ID: %s", d.Id()) - - sg, err := resourceAwsDbSecurityGroupRetrieve(d, meta) - if err != nil { - return err - } - - ingresses := d.Get("ingress").(*schema.Set) - for _, ing := range ingresses.List() { - err := resourceAwsDbSecurityGroupAuthorizeRule(ing, *sg.DBSecurityGroupName, conn) - if err != nil { - errs = append(errs, err) - } - } - - if len(errs) > 0 { - return &multierror.Error{Errors: errs} - } - - log.Println( - "[INFO] Waiting for Ingress Authorizations to be authorized") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"authorizing"}, - Target: []string{"authorized"}, - Refresh: resourceAwsDbSecurityGroupStateRefreshFunc(d, meta), - Timeout: 10 * time.Minute, - } - - // Wait, catching any errors - _, err = stateConf.WaitForState() - if err != nil { - return err - } - - return resourceAwsDbSecurityGroupRead(d, meta) -} - -func resourceAwsDbSecurityGroupRead(d *schema.ResourceData, meta interface{}) error { - sg, err := resourceAwsDbSecurityGroupRetrieve(d, meta) - if err != nil { - return err - } - - d.Set("name", *sg.DBSecurityGroupName) - d.Set("description", *sg.DBSecurityGroupDescription) - - // Create an empty schema.Set to hold all ingress rules - rules := &schema.Set{ - F: resourceAwsDbSecurityGroupIngressHash, - } - - for _, v := range sg.IPRanges { - rule := map[string]interface{}{"cidr": *v.CIDRIP} - rules.Add(rule) - } - - for _, g := range sg.EC2SecurityGroups { - rule := map[string]interface{}{} - if g.EC2SecurityGroupId != nil { - rule["security_group_id"] = *g.EC2SecurityGroupId - } - if g.EC2SecurityGroupName != nil { - rule["security_group_name"] = *g.EC2SecurityGroupName - } - if g.EC2SecurityGroupOwnerId != nil { - rule["security_group_owner_id"] = *g.EC2SecurityGroupOwnerId - } - rules.Add(rule) - } - - d.Set("ingress", rules) - - conn := meta.(*AWSClient).rdsconn - arn, err := buildRDSSecurityGroupARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - name := "" - if sg.DBSecurityGroupName != nil && *sg.DBSecurityGroupName != "" { - name = *sg.DBSecurityGroupName - } - log.Printf("[DEBUG] Error building ARN for DB Security Group, not setting Tags for DB Security Group %s", name) - } else { - d.Set("arn", arn) - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) - } - - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - d.Set("tags", tagsToMapRDS(dt)) - } - - return nil -} - -func resourceAwsDbSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - - d.Partial(true) - if arn, err := buildRDSSecurityGroupARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(conn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - - if d.HasChange("ingress") { - sg, err := resourceAwsDbSecurityGroupRetrieve(d, meta) - if err != nil { - return err - } - - oi, ni := d.GetChange("ingress") - if oi == nil { - oi = new(schema.Set) - } - if ni == nil { - ni = new(schema.Set) - } - - ois := oi.(*schema.Set) - nis := ni.(*schema.Set) - removeIngress := ois.Difference(nis).List() - newIngress := nis.Difference(ois).List() - - // DELETE old Ingress rules - for _, ing := range removeIngress { - err := resourceAwsDbSecurityGroupRevokeRule(ing, *sg.DBSecurityGroupName, conn) - if err != nil { - return err - } - } - - // ADD new/updated Ingress rules - for _, ing := range newIngress { - err := resourceAwsDbSecurityGroupAuthorizeRule(ing, *sg.DBSecurityGroupName, conn) - if err != nil { - return err - } - } - } - d.Partial(false) - - return resourceAwsDbSecurityGroupRead(d, meta) -} - -func resourceAwsDbSecurityGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - - log.Printf("[DEBUG] DB Security Group destroy: %v", d.Id()) - - opts := rds.DeleteDBSecurityGroupInput{DBSecurityGroupName: aws.String(d.Id())} - - log.Printf("[DEBUG] DB Security Group destroy configuration: %v", opts) - _, err := conn.DeleteDBSecurityGroup(&opts) - - if err != nil { - newerr, ok := err.(awserr.Error) - if ok && newerr.Code() == "InvalidDBSecurityGroup.NotFound" { - return nil - } - return err - } - - return nil -} - -func resourceAwsDbSecurityGroupRetrieve(d *schema.ResourceData, meta interface{}) (*rds.DBSecurityGroup, error) { - conn := meta.(*AWSClient).rdsconn - - opts := rds.DescribeDBSecurityGroupsInput{ - DBSecurityGroupName: aws.String(d.Id()), - } - - log.Printf("[DEBUG] DB Security Group describe configuration: %#v", opts) - - resp, err := conn.DescribeDBSecurityGroups(&opts) - - if err != nil { - return nil, fmt.Errorf("Error retrieving DB Security Groups: %s", err) - } - - if len(resp.DBSecurityGroups) != 1 || - *resp.DBSecurityGroups[0].DBSecurityGroupName != d.Id() { - return nil, fmt.Errorf("Unable to find DB Security Group: %#v", resp.DBSecurityGroups) - } - - return resp.DBSecurityGroups[0], nil -} - -// Authorizes the ingress rule on the db security group -func resourceAwsDbSecurityGroupAuthorizeRule(ingress interface{}, dbSecurityGroupName string, conn *rds.RDS) error { - ing := ingress.(map[string]interface{}) - - opts := rds.AuthorizeDBSecurityGroupIngressInput{ - DBSecurityGroupName: aws.String(dbSecurityGroupName), - } - - if attr, ok := ing["cidr"]; ok && attr != "" { - opts.CIDRIP = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_name"]; ok && attr != "" { - opts.EC2SecurityGroupName = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_id"]; ok && attr != "" { - opts.EC2SecurityGroupId = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_owner_id"]; ok && attr != "" { - opts.EC2SecurityGroupOwnerId = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] Authorize ingress rule configuration: %#v", opts) - - _, err := conn.AuthorizeDBSecurityGroupIngress(&opts) - - if err != nil { - return fmt.Errorf("Error authorizing security group ingress: %s", err) - } - - return nil -} - -// Revokes the ingress rule on the db security group -func resourceAwsDbSecurityGroupRevokeRule(ingress interface{}, dbSecurityGroupName string, conn *rds.RDS) error { - ing := ingress.(map[string]interface{}) - - opts := rds.RevokeDBSecurityGroupIngressInput{ - DBSecurityGroupName: aws.String(dbSecurityGroupName), - } - - if attr, ok := ing["cidr"]; ok && attr != "" { - opts.CIDRIP = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_name"]; ok && attr != "" { - opts.EC2SecurityGroupName = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_id"]; ok && attr != "" { - opts.EC2SecurityGroupId = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_owner_id"]; ok && attr != "" { - opts.EC2SecurityGroupOwnerId = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] Revoking ingress rule configuration: %#v", opts) - - _, err := conn.RevokeDBSecurityGroupIngress(&opts) - - if err != nil { - return fmt.Errorf("Error revoking security group ingress: %s", err) - } - - return nil -} - -func resourceAwsDbSecurityGroupIngressHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - if v, ok := m["cidr"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_name"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_owner_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - return hashcode.String(buf.String()) -} - -func resourceAwsDbSecurityGroupStateRefreshFunc( - d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - v, err := resourceAwsDbSecurityGroupRetrieve(d, meta) - - if err != nil { - log.Printf("Error on retrieving DB Security Group when waiting: %s", err) - return nil, "", err - } - - statuses := make([]string, 0, len(v.EC2SecurityGroups)+len(v.IPRanges)) - for _, ec2g := range v.EC2SecurityGroups { - statuses = append(statuses, *ec2g.Status) - } - for _, ips := range v.IPRanges { - statuses = append(statuses, *ips.Status) - } - - for _, stat := range statuses { - // Not done - if stat != "authorized" { - return nil, "authorizing", nil - } - } - - return v, "authorized", nil - } -} - -func buildRDSSecurityGroupARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:rds:%s:%s:secgrp:%s", partition, region, accountid, identifier) - return arn, nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_subnet_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_subnet_group.go deleted file mode 100644 index 9c1c561..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_db_subnet_group.go +++ /dev/null @@ -1,257 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDbSubnetGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDbSubnetGroupCreate, - Read: resourceAwsDbSubnetGroupRead, - Update: resourceAwsDbSubnetGroupUpdate, - Delete: resourceAwsDbSubnetGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - ValidateFunc: validateSubnetGroupName, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "Managed by Terraform", - }, - - "subnet_ids": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDbSubnetGroupCreate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - subnetIdsSet := d.Get("subnet_ids").(*schema.Set) - subnetIds := make([]*string, subnetIdsSet.Len()) - for i, subnetId := range subnetIdsSet.List() { - subnetIds[i] = aws.String(subnetId.(string)) - } - - createOpts := rds.CreateDBSubnetGroupInput{ - DBSubnetGroupName: aws.String(d.Get("name").(string)), - DBSubnetGroupDescription: aws.String(d.Get("description").(string)), - SubnetIds: subnetIds, - Tags: tags, - } - - log.Printf("[DEBUG] Create DB Subnet Group: %#v", createOpts) - _, err := rdsconn.CreateDBSubnetGroup(&createOpts) - if err != nil { - return fmt.Errorf("Error creating DB Subnet Group: %s", err) - } - - d.SetId(*createOpts.DBSubnetGroupName) - log.Printf("[INFO] DB Subnet Group ID: %s", d.Id()) - return resourceAwsDbSubnetGroupRead(d, meta) -} - -func resourceAwsDbSubnetGroupRead(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - - describeOpts := rds.DescribeDBSubnetGroupsInput{ - DBSubnetGroupName: aws.String(d.Id()), - } - - describeResp, err := rdsconn.DescribeDBSubnetGroups(&describeOpts) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "DBSubnetGroupNotFoundFault" { - // Update state to indicate the db subnet no longer exists. - d.SetId("") - return nil - } - return err - } - - if len(describeResp.DBSubnetGroups) == 0 { - return fmt.Errorf("Unable to find DB Subnet Group: %#v", describeResp.DBSubnetGroups) - } - - var subnetGroup *rds.DBSubnetGroup - for _, s := range describeResp.DBSubnetGroups { - // AWS is down casing the name provided, so we compare lower case versions - // of the names. We lower case both our name and their name in the check, - // incase they change that someday. - if strings.ToLower(d.Id()) == strings.ToLower(*s.DBSubnetGroupName) { - subnetGroup = describeResp.DBSubnetGroups[0] - } - } - - if subnetGroup.DBSubnetGroupName == nil { - return fmt.Errorf("Unable to find DB Subnet Group: %#v", describeResp.DBSubnetGroups) - } - - d.Set("name", subnetGroup.DBSubnetGroupName) - d.Set("description", subnetGroup.DBSubnetGroupDescription) - - subnets := make([]string, 0, len(subnetGroup.Subnets)) - for _, s := range subnetGroup.Subnets { - subnets = append(subnets, *s.SubnetIdentifier) - } - d.Set("subnet_ids", subnets) - - // list tags for resource - // set tags - conn := meta.(*AWSClient).rdsconn - arn, err := buildRDSsubgrpARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - log.Printf("[DEBUG] Error building ARN for DB Subnet Group, not setting Tags for group %s", *subnetGroup.DBSubnetGroupName) - } else { - d.Set("arn", arn) - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - log.Printf("[DEBUG] Error retreiving tags for ARN: %s", arn) - } - - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - d.Set("tags", tagsToMapRDS(dt)) - } - - return nil -} - -func resourceAwsDbSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - if d.HasChange("subnet_ids") || d.HasChange("description") { - _, n := d.GetChange("subnet_ids") - if n == nil { - n = new(schema.Set) - } - ns := n.(*schema.Set) - - var sIds []*string - for _, s := range ns.List() { - sIds = append(sIds, aws.String(s.(string))) - } - - _, err := conn.ModifyDBSubnetGroup(&rds.ModifyDBSubnetGroupInput{ - DBSubnetGroupName: aws.String(d.Id()), - DBSubnetGroupDescription: aws.String(d.Get("description").(string)), - SubnetIds: sIds, - }) - - if err != nil { - return err - } - } - - if arn, err := buildRDSsubgrpARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(conn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - - return resourceAwsDbSubnetGroupRead(d, meta) -} - -func resourceAwsDbSubnetGroupDelete(d *schema.ResourceData, meta interface{}) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"destroyed"}, - Refresh: resourceAwsDbSubnetGroupDeleteRefreshFunc(d, meta), - Timeout: 3 * time.Minute, - MinTimeout: 1 * time.Second, - } - _, err := stateConf.WaitForState() - return err -} - -func resourceAwsDbSubnetGroupDeleteRefreshFunc( - d *schema.ResourceData, - meta interface{}) resource.StateRefreshFunc { - rdsconn := meta.(*AWSClient).rdsconn - - return func() (interface{}, string, error) { - - deleteOpts := rds.DeleteDBSubnetGroupInput{ - DBSubnetGroupName: aws.String(d.Id()), - } - - if _, err := rdsconn.DeleteDBSubnetGroup(&deleteOpts); err != nil { - rdserr, ok := err.(awserr.Error) - if !ok { - return d, "error", err - } - - if rdserr.Code() != "DBSubnetGroupNotFoundFault" { - return d, "error", err - } - } - - return d, "destroyed", nil - } -} - -func buildRDSsubgrpARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct RDS ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:rds:%s:%s:subgrp:%s", partition, region, accountid, identifier) - return arn, nil - -} - -func validateSubnetGroupName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[ .0-9a-z-_]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters, hyphens, underscores, periods, and spaces allowed in %q", k)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters", k)) - } - if regexp.MustCompile(`(?i)^default$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q is not allowed as %q", "Default", k)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_network_acl.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_network_acl.go deleted file mode 100644 index 44443e9..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_network_acl.go +++ /dev/null @@ -1,283 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -// ACL Network ACLs all contain an explicit deny-all rule that cannot be -// destroyed or changed by users. This rule is numbered very high to be a -// catch-all. -// See http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html#default-network-acl -const awsDefaultAclRuleNumber = 32767 - -func resourceAwsDefaultNetworkAcl() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDefaultNetworkAclCreate, - // We reuse aws_network_acl's read method, the operations are the same - Read: resourceAwsNetworkAclRead, - Delete: resourceAwsDefaultNetworkAclDelete, - Update: resourceAwsDefaultNetworkAclUpdate, - - Schema: map[string]*schema.Schema{ - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "default_network_acl_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - Computed: false, - }, - // We want explicit management of Subnets here, so we do not allow them to be - // computed. Instead, an empty config will enforce just that; removal of the - // any Subnets that have been assigned to the Default Network ACL. Because we - // can't actually remove them, this will be a continual plan until the - // Subnets are themselves destroyed or reassigned to a different Network - // ACL - "subnet_ids": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - // We want explicit management of Rules here, so we do not allow them to be - // computed. Instead, an empty config will enforce just that; removal of the - // rules - "ingress": &schema.Schema{ - Type: schema.TypeSet, - Required: false, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "from_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "to_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "rule_no": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "action": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "protocol": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "cidr_block": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "icmp_type": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "icmp_code": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - }, - }, - Set: resourceAwsNetworkAclEntryHash, - }, - "egress": &schema.Schema{ - Type: schema.TypeSet, - Required: false, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "from_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "to_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "rule_no": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "action": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "protocol": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "cidr_block": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "icmp_type": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "icmp_code": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - }, - }, - Set: resourceAwsNetworkAclEntryHash, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDefaultNetworkAclCreate(d *schema.ResourceData, meta interface{}) error { - d.SetId(d.Get("default_network_acl_id").(string)) - - // revoke all default and pre-existing rules on the default network acl. - // In the UPDATE method, we'll apply only the rules in the configuration. - log.Printf("[DEBUG] Revoking default ingress and egress rules for Default Network ACL for %s", d.Id()) - err := revokeAllNetworkACLEntries(d.Id(), meta) - if err != nil { - return err - } - - return resourceAwsDefaultNetworkAclUpdate(d, meta) -} - -func resourceAwsDefaultNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - d.Partial(true) - - if d.HasChange("ingress") { - err := updateNetworkAclEntries(d, "ingress", conn) - if err != nil { - return err - } - } - - if d.HasChange("egress") { - err := updateNetworkAclEntries(d, "egress", conn) - if err != nil { - return err - } - } - - if d.HasChange("subnet_ids") { - o, n := d.GetChange("subnet_ids") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - remove := os.Difference(ns).List() - add := ns.Difference(os).List() - - if len(remove) > 0 { - // - // NO-OP - // - // Subnets *must* belong to a Network ACL. Subnets are not "removed" from - // Network ACLs, instead their association is replaced. In a normal - // Network ACL, any removal of a Subnet is done by replacing the - // Subnet/ACL association with an association between the Subnet and the - // Default Network ACL. Because we're managing the default here, we cannot - // do that, so we simply log a NO-OP. In order to remove the Subnet here, - // it must be destroyed, or assigned to different Network ACL. Those - // operations are not handled here - log.Printf("[WARN] Cannot remove subnets from the Default Network ACL. They must be re-assigned or destroyed") - } - - if len(add) > 0 { - for _, a := range add { - association, err := findNetworkAclAssociation(a.(string), conn) - if err != nil { - return fmt.Errorf("Failed to find acl association: acl %s with subnet %s: %s", d.Id(), a, err) - } - log.Printf("[DEBUG] Updating Network Association for Default Network ACL (%s) and Subnet (%s)", d.Id(), a.(string)) - _, err = conn.ReplaceNetworkAclAssociation(&ec2.ReplaceNetworkAclAssociationInput{ - AssociationId: association.NetworkAclAssociationId, - NetworkAclId: aws.String(d.Id()), - }) - if err != nil { - return err - } - } - } - } - - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - d.Partial(false) - // Re-use the exiting Network ACL Resources READ method - return resourceAwsNetworkAclRead(d, meta) -} - -func resourceAwsDefaultNetworkAclDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[WARN] Cannot destroy Default Network ACL. Terraform will remove this resource from the state file, however resources may remain.") - d.SetId("") - return nil -} - -// revokeAllNetworkACLEntries revoke all ingress and egress rules that the Default -// Network ACL currently has -func revokeAllNetworkACLEntries(netaclId string, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeNetworkAcls(&ec2.DescribeNetworkAclsInput{ - NetworkAclIds: []*string{aws.String(netaclId)}, - }) - - if err != nil { - log.Printf("[DEBUG] Error looking up Network ACL: %s", err) - return err - } - - if resp == nil { - return fmt.Errorf("[ERR] Error looking up Default Network ACL Entries: No results") - } - - networkAcl := resp.NetworkAcls[0] - for _, e := range networkAcl.Entries { - // Skip the default rules added by AWS. They can be neither - // configured or deleted by users. See http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html#default-network-acl - if *e.RuleNumber == awsDefaultAclRuleNumber { - continue - } - - // track if this is an egress or ingress rule, for logging purposes - rt := "ingress" - if *e.Egress == true { - rt = "egress" - } - - log.Printf("[DEBUG] Destroying Network ACL (%s) Entry number (%d)", rt, int(*e.RuleNumber)) - _, err := conn.DeleteNetworkAclEntry(&ec2.DeleteNetworkAclEntryInput{ - NetworkAclId: aws.String(netaclId), - RuleNumber: e.RuleNumber, - Egress: e.Egress, - }) - if err != nil { - return fmt.Errorf("Error deleting entry (%s): %s", e, err) - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_route_table.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_route_table.go deleted file mode 100644 index 987dd4a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_route_table.go +++ /dev/null @@ -1,236 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDefaultRouteTable() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDefaultRouteTableCreate, - Read: resourceAwsDefaultRouteTableRead, - Update: resourceAwsRouteTableUpdate, - Delete: resourceAwsDefaultRouteTableDelete, - - Schema: map[string]*schema.Schema{ - "default_route_table_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - - "propagating_vgws": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "route": { - Type: schema.TypeSet, - Computed: true, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cidr_block": { - Type: schema.TypeString, - Optional: true, - }, - - "ipv6_cidr_block": { - Type: schema.TypeString, - Optional: true, - }, - - "egress_only_gateway_id": { - Type: schema.TypeString, - Optional: true, - }, - - "gateway_id": { - Type: schema.TypeString, - Optional: true, - }, - - "instance_id": { - Type: schema.TypeString, - Optional: true, - }, - - "nat_gateway_id": { - Type: schema.TypeString, - Optional: true, - }, - - "vpc_peering_connection_id": { - Type: schema.TypeString, - Optional: true, - }, - - "network_interface_id": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - Set: resourceAwsRouteTableHash, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDefaultRouteTableCreate(d *schema.ResourceData, meta interface{}) error { - d.SetId(d.Get("default_route_table_id").(string)) - - conn := meta.(*AWSClient).ec2conn - rtRaw, _, err := resourceAwsRouteTableStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - if rtRaw == nil { - log.Printf("[WARN] Default Route Table not found") - d.SetId("") - return nil - } - - rt := rtRaw.(*ec2.RouteTable) - - d.Set("vpc_id", rt.VpcId) - - // revoke all default and pre-existing routes on the default route table. - // In the UPDATE method, we'll apply only the rules in the configuration. - log.Printf("[DEBUG] Revoking default routes for Default Route Table for %s", d.Id()) - if err := revokeAllRouteTableRules(d.Id(), meta); err != nil { - return err - } - - return resourceAwsRouteTableUpdate(d, meta) -} - -func resourceAwsDefaultRouteTableRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - // look up default route table for VPC - filter1 := &ec2.Filter{ - Name: aws.String("association.main"), - Values: []*string{aws.String("true")}, - } - filter2 := &ec2.Filter{ - Name: aws.String("vpc-id"), - Values: []*string{aws.String(d.Get("vpc_id").(string))}, - } - - findOpts := &ec2.DescribeRouteTablesInput{ - Filters: []*ec2.Filter{filter1, filter2}, - } - - resp, err := conn.DescribeRouteTables(findOpts) - if err != nil { - return err - } - - if len(resp.RouteTables) < 1 || resp.RouteTables[0] == nil { - return fmt.Errorf("Default Route table not found") - } - - rt := resp.RouteTables[0] - - d.Set("default_route_table_id", rt.RouteTableId) - d.SetId(*rt.RouteTableId) - - // re-use regular AWS Route Table READ. This is an extra API call but saves us - // from trying to manually keep parity - return resourceAwsRouteTableRead(d, meta) -} - -func resourceAwsDefaultRouteTableDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[WARN] Cannot destroy Default Route Table. Terraform will remove this resource from the state file, however resources may remain.") - d.SetId("") - return nil -} - -// revokeAllRouteTableRules revoke all routes on the Default Route Table -// This should only be ran once at creation time of this resource -func revokeAllRouteTableRules(defaultRouteTableId string, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - log.Printf("\n***\nrevokeAllRouteTableRules\n***\n") - - resp, err := conn.DescribeRouteTables(&ec2.DescribeRouteTablesInput{ - RouteTableIds: []*string{aws.String(defaultRouteTableId)}, - }) - if err != nil { - return err - } - - if len(resp.RouteTables) < 1 || resp.RouteTables[0] == nil { - return fmt.Errorf("Default Route table not found") - } - - rt := resp.RouteTables[0] - - // Remove all Gateway association - for _, r := range rt.PropagatingVgws { - log.Printf( - "[INFO] Deleting VGW propagation from %s: %s", - defaultRouteTableId, *r.GatewayId) - _, err := conn.DisableVgwRoutePropagation(&ec2.DisableVgwRoutePropagationInput{ - RouteTableId: aws.String(defaultRouteTableId), - GatewayId: r.GatewayId, - }) - if err != nil { - return err - } - } - - // Delete all routes - for _, r := range rt.Routes { - // you cannot delete the local route - if r.GatewayId != nil && *r.GatewayId == "local" { - continue - } - if r.DestinationPrefixListId != nil { - // Skipping because VPC endpoint routes are handled separately - // See aws_vpc_endpoint - continue - } - - if r.DestinationCidrBlock != nil { - log.Printf( - "[INFO] Deleting route from %s: %s", - defaultRouteTableId, *r.DestinationCidrBlock) - _, err := conn.DeleteRoute(&ec2.DeleteRouteInput{ - RouteTableId: aws.String(defaultRouteTableId), - DestinationCidrBlock: r.DestinationCidrBlock, - }) - if err != nil { - return err - } - } - - if r.DestinationIpv6CidrBlock != nil { - log.Printf( - "[INFO] Deleting route from %s: %s", - defaultRouteTableId, *r.DestinationIpv6CidrBlock) - _, err := conn.DeleteRoute(&ec2.DeleteRouteInput{ - RouteTableId: aws.String(defaultRouteTableId), - DestinationIpv6CidrBlock: r.DestinationIpv6CidrBlock, - }) - if err != nil { - return err - } - } - - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_security_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_security_group.go deleted file mode 100644 index f4fb748..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_default_security_group.go +++ /dev/null @@ -1,149 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDefaultSecurityGroup() *schema.Resource { - // reuse aws_security_group_rule schema, and methods for READ, UPDATE - dsg := resourceAwsSecurityGroup() - dsg.Create = resourceAwsDefaultSecurityGroupCreate - dsg.Delete = resourceAwsDefaultSecurityGroupDelete - - // Descriptions cannot be updated - delete(dsg.Schema, "description") - - // name is a computed value for Default Security Groups and cannot be changed - delete(dsg.Schema, "name_prefix") - dsg.Schema["name"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - - // We want explicit management of Rules here, so we do not allow them to be - // computed. Instead, an empty config will enforce just that; removal of the - // rules - dsg.Schema["ingress"].Computed = false - dsg.Schema["egress"].Computed = false - return dsg -} - -func resourceAwsDefaultSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - securityGroupOpts := &ec2.DescribeSecurityGroupsInput{ - Filters: []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("group-name"), - Values: []*string{aws.String("default")}, - }, - }, - } - - var vpcId string - if v, ok := d.GetOk("vpc_id"); ok { - vpcId = v.(string) - securityGroupOpts.Filters = append(securityGroupOpts.Filters, &ec2.Filter{ - Name: aws.String("vpc-id"), - Values: []*string{aws.String(vpcId)}, - }) - } - - var err error - log.Printf("[DEBUG] Commandeer Default Security Group: %s", securityGroupOpts) - resp, err := conn.DescribeSecurityGroups(securityGroupOpts) - if err != nil { - return fmt.Errorf("Error creating Default Security Group: %s", err) - } - - var g *ec2.SecurityGroup - if vpcId != "" { - // if vpcId contains a value, then we expect just a single Security Group - // returned, as default is a protected name for each VPC, and for each - // Region on EC2 Classic - if len(resp.SecurityGroups) != 1 { - return fmt.Errorf("[ERR] Error finding default security group; found (%d) groups: %s", len(resp.SecurityGroups), resp) - } - g = resp.SecurityGroups[0] - } else { - // we need to filter through any returned security groups for the group - // named "default", and does not belong to a VPC - for _, sg := range resp.SecurityGroups { - if sg.VpcId == nil && *sg.GroupName == "default" { - g = sg - } - } - } - - if g == nil { - return fmt.Errorf("[ERR] Error finding default security group: no matching group found") - } - - d.SetId(*g.GroupId) - - log.Printf("[INFO] Default Security Group ID: %s", d.Id()) - - if err := setTags(conn, d); err != nil { - return err - } - - if err := revokeDefaultSecurityGroupRules(meta, g); err != nil { - return errwrap.Wrapf("{{err}}", err) - } - - return resourceAwsSecurityGroupUpdate(d, meta) -} - -func resourceAwsDefaultSecurityGroupDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[WARN] Cannot destroy Default Security Group. Terraform will remove this resource from the state file, however resources may remain.") - d.SetId("") - return nil -} - -func revokeDefaultSecurityGroupRules(meta interface{}, g *ec2.SecurityGroup) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[WARN] Removing all ingress and egress rules found on Default Security Group (%s)", *g.GroupId) - if len(g.IpPermissionsEgress) > 0 { - req := &ec2.RevokeSecurityGroupEgressInput{ - GroupId: g.GroupId, - IpPermissions: g.IpPermissionsEgress, - } - - log.Printf("[DEBUG] Revoking default egress rules for Default Security Group for %s", *g.GroupId) - if _, err := conn.RevokeSecurityGroupEgress(req); err != nil { - return fmt.Errorf( - "Error revoking default egress rules for Default Security Group (%s): %s", - *g.GroupId, err) - } - } - if len(g.IpPermissions) > 0 { - // a limitation in EC2 Classic is that a call to RevokeSecurityGroupIngress - // cannot contain both the GroupName and the GroupId - for _, p := range g.IpPermissions { - for _, uigp := range p.UserIdGroupPairs { - if uigp.GroupId != nil && uigp.GroupName != nil { - uigp.GroupName = nil - } - } - } - req := &ec2.RevokeSecurityGroupIngressInput{ - GroupId: g.GroupId, - IpPermissions: g.IpPermissions, - } - - log.Printf("[DEBUG] Revoking default ingress rules for Default Security Group for (%s): %s", *g.GroupId, req) - if _, err := conn.RevokeSecurityGroupIngress(req); err != nil { - return fmt.Errorf( - "Error revoking default ingress rules for Default Security Group (%s): %s", - *g.GroupId, err) - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_directory_service_directory.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_directory_service_directory.go deleted file mode 100644 index 773a5af..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_directory_service_directory.go +++ /dev/null @@ -1,489 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/directoryservice" - "github.com/hashicorp/terraform/helper/resource" -) - -var directoryCreationFuncs = map[string]func(*directoryservice.DirectoryService, *schema.ResourceData) (string, error){ - "SimpleAD": createSimpleDirectoryService, - "MicrosoftAD": createActiveDirectoryService, - "ADConnector": createDirectoryConnector, -} - -func resourceAwsDirectoryServiceDirectory() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDirectoryServiceDirectoryCreate, - Read: resourceAwsDirectoryServiceDirectoryRead, - Update: resourceAwsDirectoryServiceDirectoryUpdate, - Delete: resourceAwsDirectoryServiceDirectoryDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "password": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "size": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "alias": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "short_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "vpc_settings": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "subnet_ids": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - }, - }, - "connect_settings": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "customer_username": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "customer_dns_ips": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "subnet_ids": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - }, - }, - "enable_sso": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "access_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "dns_ip_addresses": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Computed: true, - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "SimpleAD", - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - validTypes := []string{"SimpleAD", "MicrosoftAD"} - value := v.(string) - for validType, _ := range directoryCreationFuncs { - if validType == value { - return - } - } - es = append(es, fmt.Errorf("%q must be one of %q", k, validTypes)) - return - }, - }, - }, - } -} - -func buildVpcSettings(d *schema.ResourceData) (vpcSettings *directoryservice.DirectoryVpcSettings, err error) { - if v, ok := d.GetOk("vpc_settings"); !ok { - return nil, fmt.Errorf("vpc_settings is required for type = SimpleAD or MicrosoftAD") - } else { - settings := v.([]interface{}) - - if len(settings) > 1 { - return nil, fmt.Errorf("Only a single vpc_settings block is expected") - } else if len(settings) == 1 { - s := settings[0].(map[string]interface{}) - var subnetIds []*string - for _, id := range s["subnet_ids"].(*schema.Set).List() { - subnetIds = append(subnetIds, aws.String(id.(string))) - } - - vpcSettings = &directoryservice.DirectoryVpcSettings{ - SubnetIds: subnetIds, - VpcId: aws.String(s["vpc_id"].(string)), - } - } - } - - return vpcSettings, nil -} - -func buildConnectSettings(d *schema.ResourceData) (connectSettings *directoryservice.DirectoryConnectSettings, err error) { - if v, ok := d.GetOk("connect_settings"); !ok { - return nil, fmt.Errorf("connect_settings is required for type = ADConnector") - } else { - settings := v.([]interface{}) - - if len(settings) > 1 { - return nil, fmt.Errorf("Only a single connect_settings block is expected") - } else if len(settings) == 1 { - s := settings[0].(map[string]interface{}) - - var subnetIds []*string - for _, id := range s["subnet_ids"].(*schema.Set).List() { - subnetIds = append(subnetIds, aws.String(id.(string))) - } - - var customerDnsIps []*string - for _, id := range s["customer_dns_ips"].(*schema.Set).List() { - customerDnsIps = append(customerDnsIps, aws.String(id.(string))) - } - - connectSettings = &directoryservice.DirectoryConnectSettings{ - CustomerDnsIps: customerDnsIps, - CustomerUserName: aws.String(s["customer_username"].(string)), - SubnetIds: subnetIds, - VpcId: aws.String(s["vpc_id"].(string)), - } - } - } - - return connectSettings, nil -} - -func createDirectoryConnector(dsconn *directoryservice.DirectoryService, d *schema.ResourceData) (directoryId string, err error) { - if _, ok := d.GetOk("size"); !ok { - return "", fmt.Errorf("size is required for type = ADConnector") - } - - input := directoryservice.ConnectDirectoryInput{ - Name: aws.String(d.Get("name").(string)), - Password: aws.String(d.Get("password").(string)), - Size: aws.String(d.Get("size").(string)), - } - - if v, ok := d.GetOk("description"); ok { - input.Description = aws.String(v.(string)) - } - if v, ok := d.GetOk("short_name"); ok { - input.ShortName = aws.String(v.(string)) - } - - input.ConnectSettings, err = buildConnectSettings(d) - if err != nil { - return "", err - } - - log.Printf("[DEBUG] Creating Directory Connector: %s", input) - out, err := dsconn.ConnectDirectory(&input) - if err != nil { - return "", err - } - log.Printf("[DEBUG] Directory Connector created: %s", out) - - return *out.DirectoryId, nil -} - -func createSimpleDirectoryService(dsconn *directoryservice.DirectoryService, d *schema.ResourceData) (directoryId string, err error) { - if _, ok := d.GetOk("size"); !ok { - return "", fmt.Errorf("size is required for type = SimpleAD") - } - - input := directoryservice.CreateDirectoryInput{ - Name: aws.String(d.Get("name").(string)), - Password: aws.String(d.Get("password").(string)), - Size: aws.String(d.Get("size").(string)), - } - - if v, ok := d.GetOk("description"); ok { - input.Description = aws.String(v.(string)) - } - if v, ok := d.GetOk("short_name"); ok { - input.ShortName = aws.String(v.(string)) - } - - input.VpcSettings, err = buildVpcSettings(d) - if err != nil { - return "", err - } - - log.Printf("[DEBUG] Creating Simple Directory Service: %s", input) - out, err := dsconn.CreateDirectory(&input) - if err != nil { - return "", err - } - log.Printf("[DEBUG] Simple Directory Service created: %s", out) - - return *out.DirectoryId, nil -} - -func createActiveDirectoryService(dsconn *directoryservice.DirectoryService, d *schema.ResourceData) (directoryId string, err error) { - input := directoryservice.CreateMicrosoftADInput{ - Name: aws.String(d.Get("name").(string)), - Password: aws.String(d.Get("password").(string)), - } - - if v, ok := d.GetOk("description"); ok { - input.Description = aws.String(v.(string)) - } - if v, ok := d.GetOk("short_name"); ok { - input.ShortName = aws.String(v.(string)) - } - - input.VpcSettings, err = buildVpcSettings(d) - if err != nil { - return "", err - } - - log.Printf("[DEBUG] Creating Microsoft AD Directory Service: %s", input) - out, err := dsconn.CreateMicrosoftAD(&input) - if err != nil { - return "", err - } - log.Printf("[DEBUG] Microsoft AD Directory Service created: %s", out) - - return *out.DirectoryId, nil -} - -func resourceAwsDirectoryServiceDirectoryCreate(d *schema.ResourceData, meta interface{}) error { - dsconn := meta.(*AWSClient).dsconn - - creationFunc, ok := directoryCreationFuncs[d.Get("type").(string)] - if !ok { - // Shouldn't happen as this is validated above - return fmt.Errorf("Unsupported directory type: %s", d.Get("type")) - } - - directoryId, err := creationFunc(dsconn, d) - if err != nil { - return err - } - - d.SetId(directoryId) - - // Wait for creation - log.Printf("[DEBUG] Waiting for DS (%q) to become available", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"Requested", "Creating", "Created"}, - Target: []string{"Active"}, - Refresh: func() (interface{}, string, error) { - resp, err := dsconn.DescribeDirectories(&directoryservice.DescribeDirectoriesInput{ - DirectoryIds: []*string{aws.String(d.Id())}, - }) - if err != nil { - log.Printf("Error during creation of DS: %q", err.Error()) - return nil, "", err - } - - ds := resp.DirectoryDescriptions[0] - log.Printf("[DEBUG] Creation of DS %q is in following stage: %q.", - d.Id(), *ds.Stage) - return ds, *ds.Stage, nil - }, - Timeout: 60 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for Directory Service (%s) to become available: %s", - d.Id(), err) - } - - if v, ok := d.GetOk("alias"); ok { - d.SetPartial("alias") - - input := directoryservice.CreateAliasInput{ - DirectoryId: aws.String(d.Id()), - Alias: aws.String(v.(string)), - } - - log.Printf("[DEBUG] Assigning alias %q to DS directory %q", - v.(string), d.Id()) - out, err := dsconn.CreateAlias(&input) - if err != nil { - return err - } - log.Printf("[DEBUG] Alias %q assigned to DS directory %q", - *out.Alias, *out.DirectoryId) - } - - return resourceAwsDirectoryServiceDirectoryUpdate(d, meta) -} - -func resourceAwsDirectoryServiceDirectoryUpdate(d *schema.ResourceData, meta interface{}) error { - dsconn := meta.(*AWSClient).dsconn - - if d.HasChange("enable_sso") { - d.SetPartial("enable_sso") - var err error - - if v, ok := d.GetOk("enable_sso"); ok && v.(bool) { - log.Printf("[DEBUG] Enabling SSO for DS directory %q", d.Id()) - _, err = dsconn.EnableSso(&directoryservice.EnableSsoInput{ - DirectoryId: aws.String(d.Id()), - }) - } else { - log.Printf("[DEBUG] Disabling SSO for DS directory %q", d.Id()) - _, err = dsconn.DisableSso(&directoryservice.DisableSsoInput{ - DirectoryId: aws.String(d.Id()), - }) - } - - if err != nil { - return err - } - } - - return resourceAwsDirectoryServiceDirectoryRead(d, meta) -} - -func resourceAwsDirectoryServiceDirectoryRead(d *schema.ResourceData, meta interface{}) error { - dsconn := meta.(*AWSClient).dsconn - - input := directoryservice.DescribeDirectoriesInput{ - DirectoryIds: []*string{aws.String(d.Id())}, - } - out, err := dsconn.DescribeDirectories(&input) - if err != nil { - return err - - } - - if len(out.DirectoryDescriptions) == 0 { - log.Printf("[WARN] Directory %s not found", d.Id()) - d.SetId("") - return nil - } - - dir := out.DirectoryDescriptions[0] - log.Printf("[DEBUG] Received DS directory: %s", dir) - - d.Set("access_url", *dir.AccessUrl) - d.Set("alias", *dir.Alias) - if dir.Description != nil { - d.Set("description", *dir.Description) - } - - if *dir.Type == "ADConnector" { - d.Set("dns_ip_addresses", schema.NewSet(schema.HashString, flattenStringList(dir.ConnectSettings.ConnectIps))) - } else { - d.Set("dns_ip_addresses", schema.NewSet(schema.HashString, flattenStringList(dir.DnsIpAddrs))) - } - d.Set("name", *dir.Name) - if dir.ShortName != nil { - d.Set("short_name", *dir.ShortName) - } - if dir.Size != nil { - d.Set("size", *dir.Size) - } - d.Set("type", *dir.Type) - d.Set("vpc_settings", flattenDSVpcSettings(dir.VpcSettings)) - d.Set("connect_settings", flattenDSConnectSettings(dir.DnsIpAddrs, dir.ConnectSettings)) - d.Set("enable_sso", *dir.SsoEnabled) - - return nil -} - -func resourceAwsDirectoryServiceDirectoryDelete(d *schema.ResourceData, meta interface{}) error { - dsconn := meta.(*AWSClient).dsconn - - input := directoryservice.DeleteDirectoryInput{ - DirectoryId: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Delete Directory input: %s", input) - _, err := dsconn.DeleteDirectory(&input) - if err != nil { - return err - } - - // Wait for deletion - log.Printf("[DEBUG] Waiting for DS (%q) to be deleted", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"Deleting"}, - Target: []string{"Deleted"}, - Refresh: func() (interface{}, string, error) { - resp, err := dsconn.DescribeDirectories(&directoryservice.DescribeDirectoriesInput{ - DirectoryIds: []*string{aws.String(d.Id())}, - }) - if err != nil { - if dserr, ok := err.(awserr.Error); ok && dserr.Code() == "EntityDoesNotExistException" { - return 42, "Deleted", nil - } - return nil, "error", err - } - - if len(resp.DirectoryDescriptions) == 0 { - return 42, "Deleted", nil - } - - ds := resp.DirectoryDescriptions[0] - log.Printf("[DEBUG] Deletion of DS %q is in following stage: %q.", - d.Id(), *ds.Stage) - return ds, *ds.Stage, nil - }, - Timeout: 60 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for Directory Service (%s) to be deleted: %q", - d.Id(), err.Error()) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_certificate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_certificate.go deleted file mode 100644 index 8fd3f9f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_certificate.go +++ /dev/null @@ -1,138 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDmsCertificate() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDmsCertificateCreate, - Read: resourceAwsDmsCertificateRead, - Delete: resourceAwsDmsCertificateDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "certificate_arn": { - Type: schema.TypeString, - Computed: true, - }, - "certificate_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateDmsCertificateId, - }, - "certificate_pem": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Sensitive: true, - }, - "certificate_wallet": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Sensitive: true, - }, - }, - } -} - -func resourceAwsDmsCertificateCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.ImportCertificateInput{ - CertificateIdentifier: aws.String(d.Get("certificate_id").(string)), - } - - pem, pemSet := d.GetOk("certificate_pem") - wallet, walletSet := d.GetOk("certificate_wallet") - - if !pemSet && !walletSet { - return fmt.Errorf("Must set either certificate_pem and certificate_wallet.") - } - if pemSet && walletSet { - return fmt.Errorf("Cannot set both certificate_pem and certificate_wallet.") - } - - if pemSet { - request.CertificatePem = aws.String(pem.(string)) - } - if walletSet { - request.CertificateWallet = []byte(wallet.(string)) - } - - log.Println("[DEBUG] DMS import certificate:", request) - - _, err := conn.ImportCertificate(request) - if err != nil { - return err - } - - d.SetId(d.Get("certificate_id").(string)) - return resourceAwsDmsCertificateRead(d, meta) -} - -func resourceAwsDmsCertificateRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - response, err := conn.DescribeCertificates(&dms.DescribeCertificatesInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("certificate-id"), - Values: []*string{aws.String(d.Id())}, // Must use d.Id() to work with import. - }, - }, - }) - if err != nil { - if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { - d.SetId("") - return nil - } - return err - } - - return resourceAwsDmsCertificateSetState(d, response.Certificates[0]) -} - -func resourceAwsDmsCertificateDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.DeleteCertificateInput{ - CertificateArn: aws.String(d.Get("certificate_arn").(string)), - } - - log.Printf("[DEBUG] DMS delete certificate: %#v", request) - - _, err := conn.DeleteCertificate(request) - if err != nil { - return err - } - - return nil -} - -func resourceAwsDmsCertificateSetState(d *schema.ResourceData, cert *dms.Certificate) error { - d.SetId(*cert.CertificateIdentifier) - - d.Set("certificate_id", cert.CertificateIdentifier) - d.Set("certificate_arn", cert.CertificateArn) - - if cert.CertificatePem != nil && *cert.CertificatePem != "" { - d.Set("certificate_pem", cert.CertificatePem) - } - if cert.CertificateWallet != nil && len(cert.CertificateWallet) == 0 { - d.Set("certificate_wallet", cert.CertificateWallet) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_endpoint.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_endpoint.go deleted file mode 100644 index 07cd7a2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_endpoint.go +++ /dev/null @@ -1,345 +0,0 @@ -package aws - -import ( - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/private/waiter" - dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" -) - -func resourceAwsDmsEndpoint() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDmsEndpointCreate, - Read: resourceAwsDmsEndpointRead, - Update: resourceAwsDmsEndpointUpdate, - Delete: resourceAwsDmsEndpointDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "certificate_arn": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ValidateFunc: validateArn, - }, - "database_name": { - Type: schema.TypeString, - Optional: true, - }, - "endpoint_arn": { - Type: schema.TypeString, - Computed: true, - }, - "endpoint_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateDmsEndpointId, - }, - "endpoint_type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "source", - "target", - }, false), - }, - "engine_name": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "mysql", - "oracle", - "postgres", - "mariadb", - "aurora", - "redshift", - "sybase", - "sqlserver", - }, false), - }, - "extra_connection_attributes": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - "kms_key_arn": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - "password": { - Type: schema.TypeString, - Required: true, - Sensitive: true, - }, - "port": { - Type: schema.TypeInt, - Required: true, - }, - "server_name": { - Type: schema.TypeString, - Required: true, - }, - "ssl_mode": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "none", - "require", - "verify-ca", - "verify-full", - }, false), - }, - "tags": { - Type: schema.TypeMap, - Optional: true, - }, - "username": { - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsDmsEndpointCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.CreateEndpointInput{ - EndpointIdentifier: aws.String(d.Get("endpoint_id").(string)), - EndpointType: aws.String(d.Get("endpoint_type").(string)), - EngineName: aws.String(d.Get("engine_name").(string)), - Password: aws.String(d.Get("password").(string)), - Port: aws.Int64(int64(d.Get("port").(int))), - ServerName: aws.String(d.Get("server_name").(string)), - Tags: dmsTagsFromMap(d.Get("tags").(map[string]interface{})), - Username: aws.String(d.Get("username").(string)), - } - - if v, ok := d.GetOk("database_name"); ok { - request.DatabaseName = aws.String(v.(string)) - } - if v, ok := d.GetOk("certificate_arn"); ok { - request.CertificateArn = aws.String(v.(string)) - } - if v, ok := d.GetOk("extra_connection_attributes"); ok { - request.ExtraConnectionAttributes = aws.String(v.(string)) - } - if v, ok := d.GetOk("kms_key_arn"); ok { - request.KmsKeyId = aws.String(v.(string)) - } - if v, ok := d.GetOk("ssl_mode"); ok { - request.SslMode = aws.String(v.(string)) - } - - log.Println("[DEBUG] DMS create endpoint:", request) - - _, err := conn.CreateEndpoint(request) - if err != nil { - return err - } - - d.SetId(d.Get("endpoint_id").(string)) - return resourceAwsDmsEndpointRead(d, meta) -} - -func resourceAwsDmsEndpointRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - response, err := conn.DescribeEndpoints(&dms.DescribeEndpointsInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("endpoint-id"), - Values: []*string{aws.String(d.Id())}, // Must use d.Id() to work with import. - }, - }, - }) - if err != nil { - if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { - d.SetId("") - return nil - } - return err - } - - err = resourceAwsDmsEndpointSetState(d, response.Endpoints[0]) - if err != nil { - return err - } - - tagsResp, err := conn.ListTagsForResource(&dms.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("endpoint_arn").(string)), - }) - if err != nil { - return err - } - d.Set("tags", dmsTagsToMap(tagsResp.TagList)) - - return nil -} - -func resourceAwsDmsEndpointUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.ModifyEndpointInput{ - EndpointArn: aws.String(d.Get("endpoint_arn").(string)), - } - hasChanges := false - - if d.HasChange("certificate_arn") { - request.CertificateArn = aws.String(d.Get("certificate_arn").(string)) - hasChanges = true - } - - if d.HasChange("database_name") { - request.DatabaseName = aws.String(d.Get("database_name").(string)) - hasChanges = true - } - - if d.HasChange("endpoint_type") { - request.EndpointType = aws.String(d.Get("endpoint_type").(string)) - hasChanges = true - } - - if d.HasChange("engine_name") { - request.EngineName = aws.String(d.Get("engine_name").(string)) - hasChanges = true - } - - if d.HasChange("extra_connection_attributes") { - request.ExtraConnectionAttributes = aws.String(d.Get("extra_connection_attributes").(string)) - hasChanges = true - } - - if d.HasChange("password") { - request.Password = aws.String(d.Get("password").(string)) - hasChanges = true - } - - if d.HasChange("port") { - request.Port = aws.Int64(int64(d.Get("port").(int))) - hasChanges = true - } - - if d.HasChange("server_name") { - request.ServerName = aws.String(d.Get("server_name").(string)) - hasChanges = true - } - - if d.HasChange("ssl_mode") { - request.SslMode = aws.String(d.Get("ssl_mode").(string)) - hasChanges = true - } - - if d.HasChange("username") { - request.Username = aws.String(d.Get("username").(string)) - hasChanges = true - } - - if d.HasChange("tags") { - err := dmsSetTags(d.Get("endpoint_arn").(string), d, meta) - if err != nil { - return err - } - } - - if hasChanges { - log.Println("[DEBUG] DMS update endpoint:", request) - - _, err := conn.ModifyEndpoint(request) - if err != nil { - return err - } - - return resourceAwsDmsEndpointRead(d, meta) - } - - return nil -} - -func resourceAwsDmsEndpointDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.DeleteEndpointInput{ - EndpointArn: aws.String(d.Get("endpoint_arn").(string)), - } - - log.Printf("[DEBUG] DMS delete endpoint: %#v", request) - - _, err := conn.DeleteEndpoint(request) - if err != nil { - return err - } - - waitErr := waitForEndpointDelete(conn, d.Get("endpoint_id").(string), 30, 20) - if waitErr != nil { - return waitErr - } - - return nil -} - -func resourceAwsDmsEndpointSetState(d *schema.ResourceData, endpoint *dms.Endpoint) error { - d.SetId(*endpoint.EndpointIdentifier) - - d.Set("certificate_arn", endpoint.CertificateArn) - d.Set("database_name", endpoint.DatabaseName) - d.Set("endpoint_arn", endpoint.EndpointArn) - d.Set("endpoint_id", endpoint.EndpointIdentifier) - // For some reason the AWS API only accepts lowercase type but returns it as uppercase - d.Set("endpoint_type", strings.ToLower(*endpoint.EndpointType)) - d.Set("engine_name", endpoint.EngineName) - d.Set("extra_connection_attributes", endpoint.ExtraConnectionAttributes) - d.Set("kms_key_arn", endpoint.KmsKeyId) - d.Set("port", endpoint.Port) - d.Set("server_name", endpoint.ServerName) - d.Set("ssl_mode", endpoint.SslMode) - d.Set("username", endpoint.Username) - - return nil -} - -func waitForEndpointDelete(client *dms.DatabaseMigrationService, endpointId string, delay int, maxAttempts int) error { - input := &dms.DescribeEndpointsInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("endpoint-id"), - Values: []*string{aws.String(endpointId)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeEndpoints", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(Endpoints[]) > `0`", - Expected: false, - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_instance.go deleted file mode 100644 index 63552d2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_instance.go +++ /dev/null @@ -1,422 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/private/waiter" - dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDmsReplicationInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDmsReplicationInstanceCreate, - Read: resourceAwsDmsReplicationInstanceRead, - Update: resourceAwsDmsReplicationInstanceUpdate, - Delete: resourceAwsDmsReplicationInstanceDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "allocated_storage": { - Type: schema.TypeInt, - Computed: true, - Optional: true, - ValidateFunc: validateIntegerInRange(5, 6144), - }, - "apply_immediately": { - Type: schema.TypeBool, - Optional: true, - }, - "auto_minor_version_upgrade": { - Type: schema.TypeBool, - Computed: true, - Optional: true, - }, - "availability_zone": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, - }, - "engine_version": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - "kms_key_arn": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - "multi_az": { - Type: schema.TypeBool, - Computed: true, - Optional: true, - }, - "preferred_maintenance_window": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ValidateFunc: validateOnceAWeekWindowFormat, - }, - "publicly_accessible": { - Type: schema.TypeBool, - Computed: true, - Optional: true, - ForceNew: true, - }, - "replication_instance_arn": { - Type: schema.TypeString, - Computed: true, - }, - "replication_instance_class": { - Type: schema.TypeString, - Required: true, - // Valid Values: dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large | dms.c4.large | - // dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge - }, - "replication_instance_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateDmsReplicationInstanceId, - }, - "replication_instance_private_ips": { - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, - }, - "replication_instance_public_ips": { - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, - }, - "replication_subnet_group_id": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, - }, - "tags": { - Type: schema.TypeMap, - Optional: true, - }, - "vpc_security_group_ids": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Computed: true, - Optional: true, - }, - }, - } -} - -func resourceAwsDmsReplicationInstanceCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.CreateReplicationInstanceInput{ - AutoMinorVersionUpgrade: aws.Bool(d.Get("auto_minor_version_upgrade").(bool)), - PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), - ReplicationInstanceClass: aws.String(d.Get("replication_instance_class").(string)), - ReplicationInstanceIdentifier: aws.String(d.Get("replication_instance_id").(string)), - Tags: dmsTagsFromMap(d.Get("tags").(map[string]interface{})), - } - - // WARNING: GetOk returns the zero value for the type if the key is omitted in config. This means for optional - // keys that the zero value is valid we cannot know if the zero value was in the config and cannot allow the API - // to set the default value. See GitHub Issue #5694 https://github.com/hashicorp/terraform/issues/5694 - - if v, ok := d.GetOk("allocated_storage"); ok { - request.AllocatedStorage = aws.Int64(int64(v.(int))) - } - if v, ok := d.GetOk("engine_version"); ok { - request.EngineVersion = aws.String(v.(string)) - } - if v, ok := d.GetOk("kms_key_arn"); ok { - request.KmsKeyId = aws.String(v.(string)) - } - if v, ok := d.GetOk("preferred_maintenance_window"); ok { - request.PreferredMaintenanceWindow = aws.String(v.(string)) - } - if v, ok := d.GetOk("replication_subnet_group_id"); ok { - request.ReplicationSubnetGroupIdentifier = aws.String(v.(string)) - } - if v, ok := d.GetOk("vpc_security_group_ids"); ok { - request.VpcSecurityGroupIds = expandStringList(v.(*schema.Set).List()) - } - - az, azSet := d.GetOk("availability_zone") - if azSet { - request.AvailabilityZone = aws.String(az.(string)) - } - - if multiAz, ok := d.GetOk("multi_az"); ok { - request.MultiAZ = aws.Bool(multiAz.(bool)) - - if multiAz.(bool) && azSet { - return fmt.Errorf("Cannot set availability_zone if multi_az is set to true") - } - } - - log.Println("[DEBUG] DMS create replication instance:", request) - - _, err := conn.CreateReplicationInstance(request) - if err != nil { - return err - } - - err = waitForInstanceCreated(conn, d.Get("replication_instance_id").(string), 30, 20) - if err != nil { - return err - } - - d.SetId(d.Get("replication_instance_id").(string)) - return resourceAwsDmsReplicationInstanceRead(d, meta) -} - -func resourceAwsDmsReplicationInstanceRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - response, err := conn.DescribeReplicationInstances(&dms.DescribeReplicationInstancesInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-instance-id"), - Values: []*string{aws.String(d.Id())}, // Must use d.Id() to work with import. - }, - }, - }) - if err != nil { - if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { - d.SetId("") - return nil - } - return err - } - - err = resourceAwsDmsReplicationInstanceSetState(d, response.ReplicationInstances[0]) - if err != nil { - return err - } - - tagsResp, err := conn.ListTagsForResource(&dms.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("replication_instance_arn").(string)), - }) - if err != nil { - return err - } - d.Set("tags", dmsTagsToMap(tagsResp.TagList)) - - return nil -} - -func resourceAwsDmsReplicationInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - request := &dms.ModifyReplicationInstanceInput{ - ApplyImmediately: aws.Bool(d.Get("apply_immediately").(bool)), - ReplicationInstanceArn: aws.String(d.Get("replication_instance_arn").(string)), - } - hasChanges := false - - if d.HasChange("auto_minor_version_upgrade") { - request.AutoMinorVersionUpgrade = aws.Bool(d.Get("auto_minor_version_upgrade").(bool)) - hasChanges = true - } - - if d.HasChange("allocated_storage") { - if v, ok := d.GetOk("allocated_storage"); ok { - request.AllocatedStorage = aws.Int64(int64(v.(int))) - hasChanges = true - } - } - - if d.HasChange("engine_version") { - if v, ok := d.GetOk("engine_version"); ok { - request.ReplicationInstanceClass = aws.String(v.(string)) - hasChanges = true - } - } - - if d.HasChange("multi_az") { - if v, ok := d.GetOk("multi_az"); ok { - request.MultiAZ = aws.Bool(v.(bool)) - hasChanges = true - } - } - - if d.HasChange("preferred_maintenance_window") { - if v, ok := d.GetOk("preferred_maintenance_window"); ok { - request.PreferredMaintenanceWindow = aws.String(v.(string)) - hasChanges = true - } - } - - if d.HasChange("replication_instance_class") { - if v, ok := d.GetOk("replication_instance_class"); ok { - request.ReplicationInstanceClass = aws.String(v.(string)) - hasChanges = true - } - } - - if d.HasChange("vpc_security_group_ids") { - if v, ok := d.GetOk("vpc_security_group_ids"); ok { - request.VpcSecurityGroupIds = expandStringList(v.(*schema.Set).List()) - hasChanges = true - } - } - - if d.HasChange("tags") { - err := dmsSetTags(d.Get("replication_instance_arn").(string), d, meta) - if err != nil { - return err - } - } - - if hasChanges { - conn := meta.(*AWSClient).dmsconn - - _, err := conn.ModifyReplicationInstance(request) - if err != nil { - return err - } - - return resourceAwsDmsReplicationInstanceRead(d, meta) - } - - return nil -} - -func resourceAwsDmsReplicationInstanceDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.DeleteReplicationInstanceInput{ - ReplicationInstanceArn: aws.String(d.Get("replication_instance_arn").(string)), - } - - log.Printf("[DEBUG] DMS delete replication instance: %#v", request) - - _, err := conn.DeleteReplicationInstance(request) - if err != nil { - return err - } - - waitErr := waitForInstanceDeleted(conn, d.Get("replication_instance_id").(string), 30, 20) - if waitErr != nil { - return waitErr - } - - return nil -} - -func resourceAwsDmsReplicationInstanceSetState(d *schema.ResourceData, instance *dms.ReplicationInstance) error { - d.SetId(*instance.ReplicationInstanceIdentifier) - - d.Set("replication_instance_id", instance.ReplicationInstanceIdentifier) - d.Set("allocated_storage", instance.AllocatedStorage) - d.Set("auto_minor_version_upgrade", instance.AutoMinorVersionUpgrade) - d.Set("availability_zone", instance.AvailabilityZone) - d.Set("engine_version", instance.EngineVersion) - d.Set("kms_key_arn", instance.KmsKeyId) - d.Set("multi_az", instance.MultiAZ) - d.Set("preferred_maintenance_window", instance.PreferredMaintenanceWindow) - d.Set("publicly_accessible", instance.PubliclyAccessible) - d.Set("replication_instance_arn", instance.ReplicationInstanceArn) - d.Set("replication_instance_class", instance.ReplicationInstanceClass) - d.Set("replication_subnet_group_id", instance.ReplicationSubnetGroup.ReplicationSubnetGroupIdentifier) - - vpc_security_group_ids := []string{} - for _, sg := range instance.VpcSecurityGroups { - vpc_security_group_ids = append(vpc_security_group_ids, aws.StringValue(sg.VpcSecurityGroupId)) - } - - d.Set("vpc_security_group_ids", vpc_security_group_ids) - - private_ip_addresses := []string{} - for _, ip := range instance.ReplicationInstancePrivateIpAddresses { - private_ip_addresses = append(private_ip_addresses, aws.StringValue(ip)) - } - - d.Set("replication_instance_private_ips", private_ip_addresses) - - public_ip_addresses := []string{} - for _, ip := range instance.ReplicationInstancePublicIpAddresses { - public_ip_addresses = append(public_ip_addresses, aws.StringValue(ip)) - } - - d.Set("replication_instance_public_ips", public_ip_addresses) - - return nil -} - -func waitForInstanceCreated(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationInstancesInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-instance-id"), - Values: []*string{aws.String(id)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeReplicationInstances", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationInstances[].ReplicationInstanceStatus", - Expected: "available", - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() -} - -func waitForInstanceDeleted(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationInstancesInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-instance-id"), - Values: []*string{aws.String(id)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeReplicationInstances", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "success", - Matcher: "path", - Argument: "length(ReplicationInstances[]) > `0`", - Expected: false, - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_subnet_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_subnet_group.go deleted file mode 100644 index b281653..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_subnet_group.go +++ /dev/null @@ -1,179 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsDmsReplicationSubnetGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDmsReplicationSubnetGroupCreate, - Read: resourceAwsDmsReplicationSubnetGroupRead, - Update: resourceAwsDmsReplicationSubnetGroupUpdate, - Delete: resourceAwsDmsReplicationSubnetGroupDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "replication_subnet_group_arn": { - Type: schema.TypeString, - Computed: true, - }, - "replication_subnet_group_description": { - Type: schema.TypeString, - Required: true, - }, - "replication_subnet_group_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateDmsReplicationSubnetGroupId, - }, - "subnet_ids": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Required: true, - }, - "tags": { - Type: schema.TypeMap, - Optional: true, - }, - "vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsDmsReplicationSubnetGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.CreateReplicationSubnetGroupInput{ - ReplicationSubnetGroupIdentifier: aws.String(d.Get("replication_subnet_group_id").(string)), - ReplicationSubnetGroupDescription: aws.String(d.Get("replication_subnet_group_description").(string)), - SubnetIds: expandStringList(d.Get("subnet_ids").(*schema.Set).List()), - Tags: dmsTagsFromMap(d.Get("tags").(map[string]interface{})), - } - - log.Println("[DEBUG] DMS create replication subnet group:", request) - - _, err := conn.CreateReplicationSubnetGroup(request) - if err != nil { - return err - } - - d.SetId(d.Get("replication_subnet_group_id").(string)) - return resourceAwsDmsReplicationSubnetGroupRead(d, meta) -} - -func resourceAwsDmsReplicationSubnetGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - response, err := conn.DescribeReplicationSubnetGroups(&dms.DescribeReplicationSubnetGroupsInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-subnet-group-id"), - Values: []*string{aws.String(d.Id())}, // Must use d.Id() to work with import. - }, - }, - }) - if err != nil { - return err - } - if len(response.ReplicationSubnetGroups) == 0 { - d.SetId("") - return nil - } - - // The AWS API for DMS subnet groups does not return the ARN which is required to - // retrieve tags. This ARN can be built. - d.Set("replication_subnet_group_arn", fmt.Sprintf("arn:aws:dms:%s:%s:subgrp:%s", - meta.(*AWSClient).region, meta.(*AWSClient).accountid, d.Id())) - - err = resourceAwsDmsReplicationSubnetGroupSetState(d, response.ReplicationSubnetGroups[0]) - if err != nil { - return err - } - - tagsResp, err := conn.ListTagsForResource(&dms.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("replication_subnet_group_arn").(string)), - }) - if err != nil { - return err - } - d.Set("tags", dmsTagsToMap(tagsResp.TagList)) - - return nil -} - -func resourceAwsDmsReplicationSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - // Updates to subnet groups are only valid when sending SubnetIds even if there are no - // changes to SubnetIds. - request := &dms.ModifyReplicationSubnetGroupInput{ - ReplicationSubnetGroupIdentifier: aws.String(d.Get("replication_subnet_group_id").(string)), - SubnetIds: expandStringList(d.Get("subnet_ids").(*schema.Set).List()), - } - - if d.HasChange("replication_subnet_group_description") { - request.ReplicationSubnetGroupDescription = aws.String(d.Get("replication_subnet_group_description").(string)) - } - - if d.HasChange("tags") { - err := dmsSetTags(d.Get("replication_subnet_group_arn").(string), d, meta) - if err != nil { - return err - } - } - - log.Println("[DEBUG] DMS update replication subnet group:", request) - - _, err := conn.ModifyReplicationSubnetGroup(request) - if err != nil { - return err - } - - return resourceAwsDmsReplicationSubnetGroupRead(d, meta) -} - -func resourceAwsDmsReplicationSubnetGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.DeleteReplicationSubnetGroupInput{ - ReplicationSubnetGroupIdentifier: aws.String(d.Get("replication_subnet_group_id").(string)), - } - - log.Printf("[DEBUG] DMS delete replication subnet group: %#v", request) - - _, err := conn.DeleteReplicationSubnetGroup(request) - if err != nil { - return err - } - - return nil -} - -func resourceAwsDmsReplicationSubnetGroupSetState(d *schema.ResourceData, group *dms.ReplicationSubnetGroup) error { - d.SetId(*group.ReplicationSubnetGroupIdentifier) - - subnet_ids := []string{} - for _, subnet := range group.Subnets { - subnet_ids = append(subnet_ids, aws.StringValue(subnet.SubnetIdentifier)) - } - - d.Set("replication_subnet_group_description", group.ReplicationSubnetGroupDescription) - d.Set("replication_subnet_group_id", group.ReplicationSubnetGroupIdentifier) - d.Set("subnet_ids", subnet_ids) - d.Set("vpc_id", group.VpcId) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_task.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_task.go deleted file mode 100644 index a9ab72c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dms_replication_task.go +++ /dev/null @@ -1,379 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/private/waiter" - dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" -) - -func resourceAwsDmsReplicationTask() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDmsReplicationTaskCreate, - Read: resourceAwsDmsReplicationTaskRead, - Update: resourceAwsDmsReplicationTaskUpdate, - Delete: resourceAwsDmsReplicationTaskDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "cdc_start_time": { - Type: schema.TypeString, - Optional: true, - // Requires a Unix timestamp in seconds. Example 1484346880 - }, - "migration_type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "full-load", - "cdc", - "full-load-and-cdc", - }, false), - }, - "replication_instance_arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - "replication_task_arn": { - Type: schema.TypeString, - Computed: true, - }, - "replication_task_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateDmsReplicationTaskId, - }, - "replication_task_settings": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentJsonDiffs, - }, - "source_endpoint_arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - "table_mappings": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentJsonDiffs, - }, - "tags": { - Type: schema.TypeMap, - Optional: true, - }, - "target_endpoint_arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - }, - } -} - -func resourceAwsDmsReplicationTaskCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.CreateReplicationTaskInput{ - MigrationType: aws.String(d.Get("migration_type").(string)), - ReplicationInstanceArn: aws.String(d.Get("replication_instance_arn").(string)), - ReplicationTaskIdentifier: aws.String(d.Get("replication_task_id").(string)), - SourceEndpointArn: aws.String(d.Get("source_endpoint_arn").(string)), - TableMappings: aws.String(d.Get("table_mappings").(string)), - Tags: dmsTagsFromMap(d.Get("tags").(map[string]interface{})), - TargetEndpointArn: aws.String(d.Get("target_endpoint_arn").(string)), - } - - if v, ok := d.GetOk("cdc_start_time"); ok { - seconds, err := strconv.ParseInt(v.(string), 10, 64) - if err != nil { - return fmt.Errorf("[ERROR] DMS create replication task. Invalid CDC Unix timestamp: %s", err) - } - request.CdcStartTime = aws.Time(time.Unix(seconds, 0)) - } - - if v, ok := d.GetOk("replication_task_settings"); ok { - request.ReplicationTaskSettings = aws.String(v.(string)) - } - - log.Println("[DEBUG] DMS create replication task:", request) - - _, err := conn.CreateReplicationTask(request) - if err != nil { - return err - } - - taskId := d.Get("replication_task_id").(string) - - err = waitForTaskCreated(conn, taskId, 30, 10) - if err != nil { - return err - } - - d.SetId(taskId) - return resourceAwsDmsReplicationTaskRead(d, meta) -} - -func resourceAwsDmsReplicationTaskRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - response, err := conn.DescribeReplicationTasks(&dms.DescribeReplicationTasksInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-task-id"), - Values: []*string{aws.String(d.Id())}, // Must use d.Id() to work with import. - }, - }, - }) - if err != nil { - if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { - d.SetId("") - return nil - } - return err - } - - err = resourceAwsDmsReplicationTaskSetState(d, response.ReplicationTasks[0]) - if err != nil { - return err - } - - tagsResp, err := conn.ListTagsForResource(&dms.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("replication_task_arn").(string)), - }) - if err != nil { - return err - } - d.Set("tags", dmsTagsToMap(tagsResp.TagList)) - - return nil -} - -func resourceAwsDmsReplicationTaskUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.ModifyReplicationTaskInput{ - ReplicationTaskArn: aws.String(d.Get("replication_task_arn").(string)), - } - hasChanges := false - - if d.HasChange("cdc_start_time") { - seconds, err := strconv.ParseInt(d.Get("cdc_start_time").(string), 10, 64) - if err != nil { - return fmt.Errorf("[ERROR] DMS update replication task. Invalid CRC Unix timestamp: %s", err) - } - request.CdcStartTime = aws.Time(time.Unix(seconds, 0)) - hasChanges = true - } - - if d.HasChange("migration_type") { - request.MigrationType = aws.String(d.Get("migration_type").(string)) - hasChanges = true - } - - if d.HasChange("replication_task_settings") { - request.ReplicationTaskSettings = aws.String(d.Get("replication_task_settings").(string)) - hasChanges = true - } - - if d.HasChange("table_mappings") { - request.TableMappings = aws.String(d.Get("table_mappings").(string)) - hasChanges = true - } - - if d.HasChange("tags") { - err := dmsSetTags(d.Get("replication_task_arn").(string), d, meta) - if err != nil { - return err - } - } - - if hasChanges { - log.Println("[DEBUG] DMS update replication task:", request) - - _, err := conn.ModifyReplicationTask(request) - if err != nil { - return err - } - - err = waitForTaskUpdated(conn, d.Get("replication_task_id").(string), 30, 10) - if err != nil { - return err - } - - return resourceAwsDmsReplicationTaskRead(d, meta) - } - - return nil -} - -func resourceAwsDmsReplicationTaskDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - request := &dms.DeleteReplicationTaskInput{ - ReplicationTaskArn: aws.String(d.Get("replication_task_arn").(string)), - } - - log.Printf("[DEBUG] DMS delete replication task: %#v", request) - - _, err := conn.DeleteReplicationTask(request) - if err != nil { - return err - } - - waitErr := waitForTaskDeleted(conn, d.Get("replication_task_id").(string), 30, 10) - if waitErr != nil { - return waitErr - } - - return nil -} - -func resourceAwsDmsReplicationTaskSetState(d *schema.ResourceData, task *dms.ReplicationTask) error { - d.SetId(*task.ReplicationTaskIdentifier) - - d.Set("migration_type", task.MigrationType) - d.Set("replication_instance_arn", task.ReplicationInstanceArn) - d.Set("replication_task_arn", task.ReplicationTaskArn) - d.Set("replication_task_id", task.ReplicationTaskIdentifier) - d.Set("replication_task_settings", task.ReplicationTaskSettings) - d.Set("source_endpoint_arn", task.SourceEndpointArn) - d.Set("table_mappings", task.TableMappings) - d.Set("target_endpoint_arn", task.TargetEndpointArn) - - return nil -} - -func waitForTaskCreated(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationTasksInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-task-id"), - Values: []*string{aws.String(id)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeReplicationTasks", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "retry", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "creating", - }, - { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "ready", - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() -} - -func waitForTaskUpdated(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationTasksInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-task-id"), - Values: []*string{aws.String(id)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeReplicationTasks", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "retry", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "modifying", - }, - { - State: "success", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "ready", - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() -} - -func waitForTaskDeleted(client *dms.DatabaseMigrationService, id string, delay int, maxAttempts int) error { - input := &dms.DescribeReplicationTasksInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("replication-task-id"), - Values: []*string{aws.String(id)}, - }, - }, - } - - config := waiter.Config{ - Operation: "DescribeReplicationTasks", - Delay: delay, - MaxAttempts: maxAttempts, - Acceptors: []waiter.WaitAcceptor{ - { - State: "retry", - Matcher: "pathAll", - Argument: "ReplicationTasks[].Status", - Expected: "deleting", - }, - { - State: "success", - Matcher: "path", - Argument: "length(ReplicationTasks[]) > `0`", - Expected: false, - }, - }, - } - - w := waiter.Waiter{ - Client: client, - Input: input, - Config: config, - } - - return w.Wait() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dynamodb_table.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dynamodb_table.go deleted file mode 100644 index e0c6376..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_dynamodb_table.go +++ /dev/null @@ -1,954 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "strings" - "time" - - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "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/hashicorp/terraform/helper/hashcode" -) - -// Number of times to retry if a throttling-related exception occurs -const DYNAMODB_MAX_THROTTLE_RETRIES = 5 - -// How long to sleep when a throttle-event happens -const DYNAMODB_THROTTLE_SLEEP = 5 * time.Second - -// How long to sleep if a limit-exceeded event happens -const DYNAMODB_LIMIT_EXCEEDED_SLEEP = 10 * time.Second - -// A number of these are marked as computed because if you don't -// provide a value, DynamoDB will provide you with defaults (which are the -// default values specified below) -func resourceAwsDynamoDbTable() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDynamoDbTableCreate, - Read: resourceAwsDynamoDbTableRead, - Update: resourceAwsDynamoDbTableUpdate, - Delete: resourceAwsDynamoDbTableDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "hash_key": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "range_key": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "write_capacity": { - Type: schema.TypeInt, - Required: true, - }, - "read_capacity": { - Type: schema.TypeInt, - Required: true, - }, - "attribute": { - Type: schema.TypeSet, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - return hashcode.String(buf.String()) - }, - }, - "local_secondary_index": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "range_key": { - Type: schema.TypeString, - Required: true, - }, - "projection_type": { - Type: schema.TypeString, - Required: true, - }, - "non_key_attributes": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - return hashcode.String(buf.String()) - }, - }, - "global_secondary_index": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "write_capacity": { - Type: schema.TypeInt, - Required: true, - }, - "read_capacity": { - Type: schema.TypeInt, - Required: true, - }, - "hash_key": { - Type: schema.TypeString, - Required: true, - }, - "range_key": { - Type: schema.TypeString, - Optional: true, - }, - "projection_type": { - Type: schema.TypeString, - Required: true, - }, - "non_key_attributes": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - }, - // GSI names are the uniqueness constraint - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - buf.WriteString(fmt.Sprintf("%d-", m["write_capacity"].(int))) - buf.WriteString(fmt.Sprintf("%d-", m["read_capacity"].(int))) - return hashcode.String(buf.String()) - }, - }, - "stream_enabled": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "stream_view_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - StateFunc: func(v interface{}) string { - value := v.(string) - return strings.ToUpper(value) - }, - ValidateFunc: validateStreamViewType, - }, - "stream_arn": { - Type: schema.TypeString, - Computed: true, - }, - "tags": tagsSchema(), - }, - } -} - -func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) error { - dynamodbconn := meta.(*AWSClient).dynamodbconn - - name := d.Get("name").(string) - - log.Printf("[DEBUG] DynamoDB table create: %s", name) - - throughput := &dynamodb.ProvisionedThroughput{ - ReadCapacityUnits: aws.Int64(int64(d.Get("read_capacity").(int))), - WriteCapacityUnits: aws.Int64(int64(d.Get("write_capacity").(int))), - } - - hash_key_name := d.Get("hash_key").(string) - keyschema := []*dynamodb.KeySchemaElement{ - { - AttributeName: aws.String(hash_key_name), - KeyType: aws.String("HASH"), - }, - } - - if range_key, ok := d.GetOk("range_key"); ok { - range_schema_element := &dynamodb.KeySchemaElement{ - AttributeName: aws.String(range_key.(string)), - KeyType: aws.String("RANGE"), - } - keyschema = append(keyschema, range_schema_element) - } - - req := &dynamodb.CreateTableInput{ - TableName: aws.String(name), - ProvisionedThroughput: throughput, - KeySchema: keyschema, - } - - if attributedata, ok := d.GetOk("attribute"); ok { - attributes := []*dynamodb.AttributeDefinition{} - attributeSet := attributedata.(*schema.Set) - for _, attribute := range attributeSet.List() { - attr := attribute.(map[string]interface{}) - attributes = append(attributes, &dynamodb.AttributeDefinition{ - AttributeName: aws.String(attr["name"].(string)), - AttributeType: aws.String(attr["type"].(string)), - }) - } - - req.AttributeDefinitions = attributes - } - - if lsidata, ok := d.GetOk("local_secondary_index"); ok { - log.Printf("[DEBUG] Adding LSI data to the table") - - lsiSet := lsidata.(*schema.Set) - localSecondaryIndexes := []*dynamodb.LocalSecondaryIndex{} - for _, lsiObject := range lsiSet.List() { - lsi := lsiObject.(map[string]interface{}) - - projection := &dynamodb.Projection{ - ProjectionType: aws.String(lsi["projection_type"].(string)), - } - - if lsi["projection_type"] == "INCLUDE" { - non_key_attributes := []*string{} - for _, attr := range lsi["non_key_attributes"].([]interface{}) { - non_key_attributes = append(non_key_attributes, aws.String(attr.(string))) - } - projection.NonKeyAttributes = non_key_attributes - } - - localSecondaryIndexes = append(localSecondaryIndexes, &dynamodb.LocalSecondaryIndex{ - IndexName: aws.String(lsi["name"].(string)), - KeySchema: []*dynamodb.KeySchemaElement{ - { - AttributeName: aws.String(hash_key_name), - KeyType: aws.String("HASH"), - }, - { - AttributeName: aws.String(lsi["range_key"].(string)), - KeyType: aws.String("RANGE"), - }, - }, - Projection: projection, - }) - } - - req.LocalSecondaryIndexes = localSecondaryIndexes - - log.Printf("[DEBUG] Added %d LSI definitions", len(localSecondaryIndexes)) - } - - if gsidata, ok := d.GetOk("global_secondary_index"); ok { - globalSecondaryIndexes := []*dynamodb.GlobalSecondaryIndex{} - - gsiSet := gsidata.(*schema.Set) - for _, gsiObject := range gsiSet.List() { - gsi := gsiObject.(map[string]interface{}) - gsiObject := createGSIFromData(&gsi) - globalSecondaryIndexes = append(globalSecondaryIndexes, &gsiObject) - } - req.GlobalSecondaryIndexes = globalSecondaryIndexes - } - - if _, ok := d.GetOk("stream_enabled"); ok { - - req.StreamSpecification = &dynamodb.StreamSpecification{ - StreamEnabled: aws.Bool(d.Get("stream_enabled").(bool)), - StreamViewType: aws.String(d.Get("stream_view_type").(string)), - } - - log.Printf("[DEBUG] Adding StreamSpecifications to the table") - } - - _, tagsOk := d.GetOk("tags") - - attemptCount := 1 - for attemptCount <= DYNAMODB_MAX_THROTTLE_RETRIES { - output, err := dynamodbconn.CreateTable(req) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ThrottlingException" { - log.Printf("[DEBUG] Attempt %d/%d: Sleeping for a bit to throttle back create request", attemptCount, DYNAMODB_MAX_THROTTLE_RETRIES) - time.Sleep(DYNAMODB_THROTTLE_SLEEP) - attemptCount += 1 - } else if awsErr.Code() == "LimitExceededException" { - log.Printf("[DEBUG] Limit on concurrent table creations hit, sleeping for a bit") - time.Sleep(DYNAMODB_LIMIT_EXCEEDED_SLEEP) - attemptCount += 1 - } else { - // Some other non-retryable exception occurred - return fmt.Errorf("AWS Error creating DynamoDB table: %s", err) - } - } else { - // Non-AWS exception occurred, give up - return fmt.Errorf("Error creating DynamoDB table: %s", err) - } - } else { - // No error, set ID and return - d.SetId(*output.TableDescription.TableName) - tableArn := *output.TableDescription.TableArn - if err := d.Set("arn", tableArn); err != nil { - return err - } - if tagsOk { - log.Printf("[DEBUG] Setting DynamoDB Tags on arn: %s", tableArn) - if err := createTableTags(d, meta); err != nil { - return err - } - } - return resourceAwsDynamoDbTableRead(d, meta) - } - } - - // Too many throttling events occurred, give up - return fmt.Errorf("Unable to create DynamoDB table '%s' after %d attempts", name, attemptCount) -} - -func resourceAwsDynamoDbTableUpdate(d *schema.ResourceData, meta interface{}) error { - - log.Printf("[DEBUG] Updating DynamoDB table %s", d.Id()) - dynamodbconn := meta.(*AWSClient).dynamodbconn - - // Ensure table is active before trying to update - if err := waitForTableToBeActive(d.Id(), meta); err != nil { - return errwrap.Wrapf("Error waiting for Dynamo DB Table update: {{err}}", err) - } - - if d.HasChange("read_capacity") || d.HasChange("write_capacity") { - req := &dynamodb.UpdateTableInput{ - TableName: aws.String(d.Id()), - } - - throughput := &dynamodb.ProvisionedThroughput{ - ReadCapacityUnits: aws.Int64(int64(d.Get("read_capacity").(int))), - WriteCapacityUnits: aws.Int64(int64(d.Get("write_capacity").(int))), - } - req.ProvisionedThroughput = throughput - - _, err := dynamodbconn.UpdateTable(req) - - if err != nil { - return err - } - - if err := waitForTableToBeActive(d.Id(), meta); err != nil { - return errwrap.Wrapf("Error waiting for Dynamo DB Table update: {{err}}", err) - } - } - - if d.HasChange("stream_enabled") || d.HasChange("stream_view_type") { - req := &dynamodb.UpdateTableInput{ - TableName: aws.String(d.Id()), - } - - req.StreamSpecification = &dynamodb.StreamSpecification{ - StreamEnabled: aws.Bool(d.Get("stream_enabled").(bool)), - StreamViewType: aws.String(d.Get("stream_view_type").(string)), - } - - _, err := dynamodbconn.UpdateTable(req) - - if err != nil { - return err - } - - if err := waitForTableToBeActive(d.Id(), meta); err != nil { - return errwrap.Wrapf("Error waiting for Dynamo DB Table update: {{err}}", err) - } - } - - if d.HasChange("global_secondary_index") { - log.Printf("[DEBUG] Changed GSI data") - req := &dynamodb.UpdateTableInput{ - TableName: aws.String(d.Id()), - } - - o, n := d.GetChange("global_secondary_index") - - oldSet := o.(*schema.Set) - newSet := n.(*schema.Set) - - // Track old names so we can know which ones we need to just update based on - // capacity changes, terraform appears to only diff on the set hash, not the - // contents so we need to make sure we don't delete any indexes that we - // just want to update the capacity for - oldGsiNameSet := make(map[string]bool) - newGsiNameSet := make(map[string]bool) - - for _, gsidata := range oldSet.List() { - gsiName := gsidata.(map[string]interface{})["name"].(string) - oldGsiNameSet[gsiName] = true - } - - for _, gsidata := range newSet.List() { - gsiName := gsidata.(map[string]interface{})["name"].(string) - newGsiNameSet[gsiName] = true - } - - // First determine what's new - for _, newgsidata := range newSet.List() { - updates := []*dynamodb.GlobalSecondaryIndexUpdate{} - newGsiName := newgsidata.(map[string]interface{})["name"].(string) - if _, exists := oldGsiNameSet[newGsiName]; !exists { - attributes := []*dynamodb.AttributeDefinition{} - gsidata := newgsidata.(map[string]interface{}) - gsi := createGSIFromData(&gsidata) - log.Printf("[DEBUG] Adding GSI %s", *gsi.IndexName) - update := &dynamodb.GlobalSecondaryIndexUpdate{ - Create: &dynamodb.CreateGlobalSecondaryIndexAction{ - IndexName: gsi.IndexName, - KeySchema: gsi.KeySchema, - ProvisionedThroughput: gsi.ProvisionedThroughput, - Projection: gsi.Projection, - }, - } - updates = append(updates, update) - - // Hash key is required, range key isn't - hashkey_type, err := getAttributeType(d, *gsi.KeySchema[0].AttributeName) - if err != nil { - return err - } - - attributes = append(attributes, &dynamodb.AttributeDefinition{ - AttributeName: gsi.KeySchema[0].AttributeName, - AttributeType: aws.String(hashkey_type), - }) - - // If there's a range key, there will be 2 elements in KeySchema - if len(gsi.KeySchema) == 2 { - rangekey_type, err := getAttributeType(d, *gsi.KeySchema[1].AttributeName) - if err != nil { - return err - } - - attributes = append(attributes, &dynamodb.AttributeDefinition{ - AttributeName: gsi.KeySchema[1].AttributeName, - AttributeType: aws.String(rangekey_type), - }) - } - - req.AttributeDefinitions = attributes - req.GlobalSecondaryIndexUpdates = updates - _, err = dynamodbconn.UpdateTable(req) - - if err != nil { - return err - } - - if err := waitForTableToBeActive(d.Id(), meta); err != nil { - return errwrap.Wrapf("Error waiting for Dynamo DB Table update: {{err}}", err) - } - - if err := waitForGSIToBeActive(d.Id(), *gsi.IndexName, meta); err != nil { - return errwrap.Wrapf("Error waiting for Dynamo DB GSIT to be active: {{err}}", err) - } - - } - } - - for _, oldgsidata := range oldSet.List() { - updates := []*dynamodb.GlobalSecondaryIndexUpdate{} - oldGsiName := oldgsidata.(map[string]interface{})["name"].(string) - if _, exists := newGsiNameSet[oldGsiName]; !exists { - gsidata := oldgsidata.(map[string]interface{}) - log.Printf("[DEBUG] Deleting GSI %s", gsidata["name"].(string)) - update := &dynamodb.GlobalSecondaryIndexUpdate{ - Delete: &dynamodb.DeleteGlobalSecondaryIndexAction{ - IndexName: aws.String(gsidata["name"].(string)), - }, - } - updates = append(updates, update) - - req.GlobalSecondaryIndexUpdates = updates - _, err := dynamodbconn.UpdateTable(req) - - if err != nil { - return err - } - - if err := waitForTableToBeActive(d.Id(), meta); err != nil { - return errwrap.Wrapf("Error waiting for Dynamo DB Table update: {{err}}", err) - } - } - } - } - - // Update any out-of-date read / write capacity - if gsiObjects, ok := d.GetOk("global_secondary_index"); ok { - gsiSet := gsiObjects.(*schema.Set) - if len(gsiSet.List()) > 0 { - log.Printf("Updating capacity as needed!") - - // We can only change throughput, but we need to make sure it's actually changed - tableDescription, err := dynamodbconn.DescribeTable(&dynamodb.DescribeTableInput{ - TableName: aws.String(d.Id()), - }) - - if err != nil { - return err - } - - table := tableDescription.Table - - updates := []*dynamodb.GlobalSecondaryIndexUpdate{} - - for _, updatedgsidata := range gsiSet.List() { - gsidata := updatedgsidata.(map[string]interface{}) - gsiName := gsidata["name"].(string) - gsiWriteCapacity := gsidata["write_capacity"].(int) - gsiReadCapacity := gsidata["read_capacity"].(int) - - log.Printf("[DEBUG] Updating GSI %s", gsiName) - gsi, err := getGlobalSecondaryIndex(gsiName, table.GlobalSecondaryIndexes) - - if err != nil { - return err - } - - capacityUpdated := false - - if int64(gsiReadCapacity) != *gsi.ProvisionedThroughput.ReadCapacityUnits || - int64(gsiWriteCapacity) != *gsi.ProvisionedThroughput.WriteCapacityUnits { - capacityUpdated = true - } - - if capacityUpdated { - update := &dynamodb.GlobalSecondaryIndexUpdate{ - Update: &dynamodb.UpdateGlobalSecondaryIndexAction{ - IndexName: aws.String(gsidata["name"].(string)), - ProvisionedThroughput: &dynamodb.ProvisionedThroughput{ - WriteCapacityUnits: aws.Int64(int64(gsiWriteCapacity)), - ReadCapacityUnits: aws.Int64(int64(gsiReadCapacity)), - }, - }, - } - updates = append(updates, update) - - } - - if len(updates) > 0 { - - req := &dynamodb.UpdateTableInput{ - TableName: aws.String(d.Id()), - } - - req.GlobalSecondaryIndexUpdates = updates - - log.Printf("[DEBUG] Updating GSI read / write capacity on %s", d.Id()) - _, err := dynamodbconn.UpdateTable(req) - - if err != nil { - log.Printf("[DEBUG] Error updating table: %s", err) - return err - } - } - } - } - - } - - // Update tags - if err := setTagsDynamoDb(dynamodbconn, d); err != nil { - return err - } - - return resourceAwsDynamoDbTableRead(d, meta) -} - -func resourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) error { - dynamodbconn := meta.(*AWSClient).dynamodbconn - log.Printf("[DEBUG] Loading data for DynamoDB table '%s'", d.Id()) - req := &dynamodb.DescribeTableInput{ - TableName: aws.String(d.Id()), - } - - result, err := dynamodbconn.DescribeTable(req) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" { - log.Printf("[WARN] Dynamodb Table (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - return err - } - - table := result.Table - - d.Set("write_capacity", table.ProvisionedThroughput.WriteCapacityUnits) - d.Set("read_capacity", table.ProvisionedThroughput.ReadCapacityUnits) - - attributes := []interface{}{} - for _, attrdef := range table.AttributeDefinitions { - attribute := map[string]string{ - "name": *attrdef.AttributeName, - "type": *attrdef.AttributeType, - } - attributes = append(attributes, attribute) - log.Printf("[DEBUG] Added Attribute: %s", attribute["name"]) - } - - d.Set("attribute", attributes) - d.Set("name", table.TableName) - - for _, attribute := range table.KeySchema { - if *attribute.KeyType == "HASH" { - d.Set("hash_key", attribute.AttributeName) - } - - if *attribute.KeyType == "RANGE" { - d.Set("range_key", attribute.AttributeName) - } - } - - lsiList := make([]map[string]interface{}, 0, len(table.LocalSecondaryIndexes)) - for _, lsiObject := range table.LocalSecondaryIndexes { - lsi := map[string]interface{}{ - "name": *lsiObject.IndexName, - "projection_type": *lsiObject.Projection.ProjectionType, - } - - for _, attribute := range lsiObject.KeySchema { - - if *attribute.KeyType == "RANGE" { - lsi["range_key"] = *attribute.AttributeName - } - } - nkaList := make([]string, len(lsiObject.Projection.NonKeyAttributes)) - for _, nka := range lsiObject.Projection.NonKeyAttributes { - nkaList = append(nkaList, *nka) - } - lsi["non_key_attributes"] = nkaList - - lsiList = append(lsiList, lsi) - } - - err = d.Set("local_secondary_index", lsiList) - if err != nil { - return err - } - - gsiList := make([]map[string]interface{}, 0, len(table.GlobalSecondaryIndexes)) - for _, gsiObject := range table.GlobalSecondaryIndexes { - gsi := map[string]interface{}{ - "write_capacity": *gsiObject.ProvisionedThroughput.WriteCapacityUnits, - "read_capacity": *gsiObject.ProvisionedThroughput.ReadCapacityUnits, - "name": *gsiObject.IndexName, - } - - for _, attribute := range gsiObject.KeySchema { - if *attribute.KeyType == "HASH" { - gsi["hash_key"] = *attribute.AttributeName - } - - if *attribute.KeyType == "RANGE" { - gsi["range_key"] = *attribute.AttributeName - } - } - - gsi["projection_type"] = *(gsiObject.Projection.ProjectionType) - - nonKeyAttrs := make([]string, 0, len(gsiObject.Projection.NonKeyAttributes)) - for _, nonKeyAttr := range gsiObject.Projection.NonKeyAttributes { - nonKeyAttrs = append(nonKeyAttrs, *nonKeyAttr) - } - gsi["non_key_attributes"] = nonKeyAttrs - - gsiList = append(gsiList, gsi) - log.Printf("[DEBUG] Added GSI: %s - Read: %d / Write: %d", gsi["name"], gsi["read_capacity"], gsi["write_capacity"]) - } - - if table.StreamSpecification != nil { - d.Set("stream_view_type", table.StreamSpecification.StreamViewType) - d.Set("stream_enabled", table.StreamSpecification.StreamEnabled) - d.Set("stream_arn", table.LatestStreamArn) - } - - err = d.Set("global_secondary_index", gsiList) - if err != nil { - return err - } - - d.Set("arn", table.TableArn) - - tags, err := readTableTags(d, meta) - if err != nil { - return err - } - if len(tags) != 0 { - d.Set("tags", tags) - } - - return nil -} - -func resourceAwsDynamoDbTableDelete(d *schema.ResourceData, meta interface{}) error { - dynamodbconn := meta.(*AWSClient).dynamodbconn - - if err := waitForTableToBeActive(d.Id(), meta); err != nil { - return errwrap.Wrapf("Error waiting for Dynamo DB Table update: {{err}}", err) - } - - log.Printf("[DEBUG] DynamoDB delete table: %s", d.Id()) - - _, err := dynamodbconn.DeleteTable(&dynamodb.DeleteTableInput{ - TableName: aws.String(d.Id()), - }) - if err != nil { - return err - } - - params := &dynamodb.DescribeTableInput{ - TableName: aws.String(d.Id()), - } - - err = resource.Retry(10*time.Minute, func() *resource.RetryError { - t, err := dynamodbconn.DescribeTable(params) - if err != nil { - if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "ResourceNotFoundException" { - return nil - } - // Didn't recognize the error, so shouldn't retry. - return resource.NonRetryableError(err) - } - - if t != nil { - if t.Table.TableStatus != nil && strings.ToLower(*t.Table.TableStatus) == "deleting" { - log.Printf("[DEBUG] AWS Dynamo DB table (%s) is still deleting", d.Id()) - return resource.RetryableError(fmt.Errorf("still deleting")) - } - } - - // we should be not found or deleting, so error here - return resource.NonRetryableError(err) - }) - - // check error from retry - if err != nil { - return err - } - - return nil -} - -func createGSIFromData(data *map[string]interface{}) dynamodb.GlobalSecondaryIndex { - - projection := &dynamodb.Projection{ - ProjectionType: aws.String((*data)["projection_type"].(string)), - } - - if (*data)["projection_type"] == "INCLUDE" { - non_key_attributes := []*string{} - for _, attr := range (*data)["non_key_attributes"].([]interface{}) { - non_key_attributes = append(non_key_attributes, aws.String(attr.(string))) - } - projection.NonKeyAttributes = non_key_attributes - } - - writeCapacity := (*data)["write_capacity"].(int) - readCapacity := (*data)["read_capacity"].(int) - - key_schema := []*dynamodb.KeySchemaElement{ - { - AttributeName: aws.String((*data)["hash_key"].(string)), - KeyType: aws.String("HASH"), - }, - } - - range_key_name := (*data)["range_key"] - if range_key_name != "" { - range_key_element := &dynamodb.KeySchemaElement{ - AttributeName: aws.String(range_key_name.(string)), - KeyType: aws.String("RANGE"), - } - - key_schema = append(key_schema, range_key_element) - } - - return dynamodb.GlobalSecondaryIndex{ - IndexName: aws.String((*data)["name"].(string)), - KeySchema: key_schema, - Projection: projection, - ProvisionedThroughput: &dynamodb.ProvisionedThroughput{ - WriteCapacityUnits: aws.Int64(int64(writeCapacity)), - ReadCapacityUnits: aws.Int64(int64(readCapacity)), - }, - } -} - -func getGlobalSecondaryIndex(indexName string, indexList []*dynamodb.GlobalSecondaryIndexDescription) (*dynamodb.GlobalSecondaryIndexDescription, error) { - for _, gsi := range indexList { - if *gsi.IndexName == indexName { - return gsi, nil - } - } - - return &dynamodb.GlobalSecondaryIndexDescription{}, fmt.Errorf("Can't find a GSI by that name...") -} - -func getAttributeType(d *schema.ResourceData, attributeName string) (string, error) { - if attributedata, ok := d.GetOk("attribute"); ok { - attributeSet := attributedata.(*schema.Set) - for _, attribute := range attributeSet.List() { - attr := attribute.(map[string]interface{}) - if attr["name"] == attributeName { - return attr["type"].(string), nil - } - } - } - - return "", fmt.Errorf("Unable to find an attribute named %s", attributeName) -} - -func waitForGSIToBeActive(tableName string, gsiName string, meta interface{}) error { - dynamodbconn := meta.(*AWSClient).dynamodbconn - req := &dynamodb.DescribeTableInput{ - TableName: aws.String(tableName), - } - - activeIndex := false - - for activeIndex == false { - - result, err := dynamodbconn.DescribeTable(req) - - if err != nil { - return err - } - - table := result.Table - var targetGSI *dynamodb.GlobalSecondaryIndexDescription = nil - - for _, gsi := range table.GlobalSecondaryIndexes { - if *gsi.IndexName == gsiName { - targetGSI = gsi - } - } - - if targetGSI != nil { - activeIndex = *targetGSI.IndexStatus == "ACTIVE" - - if !activeIndex { - log.Printf("[DEBUG] Sleeping for 5 seconds for %s GSI to become active", gsiName) - time.Sleep(5 * time.Second) - } - } else { - log.Printf("[DEBUG] GSI %s did not exist, giving up", gsiName) - break - } - } - - return nil - -} - -func waitForTableToBeActive(tableName string, meta interface{}) error { - dynamodbconn := meta.(*AWSClient).dynamodbconn - req := &dynamodb.DescribeTableInput{ - TableName: aws.String(tableName), - } - - activeState := false - - for activeState == false { - result, err := dynamodbconn.DescribeTable(req) - - if err != nil { - return err - } - - activeState = *result.Table.TableStatus == "ACTIVE" - - // Wait for a few seconds - if !activeState { - log.Printf("[DEBUG] Sleeping for 5 seconds for table to become active") - time.Sleep(5 * time.Second) - } - } - - return nil - -} - -func createTableTags(d *schema.ResourceData, meta interface{}) error { - // DynamoDB Table has to be in the ACTIVE state in order to tag the resource - if err := waitForTableToBeActive(d.Id(), meta); err != nil { - return err - } - tags := d.Get("tags").(map[string]interface{}) - arn := d.Get("arn").(string) - dynamodbconn := meta.(*AWSClient).dynamodbconn - req := &dynamodb.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: tagsFromMapDynamoDb(tags), - } - _, err := dynamodbconn.TagResource(req) - if err != nil { - return fmt.Errorf("Error tagging dynamodb resource: %s", err) - } - return nil -} - -func readTableTags(d *schema.ResourceData, meta interface{}) (map[string]string, error) { - if err := waitForTableToBeActive(d.Id(), meta); err != nil { - return nil, err - } - arn := d.Get("arn").(string) - //result := make(map[string]string) - - dynamodbconn := meta.(*AWSClient).dynamodbconn - req := &dynamodb.ListTagsOfResourceInput{ - ResourceArn: aws.String(arn), - } - - output, err := dynamodbconn.ListTagsOfResource(req) - if err != nil { - return nil, fmt.Errorf("Error reading tags from dynamodb resource: %s", err) - } - result := tagsToMapDynamoDb(output.Tags) - // TODO Read NextToken if avail - return result, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ebs_snapshot.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ebs_snapshot.go deleted file mode 100644 index e06a729..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ebs_snapshot.go +++ /dev/null @@ -1,145 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEbsSnapshot() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEbsSnapshotCreate, - Read: resourceAwsEbsSnapshotRead, - Delete: resourceAwsEbsSnapshotDelete, - - Schema: map[string]*schema.Schema{ - "volume_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "owner_id": { - Type: schema.TypeString, - Computed: true, - }, - "owner_alias": { - Type: schema.TypeString, - Computed: true, - }, - "encrypted": { - Type: schema.TypeBool, - Computed: true, - }, - "volume_size": { - Type: schema.TypeInt, - Computed: true, - }, - "kms_key_id": { - Type: schema.TypeString, - Computed: true, - }, - "data_encryption_key_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsEbsSnapshotCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - request := &ec2.CreateSnapshotInput{ - VolumeId: aws.String(d.Get("volume_id").(string)), - } - if v, ok := d.GetOk("description"); ok { - request.Description = aws.String(v.(string)) - } - - res, err := conn.CreateSnapshot(request) - if err != nil { - return err - } - - d.SetId(*res.SnapshotId) - - err = resourceAwsEbsSnapshotWaitForAvailable(d.Id(), conn) - if err != nil { - return err - } - - return resourceAwsEbsSnapshotRead(d, meta) -} - -func resourceAwsEbsSnapshotRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - req := &ec2.DescribeSnapshotsInput{ - SnapshotIds: []*string{aws.String(d.Id())}, - } - res, err := conn.DescribeSnapshots(req) - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidSnapshotID.NotFound" { - log.Printf("Snapshot %q Not found - removing from state", d.Id()) - d.SetId("") - return nil - } - - snapshot := res.Snapshots[0] - - d.Set("description", snapshot.Description) - d.Set("owner_id", snapshot.OwnerId) - d.Set("encrypted", snapshot.Encrypted) - d.Set("owner_alias", snapshot.OwnerAlias) - d.Set("volume_id", snapshot.VolumeId) - d.Set("data_encryption_key_id", snapshot.DataEncryptionKeyId) - d.Set("kms_keey_id", snapshot.KmsKeyId) - d.Set("volume_size", snapshot.VolumeSize) - - return nil -} - -func resourceAwsEbsSnapshotDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - request := &ec2.DeleteSnapshotInput{ - SnapshotId: aws.String(d.Id()), - } - _, err := conn.DeleteSnapshot(request) - if err == nil { - return nil - } - - ebsErr, ok := err.(awserr.Error) - if ebsErr.Code() == "SnapshotInUse" { - return resource.RetryableError(fmt.Errorf("EBS SnapshotInUse - trying again while it detaches")) - } - - if !ok { - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} - -func resourceAwsEbsSnapshotWaitForAvailable(id string, conn *ec2.EC2) error { - log.Printf("Waiting for Snapshot %s to become available...", id) - - req := &ec2.DescribeSnapshotsInput{ - SnapshotIds: []*string{aws.String(id)}, - } - err := conn.WaitUntilSnapshotCompleted(req) - return err -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ebs_volume.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ebs_volume.go deleted file mode 100644 index 49d5281..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ebs_volume.go +++ /dev/null @@ -1,305 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEbsVolume() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEbsVolumeCreate, - Read: resourceAwsEbsVolumeRead, - Update: resourceAWSEbsVolumeUpdate, - Delete: resourceAwsEbsVolumeDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "availability_zone": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "encrypted": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - ForceNew: true, - }, - "iops": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - "kms_key_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - "size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - "snapshot_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "tags": tagsSchema(), - }, - } -} - -func resourceAwsEbsVolumeCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - request := &ec2.CreateVolumeInput{ - AvailabilityZone: aws.String(d.Get("availability_zone").(string)), - } - if value, ok := d.GetOk("encrypted"); ok { - request.Encrypted = aws.Bool(value.(bool)) - } - if value, ok := d.GetOk("kms_key_id"); ok { - request.KmsKeyId = aws.String(value.(string)) - } - if value, ok := d.GetOk("size"); ok { - request.Size = aws.Int64(int64(value.(int))) - } - if value, ok := d.GetOk("snapshot_id"); ok { - request.SnapshotId = aws.String(value.(string)) - } - - // IOPs are only valid, and required for, storage type io1. The current minimu - // is 100. Instead of a hard validation we we only apply the IOPs to the - // request if the type is io1, and log a warning otherwise. This allows users - // to "disable" iops. See https://github.com/hashicorp/terraform/pull/4146 - var t string - if value, ok := d.GetOk("type"); ok { - t = value.(string) - request.VolumeType = aws.String(t) - } - - iops := d.Get("iops").(int) - if t != "io1" && iops > 0 { - log.Printf("[WARN] IOPs is only valid for storate type io1 for EBS Volumes") - } else if t == "io1" { - // We add the iops value without validating it's size, to allow AWS to - // enforce a size requirement (currently 100) - request.Iops = aws.Int64(int64(iops)) - } - - log.Printf( - "[DEBUG] EBS Volume create opts: %s", request) - result, err := conn.CreateVolume(request) - if err != nil { - return fmt.Errorf("Error creating EC2 volume: %s", err) - } - - log.Println("[DEBUG] Waiting for Volume to become available") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating"}, - Target: []string{"available"}, - Refresh: volumeStateRefreshFunc(conn, *result.VolumeId), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Volume (%s) to become available: %s", - *result.VolumeId, err) - } - - d.SetId(*result.VolumeId) - - if _, ok := d.GetOk("tags"); ok { - if err := setTags(conn, d); err != nil { - return errwrap.Wrapf("Error setting tags for EBS Volume: {{err}}", err) - } - } - - return readVolume(d, result) -} - -func resourceAWSEbsVolumeUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - if _, ok := d.GetOk("tags"); ok { - if err := setTags(conn, d); err != nil { - return errwrap.Wrapf("Error updating tags for EBS Volume: {{err}}", err) - } - } - - requestUpdate := false - params := &ec2.ModifyVolumeInput{ - VolumeId: aws.String(d.Id()), - } - - if d.HasChange("size") { - requestUpdate = true - params.Size = aws.Int64(int64(d.Get("size").(int))) - } - - if d.HasChange("type") { - requestUpdate = true - params.VolumeType = aws.String(d.Get("type").(string)) - } - - if d.HasChange("iops") { - requestUpdate = true - params.Iops = aws.Int64(int64(d.Get("iops").(int))) - } - - if requestUpdate { - result, err := conn.ModifyVolume(params) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "modifying"}, - Target: []string{"available"}, - Refresh: volumeStateRefreshFunc(conn, *result.VolumeModification.VolumeId), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Volume (%s) to become available: %s", - *result.VolumeModification.VolumeId, err) - } - } - - return resourceAwsEbsVolumeRead(d, meta) -} - -// volumeStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// a the state of a Volume. Returns successfully when volume is available -func volumeStateRefreshFunc(conn *ec2.EC2, volumeID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeVolumes(&ec2.DescribeVolumesInput{ - VolumeIds: []*string{aws.String(volumeID)}, - }) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - // Set this to nil as if we didn't find anything. - log.Printf("Error on Volume State Refresh: message: \"%s\", code:\"%s\"", ec2err.Message(), ec2err.Code()) - resp = nil - return nil, "", err - } else { - log.Printf("Error on Volume State Refresh: %s", err) - return nil, "", err - } - } - - v := resp.Volumes[0] - return v, *v.State, nil - } -} - -func resourceAwsEbsVolumeRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - request := &ec2.DescribeVolumesInput{ - VolumeIds: []*string{aws.String(d.Id())}, - } - - response, err := conn.DescribeVolumes(request) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVolume.NotFound" { - d.SetId("") - return nil - } - return fmt.Errorf("Error reading EC2 volume %s: %s", d.Id(), err) - } - - return readVolume(d, response.Volumes[0]) -} - -func resourceAwsEbsVolumeDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - request := &ec2.DeleteVolumeInput{ - VolumeId: aws.String(d.Id()), - } - _, err := conn.DeleteVolume(request) - if err == nil { - return nil - } - - ebsErr, ok := err.(awserr.Error) - if ebsErr.Code() == "VolumeInUse" { - return resource.RetryableError(fmt.Errorf("EBS VolumeInUse - trying again while it detaches")) - } - - if !ok { - return resource.NonRetryableError(err) - } - - return resource.NonRetryableError(err) - }) - -} - -func readVolume(d *schema.ResourceData, volume *ec2.Volume) error { - d.SetId(*volume.VolumeId) - - d.Set("availability_zone", *volume.AvailabilityZone) - if volume.Encrypted != nil { - d.Set("encrypted", *volume.Encrypted) - } - if volume.KmsKeyId != nil { - d.Set("kms_key_id", *volume.KmsKeyId) - } - if volume.Size != nil { - d.Set("size", *volume.Size) - } - if volume.SnapshotId != nil { - d.Set("snapshot_id", *volume.SnapshotId) - } - if volume.VolumeType != nil { - d.Set("type", *volume.VolumeType) - } - - if volume.VolumeType != nil && *volume.VolumeType == "io1" { - // Only set the iops attribute if the volume type is io1. Setting otherwise - // can trigger a refresh/plan loop based on the computed value that is given - // from AWS, and prevent us from specifying 0 as a valid iops. - // See https://github.com/hashicorp/terraform/pull/4146 - if volume.Iops != nil { - d.Set("iops", *volume.Iops) - } - } - - if volume.Tags != nil { - d.Set("tags", tagsToMap(volume.Tags)) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecr_repository.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecr_repository.go deleted file mode 100644 index 3a24474..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecr_repository.go +++ /dev/null @@ -1,152 +0,0 @@ -package aws - -import ( - "log" - "time" - - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ecr" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEcrRepository() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEcrRepositoryCreate, - Read: resourceAwsEcrRepositoryRead, - Delete: resourceAwsEcrRepositoryDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "registry_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "repository_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsEcrRepositoryCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecrconn - - input := ecr.CreateRepositoryInput{ - RepositoryName: aws.String(d.Get("name").(string)), - } - - log.Printf("[DEBUG] Creating ECR resository: %s", input) - out, err := conn.CreateRepository(&input) - if err != nil { - return err - } - - repository := *out.Repository - - log.Printf("[DEBUG] ECR repository created: %q", *repository.RepositoryArn) - - d.SetId(*repository.RepositoryName) - d.Set("arn", repository.RepositoryArn) - d.Set("registry_id", repository.RegistryId) - - return resourceAwsEcrRepositoryRead(d, meta) -} - -func resourceAwsEcrRepositoryRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecrconn - - log.Printf("[DEBUG] Reading repository %s", d.Id()) - out, err := conn.DescribeRepositories(&ecr.DescribeRepositoriesInput{ - RepositoryNames: []*string{aws.String(d.Id())}, - }) - if err != nil { - if ecrerr, ok := err.(awserr.Error); ok && ecrerr.Code() == "RepositoryNotFoundException" { - d.SetId("") - return nil - } - return err - } - - repository := out.Repositories[0] - - log.Printf("[DEBUG] Received repository %s", out) - - d.SetId(*repository.RepositoryName) - d.Set("arn", repository.RepositoryArn) - d.Set("registry_id", repository.RegistryId) - d.Set("name", repository.RepositoryName) - - repositoryUrl := buildRepositoryUrl(repository, meta.(*AWSClient).region) - log.Printf("[INFO] Setting the repository url to be %s", repositoryUrl) - d.Set("repository_url", repositoryUrl) - - return nil -} - -func buildRepositoryUrl(repo *ecr.Repository, region string) string { - return fmt.Sprintf("%s.dkr.ecr.%s.amazonaws.com/%s", *repo.RegistryId, region, *repo.RepositoryName) -} - -func resourceAwsEcrRepositoryDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecrconn - - _, err := conn.DeleteRepository(&ecr.DeleteRepositoryInput{ - RepositoryName: aws.String(d.Id()), - RegistryId: aws.String(d.Get("registry_id").(string)), - Force: aws.Bool(true), - }) - if err != nil { - if ecrerr, ok := err.(awserr.Error); ok && ecrerr.Code() == "RepositoryNotFoundException" { - d.SetId("") - return nil - } - return err - } - - log.Printf("[DEBUG] Waiting for ECR Repository %q to be deleted", d.Id()) - err = resource.Retry(20*time.Minute, func() *resource.RetryError { - _, err := conn.DescribeRepositories(&ecr.DescribeRepositoriesInput{ - RepositoryNames: []*string{aws.String(d.Id())}, - }) - - if err != nil { - awsErr, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - - if awsErr.Code() == "RepositoryNotFoundException" { - return nil - } - - return resource.NonRetryableError(err) - } - - return resource.RetryableError( - fmt.Errorf("%q: Timeout while waiting for the ECR Repository to be deleted", d.Id())) - }) - if err != nil { - return err - } - - d.SetId("") - log.Printf("[DEBUG] repository %q deleted.", d.Get("name").(string)) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecr_repository_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecr_repository_policy.go deleted file mode 100644 index 77bfb78..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecr_repository_policy.go +++ /dev/null @@ -1,141 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ecr" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEcrRepositoryPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEcrRepositoryPolicyCreate, - Read: resourceAwsEcrRepositoryPolicyRead, - Update: resourceAwsEcrRepositoryPolicyUpdate, - Delete: resourceAwsEcrRepositoryPolicyDelete, - - Schema: map[string]*schema.Schema{ - "repository": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "policy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "registry_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsEcrRepositoryPolicyCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecrconn - - input := ecr.SetRepositoryPolicyInput{ - RepositoryName: aws.String(d.Get("repository").(string)), - PolicyText: aws.String(d.Get("policy").(string)), - } - - log.Printf("[DEBUG] Creating ECR resository policy: %s", input) - out, err := conn.SetRepositoryPolicy(&input) - if err != nil { - return err - } - - repositoryPolicy := *out - - log.Printf("[DEBUG] ECR repository policy created: %s", *repositoryPolicy.RepositoryName) - - d.SetId(*repositoryPolicy.RepositoryName) - d.Set("registry_id", repositoryPolicy.RegistryId) - - return resourceAwsEcrRepositoryPolicyRead(d, meta) -} - -func resourceAwsEcrRepositoryPolicyRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecrconn - - log.Printf("[DEBUG] Reading repository policy %s", d.Id()) - out, err := conn.GetRepositoryPolicy(&ecr.GetRepositoryPolicyInput{ - RegistryId: aws.String(d.Get("registry_id").(string)), - RepositoryName: aws.String(d.Id()), - }) - if err != nil { - if ecrerr, ok := err.(awserr.Error); ok { - switch ecrerr.Code() { - case "RepositoryNotFoundException", "RepositoryPolicyNotFoundException": - d.SetId("") - return nil - default: - return err - } - } - return err - } - - log.Printf("[DEBUG] Received repository policy %s", out) - - repositoryPolicy := out - - d.SetId(*repositoryPolicy.RepositoryName) - d.Set("registry_id", repositoryPolicy.RegistryId) - - return nil -} - -func resourceAwsEcrRepositoryPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecrconn - - if !d.HasChange("policy") { - return nil - } - - input := ecr.SetRepositoryPolicyInput{ - RepositoryName: aws.String(d.Get("repository").(string)), - RegistryId: aws.String(d.Get("registry_id").(string)), - PolicyText: aws.String(d.Get("policy").(string)), - } - - out, err := conn.SetRepositoryPolicy(&input) - if err != nil { - return err - } - - repositoryPolicy := *out - - d.SetId(*repositoryPolicy.RepositoryName) - d.Set("registry_id", repositoryPolicy.RegistryId) - - return nil -} - -func resourceAwsEcrRepositoryPolicyDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecrconn - - _, err := conn.DeleteRepositoryPolicy(&ecr.DeleteRepositoryPolicyInput{ - RepositoryName: aws.String(d.Id()), - RegistryId: aws.String(d.Get("registry_id").(string)), - }) - if err != nil { - if ecrerr, ok := err.(awserr.Error); ok { - switch ecrerr.Code() { - case "RepositoryNotFoundException", "RepositoryPolicyNotFoundException": - d.SetId("") - return nil - default: - return err - } - } - return err - } - - log.Printf("[DEBUG] repository policy %s deleted.", d.Id()) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_cluster.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_cluster.go deleted file mode 100644 index 0867db1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_cluster.go +++ /dev/null @@ -1,149 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ecs" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEcsCluster() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEcsClusterCreate, - Read: resourceAwsEcsClusterRead, - Delete: resourceAwsEcsClusterDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsEcsClusterCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - clusterName := d.Get("name").(string) - log.Printf("[DEBUG] Creating ECS cluster %s", clusterName) - - out, err := conn.CreateCluster(&ecs.CreateClusterInput{ - ClusterName: aws.String(clusterName), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] ECS cluster %s created", *out.Cluster.ClusterArn) - - d.SetId(*out.Cluster.ClusterArn) - d.Set("name", out.Cluster.ClusterName) - return nil -} - -func resourceAwsEcsClusterRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - clusterName := d.Get("name").(string) - log.Printf("[DEBUG] Reading ECS cluster %s", clusterName) - out, err := conn.DescribeClusters(&ecs.DescribeClustersInput{ - Clusters: []*string{aws.String(clusterName)}, - }) - if err != nil { - return err - } - log.Printf("[DEBUG] Received ECS clusters: %s", out.Clusters) - - for _, c := range out.Clusters { - if *c.ClusterName == clusterName { - // Status==INACTIVE means deleted cluster - if *c.Status == "INACTIVE" { - log.Printf("[DEBUG] Removing ECS cluster %q because it's INACTIVE", *c.ClusterArn) - d.SetId("") - return nil - } - - d.SetId(*c.ClusterArn) - d.Set("name", c.ClusterName) - return nil - } - } - - log.Printf("[ERR] No matching ECS Cluster found for (%s)", d.Id()) - d.SetId("") - return nil -} - -func resourceAwsEcsClusterDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - log.Printf("[DEBUG] Deleting ECS cluster %s", d.Id()) - - err := resource.Retry(10*time.Minute, func() *resource.RetryError { - out, err := conn.DeleteCluster(&ecs.DeleteClusterInput{ - Cluster: aws.String(d.Id()), - }) - - if err == nil { - log.Printf("[DEBUG] ECS cluster %s deleted: %s", d.Id(), out) - return nil - } - - awsErr, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - - if awsErr.Code() == "ClusterContainsContainerInstancesException" { - log.Printf("[TRACE] Retrying ECS cluster %q deletion after %q", d.Id(), awsErr.Code()) - return resource.RetryableError(err) - } - - if awsErr.Code() == "ClusterContainsServicesException" { - log.Printf("[TRACE] Retrying ECS cluster %q deletion after %q", d.Id(), awsErr.Code()) - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - }) - if err != nil { - return err - } - - clusterName := d.Get("name").(string) - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Checking if ECS Cluster %q is INACTIVE", d.Id()) - out, err := conn.DescribeClusters(&ecs.DescribeClustersInput{ - Clusters: []*string{aws.String(clusterName)}, - }) - - for _, c := range out.Clusters { - if *c.ClusterName == clusterName { - if *c.Status == "INACTIVE" { - return nil - } - - return resource.RetryableError( - fmt.Errorf("ECS Cluster %q is still %q", clusterName, *c.Status)) - } - } - - if err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) - if err != nil { - return err - } - - log.Printf("[DEBUG] ECS cluster %q deleted", d.Id()) - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_service.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_service.go deleted file mode 100644 index b539852..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_service.go +++ /dev/null @@ -1,529 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ecs" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -var taskDefinitionRE = regexp.MustCompile("^([a-zA-Z0-9_-]+):([0-9]+)$") - -func resourceAwsEcsService() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEcsServiceCreate, - Read: resourceAwsEcsServiceRead, - Update: resourceAwsEcsServiceUpdate, - Delete: resourceAwsEcsServiceDelete, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "cluster": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "task_definition": { - Type: schema.TypeString, - Required: true, - }, - - "desired_count": { - Type: schema.TypeInt, - Optional: true, - }, - - "iam_role": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - - "deployment_maximum_percent": { - Type: schema.TypeInt, - Optional: true, - Default: 200, - }, - - "deployment_minimum_healthy_percent": { - Type: schema.TypeInt, - Optional: true, - Default: 100, - }, - - "load_balancer": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "elb_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "target_group_arn": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "container_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "container_port": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - }, - }, - Set: resourceAwsEcsLoadBalancerHash, - }, - - "placement_strategy": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - MaxItems: 5, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "field": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - }, - }, - }, - - "placement_constraints": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - MaxItems: 10, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "expression": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - input := ecs.CreateServiceInput{ - ServiceName: aws.String(d.Get("name").(string)), - TaskDefinition: aws.String(d.Get("task_definition").(string)), - DesiredCount: aws.Int64(int64(d.Get("desired_count").(int))), - ClientToken: aws.String(resource.UniqueId()), - DeploymentConfiguration: &ecs.DeploymentConfiguration{ - MaximumPercent: aws.Int64(int64(d.Get("deployment_maximum_percent").(int))), - MinimumHealthyPercent: aws.Int64(int64(d.Get("deployment_minimum_healthy_percent").(int))), - }, - } - - if v, ok := d.GetOk("cluster"); ok { - input.Cluster = aws.String(v.(string)) - } - - loadBalancers := expandEcsLoadBalancers(d.Get("load_balancer").(*schema.Set).List()) - if len(loadBalancers) > 0 { - log.Printf("[DEBUG] Adding ECS load balancers: %s", loadBalancers) - input.LoadBalancers = loadBalancers - } - if v, ok := d.GetOk("iam_role"); ok { - input.Role = aws.String(v.(string)) - } - - strategies := d.Get("placement_strategy").(*schema.Set).List() - if len(strategies) > 0 { - var ps []*ecs.PlacementStrategy - for _, raw := range strategies { - p := raw.(map[string]interface{}) - t := p["type"].(string) - f := p["field"].(string) - if err := validateAwsEcsPlacementStrategy(t, f); err != nil { - return err - } - ps = append(ps, &ecs.PlacementStrategy{ - Type: aws.String(p["type"].(string)), - Field: aws.String(p["field"].(string)), - }) - } - input.PlacementStrategy = ps - } - - constraints := d.Get("placement_constraints").(*schema.Set).List() - if len(constraints) > 0 { - var pc []*ecs.PlacementConstraint - for _, raw := range constraints { - p := raw.(map[string]interface{}) - t := p["type"].(string) - e := p["expression"].(string) - if err := validateAwsEcsPlacementConstraint(t, e); err != nil { - return err - } - constraint := &ecs.PlacementConstraint{ - Type: aws.String(t), - } - if e != "" { - constraint.Expression = aws.String(e) - } - - pc = append(pc, constraint) - } - input.PlacementConstraints = pc - } - - log.Printf("[DEBUG] Creating ECS service: %s", input) - - // Retry due to AWS IAM policy eventual consistency - // See https://github.com/hashicorp/terraform/issues/2869 - var out *ecs.CreateServiceOutput - var err error - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - out, err = conn.CreateService(&input) - - if err != nil { - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - if ec2err.Code() == "InvalidParameterException" { - log.Printf("[DEBUG] Trying to create ECS service again: %q", - ec2err.Message()) - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - } - - return nil - }) - if err != nil { - return fmt.Errorf("%s %q", err, d.Get("name").(string)) - } - - service := *out.Service - - log.Printf("[DEBUG] ECS service created: %s", *service.ServiceArn) - d.SetId(*service.ServiceArn) - - return resourceAwsEcsServiceUpdate(d, meta) -} - -func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - log.Printf("[DEBUG] Reading ECS service %s", d.Id()) - input := ecs.DescribeServicesInput{ - Services: []*string{aws.String(d.Id())}, - Cluster: aws.String(d.Get("cluster").(string)), - } - - out, err := conn.DescribeServices(&input) - if err != nil { - return err - } - - if len(out.Services) < 1 { - log.Printf("[DEBUG] Removing ECS service %s (%s) because it's gone", d.Get("name").(string), d.Id()) - d.SetId("") - return nil - } - - service := out.Services[0] - - // Status==INACTIVE means deleted service - if *service.Status == "INACTIVE" { - log.Printf("[DEBUG] Removing ECS service %q because it's INACTIVE", *service.ServiceArn) - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Received ECS service %s", service) - - d.SetId(*service.ServiceArn) - d.Set("name", service.ServiceName) - - // Save task definition in the same format - if strings.HasPrefix(d.Get("task_definition").(string), "arn:"+meta.(*AWSClient).partition+":ecs:") { - d.Set("task_definition", service.TaskDefinition) - } else { - taskDefinition := buildFamilyAndRevisionFromARN(*service.TaskDefinition) - d.Set("task_definition", taskDefinition) - } - - d.Set("desired_count", service.DesiredCount) - - // Save cluster in the same format - if strings.HasPrefix(d.Get("cluster").(string), "arn:"+meta.(*AWSClient).partition+":ecs:") { - d.Set("cluster", service.ClusterArn) - } else { - clusterARN := getNameFromARN(*service.ClusterArn) - d.Set("cluster", clusterARN) - } - - // Save IAM role in the same format - if service.RoleArn != nil { - if strings.HasPrefix(d.Get("iam_role").(string), "arn:"+meta.(*AWSClient).partition+":iam:") { - d.Set("iam_role", service.RoleArn) - } else { - roleARN := getNameFromARN(*service.RoleArn) - d.Set("iam_role", roleARN) - } - } - - if service.DeploymentConfiguration != nil { - d.Set("deployment_maximum_percent", service.DeploymentConfiguration.MaximumPercent) - d.Set("deployment_minimum_healthy_percent", service.DeploymentConfiguration.MinimumHealthyPercent) - } - - if service.LoadBalancers != nil { - d.Set("load_balancers", flattenEcsLoadBalancers(service.LoadBalancers)) - } - - if err := d.Set("placement_strategy", flattenPlacementStrategy(service.PlacementStrategy)); err != nil { - log.Printf("[ERR] Error setting placement_strategy for (%s): %s", d.Id(), err) - } - if err := d.Set("placement_constraints", flattenServicePlacementConstraints(service.PlacementConstraints)); err != nil { - log.Printf("[ERR] Error setting placement_constraints for (%s): %s", d.Id(), err) - } - - return nil -} - -func flattenServicePlacementConstraints(pcs []*ecs.PlacementConstraint) []map[string]interface{} { - if len(pcs) == 0 { - return nil - } - results := make([]map[string]interface{}, 0) - for _, pc := range pcs { - c := make(map[string]interface{}) - c["type"] = *pc.Type - if pc.Expression != nil { - c["expression"] = *pc.Expression - } - - results = append(results, c) - } - return results -} - -func flattenPlacementStrategy(pss []*ecs.PlacementStrategy) []map[string]interface{} { - if len(pss) == 0 { - return nil - } - results := make([]map[string]interface{}, 0) - for _, ps := range pss { - c := make(map[string]interface{}) - c["type"] = *ps.Type - c["field"] = strings.ToLower(*ps.Field) - results = append(results, c) - } - return results -} - -func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - log.Printf("[DEBUG] Updating ECS service %s", d.Id()) - input := ecs.UpdateServiceInput{ - Service: aws.String(d.Id()), - Cluster: aws.String(d.Get("cluster").(string)), - } - - if d.HasChange("desired_count") { - _, n := d.GetChange("desired_count") - input.DesiredCount = aws.Int64(int64(n.(int))) - } - if d.HasChange("task_definition") { - _, n := d.GetChange("task_definition") - input.TaskDefinition = aws.String(n.(string)) - } - - if d.HasChange("deployment_maximum_percent") || d.HasChange("deployment_minimum_healthy_percent") { - input.DeploymentConfiguration = &ecs.DeploymentConfiguration{ - MaximumPercent: aws.Int64(int64(d.Get("deployment_maximum_percent").(int))), - MinimumHealthyPercent: aws.Int64(int64(d.Get("deployment_minimum_healthy_percent").(int))), - } - } - - out, err := conn.UpdateService(&input) - if err != nil { - return err - } - service := out.Service - log.Printf("[DEBUG] Updated ECS service %s", service) - - return resourceAwsEcsServiceRead(d, meta) -} - -func resourceAwsEcsServiceDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - // Check if it's not already gone - resp, err := conn.DescribeServices(&ecs.DescribeServicesInput{ - Services: []*string{aws.String(d.Id())}, - Cluster: aws.String(d.Get("cluster").(string)), - }) - if err != nil { - return err - } - - if len(resp.Services) == 0 { - log.Printf("[DEBUG] ECS Service %q is already gone", d.Id()) - return nil - } - - log.Printf("[DEBUG] ECS service %s is currently %s", d.Id(), *resp.Services[0].Status) - - if *resp.Services[0].Status == "INACTIVE" { - return nil - } - - // Drain the ECS service - if *resp.Services[0].Status != "DRAINING" { - log.Printf("[DEBUG] Draining ECS service %s", d.Id()) - _, err = conn.UpdateService(&ecs.UpdateServiceInput{ - Service: aws.String(d.Id()), - Cluster: aws.String(d.Get("cluster").(string)), - DesiredCount: aws.Int64(int64(0)), - }) - if err != nil { - return err - } - } - - // Wait until the ECS service is drained - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - input := ecs.DeleteServiceInput{ - Service: aws.String(d.Id()), - Cluster: aws.String(d.Get("cluster").(string)), - } - - log.Printf("[DEBUG] Trying to delete ECS service %s", input) - _, err := conn.DeleteService(&input) - if err == nil { - return nil - } - - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - if ec2err.Code() == "InvalidParameterException" { - // Prevent "The service cannot be stopped while deployments are active." - log.Printf("[DEBUG] Trying to delete ECS service again: %q", - ec2err.Message()) - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - - }) - if err != nil { - return err - } - - // Wait until it's deleted - wait := resource.StateChangeConf{ - Pending: []string{"DRAINING"}, - Target: []string{"INACTIVE"}, - Timeout: 10 * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - log.Printf("[DEBUG] Checking if ECS service %s is INACTIVE", d.Id()) - resp, err := conn.DescribeServices(&ecs.DescribeServicesInput{ - Services: []*string{aws.String(d.Id())}, - Cluster: aws.String(d.Get("cluster").(string)), - }) - if err != nil { - return resp, "FAILED", err - } - - log.Printf("[DEBUG] ECS service (%s) is currently %q", d.Id(), *resp.Services[0].Status) - return resp, *resp.Services[0].Status, nil - }, - } - - _, err = wait.WaitForState() - if err != nil { - return err - } - - log.Printf("[DEBUG] ECS service %s deleted.", d.Id()) - return nil -} - -func resourceAwsEcsLoadBalancerHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["elb_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["container_name"].(string))) - buf.WriteString(fmt.Sprintf("%d-", m["container_port"].(int))) - - return hashcode.String(buf.String()) -} - -func buildFamilyAndRevisionFromARN(arn string) string { - return strings.Split(arn, "/")[1] -} - -// Expects the following ARNs: -// arn:aws:iam::0123456789:role/EcsService -// arn:aws:ecs:us-west-2:0123456789:cluster/radek-cluster -func getNameFromARN(arn string) string { - return strings.Split(arn, "/")[1] -} - -func parseTaskDefinition(taskDefinition string) (string, string, error) { - matches := taskDefinitionRE.FindAllStringSubmatch(taskDefinition, 2) - - if len(matches) == 0 || len(matches[0]) != 3 { - return "", "", fmt.Errorf( - "Invalid task definition format, family:rev or ARN expected (%#v)", - taskDefinition) - } - - return matches[0][1], matches[0][2], nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_task_definition.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_task_definition.go deleted file mode 100644 index 2734afb..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ecs_task_definition.go +++ /dev/null @@ -1,254 +0,0 @@ -package aws - -import ( - "bytes" - "crypto/sha1" - "encoding/hex" - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ecs" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEcsTaskDefinition() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEcsTaskDefinitionCreate, - Read: resourceAwsEcsTaskDefinitionRead, - Delete: resourceAwsEcsTaskDefinitionDelete, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "family": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "revision": { - Type: schema.TypeInt, - Computed: true, - }, - - "container_definitions": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: func(v interface{}) string { - hash := sha1.Sum([]byte(v.(string))) - return hex.EncodeToString(hash[:]) - }, - }, - - "task_role_arn": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "network_mode": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateAwsEcsTaskDefinitionNetworkMode, - }, - - "volume": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "host_path": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - }, - }, - Set: resourceAwsEcsTaskDefinitionVolumeHash, - }, - - "placement_constraints": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - MaxItems: 10, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "expression": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - }, - }, - }, - }, - } -} - -func validateAwsEcsTaskDefinitionNetworkMode(v interface{}, k string) (ws []string, errors []error) { - value := strings.ToLower(v.(string)) - validTypes := map[string]struct{}{ - "bridge": {}, - "host": {}, - "none": {}, - } - - if _, ok := validTypes[value]; !ok { - errors = append(errors, fmt.Errorf("ECS Task Definition network_mode %q is invalid, must be `bridge`, `host` or `none`", value)) - } - return -} - -func resourceAwsEcsTaskDefinitionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - rawDefinitions := d.Get("container_definitions").(string) - definitions, err := expandEcsContainerDefinitions(rawDefinitions) - if err != nil { - return err - } - - input := ecs.RegisterTaskDefinitionInput{ - ContainerDefinitions: definitions, - Family: aws.String(d.Get("family").(string)), - } - - if v, ok := d.GetOk("task_role_arn"); ok { - input.TaskRoleArn = aws.String(v.(string)) - } - - if v, ok := d.GetOk("network_mode"); ok { - input.NetworkMode = aws.String(v.(string)) - } - - if v, ok := d.GetOk("volume"); ok { - volumes, err := expandEcsVolumes(v.(*schema.Set).List()) - if err != nil { - return err - } - input.Volumes = volumes - } - - constraints := d.Get("placement_constraints").(*schema.Set).List() - if len(constraints) > 0 { - var pc []*ecs.TaskDefinitionPlacementConstraint - for _, raw := range constraints { - p := raw.(map[string]interface{}) - t := p["type"].(string) - e := p["expression"].(string) - if err := validateAwsEcsPlacementConstraint(t, e); err != nil { - return err - } - pc = append(pc, &ecs.TaskDefinitionPlacementConstraint{ - Type: aws.String(t), - Expression: aws.String(e), - }) - } - input.PlacementConstraints = pc - } - - log.Printf("[DEBUG] Registering ECS task definition: %s", input) - out, err := conn.RegisterTaskDefinition(&input) - if err != nil { - return err - } - - taskDefinition := *out.TaskDefinition - - log.Printf("[DEBUG] ECS task definition registered: %q (rev. %d)", - *taskDefinition.TaskDefinitionArn, *taskDefinition.Revision) - - d.SetId(*taskDefinition.Family) - d.Set("arn", taskDefinition.TaskDefinitionArn) - - return resourceAwsEcsTaskDefinitionRead(d, meta) -} - -func resourceAwsEcsTaskDefinitionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - log.Printf("[DEBUG] Reading task definition %s", d.Id()) - out, err := conn.DescribeTaskDefinition(&ecs.DescribeTaskDefinitionInput{ - TaskDefinition: aws.String(d.Get("arn").(string)), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] Received task definition %s", out) - - taskDefinition := out.TaskDefinition - - d.SetId(*taskDefinition.Family) - d.Set("arn", taskDefinition.TaskDefinitionArn) - d.Set("family", taskDefinition.Family) - d.Set("revision", taskDefinition.Revision) - d.Set("container_definitions", taskDefinition.ContainerDefinitions) - d.Set("task_role_arn", taskDefinition.TaskRoleArn) - d.Set("network_mode", taskDefinition.NetworkMode) - d.Set("volumes", flattenEcsVolumes(taskDefinition.Volumes)) - if err := d.Set("placement_constraints", flattenPlacementConstraints(taskDefinition.PlacementConstraints)); err != nil { - log.Printf("[ERR] Error setting placement_constraints for (%s): %s", d.Id(), err) - } - - return nil -} - -func flattenPlacementConstraints(pcs []*ecs.TaskDefinitionPlacementConstraint) []map[string]interface{} { - if len(pcs) == 0 { - return nil - } - results := make([]map[string]interface{}, 0) - for _, pc := range pcs { - c := make(map[string]interface{}) - c["type"] = *pc.Type - c["expression"] = *pc.Expression - results = append(results, c) - } - return results -} - -func resourceAwsEcsTaskDefinitionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecsconn - - _, err := conn.DeregisterTaskDefinition(&ecs.DeregisterTaskDefinitionInput{ - TaskDefinition: aws.String(d.Get("arn").(string)), - }) - if err != nil { - return err - } - - log.Printf("[DEBUG] Task definition %q deregistered.", d.Get("arn").(string)) - - return nil -} - -func resourceAwsEcsTaskDefinitionVolumeHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["host_path"].(string))) - - return hashcode.String(buf.String()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_efs_file_system.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_efs_file_system.go deleted file mode 100644 index 445242d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_efs_file_system.go +++ /dev/null @@ -1,274 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/efs" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEfsFileSystem() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEfsFileSystemCreate, - Read: resourceAwsEfsFileSystemRead, - Update: resourceAwsEfsFileSystemUpdate, - Delete: resourceAwsEfsFileSystemDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "creation_token": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateMaxLength(64), - }, - - "reference_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Deprecated: "Please use attribute `creation_token' instead. This attribute might be removed in future releases.", - ValidateFunc: validateReferenceName, - }, - - "performance_mode": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validatePerformanceModeType, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsEfsFileSystemCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).efsconn - - creationToken := "" - if v, ok := d.GetOk("creation_token"); ok { - creationToken = v.(string) - } else { - if v, ok := d.GetOk("reference_name"); ok { - creationToken = resource.PrefixedUniqueId(fmt.Sprintf("%s-", v.(string))) - log.Printf("[WARN] Using deprecated `reference_name' attribute.") - } else { - creationToken = resource.UniqueId() - } - } - - createOpts := &efs.CreateFileSystemInput{ - CreationToken: aws.String(creationToken), - } - - if v, ok := d.GetOk("performance_mode"); ok { - createOpts.PerformanceMode = aws.String(v.(string)) - } - - log.Printf("[DEBUG] EFS file system create options: %#v", *createOpts) - fs, err := conn.CreateFileSystem(createOpts) - if err != nil { - return fmt.Errorf("Error creating EFS file system: %s", err) - } - - d.SetId(*fs.FileSystemId) - log.Printf("[INFO] EFS file system ID: %s", d.Id()) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating"}, - Target: []string{"available"}, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeFileSystems(&efs.DescribeFileSystemsInput{ - FileSystemId: aws.String(d.Id()), - }) - if err != nil { - return nil, "error", err - } - - if hasEmptyFileSystems(resp) { - return nil, "not-found", fmt.Errorf("EFS file system %q could not be found.", d.Id()) - } - - fs := resp.FileSystems[0] - log.Printf("[DEBUG] current status of %q: %q", *fs.FileSystemId, *fs.LifeCycleState) - return fs, *fs.LifeCycleState, nil - }, - Timeout: 10 * time.Minute, - Delay: 2 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for EFS file system (%q) to create: %s", - d.Id(), err.Error()) - } - log.Printf("[DEBUG] EFS file system %q created.", d.Id()) - - return resourceAwsEfsFileSystemUpdate(d, meta) -} - -func resourceAwsEfsFileSystemUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).efsconn - err := setTagsEFS(conn, d) - if err != nil { - return fmt.Errorf("Error setting EC2 tags for EFS file system (%q): %s", - d.Id(), err.Error()) - } - - return resourceAwsEfsFileSystemRead(d, meta) -} - -func resourceAwsEfsFileSystemRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).efsconn - - resp, err := conn.DescribeFileSystems(&efs.DescribeFileSystemsInput{ - FileSystemId: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "FileSystemNotFound" { - log.Printf("[WARN] EFS file system (%s) could not be found.", d.Id()) - d.SetId("") - return nil - } - return err - } - - if hasEmptyFileSystems(resp) { - return fmt.Errorf("EFS file system %q could not be found.", d.Id()) - } - - tags := make([]*efs.Tag, 0) - var marker string - for { - params := &efs.DescribeTagsInput{ - FileSystemId: aws.String(d.Id()), - } - if marker != "" { - params.Marker = aws.String(marker) - } - - tagsResp, err := conn.DescribeTags(params) - if err != nil { - return fmt.Errorf("Error retrieving EC2 tags for EFS file system (%q): %s", - d.Id(), err.Error()) - } - - for _, tag := range tagsResp.Tags { - tags = append(tags, tag) - } - - if tagsResp.NextMarker != nil { - marker = *tagsResp.NextMarker - } else { - break - } - } - - err = d.Set("tags", tagsToMapEFS(tags)) - if err != nil { - return err - } - - var fs *efs.FileSystemDescription - for _, f := range resp.FileSystems { - if d.Id() == *f.FileSystemId { - fs = f - break - } - } - if fs == nil { - log.Printf("[WARN] EFS (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - - d.Set("creation_token", fs.CreationToken) - d.Set("performance_mode", fs.PerformanceMode) - - return nil -} - -func resourceAwsEfsFileSystemDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).efsconn - - log.Printf("[DEBUG] Deleting EFS file system: %s", d.Id()) - _, err := conn.DeleteFileSystem(&efs.DeleteFileSystemInput{ - FileSystemId: aws.String(d.Id()), - }) - stateConf := &resource.StateChangeConf{ - Pending: []string{"available", "deleting"}, - Target: []string{}, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeFileSystems(&efs.DescribeFileSystemsInput{ - FileSystemId: aws.String(d.Id()), - }) - if err != nil { - efsErr, ok := err.(awserr.Error) - if ok && efsErr.Code() == "FileSystemNotFound" { - return nil, "", nil - } - return nil, "error", err - } - - if hasEmptyFileSystems(resp) { - return nil, "", nil - } - - fs := resp.FileSystems[0] - log.Printf("[DEBUG] current status of %q: %q", *fs.FileSystemId, *fs.LifeCycleState) - return fs, *fs.LifeCycleState, nil - }, - Timeout: 10 * time.Minute, - Delay: 2 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for EFS file system (%q) to delete: %s", - d.Id(), err.Error()) - } - - log.Printf("[DEBUG] EFS file system %q deleted.", d.Id()) - - return nil -} - -func validateReferenceName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - creationToken := resource.PrefixedUniqueId(fmt.Sprintf("%s-", value)) - if len(creationToken) > 64 { - errors = append(errors, fmt.Errorf( - "%q cannot take the Creation Token over the limit of 64 characters: %q", k, value)) - } - return -} - -func validatePerformanceModeType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != efs.PerformanceModeGeneralPurpose && value != efs.PerformanceModeMaxIo { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Performance Mode %q. Valid modes are either %q or %q.", - k, value, efs.PerformanceModeGeneralPurpose, efs.PerformanceModeMaxIo)) - } - return -} - -func hasEmptyFileSystems(fs *efs.DescribeFileSystemsOutput) bool { - if fs != nil && len(fs.FileSystems) > 0 { - return false - } - return true -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_efs_mount_target.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_efs_mount_target.go deleted file mode 100644 index 5014478..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_efs_mount_target.go +++ /dev/null @@ -1,298 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/efs" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEfsMountTarget() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEfsMountTargetCreate, - Read: resourceAwsEfsMountTargetRead, - Update: resourceAwsEfsMountTargetUpdate, - Delete: resourceAwsEfsMountTargetDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "file_system_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "ip_address": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, - }, - - "security_groups": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Computed: true, - Optional: true, - }, - - "subnet_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "network_interface_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "dns_name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsEfsMountTargetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).efsconn - - fsId := d.Get("file_system_id").(string) - subnetId := d.Get("subnet_id").(string) - - // CreateMountTarget would return the same Mount Target ID - // to parallel requests if they both include the same AZ - // and we would end up managing the same MT as 2 resources. - // So we make it fail by calling 1 request per AZ at a time. - az, err := getAzFromSubnetId(subnetId, meta.(*AWSClient).ec2conn) - if err != nil { - return fmt.Errorf("Failed getting Availability Zone from subnet ID (%s): %s", subnetId, err) - } - mtKey := "efs-mt-" + fsId + "-" + az - awsMutexKV.Lock(mtKey) - defer awsMutexKV.Unlock(mtKey) - - input := efs.CreateMountTargetInput{ - FileSystemId: aws.String(fsId), - SubnetId: aws.String(subnetId), - } - - if v, ok := d.GetOk("ip_address"); ok { - input.IpAddress = aws.String(v.(string)) - } - if v, ok := d.GetOk("security_groups"); ok { - input.SecurityGroups = expandStringList(v.(*schema.Set).List()) - } - - log.Printf("[DEBUG] Creating EFS mount target: %#v", input) - - mt, err := conn.CreateMountTarget(&input) - if err != nil { - return err - } - - d.SetId(*mt.MountTargetId) - log.Printf("[INFO] EFS mount target ID: %s", d.Id()) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating"}, - Target: []string{"available"}, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeMountTargets(&efs.DescribeMountTargetsInput{ - MountTargetId: aws.String(d.Id()), - }) - if err != nil { - return nil, "error", err - } - - if hasEmptyMountTargets(resp) { - return nil, "error", fmt.Errorf("EFS mount target %q could not be found.", d.Id()) - } - - mt := resp.MountTargets[0] - - log.Printf("[DEBUG] Current status of %q: %q", *mt.MountTargetId, *mt.LifeCycleState) - return mt, *mt.LifeCycleState, nil - }, - Timeout: 10 * time.Minute, - Delay: 2 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for EFS mount target (%s) to create: %s", d.Id(), err) - } - - log.Printf("[DEBUG] EFS mount target created: %s", *mt.MountTargetId) - - return resourceAwsEfsMountTargetRead(d, meta) -} - -func resourceAwsEfsMountTargetUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).efsconn - - if d.HasChange("security_groups") { - input := efs.ModifyMountTargetSecurityGroupsInput{ - MountTargetId: aws.String(d.Id()), - SecurityGroups: expandStringList(d.Get("security_groups").(*schema.Set).List()), - } - _, err := conn.ModifyMountTargetSecurityGroups(&input) - if err != nil { - return err - } - } - - return resourceAwsEfsMountTargetRead(d, meta) -} - -func resourceAwsEfsMountTargetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).efsconn - resp, err := conn.DescribeMountTargets(&efs.DescribeMountTargetsInput{ - MountTargetId: aws.String(d.Id()), - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "MountTargetNotFound" { - // The EFS mount target could not be found, - // which would indicate that it might be - // already deleted. - log.Printf("[WARN] EFS mount target %q could not be found.", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Error reading EFS mount target %s: %s", d.Id(), err) - } - - if hasEmptyMountTargets(resp) { - return fmt.Errorf("EFS mount target %q could not be found.", d.Id()) - } - - mt := resp.MountTargets[0] - - log.Printf("[DEBUG] Found EFS mount target: %#v", mt) - - d.SetId(*mt.MountTargetId) - d.Set("file_system_id", mt.FileSystemId) - d.Set("ip_address", mt.IpAddress) - d.Set("subnet_id", mt.SubnetId) - d.Set("network_interface_id", mt.NetworkInterfaceId) - - sgResp, err := conn.DescribeMountTargetSecurityGroups(&efs.DescribeMountTargetSecurityGroupsInput{ - MountTargetId: aws.String(d.Id()), - }) - if err != nil { - return err - } - - err = d.Set("security_groups", schema.NewSet(schema.HashString, flattenStringList(sgResp.SecurityGroups))) - if err != nil { - return err - } - - // DNS name per http://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html - _, err = getAzFromSubnetId(*mt.SubnetId, meta.(*AWSClient).ec2conn) - if err != nil { - return fmt.Errorf("Failed getting Availability Zone from subnet ID (%s): %s", *mt.SubnetId, err) - } - - region := meta.(*AWSClient).region - err = d.Set("dns_name", resourceAwsEfsMountTargetDnsName(*mt.FileSystemId, region)) - if err != nil { - return err - } - - return nil -} - -func getAzFromSubnetId(subnetId string, conn *ec2.EC2) (string, error) { - input := ec2.DescribeSubnetsInput{ - SubnetIds: []*string{aws.String(subnetId)}, - } - out, err := conn.DescribeSubnets(&input) - if err != nil { - return "", err - } - - if l := len(out.Subnets); l != 1 { - return "", fmt.Errorf("Expected exactly 1 subnet returned for %q, got: %d", subnetId, l) - } - - return *out.Subnets[0].AvailabilityZone, nil -} - -func resourceAwsEfsMountTargetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).efsconn - - log.Printf("[DEBUG] Deleting EFS mount target %q", d.Id()) - _, err := conn.DeleteMountTarget(&efs.DeleteMountTargetInput{ - MountTargetId: aws.String(d.Id()), - }) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"available", "deleting", "deleted"}, - Target: []string{}, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeMountTargets(&efs.DescribeMountTargetsInput{ - MountTargetId: aws.String(d.Id()), - }) - if err != nil { - awsErr, ok := err.(awserr.Error) - if !ok { - return nil, "error", err - } - - if awsErr.Code() == "MountTargetNotFound" { - return nil, "", nil - } - - return nil, "error", awsErr - } - - if hasEmptyMountTargets(resp) { - return nil, "", nil - } - - mt := resp.MountTargets[0] - - log.Printf("[DEBUG] Current status of %q: %q", *mt.MountTargetId, *mt.LifeCycleState) - return mt, *mt.LifeCycleState, nil - }, - Timeout: 10 * time.Minute, - Delay: 2 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for EFS mount target (%q) to delete: %s", - d.Id(), err.Error()) - } - - log.Printf("[DEBUG] EFS mount target %q deleted.", d.Id()) - - return nil -} - -func resourceAwsEfsMountTargetDnsName(fileSystemId, region string) string { - return fmt.Sprintf("%s.efs.%s.amazonaws.com", fileSystemId, region) -} - -func hasEmptyMountTargets(mto *efs.DescribeMountTargetsOutput) bool { - if mto != nil && len(mto.MountTargets) > 0 { - return false - } - return true -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_egress_only_internet_gateway.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_egress_only_internet_gateway.go deleted file mode 100644 index 14a01e7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_egress_only_internet_gateway.go +++ /dev/null @@ -1,126 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEgressOnlyInternetGateway() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEgressOnlyInternetGatewayCreate, - Read: resourceAwsEgressOnlyInternetGatewayRead, - Delete: resourceAwsEgressOnlyInternetGatewayDelete, - - Schema: map[string]*schema.Schema{ - "vpc_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsEgressOnlyInternetGatewayCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.CreateEgressOnlyInternetGateway(&ec2.CreateEgressOnlyInternetGatewayInput{ - VpcId: aws.String(d.Get("vpc_id").(string)), - }) - if err != nil { - return fmt.Errorf("Error creating egress internet gateway: %s", err) - } - - d.SetId(*resp.EgressOnlyInternetGateway.EgressOnlyInternetGatewayId) - - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - igRaw, _, err := EIGWStateRefreshFunc(conn, d.Id())() - if igRaw != nil { - return nil - } - if err == nil { - return resource.RetryableError(err) - } else { - return resource.NonRetryableError(err) - } - }) - - if err != nil { - return errwrap.Wrapf("{{err}}", err) - } - - return resourceAwsEgressOnlyInternetGatewayRead(d, meta) -} - -func EIGWStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeEgressOnlyInternetGateways(&ec2.DescribeEgressOnlyInternetGatewaysInput{ - EgressOnlyInternetGatewayIds: []*string{aws.String(id)}, - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "InvalidEgressInternetGatewayID.NotFound" { - resp = nil - } else { - log.Printf("[ERROR] Error on EIGWStateRefreshFunc: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - ig := resp.EgressOnlyInternetGateways[0] - return ig, "available", nil - } -} - -func resourceAwsEgressOnlyInternetGatewayRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeEgressOnlyInternetGateways(&ec2.DescribeEgressOnlyInternetGatewaysInput{ - EgressOnlyInternetGatewayIds: []*string{aws.String(d.Id())}, - }) - if err != nil { - return fmt.Errorf("Error describing egress internet gateway: %s", err) - } - - found := false - for _, igw := range resp.EgressOnlyInternetGateways { - if *igw.EgressOnlyInternetGatewayId == d.Id() { - found = true - } - } - - if !found { - log.Printf("[Error] Cannot find Egress Only Internet Gateway: %q", d.Id()) - d.SetId("") - return nil - } - - return nil -} - -func resourceAwsEgressOnlyInternetGatewayDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - _, err := conn.DeleteEgressOnlyInternetGateway(&ec2.DeleteEgressOnlyInternetGatewayInput{ - EgressOnlyInternetGatewayId: aws.String(d.Id()), - }) - if err != nil { - return fmt.Errorf("Error deleting egress internet gateway: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_eip.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_eip.go deleted file mode 100644 index 5f52e86..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_eip.go +++ /dev/null @@ -1,326 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "net" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEip() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEipCreate, - Read: resourceAwsEipRead, - Update: resourceAwsEipUpdate, - Delete: resourceAwsEipDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "vpc": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "instance": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "network_interface": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "allocation_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "association_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "domain": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "public_ip": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "private_ip": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "associate_with_private_ip": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func resourceAwsEipCreate(d *schema.ResourceData, meta interface{}) error { - ec2conn := meta.(*AWSClient).ec2conn - - // By default, we're not in a VPC - domainOpt := "" - if v := d.Get("vpc"); v != nil && v.(bool) { - domainOpt = "vpc" - } - - allocOpts := &ec2.AllocateAddressInput{ - Domain: aws.String(domainOpt), - } - - log.Printf("[DEBUG] EIP create configuration: %#v", allocOpts) - allocResp, err := ec2conn.AllocateAddress(allocOpts) - if err != nil { - return fmt.Errorf("Error creating EIP: %s", err) - } - - // The domain tells us if we're in a VPC or not - d.Set("domain", allocResp.Domain) - - // Assign the eips (unique) allocation id for use later - // the EIP api has a conditional unique ID (really), so - // if we're in a VPC we need to save the ID as such, otherwise - // it defaults to using the public IP - log.Printf("[DEBUG] EIP Allocate: %#v", allocResp) - if d.Get("domain").(string) == "vpc" { - d.SetId(*allocResp.AllocationId) - } else { - d.SetId(*allocResp.PublicIp) - } - - log.Printf("[INFO] EIP ID: %s (domain: %v)", d.Id(), *allocResp.Domain) - return resourceAwsEipUpdate(d, meta) -} - -func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { - ec2conn := meta.(*AWSClient).ec2conn - - domain := resourceAwsEipDomain(d) - id := d.Id() - - req := &ec2.DescribeAddressesInput{} - - if domain == "vpc" { - req.AllocationIds = []*string{aws.String(id)} - } else { - req.PublicIps = []*string{aws.String(id)} - } - - log.Printf( - "[DEBUG] EIP describe configuration: %s (domain: %s)", - req, domain) - - describeAddresses, err := ec2conn.DescribeAddresses(req) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && (ec2err.Code() == "InvalidAllocationID.NotFound" || ec2err.Code() == "InvalidAddress.NotFound") { - d.SetId("") - return nil - } - - return fmt.Errorf("Error retrieving EIP: %s", err) - } - - // Verify AWS returned our EIP - if len(describeAddresses.Addresses) != 1 || - domain == "vpc" && *describeAddresses.Addresses[0].AllocationId != id || - *describeAddresses.Addresses[0].PublicIp != id { - if err != nil { - return fmt.Errorf("Unable to find EIP: %#v", describeAddresses.Addresses) - } - } - - address := describeAddresses.Addresses[0] - - d.Set("association_id", address.AssociationId) - if address.InstanceId != nil { - d.Set("instance", address.InstanceId) - } else { - d.Set("instance", "") - } - if address.NetworkInterfaceId != nil { - d.Set("network_interface", address.NetworkInterfaceId) - } else { - d.Set("network_interface", "") - } - d.Set("private_ip", address.PrivateIpAddress) - d.Set("public_ip", address.PublicIp) - - // On import (domain never set, which it must've been if we created), - // set the 'vpc' attribute depending on if we're in a VPC. - if address.Domain != nil { - d.Set("vpc", *address.Domain == "vpc") - } - - d.Set("domain", address.Domain) - - // Force ID to be an Allocation ID if we're on a VPC - // This allows users to import the EIP based on the IP if they are in a VPC - if *address.Domain == "vpc" && net.ParseIP(id) != nil { - log.Printf("[DEBUG] Re-assigning EIP ID (%s) to it's Allocation ID (%s)", d.Id(), *address.AllocationId) - d.SetId(*address.AllocationId) - } - - return nil -} - -func resourceAwsEipUpdate(d *schema.ResourceData, meta interface{}) error { - ec2conn := meta.(*AWSClient).ec2conn - - domain := resourceAwsEipDomain(d) - - // Associate to instance or interface if specified - v_instance, ok_instance := d.GetOk("instance") - v_interface, ok_interface := d.GetOk("network_interface") - - if ok_instance || ok_interface { - instanceId := v_instance.(string) - networkInterfaceId := v_interface.(string) - - assocOpts := &ec2.AssociateAddressInput{ - InstanceId: aws.String(instanceId), - PublicIp: aws.String(d.Id()), - } - - // more unique ID conditionals - if domain == "vpc" { - var privateIpAddress *string - if v := d.Get("associate_with_private_ip").(string); v != "" { - privateIpAddress = aws.String(v) - } - assocOpts = &ec2.AssociateAddressInput{ - NetworkInterfaceId: aws.String(networkInterfaceId), - InstanceId: aws.String(instanceId), - AllocationId: aws.String(d.Id()), - PrivateIpAddress: privateIpAddress, - } - } - - log.Printf("[DEBUG] EIP associate configuration: %s (domain: %s)", assocOpts, domain) - - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := ec2conn.AssociateAddress(assocOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "InvalidAllocationID.NotFound" { - return resource.RetryableError(awsErr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - // Prevent saving instance if association failed - // e.g. missing internet gateway in VPC - d.Set("instance", "") - d.Set("network_interface", "") - return fmt.Errorf("Failure associating EIP: %s", err) - } - } - - return resourceAwsEipRead(d, meta) -} - -func resourceAwsEipDelete(d *schema.ResourceData, meta interface{}) error { - ec2conn := meta.(*AWSClient).ec2conn - - if err := resourceAwsEipRead(d, meta); err != nil { - return err - } - if d.Id() == "" { - // This might happen from the read - return nil - } - - // If we are attached to an instance or interface, detach first. - if d.Get("instance").(string) != "" || d.Get("association_id").(string) != "" { - log.Printf("[DEBUG] Disassociating EIP: %s", d.Id()) - var err error - switch resourceAwsEipDomain(d) { - case "vpc": - _, err = ec2conn.DisassociateAddress(&ec2.DisassociateAddressInput{ - AssociationId: aws.String(d.Get("association_id").(string)), - }) - case "standard": - _, err = ec2conn.DisassociateAddress(&ec2.DisassociateAddressInput{ - PublicIp: aws.String(d.Get("public_ip").(string)), - }) - } - - if err != nil { - // First check if the association ID is not found. If this - // is the case, then it was already disassociated somehow, - // and that is okay. The most commmon reason for this is that - // the instance or ENI it was attached it was destroyed. - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidAssociationID.NotFound" { - err = nil - } - } - - if err != nil { - return err - } - } - - domain := resourceAwsEipDomain(d) - return resource.Retry(3*time.Minute, func() *resource.RetryError { - var err error - switch domain { - case "vpc": - log.Printf( - "[DEBUG] EIP release (destroy) address allocation: %v", - d.Id()) - _, err = ec2conn.ReleaseAddress(&ec2.ReleaseAddressInput{ - AllocationId: aws.String(d.Id()), - }) - case "standard": - log.Printf("[DEBUG] EIP release (destroy) address: %v", d.Id()) - _, err = ec2conn.ReleaseAddress(&ec2.ReleaseAddressInput{ - PublicIp: aws.String(d.Id()), - }) - } - - if err == nil { - return nil - } - if _, ok := err.(awserr.Error); !ok { - return resource.NonRetryableError(err) - } - - return resource.RetryableError(err) - }) -} - -func resourceAwsEipDomain(d *schema.ResourceData) string { - if v, ok := d.GetOk("domain"); ok { - return v.(string) - } else if strings.Contains(d.Id(), "eipalloc") { - // We have to do this for backwards compatibility since TF 0.1 - // didn't have the "domain" computed attribute. - return "vpc" - } - - return "standard" -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_eip_association.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_eip_association.go deleted file mode 100644 index b3db865..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_eip_association.go +++ /dev/null @@ -1,163 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEipAssociation() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEipAssociationCreate, - Read: resourceAwsEipAssociationRead, - Delete: resourceAwsEipAssociationDelete, - - Schema: map[string]*schema.Schema{ - "allocation_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "allow_reassociation": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - }, - - "instance_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "network_interface_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "private_ip_address": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "public_ip": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsEipAssociationCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - request := &ec2.AssociateAddressInput{} - - if v, ok := d.GetOk("allocation_id"); ok { - request.AllocationId = aws.String(v.(string)) - } - if v, ok := d.GetOk("allow_reassociation"); ok { - request.AllowReassociation = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("instance_id"); ok { - request.InstanceId = aws.String(v.(string)) - } - if v, ok := d.GetOk("network_interface_id"); ok { - request.NetworkInterfaceId = aws.String(v.(string)) - } - if v, ok := d.GetOk("private_ip_address"); ok { - request.PrivateIpAddress = aws.String(v.(string)) - } - if v, ok := d.GetOk("public_ip"); ok { - request.PublicIp = aws.String(v.(string)) - } - - log.Printf("[DEBUG] EIP association configuration: %#v", request) - - resp, err := conn.AssociateAddress(request) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - return fmt.Errorf("[WARN] Error attaching EIP, message: \"%s\", code: \"%s\"", - awsErr.Message(), awsErr.Code()) - } - return err - } - - d.SetId(*resp.AssociationId) - - return resourceAwsEipAssociationRead(d, meta) -} - -func resourceAwsEipAssociationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - request := &ec2.DescribeAddressesInput{ - Filters: []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("association-id"), - Values: []*string{aws.String(d.Id())}, - }, - }, - } - - response, err := conn.DescribeAddresses(request) - if err != nil { - return fmt.Errorf("Error reading EC2 Elastic IP %s: %#v", d.Get("allocation_id").(string), err) - } - - if response.Addresses == nil || len(response.Addresses) == 0 { - log.Printf("[INFO] EIP Association ID Not Found. Refreshing from state") - d.SetId("") - return nil - } - - return readAwsEipAssociation(d, response.Addresses[0]) -} - -func resourceAwsEipAssociationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - opts := &ec2.DisassociateAddressInput{ - AssociationId: aws.String(d.Id()), - } - - _, err := conn.DisassociateAddress(opts) - if err != nil { - return fmt.Errorf("Error deleting Elastic IP association: %s", err) - } - - return nil -} - -func readAwsEipAssociation(d *schema.ResourceData, address *ec2.Address) error { - if err := d.Set("allocation_id", address.AllocationId); err != nil { - return err - } - if err := d.Set("instance_id", address.InstanceId); err != nil { - return err - } - if err := d.Set("network_interface_id", address.NetworkInterfaceId); err != nil { - return err - } - if err := d.Set("private_ip_address", address.PrivateIpAddress); err != nil { - return err - } - if err := d.Set("public_ip", address.PublicIp); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_application.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_application.go deleted file mode 100644 index 2123325..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_application.go +++ /dev/null @@ -1,152 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - "github.com/hashicorp/terraform/helper/resource" -) - -func resourceAwsElasticBeanstalkApplication() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticBeanstalkApplicationCreate, - Read: resourceAwsElasticBeanstalkApplicationRead, - Update: resourceAwsElasticBeanstalkApplicationUpdate, - Delete: resourceAwsElasticBeanstalkApplicationDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: false, - }, - }, - } -} - -func resourceAwsElasticBeanstalkApplicationCreate(d *schema.ResourceData, meta interface{}) error { - beanstalkConn := meta.(*AWSClient).elasticbeanstalkconn - - // Get the name and description - name := d.Get("name").(string) - description := d.Get("description").(string) - - log.Printf("[DEBUG] Elastic Beanstalk application create: %s, description: %s", name, description) - - req := &elasticbeanstalk.CreateApplicationInput{ - ApplicationName: aws.String(name), - Description: aws.String(description), - } - - _, err := beanstalkConn.CreateApplication(req) - if err != nil { - return err - } - - d.SetId(name) - - return resourceAwsElasticBeanstalkApplicationRead(d, meta) -} - -func resourceAwsElasticBeanstalkApplicationUpdate(d *schema.ResourceData, meta interface{}) error { - beanstalkConn := meta.(*AWSClient).elasticbeanstalkconn - - if d.HasChange("description") { - if err := resourceAwsElasticBeanstalkApplicationDescriptionUpdate(beanstalkConn, d); err != nil { - return err - } - } - - return resourceAwsElasticBeanstalkApplicationRead(d, meta) -} - -func resourceAwsElasticBeanstalkApplicationDescriptionUpdate(beanstalkConn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { - name := d.Get("name").(string) - description := d.Get("description").(string) - - log.Printf("[DEBUG] Elastic Beanstalk application: %s, update description: %s", name, description) - - _, err := beanstalkConn.UpdateApplication(&elasticbeanstalk.UpdateApplicationInput{ - ApplicationName: aws.String(name), - Description: aws.String(description), - }) - - return err -} - -func resourceAwsElasticBeanstalkApplicationRead(d *schema.ResourceData, meta interface{}) error { - a, err := getBeanstalkApplication(d, meta) - if err != nil { - return err - } - if a == nil { - return err - } - - d.Set("name", a.ApplicationName) - d.Set("description", a.Description) - return nil -} - -func resourceAwsElasticBeanstalkApplicationDelete(d *schema.ResourceData, meta interface{}) error { - beanstalkConn := meta.(*AWSClient).elasticbeanstalkconn - - a, err := getBeanstalkApplication(d, meta) - if err != nil { - return err - } - _, err = beanstalkConn.DeleteApplication(&elasticbeanstalk.DeleteApplicationInput{ - ApplicationName: aws.String(d.Id()), - }) - - return resource.Retry(10*time.Second, func() *resource.RetryError { - if a, _ = getBeanstalkApplication(d, meta); a != nil { - return resource.RetryableError( - fmt.Errorf("Beanstalk Application still exists")) - } - return nil - }) -} - -func getBeanstalkApplication( - d *schema.ResourceData, - meta interface{}) (*elasticbeanstalk.ApplicationDescription, error) { - conn := meta.(*AWSClient).elasticbeanstalkconn - - resp, err := conn.DescribeApplications(&elasticbeanstalk.DescribeApplicationsInput{ - ApplicationNames: []*string{aws.String(d.Id())}, - }) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() != "InvalidBeanstalkAppID.NotFound" { - log.Printf("[Err] Error reading Elastic Beanstalk Application (%s): Application not found", d.Id()) - d.SetId("") - return nil, nil - } - return nil, err - } - - switch { - case len(resp.Applications) > 1: - return nil, fmt.Errorf("Error %d Applications matched, expected 1", len(resp.Applications)) - case len(resp.Applications) == 0: - d.SetId("") - return nil, nil - default: - return resp.Applications[0], nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version.go deleted file mode 100644 index 9125225..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version.go +++ /dev/null @@ -1,202 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - "time" -) - -func resourceAwsElasticBeanstalkApplicationVersion() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticBeanstalkApplicationVersionCreate, - Read: resourceAwsElasticBeanstalkApplicationVersionRead, - Update: resourceAwsElasticBeanstalkApplicationVersionUpdate, - Delete: resourceAwsElasticBeanstalkApplicationVersionDelete, - - Schema: map[string]*schema.Schema{ - "application": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "bucket": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "key": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "force_delete": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } -} - -func resourceAwsElasticBeanstalkApplicationVersionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - application := d.Get("application").(string) - description := d.Get("description").(string) - bucket := d.Get("bucket").(string) - key := d.Get("key").(string) - name := d.Get("name").(string) - - s3Location := elasticbeanstalk.S3Location{ - S3Bucket: aws.String(bucket), - S3Key: aws.String(key), - } - - createOpts := elasticbeanstalk.CreateApplicationVersionInput{ - ApplicationName: aws.String(application), - Description: aws.String(description), - SourceBundle: &s3Location, - VersionLabel: aws.String(name), - } - - log.Printf("[DEBUG] Elastic Beanstalk Application Version create opts: %s", createOpts) - _, err := conn.CreateApplicationVersion(&createOpts) - if err != nil { - return err - } - - d.SetId(name) - log.Printf("[INFO] Elastic Beanstalk Application Version Label: %s", name) - - return resourceAwsElasticBeanstalkApplicationVersionRead(d, meta) -} - -func resourceAwsElasticBeanstalkApplicationVersionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - resp, err := conn.DescribeApplicationVersions(&elasticbeanstalk.DescribeApplicationVersionsInput{ - VersionLabels: []*string{aws.String(d.Id())}, - }) - - if err != nil { - return err - } - - if len(resp.ApplicationVersions) == 0 { - log.Printf("[DEBUG] Elastic Beanstalk application version read: application version not found") - - d.SetId("") - - return nil - } else if len(resp.ApplicationVersions) != 1 { - return fmt.Errorf("Error reading application version properties: found %d application versions, expected 1", len(resp.ApplicationVersions)) - } - - if err := d.Set("description", resp.ApplicationVersions[0].Description); err != nil { - return err - } - - return nil -} - -func resourceAwsElasticBeanstalkApplicationVersionUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - if d.HasChange("description") { - if err := resourceAwsElasticBeanstalkApplicationVersionDescriptionUpdate(conn, d); err != nil { - return err - } - } - - return resourceAwsElasticBeanstalkApplicationVersionRead(d, meta) - -} - -func resourceAwsElasticBeanstalkApplicationVersionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - application := d.Get("application").(string) - name := d.Id() - - if d.Get("force_delete").(bool) == false { - environments, err := versionUsedBy(application, name, conn) - if err != nil { - return err - } - - if len(environments) > 1 { - return fmt.Errorf("Unable to delete Application Version, it is currently in use by the following environments: %s.", environments) - } - } - _, err := conn.DeleteApplicationVersion(&elasticbeanstalk.DeleteApplicationVersionInput{ - ApplicationName: aws.String(application), - VersionLabel: aws.String(name), - DeleteSourceBundle: aws.Bool(false), - }) - - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - // application version is pending delete, or no longer exists. - if awserr.Code() == "InvalidParameterValue" { - d.SetId("") - return nil - } - } - return err - } - - d.SetId("") - return nil -} - -func resourceAwsElasticBeanstalkApplicationVersionDescriptionUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { - application := d.Get("application").(string) - description := d.Get("description").(string) - name := d.Get("name").(string) - - log.Printf("[DEBUG] Elastic Beanstalk application version: %s, update description: %s", name, description) - - _, err := conn.UpdateApplicationVersion(&elasticbeanstalk.UpdateApplicationVersionInput{ - ApplicationName: aws.String(application), - Description: aws.String(description), - VersionLabel: aws.String(name), - }) - - return err -} - -func versionUsedBy(applicationName, versionLabel string, conn *elasticbeanstalk.ElasticBeanstalk) ([]string, error) { - now := time.Now() - resp, err := conn.DescribeEnvironments(&elasticbeanstalk.DescribeEnvironmentsInput{ - ApplicationName: aws.String(applicationName), - VersionLabel: aws.String(versionLabel), - IncludeDeleted: aws.Bool(true), - IncludedDeletedBackTo: aws.Time(now.Add(-1 * time.Minute)), - }) - - if err != nil { - return nil, err - } - - var environmentIDs []string - for _, environment := range resp.Environments { - environmentIDs = append(environmentIDs, *environment.EnvironmentId) - } - - return environmentIDs, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_configuration_template.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_configuration_template.go deleted file mode 100644 index 346fcd5..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_configuration_template.go +++ /dev/null @@ -1,240 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" -) - -func resourceAwsElasticBeanstalkConfigurationTemplate() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticBeanstalkConfigurationTemplateCreate, - Read: resourceAwsElasticBeanstalkConfigurationTemplateRead, - Update: resourceAwsElasticBeanstalkConfigurationTemplateUpdate, - Delete: resourceAwsElasticBeanstalkConfigurationTemplateDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "application": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "environment_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "setting": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: resourceAwsElasticBeanstalkOptionSetting(), - Set: optionSettingValueHash, - }, - "solution_stack_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsElasticBeanstalkConfigurationTemplateCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - // Get the relevant properties - name := d.Get("name").(string) - appName := d.Get("application").(string) - - optionSettings := gatherOptionSettings(d) - - opts := elasticbeanstalk.CreateConfigurationTemplateInput{ - ApplicationName: aws.String(appName), - TemplateName: aws.String(name), - OptionSettings: optionSettings, - } - - if attr, ok := d.GetOk("description"); ok { - opts.Description = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("environment_id"); ok { - opts.EnvironmentId = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("solution_stack_name"); ok { - opts.SolutionStackName = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] Elastic Beanstalk configuration template create opts: %s", opts) - if _, err := conn.CreateConfigurationTemplate(&opts); err != nil { - return fmt.Errorf("Error creating Elastic Beanstalk configuration template: %s", err) - } - - d.SetId(name) - - return resourceAwsElasticBeanstalkConfigurationTemplateRead(d, meta) -} - -func resourceAwsElasticBeanstalkConfigurationTemplateRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - log.Printf("[DEBUG] Elastic Beanstalk configuration template read: %s", d.Get("name").(string)) - - resp, err := conn.DescribeConfigurationSettings(&elasticbeanstalk.DescribeConfigurationSettingsInput{ - TemplateName: aws.String(d.Id()), - ApplicationName: aws.String(d.Get("application").(string)), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "InvalidParameterValue" && strings.Contains(awsErr.Message(), "No Configuration Template named") { - log.Printf("[WARN] No Configuration Template named (%s) found", d.Id()) - d.SetId("") - return nil - } - } - return err - } - - if len(resp.ConfigurationSettings) != 1 { - log.Printf("[DEBUG] Elastic Beanstalk unexpected describe configuration template response: %+v", resp) - return fmt.Errorf("Error reading application properties: found %d applications, expected 1", len(resp.ConfigurationSettings)) - } - - d.Set("description", resp.ConfigurationSettings[0].Description) - return nil -} - -func resourceAwsElasticBeanstalkConfigurationTemplateUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - log.Printf("[DEBUG] Elastic Beanstalk configuration template update: %s", d.Get("name").(string)) - - if d.HasChange("description") { - if err := resourceAwsElasticBeanstalkConfigurationTemplateDescriptionUpdate(conn, d); err != nil { - return err - } - } - - if d.HasChange("setting") { - if err := resourceAwsElasticBeanstalkConfigurationTemplateOptionSettingsUpdate(conn, d); err != nil { - return err - } - } - - return resourceAwsElasticBeanstalkConfigurationTemplateRead(d, meta) -} - -func resourceAwsElasticBeanstalkConfigurationTemplateDescriptionUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { - _, err := conn.UpdateConfigurationTemplate(&elasticbeanstalk.UpdateConfigurationTemplateInput{ - ApplicationName: aws.String(d.Get("application").(string)), - TemplateName: aws.String(d.Get("name").(string)), - Description: aws.String(d.Get("description").(string)), - }) - - return err -} - -func resourceAwsElasticBeanstalkConfigurationTemplateOptionSettingsUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { - if d.HasChange("setting") { - _, err := conn.ValidateConfigurationSettings(&elasticbeanstalk.ValidateConfigurationSettingsInput{ - ApplicationName: aws.String(d.Get("application").(string)), - TemplateName: aws.String(d.Get("name").(string)), - OptionSettings: gatherOptionSettings(d), - }) - if err != nil { - return err - } - - o, n := d.GetChange("setting") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - rm := extractOptionSettings(os.Difference(ns)) - add := extractOptionSettings(ns.Difference(os)) - - // Additions and removals of options are done in a single API call, so we - // can't do our normal "remove these" and then later "add these", re-adding - // any updated settings. - // Because of this, we need to remove any settings in the "removable" - // settings that are also found in the "add" settings, otherwise they - // conflict. Here we loop through all the initial removables from the set - // difference, and we build up a slice of settings not found in the "add" - // set - var remove []*elasticbeanstalk.ConfigurationOptionSetting - for _, r := range rm { - for _, a := range add { - if *r.Namespace == *a.Namespace && *r.OptionName == *a.OptionName { - continue - } - remove = append(remove, r) - } - } - - req := &elasticbeanstalk.UpdateConfigurationTemplateInput{ - ApplicationName: aws.String(d.Get("application").(string)), - TemplateName: aws.String(d.Get("name").(string)), - OptionSettings: add, - } - - for _, elem := range remove { - req.OptionsToRemove = append(req.OptionsToRemove, &elasticbeanstalk.OptionSpecification{ - Namespace: elem.Namespace, - OptionName: elem.OptionName, - }) - } - - log.Printf("[DEBUG] Update Configuration Template request: %s", req) - if _, err := conn.UpdateConfigurationTemplate(req); err != nil { - return err - } - } - - return nil -} - -func resourceAwsElasticBeanstalkConfigurationTemplateDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - application := d.Get("application").(string) - - _, err := conn.DeleteConfigurationTemplate(&elasticbeanstalk.DeleteConfigurationTemplateInput{ - ApplicationName: aws.String(application), - TemplateName: aws.String(d.Id()), - }) - - return err -} - -func gatherOptionSettings(d *schema.ResourceData) []*elasticbeanstalk.ConfigurationOptionSetting { - optionSettingsSet, ok := d.Get("setting").(*schema.Set) - if !ok || optionSettingsSet == nil { - optionSettingsSet = new(schema.Set) - } - - return extractOptionSettings(optionSettingsSet) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go deleted file mode 100644 index 1e016a8..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go +++ /dev/null @@ -1,913 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "sort" - "strings" - "time" - - "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" -) - -func resourceAwsElasticBeanstalkOptionSetting() *schema.Resource { - return &schema.Resource{ - Schema: map[string]*schema.Schema{ - "namespace": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "resource": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func resourceAwsElasticBeanstalkEnvironment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticBeanstalkEnvironmentCreate, - Read: resourceAwsElasticBeanstalkEnvironmentRead, - Update: resourceAwsElasticBeanstalkEnvironmentUpdate, - Delete: resourceAwsElasticBeanstalkEnvironmentDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - SchemaVersion: 1, - MigrateState: resourceAwsElasticBeanstalkEnvironmentMigrateState, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "application": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "version_label": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "cname": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "cname_prefix": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, - }, - "tier": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "WebServer", - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - switch value { - case - "Worker", - "WebServer": - return - } - errors = append(errors, fmt.Errorf("%s is not a valid tier. Valid options are WebServer or Worker", value)) - return - }, - ForceNew: true, - }, - "setting": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: resourceAwsElasticBeanstalkOptionSetting(), - Set: optionSettingValueHash, - }, - "all_settings": &schema.Schema{ - Type: schema.TypeSet, - Computed: true, - Elem: resourceAwsElasticBeanstalkOptionSetting(), - Set: optionSettingValueHash, - }, - "solution_stack_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ConflictsWith: []string{"template_name"}, - }, - "template_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "wait_for_ready_timeout": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "10m", - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - duration, err := time.ParseDuration(value) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q cannot be parsed as a duration: %s", k, err)) - } - if duration < 0 { - errors = append(errors, fmt.Errorf( - "%q must be greater than zero", k)) - } - return - }, - }, - "poll_interval": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - duration, err := time.ParseDuration(value) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q cannot be parsed as a duration: %s", k, err)) - } - if duration < 10*time.Second || duration > 60*time.Second { - errors = append(errors, fmt.Errorf( - "%q must be between 10s and 180s", k)) - } - return - }, - }, - "autoscaling_groups": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "instances": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "launch_configurations": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "load_balancers": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "queues": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "triggers": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - // Get values from config - name := d.Get("name").(string) - cnamePrefix := d.Get("cname_prefix").(string) - tier := d.Get("tier").(string) - app := d.Get("application").(string) - desc := d.Get("description").(string) - version := d.Get("version_label").(string) - settings := d.Get("setting").(*schema.Set) - solutionStack := d.Get("solution_stack_name").(string) - templateName := d.Get("template_name").(string) - - // TODO set tags - // Note: at time of writing, you cannot view or edit Tags after creation - // d.Set("tags", tagsToMap(instance.Tags)) - createOpts := elasticbeanstalk.CreateEnvironmentInput{ - EnvironmentName: aws.String(name), - ApplicationName: aws.String(app), - OptionSettings: extractOptionSettings(settings), - Tags: tagsFromMapBeanstalk(d.Get("tags").(map[string]interface{})), - } - - if desc != "" { - createOpts.Description = aws.String(desc) - } - - if cnamePrefix != "" { - if tier != "WebServer" { - return fmt.Errorf("Cannont set cname_prefix for tier: %s.", tier) - } - createOpts.CNAMEPrefix = aws.String(cnamePrefix) - } - - if tier != "" { - var tierType string - - switch tier { - case "WebServer": - tierType = "Standard" - case "Worker": - tierType = "SQS/HTTP" - } - environmentTier := elasticbeanstalk.EnvironmentTier{ - Name: aws.String(tier), - Type: aws.String(tierType), - } - createOpts.Tier = &environmentTier - } - - if solutionStack != "" { - createOpts.SolutionStackName = aws.String(solutionStack) - } - - if templateName != "" { - createOpts.TemplateName = aws.String(templateName) - } - - if version != "" { - createOpts.VersionLabel = aws.String(version) - } - - // Get the current time to filter getBeanstalkEnvironmentErrors messages - t := time.Now() - log.Printf("[DEBUG] Elastic Beanstalk Environment create opts: %s", createOpts) - resp, err := conn.CreateEnvironment(&createOpts) - if err != nil { - return err - } - - // Assign the application name as the resource ID - d.SetId(*resp.EnvironmentId) - - waitForReadyTimeOut, err := time.ParseDuration(d.Get("wait_for_ready_timeout").(string)) - if err != nil { - return err - } - - pollInterval, err := time.ParseDuration(d.Get("poll_interval").(string)) - if err != nil { - pollInterval = 0 - log.Printf("[WARN] Error parsing poll_interval, using default backoff") - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"Launching", "Updating"}, - Target: []string{"Ready"}, - Refresh: environmentStateRefreshFunc(conn, d.Id(), t), - Timeout: waitForReadyTimeOut, - Delay: 10 * time.Second, - PollInterval: pollInterval, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Elastic Beanstalk Environment (%s) to become ready: %s", - d.Id(), err) - } - - envErrors, err := getBeanstalkEnvironmentErrors(conn, d.Id(), t) - if err != nil { - return err - } - if envErrors != nil { - return envErrors - } - - return resourceAwsElasticBeanstalkEnvironmentRead(d, meta) -} - -func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - envId := d.Id() - - var hasChange bool - - updateOpts := elasticbeanstalk.UpdateEnvironmentInput{ - EnvironmentId: aws.String(envId), - } - - if d.HasChange("description") { - hasChange = true - updateOpts.Description = aws.String(d.Get("description").(string)) - } - - if d.HasChange("solution_stack_name") { - hasChange = true - if v, ok := d.GetOk("solution_stack_name"); ok { - updateOpts.SolutionStackName = aws.String(v.(string)) - } - } - - if d.HasChange("setting") { - hasChange = true - o, n := d.GetChange("setting") - if o == nil { - o = &schema.Set{F: optionSettingValueHash} - } - if n == nil { - n = &schema.Set{F: optionSettingValueHash} - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - rm := extractOptionSettings(os.Difference(ns)) - add := extractOptionSettings(ns.Difference(os)) - - // Additions and removals of options are done in a single API call, so we - // can't do our normal "remove these" and then later "add these", re-adding - // any updated settings. - // Because of this, we need to exclude any settings in the "removable" - // settings that are also found in the "add" settings, otherwise they - // conflict. Here we loop through all the initial removables from the set - // difference, and create a new slice `remove` that contains those settings - // found in `rm` but not in `add` - var remove []*elasticbeanstalk.ConfigurationOptionSetting - if len(add) > 0 { - for _, r := range rm { - var update = false - for _, a := range add { - // ResourceNames are optional. Some defaults come with it, some do - // not. We need to guard against nil/empty in state as well as - // nil/empty from the API - if a.ResourceName != nil { - if r.ResourceName == nil { - continue - } - if *r.ResourceName != *a.ResourceName { - continue - } - } - if *r.Namespace == *a.Namespace && *r.OptionName == *a.OptionName { - log.Printf("[DEBUG] Updating Beanstalk setting (%s::%s) \"%s\" => \"%s\"", *a.Namespace, *a.OptionName, *r.Value, *a.Value) - update = true - break - } - } - // Only remove options that are not updates - if !update { - remove = append(remove, r) - } - } - } else { - remove = rm - } - - for _, elem := range remove { - updateOpts.OptionsToRemove = append(updateOpts.OptionsToRemove, &elasticbeanstalk.OptionSpecification{ - Namespace: elem.Namespace, - OptionName: elem.OptionName, - }) - } - - updateOpts.OptionSettings = add - } - - if d.HasChange("template_name") { - hasChange = true - if v, ok := d.GetOk("template_name"); ok { - updateOpts.TemplateName = aws.String(v.(string)) - } - } - - if d.HasChange("version_label") { - hasChange = true - updateOpts.VersionLabel = aws.String(d.Get("version_label").(string)) - } - - if hasChange { - // Get the current time to filter getBeanstalkEnvironmentErrors messages - t := time.Now() - log.Printf("[DEBUG] Elastic Beanstalk Environment update opts: %s", updateOpts) - _, err := conn.UpdateEnvironment(&updateOpts) - if err != nil { - return err - } - - waitForReadyTimeOut, err := time.ParseDuration(d.Get("wait_for_ready_timeout").(string)) - if err != nil { - return err - } - pollInterval, err := time.ParseDuration(d.Get("poll_interval").(string)) - if err != nil { - pollInterval = 0 - log.Printf("[WARN] Error parsing poll_interval, using default backoff") - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"Launching", "Updating"}, - Target: []string{"Ready"}, - Refresh: environmentStateRefreshFunc(conn, d.Id(), t), - Timeout: waitForReadyTimeOut, - Delay: 10 * time.Second, - PollInterval: pollInterval, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Elastic Beanstalk Environment (%s) to become ready: %s", - d.Id(), err) - } - - envErrors, err := getBeanstalkEnvironmentErrors(conn, d.Id(), t) - if err != nil { - return err - } - if envErrors != nil { - return envErrors - } - } - - return resourceAwsElasticBeanstalkEnvironmentRead(d, meta) -} - -func resourceAwsElasticBeanstalkEnvironmentRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - envId := d.Id() - - log.Printf("[DEBUG] Elastic Beanstalk environment read %s: id %s", d.Get("name").(string), d.Id()) - - resp, err := conn.DescribeEnvironments(&elasticbeanstalk.DescribeEnvironmentsInput{ - EnvironmentIds: []*string{aws.String(envId)}, - }) - - if err != nil { - return err - } - - if len(resp.Environments) == 0 { - log.Printf("[DEBUG] Elastic Beanstalk environment properties: could not find environment %s", d.Id()) - - d.SetId("") - return nil - } else if len(resp.Environments) != 1 { - return fmt.Errorf("Error reading application properties: found %d environments, expected 1", len(resp.Environments)) - } - - env := resp.Environments[0] - - if *env.Status == "Terminated" { - log.Printf("[DEBUG] Elastic Beanstalk environment %s was terminated", d.Id()) - - d.SetId("") - return nil - } - - resources, err := conn.DescribeEnvironmentResources(&elasticbeanstalk.DescribeEnvironmentResourcesInput{ - EnvironmentId: aws.String(envId), - }) - - if err != nil { - return err - } - - if err := d.Set("name", env.EnvironmentName); err != nil { - return err - } - - if err := d.Set("application", env.ApplicationName); err != nil { - return err - } - - if err := d.Set("description", env.Description); err != nil { - return err - } - - if err := d.Set("cname", env.CNAME); err != nil { - return err - } - - if err := d.Set("version_label", env.VersionLabel); err != nil { - return err - } - - if err := d.Set("tier", *env.Tier.Name); err != nil { - return err - } - - if env.CNAME != nil { - beanstalkCnamePrefixRegexp := regexp.MustCompile(`(^[^.]+)(.\w{2}-\w{4,9}-\d)?.elasticbeanstalk.com$`) - var cnamePrefix string - cnamePrefixMatch := beanstalkCnamePrefixRegexp.FindStringSubmatch(*env.CNAME) - - if cnamePrefixMatch == nil { - cnamePrefix = "" - } else { - cnamePrefix = cnamePrefixMatch[1] - } - - if err := d.Set("cname_prefix", cnamePrefix); err != nil { - return err - } - } else { - if err := d.Set("cname_prefix", ""); err != nil { - return err - } - } - - if err := d.Set("solution_stack_name", env.SolutionStackName); err != nil { - return err - } - - if err := d.Set("autoscaling_groups", flattenBeanstalkAsg(resources.EnvironmentResources.AutoScalingGroups)); err != nil { - return err - } - - if err := d.Set("instances", flattenBeanstalkInstances(resources.EnvironmentResources.Instances)); err != nil { - return err - } - if err := d.Set("launch_configurations", flattenBeanstalkLc(resources.EnvironmentResources.LaunchConfigurations)); err != nil { - return err - } - if err := d.Set("load_balancers", flattenBeanstalkElb(resources.EnvironmentResources.LoadBalancers)); err != nil { - return err - } - if err := d.Set("queues", flattenBeanstalkSqs(resources.EnvironmentResources.Queues)); err != nil { - return err - } - if err := d.Set("triggers", flattenBeanstalkTrigger(resources.EnvironmentResources.Triggers)); err != nil { - return err - } - - return resourceAwsElasticBeanstalkEnvironmentSettingsRead(d, meta) -} - -func fetchAwsElasticBeanstalkEnvironmentSettings(d *schema.ResourceData, meta interface{}) (*schema.Set, error) { - conn := meta.(*AWSClient).elasticbeanstalkconn - - app := d.Get("application").(string) - name := d.Get("name").(string) - - resp, err := conn.DescribeConfigurationSettings(&elasticbeanstalk.DescribeConfigurationSettingsInput{ - ApplicationName: aws.String(app), - EnvironmentName: aws.String(name), - }) - - if err != nil { - return nil, err - } - - if len(resp.ConfigurationSettings) != 1 { - return nil, fmt.Errorf("Error reading environment settings: received %d settings groups, expected 1", len(resp.ConfigurationSettings)) - } - - settings := &schema.Set{F: optionSettingValueHash} - for _, optionSetting := range resp.ConfigurationSettings[0].OptionSettings { - m := map[string]interface{}{} - - if optionSetting.Namespace != nil { - m["namespace"] = *optionSetting.Namespace - } else { - return nil, fmt.Errorf("Error reading environment settings: option setting with no namespace: %v", optionSetting) - } - - if optionSetting.OptionName != nil { - m["name"] = *optionSetting.OptionName - } else { - return nil, fmt.Errorf("Error reading environment settings: option setting with no name: %v", optionSetting) - } - - if *optionSetting.Namespace == "aws:autoscaling:scheduledaction" && optionSetting.ResourceName != nil { - m["resource"] = *optionSetting.ResourceName - } - - if optionSetting.Value != nil { - switch *optionSetting.OptionName { - case "SecurityGroups": - m["value"] = dropGeneratedSecurityGroup(*optionSetting.Value, meta) - case "Subnets", "ELBSubnets": - m["value"] = sortValues(*optionSetting.Value) - default: - m["value"] = *optionSetting.Value - } - } - - settings.Add(m) - } - - return settings, nil -} - -func resourceAwsElasticBeanstalkEnvironmentSettingsRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[DEBUG] Elastic Beanstalk environment settings read %s: id %s", d.Get("name").(string), d.Id()) - - allSettings, err := fetchAwsElasticBeanstalkEnvironmentSettings(d, meta) - if err != nil { - return err - } - - settings := d.Get("setting").(*schema.Set) - - log.Printf("[DEBUG] Elastic Beanstalk allSettings: %s", allSettings.GoString()) - log.Printf("[DEBUG] Elastic Beanstalk settings: %s", settings.GoString()) - - // perform the set operation with only name/namespace as keys, excluding value - // this is so we override things in the settings resource data key with updated values - // from the api. we skip values we didn't know about before because there are so many - // defaults set by the eb api that we would delete many useful defaults. - // - // there is likely a better way to do this - allSettingsKeySet := schema.NewSet(optionSettingKeyHash, allSettings.List()) - settingsKeySet := schema.NewSet(optionSettingKeyHash, settings.List()) - updatedSettingsKeySet := allSettingsKeySet.Intersection(settingsKeySet) - - log.Printf("[DEBUG] Elastic Beanstalk updatedSettingsKeySet: %s", updatedSettingsKeySet.GoString()) - - updatedSettings := schema.NewSet(optionSettingValueHash, updatedSettingsKeySet.List()) - - log.Printf("[DEBUG] Elastic Beanstalk updatedSettings: %s", updatedSettings.GoString()) - - if err := d.Set("all_settings", allSettings.List()); err != nil { - return err - } - - if err := d.Set("setting", updatedSettings.List()); err != nil { - return err - } - - return nil -} - -func resourceAwsElasticBeanstalkEnvironmentDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticbeanstalkconn - - opts := elasticbeanstalk.TerminateEnvironmentInput{ - EnvironmentId: aws.String(d.Id()), - TerminateResources: aws.Bool(true), - } - - // Get the current time to filter getBeanstalkEnvironmentErrors messages - t := time.Now() - log.Printf("[DEBUG] Elastic Beanstalk Environment terminate opts: %s", opts) - _, err := conn.TerminateEnvironment(&opts) - - if err != nil { - return err - } - - waitForReadyTimeOut, err := time.ParseDuration(d.Get("wait_for_ready_timeout").(string)) - if err != nil { - return err - } - pollInterval, err := time.ParseDuration(d.Get("poll_interval").(string)) - if err != nil { - pollInterval = 0 - log.Printf("[WARN] Error parsing poll_interval, using default backoff") - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"Terminating"}, - Target: []string{"Terminated"}, - Refresh: environmentStateRefreshFunc(conn, d.Id(), t), - Timeout: waitForReadyTimeOut, - Delay: 10 * time.Second, - PollInterval: pollInterval, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Elastic Beanstalk Environment (%s) to become terminated: %s", - d.Id(), err) - } - - envErrors, err := getBeanstalkEnvironmentErrors(conn, d.Id(), t) - if err != nil { - return err - } - if envErrors != nil { - return envErrors - } - - return nil -} - -// environmentStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// the creation of the Beanstalk Environment -func environmentStateRefreshFunc(conn *elasticbeanstalk.ElasticBeanstalk, environmentId string, t time.Time) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeEnvironments(&elasticbeanstalk.DescribeEnvironmentsInput{ - EnvironmentIds: []*string{aws.String(environmentId)}, - }) - if err != nil { - log.Printf("[Err] Error waiting for Elastic Beanstalk Environment state: %s", err) - return -1, "failed", fmt.Errorf("[Err] Error waiting for Elastic Beanstalk Environment state: %s", err) - } - - if resp == nil || len(resp.Environments) == 0 { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - var env *elasticbeanstalk.EnvironmentDescription - for _, e := range resp.Environments { - if environmentId == *e.EnvironmentId { - env = e - } - } - - if env == nil { - return -1, "failed", fmt.Errorf("[Err] Error finding Elastic Beanstalk Environment, environment not found") - } - - envErrors, err := getBeanstalkEnvironmentErrors(conn, environmentId, t) - if err != nil { - return -1, "failed", err - } - if envErrors != nil { - return -1, "failed", envErrors - } - - return env, *env.Status, nil - } -} - -// we use the following two functions to allow us to split out defaults -// as they become overridden from within the template -func optionSettingValueHash(v interface{}) int { - rd := v.(map[string]interface{}) - namespace := rd["namespace"].(string) - optionName := rd["name"].(string) - var resourceName string - if v, ok := rd["resource"].(string); ok { - resourceName = v - } - value, _ := rd["value"].(string) - hk := fmt.Sprintf("%s:%s%s=%s", namespace, optionName, resourceName, sortValues(value)) - log.Printf("[DEBUG] Elastic Beanstalk optionSettingValueHash(%#v): %s: hk=%s,hc=%d", v, optionName, hk, hashcode.String(hk)) - return hashcode.String(hk) -} - -func optionSettingKeyHash(v interface{}) int { - rd := v.(map[string]interface{}) - namespace := rd["namespace"].(string) - optionName := rd["name"].(string) - var resourceName string - if v, ok := rd["resource"].(string); ok { - resourceName = v - } - hk := fmt.Sprintf("%s:%s%s", namespace, optionName, resourceName) - log.Printf("[DEBUG] Elastic Beanstalk optionSettingKeyHash(%#v): %s: hk=%s,hc=%d", v, optionName, hk, hashcode.String(hk)) - return hashcode.String(hk) -} - -func sortValues(v string) string { - values := strings.Split(v, ",") - sort.Strings(values) - return strings.Join(values, ",") -} - -func extractOptionSettings(s *schema.Set) []*elasticbeanstalk.ConfigurationOptionSetting { - settings := []*elasticbeanstalk.ConfigurationOptionSetting{} - - if s != nil { - for _, setting := range s.List() { - optionSetting := elasticbeanstalk.ConfigurationOptionSetting{ - Namespace: aws.String(setting.(map[string]interface{})["namespace"].(string)), - OptionName: aws.String(setting.(map[string]interface{})["name"].(string)), - Value: aws.String(setting.(map[string]interface{})["value"].(string)), - } - if *optionSetting.Namespace == "aws:autoscaling:scheduledaction" { - if v, ok := setting.(map[string]interface{})["resource"].(string); ok && v != "" { - optionSetting.ResourceName = aws.String(v) - } - } - settings = append(settings, &optionSetting) - } - } - - return settings -} - -func dropGeneratedSecurityGroup(settingValue string, meta interface{}) string { - conn := meta.(*AWSClient).ec2conn - - groups := strings.Split(settingValue, ",") - - // Check to see if groups are ec2-classic or vpc security groups - ec2Classic := true - beanstalkSGRegexp := "sg-[0-9a-fA-F]{8}" - for _, g := range groups { - if ok, _ := regexp.MatchString(beanstalkSGRegexp, g); ok { - ec2Classic = false - break - } - } - - var resp *ec2.DescribeSecurityGroupsOutput - var err error - - if ec2Classic { - resp, err = conn.DescribeSecurityGroups(&ec2.DescribeSecurityGroupsInput{ - GroupNames: aws.StringSlice(groups), - }) - } else { - resp, err = conn.DescribeSecurityGroups(&ec2.DescribeSecurityGroupsInput{ - GroupIds: aws.StringSlice(groups), - }) - } - - if err != nil { - log.Printf("[DEBUG] Elastic Beanstalk error describing SecurityGroups: %v", err) - return settingValue - } - - log.Printf("[DEBUG] Elastic Beanstalk using ec2-classic security-groups: %t", ec2Classic) - var legitGroups []string - for _, group := range resp.SecurityGroups { - log.Printf("[DEBUG] Elastic Beanstalk SecurityGroup: %v", *group.GroupName) - if !strings.HasPrefix(*group.GroupName, "awseb") { - if ec2Classic { - legitGroups = append(legitGroups, *group.GroupName) - } else { - legitGroups = append(legitGroups, *group.GroupId) - } - } - } - - sort.Strings(legitGroups) - - return strings.Join(legitGroups, ",") -} - -type beanstalkEnvironmentError struct { - eventDate *time.Time - environmentID string - message *string -} - -func (e beanstalkEnvironmentError) Error() string { - return e.eventDate.String() + " (" + e.environmentID + ") : " + *e.message -} - -type beanstalkEnvironmentErrors []*beanstalkEnvironmentError - -func (e beanstalkEnvironmentErrors) Len() int { return len(e) } -func (e beanstalkEnvironmentErrors) Swap(i, j int) { e[i], e[j] = e[j], e[i] } -func (e beanstalkEnvironmentErrors) Less(i, j int) bool { return e[i].eventDate.Before(*e[j].eventDate) } - -func getBeanstalkEnvironmentErrors(conn *elasticbeanstalk.ElasticBeanstalk, environmentId string, t time.Time) (*multierror.Error, error) { - environmentErrors, err := conn.DescribeEvents(&elasticbeanstalk.DescribeEventsInput{ - EnvironmentId: aws.String(environmentId), - Severity: aws.String("ERROR"), - StartTime: aws.Time(t), - }) - - if err != nil { - return nil, fmt.Errorf("[Err] Unable to get Elastic Beanstalk Evironment events: %s", err) - } - - var events beanstalkEnvironmentErrors - for _, event := range environmentErrors.Events { - e := &beanstalkEnvironmentError{ - eventDate: event.EventDate, - environmentID: environmentId, - message: event.Message, - } - events = append(events, e) - } - sort.Sort(beanstalkEnvironmentErrors(events)) - - var result *multierror.Error - for _, event := range events { - result = multierror.Append(result, event) - } - - return result, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_environment_migrate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_environment_migrate.go deleted file mode 100644 index 31cd5c7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_environment_migrate.go +++ /dev/null @@ -1,35 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/terraform" -) - -func resourceAwsElasticBeanstalkEnvironmentMigrateState( - v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - switch v { - case 0: - log.Println("[INFO] Found AWS Elastic Beanstalk Environment State v0; migrating to v1") - return migrateBeanstalkEnvironmentStateV0toV1(is) - default: - return is, fmt.Errorf("Unexpected schema version: %d", v) - } -} - -func migrateBeanstalkEnvironmentStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() || is.Attributes == nil { - log.Println("[DEBUG] Empty Elastic Beanstalk Environment State; nothing to migrate.") - return is, nil - } - - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - - if is.Attributes["tier"] == "" { - is.Attributes["tier"] = "WebServer" - } - - log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) - return is, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_transcoder_pipeline.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_transcoder_pipeline.go deleted file mode 100644 index 6a0d883..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_transcoder_pipeline.go +++ /dev/null @@ -1,481 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elastictranscoder" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElasticTranscoderPipeline() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticTranscoderPipelineCreate, - Read: resourceAwsElasticTranscoderPipelineRead, - Update: resourceAwsElasticTranscoderPipelineUpdate, - Delete: resourceAwsElasticTranscoderPipelineDelete, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "aws_kms_key_arn": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateArn, - }, - - // ContentConfig also requires ThumbnailConfig - "content_config": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - // elastictranscoder.PipelineOutputConfig - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Optional: true, - // AWS may insert the bucket name here taken from output_bucket - Computed: true, - }, - "storage_class": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - - "content_config_permissions": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "access": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "grantee": { - Type: schema.TypeString, - Optional: true, - }, - "grantee_type": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - - "input_bucket": { - Type: schema.TypeString, - Required: true, - }, - - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[.0-9A-Za-z-_]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters, hyphens, underscores, and periods allowed in %q", k)) - } - if len(value) > 40 { - errors = append(errors, fmt.Errorf("%q cannot be longer than 40 characters", k)) - } - return - }, - }, - - "notifications": { - Type: schema.TypeSet, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "completed": { - Type: schema.TypeString, - Optional: true, - }, - "error": { - Type: schema.TypeString, - Optional: true, - }, - "progressing": { - Type: schema.TypeString, - Optional: true, - }, - "warning": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - - // The output_bucket must be set, or both of content_config.bucket - // and thumbnail_config.bucket. - // This is set as Computed, because the API may or may not return - // this as set based on the other 2 configurations. - "output_bucket": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "role": { - Type: schema.TypeString, - Required: true, - }, - - "thumbnail_config": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - // elastictranscoder.PipelineOutputConfig - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Optional: true, - // AWS may insert the bucket name here taken from output_bucket - Computed: true, - }, - "storage_class": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - - "thumbnail_config_permissions": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "access": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "grantee": { - Type: schema.TypeString, - Optional: true, - }, - "grantee_type": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsElasticTranscoderPipelineCreate(d *schema.ResourceData, meta interface{}) error { - elastictranscoderconn := meta.(*AWSClient).elastictranscoderconn - - req := &elastictranscoder.CreatePipelineInput{ - AwsKmsKeyArn: getStringPtr(d, "aws_kms_key_arn"), - ContentConfig: expandETPiplineOutputConfig(d, "content_config"), - InputBucket: aws.String(d.Get("input_bucket").(string)), - Notifications: expandETNotifications(d), - OutputBucket: getStringPtr(d, "output_bucket"), - Role: getStringPtr(d, "role"), - ThumbnailConfig: expandETPiplineOutputConfig(d, "thumbnail_config"), - } - - if name, ok := d.GetOk("name"); ok { - req.Name = aws.String(name.(string)) - } else { - name := resource.PrefixedUniqueId("tf-et-") - d.Set("name", name) - req.Name = aws.String(name) - } - - if (req.OutputBucket == nil && (req.ContentConfig == nil || req.ContentConfig.Bucket == nil)) || - (req.OutputBucket != nil && req.ContentConfig != nil && req.ContentConfig.Bucket != nil) { - return fmt.Errorf("[ERROR] you must specify only one of output_bucket or content_config.bucket") - } - - log.Printf("[DEBUG] Elastic Transcoder Pipeline create opts: %s", req) - resp, err := elastictranscoderconn.CreatePipeline(req) - if err != nil { - return fmt.Errorf("Error creating Elastic Transcoder Pipeline: %s", err) - } - - d.SetId(*resp.Pipeline.Id) - - for _, w := range resp.Warnings { - log.Printf("[WARN] Elastic Transcoder Pipeline %v: %v", *w.Code, *w.Message) - } - - return resourceAwsElasticTranscoderPipelineRead(d, meta) -} - -func expandETNotifications(d *schema.ResourceData) *elastictranscoder.Notifications { - set, ok := d.GetOk("notifications") - if !ok { - return nil - } - - s := set.(*schema.Set).List() - if s == nil || len(s) == 0 { - return nil - } - - if s[0] == nil { - log.Printf("[ERR] First element of Notifications set is nil") - return nil - } - - rN := s[0].(map[string]interface{}) - - return &elastictranscoder.Notifications{ - Completed: aws.String(rN["completed"].(string)), - Error: aws.String(rN["error"].(string)), - Progressing: aws.String(rN["progressing"].(string)), - Warning: aws.String(rN["warning"].(string)), - } -} - -func flattenETNotifications(n *elastictranscoder.Notifications) []map[string]interface{} { - if n == nil { - return nil - } - - allEmpty := func(s ...*string) bool { - for _, s := range s { - if s != nil && *s != "" { - return false - } - } - return true - } - - // the API always returns a Notifications value, even when all fields are nil - if allEmpty(n.Completed, n.Error, n.Progressing, n.Warning) { - return nil - } - - m := setMap(make(map[string]interface{})) - - m.SetString("completed", n.Completed) - m.SetString("error", n.Error) - m.SetString("progressing", n.Progressing) - m.SetString("warning", n.Warning) - return m.MapList() -} - -func expandETPiplineOutputConfig(d *schema.ResourceData, key string) *elastictranscoder.PipelineOutputConfig { - set, ok := d.GetOk(key) - if !ok { - return nil - } - - s := set.(*schema.Set) - if s == nil || s.Len() == 0 { - return nil - } - - cc := s.List()[0].(map[string]interface{}) - - cfg := &elastictranscoder.PipelineOutputConfig{ - Bucket: getStringPtr(cc, "bucket"), - StorageClass: getStringPtr(cc, "storage_class"), - } - - switch key { - case "content_config": - cfg.Permissions = expandETPermList(d.Get("content_config_permissions").(*schema.Set)) - case "thumbnail_config": - cfg.Permissions = expandETPermList(d.Get("thumbnail_config_permissions").(*schema.Set)) - } - - return cfg -} - -func flattenETPipelineOutputConfig(cfg *elastictranscoder.PipelineOutputConfig) []map[string]interface{} { - m := setMap(make(map[string]interface{})) - - m.SetString("bucket", cfg.Bucket) - m.SetString("storage_class", cfg.StorageClass) - - return m.MapList() -} - -func expandETPermList(permissions *schema.Set) []*elastictranscoder.Permission { - var perms []*elastictranscoder.Permission - - for _, p := range permissions.List() { - perm := &elastictranscoder.Permission{ - Access: getStringPtrList(p.(map[string]interface{}), "access"), - Grantee: getStringPtr(p, "grantee"), - GranteeType: getStringPtr(p, "grantee_type"), - } - perms = append(perms, perm) - } - return perms -} - -func flattenETPermList(perms []*elastictranscoder.Permission) []map[string]interface{} { - var set []map[string]interface{} - - for _, p := range perms { - m := setMap(make(map[string]interface{})) - m.Set("access", flattenStringList(p.Access)) - m.SetString("grantee", p.Grantee) - m.SetString("grantee_type", p.GranteeType) - - set = append(set, m) - } - return set -} - -func resourceAwsElasticTranscoderPipelineUpdate(d *schema.ResourceData, meta interface{}) error { - elastictranscoderconn := meta.(*AWSClient).elastictranscoderconn - - req := &elastictranscoder.UpdatePipelineInput{ - Id: aws.String(d.Id()), - } - - if d.HasChange("aws_kms_key_arn") { - req.AwsKmsKeyArn = getStringPtr(d, "aws_kms_key_arn") - } - - if d.HasChange("content_config") { - req.ContentConfig = expandETPiplineOutputConfig(d, "content_config") - } - - if d.HasChange("input_bucket") { - req.InputBucket = getStringPtr(d, "input_bucket") - } - - if d.HasChange("name") { - req.Name = getStringPtr(d, "name") - } - - if d.HasChange("notifications") { - req.Notifications = expandETNotifications(d) - } - - if d.HasChange("role") { - req.Role = getStringPtr(d, "role") - } - - if d.HasChange("thumbnail_config") { - req.ThumbnailConfig = expandETPiplineOutputConfig(d, "thumbnail_config") - } - - log.Printf("[DEBUG] Updating Elastic Transcoder Pipeline: %#v", req) - output, err := elastictranscoderconn.UpdatePipeline(req) - if err != nil { - return fmt.Errorf("Error updating Elastic Transcoder pipeline: %s", err) - } - - for _, w := range output.Warnings { - log.Printf("[WARN] Elastic Transcoder Pipeline %v: %v", *w.Code, *w.Message) - } - - return resourceAwsElasticTranscoderPipelineRead(d, meta) -} - -func resourceAwsElasticTranscoderPipelineRead(d *schema.ResourceData, meta interface{}) error { - elastictranscoderconn := meta.(*AWSClient).elastictranscoderconn - - resp, err := elastictranscoderconn.ReadPipeline(&elastictranscoder.ReadPipelineInput{ - Id: aws.String(d.Id()), - }) - - if err != nil { - if err, ok := err.(awserr.Error); ok && err.Code() == "ResourceNotFoundException" { - d.SetId("") - return nil - } - return err - } - - log.Printf("[DEBUG] Elastic Transcoder Pipeline Read response: %#v", resp) - - pipeline := resp.Pipeline - - d.Set("arn", *pipeline.Arn) - - if arn := pipeline.AwsKmsKeyArn; arn != nil { - d.Set("aws_kms_key_arn", *arn) - } - - if pipeline.ContentConfig != nil { - err := d.Set("content_config", flattenETPipelineOutputConfig(pipeline.ContentConfig)) - if err != nil { - return fmt.Errorf("error setting content_config: %s", err) - } - - if pipeline.ContentConfig.Permissions != nil { - err := d.Set("content_config_permissions", flattenETPermList(pipeline.ContentConfig.Permissions)) - if err != nil { - return fmt.Errorf("error setting content_config_permissions: %s", err) - } - } - } - - d.Set("input_bucket", *pipeline.InputBucket) - d.Set("name", *pipeline.Name) - - notifications := flattenETNotifications(pipeline.Notifications) - if notifications != nil { - if err := d.Set("notifications", notifications); err != nil { - return fmt.Errorf("error setting notifications: %s", err) - } - } - - d.Set("role", *pipeline.Role) - - if pipeline.ThumbnailConfig != nil { - err := d.Set("thumbnail_config", flattenETPipelineOutputConfig(pipeline.ThumbnailConfig)) - if err != nil { - return fmt.Errorf("error setting thumbnail_config: %s", err) - } - - if pipeline.ThumbnailConfig.Permissions != nil { - err := d.Set("thumbnail_config_permissions", flattenETPermList(pipeline.ThumbnailConfig.Permissions)) - if err != nil { - return fmt.Errorf("error setting thumbnail_config_permissions: %s", err) - } - } - } - - if pipeline.OutputBucket != nil { - d.Set("output_bucket", *pipeline.OutputBucket) - } - - return nil -} - -func resourceAwsElasticTranscoderPipelineDelete(d *schema.ResourceData, meta interface{}) error { - elastictranscoderconn := meta.(*AWSClient).elastictranscoderconn - - log.Printf("[DEBUG] Elastic Transcoder Delete Pipeline: %s", d.Id()) - _, err := elastictranscoderconn.DeletePipeline(&elastictranscoder.DeletePipelineInput{ - Id: aws.String(d.Id()), - }) - if err != nil { - return fmt.Errorf("error deleting Elastic Transcoder Pipeline: %s", err) - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_transcoder_preset.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_transcoder_preset.go deleted file mode 100644 index 0f7c76e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_transcoder_preset.go +++ /dev/null @@ -1,638 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elastictranscoder" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElasticTranscoderPreset() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticTranscoderPresetCreate, - Read: resourceAwsElasticTranscoderPresetRead, - Delete: resourceAwsElasticTranscoderPresetDelete, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "audio": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - MaxItems: 1, - Elem: &schema.Resource{ - // elastictranscoder.AudioParameters - Schema: map[string]*schema.Schema{ - "audio_packing_mode": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "bit_rate": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "channels": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "codec": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "sample_rate": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - }, - }, - }, - "audio_codec_options": &schema.Schema{ - Type: schema.TypeSet, - MaxItems: 1, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bit_depth": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "bit_order": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "profile": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "signed": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - }, - }, - }, - - "container": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "thumbnails": &schema.Schema{ - Type: schema.TypeSet, - MaxItems: 1, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - // elastictranscoder.Thumbnails - Schema: map[string]*schema.Schema{ - "aspect_ratio": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "format": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "interval": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "max_height": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "max_width": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "padding_policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "resolution:": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "sizing_policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - }, - }, - }, - - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "video": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - MaxItems: 1, - Elem: &schema.Resource{ - // elastictranscoder.VideoParameters - Schema: map[string]*schema.Schema{ - "aspect_ratio": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "bit_rate": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "codec": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "display_aspect_ratio": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "fixed_gop": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "frame_rate": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "keyframes_max_dist": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "max_frame_rate": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "max_height": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "max_width": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "padding_policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "resolution": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "sizing_policy": &schema.Schema{ - Type: schema.TypeString, - Default: "Fit", - Optional: true, - ForceNew: true, - }, - }, - }, - }, - - "video_watermarks": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - // elastictranscoder.PresetWatermark - Schema: map[string]*schema.Schema{ - "horizontal_align": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "horizontal_offset": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "max_height": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "max_width": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "opacity": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "sizing_policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "target": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "vertical_align": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "vertical_offset": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - }, - }, - }, - - "video_codec_options": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsElasticTranscoderPresetCreate(d *schema.ResourceData, meta interface{}) error { - elastictranscoderconn := meta.(*AWSClient).elastictranscoderconn - - req := &elastictranscoder.CreatePresetInput{ - Audio: expandETAudioParams(d), - Container: aws.String(d.Get("container").(string)), - Description: getStringPtr(d, "description"), - Thumbnails: expandETThumbnails(d), - Video: exapandETVideoParams(d), - } - - if name, ok := d.GetOk("name"); ok { - req.Name = aws.String(name.(string)) - } else { - name := resource.PrefixedUniqueId("tf-et-preset-") - d.Set("name", name) - req.Name = aws.String(name) - } - - log.Printf("[DEBUG] Elastic Transcoder Preset create opts: %s", req) - resp, err := elastictranscoderconn.CreatePreset(req) - if err != nil { - return fmt.Errorf("Error creating Elastic Transcoder Preset: %s", err) - } - - if resp.Warning != nil && *resp.Warning != "" { - log.Printf("[WARN] Elastic Transcoder Preset: %s", *resp.Warning) - } - - d.SetId(*resp.Preset.Id) - d.Set("arn", *resp.Preset.Arn) - - return nil -} - -func expandETThumbnails(d *schema.ResourceData) *elastictranscoder.Thumbnails { - set, ok := d.GetOk("thumbnails") - if !ok { - return nil - } - - s := set.(*schema.Set) - if s == nil || s.Len() == 0 { - return nil - } - t := s.List()[0].(map[string]interface{}) - - return &elastictranscoder.Thumbnails{ - AspectRatio: getStringPtr(t, "aspect_ratio"), - Format: getStringPtr(t, "format"), - Interval: getStringPtr(t, "interval"), - MaxHeight: getStringPtr(t, "max_height"), - MaxWidth: getStringPtr(t, "max_width"), - PaddingPolicy: getStringPtr(t, "padding_policy"), - Resolution: getStringPtr(t, "resolution"), - SizingPolicy: getStringPtr(t, "sizing_policy"), - } -} - -func expandETAudioParams(d *schema.ResourceData) *elastictranscoder.AudioParameters { - set, ok := d.GetOk("audio") - if !ok { - return nil - } - - s := set.(*schema.Set) - if s == nil || s.Len() == 0 { - return nil - } - audio := s.List()[0].(map[string]interface{}) - - return &elastictranscoder.AudioParameters{ - AudioPackingMode: getStringPtr(audio, "audio_packing_mode"), - BitRate: getStringPtr(audio, "bit_rate"), - Channels: getStringPtr(audio, "channels"), - Codec: getStringPtr(audio, "codec"), - CodecOptions: expandETAudioCodecOptions(d), - SampleRate: getStringPtr(audio, "sample_rate"), - } -} - -func expandETAudioCodecOptions(d *schema.ResourceData) *elastictranscoder.AudioCodecOptions { - s := d.Get("audio_codec_options").(*schema.Set) - if s == nil || s.Len() == 0 { - return nil - } - - codec := s.List()[0].(map[string]interface{}) - - codecOpts := &elastictranscoder.AudioCodecOptions{ - BitDepth: getStringPtr(codec, "bit_depth"), - BitOrder: getStringPtr(codec, "bit_order"), - Profile: getStringPtr(codec, "profile"), - Signed: getStringPtr(codec, "signed"), - } - - return codecOpts -} - -func exapandETVideoParams(d *schema.ResourceData) *elastictranscoder.VideoParameters { - s := d.Get("video").(*schema.Set) - if s == nil || s.Len() == 0 { - return nil - } - p := s.List()[0].(map[string]interface{}) - - return &elastictranscoder.VideoParameters{ - AspectRatio: getStringPtr(p, "aspect_ratio"), - BitRate: getStringPtr(p, "bit_rate"), - Codec: getStringPtr(p, "codec"), - CodecOptions: stringMapToPointers(d.Get("video_codec_options").(map[string]interface{})), - DisplayAspectRatio: getStringPtr(p, "display_aspect_ratio"), - FixedGOP: getStringPtr(p, "fixed_gop"), - FrameRate: getStringPtr(p, "frame_rate"), - KeyframesMaxDist: getStringPtr(p, "keyframes_max_dist"), - MaxFrameRate: getStringPtr(p, "max_frame_rate"), - MaxHeight: getStringPtr(p, "max_height"), - MaxWidth: getStringPtr(p, "max_width"), - PaddingPolicy: getStringPtr(p, "padding_policy"), - Resolution: getStringPtr(p, "resolution"), - SizingPolicy: getStringPtr(p, "sizing_policy"), - Watermarks: expandETVideoWatermarks(d), - } -} - -func expandETVideoWatermarks(d *schema.ResourceData) []*elastictranscoder.PresetWatermark { - s := d.Get("video_watermarks").(*schema.Set) - if s == nil || s.Len() == 0 { - return nil - } - var watermarks []*elastictranscoder.PresetWatermark - - for _, w := range s.List() { - watermark := &elastictranscoder.PresetWatermark{ - HorizontalAlign: getStringPtr(w, "horizontal_align"), - HorizontalOffset: getStringPtr(w, "horizontal_offset"), - Id: getStringPtr(w, "id"), - MaxHeight: getStringPtr(w, "max_height"), - MaxWidth: getStringPtr(w, "max_width"), - Opacity: getStringPtr(w, "opacity"), - SizingPolicy: getStringPtr(w, "sizing_policy"), - Target: getStringPtr(w, "target"), - VerticalAlign: getStringPtr(w, "vertical_align"), - VerticalOffset: getStringPtr(w, "vertical_offset"), - } - watermarks = append(watermarks, watermark) - } - - return watermarks -} - -func resourceAwsElasticTranscoderPresetRead(d *schema.ResourceData, meta interface{}) error { - elastictranscoderconn := meta.(*AWSClient).elastictranscoderconn - - resp, err := elastictranscoderconn.ReadPreset(&elastictranscoder.ReadPresetInput{ - Id: aws.String(d.Id()), - }) - - if err != nil { - if err, ok := err.(awserr.Error); ok && err.Code() == "ResourceNotFoundException" { - d.SetId("") - return nil - } - return err - } - - log.Printf("[DEBUG] Elastic Transcoder Preset Read response: %#v", resp) - - preset := resp.Preset - d.Set("arn", *preset.Arn) - - if preset.Audio != nil { - err := d.Set("audio", flattenETAudioParameters(preset.Audio)) - if err != nil { - return err - } - - if preset.Audio.CodecOptions != nil { - d.Set("audio_codec_options", flattenETAudioCodecOptions(preset.Audio.CodecOptions)) - } - } - - d.Set("container", *preset.Container) - d.Set("name", *preset.Name) - - if preset.Thumbnails != nil { - err := d.Set("thumbnails", flattenETThumbnails(preset.Thumbnails)) - if err != nil { - return err - } - } - - d.Set("type", *preset.Type) - - if preset.Video != nil { - err := d.Set("video", flattenETVideoParams(preset.Video)) - if err != nil { - return err - } - - if preset.Video.CodecOptions != nil { - d.Set("video_codec_options", flattenETVideoCodecOptions(preset.Video.CodecOptions)) - } - - if preset.Video.Watermarks != nil { - d.Set("video_watermarks", flattenETWatermarks(preset.Video.Watermarks)) - } - } - - return nil -} - -func flattenETAudioParameters(audio *elastictranscoder.AudioParameters) []map[string]interface{} { - m := setMap(make(map[string]interface{})) - - m.SetString("audio_packing_mode", audio.AudioPackingMode) - m.SetString("bit_rate", audio.BitRate) - m.SetString("channels", audio.Channels) - m.SetString("codec", audio.Codec) - m.SetString("sample_rate", audio.SampleRate) - - return m.MapList() -} - -func flattenETAudioCodecOptions(opts *elastictranscoder.AudioCodecOptions) []map[string]interface{} { - if opts == nil { - return nil - } - - m := setMap(make(map[string]interface{})) - - m.SetString("bit_depth", opts.BitDepth) - m.SetString("bit_order", opts.BitOrder) - m.SetString("profile", opts.Profile) - m.SetString("signed", opts.Signed) - - return m.MapList() -} - -func flattenETThumbnails(thumbs *elastictranscoder.Thumbnails) []map[string]interface{} { - m := setMap(make(map[string]interface{})) - - m.SetString("aspect_ratio", thumbs.AspectRatio) - m.SetString("format", thumbs.Format) - m.SetString("interval", thumbs.Interval) - m.SetString("max_height", thumbs.MaxHeight) - m.SetString("max_width", thumbs.MaxWidth) - m.SetString("padding_policy", thumbs.PaddingPolicy) - m.SetString("resolution", thumbs.Resolution) - m.SetString("sizing_policy", thumbs.SizingPolicy) - - return m.MapList() -} - -func flattenETVideoParams(video *elastictranscoder.VideoParameters) []map[string]interface{} { - m := setMap(make(map[string]interface{})) - - m.SetString("aspect_ratio", video.AspectRatio) - m.SetString("bit_rate", video.BitRate) - m.SetString("codec", video.Codec) - m.SetString("display_aspect_ratio", video.DisplayAspectRatio) - m.SetString("fixed_gop", video.FixedGOP) - m.SetString("frame_rate", video.FrameRate) - m.SetString("keyframes_max_dist", video.KeyframesMaxDist) - m.SetString("max_frame_rate", video.MaxFrameRate) - m.SetString("max_height", video.MaxHeight) - m.SetString("max_width", video.MaxWidth) - m.SetString("padding_policy", video.PaddingPolicy) - m.SetString("resolution", video.Resolution) - m.SetString("sizing_policy", video.SizingPolicy) - - return m.MapList() -} - -func flattenETVideoCodecOptions(opts map[string]*string) []map[string]interface{} { - codecOpts := setMap(make(map[string]interface{})) - - for k, v := range opts { - codecOpts.SetString(k, v) - } - - return codecOpts.MapList() -} - -func flattenETWatermarks(watermarks []*elastictranscoder.PresetWatermark) []map[string]interface{} { - var watermarkSet []map[string]interface{} - - for _, w := range watermarks { - watermark := setMap(make(map[string]interface{})) - - watermark.SetString("horizontal_align", w.HorizontalAlign) - watermark.SetString("horizontal_offset", w.HorizontalOffset) - watermark.SetString("id", w.Id) - watermark.SetString("max_height", w.MaxHeight) - watermark.SetString("max_width", w.MaxWidth) - watermark.SetString("opacity", w.Opacity) - watermark.SetString("sizing_policy", w.SizingPolicy) - watermark.SetString("target", w.Target) - watermark.SetString("vertical_align", w.VerticalAlign) - watermark.SetString("vertical_offset", w.VerticalOffset) - - watermarkSet = append(watermarkSet, watermark.Map()) - } - - return watermarkSet -} - -func resourceAwsElasticTranscoderPresetDelete(d *schema.ResourceData, meta interface{}) error { - elastictranscoderconn := meta.(*AWSClient).elastictranscoderconn - - log.Printf("[DEBUG] Elastic Transcoder Delete Preset: %s", d.Id()) - _, err := elastictranscoderconn.DeletePreset(&elastictranscoder.DeletePresetInput{ - Id: aws.String(d.Id()), - }) - - if err != nil { - return fmt.Errorf("error deleting Elastic Transcoder Preset: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_cluster.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_cluster.go deleted file mode 100644 index 36f0752..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_cluster.go +++ /dev/null @@ -1,676 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "sort" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElastiCacheCommonSchema() map[string]*schema.Schema { - - return map[string]*schema.Schema{ - "availability_zones": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "node_type": { - Type: schema.TypeString, - Required: true, - }, - "engine": { - Type: schema.TypeString, - Required: true, - }, - "engine_version": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "parameter_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "subnet_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "security_group_names": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "security_group_ids": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - // A single-element string list containing an Amazon Resource Name (ARN) that - // uniquely identifies a Redis RDB snapshot file stored in Amazon S3. The snapshot - // file will be used to populate the node group. - // - // See also: - // https://github.com/aws/aws-sdk-go/blob/4862a174f7fc92fb523fc39e68f00b87d91d2c3d/service/elasticache/api.go#L2079 - "snapshot_arns": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "snapshot_window": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateOnceADayWindowFormat, - }, - "snapshot_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "maintenance_window": { - Type: schema.TypeString, - Optional: true, - Computed: true, - StateFunc: func(val interface{}) string { - // Elasticache always changes the maintenance - // to lowercase - return strings.ToLower(val.(string)) - }, - ValidateFunc: validateOnceAWeekWindowFormat, - }, - "port": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - "notification_topic_arn": { - Type: schema.TypeString, - Optional: true, - }, - - "snapshot_retention_limit": { - Type: schema.TypeInt, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(int) - if value > 35 { - es = append(es, fmt.Errorf( - "snapshot retention limit cannot be more than 35 days")) - } - return - }, - }, - - "apply_immediately": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "tags": tagsSchema(), - } -} - -func resourceAwsElasticacheCluster() *schema.Resource { - resourceSchema := resourceAwsElastiCacheCommonSchema() - - resourceSchema["cluster_id"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: func(val interface{}) string { - // Elasticache normalizes cluster ids to lowercase, - // so we have to do this too or else we can end up - // with non-converging diffs. - return strings.ToLower(val.(string)) - }, - ValidateFunc: validateElastiCacheClusterId, - } - - resourceSchema["num_cache_nodes"] = &schema.Schema{ - Type: schema.TypeInt, - Required: true, - } - - resourceSchema["az_mode"] = &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - } - - resourceSchema["availability_zone"] = &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - } - - resourceSchema["configuration_endpoint"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - - resourceSchema["cluster_address"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - - resourceSchema["replication_group_id"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - - resourceSchema["cache_nodes"] = &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "address": { - Type: schema.TypeString, - Computed: true, - }, - "port": { - Type: schema.TypeInt, - Computed: true, - }, - "availability_zone": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - } - - return &schema.Resource{ - Create: resourceAwsElasticacheClusterCreate, - Read: resourceAwsElasticacheClusterRead, - Update: resourceAwsElasticacheClusterUpdate, - Delete: resourceAwsElasticacheClusterDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: resourceSchema, - } -} - -func resourceAwsElasticacheClusterCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - clusterId := d.Get("cluster_id").(string) - nodeType := d.Get("node_type").(string) // e.g) cache.m1.small - numNodes := int64(d.Get("num_cache_nodes").(int)) // 2 - engine := d.Get("engine").(string) // memcached - engineVersion := d.Get("engine_version").(string) // 1.4.14 - port := int64(d.Get("port").(int)) // e.g) 11211 - subnetGroupName := d.Get("subnet_group_name").(string) - securityNameSet := d.Get("security_group_names").(*schema.Set) - securityIdSet := d.Get("security_group_ids").(*schema.Set) - - securityNames := expandStringList(securityNameSet.List()) - securityIds := expandStringList(securityIdSet.List()) - tags := tagsFromMapEC(d.Get("tags").(map[string]interface{})) - - req := &elasticache.CreateCacheClusterInput{ - CacheClusterId: aws.String(clusterId), - CacheNodeType: aws.String(nodeType), - NumCacheNodes: aws.Int64(numNodes), - Engine: aws.String(engine), - EngineVersion: aws.String(engineVersion), - Port: aws.Int64(port), - CacheSubnetGroupName: aws.String(subnetGroupName), - CacheSecurityGroupNames: securityNames, - SecurityGroupIds: securityIds, - Tags: tags, - } - - // parameter groups are optional and can be defaulted by AWS - if v, ok := d.GetOk("parameter_group_name"); ok { - req.CacheParameterGroupName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("snapshot_retention_limit"); ok { - req.SnapshotRetentionLimit = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("snapshot_window"); ok { - req.SnapshotWindow = aws.String(v.(string)) - } - - if v, ok := d.GetOk("maintenance_window"); ok { - req.PreferredMaintenanceWindow = aws.String(v.(string)) - } - - if v, ok := d.GetOk("notification_topic_arn"); ok { - req.NotificationTopicArn = aws.String(v.(string)) - } - - snaps := d.Get("snapshot_arns").(*schema.Set).List() - if len(snaps) > 0 { - s := expandStringList(snaps) - req.SnapshotArns = s - log.Printf("[DEBUG] Restoring Redis cluster from S3 snapshot: %#v", s) - } - - if v, ok := d.GetOk("snapshot_name"); ok { - req.SnapshotName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("az_mode"); ok { - req.AZMode = aws.String(v.(string)) - } - - if v, ok := d.GetOk("availability_zone"); ok { - req.PreferredAvailabilityZone = aws.String(v.(string)) - } - - preferred_azs := d.Get("availability_zones").(*schema.Set).List() - if len(preferred_azs) > 0 { - azs := expandStringList(preferred_azs) - req.PreferredAvailabilityZones = azs - } - - if v, ok := d.GetOk("replication_group_id"); ok { - req.ReplicationGroupId = aws.String(v.(string)) - } - - resp, err := conn.CreateCacheCluster(req) - if err != nil { - return fmt.Errorf("Error creating Elasticache: %s", err) - } - - // Assign the cluster id as the resource ID - // Elasticache always retains the id in lower case, so we have to - // mimic that or else we won't be able to refresh a resource whose - // name contained uppercase characters. - d.SetId(strings.ToLower(*resp.CacheCluster.CacheClusterId)) - - pending := []string{"creating", "modifying", "restoring"} - stateConf := &resource.StateChangeConf{ - Pending: pending, - Target: []string{"available"}, - Refresh: cacheClusterStateRefreshFunc(conn, d.Id(), "available", pending), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, - } - - log.Printf("[DEBUG] Waiting for state to become available: %v", d.Id()) - _, sterr := stateConf.WaitForState() - if sterr != nil { - return fmt.Errorf("Error waiting for elasticache (%s) to be created: %s", d.Id(), sterr) - } - - return resourceAwsElasticacheClusterRead(d, meta) -} - -func resourceAwsElasticacheClusterRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - req := &elasticache.DescribeCacheClustersInput{ - CacheClusterId: aws.String(d.Id()), - ShowCacheNodeInfo: aws.Bool(true), - } - - res, err := conn.DescribeCacheClusters(req) - if err != nil { - if eccErr, ok := err.(awserr.Error); ok && eccErr.Code() == "CacheClusterNotFound" { - log.Printf("[WARN] ElastiCache Cluster (%s) not found", d.Id()) - d.SetId("") - return nil - } - - return err - } - - if len(res.CacheClusters) == 1 { - c := res.CacheClusters[0] - d.Set("cluster_id", c.CacheClusterId) - d.Set("node_type", c.CacheNodeType) - d.Set("num_cache_nodes", c.NumCacheNodes) - d.Set("engine", c.Engine) - d.Set("engine_version", c.EngineVersion) - if c.ConfigurationEndpoint != nil { - d.Set("port", c.ConfigurationEndpoint.Port) - d.Set("configuration_endpoint", aws.String(fmt.Sprintf("%s:%d", *c.ConfigurationEndpoint.Address, *c.ConfigurationEndpoint.Port))) - d.Set("cluster_address", aws.String(fmt.Sprintf("%s", *c.ConfigurationEndpoint.Address))) - } - - if c.ReplicationGroupId != nil { - d.Set("replication_group_id", c.ReplicationGroupId) - } - - d.Set("subnet_group_name", c.CacheSubnetGroupName) - d.Set("security_group_names", flattenElastiCacheSecurityGroupNames(c.CacheSecurityGroups)) - d.Set("security_group_ids", flattenElastiCacheSecurityGroupIds(c.SecurityGroups)) - if c.CacheParameterGroup != nil { - d.Set("parameter_group_name", c.CacheParameterGroup.CacheParameterGroupName) - } - d.Set("maintenance_window", c.PreferredMaintenanceWindow) - d.Set("snapshot_window", c.SnapshotWindow) - d.Set("snapshot_retention_limit", c.SnapshotRetentionLimit) - if c.NotificationConfiguration != nil { - if *c.NotificationConfiguration.TopicStatus == "active" { - d.Set("notification_topic_arn", c.NotificationConfiguration.TopicArn) - } - } - d.Set("availability_zone", c.PreferredAvailabilityZone) - - if err := setCacheNodeData(d, c); err != nil { - return err - } - // list tags for resource - // set tags - arn, err := buildECARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - log.Printf("[DEBUG] Error building ARN for ElastiCache Cluster, not setting Tags for cluster %s", *c.CacheClusterId) - } else { - resp, err := conn.ListTagsForResource(&elasticache.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) - } - - var et []*elasticache.Tag - if len(resp.TagList) > 0 { - et = resp.TagList - } - d.Set("tags", tagsToMapEC(et)) - } - } - - return nil -} - -func resourceAwsElasticacheClusterUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - arn, err := buildECARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - log.Printf("[DEBUG] Error building ARN for ElastiCache Cluster, not updating Tags for cluster %s", d.Id()) - } else { - if err := setTagsEC(conn, d, arn); err != nil { - return err - } - } - - req := &elasticache.ModifyCacheClusterInput{ - CacheClusterId: aws.String(d.Id()), - ApplyImmediately: aws.Bool(d.Get("apply_immediately").(bool)), - } - - requestUpdate := false - if d.HasChange("security_group_ids") { - if attr := d.Get("security_group_ids").(*schema.Set); attr.Len() > 0 { - req.SecurityGroupIds = expandStringList(attr.List()) - requestUpdate = true - } - } - - if d.HasChange("parameter_group_name") { - req.CacheParameterGroupName = aws.String(d.Get("parameter_group_name").(string)) - requestUpdate = true - } - - if d.HasChange("maintenance_window") { - req.PreferredMaintenanceWindow = aws.String(d.Get("maintenance_window").(string)) - requestUpdate = true - } - - if d.HasChange("notification_topic_arn") { - v := d.Get("notification_topic_arn").(string) - req.NotificationTopicArn = aws.String(v) - if v == "" { - inactive := "inactive" - req.NotificationTopicStatus = &inactive - } - requestUpdate = true - } - - if d.HasChange("engine_version") { - req.EngineVersion = aws.String(d.Get("engine_version").(string)) - requestUpdate = true - } - - if d.HasChange("snapshot_window") { - req.SnapshotWindow = aws.String(d.Get("snapshot_window").(string)) - requestUpdate = true - } - - if d.HasChange("node_type") { - req.CacheNodeType = aws.String(d.Get("node_type").(string)) - requestUpdate = true - } - - if d.HasChange("snapshot_retention_limit") { - req.SnapshotRetentionLimit = aws.Int64(int64(d.Get("snapshot_retention_limit").(int))) - requestUpdate = true - } - - if d.HasChange("num_cache_nodes") { - oraw, nraw := d.GetChange("num_cache_nodes") - o := oraw.(int) - n := nraw.(int) - if v, ok := d.GetOk("az_mode"); ok && v.(string) == "cross-az" && n == 1 { - return fmt.Errorf("[WARN] Error updateing Elasticache cluster (%s), error: Cross-AZ mode is not supported in a single cache node.", d.Id()) - } - if n < o { - log.Printf("[INFO] Cluster %s is marked for Decreasing cache nodes from %d to %d", d.Id(), o, n) - nodesToRemove := getCacheNodesToRemove(d, o, o-n) - req.CacheNodeIdsToRemove = nodesToRemove - } - - req.NumCacheNodes = aws.Int64(int64(d.Get("num_cache_nodes").(int))) - requestUpdate = true - - } - - if requestUpdate { - log.Printf("[DEBUG] Modifying ElastiCache Cluster (%s), opts:\n%s", d.Id(), req) - _, err := conn.ModifyCacheCluster(req) - if err != nil { - return fmt.Errorf("[WARN] Error updating ElastiCache cluster (%s), error: %s", d.Id(), err) - } - - log.Printf("[DEBUG] Waiting for update: %s", d.Id()) - pending := []string{"modifying", "rebooting cache cluster nodes", "snapshotting"} - stateConf := &resource.StateChangeConf{ - Pending: pending, - Target: []string{"available"}, - Refresh: cacheClusterStateRefreshFunc(conn, d.Id(), "available", pending), - Timeout: 80 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, - } - - _, sterr := stateConf.WaitForState() - if sterr != nil { - return fmt.Errorf("Error waiting for elasticache (%s) to update: %s", d.Id(), sterr) - } - } - - return resourceAwsElasticacheClusterRead(d, meta) -} - -func getCacheNodesToRemove(d *schema.ResourceData, oldNumberOfNodes int, cacheNodesToRemove int) []*string { - nodesIdsToRemove := []*string{} - for i := oldNumberOfNodes; i > oldNumberOfNodes-cacheNodesToRemove && i > 0; i-- { - s := fmt.Sprintf("%04d", i) - nodesIdsToRemove = append(nodesIdsToRemove, &s) - } - - return nodesIdsToRemove -} - -func setCacheNodeData(d *schema.ResourceData, c *elasticache.CacheCluster) error { - sortedCacheNodes := make([]*elasticache.CacheNode, len(c.CacheNodes)) - copy(sortedCacheNodes, c.CacheNodes) - sort.Sort(byCacheNodeId(sortedCacheNodes)) - - cacheNodeData := make([]map[string]interface{}, 0, len(sortedCacheNodes)) - - for _, node := range sortedCacheNodes { - if node.CacheNodeId == nil || node.Endpoint == nil || node.Endpoint.Address == nil || node.Endpoint.Port == nil || node.CustomerAvailabilityZone == nil { - return fmt.Errorf("Unexpected nil pointer in: %s", node) - } - cacheNodeData = append(cacheNodeData, map[string]interface{}{ - "id": *node.CacheNodeId, - "address": *node.Endpoint.Address, - "port": int(*node.Endpoint.Port), - "availability_zone": *node.CustomerAvailabilityZone, - }) - } - - return d.Set("cache_nodes", cacheNodeData) -} - -type byCacheNodeId []*elasticache.CacheNode - -func (b byCacheNodeId) Len() int { return len(b) } -func (b byCacheNodeId) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b byCacheNodeId) Less(i, j int) bool { - return b[i].CacheNodeId != nil && b[j].CacheNodeId != nil && - *b[i].CacheNodeId < *b[j].CacheNodeId -} - -func resourceAwsElasticacheClusterDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - req := &elasticache.DeleteCacheClusterInput{ - CacheClusterId: aws.String(d.Id()), - } - _, err := conn.DeleteCacheCluster(req) - if err != nil { - return err - } - - log.Printf("[DEBUG] Waiting for deletion: %v", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "available", "deleting", "incompatible-parameters", "incompatible-network", "restore-failed"}, - Target: []string{}, - Refresh: cacheClusterStateRefreshFunc(conn, d.Id(), "", []string{}), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, - } - - _, sterr := stateConf.WaitForState() - if sterr != nil { - return fmt.Errorf("Error waiting for elasticache (%s) to delete: %s", d.Id(), sterr) - } - - d.SetId("") - - return nil -} - -func cacheClusterStateRefreshFunc(conn *elasticache.ElastiCache, clusterID, givenState string, pending []string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeCacheClusters(&elasticache.DescribeCacheClustersInput{ - CacheClusterId: aws.String(clusterID), - ShowCacheNodeInfo: aws.Bool(true), - }) - if err != nil { - apierr := err.(awserr.Error) - log.Printf("[DEBUG] message: %v, code: %v", apierr.Message(), apierr.Code()) - if apierr.Message() == fmt.Sprintf("CacheCluster not found: %v", clusterID) { - log.Printf("[DEBUG] Detect deletion") - return nil, "", nil - } - - log.Printf("[ERROR] CacheClusterStateRefreshFunc: %s", err) - return nil, "", err - } - - if len(resp.CacheClusters) == 0 { - return nil, "", fmt.Errorf("[WARN] Error: no Cache Clusters found for id (%s)", clusterID) - } - - var c *elasticache.CacheCluster - for _, cluster := range resp.CacheClusters { - if *cluster.CacheClusterId == clusterID { - log.Printf("[DEBUG] Found matching ElastiCache cluster: %s", *cluster.CacheClusterId) - c = cluster - } - } - - if c == nil { - return nil, "", fmt.Errorf("[WARN] Error: no matching Elastic Cache cluster for id (%s)", clusterID) - } - - log.Printf("[DEBUG] ElastiCache Cluster (%s) status: %v", clusterID, *c.CacheClusterStatus) - - // return the current state if it's in the pending array - for _, p := range pending { - log.Printf("[DEBUG] ElastiCache: checking pending state (%s) for cluster (%s), cluster status: %s", pending, clusterID, *c.CacheClusterStatus) - s := *c.CacheClusterStatus - if p == s { - log.Printf("[DEBUG] Return with status: %v", *c.CacheClusterStatus) - return c, p, nil - } - } - - // return given state if it's not in pending - if givenState != "" { - log.Printf("[DEBUG] ElastiCache: checking given state (%s) of cluster (%s) against cluster status (%s)", givenState, clusterID, *c.CacheClusterStatus) - // check to make sure we have the node count we're expecting - if int64(len(c.CacheNodes)) != *c.NumCacheNodes { - log.Printf("[DEBUG] Node count is not what is expected: %d found, %d expected", len(c.CacheNodes), *c.NumCacheNodes) - return nil, "creating", nil - } - - log.Printf("[DEBUG] Node count matched (%d)", len(c.CacheNodes)) - // loop the nodes and check their status as well - for _, n := range c.CacheNodes { - log.Printf("[DEBUG] Checking cache node for status: %s", n) - if n.CacheNodeStatus != nil && *n.CacheNodeStatus != "available" { - log.Printf("[DEBUG] Node (%s) is not yet available, status: %s", *n.CacheNodeId, *n.CacheNodeStatus) - return nil, "creating", nil - } - log.Printf("[DEBUG] Cache node not in expected state") - } - log.Printf("[DEBUG] ElastiCache returning given state (%s), cluster: %s", givenState, c) - return c, givenState, nil - } - log.Printf("[DEBUG] current status: %v", *c.CacheClusterStatus) - return c, *c.CacheClusterStatus, nil - } -} - -func buildECARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct ElastiCache ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct ElastiCache ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:elasticache:%s:%s:cluster:%s", partition, region, accountid, identifier) - return arn, nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_parameter_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_parameter_group.go deleted file mode 100644 index e73d0be..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_parameter_group.go +++ /dev/null @@ -1,215 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elasticache" -) - -func resourceAwsElasticacheParameterGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticacheParameterGroupCreate, - Read: resourceAwsElasticacheParameterGroupRead, - Update: resourceAwsElasticacheParameterGroupUpdate, - Delete: resourceAwsElasticacheParameterGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "family": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - "parameter": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: false, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: resourceAwsElasticacheParameterHash, - }, - }, - } -} - -func resourceAwsElasticacheParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - createOpts := elasticache.CreateCacheParameterGroupInput{ - CacheParameterGroupName: aws.String(d.Get("name").(string)), - CacheParameterGroupFamily: aws.String(d.Get("family").(string)), - Description: aws.String(d.Get("description").(string)), - } - - log.Printf("[DEBUG] Create Cache Parameter Group: %#v", createOpts) - _, err := conn.CreateCacheParameterGroup(&createOpts) - if err != nil { - return fmt.Errorf("Error creating Cache Parameter Group: %s", err) - } - - d.Partial(true) - d.SetPartial("name") - d.SetPartial("family") - d.SetPartial("description") - d.Partial(false) - - d.SetId(*createOpts.CacheParameterGroupName) - log.Printf("[INFO] Cache Parameter Group ID: %s", d.Id()) - - return resourceAwsElasticacheParameterGroupUpdate(d, meta) -} - -func resourceAwsElasticacheParameterGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - describeOpts := elasticache.DescribeCacheParameterGroupsInput{ - CacheParameterGroupName: aws.String(d.Id()), - } - - describeResp, err := conn.DescribeCacheParameterGroups(&describeOpts) - if err != nil { - return err - } - - if len(describeResp.CacheParameterGroups) != 1 || - *describeResp.CacheParameterGroups[0].CacheParameterGroupName != d.Id() { - return fmt.Errorf("Unable to find Parameter Group: %#v", describeResp.CacheParameterGroups) - } - - d.Set("name", describeResp.CacheParameterGroups[0].CacheParameterGroupName) - d.Set("family", describeResp.CacheParameterGroups[0].CacheParameterGroupFamily) - d.Set("description", describeResp.CacheParameterGroups[0].Description) - - // Only include user customized parameters as there's hundreds of system/default ones - describeParametersOpts := elasticache.DescribeCacheParametersInput{ - CacheParameterGroupName: aws.String(d.Id()), - Source: aws.String("user"), - } - - describeParametersResp, err := conn.DescribeCacheParameters(&describeParametersOpts) - if err != nil { - return err - } - - d.Set("parameter", flattenElastiCacheParameters(describeParametersResp.Parameters)) - - return nil -} - -func resourceAwsElasticacheParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - d.Partial(true) - - if d.HasChange("parameter") { - o, n := d.GetChange("parameter") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - // Expand the "parameter" set to aws-sdk-go compat []elasticacheconn.Parameter - parameters, err := expandElastiCacheParameters(ns.Difference(os).List()) - if err != nil { - return err - } - - if len(parameters) > 0 { - modifyOpts := elasticache.ModifyCacheParameterGroupInput{ - CacheParameterGroupName: aws.String(d.Get("name").(string)), - ParameterNameValues: parameters, - } - - log.Printf("[DEBUG] Modify Cache Parameter Group: %#v", modifyOpts) - _, err = conn.ModifyCacheParameterGroup(&modifyOpts) - if err != nil { - return fmt.Errorf("Error modifying Cache Parameter Group: %s", err) - } - } - d.SetPartial("parameter") - } - - d.Partial(false) - - return resourceAwsElasticacheParameterGroupRead(d, meta) -} - -func resourceAwsElasticacheParameterGroupDelete(d *schema.ResourceData, meta interface{}) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"destroyed"}, - Refresh: resourceAwsElasticacheParameterGroupDeleteRefreshFunc(d, meta), - Timeout: 3 * time.Minute, - MinTimeout: 1 * time.Second, - } - _, err := stateConf.WaitForState() - return err -} - -func resourceAwsElasticacheParameterGroupDeleteRefreshFunc( - d *schema.ResourceData, - meta interface{}) resource.StateRefreshFunc { - conn := meta.(*AWSClient).elasticacheconn - - return func() (interface{}, string, error) { - - deleteOpts := elasticache.DeleteCacheParameterGroupInput{ - CacheParameterGroupName: aws.String(d.Id()), - } - - if _, err := conn.DeleteCacheParameterGroup(&deleteOpts); err != nil { - elasticahceerr, ok := err.(awserr.Error) - if ok && elasticahceerr.Code() == "CacheParameterGroupNotFoundFault" { - d.SetId("") - return d, "error", err - } - return d, "error", err - } - return d, "destroyed", nil - } -} - -func resourceAwsElasticacheParameterHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["value"].(string))) - - return hashcode.String(buf.String()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_replication_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_replication_group.go deleted file mode 100644 index dcd6f0c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_replication_group.go +++ /dev/null @@ -1,480 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElasticacheReplicationGroup() *schema.Resource { - - resourceSchema := resourceAwsElastiCacheCommonSchema() - - resourceSchema["replication_group_id"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAwsElastiCacheReplicationGroupId, - } - - resourceSchema["automatic_failover_enabled"] = &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - } - - resourceSchema["auto_minor_version_upgrade"] = &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - } - - resourceSchema["replication_group_description"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - } - - resourceSchema["number_cache_clusters"] = &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - } - - resourceSchema["primary_endpoint_address"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - - resourceSchema["configuration_endpoint_address"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - - resourceSchema["engine"].Required = false - resourceSchema["engine"].Optional = true - resourceSchema["engine"].Default = "redis" - resourceSchema["engine"].ValidateFunc = validateAwsElastiCacheReplicationGroupEngine - - return &schema.Resource{ - Create: resourceAwsElasticacheReplicationGroupCreate, - Read: resourceAwsElasticacheReplicationGroupRead, - Update: resourceAwsElasticacheReplicationGroupUpdate, - Delete: resourceAwsElasticacheReplicationGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: resourceSchema, - } -} - -func resourceAwsElasticacheReplicationGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - tags := tagsFromMapEC(d.Get("tags").(map[string]interface{})) - params := &elasticache.CreateReplicationGroupInput{ - ReplicationGroupId: aws.String(d.Get("replication_group_id").(string)), - ReplicationGroupDescription: aws.String(d.Get("replication_group_description").(string)), - AutomaticFailoverEnabled: aws.Bool(d.Get("automatic_failover_enabled").(bool)), - AutoMinorVersionUpgrade: aws.Bool(d.Get("auto_minor_version_upgrade").(bool)), - CacheNodeType: aws.String(d.Get("node_type").(string)), - Engine: aws.String(d.Get("engine").(string)), - Port: aws.Int64(int64(d.Get("port").(int))), - NumCacheClusters: aws.Int64(int64(d.Get("number_cache_clusters").(int))), - Tags: tags, - } - - if v, ok := d.GetOk("engine_version"); ok { - params.EngineVersion = aws.String(v.(string)) - } - - preferred_azs := d.Get("availability_zones").(*schema.Set).List() - if len(preferred_azs) > 0 { - azs := expandStringList(preferred_azs) - params.PreferredCacheClusterAZs = azs - } - - if v, ok := d.GetOk("parameter_group_name"); ok { - params.CacheParameterGroupName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("subnet_group_name"); ok { - params.CacheSubnetGroupName = aws.String(v.(string)) - } - - security_group_names := d.Get("security_group_names").(*schema.Set).List() - if len(security_group_names) > 0 { - params.CacheSecurityGroupNames = expandStringList(security_group_names) - } - - security_group_ids := d.Get("security_group_ids").(*schema.Set).List() - if len(security_group_ids) > 0 { - params.SecurityGroupIds = expandStringList(security_group_ids) - } - - snaps := d.Get("snapshot_arns").(*schema.Set).List() - if len(snaps) > 0 { - params.SnapshotArns = expandStringList(snaps) - } - - if v, ok := d.GetOk("maintenance_window"); ok { - params.PreferredMaintenanceWindow = aws.String(v.(string)) - } - - if v, ok := d.GetOk("notification_topic_arn"); ok { - params.NotificationTopicArn = aws.String(v.(string)) - } - - if v, ok := d.GetOk("snapshot_retention_limit"); ok { - params.SnapshotRetentionLimit = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("snapshot_window"); ok { - params.SnapshotWindow = aws.String(v.(string)) - } - - if v, ok := d.GetOk("snapshot_name"); ok { - params.SnapshotName = aws.String(v.(string)) - } - - resp, err := conn.CreateReplicationGroup(params) - if err != nil { - return fmt.Errorf("Error creating Elasticache Replication Group: %s", err) - } - - d.SetId(*resp.ReplicationGroup.ReplicationGroupId) - - pending := []string{"creating", "modifying", "restoring", "snapshotting"} - stateConf := &resource.StateChangeConf{ - Pending: pending, - Target: []string{"available"}, - Refresh: cacheReplicationGroupStateRefreshFunc(conn, d.Id(), "available", pending), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, - } - - log.Printf("[DEBUG] Waiting for state to become available: %v", d.Id()) - _, sterr := stateConf.WaitForState() - if sterr != nil { - return fmt.Errorf("Error waiting for elasticache replication group (%s) to be created: %s", d.Id(), sterr) - } - - return resourceAwsElasticacheReplicationGroupRead(d, meta) -} - -func resourceAwsElasticacheReplicationGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - req := &elasticache.DescribeReplicationGroupsInput{ - ReplicationGroupId: aws.String(d.Id()), - } - - res, err := conn.DescribeReplicationGroups(req) - if err != nil { - if eccErr, ok := err.(awserr.Error); ok && eccErr.Code() == "ReplicationGroupNotFoundFault" { - log.Printf("[WARN] Elasticache Replication Group (%s) not found", d.Id()) - d.SetId("") - return nil - } - - return err - } - - var rgp *elasticache.ReplicationGroup - for _, r := range res.ReplicationGroups { - if *r.ReplicationGroupId == d.Id() { - rgp = r - } - } - - if rgp == nil { - log.Printf("[WARN] Replication Group (%s) not found", d.Id()) - d.SetId("") - return nil - } - - if *rgp.Status == "deleting" { - log.Printf("[WARN] The Replication Group %q is currently in the `deleting` state", d.Id()) - d.SetId("") - return nil - } - - if rgp.AutomaticFailover != nil { - switch strings.ToLower(*rgp.AutomaticFailover) { - case "disabled", "disabling": - d.Set("automatic_failover_enabled", false) - case "enabled", "enabling": - d.Set("automatic_failover_enabled", true) - default: - log.Printf("Unknown AutomaticFailover state %s", *rgp.AutomaticFailover) - } - } - - d.Set("replication_group_description", rgp.Description) - d.Set("number_cache_clusters", len(rgp.MemberClusters)) - d.Set("replication_group_id", rgp.ReplicationGroupId) - - if rgp.NodeGroups != nil { - cacheCluster := *rgp.NodeGroups[0].NodeGroupMembers[0] - - res, err := conn.DescribeCacheClusters(&elasticache.DescribeCacheClustersInput{ - CacheClusterId: cacheCluster.CacheClusterId, - ShowCacheNodeInfo: aws.Bool(true), - }) - if err != nil { - return err - } - - if len(res.CacheClusters) == 0 { - return nil - } - - c := res.CacheClusters[0] - d.Set("node_type", c.CacheNodeType) - d.Set("engine", c.Engine) - d.Set("engine_version", c.EngineVersion) - d.Set("subnet_group_name", c.CacheSubnetGroupName) - d.Set("security_group_names", flattenElastiCacheSecurityGroupNames(c.CacheSecurityGroups)) - d.Set("security_group_ids", flattenElastiCacheSecurityGroupIds(c.SecurityGroups)) - - if c.CacheParameterGroup != nil { - d.Set("parameter_group_name", c.CacheParameterGroup.CacheParameterGroupName) - } - - d.Set("maintenance_window", c.PreferredMaintenanceWindow) - d.Set("snapshot_window", rgp.SnapshotWindow) - d.Set("snapshot_retention_limit", rgp.SnapshotRetentionLimit) - - if rgp.ConfigurationEndpoint != nil { - d.Set("port", rgp.ConfigurationEndpoint.Port) - d.Set("configuration_endpoint_address", rgp.ConfigurationEndpoint.Address) - } else { - d.Set("port", rgp.NodeGroups[0].PrimaryEndpoint.Port) - d.Set("primary_endpoint_address", rgp.NodeGroups[0].PrimaryEndpoint.Address) - } - - d.Set("auto_minor_version_upgrade", c.AutoMinorVersionUpgrade) - } - - return nil -} - -func resourceAwsElasticacheReplicationGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - requestUpdate := false - params := &elasticache.ModifyReplicationGroupInput{ - ApplyImmediately: aws.Bool(d.Get("apply_immediately").(bool)), - ReplicationGroupId: aws.String(d.Id()), - } - - if d.HasChange("replication_group_description") { - params.ReplicationGroupDescription = aws.String(d.Get("replication_group_description").(string)) - requestUpdate = true - } - - if d.HasChange("automatic_failover_enabled") { - params.AutomaticFailoverEnabled = aws.Bool(d.Get("automatic_failover_enabled").(bool)) - requestUpdate = true - } - - if d.HasChange("auto_minor_version_upgrade") { - params.AutoMinorVersionUpgrade = aws.Bool(d.Get("auto_minor_version_upgrade").(bool)) - requestUpdate = true - } - - if d.HasChange("security_group_ids") { - if attr := d.Get("security_group_ids").(*schema.Set); attr.Len() > 0 { - params.SecurityGroupIds = expandStringList(attr.List()) - requestUpdate = true - } - } - - if d.HasChange("security_group_names") { - if attr := d.Get("security_group_names").(*schema.Set); attr.Len() > 0 { - params.CacheSecurityGroupNames = expandStringList(attr.List()) - requestUpdate = true - } - } - - if d.HasChange("maintenance_window") { - params.PreferredMaintenanceWindow = aws.String(d.Get("maintenance_window").(string)) - requestUpdate = true - } - - if d.HasChange("notification_topic_arn") { - params.NotificationTopicArn = aws.String(d.Get("notification_topic_arn").(string)) - requestUpdate = true - } - - if d.HasChange("parameter_group_name") { - params.CacheParameterGroupName = aws.String(d.Get("parameter_group_name").(string)) - requestUpdate = true - } - - if d.HasChange("engine_version") { - params.EngineVersion = aws.String(d.Get("engine_version").(string)) - requestUpdate = true - } - - if d.HasChange("snapshot_retention_limit") { - params.SnapshotRetentionLimit = aws.Int64(int64(d.Get("snapshot_retention_limit").(int))) - requestUpdate = true - } - - if d.HasChange("snapshot_window") { - params.SnapshotWindow = aws.String(d.Get("snapshot_window").(string)) - requestUpdate = true - } - - if d.HasChange("node_type") { - params.CacheNodeType = aws.String(d.Get("node_type").(string)) - requestUpdate = true - } - - if requestUpdate { - _, err := conn.ModifyReplicationGroup(params) - if err != nil { - return fmt.Errorf("Error updating Elasticache replication group: %s", err) - } - - pending := []string{"creating", "modifying", "snapshotting"} - stateConf := &resource.StateChangeConf{ - Pending: pending, - Target: []string{"available"}, - Refresh: cacheReplicationGroupStateRefreshFunc(conn, d.Id(), "available", pending), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, - } - - log.Printf("[DEBUG] Waiting for state to become available: %v", d.Id()) - _, sterr := stateConf.WaitForState() - if sterr != nil { - return fmt.Errorf("Error waiting for elasticache replication group (%s) to be created: %s", d.Id(), sterr) - } - } - return resourceAwsElasticacheReplicationGroupRead(d, meta) -} - -func resourceAwsElasticacheReplicationGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - req := &elasticache.DeleteReplicationGroupInput{ - ReplicationGroupId: aws.String(d.Id()), - } - - _, err := conn.DeleteReplicationGroup(req) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "ReplicationGroupNotFoundFault" { - d.SetId("") - return nil - } - - return fmt.Errorf("Error deleting Elasticache replication group: %s", err) - } - - log.Printf("[DEBUG] Waiting for deletion: %v", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "available", "deleting"}, - Target: []string{}, - Refresh: cacheReplicationGroupStateRefreshFunc(conn, d.Id(), "", []string{}), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, - } - - _, sterr := stateConf.WaitForState() - if sterr != nil { - return fmt.Errorf("Error waiting for replication group (%s) to delete: %s", d.Id(), sterr) - } - - return nil -} - -func cacheReplicationGroupStateRefreshFunc(conn *elasticache.ElastiCache, replicationGroupId, givenState string, pending []string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeReplicationGroups(&elasticache.DescribeReplicationGroupsInput{ - ReplicationGroupId: aws.String(replicationGroupId), - }) - if err != nil { - if eccErr, ok := err.(awserr.Error); ok && eccErr.Code() == "ReplicationGroupNotFoundFault" { - log.Printf("[DEBUG] Replication Group Not Found") - return nil, "", nil - } - - log.Printf("[ERROR] cacheClusterReplicationGroupStateRefreshFunc: %s", err) - return nil, "", err - } - - if len(resp.ReplicationGroups) == 0 { - return nil, "", fmt.Errorf("[WARN] Error: no Cache Replication Groups found for id (%s)", replicationGroupId) - } - - var rg *elasticache.ReplicationGroup - for _, replicationGroup := range resp.ReplicationGroups { - if *replicationGroup.ReplicationGroupId == replicationGroupId { - log.Printf("[DEBUG] Found matching ElastiCache Replication Group: %s", *replicationGroup.ReplicationGroupId) - rg = replicationGroup - } - } - - if rg == nil { - return nil, "", fmt.Errorf("[WARN] Error: no matching ElastiCache Replication Group for id (%s)", replicationGroupId) - } - - log.Printf("[DEBUG] ElastiCache Replication Group (%s) status: %v", replicationGroupId, *rg.Status) - - // return the current state if it's in the pending array - for _, p := range pending { - log.Printf("[DEBUG] ElastiCache: checking pending state (%s) for Replication Group (%s), Replication Group status: %s", pending, replicationGroupId, *rg.Status) - s := *rg.Status - if p == s { - log.Printf("[DEBUG] Return with status: %v", *rg.Status) - return s, p, nil - } - } - - return rg, *rg.Status, nil - } -} - -func validateAwsElastiCacheReplicationGroupEngine(v interface{}, k string) (ws []string, errors []error) { - if strings.ToLower(v.(string)) != "redis" { - errors = append(errors, fmt.Errorf("The only acceptable Engine type when using Replication Groups is Redis")) - } - return -} - -func validateAwsElastiCacheReplicationGroupId(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if (len(value) < 1) || (len(value) > 20) { - errors = append(errors, fmt.Errorf( - "%q must contain from 1 to 20 alphanumeric characters or hyphens", k)) - } - if !regexp.MustCompile(`^[0-9a-zA-Z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q", k)) - } - if !regexp.MustCompile(`^[a-z]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot end with a hyphen", k)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_security_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_security_group.go deleted file mode 100644 index 07676e5..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_security_group.go +++ /dev/null @@ -1,144 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElasticacheSecurityGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticacheSecurityGroupCreate, - Read: resourceAwsElasticacheSecurityGroupRead, - Delete: resourceAwsElasticacheSecurityGroupDelete, - - Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "security_group_names": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - } -} - -func resourceAwsElasticacheSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - name := d.Get("name").(string) - desc := d.Get("description").(string) - nameSet := d.Get("security_group_names").(*schema.Set) - - names := make([]string, nameSet.Len()) - for i, name := range nameSet.List() { - names[i] = name.(string) - } - - log.Printf("[DEBUG] Cache security group create: name: %s, description: %s, security_group_names: %v", name, desc, names) - res, err := conn.CreateCacheSecurityGroup(&elasticache.CreateCacheSecurityGroupInput{ - Description: aws.String(desc), - CacheSecurityGroupName: aws.String(name), - }) - if err != nil { - return fmt.Errorf("Error creating CacheSecurityGroup: %s", err) - } - - for _, n := range names { - log.Printf("[DEBUG] Authorize cache security group ingress name: %v, ec2 security group name: %v", name, n) - _, err = conn.AuthorizeCacheSecurityGroupIngress(&elasticache.AuthorizeCacheSecurityGroupIngressInput{ - CacheSecurityGroupName: aws.String(name), - EC2SecurityGroupName: aws.String(n), - EC2SecurityGroupOwnerId: aws.String(*res.CacheSecurityGroup.OwnerId), - }) - if err != nil { - log.Printf("[ERROR] Failed to authorize: %v", err) - _, err := conn.DeleteCacheSecurityGroup(&elasticache.DeleteCacheSecurityGroupInput{ - CacheSecurityGroupName: aws.String(d.Id()), - }) - log.Printf("[ERROR] Revert cache security group: %v", err) - } - } - - d.SetId(name) - - return nil -} - -func resourceAwsElasticacheSecurityGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - req := &elasticache.DescribeCacheSecurityGroupsInput{ - CacheSecurityGroupName: aws.String(d.Get("name").(string)), - } - - res, err := conn.DescribeCacheSecurityGroups(req) - if err != nil { - return err - } - if len(res.CacheSecurityGroups) == 0 { - return fmt.Errorf("Error missing %v", d.Get("name")) - } - - var group *elasticache.CacheSecurityGroup - for _, g := range res.CacheSecurityGroups { - log.Printf("[DEBUG] CacheSecurityGroupName: %v, id: %v", g.CacheSecurityGroupName, d.Id()) - if *g.CacheSecurityGroupName == d.Id() { - group = g - } - } - if group == nil { - return fmt.Errorf("Error retrieving cache security group: %v", res) - } - - d.Set("name", group.CacheSecurityGroupName) - d.Set("description", group.Description) - - return nil -} - -func resourceAwsElasticacheSecurityGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - log.Printf("[DEBUG] Cache security group delete: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteCacheSecurityGroup(&elasticache.DeleteCacheSecurityGroupInput{ - CacheSecurityGroupName: aws.String(d.Id()), - }) - if err != nil { - apierr, ok := err.(awserr.Error) - if !ok { - return resource.RetryableError(err) - } - log.Printf("[DEBUG] APIError.Code: %v", apierr.Code()) - switch apierr.Code() { - case "InvalidCacheSecurityGroupState": - return resource.RetryableError(err) - case "DependencyViolation": - // If it is a dependency violation, we want to retry - return resource.RetryableError(err) - default: - return resource.NonRetryableError(err) - } - } - return nil - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_subnet_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_subnet_group.go deleted file mode 100644 index efae2e7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticache_subnet_group.go +++ /dev/null @@ -1,176 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElasticacheSubnetGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticacheSubnetGroupCreate, - Read: resourceAwsElasticacheSubnetGroupRead, - Update: resourceAwsElasticacheSubnetGroupUpdate, - Delete: resourceAwsElasticacheSubnetGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "Managed by Terraform", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: func(val interface{}) string { - // Elasticache normalizes subnet names to lowercase, - // so we have to do this too or else we can end up - // with non-converging diffs. - return strings.ToLower(val.(string)) - }, - }, - "subnet_ids": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - } -} - -func resourceAwsElasticacheSubnetGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - // Get the group properties - name := d.Get("name").(string) - desc := d.Get("description").(string) - subnetIdsSet := d.Get("subnet_ids").(*schema.Set) - - log.Printf("[DEBUG] Cache subnet group create: name: %s, description: %s", name, desc) - - subnetIds := expandStringList(subnetIdsSet.List()) - - req := &elasticache.CreateCacheSubnetGroupInput{ - CacheSubnetGroupDescription: aws.String(desc), - CacheSubnetGroupName: aws.String(name), - SubnetIds: subnetIds, - } - - _, err := conn.CreateCacheSubnetGroup(req) - if err != nil { - return fmt.Errorf("Error creating CacheSubnetGroup: %s", err) - } - - // Assign the group name as the resource ID - // Elasticache always retains the name in lower case, so we have to - // mimic that or else we won't be able to refresh a resource whose - // name contained uppercase characters. - d.SetId(strings.ToLower(name)) - - return nil -} - -func resourceAwsElasticacheSubnetGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - req := &elasticache.DescribeCacheSubnetGroupsInput{ - CacheSubnetGroupName: aws.String(d.Get("name").(string)), - } - - res, err := conn.DescribeCacheSubnetGroups(req) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "CacheSubnetGroupNotFoundFault" { - // Update state to indicate the db subnet no longer exists. - log.Printf("[WARN] Elasticache Subnet Group (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - return err - } - if len(res.CacheSubnetGroups) == 0 { - return fmt.Errorf("Error missing %v", d.Get("name")) - } - - var group *elasticache.CacheSubnetGroup - for _, g := range res.CacheSubnetGroups { - log.Printf("[DEBUG] %v %v", g.CacheSubnetGroupName, d.Id()) - if *g.CacheSubnetGroupName == d.Id() { - group = g - } - } - if group == nil { - return fmt.Errorf("Error retrieving cache subnet group: %v", res) - } - - ids := make([]string, len(group.Subnets)) - for i, s := range group.Subnets { - ids[i] = *s.SubnetIdentifier - } - - d.Set("name", group.CacheSubnetGroupName) - d.Set("description", group.CacheSubnetGroupDescription) - d.Set("subnet_ids", ids) - - return nil -} - -func resourceAwsElasticacheSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - if d.HasChange("subnet_ids") || d.HasChange("description") { - var subnets []*string - if v := d.Get("subnet_ids"); v != nil { - for _, v := range v.(*schema.Set).List() { - subnets = append(subnets, aws.String(v.(string))) - } - } - log.Printf("[DEBUG] Updating ElastiCache Subnet Group") - - _, err := conn.ModifyCacheSubnetGroup(&elasticache.ModifyCacheSubnetGroupInput{ - CacheSubnetGroupName: aws.String(d.Get("name").(string)), - CacheSubnetGroupDescription: aws.String(d.Get("description").(string)), - SubnetIds: subnets, - }) - if err != nil { - return err - } - } - - return resourceAwsElasticacheSubnetGroupRead(d, meta) -} -func resourceAwsElasticacheSubnetGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).elasticacheconn - - log.Printf("[DEBUG] Cache subnet group delete: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteCacheSubnetGroup(&elasticache.DeleteCacheSubnetGroupInput{ - CacheSubnetGroupName: aws.String(d.Id()), - }) - if err != nil { - apierr, ok := err.(awserr.Error) - if !ok { - return resource.RetryableError(err) - } - log.Printf("[DEBUG] APIError.Code: %v", apierr.Code()) - switch apierr.Code() { - case "DependencyViolation": - // If it is a dependency violation, we want to retry - return resource.RetryableError(err) - default: - return resource.NonRetryableError(err) - } - } - return nil - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticsearch_domain.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticsearch_domain.go deleted file mode 100644 index 7a8753e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticsearch_domain.go +++ /dev/null @@ -1,466 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElasticSearchDomain() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticSearchDomainCreate, - Read: resourceAwsElasticSearchDomainRead, - Update: resourceAwsElasticSearchDomainUpdate, - Delete: resourceAwsElasticSearchDomainDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsElasticSearchDomainImport, - }, - - Schema: map[string]*schema.Schema{ - "access_policies": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - "advanced_options": { - Type: schema.TypeMap, - Optional: true, - Computed: true, - }, - "domain_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[a-z][0-9a-z\-]{2,27}$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must start with a lowercase alphabet and be at least 3 and no more than 28 characters long. Valid characters are a-z (lowercase letters), 0-9, and - (hyphen).", k)) - } - return - }, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "domain_id": { - Type: schema.TypeString, - Computed: true, - }, - "endpoint": { - Type: schema.TypeString, - Computed: true, - }, - "ebs_options": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "ebs_enabled": { - Type: schema.TypeBool, - Required: true, - }, - "iops": { - Type: schema.TypeInt, - Optional: true, - }, - "volume_size": { - Type: schema.TypeInt, - Optional: true, - }, - "volume_type": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - "cluster_config": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "dedicated_master_count": { - Type: schema.TypeInt, - Optional: true, - }, - "dedicated_master_enabled": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "dedicated_master_type": { - Type: schema.TypeString, - Optional: true, - }, - "instance_count": { - Type: schema.TypeInt, - Optional: true, - Default: 1, - }, - "instance_type": { - Type: schema.TypeString, - Optional: true, - Default: "m3.medium.elasticsearch", - }, - "zone_awareness_enabled": { - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - }, - "snapshot_options": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "automated_snapshot_start_hour": { - Type: schema.TypeInt, - Required: true, - }, - }, - }, - }, - "elasticsearch_version": { - Type: schema.TypeString, - Optional: true, - Default: "1.5", - ForceNew: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsElasticSearchDomainImport( - d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - d.Set("domain_name", d.Id()) - return []*schema.ResourceData{d}, nil -} - -func resourceAwsElasticSearchDomainCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).esconn - - input := elasticsearch.CreateElasticsearchDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - ElasticsearchVersion: aws.String(d.Get("elasticsearch_version").(string)), - } - - if v, ok := d.GetOk("access_policies"); ok { - input.AccessPolicies = aws.String(v.(string)) - } - - if v, ok := d.GetOk("advanced_options"); ok { - input.AdvancedOptions = stringMapToPointers(v.(map[string]interface{})) - } - - if v, ok := d.GetOk("ebs_options"); ok { - options := v.([]interface{}) - - if len(options) > 1 { - return fmt.Errorf("Only a single ebs_options block is expected") - } else if len(options) == 1 { - if options[0] == nil { - return fmt.Errorf("At least one field is expected inside ebs_options") - } - - s := options[0].(map[string]interface{}) - input.EBSOptions = expandESEBSOptions(s) - } - } - - if v, ok := d.GetOk("cluster_config"); ok { - config := v.([]interface{}) - - if len(config) > 1 { - return fmt.Errorf("Only a single cluster_config block is expected") - } else if len(config) == 1 { - if config[0] == nil { - return fmt.Errorf("At least one field is expected inside cluster_config") - } - m := config[0].(map[string]interface{}) - input.ElasticsearchClusterConfig = expandESClusterConfig(m) - } - } - - if v, ok := d.GetOk("snapshot_options"); ok { - options := v.([]interface{}) - - if len(options) > 1 { - return fmt.Errorf("Only a single snapshot_options block is expected") - } else if len(options) == 1 { - if options[0] == nil { - return fmt.Errorf("At least one field is expected inside snapshot_options") - } - - o := options[0].(map[string]interface{}) - - snapshotOptions := elasticsearch.SnapshotOptions{ - AutomatedSnapshotStartHour: aws.Int64(int64(o["automated_snapshot_start_hour"].(int))), - } - - input.SnapshotOptions = &snapshotOptions - } - } - - log.Printf("[DEBUG] Creating ElasticSearch domain: %s", input) - out, err := conn.CreateElasticsearchDomain(&input) - if err != nil { - return err - } - - d.SetId(*out.DomainStatus.ARN) - - log.Printf("[DEBUG] Waiting for ElasticSearch domain %q to be created", d.Id()) - err = resource.Retry(60*time.Minute, func() *resource.RetryError { - out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - }) - if err != nil { - return resource.NonRetryableError(err) - } - - if !*out.DomainStatus.Processing && out.DomainStatus.Endpoint != nil { - return nil - } - - return resource.RetryableError( - fmt.Errorf("%q: Timeout while waiting for the domain to be created", d.Id())) - }) - if err != nil { - return err - } - - tags := tagsFromMapElasticsearchService(d.Get("tags").(map[string]interface{})) - - if err := setTagsElasticsearchService(conn, d, *out.DomainStatus.ARN); err != nil { - return err - } - - d.Set("tags", tagsToMapElasticsearchService(tags)) - d.SetPartial("tags") - d.Partial(false) - - log.Printf("[DEBUG] ElasticSearch domain %q created", d.Id()) - - return resourceAwsElasticSearchDomainRead(d, meta) -} - -func resourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).esconn - - out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "ResourceNotFoundException" { - log.Printf("[INFO] ElasticSearch Domain %q not found", d.Get("domain_name").(string)) - d.SetId("") - return nil - } - return err - } - - log.Printf("[DEBUG] Received ElasticSearch domain: %s", out) - - ds := out.DomainStatus - - if ds.AccessPolicies != nil && *ds.AccessPolicies != "" { - policies, err := normalizeJsonString(*ds.AccessPolicies) - if err != nil { - return errwrap.Wrapf("access policies contain an invalid JSON: {{err}}", err) - } - d.Set("access_policies", policies) - } - err = d.Set("advanced_options", pointersMapToStringList(ds.AdvancedOptions)) - if err != nil { - return err - } - d.SetId(*ds.ARN) - d.Set("domain_id", ds.DomainId) - d.Set("domain_name", ds.DomainName) - d.Set("elasticsearch_version", ds.ElasticsearchVersion) - if ds.Endpoint != nil { - d.Set("endpoint", *ds.Endpoint) - } - - err = d.Set("ebs_options", flattenESEBSOptions(ds.EBSOptions)) - if err != nil { - return err - } - err = d.Set("cluster_config", flattenESClusterConfig(ds.ElasticsearchClusterConfig)) - if err != nil { - return err - } - if ds.SnapshotOptions != nil { - d.Set("snapshot_options", map[string]interface{}{ - "automated_snapshot_start_hour": *ds.SnapshotOptions.AutomatedSnapshotStartHour, - }) - } - - d.Set("arn", ds.ARN) - - listOut, err := conn.ListTags(&elasticsearch.ListTagsInput{ - ARN: ds.ARN, - }) - - if err != nil { - return err - } - var est []*elasticsearch.Tag - if len(listOut.TagList) > 0 { - est = listOut.TagList - } - - d.Set("tags", tagsToMapElasticsearchService(est)) - - return nil -} - -func resourceAwsElasticSearchDomainUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).esconn - - d.Partial(true) - - if err := setTagsElasticsearchService(conn, d, d.Id()); err != nil { - return err - } else { - d.SetPartial("tags") - } - - input := elasticsearch.UpdateElasticsearchDomainConfigInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - } - - if d.HasChange("access_policies") { - input.AccessPolicies = aws.String(d.Get("access_policies").(string)) - } - - if d.HasChange("advanced_options") { - input.AdvancedOptions = stringMapToPointers(d.Get("advanced_options").(map[string]interface{})) - } - - if d.HasChange("ebs_options") { - options := d.Get("ebs_options").([]interface{}) - - if len(options) > 1 { - return fmt.Errorf("Only a single ebs_options block is expected") - } else if len(options) == 1 { - s := options[0].(map[string]interface{}) - input.EBSOptions = expandESEBSOptions(s) - } - } - - if d.HasChange("cluster_config") { - config := d.Get("cluster_config").([]interface{}) - - if len(config) > 1 { - return fmt.Errorf("Only a single cluster_config block is expected") - } else if len(config) == 1 { - m := config[0].(map[string]interface{}) - input.ElasticsearchClusterConfig = expandESClusterConfig(m) - } - } - - if d.HasChange("snapshot_options") { - options := d.Get("snapshot_options").([]interface{}) - - if len(options) > 1 { - return fmt.Errorf("Only a single snapshot_options block is expected") - } else if len(options) == 1 { - o := options[0].(map[string]interface{}) - - snapshotOptions := elasticsearch.SnapshotOptions{ - AutomatedSnapshotStartHour: aws.Int64(int64(o["automated_snapshot_start_hour"].(int))), - } - - input.SnapshotOptions = &snapshotOptions - } - } - - _, err := conn.UpdateElasticsearchDomainConfig(&input) - if err != nil { - return err - } - - err = resource.Retry(60*time.Minute, func() *resource.RetryError { - out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - }) - if err != nil { - return resource.NonRetryableError(err) - } - - if *out.DomainStatus.Processing == false { - return nil - } - - return resource.RetryableError( - fmt.Errorf("%q: Timeout while waiting for changes to be processed", d.Id())) - }) - if err != nil { - return err - } - - d.Partial(false) - - return resourceAwsElasticSearchDomainRead(d, meta) -} - -func resourceAwsElasticSearchDomainDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).esconn - - log.Printf("[DEBUG] Deleting ElasticSearch domain: %q", d.Get("domain_name").(string)) - _, err := conn.DeleteElasticsearchDomain(&elasticsearch.DeleteElasticsearchDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - }) - if err != nil { - return err - } - - log.Printf("[DEBUG] Waiting for ElasticSearch domain %q to be deleted", d.Get("domain_name").(string)) - err = resource.Retry(90*time.Minute, func() *resource.RetryError { - out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - }) - - if err != nil { - awsErr, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - - if awsErr.Code() == "ResourceNotFoundException" { - return nil - } - - return resource.NonRetryableError(err) - } - - if !*out.DomainStatus.Processing { - return nil - } - - return resource.RetryableError( - fmt.Errorf("%q: Timeout while waiting for the domain to be deleted", d.Id())) - }) - - d.SetId("") - - return err -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticsearch_domain_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticsearch_domain_policy.go deleted file mode 100644 index dfb22c6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elasticsearch_domain_policy.go +++ /dev/null @@ -1,127 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElasticSearchDomainPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElasticSearchDomainPolicyUpsert, - Read: resourceAwsElasticSearchDomainPolicyRead, - Update: resourceAwsElasticSearchDomainPolicyUpsert, - Delete: resourceAwsElasticSearchDomainPolicyDelete, - - Schema: map[string]*schema.Schema{ - "domain_name": { - Type: schema.TypeString, - Required: true, - }, - "access_policies": { - Type: schema.TypeString, - Required: true, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - }, - } -} - -func resourceAwsElasticSearchDomainPolicyRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).esconn - name := d.Get("domain_name").(string) - out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ - DomainName: aws.String(name), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFound" { - log.Printf("[WARN] ElasticSearch Domain %q not found, removing", name) - d.SetId("") - return nil - } - return err - } - - log.Printf("[DEBUG] Received ElasticSearch domain: %s", out) - - ds := out.DomainStatus - d.Set("access_policies", ds.AccessPolicies) - - return nil -} - -func resourceAwsElasticSearchDomainPolicyUpsert(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).esconn - domainName := d.Get("domain_name").(string) - _, err := conn.UpdateElasticsearchDomainConfig(&elasticsearch.UpdateElasticsearchDomainConfigInput{ - DomainName: aws.String(domainName), - AccessPolicies: aws.String(d.Get("access_policies").(string)), - }) - if err != nil { - return err - } - - d.SetId("esd-policy-" + domainName) - - err = resource.Retry(50*time.Minute, func() *resource.RetryError { - out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - }) - if err != nil { - return resource.NonRetryableError(err) - } - - if *out.DomainStatus.Processing == false { - return nil - } - - return resource.RetryableError( - fmt.Errorf("%q: Timeout while waiting for changes to be processed", d.Id())) - }) - if err != nil { - return err - } - - return resourceAwsElasticSearchDomainPolicyRead(d, meta) -} - -func resourceAwsElasticSearchDomainPolicyDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).esconn - - _, err := conn.UpdateElasticsearchDomainConfig(&elasticsearch.UpdateElasticsearchDomainConfigInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - AccessPolicies: aws.String(""), - }) - if err != nil { - return err - } - - log.Printf("[DEBUG] Waiting for ElasticSearch domain policy %q to be deleted", d.Get("domain_name").(string)) - err = resource.Retry(60*time.Minute, func() *resource.RetryError { - out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - }) - if err != nil { - return resource.NonRetryableError(err) - } - - if *out.DomainStatus.Processing == false { - return nil - } - - return resource.RetryableError( - fmt.Errorf("%q: Timeout while waiting for policy to be deleted", d.Id())) - }) - if err != nil { - return err - } - - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elb.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elb.go deleted file mode 100644 index ce69ff6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elb.go +++ /dev/null @@ -1,965 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElb() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElbCreate, - Read: resourceAwsElbRead, - Update: resourceAwsElbUpdate, - Delete: resourceAwsElbDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateElbName, - }, - - "internal": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "cross_zone_load_balancing": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "availability_zones": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Computed: true, - Set: schema.HashString, - }, - - "instances": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Computed: true, - Set: schema.HashString, - }, - - "security_groups": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Computed: true, - Set: schema.HashString, - }, - - "source_security_group": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "source_security_group_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "subnets": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Computed: true, - Set: schema.HashString, - }, - - "idle_timeout": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 60, - ValidateFunc: validateIntegerInRange(1, 3600), - }, - - "connection_draining": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "connection_draining_timeout": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 300, - }, - - "access_logs": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "interval": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 60, - ValidateFunc: validateAccessLogsInterval, - }, - "bucket": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "bucket_prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "enabled": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - }, - }, - }, - - "listener": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "instance_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ValidateFunc: validateIntegerInRange(1, 65535), - }, - - "instance_protocol": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateListenerProtocol, - }, - - "lb_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ValidateFunc: validateIntegerInRange(1, 65535), - }, - - "lb_protocol": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateListenerProtocol, - }, - - "ssl_certificate_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - }, - Set: resourceAwsElbListenerHash, - }, - - "health_check": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "healthy_threshold": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ValidateFunc: validateIntegerInRange(2, 10), - }, - - "unhealthy_threshold": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ValidateFunc: validateIntegerInRange(2, 10), - }, - - "target": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateHeathCheckTarget, - }, - - "interval": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ValidateFunc: validateIntegerInRange(5, 300), - }, - - "timeout": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ValidateFunc: validateIntegerInRange(2, 60), - }, - }, - }, - }, - - "dns_name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "zone_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsElbCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - // Expand the "listener" set to aws-sdk-go compat []*elb.Listener - listeners, err := expandListeners(d.Get("listener").(*schema.Set).List()) - if err != nil { - return err - } - - var elbName string - if v, ok := d.GetOk("name"); ok { - elbName = v.(string) - } else { - elbName = resource.PrefixedUniqueId("tf-lb-") - d.Set("name", elbName) - } - - tags := tagsFromMapELB(d.Get("tags").(map[string]interface{})) - // Provision the elb - elbOpts := &elb.CreateLoadBalancerInput{ - LoadBalancerName: aws.String(elbName), - Listeners: listeners, - Tags: tags, - } - - if scheme, ok := d.GetOk("internal"); ok && scheme.(bool) { - elbOpts.Scheme = aws.String("internal") - } - - if v, ok := d.GetOk("availability_zones"); ok { - elbOpts.AvailabilityZones = expandStringList(v.(*schema.Set).List()) - } - - if v, ok := d.GetOk("security_groups"); ok { - elbOpts.SecurityGroups = expandStringList(v.(*schema.Set).List()) - } - - if v, ok := d.GetOk("subnets"); ok { - elbOpts.Subnets = expandStringList(v.(*schema.Set).List()) - } - - log.Printf("[DEBUG] ELB create configuration: %#v", elbOpts) - err = resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := elbconn.CreateLoadBalancer(elbOpts) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Check for IAM SSL Cert error, eventual consistancy issue - if awsErr.Code() == "CertificateNotFound" { - return resource.RetryableError( - fmt.Errorf("[WARN] Error creating ELB Listener with SSL Cert, retrying: %s", err)) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return err - } - - // Assign the elb's unique identifier for use later - d.SetId(elbName) - log.Printf("[INFO] ELB ID: %s", d.Id()) - - // Enable partial mode and record what we set - d.Partial(true) - d.SetPartial("name") - d.SetPartial("internal") - d.SetPartial("availability_zones") - d.SetPartial("listener") - d.SetPartial("security_groups") - d.SetPartial("subnets") - - d.Set("tags", tagsToMapELB(tags)) - - return resourceAwsElbUpdate(d, meta) -} - -func resourceAwsElbRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - elbName := d.Id() - - // Retrieve the ELB properties for updating the state - describeElbOpts := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{aws.String(elbName)}, - } - - describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts) - if err != nil { - if isLoadBalancerNotFound(err) { - // The ELB is gone now, so just remove it from the state - d.SetId("") - return nil - } - - return fmt.Errorf("Error retrieving ELB: %s", err) - } - if len(describeResp.LoadBalancerDescriptions) != 1 { - return fmt.Errorf("Unable to find ELB: %#v", describeResp.LoadBalancerDescriptions) - } - - describeAttrsOpts := &elb.DescribeLoadBalancerAttributesInput{ - LoadBalancerName: aws.String(elbName), - } - describeAttrsResp, err := elbconn.DescribeLoadBalancerAttributes(describeAttrsOpts) - if err != nil { - if isLoadBalancerNotFound(err) { - // The ELB is gone now, so just remove it from the state - d.SetId("") - return nil - } - - return fmt.Errorf("Error retrieving ELB: %s", err) - } - - lbAttrs := describeAttrsResp.LoadBalancerAttributes - - lb := describeResp.LoadBalancerDescriptions[0] - - d.Set("name", lb.LoadBalancerName) - d.Set("dns_name", lb.DNSName) - d.Set("zone_id", lb.CanonicalHostedZoneNameID) - - var scheme bool - if lb.Scheme != nil { - scheme = *lb.Scheme == "internal" - } - d.Set("internal", scheme) - d.Set("availability_zones", flattenStringList(lb.AvailabilityZones)) - d.Set("instances", flattenInstances(lb.Instances)) - d.Set("listener", flattenListeners(lb.ListenerDescriptions)) - d.Set("security_groups", flattenStringList(lb.SecurityGroups)) - if lb.SourceSecurityGroup != nil { - group := lb.SourceSecurityGroup.GroupName - if lb.SourceSecurityGroup.OwnerAlias != nil && *lb.SourceSecurityGroup.OwnerAlias != "" { - group = aws.String(*lb.SourceSecurityGroup.OwnerAlias + "/" + *lb.SourceSecurityGroup.GroupName) - } - d.Set("source_security_group", group) - - // Manually look up the ELB Security Group ID, since it's not provided - var elbVpc string - if lb.VPCId != nil { - elbVpc = *lb.VPCId - sgId, err := sourceSGIdByName(meta, *lb.SourceSecurityGroup.GroupName, elbVpc) - if err != nil { - return fmt.Errorf("[WARN] Error looking up ELB Security Group ID: %s", err) - } else { - d.Set("source_security_group_id", sgId) - } - } - } - d.Set("subnets", flattenStringList(lb.Subnets)) - if lbAttrs.ConnectionSettings != nil { - d.Set("idle_timeout", lbAttrs.ConnectionSettings.IdleTimeout) - } - d.Set("connection_draining", lbAttrs.ConnectionDraining.Enabled) - d.Set("connection_draining_timeout", lbAttrs.ConnectionDraining.Timeout) - d.Set("cross_zone_load_balancing", lbAttrs.CrossZoneLoadBalancing.Enabled) - if lbAttrs.AccessLog != nil { - // The AWS API does not allow users to remove access_logs, only disable them. - // During creation of the ELB, Terraform sets the access_logs to disabled, - // so there should not be a case where lbAttrs.AccessLog above is nil. - - // Here we do not record the remove value of access_log if: - // - there is no access_log block in the configuration - // - the remote access_logs are disabled - // - // This indicates there is no access_log in the configuration. - // - externally added access_logs will be enabled, so we'll detect the drift - // - locally added access_logs will be in the config, so we'll add to the - // API/state - // See https://github.com/hashicorp/terraform/issues/10138 - _, n := d.GetChange("access_logs") - elbal := lbAttrs.AccessLog - nl := n.([]interface{}) - if len(nl) == 0 && !*elbal.Enabled { - elbal = nil - } - if err := d.Set("access_logs", flattenAccessLog(elbal)); err != nil { - return err - } - } - - resp, err := elbconn.DescribeTags(&elb.DescribeTagsInput{ - LoadBalancerNames: []*string{lb.LoadBalancerName}, - }) - - var et []*elb.Tag - if len(resp.TagDescriptions) > 0 { - et = resp.TagDescriptions[0].Tags - } - d.Set("tags", tagsToMapELB(et)) - - // There's only one health check, so save that to state as we - // currently can - if *lb.HealthCheck.Target != "" { - d.Set("health_check", flattenHealthCheck(lb.HealthCheck)) - } - - return nil -} - -func resourceAwsElbUpdate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - d.Partial(true) - - if d.HasChange("listener") { - o, n := d.GetChange("listener") - os := o.(*schema.Set) - ns := n.(*schema.Set) - - remove, _ := expandListeners(os.Difference(ns).List()) - add, _ := expandListeners(ns.Difference(os).List()) - - if len(remove) > 0 { - ports := make([]*int64, 0, len(remove)) - for _, listener := range remove { - ports = append(ports, listener.LoadBalancerPort) - } - - deleteListenersOpts := &elb.DeleteLoadBalancerListenersInput{ - LoadBalancerName: aws.String(d.Id()), - LoadBalancerPorts: ports, - } - - log.Printf("[DEBUG] ELB Delete Listeners opts: %s", deleteListenersOpts) - _, err := elbconn.DeleteLoadBalancerListeners(deleteListenersOpts) - if err != nil { - return fmt.Errorf("Failure removing outdated ELB listeners: %s", err) - } - } - - if len(add) > 0 { - createListenersOpts := &elb.CreateLoadBalancerListenersInput{ - LoadBalancerName: aws.String(d.Id()), - Listeners: add, - } - - // Occasionally AWS will error with a 'duplicate listener', without any - // other listeners on the ELB. Retry here to eliminate that. - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] ELB Create Listeners opts: %s", createListenersOpts) - if _, err := elbconn.CreateLoadBalancerListeners(createListenersOpts); err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "DuplicateListener" { - log.Printf("[DEBUG] Duplicate listener found for ELB (%s), retrying", d.Id()) - return resource.RetryableError(awsErr) - } - if awsErr.Code() == "CertificateNotFound" && strings.Contains(awsErr.Message(), "Server Certificate not found for the key: arn") { - log.Printf("[DEBUG] SSL Cert not found for given ARN, retrying") - return resource.RetryableError(awsErr) - } - } - - // Didn't recognize the error, so shouldn't retry. - return resource.NonRetryableError(err) - } - // Successful creation - return nil - }) - if err != nil { - return fmt.Errorf("Failure adding new or updated ELB listeners: %s", err) - } - } - - d.SetPartial("listener") - } - - // If we currently have instances, or did have instances, - // we want to figure out what to add and remove from the load - // balancer - if d.HasChange("instances") { - o, n := d.GetChange("instances") - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := expandInstanceString(os.Difference(ns).List()) - add := expandInstanceString(ns.Difference(os).List()) - - if len(add) > 0 { - registerInstancesOpts := elb.RegisterInstancesWithLoadBalancerInput{ - LoadBalancerName: aws.String(d.Id()), - Instances: add, - } - - _, err := elbconn.RegisterInstancesWithLoadBalancer(®isterInstancesOpts) - if err != nil { - return fmt.Errorf("Failure registering instances with ELB: %s", err) - } - } - if len(remove) > 0 { - deRegisterInstancesOpts := elb.DeregisterInstancesFromLoadBalancerInput{ - LoadBalancerName: aws.String(d.Id()), - Instances: remove, - } - - _, err := elbconn.DeregisterInstancesFromLoadBalancer(&deRegisterInstancesOpts) - if err != nil { - return fmt.Errorf("Failure deregistering instances from ELB: %s", err) - } - } - - d.SetPartial("instances") - } - - if d.HasChange("cross_zone_load_balancing") || d.HasChange("idle_timeout") || d.HasChange("access_logs") { - attrs := elb.ModifyLoadBalancerAttributesInput{ - LoadBalancerName: aws.String(d.Get("name").(string)), - LoadBalancerAttributes: &elb.LoadBalancerAttributes{ - CrossZoneLoadBalancing: &elb.CrossZoneLoadBalancing{ - Enabled: aws.Bool(d.Get("cross_zone_load_balancing").(bool)), - }, - ConnectionSettings: &elb.ConnectionSettings{ - IdleTimeout: aws.Int64(int64(d.Get("idle_timeout").(int))), - }, - }, - } - - logs := d.Get("access_logs").([]interface{}) - if len(logs) == 1 { - l := logs[0].(map[string]interface{}) - accessLog := &elb.AccessLog{ - Enabled: aws.Bool(l["enabled"].(bool)), - EmitInterval: aws.Int64(int64(l["interval"].(int))), - S3BucketName: aws.String(l["bucket"].(string)), - } - - if l["bucket_prefix"] != "" { - accessLog.S3BucketPrefix = aws.String(l["bucket_prefix"].(string)) - } - - attrs.LoadBalancerAttributes.AccessLog = accessLog - } else if len(logs) == 0 { - // disable access logs - attrs.LoadBalancerAttributes.AccessLog = &elb.AccessLog{ - Enabled: aws.Bool(false), - } - } - - log.Printf("[DEBUG] ELB Modify Load Balancer Attributes Request: %#v", attrs) - _, err := elbconn.ModifyLoadBalancerAttributes(&attrs) - if err != nil { - return fmt.Errorf("Failure configuring ELB attributes: %s", err) - } - - d.SetPartial("cross_zone_load_balancing") - d.SetPartial("idle_timeout") - d.SetPartial("connection_draining_timeout") - } - - // We have to do these changes separately from everything else since - // they have some weird undocumented rules. You can't set the timeout - // without having connection draining to true, so we set that to true, - // set the timeout, then reset it to false if requested. - if d.HasChange("connection_draining") || d.HasChange("connection_draining_timeout") { - // We do timeout changes first since they require us to set draining - // to true for a hot second. - if d.HasChange("connection_draining_timeout") { - attrs := elb.ModifyLoadBalancerAttributesInput{ - LoadBalancerName: aws.String(d.Get("name").(string)), - LoadBalancerAttributes: &elb.LoadBalancerAttributes{ - ConnectionDraining: &elb.ConnectionDraining{ - Enabled: aws.Bool(true), - Timeout: aws.Int64(int64(d.Get("connection_draining_timeout").(int))), - }, - }, - } - - _, err := elbconn.ModifyLoadBalancerAttributes(&attrs) - if err != nil { - return fmt.Errorf("Failure configuring ELB attributes: %s", err) - } - - d.SetPartial("connection_draining_timeout") - } - - // Then we always set connection draining even if there is no change. - // This lets us reset to "false" if requested even with a timeout - // change. - attrs := elb.ModifyLoadBalancerAttributesInput{ - LoadBalancerName: aws.String(d.Get("name").(string)), - LoadBalancerAttributes: &elb.LoadBalancerAttributes{ - ConnectionDraining: &elb.ConnectionDraining{ - Enabled: aws.Bool(d.Get("connection_draining").(bool)), - }, - }, - } - - _, err := elbconn.ModifyLoadBalancerAttributes(&attrs) - if err != nil { - return fmt.Errorf("Failure configuring ELB attributes: %s", err) - } - - d.SetPartial("connection_draining") - } - - if d.HasChange("health_check") { - hc := d.Get("health_check").([]interface{}) - if len(hc) > 0 { - check := hc[0].(map[string]interface{}) - configureHealthCheckOpts := elb.ConfigureHealthCheckInput{ - LoadBalancerName: aws.String(d.Id()), - HealthCheck: &elb.HealthCheck{ - HealthyThreshold: aws.Int64(int64(check["healthy_threshold"].(int))), - UnhealthyThreshold: aws.Int64(int64(check["unhealthy_threshold"].(int))), - Interval: aws.Int64(int64(check["interval"].(int))), - Target: aws.String(check["target"].(string)), - Timeout: aws.Int64(int64(check["timeout"].(int))), - }, - } - _, err := elbconn.ConfigureHealthCheck(&configureHealthCheckOpts) - if err != nil { - return fmt.Errorf("Failure configuring health check for ELB: %s", err) - } - d.SetPartial("health_check") - } - } - - if d.HasChange("security_groups") { - groups := d.Get("security_groups").(*schema.Set).List() - - applySecurityGroupsOpts := elb.ApplySecurityGroupsToLoadBalancerInput{ - LoadBalancerName: aws.String(d.Id()), - SecurityGroups: expandStringList(groups), - } - - _, err := elbconn.ApplySecurityGroupsToLoadBalancer(&applySecurityGroupsOpts) - if err != nil { - return fmt.Errorf("Failure applying security groups to ELB: %s", err) - } - - d.SetPartial("security_groups") - } - - if d.HasChange("availability_zones") { - o, n := d.GetChange("availability_zones") - os := o.(*schema.Set) - ns := n.(*schema.Set) - - removed := expandStringList(os.Difference(ns).List()) - added := expandStringList(ns.Difference(os).List()) - - if len(added) > 0 { - enableOpts := &elb.EnableAvailabilityZonesForLoadBalancerInput{ - LoadBalancerName: aws.String(d.Id()), - AvailabilityZones: added, - } - - log.Printf("[DEBUG] ELB enable availability zones opts: %s", enableOpts) - _, err := elbconn.EnableAvailabilityZonesForLoadBalancer(enableOpts) - if err != nil { - return fmt.Errorf("Failure enabling ELB availability zones: %s", err) - } - } - - if len(removed) > 0 { - disableOpts := &elb.DisableAvailabilityZonesForLoadBalancerInput{ - LoadBalancerName: aws.String(d.Id()), - AvailabilityZones: removed, - } - - log.Printf("[DEBUG] ELB disable availability zones opts: %s", disableOpts) - _, err := elbconn.DisableAvailabilityZonesForLoadBalancer(disableOpts) - if err != nil { - return fmt.Errorf("Failure disabling ELB availability zones: %s", err) - } - } - - d.SetPartial("availability_zones") - } - - if d.HasChange("subnets") { - o, n := d.GetChange("subnets") - os := o.(*schema.Set) - ns := n.(*schema.Set) - - removed := expandStringList(os.Difference(ns).List()) - added := expandStringList(ns.Difference(os).List()) - - if len(removed) > 0 { - detachOpts := &elb.DetachLoadBalancerFromSubnetsInput{ - LoadBalancerName: aws.String(d.Id()), - Subnets: removed, - } - - log.Printf("[DEBUG] ELB detach subnets opts: %s", detachOpts) - _, err := elbconn.DetachLoadBalancerFromSubnets(detachOpts) - if err != nil { - return fmt.Errorf("Failure removing ELB subnets: %s", err) - } - } - - if len(added) > 0 { - attachOpts := &elb.AttachLoadBalancerToSubnetsInput{ - LoadBalancerName: aws.String(d.Id()), - Subnets: added, - } - - log.Printf("[DEBUG] ELB attach subnets opts: %s", attachOpts) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := elbconn.AttachLoadBalancerToSubnets(attachOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // eventually consistent issue with removing a subnet in AZ1 and - // immediately adding a new one in the same AZ - if awsErr.Code() == "InvalidConfigurationRequest" && strings.Contains(awsErr.Message(), "cannot be attached to multiple subnets in the same AZ") { - log.Printf("[DEBUG] retrying az association") - return resource.RetryableError(awsErr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return fmt.Errorf("Failure adding ELB subnets: %s", err) - } - } - - d.SetPartial("subnets") - } - - if err := setTagsELB(elbconn, d); err != nil { - return err - } - - d.SetPartial("tags") - d.Partial(false) - - return resourceAwsElbRead(d, meta) -} - -func resourceAwsElbDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - log.Printf("[INFO] Deleting ELB: %s", d.Id()) - - // Destroy the load balancer - deleteElbOpts := elb.DeleteLoadBalancerInput{ - LoadBalancerName: aws.String(d.Id()), - } - if _, err := elbconn.DeleteLoadBalancer(&deleteElbOpts); err != nil { - return fmt.Errorf("Error deleting ELB: %s", err) - } - - return nil -} - -func resourceAwsElbListenerHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%d-", m["instance_port"].(int))) - buf.WriteString(fmt.Sprintf("%s-", - strings.ToLower(m["instance_protocol"].(string)))) - buf.WriteString(fmt.Sprintf("%d-", m["lb_port"].(int))) - buf.WriteString(fmt.Sprintf("%s-", - strings.ToLower(m["lb_protocol"].(string)))) - - if v, ok := m["ssl_certificate_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - return hashcode.String(buf.String()) -} - -func isLoadBalancerNotFound(err error) bool { - elberr, ok := err.(awserr.Error) - return ok && elberr.Code() == "LoadBalancerNotFound" -} - -func sourceSGIdByName(meta interface{}, sg, vpcId string) (string, error) { - conn := meta.(*AWSClient).ec2conn - var filters []*ec2.Filter - var sgFilterName, sgFilterVPCID *ec2.Filter - sgFilterName = &ec2.Filter{ - Name: aws.String("group-name"), - Values: []*string{aws.String(sg)}, - } - - if vpcId != "" { - sgFilterVPCID = &ec2.Filter{ - Name: aws.String("vpc-id"), - Values: []*string{aws.String(vpcId)}, - } - } - - filters = append(filters, sgFilterName) - - if sgFilterVPCID != nil { - filters = append(filters, sgFilterVPCID) - } - - req := &ec2.DescribeSecurityGroupsInput{ - Filters: filters, - } - resp, err := conn.DescribeSecurityGroups(req) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "InvalidSecurityGroupID.NotFound" || - ec2err.Code() == "InvalidGroup.NotFound" { - resp = nil - err = nil - } - } - - if err != nil { - log.Printf("Error on ELB SG look up: %s", err) - return "", err - } - } - - if resp == nil || len(resp.SecurityGroups) == 0 { - return "", fmt.Errorf("No security groups found for name %s and vpc id %s", sg, vpcId) - } - - group := resp.SecurityGroups[0] - return *group.GroupId, nil -} - -func validateAccessLogsInterval(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - - // Check if the value is either 5 or 60 (minutes). - if value != 5 && value != 60 { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Access Logs interval \"%d\". "+ - "Valid intervals are either 5 or 60 (minutes).", - k, value)) - } - return -} - -func validateHeathCheckTarget(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - // Parse the Health Check target value. - matches := regexp.MustCompile(`\A(\w+):(\d+)(.+)?\z`).FindStringSubmatch(value) - - // Check if the value contains a valid target. - if matches == nil || len(matches) < 1 { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Health Check: %s", - k, value)) - - // Invalid target? Return immediately, - // there is no need to collect other - // errors. - return - } - - // Check if the value contains a valid protocol. - if !isValidProtocol(matches[1]) { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Health Check protocol %q. "+ - "Valid protocols are either %q, %q, %q, or %q.", - k, matches[1], "TCP", "SSL", "HTTP", "HTTPS")) - } - - // Check if the value contains a valid port range. - port, _ := strconv.Atoi(matches[2]) - if port < 1 || port > 65535 { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Health Check target port \"%d\". "+ - "Valid port is in the range from 1 to 65535 inclusive.", - k, port)) - } - - switch strings.ToLower(matches[1]) { - case "tcp", "ssl": - // Check if value is in the form : for TCP and/or SSL. - if matches[3] != "" { - errors = append(errors, fmt.Errorf( - "%q cannot contain a path in the Health Check target: %s", - k, value)) - } - break - case "http", "https": - // Check if value is in the form :/ for HTTP and/or HTTPS. - if matches[3] == "" { - errors = append(errors, fmt.Errorf( - "%q must contain a path in the Health Check target: %s", - k, value)) - } - - // Cannot be longer than 1024 multibyte characters. - if len([]rune(matches[3])) > 1024 { - errors = append(errors, fmt.Errorf("%q cannot contain a path longer "+ - "than 1024 characters in the Health Check target: %s", - k, value)) - } - break - } - - return -} - -func validateListenerProtocol(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if !isValidProtocol(value) { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Listener protocol %q. "+ - "Valid protocols are either %q, %q, %q, or %q.", - k, value, "TCP", "SSL", "HTTP", "HTTPS")) - } - return -} - -func isValidProtocol(s string) bool { - if s == "" { - return false - } - s = strings.ToLower(s) - - validProtocols := map[string]bool{ - "http": true, - "https": true, - "ssl": true, - "tcp": true, - } - - if _, ok := validProtocols[s]; !ok { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elb_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elb_attachment.go deleted file mode 100644 index 401544a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elb_attachment.go +++ /dev/null @@ -1,121 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsElbAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsElbAttachmentCreate, - Read: resourceAwsElbAttachmentRead, - Delete: resourceAwsElbAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "elb": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - - "instance": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - }, - } -} - -func resourceAwsElbAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - elbName := d.Get("elb").(string) - - instance := d.Get("instance").(string) - - registerInstancesOpts := elb.RegisterInstancesWithLoadBalancerInput{ - LoadBalancerName: aws.String(elbName), - Instances: []*elb.Instance{{InstanceId: aws.String(instance)}}, - } - - log.Printf("[INFO] registering instance %s with ELB %s", instance, elbName) - - _, err := elbconn.RegisterInstancesWithLoadBalancer(®isterInstancesOpts) - if err != nil { - return fmt.Errorf("Failure registering instances with ELB: %s", err) - } - - d.SetId(resource.PrefixedUniqueId(fmt.Sprintf("%s-", elbName))) - - return nil -} - -func resourceAwsElbAttachmentRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - elbName := d.Get("elb").(string) - - // only add the instance that was previously defined for this resource - expected := d.Get("instance").(string) - - // Retrieve the ELB properties to get a list of attachments - describeElbOpts := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{aws.String(elbName)}, - } - - resp, err := elbconn.DescribeLoadBalancers(describeElbOpts) - if err != nil { - if isLoadBalancerNotFound(err) { - log.Printf("[ERROR] ELB %s not found", elbName) - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving ELB: %s", err) - } - if len(resp.LoadBalancerDescriptions) != 1 { - log.Printf("[ERROR] Unable to find ELB: %s", resp.LoadBalancerDescriptions) - d.SetId("") - return nil - } - - // only set the instance Id that this resource manages - found := false - for _, i := range resp.LoadBalancerDescriptions[0].Instances { - if expected == *i.InstanceId { - d.Set("instance", expected) - found = true - } - } - - if !found { - log.Printf("[WARN] instance %s not found in elb attachments", expected) - d.SetId("") - } - - return nil -} - -func resourceAwsElbAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - elbName := d.Get("elb").(string) - - instance := d.Get("instance").(string) - - log.Printf("[INFO] Deleting Attachment %s from: %s", instance, elbName) - - deRegisterInstancesOpts := elb.DeregisterInstancesFromLoadBalancerInput{ - LoadBalancerName: aws.String(elbName), - Instances: []*elb.Instance{{InstanceId: aws.String(instance)}}, - } - - _, err := elbconn.DeregisterInstancesFromLoadBalancer(&deRegisterInstancesOpts) - if err != nil { - return fmt.Errorf("Failure deregistering instances from ELB: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_emr_cluster.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_emr_cluster.go deleted file mode 100644 index 3017e10..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_emr_cluster.go +++ /dev/null @@ -1,791 +0,0 @@ -package aws - -import ( - "log" - - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/emr" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsEMRCluster() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEMRClusterCreate, - Read: resourceAwsEMRClusterRead, - Update: resourceAwsEMRClusterUpdate, - Delete: resourceAwsEMRClusterDelete, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "release_label": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "master_instance_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "core_instance_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - "core_instance_count": { - Type: schema.TypeInt, - Optional: true, - Default: 1, - }, - "cluster_state": { - Type: schema.TypeString, - Computed: true, - }, - "log_uri": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - "master_public_dns": { - Type: schema.TypeString, - Computed: true, - }, - "applications": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "termination_protection": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "keep_job_flow_alive_when_no_steps": { - Type: schema.TypeBool, - ForceNew: true, - Optional: true, - Computed: true, - }, - "ec2_attributes": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key_name": { - Type: schema.TypeString, - Optional: true, - }, - "subnet_id": { - Type: schema.TypeString, - Optional: true, - }, - "additional_master_security_groups": { - Type: schema.TypeString, - Optional: true, - }, - "additional_slave_security_groups": { - Type: schema.TypeString, - Optional: true, - }, - "emr_managed_master_security_group": { - Type: schema.TypeString, - Optional: true, - }, - "emr_managed_slave_security_group": { - Type: schema.TypeString, - Optional: true, - }, - "instance_profile": { - Type: schema.TypeString, - Required: true, - }, - "service_access_security_group": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - "bootstrap_action": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "path": { - Type: schema.TypeString, - Required: true, - }, - "args": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - }, - }, - "tags": tagsSchema(), - "configurations": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - "service_role": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "visible_to_all_users": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - }, - } -} - -func resourceAwsEMRClusterCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).emrconn - - log.Printf("[DEBUG] Creating EMR cluster") - masterInstanceType := d.Get("master_instance_type").(string) - coreInstanceType := masterInstanceType - if v, ok := d.GetOk("core_instance_type"); ok { - coreInstanceType = v.(string) - } - coreInstanceCount := d.Get("core_instance_count").(int) - - applications := d.Get("applications").(*schema.Set).List() - - keepJobFlowAliveWhenNoSteps := true - if v, ok := d.GetOk("keep_job_flow_alive_when_no_steps"); ok { - keepJobFlowAliveWhenNoSteps = v.(bool) - } - - terminationProtection := false - if v, ok := d.GetOk("termination_protection"); ok { - terminationProtection = v.(bool) - } - instanceConfig := &emr.JobFlowInstancesConfig{ - MasterInstanceType: aws.String(masterInstanceType), - SlaveInstanceType: aws.String(coreInstanceType), - InstanceCount: aws.Int64(int64(coreInstanceCount)), - - KeepJobFlowAliveWhenNoSteps: aws.Bool(keepJobFlowAliveWhenNoSteps), - TerminationProtected: aws.Bool(terminationProtection), - } - - var instanceProfile string - if a, ok := d.GetOk("ec2_attributes"); ok { - ec2Attributes := a.([]interface{}) - attributes := ec2Attributes[0].(map[string]interface{}) - - if v, ok := attributes["key_name"]; ok { - instanceConfig.Ec2KeyName = aws.String(v.(string)) - } - if v, ok := attributes["subnet_id"]; ok { - instanceConfig.Ec2SubnetId = aws.String(v.(string)) - } - if v, ok := attributes["subnet_id"]; ok { - instanceConfig.Ec2SubnetId = aws.String(v.(string)) - } - - if v, ok := attributes["additional_master_security_groups"]; ok { - strSlice := strings.Split(v.(string), ",") - for i, s := range strSlice { - strSlice[i] = strings.TrimSpace(s) - } - instanceConfig.AdditionalMasterSecurityGroups = aws.StringSlice(strSlice) - } - - if v, ok := attributes["additional_slave_security_groups"]; ok { - strSlice := strings.Split(v.(string), ",") - for i, s := range strSlice { - strSlice[i] = strings.TrimSpace(s) - } - instanceConfig.AdditionalSlaveSecurityGroups = aws.StringSlice(strSlice) - } - - if v, ok := attributes["emr_managed_master_security_group"]; ok { - instanceConfig.EmrManagedMasterSecurityGroup = aws.String(v.(string)) - } - if v, ok := attributes["emr_managed_slave_security_group"]; ok { - instanceConfig.EmrManagedSlaveSecurityGroup = aws.String(v.(string)) - } - - if len(strings.TrimSpace(attributes["instance_profile"].(string))) != 0 { - instanceProfile = strings.TrimSpace(attributes["instance_profile"].(string)) - } - - if v, ok := attributes["service_access_security_group"]; ok { - instanceConfig.ServiceAccessSecurityGroup = aws.String(v.(string)) - } - } - - emrApps := expandApplications(applications) - - params := &emr.RunJobFlowInput{ - Instances: instanceConfig, - Name: aws.String(d.Get("name").(string)), - Applications: emrApps, - - ReleaseLabel: aws.String(d.Get("release_label").(string)), - ServiceRole: aws.String(d.Get("service_role").(string)), - VisibleToAllUsers: aws.Bool(d.Get("visible_to_all_users").(bool)), - } - - if v, ok := d.GetOk("log_uri"); ok { - params.LogUri = aws.String(v.(string)) - } - - if instanceProfile != "" { - params.JobFlowRole = aws.String(instanceProfile) - } - - if v, ok := d.GetOk("bootstrap_action"); ok { - bootstrapActions := v.(*schema.Set).List() - params.BootstrapActions = expandBootstrapActions(bootstrapActions) - } - if v, ok := d.GetOk("tags"); ok { - tagsIn := v.(map[string]interface{}) - params.Tags = expandTags(tagsIn) - } - if v, ok := d.GetOk("configurations"); ok { - confUrl := v.(string) - params.Configurations = expandConfigures(confUrl) - } - - log.Printf("[DEBUG] EMR Cluster create options: %s", params) - resp, err := conn.RunJobFlow(params) - - if err != nil { - log.Printf("[ERROR] %s", err) - return err - } - - d.SetId(*resp.JobFlowId) - - log.Println( - "[INFO] Waiting for EMR Cluster to be available") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"STARTING", "BOOTSTRAPPING"}, - Target: []string{"WAITING", "RUNNING"}, - Refresh: resourceAwsEMRClusterStateRefreshFunc(d, meta), - Timeout: 75 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("[WARN] Error waiting for EMR Cluster state to be \"WAITING\" or \"RUNNING\": %s", err) - } - - return resourceAwsEMRClusterRead(d, meta) -} - -func resourceAwsEMRClusterRead(d *schema.ResourceData, meta interface{}) error { - emrconn := meta.(*AWSClient).emrconn - - req := &emr.DescribeClusterInput{ - ClusterId: aws.String(d.Id()), - } - - resp, err := emrconn.DescribeCluster(req) - if err != nil { - return fmt.Errorf("Error reading EMR cluster: %s", err) - } - - if resp.Cluster == nil { - log.Printf("[DEBUG] EMR Cluster (%s) not found", d.Id()) - d.SetId("") - return nil - } - - cluster := resp.Cluster - - if cluster.Status != nil { - if *cluster.Status.State == "TERMINATED" { - log.Printf("[DEBUG] EMR Cluster (%s) was TERMINATED already", d.Id()) - d.SetId("") - return nil - } - - if *cluster.Status.State == "TERMINATED_WITH_ERRORS" { - log.Printf("[DEBUG] EMR Cluster (%s) was TERMINATED_WITH_ERRORS already", d.Id()) - d.SetId("") - return nil - } - - d.Set("cluster_state", cluster.Status.State) - } - - instanceGroups, err := fetchAllEMRInstanceGroups(meta, d.Id()) - if err == nil { - coreGroup := findGroup(instanceGroups, "CORE") - if coreGroup != nil { - d.Set("core_instance_type", coreGroup.InstanceType) - } - } - - d.Set("name", cluster.Name) - d.Set("service_role", cluster.ServiceRole) - d.Set("release_label", cluster.ReleaseLabel) - d.Set("log_uri", cluster.LogUri) - d.Set("master_public_dns", cluster.MasterPublicDnsName) - d.Set("visible_to_all_users", cluster.VisibleToAllUsers) - d.Set("tags", tagsToMapEMR(cluster.Tags)) - - if err := d.Set("applications", flattenApplications(cluster.Applications)); err != nil { - log.Printf("[ERR] Error setting EMR Applications for cluster (%s): %s", d.Id(), err) - } - - // Configurations is a JSON document. It's built with an expand method but a - // simple string should be returned as JSON - if err := d.Set("configurations", cluster.Configurations); err != nil { - log.Printf("[ERR] Error setting EMR configurations for cluster (%s): %s", d.Id(), err) - } - - if err := d.Set("ec2_attributes", flattenEc2Attributes(cluster.Ec2InstanceAttributes)); err != nil { - log.Printf("[ERR] Error setting EMR Ec2 Attributes: %s", err) - } - return nil -} - -func resourceAwsEMRClusterUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).emrconn - - d.Partial(true) - - if d.HasChange("core_instance_count") { - d.SetPartial("core_instance_count") - log.Printf("[DEBUG] Modify EMR cluster") - groups, err := fetchAllEMRInstanceGroups(meta, d.Id()) - if err != nil { - log.Printf("[DEBUG] Error finding all instance groups: %s", err) - return err - } - - coreInstanceCount := d.Get("core_instance_count").(int) - coreGroup := findGroup(groups, "CORE") - if coreGroup == nil { - return fmt.Errorf("[ERR] Error finding core group") - } - - params := &emr.ModifyInstanceGroupsInput{ - InstanceGroups: []*emr.InstanceGroupModifyConfig{ - { - InstanceGroupId: coreGroup.Id, - InstanceCount: aws.Int64(int64(coreInstanceCount) - 1), - }, - }, - } - _, errModify := conn.ModifyInstanceGroups(params) - if errModify != nil { - log.Printf("[ERROR] %s", errModify) - return errModify - } - - log.Printf("[DEBUG] Modify EMR Cluster done...") - - log.Println("[INFO] Waiting for EMR Cluster to be available") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"STARTING", "BOOTSTRAPPING"}, - Target: []string{"WAITING", "RUNNING"}, - Refresh: resourceAwsEMRClusterStateRefreshFunc(d, meta), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 5 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("[WARN] Error waiting for EMR Cluster state to be \"WAITING\" or \"RUNNING\" after modification: %s", err) - } - } - - if d.HasChange("visible_to_all_users") { - d.SetPartial("visible_to_all_users") - _, errModify := conn.SetVisibleToAllUsers(&emr.SetVisibleToAllUsersInput{ - JobFlowIds: []*string{aws.String(d.Id())}, - VisibleToAllUsers: aws.Bool(d.Get("visible_to_all_users").(bool)), - }) - if errModify != nil { - log.Printf("[ERROR] %s", errModify) - return errModify - } - } - - if d.HasChange("termination_protection") { - d.SetPartial("termination_protection") - _, errModify := conn.SetTerminationProtection(&emr.SetTerminationProtectionInput{ - JobFlowIds: []*string{aws.String(d.Id())}, - TerminationProtected: aws.Bool(d.Get("termination_protection").(bool)), - }) - if errModify != nil { - log.Printf("[ERROR] %s", errModify) - return errModify - } - } - - if err := setTagsEMR(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - d.Partial(false) - - return resourceAwsEMRClusterRead(d, meta) -} - -func resourceAwsEMRClusterDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).emrconn - - req := &emr.TerminateJobFlowsInput{ - JobFlowIds: []*string{ - aws.String(d.Id()), - }, - } - - _, err := conn.TerminateJobFlows(req) - if err != nil { - log.Printf("[ERROR], %s", err) - return err - } - - err = resource.Retry(10*time.Minute, func() *resource.RetryError { - resp, err := conn.ListInstances(&emr.ListInstancesInput{ - ClusterId: aws.String(d.Id()), - }) - - if err != nil { - return resource.NonRetryableError(err) - } - - instanceCount := len(resp.Instances) - - if resp == nil || instanceCount == 0 { - log.Printf("[DEBUG] No instances found for EMR Cluster (%s)", d.Id()) - return nil - } - - // Collect instance status states, wait for all instances to be terminated - // before moving on - var terminated []string - for j, i := range resp.Instances { - if i.Status != nil { - if *i.Status.State == "TERMINATED" { - terminated = append(terminated, *i.Ec2InstanceId) - } - } else { - log.Printf("[DEBUG] Cluster instance (%d : %s) has no status", j, *i.Ec2InstanceId) - } - } - if len(terminated) == instanceCount { - log.Printf("[DEBUG] All (%d) EMR Cluster (%s) Instances terminated", instanceCount, d.Id()) - return nil - } - return resource.RetryableError(fmt.Errorf("[DEBUG] EMR Cluster (%s) has (%d) Instances remaining, retrying", d.Id(), len(resp.Instances))) - }) - - if err != nil { - log.Printf("[ERR] Error waiting for EMR Cluster (%s) Instances to drain", d.Id()) - } - - d.SetId("") - return nil -} - -func expandApplications(apps []interface{}) []*emr.Application { - appOut := make([]*emr.Application, 0, len(apps)) - - for _, appName := range expandStringList(apps) { - app := &emr.Application{ - Name: appName, - } - appOut = append(appOut, app) - } - return appOut -} - -func flattenApplications(apps []*emr.Application) []interface{} { - appOut := make([]interface{}, 0, len(apps)) - - for _, app := range apps { - appOut = append(appOut, *app.Name) - } - return appOut -} - -func flattenEc2Attributes(ia *emr.Ec2InstanceAttributes) []map[string]interface{} { - attrs := map[string]interface{}{} - result := make([]map[string]interface{}, 0) - - if ia.Ec2KeyName != nil { - attrs["key_name"] = *ia.Ec2KeyName - } - if ia.Ec2SubnetId != nil { - attrs["subnet_id"] = *ia.Ec2SubnetId - } - if ia.IamInstanceProfile != nil { - attrs["instance_profile"] = *ia.IamInstanceProfile - } - if ia.EmrManagedMasterSecurityGroup != nil { - attrs["emr_managed_master_security_group"] = *ia.EmrManagedMasterSecurityGroup - } - if ia.EmrManagedSlaveSecurityGroup != nil { - attrs["emr_managed_slave_security_group"] = *ia.EmrManagedSlaveSecurityGroup - } - - if len(ia.AdditionalMasterSecurityGroups) > 0 { - strs := aws.StringValueSlice(ia.AdditionalMasterSecurityGroups) - attrs["additional_master_security_groups"] = strings.Join(strs, ",") - } - if len(ia.AdditionalSlaveSecurityGroups) > 0 { - strs := aws.StringValueSlice(ia.AdditionalSlaveSecurityGroups) - attrs["additional_slave_security_groups"] = strings.Join(strs, ",") - } - - if ia.ServiceAccessSecurityGroup != nil { - attrs["service_access_security_group"] = *ia.ServiceAccessSecurityGroup - } - - result = append(result, attrs) - - return result -} - -func loadGroups(d *schema.ResourceData, meta interface{}) ([]*emr.InstanceGroup, error) { - emrconn := meta.(*AWSClient).emrconn - reqGrps := &emr.ListInstanceGroupsInput{ - ClusterId: aws.String(d.Id()), - } - - respGrps, errGrps := emrconn.ListInstanceGroups(reqGrps) - if errGrps != nil { - return nil, fmt.Errorf("Error reading EMR cluster: %s", errGrps) - } - return respGrps.InstanceGroups, nil -} - -func findGroup(grps []*emr.InstanceGroup, typ string) *emr.InstanceGroup { - for _, grp := range grps { - if grp.InstanceGroupType != nil { - if *grp.InstanceGroupType == typ { - return grp - } - } - } - return nil -} - -func expandTags(m map[string]interface{}) []*emr.Tag { - var result []*emr.Tag - for k, v := range m { - result = append(result, &emr.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - - return result -} - -func tagsToMapEMR(ts []*emr.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - result[*t.Key] = *t.Value - } - - return result -} - -func diffTagsEMR(oldTags, newTags []*emr.Tag) ([]*emr.Tag, []*emr.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*emr.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return expandTags(create), remove -} - -func setTagsEMR(conn *emr.EMR, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsEMR(expandTags(o), expandTags(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - k := make([]*string, len(remove), len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.RemoveTags(&emr.RemoveTagsInput{ - ResourceId: aws.String(d.Id()), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %s", create) - _, err := conn.AddTags(&emr.AddTagsInput{ - ResourceId: aws.String(d.Id()), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -func expandBootstrapActions(bootstrapActions []interface{}) []*emr.BootstrapActionConfig { - actionsOut := []*emr.BootstrapActionConfig{} - - for _, raw := range bootstrapActions { - actionAttributes := raw.(map[string]interface{}) - actionName := actionAttributes["name"].(string) - actionPath := actionAttributes["path"].(string) - actionArgs := actionAttributes["args"].(*schema.Set).List() - - action := &emr.BootstrapActionConfig{ - Name: aws.String(actionName), - ScriptBootstrapAction: &emr.ScriptBootstrapActionConfig{ - Path: aws.String(actionPath), - Args: expandStringList(actionArgs), - }, - } - actionsOut = append(actionsOut, action) - } - - return actionsOut -} - -func expandConfigures(input string) []*emr.Configuration { - configsOut := []*emr.Configuration{} - if strings.HasPrefix(input, "http") { - if err := readHttpJson(input, &configsOut); err != nil { - log.Printf("[ERR] Error reading HTTP JSON: %s", err) - } - } else if strings.HasSuffix(input, ".json") { - if err := readLocalJson(input, &configsOut); err != nil { - log.Printf("[ERR] Error reading local JSON: %s", err) - } - } else { - if err := readBodyJson(input, &configsOut); err != nil { - log.Printf("[ERR] Error reading body JSON: %s", err) - } - } - log.Printf("[DEBUG] Expanded EMR Configurations %s", configsOut) - - return configsOut -} - -func readHttpJson(url string, target interface{}) error { - r, err := http.Get(url) - if err != nil { - return err - } - defer r.Body.Close() - - return json.NewDecoder(r.Body).Decode(target) -} - -func readLocalJson(localFile string, target interface{}) error { - file, e := ioutil.ReadFile(localFile) - if e != nil { - log.Printf("[ERROR] %s", e) - return e - } - - return json.Unmarshal(file, target) -} - -func readBodyJson(body string, target interface{}) error { - log.Printf("[DEBUG] Raw Body %s\n", body) - err := json.Unmarshal([]byte(body), target) - if err != nil { - log.Printf("[ERROR] parsing JSON %s", err) - return err - } - return nil -} - -func resourceAwsEMRClusterStateRefreshFunc(d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - conn := meta.(*AWSClient).emrconn - - log.Printf("[INFO] Reading EMR Cluster Information: %s", d.Id()) - params := &emr.DescribeClusterInput{ - ClusterId: aws.String(d.Id()), - } - - resp, err := conn.DescribeCluster(params) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if "ClusterNotFound" == awsErr.Code() { - return 42, "destroyed", nil - } - } - log.Printf("[WARN] Error on retrieving EMR Cluster (%s) when waiting: %s", d.Id(), err) - return nil, "", err - } - - emrc := resp.Cluster - - if emrc == nil { - return 42, "destroyed", nil - } - - if resp.Cluster.Status != nil { - log.Printf("[DEBUG] EMR Cluster status (%s): %s", d.Id(), *resp.Cluster.Status) - } - - return emrc, *emrc.Status.State, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_emr_instance_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_emr_instance_group.go deleted file mode 100644 index 66750b4..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_emr_instance_group.go +++ /dev/null @@ -1,316 +0,0 @@ -package aws - -import ( - "errors" - "log" - "time" - - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/emr" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -var emrInstanceGroupNotFound = errors.New("No matching EMR Instance Group") - -func resourceAwsEMRInstanceGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsEMRInstanceGroupCreate, - Read: resourceAwsEMRInstanceGroupRead, - Update: resourceAwsEMRInstanceGroupUpdate, - Delete: resourceAwsEMRInstanceGroupDelete, - Schema: map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "instance_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "instance_count": { - Type: schema.TypeInt, - Optional: true, - Default: 0, - }, - "running_instance_count": { - Type: schema.TypeInt, - Computed: true, - }, - "status": { - Type: schema.TypeString, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "ebs_optimized": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - }, - "ebs_config": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "iops": { - Type: schema.TypeInt, - Optional: true, - }, - "size": { - Type: schema.TypeInt, - Required: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsEmrEbsVolumeType, - }, - "volumes_per_instance": { - Type: schema.TypeInt, - Optional: true, - }, - }, - }, - }, - }, - } -} - -// Populates an emr.EbsConfiguration struct -func readEmrEBSConfig(d *schema.ResourceData) *emr.EbsConfiguration { - result := &emr.EbsConfiguration{} - if v, ok := d.GetOk("ebs_optimized"); ok { - result.EbsOptimized = aws.Bool(v.(bool)) - } - - ebsConfigs := make([]*emr.EbsBlockDeviceConfig, 0) - if rawConfig, ok := d.GetOk("ebs_config"); ok { - configList := rawConfig.(*schema.Set).List() - for _, config := range configList { - conf := config.(map[string]interface{}) - ebs := &emr.EbsBlockDeviceConfig{} - volumeSpec := &emr.VolumeSpecification{ - SizeInGB: aws.Int64(int64(conf["size"].(int))), - VolumeType: aws.String(conf["type"].(string)), - } - if v, ok := conf["iops"].(int); ok && v != 0 { - volumeSpec.Iops = aws.Int64(int64(v)) - } - if v, ok := conf["volumes_per_instance"].(int); ok && v != 0 { - ebs.VolumesPerInstance = aws.Int64(int64(v)) - } - ebs.VolumeSpecification = volumeSpec - ebsConfigs = append(ebsConfigs, ebs) - } - } - result.EbsBlockDeviceConfigs = ebsConfigs - return result -} - -func resourceAwsEMRInstanceGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).emrconn - - clusterId := d.Get("cluster_id").(string) - instanceType := d.Get("instance_type").(string) - instanceCount := d.Get("instance_count").(int) - groupName := d.Get("name").(string) - - ebsConfig := readEmrEBSConfig(d) - - params := &emr.AddInstanceGroupsInput{ - InstanceGroups: []*emr.InstanceGroupConfig{ - { - InstanceRole: aws.String("TASK"), - InstanceCount: aws.Int64(int64(instanceCount)), - InstanceType: aws.String(instanceType), - Name: aws.String(groupName), - EbsConfiguration: ebsConfig, - }, - }, - JobFlowId: aws.String(clusterId), - } - - log.Printf("[DEBUG] Creating EMR task group params: %s", params) - resp, err := conn.AddInstanceGroups(params) - if err != nil { - return err - } - - log.Printf("[DEBUG] Created EMR task group finished: %#v", resp) - if resp == nil || len(resp.InstanceGroupIds) == 0 { - return fmt.Errorf("Error creating instance groups: no instance group returned") - } - d.SetId(*resp.InstanceGroupIds[0]) - - return nil -} - -func resourceAwsEMRInstanceGroupRead(d *schema.ResourceData, meta interface{}) error { - group, err := fetchEMRInstanceGroup(meta, d.Get("cluster_id").(string), d.Id()) - if err != nil { - switch err { - case emrInstanceGroupNotFound: - log.Printf("[DEBUG] EMR Instance Group (%s) not found, removing", d.Id()) - d.SetId("") - return nil - default: - return err - } - } - - // Guard against the chance of fetchEMRInstanceGroup returning nil group but - // not a emrInstanceGroupNotFound error - if group == nil { - log.Printf("[DEBUG] EMR Instance Group (%s) not found, removing", d.Id()) - d.SetId("") - return nil - } - - d.Set("name", group.Name) - d.Set("instance_count", group.RequestedInstanceCount) - d.Set("running_instance_count", group.RunningInstanceCount) - d.Set("instance_type", group.InstanceType) - if group.Status != nil && group.Status.State != nil { - d.Set("status", group.Status.State) - } - - return nil -} - -func fetchAllEMRInstanceGroups(meta interface{}, clusterId string) ([]*emr.InstanceGroup, error) { - conn := meta.(*AWSClient).emrconn - req := &emr.ListInstanceGroupsInput{ - ClusterId: aws.String(clusterId), - } - - var groups []*emr.InstanceGroup - marker := aws.String("intitial") - for marker != nil { - log.Printf("[DEBUG] EMR Cluster Instance Marker: %s", *marker) - respGrps, errGrps := conn.ListInstanceGroups(req) - if errGrps != nil { - return nil, fmt.Errorf("[ERR] Error reading EMR cluster (%s): %s", clusterId, errGrps) - } - if respGrps == nil { - return nil, fmt.Errorf("[ERR] Error reading EMR Instance Group for cluster (%s)", clusterId) - } - - if respGrps.InstanceGroups != nil { - for _, g := range respGrps.InstanceGroups { - groups = append(groups, g) - } - } else { - log.Printf("[DEBUG] EMR Instance Group list was empty") - } - marker = respGrps.Marker - } - - if len(groups) == 0 { - return nil, fmt.Errorf("[WARN] No instance groups found for EMR Cluster (%s)", clusterId) - } - - return groups, nil -} - -func fetchEMRInstanceGroup(meta interface{}, clusterId, groupId string) (*emr.InstanceGroup, error) { - groups, err := fetchAllEMRInstanceGroups(meta, clusterId) - if err != nil { - return nil, err - } - - var group *emr.InstanceGroup - for _, ig := range groups { - if groupId == *ig.Id { - group = ig - break - } - } - - if group != nil { - return group, nil - } - - return nil, emrInstanceGroupNotFound -} - -func resourceAwsEMRInstanceGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).emrconn - - log.Printf("[DEBUG] Modify EMR task group") - instanceCount := d.Get("instance_count").(int) - - params := &emr.ModifyInstanceGroupsInput{ - InstanceGroups: []*emr.InstanceGroupModifyConfig{ - { - InstanceGroupId: aws.String(d.Id()), - InstanceCount: aws.Int64(int64(instanceCount)), - }, - }, - } - - _, err := conn.ModifyInstanceGroups(params) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"PROVISIONING", "BOOTSTRAPPING", "RESIZING"}, - Target: []string{"RUNNING"}, - Refresh: instanceGroupStateRefresh(conn, d.Get("cluster_id").(string), d.Id()), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for instance (%s) to terminate: %s", d.Id(), err) - } - - return resourceAwsEMRInstanceGroupRead(d, meta) -} - -func instanceGroupStateRefresh(meta interface{}, clusterID, igID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - group, err := fetchEMRInstanceGroup(meta, clusterID, igID) - if err != nil { - return nil, "Not Found", err - } - - if group.Status == nil || group.Status.State == nil { - log.Printf("[WARN] ERM Instance Group found, but without state") - return nil, "Undefined", fmt.Errorf("Undefined EMR Cluster Instance Group state") - } - - return group, *group.Status.State, nil - } -} - -func resourceAwsEMRInstanceGroupDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[WARN] AWS EMR Instance Group does not support DELETE; resizing cluster to zero before removing from state") - conn := meta.(*AWSClient).emrconn - params := &emr.ModifyInstanceGroupsInput{ - InstanceGroups: []*emr.InstanceGroupModifyConfig{ - { - InstanceGroupId: aws.String(d.Id()), - InstanceCount: aws.Int64(0), - }, - }, - } - - _, err := conn.ModifyInstanceGroups(params) - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_flow_log.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_flow_log.go deleted file mode 100644 index a95a016..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_flow_log.go +++ /dev/null @@ -1,169 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsFlowLog() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLogFlowCreate, - Read: resourceAwsLogFlowRead, - Delete: resourceAwsLogFlowDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "iam_role_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "log_group_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"subnet_id", "eni_id"}, - }, - - "subnet_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"eni_id", "vpc_id"}, - }, - - "eni_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"subnet_id", "vpc_id"}, - }, - - "traffic_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsLogFlowCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - types := []struct { - ID string - Type string - }{ - {ID: d.Get("vpc_id").(string), Type: "VPC"}, - {ID: d.Get("subnet_id").(string), Type: "Subnet"}, - {ID: d.Get("eni_id").(string), Type: "NetworkInterface"}, - } - - var resourceId string - var resourceType string - for _, t := range types { - if t.ID != "" { - resourceId = t.ID - resourceType = t.Type - break - } - } - - if resourceId == "" || resourceType == "" { - return fmt.Errorf("Error: Flow Logs require either a VPC, Subnet, or ENI ID") - } - - opts := &ec2.CreateFlowLogsInput{ - DeliverLogsPermissionArn: aws.String(d.Get("iam_role_arn").(string)), - LogGroupName: aws.String(d.Get("log_group_name").(string)), - ResourceIds: []*string{aws.String(resourceId)}, - ResourceType: aws.String(resourceType), - TrafficType: aws.String(d.Get("traffic_type").(string)), - } - - log.Printf( - "[DEBUG] Flow Log Create configuration: %s", opts) - resp, err := conn.CreateFlowLogs(opts) - if err != nil { - return fmt.Errorf("Error creating Flow Log for (%s), error: %s", resourceId, err) - } - - if len(resp.FlowLogIds) > 1 { - return fmt.Errorf("Error: multiple Flow Logs created for (%s)", resourceId) - } - - d.SetId(*resp.FlowLogIds[0]) - - return resourceAwsLogFlowRead(d, meta) -} - -func resourceAwsLogFlowRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - opts := &ec2.DescribeFlowLogsInput{ - FlowLogIds: []*string{aws.String(d.Id())}, - } - - resp, err := conn.DescribeFlowLogs(opts) - if err != nil { - log.Printf("[WARN] Error describing Flow Logs for id (%s)", d.Id()) - d.SetId("") - return nil - } - - if len(resp.FlowLogs) == 0 { - log.Printf("[WARN] No Flow Logs found for id (%s)", d.Id()) - d.SetId("") - return nil - } - - fl := resp.FlowLogs[0] - d.Set("traffic_type", fl.TrafficType) - d.Set("log_group_name", fl.LogGroupName) - d.Set("iam_role_arn", fl.DeliverLogsPermissionArn) - - var resourceKey string - if strings.HasPrefix(*fl.ResourceId, "vpc-") { - resourceKey = "vpc_id" - } else if strings.HasPrefix(*fl.ResourceId, "subnet-") { - resourceKey = "subnet_id" - } else if strings.HasPrefix(*fl.ResourceId, "eni-") { - resourceKey = "eni_id" - } - if resourceKey != "" { - d.Set(resourceKey, fl.ResourceId) - } - - return nil -} - -func resourceAwsLogFlowDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf( - "[DEBUG] Flow Log Destroy: %s", d.Id()) - _, err := conn.DeleteFlowLogs(&ec2.DeleteFlowLogsInput{ - FlowLogIds: []*string{aws.String(d.Id())}, - }) - - if err != nil { - return fmt.Errorf("[WARN] Error deleting Flow Log with ID (%s), error: %s", d.Id(), err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_glacier_vault.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_glacier_vault.go deleted file mode 100644 index 64ac267..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_glacier_vault.go +++ /dev/null @@ -1,416 +0,0 @@ -package aws - -import ( - "errors" - "fmt" - "log" - "regexp" - - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/glacier" -) - -func resourceAwsGlacierVault() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsGlacierVaultCreate, - Read: resourceAwsGlacierVaultRead, - Update: resourceAwsGlacierVaultUpdate, - Delete: resourceAwsGlacierVaultDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[.0-9A-Za-z-_]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters, hyphens, underscores, and periods are allowed in %q", k)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters", k)) - } - return - }, - }, - - "location": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "access_policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateJsonString, - StateFunc: func(v interface{}) string { - json, _ := normalizeJsonString(v) - return json - }, - }, - - "notification": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "events": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "sns_topic": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsGlacierVaultCreate(d *schema.ResourceData, meta interface{}) error { - glacierconn := meta.(*AWSClient).glacierconn - - input := &glacier.CreateVaultInput{ - VaultName: aws.String(d.Get("name").(string)), - } - - out, err := glacierconn.CreateVault(input) - if err != nil { - return fmt.Errorf("Error creating Glacier Vault: %s", err) - } - - d.SetId(d.Get("name").(string)) - d.Set("location", *out.Location) - - return resourceAwsGlacierVaultUpdate(d, meta) -} - -func resourceAwsGlacierVaultUpdate(d *schema.ResourceData, meta interface{}) error { - glacierconn := meta.(*AWSClient).glacierconn - - if err := setGlacierVaultTags(glacierconn, d); err != nil { - return err - } - - if d.HasChange("access_policy") { - if err := resourceAwsGlacierVaultPolicyUpdate(glacierconn, d); err != nil { - return err - } - } - - if d.HasChange("notification") { - if err := resourceAwsGlacierVaultNotificationUpdate(glacierconn, d); err != nil { - return err - } - } - - return resourceAwsGlacierVaultRead(d, meta) -} - -func resourceAwsGlacierVaultRead(d *schema.ResourceData, meta interface{}) error { - glacierconn := meta.(*AWSClient).glacierconn - - input := &glacier.DescribeVaultInput{ - VaultName: aws.String(d.Id()), - } - - out, err := glacierconn.DescribeVault(input) - if err != nil { - return fmt.Errorf("Error reading Glacier Vault: %s", err.Error()) - } - - awsClient := meta.(*AWSClient) - d.Set("name", out.VaultName) - d.Set("arn", out.VaultARN) - - location, err := buildGlacierVaultLocation(awsClient.accountid, d.Id()) - if err != nil { - return err - } - d.Set("location", location) - - tags, err := getGlacierVaultTags(glacierconn, d.Id()) - if err != nil { - return err - } - d.Set("tags", tags) - - log.Printf("[DEBUG] Getting the access_policy for Vault %s", d.Id()) - pol, err := glacierconn.GetVaultAccessPolicy(&glacier.GetVaultAccessPolicyInput{ - VaultName: aws.String(d.Id()), - }) - - if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "ResourceNotFoundException" { - d.Set("access_policy", "") - } else if pol != nil { - policy, err := normalizeJsonString(*pol.Policy.Policy) - if err != nil { - return errwrap.Wrapf("access policy contains an invalid JSON: {{err}}", err) - } - d.Set("access_policy", policy) - } else { - return err - } - - notifications, err := getGlacierVaultNotification(glacierconn, d.Id()) - if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "ResourceNotFoundException" { - d.Set("notification", "") - } else if pol != nil { - d.Set("notification", notifications) - } else { - return err - } - - return nil -} - -func resourceAwsGlacierVaultDelete(d *schema.ResourceData, meta interface{}) error { - glacierconn := meta.(*AWSClient).glacierconn - - log.Printf("[DEBUG] Glacier Delete Vault: %s", d.Id()) - _, err := glacierconn.DeleteVault(&glacier.DeleteVaultInput{ - VaultName: aws.String(d.Id()), - }) - if err != nil { - return fmt.Errorf("Error deleting Glacier Vault: %s", err.Error()) - } - return nil -} - -func resourceAwsGlacierVaultNotificationUpdate(glacierconn *glacier.Glacier, d *schema.ResourceData) error { - - if v, ok := d.GetOk("notification"); ok { - settings := v.([]interface{}) - - if len(settings) > 1 { - return fmt.Errorf("Only a single Notification Block is allowed for Glacier Vault") - } else if len(settings) == 1 { - s := settings[0].(map[string]interface{}) - var events []*string - for _, id := range s["events"].(*schema.Set).List() { - events = append(events, aws.String(id.(string))) - } - - _, err := glacierconn.SetVaultNotifications(&glacier.SetVaultNotificationsInput{ - VaultName: aws.String(d.Id()), - VaultNotificationConfig: &glacier.VaultNotificationConfig{ - SNSTopic: aws.String(s["sns_topic"].(string)), - Events: events, - }, - }) - - if err != nil { - return fmt.Errorf("Error Updating Glacier Vault Notifications: %s", err.Error()) - } - } - } else { - _, err := glacierconn.DeleteVaultNotifications(&glacier.DeleteVaultNotificationsInput{ - VaultName: aws.String(d.Id()), - }) - - if err != nil { - return fmt.Errorf("Error Removing Glacier Vault Notifications: %s", err.Error()) - } - - } - - return nil -} - -func resourceAwsGlacierVaultPolicyUpdate(glacierconn *glacier.Glacier, d *schema.ResourceData) error { - vaultName := d.Id() - policyContents := d.Get("access_policy").(string) - - policy := &glacier.VaultAccessPolicy{ - Policy: aws.String(policyContents), - } - - if policyContents != "" { - log.Printf("[DEBUG] Glacier Vault: %s, put policy", vaultName) - - _, err := glacierconn.SetVaultAccessPolicy(&glacier.SetVaultAccessPolicyInput{ - VaultName: aws.String(d.Id()), - Policy: policy, - }) - - if err != nil { - return fmt.Errorf("Error putting Glacier Vault policy: %s", err.Error()) - } - } else { - log.Printf("[DEBUG] Glacier Vault: %s, delete policy: %s", vaultName, policy) - _, err := glacierconn.DeleteVaultAccessPolicy(&glacier.DeleteVaultAccessPolicyInput{ - VaultName: aws.String(d.Id()), - }) - - if err != nil { - return fmt.Errorf("Error deleting Glacier Vault policy: %s", err.Error()) - } - } - - return nil -} - -func setGlacierVaultTags(conn *glacier.Glacier, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffGlacierVaultTags(mapGlacierVaultTags(o), mapGlacierVaultTags(n)) - - // Set tags - if len(remove) > 0 { - tagsToRemove := &glacier.RemoveTagsFromVaultInput{ - VaultName: aws.String(d.Id()), - TagKeys: glacierStringsToPointyString(remove), - } - - log.Printf("[DEBUG] Removing tags: from %s", d.Id()) - _, err := conn.RemoveTagsFromVault(tagsToRemove) - if err != nil { - return err - } - } - if len(create) > 0 { - tagsToAdd := &glacier.AddTagsToVaultInput{ - VaultName: aws.String(d.Id()), - Tags: glacierVaultTagsFromMap(create), - } - - log.Printf("[DEBUG] Creating tags: for %s", d.Id()) - _, err := conn.AddTagsToVault(tagsToAdd) - if err != nil { - return err - } - } - } - - return nil -} - -func mapGlacierVaultTags(m map[string]interface{}) map[string]string { - results := make(map[string]string) - for k, v := range m { - results[k] = v.(string) - } - - return results -} - -func diffGlacierVaultTags(oldTags, newTags map[string]string) (map[string]string, []string) { - - create := make(map[string]string) - for k, v := range newTags { - create[k] = v - } - - // Build the list of what to remove - var remove []string - for k, v := range oldTags { - old, ok := create[k] - if !ok || old != v { - // Delete it! - remove = append(remove, k) - } - } - - return create, remove -} - -func getGlacierVaultTags(glacierconn *glacier.Glacier, vaultName string) (map[string]string, error) { - request := &glacier.ListTagsForVaultInput{ - VaultName: aws.String(vaultName), - } - - log.Printf("[DEBUG] Getting the tags: for %s", vaultName) - response, err := glacierconn.ListTagsForVault(request) - if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "NoSuchTagSet" { - return map[string]string{}, nil - } else if err != nil { - return nil, err - } - - return glacierVaultTagsToMap(response.Tags), nil -} - -func glacierVaultTagsToMap(responseTags map[string]*string) map[string]string { - results := make(map[string]string, len(responseTags)) - for k, v := range responseTags { - results[k] = *v - } - - return results -} - -func glacierVaultTagsFromMap(responseTags map[string]string) map[string]*string { - results := make(map[string]*string, len(responseTags)) - for k, v := range responseTags { - results[k] = aws.String(v) - } - - return results -} - -func glacierStringsToPointyString(s []string) []*string { - results := make([]*string, len(s)) - for i, x := range s { - results[i] = aws.String(x) - } - - return results -} - -func glacierPointersToStringList(pointers []*string) []interface{} { - list := make([]interface{}, len(pointers)) - for i, v := range pointers { - list[i] = *v - } - return list -} - -func buildGlacierVaultLocation(accountId, vaultName string) (string, error) { - if accountId == "" { - return "", errors.New("AWS account ID unavailable - failed to construct Vault location") - } - return fmt.Sprintf("/" + accountId + "/vaults/" + vaultName), nil -} - -func getGlacierVaultNotification(glacierconn *glacier.Glacier, vaultName string) ([]map[string]interface{}, error) { - request := &glacier.GetVaultNotificationsInput{ - VaultName: aws.String(vaultName), - } - - response, err := glacierconn.GetVaultNotifications(request) - if err != nil { - return nil, fmt.Errorf("Error reading Glacier Vault Notifications: %s", err.Error()) - } - - notifications := make(map[string]interface{}, 0) - - log.Print("[DEBUG] Flattening Glacier Vault Notifications") - - notifications["events"] = schema.NewSet(schema.HashString, glacierPointersToStringList(response.VaultNotificationConfig.Events)) - notifications["sns_topic"] = *response.VaultNotificationConfig.SNSTopic - - return []map[string]interface{}{notifications}, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_access_key.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_access_key.go deleted file mode 100644 index 515069c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_access_key.go +++ /dev/null @@ -1,178 +0,0 @@ -package aws - -import ( - "crypto/hmac" - "crypto/sha256" - "encoding/base64" - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/encryption" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamAccessKey() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamAccessKeyCreate, - Read: resourceAwsIamAccessKeyRead, - Delete: resourceAwsIamAccessKeyDelete, - - Schema: map[string]*schema.Schema{ - "user": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "status": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "secret": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Deprecated: "Please use a PGP key to encrypt", - }, - "ses_smtp_password": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "pgp_key": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - "key_fingerprint": { - Type: schema.TypeString, - Computed: true, - }, - "encrypted_secret": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsIamAccessKeyCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.CreateAccessKeyInput{ - UserName: aws.String(d.Get("user").(string)), - } - - createResp, err := iamconn.CreateAccessKey(request) - if err != nil { - return fmt.Errorf( - "Error creating access key for user %s: %s", - *request.UserName, - err, - ) - } - - d.SetId(*createResp.AccessKey.AccessKeyId) - - if createResp.AccessKey == nil || createResp.AccessKey.SecretAccessKey == nil { - return fmt.Errorf("[ERR] CreateAccessKey response did not contain a Secret Access Key as expected") - } - - if v, ok := d.GetOk("pgp_key"); ok { - pgpKey := v.(string) - encryptionKey, err := encryption.RetrieveGPGKey(pgpKey) - if err != nil { - return err - } - fingerprint, encrypted, err := encryption.EncryptValue(encryptionKey, *createResp.AccessKey.SecretAccessKey, "IAM Access Key Secret") - if err != nil { - return err - } - - d.Set("key_fingerprint", fingerprint) - d.Set("encrypted_secret", encrypted) - } else { - if err := d.Set("secret", createResp.AccessKey.SecretAccessKey); err != nil { - return err - } - } - - d.Set("ses_smtp_password", - sesSmtpPasswordFromSecretKey(createResp.AccessKey.SecretAccessKey)) - - return resourceAwsIamAccessKeyReadResult(d, &iam.AccessKeyMetadata{ - AccessKeyId: createResp.AccessKey.AccessKeyId, - CreateDate: createResp.AccessKey.CreateDate, - Status: createResp.AccessKey.Status, - UserName: createResp.AccessKey.UserName, - }) -} - -func resourceAwsIamAccessKeyRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.ListAccessKeysInput{ - UserName: aws.String(d.Get("user").(string)), - } - - getResp, err := iamconn.ListAccessKeys(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { // XXX TEST ME - // the user does not exist, so the key can't exist. - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM acces key: %s", err) - } - - for _, key := range getResp.AccessKeyMetadata { - if key.AccessKeyId != nil && *key.AccessKeyId == d.Id() { - return resourceAwsIamAccessKeyReadResult(d, key) - } - } - - // Guess the key isn't around anymore. - d.SetId("") - return nil -} - -func resourceAwsIamAccessKeyReadResult(d *schema.ResourceData, key *iam.AccessKeyMetadata) error { - d.SetId(*key.AccessKeyId) - if err := d.Set("user", key.UserName); err != nil { - return err - } - if err := d.Set("status", key.Status); err != nil { - return err - } - return nil -} - -func resourceAwsIamAccessKeyDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.DeleteAccessKeyInput{ - AccessKeyId: aws.String(d.Id()), - UserName: aws.String(d.Get("user").(string)), - } - - if _, err := iamconn.DeleteAccessKey(request); err != nil { - return fmt.Errorf("Error deleting access key %s: %s", d.Id(), err) - } - return nil -} - -func sesSmtpPasswordFromSecretKey(key *string) string { - if key == nil { - return "" - } - version := byte(0x02) - message := []byte("SendRawEmail") - hmacKey := []byte(*key) - h := hmac.New(sha256.New, hmacKey) - h.Write(message) - rawSig := h.Sum(nil) - versionedSig := make([]byte, 0, len(rawSig)+1) - versionedSig = append(versionedSig, version) - versionedSig = append(versionedSig, rawSig...) - return base64.StdEncoding.EncodeToString(versionedSig) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_account_alias.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_account_alias.go deleted file mode 100644 index 3b1b86f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_account_alias.go +++ /dev/null @@ -1,94 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamAccountAlias() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamAccountAliasCreate, - Read: resourceAwsIamAccountAliasRead, - Delete: resourceAwsIamAccountAliasDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "account_alias": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateAccountAlias, - }, - }, - } -} - -func resourceAwsIamAccountAliasCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - account_alias := d.Get("account_alias").(string) - - params := &iam.CreateAccountAliasInput{ - AccountAlias: aws.String(account_alias), - } - - _, err := conn.CreateAccountAlias(params) - - if err != nil { - return fmt.Errorf("Error creating account alias with name %s", account_alias) - } - - d.SetId(account_alias) - - return nil -} - -func resourceAwsIamAccountAliasRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - params := &iam.ListAccountAliasesInput{} - - resp, err := conn.ListAccountAliases(params) - - if err != nil { - return err - } - - if resp == nil || len(resp.AccountAliases) == 0 { - d.SetId("") - return nil - } - - account_alias := aws.StringValue(resp.AccountAliases[0]) - - d.SetId(account_alias) - d.Set("account_alias", account_alias) - - return nil -} - -func resourceAwsIamAccountAliasDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - account_alias := d.Get("account_alias").(string) - - params := &iam.DeleteAccountAliasInput{ - AccountAlias: aws.String(account_alias), - } - - _, err := conn.DeleteAccountAlias(params) - - if err != nil { - return fmt.Errorf("Error deleting account alias with name %s", account_alias) - } - - d.SetId("") - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_account_password_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_account_password_policy.go deleted file mode 100644 index 71dfbf0..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_account_password_policy.go +++ /dev/null @@ -1,168 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamAccountPasswordPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamAccountPasswordPolicyUpdate, - Read: resourceAwsIamAccountPasswordPolicyRead, - Update: resourceAwsIamAccountPasswordPolicyUpdate, - Delete: resourceAwsIamAccountPasswordPolicyDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "allow_users_to_change_password": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "expire_passwords": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - }, - "hard_expiry": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "max_password_age": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - "minimum_password_length": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 6, - }, - "password_reuse_prevention": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - "require_lowercase_characters": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "require_numbers": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "require_symbols": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "require_uppercase_characters": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsIamAccountPasswordPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - input := &iam.UpdateAccountPasswordPolicyInput{} - - if v, ok := d.GetOk("allow_users_to_change_password"); ok { - input.AllowUsersToChangePassword = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("hard_expiry"); ok { - input.HardExpiry = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("max_password_age"); ok { - input.MaxPasswordAge = aws.Int64(int64(v.(int))) - } - if v, ok := d.GetOk("minimum_password_length"); ok { - input.MinimumPasswordLength = aws.Int64(int64(v.(int))) - } - if v, ok := d.GetOk("password_reuse_prevention"); ok { - input.PasswordReusePrevention = aws.Int64(int64(v.(int))) - } - if v, ok := d.GetOk("require_lowercase_characters"); ok { - input.RequireLowercaseCharacters = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("require_numbers"); ok { - input.RequireNumbers = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("require_symbols"); ok { - input.RequireSymbols = aws.Bool(v.(bool)) - } - if v, ok := d.GetOk("require_uppercase_characters"); ok { - input.RequireUppercaseCharacters = aws.Bool(v.(bool)) - } - - log.Printf("[DEBUG] Updating IAM account password policy: %s", input) - _, err := iamconn.UpdateAccountPasswordPolicy(input) - if err != nil { - return fmt.Errorf("Error updating IAM Password Policy: %s", err) - } - log.Println("[DEBUG] IAM account password policy updated") - - d.SetId("iam-account-password-policy") - - return resourceAwsIamAccountPasswordPolicyRead(d, meta) -} - -func resourceAwsIamAccountPasswordPolicyRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - input := &iam.GetAccountPasswordPolicyInput{} - resp, err := iamconn.GetAccountPasswordPolicy(input) - if err != nil { - awsErr, ok := err.(awserr.Error) - if ok && awsErr.Code() == "NoSuchEntity" { - log.Printf("[WARN] IAM account password policy is gone (i.e. default)") - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM account password policy: %s", err) - } - - log.Printf("[DEBUG] Received IAM account password policy: %s", resp) - - policy := resp.PasswordPolicy - - d.Set("allow_users_to_change_password", policy.AllowUsersToChangePassword) - d.Set("expire_passwords", policy.ExpirePasswords) - d.Set("hard_expiry", policy.HardExpiry) - d.Set("max_password_age", policy.MaxPasswordAge) - d.Set("minimum_password_length", policy.MinimumPasswordLength) - d.Set("password_reuse_prevention", policy.PasswordReusePrevention) - d.Set("require_lowercase_characters", policy.RequireLowercaseCharacters) - d.Set("require_numbers", policy.RequireNumbers) - d.Set("require_symbols", policy.RequireSymbols) - d.Set("require_uppercase_characters", policy.RequireUppercaseCharacters) - - return nil -} - -func resourceAwsIamAccountPasswordPolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - log.Println("[DEBUG] Deleting IAM account password policy") - input := &iam.DeleteAccountPasswordPolicyInput{} - if _, err := iamconn.DeleteAccountPasswordPolicy(input); err != nil { - return fmt.Errorf("Error deleting IAM Password Policy: %s", err) - } - d.SetId("") - log.Println("[DEBUG] Deleted IAM account password policy") - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group.go deleted file mode 100644 index 967f055..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group.go +++ /dev/null @@ -1,141 +0,0 @@ -package aws - -import ( - "fmt" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamGroupCreate, - Read: resourceAwsIamGroupRead, - Update: resourceAwsIamGroupUpdate, - Delete: resourceAwsIamGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "unique_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsIamGroupName, - }, - "path": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "/", - }, - }, - } -} - -func resourceAwsIamGroupCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - name := d.Get("name").(string) - path := d.Get("path").(string) - - request := &iam.CreateGroupInput{ - Path: aws.String(path), - GroupName: aws.String(name), - } - - createResp, err := iamconn.CreateGroup(request) - if err != nil { - return fmt.Errorf("Error creating IAM Group %s: %s", name, err) - } - d.SetId(*createResp.Group.GroupName) - - return resourceAwsIamGroupReadResult(d, createResp.Group) -} - -func resourceAwsIamGroupRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.GetGroupInput{ - GroupName: aws.String(d.Id()), - } - - getResp, err := iamconn.GetGroup(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM Group %s: %s", d.Id(), err) - } - return resourceAwsIamGroupReadResult(d, getResp.Group) -} - -func resourceAwsIamGroupReadResult(d *schema.ResourceData, group *iam.Group) error { - if err := d.Set("name", group.GroupName); err != nil { - return err - } - if err := d.Set("arn", group.Arn); err != nil { - return err - } - if err := d.Set("path", group.Path); err != nil { - return err - } - if err := d.Set("unique_id", group.GroupId); err != nil { - return err - } - return nil -} - -func resourceAwsIamGroupUpdate(d *schema.ResourceData, meta interface{}) error { - if d.HasChange("name") || d.HasChange("path") { - iamconn := meta.(*AWSClient).iamconn - on, nn := d.GetChange("name") - _, np := d.GetChange("path") - - request := &iam.UpdateGroupInput{ - GroupName: aws.String(on.(string)), - NewGroupName: aws.String(nn.(string)), - NewPath: aws.String(np.(string)), - } - _, err := iamconn.UpdateGroup(request) - if err != nil { - return fmt.Errorf("Error updating IAM Group %s: %s", d.Id(), err) - } - return resourceAwsIamGroupRead(d, meta) - } - return nil -} - -func resourceAwsIamGroupDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.DeleteGroupInput{ - GroupName: aws.String(d.Id()), - } - - if _, err := iamconn.DeleteGroup(request); err != nil { - return fmt.Errorf("Error deleting IAM Group %s: %s", d.Id(), err) - } - return nil -} - -func validateAwsIamGroupName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9A-Za-z=,.@\-_+]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters, hyphens, underscores, commas, periods, @ symbols, plus and equals signs allowed in %q: %q", - k, value)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_membership.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_membership.go deleted file mode 100644 index 7977bbf..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_membership.go +++ /dev/null @@ -1,169 +0,0 @@ -package aws - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamGroupMembership() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamGroupMembershipCreate, - Read: resourceAwsIamGroupMembershipRead, - Update: resourceAwsIamGroupMembershipUpdate, - Delete: resourceAwsIamGroupMembershipDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "users": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "group": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsIamGroupMembershipCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - group := d.Get("group").(string) - userList := expandStringList(d.Get("users").(*schema.Set).List()) - - if err := addUsersToGroup(conn, userList, group); err != nil { - return err - } - - d.SetId(d.Get("name").(string)) - return resourceAwsIamGroupMembershipRead(d, meta) -} - -func resourceAwsIamGroupMembershipRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - group := d.Get("group").(string) - - var ul []string - var marker *string - for { - resp, err := conn.GetGroup(&iam.GetGroupInput{ - GroupName: aws.String(group), - Marker: marker, - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // aws specific error - if awsErr.Code() == "NoSuchEntity" { - // group not found - d.SetId("") - return nil - } - } - return err - } - - for _, u := range resp.Users { - ul = append(ul, *u.UserName) - } - - if !*resp.IsTruncated { - break - } - marker = resp.Marker - } - - if err := d.Set("users", ul); err != nil { - return fmt.Errorf("[WARN] Error setting user list from IAM Group Membership (%s), error: %s", group, err) - } - - return nil -} - -func resourceAwsIamGroupMembershipUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - if d.HasChange("users") { - group := d.Get("group").(string) - - o, n := d.GetChange("users") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := expandStringList(os.Difference(ns).List()) - add := expandStringList(ns.Difference(os).List()) - - if err := removeUsersFromGroup(conn, remove, group); err != nil { - return err - } - - if err := addUsersToGroup(conn, add, group); err != nil { - return err - } - } - - return resourceAwsIamGroupMembershipRead(d, meta) -} - -func resourceAwsIamGroupMembershipDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - userList := expandStringList(d.Get("users").(*schema.Set).List()) - group := d.Get("group").(string) - - if err := removeUsersFromGroup(conn, userList, group); err != nil { - return err - } - - return nil -} - -func removeUsersFromGroup(conn *iam.IAM, users []*string, group string) error { - for _, u := range users { - _, err := conn.RemoveUserFromGroup(&iam.RemoveUserFromGroupInput{ - UserName: u, - GroupName: aws.String(group), - }) - - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - return nil - } - return err - } - } - return nil -} - -func addUsersToGroup(conn *iam.IAM, users []*string, group string) error { - for _, u := range users { - _, err := conn.AddUserToGroup(&iam.AddUserToGroupInput{ - UserName: u, - GroupName: aws.String(group), - }) - - if err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_policy.go deleted file mode 100644 index 2c16fe1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_policy.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "fmt" - "net/url" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamGroupPolicy() *schema.Resource { - return &schema.Resource{ - // PutGroupPolicy API is idempotent, so these can be the same. - Create: resourceAwsIamGroupPolicyPut, - Update: resourceAwsIamGroupPolicyPut, - - Read: resourceAwsIamGroupPolicyRead, - Delete: resourceAwsIamGroupPolicyDelete, - - Schema: map[string]*schema.Schema{ - "policy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "group": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsIamGroupPolicyPut(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.PutGroupPolicyInput{ - GroupName: aws.String(d.Get("group").(string)), - PolicyName: aws.String(d.Get("name").(string)), - PolicyDocument: aws.String(d.Get("policy").(string)), - } - - if _, err := iamconn.PutGroupPolicy(request); err != nil { - return fmt.Errorf("Error putting IAM group policy %s: %s", *request.PolicyName, err) - } - - d.SetId(fmt.Sprintf("%s:%s", *request.GroupName, *request.PolicyName)) - return nil -} - -func resourceAwsIamGroupPolicyRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - group, name := resourceAwsIamGroupPolicyParseId(d.Id()) - - request := &iam.GetGroupPolicyInput{ - PolicyName: aws.String(name), - GroupName: aws.String(group), - } - - var err error - getResp, err := iamconn.GetGroupPolicy(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { // XXX test me - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM policy %s from group %s: %s", name, group, err) - } - - if getResp.PolicyDocument == nil { - return fmt.Errorf("GetGroupPolicy returned a nil policy document") - } - - policy, err := url.QueryUnescape(*getResp.PolicyDocument) - if err != nil { - return err - } - return d.Set("policy", policy) -} - -func resourceAwsIamGroupPolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - group, name := resourceAwsIamGroupPolicyParseId(d.Id()) - - request := &iam.DeleteGroupPolicyInput{ - PolicyName: aws.String(name), - GroupName: aws.String(group), - } - - if _, err := iamconn.DeleteGroupPolicy(request); err != nil { - return fmt.Errorf("Error deleting IAM group policy %s: %s", d.Id(), err) - } - return nil -} - -func resourceAwsIamGroupPolicyParseId(id string) (groupName, policyName string) { - parts := strings.SplitN(id, ":", 2) - groupName = parts[0] - policyName = parts[1] - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_policy_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_policy_attachment.go deleted file mode 100644 index cf95952..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_group_policy_attachment.go +++ /dev/null @@ -1,124 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamGroupPolicyAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamGroupPolicyAttachmentCreate, - Read: resourceAwsIamGroupPolicyAttachmentRead, - Delete: resourceAwsIamGroupPolicyAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "group": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "policy_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsIamGroupPolicyAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - group := d.Get("group").(string) - arn := d.Get("policy_arn").(string) - - err := attachPolicyToGroup(conn, group, arn) - if err != nil { - return fmt.Errorf("[WARN] Error attaching policy %s to IAM group %s: %v", arn, group, err) - } - - d.SetId(resource.PrefixedUniqueId(fmt.Sprintf("%s-", group))) - return resourceAwsIamGroupPolicyAttachmentRead(d, meta) -} - -func resourceAwsIamGroupPolicyAttachmentRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - group := d.Get("group").(string) - arn := d.Get("policy_arn").(string) - - _, err := conn.GetGroup(&iam.GetGroupInput{ - GroupName: aws.String(group), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NoSuchEntity" { - log.Printf("[WARN] No such entity found for Policy Attachment (%s)", group) - d.SetId("") - return nil - } - } - return err - } - - attachedPolicies, err := conn.ListAttachedGroupPolicies(&iam.ListAttachedGroupPoliciesInput{ - GroupName: aws.String(group), - }) - if err != nil { - return err - } - - var policy string - for _, p := range attachedPolicies.AttachedPolicies { - if *p.PolicyArn == arn { - policy = *p.PolicyArn - } - } - - if policy == "" { - log.Printf("[WARN] No such policy found for Group Policy Attachment (%s)", group) - d.SetId("") - } - - return nil -} - -func resourceAwsIamGroupPolicyAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - group := d.Get("group").(string) - arn := d.Get("policy_arn").(string) - - err := detachPolicyFromGroup(conn, group, arn) - if err != nil { - return fmt.Errorf("[WARN] Error removing policy %s from IAM Group %s: %v", arn, group, err) - } - return nil -} - -func attachPolicyToGroup(conn *iam.IAM, group string, arn string) error { - _, err := conn.AttachGroupPolicy(&iam.AttachGroupPolicyInput{ - GroupName: aws.String(group), - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - return nil -} - -func detachPolicyFromGroup(conn *iam.IAM, group string, arn string) error { - _, err := conn.DetachGroupPolicy(&iam.DetachGroupPolicyInput{ - GroupName: aws.String(group), - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_instance_profile.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_instance_profile.go deleted file mode 100644 index 2e45a65..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_instance_profile.go +++ /dev/null @@ -1,274 +0,0 @@ -package aws - -import ( - "fmt" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamInstanceProfile() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamInstanceProfileCreate, - Read: resourceAwsIamInstanceProfileRead, - Update: resourceAwsIamInstanceProfileUpdate, - Delete: resourceAwsIamInstanceProfileDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "create_date": { - Type: schema.TypeString, - Computed: true, - }, - - "unique_id": { - Type: schema.TypeString, - Computed: true, - }, - - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/2485f5c/botocore/data/iam/2010-05-08/service-2.json#L8196-L8201 - value := v.(string) - if len(value) > 128 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 128 characters", k)) - } - if !regexp.MustCompile("^[\\w+=,.@-]+$").MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must match [\\w+=,.@-]", k)) - } - return - }, - }, - - "name_prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/2485f5c/botocore/data/iam/2010-05-08/service-2.json#L8196-L8201 - value := v.(string) - if len(value) > 64 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 64 characters, name is limited to 128", k)) - } - if !regexp.MustCompile("^[\\w+=,.@-]+$").MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must match [\\w+=,.@-]", k)) - } - return - }, - }, - - "path": { - Type: schema.TypeString, - Optional: true, - Default: "/", - ForceNew: true, - }, - - "roles": { - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - } -} - -func resourceAwsIamInstanceProfileCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - var name string - if v, ok := d.GetOk("name"); ok { - name = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - name = resource.PrefixedUniqueId(v.(string)) - } else { - name = resource.UniqueId() - } - - request := &iam.CreateInstanceProfileInput{ - InstanceProfileName: aws.String(name), - Path: aws.String(d.Get("path").(string)), - } - - var err error - response, err := iamconn.CreateInstanceProfile(request) - if err == nil { - err = instanceProfileReadResult(d, response.InstanceProfile) - } - if err != nil { - return fmt.Errorf("Error creating IAM instance profile %s: %s", name, err) - } - - waiterRequest := &iam.GetInstanceProfileInput{ - InstanceProfileName: aws.String(name), - } - // don't return until the IAM service reports that the instance profile is ready. - // this ensures that terraform resources which rely on the instance profile will 'see' - // that the instance profile exists. - err = iamconn.WaitUntilInstanceProfileExists(waiterRequest) - if err != nil { - return fmt.Errorf("Timed out while waiting for instance profile %s: %s", name, err) - } - - return instanceProfileSetRoles(d, iamconn) -} - -func instanceProfileAddRole(iamconn *iam.IAM, profileName, roleName string) error { - request := &iam.AddRoleToInstanceProfileInput{ - InstanceProfileName: aws.String(profileName), - RoleName: aws.String(roleName), - } - - _, err := iamconn.AddRoleToInstanceProfile(request) - return err -} - -func instanceProfileRemoveRole(iamconn *iam.IAM, profileName, roleName string) error { - request := &iam.RemoveRoleFromInstanceProfileInput{ - InstanceProfileName: aws.String(profileName), - RoleName: aws.String(roleName), - } - - _, err := iamconn.RemoveRoleFromInstanceProfile(request) - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - return nil - } - return err -} - -func instanceProfileSetRoles(d *schema.ResourceData, iamconn *iam.IAM) error { - oldInterface, newInterface := d.GetChange("roles") - oldRoles := oldInterface.(*schema.Set) - newRoles := newInterface.(*schema.Set) - - currentRoles := schema.CopySet(oldRoles) - - d.Partial(true) - - for _, role := range oldRoles.Difference(newRoles).List() { - err := instanceProfileRemoveRole(iamconn, d.Id(), role.(string)) - if err != nil { - return fmt.Errorf("Error removing role %s from IAM instance profile %s: %s", role, d.Id(), err) - } - currentRoles.Remove(role) - d.Set("roles", currentRoles) - d.SetPartial("roles") - } - - for _, role := range newRoles.Difference(oldRoles).List() { - err := instanceProfileAddRole(iamconn, d.Id(), role.(string)) - if err != nil { - return fmt.Errorf("Error adding role %s to IAM instance profile %s: %s", role, d.Id(), err) - } - currentRoles.Add(role) - d.Set("roles", currentRoles) - d.SetPartial("roles") - } - - d.Partial(false) - - return nil -} - -func instanceProfileRemoveAllRoles(d *schema.ResourceData, iamconn *iam.IAM) error { - for _, role := range d.Get("roles").(*schema.Set).List() { - err := instanceProfileRemoveRole(iamconn, d.Id(), role.(string)) - if err != nil { - return fmt.Errorf("Error removing role %s from IAM instance profile %s: %s", role, d.Id(), err) - } - } - return nil -} - -func resourceAwsIamInstanceProfileUpdate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - if !d.HasChange("roles") { - return nil - } - - return instanceProfileSetRoles(d, iamconn) -} - -func resourceAwsIamInstanceProfileRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.GetInstanceProfileInput{ - InstanceProfileName: aws.String(d.Id()), - } - - result, err := iamconn.GetInstanceProfile(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM instance profile %s: %s", d.Id(), err) - } - - return instanceProfileReadResult(d, result.InstanceProfile) -} - -func resourceAwsIamInstanceProfileDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - if err := instanceProfileRemoveAllRoles(d, iamconn); err != nil { - return err - } - - request := &iam.DeleteInstanceProfileInput{ - InstanceProfileName: aws.String(d.Id()), - } - _, err := iamconn.DeleteInstanceProfile(request) - if err != nil { - return fmt.Errorf("Error deleting IAM instance profile %s: %s", d.Id(), err) - } - d.SetId("") - return nil -} - -func instanceProfileReadResult(d *schema.ResourceData, result *iam.InstanceProfile) error { - d.SetId(*result.InstanceProfileName) - if err := d.Set("name", result.InstanceProfileName); err != nil { - return err - } - if err := d.Set("arn", result.Arn); err != nil { - return err - } - if err := d.Set("path", result.Path); err != nil { - return err - } - d.Set("unique_id", result.InstanceProfileId) - - roles := &schema.Set{F: schema.HashString} - for _, role := range result.Roles { - roles.Add(*role.RoleName) - } - if err := d.Set("roles", roles); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_policy.go deleted file mode 100644 index e983dc7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_policy.go +++ /dev/null @@ -1,296 +0,0 @@ -package aws - -import ( - "fmt" - "net/url" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamPolicyCreate, - Read: resourceAwsIamPolicyRead, - Update: resourceAwsIamPolicyUpdate, - Delete: resourceAwsIamPolicyDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - "path": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "/", - ForceNew: true, - }, - "policy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/2485f5c/botocore/data/iam/2010-05-08/service-2.json#L8329-L8334 - value := v.(string) - if len(value) > 128 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 128 characters", k)) - } - if !regexp.MustCompile("^[\\w+=,.@-]*$").MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must match [\\w+=,.@-]", k)) - } - return - }, - }, - "name_prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/2485f5c/botocore/data/iam/2010-05-08/service-2.json#L8329-L8334 - value := v.(string) - if len(value) > 96 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 96 characters, name is limited to 128", k)) - } - if !regexp.MustCompile("^[\\w+=,.@-]*$").MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must match [\\w+=,.@-]", k)) - } - return - }, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsIamPolicyCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - var name string - if v, ok := d.GetOk("name"); ok { - name = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - name = resource.PrefixedUniqueId(v.(string)) - } else { - name = resource.UniqueId() - } - - request := &iam.CreatePolicyInput{ - Description: aws.String(d.Get("description").(string)), - Path: aws.String(d.Get("path").(string)), - PolicyDocument: aws.String(d.Get("policy").(string)), - PolicyName: aws.String(name), - } - - response, err := iamconn.CreatePolicy(request) - if err != nil { - return fmt.Errorf("Error creating IAM policy %s: %s", name, err) - } - - return readIamPolicy(d, response.Policy) -} - -func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - getPolicyRequest := &iam.GetPolicyInput{ - PolicyArn: aws.String(d.Id()), - } - - getPolicyResponse, err := iamconn.GetPolicy(getPolicyRequest) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM policy %s: %s", d.Id(), err) - } - - getPolicyVersionRequest := &iam.GetPolicyVersionInput{ - PolicyArn: aws.String(d.Id()), - VersionId: getPolicyResponse.Policy.DefaultVersionId, - } - - getPolicyVersionResponse, err := iamconn.GetPolicyVersion(getPolicyVersionRequest) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM policy version %s: %s", d.Id(), err) - } - - policy, err := url.QueryUnescape(*getPolicyVersionResponse.PolicyVersion.Document) - if err != nil { - return err - } - if err := d.Set("policy", policy); err != nil { - return err - } - - return readIamPolicy(d, getPolicyResponse.Policy) -} - -func resourceAwsIamPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - if err := iamPolicyPruneVersions(d.Id(), iamconn); err != nil { - return err - } - - if !d.HasChange("policy") { - return nil - } - request := &iam.CreatePolicyVersionInput{ - PolicyArn: aws.String(d.Id()), - PolicyDocument: aws.String(d.Get("policy").(string)), - SetAsDefault: aws.Bool(true), - } - - if _, err := iamconn.CreatePolicyVersion(request); err != nil { - return fmt.Errorf("Error updating IAM policy %s: %s", d.Id(), err) - } - return nil -} - -func resourceAwsIamPolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - if err := iamPolicyDeleteNondefaultVersions(d.Id(), iamconn); err != nil { - return err - } - - request := &iam.DeletePolicyInput{ - PolicyArn: aws.String(d.Id()), - } - - _, err := iamconn.DeletePolicy(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - return nil - } - return fmt.Errorf("Error reading IAM policy %s: %#v", d.Id(), err) - } - return nil -} - -// iamPolicyPruneVersions deletes the oldest versions. -// -// Old versions are deleted until there are 4 or less remaining, which means at -// least one more can be created before hitting the maximum of 5. -// -// The default version is never deleted. - -func iamPolicyPruneVersions(arn string, iamconn *iam.IAM) error { - versions, err := iamPolicyListVersions(arn, iamconn) - if err != nil { - return err - } - if len(versions) < 5 { - return nil - } - - var oldestVersion *iam.PolicyVersion - - for _, version := range versions { - if *version.IsDefaultVersion { - continue - } - if oldestVersion == nil || - version.CreateDate.Before(*oldestVersion.CreateDate) { - oldestVersion = version - } - } - - if err := iamPolicyDeleteVersion(arn, *oldestVersion.VersionId, iamconn); err != nil { - return err - } - return nil -} - -func iamPolicyDeleteNondefaultVersions(arn string, iamconn *iam.IAM) error { - versions, err := iamPolicyListVersions(arn, iamconn) - if err != nil { - return err - } - - for _, version := range versions { - if *version.IsDefaultVersion { - continue - } - if err := iamPolicyDeleteVersion(arn, *version.VersionId, iamconn); err != nil { - return err - } - } - - return nil -} - -func iamPolicyDeleteVersion(arn, versionID string, iamconn *iam.IAM) error { - request := &iam.DeletePolicyVersionInput{ - PolicyArn: aws.String(arn), - VersionId: aws.String(versionID), - } - - _, err := iamconn.DeletePolicyVersion(request) - if err != nil { - return fmt.Errorf("Error deleting version %s from IAM policy %s: %s", versionID, arn, err) - } - return nil -} - -func iamPolicyListVersions(arn string, iamconn *iam.IAM) ([]*iam.PolicyVersion, error) { - request := &iam.ListPolicyVersionsInput{ - PolicyArn: aws.String(arn), - } - - response, err := iamconn.ListPolicyVersions(request) - if err != nil { - return nil, fmt.Errorf("Error listing versions for IAM policy %s: %s", arn, err) - } - return response.Versions, nil -} - -func readIamPolicy(d *schema.ResourceData, policy *iam.Policy) error { - d.SetId(*policy.Arn) - if policy.Description != nil { - // the description isn't present in the response to CreatePolicy. - if err := d.Set("description", policy.Description); err != nil { - return err - } - } - if err := d.Set("path", policy.Path); err != nil { - return err - } - if err := d.Set("name", policy.PolicyName); err != nil { - return err - } - if err := d.Set("arn", policy.Arn); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_policy_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_policy_attachment.go deleted file mode 100644 index adbd81b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_policy_attachment.go +++ /dev/null @@ -1,374 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamPolicyAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamPolicyAttachmentCreate, - Read: resourceAwsIamPolicyAttachmentRead, - Update: resourceAwsIamPolicyAttachmentUpdate, - Delete: resourceAwsIamPolicyAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - if v.(string) == "" { - errors = append(errors, fmt.Errorf( - "%q cannot be an empty string", k)) - } - return - }, - }, - "users": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "roles": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "groups": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "policy_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsIamPolicyAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - name := d.Get("name").(string) - arn := d.Get("policy_arn").(string) - users := expandStringList(d.Get("users").(*schema.Set).List()) - roles := expandStringList(d.Get("roles").(*schema.Set).List()) - groups := expandStringList(d.Get("groups").(*schema.Set).List()) - - if len(users) == 0 && len(roles) == 0 && len(groups) == 0 { - return fmt.Errorf("[WARN] No Users, Roles, or Groups specified for IAM Policy Attachment %s", name) - } else { - var userErr, roleErr, groupErr error - if users != nil { - userErr = attachPolicyToUsers(conn, users, arn) - } - if roles != nil { - roleErr = attachPolicyToRoles(conn, roles, arn) - } - if groups != nil { - groupErr = attachPolicyToGroups(conn, groups, arn) - } - if userErr != nil || roleErr != nil || groupErr != nil { - return composeErrors(fmt.Sprint("[WARN] Error attaching policy with IAM Policy Attachment ", name, ":"), userErr, roleErr, groupErr) - } - } - d.SetId(d.Get("name").(string)) - return resourceAwsIamPolicyAttachmentRead(d, meta) -} - -func resourceAwsIamPolicyAttachmentRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - arn := d.Get("policy_arn").(string) - name := d.Get("name").(string) - - _, err := conn.GetPolicy(&iam.GetPolicyInput{ - PolicyArn: aws.String(arn), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NoSuchEntity" { - log.Printf("[WARN] No such entity found for Policy Attachment (%s)", d.Id()) - d.SetId("") - return nil - } - } - return err - } - - ul := make([]string, 0) - rl := make([]string, 0) - gl := make([]string, 0) - - args := iam.ListEntitiesForPolicyInput{ - PolicyArn: aws.String(arn), - } - err = conn.ListEntitiesForPolicyPages(&args, func(page *iam.ListEntitiesForPolicyOutput, lastPage bool) bool { - for _, u := range page.PolicyUsers { - ul = append(ul, *u.UserName) - } - - for _, r := range page.PolicyRoles { - rl = append(rl, *r.RoleName) - } - - for _, g := range page.PolicyGroups { - gl = append(gl, *g.GroupName) - } - return true - }) - if err != nil { - return err - } - - userErr := d.Set("users", ul) - roleErr := d.Set("roles", rl) - groupErr := d.Set("groups", gl) - - if userErr != nil || roleErr != nil || groupErr != nil { - return composeErrors(fmt.Sprint("[WARN} Error setting user, role, or group list from IAM Policy Attachment ", name, ":"), userErr, roleErr, groupErr) - } - - return nil -} -func resourceAwsIamPolicyAttachmentUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - name := d.Get("name").(string) - var userErr, roleErr, groupErr error - - if d.HasChange("users") { - userErr = updateUsers(conn, d, meta) - } - if d.HasChange("roles") { - roleErr = updateRoles(conn, d, meta) - } - if d.HasChange("groups") { - groupErr = updateGroups(conn, d, meta) - } - if userErr != nil || roleErr != nil || groupErr != nil { - return composeErrors(fmt.Sprint("[WARN] Error updating user, role, or group list from IAM Policy Attachment ", name, ":"), userErr, roleErr, groupErr) - } - return resourceAwsIamPolicyAttachmentRead(d, meta) -} - -func resourceAwsIamPolicyAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - name := d.Get("name").(string) - arn := d.Get("policy_arn").(string) - users := expandStringList(d.Get("users").(*schema.Set).List()) - roles := expandStringList(d.Get("roles").(*schema.Set).List()) - groups := expandStringList(d.Get("groups").(*schema.Set).List()) - - var userErr, roleErr, groupErr error - if len(users) != 0 { - userErr = detachPolicyFromUsers(conn, users, arn) - } - if len(roles) != 0 { - roleErr = detachPolicyFromRoles(conn, roles, arn) - } - if len(groups) != 0 { - groupErr = detachPolicyFromGroups(conn, groups, arn) - } - if userErr != nil || roleErr != nil || groupErr != nil { - return composeErrors(fmt.Sprint("[WARN] Error removing user, role, or group list from IAM Policy Detach ", name, ":"), userErr, roleErr, groupErr) - } - return nil -} - -func composeErrors(desc string, uErr error, rErr error, gErr error) error { - errMsg := fmt.Sprintf(desc) - errs := []error{uErr, rErr, gErr} - for _, e := range errs { - if e != nil { - errMsg = errMsg + "\n– " + e.Error() - } - } - return fmt.Errorf(errMsg) -} - -func attachPolicyToUsers(conn *iam.IAM, users []*string, arn string) error { - for _, u := range users { - _, err := conn.AttachUserPolicy(&iam.AttachUserPolicyInput{ - UserName: u, - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - } - return nil -} -func attachPolicyToRoles(conn *iam.IAM, roles []*string, arn string) error { - for _, r := range roles { - _, err := conn.AttachRolePolicy(&iam.AttachRolePolicyInput{ - RoleName: r, - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - - var attachmentErr error - attachmentErr = resource.Retry(2*time.Minute, func() *resource.RetryError { - - input := iam.ListRolePoliciesInput{ - RoleName: r, - } - - attachedPolicies, err := conn.ListRolePolicies(&input) - if err != nil { - return resource.NonRetryableError(err) - } - - if len(attachedPolicies.PolicyNames) > 0 { - var foundPolicy bool - for _, policyName := range attachedPolicies.PolicyNames { - if strings.HasSuffix(arn, *policyName) { - foundPolicy = true - break - } - } - - if !foundPolicy { - return resource.NonRetryableError(err) - } - } - - return nil - }) - - if attachmentErr != nil { - return attachmentErr - } - } - return nil -} -func attachPolicyToGroups(conn *iam.IAM, groups []*string, arn string) error { - for _, g := range groups { - _, err := conn.AttachGroupPolicy(&iam.AttachGroupPolicyInput{ - GroupName: g, - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - } - return nil -} -func updateUsers(conn *iam.IAM, d *schema.ResourceData, meta interface{}) error { - arn := d.Get("policy_arn").(string) - o, n := d.GetChange("users") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := expandStringList(os.Difference(ns).List()) - add := expandStringList(ns.Difference(os).List()) - - if rErr := detachPolicyFromUsers(conn, remove, arn); rErr != nil { - return rErr - } - if aErr := attachPolicyToUsers(conn, add, arn); aErr != nil { - return aErr - } - return nil -} -func updateRoles(conn *iam.IAM, d *schema.ResourceData, meta interface{}) error { - arn := d.Get("policy_arn").(string) - o, n := d.GetChange("roles") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := expandStringList(os.Difference(ns).List()) - add := expandStringList(ns.Difference(os).List()) - - if rErr := detachPolicyFromRoles(conn, remove, arn); rErr != nil { - return rErr - } - if aErr := attachPolicyToRoles(conn, add, arn); aErr != nil { - return aErr - } - return nil -} -func updateGroups(conn *iam.IAM, d *schema.ResourceData, meta interface{}) error { - arn := d.Get("policy_arn").(string) - o, n := d.GetChange("groups") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := expandStringList(os.Difference(ns).List()) - add := expandStringList(ns.Difference(os).List()) - - if rErr := detachPolicyFromGroups(conn, remove, arn); rErr != nil { - return rErr - } - if aErr := attachPolicyToGroups(conn, add, arn); aErr != nil { - return aErr - } - return nil - -} -func detachPolicyFromUsers(conn *iam.IAM, users []*string, arn string) error { - for _, u := range users { - _, err := conn.DetachUserPolicy(&iam.DetachUserPolicyInput{ - UserName: u, - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - } - return nil -} -func detachPolicyFromRoles(conn *iam.IAM, roles []*string, arn string) error { - for _, r := range roles { - _, err := conn.DetachRolePolicy(&iam.DetachRolePolicyInput{ - RoleName: r, - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - } - return nil -} -func detachPolicyFromGroups(conn *iam.IAM, groups []*string, arn string) error { - for _, g := range groups { - _, err := conn.DetachGroupPolicy(&iam.DetachGroupPolicyInput{ - GroupName: g, - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role.go deleted file mode 100644 index 3833ea2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role.go +++ /dev/null @@ -1,234 +0,0 @@ -package aws - -import ( - "fmt" - "net/url" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamRole() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamRoleCreate, - Read: resourceAwsIamRoleRead, - Update: resourceAwsIamRoleUpdate, - Delete: resourceAwsIamRoleDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "unique_id": { - Type: schema.TypeString, - Computed: true, - }, - - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/2485f5c/botocore/data/iam/2010-05-08/service-2.json#L8329-L8334 - value := v.(string) - if len(value) > 64 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 64 characters", k)) - } - if !regexp.MustCompile("^[\\w+=,.@-]*$").MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must match [\\w+=,.@-]", k)) - } - return - }, - }, - - "name_prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/2485f5c/botocore/data/iam/2010-05-08/service-2.json#L8329-L8334 - value := v.(string) - if len(value) > 32 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 32 characters, name is limited to 64", k)) - } - if !regexp.MustCompile("^[\\w+=,.@-]*$").MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must match [\\w+=,.@-]", k)) - } - return - }, - }, - - "path": { - Type: schema.TypeString, - Optional: true, - Default: "/", - ForceNew: true, - }, - - "assume_role_policy": { - Type: schema.TypeString, - Required: true, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - ValidateFunc: validateJsonString, - }, - - "create_date": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsIamRoleCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - var name string - if v, ok := d.GetOk("name"); ok { - name = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - name = resource.PrefixedUniqueId(v.(string)) - } else { - name = resource.UniqueId() - } - - request := &iam.CreateRoleInput{ - Path: aws.String(d.Get("path").(string)), - RoleName: aws.String(name), - AssumeRolePolicyDocument: aws.String(d.Get("assume_role_policy").(string)), - } - - var createResp *iam.CreateRoleOutput - err := resource.Retry(30*time.Second, func() *resource.RetryError { - var err error - createResp, err = iamconn.CreateRole(request) - // IAM users (referenced in Principal field of assume policy) - // can take ~30 seconds to propagate in AWS - if isAWSErr(err, "MalformedPolicyDocument", "Invalid principal in policy") { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - }) - if err != nil { - return fmt.Errorf("Error creating IAM Role %s: %s", name, err) - } - return resourceAwsIamRoleReadResult(d, createResp.Role) -} - -func resourceAwsIamRoleRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.GetRoleInput{ - RoleName: aws.String(d.Id()), - } - - getResp, err := iamconn.GetRole(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { // XXX test me - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM Role %s: %s", d.Id(), err) - } - return resourceAwsIamRoleReadResult(d, getResp.Role) -} - -func resourceAwsIamRoleUpdate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - if d.HasChange("assume_role_policy") { - assumeRolePolicyInput := &iam.UpdateAssumeRolePolicyInput{ - RoleName: aws.String(d.Id()), - PolicyDocument: aws.String(d.Get("assume_role_policy").(string)), - } - _, err := iamconn.UpdateAssumeRolePolicy(assumeRolePolicyInput) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - d.SetId("") - return nil - } - return fmt.Errorf("Error Updating IAM Role (%s) Assume Role Policy: %s", d.Id(), err) - } - } - - return nil -} - -func resourceAwsIamRoleReadResult(d *schema.ResourceData, role *iam.Role) error { - d.SetId(*role.RoleName) - if err := d.Set("name", role.RoleName); err != nil { - return err - } - if err := d.Set("arn", role.Arn); err != nil { - return err - } - if err := d.Set("path", role.Path); err != nil { - return err - } - if err := d.Set("unique_id", role.RoleId); err != nil { - return err - } - if err := d.Set("create_date", role.CreateDate.Format(time.RFC3339)); err != nil { - return err - } - - assumRolePolicy, err := url.QueryUnescape(*role.AssumeRolePolicyDocument) - if err != nil { - return err - } - if err := d.Set("assume_role_policy", assumRolePolicy); err != nil { - return err - } - return nil -} - -func resourceAwsIamRoleDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - // Roles cannot be destroyed when attached to an existing Instance Profile - resp, err := iamconn.ListInstanceProfilesForRole(&iam.ListInstanceProfilesForRoleInput{ - RoleName: aws.String(d.Id()), - }) - if err != nil { - return fmt.Errorf("Error listing Profiles for IAM Role (%s) when trying to delete: %s", d.Id(), err) - } - - // Loop and remove this Role from any Profiles - if len(resp.InstanceProfiles) > 0 { - for _, i := range resp.InstanceProfiles { - _, err := iamconn.RemoveRoleFromInstanceProfile(&iam.RemoveRoleFromInstanceProfileInput{ - InstanceProfileName: i.InstanceProfileName, - RoleName: aws.String(d.Id()), - }) - if err != nil { - return fmt.Errorf("Error deleting IAM Role %s: %s", d.Id(), err) - } - } - } - - request := &iam.DeleteRoleInput{ - RoleName: aws.String(d.Id()), - } - - if _, err := iamconn.DeleteRole(request); err != nil { - return fmt.Errorf("Error deleting IAM Role %s: %s", d.Id(), err) - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role_policy.go deleted file mode 100644 index e4456ec..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role_policy.go +++ /dev/null @@ -1,145 +0,0 @@ -package aws - -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/service/iam" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamRolePolicy() *schema.Resource { - return &schema.Resource{ - // PutRolePolicy API is idempotent, so these can be the same. - Create: resourceAwsIamRolePolicyPut, - Update: resourceAwsIamRolePolicyPut, - - Read: resourceAwsIamRolePolicyRead, - Delete: resourceAwsIamRolePolicyDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "policy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/2485f5c/botocore/data/iam/2010-05-08/service-2.json#L8291-L8296 - value := v.(string) - if len(value) > 128 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 128 characters", k)) - } - if !regexp.MustCompile("^[\\w+=,.@-]+$").MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must match [\\w+=,.@-]", k)) - } - return - }, - }, - "role": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsIamRolePolicyPut(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.PutRolePolicyInput{ - RoleName: aws.String(d.Get("role").(string)), - PolicyName: aws.String(d.Get("name").(string)), - PolicyDocument: aws.String(d.Get("policy").(string)), - } - - if _, err := iamconn.PutRolePolicy(request); err != nil { - return fmt.Errorf("Error putting IAM role policy %s: %s", *request.PolicyName, err) - } - - d.SetId(fmt.Sprintf("%s:%s", *request.RoleName, *request.PolicyName)) - return nil -} - -func resourceAwsIamRolePolicyRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - role, name, err := resourceAwsIamRolePolicyParseId(d.Id()) - if err != nil { - return err - } - - request := &iam.GetRolePolicyInput{ - PolicyName: aws.String(name), - RoleName: aws.String(role), - } - - getResp, err := iamconn.GetRolePolicy(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { // XXX test me - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM policy %s from role %s: %s", name, role, err) - } - - if getResp.PolicyDocument == nil { - return fmt.Errorf("GetRolePolicy returned a nil policy document") - } - - policy, err := url.QueryUnescape(*getResp.PolicyDocument) - if err != nil { - return err - } - if err := d.Set("policy", policy); err != nil { - return err - } - if err := d.Set("name", name); err != nil { - return err - } - return d.Set("role", role) -} - -func resourceAwsIamRolePolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - role, name, err := resourceAwsIamRolePolicyParseId(d.Id()) - if err != nil { - return err - } - - request := &iam.DeleteRolePolicyInput{ - PolicyName: aws.String(name), - RoleName: aws.String(role), - } - - if _, err := iamconn.DeleteRolePolicy(request); err != nil { - return fmt.Errorf("Error deleting IAM role policy %s: %s", d.Id(), err) - } - return nil -} - -func resourceAwsIamRolePolicyParseId(id string) (roleName, policyName string, err error) { - parts := strings.SplitN(id, ":", 2) - if len(parts) != 2 { - err = fmt.Errorf("role_policy id must be of the for :") - return - } - - roleName = parts[0] - policyName = parts[1] - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role_policy_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role_policy_attachment.go deleted file mode 100644 index bb72f87..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_role_policy_attachment.go +++ /dev/null @@ -1,126 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamRolePolicyAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamRolePolicyAttachmentCreate, - Read: resourceAwsIamRolePolicyAttachmentRead, - Delete: resourceAwsIamRolePolicyAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "role": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "policy_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsIamRolePolicyAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - role := d.Get("role").(string) - arn := d.Get("policy_arn").(string) - - err := attachPolicyToRole(conn, role, arn) - if err != nil { - return fmt.Errorf("[WARN] Error attaching policy %s to IAM Role %s: %v", arn, role, err) - } - - d.SetId(resource.PrefixedUniqueId(fmt.Sprintf("%s-", role))) - return resourceAwsIamRolePolicyAttachmentRead(d, meta) -} - -func resourceAwsIamRolePolicyAttachmentRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - role := d.Get("role").(string) - arn := d.Get("policy_arn").(string) - - _, err := conn.GetRole(&iam.GetRoleInput{ - RoleName: aws.String(role), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NoSuchEntity" { - log.Printf("[WARN] No such entity found for Policy Attachment (%s)", role) - d.SetId("") - return nil - } - } - return err - } - - args := iam.ListAttachedRolePoliciesInput{ - RoleName: aws.String(role), - } - var policy string - err = conn.ListAttachedRolePoliciesPages(&args, func(page *iam.ListAttachedRolePoliciesOutput, lastPage bool) bool { - for _, p := range page.AttachedPolicies { - if *p.PolicyArn == arn { - policy = *p.PolicyArn - } - } - - return policy == "" - }) - if err != nil { - return err - } - if policy == "" { - log.Printf("[WARN] No such policy found for Role Policy Attachment (%s)", role) - d.SetId("") - } - - return nil -} - -func resourceAwsIamRolePolicyAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - role := d.Get("role").(string) - arn := d.Get("policy_arn").(string) - - err := detachPolicyFromRole(conn, role, arn) - if err != nil { - return fmt.Errorf("[WARN] Error removing policy %s from IAM Role %s: %v", arn, role, err) - } - return nil -} - -func attachPolicyToRole(conn *iam.IAM, role string, arn string) error { - _, err := conn.AttachRolePolicy(&iam.AttachRolePolicyInput{ - RoleName: aws.String(role), - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - return nil -} - -func detachPolicyFromRole(conn *iam.IAM, role string, arn string) error { - _, err := conn.DetachRolePolicy(&iam.DetachRolePolicyInput{ - RoleName: aws.String(role), - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_saml_provider.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_saml_provider.go deleted file mode 100644 index 55496b4..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_saml_provider.go +++ /dev/null @@ -1,130 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamSamlProvider() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamSamlProviderCreate, - Read: resourceAwsIamSamlProviderRead, - Update: resourceAwsIamSamlProviderUpdate, - Delete: resourceAwsIamSamlProviderDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "valid_until": { - Type: schema.TypeString, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "saml_metadata_document": { - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsIamSamlProviderCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - input := &iam.CreateSAMLProviderInput{ - Name: aws.String(d.Get("name").(string)), - SAMLMetadataDocument: aws.String(d.Get("saml_metadata_document").(string)), - } - - out, err := iamconn.CreateSAMLProvider(input) - if err != nil { - return err - } - - d.SetId(*out.SAMLProviderArn) - - return resourceAwsIamSamlProviderRead(d, meta) -} - -func resourceAwsIamSamlProviderRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - input := &iam.GetSAMLProviderInput{ - SAMLProviderArn: aws.String(d.Id()), - } - out, err := iamconn.GetSAMLProvider(input) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - log.Printf("[WARN] IAM SAML Provider %q not found.", d.Id()) - d.SetId("") - return nil - } - return err - } - - validUntil := out.ValidUntil.Format(time.RFC1123) - d.Set("arn", d.Id()) - name, err := extractNameFromIAMSamlProviderArn(d.Id(), meta.(*AWSClient).partition) - if err != nil { - return err - } - d.Set("name", name) - d.Set("valid_until", validUntil) - d.Set("saml_metadata_document", *out.SAMLMetadataDocument) - - return nil -} - -func resourceAwsIamSamlProviderUpdate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - input := &iam.UpdateSAMLProviderInput{ - SAMLProviderArn: aws.String(d.Id()), - SAMLMetadataDocument: aws.String(d.Get("saml_metadata_document").(string)), - } - _, err := iamconn.UpdateSAMLProvider(input) - if err != nil { - return err - } - - return resourceAwsIamSamlProviderRead(d, meta) -} - -func resourceAwsIamSamlProviderDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - input := &iam.DeleteSAMLProviderInput{ - SAMLProviderArn: aws.String(d.Id()), - } - _, err := iamconn.DeleteSAMLProvider(input) - - return err -} - -func extractNameFromIAMSamlProviderArn(arn, partition string) (string, error) { - // arn:aws:iam::123456789012:saml-provider/tf-salesforce-test - r := regexp.MustCompile(fmt.Sprintf("^arn:%s:iam::[0-9]{12}:saml-provider/(.+)$", partition)) - submatches := r.FindStringSubmatch(arn) - if len(submatches) != 2 { - return "", fmt.Errorf("Unable to extract name from a given ARN: %q", arn) - } - return submatches[1], nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_server_certificate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_server_certificate.go deleted file mode 100644 index 28258ef..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_server_certificate.go +++ /dev/null @@ -1,230 +0,0 @@ -package aws - -import ( - "crypto/sha1" - "encoding/hex" - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIAMServerCertificate() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIAMServerCertificateCreate, - Read: resourceAwsIAMServerCertificateRead, - Delete: resourceAwsIAMServerCertificateDelete, - - Schema: map[string]*schema.Schema{ - "certificate_body": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: normalizeCert, - }, - - "certificate_chain": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - StateFunc: normalizeCert, - }, - - "path": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "/", - ForceNew: true, - }, - - "private_key": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: normalizeCert, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 128 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 128 characters", k)) - } - return - }, - }, - - "name_prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 30 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 30 characters, name is limited to 128", k)) - } - return - }, - }, - - "arn": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsIAMServerCertificateCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - var sslCertName string - if v, ok := d.GetOk("name"); ok { - sslCertName = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - sslCertName = resource.PrefixedUniqueId(v.(string)) - } else { - sslCertName = resource.UniqueId() - } - - createOpts := &iam.UploadServerCertificateInput{ - CertificateBody: aws.String(d.Get("certificate_body").(string)), - PrivateKey: aws.String(d.Get("private_key").(string)), - ServerCertificateName: aws.String(sslCertName), - } - - if v, ok := d.GetOk("certificate_chain"); ok { - createOpts.CertificateChain = aws.String(v.(string)) - } - - if v, ok := d.GetOk("path"); ok { - createOpts.Path = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Creating IAM Server Certificate with opts: %s", createOpts) - resp, err := conn.UploadServerCertificate(createOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - return fmt.Errorf("[WARN] Error uploading server certificate, error: %s: %s", awsErr.Code(), awsErr.Message()) - } - return fmt.Errorf("[WARN] Error uploading server certificate, error: %s", err) - } - - d.SetId(*resp.ServerCertificateMetadata.ServerCertificateId) - d.Set("name", sslCertName) - - return resourceAwsIAMServerCertificateRead(d, meta) -} - -func resourceAwsIAMServerCertificateRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - resp, err := conn.GetServerCertificate(&iam.GetServerCertificateInput{ - ServerCertificateName: aws.String(d.Get("name").(string)), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NoSuchEntity" { - log.Printf("[WARN] IAM Server Cert (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("[WARN] Error reading IAM Server Certificate: %s: %s", awsErr.Code(), awsErr.Message()) - } - return fmt.Errorf("[WARN] Error reading IAM Server Certificate: %s", err) - } - - // these values should always be present, and have a default if not set in - // configuration, and so safe to reference with nil checks - d.Set("certificate_body", normalizeCert(resp.ServerCertificate.CertificateBody)) - - c := normalizeCert(resp.ServerCertificate.CertificateChain) - if c != "" { - d.Set("certificate_chain", c) - } - - d.Set("path", resp.ServerCertificate.ServerCertificateMetadata.Path) - d.Set("arn", resp.ServerCertificate.ServerCertificateMetadata.Arn) - - return nil -} - -func resourceAwsIAMServerCertificateDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - log.Printf("[INFO] Deleting IAM Server Certificate: %s", d.Id()) - err := resource.Retry(3*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteServerCertificate(&iam.DeleteServerCertificateInput{ - ServerCertificateName: aws.String(d.Get("name").(string)), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "DeleteConflict" && strings.Contains(awsErr.Message(), "currently in use by arn") { - log.Printf("[WARN] Conflict deleting server certificate: %s, retrying", awsErr.Message()) - return resource.RetryableError(err) - } - if awsErr.Code() == "NoSuchEntity" { - log.Printf("[WARN] IAM Server Certificate (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return err - } - - d.SetId("") - return nil -} - -func normalizeCert(cert interface{}) string { - if cert == nil || cert == (*string)(nil) { - return "" - } - - var rawCert string - switch cert.(type) { - case string: - rawCert = cert.(string) - case *string: - rawCert = *cert.(*string) - default: - return "" - } - - cleanVal := sha1.Sum(stripCR([]byte(strings.TrimSpace(rawCert)))) - return hex.EncodeToString(cleanVal[:]) -} - -// strip CRs from raw literals. Lifted from go/scanner/scanner.go -// See https://github.com/golang/go/blob/release-branch.go1.6/src/go/scanner/scanner.go#L479 -func stripCR(b []byte) []byte { - c := make([]byte, len(b)) - i := 0 - for _, ch := range b { - if ch != '\r' { - c[i] = ch - i++ - } - } - return c[:i] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user.go deleted file mode 100644 index e2ebdd7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user.go +++ /dev/null @@ -1,249 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamUser() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamUserCreate, - Read: resourceAwsIamUserRead, - Update: resourceAwsIamUserUpdate, - Delete: resourceAwsIamUserDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - /* - The UniqueID could be used as the Id(), but none of the API - calls allow specifying a user by the UniqueID: they require the - name. The only way to locate a user by UniqueID is to list them - all and that would make this provider unnecessarily complex - and inefficient. Still, there are other reasons one might want - the UniqueID, so we can make it available. - */ - "unique_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsIamUserName, - }, - "path": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "/", - ForceNew: true, - }, - "force_destroy": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Delete user even if it has non-Terraform-managed IAM access keys, login profile or MFA devices", - }, - }, - } -} - -func resourceAwsIamUserCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - name := d.Get("name").(string) - path := d.Get("path").(string) - - request := &iam.CreateUserInput{ - Path: aws.String(path), - UserName: aws.String(name), - } - - log.Println("[DEBUG] Create IAM User request:", request) - createResp, err := iamconn.CreateUser(request) - if err != nil { - return fmt.Errorf("Error creating IAM User %s: %s", name, err) - } - d.SetId(*createResp.User.UserName) - return resourceAwsIamUserReadResult(d, createResp.User) -} - -func resourceAwsIamUserRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.GetUserInput{ - UserName: aws.String(d.Id()), - } - - getResp, err := iamconn.GetUser(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { // XXX test me - log.Printf("[WARN] No IAM user by name (%s) found", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM User %s: %s", d.Id(), err) - } - return resourceAwsIamUserReadResult(d, getResp.User) -} - -func resourceAwsIamUserReadResult(d *schema.ResourceData, user *iam.User) error { - if err := d.Set("name", user.UserName); err != nil { - return err - } - if err := d.Set("arn", user.Arn); err != nil { - return err - } - if err := d.Set("path", user.Path); err != nil { - return err - } - if err := d.Set("unique_id", user.UserId); err != nil { - return err - } - return nil -} - -func resourceAwsIamUserUpdate(d *schema.ResourceData, meta interface{}) error { - if d.HasChange("name") || d.HasChange("path") { - iamconn := meta.(*AWSClient).iamconn - on, nn := d.GetChange("name") - _, np := d.GetChange("path") - - request := &iam.UpdateUserInput{ - UserName: aws.String(on.(string)), - NewUserName: aws.String(nn.(string)), - NewPath: aws.String(np.(string)), - } - - log.Println("[DEBUG] Update IAM User request:", request) - _, err := iamconn.UpdateUser(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - log.Printf("[WARN] No IAM user by name (%s) found", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Error updating IAM User %s: %s", d.Id(), err) - } - return resourceAwsIamUserRead(d, meta) - } - return nil -} - -func resourceAwsIamUserDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - // IAM Users must be removed from all groups before they can be deleted - var groups []string - listGroups := &iam.ListGroupsForUserInput{ - UserName: aws.String(d.Id()), - } - pageOfGroups := func(page *iam.ListGroupsForUserOutput, lastPage bool) (shouldContinue bool) { - for _, g := range page.Groups { - groups = append(groups, *g.GroupName) - } - return !lastPage - } - err := iamconn.ListGroupsForUserPages(listGroups, pageOfGroups) - if err != nil { - return fmt.Errorf("Error removing user %q from all groups: %s", d.Id(), err) - } - for _, g := range groups { - // use iam group membership func to remove user from all groups - log.Printf("[DEBUG] Removing IAM User %s from IAM Group %s", d.Id(), g) - if err := removeUsersFromGroup(iamconn, []*string{aws.String(d.Id())}, g); err != nil { - return err - } - } - - // All access keys, MFA devices and login profile for the user must be removed - if d.Get("force_destroy").(bool) { - var accessKeys []string - listAccessKeys := &iam.ListAccessKeysInput{ - UserName: aws.String(d.Id()), - } - pageOfAccessKeys := func(page *iam.ListAccessKeysOutput, lastPage bool) (shouldContinue bool) { - for _, k := range page.AccessKeyMetadata { - accessKeys = append(accessKeys, *k.AccessKeyId) - } - return !lastPage - } - err = iamconn.ListAccessKeysPages(listAccessKeys, pageOfAccessKeys) - if err != nil { - return fmt.Errorf("Error removing access keys of user %s: %s", d.Id(), err) - } - for _, k := range accessKeys { - _, err := iamconn.DeleteAccessKey(&iam.DeleteAccessKeyInput{ - UserName: aws.String(d.Id()), - AccessKeyId: aws.String(k), - }) - if err != nil { - return fmt.Errorf("Error deleting access key %s: %s", k, err) - } - } - - var MFADevices []string - listMFADevices := &iam.ListMFADevicesInput{ - UserName: aws.String(d.Id()), - } - pageOfMFADevices := func(page *iam.ListMFADevicesOutput, lastPage bool) (shouldContinue bool) { - for _, m := range page.MFADevices { - MFADevices = append(MFADevices, *m.SerialNumber) - } - return !lastPage - } - err = iamconn.ListMFADevicesPages(listMFADevices, pageOfMFADevices) - if err != nil { - return fmt.Errorf("Error removing MFA devices of user %s: %s", d.Id(), err) - } - for _, m := range MFADevices { - _, err := iamconn.DeactivateMFADevice(&iam.DeactivateMFADeviceInput{ - UserName: aws.String(d.Id()), - SerialNumber: aws.String(m), - }) - if err != nil { - return fmt.Errorf("Error deactivating MFA device %s: %s", m, err) - } - } - - _, err = iamconn.DeleteLoginProfile(&iam.DeleteLoginProfileInput{ - UserName: aws.String(d.Id()), - }) - if err != nil { - if iamerr, ok := err.(awserr.Error); !ok || iamerr.Code() != "NoSuchEntity" { - return fmt.Errorf("Error deleting Account Login Profile: %s", err) - } - } - } - - request := &iam.DeleteUserInput{ - UserName: aws.String(d.Id()), - } - - log.Println("[DEBUG] Delete IAM User request:", request) - if _, err := iamconn.DeleteUser(request); err != nil { - return fmt.Errorf("Error deleting IAM User %s: %s", d.Id(), err) - } - return nil -} - -func validateAwsIamUserName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9A-Za-z=,.@\-_+]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters, hyphens, underscores, commas, periods, @ symbols, plus and equals signs allowed in %q: %q", - k, value)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_login_profile.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_login_profile.go deleted file mode 100644 index c60b67f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_login_profile.go +++ /dev/null @@ -1,158 +0,0 @@ -package aws - -import ( - "errors" - "fmt" - "log" - "math/rand" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/encryption" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamUserLoginProfile() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamUserLoginProfileCreate, - Read: schema.Noop, - Update: schema.Noop, - Delete: schema.RemoveFromState, - - Schema: map[string]*schema.Schema{ - "user": { - Type: schema.TypeString, - Required: true, - }, - "pgp_key": { - Type: schema.TypeString, - Required: true, - }, - "password_reset_required": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "password_length": { - Type: schema.TypeInt, - Optional: true, - Default: 20, - ValidateFunc: validateAwsIamLoginProfilePasswordLength, - }, - - "key_fingerprint": { - Type: schema.TypeString, - Computed: true, - }, - "encrypted_password": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func validateAwsIamLoginProfilePasswordLength(v interface{}, _ string) (_ []string, es []error) { - length := v.(int) - if length < 4 { - es = append(es, errors.New("minimum password_length is 4 characters")) - } - if length > 128 { - es = append(es, errors.New("maximum password_length is 128 characters")) - } - return -} - -// generatePassword generates a random password of a given length using -// characters that are likely to satisfy any possible AWS password policy -// (given sufficient length). -func generatePassword(length int) string { - charsets := []string{ - "abcdefghijklmnopqrstuvwxyz", - "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "012346789", - "!@#$%^&*()_+-=[]{}|'", - } - - // Use all character sets - random := rand.New(rand.NewSource(time.Now().UTC().UnixNano())) - components := make(map[int]byte, length) - for i := 0; i < length; i++ { - charset := charsets[i%len(charsets)] - components[i] = charset[random.Intn(len(charset))] - } - - // Randomise the ordering so we don't end up with a predictable - // lower case, upper case, numeric, symbol pattern - result := make([]byte, length) - i := 0 - for _, b := range components { - result[i] = b - i = i + 1 - } - - return string(result) -} - -func resourceAwsIamUserLoginProfileCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - encryptionKey, err := encryption.RetrieveGPGKey(d.Get("pgp_key").(string)) - if err != nil { - return err - } - - username := d.Get("user").(string) - passwordResetRequired := d.Get("password_reset_required").(bool) - passwordLength := d.Get("password_length").(int) - - _, err = iamconn.GetLoginProfile(&iam.GetLoginProfileInput{ - UserName: aws.String(username), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() != "NoSuchEntity" { - // If there is already a login profile, bring it under management (to prevent - // resource creation diffs) - we will never modify it, but obviously cannot - // set the password. - d.SetId(username) - d.Set("key_fingerprint", "") - d.Set("encrypted_password", "") - return nil - } - } - - initialPassword := generatePassword(passwordLength) - fingerprint, encrypted, err := encryption.EncryptValue(encryptionKey, initialPassword, "Password") - if err != nil { - return err - } - - request := &iam.CreateLoginProfileInput{ - UserName: aws.String(username), - Password: aws.String(initialPassword), - PasswordResetRequired: aws.Bool(passwordResetRequired), - } - - log.Println("[DEBUG] Create IAM User Login Profile request:", request) - createResp, err := iamconn.CreateLoginProfile(request) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "EntityAlreadyExists" { - // If there is already a login profile, bring it under management (to prevent - // resource creation diffs) - we will never modify it, but obviously cannot - // set the password. - d.SetId(username) - d.Set("key_fingerprint", "") - d.Set("encrypted_password", "") - return nil - } - return errwrap.Wrapf(fmt.Sprintf("Error creating IAM User Login Profile for %q: {{err}}", username), err) - } - - d.SetId(*createResp.LoginProfile.UserName) - d.Set("key_fingerprint", fingerprint) - d.Set("encrypted_password", encrypted) - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_policy.go deleted file mode 100644 index 24d1078..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_policy.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "fmt" - "net/url" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamUserPolicy() *schema.Resource { - return &schema.Resource{ - // PutUserPolicy API is idempotent, so these can be the same. - Create: resourceAwsIamUserPolicyPut, - Update: resourceAwsIamUserPolicyPut, - - Read: resourceAwsIamUserPolicyRead, - Delete: resourceAwsIamUserPolicyDelete, - - Schema: map[string]*schema.Schema{ - "policy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "user": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsIamUserPolicyPut(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.PutUserPolicyInput{ - UserName: aws.String(d.Get("user").(string)), - PolicyName: aws.String(d.Get("name").(string)), - PolicyDocument: aws.String(d.Get("policy").(string)), - } - - if _, err := iamconn.PutUserPolicy(request); err != nil { - return fmt.Errorf("Error putting IAM user policy %s: %s", *request.PolicyName, err) - } - - d.SetId(fmt.Sprintf("%s:%s", *request.UserName, *request.PolicyName)) - return nil -} - -func resourceAwsIamUserPolicyRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - user, name := resourceAwsIamUserPolicyParseId(d.Id()) - - request := &iam.GetUserPolicyInput{ - PolicyName: aws.String(name), - UserName: aws.String(user), - } - - var err error - getResp, err := iamconn.GetUserPolicy(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { // XXX test me - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM policy %s from user %s: %s", name, user, err) - } - - if getResp.PolicyDocument == nil { - return fmt.Errorf("GetUserPolicy returned a nil policy document") - } - - policy, err := url.QueryUnescape(*getResp.PolicyDocument) - if err != nil { - return err - } - return d.Set("policy", policy) -} - -func resourceAwsIamUserPolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - user, name := resourceAwsIamUserPolicyParseId(d.Id()) - - request := &iam.DeleteUserPolicyInput{ - PolicyName: aws.String(name), - UserName: aws.String(user), - } - - if _, err := iamconn.DeleteUserPolicy(request); err != nil { - return fmt.Errorf("Error deleting IAM user policy %s: %s", d.Id(), err) - } - return nil -} - -func resourceAwsIamUserPolicyParseId(id string) (userName, policyName string) { - parts := strings.SplitN(id, ":", 2) - userName = parts[0] - policyName = parts[1] - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_policy_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_policy_attachment.go deleted file mode 100644 index 15f7e87..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_policy_attachment.go +++ /dev/null @@ -1,123 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamUserPolicyAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamUserPolicyAttachmentCreate, - Read: resourceAwsIamUserPolicyAttachmentRead, - Delete: resourceAwsIamUserPolicyAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "user": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "policy_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsIamUserPolicyAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - - user := d.Get("user").(string) - arn := d.Get("policy_arn").(string) - - err := attachPolicyToUser(conn, user, arn) - if err != nil { - return fmt.Errorf("[WARN] Error attaching policy %s to IAM User %s: %v", arn, user, err) - } - - d.SetId(resource.PrefixedUniqueId(fmt.Sprintf("%s-", user))) - return resourceAwsIamUserPolicyAttachmentRead(d, meta) -} - -func resourceAwsIamUserPolicyAttachmentRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - user := d.Get("user").(string) - arn := d.Get("policy_arn").(string) - - _, err := conn.GetUser(&iam.GetUserInput{ - UserName: aws.String(user), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NoSuchEntity" { - log.Printf("[WARN] No such entity found for Policy Attachment (%s)", user) - d.SetId("") - return nil - } - } - return err - } - - attachedPolicies, err := conn.ListAttachedUserPolicies(&iam.ListAttachedUserPoliciesInput{ - UserName: aws.String(user), - }) - if err != nil { - return err - } - - var policy string - for _, p := range attachedPolicies.AttachedPolicies { - if *p.PolicyArn == arn { - policy = *p.PolicyArn - } - } - - if policy == "" { - log.Printf("[WARN] No such User found for Policy Attachment (%s)", user) - d.SetId("") - } - return nil -} - -func resourceAwsIamUserPolicyAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).iamconn - user := d.Get("user").(string) - arn := d.Get("policy_arn").(string) - - err := detachPolicyFromUser(conn, user, arn) - if err != nil { - return fmt.Errorf("[WARN] Error removing policy %s from IAM User %s: %v", arn, user, err) - } - return nil -} - -func attachPolicyToUser(conn *iam.IAM, user string, arn string) error { - _, err := conn.AttachUserPolicy(&iam.AttachUserPolicyInput{ - UserName: aws.String(user), - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - return nil -} - -func detachPolicyFromUser(conn *iam.IAM, user string, arn string) error { - _, err := conn.DetachUserPolicy(&iam.DetachUserPolicyInput{ - UserName: aws.String(user), - PolicyArn: aws.String(arn), - }) - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_ssh_key.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_ssh_key.go deleted file mode 100644 index 646eea6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_iam_user_ssh_key.go +++ /dev/null @@ -1,153 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/iam" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsIamUserSshKey() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsIamUserSshKeyCreate, - Read: resourceAwsIamUserSshKeyRead, - Update: resourceAwsIamUserSshKeyUpdate, - Delete: resourceAwsIamUserSshKeyDelete, - - Schema: map[string]*schema.Schema{ - "ssh_public_key_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "fingerprint": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "username": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "public_key": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "encoding": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateIamUserSSHKeyEncoding, - }, - - "status": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsIamUserSshKeyCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - username := d.Get("username").(string) - publicKey := d.Get("public_key").(string) - - request := &iam.UploadSSHPublicKeyInput{ - UserName: aws.String(username), - SSHPublicKeyBody: aws.String(publicKey), - } - - log.Println("[DEBUG] Create IAM User SSH Key Request:", request) - createResp, err := iamconn.UploadSSHPublicKey(request) - if err != nil { - return fmt.Errorf("Error creating IAM User SSH Key %s: %s", username, err) - } - - d.Set("ssh_public_key_id", createResp.SSHPublicKey.SSHPublicKeyId) - d.SetId(*createResp.SSHPublicKey.SSHPublicKeyId) - - return resourceAwsIamUserSshKeyRead(d, meta) -} - -func resourceAwsIamUserSshKeyRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - username := d.Get("username").(string) - request := &iam.GetSSHPublicKeyInput{ - UserName: aws.String(username), - SSHPublicKeyId: aws.String(d.Id()), - Encoding: aws.String(d.Get("encoding").(string)), - } - - getResp, err := iamconn.GetSSHPublicKey(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { // XXX test me - log.Printf("[WARN] No IAM user ssh key (%s) found", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Error reading IAM User SSH Key %s: %s", d.Id(), err) - } - - d.Set("fingerprint", getResp.SSHPublicKey.Fingerprint) - d.Set("status", getResp.SSHPublicKey.Status) - - return nil -} - -func resourceAwsIamUserSshKeyUpdate(d *schema.ResourceData, meta interface{}) error { - if d.HasChange("status") { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.UpdateSSHPublicKeyInput{ - UserName: aws.String(d.Get("username").(string)), - SSHPublicKeyId: aws.String(d.Id()), - Status: aws.String(d.Get("status").(string)), - } - - log.Println("[DEBUG] Update IAM User SSH Key request:", request) - _, err := iamconn.UpdateSSHPublicKey(request) - if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { - log.Printf("[WARN] No IAM user ssh key by ID (%s) found", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Error updating IAM User SSH Key %s: %s", d.Id(), err) - } - return resourceAwsIamUserRead(d, meta) - } - return nil -} - -func resourceAwsIamUserSshKeyDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn - - request := &iam.DeleteSSHPublicKeyInput{ - UserName: aws.String(d.Get("username").(string)), - SSHPublicKeyId: aws.String(d.Id()), - } - - log.Println("[DEBUG] Delete IAM User SSH Key request:", request) - if _, err := iamconn.DeleteSSHPublicKey(request); err != nil { - return fmt.Errorf("Error deleting IAM User SSH Key %s: %s", d.Id(), err) - } - return nil -} - -func validateIamUserSSHKeyEncoding(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - encodingTypes := map[string]bool{ - "PEM": true, - "SSH": true, - } - - if !encodingTypes[value] { - errors = append(errors, fmt.Errorf("IAM User SSH Key Encoding can only be PEM or SSH")) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_assessment_target.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_assessment_target.go deleted file mode 100644 index b6c2c80..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_assessment_target.go +++ /dev/null @@ -1,123 +0,0 @@ -package aws - -import ( - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/inspector" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAWSInspectorAssessmentTarget() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsInspectorAssessmentTargetCreate, - Read: resourceAwsInspectorAssessmentTargetRead, - Update: resourceAwsInspectorAssessmentTargetUpdate, - Delete: resourceAwsInspectorAssessmentTargetDelete, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "resource_group_arn": { - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsInspectorAssessmentTargetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - targetName := d.Get("name").(string) - resourceGroupArn := d.Get("resource_group_arn").(string) - - resp, err := conn.CreateAssessmentTarget(&inspector.CreateAssessmentTargetInput{ - AssessmentTargetName: aws.String(targetName), - ResourceGroupArn: aws.String(resourceGroupArn), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] Inspector Assessment %s created", *resp.AssessmentTargetArn) - - d.Set("arn", resp.AssessmentTargetArn) - d.SetId(*resp.AssessmentTargetArn) - - return resourceAwsInspectorAssessmentTargetRead(d, meta) -} - -func resourceAwsInspectorAssessmentTargetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - resp, err := conn.DescribeAssessmentTargets(&inspector.DescribeAssessmentTargetsInput{ - AssessmentTargetArns: []*string{ - aws.String(d.Id()), - }, - }) - - if err != nil { - if inspectorerr, ok := err.(awserr.Error); ok && inspectorerr.Code() == "InvalidInputException" { - return nil - } else { - log.Printf("[ERROR] Error finding Inspector Assessment Target: %s", err) - return err - } - } - - if resp.AssessmentTargets != nil && len(resp.AssessmentTargets) > 0 { - d.Set("name", resp.AssessmentTargets[0].Name) - } - - return nil -} - -func resourceAwsInspectorAssessmentTargetUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - input := inspector.UpdateAssessmentTargetInput{ - AssessmentTargetArn: aws.String(d.Id()), - AssessmentTargetName: aws.String(d.Get("name").(string)), - ResourceGroupArn: aws.String(d.Get("resource_group_arn").(string)), - } - - _, err := conn.UpdateAssessmentTarget(&input) - if err != nil { - return err - } - - log.Println("[DEBUG] Inspector Assessment Target updated") - - return resourceAwsInspectorAssessmentTargetRead(d, meta) -} - -func resourceAwsInspectorAssessmentTargetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - return resource.Retry(60*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteAssessmentTarget(&inspector.DeleteAssessmentTargetInput{ - AssessmentTargetArn: aws.String(d.Id()), - }) - if err != nil { - if inspectorerr, ok := err.(awserr.Error); ok && inspectorerr.Code() == "AssessmentRunInProgressException" { - log.Printf("[ERROR] Assement Run in progress: %s", err) - return resource.RetryableError(err) - } else { - log.Printf("[ERROR] Error deleting Assement Target: %s", err) - return resource.NonRetryableError(err) - } - } - return nil - }) - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_assessment_template.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_assessment_template.go deleted file mode 100644 index 4856a00..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_assessment_template.go +++ /dev/null @@ -1,121 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/inspector" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAWSInspectorAssessmentTemplate() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsInspectorAssessmentTemplateCreate, - Read: resourceAwsInspectorAssessmentTemplateRead, - Delete: resourceAwsInspectorAssessmentTemplateDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "target_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - ForceNew: true, - }, - "duration": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - "rules_package_arns": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsInspectorAssessmentTemplateCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - rules := []*string{} - if attr := d.Get("rules_package_arns").(*schema.Set); attr.Len() > 0 { - rules = expandStringList(attr.List()) - } - - targetArn := d.Get("target_arn").(string) - templateName := d.Get("name").(string) - duration := int64(d.Get("duration").(int)) - - resp, err := conn.CreateAssessmentTemplate(&inspector.CreateAssessmentTemplateInput{ - AssessmentTargetArn: aws.String(targetArn), - AssessmentTemplateName: aws.String(templateName), - DurationInSeconds: aws.Int64(duration), - RulesPackageArns: rules, - }) - if err != nil { - return err - } - log.Printf("[DEBUG] Inspector Assessment Template %s created", *resp.AssessmentTemplateArn) - - d.Set("arn", resp.AssessmentTemplateArn) - - d.SetId(*resp.AssessmentTemplateArn) - - return resourceAwsInspectorAssessmentTemplateRead(d, meta) -} - -func resourceAwsInspectorAssessmentTemplateRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - resp, err := conn.DescribeAssessmentTemplates(&inspector.DescribeAssessmentTemplatesInput{ - AssessmentTemplateArns: []*string{ - aws.String(d.Id()), - }, - }, - ) - if err != nil { - if inspectorerr, ok := err.(awserr.Error); ok && inspectorerr.Code() == "InvalidInputException" { - return nil - } else { - log.Printf("[ERROR] Error finding Inspector Assessment Template: %s", err) - return err - } - } - - if resp.AssessmentTemplates != nil && len(resp.AssessmentTemplates) > 0 { - d.Set("name", resp.AssessmentTemplates[0].Name) - } - return nil -} - -func resourceAwsInspectorAssessmentTemplateDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - _, err := conn.DeleteAssessmentTemplate(&inspector.DeleteAssessmentTemplateInput{ - AssessmentTemplateArn: aws.String(d.Id()), - }) - if err != nil { - if inspectorerr, ok := err.(awserr.Error); ok && inspectorerr.Code() == "AssessmentRunInProgressException" { - log.Printf("[ERROR] Assement Run in progress: %s", err) - return err - } else { - log.Printf("[ERROR] Error deleting Assement Template: %s", err) - return err - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_resource_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_resource_group.go deleted file mode 100644 index 55f5669..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_inspector_resource_group.go +++ /dev/null @@ -1,76 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/inspector" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAWSInspectorResourceGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsInspectorResourceGroupCreate, - Read: resourceAwsInspectorResourceGroupRead, - Delete: resourceAwsInspectorResourceGroupDelete, - - Schema: map[string]*schema.Schema{ - "tags": &schema.Schema{ - ForceNew: true, - Type: schema.TypeMap, - Required: true, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsInspectorResourceGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - resp, err := conn.CreateResourceGroup(&inspector.CreateResourceGroupInput{ - ResourceGroupTags: tagsFromMapInspector(d.Get("tags").(map[string]interface{})), - }) - - if err != nil { - return err - } - - d.Set("arn", *resp.ResourceGroupArn) - - d.SetId(*resp.ResourceGroupArn) - - return resourceAwsInspectorResourceGroupRead(d, meta) -} - -func resourceAwsInspectorResourceGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).inspectorconn - - _, err := conn.DescribeResourceGroups(&inspector.DescribeResourceGroupsInput{ - ResourceGroupArns: []*string{ - aws.String(d.Id()), - }, - }) - - if err != nil { - if inspectorerr, ok := err.(awserr.Error); ok && inspectorerr.Code() == "InvalidInputException" { - return nil - } else { - log.Printf("[ERROR] Error finding Inspector resource group: %s", err) - return err - } - } - - return nil -} - -func resourceAwsInspectorResourceGroupDelete(d *schema.ResourceData, meta interface{}) error { - d.Set("arn", "") - d.SetId("") - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_instance.go deleted file mode 100644 index e31baf5..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_instance.go +++ /dev/null @@ -1,1374 +0,0 @@ -package aws - -import ( - "bytes" - "crypto/sha1" - "encoding/base64" - "encoding/hex" - "errors" - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsInstanceCreate, - Read: resourceAwsInstanceRead, - Update: resourceAwsInstanceUpdate, - Delete: resourceAwsInstanceDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - SchemaVersion: 1, - MigrateState: resourceAwsInstanceMigrateState, - - Schema: map[string]*schema.Schema{ - "ami": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "associate_public_ip_address": { - Type: schema.TypeBool, - ForceNew: true, - Computed: true, - Optional: true, - }, - - "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "placement_group": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "instance_type": { - Type: schema.TypeString, - Required: true, - }, - - "key_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "subnet_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "private_ip": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "source_dest_check": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "user_data": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - StateFunc: func(v interface{}) string { - switch v.(type) { - case string: - return userDataHashSum(v.(string)) - default: - return "" - } - }, - }, - - "security_groups": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "vpc_security_group_ids": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "public_dns": { - Type: schema.TypeString, - Computed: true, - }, - - "network_interface_id": { - Type: schema.TypeString, - Computed: true, - }, - - "public_ip": { - Type: schema.TypeString, - Computed: true, - }, - - "instance_state": { - Type: schema.TypeString, - Computed: true, - }, - - "private_dns": { - Type: schema.TypeString, - Computed: true, - }, - - "ebs_optimized": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - }, - - "disable_api_termination": { - Type: schema.TypeBool, - Optional: true, - }, - - "instance_initiated_shutdown_behavior": { - Type: schema.TypeString, - Optional: true, - }, - - "monitoring": { - Type: schema.TypeBool, - Optional: true, - }, - - "iam_instance_profile": { - Type: schema.TypeString, - Optional: true, - }, - - "ipv6_address_count": { - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - }, - - "ipv6_addresses": { - Type: schema.TypeList, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - ConflictsWith: []string{"ipv6_address_count"}, - }, - - "tenancy": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "tags": tagsSchema(), - - "block_device": { - Type: schema.TypeMap, - Optional: true, - Removed: "Split out into three sub-types; see Changelog and Docs", - }, - - "ebs_block_device": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - }, - - "device_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "encrypted": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "iops": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "snapshot_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["snapshot_id"].(string))) - return hashcode.String(buf.String()) - }, - }, - - "ephemeral_block_device": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "device_name": { - Type: schema.TypeString, - Required: true, - }, - - "virtual_name": { - Type: schema.TypeString, - Optional: true, - }, - - "no_device": { - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["virtual_name"].(string))) - if v, ok := m["no_device"].(bool); ok && v { - buf.WriteString(fmt.Sprintf("%t-", v)) - } - return hashcode.String(buf.String()) - }, - }, - - "root_block_device": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - // "You can only modify the volume size, volume type, and Delete on - // Termination flag on the block device mapping entry for the root - // device volume." - bit.ly/ec2bdmap - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - }, - - "iops": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - instanceOpts, err := buildAwsInstanceOpts(d, meta) - if err != nil { - return err - } - - // Build the creation struct - runOpts := &ec2.RunInstancesInput{ - BlockDeviceMappings: instanceOpts.BlockDeviceMappings, - DisableApiTermination: instanceOpts.DisableAPITermination, - EbsOptimized: instanceOpts.EBSOptimized, - Monitoring: instanceOpts.Monitoring, - IamInstanceProfile: instanceOpts.IAMInstanceProfile, - ImageId: instanceOpts.ImageID, - InstanceInitiatedShutdownBehavior: instanceOpts.InstanceInitiatedShutdownBehavior, - InstanceType: instanceOpts.InstanceType, - KeyName: instanceOpts.KeyName, - MaxCount: aws.Int64(int64(1)), - MinCount: aws.Int64(int64(1)), - NetworkInterfaces: instanceOpts.NetworkInterfaces, - Placement: instanceOpts.Placement, - PrivateIpAddress: instanceOpts.PrivateIPAddress, - SecurityGroupIds: instanceOpts.SecurityGroupIDs, - SecurityGroups: instanceOpts.SecurityGroups, - SubnetId: instanceOpts.SubnetID, - UserData: instanceOpts.UserData64, - } - - if v, ok := d.GetOk("ipv6_address_count"); ok { - runOpts.Ipv6AddressCount = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("ipv6_addresses"); ok { - ipv6Addresses := make([]*ec2.InstanceIpv6Address, len(v.([]interface{}))) - for _, address := range v.([]interface{}) { - ipv6Address := &ec2.InstanceIpv6Address{ - Ipv6Address: aws.String(address.(string)), - } - - ipv6Addresses = append(ipv6Addresses, ipv6Address) - } - - runOpts.Ipv6Addresses = ipv6Addresses - } - - // Create the instance - log.Printf("[DEBUG] Run configuration: %s", runOpts) - - var runResp *ec2.Reservation - err = resource.Retry(15*time.Second, func() *resource.RetryError { - var err error - runResp, err = conn.RunInstances(runOpts) - // IAM instance profiles can take ~10 seconds to propagate in AWS: - // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console - if isAWSErr(err, "InvalidParameterValue", "Invalid IAM Instance Profile") { - log.Print("[DEBUG] Invalid IAM Instance Profile referenced, retrying...") - return resource.RetryableError(err) - } - // IAM roles can also take time to propagate in AWS: - if isAWSErr(err, "InvalidParameterValue", " has no associated IAM Roles") { - log.Print("[DEBUG] IAM Instance Profile appears to have no IAM roles, retrying...") - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - }) - // Warn if the AWS Error involves group ids, to help identify situation - // where a user uses group ids in security_groups for the Default VPC. - // See https://github.com/hashicorp/terraform/issues/3798 - if isAWSErr(err, "InvalidParameterValue", "groupId is invalid") { - return fmt.Errorf("Error launching instance, possible mismatch of Security Group IDs and Names. See AWS Instance docs here: %s.\n\n\tAWS Error: %s", "https://terraform.io/docs/providers/aws/r/instance.html", err.(awserr.Error).Message()) - } - if err != nil { - return fmt.Errorf("Error launching source instance: %s", err) - } - if runResp == nil || len(runResp.Instances) == 0 { - return errors.New("Error launching source instance: no instances returned in response") - } - - instance := runResp.Instances[0] - log.Printf("[INFO] Instance ID: %s", *instance.InstanceId) - - // Store the resulting ID so we can look this up later - d.SetId(*instance.InstanceId) - - // Wait for the instance to become running so we can get some attributes - // that aren't available until later. - log.Printf( - "[DEBUG] Waiting for instance (%s) to become running", - *instance.InstanceId) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"running"}, - Refresh: InstanceStateRefreshFunc(conn, *instance.InstanceId), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - instanceRaw, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for instance (%s) to become ready: %s", - *instance.InstanceId, err) - } - - instance = instanceRaw.(*ec2.Instance) - - // Initialize the connection info - if instance.PublicIpAddress != nil { - d.SetConnInfo(map[string]string{ - "type": "ssh", - "host": *instance.PublicIpAddress, - }) - } else if instance.PrivateIpAddress != nil { - d.SetConnInfo(map[string]string{ - "type": "ssh", - "host": *instance.PrivateIpAddress, - }) - } - - // Update if we need to - return resourceAwsInstanceUpdate(d, meta) -} - -func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeInstances(&ec2.DescribeInstancesInput{ - InstanceIds: []*string{aws.String(d.Id())}, - }) - if err != nil { - // If the instance was not found, return nil so that we can show - // that the instance is gone. - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidInstanceID.NotFound" { - d.SetId("") - return nil - } - - // Some other error, report it - return err - } - - // If nothing was found, then return no state - if len(resp.Reservations) == 0 { - d.SetId("") - return nil - } - - instance := resp.Reservations[0].Instances[0] - - if instance.State != nil { - // If the instance is terminated, then it is gone - if *instance.State.Name == "terminated" { - d.SetId("") - return nil - } - - d.Set("instance_state", instance.State.Name) - } - - if instance.Placement != nil { - d.Set("availability_zone", instance.Placement.AvailabilityZone) - } - if instance.Placement.Tenancy != nil { - d.Set("tenancy", instance.Placement.Tenancy) - } - - d.Set("ami", instance.ImageId) - d.Set("instance_type", instance.InstanceType) - d.Set("key_name", instance.KeyName) - d.Set("public_dns", instance.PublicDnsName) - d.Set("public_ip", instance.PublicIpAddress) - d.Set("private_dns", instance.PrivateDnsName) - d.Set("private_ip", instance.PrivateIpAddress) - d.Set("iam_instance_profile", iamInstanceProfileArnToName(instance.IamInstanceProfile)) - - var ipv6Addresses []string - if len(instance.NetworkInterfaces) > 0 { - for _, ni := range instance.NetworkInterfaces { - if *ni.Attachment.DeviceIndex == 0 { - d.Set("subnet_id", ni.SubnetId) - d.Set("network_interface_id", ni.NetworkInterfaceId) - d.Set("associate_public_ip_address", ni.Association != nil) - d.Set("ipv6_address_count", len(ni.Ipv6Addresses)) - - for _, address := range ni.Ipv6Addresses { - ipv6Addresses = append(ipv6Addresses, *address.Ipv6Address) - } - } - } - } else { - d.Set("subnet_id", instance.SubnetId) - d.Set("network_interface_id", "") - } - - if err := d.Set("ipv6_addresses", ipv6Addresses); err != nil { - log.Printf("[WARN] Error setting ipv6_addresses for AWS Instance (%s): %s", d.Id(), err) - } - - d.Set("ebs_optimized", instance.EbsOptimized) - if instance.SubnetId != nil && *instance.SubnetId != "" { - d.Set("source_dest_check", instance.SourceDestCheck) - } - - if instance.Monitoring != nil && instance.Monitoring.State != nil { - monitoringState := *instance.Monitoring.State - d.Set("monitoring", monitoringState == "enabled" || monitoringState == "pending") - } - - d.Set("tags", tagsToMap(instance.Tags)) - - if err := readSecurityGroups(d, instance); err != nil { - return err - } - - if err := readBlockDevices(d, instance, conn); err != nil { - return err - } - if _, ok := d.GetOk("ephemeral_block_device"); !ok { - d.Set("ephemeral_block_device", []interface{}{}) - } - - // Instance attributes - { - attr, err := conn.DescribeInstanceAttribute(&ec2.DescribeInstanceAttributeInput{ - Attribute: aws.String("disableApiTermination"), - InstanceId: aws.String(d.Id()), - }) - if err != nil { - return err - } - d.Set("disable_api_termination", attr.DisableApiTermination.Value) - } - { - attr, err := conn.DescribeInstanceAttribute(&ec2.DescribeInstanceAttributeInput{ - Attribute: aws.String(ec2.InstanceAttributeNameUserData), - InstanceId: aws.String(d.Id()), - }) - if err != nil { - return err - } - if attr.UserData.Value != nil { - d.Set("user_data", userDataHashSum(*attr.UserData.Value)) - } - } - - return nil -} - -func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - d.Partial(true) - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - if d.HasChange("iam_instance_profile") { - request := &ec2.DescribeIamInstanceProfileAssociationsInput{ - Filters: []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("instance-id"), - Values: []*string{aws.String(d.Id())}, - }, - }, - } - - resp, err := conn.DescribeIamInstanceProfileAssociations(request) - if err != nil { - return err - } - - // An Iam Instance Profile has been provided and is pending a change - // This means it is an association or a replacement to an association - if _, ok := d.GetOk("iam_instance_profile"); ok { - // Does not have an Iam Instance Profile associated with it, need to associate - if len(resp.IamInstanceProfileAssociations) == 0 { - _, err := conn.AssociateIamInstanceProfile(&ec2.AssociateIamInstanceProfileInput{ - InstanceId: aws.String(d.Id()), - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ - Name: aws.String(d.Get("iam_instance_profile").(string)), - }, - }) - if err != nil { - return err - } - - } else { - // Has an Iam Instance Profile associated with it, need to replace the association - associationId := resp.IamInstanceProfileAssociations[0].AssociationId - - _, err := conn.ReplaceIamInstanceProfileAssociation(&ec2.ReplaceIamInstanceProfileAssociationInput{ - AssociationId: associationId, - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ - Name: aws.String(d.Get("iam_instance_profile").(string)), - }, - }) - if err != nil { - return err - } - } - // An Iam Instance Profile has _not_ been provided but is pending a change. This means there is a pending removal - } else { - if len(resp.IamInstanceProfileAssociations) > 0 { - // Has an Iam Instance Profile associated with it, need to remove the association - associationId := resp.IamInstanceProfileAssociations[0].AssociationId - - _, err := conn.DisassociateIamInstanceProfile(&ec2.DisassociateIamInstanceProfileInput{ - AssociationId: associationId, - }) - if err != nil { - return err - } - } - } - } - - if d.HasChange("source_dest_check") || d.IsNewResource() { - // SourceDestCheck can only be set on VPC instances // AWS will return an error of InvalidParameterCombination if we attempt - // to modify the source_dest_check of an instance in EC2 Classic - log.Printf("[INFO] Modifying `source_dest_check` on Instance %s", d.Id()) - _, err := conn.ModifyInstanceAttribute(&ec2.ModifyInstanceAttributeInput{ - InstanceId: aws.String(d.Id()), - SourceDestCheck: &ec2.AttributeBooleanValue{ - Value: aws.Bool(d.Get("source_dest_check").(bool)), - }, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - // Toloerate InvalidParameterCombination error in Classic, otherwise - // return the error - if "InvalidParameterCombination" != ec2err.Code() { - return err - } - log.Printf("[WARN] Attempted to modify SourceDestCheck on non VPC instance: %s", ec2err.Message()) - } - } - } - - if d.HasChange("vpc_security_group_ids") { - var groups []*string - if v := d.Get("vpc_security_group_ids").(*schema.Set); v.Len() > 0 { - for _, v := range v.List() { - groups = append(groups, aws.String(v.(string))) - } - } - _, err := conn.ModifyInstanceAttribute(&ec2.ModifyInstanceAttributeInput{ - InstanceId: aws.String(d.Id()), - Groups: groups, - }) - if err != nil { - return err - } - } - - if d.HasChange("instance_type") && !d.IsNewResource() { - log.Printf("[INFO] Stopping Instance %q for instance_type change", d.Id()) - _, err := conn.StopInstances(&ec2.StopInstancesInput{ - InstanceIds: []*string{aws.String(d.Id())}, - }) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending", "running", "shutting-down", "stopped", "stopping"}, - Target: []string{"stopped"}, - Refresh: InstanceStateRefreshFunc(conn, d.Id()), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for instance (%s) to stop: %s", d.Id(), err) - } - - log.Printf("[INFO] Modifying instance type %s", d.Id()) - _, err = conn.ModifyInstanceAttribute(&ec2.ModifyInstanceAttributeInput{ - InstanceId: aws.String(d.Id()), - InstanceType: &ec2.AttributeValue{ - Value: aws.String(d.Get("instance_type").(string)), - }, - }) - if err != nil { - return err - } - - log.Printf("[INFO] Starting Instance %q after instance_type change", d.Id()) - _, err = conn.StartInstances(&ec2.StartInstancesInput{ - InstanceIds: []*string{aws.String(d.Id())}, - }) - - stateConf = &resource.StateChangeConf{ - Pending: []string{"pending", "stopped"}, - Target: []string{"running"}, - Refresh: InstanceStateRefreshFunc(conn, d.Id()), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for instance (%s) to become ready: %s", - d.Id(), err) - } - } - - if d.HasChange("disable_api_termination") { - _, err := conn.ModifyInstanceAttribute(&ec2.ModifyInstanceAttributeInput{ - InstanceId: aws.String(d.Id()), - DisableApiTermination: &ec2.AttributeBooleanValue{ - Value: aws.Bool(d.Get("disable_api_termination").(bool)), - }, - }) - if err != nil { - return err - } - } - - if d.HasChange("instance_initiated_shutdown_behavior") { - log.Printf("[INFO] Modifying instance %s", d.Id()) - _, err := conn.ModifyInstanceAttribute(&ec2.ModifyInstanceAttributeInput{ - InstanceId: aws.String(d.Id()), - InstanceInitiatedShutdownBehavior: &ec2.AttributeValue{ - Value: aws.String(d.Get("instance_initiated_shutdown_behavior").(string)), - }, - }) - if err != nil { - return err - } - } - - if d.HasChange("monitoring") { - var mErr error - if d.Get("monitoring").(bool) { - log.Printf("[DEBUG] Enabling monitoring for Instance (%s)", d.Id()) - _, mErr = conn.MonitorInstances(&ec2.MonitorInstancesInput{ - InstanceIds: []*string{aws.String(d.Id())}, - }) - } else { - log.Printf("[DEBUG] Disabling monitoring for Instance (%s)", d.Id()) - _, mErr = conn.UnmonitorInstances(&ec2.UnmonitorInstancesInput{ - InstanceIds: []*string{aws.String(d.Id())}, - }) - } - if mErr != nil { - return fmt.Errorf("[WARN] Error updating Instance monitoring: %s", mErr) - } - } - - // TODO(mitchellh): wait for the attributes we modified to - // persist the change... - - d.Partial(false) - - return resourceAwsInstanceRead(d, meta) -} - -func resourceAwsInstanceDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - if err := awsTerminateInstance(conn, d.Id()); err != nil { - return err - } - - d.SetId("") - return nil -} - -// InstanceStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// an EC2 instance. -func InstanceStateRefreshFunc(conn *ec2.EC2, instanceID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeInstances(&ec2.DescribeInstancesInput{ - InstanceIds: []*string{aws.String(instanceID)}, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidInstanceID.NotFound" { - // Set this to nil as if we didn't find anything. - resp = nil - } else { - log.Printf("Error on InstanceStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil || len(resp.Reservations) == 0 || len(resp.Reservations[0].Instances) == 0 { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - i := resp.Reservations[0].Instances[0] - return i, *i.State.Name, nil - } -} - -func readBlockDevices(d *schema.ResourceData, instance *ec2.Instance, conn *ec2.EC2) error { - ibds, err := readBlockDevicesFromInstance(instance, conn) - if err != nil { - return err - } - - if err := d.Set("ebs_block_device", ibds["ebs"]); err != nil { - return err - } - - // This handles the import case which needs to be defaulted to empty - if _, ok := d.GetOk("root_block_device"); !ok { - if err := d.Set("root_block_device", []interface{}{}); err != nil { - return err - } - } - - if ibds["root"] != nil { - roots := []interface{}{ibds["root"]} - if err := d.Set("root_block_device", roots); err != nil { - return err - } - } - - return nil -} - -func readBlockDevicesFromInstance(instance *ec2.Instance, conn *ec2.EC2) (map[string]interface{}, error) { - blockDevices := make(map[string]interface{}) - blockDevices["ebs"] = make([]map[string]interface{}, 0) - blockDevices["root"] = nil - - instanceBlockDevices := make(map[string]*ec2.InstanceBlockDeviceMapping) - for _, bd := range instance.BlockDeviceMappings { - if bd.Ebs != nil { - instanceBlockDevices[*bd.Ebs.VolumeId] = bd - } - } - - if len(instanceBlockDevices) == 0 { - return nil, nil - } - - volIDs := make([]*string, 0, len(instanceBlockDevices)) - for volID := range instanceBlockDevices { - volIDs = append(volIDs, aws.String(volID)) - } - - // Need to call DescribeVolumes to get volume_size and volume_type for each - // EBS block device - volResp, err := conn.DescribeVolumes(&ec2.DescribeVolumesInput{ - VolumeIds: volIDs, - }) - if err != nil { - return nil, err - } - - for _, vol := range volResp.Volumes { - instanceBd := instanceBlockDevices[*vol.VolumeId] - bd := make(map[string]interface{}) - - if instanceBd.Ebs != nil && instanceBd.Ebs.DeleteOnTermination != nil { - bd["delete_on_termination"] = *instanceBd.Ebs.DeleteOnTermination - } - if vol.Size != nil { - bd["volume_size"] = *vol.Size - } - if vol.VolumeType != nil { - bd["volume_type"] = *vol.VolumeType - } - if vol.Iops != nil { - bd["iops"] = *vol.Iops - } - - if blockDeviceIsRoot(instanceBd, instance) { - blockDevices["root"] = bd - } else { - if instanceBd.DeviceName != nil { - bd["device_name"] = *instanceBd.DeviceName - } - if vol.Encrypted != nil { - bd["encrypted"] = *vol.Encrypted - } - if vol.SnapshotId != nil { - bd["snapshot_id"] = *vol.SnapshotId - } - - blockDevices["ebs"] = append(blockDevices["ebs"].([]map[string]interface{}), bd) - } - } - - return blockDevices, nil -} - -func blockDeviceIsRoot(bd *ec2.InstanceBlockDeviceMapping, instance *ec2.Instance) bool { - return bd.DeviceName != nil && - instance.RootDeviceName != nil && - *bd.DeviceName == *instance.RootDeviceName -} - -func fetchRootDeviceName(ami string, conn *ec2.EC2) (*string, error) { - if ami == "" { - return nil, errors.New("Cannot fetch root device name for blank AMI ID.") - } - - log.Printf("[DEBUG] Describing AMI %q to get root block device name", ami) - res, err := conn.DescribeImages(&ec2.DescribeImagesInput{ - ImageIds: []*string{aws.String(ami)}, - }) - if err != nil { - return nil, err - } - - // For a bad image, we just return nil so we don't block a refresh - if len(res.Images) == 0 { - return nil, nil - } - - image := res.Images[0] - rootDeviceName := image.RootDeviceName - - // Instance store backed AMIs do not provide a root device name. - if *image.RootDeviceType == ec2.DeviceTypeInstanceStore { - return nil, nil - } - - // Some AMIs have a RootDeviceName like "/dev/sda1" that does not appear as a - // DeviceName in the BlockDeviceMapping list (which will instead have - // something like "/dev/sda") - // - // While this seems like it breaks an invariant of AMIs, it ends up working - // on the AWS side, and AMIs like this are common enough that we need to - // special case it so Terraform does the right thing. - // - // Our heuristic is: if the RootDeviceName does not appear in the - // BlockDeviceMapping, assume that the DeviceName of the first - // BlockDeviceMapping entry serves as the root device. - rootDeviceNameInMapping := false - for _, bdm := range image.BlockDeviceMappings { - if bdm.DeviceName == image.RootDeviceName { - rootDeviceNameInMapping = true - } - } - - if !rootDeviceNameInMapping && len(image.BlockDeviceMappings) > 0 { - rootDeviceName = image.BlockDeviceMappings[0].DeviceName - } - - if rootDeviceName == nil { - return nil, fmt.Errorf("[WARN] Error finding Root Device Name for AMI (%s)", ami) - } - - return rootDeviceName, nil -} - -func readBlockDeviceMappingsFromConfig( - d *schema.ResourceData, conn *ec2.EC2) ([]*ec2.BlockDeviceMapping, error) { - blockDevices := make([]*ec2.BlockDeviceMapping, 0) - - if v, ok := d.GetOk("ebs_block_device"); ok { - vL := v.(*schema.Set).List() - for _, v := range vL { - bd := v.(map[string]interface{}) - ebs := &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)), - } - - if v, ok := bd["snapshot_id"].(string); ok && v != "" { - ebs.SnapshotId = aws.String(v) - } - - if v, ok := bd["encrypted"].(bool); ok && v { - ebs.Encrypted = aws.Bool(v) - } - - if v, ok := bd["volume_size"].(int); ok && v != 0 { - ebs.VolumeSize = aws.Int64(int64(v)) - } - - if v, ok := bd["volume_type"].(string); ok && v != "" { - ebs.VolumeType = aws.String(v) - if "io1" == strings.ToLower(v) { - // 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. - // See: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html - if v, ok := bd["iops"].(int); ok && v > 0 { - ebs.Iops = aws.Int64(int64(v)) - } - } - } - - blockDevices = append(blockDevices, &ec2.BlockDeviceMapping{ - DeviceName: aws.String(bd["device_name"].(string)), - Ebs: ebs, - }) - } - } - - if v, ok := d.GetOk("ephemeral_block_device"); ok { - vL := v.(*schema.Set).List() - for _, v := range vL { - bd := v.(map[string]interface{}) - bdm := &ec2.BlockDeviceMapping{ - DeviceName: aws.String(bd["device_name"].(string)), - VirtualName: aws.String(bd["virtual_name"].(string)), - } - if v, ok := bd["no_device"].(bool); ok && v { - bdm.NoDevice = aws.String("") - // When NoDevice is true, just ignore VirtualName since it's not needed - bdm.VirtualName = nil - } - - if bdm.NoDevice == nil && aws.StringValue(bdm.VirtualName) == "" { - return nil, errors.New("virtual_name cannot be empty when no_device is false or undefined.") - } - - blockDevices = append(blockDevices, bdm) - } - } - - if v, ok := d.GetOk("root_block_device"); ok { - vL := v.([]interface{}) - if len(vL) > 1 { - return nil, errors.New("Cannot specify more than one root_block_device.") - } - for _, v := range vL { - bd := v.(map[string]interface{}) - ebs := &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)), - } - - if v, ok := bd["volume_size"].(int); ok && v != 0 { - ebs.VolumeSize = aws.Int64(int64(v)) - } - - if v, ok := bd["volume_type"].(string); ok && v != "" { - ebs.VolumeType = aws.String(v) - } - - if v, ok := bd["iops"].(int); ok && v > 0 && *ebs.VolumeType == "io1" { - // Only set the iops attribute if the volume type is io1. Setting otherwise - // can trigger a refresh/plan loop based on the computed value that is given - // from AWS, and prevent us from specifying 0 as a valid iops. - // See https://github.com/hashicorp/terraform/pull/4146 - // See https://github.com/hashicorp/terraform/issues/7765 - ebs.Iops = aws.Int64(int64(v)) - } else if v, ok := bd["iops"].(int); ok && v > 0 && *ebs.VolumeType != "io1" { - // Message user about incompatibility - log.Print("[WARN] IOPs is only valid for storate type io1 for EBS Volumes") - } - - if dn, err := fetchRootDeviceName(d.Get("ami").(string), conn); err == nil { - if dn == nil { - return nil, fmt.Errorf( - "Expected 1 AMI for ID: %s, got none", - d.Get("ami").(string)) - } - - blockDevices = append(blockDevices, &ec2.BlockDeviceMapping{ - DeviceName: dn, - Ebs: ebs, - }) - } else { - return nil, err - } - } - } - - return blockDevices, nil -} - -// Determine whether we're referring to security groups with -// IDs or names. We use a heuristic to figure this out. By default, -// we use IDs if we're in a VPC. However, if we previously had an -// all-name list of security groups, we use names. Or, if we had any -// IDs, we use IDs. -func readSecurityGroups(d *schema.ResourceData, instance *ec2.Instance) error { - useID := instance.SubnetId != nil && *instance.SubnetId != "" - if v := d.Get("security_groups"); v != nil { - match := useID - sgs := v.(*schema.Set).List() - if len(sgs) > 0 { - match = false - for _, v := range v.(*schema.Set).List() { - if strings.HasPrefix(v.(string), "sg-") { - match = true - break - } - } - } - - useID = match - } - - // Build up the security groups - sgs := make([]string, 0, len(instance.SecurityGroups)) - if useID { - for _, sg := range instance.SecurityGroups { - sgs = append(sgs, *sg.GroupId) - } - log.Printf("[DEBUG] Setting Security Group IDs: %#v", sgs) - if err := d.Set("vpc_security_group_ids", sgs); err != nil { - return err - } - if err := d.Set("security_groups", []string{}); err != nil { - return err - } - } else { - for _, sg := range instance.SecurityGroups { - sgs = append(sgs, *sg.GroupName) - } - log.Printf("[DEBUG] Setting Security Group Names: %#v", sgs) - if err := d.Set("security_groups", sgs); err != nil { - return err - } - if err := d.Set("vpc_security_group_ids", []string{}); err != nil { - return err - } - } - return nil -} - -type awsInstanceOpts struct { - BlockDeviceMappings []*ec2.BlockDeviceMapping - DisableAPITermination *bool - EBSOptimized *bool - Monitoring *ec2.RunInstancesMonitoringEnabled - IAMInstanceProfile *ec2.IamInstanceProfileSpecification - ImageID *string - InstanceInitiatedShutdownBehavior *string - InstanceType *string - KeyName *string - NetworkInterfaces []*ec2.InstanceNetworkInterfaceSpecification - Placement *ec2.Placement - PrivateIPAddress *string - SecurityGroupIDs []*string - SecurityGroups []*string - SpotPlacement *ec2.SpotPlacement - SubnetID *string - UserData64 *string -} - -func buildAwsInstanceOpts( - d *schema.ResourceData, meta interface{}) (*awsInstanceOpts, error) { - conn := meta.(*AWSClient).ec2conn - - opts := &awsInstanceOpts{ - DisableAPITermination: aws.Bool(d.Get("disable_api_termination").(bool)), - EBSOptimized: aws.Bool(d.Get("ebs_optimized").(bool)), - ImageID: aws.String(d.Get("ami").(string)), - InstanceType: aws.String(d.Get("instance_type").(string)), - } - - if v := d.Get("instance_initiated_shutdown_behavior").(string); v != "" { - opts.InstanceInitiatedShutdownBehavior = aws.String(v) - } - - opts.Monitoring = &ec2.RunInstancesMonitoringEnabled{ - Enabled: aws.Bool(d.Get("monitoring").(bool)), - } - - opts.IAMInstanceProfile = &ec2.IamInstanceProfileSpecification{ - Name: aws.String(d.Get("iam_instance_profile").(string)), - } - - user_data := d.Get("user_data").(string) - - opts.UserData64 = aws.String(base64Encode([]byte(user_data))) - - // check for non-default Subnet, and cast it to a String - subnet, hasSubnet := d.GetOk("subnet_id") - subnetID := subnet.(string) - - // Placement is used for aws_instance; SpotPlacement is used for - // aws_spot_instance_request. They represent the same data. :-| - opts.Placement = &ec2.Placement{ - AvailabilityZone: aws.String(d.Get("availability_zone").(string)), - GroupName: aws.String(d.Get("placement_group").(string)), - } - - opts.SpotPlacement = &ec2.SpotPlacement{ - AvailabilityZone: aws.String(d.Get("availability_zone").(string)), - GroupName: aws.String(d.Get("placement_group").(string)), - } - - if v := d.Get("tenancy").(string); v != "" { - opts.Placement.Tenancy = aws.String(v) - } - - associatePublicIPAddress := d.Get("associate_public_ip_address").(bool) - - var groups []*string - if v := d.Get("security_groups"); v != nil { - // Security group names. - // For a nondefault VPC, you must use security group IDs instead. - // See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - sgs := v.(*schema.Set).List() - if len(sgs) > 0 && hasSubnet { - log.Print("[WARN] Deprecated. Attempting to use 'security_groups' within a VPC instance. Use 'vpc_security_group_ids' instead.") - } - for _, v := range sgs { - str := v.(string) - groups = append(groups, aws.String(str)) - } - } - - if hasSubnet && associatePublicIPAddress { - // If we have a non-default VPC / Subnet specified, we can flag - // AssociatePublicIpAddress to get a Public IP assigned. By default these are not provided. - // You cannot specify both SubnetId and the NetworkInterface.0.* parameters though, otherwise - // you get: Network interfaces and an instance-level subnet ID may not be specified on the same request - // You also need to attach Security Groups to the NetworkInterface instead of the instance, - // to avoid: Network interfaces and an instance-level security groups may not be specified on - // the same request - ni := &ec2.InstanceNetworkInterfaceSpecification{ - AssociatePublicIpAddress: aws.Bool(associatePublicIPAddress), - DeviceIndex: aws.Int64(int64(0)), - SubnetId: aws.String(subnetID), - Groups: groups, - } - - if v, ok := d.GetOk("private_ip"); ok { - ni.PrivateIpAddress = aws.String(v.(string)) - } - - if v := d.Get("vpc_security_group_ids").(*schema.Set); v.Len() > 0 { - for _, v := range v.List() { - ni.Groups = append(ni.Groups, aws.String(v.(string))) - } - } - - opts.NetworkInterfaces = []*ec2.InstanceNetworkInterfaceSpecification{ni} - } else { - if subnetID != "" { - opts.SubnetID = aws.String(subnetID) - } - - if v, ok := d.GetOk("private_ip"); ok { - opts.PrivateIPAddress = aws.String(v.(string)) - } - if opts.SubnetID != nil && - *opts.SubnetID != "" { - opts.SecurityGroupIDs = groups - } else { - opts.SecurityGroups = groups - } - - if v := d.Get("vpc_security_group_ids").(*schema.Set); v.Len() > 0 { - for _, v := range v.List() { - opts.SecurityGroupIDs = append(opts.SecurityGroupIDs, aws.String(v.(string))) - } - } - } - - if v, ok := d.GetOk("key_name"); ok { - opts.KeyName = aws.String(v.(string)) - } - - blockDevices, err := readBlockDeviceMappingsFromConfig(d, conn) - if err != nil { - return nil, err - } - if len(blockDevices) > 0 { - opts.BlockDeviceMappings = blockDevices - } - - return opts, nil -} - -func awsTerminateInstance(conn *ec2.EC2, id string) error { - log.Printf("[INFO] Terminating instance: %s", id) - req := &ec2.TerminateInstancesInput{ - InstanceIds: []*string{aws.String(id)}, - } - if _, err := conn.TerminateInstances(req); err != nil { - return fmt.Errorf("Error terminating instance: %s", err) - } - - log.Printf("[DEBUG] Waiting for instance (%s) to become terminated", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending", "running", "shutting-down", "stopped", "stopping"}, - Target: []string{"terminated"}, - Refresh: InstanceStateRefreshFunc(conn, id), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for instance (%s) to terminate: %s", id, err) - } - - return nil -} - -func iamInstanceProfileArnToName(ip *ec2.IamInstanceProfile) string { - if ip == nil || ip.Arn == nil { - return "" - } - parts := strings.Split(*ip.Arn, "/") - return parts[len(parts)-1] -} - -func userDataHashSum(user_data string) string { - // Check whether the user_data is not Base64 encoded. - // Always calculate hash of base64 decoded value since we - // check against double-encoding when setting it - v, base64DecodeError := base64.StdEncoding.DecodeString(user_data) - if base64DecodeError != nil { - v = []byte(user_data) - } - - hash := sha1.Sum(v) - return hex.EncodeToString(hash[:]) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_instance_migrate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_instance_migrate.go deleted file mode 100644 index 28a256b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_instance_migrate.go +++ /dev/null @@ -1,111 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strconv" - "strings" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/terraform" -) - -func resourceAwsInstanceMigrateState( - v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - switch v { - case 0: - log.Println("[INFO] Found AWS Instance State v0; migrating to v1") - return migrateStateV0toV1(is) - default: - return is, fmt.Errorf("Unexpected schema version: %d", v) - } -} - -func migrateStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() || is.Attributes == nil { - log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") - return is, nil - } - - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - - // Delete old count - delete(is.Attributes, "block_device.#") - - oldBds, err := readV0BlockDevices(is) - if err != nil { - return is, err - } - // seed count fields for new types - is.Attributes["ebs_block_device.#"] = "0" - is.Attributes["ephemeral_block_device.#"] = "0" - // depending on if state was v0.3.7 or an earlier version, it might have - // root_block_device defined already - if _, ok := is.Attributes["root_block_device.#"]; !ok { - is.Attributes["root_block_device.#"] = "0" - } - for _, oldBd := range oldBds { - if err := writeV1BlockDevice(is, oldBd); err != nil { - return is, err - } - } - log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) - return is, nil -} - -func readV0BlockDevices(is *terraform.InstanceState) (map[string]map[string]string, error) { - oldBds := make(map[string]map[string]string) - for k, v := range is.Attributes { - if !strings.HasPrefix(k, "block_device.") { - continue - } - path := strings.Split(k, ".") - if len(path) != 3 { - return oldBds, fmt.Errorf("Found unexpected block_device field: %#v", k) - } - hashcode, attribute := path[1], path[2] - oldBd, ok := oldBds[hashcode] - if !ok { - oldBd = make(map[string]string) - oldBds[hashcode] = oldBd - } - oldBd[attribute] = v - delete(is.Attributes, k) - } - return oldBds, nil -} - -func writeV1BlockDevice( - is *terraform.InstanceState, oldBd map[string]string) error { - code := hashcode.String(oldBd["device_name"]) - bdType := "ebs_block_device" - if vn, ok := oldBd["virtual_name"]; ok && strings.HasPrefix(vn, "ephemeral") { - bdType = "ephemeral_block_device" - } else if dn, ok := oldBd["device_name"]; ok && dn == "/dev/sda1" { - bdType = "root_block_device" - } - - switch bdType { - case "ebs_block_device": - delete(oldBd, "virtual_name") - case "root_block_device": - delete(oldBd, "virtual_name") - delete(oldBd, "encrypted") - delete(oldBd, "snapshot_id") - case "ephemeral_block_device": - delete(oldBd, "delete_on_termination") - delete(oldBd, "encrypted") - delete(oldBd, "iops") - delete(oldBd, "volume_size") - delete(oldBd, "volume_type") - } - for attr, val := range oldBd { - attrKey := fmt.Sprintf("%s.%d.%s", bdType, code, attr) - is.Attributes[attrKey] = val - } - - countAttr := fmt.Sprintf("%s.#", bdType) - count, _ := strconv.Atoi(is.Attributes[countAttr]) - is.Attributes[countAttr] = strconv.Itoa(count + 1) - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_internet_gateway.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_internet_gateway.go deleted file mode 100644 index ad0fe57..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_internet_gateway.go +++ /dev/null @@ -1,354 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsInternetGateway() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsInternetGatewayCreate, - Read: resourceAwsInternetGatewayRead, - Update: resourceAwsInternetGatewayUpdate, - Delete: resourceAwsInternetGatewayDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "tags": tagsSchema(), - }, - } -} - -func resourceAwsInternetGatewayCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Create the gateway - log.Printf("[DEBUG] Creating internet gateway") - var err error - resp, err := conn.CreateInternetGateway(nil) - if err != nil { - return fmt.Errorf("Error creating internet gateway: %s", err) - } - - // Get the ID and store it - ig := *resp.InternetGateway - d.SetId(*ig.InternetGatewayId) - log.Printf("[INFO] InternetGateway ID: %s", d.Id()) - - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - igRaw, _, err := IGStateRefreshFunc(conn, d.Id())() - if igRaw != nil { - return nil - } - if err == nil { - return resource.RetryableError(err) - } else { - return resource.NonRetryableError(err) - } - }) - - if err != nil { - return errwrap.Wrapf("{{err}}", err) - } - - err = setTags(conn, d) - if err != nil { - return err - } - - // Attach the new gateway to the correct vpc - return resourceAwsInternetGatewayAttach(d, meta) -} - -func resourceAwsInternetGatewayRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - igRaw, _, err := IGStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - if igRaw == nil { - // Seems we have lost our internet gateway - d.SetId("") - return nil - } - - ig := igRaw.(*ec2.InternetGateway) - if len(ig.Attachments) == 0 { - // Gateway exists but not attached to the VPC - d.Set("vpc_id", "") - } else { - d.Set("vpc_id", ig.Attachments[0].VpcId) - } - - d.Set("tags", tagsToMap(ig.Tags)) - - return nil -} - -func resourceAwsInternetGatewayUpdate(d *schema.ResourceData, meta interface{}) error { - if d.HasChange("vpc_id") { - // If we're already attached, detach it first - if err := resourceAwsInternetGatewayDetach(d, meta); err != nil { - return err - } - - // Attach the gateway to the new vpc - if err := resourceAwsInternetGatewayAttach(d, meta); err != nil { - return err - } - } - - conn := meta.(*AWSClient).ec2conn - - if err := setTags(conn, d); err != nil { - return err - } - - d.SetPartial("tags") - - return nil -} - -func resourceAwsInternetGatewayDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Detach if it is attached - if err := resourceAwsInternetGatewayDetach(d, meta); err != nil { - return err - } - - log.Printf("[INFO] Deleting Internet Gateway: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteInternetGateway(&ec2.DeleteInternetGatewayInput{ - InternetGatewayId: aws.String(d.Id()), - }) - if err == nil { - return nil - } - - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.RetryableError(err) - } - - switch ec2err.Code() { - case "InvalidInternetGatewayID.NotFound": - return nil - case "DependencyViolation": - return resource.RetryableError(err) // retry - } - - return resource.NonRetryableError(err) - }) -} - -func resourceAwsInternetGatewayAttach(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - if d.Get("vpc_id").(string) == "" { - log.Printf( - "[DEBUG] Not attaching Internet Gateway '%s' as no VPC ID is set", - d.Id()) - return nil - } - - log.Printf( - "[INFO] Attaching Internet Gateway '%s' to VPC '%s'", - d.Id(), - d.Get("vpc_id").(string)) - - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - _, err := conn.AttachInternetGateway(&ec2.AttachInternetGatewayInput{ - InternetGatewayId: aws.String(d.Id()), - VpcId: aws.String(d.Get("vpc_id").(string)), - }) - if err == nil { - return nil - } - if ec2err, ok := err.(awserr.Error); ok { - switch ec2err.Code() { - case "InvalidInternetGatewayID.NotFound": - return resource.RetryableError(err) // retry - } - } - return resource.NonRetryableError(err) - }) - if err != nil { - return err - } - - // A note on the states below: the AWS docs (as of July, 2014) say - // that the states would be: attached, attaching, detached, detaching, - // but when running, I noticed that the state is usually "available" when - // it is attached. - - // Wait for it to be fully attached before continuing - log.Printf("[DEBUG] Waiting for internet gateway (%s) to attach", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"detached", "attaching"}, - Target: []string{"available"}, - Refresh: IGAttachStateRefreshFunc(conn, d.Id(), "available"), - Timeout: 4 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for internet gateway (%s) to attach: %s", - d.Id(), err) - } - - return nil -} - -func resourceAwsInternetGatewayDetach(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Get the old VPC ID to detach from - vpcID, _ := d.GetChange("vpc_id") - - if vpcID.(string) == "" { - log.Printf( - "[DEBUG] Not detaching Internet Gateway '%s' as no VPC ID is set", - d.Id()) - return nil - } - - log.Printf( - "[INFO] Detaching Internet Gateway '%s' from VPC '%s'", - d.Id(), - vpcID.(string)) - - // Wait for it to be fully detached before continuing - log.Printf("[DEBUG] Waiting for internet gateway (%s) to detach", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"detaching"}, - Target: []string{"detached"}, - Refresh: detachIGStateRefreshFunc(conn, d.Id(), vpcID.(string)), - Timeout: 15 * time.Minute, - Delay: 10 * time.Second, - NotFoundChecks: 30, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for internet gateway (%s) to detach: %s", - d.Id(), err) - } - - return nil -} - -// InstanceStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// an EC2 instance. -func detachIGStateRefreshFunc(conn *ec2.EC2, gatewayID, vpcID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - _, err := conn.DetachInternetGateway(&ec2.DetachInternetGatewayInput{ - InternetGatewayId: aws.String(gatewayID), - VpcId: aws.String(vpcID), - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - switch ec2err.Code() { - case "InvalidInternetGatewayID.NotFound": - log.Printf("[TRACE] Error detaching Internet Gateway '%s' from VPC '%s': %s", gatewayID, vpcID, err) - return nil, "Not Found", nil - - case "Gateway.NotAttached": - return "detached", "detached", nil - - case "DependencyViolation": - return nil, "detaching", nil - } - } - } - - // DetachInternetGateway only returns an error, so if it's nil, assume we're - // detached - return "detached", "detached", nil - } -} - -// IGStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// an internet gateway. -func IGStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeInternetGateways(&ec2.DescribeInternetGatewaysInput{ - InternetGatewayIds: []*string{aws.String(id)}, - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "InvalidInternetGatewayID.NotFound" { - resp = nil - } else { - log.Printf("[ERROR] Error on IGStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - ig := resp.InternetGateways[0] - return ig, "available", nil - } -} - -// IGAttachStateRefreshFunc returns a resource.StateRefreshFunc that is used -// watch the state of an internet gateway's attachment. -func IGAttachStateRefreshFunc(conn *ec2.EC2, id string, expected string) resource.StateRefreshFunc { - var start time.Time - return func() (interface{}, string, error) { - if start.IsZero() { - start = time.Now() - } - - resp, err := conn.DescribeInternetGateways(&ec2.DescribeInternetGatewaysInput{ - InternetGatewayIds: []*string{aws.String(id)}, - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "InvalidInternetGatewayID.NotFound" { - resp = nil - } else { - log.Printf("[ERROR] Error on IGStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - ig := resp.InternetGateways[0] - - if time.Now().Sub(start) > 10*time.Second { - return ig, expected, nil - } - - if len(ig.Attachments) == 0 { - // No attachments, we're detached - return ig, "detached", nil - } - - return ig, *ig.Attachments[0].State, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_key_pair.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_key_pair.go deleted file mode 100644 index 02050c7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_key_pair.go +++ /dev/null @@ -1,131 +0,0 @@ -package aws - -import ( - "fmt" - "strings" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" -) - -func resourceAwsKeyPair() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsKeyPairCreate, - Read: resourceAwsKeyPairRead, - Update: nil, - Delete: resourceAwsKeyPairDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - SchemaVersion: 1, - MigrateState: resourceAwsKeyPairMigrateState, - - Schema: map[string]*schema.Schema{ - "key_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"key_name_prefix"}, - }, - "key_name_prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 100 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 100 characters, name is limited to 255", k)) - } - return - }, - }, - "public_key": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: func(v interface{}) string { - switch v.(type) { - case string: - return strings.TrimSpace(v.(string)) - default: - return "" - } - }, - }, - "fingerprint": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsKeyPairCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - var keyName string - if v, ok := d.GetOk("key_name"); ok { - keyName = v.(string) - } else if v, ok := d.GetOk("key_name_prefix"); ok { - keyName = resource.PrefixedUniqueId(v.(string)) - d.Set("key_name", keyName) - } else { - keyName = resource.UniqueId() - d.Set("key_name", keyName) - } - - publicKey := d.Get("public_key").(string) - req := &ec2.ImportKeyPairInput{ - KeyName: aws.String(keyName), - PublicKeyMaterial: []byte(publicKey), - } - resp, err := conn.ImportKeyPair(req) - if err != nil { - return fmt.Errorf("Error import KeyPair: %s", err) - } - - d.SetId(*resp.KeyName) - return nil -} - -func resourceAwsKeyPairRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - req := &ec2.DescribeKeyPairsInput{ - KeyNames: []*string{aws.String(d.Id())}, - } - resp, err := conn.DescribeKeyPairs(req) - if err != nil { - awsErr, ok := err.(awserr.Error) - if ok && awsErr.Code() == "InvalidKeyPair.NotFound" { - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving KeyPair: %s", err) - } - - for _, keyPair := range resp.KeyPairs { - if *keyPair.KeyName == d.Id() { - d.Set("key_name", keyPair.KeyName) - d.Set("fingerprint", keyPair.KeyFingerprint) - return nil - } - } - - return fmt.Errorf("Unable to find key pair within: %#v", resp.KeyPairs) -} - -func resourceAwsKeyPairDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - _, err := conn.DeleteKeyPair(&ec2.DeleteKeyPairInput{ - KeyName: aws.String(d.Id()), - }) - return err -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_key_pair_migrate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_key_pair_migrate.go deleted file mode 100644 index c937ac3..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_key_pair_migrate.go +++ /dev/null @@ -1,36 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/hashicorp/terraform/terraform" -) - -func resourceAwsKeyPairMigrateState( - v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - switch v { - case 0: - log.Println("[INFO] Found AWS Key Pair State v0; migrating to v1") - return migrateKeyPairStateV0toV1(is) - default: - return is, fmt.Errorf("Unexpected schema version: %d", v) - } -} - -func migrateKeyPairStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() { - log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") - return is, nil - } - - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - - // replace public_key with a stripped version, removing `\n` from the end - // see https://github.com/hashicorp/terraform/issues/3455 - is.Attributes["public_key"] = strings.TrimSpace(is.Attributes["public_key"]) - - log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) - return is, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream.go deleted file mode 100644 index b82ec56..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream.go +++ /dev/null @@ -1,772 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/firehose" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func cloudWatchLoggingOptionsSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "log_group_name": { - Type: schema.TypeString, - Optional: true, - }, - - "log_stream_name": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - } -} - -func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsKinesisFirehoseDeliveryStreamCreate, - Read: resourceAwsKinesisFirehoseDeliveryStreamRead, - Update: resourceAwsKinesisFirehoseDeliveryStreamUpdate, - Delete: resourceAwsKinesisFirehoseDeliveryStreamDelete, - - SchemaVersion: 1, - MigrateState: resourceAwsKinesisFirehoseMigrateState, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 64 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 64 characters", k)) - } - return - }, - }, - - "destination": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: func(v interface{}) string { - value := v.(string) - return strings.ToLower(value) - }, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "s3" && value != "redshift" && value != "elasticsearch" { - errors = append(errors, fmt.Errorf( - "%q must be one of 's3', 'redshift', 'elasticsearch'", k)) - } - return - }, - }, - - "s3_configuration": { - Type: schema.TypeList, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bucket_arn": { - Type: schema.TypeString, - Required: true, - }, - - "buffer_size": { - Type: schema.TypeInt, - Optional: true, - Default: 5, - }, - - "buffer_interval": { - Type: schema.TypeInt, - Optional: true, - Default: 300, - }, - - "compression_format": { - Type: schema.TypeString, - Optional: true, - Default: "UNCOMPRESSED", - }, - - "kms_key_arn": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateArn, - }, - - "role_arn": { - Type: schema.TypeString, - Required: true, - }, - - "prefix": { - Type: schema.TypeString, - Optional: true, - }, - - "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), - }, - }, - }, - - "redshift_configuration": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cluster_jdbcurl": { - Type: schema.TypeString, - Required: true, - }, - - "username": { - Type: schema.TypeString, - Required: true, - }, - - "password": { - Type: schema.TypeString, - Required: true, - }, - - "role_arn": { - Type: schema.TypeString, - Required: true, - }, - - "retry_duration": { - Type: schema.TypeInt, - Optional: true, - Default: 3600, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 0 || value > 7200 { - errors = append(errors, fmt.Errorf( - "%q must be in the range from 0 to 7200 seconds.", k)) - } - return - }, - }, - - "copy_options": { - Type: schema.TypeString, - Optional: true, - }, - - "data_table_columns": { - Type: schema.TypeString, - Optional: true, - }, - - "data_table_name": { - Type: schema.TypeString, - Required: true, - }, - - "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), - }, - }, - }, - - "elasticsearch_configuration": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "buffering_interval": { - Type: schema.TypeInt, - Optional: true, - Default: 300, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 60 || value > 900 { - errors = append(errors, fmt.Errorf( - "%q must be in the range from 60 to 900 seconds.", k)) - } - return - }, - }, - - "buffering_size": { - Type: schema.TypeInt, - Optional: true, - Default: 5, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 1 || value > 100 { - errors = append(errors, fmt.Errorf( - "%q must be in the range from 1 to 100 MB.", k)) - } - return - }, - }, - - "domain_arn": { - Type: schema.TypeString, - Required: true, - }, - - "index_name": { - Type: schema.TypeString, - Required: true, - }, - - "index_rotation_period": { - Type: schema.TypeString, - Optional: true, - Default: "OneDay", - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "NoRotation" && value != "OneHour" && value != "OneDay" && value != "OneWeek" && value != "OneMonth" { - errors = append(errors, fmt.Errorf( - "%q must be one of 'NoRotation', 'OneHour', 'OneDay', 'OneWeek', 'OneMonth'", k)) - } - return - }, - }, - - "retry_duration": { - Type: schema.TypeInt, - Optional: true, - Default: 300, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 0 || value > 7200 { - errors = append(errors, fmt.Errorf( - "%q must be in the range from 0 to 7200 seconds.", k)) - } - return - }, - }, - - "role_arn": { - Type: schema.TypeString, - Required: true, - }, - - "s3_backup_mode": { - Type: schema.TypeString, - Optional: true, - Default: "FailedDocumentsOnly", - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "FailedDocumentsOnly" && value != "AllDocuments" { - errors = append(errors, fmt.Errorf( - "%q must be one of 'FailedDocumentsOnly', 'AllDocuments'", k)) - } - return - }, - }, - - "type_name": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 100 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 100 characters", k)) - } - return - }, - }, - - "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), - }, - }, - }, - - "arn": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "version_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "destination_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func createS3Config(d *schema.ResourceData) *firehose.S3DestinationConfiguration { - s3 := d.Get("s3_configuration").([]interface{})[0].(map[string]interface{}) - - configuration := &firehose.S3DestinationConfiguration{ - BucketARN: aws.String(s3["bucket_arn"].(string)), - RoleARN: aws.String(s3["role_arn"].(string)), - BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64(int64(s3["buffer_interval"].(int))), - SizeInMBs: aws.Int64(int64(s3["buffer_size"].(int))), - }, - Prefix: extractPrefixConfiguration(s3), - CompressionFormat: aws.String(s3["compression_format"].(string)), - EncryptionConfiguration: extractEncryptionConfiguration(s3), - } - - if _, ok := s3["cloudwatch_logging_options"]; ok { - configuration.CloudWatchLoggingOptions = extractCloudWatchLoggingConfiguration(s3) - } - - return configuration -} - -func updateS3Config(d *schema.ResourceData) *firehose.S3DestinationUpdate { - s3 := d.Get("s3_configuration").([]interface{})[0].(map[string]interface{}) - - configuration := &firehose.S3DestinationUpdate{ - BucketARN: aws.String(s3["bucket_arn"].(string)), - RoleARN: aws.String(s3["role_arn"].(string)), - BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64((int64)(s3["buffer_interval"].(int))), - SizeInMBs: aws.Int64((int64)(s3["buffer_size"].(int))), - }, - Prefix: extractPrefixConfiguration(s3), - CompressionFormat: aws.String(s3["compression_format"].(string)), - EncryptionConfiguration: extractEncryptionConfiguration(s3), - CloudWatchLoggingOptions: extractCloudWatchLoggingConfiguration(s3), - } - - if _, ok := s3["cloudwatch_logging_options"]; ok { - configuration.CloudWatchLoggingOptions = extractCloudWatchLoggingConfiguration(s3) - } - - return configuration -} - -func extractEncryptionConfiguration(s3 map[string]interface{}) *firehose.EncryptionConfiguration { - if key, ok := s3["kms_key_arn"]; ok && len(key.(string)) > 0 { - return &firehose.EncryptionConfiguration{ - KMSEncryptionConfig: &firehose.KMSEncryptionConfig{ - AWSKMSKeyARN: aws.String(key.(string)), - }, - } - } - - return &firehose.EncryptionConfiguration{ - NoEncryptionConfig: aws.String("NoEncryption"), - } -} - -func extractCloudWatchLoggingConfiguration(s3 map[string]interface{}) *firehose.CloudWatchLoggingOptions { - config := s3["cloudwatch_logging_options"].(*schema.Set).List() - if len(config) == 0 { - return nil - } - - loggingConfig := config[0].(map[string]interface{}) - loggingOptions := &firehose.CloudWatchLoggingOptions{ - Enabled: aws.Bool(loggingConfig["enabled"].(bool)), - } - - if v, ok := loggingConfig["log_group_name"]; ok { - loggingOptions.LogGroupName = aws.String(v.(string)) - } - - if v, ok := loggingConfig["log_stream_name"]; ok { - loggingOptions.LogStreamName = aws.String(v.(string)) - } - - return loggingOptions - -} - -func extractPrefixConfiguration(s3 map[string]interface{}) *string { - if v, ok := s3["prefix"]; ok { - return aws.String(v.(string)) - } - - return nil -} - -func createRedshiftConfig(d *schema.ResourceData, s3Config *firehose.S3DestinationConfiguration) (*firehose.RedshiftDestinationConfiguration, error) { - redshiftRaw, ok := d.GetOk("redshift_configuration") - if !ok { - return nil, fmt.Errorf("[ERR] Error loading Redshift Configuration for Kinesis Firehose: redshift_configuration not found") - } - rl := redshiftRaw.([]interface{}) - - redshift := rl[0].(map[string]interface{}) - - configuration := &firehose.RedshiftDestinationConfiguration{ - ClusterJDBCURL: aws.String(redshift["cluster_jdbcurl"].(string)), - RetryOptions: extractRedshiftRetryOptions(redshift), - Password: aws.String(redshift["password"].(string)), - Username: aws.String(redshift["username"].(string)), - RoleARN: aws.String(redshift["role_arn"].(string)), - CopyCommand: extractCopyCommandConfiguration(redshift), - S3Configuration: s3Config, - } - - if _, ok := redshift["cloudwatch_logging_options"]; ok { - configuration.CloudWatchLoggingOptions = extractCloudWatchLoggingConfiguration(redshift) - } - - return configuration, nil -} - -func updateRedshiftConfig(d *schema.ResourceData, s3Update *firehose.S3DestinationUpdate) (*firehose.RedshiftDestinationUpdate, error) { - redshiftRaw, ok := d.GetOk("redshift_configuration") - if !ok { - return nil, fmt.Errorf("[ERR] Error loading Redshift Configuration for Kinesis Firehose: redshift_configuration not found") - } - rl := redshiftRaw.([]interface{}) - - redshift := rl[0].(map[string]interface{}) - - configuration := &firehose.RedshiftDestinationUpdate{ - ClusterJDBCURL: aws.String(redshift["cluster_jdbcurl"].(string)), - RetryOptions: extractRedshiftRetryOptions(redshift), - Password: aws.String(redshift["password"].(string)), - Username: aws.String(redshift["username"].(string)), - RoleARN: aws.String(redshift["role_arn"].(string)), - CopyCommand: extractCopyCommandConfiguration(redshift), - S3Update: s3Update, - } - - if _, ok := redshift["cloudwatch_logging_options"]; ok { - configuration.CloudWatchLoggingOptions = extractCloudWatchLoggingConfiguration(redshift) - } - - return configuration, nil -} - -func createElasticsearchConfig(d *schema.ResourceData, s3Config *firehose.S3DestinationConfiguration) (*firehose.ElasticsearchDestinationConfiguration, error) { - esConfig, ok := d.GetOk("elasticsearch_configuration") - if !ok { - return nil, fmt.Errorf("[ERR] Error loading Elasticsearch Configuration for Kinesis Firehose: elasticsearch_configuration not found") - } - esList := esConfig.([]interface{}) - - es := esList[0].(map[string]interface{}) - - config := &firehose.ElasticsearchDestinationConfiguration{ - BufferingHints: extractBufferingHints(es), - DomainARN: aws.String(es["domain_arn"].(string)), - IndexName: aws.String(es["index_name"].(string)), - RetryOptions: extractElasticSearchRetryOptions(es), - RoleARN: aws.String(es["role_arn"].(string)), - TypeName: aws.String(es["type_name"].(string)), - S3Configuration: s3Config, - } - - if _, ok := es["cloudwatch_logging_options"]; ok { - config.CloudWatchLoggingOptions = extractCloudWatchLoggingConfiguration(es) - } - - if indexRotationPeriod, ok := es["index_rotation_period"]; ok { - config.IndexRotationPeriod = aws.String(indexRotationPeriod.(string)) - } - if s3BackupMode, ok := es["s3_backup_mode"]; ok { - config.S3BackupMode = aws.String(s3BackupMode.(string)) - } - - return config, nil -} - -func updateElasticsearchConfig(d *schema.ResourceData, s3Update *firehose.S3DestinationUpdate) (*firehose.ElasticsearchDestinationUpdate, error) { - esConfig, ok := d.GetOk("elasticsearch_configuration") - if !ok { - return nil, fmt.Errorf("[ERR] Error loading Elasticsearch Configuration for Kinesis Firehose: elasticsearch_configuration not found") - } - esList := esConfig.([]interface{}) - - es := esList[0].(map[string]interface{}) - - update := &firehose.ElasticsearchDestinationUpdate{ - BufferingHints: extractBufferingHints(es), - DomainARN: aws.String(es["domain_arn"].(string)), - IndexName: aws.String(es["index_name"].(string)), - RetryOptions: extractElasticSearchRetryOptions(es), - RoleARN: aws.String(es["role_arn"].(string)), - TypeName: aws.String(es["type_name"].(string)), - S3Update: s3Update, - } - - if _, ok := es["cloudwatch_logging_options"]; ok { - update.CloudWatchLoggingOptions = extractCloudWatchLoggingConfiguration(es) - } - - if indexRotationPeriod, ok := es["index_rotation_period"]; ok { - update.IndexRotationPeriod = aws.String(indexRotationPeriod.(string)) - } - - return update, nil -} - -func extractBufferingHints(es map[string]interface{}) *firehose.ElasticsearchBufferingHints { - bufferingHints := &firehose.ElasticsearchBufferingHints{} - - if bufferingInterval, ok := es["buffering_interval"].(int); ok { - bufferingHints.IntervalInSeconds = aws.Int64(int64(bufferingInterval)) - } - if bufferingSize, ok := es["buffering_size"].(int); ok { - bufferingHints.SizeInMBs = aws.Int64(int64(bufferingSize)) - } - - return bufferingHints -} - -func extractElasticSearchRetryOptions(es map[string]interface{}) *firehose.ElasticsearchRetryOptions { - retryOptions := &firehose.ElasticsearchRetryOptions{} - - if retryDuration, ok := es["retry_duration"].(int); ok { - retryOptions.DurationInSeconds = aws.Int64(int64(retryDuration)) - } - - return retryOptions -} - -func extractRedshiftRetryOptions(redshift map[string]interface{}) *firehose.RedshiftRetryOptions { - retryOptions := &firehose.RedshiftRetryOptions{} - - if retryDuration, ok := redshift["retry_duration"].(int); ok { - retryOptions.DurationInSeconds = aws.Int64(int64(retryDuration)) - } - - return retryOptions -} - -func extractCopyCommandConfiguration(redshift map[string]interface{}) *firehose.CopyCommand { - cmd := &firehose.CopyCommand{ - DataTableName: aws.String(redshift["data_table_name"].(string)), - } - if copyOptions, ok := redshift["copy_options"]; ok { - cmd.CopyOptions = aws.String(copyOptions.(string)) - } - if columns, ok := redshift["data_table_columns"]; ok { - cmd.DataTableColumns = aws.String(columns.(string)) - } - - return cmd -} - -func resourceAwsKinesisFirehoseDeliveryStreamCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).firehoseconn - - sn := d.Get("name").(string) - s3Config := createS3Config(d) - - createInput := &firehose.CreateDeliveryStreamInput{ - DeliveryStreamName: aws.String(sn), - } - - if d.Get("destination").(string) == "s3" { - createInput.S3DestinationConfiguration = s3Config - } else if d.Get("destination").(string) == "elasticsearch" { - esConfig, err := createElasticsearchConfig(d, s3Config) - if err != nil { - return err - } - createInput.ElasticsearchDestinationConfiguration = esConfig - } else { - rc, err := createRedshiftConfig(d, s3Config) - if err != nil { - return err - } - createInput.RedshiftDestinationConfiguration = rc - } - - var lastError error - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := conn.CreateDeliveryStream(createInput) - if err != nil { - log.Printf("[DEBUG] Error creating Firehose Delivery Stream: %s", err) - lastError = err - - if awsErr, ok := err.(awserr.Error); ok { - // IAM roles can take ~10 seconds to propagate in AWS: - // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console - if awsErr.Code() == "InvalidArgumentException" && strings.Contains(awsErr.Message(), "Firehose is unable to assume role") { - log.Printf("[DEBUG] Firehose could not assume role referenced, retrying...") - return resource.RetryableError(awsErr) - } - } - // Not retryable - return resource.NonRetryableError(err) - } - - return nil - }) - if err != nil { - if awsErr, ok := lastError.(awserr.Error); ok { - return fmt.Errorf("[WARN] Error creating Kinesis Firehose Delivery Stream: \"%s\", code: \"%s\"", awsErr.Message(), awsErr.Code()) - } - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"CREATING"}, - Target: []string{"ACTIVE"}, - Refresh: firehoseStreamStateRefreshFunc(conn, sn), - Timeout: 20 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - firehoseStream, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Kinesis Stream (%s) to become active: %s", - sn, err) - } - - s := firehoseStream.(*firehose.DeliveryStreamDescription) - d.SetId(*s.DeliveryStreamARN) - d.Set("arn", s.DeliveryStreamARN) - - return resourceAwsKinesisFirehoseDeliveryStreamRead(d, meta) -} - -func resourceAwsKinesisFirehoseDeliveryStreamUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).firehoseconn - - sn := d.Get("name").(string) - s3Config := updateS3Config(d) - - updateInput := &firehose.UpdateDestinationInput{ - DeliveryStreamName: aws.String(sn), - CurrentDeliveryStreamVersionId: aws.String(d.Get("version_id").(string)), - DestinationId: aws.String(d.Get("destination_id").(string)), - } - - if d.Get("destination").(string) == "s3" { - updateInput.S3DestinationUpdate = s3Config - } else if d.Get("destination").(string) == "elasticsearch" { - esUpdate, err := updateElasticsearchConfig(d, s3Config) - if err != nil { - return err - } - updateInput.ElasticsearchDestinationUpdate = esUpdate - } else { - rc, err := updateRedshiftConfig(d, s3Config) - if err != nil { - return err - } - updateInput.RedshiftDestinationUpdate = rc - } - - _, err := conn.UpdateDestination(updateInput) - if err != nil { - return fmt.Errorf( - "Error Updating Kinesis Firehose Delivery Stream: \"%s\"\n%s", - sn, err) - } - - return resourceAwsKinesisFirehoseDeliveryStreamRead(d, meta) -} - -func resourceAwsKinesisFirehoseDeliveryStreamRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).firehoseconn - - resp, err := conn.DescribeDeliveryStream(&firehose.DescribeDeliveryStreamInput{ - DeliveryStreamName: aws.String(d.Get("name").(string)), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - d.SetId("") - return nil - } - return fmt.Errorf("[WARN] Error reading Kinesis Firehose Delivery Stream: \"%s\", code: \"%s\"", awsErr.Message(), awsErr.Code()) - } - return err - } - - s := resp.DeliveryStreamDescription - d.Set("version_id", s.VersionId) - d.Set("arn", *s.DeliveryStreamARN) - if len(s.Destinations) > 0 { - destination := s.Destinations[0] - d.Set("destination_id", *destination.DestinationId) - } - - return nil -} - -func resourceAwsKinesisFirehoseDeliveryStreamDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).firehoseconn - - sn := d.Get("name").(string) - _, err := conn.DeleteDeliveryStream(&firehose.DeleteDeliveryStreamInput{ - DeliveryStreamName: aws.String(sn), - }) - - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"DELETING"}, - Target: []string{"DESTROYED"}, - Refresh: firehoseStreamStateRefreshFunc(conn, sn), - Timeout: 20 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Delivery Stream (%s) to be destroyed: %s", - sn, err) - } - - d.SetId("") - return nil -} - -func firehoseStreamStateRefreshFunc(conn *firehose.Firehose, sn string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - describeOpts := &firehose.DescribeDeliveryStreamInput{ - DeliveryStreamName: aws.String(sn), - } - resp, err := conn.DescribeDeliveryStream(describeOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - return 42, "DESTROYED", nil - } - return nil, awsErr.Code(), err - } - return nil, "failed", err - } - - return resp.DeliveryStreamDescription, *resp.DeliveryStreamDescription.DeliveryStreamStatus, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream_migrate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream_migrate.go deleted file mode 100644 index 7ed8bfa..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_firehose_delivery_stream_migrate.go +++ /dev/null @@ -1,59 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/terraform" -) - -func resourceAwsKinesisFirehoseMigrateState( - v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - switch v { - case 0: - log.Println("[INFO] Found AWS Kinesis Firehose Delivery Stream State v0; migrating to v1") - return migrateKinesisFirehoseV0toV1(is) - default: - return is, fmt.Errorf("Unexpected schema version: %d", v) - } -} - -func migrateKinesisFirehoseV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() { - log.Println("[DEBUG] Empty Kinesis Firehose Delivery State; nothing to migrate.") - return is, nil - } - - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - - // migrate flate S3 configuration to a s3_configuration block - // grab initial values - is.Attributes["s3_configuration.#"] = "1" - // Required parameters - is.Attributes["s3_configuration.0.role_arn"] = is.Attributes["role_arn"] - is.Attributes["s3_configuration.0.bucket_arn"] = is.Attributes["s3_bucket_arn"] - - // Optional parameters - if is.Attributes["s3_buffer_size"] != "" { - is.Attributes["s3_configuration.0.buffer_size"] = is.Attributes["s3_buffer_size"] - } - if is.Attributes["s3_data_compression"] != "" { - is.Attributes["s3_configuration.0.compression_format"] = is.Attributes["s3_data_compression"] - } - if is.Attributes["s3_buffer_interval"] != "" { - is.Attributes["s3_configuration.0.buffer_interval"] = is.Attributes["s3_buffer_interval"] - } - if is.Attributes["s3_prefix"] != "" { - is.Attributes["s3_configuration.0.prefix"] = is.Attributes["s3_prefix"] - } - - delete(is.Attributes, "role_arn") - delete(is.Attributes, "s3_bucket_arn") - delete(is.Attributes, "s3_buffer_size") - delete(is.Attributes, "s3_data_compression") - delete(is.Attributes, "s3_buffer_interval") - delete(is.Attributes, "s3_prefix") - - log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) - return is, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_stream.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_stream.go deleted file mode 100644 index ed731f1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kinesis_stream.go +++ /dev/null @@ -1,362 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/kinesis" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsKinesisStream() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsKinesisStreamCreate, - Read: resourceAwsKinesisStreamRead, - Update: resourceAwsKinesisStreamUpdate, - Delete: resourceAwsKinesisStreamDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "shard_count": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - - "retention_period": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 24, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < 24 || value > 168 { - errors = append(errors, fmt.Errorf( - "%q must be between 24 and 168 hours", k)) - } - return - }, - }, - - "shard_level_metrics": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "arn": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "tags": tagsSchema(), - }, - } -} - -func resourceAwsKinesisStreamCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kinesisconn - sn := d.Get("name").(string) - createOpts := &kinesis.CreateStreamInput{ - ShardCount: aws.Int64(int64(d.Get("shard_count").(int))), - StreamName: aws.String(sn), - } - - _, err := conn.CreateStream(createOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - return fmt.Errorf("[WARN] Error creating Kinesis Stream: \"%s\", code: \"%s\"", awsErr.Message(), awsErr.Code()) - } - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"CREATING"}, - Target: []string{"ACTIVE"}, - Refresh: streamStateRefreshFunc(conn, sn), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - streamRaw, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Kinesis Stream (%s) to become active: %s", - sn, err) - } - - s := streamRaw.(kinesisStreamState) - d.SetId(s.arn) - d.Set("arn", s.arn) - d.Set("shard_count", s.shardCount) - - return resourceAwsKinesisStreamUpdate(d, meta) -} - -func resourceAwsKinesisStreamUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kinesisconn - - d.Partial(true) - if err := setTagsKinesis(conn, d); err != nil { - return err - } - - d.SetPartial("tags") - d.Partial(false) - - if err := setKinesisRetentionPeriod(conn, d); err != nil { - return err - } - if err := updateKinesisShardLevelMetrics(conn, d); err != nil { - return err - } - - return resourceAwsKinesisStreamRead(d, meta) -} - -func resourceAwsKinesisStreamRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kinesisconn - sn := d.Get("name").(string) - - state, err := readKinesisStreamState(conn, sn) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - d.SetId("") - return nil - } - return fmt.Errorf("[WARN] Error reading Kinesis Stream: \"%s\", code: \"%s\"", awsErr.Message(), awsErr.Code()) - } - return err - - } - d.Set("arn", state.arn) - d.Set("shard_count", state.shardCount) - d.Set("retention_period", state.retentionPeriod) - - if len(state.shardLevelMetrics) > 0 { - d.Set("shard_level_metrics", state.shardLevelMetrics) - } - - // set tags - describeTagsOpts := &kinesis.ListTagsForStreamInput{ - StreamName: aws.String(sn), - } - tagsResp, err := conn.ListTagsForStream(describeTagsOpts) - if err != nil { - log.Printf("[DEBUG] Error retrieving tags for Stream: %s. %s", sn, err) - } else { - d.Set("tags", tagsToMapKinesis(tagsResp.Tags)) - } - - return nil -} - -func resourceAwsKinesisStreamDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kinesisconn - sn := d.Get("name").(string) - _, err := conn.DeleteStream(&kinesis.DeleteStreamInput{ - StreamName: aws.String(sn), - }) - - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"DELETING"}, - Target: []string{"DESTROYED"}, - Refresh: streamStateRefreshFunc(conn, sn), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Stream (%s) to be destroyed: %s", - sn, err) - } - - d.SetId("") - return nil -} - -func setKinesisRetentionPeriod(conn *kinesis.Kinesis, d *schema.ResourceData) error { - sn := d.Get("name").(string) - - oraw, nraw := d.GetChange("retention_period") - o := oraw.(int) - n := nraw.(int) - - if n == 0 { - log.Printf("[DEBUG] Kinesis Stream (%q) Retention Period Not Changed", sn) - return nil - } - - if n > o { - log.Printf("[DEBUG] Increasing %s Stream Retention Period to %d", sn, n) - _, err := conn.IncreaseStreamRetentionPeriod(&kinesis.IncreaseStreamRetentionPeriodInput{ - StreamName: aws.String(sn), - RetentionPeriodHours: aws.Int64(int64(n)), - }) - if err != nil { - return err - } - - } else { - log.Printf("[DEBUG] Decreasing %s Stream Retention Period to %d", sn, n) - _, err := conn.DecreaseStreamRetentionPeriod(&kinesis.DecreaseStreamRetentionPeriodInput{ - StreamName: aws.String(sn), - RetentionPeriodHours: aws.Int64(int64(n)), - }) - if err != nil { - return err - } - } - - if err := waitForKinesisToBeActive(conn, sn); err != nil { - return err - } - - return nil -} - -func updateKinesisShardLevelMetrics(conn *kinesis.Kinesis, d *schema.ResourceData) error { - sn := d.Get("name").(string) - - o, n := d.GetChange("shard_level_metrics") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - disableMetrics := os.Difference(ns) - if disableMetrics.Len() != 0 { - metrics := disableMetrics.List() - log.Printf("[DEBUG] Disabling shard level metrics %v for stream %s", metrics, sn) - - props := &kinesis.DisableEnhancedMonitoringInput{ - StreamName: aws.String(sn), - ShardLevelMetrics: expandStringList(metrics), - } - - _, err := conn.DisableEnhancedMonitoring(props) - if err != nil { - return fmt.Errorf("Failure to disable shard level metrics for stream %s: %s", sn, err) - } - if err := waitForKinesisToBeActive(conn, sn); err != nil { - return err - } - } - - enabledMetrics := ns.Difference(os) - if enabledMetrics.Len() != 0 { - metrics := enabledMetrics.List() - log.Printf("[DEBUG] Enabling shard level metrics %v for stream %s", metrics, sn) - - props := &kinesis.EnableEnhancedMonitoringInput{ - StreamName: aws.String(sn), - ShardLevelMetrics: expandStringList(metrics), - } - - _, err := conn.EnableEnhancedMonitoring(props) - if err != nil { - return fmt.Errorf("Failure to enable shard level metrics for stream %s: %s", sn, err) - } - if err := waitForKinesisToBeActive(conn, sn); err != nil { - return err - } - } - - return nil -} - -type kinesisStreamState struct { - arn string - status string - shardCount int - retentionPeriod int64 - shardLevelMetrics []string -} - -func readKinesisStreamState(conn *kinesis.Kinesis, sn string) (kinesisStreamState, error) { - describeOpts := &kinesis.DescribeStreamInput{ - StreamName: aws.String(sn), - } - - var state kinesisStreamState - err := conn.DescribeStreamPages(describeOpts, func(page *kinesis.DescribeStreamOutput, last bool) (shouldContinue bool) { - state.arn = aws.StringValue(page.StreamDescription.StreamARN) - state.status = aws.StringValue(page.StreamDescription.StreamStatus) - state.shardCount += len(openShards(page.StreamDescription.Shards)) - state.retentionPeriod = aws.Int64Value(page.StreamDescription.RetentionPeriodHours) - state.shardLevelMetrics = flattenKinesisShardLevelMetrics(page.StreamDescription.EnhancedMonitoring) - return !last - }) - return state, err -} - -func streamStateRefreshFunc(conn *kinesis.Kinesis, sn string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - state, err := readKinesisStreamState(conn, sn) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - return 42, "DESTROYED", nil - } - return nil, awsErr.Code(), err - } - return nil, "failed", err - } - - return state, state.status, nil - } -} - -func waitForKinesisToBeActive(conn *kinesis.Kinesis, sn string) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"UPDATING"}, - Target: []string{"ACTIVE"}, - Refresh: streamStateRefreshFunc(conn, sn), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Kinesis Stream (%s) to become active: %s", - sn, err) - } - return nil -} - -// See http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-merge.html -func openShards(shards []*kinesis.Shard) []*kinesis.Shard { - var open []*kinesis.Shard - for _, s := range shards { - if s.SequenceNumberRange.EndingSequenceNumber == nil { - open = append(open, s) - } - } - - return open -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kms_alias.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kms_alias.go deleted file mode 100644 index 64eec56..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kms_alias.go +++ /dev/null @@ -1,182 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kms" -) - -func resourceAwsKmsAlias() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsKmsAliasCreate, - Read: resourceAwsKmsAliasRead, - Update: resourceAwsKmsAliasUpdate, - Delete: resourceAwsKmsAliasDelete, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(string) - if !regexp.MustCompile(`^(alias\/)[a-zA-Z0-9:/_-]+$`).MatchString(value) { - es = append(es, fmt.Errorf( - "%q must begin with 'alias/' and be comprised of only [a-zA-Z0-9:/_-]", k)) - } - return - }, - }, - "name_prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(string) - if !regexp.MustCompile(`^(alias\/)[a-zA-Z0-9:/_-]+$`).MatchString(value) { - es = append(es, fmt.Errorf( - "%q must begin with 'alias/' and be comprised of only [a-zA-Z0-9:/_-]", k)) - } - return - }, - }, - "target_key_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsKmsAliasCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kmsconn - - var name string - if v, ok := d.GetOk("name"); ok { - name = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - name = resource.PrefixedUniqueId(v.(string)) - } else { - name = resource.PrefixedUniqueId("alias/") - } - - targetKeyId := d.Get("target_key_id").(string) - - log.Printf("[DEBUG] KMS alias create name: %s, target_key: %s", name, targetKeyId) - - req := &kms.CreateAliasInput{ - AliasName: aws.String(name), - TargetKeyId: aws.String(targetKeyId), - } - _, err := conn.CreateAlias(req) - if err != nil { - return err - } - d.SetId(name) - return resourceAwsKmsAliasRead(d, meta) -} - -func resourceAwsKmsAliasRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kmsconn - - alias, err := findKmsAliasByName(conn, d.Id(), nil) - if err != nil { - return err - } - if alias == nil { - log.Printf("[DEBUG] Removing KMS Alias (%s) as it's already gone", d.Id()) - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Found KMS Alias: %s", alias) - - d.Set("arn", alias.AliasArn) - d.Set("target_key_id", alias.TargetKeyId) - - return nil -} - -func resourceAwsKmsAliasUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kmsconn - - if d.HasChange("target_key_id") { - err := resourceAwsKmsAliasTargetUpdate(conn, d) - if err != nil { - return err - } - } - return nil -} - -func resourceAwsKmsAliasTargetUpdate(conn *kms.KMS, d *schema.ResourceData) error { - name := d.Get("name").(string) - targetKeyId := d.Get("target_key_id").(string) - - log.Printf("[DEBUG] KMS alias: %s, update target: %s", name, targetKeyId) - - req := &kms.UpdateAliasInput{ - AliasName: aws.String(name), - TargetKeyId: aws.String(targetKeyId), - } - _, err := conn.UpdateAlias(req) - - return err -} - -func resourceAwsKmsAliasDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kmsconn - - req := &kms.DeleteAliasInput{ - AliasName: aws.String(d.Id()), - } - _, err := conn.DeleteAlias(req) - if err != nil { - return err - } - - log.Printf("[DEBUG] KMS Alias: (%s) deleted.", d.Id()) - d.SetId("") - return nil -} - -// API by default limits results to 50 aliases -// This is how we make sure we won't miss any alias -// See http://docs.aws.amazon.com/kms/latest/APIReference/API_ListAliases.html -func findKmsAliasByName(conn *kms.KMS, name string, marker *string) (*kms.AliasListEntry, error) { - req := kms.ListAliasesInput{ - Limit: aws.Int64(int64(100)), - } - if marker != nil { - req.Marker = marker - } - - log.Printf("[DEBUG] Listing KMS aliases: %s", req) - resp, err := conn.ListAliases(&req) - if err != nil { - return nil, err - } - - for _, entry := range resp.Aliases { - if *entry.AliasName == name { - return entry, nil - } - } - if *resp.Truncated { - log.Printf("[DEBUG] KMS alias list is truncated, listing more via %s", *resp.NextMarker) - return findKmsAliasByName(conn, name, resp.NextMarker) - } - - return nil, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kms_key.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kms_key.go deleted file mode 100644 index 0ccd72e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_kms_key.go +++ /dev/null @@ -1,401 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kms" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsKmsKey() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsKmsKeyCreate, - Read: resourceAwsKmsKeyRead, - Update: resourceAwsKmsKeyUpdate, - Delete: resourceAwsKmsKeyDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "key_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "key_usage": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(string) - if !(value == "ENCRYPT_DECRYPT" || value == "") { - es = append(es, fmt.Errorf( - "%q must be ENCRYPT_DECRYPT or not specified", k)) - } - return - }, - }, - "policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - "is_enabled": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "enable_key_rotation": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "deletion_window_in_days": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(int) - if value > 30 || value < 7 { - es = append(es, fmt.Errorf( - "%q must be between 7 and 30 days inclusive", k)) - } - return - }, - }, - }, - } -} - -func resourceAwsKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kmsconn - - // Allow aws to chose default values if we don't pass them - var req kms.CreateKeyInput - if v, exists := d.GetOk("description"); exists { - req.Description = aws.String(v.(string)) - } - if v, exists := d.GetOk("key_usage"); exists { - req.KeyUsage = aws.String(v.(string)) - } - if v, exists := d.GetOk("policy"); exists { - req.Policy = aws.String(v.(string)) - } - - var resp *kms.CreateKeyOutput - // AWS requires any principal in the policy to exist before the key is created. - // The KMS service's awareness of principals is limited by "eventual consistency". - // They acknowledge this here: - // http://docs.aws.amazon.com/kms/latest/APIReference/API_CreateKey.html - err := resource.Retry(30*time.Second, func() *resource.RetryError { - var err error - resp, err = conn.CreateKey(&req) - if isAWSErr(err, "MalformedPolicyDocumentException", "") { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - }) - if err != nil { - return err - } - - d.SetId(*resp.KeyMetadata.KeyId) - d.Set("key_id", resp.KeyMetadata.KeyId) - - return _resourceAwsKmsKeyUpdate(d, meta, true) -} - -func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kmsconn - - req := &kms.DescribeKeyInput{ - KeyId: aws.String(d.Id()), - } - resp, err := conn.DescribeKey(req) - if err != nil { - return err - } - metadata := resp.KeyMetadata - - if *metadata.KeyState == "PendingDeletion" { - log.Printf("[WARN] Removing KMS key %s because it's already gone", d.Id()) - d.SetId("") - return nil - } - - d.SetId(*metadata.KeyId) - - d.Set("arn", metadata.Arn) - d.Set("key_id", metadata.KeyId) - d.Set("description", metadata.Description) - d.Set("key_usage", metadata.KeyUsage) - d.Set("is_enabled", metadata.Enabled) - - p, err := conn.GetKeyPolicy(&kms.GetKeyPolicyInput{ - KeyId: metadata.KeyId, - PolicyName: aws.String("default"), - }) - if err != nil { - return err - } - - policy, err := normalizeJsonString(*p.Policy) - if err != nil { - return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) - } - d.Set("policy", policy) - - krs, err := conn.GetKeyRotationStatus(&kms.GetKeyRotationStatusInput{ - KeyId: metadata.KeyId, - }) - if err != nil { - return err - } - d.Set("enable_key_rotation", krs.KeyRotationEnabled) - - return nil -} - -func resourceAwsKmsKeyUpdate(d *schema.ResourceData, meta interface{}) error { - return _resourceAwsKmsKeyUpdate(d, meta, false) -} - -// We expect new keys to be enabled already -// but there is no easy way to differentiate between Update() -// called from Create() and regular update, so we have this wrapper -func _resourceAwsKmsKeyUpdate(d *schema.ResourceData, meta interface{}, isFresh bool) error { - conn := meta.(*AWSClient).kmsconn - - if d.HasChange("is_enabled") && d.Get("is_enabled").(bool) && !isFresh { - // Enable before any attributes will be modified - if err := updateKmsKeyStatus(conn, d.Id(), d.Get("is_enabled").(bool)); err != nil { - return err - } - } - - if d.HasChange("enable_key_rotation") { - if err := updateKmsKeyRotationStatus(conn, d); err != nil { - return err - } - } - - if d.HasChange("description") { - if err := resourceAwsKmsKeyDescriptionUpdate(conn, d); err != nil { - return err - } - } - if d.HasChange("policy") { - if err := resourceAwsKmsKeyPolicyUpdate(conn, d); err != nil { - return err - } - } - - if d.HasChange("is_enabled") && !d.Get("is_enabled").(bool) { - // Only disable when all attributes are modified - // because we cannot modify disabled keys - if err := updateKmsKeyStatus(conn, d.Id(), d.Get("is_enabled").(bool)); err != nil { - return err - } - } - - return resourceAwsKmsKeyRead(d, meta) -} - -func resourceAwsKmsKeyDescriptionUpdate(conn *kms.KMS, d *schema.ResourceData) error { - description := d.Get("description").(string) - keyId := d.Get("key_id").(string) - - log.Printf("[DEBUG] KMS key: %s, update description: %s", keyId, description) - - req := &kms.UpdateKeyDescriptionInput{ - Description: aws.String(description), - KeyId: aws.String(keyId), - } - _, err := conn.UpdateKeyDescription(req) - return err -} - -func resourceAwsKmsKeyPolicyUpdate(conn *kms.KMS, d *schema.ResourceData) error { - policy, err := normalizeJsonString(d.Get("policy").(string)) - if err != nil { - return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) - } - keyId := d.Get("key_id").(string) - - log.Printf("[DEBUG] KMS key: %s, update policy: %s", keyId, policy) - - req := &kms.PutKeyPolicyInput{ - KeyId: aws.String(keyId), - Policy: aws.String(policy), - PolicyName: aws.String("default"), - } - _, err = conn.PutKeyPolicy(req) - return err -} - -func updateKmsKeyStatus(conn *kms.KMS, id string, shouldBeEnabled bool) error { - var err error - - if shouldBeEnabled { - log.Printf("[DEBUG] Enabling KMS key %q", id) - _, err = conn.EnableKey(&kms.EnableKeyInput{ - KeyId: aws.String(id), - }) - } else { - log.Printf("[DEBUG] Disabling KMS key %q", id) - _, err = conn.DisableKey(&kms.DisableKeyInput{ - KeyId: aws.String(id), - }) - } - - if err != nil { - return fmt.Errorf("Failed to set KMS key %q status to %t: %q", - id, shouldBeEnabled, err.Error()) - } - - // Wait for propagation since KMS is eventually consistent - wait := resource.StateChangeConf{ - Pending: []string{fmt.Sprintf("%t", !shouldBeEnabled)}, - Target: []string{fmt.Sprintf("%t", shouldBeEnabled)}, - Timeout: 20 * time.Minute, - MinTimeout: 2 * time.Second, - ContinuousTargetOccurence: 10, - Refresh: func() (interface{}, string, error) { - log.Printf("[DEBUG] Checking if KMS key %s enabled status is %t", - id, shouldBeEnabled) - resp, err := conn.DescribeKey(&kms.DescribeKeyInput{ - KeyId: aws.String(id), - }) - if err != nil { - return resp, "FAILED", err - } - status := fmt.Sprintf("%t", *resp.KeyMetadata.Enabled) - log.Printf("[DEBUG] KMS key %s status received: %s, retrying", id, status) - - return resp, status, nil - }, - } - - _, err = wait.WaitForState() - if err != nil { - return fmt.Errorf("Failed setting KMS key status to %t: %s", shouldBeEnabled, err) - } - - return nil -} - -func updateKmsKeyRotationStatus(conn *kms.KMS, d *schema.ResourceData) error { - var err error - shouldEnableRotation := d.Get("enable_key_rotation").(bool) - if shouldEnableRotation { - log.Printf("[DEBUG] Enabling key rotation for KMS key %q", d.Id()) - _, err = conn.EnableKeyRotation(&kms.EnableKeyRotationInput{ - KeyId: aws.String(d.Id()), - }) - } else { - log.Printf("[DEBUG] Disabling key rotation for KMS key %q", d.Id()) - _, err = conn.DisableKeyRotation(&kms.DisableKeyRotationInput{ - KeyId: aws.String(d.Id()), - }) - } - - if err != nil { - return fmt.Errorf("Failed to set key rotation for %q to %t: %q", - d.Id(), shouldEnableRotation, err.Error()) - } - - // Wait for propagation since KMS is eventually consistent - wait := resource.StateChangeConf{ - Pending: []string{fmt.Sprintf("%t", !shouldEnableRotation)}, - Target: []string{fmt.Sprintf("%t", shouldEnableRotation)}, - Timeout: 5 * time.Minute, - MinTimeout: 1 * time.Second, - ContinuousTargetOccurence: 5, - Refresh: func() (interface{}, string, error) { - log.Printf("[DEBUG] Checking if KMS key %s rotation status is %t", - d.Id(), shouldEnableRotation) - resp, err := conn.GetKeyRotationStatus(&kms.GetKeyRotationStatusInput{ - KeyId: aws.String(d.Id()), - }) - if err != nil { - return resp, "FAILED", err - } - status := fmt.Sprintf("%t", *resp.KeyRotationEnabled) - log.Printf("[DEBUG] KMS key %s rotation status received: %s, retrying", d.Id(), status) - - return resp, status, nil - }, - } - - _, err = wait.WaitForState() - if err != nil { - return fmt.Errorf("Failed setting KMS key rotation status to %t: %s", shouldEnableRotation, err) - } - - return nil -} - -func resourceAwsKmsKeyDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kmsconn - keyId := d.Get("key_id").(string) - - req := &kms.ScheduleKeyDeletionInput{ - KeyId: aws.String(keyId), - } - if v, exists := d.GetOk("deletion_window_in_days"); exists { - req.PendingWindowInDays = aws.Int64(int64(v.(int))) - } - _, err := conn.ScheduleKeyDeletion(req) - if err != nil { - return err - } - - // Wait for propagation since KMS is eventually consistent - wait := resource.StateChangeConf{ - Pending: []string{"Enabled", "Disabled"}, - Target: []string{"PendingDeletion"}, - Timeout: 20 * time.Minute, - MinTimeout: 2 * time.Second, - ContinuousTargetOccurence: 10, - Refresh: func() (interface{}, string, error) { - log.Printf("[DEBUG] Checking if KMS key %s state is PendingDeletion", keyId) - resp, err := conn.DescribeKey(&kms.DescribeKeyInput{ - KeyId: aws.String(keyId), - }) - if err != nil { - return resp, "Failed", err - } - - metadata := *resp.KeyMetadata - log.Printf("[DEBUG] KMS key %s state is %s, retrying", keyId, *metadata.KeyState) - - return resp, *metadata.KeyState, nil - }, - } - - _, err = wait.WaitForState() - if err != nil { - return fmt.Errorf("Failed deactivating KMS key %s: %s", keyId, err) - } - - log.Printf("[DEBUG] KMS Key %s deactivated.", keyId) - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_alias.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_alias.go deleted file mode 100644 index 083225f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_alias.go +++ /dev/null @@ -1,146 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/lambda" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLambdaAlias() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLambdaAliasCreate, - Read: resourceAwsLambdaAliasRead, - Update: resourceAwsLambdaAliasUpdate, - Delete: resourceAwsLambdaAliasDelete, - - Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "function_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "function_version": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -// resourceAwsLambdaAliasCreate maps to: -// CreateAlias in the API / SDK -func resourceAwsLambdaAliasCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - functionName := d.Get("function_name").(string) - aliasName := d.Get("name").(string) - - log.Printf("[DEBUG] Creating Lambda alias: alias %s for function %s", aliasName, functionName) - - params := &lambda.CreateAliasInput{ - Description: aws.String(d.Get("description").(string)), - FunctionName: aws.String(functionName), - FunctionVersion: aws.String(d.Get("function_version").(string)), - Name: aws.String(aliasName), - } - - aliasConfiguration, err := conn.CreateAlias(params) - if err != nil { - return fmt.Errorf("Error creating Lambda alias: %s", err) - } - - d.SetId(*aliasConfiguration.AliasArn) - - return resourceAwsLambdaAliasRead(d, meta) -} - -// resourceAwsLambdaAliasRead maps to: -// GetAlias in the API / SDK -func resourceAwsLambdaAliasRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - log.Printf("[DEBUG] Fetching Lambda alias: %s:%s", d.Get("function_name"), d.Get("name")) - - params := &lambda.GetAliasInput{ - FunctionName: aws.String(d.Get("function_name").(string)), - Name: aws.String(d.Get("name").(string)), - } - - aliasConfiguration, err := conn.GetAlias(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" && strings.Contains(awsErr.Message(), "Cannot find alias arn") { - d.SetId("") - return nil - } - } - return err - } - - d.Set("description", aliasConfiguration.Description) - d.Set("function_version", aliasConfiguration.FunctionVersion) - d.Set("name", aliasConfiguration.Name) - d.Set("arn", aliasConfiguration.AliasArn) - - return nil -} - -// resourceAwsLambdaAliasDelete maps to: -// DeleteAlias in the API / SDK -func resourceAwsLambdaAliasDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - log.Printf("[INFO] Deleting Lambda alias: %s:%s", d.Get("function_name"), d.Get("name")) - - params := &lambda.DeleteAliasInput{ - FunctionName: aws.String(d.Get("function_name").(string)), - Name: aws.String(d.Get("name").(string)), - } - - _, err := conn.DeleteAlias(params) - if err != nil { - return fmt.Errorf("Error deleting Lambda alias: %s", err) - } - - d.SetId("") - - return nil -} - -// resourceAwsLambdaAliasUpdate maps to: -// UpdateAlias in the API / SDK -func resourceAwsLambdaAliasUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - log.Printf("[DEBUG] Updating Lambda alias: %s:%s", d.Get("function_name"), d.Get("name")) - - params := &lambda.UpdateAliasInput{ - Description: aws.String(d.Get("description").(string)), - FunctionName: aws.String(d.Get("function_name").(string)), - FunctionVersion: aws.String(d.Get("function_version").(string)), - Name: aws.String(d.Get("name").(string)), - } - - _, err := conn.UpdateAlias(params) - if err != nil { - return fmt.Errorf("Error updating Lambda alias: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_event_source_mapping.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_event_source_mapping.go deleted file mode 100644 index 6cae858..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_event_source_mapping.go +++ /dev/null @@ -1,211 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/lambda" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLambdaEventSourceMapping() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLambdaEventSourceMappingCreate, - Read: resourceAwsLambdaEventSourceMappingRead, - Update: resourceAwsLambdaEventSourceMappingUpdate, - Delete: resourceAwsLambdaEventSourceMappingDelete, - - Schema: map[string]*schema.Schema{ - "event_source_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "function_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "starting_position": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "batch_size": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 100, - }, - "enabled": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "function_arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "last_modified": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "last_processing_result": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "state": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "state_transition_reason": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "uuid": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -// resourceAwsLambdaEventSourceMappingCreate maps to: -// CreateEventSourceMapping in the API / SDK -func resourceAwsLambdaEventSourceMappingCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - functionName := d.Get("function_name").(string) - eventSourceArn := d.Get("event_source_arn").(string) - - log.Printf("[DEBUG] Creating Lambda event source mapping: source %s to function %s", eventSourceArn, functionName) - - params := &lambda.CreateEventSourceMappingInput{ - EventSourceArn: aws.String(eventSourceArn), - FunctionName: aws.String(functionName), - StartingPosition: aws.String(d.Get("starting_position").(string)), - BatchSize: aws.Int64(int64(d.Get("batch_size").(int))), - Enabled: aws.Bool(d.Get("enabled").(bool)), - } - - // IAM profiles and roles can take some time to propagate in AWS: - // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console - // Error creating Lambda function: InvalidParameterValueException: The - // function defined for the task cannot be assumed by Lambda. - // - // The role may exist, but the permissions may not have propagated, so we - // retry - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - eventSourceMappingConfiguration, err := conn.CreateEventSourceMapping(params) - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "InvalidParameterValueException" { - return resource.RetryableError(awserr) - } - } - return resource.NonRetryableError(err) - } - // No error - d.Set("uuid", eventSourceMappingConfiguration.UUID) - d.SetId(*eventSourceMappingConfiguration.UUID) - return nil - }) - - if err != nil { - return fmt.Errorf("Error creating Lambda event source mapping: %s", err) - } - - return resourceAwsLambdaEventSourceMappingRead(d, meta) -} - -// resourceAwsLambdaEventSourceMappingRead maps to: -// GetEventSourceMapping in the API / SDK -func resourceAwsLambdaEventSourceMappingRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - log.Printf("[DEBUG] Fetching Lambda event source mapping: %s", d.Id()) - - params := &lambda.GetEventSourceMappingInput{ - UUID: aws.String(d.Id()), - } - - eventSourceMappingConfiguration, err := conn.GetEventSourceMapping(params) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "ResourceNotFoundException" { - log.Printf("[DEBUG] Lambda event source mapping (%s) not found", d.Id()) - d.SetId("") - - return nil - } - return err - } - - d.Set("batch_size", eventSourceMappingConfiguration.BatchSize) - d.Set("event_source_arn", eventSourceMappingConfiguration.EventSourceArn) - d.Set("function_arn", eventSourceMappingConfiguration.FunctionArn) - d.Set("last_modified", eventSourceMappingConfiguration.LastModified) - d.Set("last_processing_result", eventSourceMappingConfiguration.LastProcessingResult) - d.Set("state", eventSourceMappingConfiguration.State) - d.Set("state_transition_reason", eventSourceMappingConfiguration.StateTransitionReason) - d.Set("uuid", eventSourceMappingConfiguration.UUID) - - return nil -} - -// resourceAwsLambdaEventSourceMappingDelete maps to: -// DeleteEventSourceMapping in the API / SDK -func resourceAwsLambdaEventSourceMappingDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - log.Printf("[INFO] Deleting Lambda event source mapping: %s", d.Id()) - - params := &lambda.DeleteEventSourceMappingInput{ - UUID: aws.String(d.Id()), - } - - _, err := conn.DeleteEventSourceMapping(params) - if err != nil { - return fmt.Errorf("Error deleting Lambda event source mapping: %s", err) - } - - d.SetId("") - - return nil -} - -// resourceAwsLambdaEventSourceMappingUpdate maps to: -// UpdateEventSourceMapping in the API / SDK -func resourceAwsLambdaEventSourceMappingUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - log.Printf("[DEBUG] Updating Lambda event source mapping: %s", d.Id()) - - params := &lambda.UpdateEventSourceMappingInput{ - UUID: aws.String(d.Id()), - BatchSize: aws.Int64(int64(d.Get("batch_size").(int))), - FunctionName: aws.String(d.Get("function_name").(string)), - Enabled: aws.Bool(d.Get("enabled").(bool)), - } - - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.UpdateEventSourceMapping(params) - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "InvalidParameterValueException" { - return resource.RetryableError(awserr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return fmt.Errorf("Error updating Lambda event source mapping: %s", err) - } - - return resourceAwsLambdaEventSourceMappingRead(d, meta) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_function.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_function.go deleted file mode 100644 index 55db957..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_function.go +++ /dev/null @@ -1,637 +0,0 @@ -package aws - -import ( - "fmt" - "io/ioutil" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/lambda" - "github.com/mitchellh/go-homedir" - - "errors" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -const awsMutexLambdaKey = `aws_lambda_function` - -func resourceAwsLambdaFunction() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLambdaFunctionCreate, - Read: resourceAwsLambdaFunctionRead, - Update: resourceAwsLambdaFunctionUpdate, - Delete: resourceAwsLambdaFunctionDelete, - - Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - d.Set("function_name", d.Id()) - return []*schema.ResourceData{d}, nil - }, - }, - - Schema: map[string]*schema.Schema{ - "filename": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"s3_bucket", "s3_key", "s3_object_version"}, - }, - "s3_bucket": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"filename"}, - }, - "s3_key": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"filename"}, - }, - "s3_object_version": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"filename"}, - }, - "description": { - Type: schema.TypeString, - Optional: true, - }, - "dead_letter_config": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - MinItems: 0, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "target_arn": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateArn, - }, - }, - }, - }, - "function_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "handler": { - Type: schema.TypeString, - Required: true, - }, - "memory_size": { - Type: schema.TypeInt, - Optional: true, - Default: 128, - }, - "role": { - Type: schema.TypeString, - Required: true, - }, - "runtime": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateRuntime, - }, - "timeout": { - Type: schema.TypeInt, - Optional: true, - Default: 3, - }, - "publish": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "version": { - Type: schema.TypeString, - Computed: true, - }, - "vpc_config": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "subnet_ids": { - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "security_group_ids": { - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "qualified_arn": { - Type: schema.TypeString, - Computed: true, - }, - "last_modified": { - Type: schema.TypeString, - Computed: true, - }, - "source_code_hash": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "environment": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "variables": { - Type: schema.TypeMap, - Optional: true, - Elem: schema.TypeString, - }, - }, - }, - }, - - "kms_key_arn": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateArn, - }, - }, - } -} - -// resourceAwsLambdaFunction maps to: -// CreateFunction in the API / SDK -func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - functionName := d.Get("function_name").(string) - iamRole := d.Get("role").(string) - - log.Printf("[DEBUG] Creating Lambda Function %s with role %s", functionName, iamRole) - - filename, hasFilename := d.GetOk("filename") - s3Bucket, bucketOk := d.GetOk("s3_bucket") - s3Key, keyOk := d.GetOk("s3_key") - s3ObjectVersion, versionOk := d.GetOk("s3_object_version") - - if !hasFilename && !bucketOk && !keyOk && !versionOk { - return errors.New("filename or s3_* attributes must be set") - } - - var functionCode *lambda.FunctionCode - if hasFilename { - // Grab an exclusive lock so that we're only reading one function into - // memory at a time. - // See https://github.com/hashicorp/terraform/issues/9364 - awsMutexKV.Lock(awsMutexLambdaKey) - defer awsMutexKV.Unlock(awsMutexLambdaKey) - file, err := loadFileContent(filename.(string)) - if err != nil { - return fmt.Errorf("Unable to load %q: %s", filename.(string), err) - } - functionCode = &lambda.FunctionCode{ - ZipFile: file, - } - } else { - if !bucketOk || !keyOk { - return errors.New("s3_bucket and s3_key must all be set while using S3 code source") - } - functionCode = &lambda.FunctionCode{ - S3Bucket: aws.String(s3Bucket.(string)), - S3Key: aws.String(s3Key.(string)), - } - if versionOk { - functionCode.S3ObjectVersion = aws.String(s3ObjectVersion.(string)) - } - } - - params := &lambda.CreateFunctionInput{ - Code: functionCode, - Description: aws.String(d.Get("description").(string)), - FunctionName: aws.String(functionName), - Handler: aws.String(d.Get("handler").(string)), - MemorySize: aws.Int64(int64(d.Get("memory_size").(int))), - Role: aws.String(iamRole), - Runtime: aws.String(d.Get("runtime").(string)), - Timeout: aws.Int64(int64(d.Get("timeout").(int))), - Publish: aws.Bool(d.Get("publish").(bool)), - } - - if v, ok := d.GetOk("dead_letter_config"); ok { - dlcMaps := v.([]interface{}) - if len(dlcMaps) == 1 { // Schema guarantees either 0 or 1 - dlcMap := dlcMaps[0].(map[string]interface{}) - params.DeadLetterConfig = &lambda.DeadLetterConfig{ - TargetArn: aws.String(dlcMap["target_arn"].(string)), - } - } - } - - if v, ok := d.GetOk("vpc_config"); ok { - config, err := validateVPCConfig(v) - if err != nil { - return err - } - - if config != nil { - var subnetIds []*string - for _, id := range config["subnet_ids"].(*schema.Set).List() { - subnetIds = append(subnetIds, aws.String(id.(string))) - } - - var securityGroupIds []*string - for _, id := range config["security_group_ids"].(*schema.Set).List() { - securityGroupIds = append(securityGroupIds, aws.String(id.(string))) - } - - params.VpcConfig = &lambda.VpcConfig{ - SubnetIds: subnetIds, - SecurityGroupIds: securityGroupIds, - } - } - } - - if v, ok := d.GetOk("environment"); ok { - environments := v.([]interface{}) - environment, ok := environments[0].(map[string]interface{}) - if !ok { - return errors.New("At least one field is expected inside environment") - } - - if environmentVariables, ok := environment["variables"]; ok { - variables := readEnvironmentVariables(environmentVariables.(map[string]interface{})) - - params.Environment = &lambda.Environment{ - Variables: aws.StringMap(variables), - } - } - } - - if v, ok := d.GetOk("kms_key_arn"); ok { - params.KMSKeyArn = aws.String(v.(string)) - } - - // IAM profiles can take ~10 seconds to propagate in AWS: - // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console - // Error creating Lambda function: InvalidParameterValueException: The role defined for the task cannot be assumed by Lambda. - err := resource.Retry(10*time.Minute, func() *resource.RetryError { - _, err := conn.CreateFunction(params) - if err != nil { - log.Printf("[ERROR] Received %q, retrying CreateFunction", err) - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "InvalidParameterValueException" { - log.Printf("[DEBUG] InvalidParameterValueException creating Lambda Function: %s", awserr) - return resource.RetryableError(awserr) - } - } - log.Printf("[DEBUG] Error creating Lambda Function: %s", err) - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return fmt.Errorf("Error creating Lambda function: %s", err) - } - - d.SetId(d.Get("function_name").(string)) - - return resourceAwsLambdaFunctionRead(d, meta) -} - -// resourceAwsLambdaFunctionRead maps to: -// GetFunction in the API / SDK -func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - log.Printf("[DEBUG] Fetching Lambda Function: %s", d.Id()) - - params := &lambda.GetFunctionInput{ - FunctionName: aws.String(d.Get("function_name").(string)), - } - - getFunctionOutput, err := conn.GetFunction(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" && !d.IsNewResource() { - d.SetId("") - return nil - } - return err - } - - // getFunctionOutput.Code.Location is a pre-signed URL pointing at the zip - // file that we uploaded when we created the resource. You can use it to - // download the code from AWS. The other part is - // getFunctionOutput.Configuration which holds metadata. - - function := getFunctionOutput.Configuration - // TODO error checking / handling on the Set() calls. - d.Set("arn", function.FunctionArn) - d.Set("description", function.Description) - d.Set("handler", function.Handler) - d.Set("memory_size", function.MemorySize) - d.Set("last_modified", function.LastModified) - d.Set("role", function.Role) - d.Set("runtime", function.Runtime) - d.Set("timeout", function.Timeout) - d.Set("kms_key_arn", function.KMSKeyArn) - - config := flattenLambdaVpcConfigResponse(function.VpcConfig) - log.Printf("[INFO] Setting Lambda %s VPC config %#v from API", d.Id(), config) - vpcSetErr := d.Set("vpc_config", config) - if vpcSetErr != nil { - return fmt.Errorf("Failed setting vpc_config: %s", vpcSetErr) - } - - d.Set("source_code_hash", function.CodeSha256) - - if err := d.Set("environment", flattenLambdaEnvironment(function.Environment)); err != nil { - log.Printf("[ERR] Error setting environment for Lambda Function (%s): %s", d.Id(), err) - } - - if function.DeadLetterConfig != nil && function.DeadLetterConfig.TargetArn != nil { - d.Set("dead_letter_config", []interface{}{ - map[string]interface{}{ - "target_arn": *function.DeadLetterConfig.TargetArn, - }, - }) - } else { - d.Set("dead_letter_config", []interface{}{}) - } - - // List is sorted from oldest to latest - // so this may get costly over time :'( - var lastVersion, lastQualifiedArn string - err = listVersionsByFunctionPages(conn, &lambda.ListVersionsByFunctionInput{ - FunctionName: function.FunctionName, - MaxItems: aws.Int64(10000), - }, func(p *lambda.ListVersionsByFunctionOutput, lastPage bool) bool { - if lastPage { - last := p.Versions[len(p.Versions)-1] - lastVersion = *last.Version - lastQualifiedArn = *last.FunctionArn - return true - } - return false - }) - if err != nil { - return err - } - - d.Set("version", lastVersion) - d.Set("qualified_arn", lastQualifiedArn) - - return nil -} - -func listVersionsByFunctionPages(c *lambda.Lambda, input *lambda.ListVersionsByFunctionInput, - fn func(p *lambda.ListVersionsByFunctionOutput, lastPage bool) bool) error { - for { - page, err := c.ListVersionsByFunction(input) - if err != nil { - return err - } - lastPage := page.NextMarker == nil - - shouldContinue := fn(page, lastPage) - if !shouldContinue || lastPage { - break - } - } - return nil -} - -// resourceAwsLambdaFunction maps to: -// DeleteFunction in the API / SDK -func resourceAwsLambdaFunctionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - log.Printf("[INFO] Deleting Lambda Function: %s", d.Id()) - - params := &lambda.DeleteFunctionInput{ - FunctionName: aws.String(d.Get("function_name").(string)), - } - - _, err := conn.DeleteFunction(params) - if err != nil { - return fmt.Errorf("Error deleting Lambda Function: %s", err) - } - - d.SetId("") - - return nil -} - -// resourceAwsLambdaFunctionUpdate maps to: -// UpdateFunctionCode in the API / SDK -func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - d.Partial(true) - - if d.HasChange("filename") || d.HasChange("source_code_hash") || d.HasChange("s3_bucket") || d.HasChange("s3_key") || d.HasChange("s3_object_version") { - codeReq := &lambda.UpdateFunctionCodeInput{ - FunctionName: aws.String(d.Id()), - Publish: aws.Bool(d.Get("publish").(bool)), - } - - if v, ok := d.GetOk("filename"); ok { - // Grab an exclusive lock so that we're only reading one function into - // memory at a time. - // See https://github.com/hashicorp/terraform/issues/9364 - awsMutexKV.Lock(awsMutexLambdaKey) - defer awsMutexKV.Unlock(awsMutexLambdaKey) - file, err := loadFileContent(v.(string)) - if err != nil { - return fmt.Errorf("Unable to load %q: %s", v.(string), err) - } - codeReq.ZipFile = file - } else { - s3Bucket, _ := d.GetOk("s3_bucket") - s3Key, _ := d.GetOk("s3_key") - s3ObjectVersion, versionOk := d.GetOk("s3_object_version") - - codeReq.S3Bucket = aws.String(s3Bucket.(string)) - codeReq.S3Key = aws.String(s3Key.(string)) - if versionOk { - codeReq.S3ObjectVersion = aws.String(s3ObjectVersion.(string)) - } - } - - log.Printf("[DEBUG] Send Update Lambda Function Code request: %#v", codeReq) - - _, err := conn.UpdateFunctionCode(codeReq) - if err != nil { - return fmt.Errorf("Error modifying Lambda Function Code %s: %s", d.Id(), err) - } - - d.SetPartial("filename") - d.SetPartial("source_code_hash") - d.SetPartial("s3_bucket") - d.SetPartial("s3_key") - d.SetPartial("s3_object_version") - } - - configReq := &lambda.UpdateFunctionConfigurationInput{ - FunctionName: aws.String(d.Id()), - } - - configUpdate := false - if d.HasChange("description") { - configReq.Description = aws.String(d.Get("description").(string)) - configUpdate = true - } - if d.HasChange("handler") { - configReq.Handler = aws.String(d.Get("handler").(string)) - configUpdate = true - } - if d.HasChange("memory_size") { - configReq.MemorySize = aws.Int64(int64(d.Get("memory_size").(int))) - configUpdate = true - } - if d.HasChange("role") { - configReq.Role = aws.String(d.Get("role").(string)) - configUpdate = true - } - if d.HasChange("timeout") { - configReq.Timeout = aws.Int64(int64(d.Get("timeout").(int))) - configUpdate = true - } - if d.HasChange("kms_key_arn") { - configReq.KMSKeyArn = aws.String(d.Get("kms_key_arn").(string)) - configUpdate = true - } - if d.HasChange("dead_letter_config") { - dlcMaps := d.Get("dead_letter_config").([]interface{}) - if len(dlcMaps) == 1 { // Schema guarantees either 0 or 1 - dlcMap := dlcMaps[0].(map[string]interface{}) - configReq.DeadLetterConfig = &lambda.DeadLetterConfig{ - TargetArn: aws.String(dlcMap["target_arn"].(string)), - } - configUpdate = true - } - } - if d.HasChange("runtime") { - configReq.Runtime = aws.String(d.Get("runtime").(string)) - configUpdate = true - } - if d.HasChange("environment") { - if v, ok := d.GetOk("environment"); ok { - environments := v.([]interface{}) - environment, ok := environments[0].(map[string]interface{}) - if !ok { - return errors.New("At least one field is expected inside environment") - } - - if environmentVariables, ok := environment["variables"]; ok { - variables := readEnvironmentVariables(environmentVariables.(map[string]interface{})) - - configReq.Environment = &lambda.Environment{ - Variables: aws.StringMap(variables), - } - configUpdate = true - } - } else { - configReq.Environment = &lambda.Environment{ - Variables: aws.StringMap(map[string]string{}), - } - configUpdate = true - } - } - - if configUpdate { - log.Printf("[DEBUG] Send Update Lambda Function Configuration request: %#v", configReq) - _, err := conn.UpdateFunctionConfiguration(configReq) - if err != nil { - return fmt.Errorf("Error modifying Lambda Function Configuration %s: %s", d.Id(), err) - } - d.SetPartial("description") - d.SetPartial("handler") - d.SetPartial("memory_size") - d.SetPartial("role") - d.SetPartial("timeout") - } - d.Partial(false) - - return resourceAwsLambdaFunctionRead(d, meta) -} - -// loadFileContent returns contents of a file in a given path -func loadFileContent(v string) ([]byte, error) { - filename, err := homedir.Expand(v) - if err != nil { - return nil, err - } - fileContent, err := ioutil.ReadFile(filename) - if err != nil { - return nil, err - } - return fileContent, nil -} - -func readEnvironmentVariables(ev map[string]interface{}) map[string]string { - variables := make(map[string]string) - for k, v := range ev { - variables[k] = v.(string) - } - - return variables -} - -func validateVPCConfig(v interface{}) (map[string]interface{}, error) { - configs := v.([]interface{}) - if len(configs) > 1 { - return nil, errors.New("Only a single vpc_config block is expected") - } - - config, ok := configs[0].(map[string]interface{}) - - if !ok { - return nil, errors.New("vpc_config is ") - } - - // if subnet_ids and security_group_ids are both empty then the VPC is optional - if config["subnet_ids"].(*schema.Set).Len() == 0 && config["security_group_ids"].(*schema.Set).Len() == 0 { - return nil, nil - } - - if config["subnet_ids"].(*schema.Set).Len() == 0 { - return nil, errors.New("vpc_config.subnet_ids cannot be empty") - } - - if config["security_group_ids"].(*schema.Set).Len() == 0 { - return nil, errors.New("vpc_config.security_group_ids cannot be empty") - } - - return config, nil -} - -func validateRuntime(v interface{}, k string) (ws []string, errors []error) { - runtime := v.(string) - - if runtime == lambda.RuntimeNodejs { - errors = append(errors, fmt.Errorf( - "%s has reached end of life since October 2016 and has been deprecated in favor of %s.", - runtime, lambda.RuntimeNodejs43)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_permission.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_permission.go deleted file mode 100644 index 2cf5b67..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lambda_permission.go +++ /dev/null @@ -1,373 +0,0 @@ -package aws - -import ( - "encoding/json" - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/lambda" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -var LambdaFunctionRegexp = `^(arn:[\w-]+:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$` - -func resourceAwsLambdaPermission() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLambdaPermissionCreate, - Read: resourceAwsLambdaPermissionRead, - Delete: resourceAwsLambdaPermissionDelete, - - Schema: map[string]*schema.Schema{ - "action": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateLambdaPermissionAction, - }, - "function_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateLambdaFunctionName, - }, - "principal": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "qualifier": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validateLambdaQualifier, - }, - "source_account": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validateAwsAccountId, - }, - "source_arn": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - "statement_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validatePolicyStatementId, - }, - }, - } -} - -func resourceAwsLambdaPermissionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - functionName := d.Get("function_name").(string) - - // There is a bug in the API (reported and acknowledged by AWS) - // which causes some permissions to be ignored when API calls are sent in parallel - // We work around this bug via mutex - awsMutexKV.Lock(functionName) - defer awsMutexKV.Unlock(functionName) - - input := lambda.AddPermissionInput{ - Action: aws.String(d.Get("action").(string)), - FunctionName: aws.String(functionName), - Principal: aws.String(d.Get("principal").(string)), - StatementId: aws.String(d.Get("statement_id").(string)), - } - - if v, ok := d.GetOk("qualifier"); ok { - input.Qualifier = aws.String(v.(string)) - } - if v, ok := d.GetOk("source_account"); ok { - input.SourceAccount = aws.String(v.(string)) - } - if v, ok := d.GetOk("source_arn"); ok { - input.SourceArn = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Adding new Lambda permission: %s", input) - var out *lambda.AddPermissionOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - var err error - out, err = conn.AddPermission(&input) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // IAM is eventually consistent :/ - if awsErr.Code() == "ResourceConflictException" { - return resource.RetryableError( - fmt.Errorf("[WARN] Error adding new Lambda Permission for %s, retrying: %s", - *input.FunctionName, err)) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return err - } - - if out != nil && out.Statement != nil { - log.Printf("[DEBUG] Created new Lambda permission: %s", *out.Statement) - } else { - log.Printf("[DEBUG] Created new Lambda permission, but no Statement was included") - } - - d.SetId(d.Get("statement_id").(string)) - - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - // IAM is eventually cosistent :/ - err := resourceAwsLambdaPermissionRead(d, meta) - if err != nil { - if strings.HasPrefix(err.Error(), "Error reading Lambda policy: ResourceNotFoundException") { - return resource.RetryableError( - fmt.Errorf("[WARN] Error reading newly created Lambda Permission for %s, retrying: %s", - *input.FunctionName, err)) - } - if strings.HasPrefix(err.Error(), "Failed to find statement \""+d.Id()) { - return resource.RetryableError( - fmt.Errorf("[WARN] Error reading newly created Lambda Permission statement for %s, retrying: %s", - *input.FunctionName, err)) - } - - log.Printf("[ERROR] An actual error occurred when expecting Lambda policy to be there: %s", err) - return resource.NonRetryableError(err) - } - return nil - }) - - return err -} - -func resourceAwsLambdaPermissionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - input := lambda.GetPolicyInput{ - FunctionName: aws.String(d.Get("function_name").(string)), - } - if v, ok := d.GetOk("qualifier"); ok { - input.Qualifier = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Looking for Lambda permission: %s", input) - var out *lambda.GetPolicyOutput - var statement *LambdaPolicyStatement - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - // IAM is eventually cosistent :/ - var err error - out, err = conn.GetPolicy(&input) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - return resource.RetryableError(err) - } - } - return resource.NonRetryableError(err) - } - - policyInBytes := []byte(*out.Policy) - policy := LambdaPolicy{} - err = json.Unmarshal(policyInBytes, &policy) - if err != nil { - return resource.NonRetryableError(err) - } - - statement, err = findLambdaPolicyStatementById(&policy, d.Id()) - return resource.RetryableError(err) - }) - - if err != nil { - // Missing whole policy or Lambda function (API error) - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - log.Printf("[WARN] No Lambda Permission Policy found: %v", input) - d.SetId("") - return nil - } - } - - // Missing permission inside valid policy - if nfErr, ok := err.(*resource.NotFoundError); ok { - log.Printf("[WARN] %s", nfErr) - d.SetId("") - return nil - } - - return err - } - - qualifier, err := getQualifierFromLambdaAliasOrVersionArn(statement.Resource) - if err != nil { - log.Printf("[ERR] Error getting Lambda Qualifier: %s", err) - } - d.Set("qualifier", qualifier) - - // Save Lambda function name in the same format - if strings.HasPrefix(d.Get("function_name").(string), "arn:"+meta.(*AWSClient).partition+":lambda:") { - // Strip qualifier off - trimmedArn := strings.TrimSuffix(statement.Resource, ":"+qualifier) - d.Set("function_name", trimmedArn) - } else { - functionName, err := getFunctionNameFromLambdaArn(statement.Resource) - if err != nil { - return err - } - d.Set("function_name", functionName) - } - - d.Set("action", statement.Action) - d.Set("principal", statement.Principal["Service"]) - - if stringEquals, ok := statement.Condition["StringEquals"]; ok { - d.Set("source_account", stringEquals["AWS:SourceAccount"]) - } - - if arnLike, ok := statement.Condition["ArnLike"]; ok { - d.Set("source_arn", arnLike["AWS:SourceArn"]) - } - - return nil -} - -func resourceAwsLambdaPermissionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lambdaconn - - functionName := d.Get("function_name").(string) - - // There is a bug in the API (reported and acknowledged by AWS) - // which causes some permissions to be ignored when API calls are sent in parallel - // We work around this bug via mutex - awsMutexKV.Lock(functionName) - defer awsMutexKV.Unlock(functionName) - - input := lambda.RemovePermissionInput{ - FunctionName: aws.String(functionName), - StatementId: aws.String(d.Id()), - } - - if v, ok := d.GetOk("qualifier"); ok { - input.Qualifier = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Removing Lambda permission: %s", input) - _, err := conn.RemovePermission(&input) - if err != nil { - return err - } - - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Checking if Lambda permission %q is deleted", d.Id()) - - params := &lambda.GetPolicyInput{ - FunctionName: aws.String(d.Get("function_name").(string)), - } - if v, ok := d.GetOk("qualifier"); ok { - params.Qualifier = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Looking for Lambda permission: %s", *params) - resp, err := conn.GetPolicy(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - return nil - } - } - return resource.NonRetryableError(err) - } - - if resp.Policy == nil { - return nil - } - - policyInBytes := []byte(*resp.Policy) - policy := LambdaPolicy{} - err = json.Unmarshal(policyInBytes, &policy) - if err != nil { - return resource.RetryableError( - fmt.Errorf("Error unmarshalling Lambda policy: %s", err)) - } - - _, err = findLambdaPolicyStatementById(&policy, d.Id()) - if err != nil { - return nil - } - - log.Printf("[DEBUG] No error when checking if Lambda permission %s is deleted", d.Id()) - return nil - }) - - if err != nil { - return fmt.Errorf("Failed removing Lambda permission: %s", err) - } - - log.Printf("[DEBUG] Lambda permission with ID %q removed", d.Id()) - d.SetId("") - - return nil -} - -func findLambdaPolicyStatementById(policy *LambdaPolicy, id string) ( - *LambdaPolicyStatement, error) { - - log.Printf("[DEBUG] Received %d statements in Lambda policy: %s", len(policy.Statement), policy.Statement) - for _, statement := range policy.Statement { - if statement.Sid == id { - return &statement, nil - } - } - - return nil, &resource.NotFoundError{ - LastRequest: id, - LastResponse: policy, - Message: fmt.Sprintf("Failed to find statement %q in Lambda policy:\n%s", id, policy.Statement), - } -} - -func getQualifierFromLambdaAliasOrVersionArn(arn string) (string, error) { - matches := regexp.MustCompile(LambdaFunctionRegexp).FindStringSubmatch(arn) - if len(matches) < 8 || matches[7] == "" { - return "", fmt.Errorf("Invalid ARN or otherwise unable to get qualifier from ARN (%q)", - arn) - } - - return matches[7], nil -} - -func getFunctionNameFromLambdaArn(arn string) (string, error) { - matches := regexp.MustCompile(LambdaFunctionRegexp).FindStringSubmatch(arn) - if len(matches) < 6 || matches[5] == "" { - return "", fmt.Errorf("Invalid ARN or otherwise unable to get qualifier from ARN (%q)", - arn) - } - return matches[5], nil -} - -type LambdaPolicy struct { - Version string - Statement []LambdaPolicyStatement - Id string -} - -type LambdaPolicyStatement struct { - Condition map[string]map[string]string - Action string - Resource string - Effect string - Principal map[string]string - Sid string -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_launch_configuration.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_launch_configuration.go deleted file mode 100644 index 269ac77..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_launch_configuration.go +++ /dev/null @@ -1,657 +0,0 @@ -package aws - -import ( - "bytes" - "crypto/sha1" - "encoding/hex" - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLaunchConfiguration() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLaunchConfigurationCreate, - Read: resourceAwsLaunchConfigurationRead, - Delete: resourceAwsLaunchConfigurationDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1932-L1939 - value := v.(string) - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters", k)) - } - return - }, - }, - - "name_prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - // https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1932-L1939 - // uuid is 26 characters, limit the prefix to 229. - value := v.(string) - if len(value) > 229 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 229 characters, name is limited to 255", k)) - } - return - }, - }, - - "image_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "instance_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "iam_instance_profile": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "key_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "user_data": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - StateFunc: func(v interface{}) string { - switch v.(type) { - case string: - hash := sha1.Sum([]byte(v.(string))) - return hex.EncodeToString(hash[:]) - default: - return "" - } - }, - }, - - "security_groups": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "vpc_classic_link_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "vpc_classic_link_security_groups": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "associate_public_ip_address": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Default: false, - }, - - "spot_price": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "ebs_optimized": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "placement_tenancy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "enable_monitoring": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Default: true, - }, - - "ebs_block_device": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delete_on_termination": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - }, - - "device_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "iops": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "snapshot_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_size": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "encrypted": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["snapshot_id"].(string))) - return hashcode.String(buf.String()) - }, - }, - - "ephemeral_block_device": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "device_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "virtual_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["virtual_name"].(string))) - return hashcode.String(buf.String()) - }, - }, - - "root_block_device": &schema.Schema{ - // TODO: This is a set because we don't support singleton - // sub-resources today. We'll enforce that the set only ever has - // length zero or one below. When TF gains support for - // sub-resources this can be converted. - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - // "You can only modify the volume size, volume type, and Delete on - // Termination flag on the block device mapping entry for the root - // device volume." - bit.ly/ec2bdmap - Schema: map[string]*schema.Schema{ - "delete_on_termination": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - }, - - "iops": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_size": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - Set: func(v interface{}) int { - // there can be only one root device; no need to hash anything - return 0 - }, - }, - }, - } -} - -func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - ec2conn := meta.(*AWSClient).ec2conn - - createLaunchConfigurationOpts := autoscaling.CreateLaunchConfigurationInput{ - LaunchConfigurationName: aws.String(d.Get("name").(string)), - ImageId: aws.String(d.Get("image_id").(string)), - InstanceType: aws.String(d.Get("instance_type").(string)), - EbsOptimized: aws.Bool(d.Get("ebs_optimized").(bool)), - } - - if v, ok := d.GetOk("user_data"); ok { - userData := base64Encode([]byte(v.(string))) - createLaunchConfigurationOpts.UserData = aws.String(userData) - } - - createLaunchConfigurationOpts.InstanceMonitoring = &autoscaling.InstanceMonitoring{ - Enabled: aws.Bool(d.Get("enable_monitoring").(bool)), - } - - if v, ok := d.GetOk("iam_instance_profile"); ok { - createLaunchConfigurationOpts.IamInstanceProfile = aws.String(v.(string)) - } - - if v, ok := d.GetOk("placement_tenancy"); ok { - createLaunchConfigurationOpts.PlacementTenancy = aws.String(v.(string)) - } - - if v, ok := d.GetOk("associate_public_ip_address"); ok { - createLaunchConfigurationOpts.AssociatePublicIpAddress = aws.Bool(v.(bool)) - } - - if v, ok := d.GetOk("key_name"); ok { - createLaunchConfigurationOpts.KeyName = aws.String(v.(string)) - } - if v, ok := d.GetOk("spot_price"); ok { - createLaunchConfigurationOpts.SpotPrice = aws.String(v.(string)) - } - - if v, ok := d.GetOk("security_groups"); ok { - createLaunchConfigurationOpts.SecurityGroups = expandStringList( - v.(*schema.Set).List(), - ) - } - - if v, ok := d.GetOk("vpc_classic_link_id"); ok { - createLaunchConfigurationOpts.ClassicLinkVPCId = aws.String(v.(string)) - } - - if v, ok := d.GetOk("vpc_classic_link_security_groups"); ok { - createLaunchConfigurationOpts.ClassicLinkVPCSecurityGroups = expandStringList( - v.(*schema.Set).List(), - ) - } - - var blockDevices []*autoscaling.BlockDeviceMapping - - // We'll use this to detect if we're declaring it incorrectly as an ebs_block_device. - rootDeviceName, err := fetchRootDeviceName(d.Get("image_id").(string), ec2conn) - if err != nil { - return err - } - if rootDeviceName == nil { - // We do this so the value is empty so we don't have to do nil checks later - var blank string - rootDeviceName = &blank - } - - if v, ok := d.GetOk("ebs_block_device"); ok { - vL := v.(*schema.Set).List() - for _, v := range vL { - bd := v.(map[string]interface{}) - ebs := &autoscaling.Ebs{ - DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)), - } - - if v, ok := bd["snapshot_id"].(string); ok && v != "" { - ebs.SnapshotId = aws.String(v) - } - - if v, ok := bd["encrypted"].(bool); ok && v { - ebs.Encrypted = aws.Bool(v) - } - - if v, ok := bd["volume_size"].(int); ok && v != 0 { - ebs.VolumeSize = aws.Int64(int64(v)) - } - - if v, ok := bd["volume_type"].(string); ok && v != "" { - ebs.VolumeType = aws.String(v) - } - - if v, ok := bd["iops"].(int); ok && v > 0 { - ebs.Iops = aws.Int64(int64(v)) - } - - if *aws.String(bd["device_name"].(string)) == *rootDeviceName { - return fmt.Errorf("Root device (%s) declared as an 'ebs_block_device'. Use 'root_block_device' keyword.", *rootDeviceName) - } - - blockDevices = append(blockDevices, &autoscaling.BlockDeviceMapping{ - DeviceName: aws.String(bd["device_name"].(string)), - Ebs: ebs, - }) - } - } - - if v, ok := d.GetOk("ephemeral_block_device"); ok { - vL := v.(*schema.Set).List() - for _, v := range vL { - bd := v.(map[string]interface{}) - blockDevices = append(blockDevices, &autoscaling.BlockDeviceMapping{ - DeviceName: aws.String(bd["device_name"].(string)), - VirtualName: aws.String(bd["virtual_name"].(string)), - }) - } - } - - if v, ok := d.GetOk("root_block_device"); ok { - vL := v.(*schema.Set).List() - if len(vL) > 1 { - return fmt.Errorf("Cannot specify more than one root_block_device.") - } - for _, v := range vL { - bd := v.(map[string]interface{}) - ebs := &autoscaling.Ebs{ - DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)), - } - - if v, ok := bd["volume_size"].(int); ok && v != 0 { - ebs.VolumeSize = aws.Int64(int64(v)) - } - - if v, ok := bd["volume_type"].(string); ok && v != "" { - ebs.VolumeType = aws.String(v) - } - - if v, ok := bd["iops"].(int); ok && v > 0 { - ebs.Iops = aws.Int64(int64(v)) - } - - if dn, err := fetchRootDeviceName(d.Get("image_id").(string), ec2conn); err == nil { - if dn == nil { - return fmt.Errorf( - "Expected to find a Root Device name for AMI (%s), but got none", - d.Get("image_id").(string)) - } - blockDevices = append(blockDevices, &autoscaling.BlockDeviceMapping{ - DeviceName: dn, - Ebs: ebs, - }) - } else { - return err - } - } - } - - if len(blockDevices) > 0 { - createLaunchConfigurationOpts.BlockDeviceMappings = blockDevices - } - - var lcName string - if v, ok := d.GetOk("name"); ok { - lcName = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - lcName = resource.PrefixedUniqueId(v.(string)) - } else { - lcName = resource.UniqueId() - } - createLaunchConfigurationOpts.LaunchConfigurationName = aws.String(lcName) - - log.Printf( - "[DEBUG] autoscaling create launch configuration: %s", createLaunchConfigurationOpts) - - // IAM profiles can take ~10 seconds to propagate in AWS: - // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console - err = resource.Retry(30*time.Second, func() *resource.RetryError { - _, err := autoscalingconn.CreateLaunchConfiguration(&createLaunchConfigurationOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if strings.Contains(awsErr.Message(), "Invalid IamInstanceProfile") { - return resource.RetryableError(err) - } - if strings.Contains(awsErr.Message(), "You are not authorized to perform this operation") { - return resource.RetryableError(err) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return fmt.Errorf("Error creating launch configuration: %s", err) - } - - d.SetId(lcName) - log.Printf("[INFO] launch configuration ID: %s", d.Id()) - - // We put a Retry here since sometimes eventual consistency bites - // us and we need to retry a few times to get the LC to load properly - return resource.Retry(30*time.Second, func() *resource.RetryError { - err := resourceAwsLaunchConfigurationRead(d, meta) - if err != nil { - return resource.RetryableError(err) - } - return nil - }) -} - -func resourceAwsLaunchConfigurationRead(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - ec2conn := meta.(*AWSClient).ec2conn - - describeOpts := autoscaling.DescribeLaunchConfigurationsInput{ - LaunchConfigurationNames: []*string{aws.String(d.Id())}, - } - - log.Printf("[DEBUG] launch configuration describe configuration: %s", describeOpts) - describConfs, err := autoscalingconn.DescribeLaunchConfigurations(&describeOpts) - if err != nil { - return fmt.Errorf("Error retrieving launch configuration: %s", err) - } - if len(describConfs.LaunchConfigurations) == 0 { - d.SetId("") - return nil - } - - // Verify AWS returned our launch configuration - if *describConfs.LaunchConfigurations[0].LaunchConfigurationName != d.Id() { - return fmt.Errorf( - "Unable to find launch configuration: %#v", - describConfs.LaunchConfigurations) - } - - lc := describConfs.LaunchConfigurations[0] - - d.Set("key_name", lc.KeyName) - d.Set("image_id", lc.ImageId) - d.Set("instance_type", lc.InstanceType) - d.Set("name", lc.LaunchConfigurationName) - - d.Set("iam_instance_profile", lc.IamInstanceProfile) - d.Set("ebs_optimized", lc.EbsOptimized) - d.Set("spot_price", lc.SpotPrice) - d.Set("enable_monitoring", lc.InstanceMonitoring.Enabled) - d.Set("security_groups", lc.SecurityGroups) - d.Set("associate_public_ip_address", lc.AssociatePublicIpAddress) - - d.Set("vpc_classic_link_id", lc.ClassicLinkVPCId) - d.Set("vpc_classic_link_security_groups", lc.ClassicLinkVPCSecurityGroups) - - if err := readLCBlockDevices(d, lc, ec2conn); err != nil { - return err - } - - return nil -} - -func resourceAwsLaunchConfigurationDelete(d *schema.ResourceData, meta interface{}) error { - autoscalingconn := meta.(*AWSClient).autoscalingconn - - log.Printf("[DEBUG] Launch Configuration destroy: %v", d.Id()) - _, err := autoscalingconn.DeleteLaunchConfiguration( - &autoscaling.DeleteLaunchConfigurationInput{ - LaunchConfigurationName: aws.String(d.Id()), - }) - if err != nil { - autoscalingerr, ok := err.(awserr.Error) - if ok && (autoscalingerr.Code() == "InvalidConfiguration.NotFound" || autoscalingerr.Code() == "ValidationError") { - log.Printf("[DEBUG] Launch configuration (%s) not found", d.Id()) - return nil - } - - return err - } - - return nil -} - -func readLCBlockDevices(d *schema.ResourceData, lc *autoscaling.LaunchConfiguration, ec2conn *ec2.EC2) error { - ibds, err := readBlockDevicesFromLaunchConfiguration(d, lc, ec2conn) - if err != nil { - return err - } - - if err := d.Set("ebs_block_device", ibds["ebs"]); err != nil { - return err - } - if err := d.Set("ephemeral_block_device", ibds["ephemeral"]); err != nil { - return err - } - if ibds["root"] != nil { - if err := d.Set("root_block_device", []interface{}{ibds["root"]}); err != nil { - return err - } - } else { - d.Set("root_block_device", []interface{}{}) - } - - return nil -} - -func readBlockDevicesFromLaunchConfiguration(d *schema.ResourceData, lc *autoscaling.LaunchConfiguration, ec2conn *ec2.EC2) ( - map[string]interface{}, error) { - blockDevices := make(map[string]interface{}) - blockDevices["ebs"] = make([]map[string]interface{}, 0) - blockDevices["ephemeral"] = make([]map[string]interface{}, 0) - blockDevices["root"] = nil - if len(lc.BlockDeviceMappings) == 0 { - return nil, nil - } - rootDeviceName, err := fetchRootDeviceName(d.Get("image_id").(string), ec2conn) - if err != nil { - return nil, err - } - if rootDeviceName == nil { - // We do this so the value is empty so we don't have to do nil checks later - var blank string - rootDeviceName = &blank - } - for _, bdm := range lc.BlockDeviceMappings { - bd := make(map[string]interface{}) - if bdm.Ebs != nil && bdm.Ebs.DeleteOnTermination != nil { - bd["delete_on_termination"] = *bdm.Ebs.DeleteOnTermination - } - if bdm.Ebs != nil && bdm.Ebs.VolumeSize != nil { - bd["volume_size"] = *bdm.Ebs.VolumeSize - } - if bdm.Ebs != nil && bdm.Ebs.VolumeType != nil { - bd["volume_type"] = *bdm.Ebs.VolumeType - } - if bdm.Ebs != nil && bdm.Ebs.Iops != nil { - bd["iops"] = *bdm.Ebs.Iops - } - - if bdm.DeviceName != nil && *bdm.DeviceName == *rootDeviceName { - blockDevices["root"] = bd - } else { - if bdm.Ebs != nil && bdm.Ebs.Encrypted != nil { - bd["encrypted"] = *bdm.Ebs.Encrypted - } - if bdm.DeviceName != nil { - bd["device_name"] = *bdm.DeviceName - } - if bdm.VirtualName != nil { - bd["virtual_name"] = *bdm.VirtualName - blockDevices["ephemeral"] = append(blockDevices["ephemeral"].([]map[string]interface{}), bd) - } else { - if bdm.Ebs != nil && bdm.Ebs.SnapshotId != nil { - bd["snapshot_id"] = *bdm.Ebs.SnapshotId - } - blockDevices["ebs"] = append(blockDevices["ebs"].([]map[string]interface{}), bd) - } - } - } - return blockDevices, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lb_cookie_stickiness_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lb_cookie_stickiness_policy.go deleted file mode 100644 index 026f981..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lb_cookie_stickiness_policy.go +++ /dev/null @@ -1,182 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLBCookieStickinessPolicy() *schema.Resource { - return &schema.Resource{ - // There is no concept of "updating" an LB Stickiness policy in - // the AWS API. - Create: resourceAwsLBCookieStickinessPolicyCreate, - Read: resourceAwsLBCookieStickinessPolicyRead, - Delete: resourceAwsLBCookieStickinessPolicyDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "load_balancer": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "lb_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - - "cookie_expiration_period": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(int) - if value <= 0 { - es = append(es, fmt.Errorf( - "LB Cookie Expiration Period must be greater than zero if specified")) - } - return - }, - }, - }, - } -} - -func resourceAwsLBCookieStickinessPolicyCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - // Provision the LBStickinessPolicy - lbspOpts := &elb.CreateLBCookieStickinessPolicyInput{ - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - PolicyName: aws.String(d.Get("name").(string)), - } - - if v := d.Get("cookie_expiration_period").(int); v > 0 { - lbspOpts.CookieExpirationPeriod = aws.Int64(int64(v)) - } - - log.Printf("[DEBUG] LB Cookie Stickiness Policy opts: %#v", lbspOpts) - if _, err := elbconn.CreateLBCookieStickinessPolicy(lbspOpts); err != nil { - return fmt.Errorf("Error creating LBCookieStickinessPolicy: %s", err) - } - - setLoadBalancerOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - LoadBalancerPort: aws.Int64(int64(d.Get("lb_port").(int))), - PolicyNames: []*string{aws.String(d.Get("name").(string))}, - } - - log.Printf("[DEBUG] LB Cookie Stickiness create configuration: %#v", setLoadBalancerOpts) - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(setLoadBalancerOpts); err != nil { - return fmt.Errorf("Error setting LBCookieStickinessPolicy: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%d:%s", - *lbspOpts.LoadBalancerName, - *setLoadBalancerOpts.LoadBalancerPort, - *lbspOpts.PolicyName)) - return nil -} - -func resourceAwsLBCookieStickinessPolicyRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - lbName, lbPort, policyName := resourceAwsLBCookieStickinessPolicyParseId(d.Id()) - - request := &elb.DescribeLoadBalancerPoliciesInput{ - LoadBalancerName: aws.String(lbName), - PolicyNames: []*string{aws.String(policyName)}, - } - - getResp, err := elbconn.DescribeLoadBalancerPolicies(request) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "PolicyNotFound" || ec2err.Code() == "LoadBalancerNotFound" { - d.SetId("") - } - return nil - } - return fmt.Errorf("Error retrieving policy: %s", err) - } - - if len(getResp.PolicyDescriptions) != 1 { - return fmt.Errorf("Unable to find policy %#v", getResp.PolicyDescriptions) - } - - // we know the policy exists now, but we have to check if it's assigned to a listener - assigned, err := resourceAwsELBSticknessPolicyAssigned(policyName, lbName, lbPort, elbconn) - if err != nil { - return err - } - if !assigned { - // policy exists, but isn't assigned to a listener - log.Printf("[DEBUG] policy '%s' exists, but isn't assigned to a listener", policyName) - d.SetId("") - return nil - } - - // We can get away with this because there's only one attribute, the - // cookie expiration, in these descriptions. - policyDesc := getResp.PolicyDescriptions[0] - cookieAttr := policyDesc.PolicyAttributeDescriptions[0] - if *cookieAttr.AttributeName != "CookieExpirationPeriod" { - return fmt.Errorf("Unable to find cookie expiration period.") - } - d.Set("cookie_expiration_period", cookieAttr.AttributeValue) - - d.Set("name", policyName) - d.Set("load_balancer", lbName) - d.Set("lb_port", lbPort) - - return nil -} - -func resourceAwsLBCookieStickinessPolicyDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - lbName, _, policyName := resourceAwsLBCookieStickinessPolicyParseId(d.Id()) - - // Perversely, if we Set an empty list of PolicyNames, we detach the - // policies attached to a listener, which is required to delete the - // policy itself. - setLoadBalancerOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - LoadBalancerPort: aws.Int64(int64(d.Get("lb_port").(int))), - PolicyNames: []*string{}, - } - - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(setLoadBalancerOpts); err != nil { - return fmt.Errorf("Error removing LBCookieStickinessPolicy: %s", err) - } - - request := &elb.DeleteLoadBalancerPolicyInput{ - LoadBalancerName: aws.String(lbName), - PolicyName: aws.String(policyName), - } - - if _, err := elbconn.DeleteLoadBalancerPolicy(request); err != nil { - return fmt.Errorf("Error deleting LB stickiness policy %s: %s", d.Id(), err) - } - return nil -} - -// resourceAwsLBCookieStickinessPolicyParseId takes an ID and parses it into -// it's constituent parts. You need three axes (LB name, policy name, and LB -// port) to create or identify a stickiness policy in AWS's API. -func resourceAwsLBCookieStickinessPolicyParseId(id string) (string, string, string) { - parts := strings.SplitN(id, ":", 3) - return parts[0], parts[1], parts[2] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lb_ssl_negotiation_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lb_ssl_negotiation_policy.go deleted file mode 100644 index 64a9f98..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lb_ssl_negotiation_policy.go +++ /dev/null @@ -1,189 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLBSSLNegotiationPolicy() *schema.Resource { - return &schema.Resource{ - // There is no concept of "updating" an LB policy in - // the AWS API. - Create: resourceAwsLBSSLNegotiationPolicyCreate, - Read: resourceAwsLBSSLNegotiationPolicyRead, - Delete: resourceAwsLBSSLNegotiationPolicyDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "load_balancer": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "lb_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - - "attribute": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - return hashcode.String(buf.String()) - }, - }, - }, - } -} - -func resourceAwsLBSSLNegotiationPolicyCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - // Provision the SSLNegotiationPolicy - lbspOpts := &elb.CreateLoadBalancerPolicyInput{ - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - PolicyName: aws.String(d.Get("name").(string)), - PolicyTypeName: aws.String("SSLNegotiationPolicyType"), - } - - // Check for Policy Attributes - if v, ok := d.GetOk("attribute"); ok { - var err error - // Expand the "attribute" set to aws-sdk-go compat []*elb.PolicyAttribute - lbspOpts.PolicyAttributes, err = expandPolicyAttributes(v.(*schema.Set).List()) - if err != nil { - return err - } - } - - log.Printf("[DEBUG] Load Balancer Policy opts: %#v", lbspOpts) - if _, err := elbconn.CreateLoadBalancerPolicy(lbspOpts); err != nil { - return fmt.Errorf("Error creating Load Balancer Policy: %s", err) - } - - setLoadBalancerOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - LoadBalancerPort: aws.Int64(int64(d.Get("lb_port").(int))), - PolicyNames: []*string{aws.String(d.Get("name").(string))}, - } - - log.Printf("[DEBUG] SSL Negotiation create configuration: %#v", setLoadBalancerOpts) - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(setLoadBalancerOpts); err != nil { - return fmt.Errorf("Error setting SSLNegotiationPolicy: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%d:%s", - *lbspOpts.LoadBalancerName, - *setLoadBalancerOpts.LoadBalancerPort, - *lbspOpts.PolicyName)) - return nil -} - -func resourceAwsLBSSLNegotiationPolicyRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - lbName, lbPort, policyName := resourceAwsLBSSLNegotiationPolicyParseId(d.Id()) - - request := &elb.DescribeLoadBalancerPoliciesInput{ - LoadBalancerName: aws.String(lbName), - PolicyNames: []*string{aws.String(policyName)}, - } - - getResp, err := elbconn.DescribeLoadBalancerPolicies(request) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "PolicyNotFound" { - // The policy is gone. - d.SetId("") - return nil - } else if isLoadBalancerNotFound(err) { - // The ELB is gone now, so just remove it from the state - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving policy: %s", err) - } - - if len(getResp.PolicyDescriptions) != 1 { - return fmt.Errorf("Unable to find policy %#v", getResp.PolicyDescriptions) - } - - // We can get away with this because there's only one policy returned - policyDesc := getResp.PolicyDescriptions[0] - attributes := flattenPolicyAttributes(policyDesc.PolicyAttributeDescriptions) - d.Set("attributes", attributes) - - d.Set("name", policyName) - d.Set("load_balancer", lbName) - d.Set("lb_port", lbPort) - - return nil -} - -func resourceAwsLBSSLNegotiationPolicyDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - lbName, _, policyName := resourceAwsLBSSLNegotiationPolicyParseId(d.Id()) - - // Perversely, if we Set an empty list of PolicyNames, we detach the - // policies attached to a listener, which is required to delete the - // policy itself. - setLoadBalancerOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(d.Get("load_balancer").(string)), - LoadBalancerPort: aws.Int64(int64(d.Get("lb_port").(int))), - PolicyNames: []*string{}, - } - - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(setLoadBalancerOpts); err != nil { - return fmt.Errorf("Error removing SSLNegotiationPolicy: %s", err) - } - - request := &elb.DeleteLoadBalancerPolicyInput{ - LoadBalancerName: aws.String(lbName), - PolicyName: aws.String(policyName), - } - - if _, err := elbconn.DeleteLoadBalancerPolicy(request); err != nil { - return fmt.Errorf("Error deleting SSL negotiation policy %s: %s", d.Id(), err) - } - return nil -} - -// resourceAwsLBSSLNegotiationPolicyParseId takes an ID and parses it into -// it's constituent parts. You need three axes (LB name, policy name, and LB -// port) to create or identify an SSL negotiation policy in AWS's API. -func resourceAwsLBSSLNegotiationPolicyParseId(id string) (string, string, string) { - parts := strings.SplitN(id, ":", 3) - return parts[0], parts[1], parts[2] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_domain.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_domain.go deleted file mode 100644 index 865eb59..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_domain.go +++ /dev/null @@ -1,79 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/lightsail" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLightsailDomain() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLightsailDomainCreate, - Read: resourceAwsLightsailDomainRead, - Delete: resourceAwsLightsailDomainDelete, - - Schema: map[string]*schema.Schema{ - "domain_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsLightsailDomainCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - _, err := conn.CreateDomain(&lightsail.CreateDomainInput{ - DomainName: aws.String(d.Get("domain_name").(string)), - }) - - if err != nil { - return err - } - - d.SetId(d.Get("domain_name").(string)) - - return resourceAwsLightsailDomainRead(d, meta) -} - -func resourceAwsLightsailDomainRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - resp, err := conn.GetDomain(&lightsail.GetDomainInput{ - DomainName: aws.String(d.Id()), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NotFoundException" { - log.Printf("[WARN] Lightsail Domain (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - return err - } - return err - } - - d.Set("arn", resp.Domain.Arn) - return nil -} - -func resourceAwsLightsailDomainDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - _, err := conn.DeleteDomain(&lightsail.DeleteDomainInput{ - DomainName: aws.String(d.Id()), - }) - - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_instance.go deleted file mode 100644 index 34f2495..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_instance.go +++ /dev/null @@ -1,264 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/lightsail" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLightsailInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLightsailInstanceCreate, - Read: resourceAwsLightsailInstanceRead, - Delete: resourceAwsLightsailInstanceDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "availability_zone": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "blueprint_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "bundle_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - // Optional attributes - "key_pair_name": { - // Not compatible with aws_key_pair (yet) - // We'll need a new aws_lightsail_key_pair resource - Type: schema.TypeString, - Optional: true, - ForceNew: true, - DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { - if old == "LightsailDefaultKeyPair" && new == "" { - return true - } - return false - }, - }, - - // cannot be retrieved from the API - "user_data": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - // additional info returned from the API - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "created_at": { - Type: schema.TypeString, - Computed: true, - }, - "cpu_count": { - Type: schema.TypeInt, - Computed: true, - }, - "ram_size": { - Type: schema.TypeInt, - Computed: true, - }, - "ipv6_address": { - Type: schema.TypeString, - Computed: true, - }, - "is_static_ip": { - Type: schema.TypeBool, - Computed: true, - }, - "private_ip_address": { - Type: schema.TypeString, - Computed: true, - }, - "public_ip_address": { - Type: schema.TypeString, - Computed: true, - }, - "username": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsLightsailInstanceCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - - iName := d.Get("name").(string) - - req := lightsail.CreateInstancesInput{ - AvailabilityZone: aws.String(d.Get("availability_zone").(string)), - BlueprintId: aws.String(d.Get("blueprint_id").(string)), - BundleId: aws.String(d.Get("bundle_id").(string)), - InstanceNames: aws.StringSlice([]string{iName}), - } - - if v, ok := d.GetOk("key_pair_name"); ok { - req.KeyPairName = aws.String(v.(string)) - } - if v, ok := d.GetOk("user_data"); ok { - req.UserData = aws.String(v.(string)) - } - - resp, err := conn.CreateInstances(&req) - if err != nil { - return err - } - - if len(resp.Operations) == 0 { - return fmt.Errorf("[ERR] No operations found for CreateInstance request") - } - - op := resp.Operations[0] - d.SetId(d.Get("name").(string)) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"Started"}, - Target: []string{"Completed", "Succeeded"}, - Refresh: resourceAwsLightsailOperationRefreshFunc(op.Id, meta), - Timeout: 10 * time.Minute, - Delay: 5 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - // We don't return an error here because the Create call succeded - log.Printf("[ERR] Error waiting for instance (%s) to become ready: %s", d.Id(), err) - } - - return resourceAwsLightsailInstanceRead(d, meta) -} - -func resourceAwsLightsailInstanceRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - resp, err := conn.GetInstance(&lightsail.GetInstanceInput{ - InstanceName: aws.String(d.Id()), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NotFoundException" { - log.Printf("[WARN] Lightsail Instance (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - return err - } - return err - } - - if resp == nil { - log.Printf("[WARN] Lightsail Instance (%s) not found, nil response from server, removing from state", d.Id()) - d.SetId("") - return nil - } - - i := resp.Instance - - d.Set("availability_zone", i.Location.AvailabilityZone) - d.Set("blueprint_id", i.BlueprintId) - d.Set("bundle_id", i.BundleId) - d.Set("key_pair_name", i.SshKeyName) - d.Set("name", i.Name) - - // additional attributes - d.Set("arn", i.Arn) - d.Set("username", i.Username) - d.Set("created_at", i.CreatedAt.Format(time.RFC3339)) - d.Set("cpu_count", i.Hardware.CpuCount) - d.Set("ram_size", strconv.FormatFloat(*i.Hardware.RamSizeInGb, 'f', 0, 64)) - d.Set("ipv6_address", i.Ipv6Address) - d.Set("is_static_ip", i.IsStaticIp) - d.Set("private_ip_address", i.PrivateIpAddress) - d.Set("public_ip_address", i.PublicIpAddress) - - return nil -} - -func resourceAwsLightsailInstanceDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - resp, err := conn.DeleteInstance(&lightsail.DeleteInstanceInput{ - InstanceName: aws.String(d.Id()), - }) - - if err != nil { - return err - } - - op := resp.Operations[0] - - stateConf := &resource.StateChangeConf{ - Pending: []string{"Started"}, - Target: []string{"Completed", "Succeeded"}, - Refresh: resourceAwsLightsailOperationRefreshFunc(op.Id, meta), - Timeout: 10 * time.Minute, - Delay: 5 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for instance (%s) to become destroyed: %s", - d.Id(), err) - } - - d.SetId("") - return nil -} - -// method to check the status of an Operation, which is returned from -// Create/Delete methods. -// Status's are an aws.OperationStatus enum: -// - NotStarted -// - Started -// - Failed -// - Completed -// - Succeeded (not documented?) -func resourceAwsLightsailOperationRefreshFunc( - oid *string, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - conn := meta.(*AWSClient).lightsailconn - log.Printf("[DEBUG] Checking if Lightsail Operation (%s) is Completed", *oid) - o, err := conn.GetOperation(&lightsail.GetOperationInput{ - OperationId: oid, - }) - if err != nil { - return o, "FAILED", err - } - - if o.Operation == nil { - return nil, "Failed", fmt.Errorf("[ERR] Error retrieving Operation info for operation (%s)", *oid) - } - - log.Printf("[DEBUG] Lightsail Operation (%s) is currently %q", *oid, *o.Operation.Status) - return o, *o.Operation.Status, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_key_pair.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_key_pair.go deleted file mode 100644 index 24138aa..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_lightsail_key_pair.go +++ /dev/null @@ -1,225 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/lightsail" - "github.com/hashicorp/terraform/helper/encryption" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLightsailKeyPair() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLightsailKeyPairCreate, - Read: resourceAwsLightsailKeyPairRead, - Delete: resourceAwsLightsailKeyPairDelete, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - }, - "name_prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - // optional fields - "pgp_key": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - // additional info returned from the API - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - // fields returned from CreateKey - "fingerprint": { - Type: schema.TypeString, - Computed: true, - }, - "public_key": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, - }, - "private_key": { - Type: schema.TypeString, - Computed: true, - }, - - // encrypted fields if pgp_key is given - "encrypted_fingerprint": { - Type: schema.TypeString, - Computed: true, - }, - "encrypted_private_key": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsLightsailKeyPairCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - - var kName string - if v, ok := d.GetOk("name"); ok { - kName = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - kName = resource.PrefixedUniqueId(v.(string)) - } else { - kName = resource.UniqueId() - } - - var pubKey string - var op *lightsail.Operation - if pubKeyInterface, ok := d.GetOk("public_key"); ok { - pubKey = pubKeyInterface.(string) - } - - if pubKey == "" { - // creating new key - resp, err := conn.CreateKeyPair(&lightsail.CreateKeyPairInput{ - KeyPairName: aws.String(kName), - }) - if err != nil { - return err - } - if resp.Operation == nil { - return fmt.Errorf("[ERR] No operation found for CreateKeyPair response") - } - if resp.KeyPair == nil { - return fmt.Errorf("[ERR] No KeyPair information found for CreateKeyPair response") - } - d.SetId(kName) - - // private_key and public_key are only available in the response from - // CreateKey pair. Here we set the public_key, and encrypt the private_key - // if a pgp_key is given, else we store the private_key in state - d.Set("public_key", resp.PublicKeyBase64) - - // encrypt private key if pgp_key is given - pgpKey, err := encryption.RetrieveGPGKey(d.Get("pgp_key").(string)) - if err != nil { - return err - } - if pgpKey != "" { - fingerprint, encrypted, err := encryption.EncryptValue(pgpKey, *resp.PrivateKeyBase64, "Lightsail Private Key") - if err != nil { - return err - } - - d.Set("encrypted_fingerprint", fingerprint) - d.Set("encrypted_private_key", encrypted) - } else { - d.Set("private_key", resp.PrivateKeyBase64) - } - - op = resp.Operation - } else { - // importing key - resp, err := conn.ImportKeyPair(&lightsail.ImportKeyPairInput{ - KeyPairName: aws.String(kName), - PublicKeyBase64: aws.String(pubKey), - }) - - if err != nil { - log.Printf("[ERR] Error importing key: %s", err) - return err - } - d.SetId(kName) - - op = resp.Operation - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"Started"}, - Target: []string{"Completed", "Succeeded"}, - Refresh: resourceAwsLightsailOperationRefreshFunc(op.Id, meta), - Timeout: 10 * time.Minute, - Delay: 5 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err := stateConf.WaitForState() - if err != nil { - // We don't return an error here because the Create call succeded - log.Printf("[ERR] Error waiting for KeyPair (%s) to become ready: %s", d.Id(), err) - } - - return resourceAwsLightsailKeyPairRead(d, meta) -} - -func resourceAwsLightsailKeyPairRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - - resp, err := conn.GetKeyPair(&lightsail.GetKeyPairInput{ - KeyPairName: aws.String(d.Id()), - }) - - if err != nil { - log.Printf("[WARN] Error getting KeyPair (%s): %s", d.Id(), err) - // check for known not found error - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NotFoundException" { - log.Printf("[WARN] Lightsail KeyPair (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - } - return err - } - - d.Set("arn", resp.KeyPair.Arn) - d.Set("name", resp.KeyPair.Name) - d.Set("fingerprint", resp.KeyPair.Fingerprint) - - return nil -} - -func resourceAwsLightsailKeyPairDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - resp, err := conn.DeleteKeyPair(&lightsail.DeleteKeyPairInput{ - KeyPairName: aws.String(d.Id()), - }) - - if err != nil { - return err - } - - op := resp.Operation - stateConf := &resource.StateChangeConf{ - Pending: []string{"Started"}, - Target: []string{"Completed", "Succeeded"}, - Refresh: resourceAwsLightsailOperationRefreshFunc(op.Id, meta), - Timeout: 10 * time.Minute, - Delay: 5 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for KeyPair (%s) to become destroyed: %s", - d.Id(), err) - } - - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_backend_server_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_backend_server_policy.go deleted file mode 100644 index 325c4fd..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_backend_server_policy.go +++ /dev/null @@ -1,138 +0,0 @@ -package aws - -import ( - "fmt" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLoadBalancerBackendServerPolicies() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLoadBalancerBackendServerPoliciesCreate, - Read: resourceAwsLoadBalancerBackendServerPoliciesRead, - Update: resourceAwsLoadBalancerBackendServerPoliciesCreate, - Delete: resourceAwsLoadBalancerBackendServerPoliciesDelete, - - Schema: map[string]*schema.Schema{ - "load_balancer_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "policy_names": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Set: schema.HashString, - }, - - "instance_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - }, - } -} - -func resourceAwsLoadBalancerBackendServerPoliciesCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - loadBalancerName := d.Get("load_balancer_name") - - policyNames := []*string{} - if v, ok := d.GetOk("policy_names"); ok { - policyNames = expandStringList(v.(*schema.Set).List()) - } - - setOpts := &elb.SetLoadBalancerPoliciesForBackendServerInput{ - LoadBalancerName: aws.String(loadBalancerName.(string)), - InstancePort: aws.Int64(int64(d.Get("instance_port").(int))), - PolicyNames: policyNames, - } - - if _, err := elbconn.SetLoadBalancerPoliciesForBackendServer(setOpts); err != nil { - return fmt.Errorf("Error setting LoadBalancerPoliciesForBackendServer: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%s", *setOpts.LoadBalancerName, strconv.FormatInt(*setOpts.InstancePort, 10))) - return resourceAwsLoadBalancerBackendServerPoliciesRead(d, meta) -} - -func resourceAwsLoadBalancerBackendServerPoliciesRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - loadBalancerName, instancePort := resourceAwsLoadBalancerBackendServerPoliciesParseId(d.Id()) - - describeElbOpts := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{aws.String(loadBalancerName)}, - } - - describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "LoadBalancerNotFound" { - d.SetId("") - return fmt.Errorf("LoadBalancerNotFound: %s", err) - } - } - return fmt.Errorf("Error retrieving ELB description: %s", err) - } - - if len(describeResp.LoadBalancerDescriptions) != 1 { - return fmt.Errorf("Unable to find ELB: %#v", describeResp.LoadBalancerDescriptions) - } - - lb := describeResp.LoadBalancerDescriptions[0] - - policyNames := []*string{} - for _, backendServer := range lb.BackendServerDescriptions { - if instancePort != strconv.Itoa(int(*backendServer.InstancePort)) { - continue - } - - for _, name := range backendServer.PolicyNames { - policyNames = append(policyNames, name) - } - } - - d.Set("load_balancer_name", loadBalancerName) - d.Set("instance_port", instancePort) - d.Set("policy_names", flattenStringList(policyNames)) - - return nil -} - -func resourceAwsLoadBalancerBackendServerPoliciesDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - loadBalancerName, instancePort := resourceAwsLoadBalancerBackendServerPoliciesParseId(d.Id()) - - instancePortInt, err := strconv.ParseInt(instancePort, 10, 64) - if err != nil { - return fmt.Errorf("Error parsing instancePort as integer: %s", err) - } - - setOpts := &elb.SetLoadBalancerPoliciesForBackendServerInput{ - LoadBalancerName: aws.String(loadBalancerName), - InstancePort: aws.Int64(instancePortInt), - PolicyNames: []*string{}, - } - - if _, err := elbconn.SetLoadBalancerPoliciesForBackendServer(setOpts); err != nil { - return fmt.Errorf("Error setting LoadBalancerPoliciesForBackendServer: %s", err) - } - - d.SetId("") - return nil -} - -func resourceAwsLoadBalancerBackendServerPoliciesParseId(id string) (string, string) { - parts := strings.SplitN(id, ":", 2) - return parts[0], parts[1] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_listener_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_listener_policy.go deleted file mode 100644 index d1c8cac..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_listener_policy.go +++ /dev/null @@ -1,138 +0,0 @@ -package aws - -import ( - "fmt" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLoadBalancerListenerPolicies() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLoadBalancerListenerPoliciesCreate, - Read: resourceAwsLoadBalancerListenerPoliciesRead, - Update: resourceAwsLoadBalancerListenerPoliciesCreate, - Delete: resourceAwsLoadBalancerListenerPoliciesDelete, - - Schema: map[string]*schema.Schema{ - "load_balancer_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "policy_names": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Set: schema.HashString, - }, - - "load_balancer_port": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - }, - } -} - -func resourceAwsLoadBalancerListenerPoliciesCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - loadBalancerName := d.Get("load_balancer_name") - - policyNames := []*string{} - if v, ok := d.GetOk("policy_names"); ok { - policyNames = expandStringList(v.(*schema.Set).List()) - } - - setOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(loadBalancerName.(string)), - LoadBalancerPort: aws.Int64(int64(d.Get("load_balancer_port").(int))), - PolicyNames: policyNames, - } - - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(setOpts); err != nil { - return fmt.Errorf("Error setting LoadBalancerPoliciesOfListener: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%s", *setOpts.LoadBalancerName, strconv.FormatInt(*setOpts.LoadBalancerPort, 10))) - return resourceAwsLoadBalancerListenerPoliciesRead(d, meta) -} - -func resourceAwsLoadBalancerListenerPoliciesRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - loadBalancerName, loadBalancerPort := resourceAwsLoadBalancerListenerPoliciesParseId(d.Id()) - - describeElbOpts := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{aws.String(loadBalancerName)}, - } - - describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "LoadBalancerNotFound" { - d.SetId("") - return fmt.Errorf("LoadBalancerNotFound: %s", err) - } - } - return fmt.Errorf("Error retrieving ELB description: %s", err) - } - - if len(describeResp.LoadBalancerDescriptions) != 1 { - return fmt.Errorf("Unable to find ELB: %#v", describeResp.LoadBalancerDescriptions) - } - - lb := describeResp.LoadBalancerDescriptions[0] - - policyNames := []*string{} - for _, listener := range lb.ListenerDescriptions { - if loadBalancerPort != strconv.Itoa(int(*listener.Listener.LoadBalancerPort)) { - continue - } - - for _, name := range listener.PolicyNames { - policyNames = append(policyNames, name) - } - } - - d.Set("load_balancer_name", loadBalancerName) - d.Set("load_balancer_port", loadBalancerPort) - d.Set("policy_names", flattenStringList(policyNames)) - - return nil -} - -func resourceAwsLoadBalancerListenerPoliciesDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - loadBalancerName, loadBalancerPort := resourceAwsLoadBalancerListenerPoliciesParseId(d.Id()) - - loadBalancerPortInt, err := strconv.ParseInt(loadBalancerPort, 10, 64) - if err != nil { - return fmt.Errorf("Error parsing loadBalancerPort as integer: %s", err) - } - - setOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(loadBalancerName), - LoadBalancerPort: aws.Int64(loadBalancerPortInt), - PolicyNames: []*string{}, - } - - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(setOpts); err != nil { - return fmt.Errorf("Error setting LoadBalancerPoliciesOfListener: %s", err) - } - - d.SetId("") - return nil -} - -func resourceAwsLoadBalancerListenerPoliciesParseId(id string) (string, string) { - parts := strings.SplitN(id, ":", 2) - return parts[0], parts[1] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_policy.go deleted file mode 100644 index 8305cf9..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_load_balancer_policy.go +++ /dev/null @@ -1,352 +0,0 @@ -package aws - -import ( - "fmt" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsLoadBalancerPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLoadBalancerPolicyCreate, - Read: resourceAwsLoadBalancerPolicyRead, - Update: resourceAwsLoadBalancerPolicyUpdate, - Delete: resourceAwsLoadBalancerPolicyDelete, - - Schema: map[string]*schema.Schema{ - "load_balancer_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "policy_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "policy_type_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "policy_attribute": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "value": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsLoadBalancerPolicyCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - attributes := []*elb.PolicyAttribute{} - if attributedata, ok := d.GetOk("policy_attribute"); ok { - attributeSet := attributedata.(*schema.Set).List() - for _, attribute := range attributeSet { - data := attribute.(map[string]interface{}) - attributes = append(attributes, &elb.PolicyAttribute{ - AttributeName: aws.String(data["name"].(string)), - AttributeValue: aws.String(data["value"].(string)), - }) - } - } - - lbspOpts := &elb.CreateLoadBalancerPolicyInput{ - LoadBalancerName: aws.String(d.Get("load_balancer_name").(string)), - PolicyName: aws.String(d.Get("policy_name").(string)), - PolicyTypeName: aws.String(d.Get("policy_type_name").(string)), - PolicyAttributes: attributes, - } - - if _, err := elbconn.CreateLoadBalancerPolicy(lbspOpts); err != nil { - return fmt.Errorf("Error creating LoadBalancerPolicy: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%s", - *lbspOpts.LoadBalancerName, - *lbspOpts.PolicyName)) - return resourceAwsLoadBalancerPolicyRead(d, meta) -} - -func resourceAwsLoadBalancerPolicyRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - loadBalancerName, policyName := resourceAwsLoadBalancerPolicyParseId(d.Id()) - - request := &elb.DescribeLoadBalancerPoliciesInput{ - LoadBalancerName: aws.String(loadBalancerName), - PolicyNames: []*string{aws.String(policyName)}, - } - - getResp, err := elbconn.DescribeLoadBalancerPolicies(request) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "PolicyNotFound" { - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving policy: %s", err) - } - - if len(getResp.PolicyDescriptions) != 1 { - return fmt.Errorf("Unable to find policy %#v", getResp.PolicyDescriptions) - } - - policyDesc := getResp.PolicyDescriptions[0] - policyTypeName := policyDesc.PolicyTypeName - policyAttributes := policyDesc.PolicyAttributeDescriptions - - attributes := []map[string]string{} - for _, a := range policyAttributes { - pair := make(map[string]string) - pair["name"] = *a.AttributeName - pair["value"] = *a.AttributeValue - if (*policyTypeName == "SSLNegotiationPolicyType") && (*a.AttributeValue == "false") { - continue - } - attributes = append(attributes, pair) - } - - d.Set("policy_name", policyName) - d.Set("policy_type_name", policyTypeName) - d.Set("load_balancer_name", loadBalancerName) - d.Set("policy_attribute", attributes) - - return nil -} - -func resourceAwsLoadBalancerPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - reassignments := Reassignment{} - - loadBalancerName, policyName := resourceAwsLoadBalancerPolicyParseId(d.Id()) - - assigned, err := resourceAwsLoadBalancerPolicyAssigned(policyName, loadBalancerName, elbconn) - if err != nil { - return fmt.Errorf("Error determining assignment status of Load Balancer Policy %s: %s", policyName, err) - } - - if assigned { - reassignments, err = resourceAwsLoadBalancerPolicyUnassign(policyName, loadBalancerName, elbconn) - if err != nil { - return fmt.Errorf("Error unassigning Load Balancer Policy %s: %s", policyName, err) - } - } - - request := &elb.DeleteLoadBalancerPolicyInput{ - LoadBalancerName: aws.String(loadBalancerName), - PolicyName: aws.String(policyName), - } - - if _, err := elbconn.DeleteLoadBalancerPolicy(request); err != nil { - return fmt.Errorf("Error deleting Load Balancer Policy %s: %s", d.Id(), err) - } - - err = resourceAwsLoadBalancerPolicyCreate(d, meta) - - for _, listenerAssignment := range reassignments.listenerPolicies { - if _, err := elbconn.SetLoadBalancerPoliciesOfListener(listenerAssignment); err != nil { - return fmt.Errorf("Error setting LoadBalancerPoliciesOfListener: %s", err) - } - } - - for _, backendServerAssignment := range reassignments.backendServerPolicies { - if _, err := elbconn.SetLoadBalancerPoliciesForBackendServer(backendServerAssignment); err != nil { - return fmt.Errorf("Error setting LoadBalancerPoliciesForBackendServer: %s", err) - } - } - - return resourceAwsLoadBalancerPolicyRead(d, meta) -} - -func resourceAwsLoadBalancerPolicyDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - - loadBalancerName, policyName := resourceAwsLoadBalancerPolicyParseId(d.Id()) - - assigned, err := resourceAwsLoadBalancerPolicyAssigned(policyName, loadBalancerName, elbconn) - if err != nil { - return fmt.Errorf("Error determining assignment status of Load Balancer Policy %s: %s", policyName, err) - } - - if assigned { - _, err := resourceAwsLoadBalancerPolicyUnassign(policyName, loadBalancerName, elbconn) - if err != nil { - return fmt.Errorf("Error unassigning Load Balancer Policy %s: %s", policyName, err) - } - } - - request := &elb.DeleteLoadBalancerPolicyInput{ - LoadBalancerName: aws.String(loadBalancerName), - PolicyName: aws.String(policyName), - } - - if _, err := elbconn.DeleteLoadBalancerPolicy(request); err != nil { - return fmt.Errorf("Error deleting Load Balancer Policy %s: %s", d.Id(), err) - } - - d.SetId("") - return nil -} - -func resourceAwsLoadBalancerPolicyParseId(id string) (string, string) { - parts := strings.SplitN(id, ":", 2) - return parts[0], parts[1] -} - -func resourceAwsLoadBalancerPolicyAssigned(policyName, loadBalancerName string, elbconn *elb.ELB) (bool, error) { - describeElbOpts := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{aws.String(loadBalancerName)}, - } - - describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "LoadBalancerNotFound" { - return false, nil - } - } - return false, fmt.Errorf("Error retrieving ELB description: %s", err) - } - - if len(describeResp.LoadBalancerDescriptions) != 1 { - return false, fmt.Errorf("Unable to find ELB: %#v", describeResp.LoadBalancerDescriptions) - } - - lb := describeResp.LoadBalancerDescriptions[0] - assigned := false - for _, backendServer := range lb.BackendServerDescriptions { - for _, name := range backendServer.PolicyNames { - if policyName == *name { - assigned = true - break - } - } - } - - for _, listener := range lb.ListenerDescriptions { - for _, name := range listener.PolicyNames { - if policyName == *name { - assigned = true - break - } - } - } - - return assigned, nil -} - -type Reassignment struct { - backendServerPolicies []*elb.SetLoadBalancerPoliciesForBackendServerInput - listenerPolicies []*elb.SetLoadBalancerPoliciesOfListenerInput -} - -func resourceAwsLoadBalancerPolicyUnassign(policyName, loadBalancerName string, elbconn *elb.ELB) (Reassignment, error) { - reassignments := Reassignment{} - - describeElbOpts := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{aws.String(loadBalancerName)}, - } - - describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "LoadBalancerNotFound" { - return reassignments, nil - } - } - return reassignments, fmt.Errorf("Error retrieving ELB description: %s", err) - } - - if len(describeResp.LoadBalancerDescriptions) != 1 { - return reassignments, fmt.Errorf("Unable to find ELB: %#v", describeResp.LoadBalancerDescriptions) - } - - lb := describeResp.LoadBalancerDescriptions[0] - - for _, backendServer := range lb.BackendServerDescriptions { - policies := []*string{} - - for _, name := range backendServer.PolicyNames { - if policyName != *name { - policies = append(policies, name) - } - } - - if len(backendServer.PolicyNames) != len(policies) { - setOpts := &elb.SetLoadBalancerPoliciesForBackendServerInput{ - LoadBalancerName: aws.String(loadBalancerName), - InstancePort: aws.Int64(*backendServer.InstancePort), - PolicyNames: policies, - } - - reassignOpts := &elb.SetLoadBalancerPoliciesForBackendServerInput{ - LoadBalancerName: aws.String(loadBalancerName), - InstancePort: aws.Int64(*backendServer.InstancePort), - PolicyNames: backendServer.PolicyNames, - } - - reassignments.backendServerPolicies = append(reassignments.backendServerPolicies, reassignOpts) - - _, err = elbconn.SetLoadBalancerPoliciesForBackendServer(setOpts) - if err != nil { - return reassignments, fmt.Errorf("Error Setting Load Balancer Policies for Backend Server: %s", err) - } - } - } - - for _, listener := range lb.ListenerDescriptions { - policies := []*string{} - - for _, name := range listener.PolicyNames { - if policyName != *name { - policies = append(policies, name) - } - } - - if len(listener.PolicyNames) != len(policies) { - setOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(loadBalancerName), - LoadBalancerPort: aws.Int64(*listener.Listener.LoadBalancerPort), - PolicyNames: policies, - } - - reassignOpts := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String(loadBalancerName), - LoadBalancerPort: aws.Int64(*listener.Listener.LoadBalancerPort), - PolicyNames: listener.PolicyNames, - } - - reassignments.listenerPolicies = append(reassignments.listenerPolicies, reassignOpts) - - _, err = elbconn.SetLoadBalancerPoliciesOfListener(setOpts) - if err != nil { - return reassignments, fmt.Errorf("Error Setting Load Balancer Policies of Listener: %s", err) - } - } - } - - return reassignments, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_main_route_table_association.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_main_route_table_association.go deleted file mode 100644 index aabecda..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_main_route_table_association.go +++ /dev/null @@ -1,169 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsMainRouteTableAssociation() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsMainRouteTableAssociationCreate, - Read: resourceAwsMainRouteTableAssociationRead, - Update: resourceAwsMainRouteTableAssociationUpdate, - Delete: resourceAwsMainRouteTableAssociationDelete, - - Schema: map[string]*schema.Schema{ - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "route_table_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - // We use this field to record the main route table that is automatically - // created when the VPC is created. We need this to be able to "destroy" - // our main route table association, which we do by returning this route - // table to its original place as the Main Route Table for the VPC. - "original_route_table_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsMainRouteTableAssociationCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - vpcId := d.Get("vpc_id").(string) - routeTableId := d.Get("route_table_id").(string) - - log.Printf("[INFO] Creating main route table association: %s => %s", vpcId, routeTableId) - - mainAssociation, err := findMainRouteTableAssociation(conn, vpcId) - if err != nil { - return err - } - - resp, err := conn.ReplaceRouteTableAssociation(&ec2.ReplaceRouteTableAssociationInput{ - AssociationId: mainAssociation.RouteTableAssociationId, - RouteTableId: aws.String(routeTableId), - }) - if err != nil { - return err - } - - d.Set("original_route_table_id", mainAssociation.RouteTableId) - d.SetId(*resp.NewAssociationId) - log.Printf("[INFO] New main route table association ID: %s", d.Id()) - - return nil -} - -func resourceAwsMainRouteTableAssociationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - mainAssociation, err := findMainRouteTableAssociation( - conn, - d.Get("vpc_id").(string)) - if err != nil { - return err - } - - if mainAssociation == nil || *mainAssociation.RouteTableAssociationId != d.Id() { - // It seems it doesn't exist anymore, so clear the ID - d.SetId("") - } - - return nil -} - -// Update is almost exactly like Create, except we want to retain the -// original_route_table_id - this needs to stay recorded as the AWS-created -// table from VPC creation. -func resourceAwsMainRouteTableAssociationUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - vpcId := d.Get("vpc_id").(string) - routeTableId := d.Get("route_table_id").(string) - - log.Printf("[INFO] Updating main route table association: %s => %s", vpcId, routeTableId) - - resp, err := conn.ReplaceRouteTableAssociation(&ec2.ReplaceRouteTableAssociationInput{ - AssociationId: aws.String(d.Id()), - RouteTableId: aws.String(routeTableId), - }) - if err != nil { - return err - } - - d.SetId(*resp.NewAssociationId) - log.Printf("[INFO] New main route table association ID: %s", d.Id()) - - return nil -} - -func resourceAwsMainRouteTableAssociationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - vpcId := d.Get("vpc_id").(string) - originalRouteTableId := d.Get("original_route_table_id").(string) - - log.Printf("[INFO] Deleting main route table association by resetting Main Route Table for VPC: %s to its original Route Table: %s", - vpcId, - originalRouteTableId) - - resp, err := conn.ReplaceRouteTableAssociation(&ec2.ReplaceRouteTableAssociationInput{ - AssociationId: aws.String(d.Id()), - RouteTableId: aws.String(originalRouteTableId), - }) - if err != nil { - return err - } - - log.Printf("[INFO] Resulting Association ID: %s", *resp.NewAssociationId) - - return nil -} - -func findMainRouteTableAssociation(conn *ec2.EC2, vpcId string) (*ec2.RouteTableAssociation, error) { - mainRouteTable, err := findMainRouteTable(conn, vpcId) - if err != nil { - return nil, err - } - if mainRouteTable == nil { - return nil, nil - } - - for _, a := range mainRouteTable.Associations { - if *a.Main { - return a, nil - } - } - return nil, fmt.Errorf("Could not find main routing table association for VPC: %s", vpcId) -} - -func findMainRouteTable(conn *ec2.EC2, vpcId string) (*ec2.RouteTable, error) { - mainFilter := &ec2.Filter{ - Name: aws.String("association.main"), - Values: []*string{aws.String("true")}, - } - vpcFilter := &ec2.Filter{ - Name: aws.String("vpc-id"), - Values: []*string{aws.String(vpcId)}, - } - routeResp, err := conn.DescribeRouteTables(&ec2.DescribeRouteTablesInput{ - Filters: []*ec2.Filter{mainFilter, vpcFilter}, - }) - if err != nil { - return nil, err - } else if len(routeResp.RouteTables) != 1 { - return nil, nil - } - - return routeResp.RouteTables[0], nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_nat_gateway.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_nat_gateway.go deleted file mode 100644 index 1ec5e98..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_nat_gateway.go +++ /dev/null @@ -1,195 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsNatGateway() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsNatGatewayCreate, - Read: resourceAwsNatGatewayRead, - Delete: resourceAwsNatGatewayDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "allocation_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "subnet_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "network_interface_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "private_ip": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "public_ip": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsNatGatewayCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Create the NAT Gateway - createOpts := &ec2.CreateNatGatewayInput{ - AllocationId: aws.String(d.Get("allocation_id").(string)), - SubnetId: aws.String(d.Get("subnet_id").(string)), - } - - log.Printf("[DEBUG] Create NAT Gateway: %s", *createOpts) - natResp, err := conn.CreateNatGateway(createOpts) - if err != nil { - return fmt.Errorf("Error creating NAT Gateway: %s", err) - } - - // Get the ID and store it - ng := natResp.NatGateway - d.SetId(*ng.NatGatewayId) - log.Printf("[INFO] NAT Gateway ID: %s", d.Id()) - - // Wait for the NAT Gateway to become available - log.Printf("[DEBUG] Waiting for NAT Gateway (%s) to become available", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"available"}, - Refresh: NGStateRefreshFunc(conn, d.Id()), - Timeout: 10 * time.Minute, - } - - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf("Error waiting for NAT Gateway (%s) to become available: %s", d.Id(), err) - } - - // Update our attributes and return - return resourceAwsNatGatewayRead(d, meta) -} - -func resourceAwsNatGatewayRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Refresh the NAT Gateway state - ngRaw, state, err := NGStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - - status := map[string]bool{ - "deleted": true, - "deleting": true, - "failed": true, - } - - if _, ok := status[strings.ToLower(state)]; ngRaw == nil || ok { - log.Printf("[INFO] Removing %s from Terraform state as it is not found or in the deleted state.", d.Id()) - d.SetId("") - return nil - } - - // Set NAT Gateway attributes - ng := ngRaw.(*ec2.NatGateway) - d.Set("subnet_id", ng.SubnetId) - - // Address - address := ng.NatGatewayAddresses[0] - d.Set("allocation_id", address.AllocationId) - d.Set("network_interface_id", address.NetworkInterfaceId) - d.Set("private_ip", address.PrivateIp) - d.Set("public_ip", address.PublicIp) - - return nil -} - -func resourceAwsNatGatewayDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - deleteOpts := &ec2.DeleteNatGatewayInput{ - NatGatewayId: aws.String(d.Id()), - } - log.Printf("[INFO] Deleting NAT Gateway: %s", d.Id()) - - _, err := conn.DeleteNatGateway(deleteOpts) - if err != nil { - ec2err, ok := err.(awserr.Error) - if !ok { - return err - } - - if ec2err.Code() == "NatGatewayNotFound" { - return nil - } - - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"deleting"}, - Target: []string{"deleted"}, - Refresh: NGStateRefreshFunc(conn, d.Id()), - Timeout: 30 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - _, stateErr := stateConf.WaitForState() - if stateErr != nil { - return fmt.Errorf("Error waiting for NAT Gateway (%s) to delete: %s", d.Id(), err) - } - - return nil -} - -// NGStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// a NAT Gateway. -func NGStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - opts := &ec2.DescribeNatGatewaysInput{ - NatGatewayIds: []*string{aws.String(id)}, - } - resp, err := conn.DescribeNatGateways(opts) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "NatGatewayNotFound" { - resp = nil - } else { - log.Printf("Error on NGStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - ng := resp.NatGateways[0] - return ng, *ng.State, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl.go deleted file mode 100644 index cd3c6d0..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl.go +++ /dev/null @@ -1,646 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "sort" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsNetworkAcl() *schema.Resource { - - return &schema.Resource{ - Create: resourceAwsNetworkAclCreate, - Read: resourceAwsNetworkAclRead, - Delete: resourceAwsNetworkAclDelete, - Update: resourceAwsNetworkAclUpdate, - Importer: &schema.ResourceImporter{ - State: resourceAwsNetworkAclImportState, - }, - - Schema: map[string]*schema.Schema{ - "vpc_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Computed: false, - }, - "subnet_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: false, - Deprecated: "Attribute subnet_id is deprecated on network_acl resources. Use subnet_ids instead", - }, - "subnet_ids": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ConflictsWith: []string{"subnet_id"}, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "ingress": { - Type: schema.TypeSet, - Required: false, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "from_port": { - Type: schema.TypeInt, - Required: true, - }, - "to_port": { - Type: schema.TypeInt, - Required: true, - }, - "rule_no": { - Type: schema.TypeInt, - Required: true, - }, - "action": { - Type: schema.TypeString, - Required: true, - }, - "protocol": { - Type: schema.TypeString, - Required: true, - }, - "cidr_block": { - Type: schema.TypeString, - Optional: true, - }, - "ipv6_cidr_block": { - Type: schema.TypeString, - Optional: true, - }, - "icmp_type": { - Type: schema.TypeInt, - Optional: true, - }, - "icmp_code": { - Type: schema.TypeInt, - Optional: true, - }, - }, - }, - Set: resourceAwsNetworkAclEntryHash, - }, - "egress": { - Type: schema.TypeSet, - Required: false, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "from_port": { - Type: schema.TypeInt, - Required: true, - }, - "to_port": { - Type: schema.TypeInt, - Required: true, - }, - "rule_no": { - Type: schema.TypeInt, - Required: true, - }, - "action": { - Type: schema.TypeString, - Required: true, - }, - "protocol": { - Type: schema.TypeString, - Required: true, - }, - "cidr_block": { - Type: schema.TypeString, - Optional: true, - }, - "ipv6_cidr_block": { - Type: schema.TypeString, - Optional: true, - }, - "icmp_type": { - Type: schema.TypeInt, - Optional: true, - }, - "icmp_code": { - Type: schema.TypeInt, - Optional: true, - }, - }, - }, - Set: resourceAwsNetworkAclEntryHash, - }, - "tags": tagsSchema(), - }, - } -} - -func resourceAwsNetworkAclCreate(d *schema.ResourceData, meta interface{}) error { - - conn := meta.(*AWSClient).ec2conn - - // Create the Network Acl - createOpts := &ec2.CreateNetworkAclInput{ - VpcId: aws.String(d.Get("vpc_id").(string)), - } - - log.Printf("[DEBUG] Network Acl create config: %#v", createOpts) - resp, err := conn.CreateNetworkAcl(createOpts) - if err != nil { - return fmt.Errorf("Error creating network acl: %s", err) - } - - // Get the ID and store it - networkAcl := resp.NetworkAcl - d.SetId(*networkAcl.NetworkAclId) - log.Printf("[INFO] Network Acl ID: %s", *networkAcl.NetworkAclId) - - // Update rules and subnet association once acl is created - return resourceAwsNetworkAclUpdate(d, meta) -} - -func resourceAwsNetworkAclRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeNetworkAcls(&ec2.DescribeNetworkAclsInput{ - NetworkAclIds: []*string{aws.String(d.Id())}, - }) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "InvalidNetworkAclID.NotFound" { - log.Printf("[DEBUG] Network ACL (%s) not found", d.Id()) - d.SetId("") - return nil - } - } - return err - } - if resp == nil { - return nil - } - - networkAcl := resp.NetworkAcls[0] - var ingressEntries []*ec2.NetworkAclEntry - var egressEntries []*ec2.NetworkAclEntry - - // separate the ingress and egress rules - for _, e := range networkAcl.Entries { - // Skip the default rules added by AWS. They can be neither - // configured or deleted by users. - if *e.RuleNumber == awsDefaultAclRuleNumber { - continue - } - - if *e.Egress == true { - egressEntries = append(egressEntries, e) - } else { - ingressEntries = append(ingressEntries, e) - } - } - - d.Set("vpc_id", networkAcl.VpcId) - d.Set("tags", tagsToMap(networkAcl.Tags)) - - var s []string - for _, a := range networkAcl.Associations { - s = append(s, *a.SubnetId) - } - sort.Strings(s) - if err := d.Set("subnet_ids", s); err != nil { - return err - } - - if err := d.Set("ingress", networkAclEntriesToMapList(ingressEntries)); err != nil { - return err - } - if err := d.Set("egress", networkAclEntriesToMapList(egressEntries)); err != nil { - return err - } - - return nil -} - -func resourceAwsNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - d.Partial(true) - - if d.HasChange("ingress") { - err := updateNetworkAclEntries(d, "ingress", conn) - if err != nil { - return err - } - } - - if d.HasChange("egress") { - err := updateNetworkAclEntries(d, "egress", conn) - if err != nil { - return err - } - } - - if d.HasChange("subnet_id") { - //associate new subnet with the acl. - _, n := d.GetChange("subnet_id") - newSubnet := n.(string) - association, err := findNetworkAclAssociation(newSubnet, conn) - if err != nil { - return fmt.Errorf("Failed to update acl %s with subnet %s: %s", d.Id(), newSubnet, err) - } - _, err = conn.ReplaceNetworkAclAssociation(&ec2.ReplaceNetworkAclAssociationInput{ - AssociationId: association.NetworkAclAssociationId, - NetworkAclId: aws.String(d.Id()), - }) - if err != nil { - return err - } - } - - if d.HasChange("subnet_ids") { - o, n := d.GetChange("subnet_ids") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - remove := os.Difference(ns).List() - add := ns.Difference(os).List() - - if len(remove) > 0 { - // A Network ACL is required for each subnet. In order to disassociate a - // subnet from this ACL, we must associate it with the default ACL. - defaultAcl, err := getDefaultNetworkAcl(d.Get("vpc_id").(string), conn) - if err != nil { - return fmt.Errorf("Failed to find Default ACL for VPC %s", d.Get("vpc_id").(string)) - } - for _, r := range remove { - association, err := findNetworkAclAssociation(r.(string), conn) - if err != nil { - return fmt.Errorf("Failed to find acl association: acl %s with subnet %s: %s", d.Id(), r, err) - } - log.Printf("DEBUG] Replacing Network Acl Association (%s) with Default Network ACL ID (%s)", *association.NetworkAclAssociationId, *defaultAcl.NetworkAclId) - _, err = conn.ReplaceNetworkAclAssociation(&ec2.ReplaceNetworkAclAssociationInput{ - AssociationId: association.NetworkAclAssociationId, - NetworkAclId: defaultAcl.NetworkAclId, - }) - if err != nil { - return err - } - } - } - - if len(add) > 0 { - for _, a := range add { - association, err := findNetworkAclAssociation(a.(string), conn) - if err != nil { - return fmt.Errorf("Failed to find acl association: acl %s with subnet %s: %s", d.Id(), a, err) - } - _, err = conn.ReplaceNetworkAclAssociation(&ec2.ReplaceNetworkAclAssociationInput{ - AssociationId: association.NetworkAclAssociationId, - NetworkAclId: aws.String(d.Id()), - }) - if err != nil { - return err - } - } - } - - } - - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - d.Partial(false) - return resourceAwsNetworkAclRead(d, meta) -} - -func updateNetworkAclEntries(d *schema.ResourceData, entryType string, conn *ec2.EC2) error { - if d.HasChange(entryType) { - o, n := d.GetChange(entryType) - - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - toBeDeleted, err := expandNetworkAclEntries(os.Difference(ns).List(), entryType) - if err != nil { - return err - } - for _, remove := range toBeDeleted { - // AWS includes default rules with all network ACLs that can be - // neither modified nor destroyed. They have a custom rule - // number that is out of bounds for any other rule. If we - // encounter it, just continue. There's no work to be done. - if *remove.RuleNumber == awsDefaultAclRuleNumber { - continue - } - - // Delete old Acl - log.Printf("[DEBUG] Destroying Network ACL Entry number (%d)", int(*remove.RuleNumber)) - _, err := conn.DeleteNetworkAclEntry(&ec2.DeleteNetworkAclEntryInput{ - NetworkAclId: aws.String(d.Id()), - RuleNumber: remove.RuleNumber, - Egress: remove.Egress, - }) - if err != nil { - return fmt.Errorf("Error deleting %s entry: %s", entryType, err) - } - } - - toBeCreated, err := expandNetworkAclEntries(ns.Difference(os).List(), entryType) - if err != nil { - return err - } - for _, add := range toBeCreated { - // Protocol -1 rules don't store ports in AWS. Thus, they'll always - // hash differently when being read out of the API. Force the user - // to set from_port and to_port to 0 for these rules, to keep the - // hashing consistent. - if *add.Protocol == "-1" { - to := *add.PortRange.To - from := *add.PortRange.From - expected := &expectedPortPair{ - to_port: 0, - from_port: 0, - } - if ok := validatePorts(to, from, *expected); !ok { - return fmt.Errorf( - "to_port (%d) and from_port (%d) must both be 0 to use the the 'all' \"-1\" protocol!", - to, from) - } - } - - if add.CidrBlock != nil { - // AWS mutates the CIDR block into a network implied by the IP and - // mask provided. This results in hashing inconsistencies between - // the local config file and the state returned by the API. Error - // if the user provides a CIDR block with an inappropriate mask - if err := validateCIDRBlock(*add.CidrBlock); err != nil { - return err - } - } - - createOpts := &ec2.CreateNetworkAclEntryInput{ - NetworkAclId: aws.String(d.Id()), - Egress: add.Egress, - PortRange: add.PortRange, - Protocol: add.Protocol, - RuleAction: add.RuleAction, - RuleNumber: add.RuleNumber, - IcmpTypeCode: add.IcmpTypeCode, - } - - if add.CidrBlock != nil { - createOpts.CidrBlock = add.CidrBlock - } - - if add.Ipv6CidrBlock != nil { - createOpts.Ipv6CidrBlock = add.Ipv6CidrBlock - } - - // Add new Acl entry - _, connErr := conn.CreateNetworkAclEntry(createOpts) - if connErr != nil { - return fmt.Errorf("Error creating %s entry: %s", entryType, connErr) - } - } - } - return nil -} - -func resourceAwsNetworkAclDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[INFO] Deleting Network Acl: %s", d.Id()) - retryErr := resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteNetworkAcl(&ec2.DeleteNetworkAclInput{ - NetworkAclId: aws.String(d.Id()), - }) - if err != nil { - ec2err := err.(awserr.Error) - switch ec2err.Code() { - case "InvalidNetworkAclID.NotFound": - return nil - case "DependencyViolation": - // In case of dependency violation, we remove the association between subnet and network acl. - // This means the subnet is attached to default acl of vpc. - var associations []*ec2.NetworkAclAssociation - if v, ok := d.GetOk("subnet_id"); ok { - - a, err := findNetworkAclAssociation(v.(string), conn) - if err != nil { - return resource.NonRetryableError(err) - } - associations = append(associations, a) - } else if v, ok := d.GetOk("subnet_ids"); ok { - ids := v.(*schema.Set).List() - for _, i := range ids { - a, err := findNetworkAclAssociation(i.(string), conn) - if err != nil { - return resource.NonRetryableError(err) - } - associations = append(associations, a) - } - } - - log.Printf("[DEBUG] Replacing network associations for Network ACL (%s): %s", d.Id(), associations) - defaultAcl, err := getDefaultNetworkAcl(d.Get("vpc_id").(string), conn) - if err != nil { - return resource.NonRetryableError(err) - } - - for _, a := range associations { - log.Printf("DEBUG] Replacing Network Acl Association (%s) with Default Network ACL ID (%s)", *a.NetworkAclAssociationId, *defaultAcl.NetworkAclId) - _, replaceErr := conn.ReplaceNetworkAclAssociation(&ec2.ReplaceNetworkAclAssociationInput{ - AssociationId: a.NetworkAclAssociationId, - NetworkAclId: defaultAcl.NetworkAclId, - }) - if replaceErr != nil { - if replaceEc2err, ok := replaceErr.(awserr.Error); ok { - // It's possible that during an attempt to replace this - // association, the Subnet in question has already been moved to - // another ACL. This can happen if you're destroying a network acl - // and simultaneously re-associating it's subnet(s) with another - // ACL; Terraform may have already re-associated the subnet(s) by - // the time we attempt to destroy them, even between the time we - // list them and then try to destroy them. In this case, the - // association we're trying to replace will no longer exist and - // this call will fail. Here we trap that error and fail - // gracefully; the association we tried to replace gone, we trust - // someone else has taken ownership. - if replaceEc2err.Code() == "InvalidAssociationID.NotFound" { - log.Printf("[WARN] Network Association (%s) no longer found; Network Association likely updated or removed externally, removing from state", *a.NetworkAclAssociationId) - continue - } - } - log.Printf("[ERR] Non retry-able error in replacing associations for Network ACL (%s): %s", d.Id(), replaceErr) - return resource.NonRetryableError(replaceErr) - } - } - return resource.RetryableError(fmt.Errorf("Dependencies found and cleaned up, retrying")) - default: - // Any other error, we want to quit the retry loop immediately - return resource.NonRetryableError(err) - } - } - log.Printf("[Info] Deleted network ACL %s successfully", d.Id()) - return nil - }) - - if retryErr != nil { - return fmt.Errorf("[ERR] Error destroying Network ACL (%s): %s", d.Id(), retryErr) - } - return nil -} - -func resourceAwsNetworkAclEntryHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%d-", m["from_port"].(int))) - buf.WriteString(fmt.Sprintf("%d-", m["to_port"].(int))) - buf.WriteString(fmt.Sprintf("%d-", m["rule_no"].(int))) - buf.WriteString(fmt.Sprintf("%s-", m["action"].(string))) - - // The AWS network ACL API only speaks protocol numbers, and that's - // all we store. Never hash a protocol name. - protocol := m["protocol"].(string) - if _, err := strconv.Atoi(m["protocol"].(string)); err != nil { - // We're a protocol name. Look up the number. - buf.WriteString(fmt.Sprintf("%d-", protocolIntegers()[protocol])) - } else { - // We're a protocol number. Pass the value through. - buf.WriteString(fmt.Sprintf("%s-", protocol)) - } - - if v, ok := m["cidr_block"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["ipv6_cidr_block"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["ssl_certificate_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["icmp_type"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(int))) - } - if v, ok := m["icmp_code"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(int))) - } - - return hashcode.String(buf.String()) -} - -func getDefaultNetworkAcl(vpc_id string, conn *ec2.EC2) (defaultAcl *ec2.NetworkAcl, err error) { - resp, err := conn.DescribeNetworkAcls(&ec2.DescribeNetworkAclsInput{ - Filters: []*ec2.Filter{ - { - Name: aws.String("default"), - Values: []*string{aws.String("true")}, - }, - { - Name: aws.String("vpc-id"), - Values: []*string{aws.String(vpc_id)}, - }, - }, - }) - - if err != nil { - return nil, err - } - return resp.NetworkAcls[0], nil -} - -func findNetworkAclAssociation(subnetId string, conn *ec2.EC2) (networkAclAssociation *ec2.NetworkAclAssociation, err error) { - resp, err := conn.DescribeNetworkAcls(&ec2.DescribeNetworkAclsInput{ - Filters: []*ec2.Filter{ - { - Name: aws.String("association.subnet-id"), - Values: []*string{aws.String(subnetId)}, - }, - }, - }) - - if err != nil { - return nil, err - } - if resp.NetworkAcls != nil && len(resp.NetworkAcls) > 0 { - for _, association := range resp.NetworkAcls[0].Associations { - if *association.SubnetId == subnetId { - return association, nil - } - } - } - return nil, fmt.Errorf("could not find association for subnet: %s ", subnetId) -} - -// networkAclEntriesToMapList turns ingress/egress rules read from AWS into a list -// of maps. -func networkAclEntriesToMapList(networkAcls []*ec2.NetworkAclEntry) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(networkAcls)) - for _, entry := range networkAcls { - acl := make(map[string]interface{}) - acl["rule_no"] = *entry.RuleNumber - acl["action"] = *entry.RuleAction - if entry.CidrBlock != nil { - acl["cidr_block"] = *entry.CidrBlock - } - if entry.Ipv6CidrBlock != nil { - acl["ipv6_cidr_block"] = *entry.Ipv6CidrBlock - } - // The AWS network ACL API only speaks protocol numbers, and - // that's all we record. - if _, err := strconv.Atoi(*entry.Protocol); err != nil { - // We're a protocol name. Look up the number. - acl["protocol"] = protocolIntegers()[*entry.Protocol] - } else { - // We're a protocol number. Pass through. - acl["protocol"] = *entry.Protocol - } - - acl["protocol"] = *entry.Protocol - if entry.PortRange != nil { - acl["from_port"] = *entry.PortRange.From - acl["to_port"] = *entry.PortRange.To - } - - if entry.IcmpTypeCode != nil { - acl["icmp_type"] = *entry.IcmpTypeCode.Type - acl["icmp_code"] = *entry.IcmpTypeCode.Code - } - - result = append(result, acl) - } - - return result -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl_rule.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl_rule.go deleted file mode 100644 index 9064ddc..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl_rule.go +++ /dev/null @@ -1,282 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsNetworkAclRule() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsNetworkAclRuleCreate, - Read: resourceAwsNetworkAclRuleRead, - Delete: resourceAwsNetworkAclRuleDelete, - - Schema: map[string]*schema.Schema{ - "network_acl_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "rule_number": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - "egress": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Default: false, - }, - "protocol": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "rule_action": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "cidr_block": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "ipv6_cidr_block": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "from_port": { - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - }, - "to_port": { - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - }, - "icmp_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validateICMPArgumentValue, - }, - "icmp_code": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validateICMPArgumentValue, - }, - }, - } -} - -func resourceAwsNetworkAclRuleCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - protocol := d.Get("protocol").(string) - p, protocolErr := strconv.Atoi(protocol) - if protocolErr != nil { - var ok bool - p, ok = protocolIntegers()[protocol] - if !ok { - return fmt.Errorf("Invalid Protocol %s for rule %d", protocol, d.Get("rule_number").(int)) - } - } - log.Printf("[INFO] Transformed Protocol %s into %d", protocol, p) - - params := &ec2.CreateNetworkAclEntryInput{ - NetworkAclId: aws.String(d.Get("network_acl_id").(string)), - Egress: aws.Bool(d.Get("egress").(bool)), - RuleNumber: aws.Int64(int64(d.Get("rule_number").(int))), - Protocol: aws.String(strconv.Itoa(p)), - RuleAction: aws.String(d.Get("rule_action").(string)), - PortRange: &ec2.PortRange{ - From: aws.Int64(int64(d.Get("from_port").(int))), - To: aws.Int64(int64(d.Get("to_port").(int))), - }, - } - - if v, ok := d.GetOk("cidr_block"); ok { - params.CidrBlock = aws.String(v.(string)) - } - - if v, ok := d.GetOk("ipv6_cidr_block"); ok { - params.Ipv6CidrBlock = aws.String(v.(string)) - } - - // Specify additional required fields for ICMP. For the list - // of ICMP codes and types, see: http://www.nthelp.com/icmp.html - if p == 1 { - params.IcmpTypeCode = &ec2.IcmpTypeCode{} - if v, ok := d.GetOk("icmp_type"); ok { - icmpType, err := strconv.Atoi(v.(string)) - if err != nil { - return fmt.Errorf("Unable to parse ICMP type %s for rule %d", v, d.Get("rule_number").(int)) - } - params.IcmpTypeCode.Type = aws.Int64(int64(icmpType)) - log.Printf("[DEBUG] Got ICMP type %d for rule %d", icmpType, d.Get("rule_number").(int)) - } - if v, ok := d.GetOk("icmp_code"); ok { - icmpCode, err := strconv.Atoi(v.(string)) - if err != nil { - return fmt.Errorf("Unable to parse ICMP code %s for rule %d", v, d.Get("rule_number").(int)) - } - params.IcmpTypeCode.Code = aws.Int64(int64(icmpCode)) - log.Printf("[DEBUG] Got ICMP code %d for rule %d", icmpCode, d.Get("rule_number").(int)) - } - } - - log.Printf("[INFO] Creating Network Acl Rule: %d (%t)", d.Get("rule_number").(int), d.Get("egress").(bool)) - _, err := conn.CreateNetworkAclEntry(params) - if err != nil { - return fmt.Errorf("Error Creating Network Acl Rule: %s", err.Error()) - } - d.SetId(networkAclIdRuleNumberEgressHash(d.Get("network_acl_id").(string), d.Get("rule_number").(int), d.Get("egress").(bool), d.Get("protocol").(string))) - - // It appears it might be a while until the newly created rule is visible via the - // API (see issue GH-4721). Retry the `findNetworkAclRule` function until it is - // visible (which in most cases is likely immediately). - err = resource.Retry(3*time.Minute, func() *resource.RetryError { - _, findErr := findNetworkAclRule(d, meta) - if findErr != nil { - return resource.RetryableError(findErr) - } - - return nil - }) - if err != nil { - return fmt.Errorf("Created Network ACL Rule was not visible in API within 3 minute period. Running 'terraform apply' again will resume infrastructure creation.") - } - - return resourceAwsNetworkAclRuleRead(d, meta) -} - -func resourceAwsNetworkAclRuleRead(d *schema.ResourceData, meta interface{}) error { - resp, err := findNetworkAclRule(d, meta) - if err != nil { - return err - } - - d.Set("rule_number", resp.RuleNumber) - d.Set("cidr_block", resp.CidrBlock) - d.Set("ipv6_cidr_block", resp.Ipv6CidrBlock) - d.Set("egress", resp.Egress) - if resp.IcmpTypeCode != nil { - d.Set("icmp_code", resp.IcmpTypeCode.Code) - d.Set("icmp_type", resp.IcmpTypeCode.Type) - } - if resp.PortRange != nil { - d.Set("from_port", resp.PortRange.From) - d.Set("to_port", resp.PortRange.To) - } - - d.Set("rule_action", resp.RuleAction) - - p, protocolErr := strconv.Atoi(*resp.Protocol) - log.Printf("[INFO] Converting the protocol %v", p) - if protocolErr == nil { - var ok bool - protocol, ok := protocolStrings(protocolIntegers())[p] - if !ok { - return fmt.Errorf("Invalid Protocol %s for rule %d", *resp.Protocol, d.Get("rule_number").(int)) - } - log.Printf("[INFO] Transformed Protocol %s back into %s", *resp.Protocol, protocol) - d.Set("protocol", protocol) - } - - return nil -} - -func resourceAwsNetworkAclRuleDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - params := &ec2.DeleteNetworkAclEntryInput{ - NetworkAclId: aws.String(d.Get("network_acl_id").(string)), - RuleNumber: aws.Int64(int64(d.Get("rule_number").(int))), - Egress: aws.Bool(d.Get("egress").(bool)), - } - - log.Printf("[INFO] Deleting Network Acl Rule: %s", d.Id()) - _, err := conn.DeleteNetworkAclEntry(params) - if err != nil { - return fmt.Errorf("Error Deleting Network Acl Rule: %s", err.Error()) - } - - return nil -} - -func findNetworkAclRule(d *schema.ResourceData, meta interface{}) (*ec2.NetworkAclEntry, error) { - conn := meta.(*AWSClient).ec2conn - - filters := make([]*ec2.Filter, 0, 2) - ruleNumberFilter := &ec2.Filter{ - Name: aws.String("entry.rule-number"), - Values: []*string{aws.String(fmt.Sprintf("%d", d.Get("rule_number").(int)))}, - } - filters = append(filters, ruleNumberFilter) - egressFilter := &ec2.Filter{ - Name: aws.String("entry.egress"), - Values: []*string{aws.String(fmt.Sprintf("%v", d.Get("egress").(bool)))}, - } - filters = append(filters, egressFilter) - params := &ec2.DescribeNetworkAclsInput{ - NetworkAclIds: []*string{aws.String(d.Get("network_acl_id").(string))}, - Filters: filters, - } - - log.Printf("[INFO] Describing Network Acl: %s", d.Get("network_acl_id").(string)) - log.Printf("[INFO] Describing Network Acl with the Filters %#v", params) - resp, err := conn.DescribeNetworkAcls(params) - if err != nil { - return nil, fmt.Errorf("Error Finding Network Acl Rule %d: %s", d.Get("rule_number").(int), err.Error()) - } - - if resp == nil || len(resp.NetworkAcls) != 1 || resp.NetworkAcls[0] == nil { - return nil, fmt.Errorf( - "Expected to find one Network ACL, got: %#v", - resp.NetworkAcls) - } - networkAcl := resp.NetworkAcls[0] - if networkAcl.Entries != nil { - for _, i := range networkAcl.Entries { - if *i.RuleNumber == int64(d.Get("rule_number").(int)) && *i.Egress == d.Get("egress").(bool) { - return i, nil - } - } - } - return nil, fmt.Errorf( - "Expected the Network ACL to have Entries, got: %#v", - networkAcl) - -} - -func networkAclIdRuleNumberEgressHash(networkAclId string, ruleNumber int, egress bool, protocol string) string { - var buf bytes.Buffer - buf.WriteString(fmt.Sprintf("%s-", networkAclId)) - buf.WriteString(fmt.Sprintf("%d-", ruleNumber)) - buf.WriteString(fmt.Sprintf("%t-", egress)) - buf.WriteString(fmt.Sprintf("%s-", protocol)) - return fmt.Sprintf("nacl-%d", hashcode.String(buf.String())) -} - -func validateICMPArgumentValue(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - _, err := strconv.Atoi(value) - if len(value) == 0 || err != nil { - errors = append(errors, fmt.Errorf("%q must be an integer value: %q", k, value)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_interface.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_interface.go deleted file mode 100644 index 5c9f826..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_interface.go +++ /dev/null @@ -1,368 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsNetworkInterface() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsNetworkInterfaceCreate, - Read: resourceAwsNetworkInterfaceRead, - Update: resourceAwsNetworkInterfaceUpdate, - Delete: resourceAwsNetworkInterfaceDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - - "subnet_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "private_ips": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "security_groups": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "source_dest_check": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "attachment": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "instance": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "device_index": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "attachment_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - }, - Set: resourceAwsEniAttachmentHash, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsNetworkInterfaceCreate(d *schema.ResourceData, meta interface{}) error { - - conn := meta.(*AWSClient).ec2conn - - request := &ec2.CreateNetworkInterfaceInput{ - SubnetId: aws.String(d.Get("subnet_id").(string)), - } - - security_groups := d.Get("security_groups").(*schema.Set).List() - if len(security_groups) != 0 { - request.Groups = expandStringList(security_groups) - } - - private_ips := d.Get("private_ips").(*schema.Set).List() - if len(private_ips) != 0 { - request.PrivateIpAddresses = expandPrivateIPAddresses(private_ips) - } - - if v, ok := d.GetOk("description"); ok { - request.Description = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Creating network interface") - resp, err := conn.CreateNetworkInterface(request) - if err != nil { - return fmt.Errorf("Error creating ENI: %s", err) - } - - d.SetId(*resp.NetworkInterface.NetworkInterfaceId) - log.Printf("[INFO] ENI ID: %s", d.Id()) - return resourceAwsNetworkInterfaceUpdate(d, meta) -} - -func resourceAwsNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) error { - - conn := meta.(*AWSClient).ec2conn - describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesInput{ - NetworkInterfaceIds: []*string{aws.String(d.Id())}, - } - describeResp, err := conn.DescribeNetworkInterfaces(describe_network_interfaces_request) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidNetworkInterfaceID.NotFound" { - // The ENI is gone now, so just remove it from the state - d.SetId("") - return nil - } - - return fmt.Errorf("Error retrieving ENI: %s", err) - } - if len(describeResp.NetworkInterfaces) != 1 { - return fmt.Errorf("Unable to find ENI: %#v", describeResp.NetworkInterfaces) - } - - eni := describeResp.NetworkInterfaces[0] - d.Set("subnet_id", eni.SubnetId) - d.Set("private_ips", flattenNetworkInterfacesPrivateIPAddresses(eni.PrivateIpAddresses)) - d.Set("security_groups", flattenGroupIdentifiers(eni.Groups)) - d.Set("source_dest_check", eni.SourceDestCheck) - - if eni.Description != nil { - d.Set("description", eni.Description) - } - - // Tags - d.Set("tags", tagsToMap(eni.TagSet)) - - if eni.Attachment != nil { - attachment := []map[string]interface{}{flattenAttachment(eni.Attachment)} - d.Set("attachment", attachment) - } else { - d.Set("attachment", nil) - } - - return nil -} - -func networkInterfaceAttachmentRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - - describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesInput{ - NetworkInterfaceIds: []*string{aws.String(id)}, - } - describeResp, err := conn.DescribeNetworkInterfaces(describe_network_interfaces_request) - - if err != nil { - log.Printf("[ERROR] Could not find network interface %s. %s", id, err) - return nil, "", err - } - - eni := describeResp.NetworkInterfaces[0] - hasAttachment := strconv.FormatBool(eni.Attachment != nil) - log.Printf("[DEBUG] ENI %s has attachment state %s", id, hasAttachment) - return eni, hasAttachment, nil - } -} - -func resourceAwsNetworkInterfaceDetach(oa *schema.Set, meta interface{}, eniId string) error { - // if there was an old attachment, remove it - if oa != nil && len(oa.List()) > 0 { - old_attachment := oa.List()[0].(map[string]interface{}) - detach_request := &ec2.DetachNetworkInterfaceInput{ - AttachmentId: aws.String(old_attachment["attachment_id"].(string)), - Force: aws.Bool(true), - } - conn := meta.(*AWSClient).ec2conn - _, detach_err := conn.DetachNetworkInterface(detach_request) - if detach_err != nil { - if awsErr, _ := detach_err.(awserr.Error); awsErr.Code() != "InvalidAttachmentID.NotFound" { - return fmt.Errorf("Error detaching ENI: %s", detach_err) - } - } - - log.Printf("[DEBUG] Waiting for ENI (%s) to become dettached", eniId) - stateConf := &resource.StateChangeConf{ - Pending: []string{"true"}, - Target: []string{"false"}, - Refresh: networkInterfaceAttachmentRefreshFunc(conn, eniId), - Timeout: 10 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for ENI (%s) to become dettached: %s", eniId, err) - } - } - - return nil -} - -func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - d.Partial(true) - - if d.HasChange("attachment") { - oa, na := d.GetChange("attachment") - - detach_err := resourceAwsNetworkInterfaceDetach(oa.(*schema.Set), meta, d.Id()) - if detach_err != nil { - return detach_err - } - - // if there is a new attachment, attach it - if na != nil && len(na.(*schema.Set).List()) > 0 { - new_attachment := na.(*schema.Set).List()[0].(map[string]interface{}) - di := new_attachment["device_index"].(int) - attach_request := &ec2.AttachNetworkInterfaceInput{ - DeviceIndex: aws.Int64(int64(di)), - InstanceId: aws.String(new_attachment["instance"].(string)), - NetworkInterfaceId: aws.String(d.Id()), - } - _, attach_err := conn.AttachNetworkInterface(attach_request) - if attach_err != nil { - return fmt.Errorf("Error attaching ENI: %s", attach_err) - } - } - - d.SetPartial("attachment") - } - - if d.HasChange("private_ips") { - o, n := d.GetChange("private_ips") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - // Unassign old IP addresses - unassignIps := os.Difference(ns) - if unassignIps.Len() != 0 { - input := &ec2.UnassignPrivateIpAddressesInput{ - NetworkInterfaceId: aws.String(d.Id()), - PrivateIpAddresses: expandStringList(unassignIps.List()), - } - _, err := conn.UnassignPrivateIpAddresses(input) - if err != nil { - return fmt.Errorf("Failure to unassign Private IPs: %s", err) - } - } - - // Assign new IP addresses - assignIps := ns.Difference(os) - if assignIps.Len() != 0 { - input := &ec2.AssignPrivateIpAddressesInput{ - NetworkInterfaceId: aws.String(d.Id()), - PrivateIpAddresses: expandStringList(assignIps.List()), - } - _, err := conn.AssignPrivateIpAddresses(input) - if err != nil { - return fmt.Errorf("Failure to assign Private IPs: %s", err) - } - } - - d.SetPartial("private_ips") - } - - request := &ec2.ModifyNetworkInterfaceAttributeInput{ - NetworkInterfaceId: aws.String(d.Id()), - SourceDestCheck: &ec2.AttributeBooleanValue{Value: aws.Bool(d.Get("source_dest_check").(bool))}, - } - - _, err := conn.ModifyNetworkInterfaceAttribute(request) - if err != nil { - return fmt.Errorf("Failure updating ENI: %s", err) - } - - d.SetPartial("source_dest_check") - - if d.HasChange("security_groups") { - request := &ec2.ModifyNetworkInterfaceAttributeInput{ - NetworkInterfaceId: aws.String(d.Id()), - Groups: expandStringList(d.Get("security_groups").(*schema.Set).List()), - } - - _, err := conn.ModifyNetworkInterfaceAttribute(request) - if err != nil { - return fmt.Errorf("Failure updating ENI: %s", err) - } - - d.SetPartial("security_groups") - } - - if d.HasChange("description") { - request := &ec2.ModifyNetworkInterfaceAttributeInput{ - NetworkInterfaceId: aws.String(d.Id()), - Description: &ec2.AttributeValue{Value: aws.String(d.Get("description").(string))}, - } - - _, err := conn.ModifyNetworkInterfaceAttribute(request) - if err != nil { - return fmt.Errorf("Failure updating ENI: %s", err) - } - - d.SetPartial("description") - } - - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - d.Partial(false) - - return resourceAwsNetworkInterfaceRead(d, meta) -} - -func resourceAwsNetworkInterfaceDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[INFO] Deleting ENI: %s", d.Id()) - - detach_err := resourceAwsNetworkInterfaceDetach(d.Get("attachment").(*schema.Set), meta, d.Id()) - if detach_err != nil { - return detach_err - } - - deleteEniOpts := ec2.DeleteNetworkInterfaceInput{ - NetworkInterfaceId: aws.String(d.Id()), - } - if _, err := conn.DeleteNetworkInterface(&deleteEniOpts); err != nil { - return fmt.Errorf("Error deleting ENI: %s", err) - } - - return nil -} - -func resourceAwsEniAttachmentHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["instance"].(string))) - buf.WriteString(fmt.Sprintf("%d-", m["device_index"].(int))) - return hashcode.String(buf.String()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_application.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_application.go deleted file mode 100644 index 3ffdb9a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_application.go +++ /dev/null @@ -1,631 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/opsworks" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksApplication() *schema.Resource { - return &schema.Resource{ - - Create: resourceAwsOpsworksApplicationCreate, - Read: resourceAwsOpsworksApplicationRead, - Update: resourceAwsOpsworksApplicationUpdate, - Delete: resourceAwsOpsworksApplicationDelete, - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Required: true, - }, - "short_name": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - // aws-flow-ruby | java | rails | php | nodejs | static | other - "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - expected := [7]string{"aws-flow-ruby", "java", "rails", "php", "nodejs", "static", "other"} - - found := false - for _, b := range expected { - if b == value { - found = true - } - } - if !found { - errors = append(errors, fmt.Errorf( - "%q has to be one of [aws-flow-ruby, java, rails, php, nodejs, static, other]", k)) - } - return - }, - }, - "stack_id": { - Type: schema.TypeString, - Required: true, - }, - // TODO: the following 4 vals are really part of the Attributes array. We should validate that only ones relevant to the chosen type are set, perhaps. (what is the default type? how do they map?) - "document_root": { - Type: schema.TypeString, - Optional: true, - //Default: "public", - }, - "rails_env": { - Type: schema.TypeString, - Optional: true, - //Default: "production", - }, - "auto_bundle_on_deploy": { - Type: schema.TypeString, - Optional: true, - //Default: true, - }, - "aws_flow_ruby_settings": { - Type: schema.TypeString, - Optional: true, - }, - "app_source": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - Required: true, - }, - - "url": { - Type: schema.TypeString, - Optional: true, - }, - - "username": { - Type: schema.TypeString, - Optional: true, - }, - - "password": { - Type: schema.TypeString, - Optional: true, - }, - - "revision": { - Type: schema.TypeString, - Optional: true, - }, - - "ssh_key": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - // AutoSelectOpsworksMysqlInstance, OpsworksMysqlInstance, or RdsDbInstance. - // anything beside auto select will lead into failure in case the instance doesn't exist - // XXX: validation? - "data_source_type": { - Type: schema.TypeString, - Optional: true, - }, - "data_source_database_name": { - Type: schema.TypeString, - Optional: true, - }, - "data_source_arn": { - Type: schema.TypeString, - Optional: true, - }, - "description": { - Type: schema.TypeString, - Optional: true, - }, - "domains": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "environment": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Required: true, - }, - "value": { - Type: schema.TypeString, - Required: true, - }, - "secure": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - }, - }, - }, - "enable_ssl": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "ssl_configuration": { - Type: schema.TypeList, - Optional: true, - //Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "certificate": { - Type: schema.TypeString, - Required: true, - StateFunc: func(v interface{}) string { - switch v.(type) { - case string: - return strings.TrimSpace(v.(string)) - default: - return "" - } - }, - }, - "private_key": { - Type: schema.TypeString, - Required: true, - StateFunc: func(v interface{}) string { - switch v.(type) { - case string: - return strings.TrimSpace(v.(string)) - default: - return "" - } - }, - }, - "chain": { - Type: schema.TypeString, - Optional: true, - StateFunc: func(v interface{}) string { - switch v.(type) { - case string: - return strings.TrimSpace(v.(string)) - default: - return "" - } - }, - }, - }, - }, - }, - }, - } -} - -func resourceAwsOpsworksApplicationValidate(d *schema.ResourceData) error { - appSourceCount := d.Get("app_source.#").(int) - if appSourceCount > 1 { - return fmt.Errorf("Only one app_source is permitted.") - } - - sslCount := d.Get("ssl_configuration.#").(int) - if sslCount > 1 { - return fmt.Errorf("Only one ssl_configuration is permitted.") - } - - if d.Get("type") == opsworks.AppTypeNodejs || d.Get("type") == opsworks.AppTypeJava { - // allowed attributes: none - if d.Get("document_root").(string) != "" || d.Get("rails_env").(string) != "" || d.Get("auto_bundle_on_deploy").(string) != "" || d.Get("aws_flow_ruby_settings").(string) != "" { - return fmt.Errorf("No additional attributes are allowed for app type '%s'.", d.Get("type").(string)) - } - } else if d.Get("type") == opsworks.AppTypeRails { - // allowed attributes: document_root, rails_env, auto_bundle_on_deploy - if d.Get("aws_flow_ruby_settings").(string) != "" { - return fmt.Errorf("Only 'document_root, rails_env, auto_bundle_on_deploy' are allowed for app type '%s'.", opsworks.AppTypeRails) - } - // rails_env is required - if _, ok := d.GetOk("rails_env"); !ok { - return fmt.Errorf("Set rails_env must be set if type is set to rails.") - } - } else if d.Get("type") == opsworks.AppTypePhp || d.Get("type") == opsworks.AppTypeStatic || d.Get("type") == opsworks.AppTypeOther { - log.Printf("[DEBUG] the app type is : %s", d.Get("type").(string)) - log.Printf("[DEBUG] the attributes are: document_root '%s', rails_env '%s', auto_bundle_on_deploy '%s', aws_flow_ruby_settings '%s'", d.Get("document_root").(string), d.Get("rails_env").(string), d.Get("auto_bundle_on_deploy").(string), d.Get("aws_flow_ruby_settings").(string)) - // allowed attributes: document_root - if d.Get("rails_env").(string) != "" || d.Get("auto_bundle_on_deploy").(string) != "" || d.Get("aws_flow_ruby_settings").(string) != "" { - return fmt.Errorf("Only 'document_root' is allowed for app type '%s'.", d.Get("type").(string)) - } - } else if d.Get("type") == opsworks.AppTypeAwsFlowRuby { - // allowed attributes: aws_flow_ruby_settings - if d.Get("document_root").(string) != "" || d.Get("rails_env").(string) != "" || d.Get("auto_bundle_on_deploy").(string) != "" { - return fmt.Errorf("Only 'aws_flow_ruby_settings' is allowed for app type '%s'.", d.Get("type").(string)) - } - } - - return nil -} - -func resourceAwsOpsworksApplicationRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DescribeAppsInput{ - AppIds: []*string{ - aws.String(d.Id()), - }, - } - - log.Printf("[DEBUG] Reading OpsWorks app: %s", d.Id()) - - resp, err := client.DescribeApps(req) - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "ResourceNotFoundException" { - log.Printf("[INFO] App not found: %s", d.Id()) - d.SetId("") - return nil - } - } - return err - } - - app := resp.Apps[0] - - d.Set("name", app.Name) - d.Set("stack_id", app.StackId) - d.Set("type", app.Type) - d.Set("description", app.Description) - d.Set("domains", flattenStringList(app.Domains)) - d.Set("enable_ssl", app.EnableSsl) - resourceAwsOpsworksSetApplicationSsl(d, app.SslConfiguration) - resourceAwsOpsworksSetApplicationSource(d, app.AppSource) - resourceAwsOpsworksSetApplicationDataSources(d, app.DataSources) - resourceAwsOpsworksSetApplicationEnvironmentVariable(d, app.Environment) - resourceAwsOpsworksSetApplicationAttributes(d, app.Attributes) - return nil -} - -func resourceAwsOpsworksApplicationCreate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - err := resourceAwsOpsworksApplicationValidate(d) - if err != nil { - return err - } - - req := &opsworks.CreateAppInput{ - Name: aws.String(d.Get("name").(string)), - Shortname: aws.String(d.Get("short_name").(string)), - StackId: aws.String(d.Get("stack_id").(string)), - Type: aws.String(d.Get("type").(string)), - Description: aws.String(d.Get("description").(string)), - Domains: expandStringList(d.Get("domains").([]interface{})), - EnableSsl: aws.Bool(d.Get("enable_ssl").(bool)), - SslConfiguration: resourceAwsOpsworksApplicationSsl(d), - AppSource: resourceAwsOpsworksApplicationSource(d), - DataSources: resourceAwsOpsworksApplicationDataSources(d), - Environment: resourceAwsOpsworksApplicationEnvironmentVariable(d), - Attributes: resourceAwsOpsworksApplicationAttributes(d), - } - - var resp *opsworks.CreateAppOutput - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - var cerr error - resp, cerr = client.CreateApp(req) - if cerr != nil { - log.Printf("[INFO] client error") - if opserr, ok := cerr.(awserr.Error); ok { - // XXX: handle errors - log.Printf("[ERROR] OpsWorks error: %s message: %s", opserr.Code(), opserr.Message()) - return resource.RetryableError(cerr) - } - return resource.NonRetryableError(cerr) - } - return nil - }) - - if err != nil { - return err - } - - appID := *resp.AppId - d.SetId(appID) - d.Set("id", appID) - - return resourceAwsOpsworksApplicationRead(d, meta) -} - -func resourceAwsOpsworksApplicationUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - err := resourceAwsOpsworksApplicationValidate(d) - if err != nil { - return err - } - - req := &opsworks.UpdateAppInput{ - AppId: aws.String(d.Id()), - Name: aws.String(d.Get("name").(string)), - Type: aws.String(d.Get("type").(string)), - Description: aws.String(d.Get("description").(string)), - Domains: expandStringList(d.Get("domains").([]interface{})), - EnableSsl: aws.Bool(d.Get("enable_ssl").(bool)), - SslConfiguration: resourceAwsOpsworksApplicationSsl(d), - AppSource: resourceAwsOpsworksApplicationSource(d), - DataSources: resourceAwsOpsworksApplicationDataSources(d), - Environment: resourceAwsOpsworksApplicationEnvironmentVariable(d), - Attributes: resourceAwsOpsworksApplicationAttributes(d), - } - - log.Printf("[DEBUG] Updating OpsWorks layer: %s", d.Id()) - - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - _, cerr := client.UpdateApp(req) - if cerr != nil { - log.Printf("[INFO] client error") - if opserr, ok := cerr.(awserr.Error); ok { - // XXX: handle errors - log.Printf("[ERROR] OpsWorks error: %s message: %s", opserr.Code(), opserr.Message()) - return resource.NonRetryableError(cerr) - } - return resource.RetryableError(cerr) - } - return nil - }) - - if err != nil { - return err - } - return resourceAwsOpsworksApplicationRead(d, meta) -} - -func resourceAwsOpsworksApplicationDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DeleteAppInput{ - AppId: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Deleting OpsWorks application: %s", d.Id()) - - _, err := client.DeleteApp(req) - return err -} - -func resourceAwsOpsworksSetApplicationEnvironmentVariable(d *schema.ResourceData, v []*opsworks.EnvironmentVariable) { - log.Printf("[DEBUG] envs: %s %d", v, len(v)) - if len(v) == 0 { - d.Set("environment", nil) - return - } - newValue := make([]*map[string]interface{}, len(v)) - - for i := 0; i < len(v); i++ { - config := v[i] - data := make(map[string]interface{}) - newValue[i] = &data - - if config.Key != nil { - data["key"] = *config.Key - } - if config.Value != nil { - data["value"] = *config.Value - } - if config.Secure != nil { - - if bool(*config.Secure) { - data["secure"] = &opsworksTrueString - } else { - data["secure"] = &opsworksFalseString - } - } - log.Printf("[DEBUG] v: %s", data) - } - - d.Set("environment", newValue) -} - -func resourceAwsOpsworksApplicationEnvironmentVariable(d *schema.ResourceData) []*opsworks.EnvironmentVariable { - environmentVariables := d.Get("environment").(*schema.Set).List() - result := make([]*opsworks.EnvironmentVariable, len(environmentVariables)) - - for i := 0; i < len(environmentVariables); i++ { - env := environmentVariables[i].(map[string]interface{}) - - result[i] = &opsworks.EnvironmentVariable{ - Key: aws.String(env["key"].(string)), - Value: aws.String(env["value"].(string)), - Secure: aws.Bool(env["secure"].(bool)), - } - } - return result -} - -func resourceAwsOpsworksApplicationSource(d *schema.ResourceData) *opsworks.Source { - count := d.Get("app_source.#").(int) - if count == 0 { - return nil - } - - return &opsworks.Source{ - Type: aws.String(d.Get("app_source.0.type").(string)), - Url: aws.String(d.Get("app_source.0.url").(string)), - Username: aws.String(d.Get("app_source.0.username").(string)), - Password: aws.String(d.Get("app_source.0.password").(string)), - Revision: aws.String(d.Get("app_source.0.revision").(string)), - SshKey: aws.String(d.Get("app_source.0.ssh_key").(string)), - } -} - -func resourceAwsOpsworksSetApplicationSource(d *schema.ResourceData, v *opsworks.Source) { - nv := make([]interface{}, 0, 1) - if v != nil { - m := make(map[string]interface{}) - if v.Type != nil { - m["type"] = *v.Type - } - if v.Url != nil { - m["url"] = *v.Url - } - if v.Username != nil { - m["username"] = *v.Username - } - if v.Password != nil { - m["password"] = *v.Password - } - if v.Revision != nil { - m["revision"] = *v.Revision - } - nv = append(nv, m) - } - - err := d.Set("app_source", nv) - if err != nil { - // should never happen - panic(err) - } -} - -func resourceAwsOpsworksApplicationDataSources(d *schema.ResourceData) []*opsworks.DataSource { - arn := d.Get("data_source_arn").(string) - databaseName := d.Get("data_source_database_name").(string) - databaseType := d.Get("data_source_type").(string) - - result := make([]*opsworks.DataSource, 1) - - if len(arn) > 0 || len(databaseName) > 0 || len(databaseType) > 0 { - result[0] = &opsworks.DataSource{ - Arn: aws.String(arn), - DatabaseName: aws.String(databaseName), - Type: aws.String(databaseType), - } - } - return result -} - -func resourceAwsOpsworksSetApplicationDataSources(d *schema.ResourceData, v []*opsworks.DataSource) { - d.Set("data_source_arn", nil) - d.Set("data_source_database_name", nil) - d.Set("data_source_type", nil) - - if len(v) == 0 { - return - } - - d.Set("data_source_arn", v[0].Arn) - d.Set("data_source_database_name", v[0].DatabaseName) - d.Set("data_source_type", v[0].Type) -} - -func resourceAwsOpsworksApplicationSsl(d *schema.ResourceData) *opsworks.SslConfiguration { - count := d.Get("ssl_configuration.#").(int) - if count == 0 { - return nil - } - - return &opsworks.SslConfiguration{ - PrivateKey: aws.String(d.Get("ssl_configuration.0.private_key").(string)), - Certificate: aws.String(d.Get("ssl_configuration.0.certificate").(string)), - Chain: aws.String(d.Get("ssl_configuration.0.chain").(string)), - } -} - -func resourceAwsOpsworksSetApplicationSsl(d *schema.ResourceData, v *opsworks.SslConfiguration) { - nv := make([]interface{}, 0, 1) - set := false - if v != nil { - m := make(map[string]interface{}) - if v.PrivateKey != nil { - m["private_key"] = *v.PrivateKey - set = true - } - if v.Certificate != nil { - m["certificate"] = *v.Certificate - set = true - } - if v.Chain != nil { - m["chain"] = *v.Chain - set = true - } - if set { - nv = append(nv, m) - } - } - - err := d.Set("ssl_configuration", nv) - if err != nil { - // should never happen - panic(err) - } -} - -func resourceAwsOpsworksApplicationAttributes(d *schema.ResourceData) map[string]*string { - attributes := make(map[string]*string) - - if val := d.Get("document_root").(string); len(val) > 0 { - attributes[opsworks.AppAttributesKeysDocumentRoot] = aws.String(val) - } - if val := d.Get("aws_flow_ruby_settings").(string); len(val) > 0 { - attributes[opsworks.AppAttributesKeysAwsFlowRubySettings] = aws.String(val) - } - if val := d.Get("rails_env").(string); len(val) > 0 { - attributes[opsworks.AppAttributesKeysRailsEnv] = aws.String(val) - } - if val := d.Get("auto_bundle_on_deploy").(string); len(val) > 0 { - if val == "1" { - val = "true" - } else if val == "0" { - val = "false" - } - attributes[opsworks.AppAttributesKeysAutoBundleOnDeploy] = aws.String(val) - } - - return attributes -} - -func resourceAwsOpsworksSetApplicationAttributes(d *schema.ResourceData, v map[string]*string) { - d.Set("document_root", nil) - d.Set("rails_env", nil) - d.Set("aws_flow_ruby_settings", nil) - d.Set("auto_bundle_on_deploy", nil) - - if d.Get("type") == opsworks.AppTypeNodejs || d.Get("type") == opsworks.AppTypeJava { - return - } else if d.Get("type") == opsworks.AppTypeRails { - if val, ok := v[opsworks.AppAttributesKeysDocumentRoot]; ok { - d.Set("document_root", val) - } - if val, ok := v[opsworks.AppAttributesKeysRailsEnv]; ok { - d.Set("rails_env", val) - } - if val, ok := v[opsworks.AppAttributesKeysAutoBundleOnDeploy]; ok { - d.Set("auto_bundle_on_deploy", val) - } - return - } else if d.Get("type") == opsworks.AppTypePhp || d.Get("type") == opsworks.AppTypeStatic || d.Get("type") == opsworks.AppTypeOther { - if val, ok := v[opsworks.AppAttributesKeysDocumentRoot]; ok { - d.Set("document_root", val) - } - return - } else if d.Get("type") == opsworks.AppTypeAwsFlowRuby { - if val, ok := v[opsworks.AppAttributesKeysAwsFlowRubySettings]; ok { - d.Set("aws_flow_ruby_settings", val) - } - return - } - - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_custom_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_custom_layer.go deleted file mode 100644 index 59de60d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_custom_layer.go +++ /dev/null @@ -1,17 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksCustomLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "custom", - CustomShortName: true, - - // The "custom" layer type has no additional attributes - Attributes: map[string]*opsworksLayerTypeAttribute{}, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_ganglia_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_ganglia_layer.go deleted file mode 100644 index 1aadefe..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_ganglia_layer.go +++ /dev/null @@ -1,33 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksGangliaLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "monitoring-master", - DefaultLayerName: "Ganglia", - - Attributes: map[string]*opsworksLayerTypeAttribute{ - "url": { - AttrName: "GangliaUrl", - Type: schema.TypeString, - Default: "/ganglia", - }, - "username": { - AttrName: "GangliaUser", - Type: schema.TypeString, - Default: "opsworks", - }, - "password": { - AttrName: "GangliaPassword", - Type: schema.TypeString, - Required: true, - WriteOnly: true, - }, - }, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_haproxy_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_haproxy_layer.go deleted file mode 100644 index 91e8432..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_haproxy_layer.go +++ /dev/null @@ -1,48 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksHaproxyLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "lb", - DefaultLayerName: "HAProxy", - - Attributes: map[string]*opsworksLayerTypeAttribute{ - "stats_enabled": { - AttrName: "EnableHaproxyStats", - Type: schema.TypeBool, - Default: true, - }, - "stats_url": { - AttrName: "HaproxyStatsUrl", - Type: schema.TypeString, - Default: "/haproxy?stats", - }, - "stats_user": { - AttrName: "HaproxyStatsUser", - Type: schema.TypeString, - Default: "opsworks", - }, - "stats_password": { - AttrName: "HaproxyStatsPassword", - Type: schema.TypeString, - WriteOnly: true, - Required: true, - }, - "healthcheck_url": { - AttrName: "HaproxyHealthCheckUrl", - Type: schema.TypeString, - Default: "/", - }, - "healthcheck_method": { - AttrName: "HaproxyHealthCheckMethod", - Type: schema.TypeString, - Default: "OPTIONS", - }, - }, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_instance.go deleted file mode 100644 index 0e42e30..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_instance.go +++ /dev/null @@ -1,1054 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/opsworks" -) - -func resourceAwsOpsworksInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsOpsworksInstanceCreate, - Read: resourceAwsOpsworksInstanceRead, - Update: resourceAwsOpsworksInstanceUpdate, - Delete: resourceAwsOpsworksInstanceDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsOpsworksInstanceImport, - }, - - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - - "agent_version": { - Type: schema.TypeString, - Optional: true, - Default: "INHERIT", - }, - - "ami_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "architecture": { - Type: schema.TypeString, - Optional: true, - Default: "x86_64", - ValidateFunc: validateArchitecture, - }, - - "auto_scaling_type": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateAutoScalingType, - }, - - "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "created_at": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "delete_ebs": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "delete_eip": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "ebs_optimized": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - - "ec2_instance_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "ecs_cluster_arn": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "elastic_ip": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "hostname": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "infrastructure_class": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "install_updates_on_boot": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "instance_profile_arn": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "instance_type": { - Type: schema.TypeString, - Optional: true, - }, - - "last_service_error_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "layer_ids": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "os": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "platform": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "private_dns": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "private_ip": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "public_dns": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "public_ip": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "registered_by": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "reported_agent_version": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "reported_os_family": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "reported_os_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "reported_os_version": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "root_device_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - ValidateFunc: validateRootDeviceType, - }, - - "root_device_volume_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "security_group_ids": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "ssh_host_dsa_key_fingerprint": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "ssh_host_rsa_key_fingerprint": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "ssh_key_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "stack_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "state": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateState, - }, - - "status": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "subnet_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "tenancy": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateTenancy, - }, - - "virtualization_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateVirtualizationType, - }, - - "ebs_block_device": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - }, - - "device_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "iops": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "snapshot_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["snapshot_id"].(string))) - return hashcode.String(buf.String()) - }, - }, - "ephemeral_block_device": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "device_name": { - Type: schema.TypeString, - Required: true, - }, - - "virtual_name": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["virtual_name"].(string))) - return hashcode.String(buf.String()) - }, - }, - - "root_block_device": { - // TODO: This is a set because we don't support singleton - // sub-resources today. We'll enforce that the set only ever has - // length zero or one below. When TF gains support for - // sub-resources this can be converted. - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Resource{ - // "You can only modify the volume size, volume type, and Delete on - // Termination flag on the block device mapping entry for the root - // device volume." - bit.ly/ec2bdmap - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - }, - - "iops": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "volume_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - Set: func(v interface{}) int { - // there can be only one root device; no need to hash anything - return 0 - }, - }, - }, - } -} - -func validateArchitecture(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "x86_64" && value != "i386" { - errors = append(errors, fmt.Errorf( - "%q must be one of \"x86_64\" or \"i386\"", k)) - } - return -} - -func validateTenancy(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "dedicated" && value != "default" && value != "host" { - errors = append(errors, fmt.Errorf( - "%q must be one of \"dedicated\", \"default\" or \"host\"", k)) - } - return -} - -func validateAutoScalingType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "load" && value != "timer" { - errors = append(errors, fmt.Errorf( - "%q must be one of \"load\" or \"timer\"", k)) - } - return -} - -func validateRootDeviceType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "ebs" && value != "instance-store" { - errors = append(errors, fmt.Errorf( - "%q must be one of \"ebs\" or \"instance-store\"", k)) - } - return -} - -func validateState(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "running" && value != "stopped" { - errors = append(errors, fmt.Errorf( - "%q must be one of \"running\" or \"stopped\"", k)) - } - return -} - -func validateVirtualizationType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "paravirtual" && value != "hvm" { - errors = append(errors, fmt.Errorf( - "%q must be one of \"paravirtual\" or \"hvm\"", k)) - } - return -} - -func resourceAwsOpsworksInstanceValidate(d *schema.ResourceData) error { - if d.HasChange("ami_id") { - if v, ok := d.GetOk("os"); ok { - if v.(string) != "Custom" { - return fmt.Errorf("OS must be \"Custom\" when using using a custom ami_id") - } - } - - if _, ok := d.GetOk("root_block_device"); ok { - return fmt.Errorf("Cannot specify root_block_device when using a custom ami_id.") - } - - if _, ok := d.GetOk("ebs_block_device"); ok { - return fmt.Errorf("Cannot specify ebs_block_device when using a custom ami_id.") - } - - if _, ok := d.GetOk("ephemeral_block_device"); ok { - return fmt.Errorf("Cannot specify ephemeral_block_device when using a custom ami_id.") - } - } - return nil -} - -func resourceAwsOpsworksInstanceRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DescribeInstancesInput{ - InstanceIds: []*string{ - aws.String(d.Id()), - }, - } - - log.Printf("[DEBUG] Reading OpsWorks instance: %s", d.Id()) - - resp, err := client.DescribeInstances(req) - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "ResourceNotFoundException" { - d.SetId("") - return nil - } - } - return err - } - - // If nothing was found, then return no state - if len(resp.Instances) == 0 { - d.SetId("") - return nil - } - instance := resp.Instances[0] - - if instance.InstanceId == nil { - d.SetId("") - return nil - } - instanceId := *instance.InstanceId - - d.SetId(instanceId) - d.Set("agent_version", instance.AgentVersion) - d.Set("ami_id", instance.AmiId) - d.Set("architecture", instance.Architecture) - d.Set("auto_scaling_type", instance.AutoScalingType) - d.Set("availability_zone", instance.AvailabilityZone) - d.Set("created_at", instance.CreatedAt) - d.Set("ebs_optimized", instance.EbsOptimized) - d.Set("ec2_instance_id", instance.Ec2InstanceId) - d.Set("ecs_cluster_arn", instance.EcsClusterArn) - d.Set("elastic_ip", instance.ElasticIp) - d.Set("hostname", instance.Hostname) - d.Set("infrastructure_class", instance.InfrastructureClass) - d.Set("install_updates_on_boot", instance.InstallUpdatesOnBoot) - d.Set("id", instanceId) - d.Set("instance_profile_arn", instance.InstanceProfileArn) - d.Set("instance_type", instance.InstanceType) - d.Set("last_service_error_id", instance.LastServiceErrorId) - var layerIds []string - for _, v := range instance.LayerIds { - layerIds = append(layerIds, *v) - } - if err := d.Set("layer_ids", layerIds); err != nil { - return fmt.Errorf("[DEBUG] Error setting layer_ids attribute: %#v, error: %#v", layerIds, err) - } - d.Set("os", instance.Os) - d.Set("platform", instance.Platform) - d.Set("private_dns", instance.PrivateDns) - d.Set("private_ip", instance.PrivateIp) - d.Set("public_dns", instance.PublicDns) - d.Set("public_ip", instance.PublicIp) - d.Set("registered_by", instance.RegisteredBy) - d.Set("reported_agent_version", instance.ReportedAgentVersion) - d.Set("reported_os_family", instance.ReportedOs.Family) - d.Set("reported_os_name", instance.ReportedOs.Name) - d.Set("reported_os_version", instance.ReportedOs.Version) - d.Set("root_device_type", instance.RootDeviceType) - d.Set("root_device_volume_id", instance.RootDeviceVolumeId) - d.Set("ssh_host_dsa_key_fingerprint", instance.SshHostDsaKeyFingerprint) - d.Set("ssh_host_rsa_key_fingerprint", instance.SshHostRsaKeyFingerprint) - d.Set("ssh_key_name", instance.SshKeyName) - d.Set("stack_id", instance.StackId) - d.Set("status", instance.Status) - d.Set("subnet_id", instance.SubnetId) - d.Set("tenancy", instance.Tenancy) - d.Set("virtualization_type", instance.VirtualizationType) - - // Read BlockDeviceMapping - ibds, err := readOpsworksBlockDevices(d, instance, meta) - if err != nil { - return err - } - - if err := d.Set("ebs_block_device", ibds["ebs"]); err != nil { - return err - } - if err := d.Set("ephemeral_block_device", ibds["ephemeral"]); err != nil { - return err - } - if ibds["root"] != nil { - if err := d.Set("root_block_device", []interface{}{ibds["root"]}); err != nil { - return err - } - } else { - d.Set("root_block_device", []interface{}{}) - } - - // Read Security Groups - sgs := make([]string, 0, len(instance.SecurityGroupIds)) - for _, sg := range instance.SecurityGroupIds { - sgs = append(sgs, *sg) - } - if err := d.Set("security_group_ids", sgs); err != nil { - return err - } - - return nil -} - -func resourceAwsOpsworksInstanceCreate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - err := resourceAwsOpsworksInstanceValidate(d) - if err != nil { - return err - } - - req := &opsworks.CreateInstanceInput{ - AgentVersion: aws.String(d.Get("agent_version").(string)), - Architecture: aws.String(d.Get("architecture").(string)), - EbsOptimized: aws.Bool(d.Get("ebs_optimized").(bool)), - InstallUpdatesOnBoot: aws.Bool(d.Get("install_updates_on_boot").(bool)), - InstanceType: aws.String(d.Get("instance_type").(string)), - LayerIds: expandStringList(d.Get("layer_ids").([]interface{})), - StackId: aws.String(d.Get("stack_id").(string)), - } - - if v, ok := d.GetOk("ami_id"); ok { - req.AmiId = aws.String(v.(string)) - req.Os = aws.String("Custom") - } - - if v, ok := d.GetOk("auto_scaling_type"); ok { - req.AutoScalingType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("availability_zone"); ok { - req.AvailabilityZone = aws.String(v.(string)) - } - - if v, ok := d.GetOk("hostname"); ok { - req.Hostname = aws.String(v.(string)) - } - - if v, ok := d.GetOk("os"); ok { - req.Os = aws.String(v.(string)) - } - - if v, ok := d.GetOk("root_device_type"); ok { - req.RootDeviceType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("ssh_key_name"); ok { - req.SshKeyName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("subnet_id"); ok { - req.SubnetId = aws.String(v.(string)) - } - - if v, ok := d.GetOk("tenancy"); ok { - req.Tenancy = aws.String(v.(string)) - } - - if v, ok := d.GetOk("virtualization_type"); ok { - req.VirtualizationType = aws.String(v.(string)) - } - - var blockDevices []*opsworks.BlockDeviceMapping - - if v, ok := d.GetOk("ebs_block_device"); ok { - vL := v.(*schema.Set).List() - for _, v := range vL { - bd := v.(map[string]interface{}) - ebs := &opsworks.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)), - } - - if v, ok := bd["snapshot_id"].(string); ok && v != "" { - ebs.SnapshotId = aws.String(v) - } - - if v, ok := bd["volume_size"].(int); ok && v != 0 { - ebs.VolumeSize = aws.Int64(int64(v)) - } - - if v, ok := bd["volume_type"].(string); ok && v != "" { - ebs.VolumeType = aws.String(v) - } - - if v, ok := bd["iops"].(int); ok && v > 0 { - ebs.Iops = aws.Int64(int64(v)) - } - - blockDevices = append(blockDevices, &opsworks.BlockDeviceMapping{ - DeviceName: aws.String(bd["device_name"].(string)), - Ebs: ebs, - }) - } - } - - if v, ok := d.GetOk("ephemeral_block_device"); ok { - vL := v.(*schema.Set).List() - for _, v := range vL { - bd := v.(map[string]interface{}) - blockDevices = append(blockDevices, &opsworks.BlockDeviceMapping{ - DeviceName: aws.String(bd["device_name"].(string)), - VirtualName: aws.String(bd["virtual_name"].(string)), - }) - } - } - - if v, ok := d.GetOk("root_block_device"); ok { - vL := v.(*schema.Set).List() - if len(vL) > 1 { - return fmt.Errorf("Cannot specify more than one root_block_device.") - } - for _, v := range vL { - bd := v.(map[string]interface{}) - ebs := &opsworks.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)), - } - - if v, ok := bd["volume_size"].(int); ok && v != 0 { - ebs.VolumeSize = aws.Int64(int64(v)) - } - - if v, ok := bd["volume_type"].(string); ok && v != "" { - ebs.VolumeType = aws.String(v) - } - - if v, ok := bd["iops"].(int); ok && v > 0 { - ebs.Iops = aws.Int64(int64(v)) - } - - blockDevices = append(blockDevices, &opsworks.BlockDeviceMapping{ - DeviceName: aws.String("ROOT_DEVICE"), - Ebs: ebs, - }) - } - } - - if len(blockDevices) > 0 { - req.BlockDeviceMappings = blockDevices - } - - log.Printf("[DEBUG] Creating OpsWorks instance") - - var resp *opsworks.CreateInstanceOutput - - resp, err = client.CreateInstance(req) - if err != nil { - return err - } - - if resp.InstanceId == nil { - return fmt.Errorf("Error launching instance: no instance returned in response") - } - - instanceId := *resp.InstanceId - d.SetId(instanceId) - d.Set("id", instanceId) - - if v, ok := d.GetOk("state"); ok && v.(string) == "running" { - err := startOpsworksInstance(d, meta, false) - if err != nil { - return err - } - } - - return resourceAwsOpsworksInstanceRead(d, meta) -} - -func resourceAwsOpsworksInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - err := resourceAwsOpsworksInstanceValidate(d) - if err != nil { - return err - } - - req := &opsworks.UpdateInstanceInput{ - AgentVersion: aws.String(d.Get("agent_version").(string)), - Architecture: aws.String(d.Get("architecture").(string)), - InstanceId: aws.String(d.Get("id").(string)), - InstallUpdatesOnBoot: aws.Bool(d.Get("install_updates_on_boot").(bool)), - } - - if v, ok := d.GetOk("ami_id"); ok { - req.AmiId = aws.String(v.(string)) - req.Os = aws.String("Custom") - } - - if v, ok := d.GetOk("auto_scaling_type"); ok { - req.AutoScalingType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("hostname"); ok { - req.Hostname = aws.String(v.(string)) - } - - if v, ok := d.GetOk("instance_type"); ok { - req.InstanceType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("layer_ids"); ok { - req.LayerIds = expandStringList(v.([]interface{})) - - } - - if v, ok := d.GetOk("os"); ok { - req.Os = aws.String(v.(string)) - } - - if v, ok := d.GetOk("ssh_key_name"); ok { - req.SshKeyName = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Updating OpsWorks instance: %s", d.Id()) - - _, err = client.UpdateInstance(req) - if err != nil { - return err - } - - var status string - - if v, ok := d.GetOk("status"); ok { - status = v.(string) - } else { - status = "stopped" - } - - if v, ok := d.GetOk("state"); ok { - state := v.(string) - if state == "running" { - if status == "stopped" || status == "stopping" || status == "shutting_down" { - err := startOpsworksInstance(d, meta, false) - if err != nil { - return err - } - } - } else { - if status != "stopped" && status != "stopping" && status != "shutting_down" { - err := stopOpsworksInstance(d, meta, false) - if err != nil { - return err - } - } - } - } - - return resourceAwsOpsworksInstanceRead(d, meta) -} - -func resourceAwsOpsworksInstanceDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - if v, ok := d.GetOk("status"); ok && v.(string) != "stopped" { - err := stopOpsworksInstance(d, meta, true) - if err != nil { - return err - } - } - - req := &opsworks.DeleteInstanceInput{ - InstanceId: aws.String(d.Id()), - DeleteElasticIp: aws.Bool(d.Get("delete_eip").(bool)), - DeleteVolumes: aws.Bool(d.Get("delete_ebs").(bool)), - } - - log.Printf("[DEBUG] Deleting OpsWorks instance: %s", d.Id()) - - _, err := client.DeleteInstance(req) - if err != nil { - return err - } - - d.SetId("") - return nil -} - -func resourceAwsOpsworksInstanceImport( - d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - // Neither delete_eip nor delete_ebs can be fetched - // from any API call, so we need to default to the values - // we set in the schema by default - d.Set("delete_ebs", true) - d.Set("delete_eip", true) - return []*schema.ResourceData{d}, nil -} - -func startOpsworksInstance(d *schema.ResourceData, meta interface{}, wait bool) error { - client := meta.(*AWSClient).opsworksconn - - instanceId := d.Get("id").(string) - - req := &opsworks.StartInstanceInput{ - InstanceId: aws.String(instanceId), - } - - log.Printf("[DEBUG] Starting OpsWorks instance: %s", instanceId) - - _, err := client.StartInstance(req) - - if err != nil { - return err - } - - if wait { - log.Printf("[DEBUG] Waiting for instance (%s) to become running", instanceId) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"requested", "pending", "booting", "running_setup"}, - Target: []string{"online"}, - Refresh: OpsworksInstanceStateRefreshFunc(client, instanceId), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for instance (%s) to become stopped: %s", - instanceId, err) - } - } - - return nil -} - -func stopOpsworksInstance(d *schema.ResourceData, meta interface{}, wait bool) error { - client := meta.(*AWSClient).opsworksconn - - instanceId := d.Get("id").(string) - - req := &opsworks.StopInstanceInput{ - InstanceId: aws.String(instanceId), - } - - log.Printf("[DEBUG] Stopping OpsWorks instance: %s", instanceId) - - _, err := client.StopInstance(req) - - if err != nil { - return err - } - - if wait { - log.Printf("[DEBUG] Waiting for instance (%s) to become stopped", instanceId) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"stopping", "terminating", "shutting_down", "terminated"}, - Target: []string{"stopped"}, - Refresh: OpsworksInstanceStateRefreshFunc(client, instanceId), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for instance (%s) to become stopped: %s", - instanceId, err) - } - } - - return nil -} - -func readOpsworksBlockDevices(d *schema.ResourceData, instance *opsworks.Instance, meta interface{}) ( - map[string]interface{}, error) { - - blockDevices := make(map[string]interface{}) - blockDevices["ebs"] = make([]map[string]interface{}, 0) - blockDevices["ephemeral"] = make([]map[string]interface{}, 0) - blockDevices["root"] = nil - - if len(instance.BlockDeviceMappings) == 0 { - return nil, nil - } - - for _, bdm := range instance.BlockDeviceMappings { - bd := make(map[string]interface{}) - if bdm.Ebs != nil && bdm.Ebs.DeleteOnTermination != nil { - bd["delete_on_termination"] = *bdm.Ebs.DeleteOnTermination - } - if bdm.Ebs != nil && bdm.Ebs.VolumeSize != nil { - bd["volume_size"] = *bdm.Ebs.VolumeSize - } - if bdm.Ebs != nil && bdm.Ebs.VolumeType != nil { - bd["volume_type"] = *bdm.Ebs.VolumeType - } - if bdm.Ebs != nil && bdm.Ebs.Iops != nil { - bd["iops"] = *bdm.Ebs.Iops - } - if bdm.DeviceName != nil && *bdm.DeviceName == "ROOT_DEVICE" { - blockDevices["root"] = bd - } else { - if bdm.DeviceName != nil { - bd["device_name"] = *bdm.DeviceName - } - if bdm.VirtualName != nil { - bd["virtual_name"] = *bdm.VirtualName - blockDevices["ephemeral"] = append(blockDevices["ephemeral"].([]map[string]interface{}), bd) - } else { - if bdm.Ebs != nil && bdm.Ebs.SnapshotId != nil { - bd["snapshot_id"] = *bdm.Ebs.SnapshotId - } - blockDevices["ebs"] = append(blockDevices["ebs"].([]map[string]interface{}), bd) - } - } - } - return blockDevices, nil -} - -func OpsworksInstanceStateRefreshFunc(conn *opsworks.OpsWorks, instanceID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeInstances(&opsworks.DescribeInstancesInput{ - InstanceIds: []*string{aws.String(instanceID)}, - }) - if err != nil { - if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "ResourceNotFoundException" { - // Set this to nil as if we didn't find anything. - resp = nil - } else { - log.Printf("Error on OpsworksInstanceStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil || len(resp.Instances) == 0 { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - i := resp.Instances[0] - return i, *i.Status, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_java_app_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_java_app_layer.go deleted file mode 100644 index 1467965..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_java_app_layer.go +++ /dev/null @@ -1,42 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksJavaAppLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "java-app", - DefaultLayerName: "Java App Server", - - Attributes: map[string]*opsworksLayerTypeAttribute{ - "jvm_type": { - AttrName: "Jvm", - Type: schema.TypeString, - Default: "openjdk", - }, - "jvm_version": { - AttrName: "JvmVersion", - Type: schema.TypeString, - Default: "7", - }, - "jvm_options": { - AttrName: "JvmOptions", - Type: schema.TypeString, - Default: "", - }, - "app_server": { - AttrName: "JavaAppServer", - Type: schema.TypeString, - Default: "tomcat", - }, - "app_server_version": { - AttrName: "JavaAppServerVersion", - Type: schema.TypeString, - Default: "7", - }, - }, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_memcached_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_memcached_layer.go deleted file mode 100644 index 301d739..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_memcached_layer.go +++ /dev/null @@ -1,22 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksMemcachedLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "memcached", - DefaultLayerName: "Memcached", - - Attributes: map[string]*opsworksLayerTypeAttribute{ - "allocated_memory": { - AttrName: "MemcachedMemory", - Type: schema.TypeInt, - Default: 512, - }, - }, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_mysql_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_mysql_layer.go deleted file mode 100644 index 560641a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_mysql_layer.go +++ /dev/null @@ -1,27 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksMysqlLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "db-master", - DefaultLayerName: "MySQL", - - Attributes: map[string]*opsworksLayerTypeAttribute{ - "root_password": { - AttrName: "MysqlRootPassword", - Type: schema.TypeString, - WriteOnly: true, - }, - "root_password_on_all_instances": { - AttrName: "MysqlRootPasswordUbiquitous", - Type: schema.TypeBool, - Default: true, - }, - }, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_nodejs_app_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_nodejs_app_layer.go deleted file mode 100644 index d11261b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_nodejs_app_layer.go +++ /dev/null @@ -1,22 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksNodejsAppLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "nodejs-app", - DefaultLayerName: "Node.js App Server", - - Attributes: map[string]*opsworksLayerTypeAttribute{ - "nodejs_version": { - AttrName: "NodejsVersion", - Type: schema.TypeString, - Default: "0.10.38", - }, - }, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_permission.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_permission.go deleted file mode 100644 index 6e4d5f2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_permission.go +++ /dev/null @@ -1,156 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/opsworks" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksPermission() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsOpsworksSetPermission, - Update: resourceAwsOpsworksSetPermission, - Delete: resourceAwsOpsworksPermissionDelete, - Read: resourceAwsOpsworksPermissionRead, - - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "allow_ssh": { - Type: schema.TypeBool, - Computed: true, - Optional: true, - }, - "allow_sudo": { - Type: schema.TypeBool, - Computed: true, - Optional: true, - }, - "user_arn": { - Type: schema.TypeString, - Required: true, - }, - // one of deny, show, deploy, manage, iam_only - "level": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - expected := [5]string{"deny", "show", "deploy", "manage", "iam_only"} - - found := false - for _, b := range expected { - if b == value { - found = true - } - } - if !found { - errors = append(errors, fmt.Errorf( - "%q has to be one of [deny, show, deploy, manage, iam_only]", k)) - } - return - }, - }, - "stack_id": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - }, - } -} - -func resourceAwsOpsworksPermissionDelete(d *schema.ResourceData, meta interface{}) error { - return nil -} - -func resourceAwsOpsworksPermissionRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DescribePermissionsInput{ - IamUserArn: aws.String(d.Get("user_arn").(string)), - StackId: aws.String(d.Get("stack_id").(string)), - } - - log.Printf("[DEBUG] Reading OpsWorks prermissions for: %s on stack: %s", d.Get("user_arn"), d.Get("stack_id")) - - resp, err := client.DescribePermissions(req) - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "ResourceNotFoundException" { - log.Printf("[INFO] Permission not found") - d.SetId("") - return nil - } - } - return err - } - - found := false - id := "" - for _, permission := range resp.Permissions { - id = *permission.IamUserArn + *permission.StackId - - if d.Get("user_arn").(string)+d.Get("stack_id").(string) == id { - found = true - d.SetId(id) - d.Set("id", id) - d.Set("allow_ssh", permission.AllowSsh) - d.Set("allow_sudo", permission.AllowSudo) - d.Set("user_arn", permission.IamUserArn) - d.Set("stack_id", permission.StackId) - d.Set("level", permission.Level) - } - - } - - if false == found { - d.SetId("") - log.Printf("[INFO] The correct permission could not be found for: %s on stack: %s", d.Get("user_arn"), d.Get("stack_id")) - } - - return nil -} - -func resourceAwsOpsworksSetPermission(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.SetPermissionInput{ - AllowSudo: aws.Bool(d.Get("allow_sudo").(bool)), - AllowSsh: aws.Bool(d.Get("allow_ssh").(bool)), - Level: aws.String(d.Get("level").(string)), - IamUserArn: aws.String(d.Get("user_arn").(string)), - StackId: aws.String(d.Get("stack_id").(string)), - } - - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - var cerr error - _, cerr = client.SetPermission(req) - if cerr != nil { - log.Printf("[INFO] client error") - if opserr, ok := cerr.(awserr.Error); ok { - // XXX: handle errors - log.Printf("[ERROR] OpsWorks error: %s message: %s", opserr.Code(), opserr.Message()) - return resource.RetryableError(cerr) - } - return resource.NonRetryableError(cerr) - } - return nil - }) - - if err != nil { - return err - } - - return resourceAwsOpsworksPermissionRead(d, meta) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_php_app_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_php_app_layer.go deleted file mode 100644 index c3176af..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_php_app_layer.go +++ /dev/null @@ -1,16 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksPhpAppLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "php-app", - DefaultLayerName: "PHP App Server", - - Attributes: map[string]*opsworksLayerTypeAttribute{}, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_rails_app_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_rails_app_layer.go deleted file mode 100644 index 55f869c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_rails_app_layer.go +++ /dev/null @@ -1,47 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksRailsAppLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "rails-app", - DefaultLayerName: "Rails App Server", - - Attributes: map[string]*opsworksLayerTypeAttribute{ - "ruby_version": { - AttrName: "RubyVersion", - Type: schema.TypeString, - Default: "2.0.0", - }, - "app_server": { - AttrName: "RailsStack", - Type: schema.TypeString, - Default: "apache_passenger", - }, - "passenger_version": { - AttrName: "PassengerVersion", - Type: schema.TypeString, - Default: "4.0.46", - }, - "rubygems_version": { - AttrName: "RubygemsVersion", - Type: schema.TypeString, - Default: "2.2.2", - }, - "manage_bundler": { - AttrName: "ManageBundler", - Type: schema.TypeBool, - Default: true, - }, - "bundler_version": { - AttrName: "BundlerVersion", - Type: schema.TypeString, - Default: "1.5.3", - }, - }, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_rds_db_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_rds_db_instance.go deleted file mode 100644 index d1aee90..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_rds_db_instance.go +++ /dev/null @@ -1,202 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/opsworks" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksRdsDbInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsOpsworksRdsDbInstanceRegister, - Update: resourceAwsOpsworksRdsDbInstanceUpdate, - Delete: resourceAwsOpsworksRdsDbInstanceDeregister, - Read: resourceAwsOpsworksRdsDbInstanceRead, - - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "stack_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "rds_db_instance_arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "db_password": { - Type: schema.TypeString, - Required: true, - Sensitive: true, - }, - "db_user": { - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsOpsworksRdsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - d.Partial(true) - - d.SetPartial("rds_db_instance_arn") - req := &opsworks.UpdateRdsDbInstanceInput{ - RdsDbInstanceArn: aws.String(d.Get("rds_db_instance_arn").(string)), - } - - requestUpdate := false - if d.HasChange("db_user") { - d.SetPartial("db_user") - req.DbUser = aws.String(d.Get("db_user").(string)) - requestUpdate = true - } - if d.HasChange("db_password") { - d.SetPartial("db_password") - req.DbPassword = aws.String(d.Get("db_password").(string)) - requestUpdate = true - } - - if true == requestUpdate { - log.Printf("[DEBUG] Opsworks RDS DB Instance Modification request: %s", req) - - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - var cerr error - _, cerr = client.UpdateRdsDbInstance(req) - if cerr != nil { - log.Printf("[INFO] client error") - if opserr, ok := cerr.(awserr.Error); ok { - log.Printf("[ERROR] OpsWorks error: %s message: %s", opserr.Code(), opserr.Message()) - } - return resource.NonRetryableError(cerr) - } - return nil - }) - - if err != nil { - return err - } - - } - - d.Partial(false) - - return resourceAwsOpsworksRdsDbInstanceRead(d, meta) -} - -func resourceAwsOpsworksRdsDbInstanceDeregister(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DeregisterRdsDbInstanceInput{ - RdsDbInstanceArn: aws.String(d.Get("rds_db_instance_arn").(string)), - } - - log.Printf("[DEBUG] Unregistering rds db instance '%s' from stack: %s", d.Get("rds_db_instance_arn"), d.Get("stack_id")) - - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - var cerr error - _, cerr = client.DeregisterRdsDbInstance(req) - if cerr != nil { - log.Printf("[INFO] client error") - if opserr, ok := cerr.(awserr.Error); ok { - if opserr.Code() == "ResourceNotFoundException" { - log.Printf("[INFO] The db instance could not be found. Remove it from state.") - d.SetId("") - - return nil - } - log.Printf("[ERROR] OpsWorks error: %s message: %s", opserr.Code(), opserr.Message()) - } - return resource.NonRetryableError(cerr) - } - - return nil - }) - - if err != nil { - return err - } - - return nil -} - -func resourceAwsOpsworksRdsDbInstanceRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DescribeRdsDbInstancesInput{ - StackId: aws.String(d.Get("stack_id").(string)), - } - - log.Printf("[DEBUG] Reading OpsWorks registerd rds db instances for stack: %s", d.Get("stack_id")) - - resp, err := client.DescribeRdsDbInstances(req) - if err != nil { - return err - } - - found := false - id := "" - for _, instance := range resp.RdsDbInstances { - id = fmt.Sprintf("%s%s", *instance.RdsDbInstanceArn, *instance.StackId) - - if fmt.Sprintf("%s%s", d.Get("rds_db_instance_arn").(string), d.Get("stack_id").(string)) == id { - found = true - d.SetId(id) - d.Set("id", id) - d.Set("stack_id", instance.StackId) - d.Set("rds_db_instance_arn", instance.RdsDbInstanceArn) - d.Set("db_user", instance.DbUser) - } - - } - - if false == found { - d.SetId("") - log.Printf("[INFO] The rds instance '%s' could not be found for stack: '%s'", d.Get("rds_db_instance_arn"), d.Get("stack_id")) - } - - return nil -} - -func resourceAwsOpsworksRdsDbInstanceRegister(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.RegisterRdsDbInstanceInput{ - StackId: aws.String(d.Get("stack_id").(string)), - RdsDbInstanceArn: aws.String(d.Get("rds_db_instance_arn").(string)), - DbUser: aws.String(d.Get("db_user").(string)), - DbPassword: aws.String(d.Get("db_password").(string)), - } - - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - var cerr error - _, cerr = client.RegisterRdsDbInstance(req) - if cerr != nil { - log.Printf("[INFO] client error") - if opserr, ok := cerr.(awserr.Error); ok { - log.Printf("[ERROR] OpsWorks error: %s message: %s", opserr.Code(), opserr.Message()) - } - return resource.NonRetryableError(cerr) - } - - return nil - }) - - if err != nil { - return err - } - - return resourceAwsOpsworksRdsDbInstanceRead(d, meta) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_stack.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_stack.go deleted file mode 100644 index b7d04b2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_stack.go +++ /dev/null @@ -1,485 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/opsworks" -) - -func resourceAwsOpsworksStack() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsOpsworksStackCreate, - Read: resourceAwsOpsworksStackRead, - Update: resourceAwsOpsworksStackUpdate, - Delete: resourceAwsOpsworksStackDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "agent_version": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "id": { - Type: schema.TypeString, - Computed: true, - }, - - "name": { - Type: schema.TypeString, - Required: true, - }, - - "region": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - - "service_role_arn": { - Type: schema.TypeString, - Required: true, - }, - - "default_instance_profile_arn": { - Type: schema.TypeString, - Required: true, - }, - - "color": { - Type: schema.TypeString, - Optional: true, - }, - - "configuration_manager_name": { - Type: schema.TypeString, - Optional: true, - Default: "Chef", - }, - - "configuration_manager_version": { - Type: schema.TypeString, - Optional: true, - Default: "11.4", - }, - - "manage_berkshelf": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "berkshelf_version": { - Type: schema.TypeString, - Optional: true, - Default: "3.2.0", - }, - - "custom_cookbooks_source": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - Required: true, - }, - - "url": { - Type: schema.TypeString, - Required: true, - }, - - "username": { - Type: schema.TypeString, - Optional: true, - }, - - "password": { - Type: schema.TypeString, - Optional: true, - }, - - "revision": { - Type: schema.TypeString, - Optional: true, - }, - - "ssh_key": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - - "custom_json": { - Type: schema.TypeString, - Optional: true, - }, - - "default_availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "default_os": { - Type: schema.TypeString, - Optional: true, - Default: "Ubuntu 12.04 LTS", - }, - - "default_root_device_type": { - Type: schema.TypeString, - Optional: true, - Default: "instance-store", - }, - - "default_ssh_key_name": { - Type: schema.TypeString, - Optional: true, - }, - - "default_subnet_id": { - Type: schema.TypeString, - Optional: true, - }, - - "hostname_theme": { - Type: schema.TypeString, - Optional: true, - Default: "Layer_Dependent", - }, - - "use_custom_cookbooks": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "use_opsworks_security_groups": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "vpc_id": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - }, - } -} - -func resourceAwsOpsworksStackValidate(d *schema.ResourceData) error { - cookbooksSourceCount := d.Get("custom_cookbooks_source.#").(int) - if cookbooksSourceCount > 1 { - return fmt.Errorf("Only one custom_cookbooks_source is permitted") - } - - vpcId := d.Get("vpc_id").(string) - if vpcId != "" { - if d.Get("default_subnet_id").(string) == "" { - return fmt.Errorf("default_subnet_id must be set if vpc_id is set") - } - } else { - if d.Get("default_availability_zone").(string) == "" { - return fmt.Errorf("either vpc_id or default_availability_zone must be set") - } - } - - return nil -} - -func resourceAwsOpsworksStackCustomCookbooksSource(d *schema.ResourceData) *opsworks.Source { - count := d.Get("custom_cookbooks_source.#").(int) - if count == 0 { - return nil - } - - return &opsworks.Source{ - Type: aws.String(d.Get("custom_cookbooks_source.0.type").(string)), - Url: aws.String(d.Get("custom_cookbooks_source.0.url").(string)), - Username: aws.String(d.Get("custom_cookbooks_source.0.username").(string)), - Password: aws.String(d.Get("custom_cookbooks_source.0.password").(string)), - Revision: aws.String(d.Get("custom_cookbooks_source.0.revision").(string)), - SshKey: aws.String(d.Get("custom_cookbooks_source.0.ssh_key").(string)), - } -} - -func resourceAwsOpsworksSetStackCustomCookbooksSource(d *schema.ResourceData, v *opsworks.Source) { - nv := make([]interface{}, 0, 1) - if v != nil && v.Type != nil && *v.Type != "" { - m := make(map[string]interface{}) - if v.Type != nil { - m["type"] = *v.Type - } - if v.Url != nil { - m["url"] = *v.Url - } - if v.Username != nil { - m["username"] = *v.Username - } - if v.Revision != nil { - m["revision"] = *v.Revision - } - // v.Password will, on read, contain the placeholder string - // "*****FILTERED*****", so we ignore it on read and let persist - // the value already in the state. - nv = append(nv, m) - } - - err := d.Set("custom_cookbooks_source", nv) - if err != nil { - // should never happen - panic(err) - } -} - -func resourceAwsOpsworksStackRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DescribeStacksInput{ - StackIds: []*string{ - aws.String(d.Id()), - }, - } - - log.Printf("[DEBUG] Reading OpsWorks stack: %s", d.Id()) - - resp, err := client.DescribeStacks(req) - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "ResourceNotFoundException" { - log.Printf("[DEBUG] OpsWorks stack (%s) not found", d.Id()) - d.SetId("") - return nil - } - } - return err - } - - stack := resp.Stacks[0] - d.Set("agent_version", stack.AgentVersion) - d.Set("name", stack.Name) - d.Set("region", stack.Region) - d.Set("default_instance_profile_arn", stack.DefaultInstanceProfileArn) - d.Set("service_role_arn", stack.ServiceRoleArn) - d.Set("default_availability_zone", stack.DefaultAvailabilityZone) - d.Set("default_os", stack.DefaultOs) - d.Set("default_root_device_type", stack.DefaultRootDeviceType) - d.Set("default_ssh_key_name", stack.DefaultSshKeyName) - d.Set("default_subnet_id", stack.DefaultSubnetId) - d.Set("hostname_theme", stack.HostnameTheme) - d.Set("use_custom_cookbooks", stack.UseCustomCookbooks) - if stack.CustomJson != nil { - d.Set("custom_json", stack.CustomJson) - } - d.Set("use_opsworks_security_groups", stack.UseOpsworksSecurityGroups) - d.Set("vpc_id", stack.VpcId) - if color, ok := stack.Attributes["Color"]; ok { - d.Set("color", color) - } - if stack.ConfigurationManager != nil { - d.Set("configuration_manager_name", stack.ConfigurationManager.Name) - d.Set("configuration_manager_version", stack.ConfigurationManager.Version) - } - if stack.ChefConfiguration != nil { - d.Set("berkshelf_version", stack.ChefConfiguration.BerkshelfVersion) - d.Set("manage_berkshelf", stack.ChefConfiguration.ManageBerkshelf) - } - resourceAwsOpsworksSetStackCustomCookbooksSource(d, stack.CustomCookbooksSource) - - return nil -} - -func resourceAwsOpsworksStackCreate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - err := resourceAwsOpsworksStackValidate(d) - if err != nil { - return err - } - - req := &opsworks.CreateStackInput{ - DefaultInstanceProfileArn: aws.String(d.Get("default_instance_profile_arn").(string)), - Name: aws.String(d.Get("name").(string)), - Region: aws.String(d.Get("region").(string)), - ServiceRoleArn: aws.String(d.Get("service_role_arn").(string)), - DefaultOs: aws.String(d.Get("default_os").(string)), - UseOpsworksSecurityGroups: aws.Bool(d.Get("use_opsworks_security_groups").(bool)), - } - req.ConfigurationManager = &opsworks.StackConfigurationManager{ - Name: aws.String(d.Get("configuration_manager_name").(string)), - Version: aws.String(d.Get("configuration_manager_version").(string)), - } - inVpc := false - if vpcId, ok := d.GetOk("vpc_id"); ok { - req.VpcId = aws.String(vpcId.(string)) - inVpc = true - } - if defaultSubnetId, ok := d.GetOk("default_subnet_id"); ok { - req.DefaultSubnetId = aws.String(defaultSubnetId.(string)) - } - if defaultAvailabilityZone, ok := d.GetOk("default_availability_zone"); ok { - req.DefaultAvailabilityZone = aws.String(defaultAvailabilityZone.(string)) - } - if defaultRootDeviceType, ok := d.GetOk("default_root_device_type"); ok { - req.DefaultRootDeviceType = aws.String(defaultRootDeviceType.(string)) - } - - log.Printf("[DEBUG] Creating OpsWorks stack: %s", req) - - var resp *opsworks.CreateStackOutput - err = resource.Retry(20*time.Minute, func() *resource.RetryError { - var cerr error - resp, cerr = client.CreateStack(req) - if cerr != nil { - if opserr, ok := cerr.(awserr.Error); ok { - // If Terraform is also managing the service IAM role, - // it may have just been created and not yet be - // propagated. - // AWS doesn't provide a machine-readable code for this - // specific error, so we're forced to do fragile message - // matching. - // The full error we're looking for looks something like - // the following: - // Service Role Arn: [...] is not yet propagated, please try again in a couple of minutes - propErr := "not yet propagated" - trustErr := "not the necessary trust relationship" - validateErr := "validate IAM role permission" - if opserr.Code() == "ValidationException" && (strings.Contains(opserr.Message(), trustErr) || strings.Contains(opserr.Message(), propErr) || strings.Contains(opserr.Message(), validateErr)) { - log.Printf("[INFO] Waiting for service IAM role to propagate") - return resource.RetryableError(cerr) - } - } - return resource.NonRetryableError(cerr) - } - return nil - }) - if err != nil { - return err - } - - stackId := *resp.StackId - d.SetId(stackId) - d.Set("id", stackId) - - if inVpc && *req.UseOpsworksSecurityGroups { - // For VPC-based stacks, OpsWorks asynchronously creates some default - // security groups which must exist before layers can be created. - // Unfortunately it doesn't tell us what the ids of these are, so - // we can't actually check for them. Instead, we just wait a nominal - // amount of time for their creation to complete. - log.Print("[INFO] Waiting for OpsWorks built-in security groups to be created") - time.Sleep(30 * time.Second) - } - - return resourceAwsOpsworksStackUpdate(d, meta) -} - -func resourceAwsOpsworksStackUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - err := resourceAwsOpsworksStackValidate(d) - if err != nil { - return err - } - - req := &opsworks.UpdateStackInput{ - CustomJson: aws.String(d.Get("custom_json").(string)), - DefaultInstanceProfileArn: aws.String(d.Get("default_instance_profile_arn").(string)), - DefaultRootDeviceType: aws.String(d.Get("default_root_device_type").(string)), - DefaultSshKeyName: aws.String(d.Get("default_ssh_key_name").(string)), - Name: aws.String(d.Get("name").(string)), - ServiceRoleArn: aws.String(d.Get("service_role_arn").(string)), - StackId: aws.String(d.Id()), - UseCustomCookbooks: aws.Bool(d.Get("use_custom_cookbooks").(bool)), - UseOpsworksSecurityGroups: aws.Bool(d.Get("use_opsworks_security_groups").(bool)), - Attributes: make(map[string]*string), - CustomCookbooksSource: resourceAwsOpsworksStackCustomCookbooksSource(d), - } - if v, ok := d.GetOk("agent_version"); ok { - req.AgentVersion = aws.String(v.(string)) - } - if v, ok := d.GetOk("default_os"); ok { - req.DefaultOs = aws.String(v.(string)) - } - if v, ok := d.GetOk("default_subnet_id"); ok { - req.DefaultSubnetId = aws.String(v.(string)) - } - if v, ok := d.GetOk("default_availability_zone"); ok { - req.DefaultAvailabilityZone = aws.String(v.(string)) - } - if v, ok := d.GetOk("hostname_theme"); ok { - req.HostnameTheme = aws.String(v.(string)) - } - if v, ok := d.GetOk("color"); ok { - req.Attributes["Color"] = aws.String(v.(string)) - } - req.ChefConfiguration = &opsworks.ChefConfiguration{ - BerkshelfVersion: aws.String(d.Get("berkshelf_version").(string)), - ManageBerkshelf: aws.Bool(d.Get("manage_berkshelf").(bool)), - } - req.ConfigurationManager = &opsworks.StackConfigurationManager{ - Name: aws.String(d.Get("configuration_manager_name").(string)), - Version: aws.String(d.Get("configuration_manager_version").(string)), - } - - log.Printf("[DEBUG] Updating OpsWorks stack: %s", req) - - _, err = client.UpdateStack(req) - if err != nil { - return err - } - - return resourceAwsOpsworksStackRead(d, meta) -} - -func resourceAwsOpsworksStackDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DeleteStackInput{ - StackId: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Deleting OpsWorks stack: %s", d.Id()) - - _, err := client.DeleteStack(req) - if err != nil { - return err - } - - // For a stack in a VPC, OpsWorks has created some default security groups - // in the VPC, which it will now delete. - // Unfortunately, the security groups are deleted asynchronously and there - // is no robust way for us to determine when it is done. The VPC itself - // isn't deletable until the security groups are cleaned up, so this could - // make 'terraform destroy' fail if the VPC is also managed and we don't - // wait for the security groups to be deleted. - // There is no robust way to check for this, so we'll just wait a - // nominal amount of time. - _, inVpc := d.GetOk("vpc_id") - _, useOpsworksDefaultSg := d.GetOk("use_opsworks_security_group") - - if inVpc && useOpsworksDefaultSg { - log.Print("[INFO] Waiting for Opsworks built-in security groups to be deleted") - time.Sleep(30 * time.Second) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_static_web_layer.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_static_web_layer.go deleted file mode 100644 index df91b1b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_static_web_layer.go +++ /dev/null @@ -1,16 +0,0 @@ -package aws - -import ( - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsOpsworksStaticWebLayer() *schema.Resource { - layerType := &opsworksLayerType{ - TypeName: "web", - DefaultLayerName: "Static Web Server", - - Attributes: map[string]*opsworksLayerTypeAttribute{}, - } - - return layerType.SchemaResource() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_user_profile.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_user_profile.go deleted file mode 100644 index 39670b2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_opsworks_user_profile.go +++ /dev/null @@ -1,137 +0,0 @@ -package aws - -import ( - "log" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/opsworks" -) - -func resourceAwsOpsworksUserProfile() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsOpsworksUserProfileCreate, - Read: resourceAwsOpsworksUserProfileRead, - Update: resourceAwsOpsworksUserProfileUpdate, - Delete: resourceAwsOpsworksUserProfileDelete, - - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - - "user_arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "allow_self_management": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "ssh_username": { - Type: schema.TypeString, - Required: true, - }, - - "ssh_public_key": { - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func resourceAwsOpsworksUserProfileRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DescribeUserProfilesInput{ - IamUserArns: []*string{ - aws.String(d.Id()), - }, - } - - log.Printf("[DEBUG] Reading OpsWorks user profile: %s", d.Id()) - - resp, err := client.DescribeUserProfiles(req) - if err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "ResourceNotFoundException" { - log.Printf("[DEBUG] OpsWorks user profile (%s) not found", d.Id()) - d.SetId("") - return nil - } - } - return err - } - - for _, profile := range resp.UserProfiles { - d.Set("allow_self_management", profile.AllowSelfManagement) - d.Set("user_arn", profile.IamUserArn) - d.Set("ssh_public_key", profile.SshPublicKey) - d.Set("ssh_username", profile.SshUsername) - break - } - - return nil -} - -func resourceAwsOpsworksUserProfileCreate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.CreateUserProfileInput{ - AllowSelfManagement: aws.Bool(d.Get("allow_self_management").(bool)), - IamUserArn: aws.String(d.Get("user_arn").(string)), - SshPublicKey: aws.String(d.Get("ssh_public_key").(string)), - SshUsername: aws.String(d.Get("ssh_username").(string)), - } - - resp, err := client.CreateUserProfile(req) - if err != nil { - return err - } - - d.SetId(*resp.IamUserArn) - - return resourceAwsOpsworksUserProfileUpdate(d, meta) -} - -func resourceAwsOpsworksUserProfileUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.UpdateUserProfileInput{ - AllowSelfManagement: aws.Bool(d.Get("allow_self_management").(bool)), - IamUserArn: aws.String(d.Get("user_arn").(string)), - SshPublicKey: aws.String(d.Get("ssh_public_key").(string)), - SshUsername: aws.String(d.Get("ssh_username").(string)), - } - - log.Printf("[DEBUG] Updating OpsWorks user profile: %s", req) - - _, err := client.UpdateUserProfile(req) - if err != nil { - return err - } - - return resourceAwsOpsworksUserProfileRead(d, meta) -} - -func resourceAwsOpsworksUserProfileDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient).opsworksconn - - req := &opsworks.DeleteUserProfileInput{ - IamUserArn: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Deleting OpsWorks user profile: %s", d.Id()) - - _, err := client.DeleteUserProfile(req) - - return err -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_placement_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_placement_group.go deleted file mode 100644 index e5da78c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_placement_group.go +++ /dev/null @@ -1,153 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsPlacementGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsPlacementGroupCreate, - Read: resourceAwsPlacementGroupRead, - Delete: resourceAwsPlacementGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "strategy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsPlacementGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - name := d.Get("name").(string) - input := ec2.CreatePlacementGroupInput{ - GroupName: aws.String(name), - Strategy: aws.String(d.Get("strategy").(string)), - } - log.Printf("[DEBUG] Creating EC2 Placement group: %s", input) - _, err := conn.CreatePlacementGroup(&input) - if err != nil { - return err - } - - wait := resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"available"}, - Timeout: 5 * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - out, err := conn.DescribePlacementGroups(&ec2.DescribePlacementGroupsInput{ - GroupNames: []*string{aws.String(name)}, - }) - - if err != nil { - return out, "", err - } - - if len(out.PlacementGroups) == 0 { - return out, "", fmt.Errorf("Placement group not found (%q)", name) - } - pg := out.PlacementGroups[0] - - return out, *pg.State, nil - }, - } - - _, err = wait.WaitForState() - if err != nil { - return err - } - - log.Printf("[DEBUG] EC2 Placement group created: %q", name) - - d.SetId(name) - - return resourceAwsPlacementGroupRead(d, meta) -} - -func resourceAwsPlacementGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - input := ec2.DescribePlacementGroupsInput{ - GroupNames: []*string{aws.String(d.Id())}, - } - out, err := conn.DescribePlacementGroups(&input) - if err != nil { - return err - } - pg := out.PlacementGroups[0] - - log.Printf("[DEBUG] Received EC2 Placement Group: %s", pg) - - d.Set("name", pg.GroupName) - d.Set("strategy", pg.Strategy) - - return nil -} - -func resourceAwsPlacementGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[DEBUG] Deleting EC2 Placement Group %q", d.Id()) - _, err := conn.DeletePlacementGroup(&ec2.DeletePlacementGroupInput{ - GroupName: aws.String(d.Id()), - }) - if err != nil { - return err - } - - wait := resource.StateChangeConf{ - Pending: []string{"deleting"}, - Target: []string{"deleted"}, - Timeout: 5 * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - out, err := conn.DescribePlacementGroups(&ec2.DescribePlacementGroupsInput{ - GroupNames: []*string{aws.String(d.Id())}, - }) - - if err != nil { - awsErr := err.(awserr.Error) - if awsErr.Code() == "InvalidPlacementGroup.Unknown" { - return out, "deleted", nil - } - return out, "", awsErr - } - - if len(out.PlacementGroups) == 0 { - return out, "deleted", nil - } - - pg := out.PlacementGroups[0] - - return out, *pg.State, nil - }, - } - - _, err = wait.WaitForState() - if err != nil { - return err - } - - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_proxy_protocol_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_proxy_protocol_policy.go deleted file mode 100644 index ae7d61d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_proxy_protocol_policy.go +++ /dev/null @@ -1,267 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsProxyProtocolPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsProxyProtocolPolicyCreate, - Read: resourceAwsProxyProtocolPolicyRead, - Update: resourceAwsProxyProtocolPolicyUpdate, - Delete: resourceAwsProxyProtocolPolicyDelete, - - Schema: map[string]*schema.Schema{ - "load_balancer": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "instance_ports": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Required: true, - Set: schema.HashString, - }, - }, - } -} - -func resourceAwsProxyProtocolPolicyCreate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - elbname := aws.String(d.Get("load_balancer").(string)) - - input := &elb.CreateLoadBalancerPolicyInput{ - LoadBalancerName: elbname, - PolicyAttributes: []*elb.PolicyAttribute{ - &elb.PolicyAttribute{ - AttributeName: aws.String("ProxyProtocol"), - AttributeValue: aws.String("True"), - }, - }, - PolicyName: aws.String("TFEnableProxyProtocol"), - PolicyTypeName: aws.String("ProxyProtocolPolicyType"), - } - - // Create a policy - log.Printf("[DEBUG] ELB create a policy %s from policy type %s", - *input.PolicyName, *input.PolicyTypeName) - - if _, err := elbconn.CreateLoadBalancerPolicy(input); err != nil { - return fmt.Errorf("Error creating a policy %s: %s", - *input.PolicyName, err) - } - - // Assign the policy name for use later - d.Partial(true) - d.SetId(fmt.Sprintf("%s:%s", *elbname, *input.PolicyName)) - d.SetPartial("load_balancer") - log.Printf("[INFO] ELB PolicyName: %s", *input.PolicyName) - - return resourceAwsProxyProtocolPolicyUpdate(d, meta) -} - -func resourceAwsProxyProtocolPolicyRead(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - elbname := aws.String(d.Get("load_balancer").(string)) - - // Retrieve the current ELB policies for updating the state - req := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{elbname}, - } - resp, err := elbconn.DescribeLoadBalancers(req) - if err != nil { - if isLoadBalancerNotFound(err) { - // The ELB is gone now, so just remove it from the state - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving ELB attributes: %s", err) - } - - backends := flattenBackendPolicies(resp.LoadBalancerDescriptions[0].BackendServerDescriptions) - - ports := []*string{} - for ip := range backends { - ipstr := strconv.Itoa(int(ip)) - ports = append(ports, &ipstr) - } - d.Set("instance_ports", ports) - d.Set("load_balancer", *elbname) - return nil -} - -func resourceAwsProxyProtocolPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - elbname := aws.String(d.Get("load_balancer").(string)) - - // Retrieve the current ELB policies for updating the state - req := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{elbname}, - } - resp, err := elbconn.DescribeLoadBalancers(req) - if err != nil { - if isLoadBalancerNotFound(err) { - // The ELB is gone now, so just remove it from the state - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving ELB attributes: %s", err) - } - - backends := flattenBackendPolicies(resp.LoadBalancerDescriptions[0].BackendServerDescriptions) - _, policyName := resourceAwsProxyProtocolPolicyParseId(d.Id()) - - d.Partial(true) - if d.HasChange("instance_ports") { - o, n := d.GetChange("instance_ports") - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := os.Difference(ns).List() - add := ns.Difference(os).List() - - inputs := []*elb.SetLoadBalancerPoliciesForBackendServerInput{} - - i, err := resourceAwsProxyProtocolPolicyRemove(policyName, remove, backends) - if err != nil { - return err - } - inputs = append(inputs, i...) - - i, err = resourceAwsProxyProtocolPolicyAdd(policyName, add, backends) - if err != nil { - return err - } - inputs = append(inputs, i...) - - for _, input := range inputs { - input.LoadBalancerName = elbname - if _, err := elbconn.SetLoadBalancerPoliciesForBackendServer(input); err != nil { - return fmt.Errorf("Error setting policy for backend: %s", err) - } - } - - d.SetPartial("instance_ports") - } - - return resourceAwsProxyProtocolPolicyRead(d, meta) -} - -func resourceAwsProxyProtocolPolicyDelete(d *schema.ResourceData, meta interface{}) error { - elbconn := meta.(*AWSClient).elbconn - elbname := aws.String(d.Get("load_balancer").(string)) - - // Retrieve the current ELB policies for updating the state - req := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{elbname}, - } - var err error - resp, err := elbconn.DescribeLoadBalancers(req) - if err != nil { - if isLoadBalancerNotFound(err) { - // The ELB is gone now, so just remove it from the state - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving ELB attributes: %s", err) - } - - backends := flattenBackendPolicies(resp.LoadBalancerDescriptions[0].BackendServerDescriptions) - ports := d.Get("instance_ports").(*schema.Set).List() - _, policyName := resourceAwsProxyProtocolPolicyParseId(d.Id()) - - inputs, err := resourceAwsProxyProtocolPolicyRemove(policyName, ports, backends) - if err != nil { - return fmt.Errorf("Error detaching a policy from backend: %s", err) - } - for _, input := range inputs { - input.LoadBalancerName = elbname - if _, err := elbconn.SetLoadBalancerPoliciesForBackendServer(input); err != nil { - return fmt.Errorf("Error setting policy for backend: %s", err) - } - } - - pOpt := &elb.DeleteLoadBalancerPolicyInput{ - LoadBalancerName: elbname, - PolicyName: aws.String(policyName), - } - if _, err := elbconn.DeleteLoadBalancerPolicy(pOpt); err != nil { - return fmt.Errorf("Error removing a policy from load balancer: %s", err) - } - - return nil -} - -func resourceAwsProxyProtocolPolicyRemove(policyName string, ports []interface{}, backends map[int64][]string) ([]*elb.SetLoadBalancerPoliciesForBackendServerInput, error) { - inputs := make([]*elb.SetLoadBalancerPoliciesForBackendServerInput, 0, len(ports)) - for _, p := range ports { - ip, err := strconv.ParseInt(p.(string), 10, 64) - if err != nil { - return nil, fmt.Errorf("Error detaching the policy: %s", err) - } - - newPolicies := []*string{} - curPolicies, found := backends[ip] - if !found { - // No policy for this instance port found, just skip it. - continue - } - - for _, policy := range curPolicies { - if policy == policyName { - // remove the policy - continue - } - newPolicies = append(newPolicies, &policy) - } - - inputs = append(inputs, &elb.SetLoadBalancerPoliciesForBackendServerInput{ - InstancePort: &ip, - PolicyNames: newPolicies, - }) - } - return inputs, nil -} - -func resourceAwsProxyProtocolPolicyAdd(policyName string, ports []interface{}, backends map[int64][]string) ([]*elb.SetLoadBalancerPoliciesForBackendServerInput, error) { - inputs := make([]*elb.SetLoadBalancerPoliciesForBackendServerInput, 0, len(ports)) - for _, p := range ports { - ip, err := strconv.ParseInt(p.(string), 10, 64) - if err != nil { - return nil, fmt.Errorf("Error attaching the policy: %s", err) - } - - newPolicies := []*string{} - curPolicies := backends[ip] - for _, p := range curPolicies { - if p == policyName { - // Just remove it for now. It will be back later. - continue - } else { - newPolicies = append(newPolicies, &p) - } - } - newPolicies = append(newPolicies, aws.String(policyName)) - - inputs = append(inputs, &elb.SetLoadBalancerPoliciesForBackendServerInput{ - InstancePort: &ip, - PolicyNames: newPolicies, - }) - } - return inputs, nil -} - -// resourceAwsProxyProtocolPolicyParseId takes an ID and parses it into -// it's constituent parts. You need two axes (LB name, policy name) -// to create or identify a proxy protocol policy in AWS's API. -func resourceAwsProxyProtocolPolicyParseId(id string) (string, string) { - parts := strings.SplitN(id, ":", 2) - return parts[0], parts[1] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster.go deleted file mode 100644 index 7461b88..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster.go +++ /dev/null @@ -1,689 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRDSCluster() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRDSClusterCreate, - Read: resourceAwsRDSClusterRead, - Update: resourceAwsRDSClusterUpdate, - Delete: resourceAwsRDSClusterDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsRdsClusterImport, - }, - - Schema: map[string]*schema.Schema{ - - "availability_zones": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - ForceNew: true, - Computed: true, - Set: schema.HashString, - }, - - "cluster_identifier": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateRdsId, - }, - - "cluster_members": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Computed: true, - Set: schema.HashString, - }, - - "database_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "db_subnet_group_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "db_cluster_parameter_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "endpoint": { - Type: schema.TypeString, - Computed: true, - }, - - "reader_endpoint": { - Type: schema.TypeString, - Computed: true, - }, - - "engine": { - Type: schema.TypeString, - Computed: true, - }, - - "storage_encrypted": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - - "final_snapshot_identifier": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) { - es = append(es, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - es = append(es, fmt.Errorf("%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - es = append(es, fmt.Errorf("%q cannot end in a hyphen", k)) - } - return - }, - }, - - "skip_final_snapshot": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "master_username": { - Type: schema.TypeString, - Computed: true, - Optional: true, - ForceNew: true, - }, - - "master_password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - }, - - "snapshot_identifier": { - Type: schema.TypeString, - Computed: false, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "port": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - - // apply_immediately is used to determine when the update modifications - // take place. - // See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html - "apply_immediately": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "vpc_security_group_ids": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "preferred_backup_window": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateOnceADayWindowFormat, - }, - - "preferred_maintenance_window": { - Type: schema.TypeString, - Optional: true, - Computed: true, - StateFunc: func(val interface{}) string { - if val == nil { - return "" - } - return strings.ToLower(val.(string)) - }, - ValidateFunc: validateOnceAWeekWindowFormat, - }, - - "backup_retention_period": { - Type: schema.TypeInt, - Optional: true, - Default: 1, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(int) - if value > 35 { - es = append(es, fmt.Errorf( - "backup retention period cannot be more than 35 days")) - } - return - }, - }, - - "kms_key_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - - "replication_source_identifier": { - Type: schema.TypeString, - Optional: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsRdsClusterImport( - d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - // Neither skip_final_snapshot nor final_snapshot_identifier can be fetched - // from any API call, so we need to default skip_final_snapshot to true so - // that final_snapshot_identifier is not required - d.Set("skip_final_snapshot", true) - return []*schema.ResourceData{d}, nil -} - -func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - if _, ok := d.GetOk("snapshot_identifier"); ok { - opts := rds.RestoreDBClusterFromSnapshotInput{ - DBClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)), - SnapshotIdentifier: aws.String(d.Get("snapshot_identifier").(string)), - Engine: aws.String("aurora"), - Tags: tags, - } - - if attr := d.Get("availability_zones").(*schema.Set); attr.Len() > 0 { - opts.AvailabilityZones = expandStringList(attr.List()) - } - - if attr, ok := d.GetOk("db_subnet_group_name"); ok { - opts.DBSubnetGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("database_name"); ok { - opts.DatabaseName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("option_group_name"); ok { - opts.OptionGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("port"); ok { - opts.Port = aws.Int64(int64(attr.(int))) - } - - var sgUpdate bool - if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 { - sgUpdate = true - opts.VpcSecurityGroupIds = expandStringList(attr.List()) - } - - log.Printf("[DEBUG] RDS Cluster restore from snapshot configuration: %s", opts) - _, err := conn.RestoreDBClusterFromSnapshot(&opts) - if err != nil { - return fmt.Errorf("Error creating RDS Cluster: %s", err) - } - - if sgUpdate { - log.Printf("[INFO] RDS Cluster is restoring from snapshot with default security, but custom security should be set, will now update after snapshot is restored!") - - d.SetId(d.Get("cluster_identifier").(string)) - - log.Printf("[INFO] RDS Cluster Instance ID: %s", d.Id()) - - log.Println("[INFO] Waiting for RDS Cluster to be available") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying"}, - Target: []string{"available"}, - Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta), - Timeout: 120 * time.Minute, - MinTimeout: 3 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - // Wait, catching any errors - _, err := stateConf.WaitForState() - if err != nil { - return err - } - - err = resourceAwsRDSClusterInstanceUpdate(d, meta) - if err != nil { - return err - } - } - } else if _, ok := d.GetOk("replication_source_identifier"); ok { - createOpts := &rds.CreateDBClusterInput{ - DBClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)), - Engine: aws.String("aurora"), - StorageEncrypted: aws.Bool(d.Get("storage_encrypted").(bool)), - ReplicationSourceIdentifier: aws.String(d.Get("replication_source_identifier").(string)), - Tags: tags, - } - - if attr, ok := d.GetOk("port"); ok { - createOpts.Port = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("db_subnet_group_name"); ok { - createOpts.DBSubnetGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("db_cluster_parameter_group_name"); ok { - createOpts.DBClusterParameterGroupName = aws.String(attr.(string)) - } - - if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 { - createOpts.VpcSecurityGroupIds = expandStringList(attr.List()) - } - - if attr := d.Get("availability_zones").(*schema.Set); attr.Len() > 0 { - createOpts.AvailabilityZones = expandStringList(attr.List()) - } - - if v, ok := d.GetOk("backup_retention_period"); ok { - createOpts.BackupRetentionPeriod = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("preferred_backup_window"); ok { - createOpts.PreferredBackupWindow = aws.String(v.(string)) - } - - if v, ok := d.GetOk("preferred_maintenance_window"); ok { - createOpts.PreferredMaintenanceWindow = aws.String(v.(string)) - } - - if attr, ok := d.GetOk("kms_key_id"); ok { - createOpts.KmsKeyId = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] Create RDS Cluster as read replica: %s", createOpts) - resp, err := conn.CreateDBCluster(createOpts) - if err != nil { - log.Printf("[ERROR] Error creating RDS Cluster: %s", err) - return err - } - - log.Printf("[DEBUG]: RDS Cluster create response: %s", resp) - - } else { - if _, ok := d.GetOk("master_password"); !ok { - return fmt.Errorf(`provider.aws: aws_rds_cluster: %s: "master_password": required field is not set`, d.Get("database_name").(string)) - } - - if _, ok := d.GetOk("master_username"); !ok { - return fmt.Errorf(`provider.aws: aws_rds_cluster: %s: "master_username": required field is not set`, d.Get("database_name").(string)) - } - - createOpts := &rds.CreateDBClusterInput{ - DBClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)), - Engine: aws.String("aurora"), - MasterUserPassword: aws.String(d.Get("master_password").(string)), - MasterUsername: aws.String(d.Get("master_username").(string)), - StorageEncrypted: aws.Bool(d.Get("storage_encrypted").(bool)), - Tags: tags, - } - - if v := d.Get("database_name"); v.(string) != "" { - createOpts.DatabaseName = aws.String(v.(string)) - } - - if attr, ok := d.GetOk("port"); ok { - createOpts.Port = aws.Int64(int64(attr.(int))) - } - - if attr, ok := d.GetOk("db_subnet_group_name"); ok { - createOpts.DBSubnetGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("db_cluster_parameter_group_name"); ok { - createOpts.DBClusterParameterGroupName = aws.String(attr.(string)) - } - - if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 { - createOpts.VpcSecurityGroupIds = expandStringList(attr.List()) - } - - if attr := d.Get("availability_zones").(*schema.Set); attr.Len() > 0 { - createOpts.AvailabilityZones = expandStringList(attr.List()) - } - - if v, ok := d.GetOk("backup_retention_period"); ok { - createOpts.BackupRetentionPeriod = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("preferred_backup_window"); ok { - createOpts.PreferredBackupWindow = aws.String(v.(string)) - } - - if v, ok := d.GetOk("preferred_maintenance_window"); ok { - createOpts.PreferredMaintenanceWindow = aws.String(v.(string)) - } - - if attr, ok := d.GetOk("kms_key_id"); ok { - createOpts.KmsKeyId = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] RDS Cluster create options: %s", createOpts) - resp, err := conn.CreateDBCluster(createOpts) - if err != nil { - log.Printf("[ERROR] Error creating RDS Cluster: %s", err) - return err - } - - log.Printf("[DEBUG]: RDS Cluster create response: %s", resp) - } - - d.SetId(d.Get("cluster_identifier").(string)) - - log.Printf("[INFO] RDS Cluster ID: %s", d.Id()) - - log.Println( - "[INFO] Waiting for RDS Cluster to be available") - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying"}, - Target: []string{"available"}, - Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta), - Timeout: 120 * time.Minute, - MinTimeout: 3 * time.Second, - } - - // Wait, catching any errors - _, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf("[WARN] Error waiting for RDS Cluster state to be \"available\": %s", err) - } - - return resourceAwsRDSClusterRead(d, meta) -} - -func resourceAwsRDSClusterRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - - resp, err := conn.DescribeDBClusters(&rds.DescribeDBClustersInput{ - DBClusterIdentifier: aws.String(d.Id()), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if "DBClusterNotFoundFault" == awsErr.Code() { - d.SetId("") - log.Printf("[DEBUG] RDS Cluster (%s) not found", d.Id()) - return nil - } - } - log.Printf("[DEBUG] Error describing RDS Cluster (%s)", d.Id()) - return err - } - - var dbc *rds.DBCluster - for _, c := range resp.DBClusters { - if *c.DBClusterIdentifier == d.Id() { - dbc = c - } - } - - if dbc == nil { - log.Printf("[WARN] RDS Cluster (%s) not found", d.Id()) - d.SetId("") - return nil - } - - if err := d.Set("availability_zones", aws.StringValueSlice(dbc.AvailabilityZones)); err != nil { - return fmt.Errorf("[DEBUG] Error saving AvailabilityZones to state for RDS Cluster (%s): %s", d.Id(), err) - } - - // Only set the DatabaseName if it is not nil. There is a known API bug where - // RDS accepts a DatabaseName but does not return it, causing a perpetual - // diff. - // See https://github.com/hashicorp/terraform/issues/4671 for backstory - if dbc.DatabaseName != nil { - d.Set("database_name", dbc.DatabaseName) - } - - d.Set("cluster_identifier", dbc.DBClusterIdentifier) - d.Set("db_subnet_group_name", dbc.DBSubnetGroup) - d.Set("db_cluster_parameter_group_name", dbc.DBClusterParameterGroup) - d.Set("endpoint", dbc.Endpoint) - d.Set("engine", dbc.Engine) - d.Set("master_username", dbc.MasterUsername) - d.Set("port", dbc.Port) - d.Set("storage_encrypted", dbc.StorageEncrypted) - d.Set("backup_retention_period", dbc.BackupRetentionPeriod) - d.Set("preferred_backup_window", dbc.PreferredBackupWindow) - d.Set("preferred_maintenance_window", dbc.PreferredMaintenanceWindow) - d.Set("kms_key_id", dbc.KmsKeyId) - d.Set("reader_endpoint", dbc.ReaderEndpoint) - d.Set("replication_source_identifier", dbc.ReplicationSourceIdentifier) - - var vpcg []string - for _, g := range dbc.VpcSecurityGroups { - vpcg = append(vpcg, *g.VpcSecurityGroupId) - } - if err := d.Set("vpc_security_group_ids", vpcg); err != nil { - return fmt.Errorf("[DEBUG] Error saving VPC Security Group IDs to state for RDS Cluster (%s): %s", d.Id(), err) - } - - var cm []string - for _, m := range dbc.DBClusterMembers { - cm = append(cm, *m.DBInstanceIdentifier) - } - if err := d.Set("cluster_members", cm); err != nil { - return fmt.Errorf("[DEBUG] Error saving RDS Cluster Members to state for RDS Cluster (%s): %s", d.Id(), err) - } - - // Fetch and save tags - arn, err := buildRDSClusterARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - log.Printf("[DEBUG] Error building ARN for RDS Cluster (%s), not setting Tags", *dbc.DBClusterIdentifier) - } else { - if err := saveTagsRDS(conn, d, arn); err != nil { - log.Printf("[WARN] Failed to save tags for RDS Cluster (%s): %s", *dbc.DBClusterIdentifier, err) - } - } - - return nil -} - -func resourceAwsRDSClusterUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - requestUpdate := false - - req := &rds.ModifyDBClusterInput{ - ApplyImmediately: aws.Bool(d.Get("apply_immediately").(bool)), - DBClusterIdentifier: aws.String(d.Id()), - } - - if d.HasChange("master_password") { - req.MasterUserPassword = aws.String(d.Get("master_password").(string)) - requestUpdate = true - } - - if d.HasChange("vpc_security_group_ids") { - if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 { - req.VpcSecurityGroupIds = expandStringList(attr.List()) - } else { - req.VpcSecurityGroupIds = []*string{} - } - requestUpdate = true - } - - if d.HasChange("preferred_backup_window") { - req.PreferredBackupWindow = aws.String(d.Get("preferred_backup_window").(string)) - requestUpdate = true - } - - if d.HasChange("preferred_maintenance_window") { - req.PreferredMaintenanceWindow = aws.String(d.Get("preferred_maintenance_window").(string)) - requestUpdate = true - } - - if d.HasChange("backup_retention_period") { - req.BackupRetentionPeriod = aws.Int64(int64(d.Get("backup_retention_period").(int))) - requestUpdate = true - } - - if d.HasChange("db_cluster_parameter_group_name") { - d.SetPartial("db_cluster_parameter_group_name") - req.DBClusterParameterGroupName = aws.String(d.Get("db_cluster_parameter_group_name").(string)) - requestUpdate = true - } - - if requestUpdate { - _, err := conn.ModifyDBCluster(req) - if err != nil { - return fmt.Errorf("[WARN] Error modifying RDS Cluster (%s): %s", d.Id(), err) - } - } - - if arn, err := buildRDSClusterARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(conn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - - return resourceAwsRDSClusterRead(d, meta) -} - -func resourceAwsRDSClusterDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - log.Printf("[DEBUG] Destroying RDS Cluster (%s)", d.Id()) - - deleteOpts := rds.DeleteDBClusterInput{ - DBClusterIdentifier: aws.String(d.Id()), - } - - skipFinalSnapshot := d.Get("skip_final_snapshot").(bool) - deleteOpts.SkipFinalSnapshot = aws.Bool(skipFinalSnapshot) - - if skipFinalSnapshot == false { - if name, present := d.GetOk("final_snapshot_identifier"); present { - deleteOpts.FinalDBSnapshotIdentifier = aws.String(name.(string)) - } else { - return fmt.Errorf("RDS Cluster FinalSnapshotIdentifier is required when a final snapshot is required") - } - } - - log.Printf("[DEBUG] RDS Cluster delete options: %s", deleteOpts) - _, err := conn.DeleteDBCluster(&deleteOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if "InvalidDBClusterStateFault" == awsErr.Code() { - return fmt.Errorf("RDS Cluster cannot be deleted: %s", awsErr.Message()) - } - } - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"available", "deleting", "backing-up", "modifying"}, - Target: []string{"destroyed"}, - Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta), - Timeout: 15 * time.Minute, - MinTimeout: 3 * time.Second, - } - - // Wait, catching any errors - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("[WARN] Error deleting RDS Cluster (%s): %s", d.Id(), err) - } - - return nil -} - -func resourceAwsRDSClusterStateRefreshFunc( - d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - conn := meta.(*AWSClient).rdsconn - - resp, err := conn.DescribeDBClusters(&rds.DescribeDBClustersInput{ - DBClusterIdentifier: aws.String(d.Id()), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if "DBClusterNotFoundFault" == awsErr.Code() { - return 42, "destroyed", nil - } - } - log.Printf("[WARN] Error on retrieving DB Cluster (%s) when waiting: %s", d.Id(), err) - return nil, "", err - } - - var dbc *rds.DBCluster - - for _, c := range resp.DBClusters { - if *c.DBClusterIdentifier == d.Id() { - dbc = c - } - } - - if dbc == nil { - return 42, "destroyed", nil - } - - if dbc.Status != nil { - log.Printf("[DEBUG] DB Cluster status (%s): %s", d.Id(), *dbc.Status) - } - - return dbc, *dbc.Status, nil - } -} - -func buildRDSClusterARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct RDS Cluster ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct RDS Cluster ARN because of missing AWS Account ID") - } - - arn := fmt.Sprintf("arn:%s:rds:%s:%s:cluster:%s", partition, region, accountid, identifier) - return arn, nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster_instance.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster_instance.go deleted file mode 100644 index 6dedec1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster_instance.go +++ /dev/null @@ -1,374 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRDSClusterInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRDSClusterInstanceCreate, - Read: resourceAwsRDSClusterInstanceRead, - Update: resourceAwsRDSClusterInstanceUpdate, - Delete: resourceAwsRDSClusterInstanceDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "identifier": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validateRdsId, - }, - - "db_subnet_group_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "writer": { - Type: schema.TypeBool, - Computed: true, - }, - - "cluster_identifier": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "endpoint": { - Type: schema.TypeString, - Computed: true, - }, - - "port": { - Type: schema.TypeInt, - Computed: true, - }, - - "publicly_accessible": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "instance_class": { - Type: schema.TypeString, - Required: true, - }, - - "db_parameter_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - // apply_immediately is used to determine when the update modifications - // take place. - // See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html - "apply_immediately": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "kms_key_id": { - Type: schema.TypeString, - Computed: true, - }, - - "storage_encrypted": { - Type: schema.TypeBool, - Computed: true, - }, - - "auto_minor_version_upgrade": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "monitoring_role_arn": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "monitoring_interval": { - Type: schema.TypeInt, - Optional: true, - Default: 0, - }, - - "promotion_tier": { - Type: schema.TypeInt, - Optional: true, - Default: 0, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsRDSClusterInstanceCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - createOpts := &rds.CreateDBInstanceInput{ - DBInstanceClass: aws.String(d.Get("instance_class").(string)), - DBClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)), - Engine: aws.String("aurora"), - PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), - PromotionTier: aws.Int64(int64(d.Get("promotion_tier").(int))), - AutoMinorVersionUpgrade: aws.Bool(d.Get("auto_minor_version_upgrade").(bool)), - Tags: tags, - } - - if attr, ok := d.GetOk("db_parameter_group_name"); ok { - createOpts.DBParameterGroupName = aws.String(attr.(string)) - } - - if v := d.Get("identifier").(string); v != "" { - createOpts.DBInstanceIdentifier = aws.String(v) - } else { - createOpts.DBInstanceIdentifier = aws.String(resource.UniqueId()) - } - - if attr, ok := d.GetOk("db_subnet_group_name"); ok { - createOpts.DBSubnetGroupName = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("monitoring_role_arn"); ok { - createOpts.MonitoringRoleArn = aws.String(attr.(string)) - } - - if attr, ok := d.GetOk("monitoring_interval"); ok { - createOpts.MonitoringInterval = aws.Int64(int64(attr.(int))) - } - - log.Printf("[DEBUG] Creating RDS DB Instance opts: %s", createOpts) - resp, err := conn.CreateDBInstance(createOpts) - if err != nil { - return err - } - - d.SetId(*resp.DBInstance.DBInstanceIdentifier) - - // reuse db_instance refresh func - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying"}, - Target: []string{"available"}, - Refresh: resourceAwsDbInstanceStateRefreshFunc(d, meta), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 10 * time.Second, - } - - // Wait, catching any errors - _, err = stateConf.WaitForState() - if err != nil { - return err - } - - return resourceAwsRDSClusterInstanceRead(d, meta) -} - -func resourceAwsRDSClusterInstanceRead(d *schema.ResourceData, meta interface{}) error { - db, err := resourceAwsDbInstanceRetrieve(d, meta) - // Errors from this helper are always reportable - if err != nil { - return fmt.Errorf("[WARN] Error on retrieving RDS Cluster Instance (%s): %s", d.Id(), err) - } - // A nil response means "not found" - if db == nil { - log.Printf("[WARN] RDS Cluster Instance (%s): not found, removing from state.", d.Id()) - d.SetId("") - return nil - } - - // Retrieve DB Cluster information, to determine if this Instance is a writer - conn := meta.(*AWSClient).rdsconn - resp, err := conn.DescribeDBClusters(&rds.DescribeDBClustersInput{ - DBClusterIdentifier: db.DBClusterIdentifier, - }) - - var dbc *rds.DBCluster - for _, c := range resp.DBClusters { - if *c.DBClusterIdentifier == *db.DBClusterIdentifier { - dbc = c - } - } - - if dbc == nil { - return fmt.Errorf("[WARN] Error finding RDS Cluster (%s) for Cluster Instance (%s): %s", - *db.DBClusterIdentifier, *db.DBInstanceIdentifier, err) - } - - for _, m := range dbc.DBClusterMembers { - if *db.DBInstanceIdentifier == *m.DBInstanceIdentifier { - if *m.IsClusterWriter == true { - d.Set("writer", true) - } else { - d.Set("writer", false) - } - } - } - - if db.Endpoint != nil { - d.Set("endpoint", db.Endpoint.Address) - d.Set("port", db.Endpoint.Port) - } - - d.Set("publicly_accessible", db.PubliclyAccessible) - d.Set("cluster_identifier", db.DBClusterIdentifier) - d.Set("instance_class", db.DBInstanceClass) - d.Set("identifier", db.DBInstanceIdentifier) - d.Set("storage_encrypted", db.StorageEncrypted) - d.Set("kms_key_id", db.KmsKeyId) - d.Set("auto_minor_version_upgrade", db.AutoMinorVersionUpgrade) - d.Set("promotion_tier", db.PromotionTier) - - if db.MonitoringInterval != nil { - d.Set("monitoring_interval", db.MonitoringInterval) - } - - if db.MonitoringRoleArn != nil { - d.Set("monitoring_role_arn", db.MonitoringRoleArn) - } - - if len(db.DBParameterGroups) > 0 { - d.Set("db_parameter_group_name", db.DBParameterGroups[0].DBParameterGroupName) - } - - // Fetch and save tags - arn, err := buildRDSARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - log.Printf("[DEBUG] Error building ARN for RDS Cluster Instance (%s), not setting Tags", *db.DBInstanceIdentifier) - } else { - if err := saveTagsRDS(conn, d, arn); err != nil { - log.Printf("[WARN] Failed to save tags for RDS Cluster Instance (%s): %s", *db.DBClusterIdentifier, err) - } - } - - return nil -} - -func resourceAwsRDSClusterInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - requestUpdate := false - - req := &rds.ModifyDBInstanceInput{ - ApplyImmediately: aws.Bool(d.Get("apply_immediately").(bool)), - DBInstanceIdentifier: aws.String(d.Id()), - } - - if d.HasChange("db_parameter_group_name") { - req.DBParameterGroupName = aws.String(d.Get("db_parameter_group_name").(string)) - requestUpdate = true - } - - if d.HasChange("instance_class") { - req.DBInstanceClass = aws.String(d.Get("instance_class").(string)) - requestUpdate = true - } - - if d.HasChange("monitoring_role_arn") { - d.SetPartial("monitoring_role_arn") - req.MonitoringRoleArn = aws.String(d.Get("monitoring_role_arn").(string)) - requestUpdate = true - } - - if d.HasChange("monitoring_interval") { - d.SetPartial("monitoring_interval") - req.MonitoringInterval = aws.Int64(int64(d.Get("monitoring_interval").(int))) - requestUpdate = true - } - - if d.HasChange("auto_minor_version_upgrade") { - d.SetPartial("auto_minor_version_upgrade") - req.AutoMinorVersionUpgrade = aws.Bool(d.Get("auto_minor_version_upgrade").(bool)) - requestUpdate = true - } - - if d.HasChange("promotion_tier") { - d.SetPartial("promotion_tier") - req.PromotionTier = aws.Int64(int64(d.Get("promotion_tier").(int))) - requestUpdate = true - } - - log.Printf("[DEBUG] Send DB Instance Modification request: %#v", requestUpdate) - if requestUpdate { - log.Printf("[DEBUG] DB Instance Modification request: %#v", req) - _, err := conn.ModifyDBInstance(req) - if err != nil { - return fmt.Errorf("Error modifying DB Instance %s: %s", d.Id(), err) - } - - // reuse db_instance refresh func - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying"}, - Target: []string{"available"}, - Refresh: resourceAwsDbInstanceStateRefreshFunc(d, meta), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 10 * time.Second, - } - - // Wait, catching any errors - _, err = stateConf.WaitForState() - if err != nil { - return err - } - - } - - if arn, err := buildRDSARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(conn, d, arn); err != nil { - return err - } - } - - return resourceAwsRDSClusterInstanceRead(d, meta) -} - -func resourceAwsRDSClusterInstanceDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).rdsconn - - log.Printf("[DEBUG] RDS Cluster Instance destroy: %v", d.Id()) - - opts := rds.DeleteDBInstanceInput{DBInstanceIdentifier: aws.String(d.Id())} - - log.Printf("[DEBUG] RDS Cluster Instance destroy configuration: %s", opts) - if _, err := conn.DeleteDBInstance(&opts); err != nil { - return err - } - - // re-uses db_instance refresh func - log.Println("[INFO] Waiting for RDS Cluster Instance to be destroyed") - stateConf := &resource.StateChangeConf{ - Pending: []string{"modifying", "deleting"}, - Target: []string{}, - Refresh: resourceAwsDbInstanceStateRefreshFunc(d, meta), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - } - - if _, err := stateConf.WaitForState(); err != nil { - return err - } - - return nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster_parameter_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster_parameter_group.go deleted file mode 100644 index 62b0d49..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_rds_cluster_parameter_group.go +++ /dev/null @@ -1,275 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/rds" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRDSClusterParameterGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRDSClusterParameterGroupCreate, - Read: resourceAwsRDSClusterParameterGroupRead, - Update: resourceAwsRDSClusterParameterGroupUpdate, - Delete: resourceAwsRDSClusterParameterGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - ValidateFunc: validateDbParamGroupName, - }, - "family": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - "parameter": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: false, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "apply_method": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "immediate", - // this parameter is not actually state, but a - // meta-parameter describing how the RDS API call - // to modify the parameter group should be made. - // Future reads of the resource from AWS don't tell - // us what we used for apply_method previously, so - // by squashing state to an empty string we avoid - // needing to do an update for every future run. - StateFunc: func(interface{}) string { return "" }, - }, - }, - }, - Set: resourceAwsDbParameterHash, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsRDSClusterParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) - - createOpts := rds.CreateDBClusterParameterGroupInput{ - DBClusterParameterGroupName: aws.String(d.Get("name").(string)), - DBParameterGroupFamily: aws.String(d.Get("family").(string)), - Description: aws.String(d.Get("description").(string)), - Tags: tags, - } - - log.Printf("[DEBUG] Create DB Cluster Parameter Group: %#v", createOpts) - _, err := rdsconn.CreateDBClusterParameterGroup(&createOpts) - if err != nil { - return fmt.Errorf("Error creating DB Cluster Parameter Group: %s", err) - } - - d.SetId(*createOpts.DBClusterParameterGroupName) - log.Printf("[INFO] DB Cluster Parameter Group ID: %s", d.Id()) - - return resourceAwsRDSClusterParameterGroupUpdate(d, meta) -} - -func resourceAwsRDSClusterParameterGroupRead(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - - describeOpts := rds.DescribeDBClusterParameterGroupsInput{ - DBClusterParameterGroupName: aws.String(d.Id()), - } - - describeResp, err := rdsconn.DescribeDBClusterParameterGroups(&describeOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "DBParameterGroupNotFound" { - log.Printf("[WARN] DB Cluster Parameter Group (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - if len(describeResp.DBClusterParameterGroups) != 1 || - *describeResp.DBClusterParameterGroups[0].DBClusterParameterGroupName != d.Id() { - return fmt.Errorf("Unable to find Cluster Parameter Group: %#v", describeResp.DBClusterParameterGroups) - } - - d.Set("name", describeResp.DBClusterParameterGroups[0].DBClusterParameterGroupName) - d.Set("family", describeResp.DBClusterParameterGroups[0].DBParameterGroupFamily) - d.Set("description", describeResp.DBClusterParameterGroups[0].Description) - - // Only include user customized parameters as there's hundreds of system/default ones - describeParametersOpts := rds.DescribeDBClusterParametersInput{ - DBClusterParameterGroupName: aws.String(d.Id()), - Source: aws.String("user"), - } - - describeParametersResp, err := rdsconn.DescribeDBClusterParameters(&describeParametersOpts) - if err != nil { - return err - } - - d.Set("parameter", flattenParameters(describeParametersResp.Parameters)) - - paramGroup := describeResp.DBClusterParameterGroups[0] - arn, err := buildRDSCPGARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if err != nil { - name := "" - if paramGroup.DBClusterParameterGroupName != nil && *paramGroup.DBClusterParameterGroupName != "" { - name = *paramGroup.DBClusterParameterGroupName - } - log.Printf("[DEBUG] Error building ARN for DB Cluster Parameter Group, not setting Tags for Cluster Param Group %s", name) - } else { - d.Set("arn", arn) - resp, err := rdsconn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) - } - - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - d.Set("tags", tagsToMapRDS(dt)) - } - - return nil -} - -func resourceAwsRDSClusterParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error { - rdsconn := meta.(*AWSClient).rdsconn - - d.Partial(true) - - if d.HasChange("parameter") { - o, n := d.GetChange("parameter") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - // Expand the "parameter" set to aws-sdk-go compat []rds.Parameter - parameters, err := expandParameters(ns.Difference(os).List()) - if err != nil { - return err - } - - if len(parameters) > 0 { - modifyOpts := rds.ModifyDBClusterParameterGroupInput{ - DBClusterParameterGroupName: aws.String(d.Get("name").(string)), - Parameters: parameters, - } - - log.Printf("[DEBUG] Modify DB Cluster Parameter Group: %s", modifyOpts) - _, err = rdsconn.ModifyDBClusterParameterGroup(&modifyOpts) - if err != nil { - return fmt.Errorf("Error modifying DB Cluster Parameter Group: %s", err) - } - } - d.SetPartial("parameter") - } - - if arn, err := buildRDSCPGARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region); err == nil { - if err := setTagsRDS(rdsconn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - - d.Partial(false) - - return resourceAwsRDSClusterParameterGroupRead(d, meta) -} - -func resourceAwsRDSClusterParameterGroupDelete(d *schema.ResourceData, meta interface{}) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"destroyed"}, - Refresh: resourceAwsRDSClusterParameterGroupDeleteRefreshFunc(d, meta), - Timeout: 3 * time.Minute, - MinTimeout: 1 * time.Second, - } - _, err := stateConf.WaitForState() - return err -} - -func resourceAwsRDSClusterParameterGroupDeleteRefreshFunc( - d *schema.ResourceData, - meta interface{}) resource.StateRefreshFunc { - rdsconn := meta.(*AWSClient).rdsconn - - return func() (interface{}, string, error) { - - deleteOpts := rds.DeleteDBClusterParameterGroupInput{ - DBClusterParameterGroupName: aws.String(d.Id()), - } - - if _, err := rdsconn.DeleteDBClusterParameterGroup(&deleteOpts); err != nil { - rdserr, ok := err.(awserr.Error) - if !ok { - return d, "error", err - } - - if rdserr.Code() != "DBParameterGroupNotFound" { - return d, "error", err - } - } - - return d, "destroyed", nil - } -} - -func buildRDSCPGARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct RDS Cluster ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct RDS Cluster ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:rds:%s:%s:cluster-pg:%s", partition, region, accountid, identifier) - return arn, nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_cluster.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_cluster.go deleted file mode 100644 index 5119fb8..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_cluster.go +++ /dev/null @@ -1,954 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRedshiftCluster() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRedshiftClusterCreate, - Read: resourceAwsRedshiftClusterRead, - Update: resourceAwsRedshiftClusterUpdate, - Delete: resourceAwsRedshiftClusterDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsRedshiftClusterImport, - }, - - Schema: map[string]*schema.Schema{ - "database_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateRedshiftClusterDbName, - }, - - "cluster_identifier": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateRedshiftClusterIdentifier, - }, - "cluster_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "node_type": { - Type: schema.TypeString, - Required: true, - }, - - "master_username": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateRedshiftClusterMasterUsername, - }, - - "master_password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - ValidateFunc: validateRedshiftClusterMasterPassword, - }, - - "cluster_security_groups": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "vpc_security_group_ids": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "cluster_subnet_group_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "preferred_maintenance_window": { - Type: schema.TypeString, - Optional: true, - Computed: true, - StateFunc: func(val interface{}) string { - if val == nil { - return "" - } - return strings.ToLower(val.(string)) - }, - ValidateFunc: validateOnceAWeekWindowFormat, - }, - - "cluster_parameter_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "automated_snapshot_retention_period": { - Type: schema.TypeInt, - Optional: true, - Default: 1, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(int) - if value > 35 { - es = append(es, fmt.Errorf( - "backup retention period cannot be more than 35 days")) - } - return - }, - }, - - "port": { - Type: schema.TypeInt, - Optional: true, - Default: 5439, - }, - - "cluster_version": { - Type: schema.TypeString, - Optional: true, - Default: "1.0", - }, - - "allow_version_upgrade": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "number_of_nodes": { - Type: schema.TypeInt, - Optional: true, - Default: 1, - }, - - "publicly_accessible": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "encrypted": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "enhanced_vpc_routing": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "kms_key_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - - "elastic_ip": { - Type: schema.TypeString, - Optional: true, - }, - - "final_snapshot_identifier": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateRedshiftClusterFinalSnapshotIdentifier, - }, - - "skip_final_snapshot": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "endpoint": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "cluster_public_key": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "cluster_revision_number": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "iam_roles": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "enable_logging": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "bucket_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "s3_key_prefix": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "snapshot_identifier": { - Type: schema.TypeString, - Optional: true, - }, - - "snapshot_cluster_identifier": { - Type: schema.TypeString, - Optional: true, - }, - - "owner_account": { - Type: schema.TypeString, - Optional: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsRedshiftClusterImport( - d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - // Neither skip_final_snapshot nor final_snapshot_identifier can be fetched - // from any API call, so we need to default skip_final_snapshot to true so - // that final_snapshot_identifier is not required - d.Set("skip_final_snapshot", true) - return []*schema.ResourceData{d}, nil -} - -func resourceAwsRedshiftClusterCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - tags := tagsFromMapRedshift(d.Get("tags").(map[string]interface{})) - - if v, ok := d.GetOk("snapshot_identifier"); ok { - restoreOpts := &redshift.RestoreFromClusterSnapshotInput{ - ClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)), - SnapshotIdentifier: aws.String(v.(string)), - Port: aws.Int64(int64(d.Get("port").(int))), - AllowVersionUpgrade: aws.Bool(d.Get("allow_version_upgrade").(bool)), - NodeType: aws.String(d.Get("node_type").(string)), - PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), - AutomatedSnapshotRetentionPeriod: aws.Int64(int64(d.Get("automated_snapshot_retention_period").(int))), - } - - if v, ok := d.GetOk("owner_account"); ok { - restoreOpts.OwnerAccount = aws.String(v.(string)) - } - - if v, ok := d.GetOk("snapshot_cluster_identifier"); ok { - restoreOpts.SnapshotClusterIdentifier = aws.String(v.(string)) - } - - if v, ok := d.GetOk("availability_zone"); ok { - restoreOpts.AvailabilityZone = aws.String(v.(string)) - } - - if v, ok := d.GetOk("cluster_subnet_group_name"); ok { - restoreOpts.ClusterSubnetGroupName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("cluster_parameter_group_name"); ok { - restoreOpts.ClusterParameterGroupName = aws.String(v.(string)) - } - - if v := d.Get("cluster_security_groups").(*schema.Set); v.Len() > 0 { - restoreOpts.ClusterSecurityGroups = expandStringList(v.List()) - } - - if v := d.Get("vpc_security_group_ids").(*schema.Set); v.Len() > 0 { - restoreOpts.VpcSecurityGroupIds = expandStringList(v.List()) - } - - if v, ok := d.GetOk("preferred_maintenance_window"); ok { - restoreOpts.PreferredMaintenanceWindow = aws.String(v.(string)) - } - - if v, ok := d.GetOk("kms_key_id"); ok { - restoreOpts.KmsKeyId = aws.String(v.(string)) - } - - if v, ok := d.GetOk("elastic_ip"); ok { - restoreOpts.ElasticIp = aws.String(v.(string)) - } - - if v, ok := d.GetOk("enhanced_vpc_routing"); ok { - restoreOpts.EnhancedVpcRouting = aws.Bool(v.(bool)) - } - - if v, ok := d.GetOk("iam_roles"); ok { - restoreOpts.IamRoles = expandStringList(v.(*schema.Set).List()) - } - - log.Printf("[DEBUG] Redshift Cluster restore cluster options: %s", restoreOpts) - - resp, err := conn.RestoreFromClusterSnapshot(restoreOpts) - if err != nil { - log.Printf("[ERROR] Error Restoring Redshift Cluster from Snapshot: %s", err) - return err - } - - d.SetId(*resp.Cluster.ClusterIdentifier) - - } else { - if _, ok := d.GetOk("master_password"); !ok { - return fmt.Errorf(`provider.aws: aws_redshift_cluster: %s: "master_password": required field is not set`, d.Get("cluster_identifier").(string)) - } - - if _, ok := d.GetOk("master_username"); !ok { - return fmt.Errorf(`provider.aws: aws_redshift_cluster: %s: "master_username": required field is not set`, d.Get("cluster_identifier").(string)) - } - - createOpts := &redshift.CreateClusterInput{ - ClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)), - Port: aws.Int64(int64(d.Get("port").(int))), - MasterUserPassword: aws.String(d.Get("master_password").(string)), - MasterUsername: aws.String(d.Get("master_username").(string)), - ClusterVersion: aws.String(d.Get("cluster_version").(string)), - NodeType: aws.String(d.Get("node_type").(string)), - DBName: aws.String(d.Get("database_name").(string)), - AllowVersionUpgrade: aws.Bool(d.Get("allow_version_upgrade").(bool)), - PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), - AutomatedSnapshotRetentionPeriod: aws.Int64(int64(d.Get("automated_snapshot_retention_period").(int))), - Tags: tags, - } - - if v := d.Get("number_of_nodes").(int); v > 1 { - createOpts.ClusterType = aws.String("multi-node") - createOpts.NumberOfNodes = aws.Int64(int64(d.Get("number_of_nodes").(int))) - } else { - createOpts.ClusterType = aws.String("single-node") - } - - if v := d.Get("cluster_security_groups").(*schema.Set); v.Len() > 0 { - createOpts.ClusterSecurityGroups = expandStringList(v.List()) - } - - if v := d.Get("vpc_security_group_ids").(*schema.Set); v.Len() > 0 { - createOpts.VpcSecurityGroupIds = expandStringList(v.List()) - } - - if v, ok := d.GetOk("cluster_subnet_group_name"); ok { - createOpts.ClusterSubnetGroupName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("availability_zone"); ok { - createOpts.AvailabilityZone = aws.String(v.(string)) - } - - if v, ok := d.GetOk("preferred_maintenance_window"); ok { - createOpts.PreferredMaintenanceWindow = aws.String(v.(string)) - } - - if v, ok := d.GetOk("cluster_parameter_group_name"); ok { - createOpts.ClusterParameterGroupName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("encrypted"); ok { - createOpts.Encrypted = aws.Bool(v.(bool)) - } - - if v, ok := d.GetOk("enhanced_vpc_routing"); ok { - createOpts.EnhancedVpcRouting = aws.Bool(v.(bool)) - } - - if v, ok := d.GetOk("kms_key_id"); ok { - createOpts.KmsKeyId = aws.String(v.(string)) - } - - if v, ok := d.GetOk("elastic_ip"); ok { - createOpts.ElasticIp = aws.String(v.(string)) - } - - if v, ok := d.GetOk("iam_roles"); ok { - createOpts.IamRoles = expandStringList(v.(*schema.Set).List()) - } - - log.Printf("[DEBUG] Redshift Cluster create options: %s", createOpts) - resp, err := conn.CreateCluster(createOpts) - if err != nil { - log.Printf("[ERROR] Error creating Redshift Cluster: %s", err) - return err - } - - log.Printf("[DEBUG]: Cluster create response: %s", resp) - d.SetId(*resp.Cluster.ClusterIdentifier) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying", "restoring"}, - Target: []string{"available"}, - Refresh: resourceAwsRedshiftClusterStateRefreshFunc(d, meta), - Timeout: 75 * time.Minute, - MinTimeout: 10 * time.Second, - } - - _, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf("[WARN] Error waiting for Redshift Cluster state to be \"available\": %s", err) - } - - if _, ok := d.GetOk("enable_logging"); ok { - - loggingErr := enableRedshiftClusterLogging(d, conn) - if loggingErr != nil { - log.Printf("[ERROR] Error Enabling Logging on Redshift Cluster: %s", err) - return loggingErr - } - - } - - return resourceAwsRedshiftClusterRead(d, meta) -} - -func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - log.Printf("[INFO] Reading Redshift Cluster Information: %s", d.Id()) - resp, err := conn.DescribeClusters(&redshift.DescribeClustersInput{ - ClusterIdentifier: aws.String(d.Id()), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if "ClusterNotFound" == awsErr.Code() { - d.SetId("") - log.Printf("[DEBUG] Redshift Cluster (%s) not found", d.Id()) - return nil - } - } - log.Printf("[DEBUG] Error describing Redshift Cluster (%s)", d.Id()) - return err - } - - var rsc *redshift.Cluster - for _, c := range resp.Clusters { - if *c.ClusterIdentifier == d.Id() { - rsc = c - } - } - - if rsc == nil { - log.Printf("[WARN] Redshift Cluster (%s) not found", d.Id()) - d.SetId("") - return nil - } - - log.Printf("[INFO] Reading Redshift Cluster Logging Status: %s", d.Id()) - loggingStatus, loggingErr := conn.DescribeLoggingStatus(&redshift.DescribeLoggingStatusInput{ - ClusterIdentifier: aws.String(d.Id()), - }) - - if loggingErr != nil { - return loggingErr - } - - d.Set("master_username", rsc.MasterUsername) - d.Set("node_type", rsc.NodeType) - d.Set("allow_version_upgrade", rsc.AllowVersionUpgrade) - d.Set("database_name", rsc.DBName) - d.Set("cluster_identifier", rsc.ClusterIdentifier) - d.Set("cluster_version", rsc.ClusterVersion) - - d.Set("cluster_subnet_group_name", rsc.ClusterSubnetGroupName) - d.Set("availability_zone", rsc.AvailabilityZone) - d.Set("encrypted", rsc.Encrypted) - d.Set("enhanced_vpc_routing", rsc.EnhancedVpcRouting) - d.Set("kms_key_id", rsc.KmsKeyId) - d.Set("automated_snapshot_retention_period", rsc.AutomatedSnapshotRetentionPeriod) - d.Set("preferred_maintenance_window", rsc.PreferredMaintenanceWindow) - if rsc.Endpoint != nil && rsc.Endpoint.Address != nil { - endpoint := *rsc.Endpoint.Address - if rsc.Endpoint.Port != nil { - endpoint = fmt.Sprintf("%s:%d", endpoint, *rsc.Endpoint.Port) - } - d.Set("port", rsc.Endpoint.Port) - d.Set("endpoint", endpoint) - } - d.Set("cluster_parameter_group_name", rsc.ClusterParameterGroups[0].ParameterGroupName) - if len(rsc.ClusterNodes) > 1 { - d.Set("cluster_type", "multi-node") - } else { - d.Set("cluster_type", "single-node") - } - d.Set("number_of_nodes", rsc.NumberOfNodes) - d.Set("publicly_accessible", rsc.PubliclyAccessible) - - var vpcg []string - for _, g := range rsc.VpcSecurityGroups { - vpcg = append(vpcg, *g.VpcSecurityGroupId) - } - if err := d.Set("vpc_security_group_ids", vpcg); err != nil { - return fmt.Errorf("[DEBUG] Error saving VPC Security Group IDs to state for Redshift Cluster (%s): %s", d.Id(), err) - } - - var csg []string - for _, g := range rsc.ClusterSecurityGroups { - csg = append(csg, *g.ClusterSecurityGroupName) - } - if err := d.Set("cluster_security_groups", csg); err != nil { - return fmt.Errorf("[DEBUG] Error saving Cluster Security Group Names to state for Redshift Cluster (%s): %s", d.Id(), err) - } - - var iamRoles []string - for _, i := range rsc.IamRoles { - iamRoles = append(iamRoles, *i.IamRoleArn) - } - if err := d.Set("iam_roles", iamRoles); err != nil { - return fmt.Errorf("[DEBUG] Error saving IAM Roles to state for Redshift Cluster (%s): %s", d.Id(), err) - } - - d.Set("cluster_public_key", rsc.ClusterPublicKey) - d.Set("cluster_revision_number", rsc.ClusterRevisionNumber) - d.Set("tags", tagsToMapRedshift(rsc.Tags)) - - d.Set("bucket_name", loggingStatus.BucketName) - d.Set("enable_logging", loggingStatus.LoggingEnabled) - d.Set("s3_key_prefix", loggingStatus.S3KeyPrefix) - - return nil -} - -func resourceAwsRedshiftClusterUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - d.Partial(true) - - arn, tagErr := buildRedshiftARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if tagErr != nil { - return fmt.Errorf("Error building ARN for Redshift Cluster, not updating Tags for cluster %s", d.Id()) - } else { - if tagErr := setTagsRedshift(conn, d, arn); tagErr != nil { - return tagErr - } else { - d.SetPartial("tags") - } - } - - requestUpdate := false - log.Printf("[INFO] Building Redshift Modify Cluster Options") - req := &redshift.ModifyClusterInput{ - ClusterIdentifier: aws.String(d.Id()), - } - - if d.HasChange("cluster_type") { - req.ClusterType = aws.String(d.Get("cluster_type").(string)) - requestUpdate = true - } - - if d.HasChange("node_type") { - req.NodeType = aws.String(d.Get("node_type").(string)) - requestUpdate = true - } - - if d.HasChange("number_of_nodes") { - if v := d.Get("number_of_nodes").(int); v > 1 { - req.ClusterType = aws.String("multi-node") - req.NumberOfNodes = aws.Int64(int64(d.Get("number_of_nodes").(int))) - } else { - req.ClusterType = aws.String("single-node") - } - - req.NodeType = aws.String(d.Get("node_type").(string)) - requestUpdate = true - } - - if d.HasChange("cluster_security_groups") { - req.ClusterSecurityGroups = expandStringList(d.Get("cluster_security_groups").(*schema.Set).List()) - requestUpdate = true - } - - if d.HasChange("vpc_security_group_ids") { - req.VpcSecurityGroupIds = expandStringList(d.Get("vpc_security_group_ids").(*schema.Set).List()) - requestUpdate = true - } - - if d.HasChange("master_password") { - req.MasterUserPassword = aws.String(d.Get("master_password").(string)) - requestUpdate = true - } - - if d.HasChange("cluster_parameter_group_name") { - req.ClusterParameterGroupName = aws.String(d.Get("cluster_parameter_group_name").(string)) - requestUpdate = true - } - - if d.HasChange("automated_snapshot_retention_period") { - req.AutomatedSnapshotRetentionPeriod = aws.Int64(int64(d.Get("automated_snapshot_retention_period").(int))) - requestUpdate = true - } - - if d.HasChange("preferred_maintenance_window") { - req.PreferredMaintenanceWindow = aws.String(d.Get("preferred_maintenance_window").(string)) - requestUpdate = true - } - - if d.HasChange("cluster_version") { - req.ClusterVersion = aws.String(d.Get("cluster_version").(string)) - requestUpdate = true - } - - if d.HasChange("allow_version_upgrade") { - req.AllowVersionUpgrade = aws.Bool(d.Get("allow_version_upgrade").(bool)) - requestUpdate = true - } - - if d.HasChange("publicly_accessible") { - req.PubliclyAccessible = aws.Bool(d.Get("publicly_accessible").(bool)) - requestUpdate = true - } - - if d.HasChange("enhanced_vpc_routing") { - req.EnhancedVpcRouting = aws.Bool(d.Get("enhanced_vpc_routing").(bool)) - requestUpdate = true - } - - if requestUpdate { - log.Printf("[INFO] Modifying Redshift Cluster: %s", d.Id()) - log.Printf("[DEBUG] Redshift Cluster Modify options: %s", req) - _, err := conn.ModifyCluster(req) - if err != nil { - return fmt.Errorf("[WARN] Error modifying Redshift Cluster (%s): %s", d.Id(), err) - } - } - - if d.HasChange("iam_roles") { - o, n := d.GetChange("iam_roles") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - removeIams := os.Difference(ns).List() - addIams := ns.Difference(os).List() - - log.Printf("[INFO] Building Redshift Modify Cluster IAM Role Options") - req := &redshift.ModifyClusterIamRolesInput{ - ClusterIdentifier: aws.String(d.Id()), - AddIamRoles: expandStringList(addIams), - RemoveIamRoles: expandStringList(removeIams), - } - - log.Printf("[INFO] Modifying Redshift Cluster IAM Roles: %s", d.Id()) - log.Printf("[DEBUG] Redshift Cluster Modify IAM Role options: %s", req) - _, err := conn.ModifyClusterIamRoles(req) - if err != nil { - return fmt.Errorf("[WARN] Error modifying Redshift Cluster IAM Roles (%s): %s", d.Id(), err) - } - - d.SetPartial("iam_roles") - } - - if requestUpdate || d.HasChange("iam_roles") { - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "deleting", "rebooting", "resizing", "renaming", "modifying"}, - Target: []string{"available"}, - Refresh: resourceAwsRedshiftClusterStateRefreshFunc(d, meta), - Timeout: 40 * time.Minute, - MinTimeout: 10 * time.Second, - } - - // Wait, catching any errors - _, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf("[WARN] Error Modifying Redshift Cluster (%s): %s", d.Id(), err) - } - } - - if d.HasChange("enable_logging") || d.HasChange("bucket_name") || d.HasChange("s3_key_prefix") { - var loggingErr error - if _, ok := d.GetOk("enable_logging"); ok { - - log.Printf("[INFO] Enabling Logging for Redshift Cluster %q", d.Id()) - loggingErr = enableRedshiftClusterLogging(d, conn) - if loggingErr != nil { - return loggingErr - } - } else { - - log.Printf("[INFO] Disabling Logging for Redshift Cluster %q", d.Id()) - _, loggingErr = conn.DisableLogging(&redshift.DisableLoggingInput{ - ClusterIdentifier: aws.String(d.Id()), - }) - if loggingErr != nil { - return loggingErr - } - } - - d.SetPartial("enable_logging") - } - - d.Partial(false) - - return resourceAwsRedshiftClusterRead(d, meta) -} - -func enableRedshiftClusterLogging(d *schema.ResourceData, conn *redshift.Redshift) error { - if _, ok := d.GetOk("bucket_name"); !ok { - return fmt.Errorf("bucket_name must be set when enabling logging for Redshift Clusters") - } - - params := &redshift.EnableLoggingInput{ - ClusterIdentifier: aws.String(d.Id()), - BucketName: aws.String(d.Get("bucket_name").(string)), - } - - if v, ok := d.GetOk("s3_key_prefix"); ok { - params.S3KeyPrefix = aws.String(v.(string)) - } - - _, loggingErr := conn.EnableLogging(params) - if loggingErr != nil { - log.Printf("[ERROR] Error Enabling Logging on Redshift Cluster: %s", loggingErr) - return loggingErr - } - return nil -} - -func resourceAwsRedshiftClusterDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - log.Printf("[DEBUG] Destroying Redshift Cluster (%s)", d.Id()) - - deleteOpts := redshift.DeleteClusterInput{ - ClusterIdentifier: aws.String(d.Id()), - } - - skipFinalSnapshot := d.Get("skip_final_snapshot").(bool) - deleteOpts.SkipFinalClusterSnapshot = aws.Bool(skipFinalSnapshot) - - if skipFinalSnapshot == false { - if name, present := d.GetOk("final_snapshot_identifier"); present { - deleteOpts.FinalClusterSnapshotIdentifier = aws.String(name.(string)) - } else { - return fmt.Errorf("Redshift Cluster Instance FinalSnapshotIdentifier is required when a final snapshot is required") - } - } - - log.Printf("[DEBUG] Redshift Cluster delete options: %s", deleteOpts) - _, err := conn.DeleteCluster(&deleteOpts) - if err != nil { - return fmt.Errorf("[ERROR] Error deleting Redshift Cluster (%s): %s", d.Id(), err) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"available", "creating", "deleting", "rebooting", "resizing", "renaming", "final-snapshot"}, - Target: []string{"destroyed"}, - Refresh: resourceAwsRedshiftClusterStateRefreshFunc(d, meta), - Timeout: 40 * time.Minute, - MinTimeout: 5 * time.Second, - } - - // Wait, catching any errors - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("[ERROR] Error deleting Redshift Cluster (%s): %s", d.Id(), err) - } - - log.Printf("[INFO] Redshift Cluster %s successfully deleted", d.Id()) - - return nil -} - -func resourceAwsRedshiftClusterStateRefreshFunc(d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - conn := meta.(*AWSClient).redshiftconn - - log.Printf("[INFO] Reading Redshift Cluster Information: %s", d.Id()) - resp, err := conn.DescribeClusters(&redshift.DescribeClustersInput{ - ClusterIdentifier: aws.String(d.Id()), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if "ClusterNotFound" == awsErr.Code() { - return 42, "destroyed", nil - } - } - log.Printf("[WARN] Error on retrieving Redshift Cluster (%s) when waiting: %s", d.Id(), err) - return nil, "", err - } - - var rsc *redshift.Cluster - - for _, c := range resp.Clusters { - if *c.ClusterIdentifier == d.Id() { - rsc = c - } - } - - if rsc == nil { - return 42, "destroyed", nil - } - - if rsc.ClusterStatus != nil { - log.Printf("[DEBUG] Redshift Cluster status (%s): %s", d.Id(), *rsc.ClusterStatus) - } - - return rsc, *rsc.ClusterStatus, nil - } -} - -func validateRedshiftClusterIdentifier(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9a-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters and hyphens allowed in %q", k)) - } - if !regexp.MustCompile(`^[a-z]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot end with a hyphen", k)) - } - return -} - -func validateRedshiftClusterDbName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9a-z_$]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters, underscores, and dollar signs are allowed in %q", k)) - } - if !regexp.MustCompile(`^[a-zA-Z_]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter or underscore", k)) - } - if len(value) > 64 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 64 characters: %q", k, value)) - } - if value == "" { - errors = append(errors, fmt.Errorf( - "%q cannot be an empty string", k)) - } - - return -} - -func validateRedshiftClusterFinalSnapshotIdentifier(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - errors = append(errors, fmt.Errorf("%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf("%q cannot end in a hyphen", k)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf("%q cannot be more than 255 characters", k)) - } - return -} - -func validateRedshiftClusterMasterUsername(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^\w+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters in %q", k)) - } - if !regexp.MustCompile(`^[A-Za-z]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter", k)) - } - if len(value) > 128 { - errors = append(errors, fmt.Errorf("%q cannot be more than 128 characters", k)) - } - return -} - -func validateRedshiftClusterMasterPassword(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^.*[a-z].*`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must contain at least one lowercase letter", k)) - } - if !regexp.MustCompile(`^.*[A-Z].*`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must contain at least one uppercase letter", k)) - } - if !regexp.MustCompile(`^.*[0-9].*`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must contain at least one number", k)) - } - if !regexp.MustCompile(`^[^\@\/'" ]*$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot contain [/@\"' ]", k)) - } - if len(value) < 8 { - errors = append(errors, fmt.Errorf("%q must be at least 8 characters", k)) - } - return -} - -func buildRedshiftARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct cluster ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct cluster ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:redshift:%s:%s:cluster:%s", partition, region, accountid, identifier) - return arn, nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_parameter_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_parameter_group.go deleted file mode 100644 index e94ab8d..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_parameter_group.go +++ /dev/null @@ -1,242 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRedshiftParameterGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRedshiftParameterGroupCreate, - Read: resourceAwsRedshiftParameterGroupRead, - Update: resourceAwsRedshiftParameterGroupUpdate, - Delete: resourceAwsRedshiftParameterGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Required: true, - ValidateFunc: validateRedshiftParamGroupName, - }, - - "family": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - - "parameter": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: false, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: resourceAwsRedshiftParameterHash, - }, - }, - } -} - -func resourceAwsRedshiftParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - createOpts := redshift.CreateClusterParameterGroupInput{ - ParameterGroupName: aws.String(d.Get("name").(string)), - ParameterGroupFamily: aws.String(d.Get("family").(string)), - Description: aws.String(d.Get("description").(string)), - } - - log.Printf("[DEBUG] Create Redshift Parameter Group: %#v", createOpts) - _, err := conn.CreateClusterParameterGroup(&createOpts) - if err != nil { - return fmt.Errorf("Error creating Redshift Parameter Group: %s", err) - } - - d.SetId(*createOpts.ParameterGroupName) - log.Printf("[INFO] Redshift Parameter Group ID: %s", d.Id()) - - return resourceAwsRedshiftParameterGroupUpdate(d, meta) -} - -func resourceAwsRedshiftParameterGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - describeOpts := redshift.DescribeClusterParameterGroupsInput{ - ParameterGroupName: aws.String(d.Id()), - } - - describeResp, err := conn.DescribeClusterParameterGroups(&describeOpts) - if err != nil { - return err - } - - if len(describeResp.ParameterGroups) != 1 || - *describeResp.ParameterGroups[0].ParameterGroupName != d.Id() { - d.SetId("") - return fmt.Errorf("Unable to find Parameter Group: %#v", describeResp.ParameterGroups) - } - - d.Set("name", describeResp.ParameterGroups[0].ParameterGroupName) - d.Set("family", describeResp.ParameterGroups[0].ParameterGroupFamily) - d.Set("description", describeResp.ParameterGroups[0].Description) - - describeParametersOpts := redshift.DescribeClusterParametersInput{ - ParameterGroupName: aws.String(d.Id()), - Source: aws.String("user"), - } - - describeParametersResp, err := conn.DescribeClusterParameters(&describeParametersOpts) - if err != nil { - return err - } - - d.Set("parameter", flattenRedshiftParameters(describeParametersResp.Parameters)) - return nil -} - -func resourceAwsRedshiftParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - d.Partial(true) - - if d.HasChange("parameter") { - o, n := d.GetChange("parameter") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - // Expand the "parameter" set to aws-sdk-go compat []redshift.Parameter - parameters, err := expandRedshiftParameters(ns.Difference(os).List()) - if err != nil { - return err - } - - if len(parameters) > 0 { - modifyOpts := redshift.ModifyClusterParameterGroupInput{ - ParameterGroupName: aws.String(d.Get("name").(string)), - Parameters: parameters, - } - - log.Printf("[DEBUG] Modify Redshift Parameter Group: %s", modifyOpts) - _, err = conn.ModifyClusterParameterGroup(&modifyOpts) - if err != nil { - return fmt.Errorf("Error modifying Redshift Parameter Group: %s", err) - } - } - d.SetPartial("parameter") - } - - d.Partial(false) - return resourceAwsRedshiftParameterGroupRead(d, meta) -} - -func resourceAwsRedshiftParameterGroupDelete(d *schema.ResourceData, meta interface{}) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"destroyed"}, - Refresh: resourceAwsRedshiftParameterGroupDeleteRefreshFunc(d, meta), - Timeout: 3 * time.Minute, - MinTimeout: 1 * time.Second, - } - _, err := stateConf.WaitForState() - return err -} - -func resourceAwsRedshiftParameterGroupDeleteRefreshFunc( - d *schema.ResourceData, - meta interface{}) resource.StateRefreshFunc { - conn := meta.(*AWSClient).redshiftconn - - return func() (interface{}, string, error) { - - deleteOpts := redshift.DeleteClusterParameterGroupInput{ - ParameterGroupName: aws.String(d.Id()), - } - - if _, err := conn.DeleteClusterParameterGroup(&deleteOpts); err != nil { - redshiftErr, ok := err.(awserr.Error) - if !ok { - return d, "error", err - } - - if redshiftErr.Code() != "RedshiftParameterGroupNotFoundFault" { - return d, "error", err - } - } - - return d, "destroyed", nil - } -} - -func resourceAwsRedshiftParameterHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - // Store the value as a lower case string, to match how we store them in flattenParameters - buf.WriteString(fmt.Sprintf("%s-", strings.ToLower(m["value"].(string)))) - - return hashcode.String(buf.String()) -} - -func validateRedshiftParamGroupName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9a-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters and hyphens allowed in %q", k)) - } - if !regexp.MustCompile(`^[a-z]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot end with a hyphen", k)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be greater than 255 characters", k)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_security_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_security_group.go deleted file mode 100644 index 24a45bf..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_security_group.go +++ /dev/null @@ -1,400 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRedshiftSecurityGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRedshiftSecurityGroupCreate, - Read: resourceAwsRedshiftSecurityGroupRead, - Update: resourceAwsRedshiftSecurityGroupUpdate, - Delete: resourceAwsRedshiftSecurityGroupDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsRedshiftClusterImport, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateRedshiftSecurityGroupName, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - - "ingress": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cidr": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "security_group_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "security_group_owner_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - }, - Set: resourceAwsRedshiftSecurityGroupIngressHash, - }, - }, - } -} - -func resourceAwsRedshiftSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - var err error - var errs []error - - name := d.Get("name").(string) - desc := d.Get("description").(string) - sgInput := &redshift.CreateClusterSecurityGroupInput{ - ClusterSecurityGroupName: aws.String(name), - Description: aws.String(desc), - } - log.Printf("[DEBUG] Redshift security group create: name: %s, description: %s", name, desc) - _, err = conn.CreateClusterSecurityGroup(sgInput) - if err != nil { - return fmt.Errorf("Error creating RedshiftSecurityGroup: %s", err) - } - - d.SetId(d.Get("name").(string)) - - log.Printf("[INFO] Redshift Security Group ID: %s", d.Id()) - sg, err := resourceAwsRedshiftSecurityGroupRetrieve(d, meta) - if err != nil { - return err - } - - ingresses := d.Get("ingress").(*schema.Set) - for _, ing := range ingresses.List() { - err := resourceAwsRedshiftSecurityGroupAuthorizeRule(ing, *sg.ClusterSecurityGroupName, conn) - if err != nil { - errs = append(errs, err) - } - } - - if len(errs) > 0 { - return &multierror.Error{Errors: errs} - } - - log.Println("[INFO] Waiting for Redshift Security Group Ingress Authorizations to be authorized") - stateConf := &resource.StateChangeConf{ - Pending: []string{"authorizing"}, - Target: []string{"authorized"}, - Refresh: resourceAwsRedshiftSecurityGroupStateRefreshFunc(d, meta), - Timeout: 10 * time.Minute, - } - - _, err = stateConf.WaitForState() - if err != nil { - return err - } - - return resourceAwsRedshiftSecurityGroupRead(d, meta) -} - -func resourceAwsRedshiftSecurityGroupRead(d *schema.ResourceData, meta interface{}) error { - sg, err := resourceAwsRedshiftSecurityGroupRetrieve(d, meta) - if err != nil { - return err - } - - rules := &schema.Set{ - F: resourceAwsRedshiftSecurityGroupIngressHash, - } - - for _, v := range sg.IPRanges { - rule := map[string]interface{}{"cidr": *v.CIDRIP} - rules.Add(rule) - } - - for _, g := range sg.EC2SecurityGroups { - rule := map[string]interface{}{ - "security_group_name": *g.EC2SecurityGroupName, - "security_group_owner_id": *g.EC2SecurityGroupOwnerId, - } - rules.Add(rule) - } - - d.Set("ingress", rules) - d.Set("name", *sg.ClusterSecurityGroupName) - d.Set("description", *sg.Description) - - return nil -} - -func resourceAwsRedshiftSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - if d.HasChange("ingress") { - o, n := d.GetChange("ingress") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - removeIngressRules, err := expandRedshiftSGRevokeIngress(os.Difference(ns).List()) - if err != nil { - return err - } - if len(removeIngressRules) > 0 { - for _, r := range removeIngressRules { - r.ClusterSecurityGroupName = aws.String(d.Id()) - - _, err := conn.RevokeClusterSecurityGroupIngress(&r) - if err != nil { - return err - } - } - } - - addIngressRules, err := expandRedshiftSGAuthorizeIngress(ns.Difference(os).List()) - if err != nil { - return err - } - if len(addIngressRules) > 0 { - for _, r := range addIngressRules { - r.ClusterSecurityGroupName = aws.String(d.Id()) - - _, err := conn.AuthorizeClusterSecurityGroupIngress(&r) - if err != nil { - return err - } - } - } - - } - return resourceAwsRedshiftSecurityGroupRead(d, meta) -} - -func resourceAwsRedshiftSecurityGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - log.Printf("[DEBUG] Redshift Security Group destroy: %v", d.Id()) - opts := redshift.DeleteClusterSecurityGroupInput{ - ClusterSecurityGroupName: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Redshift Security Group destroy configuration: %v", opts) - _, err := conn.DeleteClusterSecurityGroup(&opts) - - if err != nil { - newerr, ok := err.(awserr.Error) - if ok && newerr.Code() == "InvalidRedshiftSecurityGroup.NotFound" { - return nil - } - return err - } - - return nil -} - -func resourceAwsRedshiftSecurityGroupRetrieve(d *schema.ResourceData, meta interface{}) (*redshift.ClusterSecurityGroup, error) { - conn := meta.(*AWSClient).redshiftconn - - opts := redshift.DescribeClusterSecurityGroupsInput{ - ClusterSecurityGroupName: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Redshift Security Group describe configuration: %#v", opts) - - resp, err := conn.DescribeClusterSecurityGroups(&opts) - - if err != nil { - return nil, fmt.Errorf("Error retrieving Redshift Security Groups: %s", err) - } - - if len(resp.ClusterSecurityGroups) != 1 || - *resp.ClusterSecurityGroups[0].ClusterSecurityGroupName != d.Id() { - return nil, fmt.Errorf("Unable to find Redshift Security Group: %#v", resp.ClusterSecurityGroups) - } - - return resp.ClusterSecurityGroups[0], nil -} - -func validateRedshiftSecurityGroupName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value == "default" { - errors = append(errors, fmt.Errorf("the Redshift Security Group name cannot be %q", value)) - } - if !regexp.MustCompile(`^[0-9a-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters and hyphens allowed in %q: %q", - k, value)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 32 characters: %q", k, value)) - } - return - -} - -func resourceAwsRedshiftSecurityGroupIngressHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - if v, ok := m["cidr"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_name"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_owner_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - return hashcode.String(buf.String()) -} - -func resourceAwsRedshiftSecurityGroupAuthorizeRule(ingress interface{}, redshiftSecurityGroupName string, conn *redshift.Redshift) error { - ing := ingress.(map[string]interface{}) - - opts := redshift.AuthorizeClusterSecurityGroupIngressInput{ - ClusterSecurityGroupName: aws.String(redshiftSecurityGroupName), - } - - if attr, ok := ing["cidr"]; ok && attr != "" { - opts.CIDRIP = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_name"]; ok && attr != "" { - opts.EC2SecurityGroupName = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_owner_id"]; ok && attr != "" { - opts.EC2SecurityGroupOwnerId = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] Authorize ingress rule configuration: %#v", opts) - _, err := conn.AuthorizeClusterSecurityGroupIngress(&opts) - - if err != nil { - return fmt.Errorf("Error authorizing security group ingress: %s", err) - } - - return nil -} - -func resourceAwsRedshiftSecurityGroupStateRefreshFunc( - d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - v, err := resourceAwsRedshiftSecurityGroupRetrieve(d, meta) - - if err != nil { - log.Printf("Error on retrieving Redshift Security Group when waiting: %s", err) - return nil, "", err - } - - statuses := make([]string, 0, len(v.EC2SecurityGroups)+len(v.IPRanges)) - for _, ec2g := range v.EC2SecurityGroups { - statuses = append(statuses, *ec2g.Status) - } - for _, ips := range v.IPRanges { - statuses = append(statuses, *ips.Status) - } - - for _, stat := range statuses { - // Not done - if stat != "authorized" { - return nil, "authorizing", nil - } - } - - return v, "authorized", nil - } -} - -func expandRedshiftSGAuthorizeIngress(configured []interface{}) ([]redshift.AuthorizeClusterSecurityGroupIngressInput, error) { - var ingress []redshift.AuthorizeClusterSecurityGroupIngressInput - - // Loop over our configured parameters and create - // an array of aws-sdk-go compatible objects - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - - i := redshift.AuthorizeClusterSecurityGroupIngressInput{} - - if v, ok := data["cidr"]; ok { - i.CIDRIP = aws.String(v.(string)) - } - - if v, ok := data["security_group_name"]; ok { - i.EC2SecurityGroupName = aws.String(v.(string)) - } - - if v, ok := data["security_group_owner_id"]; ok { - i.EC2SecurityGroupOwnerId = aws.String(v.(string)) - } - - ingress = append(ingress, i) - } - - return ingress, nil -} - -func expandRedshiftSGRevokeIngress(configured []interface{}) ([]redshift.RevokeClusterSecurityGroupIngressInput, error) { - var ingress []redshift.RevokeClusterSecurityGroupIngressInput - - // Loop over our configured parameters and create - // an array of aws-sdk-go compatible objects - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - - i := redshift.RevokeClusterSecurityGroupIngressInput{} - - if v, ok := data["cidr"]; ok { - i.CIDRIP = aws.String(v.(string)) - } - - if v, ok := data["security_group_name"]; ok { - i.EC2SecurityGroupName = aws.String(v.(string)) - } - - if v, ok := data["security_group_owner_id"]; ok { - i.EC2SecurityGroupOwnerId = aws.String(v.(string)) - } - - ingress = append(ingress, i) - } - - return ingress, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_subnet_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_subnet_group.go deleted file mode 100644 index 118abff..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_redshift_subnet_group.go +++ /dev/null @@ -1,220 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRedshiftSubnetGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRedshiftSubnetGroupCreate, - Read: resourceAwsRedshiftSubnetGroupRead, - Update: resourceAwsRedshiftSubnetGroupUpdate, - Delete: resourceAwsRedshiftSubnetGroupDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - ValidateFunc: validateRedshiftSubnetGroupName, - }, - - "description": { - Type: schema.TypeString, - Optional: true, - Default: "Managed by Terraform", - }, - - "subnet_ids": { - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsRedshiftSubnetGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - subnetIdsSet := d.Get("subnet_ids").(*schema.Set) - subnetIds := make([]*string, subnetIdsSet.Len()) - for i, subnetId := range subnetIdsSet.List() { - subnetIds[i] = aws.String(subnetId.(string)) - } - tags := tagsFromMapRedshift(d.Get("tags").(map[string]interface{})) - - createOpts := redshift.CreateClusterSubnetGroupInput{ - ClusterSubnetGroupName: aws.String(d.Get("name").(string)), - Description: aws.String(d.Get("description").(string)), - SubnetIds: subnetIds, - Tags: tags, - } - - log.Printf("[DEBUG] Create Redshift Subnet Group: %#v", createOpts) - _, err := conn.CreateClusterSubnetGroup(&createOpts) - if err != nil { - return fmt.Errorf("Error creating Redshift Subnet Group: %s", err) - } - - d.SetId(*createOpts.ClusterSubnetGroupName) - log.Printf("[INFO] Redshift Subnet Group ID: %s", d.Id()) - return resourceAwsRedshiftSubnetGroupRead(d, meta) -} - -func resourceAwsRedshiftSubnetGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - describeOpts := redshift.DescribeClusterSubnetGroupsInput{ - ClusterSubnetGroupName: aws.String(d.Id()), - } - - describeResp, err := conn.DescribeClusterSubnetGroups(&describeOpts) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "ClusterSubnetGroupNotFoundFault" { - log.Printf("[INFO] Redshift Subnet Group: %s was not found", d.Id()) - d.SetId("") - return nil - } - return err - } - - if len(describeResp.ClusterSubnetGroups) == 0 { - return fmt.Errorf("Unable to find Redshift Subnet Group: %#v", describeResp.ClusterSubnetGroups) - } - - d.Set("name", d.Id()) - d.Set("description", describeResp.ClusterSubnetGroups[0].Description) - d.Set("subnet_ids", subnetIdsToSlice(describeResp.ClusterSubnetGroups[0].Subnets)) - if err := d.Set("tags", tagsToMapRedshift(describeResp.ClusterSubnetGroups[0].Tags)); err != nil { - return fmt.Errorf("[DEBUG] Error setting Redshift Subnet Group Tags: %#v", err) - } - - return nil -} - -func resourceAwsRedshiftSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).redshiftconn - - arn, tagErr := buildRedshiftSubnetGroupARN(d.Id(), meta.(*AWSClient).partition, meta.(*AWSClient).accountid, meta.(*AWSClient).region) - if tagErr != nil { - return fmt.Errorf("Error building ARN for Redshift Subnet Group, not updating Tags for Subnet Group %s", d.Id()) - } else { - if tagErr := setTagsRedshift(conn, d, arn); tagErr != nil { - return tagErr - } - } - - if d.HasChange("subnet_ids") || d.HasChange("description") { - _, n := d.GetChange("subnet_ids") - if n == nil { - n = new(schema.Set) - } - ns := n.(*schema.Set) - - var sIds []*string - for _, s := range ns.List() { - sIds = append(sIds, aws.String(s.(string))) - } - - _, err := conn.ModifyClusterSubnetGroup(&redshift.ModifyClusterSubnetGroupInput{ - ClusterSubnetGroupName: aws.String(d.Id()), - Description: aws.String(d.Get("description").(string)), - SubnetIds: sIds, - }) - - if err != nil { - return err - } - } - - return nil -} - -func resourceAwsRedshiftSubnetGroupDelete(d *schema.ResourceData, meta interface{}) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"destroyed"}, - Refresh: resourceAwsRedshiftSubnetGroupDeleteRefreshFunc(d, meta), - Timeout: 3 * time.Minute, - MinTimeout: 1 * time.Second, - } - _, err := stateConf.WaitForState() - return err -} - -func resourceAwsRedshiftSubnetGroupDeleteRefreshFunc(d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - conn := meta.(*AWSClient).redshiftconn - - return func() (interface{}, string, error) { - - deleteOpts := redshift.DeleteClusterSubnetGroupInput{ - ClusterSubnetGroupName: aws.String(d.Id()), - } - - if _, err := conn.DeleteClusterSubnetGroup(&deleteOpts); err != nil { - redshiftErr, ok := err.(awserr.Error) - if !ok { - return d, "error", err - } - - if redshiftErr.Code() != "ClusterSubnetGroupNotFoundFault" { - return d, "error", err - } - } - - return d, "destroyed", nil - } -} - -func subnetIdsToSlice(subnetIds []*redshift.Subnet) []string { - subnetsSlice := make([]string, 0, len(subnetIds)) - for _, s := range subnetIds { - subnetsSlice = append(subnetsSlice, *s.SubnetIdentifier) - } - return subnetsSlice -} - -func validateRedshiftSubnetGroupName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9a-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters and hyphens allowed in %q", k)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters", k)) - } - if regexp.MustCompile(`(?i)^default$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q is not allowed as %q", "Default", k)) - } - return -} - -func buildRedshiftSubnetGroupARN(identifier, partition, accountid, region string) (string, error) { - if partition == "" { - return "", fmt.Errorf("Unable to construct Subnet Group ARN because of missing AWS partition") - } - if accountid == "" { - return "", fmt.Errorf("Unable to construct Subnet Group ARN because of missing AWS Account ID") - } - arn := fmt.Sprintf("arn:%s:redshift:%s:%s:subnetgroup:%s", partition, region, accountid, identifier) - return arn, nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route.go deleted file mode 100644 index b33dfe3..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route.go +++ /dev/null @@ -1,490 +0,0 @@ -package aws - -import ( - "errors" - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -// How long to sleep if a limit-exceeded event happens -var routeTargetValidationError = errors.New("Error: more than 1 target specified. Only 1 of gateway_id, " + - "egress_only_gateway_id, nat_gateway_id, instance_id, network_interface_id, route_table_id or " + - "vpc_peering_connection_id is allowed.") - -// AWS Route resource Schema declaration -func resourceAwsRoute() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRouteCreate, - Read: resourceAwsRouteRead, - Update: resourceAwsRouteUpdate, - Delete: resourceAwsRouteDelete, - Exists: resourceAwsRouteExists, - - Schema: map[string]*schema.Schema{ - "destination_cidr_block": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "destination_ipv6_cidr_block": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "destination_prefix_list_id": { - Type: schema.TypeString, - Computed: true, - }, - - "gateway_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "egress_only_gateway_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "nat_gateway_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "instance_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "instance_owner_id": { - Type: schema.TypeString, - Computed: true, - }, - - "network_interface_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "origin": { - Type: schema.TypeString, - Computed: true, - }, - - "state": { - Type: schema.TypeString, - Computed: true, - }, - - "route_table_id": { - Type: schema.TypeString, - Required: true, - }, - - "vpc_peering_connection_id": { - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - var numTargets int - var setTarget string - allowedTargets := []string{ - "egress_only_gateway_id", - "gateway_id", - "nat_gateway_id", - "instance_id", - "network_interface_id", - "vpc_peering_connection_id", - } - - // Check if more than 1 target is specified - for _, target := range allowedTargets { - if len(d.Get(target).(string)) > 0 { - numTargets++ - setTarget = target - } - } - - if numTargets > 1 { - return routeTargetValidationError - } - - createOpts := &ec2.CreateRouteInput{} - // Formulate CreateRouteInput based on the target type - switch setTarget { - case "gateway_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - GatewayId: aws.String(d.Get("gateway_id").(string)), - } - case "egress_only_gateway_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationIpv6CidrBlock: aws.String(d.Get("destination_ipv6_cidr_block").(string)), - EgressOnlyInternetGatewayId: aws.String(d.Get("egress_only_gateway_id").(string)), - } - case "nat_gateway_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - NatGatewayId: aws.String(d.Get("nat_gateway_id").(string)), - } - case "instance_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - InstanceId: aws.String(d.Get("instance_id").(string)), - } - case "network_interface_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - NetworkInterfaceId: aws.String(d.Get("network_interface_id").(string)), - } - case "vpc_peering_connection_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - VpcPeeringConnectionId: aws.String(d.Get("vpc_peering_connection_id").(string)), - } - default: - return fmt.Errorf("An invalid target type specified: %s", setTarget) - } - log.Printf("[DEBUG] Route create config: %s", createOpts) - - // Create the route - var err error - - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - _, err = conn.CreateRoute(createOpts) - - if err != nil { - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - if ec2err.Code() == "InvalidParameterException" { - log.Printf("[DEBUG] Trying to create route again: %q", ec2err.Message()) - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - } - - return nil - }) - if err != nil { - return fmt.Errorf("Error creating route: %s", err) - } - - var route *ec2.Route - - if v, ok := d.GetOk("destination_cidr_block"); ok { - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - route, err = findResourceRoute(conn, d.Get("route_table_id").(string), v.(string), "") - return resource.RetryableError(err) - }) - if err != nil { - return fmt.Errorf("Error finding route after creating it: %s", err) - } - } - - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - route, err = findResourceRoute(conn, d.Get("route_table_id").(string), "", v.(string)) - return resource.RetryableError(err) - }) - if err != nil { - return fmt.Errorf("Error finding route after creating it: %s", err) - } - } - - d.SetId(routeIDHash(d, route)) - resourceAwsRouteSetResourceData(d, route) - return nil -} - -func resourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - routeTableId := d.Get("route_table_id").(string) - - destinationCidrBlock := d.Get("destination_cidr_block").(string) - destinationIpv6CidrBlock := d.Get("destination_ipv6_cidr_block").(string) - - route, err := findResourceRoute(conn, routeTableId, destinationCidrBlock, destinationIpv6CidrBlock) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidRouteTableID.NotFound" { - log.Printf("[WARN] Route Table %q could not be found. Removing Route from state.", - routeTableId) - d.SetId("") - return nil - } - return err - } - resourceAwsRouteSetResourceData(d, route) - return nil -} - -func resourceAwsRouteSetResourceData(d *schema.ResourceData, route *ec2.Route) { - d.Set("destination_prefix_list_id", route.DestinationPrefixListId) - d.Set("gateway_id", route.GatewayId) - d.Set("egress_only_gateway_id", route.EgressOnlyInternetGatewayId) - d.Set("nat_gateway_id", route.NatGatewayId) - d.Set("instance_id", route.InstanceId) - d.Set("instance_owner_id", route.InstanceOwnerId) - d.Set("network_interface_id", route.NetworkInterfaceId) - d.Set("origin", route.Origin) - d.Set("state", route.State) - d.Set("vpc_peering_connection_id", route.VpcPeeringConnectionId) -} - -func resourceAwsRouteUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - var numTargets int - var setTarget string - - allowedTargets := []string{ - "egress_only_gateway_id", - "gateway_id", - "nat_gateway_id", - "network_interface_id", - "instance_id", - "vpc_peering_connection_id", - } - replaceOpts := &ec2.ReplaceRouteInput{} - - // Check if more than 1 target is specified - for _, target := range allowedTargets { - if len(d.Get(target).(string)) > 0 { - numTargets++ - setTarget = target - } - } - - switch setTarget { - //instance_id is a special case due to the fact that AWS will "discover" the network_interace_id - //when it creates the route and return that data. In the case of an update, we should ignore the - //existing network_interface_id - case "instance_id": - if numTargets > 2 || (numTargets == 2 && len(d.Get("network_interface_id").(string)) == 0) { - return routeTargetValidationError - } - default: - if numTargets > 1 { - return routeTargetValidationError - } - } - - // Formulate ReplaceRouteInput based on the target type - switch setTarget { - case "gateway_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - GatewayId: aws.String(d.Get("gateway_id").(string)), - } - case "egress_only_gateway_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationIpv6CidrBlock: aws.String(d.Get("destination_ipv6_cidr_block").(string)), - EgressOnlyInternetGatewayId: aws.String(d.Get("egress_only_gateway_id").(string)), - } - case "nat_gateway_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - NatGatewayId: aws.String(d.Get("nat_gateway_id").(string)), - } - case "instance_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - InstanceId: aws.String(d.Get("instance_id").(string)), - } - case "network_interface_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - NetworkInterfaceId: aws.String(d.Get("network_interface_id").(string)), - } - case "vpc_peering_connection_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - VpcPeeringConnectionId: aws.String(d.Get("vpc_peering_connection_id").(string)), - } - default: - return fmt.Errorf("An invalid target type specified: %s", setTarget) - } - log.Printf("[DEBUG] Route replace config: %s", replaceOpts) - - // Replace the route - _, err := conn.ReplaceRoute(replaceOpts) - if err != nil { - return err - } - - return nil -} - -func resourceAwsRouteDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - deleteOpts := &ec2.DeleteRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - } - if v, ok := d.GetOk("destination_cidr_block"); ok { - deleteOpts.DestinationCidrBlock = aws.String(v.(string)) - } - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - deleteOpts.DestinationIpv6CidrBlock = aws.String(v.(string)) - } - log.Printf("[DEBUG] Route delete opts: %s", deleteOpts) - - var err error - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Trying to delete route with opts %s", deleteOpts) - resp, err := conn.DeleteRoute(deleteOpts) - log.Printf("[DEBUG] Route delete result: %s", resp) - - if err == nil { - return nil - } - - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - if ec2err.Code() == "InvalidParameterException" { - log.Printf("[DEBUG] Trying to delete route again: %q", - ec2err.Message()) - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - }) - - if err != nil { - return err - } - - d.SetId("") - return nil -} - -func resourceAwsRouteExists(d *schema.ResourceData, meta interface{}) (bool, error) { - conn := meta.(*AWSClient).ec2conn - routeTableId := d.Get("route_table_id").(string) - - findOpts := &ec2.DescribeRouteTablesInput{ - RouteTableIds: []*string{&routeTableId}, - } - - res, err := conn.DescribeRouteTables(findOpts) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidRouteTableID.NotFound" { - log.Printf("[WARN] Route Table %q could not be found.", routeTableId) - return false, nil - } - return false, fmt.Errorf("Error while checking if route exists: %s", err) - } - - if len(res.RouteTables) < 1 || res.RouteTables[0] == nil { - log.Printf("[WARN] Route Table %q is gone, or route does not exist.", - routeTableId) - return false, nil - } - - if v, ok := d.GetOk("destination_cidr_block"); ok { - for _, route := range (*res.RouteTables[0]).Routes { - if route.DestinationCidrBlock != nil && *route.DestinationCidrBlock == v.(string) { - return true, nil - } - } - } - - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - for _, route := range (*res.RouteTables[0]).Routes { - if route.DestinationIpv6CidrBlock != nil && *route.DestinationIpv6CidrBlock == v.(string) { - return true, nil - } - } - } - - return false, nil -} - -// Create an ID for a route -func routeIDHash(d *schema.ResourceData, r *ec2.Route) string { - - if r.DestinationIpv6CidrBlock != nil && *r.DestinationIpv6CidrBlock != "" { - return fmt.Sprintf("r-%s%d", d.Get("route_table_id").(string), hashcode.String(*r.DestinationIpv6CidrBlock)) - } - - return fmt.Sprintf("r-%s%d", d.Get("route_table_id").(string), hashcode.String(*r.DestinationCidrBlock)) -} - -// Helper: retrieve a route -func findResourceRoute(conn *ec2.EC2, rtbid string, cidr string, ipv6cidr string) (*ec2.Route, error) { - routeTableID := rtbid - - findOpts := &ec2.DescribeRouteTablesInput{ - RouteTableIds: []*string{&routeTableID}, - } - - resp, err := conn.DescribeRouteTables(findOpts) - if err != nil { - return nil, err - } - - if len(resp.RouteTables) < 1 || resp.RouteTables[0] == nil { - return nil, fmt.Errorf("Route Table %q is gone, or route does not exist.", - routeTableID) - } - - if cidr != "" { - for _, route := range (*resp.RouteTables[0]).Routes { - if route.DestinationCidrBlock != nil && *route.DestinationCidrBlock == cidr { - return route, nil - } - } - - return nil, fmt.Errorf("Unable to find matching route for Route Table (%s) "+ - "and destination CIDR block (%s).", rtbid, cidr) - } - - if ipv6cidr != "" { - for _, route := range (*resp.RouteTables[0]).Routes { - if route.DestinationIpv6CidrBlock != nil && *route.DestinationIpv6CidrBlock == ipv6cidr { - return route, nil - } - } - - return nil, fmt.Errorf("Unable to find matching route for Route Table (%s) "+ - "and destination IPv6 CIDR block (%s).", rtbid, ipv6cidr) - } - - return nil, fmt.Errorf("When trying to find a matching route for Route Table %q "+ - "you need to specify a CIDR block of IPv6 CIDR Block", rtbid) - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_delegation_set.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_delegation_set.go deleted file mode 100644 index 34f96dd..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_delegation_set.go +++ /dev/null @@ -1,111 +0,0 @@ -package aws - -import ( - "log" - "sort" - "strings" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" -) - -func resourceAwsRoute53DelegationSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRoute53DelegationSetCreate, - Read: resourceAwsRoute53DelegationSetRead, - Delete: resourceAwsRoute53DelegationSetDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "reference_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "name_servers": &schema.Schema{ - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, - }, - }, - } -} - -func resourceAwsRoute53DelegationSetCreate(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - - callerRef := resource.UniqueId() - if v, ok := d.GetOk("reference_name"); ok { - callerRef = strings.Join([]string{ - v.(string), "-", callerRef, - }, "") - } - input := &route53.CreateReusableDelegationSetInput{ - CallerReference: aws.String(callerRef), - } - - log.Printf("[DEBUG] Creating Route53 reusable delegation set: %#v", input) - out, err := r53.CreateReusableDelegationSet(input) - if err != nil { - return err - } - log.Printf("[DEBUG] Route53 reusable delegation set created: %#v", out) - - set := out.DelegationSet - d.SetId(cleanDelegationSetId(*set.Id)) - d.Set("name_servers", expandNameServers(set.NameServers)) - return nil -} - -func resourceAwsRoute53DelegationSetRead(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - - input := &route53.GetReusableDelegationSetInput{ - Id: aws.String(cleanDelegationSetId(d.Id())), - } - log.Printf("[DEBUG] Reading Route53 reusable delegation set: %#v", input) - out, err := r53.GetReusableDelegationSet(input) - if err != nil { - return err - } - log.Printf("[DEBUG] Route53 reusable delegation set received: %#v", out) - - set := out.DelegationSet - - d.SetId(cleanDelegationSetId(*set.Id)) - d.Set("name_servers", expandNameServers(set.NameServers)) - - return nil -} - -func resourceAwsRoute53DelegationSetDelete(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - - input := &route53.DeleteReusableDelegationSetInput{ - Id: aws.String(cleanDelegationSetId(d.Id())), - } - log.Printf("[DEBUG] Deleting Route53 reusable delegation set: %#v", input) - _, err := r53.DeleteReusableDelegationSet(input) - return err -} - -func expandNameServers(name_servers []*string) []string { - log.Printf("[DEBUG] Processing %d name servers: %#v...", len(name_servers), name_servers) - ns := make([]string, len(name_servers)) - for i, server := range name_servers { - ns[i] = *server - } - sort.Strings(ns) - log.Printf("[DEBUG] Returning processed name servers: %#v", ns) - return ns -} - -func cleanDelegationSetId(id string) string { - return strings.TrimPrefix(id, "/delegationset/") -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_health_check.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_health_check.go deleted file mode 100644 index 6cf4ee2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_health_check.go +++ /dev/null @@ -1,379 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/route53" -) - -func resourceAwsRoute53HealthCheck() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRoute53HealthCheckCreate, - Read: resourceAwsRoute53HealthCheckRead, - Update: resourceAwsRoute53HealthCheckUpdate, - Delete: resourceAwsRoute53HealthCheckDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: func(val interface{}) string { - return strings.ToUpper(val.(string)) - }, - }, - "failure_threshold": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "request_interval": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ForceNew: true, // todo this should be updateable but the awslabs route53 service doesnt have the ability - }, - "ip_address": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "fqdn": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "port": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - - "invert_healthcheck": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - }, - - "resource_path": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "search_string": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "measure_latency": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - - "child_healthchecks": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Set: schema.HashString, - }, - "child_health_threshold": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(int) - if value > 256 { - es = append(es, fmt.Errorf( - "Child HealthThreshold cannot be more than 256")) - } - return - }, - }, - - "cloudwatch_alarm_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "cloudwatch_alarm_region": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "insufficient_data_health_status": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "reference_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "enable_sni": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsRoute53HealthCheckUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).r53conn - - updateHealthCheck := &route53.UpdateHealthCheckInput{ - HealthCheckId: aws.String(d.Id()), - } - - if d.HasChange("failure_threshold") { - updateHealthCheck.FailureThreshold = aws.Int64(int64(d.Get("failure_threshold").(int))) - } - - if d.HasChange("fqdn") { - updateHealthCheck.FullyQualifiedDomainName = aws.String(d.Get("fqdn").(string)) - } - - if d.HasChange("port") { - updateHealthCheck.Port = aws.Int64(int64(d.Get("port").(int))) - } - - if d.HasChange("resource_path") { - updateHealthCheck.ResourcePath = aws.String(d.Get("resource_path").(string)) - } - - if d.HasChange("invert_healthcheck") { - updateHealthCheck.Inverted = aws.Bool(d.Get("invert_healthcheck").(bool)) - } - - if d.HasChange("child_healthchecks") { - updateHealthCheck.ChildHealthChecks = expandStringList(d.Get("child_healthchecks").(*schema.Set).List()) - - } - if d.HasChange("child_health_threshold") { - updateHealthCheck.HealthThreshold = aws.Int64(int64(d.Get("child_health_threshold").(int))) - } - - if d.HasChange("search_string") { - updateHealthCheck.SearchString = aws.String(d.Get("search_string").(string)) - } - - if d.HasChange("cloudwatch_alarm_name") || d.HasChange("cloudwatch_alarm_region") { - cloudwatchAlarm := &route53.AlarmIdentifier{ - Name: aws.String(d.Get("cloudwatch_alarm_name").(string)), - Region: aws.String(d.Get("cloudwatch_alarm_region").(string)), - } - - updateHealthCheck.AlarmIdentifier = cloudwatchAlarm - } - - if d.HasChange("insufficient_data_health_status") { - updateHealthCheck.InsufficientDataHealthStatus = aws.String(d.Get("insufficient_data_health_status").(string)) - } - - if d.HasChange("enable_sni") { - updateHealthCheck.EnableSNI = aws.Bool(d.Get("enable_sni").(bool)) - } - - _, err := conn.UpdateHealthCheck(updateHealthCheck) - if err != nil { - return err - } - - if err := setTagsR53(conn, d, "healthcheck"); err != nil { - return err - } - - return resourceAwsRoute53HealthCheckRead(d, meta) -} - -func resourceAwsRoute53HealthCheckCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).r53conn - - healthConfig := &route53.HealthCheckConfig{ - Type: aws.String(d.Get("type").(string)), - } - - if v, ok := d.GetOk("request_interval"); ok { - healthConfig.RequestInterval = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("failure_threshold"); ok { - healthConfig.FailureThreshold = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("fqdn"); ok { - healthConfig.FullyQualifiedDomainName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("search_string"); ok { - healthConfig.SearchString = aws.String(v.(string)) - } - - if v, ok := d.GetOk("ip_address"); ok { - healthConfig.IPAddress = aws.String(v.(string)) - } - - if v, ok := d.GetOk("port"); ok { - healthConfig.Port = aws.Int64(int64(v.(int))) - } - - if v, ok := d.GetOk("resource_path"); ok { - healthConfig.ResourcePath = aws.String(v.(string)) - } - - if *healthConfig.Type != route53.HealthCheckTypeCalculated && *healthConfig.Type != route53.HealthCheckTypeCloudwatchMetric { - if v, ok := d.GetOk("measure_latency"); ok { - healthConfig.MeasureLatency = aws.Bool(v.(bool)) - } - } - - if v, ok := d.GetOk("invert_healthcheck"); ok { - healthConfig.Inverted = aws.Bool(v.(bool)) - } - - if v, ok := d.GetOk("enable_sni"); ok { - healthConfig.EnableSNI = aws.Bool(v.(bool)) - } - - if *healthConfig.Type == route53.HealthCheckTypeCalculated { - if v, ok := d.GetOk("child_healthchecks"); ok { - healthConfig.ChildHealthChecks = expandStringList(v.(*schema.Set).List()) - } - - if v, ok := d.GetOk("child_health_threshold"); ok { - healthConfig.HealthThreshold = aws.Int64(int64(v.(int))) - } - } - - if *healthConfig.Type == route53.HealthCheckTypeCloudwatchMetric { - cloudwatchAlarmIdentifier := &route53.AlarmIdentifier{} - - if v, ok := d.GetOk("cloudwatch_alarm_name"); ok { - cloudwatchAlarmIdentifier.Name = aws.String(v.(string)) - } - - if v, ok := d.GetOk("cloudwatch_alarm_region"); ok { - cloudwatchAlarmIdentifier.Region = aws.String(v.(string)) - } - - healthConfig.AlarmIdentifier = cloudwatchAlarmIdentifier - - if v, ok := d.GetOk("insufficient_data_health_status"); ok { - healthConfig.InsufficientDataHealthStatus = aws.String(v.(string)) - } - } - - callerRef := resource.UniqueId() - if v, ok := d.GetOk("reference_name"); ok { - callerRef = fmt.Sprintf("%s-%s", v.(string), callerRef) - } - - input := &route53.CreateHealthCheckInput{ - CallerReference: aws.String(callerRef), - HealthCheckConfig: healthConfig, - } - - resp, err := conn.CreateHealthCheck(input) - - if err != nil { - return err - } - - d.SetId(*resp.HealthCheck.Id) - - if err := setTagsR53(conn, d, "healthcheck"); err != nil { - return err - } - - return resourceAwsRoute53HealthCheckRead(d, meta) -} - -func resourceAwsRoute53HealthCheckRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).r53conn - - read, err := conn.GetHealthCheck(&route53.GetHealthCheckInput{HealthCheckId: aws.String(d.Id())}) - if err != nil { - if r53err, ok := err.(awserr.Error); ok && r53err.Code() == "NoSuchHealthCheck" { - d.SetId("") - return nil - - } - return err - } - - if read == nil { - return nil - } - - updated := read.HealthCheck.HealthCheckConfig - d.Set("type", updated.Type) - d.Set("failure_threshold", updated.FailureThreshold) - d.Set("request_interval", updated.RequestInterval) - d.Set("fqdn", updated.FullyQualifiedDomainName) - d.Set("search_string", updated.SearchString) - d.Set("ip_address", updated.IPAddress) - d.Set("port", updated.Port) - d.Set("resource_path", updated.ResourcePath) - d.Set("measure_latency", updated.MeasureLatency) - d.Set("invert_healthcheck", updated.Inverted) - d.Set("child_healthchecks", updated.ChildHealthChecks) - d.Set("child_health_threshold", updated.HealthThreshold) - d.Set("insufficient_data_health_status", updated.InsufficientDataHealthStatus) - d.Set("enable_sni", updated.EnableSNI) - - if updated.AlarmIdentifier != nil { - d.Set("cloudwatch_alarm_name", updated.AlarmIdentifier.Name) - d.Set("cloudwatch_alarm_region", updated.AlarmIdentifier.Region) - } - - // read the tags - req := &route53.ListTagsForResourceInput{ - ResourceId: aws.String(d.Id()), - ResourceType: aws.String("healthcheck"), - } - - resp, err := conn.ListTagsForResource(req) - if err != nil { - return err - } - - var tags []*route53.Tag - if resp.ResourceTagSet != nil { - tags = resp.ResourceTagSet.Tags - } - - if err := d.Set("tags", tagsToMapR53(tags)); err != nil { - return err - } - - return nil -} - -func resourceAwsRoute53HealthCheckDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).r53conn - - log.Printf("[DEBUG] Deleteing Route53 health check: %s", d.Id()) - _, err := conn.DeleteHealthCheck(&route53.DeleteHealthCheckInput{HealthCheckId: aws.String(d.Id())}) - if err != nil { - return err - } - - return nil -} - -func createChildHealthCheckList(s *schema.Set) (nl []*string) { - l := s.List() - for _, n := range l { - nl = append(nl, aws.String(n.(string))) - } - - return nl -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_record.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_record.go deleted file mode 100644 index 8739141..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_record.go +++ /dev/null @@ -1,877 +0,0 @@ -package aws - -import ( - "bytes" - "errors" - "fmt" - "log" - "strings" - "time" - - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/route53" -) - -var r53NoRecordsFound = errors.New("No matching Hosted Zone found") -var r53NoHostedZoneFound = errors.New("No matching records found") - -func resourceAwsRoute53Record() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRoute53RecordCreate, - Read: resourceAwsRoute53RecordRead, - Update: resourceAwsRoute53RecordUpdate, - Delete: resourceAwsRoute53RecordDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - SchemaVersion: 2, - MigrateState: resourceAwsRoute53RecordMigrateState, - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: func(v interface{}) string { - value := strings.TrimSuffix(v.(string), ".") - return strings.ToLower(value) - }, - }, - - "fqdn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateRoute53RecordType, - }, - - "zone_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(string) - if value == "" { - es = append(es, fmt.Errorf("Cannot have empty zone_id")) - } - return - }, - }, - - "ttl": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ConflictsWith: []string{"alias"}, - }, - - "weight": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Removed: "Now implemented as weighted_routing_policy; Please see https://www.terraform.io/docs/providers/aws/r/route53_record.html", - }, - - "set_identifier": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "alias": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ConflictsWith: []string{"records", "ttl"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "zone_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - StateFunc: normalizeAwsAliasName, - }, - - "evaluate_target_health": &schema.Schema{ - Type: schema.TypeBool, - Required: true, - }, - }, - }, - Set: resourceAwsRoute53AliasRecordHash, - }, - - "failover": &schema.Schema{ // PRIMARY | SECONDARY - Type: schema.TypeString, - Optional: true, - Removed: "Now implemented as failover_routing_policy; see docs", - }, - - "failover_routing_policy": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ConflictsWith: []string{ - "geolocation_routing_policy", - "latency_routing_policy", - "weighted_routing_policy", - }, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(string) - if value != "PRIMARY" && value != "SECONDARY" { - es = append(es, fmt.Errorf("Failover policy type must be PRIMARY or SECONDARY")) - } - return - }, - }, - }, - }, - }, - - "latency_routing_policy": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ConflictsWith: []string{ - "failover_routing_policy", - "geolocation_routing_policy", - "weighted_routing_policy", - }, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - - "geolocation_routing_policy": &schema.Schema{ // AWS Geolocation - Type: schema.TypeList, - Optional: true, - ConflictsWith: []string{ - "failover_routing_policy", - "latency_routing_policy", - "weighted_routing_policy", - }, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "continent": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "country": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "subdivision": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - - "weighted_routing_policy": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ConflictsWith: []string{ - "failover_routing_policy", - "geolocation_routing_policy", - "latency_routing_policy", - }, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "weight": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - }, - }, - }, - - "health_check_id": &schema.Schema{ // ID of health check - Type: schema.TypeString, - Optional: true, - }, - - "records": &schema.Schema{ - Type: schema.TypeSet, - ConflictsWith: []string{"alias"}, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Set: schema.HashString, - }, - }, - } -} - -func resourceAwsRoute53RecordUpdate(d *schema.ResourceData, meta interface{}) error { - // Route 53 supports CREATE, DELETE, and UPSERT actions. We use UPSERT, and - // AWS dynamically determines if a record should be created or updated. - // Amazon Route 53 can update an existing resource record set only when all - // of the following values match: Name, Type and SetIdentifier - // See http://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html - - if !d.HasChange("type") && !d.HasChange("set_identifier") { - // If neither type nor set_identifier changed we use UPSERT, - // for resouce update here we simply fall through to - // our resource create function. - return resourceAwsRoute53RecordCreate(d, meta) - } - - // Otherwise we delete the existing record and create a new record within - // a transactional change - conn := meta.(*AWSClient).r53conn - zone := cleanZoneID(d.Get("zone_id").(string)) - - var err error - zoneRecord, err := conn.GetHostedZone(&route53.GetHostedZoneInput{Id: aws.String(zone)}) - if err != nil { - return err - } - if zoneRecord.HostedZone == nil { - return fmt.Errorf("[WARN] No Route53 Zone found for id (%s)", zone) - } - - // Build the to be deleted record - en := expandRecordName(d.Get("name").(string), *zoneRecord.HostedZone.Name) - typeo, _ := d.GetChange("type") - - oldRec := &route53.ResourceRecordSet{ - Name: aws.String(en), - Type: aws.String(typeo.(string)), - } - - if v, _ := d.GetChange("ttl"); v.(int) != 0 { - oldRec.TTL = aws.Int64(int64(v.(int))) - } - - // Resource records - if v, _ := d.GetChange("records"); v != nil { - recs := v.(*schema.Set).List() - if len(recs) > 0 { - oldRec.ResourceRecords = expandResourceRecords(recs, typeo.(string)) - } - } - - // Alias record - if v, _ := d.GetChange("alias"); v != nil { - aliases := v.(*schema.Set).List() - if len(aliases) == 1 { - alias := aliases[0].(map[string]interface{}) - oldRec.AliasTarget = &route53.AliasTarget{ - DNSName: aws.String(alias["name"].(string)), - EvaluateTargetHealth: aws.Bool(alias["evaluate_target_health"].(bool)), - HostedZoneId: aws.String(alias["zone_id"].(string)), - } - } - } - - if v, _ := d.GetChange("set_identifier"); v.(string) != "" { - oldRec.SetIdentifier = aws.String(v.(string)) - } - - // Build the to be created record - rec, err := resourceAwsRoute53RecordBuildSet(d, *zoneRecord.HostedZone.Name) - if err != nil { - return err - } - - // Delete the old and create the new records in a single batch. We abuse - // StateChangeConf for this to retry for us since Route53 sometimes returns - // errors about another operation happening at the same time. - changeBatch := &route53.ChangeBatch{ - Comment: aws.String("Managed by Terraform"), - Changes: []*route53.Change{ - &route53.Change{ - Action: aws.String("DELETE"), - ResourceRecordSet: oldRec, - }, - &route53.Change{ - Action: aws.String("CREATE"), - ResourceRecordSet: rec, - }, - }, - } - - req := &route53.ChangeResourceRecordSetsInput{ - HostedZoneId: aws.String(cleanZoneID(*zoneRecord.HostedZone.Id)), - ChangeBatch: changeBatch, - } - - log.Printf("[DEBUG] Updating resource records for zone: %s, name: %s\n\n%s", - zone, *rec.Name, req) - - respRaw, err := changeRoute53RecordSet(conn, req) - if err != nil { - return errwrap.Wrapf("[ERR]: Error building changeset: {{err}}", err) - } - - changeInfo := respRaw.(*route53.ChangeResourceRecordSetsOutput).ChangeInfo - - // Generate an ID - vars := []string{ - zone, - strings.ToLower(d.Get("name").(string)), - d.Get("type").(string), - } - if v, ok := d.GetOk("set_identifier"); ok { - vars = append(vars, v.(string)) - } - - d.SetId(strings.Join(vars, "_")) - - err = waitForRoute53RecordSetToSync(conn, cleanChangeID(*changeInfo.Id)) - if err != nil { - return err - } - - return resourceAwsRoute53RecordRead(d, meta) -} - -func resourceAwsRoute53RecordCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).r53conn - zone := cleanZoneID(d.Get("zone_id").(string)) - - var err error - zoneRecord, err := conn.GetHostedZone(&route53.GetHostedZoneInput{Id: aws.String(zone)}) - if err != nil { - return err - } - if zoneRecord.HostedZone == nil { - return fmt.Errorf("[WARN] No Route53 Zone found for id (%s)", zone) - } - - // Build the record - rec, err := resourceAwsRoute53RecordBuildSet(d, *zoneRecord.HostedZone.Name) - if err != nil { - return err - } - - // Create the new records. We abuse StateChangeConf for this to - // retry for us since Route53 sometimes returns errors about another - // operation happening at the same time. - changeBatch := &route53.ChangeBatch{ - Comment: aws.String("Managed by Terraform"), - Changes: []*route53.Change{ - &route53.Change{ - Action: aws.String("UPSERT"), - ResourceRecordSet: rec, - }, - }, - } - - req := &route53.ChangeResourceRecordSetsInput{ - HostedZoneId: aws.String(cleanZoneID(*zoneRecord.HostedZone.Id)), - ChangeBatch: changeBatch, - } - - log.Printf("[DEBUG] Creating resource records for zone: %s, name: %s\n\n%s", - zone, *rec.Name, req) - - respRaw, err := changeRoute53RecordSet(conn, req) - if err != nil { - return errwrap.Wrapf("[ERR]: Error building changeset: {{err}}", err) - } - - changeInfo := respRaw.(*route53.ChangeResourceRecordSetsOutput).ChangeInfo - - // Generate an ID - vars := []string{ - zone, - strings.ToLower(d.Get("name").(string)), - d.Get("type").(string), - } - if v, ok := d.GetOk("set_identifier"); ok { - vars = append(vars, v.(string)) - } - - d.SetId(strings.Join(vars, "_")) - - err = waitForRoute53RecordSetToSync(conn, cleanChangeID(*changeInfo.Id)) - if err != nil { - return err - } - - return resourceAwsRoute53RecordRead(d, meta) -} - -func changeRoute53RecordSet(conn *route53.Route53, input *route53.ChangeResourceRecordSetsInput) (interface{}, error) { - wait := resource.StateChangeConf{ - Pending: []string{"rejected"}, - Target: []string{"accepted"}, - Timeout: 5 * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := conn.ChangeResourceRecordSets(input) - if err != nil { - if r53err, ok := err.(awserr.Error); ok { - if r53err.Code() == "PriorRequestNotComplete" { - // There is some pending operation, so just retry - // in a bit. - return nil, "rejected", nil - } - } - - return nil, "failure", err - } - - return resp, "accepted", nil - }, - } - - return wait.WaitForState() -} - -func waitForRoute53RecordSetToSync(conn *route53.Route53, requestId string) error { - wait := resource.StateChangeConf{ - Delay: 30 * time.Second, - Pending: []string{"PENDING"}, - Target: []string{"INSYNC"}, - Timeout: 30 * time.Minute, - MinTimeout: 5 * time.Second, - Refresh: func() (result interface{}, state string, err error) { - changeRequest := &route53.GetChangeInput{ - Id: aws.String(requestId), - } - return resourceAwsGoRoute53Wait(conn, changeRequest) - }, - } - _, err := wait.WaitForState() - return err -} - -func resourceAwsRoute53RecordRead(d *schema.ResourceData, meta interface{}) error { - // If we don't have a zone ID we're doing an import. Parse it from the ID. - if _, ok := d.GetOk("zone_id"); !ok { - parts := strings.Split(d.Id(), "_") - - if len(parts) == 1 { - return fmt.Errorf("Error Importing aws_route_53 record. Please make sure the record ID is in the form ZONEID_RECORDNAME_TYPE (i.e. Z4KAPRWWNC7JR_dev_A") - } - - d.Set("zone_id", parts[0]) - d.Set("name", parts[1]) - d.Set("type", parts[2]) - if len(parts) > 3 { - d.Set("set_identifier", parts[3]) - } - - d.Set("weight", -1) - } - - record, err := findRecord(d, meta) - if err != nil { - switch err { - case r53NoHostedZoneFound, r53NoRecordsFound: - log.Printf("[DEBUG] %s for: %s, removing from state file", err, d.Id()) - d.SetId("") - return nil - default: - return err - } - } - - err = d.Set("records", flattenResourceRecords(record.ResourceRecords)) - if err != nil { - return fmt.Errorf("[DEBUG] Error setting records for: %s, error: %#v", d.Id(), err) - } - - if alias := record.AliasTarget; alias != nil { - name := normalizeAwsAliasName(*alias.DNSName) - d.Set("alias", []interface{}{ - map[string]interface{}{ - "zone_id": *alias.HostedZoneId, - "name": name, - "evaluate_target_health": *alias.EvaluateTargetHealth, - }, - }) - } - - d.Set("ttl", record.TTL) - - if record.Failover != nil { - v := []map[string]interface{}{{ - "type": aws.StringValue(record.Failover), - }} - if err := d.Set("failover_routing_policy", v); err != nil { - return fmt.Errorf("[DEBUG] Error setting failover records for: %s, error: %#v", d.Id(), err) - } - } - - if record.GeoLocation != nil { - v := []map[string]interface{}{{ - "continent": aws.StringValue(record.GeoLocation.ContinentCode), - "country": aws.StringValue(record.GeoLocation.CountryCode), - "subdivision": aws.StringValue(record.GeoLocation.SubdivisionCode), - }} - if err := d.Set("geolocation_routing_policy", v); err != nil { - return fmt.Errorf("[DEBUG] Error setting gelocation records for: %s, error: %#v", d.Id(), err) - } - } - - if record.Region != nil { - v := []map[string]interface{}{{ - "region": aws.StringValue(record.Region), - }} - if err := d.Set("latency_routing_policy", v); err != nil { - return fmt.Errorf("[DEBUG] Error setting latency records for: %s, error: %#v", d.Id(), err) - } - } - - if record.Weight != nil { - v := []map[string]interface{}{{ - "weight": aws.Int64Value((record.Weight)), - }} - if err := d.Set("weighted_routing_policy", v); err != nil { - return fmt.Errorf("[DEBUG] Error setting weighted records for: %s, error: %#v", d.Id(), err) - } - } - - d.Set("set_identifier", record.SetIdentifier) - d.Set("health_check_id", record.HealthCheckId) - - return nil -} - -// findRecord takes a ResourceData struct for aws_resource_route53_record. It -// uses the referenced zone_id to query Route53 and find information on it's -// records. -// -// If records are found, it returns the matching -// route53.ResourceRecordSet and nil for the error. -// -// If no hosted zone is found, it returns a nil recordset and r53NoHostedZoneFound -// error. -// -// If no matching recordset is found, it returns nil and a r53NoRecordsFound -// error -// -// If there are other errors, it returns nil a nil recordset and passes on the -// error. -func findRecord(d *schema.ResourceData, meta interface{}) (*route53.ResourceRecordSet, error) { - conn := meta.(*AWSClient).r53conn - // Scan for a - zone := cleanZoneID(d.Get("zone_id").(string)) - - // get expanded name - zoneRecord, err := conn.GetHostedZone(&route53.GetHostedZoneInput{Id: aws.String(zone)}) - if err != nil { - if r53err, ok := err.(awserr.Error); ok && r53err.Code() == "NoSuchHostedZone" { - return nil, r53NoHostedZoneFound - } - return nil, err - } - - en := expandRecordName(d.Get("name").(string), *zoneRecord.HostedZone.Name) - log.Printf("[DEBUG] Expanded record name: %s", en) - d.Set("fqdn", en) - - lopts := &route53.ListResourceRecordSetsInput{ - HostedZoneId: aws.String(cleanZoneID(zone)), - StartRecordName: aws.String(en), - StartRecordType: aws.String(d.Get("type").(string)), - } - - log.Printf("[DEBUG] List resource records sets for zone: %s, opts: %s", - zone, lopts) - resp, err := conn.ListResourceRecordSets(lopts) - if err != nil { - return nil, err - } - - for _, record := range resp.ResourceRecordSets { - name := cleanRecordName(*record.Name) - if FQDN(strings.ToLower(name)) != FQDN(strings.ToLower(*lopts.StartRecordName)) { - continue - } - if strings.ToUpper(*record.Type) != strings.ToUpper(*lopts.StartRecordType) { - continue - } - - if record.SetIdentifier != nil && *record.SetIdentifier != d.Get("set_identifier") { - continue - } - // The only safe return where a record is found - return record, nil - } - return nil, r53NoRecordsFound -} - -func resourceAwsRoute53RecordDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).r53conn - // Get the records - rec, err := findRecord(d, meta) - if err != nil { - switch err { - case r53NoHostedZoneFound, r53NoRecordsFound: - log.Printf("[DEBUG] %s for: %s, removing from state file", err, d.Id()) - d.SetId("") - return nil - default: - return err - } - } - - // Change batch for deleting - changeBatch := &route53.ChangeBatch{ - Comment: aws.String("Deleted by Terraform"), - Changes: []*route53.Change{ - &route53.Change{ - Action: aws.String("DELETE"), - ResourceRecordSet: rec, - }, - }, - } - - zone := cleanZoneID(d.Get("zone_id").(string)) - - req := &route53.ChangeResourceRecordSetsInput{ - HostedZoneId: aws.String(cleanZoneID(zone)), - ChangeBatch: changeBatch, - } - - respRaw, err := deleteRoute53RecordSet(conn, req) - if err != nil { - return errwrap.Wrapf("[ERR]: Error building changeset: {{err}}", err) - } - - changeInfo := respRaw.(*route53.ChangeResourceRecordSetsOutput).ChangeInfo - if changeInfo == nil { - log.Printf("[INFO] No ChangeInfo Found. Waiting for Sync not required") - return nil - } - - err = waitForRoute53RecordSetToSync(conn, cleanChangeID(*changeInfo.Id)) - if err != nil { - return err - } - - return err -} - -func deleteRoute53RecordSet(conn *route53.Route53, input *route53.ChangeResourceRecordSetsInput) (interface{}, error) { - wait := resource.StateChangeConf{ - Pending: []string{"rejected"}, - Target: []string{"accepted"}, - Timeout: 5 * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := conn.ChangeResourceRecordSets(input) - if err != nil { - if r53err, ok := err.(awserr.Error); ok { - if r53err.Code() == "PriorRequestNotComplete" { - // There is some pending operation, so just retry - // in a bit. - return 42, "rejected", nil - } - - if r53err.Code() == "InvalidChangeBatch" { - // This means that the record is already gone. - return resp, "accepted", nil - } - } - - return 42, "failure", err - } - - return resp, "accepted", nil - }, - } - - return wait.WaitForState() -} - -func resourceAwsRoute53RecordBuildSet(d *schema.ResourceData, zoneName string) (*route53.ResourceRecordSet, error) { - // get expanded name - en := expandRecordName(d.Get("name").(string), zoneName) - - // Create the RecordSet request with the fully expanded name, e.g. - // sub.domain.com. Route 53 requires a fully qualified domain name, but does - // not require the trailing ".", which it will itself, so we don't call FQDN - // here. - rec := &route53.ResourceRecordSet{ - Name: aws.String(en), - Type: aws.String(d.Get("type").(string)), - } - - if v, ok := d.GetOk("ttl"); ok { - rec.TTL = aws.Int64(int64(v.(int))) - } - - // Resource records - if v, ok := d.GetOk("records"); ok { - recs := v.(*schema.Set).List() - rec.ResourceRecords = expandResourceRecords(recs, d.Get("type").(string)) - } - - // Alias record - if v, ok := d.GetOk("alias"); ok { - aliases := v.(*schema.Set).List() - if len(aliases) > 1 { - return nil, fmt.Errorf("You can only define a single alias target per record") - } - alias := aliases[0].(map[string]interface{}) - rec.AliasTarget = &route53.AliasTarget{ - DNSName: aws.String(alias["name"].(string)), - EvaluateTargetHealth: aws.Bool(alias["evaluate_target_health"].(bool)), - HostedZoneId: aws.String(alias["zone_id"].(string)), - } - log.Printf("[DEBUG] Creating alias: %#v", alias) - } else { - if _, ok := d.GetOk("ttl"); !ok { - return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "ttl": required field is not set`, d.Get("name").(string)) - } - - if _, ok := d.GetOk("records"); !ok { - return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "records": required field is not set`, d.Get("name").(string)) - } - } - - if v, ok := d.GetOk("failover_routing_policy"); ok { - if _, ok := d.GetOk("set_identifier"); !ok { - return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "set_identifier": required field is not set when "failover_routing_policy" is set`, d.Get("name").(string)) - } - records := v.([]interface{}) - if len(records) > 1 { - return nil, fmt.Errorf("You can only define a single failover_routing_policy per record") - } - failover := records[0].(map[string]interface{}) - - rec.Failover = aws.String(failover["type"].(string)) - } - - if v, ok := d.GetOk("health_check_id"); ok { - rec.HealthCheckId = aws.String(v.(string)) - } - - if v, ok := d.GetOk("weighted_routing_policy"); ok { - if _, ok := d.GetOk("set_identifier"); !ok { - return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "set_identifier": required field is not set when "weight_routing_policy" is set`, d.Get("name").(string)) - } - records := v.([]interface{}) - if len(records) > 1 { - return nil, fmt.Errorf("You can only define a single weighed_routing_policy per record") - } - weight := records[0].(map[string]interface{}) - - rec.Weight = aws.Int64(int64(weight["weight"].(int))) - } - - if v, ok := d.GetOk("set_identifier"); ok { - rec.SetIdentifier = aws.String(v.(string)) - } - - if v, ok := d.GetOk("latency_routing_policy"); ok { - if _, ok := d.GetOk("set_identifier"); !ok { - return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "set_identifier": required field is not set when "latency_routing_policy" is set`, d.Get("name").(string)) - } - records := v.([]interface{}) - if len(records) > 1 { - return nil, fmt.Errorf("You can only define a single latency_routing_policy per record") - } - latency := records[0].(map[string]interface{}) - - rec.Region = aws.String(latency["region"].(string)) - } - - if v, ok := d.GetOk("geolocation_routing_policy"); ok { - if _, ok := d.GetOk("set_identifier"); !ok { - return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "set_identifier": required field is not set when "geolocation_routing_policy" is set`, d.Get("name").(string)) - } - geolocations := v.([]interface{}) - if len(geolocations) > 1 { - return nil, fmt.Errorf("You can only define a single geolocation_routing_policy per record") - } - geolocation := geolocations[0].(map[string]interface{}) - - rec.GeoLocation = &route53.GeoLocation{ - ContinentCode: nilString(geolocation["continent"].(string)), - CountryCode: nilString(geolocation["country"].(string)), - SubdivisionCode: nilString(geolocation["subdivision"].(string)), - } - log.Printf("[DEBUG] Creating geolocation: %#v", geolocation) - } - - return rec, nil -} - -func FQDN(name string) string { - n := len(name) - if n == 0 || name[n-1] == '.' { - return name - } else { - return name + "." - } -} - -// Route 53 stores the "*" wildcard indicator as ASCII 42 and returns the -// octal equivalent, "\\052". Here we look for that, and convert back to "*" -// as needed. -func cleanRecordName(name string) string { - str := name - if strings.HasPrefix(name, "\\052") { - str = strings.Replace(name, "\\052", "*", 1) - log.Printf("[DEBUG] Replacing octal \\052 for * in: %s", name) - } - return str -} - -// Check if the current record name contains the zone suffix. -// If it does not, add the zone name to form a fully qualified name -// and keep AWS happy. -func expandRecordName(name, zone string) string { - rn := strings.ToLower(strings.TrimSuffix(name, ".")) - zone = strings.TrimSuffix(zone, ".") - if !strings.HasSuffix(rn, zone) { - if len(name) == 0 { - rn = zone - } else { - rn = strings.Join([]string{name, zone}, ".") - } - } - return rn -} - -func resourceAwsRoute53AliasRecordHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", normalizeAwsAliasName(m["name"].(string)))) - buf.WriteString(fmt.Sprintf("%s-", m["zone_id"].(string))) - buf.WriteString(fmt.Sprintf("%t-", m["evaluate_target_health"].(bool))) - - return hashcode.String(buf.String()) -} - -// nilString takes a string as an argument and returns a string -// pointer. The returned pointer is nil if the string argument is -// empty, otherwise it is a pointer to a copy of the string. -func nilString(s string) *string { - if s == "" { - return nil - } - return aws.String(s) -} - -func normalizeAwsAliasName(alias interface{}) string { - input := alias.(string) - if strings.HasPrefix(input, "dualstack.") { - return strings.Replace(input, "dualstack.", "", -1) - } - - return strings.TrimRight(input, ".") -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_record_migrate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_record_migrate.go deleted file mode 100644 index ad6cda9..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_record_migrate.go +++ /dev/null @@ -1,62 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/hashicorp/terraform/terraform" -) - -func resourceAwsRoute53RecordMigrateState( - v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - switch v { - case 0: - log.Println("[INFO] Found AWS Route53 Record State v0; migrating to v1 then v2") - v1InstanceState, err := migrateRoute53RecordStateV0toV1(is) - if err != nil { - return v1InstanceState, err - } - return migrateRoute53RecordStateV1toV2(v1InstanceState) - case 1: - log.Println("[INFO] Found AWS Route53 Record State v1; migrating to v2") - return migrateRoute53RecordStateV1toV2(is) - default: - return is, fmt.Errorf("Unexpected schema version: %d", v) - } -} - -func migrateRoute53RecordStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() { - log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") - return is, nil - } - - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - newName := strings.TrimSuffix(is.Attributes["name"], ".") - is.Attributes["name"] = newName - log.Printf("[DEBUG] Attributes after migration: %#v, new name: %s", is.Attributes, newName) - return is, nil -} - -func migrateRoute53RecordStateV1toV2(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() { - log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") - return is, nil - } - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - if is.Attributes["weight"] != "" && is.Attributes["weight"] != "-1" { - is.Attributes["weighted_routing_policy.#"] = "1" - key := fmt.Sprintf("weighted_routing_policy.0.weight") - is.Attributes[key] = is.Attributes["weight"] - } - if is.Attributes["failover"] != "" { - is.Attributes["failover_routing_policy.#"] = "1" - key := fmt.Sprintf("failover_routing_policy.0.type") - is.Attributes[key] = is.Attributes["failover"] - } - delete(is.Attributes, "weight") - delete(is.Attributes, "failover") - log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) - return is, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_zone.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_zone.go deleted file mode 100644 index 9faa716..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_zone.go +++ /dev/null @@ -1,391 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "sort" - "strings" - "time" - - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/route53" -) - -func resourceAwsRoute53Zone() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRoute53ZoneCreate, - Read: resourceAwsRoute53ZoneRead, - Update: resourceAwsRoute53ZoneUpdate, - Delete: resourceAwsRoute53ZoneDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "comment": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "Managed by Terraform", - }, - - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"delegation_set_id"}, - }, - - "vpc_region": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "zone_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "delegation_set_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"vpc_id"}, - }, - - "name_servers": &schema.Schema{ - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, - }, - - "tags": tagsSchema(), - - "force_destroy": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } -} - -func resourceAwsRoute53ZoneCreate(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - - req := &route53.CreateHostedZoneInput{ - Name: aws.String(d.Get("name").(string)), - HostedZoneConfig: &route53.HostedZoneConfig{Comment: aws.String(d.Get("comment").(string))}, - CallerReference: aws.String(time.Now().Format(time.RFC3339Nano)), - } - if v := d.Get("vpc_id"); v != "" { - req.VPC = &route53.VPC{ - VPCId: aws.String(v.(string)), - VPCRegion: aws.String(meta.(*AWSClient).region), - } - if w := d.Get("vpc_region"); w != "" { - req.VPC.VPCRegion = aws.String(w.(string)) - } - d.Set("vpc_region", req.VPC.VPCRegion) - } - - if v, ok := d.GetOk("delegation_set_id"); ok { - req.DelegationSetId = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Creating Route53 hosted zone: %s", *req.Name) - var err error - resp, err := r53.CreateHostedZone(req) - if err != nil { - return err - } - - // Store the zone_id - zone := cleanZoneID(*resp.HostedZone.Id) - d.Set("zone_id", zone) - d.SetId(zone) - - // Wait until we are done initializing - wait := resource.StateChangeConf{ - Delay: 30 * time.Second, - Pending: []string{"PENDING"}, - Target: []string{"INSYNC"}, - Timeout: 10 * time.Minute, - MinTimeout: 2 * time.Second, - Refresh: func() (result interface{}, state string, err error) { - changeRequest := &route53.GetChangeInput{ - Id: aws.String(cleanChangeID(*resp.ChangeInfo.Id)), - } - return resourceAwsGoRoute53Wait(r53, changeRequest) - }, - } - _, err = wait.WaitForState() - if err != nil { - return err - } - return resourceAwsRoute53ZoneUpdate(d, meta) -} - -func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - zone, err := r53.GetHostedZone(&route53.GetHostedZoneInput{Id: aws.String(d.Id())}) - if err != nil { - // Handle a deleted zone - if r53err, ok := err.(awserr.Error); ok && r53err.Code() == "NoSuchHostedZone" { - d.SetId("") - return nil - } - return err - } - - // In the import case this will be empty - if _, ok := d.GetOk("zone_id"); !ok { - d.Set("zone_id", d.Id()) - } - if _, ok := d.GetOk("name"); !ok { - d.Set("name", zone.HostedZone.Name) - } - - if !*zone.HostedZone.Config.PrivateZone { - ns := make([]string, len(zone.DelegationSet.NameServers)) - for i := range zone.DelegationSet.NameServers { - ns[i] = *zone.DelegationSet.NameServers[i] - } - sort.Strings(ns) - if err := d.Set("name_servers", ns); err != nil { - return fmt.Errorf("[DEBUG] Error setting name servers for: %s, error: %#v", d.Id(), err) - } - } else { - ns, err := getNameServers(d.Id(), d.Get("name").(string), r53) - if err != nil { - return err - } - if err := d.Set("name_servers", ns); err != nil { - return fmt.Errorf("[DEBUG] Error setting name servers for: %s, error: %#v", d.Id(), err) - } - - // In the import case we just associate it with the first VPC - if _, ok := d.GetOk("vpc_id"); !ok { - if len(zone.VPCs) > 1 { - return fmt.Errorf( - "Can't import a route53_zone with more than one VPC attachment") - } - - if len(zone.VPCs) > 0 { - d.Set("vpc_id", zone.VPCs[0].VPCId) - d.Set("vpc_region", zone.VPCs[0].VPCRegion) - } - } - - var associatedVPC *route53.VPC - for _, vpc := range zone.VPCs { - if *vpc.VPCId == d.Get("vpc_id") { - associatedVPC = vpc - break - } - } - if associatedVPC == nil { - return fmt.Errorf("[DEBUG] VPC: %v is not associated with Zone: %v", d.Get("vpc_id"), d.Id()) - } - } - - if zone.DelegationSet != nil && zone.DelegationSet.Id != nil { - d.Set("delegation_set_id", cleanDelegationSetId(*zone.DelegationSet.Id)) - } - - if zone.HostedZone != nil && zone.HostedZone.Config != nil && zone.HostedZone.Config.Comment != nil { - d.Set("comment", zone.HostedZone.Config.Comment) - } - - // get tags - req := &route53.ListTagsForResourceInput{ - ResourceId: aws.String(d.Id()), - ResourceType: aws.String("hostedzone"), - } - - resp, err := r53.ListTagsForResource(req) - if err != nil { - return err - } - - var tags []*route53.Tag - if resp.ResourceTagSet != nil { - tags = resp.ResourceTagSet.Tags - } - - if err := d.Set("tags", tagsToMapR53(tags)); err != nil { - return err - } - - return nil -} - -func resourceAwsRoute53ZoneUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).r53conn - - d.Partial(true) - - if d.HasChange("comment") { - zoneInput := route53.UpdateHostedZoneCommentInput{ - Id: aws.String(d.Id()), - Comment: aws.String(d.Get("comment").(string)), - } - - _, err := conn.UpdateHostedZoneComment(&zoneInput) - if err != nil { - return err - } else { - d.SetPartial("comment") - } - } - - if err := setTagsR53(conn, d, "hostedzone"); err != nil { - return err - } else { - d.SetPartial("tags") - } - - d.Partial(false) - - return resourceAwsRoute53ZoneRead(d, meta) -} - -func resourceAwsRoute53ZoneDelete(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - - if d.Get("force_destroy").(bool) { - if err := deleteAllRecordsInHostedZoneId(d.Id(), d.Get("name").(string), r53); err != nil { - return errwrap.Wrapf("{{err}}", err) - } - } - - log.Printf("[DEBUG] Deleting Route53 hosted zone: %s (ID: %s)", - d.Get("name").(string), d.Id()) - _, err := r53.DeleteHostedZone(&route53.DeleteHostedZoneInput{Id: aws.String(d.Id())}) - if err != nil { - if r53err, ok := err.(awserr.Error); ok && r53err.Code() == "NoSuchHostedZone" { - log.Printf("[DEBUG] No matching Route 53 Zone found for: %s, removing from state file", d.Id()) - d.SetId("") - return nil - } - return err - } - - return nil -} - -func deleteAllRecordsInHostedZoneId(hostedZoneId, hostedZoneName string, conn *route53.Route53) error { - input := &route53.ListResourceRecordSetsInput{ - HostedZoneId: aws.String(hostedZoneId), - } - - var lastDeleteErr, lastErrorFromWaiter error - var pageNum = 0 - err := conn.ListResourceRecordSetsPages(input, func(page *route53.ListResourceRecordSetsOutput, isLastPage bool) bool { - sets := page.ResourceRecordSets - pageNum += 1 - - changes := make([]*route53.Change, 0) - // 100 items per page returned by default - for _, set := range sets { - if *set.Name == hostedZoneName+"." && (*set.Type == "NS" || *set.Type == "SOA") { - // Zone NS & SOA records cannot be deleted - continue - } - changes = append(changes, &route53.Change{ - Action: aws.String("DELETE"), - ResourceRecordSet: set, - }) - } - log.Printf("[DEBUG] Deleting %d records (page %d) from %s", - len(changes), pageNum, hostedZoneId) - - req := &route53.ChangeResourceRecordSetsInput{ - HostedZoneId: aws.String(hostedZoneId), - ChangeBatch: &route53.ChangeBatch{ - Comment: aws.String("Deleted by Terraform"), - Changes: changes, - }, - } - - var resp interface{} - resp, lastDeleteErr = deleteRoute53RecordSet(conn, req) - if out, ok := resp.(*route53.ChangeResourceRecordSetsOutput); ok { - log.Printf("[DEBUG] Waiting for change batch to become INSYNC: %#v", out) - if out.ChangeInfo != nil && out.ChangeInfo.Id != nil { - lastErrorFromWaiter = waitForRoute53RecordSetToSync(conn, cleanChangeID(*out.ChangeInfo.Id)) - } else { - log.Printf("[DEBUG] Change info was empty") - } - } else { - log.Printf("[DEBUG] Unable to wait for change batch because of an error: %s", lastDeleteErr) - } - - return !isLastPage - }) - if err != nil { - return fmt.Errorf("Failed listing/deleting record sets: %s\nLast error from deletion: %s\nLast error from waiter: %s", - err, lastDeleteErr, lastErrorFromWaiter) - } - - return nil -} - -func resourceAwsGoRoute53Wait(r53 *route53.Route53, ref *route53.GetChangeInput) (result interface{}, state string, err error) { - - status, err := r53.GetChange(ref) - if err != nil { - return nil, "UNKNOWN", err - } - return true, *status.ChangeInfo.Status, nil -} - -// cleanChangeID is used to remove the leading /change/ -func cleanChangeID(ID string) string { - return cleanPrefix(ID, "/change/") -} - -// cleanZoneID is used to remove the leading /hostedzone/ -func cleanZoneID(ID string) string { - return cleanPrefix(ID, "/hostedzone/") -} - -// cleanPrefix removes a string prefix from an ID -func cleanPrefix(ID, prefix string) string { - if strings.HasPrefix(ID, prefix) { - ID = strings.TrimPrefix(ID, prefix) - } - return ID -} - -func getNameServers(zoneId string, zoneName string, r53 *route53.Route53) ([]string, error) { - resp, err := r53.ListResourceRecordSets(&route53.ListResourceRecordSetsInput{ - HostedZoneId: aws.String(zoneId), - StartRecordName: aws.String(zoneName), - StartRecordType: aws.String("NS"), - }) - if err != nil { - return nil, err - } - if len(resp.ResourceRecordSets) == 0 { - return nil, nil - } - ns := make([]string, len(resp.ResourceRecordSets[0].ResourceRecords)) - for i := range resp.ResourceRecordSets[0].ResourceRecords { - ns[i] = *resp.ResourceRecordSets[0].ResourceRecords[i].Value - } - sort.Strings(ns) - return ns, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_zone_association.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_zone_association.go deleted file mode 100644 index c416095..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route53_zone_association.go +++ /dev/null @@ -1,149 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/route53" -) - -func resourceAwsRoute53ZoneAssociation() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRoute53ZoneAssociationCreate, - Read: resourceAwsRoute53ZoneAssociationRead, - Update: resourceAwsRoute53ZoneAssociationUpdate, - Delete: resourceAwsRoute53ZoneAssociationDelete, - - Schema: map[string]*schema.Schema{ - "zone_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "vpc_region": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsRoute53ZoneAssociationCreate(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - - req := &route53.AssociateVPCWithHostedZoneInput{ - HostedZoneId: aws.String(d.Get("zone_id").(string)), - VPC: &route53.VPC{ - VPCId: aws.String(d.Get("vpc_id").(string)), - VPCRegion: aws.String(meta.(*AWSClient).region), - }, - Comment: aws.String("Managed by Terraform"), - } - if w := d.Get("vpc_region"); w != "" { - req.VPC.VPCRegion = aws.String(w.(string)) - } - - log.Printf("[DEBUG] Associating Route53 Private Zone %s with VPC %s with region %s", *req.HostedZoneId, *req.VPC.VPCId, *req.VPC.VPCRegion) - var err error - resp, err := r53.AssociateVPCWithHostedZone(req) - if err != nil { - return err - } - - // Store association id - d.SetId(fmt.Sprintf("%s:%s", *req.HostedZoneId, *req.VPC.VPCId)) - d.Set("vpc_region", req.VPC.VPCRegion) - - // Wait until we are done initializing - wait := resource.StateChangeConf{ - Delay: 30 * time.Second, - Pending: []string{"PENDING"}, - Target: []string{"INSYNC"}, - Timeout: 10 * time.Minute, - MinTimeout: 2 * time.Second, - Refresh: func() (result interface{}, state string, err error) { - changeRequest := &route53.GetChangeInput{ - Id: aws.String(cleanChangeID(*resp.ChangeInfo.Id)), - } - return resourceAwsGoRoute53Wait(r53, changeRequest) - }, - } - _, err = wait.WaitForState() - if err != nil { - return err - } - - return resourceAwsRoute53ZoneAssociationUpdate(d, meta) -} - -func resourceAwsRoute53ZoneAssociationRead(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - zone_id, vpc_id := resourceAwsRoute53ZoneAssociationParseId(d.Id()) - zone, err := r53.GetHostedZone(&route53.GetHostedZoneInput{Id: aws.String(zone_id)}) - if err != nil { - // Handle a deleted zone - if r53err, ok := err.(awserr.Error); ok && r53err.Code() == "NoSuchHostedZone" { - d.SetId("") - return nil - } - return err - } - - for _, vpc := range zone.VPCs { - if vpc_id == *vpc.VPCId { - // association is there, return - return nil - } - } - - // no association found - d.SetId("") - return nil -} - -func resourceAwsRoute53ZoneAssociationUpdate(d *schema.ResourceData, meta interface{}) error { - return resourceAwsRoute53ZoneAssociationRead(d, meta) -} - -func resourceAwsRoute53ZoneAssociationDelete(d *schema.ResourceData, meta interface{}) error { - r53 := meta.(*AWSClient).r53conn - zone_id, vpc_id := resourceAwsRoute53ZoneAssociationParseId(d.Id()) - log.Printf("[DEBUG] Deleting Route53 Private Zone (%s) association (VPC: %s)", - zone_id, vpc_id) - - req := &route53.DisassociateVPCFromHostedZoneInput{ - HostedZoneId: aws.String(zone_id), - VPC: &route53.VPC{ - VPCId: aws.String(vpc_id), - VPCRegion: aws.String(d.Get("vpc_region").(string)), - }, - Comment: aws.String("Managed by Terraform"), - } - - _, err := r53.DisassociateVPCFromHostedZone(req) - if err != nil { - return err - } - - return nil -} - -func resourceAwsRoute53ZoneAssociationParseId(id string) (zone_id, vpc_id string) { - parts := strings.SplitN(id, ":", 2) - zone_id = parts[0] - vpc_id = parts[1] - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route_table.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route_table.go deleted file mode 100644 index c92dbde..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route_table.go +++ /dev/null @@ -1,521 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRouteTable() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRouteTableCreate, - Read: resourceAwsRouteTableRead, - Update: resourceAwsRouteTableUpdate, - Delete: resourceAwsRouteTableDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsRouteTableImportState, - }, - - Schema: map[string]*schema.Schema{ - "vpc_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "tags": tagsSchema(), - - "propagating_vgws": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "route": { - Type: schema.TypeSet, - Computed: true, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cidr_block": { - Type: schema.TypeString, - Optional: true, - }, - - "ipv6_cidr_block": { - Type: schema.TypeString, - Optional: true, - }, - - "egress_only_gateway_id": { - Type: schema.TypeString, - Optional: true, - }, - - "gateway_id": { - Type: schema.TypeString, - Optional: true, - }, - - "instance_id": { - Type: schema.TypeString, - Optional: true, - }, - - "nat_gateway_id": { - Type: schema.TypeString, - Optional: true, - }, - - "vpc_peering_connection_id": { - Type: schema.TypeString, - Optional: true, - }, - - "network_interface_id": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - Set: resourceAwsRouteTableHash, - }, - }, - } -} - -func resourceAwsRouteTableCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Create the routing table - createOpts := &ec2.CreateRouteTableInput{ - VpcId: aws.String(d.Get("vpc_id").(string)), - } - log.Printf("[DEBUG] RouteTable create config: %#v", createOpts) - - resp, err := conn.CreateRouteTable(createOpts) - if err != nil { - return fmt.Errorf("Error creating route table: %s", err) - } - - // Get the ID and store it - rt := resp.RouteTable - d.SetId(*rt.RouteTableId) - log.Printf("[INFO] Route Table ID: %s", d.Id()) - - // Wait for the route table to become available - log.Printf( - "[DEBUG] Waiting for route table (%s) to become available", - d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"ready"}, - Refresh: resourceAwsRouteTableStateRefreshFunc(conn, d.Id()), - Timeout: 2 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for route table (%s) to become available: %s", - d.Id(), err) - } - - return resourceAwsRouteTableUpdate(d, meta) -} - -func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - rtRaw, _, err := resourceAwsRouteTableStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - if rtRaw == nil { - d.SetId("") - return nil - } - - rt := rtRaw.(*ec2.RouteTable) - d.Set("vpc_id", rt.VpcId) - - propagatingVGWs := make([]string, 0, len(rt.PropagatingVgws)) - for _, vgw := range rt.PropagatingVgws { - propagatingVGWs = append(propagatingVGWs, *vgw.GatewayId) - } - d.Set("propagating_vgws", propagatingVGWs) - - // Create an empty schema.Set to hold all routes - route := &schema.Set{F: resourceAwsRouteTableHash} - - // Loop through the routes and add them to the set - for _, r := range rt.Routes { - if r.GatewayId != nil && *r.GatewayId == "local" { - continue - } - - if r.Origin != nil && *r.Origin == "EnableVgwRoutePropagation" { - continue - } - - if r.DestinationPrefixListId != nil { - // Skipping because VPC endpoint routes are handled separately - // See aws_vpc_endpoint - continue - } - - m := make(map[string]interface{}) - - if r.DestinationCidrBlock != nil { - m["cidr_block"] = *r.DestinationCidrBlock - } - if r.DestinationIpv6CidrBlock != nil { - m["ipv6_cidr_block"] = *r.DestinationIpv6CidrBlock - } - if r.EgressOnlyInternetGatewayId != nil { - m["egress_only_gateway_id"] = *r.EgressOnlyInternetGatewayId - } - if r.GatewayId != nil { - m["gateway_id"] = *r.GatewayId - } - if r.NatGatewayId != nil { - m["nat_gateway_id"] = *r.NatGatewayId - } - if r.InstanceId != nil { - m["instance_id"] = *r.InstanceId - } - if r.VpcPeeringConnectionId != nil { - m["vpc_peering_connection_id"] = *r.VpcPeeringConnectionId - } - if r.NetworkInterfaceId != nil { - m["network_interface_id"] = *r.NetworkInterfaceId - } - - route.Add(m) - } - d.Set("route", route) - - // Tags - d.Set("tags", tagsToMap(rt.Tags)) - - return nil -} - -func resourceAwsRouteTableUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - if d.HasChange("propagating_vgws") { - o, n := d.GetChange("propagating_vgws") - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove := os.Difference(ns).List() - add := ns.Difference(os).List() - - // Now first loop through all the old propagations and disable any obsolete ones - for _, vgw := range remove { - id := vgw.(string) - - // Disable the propagation as it no longer exists in the config - log.Printf( - "[INFO] Deleting VGW propagation from %s: %s", - d.Id(), id) - _, err := conn.DisableVgwRoutePropagation(&ec2.DisableVgwRoutePropagationInput{ - RouteTableId: aws.String(d.Id()), - GatewayId: aws.String(id), - }) - if err != nil { - return err - } - } - - // Make sure we save the state of the currently configured rules - propagatingVGWs := os.Intersection(ns) - d.Set("propagating_vgws", propagatingVGWs) - - // Then loop through all the newly configured propagations and enable them - for _, vgw := range add { - id := vgw.(string) - - var err error - for i := 0; i < 5; i++ { - log.Printf("[INFO] Enabling VGW propagation for %s: %s", d.Id(), id) - _, err = conn.EnableVgwRoutePropagation(&ec2.EnableVgwRoutePropagationInput{ - RouteTableId: aws.String(d.Id()), - GatewayId: aws.String(id), - }) - if err == nil { - break - } - - // If we get a Gateway.NotAttached, it is usually some - // eventually consistency stuff. So we have to just wait a - // bit... - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "Gateway.NotAttached" { - time.Sleep(20 * time.Second) - continue - } - } - if err != nil { - return err - } - - propagatingVGWs.Add(vgw) - d.Set("propagating_vgws", propagatingVGWs) - } - } - - // Check if the route set as a whole has changed - if d.HasChange("route") { - o, n := d.GetChange("route") - ors := o.(*schema.Set).Difference(n.(*schema.Set)) - nrs := n.(*schema.Set).Difference(o.(*schema.Set)) - - // Now first loop through all the old routes and delete any obsolete ones - for _, route := range ors.List() { - m := route.(map[string]interface{}) - - deleteOpts := &ec2.DeleteRouteInput{ - RouteTableId: aws.String(d.Id()), - } - - if s := m["ipv6_cidr_block"].(string); s != "" { - deleteOpts.DestinationIpv6CidrBlock = aws.String(s) - - log.Printf( - "[INFO] Deleting route from %s: %s", - d.Id(), m["ipv6_cidr_block"].(string)) - } - - if s := m["cidr_block"].(string); s != "" { - deleteOpts.DestinationCidrBlock = aws.String(s) - - log.Printf( - "[INFO] Deleting route from %s: %s", - d.Id(), m["cidr_block"].(string)) - } - - _, err := conn.DeleteRoute(deleteOpts) - if err != nil { - return err - } - } - - // Make sure we save the state of the currently configured rules - routes := o.(*schema.Set).Intersection(n.(*schema.Set)) - d.Set("route", routes) - - // Then loop through all the newly configured routes and create them - for _, route := range nrs.List() { - m := route.(map[string]interface{}) - - opts := ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Id()), - } - - if s := m["vpc_peering_connection_id"].(string); s != "" { - opts.VpcPeeringConnectionId = aws.String(s) - } - - if s := m["network_interface_id"].(string); s != "" { - opts.NetworkInterfaceId = aws.String(s) - } - - if s := m["instance_id"].(string); s != "" { - opts.InstanceId = aws.String(s) - } - - if s := m["ipv6_cidr_block"].(string); s != "" { - opts.DestinationIpv6CidrBlock = aws.String(s) - } - - if s := m["cidr_block"].(string); s != "" { - opts.DestinationCidrBlock = aws.String(s) - } - - if s := m["gateway_id"].(string); s != "" { - opts.GatewayId = aws.String(s) - } - - if s := m["egress_only_gateway_id"].(string); s != "" { - opts.EgressOnlyInternetGatewayId = aws.String(s) - } - - if s := m["nat_gateway_id"].(string); s != "" { - opts.NatGatewayId = aws.String(s) - } - - log.Printf("[INFO] Creating route for %s: %#v", d.Id(), opts) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := conn.CreateRoute(&opts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "InvalidRouteTableID.NotFound" { - return resource.RetryableError(awsErr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return err - } - - routes.Add(route) - d.Set("route", routes) - } - } - - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - return resourceAwsRouteTableRead(d, meta) -} - -func resourceAwsRouteTableDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // First request the routing table since we'll have to disassociate - // all the subnets first. - rtRaw, _, err := resourceAwsRouteTableStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - if rtRaw == nil { - return nil - } - rt := rtRaw.(*ec2.RouteTable) - - // Do all the disassociations - for _, a := range rt.Associations { - log.Printf("[INFO] Disassociating association: %s", *a.RouteTableAssociationId) - _, err := conn.DisassociateRouteTable(&ec2.DisassociateRouteTableInput{ - AssociationId: a.RouteTableAssociationId, - }) - if err != nil { - // First check if the association ID is not found. If this - // is the case, then it was already disassociated somehow, - // and that is okay. - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidAssociationID.NotFound" { - err = nil - } - } - if err != nil { - return err - } - } - - // Delete the route table - log.Printf("[INFO] Deleting Route Table: %s", d.Id()) - _, err = conn.DeleteRouteTable(&ec2.DeleteRouteTableInput{ - RouteTableId: aws.String(d.Id()), - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "InvalidRouteTableID.NotFound" { - return nil - } - - return fmt.Errorf("Error deleting route table: %s", err) - } - - // Wait for the route table to really destroy - log.Printf( - "[DEBUG] Waiting for route table (%s) to become destroyed", - d.Id()) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"ready"}, - Target: []string{}, - Refresh: resourceAwsRouteTableStateRefreshFunc(conn, d.Id()), - Timeout: 2 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for route table (%s) to become destroyed: %s", - d.Id(), err) - } - - return nil -} - -func resourceAwsRouteTableHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - if v, ok := m["ipv6_cidr_block"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["cidr_block"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["gateway_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["egress_only_gateway_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - natGatewaySet := false - if v, ok := m["nat_gateway_id"]; ok { - natGatewaySet = v.(string) != "" - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - instanceSet := false - if v, ok := m["instance_id"]; ok { - instanceSet = v.(string) != "" - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["vpc_peering_connection_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["network_interface_id"]; ok && !(instanceSet || natGatewaySet) { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - return hashcode.String(buf.String()) -} - -// resourceAwsRouteTableStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// a RouteTable. -func resourceAwsRouteTableStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeRouteTables(&ec2.DescribeRouteTablesInput{ - RouteTableIds: []*string{aws.String(id)}, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidRouteTableID.NotFound" { - resp = nil - } else { - log.Printf("Error on RouteTableStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - rt := resp.RouteTables[0] - return rt, "ready", nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route_table_association.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route_table_association.go deleted file mode 100644 index d681078..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route_table_association.go +++ /dev/null @@ -1,155 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsRouteTableAssociation() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsRouteTableAssociationCreate, - Read: resourceAwsRouteTableAssociationRead, - Update: resourceAwsRouteTableAssociationUpdate, - Delete: resourceAwsRouteTableAssociationDelete, - - Schema: map[string]*schema.Schema{ - "subnet_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "route_table_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsRouteTableAssociationCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf( - "[INFO] Creating route table association: %s => %s", - d.Get("subnet_id").(string), - d.Get("route_table_id").(string)) - - associationOpts := ec2.AssociateRouteTableInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - SubnetId: aws.String(d.Get("subnet_id").(string)), - } - - var resp *ec2.AssociateRouteTableOutput - var err error - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - resp, err = conn.AssociateRouteTable(&associationOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "InvalidRouteTableID.NotFound" { - return resource.RetryableError(awsErr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return err - } - - // Set the ID and return - d.SetId(*resp.AssociationId) - log.Printf("[INFO] Association ID: %s", d.Id()) - - return nil -} - -func resourceAwsRouteTableAssociationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Get the routing table that this association belongs to - rtRaw, _, err := resourceAwsRouteTableStateRefreshFunc( - conn, d.Get("route_table_id").(string))() - if err != nil { - return err - } - if rtRaw == nil { - return nil - } - rt := rtRaw.(*ec2.RouteTable) - - // Inspect that the association exists - found := false - for _, a := range rt.Associations { - if *a.RouteTableAssociationId == d.Id() { - found = true - d.Set("subnet_id", *a.SubnetId) - break - } - } - - if !found { - // It seems it doesn't exist anymore, so clear the ID - d.SetId("") - } - - return nil -} - -func resourceAwsRouteTableAssociationUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf( - "[INFO] Creating route table association: %s => %s", - d.Get("subnet_id").(string), - d.Get("route_table_id").(string)) - - req := &ec2.ReplaceRouteTableAssociationInput{ - AssociationId: aws.String(d.Id()), - RouteTableId: aws.String(d.Get("route_table_id").(string)), - } - resp, err := conn.ReplaceRouteTableAssociation(req) - - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "InvalidAssociationID.NotFound" { - // Not found, so just create a new one - return resourceAwsRouteTableAssociationCreate(d, meta) - } - - return err - } - - // Update the ID - d.SetId(*resp.NewAssociationId) - log.Printf("[INFO] Association ID: %s", d.Id()) - - return nil -} - -func resourceAwsRouteTableAssociationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[INFO] Deleting route table association: %s", d.Id()) - _, err := conn.DisassociateRouteTable(&ec2.DisassociateRouteTableInput{ - AssociationId: aws.String(d.Id()), - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "InvalidAssociationID.NotFound" { - return nil - } - - return fmt.Errorf("Error deleting route table association: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket.go deleted file mode 100644 index f75824a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket.go +++ /dev/null @@ -1,1843 +0,0 @@ -package aws - -import ( - "bytes" - "encoding/json" - "fmt" - "log" - "net/url" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsS3Bucket() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsS3BucketCreate, - Read: resourceAwsS3BucketRead, - Update: resourceAwsS3BucketUpdate, - Delete: resourceAwsS3BucketDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsS3BucketImportState, - }, - - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "bucket_domain_name": { - Type: schema.TypeString, - Computed: true, - }, - - "arn": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "acl": { - Type: schema.TypeString, - Default: "private", - Optional: true, - }, - - "policy": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - - "cors_rule": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "allowed_headers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "allowed_methods": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "allowed_origins": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "expose_headers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "max_age_seconds": { - Type: schema.TypeInt, - Optional: true, - }, - }, - }, - }, - - "website": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "index_document": { - Type: schema.TypeString, - Optional: true, - }, - - "error_document": { - Type: schema.TypeString, - Optional: true, - }, - - "redirect_all_requests_to": { - Type: schema.TypeString, - ConflictsWith: []string{ - "website.0.index_document", - "website.0.error_document", - "website.0.routing_rules", - }, - Optional: true, - }, - - "routing_rules": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateJsonString, - StateFunc: func(v interface{}) string { - json, _ := normalizeJsonString(v) - return json - }, - }, - }, - }, - }, - - "hosted_zone_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "region": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "website_endpoint": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "website_domain": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "versioning": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "mfa_delete": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - }, - }, - - "logging": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "target_bucket": { - Type: schema.TypeString, - Required: true, - }, - "target_prefix": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["target_bucket"])) - buf.WriteString(fmt.Sprintf("%s-", m["target_prefix"])) - return hashcode.String(buf.String()) - }, - }, - - "lifecycle_rule": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateS3BucketLifecycleRuleId, - }, - "prefix": { - Type: schema.TypeString, - Required: true, - }, - "enabled": { - Type: schema.TypeBool, - Required: true, - }, - "abort_incomplete_multipart_upload_days": { - Type: schema.TypeInt, - Optional: true, - }, - "expiration": { - Type: schema.TypeSet, - Optional: true, - Set: expirationHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "date": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateS3BucketLifecycleTimestamp, - }, - "days": { - Type: schema.TypeInt, - Optional: true, - }, - "expired_object_delete_marker": { - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - }, - "noncurrent_version_expiration": { - Type: schema.TypeSet, - Optional: true, - Set: expirationHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "days": { - Type: schema.TypeInt, - Optional: true, - }, - }, - }, - }, - "transition": { - Type: schema.TypeSet, - Optional: true, - Set: transitionHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "date": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateS3BucketLifecycleTimestamp, - }, - "days": { - Type: schema.TypeInt, - Optional: true, - }, - "storage_class": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateS3BucketLifecycleStorageClass, - }, - }, - }, - }, - "noncurrent_version_transition": { - Type: schema.TypeSet, - Optional: true, - Set: transitionHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "days": { - Type: schema.TypeInt, - Optional: true, - }, - "storage_class": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateS3BucketLifecycleStorageClass, - }, - }, - }, - }, - }, - }, - }, - - "force_destroy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "acceleration_status": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateS3BucketAccelerationStatus, - }, - - "request_payer": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateS3BucketRequestPayerType, - }, - - "replication_configuration": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "role": { - Type: schema.TypeString, - Required: true, - }, - "rules": { - Type: schema.TypeSet, - Required: true, - Set: rulesHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateS3BucketReplicationRuleId, - }, - "destination": { - Type: schema.TypeSet, - MaxItems: 1, - MinItems: 1, - Required: true, - Set: destinationHash, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateArn, - }, - "storage_class": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateS3BucketReplicationDestinationStorageClass, - }, - }, - }, - }, - "prefix": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateS3BucketReplicationRulePrefix, - }, - "status": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateS3BucketReplicationRuleStatus, - }, - }, - }, - }, - }, - }, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsS3BucketCreate(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - // Get the bucket and acl - bucket := d.Get("bucket").(string) - acl := d.Get("acl").(string) - - log.Printf("[DEBUG] S3 bucket create: %s, ACL: %s", bucket, acl) - - req := &s3.CreateBucketInput{ - Bucket: aws.String(bucket), - ACL: aws.String(acl), - } - - var awsRegion string - if region, ok := d.GetOk("region"); ok { - awsRegion = region.(string) - } else { - awsRegion = meta.(*AWSClient).region - } - log.Printf("[DEBUG] S3 bucket create: %s, using region: %s", bucket, awsRegion) - - // Special case us-east-1 region and do not set the LocationConstraint. - // See "Request Elements: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html - if awsRegion != "us-east-1" { - req.CreateBucketConfiguration = &s3.CreateBucketConfiguration{ - LocationConstraint: aws.String(awsRegion), - } - } - - if err := validateS3BucketName(bucket, awsRegion); err != nil { - return fmt.Errorf("Error validating S3 bucket name: %s", err) - } - - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Trying to create new S3 bucket: %q", bucket) - _, err := s3conn.CreateBucket(req) - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "OperationAborted" { - log.Printf("[WARN] Got an error while trying to create S3 bucket %s: %s", bucket, err) - return resource.RetryableError( - fmt.Errorf("[WARN] Error creating S3 bucket %s, retrying: %s", - bucket, err)) - } - } - if err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) - - if err != nil { - return fmt.Errorf("Error creating S3 bucket: %s", err) - } - - // Assign the bucket name as the resource ID - d.SetId(bucket) - - return resourceAwsS3BucketUpdate(d, meta) -} - -func resourceAwsS3BucketUpdate(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - if err := setTagsS3(s3conn, d); err != nil { - return fmt.Errorf("%q: %s", d.Get("bucket").(string), err) - } - - if d.HasChange("policy") { - if err := resourceAwsS3BucketPolicyUpdate(s3conn, d); err != nil { - return err - } - } - - if d.HasChange("cors_rule") { - if err := resourceAwsS3BucketCorsUpdate(s3conn, d); err != nil { - return err - } - } - - if d.HasChange("website") { - if err := resourceAwsS3BucketWebsiteUpdate(s3conn, d); err != nil { - return err - } - } - - if d.HasChange("versioning") { - if err := resourceAwsS3BucketVersioningUpdate(s3conn, d); err != nil { - return err - } - } - if d.HasChange("acl") { - if err := resourceAwsS3BucketAclUpdate(s3conn, d); err != nil { - return err - } - } - - if d.HasChange("logging") { - if err := resourceAwsS3BucketLoggingUpdate(s3conn, d); err != nil { - return err - } - } - - if d.HasChange("lifecycle_rule") { - if err := resourceAwsS3BucketLifecycleUpdate(s3conn, d); err != nil { - return err - } - } - - if d.HasChange("acceleration_status") { - if err := resourceAwsS3BucketAccelerationUpdate(s3conn, d); err != nil { - return err - } - } - - if d.HasChange("request_payer") { - if err := resourceAwsS3BucketRequestPayerUpdate(s3conn, d); err != nil { - return err - } - } - - if d.HasChange("replication_configuration") { - if err := resourceAwsS3BucketReplicationConfigurationUpdate(s3conn, d); err != nil { - return err - } - } - - return resourceAwsS3BucketRead(d, meta) -} - -func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - var err error - _, err = s3conn.HeadBucket(&s3.HeadBucketInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - if awsError, ok := err.(awserr.RequestFailure); ok && awsError.StatusCode() == 404 { - log.Printf("[WARN] S3 Bucket (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } else { - // some of the AWS SDK's errors can be empty strings, so let's add - // some additional context. - return fmt.Errorf("error reading S3 bucket \"%s\": %s", d.Id(), err) - } - } - - // In the import case, we won't have this - if _, ok := d.GetOk("bucket"); !ok { - d.Set("bucket", d.Id()) - } - - d.Set("bucket_domain_name", bucketDomainName(d.Get("bucket").(string))) - - // Read the policy - if _, ok := d.GetOk("policy"); ok { - pol, err := s3conn.GetBucketPolicy(&s3.GetBucketPolicyInput{ - Bucket: aws.String(d.Id()), - }) - log.Printf("[DEBUG] S3 bucket: %s, read policy: %v", d.Id(), pol) - if err != nil { - if err := d.Set("policy", ""); err != nil { - return err - } - } else { - if v := pol.Policy; v == nil { - if err := d.Set("policy", ""); err != nil { - return err - } - } else { - policy, err := normalizeJsonString(*v) - if err != nil { - return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) - } - d.Set("policy", policy) - } - } - } - - // Read the CORS - cors, err := s3conn.GetBucketCors(&s3.GetBucketCorsInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - // An S3 Bucket might not have CORS configuration set. - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() != "NoSuchCORSConfiguration" { - return err - } - log.Printf("[WARN] S3 bucket: %s, no CORS configuration could be found.", d.Id()) - } - log.Printf("[DEBUG] S3 bucket: %s, read CORS: %v", d.Id(), cors) - if cors.CORSRules != nil { - rules := make([]map[string]interface{}, 0, len(cors.CORSRules)) - for _, ruleObject := range cors.CORSRules { - rule := make(map[string]interface{}) - rule["allowed_headers"] = flattenStringList(ruleObject.AllowedHeaders) - rule["allowed_methods"] = flattenStringList(ruleObject.AllowedMethods) - rule["allowed_origins"] = flattenStringList(ruleObject.AllowedOrigins) - // Both the "ExposeHeaders" and "MaxAgeSeconds" might not be set. - if ruleObject.AllowedOrigins != nil { - rule["expose_headers"] = flattenStringList(ruleObject.ExposeHeaders) - } - if ruleObject.MaxAgeSeconds != nil { - rule["max_age_seconds"] = int(*ruleObject.MaxAgeSeconds) - } - rules = append(rules, rule) - } - if err := d.Set("cors_rule", rules); err != nil { - return err - } - } - - // Read the website configuration - ws, err := s3conn.GetBucketWebsite(&s3.GetBucketWebsiteInput{ - Bucket: aws.String(d.Id()), - }) - var websites []map[string]interface{} - if err == nil { - w := make(map[string]interface{}) - - if v := ws.IndexDocument; v != nil { - w["index_document"] = *v.Suffix - } - - if v := ws.ErrorDocument; v != nil { - w["error_document"] = *v.Key - } - - if v := ws.RedirectAllRequestsTo; v != nil { - if v.Protocol == nil { - w["redirect_all_requests_to"] = *v.HostName - } else { - var host string - var path string - parsedHostName, err := url.Parse(*v.HostName) - if err == nil { - host = parsedHostName.Host - path = parsedHostName.Path - } else { - host = *v.HostName - path = "" - } - - w["redirect_all_requests_to"] = (&url.URL{ - Host: host, - Path: path, - Scheme: *v.Protocol, - }).String() - } - } - - if v := ws.RoutingRules; v != nil { - rr, err := normalizeRoutingRules(v) - if err != nil { - return fmt.Errorf("Error while marshaling routing rules: %s", err) - } - w["routing_rules"] = rr - } - - websites = append(websites, w) - } - if err := d.Set("website", websites); err != nil { - return err - } - - // Read the versioning configuration - versioning, err := s3conn.GetBucketVersioning(&s3.GetBucketVersioningInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] S3 Bucket: %s, versioning: %v", d.Id(), versioning) - if versioning != nil { - vcl := make([]map[string]interface{}, 0, 1) - vc := make(map[string]interface{}) - if versioning.Status != nil && *versioning.Status == s3.BucketVersioningStatusEnabled { - vc["enabled"] = true - } else { - vc["enabled"] = false - } - - if versioning.MFADelete != nil && *versioning.MFADelete == s3.MFADeleteEnabled { - vc["mfa_delete"] = true - } else { - vc["mfa_delete"] = false - } - vcl = append(vcl, vc) - if err := d.Set("versioning", vcl); err != nil { - return err - } - } - - // Read the acceleration status - accelerate, err := s3conn.GetBucketAccelerateConfiguration(&s3.GetBucketAccelerateConfigurationInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - // Amazon S3 Transfer Acceleration might not be supported in the - // given region, for example, China (Beijing) and the Government - // Cloud does not support this feature at the moment. - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() != "UnsupportedArgument" { - return err - } - - var awsRegion string - if region, ok := d.GetOk("region"); ok { - awsRegion = region.(string) - } else { - awsRegion = meta.(*AWSClient).region - } - - log.Printf("[WARN] S3 bucket: %s, the S3 Transfer Acceleration is not supported in the region: %s", d.Id(), awsRegion) - } else { - log.Printf("[DEBUG] S3 bucket: %s, read Acceleration: %v", d.Id(), accelerate) - d.Set("acceleration_status", accelerate.Status) - } - - // Read the request payer configuration. - payer, err := s3conn.GetBucketRequestPayment(&s3.GetBucketRequestPaymentInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] S3 Bucket: %s, read request payer: %v", d.Id(), payer) - if payer.Payer != nil { - if err := d.Set("request_payer", *payer.Payer); err != nil { - return err - } - } - - // Read the logging configuration - logging, err := s3conn.GetBucketLogging(&s3.GetBucketLoggingInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - return err - } - - log.Printf("[DEBUG] S3 Bucket: %s, logging: %v", d.Id(), logging) - if v := logging.LoggingEnabled; v != nil { - lcl := make([]map[string]interface{}, 0, 1) - lc := make(map[string]interface{}) - if *v.TargetBucket != "" { - lc["target_bucket"] = *v.TargetBucket - } - if *v.TargetPrefix != "" { - lc["target_prefix"] = *v.TargetPrefix - } - lcl = append(lcl, lc) - if err := d.Set("logging", lcl); err != nil { - return err - } - } - - // Read the lifecycle configuration - lifecycle, err := s3conn.GetBucketLifecycleConfiguration(&s3.GetBucketLifecycleConfigurationInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - if awsError, ok := err.(awserr.RequestFailure); ok && awsError.StatusCode() != 404 { - return err - } - } - log.Printf("[DEBUG] S3 Bucket: %s, lifecycle: %v", d.Id(), lifecycle) - if len(lifecycle.Rules) > 0 { - rules := make([]map[string]interface{}, 0, len(lifecycle.Rules)) - - for _, lifecycleRule := range lifecycle.Rules { - rule := make(map[string]interface{}) - - // ID - if lifecycleRule.ID != nil && *lifecycleRule.ID != "" { - rule["id"] = *lifecycleRule.ID - } - // Prefix - if lifecycleRule.Prefix != nil && *lifecycleRule.Prefix != "" { - rule["prefix"] = *lifecycleRule.Prefix - } - // Enabled - if lifecycleRule.Status != nil { - if *lifecycleRule.Status == s3.ExpirationStatusEnabled { - rule["enabled"] = true - } else { - rule["enabled"] = false - } - } - - // AbortIncompleteMultipartUploadDays - if lifecycleRule.AbortIncompleteMultipartUpload != nil { - if lifecycleRule.AbortIncompleteMultipartUpload.DaysAfterInitiation != nil { - rule["abort_incomplete_multipart_upload_days"] = int(*lifecycleRule.AbortIncompleteMultipartUpload.DaysAfterInitiation) - } - } - - // expiration - if lifecycleRule.Expiration != nil { - e := make(map[string]interface{}) - if lifecycleRule.Expiration.Date != nil { - e["date"] = (*lifecycleRule.Expiration.Date).Format("2006-01-02") - } - if lifecycleRule.Expiration.Days != nil { - e["days"] = int(*lifecycleRule.Expiration.Days) - } - if lifecycleRule.Expiration.ExpiredObjectDeleteMarker != nil { - e["expired_object_delete_marker"] = *lifecycleRule.Expiration.ExpiredObjectDeleteMarker - } - rule["expiration"] = schema.NewSet(expirationHash, []interface{}{e}) - } - // noncurrent_version_expiration - if lifecycleRule.NoncurrentVersionExpiration != nil { - e := make(map[string]interface{}) - if lifecycleRule.NoncurrentVersionExpiration.NoncurrentDays != nil { - e["days"] = int(*lifecycleRule.NoncurrentVersionExpiration.NoncurrentDays) - } - rule["noncurrent_version_expiration"] = schema.NewSet(expirationHash, []interface{}{e}) - } - //// transition - if len(lifecycleRule.Transitions) > 0 { - transitions := make([]interface{}, 0, len(lifecycleRule.Transitions)) - for _, v := range lifecycleRule.Transitions { - t := make(map[string]interface{}) - if v.Date != nil { - t["date"] = (*v.Date).Format("2006-01-02") - } - if v.Days != nil { - t["days"] = int(*v.Days) - } - if v.StorageClass != nil { - t["storage_class"] = *v.StorageClass - } - transitions = append(transitions, t) - } - rule["transition"] = schema.NewSet(transitionHash, transitions) - } - // noncurrent_version_transition - if len(lifecycleRule.NoncurrentVersionTransitions) > 0 { - transitions := make([]interface{}, 0, len(lifecycleRule.NoncurrentVersionTransitions)) - for _, v := range lifecycleRule.NoncurrentVersionTransitions { - t := make(map[string]interface{}) - if v.NoncurrentDays != nil { - t["days"] = int(*v.NoncurrentDays) - } - if v.StorageClass != nil { - t["storage_class"] = *v.StorageClass - } - transitions = append(transitions, t) - } - rule["noncurrent_version_transition"] = schema.NewSet(transitionHash, transitions) - } - - rules = append(rules, rule) - } - - if err := d.Set("lifecycle_rule", rules); err != nil { - return err - } - } - - // Read the bucket replication configuration - replication, err := s3conn.GetBucketReplication(&s3.GetBucketReplicationInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - if awsError, ok := err.(awserr.RequestFailure); ok && awsError.StatusCode() != 404 { - return err - } - } - - log.Printf("[DEBUG] S3 Bucket: %s, read replication configuration: %v", d.Id(), replication) - if r := replication.ReplicationConfiguration; r != nil { - if err := d.Set("replication_configuration", flattenAwsS3BucketReplicationConfiguration(replication.ReplicationConfiguration)); err != nil { - log.Printf("[DEBUG] Error setting replication configuration: %s", err) - return err - } - } - - // Add the region as an attribute - location, err := s3conn.GetBucketLocation( - &s3.GetBucketLocationInput{ - Bucket: aws.String(d.Id()), - }, - ) - if err != nil { - return err - } - var region string - if location.LocationConstraint != nil { - region = *location.LocationConstraint - } - region = normalizeRegion(region) - if err := d.Set("region", region); err != nil { - return err - } - - // Add the hosted zone ID for this bucket's region as an attribute - hostedZoneID := HostedZoneIDForRegion(region) - if err := d.Set("hosted_zone_id", hostedZoneID); err != nil { - return err - } - - // Add website_endpoint as an attribute - websiteEndpoint, err := websiteEndpoint(s3conn, d) - if err != nil { - return err - } - if websiteEndpoint != nil { - if err := d.Set("website_endpoint", websiteEndpoint.Endpoint); err != nil { - return err - } - if err := d.Set("website_domain", websiteEndpoint.Domain); err != nil { - return err - } - } - - tagSet, err := getTagSetS3(s3conn, d.Id()) - if err != nil { - return err - } - - if err := d.Set("tags", tagsToMapS3(tagSet)); err != nil { - return err - } - - d.Set("arn", fmt.Sprintf("arn:%s:s3:::%s", meta.(*AWSClient).partition, d.Id())) - - return nil -} - -func resourceAwsS3BucketDelete(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - log.Printf("[DEBUG] S3 Delete Bucket: %s", d.Id()) - _, err := s3conn.DeleteBucket(&s3.DeleteBucketInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "BucketNotEmpty" { - if d.Get("force_destroy").(bool) { - // bucket may have things delete them - log.Printf("[DEBUG] S3 Bucket attempting to forceDestroy %+v", err) - - bucket := d.Get("bucket").(string) - resp, err := s3conn.ListObjectVersions( - &s3.ListObjectVersionsInput{ - Bucket: aws.String(bucket), - }, - ) - - if err != nil { - return fmt.Errorf("Error S3 Bucket list Object Versions err: %s", err) - } - - objectsToDelete := make([]*s3.ObjectIdentifier, 0) - - if len(resp.DeleteMarkers) != 0 { - - for _, v := range resp.DeleteMarkers { - objectsToDelete = append(objectsToDelete, &s3.ObjectIdentifier{ - Key: v.Key, - VersionId: v.VersionId, - }) - } - } - - if len(resp.Versions) != 0 { - for _, v := range resp.Versions { - objectsToDelete = append(objectsToDelete, &s3.ObjectIdentifier{ - Key: v.Key, - VersionId: v.VersionId, - }) - } - } - - params := &s3.DeleteObjectsInput{ - Bucket: aws.String(bucket), - Delete: &s3.Delete{ - Objects: objectsToDelete, - }, - } - - _, err = s3conn.DeleteObjects(params) - - if err != nil { - return fmt.Errorf("Error S3 Bucket force_destroy error deleting: %s", err) - } - - // this line recurses until all objects are deleted or an error is returned - return resourceAwsS3BucketDelete(d, meta) - } - } - return fmt.Errorf("Error deleting S3 Bucket: %s %q", err, d.Get("bucket").(string)) - } - return nil -} - -func resourceAwsS3BucketPolicyUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - bucket := d.Get("bucket").(string) - policy := d.Get("policy").(string) - - if policy != "" { - log.Printf("[DEBUG] S3 bucket: %s, put policy: %s", bucket, policy) - - params := &s3.PutBucketPolicyInput{ - Bucket: aws.String(bucket), - Policy: aws.String(policy), - } - - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - if _, err := s3conn.PutBucketPolicy(params); err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "MalformedPolicy" { - return resource.RetryableError(awserr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return fmt.Errorf("Error putting S3 policy: %s", err) - } - } else { - log.Printf("[DEBUG] S3 bucket: %s, delete policy: %s", bucket, policy) - _, err := s3conn.DeleteBucketPolicy(&s3.DeleteBucketPolicyInput{ - Bucket: aws.String(bucket), - }) - - if err != nil { - return fmt.Errorf("Error deleting S3 policy: %s", err) - } - } - - return nil -} - -func resourceAwsS3BucketCorsUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - bucket := d.Get("bucket").(string) - rawCors := d.Get("cors_rule").([]interface{}) - - if len(rawCors) == 0 { - // Delete CORS - log.Printf("[DEBUG] S3 bucket: %s, delete CORS", bucket) - _, err := s3conn.DeleteBucketCors(&s3.DeleteBucketCorsInput{ - Bucket: aws.String(bucket), - }) - if err != nil { - return fmt.Errorf("Error deleting S3 CORS: %s", err) - } - } else { - // Put CORS - rules := make([]*s3.CORSRule, 0, len(rawCors)) - for _, cors := range rawCors { - corsMap := cors.(map[string]interface{}) - r := &s3.CORSRule{} - for k, v := range corsMap { - log.Printf("[DEBUG] S3 bucket: %s, put CORS: %#v, %#v", bucket, k, v) - if k == "max_age_seconds" { - r.MaxAgeSeconds = aws.Int64(int64(v.(int))) - } else { - vMap := make([]*string, len(v.([]interface{}))) - for i, vv := range v.([]interface{}) { - str := vv.(string) - vMap[i] = aws.String(str) - } - switch k { - case "allowed_headers": - r.AllowedHeaders = vMap - case "allowed_methods": - r.AllowedMethods = vMap - case "allowed_origins": - r.AllowedOrigins = vMap - case "expose_headers": - r.ExposeHeaders = vMap - } - } - } - rules = append(rules, r) - } - corsInput := &s3.PutBucketCorsInput{ - Bucket: aws.String(bucket), - CORSConfiguration: &s3.CORSConfiguration{ - CORSRules: rules, - }, - } - log.Printf("[DEBUG] S3 bucket: %s, put CORS: %#v", bucket, corsInput) - _, err := s3conn.PutBucketCors(corsInput) - if err != nil { - return fmt.Errorf("Error putting S3 CORS: %s", err) - } - } - - return nil -} - -func resourceAwsS3BucketWebsiteUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - ws := d.Get("website").([]interface{}) - - if len(ws) == 1 { - var w map[string]interface{} - if ws[0] != nil { - w = ws[0].(map[string]interface{}) - } else { - w = make(map[string]interface{}) - } - return resourceAwsS3BucketWebsitePut(s3conn, d, w) - } else if len(ws) == 0 { - return resourceAwsS3BucketWebsiteDelete(s3conn, d) - } else { - return fmt.Errorf("Cannot specify more than one website.") - } -} - -func resourceAwsS3BucketWebsitePut(s3conn *s3.S3, d *schema.ResourceData, website map[string]interface{}) error { - bucket := d.Get("bucket").(string) - - var indexDocument, errorDocument, redirectAllRequestsTo, routingRules string - if v, ok := website["index_document"]; ok { - indexDocument = v.(string) - } - if v, ok := website["error_document"]; ok { - errorDocument = v.(string) - } - if v, ok := website["redirect_all_requests_to"]; ok { - redirectAllRequestsTo = v.(string) - } - if v, ok := website["routing_rules"]; ok { - routingRules = v.(string) - } - - if indexDocument == "" && redirectAllRequestsTo == "" { - return fmt.Errorf("Must specify either index_document or redirect_all_requests_to.") - } - - websiteConfiguration := &s3.WebsiteConfiguration{} - - if indexDocument != "" { - websiteConfiguration.IndexDocument = &s3.IndexDocument{Suffix: aws.String(indexDocument)} - } - - if errorDocument != "" { - websiteConfiguration.ErrorDocument = &s3.ErrorDocument{Key: aws.String(errorDocument)} - } - - if redirectAllRequestsTo != "" { - redirect, err := url.Parse(redirectAllRequestsTo) - if err == nil && redirect.Scheme != "" { - var redirectHostBuf bytes.Buffer - redirectHostBuf.WriteString(redirect.Host) - if redirect.Path != "" { - redirectHostBuf.WriteString(redirect.Path) - } - websiteConfiguration.RedirectAllRequestsTo = &s3.RedirectAllRequestsTo{HostName: aws.String(redirectHostBuf.String()), Protocol: aws.String(redirect.Scheme)} - } else { - websiteConfiguration.RedirectAllRequestsTo = &s3.RedirectAllRequestsTo{HostName: aws.String(redirectAllRequestsTo)} - } - } - - if routingRules != "" { - var unmarshaledRules []*s3.RoutingRule - if err := json.Unmarshal([]byte(routingRules), &unmarshaledRules); err != nil { - return err - } - websiteConfiguration.RoutingRules = unmarshaledRules - } - - putInput := &s3.PutBucketWebsiteInput{ - Bucket: aws.String(bucket), - WebsiteConfiguration: websiteConfiguration, - } - - log.Printf("[DEBUG] S3 put bucket website: %#v", putInput) - - _, err := s3conn.PutBucketWebsite(putInput) - if err != nil { - return fmt.Errorf("Error putting S3 website: %s", err) - } - - return nil -} - -func resourceAwsS3BucketWebsiteDelete(s3conn *s3.S3, d *schema.ResourceData) error { - bucket := d.Get("bucket").(string) - deleteInput := &s3.DeleteBucketWebsiteInput{Bucket: aws.String(bucket)} - - log.Printf("[DEBUG] S3 delete bucket website: %#v", deleteInput) - - _, err := s3conn.DeleteBucketWebsite(deleteInput) - if err != nil { - return fmt.Errorf("Error deleting S3 website: %s", err) - } - - d.Set("website_endpoint", "") - d.Set("website_domain", "") - - return nil -} - -func websiteEndpoint(s3conn *s3.S3, d *schema.ResourceData) (*S3Website, error) { - // If the bucket doesn't have a website configuration, return an empty - // endpoint - if _, ok := d.GetOk("website"); !ok { - return nil, nil - } - - bucket := d.Get("bucket").(string) - - // Lookup the region for this bucket - location, err := s3conn.GetBucketLocation( - &s3.GetBucketLocationInput{ - Bucket: aws.String(bucket), - }, - ) - if err != nil { - return nil, err - } - var region string - if location.LocationConstraint != nil { - region = *location.LocationConstraint - } - - return WebsiteEndpoint(bucket, region), nil -} - -func bucketDomainName(bucket string) string { - return fmt.Sprintf("%s.s3.amazonaws.com", bucket) -} - -func WebsiteEndpoint(bucket string, region string) *S3Website { - domain := WebsiteDomainUrl(region) - return &S3Website{Endpoint: fmt.Sprintf("%s.%s", bucket, domain), Domain: domain} -} - -func WebsiteDomainUrl(region string) string { - region = normalizeRegion(region) - - // New regions uses different syntax for website endpoints - // http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html - if isOldRegion(region) { - return fmt.Sprintf("s3-website-%s.amazonaws.com", region) - } - return fmt.Sprintf("s3-website.%s.amazonaws.com", region) -} - -func isOldRegion(region string) bool { - oldRegions := []string{ - "ap-northeast-1", - "ap-southeast-1", - "ap-southeast-2", - "eu-west-1", - "sa-east-1", - "us-east-1", - "us-gov-west-1", - "us-west-1", - "us-west-2", - } - for _, r := range oldRegions { - if region == r { - return true - } - } - return false -} - -func resourceAwsS3BucketAclUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - acl := d.Get("acl").(string) - bucket := d.Get("bucket").(string) - - i := &s3.PutBucketAclInput{ - Bucket: aws.String(bucket), - ACL: aws.String(acl), - } - log.Printf("[DEBUG] S3 put bucket ACL: %#v", i) - - _, err := s3conn.PutBucketAcl(i) - if err != nil { - return fmt.Errorf("Error putting S3 ACL: %s", err) - } - - return nil -} - -func resourceAwsS3BucketVersioningUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - v := d.Get("versioning").([]interface{}) - bucket := d.Get("bucket").(string) - vc := &s3.VersioningConfiguration{} - - if len(v) > 0 { - c := v[0].(map[string]interface{}) - - if c["enabled"].(bool) { - vc.Status = aws.String(s3.BucketVersioningStatusEnabled) - } else { - vc.Status = aws.String(s3.BucketVersioningStatusSuspended) - } - - if c["mfa_delete"].(bool) { - vc.MFADelete = aws.String(s3.MFADeleteEnabled) - } else { - vc.MFADelete = aws.String(s3.MFADeleteDisabled) - } - - } else { - vc.Status = aws.String(s3.BucketVersioningStatusSuspended) - } - - i := &s3.PutBucketVersioningInput{ - Bucket: aws.String(bucket), - VersioningConfiguration: vc, - } - log.Printf("[DEBUG] S3 put bucket versioning: %#v", i) - - _, err := s3conn.PutBucketVersioning(i) - if err != nil { - return fmt.Errorf("Error putting S3 versioning: %s", err) - } - - return nil -} - -func resourceAwsS3BucketLoggingUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - logging := d.Get("logging").(*schema.Set).List() - bucket := d.Get("bucket").(string) - loggingStatus := &s3.BucketLoggingStatus{} - - if len(logging) > 0 { - c := logging[0].(map[string]interface{}) - - loggingEnabled := &s3.LoggingEnabled{} - if val, ok := c["target_bucket"]; ok { - loggingEnabled.TargetBucket = aws.String(val.(string)) - } - if val, ok := c["target_prefix"]; ok { - loggingEnabled.TargetPrefix = aws.String(val.(string)) - } - - loggingStatus.LoggingEnabled = loggingEnabled - } - - i := &s3.PutBucketLoggingInput{ - Bucket: aws.String(bucket), - BucketLoggingStatus: loggingStatus, - } - log.Printf("[DEBUG] S3 put bucket logging: %#v", i) - - _, err := s3conn.PutBucketLogging(i) - if err != nil { - return fmt.Errorf("Error putting S3 logging: %s", err) - } - - return nil -} - -func resourceAwsS3BucketAccelerationUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - bucket := d.Get("bucket").(string) - enableAcceleration := d.Get("acceleration_status").(string) - - i := &s3.PutBucketAccelerateConfigurationInput{ - Bucket: aws.String(bucket), - AccelerateConfiguration: &s3.AccelerateConfiguration{ - Status: aws.String(enableAcceleration), - }, - } - log.Printf("[DEBUG] S3 put bucket acceleration: %#v", i) - - _, err := s3conn.PutBucketAccelerateConfiguration(i) - if err != nil { - return fmt.Errorf("Error putting S3 acceleration: %s", err) - } - - return nil -} - -func resourceAwsS3BucketRequestPayerUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - bucket := d.Get("bucket").(string) - payer := d.Get("request_payer").(string) - - i := &s3.PutBucketRequestPaymentInput{ - Bucket: aws.String(bucket), - RequestPaymentConfiguration: &s3.RequestPaymentConfiguration{ - Payer: aws.String(payer), - }, - } - log.Printf("[DEBUG] S3 put bucket request payer: %#v", i) - - _, err := s3conn.PutBucketRequestPayment(i) - if err != nil { - return fmt.Errorf("Error putting S3 request payer: %s", err) - } - - return nil -} - -func resourceAwsS3BucketReplicationConfigurationUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - bucket := d.Get("bucket").(string) - replicationConfiguration := d.Get("replication_configuration").([]interface{}) - - if len(replicationConfiguration) == 0 { - i := &s3.DeleteBucketReplicationInput{ - Bucket: aws.String(bucket), - } - - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - if _, err := s3conn.DeleteBucketReplication(i); err != nil { - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return fmt.Errorf("Error removing S3 bucket replication: %s", err) - } - return nil - } - - hasVersioning := false - // Validate that bucket versioning is enabled - if versioning, ok := d.GetOk("versioning"); ok { - v := versioning.([]interface{}) - - if v[0].(map[string]interface{})["enabled"].(bool) { - hasVersioning = true - } - } - - if !hasVersioning { - return fmt.Errorf("versioning must be enabled to allow S3 bucket replication") - } - - c := replicationConfiguration[0].(map[string]interface{}) - - rc := &s3.ReplicationConfiguration{} - if val, ok := c["role"]; ok { - rc.Role = aws.String(val.(string)) - } - - rcRules := c["rules"].(*schema.Set).List() - rules := []*s3.ReplicationRule{} - for _, v := range rcRules { - rr := v.(map[string]interface{}) - rcRule := &s3.ReplicationRule{ - Prefix: aws.String(rr["prefix"].(string)), - Status: aws.String(rr["status"].(string)), - } - - if rrid, ok := rr["id"]; ok { - rcRule.ID = aws.String(rrid.(string)) - } - - ruleDestination := &s3.Destination{} - if destination, ok := rr["destination"]; ok { - dest := destination.(*schema.Set).List() - - bd := dest[0].(map[string]interface{}) - ruleDestination.Bucket = aws.String(bd["bucket"].(string)) - - if storageClass, ok := bd["storage_class"]; ok && storageClass != "" { - ruleDestination.StorageClass = aws.String(storageClass.(string)) - } - } - rcRule.Destination = ruleDestination - rules = append(rules, rcRule) - } - - rc.Rules = rules - i := &s3.PutBucketReplicationInput{ - Bucket: aws.String(bucket), - ReplicationConfiguration: rc, - } - log.Printf("[DEBUG] S3 put bucket replication configuration: %#v", i) - - _, err := s3conn.PutBucketReplication(i) - if err != nil { - return fmt.Errorf("Error putting S3 replication configuration: %s", err) - } - - return nil -} - -func resourceAwsS3BucketLifecycleUpdate(s3conn *s3.S3, d *schema.ResourceData) error { - bucket := d.Get("bucket").(string) - - lifecycleRules := d.Get("lifecycle_rule").([]interface{}) - - if len(lifecycleRules) == 0 { - i := &s3.DeleteBucketLifecycleInput{ - Bucket: aws.String(bucket), - } - - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - if _, err := s3conn.DeleteBucketLifecycle(i); err != nil { - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return fmt.Errorf("Error removing S3 lifecycle: %s", err) - } - return nil - } - - rules := make([]*s3.LifecycleRule, 0, len(lifecycleRules)) - - for i, lifecycleRule := range lifecycleRules { - r := lifecycleRule.(map[string]interface{}) - - rule := &s3.LifecycleRule{ - Prefix: aws.String(r["prefix"].(string)), - } - - // ID - if val, ok := r["id"].(string); ok && val != "" { - rule.ID = aws.String(val) - } else { - rule.ID = aws.String(resource.PrefixedUniqueId("tf-s3-lifecycle-")) - } - - // Enabled - if val, ok := r["enabled"].(bool); ok && val { - rule.Status = aws.String(s3.ExpirationStatusEnabled) - } else { - rule.Status = aws.String(s3.ExpirationStatusDisabled) - } - - // AbortIncompleteMultipartUpload - if val, ok := r["abort_incomplete_multipart_upload_days"].(int); ok && val > 0 { - rule.AbortIncompleteMultipartUpload = &s3.AbortIncompleteMultipartUpload{ - DaysAfterInitiation: aws.Int64(int64(val)), - } - } - - // Expiration - expiration := d.Get(fmt.Sprintf("lifecycle_rule.%d.expiration", i)).(*schema.Set).List() - if len(expiration) > 0 { - e := expiration[0].(map[string]interface{}) - i := &s3.LifecycleExpiration{} - - if val, ok := e["date"].(string); ok && val != "" { - t, err := time.Parse(time.RFC3339, fmt.Sprintf("%sT00:00:00Z", val)) - if err != nil { - return fmt.Errorf("Error Parsing AWS S3 Bucket Lifecycle Expiration Date: %s", err.Error()) - } - i.Date = aws.Time(t) - } else if val, ok := e["days"].(int); ok && val > 0 { - i.Days = aws.Int64(int64(val)) - } else if val, ok := e["expired_object_delete_marker"].(bool); ok { - i.ExpiredObjectDeleteMarker = aws.Bool(val) - } - rule.Expiration = i - } - - // NoncurrentVersionExpiration - nc_expiration := d.Get(fmt.Sprintf("lifecycle_rule.%d.noncurrent_version_expiration", i)).(*schema.Set).List() - if len(nc_expiration) > 0 { - e := nc_expiration[0].(map[string]interface{}) - - if val, ok := e["days"].(int); ok && val > 0 { - rule.NoncurrentVersionExpiration = &s3.NoncurrentVersionExpiration{ - NoncurrentDays: aws.Int64(int64(val)), - } - } - } - - // Transitions - transitions := d.Get(fmt.Sprintf("lifecycle_rule.%d.transition", i)).(*schema.Set).List() - if len(transitions) > 0 { - rule.Transitions = make([]*s3.Transition, 0, len(transitions)) - for _, transition := range transitions { - transition := transition.(map[string]interface{}) - i := &s3.Transition{} - if val, ok := transition["date"].(string); ok && val != "" { - t, err := time.Parse(time.RFC3339, fmt.Sprintf("%sT00:00:00Z", val)) - if err != nil { - return fmt.Errorf("Error Parsing AWS S3 Bucket Lifecycle Expiration Date: %s", err.Error()) - } - i.Date = aws.Time(t) - } else if val, ok := transition["days"].(int); ok && val > 0 { - i.Days = aws.Int64(int64(val)) - } - if val, ok := transition["storage_class"].(string); ok && val != "" { - i.StorageClass = aws.String(val) - } - - rule.Transitions = append(rule.Transitions, i) - } - } - // NoncurrentVersionTransitions - nc_transitions := d.Get(fmt.Sprintf("lifecycle_rule.%d.noncurrent_version_transition", i)).(*schema.Set).List() - if len(nc_transitions) > 0 { - rule.NoncurrentVersionTransitions = make([]*s3.NoncurrentVersionTransition, 0, len(nc_transitions)) - for _, transition := range nc_transitions { - transition := transition.(map[string]interface{}) - i := &s3.NoncurrentVersionTransition{} - if val, ok := transition["days"].(int); ok && val > 0 { - i.NoncurrentDays = aws.Int64(int64(val)) - } - if val, ok := transition["storage_class"].(string); ok && val != "" { - i.StorageClass = aws.String(val) - } - - rule.NoncurrentVersionTransitions = append(rule.NoncurrentVersionTransitions, i) - } - } - - rules = append(rules, rule) - } - - i := &s3.PutBucketLifecycleConfigurationInput{ - Bucket: aws.String(bucket), - LifecycleConfiguration: &s3.BucketLifecycleConfiguration{ - Rules: rules, - }, - } - - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - if _, err := s3conn.PutBucketLifecycleConfiguration(i); err != nil { - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return fmt.Errorf("Error putting S3 lifecycle: %s", err) - } - - return nil -} - -func flattenAwsS3BucketReplicationConfiguration(r *s3.ReplicationConfiguration) []map[string]interface{} { - replication_configuration := make([]map[string]interface{}, 0, 1) - m := make(map[string]interface{}) - - if r.Role != nil && *r.Role != "" { - m["role"] = *r.Role - } - - rules := make([]interface{}, 0, len(r.Rules)) - for _, v := range r.Rules { - t := make(map[string]interface{}) - if v.Destination != nil { - rd := make(map[string]interface{}) - if v.Destination.Bucket != nil { - rd["bucket"] = *v.Destination.Bucket - } - if v.Destination.StorageClass != nil { - rd["storage_class"] = *v.Destination.StorageClass - } - t["destination"] = schema.NewSet(destinationHash, []interface{}{rd}) - } - - if v.ID != nil { - t["id"] = *v.ID - } - if v.Prefix != nil { - t["prefix"] = *v.Prefix - } - if v.Status != nil { - t["status"] = *v.Status - } - rules = append(rules, t) - } - m["rules"] = schema.NewSet(rulesHash, rules) - - replication_configuration = append(replication_configuration, m) - - return replication_configuration -} - -func normalizeRoutingRules(w []*s3.RoutingRule) (string, error) { - withNulls, err := json.Marshal(w) - if err != nil { - return "", err - } - - var rules []map[string]interface{} - if err := json.Unmarshal(withNulls, &rules); err != nil { - return "", err - } - - var cleanRules []map[string]interface{} - for _, rule := range rules { - cleanRules = append(cleanRules, removeNil(rule)) - } - - withoutNulls, err := json.Marshal(cleanRules) - if err != nil { - return "", err - } - - return string(withoutNulls), nil -} - -func removeNil(data map[string]interface{}) map[string]interface{} { - withoutNil := make(map[string]interface{}) - - for k, v := range data { - if v == nil { - continue - } - - switch v.(type) { - case map[string]interface{}: - withoutNil[k] = removeNil(v.(map[string]interface{})) - default: - withoutNil[k] = v - } - } - - return withoutNil -} - -// DEPRECATED. Please consider using `normalizeJsonString` function instead. -func normalizeJson(jsonString interface{}) string { - if jsonString == nil || jsonString == "" { - return "" - } - var j interface{} - err := json.Unmarshal([]byte(jsonString.(string)), &j) - if err != nil { - return fmt.Sprintf("Error parsing JSON: %s", err) - } - b, _ := json.Marshal(j) - return string(b[:]) -} - -func normalizeRegion(region string) string { - // Default to us-east-1 if the bucket doesn't have a region: - // http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html - if region == "" { - region = "us-east-1" - } - - return region -} - -func validateS3BucketAccelerationStatus(v interface{}, k string) (ws []string, errors []error) { - validTypes := map[string]struct{}{ - "Enabled": struct{}{}, - "Suspended": struct{}{}, - } - - if _, ok := validTypes[v.(string)]; !ok { - errors = append(errors, fmt.Errorf("S3 Bucket Acceleration Status %q is invalid, must be %q or %q", v.(string), "Enabled", "Suspended")) - } - return -} - -func validateS3BucketRequestPayerType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != s3.PayerRequester && value != s3.PayerBucketOwner { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Request Payer type %q. Valid types are either %q or %q", - k, value, s3.PayerRequester, s3.PayerBucketOwner)) - } - return -} - -// validateS3BucketName validates any S3 bucket name that is not inside the us-east-1 region. -// Buckets outside of this region have to be DNS-compliant. After the same restrictions are -// applied to buckets in the us-east-1 region, this function can be refactored as a SchemaValidateFunc -func validateS3BucketName(value string, region string) error { - if region != "us-east-1" { - if (len(value) < 3) || (len(value) > 63) { - return fmt.Errorf("%q must contain from 3 to 63 characters", value) - } - if !regexp.MustCompile(`^[0-9a-z-.]+$`).MatchString(value) { - return fmt.Errorf("only lowercase alphanumeric characters and hyphens allowed in %q", value) - } - if regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$`).MatchString(value) { - return fmt.Errorf("%q must not be formatted as an IP address", value) - } - if strings.HasPrefix(value, `.`) { - return fmt.Errorf("%q cannot start with a period", value) - } - if strings.HasSuffix(value, `.`) { - return fmt.Errorf("%q cannot end with a period", value) - } - if strings.Contains(value, `..`) { - return fmt.Errorf("%q can be only one period between labels", value) - } - } else { - if len(value) > 255 { - return fmt.Errorf("%q must contain less than 256 characters", value) - } - if !regexp.MustCompile(`^[0-9a-zA-Z-._]+$`).MatchString(value) { - return fmt.Errorf("only alphanumeric characters, hyphens, periods, and underscores allowed in %q", value) - } - } - return nil -} - -func expirationHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - if v, ok := m["date"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["days"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(int))) - } - if v, ok := m["expired_object_delete_marker"]; ok { - buf.WriteString(fmt.Sprintf("%t-", v.(bool))) - } - return hashcode.String(buf.String()) -} - -func transitionHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - if v, ok := m["date"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["days"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(int))) - } - if v, ok := m["storage_class"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - return hashcode.String(buf.String()) -} - -func rulesHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - if v, ok := m["id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["prefix"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["status"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - return hashcode.String(buf.String()) -} - -func destinationHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - if v, ok := m["bucket"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["storage_class"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - return hashcode.String(buf.String()) -} - -type S3Website struct { - Endpoint, Domain string -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_notification.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_notification.go deleted file mode 100644 index f3e19b4..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_notification.go +++ /dev/null @@ -1,467 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/s3" -) - -func resourceAwsS3BucketNotification() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsS3BucketNotificationPut, - Read: resourceAwsS3BucketNotificationRead, - Update: resourceAwsS3BucketNotificationPut, - Delete: resourceAwsS3BucketNotificationDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "bucket": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "topic": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "filter_prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "filter_suffix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "topic_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "events": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - }, - }, - - "queue": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "filter_prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "filter_suffix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "queue_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "events": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - }, - }, - - "lambda_function": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "filter_prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "filter_suffix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "lambda_function_arn": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "events": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - }, - }, - }, - } -} - -func resourceAwsS3BucketNotificationPut(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - bucket := d.Get("bucket").(string) - - // TopicNotifications - topicNotifications := d.Get("topic").([]interface{}) - topicConfigs := make([]*s3.TopicConfiguration, 0, len(topicNotifications)) - for i, c := range topicNotifications { - tc := &s3.TopicConfiguration{} - - c := c.(map[string]interface{}) - - // Id - if val, ok := c["id"].(string); ok && val != "" { - tc.Id = aws.String(val) - } else { - tc.Id = aws.String(resource.PrefixedUniqueId("tf-s3-topic-")) - } - - // TopicArn - if val, ok := c["topic_arn"].(string); ok { - tc.TopicArn = aws.String(val) - } - - // Events - events := d.Get(fmt.Sprintf("topic.%d.events", i)).(*schema.Set).List() - tc.Events = make([]*string, 0, len(events)) - for _, e := range events { - tc.Events = append(tc.Events, aws.String(e.(string))) - } - - // Filter - filterRules := make([]*s3.FilterRule, 0, 2) - if val, ok := c["filter_prefix"].(string); ok && val != "" { - filterRule := &s3.FilterRule{ - Name: aws.String("prefix"), - Value: aws.String(val), - } - filterRules = append(filterRules, filterRule) - } - if val, ok := c["filter_suffix"].(string); ok && val != "" { - filterRule := &s3.FilterRule{ - Name: aws.String("suffix"), - Value: aws.String(val), - } - filterRules = append(filterRules, filterRule) - } - if len(filterRules) > 0 { - tc.Filter = &s3.NotificationConfigurationFilter{ - Key: &s3.KeyFilter{ - FilterRules: filterRules, - }, - } - } - topicConfigs = append(topicConfigs, tc) - } - - // SQS - queueNotifications := d.Get("queue").([]interface{}) - queueConfigs := make([]*s3.QueueConfiguration, 0, len(queueNotifications)) - for i, c := range queueNotifications { - qc := &s3.QueueConfiguration{} - - c := c.(map[string]interface{}) - - // Id - if val, ok := c["id"].(string); ok && val != "" { - qc.Id = aws.String(val) - } else { - qc.Id = aws.String(resource.PrefixedUniqueId("tf-s3-queue-")) - } - - // QueueArn - if val, ok := c["queue_arn"].(string); ok { - qc.QueueArn = aws.String(val) - } - - // Events - events := d.Get(fmt.Sprintf("queue.%d.events", i)).(*schema.Set).List() - qc.Events = make([]*string, 0, len(events)) - for _, e := range events { - qc.Events = append(qc.Events, aws.String(e.(string))) - } - - // Filter - filterRules := make([]*s3.FilterRule, 0, 2) - if val, ok := c["filter_prefix"].(string); ok && val != "" { - filterRule := &s3.FilterRule{ - Name: aws.String("prefix"), - Value: aws.String(val), - } - filterRules = append(filterRules, filterRule) - } - if val, ok := c["filter_suffix"].(string); ok && val != "" { - filterRule := &s3.FilterRule{ - Name: aws.String("suffix"), - Value: aws.String(val), - } - filterRules = append(filterRules, filterRule) - } - if len(filterRules) > 0 { - qc.Filter = &s3.NotificationConfigurationFilter{ - Key: &s3.KeyFilter{ - FilterRules: filterRules, - }, - } - } - queueConfigs = append(queueConfigs, qc) - } - - // Lambda - lambdaFunctionNotifications := d.Get("lambda_function").([]interface{}) - lambdaConfigs := make([]*s3.LambdaFunctionConfiguration, 0, len(lambdaFunctionNotifications)) - for i, c := range lambdaFunctionNotifications { - lc := &s3.LambdaFunctionConfiguration{} - - c := c.(map[string]interface{}) - - // Id - if val, ok := c["id"].(string); ok && val != "" { - lc.Id = aws.String(val) - } else { - lc.Id = aws.String(resource.PrefixedUniqueId("tf-s3-lambda-")) - } - - // LambdaFunctionArn - if val, ok := c["lambda_function_arn"].(string); ok { - lc.LambdaFunctionArn = aws.String(val) - } - - // Events - events := d.Get(fmt.Sprintf("lambda_function.%d.events", i)).(*schema.Set).List() - lc.Events = make([]*string, 0, len(events)) - for _, e := range events { - lc.Events = append(lc.Events, aws.String(e.(string))) - } - - // Filter - filterRules := make([]*s3.FilterRule, 0, 2) - if val, ok := c["filter_prefix"].(string); ok && val != "" { - filterRule := &s3.FilterRule{ - Name: aws.String("prefix"), - Value: aws.String(val), - } - filterRules = append(filterRules, filterRule) - } - if val, ok := c["filter_suffix"].(string); ok && val != "" { - filterRule := &s3.FilterRule{ - Name: aws.String("suffix"), - Value: aws.String(val), - } - filterRules = append(filterRules, filterRule) - } - if len(filterRules) > 0 { - lc.Filter = &s3.NotificationConfigurationFilter{ - Key: &s3.KeyFilter{ - FilterRules: filterRules, - }, - } - } - lambdaConfigs = append(lambdaConfigs, lc) - } - - notificationConfiguration := &s3.NotificationConfiguration{} - if len(lambdaConfigs) > 0 { - notificationConfiguration.LambdaFunctionConfigurations = lambdaConfigs - } - if len(queueConfigs) > 0 { - notificationConfiguration.QueueConfigurations = queueConfigs - } - if len(topicConfigs) > 0 { - notificationConfiguration.TopicConfigurations = topicConfigs - } - i := &s3.PutBucketNotificationConfigurationInput{ - Bucket: aws.String(bucket), - NotificationConfiguration: notificationConfiguration, - } - - log.Printf("[DEBUG] S3 bucket: %s, Putting notification: %v", bucket, i) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - if _, err := s3conn.PutBucketNotificationConfiguration(i); err != nil { - if awserr, ok := err.(awserr.Error); ok { - switch awserr.Message() { - case "Unable to validate the following destination configurations": - return resource.RetryableError(awserr) - } - } - // Didn't recognize the error, so shouldn't retry. - return resource.NonRetryableError(err) - } - // Successful put configuration - return nil - }) - if err != nil { - return fmt.Errorf("Error putting S3 notification configuration: %s", err) - } - - d.SetId(bucket) - - return resourceAwsS3BucketNotificationRead(d, meta) -} - -func resourceAwsS3BucketNotificationDelete(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - i := &s3.PutBucketNotificationConfigurationInput{ - Bucket: aws.String(d.Id()), - NotificationConfiguration: &s3.NotificationConfiguration{}, - } - - log.Printf("[DEBUG] S3 bucket: %s, Deleting notification: %v", d.Id(), i) - _, err := s3conn.PutBucketNotificationConfiguration(i) - if err != nil { - return fmt.Errorf("Error deleting S3 notification configuration: %s", err) - } - - d.SetId("") - - return nil -} - -func resourceAwsS3BucketNotificationRead(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - var err error - _, err = s3conn.HeadBucket(&s3.HeadBucketInput{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - if awsError, ok := err.(awserr.RequestFailure); ok && awsError.StatusCode() == 404 { - log.Printf("[WARN] S3 Bucket (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } else { - // some of the AWS SDK's errors can be empty strings, so let's add - // some additional context. - return fmt.Errorf("error reading S3 bucket \"%s\": %s", d.Id(), err) - } - } - - // Read the notification configuration - notificationConfigs, err := s3conn.GetBucketNotificationConfiguration(&s3.GetBucketNotificationConfigurationRequest{ - Bucket: aws.String(d.Id()), - }) - if err != nil { - return err - } - log.Printf("[DEBUG] S3 Bucket: %s, get notification: %v", d.Id(), notificationConfigs) - // Topic Notification - if err := d.Set("topic", flattenTopicConfigurations(notificationConfigs.TopicConfigurations)); err != nil { - return fmt.Errorf("error reading S3 bucket \"%s\" topic notification: %s", d.Id(), err) - } - - // SQS Notification - if err := d.Set("queue", flattenQueueConfigurations(notificationConfigs.QueueConfigurations)); err != nil { - return fmt.Errorf("error reading S3 bucket \"%s\" queue notification: %s", d.Id(), err) - } - - // Lambda Notification - if err := d.Set("lambda_function", flattenLambdaFunctionConfigurations(notificationConfigs.LambdaFunctionConfigurations)); err != nil { - return fmt.Errorf("error reading S3 bucket \"%s\" lambda function notification: %s", d.Id(), err) - } - - return nil -} - -func flattenNotificationConfigurationFilter(filter *s3.NotificationConfigurationFilter) map[string]interface{} { - filterRules := map[string]interface{}{} - for _, f := range filter.Key.FilterRules { - if strings.ToLower(*f.Name) == s3.FilterRuleNamePrefix { - filterRules["filter_prefix"] = *f.Value - } - if strings.ToLower(*f.Name) == s3.FilterRuleNameSuffix { - filterRules["filter_suffix"] = *f.Value - } - } - return filterRules -} - -func flattenTopicConfigurations(configs []*s3.TopicConfiguration) []map[string]interface{} { - topicNotifications := make([]map[string]interface{}, 0, len(configs)) - for _, notification := range configs { - var conf map[string]interface{} - if filter := notification.Filter; filter != nil { - conf = flattenNotificationConfigurationFilter(filter) - } else { - conf = map[string]interface{}{} - } - - conf["id"] = *notification.Id - conf["events"] = schema.NewSet(schema.HashString, flattenStringList(notification.Events)) - conf["topic_arn"] = *notification.TopicArn - topicNotifications = append(topicNotifications, conf) - } - - return topicNotifications -} - -func flattenQueueConfigurations(configs []*s3.QueueConfiguration) []map[string]interface{} { - queueNotifications := make([]map[string]interface{}, 0, len(configs)) - for _, notification := range configs { - var conf map[string]interface{} - if filter := notification.Filter; filter != nil { - conf = flattenNotificationConfigurationFilter(filter) - } else { - conf = map[string]interface{}{} - } - - conf["id"] = *notification.Id - conf["events"] = schema.NewSet(schema.HashString, flattenStringList(notification.Events)) - conf["queue_arn"] = *notification.QueueArn - queueNotifications = append(queueNotifications, conf) - } - - return queueNotifications -} - -func flattenLambdaFunctionConfigurations(configs []*s3.LambdaFunctionConfiguration) []map[string]interface{} { - lambdaFunctionNotifications := make([]map[string]interface{}, 0, len(configs)) - for _, notification := range configs { - var conf map[string]interface{} - if filter := notification.Filter; filter != nil { - conf = flattenNotificationConfigurationFilter(filter) - } else { - conf = map[string]interface{}{} - } - - conf["id"] = *notification.Id - conf["events"] = schema.NewSet(schema.HashString, flattenStringList(notification.Events)) - conf["lambda_function_arn"] = *notification.LambdaFunctionArn - lambdaFunctionNotifications = append(lambdaFunctionNotifications, conf) - } - - return lambdaFunctionNotifications -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_object.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_object.go deleted file mode 100644 index f9828dc..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_object.go +++ /dev/null @@ -1,397 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "io" - "log" - "net/url" - "os" - "sort" - "strings" - - "github.com/hashicorp/terraform/helper/schema" - "github.com/mitchellh/go-homedir" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/kms" - "github.com/aws/aws-sdk-go/service/s3" -) - -func resourceAwsS3BucketObject() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsS3BucketObjectPut, - Read: resourceAwsS3BucketObjectRead, - Update: resourceAwsS3BucketObjectPut, - Delete: resourceAwsS3BucketObjectDelete, - - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "acl": { - Type: schema.TypeString, - Default: "private", - Optional: true, - ValidateFunc: validateS3BucketObjectAclType, - }, - - "cache_control": { - Type: schema.TypeString, - Optional: true, - }, - - "content_disposition": { - Type: schema.TypeString, - Optional: true, - }, - - "content_encoding": { - Type: schema.TypeString, - Optional: true, - }, - - "content_language": { - Type: schema.TypeString, - Optional: true, - }, - - "content_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "key": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "source": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"content"}, - }, - - "content": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"source"}, - }, - - "storage_class": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateS3BucketObjectStorageClassType, - }, - - "server_side_encryption": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateS3BucketObjectServerSideEncryption, - Computed: true, - }, - - "kms_key_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateArn, - }, - - "etag": { - Type: schema.TypeString, - // This will conflict with SSE-C and SSE-KMS encryption and multi-part upload - // if/when it's actually implemented. The Etag then won't match raw-file MD5. - // See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html - Optional: true, - Computed: true, - ConflictsWith: []string{"kms_key_id", "server_side_encryption"}, - }, - - "version_id": { - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsS3BucketObjectPut(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - var body io.ReadSeeker - - if v, ok := d.GetOk("source"); ok { - source := v.(string) - path, err := homedir.Expand(source) - if err != nil { - return fmt.Errorf("Error expanding homedir in source (%s): %s", source, err) - } - file, err := os.Open(path) - if err != nil { - return fmt.Errorf("Error opening S3 bucket object source (%s): %s", source, err) - } - - body = file - } else if v, ok := d.GetOk("content"); ok { - content := v.(string) - body = bytes.NewReader([]byte(content)) - } else { - return fmt.Errorf("Must specify \"source\" or \"content\" field") - } - - bucket := d.Get("bucket").(string) - key := d.Get("key").(string) - - putInput := &s3.PutObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - ACL: aws.String(d.Get("acl").(string)), - Body: body, - } - - if v, ok := d.GetOk("storage_class"); ok { - putInput.StorageClass = aws.String(v.(string)) - } - - if v, ok := d.GetOk("cache_control"); ok { - putInput.CacheControl = aws.String(v.(string)) - } - - if v, ok := d.GetOk("content_type"); ok { - putInput.ContentType = aws.String(v.(string)) - } - - if v, ok := d.GetOk("content_encoding"); ok { - putInput.ContentEncoding = aws.String(v.(string)) - } - - if v, ok := d.GetOk("content_language"); ok { - putInput.ContentLanguage = aws.String(v.(string)) - } - - if v, ok := d.GetOk("content_disposition"); ok { - putInput.ContentDisposition = aws.String(v.(string)) - } - - if v, ok := d.GetOk("server_side_encryption"); ok { - putInput.ServerSideEncryption = aws.String(v.(string)) - } - - if v, ok := d.GetOk("kms_key_id"); ok { - putInput.SSEKMSKeyId = aws.String(v.(string)) - putInput.ServerSideEncryption = aws.String(s3.ServerSideEncryptionAwsKms) - } - - if v, ok := d.GetOk("tags"); ok { - // The tag-set must be encoded as URL Query parameters. - values := url.Values{} - for k, v := range v.(map[string]interface{}) { - values.Add(k, v.(string)) - } - putInput.Tagging = aws.String(values.Encode()) - } - - resp, err := s3conn.PutObject(putInput) - if err != nil { - return fmt.Errorf("Error putting object in S3 bucket (%s): %s", bucket, err) - } - - // See https://forums.aws.amazon.com/thread.jspa?threadID=44003 - d.Set("etag", strings.Trim(*resp.ETag, `"`)) - - d.Set("version_id", resp.VersionId) - d.SetId(key) - return resourceAwsS3BucketObjectRead(d, meta) -} - -func resourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - bucket := d.Get("bucket").(string) - key := d.Get("key").(string) - - resp, err := s3conn.HeadObject( - &s3.HeadObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - }) - - if err != nil { - // If S3 returns a 404 Request Failure, mark the object as destroyed - if awsErr, ok := err.(awserr.RequestFailure); ok && awsErr.StatusCode() == 404 { - d.SetId("") - log.Printf("[WARN] Error Reading Object (%s), object not found (HTTP status 404)", key) - return nil - } - return err - } - log.Printf("[DEBUG] Reading S3 Bucket Object meta: %s", resp) - - d.Set("cache_control", resp.CacheControl) - d.Set("content_disposition", resp.ContentDisposition) - d.Set("content_encoding", resp.ContentEncoding) - d.Set("content_language", resp.ContentLanguage) - d.Set("content_type", resp.ContentType) - d.Set("version_id", resp.VersionId) - d.Set("server_side_encryption", resp.ServerSideEncryption) - - // Only set non-default KMS key ID (one that doesn't match default) - if resp.SSEKMSKeyId != nil { - // retrieve S3 KMS Default Master Key - kmsconn := meta.(*AWSClient).kmsconn - kmsresp, err := kmsconn.DescribeKey(&kms.DescribeKeyInput{ - KeyId: aws.String("alias/aws/s3"), - }) - if err != nil { - return fmt.Errorf("Failed to describe default S3 KMS key (alias/aws/s3): %s", err) - } - - if *resp.SSEKMSKeyId != *kmsresp.KeyMetadata.Arn { - log.Printf("[DEBUG] S3 object is encrypted using a non-default KMS Key ID: %s", *resp.SSEKMSKeyId) - d.Set("kms_key_id", resp.SSEKMSKeyId) - } - } - d.Set("etag", strings.Trim(*resp.ETag, `"`)) - - // The "STANDARD" (which is also the default) storage - // class when set would not be included in the results. - d.Set("storage_class", s3.StorageClassStandard) - if resp.StorageClass != nil { - d.Set("storage_class", resp.StorageClass) - } - - tagResp, err := s3conn.GetObjectTagging( - &s3.GetObjectTaggingInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - }) - if err != nil { - return err - } - d.Set("tags", tagsToMapS3(tagResp.TagSet)) - - return nil -} - -func resourceAwsS3BucketObjectDelete(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - bucket := d.Get("bucket").(string) - key := d.Get("key").(string) - - if _, ok := d.GetOk("version_id"); ok { - // Bucket is versioned, we need to delete all versions - vInput := s3.ListObjectVersionsInput{ - Bucket: aws.String(bucket), - Prefix: aws.String(key), - } - out, err := s3conn.ListObjectVersions(&vInput) - if err != nil { - return fmt.Errorf("Failed listing S3 object versions: %s", err) - } - - for _, v := range out.Versions { - input := s3.DeleteObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - VersionId: v.VersionId, - } - _, err := s3conn.DeleteObject(&input) - if err != nil { - return fmt.Errorf("Error deleting S3 object version of %s:\n %s:\n %s", - key, v, err) - } - } - } else { - // Just delete the object - input := s3.DeleteObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - } - _, err := s3conn.DeleteObject(&input) - if err != nil { - return fmt.Errorf("Error deleting S3 bucket object: %s Bucket: %q Object: %q", err, bucket, key) - } - } - - return nil -} - -func validateS3BucketObjectAclType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - cannedAcls := map[string]bool{ - s3.ObjectCannedACLPrivate: true, - s3.ObjectCannedACLPublicRead: true, - s3.ObjectCannedACLPublicReadWrite: true, - s3.ObjectCannedACLAuthenticatedRead: true, - s3.ObjectCannedACLAwsExecRead: true, - s3.ObjectCannedACLBucketOwnerRead: true, - s3.ObjectCannedACLBucketOwnerFullControl: true, - } - - sentenceJoin := func(m map[string]bool) string { - keys := make([]string, 0, len(m)) - for k := range m { - keys = append(keys, fmt.Sprintf("%q", k)) - } - sort.Strings(keys) - - length := len(keys) - words := make([]string, length) - copy(words, keys) - - words[length-1] = fmt.Sprintf("or %s", words[length-1]) - return strings.Join(words, ", ") - } - - if _, ok := cannedAcls[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q contains an invalid canned ACL type %q. Valid types are either %s", - k, value, sentenceJoin(cannedAcls))) - } - return -} - -func validateS3BucketObjectStorageClassType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - storageClass := map[string]bool{ - s3.StorageClassStandard: true, - s3.StorageClassReducedRedundancy: true, - s3.StorageClassStandardIa: true, - } - - if _, ok := storageClass[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Storage Class type %q. Valid types are either %q, %q, or %q", - k, value, s3.StorageClassStandard, s3.StorageClassReducedRedundancy, - s3.StorageClassStandardIa)) - } - return -} - -func validateS3BucketObjectServerSideEncryption(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - serverSideEncryption := map[string]bool{ - s3.ServerSideEncryptionAes256: true, - s3.ServerSideEncryptionAwsKms: true, - } - - if _, ok := serverSideEncryption[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Server Side Encryption value %q. Valid values are %q and %q", - k, value, s3.ServerSideEncryptionAes256, s3.ServerSideEncryptionAwsKms)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_policy.go deleted file mode 100644 index 593d144..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_s3_bucket_policy.go +++ /dev/null @@ -1,110 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsS3BucketPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsS3BucketPolicyPut, - Read: resourceAwsS3BucketPolicyRead, - Update: resourceAwsS3BucketPolicyPut, - Delete: resourceAwsS3BucketPolicyDelete, - - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "policy": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - }, - } -} - -func resourceAwsS3BucketPolicyPut(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - bucket := d.Get("bucket").(string) - policy := d.Get("policy").(string) - - d.SetId(bucket) - - log.Printf("[DEBUG] S3 bucket: %s, put policy: %s", bucket, policy) - - params := &s3.PutBucketPolicyInput{ - Bucket: aws.String(bucket), - Policy: aws.String(policy), - } - - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - if _, err := s3conn.PutBucketPolicy(params); err != nil { - if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "MalformedPolicy" { - return resource.RetryableError(awserr) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return fmt.Errorf("Error putting S3 policy: %s", err) - } - - return nil -} - -func resourceAwsS3BucketPolicyRead(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - log.Printf("[DEBUG] S3 bucket policy, read for bucket: %s", d.Id()) - pol, err := s3conn.GetBucketPolicy(&s3.GetBucketPolicyInput{ - Bucket: aws.String(d.Id()), - }) - - v := "" - if err == nil && pol.Policy != nil { - v = *pol.Policy - } - if err := d.Set("policy", v); err != nil { - return err - } - - return nil -} - -func resourceAwsS3BucketPolicyDelete(d *schema.ResourceData, meta interface{}) error { - s3conn := meta.(*AWSClient).s3conn - - bucket := d.Get("bucket").(string) - - log.Printf("[DEBUG] S3 bucket: %s, delete policy", bucket) - _, err := s3conn.DeleteBucketPolicy(&s3.DeleteBucketPolicyInput{ - Bucket: aws.String(bucket), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchBucket" { - return nil - } - return fmt.Errorf("Error deleting S3 policy: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group.go deleted file mode 100644 index 4598a44..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group.go +++ /dev/null @@ -1,1176 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "sort" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSecurityGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSecurityGroupCreate, - Read: resourceAwsSecurityGroupRead, - Update: resourceAwsSecurityGroupUpdate, - Delete: resourceAwsSecurityGroupDelete, - Importer: &schema.ResourceImporter{ - State: resourceAwsSecurityGroupImportState, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"name_prefix"}, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters", k)) - } - return - }, - }, - - "name_prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 100 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 100 characters, name is limited to 255", k)) - } - return - }, - }, - - "description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters", k)) - } - return - }, - }, - - "vpc_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "ingress": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "from_port": { - Type: schema.TypeInt, - Required: true, - }, - - "to_port": { - Type: schema.TypeInt, - Required: true, - }, - - "protocol": { - Type: schema.TypeString, - Required: true, - StateFunc: protocolStateFunc, - }, - - "cidr_blocks": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "ipv6_cidr_blocks": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "security_groups": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "self": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - }, - Set: resourceAwsSecurityGroupRuleHash, - }, - - "egress": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "from_port": { - Type: schema.TypeInt, - Required: true, - }, - - "to_port": { - Type: schema.TypeInt, - Required: true, - }, - - "protocol": { - Type: schema.TypeString, - Required: true, - StateFunc: protocolStateFunc, - }, - - "cidr_blocks": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "ipv6_cidr_blocks": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "prefix_list_ids": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "security_groups": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "self": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - }, - Set: resourceAwsSecurityGroupRuleHash, - }, - - "owner_id": { - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - securityGroupOpts := &ec2.CreateSecurityGroupInput{} - - if v, ok := d.GetOk("vpc_id"); ok { - securityGroupOpts.VpcId = aws.String(v.(string)) - } - - if v := d.Get("description"); v != nil { - securityGroupOpts.Description = aws.String(v.(string)) - } - - var groupName string - if v, ok := d.GetOk("name"); ok { - groupName = v.(string) - } else if v, ok := d.GetOk("name_prefix"); ok { - groupName = resource.PrefixedUniqueId(v.(string)) - } else { - groupName = resource.UniqueId() - } - securityGroupOpts.GroupName = aws.String(groupName) - - var err error - log.Printf( - "[DEBUG] Security Group create configuration: %#v", securityGroupOpts) - createResp, err := conn.CreateSecurityGroup(securityGroupOpts) - if err != nil { - return fmt.Errorf("Error creating Security Group: %s", err) - } - - d.SetId(*createResp.GroupId) - - log.Printf("[INFO] Security Group ID: %s", d.Id()) - - // Wait for the security group to truly exist - log.Printf( - "[DEBUG] Waiting for Security Group (%s) to exist", - d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{""}, - Target: []string{"exists"}, - Refresh: SGStateRefreshFunc(conn, d.Id()), - Timeout: 1 * time.Minute, - } - - resp, err := stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Security Group (%s) to become available: %s", - d.Id(), err) - } - - if err := setTags(conn, d); err != nil { - return err - } - - // AWS defaults all Security Groups to have an ALLOW ALL egress rule. Here we - // revoke that rule, so users don't unknowingly have/use it. - group := resp.(*ec2.SecurityGroup) - if group.VpcId != nil && *group.VpcId != "" { - log.Printf("[DEBUG] Revoking default egress rule for Security Group for %s", d.Id()) - - req := &ec2.RevokeSecurityGroupEgressInput{ - GroupId: createResp.GroupId, - IpPermissions: []*ec2.IpPermission{ - { - FromPort: aws.Int64(int64(0)), - ToPort: aws.Int64(int64(0)), - IpRanges: []*ec2.IpRange{ - { - CidrIp: aws.String("0.0.0.0/0"), - }, - }, - IpProtocol: aws.String("-1"), - }, - }, - } - - if _, err = conn.RevokeSecurityGroupEgress(req); err != nil { - return fmt.Errorf( - "Error revoking default egress rule for Security Group (%s): %s", - d.Id(), err) - } - - } - - return resourceAwsSecurityGroupUpdate(d, meta) -} - -func resourceAwsSecurityGroupRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - sgRaw, _, err := SGStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - if sgRaw == nil { - d.SetId("") - return nil - } - - sg := sgRaw.(*ec2.SecurityGroup) - - remoteIngressRules := resourceAwsSecurityGroupIPPermGather(d.Id(), sg.IpPermissions, sg.OwnerId) - remoteEgressRules := resourceAwsSecurityGroupIPPermGather(d.Id(), sg.IpPermissionsEgress, sg.OwnerId) - - localIngressRules := d.Get("ingress").(*schema.Set).List() - localEgressRules := d.Get("egress").(*schema.Set).List() - - // Loop through the local state of rules, doing a match against the remote - // ruleSet we built above. - ingressRules := matchRules("ingress", localIngressRules, remoteIngressRules) - egressRules := matchRules("egress", localEgressRules, remoteEgressRules) - - d.Set("description", sg.Description) - d.Set("name", sg.GroupName) - d.Set("vpc_id", sg.VpcId) - d.Set("owner_id", sg.OwnerId) - - if err := d.Set("ingress", ingressRules); err != nil { - log.Printf("[WARN] Error setting Ingress rule set for (%s): %s", d.Id(), err) - } - - if err := d.Set("egress", egressRules); err != nil { - log.Printf("[WARN] Error setting Egress rule set for (%s): %s", d.Id(), err) - } - - d.Set("tags", tagsToMap(sg.Tags)) - return nil -} - -func resourceAwsSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - sgRaw, _, err := SGStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - if sgRaw == nil { - d.SetId("") - return nil - } - - group := sgRaw.(*ec2.SecurityGroup) - - err = resourceAwsSecurityGroupUpdateRules(d, "ingress", meta, group) - if err != nil { - return err - } - - if d.Get("vpc_id") != nil { - err = resourceAwsSecurityGroupUpdateRules(d, "egress", meta, group) - if err != nil { - return err - } - } - - if !d.IsNewResource() { - if err := setTags(conn, d); err != nil { - return err - } - d.SetPartial("tags") - } - - return resourceAwsSecurityGroupRead(d, meta) -} - -func resourceAwsSecurityGroupDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[DEBUG] Security Group destroy: %v", d.Id()) - - if err := deleteLingeringLambdaENIs(conn, d); err != nil { - return fmt.Errorf("Failed to delete Lambda ENIs: %s", err) - } - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteSecurityGroup(&ec2.DeleteSecurityGroupInput{ - GroupId: aws.String(d.Id()), - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.RetryableError(err) - } - - switch ec2err.Code() { - case "InvalidGroup.NotFound": - return nil - case "DependencyViolation": - // If it is a dependency violation, we want to retry - return resource.RetryableError(err) - default: - // Any other error, we want to quit the retry loop immediately - return resource.NonRetryableError(err) - } - } - - return nil - }) -} - -func resourceAwsSecurityGroupRuleHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%d-", m["from_port"].(int))) - buf.WriteString(fmt.Sprintf("%d-", m["to_port"].(int))) - p := protocolForValue(m["protocol"].(string)) - buf.WriteString(fmt.Sprintf("%s-", p)) - buf.WriteString(fmt.Sprintf("%t-", m["self"].(bool))) - - // We need to make sure to sort the strings below so that we always - // generate the same hash code no matter what is in the set. - if v, ok := m["cidr_blocks"]; ok { - vs := v.([]interface{}) - s := make([]string, len(vs)) - for i, raw := range vs { - s[i] = raw.(string) - } - sort.Strings(s) - - for _, v := range s { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - if v, ok := m["ipv6_cidr_blocks"]; ok { - vs := v.([]interface{}) - s := make([]string, len(vs)) - for i, raw := range vs { - s[i] = raw.(string) - } - sort.Strings(s) - - for _, v := range s { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - if v, ok := m["prefix_list_ids"]; ok { - vs := v.([]interface{}) - s := make([]string, len(vs)) - for i, raw := range vs { - s[i] = raw.(string) - } - sort.Strings(s) - - for _, v := range s { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - if v, ok := m["security_groups"]; ok { - vs := v.(*schema.Set).List() - s := make([]string, len(vs)) - for i, raw := range vs { - s[i] = raw.(string) - } - sort.Strings(s) - - for _, v := range s { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - - return hashcode.String(buf.String()) -} - -func resourceAwsSecurityGroupIPPermGather(groupId string, permissions []*ec2.IpPermission, ownerId *string) []map[string]interface{} { - ruleMap := make(map[string]map[string]interface{}) - for _, perm := range permissions { - var fromPort, toPort int64 - if v := perm.FromPort; v != nil { - fromPort = *v - } - if v := perm.ToPort; v != nil { - toPort = *v - } - - k := fmt.Sprintf("%s-%d-%d", *perm.IpProtocol, fromPort, toPort) - m, ok := ruleMap[k] - if !ok { - m = make(map[string]interface{}) - ruleMap[k] = m - } - - m["from_port"] = fromPort - m["to_port"] = toPort - m["protocol"] = *perm.IpProtocol - - if len(perm.IpRanges) > 0 { - raw, ok := m["cidr_blocks"] - if !ok { - raw = make([]string, 0, len(perm.IpRanges)) - } - list := raw.([]string) - - for _, ip := range perm.IpRanges { - list = append(list, *ip.CidrIp) - } - - m["cidr_blocks"] = list - } - - if len(perm.Ipv6Ranges) > 0 { - raw, ok := m["ipv6_cidr_blocks"] - if !ok { - raw = make([]string, 0, len(perm.Ipv6Ranges)) - } - list := raw.([]string) - - for _, ip := range perm.Ipv6Ranges { - list = append(list, *ip.CidrIpv6) - } - - m["ipv6_cidr_blocks"] = list - } - - if len(perm.PrefixListIds) > 0 { - raw, ok := m["prefix_list_ids"] - if !ok { - raw = make([]string, 0, len(perm.PrefixListIds)) - } - list := raw.([]string) - - for _, pl := range perm.PrefixListIds { - list = append(list, *pl.PrefixListId) - } - - m["prefix_list_ids"] = list - } - - groups := flattenSecurityGroups(perm.UserIdGroupPairs, ownerId) - for i, g := range groups { - if *g.GroupId == groupId { - groups[i], groups = groups[len(groups)-1], groups[:len(groups)-1] - m["self"] = true - } - } - - if len(groups) > 0 { - raw, ok := m["security_groups"] - if !ok { - raw = schema.NewSet(schema.HashString, nil) - } - list := raw.(*schema.Set) - - for _, g := range groups { - if g.GroupName != nil { - list.Add(*g.GroupName) - } else { - list.Add(*g.GroupId) - } - } - - m["security_groups"] = list - } - } - rules := make([]map[string]interface{}, 0, len(ruleMap)) - for _, m := range ruleMap { - rules = append(rules, m) - } - - return rules -} - -func resourceAwsSecurityGroupUpdateRules( - d *schema.ResourceData, ruleset string, - meta interface{}, group *ec2.SecurityGroup) error { - - if d.HasChange(ruleset) { - o, n := d.GetChange(ruleset) - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - remove, err := expandIPPerms(group, os.Difference(ns).List()) - if err != nil { - return err - } - add, err := expandIPPerms(group, ns.Difference(os).List()) - if err != nil { - return err - } - - // TODO: We need to handle partial state better in the in-between - // in this update. - - // TODO: It'd be nicer to authorize before removing, but then we have - // to deal with complicated unrolling to get individual CIDR blocks - // to avoid authorizing already authorized sources. Removing before - // adding is easier here, and Terraform should be fast enough to - // not have service issues. - - if len(remove) > 0 || len(add) > 0 { - conn := meta.(*AWSClient).ec2conn - - var err error - if len(remove) > 0 { - log.Printf("[DEBUG] Revoking security group %#v %s rule: %#v", - group, ruleset, remove) - - if ruleset == "egress" { - req := &ec2.RevokeSecurityGroupEgressInput{ - GroupId: group.GroupId, - IpPermissions: remove, - } - _, err = conn.RevokeSecurityGroupEgress(req) - } else { - req := &ec2.RevokeSecurityGroupIngressInput{ - GroupId: group.GroupId, - IpPermissions: remove, - } - if group.VpcId == nil || *group.VpcId == "" { - req.GroupId = nil - req.GroupName = group.GroupName - } - _, err = conn.RevokeSecurityGroupIngress(req) - } - - if err != nil { - return fmt.Errorf( - "Error revoking security group %s rules: %s", - ruleset, err) - } - } - - if len(add) > 0 { - log.Printf("[DEBUG] Authorizing security group %#v %s rule: %#v", - group, ruleset, add) - // Authorize the new rules - if ruleset == "egress" { - req := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupId: group.GroupId, - IpPermissions: add, - } - _, err = conn.AuthorizeSecurityGroupEgress(req) - } else { - req := &ec2.AuthorizeSecurityGroupIngressInput{ - GroupId: group.GroupId, - IpPermissions: add, - } - if group.VpcId == nil || *group.VpcId == "" { - req.GroupId = nil - req.GroupName = group.GroupName - } - - _, err = conn.AuthorizeSecurityGroupIngress(req) - } - - if err != nil { - return fmt.Errorf( - "Error authorizing security group %s rules: %s", - ruleset, err) - } - } - } - } - return nil -} - -// SGStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// a security group. -func SGStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - req := &ec2.DescribeSecurityGroupsInput{ - GroupIds: []*string{aws.String(id)}, - } - resp, err := conn.DescribeSecurityGroups(req) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if ec2err.Code() == "InvalidSecurityGroupID.NotFound" || - ec2err.Code() == "InvalidGroup.NotFound" { - resp = nil - err = nil - } - } - - if err != nil { - log.Printf("Error on SGStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - return nil, "", nil - } - - group := resp.SecurityGroups[0] - return group, "exists", nil - } -} - -// matchRules receives the group id, type of rules, and the local / remote maps -// of rules. We iterate through the local set of rules trying to find a matching -// remote rule, which may be structured differently because of how AWS -// aggregates the rules under the to, from, and type. -// -// -// Matching rules are written to state, with their elements removed from the -// remote set -// -// If no match is found, we'll write the remote rule to state and let the graph -// sort things out -func matchRules(rType string, local []interface{}, remote []map[string]interface{}) []map[string]interface{} { - // For each local ip or security_group, we need to match against the remote - // ruleSet until all ips or security_groups are found - - // saves represents the rules that have been identified to be saved to state, - // in the appropriate d.Set("{ingress,egress}") call. - var saves []map[string]interface{} - for _, raw := range local { - l := raw.(map[string]interface{}) - - var selfVal bool - if v, ok := l["self"]; ok { - selfVal = v.(bool) - } - - // matching against self is required to detect rules that only include self - // as the rule. resourceAwsSecurityGroupIPPermGather parses the group out - // and replaces it with self if it's ID is found - localHash := idHash(rType, l["protocol"].(string), int64(l["to_port"].(int)), int64(l["from_port"].(int)), selfVal) - - // loop remote rules, looking for a matching hash - for _, r := range remote { - var remoteSelfVal bool - if v, ok := r["self"]; ok { - remoteSelfVal = v.(bool) - } - - // hash this remote rule and compare it for a match consideration with the - // local rule we're examining - rHash := idHash(rType, r["protocol"].(string), r["to_port"].(int64), r["from_port"].(int64), remoteSelfVal) - if rHash == localHash { - var numExpectedCidrs, numExpectedIpv6Cidrs, numExpectedPrefixLists, numExpectedSGs, numRemoteCidrs, numRemoteIpv6Cidrs, numRemotePrefixLists, numRemoteSGs int - var matchingCidrs []string - var matchingIpv6Cidrs []string - var matchingSGs []string - var matchingPrefixLists []string - - // grab the local/remote cidr and sg groups, capturing the expected and - // actual counts - lcRaw, ok := l["cidr_blocks"] - if ok { - numExpectedCidrs = len(l["cidr_blocks"].([]interface{})) - } - liRaw, ok := l["ipv6_cidr_blocks"] - if ok { - numExpectedIpv6Cidrs = len(l["ipv6_cidr_blocks"].([]interface{})) - } - lpRaw, ok := l["prefix_list_ids"] - if ok { - numExpectedPrefixLists = len(l["prefix_list_ids"].([]interface{})) - } - lsRaw, ok := l["security_groups"] - if ok { - numExpectedSGs = len(l["security_groups"].(*schema.Set).List()) - } - - rcRaw, ok := r["cidr_blocks"] - if ok { - numRemoteCidrs = len(r["cidr_blocks"].([]string)) - } - riRaw, ok := r["ipv6_cidr_blocks"] - if ok { - numRemoteIpv6Cidrs = len(r["ipv6_cidr_blocks"].([]string)) - } - rpRaw, ok := r["prefix_list_ids"] - if ok { - numRemotePrefixLists = len(r["prefix_list_ids"].([]string)) - } - - rsRaw, ok := r["security_groups"] - if ok { - numRemoteSGs = len(r["security_groups"].(*schema.Set).List()) - } - - // check some early failures - if numExpectedCidrs > numRemoteCidrs { - log.Printf("[DEBUG] Local rule has more CIDR blocks, continuing (%d/%d)", numExpectedCidrs, numRemoteCidrs) - continue - } - if numExpectedIpv6Cidrs > numRemoteIpv6Cidrs { - log.Printf("[DEBUG] Local rule has more IPV6 CIDR blocks, continuing (%d/%d)", numExpectedIpv6Cidrs, numRemoteIpv6Cidrs) - continue - } - if numExpectedPrefixLists > numRemotePrefixLists { - log.Printf("[DEBUG] Local rule has more prefix lists, continuing (%d/%d)", numExpectedPrefixLists, numRemotePrefixLists) - continue - } - if numExpectedSGs > numRemoteSGs { - log.Printf("[DEBUG] Local rule has more Security Groups, continuing (%d/%d)", numExpectedSGs, numRemoteSGs) - continue - } - - // match CIDRs by converting both to sets, and using Set methods - var localCidrs []interface{} - if lcRaw != nil { - localCidrs = lcRaw.([]interface{}) - } - localCidrSet := schema.NewSet(schema.HashString, localCidrs) - - // remote cidrs are presented as a slice of strings, so we need to - // reformat them into a slice of interfaces to be used in creating the - // remote cidr set - var remoteCidrs []string - if rcRaw != nil { - remoteCidrs = rcRaw.([]string) - } - // convert remote cidrs to a set, for easy comparisons - var list []interface{} - for _, s := range remoteCidrs { - list = append(list, s) - } - remoteCidrSet := schema.NewSet(schema.HashString, list) - - // Build up a list of local cidrs that are found in the remote set - for _, s := range localCidrSet.List() { - if remoteCidrSet.Contains(s) { - matchingCidrs = append(matchingCidrs, s.(string)) - } - } - - //IPV6 CIDRs - var localIpv6Cidrs []interface{} - if liRaw != nil { - localIpv6Cidrs = liRaw.([]interface{}) - } - localIpv6CidrSet := schema.NewSet(schema.HashString, localIpv6Cidrs) - - var remoteIpv6Cidrs []string - if riRaw != nil { - remoteIpv6Cidrs = riRaw.([]string) - } - var listIpv6 []interface{} - for _, s := range remoteIpv6Cidrs { - listIpv6 = append(listIpv6, s) - } - remoteIpv6CidrSet := schema.NewSet(schema.HashString, listIpv6) - - for _, s := range localIpv6CidrSet.List() { - if remoteIpv6CidrSet.Contains(s) { - matchingIpv6Cidrs = append(matchingIpv6Cidrs, s.(string)) - } - } - - // match prefix lists by converting both to sets, and using Set methods - var localPrefixLists []interface{} - if lpRaw != nil { - localPrefixLists = lpRaw.([]interface{}) - } - localPrefixListsSet := schema.NewSet(schema.HashString, localPrefixLists) - - // remote prefix lists are presented as a slice of strings, so we need to - // reformat them into a slice of interfaces to be used in creating the - // remote prefix list set - var remotePrefixLists []string - if rpRaw != nil { - remotePrefixLists = rpRaw.([]string) - } - // convert remote prefix lists to a set, for easy comparison - list = nil - for _, s := range remotePrefixLists { - list = append(list, s) - } - remotePrefixListsSet := schema.NewSet(schema.HashString, list) - - // Build up a list of local prefix lists that are found in the remote set - for _, s := range localPrefixListsSet.List() { - if remotePrefixListsSet.Contains(s) { - matchingPrefixLists = append(matchingPrefixLists, s.(string)) - } - } - - // match SGs. Both local and remote are already sets - var localSGSet *schema.Set - if lsRaw == nil { - localSGSet = schema.NewSet(schema.HashString, nil) - } else { - localSGSet = lsRaw.(*schema.Set) - } - - var remoteSGSet *schema.Set - if rsRaw == nil { - remoteSGSet = schema.NewSet(schema.HashString, nil) - } else { - remoteSGSet = rsRaw.(*schema.Set) - } - - // Build up a list of local security groups that are found in the remote set - for _, s := range localSGSet.List() { - if remoteSGSet.Contains(s) { - matchingSGs = append(matchingSGs, s.(string)) - } - } - - // compare equalities for matches. - // If we found the number of cidrs and number of sgs, we declare a - // match, and then remove those elements from the remote rule, so that - // this remote rule can still be considered by other local rules - if numExpectedCidrs == len(matchingCidrs) { - if numExpectedIpv6Cidrs == len(matchingIpv6Cidrs) { - if numExpectedPrefixLists == len(matchingPrefixLists) { - if numExpectedSGs == len(matchingSGs) { - // confirm that self references match - var lSelf bool - var rSelf bool - if _, ok := l["self"]; ok { - lSelf = l["self"].(bool) - } - if _, ok := r["self"]; ok { - rSelf = r["self"].(bool) - } - if rSelf == lSelf { - delete(r, "self") - // pop local cidrs from remote - diffCidr := remoteCidrSet.Difference(localCidrSet) - var newCidr []string - for _, cRaw := range diffCidr.List() { - newCidr = append(newCidr, cRaw.(string)) - } - - // reassigning - if len(newCidr) > 0 { - r["cidr_blocks"] = newCidr - } else { - delete(r, "cidr_blocks") - } - - //// IPV6 - //// Comparison - diffIpv6Cidr := remoteIpv6CidrSet.Difference(localIpv6CidrSet) - var newIpv6Cidr []string - for _, cRaw := range diffIpv6Cidr.List() { - newIpv6Cidr = append(newIpv6Cidr, cRaw.(string)) - } - - // reassigning - if len(newIpv6Cidr) > 0 { - r["ipv6_cidr_blocks"] = newIpv6Cidr - } else { - delete(r, "ipv6_cidr_blocks") - } - - // pop local prefix lists from remote - diffPrefixLists := remotePrefixListsSet.Difference(localPrefixListsSet) - var newPrefixLists []string - for _, pRaw := range diffPrefixLists.List() { - newPrefixLists = append(newPrefixLists, pRaw.(string)) - } - - // reassigning - if len(newPrefixLists) > 0 { - r["prefix_list_ids"] = newPrefixLists - } else { - delete(r, "prefix_list_ids") - } - - // pop local sgs from remote - diffSGs := remoteSGSet.Difference(localSGSet) - if len(diffSGs.List()) > 0 { - r["security_groups"] = diffSGs - } else { - delete(r, "security_groups") - } - - saves = append(saves, l) - } - } - } - - } - } - } - } - } - // Here we catch any remote rules that have not been stripped of all self, - // cidrs, and security groups. We'll add remote rules here that have not been - // matched locally, and let the graph sort things out. This will happen when - // rules are added externally to Terraform - for _, r := range remote { - var lenCidr, lenIpv6Cidr, lenPrefixLists, lenSGs int - if rCidrs, ok := r["cidr_blocks"]; ok { - lenCidr = len(rCidrs.([]string)) - } - if rIpv6Cidrs, ok := r["ipv6_cidr_blocks"]; ok { - lenIpv6Cidr = len(rIpv6Cidrs.([]string)) - } - if rPrefixLists, ok := r["prefix_list_ids"]; ok { - lenPrefixLists = len(rPrefixLists.([]string)) - } - if rawSGs, ok := r["security_groups"]; ok { - lenSGs = len(rawSGs.(*schema.Set).List()) - } - - if _, ok := r["self"]; ok { - if r["self"].(bool) == true { - lenSGs++ - } - } - - if lenSGs+lenCidr+lenIpv6Cidr+lenPrefixLists > 0 { - log.Printf("[DEBUG] Found a remote Rule that wasn't empty: (%#v)", r) - saves = append(saves, r) - } - } - - return saves -} - -// Creates a unique hash for the type, ports, and protocol, used as a key in -// maps -func idHash(rType, protocol string, toPort, fromPort int64, self bool) string { - var buf bytes.Buffer - buf.WriteString(fmt.Sprintf("%s-", rType)) - buf.WriteString(fmt.Sprintf("%d-", toPort)) - buf.WriteString(fmt.Sprintf("%d-", fromPort)) - buf.WriteString(fmt.Sprintf("%s-", strings.ToLower(protocol))) - buf.WriteString(fmt.Sprintf("%t-", self)) - - return fmt.Sprintf("rule-%d", hashcode.String(buf.String())) -} - -// protocolStateFunc ensures we only store a string in any protocol field -func protocolStateFunc(v interface{}) string { - switch v.(type) { - case string: - p := protocolForValue(v.(string)) - return p - default: - log.Printf("[WARN] Non String value given for Protocol: %#v", v) - return "" - } -} - -// protocolForValue converts a valid Internet Protocol number into it's name -// representation. If a name is given, it validates that it's a proper protocol -// name. Names/numbers are as defined at -// https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml -func protocolForValue(v string) string { - // special case -1 - protocol := strings.ToLower(v) - if protocol == "-1" || protocol == "all" { - return "-1" - } - // if it's a name like tcp, return that - if _, ok := sgProtocolIntegers()[protocol]; ok { - return protocol - } - // convert to int, look for that value - p, err := strconv.Atoi(protocol) - if err != nil { - // we were unable to convert to int, suggesting a string name, but it wasn't - // found above - log.Printf("[WARN] Unable to determine valid protocol: %s", err) - return protocol - } - - for k, v := range sgProtocolIntegers() { - if p == v { - // guard against protocolIntegers sometime in the future not having lower - // case ids in the map - return strings.ToLower(k) - } - } - - // fall through - log.Printf("[WARN] Unable to determine valid protocol: no matching protocols found") - return protocol -} - -// a map of protocol names and their codes, defined at -// https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml, -// documented to be supported by AWS Security Groups -// http://docs.aws.amazon.com/fr_fr/AWSEC2/latest/APIReference/API_IpPermission.html -// Similar to protocolIntegers() used by Network ACLs, but explicitly only -// supports "tcp", "udp", "icmp", and "all" -func sgProtocolIntegers() map[string]int { - var protocolIntegers = make(map[string]int) - protocolIntegers = map[string]int{ - "udp": 17, - "tcp": 6, - "icmp": 1, - "all": -1, - } - return protocolIntegers -} - -// The AWS Lambda service creates ENIs behind the scenes and keeps these around for a while -// which would prevent SGs attached to such ENIs from being destroyed -func deleteLingeringLambdaENIs(conn *ec2.EC2, d *schema.ResourceData) error { - // Here we carefully find the offenders - params := &ec2.DescribeNetworkInterfacesInput{ - Filters: []*ec2.Filter{ - { - Name: aws.String("group-id"), - Values: []*string{aws.String(d.Id())}, - }, - { - Name: aws.String("description"), - Values: []*string{aws.String("AWS Lambda VPC ENI: *")}, - }, - { - Name: aws.String("requester-id"), - Values: []*string{aws.String("*:awslambda_*")}, - }, - }, - } - networkInterfaceResp, err := conn.DescribeNetworkInterfaces(params) - if err != nil { - return err - } - - // Then we detach and finally delete those - v := networkInterfaceResp.NetworkInterfaces - for _, eni := range v { - if eni.Attachment != nil { - detachNetworkInterfaceParams := &ec2.DetachNetworkInterfaceInput{ - AttachmentId: eni.Attachment.AttachmentId, - } - _, detachNetworkInterfaceErr := conn.DetachNetworkInterface(detachNetworkInterfaceParams) - - if detachNetworkInterfaceErr != nil { - return detachNetworkInterfaceErr - } - - log.Printf("[DEBUG] Waiting for ENI (%s) to become detached", *eni.NetworkInterfaceId) - stateConf := &resource.StateChangeConf{ - Pending: []string{"true"}, - Target: []string{"false"}, - Refresh: networkInterfaceAttachedRefreshFunc(conn, *eni.NetworkInterfaceId), - Timeout: 10 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for ENI (%s) to become detached: %s", *eni.NetworkInterfaceId, err) - } - } - - deleteNetworkInterfaceParams := &ec2.DeleteNetworkInterfaceInput{ - NetworkInterfaceId: eni.NetworkInterfaceId, - } - _, deleteNetworkInterfaceErr := conn.DeleteNetworkInterface(deleteNetworkInterfaceParams) - - if deleteNetworkInterfaceErr != nil { - return deleteNetworkInterfaceErr - } - } - - return nil -} - -func networkInterfaceAttachedRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - - describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesInput{ - NetworkInterfaceIds: []*string{aws.String(id)}, - } - describeResp, err := conn.DescribeNetworkInterfaces(describe_network_interfaces_request) - - if err != nil { - log.Printf("[ERROR] Could not find network interface %s. %s", id, err) - return nil, "", err - } - - eni := describeResp.NetworkInterfaces[0] - hasAttachment := strconv.FormatBool(eni.Attachment != nil) - log.Printf("[DEBUG] ENI %s has attachment state %s", id, hasAttachment) - return eni, hasAttachment, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group_rule.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group_rule.go deleted file mode 100644 index 6c2f087..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group_rule.go +++ /dev/null @@ -1,668 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "sort" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSecurityGroupRule() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSecurityGroupRuleCreate, - Read: resourceAwsSecurityGroupRuleRead, - Delete: resourceAwsSecurityGroupRuleDelete, - - SchemaVersion: 2, - MigrateState: resourceAwsSecurityGroupRuleMigrateState, - - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Type of rule, ingress (inbound) or egress (outbound).", - ValidateFunc: validateSecurityRuleType, - }, - - "from_port": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - - "to_port": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - - "protocol": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - StateFunc: protocolStateFunc, - }, - - "cidr_blocks": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "ipv6_cidr_blocks": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "prefix_list_ids": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "security_group_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "source_security_group_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - ConflictsWith: []string{"cidr_blocks", "self"}, - }, - - "self": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - ConflictsWith: []string{"cidr_blocks"}, - }, - }, - } -} - -func resourceAwsSecurityGroupRuleCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - sg_id := d.Get("security_group_id").(string) - - awsMutexKV.Lock(sg_id) - defer awsMutexKV.Unlock(sg_id) - - sg, err := findResourceSecurityGroup(conn, sg_id) - if err != nil { - return err - } - - perm, err := expandIPPerm(d, sg) - if err != nil { - return err - } - - // Verify that either 'cidr_blocks', 'self', or 'source_security_group_id' is set - // If they are not set the AWS API will silently fail. This causes TF to hit a timeout - // at 5-minutes waiting for the security group rule to appear, when it was never actually - // created. - if err := validateAwsSecurityGroupRule(d); err != nil { - return err - } - - ruleType := d.Get("type").(string) - isVPC := sg.VpcId != nil && *sg.VpcId != "" - - var autherr error - switch ruleType { - case "ingress": - log.Printf("[DEBUG] Authorizing security group %s %s rule: %s", - sg_id, "Ingress", perm) - - req := &ec2.AuthorizeSecurityGroupIngressInput{ - GroupId: sg.GroupId, - IpPermissions: []*ec2.IpPermission{perm}, - } - - if !isVPC { - req.GroupId = nil - req.GroupName = sg.GroupName - } - - _, autherr = conn.AuthorizeSecurityGroupIngress(req) - - case "egress": - log.Printf("[DEBUG] Authorizing security group %s %s rule: %#v", - sg_id, "Egress", perm) - - req := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupId: sg.GroupId, - IpPermissions: []*ec2.IpPermission{perm}, - } - - _, autherr = conn.AuthorizeSecurityGroupEgress(req) - - default: - return fmt.Errorf("Security Group Rule must be type 'ingress' or type 'egress'") - } - - if autherr != nil { - if awsErr, ok := autherr.(awserr.Error); ok { - if awsErr.Code() == "InvalidPermission.Duplicate" { - return fmt.Errorf(`[WARN] A duplicate Security Group rule was found on (%s). This may be -a side effect of a now-fixed Terraform issue causing two security groups with -identical attributes but different source_security_group_ids to overwrite each -other in the state. See https://github.com/hashicorp/terraform/pull/2376 for more -information and instructions for recovery. Error message: %s`, sg_id, awsErr.Message()) - } - } - - return fmt.Errorf( - "Error authorizing security group rule type %s: %s", - ruleType, autherr) - } - - id := ipPermissionIDHash(sg_id, ruleType, perm) - log.Printf("[DEBUG] Computed group rule ID %s", id) - - retErr := resource.Retry(5*time.Minute, func() *resource.RetryError { - sg, err := findResourceSecurityGroup(conn, sg_id) - - if err != nil { - log.Printf("[DEBUG] Error finding Security Group (%s) for Rule (%s): %s", sg_id, id, err) - return resource.NonRetryableError(err) - } - - var rules []*ec2.IpPermission - switch ruleType { - case "ingress": - rules = sg.IpPermissions - default: - rules = sg.IpPermissionsEgress - } - - rule := findRuleMatch(perm, rules, isVPC) - - if rule == nil { - log.Printf("[DEBUG] Unable to find matching %s Security Group Rule (%s) for Group %s", - ruleType, id, sg_id) - return resource.RetryableError(fmt.Errorf("No match found")) - } - - log.Printf("[DEBUG] Found rule for Security Group Rule (%s): %s", id, rule) - return nil - }) - - if retErr != nil { - return fmt.Errorf("Error finding matching %s Security Group Rule (%s) for Group %s", - ruleType, id, sg_id) - } - - d.SetId(id) - return nil -} - -func resourceAwsSecurityGroupRuleRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - sg_id := d.Get("security_group_id").(string) - sg, err := findResourceSecurityGroup(conn, sg_id) - if _, notFound := err.(securityGroupNotFound); notFound { - // The security group containing this rule no longer exists. - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("Error finding security group (%s) for rule (%s): %s", sg_id, d.Id(), err) - } - - isVPC := sg.VpcId != nil && *sg.VpcId != "" - - var rule *ec2.IpPermission - var rules []*ec2.IpPermission - ruleType := d.Get("type").(string) - switch ruleType { - case "ingress": - rules = sg.IpPermissions - default: - rules = sg.IpPermissionsEgress - } - - p, err := expandIPPerm(d, sg) - if err != nil { - return err - } - - if len(rules) == 0 { - log.Printf("[WARN] No %s rules were found for Security Group (%s) looking for Security Group Rule (%s)", - ruleType, *sg.GroupName, d.Id()) - d.SetId("") - return nil - } - - rule = findRuleMatch(p, rules, isVPC) - - if rule == nil { - log.Printf("[DEBUG] Unable to find matching %s Security Group Rule (%s) for Group %s", - ruleType, d.Id(), sg_id) - d.SetId("") - return nil - } - - log.Printf("[DEBUG] Found rule for Security Group Rule (%s): %s", d.Id(), rule) - - d.Set("type", ruleType) - if err := setFromIPPerm(d, sg, p); err != nil { - return errwrap.Wrapf("Error setting IP Permission for Security Group Rule: {{err}}", err) - } - return nil -} - -func resourceAwsSecurityGroupRuleDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - sg_id := d.Get("security_group_id").(string) - - awsMutexKV.Lock(sg_id) - defer awsMutexKV.Unlock(sg_id) - - sg, err := findResourceSecurityGroup(conn, sg_id) - if err != nil { - return err - } - - perm, err := expandIPPerm(d, sg) - if err != nil { - return err - } - ruleType := d.Get("type").(string) - switch ruleType { - case "ingress": - log.Printf("[DEBUG] Revoking rule (%s) from security group %s:\n%s", - "ingress", sg_id, perm) - req := &ec2.RevokeSecurityGroupIngressInput{ - GroupId: sg.GroupId, - IpPermissions: []*ec2.IpPermission{perm}, - } - - _, err = conn.RevokeSecurityGroupIngress(req) - - if err != nil { - return fmt.Errorf( - "Error revoking security group %s rules: %s", - sg_id, err) - } - case "egress": - - log.Printf("[DEBUG] Revoking security group %#v %s rule: %#v", - sg_id, "egress", perm) - req := &ec2.RevokeSecurityGroupEgressInput{ - GroupId: sg.GroupId, - IpPermissions: []*ec2.IpPermission{perm}, - } - - _, err = conn.RevokeSecurityGroupEgress(req) - - if err != nil { - return fmt.Errorf( - "Error revoking security group %s rules: %s", - sg_id, err) - } - } - - d.SetId("") - - return nil -} - -func findResourceSecurityGroup(conn *ec2.EC2, id string) (*ec2.SecurityGroup, error) { - req := &ec2.DescribeSecurityGroupsInput{ - GroupIds: []*string{aws.String(id)}, - } - resp, err := conn.DescribeSecurityGroups(req) - if err, ok := err.(awserr.Error); ok && err.Code() == "InvalidGroup.NotFound" { - return nil, securityGroupNotFound{id, nil} - } - if err != nil { - return nil, err - } - if resp == nil { - return nil, securityGroupNotFound{id, nil} - } - if len(resp.SecurityGroups) != 1 || resp.SecurityGroups[0] == nil { - return nil, securityGroupNotFound{id, resp.SecurityGroups} - } - - return resp.SecurityGroups[0], nil -} - -type securityGroupNotFound struct { - id string - securityGroups []*ec2.SecurityGroup -} - -func (err securityGroupNotFound) Error() string { - if err.securityGroups == nil { - return fmt.Sprintf("No security group with ID %q", err.id) - } - return fmt.Sprintf("Expected to find one security group with ID %q, got: %#v", - err.id, err.securityGroups) -} - -// ByGroupPair implements sort.Interface for []*ec2.UserIDGroupPairs based on -// GroupID or GroupName field (only one should be set). -type ByGroupPair []*ec2.UserIdGroupPair - -func (b ByGroupPair) Len() int { return len(b) } -func (b ByGroupPair) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b ByGroupPair) Less(i, j int) bool { - if b[i].GroupId != nil && b[j].GroupId != nil { - return *b[i].GroupId < *b[j].GroupId - } - if b[i].GroupName != nil && b[j].GroupName != nil { - return *b[i].GroupName < *b[j].GroupName - } - - panic("mismatched security group rules, may be a terraform bug") -} - -func findRuleMatch(p *ec2.IpPermission, rules []*ec2.IpPermission, isVPC bool) *ec2.IpPermission { - var rule *ec2.IpPermission - for _, r := range rules { - if r.ToPort != nil && *p.ToPort != *r.ToPort { - continue - } - - if r.FromPort != nil && *p.FromPort != *r.FromPort { - continue - } - - if r.IpProtocol != nil && *p.IpProtocol != *r.IpProtocol { - continue - } - - remaining := len(p.IpRanges) - for _, ip := range p.IpRanges { - for _, rip := range r.IpRanges { - if *ip.CidrIp == *rip.CidrIp { - remaining-- - } - } - } - - if remaining > 0 { - continue - } - - remaining = len(p.Ipv6Ranges) - for _, ipv6 := range p.Ipv6Ranges { - for _, ipv6ip := range r.Ipv6Ranges { - if *ipv6.CidrIpv6 == *ipv6ip.CidrIpv6 { - remaining-- - } - } - } - - if remaining > 0 { - continue - } - - remaining = len(p.PrefixListIds) - for _, pl := range p.PrefixListIds { - for _, rpl := range r.PrefixListIds { - if *pl.PrefixListId == *rpl.PrefixListId { - remaining-- - } - } - } - - if remaining > 0 { - continue - } - - remaining = len(p.UserIdGroupPairs) - for _, ip := range p.UserIdGroupPairs { - for _, rip := range r.UserIdGroupPairs { - if isVPC { - if *ip.GroupId == *rip.GroupId { - remaining-- - } - } else { - if *ip.GroupName == *rip.GroupName { - remaining-- - } - } - } - } - - if remaining > 0 { - continue - } - - rule = r - } - return rule -} - -func ipPermissionIDHash(sg_id, ruleType string, ip *ec2.IpPermission) string { - var buf bytes.Buffer - buf.WriteString(fmt.Sprintf("%s-", sg_id)) - if ip.FromPort != nil && *ip.FromPort > 0 { - buf.WriteString(fmt.Sprintf("%d-", *ip.FromPort)) - } - if ip.ToPort != nil && *ip.ToPort > 0 { - buf.WriteString(fmt.Sprintf("%d-", *ip.ToPort)) - } - buf.WriteString(fmt.Sprintf("%s-", *ip.IpProtocol)) - buf.WriteString(fmt.Sprintf("%s-", ruleType)) - - // We need to make sure to sort the strings below so that we always - // generate the same hash code no matter what is in the set. - if len(ip.IpRanges) > 0 { - s := make([]string, len(ip.IpRanges)) - for i, r := range ip.IpRanges { - s[i] = *r.CidrIp - } - sort.Strings(s) - - for _, v := range s { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - - if len(ip.Ipv6Ranges) > 0 { - s := make([]string, len(ip.Ipv6Ranges)) - for i, r := range ip.Ipv6Ranges { - s[i] = *r.CidrIpv6 - } - sort.Strings(s) - - for _, v := range s { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - - if len(ip.PrefixListIds) > 0 { - s := make([]string, len(ip.PrefixListIds)) - for i, pl := range ip.PrefixListIds { - s[i] = *pl.PrefixListId - } - sort.Strings(s) - - for _, v := range s { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - - if len(ip.UserIdGroupPairs) > 0 { - sort.Sort(ByGroupPair(ip.UserIdGroupPairs)) - for _, pair := range ip.UserIdGroupPairs { - if pair.GroupId != nil { - buf.WriteString(fmt.Sprintf("%s-", *pair.GroupId)) - } else { - buf.WriteString("-") - } - if pair.GroupName != nil { - buf.WriteString(fmt.Sprintf("%s-", *pair.GroupName)) - } else { - buf.WriteString("-") - } - } - } - - return fmt.Sprintf("sgrule-%d", hashcode.String(buf.String())) -} - -func expandIPPerm(d *schema.ResourceData, sg *ec2.SecurityGroup) (*ec2.IpPermission, error) { - var perm ec2.IpPermission - - perm.FromPort = aws.Int64(int64(d.Get("from_port").(int))) - perm.ToPort = aws.Int64(int64(d.Get("to_port").(int))) - protocol := protocolForValue(d.Get("protocol").(string)) - perm.IpProtocol = aws.String(protocol) - - // build a group map that behaves like a set - groups := make(map[string]bool) - if raw, ok := d.GetOk("source_security_group_id"); ok { - groups[raw.(string)] = true - } - - if v, ok := d.GetOk("self"); ok && v.(bool) { - if sg.VpcId != nil && *sg.VpcId != "" { - groups[*sg.GroupId] = true - } else { - groups[*sg.GroupName] = true - } - } - - if len(groups) > 0 { - perm.UserIdGroupPairs = make([]*ec2.UserIdGroupPair, len(groups)) - // build string list of group name/ids - var gl []string - for k, _ := range groups { - gl = append(gl, k) - } - - for i, name := range gl { - ownerId, id := "", name - if items := strings.Split(id, "/"); len(items) > 1 { - ownerId, id = items[0], items[1] - } - - perm.UserIdGroupPairs[i] = &ec2.UserIdGroupPair{ - GroupId: aws.String(id), - UserId: aws.String(ownerId), - } - - if sg.VpcId == nil || *sg.VpcId == "" { - perm.UserIdGroupPairs[i].GroupId = nil - perm.UserIdGroupPairs[i].GroupName = aws.String(id) - perm.UserIdGroupPairs[i].UserId = nil - } - } - } - - if raw, ok := d.GetOk("cidr_blocks"); ok { - list := raw.([]interface{}) - perm.IpRanges = make([]*ec2.IpRange, len(list)) - for i, v := range list { - cidrIP, ok := v.(string) - if !ok { - return nil, fmt.Errorf("empty element found in cidr_blocks - consider using the compact function") - } - perm.IpRanges[i] = &ec2.IpRange{CidrIp: aws.String(cidrIP)} - } - } - - if raw, ok := d.GetOk("ipv6_cidr_blocks"); ok { - list := raw.([]interface{}) - perm.Ipv6Ranges = make([]*ec2.Ipv6Range, len(list)) - for i, v := range list { - cidrIP, ok := v.(string) - if !ok { - return nil, fmt.Errorf("empty element found in ipv6_cidr_blocks - consider using the compact function") - } - perm.Ipv6Ranges[i] = &ec2.Ipv6Range{CidrIpv6: aws.String(cidrIP)} - } - } - - if raw, ok := d.GetOk("prefix_list_ids"); ok { - list := raw.([]interface{}) - perm.PrefixListIds = make([]*ec2.PrefixListId, len(list)) - for i, v := range list { - prefixListID, ok := v.(string) - if !ok { - return nil, fmt.Errorf("empty element found in prefix_list_ids - consider using the compact function") - } - perm.PrefixListIds[i] = &ec2.PrefixListId{PrefixListId: aws.String(prefixListID)} - } - } - - return &perm, nil -} - -func setFromIPPerm(d *schema.ResourceData, sg *ec2.SecurityGroup, rule *ec2.IpPermission) error { - isVPC := sg.VpcId != nil && *sg.VpcId != "" - - d.Set("from_port", rule.FromPort) - d.Set("to_port", rule.ToPort) - d.Set("protocol", rule.IpProtocol) - - var cb []string - for _, c := range rule.IpRanges { - cb = append(cb, *c.CidrIp) - } - - d.Set("cidr_blocks", cb) - - var ipv6 []string - for _, ip := range rule.Ipv6Ranges { - ipv6 = append(ipv6, *ip.CidrIpv6) - } - d.Set("ipv6_cidr_blocks", ipv6) - - var pl []string - for _, p := range rule.PrefixListIds { - pl = append(pl, *p.PrefixListId) - } - d.Set("prefix_list_ids", pl) - - if len(rule.UserIdGroupPairs) > 0 { - s := rule.UserIdGroupPairs[0] - - if isVPC { - d.Set("source_security_group_id", *s.GroupId) - } else { - d.Set("source_security_group_id", *s.GroupName) - } - } - - return nil -} - -// Validates that either 'cidr_blocks', 'ipv6_cidr_blocks', 'self', or 'source_security_group_id' is set -func validateAwsSecurityGroupRule(d *schema.ResourceData) error { - _, blocksOk := d.GetOk("cidr_blocks") - _, ipv6Ok := d.GetOk("ipv6_cidr_blocks") - _, sourceOk := d.GetOk("source_security_group_id") - _, selfOk := d.GetOk("self") - _, prefixOk := d.GetOk("prefix_list_ids") - if !blocksOk && !sourceOk && !selfOk && !prefixOk && !ipv6Ok { - return fmt.Errorf( - "One of ['cidr_blocks', 'ipv6_cidr_blocks', 'self', 'source_security_group_id', 'prefix_list_ids'] must be set to create an AWS Security Group Rule") - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group_rule_migrate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group_rule_migrate.go deleted file mode 100644 index 1278805..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_security_group_rule_migrate.go +++ /dev/null @@ -1,105 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/terraform" -) - -func resourceAwsSecurityGroupRuleMigrateState( - v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - switch v { - case 0: - log.Println("[INFO] Found AWS Security Group State v0; migrating to v1") - return migrateSGRuleStateV0toV1(is) - case 1: - log.Println("[INFO] Found AWS Security Group State v1; migrating to v2") - // migrating to version 2 of the schema is the same as 0->1, since the - // method signature has changed now and will use the security group id in - // the hash - return migrateSGRuleStateV0toV1(is) - default: - return is, fmt.Errorf("Unexpected schema version: %d", v) - } -} - -func migrateSGRuleStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() { - log.Println("[DEBUG] Empty InstanceState; nothing to migrate.") - return is, nil - } - - perm, err := migrateExpandIPPerm(is.Attributes) - - if err != nil { - return nil, fmt.Errorf("[WARN] Error making new IP Permission in Security Group migration") - } - - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - newID := ipPermissionIDHash(is.Attributes["security_group_id"], is.Attributes["type"], perm) - is.Attributes["id"] = newID - is.ID = newID - log.Printf("[DEBUG] Attributes after migration: %#v, new id: %s", is.Attributes, newID) - return is, nil -} - -func migrateExpandIPPerm(attrs map[string]string) (*ec2.IpPermission, error) { - var perm ec2.IpPermission - tp, err := strconv.Atoi(attrs["to_port"]) - if err != nil { - return nil, fmt.Errorf("Error converting to_port in Security Group migration") - } - - fp, err := strconv.Atoi(attrs["from_port"]) - if err != nil { - return nil, fmt.Errorf("Error converting from_port in Security Group migration") - } - - perm.ToPort = aws.Int64(int64(tp)) - perm.FromPort = aws.Int64(int64(fp)) - perm.IpProtocol = aws.String(attrs["protocol"]) - - groups := make(map[string]bool) - if attrs["self"] == "true" { - groups[attrs["security_group_id"]] = true - } - - if attrs["source_security_group_id"] != "" { - groups[attrs["source_security_group_id"]] = true - } - - if len(groups) > 0 { - perm.UserIdGroupPairs = make([]*ec2.UserIdGroupPair, len(groups)) - // build string list of group name/ids - var gl []string - for k, _ := range groups { - gl = append(gl, k) - } - - for i, name := range gl { - perm.UserIdGroupPairs[i] = &ec2.UserIdGroupPair{ - GroupId: aws.String(name), - } - } - } - - var cb []string - for k, v := range attrs { - if k != "cidr_blocks.#" && strings.HasPrefix(k, "cidr_blocks") { - cb = append(cb, v) - } - } - if len(cb) > 0 { - perm.IpRanges = make([]*ec2.IpRange, len(cb)) - for i, v := range cb { - perm.IpRanges[i] = &ec2.IpRange{CidrIp: aws.String(v)} - } - } - - return &perm, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_active_receipt_rule_set.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_active_receipt_rule_set.go deleted file mode 100644 index 854d645..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_active_receipt_rule_set.go +++ /dev/null @@ -1,80 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSesActiveReceiptRuleSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSesActiveReceiptRuleSetUpdate, - Update: resourceAwsSesActiveReceiptRuleSetUpdate, - Read: resourceAwsSesActiveReceiptRuleSetRead, - Delete: resourceAwsSesActiveReceiptRuleSetDelete, - - Schema: map[string]*schema.Schema{ - "rule_set_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsSesActiveReceiptRuleSetUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - ruleSetName := d.Get("rule_set_name").(string) - - createOpts := &ses.SetActiveReceiptRuleSetInput{ - RuleSetName: aws.String(ruleSetName), - } - - _, err := conn.SetActiveReceiptRuleSet(createOpts) - if err != nil { - return fmt.Errorf("Error setting active SES rule set: %s", err) - } - - d.SetId(ruleSetName) - - return resourceAwsSesActiveReceiptRuleSetRead(d, meta) -} - -func resourceAwsSesActiveReceiptRuleSetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - describeOpts := &ses.DescribeActiveReceiptRuleSetInput{} - - response, err := conn.DescribeActiveReceiptRuleSet(describeOpts) - if err != nil { - return err - } - - if response.Metadata != nil { - d.Set("rule_set_name", response.Metadata.Name) - } else { - log.Print("[WARN] No active Receipt Rule Set found") - d.SetId("") - } - - return nil -} - -func resourceAwsSesActiveReceiptRuleSetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - deleteOpts := &ses.SetActiveReceiptRuleSetInput{ - RuleSetName: nil, - } - - _, err := conn.SetActiveReceiptRuleSet(deleteOpts) - if err != nil { - return fmt.Errorf("Error deleting active SES rule set: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_configuration_set.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_configuration_set.go deleted file mode 100644 index e631b88..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_configuration_set.go +++ /dev/null @@ -1,110 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSesConfigurationSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSesConfigurationSetCreate, - Read: resourceAwsSesConfigurationSetRead, - Delete: resourceAwsSesConfigurationSetDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsSesConfigurationSetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - configurationSetName := d.Get("name").(string) - - createOpts := &ses.CreateConfigurationSetInput{ - ConfigurationSet: &ses.ConfigurationSet{ - Name: aws.String(configurationSetName), - }, - } - - _, err := conn.CreateConfigurationSet(createOpts) - if err != nil { - return fmt.Errorf("Error creating SES configuration set: %s", err) - } - - d.SetId(configurationSetName) - - return resourceAwsSesConfigurationSetRead(d, meta) -} - -func resourceAwsSesConfigurationSetRead(d *schema.ResourceData, meta interface{}) error { - configurationSetExists, err := findConfigurationSet(d.Id(), nil, meta) - - if !configurationSetExists { - log.Printf("[WARN] SES Configuration Set (%s) not found", d.Id()) - d.SetId("") - return nil - } - - if err != nil { - return err - } - - d.Set("name", d.Id()) - - return nil -} - -func resourceAwsSesConfigurationSetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - log.Printf("[DEBUG] SES Delete Configuration Rule Set: %s", d.Id()) - _, err := conn.DeleteConfigurationSet(&ses.DeleteConfigurationSetInput{ - ConfigurationSetName: aws.String(d.Id()), - }) - - if err != nil { - return err - } - - return nil -} - -func findConfigurationSet(name string, token *string, meta interface{}) (bool, error) { - conn := meta.(*AWSClient).sesConn - - configurationSetExists := false - - listOpts := &ses.ListConfigurationSetsInput{ - NextToken: token, - } - - response, err := conn.ListConfigurationSets(listOpts) - for _, element := range response.ConfigurationSets { - if *element.Name == name { - configurationSetExists = true - } - } - - if err != nil && !configurationSetExists && response.NextToken != nil { - configurationSetExists, err = findConfigurationSet(name, response.NextToken, meta) - } - - if err != nil { - return false, err - } - - return configurationSetExists, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_event_destination.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_event_destination.go deleted file mode 100644 index 2dde76e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_event_destination.go +++ /dev/null @@ -1,214 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSesEventDestination() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSesEventDestinationCreate, - Read: resourceAwsSesEventDestinationRead, - Delete: resourceAwsSesEventDestinationDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "configuration_set_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "enabled": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - - "matching_types": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Set: schema.HashString, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validateMatchingTypes, - }, - }, - - "cloudwatch_destination": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"kinesis_destination"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "default_value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "dimension_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "value_source": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateDimensionValueSource, - }, - }, - }, - }, - - "kinesis_destination": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"cloudwatch_destination"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "stream_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "role_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsSesEventDestinationCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - configurationSetName := d.Get("configuration_set_name").(string) - eventDestinationName := d.Get("name").(string) - enabled := d.Get("enabled").(bool) - matchingEventTypes := d.Get("matching_types").(*schema.Set).List() - - createOpts := &ses.CreateConfigurationSetEventDestinationInput{ - ConfigurationSetName: aws.String(configurationSetName), - EventDestination: &ses.EventDestination{ - Name: aws.String(eventDestinationName), - Enabled: aws.Bool(enabled), - MatchingEventTypes: expandStringList(matchingEventTypes), - }, - } - - if v, ok := d.GetOk("cloudwatch_destination"); ok { - destination := v.(*schema.Set).List() - createOpts.EventDestination.CloudWatchDestination = &ses.CloudWatchDestination{ - DimensionConfigurations: generateCloudWatchDestination(destination), - } - log.Printf("[DEBUG] Creating cloudwatch destination: %#v", destination) - } - - if v, ok := d.GetOk("kinesis_destination"); ok { - destination := v.(*schema.Set).List() - if len(destination) > 1 { - return fmt.Errorf("You can only define a single kinesis destination per record") - } - kinesis := destination[0].(map[string]interface{}) - createOpts.EventDestination.KinesisFirehoseDestination = &ses.KinesisFirehoseDestination{ - DeliveryStreamARN: aws.String(kinesis["stream_arn"].(string)), - IAMRoleARN: aws.String(kinesis["role_arn"].(string)), - } - log.Printf("[DEBUG] Creating kinesis destination: %#v", kinesis) - } - - _, err := conn.CreateConfigurationSetEventDestination(createOpts) - if err != nil { - return fmt.Errorf("Error creating SES configuration set event destination: %s", err) - } - - d.SetId(eventDestinationName) - - log.Printf("[WARN] SES DONE") - return resourceAwsSesEventDestinationRead(d, meta) -} - -func resourceAwsSesEventDestinationRead(d *schema.ResourceData, meta interface{}) error { - - return nil -} - -func resourceAwsSesEventDestinationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - log.Printf("[DEBUG] SES Delete Configuration Set Destination: %s", d.Id()) - _, err := conn.DeleteConfigurationSetEventDestination(&ses.DeleteConfigurationSetEventDestinationInput{ - ConfigurationSetName: aws.String(d.Get("configuration_set_name").(string)), - EventDestinationName: aws.String(d.Id()), - }) - - if err != nil { - return err - } - - return nil -} - -func validateMatchingTypes(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - matchingTypes := map[string]bool{ - "send": true, - "reject": true, - "bounce": true, - "complaint": true, - "delivery": true, - } - - if !matchingTypes[value] { - errors = append(errors, fmt.Errorf("%q must be a valid matching event type value: %q", k, value)) - } - return -} - -func validateDimensionValueSource(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - matchingSource := map[string]bool{ - "messageTag": true, - "emailHeader": true, - } - - if !matchingSource[value] { - errors = append(errors, fmt.Errorf("%q must be a valid dimension value: %q", k, value)) - } - return -} - -func generateCloudWatchDestination(v []interface{}) []*ses.CloudWatchDimensionConfiguration { - - b := make([]*ses.CloudWatchDimensionConfiguration, len(v)) - - for i, vI := range v { - cloudwatch := vI.(map[string]interface{}) - b[i] = &ses.CloudWatchDimensionConfiguration{ - DefaultDimensionValue: aws.String(cloudwatch["default_value"].(string)), - DimensionName: aws.String(cloudwatch["dimension_name"].(string)), - DimensionValueSource: aws.String(cloudwatch["value_source"].(string)), - } - } - - return b -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_filter.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_filter.go deleted file mode 100644 index 2242d7e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_filter.go +++ /dev/null @@ -1,109 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSesReceiptFilter() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSesReceiptFilterCreate, - Read: resourceAwsSesReceiptFilterRead, - Delete: resourceAwsSesReceiptFilterDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "cidr": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "policy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsSesReceiptFilterCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - name := d.Get("name").(string) - - createOpts := &ses.CreateReceiptFilterInput{ - Filter: &ses.ReceiptFilter{ - Name: aws.String(name), - IpFilter: &ses.ReceiptIpFilter{ - Cidr: aws.String(d.Get("cidr").(string)), - Policy: aws.String(d.Get("policy").(string)), - }, - }, - } - - _, err := conn.CreateReceiptFilter(createOpts) - if err != nil { - return fmt.Errorf("Error creating SES receipt filter: %s", err) - } - - d.SetId(name) - - return resourceAwsSesReceiptFilterRead(d, meta) -} - -func resourceAwsSesReceiptFilterRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - listOpts := &ses.ListReceiptFiltersInput{} - - response, err := conn.ListReceiptFilters(listOpts) - if err != nil { - return err - } - - found := false - for _, element := range response.Filters { - if *element.Name == d.Id() { - d.Set("cidr", element.IpFilter.Cidr) - d.Set("policy", element.IpFilter.Policy) - d.Set("name", element.Name) - found = true - } - } - - if !found { - log.Printf("[WARN] SES Receipt Filter (%s) not found", d.Id()) - d.SetId("") - } - - return nil -} - -func resourceAwsSesReceiptFilterDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - deleteOpts := &ses.DeleteReceiptFilterInput{ - FilterName: aws.String(d.Id()), - } - - _, err := conn.DeleteReceiptFilter(deleteOpts) - if err != nil { - return fmt.Errorf("Error deleting SES receipt filter: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_rule.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_rule.go deleted file mode 100644 index 54cb88c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_rule.go +++ /dev/null @@ -1,765 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "sort" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSesReceiptRule() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSesReceiptRuleCreate, - Update: resourceAwsSesReceiptRuleUpdate, - Read: resourceAwsSesReceiptRuleRead, - Delete: resourceAwsSesReceiptRuleDelete, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "rule_set_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "after": { - Type: schema.TypeString, - Optional: true, - }, - - "enabled": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "recipients": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Set: schema.HashString, - }, - - "scan_enabled": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "tls_policy": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "add_header_action": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "header_name": { - Type: schema.TypeString, - Required: true, - }, - - "header_value": { - Type: schema.TypeString, - Required: true, - }, - - "position": { - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["header_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["header_value"].(string))) - buf.WriteString(fmt.Sprintf("%d-", m["position"].(int))) - - return hashcode.String(buf.String()) - }, - }, - - "bounce_action": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "message": { - Type: schema.TypeString, - Required: true, - }, - - "sender": { - Type: schema.TypeString, - Required: true, - }, - - "smtp_reply_code": { - Type: schema.TypeString, - Required: true, - }, - - "status_code": { - Type: schema.TypeString, - Optional: true, - }, - - "topic_arn": { - Type: schema.TypeString, - Optional: true, - }, - - "position": { - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["message"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["sender"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["smtp_reply_code"].(string))) - - if _, ok := m["status_code"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["status_code"].(string))) - } - - if _, ok := m["topic_arn"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["topic_arn"].(string))) - } - - buf.WriteString(fmt.Sprintf("%d-", m["position"].(int))) - - return hashcode.String(buf.String()) - }, - }, - - "lambda_action": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "function_arn": { - Type: schema.TypeString, - Required: true, - }, - - "invocation_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "topic_arn": { - Type: schema.TypeString, - Optional: true, - }, - - "position": { - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["function_arn"].(string))) - - if _, ok := m["invocation_type"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["invocation_type"].(string))) - } - - if _, ok := m["topic_arn"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["topic_arn"].(string))) - } - - buf.WriteString(fmt.Sprintf("%d-", m["position"].(int))) - - return hashcode.String(buf.String()) - }, - }, - - "s3_action": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bucket_name": { - Type: schema.TypeString, - Required: true, - }, - - "kms_key_arn": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateArn, - }, - - "object_key_prefix": { - Type: schema.TypeString, - Optional: true, - }, - - "topic_arn": { - Type: schema.TypeString, - Optional: true, - }, - - "position": { - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["bucket_name"].(string))) - - if _, ok := m["kms_key_arn"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["kms_key_arn"].(string))) - } - - if _, ok := m["object_key_prefix"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["object_key_prefix"].(string))) - } - - if _, ok := m["topic_arn"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["topic_arn"].(string))) - } - - buf.WriteString(fmt.Sprintf("%d-", m["position"].(int))) - - return hashcode.String(buf.String()) - }, - }, - - "sns_action": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "topic_arn": { - Type: schema.TypeString, - Required: true, - }, - - "position": { - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["topic_arn"].(string))) - buf.WriteString(fmt.Sprintf("%d-", m["position"].(int))) - - return hashcode.String(buf.String()) - }, - }, - - "stop_action": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "scope": { - Type: schema.TypeString, - Required: true, - }, - - "topic_arn": { - Type: schema.TypeString, - Optional: true, - }, - - "position": { - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["scope"].(string))) - - if _, ok := m["topic_arn"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["topic_arn"].(string))) - } - - buf.WriteString(fmt.Sprintf("%d-", m["position"].(int))) - - return hashcode.String(buf.String()) - }, - }, - - "workmail_action": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "organization_arn": { - Type: schema.TypeString, - Required: true, - }, - - "topic_arn": { - Type: schema.TypeString, - Optional: true, - }, - - "position": { - Type: schema.TypeInt, - Required: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["organization_arn"].(string))) - - if _, ok := m["topic_arn"]; ok { - buf.WriteString(fmt.Sprintf("%s-", m["topic_arn"].(string))) - } - - buf.WriteString(fmt.Sprintf("%d-", m["position"].(int))) - - return hashcode.String(buf.String()) - }, - }, - }, - } -} - -func resourceAwsSesReceiptRuleCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - createOpts := &ses.CreateReceiptRuleInput{ - Rule: buildReceiptRule(d, meta), - RuleSetName: aws.String(d.Get("rule_set_name").(string)), - } - - if v, ok := d.GetOk("after"); ok { - createOpts.After = aws.String(v.(string)) - } - - _, err := conn.CreateReceiptRule(createOpts) - if err != nil { - return fmt.Errorf("Error creating SES rule: %s", err) - } - - d.SetId(d.Get("name").(string)) - - return resourceAwsSesReceiptRuleUpdate(d, meta) -} - -func resourceAwsSesReceiptRuleUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - updateOpts := &ses.UpdateReceiptRuleInput{ - Rule: buildReceiptRule(d, meta), - RuleSetName: aws.String(d.Get("rule_set_name").(string)), - } - - _, err := conn.UpdateReceiptRule(updateOpts) - if err != nil { - return fmt.Errorf("Error updating SES rule: %s", err) - } - - if d.HasChange("after") { - changePosOpts := &ses.SetReceiptRulePositionInput{ - After: aws.String(d.Get("after").(string)), - RuleName: aws.String(d.Get("name").(string)), - RuleSetName: aws.String(d.Get("rule_set_name").(string)), - } - - _, err := conn.SetReceiptRulePosition(changePosOpts) - if err != nil { - return fmt.Errorf("Error updating SES rule: %s", err) - } - } - - return resourceAwsSesReceiptRuleRead(d, meta) -} - -func resourceAwsSesReceiptRuleRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - describeOpts := &ses.DescribeReceiptRuleInput{ - RuleName: aws.String(d.Id()), - RuleSetName: aws.String(d.Get("rule_set_name").(string)), - } - - response, err := conn.DescribeReceiptRule(describeOpts) - if err != nil { - _, ok := err.(awserr.Error) - if ok && err.(awserr.Error).Code() == "RuleDoesNotExist" { - log.Printf("[WARN] SES Receipt Rule (%s) not found", d.Id()) - d.SetId("") - return nil - } else { - return err - } - } - - d.Set("enabled", *response.Rule.Enabled) - d.Set("recipients", flattenStringList(response.Rule.Recipients)) - d.Set("scan_enabled", *response.Rule.ScanEnabled) - d.Set("tls_policy", *response.Rule.TlsPolicy) - - addHeaderActionList := []map[string]interface{}{} - bounceActionList := []map[string]interface{}{} - lambdaActionList := []map[string]interface{}{} - s3ActionList := []map[string]interface{}{} - snsActionList := []map[string]interface{}{} - stopActionList := []map[string]interface{}{} - workmailActionList := []map[string]interface{}{} - - for i, element := range response.Rule.Actions { - if element.AddHeaderAction != nil { - addHeaderAction := map[string]interface{}{ - "header_name": *element.AddHeaderAction.HeaderName, - "header_value": *element.AddHeaderAction.HeaderValue, - "position": i, - } - addHeaderActionList = append(addHeaderActionList, addHeaderAction) - } - - if element.BounceAction != nil { - bounceAction := map[string]interface{}{ - "message": *element.BounceAction.Message, - "sender": *element.BounceAction.Sender, - "smtp_reply_code": *element.BounceAction.SmtpReplyCode, - "position": i, - } - - if element.BounceAction.StatusCode != nil { - bounceAction["status_code"] = *element.BounceAction.StatusCode - } - - if element.BounceAction.TopicArn != nil { - bounceAction["topic_arn"] = *element.BounceAction.TopicArn - } - - bounceActionList = append(bounceActionList, bounceAction) - } - - if element.LambdaAction != nil { - lambdaAction := map[string]interface{}{ - "function_arn": *element.LambdaAction.FunctionArn, - "position": i, - } - - if element.LambdaAction.InvocationType != nil { - lambdaAction["invocation_type"] = *element.LambdaAction.InvocationType - } - - if element.LambdaAction.TopicArn != nil { - lambdaAction["topic_arn"] = *element.LambdaAction.TopicArn - } - - lambdaActionList = append(lambdaActionList, lambdaAction) - } - - if element.S3Action != nil { - s3Action := map[string]interface{}{ - "bucket_name": *element.S3Action.BucketName, - "position": i, - } - - if element.S3Action.KmsKeyArn != nil { - s3Action["kms_key_arn"] = *element.S3Action.KmsKeyArn - } - - if element.S3Action.ObjectKeyPrefix != nil { - s3Action["object_key_prefix"] = *element.S3Action.ObjectKeyPrefix - } - - if element.S3Action.TopicArn != nil { - s3Action["topic_arn"] = *element.S3Action.TopicArn - } - - s3ActionList = append(s3ActionList, s3Action) - } - - if element.SNSAction != nil { - snsAction := map[string]interface{}{ - "topic_arn": *element.SNSAction.TopicArn, - "position": i, - } - - snsActionList = append(snsActionList, snsAction) - } - - if element.StopAction != nil { - stopAction := map[string]interface{}{ - "scope": *element.StopAction.Scope, - "position": i, - } - - if element.StopAction.TopicArn != nil { - stopAction["topic_arn"] = *element.StopAction.TopicArn - } - - stopActionList = append(stopActionList, stopAction) - } - - if element.WorkmailAction != nil { - workmailAction := map[string]interface{}{ - "organization_arn": *element.WorkmailAction.OrganizationArn, - "position": i, - } - - if element.WorkmailAction.TopicArn != nil { - workmailAction["topic_arn"] = *element.WorkmailAction.TopicArn - } - - workmailActionList = append(workmailActionList, workmailAction) - } - - } - - err = d.Set("add_header_action", addHeaderActionList) - if err != nil { - return err - } - - err = d.Set("bounce_action", bounceActionList) - if err != nil { - return err - } - - err = d.Set("lambda_action", lambdaActionList) - if err != nil { - return err - } - - err = d.Set("s3_action", s3ActionList) - if err != nil { - return err - } - - err = d.Set("sns_action", snsActionList) - if err != nil { - return err - } - - err = d.Set("stop_action", stopActionList) - if err != nil { - return err - } - - err = d.Set("workmail_action", workmailActionList) - if err != nil { - return err - } - - return nil -} - -func resourceAwsSesReceiptRuleDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - deleteOpts := &ses.DeleteReceiptRuleInput{ - RuleName: aws.String(d.Id()), - RuleSetName: aws.String(d.Get("rule_set_name").(string)), - } - - _, err := conn.DeleteReceiptRule(deleteOpts) - if err != nil { - return fmt.Errorf("Error deleting SES receipt rule: %s", err) - } - - return nil -} - -func buildReceiptRule(d *schema.ResourceData, meta interface{}) *ses.ReceiptRule { - receiptRule := &ses.ReceiptRule{ - Name: aws.String(d.Get("name").(string)), - } - - if v, ok := d.GetOk("enabled"); ok { - receiptRule.Enabled = aws.Bool(v.(bool)) - } - - if v, ok := d.GetOk("recipients"); ok { - receiptRule.Recipients = expandStringList(v.(*schema.Set).List()) - } - - if v, ok := d.GetOk("scan_enabled"); ok { - receiptRule.ScanEnabled = aws.Bool(v.(bool)) - } - - if v, ok := d.GetOk("tls_policy"); ok { - receiptRule.TlsPolicy = aws.String(v.(string)) - } - - actions := make(map[int]*ses.ReceiptAction) - - if v, ok := d.GetOk("add_header_action"); ok { - for _, element := range v.(*schema.Set).List() { - elem := element.(map[string]interface{}) - - actions[elem["position"].(int)] = &ses.ReceiptAction{ - AddHeaderAction: &ses.AddHeaderAction{ - HeaderName: aws.String(elem["header_name"].(string)), - HeaderValue: aws.String(elem["header_value"].(string)), - }, - } - } - } - - if v, ok := d.GetOk("bounce_action"); ok { - for _, element := range v.(*schema.Set).List() { - elem := element.(map[string]interface{}) - - bounceAction := &ses.BounceAction{ - Message: aws.String(elem["message"].(string)), - Sender: aws.String(elem["sender"].(string)), - SmtpReplyCode: aws.String(elem["smtp_reply_code"].(string)), - } - - if elem["status_code"] != "" { - bounceAction.StatusCode = aws.String(elem["status_code"].(string)) - } - - if elem["topic_arn"] != "" { - bounceAction.TopicArn = aws.String(elem["topic_arn"].(string)) - } - - actions[elem["position"].(int)] = &ses.ReceiptAction{ - BounceAction: bounceAction, - } - } - } - - if v, ok := d.GetOk("lambda_action"); ok { - for _, element := range v.(*schema.Set).List() { - elem := element.(map[string]interface{}) - - lambdaAction := &ses.LambdaAction{ - FunctionArn: aws.String(elem["function_arn"].(string)), - } - - if elem["invocation_type"] != "" { - lambdaAction.InvocationType = aws.String(elem["invocation_type"].(string)) - } - - if elem["topic_arn"] != "" { - lambdaAction.TopicArn = aws.String(elem["topic_arn"].(string)) - } - - actions[elem["position"].(int)] = &ses.ReceiptAction{ - LambdaAction: lambdaAction, - } - } - } - - if v, ok := d.GetOk("s3_action"); ok { - for _, element := range v.(*schema.Set).List() { - elem := element.(map[string]interface{}) - - s3Action := &ses.S3Action{ - BucketName: aws.String(elem["bucket_name"].(string)), - KmsKeyArn: aws.String(elem["kms_key_arn"].(string)), - ObjectKeyPrefix: aws.String(elem["object_key_prefix"].(string)), - } - - if elem["topic_arn"] != "" { - s3Action.TopicArn = aws.String(elem["topic_arn"].(string)) - } - - actions[elem["position"].(int)] = &ses.ReceiptAction{ - S3Action: s3Action, - } - } - } - - if v, ok := d.GetOk("sns_action"); ok { - for _, element := range v.(*schema.Set).List() { - elem := element.(map[string]interface{}) - - snsAction := &ses.SNSAction{ - TopicArn: aws.String(elem["topic_arn"].(string)), - } - - actions[elem["position"].(int)] = &ses.ReceiptAction{ - SNSAction: snsAction, - } - } - } - - if v, ok := d.GetOk("stop_action"); ok { - for _, element := range v.(*schema.Set).List() { - elem := element.(map[string]interface{}) - - stopAction := &ses.StopAction{ - Scope: aws.String(elem["scope"].(string)), - } - - if elem["topic_arn"] != "" { - stopAction.TopicArn = aws.String(elem["topic_arn"].(string)) - } - - actions[elem["position"].(int)] = &ses.ReceiptAction{ - StopAction: stopAction, - } - } - } - - if v, ok := d.GetOk("workmail_action"); ok { - for _, element := range v.(*schema.Set).List() { - elem := element.(map[string]interface{}) - - workmailAction := &ses.WorkmailAction{ - OrganizationArn: aws.String(elem["organization_arn"].(string)), - } - - if elem["topic_arn"] != "" { - workmailAction.TopicArn = aws.String(elem["topic_arn"].(string)) - } - - actions[elem["position"].(int)] = &ses.ReceiptAction{ - WorkmailAction: workmailAction, - } - } - } - - var keys []int - for k := range actions { - keys = append(keys, k) - } - sort.Ints(keys) - - sortedActions := []*ses.ReceiptAction{} - for _, k := range keys { - sortedActions = append(sortedActions, actions[k]) - } - - receiptRule.Actions = sortedActions - - return receiptRule -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_rule_set.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_rule_set.go deleted file mode 100644 index dfaf98c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ses_receipt_rule_set.go +++ /dev/null @@ -1,108 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSesReceiptRuleSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSesReceiptRuleSetCreate, - Read: resourceAwsSesReceiptRuleSetRead, - Delete: resourceAwsSesReceiptRuleSetDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "rule_set_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsSesReceiptRuleSetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - ruleSetName := d.Get("rule_set_name").(string) - - createOpts := &ses.CreateReceiptRuleSetInput{ - RuleSetName: aws.String(ruleSetName), - } - - _, err := conn.CreateReceiptRuleSet(createOpts) - if err != nil { - return fmt.Errorf("Error creating SES rule set: %s", err) - } - - d.SetId(ruleSetName) - - return resourceAwsSesReceiptRuleSetRead(d, meta) -} - -func resourceAwsSesReceiptRuleSetRead(d *schema.ResourceData, meta interface{}) error { - ruleSetExists, err := findRuleSet(d.Id(), nil, meta) - - if !ruleSetExists { - log.Printf("[WARN] SES Receipt Rule Set (%s) not found", d.Id()) - d.SetId("") - return nil - } - - if err != nil { - return err - } - - d.Set("rule_set_name", d.Id()) - - return nil -} - -func resourceAwsSesReceiptRuleSetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sesConn - - log.Printf("[DEBUG] SES Delete Receipt Rule Set: %s", d.Id()) - _, err := conn.DeleteReceiptRuleSet(&ses.DeleteReceiptRuleSetInput{ - RuleSetName: aws.String(d.Id()), - }) - - if err != nil { - return err - } - - return nil -} - -func findRuleSet(name string, token *string, meta interface{}) (bool, error) { - conn := meta.(*AWSClient).sesConn - - ruleSetExists := false - - listOpts := &ses.ListReceiptRuleSetsInput{ - NextToken: token, - } - - response, err := conn.ListReceiptRuleSets(listOpts) - for _, element := range response.RuleSets { - if *element.Name == name { - ruleSetExists = true - } - } - - if err != nil && !ruleSetExists && response.NextToken != nil { - ruleSetExists, err = findRuleSet(name, response.NextToken, meta) - } - - if err != nil { - return false, err - } - - return ruleSetExists, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sfn_activity.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sfn_activity.go deleted file mode 100644 index 7ed65d1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sfn_activity.go +++ /dev/null @@ -1,97 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/sfn" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSfnActivity() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSfnActivityCreate, - Read: resourceAwsSfnActivityRead, - Delete: resourceAwsSfnActivityDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateSfnActivityName, - }, - - "creation_date": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsSfnActivityCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sfnconn - log.Print("[DEBUG] Creating Step Function Activity") - - params := &sfn.CreateActivityInput{ - Name: aws.String(d.Get("name").(string)), - } - - activity, err := conn.CreateActivity(params) - if err != nil { - return fmt.Errorf("Error creating Step Function Activity: %s", err) - } - - d.SetId(*activity.ActivityArn) - - return resourceAwsSfnActivityRead(d, meta) -} - -func resourceAwsSfnActivityRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sfnconn - log.Printf("[DEBUG] Reading Step Function Activity: %s", d.Id()) - - sm, err := conn.DescribeActivity(&sfn.DescribeActivityInput{ - ActivityArn: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ActivityDoesNotExist" { - d.SetId("") - return nil - } - return err - } - - d.Set("name", sm.Name) - - if err := d.Set("creation_date", sm.CreationDate.Format(time.RFC3339)); err != nil { - log.Printf("[DEBUG] Error setting creation_date: %s", err) - } - - return nil -} - -func resourceAwsSfnActivityDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sfnconn - log.Printf("[DEBUG] Deleting Step Functions Activity: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteActivity(&sfn.DeleteActivityInput{ - ActivityArn: aws.String(d.Id()), - }) - - if err == nil { - return nil - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sfn_state_machine.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sfn_state_machine.go deleted file mode 100644 index 9d0fc4c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sfn_state_machine.go +++ /dev/null @@ -1,140 +0,0 @@ -package aws - -import ( - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/sfn" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSfnStateMachine() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSfnStateMachineCreate, - Read: resourceAwsSfnStateMachineRead, - Delete: resourceAwsSfnStateMachineDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "definition": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateSfnStateMachineDefinition, - }, - - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateSfnStateMachineName, - }, - - "role_arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateArn, - }, - - "creation_date": { - Type: schema.TypeString, - Computed: true, - }, - - "status": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsSfnStateMachineCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sfnconn - log.Print("[DEBUG] Creating Step Function State Machine") - - params := &sfn.CreateStateMachineInput{ - Definition: aws.String(d.Get("definition").(string)), - Name: aws.String(d.Get("name").(string)), - RoleArn: aws.String(d.Get("role_arn").(string)), - } - - var activity *sfn.CreateStateMachineOutput - - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - var err error - activity, err = conn.CreateStateMachine(params) - - if err != nil { - // Note: the instance may be in a deleting mode, hence the retry - // when creating the step function. This can happen when we are - // updating the resource (since there is no update API call). - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "StateMachineDeleting" { - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - } - - return nil - }) - - if err != nil { - return errwrap.Wrapf("Error creating Step Function State Machine: {{err}}", err) - } - - d.SetId(*activity.StateMachineArn) - - return resourceAwsSfnStateMachineRead(d, meta) -} - -func resourceAwsSfnStateMachineRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sfnconn - log.Printf("[DEBUG] Reading Step Function State Machine: %s", d.Id()) - - sm, err := conn.DescribeStateMachine(&sfn.DescribeStateMachineInput{ - StateMachineArn: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { - d.SetId("") - return nil - } - return err - } - - d.Set("definition", sm.Definition) - d.Set("name", sm.Name) - d.Set("role_arn", sm.RoleArn) - d.Set("status", sm.Status) - - if err := d.Set("creation_date", sm.CreationDate.Format(time.RFC3339)); err != nil { - log.Printf("[DEBUG] Error setting creation_date: %s", err) - } - - return nil -} - -func resourceAwsSfnStateMachineDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sfnconn - log.Printf("[DEBUG] Deleting Step Function State Machine: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteStateMachine(&sfn.DeleteStateMachineInput{ - StateMachineArn: aws.String(d.Id()), - }) - - if err == nil { - return nil - } - - return resource.NonRetryableError(err) - }) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_simpledb_domain.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_simpledb_domain.go deleted file mode 100644 index 8450342..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_simpledb_domain.go +++ /dev/null @@ -1,84 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/simpledb" -) - -func resourceAwsSimpleDBDomain() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSimpleDBDomainCreate, - Read: resourceAwsSimpleDBDomainRead, - Delete: resourceAwsSimpleDBDomainDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsSimpleDBDomainCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).simpledbconn - - name := d.Get("name").(string) - input := &simpledb.CreateDomainInput{ - DomainName: aws.String(name), - } - _, err := conn.CreateDomain(input) - if err != nil { - return fmt.Errorf("Create SimpleDB Domain failed: %s", err) - } - - d.SetId(name) - return nil -} - -func resourceAwsSimpleDBDomainRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).simpledbconn - - input := &simpledb.DomainMetadataInput{ - DomainName: aws.String(d.Id()), - } - _, err := conn.DomainMetadata(input) - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NoSuchDomain" { - log.Printf("[WARN] Removing SimpleDB domain %q because it's gone.", d.Id()) - d.SetId("") - return nil - } - } - if err != nil { - return err - } - - d.Set("name", d.Id()) - return nil -} - -func resourceAwsSimpleDBDomainDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).simpledbconn - - input := &simpledb.DeleteDomainInput{ - DomainName: aws.String(d.Id()), - } - _, err := conn.DeleteDomain(input) - if err != nil { - return fmt.Errorf("Delete SimpleDB Domain failed: %s", err) - } - - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_snapshot_create_volume_permission.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_snapshot_create_volume_permission.go deleted file mode 100644 index 6a7fd40..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_snapshot_create_volume_permission.go +++ /dev/null @@ -1,152 +0,0 @@ -package aws - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSnapshotCreateVolumePermission() *schema.Resource { - return &schema.Resource{ - Exists: resourceAwsSnapshotCreateVolumePermissionExists, - Create: resourceAwsSnapshotCreateVolumePermissionCreate, - Read: resourceAwsSnapshotCreateVolumePermissionRead, - Delete: resourceAwsSnapshotCreateVolumePermissionDelete, - - Schema: map[string]*schema.Schema{ - "snapshot_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "account_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsSnapshotCreateVolumePermissionExists(d *schema.ResourceData, meta interface{}) (bool, error) { - conn := meta.(*AWSClient).ec2conn - - snapshot_id := d.Get("snapshot_id").(string) - account_id := d.Get("account_id").(string) - return hasCreateVolumePermission(conn, snapshot_id, account_id) -} - -func resourceAwsSnapshotCreateVolumePermissionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - snapshot_id := d.Get("snapshot_id").(string) - account_id := d.Get("account_id").(string) - - _, err := conn.ModifySnapshotAttribute(&ec2.ModifySnapshotAttributeInput{ - SnapshotId: aws.String(snapshot_id), - Attribute: aws.String("createVolumePermission"), - CreateVolumePermission: &ec2.CreateVolumePermissionModifications{ - Add: []*ec2.CreateVolumePermission{ - &ec2.CreateVolumePermission{UserId: aws.String(account_id)}, - }, - }, - }) - if err != nil { - return fmt.Errorf("Error adding snapshot createVolumePermission: %s", err) - } - - d.SetId(fmt.Sprintf("%s-%s", snapshot_id, account_id)) - - // Wait for the account to appear in the permission list - stateConf := &resource.StateChangeConf{ - Pending: []string{"denied"}, - Target: []string{"granted"}, - Refresh: resourceAwsSnapshotCreateVolumePermissionStateRefreshFunc(conn, snapshot_id, account_id), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for snapshot createVolumePermission (%s) to be added: %s", - d.Id(), err) - } - - return nil -} - -func resourceAwsSnapshotCreateVolumePermissionRead(d *schema.ResourceData, meta interface{}) error { - return nil -} - -func resourceAwsSnapshotCreateVolumePermissionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - snapshot_id := d.Get("snapshot_id").(string) - account_id := d.Get("account_id").(string) - - _, err := conn.ModifySnapshotAttribute(&ec2.ModifySnapshotAttributeInput{ - SnapshotId: aws.String(snapshot_id), - Attribute: aws.String("createVolumePermission"), - CreateVolumePermission: &ec2.CreateVolumePermissionModifications{ - Remove: []*ec2.CreateVolumePermission{ - &ec2.CreateVolumePermission{UserId: aws.String(account_id)}, - }, - }, - }) - if err != nil { - return fmt.Errorf("Error removing snapshot createVolumePermission: %s", err) - } - - // Wait for the account to disappear from the permission list - stateConf := &resource.StateChangeConf{ - Pending: []string{"granted"}, - Target: []string{"denied"}, - Refresh: resourceAwsSnapshotCreateVolumePermissionStateRefreshFunc(conn, snapshot_id, account_id), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for snapshot createVolumePermission (%s) to be removed: %s", - d.Id(), err) - } - - return nil -} - -func hasCreateVolumePermission(conn *ec2.EC2, snapshot_id string, account_id string) (bool, error) { - _, state, err := resourceAwsSnapshotCreateVolumePermissionStateRefreshFunc(conn, snapshot_id, account_id)() - if err != nil { - return false, err - } - if state == "granted" { - return true, nil - } else { - return false, nil - } -} - -func resourceAwsSnapshotCreateVolumePermissionStateRefreshFunc(conn *ec2.EC2, snapshot_id string, account_id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - attrs, err := conn.DescribeSnapshotAttribute(&ec2.DescribeSnapshotAttributeInput{ - SnapshotId: aws.String(snapshot_id), - Attribute: aws.String("createVolumePermission"), - }) - if err != nil { - return nil, "", fmt.Errorf("Error refreshing snapshot createVolumePermission state: %s", err) - } - - for _, vp := range attrs.CreateVolumePermissions { - if *vp.UserId == account_id { - return attrs, "granted", nil - } - } - return attrs, "denied", nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic.go deleted file mode 100644 index f332086..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic.go +++ /dev/null @@ -1,221 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/sns" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -// Mutable attributes -var SNSAttributeMap = map[string]string{ - "arn": "TopicArn", - "display_name": "DisplayName", - "policy": "Policy", - "delivery_policy": "DeliveryPolicy", -} - -func resourceAwsSnsTopic() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSnsTopicCreate, - Read: resourceAwsSnsTopicRead, - Update: resourceAwsSnsTopicUpdate, - Delete: resourceAwsSnsTopicDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "display_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: false, - }, - "policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - StateFunc: func(v interface{}) string { - json, _ := normalizeJsonString(v) - return json - }, - }, - "delivery_policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: false, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsSnsTopicCreate(d *schema.ResourceData, meta interface{}) error { - snsconn := meta.(*AWSClient).snsconn - - name := d.Get("name").(string) - - log.Printf("[DEBUG] SNS create topic: %s", name) - - req := &sns.CreateTopicInput{ - Name: aws.String(name), - } - - output, err := snsconn.CreateTopic(req) - if err != nil { - return fmt.Errorf("Error creating SNS topic: %s", err) - } - - d.SetId(*output.TopicArn) - - // Write the ARN to the 'arn' field for export - d.Set("arn", *output.TopicArn) - - return resourceAwsSnsTopicUpdate(d, meta) -} - -func resourceAwsSnsTopicUpdate(d *schema.ResourceData, meta interface{}) error { - r := *resourceAwsSnsTopic() - - for k, _ := range r.Schema { - if attrKey, ok := SNSAttributeMap[k]; ok { - if d.HasChange(k) { - log.Printf("[DEBUG] Updating %s", attrKey) - _, n := d.GetChange(k) - // Ignore an empty policy - if !(k == "policy" && n == "") { - // Make API call to update attributes - req := sns.SetTopicAttributesInput{ - TopicArn: aws.String(d.Id()), - AttributeName: aws.String(attrKey), - AttributeValue: aws.String(n.(string)), - } - - // Retry the update in the event of an eventually consistent style of - // error, where say an IAM resource is successfully created but not - // actually available. See https://github.com/hashicorp/terraform/issues/3660 - log.Printf("[DEBUG] Updating SNS Topic (%s) attributes request: %s", d.Id(), req) - stateConf := &resource.StateChangeConf{ - Pending: []string{"retrying"}, - Target: []string{"success"}, - Refresh: resourceAwsSNSUpdateRefreshFunc(meta, req), - Timeout: 1 * time.Minute, - MinTimeout: 3 * time.Second, - } - _, err := stateConf.WaitForState() - if err != nil { - return err - } - } - } - } - } - - return resourceAwsSnsTopicRead(d, meta) -} - -func resourceAwsSNSUpdateRefreshFunc( - meta interface{}, params sns.SetTopicAttributesInput) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - snsconn := meta.(*AWSClient).snsconn - if _, err := snsconn.SetTopicAttributes(¶ms); err != nil { - log.Printf("[WARN] Erroring updating topic attributes: %s", err) - if awsErr, ok := err.(awserr.Error); ok { - // if the error contains the PrincipalNotFound message, we can retry - if strings.Contains(awsErr.Message(), "PrincipalNotFound") { - log.Printf("[DEBUG] Retrying AWS SNS Topic Update: %s", params) - return nil, "retrying", nil - } - } - return nil, "failed", err - } - return 42, "success", nil - } -} - -func resourceAwsSnsTopicRead(d *schema.ResourceData, meta interface{}) error { - snsconn := meta.(*AWSClient).snsconn - - attributeOutput, err := snsconn.GetTopicAttributes(&sns.GetTopicAttributesInput{ - TopicArn: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFound" { - log.Printf("[WARN] SNS Topic (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - if attributeOutput.Attributes != nil && len(attributeOutput.Attributes) > 0 { - attrmap := attributeOutput.Attributes - resource := *resourceAwsSnsTopic() - // iKey = internal struct key, oKey = AWS Attribute Map key - for iKey, oKey := range SNSAttributeMap { - log.Printf("[DEBUG] Reading %s => %s", iKey, oKey) - - if attrmap[oKey] != nil { - // Some of the fetched attributes are stateful properties such as - // the number of subscriptions, the owner, etc. skip those - if resource.Schema[iKey] != nil { - var value string - if iKey == "policy" { - value, err = normalizeJsonString(*attrmap[oKey]) - if err != nil { - return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) - } - } else { - value = *attrmap[oKey] - } - log.Printf("[DEBUG] Reading %s => %s -> %s", iKey, oKey, value) - d.Set(iKey, value) - } - } - } - } - - // If we have no name set (import) then determine it from the ARN. - // This is a bit of a heuristic for now since AWS provides no other - // way to get it. - if _, ok := d.GetOk("name"); !ok { - arn := d.Get("arn").(string) - idx := strings.LastIndex(arn, ":") - if idx > -1 { - d.Set("name", arn[idx+1:]) - } - } - - return nil -} - -func resourceAwsSnsTopicDelete(d *schema.ResourceData, meta interface{}) error { - snsconn := meta.(*AWSClient).snsconn - - log.Printf("[DEBUG] SNS Delete Topic: %s", d.Id()) - _, err := snsconn.DeleteTopic(&sns.DeleteTopicInput{ - TopicArn: aws.String(d.Id()), - }) - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic_policy.go deleted file mode 100644 index 288a9a4..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic_policy.go +++ /dev/null @@ -1,179 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "time" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/sns" -) - -func resourceAwsSnsTopicPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSnsTopicPolicyUpsert, - Read: resourceAwsSnsTopicPolicyRead, - Update: resourceAwsSnsTopicPolicyUpsert, - Delete: resourceAwsSnsTopicPolicyDelete, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "policy": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - }, - } -} - -func resourceAwsSnsTopicPolicyUpsert(d *schema.ResourceData, meta interface{}) error { - arn := d.Get("arn").(string) - req := sns.SetTopicAttributesInput{ - TopicArn: aws.String(arn), - AttributeName: aws.String("Policy"), - AttributeValue: aws.String(d.Get("policy").(string)), - } - - d.SetId(arn) - - // Retry the update in the event of an eventually consistent style of - // error, where say an IAM resource is successfully created but not - // actually available. See https://github.com/hashicorp/terraform/issues/3660 - log.Printf("[DEBUG] Updating SNS Topic Policy: %s", req) - stateConf := &resource.StateChangeConf{ - Pending: []string{"retrying"}, - Target: []string{"success"}, - Refresh: resourceAwsSNSUpdateRefreshFunc(meta, req), - Timeout: 3 * time.Minute, - MinTimeout: 3 * time.Second, - } - _, err := stateConf.WaitForState() - if err != nil { - return err - } - - return resourceAwsSnsTopicPolicyRead(d, meta) -} - -func resourceAwsSnsTopicPolicyRead(d *schema.ResourceData, meta interface{}) error { - snsconn := meta.(*AWSClient).snsconn - - attributeOutput, err := snsconn.GetTopicAttributes(&sns.GetTopicAttributesInput{ - TopicArn: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFound" { - log.Printf("[WARN] SNS Topic (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - if attributeOutput.Attributes == nil { - log.Printf("[WARN] SNS Topic (%q) attributes not found (nil)", d.Id()) - d.SetId("") - return nil - } - attrmap := attributeOutput.Attributes - - policy, ok := attrmap["Policy"] - if !ok { - log.Printf("[WARN] SNS Topic (%q) policy not found in attributes", d.Id()) - d.SetId("") - return nil - } - - d.Set("policy", policy) - - return nil -} - -func resourceAwsSnsTopicPolicyDelete(d *schema.ResourceData, meta interface{}) error { - accountId, err := getAccountIdFromSnsTopicArn(d.Id(), meta.(*AWSClient).partition) - if err != nil { - return err - } - - req := sns.SetTopicAttributesInput{ - TopicArn: aws.String(d.Id()), - AttributeName: aws.String("Policy"), - // It is impossible to delete a policy or set to empty - // (confirmed by AWS Support representative) - // so we instead set it back to the default one - AttributeValue: aws.String(buildDefaultSnsTopicPolicy(d.Id(), accountId)), - } - - // Retry the update in the event of an eventually consistent style of - // error, where say an IAM resource is successfully created but not - // actually available. See https://github.com/hashicorp/terraform/issues/3660 - log.Printf("[DEBUG] Resetting SNS Topic Policy to default: %s", req) - stateConf := &resource.StateChangeConf{ - Pending: []string{"retrying"}, - Target: []string{"success"}, - Refresh: resourceAwsSNSUpdateRefreshFunc(meta, req), - Timeout: 3 * time.Minute, - MinTimeout: 3 * time.Second, - } - _, err = stateConf.WaitForState() - if err != nil { - return err - } - return nil -} - -func getAccountIdFromSnsTopicArn(arn, partition string) (string, error) { - // arn:aws:sns:us-west-2:123456789012:test-new - // arn:aws-us-gov:sns:us-west-2:123456789012:test-new - re := regexp.MustCompile(fmt.Sprintf("^arn:%s:sns:[^:]+:([0-9]{12}):.+", partition)) - matches := re.FindStringSubmatch(arn) - if len(matches) != 2 { - return "", fmt.Errorf("Unable to get account ID from ARN (%q)", arn) - } - return matches[1], nil -} - -func buildDefaultSnsTopicPolicy(topicArn, accountId string) string { - return fmt.Sprintf(`{ - "Version": "2008-10-17", - "Id": "__default_policy_ID", - "Statement": [ - { - "Sid": "__default_statement_ID", - "Effect": "Allow", - "Principal": { - "AWS": "*" - }, - "Action": [ - "SNS:GetTopicAttributes", - "SNS:SetTopicAttributes", - "SNS:AddPermission", - "SNS:RemovePermission", - "SNS:DeleteTopic", - "SNS:Subscribe", - "SNS:ListSubscriptionsByTopic", - "SNS:Publish", - "SNS:Receive" - ], - "Resource": "%s", - "Condition": { - "StringEquals": { - "AWS:SourceOwner": "%s" - } - } - } - ] -}`, topicArn, accountId) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic_subscription.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic_subscription.go deleted file mode 100644 index 0259230..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sns_topic_subscription.go +++ /dev/null @@ -1,298 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" - - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/sns" -) - -const awsSNSPendingConfirmationMessage = "pending confirmation" -const awsSNSPendingConfirmationMessageWithoutSpaces = "pendingconfirmation" - -var SNSSubscriptionAttributeMap = map[string]string{ - "topic_arn": "TopicArn", - "endpoint": "Endpoint", - "protocol": "Protocol", - "raw_message_delivery": "RawMessageDelivery", -} - -func resourceAwsSnsTopicSubscription() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSnsTopicSubscriptionCreate, - Read: resourceAwsSnsTopicSubscriptionRead, - Update: resourceAwsSnsTopicSubscriptionUpdate, - Delete: resourceAwsSnsTopicSubscriptionDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "protocol": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: false, - ValidateFunc: validateSNSSubscriptionProtocol, - }, - "endpoint": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "endpoint_auto_confirms": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "confirmation_timeout_in_minutes": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 1, - }, - "topic_arn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "delivery_policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "raw_message_delivery": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "arn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceAwsSnsTopicSubscriptionCreate(d *schema.ResourceData, meta interface{}) error { - snsconn := meta.(*AWSClient).snsconn - - output, err := subscribeToSNSTopic(d, snsconn) - - if err != nil { - return err - } - - if subscriptionHasPendingConfirmation(output.SubscriptionArn) { - log.Printf("[WARN] Invalid SNS Subscription, received a \"%s\" ARN", awsSNSPendingConfirmationMessage) - return nil - } - - log.Printf("New subscription ARN: %s", *output.SubscriptionArn) - d.SetId(*output.SubscriptionArn) - - // Write the ARN to the 'arn' field for export - d.Set("arn", *output.SubscriptionArn) - - return resourceAwsSnsTopicSubscriptionUpdate(d, meta) -} - -func resourceAwsSnsTopicSubscriptionUpdate(d *schema.ResourceData, meta interface{}) error { - snsconn := meta.(*AWSClient).snsconn - - // If any changes happened, un-subscribe and re-subscribe - if d.HasChange("protocol") || d.HasChange("endpoint") || d.HasChange("topic_arn") { - log.Printf("[DEBUG] Updating subscription %s", d.Id()) - // Unsubscribe - _, err := snsconn.Unsubscribe(&sns.UnsubscribeInput{ - SubscriptionArn: aws.String(d.Id()), - }) - - if err != nil { - return fmt.Errorf("Error unsubscribing from SNS topic: %s", err) - } - - // Re-subscribe and set id - output, err := subscribeToSNSTopic(d, snsconn) - d.SetId(*output.SubscriptionArn) - d.Set("arn", *output.SubscriptionArn) - } - - if d.HasChange("raw_message_delivery") { - _, n := d.GetChange("raw_message_delivery") - - attrValue := "false" - - if n.(bool) { - attrValue = "true" - } - - req := &sns.SetSubscriptionAttributesInput{ - SubscriptionArn: aws.String(d.Id()), - AttributeName: aws.String("RawMessageDelivery"), - AttributeValue: aws.String(attrValue), - } - _, err := snsconn.SetSubscriptionAttributes(req) - - if err != nil { - return fmt.Errorf("Unable to set raw message delivery attribute on subscription") - } - } - - return resourceAwsSnsTopicSubscriptionRead(d, meta) -} - -func resourceAwsSnsTopicSubscriptionRead(d *schema.ResourceData, meta interface{}) error { - snsconn := meta.(*AWSClient).snsconn - - log.Printf("[DEBUG] Loading subscription %s", d.Id()) - - attributeOutput, err := snsconn.GetSubscriptionAttributes(&sns.GetSubscriptionAttributesInput{ - SubscriptionArn: aws.String(d.Id()), - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFound" { - log.Printf("[WARN] SNS Topic Subscription (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - if attributeOutput.Attributes != nil && len(attributeOutput.Attributes) > 0 { - attrHash := attributeOutput.Attributes - resource := *resourceAwsSnsTopicSubscription() - - for iKey, oKey := range SNSSubscriptionAttributeMap { - log.Printf("[DEBUG] Reading %s => %s", iKey, oKey) - - if attrHash[oKey] != nil { - if resource.Schema[iKey] != nil { - var value string - value = *attrHash[oKey] - log.Printf("[DEBUG] Reading %s => %s -> %s", iKey, oKey, value) - d.Set(iKey, value) - } - } - } - } - - return nil -} - -func resourceAwsSnsTopicSubscriptionDelete(d *schema.ResourceData, meta interface{}) error { - snsconn := meta.(*AWSClient).snsconn - - log.Printf("[DEBUG] SNS delete topic subscription: %s", d.Id()) - _, err := snsconn.Unsubscribe(&sns.UnsubscribeInput{ - SubscriptionArn: aws.String(d.Id()), - }) - if err != nil { - return err - } - return nil -} - -func subscribeToSNSTopic(d *schema.ResourceData, snsconn *sns.SNS) (output *sns.SubscribeOutput, err error) { - protocol := d.Get("protocol").(string) - endpoint := d.Get("endpoint").(string) - topic_arn := d.Get("topic_arn").(string) - endpoint_auto_confirms := d.Get("endpoint_auto_confirms").(bool) - confirmation_timeout_in_minutes := d.Get("confirmation_timeout_in_minutes").(int) - - if strings.Contains(protocol, "http") && !endpoint_auto_confirms { - return nil, fmt.Errorf("Protocol http/https is only supported for endpoints which auto confirms!") - } - - log.Printf("[DEBUG] SNS create topic subscription: %s (%s) @ '%s'", endpoint, protocol, topic_arn) - - req := &sns.SubscribeInput{ - Protocol: aws.String(protocol), - Endpoint: aws.String(endpoint), - TopicArn: aws.String(topic_arn), - } - - output, err = snsconn.Subscribe(req) - if err != nil { - return nil, fmt.Errorf("Error creating SNS topic: %s", err) - } - - log.Printf("[DEBUG] Finished subscribing to topic %s with subscription arn %s", topic_arn, *output.SubscriptionArn) - - if strings.Contains(protocol, "http") && subscriptionHasPendingConfirmation(output.SubscriptionArn) { - - log.Printf("[DEBUG] SNS create topic subscription is pending so fetching the subscription list for topic : %s (%s) @ '%s'", endpoint, protocol, topic_arn) - - err = resource.Retry(time.Duration(confirmation_timeout_in_minutes)*time.Minute, func() *resource.RetryError { - - subscription, err := findSubscriptionByNonID(d, snsconn) - - if subscription != nil { - output.SubscriptionArn = subscription.SubscriptionArn - return nil - } - - if err != nil { - return resource.RetryableError( - fmt.Errorf("Error fetching subscriptions for SNS topic %s: %s", topic_arn, err)) - } - - return resource.RetryableError( - fmt.Errorf("Endpoint (%s) did not autoconfirm the subscription for topic %s", endpoint, topic_arn)) - }) - - if err != nil { - return nil, err - } - } - - log.Printf("[DEBUG] Created new subscription! %s", *output.SubscriptionArn) - return output, nil -} - -// finds a subscription using protocol, endpoint and topic_arn (which is a key in sns subscription) -func findSubscriptionByNonID(d *schema.ResourceData, snsconn *sns.SNS) (*sns.Subscription, error) { - protocol := d.Get("protocol").(string) - endpoint := d.Get("endpoint").(string) - topic_arn := d.Get("topic_arn").(string) - - req := &sns.ListSubscriptionsByTopicInput{ - TopicArn: aws.String(topic_arn), - } - - for { - - res, err := snsconn.ListSubscriptionsByTopic(req) - - if err != nil { - return nil, fmt.Errorf("Error fetching subscripitions for topic %s : %s", topic_arn, err) - } - - for _, subscription := range res.Subscriptions { - log.Printf("[DEBUG] check subscription with EndPoint %s, Protocol %s, topicARN %s and SubscriptionARN %s", *subscription.Endpoint, *subscription.Protocol, *subscription.TopicArn, *subscription.SubscriptionArn) - if *subscription.Endpoint == endpoint && *subscription.Protocol == protocol && *subscription.TopicArn == topic_arn && !subscriptionHasPendingConfirmation(subscription.SubscriptionArn) { - return subscription, nil - } - } - - // if there are more than 100 subscriptions then go to the next 100 otherwise return nil - if res.NextToken != nil { - req.NextToken = res.NextToken - } else { - return nil, nil - } - } -} - -// returns true if arn is nil or has both pending and confirmation words in the arn -func subscriptionHasPendingConfirmation(arn *string) bool { - if arn != nil && !strings.Contains(strings.Replace(strings.ToLower(*arn), " ", "", -1), awsSNSPendingConfirmationMessageWithoutSpaces) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_datafeed_subscription.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_datafeed_subscription.go deleted file mode 100644 index 2e33227..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_datafeed_subscription.go +++ /dev/null @@ -1,93 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSpotDataFeedSubscription() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSpotDataFeedSubscriptionCreate, - Read: resourceAwsSpotDataFeedSubscriptionRead, - Delete: resourceAwsSpotDataFeedSubscriptionDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "bucket": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "prefix": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsSpotDataFeedSubscriptionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - params := &ec2.CreateSpotDatafeedSubscriptionInput{ - Bucket: aws.String(d.Get("bucket").(string)), - } - - if v, ok := d.GetOk("prefix"); ok { - params.Prefix = aws.String(v.(string)) - } - - log.Printf("[INFO] Creating Spot Datafeed Subscription") - _, err := conn.CreateSpotDatafeedSubscription(params) - if err != nil { - return errwrap.Wrapf("Error Creating Spot Datafeed Subscription: {{err}}", err) - } - - d.SetId("spot-datafeed-subscription") - - return resourceAwsSpotDataFeedSubscriptionRead(d, meta) -} -func resourceAwsSpotDataFeedSubscriptionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeSpotDatafeedSubscription(&ec2.DescribeSpotDatafeedSubscriptionInput{}) - if err != nil { - cgw, ok := err.(awserr.Error) - if ok && cgw.Code() == "InvalidSpotDatafeed.NotFound" { - log.Printf("[WARNING] Spot Datafeed Subscription Not Found so refreshing from state") - d.SetId("") - return nil - } - return errwrap.Wrapf("Error Describing Spot Datafeed Subscription: {{err}}", err) - } - - if resp == nil { - log.Printf("[WARNING] Spot Datafeed Subscription Not Found so refreshing from state") - d.SetId("") - return nil - } - - subscription := *resp.SpotDatafeedSubscription - d.Set("bucket", subscription.Bucket) - d.Set("prefix", subscription.Prefix) - - return nil -} -func resourceAwsSpotDataFeedSubscriptionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[INFO] Deleting Spot Datafeed Subscription") - _, err := conn.DeleteSpotDatafeedSubscription(&ec2.DeleteSpotDatafeedSubscriptionInput{}) - if err != nil { - return errwrap.Wrapf("Error deleting Spot Datafeed Subscription: {{err}}", err) - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go deleted file mode 100644 index db2424e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go +++ /dev/null @@ -1,1029 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSpotFleetRequest() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSpotFleetRequestCreate, - Read: resourceAwsSpotFleetRequestRead, - Delete: resourceAwsSpotFleetRequestDelete, - Update: resourceAwsSpotFleetRequestUpdate, - - SchemaVersion: 1, - MigrateState: resourceAwsSpotFleetRequestMigrateState, - - Schema: map[string]*schema.Schema{ - "iam_fleet_role": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "replace_unhealthy_instances": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Default: false, - }, - // http://docs.aws.amazon.com/sdk-for-go/api/service/ec2.html#type-SpotFleetLaunchSpecification - // http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetLaunchSpecification.html - "launch_specification": { - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "vpc_security_group_ids": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "associate_public_ip_address": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "ebs_block_device": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - }, - "device_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "encrypted": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - ForceNew: true, - }, - "iops": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - "snapshot_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "volume_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - "volume_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - Set: hashEbsBlockDevice, - }, - "ephemeral_block_device": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "device_name": { - Type: schema.TypeString, - Required: true, - }, - "virtual_name": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - Set: hashEphemeralBlockDevice, - }, - "root_block_device": { - // TODO: This is a set because we don't support singleton - // sub-resources today. We'll enforce that the set only ever has - // length zero or one below. When TF gains support for - // sub-resources this can be converted. - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - // "You can only modify the volume size, volume type, and Delete on - // Termination flag on the block device mapping entry for the root - // device volume." - bit.ly/ec2bdmap - Schema: map[string]*schema.Schema{ - "delete_on_termination": { - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - }, - "iops": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - "volume_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ForceNew: true, - }, - "volume_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - Set: hashRootBlockDevice, - }, - "ebs_optimized": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "iam_instance_profile": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - "ami": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "instance_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "key_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - ValidateFunc: validateSpotFleetRequestKeyName, - }, - "monitoring": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "placement_group": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "spot_price": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "user_data": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - StateFunc: func(v interface{}) string { - switch v.(type) { - case string: - return userDataHashSum(v.(string)) - default: - return "" - } - }, - }, - "weighted_capacity": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "subnet_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - }, - }, - Set: hashLaunchSpecification, - }, - // Everything on a spot fleet is ForceNew except target_capacity - "target_capacity": { - Type: schema.TypeInt, - Required: true, - ForceNew: false, - }, - "allocation_strategy": { - Type: schema.TypeString, - Optional: true, - Default: "lowestPrice", - ForceNew: true, - }, - "excess_capacity_termination_policy": { - Type: schema.TypeString, - Optional: true, - Default: "Default", - ForceNew: false, - }, - "spot_price": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "terminate_instances_with_expiration": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - }, - "valid_from": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "valid_until": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "spot_request_state": { - Type: schema.TypeString, - Computed: true, - }, - "client_token": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func buildSpotFleetLaunchSpecification(d map[string]interface{}, meta interface{}) (*ec2.SpotFleetLaunchSpecification, error) { - conn := meta.(*AWSClient).ec2conn - - opts := &ec2.SpotFleetLaunchSpecification{ - ImageId: aws.String(d["ami"].(string)), - InstanceType: aws.String(d["instance_type"].(string)), - SpotPrice: aws.String(d["spot_price"].(string)), - } - - if v, ok := d["availability_zone"]; ok { - opts.Placement = &ec2.SpotPlacement{ - AvailabilityZone: aws.String(v.(string)), - } - } - - if v, ok := d["ebs_optimized"]; ok { - opts.EbsOptimized = aws.Bool(v.(bool)) - } - - if v, ok := d["monitoring"]; ok { - opts.Monitoring = &ec2.SpotFleetMonitoring{ - Enabled: aws.Bool(v.(bool)), - } - } - - if v, ok := d["iam_instance_profile"]; ok { - opts.IamInstanceProfile = &ec2.IamInstanceProfileSpecification{ - Name: aws.String(v.(string)), - } - } - - if v, ok := d["user_data"]; ok { - opts.UserData = aws.String(base64Encode([]byte(v.(string)))) - } - - if v, ok := d["key_name"]; ok { - opts.KeyName = aws.String(v.(string)) - } - - if v, ok := d["weighted_capacity"]; ok && v != "" { - wc, err := strconv.ParseFloat(v.(string), 64) - if err != nil { - return nil, err - } - opts.WeightedCapacity = aws.Float64(wc) - } - - var securityGroupIds []*string - if v, ok := d["vpc_security_group_ids"]; ok { - if s := v.(*schema.Set); s.Len() > 0 { - for _, v := range s.List() { - securityGroupIds = append(securityGroupIds, aws.String(v.(string))) - } - } - } - - subnetId, hasSubnetId := d["subnet_id"] - if hasSubnetId { - opts.SubnetId = aws.String(subnetId.(string)) - } - - associatePublicIpAddress, hasPublicIpAddress := d["associate_public_ip_address"] - if hasPublicIpAddress && associatePublicIpAddress.(bool) == true && hasSubnetId { - - // If we have a non-default VPC / Subnet specified, we can flag - // AssociatePublicIpAddress to get a Public IP assigned. By default these are not provided. - // You cannot specify both SubnetId and the NetworkInterface.0.* parameters though, otherwise - // you get: Network interfaces and an instance-level subnet ID may not be specified on the same request - // You also need to attach Security Groups to the NetworkInterface instead of the instance, - // to avoid: Network interfaces and an instance-level security groups may not be specified on - // the same request - ni := &ec2.InstanceNetworkInterfaceSpecification{ - AssociatePublicIpAddress: aws.Bool(true), - DeleteOnTermination: aws.Bool(true), - DeviceIndex: aws.Int64(int64(0)), - SubnetId: aws.String(subnetId.(string)), - Groups: securityGroupIds, - } - - opts.NetworkInterfaces = []*ec2.InstanceNetworkInterfaceSpecification{ni} - opts.SubnetId = aws.String("") - } else { - for _, id := range securityGroupIds { - opts.SecurityGroups = append(opts.SecurityGroups, &ec2.GroupIdentifier{GroupId: id}) - } - } - - blockDevices, err := readSpotFleetBlockDeviceMappingsFromConfig(d, conn) - if err != nil { - return nil, err - } - if len(blockDevices) > 0 { - opts.BlockDeviceMappings = blockDevices - } - - return opts, nil -} - -func validateSpotFleetRequestKeyName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if value == "" { - errors = append(errors, fmt.Errorf("Key name cannot be empty.")) - } - - return -} - -func readSpotFleetBlockDeviceMappingsFromConfig( - d map[string]interface{}, conn *ec2.EC2) ([]*ec2.BlockDeviceMapping, error) { - blockDevices := make([]*ec2.BlockDeviceMapping, 0) - - if v, ok := d["ebs_block_device"]; ok { - vL := v.(*schema.Set).List() - for _, v := range vL { - bd := v.(map[string]interface{}) - ebs := &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)), - } - - if v, ok := bd["snapshot_id"].(string); ok && v != "" { - ebs.SnapshotId = aws.String(v) - } - - if v, ok := bd["encrypted"].(bool); ok && v { - ebs.Encrypted = aws.Bool(v) - } - - if v, ok := bd["volume_size"].(int); ok && v != 0 { - ebs.VolumeSize = aws.Int64(int64(v)) - } - - if v, ok := bd["volume_type"].(string); ok && v != "" { - ebs.VolumeType = aws.String(v) - } - - if v, ok := bd["iops"].(int); ok && v > 0 { - ebs.Iops = aws.Int64(int64(v)) - } - - blockDevices = append(blockDevices, &ec2.BlockDeviceMapping{ - DeviceName: aws.String(bd["device_name"].(string)), - Ebs: ebs, - }) - } - } - - if v, ok := d["ephemeral_block_device"]; ok { - vL := v.(*schema.Set).List() - for _, v := range vL { - bd := v.(map[string]interface{}) - blockDevices = append(blockDevices, &ec2.BlockDeviceMapping{ - DeviceName: aws.String(bd["device_name"].(string)), - VirtualName: aws.String(bd["virtual_name"].(string)), - }) - } - } - - if v, ok := d["root_block_device"]; ok { - vL := v.(*schema.Set).List() - if len(vL) > 1 { - return nil, fmt.Errorf("Cannot specify more than one root_block_device.") - } - for _, v := range vL { - bd := v.(map[string]interface{}) - ebs := &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(bd["delete_on_termination"].(bool)), - } - - if v, ok := bd["volume_size"].(int); ok && v != 0 { - ebs.VolumeSize = aws.Int64(int64(v)) - } - - if v, ok := bd["volume_type"].(string); ok && v != "" { - ebs.VolumeType = aws.String(v) - } - - if v, ok := bd["iops"].(int); ok && v > 0 { - ebs.Iops = aws.Int64(int64(v)) - } - - if dn, err := fetchRootDeviceName(d["ami"].(string), conn); err == nil { - if dn == nil { - return nil, fmt.Errorf( - "Expected 1 AMI for ID: %s, got none", - d["ami"].(string)) - } - - blockDevices = append(blockDevices, &ec2.BlockDeviceMapping{ - DeviceName: dn, - Ebs: ebs, - }) - } else { - return nil, err - } - } - } - - return blockDevices, nil -} - -func buildAwsSpotFleetLaunchSpecifications( - d *schema.ResourceData, meta interface{}) ([]*ec2.SpotFleetLaunchSpecification, error) { - - user_specs := d.Get("launch_specification").(*schema.Set).List() - specs := make([]*ec2.SpotFleetLaunchSpecification, len(user_specs)) - for i, user_spec := range user_specs { - user_spec_map := user_spec.(map[string]interface{}) - // panic: interface conversion: interface {} is map[string]interface {}, not *schema.ResourceData - opts, err := buildSpotFleetLaunchSpecification(user_spec_map, meta) - if err != nil { - return nil, err - } - specs[i] = opts - } - - return specs, nil -} - -func resourceAwsSpotFleetRequestCreate(d *schema.ResourceData, meta interface{}) error { - // http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html - conn := meta.(*AWSClient).ec2conn - - launch_specs, err := buildAwsSpotFleetLaunchSpecifications(d, meta) - if err != nil { - return err - } - - // http://docs.aws.amazon.com/sdk-for-go/api/service/ec2.html#type-SpotFleetRequestConfigData - spotFleetConfig := &ec2.SpotFleetRequestConfigData{ - IamFleetRole: aws.String(d.Get("iam_fleet_role").(string)), - LaunchSpecifications: launch_specs, - SpotPrice: aws.String(d.Get("spot_price").(string)), - TargetCapacity: aws.Int64(int64(d.Get("target_capacity").(int))), - ClientToken: aws.String(resource.UniqueId()), - TerminateInstancesWithExpiration: aws.Bool(d.Get("terminate_instances_with_expiration").(bool)), - ReplaceUnhealthyInstances: aws.Bool(d.Get("replace_unhealthy_instances").(bool)), - } - - if v, ok := d.GetOk("excess_capacity_termination_policy"); ok { - spotFleetConfig.ExcessCapacityTerminationPolicy = aws.String(v.(string)) - } - - if v, ok := d.GetOk("allocation_strategy"); ok { - spotFleetConfig.AllocationStrategy = aws.String(v.(string)) - } else { - spotFleetConfig.AllocationStrategy = aws.String("lowestPrice") - } - - if v, ok := d.GetOk("valid_from"); ok { - valid_from, err := time.Parse(awsAutoscalingScheduleTimeLayout, v.(string)) - if err != nil { - return err - } - spotFleetConfig.ValidFrom = &valid_from - } - - if v, ok := d.GetOk("valid_until"); ok { - valid_until, err := time.Parse(awsAutoscalingScheduleTimeLayout, v.(string)) - if err != nil { - return err - } - spotFleetConfig.ValidUntil = &valid_until - } else { - valid_until := time.Now().Add(24 * time.Hour) - spotFleetConfig.ValidUntil = &valid_until - } - - // http://docs.aws.amazon.com/sdk-for-go/api/service/ec2.html#type-RequestSpotFleetInput - spotFleetOpts := &ec2.RequestSpotFleetInput{ - SpotFleetRequestConfig: spotFleetConfig, - DryRun: aws.Bool(false), - } - - log.Printf("[DEBUG] Requesting spot fleet with these opts: %+v", spotFleetOpts) - - // Since IAM is eventually consistent, we retry creation as a newly created role may not - // take effect immediately, resulting in an InvalidSpotFleetRequestConfig error - var resp *ec2.RequestSpotFleetOutput - err = resource.Retry(1*time.Minute, func() *resource.RetryError { - var err error - resp, err = conn.RequestSpotFleet(spotFleetOpts) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // IAM is eventually consistent :/ - if awsErr.Code() == "InvalidSpotFleetRequestConfig" { - return resource.RetryableError( - fmt.Errorf("[WARN] Error creating Spot fleet request, retrying: %s", err)) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return fmt.Errorf("Error requesting spot fleet: %s", err) - } - - d.SetId(*resp.SpotFleetRequestId) - - log.Printf("[INFO] Spot Fleet Request ID: %s", d.Id()) - log.Println("[INFO] Waiting for Spot Fleet Request to be active") - stateConf := &resource.StateChangeConf{ - Pending: []string{"submitted"}, - Target: []string{"active"}, - Refresh: resourceAwsSpotFleetRequestStateRefreshFunc(d, meta), - Timeout: 10 * time.Minute, - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return err - } - - return resourceAwsSpotFleetRequestRead(d, meta) -} - -func resourceAwsSpotFleetRequestStateRefreshFunc(d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - conn := meta.(*AWSClient).ec2conn - req := &ec2.DescribeSpotFleetRequestsInput{ - SpotFleetRequestIds: []*string{aws.String(d.Id())}, - } - resp, err := conn.DescribeSpotFleetRequests(req) - - if err != nil { - log.Printf("Error on retrieving Spot Fleet Request when waiting: %s", err) - return nil, "", nil - } - - if resp == nil { - return nil, "", nil - } - - if len(resp.SpotFleetRequestConfigs) == 0 { - return nil, "", nil - } - - spotFleetRequest := resp.SpotFleetRequestConfigs[0] - - return spotFleetRequest, *spotFleetRequest.SpotFleetRequestState, nil - } -} - -func resourceAwsSpotFleetRequestRead(d *schema.ResourceData, meta interface{}) error { - // http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSpotFleetRequests.html - conn := meta.(*AWSClient).ec2conn - - req := &ec2.DescribeSpotFleetRequestsInput{ - SpotFleetRequestIds: []*string{aws.String(d.Id())}, - } - resp, err := conn.DescribeSpotFleetRequests(req) - - if err != nil { - // If the spot request was not found, return nil so that we can show - // that it is gone. - ec2err, ok := err.(awserr.Error) - if ok && ec2err.Code() == "InvalidSpotFleetRequestId.NotFound" { - d.SetId("") - return nil - } - - // Some other error, report it - return err - } - - sfr := resp.SpotFleetRequestConfigs[0] - - // if the request is cancelled, then it is gone - cancelledStates := map[string]bool{ - "cancelled": true, - "cancelled_running": true, - "cancelled_terminating": true, - } - if _, ok := cancelledStates[*sfr.SpotFleetRequestState]; ok { - d.SetId("") - return nil - } - - d.SetId(*sfr.SpotFleetRequestId) - d.Set("spot_request_state", aws.StringValue(sfr.SpotFleetRequestState)) - - config := sfr.SpotFleetRequestConfig - - if config.AllocationStrategy != nil { - d.Set("allocation_strategy", aws.StringValue(config.AllocationStrategy)) - } - - if config.ClientToken != nil { - d.Set("client_token", aws.StringValue(config.ClientToken)) - } - - if config.ExcessCapacityTerminationPolicy != nil { - d.Set("excess_capacity_termination_policy", - aws.StringValue(config.ExcessCapacityTerminationPolicy)) - } - - if config.IamFleetRole != nil { - d.Set("iam_fleet_role", aws.StringValue(config.IamFleetRole)) - } - - if config.SpotPrice != nil { - d.Set("spot_price", aws.StringValue(config.SpotPrice)) - } - - if config.TargetCapacity != nil { - d.Set("target_capacity", aws.Int64Value(config.TargetCapacity)) - } - - if config.TerminateInstancesWithExpiration != nil { - d.Set("terminate_instances_with_expiration", - aws.BoolValue(config.TerminateInstancesWithExpiration)) - } - - if config.ValidFrom != nil { - d.Set("valid_from", - aws.TimeValue(config.ValidFrom).Format(awsAutoscalingScheduleTimeLayout)) - } - - if config.ValidUntil != nil { - d.Set("valid_until", - aws.TimeValue(config.ValidUntil).Format(awsAutoscalingScheduleTimeLayout)) - } - - d.Set("replace_unhealthy_instances", config.ReplaceUnhealthyInstances) - d.Set("launch_specification", launchSpecsToSet(config.LaunchSpecifications, conn)) - - return nil -} - -func launchSpecsToSet(launchSpecs []*ec2.SpotFleetLaunchSpecification, conn *ec2.EC2) *schema.Set { - specSet := &schema.Set{F: hashLaunchSpecification} - for _, spec := range launchSpecs { - rootDeviceName, err := fetchRootDeviceName(aws.StringValue(spec.ImageId), conn) - if err != nil { - log.Panic(err) - } - - specSet.Add(launchSpecToMap(spec, rootDeviceName)) - } - return specSet -} - -func launchSpecToMap(l *ec2.SpotFleetLaunchSpecification, rootDevName *string) map[string]interface{} { - m := make(map[string]interface{}) - - m["root_block_device"] = rootBlockDeviceToSet(l.BlockDeviceMappings, rootDevName) - m["ebs_block_device"] = ebsBlockDevicesToSet(l.BlockDeviceMappings, rootDevName) - m["ephemeral_block_device"] = ephemeralBlockDevicesToSet(l.BlockDeviceMappings) - - if l.ImageId != nil { - m["ami"] = aws.StringValue(l.ImageId) - } - - if l.InstanceType != nil { - m["instance_type"] = aws.StringValue(l.InstanceType) - } - - if l.SpotPrice != nil { - m["spot_price"] = aws.StringValue(l.SpotPrice) - } - - if l.EbsOptimized != nil { - m["ebs_optimized"] = aws.BoolValue(l.EbsOptimized) - } - - if l.Monitoring != nil && l.Monitoring.Enabled != nil { - m["monitoring"] = aws.BoolValue(l.Monitoring.Enabled) - } - - if l.IamInstanceProfile != nil && l.IamInstanceProfile.Name != nil { - m["iam_instance_profile"] = aws.StringValue(l.IamInstanceProfile.Name) - } - - if l.UserData != nil { - m["user_data"] = userDataHashSum(aws.StringValue(l.UserData)) - } - - if l.KeyName != nil { - m["key_name"] = aws.StringValue(l.KeyName) - } - - if l.Placement != nil { - m["availability_zone"] = aws.StringValue(l.Placement.AvailabilityZone) - } - - if l.SubnetId != nil { - m["subnet_id"] = aws.StringValue(l.SubnetId) - } - - securityGroupIds := &schema.Set{F: schema.HashString} - if len(l.NetworkInterfaces) > 0 { - // This resource auto-creates one network interface when associate_public_ip_address is true - for _, group := range l.NetworkInterfaces[0].Groups { - securityGroupIds.Add(aws.StringValue(group)) - } - } else { - for _, group := range l.SecurityGroups { - securityGroupIds.Add(aws.StringValue(group.GroupId)) - } - } - m["vpc_security_group_ids"] = securityGroupIds - - if l.WeightedCapacity != nil { - m["weighted_capacity"] = strconv.FormatFloat(*l.WeightedCapacity, 'f', 0, 64) - } - - return m -} - -func ebsBlockDevicesToSet(bdm []*ec2.BlockDeviceMapping, rootDevName *string) *schema.Set { - set := &schema.Set{F: hashEbsBlockDevice} - - for _, val := range bdm { - if val.Ebs != nil { - m := make(map[string]interface{}) - - ebs := val.Ebs - - if val.DeviceName != nil { - if aws.StringValue(rootDevName) == aws.StringValue(val.DeviceName) { - continue - } - - m["device_name"] = aws.StringValue(val.DeviceName) - } - - if ebs.DeleteOnTermination != nil { - m["delete_on_termination"] = aws.BoolValue(ebs.DeleteOnTermination) - } - - if ebs.SnapshotId != nil { - m["snapshot_id"] = aws.StringValue(ebs.SnapshotId) - } - - if ebs.Encrypted != nil { - m["encrypted"] = aws.BoolValue(ebs.Encrypted) - } - - if ebs.VolumeSize != nil { - m["volume_size"] = aws.Int64Value(ebs.VolumeSize) - } - - if ebs.VolumeType != nil { - m["volume_type"] = aws.StringValue(ebs.VolumeType) - } - - if ebs.Iops != nil { - m["iops"] = aws.Int64Value(ebs.Iops) - } - - set.Add(m) - } - } - - return set -} - -func ephemeralBlockDevicesToSet(bdm []*ec2.BlockDeviceMapping) *schema.Set { - set := &schema.Set{F: hashEphemeralBlockDevice} - - for _, val := range bdm { - if val.VirtualName != nil { - m := make(map[string]interface{}) - m["virtual_name"] = aws.StringValue(val.VirtualName) - - if val.DeviceName != nil { - m["device_name"] = aws.StringValue(val.DeviceName) - } - - set.Add(m) - } - } - - return set -} - -func rootBlockDeviceToSet( - bdm []*ec2.BlockDeviceMapping, - rootDevName *string, -) *schema.Set { - set := &schema.Set{F: hashRootBlockDevice} - - if rootDevName != nil { - for _, val := range bdm { - if aws.StringValue(val.DeviceName) == aws.StringValue(rootDevName) { - m := make(map[string]interface{}) - if val.Ebs.DeleteOnTermination != nil { - m["delete_on_termination"] = aws.BoolValue(val.Ebs.DeleteOnTermination) - } - - if val.Ebs.VolumeSize != nil { - m["volume_size"] = aws.Int64Value(val.Ebs.VolumeSize) - } - - if val.Ebs.VolumeType != nil { - m["volume_type"] = aws.StringValue(val.Ebs.VolumeType) - } - - if val.Ebs.Iops != nil { - m["iops"] = aws.Int64Value(val.Ebs.Iops) - } - - set.Add(m) - } - } - } - - return set -} - -func resourceAwsSpotFleetRequestUpdate(d *schema.ResourceData, meta interface{}) error { - // http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySpotFleetRequest.html - conn := meta.(*AWSClient).ec2conn - - d.Partial(true) - - req := &ec2.ModifySpotFleetRequestInput{ - SpotFleetRequestId: aws.String(d.Id()), - } - - if val, ok := d.GetOk("target_capacity"); ok { - req.TargetCapacity = aws.Int64(int64(val.(int))) - } - - if val, ok := d.GetOk("excess_capacity_termination_policy"); ok { - req.ExcessCapacityTerminationPolicy = aws.String(val.(string)) - } - - resp, err := conn.ModifySpotFleetRequest(req) - if err == nil && aws.BoolValue(resp.Return) { - // TODO: rollback to old values? - } - - return nil -} - -func resourceAwsSpotFleetRequestDelete(d *schema.ResourceData, meta interface{}) error { - // http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CancelSpotFleetRequests.html - conn := meta.(*AWSClient).ec2conn - terminateInstances := d.Get("terminate_instances_with_expiration").(bool) - - log.Printf("[INFO] Cancelling spot fleet request: %s", d.Id()) - resp, err := conn.CancelSpotFleetRequests(&ec2.CancelSpotFleetRequestsInput{ - SpotFleetRequestIds: []*string{aws.String(d.Id())}, - TerminateInstances: aws.Bool(terminateInstances), - }) - - if err != nil { - return fmt.Errorf("Error cancelling spot request (%s): %s", d.Id(), err) - } - - // check response successfulFleetRequestSet to make sure our request was canceled - var found bool - for _, s := range resp.SuccessfulFleetRequests { - if *s.SpotFleetRequestId == d.Id() { - found = true - } - } - - if !found { - return fmt.Errorf("[ERR] Spot Fleet request (%s) was not found to be successfully canceled, dangling resources may exit", d.Id()) - } - - // Only wait for instance termination if requested - if !terminateInstances { - return nil - } - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - resp, err := conn.DescribeSpotFleetInstances(&ec2.DescribeSpotFleetInstancesInput{ - SpotFleetRequestId: aws.String(d.Id()), - }) - if err != nil { - return resource.NonRetryableError(err) - } - - if len(resp.ActiveInstances) == 0 { - log.Printf("[DEBUG] Active instance count is 0 for Spot Fleet Request (%s), removing", d.Id()) - return nil - } - - log.Printf("[DEBUG] Active instance count in Spot Fleet Request (%s): %d", d.Id(), len(resp.ActiveInstances)) - - return resource.RetryableError( - fmt.Errorf("fleet still has (%d) running instances", len(resp.ActiveInstances))) - }) -} - -func hashEphemeralBlockDevice(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["device_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["virtual_name"].(string))) - return hashcode.String(buf.String()) -} - -func hashRootBlockDevice(v interface{}) int { - // there can be only one root device; no need to hash anything - return 0 -} - -func hashLaunchSpecification(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["ami"].(string))) - if m["availability_zone"] != "" { - buf.WriteString(fmt.Sprintf("%s-", m["availability_zone"].(string))) - } - if m["subnet_id"] != "" { - buf.WriteString(fmt.Sprintf("%s-", m["subnet_id"].(string))) - } - buf.WriteString(fmt.Sprintf("%s-", m["instance_type"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["spot_price"].(string))) - return hashcode.String(buf.String()) -} - -func hashEbsBlockDevice(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - if name, ok := m["device_name"]; ok { - buf.WriteString(fmt.Sprintf("%s-", name.(string))) - } - if id, ok := m["snapshot_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", id.(string))) - } - return hashcode.String(buf.String()) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request_migrate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request_migrate.go deleted file mode 100644 index dea0a32..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request_migrate.go +++ /dev/null @@ -1,33 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform/terraform" -) - -func resourceAwsSpotFleetRequestMigrateState( - v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - switch v { - case 0: - log.Println("[INFO] Found AWS Spot Fleet Request State v0; migrating to v1") - return migrateSpotFleetRequestV0toV1(is) - default: - return is, fmt.Errorf("Unexpected schema version: %d", v) - } -} - -func migrateSpotFleetRequestV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { - if is.Empty() { - log.Println("[DEBUG] Empty Spot Fleet Request State; nothing to migrate.") - return is, nil - } - - log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) - - is.Attributes["associate_public_ip_address"] = "false" - - log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) - return is, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_instance_request.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_instance_request.go deleted file mode 100644 index c0e87e5..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_instance_request.go +++ /dev/null @@ -1,363 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSpotInstanceRequest() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSpotInstanceRequestCreate, - Read: resourceAwsSpotInstanceRequestRead, - Delete: resourceAwsSpotInstanceRequestDelete, - Update: resourceAwsSpotInstanceRequestUpdate, - - Schema: func() map[string]*schema.Schema { - // The Spot Instance Request Schema is based on the AWS Instance schema. - s := resourceAwsInstance().Schema - - // Everything on a spot instance is ForceNew except tags - for k, v := range s { - if k == "tags" { - continue - } - v.ForceNew = true - } - - s["spot_price"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - } - s["spot_type"] = &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "persistent", - } - s["wait_for_fulfillment"] = &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - } - s["spot_bid_status"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - s["spot_request_state"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - s["spot_instance_id"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - } - s["block_duration_minutes"] = &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - } - - return s - }(), - } -} - -func resourceAwsSpotInstanceRequestCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - instanceOpts, err := buildAwsInstanceOpts(d, meta) - if err != nil { - return err - } - - spotOpts := &ec2.RequestSpotInstancesInput{ - SpotPrice: aws.String(d.Get("spot_price").(string)), - Type: aws.String(d.Get("spot_type").(string)), - - // Though the AWS API supports creating spot instance requests for multiple - // instances, for TF purposes we fix this to one instance per request. - // Users can get equivalent behavior out of TF's "count" meta-parameter. - InstanceCount: aws.Int64(1), - - LaunchSpecification: &ec2.RequestSpotLaunchSpecification{ - BlockDeviceMappings: instanceOpts.BlockDeviceMappings, - EbsOptimized: instanceOpts.EBSOptimized, - Monitoring: instanceOpts.Monitoring, - IamInstanceProfile: instanceOpts.IAMInstanceProfile, - ImageId: instanceOpts.ImageID, - InstanceType: instanceOpts.InstanceType, - KeyName: instanceOpts.KeyName, - Placement: instanceOpts.SpotPlacement, - SecurityGroupIds: instanceOpts.SecurityGroupIDs, - SecurityGroups: instanceOpts.SecurityGroups, - SubnetId: instanceOpts.SubnetID, - UserData: instanceOpts.UserData64, - }, - } - - if v, ok := d.GetOk("block_duration_minutes"); ok { - spotOpts.BlockDurationMinutes = aws.Int64(int64(v.(int))) - } - - // If the instance is configured with a Network Interface (a subnet, has - // public IP, etc), then the instanceOpts.SecurityGroupIds and SubnetId will - // be nil - if len(instanceOpts.NetworkInterfaces) > 0 { - spotOpts.LaunchSpecification.SecurityGroupIds = instanceOpts.NetworkInterfaces[0].Groups - spotOpts.LaunchSpecification.SubnetId = instanceOpts.NetworkInterfaces[0].SubnetId - } - - // Make the spot instance request - log.Printf("[DEBUG] Requesting spot bid opts: %s", spotOpts) - - var resp *ec2.RequestSpotInstancesOutput - err = resource.Retry(15*time.Second, func() *resource.RetryError { - var err error - resp, err = conn.RequestSpotInstances(spotOpts) - // IAM instance profiles can take ~10 seconds to propagate in AWS: - // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console - if isAWSErr(err, "InvalidParameterValue", "Invalid IAM Instance Profile") { - log.Printf("[DEBUG] Invalid IAM Instance Profile referenced, retrying...") - return resource.RetryableError(err) - } - // IAM roles can also take time to propagate in AWS: - if isAWSErr(err, "InvalidParameterValue", " has no associated IAM Roles") { - log.Printf("[DEBUG] IAM Instance Profile appears to have no IAM roles, retrying...") - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - }) - - if err != nil { - return fmt.Errorf("Error requesting spot instances: %s", err) - } - if len(resp.SpotInstanceRequests) != 1 { - return fmt.Errorf( - "Expected response with length 1, got: %s", resp) - } - - sir := *resp.SpotInstanceRequests[0] - d.SetId(*sir.SpotInstanceRequestId) - - if d.Get("wait_for_fulfillment").(bool) { - spotStateConf := &resource.StateChangeConf{ - // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html - Pending: []string{"start", "pending-evaluation", "pending-fulfillment"}, - Target: []string{"fulfilled"}, - Refresh: SpotInstanceStateRefreshFunc(conn, sir), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - log.Printf("[DEBUG] waiting for spot bid to resolve... this may take several minutes.") - _, err = spotStateConf.WaitForState() - - if err != nil { - return fmt.Errorf("Error while waiting for spot request (%s) to resolve: %s", sir, err) - } - } - - return resourceAwsSpotInstanceRequestUpdate(d, meta) -} - -// Update spot state, etc -func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - req := &ec2.DescribeSpotInstanceRequestsInput{ - SpotInstanceRequestIds: []*string{aws.String(d.Id())}, - } - resp, err := conn.DescribeSpotInstanceRequests(req) - - if err != nil { - // If the spot request was not found, return nil so that we can show - // that it is gone. - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidSpotInstanceRequestID.NotFound" { - d.SetId("") - return nil - } - - // Some other error, report it - return err - } - - // If nothing was found, then return no state - if len(resp.SpotInstanceRequests) == 0 { - d.SetId("") - return nil - } - - request := resp.SpotInstanceRequests[0] - - // if the request is cancelled, then it is gone - if *request.State == "cancelled" { - d.SetId("") - return nil - } - - d.Set("spot_bid_status", *request.Status.Code) - // Instance ID is not set if the request is still pending - if request.InstanceId != nil { - d.Set("spot_instance_id", *request.InstanceId) - // Read the instance data, setting up connection information - if err := readInstance(d, meta); err != nil { - return fmt.Errorf("[ERR] Error reading Spot Instance Data: %s", err) - } - } - - d.Set("spot_request_state", request.State) - d.Set("block_duration_minutes", request.BlockDurationMinutes) - d.Set("tags", tagsToMap(request.Tags)) - - return nil -} - -func readInstance(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeInstances(&ec2.DescribeInstancesInput{ - InstanceIds: []*string{aws.String(d.Get("spot_instance_id").(string))}, - }) - if err != nil { - // If the instance was not found, return nil so that we can show - // that the instance is gone. - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidInstanceID.NotFound" { - return fmt.Errorf("no instance found") - } - - // Some other error, report it - return err - } - - // If nothing was found, then return no state - if len(resp.Reservations) == 0 { - return fmt.Errorf("no instances found") - } - - instance := resp.Reservations[0].Instances[0] - - // Set these fields for connection information - if instance != nil { - d.Set("public_dns", instance.PublicDnsName) - d.Set("public_ip", instance.PublicIpAddress) - d.Set("private_dns", instance.PrivateDnsName) - d.Set("private_ip", instance.PrivateIpAddress) - - // set connection information - if instance.PublicIpAddress != nil { - d.SetConnInfo(map[string]string{ - "type": "ssh", - "host": *instance.PublicIpAddress, - }) - } else if instance.PrivateIpAddress != nil { - d.SetConnInfo(map[string]string{ - "type": "ssh", - "host": *instance.PrivateIpAddress, - }) - } - if err := readBlockDevices(d, instance, conn); err != nil { - return err - } - - var ipv6Addresses []string - if len(instance.NetworkInterfaces) > 0 { - for _, ni := range instance.NetworkInterfaces { - if *ni.Attachment.DeviceIndex == 0 { - d.Set("subnet_id", ni.SubnetId) - d.Set("network_interface_id", ni.NetworkInterfaceId) - d.Set("associate_public_ip_address", ni.Association != nil) - d.Set("ipv6_address_count", len(ni.Ipv6Addresses)) - - for _, address := range ni.Ipv6Addresses { - ipv6Addresses = append(ipv6Addresses, *address.Ipv6Address) - } - } - } - } else { - d.Set("subnet_id", instance.SubnetId) - d.Set("network_interface_id", "") - } - - if err := d.Set("ipv6_addresses", ipv6Addresses); err != nil { - log.Printf("[WARN] Error setting ipv6_addresses for AWS Spot Instance (%s): %s", d.Id(), err) - } - } - - return nil -} - -func resourceAwsSpotInstanceRequestUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - d.Partial(true) - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - d.Partial(false) - - return resourceAwsSpotInstanceRequestRead(d, meta) -} - -func resourceAwsSpotInstanceRequestDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[INFO] Cancelling spot request: %s", d.Id()) - _, err := conn.CancelSpotInstanceRequests(&ec2.CancelSpotInstanceRequestsInput{ - SpotInstanceRequestIds: []*string{aws.String(d.Id())}, - }) - - if err != nil { - return fmt.Errorf("Error cancelling spot request (%s): %s", d.Id(), err) - } - - if instanceId := d.Get("spot_instance_id").(string); instanceId != "" { - log.Printf("[INFO] Terminating instance: %s", instanceId) - if err := awsTerminateInstance(conn, instanceId); err != nil { - return fmt.Errorf("Error terminating spot instance: %s", err) - } - } - - return nil -} - -// SpotInstanceStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// an EC2 spot instance request -func SpotInstanceStateRefreshFunc( - conn *ec2.EC2, sir ec2.SpotInstanceRequest) resource.StateRefreshFunc { - - return func() (interface{}, string, error) { - resp, err := conn.DescribeSpotInstanceRequests(&ec2.DescribeSpotInstanceRequestsInput{ - SpotInstanceRequestIds: []*string{sir.SpotInstanceRequestId}, - }) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidSpotInstanceRequestID.NotFound" { - // Set this to nil as if we didn't find anything. - resp = nil - } else { - log.Printf("Error on StateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil || len(resp.SpotInstanceRequests) == 0 { - // Sometimes AWS just has consistency issues and doesn't see - // our request yet. Return an empty state. - return nil, "", nil - } - - req := resp.SpotInstanceRequests[0] - return req, *req.Status.Code, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sqs_queue.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sqs_queue.go deleted file mode 100644 index b7ce4c5..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sqs_queue.go +++ /dev/null @@ -1,297 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "net/url" - "strconv" - - "github.com/hashicorp/terraform/helper/schema" - - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/sqs" -) - -var AttributeMap = map[string]string{ - "delay_seconds": "DelaySeconds", - "max_message_size": "MaximumMessageSize", - "message_retention_seconds": "MessageRetentionPeriod", - "receive_wait_time_seconds": "ReceiveMessageWaitTimeSeconds", - "visibility_timeout_seconds": "VisibilityTimeout", - "policy": "Policy", - "redrive_policy": "RedrivePolicy", - "arn": "QueueArn", - "fifo_queue": "FifoQueue", - "content_based_deduplication": "ContentBasedDeduplication", -} - -// A number of these are marked as computed because if you don't -// provide a value, SQS will provide you with defaults (which are the -// default values specified below) -func resourceAwsSqsQueue() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSqsQueueCreate, - Read: resourceAwsSqsQueueRead, - Update: resourceAwsSqsQueueUpdate, - Delete: resourceAwsSqsQueueDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "delay_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 0, - }, - "max_message_size": { - Type: schema.TypeInt, - Optional: true, - Default: 262144, - }, - "message_retention_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 345600, - }, - "receive_wait_time_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 0, - }, - "visibility_timeout_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 30, - }, - "policy": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - "redrive_policy": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateJsonString, - StateFunc: func(v interface{}) string { - json, _ := normalizeJsonString(v) - return json - }, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "fifo_queue": { - Type: schema.TypeBool, - Default: false, - ForceNew: true, - Optional: true, - }, - "content_based_deduplication": { - Type: schema.TypeBool, - Default: false, - Optional: true, - }, - }, - } -} - -func resourceAwsSqsQueueCreate(d *schema.ResourceData, meta interface{}) error { - sqsconn := meta.(*AWSClient).sqsconn - - name := d.Get("name").(string) - fq := d.Get("fifo_queue").(bool) - cbd := d.Get("content_based_deduplication").(bool) - - if fq { - if errors := validateSQSFifoQueueName(name, "name"); len(errors) > 0 { - return fmt.Errorf("Error validating the FIFO queue name: %v", errors) - } - } else { - if errors := validateSQSQueueName(name, "name"); len(errors) > 0 { - return fmt.Errorf("Error validating SQS queue name: %v", errors) - } - } - - if !fq && cbd { - return fmt.Errorf("Content based deduplication can only be set with FIFO queues") - } - - log.Printf("[DEBUG] SQS queue create: %s", name) - - req := &sqs.CreateQueueInput{ - QueueName: aws.String(name), - } - - attributes := make(map[string]*string) - - resource := *resourceAwsSqsQueue() - - for k, s := range resource.Schema { - if attrKey, ok := AttributeMap[k]; ok { - if value, ok := d.GetOk(k); ok { - switch s.Type { - case schema.TypeInt: - attributes[attrKey] = aws.String(strconv.Itoa(value.(int))) - case schema.TypeBool: - attributes[attrKey] = aws.String(strconv.FormatBool(value.(bool))) - default: - attributes[attrKey] = aws.String(value.(string)) - } - } - - } - } - - if len(attributes) > 0 { - req.Attributes = attributes - } - - output, err := sqsconn.CreateQueue(req) - if err != nil { - return fmt.Errorf("Error creating SQS queue: %s", err) - } - - d.SetId(*output.QueueUrl) - - return resourceAwsSqsQueueUpdate(d, meta) -} - -func resourceAwsSqsQueueUpdate(d *schema.ResourceData, meta interface{}) error { - sqsconn := meta.(*AWSClient).sqsconn - attributes := make(map[string]*string) - - resource := *resourceAwsSqsQueue() - - for k, s := range resource.Schema { - if attrKey, ok := AttributeMap[k]; ok { - if d.HasChange(k) { - log.Printf("[DEBUG] Updating %s", attrKey) - _, n := d.GetChange(k) - switch s.Type { - case schema.TypeInt: - attributes[attrKey] = aws.String(strconv.Itoa(n.(int))) - case schema.TypeBool: - attributes[attrKey] = aws.String(strconv.FormatBool(n.(bool))) - default: - attributes[attrKey] = aws.String(n.(string)) - } - } - } - } - - if len(attributes) > 0 { - req := &sqs.SetQueueAttributesInput{ - QueueUrl: aws.String(d.Id()), - Attributes: attributes, - } - if _, err := sqsconn.SetQueueAttributes(req); err != nil { - return fmt.Errorf("[ERR] Error updating SQS attributes: %s", err) - } - } - - return resourceAwsSqsQueueRead(d, meta) -} - -func resourceAwsSqsQueueRead(d *schema.ResourceData, meta interface{}) error { - sqsconn := meta.(*AWSClient).sqsconn - - attributeOutput, err := sqsconn.GetQueueAttributes(&sqs.GetQueueAttributesInput{ - QueueUrl: aws.String(d.Id()), - AttributeNames: []*string{aws.String("All")}, - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - log.Printf("ERROR Found %s", awsErr.Code()) - if "AWS.SimpleQueueService.NonExistentQueue" == awsErr.Code() { - d.SetId("") - log.Printf("[DEBUG] SQS Queue (%s) not found", d.Get("name").(string)) - return nil - } - } - return err - } - - name, err := extractNameFromSqsQueueUrl(d.Id()) - if err != nil { - return err - } - d.Set("name", name) - - if attributeOutput.Attributes != nil && len(attributeOutput.Attributes) > 0 { - attrmap := attributeOutput.Attributes - resource := *resourceAwsSqsQueue() - // iKey = internal struct key, oKey = AWS Attribute Map key - for iKey, oKey := range AttributeMap { - if attrmap[oKey] != nil { - switch resource.Schema[iKey].Type { - case schema.TypeInt: - value, err := strconv.Atoi(*attrmap[oKey]) - if err != nil { - return err - } - d.Set(iKey, value) - log.Printf("[DEBUG] Reading %s => %s -> %d", iKey, oKey, value) - case schema.TypeBool: - value, err := strconv.ParseBool(*attrmap[oKey]) - if err != nil { - return err - } - d.Set(iKey, value) - log.Printf("[DEBUG] Reading %s => %s -> %t", iKey, oKey, value) - default: - log.Printf("[DEBUG] Reading %s => %s -> %s", iKey, oKey, *attrmap[oKey]) - d.Set(iKey, *attrmap[oKey]) - } - } - } - } - - // Since AWS does not send the FifoQueue attribute back when the queue - // is a standard one (even to false), this enforces the queue to be set - // to the correct value. - d.Set("fifo_queue", d.Get("fifo_queue").(bool)) - d.Set("content_based_deduplication", d.Get("content_based_deduplication").(bool)) - - return nil -} - -func resourceAwsSqsQueueDelete(d *schema.ResourceData, meta interface{}) error { - sqsconn := meta.(*AWSClient).sqsconn - - log.Printf("[DEBUG] SQS Delete Queue: %s", d.Id()) - _, err := sqsconn.DeleteQueue(&sqs.DeleteQueueInput{ - QueueUrl: aws.String(d.Id()), - }) - if err != nil { - return err - } - return nil -} - -func extractNameFromSqsQueueUrl(queue string) (string, error) { - //http://sqs.us-west-2.amazonaws.com/123456789012/queueName - u, err := url.Parse(queue) - if err != nil { - return "", err - } - segments := strings.Split(u.Path, "/") - if len(segments) != 3 { - return "", fmt.Errorf("SQS Url not parsed correctly") - } - - return segments[2], nil - -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sqs_queue_policy.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sqs_queue_policy.go deleted file mode 100644 index 3432497..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_sqs_queue_policy.go +++ /dev/null @@ -1,100 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/sqs" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSqsQueuePolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSqsQueuePolicyUpsert, - Read: resourceAwsSqsQueuePolicyRead, - Update: resourceAwsSqsQueuePolicyUpsert, - Delete: resourceAwsSqsQueuePolicyDelete, - - Schema: map[string]*schema.Schema{ - "queue_url": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "policy": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: validateJsonString, - DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - }, - }, - } -} - -func resourceAwsSqsQueuePolicyUpsert(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sqsconn - url := d.Get("queue_url").(string) - - _, err := conn.SetQueueAttributes(&sqs.SetQueueAttributesInput{ - QueueUrl: aws.String(url), - Attributes: aws.StringMap(map[string]string{ - "Policy": d.Get("policy").(string), - }), - }) - if err != nil { - return fmt.Errorf("Error updating SQS attributes: %s", err) - } - - d.SetId("sqs-policy-" + url) - - return resourceAwsSqsQueuePolicyRead(d, meta) -} - -func resourceAwsSqsQueuePolicyRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sqsconn - url := d.Get("queue_url").(string) - out, err := conn.GetQueueAttributes(&sqs.GetQueueAttributesInput{ - QueueUrl: aws.String(url), - AttributeNames: []*string{aws.String("Policy")}, - }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "AWS.SimpleQueueService.NonExistentQueue" { - log.Printf("[WARN] SQS Queue (%s) not found", d.Id()) - d.SetId("") - return nil - } - return err - } - if out == nil { - return fmt.Errorf("Received empty response for SQS queue %s", d.Id()) - } - - policy, ok := out.Attributes["Policy"] - if !ok { - return fmt.Errorf("SQS Queue policy not found for %s", d.Id()) - } - - d.Set("policy", policy) - - return nil -} - -func resourceAwsSqsQueuePolicyDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).sqsconn - - url := d.Get("queue_url").(string) - log.Printf("[DEBUG] Deleting SQS Queue Policy of %s", url) - _, err := conn.SetQueueAttributes(&sqs.SetQueueAttributesInput{ - QueueUrl: aws.String(url), - Attributes: aws.StringMap(map[string]string{ - "Policy": "", - }), - }) - if err != nil { - return fmt.Errorf("Error deleting SQS Queue policy: %s", err) - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_activation.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_activation.go deleted file mode 100644 index 9cceda4..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_activation.go +++ /dev/null @@ -1,168 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ssm" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSsmActivation() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSsmActivationCreate, - Read: resourceAwsSsmActivationRead, - Delete: resourceAwsSsmActivationDelete, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "expired": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "expiration_date": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "iam_role": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "registration_limit": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - }, - "registration_count": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - }, - } -} - -func resourceAwsSsmActivationCreate(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[DEBUG] SSM activation create: %s", d.Id()) - - activationInput := &ssm.CreateActivationInput{ - IamRole: aws.String(d.Get("name").(string)), - } - - if _, ok := d.GetOk("name"); ok { - activationInput.DefaultInstanceName = aws.String(d.Get("name").(string)) - } - - if _, ok := d.GetOk("description"); ok { - activationInput.Description = aws.String(d.Get("description").(string)) - } - - if _, ok := d.GetOk("expiration_date"); ok { - activationInput.ExpirationDate = aws.Time(d.Get("expiration_date").(time.Time)) - } - - if _, ok := d.GetOk("iam_role"); ok { - activationInput.IamRole = aws.String(d.Get("iam_role").(string)) - } - - if _, ok := d.GetOk("registration_limit"); ok { - activationInput.RegistrationLimit = aws.Int64(int64(d.Get("registration_limit").(int))) - } - - // Retry to allow iam_role to be created and policy attachment to take place - var resp *ssm.CreateActivationOutput - err := resource.Retry(30*time.Second, func() *resource.RetryError { - var err error - - resp, err = ssmconn.CreateActivation(activationInput) - - if err != nil { - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - }) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error creating SSM activation: {{err}}", err) - } - - if resp.ActivationId == nil { - return fmt.Errorf("[ERROR] ActivationId was nil") - } - d.SetId(*resp.ActivationId) - - return resourceAwsSsmActivationRead(d, meta) -} - -func resourceAwsSsmActivationRead(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[DEBUG] Reading SSM Activation: %s", d.Id()) - - params := &ssm.DescribeActivationsInput{ - Filters: []*ssm.DescribeActivationsFilter{ - { - FilterKey: aws.String("ActivationIds"), - FilterValues: []*string{ - aws.String(d.Id()), - }, - }, - }, - MaxResults: aws.Int64(1), - } - - resp, err := ssmconn.DescribeActivations(params) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error reading SSM activation: {{err}}", err) - } - if resp.ActivationList == nil || len(resp.ActivationList) == 0 { - return fmt.Errorf("[ERROR] ActivationList was nil or empty") - } - - activation := resp.ActivationList[0] // Only 1 result as MaxResults is 1 above - d.Set("name", activation.DefaultInstanceName) - d.Set("description", activation.Description) - d.Set("expiration_date", activation.ExpirationDate) - d.Set("expired", activation.Expired) - d.Set("iam_role", activation.IamRole) - d.Set("registration_limit", activation.RegistrationLimit) - d.Set("registration_count", activation.RegistrationsCount) - - return nil -} - -func resourceAwsSsmActivationDelete(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[DEBUG] Deleting SSM Activation: %s", d.Id()) - - params := &ssm.DeleteActivationInput{ - ActivationId: aws.String(d.Id()), - } - - _, err := ssmconn.DeleteActivation(params) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting SSM activation: {{err}}", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_association.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_association.go deleted file mode 100644 index 30bc19c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_association.go +++ /dev/null @@ -1,123 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ssm" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSsmAssociation() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSsmAssociationCreate, - Read: resourceAwsSsmAssociationRead, - Delete: resourceAwsSsmAssociationDelete, - - Schema: map[string]*schema.Schema{ - "instance_id": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "name": { - Type: schema.TypeString, - ForceNew: true, - Required: true, - }, - "parameters": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - Computed: true, - }, - }, - } -} - -func resourceAwsSsmAssociationCreate(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[DEBUG] SSM association create: %s", d.Id()) - - assosciationInput := &ssm.CreateAssociationInput{ - Name: aws.String(d.Get("name").(string)), - InstanceId: aws.String(d.Get("instance_id").(string)), - } - - if v, ok := d.GetOk("parameters"); ok { - assosciationInput.Parameters = expandSSMDocumentParameters(v.(map[string]interface{})) - } - - resp, err := ssmconn.CreateAssociation(assosciationInput) - if err != nil { - return errwrap.Wrapf("[ERROR] Error creating SSM association: {{err}}", err) - } - - if resp.AssociationDescription == nil { - return fmt.Errorf("[ERROR] AssociationDescription was nil") - } - - d.SetId(*resp.AssociationDescription.Name) - - return resourceAwsSsmAssociationRead(d, meta) -} - -func resourceAwsSsmAssociationRead(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[DEBUG] Reading SSM Assosciation: %s", d.Id()) - - params := &ssm.DescribeAssociationInput{ - Name: aws.String(d.Get("name").(string)), - InstanceId: aws.String(d.Get("instance_id").(string)), - } - - resp, err := ssmconn.DescribeAssociation(params) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error reading SSM association: {{err}}", err) - } - if resp.AssociationDescription == nil { - return fmt.Errorf("[ERROR] AssociationDescription was nil") - } - - association := resp.AssociationDescription - d.Set("instance_id", association.InstanceId) - d.Set("name", association.Name) - d.Set("parameters", association.Parameters) - - return nil -} - -func resourceAwsSsmAssociationDelete(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[DEBUG] Deleting SSM Assosciation: %s", d.Id()) - - params := &ssm.DeleteAssociationInput{ - Name: aws.String(d.Get("name").(string)), - InstanceId: aws.String(d.Get("instance_id").(string)), - } - - _, err := ssmconn.DeleteAssociation(params) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting SSM association: {{err}}", err) - } - - return nil -} - -func expandSSMDocumentParameters(params map[string]interface{}) map[string][]*string { - var docParams = make(map[string][]*string) - for k, v := range params { - values := make([]*string, 1) - values[0] = aws.String(v.(string)) - docParams[k] = values - } - - return docParams -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_document.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_document.go deleted file mode 100644 index 5ed4516..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_ssm_document.go +++ /dev/null @@ -1,390 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ssm" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSsmDocument() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSsmDocumentCreate, - Read: resourceAwsSsmDocumentRead, - Update: resourceAwsSsmDocumentUpdate, - Delete: resourceAwsSsmDocumentDelete, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "content": { - Type: schema.TypeString, - Required: true, - }, - "document_type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validateAwsSSMDocumentType, - }, - "created_date": { - Type: schema.TypeString, - Computed: true, - }, - "default_version": { - Type: schema.TypeString, - Computed: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - "hash": { - Type: schema.TypeString, - Computed: true, - }, - "hash_type": { - Type: schema.TypeString, - Computed: true, - }, - "latest_version": { - Type: schema.TypeString, - Computed: true, - }, - "owner": { - Type: schema.TypeString, - Computed: true, - }, - "status": { - Type: schema.TypeString, - Computed: true, - }, - "platform_types": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "parameter": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Optional: true, - }, - "default_value": { - Type: schema.TypeString, - Optional: true, - }, - "description": { - Type: schema.TypeString, - Optional: true, - }, - "type": { - Type: schema.TypeString, - Optional: true, - }, - }, - }, - }, - "permissions": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - Required: true, - }, - "account_ids": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsSsmDocumentCreate(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[INFO] Creating SSM Document: %s", d.Get("name").(string)) - - docInput := &ssm.CreateDocumentInput{ - Name: aws.String(d.Get("name").(string)), - Content: aws.String(d.Get("content").(string)), - DocumentType: aws.String(d.Get("document_type").(string)), - } - - log.Printf("[DEBUG] Waiting for SSM Document %q to be created", d.Get("name").(string)) - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - resp, err := ssmconn.CreateDocument(docInput) - - if err != nil { - return resource.NonRetryableError(err) - } - - d.SetId(*resp.DocumentDescription.Name) - return nil - }) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error creating SSM document: {{err}}", err) - } - - if v, ok := d.GetOk("permissions"); ok && v != nil { - if err := setDocumentPermissions(d, meta); err != nil { - return err - } - } else { - log.Printf("[DEBUG] Not setting permissions for %q", d.Id()) - } - - return resourceAwsSsmDocumentRead(d, meta) -} - -func resourceAwsSsmDocumentRead(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[DEBUG] Reading SSM Document: %s", d.Id()) - - docInput := &ssm.DescribeDocumentInput{ - Name: aws.String(d.Get("name").(string)), - } - - resp, err := ssmconn.DescribeDocument(docInput) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error describing SSM document: {{err}}", err) - } - - doc := resp.Document - d.Set("created_date", doc.CreatedDate) - d.Set("default_version", doc.DefaultVersion) - d.Set("description", doc.Description) - - if _, ok := d.GetOk("document_type"); ok { - d.Set("document_type", doc.DocumentType) - } - - d.Set("document_version", doc.DocumentVersion) - d.Set("hash", doc.Hash) - d.Set("hash_type", doc.HashType) - d.Set("latest_version", doc.LatestVersion) - d.Set("name", doc.Name) - d.Set("owner", doc.Owner) - d.Set("platform_types", flattenStringList(doc.PlatformTypes)) - - d.Set("status", doc.Status) - - gp, err := getDocumentPermissions(d, meta) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error reading SSM document permissions: {{err}}", err) - } - - d.Set("permissions", gp) - - params := make([]map[string]interface{}, 0) - for i := 0; i < len(doc.Parameters); i++ { - - dp := doc.Parameters[i] - param := make(map[string]interface{}) - - if dp.DefaultValue != nil { - param["default_value"] = *dp.DefaultValue - } - param["description"] = *dp.Description - param["name"] = *dp.Name - param["type"] = *dp.Type - params = append(params, param) - } - - if len(params) == 0 { - params = make([]map[string]interface{}, 1) - } - - if err := d.Set("parameter", params); err != nil { - return err - } - - return nil -} - -func resourceAwsSsmDocumentUpdate(d *schema.ResourceData, meta interface{}) error { - - if _, ok := d.GetOk("permissions"); ok { - if err := setDocumentPermissions(d, meta); err != nil { - return err - } - } else { - log.Printf("[DEBUG] Not setting document permissions on %q", d.Id()) - } - - return resourceAwsSsmDocumentRead(d, meta) -} - -func resourceAwsSsmDocumentDelete(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - if err := deleteDocumentPermissions(d, meta); err != nil { - return err - } - - log.Printf("[INFO] Deleting SSM Document: %s", d.Id()) - - params := &ssm.DeleteDocumentInput{ - Name: aws.String(d.Get("name").(string)), - } - - _, err := ssmconn.DeleteDocument(params) - if err != nil { - return err - } - - log.Printf("[DEBUG] Waiting for SSM Document %q to be deleted", d.Get("name").(string)) - err = resource.Retry(10*time.Minute, func() *resource.RetryError { - _, err := ssmconn.DescribeDocument(&ssm.DescribeDocumentInput{ - Name: aws.String(d.Get("name").(string)), - }) - - if err != nil { - awsErr, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - - if awsErr.Code() == "InvalidDocument" { - return nil - } - - return resource.NonRetryableError(err) - } - - return resource.RetryableError( - fmt.Errorf("%q: Timeout while waiting for the document to be deleted", d.Id())) - }) - if err != nil { - return err - } - - d.SetId("") - - return nil -} - -func setDocumentPermissions(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[INFO] Setting permissions for document: %s", d.Id()) - permission := d.Get("permissions").(map[string]interface{}) - - ids := aws.StringSlice([]string{permission["account_ids"].(string)}) - - if strings.Contains(permission["account_ids"].(string), ",") { - ids = aws.StringSlice(strings.Split(permission["account_ids"].(string), ",")) - } - - permInput := &ssm.ModifyDocumentPermissionInput{ - Name: aws.String(d.Get("name").(string)), - PermissionType: aws.String(permission["type"].(string)), - AccountIdsToAdd: ids, - } - - _, err := ssmconn.ModifyDocumentPermission(permInput) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error setting permissions for SSM document: {{err}}", err) - } - - return nil -} - -func getDocumentPermissions(d *schema.ResourceData, meta interface{}) (map[string]interface{}, error) { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[INFO] Getting permissions for document: %s", d.Id()) - - //How to get from nested scheme resource? - permissionType := "Share" - - permInput := &ssm.DescribeDocumentPermissionInput{ - Name: aws.String(d.Get("name").(string)), - PermissionType: aws.String(permissionType), - } - - resp, err := ssmconn.DescribeDocumentPermission(permInput) - - if err != nil { - return nil, errwrap.Wrapf("[ERROR] Error setting permissions for SSM document: {{err}}", err) - } - - var account_ids = make([]string, len(resp.AccountIds)) - for i := 0; i < len(resp.AccountIds); i++ { - account_ids[i] = *resp.AccountIds[i] - } - - var ids = "" - if len(account_ids) == 1 { - ids = account_ids[0] - } else if len(account_ids) > 1 { - ids = strings.Join(account_ids, ",") - } else { - ids = "" - } - - if ids == "" { - return nil, nil - } - - perms := make(map[string]interface{}) - perms["type"] = permissionType - perms["account_ids"] = ids - - return perms, nil -} - -func deleteDocumentPermissions(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - log.Printf("[INFO] Removing permissions from document: %s", d.Id()) - - permInput := &ssm.ModifyDocumentPermissionInput{ - Name: aws.String(d.Get("name").(string)), - PermissionType: aws.String("Share"), - AccountIdsToRemove: aws.StringSlice(strings.Split("all", ",")), - } - - _, err := ssmconn.ModifyDocumentPermission(permInput) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error removing permissions for SSM document: {{err}}", err) - } - - return nil -} - -func validateAwsSSMDocumentType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - types := map[string]bool{ - "Command": true, - "Policy": true, - "Automation": true, - } - - if !types[value] { - errors = append(errors, fmt.Errorf("Document type %s is invalid. Valid types are Command, Policy or Automation", value)) - } - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_subnet.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_subnet.go deleted file mode 100644 index 68bf1e0..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_subnet.go +++ /dev/null @@ -1,273 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsSubnet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsSubnetCreate, - Read: resourceAwsSubnetRead, - Update: resourceAwsSubnetUpdate, - Delete: resourceAwsSubnetDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "vpc_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "cidr_block": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "ipv6_cidr_block": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "map_public_ip_on_launch": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "assign_ipv6_address_on_creation": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "ipv6_cidr_block_association_id": { - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - createOpts := &ec2.CreateSubnetInput{ - AvailabilityZone: aws.String(d.Get("availability_zone").(string)), - CidrBlock: aws.String(d.Get("cidr_block").(string)), - VpcId: aws.String(d.Get("vpc_id").(string)), - } - - if v, ok := d.GetOk("ipv6_cidr_block"); ok { - createOpts.Ipv6CidrBlock = aws.String(v.(string)) - } - - var err error - resp, err := conn.CreateSubnet(createOpts) - - if err != nil { - return fmt.Errorf("Error creating subnet: %s", err) - } - - // Get the ID and store it - subnet := resp.Subnet - d.SetId(*subnet.SubnetId) - log.Printf("[INFO] Subnet ID: %s", *subnet.SubnetId) - - // Wait for the Subnet to become available - log.Printf("[DEBUG] Waiting for subnet (%s) to become available", *subnet.SubnetId) - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"available"}, - Refresh: SubnetStateRefreshFunc(conn, *subnet.SubnetId), - Timeout: 10 * time.Minute, - } - - _, err = stateConf.WaitForState() - - if err != nil { - return fmt.Errorf( - "Error waiting for subnet (%s) to become ready: %s", - d.Id(), err) - } - - return resourceAwsSubnetUpdate(d, meta) -} - -func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeSubnets(&ec2.DescribeSubnetsInput{ - SubnetIds: []*string{aws.String(d.Id())}, - }) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidSubnetID.NotFound" { - // Update state to indicate the subnet no longer exists. - d.SetId("") - return nil - } - return err - } - if resp == nil { - return nil - } - - subnet := resp.Subnets[0] - - d.Set("vpc_id", subnet.VpcId) - d.Set("availability_zone", subnet.AvailabilityZone) - d.Set("cidr_block", subnet.CidrBlock) - d.Set("map_public_ip_on_launch", subnet.MapPublicIpOnLaunch) - d.Set("assign_ipv6_address_on_creation", subnet.AssignIpv6AddressOnCreation) - if subnet.Ipv6CidrBlockAssociationSet != nil { - d.Set("ipv6_cidr_block", subnet.Ipv6CidrBlockAssociationSet[0].Ipv6CidrBlock) - d.Set("ipv6_cidr_block_association_id", subnet.Ipv6CidrBlockAssociationSet[0].AssociationId) - } - d.Set("tags", tagsToMap(subnet.Tags)) - - return nil -} - -func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - d.Partial(true) - - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - if d.HasChange("assign_ipv6_address_on_creation") { - modifyOpts := &ec2.ModifySubnetAttributeInput{ - SubnetId: aws.String(d.Id()), - AssignIpv6AddressOnCreation: &ec2.AttributeBooleanValue{ - Value: aws.Bool(d.Get("assign_ipv6_address_on_creation").(bool)), - }, - } - - log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts) - - _, err := conn.ModifySubnetAttribute(modifyOpts) - - if err != nil { - return err - } else { - d.SetPartial("assign_ipv6_address_on_creation") - } - } - - if d.HasChange("map_public_ip_on_launch") { - modifyOpts := &ec2.ModifySubnetAttributeInput{ - SubnetId: aws.String(d.Id()), - MapPublicIpOnLaunch: &ec2.AttributeBooleanValue{ - Value: aws.Bool(d.Get("map_public_ip_on_launch").(bool)), - }, - } - - log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts) - - _, err := conn.ModifySubnetAttribute(modifyOpts) - - if err != nil { - return err - } else { - d.SetPartial("map_public_ip_on_launch") - } - } - - d.Partial(false) - - return resourceAwsSubnetRead(d, meta) -} - -func resourceAwsSubnetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[INFO] Deleting subnet: %s", d.Id()) - req := &ec2.DeleteSubnetInput{ - SubnetId: aws.String(d.Id()), - } - - wait := resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"destroyed"}, - Timeout: 5 * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - _, err := conn.DeleteSubnet(req) - if err != nil { - if apiErr, ok := err.(awserr.Error); ok { - if apiErr.Code() == "DependencyViolation" { - // There is some pending operation, so just retry - // in a bit. - return 42, "pending", nil - } - - if apiErr.Code() == "InvalidSubnetID.NotFound" { - return 42, "destroyed", nil - } - } - - return 42, "failure", err - } - - return 42, "destroyed", nil - }, - } - - if _, err := wait.WaitForState(); err != nil { - return fmt.Errorf("Error deleting subnet: %s", err) - } - - return nil -} - -// SubnetStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch a Subnet. -func SubnetStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeSubnets(&ec2.DescribeSubnetsInput{ - SubnetIds: []*string{aws.String(id)}, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidSubnetID.NotFound" { - resp = nil - } else { - log.Printf("Error on SubnetStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - subnet := resp.Subnets[0] - return subnet, *subnet.State, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_volume_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_volume_attachment.go deleted file mode 100644 index 9aed74a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_volume_attachment.go +++ /dev/null @@ -1,251 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVolumeAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVolumeAttachmentCreate, - Read: resourceAwsVolumeAttachmentRead, - Delete: resourceAwsVolumeAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "device_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "instance_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "volume_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "force_detach": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "skip_destroy": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - }, - } -} - -func resourceAwsVolumeAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - name := d.Get("device_name").(string) - iID := d.Get("instance_id").(string) - vID := d.Get("volume_id").(string) - - // Find out if the volume is already attached to the instance, in which case - // we have nothing to do - request := &ec2.DescribeVolumesInput{ - VolumeIds: []*string{aws.String(vID)}, - Filters: []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("attachment.instance-id"), - Values: []*string{aws.String(iID)}, - }, - &ec2.Filter{ - Name: aws.String("attachment.device"), - Values: []*string{aws.String(name)}, - }, - }, - } - - vols, err := conn.DescribeVolumes(request) - if (err != nil) || (len(vols.Volumes) == 0) { - // This handles the situation where the instance is created by - // a spot request and whilst the request has been fulfilled the - // instance is not running yet - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"running"}, - Refresh: InstanceStateRefreshFunc(conn, iID), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for instance (%s) to become ready: %s", - iID, err) - } - - // not attached - opts := &ec2.AttachVolumeInput{ - Device: aws.String(name), - InstanceId: aws.String(iID), - VolumeId: aws.String(vID), - } - - log.Printf("[DEBUG] Attaching Volume (%s) to Instance (%s)", vID, iID) - _, err := conn.AttachVolume(opts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - return fmt.Errorf("[WARN] Error attaching volume (%s) to instance (%s), message: \"%s\", code: \"%s\"", - vID, iID, awsErr.Message(), awsErr.Code()) - } - return err - } - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"attaching"}, - Target: []string{"attached"}, - Refresh: volumeAttachmentStateRefreshFunc(conn, vID, iID), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Volume (%s) to attach to Instance: %s, error: %s", - vID, iID, err) - } - - d.SetId(volumeAttachmentID(name, vID, iID)) - return resourceAwsVolumeAttachmentRead(d, meta) -} - -func volumeAttachmentStateRefreshFunc(conn *ec2.EC2, volumeID, instanceID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - - request := &ec2.DescribeVolumesInput{ - VolumeIds: []*string{aws.String(volumeID)}, - Filters: []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("attachment.instance-id"), - Values: []*string{aws.String(instanceID)}, - }, - }, - } - - resp, err := conn.DescribeVolumes(request) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - return nil, "failed", fmt.Errorf("code: %s, message: %s", awsErr.Code(), awsErr.Message()) - } - return nil, "failed", err - } - - if len(resp.Volumes) > 0 { - v := resp.Volumes[0] - for _, a := range v.Attachments { - if a.InstanceId != nil && *a.InstanceId == instanceID { - return a, *a.State, nil - } - } - } - // assume detached if volume count is 0 - return 42, "detached", nil - } -} -func resourceAwsVolumeAttachmentRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - request := &ec2.DescribeVolumesInput{ - VolumeIds: []*string{aws.String(d.Get("volume_id").(string))}, - Filters: []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("attachment.instance-id"), - Values: []*string{aws.String(d.Get("instance_id").(string))}, - }, - }, - } - - vols, err := conn.DescribeVolumes(request) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVolume.NotFound" { - d.SetId("") - return nil - } - return fmt.Errorf("Error reading EC2 volume %s for instance: %s: %#v", d.Get("volume_id").(string), d.Get("instance_id").(string), err) - } - - if len(vols.Volumes) == 0 || *vols.Volumes[0].State == "available" { - log.Printf("[DEBUG] Volume Attachment (%s) not found, removing from state", d.Id()) - d.SetId("") - } - - return nil -} - -func resourceAwsVolumeAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - if _, ok := d.GetOk("skip_destroy"); ok { - log.Printf("[INFO] Found skip_destroy to be true, removing attachment %q from state", d.Id()) - d.SetId("") - return nil - } - - vID := d.Get("volume_id").(string) - iID := d.Get("instance_id").(string) - - opts := &ec2.DetachVolumeInput{ - Device: aws.String(d.Get("device_name").(string)), - InstanceId: aws.String(iID), - VolumeId: aws.String(vID), - Force: aws.Bool(d.Get("force_detach").(bool)), - } - - _, err := conn.DetachVolume(opts) - if err != nil { - return fmt.Errorf("Failed to detach Volume (%s) from Instance (%s): %s", - vID, iID, err) - } - stateConf := &resource.StateChangeConf{ - Pending: []string{"detaching"}, - Target: []string{"detached"}, - Refresh: volumeAttachmentStateRefreshFunc(conn, vID, iID), - Timeout: 5 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - log.Printf("[DEBUG] Detaching Volume (%s) from Instance (%s)", vID, iID) - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Volume (%s) to detach from Instance: %s", - vID, iID) - } - d.SetId("") - return nil -} - -func volumeAttachmentID(name, volumeID, instanceID string) string { - var buf bytes.Buffer - buf.WriteString(fmt.Sprintf("%s-", name)) - buf.WriteString(fmt.Sprintf("%s-", instanceID)) - buf.WriteString(fmt.Sprintf("%s-", volumeID)) - - return fmt.Sprintf("vai-%d", hashcode.String(buf.String())) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc.go deleted file mode 100644 index e2e9f83..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc.go +++ /dev/null @@ -1,483 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpc() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVpcCreate, - Read: resourceAwsVpcRead, - Update: resourceAwsVpcUpdate, - Delete: resourceAwsVpcDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "cidr_block": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateCIDRNetworkAddress, - }, - - "instance_tenancy": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - - "enable_dns_hostnames": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "enable_dns_support": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - - "enable_classiclink": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - - "assign_generated_ipv6_cidr_block": { - Type: schema.TypeBool, - ForceNew: true, - Optional: true, - Default: false, - }, - - "main_route_table_id": { - Type: schema.TypeString, - Computed: true, - }, - - "default_network_acl_id": { - Type: schema.TypeString, - Computed: true, - }, - - "dhcp_options_id": { - Type: schema.TypeString, - Computed: true, - }, - - "default_security_group_id": { - Type: schema.TypeString, - Computed: true, - }, - - "default_route_table_id": { - Type: schema.TypeString, - Computed: true, - }, - - "ipv6_association_id": { - Type: schema.TypeString, - Computed: true, - }, - - "ipv6_cidr_block": { - Type: schema.TypeString, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - instance_tenancy := "default" - if v, ok := d.GetOk("instance_tenancy"); ok { - instance_tenancy = v.(string) - } - - // Create the VPC - createOpts := &ec2.CreateVpcInput{ - CidrBlock: aws.String(d.Get("cidr_block").(string)), - InstanceTenancy: aws.String(instance_tenancy), - AmazonProvidedIpv6CidrBlock: aws.Bool(d.Get("assign_generated_ipv6_cidr_block").(bool)), - } - - log.Printf("[DEBUG] VPC create config: %#v", *createOpts) - vpcResp, err := conn.CreateVpc(createOpts) - if err != nil { - return fmt.Errorf("Error creating VPC: %s", err) - } - - // Get the ID and store it - vpc := vpcResp.Vpc - d.SetId(*vpc.VpcId) - log.Printf("[INFO] VPC ID: %s", d.Id()) - - // Set partial mode and say that we setup the cidr block - d.Partial(true) - d.SetPartial("cidr_block") - - // Wait for the VPC to become available - log.Printf( - "[DEBUG] Waiting for VPC (%s) to become available", - d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"available"}, - Refresh: VPCStateRefreshFunc(conn, d.Id()), - Timeout: 10 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for VPC (%s) to become available: %s", - d.Id(), err) - } - - // Update our attributes and return - return resourceAwsVpcUpdate(d, meta) -} - -func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Refresh the VPC state - vpcRaw, _, err := VPCStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - if vpcRaw == nil { - d.SetId("") - return nil - } - - // VPC stuff - vpc := vpcRaw.(*ec2.Vpc) - vpcid := d.Id() - d.Set("cidr_block", vpc.CidrBlock) - d.Set("dhcp_options_id", vpc.DhcpOptionsId) - d.Set("instance_tenancy", vpc.InstanceTenancy) - - // Tags - d.Set("tags", tagsToMap(vpc.Tags)) - - if vpc.Ipv6CidrBlockAssociationSet != nil { - d.Set("assign_generated_ipv6_cidr_block", true) - d.Set("ipv6_association_id", vpc.Ipv6CidrBlockAssociationSet[0].AssociationId) - d.Set("ipv6_cidr_block", vpc.Ipv6CidrBlockAssociationSet[0].Ipv6CidrBlock) - } else { - d.Set("assign_generated_ipv6_cidr_block", false) - } - - // Attributes - attribute := "enableDnsSupport" - DescribeAttrOpts := &ec2.DescribeVpcAttributeInput{ - Attribute: aws.String(attribute), - VpcId: aws.String(vpcid), - } - resp, err := conn.DescribeVpcAttribute(DescribeAttrOpts) - if err != nil { - return err - } - d.Set("enable_dns_support", *resp.EnableDnsSupport.Value) - attribute = "enableDnsHostnames" - DescribeAttrOpts = &ec2.DescribeVpcAttributeInput{ - Attribute: &attribute, - VpcId: &vpcid, - } - resp, err = conn.DescribeVpcAttribute(DescribeAttrOpts) - if err != nil { - return err - } - d.Set("enable_dns_hostnames", *resp.EnableDnsHostnames.Value) - - DescribeClassiclinkOpts := &ec2.DescribeVpcClassicLinkInput{ - VpcIds: []*string{&vpcid}, - } - - // Classic Link is only available in regions that support EC2 Classic - respClassiclink, err := conn.DescribeVpcClassicLink(DescribeClassiclinkOpts) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "UnsupportedOperation" { - log.Printf("[WARN] VPC Classic Link is not supported in this region") - } else { - return err - } - } else { - classiclink_enabled := false - for _, v := range respClassiclink.Vpcs { - if *v.VpcId == vpcid { - if v.ClassicLinkEnabled != nil { - classiclink_enabled = *v.ClassicLinkEnabled - } - break - } - } - d.Set("enable_classiclink", classiclink_enabled) - } - - // Get the main routing table for this VPC - // Really Ugly need to make this better - rmenn - filter1 := &ec2.Filter{ - Name: aws.String("association.main"), - Values: []*string{aws.String("true")}, - } - filter2 := &ec2.Filter{ - Name: aws.String("vpc-id"), - Values: []*string{aws.String(d.Id())}, - } - DescribeRouteOpts := &ec2.DescribeRouteTablesInput{ - Filters: []*ec2.Filter{filter1, filter2}, - } - routeResp, err := conn.DescribeRouteTables(DescribeRouteOpts) - if err != nil { - return err - } - if v := routeResp.RouteTables; len(v) > 0 { - d.Set("main_route_table_id", *v[0].RouteTableId) - } - - if err := resourceAwsVpcSetDefaultNetworkAcl(conn, d); err != nil { - log.Printf("[WARN] Unable to set Default Network ACL: %s", err) - } - if err := resourceAwsVpcSetDefaultSecurityGroup(conn, d); err != nil { - log.Printf("[WARN] Unable to set Default Security Group: %s", err) - } - if err := resourceAwsVpcSetDefaultRouteTable(conn, d); err != nil { - log.Printf("[WARN] Unable to set Default Route Table: %s", err) - } - - return nil -} - -func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Turn on partial mode - d.Partial(true) - vpcid := d.Id() - if d.HasChange("enable_dns_hostnames") { - val := d.Get("enable_dns_hostnames").(bool) - modifyOpts := &ec2.ModifyVpcAttributeInput{ - VpcId: &vpcid, - EnableDnsHostnames: &ec2.AttributeBooleanValue{ - Value: &val, - }, - } - - log.Printf( - "[INFO] Modifying enable_dns_hostnames vpc attribute for %s: %s", - d.Id(), modifyOpts) - if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil { - return err - } - - d.SetPartial("enable_dns_hostnames") - } - - _, hasEnableDnsSupportOption := d.GetOk("enable_dns_support") - - if !hasEnableDnsSupportOption || d.HasChange("enable_dns_support") { - val := d.Get("enable_dns_support").(bool) - modifyOpts := &ec2.ModifyVpcAttributeInput{ - VpcId: &vpcid, - EnableDnsSupport: &ec2.AttributeBooleanValue{ - Value: &val, - }, - } - - log.Printf( - "[INFO] Modifying enable_dns_support vpc attribute for %s: %s", - d.Id(), modifyOpts) - if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil { - return err - } - - d.SetPartial("enable_dns_support") - } - - if d.HasChange("enable_classiclink") { - val := d.Get("enable_classiclink").(bool) - - if val { - modifyOpts := &ec2.EnableVpcClassicLinkInput{ - VpcId: &vpcid, - } - log.Printf( - "[INFO] Modifying enable_classiclink vpc attribute for %s: %#v", - d.Id(), modifyOpts) - if _, err := conn.EnableVpcClassicLink(modifyOpts); err != nil { - return err - } - } else { - modifyOpts := &ec2.DisableVpcClassicLinkInput{ - VpcId: &vpcid, - } - log.Printf( - "[INFO] Modifying enable_classiclink vpc attribute for %s: %#v", - d.Id(), modifyOpts) - if _, err := conn.DisableVpcClassicLink(modifyOpts); err != nil { - return err - } - } - - d.SetPartial("enable_classiclink") - } - - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - d.Partial(false) - return resourceAwsVpcRead(d, meta) -} - -func resourceAwsVpcDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - vpcID := d.Id() - DeleteVpcOpts := &ec2.DeleteVpcInput{ - VpcId: &vpcID, - } - log.Printf("[INFO] Deleting VPC: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteVpc(DeleteVpcOpts) - if err == nil { - return nil - } - - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.NonRetryableError(err) - } - - switch ec2err.Code() { - case "InvalidVpcID.NotFound": - return nil - case "DependencyViolation": - return resource.RetryableError(err) - } - - return resource.NonRetryableError(fmt.Errorf("Error deleting VPC: %s", err)) - }) -} - -// VPCStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// a VPC. -func VPCStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - DescribeVpcOpts := &ec2.DescribeVpcsInput{ - VpcIds: []*string{aws.String(id)}, - } - resp, err := conn.DescribeVpcs(DescribeVpcOpts) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpcID.NotFound" { - resp = nil - } else { - log.Printf("Error on VPCStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - vpc := resp.Vpcs[0] - return vpc, *vpc.State, nil - } -} - -func resourceAwsVpcSetDefaultNetworkAcl(conn *ec2.EC2, d *schema.ResourceData) error { - filter1 := &ec2.Filter{ - Name: aws.String("default"), - Values: []*string{aws.String("true")}, - } - filter2 := &ec2.Filter{ - Name: aws.String("vpc-id"), - Values: []*string{aws.String(d.Id())}, - } - DescribeNetworkACLOpts := &ec2.DescribeNetworkAclsInput{ - Filters: []*ec2.Filter{filter1, filter2}, - } - networkAclResp, err := conn.DescribeNetworkAcls(DescribeNetworkACLOpts) - - if err != nil { - return err - } - if v := networkAclResp.NetworkAcls; len(v) > 0 { - d.Set("default_network_acl_id", v[0].NetworkAclId) - } - - return nil -} - -func resourceAwsVpcSetDefaultSecurityGroup(conn *ec2.EC2, d *schema.ResourceData) error { - filter1 := &ec2.Filter{ - Name: aws.String("group-name"), - Values: []*string{aws.String("default")}, - } - filter2 := &ec2.Filter{ - Name: aws.String("vpc-id"), - Values: []*string{aws.String(d.Id())}, - } - DescribeSgOpts := &ec2.DescribeSecurityGroupsInput{ - Filters: []*ec2.Filter{filter1, filter2}, - } - securityGroupResp, err := conn.DescribeSecurityGroups(DescribeSgOpts) - - if err != nil { - return err - } - if v := securityGroupResp.SecurityGroups; len(v) > 0 { - d.Set("default_security_group_id", v[0].GroupId) - } - - return nil -} - -func resourceAwsVpcSetDefaultRouteTable(conn *ec2.EC2, d *schema.ResourceData) error { - filter1 := &ec2.Filter{ - Name: aws.String("association.main"), - Values: []*string{aws.String("true")}, - } - filter2 := &ec2.Filter{ - Name: aws.String("vpc-id"), - Values: []*string{aws.String(d.Id())}, - } - - findOpts := &ec2.DescribeRouteTablesInput{ - Filters: []*ec2.Filter{filter1, filter2}, - } - - resp, err := conn.DescribeRouteTables(findOpts) - if err != nil { - return err - } - - if len(resp.RouteTables) < 1 || resp.RouteTables[0] == nil { - return fmt.Errorf("Default Route table not found") - } - - // There Can Be Only 1 ... Default Route Table - d.Set("default_route_table_id", resp.RouteTables[0].RouteTableId) - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_dhcp_options.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_dhcp_options.go deleted file mode 100644 index 16c33fd..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_dhcp_options.go +++ /dev/null @@ -1,281 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpcDhcpOptions() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVpcDhcpOptionsCreate, - Read: resourceAwsVpcDhcpOptionsRead, - Update: resourceAwsVpcDhcpOptionsUpdate, - Delete: resourceAwsVpcDhcpOptionsDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "domain_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "domain_name_servers": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "ntp_servers": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "netbios_node_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "netbios_name_servers": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "tags": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - }, - }, - } -} - -func resourceAwsVpcDhcpOptionsCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - setDHCPOption := func(key string) *ec2.NewDhcpConfiguration { - log.Printf("[DEBUG] Setting DHCP option %s...", key) - tfKey := strings.Replace(key, "-", "_", -1) - - value, ok := d.GetOk(tfKey) - if !ok { - return nil - } - - if v, ok := value.(string); ok { - return &ec2.NewDhcpConfiguration{ - Key: aws.String(key), - Values: []*string{ - aws.String(v), - }, - } - } - - if v, ok := value.([]interface{}); ok { - var s []*string - for _, attr := range v { - s = append(s, aws.String(attr.(string))) - } - - return &ec2.NewDhcpConfiguration{ - Key: aws.String(key), - Values: s, - } - } - - return nil - } - - createOpts := &ec2.CreateDhcpOptionsInput{ - DhcpConfigurations: []*ec2.NewDhcpConfiguration{ - setDHCPOption("domain-name"), - setDHCPOption("domain-name-servers"), - setDHCPOption("ntp-servers"), - setDHCPOption("netbios-node-type"), - setDHCPOption("netbios-name-servers"), - }, - } - - resp, err := conn.CreateDhcpOptions(createOpts) - if err != nil { - return fmt.Errorf("Error creating DHCP Options Set: %s", err) - } - - dos := resp.DhcpOptions - d.SetId(*dos.DhcpOptionsId) - log.Printf("[INFO] DHCP Options Set ID: %s", d.Id()) - - // Wait for the DHCP Options to become available - log.Printf("[DEBUG] Waiting for DHCP Options (%s) to become available", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"created"}, - Refresh: resourceDHCPOptionsStateRefreshFunc(conn, d.Id()), - Timeout: 1 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for DHCP Options (%s) to become available: %s", - d.Id(), err) - } - - return resourceAwsVpcDhcpOptionsUpdate(d, meta) -} - -func resourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - req := &ec2.DescribeDhcpOptionsInput{ - DhcpOptionsIds: []*string{ - aws.String(d.Id()), - }, - } - - resp, err := conn.DescribeDhcpOptions(req) - if err != nil { - return fmt.Errorf("Error retrieving DHCP Options: %s", err) - } - - if len(resp.DhcpOptions) == 0 { - return nil - } - - opts := resp.DhcpOptions[0] - d.Set("tags", tagsToMap(opts.Tags)) - - for _, cfg := range opts.DhcpConfigurations { - tfKey := strings.Replace(*cfg.Key, "-", "_", -1) - - if _, ok := d.Get(tfKey).(string); ok { - d.Set(tfKey, cfg.Values[0].Value) - } else { - values := make([]string, 0, len(cfg.Values)) - for _, v := range cfg.Values { - values = append(values, *v.Value) - } - - d.Set(tfKey, values) - } - } - - return nil -} - -func resourceAwsVpcDhcpOptionsUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - return setTags(conn, d) -} - -func resourceAwsVpcDhcpOptionsDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - return resource.Retry(3*time.Minute, func() *resource.RetryError { - log.Printf("[INFO] Deleting DHCP Options ID %s...", d.Id()) - _, err := conn.DeleteDhcpOptions(&ec2.DeleteDhcpOptionsInput{ - DhcpOptionsId: aws.String(d.Id()), - }) - - if err == nil { - return nil - } - - log.Printf("[WARN] %s", err) - - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.RetryableError(err) - } - - switch ec2err.Code() { - case "InvalidDhcpOptionsID.NotFound": - return nil - case "DependencyViolation": - // If it is a dependency violation, we want to disassociate - // all VPCs using the given DHCP Options ID, and retry deleting. - vpcs, err2 := findVPCsByDHCPOptionsID(conn, d.Id()) - if err2 != nil { - log.Printf("[ERROR] %s", err2) - return resource.RetryableError(err2) - } - - for _, vpc := range vpcs { - log.Printf("[INFO] Disassociating DHCP Options Set %s from VPC %s...", d.Id(), *vpc.VpcId) - if _, err := conn.AssociateDhcpOptions(&ec2.AssociateDhcpOptionsInput{ - DhcpOptionsId: aws.String("default"), - VpcId: vpc.VpcId, - }); err != nil { - return resource.RetryableError(err) - } - } - return resource.RetryableError(err) - default: - return resource.NonRetryableError(err) - } - }) -} - -func findVPCsByDHCPOptionsID(conn *ec2.EC2, id string) ([]*ec2.Vpc, error) { - req := &ec2.DescribeVpcsInput{ - Filters: []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("dhcp-options-id"), - Values: []*string{ - aws.String(id), - }, - }, - }, - } - - resp, err := conn.DescribeVpcs(req) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpcID.NotFound" { - return nil, nil - } - return nil, err - } - - return resp.Vpcs, nil -} - -func resourceDHCPOptionsStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - DescribeDhcpOpts := &ec2.DescribeDhcpOptionsInput{ - DhcpOptionsIds: []*string{ - aws.String(id), - }, - } - - resp, err := conn.DescribeDhcpOptions(DescribeDhcpOpts) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidDhcpOptionsID.NotFound" { - resp = nil - } else { - log.Printf("Error on DHCPOptionsStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - dos := resp.DhcpOptions[0] - return dos, "created", nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_dhcp_options_association.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_dhcp_options_association.go deleted file mode 100644 index 7bdcb7a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_dhcp_options_association.go +++ /dev/null @@ -1,99 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpcDhcpOptionsAssociation() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVpcDhcpOptionsAssociationCreate, - Read: resourceAwsVpcDhcpOptionsAssociationRead, - Update: resourceAwsVpcDhcpOptionsAssociationUpdate, - Delete: resourceAwsVpcDhcpOptionsAssociationDelete, - - Schema: map[string]*schema.Schema{ - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "dhcp_options_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsVpcDhcpOptionsAssociationCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf( - "[INFO] Creating DHCP Options association: %s => %s", - d.Get("vpc_id").(string), - d.Get("dhcp_options_id").(string)) - - optsID := aws.String(d.Get("dhcp_options_id").(string)) - vpcID := aws.String(d.Get("vpc_id").(string)) - - if _, err := conn.AssociateDhcpOptions(&ec2.AssociateDhcpOptionsInput{ - DhcpOptionsId: optsID, - VpcId: vpcID, - }); err != nil { - return err - } - - // Set the ID and return - d.SetId(*optsID + "-" + *vpcID) - log.Printf("[INFO] Association ID: %s", d.Id()) - - return nil -} - -func resourceAwsVpcDhcpOptionsAssociationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - // Get the VPC that this association belongs to - vpcRaw, _, err := VPCStateRefreshFunc(conn, d.Get("vpc_id").(string))() - - if err != nil { - return err - } - - if vpcRaw == nil { - return nil - } - - vpc := vpcRaw.(*ec2.Vpc) - if *vpc.VpcId != d.Get("vpc_id") || *vpc.DhcpOptionsId != d.Get("dhcp_options_id") { - log.Printf("[INFO] It seems the DHCP Options association is gone. Deleting reference from Graph...") - d.SetId("") - } - - return nil -} - -// DHCP Options Asociations cannot be updated. -func resourceAwsVpcDhcpOptionsAssociationUpdate(d *schema.ResourceData, meta interface{}) error { - return resourceAwsVpcDhcpOptionsAssociationCreate(d, meta) -} - -// AWS does not provide an API to disassociate a DHCP Options set from a VPC. -// So, we do this by setting the VPC to the default DHCP Options Set. -func resourceAwsVpcDhcpOptionsAssociationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - log.Printf("[INFO] Disassociating DHCP Options Set %s from VPC %s...", d.Get("dhcp_options_id"), d.Get("vpc_id")) - if _, err := conn.AssociateDhcpOptions(&ec2.AssociateDhcpOptionsInput{ - DhcpOptionsId: aws.String("default"), - VpcId: aws.String(d.Get("vpc_id").(string)), - }); err != nil { - return err - } - - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_endpoint.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_endpoint.go deleted file mode 100644 index b079403..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_endpoint.go +++ /dev/null @@ -1,237 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpcEndpoint() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVPCEndpointCreate, - Read: resourceAwsVPCEndpointRead, - Update: resourceAwsVPCEndpointUpdate, - Delete: resourceAwsVPCEndpointDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "policy": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateJsonString, - StateFunc: func(v interface{}) string { - json, _ := normalizeJsonString(v) - return json - }, - }, - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "service_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "route_table_ids": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "prefix_list_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "cidr_blocks": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - } -} - -func resourceAwsVPCEndpointCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - input := &ec2.CreateVpcEndpointInput{ - VpcId: aws.String(d.Get("vpc_id").(string)), - ServiceName: aws.String(d.Get("service_name").(string)), - } - - if v, ok := d.GetOk("route_table_ids"); ok { - list := v.(*schema.Set).List() - if len(list) > 0 { - input.RouteTableIds = expandStringList(list) - } - } - - if v, ok := d.GetOk("policy"); ok { - policy, err := normalizeJsonString(v) - if err != nil { - return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) - } - input.PolicyDocument = aws.String(policy) - } - - log.Printf("[DEBUG] Creating VPC Endpoint: %#v", input) - output, err := conn.CreateVpcEndpoint(input) - if err != nil { - return fmt.Errorf("Error creating VPC Endpoint: %s", err) - } - log.Printf("[DEBUG] VPC Endpoint %q created.", *output.VpcEndpoint.VpcEndpointId) - - d.SetId(*output.VpcEndpoint.VpcEndpointId) - - return resourceAwsVPCEndpointRead(d, meta) -} - -func resourceAwsVPCEndpointRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - input := &ec2.DescribeVpcEndpointsInput{ - VpcEndpointIds: []*string{aws.String(d.Id())}, - } - - log.Printf("[DEBUG] Reading VPC Endpoint: %q", d.Id()) - output, err := conn.DescribeVpcEndpoints(input) - - if err != nil { - ec2err, ok := err.(awserr.Error) - if !ok { - return fmt.Errorf("Error reading VPC Endpoint: %s", err.Error()) - } - - if ec2err.Code() == "InvalidVpcEndpointId.NotFound" { - log.Printf("[WARN] VPC Endpoint (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - - return fmt.Errorf("Error reading VPC Endpoint: %s", err.Error()) - } - - if len(output.VpcEndpoints) != 1 { - return fmt.Errorf("There's no unique VPC Endpoint, but %d endpoints: %#v", - len(output.VpcEndpoints), output.VpcEndpoints) - } - - vpce := output.VpcEndpoints[0] - - // A VPC Endpoint is associated with exactly one prefix list name (also called Service Name). - // The prefix list ID can be used in security groups, so retrieve it to support that capability. - prefixListServiceName := *vpce.ServiceName - prefixListInput := &ec2.DescribePrefixListsInput{ - Filters: []*ec2.Filter{ - {Name: aws.String("prefix-list-name"), Values: []*string{aws.String(prefixListServiceName)}}, - }, - } - - log.Printf("[DEBUG] Reading VPC Endpoint prefix list: %s", prefixListServiceName) - prefixListsOutput, err := conn.DescribePrefixLists(prefixListInput) - - if err != nil { - _, ok := err.(awserr.Error) - if !ok { - return fmt.Errorf("Error reading VPC Endpoint prefix list: %s", err.Error()) - } - } - - if len(prefixListsOutput.PrefixLists) != 1 { - return fmt.Errorf("There are multiple prefix lists associated with the service name '%s'. Unexpected", prefixListServiceName) - } - - policy, err := normalizeJsonString(*vpce.PolicyDocument) - if err != nil { - return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) - } - - d.Set("vpc_id", vpce.VpcId) - d.Set("policy", policy) - d.Set("service_name", vpce.ServiceName) - if err := d.Set("route_table_ids", aws.StringValueSlice(vpce.RouteTableIds)); err != nil { - return err - } - pl := prefixListsOutput.PrefixLists[0] - d.Set("prefix_list_id", pl.PrefixListId) - d.Set("cidr_blocks", aws.StringValueSlice(pl.Cidrs)) - - return nil -} - -func resourceAwsVPCEndpointUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - input := &ec2.ModifyVpcEndpointInput{ - VpcEndpointId: aws.String(d.Id()), - } - - if d.HasChange("route_table_ids") { - o, n := d.GetChange("route_table_ids") - os := o.(*schema.Set) - ns := n.(*schema.Set) - - add := expandStringList(ns.Difference(os).List()) - if len(add) > 0 { - input.AddRouteTableIds = add - } - - remove := expandStringList(os.Difference(ns).List()) - if len(remove) > 0 { - input.RemoveRouteTableIds = remove - } - } - - if d.HasChange("policy") { - policy, err := normalizeJsonString(d.Get("policy")) - if err != nil { - return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) - } - input.PolicyDocument = aws.String(policy) - } - - log.Printf("[DEBUG] Updating VPC Endpoint: %#v", input) - _, err := conn.ModifyVpcEndpoint(input) - if err != nil { - return fmt.Errorf("Error updating VPC Endpoint: %s", err) - } - log.Printf("[DEBUG] VPC Endpoint %q updated", input.VpcEndpointId) - - return resourceAwsVPCEndpointRead(d, meta) -} - -func resourceAwsVPCEndpointDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - input := &ec2.DeleteVpcEndpointsInput{ - VpcEndpointIds: []*string{aws.String(d.Id())}, - } - - log.Printf("[DEBUG] Deleting VPC Endpoint: %#v", input) - _, err := conn.DeleteVpcEndpoints(input) - - if err != nil { - ec2err, ok := err.(awserr.Error) - if !ok { - return fmt.Errorf("Error deleting VPC Endpoint: %s", err.Error()) - } - - if ec2err.Code() == "InvalidVpcEndpointId.NotFound" { - log.Printf("[DEBUG] VPC Endpoint %q is already gone", d.Id()) - } else { - return fmt.Errorf("Error deleting VPC Endpoint: %s", err.Error()) - } - } - - log.Printf("[DEBUG] VPC Endpoint %q deleted", d.Id()) - d.SetId("") - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_endpoint_route_table_association.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_endpoint_route_table_association.go deleted file mode 100644 index 655638a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_endpoint_route_table_association.go +++ /dev/null @@ -1,159 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpcEndpointRouteTableAssociation() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVPCEndpointRouteTableAssociationCreate, - Read: resourceAwsVPCEndpointRouteTableAssociationRead, - Delete: resourceAwsVPCEndpointRouteTableAssociationDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "vpc_endpoint_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "route_table_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsVPCEndpointRouteTableAssociationCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - endpointId := d.Get("vpc_endpoint_id").(string) - rtId := d.Get("route_table_id").(string) - - _, err := findResourceVPCEndpoint(conn, endpointId) - if err != nil { - return err - } - - log.Printf( - "[INFO] Creating VPC Endpoint/Route Table association: %s => %s", - endpointId, rtId) - - input := &ec2.ModifyVpcEndpointInput{ - VpcEndpointId: aws.String(endpointId), - AddRouteTableIds: aws.StringSlice([]string{rtId}), - } - - _, err = conn.ModifyVpcEndpoint(input) - if err != nil { - return fmt.Errorf("Error creating VPC Endpoint/Route Table association: %s", err.Error()) - } - id := vpcEndpointIdRouteTableIdHash(endpointId, rtId) - log.Printf("[DEBUG] VPC Endpoint/Route Table association %q created.", id) - - d.SetId(id) - - return resourceAwsVPCEndpointRouteTableAssociationRead(d, meta) -} - -func resourceAwsVPCEndpointRouteTableAssociationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - endpointId := d.Get("vpc_endpoint_id").(string) - rtId := d.Get("route_table_id").(string) - - vpce, err := findResourceVPCEndpoint(conn, endpointId) - if err != nil { - if err, ok := err.(awserr.Error); ok && err.Code() == "InvalidVpcEndpointId.NotFound" { - d.SetId("") - return nil - } - - return err - } - - found := false - for _, id := range vpce.RouteTableIds { - if id != nil && *id == rtId { - found = true - break - } - } - if !found { - // The association no longer exists. - d.SetId("") - return nil - } - - id := vpcEndpointIdRouteTableIdHash(endpointId, rtId) - log.Printf("[DEBUG] Computed VPC Endpoint/Route Table ID %s", id) - d.SetId(id) - - return nil -} - -func resourceAwsVPCEndpointRouteTableAssociationDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - endpointId := d.Get("vpc_endpoint_id").(string) - rtId := d.Get("route_table_id").(string) - - input := &ec2.ModifyVpcEndpointInput{ - VpcEndpointId: aws.String(endpointId), - RemoveRouteTableIds: aws.StringSlice([]string{rtId}), - } - - _, err := conn.ModifyVpcEndpoint(input) - if err != nil { - ec2err, ok := err.(awserr.Error) - if !ok { - return fmt.Errorf("Error deleting VPC Endpoint/Route Table association: %s", err.Error()) - } - - switch ec2err.Code() { - case "InvalidVpcEndpointId.NotFound": - fallthrough - case "InvalidRouteTableId.NotFound": - fallthrough - case "InvalidParameter": - log.Printf("[DEBUG] VPC Endpoint/Route Table association is already gone") - default: - return fmt.Errorf("Error deleting VPC Endpoint/Route Table association: %s", err.Error()) - } - } - - log.Printf("[DEBUG] VPC Endpoint/Route Table association %q deleted", d.Id()) - d.SetId("") - - return nil -} - -func findResourceVPCEndpoint(conn *ec2.EC2, id string) (*ec2.VpcEndpoint, error) { - input := &ec2.DescribeVpcEndpointsInput{ - VpcEndpointIds: aws.StringSlice([]string{id}), - } - - log.Printf("[DEBUG] Reading VPC Endpoint: %q", id) - output, err := conn.DescribeVpcEndpoints(input) - if err != nil { - return nil, err - } - - if output.VpcEndpoints == nil { - return nil, fmt.Errorf("No VPC Endpoints were found for %q", id) - } - - return output.VpcEndpoints[0], nil -} - -func vpcEndpointIdRouteTableIdHash(endpointId, rtId string) string { - return fmt.Sprintf("a-%s%d", endpointId, hashcode.String(rtId)) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection.go deleted file mode 100644 index 24a1912..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection.go +++ /dev/null @@ -1,381 +0,0 @@ -package aws - -import ( - "errors" - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpcPeeringConnection() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVPCPeeringCreate, - Read: resourceAwsVPCPeeringRead, - Update: resourceAwsVPCPeeringUpdate, - Delete: resourceAwsVPCPeeringDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "peer_owner_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - }, - "peer_vpc_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "vpc_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "auto_accept": { - Type: schema.TypeBool, - Optional: true, - }, - "accept_status": { - Type: schema.TypeString, - Computed: true, - }, - "accepter": vpcPeeringConnectionOptionsSchema(), - "requester": vpcPeeringConnectionOptionsSchema(), - "tags": tagsSchema(), - }, - } -} - -func resourceAwsVPCPeeringCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Create the vpc peering connection - createOpts := &ec2.CreateVpcPeeringConnectionInput{ - PeerVpcId: aws.String(d.Get("peer_vpc_id").(string)), - VpcId: aws.String(d.Get("vpc_id").(string)), - } - - if v, ok := d.GetOk("peer_owner_id"); ok { - createOpts.PeerOwnerId = aws.String(v.(string)) - } - - log.Printf("[DEBUG] VPC Peering Create options: %#v", createOpts) - - resp, err := conn.CreateVpcPeeringConnection(createOpts) - if err != nil { - return errwrap.Wrapf("Error creating VPC Peering Connection: {{err}}", err) - } - - // Get the ID and store it - rt := resp.VpcPeeringConnection - d.SetId(*rt.VpcPeeringConnectionId) - log.Printf("[INFO] VPC Peering Connection ID: %s", d.Id()) - - // Wait for the vpc peering connection to become available - log.Printf("[DEBUG] Waiting for VPC Peering Connection (%s) to become available.", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"initiating-request", "provisioning", "pending"}, - Target: []string{"pending-acceptance", "active"}, - Refresh: resourceAwsVPCPeeringConnectionStateRefreshFunc(conn, d.Id()), - Timeout: 1 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return errwrap.Wrapf(fmt.Sprintf( - "Error waiting for VPC Peering Connection (%s) to become available: {{err}}", - d.Id()), err) - } - - return resourceAwsVPCPeeringUpdate(d, meta) -} - -func resourceAwsVPCPeeringRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*AWSClient) - conn := client.ec2conn - - pcRaw, status, err := resourceAwsVPCPeeringConnectionStateRefreshFunc(conn, d.Id())() - // Allow a failed VPC Peering Connection to fallthrough, - // to allow rest of the logic below to do its work. - if err != nil && status != "failed" { - return err - } - - if pcRaw == nil { - d.SetId("") - return nil - } - - pc := pcRaw.(*ec2.VpcPeeringConnection) - - // The failed status is a status that we can assume just means the - // connection is gone. Destruction isn't allowed, and it eventually - // just "falls off" the console. See GH-2322 - if pc.Status != nil { - status := map[string]bool{ - "deleted": true, - "deleting": true, - "expired": true, - "failed": true, - "rejected": true, - } - if _, ok := status[*pc.Status.Code]; ok { - log.Printf("[DEBUG] VPC Peering Connection (%s) in state (%s), removing.", - d.Id(), *pc.Status.Code) - d.SetId("") - return nil - } - } - log.Printf("[DEBUG] VPC Peering Connection response: %#v", pc) - - log.Printf("[DEBUG] Account ID %s, VPC PeerConn Requester %s, Accepter %s", - client.accountid, *pc.RequesterVpcInfo.OwnerId, *pc.AccepterVpcInfo.OwnerId) - - if (client.accountid == *pc.AccepterVpcInfo.OwnerId) && (client.accountid != *pc.RequesterVpcInfo.OwnerId) { - // We're the accepter - d.Set("peer_owner_id", pc.RequesterVpcInfo.OwnerId) - d.Set("peer_vpc_id", pc.RequesterVpcInfo.VpcId) - d.Set("vpc_id", pc.AccepterVpcInfo.VpcId) - } else { - // We're the requester - d.Set("peer_owner_id", pc.AccepterVpcInfo.OwnerId) - d.Set("peer_vpc_id", pc.AccepterVpcInfo.VpcId) - d.Set("vpc_id", pc.RequesterVpcInfo.VpcId) - } - - d.Set("accept_status", pc.Status.Code) - - // When the VPC Peering Connection is pending acceptance, - // the details about accepter and/or requester peering - // options would not be included in the response. - if pc.AccepterVpcInfo.PeeringOptions != nil { - err := d.Set("accepter", flattenPeeringOptions(pc.AccepterVpcInfo.PeeringOptions)) - if err != nil { - return errwrap.Wrapf("Error setting VPC Peering Connection accepter information: {{err}}", err) - } - } - - if pc.RequesterVpcInfo.PeeringOptions != nil { - err := d.Set("requester", flattenPeeringOptions(pc.RequesterVpcInfo.PeeringOptions)) - if err != nil { - return errwrap.Wrapf("Error setting VPC Peering Connection requester information: {{err}}", err) - } - } - - err = d.Set("tags", tagsToMap(pc.Tags)) - if err != nil { - return errwrap.Wrapf("Error setting VPC Peering Connection tags: {{err}}", err) - } - - return nil -} - -func resourceVPCPeeringConnectionAccept(conn *ec2.EC2, id string) (string, error) { - log.Printf("[INFO] Accept VPC Peering Connection with ID: %s", id) - - req := &ec2.AcceptVpcPeeringConnectionInput{ - VpcPeeringConnectionId: aws.String(id), - } - - resp, err := conn.AcceptVpcPeeringConnection(req) - if err != nil { - return "", err - } - pc := resp.VpcPeeringConnection - - return *pc.Status.Code, nil -} - -func resourceVPCPeeringConnectionOptionsModify(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - modifyOpts := &ec2.ModifyVpcPeeringConnectionOptionsInput{ - VpcPeeringConnectionId: aws.String(d.Id()), - } - - if v, ok := d.GetOk("accepter"); ok { - if s := v.(*schema.Set); len(s.List()) > 0 { - co := s.List()[0].(map[string]interface{}) - modifyOpts.AccepterPeeringConnectionOptions = expandPeeringOptions(co) - } - } - - if v, ok := d.GetOk("requester"); ok { - if s := v.(*schema.Set); len(s.List()) > 0 { - co := s.List()[0].(map[string]interface{}) - modifyOpts.RequesterPeeringConnectionOptions = expandPeeringOptions(co) - } - } - - log.Printf("[DEBUG] VPC Peering Connection modify options: %#v", modifyOpts) - if _, err := conn.ModifyVpcPeeringConnectionOptions(modifyOpts); err != nil { - return err - } - - return nil -} - -func resourceAwsVPCPeeringUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - - pcRaw, _, err := resourceAwsVPCPeeringConnectionStateRefreshFunc(conn, d.Id())() - if err != nil { - return err - } - - if pcRaw == nil { - d.SetId("") - return nil - } - pc := pcRaw.(*ec2.VpcPeeringConnection) - - if _, ok := d.GetOk("auto_accept"); ok { - if pc.Status != nil && *pc.Status.Code == "pending-acceptance" { - status, err := resourceVPCPeeringConnectionAccept(conn, d.Id()) - if err != nil { - return errwrap.Wrapf("Unable to accept VPC Peering Connection: {{err}}", err) - } - log.Printf("[DEBUG] VPC Peering Connection accept status: %s", status) - } - } - - if d.HasChange("accepter") || d.HasChange("requester") { - _, ok := d.GetOk("auto_accept") - if !ok && pc.Status != nil && *pc.Status.Code != "active" { - return fmt.Errorf("Unable to modify peering options. The VPC Peering Connection "+ - "%q is not active. Please set `auto_accept` attribute to `true`, "+ - "or activate VPC Peering Connection manually.", d.Id()) - } - - if err := resourceVPCPeeringConnectionOptionsModify(d, meta); err != nil { - return errwrap.Wrapf("Error modifying VPC Peering Connection options: {{err}}", err) - } - } - - return resourceAwsVPCPeeringRead(d, meta) -} - -func resourceAwsVPCPeeringDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - _, err := conn.DeleteVpcPeeringConnection( - &ec2.DeleteVpcPeeringConnectionInput{ - VpcPeeringConnectionId: aws.String(d.Id()), - }) - - return err -} - -// resourceAwsVPCPeeringConnectionStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// a VPCPeeringConnection. -func resourceAwsVPCPeeringConnectionStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeVpcPeeringConnections(&ec2.DescribeVpcPeeringConnectionsInput{ - VpcPeeringConnectionIds: []*string{aws.String(id)}, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpcPeeringConnectionID.NotFound" { - resp = nil - } else { - log.Printf("Error reading VPC Peering Connection details: %s", err) - return nil, "error", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - pc := resp.VpcPeeringConnections[0] - - // A VPC Peering Connection can exist in a failed state due to - // incorrect VPC ID, account ID, or overlapping IP address range, - // thus we short circuit before the time out would occur. - if pc != nil && *pc.Status.Code == "failed" { - return nil, "failed", errors.New(*pc.Status.Message) - } - - return pc, *pc.Status.Code, nil - } -} - -func vpcPeeringConnectionOptionsSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "allow_remote_vpc_dns_resolution": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "allow_classic_link_to_remote_vpc": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "allow_vpc_to_remote_classic_link": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - }, - } -} - -func flattenPeeringOptions(options *ec2.VpcPeeringConnectionOptionsDescription) (results []map[string]interface{}) { - m := make(map[string]interface{}) - - if options.AllowDnsResolutionFromRemoteVpc != nil { - m["allow_remote_vpc_dns_resolution"] = *options.AllowDnsResolutionFromRemoteVpc - } - - if options.AllowEgressFromLocalClassicLinkToRemoteVpc != nil { - m["allow_classic_link_to_remote_vpc"] = *options.AllowEgressFromLocalClassicLinkToRemoteVpc - } - - if options.AllowEgressFromLocalVpcToRemoteClassicLink != nil { - m["allow_vpc_to_remote_classic_link"] = *options.AllowEgressFromLocalVpcToRemoteClassicLink - } - - results = append(results, m) - return -} - -func expandPeeringOptions(m map[string]interface{}) *ec2.PeeringConnectionOptionsRequest { - r := &ec2.PeeringConnectionOptionsRequest{} - - if v, ok := m["allow_remote_vpc_dns_resolution"]; ok { - r.AllowDnsResolutionFromRemoteVpc = aws.Bool(v.(bool)) - } - - if v, ok := m["allow_classic_link_to_remote_vpc"]; ok { - r.AllowEgressFromLocalClassicLinkToRemoteVpc = aws.Bool(v.(bool)) - } - - if v, ok := m["allow_vpc_to_remote_classic_link"]; ok { - r.AllowEgressFromLocalVpcToRemoteClassicLink = aws.Bool(v.(bool)) - } - - return r -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection_accepter.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection_accepter.go deleted file mode 100644 index 8b1efff..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection_accepter.go +++ /dev/null @@ -1,76 +0,0 @@ -package aws - -import ( - "errors" - "log" - - "fmt" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpcPeeringConnectionAccepter() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVPCPeeringAccepterCreate, - Read: resourceAwsVPCPeeringRead, - Update: resourceAwsVPCPeeringUpdate, - Delete: resourceAwsVPCPeeringAccepterDelete, - - Schema: map[string]*schema.Schema{ - "vpc_peering_connection_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - Computed: false, - }, - "auto_accept": { - Type: schema.TypeBool, - Optional: true, - }, - "accept_status": { - Type: schema.TypeString, - Computed: true, - }, - "vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - "peer_vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - "peer_owner_id": { - Type: schema.TypeString, - Computed: true, - }, - "accepter": vpcPeeringConnectionOptionsSchema(), - "requester": vpcPeeringConnectionOptionsSchema(), - "tags": tagsSchema(), - }, - } -} - -func resourceAwsVPCPeeringAccepterCreate(d *schema.ResourceData, meta interface{}) error { - id := d.Get("vpc_peering_connection_id").(string) - d.SetId(id) - - if err := resourceAwsVPCPeeringRead(d, meta); err != nil { - return err - } - if d.Id() == "" { - return fmt.Errorf("VPC Peering Connection %q not found", id) - } - - // Ensure that this IS as cross-account VPC peering connection. - if d.Get("peer_owner_id").(string) == meta.(*AWSClient).accountid { - return errors.New("aws_vpc_peering_connection_accepter can only adopt into management cross-account VPC peering connections") - } - - return resourceAwsVPCPeeringUpdate(d, meta) -} - -func resourceAwsVPCPeeringAccepterDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[WARN] Will not delete VPC peering connection. Terraform will remove this resource from the state file, however resources may remain.") - d.SetId("") - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_connection.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_connection.go deleted file mode 100644 index b38d903..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_connection.go +++ /dev/null @@ -1,445 +0,0 @@ -package aws - -import ( - "bytes" - "encoding/xml" - "fmt" - "log" - "sort" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -type XmlVpnConnectionConfig struct { - Tunnels []XmlIpsecTunnel `xml:"ipsec_tunnel"` -} - -type XmlIpsecTunnel struct { - OutsideAddress string `xml:"vpn_gateway>tunnel_outside_address>ip_address"` - PreSharedKey string `xml:"ike>pre_shared_key"` -} - -type TunnelInfo struct { - Tunnel1Address string - Tunnel1PreSharedKey string - Tunnel2Address string - Tunnel2PreSharedKey string -} - -func (slice XmlVpnConnectionConfig) Len() int { - return len(slice.Tunnels) -} - -func (slice XmlVpnConnectionConfig) Less(i, j int) bool { - return slice.Tunnels[i].OutsideAddress < slice.Tunnels[j].OutsideAddress -} - -func (slice XmlVpnConnectionConfig) Swap(i, j int) { - slice.Tunnels[i], slice.Tunnels[j] = slice.Tunnels[j], slice.Tunnels[i] -} - -func resourceAwsVpnConnection() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVpnConnectionCreate, - Read: resourceAwsVpnConnectionRead, - Update: resourceAwsVpnConnectionUpdate, - Delete: resourceAwsVpnConnectionDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "vpn_gateway_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "customer_gateway_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "static_routes_only": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "tags": tagsSchema(), - - // Begin read only attributes - "customer_gateway_configuration": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - - "tunnel1_address": { - Type: schema.TypeString, - Computed: true, - }, - - "tunnel1_preshared_key": { - Type: schema.TypeString, - Computed: true, - }, - - "tunnel2_address": { - Type: schema.TypeString, - Computed: true, - }, - - "tunnel2_preshared_key": { - Type: schema.TypeString, - Computed: true, - }, - - "routes": { - Type: schema.TypeSet, - Computed: true, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "destination_cidr_block": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - - "source": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - - "state": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["destination_cidr_block"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["source"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["state"].(string))) - return hashcode.String(buf.String()) - }, - }, - - "vgw_telemetry": { - Type: schema.TypeSet, - Computed: true, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "accepted_route_count": { - Type: schema.TypeInt, - Computed: true, - Optional: true, - }, - - "last_status_change": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - - "outside_ip_address": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - - "status": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - - "status_message": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - }, - }, - Set: func(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%s-", m["outside_ip_address"].(string))) - return hashcode.String(buf.String()) - }, - }, - }, - } -} - -func resourceAwsVpnConnectionCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - connectOpts := &ec2.VpnConnectionOptionsSpecification{ - StaticRoutesOnly: aws.Bool(d.Get("static_routes_only").(bool)), - } - - createOpts := &ec2.CreateVpnConnectionInput{ - CustomerGatewayId: aws.String(d.Get("customer_gateway_id").(string)), - Options: connectOpts, - Type: aws.String(d.Get("type").(string)), - VpnGatewayId: aws.String(d.Get("vpn_gateway_id").(string)), - } - - // Create the VPN Connection - log.Printf("[DEBUG] Creating vpn connection") - resp, err := conn.CreateVpnConnection(createOpts) - if err != nil { - return fmt.Errorf("Error creating vpn connection: %s", err) - } - - // Store the ID - vpnConnection := resp.VpnConnection - d.SetId(*vpnConnection.VpnConnectionId) - log.Printf("[INFO] VPN connection ID: %s", *vpnConnection.VpnConnectionId) - - // Wait for the connection to become available. This has an obscenely - // high default timeout because AWS VPN connections are notoriously - // slow at coming up or going down. There's also no point in checking - // more frequently than every ten seconds. - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending"}, - Target: []string{"available"}, - Refresh: vpnConnectionRefreshFunc(conn, *vpnConnection.VpnConnectionId), - Timeout: 30 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - _, stateErr := stateConf.WaitForState() - if stateErr != nil { - return fmt.Errorf( - "Error waiting for VPN connection (%s) to become ready: %s", - *vpnConnection.VpnConnectionId, err) - } - - // Create tags. - if err := setTags(conn, d); err != nil { - return err - } - - // Read off the API to populate our RO fields. - return resourceAwsVpnConnectionRead(d, meta) -} - -func vpnConnectionRefreshFunc(conn *ec2.EC2, connectionId string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeVpnConnections(&ec2.DescribeVpnConnectionsInput{ - VpnConnectionIds: []*string{aws.String(connectionId)}, - }) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpnConnectionID.NotFound" { - resp = nil - } else { - log.Printf("Error on VPNConnectionRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil || len(resp.VpnConnections) == 0 { - return nil, "", nil - } - - connection := resp.VpnConnections[0] - return connection, *connection.State, nil - } -} - -func resourceAwsVpnConnectionRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeVpnConnections(&ec2.DescribeVpnConnectionsInput{ - VpnConnectionIds: []*string{aws.String(d.Id())}, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpnConnectionID.NotFound" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error finding VPN connection: %s", err) - return err - } - } - - if len(resp.VpnConnections) != 1 { - return fmt.Errorf("[ERROR] Error finding VPN connection: %s", d.Id()) - } - - vpnConnection := resp.VpnConnections[0] - - // Set attributes under the user's control. - d.Set("vpn_gateway_id", vpnConnection.VpnGatewayId) - d.Set("customer_gateway_id", vpnConnection.CustomerGatewayId) - d.Set("type", vpnConnection.Type) - d.Set("tags", tagsToMap(vpnConnection.Tags)) - - if vpnConnection.Options != nil { - if err := d.Set("static_routes_only", vpnConnection.Options.StaticRoutesOnly); err != nil { - return err - } - } else { - //If there no Options on the connection then we do not support *static_routes* - d.Set("static_routes_only", false) - } - - // Set read only attributes. - d.Set("customer_gateway_configuration", vpnConnection.CustomerGatewayConfiguration) - - if vpnConnection.CustomerGatewayConfiguration != nil { - if tunnelInfo, err := xmlConfigToTunnelInfo(*vpnConnection.CustomerGatewayConfiguration); err != nil { - log.Printf("[ERR] Error unmarshaling XML configuration for (%s): %s", d.Id(), err) - } else { - d.Set("tunnel1_address", tunnelInfo.Tunnel1Address) - d.Set("tunnel1_preshared_key", tunnelInfo.Tunnel1PreSharedKey) - d.Set("tunnel2_address", tunnelInfo.Tunnel2Address) - d.Set("tunnel2_preshared_key", tunnelInfo.Tunnel2PreSharedKey) - } - } - - if err := d.Set("vgw_telemetry", telemetryToMapList(vpnConnection.VgwTelemetry)); err != nil { - return err - } - if err := d.Set("routes", routesToMapList(vpnConnection.Routes)); err != nil { - return err - } - - return nil -} - -func resourceAwsVpnConnectionUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Update tags if required. - if err := setTags(conn, d); err != nil { - return err - } - - d.SetPartial("tags") - - return resourceAwsVpnConnectionRead(d, meta) -} - -func resourceAwsVpnConnectionDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - _, err := conn.DeleteVpnConnection(&ec2.DeleteVpnConnectionInput{ - VpnConnectionId: aws.String(d.Id()), - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpnConnectionID.NotFound" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error deleting VPN connection: %s", err) - return err - } - } - - // These things can take quite a while to tear themselves down and any - // attempt to modify resources they reference (e.g. CustomerGateways or - // VPN Gateways) before deletion will result in an error. Furthermore, - // they don't just disappear. The go into "deleted" state. We need to - // wait to ensure any other modifications the user might make to their - // VPC stack can safely run. - stateConf := &resource.StateChangeConf{ - Pending: []string{"deleting"}, - Target: []string{"deleted"}, - Refresh: vpnConnectionRefreshFunc(conn, d.Id()), - Timeout: 30 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - _, stateErr := stateConf.WaitForState() - if stateErr != nil { - return fmt.Errorf( - "Error waiting for VPN connection (%s) to delete: %s", d.Id(), err) - } - - return nil -} - -// routesToMapList turns the list of routes into a list of maps. -func routesToMapList(routes []*ec2.VpnStaticRoute) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(routes)) - for _, r := range routes { - staticRoute := make(map[string]interface{}) - staticRoute["destination_cidr_block"] = *r.DestinationCidrBlock - staticRoute["state"] = *r.State - - if r.Source != nil { - staticRoute["source"] = *r.Source - } - - result = append(result, staticRoute) - } - - return result -} - -// telemetryToMapList turns the VGW telemetry into a list of maps. -func telemetryToMapList(telemetry []*ec2.VgwTelemetry) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(telemetry)) - for _, t := range telemetry { - vgw := make(map[string]interface{}) - vgw["accepted_route_count"] = *t.AcceptedRouteCount - vgw["outside_ip_address"] = *t.OutsideIpAddress - vgw["status"] = *t.Status - vgw["status_message"] = *t.StatusMessage - - // LastStatusChange is a time.Time(). Convert it into a string - // so it can be handled by schema's type system. - vgw["last_status_change"] = t.LastStatusChange.String() - result = append(result, vgw) - } - - return result -} - -func xmlConfigToTunnelInfo(xmlConfig string) (*TunnelInfo, error) { - var vpnConfig XmlVpnConnectionConfig - if err := xml.Unmarshal([]byte(xmlConfig), &vpnConfig); err != nil { - return nil, errwrap.Wrapf("Error Unmarshalling XML: {{err}}", err) - } - - // don't expect consistent ordering from the XML - sort.Sort(vpnConfig) - - tunnelInfo := TunnelInfo{ - Tunnel1Address: vpnConfig.Tunnels[0].OutsideAddress, - Tunnel1PreSharedKey: vpnConfig.Tunnels[0].PreSharedKey, - - Tunnel2Address: vpnConfig.Tunnels[1].OutsideAddress, - Tunnel2PreSharedKey: vpnConfig.Tunnels[1].PreSharedKey, - } - - return &tunnelInfo, nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_gateway.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_gateway.go deleted file mode 100644 index 89c7bea..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_gateway.go +++ /dev/null @@ -1,326 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpnGateway() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVpnGatewayCreate, - Read: resourceAwsVpnGatewayRead, - Update: resourceAwsVpnGatewayUpdate, - Delete: resourceAwsVpnGatewayDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "availability_zone": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "tags": tagsSchema(), - }, - } -} - -func resourceAwsVpnGatewayCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - createOpts := &ec2.CreateVpnGatewayInput{ - AvailabilityZone: aws.String(d.Get("availability_zone").(string)), - Type: aws.String("ipsec.1"), - } - - // Create the VPN gateway - log.Printf("[DEBUG] Creating VPN gateway") - resp, err := conn.CreateVpnGateway(createOpts) - if err != nil { - return fmt.Errorf("Error creating VPN gateway: %s", err) - } - - // Get the ID and store it - vpnGateway := resp.VpnGateway - d.SetId(*vpnGateway.VpnGatewayId) - log.Printf("[INFO] VPN Gateway ID: %s", *vpnGateway.VpnGatewayId) - - // Attach the VPN gateway to the correct VPC - return resourceAwsVpnGatewayUpdate(d, meta) -} - -func resourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - resp, err := conn.DescribeVpnGateways(&ec2.DescribeVpnGatewaysInput{ - VpnGatewayIds: []*string{aws.String(d.Id())}, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpnGatewayID.NotFound" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error finding VpnGateway: %s", err) - return err - } - } - - vpnGateway := resp.VpnGateways[0] - if vpnGateway == nil || *vpnGateway.State == "deleted" { - // Seems we have lost our VPN gateway - d.SetId("") - return nil - } - - vpnAttachment := vpnGatewayGetAttachment(vpnGateway) - if len(vpnGateway.VpcAttachments) == 0 || *vpnAttachment.State == "detached" { - // Gateway exists but not attached to the VPC - d.Set("vpc_id", "") - } else { - d.Set("vpc_id", *vpnAttachment.VpcId) - } - - if vpnGateway.AvailabilityZone != nil && *vpnGateway.AvailabilityZone != "" { - d.Set("availability_zone", vpnGateway.AvailabilityZone) - } - d.Set("tags", tagsToMap(vpnGateway.Tags)) - - return nil -} - -func resourceAwsVpnGatewayUpdate(d *schema.ResourceData, meta interface{}) error { - if d.HasChange("vpc_id") { - // If we're already attached, detach it first - if err := resourceAwsVpnGatewayDetach(d, meta); err != nil { - return err - } - - // Attach the VPN gateway to the new vpc - if err := resourceAwsVpnGatewayAttach(d, meta); err != nil { - return err - } - } - - conn := meta.(*AWSClient).ec2conn - - if err := setTags(conn, d); err != nil { - return err - } - - d.SetPartial("tags") - - return resourceAwsVpnGatewayRead(d, meta) -} - -func resourceAwsVpnGatewayDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Detach if it is attached - if err := resourceAwsVpnGatewayDetach(d, meta); err != nil { - return err - } - - log.Printf("[INFO] Deleting VPN gateway: %s", d.Id()) - - return resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteVpnGateway(&ec2.DeleteVpnGatewayInput{ - VpnGatewayId: aws.String(d.Id()), - }) - if err == nil { - return nil - } - - ec2err, ok := err.(awserr.Error) - if !ok { - return resource.RetryableError(err) - } - - switch ec2err.Code() { - case "InvalidVpnGatewayID.NotFound": - return nil - case "IncorrectState": - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - }) -} - -func resourceAwsVpnGatewayAttach(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - if d.Get("vpc_id").(string) == "" { - log.Printf( - "[DEBUG] Not attaching VPN Gateway '%s' as no VPC ID is set", - d.Id()) - return nil - } - - log.Printf( - "[INFO] Attaching VPN Gateway '%s' to VPC '%s'", - d.Id(), - d.Get("vpc_id").(string)) - - req := &ec2.AttachVpnGatewayInput{ - VpnGatewayId: aws.String(d.Id()), - VpcId: aws.String(d.Get("vpc_id").(string)), - } - - err := resource.Retry(30*time.Second, func() *resource.RetryError { - _, err := conn.AttachVpnGateway(req) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok { - if "InvalidVpnGatewayID.NotFound" == ec2err.Code() { - return resource.RetryableError( - fmt.Errorf("Gateway not found, retry for eventual consistancy")) - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if err != nil { - return err - } - - // Wait for it to be fully attached before continuing - log.Printf("[DEBUG] Waiting for VPN gateway (%s) to attach", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"detached", "attaching"}, - Target: []string{"attached"}, - Refresh: vpnGatewayAttachStateRefreshFunc(conn, d.Id(), "available"), - Timeout: 1 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for VPN gateway (%s) to attach: %s", - d.Id(), err) - } - - return nil -} - -func resourceAwsVpnGatewayDetach(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - // Get the old VPC ID to detach from - vpcID, _ := d.GetChange("vpc_id") - - if vpcID.(string) == "" { - log.Printf( - "[DEBUG] Not detaching VPN Gateway '%s' as no VPC ID is set", - d.Id()) - return nil - } - - log.Printf( - "[INFO] Detaching VPN Gateway '%s' from VPC '%s'", - d.Id(), - vpcID.(string)) - - wait := true - _, err := conn.DetachVpnGateway(&ec2.DetachVpnGatewayInput{ - VpnGatewayId: aws.String(d.Id()), - VpcId: aws.String(vpcID.(string)), - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok { - if ec2err.Code() == "InvalidVpnGatewayID.NotFound" { - err = nil - wait = false - } else if ec2err.Code() == "InvalidVpnGatewayAttachment.NotFound" { - err = nil - wait = false - } - } - - if err != nil { - return err - } - } - - if !wait { - return nil - } - - // Wait for it to be fully detached before continuing - log.Printf("[DEBUG] Waiting for VPN gateway (%s) to detach", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{"attached", "detaching", "available"}, - Target: []string{"detached"}, - Refresh: vpnGatewayAttachStateRefreshFunc(conn, d.Id(), "detached"), - Timeout: 1 * time.Minute, - } - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf( - "Error waiting for vpn gateway (%s) to detach: %s", - d.Id(), err) - } - - return nil -} - -// vpnGatewayAttachStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch -// the state of a VPN gateway's attachment -func vpnGatewayAttachStateRefreshFunc(conn *ec2.EC2, id string, expected string) resource.StateRefreshFunc { - var start time.Time - return func() (interface{}, string, error) { - if start.IsZero() { - start = time.Now() - } - - resp, err := conn.DescribeVpnGateways(&ec2.DescribeVpnGatewaysInput{ - VpnGatewayIds: []*string{aws.String(id)}, - }) - - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpnGatewayID.NotFound" { - resp = nil - } else { - log.Printf("[ERROR] Error on VpnGatewayStateRefresh: %s", err) - return nil, "", err - } - } - - if resp == nil { - // Sometimes AWS just has consistency issues and doesn't see - // our instance yet. Return an empty state. - return nil, "", nil - } - - vpnGateway := resp.VpnGateways[0] - if len(vpnGateway.VpcAttachments) == 0 { - // No attachments, we're detached - return vpnGateway, "detached", nil - } - - vpnAttachment := vpnGatewayGetAttachment(vpnGateway) - return vpnGateway, *vpnAttachment.State, nil - } -} - -func vpnGatewayGetAttachment(vgw *ec2.VpnGateway) *ec2.VpcAttachment { - for _, v := range vgw.VpcAttachments { - if *v.State == "attached" { - return v - } - } - return &ec2.VpcAttachment{State: aws.String("detached")} -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_gateway_attachment.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_gateway_attachment.go deleted file mode 100644 index db01100..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpn_gateway_attachment.go +++ /dev/null @@ -1,210 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpnGatewayAttachment() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsVpnGatewayAttachmentCreate, - Read: resourceAwsVpnGatewayAttachmentRead, - Delete: resourceAwsVpnGatewayAttachmentDelete, - - Schema: map[string]*schema.Schema{ - "vpc_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "vpn_gateway_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsVpnGatewayAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - vpcId := d.Get("vpc_id").(string) - vgwId := d.Get("vpn_gateway_id").(string) - - createOpts := &ec2.AttachVpnGatewayInput{ - VpcId: aws.String(vpcId), - VpnGatewayId: aws.String(vgwId), - } - log.Printf("[DEBUG] VPN Gateway attachment options: %#v", *createOpts) - - _, err := conn.AttachVpnGateway(createOpts) - if err != nil { - return fmt.Errorf("Error attaching VPN Gateway %q to VPC %q: %s", - vgwId, vpcId, err) - } - - d.SetId(vpnGatewayAttachmentId(vpcId, vgwId)) - log.Printf("[INFO] VPN Gateway %q attachment ID: %s", vgwId, d.Id()) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"detached", "attaching"}, - Target: []string{"attached"}, - Refresh: vpnGatewayAttachmentStateRefresh(conn, vpcId, vgwId), - Timeout: 15 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 5 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for VPN Gateway %q to attach to VPC %q: %s", - vgwId, vpcId, err) - } - log.Printf("[DEBUG] VPN Gateway %q attached to VPC %q.", vgwId, vpcId) - - return resourceAwsVpnGatewayAttachmentRead(d, meta) -} - -func resourceAwsVpnGatewayAttachmentRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - vgwId := d.Get("vpn_gateway_id").(string) - - resp, err := conn.DescribeVpnGateways(&ec2.DescribeVpnGatewaysInput{ - VpnGatewayIds: []*string{aws.String(vgwId)}, - }) - - if err != nil { - awsErr, ok := err.(awserr.Error) - if ok && awsErr.Code() == "InvalidVPNGatewayID.NotFound" { - log.Printf("[WARN] VPN Gateway %q not found.", vgwId) - d.SetId("") - return nil - } - return err - } - - vgw := resp.VpnGateways[0] - if *vgw.State == "deleted" { - log.Printf("[INFO] VPN Gateway %q appears to have been deleted.", vgwId) - d.SetId("") - return nil - } - - vga := vpnGatewayGetAttachment(vgw) - if len(vgw.VpcAttachments) == 0 || *vga.State == "detached" { - d.Set("vpc_id", "") - return nil - } - - d.Set("vpc_id", *vga.VpcId) - return nil -} - -func resourceAwsVpnGatewayAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - vpcId := d.Get("vpc_id").(string) - vgwId := d.Get("vpn_gateway_id").(string) - - if vpcId == "" { - log.Printf("[DEBUG] Not detaching VPN Gateway %q as no VPC ID is set.", vgwId) - return nil - } - - _, err := conn.DetachVpnGateway(&ec2.DetachVpnGatewayInput{ - VpcId: aws.String(vpcId), - VpnGatewayId: aws.String(vgwId), - }) - - if err != nil { - awsErr, ok := err.(awserr.Error) - if ok { - switch awsErr.Code() { - case "InvalidVPNGatewayID.NotFound": - log.Printf("[WARN] VPN Gateway %q not found.", vgwId) - d.SetId("") - return nil - case "InvalidVpnGatewayAttachment.NotFound": - log.Printf( - "[WARN] VPN Gateway %q attachment to VPC %q not found.", - vgwId, vpcId) - d.SetId("") - return nil - } - } - - return fmt.Errorf("Error detaching VPN Gateway %q from VPC %q: %s", - vgwId, vpcId, err) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"attached", "detaching"}, - Target: []string{"detached"}, - Refresh: vpnGatewayAttachmentStateRefresh(conn, vpcId, vgwId), - Timeout: 15 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 5 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for VPN Gateway %q to detach from VPC %q: %s", - vgwId, vpcId, err) - } - log.Printf("[DEBUG] VPN Gateway %q detached from VPC %q.", vgwId, vpcId) - - d.SetId("") - return nil -} - -func vpnGatewayAttachmentStateRefresh(conn *ec2.EC2, vpcId, vgwId string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeVpnGateways(&ec2.DescribeVpnGatewaysInput{ - Filters: []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("attachment.vpc-id"), - Values: []*string{aws.String(vpcId)}, - }, - }, - VpnGatewayIds: []*string{aws.String(vgwId)}, - }) - - if err != nil { - awsErr, ok := err.(awserr.Error) - if ok { - switch awsErr.Code() { - case "InvalidVPNGatewayID.NotFound": - fallthrough - case "InvalidVpnGatewayAttachment.NotFound": - return nil, "", nil - } - } - - return nil, "", err - } - - vgw := resp.VpnGateways[0] - if len(vgw.VpcAttachments) == 0 { - return vgw, "detached", nil - } - - vga := vpnGatewayGetAttachment(vgw) - - log.Printf("[DEBUG] VPN Gateway %q attachment status: %s", vgwId, *vga.State) - return vgw, *vga.State, nil - } -} - -func vpnGatewayAttachmentId(vpcId, vgwId string) string { - return fmt.Sprintf("vpn-attachment-%x", hashcode.String(fmt.Sprintf("%s-%s", vpcId, vgwId))) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_byte_match_set.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_byte_match_set.go deleted file mode 100644 index b3a02b7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_byte_match_set.go +++ /dev/null @@ -1,205 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsWafByteMatchSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsWafByteMatchSetCreate, - Read: resourceAwsWafByteMatchSetRead, - Update: resourceAwsWafByteMatchSetUpdate, - Delete: resourceAwsWafByteMatchSetDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "byte_match_tuples": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "field_to_match": { - Type: schema.TypeSet, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "data": { - Type: schema.TypeString, - Optional: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "positional_constraint": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "target_string": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "text_transformation": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsWafByteMatchSetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - log.Printf("[INFO] Creating ByteMatchSet: %s", d.Get("name").(string)) - - // ChangeToken - var ct *waf.GetChangeTokenInput - - res, err := conn.GetChangeToken(ct) - if err != nil { - return errwrap.Wrapf("[ERROR] Error getting change token: {{err}}", err) - } - - params := &waf.CreateByteMatchSetInput{ - ChangeToken: res.ChangeToken, - Name: aws.String(d.Get("name").(string)), - } - - resp, err := conn.CreateByteMatchSet(params) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error creating ByteMatchSet: {{err}}", err) - } - - d.SetId(*resp.ByteMatchSet.ByteMatchSetId) - - return resourceAwsWafByteMatchSetUpdate(d, meta) -} - -func resourceAwsWafByteMatchSetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - log.Printf("[INFO] Reading ByteMatchSet: %s", d.Get("name").(string)) - params := &waf.GetByteMatchSetInput{ - ByteMatchSetId: aws.String(d.Id()), - } - - resp, err := conn.GetByteMatchSet(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { - log.Printf("[WARN] WAF IPSet (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - d.Set("name", resp.ByteMatchSet.Name) - - return nil -} - -func resourceAwsWafByteMatchSetUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating ByteMatchSet: %s", d.Get("name").(string)) - err := updateByteMatchSetResource(d, meta, waf.ChangeActionInsert) - if err != nil { - return errwrap.Wrapf("[ERROR] Error updating ByteMatchSet: {{err}}", err) - } - return resourceAwsWafByteMatchSetRead(d, meta) -} - -func resourceAwsWafByteMatchSetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - log.Printf("[INFO] Deleting ByteMatchSet: %s", d.Get("name").(string)) - err := updateByteMatchSetResource(d, meta, waf.ChangeActionDelete) - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting ByteMatchSet: {{err}}", err) - } - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - - req := &waf.DeleteByteMatchSetInput{ - ChangeToken: resp.ChangeToken, - ByteMatchSetId: aws.String(d.Id()), - } - - _, err = conn.DeleteByteMatchSet(req) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting ByteMatchSet: {{err}}", err) - } - - return nil -} - -func updateByteMatchSetResource(d *schema.ResourceData, meta interface{}, ChangeAction string) error { - conn := meta.(*AWSClient).wafconn - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - if err != nil { - return errwrap.Wrapf("[ERROR] Error getting change token: {{err}}", err) - } - - req := &waf.UpdateByteMatchSetInput{ - ChangeToken: resp.ChangeToken, - ByteMatchSetId: aws.String(d.Id()), - } - - ByteMatchTuples := d.Get("byte_match_tuples").(*schema.Set) - for _, ByteMatchTuple := range ByteMatchTuples.List() { - ByteMatch := ByteMatchTuple.(map[string]interface{}) - ByteMatchUpdate := &waf.ByteMatchSetUpdate{ - Action: aws.String(ChangeAction), - ByteMatchTuple: &waf.ByteMatchTuple{ - FieldToMatch: expandFieldToMatch(ByteMatch["field_to_match"].(*schema.Set).List()[0].(map[string]interface{})), - PositionalConstraint: aws.String(ByteMatch["positional_constraint"].(string)), - TargetString: []byte(ByteMatch["target_string"].(string)), - TextTransformation: aws.String(ByteMatch["text_transformation"].(string)), - }, - } - req.Updates = append(req.Updates, ByteMatchUpdate) - } - - _, err = conn.UpdateByteMatchSet(req) - if err != nil { - return errwrap.Wrapf("[ERROR] Error updating ByteMatchSet: {{err}}", err) - } - - return nil -} - -func expandFieldToMatch(d map[string]interface{}) *waf.FieldToMatch { - return &waf.FieldToMatch{ - Type: aws.String(d["type"].(string)), - Data: aws.String(d["data"].(string)), - } -} - -func flattenFieldToMatch(fm *waf.FieldToMatch) map[string]interface{} { - m := make(map[string]interface{}) - m["data"] = *fm.Data - m["type"] = *fm.Type - return m -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_ipset.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_ipset.go deleted file mode 100644 index 4b07f64..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_ipset.go +++ /dev/null @@ -1,174 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsWafIPSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsWafIPSetCreate, - Read: resourceAwsWafIPSetRead, - Update: resourceAwsWafIPSetUpdate, - Delete: resourceAwsWafIPSetDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "ip_set_descriptors": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsWafIPSetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - // ChangeToken - var ct *waf.GetChangeTokenInput - - res, err := conn.GetChangeToken(ct) - if err != nil { - return fmt.Errorf("Error getting change token: %s", err) - } - - params := &waf.CreateIPSetInput{ - ChangeToken: res.ChangeToken, - Name: aws.String(d.Get("name").(string)), - } - - resp, err := conn.CreateIPSet(params) - if err != nil { - return err - } - d.SetId(*resp.IPSet.IPSetId) - return resourceAwsWafIPSetUpdate(d, meta) -} - -func resourceAwsWafIPSetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - params := &waf.GetIPSetInput{ - IPSetId: aws.String(d.Id()), - } - - resp, err := conn.GetIPSet(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { - log.Printf("[WARN] WAF IPSet (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - var IPSetDescriptors []map[string]interface{} - - for _, IPSetDescriptor := range resp.IPSet.IPSetDescriptors { - IPSet := map[string]interface{}{ - "type": *IPSetDescriptor.Type, - "value": *IPSetDescriptor.Value, - } - IPSetDescriptors = append(IPSetDescriptors, IPSet) - } - - d.Set("ip_set_descriptors", IPSetDescriptors) - - d.Set("name", resp.IPSet.Name) - - return nil -} - -func resourceAwsWafIPSetUpdate(d *schema.ResourceData, meta interface{}) error { - err := updateIPSetResource(d, meta, waf.ChangeActionInsert) - if err != nil { - return fmt.Errorf("Error Updating WAF IPSet: %s", err) - } - return resourceAwsWafIPSetRead(d, meta) -} - -func resourceAwsWafIPSetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - err := updateIPSetResource(d, meta, waf.ChangeActionDelete) - if err != nil { - return fmt.Errorf("Error Removing IPSetDescriptors: %s", err) - } - - // ChangeToken - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - - req := &waf.DeleteIPSetInput{ - ChangeToken: resp.ChangeToken, - IPSetId: aws.String(d.Id()), - } - log.Printf("[INFO] Deleting WAF IPSet") - _, err = conn.DeleteIPSet(req) - - if err != nil { - return fmt.Errorf("Error Deleting WAF IPSet: %s", err) - } - - return nil -} - -func updateIPSetResource(d *schema.ResourceData, meta interface{}, ChangeAction string) error { - conn := meta.(*AWSClient).wafconn - - // ChangeToken - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - if err != nil { - return fmt.Errorf("Error getting change token: %s", err) - } - - req := &waf.UpdateIPSetInput{ - ChangeToken: resp.ChangeToken, - IPSetId: aws.String(d.Id()), - } - - IPSetDescriptors := d.Get("ip_set_descriptors").(*schema.Set) - for _, IPSetDescriptor := range IPSetDescriptors.List() { - IPSet := IPSetDescriptor.(map[string]interface{}) - IPSetUpdate := &waf.IPSetUpdate{ - Action: aws.String(ChangeAction), - IPSetDescriptor: &waf.IPSetDescriptor{ - Type: aws.String(IPSet["type"].(string)), - Value: aws.String(IPSet["value"].(string)), - }, - } - req.Updates = append(req.Updates, IPSetUpdate) - } - - _, err = conn.UpdateIPSet(req) - if err != nil { - return fmt.Errorf("Error Updating WAF IPSet: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_rule.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_rule.go deleted file mode 100644 index ba59bf2..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_rule.go +++ /dev/null @@ -1,201 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsWafRule() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsWafRuleCreate, - Read: resourceAwsWafRuleRead, - Update: resourceAwsWafRuleUpdate, - Delete: resourceAwsWafRuleDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "metric_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "predicates": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "negated": &schema.Schema{ - Type: schema.TypeBool, - Required: true, - }, - "data_id": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 128 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 128 characters", k)) - } - return - }, - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "IPMatch" && value != "ByteMatch" && value != "SqlInjectionMatch" && value != "SizeConstraint" && value != "XssMatch" { - errors = append(errors, fmt.Errorf( - "%q must be one of IPMatch | ByteMatch | SqlInjectionMatch | SizeConstraint | XssMatch", k)) - } - return - }, - }, - }, - }, - }, - }, - } -} - -func resourceAwsWafRuleCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - // ChangeToken - var ct *waf.GetChangeTokenInput - - res, err := conn.GetChangeToken(ct) - if err != nil { - return fmt.Errorf("Error getting change token: %s", err) - } - - params := &waf.CreateRuleInput{ - ChangeToken: res.ChangeToken, - MetricName: aws.String(d.Get("metric_name").(string)), - Name: aws.String(d.Get("name").(string)), - } - - resp, err := conn.CreateRule(params) - if err != nil { - return err - } - d.SetId(*resp.Rule.RuleId) - return resourceAwsWafRuleUpdate(d, meta) -} - -func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - params := &waf.GetRuleInput{ - RuleId: aws.String(d.Id()), - } - - resp, err := conn.GetRule(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { - log.Printf("[WARN] WAF Rule (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - var predicates []map[string]interface{} - - for _, predicateSet := range resp.Rule.Predicates { - predicate := map[string]interface{}{ - "negated": *predicateSet.Negated, - "type": *predicateSet.Type, - "data_id": *predicateSet.DataId, - } - predicates = append(predicates, predicate) - } - - d.Set("predicates", predicates) - d.Set("name", resp.Rule.Name) - d.Set("metric_name", resp.Rule.MetricName) - - return nil -} - -func resourceAwsWafRuleUpdate(d *schema.ResourceData, meta interface{}) error { - err := updateWafRuleResource(d, meta, waf.ChangeActionInsert) - if err != nil { - return fmt.Errorf("Error Updating WAF Rule: %s", err) - } - return resourceAwsWafRuleRead(d, meta) -} - -func resourceAwsWafRuleDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - err := updateWafRuleResource(d, meta, waf.ChangeActionDelete) - if err != nil { - return fmt.Errorf("Error Removing WAF Rule Predicates: %s", err) - } - // ChangeToken - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - - req := &waf.DeleteRuleInput{ - ChangeToken: resp.ChangeToken, - RuleId: aws.String(d.Id()), - } - log.Printf("[INFO] Deleting WAF Rule") - _, err = conn.DeleteRule(req) - - if err != nil { - return fmt.Errorf("Error deleting WAF Rule: %s", err) - } - - return nil -} - -func updateWafRuleResource(d *schema.ResourceData, meta interface{}, ChangeAction string) error { - conn := meta.(*AWSClient).wafconn - - // ChangeToken - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - if err != nil { - return fmt.Errorf("Error getting change token: %s", err) - } - - req := &waf.UpdateRuleInput{ - ChangeToken: resp.ChangeToken, - RuleId: aws.String(d.Id()), - } - - predicatesSet := d.Get("predicates").(*schema.Set) - for _, predicateI := range predicatesSet.List() { - predicate := predicateI.(map[string]interface{}) - updatePredicate := &waf.RuleUpdate{ - Action: aws.String(ChangeAction), - Predicate: &waf.Predicate{ - Negated: aws.Bool(predicate["negated"].(bool)), - Type: aws.String(predicate["type"].(string)), - DataId: aws.String(predicate["data_id"].(string)), - }, - } - req.Updates = append(req.Updates, updatePredicate) - } - - _, err = conn.UpdateRule(req) - if err != nil { - return fmt.Errorf("Error Updating WAF Rule: %s", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_size_constraint_set.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_size_constraint_set.go deleted file mode 100644 index 9f384e8..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_size_constraint_set.go +++ /dev/null @@ -1,191 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsWafSizeConstraintSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsWafSizeConstraintSetCreate, - Read: resourceAwsWafSizeConstraintSetRead, - Update: resourceAwsWafSizeConstraintSetUpdate, - Delete: resourceAwsWafSizeConstraintSetDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "size_constraints": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "field_to_match": { - Type: schema.TypeSet, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "data": { - Type: schema.TypeString, - Optional: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "comparison_operator": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "size": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "text_transformation": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsWafSizeConstraintSetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - log.Printf("[INFO] Creating SizeConstraintSet: %s", d.Get("name").(string)) - - // ChangeToken - var ct *waf.GetChangeTokenInput - - res, err := conn.GetChangeToken(ct) - if err != nil { - return errwrap.Wrapf("[ERROR] Error getting change token: {{err}}", err) - } - - params := &waf.CreateSizeConstraintSetInput{ - ChangeToken: res.ChangeToken, - Name: aws.String(d.Get("name").(string)), - } - - resp, err := conn.CreateSizeConstraintSet(params) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error creating SizeConstraintSet: {{err}}", err) - } - - d.SetId(*resp.SizeConstraintSet.SizeConstraintSetId) - - return resourceAwsWafSizeConstraintSetUpdate(d, meta) -} - -func resourceAwsWafSizeConstraintSetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - log.Printf("[INFO] Reading SizeConstraintSet: %s", d.Get("name").(string)) - params := &waf.GetSizeConstraintSetInput{ - SizeConstraintSetId: aws.String(d.Id()), - } - - resp, err := conn.GetSizeConstraintSet(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { - log.Printf("[WARN] WAF IPSet (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - d.Set("name", resp.SizeConstraintSet.Name) - - return nil -} - -func resourceAwsWafSizeConstraintSetUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating SizeConstraintSet: %s", d.Get("name").(string)) - err := updateSizeConstraintSetResource(d, meta, waf.ChangeActionInsert) - if err != nil { - return errwrap.Wrapf("[ERROR] Error updating SizeConstraintSet: {{err}}", err) - } - return resourceAwsWafSizeConstraintSetRead(d, meta) -} - -func resourceAwsWafSizeConstraintSetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - log.Printf("[INFO] Deleting SizeConstraintSet: %s", d.Get("name").(string)) - err := updateSizeConstraintSetResource(d, meta, waf.ChangeActionDelete) - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting SizeConstraintSet: {{err}}", err) - } - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - - req := &waf.DeleteSizeConstraintSetInput{ - ChangeToken: resp.ChangeToken, - SizeConstraintSetId: aws.String(d.Id()), - } - - _, err = conn.DeleteSizeConstraintSet(req) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting SizeConstraintSet: {{err}}", err) - } - - return nil -} - -func updateSizeConstraintSetResource(d *schema.ResourceData, meta interface{}, ChangeAction string) error { - conn := meta.(*AWSClient).wafconn - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - if err != nil { - return errwrap.Wrapf("[ERROR] Error getting change token: {{err}}", err) - } - - req := &waf.UpdateSizeConstraintSetInput{ - ChangeToken: resp.ChangeToken, - SizeConstraintSetId: aws.String(d.Id()), - } - - sizeConstraints := d.Get("size_constraints").(*schema.Set) - for _, sizeConstraint := range sizeConstraints.List() { - sc := sizeConstraint.(map[string]interface{}) - sizeConstraintUpdate := &waf.SizeConstraintSetUpdate{ - Action: aws.String(ChangeAction), - SizeConstraint: &waf.SizeConstraint{ - FieldToMatch: expandFieldToMatch(sc["field_to_match"].(*schema.Set).List()[0].(map[string]interface{})), - ComparisonOperator: aws.String(sc["comparison_operator"].(string)), - Size: aws.Int64(int64(sc["size"].(int))), - TextTransformation: aws.String(sc["text_transformation"].(string)), - }, - } - req.Updates = append(req.Updates, sizeConstraintUpdate) - } - - _, err = conn.UpdateSizeConstraintSet(req) - if err != nil { - return errwrap.Wrapf("[ERROR] Error updating SizeConstraintSet: {{err}}", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_sql_injection_match_set.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_sql_injection_match_set.go deleted file mode 100644 index 01efd6a..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_sql_injection_match_set.go +++ /dev/null @@ -1,181 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsWafSqlInjectionMatchSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsWafSqlInjectionMatchSetCreate, - Read: resourceAwsWafSqlInjectionMatchSetRead, - Update: resourceAwsWafSqlInjectionMatchSetUpdate, - Delete: resourceAwsWafSqlInjectionMatchSetDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "sql_injection_match_tuples": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "field_to_match": { - Type: schema.TypeSet, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "data": { - Type: schema.TypeString, - Optional: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "text_transformation": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsWafSqlInjectionMatchSetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - log.Printf("[INFO] Creating SqlInjectionMatchSet: %s", d.Get("name").(string)) - - // ChangeToken - var ct *waf.GetChangeTokenInput - - res, err := conn.GetChangeToken(ct) - if err != nil { - return errwrap.Wrapf("[ERROR] Error getting change token: {{err}}", err) - } - - params := &waf.CreateSqlInjectionMatchSetInput{ - ChangeToken: res.ChangeToken, - Name: aws.String(d.Get("name").(string)), - } - - resp, err := conn.CreateSqlInjectionMatchSet(params) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error creating SqlInjectionMatchSet: {{err}}", err) - } - - d.SetId(*resp.SqlInjectionMatchSet.SqlInjectionMatchSetId) - - return resourceAwsWafSqlInjectionMatchSetUpdate(d, meta) -} - -func resourceAwsWafSqlInjectionMatchSetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - log.Printf("[INFO] Reading SqlInjectionMatchSet: %s", d.Get("name").(string)) - params := &waf.GetSqlInjectionMatchSetInput{ - SqlInjectionMatchSetId: aws.String(d.Id()), - } - - resp, err := conn.GetSqlInjectionMatchSet(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { - log.Printf("[WARN] WAF IPSet (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - d.Set("name", resp.SqlInjectionMatchSet.Name) - - return nil -} - -func resourceAwsWafSqlInjectionMatchSetUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating SqlInjectionMatchSet: %s", d.Get("name").(string)) - err := updateSqlInjectionMatchSetResource(d, meta, waf.ChangeActionInsert) - if err != nil { - return errwrap.Wrapf("[ERROR] Error updating SqlInjectionMatchSet: {{err}}", err) - } - return resourceAwsWafSqlInjectionMatchSetRead(d, meta) -} - -func resourceAwsWafSqlInjectionMatchSetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - log.Printf("[INFO] Deleting SqlInjectionMatchSet: %s", d.Get("name").(string)) - err := updateSqlInjectionMatchSetResource(d, meta, waf.ChangeActionDelete) - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting SqlInjectionMatchSet: {{err}}", err) - } - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - - req := &waf.DeleteSqlInjectionMatchSetInput{ - ChangeToken: resp.ChangeToken, - SqlInjectionMatchSetId: aws.String(d.Id()), - } - - _, err = conn.DeleteSqlInjectionMatchSet(req) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting SqlInjectionMatchSet: {{err}}", err) - } - - return nil -} - -func updateSqlInjectionMatchSetResource(d *schema.ResourceData, meta interface{}, ChangeAction string) error { - conn := meta.(*AWSClient).wafconn - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - if err != nil { - return errwrap.Wrapf("[ERROR] Error getting change token: {{err}}", err) - } - - req := &waf.UpdateSqlInjectionMatchSetInput{ - ChangeToken: resp.ChangeToken, - SqlInjectionMatchSetId: aws.String(d.Id()), - } - - sqlInjectionMatchTuples := d.Get("sql_injection_match_tuples").(*schema.Set) - for _, sqlInjectionMatchTuple := range sqlInjectionMatchTuples.List() { - simt := sqlInjectionMatchTuple.(map[string]interface{}) - sizeConstraintUpdate := &waf.SqlInjectionMatchSetUpdate{ - Action: aws.String(ChangeAction), - SqlInjectionMatchTuple: &waf.SqlInjectionMatchTuple{ - FieldToMatch: expandFieldToMatch(simt["field_to_match"].(*schema.Set).List()[0].(map[string]interface{})), - TextTransformation: aws.String(simt["text_transformation"].(string)), - }, - } - req.Updates = append(req.Updates, sizeConstraintUpdate) - } - - _, err = conn.UpdateSqlInjectionMatchSet(req) - if err != nil { - return errwrap.Wrapf("[ERROR] Error updating SqlInjectionMatchSet: {{err}}", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_web_acl.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_web_acl.go deleted file mode 100644 index dd3a9d1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_web_acl.go +++ /dev/null @@ -1,237 +0,0 @@ -package aws - -import ( - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsWafWebAcl() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsWafWebAclCreate, - Read: resourceAwsWafWebAclRead, - Update: resourceAwsWafWebAclUpdate, - Delete: resourceAwsWafWebAclDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "default_action": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "metric_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "rules": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "action": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "priority": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - }, - "rule_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - // ChangeToken - var ct *waf.GetChangeTokenInput - - res, err := conn.GetChangeToken(ct) - if err != nil { - return fmt.Errorf("Error getting change token: %s", err) - } - - params := &waf.CreateWebACLInput{ - ChangeToken: res.ChangeToken, - DefaultAction: expandDefaultAction(d), - MetricName: aws.String(d.Get("metric_name").(string)), - Name: aws.String(d.Get("name").(string)), - } - - resp, err := conn.CreateWebACL(params) - if err != nil { - return err - } - d.SetId(*resp.WebACL.WebACLId) - return resourceAwsWafWebAclUpdate(d, meta) -} - -func resourceAwsWafWebAclRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - params := &waf.GetWebACLInput{ - WebACLId: aws.String(d.Id()), - } - - resp, err := conn.GetWebACL(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { - log.Printf("[WARN] WAF ACL (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - defaultAction := flattenDefaultAction(resp.WebACL.DefaultAction) - if defaultAction != nil { - if err := d.Set("default_action", defaultAction); err != nil { - return fmt.Errorf("error setting default_action: %s", err) - } - } - d.Set("name", resp.WebACL.Name) - d.Set("metric_name", resp.WebACL.MetricName) - - return nil -} - -func resourceAwsWafWebAclUpdate(d *schema.ResourceData, meta interface{}) error { - err := updateWebAclResource(d, meta, waf.ChangeActionInsert) - if err != nil { - return fmt.Errorf("Error Updating WAF ACL: %s", err) - } - return resourceAwsWafWebAclRead(d, meta) -} - -func resourceAwsWafWebAclDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - err := updateWebAclResource(d, meta, waf.ChangeActionDelete) - if err != nil { - return fmt.Errorf("Error Removing WAF ACL Rules: %s", err) - } - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - - req := &waf.DeleteWebACLInput{ - ChangeToken: resp.ChangeToken, - WebACLId: aws.String(d.Id()), - } - - log.Printf("[INFO] Deleting WAF ACL") - _, err = conn.DeleteWebACL(req) - - if err != nil { - return fmt.Errorf("Error Deleting WAF ACL: %s", err) - } - return nil -} - -func updateWebAclResource(d *schema.ResourceData, meta interface{}, ChangeAction string) error { - conn := meta.(*AWSClient).wafconn - // ChangeToken - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - if err != nil { - return fmt.Errorf("Error getting change token: %s", err) - } - - req := &waf.UpdateWebACLInput{ - ChangeToken: resp.ChangeToken, - WebACLId: aws.String(d.Id()), - } - - if d.HasChange("default_action") { - req.DefaultAction = expandDefaultAction(d) - } - - rules := d.Get("rules").(*schema.Set) - for _, rule := range rules.List() { - aclRule := rule.(map[string]interface{}) - action := aclRule["action"].(*schema.Set).List()[0].(map[string]interface{}) - aclRuleUpdate := &waf.WebACLUpdate{ - Action: aws.String(ChangeAction), - ActivatedRule: &waf.ActivatedRule{ - Priority: aws.Int64(int64(aclRule["priority"].(int))), - RuleId: aws.String(aclRule["rule_id"].(string)), - Action: &waf.WafAction{Type: aws.String(action["type"].(string))}, - }, - } - req.Updates = append(req.Updates, aclRuleUpdate) - } - _, err = conn.UpdateWebACL(req) - if err != nil { - return fmt.Errorf("Error Updating WAF ACL: %s", err) - } - return nil -} - -func expandDefaultAction(d *schema.ResourceData) *waf.WafAction { - set, ok := d.GetOk("default_action") - if !ok { - return nil - } - - s := set.(*schema.Set).List() - if s == nil || len(s) == 0 { - return nil - } - - if s[0] == nil { - log.Printf("[ERR] First element of Default Action is set to nil") - return nil - } - - dA := s[0].(map[string]interface{}) - - return &waf.WafAction{ - Type: aws.String(dA["type"].(string)), - } -} - -func flattenDefaultAction(n *waf.WafAction) []map[string]interface{} { - if n == nil { - return nil - } - - m := setMap(make(map[string]interface{})) - - m.SetString("type", n.Type) - return m.MapList() -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_xss_match_set.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_xss_match_set.go deleted file mode 100644 index 574245f..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_waf_xss_match_set.go +++ /dev/null @@ -1,181 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsWafXssMatchSet() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsWafXssMatchSetCreate, - Read: resourceAwsWafXssMatchSetRead, - Update: resourceAwsWafXssMatchSetUpdate, - Delete: resourceAwsWafXssMatchSetDelete, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "xss_match_tuples": &schema.Schema{ - Type: schema.TypeSet, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "field_to_match": { - Type: schema.TypeSet, - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "data": { - Type: schema.TypeString, - Optional: true, - }, - "type": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - "text_transformation": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, - }, - } -} - -func resourceAwsWafXssMatchSetCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - log.Printf("[INFO] Creating XssMatchSet: %s", d.Get("name").(string)) - - // ChangeToken - var ct *waf.GetChangeTokenInput - - res, err := conn.GetChangeToken(ct) - if err != nil { - return errwrap.Wrapf("[ERROR] Error getting change token: {{err}}", err) - } - - params := &waf.CreateXssMatchSetInput{ - ChangeToken: res.ChangeToken, - Name: aws.String(d.Get("name").(string)), - } - - resp, err := conn.CreateXssMatchSet(params) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error creating XssMatchSet: {{err}}", err) - } - - d.SetId(*resp.XssMatchSet.XssMatchSetId) - - return resourceAwsWafXssMatchSetUpdate(d, meta) -} - -func resourceAwsWafXssMatchSetRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - log.Printf("[INFO] Reading XssMatchSet: %s", d.Get("name").(string)) - params := &waf.GetXssMatchSetInput{ - XssMatchSetId: aws.String(d.Id()), - } - - resp, err := conn.GetXssMatchSet(params) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { - log.Printf("[WARN] WAF IPSet (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return err - } - - d.Set("name", resp.XssMatchSet.Name) - - return nil -} - -func resourceAwsWafXssMatchSetUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating XssMatchSet: %s", d.Get("name").(string)) - err := updateXssMatchSetResource(d, meta, waf.ChangeActionInsert) - if err != nil { - return errwrap.Wrapf("[ERROR] Error updating XssMatchSet: {{err}}", err) - } - return resourceAwsWafXssMatchSetRead(d, meta) -} - -func resourceAwsWafXssMatchSetDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).wafconn - - log.Printf("[INFO] Deleting XssMatchSet: %s", d.Get("name").(string)) - err := updateXssMatchSetResource(d, meta, waf.ChangeActionDelete) - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting XssMatchSet: {{err}}", err) - } - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - - req := &waf.DeleteXssMatchSetInput{ - ChangeToken: resp.ChangeToken, - XssMatchSetId: aws.String(d.Id()), - } - - _, err = conn.DeleteXssMatchSet(req) - - if err != nil { - return errwrap.Wrapf("[ERROR] Error deleting XssMatchSet: {{err}}", err) - } - - return nil -} - -func updateXssMatchSetResource(d *schema.ResourceData, meta interface{}, ChangeAction string) error { - conn := meta.(*AWSClient).wafconn - - var ct *waf.GetChangeTokenInput - - resp, err := conn.GetChangeToken(ct) - if err != nil { - return errwrap.Wrapf("[ERROR] Error getting change token: {{err}}", err) - } - - req := &waf.UpdateXssMatchSetInput{ - ChangeToken: resp.ChangeToken, - XssMatchSetId: aws.String(d.Id()), - } - - xssMatchTuples := d.Get("xss_match_tuples").(*schema.Set) - for _, xssMatchTuple := range xssMatchTuples.List() { - xmt := xssMatchTuple.(map[string]interface{}) - xssMatchTupleUpdate := &waf.XssMatchSetUpdate{ - Action: aws.String(ChangeAction), - XssMatchTuple: &waf.XssMatchTuple{ - FieldToMatch: expandFieldToMatch(xmt["field_to_match"].(*schema.Set).List()[0].(map[string]interface{})), - TextTransformation: aws.String(xmt["text_transformation"].(string)), - }, - } - req.Updates = append(req.Updates, xssMatchTupleUpdate) - } - - _, err = conn.UpdateXssMatchSet(req) - if err != nil { - return errwrap.Wrapf("[ERROR] Error updating XssMatchSet: {{err}}", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_vpn_connection_route.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_vpn_connection_route.go deleted file mode 100644 index e6863f7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/resource_vpn_connection_route.go +++ /dev/null @@ -1,140 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceAwsVpnConnectionRoute() *schema.Resource { - return &schema.Resource{ - // You can't update a route. You can just delete one and make - // a new one. - Create: resourceAwsVpnConnectionRouteCreate, - Read: resourceAwsVpnConnectionRouteRead, - Delete: resourceAwsVpnConnectionRouteDelete, - - Schema: map[string]*schema.Schema{ - "destination_cidr_block": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "vpn_connection_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceAwsVpnConnectionRouteCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - createOpts := &ec2.CreateVpnConnectionRouteInput{ - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - VpnConnectionId: aws.String(d.Get("vpn_connection_id").(string)), - } - - // Create the route. - log.Printf("[DEBUG] Creating VPN connection route") - _, err := conn.CreateVpnConnectionRoute(createOpts) - if err != nil { - return fmt.Errorf("Error creating VPN connection route: %s", err) - } - - // Store the ID by the only two data we have available to us. - d.SetId(fmt.Sprintf("%s:%s", *createOpts.DestinationCidrBlock, *createOpts.VpnConnectionId)) - - return resourceAwsVpnConnectionRouteRead(d, meta) -} - -func resourceAwsVpnConnectionRouteRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - cidrBlock, vpnConnectionId := resourceAwsVpnConnectionRouteParseId(d.Id()) - - routeFilters := []*ec2.Filter{ - &ec2.Filter{ - Name: aws.String("route.destination-cidr-block"), - Values: []*string{aws.String(cidrBlock)}, - }, - &ec2.Filter{ - Name: aws.String("vpn-connection-id"), - Values: []*string{aws.String(vpnConnectionId)}, - }, - } - - // Technically, we know everything there is to know about the route - // from its ID, but we still want to catch cases where it changes - // outside of terraform and results in a stale state file. Hence, - // conduct a read. - resp, err := conn.DescribeVpnConnections(&ec2.DescribeVpnConnectionsInput{ - Filters: routeFilters, - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpnConnectionID.NotFound" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error finding VPN connection route: %s", err) - return err - } - } - if resp == nil || len(resp.VpnConnections) == 0 { - // This is kind of a weird edge case. I'd rather return an error - // instead of just blindly setting the ID to ""... since I don't know - // what might cause this. - return fmt.Errorf("No VPN connections returned") - } - - vpnConnection := resp.VpnConnections[0] - - var found bool - for _, r := range vpnConnection.Routes { - if *r.DestinationCidrBlock == cidrBlock { - d.Set("destination_cidr_block", *r.DestinationCidrBlock) - d.Set("vpn_connection_id", *vpnConnection.VpnConnectionId) - found = true - } - } - if !found { - // Something other than terraform eliminated the route. - d.SetId("") - } - - return nil -} - -func resourceAwsVpnConnectionRouteDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ec2conn - - _, err := conn.DeleteVpnConnectionRoute(&ec2.DeleteVpnConnectionRouteInput{ - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - VpnConnectionId: aws.String(d.Get("vpn_connection_id").(string)), - }) - if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpnConnectionID.NotFound" { - d.SetId("") - return nil - } else { - log.Printf("[ERROR] Error deleting VPN connection route: %s", err) - return err - } - } - - return nil -} - -func resourceAwsVpnConnectionRouteParseId(id string) (string, string) { - parts := strings.SplitN(id, ":", 2) - return parts[0], parts[1] -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/s3_tags.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/s3_tags.go deleted file mode 100644 index 696821b..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/s3_tags.go +++ /dev/null @@ -1,133 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsS3(conn *s3.S3, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsS3(tagsFromMapS3(o), tagsFromMapS3(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - _, err := conn.DeleteBucketTagging(&s3.DeleteBucketTaggingInput{ - Bucket: aws.String(d.Get("bucket").(string)), - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - req := &s3.PutBucketTaggingInput{ - Bucket: aws.String(d.Get("bucket").(string)), - Tagging: &s3.Tagging{ - TagSet: create, - }, - } - - _, err := conn.PutBucketTagging(req) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsS3(oldTags, newTags []*s3.Tag) ([]*s3.Tag, []*s3.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*s3.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapS3(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapS3(m map[string]interface{}) []*s3.Tag { - result := make([]*s3.Tag, 0, len(m)) - for k, v := range m { - t := &s3.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredS3(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapS3(ts []*s3.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredS3(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// return a slice of s3 tags associated with the given s3 bucket. Essentially -// s3.GetBucketTagging, except returns an empty slice instead of an error when -// there are no tags. -func getTagSetS3(s3conn *s3.S3, bucket string) ([]*s3.Tag, error) { - request := &s3.GetBucketTaggingInput{ - Bucket: aws.String(bucket), - } - - response, err := s3conn.GetBucketTagging(request) - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "NoSuchTagSet" { - // There is no tag set associated with the bucket. - return []*s3.Tag{}, nil - } else if err != nil { - return nil, err - } - - return response.TagSet, nil -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredS3(t *s3.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/structure.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/structure.go deleted file mode 100644 index 24aec4e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/structure.go +++ /dev/null @@ -1,1851 +0,0 @@ -package aws - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "sort" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - "github.com/aws/aws-sdk-go/service/configservice" - "github.com/aws/aws-sdk-go/service/directoryservice" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/ecs" - "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/aws/aws-sdk-go/service/kinesis" - "github.com/aws/aws-sdk-go/service/lambda" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/hashicorp/terraform/helper/schema" - "gopkg.in/yaml.v2" -) - -// Takes the result of flatmap.Expand for an array of listeners and -// returns ELB API compatible objects -func expandListeners(configured []interface{}) ([]*elb.Listener, error) { - listeners := make([]*elb.Listener, 0, len(configured)) - - // Loop over our configured listeners and create - // an array of aws-sdk-go compatible objects - for _, lRaw := range configured { - data := lRaw.(map[string]interface{}) - - ip := int64(data["instance_port"].(int)) - lp := int64(data["lb_port"].(int)) - l := &elb.Listener{ - InstancePort: &ip, - InstanceProtocol: aws.String(data["instance_protocol"].(string)), - LoadBalancerPort: &lp, - Protocol: aws.String(data["lb_protocol"].(string)), - } - - if v, ok := data["ssl_certificate_id"]; ok { - l.SSLCertificateId = aws.String(v.(string)) - } - - var valid bool - if l.SSLCertificateId != nil && *l.SSLCertificateId != "" { - // validate the protocol is correct - for _, p := range []string{"https", "ssl"} { - if (strings.ToLower(*l.InstanceProtocol) == p) || (strings.ToLower(*l.Protocol) == p) { - valid = true - } - } - } else { - valid = true - } - - if valid { - listeners = append(listeners, l) - } else { - return nil, fmt.Errorf("[ERR] ELB Listener: ssl_certificate_id may be set only when protocol is 'https' or 'ssl'") - } - } - - return listeners, nil -} - -// Takes the result of flatmap. Expand for an array of listeners and -// returns ECS Volume compatible objects -func expandEcsVolumes(configured []interface{}) ([]*ecs.Volume, error) { - volumes := make([]*ecs.Volume, 0, len(configured)) - - // Loop over our configured volumes and create - // an array of aws-sdk-go compatible objects - for _, lRaw := range configured { - data := lRaw.(map[string]interface{}) - - l := &ecs.Volume{ - Name: aws.String(data["name"].(string)), - } - - hostPath := data["host_path"].(string) - if hostPath != "" { - l.Host = &ecs.HostVolumeProperties{ - SourcePath: aws.String(hostPath), - } - } - - volumes = append(volumes, l) - } - - return volumes, nil -} - -// Takes JSON in a string. Decodes JSON into -// an array of ecs.ContainerDefinition compatible objects -func expandEcsContainerDefinitions(rawDefinitions string) ([]*ecs.ContainerDefinition, error) { - var definitions []*ecs.ContainerDefinition - - err := json.Unmarshal([]byte(rawDefinitions), &definitions) - if err != nil { - return nil, fmt.Errorf("Error decoding JSON: %s", err) - } - - return definitions, nil -} - -// Takes the result of flatmap. Expand for an array of load balancers and -// returns ecs.LoadBalancer compatible objects -func expandEcsLoadBalancers(configured []interface{}) []*ecs.LoadBalancer { - loadBalancers := make([]*ecs.LoadBalancer, 0, len(configured)) - - // Loop over our configured load balancers and create - // an array of aws-sdk-go compatible objects - for _, lRaw := range configured { - data := lRaw.(map[string]interface{}) - - l := &ecs.LoadBalancer{ - ContainerName: aws.String(data["container_name"].(string)), - ContainerPort: aws.Int64(int64(data["container_port"].(int))), - } - - if v, ok := data["elb_name"]; ok && v.(string) != "" { - l.LoadBalancerName = aws.String(v.(string)) - } - if v, ok := data["target_group_arn"]; ok && v.(string) != "" { - l.TargetGroupArn = aws.String(v.(string)) - } - - loadBalancers = append(loadBalancers, l) - } - - return loadBalancers -} - -// Takes the result of flatmap.Expand for an array of ingress/egress security -// group rules and returns EC2 API compatible objects. This function will error -// if it finds invalid permissions input, namely a protocol of "-1" with either -// to_port or from_port set to a non-zero value. -func expandIPPerms( - group *ec2.SecurityGroup, configured []interface{}) ([]*ec2.IpPermission, error) { - vpc := group.VpcId != nil && *group.VpcId != "" - - perms := make([]*ec2.IpPermission, len(configured)) - for i, mRaw := range configured { - var perm ec2.IpPermission - m := mRaw.(map[string]interface{}) - - perm.FromPort = aws.Int64(int64(m["from_port"].(int))) - perm.ToPort = aws.Int64(int64(m["to_port"].(int))) - perm.IpProtocol = aws.String(m["protocol"].(string)) - - // When protocol is "-1", AWS won't store any ports for the - // rule, but also won't error if the user specifies ports other - // than '0'. Force the user to make a deliberate '0' port - // choice when specifying a "-1" protocol, and tell them about - // AWS's behavior in the error message. - if *perm.IpProtocol == "-1" && (*perm.FromPort != 0 || *perm.ToPort != 0) { - return nil, fmt.Errorf( - "from_port (%d) and to_port (%d) must both be 0 to use the 'ALL' \"-1\" protocol!", - *perm.FromPort, *perm.ToPort) - } - - var groups []string - if raw, ok := m["security_groups"]; ok { - list := raw.(*schema.Set).List() - for _, v := range list { - groups = append(groups, v.(string)) - } - } - if v, ok := m["self"]; ok && v.(bool) { - if vpc { - groups = append(groups, *group.GroupId) - } else { - groups = append(groups, *group.GroupName) - } - } - - if len(groups) > 0 { - perm.UserIdGroupPairs = make([]*ec2.UserIdGroupPair, len(groups)) - for i, name := range groups { - ownerId, id := "", name - if items := strings.Split(id, "/"); len(items) > 1 { - ownerId, id = items[0], items[1] - } - - perm.UserIdGroupPairs[i] = &ec2.UserIdGroupPair{ - GroupId: aws.String(id), - } - - if ownerId != "" { - perm.UserIdGroupPairs[i].UserId = aws.String(ownerId) - } - - if !vpc { - perm.UserIdGroupPairs[i].GroupId = nil - perm.UserIdGroupPairs[i].GroupName = aws.String(id) - } - } - } - - if raw, ok := m["cidr_blocks"]; ok { - list := raw.([]interface{}) - for _, v := range list { - perm.IpRanges = append(perm.IpRanges, &ec2.IpRange{CidrIp: aws.String(v.(string))}) - } - } - if raw, ok := m["ipv6_cidr_blocks"]; ok { - list := raw.([]interface{}) - for _, v := range list { - perm.Ipv6Ranges = append(perm.Ipv6Ranges, &ec2.Ipv6Range{CidrIpv6: aws.String(v.(string))}) - } - } - - if raw, ok := m["prefix_list_ids"]; ok { - list := raw.([]interface{}) - for _, v := range list { - perm.PrefixListIds = append(perm.PrefixListIds, &ec2.PrefixListId{PrefixListId: aws.String(v.(string))}) - } - } - - perms[i] = &perm - } - - return perms, nil -} - -// Takes the result of flatmap.Expand for an array of parameters and -// returns Parameter API compatible objects -func expandParameters(configured []interface{}) ([]*rds.Parameter, error) { - var parameters []*rds.Parameter - - // Loop over our configured parameters and create - // an array of aws-sdk-go compatible objects - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - - if data["name"].(string) == "" { - continue - } - - p := &rds.Parameter{ - ApplyMethod: aws.String(data["apply_method"].(string)), - ParameterName: aws.String(data["name"].(string)), - ParameterValue: aws.String(data["value"].(string)), - } - - parameters = append(parameters, p) - } - - return parameters, nil -} - -func expandRedshiftParameters(configured []interface{}) ([]*redshift.Parameter, error) { - var parameters []*redshift.Parameter - - // Loop over our configured parameters and create - // an array of aws-sdk-go compatible objects - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - - if data["name"].(string) == "" { - continue - } - - p := &redshift.Parameter{ - ParameterName: aws.String(data["name"].(string)), - ParameterValue: aws.String(data["value"].(string)), - } - - parameters = append(parameters, p) - } - - return parameters, nil -} - -func expandOptionConfiguration(configured []interface{}) ([]*rds.OptionConfiguration, error) { - var option []*rds.OptionConfiguration - - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - - o := &rds.OptionConfiguration{ - OptionName: aws.String(data["option_name"].(string)), - } - - if raw, ok := data["port"]; ok { - port := raw.(int) - if port != 0 { - o.Port = aws.Int64(int64(port)) - } - } - - if raw, ok := data["db_security_group_memberships"]; ok { - memberships := expandStringList(raw.(*schema.Set).List()) - if len(memberships) > 0 { - o.DBSecurityGroupMemberships = memberships - } - } - - if raw, ok := data["vpc_security_group_memberships"]; ok { - memberships := expandStringList(raw.(*schema.Set).List()) - if len(memberships) > 0 { - o.VpcSecurityGroupMemberships = memberships - } - } - - if raw, ok := data["option_settings"]; ok { - o.OptionSettings = expandOptionSetting(raw.(*schema.Set).List()) - } - - option = append(option, o) - } - - return option, nil -} - -func expandOptionSetting(list []interface{}) []*rds.OptionSetting { - options := make([]*rds.OptionSetting, 0, len(list)) - - for _, oRaw := range list { - data := oRaw.(map[string]interface{}) - - o := &rds.OptionSetting{ - Name: aws.String(data["name"].(string)), - Value: aws.String(data["value"].(string)), - } - - options = append(options, o) - } - - return options -} - -// Takes the result of flatmap.Expand for an array of parameters and -// returns Parameter API compatible objects -func expandElastiCacheParameters(configured []interface{}) ([]*elasticache.ParameterNameValue, error) { - parameters := make([]*elasticache.ParameterNameValue, 0, len(configured)) - - // Loop over our configured parameters and create - // an array of aws-sdk-go compatible objects - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - - p := &elasticache.ParameterNameValue{ - ParameterName: aws.String(data["name"].(string)), - ParameterValue: aws.String(data["value"].(string)), - } - - parameters = append(parameters, p) - } - - return parameters, nil -} - -// Flattens an access log into something that flatmap.Flatten() can handle -func flattenAccessLog(l *elb.AccessLog) []map[string]interface{} { - result := make([]map[string]interface{}, 0, 1) - - if l == nil { - return nil - } - - r := make(map[string]interface{}) - if l.S3BucketName != nil { - r["bucket"] = *l.S3BucketName - } - - if l.S3BucketPrefix != nil { - r["bucket_prefix"] = *l.S3BucketPrefix - } - - if l.EmitInterval != nil { - r["interval"] = *l.EmitInterval - } - - if l.Enabled != nil { - r["enabled"] = *l.Enabled - } - - result = append(result, r) - - return result -} - -// Takes the result of flatmap.Expand for an array of step adjustments and -// returns a []*autoscaling.StepAdjustment. -func expandStepAdjustments(configured []interface{}) ([]*autoscaling.StepAdjustment, error) { - var adjustments []*autoscaling.StepAdjustment - - // Loop over our configured step adjustments and create an array - // of aws-sdk-go compatible objects. We're forced to convert strings - // to floats here because there's no way to detect whether or not - // an uninitialized, optional schema element is "0.0" deliberately. - // With strings, we can test for "", which is definitely an empty - // struct value. - for _, raw := range configured { - data := raw.(map[string]interface{}) - a := &autoscaling.StepAdjustment{ - ScalingAdjustment: aws.Int64(int64(data["scaling_adjustment"].(int))), - } - if data["metric_interval_lower_bound"] != "" { - bound := data["metric_interval_lower_bound"] - switch bound := bound.(type) { - case string: - f, err := strconv.ParseFloat(bound, 64) - if err != nil { - return nil, fmt.Errorf( - "metric_interval_lower_bound must be a float value represented as a string") - } - a.MetricIntervalLowerBound = aws.Float64(f) - default: - return nil, fmt.Errorf( - "metric_interval_lower_bound isn't a string. This is a bug. Please file an issue.") - } - } - if data["metric_interval_upper_bound"] != "" { - bound := data["metric_interval_upper_bound"] - switch bound := bound.(type) { - case string: - f, err := strconv.ParseFloat(bound, 64) - if err != nil { - return nil, fmt.Errorf( - "metric_interval_upper_bound must be a float value represented as a string") - } - a.MetricIntervalUpperBound = aws.Float64(f) - default: - return nil, fmt.Errorf( - "metric_interval_upper_bound isn't a string. This is a bug. Please file an issue.") - } - } - adjustments = append(adjustments, a) - } - - return adjustments, nil -} - -// Flattens a health check into something that flatmap.Flatten() -// can handle -func flattenHealthCheck(check *elb.HealthCheck) []map[string]interface{} { - result := make([]map[string]interface{}, 0, 1) - - chk := make(map[string]interface{}) - chk["unhealthy_threshold"] = *check.UnhealthyThreshold - chk["healthy_threshold"] = *check.HealthyThreshold - chk["target"] = *check.Target - chk["timeout"] = *check.Timeout - chk["interval"] = *check.Interval - - result = append(result, chk) - - return result -} - -// Flattens an array of UserSecurityGroups into a []*ec2.GroupIdentifier -func flattenSecurityGroups(list []*ec2.UserIdGroupPair, ownerId *string) []*ec2.GroupIdentifier { - result := make([]*ec2.GroupIdentifier, 0, len(list)) - for _, g := range list { - var userId *string - if g.UserId != nil && *g.UserId != "" && (ownerId == nil || *ownerId != *g.UserId) { - userId = g.UserId - } - // userid nil here for same vpc groups - - vpc := g.GroupName == nil || *g.GroupName == "" - var id *string - if vpc { - id = g.GroupId - } else { - id = g.GroupName - } - - // id is groupid for vpcs - // id is groupname for non vpc (classic) - - if userId != nil { - id = aws.String(*userId + "/" + *id) - } - - if vpc { - result = append(result, &ec2.GroupIdentifier{ - GroupId: id, - }) - } else { - result = append(result, &ec2.GroupIdentifier{ - GroupId: g.GroupId, - GroupName: id, - }) - } - } - return result -} - -// Flattens an array of Instances into a []string -func flattenInstances(list []*elb.Instance) []string { - result := make([]string, 0, len(list)) - for _, i := range list { - result = append(result, *i.InstanceId) - } - return result -} - -// Expands an array of String Instance IDs into a []Instances -func expandInstanceString(list []interface{}) []*elb.Instance { - result := make([]*elb.Instance, 0, len(list)) - for _, i := range list { - result = append(result, &elb.Instance{InstanceId: aws.String(i.(string))}) - } - return result -} - -// Flattens an array of Backend Descriptions into a a map of instance_port to policy names. -func flattenBackendPolicies(backends []*elb.BackendServerDescription) map[int64][]string { - policies := make(map[int64][]string) - for _, i := range backends { - for _, p := range i.PolicyNames { - policies[*i.InstancePort] = append(policies[*i.InstancePort], *p) - } - sort.Strings(policies[*i.InstancePort]) - } - return policies -} - -// Flattens an array of Listeners into a []map[string]interface{} -func flattenListeners(list []*elb.ListenerDescription) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(list)) - for _, i := range list { - l := map[string]interface{}{ - "instance_port": *i.Listener.InstancePort, - "instance_protocol": strings.ToLower(*i.Listener.InstanceProtocol), - "lb_port": *i.Listener.LoadBalancerPort, - "lb_protocol": strings.ToLower(*i.Listener.Protocol), - } - // SSLCertificateID is optional, and may be nil - if i.Listener.SSLCertificateId != nil { - l["ssl_certificate_id"] = *i.Listener.SSLCertificateId - } - result = append(result, l) - } - return result -} - -// Flattens an array of Volumes into a []map[string]interface{} -func flattenEcsVolumes(list []*ecs.Volume) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(list)) - for _, volume := range list { - l := map[string]interface{}{ - "name": *volume.Name, - } - - if volume.Host.SourcePath != nil { - l["host_path"] = *volume.Host.SourcePath - } - - result = append(result, l) - } - return result -} - -// Flattens an array of ECS LoadBalancers into a []map[string]interface{} -func flattenEcsLoadBalancers(list []*ecs.LoadBalancer) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(list)) - for _, loadBalancer := range list { - l := map[string]interface{}{ - "container_name": *loadBalancer.ContainerName, - "container_port": *loadBalancer.ContainerPort, - } - - if loadBalancer.LoadBalancerName != nil { - l["elb_name"] = *loadBalancer.LoadBalancerName - } - - if loadBalancer.TargetGroupArn != nil { - l["target_group_arn"] = *loadBalancer.TargetGroupArn - } - - result = append(result, l) - } - return result -} - -// Encodes an array of ecs.ContainerDefinitions into a JSON string -func flattenEcsContainerDefinitions(definitions []*ecs.ContainerDefinition) (string, error) { - byteArray, err := json.Marshal(definitions) - if err != nil { - return "", fmt.Errorf("Error encoding to JSON: %s", err) - } - - n := bytes.Index(byteArray, []byte{0}) - return string(byteArray[:n]), nil -} - -// Flattens an array of Options into a []map[string]interface{} -func flattenOptions(list []*rds.Option) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(list)) - for _, i := range list { - if i.OptionName != nil { - r := make(map[string]interface{}) - r["option_name"] = strings.ToLower(*i.OptionName) - // Default empty string, guard against nil parameter values - r["port"] = "" - if i.Port != nil { - r["port"] = int(*i.Port) - } - if i.VpcSecurityGroupMemberships != nil { - vpcs := make([]string, 0, len(i.VpcSecurityGroupMemberships)) - for _, vpc := range i.VpcSecurityGroupMemberships { - id := vpc.VpcSecurityGroupId - vpcs = append(vpcs, *id) - } - - r["vpc_security_group_memberships"] = vpcs - } - if i.DBSecurityGroupMemberships != nil { - dbs := make([]string, 0, len(i.DBSecurityGroupMemberships)) - for _, db := range i.DBSecurityGroupMemberships { - id := db.DBSecurityGroupName - dbs = append(dbs, *id) - } - - r["db_security_group_memberships"] = dbs - } - if i.OptionSettings != nil { - settings := make([]map[string]interface{}, 0, len(i.OptionSettings)) - for _, j := range i.OptionSettings { - setting := map[string]interface{}{ - "name": *j.Name, - } - if j.Value != nil { - setting["value"] = *j.Value - } - - settings = append(settings, setting) - } - - r["option_settings"] = settings - } - result = append(result, r) - } - } - return result -} - -// Flattens an array of Parameters into a []map[string]interface{} -func flattenParameters(list []*rds.Parameter) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(list)) - for _, i := range list { - if i.ParameterName != nil { - r := make(map[string]interface{}) - r["name"] = strings.ToLower(*i.ParameterName) - // Default empty string, guard against nil parameter values - r["value"] = "" - if i.ParameterValue != nil { - r["value"] = strings.ToLower(*i.ParameterValue) - } - if i.ApplyMethod != nil { - r["apply_method"] = strings.ToLower(*i.ApplyMethod) - } - - result = append(result, r) - } - } - return result -} - -// Flattens an array of Redshift Parameters into a []map[string]interface{} -func flattenRedshiftParameters(list []*redshift.Parameter) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(list)) - for _, i := range list { - result = append(result, map[string]interface{}{ - "name": strings.ToLower(*i.ParameterName), - "value": strings.ToLower(*i.ParameterValue), - }) - } - return result -} - -// Flattens an array of Parameters into a []map[string]interface{} -func flattenElastiCacheParameters(list []*elasticache.Parameter) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(list)) - for _, i := range list { - if i.ParameterValue != nil { - result = append(result, map[string]interface{}{ - "name": strings.ToLower(*i.ParameterName), - "value": *i.ParameterValue, - }) - } - } - return result -} - -// Takes the result of flatmap.Expand for an array of strings -// and returns a []*string -func expandStringList(configured []interface{}) []*string { - vs := make([]*string, 0, len(configured)) - for _, v := range configured { - val, ok := v.(string) - if ok && val != "" { - vs = append(vs, aws.String(v.(string))) - } - } - return vs -} - -// Takes the result of schema.Set of strings and returns a []*string -func expandStringSet(configured *schema.Set) []*string { - return expandStringList(configured.List()) -} - -// Takes list of pointers to strings. Expand to an array -// of raw strings and returns a []interface{} -// to keep compatibility w/ schema.NewSetschema.NewSet -func flattenStringList(list []*string) []interface{} { - vs := make([]interface{}, 0, len(list)) - for _, v := range list { - vs = append(vs, *v) - } - return vs -} - -//Flattens an array of private ip addresses into a []string, where the elements returned are the IP strings e.g. "192.168.0.0" -func flattenNetworkInterfacesPrivateIPAddresses(dtos []*ec2.NetworkInterfacePrivateIpAddress) []string { - ips := make([]string, 0, len(dtos)) - for _, v := range dtos { - ip := *v.PrivateIpAddress - ips = append(ips, ip) - } - return ips -} - -//Flattens security group identifiers into a []string, where the elements returned are the GroupIDs -func flattenGroupIdentifiers(dtos []*ec2.GroupIdentifier) []string { - ids := make([]string, 0, len(dtos)) - for _, v := range dtos { - group_id := *v.GroupId - ids = append(ids, group_id) - } - return ids -} - -//Expands an array of IPs into a ec2 Private IP Address Spec -func expandPrivateIPAddresses(ips []interface{}) []*ec2.PrivateIpAddressSpecification { - dtos := make([]*ec2.PrivateIpAddressSpecification, 0, len(ips)) - for i, v := range ips { - new_private_ip := &ec2.PrivateIpAddressSpecification{ - PrivateIpAddress: aws.String(v.(string)), - } - - new_private_ip.Primary = aws.Bool(i == 0) - - dtos = append(dtos, new_private_ip) - } - return dtos -} - -//Flattens network interface attachment into a map[string]interface -func flattenAttachment(a *ec2.NetworkInterfaceAttachment) map[string]interface{} { - att := make(map[string]interface{}) - if a.InstanceId != nil { - att["instance"] = *a.InstanceId - } - att["device_index"] = *a.DeviceIndex - att["attachment_id"] = *a.AttachmentId - return att -} - -func flattenElastiCacheSecurityGroupNames(securityGroups []*elasticache.CacheSecurityGroupMembership) []string { - result := make([]string, 0, len(securityGroups)) - for _, sg := range securityGroups { - if sg.CacheSecurityGroupName != nil { - result = append(result, *sg.CacheSecurityGroupName) - } - } - return result -} - -func flattenElastiCacheSecurityGroupIds(securityGroups []*elasticache.SecurityGroupMembership) []string { - result := make([]string, 0, len(securityGroups)) - for _, sg := range securityGroups { - if sg.SecurityGroupId != nil { - result = append(result, *sg.SecurityGroupId) - } - } - return result -} - -// Flattens step adjustments into a list of map[string]interface. -func flattenStepAdjustments(adjustments []*autoscaling.StepAdjustment) []map[string]interface{} { - result := make([]map[string]interface{}, 0, len(adjustments)) - for _, raw := range adjustments { - a := map[string]interface{}{ - "scaling_adjustment": *raw.ScalingAdjustment, - } - if raw.MetricIntervalUpperBound != nil { - a["metric_interval_upper_bound"] = *raw.MetricIntervalUpperBound - } - if raw.MetricIntervalLowerBound != nil { - a["metric_interval_lower_bound"] = *raw.MetricIntervalLowerBound - } - result = append(result, a) - } - return result -} - -func flattenResourceRecords(recs []*route53.ResourceRecord) []string { - strs := make([]string, 0, len(recs)) - for _, r := range recs { - if r.Value != nil { - s := strings.Replace(*r.Value, "\"", "", 2) - strs = append(strs, s) - } - } - return strs -} - -func expandResourceRecords(recs []interface{}, typeStr string) []*route53.ResourceRecord { - records := make([]*route53.ResourceRecord, 0, len(recs)) - for _, r := range recs { - s := r.(string) - switch typeStr { - case "TXT", "SPF": - str := fmt.Sprintf("\"%s\"", s) - records = append(records, &route53.ResourceRecord{Value: aws.String(str)}) - default: - records = append(records, &route53.ResourceRecord{Value: aws.String(s)}) - } - } - return records -} - -func expandESClusterConfig(m map[string]interface{}) *elasticsearch.ElasticsearchClusterConfig { - config := elasticsearch.ElasticsearchClusterConfig{} - - if v, ok := m["dedicated_master_enabled"]; ok { - isEnabled := v.(bool) - config.DedicatedMasterEnabled = aws.Bool(isEnabled) - - if isEnabled { - if v, ok := m["dedicated_master_count"]; ok && v.(int) > 0 { - config.DedicatedMasterCount = aws.Int64(int64(v.(int))) - } - if v, ok := m["dedicated_master_type"]; ok && v.(string) != "" { - config.DedicatedMasterType = aws.String(v.(string)) - } - } - } - - if v, ok := m["instance_count"]; ok { - config.InstanceCount = aws.Int64(int64(v.(int))) - } - if v, ok := m["instance_type"]; ok { - config.InstanceType = aws.String(v.(string)) - } - - if v, ok := m["zone_awareness_enabled"]; ok { - config.ZoneAwarenessEnabled = aws.Bool(v.(bool)) - } - - return &config -} - -func flattenESClusterConfig(c *elasticsearch.ElasticsearchClusterConfig) []map[string]interface{} { - m := map[string]interface{}{} - - if c.DedicatedMasterCount != nil { - m["dedicated_master_count"] = *c.DedicatedMasterCount - } - if c.DedicatedMasterEnabled != nil { - m["dedicated_master_enabled"] = *c.DedicatedMasterEnabled - } - if c.DedicatedMasterType != nil { - m["dedicated_master_type"] = *c.DedicatedMasterType - } - if c.InstanceCount != nil { - m["instance_count"] = *c.InstanceCount - } - if c.InstanceType != nil { - m["instance_type"] = *c.InstanceType - } - if c.ZoneAwarenessEnabled != nil { - m["zone_awareness_enabled"] = *c.ZoneAwarenessEnabled - } - - return []map[string]interface{}{m} -} - -func flattenESEBSOptions(o *elasticsearch.EBSOptions) []map[string]interface{} { - m := map[string]interface{}{} - - if o.EBSEnabled != nil { - m["ebs_enabled"] = *o.EBSEnabled - } - if o.Iops != nil { - m["iops"] = *o.Iops - } - if o.VolumeSize != nil { - m["volume_size"] = *o.VolumeSize - } - if o.VolumeType != nil { - m["volume_type"] = *o.VolumeType - } - - return []map[string]interface{}{m} -} - -func expandESEBSOptions(m map[string]interface{}) *elasticsearch.EBSOptions { - options := elasticsearch.EBSOptions{} - - if v, ok := m["ebs_enabled"]; ok { - options.EBSEnabled = aws.Bool(v.(bool)) - } - if v, ok := m["iops"]; ok && v.(int) > 0 { - options.Iops = aws.Int64(int64(v.(int))) - } - if v, ok := m["volume_size"]; ok && v.(int) > 0 { - options.VolumeSize = aws.Int64(int64(v.(int))) - } - if v, ok := m["volume_type"]; ok && v.(string) != "" { - options.VolumeType = aws.String(v.(string)) - } - - return &options -} - -func expandConfigRecordingGroup(configured []interface{}) *configservice.RecordingGroup { - recordingGroup := configservice.RecordingGroup{} - group := configured[0].(map[string]interface{}) - - if v, ok := group["all_supported"]; ok { - recordingGroup.AllSupported = aws.Bool(v.(bool)) - } - - if v, ok := group["include_global_resource_types"]; ok { - recordingGroup.IncludeGlobalResourceTypes = aws.Bool(v.(bool)) - } - - if v, ok := group["resource_types"]; ok { - recordingGroup.ResourceTypes = expandStringList(v.(*schema.Set).List()) - } - return &recordingGroup -} - -func flattenConfigRecordingGroup(g *configservice.RecordingGroup) []map[string]interface{} { - m := make(map[string]interface{}, 1) - - if g.AllSupported != nil { - m["all_supported"] = *g.AllSupported - } - - if g.IncludeGlobalResourceTypes != nil { - m["include_global_resource_types"] = *g.IncludeGlobalResourceTypes - } - - if g.ResourceTypes != nil && len(g.ResourceTypes) > 0 { - m["resource_types"] = schema.NewSet(schema.HashString, flattenStringList(g.ResourceTypes)) - } - - return []map[string]interface{}{m} -} - -func flattenConfigSnapshotDeliveryProperties(p *configservice.ConfigSnapshotDeliveryProperties) []map[string]interface{} { - m := make(map[string]interface{}, 0) - - if p.DeliveryFrequency != nil { - m["delivery_frequency"] = *p.DeliveryFrequency - } - - return []map[string]interface{}{m} -} - -func pointersMapToStringList(pointers map[string]*string) map[string]interface{} { - list := make(map[string]interface{}, len(pointers)) - for i, v := range pointers { - list[i] = *v - } - return list -} - -func stringMapToPointers(m map[string]interface{}) map[string]*string { - list := make(map[string]*string, len(m)) - for i, v := range m { - list[i] = aws.String(v.(string)) - } - return list -} - -func flattenDSVpcSettings( - s *directoryservice.DirectoryVpcSettingsDescription) []map[string]interface{} { - settings := make(map[string]interface{}, 0) - - if s == nil { - return nil - } - - settings["subnet_ids"] = schema.NewSet(schema.HashString, flattenStringList(s.SubnetIds)) - settings["vpc_id"] = *s.VpcId - - return []map[string]interface{}{settings} -} - -func flattenLambdaEnvironment(lambdaEnv *lambda.EnvironmentResponse) []interface{} { - envs := make(map[string]interface{}) - en := make(map[string]string) - - if lambdaEnv == nil { - return nil - } - - for k, v := range lambdaEnv.Variables { - en[k] = *v - } - if len(en) > 0 { - envs["variables"] = en - } - - return []interface{}{envs} -} - -func flattenLambdaVpcConfigResponse(s *lambda.VpcConfigResponse) []map[string]interface{} { - settings := make(map[string]interface{}, 0) - - if s == nil { - return nil - } - - var emptyVpc bool - if s.VpcId == nil || *s.VpcId == "" { - emptyVpc = true - } - if len(s.SubnetIds) == 0 && len(s.SecurityGroupIds) == 0 && emptyVpc { - return nil - } - - settings["subnet_ids"] = schema.NewSet(schema.HashString, flattenStringList(s.SubnetIds)) - settings["security_group_ids"] = schema.NewSet(schema.HashString, flattenStringList(s.SecurityGroupIds)) - if s.VpcId != nil { - settings["vpc_id"] = *s.VpcId - } - - return []map[string]interface{}{settings} -} - -func flattenDSConnectSettings( - customerDnsIps []*string, - s *directoryservice.DirectoryConnectSettingsDescription) []map[string]interface{} { - if s == nil { - return nil - } - - settings := make(map[string]interface{}, 0) - - settings["customer_dns_ips"] = schema.NewSet(schema.HashString, flattenStringList(customerDnsIps)) - settings["connect_ips"] = schema.NewSet(schema.HashString, flattenStringList(s.ConnectIps)) - settings["customer_username"] = *s.CustomerUserName - settings["subnet_ids"] = schema.NewSet(schema.HashString, flattenStringList(s.SubnetIds)) - settings["vpc_id"] = *s.VpcId - - return []map[string]interface{}{settings} -} - -func expandCloudFormationParameters(params map[string]interface{}) []*cloudformation.Parameter { - var cfParams []*cloudformation.Parameter - for k, v := range params { - cfParams = append(cfParams, &cloudformation.Parameter{ - ParameterKey: aws.String(k), - ParameterValue: aws.String(v.(string)), - }) - } - - return cfParams -} - -// flattenCloudFormationParameters is flattening list of -// *cloudformation.Parameters and only returning existing -// parameters to avoid clash with default values -func flattenCloudFormationParameters(cfParams []*cloudformation.Parameter, - originalParams map[string]interface{}) map[string]interface{} { - params := make(map[string]interface{}, len(cfParams)) - for _, p := range cfParams { - _, isConfigured := originalParams[*p.ParameterKey] - if isConfigured { - params[*p.ParameterKey] = *p.ParameterValue - } - } - return params -} - -func flattenAllCloudFormationParameters(cfParams []*cloudformation.Parameter) map[string]interface{} { - params := make(map[string]interface{}, len(cfParams)) - for _, p := range cfParams { - params[*p.ParameterKey] = *p.ParameterValue - } - return params -} - -func expandCloudFormationTags(tags map[string]interface{}) []*cloudformation.Tag { - var cfTags []*cloudformation.Tag - for k, v := range tags { - cfTags = append(cfTags, &cloudformation.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - return cfTags -} - -func flattenCloudFormationTags(cfTags []*cloudformation.Tag) map[string]string { - tags := make(map[string]string, len(cfTags)) - for _, t := range cfTags { - tags[*t.Key] = *t.Value - } - return tags -} - -func flattenCloudFormationOutputs(cfOutputs []*cloudformation.Output) map[string]string { - outputs := make(map[string]string, len(cfOutputs)) - for _, o := range cfOutputs { - outputs[*o.OutputKey] = *o.OutputValue - } - return outputs -} - -func flattenAsgSuspendedProcesses(list []*autoscaling.SuspendedProcess) []string { - strs := make([]string, 0, len(list)) - for _, r := range list { - if r.ProcessName != nil { - strs = append(strs, *r.ProcessName) - } - } - return strs -} - -func flattenAsgEnabledMetrics(list []*autoscaling.EnabledMetric) []string { - strs := make([]string, 0, len(list)) - for _, r := range list { - if r.Metric != nil { - strs = append(strs, *r.Metric) - } - } - return strs -} - -func flattenKinesisShardLevelMetrics(list []*kinesis.EnhancedMetrics) []string { - if len(list) == 0 { - return []string{} - } - strs := make([]string, 0, len(list[0].ShardLevelMetrics)) - for _, s := range list[0].ShardLevelMetrics { - strs = append(strs, *s) - } - return strs -} - -func flattenApiGatewayStageKeys(keys []*string) []map[string]interface{} { - stageKeys := make([]map[string]interface{}, 0, len(keys)) - for _, o := range keys { - key := make(map[string]interface{}) - parts := strings.Split(*o, "/") - key["stage_name"] = parts[1] - key["rest_api_id"] = parts[0] - - stageKeys = append(stageKeys, key) - } - return stageKeys -} - -func expandApiGatewayStageKeys(d *schema.ResourceData) []*apigateway.StageKey { - var stageKeys []*apigateway.StageKey - - if stageKeyData, ok := d.GetOk("stage_key"); ok { - params := stageKeyData.(*schema.Set).List() - for k := range params { - data := params[k].(map[string]interface{}) - stageKeys = append(stageKeys, &apigateway.StageKey{ - RestApiId: aws.String(data["rest_api_id"].(string)), - StageName: aws.String(data["stage_name"].(string)), - }) - } - } - - return stageKeys -} - -func expandApiGatewayRequestResponseModelOperations(d *schema.ResourceData, key string, prefix string) []*apigateway.PatchOperation { - operations := make([]*apigateway.PatchOperation, 0) - - oldModels, newModels := d.GetChange(key) - oldModelMap := oldModels.(map[string]interface{}) - newModelMap := newModels.(map[string]interface{}) - - for k, _ := range oldModelMap { - operation := apigateway.PatchOperation{ - Op: aws.String("remove"), - Path: aws.String(fmt.Sprintf("/%s/%s", prefix, strings.Replace(k, "/", "~1", -1))), - } - - for nK, nV := range newModelMap { - if nK == k { - operation.Op = aws.String("replace") - operation.Value = aws.String(nV.(string)) - } - } - - operations = append(operations, &operation) - } - - for nK, nV := range newModelMap { - exists := false - for k, _ := range oldModelMap { - if k == nK { - exists = true - } - } - if !exists { - operation := apigateway.PatchOperation{ - Op: aws.String("add"), - Path: aws.String(fmt.Sprintf("/%s/%s", prefix, strings.Replace(nK, "/", "~1", -1))), - Value: aws.String(nV.(string)), - } - operations = append(operations, &operation) - } - } - - return operations -} - -func deprecatedExpandApiGatewayMethodParametersJSONOperations(d *schema.ResourceData, key string, prefix string) ([]*apigateway.PatchOperation, error) { - operations := make([]*apigateway.PatchOperation, 0) - oldParameters, newParameters := d.GetChange(key) - oldParametersMap := make(map[string]interface{}) - newParametersMap := make(map[string]interface{}) - - if err := json.Unmarshal([]byte(oldParameters.(string)), &oldParametersMap); err != nil { - err := fmt.Errorf("Error unmarshaling old %s: %s", key, err) - return operations, err - } - - if err := json.Unmarshal([]byte(newParameters.(string)), &newParametersMap); err != nil { - err := fmt.Errorf("Error unmarshaling new %s: %s", key, err) - return operations, err - } - - for k, _ := range oldParametersMap { - operation := apigateway.PatchOperation{ - Op: aws.String("remove"), - Path: aws.String(fmt.Sprintf("/%s/%s", prefix, k)), - } - - for nK, nV := range newParametersMap { - if nK == k { - operation.Op = aws.String("replace") - operation.Value = aws.String(strconv.FormatBool(nV.(bool))) - } - } - - operations = append(operations, &operation) - } - - for nK, nV := range newParametersMap { - exists := false - for k, _ := range oldParametersMap { - if k == nK { - exists = true - } - } - if !exists { - operation := apigateway.PatchOperation{ - Op: aws.String("add"), - Path: aws.String(fmt.Sprintf("/%s/%s", prefix, nK)), - Value: aws.String(strconv.FormatBool(nV.(bool))), - } - operations = append(operations, &operation) - } - } - - return operations, nil -} - -func expandApiGatewayMethodParametersOperations(d *schema.ResourceData, key string, prefix string) ([]*apigateway.PatchOperation, error) { - operations := make([]*apigateway.PatchOperation, 0) - - oldParameters, newParameters := d.GetChange(key) - oldParametersMap := oldParameters.(map[string]interface{}) - newParametersMap := newParameters.(map[string]interface{}) - - for k, _ := range oldParametersMap { - operation := apigateway.PatchOperation{ - Op: aws.String("remove"), - Path: aws.String(fmt.Sprintf("/%s/%s", prefix, k)), - } - - for nK, nV := range newParametersMap { - b, ok := nV.(bool) - if !ok { - value, _ := strconv.ParseBool(nV.(string)) - b = value - } - if nK == k { - operation.Op = aws.String("replace") - operation.Value = aws.String(strconv.FormatBool(b)) - } - } - - operations = append(operations, &operation) - } - - for nK, nV := range newParametersMap { - exists := false - for k, _ := range oldParametersMap { - if k == nK { - exists = true - } - } - if !exists { - b, ok := nV.(bool) - if !ok { - value, _ := strconv.ParseBool(nV.(string)) - b = value - } - operation := apigateway.PatchOperation{ - Op: aws.String("add"), - Path: aws.String(fmt.Sprintf("/%s/%s", prefix, nK)), - Value: aws.String(strconv.FormatBool(b)), - } - operations = append(operations, &operation) - } - } - - return operations, nil -} - -func expandApiGatewayStageKeyOperations(d *schema.ResourceData) []*apigateway.PatchOperation { - operations := make([]*apigateway.PatchOperation, 0) - - prev, curr := d.GetChange("stage_key") - prevList := prev.(*schema.Set).List() - currList := curr.(*schema.Set).List() - - for i := range prevList { - p := prevList[i].(map[string]interface{}) - exists := false - - for j := range currList { - c := currList[j].(map[string]interface{}) - if c["rest_api_id"].(string) == p["rest_api_id"].(string) && c["stage_name"].(string) == p["stage_name"].(string) { - exists = true - } - } - - if !exists { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("remove"), - Path: aws.String("/stages"), - Value: aws.String(fmt.Sprintf("%s/%s", p["rest_api_id"].(string), p["stage_name"].(string))), - }) - } - } - - for i := range currList { - c := currList[i].(map[string]interface{}) - exists := false - - for j := range prevList { - p := prevList[j].(map[string]interface{}) - if c["rest_api_id"].(string) == p["rest_api_id"].(string) && c["stage_name"].(string) == p["stage_name"].(string) { - exists = true - } - } - - if !exists { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("add"), - Path: aws.String("/stages"), - Value: aws.String(fmt.Sprintf("%s/%s", c["rest_api_id"].(string), c["stage_name"].(string))), - }) - } - } - - return operations -} - -func expandCloudWachLogMetricTransformations(m map[string]interface{}) []*cloudwatchlogs.MetricTransformation { - transformation := cloudwatchlogs.MetricTransformation{ - MetricName: aws.String(m["name"].(string)), - MetricNamespace: aws.String(m["namespace"].(string)), - MetricValue: aws.String(m["value"].(string)), - } - - return []*cloudwatchlogs.MetricTransformation{&transformation} -} - -func flattenCloudWachLogMetricTransformations(ts []*cloudwatchlogs.MetricTransformation) map[string]string { - m := make(map[string]string, 0) - - m["name"] = *ts[0].MetricName - m["namespace"] = *ts[0].MetricNamespace - m["value"] = *ts[0].MetricValue - - return m -} - -func flattenBeanstalkAsg(list []*elasticbeanstalk.AutoScalingGroup) []string { - strs := make([]string, 0, len(list)) - for _, r := range list { - if r.Name != nil { - strs = append(strs, *r.Name) - } - } - return strs -} - -func flattenBeanstalkInstances(list []*elasticbeanstalk.Instance) []string { - strs := make([]string, 0, len(list)) - for _, r := range list { - if r.Id != nil { - strs = append(strs, *r.Id) - } - } - return strs -} - -func flattenBeanstalkLc(list []*elasticbeanstalk.LaunchConfiguration) []string { - strs := make([]string, 0, len(list)) - for _, r := range list { - if r.Name != nil { - strs = append(strs, *r.Name) - } - } - return strs -} - -func flattenBeanstalkElb(list []*elasticbeanstalk.LoadBalancer) []string { - strs := make([]string, 0, len(list)) - for _, r := range list { - if r.Name != nil { - strs = append(strs, *r.Name) - } - } - return strs -} - -func flattenBeanstalkSqs(list []*elasticbeanstalk.Queue) []string { - strs := make([]string, 0, len(list)) - for _, r := range list { - if r.URL != nil { - strs = append(strs, *r.URL) - } - } - return strs -} - -func flattenBeanstalkTrigger(list []*elasticbeanstalk.Trigger) []string { - strs := make([]string, 0, len(list)) - for _, r := range list { - if r.Name != nil { - strs = append(strs, *r.Name) - } - } - return strs -} - -// There are several parts of the AWS API that will sort lists of strings, -// causing diffs inbetween resources that use lists. This avoids a bit of -// code duplication for pre-sorts that can be used for things like hash -// functions, etc. -func sortInterfaceSlice(in []interface{}) []interface{} { - a := []string{} - b := []interface{}{} - for _, v := range in { - a = append(a, v.(string)) - } - - sort.Strings(a) - - for _, v := range a { - b = append(b, v) - } - - return b -} - -func flattenApiGatewayThrottleSettings(settings *apigateway.ThrottleSettings) []map[string]interface{} { - result := make([]map[string]interface{}, 0, 1) - - if settings != nil { - r := make(map[string]interface{}) - if settings.BurstLimit != nil { - r["burst_limit"] = *settings.BurstLimit - } - - if settings.RateLimit != nil { - r["rate_limit"] = *settings.RateLimit - } - - result = append(result, r) - } - - return result -} - -// TODO: refactor some of these helper functions and types in the terraform/helper packages - -// getStringPtr returns a *string version of the value taken from m, where m -// can be a map[string]interface{} or a *schema.ResourceData. If the key isn't -// present or is empty, getNilString returns nil. -func getStringPtr(m interface{}, key string) *string { - switch m := m.(type) { - case map[string]interface{}: - v := m[key] - - if v == nil { - return nil - } - - s := v.(string) - if s == "" { - return nil - } - - return &s - - case *schema.ResourceData: - if v, ok := m.GetOk(key); ok { - if v == nil || v.(string) == "" { - return nil - } - s := v.(string) - return &s - } - - default: - panic("unknown type in getStringPtr") - } - - return nil -} - -// getStringPtrList returns a []*string version of the map value. If the key -// isn't present, getNilStringList returns nil. -func getStringPtrList(m map[string]interface{}, key string) []*string { - if v, ok := m[key]; ok { - var stringList []*string - for _, i := range v.([]interface{}) { - s := i.(string) - stringList = append(stringList, &s) - } - - return stringList - } - - return nil -} - -// a convenience wrapper type for the schema.Set map[string]interface{} -// Set operations only alter the underlying map if the value is not nil -type setMap map[string]interface{} - -// SetString sets m[key] = *value only if `value != nil` -func (s setMap) SetString(key string, value *string) { - if value == nil { - return - } - - s[key] = *value -} - -// SetStringMap sets key to value as a map[string]interface{}, stripping any nil -// values. The value parameter can be a map[string]interface{}, a -// map[string]*string, or a map[string]string. -func (s setMap) SetStringMap(key string, value interface{}) { - // because these methods are meant to be chained without intermediate - // checks for nil, we are likely to get interfaces with dynamic types but - // a nil value. - if reflect.ValueOf(value).IsNil() { - return - } - - m := make(map[string]interface{}) - - switch value := value.(type) { - case map[string]string: - for k, v := range value { - m[k] = v - } - case map[string]*string: - for k, v := range value { - if v == nil { - continue - } - m[k] = *v - } - case map[string]interface{}: - for k, v := range value { - if v == nil { - continue - } - - switch v := v.(type) { - case string: - m[k] = v - case *string: - if v != nil { - m[k] = *v - } - default: - panic(fmt.Sprintf("unknown type for SetString: %T", v)) - } - } - } - - // catch the case where the interface wasn't nil, but we had no non-nil values - if len(m) > 0 { - s[key] = m - } -} - -// Set assigns value to s[key] if value isn't nil -func (s setMap) Set(key string, value interface{}) { - if reflect.ValueOf(value).IsNil() { - return - } - - s[key] = value -} - -// Map returns the raw map type for a shorter type conversion -func (s setMap) Map() map[string]interface{} { - return map[string]interface{}(s) -} - -// MapList returns the map[string]interface{} as a single element in a slice to -// match the schema.Set data type used for structs. -func (s setMap) MapList() []map[string]interface{} { - return []map[string]interface{}{s.Map()} -} - -// Takes the result of flatmap.Expand for an array of policy attributes and -// returns ELB API compatible objects -func expandPolicyAttributes(configured []interface{}) ([]*elb.PolicyAttribute, error) { - attributes := make([]*elb.PolicyAttribute, 0, len(configured)) - - // Loop over our configured attributes and create - // an array of aws-sdk-go compatible objects - for _, lRaw := range configured { - data := lRaw.(map[string]interface{}) - - a := &elb.PolicyAttribute{ - AttributeName: aws.String(data["name"].(string)), - AttributeValue: aws.String(data["value"].(string)), - } - - attributes = append(attributes, a) - - } - - return attributes, nil -} - -// Flattens an array of PolicyAttributes into a []interface{} -func flattenPolicyAttributes(list []*elb.PolicyAttributeDescription) []interface{} { - attributes := []interface{}{} - for _, attrdef := range list { - attribute := map[string]string{ - "name": *attrdef.AttributeName, - "value": *attrdef.AttributeValue, - } - - attributes = append(attributes, attribute) - - } - - return attributes -} - -func flattenConfigRuleSource(source *configservice.Source) []interface{} { - var result []interface{} - m := make(map[string]interface{}) - m["owner"] = *source.Owner - m["source_identifier"] = *source.SourceIdentifier - if len(source.SourceDetails) > 0 { - m["source_detail"] = schema.NewSet(configRuleSourceDetailsHash, flattenConfigRuleSourceDetails(source.SourceDetails)) - } - result = append(result, m) - return result -} - -func flattenConfigRuleSourceDetails(details []*configservice.SourceDetail) []interface{} { - var items []interface{} - for _, d := range details { - m := make(map[string]interface{}) - if d.MessageType != nil { - m["message_type"] = *d.MessageType - } - if d.EventSource != nil { - m["event_source"] = *d.EventSource - } - if d.MaximumExecutionFrequency != nil { - m["maximum_execution_frequency"] = *d.MaximumExecutionFrequency - } - - items = append(items, m) - } - - return items -} - -func expandConfigRuleSource(configured []interface{}) *configservice.Source { - cfg := configured[0].(map[string]interface{}) - source := configservice.Source{ - Owner: aws.String(cfg["owner"].(string)), - SourceIdentifier: aws.String(cfg["source_identifier"].(string)), - } - if details, ok := cfg["source_detail"]; ok { - source.SourceDetails = expandConfigRuleSourceDetails(details.(*schema.Set)) - } - return &source -} - -func expandConfigRuleSourceDetails(configured *schema.Set) []*configservice.SourceDetail { - var results []*configservice.SourceDetail - - for _, item := range configured.List() { - detail := item.(map[string]interface{}) - src := configservice.SourceDetail{} - - if msgType, ok := detail["message_type"].(string); ok && msgType != "" { - src.MessageType = aws.String(msgType) - } - if eventSource, ok := detail["event_source"].(string); ok && eventSource != "" { - src.EventSource = aws.String(eventSource) - } - if maxExecFreq, ok := detail["maximum_execution_frequency"].(string); ok && maxExecFreq != "" { - src.MaximumExecutionFrequency = aws.String(maxExecFreq) - } - - results = append(results, &src) - } - - return results -} - -func flattenConfigRuleScope(scope *configservice.Scope) []interface{} { - var items []interface{} - - m := make(map[string]interface{}) - if scope.ComplianceResourceId != nil { - m["compliance_resource_id"] = *scope.ComplianceResourceId - } - if scope.ComplianceResourceTypes != nil { - m["compliance_resource_types"] = schema.NewSet(schema.HashString, flattenStringList(scope.ComplianceResourceTypes)) - } - if scope.TagKey != nil { - m["tag_key"] = *scope.TagKey - } - if scope.TagValue != nil { - m["tag_value"] = *scope.TagValue - } - - items = append(items, m) - return items -} - -func expandConfigRuleScope(configured map[string]interface{}) *configservice.Scope { - scope := &configservice.Scope{} - - if v, ok := configured["compliance_resource_id"].(string); ok && v != "" { - scope.ComplianceResourceId = aws.String(v) - } - if v, ok := configured["compliance_resource_types"]; ok { - l := v.(*schema.Set) - if l.Len() > 0 { - scope.ComplianceResourceTypes = expandStringList(l.List()) - } - } - if v, ok := configured["tag_key"].(string); ok && v != "" { - scope.TagKey = aws.String(v) - } - if v, ok := configured["tag_value"].(string); ok && v != "" { - scope.TagValue = aws.String(v) - } - - return scope -} - -// Takes a value containing JSON string and passes it through -// the JSON parser to normalize it, returns either a parsing -// error or normalized JSON string. -func normalizeJsonString(jsonString interface{}) (string, error) { - var j interface{} - - if jsonString == nil || jsonString.(string) == "" { - return "", nil - } - - s := jsonString.(string) - - err := json.Unmarshal([]byte(s), &j) - if err != nil { - return s, err - } - - bytes, _ := json.Marshal(j) - return string(bytes[:]), nil -} - -// Takes a value containing YAML string and passes it through -// the YAML parser. Returns either a parsing -// error or original YAML string. -func checkYamlString(yamlString interface{}) (string, error) { - var y interface{} - - if yamlString == nil || yamlString.(string) == "" { - return "", nil - } - - s := yamlString.(string) - - err := yaml.Unmarshal([]byte(s), &y) - if err != nil { - return s, err - } - - return s, nil -} - -func normalizeCloudFormationTemplate(templateString interface{}) (string, error) { - if looksLikeJsonString(templateString) { - return normalizeJsonString(templateString) - } else { - return checkYamlString(templateString) - } -} - -func flattenInspectorTags(cfTags []*cloudformation.Tag) map[string]string { - tags := make(map[string]string, len(cfTags)) - for _, t := range cfTags { - tags[*t.Key] = *t.Value - } - return tags -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags.go deleted file mode 100644 index 90fda01..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags.go +++ /dev/null @@ -1,350 +0,0 @@ -package aws - -import ( - "log" - "regexp" - "strings" - "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/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/helper/schema" -) - -// tagsSchema returns the schema to use for tags. -// -func tagsSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - } -} - -func tagsSchemaComputed() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - Computed: true, - } -} - -func setElbV2Tags(conn *elbv2.ELBV2, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffElbV2Tags(tagsFromMapELBv2(o), tagsFromMapELBv2(n)) - - // Set tags - if len(remove) > 0 { - var tagKeys []*string - for _, tag := range remove { - tagKeys = append(tagKeys, tag.Key) - } - log.Printf("[DEBUG] Removing tags: %#v from %s", remove, d.Id()) - _, err := conn.RemoveTags(&elbv2.RemoveTagsInput{ - ResourceArns: []*string{aws.String(d.Id())}, - TagKeys: tagKeys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %s for %s", create, d.Id()) - _, err := conn.AddTags(&elbv2.AddTagsInput{ - ResourceArns: []*string{aws.String(d.Id())}, - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTags(conn *ec2.EC2, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTags(tagsFromMap(o), tagsFromMap(n)) - - // Set tags - if len(remove) > 0 { - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Removing tags: %#v from %s", remove, d.Id()) - _, err := conn.DeleteTags(&ec2.DeleteTagsInput{ - Resources: []*string{aws.String(d.Id())}, - Tags: remove, - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && strings.Contains(ec2err.Code(), ".NotFound") { - return resource.RetryableError(err) // retry - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return err - } - } - if len(create) > 0 { - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Creating tags: %s for %s", create, d.Id()) - _, err := conn.CreateTags(&ec2.CreateTagsInput{ - Resources: []*string{aws.String(d.Id())}, - Tags: create, - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && strings.Contains(ec2err.Code(), ".NotFound") { - return resource.RetryableError(err) // retry - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTags(oldTags, newTags []*ec2.Tag) ([]*ec2.Tag, []*ec2.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*ec2.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - remove = append(remove, t) - } - } - - return tagsFromMap(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMap(m map[string]interface{}) []*ec2.Tag { - result := make([]*ec2.Tag, 0, len(m)) - for k, v := range m { - t := &ec2.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnored(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMap(ts []*ec2.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnored(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -func diffElbV2Tags(oldTags, newTags []*elbv2.Tag) ([]*elbv2.Tag, []*elbv2.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*elbv2.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapELBv2(create), remove -} - -// tagsToMapELBv2 turns the list of tags into a map. -func tagsToMapELBv2(ts []*elbv2.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredELBv2(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// tagsFromMapELBv2 returns the tags for the given map of data. -func tagsFromMapELBv2(m map[string]interface{}) []*elbv2.Tag { - var result []*elbv2.Tag - for k, v := range m { - t := &elbv2.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredELBv2(t) { - result = append(result, t) - } - } - - return result -} - -// tagIgnored compares a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnored(t *ec2.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} - -// and for ELBv2 as well -func tagIgnoredELBv2(t *elbv2.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} - -// tagsToMapDynamoDb turns the list of tags into a map for dynamoDB -func tagsToMapDynamoDb(ts []*dynamodb.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - result[*t.Key] = *t.Value - } - return result -} - -// tagsFromMapDynamoDb returns the tags for a given map -func tagsFromMapDynamoDb(m map[string]interface{}) []*dynamodb.Tag { - result := make([]*dynamodb.Tag, 0, len(m)) - for k, v := range m { - t := &dynamodb.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - result = append(result, t) - } - return result -} - -// setTagsDynamoDb is a helper to set the tags for a dynamoDB resource -// This is needed because dynamodb requires a completely different set and delete -// method from the ec2 tag resource handling. Also the `UntagResource` method -// for dynamoDB only requires a list of tag keys, instead of the full map of keys. -func setTagsDynamoDb(conn *dynamodb.DynamoDB, d *schema.ResourceData) error { - if d.HasChange("tags") { - arn := d.Get("arn").(string) - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsDynamoDb(tagsFromMapDynamoDb(o), tagsFromMapDynamoDb(n)) - - // Set tags - if len(remove) > 0 { - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Removing tags: %#v from %s", remove, d.Id()) - _, err := conn.UntagResource(&dynamodb.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: remove, - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && strings.Contains(ec2err.Code(), "ResourceNotFoundException") { - return resource.RetryableError(err) // retry - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return err - } - } - if len(create) > 0 { - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Creating tags: %s for %s", create, d.Id()) - _, err := conn.TagResource(&dynamodb.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: create, - }) - if err != nil { - ec2err, ok := err.(awserr.Error) - if ok && strings.Contains(ec2err.Code(), "ResourceNotFoundException") { - return resource.RetryableError(err) // retry - } - return resource.NonRetryableError(err) - } - return nil - }) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTagsDynamoDb takes a local set of dynamodb tags and the ones found remotely -// and returns the set of tags that must be created as a map, and returns a list of tag keys -// that must be destroyed. -func diffTagsDynamoDb(oldTags, newTags []*dynamodb.Tag) ([]*dynamodb.Tag, []*string) { - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - var remove []*string - for _, t := range oldTags { - // Verify the old tag is not a tag we're currently attempting to create - old, ok := create[*t.Key] - if !ok || old != *t.Value { - remove = append(remove, t.Key) - } - } - return tagsFromMapDynamoDb(create), remove -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsBeanstalk.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsBeanstalk.go deleted file mode 100644 index c3b7b95..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsBeanstalk.go +++ /dev/null @@ -1,74 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" -) - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsBeanstalk(oldTags, newTags []*elasticbeanstalk.Tag) ([]*elasticbeanstalk.Tag, []*elasticbeanstalk.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*elasticbeanstalk.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapBeanstalk(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapBeanstalk(m map[string]interface{}) []*elasticbeanstalk.Tag { - var result []*elasticbeanstalk.Tag - for k, v := range m { - t := &elasticbeanstalk.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredBeanstalk(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapBeanstalk(ts []*elasticbeanstalk.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredBeanstalk(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredBeanstalk(t *elasticbeanstalk.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCloudFront.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCloudFront.go deleted file mode 100644 index d2b60c7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCloudFront.go +++ /dev/null @@ -1,98 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/terraform/helper/schema" -) - -func setTagsCloudFront(conn *cloudfront.CloudFront, d *schema.ResourceData, arn string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsCloudFront(tagsFromMapCloudFront(o), tagsFromMapCloudFront(n)) - - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - k := make([]*string, 0, len(remove)) - for _, t := range remove { - k = append(k, t.Key) - } - - _, err := conn.UntagResource(&cloudfront.UntagResourceInput{ - Resource: aws.String(arn), - TagKeys: &cloudfront.TagKeys{ - Items: k, - }, - }) - if err != nil { - return err - } - } - - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %s", create) - _, err := conn.TagResource(&cloudfront.TagResourceInput{ - Resource: aws.String(arn), - Tags: &cloudfront.Tags{ - Items: create, - }, - }) - if err != nil { - return err - } - } - - } - - return nil -} -func diffTagsCloudFront(oldTags, newTags *cloudfront.Tags) ([]*cloudfront.Tag, []*cloudfront.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags.Items { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*cloudfront.Tag - for _, t := range oldTags.Items { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - createTags := tagsFromMapCloudFront(create) - return createTags.Items, remove -} - -func tagsFromMapCloudFront(m map[string]interface{}) *cloudfront.Tags { - result := make([]*cloudfront.Tag, 0, len(m)) - for k, v := range m { - result = append(result, &cloudfront.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - - tags := &cloudfront.Tags{ - Items: result, - } - - return tags -} - -func tagsToMapCloudFront(ts *cloudfront.Tags) map[string]string { - result := make(map[string]string) - - for _, t := range ts.Items { - result[*t.Key] = *t.Value - } - - return result -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCloudtrail.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCloudtrail.go deleted file mode 100644 index 020a6ea..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCloudtrail.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudtrail" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsCloudtrail(conn *cloudtrail.CloudTrail, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsCloudtrail(tagsFromMapCloudtrail(o), tagsFromMapCloudtrail(n)) - - // Set tags - if len(remove) > 0 { - input := cloudtrail.RemoveTagsInput{ - ResourceId: aws.String(d.Get("arn").(string)), - TagsList: remove, - } - log.Printf("[DEBUG] Removing CloudTrail tags: %s", input) - _, err := conn.RemoveTags(&input) - if err != nil { - return err - } - } - if len(create) > 0 { - input := cloudtrail.AddTagsInput{ - ResourceId: aws.String(d.Get("arn").(string)), - TagsList: create, - } - log.Printf("[DEBUG] Adding CloudTrail tags: %s", input) - _, err := conn.AddTags(&input) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsCloudtrail(oldTags, newTags []*cloudtrail.Tag) ([]*cloudtrail.Tag, []*cloudtrail.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*cloudtrail.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapCloudtrail(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapCloudtrail(m map[string]interface{}) []*cloudtrail.Tag { - var result []*cloudtrail.Tag - for k, v := range m { - t := &cloudtrail.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredCloudtrail(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapCloudtrail(ts []*cloudtrail.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredCloudtrail(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredCloudtrail(t *cloudtrail.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCodeBuild.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCodeBuild.go deleted file mode 100644 index e28fc21..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsCodeBuild.go +++ /dev/null @@ -1,67 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codebuild" -) - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsCodeBuild(oldTags, newTags []*codebuild.Tag) ([]*codebuild.Tag, []*codebuild.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*codebuild.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapCodeBuild(create), remove -} - -func tagsFromMapCodeBuild(m map[string]interface{}) []*codebuild.Tag { - result := []*codebuild.Tag{} - for k, v := range m { - result = append(result, &codebuild.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - - return result -} - -func tagsToMapCodeBuild(ts []*codebuild.Tag) map[string]string { - result := map[string]string{} - for _, t := range ts { - result[*t.Key] = *t.Value - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredCodeBuild(t *codebuild.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsEC.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsEC.go deleted file mode 100644 index 6b29057..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsEC.go +++ /dev/null @@ -1,115 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsEC(conn *elasticache.ElastiCache, d *schema.ResourceData, arn string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsEC(tagsFromMapEC(o), tagsFromMapEC(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove), len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.RemoveTagsFromResource(&elasticache.RemoveTagsFromResourceInput{ - ResourceName: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.AddTagsToResource(&elasticache.AddTagsToResourceInput{ - ResourceName: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsEC(oldTags, newTags []*elasticache.Tag) ([]*elasticache.Tag, []*elasticache.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*elasticache.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapEC(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapEC(m map[string]interface{}) []*elasticache.Tag { - result := make([]*elasticache.Tag, 0, len(m)) - for k, v := range m { - t := &elasticache.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredEC(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapEC(ts []*elasticache.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredEC(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredEC(t *elasticache.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsEFS.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsEFS.go deleted file mode 100644 index 2dc6189..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsEFS.go +++ /dev/null @@ -1,114 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/efs" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsEFS(conn *efs.EFS, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsEFS(tagsFromMapEFS(o), tagsFromMapEFS(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, 0, len(remove)) - for _, t := range remove { - k = append(k, t.Key) - } - _, err := conn.DeleteTags(&efs.DeleteTagsInput{ - FileSystemId: aws.String(d.Id()), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.CreateTags(&efs.CreateTagsInput{ - FileSystemId: aws.String(d.Id()), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsEFS(oldTags, newTags []*efs.Tag) ([]*efs.Tag, []*efs.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*efs.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapEFS(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapEFS(m map[string]interface{}) []*efs.Tag { - var result []*efs.Tag - for k, v := range m { - t := &efs.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredEFS(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapEFS(ts []*efs.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredEFS(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredEFS(t *efs.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsELB.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsELB.go deleted file mode 100644 index 4c177b8..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsELB.go +++ /dev/null @@ -1,114 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsELB(conn *elb.ELB, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsELB(tagsFromMapELB(o), tagsFromMapELB(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*elb.TagKeyOnly, 0, len(remove)) - for _, t := range remove { - k = append(k, &elb.TagKeyOnly{Key: t.Key}) - } - _, err := conn.RemoveTags(&elb.RemoveTagsInput{ - LoadBalancerNames: []*string{aws.String(d.Get("name").(string))}, - Tags: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.AddTags(&elb.AddTagsInput{ - LoadBalancerNames: []*string{aws.String(d.Get("name").(string))}, - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsELB(oldTags, newTags []*elb.Tag) ([]*elb.Tag, []*elb.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*elb.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapELB(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapELB(m map[string]interface{}) []*elb.Tag { - var result []*elb.Tag - for k, v := range m { - t := &elb.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredELB(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapELB(ts []*elb.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredELB(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredELB(t *elb.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsInspector.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsInspector.go deleted file mode 100644 index f846319..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsInspector.go +++ /dev/null @@ -1,74 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/inspector" -) - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsInspector(oldTags, newTags []*inspector.ResourceGroupTag) ([]*inspector.ResourceGroupTag, []*inspector.ResourceGroupTag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*inspector.ResourceGroupTag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapInspector(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapInspector(m map[string]interface{}) []*inspector.ResourceGroupTag { - var result []*inspector.ResourceGroupTag - for k, v := range m { - t := &inspector.ResourceGroupTag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredInspector(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapInspector(ts []*inspector.ResourceGroupTag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredInspector(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredInspector(t *inspector.ResourceGroupTag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsRDS.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsRDS.go deleted file mode 100644 index 1a5b0c1..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsRDS.go +++ /dev/null @@ -1,133 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsRDS(conn *rds.RDS, d *schema.ResourceData, arn string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsRDS(tagsFromMapRDS(o), tagsFromMapRDS(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - k := make([]*string, len(remove), len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.RemoveTagsFromResource(&rds.RemoveTagsFromResourceInput{ - ResourceName: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %s", create) - _, err := conn.AddTagsToResource(&rds.AddTagsToResourceInput{ - ResourceName: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsRDS(oldTags, newTags []*rds.Tag) ([]*rds.Tag, []*rds.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*rds.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapRDS(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapRDS(m map[string]interface{}) []*rds.Tag { - result := make([]*rds.Tag, 0, len(m)) - for k, v := range m { - t := &rds.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredRDS(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapRDS(ts []*rds.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredRDS(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -func saveTagsRDS(conn *rds.RDS, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - return fmt.Errorf("[DEBUG] Error retreiving tags for ARN: %s", arn) - } - - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - - return d.Set("tags", tagsToMapRDS(dt)) -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredRDS(t *rds.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsRedshift.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsRedshift.go deleted file mode 100644 index 0a87f71..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tagsRedshift.go +++ /dev/null @@ -1,108 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/hashicorp/terraform/helper/schema" -) - -func setTagsRedshift(conn *redshift.Redshift, d *schema.ResourceData, arn string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsRedshift(tagsFromMapRedshift(o), tagsFromMapRedshift(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove), len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.DeleteTags(&redshift.DeleteTagsInput{ - ResourceName: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.CreateTags(&redshift.CreateTagsInput{ - ResourceName: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -func diffTagsRedshift(oldTags, newTags []*redshift.Tag) ([]*redshift.Tag, []*redshift.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*redshift.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapRedshift(create), remove -} - -func tagsFromMapRedshift(m map[string]interface{}) []*redshift.Tag { - result := make([]*redshift.Tag, 0, len(m)) - for k, v := range m { - t := &redshift.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredRedshift(t) { - result = append(result, t) - } - } - - return result -} - -func tagsToMapRedshift(ts []*redshift.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredRedshift(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredRedshift(t *redshift.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_dms.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_dms.go deleted file mode 100644 index c880500..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_dms.go +++ /dev/null @@ -1,91 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - "github.com/hashicorp/terraform/helper/schema" -) - -func dmsTagsToMap(tags []*dms.Tag) map[string]string { - result := make(map[string]string) - - for _, tag := range tags { - result[*tag.Key] = *tag.Value - } - - return result -} - -func dmsTagsFromMap(m map[string]interface{}) []*dms.Tag { - result := make([]*dms.Tag, 0, len(m)) - - for k, v := range m { - result = append(result, &dms.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - - return result -} - -func dmsDiffTags(oldTags, newTags []*dms.Tag) ([]*dms.Tag, []*dms.Tag) { - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - remove := []*dms.Tag{} - for _, t := range oldTags { - v, ok := create[*t.Key] - if !ok || v != *t.Value { - remove = append(remove, t) - } - } - - return dmsTagsFromMap(create), remove -} - -func dmsGetTagKeys(tags []*dms.Tag) []*string { - keys := []*string{} - - for _, tag := range tags { - keys = append(keys, tag.Key) - } - - return keys -} - -func dmsSetTags(arn string, d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dmsconn - - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - - add, remove := dmsDiffTags(dmsTagsFromMap(o), dmsTagsFromMap(n)) - - if len(remove) > 0 { - _, err := conn.RemoveTagsFromResource(&dms.RemoveTagsFromResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: dmsGetTagKeys(remove), - }) - if err != nil { - return err - } - } - - if len(add) > 0 { - _, err := conn.AddTagsToResource(&dms.AddTagsToResourceInput{ - ResourceArn: aws.String(arn), - Tags: add, - }) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_elasticsearchservice.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_elasticsearchservice.go deleted file mode 100644 index f048e46..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_elasticsearchservice.go +++ /dev/null @@ -1,114 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsElasticsearchService(conn *elasticsearch.ElasticsearchService, d *schema.ResourceData, arn string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsElasticsearchService(tagsFromMapElasticsearchService(o), tagsFromMapElasticsearchService(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, 0, len(remove)) - for _, t := range remove { - k = append(k, t.Key) - } - _, err := conn.RemoveTags(&elasticsearch.RemoveTagsInput{ - ARN: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.AddTags(&elasticsearch.AddTagsInput{ - ARN: aws.String(arn), - TagList: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsElasticsearchService(oldTags, newTags []*elasticsearch.Tag) ([]*elasticsearch.Tag, []*elasticsearch.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*elasticsearch.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapElasticsearchService(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapElasticsearchService(m map[string]interface{}) []*elasticsearch.Tag { - var result []*elasticsearch.Tag - for k, v := range m { - t := &elasticsearch.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredElasticsearchService(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapElasticsearchService(ts []*elasticsearch.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredElasticsearchService(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredElasticsearchService(t *elasticsearch.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_kinesis.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_kinesis.go deleted file mode 100644 index 5c59359..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_kinesis.go +++ /dev/null @@ -1,125 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kinesis" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsKinesis(conn *kinesis.Kinesis, d *schema.ResourceData) error { - - sn := d.Get("name").(string) - - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsKinesis(tagsFromMapKinesis(o), tagsFromMapKinesis(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove), len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.RemoveTagsFromStream(&kinesis.RemoveTagsFromStreamInput{ - StreamName: aws.String(sn), - TagKeys: k, - }) - if err != nil { - return err - } - } - - if len(create) > 0 { - - log.Printf("[DEBUG] Creating tags: %#v", create) - t := make(map[string]*string) - for _, tag := range create { - t[*tag.Key] = tag.Value - } - - _, err := conn.AddTagsToStream(&kinesis.AddTagsToStreamInput{ - StreamName: aws.String(sn), - Tags: t, - }) - if err != nil { - return err - } - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsKinesis(oldTags, newTags []*kinesis.Tag) ([]*kinesis.Tag, []*kinesis.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*kinesis.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapKinesis(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapKinesis(m map[string]interface{}) []*kinesis.Tag { - var result []*kinesis.Tag - for k, v := range m { - t := &kinesis.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredKinesis(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapKinesis(ts []*kinesis.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredKinesis(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredKinesis(t *kinesis.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_route53.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_route53.go deleted file mode 100644 index d675f42..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/tags_route53.go +++ /dev/null @@ -1,111 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/hashicorp/terraform/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsR53(conn *route53.Route53, d *schema.ResourceData, resourceType string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsR53(tagsFromMapR53(o), tagsFromMapR53(n)) - - // Set tags - r := make([]*string, len(remove)) - for i, t := range remove { - r[i] = t.Key - } - log.Printf("[DEBUG] Changing tags: \n\tadding: %#v\n\tremoving:%#v", create, remove) - req := &route53.ChangeTagsForResourceInput{ - ResourceId: aws.String(d.Id()), - ResourceType: aws.String(resourceType), - } - - if len(create) > 0 { - req.AddTags = create - } - if len(r) > 0 { - req.RemoveTagKeys = r - } - - _, err := conn.ChangeTagsForResource(req) - if err != nil { - return err - } - } - - return nil -} - -// diffTags takes our tags locally and the ones remotely and returns -// the set of tags that must be created, and the set of tags that must -// be destroyed. -func diffTagsR53(oldTags, newTags []*route53.Tag) ([]*route53.Tag, []*route53.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - // Build the list of what to remove - var remove []*route53.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapR53(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapR53(m map[string]interface{}) []*route53.Tag { - result := make([]*route53.Tag, 0, len(m)) - for k, v := range m { - t := &route53.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredRoute53(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapR53(ts []*route53.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredRoute53(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredRoute53(t *route53.Tag) bool { - filter := []string{"^aws:*"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - if r, _ := regexp.MatchString(v, *t.Key); r == true { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/utils.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/utils.go deleted file mode 100644 index bfca044..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/utils.go +++ /dev/null @@ -1,42 +0,0 @@ -package aws - -import ( - "encoding/base64" - "encoding/json" - "reflect" - "regexp" -) - -// Base64Encode encodes data if the input isn't already encoded using base64.StdEncoding.EncodeToString. -// If the input is already base64 encoded, return the original input unchanged. -func base64Encode(data []byte) string { - // Check whether the data is already Base64 encoded; don't double-encode - if isBase64Encoded(data) { - return string(data) - } - // data has not been encoded encode and return - return base64.StdEncoding.EncodeToString(data) -} - -func isBase64Encoded(data []byte) bool { - _, err := base64.StdEncoding.DecodeString(string(data)) - return err == nil -} - -func looksLikeJsonString(s interface{}) bool { - return regexp.MustCompile(`^\s*{`).MatchString(s.(string)) -} - -func jsonBytesEqual(b1, b2 []byte) bool { - var o1 interface{} - if err := json.Unmarshal(b1, &o1); err != nil { - return false - } - - var o2 interface{} - if err := json.Unmarshal(b2, &o2); err != nil { - return false - } - - return reflect.DeepEqual(o1, o2) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/validators.go b/vendor/github.com/hashicorp/terraform/builtin/providers/aws/validators.go deleted file mode 100644 index f7a600c..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/aws/validators.go +++ /dev/null @@ -1,951 +0,0 @@ -package aws - -import ( - "fmt" - "net" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform/helper/schema" -) - -func validateRdsId(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9a-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters and hyphens allowed in %q", k)) - } - if !regexp.MustCompile(`^[a-z]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot end with a hyphen", k)) - } - return -} - -func validateElastiCacheClusterId(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if (len(value) < 1) || (len(value) > 20) { - errors = append(errors, fmt.Errorf( - "%q (%q) must contain from 1 to 20 alphanumeric characters or hyphens", k, value)) - } - if !regexp.MustCompile(`^[0-9a-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters and hyphens allowed in %q (%q)", k, value)) - } - if !regexp.MustCompile(`^[a-z]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q (%q) must be a letter", k, value)) - } - if regexp.MustCompile(`--`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q (%q) cannot contain two consecutive hyphens", k, value)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q (%q) cannot end with a hyphen", k, value)) - } - return -} - -func validateASGScheduleTimestamp(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - _, err := time.Parse(awsAutoscalingScheduleTimeLayout, value) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q cannot be parsed as iso8601 Timestamp Format", value)) - } - - return -} - -// validateTagFilters confirms the "value" component of a tag filter is one of -// AWS's three allowed types. -func validateTagFilters(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "KEY_ONLY" && value != "VALUE_ONLY" && value != "KEY_AND_VALUE" { - errors = append(errors, fmt.Errorf( - "%q must be one of \"KEY_ONLY\", \"VALUE_ONLY\", or \"KEY_AND_VALUE\"", k)) - } - return -} - -func validateDbParamGroupName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9a-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only lowercase alphanumeric characters and hyphens allowed in %q", k)) - } - if !regexp.MustCompile(`^[a-z]`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "first character of %q must be a letter", k)) - } - if regexp.MustCompile(`--`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot contain two consecutive hyphens", k)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot end with a hyphen", k)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be greater than 255 characters", k)) - } - return - -} - -func validateStreamViewType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - viewTypes := map[string]bool{ - "KEYS_ONLY": true, - "NEW_IMAGE": true, - "OLD_IMAGE": true, - "NEW_AND_OLD_IMAGES": true, - } - - if !viewTypes[value] { - errors = append(errors, fmt.Errorf("%q be a valid DynamoDB StreamViewType", k)) - } - return -} - -func validateElbName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q: %q", - k, value)) - } - if len(value) > 32 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 32 characters: %q", k, value)) - } - if regexp.MustCompile(`^-`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot begin with a hyphen: %q", k, value)) - } - if regexp.MustCompile(`-$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q cannot end with a hyphen: %q", k, value)) - } - return - -} - -func validateEcrRepositoryName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) < 2 { - errors = append(errors, fmt.Errorf( - "%q must be at least 2 characters long: %q", k, value)) - } - if len(value) > 256 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 256 characters: %q", k, value)) - } - - // http://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_CreateRepository.html - pattern := `^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't comply with restrictions (%q): %q", - k, pattern, value)) - } - - return -} - -func validateCloudWatchEventRuleName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 64 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 64 characters: %q", k, value)) - } - - // http://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_PutRule.html - pattern := `^[\.\-_A-Za-z0-9]+$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't comply with restrictions (%q): %q", - k, pattern, value)) - } - - return -} - -func validateMaxLength(length int) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > length { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than %d characters: %q", k, length, value)) - } - return - } -} - -func validateIntegerInRange(min, max int) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < min { - errors = append(errors, fmt.Errorf( - "%q cannot be lower than %d: %d", k, min, value)) - } - if value > max { - errors = append(errors, fmt.Errorf( - "%q cannot be higher than %d: %d", k, max, value)) - } - return - } -} - -func validateCloudWatchEventTargetId(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 64 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 64 characters: %q", k, value)) - } - - // http://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_Target.html - pattern := `^[\.\-_A-Za-z0-9]+$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't comply with restrictions (%q): %q", - k, pattern, value)) - } - - return -} - -func validateLambdaFunctionName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 140 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 140 characters: %q", k, value)) - } - // http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html - pattern := `^(arn:[\w-]+:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't comply with restrictions (%q): %q", - k, pattern, value)) - } - - return -} - -func validateLambdaQualifier(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 128 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 128 characters: %q", k, value)) - } - // http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html - pattern := `^[a-zA-Z0-9$_-]+$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't comply with restrictions (%q): %q", - k, pattern, value)) - } - - return -} - -func validateLambdaPermissionAction(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - // http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html - pattern := `^(lambda:[*]|lambda:[a-zA-Z]+|[*])$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't comply with restrictions (%q): %q", - k, pattern, value)) - } - - return -} - -func validateAwsAccountId(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - // http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html - pattern := `^\d{12}$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't look like AWS Account ID (exactly 12 digits): %q", - k, value)) - } - - return -} - -func validateArn(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if value == "" { - return - } - - // http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html - pattern := `^arn:[\w-]+:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't look like a valid ARN (%q): %q", - k, pattern, value)) - } - - return -} - -func validatePolicyStatementId(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if len(value) > 100 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 100 characters: %q", k, value)) - } - - // http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html - pattern := `^[a-zA-Z0-9-_]+$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q doesn't look like a valid statement ID (%q): %q", - k, pattern, value)) - } - - return -} - -// validateCIDRNetworkAddress ensures that the string value is a valid CIDR that -// represents a network address - it adds an error otherwise -func validateCIDRNetworkAddress(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - _, ipnet, err := net.ParseCIDR(value) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q must contain a valid CIDR, got error parsing: %s", k, err)) - return - } - - if ipnet == nil || value != ipnet.String() { - errors = append(errors, fmt.Errorf( - "%q must contain a valid network CIDR, expected %q, got %q", - k, ipnet, value)) - } - - return -} - -func validateHTTPMethod(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - validMethods := map[string]bool{ - "ANY": true, - "DELETE": true, - "GET": true, - "HEAD": true, - "OPTIONS": true, - "PATCH": true, - "POST": true, - "PUT": true, - } - - if _, ok := validMethods[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q contains an invalid method %q. Valid methods are either %q, %q, %q, %q, %q, %q, %q, or %q.", - k, value, "ANY", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT")) - } - return -} - -func validateLogMetricFilterName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if len(value) > 512 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 512 characters: %q", k, value)) - } - - // http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutMetricFilter.html - pattern := `^[^:*]+$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q isn't a valid log metric name (must not contain colon nor asterisk): %q", - k, value)) - } - - return -} - -func validateLogMetricFilterTransformationName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters: %q", k, value)) - } - - // http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_MetricTransformation.html - pattern := `^[^:*$]*$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q isn't a valid log metric transformation name (must not contain"+ - " colon, asterisk nor dollar sign): %q", - k, value)) - } - - return -} - -func validateLogGroupName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if len(value) > 512 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 512 characters: %q", k, value)) - } - - // http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html - pattern := `^[\.\-_/#A-Za-z0-9]+$` - if !regexp.MustCompile(pattern).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q isn't a valid log group name (alphanumeric characters, underscores,"+ - " hyphens, slashes, hash signs and dots are allowed): %q", - k, value)) - } - - return -} - -func validateS3BucketLifecycleTimestamp(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - _, err := time.Parse(time.RFC3339, fmt.Sprintf("%sT00:00:00Z", value)) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q cannot be parsed as RFC3339 Timestamp Format", value)) - } - - return -} - -func validateS3BucketLifecycleStorageClass(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != s3.TransitionStorageClassStandardIa && value != s3.TransitionStorageClassGlacier { - errors = append(errors, fmt.Errorf( - "%q must be one of '%q', '%q'", k, s3.TransitionStorageClassStandardIa, s3.TransitionStorageClassGlacier)) - } - - return -} - -func validateS3BucketReplicationRuleId(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters: %q", k, value)) - } - - return -} - -func validateS3BucketReplicationRulePrefix(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 1024 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 1024 characters: %q", k, value)) - } - - return -} - -func validateS3BucketReplicationDestinationStorageClass(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != s3.StorageClassStandard && value != s3.StorageClassStandardIa && value != s3.StorageClassReducedRedundancy { - errors = append(errors, fmt.Errorf( - "%q must be one of '%q', '%q' or '%q'", k, s3.StorageClassStandard, s3.StorageClassStandardIa, s3.StorageClassReducedRedundancy)) - } - - return -} - -func validateS3BucketReplicationRuleStatus(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != s3.ReplicationRuleStatusEnabled && value != s3.ReplicationRuleStatusDisabled { - errors = append(errors, fmt.Errorf( - "%q must be one of '%q' or '%q'", k, s3.ReplicationRuleStatusEnabled, s3.ReplicationRuleStatusDisabled)) - } - - return -} - -func validateS3BucketLifecycleRuleId(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot exceed 255 characters", k)) - } - return -} - -func validateDbEventSubscriptionName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "only alphanumeric characters and hyphens allowed in %q", k)) - } - if len(value) > 255 { - errors = append(errors, fmt.Errorf( - "%q cannot be longer than 255 characters", k)) - } - return -} - -func validateApiGatewayIntegrationPassthroughBehavior(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if value != "WHEN_NO_MATCH" && value != "WHEN_NO_TEMPLATES" && value != "NEVER" { - errors = append(errors, fmt.Errorf( - "%q must be one of 'WHEN_NO_MATCH', 'WHEN_NO_TEMPLATES', 'NEVER'", k)) - } - return -} - -func validateJsonString(v interface{}, k string) (ws []string, errors []error) { - if _, err := normalizeJsonString(v); err != nil { - errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) - } - return -} - -func validateCloudFormationTemplate(v interface{}, k string) (ws []string, errors []error) { - if looksLikeJsonString(v) { - if _, err := normalizeJsonString(v); err != nil { - errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) - } - } else { - if _, err := checkYamlString(v); err != nil { - errors = append(errors, fmt.Errorf("%q contains an invalid YAML: %s", k, err)) - } - } - return -} - -func validateApiGatewayIntegrationType(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - validTypes := map[string]bool{ - "AWS": true, - "AWS_PROXY": true, - "HTTP": true, - "HTTP_PROXY": true, - "MOCK": true, - } - - if _, ok := validTypes[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q contains an invalid integration type %q. Valid types are either %q, %q, %q, %q, or %q.", - k, value, "AWS", "AWS_PROXY", "HTTP", "HTTP_PROXY", "MOCK")) - } - return -} - -func validateApiGatewayIntegrationContentHandling(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - validTypes := map[string]bool{ - "CONVERT_TO_BINARY": true, - "CONVERT_TO_TEXT": true, - } - - if _, ok := validTypes[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q contains an invalid integration type %q. Valid types are either %q or %q.", - k, value, "CONVERT_TO_BINARY", "CONVERT_TO_TEXT")) - } - return -} - -func validateSQSQueueName(v interface{}, k string) (errors []error) { - value := v.(string) - if len(value) > 80 { - errors = append(errors, fmt.Errorf("%q cannot be longer than 80 characters", k)) - } - - if !regexp.MustCompile(`^[0-9A-Za-z-_]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf("only alphanumeric characters and hyphens allowed in %q", k)) - } - return -} - -func validateSQSFifoQueueName(v interface{}, k string) (errors []error) { - value := v.(string) - - if len(value) > 80 { - errors = append(errors, fmt.Errorf("%q cannot be longer than 80 characters", k)) - } - - if !regexp.MustCompile(`^[0-9A-Za-z-_.]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf("only alphanumeric characters and hyphens allowed in %q", k)) - } - - if regexp.MustCompile(`^[^a-zA-Z0-9-_]`).MatchString(value) { - errors = append(errors, fmt.Errorf("FIFO queue name must start with one of these characters [a-zA-Z0-9-_]: %v", value)) - } - - if !regexp.MustCompile(`\.fifo$`).MatchString(value) { - errors = append(errors, fmt.Errorf("FIFO queue name should ends with \".fifo\": %v", value)) - } - - return -} - -func validateSNSSubscriptionProtocol(v interface{}, k string) (ws []string, errors []error) { - value := strings.ToLower(v.(string)) - forbidden := []string{"email", "sms"} - for _, f := range forbidden { - if strings.Contains(value, f) { - errors = append( - errors, - fmt.Errorf("Unsupported protocol (%s) for SNS Topic", value), - ) - } - } - return -} - -func validateSecurityRuleType(v interface{}, k string) (ws []string, errors []error) { - value := strings.ToLower(v.(string)) - - validTypes := map[string]bool{ - "ingress": true, - "egress": true, - } - - if _, ok := validTypes[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q contains an invalid Security Group Rule type %q. Valid types are either %q or %q.", - k, value, "ingress", "egress")) - } - return -} - -func validateOnceAWeekWindowFormat(v interface{}, k string) (ws []string, errors []error) { - // valid time format is "ddd:hh24:mi" - validTimeFormat := "(sun|mon|tue|wed|thu|fri|sat):([0-1][0-9]|2[0-3]):([0-5][0-9])" - validTimeFormatConsolidated := "^(" + validTimeFormat + "-" + validTimeFormat + "|)$" - - value := strings.ToLower(v.(string)) - if !regexp.MustCompile(validTimeFormatConsolidated).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must satisfy the format of \"ddd:hh24:mi-ddd:hh24:mi\".", k)) - } - return -} - -func validateOnceADayWindowFormat(v interface{}, k string) (ws []string, errors []error) { - // valid time format is "hh24:mi" - validTimeFormat := "([0-1][0-9]|2[0-3]):([0-5][0-9])" - validTimeFormatConsolidated := "^(" + validTimeFormat + "-" + validTimeFormat + "|)$" - - value := v.(string) - if !regexp.MustCompile(validTimeFormatConsolidated).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must satisfy the format of \"hh24:mi-hh24:mi\".", k)) - } - return -} - -func validateRoute53RecordType(v interface{}, k string) (ws []string, errors []error) { - // Valid Record types - // SOA, A, TXT, NS, CNAME, MX, NAPTR, PTR, SRV, SPF, AAAA - validTypes := map[string]struct{}{ - "SOA": {}, - "A": {}, - "TXT": {}, - "NS": {}, - "CNAME": {}, - "MX": {}, - "NAPTR": {}, - "PTR": {}, - "SRV": {}, - "SPF": {}, - "AAAA": {}, - } - - value := v.(string) - if _, ok := validTypes[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q must be one of [SOA, A, TXT, NS, CNAME, MX, NAPTR, PTR, SRV, SPF, AAAA]", k)) - } - return -} - -// Validates that ECS Placement Constraints are set correctly -// Takes type, and expression as strings -func validateAwsEcsPlacementConstraint(constType, constExpr string) error { - switch constType { - case "distinctInstance": - // Expression can be nil for distinctInstance - return nil - case "memberOf": - if constExpr == "" { - return fmt.Errorf("Expression cannot be nil for 'memberOf' type") - } - default: - return fmt.Errorf("Unknown type provided: %q", constType) - } - return nil -} - -// Validates that an Ecs placement strategy is set correctly -// Takes type, and field as strings -func validateAwsEcsPlacementStrategy(stratType, stratField string) error { - switch stratType { - case "random": - // random does not need the field attribute set, could error, but it isn't read at the API level - return nil - case "spread": - // For the spread placement strategy, valid values are instanceId - // (or host, which has the same effect), or any platform or custom attribute - // that is applied to a container instance - // stratField is already cased to a string - return nil - case "binpack": - if stratField != "cpu" && stratField != "memory" { - return fmt.Errorf("Binpack type requires the field attribute to be either 'cpu' or 'memory'. Got: %s", - stratField) - } - default: - return fmt.Errorf("Unknown type %s. Must be one of 'random', 'spread', or 'binpack'.", stratType) - } - return nil -} - -func validateAwsEmrEbsVolumeType(v interface{}, k string) (ws []string, errors []error) { - validTypes := map[string]struct{}{ - "gp2": {}, - "io1": {}, - "standard": {}, - } - - value := v.(string) - - if _, ok := validTypes[value]; !ok { - errors = append(errors, fmt.Errorf( - "%q must be one of ['gp2', 'io1', 'standard']", k)) - } - return -} - -func validateSfnActivityName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 80 { - errors = append(errors, fmt.Errorf("%q cannot be longer than 80 characters", k)) - } - - return -} - -func validateSfnStateMachineDefinition(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 1048576 { - errors = append(errors, fmt.Errorf("%q cannot be longer than 1048576 characters", k)) - } - return -} - -func validateSfnStateMachineName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 80 { - errors = append(errors, fmt.Errorf("%q cannot be longer than 80 characters", k)) - } - - if !regexp.MustCompile(`^[a-zA-Z0-9-_]+$`).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q must be composed with only these characters [a-zA-Z0-9-_]: %v", k, value)) - } - return -} - -func validateDmsCertificateId(v interface{}, k string) (ws []string, es []error) { - val := v.(string) - - if len(val) > 255 { - es = append(es, fmt.Errorf("%q must not be longer than 255 characters", k)) - } - if !regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]+$").MatchString(val) { - es = append(es, fmt.Errorf("%q must start with a letter, only contain alphanumeric characters and hyphens", k)) - } - if strings.Contains(val, "--") { - es = append(es, fmt.Errorf("%q must not contain consecutive hyphens", k)) - } - if strings.HasSuffix(val, "-") { - es = append(es, fmt.Errorf("%q must not end in a hyphen", k)) - } - - return -} - -func validateDmsEndpointId(v interface{}, k string) (ws []string, es []error) { - val := v.(string) - - if len(val) > 255 { - es = append(es, fmt.Errorf("%q must not be longer than 255 characters", k)) - } - if !regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]+$").MatchString(val) { - es = append(es, fmt.Errorf("%q must start with a letter, only contain alphanumeric characters and hyphens", k)) - } - if strings.Contains(val, "--") { - es = append(es, fmt.Errorf("%q must not contain consecutive hyphens", k)) - } - if strings.HasSuffix(val, "-") { - es = append(es, fmt.Errorf("%q must not end in a hyphen", k)) - } - - return -} - -func validateDmsReplicationInstanceId(v interface{}, k string) (ws []string, es []error) { - val := v.(string) - - if len(val) > 63 { - es = append(es, fmt.Errorf("%q must not be longer than 63 characters", k)) - } - if !regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]+$").MatchString(val) { - es = append(es, fmt.Errorf("%q must start with a letter, only contain alphanumeric characters and hyphens", k)) - } - if strings.Contains(val, "--") { - es = append(es, fmt.Errorf("%q must not contain consecutive hyphens", k)) - } - if strings.HasSuffix(val, "-") { - es = append(es, fmt.Errorf("%q must not end in a hyphen", k)) - } - - return -} - -func validateDmsReplicationSubnetGroupId(v interface{}, k string) (ws []string, es []error) { - val := v.(string) - - if val == "default" { - es = append(es, fmt.Errorf("%q must not be default", k)) - } - if len(val) > 255 { - es = append(es, fmt.Errorf("%q must not be longer than 255 characters", k)) - } - if !regexp.MustCompile(`^[a-zA-Z0-9. _-]+$`).MatchString(val) { - es = append(es, fmt.Errorf("%q must only contain alphanumeric characters, periods, spaces, underscores and hyphens", k)) - } - - return -} - -func validateDmsReplicationTaskId(v interface{}, k string) (ws []string, es []error) { - val := v.(string) - - if len(val) > 255 { - es = append(es, fmt.Errorf("%q must not be longer than 255 characters", k)) - } - if !regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]+$").MatchString(val) { - es = append(es, fmt.Errorf("%q must start with a letter, only contain alphanumeric characters and hyphens", k)) - } - if strings.Contains(val, "--") { - es = append(es, fmt.Errorf("%q must not contain consecutive hyphens", k)) - } - if strings.HasSuffix(val, "-") { - es = append(es, fmt.Errorf("%q must not end in a hyphen", k)) - } - - return -} - -func validateAppautoscalingScalableDimension(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - dimensions := map[string]bool{ - "ecs:service:DesiredCount": true, - "ec2:spot-fleet-request:TargetCapacity": true, - } - - if !dimensions[value] { - errors = append(errors, fmt.Errorf("%q must be a valid scalable dimension value: %q", k, value)) - } - return -} - -func validateAppautoscalingServiceNamespace(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - namespaces := map[string]bool{ - "ecs": true, - "ec2": true, - } - - if !namespaces[value] { - errors = append(errors, fmt.Errorf("%q must be a valid service namespace value: %q", k, value)) - } - return -} - -func validateConfigRuleSourceOwner(v interface{}, k string) (ws []string, errors []error) { - validOwners := []string{ - "CUSTOM_LAMBDA", - "AWS", - } - owner := v.(string) - for _, o := range validOwners { - if owner == o { - return - } - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid owner %q. Valid owners are %q.", - k, owner, validOwners)) - return -} - -func validateConfigExecutionFrequency(v interface{}, k string) (ws []string, errors []error) { - validFrequencies := []string{ - "One_Hour", - "Three_Hours", - "Six_Hours", - "Twelve_Hours", - "TwentyFour_Hours", - } - frequency := v.(string) - for _, f := range validFrequencies { - if frequency == f { - return - } - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid freqency %q. Valid frequencies are %q.", - k, frequency, validFrequencies)) - return -} - -func validateAccountAlias(v interface{}, k string) (ws []string, es []error) { - val := v.(string) - - if (len(val) < 3) || (len(val) > 63) { - es = append(es, fmt.Errorf("%q must contain from 3 to 63 alphanumeric characters or hyphens", k)) - } - if !regexp.MustCompile("^[a-z0-9][a-z0-9-]+$").MatchString(val) { - es = append(es, fmt.Errorf("%q must start with an alphanumeric character and only contain lowercase alphanumeric characters and hyphens", k)) - } - if strings.Contains(val, "--") { - es = append(es, fmt.Errorf("%q must not contain consecutive hyphens", k)) - } - if strings.HasSuffix(val, "-") { - es = append(es, fmt.Errorf("%q must not end in a hyphen", k)) - } - - return -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/provider.go b/vendor/github.com/hashicorp/terraform/builtin/providers/tls/provider.go deleted file mode 100644 index e6c1d61..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/provider.go +++ /dev/null @@ -1,112 +0,0 @@ -package tls - -import ( - "crypto/sha1" - "crypto/x509/pkix" - "encoding/hex" - "strings" - - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/terraform" -) - -func Provider() terraform.ResourceProvider { - return &schema.Provider{ - ResourcesMap: map[string]*schema.Resource{ - "tls_private_key": resourcePrivateKey(), - "tls_locally_signed_cert": resourceLocallySignedCert(), - "tls_self_signed_cert": resourceSelfSignedCert(), - "tls_cert_request": resourceCertRequest(), - }, - } -} - -func hashForState(value string) string { - if value == "" { - return "" - } - hash := sha1.Sum([]byte(strings.TrimSpace(value))) - return hex.EncodeToString(hash[:]) -} - -func nameFromResourceData(nameMap map[string]interface{}) (*pkix.Name, error) { - result := &pkix.Name{} - - if value := nameMap["common_name"]; value != nil { - result.CommonName = value.(string) - } - if value := nameMap["organization"]; value != nil { - result.Organization = []string{value.(string)} - } - if value := nameMap["organizational_unit"]; value != nil { - result.OrganizationalUnit = []string{value.(string)} - } - if value := nameMap["street_address"]; value != nil { - valueI := value.([]interface{}) - result.StreetAddress = make([]string, len(valueI)) - for i, vi := range valueI { - result.StreetAddress[i] = vi.(string) - } - } - if value := nameMap["locality"]; value != nil { - result.Locality = []string{value.(string)} - } - if value := nameMap["province"]; value != nil { - result.Province = []string{value.(string)} - } - if value := nameMap["country"]; value != nil { - result.Country = []string{value.(string)} - } - if value := nameMap["postal_code"]; value != nil { - result.PostalCode = []string{value.(string)} - } - if value := nameMap["serial_number"]; value != nil { - result.SerialNumber = value.(string) - } - - return result, nil -} - -var nameSchema *schema.Resource = &schema.Resource{ - Schema: map[string]*schema.Schema{ - "organization": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "common_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "organizational_unit": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "street_address": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "locality": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "province": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "country": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "postal_code": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "serial_number": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - }, -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_cert_request.go b/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_cert_request.go deleted file mode 100644 index 267f0db..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_cert_request.go +++ /dev/null @@ -1,127 +0,0 @@ -package tls - -import ( - "crypto/rand" - "crypto/x509" - "encoding/pem" - "fmt" - "net" - - "github.com/hashicorp/terraform/helper/schema" -) - -const pemCertReqType = "CERTIFICATE REQUEST" - -func resourceCertRequest() *schema.Resource { - return &schema.Resource{ - Create: CreateCertRequest, - Delete: DeleteCertRequest, - Read: ReadCertRequest, - - Schema: map[string]*schema.Schema{ - - "dns_names": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "List of DNS names to use as subjects of the certificate", - ForceNew: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - - "ip_addresses": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "List of IP addresses to use as subjects of the certificate", - ForceNew: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - - "key_algorithm": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "Name of the algorithm to use to generate the certificate's private key", - ForceNew: true, - }, - - "private_key_pem": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "PEM-encoded private key that the certificate will belong to", - ForceNew: true, - StateFunc: func(v interface{}) string { - return hashForState(v.(string)) - }, - }, - - "subject": &schema.Schema{ - Type: schema.TypeList, - Required: true, - Elem: nameSchema, - ForceNew: true, - }, - - "cert_request_pem": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func CreateCertRequest(d *schema.ResourceData, meta interface{}) error { - key, err := parsePrivateKey(d, "private_key_pem", "key_algorithm") - if err != nil { - return err - } - - subjectConfs := d.Get("subject").([]interface{}) - if len(subjectConfs) != 1 { - return fmt.Errorf("must have exactly one 'subject' block") - } - subjectConf := subjectConfs[0].(map[string]interface{}) - subject, err := nameFromResourceData(subjectConf) - if err != nil { - return fmt.Errorf("invalid subject block: %s", err) - } - - certReq := x509.CertificateRequest{ - Subject: *subject, - } - - dnsNamesI := d.Get("dns_names").([]interface{}) - for _, nameI := range dnsNamesI { - certReq.DNSNames = append(certReq.DNSNames, nameI.(string)) - } - ipAddressesI := d.Get("ip_addresses").([]interface{}) - for _, ipStrI := range ipAddressesI { - ip := net.ParseIP(ipStrI.(string)) - if ip == nil { - return fmt.Errorf("invalid IP address %#v", ipStrI.(string)) - } - certReq.IPAddresses = append(certReq.IPAddresses, ip) - } - - certReqBytes, err := x509.CreateCertificateRequest(rand.Reader, &certReq, key) - if err != nil { - return fmt.Errorf("Error creating certificate request: %s", err) - } - certReqPem := string(pem.EncodeToMemory(&pem.Block{Type: pemCertReqType, Bytes: certReqBytes})) - - d.SetId(hashForState(string(certReqBytes))) - d.Set("cert_request_pem", certReqPem) - - return nil -} - -func DeleteCertRequest(d *schema.ResourceData, meta interface{}) error { - d.SetId("") - return nil -} - -func ReadCertRequest(d *schema.ResourceData, meta interface{}) error { - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_certificate.go b/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_certificate.go deleted file mode 100644 index d30efa7..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_certificate.go +++ /dev/null @@ -1,210 +0,0 @@ -package tls - -import ( - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - "crypto/sha1" - "crypto/x509" - "encoding/asn1" - "encoding/pem" - "errors" - "fmt" - "math/big" - "time" - - "github.com/hashicorp/terraform/helper/schema" -) - -const pemCertType = "CERTIFICATE" - -var keyUsages map[string]x509.KeyUsage = map[string]x509.KeyUsage{ - "digital_signature": x509.KeyUsageDigitalSignature, - "content_commitment": x509.KeyUsageContentCommitment, - "key_encipherment": x509.KeyUsageKeyEncipherment, - "data_encipherment": x509.KeyUsageDataEncipherment, - "key_agreement": x509.KeyUsageKeyAgreement, - "cert_signing": x509.KeyUsageCertSign, - "crl_signing": x509.KeyUsageCRLSign, - "encipher_only": x509.KeyUsageEncipherOnly, - "decipher_only": x509.KeyUsageDecipherOnly, -} - -var extKeyUsages map[string]x509.ExtKeyUsage = map[string]x509.ExtKeyUsage{ - "any_extended": x509.ExtKeyUsageAny, - "server_auth": x509.ExtKeyUsageServerAuth, - "client_auth": x509.ExtKeyUsageClientAuth, - "code_signing": x509.ExtKeyUsageCodeSigning, - "email_protection": x509.ExtKeyUsageEmailProtection, - "ipsec_end_system": x509.ExtKeyUsageIPSECEndSystem, - "ipsec_tunnel": x509.ExtKeyUsageIPSECTunnel, - "ipsec_user": x509.ExtKeyUsageIPSECUser, - "timestamping": x509.ExtKeyUsageTimeStamping, - "ocsp_signing": x509.ExtKeyUsageOCSPSigning, - "microsoft_server_gated_crypto": x509.ExtKeyUsageMicrosoftServerGatedCrypto, - "netscape_server_gated_crypto": x509.ExtKeyUsageNetscapeServerGatedCrypto, -} - -// rsaPublicKey reflects the ASN.1 structure of a PKCS#1 public key. -type rsaPublicKey struct { - N *big.Int - E int -} - -// generateSubjectKeyID generates a SHA-1 hash of the subject public key. -func generateSubjectKeyID(pub crypto.PublicKey) ([]byte, error) { - var publicKeyBytes []byte - var err error - - switch pub := pub.(type) { - case *rsa.PublicKey: - publicKeyBytes, err = asn1.Marshal(rsaPublicKey{N: pub.N, E: pub.E}) - if err != nil { - return nil, err - } - case *ecdsa.PublicKey: - publicKeyBytes = elliptic.Marshal(pub.Curve, pub.X, pub.Y) - default: - return nil, errors.New("only RSA and ECDSA public keys supported") - } - - hash := sha1.Sum(publicKeyBytes) - return hash[:], nil -} - -func resourceCertificateCommonSchema() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "validity_period_hours": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - Description: "Number of hours that the certificate will remain valid for", - ForceNew: true, - }, - - "early_renewal_hours": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Default: 0, - Description: "Number of hours before the certificates expiry when a new certificate will be generated", - ForceNew: true, - }, - - "is_ca_certificate": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Description: "Whether the generated certificate will be usable as a CA certificate", - ForceNew: true, - }, - - "allowed_uses": &schema.Schema{ - Type: schema.TypeList, - Required: true, - Description: "Uses that are allowed for the certificate", - ForceNew: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - - "cert_pem": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "validity_start_time": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "validity_end_time": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - } -} - -func createCertificate(d *schema.ResourceData, template, parent *x509.Certificate, pub crypto.PublicKey, priv interface{}) error { - var err error - - template.NotBefore = time.Now() - template.NotAfter = template.NotBefore.Add(time.Duration(d.Get("validity_period_hours").(int)) * time.Hour) - - serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) - template.SerialNumber, err = rand.Int(rand.Reader, serialNumberLimit) - if err != nil { - return fmt.Errorf("failed to generate serial number: %s", err) - } - - keyUsesI := d.Get("allowed_uses").([]interface{}) - for _, keyUseI := range keyUsesI { - keyUse := keyUseI.(string) - if usage, ok := keyUsages[keyUse]; ok { - template.KeyUsage |= usage - } - if usage, ok := extKeyUsages[keyUse]; ok { - template.ExtKeyUsage = append(template.ExtKeyUsage, usage) - } - } - - if d.Get("is_ca_certificate").(bool) { - template.IsCA = true - - template.SubjectKeyId, err = generateSubjectKeyID(pub) - if err != nil { - return fmt.Errorf("failed to set subject key identifier: %s", err) - } - } - - certBytes, err := x509.CreateCertificate(rand.Reader, template, parent, pub, priv) - if err != nil { - return fmt.Errorf("error creating certificate: %s", err) - } - certPem := string(pem.EncodeToMemory(&pem.Block{Type: pemCertType, Bytes: certBytes})) - - validFromBytes, err := template.NotBefore.MarshalText() - if err != nil { - return fmt.Errorf("error serializing validity_start_time: %s", err) - } - validToBytes, err := template.NotAfter.MarshalText() - if err != nil { - return fmt.Errorf("error serializing validity_end_time: %s", err) - } - - d.SetId(template.SerialNumber.String()) - d.Set("cert_pem", certPem) - d.Set("validity_start_time", string(validFromBytes)) - d.Set("validity_end_time", string(validToBytes)) - - return nil -} - -func DeleteCertificate(d *schema.ResourceData, meta interface{}) error { - d.SetId("") - return nil -} - -func ReadCertificate(d *schema.ResourceData, meta interface{}) error { - - endTimeStr := d.Get("validity_end_time").(string) - endTime := time.Now() - err := endTime.UnmarshalText([]byte(endTimeStr)) - if err != nil { - // If end time is invalid then we'll just throw away the whole - // thing so we can generate a new one. - d.SetId("") - return nil - } - - earlyRenewalPeriod := time.Duration(-d.Get("early_renewal_hours").(int)) * time.Hour - endTime = endTime.Add(earlyRenewalPeriod) - - if time.Now().After(endTime) { - // Treat an expired certificate as not existing, so we'll generate - // a new one with the next plan. - d.SetId("") - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_locally_signed_cert.go b/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_locally_signed_cert.go deleted file mode 100644 index 39c9002..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_locally_signed_cert.go +++ /dev/null @@ -1,79 +0,0 @@ -package tls - -import ( - "crypto/x509" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceLocallySignedCert() *schema.Resource { - s := resourceCertificateCommonSchema() - - s["cert_request_pem"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "PEM-encoded certificate request", - ForceNew: true, - StateFunc: func(v interface{}) string { - return hashForState(v.(string)) - }, - } - - s["ca_key_algorithm"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "Name of the algorithm used to generate the certificate's private key", - ForceNew: true, - } - - s["ca_private_key_pem"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "PEM-encoded CA private key used to sign the certificate", - ForceNew: true, - StateFunc: func(v interface{}) string { - return hashForState(v.(string)) - }, - } - - s["ca_cert_pem"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "PEM-encoded CA certificate", - ForceNew: true, - StateFunc: func(v interface{}) string { - return hashForState(v.(string)) - }, - } - - return &schema.Resource{ - Create: CreateLocallySignedCert, - Delete: DeleteCertificate, - Read: ReadCertificate, - Schema: s, - } -} - -func CreateLocallySignedCert(d *schema.ResourceData, meta interface{}) error { - certReq, err := parseCertificateRequest(d, "cert_request_pem") - if err != nil { - return err - } - caKey, err := parsePrivateKey(d, "ca_private_key_pem", "ca_key_algorithm") - if err != nil { - return err - } - caCert, err := parseCertificate(d, "ca_cert_pem") - if err != nil { - return err - } - - cert := x509.Certificate{ - Subject: certReq.Subject, - DNSNames: certReq.DNSNames, - IPAddresses: certReq.IPAddresses, - BasicConstraintsValid: true, - } - - return createCertificate(d, &cert, caCert, certReq.PublicKey, caKey) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_private_key.go b/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_private_key.go deleted file mode 100644 index 8270cc6..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_private_key.go +++ /dev/null @@ -1,178 +0,0 @@ -package tls - -import ( - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - "crypto/x509" - "encoding/pem" - "fmt" - - "golang.org/x/crypto/ssh" - - "github.com/hashicorp/terraform/helper/schema" -) - -type keyAlgo func(d *schema.ResourceData) (interface{}, error) -type keyParser func([]byte) (interface{}, error) - -var keyAlgos map[string]keyAlgo = map[string]keyAlgo{ - "RSA": func(d *schema.ResourceData) (interface{}, error) { - rsaBits := d.Get("rsa_bits").(int) - return rsa.GenerateKey(rand.Reader, rsaBits) - }, - "ECDSA": func(d *schema.ResourceData) (interface{}, error) { - curve := d.Get("ecdsa_curve").(string) - switch curve { - case "P224": - return ecdsa.GenerateKey(elliptic.P224(), rand.Reader) - case "P256": - return ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - case "P384": - return ecdsa.GenerateKey(elliptic.P384(), rand.Reader) - case "P521": - return ecdsa.GenerateKey(elliptic.P521(), rand.Reader) - default: - return nil, fmt.Errorf("invalid ecdsa_curve; must be P224, P256, P384 or P521") - } - }, -} - -var keyParsers map[string]keyParser = map[string]keyParser{ - "RSA": func(der []byte) (interface{}, error) { - return x509.ParsePKCS1PrivateKey(der) - }, - "ECDSA": func(der []byte) (interface{}, error) { - return x509.ParseECPrivateKey(der) - }, -} - -func resourcePrivateKey() *schema.Resource { - return &schema.Resource{ - Create: CreatePrivateKey, - Delete: DeletePrivateKey, - Read: ReadPrivateKey, - - Schema: map[string]*schema.Schema{ - "algorithm": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "Name of the algorithm to use to generate the private key", - ForceNew: true, - }, - - "rsa_bits": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Description: "Number of bits to use when generating an RSA key", - ForceNew: true, - Default: 2048, - }, - - "ecdsa_curve": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "ECDSA curve to use when generating a key", - ForceNew: true, - Default: "P224", - }, - - "private_key_pem": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "public_key_pem": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "public_key_openssh": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func CreatePrivateKey(d *schema.ResourceData, meta interface{}) error { - keyAlgoName := d.Get("algorithm").(string) - var keyFunc keyAlgo - var ok bool - if keyFunc, ok = keyAlgos[keyAlgoName]; !ok { - return fmt.Errorf("invalid key_algorithm %#v", keyAlgoName) - } - - key, err := keyFunc(d) - if err != nil { - return err - } - - var keyPemBlock *pem.Block - switch k := key.(type) { - case *rsa.PrivateKey: - keyPemBlock = &pem.Block{ - Type: "RSA PRIVATE KEY", - Bytes: x509.MarshalPKCS1PrivateKey(k), - } - case *ecdsa.PrivateKey: - keyBytes, err := x509.MarshalECPrivateKey(k) - if err != nil { - return fmt.Errorf("error encoding key to PEM: %s", err) - } - keyPemBlock = &pem.Block{ - Type: "EC PRIVATE KEY", - Bytes: keyBytes, - } - default: - return fmt.Errorf("unsupported private key type") - } - keyPem := string(pem.EncodeToMemory(keyPemBlock)) - - pubKey := publicKey(key) - pubKeyBytes, err := x509.MarshalPKIXPublicKey(pubKey) - if err != nil { - return fmt.Errorf("failed to marshal public key: %s", err) - } - pubKeyPemBlock := &pem.Block{ - Type: "PUBLIC KEY", - Bytes: pubKeyBytes, - } - - d.SetId(hashForState(string((pubKeyBytes)))) - d.Set("private_key_pem", keyPem) - d.Set("public_key_pem", string(pem.EncodeToMemory(pubKeyPemBlock))) - - sshPubKey, err := ssh.NewPublicKey(pubKey) - if err == nil { - // Not all EC types can be SSH keys, so we'll produce this only - // if an appropriate type was selected. - sshPubKeyBytes := ssh.MarshalAuthorizedKey(sshPubKey) - d.Set("public_key_openssh", string(sshPubKeyBytes)) - } else { - d.Set("public_key_openssh", "") - } - - return nil -} - -func DeletePrivateKey(d *schema.ResourceData, meta interface{}) error { - d.SetId("") - return nil -} - -func ReadPrivateKey(d *schema.ResourceData, meta interface{}) error { - return nil -} - -func publicKey(priv interface{}) interface{} { - switch k := priv.(type) { - case *rsa.PrivateKey: - return &k.PublicKey - case *ecdsa.PrivateKey: - return &k.PublicKey - default: - return nil - } -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_self_signed_cert.go b/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_self_signed_cert.go deleted file mode 100644 index 29e0415..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/resource_self_signed_cert.go +++ /dev/null @@ -1,101 +0,0 @@ -package tls - -import ( - "crypto/x509" - "fmt" - "net" - - "github.com/hashicorp/terraform/helper/schema" -) - -func resourceSelfSignedCert() *schema.Resource { - s := resourceCertificateCommonSchema() - - s["subject"] = &schema.Schema{ - Type: schema.TypeList, - Required: true, - Elem: nameSchema, - ForceNew: true, - } - - s["dns_names"] = &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "List of DNS names to use as subjects of the certificate", - ForceNew: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - } - - s["ip_addresses"] = &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "List of IP addresses to use as subjects of the certificate", - ForceNew: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - } - - s["key_algorithm"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "Name of the algorithm to use to generate the certificate's private key", - ForceNew: true, - } - - s["private_key_pem"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "PEM-encoded private key that the certificate will belong to", - ForceNew: true, - StateFunc: func(v interface{}) string { - return hashForState(v.(string)) - }, - } - - return &schema.Resource{ - Create: CreateSelfSignedCert, - Delete: DeleteCertificate, - Read: ReadCertificate, - Schema: s, - } -} - -func CreateSelfSignedCert(d *schema.ResourceData, meta interface{}) error { - key, err := parsePrivateKey(d, "private_key_pem", "key_algorithm") - if err != nil { - return err - } - - subjectConfs := d.Get("subject").([]interface{}) - if len(subjectConfs) != 1 { - return fmt.Errorf("must have exactly one 'subject' block") - } - subjectConf := subjectConfs[0].(map[string]interface{}) - subject, err := nameFromResourceData(subjectConf) - if err != nil { - return fmt.Errorf("invalid subject block: %s", err) - } - - cert := x509.Certificate{ - Subject: *subject, - BasicConstraintsValid: true, - } - - dnsNamesI := d.Get("dns_names").([]interface{}) - for _, nameI := range dnsNamesI { - cert.DNSNames = append(cert.DNSNames, nameI.(string)) - } - ipAddressesI := d.Get("ip_addresses").([]interface{}) - for _, ipStrI := range ipAddressesI { - ip := net.ParseIP(ipStrI.(string)) - if ip == nil { - return fmt.Errorf("invalid IP address %#v", ipStrI.(string)) - } - cert.IPAddresses = append(cert.IPAddresses, ip) - } - - return createCertificate(d, &cert, &cert, publicKey(key), key) -} diff --git a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/util.go b/vendor/github.com/hashicorp/terraform/builtin/providers/tls/util.go deleted file mode 100644 index b1ff32e..0000000 --- a/vendor/github.com/hashicorp/terraform/builtin/providers/tls/util.go +++ /dev/null @@ -1,76 +0,0 @@ -package tls - -import ( - "crypto/x509" - "encoding/pem" - "fmt" - - "github.com/hashicorp/terraform/helper/schema" -) - -func decodePEM(d *schema.ResourceData, pemKey, pemType string) (*pem.Block, error) { - block, _ := pem.Decode([]byte(d.Get(pemKey).(string))) - if block == nil { - return nil, fmt.Errorf("no PEM block found in %s", pemKey) - } - if pemType != "" && block.Type != pemType { - return nil, fmt.Errorf("invalid PEM type in %s: %s", pemKey, block.Type) - } - - return block, nil -} - -func parsePrivateKey(d *schema.ResourceData, pemKey, algoKey string) (interface{}, error) { - algoName := d.Get(algoKey).(string) - - keyFunc, ok := keyParsers[algoName] - if !ok { - return nil, fmt.Errorf("invalid %s: %#v", algoKey, algoName) - } - - block, err := decodePEM(d, pemKey, "") - if err != nil { - return nil, err - } - - key, err := keyFunc(block.Bytes) - if err != nil { - return nil, fmt.Errorf("failed to decode %s: %s", pemKey, err) - } - - return key, nil -} - -func parseCertificate(d *schema.ResourceData, pemKey string) (*x509.Certificate, error) { - block, err := decodePEM(d, pemKey, "") - if err != nil { - return nil, err - } - - certs, err := x509.ParseCertificates(block.Bytes) - if err != nil { - return nil, fmt.Errorf("failed to parse %s: %s", pemKey, err) - } - if len(certs) < 1 { - return nil, fmt.Errorf("no certificates found in %s", pemKey) - } - if len(certs) > 1 { - return nil, fmt.Errorf("multiple certificates found in %s", pemKey) - } - - return certs[0], nil -} - -func parseCertificateRequest(d *schema.ResourceData, pemKey string) (*x509.CertificateRequest, error) { - block, err := decodePEM(d, pemKey, pemCertReqType) - if err != nil { - return nil, err - } - - certReq, err := x509.ParseCertificateRequest(block.Bytes) - if err != nil { - return nil, fmt.Errorf("failed to parse %s: %s", pemKey, err) - } - - return certReq, nil -} diff --git a/vendor/github.com/hashicorp/terraform/config/append.go b/vendor/github.com/hashicorp/terraform/config/append.go index a421df4..9d80c42 100644 --- a/vendor/github.com/hashicorp/terraform/config/append.go +++ b/vendor/github.com/hashicorp/terraform/config/append.go @@ -35,8 +35,13 @@ func Append(c1, c2 *Config) (*Config, error) { c.Atlas = c2.Atlas } - c.Terraform = c1.Terraform - if c2.Terraform != nil { + // merge Terraform blocks + if c1.Terraform != nil { + c.Terraform = c1.Terraform + if c2.Terraform != nil { + c.Terraform.Merge(c2.Terraform) + } + } else { c.Terraform = c2.Terraform } @@ -77,5 +82,11 @@ func Append(c1, c2 *Config) (*Config, error) { c.Variables = append(c.Variables, c2.Variables...) } + if len(c1.Locals) > 0 || len(c2.Locals) > 0 { + c.Locals = make([]*Local, 0, len(c1.Locals)+len(c2.Locals)) + c.Locals = append(c.Locals, c1.Locals...) + c.Locals = append(c.Locals, c2.Locals...) + } + return c, nil } diff --git a/vendor/github.com/hashicorp/terraform/config/config.go b/vendor/github.com/hashicorp/terraform/config/config.go index bf064e5..949ad06 100644 --- a/vendor/github.com/hashicorp/terraform/config/config.go +++ b/vendor/github.com/hashicorp/terraform/config/config.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/hil" "github.com/hashicorp/hil/ast" "github.com/hashicorp/terraform/helper/hilmapstructure" + "github.com/hashicorp/terraform/plugin/discovery" "github.com/mitchellh/reflectwalk" ) @@ -33,6 +34,7 @@ type Config struct { ProviderConfigs []*ProviderConfig Resources []*Resource Variables []*Variable + Locals []*Local Outputs []*Output // The fields below can be filled in by loaders for validation @@ -64,6 +66,7 @@ type Module struct { type ProviderConfig struct { Name string Alias string + Version string RawConfig *RawConfig } @@ -145,7 +148,7 @@ func (p *Provisioner) Copy() *Provisioner { } } -// Variable is a variable defined within the configuration. +// Variable is a module argument defined within the configuration. type Variable struct { Name string DeclaredType string `mapstructure:"type"` @@ -153,6 +156,12 @@ type Variable struct { Description string } +// Local is a local value defined within the configuration. +type Local struct { + Name string + RawConfig *RawConfig +} + // Output is an output defined within the configuration. An output is // resulting data that is highlighted by Terraform when finished. An // output marked Sensitive will be output in a masked form following @@ -238,6 +247,33 @@ func (r *Resource) Id() string { } } +// ProviderFullName returns the full name of the provider for this resource, +// which may either be specified explicitly using the "provider" meta-argument +// or implied by the prefix on the resource type name. +func (r *Resource) ProviderFullName() string { + return ResourceProviderFullName(r.Type, r.Provider) +} + +// ResourceProviderFullName returns the full (dependable) name of the +// provider for a hypothetical resource with the given resource type and +// explicit provider string. If the explicit provider string is empty then +// the provider name is inferred from the resource type name. +func ResourceProviderFullName(resourceType, explicitProvider string) string { + if explicitProvider != "" { + return explicitProvider + } + + idx := strings.IndexRune(resourceType, '_') + if idx == -1 { + // If no underscores, the resource name is assumed to be + // also the provider name, e.g. if the provider exposes + // only a single resource of each type. + return resourceType + } + + return resourceType[:idx] +} + // Validate does some basic semantic checking of the configuration. func (c *Config) Validate() error { if c == nil { @@ -285,8 +321,15 @@ func (c *Config) Validate() error { } interp := false - fn := func(ast.Node) (interface{}, error) { - interp = true + fn := func(n ast.Node) (interface{}, error) { + // LiteralNode is a literal string (outside of a ${ ... } sequence). + // interpolationWalker skips most of these. but in particular it + // visits those that have escaped sequences (like $${foo}) as a + // signal that *some* processing is required on this string. For + // our purposes here though, this is fine and not an interpolation. + if _, ok := n.(*ast.LiteralNode); !ok { + interp = true + } return "", nil } @@ -342,7 +385,8 @@ func (c *Config) Validate() error { } } - // Check that providers aren't declared multiple times. + // Check that providers aren't declared multiple times and that their + // version constraints, where present, are syntactically valid. providerSet := make(map[string]struct{}) for _, p := range c.ProviderConfigs { name := p.FullName() @@ -353,6 +397,16 @@ func (c *Config) Validate() error { continue } + if p.Version != "" { + _, err := discovery.ConstraintStr(p.Version).Parse() + if err != nil { + errs = append(errs, fmt.Errorf( + "provider.%s: invalid version constraint %q: %s", + name, p.Version, err, + )) + } + } + providerSet[name] = struct{}{} } @@ -503,6 +557,7 @@ func (c *Config) Validate() error { case *ResourceVariable: case *TerraformVariable: case *UserVariable: + case *LocalVariable: default: errs = append(errs, fmt.Errorf( @@ -538,7 +593,7 @@ func (c *Config) Validate() error { // Verify provisioners for _, p := range r.Provisioners { - // This validation checks that there are now splat variables + // This validation checks that there are no splat variables // referencing ourself. This currently is not allowed. for _, v := range p.ConnInfo.Variables { @@ -633,6 +688,29 @@ func (c *Config) Validate() error { } } + // Check that all locals are valid + { + found := make(map[string]struct{}) + for _, l := range c.Locals { + if _, ok := found[l.Name]; ok { + errs = append(errs, fmt.Errorf( + "%s: duplicate local. local value names must be unique", + l.Name, + )) + continue + } + found[l.Name] = struct{}{} + + for _, v := range l.RawConfig.Variables { + if _, ok := v.(*CountVariable); ok { + errs = append(errs, fmt.Errorf( + "local %s: count variables are only valid within resources", l.Name, + )) + } + } + } + } + // Check that all outputs are valid { found := make(map[string]struct{}) @@ -698,17 +776,6 @@ func (c *Config) Validate() error { } } - // Check that all variables are in the proper context - for source, rc := range c.rawConfigs() { - walker := &interpolationWalker{ - ContextF: c.validateVarContextFn(source, &errs), - } - if err := reflectwalk.Walk(rc.Raw, walker); err != nil { - errs = append(errs, fmt.Errorf( - "%s: error reading config: %s", source, err)) - } - } - // Validate the self variable for source, rc := range c.rawConfigs() { // Ignore provisioners. This is a pretty brittle way to do this, @@ -780,57 +847,6 @@ func (c *Config) rawConfigs() map[string]*RawConfig { return result } -func (c *Config) validateVarContextFn( - source string, errs *[]error) interpolationWalkerContextFunc { - return func(loc reflectwalk.Location, node ast.Node) { - // If we're in a slice element, then its fine, since you can do - // anything in there. - if loc == reflectwalk.SliceElem { - return - } - - // Otherwise, let's check if there is a splat resource variable - // at the top level in here. We do this by doing a transform that - // replaces everything with a noop node unless its a variable - // access or concat. This should turn the AST into a flat tree - // of Concat(Noop, ...). If there are any variables left that are - // multi-access, then its still broken. - node = node.Accept(func(n ast.Node) ast.Node { - // If it is a concat or variable access, we allow it. - switch n.(type) { - case *ast.Output: - return n - case *ast.VariableAccess: - return n - } - - // Otherwise, noop - return &noopNode{} - }) - - vars, err := DetectVariables(node) - if err != nil { - // Ignore it since this will be caught during parse. This - // actually probably should never happen by the time this - // is called, but its okay. - return - } - - for _, v := range vars { - rv, ok := v.(*ResourceVariable) - if !ok { - return - } - - if rv.Multi && rv.Index == -1 { - *errs = append(*errs, fmt.Errorf( - "%s: use of the splat ('*') operator must be wrapped in a list declaration", - source)) - } - } - } -} - func (c *Config) validateDependsOn( n string, v []string, @@ -1010,7 +1026,16 @@ func (v *Variable) ValidateTypeAndDefault() error { // If an explicit type is declared, ensure it is valid if v.DeclaredType != "" { if _, ok := typeStringMap[v.DeclaredType]; !ok { - return fmt.Errorf("Variable '%s' must be of type string or map - '%s' is not a valid type", v.Name, v.DeclaredType) + validTypes := []string{} + for k := range typeStringMap { + validTypes = append(validTypes, k) + } + return fmt.Errorf( + "Variable '%s' type must be one of [%s] - '%s' is not a valid type", + v.Name, + strings.Join(validTypes, ", "), + v.DeclaredType, + ) } } diff --git a/vendor/github.com/hashicorp/terraform/config/config_string.go b/vendor/github.com/hashicorp/terraform/config/config_string.go index 0b3abbc..a6933c2 100644 --- a/vendor/github.com/hashicorp/terraform/config/config_string.go +++ b/vendor/github.com/hashicorp/terraform/config/config_string.go @@ -143,6 +143,46 @@ func outputsStr(os []*Output) string { result += fmt.Sprintf(" %s: %s\n", kind, str) } } + + if o.Description != "" { + result += fmt.Sprintf(" description\n %s\n", o.Description) + } + } + + return strings.TrimSpace(result) +} + +func localsStr(ls []*Local) string { + ns := make([]string, 0, len(ls)) + m := make(map[string]*Local) + for _, l := range ls { + ns = append(ns, l.Name) + m[l.Name] = l + } + sort.Strings(ns) + + result := "" + for _, n := range ns { + l := m[n] + + result += fmt.Sprintf("%s\n", n) + + if len(l.RawConfig.Variables) > 0 { + result += fmt.Sprintf(" vars\n") + for _, rawV := range l.RawConfig.Variables { + kind := "unknown" + str := rawV.FullKey() + + switch rawV.(type) { + case *ResourceVariable: + kind = "resource" + case *UserVariable: + kind = "user" + } + + result += fmt.Sprintf(" %s: %s\n", kind, str) + } + } } return strings.TrimSpace(result) diff --git a/vendor/github.com/hashicorp/terraform/config/config_terraform.go b/vendor/github.com/hashicorp/terraform/config/config_terraform.go index 952d59c..8535c96 100644 --- a/vendor/github.com/hashicorp/terraform/config/config_terraform.go +++ b/vendor/github.com/hashicorp/terraform/config/config_terraform.go @@ -47,6 +47,18 @@ func (t *Terraform) Validate() []error { return errs } +// Merge t with t2. +// Any conflicting fields are overwritten by t2. +func (t *Terraform) Merge(t2 *Terraform) { + if t2.RequiredVersion != "" { + t.RequiredVersion = t2.RequiredVersion + } + + if t2.Backend != nil { + t.Backend = t2.Backend + } +} + // Backend is the configuration for the "backend" to use with Terraform. // A backend is responsible for all major behavior of Terraform's core. // The abstraction layer above the core (the "backend") allows for behavior @@ -60,7 +72,7 @@ type Backend struct { Hash uint64 } -// Hash returns a unique content hash for this backend's configuration +// Rehash returns a unique content hash for this backend's configuration // as a uint64 value. func (b *Backend) Rehash() uint64 { // If we have no backend, the value is zero diff --git a/vendor/github.com/hashicorp/terraform/config/interpolate.go b/vendor/github.com/hashicorp/terraform/config/interpolate.go index bbb3555..b18f2d3 100644 --- a/vendor/github.com/hashicorp/terraform/config/interpolate.go +++ b/vendor/github.com/hashicorp/terraform/config/interpolate.go @@ -101,6 +101,12 @@ type UserVariable struct { key string } +// A LocalVariable is a variable that references a local value defined within +// the current module, via a "locals" block. This looks like "${local.foo}". +type LocalVariable struct { + Name string +} + func NewInterpolatedVariable(v string) (InterpolatedVariable, error) { if strings.HasPrefix(v, "count.") { return NewCountVariable(v) @@ -112,6 +118,8 @@ func NewInterpolatedVariable(v string) (InterpolatedVariable, error) { return NewTerraformVariable(v) } else if strings.HasPrefix(v, "var.") { return NewUserVariable(v) + } else if strings.HasPrefix(v, "local.") { + return NewLocalVariable(v) } else if strings.HasPrefix(v, "module.") { return NewModuleVariable(v) } else if !strings.ContainsRune(v, '.') { @@ -331,6 +339,25 @@ func (v *UserVariable) GoString() string { return fmt.Sprintf("*%#v", *v) } +func NewLocalVariable(key string) (*LocalVariable, error) { + name := key[len("local."):] + if idx := strings.Index(name, "."); idx > -1 { + return nil, fmt.Errorf("Can't use dot (.) attribute access in local.%s; use square bracket indexing", name) + } + + return &LocalVariable{ + Name: name, + }, nil +} + +func (v *LocalVariable) FullKey() string { + return fmt.Sprintf("local.%s", v.Name) +} + +func (v *LocalVariable) GoString() string { + return fmt.Sprintf("*%#v", *v) +} + // DetectVariables takes an AST root and returns all the interpolated // variables that are detected in the AST tree. func DetectVariables(root ast.Node) ([]InterpolatedVariable, error) { diff --git a/vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go b/vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go index ad543c3..2ab3c4d 100644 --- a/vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go +++ b/vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go @@ -1,9 +1,12 @@ package config import ( + "bytes" + "compress/gzip" "crypto/md5" "crypto/sha1" "crypto/sha256" + "crypto/sha512" "encoding/base64" "encoding/hex" "encoding/json" @@ -11,6 +14,8 @@ import ( "io/ioutil" "math" "net" + "net/url" + "path/filepath" "regexp" "sort" "strconv" @@ -22,6 +27,7 @@ import ( "github.com/hashicorp/hil" "github.com/hashicorp/hil/ast" "github.com/mitchellh/go-homedir" + "golang.org/x/crypto/bcrypt" ) // stringSliceToVariableValue converts a string slice into the value @@ -52,27 +58,40 @@ func listVariableValueToStringSlice(values []ast.Variable) ([]string, error) { // Funcs is the mapping of built-in functions for configuration. func Funcs() map[string]ast.Function { return map[string]ast.Function{ + "abs": interpolationFuncAbs(), + "basename": interpolationFuncBasename(), "base64decode": interpolationFuncBase64Decode(), "base64encode": interpolationFuncBase64Encode(), + "base64gzip": interpolationFuncBase64Gzip(), "base64sha256": interpolationFuncBase64Sha256(), + "base64sha512": interpolationFuncBase64Sha512(), + "bcrypt": interpolationFuncBcrypt(), "ceil": interpolationFuncCeil(), + "chomp": interpolationFuncChomp(), "cidrhost": interpolationFuncCidrHost(), "cidrnetmask": interpolationFuncCidrNetmask(), "cidrsubnet": interpolationFuncCidrSubnet(), "coalesce": interpolationFuncCoalesce(), + "coalescelist": interpolationFuncCoalesceList(), "compact": interpolationFuncCompact(), "concat": interpolationFuncConcat(), + "contains": interpolationFuncContains(), + "dirname": interpolationFuncDirname(), "distinct": interpolationFuncDistinct(), "element": interpolationFuncElement(), "file": interpolationFuncFile(), + "matchkeys": interpolationFuncMatchKeys(), + "flatten": interpolationFuncFlatten(), "floor": interpolationFuncFloor(), "format": interpolationFuncFormat(), "formatlist": interpolationFuncFormatList(), + "indent": interpolationFuncIndent(), "index": interpolationFuncIndex(), "join": interpolationFuncJoin(), "jsonencode": interpolationFuncJSONEncode(), "length": interpolationFuncLength(), "list": interpolationFuncList(), + "log": interpolationFuncLog(), "lower": interpolationFuncLower(), "map": interpolationFuncMap(), "max": interpolationFuncMax(), @@ -80,18 +99,22 @@ func Funcs() map[string]ast.Function { "merge": interpolationFuncMerge(), "min": interpolationFuncMin(), "pathexpand": interpolationFuncPathExpand(), + "pow": interpolationFuncPow(), "uuid": interpolationFuncUUID(), "replace": interpolationFuncReplace(), "sha1": interpolationFuncSha1(), "sha256": interpolationFuncSha256(), + "sha512": interpolationFuncSha512(), "signum": interpolationFuncSignum(), "slice": interpolationFuncSlice(), "sort": interpolationFuncSort(), "split": interpolationFuncSplit(), + "substr": interpolationFuncSubstr(), "timestamp": interpolationFuncTimestamp(), "title": interpolationFuncTitle(), "trimspace": interpolationFuncTrimSpace(), "upper": interpolationFuncUpper(), + "urlencode": interpolationFuncURLEncode(), "zipmap": interpolationFuncZipMap(), } } @@ -318,6 +341,46 @@ func interpolationFuncCoalesce() ast.Function { } } +// interpolationFuncCoalesceList implements the "coalescelist" function that +// returns the first non empty list from the provided input +func interpolationFuncCoalesceList() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeList}, + ReturnType: ast.TypeList, + Variadic: true, + VariadicType: ast.TypeList, + Callback: func(args []interface{}) (interface{}, error) { + if len(args) < 2 { + return nil, fmt.Errorf("must provide at least two arguments") + } + for _, arg := range args { + argument := arg.([]ast.Variable) + + if len(argument) > 0 { + return argument, nil + } + } + return make([]ast.Variable, 0), nil + }, + } +} + +// interpolationFuncContains returns true if an element is in the list +// and return false otherwise +func interpolationFuncContains() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeList, ast.TypeString}, + ReturnType: ast.TypeBool, + Callback: func(args []interface{}) (interface{}, error) { + _, err := interpolationFuncIndex().Callback(args) + if err != nil { + return false, nil + } + return true, nil + }, + } +} + // interpolationFuncConcat implements the "concat" function that concatenates // multiple lists. func interpolationFuncConcat() ast.Function { @@ -359,6 +422,17 @@ func interpolationFuncConcat() ast.Function { } } +// interpolationFuncPow returns base x exponential of y. +func interpolationFuncPow() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeFloat, ast.TypeFloat}, + ReturnType: ast.TypeFloat, + Callback: func(args []interface{}) (interface{}, error) { + return math.Pow(args[0].(float64), args[1].(float64)), nil + }, + } +} + // interpolationFuncFile implements the "file" function that allows // loading contents from a file. func interpolationFuncFile() ast.Function { @@ -455,6 +529,29 @@ func interpolationFuncCeil() ast.Function { } } +// interpolationFuncLog returns the logarithnm. +func interpolationFuncLog() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeFloat, ast.TypeFloat}, + ReturnType: ast.TypeFloat, + Callback: func(args []interface{}) (interface{}, error) { + return math.Log(args[0].(float64)) / math.Log(args[1].(float64)), nil + }, + } +} + +// interpolationFuncChomp removes trailing newlines from the given string +func interpolationFuncChomp() ast.Function { + newlines := regexp.MustCompile(`(?:\r\n?|\n)*\z`) + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeString}, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + return newlines.ReplaceAllString(args[0].(string), ""), nil + }, + } +} + // interpolationFuncFloorreturns returns the greatest integer value less than or equal to the argument func interpolationFuncFloor() ast.Function { return ast.Function{ @@ -580,6 +677,21 @@ func interpolationFuncFormatList() ast.Function { } } +// interpolationFuncIndent indents a multi-line string with the +// specified number of spaces +func interpolationFuncIndent() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeInt, ast.TypeString}, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + spaces := args[0].(int) + data := args[1].(string) + pad := strings.Repeat(" ", spaces) + return strings.Replace(data, "\n", "\n"+pad, -1), nil + }, + } +} + // interpolationFuncIndex implements the "index" function that allows one to // find the index of a specific element in a list func interpolationFuncIndex() ast.Function { @@ -599,6 +711,17 @@ func interpolationFuncIndex() ast.Function { } } +// interpolationFuncBasename implements the "dirname" function. +func interpolationFuncDirname() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeString}, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + return filepath.Dir(args[0].(string)), nil + }, + } +} + // interpolationFuncDistinct implements the "distinct" function that // removes duplicate elements from a list. func interpolationFuncDistinct() ast.Function { @@ -640,6 +763,57 @@ func appendIfMissing(slice []string, element string) []string { return append(slice, element) } +// for two lists `keys` and `values` of equal length, returns all elements +// from `values` where the corresponding element from `keys` is in `searchset`. +func interpolationFuncMatchKeys() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeList, ast.TypeList, ast.TypeList}, + ReturnType: ast.TypeList, + Callback: func(args []interface{}) (interface{}, error) { + output := make([]ast.Variable, 0) + + values, _ := args[0].([]ast.Variable) + keys, _ := args[1].([]ast.Variable) + searchset, _ := args[2].([]ast.Variable) + + if len(keys) != len(values) { + return nil, fmt.Errorf("length of keys and values should be equal") + } + + for i, key := range keys { + for _, search := range searchset { + if res, err := compareSimpleVariables(key, search); err != nil { + return nil, err + } else if res == true { + output = append(output, values[i]) + break + } + } + } + // if searchset is empty, then output is an empty list as well. + // if we haven't matched any key, then output is an empty list. + return output, nil + }, + } +} + +// compare two variables of the same type, i.e. non complex one, such as TypeList or TypeMap +func compareSimpleVariables(a, b ast.Variable) (bool, error) { + if a.Type != b.Type { + return false, fmt.Errorf( + "won't compare items of different types %s and %s", + a.Type.Printable(), b.Type.Printable()) + } + switch a.Type { + case ast.TypeString: + return a.Value.(string) == b.Value.(string), nil + default: + return false, fmt.Errorf( + "can't compare items of type %s", + a.Type.Printable()) + } +} + // interpolationFuncJoin implements the "join" function that allows // multi-variable values to be joined by some character. func interpolationFuncJoin() ast.Function { @@ -672,8 +846,7 @@ func interpolationFuncJoin() ast.Function { } // interpolationFuncJSONEncode implements the "jsonencode" function that encodes -// a string, list, or map as its JSON representation. For now, values in the -// list or map may only be strings. +// a string, list, or map as its JSON representation. func interpolationFuncJSONEncode() ast.Function { return ast.Function{ ArgTypes: []ast.Type{ast.TypeAny}, @@ -686,28 +859,36 @@ func interpolationFuncJSONEncode() ast.Function { toEncode = typedArg case []ast.Variable: - // We preallocate the list here. Note that it's important that in - // the length 0 case, we have an empty list rather than nil, as - // they encode differently. - // XXX It would be nice to support arbitrarily nested data here. Is - // there an inverse of hil.InterfaceToVariable? strings := make([]string, len(typedArg)) for i, v := range typedArg { if v.Type != ast.TypeString { - return "", fmt.Errorf("list elements must be strings") + variable, _ := hil.InterfaceToVariable(typedArg) + toEncode, _ = hil.VariableToInterface(variable) + + jEnc, err := json.Marshal(toEncode) + if err != nil { + return "", fmt.Errorf("failed to encode JSON data '%s'", toEncode) + } + return string(jEnc), nil + } strings[i] = v.Value.(string) } toEncode = strings case map[string]ast.Variable: - // XXX It would be nice to support arbitrarily nested data here. Is - // there an inverse of hil.InterfaceToVariable? stringMap := make(map[string]string) for k, v := range typedArg { if v.Type != ast.TypeString { - return "", fmt.Errorf("map values must be strings") + variable, _ := hil.InterfaceToVariable(typedArg) + toEncode, _ = hil.VariableToInterface(variable) + + jEnc, err := json.Marshal(toEncode) + if err != nil { + return "", fmt.Errorf("failed to encode JSON data '%s'", toEncode) + } + return string(jEnc), nil } stringMap[k] = v.Value.(string) } @@ -1005,6 +1186,17 @@ func interpolationFuncValues(vs map[string]ast.Variable) ast.Function { } } +// interpolationFuncBasename implements the "basename" function. +func interpolationFuncBasename() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeString}, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + return filepath.Base(args[0].(string)), nil + }, + } +} + // interpolationFuncBase64Encode implements the "base64encode" function that // allows Base64 encoding. func interpolationFuncBase64Encode() ast.Function { @@ -1035,6 +1227,32 @@ func interpolationFuncBase64Decode() ast.Function { } } +// interpolationFuncBase64Gzip implements the "gzip" function that allows gzip +// compression encoding the result using base64 +func interpolationFuncBase64Gzip() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeString}, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + s := args[0].(string) + + var b bytes.Buffer + gz := gzip.NewWriter(&b) + if _, err := gz.Write([]byte(s)); err != nil { + return "", fmt.Errorf("failed to write gzip raw data: '%s'", s) + } + if err := gz.Flush(); err != nil { + return "", fmt.Errorf("failed to flush gzip writer: '%s'", s) + } + if err := gz.Close(); err != nil { + return "", fmt.Errorf("failed to close gzip writer: '%s'", s) + } + + return base64.StdEncoding.EncodeToString(b.Bytes()), nil + }, + } +} + // interpolationFuncLower implements the "lower" function that does // string lower casing. func interpolationFuncLower() ast.Function { @@ -1124,6 +1342,20 @@ func interpolationFuncSha256() ast.Function { } } +func interpolationFuncSha512() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeString}, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + s := args[0].(string) + h := sha512.New() + h.Write([]byte(s)) + hash := hex.EncodeToString(h.Sum(nil)) + return hash, nil + }, + } +} + func interpolationFuncTrimSpace() ast.Function { return ast.Function{ ArgTypes: []ast.Type{ast.TypeString}, @@ -1150,6 +1382,55 @@ func interpolationFuncBase64Sha256() ast.Function { } } +func interpolationFuncBase64Sha512() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeString}, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + s := args[0].(string) + h := sha512.New() + h.Write([]byte(s)) + shaSum := h.Sum(nil) + encoded := base64.StdEncoding.EncodeToString(shaSum[:]) + return encoded, nil + }, + } +} + +func interpolationFuncBcrypt() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeString}, + Variadic: true, + VariadicType: ast.TypeString, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + defaultCost := 10 + + if len(args) > 1 { + costStr := args[1].(string) + cost, err := strconv.Atoi(costStr) + if err != nil { + return "", err + } + + defaultCost = cost + } + + if len(args) > 2 { + return "", fmt.Errorf("bcrypt() takes no more than two arguments") + } + + input := args[0].(string) + out, err := bcrypt.GenerateFromPassword([]byte(input), defaultCost) + if err != nil { + return "", fmt.Errorf("error occured generating password %s", err.Error()) + } + + return string(out), nil + }, + } +} + func interpolationFuncUUID() ast.Function { return ast.Function{ ArgTypes: []ast.Type{}, @@ -1183,3 +1464,97 @@ func interpolationFuncTitle() ast.Function { }, } } + +// interpolationFuncSubstr implements the "substr" function that allows strings +// to be truncated. +func interpolationFuncSubstr() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ + ast.TypeString, // input string + ast.TypeInt, // offset + ast.TypeInt, // length + }, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + str := args[0].(string) + offset := args[1].(int) + length := args[2].(int) + + // Interpret a negative offset as being equivalent to a positive + // offset taken from the end of the string. + if offset < 0 { + offset += len(str) + } + + // Interpret a length of `-1` as indicating that the substring + // should start at `offset` and continue until the end of the + // string. Any other negative length (other than `-1`) is invalid. + if length == -1 { + length = len(str) + } else if length >= 0 { + length += offset + } else { + return nil, fmt.Errorf("length should be a non-negative integer") + } + + if offset > len(str) { + return nil, fmt.Errorf("offset cannot be larger than the length of the string") + } + + if length > len(str) { + return nil, fmt.Errorf("'offset + length' cannot be larger than the length of the string") + } + + return str[offset:length], nil + }, + } +} + +// Flatten until it's not ast.TypeList +func flattener(finalList []ast.Variable, flattenList []ast.Variable) []ast.Variable { + for _, val := range flattenList { + if val.Type == ast.TypeList { + finalList = flattener(finalList, val.Value.([]ast.Variable)) + } else { + finalList = append(finalList, val) + } + } + return finalList +} + +// Flatten to single list +func interpolationFuncFlatten() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeList}, + ReturnType: ast.TypeList, + Variadic: false, + Callback: func(args []interface{}) (interface{}, error) { + inputList := args[0].([]ast.Variable) + + var outputList []ast.Variable + return flattener(outputList, inputList), nil + }, + } +} + +func interpolationFuncURLEncode() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeString}, + ReturnType: ast.TypeString, + Callback: func(args []interface{}) (interface{}, error) { + s := args[0].(string) + return url.QueryEscape(s), nil + }, + } +} + +// interpolationFuncAbs returns the absolute value of a given float. +func interpolationFuncAbs() ast.Function { + return ast.Function{ + ArgTypes: []ast.Type{ast.TypeFloat}, + ReturnType: ast.TypeFloat, + Callback: func(args []interface{}) (interface{}, error) { + return math.Abs(args[0].(float64)), nil + }, + } +} diff --git a/vendor/github.com/hashicorp/terraform/config/loader.go b/vendor/github.com/hashicorp/terraform/config/loader.go index 0bfa89c..5dd7d46 100644 --- a/vendor/github.com/hashicorp/terraform/config/loader.go +++ b/vendor/github.com/hashicorp/terraform/config/loader.go @@ -194,7 +194,7 @@ func dirFiles(dir string) ([]string, []string, error) { // Only care about files that are valid to load name := fi.Name() extValue := ext(name) - if extValue == "" || isIgnoredFile(name) { + if extValue == "" || IsIgnoredFile(name) { continue } @@ -215,9 +215,9 @@ func dirFiles(dir string) ([]string, []string, error) { return files, overrides, nil } -// isIgnoredFile returns true or false depending on whether the +// IsIgnoredFile returns true or false depending on whether the // provided file name is a file that should be ignored. -func isIgnoredFile(name string) bool { +func IsIgnoredFile(name string) bool { return strings.HasPrefix(name, ".") || // Unix-like hidden files strings.HasSuffix(name, "~") || // vim strings.HasPrefix(name, "#") && strings.HasSuffix(name, "#") // emacs diff --git a/vendor/github.com/hashicorp/terraform/config/loader_hcl.go b/vendor/github.com/hashicorp/terraform/config/loader_hcl.go index 8e0d62c..a884062 100644 --- a/vendor/github.com/hashicorp/terraform/config/loader_hcl.go +++ b/vendor/github.com/hashicorp/terraform/config/loader_hcl.go @@ -17,10 +17,27 @@ type hclConfigurable struct { Root *ast.File } +var ReservedResourceFields = []string{ + "connection", + "count", + "depends_on", + "id", + "lifecycle", + "provider", + "provisioner", +} + +var ReservedProviderFields = []string{ + "alias", + "id", + "version", +} + func (t *hclConfigurable) Config() (*Config, error) { validKeys := map[string]struct{}{ "atlas": struct{}{}, "data": struct{}{}, + "locals": struct{}{}, "module": struct{}{}, "output": struct{}{}, "provider": struct{}{}, @@ -56,6 +73,15 @@ func (t *hclConfigurable) Config() (*Config, error) { } } + // Build local values + if locals := list.Filter("locals"); len(locals.Items) > 0 { + var err error + config.Locals, err = loadLocalsHcl(locals) + if err != nil { + return nil, err + } + } + // Get Atlas configuration if atlas := list.Filter("atlas"); len(atlas.Items) > 0 { var err error @@ -209,6 +235,19 @@ func loadTerraformHcl(list *ast.ObjectList) (*Terraform, error) { // Get our one item item := list.Items[0] + // This block should have an empty top level ObjectItem. If there are keys + // here, it's likely because we have a flattened JSON object, and we can + // lift this into a nested ObjectList to decode properly. + if len(item.Keys) > 0 { + item = &ast.ObjectItem{ + Val: &ast.ObjectType{ + List: &ast.ObjectList{ + Items: []*ast.ObjectItem{item}, + }, + }, + } + } + // We need the item value as an ObjectList var listVal *ast.ObjectList if ot, ok := item.Val.(*ast.ObjectType); ok { @@ -314,6 +353,10 @@ func loadAtlasHcl(list *ast.ObjectList) (*AtlasConfig, error) { // represents exactly one module definition in the HCL configuration. // We leave it up to another pass to merge them together. func loadModulesHcl(list *ast.ObjectList) ([]*Module, error) { + if err := assertAllBlocksHaveNames("module", list); err != nil { + return nil, err + } + list = list.Children() if len(list.Items) == 0 { return nil, nil @@ -375,15 +418,68 @@ func loadModulesHcl(list *ast.ObjectList) ([]*Module, error) { return result, nil } +// loadLocalsHcl recurses into the given HCL object turns it into +// a list of locals. +func loadLocalsHcl(list *ast.ObjectList) ([]*Local, error) { + + result := make([]*Local, 0, len(list.Items)) + + for _, block := range list.Items { + if len(block.Keys) > 0 { + return nil, fmt.Errorf( + "locals block at %s should not have label %q", + block.Pos(), block.Keys[0].Token.Value(), + ) + } + + blockObj, ok := block.Val.(*ast.ObjectType) + if !ok { + return nil, fmt.Errorf("locals value at %s should be a block", block.Val.Pos()) + } + + // blockObj now contains directly our local decls + for _, item := range blockObj.List.Items { + if len(item.Keys) != 1 { + return nil, fmt.Errorf("local declaration at %s may not be a block", item.Val.Pos()) + } + + // By the time we get here there can only be one item left, but + // we'll decode into a map anyway because it's a convenient way + // to extract both the key and the value robustly. + kv := map[string]interface{}{} + hcl.DecodeObject(&kv, item) + for k, v := range kv { + rawConfig, err := NewRawConfig(map[string]interface{}{ + "value": v, + }) + + if err != nil { + return nil, fmt.Errorf( + "error parsing local value %q at %s: %s", + k, item.Val.Pos(), err, + ) + } + + result = append(result, &Local{ + Name: k, + RawConfig: rawConfig, + }) + } + } + } + + return result, nil +} + // LoadOutputsHcl recurses into the given HCL object and turns // it into a mapping of outputs. func loadOutputsHcl(list *ast.ObjectList) ([]*Output, error) { - list = list.Children() - if len(list.Items) == 0 { - return nil, fmt.Errorf( - "'output' must be followed by exactly one string: a name") + if err := assertAllBlocksHaveNames("output", list); err != nil { + return nil, err } + list = list.Children() + // Go through each object and turn it into an actual result. result := make([]*Output, 0, len(list.Items)) for _, item := range list.Items { @@ -403,6 +499,7 @@ func loadOutputsHcl(list *ast.ObjectList) ([]*Output, error) { // Delete special keys delete(config, "depends_on") + delete(config, "description") rawConfig, err := NewRawConfig(config) if err != nil { @@ -424,10 +521,23 @@ func loadOutputsHcl(list *ast.ObjectList) ([]*Output, error) { } } + // If we have a description field, then filter that + var description string + if o := listVal.Filter("description"); len(o.Items) > 0 { + err := hcl.DecodeObject(&description, o.Items[0].Val) + if err != nil { + return nil, fmt.Errorf( + "Error reading description for output %q: %s", + n, + err) + } + } + result = append(result, &Output{ - Name: n, - RawConfig: rawConfig, - DependsOn: dependsOn, + Name: n, + RawConfig: rawConfig, + DependsOn: dependsOn, + Description: description, }) } @@ -437,12 +547,12 @@ func loadOutputsHcl(list *ast.ObjectList) ([]*Output, error) { // LoadVariablesHcl recurses into the given HCL object and turns // it into a list of variables. func loadVariablesHcl(list *ast.ObjectList) ([]*Variable, error) { - list = list.Children() - if len(list.Items) == 0 { - return nil, fmt.Errorf( - "'variable' must be followed by exactly one strings: a name") + if err := assertAllBlocksHaveNames("variable", list); err != nil { + return nil, err } + list = list.Children() + // hclVariable is the structure each variable is decoded into type hclVariable struct { DeclaredType string `hcl:"type"` @@ -518,6 +628,10 @@ func loadVariablesHcl(list *ast.ObjectList) ([]*Variable, error) { // LoadProvidersHcl recurses into the given HCL object and turns // it into a mapping of provider configs. func loadProvidersHcl(list *ast.ObjectList) ([]*ProviderConfig, error) { + if err := assertAllBlocksHaveNames("provider", list); err != nil { + return nil, err + } + list = list.Children() if len(list.Items) == 0 { return nil, nil @@ -541,6 +655,7 @@ func loadProvidersHcl(list *ast.ObjectList) ([]*ProviderConfig, error) { } delete(config, "alias") + delete(config, "version") rawConfig, err := NewRawConfig(config) if err != nil { @@ -562,9 +677,22 @@ func loadProvidersHcl(list *ast.ObjectList) ([]*ProviderConfig, error) { } } + // If we have a version field then extract it + var version string + if a := listVal.Filter("version"); len(a.Items) > 0 { + err := hcl.DecodeObject(&version, a.Items[0].Val) + if err != nil { + return nil, fmt.Errorf( + "Error reading version for provider[%s]: %s", + n, + err) + } + } + result = append(result, &ProviderConfig{ Name: n, Alias: alias, + Version: version, RawConfig: rawConfig, }) } @@ -579,6 +707,10 @@ func loadProvidersHcl(list *ast.ObjectList) ([]*ProviderConfig, error) { // represents exactly one data definition in the HCL configuration. // We leave it up to another pass to merge them together. func loadDataResourcesHcl(list *ast.ObjectList) ([]*Resource, error) { + if err := assertAllBlocksHaveNames("data", list); err != nil { + return nil, err + } + list = list.Children() if len(list.Items) == 0 { return nil, nil @@ -888,6 +1020,10 @@ func loadManagedResourcesHcl(list *ast.ObjectList) ([]*Resource, error) { } func loadProvisionersHcl(list *ast.ObjectList, connInfo map[string]interface{}) ([]*Provisioner, error) { + if err := assertAllBlocksHaveNames("provisioner", list); err != nil { + return nil, err + } + list = list.Children() if len(list.Items) == 0 { return nil, nil @@ -1010,6 +1146,29 @@ func hclObjectMap(os *hclobj.Object) map[string]ast.ListNode { } */ +// assertAllBlocksHaveNames returns an error if any of the items in +// the given object list are blocks without keys (like "module {}") +// or simple assignments (like "module = 1"). It returns nil if +// neither of these things are true. +// +// The given name is used in any generated error messages, and should +// be the name of the block we're dealing with. The given list should +// be the result of calling .Filter on an object list with that same +// name. +func assertAllBlocksHaveNames(name string, list *ast.ObjectList) error { + if elem := list.Elem(); len(elem.Items) != 0 { + switch et := elem.Items[0].Val.(type) { + case *ast.ObjectType: + pos := et.Lbrace + return fmt.Errorf("%s: %q must be followed by a name", pos, name) + default: + pos := elem.Items[0].Val.Pos() + return fmt.Errorf("%s: %q must be a configuration block", pos, name) + } + } + return nil +} + func checkHCLKeys(node ast.Node, valid []string) error { var list *ast.ObjectList switch n := node.(type) { diff --git a/vendor/github.com/hashicorp/terraform/config/merge.go b/vendor/github.com/hashicorp/terraform/config/merge.go index 2e76865..23798d6 100644 --- a/vendor/github.com/hashicorp/terraform/config/merge.go +++ b/vendor/github.com/hashicorp/terraform/config/merge.go @@ -32,9 +32,13 @@ func Merge(c1, c2 *Config) (*Config, error) { c.Atlas = c2.Atlas } - // Merge the Terraform configuration, which is a complete overwrite. - c.Terraform = c1.Terraform - if c2.Terraform != nil { + // Merge the Terraform configuration + if c1.Terraform != nil { + c.Terraform = c1.Terraform + if c2.Terraform != nil { + c.Terraform.Merge(c2.Terraform) + } + } else { c.Terraform = c2.Terraform } @@ -133,6 +137,21 @@ func Merge(c1, c2 *Config) (*Config, error) { } } + // Local Values + // These are simpler than the other config elements because they are just + // flat values and so no deep merging is required. + if localsCount := len(c1.Locals) + len(c2.Locals); localsCount != 0 { + // Explicit length check above because we want c.Locals to remain + // nil if the result would be empty. + c.Locals = make([]*Local, 0, len(c1.Locals)+len(c2.Locals)) + for _, v := range c1.Locals { + c.Locals = append(c.Locals, v) + } + for _, v := range c2.Locals { + c.Locals = append(c.Locals, v) + } + } + return c, nil } diff --git a/vendor/github.com/hashicorp/terraform/config/module/get.go b/vendor/github.com/hashicorp/terraform/config/module/get.go index 96b4a63..ba9d292 100644 --- a/vendor/github.com/hashicorp/terraform/config/module/get.go +++ b/vendor/github.com/hashicorp/terraform/config/module/get.go @@ -1,10 +1,18 @@ package module import ( + "fmt" "io/ioutil" + "log" + "net/http" + "net/url" "os" + "regexp" + "strings" "github.com/hashicorp/go-getter" + + cleanhttp "github.com/hashicorp/go-cleanhttp" ) // GetMode is an enum that describes how modules are loaded. @@ -69,3 +77,131 @@ func getStorage(s getter.Storage, key string, src string, mode GetMode) (string, // Get the directory where the module is. return s.Dir(key) } + +const ( + registryAPI = "https://registry.terraform.io/v1/modules/" + xTerraformGet = "X-Terraform-Get" +) + +var detectors = []getter.Detector{ + new(getter.GitHubDetector), + new(getter.BitBucketDetector), + new(getter.S3Detector), + new(localDetector), + new(registryDetector), +} + +// these prefixes can't be registry IDs +// "http", "./", "/", "getter::" +var skipRegistry = regexp.MustCompile(`^(http|\./|/|[A-Za-z0-9]+::)`).MatchString + +// registryDetector implements getter.Detector to detect Terraform Registry modules. +// If a path looks like a registry module identifier, attempt to locate it in +// the registry. If it's not found, pass it on in case it can be found by +// other means. +type registryDetector struct { + // override the default registry URL + api string + + client *http.Client +} + +func (d registryDetector) Detect(src, _ string) (string, bool, error) { + // the namespace can't start with "http", a relative or absolute path, or + // contain a go-getter "forced getter" + if skipRegistry(src) { + return "", false, nil + } + + // there are 3 parts to a registry ID + if len(strings.Split(src, "/")) != 3 { + return "", false, nil + } + + return d.lookupModule(src) +} + +// Lookup the module in the registry. +func (d registryDetector) lookupModule(src string) (string, bool, error) { + if d.api == "" { + d.api = registryAPI + } + + if d.client == nil { + d.client = cleanhttp.DefaultClient() + } + + // src is already partially validated in Detect. We know it's a path, and + // if it can be parsed as a URL we will hand it off to the registry to + // determine if it's truly valid. + resp, err := d.client.Get(fmt.Sprintf("%s/%s/download", d.api, src)) + if err != nil { + log.Printf("[WARN] error looking up module %q: %s", src, err) + return "", false, nil + } + defer resp.Body.Close() + + // there should be no body, but save it for logging + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + fmt.Printf("[WARN] error reading response body from registry: %s", err) + return "", false, nil + } + + switch resp.StatusCode { + case http.StatusOK, http.StatusNoContent: + // OK + case http.StatusNotFound: + log.Printf("[INFO] module %q not found in registry", src) + return "", false, nil + default: + // anything else is an error: + log.Printf("[WARN] error getting download location for %q: %s resp:%s", src, resp.Status, body) + return "", false, nil + } + + // the download location is in the X-Terraform-Get header + location := resp.Header.Get(xTerraformGet) + if location == "" { + return "", false, fmt.Errorf("failed to get download URL for %q: %s resp:%s", src, resp.Status, body) + } + + return location, true, nil +} + +// localDetector wraps the default getter.FileDetector and checks if the module +// exists in the local filesystem. The default FileDetector only converts paths +// into file URLs, and returns found. We want to first check for a local module +// before passing it off to the registryDetector so we don't inadvertently +// replace a local module with a registry module of the same name. +type localDetector struct{} + +func (d localDetector) Detect(src, wd string) (string, bool, error) { + localSrc, ok, err := new(getter.FileDetector).Detect(src, wd) + if err != nil { + return src, ok, err + } + + if !ok { + return "", false, nil + } + + u, err := url.Parse(localSrc) + if err != nil { + return "", false, err + } + + _, err = os.Stat(u.Path) + + // just continue detection if it doesn't exist + if os.IsNotExist(err) { + return "", false, nil + } + + // return any other errors + if err != nil { + return "", false, err + } + + return localSrc, true, nil +} diff --git a/vendor/github.com/hashicorp/terraform/config/module/tree.go b/vendor/github.com/hashicorp/terraform/config/module/tree.go index 8ce24a3..4fdd20e 100644 --- a/vendor/github.com/hashicorp/terraform/config/module/tree.go +++ b/vendor/github.com/hashicorp/terraform/config/module/tree.go @@ -3,7 +3,11 @@ package module import ( "bufio" "bytes" + "encoding/json" "fmt" + "io/ioutil" + "log" + "os" "path/filepath" "strings" "sync" @@ -92,6 +96,25 @@ func (t *Tree) Children() map[string]*Tree { return t.children } +// DeepEach calls the provided callback for the receiver and then all of +// its descendents in the tree, allowing an operation to be performed on +// all modules in the tree. +// +// Parents will be visited before their children but otherwise the order is +// not defined. +func (t *Tree) DeepEach(cb func(*Tree)) { + t.lock.RLock() + defer t.lock.RUnlock() + t.deepEach(cb) +} + +func (t *Tree) deepEach(cb func(*Tree)) { + cb(t) + for _, c := range t.children { + c.deepEach(cb) + } +} + // Loaded says whether or not this tree has been loaded or not yet. func (t *Tree) Loaded() bool { t.lock.RLock() @@ -158,23 +181,74 @@ func (t *Tree) Load(s getter.Storage, mode GetMode) error { copy(path, t.path) path = append(path, m.Name) - // Split out the subdir if we have one + // The key is the string that will be hashed to uniquely id the Source. + // The leading digit can be incremented to force re-fetch all existing + // modules. + key := fmt.Sprintf("0.root.%s-%s", strings.Join(path, "."), m.Source) + + log.Printf("[TRACE] module source %q", m.Source) + // Split out the subdir if we have one. + // Terraform keeps the entire requested tree for now, so that modules can + // reference sibling modules from the same archive or repo. source, subDir := getter.SourceDirSubdir(m.Source) - source, err := getter.Detect(source, t.config.Dir, getter.Detectors) + // First check if we we need to download anything. + // This is also checked by the getter.Storage implementation, but we + // want to be able to short-circuit the detection as well, since some + // detectors may need to make external calls. + dir, found, err := s.Dir(key) + if err != nil { + return err + } + + // looks like we already have it + // In order to load the Tree we need to find out if there was another + // subDir stored from discovery. + if found && mode != GetModeUpdate { + subDir, err := t.getSubdir(dir) + if err != nil { + // If there's a problem with the subdir record, we'll let the + // recordSubdir method fix it up. Any other errors filesystem + // errors will turn up again below. + log.Println("[WARN] error reading subdir record:", err) + } else { + dir := filepath.Join(dir, subDir) + // Load the configurations.Dir(source) + children[m.Name], err = NewTreeModule(m.Name, dir) + if err != nil { + return fmt.Errorf("module %s: %s", m.Name, err) + } + // Set the path of this child + children[m.Name].path = path + continue + } + } + + log.Printf("[TRACE] module source: %q", source) + + source, err = getter.Detect(source, t.config.Dir, detectors) if err != nil { return fmt.Errorf("module %s: %s", m.Name, err) } + log.Printf("[TRACE] detected module source %q", source) + // Check if the detector introduced something new. + // For example, the registry always adds a subdir of `//*`, + // indicating that we need to strip off the first component from the + // tar archive, though we may not yet know what it is called. + // + // TODO: This can cause us to lose the previously detected subdir. It + // was never an issue before, since none of the supported detectors + // previously had this behavior, but we may want to add this ability to + // registry modules. source, subDir2 := getter.SourceDirSubdir(source) if subDir2 != "" { - subDir = filepath.Join(subDir2, subDir) + subDir = subDir2 } - // Get the directory where this module is so we can load it - key := strings.Join(path, ".") - key = fmt.Sprintf("root.%s-%s", key, m.Source) + log.Printf("[TRACE] getting module source %q", source) + dir, ok, err := getStorage(s, key, source, mode) if err != nil { return err @@ -184,18 +258,31 @@ func (t *Tree) Load(s getter.Storage, mode GetMode) error { "module %s: not found, may need to be downloaded using 'terraform get'", m.Name) } - // If we have a subdirectory, then merge that in + // expand and record the subDir for later if subDir != "" { - dir = filepath.Join(dir, subDir) + fullDir, err := getter.SubdirGlob(dir, subDir) + if err != nil { + return err + } + + // +1 to account for the pathsep + if len(dir)+1 > len(fullDir) { + return fmt.Errorf("invalid module storage path %q", fullDir) + } + + subDir = fullDir[len(dir)+1:] + + if err := t.recordSubdir(dir, subDir); err != nil { + return err + } + dir = fullDir } // Load the configurations.Dir(source) children[m.Name], err = NewTreeModule(m.Name, dir) if err != nil { - return fmt.Errorf( - "module %s: %s", m.Name, err) + return fmt.Errorf("module %s: %s", m.Name, err) } - // Set the path of this child children[m.Name].path = path } @@ -213,6 +300,65 @@ func (t *Tree) Load(s getter.Storage, mode GetMode) error { return nil } +func subdirRecordsPath(dir string) string { + const filename = "module-subdir.json" + // Get the parent directory. + // The current FolderStorage implementation needed to be able to create + // this directory, so we can be reasonably certain we can use it. + parent := filepath.Dir(filepath.Clean(dir)) + return filepath.Join(parent, filename) +} + +// unmarshal the records file in the parent directory. Always returns a valid map. +func loadSubdirRecords(dir string) (map[string]string, error) { + records := map[string]string{} + + recordsPath := subdirRecordsPath(dir) + data, err := ioutil.ReadFile(recordsPath) + if err != nil && !os.IsNotExist(err) { + return records, err + } + + if len(data) == 0 { + return records, nil + } + + if err := json.Unmarshal(data, &records); err != nil { + return records, err + } + return records, nil +} + +func (t *Tree) getSubdir(dir string) (string, error) { + records, err := loadSubdirRecords(dir) + if err != nil { + return "", err + } + + return records[dir], nil +} + +// Mark the location of a detected subdir in a top-level file so we +// can skip detection when not updating the module. +func (t *Tree) recordSubdir(dir, subdir string) error { + records, err := loadSubdirRecords(dir) + if err != nil { + // if there was a problem with the file, we will attempt to write a new + // one. Any non-data related error should surface there. + log.Printf("[WARN] error reading subdir records: %s", err) + } + + records[dir] = subdir + + js, err := json.Marshal(records) + if err != nil { + return err + } + + recordsPath := subdirRecordsPath(dir) + return ioutil.WriteFile(recordsPath, js, 0644) +} + // Path is the full path to this tree. func (t *Tree) Path() []string { return t.path @@ -354,8 +500,10 @@ func (t *Tree) Validate() error { tree, ok := children[mv.Name] if !ok { - // This should never happen because Load watches us - panic("module not found in children: " + mv.Name) + newErr.Add(fmt.Errorf( + "%s: undefined module referenced %s", + source, mv.Name)) + continue } found := false diff --git a/vendor/github.com/hashicorp/terraform/config/providers.go b/vendor/github.com/hashicorp/terraform/config/providers.go new file mode 100644 index 0000000..7a50782 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/config/providers.go @@ -0,0 +1,103 @@ +package config + +import "github.com/blang/semver" + +// ProviderVersionConstraint presents a constraint for a particular +// provider, identified by its full name. +type ProviderVersionConstraint struct { + Constraint string + ProviderType string +} + +// ProviderVersionConstraints is a map from provider full name to its associated +// ProviderVersionConstraint, as produced by Config.RequiredProviders. +type ProviderVersionConstraints map[string]ProviderVersionConstraint + +// RequiredProviders returns the ProviderVersionConstraints for this +// module. +// +// This includes both providers that are explicitly requested by provider +// blocks and those that are used implicitly by instantiating one of their +// resource types. In the latter case, the returned semver Range will +// accept any version of the provider. +func (c *Config) RequiredProviders() ProviderVersionConstraints { + ret := make(ProviderVersionConstraints, len(c.ProviderConfigs)) + + configs := c.ProviderConfigsByFullName() + + // In order to find the *implied* dependencies (those without explicit + // "provider" blocks) we need to walk over all of the resources and + // cross-reference with the provider configs. + for _, rc := range c.Resources { + providerName := rc.ProviderFullName() + var providerType string + + // Default to (effectively) no constraint whatsoever, but we might + // override if there's an explicit constraint in config. + constraint := ">=0.0.0" + + config, ok := configs[providerName] + if ok { + if config.Version != "" { + constraint = config.Version + } + providerType = config.Name + } else { + providerType = providerName + } + + ret[providerName] = ProviderVersionConstraint{ + ProviderType: providerType, + Constraint: constraint, + } + } + + return ret +} + +// RequiredRanges returns a semver.Range for each distinct provider type in +// the constraint map. If the same provider type appears more than once +// (e.g. because aliases are in use) then their respective constraints are +// combined such that they must *all* apply. +// +// The result of this method can be passed to the +// PluginMetaSet.ConstrainVersions method within the plugin/discovery +// package in order to filter down the available plugins to those which +// satisfy the given constraints. +// +// This function will panic if any of the constraints within cannot be +// parsed as semver ranges. This is guaranteed to never happen for a +// constraint set that was built from a configuration that passed validation. +func (cons ProviderVersionConstraints) RequiredRanges() map[string]semver.Range { + ret := make(map[string]semver.Range, len(cons)) + + for _, con := range cons { + spec := semver.MustParseRange(con.Constraint) + if existing, exists := ret[con.ProviderType]; exists { + ret[con.ProviderType] = existing.AND(spec) + } else { + ret[con.ProviderType] = spec + } + } + + return ret +} + +// ProviderConfigsByFullName returns a map from provider full names (as +// returned by ProviderConfig.FullName()) to the corresponding provider +// configs. +// +// This function returns no new information than what's already in +// c.ProviderConfigs, but returns it in a more convenient shape. If there +// is more than one provider config with the same full name then the result +// is undefined, but that is guaranteed not to happen for any config that +// has passed validation. +func (c *Config) ProviderConfigsByFullName() map[string]*ProviderConfig { + ret := make(map[string]*ProviderConfig, len(c.ProviderConfigs)) + + for _, pc := range c.ProviderConfigs { + ret[pc.FullName()] = pc + } + + return ret +} diff --git a/vendor/github.com/hashicorp/terraform/config/resource_mode_string.go b/vendor/github.com/hashicorp/terraform/config/resource_mode_string.go index 930645f..ea68b4f 100644 --- a/vendor/github.com/hashicorp/terraform/config/resource_mode_string.go +++ b/vendor/github.com/hashicorp/terraform/config/resource_mode_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type=ResourceMode -output=resource_mode_string.go resource_mode.go"; DO NOT EDIT +// Code generated by "stringer -type=ResourceMode -output=resource_mode_string.go resource_mode.go"; DO NOT EDIT. package config diff --git a/vendor/github.com/hashicorp/terraform/config/testing.go b/vendor/github.com/hashicorp/terraform/config/testing.go index f7bfadd..831fc77 100644 --- a/vendor/github.com/hashicorp/terraform/config/testing.go +++ b/vendor/github.com/hashicorp/terraform/config/testing.go @@ -6,6 +6,8 @@ import ( // TestRawConfig is used to create a RawConfig for testing. func TestRawConfig(t *testing.T, c map[string]interface{}) *RawConfig { + t.Helper() + cfg, err := NewRawConfig(c) if err != nil { t.Fatalf("err: %s", err) diff --git a/vendor/github.com/hashicorp/terraform/dag/set.go b/vendor/github.com/hashicorp/terraform/dag/set.go index 3929c9d..92b4215 100644 --- a/vendor/github.com/hashicorp/terraform/dag/set.go +++ b/vendor/github.com/hashicorp/terraform/dag/set.go @@ -81,6 +81,20 @@ func (s *Set) Difference(other *Set) *Set { return result } +// Filter returns a set that contains the elements from the receiver +// where the given callback returns true. +func (s *Set) Filter(cb func(interface{}) bool) *Set { + result := new(Set) + + for _, v := range s.m { + if cb(v) { + result.Add(v) + } + } + + return result +} + // Len is the number of items in the set. func (s *Set) Len() int { if s == nil { diff --git a/vendor/github.com/hashicorp/terraform/dag/walk.go b/vendor/github.com/hashicorp/terraform/dag/walk.go index a74f114..f03b100 100644 --- a/vendor/github.com/hashicorp/terraform/dag/walk.go +++ b/vendor/github.com/hashicorp/terraform/dag/walk.go @@ -166,7 +166,7 @@ func (w *Walker) Update(g *AcyclicGraph) { w.wait.Add(1) // Add to our own set so we know about it already - log.Printf("[DEBUG] dag/walk: added new vertex: %q", VertexName(v)) + log.Printf("[TRACE] dag/walk: added new vertex: %q", VertexName(v)) w.vertices.Add(raw) // Initialize the vertex info @@ -198,7 +198,7 @@ func (w *Walker) Update(g *AcyclicGraph) { // Delete it out of the map delete(w.vertexMap, v) - log.Printf("[DEBUG] dag/walk: removed vertex: %q", VertexName(v)) + log.Printf("[TRACE] dag/walk: removed vertex: %q", VertexName(v)) w.vertices.Delete(raw) } @@ -229,7 +229,7 @@ func (w *Walker) Update(g *AcyclicGraph) { changedDeps.Add(waiter) log.Printf( - "[DEBUG] dag/walk: added edge: %q waiting on %q", + "[TRACE] dag/walk: added edge: %q waiting on %q", VertexName(waiter), VertexName(dep)) w.edges.Add(raw) } @@ -253,7 +253,7 @@ func (w *Walker) Update(g *AcyclicGraph) { changedDeps.Add(waiter) log.Printf( - "[DEBUG] dag/walk: removed edge: %q waiting on %q", + "[TRACE] dag/walk: removed edge: %q waiting on %q", VertexName(waiter), VertexName(dep)) w.edges.Delete(raw) } @@ -296,7 +296,7 @@ func (w *Walker) Update(g *AcyclicGraph) { info.depsCancelCh = cancelCh log.Printf( - "[DEBUG] dag/walk: dependencies changed for %q, sending new deps", + "[TRACE] dag/walk: dependencies changed for %q, sending new deps", VertexName(v)) // Start the waiter @@ -352,7 +352,7 @@ func (w *Walker) walkVertex(v Vertex, info *walkerVertex) { } // Check if we have updated dependencies. This can happen if the - // dependencies were satisfied exactly prior to an Update occuring. + // dependencies were satisfied exactly prior to an Update occurring. // In that case, we'd like to take into account new dependencies // if possible. info.DepsLock.Lock() @@ -383,10 +383,10 @@ func (w *Walker) walkVertex(v Vertex, info *walkerVertex) { // Run our callback or note that our upstream failed var err error if depsSuccess { - log.Printf("[DEBUG] dag/walk: walking %q", VertexName(v)) + log.Printf("[TRACE] dag/walk: walking %q", VertexName(v)) err = w.Callback(v) } else { - log.Printf("[DEBUG] dag/walk: upstream errored, not walking %q", VertexName(v)) + log.Printf("[TRACE] dag/walk: upstream errored, not walking %q", VertexName(v)) err = errWalkUpstream } @@ -423,7 +423,7 @@ func (w *Walker) waitDeps( return case <-time.After(time.Second * 5): - log.Printf("[DEBUG] dag/walk: vertex %q, waiting for: %q", + log.Printf("[TRACE] dag/walk: vertex %q, waiting for: %q", VertexName(v), VertexName(dep)) } } diff --git a/vendor/github.com/hashicorp/terraform/flatmap/expand.go b/vendor/github.com/hashicorp/terraform/flatmap/expand.go index e325077..1449065 100644 --- a/vendor/github.com/hashicorp/terraform/flatmap/expand.go +++ b/vendor/github.com/hashicorp/terraform/flatmap/expand.go @@ -37,7 +37,7 @@ func Expand(m map[string]string, key string) interface{} { // Check if this is a prefix in the map prefix := key + "." - for k, _ := range m { + for k := range m { if strings.HasPrefix(k, prefix) { return expandMap(m, prefix) } @@ -52,9 +52,22 @@ func expandArray(m map[string]string, prefix string) []interface{} { panic(err) } - // The Schema "Set" type stores its values in an array format, but using - // numeric hash values instead of ordinal keys. Take the set of keys - // regardless of value, and expand them in numeric order. + // If the number of elements in this array is 0, then return an + // empty slice as there is nothing to expand. Trying to expand it + // anyway could lead to crashes as any child maps, arrays or sets + // that no longer exist are still shown as empty with a count of 0. + if num == 0 { + return []interface{}{} + } + + // NOTE: "num" is not necessarily accurate, e.g. if a user tampers + // with state, so the following code should not crash when given a + // number of items more or less than what's given in num. The + // num key is mainly just a hint that this is a list or set. + + // The Schema "Set" type stores its values in an array format, but + // using numeric hash values instead of ordinal keys. Take the set + // of keys regardless of value, and expand them in numeric order. // See GH-11042 for more details. keySet := map[int]bool{} computed := map[string]bool{} @@ -93,7 +106,7 @@ func expandArray(m map[string]string, prefix string) []interface{} { } sort.Ints(keysList) - result := make([]interface{}, num) + result := make([]interface{}, len(keysList)) for i, key := range keysList { keyString := strconv.Itoa(key) if computed[keyString] { @@ -106,8 +119,14 @@ func expandArray(m map[string]string, prefix string) []interface{} { } func expandMap(m map[string]string, prefix string) map[string]interface{} { + // Submaps may not have a '%' key, so we can't count on this value being + // here. If we don't have a count, just proceed as if we have have a map. + if count, ok := m[prefix+"%"]; ok && count == "0" { + return map[string]interface{}{} + } + result := make(map[string]interface{}) - for k, _ := range m { + for k := range m { if !strings.HasPrefix(k, prefix) { continue } @@ -125,6 +144,7 @@ func expandMap(m map[string]string, prefix string) map[string]interface{} { if key == "%" { continue } + result[key] = Expand(m, k[:len(prefix)+len(key)]) } diff --git a/vendor/github.com/hashicorp/terraform/helper/encryption/encryption.go b/vendor/github.com/hashicorp/terraform/helper/encryption/encryption.go deleted file mode 100644 index a565c6d..0000000 --- a/vendor/github.com/hashicorp/terraform/helper/encryption/encryption.go +++ /dev/null @@ -1,40 +0,0 @@ -package encryption - -import ( - "encoding/base64" - "fmt" - "strings" - - "github.com/hashicorp/errwrap" - "github.com/hashicorp/vault/helper/pgpkeys" -) - -// RetrieveGPGKey returns the PGP key specified as the pgpKey parameter, or queries -// the public key from the keybase service if the parameter is a keybase username -// prefixed with the phrase "keybase:" -func RetrieveGPGKey(pgpKey string) (string, error) { - const keybasePrefix = "keybase:" - - encryptionKey := pgpKey - if strings.HasPrefix(pgpKey, keybasePrefix) { - publicKeys, err := pgpkeys.FetchKeybasePubkeys([]string{pgpKey}) - if err != nil { - return "", errwrap.Wrapf(fmt.Sprintf("Error retrieving Public Key for %s: {{err}}", pgpKey), err) - } - encryptionKey = publicKeys[pgpKey] - } - - return encryptionKey, nil -} - -// EncryptValue encrypts the given value with the given encryption key. Description -// should be set such that errors return a meaningful user-facing response. -func EncryptValue(encryptionKey, value, description string) (string, string, error) { - fingerprints, encryptedValue, err := - pgpkeys.EncryptShares([][]byte{[]byte(value)}, []string{encryptionKey}) - if err != nil { - return "", "", errwrap.Wrapf(fmt.Sprintf("Error encrypting %s: {{err}}", description), err) - } - - return fingerprints[0], base64.StdEncoding.EncodeToString(encryptedValue[0]), nil -} diff --git a/vendor/github.com/hashicorp/terraform/helper/logging/transport.go b/vendor/github.com/hashicorp/terraform/helper/logging/transport.go new file mode 100644 index 0000000..4477924 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/helper/logging/transport.go @@ -0,0 +1,53 @@ +package logging + +import ( + "log" + "net/http" + "net/http/httputil" +) + +type transport struct { + name string + transport http.RoundTripper +} + +func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) { + if IsDebugOrHigher() { + reqData, err := httputil.DumpRequestOut(req, true) + if err == nil { + log.Printf("[DEBUG] "+logReqMsg, t.name, string(reqData)) + } else { + log.Printf("[ERROR] %s API Request error: %#v", t.name, err) + } + } + + resp, err := t.transport.RoundTrip(req) + if err != nil { + return resp, err + } + + if IsDebugOrHigher() { + respData, err := httputil.DumpResponse(resp, true) + if err == nil { + log.Printf("[DEBUG] "+logRespMsg, t.name, string(respData)) + } else { + log.Printf("[ERROR] %s API Response error: %#v", t.name, err) + } + } + + return resp, nil +} + +func NewTransport(name string, t http.RoundTripper) *transport { + return &transport{name, t} +} + +const logReqMsg = `%s API Request Details: +---[ REQUEST ]--------------------------------------- +%s +-----------------------------------------------------` + +const logRespMsg = `%s API Response Details: +---[ RESPONSE ]-------------------------------------- +%s +-----------------------------------------------------` diff --git a/vendor/github.com/hashicorp/terraform/helper/mutexkv/mutexkv.go b/vendor/github.com/hashicorp/terraform/helper/mutexkv/mutexkv.go deleted file mode 100644 index 6917f21..0000000 --- a/vendor/github.com/hashicorp/terraform/helper/mutexkv/mutexkv.go +++ /dev/null @@ -1,51 +0,0 @@ -package mutexkv - -import ( - "log" - "sync" -) - -// MutexKV is a simple key/value store for arbitrary mutexes. It can be used to -// serialize changes across arbitrary collaborators that share knowledge of the -// keys they must serialize on. -// -// The initial use case is to let aws_security_group_rule resources serialize -// their access to individual security groups based on SG ID. -type MutexKV struct { - lock sync.Mutex - store map[string]*sync.Mutex -} - -// Locks the mutex for the given key. Caller is responsible for calling Unlock -// for the same key -func (m *MutexKV) Lock(key string) { - log.Printf("[DEBUG] Locking %q", key) - m.get(key).Lock() - log.Printf("[DEBUG] Locked %q", key) -} - -// Unlock the mutex for the given key. Caller must have called Lock for the same key first -func (m *MutexKV) Unlock(key string) { - log.Printf("[DEBUG] Unlocking %q", key) - m.get(key).Unlock() - log.Printf("[DEBUG] Unlocked %q", key) -} - -// Returns a mutex for the given key, no guarantee of its lock status -func (m *MutexKV) get(key string) *sync.Mutex { - m.lock.Lock() - defer m.lock.Unlock() - mutex, ok := m.store[key] - if !ok { - mutex = &sync.Mutex{} - m.store[key] = mutex - } - return mutex -} - -// Returns a properly initalized MutexKV -func NewMutexKV() *MutexKV { - return &MutexKV{ - store: make(map[string]*sync.Mutex), - } -} diff --git a/vendor/github.com/hashicorp/terraform/helper/resource/id.go b/vendor/github.com/hashicorp/terraform/helper/resource/id.go index 629582b..1cde67c 100644 --- a/vendor/github.com/hashicorp/terraform/helper/resource/id.go +++ b/vendor/github.com/hashicorp/terraform/helper/resource/id.go @@ -1,21 +1,17 @@ package resource import ( - "crypto/rand" "fmt" - "math/big" + "strings" "sync" + "time" ) const UniqueIdPrefix = `terraform-` -// idCounter is a randomly seeded monotonic counter for generating ordered -// unique ids. It uses a big.Int so we can easily increment a long numeric -// string. The max possible hex value here with 12 random bytes is -// "01000000000000000000000000", so there's no chance of rollover during -// operation. +// idCounter is a monotonic counter for generating ordered unique ids. var idMutex sync.Mutex -var idCounter = big.NewInt(0).SetBytes(randomBytes(12)) +var idCounter uint32 // Helper for a resource to generate a unique identifier w/ default prefix func UniqueId() string { @@ -25,15 +21,20 @@ func UniqueId() string { // Helper for a resource to generate a unique identifier w/ given prefix // // After the prefix, the ID consists of an incrementing 26 digit value (to match -// previous timestamp output). +// previous timestamp output). After the prefix, the ID consists of a timestamp +// and an incrementing 8 hex digit value The timestamp means that multiple IDs +// created with the same prefix will sort in the order of their creation, even +// across multiple terraform executions, as long as the clock is not turned back +// between calls, and as long as any given terraform execution generates fewer +// than 4 billion IDs. func PrefixedUniqueId(prefix string) string { + // Be precise to 4 digits of fractional seconds, but remove the dot before the + // fractional seconds. + timestamp := strings.Replace( + time.Now().UTC().Format("20060102150405.0000"), ".", "", 1) + idMutex.Lock() defer idMutex.Unlock() - return fmt.Sprintf("%s%026x", prefix, idCounter.Add(idCounter, big.NewInt(1))) -} - -func randomBytes(n int) []byte { - b := make([]byte, n) - rand.Read(b) - return b + idCounter++ + return fmt.Sprintf("%s%s%08x", prefix, timestamp, idCounter) } diff --git a/vendor/github.com/hashicorp/terraform/helper/resource/state.go b/vendor/github.com/hashicorp/terraform/helper/resource/state.go index aafa7f3..37c586a 100644 --- a/vendor/github.com/hashicorp/terraform/helper/resource/state.go +++ b/vendor/github.com/hashicorp/terraform/helper/resource/state.go @@ -2,10 +2,11 @@ package resource import ( "log" - "sync/atomic" "time" ) +var refreshGracePeriod = 30 * time.Second + // StateRefreshFunc is a function type used for StateChangeConf that is // responsible for refreshing the item being watched for a state change. // @@ -62,58 +63,76 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) { conf.ContinuousTargetOccurence = 1 } - // We can't safely read the result values if we timeout, so store them in - // an atomic.Value type Result struct { Result interface{} State string Error error + Done bool } - var lastResult atomic.Value - lastResult.Store(Result{}) - doneCh := make(chan struct{}) + // Read every result from the refresh loop, waiting for a positive result.Done. + resCh := make(chan Result, 1) + // cancellation channel for the refresh loop + cancelCh := make(chan struct{}) + + result := Result{} + go func() { - defer close(doneCh) + defer close(resCh) - // Wait for the delay time.Sleep(conf.Delay) - wait := 100 * time.Millisecond + // start with 0 delay for the first loop + var wait time.Duration for { + // store the last result + resCh <- result + + // wait and watch for cancellation + select { + case <-cancelCh: + return + case <-time.After(wait): + // first round had no wait + if wait == 0 { + wait = 100 * time.Millisecond + } + } + res, currentState, err := conf.Refresh() - result := Result{ + result = Result{ Result: res, State: currentState, Error: err, } - lastResult.Store(result) if err != nil { + resCh <- result return } // If we're waiting for the absence of a thing, then return if res == nil && len(conf.Target) == 0 { - targetOccurence += 1 + targetOccurence++ if conf.ContinuousTargetOccurence == targetOccurence { + result.Done = true + resCh <- result return - } else { - continue } + continue } if res == nil { // If we didn't find the resource, check if we have been // not finding it for awhile, and if so, report an error. - notfoundTick += 1 + notfoundTick++ if notfoundTick > conf.NotFoundChecks { result.Error = &NotFoundError{ LastError: err, Retries: notfoundTick, } - lastResult.Store(result) + resCh <- result return } } else { @@ -124,12 +143,13 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) { for _, allowed := range conf.Target { if currentState == allowed { found = true - targetOccurence += 1 + targetOccurence++ if conf.ContinuousTargetOccurence == targetOccurence { + result.Done = true + resCh <- result return - } else { - continue } + continue } } @@ -141,17 +161,23 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) { } } - if !found { + if !found && len(conf.Pending) > 0 { result.Error = &UnexpectedStateError{ LastError: err, State: result.State, ExpectedState: conf.Target, } - lastResult.Store(result) + resCh <- result return } } + // Wait between refreshes using exponential backoff, except when + // waiting for the target state to reoccur. + if targetOccurence == 0 { + wait *= 2 + } + // If a poll interval has been specified, choose that interval. // Otherwise bound the default value. if conf.PollInterval > 0 && conf.PollInterval < 180*time.Second { @@ -165,27 +191,69 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) { } log.Printf("[TRACE] Waiting %s before next try", wait) - time.Sleep(wait) - - // Wait between refreshes using exponential backoff, except when - // waiting for the target state to reoccur. - if targetOccurence == 0 { - wait *= 2 - } } }() - select { - case <-doneCh: - r := lastResult.Load().(Result) - return r.Result, r.Error - case <-time.After(conf.Timeout): - r := lastResult.Load().(Result) - return nil, &TimeoutError{ - LastError: r.Error, - LastState: r.State, - Timeout: conf.Timeout, - ExpectedState: conf.Target, + // store the last value result from the refresh loop + lastResult := Result{} + + timeout := time.After(conf.Timeout) + for { + select { + case r, ok := <-resCh: + // channel closed, so return the last result + if !ok { + return lastResult.Result, lastResult.Error + } + + // we reached the intended state + if r.Done { + return r.Result, r.Error + } + + // still waiting, store the last result + lastResult = r + + case <-timeout: + log.Printf("[WARN] WaitForState timeout after %s", conf.Timeout) + log.Printf("[WARN] WaitForState starting %s refresh grace period", refreshGracePeriod) + + // cancel the goroutine and start our grace period timer + close(cancelCh) + timeout := time.After(refreshGracePeriod) + + // we need a for loop and a label to break on, because we may have + // an extra response value to read, but still want to wait for the + // channel to close. + forSelect: + for { + select { + case r, ok := <-resCh: + if r.Done { + // the last refresh loop reached the desired state + return r.Result, r.Error + } + + if !ok { + // the goroutine returned + break forSelect + } + + // target state not reached, save the result for the + // TimeoutError and wait for the channel to close + lastResult = r + case <-timeout: + log.Println("[ERROR] WaitForState exceeded refresh grace period") + break forSelect + } + } + + return nil, &TimeoutError{ + LastError: lastResult.Error, + LastState: lastResult.State, + Timeout: conf.Timeout, + ExpectedState: conf.Target, + } } } } diff --git a/vendor/github.com/hashicorp/terraform/helper/resource/testing.go b/vendor/github.com/hashicorp/terraform/helper/resource/testing.go index c50d6d1..8db38a7 100644 --- a/vendor/github.com/hashicorp/terraform/helper/resource/testing.go +++ b/vendor/github.com/hashicorp/terraform/helper/resource/testing.go @@ -1,6 +1,7 @@ package resource import ( + "flag" "fmt" "io" "io/ioutil" @@ -20,6 +21,153 @@ import ( "github.com/hashicorp/terraform/terraform" ) +// flagSweep is a flag available when running tests on the command line. It +// contains a comma seperated list of regions to for the sweeper functions to +// run in. This flag bypasses the normal Test path and instead runs functions designed to +// clean up any leaked resources a testing environment could have created. It is +// a best effort attempt, and relies on Provider authors to implement "Sweeper" +// methods for resources. + +// Adding Sweeper methods with AddTestSweepers will +// construct a list of sweeper funcs to be called here. We iterate through +// regions provided by the sweep flag, and for each region we iterate through the +// tests, and exit on any errors. At time of writing, sweepers are ran +// sequentially, however they can list dependencies to be ran first. We track +// the sweepers that have been ran, so as to not run a sweeper twice for a given +// region. +// +// WARNING: +// Sweepers are designed to be destructive. You should not use the -sweep flag +// in any environment that is not strictly a test environment. Resources will be +// destroyed. + +var flagSweep = flag.String("sweep", "", "List of Regions to run available Sweepers") +var flagSweepRun = flag.String("sweep-run", "", "Comma seperated list of Sweeper Tests to run") +var sweeperFuncs map[string]*Sweeper + +// map of sweepers that have ran, and the success/fail status based on any error +// raised +var sweeperRunList map[string]bool + +// type SweeperFunc is a signature for a function that acts as a sweeper. It +// accepts a string for the region that the sweeper is to be ran in. This +// function must be able to construct a valid client for that region. +type SweeperFunc func(r string) error + +type Sweeper struct { + // Name for sweeper. Must be unique to be ran by the Sweeper Runner + Name string + + // Dependencies list the const names of other Sweeper functions that must be ran + // prior to running this Sweeper. This is an ordered list that will be invoked + // recursively at the helper/resource level + Dependencies []string + + // Sweeper function that when invoked sweeps the Provider of specific + // resources + F SweeperFunc +} + +func init() { + sweeperFuncs = make(map[string]*Sweeper) +} + +// AddTestSweepers function adds a given name and Sweeper configuration +// pair to the internal sweeperFuncs map. Invoke this function to register a +// resource sweeper to be available for running when the -sweep flag is used +// with `go test`. Sweeper names must be unique to help ensure a given sweeper +// is only ran once per run. +func AddTestSweepers(name string, s *Sweeper) { + if _, ok := sweeperFuncs[name]; ok { + log.Fatalf("[ERR] Error adding (%s) to sweeperFuncs: function already exists in map", name) + } + + sweeperFuncs[name] = s +} + +func TestMain(m *testing.M) { + flag.Parse() + if *flagSweep != "" { + // parse flagSweep contents for regions to run + regions := strings.Split(*flagSweep, ",") + + // get filtered list of sweepers to run based on sweep-run flag + sweepers := filterSweepers(*flagSweepRun, sweeperFuncs) + for _, region := range regions { + region = strings.TrimSpace(region) + // reset sweeperRunList for each region + sweeperRunList = map[string]bool{} + + log.Printf("[DEBUG] Running Sweepers for region (%s):\n", region) + for _, sweeper := range sweepers { + if err := runSweeperWithRegion(region, sweeper); err != nil { + log.Fatalf("[ERR] error running (%s): %s", sweeper.Name, err) + } + } + + log.Printf("Sweeper Tests ran:\n") + for s, _ := range sweeperRunList { + fmt.Printf("\t- %s\n", s) + } + } + } else { + os.Exit(m.Run()) + } +} + +// filterSweepers takes a comma seperated string listing the names of sweepers +// to be ran, and returns a filtered set from the list of all of sweepers to +// run based on the names given. +func filterSweepers(f string, source map[string]*Sweeper) map[string]*Sweeper { + filterSlice := strings.Split(strings.ToLower(f), ",") + if len(filterSlice) == 1 && filterSlice[0] == "" { + // if the filter slice is a single element of "" then no sweeper list was + // given, so just return the full list + return source + } + + sweepers := make(map[string]*Sweeper) + for name, sweeper := range source { + for _, s := range filterSlice { + if strings.Contains(strings.ToLower(name), s) { + sweepers[name] = sweeper + } + } + } + return sweepers +} + +// runSweeperWithRegion recieves a sweeper and a region, and recursively calls +// itself with that region for every dependency found for that sweeper. If there +// are no dependencies, invoke the contained sweeper fun with the region, and +// add the success/fail status to the sweeperRunList. +func runSweeperWithRegion(region string, s *Sweeper) error { + for _, dep := range s.Dependencies { + if depSweeper, ok := sweeperFuncs[dep]; ok { + log.Printf("[DEBUG] Sweeper (%s) has dependency (%s), running..", s.Name, dep) + if err := runSweeperWithRegion(region, depSweeper); err != nil { + return err + } + } else { + log.Printf("[DEBUG] Sweeper (%s) has dependency (%s), but that sweeper was not found", s.Name, dep) + } + } + + if _, ok := sweeperRunList[s.Name]; ok { + log.Printf("[DEBUG] Sweeper (%s) already ran in region (%s)", s.Name, region) + return nil + } + + runE := s.F(region) + if runE == nil { + sweeperRunList[s.Name] = true + } else { + sweeperRunList[s.Name] = false + } + + return runE +} + const TestEnvVar = "TF_ACC" // TestProvider can be implemented by any ResourceProvider to provide custom @@ -38,6 +186,10 @@ type TestCheckFunc func(*terraform.State) error // ImportStateCheckFunc is the check function for ImportState tests type ImportStateCheckFunc func([]*terraform.InstanceState) error +// ImportStateIdFunc is an ID generation function to help with complex ID +// generation for ImportState tests. +type ImportStateIdFunc func(*terraform.State) (string, error) + // TestCase is a single acceptance test case used to test the apply/destroy // lifecycle of a resource in a specific configuration. // @@ -151,10 +303,19 @@ type TestStep struct { // test to pass. ExpectError *regexp.Regexp + // PlanOnly can be set to only run `plan` with this configuration, and not + // actually apply it. This is useful for ensuring config changes result in + // no-op plans + PlanOnly bool + // PreventPostDestroyRefresh can be set to true for cases where data sources // are tested alongside real resources PreventPostDestroyRefresh bool + // SkipFunc is called before applying config, but after PreConfig + // This is useful for defining test steps with platform-dependent checks + SkipFunc func() (bool, error) + //--------------------------------------------------------------- // ImportState testing //--------------------------------------------------------------- @@ -169,6 +330,19 @@ type TestStep struct { // determined by inspecting the state for ResourceName's ID. ImportStateId string + // ImportStateIdPrefix is the prefix added in front of ImportStateId. + // This can be useful in complex import cases, where more than one + // attribute needs to be passed on as the Import ID. Mainly in cases + // where the ID is not known, and a known prefix needs to be added to + // the unset ImportStateId field. + ImportStateIdPrefix string + + // ImportStateIdFunc is a function that can be used to dynamically generate + // the ID for the ImportState tests. It is sent the state, which can be + // checked to derive the attributes necessary and generate the string in the + // desired format. + ImportStateIdFunc ImportStateIdFunc + // ImportStateCheck checks the results of ImportState. It should be // used to verify that the resulting value of ImportState has the // proper resources, IDs, and attributes. @@ -223,11 +397,11 @@ func Test(t TestT, c TestCase) { c.PreCheck() } - ctxProviders, err := testProviderFactories(c) + providerResolver, err := testProviderResolver(c) if err != nil { t.Fatal(err) } - opts := terraform.ContextOpts{Providers: ctxProviders} + opts := terraform.ContextOpts{ProviderResolver: providerResolver} // A single state variable to track the lifecycle, starting with no state var state *terraform.State @@ -238,17 +412,35 @@ func Test(t TestT, c TestCase) { errored := false for i, step := range c.Steps { var err error - log.Printf("[WARN] Test: Executing step %d", i) + log.Printf("[DEBUG] Test: Executing step %d", i) - // Determine the test mode to execute - if step.Config != "" { - state, err = testStepConfig(opts, state, step) - } else if step.ImportState { - state, err = testStepImportState(opts, state, step) - } else { + if step.SkipFunc != nil { + skip, err := step.SkipFunc() + if err != nil { + t.Fatal(err) + } + if skip { + log.Printf("[WARN] Skipping step %d", i) + continue + } + } + + if step.Config == "" && !step.ImportState { err = fmt.Errorf( "unknown test mode for step. Please see TestStep docs\n\n%#v", step) + } else { + if step.ImportState { + if step.Config == "" { + step.Config = testProviderConfig(c) + } + + // Can optionally set step.Config in addition to + // step.ImportState, to provide config for the import. + state, err = testStepImportState(opts, state, step) + } else { + state, err = testStepConfig(opts, state, step) + } } // If there was an error, exit @@ -336,32 +528,42 @@ func Test(t TestT, c TestCase) { } } -// testProviderFactories is a helper to build the ResourceProviderFactory map +// testProviderConfig takes the list of Providers in a TestCase and returns a +// config with only empty provider blocks. This is useful for Import, where no +// config is provided, but the providers must be defined. +func testProviderConfig(c TestCase) string { + var lines []string + for p := range c.Providers { + lines = append(lines, fmt.Sprintf("provider %q {}\n", p)) + } + + return strings.Join(lines, "") +} + +// testProviderResolver is a helper to build a ResourceProviderResolver // with pre instantiated ResourceProviders, so that we can reset them for the // test, while only calling the factory function once. // Any errors are stored so that they can be returned by the factory in // terraform to match non-test behavior. -func testProviderFactories(c TestCase) (map[string]terraform.ResourceProviderFactory, error) { - ctxProviders := make(map[string]terraform.ResourceProviderFactory) +func testProviderResolver(c TestCase) (terraform.ResourceProviderResolver, error) { + ctxProviders := c.ProviderFactories + if ctxProviders == nil { + ctxProviders = make(map[string]terraform.ResourceProviderFactory) + } // add any fixed providers for k, p := range c.Providers { ctxProviders[k] = terraform.ResourceProviderFactoryFixed(p) } - // call any factory functions and store the result. - for k, pf := range c.ProviderFactories { - p, err := pf() - ctxProviders[k] = func() (terraform.ResourceProvider, error) { - return p, err - } - } - // reset the providers if needed for k, pf := range ctxProviders { // we can ignore any errors here, if we don't have a provider to reset // the error will be handled later - p, _ := pf() + p, err := pf() + if err != nil { + return nil, err + } if p, ok := p.(TestProvider); ok { err := p.TestReset() if err != nil { @@ -370,7 +572,7 @@ func testProviderFactories(c TestCase) (map[string]terraform.ResourceProviderFac } } - return ctxProviders, nil + return terraform.ResourceProviderResolverFixed(ctxProviders), nil } // UnitTest is a helper to force the acceptance testing harness to run in the diff --git a/vendor/github.com/hashicorp/terraform/helper/resource/testing_config.go b/vendor/github.com/hashicorp/terraform/helper/resource/testing_config.go index b49fdc7..537a11c 100644 --- a/vendor/github.com/hashicorp/terraform/helper/resource/testing_config.go +++ b/vendor/github.com/hashicorp/terraform/helper/resource/testing_config.go @@ -53,34 +53,38 @@ func testStep( "Error refreshing: %s", err) } - // Plan! - if p, err := ctx.Plan(); err != nil { - return state, fmt.Errorf( - "Error planning: %s", err) - } else { - log.Printf("[WARN] Test: Step plan: %s", p) - } + // If this step is a PlanOnly step, skip over this first Plan and subsequent + // Apply, and use the follow up Plan that checks for perpetual diffs + if !step.PlanOnly { + // Plan! + if p, err := ctx.Plan(); err != nil { + return state, fmt.Errorf( + "Error planning: %s", err) + } else { + log.Printf("[WARN] Test: Step plan: %s", p) + } - // We need to keep a copy of the state prior to destroying - // such that destroy steps can verify their behaviour in the check - // function - stateBeforeApplication := state.DeepCopy() + // We need to keep a copy of the state prior to destroying + // such that destroy steps can verify their behaviour in the check + // function + stateBeforeApplication := state.DeepCopy() - // Apply! - state, err = ctx.Apply() - if err != nil { - return state, fmt.Errorf("Error applying: %s", err) - } + // Apply! + state, err = ctx.Apply() + if err != nil { + return state, fmt.Errorf("Error applying: %s", err) + } - // Check! Excitement! - if step.Check != nil { - if step.Destroy { - if err := step.Check(stateBeforeApplication); err != nil { - return state, fmt.Errorf("Check failed: %s", err) - } - } else { - if err := step.Check(state); err != nil { - return state, fmt.Errorf("Check failed: %s", err) + // Check! Excitement! + if step.Check != nil { + if step.Destroy { + if err := step.Check(stateBeforeApplication); err != nil { + return state, fmt.Errorf("Check failed: %s", err) + } + } else { + if err := step.Check(state); err != nil { + return state, fmt.Errorf("Check failed: %s", err) + } } } } diff --git a/vendor/github.com/hashicorp/terraform/helper/resource/testing_import_state.go b/vendor/github.com/hashicorp/terraform/helper/resource/testing_import_state.go index d5c5796..94fef3c 100644 --- a/vendor/github.com/hashicorp/terraform/helper/resource/testing_import_state.go +++ b/vendor/github.com/hashicorp/terraform/helper/resource/testing_import_state.go @@ -16,16 +16,29 @@ func testStepImportState( state *terraform.State, step TestStep) (*terraform.State, error) { // Determine the ID to import - importId := step.ImportStateId - if importId == "" { + var importId string + switch { + case step.ImportStateIdFunc != nil: + var err error + importId, err = step.ImportStateIdFunc(state) + if err != nil { + return state, err + } + case step.ImportStateId != "": + importId = step.ImportStateId + default: resource, err := testResource(step, state) if err != nil { return state, err } - importId = resource.Primary.ID } + importPrefix := step.ImportStateIdPrefix + if importPrefix != "" { + importId = fmt.Sprintf("%s%s", importPrefix, importId) + } + // Setup the context. We initialize with an empty state. We use the // full config for provider configurations. mod, err := testModule(opts, step) diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/backend.go b/vendor/github.com/hashicorp/terraform/helper/schema/backend.go index 33fe2c1..a0729c0 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/backend.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/backend.go @@ -28,8 +28,8 @@ type Backend struct { config *ResourceData } -const ( - backendConfigKey = iota +var ( + backendConfigKey = contextKey("backend config") ) // FromContextBackendConfig extracts a ResourceData with the configuration diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_diff.go b/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_diff.go index 16bbae2..644b93e 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_diff.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_diff.go @@ -29,29 +29,59 @@ type DiffFieldReader struct { Diff *terraform.InstanceDiff Source FieldReader Schema map[string]*Schema + + // cache for memoizing ReadField calls. + cache map[string]cachedFieldReadResult +} + +type cachedFieldReadResult struct { + val FieldReadResult + err error } func (r *DiffFieldReader) ReadField(address []string) (FieldReadResult, error) { + if r.cache == nil { + r.cache = make(map[string]cachedFieldReadResult) + } + + // Create the cache key by joining around a value that isn't a valid part + // of an address. This assumes that the Source and Schema are not changed + // for the life of this DiffFieldReader. + cacheKey := strings.Join(address, "|") + if cached, ok := r.cache[cacheKey]; ok { + return cached.val, cached.err + } + schemaList := addrToSchema(address, r.Schema) if len(schemaList) == 0 { + r.cache[cacheKey] = cachedFieldReadResult{} return FieldReadResult{}, nil } + var res FieldReadResult + var err error + schema := schemaList[len(schemaList)-1] switch schema.Type { case TypeBool, TypeInt, TypeFloat, TypeString: - return r.readPrimitive(address, schema) + res, err = r.readPrimitive(address, schema) case TypeList: - return readListField(r, address, schema) + res, err = readListField(r, address, schema) case TypeMap: - return r.readMap(address, schema) + res, err = r.readMap(address, schema) case TypeSet: - return r.readSet(address, schema) + res, err = r.readSet(address, schema) case typeObject: - return readObjectField(r, address, schema.Elem.(map[string]*Schema)) + res, err = readObjectField(r, address, schema.Elem.(map[string]*Schema)) default: panic(fmt.Sprintf("Unknown type: %#v", schema.Type)) } + + r.cache[cacheKey] = cachedFieldReadResult{ + val: res, + err: err, + } + return res, err } func (r *DiffFieldReader) readMap( diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/getsource_string.go b/vendor/github.com/hashicorp/terraform/helper/schema/getsource_string.go index 790dbff..3a97629 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/getsource_string.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/getsource_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type=getSource resource_data_get_source.go"; DO NOT EDIT +// Code generated by "stringer -type=getSource resource_data_get_source.go"; DO NOT EDIT. package schema diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/provider.go b/vendor/github.com/hashicorp/terraform/helper/schema/provider.go index d52d2f5..fb28b41 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/provider.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/provider.go @@ -8,6 +8,7 @@ import ( "sync" "github.com/hashicorp/go-multierror" + "github.com/hashicorp/terraform/config" "github.com/hashicorp/terraform/terraform" ) @@ -89,6 +90,13 @@ func (p *Provider) InternalValidate() error { validationErrors = multierror.Append(validationErrors, err) } + // Provider-specific checks + for k, _ := range sm { + if isReservedProviderFieldName(k) { + return fmt.Errorf("%s is a reserved field name for a provider", k) + } + } + for k, r := range p.ResourcesMap { if err := r.InternalValidate(nil, true); err != nil { validationErrors = multierror.Append(validationErrors, fmt.Errorf("resource %s: %s", k, err)) @@ -104,6 +112,15 @@ func (p *Provider) InternalValidate() error { return validationErrors } +func isReservedProviderFieldName(name string) bool { + for _, reservedName := range config.ReservedProviderFields { + if name == reservedName { + return true + } + } + return false +} + // Meta returns the metadata associated with this provider that was // returned by the Configure call. It will be nil until Configure is called. func (p *Provider) Meta() interface{} { diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/provisioner.go b/vendor/github.com/hashicorp/terraform/helper/schema/provisioner.go index 6ac3fc1..476192e 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/provisioner.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/provisioner.go @@ -41,30 +41,34 @@ type Provisioner struct { // information. ApplyFunc func(ctx context.Context) error + // ValidateFunc is a function for extended validation. This is optional + // and should be used when individual field validation is not enough. + ValidateFunc func(*terraform.ResourceConfig) ([]string, []error) + stopCtx context.Context stopCtxCancel context.CancelFunc stopOnce sync.Once } -// These constants are the keys that can be used to access data in -// the context parameters for Provisioners. -const ( - connDataInvalid int = iota +// Keys that can be used to access data in the context parameters for +// Provisioners. +var ( + connDataInvalid = contextKey("data invalid") // This returns a *ResourceData for the connection information. // Guaranteed to never be nil. - ProvConnDataKey + ProvConnDataKey = contextKey("provider conn data") // This returns a *ResourceData for the config information. // Guaranteed to never be nil. - ProvConfigDataKey + ProvConfigDataKey = contextKey("provider config data") // This returns a terraform.UIOutput. Guaranteed to never be nil. - ProvOutputKey + ProvOutputKey = contextKey("provider output") // This returns the raw InstanceState passed to Apply. Guaranteed to // be set, but may be nil. - ProvRawStateKey + ProvRawStateKey = contextKey("provider raw state") ) // InternalValidate should be called to validate the structure @@ -117,10 +121,6 @@ func (p *Provisioner) Stop() error { return nil } -func (p *Provisioner) Validate(c *terraform.ResourceConfig) ([]string, []error) { - return schemaMap(p.Schema).Validate(c) -} - // Apply implementation of terraform.ResourceProvisioner interface. func (p *Provisioner) Apply( o terraform.UIOutput, @@ -178,3 +178,27 @@ func (p *Provisioner) Apply( ctx = context.WithValue(ctx, ProvRawStateKey, s) return p.ApplyFunc(ctx) } + +// Validate implements the terraform.ResourceProvisioner interface. +func (p *Provisioner) Validate(c *terraform.ResourceConfig) (ws []string, es []error) { + if err := p.InternalValidate(); err != nil { + return nil, []error{fmt.Errorf( + "Internal validation of the provisioner failed! This is always a bug\n"+ + "with the provisioner itself, and not a user issue. Please report\n"+ + "this bug:\n\n%s", err)} + } + + if p.Schema != nil { + w, e := schemaMap(p.Schema).Validate(c) + ws = append(ws, w...) + es = append(es, e...) + } + + if p.ValidateFunc != nil { + w, e := p.ValidateFunc(c) + ws = append(ws, w...) + es = append(es, e...) + } + + return ws, es +} diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/resource.go b/vendor/github.com/hashicorp/terraform/helper/schema/resource.go index c810558..ddba109 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/resource.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/resource.go @@ -6,6 +6,7 @@ import ( "log" "strconv" + "github.com/hashicorp/terraform/config" "github.com/hashicorp/terraform/terraform" ) @@ -142,6 +143,12 @@ func (r *Resource) Apply( if err := rt.DiffDecode(d); err != nil { log.Printf("[ERR] Error decoding ResourceTimeout: %s", err) } + } else if s != nil { + if _, ok := s.Meta[TimeoutKey]; ok { + if err := rt.StateDecode(s); err != nil { + log.Printf("[ERR] Error decoding ResourceTimeout: %s", err) + } + } } else { log.Printf("[DEBUG] No meta timeoutkey found in Apply()") } @@ -388,9 +395,25 @@ func (r *Resource) InternalValidate(topSchemaMap schemaMap, writable bool) error } } + // Resource-specific checks + for k, _ := range tsm { + if isReservedResourceFieldName(k) { + return fmt.Errorf("%s is a reserved field name for a resource", k) + } + } + return schemaMap(r.Schema).InternalValidate(tsm) } +func isReservedResourceFieldName(name string) bool { + for _, reservedName := range config.ReservedResourceFields { + if name == reservedName { + return true + } + } + return false +} + // Data returns a ResourceData struct for this Resource. Each return value // is a separate copy and can be safely modified differently. // diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go b/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go index b2bc8f6..15aa0b5 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go @@ -104,6 +104,22 @@ func (d *ResourceData) GetOk(key string) (interface{}, bool) { return r.Value, exists } +// GetOkExists returns the data for a given key and whether or not the key +// has been set to a non-zero value. This is only useful for determining +// if boolean attributes have been set, if they are Optional but do not +// have a Default value. +// +// This is nearly the same function as GetOk, yet it does not check +// for the zero value of the attribute's type. This allows for attributes +// without a default, to fully check for a literal assignment, regardless +// of the zero-value for that type. +// This should only be used if absolutely required/needed. +func (d *ResourceData) GetOkExists(key string) (interface{}, bool) { + r := d.getRaw(key, getSourceSet) + exists := r.Exists && !r.Computed + return r.Value, exists +} + func (d *ResourceData) getRaw(key string, level getSource) getResult { var parts []string if key != "" { diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/schema.go b/vendor/github.com/hashicorp/terraform/helper/schema/schema.go index ac55d76..acb5618 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/schema.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/schema.go @@ -15,6 +15,7 @@ import ( "fmt" "os" "reflect" + "regexp" "sort" "strconv" "strings" @@ -23,6 +24,9 @@ import ( "github.com/mitchellh/mapstructure" ) +// type used for schema package context keys +type contextKey string + // Schema is used to describe the structure of a value. // // Read the documentation of the struct elements for important details. @@ -62,10 +66,20 @@ type Schema struct { DiffSuppressFunc SchemaDiffSuppressFunc // If this is non-nil, then this will be a default value that is used - // when this item is not set in the configuration/state. + // when this item is not set in the configuration. + // + // DefaultFunc can be specified to compute a dynamic default. + // Only one of Default or DefaultFunc can be set. If DefaultFunc is + // used then its return value should be stable to avoid generating + // confusing/perpetual diffs. // - // DefaultFunc can be specified if you want a dynamic default value. - // Only one of Default or DefaultFunc can be set. + // Changing either Default or the return value of DefaultFunc can be + // a breaking change, especially if the attribute in question has + // ForceNew set. If a default needs to change to align with changing + // assumptions in an upstream API then it may be necessary to also use + // the MigrateState function on the resource to change the state to match, + // or have the Read function adjust the state value to align with the + // new default. // // If Required is true above, then Default cannot be set. DefaultFunc // can be set with Required. If the DefaultFunc returns nil, then there @@ -477,7 +491,9 @@ func (m schemaMap) Input( // Skip things that don't require config, if that is even valid // for a provider schema. - if !v.Required && !v.Optional { + // Required XOR Optional must always be true to validate, so we only + // need to check one. + if v.Optional { continue } @@ -630,10 +646,29 @@ func (m schemaMap) InternalValidate(topSchemaMap schemaMap) error { } } + // Computed-only field + if v.Computed && !v.Optional { + if v.ValidateFunc != nil { + return fmt.Errorf("%s: ValidateFunc is for validating user input, "+ + "there's nothing to validate on computed-only field", k) + } + if v.DiffSuppressFunc != nil { + return fmt.Errorf("%s: DiffSuppressFunc is for suppressing differences"+ + " between config and state representation. "+ + "There is no config for computed-only field, nothing to compare.", k) + } + } + if v.ValidateFunc != nil { switch v.Type { case TypeList, TypeSet: - return fmt.Errorf("ValidateFunc is not yet supported on lists or sets.") + return fmt.Errorf("%s: ValidateFunc is not yet supported on lists or sets.", k) + } + } + + if v.Deprecated == "" && v.Removed == "" { + if !isValidFieldName(k) { + return fmt.Errorf("%s: Field name may only contain lowercase alphanumeric characters & underscores.", k) } } } @@ -641,17 +676,9 @@ func (m schemaMap) InternalValidate(topSchemaMap schemaMap) error { return nil } -func (m schemaMap) markAsRemoved(k string, schema *Schema, diff *terraform.InstanceDiff) { - existingDiff, ok := diff.Attributes[k] - if ok { - existingDiff.NewRemoved = true - diff.Attributes[k] = schema.finalizeDiff(existingDiff) - return - } - - diff.Attributes[k] = schema.finalizeDiff(&terraform.ResourceAttrDiff{ - NewRemoved: true, - }) +func isValidFieldName(name string) bool { + re := regexp.MustCompile("^[a-z0-9_]+$") + return re.MatchString(name) } func (m schemaMap) diff( @@ -742,6 +769,7 @@ func (m schemaMap) diffList( diff.Attributes[k+".#"] = &terraform.ResourceAttrDiff{ Old: oldStr, NewComputed: true, + RequiresNew: schema.ForceNew, } return nil } @@ -777,7 +805,6 @@ func (m schemaMap) diffList( switch t := schema.Elem.(type) { case *Resource: - countDiff, cOk := diff.GetAttribute(k + ".#") // This is a complex resource for i := 0; i < maxLen; i++ { for k2, schema := range t.Schema { @@ -786,15 +813,6 @@ func (m schemaMap) diffList( if err != nil { return err } - - // If parent list is being removed - // remove all subfields which were missed by the diff func - // We process these separately because type-specific diff functions - // lack the context (hierarchy of fields) - subKeyIsCount := strings.HasSuffix(subK, ".#") - if cOk && countDiff.New == "0" && !subKeyIsCount { - m.markAsRemoved(subK, schema, diff) - } } } case *Schema: @@ -1004,7 +1022,6 @@ func (m schemaMap) diffSet( for _, code := range list { switch t := schema.Elem.(type) { case *Resource: - countDiff, cOk := diff.GetAttribute(k + ".#") // This is a complex resource for k2, schema := range t.Schema { subK := fmt.Sprintf("%s.%s.%s", k, code, k2) @@ -1012,17 +1029,7 @@ func (m schemaMap) diffSet( if err != nil { return err } - - // If parent set is being removed - // remove all subfields which were missed by the diff func - // We process these separately because type-specific diff functions - // lack the context (hierarchy of fields) - subKeyIsCount := strings.HasSuffix(subK, ".#") - if cOk && countDiff.New == "0" && !subKeyIsCount { - m.markAsRemoved(subK, schema, diff) - } } - case *Schema: // Copy the schema so that we can set Computed/ForceNew from // the parent schema (the TypeSet). @@ -1217,6 +1224,13 @@ func (m schemaMap) validateList( for i, raw := range raws { key := fmt.Sprintf("%s.%d", k, i) + // Reify the key value from the ResourceConfig. + // If the list was computed we have all raw values, but some of these + // may be known in the config, and aren't individually marked as Computed. + if r, ok := c.Get(key); ok { + raw = r + } + var ws2 []string var es2 []error switch t := schema.Elem.(type) { @@ -1371,8 +1385,8 @@ func (m schemaMap) validateObject( k string, schema map[string]*Schema, c *terraform.ResourceConfig) ([]string, []error) { - raw, _ := c.GetRaw(k) - if _, ok := raw.(map[string]interface{}); !ok { + raw, _ := c.Get(k) + if _, ok := raw.(map[string]interface{}); !ok && !c.IsComputed(k) { return nil, []error{fmt.Errorf( "%s: expected object, got %s", k, reflect.ValueOf(raw).Kind())} diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/serialize.go b/vendor/github.com/hashicorp/terraform/helper/schema/serialize.go index 3eb2d00..fe6d750 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/serialize.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/serialize.go @@ -85,6 +85,9 @@ func SerializeValueForHash(buf *bytes.Buffer, val interface{}, schema *Schema) { // to hash complex substructures when used in sets, and so the serialization // is not reversible. func SerializeResourceForHash(buf *bytes.Buffer, val interface{}, resource *Resource) { + if val == nil { + return + } sm := resource.Schema m := val.(map[string]interface{}) var keys []string diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/set.go b/vendor/github.com/hashicorp/terraform/helper/schema/set.go index de05f40..bb194ee 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/set.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/set.go @@ -153,6 +153,31 @@ func (s *Set) Equal(raw interface{}) bool { return reflect.DeepEqual(s.m, other.m) } +// HashEqual simply checks to the keys the top-level map to the keys in the +// other set's top-level map to see if they are equal. This obviously assumes +// you have a properly working hash function - use HashResource if in doubt. +func (s *Set) HashEqual(raw interface{}) bool { + other, ok := raw.(*Set) + if !ok { + return false + } + + ks1 := make([]string, 0) + ks2 := make([]string, 0) + + for k := range s.m { + ks1 = append(ks1, k) + } + for k := range other.m { + ks2 = append(ks2, k) + } + + sort.Strings(ks1) + sort.Strings(ks2) + + return reflect.DeepEqual(ks1, ks2) +} + func (s *Set) GoString() string { return fmt.Sprintf("*Set(%#v)", s.m) } diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/testing.go b/vendor/github.com/hashicorp/terraform/helper/schema/testing.go index 9765bdb..353c936 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/testing.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/testing.go @@ -10,6 +10,8 @@ import ( // TestResourceDataRaw creates a ResourceData from a raw configuration map. func TestResourceDataRaw( t *testing.T, schema map[string]*Schema, raw map[string]interface{}) *ResourceData { + t.Helper() + c, err := config.NewRawConfig(raw) if err != nil { t.Fatalf("err: %s", err) diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/valuetype_string.go b/vendor/github.com/hashicorp/terraform/helper/schema/valuetype_string.go index 08f0084..1610cec 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/valuetype_string.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/valuetype_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type=ValueType valuetype.go"; DO NOT EDIT +// Code generated by "stringer -type=ValueType valuetype.go"; DO NOT EDIT. package schema diff --git a/vendor/github.com/hashicorp/terraform/helper/shadow/closer.go b/vendor/github.com/hashicorp/terraform/helper/shadow/closer.go index 7edd5e7..edc1e2a 100644 --- a/vendor/github.com/hashicorp/terraform/helper/shadow/closer.go +++ b/vendor/github.com/hashicorp/terraform/helper/shadow/closer.go @@ -39,6 +39,8 @@ func (w *closeWalker) Struct(reflect.Value) error { return nil } +var closerType = reflect.TypeOf((*io.Closer)(nil)).Elem() + func (w *closeWalker) StructField(f reflect.StructField, v reflect.Value) error { // Not sure why this would be but lets avoid some panics if !v.IsValid() { @@ -56,17 +58,18 @@ func (w *closeWalker) StructField(f reflect.StructField, v reflect.Value) error return nil } - // We're looking for an io.Closer - raw := v.Interface() - if raw == nil { - return nil + var closer io.Closer + if v.Type().Implements(closerType) { + closer = v.Interface().(io.Closer) + } else if v.CanAddr() { + // The Close method may require a pointer receiver, but we only have a value. + v := v.Addr() + if v.Type().Implements(closerType) { + closer = v.Interface().(io.Closer) + } } - closer, ok := raw.(io.Closer) - if !ok && v.CanAddr() { - closer, ok = v.Addr().Interface().(io.Closer) - } - if !ok { + if closer == nil { return reflectwalk.SkipEntry } diff --git a/vendor/github.com/hashicorp/terraform/helper/shadow/value.go b/vendor/github.com/hashicorp/terraform/helper/shadow/value.go index 2413335..178b7e7 100644 --- a/vendor/github.com/hashicorp/terraform/helper/shadow/value.go +++ b/vendor/github.com/hashicorp/terraform/helper/shadow/value.go @@ -26,6 +26,14 @@ type Value struct { valueSet bool } +func (v *Value) Lock() { + v.lock.Lock() +} + +func (v *Value) Unlock() { + v.lock.Unlock() +} + // Close closes the value. This can never fail. For a definition of // "close" see the struct docs. func (w *Value) Close() error { diff --git a/vendor/github.com/hashicorp/terraform/helper/validation/validation.go b/vendor/github.com/hashicorp/terraform/helper/validation/validation.go deleted file mode 100644 index 484f7d7..0000000 --- a/vendor/github.com/hashicorp/terraform/helper/validation/validation.go +++ /dev/null @@ -1,49 +0,0 @@ -package validation - -import ( - "fmt" - "strings" - - "github.com/hashicorp/terraform/helper/schema" -) - -// IntBetween returns a SchemaValidateFunc which tests if the provided value -// is of type int and is between min and max (inclusive) -func IntBetween(min, max int) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(int) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be int", k)) - return - } - - if v < min || v > max { - es = append(es, fmt.Errorf("expected %s to be in the range (%d - %d), got %d", k, min, max, v)) - return - } - - return - } -} - -// StringInSlice returns a SchemaValidateFunc which tests if the provided value -// is of type string and matches the value of an element in the valid slice -// will test with in lower case if ignoreCase is true -func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(string) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be string", k)) - return - } - - for _, str := range valid { - if v == str || (ignoreCase && strings.ToLower(v) == strings.ToLower(str)) { - return - } - } - - es = append(es, fmt.Errorf("expected %s to be one of %v, got %s", k, valid, v)) - return - } -} diff --git a/vendor/github.com/hashicorp/terraform/moduledeps/dependencies.go b/vendor/github.com/hashicorp/terraform/moduledeps/dependencies.go new file mode 100644 index 0000000..87c8431 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/moduledeps/dependencies.go @@ -0,0 +1,43 @@ +package moduledeps + +import ( + "github.com/hashicorp/terraform/plugin/discovery" +) + +// Providers describes a set of provider dependencies for a given module. +// +// Each named provider instance can have one version constraint. +type Providers map[ProviderInstance]ProviderDependency + +// ProviderDependency describes the dependency for a particular provider +// instance, including both the set of allowed versions and the reason for +// the dependency. +type ProviderDependency struct { + Constraints discovery.Constraints + Reason ProviderDependencyReason +} + +// ProviderDependencyReason is an enumeration of reasons why a dependency might be +// present. +type ProviderDependencyReason int + +const ( + // ProviderDependencyExplicit means that there is an explicit "provider" + // block in the configuration for this module. + ProviderDependencyExplicit ProviderDependencyReason = iota + + // ProviderDependencyImplicit means that there is no explicit "provider" + // block but there is at least one resource that uses this provider. + ProviderDependencyImplicit + + // ProviderDependencyInherited is a special case of + // ProviderDependencyImplicit where a parent module has defined a + // configuration for the provider that has been inherited by at least one + // resource in this module. + ProviderDependencyInherited + + // ProviderDependencyFromState means that this provider is not currently + // referenced by configuration at all, but some existing instances in + // the state still depend on it. + ProviderDependencyFromState +) diff --git a/vendor/github.com/hashicorp/terraform/moduledeps/doc.go b/vendor/github.com/hashicorp/terraform/moduledeps/doc.go new file mode 100644 index 0000000..7eff083 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/moduledeps/doc.go @@ -0,0 +1,7 @@ +// Package moduledeps contains types that can be used to describe the +// providers required for all of the modules in a module tree. +// +// It does not itself contain the functionality for populating such +// data structures; that's in Terraform core, since this package intentionally +// does not depend on terraform core to avoid package dependency cycles. +package moduledeps diff --git a/vendor/github.com/hashicorp/terraform/moduledeps/module.go b/vendor/github.com/hashicorp/terraform/moduledeps/module.go new file mode 100644 index 0000000..d6cbaf5 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/moduledeps/module.go @@ -0,0 +1,204 @@ +package moduledeps + +import ( + "sort" + "strings" + + "github.com/hashicorp/terraform/plugin/discovery" +) + +// Module represents the dependencies of a single module, as well being +// a node in a tree of such structures representing the dependencies of +// an entire configuration. +type Module struct { + Name string + Providers Providers + Children []*Module +} + +// WalkFunc is a callback type for use with Module.WalkTree +type WalkFunc func(path []string, parent *Module, current *Module) error + +// WalkTree calls the given callback once for the receiver and then +// once for each descendent, in an order such that parents are called +// before their children and siblings are called in the order they +// appear in the Children slice. +// +// When calling the callback, parent will be nil for the first call +// for the receiving module, and then set to the direct parent of +// each module for the subsequent calls. +// +// The path given to the callback is valid only until the callback +// returns, after which it will be mutated and reused. Callbacks must +// therefore copy the path slice if they wish to retain it. +// +// If the given callback returns an error, the walk will be aborted at +// that point and that error returned to the caller. +// +// This function is not thread-safe for concurrent modifications of the +// data structure, so it's the caller's responsibility to arrange for that +// should it be needed. +// +// It is safe for a callback to modify the descendents of the "current" +// module, including the ordering of the Children slice itself, but the +// callback MUST NOT modify the parent module. +func (m *Module) WalkTree(cb WalkFunc) error { + return walkModuleTree(make([]string, 0, 1), nil, m, cb) +} + +func walkModuleTree(path []string, parent *Module, current *Module, cb WalkFunc) error { + path = append(path, current.Name) + err := cb(path, parent, current) + if err != nil { + return err + } + + for _, child := range current.Children { + err := walkModuleTree(path, current, child, cb) + if err != nil { + return err + } + } + return nil +} + +// SortChildren sorts the Children slice into lexicographic order by +// name, in-place. +// +// This is primarily useful prior to calling WalkTree so that the walk +// will proceed in a consistent order. +func (m *Module) SortChildren() { + sort.Sort(sortModules{m.Children}) +} + +// SortDescendents is a convenience wrapper for calling SortChildren on +// the receiver and all of its descendent modules. +func (m *Module) SortDescendents() { + m.WalkTree(func(path []string, parent *Module, current *Module) error { + current.SortChildren() + return nil + }) +} + +type sortModules struct { + modules []*Module +} + +func (s sortModules) Len() int { + return len(s.modules) +} + +func (s sortModules) Less(i, j int) bool { + cmp := strings.Compare(s.modules[i].Name, s.modules[j].Name) + return cmp < 0 +} + +func (s sortModules) Swap(i, j int) { + s.modules[i], s.modules[j] = s.modules[j], s.modules[i] +} + +// PluginRequirements produces a PluginRequirements structure that can +// be used with discovery.PluginMetaSet.ConstrainVersions to identify +// suitable plugins to satisfy the module's provider dependencies. +// +// This method only considers the direct requirements of the receiver. +// Use AllPluginRequirements to flatten the dependencies for the +// entire tree of modules. +// +// Requirements returned by this method include only version constraints, +// and apply no particular SHA256 hash constraint. +func (m *Module) PluginRequirements() discovery.PluginRequirements { + ret := make(discovery.PluginRequirements) + for inst, dep := range m.Providers { + // m.Providers is keyed on provider names, such as "aws.foo". + // a PluginRequirements wants keys to be provider *types*, such + // as "aws". If there are multiple aliases for the same + // provider then we will flatten them into a single requirement + // by combining their constraint sets. + pty := inst.Type() + if existing, exists := ret[pty]; exists { + ret[pty].Versions = existing.Versions.Append(dep.Constraints) + } else { + ret[pty] = &discovery.PluginConstraints{ + Versions: dep.Constraints, + } + } + } + return ret +} + +// AllPluginRequirements calls PluginRequirements for the receiver and all +// of its descendents, and merges the result into a single PluginRequirements +// structure that would satisfy all of the modules together. +// +// Requirements returned by this method include only version constraints, +// and apply no particular SHA256 hash constraint. +func (m *Module) AllPluginRequirements() discovery.PluginRequirements { + var ret discovery.PluginRequirements + m.WalkTree(func(path []string, parent *Module, current *Module) error { + ret = ret.Merge(current.PluginRequirements()) + return nil + }) + return ret +} + +// Equal returns true if the receiver is the root of an identical tree +// to the other given Module. This is a deep comparison that considers +// the equality of all downstream modules too. +// +// The children are considered to be ordered, so callers may wish to use +// SortDescendents first to normalize the order of the slices of child nodes. +// +// The implementation of this function is not optimized since it is provided +// primarily for use in tests. +func (m *Module) Equal(other *Module) bool { + // take care of nils first + if m == nil && other == nil { + return true + } else if (m == nil && other != nil) || (m != nil && other == nil) { + return false + } + + if m.Name != other.Name { + return false + } + + if len(m.Providers) != len(other.Providers) { + return false + } + if len(m.Children) != len(other.Children) { + return false + } + + // Can't use reflect.DeepEqual on this provider structure because + // the nested Constraints objects contain function pointers that + // never compare as equal. So we'll need to walk it the long way. + for inst, dep := range m.Providers { + if _, exists := other.Providers[inst]; !exists { + return false + } + + if dep.Reason != other.Providers[inst].Reason { + return false + } + + // Constraints are not too easy to compare robustly, so + // we'll just use their string representations as a proxy + // for now. + if dep.Constraints.String() != other.Providers[inst].Constraints.String() { + return false + } + } + + // Above we already checked that we have the same number of children + // in each module, so now we just need to check that they are + // recursively equal. + for i := range m.Children { + if !m.Children[i].Equal(other.Children[i]) { + return false + } + } + + // If we fall out here then they are equal + return true +} diff --git a/vendor/github.com/hashicorp/terraform/moduledeps/provider.go b/vendor/github.com/hashicorp/terraform/moduledeps/provider.go new file mode 100644 index 0000000..89ceefb --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/moduledeps/provider.go @@ -0,0 +1,30 @@ +package moduledeps + +import ( + "strings" +) + +// ProviderInstance describes a particular provider instance by its full name, +// like "null" or "aws.foo". +type ProviderInstance string + +// Type returns the provider type of this instance. For example, for an instance +// named "aws.foo" the type is "aws". +func (p ProviderInstance) Type() string { + t := string(p) + if dotPos := strings.Index(t, "."); dotPos != -1 { + t = t[:dotPos] + } + return t +} + +// Alias returns the alias of this provider, if any. An instance named "aws.foo" +// has the alias "foo", while an instance named just "docker" has no alias, +// so the empty string would be returned. +func (p ProviderInstance) Alias() string { + t := string(p) + if dotPos := strings.Index(t, "."); dotPos != -1 { + return t[dotPos+1:] + } + return "" +} diff --git a/vendor/github.com/hashicorp/terraform/plugin/client.go b/vendor/github.com/hashicorp/terraform/plugin/client.go new file mode 100644 index 0000000..7e2f4fe --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/client.go @@ -0,0 +1,33 @@ +package plugin + +import ( + "os" + "os/exec" + + hclog "github.com/hashicorp/go-hclog" + plugin "github.com/hashicorp/go-plugin" + "github.com/hashicorp/terraform/plugin/discovery" +) + +// ClientConfig returns a configuration object that can be used to instantiate +// a client for the plugin described by the given metadata. +func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig { + logger := hclog.New(&hclog.LoggerOptions{ + Name: "plugin", + Level: hclog.Trace, + Output: os.Stderr, + }) + + return &plugin.ClientConfig{ + Cmd: exec.Command(m.Path), + HandshakeConfig: Handshake, + Managed: true, + Plugins: PluginMap, + Logger: logger, + } +} + +// Client returns a plugin client for the plugin described by the given metadata. +func Client(m discovery.PluginMeta) *plugin.Client { + return plugin.NewClient(ClientConfig(m)) +} diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/error.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/error.go new file mode 100644 index 0000000..df855a7 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/error.go @@ -0,0 +1,30 @@ +package discovery + +// Error is a type used to describe situations that the caller must handle +// since they indicate some form of user error. +// +// The functions and methods that return these specialized errors indicate so +// in their documentation. The Error type should not itself be used directly, +// but rather errors should be compared using the == operator with the +// error constants in this package. +// +// Values of this type are _not_ used when the error being reported is an +// operational error (server unavailable, etc) or indicative of a bug in +// this package or its caller. +type Error string + +// ErrorNoSuitableVersion indicates that a suitable version (meeting given +// constraints) is not available. +const ErrorNoSuitableVersion = Error("no suitable version is available") + +// ErrorNoVersionCompatible indicates that all of the available versions +// that otherwise met constraints are not compatible with the current +// version of Terraform. +const ErrorNoVersionCompatible = Error("no available version is compatible with this version of Terraform") + +// ErrorNoSuchProvider indicates that no provider exists with a name given +const ErrorNoSuchProvider = Error("no provider exists with the given name") + +func (err Error) Error() string { + return string(err) +} diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/find.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/find.go new file mode 100644 index 0000000..10f8fce --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/find.go @@ -0,0 +1,167 @@ +package discovery + +import ( + "io/ioutil" + "log" + "path/filepath" + "strings" +) + +// FindPlugins looks in the given directories for files whose filenames +// suggest that they are plugins of the given kind (e.g. "provider") and +// returns a PluginMetaSet representing the discovered potential-plugins. +// +// Currently this supports two different naming schemes. The current +// standard naming scheme is a subdirectory called $GOOS-$GOARCH containing +// files named terraform-$KIND-$NAME-V$VERSION. The legacy naming scheme is +// files directly in the given directory whose names are like +// terraform-$KIND-$NAME. +// +// Only one plugin will be returned for each unique plugin (name, version) +// pair, with preference given to files found in earlier directories. +// +// This is a convenience wrapper around FindPluginPaths and ResolvePluginsPaths. +func FindPlugins(kind string, dirs []string) PluginMetaSet { + return ResolvePluginPaths(FindPluginPaths(kind, dirs)) +} + +// FindPluginPaths looks in the given directories for files whose filenames +// suggest that they are plugins of the given kind (e.g. "provider"). +// +// The return value is a list of absolute paths that appear to refer to +// plugins in the given directories, based only on what can be inferred +// from the naming scheme. The paths returned are ordered such that files +// in later dirs appear after files in earlier dirs in the given directory +// list. Within the same directory plugins are returned in a consistent but +// undefined order. +func FindPluginPaths(kind string, dirs []string) []string { + // This is just a thin wrapper around findPluginPaths so that we can + // use the latter in tests with a fake machineName so we can use our + // test fixtures. + return findPluginPaths(kind, dirs) +} + +func findPluginPaths(kind string, dirs []string) []string { + prefix := "terraform-" + kind + "-" + + ret := make([]string, 0, len(dirs)) + + for _, dir := range dirs { + items, err := ioutil.ReadDir(dir) + if err != nil { + // Ignore missing dirs, non-dirs, etc + continue + } + + log.Printf("[DEBUG] checking for %s in %q", kind, dir) + + for _, item := range items { + fullName := item.Name() + + if !strings.HasPrefix(fullName, prefix) { + continue + } + + // New-style paths must have a version segment in filename + if strings.Contains(strings.ToLower(fullName), "_v") { + absPath, err := filepath.Abs(filepath.Join(dir, fullName)) + if err != nil { + log.Printf("[ERROR] plugin filepath error: %s", err) + continue + } + + log.Printf("[DEBUG] found %s %q", kind, fullName) + ret = append(ret, filepath.Clean(absPath)) + continue + } + + // Legacy style with files directly in the base directory + absPath, err := filepath.Abs(filepath.Join(dir, fullName)) + if err != nil { + log.Printf("[ERROR] plugin filepath error: %s", err) + continue + } + + log.Printf("[WARNING] found legacy %s %q", kind, fullName) + + ret = append(ret, filepath.Clean(absPath)) + } + } + + return ret +} + +// ResolvePluginPaths takes a list of paths to plugin executables (as returned +// by e.g. FindPluginPaths) and produces a PluginMetaSet describing the +// referenced plugins. +// +// If the same combination of plugin name and version appears multiple times, +// the earlier reference will be preferred. Several different versions of +// the same plugin name may be returned, in which case the methods of +// PluginMetaSet can be used to filter down. +func ResolvePluginPaths(paths []string) PluginMetaSet { + s := make(PluginMetaSet) + + type nameVersion struct { + Name string + Version string + } + found := make(map[nameVersion]struct{}) + + for _, path := range paths { + baseName := strings.ToLower(filepath.Base(path)) + if !strings.HasPrefix(baseName, "terraform-") { + // Should never happen with reasonable input + continue + } + + baseName = baseName[10:] + firstDash := strings.Index(baseName, "-") + if firstDash == -1 { + // Should never happen with reasonable input + continue + } + + baseName = baseName[firstDash+1:] + if baseName == "" { + // Should never happen with reasonable input + continue + } + + // Trim the .exe suffix used on Windows before we start wrangling + // the remainder of the path. + if strings.HasSuffix(baseName, ".exe") { + baseName = baseName[:len(baseName)-4] + } + + parts := strings.SplitN(baseName, "_v", 2) + name := parts[0] + version := VersionZero + if len(parts) == 2 { + version = parts[1] + } + + // Auto-installed plugins contain an extra name portion representing + // the expected plugin version, which we must trim off. + if underX := strings.Index(version, "_x"); underX != -1 { + version = version[:underX] + } + + if _, ok := found[nameVersion{name, version}]; ok { + // Skip duplicate versions of the same plugin + // (We do this during this step because after this we will be + // dealing with sets and thus lose our ordering with which to + // decide preference.) + continue + } + + s.Add(PluginMeta{ + Name: name, + Version: VersionStr(version), + Path: path, + }) + found[nameVersion{name, version}] = struct{}{} + } + + return s +} diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/get.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/get.go new file mode 100644 index 0000000..64d2b69 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/get.go @@ -0,0 +1,432 @@ +package discovery + +import ( + "errors" + "fmt" + "io/ioutil" + "log" + "net/http" + "os" + "runtime" + "strconv" + "strings" + + "golang.org/x/net/html" + + cleanhttp "github.com/hashicorp/go-cleanhttp" + getter "github.com/hashicorp/go-getter" + multierror "github.com/hashicorp/go-multierror" + "github.com/mitchellh/cli" +) + +// Releases are located by parsing the html listing from releases.hashicorp.com. +// +// The URL for releases follows the pattern: +// https://releases.hashicorp.com/terraform-provider-name//terraform-provider-name___. +// +// The plugin protocol version will be saved with the release and returned in +// the header X-TERRAFORM_PROTOCOL_VERSION. + +const protocolVersionHeader = "x-terraform-protocol-version" + +var releaseHost = "https://releases.hashicorp.com" + +var httpClient = cleanhttp.DefaultClient() + +// An Installer maintains a local cache of plugins by downloading plugins +// from an online repository. +type Installer interface { + Get(name string, req Constraints) (PluginMeta, error) + PurgeUnused(used map[string]PluginMeta) (removed PluginMetaSet, err error) +} + +// ProviderInstaller is an Installer implementation that knows how to +// download Terraform providers from the official HashiCorp releases service +// into a local directory. The files downloaded are compliant with the +// naming scheme expected by FindPlugins, so the target directory of a +// provider installer can be used as one of several plugin discovery sources. +type ProviderInstaller struct { + Dir string + + PluginProtocolVersion uint + + // OS and Arch specify the OS and architecture that should be used when + // installing plugins. These use the same labels as the runtime.GOOS and + // runtime.GOARCH variables respectively, and indeed the values of these + // are used as defaults if either of these is the empty string. + OS string + Arch string + + // Skip checksum and signature verification + SkipVerify bool + + Ui cli.Ui // Ui for output +} + +// Get is part of an implementation of type Installer, and attempts to download +// and install a Terraform provider matching the given constraints. +// +// This method may return one of a number of sentinel errors from this +// package to indicate issues that are likely to be resolvable via user action: +// +// ErrorNoSuchProvider: no provider with the given name exists in the repository. +// ErrorNoSuitableVersion: the provider exists but no available version matches constraints. +// ErrorNoVersionCompatible: a plugin was found within the constraints but it is +// incompatible with the current Terraform version. +// +// These errors should be recognized and handled as special cases by the caller +// to present a suitable user-oriented error message. +// +// All other errors indicate an internal problem that is likely _not_ solvable +// through user action, or at least not within Terraform's scope. Error messages +// are produced under the assumption that if presented to the user they will +// be presented alongside context about what is being installed, and thus the +// error messages do not redundantly include such information. +func (i *ProviderInstaller) Get(provider string, req Constraints) (PluginMeta, error) { + versions, err := i.listProviderVersions(provider) + // TODO: return multiple errors + if err != nil { + return PluginMeta{}, err + } + + if len(versions) == 0 { + return PluginMeta{}, ErrorNoSuitableVersion + } + + versions = allowedVersions(versions, req) + if len(versions) == 0 { + return PluginMeta{}, ErrorNoSuitableVersion + } + + // sort them newest to oldest + Versions(versions).Sort() + + // take the first matching plugin we find + for _, v := range versions { + url := i.providerURL(provider, v.String()) + + if !i.SkipVerify { + sha256, err := i.getProviderChecksum(provider, v.String()) + if err != nil { + return PluginMeta{}, err + } + + // add the checksum parameter for go-getter to verify the download for us. + if sha256 != "" { + url = url + "?checksum=sha256:" + sha256 + } + } + + log.Printf("[DEBUG] fetching provider info for %s version %s", provider, v) + if checkPlugin(url, i.PluginProtocolVersion) { + i.Ui.Info(fmt.Sprintf("- Downloading plugin for provider %q (%s)...", provider, v.String())) + log.Printf("[DEBUG] getting provider %q version %q at %s", provider, v, url) + err := getter.Get(i.Dir, url) + if err != nil { + return PluginMeta{}, err + } + + // Find what we just installed + // (This is weird, because go-getter doesn't directly return + // information about what was extracted, and we just extracted + // the archive directly into a shared dir here.) + log.Printf("[DEBUG] looking for the %s %s plugin we just installed", provider, v) + metas := FindPlugins("provider", []string{i.Dir}) + log.Printf("[DEBUG] all plugins found %#v", metas) + metas, _ = metas.ValidateVersions() + metas = metas.WithName(provider).WithVersion(v) + log.Printf("[DEBUG] filtered plugins %#v", metas) + if metas.Count() == 0 { + // This should never happen. Suggests that the release archive + // contains an executable file whose name doesn't match the + // expected convention. + return PluginMeta{}, fmt.Errorf( + "failed to find installed plugin version %s; this is a bug in Terraform and should be reported", + v, + ) + } + + if metas.Count() > 1 { + // This should also never happen, and suggests that a + // particular version was re-released with a different + // executable filename. We consider releases as immutable, so + // this is an error. + return PluginMeta{}, fmt.Errorf( + "multiple plugins installed for version %s; this is a bug in Terraform and should be reported", + v, + ) + } + + // By now we know we have exactly one meta, and so "Newest" will + // return that one. + return metas.Newest(), nil + } + + log.Printf("[INFO] incompatible ProtocolVersion for %s version %s", provider, v) + } + + return PluginMeta{}, ErrorNoVersionCompatible +} + +func (i *ProviderInstaller) PurgeUnused(used map[string]PluginMeta) (PluginMetaSet, error) { + purge := make(PluginMetaSet) + + present := FindPlugins("provider", []string{i.Dir}) + for meta := range present { + chosen, ok := used[meta.Name] + if !ok { + purge.Add(meta) + } + if chosen.Path != meta.Path { + purge.Add(meta) + } + } + + removed := make(PluginMetaSet) + var errs error + for meta := range purge { + path := meta.Path + err := os.Remove(path) + if err != nil { + errs = multierror.Append(errs, fmt.Errorf( + "failed to remove unused provider plugin %s: %s", + path, err, + )) + } else { + removed.Add(meta) + } + } + + return removed, errs +} + +// Plugins are referred to by the short name, but all URLs and files will use +// the full name prefixed with terraform-- +func (i *ProviderInstaller) providerName(name string) string { + return "terraform-provider-" + name +} + +func (i *ProviderInstaller) providerFileName(name, version string) string { + os := i.OS + arch := i.Arch + if os == "" { + os = runtime.GOOS + } + if arch == "" { + arch = runtime.GOARCH + } + return fmt.Sprintf("%s_%s_%s_%s.zip", i.providerName(name), version, os, arch) +} + +// providerVersionsURL returns the path to the released versions directory for the provider: +// https://releases.hashicorp.com/terraform-provider-name/ +func (i *ProviderInstaller) providerVersionsURL(name string) string { + return releaseHost + "/" + i.providerName(name) + "/" +} + +// providerURL returns the full path to the provider file, using the current OS +// and ARCH: +// .../terraform-provider-name_/terraform-provider-name___. +func (i *ProviderInstaller) providerURL(name, version string) string { + return fmt.Sprintf("%s%s/%s", i.providerVersionsURL(name), version, i.providerFileName(name, version)) +} + +func (i *ProviderInstaller) providerChecksumURL(name, version string) string { + fileName := fmt.Sprintf("%s_%s_SHA256SUMS", i.providerName(name), version) + u := fmt.Sprintf("%s%s/%s", i.providerVersionsURL(name), version, fileName) + return u +} + +func (i *ProviderInstaller) getProviderChecksum(name, version string) (string, error) { + checksums, err := getPluginSHA256SUMs(i.providerChecksumURL(name, version)) + if err != nil { + return "", err + } + + return checksumForFile(checksums, i.providerFileName(name, version)), nil +} + +// Return the plugin version by making a HEAD request to the provided url. +// If the header is not present, we assume the latest version will be +// compatible, and leave the check for discovery or execution. +func checkPlugin(url string, pluginProtocolVersion uint) bool { + resp, err := httpClient.Head(url) + if err != nil { + log.Printf("[ERROR] error fetching plugin headers: %s", err) + return false + } + + if resp.StatusCode != http.StatusOK { + log.Println("[ERROR] non-200 status fetching plugin headers:", resp.Status) + return false + } + + proto := resp.Header.Get(protocolVersionHeader) + if proto == "" { + // The header isn't present, but we don't make this error fatal since + // the latest version will probably work. + log.Printf("[WARNING] missing %s from: %s", protocolVersionHeader, url) + return true + } + + protoVersion, err := strconv.Atoi(proto) + if err != nil { + log.Printf("[ERROR] invalid ProtocolVersion: %s", proto) + return false + } + + return protoVersion == int(pluginProtocolVersion) +} + +// list the version available for the named plugin +func (i *ProviderInstaller) listProviderVersions(name string) ([]Version, error) { + versions, err := listPluginVersions(i.providerVersionsURL(name)) + if err != nil { + // listPluginVersions returns a verbose error message indicating + // what was being accessed and what failed + return nil, err + } + return versions, nil +} + +var errVersionNotFound = errors.New("version not found") + +// take the list of available versions for a plugin, and filter out those that +// don't fit the constraints. +func allowedVersions(available []Version, required Constraints) []Version { + var allowed []Version + + for _, v := range available { + if required.Allows(v) { + allowed = append(allowed, v) + } + } + + return allowed +} + +// return a list of the plugin versions at the given URL +func listPluginVersions(url string) ([]Version, error) { + resp, err := httpClient.Get(url) + if err != nil { + // http library produces a verbose error message that includes the + // URL being accessed, etc. + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + body, _ := ioutil.ReadAll(resp.Body) + log.Printf("[ERROR] failed to fetch plugin versions from %s\n%s\n%s", url, resp.Status, body) + + switch resp.StatusCode { + case http.StatusNotFound, http.StatusForbidden: + // These are treated as indicative of the given name not being + // a valid provider name at all. + return nil, ErrorNoSuchProvider + + default: + // All other errors are assumed to be operational problems. + return nil, fmt.Errorf("error accessing %s: %s", url, resp.Status) + } + + } + + body, err := html.Parse(resp.Body) + if err != nil { + log.Fatal(err) + } + + names := []string{} + + // all we need to do is list links on the directory listing page that look like plugins + var f func(*html.Node) + f = func(n *html.Node) { + if n.Type == html.ElementNode && n.Data == "a" { + c := n.FirstChild + if c != nil && c.Type == html.TextNode && strings.HasPrefix(c.Data, "terraform-") { + names = append(names, c.Data) + return + } + } + for c := n.FirstChild; c != nil; c = c.NextSibling { + f(c) + } + } + f(body) + + return versionsFromNames(names), nil +} + +// parse the list of directory names into a sorted list of available versions +func versionsFromNames(names []string) []Version { + var versions []Version + for _, name := range names { + parts := strings.SplitN(name, "_", 2) + if len(parts) == 2 && parts[1] != "" { + v, err := VersionStr(parts[1]).Parse() + if err != nil { + // filter invalid versions scraped from the page + log.Printf("[WARN] invalid version found for %q: %s", name, err) + continue + } + + versions = append(versions, v) + } + } + + return versions +} + +func checksumForFile(sums []byte, name string) string { + for _, line := range strings.Split(string(sums), "\n") { + parts := strings.Fields(line) + if len(parts) > 1 && parts[1] == name { + return parts[0] + } + } + return "" +} + +// fetch the SHA256SUMS file provided, and verify its signature. +func getPluginSHA256SUMs(sumsURL string) ([]byte, error) { + sigURL := sumsURL + ".sig" + + sums, err := getFile(sumsURL) + if err != nil { + return nil, fmt.Errorf("error fetching checksums: %s", err) + } + + sig, err := getFile(sigURL) + if err != nil { + return nil, fmt.Errorf("error fetching checksums signature: %s", err) + } + + if err := verifySig(sums, sig); err != nil { + return nil, err + } + + return sums, nil +} + +func getFile(url string) ([]byte, error) { + resp, err := httpClient.Get(url) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("%s", resp.Status) + } + + data, err := ioutil.ReadAll(resp.Body) + if err != nil { + return data, err + } + return data, nil +} + +func GetReleaseHost() string { + return releaseHost +} diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/meta.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/meta.go new file mode 100644 index 0000000..bdcebcb --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/meta.go @@ -0,0 +1,41 @@ +package discovery + +import ( + "crypto/sha256" + "io" + "os" +) + +// PluginMeta is metadata about a plugin, useful for launching the plugin +// and for understanding which plugins are available. +type PluginMeta struct { + // Name is the name of the plugin, e.g. as inferred from the plugin + // binary's filename, or by explicit configuration. + Name string + + // Version is the semver version of the plugin, expressed as a string + // that might not be semver-valid. + Version VersionStr + + // Path is the absolute path of the executable that can be launched + // to provide the RPC server for this plugin. + Path string +} + +// SHA256 returns a SHA256 hash of the content of the referenced executable +// file, or an error if the file's contents cannot be read. +func (m PluginMeta) SHA256() ([]byte, error) { + f, err := os.Open(m.Path) + if err != nil { + return nil, err + } + defer f.Close() + + h := sha256.New() + _, err = io.Copy(h, f) + if err != nil { + return nil, err + } + + return h.Sum(nil), nil +} diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/meta_set.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/meta_set.go new file mode 100644 index 0000000..181ea1f --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/meta_set.go @@ -0,0 +1,195 @@ +package discovery + +// A PluginMetaSet is a set of PluginMeta objects meeting a certain criteria. +// +// Methods on this type allow filtering of the set to produce subsets that +// meet more restrictive criteria. +type PluginMetaSet map[PluginMeta]struct{} + +// Add inserts the given PluginMeta into the receiving set. This is a no-op +// if the given meta is already present. +func (s PluginMetaSet) Add(p PluginMeta) { + s[p] = struct{}{} +} + +// Remove removes the given PluginMeta from the receiving set. This is a no-op +// if the given meta is not already present. +func (s PluginMetaSet) Remove(p PluginMeta) { + delete(s, p) +} + +// Has returns true if the given meta is in the receiving set, or false +// otherwise. +func (s PluginMetaSet) Has(p PluginMeta) bool { + _, ok := s[p] + return ok +} + +// Count returns the number of metas in the set +func (s PluginMetaSet) Count() int { + return len(s) +} + +// ValidateVersions returns two new PluginMetaSets, separating those with +// versions that have syntax-valid semver versions from those that don't. +// +// Eliminating invalid versions from consideration (and possibly warning about +// them) is usually the first step of working with a meta set after discovery +// has completed. +func (s PluginMetaSet) ValidateVersions() (valid, invalid PluginMetaSet) { + valid = make(PluginMetaSet) + invalid = make(PluginMetaSet) + for p := range s { + if _, err := p.Version.Parse(); err == nil { + valid.Add(p) + } else { + invalid.Add(p) + } + } + return +} + +// WithName returns the subset of metas that have the given name. +func (s PluginMetaSet) WithName(name string) PluginMetaSet { + ns := make(PluginMetaSet) + for p := range s { + if p.Name == name { + ns.Add(p) + } + } + return ns +} + +// WithVersion returns the subset of metas that have the given version. +// +// This should be used only with the "valid" result from ValidateVersions; +// it will ignore any plugin metas that have a invalid version strings. +func (s PluginMetaSet) WithVersion(version Version) PluginMetaSet { + ns := make(PluginMetaSet) + for p := range s { + gotVersion, err := p.Version.Parse() + if err != nil { + continue + } + if gotVersion.Equal(version) { + ns.Add(p) + } + } + return ns +} + +// ByName groups the metas in the set by their Names, returning a map. +func (s PluginMetaSet) ByName() map[string]PluginMetaSet { + ret := make(map[string]PluginMetaSet) + for p := range s { + if _, ok := ret[p.Name]; !ok { + ret[p.Name] = make(PluginMetaSet) + } + ret[p.Name].Add(p) + } + return ret +} + +// Newest returns the one item from the set that has the newest Version value. +// +// The result is meaningful only if the set is already filtered such that +// all of the metas have the same Name. +// +// If there isn't at least one meta in the set then this function will panic. +// Use Count() to ensure that there is at least one value before calling. +// +// If any of the metas have invalid version strings then this function will +// panic. Use ValidateVersions() first to filter out metas with invalid +// versions. +// +// If two metas have the same Version then one is arbitrarily chosen. This +// situation should be avoided by pre-filtering the set. +func (s PluginMetaSet) Newest() PluginMeta { + if len(s) == 0 { + panic("can't call NewestStable on empty PluginMetaSet") + } + + var first = true + var winner PluginMeta + var winnerVersion Version + for p := range s { + version, err := p.Version.Parse() + if err != nil { + panic(err) + } + + if first == true || version.NewerThan(winnerVersion) { + winner = p + winnerVersion = version + first = false + } + } + + return winner +} + +// ConstrainVersions takes a set of requirements and attempts to +// return a map from name to a set of metas that have the matching +// name and an appropriate version. +// +// If any of the given requirements match *no* plugins then its PluginMetaSet +// in the returned map will be empty. +// +// All viable metas are returned, so the caller can apply any desired filtering +// to reduce down to a single option. For example, calling Newest() to obtain +// the highest available version. +// +// If any of the metas in the set have invalid version strings then this +// function will panic. Use ValidateVersions() first to filter out metas with +// invalid versions. +func (s PluginMetaSet) ConstrainVersions(reqd PluginRequirements) map[string]PluginMetaSet { + ret := make(map[string]PluginMetaSet) + for p := range s { + name := p.Name + allowedVersions, ok := reqd[name] + if !ok { + continue + } + if _, ok := ret[p.Name]; !ok { + ret[p.Name] = make(PluginMetaSet) + } + version, err := p.Version.Parse() + if err != nil { + panic(err) + } + if allowedVersions.Allows(version) { + ret[p.Name].Add(p) + } + } + return ret +} + +// OverridePaths returns a new set where any existing plugins with the given +// names are removed and replaced with the single path given in the map. +// +// This is here only to continue to support the legacy way of overriding +// plugin binaries in the .terraformrc file. It treats all given plugins +// as pre-versioning (version 0.0.0). This mechanism will eventually be +// phased out, with vendor directories being the intended replacement. +func (s PluginMetaSet) OverridePaths(paths map[string]string) PluginMetaSet { + ret := make(PluginMetaSet) + for p := range s { + if _, ok := paths[p.Name]; ok { + // Skip plugins that we're overridding + continue + } + + ret.Add(p) + } + + // Now add the metadata for overriding plugins + for name, path := range paths { + ret.Add(PluginMeta{ + Name: name, + Version: VersionZero, + Path: path, + }) + } + + return ret +} diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/requirements.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/requirements.go new file mode 100644 index 0000000..75430fd --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/requirements.go @@ -0,0 +1,105 @@ +package discovery + +import ( + "bytes" +) + +// PluginRequirements describes a set of plugins (assumed to be of a consistent +// kind) that are required to exist and have versions within the given +// corresponding sets. +type PluginRequirements map[string]*PluginConstraints + +// PluginConstraints represents an element of PluginRequirements describing +// the constraints for a single plugin. +type PluginConstraints struct { + // Specifies that the plugin's version must be within the given + // constraints. + Versions Constraints + + // If non-nil, the hash of the on-disk plugin executable must exactly + // match the SHA256 hash given here. + SHA256 []byte +} + +// Allows returns true if the given version is within the receiver's version +// constraints. +func (s *PluginConstraints) Allows(v Version) bool { + return s.Versions.Allows(v) +} + +// AcceptsSHA256 returns true if the given executable SHA256 hash is acceptable, +// either because it matches the constraint or because there is no such +// constraint. +func (s *PluginConstraints) AcceptsSHA256(digest []byte) bool { + if s.SHA256 == nil { + return true + } + return bytes.Equal(s.SHA256, digest) +} + +// Merge takes the contents of the receiver and the other given requirements +// object and merges them together into a single requirements structure +// that satisfies both sets of requirements. +// +// Note that it doesn't make sense to merge two PluginRequirements with +// differing required plugin SHA256 hashes, since the result will never +// match any plugin. +func (r PluginRequirements) Merge(other PluginRequirements) PluginRequirements { + ret := make(PluginRequirements) + for n, c := range r { + ret[n] = &PluginConstraints{ + Versions: Constraints{}.Append(c.Versions), + SHA256: c.SHA256, + } + } + for n, c := range other { + if existing, exists := ret[n]; exists { + ret[n].Versions = ret[n].Versions.Append(c.Versions) + + if existing.SHA256 != nil { + if c.SHA256 != nil && !bytes.Equal(c.SHA256, existing.SHA256) { + // If we've been asked to merge two constraints with + // different SHA256 hashes then we'll produce a dummy value + // that can never match anything. This is a silly edge case + // that no reasonable caller should hit. + ret[n].SHA256 = []byte(invalidProviderHash) + } + } else { + ret[n].SHA256 = c.SHA256 // might still be nil + } + } else { + ret[n] = &PluginConstraints{ + Versions: Constraints{}.Append(c.Versions), + SHA256: c.SHA256, + } + } + } + return ret +} + +// LockExecutables applies additional constraints to the receiver that +// require plugin executables with specific SHA256 digests. This modifies +// the receiver in-place, since it's intended to be applied after +// version constraints have been resolved. +// +// The given map must include a key for every plugin that is already +// required. If not, any missing keys will cause the corresponding plugin +// to never match, though the direct caller doesn't necessarily need to +// guarantee this as long as the downstream code _applying_ these constraints +// is able to deal with the non-match in some way. +func (r PluginRequirements) LockExecutables(sha256s map[string][]byte) { + for name, cons := range r { + digest := sha256s[name] + + if digest == nil { + // Prevent any match, which will then presumably cause the + // downstream consumer of this requirements to report an error. + cons.SHA256 = []byte(invalidProviderHash) + continue + } + + cons.SHA256 = digest + } +} + +const invalidProviderHash = "" diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/signature.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/signature.go new file mode 100644 index 0000000..b6686a5 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/signature.go @@ -0,0 +1,53 @@ +package discovery + +import ( + "bytes" + "log" + "strings" + + "golang.org/x/crypto/openpgp" +) + +// Verify the data using the provided openpgp detached signature and the +// embedded hashicorp public key. +func verifySig(data, sig []byte) error { + el, err := openpgp.ReadArmoredKeyRing(strings.NewReader(hashiPublicKey)) + if err != nil { + log.Fatal(err) + } + + _, err = openpgp.CheckDetachedSignature(el, bytes.NewReader(data), bytes.NewReader(sig)) + return err +} + +// this is the public key that signs the checksums file for releases. +const hashiPublicKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQENBFMORM0BCADBRyKO1MhCirazOSVwcfTr1xUxjPvfxD3hjUwHtjsOy/bT6p9f +W2mRPfwnq2JB5As+paL3UGDsSRDnK9KAxQb0NNF4+eVhr/EJ18s3wwXXDMjpIifq +fIm2WyH3G+aRLTLPIpscUNKDyxFOUbsmgXAmJ46Re1fn8uKxKRHbfa39aeuEYWFA +3drdL1WoUngvED7f+RnKBK2G6ZEpO+LDovQk19xGjiMTtPJrjMjZJ3QXqPvx5wca +KSZLr4lMTuoTI/ZXyZy5bD4tShiZz6KcyX27cD70q2iRcEZ0poLKHyEIDAi3TM5k +SwbbWBFd5RNPOR0qzrb/0p9ksKK48IIfH2FvABEBAAG0K0hhc2hpQ29ycCBTZWN1 +cml0eSA8c2VjdXJpdHlAaGFzaGljb3JwLmNvbT6JATgEEwECACIFAlMORM0CGwMG +CwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEFGFLYc0j/xMyWIIAIPhcVqiQ59n +Jc07gjUX0SWBJAxEG1lKxfzS4Xp+57h2xxTpdotGQ1fZwsihaIqow337YHQI3q0i +SqV534Ms+j/tU7X8sq11xFJIeEVG8PASRCwmryUwghFKPlHETQ8jJ+Y8+1asRydi +psP3B/5Mjhqv/uOK+Vy3zAyIpyDOMtIpOVfjSpCplVRdtSTFWBu9Em7j5I2HMn1w +sJZnJgXKpybpibGiiTtmnFLOwibmprSu04rsnP4ncdC2XRD4wIjoyA+4PKgX3sCO +klEzKryWYBmLkJOMDdo52LttP3279s7XrkLEE7ia0fXa2c12EQ0f0DQ1tGUvyVEW +WmJVccm5bq25AQ0EUw5EzQEIANaPUY04/g7AmYkOMjaCZ6iTp9hB5Rsj/4ee/ln9 +wArzRO9+3eejLWh53FoN1rO+su7tiXJA5YAzVy6tuolrqjM8DBztPxdLBbEi4V+j +2tK0dATdBQBHEh3OJApO2UBtcjaZBT31zrG9K55D+CrcgIVEHAKY8Cb4kLBkb5wM +skn+DrASKU0BNIV1qRsxfiUdQHZfSqtp004nrql1lbFMLFEuiY8FZrkkQ9qduixo +mTT6f34/oiY+Jam3zCK7RDN/OjuWheIPGj/Qbx9JuNiwgX6yRj7OE1tjUx6d8g9y +0H1fmLJbb3WZZbuuGFnK6qrE3bGeY8+AWaJAZ37wpWh1p0cAEQEAAYkBHwQYAQIA +CQUCUw5EzQIbDAAKCRBRhS2HNI/8TJntCAClU7TOO/X053eKF1jqNW4A1qpxctVc +z8eTcY8Om5O4f6a/rfxfNFKn9Qyja/OG1xWNobETy7MiMXYjaa8uUx5iFy6kMVaP +0BXJ59NLZjMARGw6lVTYDTIvzqqqwLxgliSDfSnqUhubGwvykANPO+93BBx89MRG +unNoYGXtPlhNFrAsB1VR8+EyKLv2HQtGCPSFBhrjuzH3gxGibNDDdFQLxxuJWepJ +EK1UbTS4ms0NgZ2Uknqn1WRU1Ki7rE4sTy68iZtWpKQXZEJa0IGnuI2sSINGcXCJ +oEIgXTMyCILo34Fa/C6VCm2WBgz9zZO8/rHIiQm1J5zqz0DrDwKBUM9C +=LYpS +-----END PGP PUBLIC KEY BLOCK-----` diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/version.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/version.go new file mode 100644 index 0000000..8fad58d --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/version.go @@ -0,0 +1,72 @@ +package discovery + +import ( + "fmt" + "sort" + + version "github.com/hashicorp/go-version" +) + +const VersionZero = "0.0.0" + +// A VersionStr is a string containing a possibly-invalid representation +// of a semver version number. Call Parse on it to obtain a real Version +// object, or discover that it is invalid. +type VersionStr string + +// Parse transforms a VersionStr into a Version if it is +// syntactically valid. If it isn't then an error is returned instead. +func (s VersionStr) Parse() (Version, error) { + raw, err := version.NewVersion(string(s)) + if err != nil { + return Version{}, err + } + return Version{raw}, nil +} + +// MustParse transforms a VersionStr into a Version if it is +// syntactically valid. If it isn't then it panics. +func (s VersionStr) MustParse() Version { + ret, err := s.Parse() + if err != nil { + panic(err) + } + return ret +} + +// Version represents a version number that has been parsed from +// a semver string and known to be valid. +type Version struct { + // We wrap this here just because it avoids a proliferation of + // direct go-version imports all over the place, and keeps the + // version-processing details within this package. + raw *version.Version +} + +func (v Version) String() string { + return v.raw.String() +} + +func (v Version) NewerThan(other Version) bool { + return v.raw.GreaterThan(other.raw) +} + +func (v Version) Equal(other Version) bool { + return v.raw.Equal(other.raw) +} + +// MinorUpgradeConstraintStr returns a ConstraintStr that would permit +// minor upgrades relative to the receiving version. +func (v Version) MinorUpgradeConstraintStr() ConstraintStr { + segments := v.raw.Segments() + return ConstraintStr(fmt.Sprintf("~> %d.%d", segments[0], segments[1])) +} + +type Versions []Version + +// Sort sorts version from newest to oldest. +func (v Versions) Sort() { + sort.Slice(v, func(i, j int) bool { + return v[i].NewerThan(v[j]) + }) +} diff --git a/vendor/github.com/hashicorp/terraform/plugin/discovery/version_set.go b/vendor/github.com/hashicorp/terraform/plugin/discovery/version_set.go new file mode 100644 index 0000000..0aefd75 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/discovery/version_set.go @@ -0,0 +1,84 @@ +package discovery + +import ( + "sort" + + version "github.com/hashicorp/go-version" +) + +// A ConstraintStr is a string containing a possibly-invalid representation +// of a version constraint provided in configuration. Call Parse on it to +// obtain a real Constraint object, or discover that it is invalid. +type ConstraintStr string + +// Parse transforms a ConstraintStr into a Constraints if it is +// syntactically valid. If it isn't then an error is returned instead. +func (s ConstraintStr) Parse() (Constraints, error) { + raw, err := version.NewConstraint(string(s)) + if err != nil { + return Constraints{}, err + } + return Constraints{raw}, nil +} + +// MustParse is like Parse but it panics if the constraint string is invalid. +func (s ConstraintStr) MustParse() Constraints { + ret, err := s.Parse() + if err != nil { + panic(err) + } + return ret +} + +// Constraints represents a set of versions which any given Version is either +// a member of or not. +type Constraints struct { + raw version.Constraints +} + +// AllVersions is a Constraints containing all versions +var AllVersions Constraints + +func init() { + AllVersions = Constraints{ + raw: make(version.Constraints, 0), + } +} + +// Allows returns true if the given version permitted by the receiving +// constraints set. +func (s Constraints) Allows(v Version) bool { + return s.raw.Check(v.raw) +} + +// Append combines the receiving set with the given other set to produce +// a set that is the intersection of both sets, which is to say that resulting +// constraints contain only the versions that are members of both. +func (s Constraints) Append(other Constraints) Constraints { + raw := make(version.Constraints, 0, len(s.raw)+len(other.raw)) + + // Since "raw" is a list of constraints that remove versions from the set, + // "Intersection" is implemented by concatenating together those lists, + // thus leaving behind only the versions not removed by either list. + raw = append(raw, s.raw...) + raw = append(raw, other.raw...) + + // while the set is unordered, we sort these lexically for consistent output + sort.Slice(raw, func(i, j int) bool { + return raw[i].String() < raw[j].String() + }) + + return Constraints{raw} +} + +// String returns a string representation of the set members as a set +// of range constraints. +func (s Constraints) String() string { + return s.raw.String() +} + +// Unconstrained returns true if and only if the receiver is an empty +// constraint set. +func (s Constraints) Unconstrained() bool { + return len(s.raw) == 0 +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/context.go b/vendor/github.com/hashicorp/terraform/terraform/context.go index 15528be..28ca14c 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/context.go +++ b/vendor/github.com/hashicorp/terraform/terraform/context.go @@ -12,7 +12,6 @@ import ( "github.com/hashicorp/hcl" "github.com/hashicorp/terraform/config" "github.com/hashicorp/terraform/config/module" - "github.com/hashicorp/terraform/helper/experiment" ) // InputMode defines what sort of input will be asked for when Input @@ -57,12 +56,17 @@ type ContextOpts struct { Parallelism int State *State StateFutureAllowed bool - Providers map[string]ResourceProviderFactory + ProviderResolver ResourceProviderResolver Provisioners map[string]ResourceProvisionerFactory Shadow bool Targets []string Variables map[string]interface{} + // If non-nil, will apply as additional constraints on the provider + // plugins that will be requested from the provider resolver. + ProviderSHA256s map[string][]byte + SkipProviderVerify bool + UIInput UIInput } @@ -102,6 +106,7 @@ type Context struct { l sync.Mutex // Lock acquired during any task parallelSem Semaphore providerInputConfig map[string]map[string]interface{} + providerSHA256s map[string][]byte runLock sync.Mutex runCond *sync.Cond runContext context.Context @@ -117,7 +122,7 @@ type Context struct { func NewContext(opts *ContextOpts) (*Context, error) { // Validate the version requirement if it is given if opts.Module != nil { - if err := checkRequiredVersion(opts.Module); err != nil { + if err := CheckRequiredVersion(opts.Module); err != nil { return nil, err } } @@ -166,7 +171,6 @@ func NewContext(opts *ContextOpts) (*Context, error) { // set by environment variables if necessary. This includes // values taken from -var-file in addition. variables := make(map[string]interface{}) - if opts.Module != nil { var err error variables, err = Variables(opts.Module, opts.Variables) @@ -175,6 +179,23 @@ func NewContext(opts *ContextOpts) (*Context, error) { } } + // Bind available provider plugins to the constraints in config + var providers map[string]ResourceProviderFactory + if opts.ProviderResolver != nil { + var err error + deps := ModuleTreeDependencies(opts.Module, state) + reqd := deps.AllPluginRequirements() + if opts.ProviderSHA256s != nil && !opts.SkipProviderVerify { + reqd.LockExecutables(opts.ProviderSHA256s) + } + providers, err = resourceProviderFactories(opts.ProviderResolver, reqd) + if err != nil { + return nil, err + } + } else { + providers = make(map[string]ResourceProviderFactory) + } + diff := opts.Diff if diff == nil { diff = &Diff{} @@ -182,7 +203,7 @@ func NewContext(opts *ContextOpts) (*Context, error) { return &Context{ components: &basicComponentFactory{ - providers: opts.Providers, + providers: providers, provisioners: opts.Provisioners, }, destroy: opts.Destroy, @@ -198,6 +219,7 @@ func NewContext(opts *ContextOpts) (*Context, error) { parallelSem: NewSemaphore(par), providerInputConfig: make(map[string]map[string]interface{}), + providerSHA256s: opts.ProviderSHA256s, sh: sh, }, nil } @@ -442,7 +464,7 @@ func (c *Context) Input(mode InputMode) error { } // Do the walk - if _, err := c.walk(graph, nil, walkInput); err != nil { + if _, err := c.walk(graph, walkInput); err != nil { return err } } @@ -453,8 +475,17 @@ func (c *Context) Input(mode InputMode) error { // Apply applies the changes represented by this context and returns // the resulting state. // -// In addition to returning the resulting state, this context is updated -// with the latest state. +// Even in the case an error is returned, the state may be returned and will +// potentially be partially updated. In addition to returning the resulting +// state, this context is updated with the latest state. +// +// If the state is required after an error, the caller should call +// Context.State, rather than rely on the return value. +// +// TODO: Apply and Refresh should either always return a state, or rely on the +// State() method. Currently the helper/resource testing framework relies +// on the absence of a returned state to determine if Destroy can be +// called, so that will need to be refactored before this can be changed. func (c *Context) Apply() (*State, error) { defer c.acquireRun("apply")() @@ -474,7 +505,7 @@ func (c *Context) Apply() (*State, error) { } // Walk the graph - walker, err := c.walk(graph, graph, operation) + walker, err := c.walk(graph, operation) if len(walker.ValidationErrors) > 0 { err = multierror.Append(err, walker.ValidationErrors...) } @@ -500,6 +531,9 @@ func (c *Context) Plan() (*Plan, error) { Vars: c.variables, State: c.state, Targets: c.targets, + + TerraformVersion: VersionString(), + ProviderSHA256s: c.providerSHA256s, } var operation walkOperation @@ -540,7 +574,7 @@ func (c *Context) Plan() (*Plan, error) { } // Do the walk - walker, err := c.walk(graph, graph, operation) + walker, err := c.walk(graph, operation) if err != nil { return nil, err } @@ -580,7 +614,7 @@ func (c *Context) Plan() (*Plan, error) { // to their latest state. This will update the state that this context // works with, along with returning it. // -// Even in the case an error is returned, the state will be returned and +// Even in the case an error is returned, the state may be returned and // will potentially be partially updated. func (c *Context) Refresh() (*State, error) { defer c.acquireRun("refresh")() @@ -595,7 +629,7 @@ func (c *Context) Refresh() (*State, error) { } // Do the walk - if _, err := c.walk(graph, graph, walkRefresh); err != nil { + if _, err := c.walk(graph, walkRefresh); err != nil { return nil, err } @@ -670,7 +704,7 @@ func (c *Context) Validate() ([]string, []error) { } // Walk - walker, err := c.walk(graph, graph, walkValidate) + walker, err := c.walk(graph, walkValidate) if err != nil { return nil, multierror.Append(errs, err).Errors } @@ -757,33 +791,11 @@ func (c *Context) releaseRun() { c.runContext = nil } -func (c *Context) walk( - graph, shadow *Graph, operation walkOperation) (*ContextGraphWalker, error) { +func (c *Context) walk(graph *Graph, operation walkOperation) (*ContextGraphWalker, error) { // Keep track of the "real" context which is the context that does // the real work: talking to real providers, modifying real state, etc. realCtx := c - // If we don't want shadowing, remove it - if !experiment.Enabled(experiment.X_shadow) { - shadow = nil - } - - // Just log this so we can see it in a debug log - if !c.shadow { - log.Printf("[WARN] terraform: shadow graph disabled") - shadow = nil - } - - // If we have a shadow graph, walk that as well - var shadowCtx *Context - var shadowCloser Shadow - if shadow != nil { - // Build the shadow context. In the process, override the real context - // with the one that is wrapped so that the shadow context can verify - // the results of the real. - realCtx, shadowCtx, shadowCloser = newShadowContext(c) - } - log.Printf("[DEBUG] Starting graph walk: %s", operation.String()) walker := &ContextGraphWalker{ @@ -802,90 +814,6 @@ func (c *Context) walk( close(watchStop) <-watchWait - // If we have a shadow graph and we interrupted the real graph, then - // we just close the shadow and never verify it. It is non-trivial to - // recreate the exact execution state up until an interruption so this - // isn't supported with shadows at the moment. - if shadowCloser != nil && c.sh.Stopped() { - // Ignore the error result, there is nothing we could care about - shadowCloser.CloseShadow() - - // Set it to nil so we don't do anything - shadowCloser = nil - } - - // If we have a shadow graph, wait for that to complete. - if shadowCloser != nil { - // Build the graph walker for the shadow. We also wrap this in - // a panicwrap so that panics are captured. For the shadow graph, - // we just want panics to be normal errors rather than to crash - // Terraform. - shadowWalker := GraphWalkerPanicwrap(&ContextGraphWalker{ - Context: shadowCtx, - Operation: operation, - }) - - // Kick off the shadow walk. This will block on any operations - // on the real walk so it is fine to start first. - log.Printf("[INFO] Starting shadow graph walk: %s", operation.String()) - shadowCh := make(chan error) - go func() { - shadowCh <- shadow.Walk(shadowWalker) - }() - - // Notify the shadow that we're done - if err := shadowCloser.CloseShadow(); err != nil { - c.shadowErr = multierror.Append(c.shadowErr, err) - } - - // Wait for the walk to end - log.Printf("[DEBUG] Waiting for shadow graph to complete...") - shadowWalkErr := <-shadowCh - - // Get any shadow errors - if err := shadowCloser.ShadowError(); err != nil { - c.shadowErr = multierror.Append(c.shadowErr, err) - } - - // Verify the contexts (compare) - if err := shadowContextVerify(realCtx, shadowCtx); err != nil { - c.shadowErr = multierror.Append(c.shadowErr, err) - } - - // At this point, if we're supposed to fail on error, then - // we PANIC. Some tests just verify that there is an error, - // so simply appending it to realErr and returning could hide - // shadow problems. - // - // This must be done BEFORE appending shadowWalkErr since the - // shadowWalkErr may include expected errors. - // - // We only do this if we don't have a real error. In the case of - // a real error, we can't guarantee what nodes were and weren't - // traversed in parallel scenarios so we can't guarantee no - // shadow errors. - if c.shadowErr != nil && contextFailOnShadowError && realErr == nil { - panic(multierror.Prefix(c.shadowErr, "shadow graph:")) - } - - // Now, if we have a walk error, we append that through - if shadowWalkErr != nil { - c.shadowErr = multierror.Append(c.shadowErr, shadowWalkErr) - } - - if c.shadowErr == nil { - log.Printf("[INFO] Shadow graph success!") - } else { - log.Printf("[ERROR] Shadow graph error: %s", c.shadowErr) - - // If we're supposed to fail on shadow errors, then report it - if contextFailOnShadowError { - realErr = multierror.Append(realErr, multierror.Prefix( - c.shadowErr, "shadow graph:")) - } - } - } - return walker, realErr } diff --git a/vendor/github.com/hashicorp/terraform/terraform/context_import.go b/vendor/github.com/hashicorp/terraform/terraform/context_import.go index f1d5776..e940143 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/context_import.go +++ b/vendor/github.com/hashicorp/terraform/terraform/context_import.go @@ -66,7 +66,7 @@ func (c *Context) Import(opts *ImportOpts) (*State, error) { } // Walk it - if _, err := c.walk(graph, nil, walkImport); err != nil { + if _, err := c.walk(graph, walkImport); err != nil { return c.state, err } diff --git a/vendor/github.com/hashicorp/terraform/terraform/diff.go b/vendor/github.com/hashicorp/terraform/terraform/diff.go index 5cf1b78..9cbd5d8 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/diff.go +++ b/vendor/github.com/hashicorp/terraform/terraform/diff.go @@ -23,9 +23,18 @@ const ( DiffUpdate DiffDestroy DiffDestroyCreate + + // DiffRefresh is only used in the UI for displaying diffs. + // Managed resource reads never appear in plan, and when data source + // reads appear they are represented as DiffCreate in core before + // transforming to DiffRefresh in the UI layer. + DiffRefresh // TODO: Actually use DiffRefresh in core too, for less confusion ) -// Diff trackes the changes that are necessary to apply a configuration +// multiVal matches the index key to a flatmapped set, list or map +var multiVal = regexp.MustCompile(`\.(#|%)$`) + +// Diff tracks the changes that are necessary to apply a configuration // to an existing infrastructure. type Diff struct { // Modules contains all the modules that have a diff @@ -367,7 +376,7 @@ type InstanceDiff struct { // Meta is a simple K/V map that is stored in a diff and persisted to // plans but otherwise is completely ignored by Terraform core. It is - // mean to be used for additional data a resource may want to pass through. + // meant to be used for additional data a resource may want to pass through. // The value here must only contain Go primitives and collections. Meta map[string]interface{} } @@ -548,7 +557,7 @@ func (d *InstanceDiff) SetDestroyDeposed(b bool) { } // These methods are properly locked, for use outside other InstanceDiff -// methods but everywhere else within in the terraform package. +// methods but everywhere else within the terraform package. // TODO refactor the locking scheme func (d *InstanceDiff) SetTainted(b bool) { d.mu.Lock() @@ -808,7 +817,6 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) { } // search for the suffix of the base of a [computed] map, list or set. - multiVal := regexp.MustCompile(`\.(#|~#|%)$`) match := multiVal.FindStringSubmatch(k) if diffOld.NewComputed && len(match) == 2 { diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval.go b/vendor/github.com/hashicorp/terraform/terraform/eval.go index 3cb088a..10d9c22 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval.go @@ -49,11 +49,11 @@ func EvalRaw(n EvalNode, ctx EvalContext) (interface{}, error) { path = strings.Join(ctx.Path(), ".") } - log.Printf("[DEBUG] %s: eval: %T", path, n) + log.Printf("[TRACE] %s: eval: %T", path, n) output, err := n.Eval(ctx) if err != nil { if _, ok := err.(EvalEarlyExitError); ok { - log.Printf("[DEBUG] %s: eval: %T, err: %s", path, n, err) + log.Printf("[TRACE] %s: eval: %T, err: %s", path, n, err) } else { log.Printf("[ERROR] %s: eval: %T, err: %s", path, n, err) } diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_apply.go b/vendor/github.com/hashicorp/terraform/terraform/eval_apply.go index 2f6a497..36c9845 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval_apply.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_apply.go @@ -112,7 +112,7 @@ func (n *EvalApplyPre) Eval(ctx EvalContext) (interface{}, error) { } state.init() - { + if resourceHasUserVisibleApply(n.Info) { // Call post-apply hook err := ctx.Hook(func(h Hook) (HookAction, error) { return h.PreApply(n.Info, state, diff) @@ -136,7 +136,7 @@ type EvalApplyPost struct { func (n *EvalApplyPost) Eval(ctx EvalContext) (interface{}, error) { state := *n.State - { + if resourceHasUserVisibleApply(n.Info) { // Call post-apply hook err := ctx.Hook(func(h Hook) (HookAction, error) { return h.PostApply(n.Info, state, *n.Error) @@ -149,6 +149,22 @@ func (n *EvalApplyPost) Eval(ctx EvalContext) (interface{}, error) { return nil, *n.Error } +// resourceHasUserVisibleApply returns true if the given resource is one where +// apply actions should be exposed to the user. +// +// Certain resources do apply actions only as an implementation detail, so +// these should not be advertised to code outside of this package. +func resourceHasUserVisibleApply(info *InstanceInfo) bool { + addr := info.ResourceAddress() + + // Only managed resources have user-visible apply actions. + // In particular, this excludes data resources since we "apply" these + // only as an implementation detail of removing them from state when + // they are destroyed. (When reading, they don't get here at all because + // we present them as "Refresh" actions.) + return addr.Mode == config.ManagedResourceMode +} + // EvalApplyProvisioners is an EvalNode implementation that executes // the provisioners for a resource. // diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_diff.go b/vendor/github.com/hashicorp/terraform/terraform/eval_diff.go index 717d951..c35f908 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval_diff.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_diff.go @@ -81,6 +81,12 @@ type EvalDiff struct { // Resource is needed to fetch the ignore_changes list so we can // filter user-requested ignored attributes from the diff. Resource *config.Resource + + // Stub is used to flag the generated InstanceDiff as a stub. This is used to + // ensure that the node exists to perform interpolations and generate + // computed paths off of, but not as an actual diff where resouces should be + // counted, and not as a diff that should be acted on. + Stub bool } // TODO: test @@ -90,11 +96,13 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { provider := *n.Provider // Call pre-diff hook - err := ctx.Hook(func(h Hook) (HookAction, error) { - return h.PreDiff(n.Info, state) - }) - if err != nil { - return nil, err + if !n.Stub { + err := ctx.Hook(func(h Hook) (HookAction, error) { + return h.PreDiff(n.Info, state) + }) + if err != nil { + return nil, err + } } // The state for the diff must never be nil @@ -152,20 +160,25 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { }) } + // filter out ignored resources if err := n.processIgnoreChanges(diff); err != nil { return nil, err } // Call post-refresh hook - err = ctx.Hook(func(h Hook) (HookAction, error) { - return h.PostDiff(n.Info, diff) - }) - if err != nil { - return nil, err + if !n.Stub { + err = ctx.Hook(func(h Hook) (HookAction, error) { + return h.PostDiff(n.Info, diff) + }) + if err != nil { + return nil, err + } } - // Update our output - *n.OutputDiff = diff + // Update our output if we care + if n.OutputDiff != nil { + *n.OutputDiff = diff + } // Update the state if we care if n.OutputState != nil { @@ -190,72 +203,81 @@ func (n *EvalDiff) processIgnoreChanges(diff *InstanceDiff) error { return nil } - changeType := diff.ChangeType() - // If we're just creating the resource, we shouldn't alter the // Diff at all - if changeType == DiffCreate { + if diff.ChangeType() == DiffCreate { return nil } // If the resource has been tainted then we don't process ignore changes // since we MUST recreate the entire resource. - if diff.DestroyTainted { + if diff.GetDestroyTainted() { return nil } + attrs := diff.CopyAttributes() + + // get the complete set of keys we want to ignore ignorableAttrKeys := make(map[string]bool) for _, ignoredKey := range ignoreChanges { - for k := range diff.CopyAttributes() { + for k := range attrs { if ignoredKey == "*" || strings.HasPrefix(k, ignoredKey) { ignorableAttrKeys[k] = true } } } - // If we are replacing the resource, then we expect there to be a bunch of - // extraneous attribute diffs we need to filter out for the other - // non-requires-new attributes going from "" -> "configval" or "" -> - // "". Filtering these out allows us to see if we might be able to - // skip this diff altogether. - if changeType == DiffDestroyCreate { - for k, v := range diff.CopyAttributes() { - if v.Empty() || v.NewComputed { - ignorableAttrKeys[k] = true - } - } - - // Here we emulate the implementation of diff.RequiresNew() with one small - // tweak, we ignore the "id" attribute diff that gets added by EvalDiff, - // since that was added in reaction to RequiresNew being true. - requiresNewAfterIgnores := false - for k, v := range diff.CopyAttributes() { + // If the resource was being destroyed, check to see if we can ignore the + // reason for it being destroyed. + if diff.GetDestroy() { + for k, v := range attrs { if k == "id" { + // id will always be changed if we intended to replace this instance continue } - if _, ok := ignorableAttrKeys[k]; ok { + if v.Empty() || v.NewComputed { continue } - if v.RequiresNew == true { - requiresNewAfterIgnores = true + + // If any RequiresNew attribute isn't ignored, we need to keep the diff + // as-is to be able to replace the resource. + if v.RequiresNew && !ignorableAttrKeys[k] { + return nil } } - // If we still require resource replacement after ignores, we - // can't touch the diff, as all of the attributes will be - // required to process the replacement. - if requiresNewAfterIgnores { - return nil + // Now that we know that we aren't replacing the instance, we can filter + // out all the empty and computed attributes. There may be a bunch of + // extraneous attribute diffs for the other non-requires-new attributes + // going from "" -> "configval" or "" -> "". + // We must make sure any flatmapped containers are filterred (or not) as a + // whole. + containers := groupContainers(diff) + keep := map[string]bool{} + for _, v := range containers { + if v.keepDiff() { + // At least one key has changes, so list all the sibling keys + // to keep in the diff. + for k := range v { + keep[k] = true + } + } } - // Here we undo the two reactions to RequireNew in EvalDiff - the "id" - // attribute diff and the Destroy boolean field - log.Printf("[DEBUG] Removing 'id' diff and setting Destroy to false " + - "because after ignore_changes, this diff no longer requires replacement") - diff.DelAttribute("id") - diff.SetDestroy(false) + for k, v := range attrs { + if (v.Empty() || v.NewComputed) && !keep[k] { + ignorableAttrKeys[k] = true + } + } } + // Here we undo the two reactions to RequireNew in EvalDiff - the "id" + // attribute diff and the Destroy boolean field + log.Printf("[DEBUG] Removing 'id' diff and setting Destroy to false " + + "because after ignore_changes, this diff no longer requires replacement") + diff.DelAttribute("id") + diff.SetDestroy(false) + // If we didn't hit any of our early exit conditions, we can filter the diff. for k := range ignorableAttrKeys { log.Printf("[DEBUG] [EvalIgnoreChanges] %s - Ignoring diff attribute: %s", @@ -266,6 +288,46 @@ func (n *EvalDiff) processIgnoreChanges(diff *InstanceDiff) error { return nil } +// a group of key-*ResourceAttrDiff pairs from the same flatmapped container +type flatAttrDiff map[string]*ResourceAttrDiff + +// we need to keep all keys if any of them have a diff +func (f flatAttrDiff) keepDiff() bool { + for _, v := range f { + if !v.Empty() && !v.NewComputed { + return true + } + } + return false +} + +// sets, lists and maps need to be compared for diff inclusion as a whole, so +// group the flatmapped keys together for easier comparison. +func groupContainers(d *InstanceDiff) map[string]flatAttrDiff { + isIndex := multiVal.MatchString + containers := map[string]flatAttrDiff{} + attrs := d.CopyAttributes() + // we need to loop once to find the index key + for k := range attrs { + if isIndex(k) { + // add the key, always including the final dot to fully qualify it + containers[k[:len(k)-1]] = flatAttrDiff{} + } + } + + // loop again to find all the sub keys + for prefix, values := range containers { + for k, attrDiff := range attrs { + // we include the index value as well, since it could be part of the diff + if strings.HasPrefix(k, prefix) { + values[k] = attrDiff + } + } + } + + return containers +} + // EvalDiffDestroy is an EvalNode implementation that returns a plain // destroy diff. type EvalDiffDestroy struct { diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_interpolate.go b/vendor/github.com/hashicorp/terraform/terraform/eval_interpolate.go index 6825ff5..df3bcb9 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval_interpolate.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_interpolate.go @@ -1,6 +1,10 @@ package terraform -import "github.com/hashicorp/terraform/config" +import ( + "log" + + "github.com/hashicorp/terraform/config" +) // EvalInterpolate is an EvalNode implementation that takes a raw // configuration and interpolates it. @@ -22,3 +26,28 @@ func (n *EvalInterpolate) Eval(ctx EvalContext) (interface{}, error) { return nil, nil } + +// EvalTryInterpolate is an EvalNode implementation that takes a raw +// configuration and interpolates it, but only logs a warning on an +// interpolation error, and stops further Eval steps. +// This is used during Input where a value may not be known before Refresh, but +// we don't want to block Input. +type EvalTryInterpolate struct { + Config *config.RawConfig + Resource *Resource + Output **ResourceConfig +} + +func (n *EvalTryInterpolate) Eval(ctx EvalContext) (interface{}, error) { + rc, err := ctx.Interpolate(n.Config, n.Resource) + if err != nil { + log.Printf("[WARN] Interpolation %q failed: %s", n.Config.Key, err) + return nil, EvalEarlyExitError{} + } + + if n.Output != nil { + *n.Output = rc + } + + return nil, nil +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_local.go b/vendor/github.com/hashicorp/terraform/terraform/eval_local.go new file mode 100644 index 0000000..1b63bf4 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_local.go @@ -0,0 +1,58 @@ +package terraform + +import ( + "fmt" + + "github.com/hashicorp/terraform/config" +) + +// EvalLocal is an EvalNode implementation that evaluates the +// expression for a local value and writes it into a transient part of +// the state. +type EvalLocal struct { + Name string + Value *config.RawConfig +} + +func (n *EvalLocal) Eval(ctx EvalContext) (interface{}, error) { + cfg, err := ctx.Interpolate(n.Value, nil) + if err != nil { + return nil, fmt.Errorf("local.%s: %s", n.Name, err) + } + + state, lock := ctx.State() + if state == nil { + return nil, fmt.Errorf("cannot write local value to nil state") + } + + // Get a write lock so we can access the state + lock.Lock() + defer lock.Unlock() + + // Look for the module state. If we don't have one, create it. + mod := state.ModuleByPath(ctx.Path()) + if mod == nil { + mod = state.AddModule(ctx.Path()) + } + + // Get the value from the config + var valueRaw interface{} = config.UnknownVariableValue + if cfg != nil { + var ok bool + valueRaw, ok = cfg.Get("value") + if !ok { + valueRaw = "" + } + if cfg.IsComputed("value") { + valueRaw = config.UnknownVariableValue + } + } + + if mod.Locals == nil { + // initialize + mod.Locals = map[string]interface{}{} + } + mod.Locals[n.Name] = valueRaw + + return nil, nil +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_provider.go b/vendor/github.com/hashicorp/terraform/terraform/eval_provider.go index 61efcc2..092fd18 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval_provider.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_provider.go @@ -30,6 +30,11 @@ func (n *EvalBuildProviderConfig) Eval(ctx EvalContext) (interface{}, error) { // If we have a configuration set, then merge that in if input := ctx.ProviderInput(n.Provider); input != nil { + // "input" is a map of the subset of config values that were known + // during the input walk, set by EvalInputProvider. Note that + // in particular it does *not* include attributes that had + // computed values at input time; those appear *only* in + // "cfg" here. rc, err := config.NewRawConfig(input) if err != nil { return nil, err @@ -136,7 +141,21 @@ func (n *EvalInputProvider) Eval(ctx EvalContext) (interface{}, error) { // Set the input that we received so that child modules don't attempt // to ask for input again. if config != nil && len(config.Config) > 0 { - ctx.SetProviderInput(n.Name, config.Config) + // This repository of provider input results on the context doesn't + // retain config.ComputedKeys, so we need to filter those out here + // in order that later users of this data won't try to use the unknown + // value placeholder as if it were a literal value. This map is just + // of known values we've been able to complete so far; dynamic stuff + // will be merged in by EvalBuildProviderConfig on subsequent + // (post-input) walks. + confMap := config.Config + if config.ComputedKeys != nil { + for _, key := range config.ComputedKeys { + delete(confMap, key) + } + } + + ctx.SetProviderInput(n.Name, confMap) } else { ctx.SetProviderInput(n.Name, map[string]interface{}{}) } diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_state.go b/vendor/github.com/hashicorp/terraform/terraform/eval_state.go index 126a0e6..1f67e3d 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval_state.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_state.go @@ -1,6 +1,8 @@ package terraform -import "fmt" +import ( + "fmt" +) // EvalReadState is an EvalNode implementation that reads the // primary InstanceState for a specific resource out of the state. diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_validate.go b/vendor/github.com/hashicorp/terraform/terraform/eval_validate.go index a2c122d..478aa64 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval_validate.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_validate.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform/config" + "github.com/mitchellh/mapstructure" ) // EvalValidateError is the error structure returned if there were @@ -85,12 +86,31 @@ func (n *EvalValidateProvider) Eval(ctx EvalContext) (interface{}, error) { type EvalValidateProvisioner struct { Provisioner *ResourceProvisioner Config **ResourceConfig + ConnConfig **ResourceConfig } func (n *EvalValidateProvisioner) Eval(ctx EvalContext) (interface{}, error) { provisioner := *n.Provisioner config := *n.Config - warns, errs := provisioner.Validate(config) + var warns []string + var errs []error + + { + // Validate the provisioner's own config first + w, e := provisioner.Validate(config) + warns = append(warns, w...) + errs = append(errs, e...) + } + + { + // Now validate the connection config, which might either be from + // the provisioner block itself or inherited from the resource's + // shared connection info. + w, e := n.validateConnConfig(*n.ConnConfig) + warns = append(warns, w...) + errs = append(errs, e...) + } + if len(warns) == 0 && len(errs) == 0 { return nil, nil } @@ -101,6 +121,64 @@ func (n *EvalValidateProvisioner) Eval(ctx EvalContext) (interface{}, error) { } } +func (n *EvalValidateProvisioner) validateConnConfig(connConfig *ResourceConfig) (warns []string, errs []error) { + // We can't comprehensively validate the connection config since its + // final structure is decided by the communicator and we can't instantiate + // that until we have a complete instance state. However, we *can* catch + // configuration keys that are not valid for *any* communicator, catching + // typos early rather than waiting until we actually try to run one of + // the resource's provisioners. + + type connConfigSuperset struct { + // All attribute types are interface{} here because at this point we + // may still have unresolved interpolation expressions, which will + // appear as strings regardless of the final goal type. + + Type interface{} `mapstructure:"type"` + User interface{} `mapstructure:"user"` + Password interface{} `mapstructure:"password"` + Host interface{} `mapstructure:"host"` + Port interface{} `mapstructure:"port"` + Timeout interface{} `mapstructure:"timeout"` + ScriptPath interface{} `mapstructure:"script_path"` + + // For type=ssh only (enforced in ssh communicator) + PrivateKey interface{} `mapstructure:"private_key"` + Agent interface{} `mapstructure:"agent"` + BastionHost interface{} `mapstructure:"bastion_host"` + BastionPort interface{} `mapstructure:"bastion_port"` + BastionUser interface{} `mapstructure:"bastion_user"` + BastionPassword interface{} `mapstructure:"bastion_password"` + BastionPrivateKey interface{} `mapstructure:"bastion_private_key"` + + // For type=winrm only (enforced in winrm communicator) + HTTPS interface{} `mapstructure:"https"` + Insecure interface{} `mapstructure:"insecure"` + CACert interface{} `mapstructure:"cacert"` + } + + var metadata mapstructure.Metadata + decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ + Metadata: &metadata, + Result: &connConfigSuperset{}, // result is disregarded; we only care about unused keys + }) + if err != nil { + // should never happen + errs = append(errs, err) + return + } + + if err := decoder.Decode(connConfig.Config); err != nil { + errs = append(errs, err) + return + } + + for _, attrName := range metadata.Unused { + errs = append(errs, fmt.Errorf("unknown 'connection' argument %q", attrName)) + } + return +} + // EvalValidateResource is an EvalNode implementation that validates // the configuration of a resource. type EvalValidateResource struct { diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_variable.go b/vendor/github.com/hashicorp/terraform/terraform/eval_variable.go index 47bd2ea..e39a33c 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval_variable.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_variable.go @@ -114,7 +114,6 @@ type EvalVariableBlock struct { VariableValues map[string]interface{} } -// TODO: test func (n *EvalVariableBlock) Eval(ctx EvalContext) (interface{}, error) { // Clear out the existing mapping for k, _ := range n.VariableValues { @@ -124,22 +123,27 @@ func (n *EvalVariableBlock) Eval(ctx EvalContext) (interface{}, error) { // Get our configuration rc := *n.Config for k, v := range rc.Config { - var vString string - if err := hilmapstructure.WeakDecode(v, &vString); err == nil { - n.VariableValues[k] = vString - continue - } - - var vMap map[string]interface{} - if err := hilmapstructure.WeakDecode(v, &vMap); err == nil { - n.VariableValues[k] = vMap - continue - } + vKind := reflect.ValueOf(v).Type().Kind() - var vSlice []interface{} - if err := hilmapstructure.WeakDecode(v, &vSlice); err == nil { - n.VariableValues[k] = vSlice - continue + switch vKind { + case reflect.Slice: + var vSlice []interface{} + if err := hilmapstructure.WeakDecode(v, &vSlice); err == nil { + n.VariableValues[k] = vSlice + continue + } + case reflect.Map: + var vMap map[string]interface{} + if err := hilmapstructure.WeakDecode(v, &vMap); err == nil { + n.VariableValues[k] = vMap + continue + } + default: + var vString string + if err := hilmapstructure.WeakDecode(v, &vString); err == nil { + n.VariableValues[k] = vString + continue + } } return nil, fmt.Errorf("Variable value for %s is not a string, list or map type", k) @@ -174,9 +178,15 @@ func (n *EvalVariableBlock) setUnknownVariableValueForPath(path string) error { // Otherwise find the correct point in the tree and then set to unknown var current interface{} = n.VariableValues[pathComponents[0]] for i := 1; i < len(pathComponents); i++ { - switch current.(type) { - case []interface{}, []map[string]interface{}: - tCurrent := current.([]interface{}) + switch tCurrent := current.(type) { + case []interface{}: + index, err := strconv.Atoi(pathComponents[i]) + if err != nil { + return fmt.Errorf("Cannot convert %s to slice index in path %s", + pathComponents[i], path) + } + current = tCurrent[index] + case []map[string]interface{}: index, err := strconv.Atoi(pathComponents[i]) if err != nil { return fmt.Errorf("Cannot convert %s to slice index in path %s", @@ -184,7 +194,6 @@ func (n *EvalVariableBlock) setUnknownVariableValueForPath(path string) error { } current = tCurrent[index] case map[string]interface{}: - tCurrent := current.(map[string]interface{}) if val, hasVal := tCurrent[pathComponents[i]]; hasVal { current = val continue diff --git a/vendor/github.com/hashicorp/terraform/terraform/graph.go b/vendor/github.com/hashicorp/terraform/terraform/graph.go index 48ce6a3..735ec4e 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/graph.go +++ b/vendor/github.com/hashicorp/terraform/terraform/graph.go @@ -70,7 +70,7 @@ func (g *Graph) walk(walker GraphWalker) error { // Walk the graph. var walkFn dag.WalkFunc walkFn = func(v dag.Vertex) (rerr error) { - log.Printf("[DEBUG] vertex '%s.%s': walking", path, dag.VertexName(v)) + log.Printf("[TRACE] vertex '%s.%s': walking", path, dag.VertexName(v)) g.DebugVisitInfo(v, g.debugName) // If we have a panic wrap GraphWalker and a panic occurs, recover @@ -118,7 +118,7 @@ func (g *Graph) walk(walker GraphWalker) error { // Allow the walker to change our tree if needed. Eval, // then callback with the output. - log.Printf("[DEBUG] vertex '%s.%s': evaluating", path, dag.VertexName(v)) + log.Printf("[TRACE] vertex '%s.%s': evaluating", path, dag.VertexName(v)) g.DebugVertexInfo(v, fmt.Sprintf("evaluating %T(%s)", v, path)) @@ -132,7 +132,7 @@ func (g *Graph) walk(walker GraphWalker) error { // If the node is dynamically expanded, then expand it if ev, ok := v.(GraphNodeDynamicExpandable); ok { log.Printf( - "[DEBUG] vertex '%s.%s': expanding/walking dynamic subgraph", + "[TRACE] vertex '%s.%s': expanding/walking dynamic subgraph", path, dag.VertexName(v)) @@ -154,7 +154,7 @@ func (g *Graph) walk(walker GraphWalker) error { // If the node has a subgraph, then walk the subgraph if sn, ok := v.(GraphNodeSubgraph); ok { log.Printf( - "[DEBUG] vertex '%s.%s': walking subgraph", + "[TRACE] vertex '%s.%s': walking subgraph", path, dag.VertexName(v)) diff --git a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_apply.go b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_apply.go index 6124258..4d78327 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_apply.go +++ b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_apply.go @@ -108,6 +108,9 @@ func (b *ApplyGraphBuilder) Steps() []GraphTransformer { // Add root variables &RootVariableTransformer{Module: b.Module}, + // Add the local values + &LocalTransformer{Module: b.Module}, + // Add the outputs &OutputTransformer{Module: b.Module}, @@ -123,6 +126,10 @@ func (b *ApplyGraphBuilder) Steps() []GraphTransformer { // Target &TargetsTransformer{Targets: b.Targets}, + // Close opened plugin connections + &CloseProviderTransformer{}, + &CloseProvisionerTransformer{}, + // Single root &RootTransformer{}, } diff --git a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_import.go b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_import.go index 7fa76de..7070c59 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_import.go +++ b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_import.go @@ -62,6 +62,9 @@ func (b *ImportGraphBuilder) Steps() []GraphTransformer { // This validates that the providers only depend on variables &ImportProviderValidateTransformer{}, + // Close opened plugin connections + &CloseProviderTransformer{}, + // Single root &RootTransformer{}, diff --git a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_input.go b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_input.go index 0df48cd..10fd8b1 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_input.go +++ b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_input.go @@ -10,6 +10,9 @@ import ( // and is based on the PlanGraphBuilder. The PlanGraphBuilder passed in will be // modified and should not be used for any other operations. func InputGraphBuilder(p *PlanGraphBuilder) GraphBuilder { + // convert this to an InputPlan + p.Input = true + // We're going to customize the concrete functions p.CustomConcrete = true diff --git a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_plan.go b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_plan.go index 275cb32..9d05d4a 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_plan.go +++ b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_plan.go @@ -40,6 +40,9 @@ type PlanGraphBuilder struct { // Validate will do structural validation of the graph. Validate bool + // Input represents that this builder is for an Input operation. + Input bool + // CustomConcrete can be set to customize the node types created // for various parts of the plan. This is useful in order to customize // the plan behavior. @@ -71,6 +74,9 @@ func (b *PlanGraphBuilder) Steps() []GraphTransformer { Module: b.Module, }, + // Add the local values + &LocalTransformer{Module: b.Module}, + // Add the outputs &OutputTransformer{Module: b.Module}, @@ -107,14 +113,32 @@ func (b *PlanGraphBuilder) Steps() []GraphTransformer { ), // Add module variables - &ModuleVariableTransformer{Module: b.Module}, + &ModuleVariableTransformer{ + Module: b.Module, + Input: b.Input, + }, // Connect so that the references are ready for targeting. We'll // have to connect again later for providers and so on. &ReferenceTransformer{}, + // Add the node to fix the state count boundaries + &CountBoundaryTransformer{}, + // Target - &TargetsTransformer{Targets: b.Targets}, + &TargetsTransformer{ + Targets: b.Targets, + + // Resource nodes from config have not yet been expanded for + // "count", so we must apply targeting without indices. Exact + // targeting will be dealt with later when these resources + // DynamicExpand. + IgnoreIndices: true, + }, + + // Close opened plugin connections + &CloseProviderTransformer{}, + &CloseProvisionerTransformer{}, // Single root &RootTransformer{}, diff --git a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_refresh.go b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_refresh.go index 8fed21d..beb5a4a 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/graph_builder_refresh.go +++ b/vendor/github.com/hashicorp/terraform/terraform/graph_builder_refresh.go @@ -1,6 +1,8 @@ package terraform import ( + "log" + "github.com/hashicorp/terraform/config" "github.com/hashicorp/terraform/config/module" "github.com/hashicorp/terraform/dag" @@ -56,8 +58,16 @@ func (b *RefreshGraphBuilder) Steps() []GraphTransformer { } } - concreteResource := func(a *NodeAbstractResource) dag.Vertex { - return &NodeRefreshableResource{ + concreteManagedResource := func(a *NodeAbstractResource) dag.Vertex { + return &NodeRefreshableManagedResource{ + NodeAbstractCountResource: &NodeAbstractCountResource{ + NodeAbstractResource: a, + }, + } + } + + concreteManagedResourceInstance := func(a *NodeAbstractResource) dag.Vertex { + return &NodeRefreshableManagedResourceInstance{ NodeAbstractResource: a, } } @@ -71,13 +81,25 @@ func (b *RefreshGraphBuilder) Steps() []GraphTransformer { } steps := []GraphTransformer{ - // Creates all the resources represented in the state - &StateTransformer{ - Concrete: concreteResource, - State: b.State, - }, - - // Creates all the data resources that aren't in the state + // Creates all the managed resources that aren't in the state, but only if + // we have a state already. No resources in state means there's not + // anything to refresh. + func() GraphTransformer { + if b.State.HasResources() { + return &ConfigTransformer{ + Concrete: concreteManagedResource, + Module: b.Module, + Unique: true, + ModeFilter: true, + Mode: config.ManagedResourceMode, + } + } + log.Println("[TRACE] No managed resources in state during refresh, skipping managed resource transformer") + return nil + }(), + + // Creates all the data resources that aren't in the state. This will also + // add any orphans from scaling in as destroy nodes. &ConfigTransformer{ Concrete: concreteDataResource, Module: b.Module, @@ -86,6 +108,15 @@ func (b *RefreshGraphBuilder) Steps() []GraphTransformer { Mode: config.DataResourceMode, }, + // Add any fully-orphaned resources from config (ones that have been + // removed completely, not ones that are just orphaned due to a scaled-in + // count. + &OrphanResourceTransformer{ + Concrete: concreteManagedResourceInstance, + State: b.State, + Module: b.Module, + }, + // Attach the state &AttachStateTransformer{State: b.State}, @@ -102,6 +133,9 @@ func (b *RefreshGraphBuilder) Steps() []GraphTransformer { &ParentProviderTransformer{}, &AttachProviderConfigTransformer{Module: b.Module}, + // Add the local values + &LocalTransformer{Module: b.Module}, + // Add the outputs &OutputTransformer{Module: b.Module}, @@ -113,7 +147,18 @@ func (b *RefreshGraphBuilder) Steps() []GraphTransformer { &ReferenceTransformer{}, // Target - &TargetsTransformer{Targets: b.Targets}, + &TargetsTransformer{ + Targets: b.Targets, + + // Resource nodes from config have not yet been expanded for + // "count", so we must apply targeting without indices. Exact + // targeting will be dealt with later when these resources + // DynamicExpand. + IgnoreIndices: true, + }, + + // Close opened plugin connections + &CloseProviderTransformer{}, // Single root &RootTransformer{}, diff --git a/vendor/github.com/hashicorp/terraform/terraform/graphtype_string.go b/vendor/github.com/hashicorp/terraform/terraform/graphtype_string.go index 88ecad4..e97b485 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/graphtype_string.go +++ b/vendor/github.com/hashicorp/terraform/terraform/graphtype_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type=GraphType context_graph_type.go"; DO NOT EDIT +// Code generated by "stringer -type=GraphType context_graph_type.go"; DO NOT EDIT. package terraform diff --git a/vendor/github.com/hashicorp/terraform/terraform/instancetype_string.go b/vendor/github.com/hashicorp/terraform/terraform/instancetype_string.go index f65414b..f69267c 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/instancetype_string.go +++ b/vendor/github.com/hashicorp/terraform/terraform/instancetype_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type=InstanceType instancetype.go"; DO NOT EDIT +// Code generated by "stringer -type=InstanceType instancetype.go"; DO NOT EDIT. package terraform diff --git a/vendor/github.com/hashicorp/terraform/terraform/interpolate.go b/vendor/github.com/hashicorp/terraform/terraform/interpolate.go index 993317e..52ce1e8 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/interpolate.go +++ b/vendor/github.com/hashicorp/terraform/terraform/interpolate.go @@ -90,6 +90,8 @@ func (i *Interpolater) Values( err = i.valueSimpleVar(scope, n, v, result) case *config.TerraformVariable: err = i.valueTerraformVar(scope, n, v, result) + case *config.LocalVariable: + err = i.valueLocalVar(scope, n, v, result) case *config.UserVariable: err = i.valueUserVar(scope, n, v, result) default: @@ -262,7 +264,7 @@ func (i *Interpolater) valueResourceVar( // If it truly is missing, we'll catch it on a later walk. // This applies only to graph nodes that interpolate during the // config walk, e.g. providers. - if i.Operation == walkInput { + if i.Operation == walkInput || i.Operation == walkRefresh { result[n] = unknownVariable() return nil } @@ -306,10 +308,10 @@ func (i *Interpolater) valueSimpleVar( // relied on this for their template_file data sources. We should // remove this at some point but there isn't any rush. return fmt.Errorf( - "invalid variable syntax: %q. If this is part of inline `template` parameter\n"+ + "invalid variable syntax: %q. Did you mean 'var.%s'? If this is part of inline `template` parameter\n"+ "then you must escape the interpolation with two dollar signs. For\n"+ "example: ${a} becomes $${a}.", - n) + n, n) } func (i *Interpolater) valueTerraformVar( @@ -317,9 +319,13 @@ func (i *Interpolater) valueTerraformVar( n string, v *config.TerraformVariable, result map[string]ast.Variable) error { - if v.Field != "env" { + + // "env" is supported for backward compatibility, but it's deprecated and + // so we won't advertise it as being allowed in the error message. It will + // be removed in a future version of Terraform. + if v.Field != "workspace" && v.Field != "env" { return fmt.Errorf( - "%s: only supported key for 'terraform.X' interpolations is 'env'", n) + "%s: only supported key for 'terraform.X' interpolations is 'workspace'", n) } if i.Meta == nil { @@ -331,6 +337,59 @@ func (i *Interpolater) valueTerraformVar( return nil } +func (i *Interpolater) valueLocalVar( + scope *InterpolationScope, + n string, + v *config.LocalVariable, + result map[string]ast.Variable, +) error { + i.StateLock.RLock() + defer i.StateLock.RUnlock() + + modTree := i.Module + if len(scope.Path) > 1 { + modTree = i.Module.Child(scope.Path[1:]) + } + + // Get the resource from the configuration so we can verify + // that the resource is in the configuration and so we can access + // the configuration if we need to. + var cl *config.Local + for _, l := range modTree.Config().Locals { + if l.Name == v.Name { + cl = l + break + } + } + + if cl == nil { + return fmt.Errorf("%s: no local value of this name has been declared", n) + } + + // Get the relevant module + module := i.State.ModuleByPath(scope.Path) + if module == nil { + result[n] = unknownVariable() + return nil + } + + rawV, exists := module.Locals[v.Name] + if !exists { + result[n] = unknownVariable() + return nil + } + + varV, err := hil.InterfaceToVariable(rawV) + if err != nil { + // Should never happen, since interpolation should always produce + // something we can feed back in to interpolation. + return fmt.Errorf("%s: %s", n, err) + } + + result[n] = varV + return nil +} + func (i *Interpolater) valueUserVar( scope *InterpolationScope, n string, @@ -540,6 +599,13 @@ func (i *Interpolater) computeResourceMultiVariable( unknownVariable := unknownVariable() + // If we're only looking for input, we don't need to expand a + // multi-variable. This prevents us from encountering things that should be + // known but aren't because the state has yet to be refreshed. + if i.Operation == walkInput { + return &unknownVariable, nil + } + // Get the information about this resource variable, and verify // that it exists and such. module, cr, err := i.resourceVariableInfo(scope, v) @@ -587,10 +653,6 @@ func (i *Interpolater) computeResourceMultiVariable( } if singleAttr, ok := r.Primary.Attributes[v.Field]; ok { - if singleAttr == config.UnknownVariableValue { - return &unknownVariable, nil - } - values = append(values, singleAttr) continue } @@ -606,10 +668,6 @@ func (i *Interpolater) computeResourceMultiVariable( return nil, err } - if multiAttr == unknownVariable { - return &unknownVariable, nil - } - values = append(values, multiAttr) } @@ -732,6 +790,19 @@ func (i *Interpolater) resourceCountMax( return count, nil } + // If we have no module state in the apply walk, that suggests we've hit + // a rather awkward edge-case: the resource this variable refers to + // has count = 0 and is the only resource processed so far on this walk, + // and so we've ended up not creating any resource states yet. We don't + // create a module state until the first resource is written into it, + // so the module state doesn't exist when we get here. + // + // In this case we act as we would if we had been passed a module + // with an empty resource state map. + if ms == nil { + return 0, nil + } + // We need to determine the list of resource keys to get values from. // This needs to be sorted so the order is deterministic. We used to // use "cr.Count()" but that doesn't work if the count is interpolated diff --git a/vendor/github.com/hashicorp/terraform/terraform/module_dependencies.go b/vendor/github.com/hashicorp/terraform/terraform/module_dependencies.go new file mode 100644 index 0000000..b9f44a0 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/terraform/module_dependencies.go @@ -0,0 +1,156 @@ +package terraform + +import ( + "github.com/hashicorp/terraform/config" + "github.com/hashicorp/terraform/config/module" + "github.com/hashicorp/terraform/moduledeps" + "github.com/hashicorp/terraform/plugin/discovery" +) + +// ModuleTreeDependencies returns the dependencies of the tree of modules +// described by the given configuration tree and state. +// +// Both configuration and state are required because there can be resources +// implied by instances in the state that no longer exist in config. +// +// This function will panic if any invalid version constraint strings are +// present in the configuration. This is guaranteed not to happen for any +// configuration that has passed a call to Config.Validate(). +func ModuleTreeDependencies(root *module.Tree, state *State) *moduledeps.Module { + + // First we walk the configuration tree to build the overall structure + // and capture the explicit/implicit/inherited provider dependencies. + deps := moduleTreeConfigDependencies(root, nil) + + // Next we walk over the resources in the state to catch any additional + // dependencies created by existing resources that are no longer in config. + // Most things we find in state will already be present in 'deps', but + // we're interested in the rare thing that isn't. + moduleTreeMergeStateDependencies(deps, state) + + return deps +} + +func moduleTreeConfigDependencies(root *module.Tree, inheritProviders map[string]*config.ProviderConfig) *moduledeps.Module { + if root == nil { + // If no config is provided, we'll make a synthetic root. + // This isn't necessarily correct if we're called with a nil that + // *isn't* at the root, but in practice that can never happen. + return &moduledeps.Module{ + Name: "root", + } + } + + ret := &moduledeps.Module{ + Name: root.Name(), + } + + cfg := root.Config() + providerConfigs := cfg.ProviderConfigsByFullName() + + // Provider dependencies + { + providers := make(moduledeps.Providers, len(providerConfigs)) + + // Any providerConfigs elements are *explicit* provider dependencies, + // which is the only situation where the user might provide an actual + // version constraint. We'll take care of these first. + for fullName, pCfg := range providerConfigs { + inst := moduledeps.ProviderInstance(fullName) + versionSet := discovery.AllVersions + if pCfg.Version != "" { + versionSet = discovery.ConstraintStr(pCfg.Version).MustParse() + } + providers[inst] = moduledeps.ProviderDependency{ + Constraints: versionSet, + Reason: moduledeps.ProviderDependencyExplicit, + } + } + + // Each resource in the configuration creates an *implicit* provider + // dependency, though we'll only record it if there isn't already + // an explicit dependency on the same provider. + for _, rc := range cfg.Resources { + fullName := rc.ProviderFullName() + inst := moduledeps.ProviderInstance(fullName) + if _, exists := providers[inst]; exists { + // Explicit dependency already present + continue + } + + reason := moduledeps.ProviderDependencyImplicit + if _, inherited := inheritProviders[fullName]; inherited { + reason = moduledeps.ProviderDependencyInherited + } + + providers[inst] = moduledeps.ProviderDependency{ + Constraints: discovery.AllVersions, + Reason: reason, + } + } + + ret.Providers = providers + } + + childInherit := make(map[string]*config.ProviderConfig) + for k, v := range inheritProviders { + childInherit[k] = v + } + for k, v := range providerConfigs { + childInherit[k] = v + } + for _, c := range root.Children() { + ret.Children = append(ret.Children, moduleTreeConfigDependencies(c, childInherit)) + } + + return ret +} + +func moduleTreeMergeStateDependencies(root *moduledeps.Module, state *State) { + if state == nil { + return + } + + findModule := func(path []string) *moduledeps.Module { + module := root + for _, name := range path[1:] { // skip initial "root" + var next *moduledeps.Module + for _, cm := range module.Children { + if cm.Name == name { + next = cm + break + } + } + + if next == nil { + // If we didn't find a next node, we'll need to make one + next = &moduledeps.Module{ + Name: name, + } + module.Children = append(module.Children, next) + } + + module = next + } + return module + } + + for _, ms := range state.Modules { + module := findModule(ms.Path) + + for _, is := range ms.Resources { + fullName := config.ResourceProviderFullName(is.Type, is.Provider) + inst := moduledeps.ProviderInstance(fullName) + if _, exists := module.Providers[inst]; !exists { + if module.Providers == nil { + module.Providers = make(moduledeps.Providers) + } + module.Providers[inst] = moduledeps.ProviderDependency{ + Constraints: discovery.AllVersions, + Reason: moduledeps.ProviderDependencyFromState, + } + } + } + } + +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go b/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go index d504c89..45129b3 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go +++ b/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go @@ -33,6 +33,17 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er } } + // We also need a destroyable resource for orphans that are a result of a + // scaled-in count. + concreteResourceDestroyable := func(a *NodeAbstractResource) dag.Vertex { + // Add the config since we don't do that via transforms + a.Config = n.Config + + return &NodeDestroyableDataResource{ + NodeAbstractResource: a, + } + } + // Start creating the steps steps := []GraphTransformer{ // Expand the count. @@ -42,6 +53,15 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er Addr: n.ResourceAddr(), }, + // Add the count orphans. As these are orphaned refresh nodes, we add them + // directly as NodeDestroyableDataResource. + &OrphanResourceCountTransformer{ + Concrete: concreteResourceDestroyable, + Count: count, + Addr: n.ResourceAddr(), + State: state, + }, + // Attach the state &AttachStateTransformer{State: state}, diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_local.go b/vendor/github.com/hashicorp/terraform/terraform/node_local.go new file mode 100644 index 0000000..da1564e --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/terraform/node_local.go @@ -0,0 +1,80 @@ +package terraform + +import ( + "fmt" + "strings" + + "github.com/hashicorp/terraform/config" +) + +// NodeLocal represents a named local value in a particular module. +// +// Local value nodes only have one operation, common to all walk types: +// evaluate the result and place it in state. +type NodeLocal struct { + PathValue []string + Config *config.Local +} + +func (n *NodeLocal) Name() string { + result := fmt.Sprintf("local.%s", n.Config.Name) + if len(n.PathValue) > 1 { + result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result) + } + + return result +} + +// GraphNodeSubPath +func (n *NodeLocal) Path() []string { + return n.PathValue +} + +// RemovableIfNotTargeted +func (n *NodeLocal) RemoveIfNotTargeted() bool { + return true +} + +// GraphNodeReferenceable +func (n *NodeLocal) ReferenceableName() []string { + name := fmt.Sprintf("local.%s", n.Config.Name) + return []string{name} +} + +// GraphNodeReferencer +func (n *NodeLocal) References() []string { + var result []string + result = append(result, ReferencesFromConfig(n.Config.RawConfig)...) + for _, v := range result { + split := strings.Split(v, "/") + for i, s := range split { + split[i] = s + ".destroy" + } + + result = append(result, strings.Join(split, "/")) + } + + return result +} + +// GraphNodeEvalable +func (n *NodeLocal) EvalTree() EvalNode { + return &EvalOpFilter{ + Ops: []walkOperation{ + walkInput, + walkValidate, + walkRefresh, + walkPlan, + walkApply, + walkDestroy, + }, + Node: &EvalSequence{ + Nodes: []EvalNode{ + &EvalLocal{ + Name: n.Config.Name, + Value: n.Config.RawConfig, + }, + }, + }, + } +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_module_variable.go b/vendor/github.com/hashicorp/terraform/terraform/node_module_variable.go index 13fe8fc..63b84a9 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/node_module_variable.go +++ b/vendor/github.com/hashicorp/terraform/terraform/node_module_variable.go @@ -15,6 +15,9 @@ type NodeApplyableModuleVariable struct { Value *config.RawConfig // Value is the value that is set Module *module.Tree // Antiquated, want to remove + + // Input is set if this graph was created for the Input operation. + Input bool } func (n *NodeApplyableModuleVariable) Name() string { @@ -92,12 +95,24 @@ func (n *NodeApplyableModuleVariable) EvalTree() EvalNode { // within the variables mapping. var config *ResourceConfig variables := make(map[string]interface{}) + + var interpolate EvalNode + + if n.Input { + interpolate = &EvalTryInterpolate{ + Config: n.Value, + Output: &config, + } + } else { + interpolate = &EvalInterpolate{ + Config: n.Value, + Output: &config, + } + } + return &EvalSequence{ Nodes: []EvalNode{ - &EvalInterpolate{ - Config: n.Value, - Output: &config, - }, + interpolate, &EvalVariableBlock{ Config: &config, diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_output.go b/vendor/github.com/hashicorp/terraform/terraform/node_output.go index e28e6f0..9017a63 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/node_output.go +++ b/vendor/github.com/hashicorp/terraform/terraform/node_output.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/hashicorp/terraform/config" + "github.com/hashicorp/terraform/dag" ) // NodeApplyableOutput represents an output that is "applyable": @@ -35,6 +36,14 @@ func (n *NodeApplyableOutput) RemoveIfNotTargeted() bool { return true } +// GraphNodeTargetDownstream +func (n *NodeApplyableOutput) TargetDownstream(targetedDeps, untargetedDeps *dag.Set) bool { + // If any of the direct dependencies of an output are targeted then + // the output must always be targeted as well, so its value will always + // be up-to-date at the completion of an apply walk. + return true +} + // GraphNodeReferenceable func (n *NodeApplyableOutput) ReferenceableName() []string { name := fmt.Sprintf("output.%s", n.Config.Name) diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go b/vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go index e4577e9..50bb707 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go +++ b/vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go @@ -102,7 +102,7 @@ func (n *NodeAbstractResource) References() []string { } } - return result + return uniqueStrings(result) } // If we have state, that is our next source diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go b/vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go index 3a44926..cd4fe92 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go +++ b/vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go @@ -4,24 +4,98 @@ import ( "fmt" "github.com/hashicorp/terraform/config" + "github.com/hashicorp/terraform/dag" ) -// NodeRefreshableResource represents a resource that is "applyable": +// NodeRefreshableManagedResource represents a resource that is expanabled into +// NodeRefreshableManagedResourceInstance. Resource count orphans are also added. +type NodeRefreshableManagedResource struct { + *NodeAbstractCountResource +} + +// GraphNodeDynamicExpandable +func (n *NodeRefreshableManagedResource) DynamicExpand(ctx EvalContext) (*Graph, error) { + // Grab the state which we read + state, lock := ctx.State() + lock.RLock() + defer lock.RUnlock() + + // Expand the resource count which must be available by now from EvalTree + count, err := n.Config.Count() + if err != nil { + return nil, err + } + + // The concrete resource factory we'll use + concreteResource := func(a *NodeAbstractResource) dag.Vertex { + // Add the config and state since we don't do that via transforms + a.Config = n.Config + + return &NodeRefreshableManagedResourceInstance{ + NodeAbstractResource: a, + } + } + + // Start creating the steps + steps := []GraphTransformer{ + // Expand the count. + &ResourceCountTransformer{ + Concrete: concreteResource, + Count: count, + Addr: n.ResourceAddr(), + }, + + // Add the count orphans to make sure these resources are accounted for + // during a scale in. + &OrphanResourceCountTransformer{ + Concrete: concreteResource, + Count: count, + Addr: n.ResourceAddr(), + State: state, + }, + + // Attach the state + &AttachStateTransformer{State: state}, + + // Targeting + &TargetsTransformer{ParsedTargets: n.Targets}, + + // Connect references so ordering is correct + &ReferenceTransformer{}, + + // Make sure there is a single root + &RootTransformer{}, + } + + // Build the graph + b := &BasicGraphBuilder{ + Steps: steps, + Validate: true, + Name: "NodeRefreshableManagedResource", + } + + return b.Build(ctx.Path()) +} + +// NodeRefreshableManagedResourceInstance represents a resource that is "applyable": // it is ready to be applied and is represented by a diff. -type NodeRefreshableResource struct { +type NodeRefreshableManagedResourceInstance struct { *NodeAbstractResource } // GraphNodeDestroyer -func (n *NodeRefreshableResource) DestroyAddr() *ResourceAddress { +func (n *NodeRefreshableManagedResourceInstance) DestroyAddr() *ResourceAddress { return n.Addr } // GraphNodeEvalable -func (n *NodeRefreshableResource) EvalTree() EvalNode { +func (n *NodeRefreshableManagedResourceInstance) EvalTree() EvalNode { // Eval info is different depending on what kind of resource this is switch mode := n.Addr.Mode; mode { case config.ManagedResourceMode: + if n.ResourceState == nil { + return n.evalTreeManagedResourceNoState() + } return n.evalTreeManagedResource() case config.DataResourceMode: @@ -44,7 +118,7 @@ func (n *NodeRefreshableResource) EvalTree() EvalNode { } } -func (n *NodeRefreshableResource) evalTreeManagedResource() EvalNode { +func (n *NodeRefreshableManagedResourceInstance) evalTreeManagedResource() EvalNode { addr := n.NodeAbstractResource.Addr // stateId is the ID to put into the state @@ -98,3 +172,88 @@ func (n *NodeRefreshableResource) evalTreeManagedResource() EvalNode { }, } } + +// evalTreeManagedResourceNoState produces an EvalSequence for refresh resource +// nodes that don't have state attached. An example of where this functionality +// is useful is when a resource that already exists in state is being scaled +// out, ie: has its resource count increased. In this case, the scaled out node +// needs to be available to other nodes (namely data sources) that may depend +// on it for proper interpolation, or confusing "index out of range" errors can +// occur. +// +// The steps in this sequence are very similar to the steps carried out in +// plan, but nothing is done with the diff after it is created - it is dropped, +// and its changes are not counted in the UI. +func (n *NodeRefreshableManagedResourceInstance) evalTreeManagedResourceNoState() EvalNode { + // Declare a bunch of variables that are used for state during + // evaluation. Most of this are written to by-address below. + var provider ResourceProvider + var state *InstanceState + var resourceConfig *ResourceConfig + + addr := n.NodeAbstractResource.Addr + stateID := addr.stateId() + info := &InstanceInfo{ + Id: stateID, + Type: addr.Type, + ModulePath: normalizeModulePath(addr.Path), + } + + // Build the resource for eval + resource := &Resource{ + Name: addr.Name, + Type: addr.Type, + CountIndex: addr.Index, + } + if resource.CountIndex < 0 { + resource.CountIndex = 0 + } + + // Determine the dependencies for the state. + stateDeps := n.StateReferences() + + return &EvalSequence{ + Nodes: []EvalNode{ + &EvalInterpolate{ + Config: n.Config.RawConfig.Copy(), + Resource: resource, + Output: &resourceConfig, + }, + &EvalGetProvider{ + Name: n.ProvidedBy()[0], + Output: &provider, + }, + // Re-run validation to catch any errors we missed, e.g. type + // mismatches on computed values. + &EvalValidateResource{ + Provider: &provider, + Config: &resourceConfig, + ResourceName: n.Config.Name, + ResourceType: n.Config.Type, + ResourceMode: n.Config.Mode, + IgnoreWarnings: true, + }, + &EvalReadState{ + Name: stateID, + Output: &state, + }, + &EvalDiff{ + Name: stateID, + Info: info, + Config: &resourceConfig, + Resource: n.Config, + Provider: &provider, + State: &state, + OutputState: &state, + Stub: true, + }, + &EvalWriteState{ + Name: stateID, + ResourceType: n.Config.Type, + Provider: n.Config.Provider, + Dependencies: stateDeps, + State: &state, + }, + }, + } +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_resource_validate.go b/vendor/github.com/hashicorp/terraform/terraform/node_resource_validate.go index e01518d..f528f24 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/node_resource_validate.go +++ b/vendor/github.com/hashicorp/terraform/terraform/node_resource_validate.go @@ -129,17 +129,29 @@ func (n *NodeValidatableResourceInstance) EvalTree() EvalNode { // Validate all the provisioners for _, p := range n.Config.Provisioners { var provisioner ResourceProvisioner - seq.Nodes = append(seq.Nodes, &EvalGetProvisioner{ - Name: p.Type, - Output: &provisioner, - }, &EvalInterpolate{ - Config: p.RawConfig.Copy(), - Resource: resource, - Output: &config, - }, &EvalValidateProvisioner{ - Provisioner: &provisioner, - Config: &config, - }) + var connConfig *ResourceConfig + seq.Nodes = append( + seq.Nodes, + &EvalGetProvisioner{ + Name: p.Type, + Output: &provisioner, + }, + &EvalInterpolate{ + Config: p.RawConfig.Copy(), + Resource: resource, + Output: &config, + }, + &EvalInterpolate{ + Config: p.ConnInfo.Copy(), + Resource: resource, + Output: &connConfig, + }, + &EvalValidateProvisioner{ + Provisioner: &provisioner, + Config: &config, + ConnConfig: &connConfig, + }, + ) } return seq diff --git a/vendor/github.com/hashicorp/terraform/terraform/plan.go b/vendor/github.com/hashicorp/terraform/terraform/plan.go index ea08845..7b9ae1b 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/plan.go +++ b/vendor/github.com/hashicorp/terraform/terraform/plan.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "io" + "log" "sync" "github.com/hashicorp/terraform/config/module" @@ -25,12 +26,48 @@ func init() { // necessary to make a change: the state, diff, config, backend config, etc. // This is so that it can run alone without any other data. type Plan struct { - Diff *Diff - Module *module.Tree - State *State - Vars map[string]interface{} + // Diff describes the resource actions that must be taken when this + // plan is applied. + Diff *Diff + + // Module represents the entire configuration that was present when this + // plan was created. + Module *module.Tree + + // State is the Terraform state that was current when this plan was + // created. + // + // It is not allowed to apply a plan that has a stale state, since its + // diff could be outdated. + State *State + + // Vars retains the variables that were set when creating the plan, so + // that the same variables can be applied during apply. + Vars map[string]interface{} + + // Targets, if non-empty, contains a set of resource address strings that + // identify graph nodes that were selected as targets for plan. + // + // When targets are set, any graph node that is not directly targeted or + // indirectly targeted via dependencies is excluded from the graph. Targets []string + // TerraformVersion is the version of Terraform that was used to create + // this plan. + // + // It is not allowed to apply a plan created with a different version of + // Terraform, since the other fields of this structure may be interpreted + // in different ways between versions. + TerraformVersion string + + // ProviderSHA256s is a map giving the SHA256 hashes of the exact binaries + // used as plugins for each provider during plan. + // + // These must match between plan and apply to ensure that the diff is + // correctly interpreted, since different provider versions may have + // different attributes or attribute value constraints. + ProviderSHA256s map[string][]byte + // Backend is the backend that this plan should use and store data with. Backend *BackendState @@ -40,19 +77,58 @@ type Plan struct { // Context returns a Context with the data encapsulated in this plan. // // The following fields in opts are overridden by the plan: Config, -// Diff, State, Variables. +// Diff, Variables. +// +// If State is not provided, it is set from the plan. If it _is_ provided, +// it must be Equal to the state stored in plan, but may have a newer +// serial. func (p *Plan) Context(opts *ContextOpts) (*Context, error) { + var err error + opts, err = p.contextOpts(opts) + if err != nil { + return nil, err + } + return NewContext(opts) +} + +// contextOpts mutates the given base ContextOpts in place to use input +// objects obtained from the receiving plan. +func (p *Plan) contextOpts(base *ContextOpts) (*ContextOpts, error) { + opts := base + opts.Diff = p.Diff opts.Module = p.Module - opts.State = p.State opts.Targets = p.Targets + opts.ProviderSHA256s = p.ProviderSHA256s + + if opts.State == nil { + opts.State = p.State + } else if !opts.State.Equal(p.State) { + // Even if we're overriding the state, it should be logically equal + // to what's in plan. The only valid change to have made by the time + // we get here is to have incremented the serial. + // + // Due to the fact that serialization may change the representation of + // the state, there is little chance that these aren't actually equal. + // Log the error condition for reference, but continue with the state + // we have. + log.Println("[WARNING] Plan state and ContextOpts state are not equal") + } + + thisVersion := VersionString() + if p.TerraformVersion != "" && p.TerraformVersion != thisVersion { + return nil, fmt.Errorf( + "plan was created with a different version of Terraform (created with %s, but running %s)", + p.TerraformVersion, thisVersion, + ) + } opts.Variables = make(map[string]interface{}) for k, v := range p.Vars { opts.Variables[k] = v } - return NewContext(opts) + return opts, nil } func (p *Plan) String() string { @@ -86,7 +162,7 @@ func (p *Plan) init() { // the ability in the future to change the file format if we want for any // reason. const planFormatMagic = "tfplan" -const planFormatVersion byte = 1 +const planFormatVersion byte = 2 // ReadPlan reads a plan structure out of a reader in the format that // was written by WritePlan. diff --git a/vendor/github.com/hashicorp/terraform/terraform/resource.go b/vendor/github.com/hashicorp/terraform/terraform/resource.go index 0acf0be..a8cd8dd 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/resource.go +++ b/vendor/github.com/hashicorp/terraform/terraform/resource.go @@ -88,6 +88,46 @@ func (i *InstanceInfo) HumanId() string { i.Id) } +// ResourceAddress returns the address of the resource that the receiver is describing. +func (i *InstanceInfo) ResourceAddress() *ResourceAddress { + // GROSS: for tainted and deposed instances, their status gets appended + // to i.Id to create a unique id for the graph node. Historically these + // ids were displayed to the user, so it's designed to be human-readable: + // "aws_instance.bar.0 (deposed #0)" + // + // So here we detect such suffixes and try to interpret them back to + // their original meaning so we can then produce a ResourceAddress + // with a suitable InstanceType. + id := i.Id + instanceType := TypeInvalid + if idx := strings.Index(id, " ("); idx != -1 { + remain := id[idx:] + id = id[:idx] + + switch { + case strings.Contains(remain, "tainted"): + instanceType = TypeTainted + case strings.Contains(remain, "deposed"): + instanceType = TypeDeposed + } + } + + addr, err := parseResourceAddressInternal(id) + if err != nil { + // should never happen, since that would indicate a bug in the + // code that constructed this InstanceInfo. + panic(fmt.Errorf("InstanceInfo has invalid Id %s", id)) + } + if len(i.ModulePath) > 1 { + addr.Path = i.ModulePath[1:] // trim off "root" prefix, which is implied + } + if instanceType != TypeInvalid { + addr.InstanceTypeSet = true + addr.InstanceType = instanceType + } + return addr +} + func (i *InstanceInfo) uniqueId() string { prefix := i.HumanId() if v := i.uniqueExtra; v != "" { diff --git a/vendor/github.com/hashicorp/terraform/terraform/resource_address.go b/vendor/github.com/hashicorp/terraform/terraform/resource_address.go index a8a0c95..3537258 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/resource_address.go +++ b/vendor/github.com/hashicorp/terraform/terraform/resource_address.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/hashicorp/terraform/config" + "github.com/hashicorp/terraform/config/module" ) // ResourceAddress is a way of identifying an individual resource (or, @@ -89,6 +90,51 @@ func (r *ResourceAddress) String() string { return strings.Join(result, ".") } +// HasResourceSpec returns true if the address has a resource spec, as +// defined in the documentation: +// https://www.terraform.io/docs/internals/resource-addressing.html +// In particular, this returns false if the address contains only +// a module path, thus addressing the entire module. +func (r *ResourceAddress) HasResourceSpec() bool { + return r.Type != "" && r.Name != "" +} + +// WholeModuleAddress returns the resource address that refers to all +// resources in the same module as the receiver address. +func (r *ResourceAddress) WholeModuleAddress() *ResourceAddress { + return &ResourceAddress{ + Path: r.Path, + Index: -1, + InstanceTypeSet: false, + } +} + +// MatchesConfig returns true if the receiver matches the given +// configuration resource within the given configuration module. +// +// Since resource configuration blocks represent all of the instances of +// a multi-instance resource, the index of the address (if any) is not +// considered. +func (r *ResourceAddress) MatchesConfig(mod *module.Tree, rc *config.Resource) bool { + if r.HasResourceSpec() { + if r.Mode != rc.Mode || r.Type != rc.Type || r.Name != rc.Name { + return false + } + } + + addrPath := r.Path + cfgPath := mod.Path() + + // normalize + if len(addrPath) == 0 { + addrPath = nil + } + if len(cfgPath) == 0 { + cfgPath = nil + } + return reflect.DeepEqual(addrPath, cfgPath) +} + // stateId returns the ID that this resource should be entered with // in the state. This is also used for diffs. In the future, we'd like to // move away from this string field so I don't export this. @@ -185,7 +231,10 @@ func ParseResourceAddress(s string) (*ResourceAddress, error) { // not allowed to say "data." without a type following if mode == config.DataResourceMode && matches["type"] == "" { - return nil, fmt.Errorf("must target specific data instance") + return nil, fmt.Errorf( + "invalid resource address %q: must target specific data instance", + s, + ) } return &ResourceAddress{ @@ -199,6 +248,75 @@ func ParseResourceAddress(s string) (*ResourceAddress, error) { }, nil } +// ParseResourceAddressForInstanceDiff creates a ResourceAddress for a +// resource name as described in a module diff. +// +// For historical reasons a different addressing format is used in this +// context. The internal format should not be shown in the UI and instead +// this function should be used to translate to a ResourceAddress and +// then, where appropriate, use the String method to produce a canonical +// resource address string for display in the UI. +// +// The given path slice must be empty (or nil) for the root module, and +// otherwise consist of a sequence of module names traversing down into +// the module tree. If a non-nil path is provided, the caller must not +// modify its underlying array after passing it to this function. +func ParseResourceAddressForInstanceDiff(path []string, key string) (*ResourceAddress, error) { + addr, err := parseResourceAddressInternal(key) + if err != nil { + return nil, err + } + addr.Path = path + return addr, nil +} + +// Contains returns true if and only if the given node is contained within +// the receiver. +// +// Containment is defined in terms of the module and resource heirarchy: +// a resource is contained within its module and any ancestor modules, +// an indexed resource instance is contained with the unindexed resource, etc. +func (addr *ResourceAddress) Contains(other *ResourceAddress) bool { + ourPath := addr.Path + givenPath := other.Path + if len(givenPath) < len(ourPath) { + return false + } + for i := range ourPath { + if ourPath[i] != givenPath[i] { + return false + } + } + + // If the receiver is a whole-module address then the path prefix + // matching is all we need. + if !addr.HasResourceSpec() { + return true + } + + if addr.Type != other.Type || addr.Name != other.Name || addr.Mode != other.Mode { + return false + } + + if addr.Index != -1 && addr.Index != other.Index { + return false + } + + if addr.InstanceTypeSet && (addr.InstanceTypeSet != other.InstanceTypeSet || addr.InstanceType != other.InstanceType) { + return false + } + + return true +} + +// Equals returns true if the receiver matches the given address. +// +// The name of this method is a misnomer, since it doesn't test for exact +// equality. Instead, it tests that the _specified_ parts of each +// address match, treating any unspecified parts as wildcards. +// +// See also Contains, which takes a more heirarchical approach to comparing +// addresses. func (addr *ResourceAddress) Equals(raw interface{}) bool { other, ok := raw.(*ResourceAddress) if !ok { @@ -233,6 +351,59 @@ func (addr *ResourceAddress) Equals(raw interface{}) bool { modeMatch } +// Less returns true if and only if the receiver should be sorted before +// the given address when presenting a list of resource addresses to +// an end-user. +// +// This sort uses lexicographic sorting for most components, but uses +// numeric sort for indices, thus causing index 10 to sort after +// index 9, rather than after index 1. +func (addr *ResourceAddress) Less(other *ResourceAddress) bool { + + switch { + + case len(addr.Path) != len(other.Path): + return len(addr.Path) < len(other.Path) + + case !reflect.DeepEqual(addr.Path, other.Path): + // If the two paths are the same length but don't match, we'll just + // cheat and compare the string forms since it's easier than + // comparing all of the path segments in turn, and lexicographic + // comparison is correct for the module path portion. + addrStr := addr.String() + otherStr := other.String() + return addrStr < otherStr + + case addr.Mode != other.Mode: + return addr.Mode == config.DataResourceMode + + case addr.Type != other.Type: + return addr.Type < other.Type + + case addr.Name != other.Name: + return addr.Name < other.Name + + case addr.Index != other.Index: + // Since "Index" is -1 for an un-indexed address, this also conveniently + // sorts unindexed addresses before indexed ones, should they both + // appear for some reason. + return addr.Index < other.Index + + case addr.InstanceTypeSet != other.InstanceTypeSet: + return !addr.InstanceTypeSet + + case addr.InstanceType != other.InstanceType: + // InstanceType is actually an enum, so this is just an arbitrary + // sort based on the enum numeric values, and thus not particularly + // meaningful. + return addr.InstanceType < other.InstanceType + + default: + return false + + } +} + func ParseResourceIndex(s string) (int, error) { if s == "" { return -1, nil @@ -275,7 +446,7 @@ func tokenizeResourceAddress(s string) (map[string]string, error) { // string "aws_instance.web.tainted[1]" re := regexp.MustCompile(`\A` + // "module.foo.module.bar" (optional) - `(?P(?:module\.[^.]+\.?)*)` + + `(?P(?:module\.(?P[^.]+)\.?)*)` + // possibly "data.", if targeting is a data resource `(?P(?:data\.)?)` + // "aws_instance.web" (optional when module path specified) @@ -289,7 +460,7 @@ func tokenizeResourceAddress(s string) (map[string]string, error) { groupNames := re.SubexpNames() rawMatches := re.FindAllStringSubmatch(s, -1) if len(rawMatches) != 1 { - return nil, fmt.Errorf("Problem parsing address: %q", s) + return nil, fmt.Errorf("invalid resource address %q", s) } matches := make(map[string]string) diff --git a/vendor/github.com/hashicorp/terraform/terraform/resource_provider.go b/vendor/github.com/hashicorp/terraform/terraform/resource_provider.go index 1a68c86..7d78f67 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/resource_provider.go +++ b/vendor/github.com/hashicorp/terraform/terraform/resource_provider.go @@ -1,5 +1,12 @@ package terraform +import ( + "fmt" + + multierror "github.com/hashicorp/go-multierror" + "github.com/hashicorp/terraform/plugin/discovery" +) + // ResourceProvider is an interface that must be implemented by any // resource provider: the thing that creates and manages the resources in // a Terraform configuration. @@ -154,6 +161,18 @@ type ResourceProvider interface { ReadDataApply(*InstanceInfo, *InstanceDiff) (*InstanceState, error) } +// ResourceProviderError may be returned when creating a Context if the +// required providers cannot be satisfied. This error can then be used to +// format a more useful message for the user. +type ResourceProviderError struct { + Errors []error +} + +func (e *ResourceProviderError) Error() string { + // use multierror to format the default output + return multierror.Append(nil, e.Errors...).Error() +} + // ResourceProviderCloser is an interface that providers that can close // connections that aren't needed anymore must implement. type ResourceProviderCloser interface { @@ -171,6 +190,50 @@ type DataSource struct { Name string } +// ResourceProviderResolver is an interface implemented by objects that are +// able to resolve a given set of resource provider version constraints +// into ResourceProviderFactory callbacks. +type ResourceProviderResolver interface { + // Given a constraint map, return a ResourceProviderFactory for each + // requested provider. If some or all of the constraints cannot be + // satisfied, return a non-nil slice of errors describing the problems. + ResolveProviders(reqd discovery.PluginRequirements) (map[string]ResourceProviderFactory, []error) +} + +// ResourceProviderResolverFunc wraps a callback function and turns it into +// a ResourceProviderResolver implementation, for convenience in situations +// where a function and its associated closure are sufficient as a resolver +// implementation. +type ResourceProviderResolverFunc func(reqd discovery.PluginRequirements) (map[string]ResourceProviderFactory, []error) + +// ResolveProviders implements ResourceProviderResolver by calling the +// wrapped function. +func (f ResourceProviderResolverFunc) ResolveProviders(reqd discovery.PluginRequirements) (map[string]ResourceProviderFactory, []error) { + return f(reqd) +} + +// ResourceProviderResolverFixed returns a ResourceProviderResolver that +// has a fixed set of provider factories provided by the caller. The returned +// resolver ignores version constraints entirely and just returns the given +// factory for each requested provider name. +// +// This function is primarily used in tests, to provide mock providers or +// in-process providers under test. +func ResourceProviderResolverFixed(factories map[string]ResourceProviderFactory) ResourceProviderResolver { + return ResourceProviderResolverFunc(func(reqd discovery.PluginRequirements) (map[string]ResourceProviderFactory, []error) { + ret := make(map[string]ResourceProviderFactory, len(reqd)) + var errs []error + for name := range reqd { + if factory, exists := factories[name]; exists { + ret[name] = factory + } else { + errs = append(errs, fmt.Errorf("provider %q is not available", name)) + } + } + return ret, errs + }) +} + // ResourceProviderFactory is a function type that creates a new instance // of a resource provider. type ResourceProviderFactory func() (ResourceProvider, error) @@ -202,3 +265,21 @@ func ProviderHasDataSource(p ResourceProvider, n string) bool { return false } + +// resourceProviderFactories matches available plugins to the given version +// requirements to produce a map of compatible provider plugins if possible, +// or an error if the currently-available plugins are insufficient. +// +// This should be called only with configurations that have passed calls +// to config.Validate(), which ensures that all of the given version +// constraints are valid. It will panic if any invalid constraints are present. +func resourceProviderFactories(resolver ResourceProviderResolver, reqd discovery.PluginRequirements) (map[string]ResourceProviderFactory, error) { + ret, errs := resolver.ResolveProviders(reqd) + if errs != nil { + return nil, &ResourceProviderError{ + Errors: errs, + } + } + + return ret, nil +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/resource_provider_mock.go b/vendor/github.com/hashicorp/terraform/terraform/resource_provider_mock.go index f531533..95f8c56 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/resource_provider_mock.go +++ b/vendor/github.com/hashicorp/terraform/terraform/resource_provider_mock.go @@ -94,6 +94,8 @@ func (p *MockResourceProvider) Close() error { func (p *MockResourceProvider) Input( input UIInput, c *ResourceConfig) (*ResourceConfig, error) { + p.Lock() + defer p.Unlock() p.InputCalled = true p.InputInput = input p.InputConfig = c diff --git a/vendor/github.com/hashicorp/terraform/terraform/shadow.go b/vendor/github.com/hashicorp/terraform/terraform/shadow.go deleted file mode 100644 index 4632559..0000000 --- a/vendor/github.com/hashicorp/terraform/terraform/shadow.go +++ /dev/null @@ -1,28 +0,0 @@ -package terraform - -// Shadow is the interface that any "shadow" structures must implement. -// -// A shadow structure is an interface implementation (typically) that -// shadows a real implementation and verifies that the same behavior occurs -// on both. The semantics of this behavior are up to the interface itself. -// -// A shadow NEVER modifies real values or state. It must always be safe to use. -// -// For example, a ResourceProvider shadow ensures that the same operations -// are done on the same resources with the same configurations. -// -// The typical usage of a shadow following this interface is to complete -// the real operations, then call CloseShadow which tells the shadow that -// the real side is done. Then, once the shadow is also complete, call -// ShadowError to find any errors that may have been caught. -type Shadow interface { - // CloseShadow tells the shadow that the REAL implementation is - // complete. Therefore, any calls that would block should now return - // immediately since no more changes will happen to the real side. - CloseShadow() error - - // ShadowError returns the errors that the shadow has found. - // This should be called AFTER CloseShadow and AFTER the shadow is - // known to be complete (no more calls to it). - ShadowError() error -} diff --git a/vendor/github.com/hashicorp/terraform/terraform/shadow_components.go b/vendor/github.com/hashicorp/terraform/terraform/shadow_components.go deleted file mode 100644 index 116cf84..0000000 --- a/vendor/github.com/hashicorp/terraform/terraform/shadow_components.go +++ /dev/null @@ -1,273 +0,0 @@ -package terraform - -import ( - "fmt" - "sync" - - "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/shadow" -) - -// newShadowComponentFactory creates a shadowed contextComponentFactory -// so that requests to create new components result in both a real and -// shadow side. -func newShadowComponentFactory( - f contextComponentFactory) (contextComponentFactory, *shadowComponentFactory) { - // Create the shared data - shared := &shadowComponentFactoryShared{contextComponentFactory: f} - - // Create the real side - real := &shadowComponentFactory{ - shadowComponentFactoryShared: shared, - } - - // Create the shadow - shadow := &shadowComponentFactory{ - shadowComponentFactoryShared: shared, - Shadow: true, - } - - return real, shadow -} - -// shadowComponentFactory is the shadow side. Any components created -// with this factory are fake and will not cause real work to happen. -// -// Unlike other shadowers, the shadow component factory will allow the -// shadow to create _any_ component even if it is never requested on the -// real side. This is because errors will happen later downstream as function -// calls are made to the shadows that are never matched on the real side. -type shadowComponentFactory struct { - *shadowComponentFactoryShared - - Shadow bool // True if this should return the shadow - lock sync.Mutex -} - -func (f *shadowComponentFactory) ResourceProvider( - n, uid string) (ResourceProvider, error) { - f.lock.Lock() - defer f.lock.Unlock() - - real, shadow, err := f.shadowComponentFactoryShared.ResourceProvider(n, uid) - var result ResourceProvider = real - if f.Shadow { - result = shadow - } - - return result, err -} - -func (f *shadowComponentFactory) ResourceProvisioner( - n, uid string) (ResourceProvisioner, error) { - f.lock.Lock() - defer f.lock.Unlock() - - real, shadow, err := f.shadowComponentFactoryShared.ResourceProvisioner(n, uid) - var result ResourceProvisioner = real - if f.Shadow { - result = shadow - } - - return result, err -} - -// CloseShadow is called when the _real_ side is complete. This will cause -// all future blocking operations to return immediately on the shadow to -// ensure the shadow also completes. -func (f *shadowComponentFactory) CloseShadow() error { - // If we aren't the shadow, just return - if !f.Shadow { - return nil - } - - // Lock ourselves so we don't modify state - f.lock.Lock() - defer f.lock.Unlock() - - // Grab our shared state - shared := f.shadowComponentFactoryShared - - // If we're already closed, its an error - if shared.closed { - return fmt.Errorf("component factory shadow already closed") - } - - // Close all the providers and provisioners and return the error - var result error - for _, n := range shared.providerKeys { - _, shadow, err := shared.ResourceProvider(n, n) - if err == nil && shadow != nil { - if err := shadow.CloseShadow(); err != nil { - result = multierror.Append(result, err) - } - } - } - - for _, n := range shared.provisionerKeys { - _, shadow, err := shared.ResourceProvisioner(n, n) - if err == nil && shadow != nil { - if err := shadow.CloseShadow(); err != nil { - result = multierror.Append(result, err) - } - } - } - - // Mark ourselves as closed - shared.closed = true - - return result -} - -func (f *shadowComponentFactory) ShadowError() error { - // If we aren't the shadow, just return - if !f.Shadow { - return nil - } - - // Lock ourselves so we don't modify state - f.lock.Lock() - defer f.lock.Unlock() - - // Grab our shared state - shared := f.shadowComponentFactoryShared - - // If we're not closed, its an error - if !shared.closed { - return fmt.Errorf("component factory must be closed to retrieve errors") - } - - // Close all the providers and provisioners and return the error - var result error - for _, n := range shared.providerKeys { - _, shadow, err := shared.ResourceProvider(n, n) - if err == nil && shadow != nil { - if err := shadow.ShadowError(); err != nil { - result = multierror.Append(result, err) - } - } - } - - for _, n := range shared.provisionerKeys { - _, shadow, err := shared.ResourceProvisioner(n, n) - if err == nil && shadow != nil { - if err := shadow.ShadowError(); err != nil { - result = multierror.Append(result, err) - } - } - } - - return result -} - -// shadowComponentFactoryShared is shared data between the two factories. -// -// It is NOT SAFE to run any function on this struct in parallel. Lock -// access to this struct. -type shadowComponentFactoryShared struct { - contextComponentFactory - - closed bool - providers shadow.KeyedValue - providerKeys []string - provisioners shadow.KeyedValue - provisionerKeys []string -} - -// shadowResourceProviderFactoryEntry is the entry that is stored in -// the Shadows key/value for a provider. -type shadowComponentFactoryProviderEntry struct { - Real ResourceProvider - Shadow shadowResourceProvider - Err error -} - -type shadowComponentFactoryProvisionerEntry struct { - Real ResourceProvisioner - Shadow shadowResourceProvisioner - Err error -} - -func (f *shadowComponentFactoryShared) ResourceProvider( - n, uid string) (ResourceProvider, shadowResourceProvider, error) { - // Determine if we already have a value - raw, ok := f.providers.ValueOk(uid) - if !ok { - // Build the entry - var entry shadowComponentFactoryProviderEntry - - // No value, initialize. Create the original - p, err := f.contextComponentFactory.ResourceProvider(n, uid) - if err != nil { - entry.Err = err - p = nil // Just to be sure - } - - if p != nil { - // Create the shadow - real, shadow := newShadowResourceProvider(p) - entry.Real = real - entry.Shadow = shadow - - if f.closed { - shadow.CloseShadow() - } - } - - // Store the value - f.providers.SetValue(uid, &entry) - f.providerKeys = append(f.providerKeys, uid) - raw = &entry - } - - // Read the entry - entry, ok := raw.(*shadowComponentFactoryProviderEntry) - if !ok { - return nil, nil, fmt.Errorf("Unknown value for shadow provider: %#v", raw) - } - - // Return - return entry.Real, entry.Shadow, entry.Err -} - -func (f *shadowComponentFactoryShared) ResourceProvisioner( - n, uid string) (ResourceProvisioner, shadowResourceProvisioner, error) { - // Determine if we already have a value - raw, ok := f.provisioners.ValueOk(uid) - if !ok { - // Build the entry - var entry shadowComponentFactoryProvisionerEntry - - // No value, initialize. Create the original - p, err := f.contextComponentFactory.ResourceProvisioner(n, uid) - if err != nil { - entry.Err = err - p = nil // Just to be sure - } - - if p != nil { - // For now, just create a mock since we don't support provisioners yet - real, shadow := newShadowResourceProvisioner(p) - entry.Real = real - entry.Shadow = shadow - - if f.closed { - shadow.CloseShadow() - } - } - - // Store the value - f.provisioners.SetValue(uid, &entry) - f.provisionerKeys = append(f.provisionerKeys, uid) - raw = &entry - } - - // Read the entry - entry, ok := raw.(*shadowComponentFactoryProvisionerEntry) - if !ok { - return nil, nil, fmt.Errorf("Unknown value for shadow provisioner: %#v", raw) - } - - // Return - return entry.Real, entry.Shadow, entry.Err -} diff --git a/vendor/github.com/hashicorp/terraform/terraform/shadow_context.go b/vendor/github.com/hashicorp/terraform/terraform/shadow_context.go deleted file mode 100644 index 5588af2..0000000 --- a/vendor/github.com/hashicorp/terraform/terraform/shadow_context.go +++ /dev/null @@ -1,158 +0,0 @@ -package terraform - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-multierror" - "github.com/mitchellh/copystructure" -) - -// newShadowContext creates a new context that will shadow the given context -// when walking the graph. The resulting context should be used _only once_ -// for a graph walk. -// -// The returned Shadow should be closed after the graph walk with the -// real context is complete. Errors from the shadow can be retrieved there. -// -// Most importantly, any operations done on the shadow context (the returned -// context) will NEVER affect the real context. All structures are deep -// copied, no real providers or resources are used, etc. -func newShadowContext(c *Context) (*Context, *Context, Shadow) { - // Copy the targets - targetRaw, err := copystructure.Copy(c.targets) - if err != nil { - panic(err) - } - - // Copy the variables - varRaw, err := copystructure.Copy(c.variables) - if err != nil { - panic(err) - } - - // Copy the provider inputs - providerInputRaw, err := copystructure.Copy(c.providerInputConfig) - if err != nil { - panic(err) - } - - // The factories - componentsReal, componentsShadow := newShadowComponentFactory(c.components) - - // Create the shadow - shadow := &Context{ - components: componentsShadow, - destroy: c.destroy, - diff: c.diff.DeepCopy(), - hooks: nil, - meta: c.meta, - module: c.module, - state: c.state.DeepCopy(), - targets: targetRaw.([]string), - variables: varRaw.(map[string]interface{}), - - // NOTE(mitchellh): This is not going to work for shadows that are - // testing that input results in the proper end state. At the time - // of writing, input is not used in any state-changing graph - // walks anyways, so this checks nothing. We set it to this to avoid - // any panics but even a "nil" value worked here. - uiInput: new(MockUIInput), - - // Hardcoded to 4 since parallelism in the shadow doesn't matter - // a ton since we're doing far less compared to the real side - // and our operations are MUCH faster. - parallelSem: NewSemaphore(4), - providerInputConfig: providerInputRaw.(map[string]map[string]interface{}), - } - - // Create the real context. This is effectively just a copy of - // the context given except we need to modify some of the values - // to point to the real side of a shadow so the shadow can compare values. - real := &Context{ - // The fields below are changed. - components: componentsReal, - - // The fields below are direct copies - destroy: c.destroy, - diff: c.diff, - // diffLock - no copy - hooks: c.hooks, - meta: c.meta, - module: c.module, - sh: c.sh, - state: c.state, - // stateLock - no copy - targets: c.targets, - uiInput: c.uiInput, - variables: c.variables, - - // l - no copy - parallelSem: c.parallelSem, - providerInputConfig: c.providerInputConfig, - runContext: c.runContext, - runContextCancel: c.runContextCancel, - shadowErr: c.shadowErr, - } - - return real, shadow, &shadowContextCloser{ - Components: componentsShadow, - } -} - -// shadowContextVerify takes the real and shadow context and verifies they -// have equal diffs and states. -func shadowContextVerify(real, shadow *Context) error { - var result error - - // The states compared must be pruned so they're minimal/clean - real.state.prune() - shadow.state.prune() - - // Compare the states - if !real.state.Equal(shadow.state) { - result = multierror.Append(result, fmt.Errorf( - "Real and shadow states do not match! "+ - "Real state:\n\n%s\n\n"+ - "Shadow state:\n\n%s\n\n", - real.state, shadow.state)) - } - - // Compare the diffs - if !real.diff.Equal(shadow.diff) { - result = multierror.Append(result, fmt.Errorf( - "Real and shadow diffs do not match! "+ - "Real diff:\n\n%s\n\n"+ - "Shadow diff:\n\n%s\n\n", - real.diff, shadow.diff)) - } - - return result -} - -// shadowContextCloser is the io.Closer returned by newShadowContext that -// closes all the shadows and returns the results. -type shadowContextCloser struct { - Components *shadowComponentFactory -} - -// Close closes the shadow context. -func (c *shadowContextCloser) CloseShadow() error { - return c.Components.CloseShadow() -} - -func (c *shadowContextCloser) ShadowError() error { - err := c.Components.ShadowError() - if err == nil { - return nil - } - - // This is a sad edge case: if the configuration contains uuid() at - // any point, we cannot reason aboyt the shadow execution. Tested - // with Context2Plan_shadowUuid. - if strings.Contains(err.Error(), "uuid()") { - err = nil - } - - return err -} diff --git a/vendor/github.com/hashicorp/terraform/terraform/shadow_resource_provider.go b/vendor/github.com/hashicorp/terraform/terraform/shadow_resource_provider.go deleted file mode 100644 index 9741d7e..0000000 --- a/vendor/github.com/hashicorp/terraform/terraform/shadow_resource_provider.go +++ /dev/null @@ -1,815 +0,0 @@ -package terraform - -import ( - "fmt" - "log" - "sync" - - "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/shadow" -) - -// shadowResourceProvider implements ResourceProvider for the shadow -// eval context defined in eval_context_shadow.go. -// -// This is used to verify behavior with a real provider. This shouldn't -// be used directly. -type shadowResourceProvider interface { - ResourceProvider - Shadow -} - -// newShadowResourceProvider creates a new shadowed ResourceProvider. -// -// This will assume a well behaved real ResourceProvider. For example, -// it assumes that the `Resources` call underneath doesn't change values -// since once it is called on the real provider, it will be cached and -// returned in the shadow since number of calls to that shouldn't affect -// actual behavior. -// -// However, with calls like Apply, call order is taken into account, -// parameters are checked for equality, etc. -func newShadowResourceProvider(p ResourceProvider) (ResourceProvider, shadowResourceProvider) { - // Create the shared data - shared := shadowResourceProviderShared{} - - // Create the real provider that does actual work - real := &shadowResourceProviderReal{ - ResourceProvider: p, - Shared: &shared, - } - - // Create the shadow that watches the real value - shadow := &shadowResourceProviderShadow{ - Shared: &shared, - - resources: p.Resources(), - dataSources: p.DataSources(), - } - - return real, shadow -} - -// shadowResourceProviderReal is the real resource provider. Function calls -// to this will perform real work. This records the parameters and return -// values and call order for the shadow to reproduce. -type shadowResourceProviderReal struct { - ResourceProvider - - Shared *shadowResourceProviderShared -} - -func (p *shadowResourceProviderReal) Close() error { - var result error - if c, ok := p.ResourceProvider.(ResourceProviderCloser); ok { - result = c.Close() - } - - p.Shared.CloseErr.SetValue(result) - return result -} - -func (p *shadowResourceProviderReal) Input( - input UIInput, c *ResourceConfig) (*ResourceConfig, error) { - cCopy := c.DeepCopy() - - result, err := p.ResourceProvider.Input(input, c) - p.Shared.Input.SetValue(&shadowResourceProviderInput{ - Config: cCopy, - Result: result.DeepCopy(), - ResultErr: err, - }) - - return result, err -} - -func (p *shadowResourceProviderReal) Validate(c *ResourceConfig) ([]string, []error) { - warns, errs := p.ResourceProvider.Validate(c) - p.Shared.Validate.SetValue(&shadowResourceProviderValidate{ - Config: c.DeepCopy(), - ResultWarn: warns, - ResultErr: errs, - }) - - return warns, errs -} - -func (p *shadowResourceProviderReal) Configure(c *ResourceConfig) error { - cCopy := c.DeepCopy() - - err := p.ResourceProvider.Configure(c) - p.Shared.Configure.SetValue(&shadowResourceProviderConfigure{ - Config: cCopy, - Result: err, - }) - - return err -} - -func (p *shadowResourceProviderReal) Stop() error { - return p.ResourceProvider.Stop() -} - -func (p *shadowResourceProviderReal) ValidateResource( - t string, c *ResourceConfig) ([]string, []error) { - key := t - configCopy := c.DeepCopy() - - // Real operation - warns, errs := p.ResourceProvider.ValidateResource(t, c) - - // Initialize to ensure we always have a wrapper with a lock - p.Shared.ValidateResource.Init( - key, &shadowResourceProviderValidateResourceWrapper{}) - - // Get the result - raw := p.Shared.ValidateResource.Value(key) - wrapper, ok := raw.(*shadowResourceProviderValidateResourceWrapper) - if !ok { - // If this fails then we just continue with our day... the shadow - // will fail to but there isn't much we can do. - log.Printf( - "[ERROR] unknown value in ValidateResource shadow value: %#v", raw) - return warns, errs - } - - // Lock the wrapper for writing and record our call - wrapper.Lock() - defer wrapper.Unlock() - - wrapper.Calls = append(wrapper.Calls, &shadowResourceProviderValidateResource{ - Config: configCopy, - Warns: warns, - Errors: errs, - }) - - // With it locked, call SetValue again so that it triggers WaitForChange - p.Shared.ValidateResource.SetValue(key, wrapper) - - // Return the result - return warns, errs -} - -func (p *shadowResourceProviderReal) Apply( - info *InstanceInfo, - state *InstanceState, - diff *InstanceDiff) (*InstanceState, error) { - // Thse have to be copied before the call since call can modify - stateCopy := state.DeepCopy() - diffCopy := diff.DeepCopy() - - result, err := p.ResourceProvider.Apply(info, state, diff) - p.Shared.Apply.SetValue(info.uniqueId(), &shadowResourceProviderApply{ - State: stateCopy, - Diff: diffCopy, - Result: result.DeepCopy(), - ResultErr: err, - }) - - return result, err -} - -func (p *shadowResourceProviderReal) Diff( - info *InstanceInfo, - state *InstanceState, - desired *ResourceConfig) (*InstanceDiff, error) { - // Thse have to be copied before the call since call can modify - stateCopy := state.DeepCopy() - desiredCopy := desired.DeepCopy() - - result, err := p.ResourceProvider.Diff(info, state, desired) - p.Shared.Diff.SetValue(info.uniqueId(), &shadowResourceProviderDiff{ - State: stateCopy, - Desired: desiredCopy, - Result: result.DeepCopy(), - ResultErr: err, - }) - - return result, err -} - -func (p *shadowResourceProviderReal) Refresh( - info *InstanceInfo, - state *InstanceState) (*InstanceState, error) { - // Thse have to be copied before the call since call can modify - stateCopy := state.DeepCopy() - - result, err := p.ResourceProvider.Refresh(info, state) - p.Shared.Refresh.SetValue(info.uniqueId(), &shadowResourceProviderRefresh{ - State: stateCopy, - Result: result.DeepCopy(), - ResultErr: err, - }) - - return result, err -} - -func (p *shadowResourceProviderReal) ValidateDataSource( - t string, c *ResourceConfig) ([]string, []error) { - key := t - configCopy := c.DeepCopy() - - // Real operation - warns, errs := p.ResourceProvider.ValidateDataSource(t, c) - - // Initialize - p.Shared.ValidateDataSource.Init( - key, &shadowResourceProviderValidateDataSourceWrapper{}) - - // Get the result - raw := p.Shared.ValidateDataSource.Value(key) - wrapper, ok := raw.(*shadowResourceProviderValidateDataSourceWrapper) - if !ok { - // If this fails then we just continue with our day... the shadow - // will fail to but there isn't much we can do. - log.Printf( - "[ERROR] unknown value in ValidateDataSource shadow value: %#v", raw) - return warns, errs - } - - // Lock the wrapper for writing and record our call - wrapper.Lock() - defer wrapper.Unlock() - - wrapper.Calls = append(wrapper.Calls, &shadowResourceProviderValidateDataSource{ - Config: configCopy, - Warns: warns, - Errors: errs, - }) - - // Set it - p.Shared.ValidateDataSource.SetValue(key, wrapper) - - // Return the result - return warns, errs -} - -func (p *shadowResourceProviderReal) ReadDataDiff( - info *InstanceInfo, - desired *ResourceConfig) (*InstanceDiff, error) { - // These have to be copied before the call since call can modify - desiredCopy := desired.DeepCopy() - - result, err := p.ResourceProvider.ReadDataDiff(info, desired) - p.Shared.ReadDataDiff.SetValue(info.uniqueId(), &shadowResourceProviderReadDataDiff{ - Desired: desiredCopy, - Result: result.DeepCopy(), - ResultErr: err, - }) - - return result, err -} - -func (p *shadowResourceProviderReal) ReadDataApply( - info *InstanceInfo, - diff *InstanceDiff) (*InstanceState, error) { - // Thse have to be copied before the call since call can modify - diffCopy := diff.DeepCopy() - - result, err := p.ResourceProvider.ReadDataApply(info, diff) - p.Shared.ReadDataApply.SetValue(info.uniqueId(), &shadowResourceProviderReadDataApply{ - Diff: diffCopy, - Result: result.DeepCopy(), - ResultErr: err, - }) - - return result, err -} - -// shadowResourceProviderShadow is the shadow resource provider. Function -// calls never affect real resources. This is paired with the "real" side -// which must be called properly to enable recording. -type shadowResourceProviderShadow struct { - Shared *shadowResourceProviderShared - - // Cached values that are expected to not change - resources []ResourceType - dataSources []DataSource - - Error error // Error is the list of errors from the shadow - ErrorLock sync.Mutex -} - -type shadowResourceProviderShared struct { - // NOTE: Anytime a value is added here, be sure to add it to - // the Close() method so that it is closed. - - CloseErr shadow.Value - Input shadow.Value - Validate shadow.Value - Configure shadow.Value - ValidateResource shadow.KeyedValue - Apply shadow.KeyedValue - Diff shadow.KeyedValue - Refresh shadow.KeyedValue - ValidateDataSource shadow.KeyedValue - ReadDataDiff shadow.KeyedValue - ReadDataApply shadow.KeyedValue -} - -func (p *shadowResourceProviderShared) Close() error { - return shadow.Close(p) -} - -func (p *shadowResourceProviderShadow) CloseShadow() error { - err := p.Shared.Close() - if err != nil { - err = fmt.Errorf("close error: %s", err) - } - - return err -} - -func (p *shadowResourceProviderShadow) ShadowError() error { - return p.Error -} - -func (p *shadowResourceProviderShadow) Resources() []ResourceType { - return p.resources -} - -func (p *shadowResourceProviderShadow) DataSources() []DataSource { - return p.dataSources -} - -func (p *shadowResourceProviderShadow) Close() error { - v := p.Shared.CloseErr.Value() - if v == nil { - return nil - } - - return v.(error) -} - -func (p *shadowResourceProviderShadow) Input( - input UIInput, c *ResourceConfig) (*ResourceConfig, error) { - // Get the result of the input call - raw := p.Shared.Input.Value() - if raw == nil { - return nil, nil - } - - result, ok := raw.(*shadowResourceProviderInput) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'input' shadow value: %#v", raw)) - return nil, nil - } - - // Compare the parameters, which should be identical - if !c.Equal(result.Config) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Input had unequal configurations (real, then shadow):\n\n%#v\n\n%#v", - result.Config, c)) - p.ErrorLock.Unlock() - } - - // Return the results - return result.Result, result.ResultErr -} - -func (p *shadowResourceProviderShadow) Validate(c *ResourceConfig) ([]string, []error) { - // Get the result of the validate call - raw := p.Shared.Validate.Value() - if raw == nil { - return nil, nil - } - - result, ok := raw.(*shadowResourceProviderValidate) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'validate' shadow value: %#v", raw)) - return nil, nil - } - - // Compare the parameters, which should be identical - if !c.Equal(result.Config) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Validate had unequal configurations (real, then shadow):\n\n%#v\n\n%#v", - result.Config, c)) - p.ErrorLock.Unlock() - } - - // Return the results - return result.ResultWarn, result.ResultErr -} - -func (p *shadowResourceProviderShadow) Configure(c *ResourceConfig) error { - // Get the result of the call - raw := p.Shared.Configure.Value() - if raw == nil { - return nil - } - - result, ok := raw.(*shadowResourceProviderConfigure) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'configure' shadow value: %#v", raw)) - return nil - } - - // Compare the parameters, which should be identical - if !c.Equal(result.Config) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Configure had unequal configurations (real, then shadow):\n\n%#v\n\n%#v", - result.Config, c)) - p.ErrorLock.Unlock() - } - - // Return the results - return result.Result -} - -// Stop returns immediately. -func (p *shadowResourceProviderShadow) Stop() error { - return nil -} - -func (p *shadowResourceProviderShadow) ValidateResource(t string, c *ResourceConfig) ([]string, []error) { - // Unique key - key := t - - // Get the initial value - raw := p.Shared.ValidateResource.Value(key) - - // Find a validation with our configuration - var result *shadowResourceProviderValidateResource - for { - // Get the value - if raw == nil { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ValidateResource' call for %q:\n\n%#v", - key, c)) - return nil, nil - } - - wrapper, ok := raw.(*shadowResourceProviderValidateResourceWrapper) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ValidateResource' shadow value for %q: %#v", key, raw)) - return nil, nil - } - - // Look for the matching call with our configuration - wrapper.RLock() - for _, call := range wrapper.Calls { - if call.Config.Equal(c) { - result = call - break - } - } - wrapper.RUnlock() - - // If we found a result, exit - if result != nil { - break - } - - // Wait for a change so we can get the wrapper again - raw = p.Shared.ValidateResource.WaitForChange(key) - } - - return result.Warns, result.Errors -} - -func (p *shadowResourceProviderShadow) Apply( - info *InstanceInfo, - state *InstanceState, - diff *InstanceDiff) (*InstanceState, error) { - // Unique key - key := info.uniqueId() - raw := p.Shared.Apply.Value(key) - if raw == nil { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'apply' call for %q:\n\n%#v\n\n%#v", - key, state, diff)) - return nil, nil - } - - result, ok := raw.(*shadowResourceProviderApply) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'apply' shadow value for %q: %#v", key, raw)) - return nil, nil - } - - // Compare the parameters, which should be identical - if !state.Equal(result.State) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Apply %q: state had unequal states (real, then shadow):\n\n%#v\n\n%#v", - key, result.State, state)) - p.ErrorLock.Unlock() - } - - if !diff.Equal(result.Diff) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Apply %q: unequal diffs (real, then shadow):\n\n%#v\n\n%#v", - key, result.Diff, diff)) - p.ErrorLock.Unlock() - } - - return result.Result, result.ResultErr -} - -func (p *shadowResourceProviderShadow) Diff( - info *InstanceInfo, - state *InstanceState, - desired *ResourceConfig) (*InstanceDiff, error) { - // Unique key - key := info.uniqueId() - raw := p.Shared.Diff.Value(key) - if raw == nil { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'diff' call for %q:\n\n%#v\n\n%#v", - key, state, desired)) - return nil, nil - } - - result, ok := raw.(*shadowResourceProviderDiff) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'diff' shadow value for %q: %#v", key, raw)) - return nil, nil - } - - // Compare the parameters, which should be identical - if !state.Equal(result.State) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Diff %q had unequal states (real, then shadow):\n\n%#v\n\n%#v", - key, result.State, state)) - p.ErrorLock.Unlock() - } - if !desired.Equal(result.Desired) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Diff %q had unequal states (real, then shadow):\n\n%#v\n\n%#v", - key, result.Desired, desired)) - p.ErrorLock.Unlock() - } - - return result.Result, result.ResultErr -} - -func (p *shadowResourceProviderShadow) Refresh( - info *InstanceInfo, - state *InstanceState) (*InstanceState, error) { - // Unique key - key := info.uniqueId() - raw := p.Shared.Refresh.Value(key) - if raw == nil { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'refresh' call for %q:\n\n%#v", - key, state)) - return nil, nil - } - - result, ok := raw.(*shadowResourceProviderRefresh) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'refresh' shadow value: %#v", raw)) - return nil, nil - } - - // Compare the parameters, which should be identical - if !state.Equal(result.State) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Refresh %q had unequal states (real, then shadow):\n\n%#v\n\n%#v", - key, result.State, state)) - p.ErrorLock.Unlock() - } - - return result.Result, result.ResultErr -} - -func (p *shadowResourceProviderShadow) ValidateDataSource( - t string, c *ResourceConfig) ([]string, []error) { - // Unique key - key := t - - // Get the initial value - raw := p.Shared.ValidateDataSource.Value(key) - - // Find a validation with our configuration - var result *shadowResourceProviderValidateDataSource - for { - // Get the value - if raw == nil { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ValidateDataSource' call for %q:\n\n%#v", - key, c)) - return nil, nil - } - - wrapper, ok := raw.(*shadowResourceProviderValidateDataSourceWrapper) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ValidateDataSource' shadow value: %#v", raw)) - return nil, nil - } - - // Look for the matching call with our configuration - wrapper.RLock() - for _, call := range wrapper.Calls { - if call.Config.Equal(c) { - result = call - break - } - } - wrapper.RUnlock() - - // If we found a result, exit - if result != nil { - break - } - - // Wait for a change so we can get the wrapper again - raw = p.Shared.ValidateDataSource.WaitForChange(key) - } - - return result.Warns, result.Errors -} - -func (p *shadowResourceProviderShadow) ReadDataDiff( - info *InstanceInfo, - desired *ResourceConfig) (*InstanceDiff, error) { - // Unique key - key := info.uniqueId() - raw := p.Shared.ReadDataDiff.Value(key) - if raw == nil { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ReadDataDiff' call for %q:\n\n%#v", - key, desired)) - return nil, nil - } - - result, ok := raw.(*shadowResourceProviderReadDataDiff) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ReadDataDiff' shadow value for %q: %#v", key, raw)) - return nil, nil - } - - // Compare the parameters, which should be identical - if !desired.Equal(result.Desired) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "ReadDataDiff %q had unequal configs (real, then shadow):\n\n%#v\n\n%#v", - key, result.Desired, desired)) - p.ErrorLock.Unlock() - } - - return result.Result, result.ResultErr -} - -func (p *shadowResourceProviderShadow) ReadDataApply( - info *InstanceInfo, - d *InstanceDiff) (*InstanceState, error) { - // Unique key - key := info.uniqueId() - raw := p.Shared.ReadDataApply.Value(key) - if raw == nil { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ReadDataApply' call for %q:\n\n%#v", - key, d)) - return nil, nil - } - - result, ok := raw.(*shadowResourceProviderReadDataApply) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ReadDataApply' shadow value for %q: %#v", key, raw)) - return nil, nil - } - - // Compare the parameters, which should be identical - if !d.Equal(result.Diff) { - p.ErrorLock.Lock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "ReadDataApply: unequal diffs (real, then shadow):\n\n%#v\n\n%#v", - result.Diff, d)) - p.ErrorLock.Unlock() - } - - return result.Result, result.ResultErr -} - -func (p *shadowResourceProviderShadow) ImportState(info *InstanceInfo, id string) ([]*InstanceState, error) { - panic("import not supported by shadow graph") -} - -// The structs for the various function calls are put below. These structs -// are used to carry call information across the real/shadow boundaries. - -type shadowResourceProviderInput struct { - Config *ResourceConfig - Result *ResourceConfig - ResultErr error -} - -type shadowResourceProviderValidate struct { - Config *ResourceConfig - ResultWarn []string - ResultErr []error -} - -type shadowResourceProviderConfigure struct { - Config *ResourceConfig - Result error -} - -type shadowResourceProviderValidateResourceWrapper struct { - sync.RWMutex - - Calls []*shadowResourceProviderValidateResource -} - -type shadowResourceProviderValidateResource struct { - Config *ResourceConfig - Warns []string - Errors []error -} - -type shadowResourceProviderApply struct { - State *InstanceState - Diff *InstanceDiff - Result *InstanceState - ResultErr error -} - -type shadowResourceProviderDiff struct { - State *InstanceState - Desired *ResourceConfig - Result *InstanceDiff - ResultErr error -} - -type shadowResourceProviderRefresh struct { - State *InstanceState - Result *InstanceState - ResultErr error -} - -type shadowResourceProviderValidateDataSourceWrapper struct { - sync.RWMutex - - Calls []*shadowResourceProviderValidateDataSource -} - -type shadowResourceProviderValidateDataSource struct { - Config *ResourceConfig - Warns []string - Errors []error -} - -type shadowResourceProviderReadDataDiff struct { - Desired *ResourceConfig - Result *InstanceDiff - ResultErr error -} - -type shadowResourceProviderReadDataApply struct { - Diff *InstanceDiff - Result *InstanceState - ResultErr error -} diff --git a/vendor/github.com/hashicorp/terraform/terraform/shadow_resource_provisioner.go b/vendor/github.com/hashicorp/terraform/terraform/shadow_resource_provisioner.go deleted file mode 100644 index 60a4908..0000000 --- a/vendor/github.com/hashicorp/terraform/terraform/shadow_resource_provisioner.go +++ /dev/null @@ -1,282 +0,0 @@ -package terraform - -import ( - "fmt" - "io" - "log" - "sync" - - "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/shadow" -) - -// shadowResourceProvisioner implements ResourceProvisioner for the shadow -// eval context defined in eval_context_shadow.go. -// -// This is used to verify behavior with a real provisioner. This shouldn't -// be used directly. -type shadowResourceProvisioner interface { - ResourceProvisioner - Shadow -} - -// newShadowResourceProvisioner creates a new shadowed ResourceProvisioner. -func newShadowResourceProvisioner( - p ResourceProvisioner) (ResourceProvisioner, shadowResourceProvisioner) { - // Create the shared data - shared := shadowResourceProvisionerShared{ - Validate: shadow.ComparedValue{ - Func: shadowResourceProvisionerValidateCompare, - }, - } - - // Create the real provisioner that does actual work - real := &shadowResourceProvisionerReal{ - ResourceProvisioner: p, - Shared: &shared, - } - - // Create the shadow that watches the real value - shadow := &shadowResourceProvisionerShadow{ - Shared: &shared, - } - - return real, shadow -} - -// shadowResourceProvisionerReal is the real resource provisioner. Function calls -// to this will perform real work. This records the parameters and return -// values and call order for the shadow to reproduce. -type shadowResourceProvisionerReal struct { - ResourceProvisioner - - Shared *shadowResourceProvisionerShared -} - -func (p *shadowResourceProvisionerReal) Close() error { - var result error - if c, ok := p.ResourceProvisioner.(ResourceProvisionerCloser); ok { - result = c.Close() - } - - p.Shared.CloseErr.SetValue(result) - return result -} - -func (p *shadowResourceProvisionerReal) Validate(c *ResourceConfig) ([]string, []error) { - warns, errs := p.ResourceProvisioner.Validate(c) - p.Shared.Validate.SetValue(&shadowResourceProvisionerValidate{ - Config: c, - ResultWarn: warns, - ResultErr: errs, - }) - - return warns, errs -} - -func (p *shadowResourceProvisionerReal) Apply( - output UIOutput, s *InstanceState, c *ResourceConfig) error { - err := p.ResourceProvisioner.Apply(output, s, c) - - // Write the result, grab a lock for writing. This should nver - // block long since the operations below don't block. - p.Shared.ApplyLock.Lock() - defer p.Shared.ApplyLock.Unlock() - - key := s.ID - raw, ok := p.Shared.Apply.ValueOk(key) - if !ok { - // Setup a new value - raw = &shadow.ComparedValue{ - Func: shadowResourceProvisionerApplyCompare, - } - - // Set it - p.Shared.Apply.SetValue(key, raw) - } - - compareVal, ok := raw.(*shadow.ComparedValue) - if !ok { - // Just log and return so that we don't cause the real side - // any side effects. - log.Printf("[ERROR] unknown value in 'apply': %#v", raw) - return err - } - - // Write the resulting value - compareVal.SetValue(&shadowResourceProvisionerApply{ - Config: c, - ResultErr: err, - }) - - return err -} - -func (p *shadowResourceProvisionerReal) Stop() error { - return p.ResourceProvisioner.Stop() -} - -// shadowResourceProvisionerShadow is the shadow resource provisioner. Function -// calls never affect real resources. This is paired with the "real" side -// which must be called properly to enable recording. -type shadowResourceProvisionerShadow struct { - Shared *shadowResourceProvisionerShared - - Error error // Error is the list of errors from the shadow - ErrorLock sync.Mutex -} - -type shadowResourceProvisionerShared struct { - // NOTE: Anytime a value is added here, be sure to add it to - // the Close() method so that it is closed. - - CloseErr shadow.Value - Validate shadow.ComparedValue - Apply shadow.KeyedValue - ApplyLock sync.Mutex // For writing only -} - -func (p *shadowResourceProvisionerShared) Close() error { - closers := []io.Closer{ - &p.CloseErr, - } - - for _, c := range closers { - // This should never happen, but we don't panic because a panic - // could affect the real behavior of Terraform and a shadow should - // never be able to do that. - if err := c.Close(); err != nil { - return err - } - } - - return nil -} - -func (p *shadowResourceProvisionerShadow) CloseShadow() error { - err := p.Shared.Close() - if err != nil { - err = fmt.Errorf("close error: %s", err) - } - - return err -} - -func (p *shadowResourceProvisionerShadow) ShadowError() error { - return p.Error -} - -func (p *shadowResourceProvisionerShadow) Close() error { - v := p.Shared.CloseErr.Value() - if v == nil { - return nil - } - - return v.(error) -} - -func (p *shadowResourceProvisionerShadow) Validate(c *ResourceConfig) ([]string, []error) { - // Get the result of the validate call - raw := p.Shared.Validate.Value(c) - if raw == nil { - return nil, nil - } - - result, ok := raw.(*shadowResourceProvisionerValidate) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'validate' shadow value: %#v", raw)) - return nil, nil - } - - // We don't need to compare configurations because we key on the - // configuration so just return right away. - return result.ResultWarn, result.ResultErr -} - -func (p *shadowResourceProvisionerShadow) Apply( - output UIOutput, s *InstanceState, c *ResourceConfig) error { - // Get the value based on the key - key := s.ID - raw := p.Shared.Apply.Value(key) - if raw == nil { - return nil - } - - compareVal, ok := raw.(*shadow.ComparedValue) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'apply' shadow value: %#v", raw)) - return nil - } - - // With the compared value, we compare against our config - raw = compareVal.Value(c) - if raw == nil { - return nil - } - - result, ok := raw.(*shadowResourceProvisionerApply) - if !ok { - p.ErrorLock.Lock() - defer p.ErrorLock.Unlock() - p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'apply' shadow value: %#v", raw)) - return nil - } - - return result.ResultErr -} - -func (p *shadowResourceProvisionerShadow) Stop() error { - // For the shadow, we always just return nil since a Stop indicates - // that we were interrupted and shadows are disabled during interrupts - // anyways. - return nil -} - -// The structs for the various function calls are put below. These structs -// are used to carry call information across the real/shadow boundaries. - -type shadowResourceProvisionerValidate struct { - Config *ResourceConfig - ResultWarn []string - ResultErr []error -} - -type shadowResourceProvisionerApply struct { - Config *ResourceConfig - ResultErr error -} - -func shadowResourceProvisionerValidateCompare(k, v interface{}) bool { - c, ok := k.(*ResourceConfig) - if !ok { - return false - } - - result, ok := v.(*shadowResourceProvisionerValidate) - if !ok { - return false - } - - return c.Equal(result.Config) -} - -func shadowResourceProvisionerApplyCompare(k, v interface{}) bool { - c, ok := k.(*ResourceConfig) - if !ok { - return false - } - - result, ok := v.(*shadowResourceProvisionerApply) - if !ok { - return false - } - - return c.Equal(result.Config) -} diff --git a/vendor/github.com/hashicorp/terraform/terraform/state.go b/vendor/github.com/hashicorp/terraform/terraform/state.go index 5fa74a7..2d58c2d 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/state.go +++ b/vendor/github.com/hashicorp/terraform/terraform/state.go @@ -10,7 +10,6 @@ import ( "io/ioutil" "log" "reflect" - "regexp" "sort" "strconv" "strings" @@ -534,6 +533,43 @@ func (s *State) equal(other *State) bool { return true } +// MarshalEqual is similar to Equal but provides a stronger definition of +// "equal", where two states are equal if and only if their serialized form +// is byte-for-byte identical. +// +// This is primarily useful for callers that are trying to save snapshots +// of state to persistent storage, allowing them to detect when a new +// snapshot must be taken. +// +// Note that the serial number and lineage are included in the serialized form, +// so it's the caller's responsibility to properly manage these attributes +// so that this method is only called on two states that have the same +// serial and lineage, unless detecting such differences is desired. +func (s *State) MarshalEqual(other *State) bool { + if s == nil && other == nil { + return true + } else if s == nil || other == nil { + return false + } + + recvBuf := &bytes.Buffer{} + otherBuf := &bytes.Buffer{} + + err := WriteState(s, recvBuf) + if err != nil { + // should never happen, since we're writing to a buffer + panic(err) + } + + err = WriteState(other, otherBuf) + if err != nil { + // should never happen, since we're writing to a buffer + panic(err) + } + + return bytes.Equal(recvBuf.Bytes(), otherBuf.Bytes()) +} + type StateAgeComparison int const ( @@ -585,7 +621,7 @@ func (s *State) CompareAges(other *State) (StateAgeComparison, error) { } // SameLineage returns true only if the state given in argument belongs -// to the same "lineage" of states as the reciever. +// to the same "lineage" of states as the receiver. func (s *State) SameLineage(other *State) bool { s.Lock() defer s.Unlock() @@ -604,6 +640,10 @@ func (s *State) SameLineage(other *State) bool { // DeepCopy performs a deep copy of the state structure and returns // a new structure. func (s *State) DeepCopy() *State { + if s == nil { + return nil + } + copy, err := copystructure.Config{Lock: true}.Copy(s) if err != nil { panic(err) @@ -612,30 +652,6 @@ func (s *State) DeepCopy() *State { return copy.(*State) } -// IncrementSerialMaybe increments the serial number of this state -// if it different from the other state. -func (s *State) IncrementSerialMaybe(other *State) { - if s == nil { - return - } - if other == nil { - return - } - s.Lock() - defer s.Unlock() - - if s.Serial > other.Serial { - return - } - if other.TFVersion != s.TFVersion || !s.equal(other) { - if other.Serial > s.Serial { - s.Serial = other.Serial - } - - s.Serial++ - } -} - // FromFutureTerraform checks if this state was written by a Terraform // version from the future. func (s *State) FromFutureTerraform() bool { @@ -661,6 +677,7 @@ func (s *State) init() { if s.Version == 0 { s.Version = StateVersion } + if s.moduleByPath(rootModulePath) == nil { s.addModule(rootModulePath) } @@ -801,6 +818,27 @@ func (s *BackendState) Empty() bool { return s == nil || s.Type == "" } +// Rehash returns a unique content hash for this backend's configuration +// as a uint64 value. +// The Hash stored in the backend state needs to match the config itself, but +// we need to compare the backend config after it has been combined with all +// options. +// This function must match the implementation used by config.Backend. +func (s *BackendState) Rehash() uint64 { + if s == nil { + return 0 + } + + cfg := config.Backend{ + Type: s.Type, + RawConfig: &config.RawConfig{ + Raw: s.Config, + }, + } + + return cfg.Rehash() +} + // RemoteState is used to track the information about a remote // state store that we push/pull state to. type RemoteState struct { @@ -939,6 +977,10 @@ type ModuleState struct { // always disjoint, so the path represents amodule tree Path []string `json:"path"` + // Locals are kept only transiently in-memory, because we can always + // re-compute them. + Locals map[string]interface{} `json:"-"` + // Outputs declared by the module and maintained for each module // even though only the root module technically needs to be kept. // This allows operators to inspect values at the boundaries. @@ -1142,6 +1184,8 @@ func (m *ModuleState) prune() { delete(m.Outputs, k) } } + + m.Dependencies = uniqueStrings(m.Dependencies) } func (m *ModuleState) sort() { @@ -1505,8 +1549,9 @@ func (s *ResourceState) prune() { i-- } } - s.Deposed = s.Deposed[:n] + + s.Dependencies = uniqueStrings(s.Dependencies) } func (s *ResourceState) sort() { @@ -1640,7 +1685,20 @@ func (s *InstanceState) Equal(other *InstanceState) bool { // We only do the deep check if both are non-nil. If one is nil // we treat it as equal since their lengths are both zero (check // above). - if !reflect.DeepEqual(s.Meta, other.Meta) { + // + // Since this can contain numeric values that may change types during + // serialization, let's compare the serialized values. + sMeta, err := json.Marshal(s.Meta) + if err != nil { + // marshaling primitives shouldn't ever error out + panic(err) + } + otherMeta, err := json.Marshal(other.Meta) + if err != nil { + panic(err) + } + + if !bytes.Equal(sMeta, otherMeta) { return false } } @@ -1689,32 +1747,6 @@ func (s *InstanceState) MergeDiff(d *InstanceDiff) *InstanceState { } } - // Remove any now empty array, maps or sets because a parent structure - // won't include these entries in the count value. - isCount := regexp.MustCompile(`\.[%#]$`).MatchString - var deleted []string - - for k, v := range result.Attributes { - if isCount(k) && v == "0" { - delete(result.Attributes, k) - deleted = append(deleted, k) - } - } - - for _, k := range deleted { - // Sanity check for invalid structures. - // If we removed the primary count key, there should have been no - // other keys left with this prefix. - - // this must have a "#" or "%" which we need to remove - base := k[:len(k)-1] - for k, _ := range result.Attributes { - if strings.HasPrefix(k, base) { - panic(fmt.Sprintf("empty structure %q has entry %q", base, k)) - } - } - } - return result } @@ -1936,12 +1968,12 @@ func ReadStateV2(jsonBytes []byte) (*State, error) { } } - // Sort it - state.sort() - // catch any unitialized fields in the state state.init() + // Sort it + state.sort() + return state, nil } @@ -1971,12 +2003,12 @@ func ReadStateV3(jsonBytes []byte) (*State, error) { } } - // Sort it - state.sort() - // catch any unitialized fields in the state state.init() + // Sort it + state.sort() + // Now we write the state back out to detect any changes in normaliztion. // If our state is now written out differently, bump the serial number to // prevent conflicts. @@ -1996,12 +2028,17 @@ func ReadStateV3(jsonBytes []byte) (*State, error) { // WriteState writes a state somewhere in a binary format. func WriteState(d *State, dst io.Writer) error { - // Make sure it is sorted - d.sort() + // writing a nil state is a noop. + if d == nil { + return nil + } // make sure we have no uninitialized fields d.init() + // Make sure it is sorted + d.sort() + // Ensure the version is set d.Version = StateVersion diff --git a/vendor/github.com/hashicorp/terraform/terraform/state_upgrade_v1_to_v2.go b/vendor/github.com/hashicorp/terraform/terraform/state_upgrade_v1_to_v2.go index 928cdba..aa13cce 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/state_upgrade_v1_to_v2.go +++ b/vendor/github.com/hashicorp/terraform/terraform/state_upgrade_v1_to_v2.go @@ -64,10 +64,19 @@ func (old *moduleStateV1) upgradeToV2() (*ModuleState, error) { return nil, nil } - path, err := copystructure.Copy(old.Path) + pathRaw, err := copystructure.Copy(old.Path) if err != nil { return nil, fmt.Errorf("Error upgrading ModuleState V1: %v", err) } + path, ok := pathRaw.([]string) + if !ok { + return nil, fmt.Errorf("Error upgrading ModuleState V1: path is not a list of strings") + } + if len(path) == 0 { + // We found some V1 states with a nil path. Assume root and catch + // duplicate path errors later (as part of Validate). + path = rootModulePath + } // Outputs needs upgrading to use the new structure outputs := make(map[string]*OutputState) @@ -94,7 +103,7 @@ func (old *moduleStateV1) upgradeToV2() (*ModuleState, error) { } return &ModuleState{ - Path: path.([]string), + Path: path, Outputs: outputs, Resources: resources, Dependencies: dependencies.([]string), diff --git a/vendor/github.com/hashicorp/terraform/terraform/state_upgrade_v2_to_v3.go b/vendor/github.com/hashicorp/terraform/terraform/state_upgrade_v2_to_v3.go index 1fc458d..e52d35f 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/state_upgrade_v2_to_v3.go +++ b/vendor/github.com/hashicorp/terraform/terraform/state_upgrade_v2_to_v3.go @@ -18,7 +18,7 @@ func upgradeStateV2ToV3(old *State) (*State, error) { // Ensure the copied version is v2 before attempting to upgrade if new.Version != 2 { - return nil, fmt.Errorf("Cannot appply v2->v3 state upgrade to " + + return nil, fmt.Errorf("Cannot apply v2->v3 state upgrade to " + "a state which is not version 2.") } diff --git a/vendor/github.com/hashicorp/terraform/terraform/test_failure b/vendor/github.com/hashicorp/terraform/terraform/test_failure new file mode 100644 index 0000000..5d3ad1a --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/terraform/test_failure @@ -0,0 +1,9 @@ +--- FAIL: TestContext2Plan_moduleProviderInherit (0.01s) + context_plan_test.go:552: bad: []string{"child"} +map[string]dag.Vertex{} +"module.middle.null" +map[string]dag.Vertex{} +"module.middle.module.inner.null" +map[string]dag.Vertex{} +"aws" +FAIL diff --git a/vendor/github.com/hashicorp/terraform/terraform/transform_local.go b/vendor/github.com/hashicorp/terraform/terraform/transform_local.go new file mode 100644 index 0000000..95ecfc0 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/terraform/transform_local.go @@ -0,0 +1,40 @@ +package terraform + +import ( + "github.com/hashicorp/terraform/config/module" +) + +// LocalTransformer is a GraphTransformer that adds all the local values +// from the configuration to the graph. +type LocalTransformer struct { + Module *module.Tree +} + +func (t *LocalTransformer) Transform(g *Graph) error { + return t.transformModule(g, t.Module) +} + +func (t *LocalTransformer) transformModule(g *Graph, m *module.Tree) error { + if m == nil { + // Can't have any locals if there's no config + return nil + } + + for _, local := range m.Config().Locals { + node := &NodeLocal{ + PathValue: normalizeModulePath(m.Path()), + Config: local, + } + + g.Add(node) + } + + // Also populate locals for child modules + for _, c := range m.Children() { + if err := t.transformModule(g, c); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/transform_module_variable.go b/vendor/github.com/hashicorp/terraform/terraform/transform_module_variable.go index 467950b..dbfd168 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/transform_module_variable.go +++ b/vendor/github.com/hashicorp/terraform/terraform/transform_module_variable.go @@ -17,6 +17,7 @@ type ModuleVariableTransformer struct { Module *module.Tree DisablePrune bool // True if pruning unreferenced should be disabled + Input bool // True if this is from an Input operation. } func (t *ModuleVariableTransformer) Transform(g *Graph) error { @@ -99,6 +100,7 @@ func (t *ModuleVariableTransformer) transformSingle(g *Graph, parent, m *module. Config: v, Value: value, Module: t.Module, + Input: t.Input, } if !t.DisablePrune { diff --git a/vendor/github.com/hashicorp/terraform/terraform/transform_reference.go b/vendor/github.com/hashicorp/terraform/terraform/transform_reference.go index c545235..ce55e1d 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/transform_reference.go +++ b/vendor/github.com/hashicorp/terraform/terraform/transform_reference.go @@ -296,6 +296,8 @@ func ReferenceFromInterpolatedVar(v config.InterpolatedVariable) []string { return []string{fmt.Sprintf("%s.%d/%s.N", id, idx, id)} case *config.UserVariable: return []string{fmt.Sprintf("var.%s", v.Name)} + case *config.LocalVariable: + return []string{fmt.Sprintf("local.%s", v.Name)} default: return nil } diff --git a/vendor/github.com/hashicorp/terraform/terraform/transform_targets.go b/vendor/github.com/hashicorp/terraform/terraform/transform_targets.go index 225ac4b..4f117b4 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/transform_targets.go +++ b/vendor/github.com/hashicorp/terraform/terraform/transform_targets.go @@ -15,6 +15,21 @@ type GraphNodeTargetable interface { SetTargets([]ResourceAddress) } +// GraphNodeTargetDownstream is an interface for graph nodes that need to +// be remain present under targeting if any of their dependencies are targeted. +// TargetDownstream is called with the set of vertices that are direct +// dependencies for the node, and it should return true if the node must remain +// in the graph in support of those dependencies. +// +// This is used in situations where the dependency edges are representing an +// ordering relationship but the dependency must still be visited if its +// dependencies are visited. This is true for outputs, for example, since +// they must get updated if any of their dependent resources get updated, +// which would not normally be true if one of their dependencies were targeted. +type GraphNodeTargetDownstream interface { + TargetDownstream(targeted, untargeted *dag.Set) bool +} + // TargetsTransformer is a GraphTransformer that, when the user specifies a // list of resources to target, limits the graph to only those resources and // their dependencies. @@ -26,6 +41,12 @@ type TargetsTransformer struct { // that already have the targets parsed ParsedTargets []ResourceAddress + // If set, the index portions of resource addresses will be ignored + // for comparison. This is used when transforming a graph where + // counted resources have not yet been expanded, since otherwise + // the unexpanded nodes (which never have indices) would not match. + IgnoreIndices bool + // Set to true when we're in a `terraform destroy` or a // `terraform plan -destroy` Destroy bool @@ -84,7 +105,10 @@ func (t *TargetsTransformer) parseTargetAddresses() ([]ResourceAddress, error) { func (t *TargetsTransformer) selectTargetedNodes( g *Graph, addrs []ResourceAddress) (*dag.Set, error) { targetedNodes := new(dag.Set) - for _, v := range g.Vertices() { + + vertices := g.Vertices() + + for _, v := range vertices { if t.nodeIsTarget(v, addrs) { targetedNodes.Add(v) @@ -112,6 +136,63 @@ func (t *TargetsTransformer) selectTargetedNodes( } } + // Handle nodes that need to be included if their dependencies are included. + // This requires multiple passes since we need to catch transitive + // dependencies if and only if they are via other nodes that also + // support TargetDownstream. For example: + // output -> output -> targeted-resource: both outputs need to be targeted + // output -> non-targeted-resource -> targeted-resource: output not targeted + // + // We'll keep looping until we stop targeting more nodes. + queue := targetedNodes.List() + for len(queue) > 0 { + vertices := queue + queue = nil // ready to append for next iteration if neccessary + for _, v := range vertices { + dependers := g.UpEdges(v) + if dependers == nil { + // indicates that there are no up edges for this node, so + // we have nothing to do here. + continue + } + + dependers = dependers.Filter(func(dv interface{}) bool { + // Can ignore nodes that are already targeted + /*if targetedNodes.Include(dv) { + return false + }*/ + + _, ok := dv.(GraphNodeTargetDownstream) + return ok + }) + + if dependers.Len() == 0 { + continue + } + + for _, dv := range dependers.List() { + if targetedNodes.Include(dv) { + // Already present, so nothing to do + continue + } + + // We'll give the node some information about what it's + // depending on in case that informs its decision about whether + // it is safe to be targeted. + deps := g.DownEdges(v) + depsTargeted := deps.Intersection(targetedNodes) + depsUntargeted := deps.Difference(depsTargeted) + + if dv.(GraphNodeTargetDownstream).TargetDownstream(depsTargeted, depsUntargeted) { + targetedNodes.Add(dv) + // Need to visit this node on the next pass to see if it + // has any transitive dependers. + queue = append(queue, dv) + } + } + } + } + return targetedNodes, nil } @@ -124,7 +205,12 @@ func (t *TargetsTransformer) nodeIsTarget( addr := r.ResourceAddr() for _, targetAddr := range addrs { - if targetAddr.Equals(addr) { + if t.IgnoreIndices { + // targetAddr is not a pointer, so we can safely mutate it without + // interfering with references elsewhere. + targetAddr.Index = -1 + } + if targetAddr.Contains(addr) { return true } } diff --git a/vendor/github.com/hashicorp/terraform/terraform/user_agent.go b/vendor/github.com/hashicorp/terraform/terraform/user_agent.go new file mode 100644 index 0000000..700be2a --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/terraform/user_agent.go @@ -0,0 +1,14 @@ +package terraform + +import ( + "fmt" + "runtime" +) + +// The standard Terraform User-Agent format +const UserAgent = "Terraform %s (%s)" + +// Generate a UserAgent string +func UserAgentString() string { + return fmt.Sprintf(UserAgent, VersionString(), runtime.Version()) +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/util.go b/vendor/github.com/hashicorp/terraform/terraform/util.go index e1d951c..752241a 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/util.go +++ b/vendor/github.com/hashicorp/terraform/terraform/util.go @@ -1,7 +1,9 @@ package terraform import ( - "strings" + "sort" + + "github.com/hashicorp/terraform/config" ) // Semaphore is a wrapper around a channel to provide @@ -46,21 +48,8 @@ func (s Semaphore) Release() { } } -// resourceProvider returns the provider name for the given type. -func resourceProvider(t, alias string) string { - if alias != "" { - return alias - } - - idx := strings.IndexRune(t, '_') - if idx == -1 { - // If no underscores, the resource name is assumed to be - // also the provider name, e.g. if the provider exposes - // only a single resource of each type. - return t - } - - return t[:idx] +func resourceProvider(resourceType, explicitProvider string) string { + return config.ResourceProviderFullName(resourceType, explicitProvider) } // strSliceContains checks if a given string is contained in a slice @@ -73,3 +62,20 @@ func strSliceContains(haystack []string, needle string) bool { } return false } + +// deduplicate a slice of strings +func uniqueStrings(s []string) []string { + if len(s) < 2 { + return s + } + + sort.Strings(s) + result := make([]string, 1, len(s)) + result[0] = s[0] + for i := 1; i < len(s); i++ { + if s[i] != result[len(result)-1] { + result = append(result, s[i]) + } + } + return result +} diff --git a/vendor/github.com/hashicorp/terraform/terraform/version.go b/vendor/github.com/hashicorp/terraform/terraform/version.go index 4feb9e0..bce60e3 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/version.go +++ b/vendor/github.com/hashicorp/terraform/terraform/version.go @@ -7,12 +7,12 @@ import ( ) // The main version number that is being run at the moment. -const Version = "0.9.0" +const Version = "0.10.7" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release // such as "dev" (in development), "beta", "rc1", etc. -const VersionPrerelease = "" +var VersionPrerelease = "dev" // SemVersion is an instance of version.Version. This has the secondary // benefit of verifying during tests and init time that our version is a diff --git a/vendor/github.com/hashicorp/terraform/terraform/version_required.go b/vendor/github.com/hashicorp/terraform/terraform/version_required.go index 3cbbf56..723ec39 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/version_required.go +++ b/vendor/github.com/hashicorp/terraform/terraform/version_required.go @@ -8,17 +8,17 @@ import ( "github.com/hashicorp/terraform/config/module" ) -// checkRequiredVersion verifies that any version requirements specified by +// CheckRequiredVersion verifies that any version requirements specified by // the configuration are met. // // This checks the root module as well as any additional version requirements // from child modules. // // This is tested in context_test.go. -func checkRequiredVersion(m *module.Tree) error { +func CheckRequiredVersion(m *module.Tree) error { // Check any children for _, c := range m.Children() { - if err := checkRequiredVersion(c); err != nil { + if err := CheckRequiredVersion(c); err != nil { return err } } diff --git a/vendor/github.com/hashicorp/terraform/terraform/walkoperation_string.go b/vendor/github.com/hashicorp/terraform/terraform/walkoperation_string.go index 8fb33d7..cbd78dd 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/walkoperation_string.go +++ b/vendor/github.com/hashicorp/terraform/terraform/walkoperation_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type=walkOperation graph_walk_operation.go"; DO NOT EDIT +// Code generated by "stringer -type=walkOperation graph_walk_operation.go"; DO NOT EDIT. package terraform diff --git a/vendor/github.com/hashicorp/vault/LICENSE b/vendor/github.com/hashicorp/vault/LICENSE deleted file mode 100644 index e87a115..0000000 --- a/vendor/github.com/hashicorp/vault/LICENSE +++ /dev/null @@ -1,363 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/hashicorp/vault/helper/compressutil/compress.go b/vendor/github.com/hashicorp/vault/helper/compressutil/compress.go deleted file mode 100644 index e485f2f..0000000 --- a/vendor/github.com/hashicorp/vault/helper/compressutil/compress.go +++ /dev/null @@ -1,159 +0,0 @@ -package compressutil - -import ( - "bytes" - "compress/gzip" - "compress/lzw" - "fmt" - "io" -) - -const ( - // A byte value used as a canary prefix for the compressed information - // which is used to distinguish if a JSON input is compressed or not. - // The value of this constant should not be a first character of any - // valid JSON string. - - // Byte value used as canary when using Gzip format - CompressionCanaryGzip byte = 'G' - - // Byte value used as canary when using Lzw format - CompressionCanaryLzw byte = 'L' - - CompressionTypeLzw = "lzw" - - CompressionTypeGzip = "gzip" -) - -// CompressionConfig is used to select a compression type to be performed by -// Compress and Decompress utilities. -// Supported types are: -// * CompressionTypeLzw -// * CompressionTypeGzip -// -// When using CompressionTypeGzip, the compression levels can also be chosen: -// * gzip.DefaultCompression -// * gzip.BestSpeed -// * gzip.BestCompression -type CompressionConfig struct { - // Type of the compression algorithm to be used - Type string - - // When using Gzip format, the compression level to employ - GzipCompressionLevel int -} - -// Compress places the canary byte in a buffer and uses the same buffer to fill -// in the compressed information of the given input. The configuration supports -// two type of compression: LZW and Gzip. When using Gzip compression format, -// if GzipCompressionLevel is not specified, the 'gzip.DefaultCompression' will -// be assumed. -func Compress(data []byte, config *CompressionConfig) ([]byte, error) { - var buf bytes.Buffer - var writer io.WriteCloser - var err error - - if config == nil { - return nil, fmt.Errorf("config is nil") - } - - // Write the canary into the buffer and create writer to compress the - // input data based on the configured type - switch config.Type { - case CompressionTypeLzw: - buf.Write([]byte{CompressionCanaryLzw}) - - writer = lzw.NewWriter(&buf, lzw.LSB, 8) - case CompressionTypeGzip: - buf.Write([]byte{CompressionCanaryGzip}) - - switch { - case config.GzipCompressionLevel == gzip.BestCompression, - config.GzipCompressionLevel == gzip.BestSpeed, - config.GzipCompressionLevel == gzip.DefaultCompression: - // These are valid compression levels - default: - // If compression level is set to NoCompression or to - // any invalid value, fallback to Defaultcompression - config.GzipCompressionLevel = gzip.DefaultCompression - } - writer, err = gzip.NewWriterLevel(&buf, config.GzipCompressionLevel) - default: - return nil, fmt.Errorf("unsupported compression type") - } - if err != nil { - return nil, fmt.Errorf("failed to create a compression writer; err: %v", err) - } - - if writer == nil { - return nil, fmt.Errorf("failed to create a compression writer") - } - - // Compress the input and place it in the same buffer containing the - // canary byte. - if _, err = writer.Write(data); err != nil { - return nil, fmt.Errorf("failed to compress input data; err: %v", err) - } - - // Close the io.WriteCloser - if err = writer.Close(); err != nil { - return nil, err - } - - // Return the compressed bytes with canary byte at the start - return buf.Bytes(), nil -} - -// Decompress checks if the first byte in the input matches the canary byte. -// If the first byte is a canary byte, then the input past the canary byte -// will be decompressed using the method specified in the given configuration. -// If the first byte isn't a canary byte, then the utility returns a boolean -// value indicating that the input was not compressed. -func Decompress(data []byte) ([]byte, bool, error) { - var err error - var reader io.ReadCloser - if data == nil || len(data) == 0 { - return nil, false, fmt.Errorf("'data' being decompressed is empty") - } - - switch { - case data[0] == CompressionCanaryGzip: - // If the first byte matches the canary byte, remove the canary - // byte and try to decompress the data that is after the canary. - if len(data) < 2 { - return nil, false, fmt.Errorf("invalid 'data' after the canary") - } - data = data[1:] - reader, err = gzip.NewReader(bytes.NewReader(data)) - case data[0] == CompressionCanaryLzw: - // If the first byte matches the canary byte, remove the canary - // byte and try to decompress the data that is after the canary. - if len(data) < 2 { - return nil, false, fmt.Errorf("invalid 'data' after the canary") - } - data = data[1:] - reader = lzw.NewReader(bytes.NewReader(data), lzw.LSB, 8) - default: - // If the first byte doesn't match the canary byte, it means - // that the content was not compressed at all. Indicate the - // caller that the input was not compressed. - return nil, true, nil - } - if err != nil { - return nil, false, fmt.Errorf("failed to create a compression reader; err: %v", err) - } - if reader == nil { - return nil, false, fmt.Errorf("failed to create a compression reader") - } - - // Close the io.ReadCloser - defer reader.Close() - - // Read all the compressed data into a buffer - var buf bytes.Buffer - if _, err = io.Copy(&buf, reader); err != nil { - return nil, false, err - } - - return buf.Bytes(), false, nil -} diff --git a/vendor/github.com/hashicorp/vault/helper/jsonutil/json.go b/vendor/github.com/hashicorp/vault/helper/jsonutil/json.go deleted file mode 100644 index a96745b..0000000 --- a/vendor/github.com/hashicorp/vault/helper/jsonutil/json.go +++ /dev/null @@ -1,99 +0,0 @@ -package jsonutil - -import ( - "bytes" - "compress/gzip" - "encoding/json" - "fmt" - "io" - - "github.com/hashicorp/vault/helper/compressutil" -) - -// Encodes/Marshals the given object into JSON -func EncodeJSON(in interface{}) ([]byte, error) { - if in == nil { - return nil, fmt.Errorf("input for encoding is nil") - } - var buf bytes.Buffer - enc := json.NewEncoder(&buf) - if err := enc.Encode(in); err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -// EncodeJSONAndCompress encodes the given input into JSON and compresses the -// encoded value (using Gzip format BestCompression level, by default). A -// canary byte is placed at the beginning of the returned bytes for the logic -// in decompression method to identify compressed input. -func EncodeJSONAndCompress(in interface{}, config *compressutil.CompressionConfig) ([]byte, error) { - if in == nil { - return nil, fmt.Errorf("input for encoding is nil") - } - - // First JSON encode the given input - encodedBytes, err := EncodeJSON(in) - if err != nil { - return nil, err - } - - if config == nil { - config = &compressutil.CompressionConfig{ - Type: compressutil.CompressionTypeGzip, - GzipCompressionLevel: gzip.BestCompression, - } - } - - return compressutil.Compress(encodedBytes, config) -} - -// DecodeJSON tries to decompress the given data. The call to decompress, fails -// if the content was not compressed in the first place, which is identified by -// a canary byte before the compressed data. If the data is not compressed, it -// is JSON decoded directly. Otherwise the decompressed data will be JSON -// decoded. -func DecodeJSON(data []byte, out interface{}) error { - if data == nil || len(data) == 0 { - return fmt.Errorf("'data' being decoded is nil") - } - if out == nil { - return fmt.Errorf("output parameter 'out' is nil") - } - - // Decompress the data if it was compressed in the first place - decompressedBytes, uncompressed, err := compressutil.Decompress(data) - if err != nil { - return fmt.Errorf("failed to decompress JSON: err: %v", err) - } - if !uncompressed && (decompressedBytes == nil || len(decompressedBytes) == 0) { - return fmt.Errorf("decompressed data being decoded is invalid") - } - - // If the input supplied failed to contain the compression canary, it - // will be notified by the compression utility. Decode the decompressed - // input. - if !uncompressed { - data = decompressedBytes - } - - return DecodeJSONFromReader(bytes.NewReader(data), out) -} - -// Decodes/Unmarshals the given io.Reader pointing to a JSON, into a desired object -func DecodeJSONFromReader(r io.Reader, out interface{}) error { - if r == nil { - return fmt.Errorf("'io.Reader' being decoded is nil") - } - if out == nil { - return fmt.Errorf("output parameter 'out' is nil") - } - - dec := json.NewDecoder(r) - - // While decoding JSON values, intepret the integer values as `json.Number`s instead of `float64`. - dec.UseNumber() - - // Since 'out' is an interface representing a pointer, pass it to the decoder without an '&' - return dec.Decode(out) -} diff --git a/vendor/github.com/hashicorp/vault/helper/pgpkeys/encrypt_decrypt.go b/vendor/github.com/hashicorp/vault/helper/pgpkeys/encrypt_decrypt.go deleted file mode 100644 index d8b7f60..0000000 --- a/vendor/github.com/hashicorp/vault/helper/pgpkeys/encrypt_decrypt.go +++ /dev/null @@ -1,117 +0,0 @@ -package pgpkeys - -import ( - "bytes" - "encoding/base64" - "fmt" - - "github.com/keybase/go-crypto/openpgp" - "github.com/keybase/go-crypto/openpgp/packet" -) - -// EncryptShares takes an ordered set of byte slices to encrypt and the -// corresponding base64-encoded public keys to encrypt them with, encrypts each -// byte slice with the corresponding public key. -// -// Note: There is no corresponding test function; this functionality is -// thoroughly tested in the init and rekey command unit tests -func EncryptShares(input [][]byte, pgpKeys []string) ([]string, [][]byte, error) { - if len(input) != len(pgpKeys) { - return nil, nil, fmt.Errorf("Mismatch between number items to encrypt and number of PGP keys") - } - encryptedShares := make([][]byte, 0, len(pgpKeys)) - entities, err := GetEntities(pgpKeys) - if err != nil { - return nil, nil, err - } - for i, entity := range entities { - ctBuf := bytes.NewBuffer(nil) - pt, err := openpgp.Encrypt(ctBuf, []*openpgp.Entity{entity}, nil, nil, nil) - if err != nil { - return nil, nil, fmt.Errorf("Error setting up encryption for PGP message: %s", err) - } - _, err = pt.Write(input[i]) - if err != nil { - return nil, nil, fmt.Errorf("Error encrypting PGP message: %s", err) - } - pt.Close() - encryptedShares = append(encryptedShares, ctBuf.Bytes()) - } - - fingerprints, err := GetFingerprints(nil, entities) - if err != nil { - return nil, nil, err - } - - return fingerprints, encryptedShares, nil -} - -// GetFingerprints takes in a list of openpgp Entities and returns the -// fingerprints. If entities is nil, it will instead parse both entities and -// fingerprints from the pgpKeys string slice. -func GetFingerprints(pgpKeys []string, entities []*openpgp.Entity) ([]string, error) { - if entities == nil { - var err error - entities, err = GetEntities(pgpKeys) - - if err != nil { - return nil, err - } - } - ret := make([]string, 0, len(entities)) - for _, entity := range entities { - ret = append(ret, fmt.Sprintf("%x", entity.PrimaryKey.Fingerprint)) - } - return ret, nil -} - -// GetEntities takes in a string array of base64-encoded PGP keys and returns -// the openpgp Entities -func GetEntities(pgpKeys []string) ([]*openpgp.Entity, error) { - ret := make([]*openpgp.Entity, 0, len(pgpKeys)) - for _, keystring := range pgpKeys { - data, err := base64.StdEncoding.DecodeString(keystring) - if err != nil { - return nil, fmt.Errorf("Error decoding given PGP key: %s", err) - } - entity, err := openpgp.ReadEntity(packet.NewReader(bytes.NewBuffer(data))) - if err != nil { - return nil, fmt.Errorf("Error parsing given PGP key: %s", err) - } - ret = append(ret, entity) - } - return ret, nil -} - -// DecryptBytes takes in base64-encoded encrypted bytes and the base64-encoded -// private key and decrypts it. A bytes.Buffer is returned to allow the caller -// to do useful thing with it (get it as a []byte, get it as a string, use it -// as an io.Reader, etc), and also because this function doesn't know if what -// comes out is binary data or a string, so let the caller decide. -func DecryptBytes(encodedCrypt, privKey string) (*bytes.Buffer, error) { - privKeyBytes, err := base64.StdEncoding.DecodeString(privKey) - if err != nil { - return nil, fmt.Errorf("Error decoding base64 private key: %s", err) - } - - cryptBytes, err := base64.StdEncoding.DecodeString(encodedCrypt) - if err != nil { - return nil, fmt.Errorf("Error decoding base64 crypted bytes: %s", err) - } - - entity, err := openpgp.ReadEntity(packet.NewReader(bytes.NewBuffer(privKeyBytes))) - if err != nil { - return nil, fmt.Errorf("Error parsing private key: %s", err) - } - - entityList := &openpgp.EntityList{entity} - md, err := openpgp.ReadMessage(bytes.NewBuffer(cryptBytes), entityList, nil, nil) - if err != nil { - return nil, fmt.Errorf("Error decrypting the messages: %s", err) - } - - ptBuf := bytes.NewBuffer(nil) - ptBuf.ReadFrom(md.UnverifiedBody) - - return ptBuf, nil -} diff --git a/vendor/github.com/hashicorp/vault/helper/pgpkeys/flag.go b/vendor/github.com/hashicorp/vault/helper/pgpkeys/flag.go deleted file mode 100644 index ccfc64b..0000000 --- a/vendor/github.com/hashicorp/vault/helper/pgpkeys/flag.go +++ /dev/null @@ -1,97 +0,0 @@ -package pgpkeys - -import ( - "bytes" - "encoding/base64" - "errors" - "fmt" - "os" - "strings" - - "github.com/keybase/go-crypto/openpgp" -) - -// PGPPubKeyFiles implements the flag.Value interface and allows -// parsing and reading a list of pgp public key files -type PubKeyFilesFlag []string - -func (p *PubKeyFilesFlag) String() string { - return fmt.Sprint(*p) -} - -func (p *PubKeyFilesFlag) Set(value string) error { - if len(*p) > 0 { - return errors.New("pgp-keys can only be specified once") - } - - splitValues := strings.Split(value, ",") - - keybaseMap, err := FetchKeybasePubkeys(splitValues) - if err != nil { - return err - } - - // Now go through the actual flag, and substitute in resolved keybase - // entries where appropriate - for _, keyfile := range splitValues { - if strings.HasPrefix(keyfile, kbPrefix) { - key := keybaseMap[keyfile] - if key == "" { - return fmt.Errorf("key for keybase user %s was not found in the map", strings.TrimPrefix(keyfile, kbPrefix)) - } - *p = append(*p, key) - continue - } - - pgpStr, err := ReadPGPFile(keyfile) - if err != nil { - return err - } - - *p = append(*p, pgpStr) - } - return nil -} - -func ReadPGPFile(path string) (string, error) { - if path[0] == '@' { - path = path[1:] - } - f, err := os.Open(path) - if err != nil { - return "", err - } - defer f.Close() - buf := bytes.NewBuffer(nil) - _, err = buf.ReadFrom(f) - if err != nil { - return "", err - } - - // First parse as an armored keyring file, if that doesn't work, treat it as a straight binary/b64 string - keyReader := bytes.NewReader(buf.Bytes()) - entityList, err := openpgp.ReadArmoredKeyRing(keyReader) - if err == nil { - if len(entityList) != 1 { - return "", fmt.Errorf("more than one key found in file %s", path) - } - if entityList[0] == nil { - return "", fmt.Errorf("primary key was nil for file %s", path) - } - - serializedEntity := bytes.NewBuffer(nil) - err = entityList[0].Serialize(serializedEntity) - if err != nil { - return "", fmt.Errorf("error serializing entity for file %s: %s", path, err) - } - - return base64.StdEncoding.EncodeToString(serializedEntity.Bytes()), nil - } - - _, err = base64.StdEncoding.DecodeString(buf.String()) - if err == nil { - return buf.String(), nil - } - return base64.StdEncoding.EncodeToString(buf.Bytes()), nil - -} diff --git a/vendor/github.com/hashicorp/vault/helper/pgpkeys/keybase.go b/vendor/github.com/hashicorp/vault/helper/pgpkeys/keybase.go deleted file mode 100644 index 5c14cbc..0000000 --- a/vendor/github.com/hashicorp/vault/helper/pgpkeys/keybase.go +++ /dev/null @@ -1,116 +0,0 @@ -package pgpkeys - -import ( - "bytes" - "encoding/base64" - "fmt" - "strings" - - "github.com/hashicorp/go-cleanhttp" - "github.com/hashicorp/vault/helper/jsonutil" - "github.com/keybase/go-crypto/openpgp" -) - -const ( - kbPrefix = "keybase:" -) - -// FetchKeybasePubkeys fetches public keys from Keybase given a set of -// usernames, which are derived from correctly formatted input entries. It -// doesn't use their client code due to both the API and the fact that it is -// considered alpha and probably best not to rely on it. The keys are returned -// as base64-encoded strings. -func FetchKeybasePubkeys(input []string) (map[string]string, error) { - client := cleanhttp.DefaultClient() - if client == nil { - return nil, fmt.Errorf("unable to create an http client") - } - - if len(input) == 0 { - return nil, nil - } - - usernames := make([]string, 0, len(input)) - for _, v := range input { - if strings.HasPrefix(v, kbPrefix) { - usernames = append(usernames, strings.TrimPrefix(v, kbPrefix)) - } - } - - if len(usernames) == 0 { - return nil, nil - } - - ret := make(map[string]string, len(usernames)) - url := fmt.Sprintf("https://keybase.io/_/api/1.0/user/lookup.json?usernames=%s&fields=public_keys", strings.Join(usernames, ",")) - resp, err := client.Get(url) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - type publicKeys struct { - Primary struct { - Bundle string - } - } - - type them struct { - publicKeys `json:"public_keys"` - } - - type kbResp struct { - Status struct { - Name string - } - Them []them - } - - out := &kbResp{ - Them: []them{}, - } - - if err := jsonutil.DecodeJSONFromReader(resp.Body, out); err != nil { - return nil, err - } - - if out.Status.Name != "OK" { - return nil, fmt.Errorf("got non-OK response: %s", out.Status.Name) - } - - missingNames := make([]string, 0, len(usernames)) - var keyReader *bytes.Reader - serializedEntity := bytes.NewBuffer(nil) - for i, themVal := range out.Them { - if themVal.Primary.Bundle == "" { - missingNames = append(missingNames, usernames[i]) - continue - } - keyReader = bytes.NewReader([]byte(themVal.Primary.Bundle)) - entityList, err := openpgp.ReadArmoredKeyRing(keyReader) - if err != nil { - return nil, err - } - if len(entityList) != 1 { - return nil, fmt.Errorf("primary key could not be parsed for user %s", usernames[i]) - } - if entityList[0] == nil { - return nil, fmt.Errorf("primary key was nil for user %s", usernames[i]) - } - - serializedEntity.Reset() - err = entityList[0].Serialize(serializedEntity) - if err != nil { - return nil, fmt.Errorf("error serializing entity for user %s: %s", usernames[i], err) - } - - // The API returns values in the same ordering requested, so this should properly match - ret[kbPrefix+usernames[i]] = base64.StdEncoding.EncodeToString(serializedEntity.Bytes()) - } - - if len(missingNames) > 0 { - return nil, fmt.Errorf("unable to fetch keys for user(s) %s from keybase", strings.Join(missingNames, ",")) - } - - return ret, nil -} diff --git a/vendor/github.com/hashicorp/vault/helper/pgpkeys/test_keys.go b/vendor/github.com/hashicorp/vault/helper/pgpkeys/test_keys.go deleted file mode 100644 index c10a905..0000000 --- a/vendor/github.com/hashicorp/vault/helper/pgpkeys/test_keys.go +++ /dev/null @@ -1,271 +0,0 @@ -package pgpkeys - -const ( - TestPrivKey1 = `lQOYBFXbjPUBCADjNjCUQwfxKL+RR2GA6pv/1K+zJZ8UWIF9S0lk7cVIEfJiprzzwiMwBS5cD0da -rGin1FHvIWOZxujA7oW0O2TUuatqI3aAYDTfRYurh6iKLC+VS+F7H+/mhfFvKmgr0Y5kDCF1j0T/ -063QZ84IRGucR/X43IY7kAtmxGXH0dYOCzOe5UBX1fTn3mXGe2ImCDWBH7gOViynXmb6XNvXkP0f -sF5St9jhO7mbZU9EFkv9O3t3EaURfHopsCVDOlCkFCw5ArY+DUORHRzoMX0PnkyQb5OzibkChzpg -8hQssKeVGpuskTdz5Q7PtdW71jXd4fFVzoNH8fYwRpziD2xNvi6HABEBAAEAB/wL+KX0mdeISEpX -oDgt766Key1Kthe8nbEs5dOXIsP7OR7ZPcnE2hy6gftgVFnBGEZnWVN70vmJd6Z5y9d1mI+GecXj -UL0EpI0EmohyYDJsHUnght/5ecRNFA+VeNmGPYNQGCeHJyZOiFunGGENpHU7BbubAht8delz37Mx -JQgvMyR6AKvg8HKBoQeqV1uMWNJE/vKwV/z1dh1sjK/GFxu05Qaq0GTfAjVLuFOyJTS95yq6gblD -jUdbHLp7tBeqIKo9voWCJF5mGOlq3973vVoWETy9b0YYPCE/M7fXmK9dJITHqkROLMW6TgcFeIw4 -yL5KOBCHk+QGPSvyQN7R7Fd5BADwuT1HZmvg7Y9GjarKXDjxdNemUiHtba2rUzfH6uNmKNQvwQek -nma5palNUJ4/dz1aPB21FUBXJF5yWwXEdApl+lIDU0J5m4UD26rqEVRq9Kx3GsX+yfcwObkrSzW6 -kmnQSB5KI0fIuegMTM+Jxo3pB/mIRwDTMmk+vfzIGyW+7QQA8aFwFLMdKdfLgSGbl5Z6etmOAVQ2 -Oe2ebegU9z/ewi/Rdt2s9yQiAdGVM8+q15Saz8a+kyS/l1CjNPzr3VpYx1OdZ3gb7i2xoy9GdMYR -ZpTq3TuST95kx/9DqA97JrP23G47U0vwF/cg8ixCYF8Fz5dG4DEsxgMwKqhGdW58wMMD/iytkfMk -Vk6Z958Rpy7lhlC6L3zpO38767bSeZ8gRRi/NMFVOSGYepKFarnfxcTiNa+EoSVA6hUo1N64nALE -sJBpyOoTfKIpz7WwTF1+WogkiYrfM6lHon1+3qlziAcRW0IohM3g2C1i3GWdON4Cl8/PDO3R0E52 -N6iG/ctNNeMiPe60EFZhdWx0IFRlc3QgS2V5IDGJATgEEwECACIFAlXbjPUCGy8GCwkIBwMCBhUI -AgkKCwQWAgMBAh4BAheAAAoJEOfLr44BHbeTo+sH/i7bapIgPnZsJ81hmxPj4W12uvunksGJiC7d -4hIHsG7kmJRTJfjECi+AuTGeDwBy84TDcRaOB6e79fj65Fg6HgSahDUtKJbGxj/lWzmaBuTzlN3C -Ee8cMwIPqPT2kajJVdOyrvkyuFOdPFOEA7bdCH0MqgIdM2SdF8t40k/ATfuD2K1ZmumJ508I3gF3 -9jgTnPzD4C8quswrMQ3bzfvKC3klXRlBC0yoArn+0QA3cf2B9T4zJ2qnvgotVbeK/b1OJRNj6Poe -o+SsWNc/A5mw7lGScnDgL3yfwCm1gQXaQKfOt5x+7GqhWDw10q+bJpJlI10FfzAnhMF9etSqSeUR -BRWdA5gEVduM9QEIAL53hJ5bZJ7oEDCnaY+SCzt9QsAfnFTAnZJQrvkvusJzrTQ088eUQmAjvxkf -Rqnv981fFwGnh2+I1Ktm698UAZS9Jt8yjak9wWUICKQO5QUt5k8cHwldQXNXVXFa+TpQWQR5yW1a -9okjh5o/3d4cBt1yZPUJJyLKY43Wvptb6EuEsScO2DnRkh5wSMDQ7dTooddJCmaq3LTjOleRFQbu -9ij386Do6jzK69mJU56TfdcydkxkWF5NZLGnED3lq+hQNbe+8UI5tD2oP/3r5tXKgMy1R/XPvR/z -bfwvx4FAKFOP01awLq4P3d/2xOkMu4Lu9p315E87DOleYwxk+FoTqXEAEQEAAQAH+wVyQXaNwnjQ -xfW+M8SJNo0C7e+0d7HsuBTA/d/eP4bj6+X8RaRFVwiMvSAoxsqBNCLJP00qzzKfRQWJseD1H35z -UjM7rNVUEL2k1yppyp61S0qj0TdhVUfJDYZqRYonVgRMvzfDTB1ryKrefKenQYL/jGd9VYMnKmWZ -6GVk4WWXXx61iOt2HNcmSXKetMM1Mg67woPZkA3fJaXZ+zW0zMu4lTSB7yl3+vLGIFYILkCFnREr -drQ+pmIMwozUAt+pBq8dylnkHh6g/FtRfWmLIMDqM1NlyuHRp3dyLDFdTA93osLG0QJblfX54W34 -byX7a4HASelGi3nPjjOAsTFDkuEEANV2viaWk1CV4ryDrXGmy4Xo32Md+laGPRcVfbJ0mjZjhQsO -gWC1tjMs1qZMPhcrKIBCjjdAcAIrGV9h3CXc0uGuez4XxLO+TPBKaS0B8rKhnKph1YZuf+HrOhzS -astDnOjNIT+qucCL/qSbdYpj9of3yY61S59WphPOBjoVM3BFBADka6ZCk81gx8jA2E1e9UqQDmdM -FZaVA1E7++kqVSFRDJGnq+5GrBTwCJ+sevi+Rvf8Nx4AXvpCdtMBPX9RogsUFcR0pMrKBrgRo/Vg -EpuodY2Ef1VtqXR24OxtRf1UwvHKydIsU05rzMAy5uGgQvTzRTXxZFLGUY31wjWqmo9VPQP+PnwA -K83EV2kk2bsXwZ9MXg05iXqGQYR4bEc/12v04BtaNaDS53hBDO4JIa3Bnz+5oUoYhb8FgezUKA9I -n6RdKTTP1BLAu8titeozpNF07V++dPiSE2wrIVsaNHL1pUwW0ql50titVwe+EglWiCKPtJBcCPUA -3oepSPchiDjPqrNCYIkCPgQYAQIACQUCVduM9QIbLgEpCRDny6+OAR23k8BdIAQZAQIABgUCVduM -9QAKCRAID0JGyHtSGmqYB/4m4rJbbWa7dBJ8VqRU7ZKnNRDR9CVhEGipBmpDGRYulEimOPzLUX/Z -XZmTZzgemeXLBaJJlWnopVUWuAsyjQuZAfdd8nHkGRHG0/DGum0l4sKTta3OPGHNC1z1dAcQ1RCr -9bTD3PxjLBczdGqhzw71trkQRBRdtPiUchltPMIyjUHqVJ0xmg0hPqFic0fICsr0YwKoz3h9+QEc -ZHvsjSZjgydKvfLYcm+4DDMCCqcHuJrbXJKUWmJcXR0y/+HQONGrGJ5xWdO+6eJioPn2jVMnXCm4 -EKc7fcLFrz/LKmJ8seXhxjM3EdFtylBGCrx3xdK0f+JDNQaC/rhUb5V2XuX6VwoH/AtY+XsKVYRf -NIupLOUcf/srsm3IXT4SXWVomOc9hjGQiJ3rraIbADsc+6bCAr4XNZS7moViAAcIPXFv3m3WfUln -G/om78UjQqyVACRZqqAGmuPq+TSkRUCpt9h+A39LQWkojHqyob3cyLgy6z9Q557O9uK3lQozbw2g -H9zC0RqnePl+rsWIUU/ga16fH6pWc1uJiEBt8UZGypQ/E56/343epmYAe0a87sHx8iDV+dNtDVKf -PRENiLOOc19MmS+phmUyrbHqI91c0pmysYcJZCD3a502X1gpjFbPZcRtiTmGnUKdOIu60YPNE4+h -7u2CfYyFPu3AlUaGNMBlvy6PEpU=` - - TestPrivKey2 = `lQOYBFXbkJEBCADKb1ZvlT14XrJa2rTOe5924LQr2PTZlRv+651TXy33yEhelZ+V4sMrELN8fKEG -Zy1kNixmbq3MCF/671k3LigHA7VrOaH9iiQgr6IIq2MeIkUYKZ27C992vQkYLjbYUG8+zl5h69S4 -0Ixm0yL0M54XOJ0gm+maEK1ZESKTUlDNkIS7l0jLZSYwfUeGXSEt6FWs8OgbyRTaHw4PDHrDEE9e -Q67K6IZ3YMhPOL4fVk4Jwrp5R/RwiklT+lNozWEyFVwPFH4MeQMs9nMbt+fWlTzEA7tI4acI9yDk -Cm1yN2R9rmY0UjODRiJw6z6sLV2T+Pf32n3MNSUOYczOjZa4VBwjABEBAAEAB/oCBqTIsxlUgLtz -HRpWW5MJ+93xvmVV0JHhRK/ygKghq+zpC6S+cn7dwrEj1JTPh+17lyemYQK+RMeiBEduoWNKuHUd -WX353w2411rrc/VuGTglzhd8Ir2BdJlPesCzw4JQnrWqcBqN52W+iwhnE7PWVhnvItWnx6APK5Se -q7dzFWy8Z8tNIHm0pBQbeyo6x2rHHSWkr2fs7V02qFQhii1ayFRMcgdOWSNX6CaZJuYhk/DyjApN -9pVhi3P1pNMpFeV0Pt8Gl1f/9o6/HpAYYEt/6vtVRhFUGgtNi95oc0oyzIJxliRvd6+Z236osigQ -QEBwj1ImRK8TKyWPlykiJWc5BADfldgOCA55o3Qz/z/oVE1mm+a3FmPPTQlHBXotNEsrWV2wmJHe -lNQPI6ZwMtLrBSg8PUpG2Rvao6XJ4ZBl/VcDwfcLgCnALPCcL0L0Z3vH3Sc9Ta/bQWJODG7uSaI1 -iVJ7ArKNtVzTqRQWK967mol9CCqh4A0jRrH0aVEFbrqQ/QQA58iEJaFhzFZjufjC9N8Isn3Ky7xu -h+dk001RNCb1GnNZcx4Ld2IB+uXyYjtg7dNaUhGgGuCBo9nax89bMsBzzUukx3SHq1pxopMg6Dm8 -ImBoIAicuQWgEkaP2T0rlwCozUalJZaG1gyrzkPhkeY7CglpJycHLHfY2MIb46c8+58D/iJ83Q5j -Y4x+sqW2QeUYFwqCcOW8Urg64UxEkgXZXiNMwTAJCaxp/Pz7cgeUDwgv+6CXEdnT1910+byzK9ha -V1Q/65+/JYuCeyHxcoAb4Wtpdl7GALGd/1G0UAmq47yrefEr/b00uS35i1qUUhOzo1NmEZch/bvF -kmJ+WtAHunZcOCu0EFZhdWx0IFRlc3QgS2V5IDKJATgEEwECACIFAlXbkJECGy8GCwkIBwMCBhUI -AgkKCwQWAgMBAh4BAheAAAoJEOuDLGfrXolXqz4H/28IuoRxGKoJ064YHjPkkpoddW6zdzzNfHip -ZnNfEUiTEls4qF1IB81M2xqfiXIFRIdO2kaLkRPFhO0hRxbtI6VuZYLgG3QCaXhxW6GyFa5zKABq -hb5ojexdnAYRswaHV201ZCclj9rnJN1PAg0Rz6MdX/w1euEWktQxWKo42oZKyx8oT9p6lrv5KRmG -kdrg8K8ARmRILjmwuBAgJM0eXBZHNGWXelk4YmOgnAAcZA6ZAo1G+8Pg6pKKP61ETewuCg3/u7N0 -vDttB+ZXqF88W9jAYlvdgbTtajNF5IDYDjTzWfeCaIB18F9gOzXq15SwWeDDI+CU9Nmq358IzXlx -k4edA5gEVduQkQEIAOjZV5tbpfIh5QefpIp2dpGMVfpgPj4RNc15CyFnb8y6dhCrdybkY9GveXJe -4F3GNYnSfB42cgxrfhizX3LakmZQ/SAg+YO5KxfCIN7Q9LPNeTgPsZZT6h8lVuXUxOFKXfRaR3/t -GF5xE3e5CoZRsHV/c92h3t1LdJNOnC5mUKIPO4zDxiw/C2T2q3rP1kmIMaOH724kEH5A+xcp1cBH -yt0tdHtIWuQv6joTJzujqViRhlCwQYzQSKpSBxwhBsorPvyinZI/ZXA4XXZc5RoMqV9rikedrb1r -ENO8JOuPu6tMS+znFu67skq2gFFZwCQWIjdHm+2ukE+PE580WAWudyMAEQEAAQAH/i7ndRPI+t0T -AdEu0dTIdyrrg3g7gd471kQtIVZZwTYSy2yhNY/Ciu72s3ab8QNCxY8dNL5bRk8FKjHslAoNSFdO -8iZSLiDgIHOZOcjYe6pqdgQaeTHodm1Otrn2SbB+K/3oX6W/y1xe18aSojGba/nHMj5PeJbIN9Pi -jmh0WMLD/0rmkTTxR7qQ5+kMV4O29xY4qjdYRD5O0adeZX0mNncmlmQ+rX9yxrtSgFROu1jwVtfP -hcNetifTTshJnTwND8hux5ECEadlIVBHypW28Hth9TRBXmddTmv7L7mdtUO6DybgkpWpw4k4LPsk -uZ6aY4wcGRp7EVfWGr9NHbq/n+0EAOlhDXIGdylkQsndjBMyhPsXZa5fFBmOyHjXj733195Jgr1v -ZjaIomrA9cvYrmN75oKrG1jJsMEl6HfC/ZPzEj6E51/p1PRdHP7CdUUA+DG8x4M3jn+e43psVuAR -a1XbN+8/bOa0ubt7ljVPjAEvWRSvU9dRaQz93w3fduAuM07dBAD/ayK3e0d6JMJMrU50lNOXQBgL -rFbg4rWzPO9BJQdhjOhmOZQiUa1Q+EV+s95yIUg1OAfaMP9KRIljr5RCdGNS6WoMNBAQOSrZpelf -jW4NpzphNfWDGVkUoPoskVtJz/nu9d860dGd3Al0kSmtUpMu5QKlo+sSxXUPbWLUn8V9/wP/ScCW -H+0gtL4R7SFazPeTIP+Cu5oR7A/DlFVLJKa3vo+atkhSvwxHGbg04vb/W4mKhGGVtMBtlhRmaWOe -PhUulU5FdaYsdlpN/Yd+hhgU6NHlyImPGVEHWD8c6CG8qoZfpR33j2sqshs4i/MtJZeBvl62vxPn -9bDN7KAjFNll9axAjIkCPgQYAQIACQUCVduQkQIbLgEpCRDrgyxn616JV8BdIAQZAQIABgUCVduQ -kQAKCRArYtevdF38xtzgB/4zVzozBpVOnagRkA7FDsHo36xX60Lik+ew0m28ueDDhnV3bXQsCvn/ -6wiCVWqLOTDeYCPlyTTpEMyk8zwdCICW6MgSkVHWcEDOrRqIrqm86rirjTGjJSgQe3l4CqJvkn6j -ybShYoBk1OZZV6vVv9hPTXXv9E6dLKoEW5YZBrrF+VC0w1iOIvaAQ+QXph20eV4KBIrp/bhG6Pdn -igKxuBZ79cdqDnXIzT9UiIa6LYpR0rbeg+7BmuZTTPS8t+41hIiKS+UZFdKa67eYENtyOmEMWOFC -LLRJGxkleukchiMJ70rknloZXsvJIweXBzSZ6m7mJQBgaig/L/dXyjv6+j2pNB4H/1trYUtJjXQK -HmqlgCmpCkHt3g7JoxWvglnDNmE6q3hIWuVIYQpnzZy1g05+X9Egwc1WVpBB02H7PkUZTfpaP/L6 -DLneMmSKPhZE3I+lPIPjwrxqh6xy5uQezcWkJTNKvPWF4FJzrVvx7XTPjfGvOB0UPEnjvtZTp5yO -hTeZK7DgIEtb/Wcrqs+iRArQKboM930ORSZhwvGK3F9V/gMDpIrvge5vDFsTEYQdw/2epIewH0L/ -FUb/6jBRcVEpGo9Ayg+Jnhq14GOGcd1y9oMZ48kYVLVBTA9tQ+82WE8Bch7uFPj4MFOMVRn1dc3q -dXlg3mimA+iK7tABQfG0RJ9YzWs=` - - TestPrivKey3 = `lQOXBFXbkiMBCACiHW4/VI2JkfvSEINddS7vE6wEu5e1leNQDaLUh6PrATQZS2a4Q6kRE6WlJumj -6wCeN753Cm93UGQl2Bi3USIEeArIZnPTcocrckOVXxtoLBNKXgqKvEsDXgfw8A+doSfXoDm/3Js4 -Wy3WsYKNR9LaPuJZHnpjsFAJhvRVyhH4UFD+1RTSSefq1mozPfDdMoZeZNEpfhwt3DuTJs7RqcTH -CgR2CqhEHnOOE5jJUljHKYLCglE2+8dth1bZlQi4xly/VHZzP3Bn7wKeolK/ROP6VZz/e0xq/BKy -resmxvlBWZ1zWwqGIrV9b0uwYvGrh2hOd5C5+5oGaA2MGcjxwaLBABEBAAEAB/dQbElFIa0VklZa -39ZLhtbBxACSWH3ql3EtRZaB2Mh4zSALbFyJDQfScOy8AZHmv66Ozxit9X9WsYr9OzcHujgl/2da -A3lybF6iLw1YDNaL11G6kuyn5sFP6lYGMRGOIWSik9oSVF6slo8m8ujRLdBsdMXVcElHKzCJiWmt -JZHEnUkl9X96fIPajMBfWjHHwcaeMOc77nvjwqy5wC4EY8TSVYzxeZHL7DADQ0EHBcThlmfizpCq -26LMVb6ju8STH7uDDFyKmhr/hC2vOkt+PKsvBCmW8/ESanO1zKPD9cvSsOWr2rZWNnkDRftqzOU5 -OCrI+3o9E74+toNb07bPntEEAMEStOzSvqZ6NKdh7EZYPA4mkkFC+EiHYIoinP1sd9V8O2Hq+dzx -yFHtWu0LmP6uWXk45vsP9y1UMJcEa33ew5JJa7zgucI772/BNvd/Oys/PqwIAl6uNIY8uYLgmn4L -1IPatp7vDiXzZSivPZd4yN4S4zCypZp9cnpO3qv8q7CtBADW87IA0TabdoxiN+m4XL7sYDRIfglr -MRPAlfrkAUaGDBx/t1xb6IaKk7giFdwHpTI6+g9XNkqKqogMe4Fp+nsd1xtfsNUBn6iKZavm5kXe -Lp9QgE+K6mvIreOTe2PKQqXqgPRG6+SRGatoKeY76fIpd8AxOJyWERxcq2lUHLn45QP/UXDTcYB7 -gzJtZrfpXN0GqQ0lYXMzbQfLnkUsu3mYzArfNy0otzEmKTkwmKclNY1/EJSzSdHfgmeA260a0nLK -64C0wPgSmOqw90qwi5odAYSjSFBapDbyGF86JpHrLxyEEpGoXanRPwWfbiWp19Nwg6nknA87AtaM -3+AHjbWzwCpHL7QQVmF1bHQgVGVzdCBLZXkgM4kBOAQTAQIAIgUCVduSIwIbLwYLCQgHAwIGFQgC -CQoLBBYCAwECHgECF4AACgkQ9HlLVvwtxt1aMQf/aaGoL1rRWTUjM6DEShXFhWpV29rEjSdNk5N+ -ZwVifgdCVD5IsSjI1Z7mO2SHHiTm4eKnHAofM6/TZgzXg1YLpu8rDYJARMsM8bgK/xgxSamGjm2c -wN220jOnwePIlG0drNTW5N6zb/K6qHoscJ6NUkjS5JPdGJuq7B0bdCM8/xSbG75gL34U5bYqK38B -DwmW4UMl2rf/BJfxV9hmsZ2Cat4TspgyiWEKTMZI+PugXKDDwuoqgm+320K4EqFkwG4y/WwHkKgk -hZ0+io5lzhTsvVd2p8q8VlH9GG5eA3WWQj0yqucsOmKQvcuT5y0vFY6NQJbyuioqgdlgEXtc+p0B -+Z0DmARV25IjAQgA49yN3hCBsuWoiTezoE9FHJXOCVOBR1/4jStQPJtoMl8mhtl3xTp7iGQ+9GhD -y0l5+fP+qcP/rfBq0BslhxVOZ7jQjdUoM6ZUZzJoPGIo/V2KwqpwQl3tdCIjvagCJeYQfTL7lTCc -4ySz+XBoAYMwZVGMcRcjp+JE8Wx9Ovzuq8wnelbU6I5dVJ7O4E1OWbIkLuytDX+fDEvfft6/oPXN -Bl3cm6FzEuQetQQss3DOG9xnvS+DrjmMCbPwR2a++ioQ8+geoqA/kB4cAI6xOb3ncoeGDHc1i4Y9 -T9Ggi+6Aq3girmfDtNYVOM8cZUXcZNCvLkJn8DNeIvnuFUSEO+a5PwARAQABAAf/TPd98CmRNdV/ -VUI8aYT9Kkervdi4DVzsfvrHcoFn88PSJrCkVTmI6qw526Kwa6VZD0YMmll7LszLt5nD1lorDrwN -rir3FmMzlVwge20IvXRwX4rkunYxtA2oFvL+LsEEhtXGx0ERbWRDapk+eGxQ15hxIO4Y/Cdg9E+a -CWfQUrTSnC6qMVfVYMGfnM1yNX3OWattEFfmxQas5XqQk/0FgjCZALixdanjN/r1tjp5/2MiSD8N -Wkemzsr6yPicnc3+BOZc5YOOnH8FqBvVHcDlSJI6pCOCEiO3Pq2QEk/1evONulbF116mLnQoGrpp -W77l+5O42VUpZfjROCPd5DYyMQQA492CFXZpDIJ2emB9/nK8X6IzdVRK3oof8btbSNnme5afIzhs -wR1ruX30O7ThfB+5ezpbgK1C988CWkr9SNSTy43omarafGig6/Y1RzdiITILuIGfbChoSpc70jXx -U0nzJ/1i9yZ/vDgP3EC2miRhlDcp5w0Bu0oMBlgG/1uhj0cEAP/+7aFGP0fo2MZPhyl5feHKWj4k -85XoAIpMBnzF6HTGU3ljAE56a+4sVw3bWB755DPhvpZvDkX60I9iIJxio8TK5ITdfjlLhxuskXyt -ycwWI/4J+soeq4meoxK9jxZJuDl/qvoGfyzNg1oy2OBehX8+6erW46kr6Z/MQutS3zJJBACmJHrK -VR40qD7a8KbvfuM3ruwlm5JqT/Ykq1gfKKxHjWDIUIeyBX/axGQvAGNYeuuQCzZ0+QsEWur3C4kN -U+Pb5K1WGyOKkhJzivSI56AG3d8TA/Q0JhqST6maY0fvUoahWSCcpd7MULa3n1zx5Wsvi8mkVtup -Js/IDi/kqneqM0XviQI+BBgBAgAJBQJV25IjAhsuASkJEPR5S1b8LcbdwF0gBBkBAgAGBQJV25Ij -AAoJEAUj/03Hcrkg84UIAKxn9nizYtwSgDnVNb5PnD5h6+Ui6r7ffYm2o0im4YhakbFTHIPI9PRh -BavRI5sE5Fg2vtE/x38jattoUrJoNoq9Gh9iv5PBfL3amEGjul0RRqYGl+ub+yv7YGAAHbHcdZen -4gx15VWGpB7y3hycWbdzV8h3EAPKIm5XmB7YyXmArnI3CoJA+HtTZGoL6WZWUwka9YichGfaZ/oD -umENg1l87Pp2RqvjLKHmv2tGCtnDzyv/IiWur9zopFQiCc8ysVgRq6CA5x5nzbv6MqRspYUS4e2I -LFbuREA3blR+caw9oX41IYzarW8IbgeIXJ3HqUyhczRKF/z5nDKtX/kHMCqlbAgAnfu0TALnwVuj -KeXLo4Y7OA9LTEqfORcw62q5OjSoQf/VsRSwGSefv3kGZk5N/igELluU3qpG/twZI/TSL6zGqXU2 -FOMlyMm1849TOB9b4B//4dHrjzPhztzowKMMUqeTxmSgYtFTshKN6eQ0XO+7ZuOXEmSKXS4kOUs9 -ttfzSiPNXUZL2D5nFU9H7rw3VAuXYVTrOx+Dfi6mYsscbxUbi8THODI2Q7B9Ni92DJE1OOe4+57o -fXZ9ln24I14bna/uVHd6hBwLEE6eLCCKkHxQnnZFZduXDHMK0a0OL8RYHfMtNSem4pyC5wDQui1u -KFIzGEPKVoBF9U7VBXpyxpsz+A==` - - TestPubKey1 = `mQENBFXbjPUBCADjNjCUQwfxKL+RR2GA6pv/1K+zJZ8UWIF9S0lk7cVIEfJiprzzwiMwBS5cD0da -rGin1FHvIWOZxujA7oW0O2TUuatqI3aAYDTfRYurh6iKLC+VS+F7H+/mhfFvKmgr0Y5kDCF1j0T/ -063QZ84IRGucR/X43IY7kAtmxGXH0dYOCzOe5UBX1fTn3mXGe2ImCDWBH7gOViynXmb6XNvXkP0f -sF5St9jhO7mbZU9EFkv9O3t3EaURfHopsCVDOlCkFCw5ArY+DUORHRzoMX0PnkyQb5OzibkChzpg -8hQssKeVGpuskTdz5Q7PtdW71jXd4fFVzoNH8fYwRpziD2xNvi6HABEBAAG0EFZhdWx0IFRlc3Qg -S2V5IDGJATgEEwECACIFAlXbjPUCGy8GCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEOfLr44B -HbeTo+sH/i7bapIgPnZsJ81hmxPj4W12uvunksGJiC7d4hIHsG7kmJRTJfjECi+AuTGeDwBy84TD -cRaOB6e79fj65Fg6HgSahDUtKJbGxj/lWzmaBuTzlN3CEe8cMwIPqPT2kajJVdOyrvkyuFOdPFOE -A7bdCH0MqgIdM2SdF8t40k/ATfuD2K1ZmumJ508I3gF39jgTnPzD4C8quswrMQ3bzfvKC3klXRlB -C0yoArn+0QA3cf2B9T4zJ2qnvgotVbeK/b1OJRNj6Poeo+SsWNc/A5mw7lGScnDgL3yfwCm1gQXa -QKfOt5x+7GqhWDw10q+bJpJlI10FfzAnhMF9etSqSeURBRW5AQ0EVduM9QEIAL53hJ5bZJ7oEDCn -aY+SCzt9QsAfnFTAnZJQrvkvusJzrTQ088eUQmAjvxkfRqnv981fFwGnh2+I1Ktm698UAZS9Jt8y -jak9wWUICKQO5QUt5k8cHwldQXNXVXFa+TpQWQR5yW1a9okjh5o/3d4cBt1yZPUJJyLKY43Wvptb -6EuEsScO2DnRkh5wSMDQ7dTooddJCmaq3LTjOleRFQbu9ij386Do6jzK69mJU56TfdcydkxkWF5N -ZLGnED3lq+hQNbe+8UI5tD2oP/3r5tXKgMy1R/XPvR/zbfwvx4FAKFOP01awLq4P3d/2xOkMu4Lu -9p315E87DOleYwxk+FoTqXEAEQEAAYkCPgQYAQIACQUCVduM9QIbLgEpCRDny6+OAR23k8BdIAQZ -AQIABgUCVduM9QAKCRAID0JGyHtSGmqYB/4m4rJbbWa7dBJ8VqRU7ZKnNRDR9CVhEGipBmpDGRYu -lEimOPzLUX/ZXZmTZzgemeXLBaJJlWnopVUWuAsyjQuZAfdd8nHkGRHG0/DGum0l4sKTta3OPGHN -C1z1dAcQ1RCr9bTD3PxjLBczdGqhzw71trkQRBRdtPiUchltPMIyjUHqVJ0xmg0hPqFic0fICsr0 -YwKoz3h9+QEcZHvsjSZjgydKvfLYcm+4DDMCCqcHuJrbXJKUWmJcXR0y/+HQONGrGJ5xWdO+6eJi -oPn2jVMnXCm4EKc7fcLFrz/LKmJ8seXhxjM3EdFtylBGCrx3xdK0f+JDNQaC/rhUb5V2XuX6VwoH -/AtY+XsKVYRfNIupLOUcf/srsm3IXT4SXWVomOc9hjGQiJ3rraIbADsc+6bCAr4XNZS7moViAAcI -PXFv3m3WfUlnG/om78UjQqyVACRZqqAGmuPq+TSkRUCpt9h+A39LQWkojHqyob3cyLgy6z9Q557O -9uK3lQozbw2gH9zC0RqnePl+rsWIUU/ga16fH6pWc1uJiEBt8UZGypQ/E56/343epmYAe0a87sHx -8iDV+dNtDVKfPRENiLOOc19MmS+phmUyrbHqI91c0pmysYcJZCD3a502X1gpjFbPZcRtiTmGnUKd -OIu60YPNE4+h7u2CfYyFPu3AlUaGNMBlvy6PEpU=` - - TestPubKey2 = `mQENBFXbkJEBCADKb1ZvlT14XrJa2rTOe5924LQr2PTZlRv+651TXy33yEhelZ+V4sMrELN8fKEG -Zy1kNixmbq3MCF/671k3LigHA7VrOaH9iiQgr6IIq2MeIkUYKZ27C992vQkYLjbYUG8+zl5h69S4 -0Ixm0yL0M54XOJ0gm+maEK1ZESKTUlDNkIS7l0jLZSYwfUeGXSEt6FWs8OgbyRTaHw4PDHrDEE9e -Q67K6IZ3YMhPOL4fVk4Jwrp5R/RwiklT+lNozWEyFVwPFH4MeQMs9nMbt+fWlTzEA7tI4acI9yDk -Cm1yN2R9rmY0UjODRiJw6z6sLV2T+Pf32n3MNSUOYczOjZa4VBwjABEBAAG0EFZhdWx0IFRlc3Qg -S2V5IDKJATgEEwECACIFAlXbkJECGy8GCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEOuDLGfr -XolXqz4H/28IuoRxGKoJ064YHjPkkpoddW6zdzzNfHipZnNfEUiTEls4qF1IB81M2xqfiXIFRIdO -2kaLkRPFhO0hRxbtI6VuZYLgG3QCaXhxW6GyFa5zKABqhb5ojexdnAYRswaHV201ZCclj9rnJN1P -Ag0Rz6MdX/w1euEWktQxWKo42oZKyx8oT9p6lrv5KRmGkdrg8K8ARmRILjmwuBAgJM0eXBZHNGWX -elk4YmOgnAAcZA6ZAo1G+8Pg6pKKP61ETewuCg3/u7N0vDttB+ZXqF88W9jAYlvdgbTtajNF5IDY -DjTzWfeCaIB18F9gOzXq15SwWeDDI+CU9Nmq358IzXlxk4e5AQ0EVduQkQEIAOjZV5tbpfIh5Qef -pIp2dpGMVfpgPj4RNc15CyFnb8y6dhCrdybkY9GveXJe4F3GNYnSfB42cgxrfhizX3LakmZQ/SAg -+YO5KxfCIN7Q9LPNeTgPsZZT6h8lVuXUxOFKXfRaR3/tGF5xE3e5CoZRsHV/c92h3t1LdJNOnC5m -UKIPO4zDxiw/C2T2q3rP1kmIMaOH724kEH5A+xcp1cBHyt0tdHtIWuQv6joTJzujqViRhlCwQYzQ -SKpSBxwhBsorPvyinZI/ZXA4XXZc5RoMqV9rikedrb1rENO8JOuPu6tMS+znFu67skq2gFFZwCQW -IjdHm+2ukE+PE580WAWudyMAEQEAAYkCPgQYAQIACQUCVduQkQIbLgEpCRDrgyxn616JV8BdIAQZ -AQIABgUCVduQkQAKCRArYtevdF38xtzgB/4zVzozBpVOnagRkA7FDsHo36xX60Lik+ew0m28ueDD -hnV3bXQsCvn/6wiCVWqLOTDeYCPlyTTpEMyk8zwdCICW6MgSkVHWcEDOrRqIrqm86rirjTGjJSgQ -e3l4CqJvkn6jybShYoBk1OZZV6vVv9hPTXXv9E6dLKoEW5YZBrrF+VC0w1iOIvaAQ+QXph20eV4K -BIrp/bhG6PdnigKxuBZ79cdqDnXIzT9UiIa6LYpR0rbeg+7BmuZTTPS8t+41hIiKS+UZFdKa67eY -ENtyOmEMWOFCLLRJGxkleukchiMJ70rknloZXsvJIweXBzSZ6m7mJQBgaig/L/dXyjv6+j2pNB4H -/1trYUtJjXQKHmqlgCmpCkHt3g7JoxWvglnDNmE6q3hIWuVIYQpnzZy1g05+X9Egwc1WVpBB02H7 -PkUZTfpaP/L6DLneMmSKPhZE3I+lPIPjwrxqh6xy5uQezcWkJTNKvPWF4FJzrVvx7XTPjfGvOB0U -PEnjvtZTp5yOhTeZK7DgIEtb/Wcrqs+iRArQKboM930ORSZhwvGK3F9V/gMDpIrvge5vDFsTEYQd -w/2epIewH0L/FUb/6jBRcVEpGo9Ayg+Jnhq14GOGcd1y9oMZ48kYVLVBTA9tQ+82WE8Bch7uFPj4 -MFOMVRn1dc3qdXlg3mimA+iK7tABQfG0RJ9YzWs=` - - TestPubKey3 = `mQENBFXbkiMBCACiHW4/VI2JkfvSEINddS7vE6wEu5e1leNQDaLUh6PrATQZS2a4Q6kRE6WlJumj -6wCeN753Cm93UGQl2Bi3USIEeArIZnPTcocrckOVXxtoLBNKXgqKvEsDXgfw8A+doSfXoDm/3Js4 -Wy3WsYKNR9LaPuJZHnpjsFAJhvRVyhH4UFD+1RTSSefq1mozPfDdMoZeZNEpfhwt3DuTJs7RqcTH -CgR2CqhEHnOOE5jJUljHKYLCglE2+8dth1bZlQi4xly/VHZzP3Bn7wKeolK/ROP6VZz/e0xq/BKy -resmxvlBWZ1zWwqGIrV9b0uwYvGrh2hOd5C5+5oGaA2MGcjxwaLBABEBAAG0EFZhdWx0IFRlc3Qg -S2V5IDOJATgEEwECACIFAlXbkiMCGy8GCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEPR5S1b8 -LcbdWjEH/2mhqC9a0Vk1IzOgxEoVxYVqVdvaxI0nTZOTfmcFYn4HQlQ+SLEoyNWe5jtkhx4k5uHi -pxwKHzOv02YM14NWC6bvKw2CQETLDPG4Cv8YMUmpho5tnMDdttIzp8HjyJRtHazU1uTes2/yuqh6 -LHCejVJI0uST3RibquwdG3QjPP8Umxu+YC9+FOW2Kit/AQ8JluFDJdq3/wSX8VfYZrGdgmreE7KY -MolhCkzGSPj7oFygw8LqKoJvt9tCuBKhZMBuMv1sB5CoJIWdPoqOZc4U7L1XdqfKvFZR/RhuXgN1 -lkI9MqrnLDpikL3Lk+ctLxWOjUCW8roqKoHZYBF7XPqdAfm5AQ0EVduSIwEIAOPcjd4QgbLlqIk3 -s6BPRRyVzglTgUdf+I0rUDybaDJfJobZd8U6e4hkPvRoQ8tJefnz/qnD/63watAbJYcVTme40I3V -KDOmVGcyaDxiKP1disKqcEJd7XQiI72oAiXmEH0y+5UwnOMks/lwaAGDMGVRjHEXI6fiRPFsfTr8 -7qvMJ3pW1OiOXVSezuBNTlmyJC7srQ1/nwxL337ev6D1zQZd3JuhcxLkHrUELLNwzhvcZ70vg645 -jAmz8EdmvvoqEPPoHqKgP5AeHACOsTm953KHhgx3NYuGPU/RoIvugKt4Iq5nw7TWFTjPHGVF3GTQ -ry5CZ/AzXiL57hVEhDvmuT8AEQEAAYkCPgQYAQIACQUCVduSIwIbLgEpCRD0eUtW/C3G3cBdIAQZ -AQIABgUCVduSIwAKCRAFI/9Nx3K5IPOFCACsZ/Z4s2LcEoA51TW+T5w+YevlIuq+332JtqNIpuGI -WpGxUxyDyPT0YQWr0SObBORYNr7RP8d/I2rbaFKyaDaKvRofYr+TwXy92phBo7pdEUamBpfrm/sr -+2BgAB2x3HWXp+IMdeVVhqQe8t4cnFm3c1fIdxADyiJuV5ge2Ml5gK5yNwqCQPh7U2RqC+lmVlMJ -GvWInIRn2mf6A7phDYNZfOz6dkar4yyh5r9rRgrZw88r/yIlrq/c6KRUIgnPMrFYEauggOceZ827 -+jKkbKWFEuHtiCxW7kRAN25UfnGsPaF+NSGM2q1vCG4HiFydx6lMoXM0Shf8+ZwyrV/5BzAqpWwI -AJ37tEwC58Fboynly6OGOzgPS0xKnzkXMOtquTo0qEH/1bEUsBknn795BmZOTf4oBC5blN6qRv7c -GSP00i+sxql1NhTjJcjJtfOPUzgfW+Af/+HR648z4c7c6MCjDFKnk8ZkoGLRU7ISjenkNFzvu2bj -lxJkil0uJDlLPbbX80ojzV1GS9g+ZxVPR+68N1QLl2FU6zsfg34upmLLHG8VG4vExzgyNkOwfTYv -dgyRNTjnuPue6H12fZZ9uCNeG52v7lR3eoQcCxBOniwgipB8UJ52RWXblwxzCtGtDi/EWB3zLTUn -puKcgucA0LotbihSMxhDylaARfVO1QV6csabM/g=` - - TestAAPubKey1 = `-----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mQENBFXbjPUBCADjNjCUQwfxKL+RR2GA6pv/1K+zJZ8UWIF9S0lk7cVIEfJiprzz -wiMwBS5cD0darGin1FHvIWOZxujA7oW0O2TUuatqI3aAYDTfRYurh6iKLC+VS+F7 -H+/mhfFvKmgr0Y5kDCF1j0T/063QZ84IRGucR/X43IY7kAtmxGXH0dYOCzOe5UBX -1fTn3mXGe2ImCDWBH7gOViynXmb6XNvXkP0fsF5St9jhO7mbZU9EFkv9O3t3EaUR -fHopsCVDOlCkFCw5ArY+DUORHRzoMX0PnkyQb5OzibkChzpg8hQssKeVGpuskTdz -5Q7PtdW71jXd4fFVzoNH8fYwRpziD2xNvi6HABEBAAG0EFZhdWx0IFRlc3QgS2V5 -IDGJATgEEwECACIFAlXbjPUCGy8GCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJ -EOfLr44BHbeTo+sH/i7bapIgPnZsJ81hmxPj4W12uvunksGJiC7d4hIHsG7kmJRT -JfjECi+AuTGeDwBy84TDcRaOB6e79fj65Fg6HgSahDUtKJbGxj/lWzmaBuTzlN3C -Ee8cMwIPqPT2kajJVdOyrvkyuFOdPFOEA7bdCH0MqgIdM2SdF8t40k/ATfuD2K1Z -mumJ508I3gF39jgTnPzD4C8quswrMQ3bzfvKC3klXRlBC0yoArn+0QA3cf2B9T4z -J2qnvgotVbeK/b1OJRNj6Poeo+SsWNc/A5mw7lGScnDgL3yfwCm1gQXaQKfOt5x+ -7GqhWDw10q+bJpJlI10FfzAnhMF9etSqSeURBRW5AQ0EVduM9QEIAL53hJ5bZJ7o -EDCnaY+SCzt9QsAfnFTAnZJQrvkvusJzrTQ088eUQmAjvxkfRqnv981fFwGnh2+I -1Ktm698UAZS9Jt8yjak9wWUICKQO5QUt5k8cHwldQXNXVXFa+TpQWQR5yW1a9okj -h5o/3d4cBt1yZPUJJyLKY43Wvptb6EuEsScO2DnRkh5wSMDQ7dTooddJCmaq3LTj -OleRFQbu9ij386Do6jzK69mJU56TfdcydkxkWF5NZLGnED3lq+hQNbe+8UI5tD2o -P/3r5tXKgMy1R/XPvR/zbfwvx4FAKFOP01awLq4P3d/2xOkMu4Lu9p315E87DOle -Ywxk+FoTqXEAEQEAAYkCPgQYAQIACQUCVduM9QIbLgEpCRDny6+OAR23k8BdIAQZ -AQIABgUCVduM9QAKCRAID0JGyHtSGmqYB/4m4rJbbWa7dBJ8VqRU7ZKnNRDR9CVh -EGipBmpDGRYulEimOPzLUX/ZXZmTZzgemeXLBaJJlWnopVUWuAsyjQuZAfdd8nHk -GRHG0/DGum0l4sKTta3OPGHNC1z1dAcQ1RCr9bTD3PxjLBczdGqhzw71trkQRBRd -tPiUchltPMIyjUHqVJ0xmg0hPqFic0fICsr0YwKoz3h9+QEcZHvsjSZjgydKvfLY -cm+4DDMCCqcHuJrbXJKUWmJcXR0y/+HQONGrGJ5xWdO+6eJioPn2jVMnXCm4EKc7 -fcLFrz/LKmJ8seXhxjM3EdFtylBGCrx3xdK0f+JDNQaC/rhUb5V2XuX6VwoH/AtY -+XsKVYRfNIupLOUcf/srsm3IXT4SXWVomOc9hjGQiJ3rraIbADsc+6bCAr4XNZS7 -moViAAcIPXFv3m3WfUlnG/om78UjQqyVACRZqqAGmuPq+TSkRUCpt9h+A39LQWko -jHqyob3cyLgy6z9Q557O9uK3lQozbw2gH9zC0RqnePl+rsWIUU/ga16fH6pWc1uJ -iEBt8UZGypQ/E56/343epmYAe0a87sHx8iDV+dNtDVKfPRENiLOOc19MmS+phmUy -rbHqI91c0pmysYcJZCD3a502X1gpjFbPZcRtiTmGnUKdOIu60YPNE4+h7u2CfYyF -Pu3AlUaGNMBlvy6PEpU= -=NUTS ------END PGP PUBLIC KEY BLOCK-----` -) diff --git a/vendor/github.com/jen20/awspolicyequivalence/README.md b/vendor/github.com/jen20/awspolicyequivalence/README.md deleted file mode 100644 index 3883faf..0000000 --- a/vendor/github.com/jen20/awspolicyequivalence/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## AWS Policy Equivalence Library - -This library checks for structural equivalence of two AWS policy documents. See Godoc for more information on usage. - -### CI - -Travis CI Build Status diff --git a/vendor/github.com/jen20/awspolicyequivalence/aws_policy_equivalence.go b/vendor/github.com/jen20/awspolicyequivalence/aws_policy_equivalence.go deleted file mode 100644 index 94a2ef0..0000000 --- a/vendor/github.com/jen20/awspolicyequivalence/aws_policy_equivalence.go +++ /dev/null @@ -1,377 +0,0 @@ -package awspolicy - -import ( - "encoding/json" - "errors" - "reflect" - "strings" - - "github.com/hashicorp/errwrap" - "github.com/mitchellh/mapstructure" -) - -// PoliciesAreEquivalent tests for the structural equivalence of two -// AWS policies. It does not read into the semantics, other than treating -// single element string arrays as equivalent to a string without an -// array, as the AWS endpoints do. -// -// It will, however, detect reordering and ignore whitespace. -// -// Returns true if the policies are structurally equivalent, false -// otherwise. If either of the input strings are not valid JSON, -// false is returned along with an error. -func PoliciesAreEquivalent(policy1, policy2 string) (bool, error) { - policy1intermediate := &intermediateAwsPolicyDocument{} - if err := json.Unmarshal([]byte(policy1), policy1intermediate); err != nil { - return false, errwrap.Wrapf("Error unmarshaling policy: {{err}}", err) - } - - policy2intermediate := &intermediateAwsPolicyDocument{} - if err := json.Unmarshal([]byte(policy2), policy2intermediate); err != nil { - return false, errwrap.Wrapf("Error unmarshaling policy: {{err}}", err) - } - - policy1Doc, err := policy1intermediate.document() - if err != nil { - return false, errwrap.Wrapf("Error parsing policy: {{err}}", err) - } - policy2Doc, err := policy2intermediate.document() - if err != nil { - return false, errwrap.Wrapf("Error parsing policy: {{err}}", err) - } - - return policy1Doc.equals(policy2Doc), nil -} - -type intermediateAwsPolicyDocument struct { - Version string `json:",omitempty"` - Id string `json:",omitempty"` - Statements interface{} `json:"Statement"` -} - -func (intermediate *intermediateAwsPolicyDocument) document() (*awsPolicyDocument, error) { - var statements []*awsPolicyStatement - - switch s := intermediate.Statements.(type) { - case []interface{}: - if err := mapstructure.Decode(s, &statements); err != nil { - return nil, errwrap.Wrapf("Error parsing statement: {{err}}", err) - } - case map[string]interface{}: - var singleStatement *awsPolicyStatement - if err := mapstructure.Decode(s, &singleStatement); err != nil { - return nil, errwrap.Wrapf("Error parsing statement: {{err}}", err) - } - statements = append(statements, singleStatement) - default: - return nil, errors.New("Unknown error parsing statement") - } - - document := &awsPolicyDocument{ - Version: intermediate.Version, - Id: intermediate.Id, - Statements: statements, - } - - return document, nil -} - -type awsPolicyDocument struct { - Version string - Id string - Statements []*awsPolicyStatement -} - -func (doc *awsPolicyDocument) equals(other *awsPolicyDocument) bool { - // Check the basic fields of the document - if doc.Version != other.Version { - return false - } - if doc.Id != other.Id { - return false - } - - // If we have different number of statements we are very unlikely - // to have them be equivalent. - if len(doc.Statements) != len(other.Statements) { - return false - } - - // If we have the same number of statements in the policy, does - // each statement in the intermediate have a corresponding statement in - // other which is equal? If no, policies are not equal, if yes, - // then they may be. - for _, ours := range doc.Statements { - found := false - for _, theirs := range other.Statements { - if ours.equals(theirs) { - found = true - } - } - - if !found { - return false - } - } - - // Now we need to repeat this process the other way around to - // ensure we don't have any matching errors. - for _, theirs := range other.Statements { - found := false - for _, ours := range doc.Statements { - if theirs.equals(ours) { - found = true - } - } - - if !found { - return false - } - } - - return true -} - -type awsPolicyStatement struct { - Sid string `json:",omitempty" mapstructure:"Sid"` - Effect string `json:",omitempty" mapstructure:"Effect"` - Actions interface{} `json:"Action,omitempty" mapstructure:"Action"` - NotActions interface{} `json:"NotAction,omitempty" mapstructure:"NotAction"` - Resources interface{} `json:"Resource,omitempty" mapstructure:"Resource"` - NotResources interface{} `json:"NotResource,omitempty" mapstructure:"NotResource"` - Principals interface{} `json:"Principal,omitempty" mapstructure:"Principal"` - NotPrincipals interface{} `json:"NotPrincipal,omitempty" mapstructure:"NotPrincipal"` - Conditions map[string]map[string]interface{} `json:"Condition,omitempty" mapstructure:"Condition"` -} - -func (statement *awsPolicyStatement) equals(other *awsPolicyStatement) bool { - if statement.Sid != other.Sid { - return false - } - - if strings.ToLower(statement.Effect) != strings.ToLower(other.Effect) { - return false - } - - ourActions := newAWSStringSet(statement.Actions) - theirActions := newAWSStringSet(other.Actions) - if !ourActions.equals(theirActions) { - return false - } - - ourNotActions := newAWSStringSet(statement.NotActions) - theirNotActions := newAWSStringSet(other.NotActions) - if !ourNotActions.equals(theirNotActions) { - return false - } - - ourResources := newAWSStringSet(statement.Resources) - theirResources := newAWSStringSet(other.Resources) - if !ourResources.equals(theirResources) { - return false - } - - ourNotResources := newAWSStringSet(statement.NotResources) - theirNotResources := newAWSStringSet(other.NotResources) - if !ourNotResources.equals(theirNotResources) { - return false - } - - ourConditionsBlock := awsConditionsBlock(statement.Conditions) - theirConditionsBlock := awsConditionsBlock(other.Conditions) - if !ourConditionsBlock.Equals(theirConditionsBlock) { - return false - } - - if statement.Principals != nil || other.Principals != nil { - stringPrincipalsEqual := stringPrincipalsEqual(statement.Principals, other.Principals) - mapPrincipalsEqual := mapPrincipalsEqual(statement.Principals, other.Principals) - if !(stringPrincipalsEqual || mapPrincipalsEqual) { - return false - } - } - - if statement.NotPrincipals != nil || other.NotPrincipals != nil { - stringNotPrincipalsEqual := stringPrincipalsEqual(statement.NotPrincipals, other.NotPrincipals) - mapNotPrincipalsEqual := mapPrincipalsEqual(statement.NotPrincipals, other.NotPrincipals) - if !(stringNotPrincipalsEqual || mapNotPrincipalsEqual) { - return false - } - } - - return true -} - -func mapPrincipalsEqual(ours, theirs interface{}) bool { - ourPrincipalMap, ok := ours.(map[string]interface{}) - if !ok { - return false - } - - theirPrincipalMap, ok := theirs.(map[string]interface{}) - if !ok { - return false - } - - oursNormalized := make(map[string]awsStringSet) - for key, val := range ourPrincipalMap { - oursNormalized[key] = newAWSStringSet(val) - } - - theirsNormalized := make(map[string]awsStringSet) - for key, val := range theirPrincipalMap { - theirsNormalized[key] = newAWSStringSet(val) - } - - for key, ours := range oursNormalized { - theirs, ok := theirsNormalized[key] - if !ok { - return false - } - - if !ours.equals(theirs) { - return false - } - } - - for key, theirs := range theirsNormalized { - ours, ok := oursNormalized[key] - if !ok { - return false - } - - if !theirs.equals(ours) { - return false - } - } - - return true -} - -func stringPrincipalsEqual(ours, theirs interface{}) bool { - ourPrincipal, oursIsString := ours.(string) - theirPrincipal, theirsIsString := theirs.(string) - - if !(oursIsString && theirsIsString) { - return false - } - - if ourPrincipal == theirPrincipal { - return true - } - - return false -} - -type awsConditionsBlock map[string]map[string]interface{} - -func (conditions awsConditionsBlock) Equals(other awsConditionsBlock) bool { - if conditions == nil && other != nil || other == nil && conditions != nil { - return false - } - - if len(conditions) != len(other) { - return false - } - - oursNormalized := make(map[string]map[string]awsStringSet) - for key, condition := range conditions { - normalizedCondition := make(map[string]awsStringSet) - for innerKey, val := range condition { - normalizedCondition[innerKey] = newAWSStringSet(val) - } - oursNormalized[key] = normalizedCondition - } - - theirsNormalized := make(map[string]map[string]awsStringSet) - for key, condition := range other { - normalizedCondition := make(map[string]awsStringSet) - for innerKey, val := range condition { - normalizedCondition[innerKey] = newAWSStringSet(val) - } - theirsNormalized[key] = normalizedCondition - } - - for key, ours := range oursNormalized { - theirs, ok := theirsNormalized[key] - if !ok { - return false - } - - for innerKey, oursInner := range ours { - theirsInner, ok := theirs[innerKey] - if !ok { - return false - } - - if !oursInner.equals(theirsInner) { - return false - } - } - } - - for key, theirs := range theirsNormalized { - ours, ok := oursNormalized[key] - if !ok { - return false - } - - for innerKey, theirsInner := range theirs { - oursInner, ok := ours[innerKey] - if !ok { - return false - } - - if !theirsInner.equals(oursInner) { - return false - } - } - } - - return true -} - -type awsStringSet []string - -// newAWSStringSet constructs an awsStringSet from an interface{} - which -// may be nil, a single string, or []interface{} (each of which is a string). -// This corresponds with how structures come off the JSON unmarshaler -// without any custom encoding rules. -func newAWSStringSet(members interface{}) awsStringSet { - if members == nil { - return awsStringSet{} - } - - if single, ok := members.(string); ok { - return awsStringSet{single} - } - - if multiple, ok := members.([]interface{}); ok { - actions := make([]string, len(multiple)) - for i, action := range multiple { - actions[i] = action.(string) - } - return awsStringSet(actions) - } - - return nil -} - -func (actions awsStringSet) equals(other awsStringSet) bool { - if len(actions) != len(other) { - return false - } - - ourMap := map[string]struct{}{} - theirMap := map[string]struct{}{} - - for _, action := range actions { - ourMap[action] = struct{}{} - } - - for _, action := range other { - theirMap[action] = struct{}{} - } - - return reflect.DeepEqual(ourMap, theirMap) -} diff --git a/vendor/github.com/juju/ratelimit/LICENSE b/vendor/github.com/juju/ratelimit/LICENSE deleted file mode 100644 index ade9307..0000000 --- a/vendor/github.com/juju/ratelimit/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -All files in this repository are licensed as follows. If you contribute -to this repository, it is assumed that you license your contribution -under the same license unless you state otherwise. - -All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. - -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. diff --git a/vendor/github.com/juju/ratelimit/README.md b/vendor/github.com/juju/ratelimit/README.md deleted file mode 100644 index a0fdfe2..0000000 --- a/vendor/github.com/juju/ratelimit/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# ratelimit --- - import "github.com/juju/ratelimit" - -The ratelimit package provides an efficient token bucket implementation. See -http://en.wikipedia.org/wiki/Token_bucket. - -## Usage - -#### func Reader - -```go -func Reader(r io.Reader, bucket *Bucket) io.Reader -``` -Reader returns a reader that is rate limited by the given token bucket. Each -token in the bucket represents one byte. - -#### func Writer - -```go -func Writer(w io.Writer, bucket *Bucket) io.Writer -``` -Writer returns a writer that is rate limited by the given token bucket. Each -token in the bucket represents one byte. - -#### type Bucket - -```go -type Bucket struct { -} -``` - -Bucket represents a token bucket that fills at a predetermined rate. Methods on -Bucket may be called concurrently. - -#### func NewBucket - -```go -func NewBucket(fillInterval time.Duration, capacity int64) *Bucket -``` -NewBucket returns a new token bucket that fills at the rate of one token every -fillInterval, up to the given maximum capacity. Both arguments must be positive. -The bucket is initially full. - -#### func NewBucketWithQuantum - -```go -func NewBucketWithQuantum(fillInterval time.Duration, capacity, quantum int64) *Bucket -``` -NewBucketWithQuantum is similar to NewBucket, but allows the specification of -the quantum size - quantum tokens are added every fillInterval. - -#### func NewBucketWithRate - -```go -func NewBucketWithRate(rate float64, capacity int64) *Bucket -``` -NewBucketWithRate returns a token bucket that fills the bucket at the rate of -rate tokens per second up to the given maximum capacity. Because of limited -clock resolution, at high rates, the actual rate may be up to 1% different from -the specified rate. - -#### func (*Bucket) Rate - -```go -func (tb *Bucket) Rate() float64 -``` -Rate returns the fill rate of the bucket, in tokens per second. - -#### func (*Bucket) Take - -```go -func (tb *Bucket) Take(count int64) time.Duration -``` -Take takes count tokens from the bucket without blocking. It returns the time -that the caller should wait until the tokens are actually available. - -Note that if the request is irrevocable - there is no way to return tokens to -the bucket once this method commits us to taking them. - -#### func (*Bucket) TakeAvailable - -```go -func (tb *Bucket) TakeAvailable(count int64) int64 -``` -TakeAvailable takes up to count immediately available tokens from the bucket. It -returns the number of tokens removed, or zero if there are no available tokens. -It does not block. - -#### func (*Bucket) TakeMaxDuration - -```go -func (tb *Bucket) TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool) -``` -TakeMaxDuration is like Take, except that it will only take tokens from the -bucket if the wait time for the tokens is no greater than maxWait. - -If it would take longer than maxWait for the tokens to become available, it does -nothing and reports false, otherwise it returns the time that the caller should -wait until the tokens are actually available, and reports true. - -#### func (*Bucket) Wait - -```go -func (tb *Bucket) Wait(count int64) -``` -Wait takes count tokens from the bucket, waiting until they are available. - -#### func (*Bucket) WaitMaxDuration - -```go -func (tb *Bucket) WaitMaxDuration(count int64, maxWait time.Duration) bool -``` -WaitMaxDuration is like Wait except that it will only take tokens from the -bucket if it needs to wait for no greater than maxWait. It reports whether any -tokens have been removed from the bucket If no tokens have been removed, it -returns immediately. diff --git a/vendor/github.com/juju/ratelimit/ratelimit.go b/vendor/github.com/juju/ratelimit/ratelimit.go deleted file mode 100644 index 3ef32fb..0000000 --- a/vendor/github.com/juju/ratelimit/ratelimit.go +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3 with static-linking exception. -// See LICENCE file for details. - -// The ratelimit package provides an efficient token bucket implementation -// that can be used to limit the rate of arbitrary things. -// See http://en.wikipedia.org/wiki/Token_bucket. -package ratelimit - -import ( - "math" - "strconv" - "sync" - "time" -) - -// Bucket represents a token bucket that fills at a predetermined rate. -// Methods on Bucket may be called concurrently. -type Bucket struct { - startTime time.Time - capacity int64 - quantum int64 - fillInterval time.Duration - - // The mutex guards the fields following it. - mu sync.Mutex - - // avail holds the number of available tokens - // in the bucket, as of availTick ticks from startTime. - // It will be negative when there are consumers - // waiting for tokens. - avail int64 - availTick int64 -} - -// NewBucket returns a new token bucket that fills at the -// rate of one token every fillInterval, up to the given -// maximum capacity. Both arguments must be -// positive. The bucket is initially full. -func NewBucket(fillInterval time.Duration, capacity int64) *Bucket { - return NewBucketWithQuantum(fillInterval, capacity, 1) -} - -// rateMargin specifes the allowed variance of actual -// rate from specified rate. 1% seems reasonable. -const rateMargin = 0.01 - -// NewBucketWithRate returns a token bucket that fills the bucket -// at the rate of rate tokens per second up to the given -// maximum capacity. Because of limited clock resolution, -// at high rates, the actual rate may be up to 1% different from the -// specified rate. -func NewBucketWithRate(rate float64, capacity int64) *Bucket { - for quantum := int64(1); quantum < 1<<50; quantum = nextQuantum(quantum) { - fillInterval := time.Duration(1e9 * float64(quantum) / rate) - if fillInterval <= 0 { - continue - } - tb := NewBucketWithQuantum(fillInterval, capacity, quantum) - if diff := math.Abs(tb.Rate() - rate); diff/rate <= rateMargin { - return tb - } - } - panic("cannot find suitable quantum for " + strconv.FormatFloat(rate, 'g', -1, 64)) -} - -// nextQuantum returns the next quantum to try after q. -// We grow the quantum exponentially, but slowly, so we -// get a good fit in the lower numbers. -func nextQuantum(q int64) int64 { - q1 := q * 11 / 10 - if q1 == q { - q1++ - } - return q1 -} - -// NewBucketWithQuantum is similar to NewBucket, but allows -// the specification of the quantum size - quantum tokens -// are added every fillInterval. -func NewBucketWithQuantum(fillInterval time.Duration, capacity, quantum int64) *Bucket { - if fillInterval <= 0 { - panic("token bucket fill interval is not > 0") - } - if capacity <= 0 { - panic("token bucket capacity is not > 0") - } - if quantum <= 0 { - panic("token bucket quantum is not > 0") - } - return &Bucket{ - startTime: time.Now(), - capacity: capacity, - quantum: quantum, - avail: capacity, - fillInterval: fillInterval, - } -} - -// Wait takes count tokens from the bucket, waiting until they are -// available. -func (tb *Bucket) Wait(count int64) { - if d := tb.Take(count); d > 0 { - time.Sleep(d) - } -} - -// WaitMaxDuration is like Wait except that it will -// only take tokens from the bucket if it needs to wait -// for no greater than maxWait. It reports whether -// any tokens have been removed from the bucket -// If no tokens have been removed, it returns immediately. -func (tb *Bucket) WaitMaxDuration(count int64, maxWait time.Duration) bool { - d, ok := tb.TakeMaxDuration(count, maxWait) - if d > 0 { - time.Sleep(d) - } - return ok -} - -const infinityDuration time.Duration = 0x7fffffffffffffff - -// Take takes count tokens from the bucket without blocking. It returns -// the time that the caller should wait until the tokens are actually -// available. -// -// Note that if the request is irrevocable - there is no way to return -// tokens to the bucket once this method commits us to taking them. -func (tb *Bucket) Take(count int64) time.Duration { - d, _ := tb.take(time.Now(), count, infinityDuration) - return d -} - -// TakeMaxDuration is like Take, except that -// it will only take tokens from the bucket if the wait -// time for the tokens is no greater than maxWait. -// -// If it would take longer than maxWait for the tokens -// to become available, it does nothing and reports false, -// otherwise it returns the time that the caller should -// wait until the tokens are actually available, and reports -// true. -func (tb *Bucket) TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool) { - return tb.take(time.Now(), count, maxWait) -} - -// TakeAvailable takes up to count immediately available tokens from the -// bucket. It returns the number of tokens removed, or zero if there are -// no available tokens. It does not block. -func (tb *Bucket) TakeAvailable(count int64) int64 { - return tb.takeAvailable(time.Now(), count) -} - -// takeAvailable is the internal version of TakeAvailable - it takes the -// current time as an argument to enable easy testing. -func (tb *Bucket) takeAvailable(now time.Time, count int64) int64 { - if count <= 0 { - return 0 - } - tb.mu.Lock() - defer tb.mu.Unlock() - - tb.adjust(now) - if tb.avail <= 0 { - return 0 - } - if count > tb.avail { - count = tb.avail - } - tb.avail -= count - return count -} - -// Available returns the number of available tokens. It will be negative -// when there are consumers waiting for tokens. Note that if this -// returns greater than zero, it does not guarantee that calls that take -// tokens from the buffer will succeed, as the number of available -// tokens could have changed in the meantime. This method is intended -// primarily for metrics reporting and debugging. -func (tb *Bucket) Available() int64 { - return tb.available(time.Now()) -} - -// available is the internal version of available - it takes the current time as -// an argument to enable easy testing. -func (tb *Bucket) available(now time.Time) int64 { - tb.mu.Lock() - defer tb.mu.Unlock() - tb.adjust(now) - return tb.avail -} - -// Capacity returns the capacity that the bucket was created with. -func (tb *Bucket) Capacity() int64 { - return tb.capacity -} - -// Rate returns the fill rate of the bucket, in tokens per second. -func (tb *Bucket) Rate() float64 { - return 1e9 * float64(tb.quantum) / float64(tb.fillInterval) -} - -// take is the internal version of Take - it takes the current time as -// an argument to enable easy testing. -func (tb *Bucket) take(now time.Time, count int64, maxWait time.Duration) (time.Duration, bool) { - if count <= 0 { - return 0, true - } - tb.mu.Lock() - defer tb.mu.Unlock() - - currentTick := tb.adjust(now) - avail := tb.avail - count - if avail >= 0 { - tb.avail = avail - return 0, true - } - // Round up the missing tokens to the nearest multiple - // of quantum - the tokens won't be available until - // that tick. - endTick := currentTick + (-avail+tb.quantum-1)/tb.quantum - endTime := tb.startTime.Add(time.Duration(endTick) * tb.fillInterval) - waitTime := endTime.Sub(now) - if waitTime > maxWait { - return 0, false - } - tb.avail = avail - return waitTime, true -} - -// adjust adjusts the current bucket capacity based on the current time. -// It returns the current tick. -func (tb *Bucket) adjust(now time.Time) (currentTick int64) { - currentTick = int64(now.Sub(tb.startTime) / tb.fillInterval) - - if tb.avail >= tb.capacity { - return - } - tb.avail += (currentTick - tb.availTick) * tb.quantum - if tb.avail > tb.capacity { - tb.avail = tb.capacity - } - tb.availTick = currentTick - return -} diff --git a/vendor/github.com/juju/ratelimit/reader.go b/vendor/github.com/juju/ratelimit/reader.go deleted file mode 100644 index 6403bf7..0000000 --- a/vendor/github.com/juju/ratelimit/reader.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3 with static-linking exception. -// See LICENCE file for details. - -package ratelimit - -import "io" - -type reader struct { - r io.Reader - bucket *Bucket -} - -// Reader returns a reader that is rate limited by -// the given token bucket. Each token in the bucket -// represents one byte. -func Reader(r io.Reader, bucket *Bucket) io.Reader { - return &reader{ - r: r, - bucket: bucket, - } -} - -func (r *reader) Read(buf []byte) (int, error) { - n, err := r.r.Read(buf) - if n <= 0 { - return n, err - } - r.bucket.Wait(int64(n)) - return n, err -} - -type writer struct { - w io.Writer - bucket *Bucket -} - -// Writer returns a reader that is rate limited by -// the given token bucket. Each token in the bucket -// represents one byte. -func Writer(w io.Writer, bucket *Bucket) io.Writer { - return &writer{ - w: w, - bucket: bucket, - } -} - -func (w *writer) Write(buf []byte) (int, error) { - w.bucket.Wait(int64(len(buf))) - return w.w.Write(buf) -} diff --git a/vendor/github.com/keybase/go-crypto/brainpool/brainpool.go b/vendor/github.com/keybase/go-crypto/brainpool/brainpool.go deleted file mode 100644 index 77fb8b9..0000000 --- a/vendor/github.com/keybase/go-crypto/brainpool/brainpool.go +++ /dev/null @@ -1,134 +0,0 @@ -// Package brainpool implements Brainpool elliptic curves. -// Implementation of rcurves is from github.com/ebfe/brainpool -// Note that these curves are implemented with naive, non-constant time operations -// and are likely not suitable for enviroments where timing attacks are a concern. -package brainpool - -import ( - "crypto/elliptic" - "math/big" - "sync" -) - -var ( - once sync.Once - p256t1, p384t1, p512t1 *elliptic.CurveParams - p256r1, p384r1, p512r1 *rcurve -) - -func initAll() { - initP256t1() - initP384t1() - initP512t1() - initP256r1() - initP384r1() - initP512r1() -} - -func initP256t1() { - p256t1 = &elliptic.CurveParams{Name: "brainpoolP256t1"} - p256t1.P, _ = new(big.Int).SetString("A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", 16) - p256t1.N, _ = new(big.Int).SetString("A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", 16) - p256t1.B, _ = new(big.Int).SetString("662C61C430D84EA4FE66A7733D0B76B7BF93EBC4AF2F49256AE58101FEE92B04", 16) - p256t1.Gx, _ = new(big.Int).SetString("A3E8EB3CC1CFE7B7732213B23A656149AFA142C47AAFBC2B79A191562E1305F4", 16) - p256t1.Gy, _ = new(big.Int).SetString("2D996C823439C56D7F7B22E14644417E69BCB6DE39D027001DABE8F35B25C9BE", 16) - p256t1.BitSize = 256 -} - -func initP256r1() { - twisted := p256t1 - params := &elliptic.CurveParams{ - Name: "brainpoolP256r1", - P: twisted.P, - N: twisted.N, - BitSize: twisted.BitSize, - } - params.Gx, _ = new(big.Int).SetString("8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", 16) - params.Gy, _ = new(big.Int).SetString("547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", 16) - z, _ := new(big.Int).SetString("3E2D4BD9597B58639AE7AA669CAB9837CF5CF20A2C852D10F655668DFC150EF0", 16) - p256r1 = newrcurve(twisted, params, z) -} - -func initP384t1() { - p384t1 = &elliptic.CurveParams{Name: "brainpoolP384t1"} - p384t1.P, _ = new(big.Int).SetString("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", 16) - p384t1.N, _ = new(big.Int).SetString("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", 16) - p384t1.B, _ = new(big.Int).SetString("7F519EADA7BDA81BD826DBA647910F8C4B9346ED8CCDC64E4B1ABD11756DCE1D2074AA263B88805CED70355A33B471EE", 16) - p384t1.Gx, _ = new(big.Int).SetString("18DE98B02DB9A306F2AFCD7235F72A819B80AB12EBD653172476FECD462AABFFC4FF191B946A5F54D8D0AA2F418808CC", 16) - p384t1.Gy, _ = new(big.Int).SetString("25AB056962D30651A114AFD2755AD336747F93475B7A1FCA3B88F2B6A208CCFE469408584DC2B2912675BF5B9E582928", 16) - p384t1.BitSize = 384 -} - -func initP384r1() { - twisted := p384t1 - params := &elliptic.CurveParams{ - Name: "brainpoolP384r1", - P: twisted.P, - N: twisted.N, - BitSize: twisted.BitSize, - } - params.Gx, _ = new(big.Int).SetString("1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", 16) - params.Gy, _ = new(big.Int).SetString("8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", 16) - z, _ := new(big.Int).SetString("41DFE8DD399331F7166A66076734A89CD0D2BCDB7D068E44E1F378F41ECBAE97D2D63DBC87BCCDDCCC5DA39E8589291C", 16) - p384r1 = newrcurve(twisted, params, z) -} - -func initP512t1() { - p512t1 = &elliptic.CurveParams{Name: "brainpoolP512t1"} - p512t1.P, _ = new(big.Int).SetString("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", 16) - p512t1.N, _ = new(big.Int).SetString("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", 16) - p512t1.B, _ = new(big.Int).SetString("7CBBBCF9441CFAB76E1890E46884EAE321F70C0BCB4981527897504BEC3E36A62BCDFA2304976540F6450085F2DAE145C22553B465763689180EA2571867423E", 16) - p512t1.Gx, _ = new(big.Int).SetString("640ECE5C12788717B9C1BA06CBC2A6FEBA85842458C56DDE9DB1758D39C0313D82BA51735CDB3EA499AA77A7D6943A64F7A3F25FE26F06B51BAA2696FA9035DA", 16) - p512t1.Gy, _ = new(big.Int).SetString("5B534BD595F5AF0FA2C892376C84ACE1BB4E3019B71634C01131159CAE03CEE9D9932184BEEF216BD71DF2DADF86A627306ECFF96DBB8BACE198B61E00F8B332", 16) - p512t1.BitSize = 512 -} - -func initP512r1() { - twisted := p512t1 - params := &elliptic.CurveParams{ - Name: "brainpoolP512r1", - P: twisted.P, - N: twisted.N, - BitSize: twisted.BitSize, - } - params.Gx, _ = new(big.Int).SetString("81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", 16) - params.Gy, _ = new(big.Int).SetString("7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", 16) - z, _ := new(big.Int).SetString("12EE58E6764838B69782136F0F2D3BA06E27695716054092E60A80BEDB212B64E585D90BCE13761F85C3F1D2A64E3BE8FEA2220F01EBA5EEB0F35DBD29D922AB", 16) - p512r1 = newrcurve(twisted, params, z) -} - -// P256t1 returns a Curve which implements Brainpool P256t1 (see RFC 5639, section 3.4) -func P256t1() elliptic.Curve { - once.Do(initAll) - return p256t1 -} - -// P256r1 returns a Curve which implements Brainpool P256r1 (see RFC 5639, section 3.4) -func P256r1() elliptic.Curve { - once.Do(initAll) - return p256r1 -} - -// P384t1 returns a Curve which implements Brainpool P384t1 (see RFC 5639, section 3.6) -func P384t1() elliptic.Curve { - once.Do(initAll) - return p384t1 -} - -// P384r1 returns a Curve which implements Brainpool P384r1 (see RFC 5639, section 3.6) -func P384r1() elliptic.Curve { - once.Do(initAll) - return p384r1 -} - -// P512t1 returns a Curve which implements Brainpool P512t1 (see RFC 5639, section 3.7) -func P512t1() elliptic.Curve { - once.Do(initAll) - return p512t1 -} - -// P512r1 returns a Curve which implements Brainpool P512r1 (see RFC 5639, section 3.7) -func P512r1() elliptic.Curve { - once.Do(initAll) - return p512r1 -} diff --git a/vendor/github.com/keybase/go-crypto/brainpool/rcurve.go b/vendor/github.com/keybase/go-crypto/brainpool/rcurve.go deleted file mode 100644 index 7e291d6..0000000 --- a/vendor/github.com/keybase/go-crypto/brainpool/rcurve.go +++ /dev/null @@ -1,83 +0,0 @@ -package brainpool - -import ( - "crypto/elliptic" - "math/big" -) - -var _ elliptic.Curve = (*rcurve)(nil) - -type rcurve struct { - twisted elliptic.Curve - params *elliptic.CurveParams - z *big.Int - zinv *big.Int - z2 *big.Int - z3 *big.Int - zinv2 *big.Int - zinv3 *big.Int -} - -var ( - two = big.NewInt(2) - three = big.NewInt(3) -) - -func newrcurve(twisted elliptic.Curve, params *elliptic.CurveParams, z *big.Int) *rcurve { - zinv := new(big.Int).ModInverse(z, params.P) - return &rcurve{ - twisted: twisted, - params: params, - z: z, - zinv: zinv, - z2: new(big.Int).Exp(z, two, params.P), - z3: new(big.Int).Exp(z, three, params.P), - zinv2: new(big.Int).Exp(zinv, two, params.P), - zinv3: new(big.Int).Exp(zinv, three, params.P), - } -} - -func (curve *rcurve) toTwisted(x, y *big.Int) (*big.Int, *big.Int) { - var tx, ty big.Int - tx.Mul(x, curve.z2) - tx.Mod(&tx, curve.params.P) - ty.Mul(y, curve.z3) - ty.Mod(&ty, curve.params.P) - return &tx, &ty -} - -func (curve *rcurve) fromTwisted(tx, ty *big.Int) (*big.Int, *big.Int) { - var x, y big.Int - x.Mul(tx, curve.zinv2) - x.Mod(&x, curve.params.P) - y.Mul(ty, curve.zinv3) - y.Mod(&y, curve.params.P) - return &x, &y -} - -func (curve *rcurve) Params() *elliptic.CurveParams { - return curve.params -} - -func (curve *rcurve) IsOnCurve(x, y *big.Int) bool { - return curve.twisted.IsOnCurve(curve.toTwisted(x, y)) -} - -func (curve *rcurve) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int) { - tx1, ty1 := curve.toTwisted(x1, y1) - tx2, ty2 := curve.toTwisted(x2, y2) - return curve.fromTwisted(curve.twisted.Add(tx1, ty1, tx2, ty2)) -} - -func (curve *rcurve) Double(x1, y1 *big.Int) (x, y *big.Int) { - return curve.fromTwisted(curve.twisted.Double(curve.toTwisted(x1, y1))) -} - -func (curve *rcurve) ScalarMult(x1, y1 *big.Int, scalar []byte) (x, y *big.Int) { - tx1, ty1 := curve.toTwisted(x1, y1) - return curve.fromTwisted(curve.twisted.ScalarMult(tx1, ty1, scalar)) -} - -func (curve *rcurve) ScalarBaseMult(scalar []byte) (x, y *big.Int) { - return curve.fromTwisted(curve.twisted.ScalarBaseMult(scalar)) -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/armor/encode.go b/vendor/github.com/keybase/go-crypto/openpgp/armor/encode.go deleted file mode 100644 index 075a197..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/armor/encode.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package armor - -import ( - "encoding/base64" - "io" -) - -var armorHeaderSep = []byte(": ") -var blockEnd = []byte("\n=") -var newline = []byte("\n") -var armorEndOfLineOut = []byte("-----\n") - -// writeSlices writes its arguments to the given Writer. -func writeSlices(out io.Writer, slices ...[]byte) (err error) { - for _, s := range slices { - _, err = out.Write(s) - if err != nil { - return err - } - } - return -} - -// lineBreaker breaks data across several lines, all of the same byte length -// (except possibly the last). Lines are broken with a single '\n'. -type lineBreaker struct { - lineLength int - line []byte - used int - out io.Writer - haveWritten bool -} - -func newLineBreaker(out io.Writer, lineLength int) *lineBreaker { - return &lineBreaker{ - lineLength: lineLength, - line: make([]byte, lineLength), - used: 0, - out: out, - } -} - -func (l *lineBreaker) Write(b []byte) (n int, err error) { - n = len(b) - - if n == 0 { - return - } - - if l.used == 0 && l.haveWritten { - _, err = l.out.Write([]byte{'\n'}) - if err != nil { - return - } - } - - if l.used+len(b) < l.lineLength { - l.used += copy(l.line[l.used:], b) - return - } - - l.haveWritten = true - _, err = l.out.Write(l.line[0:l.used]) - if err != nil { - return - } - excess := l.lineLength - l.used - l.used = 0 - - _, err = l.out.Write(b[0:excess]) - if err != nil { - return - } - - _, err = l.Write(b[excess:]) - return -} - -func (l *lineBreaker) Close() (err error) { - if l.used > 0 { - _, err = l.out.Write(l.line[0:l.used]) - if err != nil { - return - } - } - - return -} - -// encoding keeps track of a running CRC24 over the data which has been written -// to it and outputs a OpenPGP checksum when closed, followed by an armor -// trailer. -// -// It's built into a stack of io.Writers: -// encoding -> base64 encoder -> lineBreaker -> out -type encoding struct { - out io.Writer - breaker *lineBreaker - b64 io.WriteCloser - crc uint32 - blockType []byte -} - -func (e *encoding) Write(data []byte) (n int, err error) { - e.crc = crc24(e.crc, data) - return e.b64.Write(data) -} - -func (e *encoding) Close() (err error) { - err = e.b64.Close() - if err != nil { - return - } - e.breaker.Close() - - var checksumBytes [3]byte - checksumBytes[0] = byte(e.crc >> 16) - checksumBytes[1] = byte(e.crc >> 8) - checksumBytes[2] = byte(e.crc) - - var b64ChecksumBytes [4]byte - base64.StdEncoding.Encode(b64ChecksumBytes[:], checksumBytes[:]) - - return writeSlices(e.out, blockEnd, b64ChecksumBytes[:], newline, armorEnd, e.blockType, armorEndOfLine, []byte{'\n'}) -} - -// Encode returns a WriteCloser which will encode the data written to it in -// OpenPGP armor. -func Encode(out io.Writer, blockType string, headers map[string]string) (w io.WriteCloser, err error) { - bType := []byte(blockType) - err = writeSlices(out, armorStart, bType, armorEndOfLineOut) - if err != nil { - return - } - - for k, v := range headers { - err = writeSlices(out, []byte(k), armorHeaderSep, []byte(v), newline) - if err != nil { - return - } - } - - _, err = out.Write(newline) - if err != nil { - return - } - - e := &encoding{ - out: out, - breaker: newLineBreaker(out, 64), - crc: crc24Init, - blockType: bType, - } - e.b64 = base64.NewEncoder(base64.StdEncoding, e.breaker) - return e, nil -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/errors/errors.go b/vendor/github.com/keybase/go-crypto/openpgp/errors/errors.go deleted file mode 100644 index d48c6c9..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/errors/errors.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package errors contains common error types for the OpenPGP packages. -package errors // import "github.com/keybase/go-crypto/openpgp/errors" - -import ( - "strconv" -) - -// A StructuralError is returned when OpenPGP data is found to be syntactically -// invalid. -type StructuralError string - -func (s StructuralError) Error() string { - return "openpgp: invalid data: " + string(s) -} - -// UnsupportedError indicates that, although the OpenPGP data is valid, it -// makes use of currently unimplemented features. -type UnsupportedError string - -func (s UnsupportedError) Error() string { - return "openpgp: unsupported feature: " + string(s) -} - -// InvalidArgumentError indicates that the caller is in error and passed an -// incorrect value. -type InvalidArgumentError string - -func (i InvalidArgumentError) Error() string { - return "openpgp: invalid argument: " + string(i) -} - -// SignatureError indicates that a syntactically valid signature failed to -// validate. -type SignatureError string - -func (b SignatureError) Error() string { - return "openpgp: invalid signature: " + string(b) -} - -type keyIncorrectError int - -func (ki keyIncorrectError) Error() string { - return "openpgp: incorrect key" -} - -var ErrKeyIncorrect error = keyIncorrectError(0) - -type unknownIssuerError int - -func (unknownIssuerError) Error() string { - return "openpgp: signature made by unknown entity" -} - -var ErrUnknownIssuer error = unknownIssuerError(0) - -type keyRevokedError int - -func (keyRevokedError) Error() string { - return "openpgp: signature made by revoked key" -} - -var ErrKeyRevoked error = keyRevokedError(0) - -type UnknownPacketTypeError uint8 - -func (upte UnknownPacketTypeError) Error() string { - return "openpgp: unknown packet type: " + strconv.Itoa(int(upte)) -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/keys.go b/vendor/github.com/keybase/go-crypto/openpgp/keys.go deleted file mode 100644 index 8221aa7..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/keys.go +++ /dev/null @@ -1,812 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package openpgp - -import ( - "github.com/keybase/go-crypto/openpgp/armor" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/openpgp/packet" - "github.com/keybase/go-crypto/rsa" - "io" - "time" -) - -// PublicKeyType is the armor type for a PGP public key. -var PublicKeyType = "PGP PUBLIC KEY BLOCK" - -// PrivateKeyType is the armor type for a PGP private key. -var PrivateKeyType = "PGP PRIVATE KEY BLOCK" - -// An Entity represents the components of an OpenPGP key: a primary public key -// (which must be a signing key), one or more identities claimed by that key, -// and zero or more subkeys, which may be encryption keys. -type Entity struct { - PrimaryKey *packet.PublicKey - PrivateKey *packet.PrivateKey - Identities map[string]*Identity // indexed by Identity.Name - Revocations []*packet.Signature - Subkeys []Subkey - BadSubkeys []BadSubkey -} - -// An Identity represents an identity claimed by an Entity and zero or more -// assertions by other entities about that claim. -type Identity struct { - Name string // by convention, has the form "Full Name (comment) " - UserId *packet.UserId - SelfSignature *packet.Signature - Signatures []*packet.Signature -} - -// A Subkey is an additional public key in an Entity. Subkeys can be used for -// encryption. -type Subkey struct { - PublicKey *packet.PublicKey - PrivateKey *packet.PrivateKey - Sig *packet.Signature - Revocation *packet.Signature -} - -// BadSubkey is one that failed reconstruction, but we'll keep it around for -// informational purposes. -type BadSubkey struct { - Subkey - Err error -} - -// A Key identifies a specific public key in an Entity. This is either the -// Entity's primary key or a subkey. -type Key struct { - Entity *Entity - PublicKey *packet.PublicKey - PrivateKey *packet.PrivateKey - SelfSignature *packet.Signature -} - -// A KeyRing provides access to public and private keys. -type KeyRing interface { - // KeysById returns the set of keys that have the given key id. - KeysById(id uint64) []Key - // KeysByIdAndUsage returns the set of keys with the given id - // that also meet the key usage given by requiredUsage. - // The requiredUsage is expressed as the bitwise-OR of - // packet.KeyFlag* values. - KeysByIdUsage(id uint64, requiredUsage byte) []Key - // DecryptionKeys returns all private keys that are valid for - // decryption. - DecryptionKeys() []Key -} - -// primaryIdentity returns the Identity marked as primary or the first identity -// if none are so marked. -func (e *Entity) primaryIdentity() *Identity { - var firstIdentity *Identity - for _, ident := range e.Identities { - if firstIdentity == nil { - firstIdentity = ident - } - if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId { - return ident - } - } - return firstIdentity -} - -// encryptionKey returns the best candidate Key for encrypting a message to the -// given Entity. -func (e *Entity) encryptionKey(now time.Time) (Key, bool) { - candidateSubkey := -1 - - // Iterate the keys to find the newest key - var maxTime time.Time - for i, subkey := range e.Subkeys { - - // NOTE(maxtaco) - // If there is a Flags subpacket, then we have to follow it, and only - // use keys that are marked for Encryption of Communication. If there - // isn't a Flags subpacket, and this is an Encrypt-Only key (right now only ElGamal - // suffices), then we implicitly use it. The check for primary below is a little - // more open-ended, but for now, let's be strict and potentially open up - // if we see bugs in the wild. - // - // One more note: old DSA/ElGamal keys tend not to have the Flags subpacket, - // so this sort of thing is pretty important for encrypting to older keys. - // - if ((subkey.Sig.FlagsValid && subkey.Sig.FlagEncryptCommunications) || - (!subkey.Sig.FlagsValid && subkey.PublicKey.PubKeyAlgo == packet.PubKeyAlgoElGamal)) && - subkey.PublicKey.PubKeyAlgo.CanEncrypt() && - !subkey.Sig.KeyExpired(now) && - subkey.Revocation == nil && - (maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) { - candidateSubkey = i - maxTime = subkey.Sig.CreationTime - } - } - - if candidateSubkey != -1 { - subkey := e.Subkeys[candidateSubkey] - return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true - } - - // If we don't have any candidate subkeys for encryption and - // the primary key doesn't have any usage metadata then we - // assume that the primary key is ok. Or, if the primary key is - // marked as ok to encrypt to, then we can obviously use it. - // - // NOTE(maxtaco) - see note above, how this policy is a little too open-ended - // for my liking, but leave it for now. - i := e.primaryIdentity() - if (!i.SelfSignature.FlagsValid || i.SelfSignature.FlagEncryptCommunications) && - e.PrimaryKey.PubKeyAlgo.CanEncrypt() && - !i.SelfSignature.KeyExpired(now) { - return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true - } - - // This Entity appears to be signing only. - return Key{}, false -} - -// signingKey return the best candidate Key for signing a message with this -// Entity. -func (e *Entity) signingKey(now time.Time) (Key, bool) { - candidateSubkey := -1 - - for i, subkey := range e.Subkeys { - if (!subkey.Sig.FlagsValid || subkey.Sig.FlagSign) && - subkey.PrivateKey.PrivateKey != nil && - subkey.PublicKey.PubKeyAlgo.CanSign() && - subkey.Revocation == nil && - !subkey.Sig.KeyExpired(now) { - candidateSubkey = i - break - } - } - - if candidateSubkey != -1 { - subkey := e.Subkeys[candidateSubkey] - return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true - } - - // If we have no candidate subkey then we assume that it's ok to sign - // with the primary key. - i := e.primaryIdentity() - if (!i.SelfSignature.FlagsValid || i.SelfSignature.FlagSign) && - e.PrimaryKey.PubKeyAlgo.CanSign() && - !i.SelfSignature.KeyExpired(now) && - e.PrivateKey.PrivateKey != nil { - return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true - } - - return Key{}, false -} - -// An EntityList contains one or more Entities. -type EntityList []*Entity - -// KeysById returns the set of keys that have the given key id. -func (el EntityList) KeysById(id uint64) (keys []Key) { - for _, e := range el { - if e.PrimaryKey.KeyId == id { - var selfSig *packet.Signature - for _, ident := range e.Identities { - if selfSig == nil { - selfSig = ident.SelfSignature - } else if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId { - selfSig = ident.SelfSignature - break - } - } - keys = append(keys, Key{e, e.PrimaryKey, e.PrivateKey, selfSig}) - } - - for _, subKey := range e.Subkeys { - if subKey.PublicKey.KeyId == id { - - // If there's both a a revocation and a sig, then take the - // revocation. Otherwise, we can proceed with the sig. - sig := subKey.Revocation - if sig == nil { - sig = subKey.Sig - } - - keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, sig}) - } - } - } - return -} - -// KeysByIdAndUsage returns the set of keys with the given id that also meet -// the key usage given by requiredUsage. The requiredUsage is expressed as -// the bitwise-OR of packet.KeyFlag* values. -func (el EntityList) KeysByIdUsage(id uint64, requiredUsage byte) (keys []Key) { - for _, key := range el.KeysById(id) { - if len(key.Entity.Revocations) > 0 { - continue - } - - if key.SelfSignature.RevocationReason != nil { - continue - } - - if requiredUsage != 0 { - var usage byte - - switch { - case key.SelfSignature.FlagsValid: - if key.SelfSignature.FlagCertify { - usage |= packet.KeyFlagCertify - } - if key.SelfSignature.FlagSign { - usage |= packet.KeyFlagSign - } - if key.SelfSignature.FlagEncryptCommunications { - usage |= packet.KeyFlagEncryptCommunications - } - if key.SelfSignature.FlagEncryptStorage { - usage |= packet.KeyFlagEncryptStorage - } - - case key.PublicKey.PubKeyAlgo == packet.PubKeyAlgoElGamal: - // We also need to handle the case where, although the sig's - // flags aren't valid, the key can is implicitly usable for - // encryption by virtue of being ElGamal. See also the comment - // in encryptionKey() above. - usage |= packet.KeyFlagEncryptCommunications - usage |= packet.KeyFlagEncryptStorage - - case key.PublicKey.PubKeyAlgo == packet.PubKeyAlgoDSA: - usage |= packet.KeyFlagSign - - // For a primary RSA key without any key flags, be as permissiable - // as possible. - case key.PublicKey.PubKeyAlgo == packet.PubKeyAlgoRSA && - key.Entity.PrimaryKey.KeyId == id: - usage = (packet.KeyFlagCertify | packet.KeyFlagSign | - packet.KeyFlagEncryptCommunications | packet.KeyFlagEncryptStorage) - } - - if usage&requiredUsage != requiredUsage { - continue - } - } - - keys = append(keys, key) - } - return -} - -// DecryptionKeys returns all private keys that are valid for decryption. -func (el EntityList) DecryptionKeys() (keys []Key) { - for _, e := range el { - for _, subKey := range e.Subkeys { - if subKey.PrivateKey != nil && subKey.PrivateKey.PrivateKey != nil && (!subKey.Sig.FlagsValid || subKey.Sig.FlagEncryptStorage || subKey.Sig.FlagEncryptCommunications) { - keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig}) - } - } - } - return -} - -// ReadArmoredKeyRing reads one or more public/private keys from an armor keyring file. -func ReadArmoredKeyRing(r io.Reader) (EntityList, error) { - block, err := armor.Decode(r) - if err == io.EOF { - return nil, errors.InvalidArgumentError("no armored data found") - } - if err != nil { - return nil, err - } - if block.Type != PublicKeyType && block.Type != PrivateKeyType { - return nil, errors.InvalidArgumentError("expected public or private key block, got: " + block.Type) - } - - return ReadKeyRing(block.Body) -} - -// ReadKeyRing reads one or more public/private keys. Unsupported keys are -// ignored as long as at least a single valid key is found. -func ReadKeyRing(r io.Reader) (el EntityList, err error) { - packets := packet.NewReader(r) - var lastUnsupportedError error - - for { - var e *Entity - e, err = ReadEntity(packets) - if err != nil { - // TODO: warn about skipped unsupported/unreadable keys - if _, ok := err.(errors.UnsupportedError); ok { - lastUnsupportedError = err - err = readToNextPublicKey(packets) - } else if _, ok := err.(errors.StructuralError); ok { - // Skip unreadable, badly-formatted keys - lastUnsupportedError = err - err = readToNextPublicKey(packets) - } - if err == io.EOF { - err = nil - break - } - if err != nil { - el = nil - break - } - } else { - el = append(el, e) - } - } - - if len(el) == 0 && err == nil { - err = lastUnsupportedError - } - return -} - -// readToNextPublicKey reads packets until the start of the entity and leaves -// the first packet of the new entity in the Reader. -func readToNextPublicKey(packets *packet.Reader) (err error) { - var p packet.Packet - for { - p, err = packets.Next() - if err == io.EOF { - return - } else if err != nil { - if _, ok := err.(errors.UnsupportedError); ok { - err = nil - continue - } - return - } - - if pk, ok := p.(*packet.PublicKey); ok && !pk.IsSubkey { - packets.Unread(p) - return - } - } - - panic("unreachable") -} - -// ReadEntity reads an entity (public key, identities, subkeys etc) from the -// given Reader. -func ReadEntity(packets *packet.Reader) (*Entity, error) { - e := new(Entity) - e.Identities = make(map[string]*Identity) - - p, err := packets.Next() - if err != nil { - return nil, err - } - - var ok bool - if e.PrimaryKey, ok = p.(*packet.PublicKey); !ok { - if e.PrivateKey, ok = p.(*packet.PrivateKey); !ok { - packets.Unread(p) - return nil, errors.StructuralError("first packet was not a public/private key") - } else { - e.PrimaryKey = &e.PrivateKey.PublicKey - } - } - - if !e.PrimaryKey.PubKeyAlgo.CanSign() { - return nil, errors.StructuralError("primary key cannot be used for signatures") - } - - var current *Identity - var revocations []*packet.Signature -EachPacket: - for { - p, err := packets.Next() - if err == io.EOF { - break - } else if err != nil { - return nil, err - } - switch pkt := p.(type) { - case *packet.UserId: - - // Make a new Identity object, that we might wind up throwing away. - // We'll only add it if we get a valid self-signature over this - // userID. - current = new(Identity) - current.Name = pkt.Id - current.UserId = pkt - case *packet.Signature: - - // These are signatures by other people on this key. Let's just ignore them - // from the beginning, since they shouldn't affect our key decoding one way - // or the other. - if pkt.IssuerKeyId != nil && *pkt.IssuerKeyId != e.PrimaryKey.KeyId { - continue - } - - // If this is a signature made by the keyholder, and the signature has stubbed out - // critical packets, then *now* we need to bail out. - if e := pkt.StubbedOutCriticalError; e != nil { - return nil, e - } - - // Next handle the case of a self-signature. According to RFC8440, - // Section 5.2.3.3, if there are several self-signatures, - // we should take the newer one. If they were both created - // at the same time, but one of them has keyflags specified and the - // other doesn't, keep the one with the keyflags. We have actually - // seen this in the wild (see the 'Yield' test in read_test.go). - // If there is a tie, and both have the same value for FlagsValid, - // then "last writer wins." - // - // HOWEVER! We have seen yet more keys in the wild (see the 'Spiros' - // test in read_test.go), in which the later self-signature is a bunch - // of junk, and doesn't even specify key flags. Does it really make - // sense to overwrite reasonable key flags with the empty set? I'm not - // sure what that would be trying to achieve, and plus GPG seems to be - // ok with this situation, and ignores the later (empty) keyflag set. - // So further tighten our overwrite rules, and only allow the later - // signature to overwrite the earlier signature if so doing won't - // trash the key flags. - if current != nil && - (current.SelfSignature == nil || - (!pkt.CreationTime.Before(current.SelfSignature.CreationTime) && - (pkt.FlagsValid || !current.SelfSignature.FlagsValid))) && - (pkt.SigType == packet.SigTypePositiveCert || pkt.SigType == packet.SigTypeGenericCert) && - pkt.IssuerKeyId != nil && - *pkt.IssuerKeyId == e.PrimaryKey.KeyId { - - if err = e.PrimaryKey.VerifyUserIdSignature(current.Name, e.PrimaryKey, pkt); err == nil { - - current.SelfSignature = pkt - - // NOTE(maxtaco) 2016.01.11 - // Only register an identity once we've gotten a valid self-signature. - // It's possible therefore for us to throw away `current` in the case - // no valid self-signatures were found. That's OK as long as there are - // other identies that make sense. - // - // NOTE! We might later see a revocation for this very same UID, and it - // won't be undone. We've preserved this feature from the original - // Google OpenPGP we forked from. - e.Identities[current.Name] = current - } else { - // We really should warn that there was a failure here. Not raise an error - // since this really shouldn't be a fail-stop error. - } - } else if pkt.SigType == packet.SigTypeKeyRevocation { - // These revocations won't revoke UIDs as handled above, so lookout! - revocations = append(revocations, pkt) - } else if pkt.SigType == packet.SigTypeDirectSignature { - // TODO: RFC4880 5.2.1 permits signatures - // directly on keys (eg. to bind additional - // revocation keys). - } else if current == nil { - // NOTE(maxtaco) - // - // See https://github.com/keybase/client/issues/2666 - // - // There might have been a user attribute picture before this signature, - // in which case this is still a valid PGP key. In the future we might - // not ignore user attributes (like picture). But either way, it doesn't - // make sense to bail out here. Keep looking for other valid signatures. - // - // Used to be: - // return nil, errors.StructuralError("signature packet found before user id packet") - } else { - current.Signatures = append(current.Signatures, pkt) - } - case *packet.PrivateKey: - if pkt.IsSubkey == false { - packets.Unread(p) - break EachPacket - } - err = addSubkey(e, packets, &pkt.PublicKey, pkt) - if err != nil { - return nil, err - } - case *packet.PublicKey: - if pkt.IsSubkey == false { - packets.Unread(p) - break EachPacket - } - err = addSubkey(e, packets, pkt, nil) - if err != nil { - return nil, err - } - default: - // we ignore unknown packets - } - } - - if len(e.Identities) == 0 { - return nil, errors.StructuralError("entity without any identities") - } - - for _, revocation := range revocations { - err = e.PrimaryKey.VerifyRevocationSignature(revocation) - if err == nil { - e.Revocations = append(e.Revocations, revocation) - } else { - // TODO: RFC 4880 5.2.3.15 defines revocation keys. - return nil, errors.StructuralError("revocation signature signed by alternate key") - } - } - - return e, nil -} - -func addSubkey(e *Entity, packets *packet.Reader, pub *packet.PublicKey, priv *packet.PrivateKey) error { - var subKey Subkey - subKey.PublicKey = pub - subKey.PrivateKey = priv - var lastErr error - for { - p, err := packets.Next() - if err == io.EOF { - break - } - if err != nil { - return errors.StructuralError("subkey signature invalid: " + err.Error()) - } - sig, ok := p.(*packet.Signature) - if !ok { - // Hit a non-signature packet, so assume we're up to the next key - packets.Unread(p) - break - } - if st := sig.SigType; st != packet.SigTypeSubkeyBinding && st != packet.SigTypeSubkeyRevocation { - - // Note(maxtaco): - // We used to error out here, but instead, let's fast-forward past - // packets that are in the wrong place (like misplaced 0x13 signatures) - // until we get to one that works. For a test case, - // see TestWithBadSubkeySignaturePackets. - - continue - } - err = e.PrimaryKey.VerifyKeySignature(subKey.PublicKey, sig) - if err != nil { - // Non valid signature, so again, no need to abandon all hope, just continue; - // make a note of the error we hit. - lastErr = errors.StructuralError("subkey signature invalid: " + err.Error()) - continue - } - switch sig.SigType { - case packet.SigTypeSubkeyBinding: - // First writer wins - if subKey.Sig == nil { - subKey.Sig = sig - } - case packet.SigTypeSubkeyRevocation: - // First writer wins - if subKey.Revocation == nil { - subKey.Revocation = sig - } - } - } - if subKey.Sig != nil { - e.Subkeys = append(e.Subkeys, subKey) - } else { - if lastErr == nil { - lastErr = errors.StructuralError("Subkey wasn't signed; expected a 'binding' signature") - } - e.BadSubkeys = append(e.BadSubkeys, BadSubkey{Subkey: subKey, Err: lastErr}) - } - return nil -} - -const defaultRSAKeyBits = 2048 - -// NewEntity returns an Entity that contains a fresh RSA/RSA keypair with a -// single identity composed of the given full name, comment and email, any of -// which may be empty but must not contain any of "()<>\x00". -// If config is nil, sensible defaults will be used. -func NewEntity(name, comment, email string, config *packet.Config) (*Entity, error) { - currentTime := config.Now() - - bits := defaultRSAKeyBits - if config != nil && config.RSABits != 0 { - bits = config.RSABits - } - - uid := packet.NewUserId(name, comment, email) - if uid == nil { - return nil, errors.InvalidArgumentError("user id field contained invalid characters") - } - signingPriv, err := rsa.GenerateKey(config.Random(), bits) - if err != nil { - return nil, err - } - encryptingPriv, err := rsa.GenerateKey(config.Random(), bits) - if err != nil { - return nil, err - } - - e := &Entity{ - PrimaryKey: packet.NewRSAPublicKey(currentTime, &signingPriv.PublicKey), - PrivateKey: packet.NewRSAPrivateKey(currentTime, signingPriv), - Identities: make(map[string]*Identity), - } - isPrimaryId := true - e.Identities[uid.Id] = &Identity{ - Name: uid.Name, - UserId: uid, - SelfSignature: &packet.Signature{ - CreationTime: currentTime, - SigType: packet.SigTypePositiveCert, - PubKeyAlgo: packet.PubKeyAlgoRSA, - Hash: config.Hash(), - IsPrimaryId: &isPrimaryId, - FlagsValid: true, - FlagSign: true, - FlagCertify: true, - IssuerKeyId: &e.PrimaryKey.KeyId, - }, - } - - e.Subkeys = make([]Subkey, 1) - e.Subkeys[0] = Subkey{ - PublicKey: packet.NewRSAPublicKey(currentTime, &encryptingPriv.PublicKey), - PrivateKey: packet.NewRSAPrivateKey(currentTime, encryptingPriv), - Sig: &packet.Signature{ - CreationTime: currentTime, - SigType: packet.SigTypeSubkeyBinding, - PubKeyAlgo: packet.PubKeyAlgoRSA, - Hash: config.Hash(), - FlagsValid: true, - FlagEncryptStorage: true, - FlagEncryptCommunications: true, - IssuerKeyId: &e.PrimaryKey.KeyId, - }, - } - e.Subkeys[0].PublicKey.IsSubkey = true - e.Subkeys[0].PrivateKey.IsSubkey = true - - return e, nil -} - -// SerializePrivate serializes an Entity, including private key material, to -// the given Writer. For now, it must only be used on an Entity returned from -// NewEntity. -// If config is nil, sensible defaults will be used. -func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) { - err = e.PrivateKey.Serialize(w) - if err != nil { - return - } - for _, ident := range e.Identities { - err = ident.UserId.Serialize(w) - if err != nil { - return - } - if e.PrivateKey.PrivateKey != nil { - err = ident.SelfSignature.SignUserId(ident.UserId.Id, e.PrimaryKey, e.PrivateKey, config) - if err != nil { - return - } - } - err = ident.SelfSignature.Serialize(w) - if err != nil { - return - } - } - for _, subkey := range e.Subkeys { - err = subkey.PrivateKey.Serialize(w) - if err != nil { - return - } - // Workaround shortcoming of SignKey(), which doesn't work to reverse-sign - // sub-signing keys. So if requested, just reuse the signatures already - // available to us (if we read this key from a keyring). - if e.PrivateKey.PrivateKey != nil && !config.ReuseSignatures() { - err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config) - if err != nil { - return - } - } - - if subkey.Revocation != nil { - err = subkey.Revocation.Serialize(w) - if err != nil { - return - } - } - - err = subkey.Sig.Serialize(w) - if err != nil { - return - } - } - return nil -} - -// Serialize writes the public part of the given Entity to w. (No private -// key material will be output). -func (e *Entity) Serialize(w io.Writer) error { - err := e.PrimaryKey.Serialize(w) - if err != nil { - return err - } - for _, ident := range e.Identities { - err = ident.UserId.Serialize(w) - if err != nil { - return err - } - err = ident.SelfSignature.Serialize(w) - if err != nil { - return err - } - for _, sig := range ident.Signatures { - err = sig.Serialize(w) - if err != nil { - return err - } - } - } - for _, subkey := range e.Subkeys { - err = subkey.PublicKey.Serialize(w) - if err != nil { - return err - } - - if subkey.Revocation != nil { - err = subkey.Revocation.Serialize(w) - if err != nil { - return err - } - } - err = subkey.Sig.Serialize(w) - if err != nil { - return err - } - } - return nil -} - -// SignIdentity adds a signature to e, from signer, attesting that identity is -// associated with e. The provided identity must already be an element of -// e.Identities and the private key of signer must have been decrypted if -// necessary. -// If config is nil, sensible defaults will be used. -func (e *Entity) SignIdentity(identity string, signer *Entity, config *packet.Config) error { - if signer.PrivateKey == nil { - return errors.InvalidArgumentError("signing Entity must have a private key") - } - if signer.PrivateKey.Encrypted { - return errors.InvalidArgumentError("signing Entity's private key must be decrypted") - } - ident, ok := e.Identities[identity] - if !ok { - return errors.InvalidArgumentError("given identity string not found in Entity") - } - - sig := &packet.Signature{ - SigType: packet.SigTypeGenericCert, - PubKeyAlgo: signer.PrivateKey.PubKeyAlgo, - Hash: config.Hash(), - CreationTime: config.Now(), - IssuerKeyId: &signer.PrivateKey.KeyId, - } - if err := sig.SignUserId(identity, e.PrimaryKey, signer.PrivateKey, config); err != nil { - return err - } - ident.Signatures = append(ident.Signatures, sig) - return nil -} - -// CopySubkeyRevocations copies subkey revocations from the src Entity over -// to the receiver entity. We need this because `gpg --export-secret-key` does -// not appear to output subkey revocations. In this case we need to manually -// merge with the output of `gpg --export`. -func (e *Entity) CopySubkeyRevocations(src *Entity) { - m := make(map[[20]byte]*packet.Signature) - for _, subkey := range src.Subkeys { - if subkey.Revocation != nil { - m[subkey.PublicKey.Fingerprint] = subkey.Revocation - } - } - for i, subkey := range e.Subkeys { - if r := m[subkey.PublicKey.Fingerprint]; r != nil { - e.Subkeys[i].Revocation = r - } - } -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/config.go b/vendor/github.com/keybase/go-crypto/openpgp/packet/config.go deleted file mode 100644 index f4125e1..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/config.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "crypto" - "crypto/rand" - "io" - "time" -) - -// Config collects a number of parameters along with sensible defaults. -// A nil *Config is valid and results in all default values. -type Config struct { - // Rand provides the source of entropy. - // If nil, the crypto/rand Reader is used. - Rand io.Reader - // DefaultHash is the default hash function to be used. - // If zero, SHA-256 is used. - DefaultHash crypto.Hash - // DefaultCipher is the cipher to be used. - // If zero, AES-128 is used. - DefaultCipher CipherFunction - // Time returns the current time as the number of seconds since the - // epoch. If Time is nil, time.Now is used. - Time func() time.Time - // DefaultCompressionAlgo is the compression algorithm to be - // applied to the plaintext before encryption. If zero, no - // compression is done. - DefaultCompressionAlgo CompressionAlgo - // CompressionConfig configures the compression settings. - CompressionConfig *CompressionConfig - // S2KCount is only used for symmetric encryption. It - // determines the strength of the passphrase stretching when - // the said passphrase is hashed to produce a key. S2KCount - // should be between 1024 and 65011712, inclusive. If Config - // is nil or S2KCount is 0, the value 65536 used. Not all - // values in the above range can be represented. S2KCount will - // be rounded up to the next representable value if it cannot - // be encoded exactly. When set, it is strongly encrouraged to - // use a value that is at least 65536. See RFC 4880 Section - // 3.7.1.3. - S2KCount int - // RSABits is the number of bits in new RSA keys made with NewEntity. - // If zero, then 2048 bit keys are created. - RSABits int - // ReuseSignatures tells us to reuse existing Signatures - // on serialized output. - ReuseSignaturesOnSerialize bool -} - -func (c *Config) Random() io.Reader { - if c == nil || c.Rand == nil { - return rand.Reader - } - return c.Rand -} - -func (c *Config) Hash() crypto.Hash { - if c == nil || uint(c.DefaultHash) == 0 { - return crypto.SHA256 - } - return c.DefaultHash -} - -func (c *Config) Cipher() CipherFunction { - if c == nil || uint8(c.DefaultCipher) == 0 { - return CipherAES128 - } - return c.DefaultCipher -} - -func (c *Config) Now() time.Time { - if c == nil || c.Time == nil { - return time.Now() - } - return c.Time() -} - -func (c *Config) Compression() CompressionAlgo { - if c == nil { - return CompressionNone - } - return c.DefaultCompressionAlgo -} - -func (c *Config) PasswordHashIterations() int { - if c == nil || c.S2KCount == 0 { - return 0 - } - return c.S2KCount -} - -func (c *Config) ReuseSignatures() bool { - return c != nil && c.ReuseSignaturesOnSerialize -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/ecdh.go b/vendor/github.com/keybase/go-crypto/openpgp/packet/ecdh.go deleted file mode 100644 index 1c2a728..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/ecdh.go +++ /dev/null @@ -1,19 +0,0 @@ - -package packet - -import ( - "math/big" - "crypto/ecdsa" - "errors" -) - -type ecdhPrivateKey struct { - ecdsa.PublicKey - x *big.Int -} - -func (e *ecdhPrivateKey) Decrypt(b []byte) ([]byte, error) { - // TODO(maxtaco): compute the shared secret, run the KDF and - // recover the decrypted shard key. - return nil, errors.New("ECDH decrypt unimplemented") -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/reader.go b/vendor/github.com/keybase/go-crypto/openpgp/packet/reader.go deleted file mode 100644 index 957b3b8..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/reader.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "io" - - "github.com/keybase/go-crypto/openpgp/errors" -) - -// Reader reads packets from an io.Reader and allows packets to be 'unread' so -// that they result from the next call to Next. -type Reader struct { - q []Packet - readers []io.Reader -} - -// New io.Readers are pushed when a compressed or encrypted packet is processed -// and recursively treated as a new source of packets. However, a carefully -// crafted packet can trigger an infinite recursive sequence of packets. See -// http://mumble.net/~campbell/misc/pgp-quine -// https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4402 -// This constant limits the number of recursive packets that may be pushed. -const maxReaders = 32 - -// Next returns the most recently unread Packet, or reads another packet from -// the top-most io.Reader. Unknown packet types are skipped. -func (r *Reader) Next() (p Packet, err error) { - if len(r.q) > 0 { - p = r.q[len(r.q)-1] - r.q = r.q[:len(r.q)-1] - return - } - - for len(r.readers) > 0 { - p, err = Read(r.readers[len(r.readers)-1]) - if err == nil { - return - } - if err == io.EOF { - r.readers = r.readers[:len(r.readers)-1] - continue - } - if _, ok := err.(errors.UnknownPacketTypeError); !ok { - return nil, err - } - } - return nil, io.EOF -} - -// Push causes the Reader to start reading from a new io.Reader. When an EOF -// error is seen from the new io.Reader, it is popped and the Reader continues -// to read from the next most recent io.Reader. Push returns a StructuralError -// if pushing the reader would exceed the maximum recursion level, otherwise it -// returns nil. -func (r *Reader) Push(reader io.Reader) (err error) { - if len(r.readers) >= maxReaders { - return errors.StructuralError("too many layers of packets") - } - r.readers = append(r.readers, reader) - return nil -} - -// Unread causes the given Packet to be returned from the next call to Next. -func (r *Reader) Unread(p Packet) { - r.q = append(r.q, p) -} - -func NewReader(r io.Reader) *Reader { - return &Reader{ - q: nil, - readers: []io.Reader{r}, - } -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/signature.go b/vendor/github.com/keybase/go-crypto/openpgp/packet/signature.go deleted file mode 100644 index 994c497..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/signature.go +++ /dev/null @@ -1,781 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "bytes" - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "encoding/binary" - "hash" - "io" - "strconv" - "time" - - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/openpgp/s2k" - "github.com/keybase/go-crypto/rsa" -) - -const ( - // See RFC 4880, section 5.2.3.21 for details. - KeyFlagCertify = 1 << iota - KeyFlagSign - KeyFlagEncryptCommunications - KeyFlagEncryptStorage -) - -// Signer can be implemented by application code to do actual signing. -type Signer interface { - hash.Hash - Sign(sig *Signature) error - KeyId() uint64 - PublicKeyAlgo() PublicKeyAlgorithm -} - -// Signature represents a signature. See RFC 4880, section 5.2. -type Signature struct { - SigType SignatureType - PubKeyAlgo PublicKeyAlgorithm - Hash crypto.Hash - - // HashSuffix is extra data that is hashed in after the signed data. - HashSuffix []byte - // HashTag contains the first two bytes of the hash for fast rejection - // of bad signed data. - HashTag [2]byte - CreationTime time.Time - - RSASignature parsedMPI - DSASigR, DSASigS parsedMPI - ECDSASigR, ECDSASigS parsedMPI - EdDSASigR, EdDSASigS parsedMPI - - // rawSubpackets contains the unparsed subpackets, in order. - rawSubpackets []outputSubpacket - - // The following are optional so are nil when not included in the - // signature. - - SigLifetimeSecs, KeyLifetimeSecs *uint32 - PreferredSymmetric, PreferredHash, PreferredCompression []uint8 - PreferredKeyServer string - IssuerKeyId *uint64 - IsPrimaryId *bool - - // FlagsValid is set if any flags were given. See RFC 4880, section - // 5.2.3.21 for details. - FlagsValid bool - FlagCertify, FlagSign, FlagEncryptCommunications, FlagEncryptStorage bool - - // RevocationReason is set if this signature has been revoked. - // See RFC 4880, section 5.2.3.23 for details. - RevocationReason *uint8 - RevocationReasonText string - - // PolicyURI is optional. See RFC 4880, Section 5.2.3.20 for details - PolicyURI string - - // Regex is a regex that can match a PGP UID. See RFC 4880, 5.2.3.14 for details - Regex string - - // MDC is set if this signature has a feature packet that indicates - // support for MDC subpackets. - MDC bool - - // EmbeddedSignature, if non-nil, is a signature of the parent key, by - // this key. This prevents an attacker from claiming another's signing - // subkey as their own. - EmbeddedSignature *Signature - - // StubbedOutCriticalError is not fail-stop, since it shouldn't break key parsing - // when appearing in WoT-style cross signatures. But it should prevent a signature - // from being applied to a primary or subkey. - StubbedOutCriticalError error - - outSubpackets []outputSubpacket -} - -func (sig *Signature) parse(r io.Reader) (err error) { - // RFC 4880, section 5.2.3 - var buf [5]byte - _, err = readFull(r, buf[:1]) - if err != nil { - return - } - if buf[0] != 4 { - err = errors.UnsupportedError("signature packet version " + strconv.Itoa(int(buf[0]))) - return - } - - _, err = readFull(r, buf[:5]) - if err != nil { - return - } - sig.SigType = SignatureType(buf[0]) - sig.PubKeyAlgo = PublicKeyAlgorithm(buf[1]) - switch sig.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA, PubKeyAlgoEdDSA: - default: - err = errors.UnsupportedError("public key algorithm " + strconv.Itoa(int(sig.PubKeyAlgo))) - return - } - - var ok bool - sig.Hash, ok = s2k.HashIdToHash(buf[2]) - if !ok { - return errors.UnsupportedError("hash function " + strconv.Itoa(int(buf[2]))) - } - - hashedSubpacketsLength := int(buf[3])<<8 | int(buf[4]) - l := 6 + hashedSubpacketsLength - sig.HashSuffix = make([]byte, l+6) - sig.HashSuffix[0] = 4 - copy(sig.HashSuffix[1:], buf[:5]) - hashedSubpackets := sig.HashSuffix[6:l] - _, err = readFull(r, hashedSubpackets) - if err != nil { - return - } - // See RFC 4880, section 5.2.4 - trailer := sig.HashSuffix[l:] - trailer[0] = 4 - trailer[1] = 0xff - trailer[2] = uint8(l >> 24) - trailer[3] = uint8(l >> 16) - trailer[4] = uint8(l >> 8) - trailer[5] = uint8(l) - - err = parseSignatureSubpackets(sig, hashedSubpackets, true) - if err != nil { - return - } - - _, err = readFull(r, buf[:2]) - if err != nil { - return - } - unhashedSubpacketsLength := int(buf[0])<<8 | int(buf[1]) - unhashedSubpackets := make([]byte, unhashedSubpacketsLength) - _, err = readFull(r, unhashedSubpackets) - if err != nil { - return - } - err = parseSignatureSubpackets(sig, unhashedSubpackets, false) - if err != nil { - return - } - - _, err = readFull(r, sig.HashTag[:2]) - if err != nil { - return - } - - switch sig.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - sig.RSASignature.bytes, sig.RSASignature.bitLength, err = readMPI(r) - case PubKeyAlgoDSA: - sig.DSASigR.bytes, sig.DSASigR.bitLength, err = readMPI(r) - if err == nil { - sig.DSASigS.bytes, sig.DSASigS.bitLength, err = readMPI(r) - } - case PubKeyAlgoEdDSA: - sig.EdDSASigR.bytes, sig.EdDSASigR.bitLength, err = readMPI(r) - if err == nil { - sig.EdDSASigS.bytes, sig.EdDSASigS.bitLength, err = readMPI(r) - } - case PubKeyAlgoECDSA: - sig.ECDSASigR.bytes, sig.ECDSASigR.bitLength, err = readMPI(r) - if err == nil { - sig.ECDSASigS.bytes, sig.ECDSASigS.bitLength, err = readMPI(r) - } - default: - panic("unreachable") - } - return -} - -// parseSignatureSubpackets parses subpackets of the main signature packet. See -// RFC 4880, section 5.2.3.1. -func parseSignatureSubpackets(sig *Signature, subpackets []byte, isHashed bool) (err error) { - for len(subpackets) > 0 { - subpackets, err = parseSignatureSubpacket(sig, subpackets, isHashed) - if err != nil { - return - } - } - - if sig.CreationTime.IsZero() { - err = errors.StructuralError("no creation time in signature") - } - - return -} - -type signatureSubpacketType uint8 - -const ( - creationTimeSubpacket signatureSubpacketType = 2 - signatureExpirationSubpacket signatureSubpacketType = 3 - regularExpressionSubpacket signatureSubpacketType = 6 - keyExpirationSubpacket signatureSubpacketType = 9 - prefSymmetricAlgosSubpacket signatureSubpacketType = 11 - issuerSubpacket signatureSubpacketType = 16 - prefHashAlgosSubpacket signatureSubpacketType = 21 - prefCompressionSubpacket signatureSubpacketType = 22 - prefKeyServerSubpacket signatureSubpacketType = 24 - primaryUserIdSubpacket signatureSubpacketType = 25 - policyURISubpacket signatureSubpacketType = 26 - keyFlagsSubpacket signatureSubpacketType = 27 - reasonForRevocationSubpacket signatureSubpacketType = 29 - featuresSubpacket signatureSubpacketType = 30 - embeddedSignatureSubpacket signatureSubpacketType = 32 -) - -// parseSignatureSubpacket parses a single subpacket. len(subpacket) is >= 1. -func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (rest []byte, err error) { - // RFC 4880, section 5.2.3.1 - var ( - length uint32 - packetType signatureSubpacketType - isCritical bool - ) - switch { - case subpacket[0] < 192: - length = uint32(subpacket[0]) - subpacket = subpacket[1:] - case subpacket[0] < 255: - if len(subpacket) < 2 { - goto Truncated - } - length = uint32(subpacket[0]-192)<<8 + uint32(subpacket[1]) + 192 - subpacket = subpacket[2:] - default: - if len(subpacket) < 5 { - goto Truncated - } - length = uint32(subpacket[1])<<24 | - uint32(subpacket[2])<<16 | - uint32(subpacket[3])<<8 | - uint32(subpacket[4]) - subpacket = subpacket[5:] - } - if length > uint32(len(subpacket)) { - goto Truncated - } - rest = subpacket[length:] - subpacket = subpacket[:length] - if len(subpacket) == 0 { - err = errors.StructuralError("zero length signature subpacket") - return - } - packetType = signatureSubpacketType(subpacket[0] & 0x7f) - isCritical = subpacket[0]&0x80 == 0x80 - subpacket = subpacket[1:] - sig.rawSubpackets = append(sig.rawSubpackets, outputSubpacket{isHashed, packetType, isCritical, subpacket}) - switch packetType { - case creationTimeSubpacket: - if !isHashed { - err = errors.StructuralError("signature creation time in non-hashed area") - return - } - if len(subpacket) != 4 { - err = errors.StructuralError("signature creation time not four bytes") - return - } - t := binary.BigEndian.Uint32(subpacket) - sig.CreationTime = time.Unix(int64(t), 0) - case signatureExpirationSubpacket: - // Signature expiration time, section 5.2.3.10 - if !isHashed { - return - } - if len(subpacket) != 4 { - err = errors.StructuralError("expiration subpacket with bad length") - return - } - sig.SigLifetimeSecs = new(uint32) - *sig.SigLifetimeSecs = binary.BigEndian.Uint32(subpacket) - case keyExpirationSubpacket: - // Key expiration time, section 5.2.3.6 - if !isHashed { - return - } - if len(subpacket) != 4 { - err = errors.StructuralError("key expiration subpacket with bad length") - return - } - sig.KeyLifetimeSecs = new(uint32) - *sig.KeyLifetimeSecs = binary.BigEndian.Uint32(subpacket) - case prefSymmetricAlgosSubpacket: - // Preferred symmetric algorithms, section 5.2.3.7 - if !isHashed { - return - } - sig.PreferredSymmetric = make([]byte, len(subpacket)) - copy(sig.PreferredSymmetric, subpacket) - case issuerSubpacket: - // Issuer, section 5.2.3.5 - if len(subpacket) != 8 { - err = errors.StructuralError("issuer subpacket with bad length") - return - } - sig.IssuerKeyId = new(uint64) - *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket) - case prefHashAlgosSubpacket: - // Preferred hash algorithms, section 5.2.3.8 - if !isHashed { - return - } - sig.PreferredHash = make([]byte, len(subpacket)) - copy(sig.PreferredHash, subpacket) - case prefCompressionSubpacket: - // Preferred compression algorithms, section 5.2.3.9 - if !isHashed { - return - } - sig.PreferredCompression = make([]byte, len(subpacket)) - copy(sig.PreferredCompression, subpacket) - case primaryUserIdSubpacket: - // Primary User ID, section 5.2.3.19 - if !isHashed { - return - } - if len(subpacket) != 1 { - err = errors.StructuralError("primary user id subpacket with bad length") - return - } - sig.IsPrimaryId = new(bool) - if subpacket[0] > 0 { - *sig.IsPrimaryId = true - } - case keyFlagsSubpacket: - // Key flags, section 5.2.3.21 - if !isHashed { - return - } - if len(subpacket) == 0 { - err = errors.StructuralError("empty key flags subpacket") - return - } - sig.FlagsValid = true - if subpacket[0]&KeyFlagCertify != 0 { - sig.FlagCertify = true - } - if subpacket[0]&KeyFlagSign != 0 { - sig.FlagSign = true - } - if subpacket[0]&KeyFlagEncryptCommunications != 0 { - sig.FlagEncryptCommunications = true - } - if subpacket[0]&KeyFlagEncryptStorage != 0 { - sig.FlagEncryptStorage = true - } - case reasonForRevocationSubpacket: - // Reason For Revocation, section 5.2.3.23 - if !isHashed { - return - } - if len(subpacket) == 0 { - err = errors.StructuralError("empty revocation reason subpacket") - return - } - sig.RevocationReason = new(uint8) - *sig.RevocationReason = subpacket[0] - sig.RevocationReasonText = string(subpacket[1:]) - case featuresSubpacket: - // Features subpacket, section 5.2.3.24 specifies a very general - // mechanism for OpenPGP implementations to signal support for new - // features. In practice, the subpacket is used exclusively to - // indicate support for MDC-protected encryption. - sig.MDC = len(subpacket) >= 1 && subpacket[0]&1 == 1 - case embeddedSignatureSubpacket: - // Only usage is in signatures that cross-certify - // signing subkeys. section 5.2.3.26 describes the - // format, with its usage described in section 11.1 - if sig.EmbeddedSignature != nil { - err = errors.StructuralError("Cannot have multiple embedded signatures") - return - } - sig.EmbeddedSignature = new(Signature) - // Embedded signatures are required to be v4 signatures see - // section 12.1. However, we only parse v4 signatures in this - // file anyway. - if err := sig.EmbeddedSignature.parse(bytes.NewBuffer(subpacket)); err != nil { - return nil, err - } - if sigType := sig.EmbeddedSignature.SigType; sigType != SigTypePrimaryKeyBinding { - return nil, errors.StructuralError("cross-signature has unexpected type " + strconv.Itoa(int(sigType))) - } - case policyURISubpacket: - // See RFC 4880, Section 5.2.3.20 - sig.PolicyURI = string(subpacket[:]) - case regularExpressionSubpacket: - sig.Regex = string(subpacket[:]) - if isCritical { - sig.StubbedOutCriticalError = errors.UnsupportedError("regex support is stubbed out") - } - case prefKeyServerSubpacket: - sig.PreferredKeyServer = string(subpacket[:]) - default: - if isCritical { - err = errors.UnsupportedError("unknown critical signature subpacket type " + strconv.Itoa(int(packetType))) - return - } - } - return - -Truncated: - err = errors.StructuralError("signature subpacket truncated") - return -} - -// subpacketLengthLength returns the length, in bytes, of an encoded length value. -func subpacketLengthLength(length int) int { - if length < 192 { - return 1 - } - if length < 16320 { - return 2 - } - return 5 -} - -// serializeSubpacketLength marshals the given length into to. -func serializeSubpacketLength(to []byte, length int) int { - // RFC 4880, Section 4.2.2. - if length < 192 { - to[0] = byte(length) - return 1 - } - if length < 16320 { - length -= 192 - to[0] = byte((length >> 8) + 192) - to[1] = byte(length) - return 2 - } - to[0] = 255 - to[1] = byte(length >> 24) - to[2] = byte(length >> 16) - to[3] = byte(length >> 8) - to[4] = byte(length) - return 5 -} - -// subpacketsLength returns the serialized length, in bytes, of the given -// subpackets. -func subpacketsLength(subpackets []outputSubpacket, hashed bool) (length int) { - for _, subpacket := range subpackets { - if subpacket.hashed == hashed { - length += subpacketLengthLength(len(subpacket.contents) + 1) - length += 1 // type byte - length += len(subpacket.contents) - } - } - return -} - -// serializeSubpackets marshals the given subpackets into to. -func serializeSubpackets(to []byte, subpackets []outputSubpacket, hashed bool) { - for _, subpacket := range subpackets { - if subpacket.hashed == hashed { - n := serializeSubpacketLength(to, len(subpacket.contents)+1) - to[n] = byte(subpacket.subpacketType) - to = to[1+n:] - n = copy(to, subpacket.contents) - to = to[n:] - } - } - return -} - -// KeyExpired returns whether sig is a self-signature of a key that has -// expired. -func (sig *Signature) KeyExpired(currentTime time.Time) bool { - if sig.KeyLifetimeSecs == nil { - return false - } - expiry := sig.CreationTime.Add(time.Duration(*sig.KeyLifetimeSecs) * time.Second) - return currentTime.After(expiry) -} - -// buildHashSuffix constructs the HashSuffix member of sig in preparation for signing. -func (sig *Signature) buildHashSuffix() (err error) { - hashedSubpacketsLen := subpacketsLength(sig.outSubpackets, true) - - var ok bool - l := 6 + hashedSubpacketsLen - sig.HashSuffix = make([]byte, l+6) - sig.HashSuffix[0] = 4 - sig.HashSuffix[1] = uint8(sig.SigType) - sig.HashSuffix[2] = uint8(sig.PubKeyAlgo) - sig.HashSuffix[3], ok = s2k.HashToHashId(sig.Hash) - if !ok { - sig.HashSuffix = nil - return errors.InvalidArgumentError("hash cannot be represented in OpenPGP: " + strconv.Itoa(int(sig.Hash))) - } - sig.HashSuffix[4] = byte(hashedSubpacketsLen >> 8) - sig.HashSuffix[5] = byte(hashedSubpacketsLen) - serializeSubpackets(sig.HashSuffix[6:l], sig.outSubpackets, true) - trailer := sig.HashSuffix[l:] - trailer[0] = 4 - trailer[1] = 0xff - trailer[2] = byte(l >> 24) - trailer[3] = byte(l >> 16) - trailer[4] = byte(l >> 8) - trailer[5] = byte(l) - return -} - -func (sig *Signature) signPrepareHash(h hash.Hash) (digest []byte, err error) { - err = sig.buildHashSuffix() - if err != nil { - return - } - - h.Write(sig.HashSuffix) - digest = h.Sum(nil) - copy(sig.HashTag[:], digest) - return -} - -// Sign signs a message with a private key. The hash, h, must contain -// the hash of the message to be signed and will be mutated by this function. -// On success, the signature is stored in sig. Call Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) Sign(h hash.Hash, priv *PrivateKey, config *Config) (err error) { - signer, hashIsSigner := h.(Signer) - - if !hashIsSigner && (priv == nil || priv.PrivateKey == nil) { - err = errors.InvalidArgumentError("attempting to sign with nil PrivateKey") - return - } - - sig.outSubpackets = sig.buildSubpackets() - digest, err := sig.signPrepareHash(h) - if err != nil { - return - } - - if hashIsSigner { - err = signer.Sign(sig) - return - } - - switch priv.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - sig.RSASignature.bytes, err = rsa.SignPKCS1v15(config.Random(), priv.PrivateKey.(*rsa.PrivateKey), sig.Hash, digest) - sig.RSASignature.bitLength = uint16(8 * len(sig.RSASignature.bytes)) - case PubKeyAlgoDSA: - dsaPriv := priv.PrivateKey.(*dsa.PrivateKey) - - // Need to truncate hashBytes to match FIPS 186-3 section 4.6. - subgroupSize := (dsaPriv.Q.BitLen() + 7) / 8 - if len(digest) > subgroupSize { - digest = digest[:subgroupSize] - } - r, s, err := dsa.Sign(config.Random(), dsaPriv, digest) - if err == nil { - sig.DSASigR.bytes = r.Bytes() - sig.DSASigR.bitLength = uint16(8 * len(sig.DSASigR.bytes)) - sig.DSASigS.bytes = s.Bytes() - sig.DSASigS.bitLength = uint16(8 * len(sig.DSASigS.bytes)) - } - case PubKeyAlgoECDSA: - r, s, err := ecdsa.Sign(config.Random(), priv.PrivateKey.(*ecdsa.PrivateKey), digest) - if err == nil { - sig.ECDSASigR = FromBig(r) - sig.ECDSASigS = FromBig(s) - } - default: - err = errors.UnsupportedError("public key algorithm: " + strconv.Itoa(int(sig.PubKeyAlgo))) - } - - return -} - -// SignUserId computes a signature from priv, asserting that pub is a valid -// key for the identity id. On success, the signature is stored in sig. Call -// Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) SignUserId(id string, pub *PublicKey, priv *PrivateKey, config *Config) error { - h, err := userIdSignatureHash(id, pub, sig.Hash) - if err != nil { - return nil - } - return sig.Sign(h, priv, config) -} - -// SignUserIdWithSigner computes a signature from priv, asserting that pub is a -// valid key for the identity id. On success, the signature is stored in sig. -// Call Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) SignUserIdWithSigner(id string, pub *PublicKey, s Signer, config *Config) error { - updateUserIdSignatureHash(id, pub, s) - - return sig.Sign(s, nil, config) -} - -// SignKey computes a signature from priv, asserting that pub is a subkey. On -// success, the signature is stored in sig. Call Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) SignKey(pub *PublicKey, priv *PrivateKey, config *Config) error { - h, err := keySignatureHash(&priv.PublicKey, pub, sig.Hash) - if err != nil { - return err - } - return sig.Sign(h, priv, config) -} - -// SignKeyWithSigner computes a signature using s, asserting that -// signeePubKey is a subkey. On success, the signature is stored in sig. Call -// Serialize to write it out. If config is nil, sensible defaults will be used. -func (sig *Signature) SignKeyWithSigner(signeePubKey *PublicKey, signerPubKey *PublicKey, s Signer, config *Config) error { - updateKeySignatureHash(signerPubKey, signeePubKey, s) - - return sig.Sign(s, nil, config) -} - -// Serialize marshals sig to w. Sign, SignUserId or SignKey must have been -// called first. -func (sig *Signature) Serialize(w io.Writer) (err error) { - if len(sig.outSubpackets) == 0 { - sig.outSubpackets = sig.rawSubpackets - } - if sig.RSASignature.bytes == nil && sig.DSASigR.bytes == nil && sig.ECDSASigR.bytes == nil { - return errors.InvalidArgumentError("Signature: need to call Sign, SignUserId or SignKey before Serialize") - } - - sigLength := 0 - switch sig.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - sigLength = 2 + len(sig.RSASignature.bytes) - case PubKeyAlgoDSA: - sigLength = 2 + len(sig.DSASigR.bytes) - sigLength += 2 + len(sig.DSASigS.bytes) - case PubKeyAlgoEdDSA: - sigLength = 2 + len(sig.EdDSASigR.bytes) - sigLength += 2 + len(sig.EdDSASigS.bytes) - case PubKeyAlgoECDSA: - sigLength = 2 + len(sig.ECDSASigR.bytes) - sigLength += 2 + len(sig.ECDSASigS.bytes) - default: - panic("impossible") - } - - unhashedSubpacketsLen := subpacketsLength(sig.outSubpackets, false) - length := len(sig.HashSuffix) - 6 /* trailer not included */ + - 2 /* length of unhashed subpackets */ + unhashedSubpacketsLen + - 2 /* hash tag */ + sigLength - err = serializeHeader(w, packetTypeSignature, length) - if err != nil { - return - } - - _, err = w.Write(sig.HashSuffix[:len(sig.HashSuffix)-6]) - if err != nil { - return - } - - unhashedSubpackets := make([]byte, 2+unhashedSubpacketsLen) - unhashedSubpackets[0] = byte(unhashedSubpacketsLen >> 8) - unhashedSubpackets[1] = byte(unhashedSubpacketsLen) - serializeSubpackets(unhashedSubpackets[2:], sig.outSubpackets, false) - - _, err = w.Write(unhashedSubpackets) - if err != nil { - return - } - _, err = w.Write(sig.HashTag[:]) - if err != nil { - return - } - - switch sig.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - err = writeMPIs(w, sig.RSASignature) - case PubKeyAlgoDSA: - err = writeMPIs(w, sig.DSASigR, sig.DSASigS) - case PubKeyAlgoEdDSA: - err = writeMPIs(w, sig.EdDSASigR, sig.EdDSASigS) - case PubKeyAlgoECDSA: - err = writeMPIs(w, sig.ECDSASigR, sig.ECDSASigS) - default: - panic("impossible") - } - return -} - -// outputSubpacket represents a subpacket to be marshaled. -type outputSubpacket struct { - hashed bool // true if this subpacket is in the hashed area. - subpacketType signatureSubpacketType - isCritical bool - contents []byte -} - -func (sig *Signature) buildSubpackets() (subpackets []outputSubpacket) { - creationTime := make([]byte, 4) - binary.BigEndian.PutUint32(creationTime, uint32(sig.CreationTime.Unix())) - subpackets = append(subpackets, outputSubpacket{true, creationTimeSubpacket, false, creationTime}) - - if sig.IssuerKeyId != nil { - keyId := make([]byte, 8) - binary.BigEndian.PutUint64(keyId, *sig.IssuerKeyId) - subpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, false, keyId}) - } - - if sig.SigLifetimeSecs != nil && *sig.SigLifetimeSecs != 0 { - sigLifetime := make([]byte, 4) - binary.BigEndian.PutUint32(sigLifetime, *sig.SigLifetimeSecs) - subpackets = append(subpackets, outputSubpacket{true, signatureExpirationSubpacket, true, sigLifetime}) - } - - // Key flags may only appear in self-signatures or certification signatures. - - if sig.FlagsValid { - var flags byte - if sig.FlagCertify { - flags |= KeyFlagCertify - } - if sig.FlagSign { - flags |= KeyFlagSign - } - if sig.FlagEncryptCommunications { - flags |= KeyFlagEncryptCommunications - } - if sig.FlagEncryptStorage { - flags |= KeyFlagEncryptStorage - } - subpackets = append(subpackets, outputSubpacket{true, keyFlagsSubpacket, false, []byte{flags}}) - } - - // The following subpackets may only appear in self-signatures - - if sig.KeyLifetimeSecs != nil && *sig.KeyLifetimeSecs != 0 { - keyLifetime := make([]byte, 4) - binary.BigEndian.PutUint32(keyLifetime, *sig.KeyLifetimeSecs) - subpackets = append(subpackets, outputSubpacket{true, keyExpirationSubpacket, true, keyLifetime}) - } - - if sig.IsPrimaryId != nil && *sig.IsPrimaryId { - subpackets = append(subpackets, outputSubpacket{true, primaryUserIdSubpacket, false, []byte{1}}) - } - - if len(sig.PreferredSymmetric) > 0 { - subpackets = append(subpackets, outputSubpacket{true, prefSymmetricAlgosSubpacket, false, sig.PreferredSymmetric}) - } - - if len(sig.PreferredHash) > 0 { - subpackets = append(subpackets, outputSubpacket{true, prefHashAlgosSubpacket, false, sig.PreferredHash}) - } - - if len(sig.PreferredCompression) > 0 { - subpackets = append(subpackets, outputSubpacket{true, prefCompressionSubpacket, false, sig.PreferredCompression}) - } - - return -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/patch.sh b/vendor/github.com/keybase/go-crypto/openpgp/patch.sh deleted file mode 100644 index 23cacc8..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/patch.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -patch < sig-v3.patch -patch < s2k-gnu-dummy.patch -find . -type f -name '*.go' -exec sed -i'' -e 's/golang.org\/x\/crypto\/openpgp/github.com\/keybase\/go-crypto\/openpgp/' {} \; -find . -type f -name '*.go-e' -exec rm {} \; -go test ./... diff --git a/vendor/github.com/keybase/go-crypto/openpgp/sig-v3.patch b/vendor/github.com/keybase/go-crypto/openpgp/sig-v3.patch deleted file mode 100644 index bfd764a..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/sig-v3.patch +++ /dev/null @@ -1,135 +0,0 @@ -diff --git a/openpgp/read.go b/openpgp/read.go -index a6cecc5..0c9397b 100644 ---- a/openpgp/read.go -+++ b/openpgp/read.go -@@ -56,8 +56,9 @@ type MessageDetails struct { - // been consumed. Once EOF has been seen, the following fields are - // valid. (An authentication code failure is reported as a - // SignatureError error when reading from UnverifiedBody.) -- SignatureError error // nil if the signature is good. -- Signature *packet.Signature // the signature packet itself. -+ SignatureError error // nil if the signature is good. -+ Signature *packet.Signature // the signature packet itself, if v4 (default) -+ SignatureV3 *packet.SignatureV3 // the signature packet if it is a v2 or v3 signature - - decrypted io.ReadCloser - } -@@ -334,13 +335,15 @@ func (scr *signatureCheckReader) Read(buf []byte) (n int, err error) { - } - - var ok bool -- if scr.md.Signature, ok = p.(*packet.Signature); !ok { -+ if scr.md.Signature, ok = p.(*packet.Signature); ok { -+ scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignature(scr.h, scr.md.Signature) -+ } else if scr.md.SignatureV3, ok = p.(*packet.SignatureV3); ok { -+ scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignatureV3(scr.h, scr.md.SignatureV3) -+ } else { - scr.md.SignatureError = errors.StructuralError("LiteralData not followed by Signature") - return - } - -- scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignature(scr.h, scr.md.Signature) -- - // The SymmetricallyEncrypted packet, if any, might have an - // unsigned hash of its own. In order to check this we need to - // close that Reader. -diff --git a/openpgp/read_test.go b/openpgp/read_test.go -index 52f942c..abe8d7b 100644 ---- a/openpgp/read_test.go -+++ b/openpgp/read_test.go -@@ -13,6 +13,7 @@ import ( - "strings" - "testing" - -+ "golang.org/x/crypto/openpgp/armor" - "golang.org/x/crypto/openpgp/errors" - ) - -@@ -411,6 +412,50 @@ func TestIssue11504(t *testing.T) { - testReadMessageError(t, "9303000130303030303030303030983002303030303030030000000130") - } - -+// TestSignatureV3Message tests the verification of V3 signature, generated -+// with a modern V4-style key. Some people have their clients set to generate -+// V3 signatures, so it's useful to be able to verify them. -+func TestSignatureV3Message(t *testing.T) { -+ sig, err := armor.Decode(strings.NewReader(signedMessageV3)) -+ if err != nil { -+ t.Error(err) -+ return -+ } -+ key, err := ReadArmoredKeyRing(strings.NewReader(keyV4forVerifyingSignedMessageV3)) -+ if err != nil { -+ t.Error(err) -+ return -+ } -+ md, err := ReadMessage(sig.Body, key, nil, nil) -+ if err != nil { -+ t.Error(err) -+ return -+ } -+ -+ _, err = ioutil.ReadAll(md.UnverifiedBody) -+ if err != nil { -+ t.Error(err) -+ return -+ } -+ -+ // We'll see a sig error here after reading in the UnverifiedBody above, -+ // if there was one to see. -+ if err = md.SignatureError; err != nil { -+ t.Error(err) -+ return -+ } -+ -+ if md.SignatureV3 == nil { -+ t.Errorf("No available signature after checking signature") -+ return -+ } -+ if md.Signature != nil { -+ t.Errorf("Did not expect a signature V4 back") -+ return -+ } -+ return -+} -+ - const testKey1KeyId = 0xA34D7E18C20C31BB - const testKey3KeyId = 0x338934250CCC0360 - -@@ -504,3 +549,36 @@ const unknownHashFunctionHex = `8a00000040040001990006050253863c24000a09103b4fe6 - const missingHashFunctionHex = `8a00000040040001030006050253863c24000a09103b4fe6acc0b21f32ffff0101010101010101010101010101010101010101010101010101010101010101010101010101` - - const campbellQuine = `a0b001000300fcffa0b001000d00f2ff000300fcffa0b001000d00f2ff8270a01c00000500faff8270a01c00000500faff000500faff001400ebff8270a01c00000500faff000500faff001400ebff428821c400001400ebff428821c400001400ebff428821c400001400ebff428821c400001400ebff428821c400000000ffff000000ffff000b00f4ff428821c400000000ffff000000ffff000b00f4ff0233214c40000100feff000233214c40000100feff0000` -+ -+const keyV4forVerifyingSignedMessageV3 = `-----BEGIN PGP PUBLIC KEY BLOCK----- -+Comment: GPGTools - https://gpgtools.org -+ -+mI0EVfxoFQEEAMBIqmbDfYygcvP6Phr1wr1XI41IF7Qixqybs/foBF8qqblD9gIY -+BKpXjnBOtbkcVOJ0nljd3/sQIfH4E0vQwK5/4YRQSI59eKOqd6Fx+fWQOLG+uu6z -+tewpeCj9LLHvibx/Sc7VWRnrznia6ftrXxJ/wHMezSab3tnGC0YPVdGNABEBAAG0 -+JEdvY3J5cHRvIFRlc3QgS2V5IDx0aGVtYXhAZ21haWwuY29tPoi5BBMBCgAjBQJV -+/GgVAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQeXnQmhdGW9PFVAP+ -+K7TU0qX5ArvIONIxh/WAweyOk884c5cE8f+3NOPOOCRGyVy0FId5A7MmD5GOQh4H -+JseOZVEVCqlmngEvtHZb3U1VYtVGE5WZ+6rQhGsMcWP5qaT4soYwMBlSYxgYwQcx -+YhN9qOr292f9j2Y//TTIJmZT4Oa+lMxhWdqTfX+qMgG4jQRV/GgVAQQArhFSiij1 -+b+hT3dnapbEU+23Z1yTu1DfF6zsxQ4XQWEV3eR8v+8mEDDNcz8oyyF56k6UQ3rXi -+UMTIwRDg4V6SbZmaFbZYCOwp/EmXJ3rfhm7z7yzXj2OFN22luuqbyVhuL7LRdB0M -+pxgmjXb4tTvfgKd26x34S+QqUJ7W6uprY4sAEQEAAYifBBgBCgAJBQJV/GgVAhsM -+AAoJEHl50JoXRlvT7y8D/02ckx4OMkKBZo7viyrBw0MLG92i+DC2bs35PooHR6zz -+786mitjOp5z2QWNLBvxC70S0qVfCIz8jKupO1J6rq6Z8CcbLF3qjm6h1omUBf8Nd -+EfXKD2/2HV6zMKVknnKzIEzauh+eCKS2CeJUSSSryap/QLVAjRnckaES/OsEWhNB -+=RZia -+-----END PGP PUBLIC KEY BLOCK----- -+` -+ -+const signedMessageV3 = `-----BEGIN PGP MESSAGE----- -+Comment: GPGTools - https://gpgtools.org -+ -+owGbwMvMwMVYWXlhlrhb9GXG03JJDKF/MtxDMjKLFYAoUaEktbhEITe1uDgxPVWP -+q5NhKjMrWAVcC9evD8z/bF/uWNjqtk/X3y5/38XGRQHm/57rrDRYuGnTw597Xqka -+uM3137/hH3Os+Jf2dc0fXOITKwJvXJvecPVs0ta+Vg7ZO1MLn8w58Xx+6L58mbka -+DGHyU9yTueZE8D+QF/Tz28Y78dqtF56R1VPn9Xw4uJqrWYdd7b3vIZ1V6R4Nh05d -+iT57d/OhWwA= -+=hG7R -+-----END PGP MESSAGE----- -+` diff --git a/vendor/github.com/keybase/go-crypto/openpgp/write.go b/vendor/github.com/keybase/go-crypto/openpgp/write.go deleted file mode 100644 index 03b019e..0000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/write.go +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package openpgp - -import ( - "crypto" - "hash" - "io" - "strconv" - "time" - - "github.com/keybase/go-crypto/openpgp/armor" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/openpgp/packet" - "github.com/keybase/go-crypto/openpgp/s2k" -) - -// DetachSign signs message with the private key from signer (which must -// already have been decrypted) and writes the signature to w. -// If config is nil, sensible defaults will be used. -func DetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { - return detachSign(w, signer, message, packet.SigTypeBinary, config) -} - -// ArmoredDetachSign signs message with the private key from signer (which -// must already have been decrypted) and writes an armored signature to w. -// If config is nil, sensible defaults will be used. -func ArmoredDetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) (err error) { - return armoredDetachSign(w, signer, message, packet.SigTypeBinary, config) -} - -// DetachSignText signs message (after canonicalising the line endings) with -// the private key from signer (which must already have been decrypted) and -// writes the signature to w. -// If config is nil, sensible defaults will be used. -func DetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { - return detachSign(w, signer, message, packet.SigTypeText, config) -} - -// ArmoredDetachSignText signs message (after canonicalising the line endings) -// with the private key from signer (which must already have been decrypted) -// and writes an armored signature to w. -// If config is nil, sensible defaults will be used. -func ArmoredDetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { - return armoredDetachSign(w, signer, message, packet.SigTypeText, config) -} - -func armoredDetachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { - out, err := armor.Encode(w, SignatureType, nil) - if err != nil { - return - } - err = detachSign(out, signer, message, sigType, config) - if err != nil { - return - } - return out.Close() -} - -// SignWithSigner signs the message of type sigType with s and writes the -// signature to w. -// If config is nil, sensible defaults will be used. -func SignWithSigner(s packet.Signer, w io.Writer, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { - keyId := s.KeyId() - sig := new(packet.Signature) - sig.SigType = sigType - sig.PubKeyAlgo = s.PublicKeyAlgo() - sig.Hash = config.Hash() - sig.CreationTime = config.Now() - sig.IssuerKeyId = &keyId - - s.Reset() - - wrapped := s.(hash.Hash) - - if sigType == packet.SigTypeText { - wrapped = NewCanonicalTextHash(s) - } - - io.Copy(wrapped, message) - - err = sig.Sign(s, nil, config) - if err != nil { - return - } - - err = sig.Serialize(w) - - return -} - -func detachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { - signerSubkey, ok := signer.signingKey(config.Now()) - if !ok { - err = errors.InvalidArgumentError("no valid signing keys") - return - } - if signerSubkey.PrivateKey == nil { - return errors.InvalidArgumentError("signing key doesn't have a private key") - } - if signerSubkey.PrivateKey.Encrypted { - return errors.InvalidArgumentError("signing key is encrypted") - } - - sig := new(packet.Signature) - sig.SigType = sigType - sig.PubKeyAlgo = signerSubkey.PrivateKey.PubKeyAlgo - sig.Hash = config.Hash() - sig.CreationTime = config.Now() - sig.IssuerKeyId = &signerSubkey.PrivateKey.KeyId - - h, wrappedHash, err := hashForSignature(sig.Hash, sig.SigType) - if err != nil { - return - } - io.Copy(wrappedHash, message) - - err = sig.Sign(h, signerSubkey.PrivateKey, config) - if err != nil { - return - } - - return sig.Serialize(w) -} - -// FileHints contains metadata about encrypted files. This metadata is, itself, -// encrypted. -type FileHints struct { - // IsBinary can be set to hint that the contents are binary data. - IsBinary bool - // FileName hints at the name of the file that should be written. It's - // truncated to 255 bytes if longer. It may be empty to suggest that the - // file should not be written to disk. It may be equal to "_CONSOLE" to - // suggest the data should not be written to disk. - FileName string - // ModTime contains the modification time of the file, or the zero time if not applicable. - ModTime time.Time -} - -// SymmetricallyEncrypt acts like gpg -c: it encrypts a file with a passphrase. -// The resulting WriteCloser must be closed after the contents of the file have -// been written. -// If config is nil, sensible defaults will be used. -func SymmetricallyEncrypt(ciphertext io.Writer, passphrase []byte, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { - if hints == nil { - hints = &FileHints{} - } - - key, err := packet.SerializeSymmetricKeyEncrypted(ciphertext, passphrase, config) - if err != nil { - return - } - w, err := packet.SerializeSymmetricallyEncrypted(ciphertext, config.Cipher(), key, config) - if err != nil { - return - } - - literaldata := w - if algo := config.Compression(); algo != packet.CompressionNone { - var compConfig *packet.CompressionConfig - if config != nil { - compConfig = config.CompressionConfig - } - literaldata, err = packet.SerializeCompressed(w, algo, compConfig) - if err != nil { - return - } - } - - var epochSeconds uint32 - if !hints.ModTime.IsZero() { - epochSeconds = uint32(hints.ModTime.Unix()) - } - return packet.SerializeLiteral(literaldata, hints.IsBinary, hints.FileName, epochSeconds) -} - -// intersectPreferences mutates and returns a prefix of a that contains only -// the values in the intersection of a and b. The order of a is preserved. -func intersectPreferences(a []uint8, b []uint8) (intersection []uint8) { - var j int - for _, v := range a { - for _, v2 := range b { - if v == v2 { - a[j] = v - j++ - break - } - } - } - - return a[:j] -} - -func hashToHashId(h crypto.Hash) uint8 { - v, ok := s2k.HashToHashId(h) - if !ok { - panic("tried to convert unknown hash") - } - return v -} - -// Encrypt encrypts a message to a number of recipients and, optionally, signs -// it. hints contains optional information, that is also encrypted, that aids -// the recipients in processing the message. The resulting WriteCloser must -// be closed after the contents of the file have been written. -// If config is nil, sensible defaults will be used. -func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { - var signer *packet.PrivateKey - if signed != nil { - signKey, ok := signed.signingKey(config.Now()) - if !ok { - return nil, errors.InvalidArgumentError("no valid signing keys") - } - signer = signKey.PrivateKey - if signer == nil { - return nil, errors.InvalidArgumentError("no private key in signing key") - } - if signer.Encrypted { - return nil, errors.InvalidArgumentError("signing key must be decrypted") - } - } - - // These are the possible ciphers that we'll use for the message. - candidateCiphers := []uint8{ - uint8(packet.CipherAES128), - uint8(packet.CipherAES256), - uint8(packet.CipherCAST5), - } - // These are the possible hash functions that we'll use for the signature. - candidateHashes := []uint8{ - hashToHashId(crypto.SHA256), - hashToHashId(crypto.SHA512), - hashToHashId(crypto.SHA1), - hashToHashId(crypto.RIPEMD160), - } - - // If no preferences were specified, assume something safe and reasonable. - defaultCiphers := []uint8{ - uint8(packet.CipherAES128), - uint8(packet.CipherAES192), - uint8(packet.CipherAES256), - uint8(packet.CipherCAST5), - } - - defaultHashes := []uint8{ - hashToHashId(crypto.SHA256), - hashToHashId(crypto.SHA512), - hashToHashId(crypto.RIPEMD160), - } - - encryptKeys := make([]Key, len(to)) - for i := range to { - var ok bool - encryptKeys[i], ok = to[i].encryptionKey(config.Now()) - if !ok { - return nil, errors.InvalidArgumentError("cannot encrypt a message to key id " + strconv.FormatUint(to[i].PrimaryKey.KeyId, 16) + " because it has no encryption keys") - } - - sig := to[i].primaryIdentity().SelfSignature - - preferredSymmetric := sig.PreferredSymmetric - if len(preferredSymmetric) == 0 { - preferredSymmetric = defaultCiphers - } - preferredHashes := sig.PreferredHash - if len(preferredHashes) == 0 { - preferredHashes = defaultHashes - } - candidateCiphers = intersectPreferences(candidateCiphers, preferredSymmetric) - candidateHashes = intersectPreferences(candidateHashes, preferredHashes) - } - - if len(candidateCiphers) == 0 { - return nil, errors.InvalidArgumentError("cannot encrypt because recipient set shares no common ciphers") - } - if len(candidateHashes) == 0 { - return nil, errors.InvalidArgumentError("cannot encrypt because recipient set shares no common hashes") - } - - cipher := packet.CipherFunction(candidateCiphers[0]) - // If the cipher specifed by config is a candidate, we'll use that. - configuredCipher := config.Cipher() - for _, c := range candidateCiphers { - cipherFunc := packet.CipherFunction(c) - if cipherFunc == configuredCipher { - cipher = cipherFunc - break - } - } - - var hash crypto.Hash - for _, hashId := range candidateHashes { - if h, ok := s2k.HashIdToHash(hashId); ok && h.Available() { - hash = h - break - } - } - - // If the hash specified by config is a candidate, we'll use that. - if configuredHash := config.Hash(); configuredHash.Available() { - for _, hashId := range candidateHashes { - if h, ok := s2k.HashIdToHash(hashId); ok && h == configuredHash { - hash = h - break - } - } - } - - if hash == 0 { - hashId := candidateHashes[0] - name, ok := s2k.HashIdToString(hashId) - if !ok { - name = "#" + strconv.Itoa(int(hashId)) - } - return nil, errors.InvalidArgumentError("cannot encrypt because no candidate hash functions are compiled in. (Wanted " + name + " in this case.)") - } - - symKey := make([]byte, cipher.KeySize()) - if _, err := io.ReadFull(config.Random(), symKey); err != nil { - return nil, err - } - - for _, key := range encryptKeys { - if err := packet.SerializeEncryptedKey(ciphertext, key.PublicKey, cipher, symKey, config); err != nil { - return nil, err - } - } - - encryptedData, err := packet.SerializeSymmetricallyEncrypted(ciphertext, cipher, symKey, config) - if err != nil { - return - } - - if signer != nil { - ops := &packet.OnePassSignature{ - SigType: packet.SigTypeBinary, - Hash: hash, - PubKeyAlgo: signer.PubKeyAlgo, - KeyId: signer.KeyId, - IsLast: true, - } - if err := ops.Serialize(encryptedData); err != nil { - return nil, err - } - } - - if hints == nil { - hints = &FileHints{} - } - - w := encryptedData - if signer != nil { - // If we need to write a signature packet after the literal - // data then we need to stop literalData from closing - // encryptedData. - w = noOpCloser{encryptedData} - - } - var epochSeconds uint32 - if !hints.ModTime.IsZero() { - epochSeconds = uint32(hints.ModTime.Unix()) - } - literalData, err := packet.SerializeLiteral(w, hints.IsBinary, hints.FileName, epochSeconds) - if err != nil { - return nil, err - } - - if signer != nil { - return signatureWriter{encryptedData, literalData, hash, hash.New(), signer, config}, nil - } - return literalData, nil -} - -// signatureWriter hashes the contents of a message while passing it along to -// literalData. When closed, it closes literalData, writes a signature packet -// to encryptedData and then also closes encryptedData. -type signatureWriter struct { - encryptedData io.WriteCloser - literalData io.WriteCloser - hashType crypto.Hash - h hash.Hash - signer *packet.PrivateKey - config *packet.Config -} - -func (s signatureWriter) Write(data []byte) (int, error) { - s.h.Write(data) - return s.literalData.Write(data) -} - -func (s signatureWriter) Close() error { - sig := &packet.Signature{ - SigType: packet.SigTypeBinary, - PubKeyAlgo: s.signer.PubKeyAlgo, - Hash: s.hashType, - CreationTime: s.config.Now(), - IssuerKeyId: &s.signer.KeyId, - } - - if err := sig.Sign(s.h, s.signer, s.config); err != nil { - return err - } - if err := s.literalData.Close(); err != nil { - return err - } - if err := sig.Serialize(s.encryptedData); err != nil { - return err - } - return s.encryptedData.Close() -} - -// noOpCloser is like an ioutil.NopCloser, but for an io.Writer. -// TODO: we have two of these in OpenPGP packages alone. This probably needs -// to be promoted somewhere more common. -type noOpCloser struct { - w io.Writer -} - -func (c noOpCloser) Write(data []byte) (n int, err error) { - return c.w.Write(data) -} - -func (c noOpCloser) Close() error { - return nil -} - -// AttachedSign is like openpgp.Encrypt (as in p.crypto/openpgp/write.go), but -// don't encrypt at all, just sign the literal unencrypted data. -// Unfortunately we need to duplicate some code here that's already -// in write.go -func AttachedSign(out io.WriteCloser, signed Entity, hints *FileHints, - config *packet.Config) (in io.WriteCloser, err error) { - - if hints == nil { - hints = &FileHints{} - } - - if config == nil { - config = &packet.Config{} - } - - var signer *packet.PrivateKey - - signKey, ok := signed.signingKey(config.Now()) - if !ok { - err = errors.InvalidArgumentError("no valid signing keys") - return - } - signer = signKey.PrivateKey - if signer == nil { - err = errors.InvalidArgumentError("no valid signing keys") - return - } - if signer.Encrypted { - err = errors.InvalidArgumentError("signing key must be decrypted") - return - } - - hasher := crypto.SHA512 - - ops := &packet.OnePassSignature{ - SigType: packet.SigTypeBinary, - Hash: hasher, - PubKeyAlgo: signer.PubKeyAlgo, - KeyId: signer.KeyId, - IsLast: true, - } - - if err = ops.Serialize(out); err != nil { - return - } - - var epochSeconds uint32 - if !hints.ModTime.IsZero() { - epochSeconds = uint32(hints.ModTime.Unix()) - } - - // We don't want the literal serializer to closer the output stream - // since we're going to need to write to it when we finish up the - // signature stuff. - in, err = packet.SerializeLiteral(noOpCloser{out}, hints.IsBinary, hints.FileName, epochSeconds) - - if err != nil { - return - } - - // If we need to write a signature packet after the literal - // data then we need to stop literalData from closing - // encryptedData. - in = signatureWriter{out, in, hasher, hasher.New(), signer, config} - - return -} diff --git a/vendor/github.com/keybase/go-crypto/rsa/pkcs1v15.go b/vendor/github.com/keybase/go-crypto/rsa/pkcs1v15.go deleted file mode 100644 index 5c5f415..0000000 --- a/vendor/github.com/keybase/go-crypto/rsa/pkcs1v15.go +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package rsa - -import ( - "crypto" - "crypto/subtle" - "errors" - "io" - "math/big" -) - -// This file implements encryption and decryption using PKCS#1 v1.5 padding. - -// PKCS1v15DecrypterOpts is for passing options to PKCS#1 v1.5 decryption using -// the crypto.Decrypter interface. -type PKCS1v15DecryptOptions struct { - // SessionKeyLen is the length of the session key that is being - // decrypted. If not zero, then a padding error during decryption will - // cause a random plaintext of this length to be returned rather than - // an error. These alternatives happen in constant time. - SessionKeyLen int -} - -// EncryptPKCS1v15 encrypts the given message with RSA and the padding scheme from PKCS#1 v1.5. -// The message must be no longer than the length of the public modulus minus 11 bytes. -// -// The rand parameter is used as a source of entropy to ensure that encrypting -// the same message twice doesn't result in the same ciphertext. -// -// WARNING: use of this function to encrypt plaintexts other than session keys -// is dangerous. Use RSA OAEP in new protocols. -func EncryptPKCS1v15(rand io.Reader, pub *PublicKey, msg []byte) (out []byte, err error) { - if err := checkPub(pub); err != nil { - return nil, err - } - k := (pub.N.BitLen() + 7) / 8 - if len(msg) > k-11 { - err = ErrMessageTooLong - return - } - - // EM = 0x00 || 0x02 || PS || 0x00 || M - em := make([]byte, k) - em[1] = 2 - ps, mm := em[2:len(em)-len(msg)-1], em[len(em)-len(msg):] - err = nonZeroRandomBytes(ps, rand) - if err != nil { - return - } - em[len(em)-len(msg)-1] = 0 - copy(mm, msg) - - m := new(big.Int).SetBytes(em) - c := encrypt(new(big.Int), pub, m) - - copyWithLeftPad(em, c.Bytes()) - out = em - return -} - -// DecryptPKCS1v15 decrypts a plaintext using RSA and the padding scheme from PKCS#1 v1.5. -// If rand != nil, it uses RSA blinding to avoid timing side-channel attacks. -// -// Note that whether this function returns an error or not discloses secret -// information. If an attacker can cause this function to run repeatedly and -// learn whether each instance returned an error then they can decrypt and -// forge signatures as if they had the private key. See -// DecryptPKCS1v15SessionKey for a way of solving this problem. -func DecryptPKCS1v15(rand io.Reader, priv *PrivateKey, ciphertext []byte) (out []byte, err error) { - if err := checkPub(&priv.PublicKey); err != nil { - return nil, err - } - valid, out, index, err := decryptPKCS1v15(rand, priv, ciphertext) - if err != nil { - return - } - if valid == 0 { - return nil, ErrDecryption - } - out = out[index:] - return -} - -// DecryptPKCS1v15SessionKey decrypts a session key using RSA and the padding scheme from PKCS#1 v1.5. -// If rand != nil, it uses RSA blinding to avoid timing side-channel attacks. -// It returns an error if the ciphertext is the wrong length or if the -// ciphertext is greater than the public modulus. Otherwise, no error is -// returned. If the padding is valid, the resulting plaintext message is copied -// into key. Otherwise, key is unchanged. These alternatives occur in constant -// time. It is intended that the user of this function generate a random -// session key beforehand and continue the protocol with the resulting value. -// This will remove any possibility that an attacker can learn any information -// about the plaintext. -// See ``Chosen Ciphertext Attacks Against Protocols Based on the RSA -// Encryption Standard PKCS #1'', Daniel Bleichenbacher, Advances in Cryptology -// (Crypto '98). -// -// Note that if the session key is too small then it may be possible for an -// attacker to brute-force it. If they can do that then they can learn whether -// a random value was used (because it'll be different for the same ciphertext) -// and thus whether the padding was correct. This defeats the point of this -// function. Using at least a 16-byte key will protect against this attack. -func DecryptPKCS1v15SessionKey(rand io.Reader, priv *PrivateKey, ciphertext []byte, key []byte) (err error) { - if err := checkPub(&priv.PublicKey); err != nil { - return err - } - k := (priv.N.BitLen() + 7) / 8 - if k-(len(key)+3+8) < 0 { - return ErrDecryption - } - - valid, em, index, err := decryptPKCS1v15(rand, priv, ciphertext) - if err != nil { - return - } - - if len(em) != k { - // This should be impossible because decryptPKCS1v15 always - // returns the full slice. - return ErrDecryption - } - - valid &= subtle.ConstantTimeEq(int32(len(em)-index), int32(len(key))) - subtle.ConstantTimeCopy(valid, key, em[len(em)-len(key):]) - return -} - -// decryptPKCS1v15 decrypts ciphertext using priv and blinds the operation if -// rand is not nil. It returns one or zero in valid that indicates whether the -// plaintext was correctly structured. In either case, the plaintext is -// returned in em so that it may be read independently of whether it was valid -// in order to maintain constant memory access patterns. If the plaintext was -// valid then index contains the index of the original message in em. -func decryptPKCS1v15(rand io.Reader, priv *PrivateKey, ciphertext []byte) (valid int, em []byte, index int, err error) { - k := (priv.N.BitLen() + 7) / 8 - if k < 11 { - err = ErrDecryption - return - } - - c := new(big.Int).SetBytes(ciphertext) - m, err := decrypt(rand, priv, c) - if err != nil { - return - } - - em = leftPad(m.Bytes(), k) - firstByteIsZero := subtle.ConstantTimeByteEq(em[0], 0) - secondByteIsTwo := subtle.ConstantTimeByteEq(em[1], 2) - - // The remainder of the plaintext must be a string of non-zero random - // octets, followed by a 0, followed by the message. - // lookingForIndex: 1 iff we are still looking for the zero. - // index: the offset of the first zero byte. - lookingForIndex := 1 - - for i := 2; i < len(em); i++ { - equals0 := subtle.ConstantTimeByteEq(em[i], 0) - index = subtle.ConstantTimeSelect(lookingForIndex&equals0, i, index) - lookingForIndex = subtle.ConstantTimeSelect(equals0, 0, lookingForIndex) - } - - // The PS padding must be at least 8 bytes long, and it starts two - // bytes into em. - validPS := subtle.ConstantTimeLessOrEq(2+8, index) - - valid = firstByteIsZero & secondByteIsTwo & (^lookingForIndex & 1) & validPS - index = subtle.ConstantTimeSelect(valid, index+1, 0) - return valid, em, index, nil -} - -// nonZeroRandomBytes fills the given slice with non-zero random octets. -func nonZeroRandomBytes(s []byte, rand io.Reader) (err error) { - _, err = io.ReadFull(rand, s) - if err != nil { - return - } - - for i := 0; i < len(s); i++ { - for s[i] == 0 { - _, err = io.ReadFull(rand, s[i:i+1]) - if err != nil { - return - } - // In tests, the PRNG may return all zeros so we do - // this to break the loop. - s[i] ^= 0x42 - } - } - - return -} - -// These are ASN1 DER structures: -// DigestInfo ::= SEQUENCE { -// digestAlgorithm AlgorithmIdentifier, -// digest OCTET STRING -// } -// For performance, we don't use the generic ASN1 encoder. Rather, we -// precompute a prefix of the digest value that makes a valid ASN1 DER string -// with the correct contents. -var hashPrefixes = map[crypto.Hash][]byte{ - crypto.MD5: {0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10}, - crypto.SHA1: {0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14}, - crypto.SHA224: {0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c}, - crypto.SHA256: {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20}, - crypto.SHA384: {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30}, - crypto.SHA512: {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40}, - crypto.MD5SHA1: {}, // A special TLS case which doesn't use an ASN1 prefix. - crypto.RIPEMD160: {0x30, 0x20, 0x30, 0x08, 0x06, 0x06, 0x28, 0xcf, 0x06, 0x03, 0x00, 0x31, 0x04, 0x14}, -} - -// SignPKCS1v15 calculates the signature of hashed using RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5. -// Note that hashed must be the result of hashing the input message using the -// given hash function. If hash is zero, hashed is signed directly. This isn't -// advisable except for interoperability. -// -// If rand is not nil then RSA blinding will be used to avoid timing side-channel attacks. -// -// This function is deterministic. Thus, if the set of possible messages is -// small, an attacker may be able to build a map from messages to signatures -// and identify the signed messages. As ever, signatures provide authenticity, -// not confidentiality. -func SignPKCS1v15(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte) (s []byte, err error) { - hashLen, prefix, err := pkcs1v15HashInfo(hash, len(hashed)) - if err != nil { - return - } - - tLen := len(prefix) + hashLen - k := (priv.N.BitLen() + 7) / 8 - if k < tLen+11 { - return nil, ErrMessageTooLong - } - - // EM = 0x00 || 0x01 || PS || 0x00 || T - em := make([]byte, k) - em[1] = 1 - for i := 2; i < k-tLen-1; i++ { - em[i] = 0xff - } - copy(em[k-tLen:k-hashLen], prefix) - copy(em[k-hashLen:k], hashed) - - m := new(big.Int).SetBytes(em) - c, err := decryptAndCheck(rand, priv, m) - if err != nil { - return - } - - copyWithLeftPad(em, c.Bytes()) - s = em - return -} - -// VerifyPKCS1v15 verifies an RSA PKCS#1 v1.5 signature. -// hashed is the result of hashing the input message using the given hash -// function and sig is the signature. A valid signature is indicated by -// returning a nil error. If hash is zero then hashed is used directly. This -// isn't advisable except for interoperability. -func VerifyPKCS1v15(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte) (err error) { - hashLen, prefix, err := pkcs1v15HashInfo(hash, len(hashed)) - if err != nil { - return - } - - tLen := len(prefix) + hashLen - k := (pub.N.BitLen() + 7) / 8 - if k < tLen+11 { - err = ErrVerification - return - } - - c := new(big.Int).SetBytes(sig) - m := encrypt(new(big.Int), pub, c) - em := leftPad(m.Bytes(), k) - // EM = 0x00 || 0x01 || PS || 0x00 || T - - ok := subtle.ConstantTimeByteEq(em[0], 0) - ok &= subtle.ConstantTimeByteEq(em[1], 1) - ok &= subtle.ConstantTimeCompare(em[k-hashLen:k], hashed) - ok &= subtle.ConstantTimeCompare(em[k-tLen:k-hashLen], prefix) - ok &= subtle.ConstantTimeByteEq(em[k-tLen-1], 0) - - for i := 2; i < k-tLen-1; i++ { - ok &= subtle.ConstantTimeByteEq(em[i], 0xff) - } - - if ok != 1 { - return ErrVerification - } - - return nil -} - -func pkcs1v15HashInfo(hash crypto.Hash, inLen int) (hashLen int, prefix []byte, err error) { - // Special case: crypto.Hash(0) is used to indicate that the data is - // signed directly. - if hash == 0 { - return inLen, nil, nil - } - - hashLen = hash.Size() - if inLen != hashLen { - return 0, nil, errors.New("crypto/rsa: input must be hashed message") - } - prefix, ok := hashPrefixes[hash] - if !ok { - return 0, nil, errors.New("crypto/rsa: unsupported hash function") - } - return -} - -// copyWithLeftPad copies src to the end of dest, padding with zero bytes as -// needed. -func copyWithLeftPad(dest, src []byte) { - numPaddingBytes := len(dest) - len(src) - for i := 0; i < numPaddingBytes; i++ { - dest[i] = 0 - } - copy(dest[numPaddingBytes:], src) -} diff --git a/vendor/github.com/keybase/go-crypto/rsa/pss.go b/vendor/github.com/keybase/go-crypto/rsa/pss.go deleted file mode 100644 index 8a94589..0000000 --- a/vendor/github.com/keybase/go-crypto/rsa/pss.go +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package rsa - -// This file implements the PSS signature scheme [1]. -// -// [1] http://www.rsa.com/rsalabs/pkcs/files/h11300-wp-pkcs-1v2-2-rsa-cryptography-standard.pdf - -import ( - "bytes" - "crypto" - "errors" - "hash" - "io" - "math/big" -) - -func emsaPSSEncode(mHash []byte, emBits int, salt []byte, hash hash.Hash) ([]byte, error) { - // See [1], section 9.1.1 - hLen := hash.Size() - sLen := len(salt) - emLen := (emBits + 7) / 8 - - // 1. If the length of M is greater than the input limitation for the - // hash function (2^61 - 1 octets for SHA-1), output "message too - // long" and stop. - // - // 2. Let mHash = Hash(M), an octet string of length hLen. - - if len(mHash) != hLen { - return nil, errors.New("crypto/rsa: input must be hashed message") - } - - // 3. If emLen < hLen + sLen + 2, output "encoding error" and stop. - - if emLen < hLen+sLen+2 { - return nil, errors.New("crypto/rsa: encoding error") - } - - em := make([]byte, emLen) - db := em[:emLen-sLen-hLen-2+1+sLen] - h := em[emLen-sLen-hLen-2+1+sLen : emLen-1] - - // 4. Generate a random octet string salt of length sLen; if sLen = 0, - // then salt is the empty string. - // - // 5. Let - // M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; - // - // M' is an octet string of length 8 + hLen + sLen with eight - // initial zero octets. - // - // 6. Let H = Hash(M'), an octet string of length hLen. - - var prefix [8]byte - - hash.Write(prefix[:]) - hash.Write(mHash) - hash.Write(salt) - - h = hash.Sum(h[:0]) - hash.Reset() - - // 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2 - // zero octets. The length of PS may be 0. - // - // 8. Let DB = PS || 0x01 || salt; DB is an octet string of length - // emLen - hLen - 1. - - db[emLen-sLen-hLen-2] = 0x01 - copy(db[emLen-sLen-hLen-1:], salt) - - // 9. Let dbMask = MGF(H, emLen - hLen - 1). - // - // 10. Let maskedDB = DB \xor dbMask. - - mgf1XOR(db, hash, h) - - // 11. Set the leftmost 8 * emLen - emBits bits of the leftmost octet in - // maskedDB to zero. - - db[0] &= (0xFF >> uint(8*emLen-emBits)) - - // 12. Let EM = maskedDB || H || 0xbc. - em[emLen-1] = 0xBC - - // 13. Output EM. - return em, nil -} - -func emsaPSSVerify(mHash, em []byte, emBits, sLen int, hash hash.Hash) error { - // 1. If the length of M is greater than the input limitation for the - // hash function (2^61 - 1 octets for SHA-1), output "inconsistent" - // and stop. - // - // 2. Let mHash = Hash(M), an octet string of length hLen. - hLen := hash.Size() - if hLen != len(mHash) { - return ErrVerification - } - - // 3. If emLen < hLen + sLen + 2, output "inconsistent" and stop. - emLen := (emBits + 7) / 8 - if emLen < hLen+sLen+2 { - return ErrVerification - } - - // 4. If the rightmost octet of EM does not have hexadecimal value - // 0xbc, output "inconsistent" and stop. - if em[len(em)-1] != 0xBC { - return ErrVerification - } - - // 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and - // let H be the next hLen octets. - db := em[:emLen-hLen-1] - h := em[emLen-hLen-1 : len(em)-1] - - // 6. If the leftmost 8 * emLen - emBits bits of the leftmost octet in - // maskedDB are not all equal to zero, output "inconsistent" and - // stop. - if em[0]&(0xFF<> uint(8*emLen-emBits)) - - if sLen == PSSSaltLengthAuto { - FindSaltLength: - for sLen = emLen - (hLen + 2); sLen >= 0; sLen-- { - switch db[emLen-hLen-sLen-2] { - case 1: - break FindSaltLength - case 0: - continue - default: - return ErrVerification - } - } - if sLen < 0 { - return ErrVerification - } - } else { - // 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero - // or if the octet at position emLen - hLen - sLen - 1 (the leftmost - // position is "position 1") does not have hexadecimal value 0x01, - // output "inconsistent" and stop. - for _, e := range db[:emLen-hLen-sLen-2] { - if e != 0x00 { - return ErrVerification - } - } - if db[emLen-hLen-sLen-2] != 0x01 { - return ErrVerification - } - } - - // 11. Let salt be the last sLen octets of DB. - salt := db[len(db)-sLen:] - - // 12. Let - // M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt ; - // M' is an octet string of length 8 + hLen + sLen with eight - // initial zero octets. - // - // 13. Let H' = Hash(M'), an octet string of length hLen. - var prefix [8]byte - hash.Write(prefix[:]) - hash.Write(mHash) - hash.Write(salt) - - h0 := hash.Sum(nil) - - // 14. If H = H', output "consistent." Otherwise, output "inconsistent." - if !bytes.Equal(h0, h) { - return ErrVerification - } - return nil -} - -// signPSSWithSalt calculates the signature of hashed using PSS [1] with specified salt. -// Note that hashed must be the result of hashing the input message using the -// given hash function. salt is a random sequence of bytes whose length will be -// later used to verify the signature. -func signPSSWithSalt(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed, salt []byte) (s []byte, err error) { - nBits := priv.N.BitLen() - em, err := emsaPSSEncode(hashed, nBits-1, salt, hash.New()) - if err != nil { - return - } - m := new(big.Int).SetBytes(em) - c, err := decryptAndCheck(rand, priv, m) - if err != nil { - return - } - s = make([]byte, (nBits+7)/8) - copyWithLeftPad(s, c.Bytes()) - return -} - -const ( - // PSSSaltLengthAuto causes the salt in a PSS signature to be as large - // as possible when signing, and to be auto-detected when verifying. - PSSSaltLengthAuto = 0 - // PSSSaltLengthEqualsHash causes the salt length to equal the length - // of the hash used in the signature. - PSSSaltLengthEqualsHash = -1 -) - -// PSSOptions contains options for creating and verifying PSS signatures. -type PSSOptions struct { - // SaltLength controls the length of the salt used in the PSS - // signature. It can either be a number of bytes, or one of the special - // PSSSaltLength constants. - SaltLength int - - // Hash, if not zero, overrides the hash function passed to SignPSS. - // This is the only way to specify the hash function when using the - // crypto.Signer interface. - Hash crypto.Hash -} - -// HashFunc returns pssOpts.Hash so that PSSOptions implements -// crypto.SignerOpts. -func (pssOpts *PSSOptions) HashFunc() crypto.Hash { - return pssOpts.Hash -} - -func (opts *PSSOptions) saltLength() int { - if opts == nil { - return PSSSaltLengthAuto - } - return opts.SaltLength -} - -// SignPSS calculates the signature of hashed using RSASSA-PSS [1]. -// Note that hashed must be the result of hashing the input message using the -// given hash function. The opts argument may be nil, in which case sensible -// defaults are used. -func SignPSS(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte, opts *PSSOptions) (s []byte, err error) { - saltLength := opts.saltLength() - switch saltLength { - case PSSSaltLengthAuto: - saltLength = (priv.N.BitLen()+7)/8 - 2 - hash.Size() - case PSSSaltLengthEqualsHash: - saltLength = hash.Size() - } - - if opts != nil && opts.Hash != 0 { - hash = opts.Hash - } - - salt := make([]byte, saltLength) - if _, err = io.ReadFull(rand, salt); err != nil { - return - } - return signPSSWithSalt(rand, priv, hash, hashed, salt) -} - -// VerifyPSS verifies a PSS signature. -// hashed is the result of hashing the input message using the given hash -// function and sig is the signature. A valid signature is indicated by -// returning a nil error. The opts argument may be nil, in which case sensible -// defaults are used. -func VerifyPSS(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte, opts *PSSOptions) error { - return verifyPSS(pub, hash, hashed, sig, opts.saltLength()) -} - -// verifyPSS verifies a PSS signature with the given salt length. -func verifyPSS(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte, saltLen int) error { - nBits := pub.N.BitLen() - if len(sig) != (nBits+7)/8 { - return ErrVerification - } - s := new(big.Int).SetBytes(sig) - m := encrypt(new(big.Int), pub, s) - emBits := nBits - 1 - emLen := (emBits + 7) / 8 - if emLen < len(m.Bytes()) { - return ErrVerification - } - em := make([]byte, emLen) - copyWithLeftPad(em, m.Bytes()) - if saltLen == PSSSaltLengthEqualsHash { - saltLen = hash.Size() - } - return emsaPSSVerify(hashed, em, emBits, saltLen, hash.New()) -} diff --git a/vendor/github.com/keybase/go-crypto/rsa/rsa.go b/vendor/github.com/keybase/go-crypto/rsa/rsa.go deleted file mode 100644 index ff6b11b..0000000 --- a/vendor/github.com/keybase/go-crypto/rsa/rsa.go +++ /dev/null @@ -1,646 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package rsa implements RSA encryption as specified in PKCS#1. -// -// RSA is a single, fundamental operation that is used in this package to -// implement either public-key encryption or public-key signatures. -// -// The original specification for encryption and signatures with RSA is PKCS#1 -// and the terms "RSA encryption" and "RSA signatures" by default refer to -// PKCS#1 version 1.5. However, that specification has flaws and new designs -// should use version two, usually called by just OAEP and PSS, where -// possible. -// -// Two sets of interfaces are included in this package. When a more abstract -// interface isn't neccessary, there are functions for encrypting/decrypting -// with v1.5/OAEP and signing/verifying with v1.5/PSS. If one needs to abstract -// over the public-key primitive, the PrivateKey struct implements the -// Decrypter and Signer interfaces from the crypto package. -package rsa - -import ( - "crypto" - "crypto/rand" - "crypto/subtle" - "errors" - "hash" - "io" - "math/big" -) - -var bigZero = big.NewInt(0) -var bigOne = big.NewInt(1) - -// A PublicKey represents the public part of an RSA key. -type PublicKey struct { - N *big.Int // modulus - E int64 // public exponent -} - -// OAEPOptions is an interface for passing options to OAEP decryption using the -// crypto.Decrypter interface. -type OAEPOptions struct { - // Hash is the hash function that will be used when generating the mask. - Hash crypto.Hash - // Label is an arbitrary byte string that must be equal to the value - // used when encrypting. - Label []byte -} - -var ( - errPublicModulus = errors.New("crypto/rsa: missing public modulus") - errPublicExponentSmall = errors.New("crypto/rsa: public exponent too small") - errPublicExponentLarge = errors.New("crypto/rsa: public exponent too large") -) - -// checkPub sanity checks the public key before we use it. -// We require pub.E to fit into a 32-bit integer so that we -// do not have different behavior depending on whether -// int is 32 or 64 bits. See also -// http://www.imperialviolet.org/2012/03/16/rsae.html. -func checkPub(pub *PublicKey) error { - if pub.N == nil { - return errPublicModulus - } - if pub.E < 2 { - return errPublicExponentSmall - } - if pub.E > 1<<63-1 { - return errPublicExponentLarge - } - return nil -} - -// A PrivateKey represents an RSA key -type PrivateKey struct { - PublicKey // public part. - D *big.Int // private exponent - Primes []*big.Int // prime factors of N, has >= 2 elements. - - // Precomputed contains precomputed values that speed up private - // operations, if available. - Precomputed PrecomputedValues -} - -// Public returns the public key corresponding to priv. -func (priv *PrivateKey) Public() crypto.PublicKey { - return &priv.PublicKey -} - -// Sign signs msg with priv, reading randomness from rand. If opts is a -// *PSSOptions then the PSS algorithm will be used, otherwise PKCS#1 v1.5 will -// be used. This method is intended to support keys where the private part is -// kept in, for example, a hardware module. Common uses should use the Sign* -// functions in this package. -func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) ([]byte, error) { - if pssOpts, ok := opts.(*PSSOptions); ok { - return SignPSS(rand, priv, pssOpts.Hash, msg, pssOpts) - } - - return SignPKCS1v15(rand, priv, opts.HashFunc(), msg) -} - -// Decrypt decrypts ciphertext with priv. If opts is nil or of type -// *PKCS1v15DecryptOptions then PKCS#1 v1.5 decryption is performed. Otherwise -// opts must have type *OAEPOptions and OAEP decryption is done. -func (priv *PrivateKey) Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) { - if opts == nil { - return DecryptPKCS1v15(rand, priv, ciphertext) - } - - switch opts := opts.(type) { - case *OAEPOptions: - return DecryptOAEP(opts.Hash.New(), rand, priv, ciphertext, opts.Label) - - case *PKCS1v15DecryptOptions: - if l := opts.SessionKeyLen; l > 0 { - plaintext = make([]byte, l) - if _, err := io.ReadFull(rand, plaintext); err != nil { - return nil, err - } - if err := DecryptPKCS1v15SessionKey(rand, priv, ciphertext, plaintext); err != nil { - return nil, err - } - return plaintext, nil - } else { - return DecryptPKCS1v15(rand, priv, ciphertext) - } - - default: - return nil, errors.New("crypto/rsa: invalid options for Decrypt") - } -} - -type PrecomputedValues struct { - Dp, Dq *big.Int // D mod (P-1) (or mod Q-1) - Qinv *big.Int // Q^-1 mod P - - // CRTValues is used for the 3rd and subsequent primes. Due to a - // historical accident, the CRT for the first two primes is handled - // differently in PKCS#1 and interoperability is sufficiently - // important that we mirror this. - CRTValues []CRTValue -} - -// CRTValue contains the precomputed Chinese remainder theorem values. -type CRTValue struct { - Exp *big.Int // D mod (prime-1). - Coeff *big.Int // R·Coeff ≡ 1 mod Prime. - R *big.Int // product of primes prior to this (inc p and q). -} - -// Validate performs basic sanity checks on the key. -// It returns nil if the key is valid, or else an error describing a problem. -func (priv *PrivateKey) Validate() error { - if err := checkPub(&priv.PublicKey); err != nil { - return err - } - - // Check that Πprimes == n. - modulus := new(big.Int).Set(bigOne) - for _, prime := range priv.Primes { - // Any primes ≤ 1 will cause divide-by-zero panics later. - if prime.Cmp(bigOne) <= 0 { - return errors.New("crypto/rsa: invalid prime value") - } - modulus.Mul(modulus, prime) - } - if modulus.Cmp(priv.N) != 0 { - return errors.New("crypto/rsa: invalid modulus") - } - - // Check that de ≡ 1 mod p-1, for each prime. - // This implies that e is coprime to each p-1 as e has a multiplicative - // inverse. Therefore e is coprime to lcm(p-1,q-1,r-1,...) = - // exponent(ℤ/nℤ). It also implies that a^de ≡ a mod p as a^(p-1) ≡ 1 - // mod p. Thus a^de ≡ a mod n for all a coprime to n, as required. - congruence := new(big.Int) - de := new(big.Int).SetInt64(int64(priv.E)) - de.Mul(de, priv.D) - for _, prime := range priv.Primes { - pminus1 := new(big.Int).Sub(prime, bigOne) - congruence.Mod(de, pminus1) - if congruence.Cmp(bigOne) != 0 { - return errors.New("crypto/rsa: invalid exponents") - } - } - return nil -} - -// GenerateKey generates an RSA keypair of the given bit size using the -// random source random (for example, crypto/rand.Reader). -func GenerateKey(random io.Reader, bits int) (priv *PrivateKey, err error) { - return GenerateMultiPrimeKey(random, 2, bits) -} - -// GenerateMultiPrimeKey generates a multi-prime RSA keypair of the given bit -// size and the given random source, as suggested in [1]. Although the public -// keys are compatible (actually, indistinguishable) from the 2-prime case, -// the private keys are not. Thus it may not be possible to export multi-prime -// private keys in certain formats or to subsequently import them into other -// code. -// -// Table 1 in [2] suggests maximum numbers of primes for a given size. -// -// [1] US patent 4405829 (1972, expired) -// [2] http://www.cacr.math.uwaterloo.ca/techreports/2006/cacr2006-16.pdf -func GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (priv *PrivateKey, err error) { - priv = new(PrivateKey) - priv.E = 65537 - - if nprimes < 2 { - return nil, errors.New("crypto/rsa: GenerateMultiPrimeKey: nprimes must be >= 2") - } - - primes := make([]*big.Int, nprimes) - -NextSetOfPrimes: - for { - todo := bits - // crypto/rand should set the top two bits in each prime. - // Thus each prime has the form - // p_i = 2^bitlen(p_i) × 0.11... (in base 2). - // And the product is: - // P = 2^todo × α - // where α is the product of nprimes numbers of the form 0.11... - // - // If α < 1/2 (which can happen for nprimes > 2), we need to - // shift todo to compensate for lost bits: the mean value of 0.11... - // is 7/8, so todo + shift - nprimes * log2(7/8) ~= bits - 1/2 - // will give good results. - if nprimes >= 7 { - todo += (nprimes - 2) / 5 - } - for i := 0; i < nprimes; i++ { - primes[i], err = rand.Prime(random, todo/(nprimes-i)) - if err != nil { - return nil, err - } - todo -= primes[i].BitLen() - } - - // Make sure that primes is pairwise unequal. - for i, prime := range primes { - for j := 0; j < i; j++ { - if prime.Cmp(primes[j]) == 0 { - continue NextSetOfPrimes - } - } - } - - n := new(big.Int).Set(bigOne) - totient := new(big.Int).Set(bigOne) - pminus1 := new(big.Int) - for _, prime := range primes { - n.Mul(n, prime) - pminus1.Sub(prime, bigOne) - totient.Mul(totient, pminus1) - } - if n.BitLen() != bits { - // This should never happen for nprimes == 2 because - // crypto/rand should set the top two bits in each prime. - // For nprimes > 2 we hope it does not happen often. - continue NextSetOfPrimes - } - - g := new(big.Int) - priv.D = new(big.Int) - y := new(big.Int) - e := big.NewInt(int64(priv.E)) - g.GCD(priv.D, y, e, totient) - - if g.Cmp(bigOne) == 0 { - if priv.D.Sign() < 0 { - priv.D.Add(priv.D, totient) - } - priv.Primes = primes - priv.N = n - - break - } - } - - priv.Precompute() - return -} - -// incCounter increments a four byte, big-endian counter. -func incCounter(c *[4]byte) { - if c[3]++; c[3] != 0 { - return - } - if c[2]++; c[2] != 0 { - return - } - if c[1]++; c[1] != 0 { - return - } - c[0]++ -} - -// mgf1XOR XORs the bytes in out with a mask generated using the MGF1 function -// specified in PKCS#1 v2.1. -func mgf1XOR(out []byte, hash hash.Hash, seed []byte) { - var counter [4]byte - var digest []byte - - done := 0 - for done < len(out) { - hash.Write(seed) - hash.Write(counter[0:4]) - digest = hash.Sum(digest[:0]) - hash.Reset() - - for i := 0; i < len(digest) && done < len(out); i++ { - out[done] ^= digest[i] - done++ - } - incCounter(&counter) - } -} - -// ErrMessageTooLong is returned when attempting to encrypt a message which is -// too large for the size of the public key. -var ErrMessageTooLong = errors.New("crypto/rsa: message too long for RSA public key size") - -func encrypt(c *big.Int, pub *PublicKey, m *big.Int) *big.Int { - e := big.NewInt(int64(pub.E)) - c.Exp(m, e, pub.N) - return c -} - -// EncryptOAEP encrypts the given message with RSA-OAEP. -// -// OAEP is parameterised by a hash function that is used as a random oracle. -// Encryption and decryption of a given message must use the same hash function -// and sha256.New() is a reasonable choice. -// -// The random parameter is used as a source of entropy to ensure that -// encrypting the same message twice doesn't result in the same ciphertext. -// -// The label parameter may contain arbitrary data that will not be encrypted, -// but which gives important context to the message. For example, if a given -// public key is used to decrypt two types of messages then distinct label -// values could be used to ensure that a ciphertext for one purpose cannot be -// used for another by an attacker. If not required it can be empty. -// -// The message must be no longer than the length of the public modulus less -// twice the hash length plus 2. -func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) (out []byte, err error) { - if err := checkPub(pub); err != nil { - return nil, err - } - hash.Reset() - k := (pub.N.BitLen() + 7) / 8 - if len(msg) > k-2*hash.Size()-2 { - err = ErrMessageTooLong - return - } - - hash.Write(label) - lHash := hash.Sum(nil) - hash.Reset() - - em := make([]byte, k) - seed := em[1 : 1+hash.Size()] - db := em[1+hash.Size():] - - copy(db[0:hash.Size()], lHash) - db[len(db)-len(msg)-1] = 1 - copy(db[len(db)-len(msg):], msg) - - _, err = io.ReadFull(random, seed) - if err != nil { - return - } - - mgf1XOR(db, hash, seed) - mgf1XOR(seed, hash, db) - - m := new(big.Int) - m.SetBytes(em) - c := encrypt(new(big.Int), pub, m) - out = c.Bytes() - - if len(out) < k { - // If the output is too small, we need to left-pad with zeros. - t := make([]byte, k) - copy(t[k-len(out):], out) - out = t - } - - return -} - -// ErrDecryption represents a failure to decrypt a message. -// It is deliberately vague to avoid adaptive attacks. -var ErrDecryption = errors.New("crypto/rsa: decryption error") - -// ErrVerification represents a failure to verify a signature. -// It is deliberately vague to avoid adaptive attacks. -var ErrVerification = errors.New("crypto/rsa: verification error") - -// modInverse returns ia, the inverse of a in the multiplicative group of prime -// order n. It requires that a be a member of the group (i.e. less than n). -func modInverse(a, n *big.Int) (ia *big.Int, ok bool) { - g := new(big.Int) - x := new(big.Int) - y := new(big.Int) - g.GCD(x, y, a, n) - if g.Cmp(bigOne) != 0 { - // In this case, a and n aren't coprime and we cannot calculate - // the inverse. This happens because the values of n are nearly - // prime (being the product of two primes) rather than truly - // prime. - return - } - - if x.Cmp(bigOne) < 0 { - // 0 is not the multiplicative inverse of any element so, if x - // < 1, then x is negative. - x.Add(x, n) - } - - return x, true -} - -// Precompute performs some calculations that speed up private key operations -// in the future. -func (priv *PrivateKey) Precompute() { - if priv.Precomputed.Dp != nil { - return - } - - priv.Precomputed.Dp = new(big.Int).Sub(priv.Primes[0], bigOne) - priv.Precomputed.Dp.Mod(priv.D, priv.Precomputed.Dp) - - priv.Precomputed.Dq = new(big.Int).Sub(priv.Primes[1], bigOne) - priv.Precomputed.Dq.Mod(priv.D, priv.Precomputed.Dq) - - priv.Precomputed.Qinv = new(big.Int).ModInverse(priv.Primes[1], priv.Primes[0]) - - r := new(big.Int).Mul(priv.Primes[0], priv.Primes[1]) - priv.Precomputed.CRTValues = make([]CRTValue, len(priv.Primes)-2) - for i := 2; i < len(priv.Primes); i++ { - prime := priv.Primes[i] - values := &priv.Precomputed.CRTValues[i-2] - - values.Exp = new(big.Int).Sub(prime, bigOne) - values.Exp.Mod(priv.D, values.Exp) - - values.R = new(big.Int).Set(r) - values.Coeff = new(big.Int).ModInverse(r, prime) - - r.Mul(r, prime) - } -} - -// decrypt performs an RSA decryption, resulting in a plaintext integer. If a -// random source is given, RSA blinding is used. -func decrypt(random io.Reader, priv *PrivateKey, c *big.Int) (m *big.Int, err error) { - // TODO(agl): can we get away with reusing blinds? - if c.Cmp(priv.N) > 0 { - err = ErrDecryption - return - } - - var ir *big.Int - if random != nil { - // Blinding enabled. Blinding involves multiplying c by r^e. - // Then the decryption operation performs (m^e * r^e)^d mod n - // which equals mr mod n. The factor of r can then be removed - // by multiplying by the multiplicative inverse of r. - - var r *big.Int - - for { - r, err = rand.Int(random, priv.N) - if err != nil { - return - } - if r.Cmp(bigZero) == 0 { - r = bigOne - } - var ok bool - ir, ok = modInverse(r, priv.N) - if ok { - break - } - } - bigE := big.NewInt(int64(priv.E)) - rpowe := new(big.Int).Exp(r, bigE, priv.N) - cCopy := new(big.Int).Set(c) - cCopy.Mul(cCopy, rpowe) - cCopy.Mod(cCopy, priv.N) - c = cCopy - } - - if priv.Precomputed.Dp == nil { - m = new(big.Int).Exp(c, priv.D, priv.N) - } else { - // We have the precalculated values needed for the CRT. - m = new(big.Int).Exp(c, priv.Precomputed.Dp, priv.Primes[0]) - m2 := new(big.Int).Exp(c, priv.Precomputed.Dq, priv.Primes[1]) - m.Sub(m, m2) - if m.Sign() < 0 { - m.Add(m, priv.Primes[0]) - } - m.Mul(m, priv.Precomputed.Qinv) - m.Mod(m, priv.Primes[0]) - m.Mul(m, priv.Primes[1]) - m.Add(m, m2) - - for i, values := range priv.Precomputed.CRTValues { - prime := priv.Primes[2+i] - m2.Exp(c, values.Exp, prime) - m2.Sub(m2, m) - m2.Mul(m2, values.Coeff) - m2.Mod(m2, prime) - if m2.Sign() < 0 { - m2.Add(m2, prime) - } - m2.Mul(m2, values.R) - m.Add(m, m2) - } - } - - if ir != nil { - // Unblind. - m.Mul(m, ir) - m.Mod(m, priv.N) - } - - return -} - -func decryptAndCheck(random io.Reader, priv *PrivateKey, c *big.Int) (m *big.Int, err error) { - m, err = decrypt(random, priv, c) - if err != nil { - return nil, err - } - - // In order to defend against errors in the CRT computation, m^e is - // calculated, which should match the original ciphertext. - check := encrypt(new(big.Int), &priv.PublicKey, m) - if c.Cmp(check) != 0 { - return nil, errors.New("rsa: internal error") - } - return m, nil -} - -// DecryptOAEP decrypts ciphertext using RSA-OAEP. - -// OAEP is parameterised by a hash function that is used as a random oracle. -// Encryption and decryption of a given message must use the same hash function -// and sha256.New() is a reasonable choice. -// -// The random parameter, if not nil, is used to blind the private-key operation -// and avoid timing side-channel attacks. Blinding is purely internal to this -// function – the random data need not match that used when encrypting. -// -// The label parameter must match the value given when encrypting. See -// EncryptOAEP for details. -func DecryptOAEP(hash hash.Hash, random io.Reader, priv *PrivateKey, ciphertext []byte, label []byte) (msg []byte, err error) { - if err := checkPub(&priv.PublicKey); err != nil { - return nil, err - } - k := (priv.N.BitLen() + 7) / 8 - if len(ciphertext) > k || - k < hash.Size()*2+2 { - err = ErrDecryption - return - } - - c := new(big.Int).SetBytes(ciphertext) - - m, err := decrypt(random, priv, c) - if err != nil { - return - } - - hash.Write(label) - lHash := hash.Sum(nil) - hash.Reset() - - // Converting the plaintext number to bytes will strip any - // leading zeros so we may have to left pad. We do this unconditionally - // to avoid leaking timing information. (Although we still probably - // leak the number of leading zeros. It's not clear that we can do - // anything about this.) - em := leftPad(m.Bytes(), k) - - firstByteIsZero := subtle.ConstantTimeByteEq(em[0], 0) - - seed := em[1 : hash.Size()+1] - db := em[hash.Size()+1:] - - mgf1XOR(seed, hash, db) - mgf1XOR(db, hash, seed) - - lHash2 := db[0:hash.Size()] - - // We have to validate the plaintext in constant time in order to avoid - // attacks like: J. Manger. A Chosen Ciphertext Attack on RSA Optimal - // Asymmetric Encryption Padding (OAEP) as Standardized in PKCS #1 - // v2.0. In J. Kilian, editor, Advances in Cryptology. - lHash2Good := subtle.ConstantTimeCompare(lHash, lHash2) - - // The remainder of the plaintext must be zero or more 0x00, followed - // by 0x01, followed by the message. - // lookingForIndex: 1 iff we are still looking for the 0x01 - // index: the offset of the first 0x01 byte - // invalid: 1 iff we saw a non-zero byte before the 0x01. - var lookingForIndex, index, invalid int - lookingForIndex = 1 - rest := db[hash.Size():] - - for i := 0; i < len(rest); i++ { - equals0 := subtle.ConstantTimeByteEq(rest[i], 0) - equals1 := subtle.ConstantTimeByteEq(rest[i], 1) - index = subtle.ConstantTimeSelect(lookingForIndex&equals1, i, index) - lookingForIndex = subtle.ConstantTimeSelect(equals1, 0, lookingForIndex) - invalid = subtle.ConstantTimeSelect(lookingForIndex&^equals0, 1, invalid) - } - - if firstByteIsZero&lHash2Good&^invalid&^lookingForIndex != 1 { - err = ErrDecryption - return - } - - msg = rest[index+1:] - return -} - -// leftPad returns a new slice of length size. The contents of input are right -// aligned in the new slice. -func leftPad(input []byte, size int) (out []byte) { - n := len(input) - if n > size { - n = size - } - out = make([]byte, size) - copy(out[len(out)-n:], input) - return -} diff --git a/vendor/github.com/mattn/go-isatty/LICENSE b/vendor/github.com/mattn/go-isatty/LICENSE new file mode 100644 index 0000000..65dc692 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/LICENSE @@ -0,0 +1,9 @@ +Copyright (c) Yasuhiro MATSUMOTO + +MIT License (Expat) + +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/mattn/go-isatty/README.md b/vendor/github.com/mattn/go-isatty/README.md new file mode 100644 index 0000000..1e69004 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/README.md @@ -0,0 +1,50 @@ +# go-isatty + +[![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) +[![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) +[![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) +[![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) + +isatty for golang + +## Usage + +```go +package main + +import ( + "fmt" + "github.com/mattn/go-isatty" + "os" +) + +func main() { + if isatty.IsTerminal(os.Stdout.Fd()) { + fmt.Println("Is Terminal") + } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { + fmt.Println("Is Cygwin/MSYS2 Terminal") + } else { + fmt.Println("Is Not Terminal") + } +} +``` + +## Installation + +``` +$ go get github.com/mattn/go-isatty +``` + +## License + +MIT + +## Author + +Yasuhiro Matsumoto (a.k.a mattn) + +## Thanks + +* k-takata: base idea for IsCygwinTerminal + + https://github.com/k-takata/go-iscygpty diff --git a/vendor/github.com/mattn/go-isatty/doc.go b/vendor/github.com/mattn/go-isatty/doc.go new file mode 100644 index 0000000..17d4f90 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/doc.go @@ -0,0 +1,2 @@ +// Package isatty implements interface to isatty +package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_bsd.go b/vendor/github.com/mattn/go-isatty/isatty_bsd.go new file mode 100644 index 0000000..42f2514 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_bsd.go @@ -0,0 +1,18 @@ +// +build darwin freebsd openbsd netbsd dragonfly +// +build !appengine + +package isatty + +import ( + "syscall" + "unsafe" +) + +const ioctlReadTermios = syscall.TIOCGETA + +// IsTerminal return true if the file descriptor is terminal. +func IsTerminal(fd uintptr) bool { + var termios syscall.Termios + _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) + return err == 0 +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_linux.go b/vendor/github.com/mattn/go-isatty/isatty_linux.go new file mode 100644 index 0000000..7384cf9 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_linux.go @@ -0,0 +1,18 @@ +// +build linux +// +build !appengine,!ppc64,!ppc64le + +package isatty + +import ( + "syscall" + "unsafe" +) + +const ioctlReadTermios = syscall.TCGETS + +// IsTerminal return true if the file descriptor is terminal. +func IsTerminal(fd uintptr) bool { + var termios syscall.Termios + _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) + return err == 0 +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go b/vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go new file mode 100644 index 0000000..44e5d21 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go @@ -0,0 +1,19 @@ +// +build linux +// +build ppc64 ppc64le + +package isatty + +import ( + "unsafe" + + syscall "golang.org/x/sys/unix" +) + +const ioctlReadTermios = syscall.TCGETS + +// IsTerminal return true if the file descriptor is terminal. +func IsTerminal(fd uintptr) bool { + var termios syscall.Termios + _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) + return err == 0 +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go new file mode 100644 index 0000000..ff4de3d --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -0,0 +1,10 @@ +// +build !windows +// +build !appengine + +package isatty + +// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 +// terminal. This is also always false on this environment. +func IsCygwinTerminal(fd uintptr) bool { + return false +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_solaris.go b/vendor/github.com/mattn/go-isatty/isatty_solaris.go new file mode 100644 index 0000000..1f0c6bf --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_solaris.go @@ -0,0 +1,16 @@ +// +build solaris +// +build !appengine + +package isatty + +import ( + "golang.org/x/sys/unix" +) + +// IsTerminal returns true if the given file descriptor is a terminal. +// see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c +func IsTerminal(fd uintptr) bool { + var termio unix.Termio + err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) + return err == nil +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go new file mode 100644 index 0000000..af51cbc --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_windows.go @@ -0,0 +1,94 @@ +// +build windows +// +build !appengine + +package isatty + +import ( + "strings" + "syscall" + "unicode/utf16" + "unsafe" +) + +const ( + fileNameInfo uintptr = 2 + fileTypePipe = 3 +) + +var ( + kernel32 = syscall.NewLazyDLL("kernel32.dll") + procGetConsoleMode = kernel32.NewProc("GetConsoleMode") + procGetFileInformationByHandleEx = kernel32.NewProc("GetFileInformationByHandleEx") + procGetFileType = kernel32.NewProc("GetFileType") +) + +func init() { + // Check if GetFileInformationByHandleEx is available. + if procGetFileInformationByHandleEx.Find() != nil { + procGetFileInformationByHandleEx = nil + } +} + +// IsTerminal return true if the file descriptor is terminal. +func IsTerminal(fd uintptr) bool { + var st uint32 + r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) + return r != 0 && e == 0 +} + +// Check pipe name is used for cygwin/msys2 pty. +// Cygwin/MSYS2 PTY has a name like: +// \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master +func isCygwinPipeName(name string) bool { + token := strings.Split(name, "-") + if len(token) < 5 { + return false + } + + if token[0] != `\msys` && token[0] != `\cygwin` { + return false + } + + if token[1] == "" { + return false + } + + if !strings.HasPrefix(token[2], "pty") { + return false + } + + if token[3] != `from` && token[3] != `to` { + return false + } + + if token[4] != "master" { + return false + } + + return true +} + +// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 +// terminal. +func IsCygwinTerminal(fd uintptr) bool { + if procGetFileInformationByHandleEx == nil { + return false + } + + // Cygwin/msys's pty is a pipe. + ft, _, e := syscall.Syscall(procGetFileType.Addr(), 1, fd, 0, 0) + if ft != fileTypePipe || e != 0 { + return false + } + + var buf [2 + syscall.MAX_PATH]uint16 + r, _, e := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), + 4, fd, fileNameInfo, uintptr(unsafe.Pointer(&buf)), + uintptr(len(buf)*2), 0, 0) + if r == 0 || e != 0 { + return false + } + + l := *(*uint32)(unsafe.Pointer(&buf)) + return isCygwinPipeName(string(utf16.Decode(buf[2 : 2+l/2]))) +} diff --git a/vendor/github.com/miekg/dns/AUTHORS b/vendor/github.com/miekg/dns/AUTHORS deleted file mode 100644 index 1965683..0000000 --- a/vendor/github.com/miekg/dns/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Miek Gieben diff --git a/vendor/github.com/miekg/dns/CONTRIBUTORS b/vendor/github.com/miekg/dns/CONTRIBUTORS deleted file mode 100644 index f77e8a8..0000000 --- a/vendor/github.com/miekg/dns/CONTRIBUTORS +++ /dev/null @@ -1,9 +0,0 @@ -Alex A. Skinner -Andrew Tunnell-Jones -Ask Bjørn Hansen -Dave Cheney -Dusty Wilson -Marek Majkowski -Peter van Dijk -Omri Bahumi -Alex Sergeyev diff --git a/vendor/github.com/miekg/dns/COPYRIGHT b/vendor/github.com/miekg/dns/COPYRIGHT deleted file mode 100644 index 35702b1..0000000 --- a/vendor/github.com/miekg/dns/COPYRIGHT +++ /dev/null @@ -1,9 +0,0 @@ -Copyright 2009 The Go Authors. All rights reserved. Use of this source code -is governed by a BSD-style license that can be found in the LICENSE file. -Extensions of the original work are copyright (c) 2011 Miek Gieben - -Copyright 2011 Miek Gieben. All rights reserved. Use of this source code is -governed by a BSD-style license that can be found in the LICENSE file. - -Copyright 2014 CloudFlare. All rights reserved. Use of this source code is -governed by a BSD-style license that can be found in the LICENSE file. diff --git a/vendor/github.com/miekg/dns/LICENSE b/vendor/github.com/miekg/dns/LICENSE deleted file mode 100644 index 5763fa7..0000000 --- a/vendor/github.com/miekg/dns/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ -Extensions of the original work are copyright (c) 2011 Miek Gieben - -As this is fork of the official Go code the same license applies: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/miekg/dns/README.md b/vendor/github.com/miekg/dns/README.md deleted file mode 100644 index 0e3356c..0000000 --- a/vendor/github.com/miekg/dns/README.md +++ /dev/null @@ -1,154 +0,0 @@ -[![Build Status](https://travis-ci.org/miekg/dns.svg?branch=master)](https://travis-ci.org/miekg/dns) [![](https://godoc.org/github.com/miekg/dns?status.svg)](https://godoc.org/github.com/miekg/dns) - -# Alternative (more granular) approach to a DNS library - -> Less is more. - -Complete and usable DNS library. All widely used Resource Records are -supported, including the DNSSEC types. It follows a lean and mean philosophy. -If there is stuff you should know as a DNS programmer there isn't a convenience -function for it. Server side and client side programming is supported, i.e. you -can build servers and resolvers with it. - -We try to keep the "master" branch as sane as possible and at the bleeding edge -of standards, avoiding breaking changes wherever reasonable. We support the last -two versions of Go, currently: 1.5 and 1.6. - -# Goals - -* KISS; -* Fast; -* Small API, if its easy to code in Go, don't make a function for it. - -# Users - -A not-so-up-to-date-list-that-may-be-actually-current: - -* https://cloudflare.com -* https://github.com/abh/geodns -* http://www.statdns.com/ -* http://www.dnsinspect.com/ -* https://github.com/chuangbo/jianbing-dictionary-dns -* http://www.dns-lg.com/ -* https://github.com/fcambus/rrda -* https://github.com/kenshinx/godns -* https://github.com/skynetservices/skydns -* https://github.com/hashicorp/consul -* https://github.com/DevelopersPL/godnsagent -* https://github.com/duedil-ltd/discodns -* https://github.com/StalkR/dns-reverse-proxy -* https://github.com/tianon/rawdns -* https://mesosphere.github.io/mesos-dns/ -* https://pulse.turbobytes.com/ -* https://play.google.com/store/apps/details?id=com.turbobytes.dig -* https://github.com/fcambus/statzone -* https://github.com/benschw/dns-clb-go -* https://github.com/corny/dnscheck for http://public-dns.info/ -* https://namesmith.io -* https://github.com/miekg/unbound -* https://github.com/miekg/exdns -* https://dnslookup.org -* https://github.com/looterz/grimd -* https://github.com/phamhongviet/serf-dns -* https://github.com/mehrdadrad/mylg -* https://github.com/bamarni/dockness -* https://github.com/fffaraz/microdns - -Send pull request if you want to be listed here. - -# Features - -* UDP/TCP queries, IPv4 and IPv6; -* RFC 1035 zone file parsing ($INCLUDE, $ORIGIN, $TTL and $GENERATE (for all record types) are supported; -* Fast: - * Reply speed around ~ 80K qps (faster hardware results in more qps); - * Parsing RRs ~ 100K RR/s, that's 5M records in about 50 seconds; -* Server side programming (mimicking the net/http package); -* Client side programming; -* DNSSEC: signing, validating and key generation for DSA, RSA and ECDSA; -* EDNS0, NSID, Cookies; -* AXFR/IXFR; -* TSIG, SIG(0); -* DNS over TLS: optional encrypted connection between client and server; -* DNS name compression; -* Depends only on the standard library. - -Have fun! - -Miek Gieben - 2010-2012 - - -# Building - -Building is done with the `go` tool. If you have setup your GOPATH -correctly, the following should work: - - go get github.com/miekg/dns - go build github.com/miekg/dns - -## Examples - -A short "how to use the API" is at the beginning of doc.go (this also will show -when you call `godoc github.com/miekg/dns`). - -Example programs can be found in the `github.com/miekg/exdns` repository. - -## Supported RFCs - -*all of them* - -* 103{4,5} - DNS standard -* 1348 - NSAP record (removed the record) -* 1982 - Serial Arithmetic -* 1876 - LOC record -* 1995 - IXFR -* 1996 - DNS notify -* 2136 - DNS Update (dynamic updates) -* 2181 - RRset definition - there is no RRset type though, just []RR -* 2537 - RSAMD5 DNS keys -* 2065 - DNSSEC (updated in later RFCs) -* 2671 - EDNS record -* 2782 - SRV record -* 2845 - TSIG record -* 2915 - NAPTR record -* 2929 - DNS IANA Considerations -* 3110 - RSASHA1 DNS keys -* 3225 - DO bit (DNSSEC OK) -* 340{1,2,3} - NAPTR record -* 3445 - Limiting the scope of (DNS)KEY -* 3597 - Unknown RRs -* 403{3,4,5} - DNSSEC + validation functions -* 4255 - SSHFP record -* 4343 - Case insensitivity -* 4408 - SPF record -* 4509 - SHA256 Hash in DS -* 4592 - Wildcards in the DNS -* 4635 - HMAC SHA TSIG -* 4701 - DHCID -* 4892 - id.server -* 5001 - NSID -* 5155 - NSEC3 record -* 5205 - HIP record -* 5702 - SHA2 in the DNS -* 5936 - AXFR -* 5966 - TCP implementation recommendations -* 6605 - ECDSA -* 6725 - IANA Registry Update -* 6742 - ILNP DNS -* 6840 - Clarifications and Implementation Notes for DNS Security -* 6844 - CAA record -* 6891 - EDNS0 update -* 6895 - DNS IANA considerations -* 6975 - Algorithm Understanding in DNSSEC -* 7043 - EUI48/EUI64 records -* 7314 - DNS (EDNS) EXPIRE Option -* 7553 - URI record -* 7858 - DNS over TLS: Initiation and Performance Considerations (draft) -* 7873 - Domain Name System (DNS) Cookies (draft-ietf-dnsop-cookies) -* xxxx - EDNS0 DNS Update Lease (draft) - -## Loosely based upon - -* `ldns` -* `NSD` -* `Net::DNS` -* `GRONG` diff --git a/vendor/github.com/miekg/dns/client.go b/vendor/github.com/miekg/dns/client.go deleted file mode 100644 index 0db7f7b..0000000 --- a/vendor/github.com/miekg/dns/client.go +++ /dev/null @@ -1,455 +0,0 @@ -package dns - -// A client implementation. - -import ( - "bytes" - "crypto/tls" - "encoding/binary" - "io" - "net" - "time" -) - -const dnsTimeout time.Duration = 2 * time.Second -const tcpIdleTimeout time.Duration = 8 * time.Second - -// A Conn represents a connection to a DNS server. -type Conn struct { - net.Conn // a net.Conn holding the connection - UDPSize uint16 // minimum receive buffer for UDP messages - TsigSecret map[string]string // secret(s) for Tsig map[], zonename must be fully qualified - rtt time.Duration - t time.Time - tsigRequestMAC string -} - -// A Client defines parameters for a DNS client. -type Client struct { - Net string // if "tcp" or "tcp-tls" (DNS over TLS) a TCP query will be initiated, otherwise an UDP one (default is "" for UDP) - UDPSize uint16 // minimum receive buffer for UDP messages - TLSConfig *tls.Config // TLS connection configuration - Timeout time.Duration // a cumulative timeout for dial, write and read, defaults to 0 (disabled) - overrides DialTimeout, ReadTimeout and WriteTimeout when non-zero - DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds - overridden by Timeout when that value is non-zero - ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds - overridden by Timeout when that value is non-zero - WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds - overridden by Timeout when that value is non-zero - TsigSecret map[string]string // secret(s) for Tsig map[], zonename must be fully qualified - SingleInflight bool // if true suppress multiple outstanding queries for the same Qname, Qtype and Qclass - group singleflight -} - -// Exchange performs a synchronous UDP query. It sends the message m to the address -// contained in a and waits for a reply. Exchange does not retry a failed query, nor -// will it fall back to TCP in case of truncation. -// See client.Exchange for more information on setting larger buffer sizes. -func Exchange(m *Msg, a string) (r *Msg, err error) { - var co *Conn - co, err = DialTimeout("udp", a, dnsTimeout) - if err != nil { - return nil, err - } - - defer co.Close() - - opt := m.IsEdns0() - // If EDNS0 is used use that for size. - if opt != nil && opt.UDPSize() >= MinMsgSize { - co.UDPSize = opt.UDPSize() - } - - co.SetWriteDeadline(time.Now().Add(dnsTimeout)) - if err = co.WriteMsg(m); err != nil { - return nil, err - } - - co.SetReadDeadline(time.Now().Add(dnsTimeout)) - r, err = co.ReadMsg() - if err == nil && r.Id != m.Id { - err = ErrId - } - return r, err -} - -// ExchangeConn performs a synchronous query. It sends the message m via the connection -// c and waits for a reply. The connection c is not closed by ExchangeConn. -// This function is going away, but can easily be mimicked: -// -// co := &dns.Conn{Conn: c} // c is your net.Conn -// co.WriteMsg(m) -// in, _ := co.ReadMsg() -// co.Close() -// -func ExchangeConn(c net.Conn, m *Msg) (r *Msg, err error) { - println("dns: this function is deprecated") - co := new(Conn) - co.Conn = c - if err = co.WriteMsg(m); err != nil { - return nil, err - } - r, err = co.ReadMsg() - if err == nil && r.Id != m.Id { - err = ErrId - } - return r, err -} - -// Exchange performs a synchronous query. It sends the message m to the address -// contained in a and waits for a reply. Basic use pattern with a *dns.Client: -// -// c := new(dns.Client) -// in, rtt, err := c.Exchange(message, "127.0.0.1:53") -// -// Exchange does not retry a failed query, nor will it fall back to TCP in -// case of truncation. -// It is up to the caller to create a message that allows for larger responses to be -// returned. Specifically this means adding an EDNS0 OPT RR that will advertise a larger -// buffer, see SetEdns0. Messsages without an OPT RR will fallback to the historic limit -// of 512 bytes. -func (c *Client) Exchange(m *Msg, a string) (r *Msg, rtt time.Duration, err error) { - if !c.SingleInflight { - return c.exchange(m, a) - } - // This adds a bunch of garbage, TODO(miek). - t := "nop" - if t1, ok := TypeToString[m.Question[0].Qtype]; ok { - t = t1 - } - cl := "nop" - if cl1, ok := ClassToString[m.Question[0].Qclass]; ok { - cl = cl1 - } - r, rtt, err, shared := c.group.Do(m.Question[0].Name+t+cl, func() (*Msg, time.Duration, error) { - return c.exchange(m, a) - }) - if err != nil { - return r, rtt, err - } - if shared { - return r.Copy(), rtt, nil - } - return r, rtt, nil -} - -func (c *Client) dialTimeout() time.Duration { - if c.Timeout != 0 { - return c.Timeout - } - if c.DialTimeout != 0 { - return c.DialTimeout - } - return dnsTimeout -} - -func (c *Client) readTimeout() time.Duration { - if c.ReadTimeout != 0 { - return c.ReadTimeout - } - return dnsTimeout -} - -func (c *Client) writeTimeout() time.Duration { - if c.WriteTimeout != 0 { - return c.WriteTimeout - } - return dnsTimeout -} - -func (c *Client) exchange(m *Msg, a string) (r *Msg, rtt time.Duration, err error) { - var co *Conn - network := "udp" - tls := false - - switch c.Net { - case "tcp-tls": - network = "tcp" - tls = true - case "tcp4-tls": - network = "tcp4" - tls = true - case "tcp6-tls": - network = "tcp6" - tls = true - default: - if c.Net != "" { - network = c.Net - } - } - - var deadline time.Time - if c.Timeout != 0 { - deadline = time.Now().Add(c.Timeout) - } - - if tls { - co, err = DialTimeoutWithTLS(network, a, c.TLSConfig, c.dialTimeout()) - } else { - co, err = DialTimeout(network, a, c.dialTimeout()) - } - - if err != nil { - return nil, 0, err - } - defer co.Close() - - opt := m.IsEdns0() - // If EDNS0 is used use that for size. - if opt != nil && opt.UDPSize() >= MinMsgSize { - co.UDPSize = opt.UDPSize() - } - // Otherwise use the client's configured UDP size. - if opt == nil && c.UDPSize >= MinMsgSize { - co.UDPSize = c.UDPSize - } - - co.TsigSecret = c.TsigSecret - co.SetWriteDeadline(deadlineOrTimeout(deadline, c.writeTimeout())) - if err = co.WriteMsg(m); err != nil { - return nil, 0, err - } - - co.SetReadDeadline(deadlineOrTimeout(deadline, c.readTimeout())) - r, err = co.ReadMsg() - if err == nil && r.Id != m.Id { - err = ErrId - } - return r, co.rtt, err -} - -// ReadMsg reads a message from the connection co. -// If the received message contains a TSIG record the transaction -// signature is verified. -func (co *Conn) ReadMsg() (*Msg, error) { - p, err := co.ReadMsgHeader(nil) - if err != nil { - return nil, err - } - - m := new(Msg) - if err := m.Unpack(p); err != nil { - // If ErrTruncated was returned, we still want to allow the user to use - // the message, but naively they can just check err if they don't want - // to use a truncated message - if err == ErrTruncated { - return m, err - } - return nil, err - } - if t := m.IsTsig(); t != nil { - if _, ok := co.TsigSecret[t.Hdr.Name]; !ok { - return m, ErrSecret - } - // Need to work on the original message p, as that was used to calculate the tsig. - err = TsigVerify(p, co.TsigSecret[t.Hdr.Name], co.tsigRequestMAC, false) - } - return m, err -} - -// ReadMsgHeader reads a DNS message, parses and populates hdr (when hdr is not nil). -// Returns message as a byte slice to be parsed with Msg.Unpack later on. -// Note that error handling on the message body is not possible as only the header is parsed. -func (co *Conn) ReadMsgHeader(hdr *Header) ([]byte, error) { - var ( - p []byte - n int - err error - ) - - switch t := co.Conn.(type) { - case *net.TCPConn, *tls.Conn: - r := t.(io.Reader) - - // First two bytes specify the length of the entire message. - l, err := tcpMsgLen(r) - if err != nil { - return nil, err - } - p = make([]byte, l) - n, err = tcpRead(r, p) - co.rtt = time.Since(co.t) - default: - if co.UDPSize > MinMsgSize { - p = make([]byte, co.UDPSize) - } else { - p = make([]byte, MinMsgSize) - } - n, err = co.Read(p) - co.rtt = time.Since(co.t) - } - - if err != nil { - return nil, err - } else if n < headerSize { - return nil, ErrShortRead - } - - p = p[:n] - if hdr != nil { - dh, _, err := unpackMsgHdr(p, 0) - if err != nil { - return nil, err - } - *hdr = dh - } - return p, err -} - -// tcpMsgLen is a helper func to read first two bytes of stream as uint16 packet length. -func tcpMsgLen(t io.Reader) (int, error) { - p := []byte{0, 0} - n, err := t.Read(p) - if err != nil { - return 0, err - } - if n != 2 { - return 0, ErrShortRead - } - l := binary.BigEndian.Uint16(p) - if l == 0 { - return 0, ErrShortRead - } - return int(l), nil -} - -// tcpRead calls TCPConn.Read enough times to fill allocated buffer. -func tcpRead(t io.Reader, p []byte) (int, error) { - n, err := t.Read(p) - if err != nil { - return n, err - } - for n < len(p) { - j, err := t.Read(p[n:]) - if err != nil { - return n, err - } - n += j - } - return n, err -} - -// Read implements the net.Conn read method. -func (co *Conn) Read(p []byte) (n int, err error) { - if co.Conn == nil { - return 0, ErrConnEmpty - } - if len(p) < 2 { - return 0, io.ErrShortBuffer - } - switch t := co.Conn.(type) { - case *net.TCPConn, *tls.Conn: - r := t.(io.Reader) - - l, err := tcpMsgLen(r) - if err != nil { - return 0, err - } - if l > len(p) { - return int(l), io.ErrShortBuffer - } - return tcpRead(r, p[:l]) - } - // UDP connection - n, err = co.Conn.Read(p) - if err != nil { - return n, err - } - return n, err -} - -// WriteMsg sends a message through the connection co. -// If the message m contains a TSIG record the transaction -// signature is calculated. -func (co *Conn) WriteMsg(m *Msg) (err error) { - var out []byte - if t := m.IsTsig(); t != nil { - mac := "" - if _, ok := co.TsigSecret[t.Hdr.Name]; !ok { - return ErrSecret - } - out, mac, err = TsigGenerate(m, co.TsigSecret[t.Hdr.Name], co.tsigRequestMAC, false) - // Set for the next read, although only used in zone transfers - co.tsigRequestMAC = mac - } else { - out, err = m.Pack() - } - if err != nil { - return err - } - co.t = time.Now() - if _, err = co.Write(out); err != nil { - return err - } - return nil -} - -// Write implements the net.Conn Write method. -func (co *Conn) Write(p []byte) (n int, err error) { - switch t := co.Conn.(type) { - case *net.TCPConn, *tls.Conn: - w := t.(io.Writer) - - lp := len(p) - if lp < 2 { - return 0, io.ErrShortBuffer - } - if lp > MaxMsgSize { - return 0, &Error{err: "message too large"} - } - l := make([]byte, 2, lp+2) - binary.BigEndian.PutUint16(l, uint16(lp)) - p = append(l, p...) - n, err := io.Copy(w, bytes.NewReader(p)) - return int(n), err - } - n, err = co.Conn.(*net.UDPConn).Write(p) - return n, err -} - -// Dial connects to the address on the named network. -func Dial(network, address string) (conn *Conn, err error) { - conn = new(Conn) - conn.Conn, err = net.Dial(network, address) - if err != nil { - return nil, err - } - return conn, nil -} - -// DialTimeout acts like Dial but takes a timeout. -func DialTimeout(network, address string, timeout time.Duration) (conn *Conn, err error) { - conn = new(Conn) - conn.Conn, err = net.DialTimeout(network, address, timeout) - if err != nil { - return nil, err - } - return conn, nil -} - -// DialWithTLS connects to the address on the named network with TLS. -func DialWithTLS(network, address string, tlsConfig *tls.Config) (conn *Conn, err error) { - conn = new(Conn) - conn.Conn, err = tls.Dial(network, address, tlsConfig) - if err != nil { - return nil, err - } - return conn, nil -} - -// DialTimeoutWithTLS acts like DialWithTLS but takes a timeout. -func DialTimeoutWithTLS(network, address string, tlsConfig *tls.Config, timeout time.Duration) (conn *Conn, err error) { - var dialer net.Dialer - dialer.Timeout = timeout - - conn = new(Conn) - conn.Conn, err = tls.DialWithDialer(&dialer, network, address, tlsConfig) - if err != nil { - return nil, err - } - return conn, nil -} - -func deadlineOrTimeout(deadline time.Time, timeout time.Duration) time.Time { - if deadline.IsZero() { - return time.Now().Add(timeout) - } - return deadline -} diff --git a/vendor/github.com/miekg/dns/clientconfig.go b/vendor/github.com/miekg/dns/clientconfig.go deleted file mode 100644 index cfa9ad0..0000000 --- a/vendor/github.com/miekg/dns/clientconfig.go +++ /dev/null @@ -1,99 +0,0 @@ -package dns - -import ( - "bufio" - "os" - "strconv" - "strings" -) - -// ClientConfig wraps the contents of the /etc/resolv.conf file. -type ClientConfig struct { - Servers []string // servers to use - Search []string // suffixes to append to local name - Port string // what port to use - Ndots int // number of dots in name to trigger absolute lookup - Timeout int // seconds before giving up on packet - Attempts int // lost packets before giving up on server, not used in the package dns -} - -// ClientConfigFromFile parses a resolv.conf(5) like file and returns -// a *ClientConfig. -func ClientConfigFromFile(resolvconf string) (*ClientConfig, error) { - file, err := os.Open(resolvconf) - if err != nil { - return nil, err - } - defer file.Close() - c := new(ClientConfig) - scanner := bufio.NewScanner(file) - c.Servers = make([]string, 0) - c.Search = make([]string, 0) - c.Port = "53" - c.Ndots = 1 - c.Timeout = 5 - c.Attempts = 2 - - for scanner.Scan() { - if err := scanner.Err(); err != nil { - return nil, err - } - line := scanner.Text() - f := strings.Fields(line) - if len(f) < 1 { - continue - } - switch f[0] { - case "nameserver": // add one name server - if len(f) > 1 { - // One more check: make sure server name is - // just an IP address. Otherwise we need DNS - // to look it up. - name := f[1] - c.Servers = append(c.Servers, name) - } - - case "domain": // set search path to just this domain - if len(f) > 1 { - c.Search = make([]string, 1) - c.Search[0] = f[1] - } else { - c.Search = make([]string, 0) - } - - case "search": // set search path to given servers - c.Search = make([]string, len(f)-1) - for i := 0; i < len(c.Search); i++ { - c.Search[i] = f[i+1] - } - - case "options": // magic options - for i := 1; i < len(f); i++ { - s := f[i] - switch { - case len(s) >= 6 && s[:6] == "ndots:": - n, _ := strconv.Atoi(s[6:]) - if n < 1 { - n = 1 - } - c.Ndots = n - case len(s) >= 8 && s[:8] == "timeout:": - n, _ := strconv.Atoi(s[8:]) - if n < 1 { - n = 1 - } - c.Timeout = n - case len(s) >= 8 && s[:9] == "attempts:": - n, _ := strconv.Atoi(s[9:]) - if n < 1 { - n = 1 - } - c.Attempts = n - case s == "rotate": - /* not imp */ - } - } - } - } - return c, nil -} diff --git a/vendor/github.com/miekg/dns/dane.go b/vendor/github.com/miekg/dns/dane.go deleted file mode 100644 index cdaa833..0000000 --- a/vendor/github.com/miekg/dns/dane.go +++ /dev/null @@ -1,44 +0,0 @@ -package dns - -import ( - "crypto/sha256" - "crypto/sha512" - "crypto/x509" - "encoding/hex" - "errors" - "io" -) - -// CertificateToDANE converts a certificate to a hex string as used in the TLSA or SMIMEA records. -func CertificateToDANE(selector, matchingType uint8, cert *x509.Certificate) (string, error) { - switch matchingType { - case 0: - switch selector { - case 0: - return hex.EncodeToString(cert.Raw), nil - case 1: - return hex.EncodeToString(cert.RawSubjectPublicKeyInfo), nil - } - case 1: - h := sha256.New() - switch selector { - case 0: - io.WriteString(h, string(cert.Raw)) - return hex.EncodeToString(h.Sum(nil)), nil - case 1: - io.WriteString(h, string(cert.RawSubjectPublicKeyInfo)) - return hex.EncodeToString(h.Sum(nil)), nil - } - case 2: - h := sha512.New() - switch selector { - case 0: - io.WriteString(h, string(cert.Raw)) - return hex.EncodeToString(h.Sum(nil)), nil - case 1: - io.WriteString(h, string(cert.RawSubjectPublicKeyInfo)) - return hex.EncodeToString(h.Sum(nil)), nil - } - } - return "", errors.New("dns: bad MatchingType or Selector") -} diff --git a/vendor/github.com/miekg/dns/defaults.go b/vendor/github.com/miekg/dns/defaults.go deleted file mode 100644 index cf45616..0000000 --- a/vendor/github.com/miekg/dns/defaults.go +++ /dev/null @@ -1,282 +0,0 @@ -package dns - -import ( - "errors" - "net" - "strconv" -) - -const hexDigit = "0123456789abcdef" - -// Everything is assumed in ClassINET. - -// SetReply creates a reply message from a request message. -func (dns *Msg) SetReply(request *Msg) *Msg { - dns.Id = request.Id - dns.RecursionDesired = request.RecursionDesired // Copy rd bit - dns.Response = true - dns.Opcode = OpcodeQuery - dns.Rcode = RcodeSuccess - if len(request.Question) > 0 { - dns.Question = make([]Question, 1) - dns.Question[0] = request.Question[0] - } - return dns -} - -// SetQuestion creates a question message, it sets the Question -// section, generates an Id and sets the RecursionDesired (RD) -// bit to true. -func (dns *Msg) SetQuestion(z string, t uint16) *Msg { - dns.Id = Id() - dns.RecursionDesired = true - dns.Question = make([]Question, 1) - dns.Question[0] = Question{z, t, ClassINET} - return dns -} - -// SetNotify creates a notify message, it sets the Question -// section, generates an Id and sets the Authoritative (AA) -// bit to true. -func (dns *Msg) SetNotify(z string) *Msg { - dns.Opcode = OpcodeNotify - dns.Authoritative = true - dns.Id = Id() - dns.Question = make([]Question, 1) - dns.Question[0] = Question{z, TypeSOA, ClassINET} - return dns -} - -// SetRcode creates an error message suitable for the request. -func (dns *Msg) SetRcode(request *Msg, rcode int) *Msg { - dns.SetReply(request) - dns.Rcode = rcode - return dns -} - -// SetRcodeFormatError creates a message with FormError set. -func (dns *Msg) SetRcodeFormatError(request *Msg) *Msg { - dns.Rcode = RcodeFormatError - dns.Opcode = OpcodeQuery - dns.Response = true - dns.Authoritative = false - dns.Id = request.Id - return dns -} - -// SetUpdate makes the message a dynamic update message. It -// sets the ZONE section to: z, TypeSOA, ClassINET. -func (dns *Msg) SetUpdate(z string) *Msg { - dns.Id = Id() - dns.Response = false - dns.Opcode = OpcodeUpdate - dns.Compress = false // BIND9 cannot handle compression - dns.Question = make([]Question, 1) - dns.Question[0] = Question{z, TypeSOA, ClassINET} - return dns -} - -// SetIxfr creates message for requesting an IXFR. -func (dns *Msg) SetIxfr(z string, serial uint32, ns, mbox string) *Msg { - dns.Id = Id() - dns.Question = make([]Question, 1) - dns.Ns = make([]RR, 1) - s := new(SOA) - s.Hdr = RR_Header{z, TypeSOA, ClassINET, defaultTtl, 0} - s.Serial = serial - s.Ns = ns - s.Mbox = mbox - dns.Question[0] = Question{z, TypeIXFR, ClassINET} - dns.Ns[0] = s - return dns -} - -// SetAxfr creates message for requesting an AXFR. -func (dns *Msg) SetAxfr(z string) *Msg { - dns.Id = Id() - dns.Question = make([]Question, 1) - dns.Question[0] = Question{z, TypeAXFR, ClassINET} - return dns -} - -// SetTsig appends a TSIG RR to the message. -// This is only a skeleton TSIG RR that is added as the last RR in the -// additional section. The Tsig is calculated when the message is being send. -func (dns *Msg) SetTsig(z, algo string, fudge, timesigned int64) *Msg { - t := new(TSIG) - t.Hdr = RR_Header{z, TypeTSIG, ClassANY, 0, 0} - t.Algorithm = algo - t.Fudge = 300 - t.TimeSigned = uint64(timesigned) - t.OrigId = dns.Id - dns.Extra = append(dns.Extra, t) - return dns -} - -// SetEdns0 appends a EDNS0 OPT RR to the message. -// TSIG should always the last RR in a message. -func (dns *Msg) SetEdns0(udpsize uint16, do bool) *Msg { - e := new(OPT) - e.Hdr.Name = "." - e.Hdr.Rrtype = TypeOPT - e.SetUDPSize(udpsize) - if do { - e.SetDo() - } - dns.Extra = append(dns.Extra, e) - return dns -} - -// IsTsig checks if the message has a TSIG record as the last record -// in the additional section. It returns the TSIG record found or nil. -func (dns *Msg) IsTsig() *TSIG { - if len(dns.Extra) > 0 { - if dns.Extra[len(dns.Extra)-1].Header().Rrtype == TypeTSIG { - return dns.Extra[len(dns.Extra)-1].(*TSIG) - } - } - return nil -} - -// IsEdns0 checks if the message has a EDNS0 (OPT) record, any EDNS0 -// record in the additional section will do. It returns the OPT record -// found or nil. -func (dns *Msg) IsEdns0() *OPT { - // EDNS0 is at the end of the additional section, start there. - // We might want to change this to *only* look at the last two - // records. So we see TSIG and/or OPT - this a slightly bigger - // change though. - for i := len(dns.Extra) - 1; i >= 0; i-- { - if dns.Extra[i].Header().Rrtype == TypeOPT { - return dns.Extra[i].(*OPT) - } - } - return nil -} - -// IsDomainName checks if s is a valid domain name, it returns the number of -// labels and true, when a domain name is valid. Note that non fully qualified -// domain name is considered valid, in this case the last label is counted in -// the number of labels. When false is returned the number of labels is not -// defined. Also note that this function is extremely liberal; almost any -// string is a valid domain name as the DNS is 8 bit protocol. It checks if each -// label fits in 63 characters, but there is no length check for the entire -// string s. I.e. a domain name longer than 255 characters is considered valid. -func IsDomainName(s string) (labels int, ok bool) { - _, labels, err := packDomainName(s, nil, 0, nil, false) - return labels, err == nil -} - -// IsSubDomain checks if child is indeed a child of the parent. If child and parent -// are the same domain true is returned as well. -func IsSubDomain(parent, child string) bool { - // Entire child is contained in parent - return CompareDomainName(parent, child) == CountLabel(parent) -} - -// IsMsg sanity checks buf and returns an error if it isn't a valid DNS packet. -// The checking is performed on the binary payload. -func IsMsg(buf []byte) error { - // Header - if len(buf) < 12 { - return errors.New("dns: bad message header") - } - // Header: Opcode - // TODO(miek): more checks here, e.g. check all header bits. - return nil -} - -// IsFqdn checks if a domain name is fully qualified. -func IsFqdn(s string) bool { - l := len(s) - if l == 0 { - return false - } - return s[l-1] == '.' -} - -// IsRRset checks if a set of RRs is a valid RRset as defined by RFC 2181. -// This means the RRs need to have the same type, name, and class. Returns true -// if the RR set is valid, otherwise false. -func IsRRset(rrset []RR) bool { - if len(rrset) == 0 { - return false - } - if len(rrset) == 1 { - return true - } - rrHeader := rrset[0].Header() - rrType := rrHeader.Rrtype - rrClass := rrHeader.Class - rrName := rrHeader.Name - - for _, rr := range rrset[1:] { - curRRHeader := rr.Header() - if curRRHeader.Rrtype != rrType || curRRHeader.Class != rrClass || curRRHeader.Name != rrName { - // Mismatch between the records, so this is not a valid rrset for - //signing/verifying - return false - } - } - - return true -} - -// Fqdn return the fully qualified domain name from s. -// If s is already fully qualified, it behaves as the identity function. -func Fqdn(s string) string { - if IsFqdn(s) { - return s - } - return s + "." -} - -// Copied from the official Go code. - -// ReverseAddr returns the in-addr.arpa. or ip6.arpa. hostname of the IP -// address suitable for reverse DNS (PTR) record lookups or an error if it fails -// to parse the IP address. -func ReverseAddr(addr string) (arpa string, err error) { - ip := net.ParseIP(addr) - if ip == nil { - return "", &Error{err: "unrecognized address: " + addr} - } - if ip.To4() != nil { - return strconv.Itoa(int(ip[15])) + "." + strconv.Itoa(int(ip[14])) + "." + strconv.Itoa(int(ip[13])) + "." + - strconv.Itoa(int(ip[12])) + ".in-addr.arpa.", nil - } - // Must be IPv6 - buf := make([]byte, 0, len(ip)*4+len("ip6.arpa.")) - // Add it, in reverse, to the buffer - for i := len(ip) - 1; i >= 0; i-- { - v := ip[i] - buf = append(buf, hexDigit[v&0xF]) - buf = append(buf, '.') - buf = append(buf, hexDigit[v>>4]) - buf = append(buf, '.') - } - // Append "ip6.arpa." and return (buf already has the final .) - buf = append(buf, "ip6.arpa."...) - return string(buf), nil -} - -// String returns the string representation for the type t. -func (t Type) String() string { - if t1, ok := TypeToString[uint16(t)]; ok { - return t1 - } - return "TYPE" + strconv.Itoa(int(t)) -} - -// String returns the string representation for the class c. -func (c Class) String() string { - if c1, ok := ClassToString[uint16(c)]; ok { - return c1 - } - return "CLASS" + strconv.Itoa(int(c)) -} - -// String returns the string representation for the name n. -func (n Name) String() string { - return sprintName(string(n)) -} diff --git a/vendor/github.com/miekg/dns/dns.go b/vendor/github.com/miekg/dns/dns.go deleted file mode 100644 index b329228..0000000 --- a/vendor/github.com/miekg/dns/dns.go +++ /dev/null @@ -1,104 +0,0 @@ -package dns - -import "strconv" - -const ( - year68 = 1 << 31 // For RFC1982 (Serial Arithmetic) calculations in 32 bits. - defaultTtl = 3600 // Default internal TTL. - - DefaultMsgSize = 4096 // DefaultMsgSize is the standard default for messages larger than 512 bytes. - MinMsgSize = 512 // MinMsgSize is the minimal size of a DNS packet. - MaxMsgSize = 65535 // MaxMsgSize is the largest possible DNS packet. -) - -// Error represents a DNS error. -type Error struct{ err string } - -func (e *Error) Error() string { - if e == nil { - return "dns: " - } - return "dns: " + e.err -} - -// An RR represents a resource record. -type RR interface { - // Header returns the header of an resource record. The header contains - // everything up to the rdata. - Header() *RR_Header - // String returns the text representation of the resource record. - String() string - - // copy returns a copy of the RR - copy() RR - // len returns the length (in octets) of the uncompressed RR in wire format. - len() int - // pack packs an RR into wire format. - pack([]byte, int, map[string]int, bool) (int, error) -} - -// RR_Header is the header all DNS resource records share. -type RR_Header struct { - Name string `dns:"cdomain-name"` - Rrtype uint16 - Class uint16 - Ttl uint32 - Rdlength uint16 // Length of data after header. -} - -// Header returns itself. This is here to make RR_Header implements the RR interface. -func (h *RR_Header) Header() *RR_Header { return h } - -// Just to implement the RR interface. -func (h *RR_Header) copy() RR { return nil } - -func (h *RR_Header) copyHeader() *RR_Header { - r := new(RR_Header) - r.Name = h.Name - r.Rrtype = h.Rrtype - r.Class = h.Class - r.Ttl = h.Ttl - r.Rdlength = h.Rdlength - return r -} - -func (h *RR_Header) String() string { - var s string - - if h.Rrtype == TypeOPT { - s = ";" - // and maybe other things - } - - s += sprintName(h.Name) + "\t" - s += strconv.FormatInt(int64(h.Ttl), 10) + "\t" - s += Class(h.Class).String() + "\t" - s += Type(h.Rrtype).String() + "\t" - return s -} - -func (h *RR_Header) len() int { - l := len(h.Name) + 1 - l += 10 // rrtype(2) + class(2) + ttl(4) + rdlength(2) - return l -} - -// ToRFC3597 converts a known RR to the unknown RR representation from RFC 3597. -func (rr *RFC3597) ToRFC3597(r RR) error { - buf := make([]byte, r.len()*2) - off, err := PackRR(r, buf, 0, nil, false) - if err != nil { - return err - } - buf = buf[:off] - if int(r.Header().Rdlength) > off { - return ErrBuf - } - - rfc3597, _, err := unpackRFC3597(*r.Header(), buf, off-int(r.Header().Rdlength)) - if err != nil { - return err - } - *rr = *rfc3597.(*RFC3597) - return nil -} diff --git a/vendor/github.com/miekg/dns/dnssec.go b/vendor/github.com/miekg/dns/dnssec.go deleted file mode 100644 index f5f3fbd..0000000 --- a/vendor/github.com/miekg/dns/dnssec.go +++ /dev/null @@ -1,721 +0,0 @@ -package dns - -import ( - "bytes" - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "crypto/elliptic" - _ "crypto/md5" - "crypto/rand" - "crypto/rsa" - _ "crypto/sha1" - _ "crypto/sha256" - _ "crypto/sha512" - "encoding/asn1" - "encoding/binary" - "encoding/hex" - "math/big" - "sort" - "strings" - "time" -) - -// DNSSEC encryption algorithm codes. -const ( - _ uint8 = iota - RSAMD5 - DH - DSA - _ // Skip 4, RFC 6725, section 2.1 - RSASHA1 - DSANSEC3SHA1 - RSASHA1NSEC3SHA1 - RSASHA256 - _ // Skip 9, RFC 6725, section 2.1 - RSASHA512 - _ // Skip 11, RFC 6725, section 2.1 - ECCGOST - ECDSAP256SHA256 - ECDSAP384SHA384 - INDIRECT uint8 = 252 - PRIVATEDNS uint8 = 253 // Private (experimental keys) - PRIVATEOID uint8 = 254 -) - -// Map for algorithm names. -var AlgorithmToString = map[uint8]string{ - RSAMD5: "RSAMD5", - DH: "DH", - DSA: "DSA", - RSASHA1: "RSASHA1", - DSANSEC3SHA1: "DSA-NSEC3-SHA1", - RSASHA1NSEC3SHA1: "RSASHA1-NSEC3-SHA1", - RSASHA256: "RSASHA256", - RSASHA512: "RSASHA512", - ECCGOST: "ECC-GOST", - ECDSAP256SHA256: "ECDSAP256SHA256", - ECDSAP384SHA384: "ECDSAP384SHA384", - INDIRECT: "INDIRECT", - PRIVATEDNS: "PRIVATEDNS", - PRIVATEOID: "PRIVATEOID", -} - -// Map of algorithm strings. -var StringToAlgorithm = reverseInt8(AlgorithmToString) - -// Map of algorithm crypto hashes. -var AlgorithmToHash = map[uint8]crypto.Hash{ - RSAMD5: crypto.MD5, // Deprecated in RFC 6725 - RSASHA1: crypto.SHA1, - RSASHA1NSEC3SHA1: crypto.SHA1, - RSASHA256: crypto.SHA256, - ECDSAP256SHA256: crypto.SHA256, - ECDSAP384SHA384: crypto.SHA384, - RSASHA512: crypto.SHA512, -} - -// DNSSEC hashing algorithm codes. -const ( - _ uint8 = iota - SHA1 // RFC 4034 - SHA256 // RFC 4509 - GOST94 // RFC 5933 - SHA384 // Experimental - SHA512 // Experimental -) - -// Map for hash names. -var HashToString = map[uint8]string{ - SHA1: "SHA1", - SHA256: "SHA256", - GOST94: "GOST94", - SHA384: "SHA384", - SHA512: "SHA512", -} - -// Map of hash strings. -var StringToHash = reverseInt8(HashToString) - -// DNSKEY flag values. -const ( - SEP = 1 - REVOKE = 1 << 7 - ZONE = 1 << 8 -) - -// The RRSIG needs to be converted to wireformat with some of the rdata (the signature) missing. -type rrsigWireFmt struct { - TypeCovered uint16 - Algorithm uint8 - Labels uint8 - OrigTtl uint32 - Expiration uint32 - Inception uint32 - KeyTag uint16 - SignerName string `dns:"domain-name"` - /* No Signature */ -} - -// Used for converting DNSKEY's rdata to wirefmt. -type dnskeyWireFmt struct { - Flags uint16 - Protocol uint8 - Algorithm uint8 - PublicKey string `dns:"base64"` - /* Nothing is left out */ -} - -func divRoundUp(a, b int) int { - return (a + b - 1) / b -} - -// KeyTag calculates the keytag (or key-id) of the DNSKEY. -func (k *DNSKEY) KeyTag() uint16 { - if k == nil { - return 0 - } - var keytag int - switch k.Algorithm { - case RSAMD5: - // Look at the bottom two bytes of the modules, which the last - // item in the pubkey. We could do this faster by looking directly - // at the base64 values. But I'm lazy. - modulus, _ := fromBase64([]byte(k.PublicKey)) - if len(modulus) > 1 { - x := binary.BigEndian.Uint16(modulus[len(modulus)-2:]) - keytag = int(x) - } - default: - keywire := new(dnskeyWireFmt) - keywire.Flags = k.Flags - keywire.Protocol = k.Protocol - keywire.Algorithm = k.Algorithm - keywire.PublicKey = k.PublicKey - wire := make([]byte, DefaultMsgSize) - n, err := packKeyWire(keywire, wire) - if err != nil { - return 0 - } - wire = wire[:n] - for i, v := range wire { - if i&1 != 0 { - keytag += int(v) // must be larger than uint32 - } else { - keytag += int(v) << 8 - } - } - keytag += (keytag >> 16) & 0xFFFF - keytag &= 0xFFFF - } - return uint16(keytag) -} - -// ToDS converts a DNSKEY record to a DS record. -func (k *DNSKEY) ToDS(h uint8) *DS { - if k == nil { - return nil - } - ds := new(DS) - ds.Hdr.Name = k.Hdr.Name - ds.Hdr.Class = k.Hdr.Class - ds.Hdr.Rrtype = TypeDS - ds.Hdr.Ttl = k.Hdr.Ttl - ds.Algorithm = k.Algorithm - ds.DigestType = h - ds.KeyTag = k.KeyTag() - - keywire := new(dnskeyWireFmt) - keywire.Flags = k.Flags - keywire.Protocol = k.Protocol - keywire.Algorithm = k.Algorithm - keywire.PublicKey = k.PublicKey - wire := make([]byte, DefaultMsgSize) - n, err := packKeyWire(keywire, wire) - if err != nil { - return nil - } - wire = wire[:n] - - owner := make([]byte, 255) - off, err1 := PackDomainName(strings.ToLower(k.Hdr.Name), owner, 0, nil, false) - if err1 != nil { - return nil - } - owner = owner[:off] - // RFC4034: - // digest = digest_algorithm( DNSKEY owner name | DNSKEY RDATA); - // "|" denotes concatenation - // DNSKEY RDATA = Flags | Protocol | Algorithm | Public Key. - - // digest buffer - digest := append(owner, wire...) // another copy - - var hash crypto.Hash - switch h { - case SHA1: - hash = crypto.SHA1 - case SHA256: - hash = crypto.SHA256 - case SHA384: - hash = crypto.SHA384 - case SHA512: - hash = crypto.SHA512 - default: - return nil - } - - s := hash.New() - s.Write(digest) - ds.Digest = hex.EncodeToString(s.Sum(nil)) - return ds -} - -// ToCDNSKEY converts a DNSKEY record to a CDNSKEY record. -func (k *DNSKEY) ToCDNSKEY() *CDNSKEY { - c := &CDNSKEY{DNSKEY: *k} - c.Hdr = *k.Hdr.copyHeader() - c.Hdr.Rrtype = TypeCDNSKEY - return c -} - -// ToCDS converts a DS record to a CDS record. -func (d *DS) ToCDS() *CDS { - c := &CDS{DS: *d} - c.Hdr = *d.Hdr.copyHeader() - c.Hdr.Rrtype = TypeCDS - return c -} - -// Sign signs an RRSet. The signature needs to be filled in with the values: -// Inception, Expiration, KeyTag, SignerName and Algorithm. The rest is copied -// from the RRset. Sign returns a non-nill error when the signing went OK. -// There is no check if RRSet is a proper (RFC 2181) RRSet. If OrigTTL is non -// zero, it is used as-is, otherwise the TTL of the RRset is used as the -// OrigTTL. -func (rr *RRSIG) Sign(k crypto.Signer, rrset []RR) error { - if k == nil { - return ErrPrivKey - } - // s.Inception and s.Expiration may be 0 (rollover etc.), the rest must be set - if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { - return ErrKey - } - - rr.Hdr.Rrtype = TypeRRSIG - rr.Hdr.Name = rrset[0].Header().Name - rr.Hdr.Class = rrset[0].Header().Class - if rr.OrigTtl == 0 { // If set don't override - rr.OrigTtl = rrset[0].Header().Ttl - } - rr.TypeCovered = rrset[0].Header().Rrtype - rr.Labels = uint8(CountLabel(rrset[0].Header().Name)) - - if strings.HasPrefix(rrset[0].Header().Name, "*") { - rr.Labels-- // wildcard, remove from label count - } - - sigwire := new(rrsigWireFmt) - sigwire.TypeCovered = rr.TypeCovered - sigwire.Algorithm = rr.Algorithm - sigwire.Labels = rr.Labels - sigwire.OrigTtl = rr.OrigTtl - sigwire.Expiration = rr.Expiration - sigwire.Inception = rr.Inception - sigwire.KeyTag = rr.KeyTag - // For signing, lowercase this name - sigwire.SignerName = strings.ToLower(rr.SignerName) - - // Create the desired binary blob - signdata := make([]byte, DefaultMsgSize) - n, err := packSigWire(sigwire, signdata) - if err != nil { - return err - } - signdata = signdata[:n] - wire, err := rawSignatureData(rrset, rr) - if err != nil { - return err - } - signdata = append(signdata, wire...) - - hash, ok := AlgorithmToHash[rr.Algorithm] - if !ok { - return ErrAlg - } - - h := hash.New() - h.Write(signdata) - - signature, err := sign(k, h.Sum(nil), hash, rr.Algorithm) - if err != nil { - return err - } - - rr.Signature = toBase64(signature) - - return nil -} - -func sign(k crypto.Signer, hashed []byte, hash crypto.Hash, alg uint8) ([]byte, error) { - signature, err := k.Sign(rand.Reader, hashed, hash) - if err != nil { - return nil, err - } - - switch alg { - case RSASHA1, RSASHA1NSEC3SHA1, RSASHA256, RSASHA512: - return signature, nil - - case ECDSAP256SHA256, ECDSAP384SHA384: - ecdsaSignature := &struct { - R, S *big.Int - }{} - if _, err := asn1.Unmarshal(signature, ecdsaSignature); err != nil { - return nil, err - } - - var intlen int - switch alg { - case ECDSAP256SHA256: - intlen = 32 - case ECDSAP384SHA384: - intlen = 48 - } - - signature := intToBytes(ecdsaSignature.R, intlen) - signature = append(signature, intToBytes(ecdsaSignature.S, intlen)...) - return signature, nil - - // There is no defined interface for what a DSA backed crypto.Signer returns - case DSA, DSANSEC3SHA1: - // t := divRoundUp(divRoundUp(p.PublicKey.Y.BitLen(), 8)-64, 8) - // signature := []byte{byte(t)} - // signature = append(signature, intToBytes(r1, 20)...) - // signature = append(signature, intToBytes(s1, 20)...) - // rr.Signature = signature - } - - return nil, ErrAlg -} - -// Verify validates an RRSet with the signature and key. This is only the -// cryptographic test, the signature validity period must be checked separately. -// This function copies the rdata of some RRs (to lowercase domain names) for the validation to work. -func (rr *RRSIG) Verify(k *DNSKEY, rrset []RR) error { - // First the easy checks - if !IsRRset(rrset) { - return ErrRRset - } - if rr.KeyTag != k.KeyTag() { - return ErrKey - } - if rr.Hdr.Class != k.Hdr.Class { - return ErrKey - } - if rr.Algorithm != k.Algorithm { - return ErrKey - } - if strings.ToLower(rr.SignerName) != strings.ToLower(k.Hdr.Name) { - return ErrKey - } - if k.Protocol != 3 { - return ErrKey - } - - // IsRRset checked that we have at least one RR and that the RRs in - // the set have consistent type, class, and name. Also check that type and - // class matches the RRSIG record. - if rrset[0].Header().Class != rr.Hdr.Class { - return ErrRRset - } - if rrset[0].Header().Rrtype != rr.TypeCovered { - return ErrRRset - } - - // RFC 4035 5.3.2. Reconstructing the Signed Data - // Copy the sig, except the rrsig data - sigwire := new(rrsigWireFmt) - sigwire.TypeCovered = rr.TypeCovered - sigwire.Algorithm = rr.Algorithm - sigwire.Labels = rr.Labels - sigwire.OrigTtl = rr.OrigTtl - sigwire.Expiration = rr.Expiration - sigwire.Inception = rr.Inception - sigwire.KeyTag = rr.KeyTag - sigwire.SignerName = strings.ToLower(rr.SignerName) - // Create the desired binary blob - signeddata := make([]byte, DefaultMsgSize) - n, err := packSigWire(sigwire, signeddata) - if err != nil { - return err - } - signeddata = signeddata[:n] - wire, err := rawSignatureData(rrset, rr) - if err != nil { - return err - } - signeddata = append(signeddata, wire...) - - sigbuf := rr.sigBuf() // Get the binary signature data - if rr.Algorithm == PRIVATEDNS { // PRIVATEOID - // TODO(miek) - // remove the domain name and assume its ours? - } - - hash, ok := AlgorithmToHash[rr.Algorithm] - if !ok { - return ErrAlg - } - - switch rr.Algorithm { - case RSASHA1, RSASHA1NSEC3SHA1, RSASHA256, RSASHA512, RSAMD5: - // TODO(mg): this can be done quicker, ie. cache the pubkey data somewhere?? - pubkey := k.publicKeyRSA() // Get the key - if pubkey == nil { - return ErrKey - } - - h := hash.New() - h.Write(signeddata) - return rsa.VerifyPKCS1v15(pubkey, hash, h.Sum(nil), sigbuf) - - case ECDSAP256SHA256, ECDSAP384SHA384: - pubkey := k.publicKeyECDSA() - if pubkey == nil { - return ErrKey - } - - // Split sigbuf into the r and s coordinates - r := new(big.Int).SetBytes(sigbuf[:len(sigbuf)/2]) - s := new(big.Int).SetBytes(sigbuf[len(sigbuf)/2:]) - - h := hash.New() - h.Write(signeddata) - if ecdsa.Verify(pubkey, h.Sum(nil), r, s) { - return nil - } - return ErrSig - - default: - return ErrAlg - } -} - -// ValidityPeriod uses RFC1982 serial arithmetic to calculate -// if a signature period is valid. If t is the zero time, the -// current time is taken other t is. Returns true if the signature -// is valid at the given time, otherwise returns false. -func (rr *RRSIG) ValidityPeriod(t time.Time) bool { - var utc int64 - if t.IsZero() { - utc = time.Now().UTC().Unix() - } else { - utc = t.UTC().Unix() - } - modi := (int64(rr.Inception) - utc) / year68 - mode := (int64(rr.Expiration) - utc) / year68 - ti := int64(rr.Inception) + (modi * year68) - te := int64(rr.Expiration) + (mode * year68) - return ti <= utc && utc <= te -} - -// Return the signatures base64 encodedig sigdata as a byte slice. -func (rr *RRSIG) sigBuf() []byte { - sigbuf, err := fromBase64([]byte(rr.Signature)) - if err != nil { - return nil - } - return sigbuf -} - -// publicKeyRSA returns the RSA public key from a DNSKEY record. -func (k *DNSKEY) publicKeyRSA() *rsa.PublicKey { - keybuf, err := fromBase64([]byte(k.PublicKey)) - if err != nil { - return nil - } - - // RFC 2537/3110, section 2. RSA Public KEY Resource Records - // Length is in the 0th byte, unless its zero, then it - // it in bytes 1 and 2 and its a 16 bit number - explen := uint16(keybuf[0]) - keyoff := 1 - if explen == 0 { - explen = uint16(keybuf[1])<<8 | uint16(keybuf[2]) - keyoff = 3 - } - pubkey := new(rsa.PublicKey) - - pubkey.N = big.NewInt(0) - shift := uint64((explen - 1) * 8) - expo := uint64(0) - for i := int(explen - 1); i > 0; i-- { - expo += uint64(keybuf[keyoff+i]) << shift - shift -= 8 - } - // Remainder - expo += uint64(keybuf[keyoff]) - if expo > 2<<31 { - // Larger expo than supported. - // println("dns: F5 primes (or larger) are not supported") - return nil - } - pubkey.E = int(expo) - - pubkey.N.SetBytes(keybuf[keyoff+int(explen):]) - return pubkey -} - -// publicKeyECDSA returns the Curve public key from the DNSKEY record. -func (k *DNSKEY) publicKeyECDSA() *ecdsa.PublicKey { - keybuf, err := fromBase64([]byte(k.PublicKey)) - if err != nil { - return nil - } - pubkey := new(ecdsa.PublicKey) - switch k.Algorithm { - case ECDSAP256SHA256: - pubkey.Curve = elliptic.P256() - if len(keybuf) != 64 { - // wrongly encoded key - return nil - } - case ECDSAP384SHA384: - pubkey.Curve = elliptic.P384() - if len(keybuf) != 96 { - // Wrongly encoded key - return nil - } - } - pubkey.X = big.NewInt(0) - pubkey.X.SetBytes(keybuf[:len(keybuf)/2]) - pubkey.Y = big.NewInt(0) - pubkey.Y.SetBytes(keybuf[len(keybuf)/2:]) - return pubkey -} - -func (k *DNSKEY) publicKeyDSA() *dsa.PublicKey { - keybuf, err := fromBase64([]byte(k.PublicKey)) - if err != nil { - return nil - } - if len(keybuf) < 22 { - return nil - } - t, keybuf := int(keybuf[0]), keybuf[1:] - size := 64 + t*8 - q, keybuf := keybuf[:20], keybuf[20:] - if len(keybuf) != 3*size { - return nil - } - p, keybuf := keybuf[:size], keybuf[size:] - g, y := keybuf[:size], keybuf[size:] - pubkey := new(dsa.PublicKey) - pubkey.Parameters.Q = big.NewInt(0).SetBytes(q) - pubkey.Parameters.P = big.NewInt(0).SetBytes(p) - pubkey.Parameters.G = big.NewInt(0).SetBytes(g) - pubkey.Y = big.NewInt(0).SetBytes(y) - return pubkey -} - -type wireSlice [][]byte - -func (p wireSlice) Len() int { return len(p) } -func (p wireSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } -func (p wireSlice) Less(i, j int) bool { - _, ioff, _ := UnpackDomainName(p[i], 0) - _, joff, _ := UnpackDomainName(p[j], 0) - return bytes.Compare(p[i][ioff+10:], p[j][joff+10:]) < 0 -} - -// Return the raw signature data. -func rawSignatureData(rrset []RR, s *RRSIG) (buf []byte, err error) { - wires := make(wireSlice, len(rrset)) - for i, r := range rrset { - r1 := r.copy() - r1.Header().Ttl = s.OrigTtl - labels := SplitDomainName(r1.Header().Name) - // 6.2. Canonical RR Form. (4) - wildcards - if len(labels) > int(s.Labels) { - // Wildcard - r1.Header().Name = "*." + strings.Join(labels[len(labels)-int(s.Labels):], ".") + "." - } - // RFC 4034: 6.2. Canonical RR Form. (2) - domain name to lowercase - r1.Header().Name = strings.ToLower(r1.Header().Name) - // 6.2. Canonical RR Form. (3) - domain rdata to lowercase. - // NS, MD, MF, CNAME, SOA, MB, MG, MR, PTR, - // HINFO, MINFO, MX, RP, AFSDB, RT, SIG, PX, NXT, NAPTR, KX, - // SRV, DNAME, A6 - // - // RFC 6840 - Clarifications and Implementation Notes for DNS Security (DNSSEC): - // Section 6.2 of [RFC4034] also erroneously lists HINFO as a record - // that needs conversion to lowercase, and twice at that. Since HINFO - // records contain no domain names, they are not subject to case - // conversion. - switch x := r1.(type) { - case *NS: - x.Ns = strings.ToLower(x.Ns) - case *CNAME: - x.Target = strings.ToLower(x.Target) - case *SOA: - x.Ns = strings.ToLower(x.Ns) - x.Mbox = strings.ToLower(x.Mbox) - case *MB: - x.Mb = strings.ToLower(x.Mb) - case *MG: - x.Mg = strings.ToLower(x.Mg) - case *MR: - x.Mr = strings.ToLower(x.Mr) - case *PTR: - x.Ptr = strings.ToLower(x.Ptr) - case *MINFO: - x.Rmail = strings.ToLower(x.Rmail) - x.Email = strings.ToLower(x.Email) - case *MX: - x.Mx = strings.ToLower(x.Mx) - case *NAPTR: - x.Replacement = strings.ToLower(x.Replacement) - case *KX: - x.Exchanger = strings.ToLower(x.Exchanger) - case *SRV: - x.Target = strings.ToLower(x.Target) - case *DNAME: - x.Target = strings.ToLower(x.Target) - } - // 6.2. Canonical RR Form. (5) - origTTL - wire := make([]byte, r1.len()+1) // +1 to be safe(r) - off, err1 := PackRR(r1, wire, 0, nil, false) - if err1 != nil { - return nil, err1 - } - wire = wire[:off] - wires[i] = wire - } - sort.Sort(wires) - for i, wire := range wires { - if i > 0 && bytes.Equal(wire, wires[i-1]) { - continue - } - buf = append(buf, wire...) - } - return buf, nil -} - -func packSigWire(sw *rrsigWireFmt, msg []byte) (int, error) { - // copied from zmsg.go RRSIG packing - off, err := packUint16(sw.TypeCovered, msg, 0) - if err != nil { - return off, err - } - off, err = packUint8(sw.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(sw.Labels, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(sw.OrigTtl, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(sw.Expiration, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(sw.Inception, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(sw.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(sw.SignerName, msg, off, nil, false) - if err != nil { - return off, err - } - return off, nil -} - -func packKeyWire(dw *dnskeyWireFmt, msg []byte) (int, error) { - // copied from zmsg.go DNSKEY packing - off, err := packUint16(dw.Flags, msg, 0) - if err != nil { - return off, err - } - off, err = packUint8(dw.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(dw.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(dw.PublicKey, msg, off) - if err != nil { - return off, err - } - return off, nil -} diff --git a/vendor/github.com/miekg/dns/dnssec_keygen.go b/vendor/github.com/miekg/dns/dnssec_keygen.go deleted file mode 100644 index 229a079..0000000 --- a/vendor/github.com/miekg/dns/dnssec_keygen.go +++ /dev/null @@ -1,156 +0,0 @@ -package dns - -import ( - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - "math/big" -) - -// Generate generates a DNSKEY of the given bit size. -// The public part is put inside the DNSKEY record. -// The Algorithm in the key must be set as this will define -// what kind of DNSKEY will be generated. -// The ECDSA algorithms imply a fixed keysize, in that case -// bits should be set to the size of the algorithm. -func (k *DNSKEY) Generate(bits int) (crypto.PrivateKey, error) { - switch k.Algorithm { - case DSA, DSANSEC3SHA1: - if bits != 1024 { - return nil, ErrKeySize - } - case RSAMD5, RSASHA1, RSASHA256, RSASHA1NSEC3SHA1: - if bits < 512 || bits > 4096 { - return nil, ErrKeySize - } - case RSASHA512: - if bits < 1024 || bits > 4096 { - return nil, ErrKeySize - } - case ECDSAP256SHA256: - if bits != 256 { - return nil, ErrKeySize - } - case ECDSAP384SHA384: - if bits != 384 { - return nil, ErrKeySize - } - } - - switch k.Algorithm { - case DSA, DSANSEC3SHA1: - params := new(dsa.Parameters) - if err := dsa.GenerateParameters(params, rand.Reader, dsa.L1024N160); err != nil { - return nil, err - } - priv := new(dsa.PrivateKey) - priv.PublicKey.Parameters = *params - err := dsa.GenerateKey(priv, rand.Reader) - if err != nil { - return nil, err - } - k.setPublicKeyDSA(params.Q, params.P, params.G, priv.PublicKey.Y) - return priv, nil - case RSAMD5, RSASHA1, RSASHA256, RSASHA512, RSASHA1NSEC3SHA1: - priv, err := rsa.GenerateKey(rand.Reader, bits) - if err != nil { - return nil, err - } - k.setPublicKeyRSA(priv.PublicKey.E, priv.PublicKey.N) - return priv, nil - case ECDSAP256SHA256, ECDSAP384SHA384: - var c elliptic.Curve - switch k.Algorithm { - case ECDSAP256SHA256: - c = elliptic.P256() - case ECDSAP384SHA384: - c = elliptic.P384() - } - priv, err := ecdsa.GenerateKey(c, rand.Reader) - if err != nil { - return nil, err - } - k.setPublicKeyECDSA(priv.PublicKey.X, priv.PublicKey.Y) - return priv, nil - default: - return nil, ErrAlg - } -} - -// Set the public key (the value E and N) -func (k *DNSKEY) setPublicKeyRSA(_E int, _N *big.Int) bool { - if _E == 0 || _N == nil { - return false - } - buf := exponentToBuf(_E) - buf = append(buf, _N.Bytes()...) - k.PublicKey = toBase64(buf) - return true -} - -// Set the public key for Elliptic Curves -func (k *DNSKEY) setPublicKeyECDSA(_X, _Y *big.Int) bool { - if _X == nil || _Y == nil { - return false - } - var intlen int - switch k.Algorithm { - case ECDSAP256SHA256: - intlen = 32 - case ECDSAP384SHA384: - intlen = 48 - } - k.PublicKey = toBase64(curveToBuf(_X, _Y, intlen)) - return true -} - -// Set the public key for DSA -func (k *DNSKEY) setPublicKeyDSA(_Q, _P, _G, _Y *big.Int) bool { - if _Q == nil || _P == nil || _G == nil || _Y == nil { - return false - } - buf := dsaToBuf(_Q, _P, _G, _Y) - k.PublicKey = toBase64(buf) - return true -} - -// Set the public key (the values E and N) for RSA -// RFC 3110: Section 2. RSA Public KEY Resource Records -func exponentToBuf(_E int) []byte { - var buf []byte - i := big.NewInt(int64(_E)) - if len(i.Bytes()) < 256 { - buf = make([]byte, 1) - buf[0] = uint8(len(i.Bytes())) - } else { - buf = make([]byte, 3) - buf[0] = 0 - buf[1] = uint8(len(i.Bytes()) >> 8) - buf[2] = uint8(len(i.Bytes())) - } - buf = append(buf, i.Bytes()...) - return buf -} - -// Set the public key for X and Y for Curve. The two -// values are just concatenated. -func curveToBuf(_X, _Y *big.Int, intlen int) []byte { - buf := intToBytes(_X, intlen) - buf = append(buf, intToBytes(_Y, intlen)...) - return buf -} - -// Set the public key for X and Y for Curve. The two -// values are just concatenated. -func dsaToBuf(_Q, _P, _G, _Y *big.Int) []byte { - t := divRoundUp(divRoundUp(_G.BitLen(), 8)-64, 8) - buf := []byte{byte(t)} - buf = append(buf, intToBytes(_Q, 20)...) - buf = append(buf, intToBytes(_P, 64+t*8)...) - buf = append(buf, intToBytes(_G, 64+t*8)...) - buf = append(buf, intToBytes(_Y, 64+t*8)...) - return buf -} diff --git a/vendor/github.com/miekg/dns/dnssec_keyscan.go b/vendor/github.com/miekg/dns/dnssec_keyscan.go deleted file mode 100644 index 9ff3a61..0000000 --- a/vendor/github.com/miekg/dns/dnssec_keyscan.go +++ /dev/null @@ -1,249 +0,0 @@ -package dns - -import ( - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "crypto/rsa" - "io" - "math/big" - "strconv" - "strings" -) - -// NewPrivateKey returns a PrivateKey by parsing the string s. -// s should be in the same form of the BIND private key files. -func (k *DNSKEY) NewPrivateKey(s string) (crypto.PrivateKey, error) { - if s == "" || s[len(s)-1] != '\n' { // We need a closing newline - return k.ReadPrivateKey(strings.NewReader(s+"\n"), "") - } - return k.ReadPrivateKey(strings.NewReader(s), "") -} - -// ReadPrivateKey reads a private key from the io.Reader q. The string file is -// only used in error reporting. -// The public key must be known, because some cryptographic algorithms embed -// the public inside the privatekey. -func (k *DNSKEY) ReadPrivateKey(q io.Reader, file string) (crypto.PrivateKey, error) { - m, err := parseKey(q, file) - if m == nil { - return nil, err - } - if _, ok := m["private-key-format"]; !ok { - return nil, ErrPrivKey - } - if m["private-key-format"] != "v1.2" && m["private-key-format"] != "v1.3" { - return nil, ErrPrivKey - } - // TODO(mg): check if the pubkey matches the private key - algo, err := strconv.Atoi(strings.SplitN(m["algorithm"], " ", 2)[0]) - if err != nil { - return nil, ErrPrivKey - } - switch uint8(algo) { - case DSA: - priv, err := readPrivateKeyDSA(m) - if err != nil { - return nil, err - } - pub := k.publicKeyDSA() - if pub == nil { - return nil, ErrKey - } - priv.PublicKey = *pub - return priv, nil - case RSAMD5: - fallthrough - case RSASHA1: - fallthrough - case RSASHA1NSEC3SHA1: - fallthrough - case RSASHA256: - fallthrough - case RSASHA512: - priv, err := readPrivateKeyRSA(m) - if err != nil { - return nil, err - } - pub := k.publicKeyRSA() - if pub == nil { - return nil, ErrKey - } - priv.PublicKey = *pub - return priv, nil - case ECCGOST: - return nil, ErrPrivKey - case ECDSAP256SHA256: - fallthrough - case ECDSAP384SHA384: - priv, err := readPrivateKeyECDSA(m) - if err != nil { - return nil, err - } - pub := k.publicKeyECDSA() - if pub == nil { - return nil, ErrKey - } - priv.PublicKey = *pub - return priv, nil - default: - return nil, ErrPrivKey - } -} - -// Read a private key (file) string and create a public key. Return the private key. -func readPrivateKeyRSA(m map[string]string) (*rsa.PrivateKey, error) { - p := new(rsa.PrivateKey) - p.Primes = []*big.Int{nil, nil} - for k, v := range m { - switch k { - case "modulus", "publicexponent", "privateexponent", "prime1", "prime2": - v1, err := fromBase64([]byte(v)) - if err != nil { - return nil, err - } - switch k { - case "modulus": - p.PublicKey.N = big.NewInt(0) - p.PublicKey.N.SetBytes(v1) - case "publicexponent": - i := big.NewInt(0) - i.SetBytes(v1) - p.PublicKey.E = int(i.Int64()) // int64 should be large enough - case "privateexponent": - p.D = big.NewInt(0) - p.D.SetBytes(v1) - case "prime1": - p.Primes[0] = big.NewInt(0) - p.Primes[0].SetBytes(v1) - case "prime2": - p.Primes[1] = big.NewInt(0) - p.Primes[1].SetBytes(v1) - } - case "exponent1", "exponent2", "coefficient": - // not used in Go (yet) - case "created", "publish", "activate": - // not used in Go (yet) - } - } - return p, nil -} - -func readPrivateKeyDSA(m map[string]string) (*dsa.PrivateKey, error) { - p := new(dsa.PrivateKey) - p.X = big.NewInt(0) - for k, v := range m { - switch k { - case "private_value(x)": - v1, err := fromBase64([]byte(v)) - if err != nil { - return nil, err - } - p.X.SetBytes(v1) - case "created", "publish", "activate": - /* not used in Go (yet) */ - } - } - return p, nil -} - -func readPrivateKeyECDSA(m map[string]string) (*ecdsa.PrivateKey, error) { - p := new(ecdsa.PrivateKey) - p.D = big.NewInt(0) - // TODO: validate that the required flags are present - for k, v := range m { - switch k { - case "privatekey": - v1, err := fromBase64([]byte(v)) - if err != nil { - return nil, err - } - p.D.SetBytes(v1) - case "created", "publish", "activate": - /* not used in Go (yet) */ - } - } - return p, nil -} - -// parseKey reads a private key from r. It returns a map[string]string, -// with the key-value pairs, or an error when the file is not correct. -func parseKey(r io.Reader, file string) (map[string]string, error) { - s := scanInit(r) - m := make(map[string]string) - c := make(chan lex) - k := "" - // Start the lexer - go klexer(s, c) - for l := range c { - // It should alternate - switch l.value { - case zKey: - k = l.token - case zValue: - if k == "" { - return nil, &ParseError{file, "no private key seen", l} - } - //println("Setting", strings.ToLower(k), "to", l.token, "b") - m[strings.ToLower(k)] = l.token - k = "" - } - } - return m, nil -} - -// klexer scans the sourcefile and returns tokens on the channel c. -func klexer(s *scan, c chan lex) { - var l lex - str := "" // Hold the current read text - commt := false - key := true - x, err := s.tokenText() - defer close(c) - for err == nil { - l.column = s.position.Column - l.line = s.position.Line - switch x { - case ':': - if commt { - break - } - l.token = str - if key { - l.value = zKey - c <- l - // Next token is a space, eat it - s.tokenText() - key = false - str = "" - } else { - l.value = zValue - } - case ';': - commt = true - case '\n': - if commt { - // Reset a comment - commt = false - } - l.value = zValue - l.token = str - c <- l - str = "" - commt = false - key = true - default: - if commt { - break - } - str += string(x) - } - x, err = s.tokenText() - } - if len(str) > 0 { - // Send remainder - l.token = str - l.value = zValue - c <- l - } -} diff --git a/vendor/github.com/miekg/dns/dnssec_privkey.go b/vendor/github.com/miekg/dns/dnssec_privkey.go deleted file mode 100644 index 56f3ea9..0000000 --- a/vendor/github.com/miekg/dns/dnssec_privkey.go +++ /dev/null @@ -1,85 +0,0 @@ -package dns - -import ( - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "crypto/rsa" - "math/big" - "strconv" -) - -const format = "Private-key-format: v1.3\n" - -// PrivateKeyString converts a PrivateKey to a string. This string has the same -// format as the private-key-file of BIND9 (Private-key-format: v1.3). -// It needs some info from the key (the algorithm), so its a method of the DNSKEY -// It supports rsa.PrivateKey, ecdsa.PrivateKey and dsa.PrivateKey -func (r *DNSKEY) PrivateKeyString(p crypto.PrivateKey) string { - algorithm := strconv.Itoa(int(r.Algorithm)) - algorithm += " (" + AlgorithmToString[r.Algorithm] + ")" - - switch p := p.(type) { - case *rsa.PrivateKey: - modulus := toBase64(p.PublicKey.N.Bytes()) - e := big.NewInt(int64(p.PublicKey.E)) - publicExponent := toBase64(e.Bytes()) - privateExponent := toBase64(p.D.Bytes()) - prime1 := toBase64(p.Primes[0].Bytes()) - prime2 := toBase64(p.Primes[1].Bytes()) - // Calculate Exponent1/2 and Coefficient as per: http://en.wikipedia.org/wiki/RSA#Using_the_Chinese_remainder_algorithm - // and from: http://code.google.com/p/go/issues/detail?id=987 - one := big.NewInt(1) - p1 := big.NewInt(0).Sub(p.Primes[0], one) - q1 := big.NewInt(0).Sub(p.Primes[1], one) - exp1 := big.NewInt(0).Mod(p.D, p1) - exp2 := big.NewInt(0).Mod(p.D, q1) - coeff := big.NewInt(0).ModInverse(p.Primes[1], p.Primes[0]) - - exponent1 := toBase64(exp1.Bytes()) - exponent2 := toBase64(exp2.Bytes()) - coefficient := toBase64(coeff.Bytes()) - - return format + - "Algorithm: " + algorithm + "\n" + - "Modulus: " + modulus + "\n" + - "PublicExponent: " + publicExponent + "\n" + - "PrivateExponent: " + privateExponent + "\n" + - "Prime1: " + prime1 + "\n" + - "Prime2: " + prime2 + "\n" + - "Exponent1: " + exponent1 + "\n" + - "Exponent2: " + exponent2 + "\n" + - "Coefficient: " + coefficient + "\n" - - case *ecdsa.PrivateKey: - var intlen int - switch r.Algorithm { - case ECDSAP256SHA256: - intlen = 32 - case ECDSAP384SHA384: - intlen = 48 - } - private := toBase64(intToBytes(p.D, intlen)) - return format + - "Algorithm: " + algorithm + "\n" + - "PrivateKey: " + private + "\n" - - case *dsa.PrivateKey: - T := divRoundUp(divRoundUp(p.PublicKey.Parameters.G.BitLen(), 8)-64, 8) - prime := toBase64(intToBytes(p.PublicKey.Parameters.P, 64+T*8)) - subprime := toBase64(intToBytes(p.PublicKey.Parameters.Q, 20)) - base := toBase64(intToBytes(p.PublicKey.Parameters.G, 64+T*8)) - priv := toBase64(intToBytes(p.X, 20)) - pub := toBase64(intToBytes(p.PublicKey.Y, 64+T*8)) - return format + - "Algorithm: " + algorithm + "\n" + - "Prime(p): " + prime + "\n" + - "Subprime(q): " + subprime + "\n" + - "Base(g): " + base + "\n" + - "Private_value(x): " + priv + "\n" + - "Public_value(y): " + pub + "\n" - - default: - return "" - } -} diff --git a/vendor/github.com/miekg/dns/doc.go b/vendor/github.com/miekg/dns/doc.go deleted file mode 100644 index e38753d..0000000 --- a/vendor/github.com/miekg/dns/doc.go +++ /dev/null @@ -1,251 +0,0 @@ -/* -Package dns implements a full featured interface to the Domain Name System. -Server- and client-side programming is supported. -The package allows complete control over what is send out to the DNS. The package -API follows the less-is-more principle, by presenting a small, clean interface. - -The package dns supports (asynchronous) querying/replying, incoming/outgoing zone transfers, -TSIG, EDNS0, dynamic updates, notifies and DNSSEC validation/signing. -Note that domain names MUST be fully qualified, before sending them, unqualified -names in a message will result in a packing failure. - -Resource records are native types. They are not stored in wire format. -Basic usage pattern for creating a new resource record: - - r := new(dns.MX) - r.Hdr = dns.RR_Header{Name: "miek.nl.", Rrtype: dns.TypeMX, - Class: dns.ClassINET, Ttl: 3600} - r.Preference = 10 - r.Mx = "mx.miek.nl." - -Or directly from a string: - - mx, err := dns.NewRR("miek.nl. 3600 IN MX 10 mx.miek.nl.") - -Or when the default TTL (3600) and class (IN) suit you: - - mx, err := dns.NewRR("miek.nl. MX 10 mx.miek.nl.") - -Or even: - - mx, err := dns.NewRR("$ORIGIN nl.\nmiek 1H IN MX 10 mx.miek") - -In the DNS messages are exchanged, these messages contain resource -records (sets). Use pattern for creating a message: - - m := new(dns.Msg) - m.SetQuestion("miek.nl.", dns.TypeMX) - -Or when not certain if the domain name is fully qualified: - - m.SetQuestion(dns.Fqdn("miek.nl"), dns.TypeMX) - -The message m is now a message with the question section set to ask -the MX records for the miek.nl. zone. - -The following is slightly more verbose, but more flexible: - - m1 := new(dns.Msg) - m1.Id = dns.Id() - m1.RecursionDesired = true - m1.Question = make([]dns.Question, 1) - m1.Question[0] = dns.Question{"miek.nl.", dns.TypeMX, dns.ClassINET} - -After creating a message it can be send. -Basic use pattern for synchronous querying the DNS at a -server configured on 127.0.0.1 and port 53: - - c := new(dns.Client) - in, rtt, err := c.Exchange(m1, "127.0.0.1:53") - -Suppressing multiple outstanding queries (with the same question, type and -class) is as easy as setting: - - c.SingleInflight = true - -If these "advanced" features are not needed, a simple UDP query can be send, -with: - - in, err := dns.Exchange(m1, "127.0.0.1:53") - -When this functions returns you will get dns message. A dns message consists -out of four sections. -The question section: in.Question, the answer section: in.Answer, -the authority section: in.Ns and the additional section: in.Extra. - -Each of these sections (except the Question section) contain a []RR. Basic -use pattern for accessing the rdata of a TXT RR as the first RR in -the Answer section: - - if t, ok := in.Answer[0].(*dns.TXT); ok { - // do something with t.Txt - } - -Domain Name and TXT Character String Representations - -Both domain names and TXT character strings are converted to presentation -form both when unpacked and when converted to strings. - -For TXT character strings, tabs, carriage returns and line feeds will be -converted to \t, \r and \n respectively. Back slashes and quotations marks -will be escaped. Bytes below 32 and above 127 will be converted to \DDD -form. - -For domain names, in addition to the above rules brackets, periods, -spaces, semicolons and the at symbol are escaped. - -DNSSEC - -DNSSEC (DNS Security Extension) adds a layer of security to the DNS. It -uses public key cryptography to sign resource records. The -public keys are stored in DNSKEY records and the signatures in RRSIG records. - -Requesting DNSSEC information for a zone is done by adding the DO (DNSSEC OK) bit -to a request. - - m := new(dns.Msg) - m.SetEdns0(4096, true) - -Signature generation, signature verification and key generation are all supported. - -DYNAMIC UPDATES - -Dynamic updates reuses the DNS message format, but renames three of -the sections. Question is Zone, Answer is Prerequisite, Authority is -Update, only the Additional is not renamed. See RFC 2136 for the gory details. - -You can set a rather complex set of rules for the existence of absence of -certain resource records or names in a zone to specify if resource records -should be added or removed. The table from RFC 2136 supplemented with the Go -DNS function shows which functions exist to specify the prerequisites. - - 3.2.4 - Table Of Metavalues Used In Prerequisite Section - - CLASS TYPE RDATA Meaning Function - -------------------------------------------------------------- - ANY ANY empty Name is in use dns.NameUsed - ANY rrset empty RRset exists (value indep) dns.RRsetUsed - NONE ANY empty Name is not in use dns.NameNotUsed - NONE rrset empty RRset does not exist dns.RRsetNotUsed - zone rrset rr RRset exists (value dep) dns.Used - -The prerequisite section can also be left empty. -If you have decided on the prerequisites you can tell what RRs should -be added or deleted. The next table shows the options you have and -what functions to call. - - 3.4.2.6 - Table Of Metavalues Used In Update Section - - CLASS TYPE RDATA Meaning Function - --------------------------------------------------------------- - ANY ANY empty Delete all RRsets from name dns.RemoveName - ANY rrset empty Delete an RRset dns.RemoveRRset - NONE rrset rr Delete an RR from RRset dns.Remove - zone rrset rr Add to an RRset dns.Insert - -TRANSACTION SIGNATURE - -An TSIG or transaction signature adds a HMAC TSIG record to each message sent. -The supported algorithms include: HmacMD5, HmacSHA1, HmacSHA256 and HmacSHA512. - -Basic use pattern when querying with a TSIG name "axfr." (note that these key names -must be fully qualified - as they are domain names) and the base64 secret -"so6ZGir4GPAqINNh9U5c3A==": - - c := new(dns.Client) - c.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} - m := new(dns.Msg) - m.SetQuestion("miek.nl.", dns.TypeMX) - m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) - ... - // When sending the TSIG RR is calculated and filled in before sending - -When requesting an zone transfer (almost all TSIG usage is when requesting zone transfers), with -TSIG, this is the basic use pattern. In this example we request an AXFR for -miek.nl. with TSIG key named "axfr." and secret "so6ZGir4GPAqINNh9U5c3A==" -and using the server 176.58.119.54: - - t := new(dns.Transfer) - m := new(dns.Msg) - t.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} - m.SetAxfr("miek.nl.") - m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) - c, err := t.In(m, "176.58.119.54:53") - for r := range c { ... } - -You can now read the records from the transfer as they come in. Each envelope is checked with TSIG. -If something is not correct an error is returned. - -Basic use pattern validating and replying to a message that has TSIG set. - - server := &dns.Server{Addr: ":53", Net: "udp"} - server.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} - go server.ListenAndServe() - dns.HandleFunc(".", handleRequest) - - func handleRequest(w dns.ResponseWriter, r *dns.Msg) { - m := new(dns.Msg) - m.SetReply(r) - if r.IsTsig() != nil { - if w.TsigStatus() == nil { - // *Msg r has an TSIG record and it was validated - m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) - } else { - // *Msg r has an TSIG records and it was not valided - } - } - w.WriteMsg(m) - } - -PRIVATE RRS - -RFC 6895 sets aside a range of type codes for private use. This range -is 65,280 - 65,534 (0xFF00 - 0xFFFE). When experimenting with new Resource Records these -can be used, before requesting an official type code from IANA. - -see http://miek.nl/2014/September/21/idn-and-private-rr-in-go-dns/ for more -information. - -EDNS0 - -EDNS0 is an extension mechanism for the DNS defined in RFC 2671 and updated -by RFC 6891. It defines an new RR type, the OPT RR, which is then completely -abused. -Basic use pattern for creating an (empty) OPT RR: - - o := new(dns.OPT) - o.Hdr.Name = "." // MUST be the root zone, per definition. - o.Hdr.Rrtype = dns.TypeOPT - -The rdata of an OPT RR consists out of a slice of EDNS0 (RFC 6891) -interfaces. Currently only a few have been standardized: EDNS0_NSID -(RFC 5001) and EDNS0_SUBNET (draft-vandergaast-edns-client-subnet-02). Note -that these options may be combined in an OPT RR. -Basic use pattern for a server to check if (and which) options are set: - - // o is a dns.OPT - for _, s := range o.Option { - switch e := s.(type) { - case *dns.EDNS0_NSID: - // do stuff with e.Nsid - case *dns.EDNS0_SUBNET: - // access e.Family, e.Address, etc. - } - } - -SIG(0) - -From RFC 2931: - - SIG(0) provides protection for DNS transactions and requests .... - ... protection for glue records, DNS requests, protection for message headers - on requests and responses, and protection of the overall integrity of a response. - -It works like TSIG, except that SIG(0) uses public key cryptography, instead of the shared -secret approach in TSIG. -Supported algorithms: DSA, ECDSAP256SHA256, ECDSAP384SHA384, RSASHA1, RSASHA256 and -RSASHA512. - -Signing subsequent messages in multi-message sessions is not implemented. -*/ -package dns diff --git a/vendor/github.com/miekg/dns/edns.go b/vendor/github.com/miekg/dns/edns.go deleted file mode 100644 index fc0b469..0000000 --- a/vendor/github.com/miekg/dns/edns.go +++ /dev/null @@ -1,597 +0,0 @@ -package dns - -import ( - "encoding/binary" - "encoding/hex" - "errors" - "fmt" - "net" - "strconv" -) - -// EDNS0 Option codes. -const ( - EDNS0LLQ = 0x1 // long lived queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01 - EDNS0UL = 0x2 // update lease draft: http://files.dns-sd.org/draft-sekar-dns-ul.txt - EDNS0NSID = 0x3 // nsid (RFC5001) - EDNS0DAU = 0x5 // DNSSEC Algorithm Understood - EDNS0DHU = 0x6 // DS Hash Understood - EDNS0N3U = 0x7 // NSEC3 Hash Understood - EDNS0SUBNET = 0x8 // client-subnet (RFC6891) - EDNS0EXPIRE = 0x9 // EDNS0 expire - EDNS0COOKIE = 0xa // EDNS0 Cookie - EDNS0TCPKEEPALIVE = 0xb // EDNS0 tcp keep alive (RFC7828) - EDNS0SUBNETDRAFT = 0x50fa // Don't use! Use EDNS0SUBNET - EDNS0LOCALSTART = 0xFDE9 // Beginning of range reserved for local/experimental use (RFC6891) - EDNS0LOCALEND = 0xFFFE // End of range reserved for local/experimental use (RFC6891) - _DO = 1 << 15 // dnssec ok -) - -// OPT is the EDNS0 RR appended to messages to convey extra (meta) information. -// See RFC 6891. -type OPT struct { - Hdr RR_Header - Option []EDNS0 `dns:"opt"` -} - -func (rr *OPT) String() string { - s := "\n;; OPT PSEUDOSECTION:\n; EDNS: version " + strconv.Itoa(int(rr.Version())) + "; " - if rr.Do() { - s += "flags: do; " - } else { - s += "flags: ; " - } - s += "udp: " + strconv.Itoa(int(rr.UDPSize())) - - for _, o := range rr.Option { - switch o.(type) { - case *EDNS0_NSID: - s += "\n; NSID: " + o.String() - h, e := o.pack() - var r string - if e == nil { - for _, c := range h { - r += "(" + string(c) + ")" - } - s += " " + r - } - case *EDNS0_SUBNET: - s += "\n; SUBNET: " + o.String() - if o.(*EDNS0_SUBNET).DraftOption { - s += " (draft)" - } - case *EDNS0_COOKIE: - s += "\n; COOKIE: " + o.String() - case *EDNS0_UL: - s += "\n; UPDATE LEASE: " + o.String() - case *EDNS0_LLQ: - s += "\n; LONG LIVED QUERIES: " + o.String() - case *EDNS0_DAU: - s += "\n; DNSSEC ALGORITHM UNDERSTOOD: " + o.String() - case *EDNS0_DHU: - s += "\n; DS HASH UNDERSTOOD: " + o.String() - case *EDNS0_N3U: - s += "\n; NSEC3 HASH UNDERSTOOD: " + o.String() - case *EDNS0_LOCAL: - s += "\n; LOCAL OPT: " + o.String() - } - } - return s -} - -func (rr *OPT) len() int { - l := rr.Hdr.len() - for i := 0; i < len(rr.Option); i++ { - l += 4 // Account for 2-byte option code and 2-byte option length. - lo, _ := rr.Option[i].pack() - l += len(lo) - } - return l -} - -// return the old value -> delete SetVersion? - -// Version returns the EDNS version used. Only zero is defined. -func (rr *OPT) Version() uint8 { - return uint8((rr.Hdr.Ttl & 0x00FF0000) >> 16) -} - -// SetVersion sets the version of EDNS. This is usually zero. -func (rr *OPT) SetVersion(v uint8) { - rr.Hdr.Ttl = rr.Hdr.Ttl&0xFF00FFFF | (uint32(v) << 16) -} - -// ExtendedRcode returns the EDNS extended RCODE field (the upper 8 bits of the TTL). -func (rr *OPT) ExtendedRcode() int { - return int((rr.Hdr.Ttl&0xFF000000)>>24) + 15 -} - -// SetExtendedRcode sets the EDNS extended RCODE field. -func (rr *OPT) SetExtendedRcode(v uint8) { - if v < RcodeBadVers { // Smaller than 16.. Use the 4 bits you have! - return - } - rr.Hdr.Ttl = rr.Hdr.Ttl&0x00FFFFFF | (uint32(v-15) << 24) -} - -// UDPSize returns the UDP buffer size. -func (rr *OPT) UDPSize() uint16 { - return rr.Hdr.Class -} - -// SetUDPSize sets the UDP buffer size. -func (rr *OPT) SetUDPSize(size uint16) { - rr.Hdr.Class = size -} - -// Do returns the value of the DO (DNSSEC OK) bit. -func (rr *OPT) Do() bool { - return rr.Hdr.Ttl&_DO == _DO -} - -// SetDo sets the DO (DNSSEC OK) bit. -// If we pass an argument, set the DO bit to that value. -// It is possible to pass 2 or more arguments. Any arguments after the 1st is silently ignored. -func (rr *OPT) SetDo(do ...bool) { - if len(do) == 1 { - if do[0] { - rr.Hdr.Ttl |= _DO - } else { - rr.Hdr.Ttl &^= _DO - } - } else { - rr.Hdr.Ttl |= _DO - } -} - -// EDNS0 defines an EDNS0 Option. An OPT RR can have multiple options appended to it. -type EDNS0 interface { - // Option returns the option code for the option. - Option() uint16 - // pack returns the bytes of the option data. - pack() ([]byte, error) - // unpack sets the data as found in the buffer. Is also sets - // the length of the slice as the length of the option data. - unpack([]byte) error - // String returns the string representation of the option. - String() string -} - -// The nsid EDNS0 option is used to retrieve a nameserver -// identifier. When sending a request Nsid must be set to the empty string -// The identifier is an opaque string encoded as hex. -// Basic use pattern for creating an nsid option: -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_NSID) -// e.Code = dns.EDNS0NSID -// e.Nsid = "AA" -// o.Option = append(o.Option, e) -type EDNS0_NSID struct { - Code uint16 // Always EDNS0NSID - Nsid string // This string needs to be hex encoded -} - -func (e *EDNS0_NSID) pack() ([]byte, error) { - h, err := hex.DecodeString(e.Nsid) - if err != nil { - return nil, err - } - return h, nil -} - -func (e *EDNS0_NSID) Option() uint16 { return EDNS0NSID } -func (e *EDNS0_NSID) unpack(b []byte) error { e.Nsid = hex.EncodeToString(b); return nil } -func (e *EDNS0_NSID) String() string { return string(e.Nsid) } - -// EDNS0_SUBNET is the subnet option that is used to give the remote nameserver -// an idea of where the client lives. It can then give back a different -// answer depending on the location or network topology. -// Basic use pattern for creating an subnet option: -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_SUBNET) -// e.Code = dns.EDNS0SUBNET -// e.Family = 1 // 1 for IPv4 source address, 2 for IPv6 -// e.NetMask = 32 // 32 for IPV4, 128 for IPv6 -// e.SourceScope = 0 -// e.Address = net.ParseIP("127.0.0.1").To4() // for IPv4 -// // e.Address = net.ParseIP("2001:7b8:32a::2") // for IPV6 -// o.Option = append(o.Option, e) -// -// Note: the spec (draft-ietf-dnsop-edns-client-subnet-00) has some insane logic -// for which netmask applies to the address. This code will parse all the -// available bits when unpacking (up to optlen). When packing it will apply -// SourceNetmask. If you need more advanced logic, patches welcome and good luck. -type EDNS0_SUBNET struct { - Code uint16 // Always EDNS0SUBNET - Family uint16 // 1 for IP, 2 for IP6 - SourceNetmask uint8 - SourceScope uint8 - Address net.IP - DraftOption bool // Set to true if using the old (0x50fa) option code -} - -func (e *EDNS0_SUBNET) Option() uint16 { - if e.DraftOption { - return EDNS0SUBNETDRAFT - } - return EDNS0SUBNET -} - -func (e *EDNS0_SUBNET) pack() ([]byte, error) { - b := make([]byte, 4) - binary.BigEndian.PutUint16(b[0:], e.Family) - b[2] = e.SourceNetmask - b[3] = e.SourceScope - switch e.Family { - case 1: - if e.SourceNetmask > net.IPv4len*8 { - return nil, errors.New("dns: bad netmask") - } - if len(e.Address.To4()) != net.IPv4len { - return nil, errors.New("dns: bad address") - } - ip := e.Address.To4().Mask(net.CIDRMask(int(e.SourceNetmask), net.IPv4len*8)) - needLength := (e.SourceNetmask + 8 - 1) / 8 // division rounding up - b = append(b, ip[:needLength]...) - case 2: - if e.SourceNetmask > net.IPv6len*8 { - return nil, errors.New("dns: bad netmask") - } - if len(e.Address) != net.IPv6len { - return nil, errors.New("dns: bad address") - } - ip := e.Address.Mask(net.CIDRMask(int(e.SourceNetmask), net.IPv6len*8)) - needLength := (e.SourceNetmask + 8 - 1) / 8 // division rounding up - b = append(b, ip[:needLength]...) - default: - return nil, errors.New("dns: bad address family") - } - return b, nil -} - -func (e *EDNS0_SUBNET) unpack(b []byte) error { - if len(b) < 4 { - return ErrBuf - } - e.Family = binary.BigEndian.Uint16(b) - e.SourceNetmask = b[2] - e.SourceScope = b[3] - switch e.Family { - case 1: - if e.SourceNetmask > net.IPv4len*8 || e.SourceScope > net.IPv4len*8 { - return errors.New("dns: bad netmask") - } - addr := make([]byte, net.IPv4len) - for i := 0; i < net.IPv4len && 4+i < len(b); i++ { - addr[i] = b[4+i] - } - e.Address = net.IPv4(addr[0], addr[1], addr[2], addr[3]) - case 2: - if e.SourceNetmask > net.IPv6len*8 || e.SourceScope > net.IPv6len*8 { - return errors.New("dns: bad netmask") - } - addr := make([]byte, net.IPv6len) - for i := 0; i < net.IPv6len && 4+i < len(b); i++ { - addr[i] = b[4+i] - } - e.Address = net.IP{addr[0], addr[1], addr[2], addr[3], addr[4], - addr[5], addr[6], addr[7], addr[8], addr[9], addr[10], - addr[11], addr[12], addr[13], addr[14], addr[15]} - default: - return errors.New("dns: bad address family") - } - return nil -} - -func (e *EDNS0_SUBNET) String() (s string) { - if e.Address == nil { - s = "" - } else if e.Address.To4() != nil { - s = e.Address.String() - } else { - s = "[" + e.Address.String() + "]" - } - s += "/" + strconv.Itoa(int(e.SourceNetmask)) + "/" + strconv.Itoa(int(e.SourceScope)) - return -} - -// The Cookie EDNS0 option -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_COOKIE) -// e.Code = dns.EDNS0COOKIE -// e.Cookie = "24a5ac.." -// o.Option = append(o.Option, e) -// -// The Cookie field consists out of a client cookie (RFC 7873 Section 4), that is -// always 8 bytes. It may then optionally be followed by the server cookie. The server -// cookie is of variable length, 8 to a maximum of 32 bytes. In other words: -// -// cCookie := o.Cookie[:16] -// sCookie := o.Cookie[16:] -// -// There is no guarantee that the Cookie string has a specific length. -type EDNS0_COOKIE struct { - Code uint16 // Always EDNS0COOKIE - Cookie string // Hex-encoded cookie data -} - -func (e *EDNS0_COOKIE) pack() ([]byte, error) { - h, err := hex.DecodeString(e.Cookie) - if err != nil { - return nil, err - } - return h, nil -} - -func (e *EDNS0_COOKIE) Option() uint16 { return EDNS0COOKIE } -func (e *EDNS0_COOKIE) unpack(b []byte) error { e.Cookie = hex.EncodeToString(b); return nil } -func (e *EDNS0_COOKIE) String() string { return e.Cookie } - -// The EDNS0_UL (Update Lease) (draft RFC) option is used to tell the server to set -// an expiration on an update RR. This is helpful for clients that cannot clean -// up after themselves. This is a draft RFC and more information can be found at -// http://files.dns-sd.org/draft-sekar-dns-ul.txt -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_UL) -// e.Code = dns.EDNS0UL -// e.Lease = 120 // in seconds -// o.Option = append(o.Option, e) -type EDNS0_UL struct { - Code uint16 // Always EDNS0UL - Lease uint32 -} - -func (e *EDNS0_UL) Option() uint16 { return EDNS0UL } -func (e *EDNS0_UL) String() string { return strconv.FormatUint(uint64(e.Lease), 10) } - -// Copied: http://golang.org/src/pkg/net/dnsmsg.go -func (e *EDNS0_UL) pack() ([]byte, error) { - b := make([]byte, 4) - binary.BigEndian.PutUint32(b, e.Lease) - return b, nil -} - -func (e *EDNS0_UL) unpack(b []byte) error { - if len(b) < 4 { - return ErrBuf - } - e.Lease = binary.BigEndian.Uint32(b) - return nil -} - -// EDNS0_LLQ stands for Long Lived Queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01 -// Implemented for completeness, as the EDNS0 type code is assigned. -type EDNS0_LLQ struct { - Code uint16 // Always EDNS0LLQ - Version uint16 - Opcode uint16 - Error uint16 - Id uint64 - LeaseLife uint32 -} - -func (e *EDNS0_LLQ) Option() uint16 { return EDNS0LLQ } - -func (e *EDNS0_LLQ) pack() ([]byte, error) { - b := make([]byte, 18) - binary.BigEndian.PutUint16(b[0:], e.Version) - binary.BigEndian.PutUint16(b[2:], e.Opcode) - binary.BigEndian.PutUint16(b[4:], e.Error) - binary.BigEndian.PutUint64(b[6:], e.Id) - binary.BigEndian.PutUint32(b[14:], e.LeaseLife) - return b, nil -} - -func (e *EDNS0_LLQ) unpack(b []byte) error { - if len(b) < 18 { - return ErrBuf - } - e.Version = binary.BigEndian.Uint16(b[0:]) - e.Opcode = binary.BigEndian.Uint16(b[2:]) - e.Error = binary.BigEndian.Uint16(b[4:]) - e.Id = binary.BigEndian.Uint64(b[6:]) - e.LeaseLife = binary.BigEndian.Uint32(b[14:]) - return nil -} - -func (e *EDNS0_LLQ) String() string { - s := strconv.FormatUint(uint64(e.Version), 10) + " " + strconv.FormatUint(uint64(e.Opcode), 10) + - " " + strconv.FormatUint(uint64(e.Error), 10) + " " + strconv.FormatUint(uint64(e.Id), 10) + - " " + strconv.FormatUint(uint64(e.LeaseLife), 10) - return s -} - -type EDNS0_DAU struct { - Code uint16 // Always EDNS0DAU - AlgCode []uint8 -} - -func (e *EDNS0_DAU) Option() uint16 { return EDNS0DAU } -func (e *EDNS0_DAU) pack() ([]byte, error) { return e.AlgCode, nil } -func (e *EDNS0_DAU) unpack(b []byte) error { e.AlgCode = b; return nil } - -func (e *EDNS0_DAU) String() string { - s := "" - for i := 0; i < len(e.AlgCode); i++ { - if a, ok := AlgorithmToString[e.AlgCode[i]]; ok { - s += " " + a - } else { - s += " " + strconv.Itoa(int(e.AlgCode[i])) - } - } - return s -} - -type EDNS0_DHU struct { - Code uint16 // Always EDNS0DHU - AlgCode []uint8 -} - -func (e *EDNS0_DHU) Option() uint16 { return EDNS0DHU } -func (e *EDNS0_DHU) pack() ([]byte, error) { return e.AlgCode, nil } -func (e *EDNS0_DHU) unpack(b []byte) error { e.AlgCode = b; return nil } - -func (e *EDNS0_DHU) String() string { - s := "" - for i := 0; i < len(e.AlgCode); i++ { - if a, ok := HashToString[e.AlgCode[i]]; ok { - s += " " + a - } else { - s += " " + strconv.Itoa(int(e.AlgCode[i])) - } - } - return s -} - -type EDNS0_N3U struct { - Code uint16 // Always EDNS0N3U - AlgCode []uint8 -} - -func (e *EDNS0_N3U) Option() uint16 { return EDNS0N3U } -func (e *EDNS0_N3U) pack() ([]byte, error) { return e.AlgCode, nil } -func (e *EDNS0_N3U) unpack(b []byte) error { e.AlgCode = b; return nil } - -func (e *EDNS0_N3U) String() string { - // Re-use the hash map - s := "" - for i := 0; i < len(e.AlgCode); i++ { - if a, ok := HashToString[e.AlgCode[i]]; ok { - s += " " + a - } else { - s += " " + strconv.Itoa(int(e.AlgCode[i])) - } - } - return s -} - -type EDNS0_EXPIRE struct { - Code uint16 // Always EDNS0EXPIRE - Expire uint32 -} - -func (e *EDNS0_EXPIRE) Option() uint16 { return EDNS0EXPIRE } -func (e *EDNS0_EXPIRE) String() string { return strconv.FormatUint(uint64(e.Expire), 10) } - -func (e *EDNS0_EXPIRE) pack() ([]byte, error) { - b := make([]byte, 4) - b[0] = byte(e.Expire >> 24) - b[1] = byte(e.Expire >> 16) - b[2] = byte(e.Expire >> 8) - b[3] = byte(e.Expire) - return b, nil -} - -func (e *EDNS0_EXPIRE) unpack(b []byte) error { - if len(b) < 4 { - return ErrBuf - } - e.Expire = binary.BigEndian.Uint32(b) - return nil -} - -// The EDNS0_LOCAL option is used for local/experimental purposes. The option -// code is recommended to be within the range [EDNS0LOCALSTART, EDNS0LOCALEND] -// (RFC6891), although any unassigned code can actually be used. The content of -// the option is made available in Data, unaltered. -// Basic use pattern for creating a local option: -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_LOCAL) -// e.Code = dns.EDNS0LOCALSTART -// e.Data = []byte{72, 82, 74} -// o.Option = append(o.Option, e) -type EDNS0_LOCAL struct { - Code uint16 - Data []byte -} - -func (e *EDNS0_LOCAL) Option() uint16 { return e.Code } -func (e *EDNS0_LOCAL) String() string { - return strconv.FormatInt(int64(e.Code), 10) + ":0x" + hex.EncodeToString(e.Data) -} - -func (e *EDNS0_LOCAL) pack() ([]byte, error) { - b := make([]byte, len(e.Data)) - copied := copy(b, e.Data) - if copied != len(e.Data) { - return nil, ErrBuf - } - return b, nil -} - -func (e *EDNS0_LOCAL) unpack(b []byte) error { - e.Data = make([]byte, len(b)) - copied := copy(e.Data, b) - if copied != len(b) { - return ErrBuf - } - return nil -} - -type EDNS0_TCP_KEEPALIVE struct { - Code uint16 // Always EDNSTCPKEEPALIVE - Length uint16 // the value 0 if the TIMEOUT is omitted, the value 2 if it is present; - Timeout uint16 // an idle timeout value for the TCP connection, specified in units of 100 milliseconds, encoded in network byte order. -} - -func (e *EDNS0_TCP_KEEPALIVE) Option() uint16 { - return EDNS0TCPKEEPALIVE -} - -func (e *EDNS0_TCP_KEEPALIVE) pack() ([]byte, error) { - if e.Timeout != 0 && e.Length != 2 { - return nil, errors.New("dns: timeout specified but length is not 2") - } - if e.Timeout == 0 && e.Length != 0 { - return nil, errors.New("dns: timeout not specified but length is not 0") - } - b := make([]byte, 4+e.Length) - binary.BigEndian.PutUint16(b[0:], e.Code) - binary.BigEndian.PutUint16(b[2:], e.Length) - if e.Length == 2 { - binary.BigEndian.PutUint16(b[4:], e.Timeout) - } - return b, nil -} - -func (e *EDNS0_TCP_KEEPALIVE) unpack(b []byte) error { - if len(b) < 4 { - return ErrBuf - } - e.Length = binary.BigEndian.Uint16(b[2:4]) - if e.Length != 0 && e.Length != 2 { - return errors.New("dns: length mismatch, want 0/2 but got " + strconv.FormatUint(uint64(e.Length), 10)) - } - if e.Length == 2 { - if len(b) < 6 { - return ErrBuf - } - e.Timeout = binary.BigEndian.Uint16(b[4:6]) - } - return nil -} - -func (e *EDNS0_TCP_KEEPALIVE) String() (s string) { - s = "use tcp keep-alive" - if e.Length == 0 { - s += ", timeout omitted" - } else { - s += fmt.Sprintf(", timeout %dms", e.Timeout*100) - } - return -} diff --git a/vendor/github.com/miekg/dns/format.go b/vendor/github.com/miekg/dns/format.go deleted file mode 100644 index 3f5303c..0000000 --- a/vendor/github.com/miekg/dns/format.go +++ /dev/null @@ -1,87 +0,0 @@ -package dns - -import ( - "net" - "reflect" - "strconv" -) - -// NumField returns the number of rdata fields r has. -func NumField(r RR) int { - return reflect.ValueOf(r).Elem().NumField() - 1 // Remove RR_Header -} - -// Field returns the rdata field i as a string. Fields are indexed starting from 1. -// RR types that holds slice data, for instance the NSEC type bitmap will return a single -// string where the types are concatenated using a space. -// Accessing non existing fields will cause a panic. -func Field(r RR, i int) string { - if i == 0 { - return "" - } - d := reflect.ValueOf(r).Elem().Field(i) - switch k := d.Kind(); k { - case reflect.String: - return d.String() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return strconv.FormatInt(d.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return strconv.FormatUint(d.Uint(), 10) - case reflect.Slice: - switch reflect.ValueOf(r).Elem().Type().Field(i).Tag { - case `dns:"a"`: - // TODO(miek): Hmm store this as 16 bytes - if d.Len() < net.IPv6len { - return net.IPv4(byte(d.Index(0).Uint()), - byte(d.Index(1).Uint()), - byte(d.Index(2).Uint()), - byte(d.Index(3).Uint())).String() - } - return net.IPv4(byte(d.Index(12).Uint()), - byte(d.Index(13).Uint()), - byte(d.Index(14).Uint()), - byte(d.Index(15).Uint())).String() - case `dns:"aaaa"`: - return net.IP{ - byte(d.Index(0).Uint()), - byte(d.Index(1).Uint()), - byte(d.Index(2).Uint()), - byte(d.Index(3).Uint()), - byte(d.Index(4).Uint()), - byte(d.Index(5).Uint()), - byte(d.Index(6).Uint()), - byte(d.Index(7).Uint()), - byte(d.Index(8).Uint()), - byte(d.Index(9).Uint()), - byte(d.Index(10).Uint()), - byte(d.Index(11).Uint()), - byte(d.Index(12).Uint()), - byte(d.Index(13).Uint()), - byte(d.Index(14).Uint()), - byte(d.Index(15).Uint()), - }.String() - case `dns:"nsec"`: - if d.Len() == 0 { - return "" - } - s := Type(d.Index(0).Uint()).String() - for i := 1; i < d.Len(); i++ { - s += " " + Type(d.Index(i).Uint()).String() - } - return s - default: - // if it does not have a tag its a string slice - fallthrough - case `dns:"txt"`: - if d.Len() == 0 { - return "" - } - s := d.Index(0).String() - for i := 1; i < d.Len(); i++ { - s += " " + d.Index(i).String() - } - return s - } - } - return "" -} diff --git a/vendor/github.com/miekg/dns/generate.go b/vendor/github.com/miekg/dns/generate.go deleted file mode 100644 index e4481a4..0000000 --- a/vendor/github.com/miekg/dns/generate.go +++ /dev/null @@ -1,159 +0,0 @@ -package dns - -import ( - "bytes" - "errors" - "fmt" - "strconv" - "strings" -) - -// Parse the $GENERATE statement as used in BIND9 zones. -// See http://www.zytrax.com/books/dns/ch8/generate.html for instance. -// We are called after '$GENERATE '. After which we expect: -// * the range (12-24/2) -// * lhs (ownername) -// * [[ttl][class]] -// * type -// * rhs (rdata) -// But we are lazy here, only the range is parsed *all* occurrences -// of $ after that are interpreted. -// Any error are returned as a string value, the empty string signals -// "no error". -func generate(l lex, c chan lex, t chan *Token, o string) string { - step := 1 - if i := strings.IndexAny(l.token, "/"); i != -1 { - if i+1 == len(l.token) { - return "bad step in $GENERATE range" - } - if s, err := strconv.Atoi(l.token[i+1:]); err == nil { - if s < 0 { - return "bad step in $GENERATE range" - } - step = s - } else { - return "bad step in $GENERATE range" - } - l.token = l.token[:i] - } - sx := strings.SplitN(l.token, "-", 2) - if len(sx) != 2 { - return "bad start-stop in $GENERATE range" - } - start, err := strconv.Atoi(sx[0]) - if err != nil { - return "bad start in $GENERATE range" - } - end, err := strconv.Atoi(sx[1]) - if err != nil { - return "bad stop in $GENERATE range" - } - if end < 0 || start < 0 || end < start { - return "bad range in $GENERATE range" - } - - <-c // _BLANK - // Create a complete new string, which we then parse again. - s := "" -BuildRR: - l = <-c - if l.value != zNewline && l.value != zEOF { - s += l.token - goto BuildRR - } - for i := start; i <= end; i += step { - var ( - escape bool - dom bytes.Buffer - mod string - err error - offset int - ) - - for j := 0; j < len(s); j++ { // No 'range' because we need to jump around - switch s[j] { - case '\\': - if escape { - dom.WriteByte('\\') - escape = false - continue - } - escape = true - case '$': - mod = "%d" - offset = 0 - if escape { - dom.WriteByte('$') - escape = false - continue - } - escape = false - if j+1 >= len(s) { // End of the string - dom.WriteString(fmt.Sprintf(mod, i+offset)) - continue - } else { - if s[j+1] == '$' { - dom.WriteByte('$') - j++ - continue - } - } - // Search for { and } - if s[j+1] == '{' { // Modifier block - sep := strings.Index(s[j+2:], "}") - if sep == -1 { - return "bad modifier in $GENERATE" - } - mod, offset, err = modToPrintf(s[j+2 : j+2+sep]) - if err != nil { - return err.Error() - } - j += 2 + sep // Jump to it - } - dom.WriteString(fmt.Sprintf(mod, i+offset)) - default: - if escape { // Pretty useless here - escape = false - continue - } - dom.WriteByte(s[j]) - } - } - // Re-parse the RR and send it on the current channel t - rx, err := NewRR("$ORIGIN " + o + "\n" + dom.String()) - if err != nil { - return err.Error() - } - t <- &Token{RR: rx} - // Its more efficient to first built the rrlist and then parse it in - // one go! But is this a problem? - } - return "" -} - -// Convert a $GENERATE modifier 0,0,d to something Printf can deal with. -func modToPrintf(s string) (string, int, error) { - xs := strings.SplitN(s, ",", 3) - if len(xs) != 3 { - return "", 0, errors.New("bad modifier in $GENERATE") - } - // xs[0] is offset, xs[1] is width, xs[2] is base - if xs[2] != "o" && xs[2] != "d" && xs[2] != "x" && xs[2] != "X" { - return "", 0, errors.New("bad base in $GENERATE") - } - offset, err := strconv.Atoi(xs[0]) - if err != nil || offset > 255 { - return "", 0, errors.New("bad offset in $GENERATE") - } - width, err := strconv.Atoi(xs[1]) - if err != nil || width > 255 { - return "", offset, errors.New("bad width in $GENERATE") - } - switch { - case width < 0: - return "", offset, errors.New("bad width in $GENERATE") - case width == 0: - return "%" + xs[1] + xs[2], offset, nil - } - return "%0" + xs[1] + xs[2], offset, nil -} diff --git a/vendor/github.com/miekg/dns/labels.go b/vendor/github.com/miekg/dns/labels.go deleted file mode 100644 index fca5c7d..0000000 --- a/vendor/github.com/miekg/dns/labels.go +++ /dev/null @@ -1,168 +0,0 @@ -package dns - -// Holds a bunch of helper functions for dealing with labels. - -// SplitDomainName splits a name string into it's labels. -// www.miek.nl. returns []string{"www", "miek", "nl"} -// .www.miek.nl. returns []string{"", "www", "miek", "nl"}, -// The root label (.) returns nil. Note that using -// strings.Split(s) will work in most cases, but does not handle -// escaped dots (\.) for instance. -// s must be a syntactically valid domain name, see IsDomainName. -func SplitDomainName(s string) (labels []string) { - if len(s) == 0 { - return nil - } - fqdnEnd := 0 // offset of the final '.' or the length of the name - idx := Split(s) - begin := 0 - if s[len(s)-1] == '.' { - fqdnEnd = len(s) - 1 - } else { - fqdnEnd = len(s) - } - - switch len(idx) { - case 0: - return nil - case 1: - // no-op - default: - end := 0 - for i := 1; i < len(idx); i++ { - end = idx[i] - labels = append(labels, s[begin:end-1]) - begin = end - } - } - - labels = append(labels, s[begin:fqdnEnd]) - return labels -} - -// CompareDomainName compares the names s1 and s2 and -// returns how many labels they have in common starting from the *right*. -// The comparison stops at the first inequality. The names are not downcased -// before the comparison. -// -// www.miek.nl. and miek.nl. have two labels in common: miek and nl -// www.miek.nl. and www.bla.nl. have one label in common: nl -// -// s1 and s2 must be syntactically valid domain names. -func CompareDomainName(s1, s2 string) (n int) { - s1 = Fqdn(s1) - s2 = Fqdn(s2) - l1 := Split(s1) - l2 := Split(s2) - - // the first check: root label - if l1 == nil || l2 == nil { - return - } - - j1 := len(l1) - 1 // end - i1 := len(l1) - 2 // start - j2 := len(l2) - 1 - i2 := len(l2) - 2 - // the second check can be done here: last/only label - // before we fall through into the for-loop below - if s1[l1[j1]:] == s2[l2[j2]:] { - n++ - } else { - return - } - for { - if i1 < 0 || i2 < 0 { - break - } - if s1[l1[i1]:l1[j1]] == s2[l2[i2]:l2[j2]] { - n++ - } else { - break - } - j1-- - i1-- - j2-- - i2-- - } - return -} - -// CountLabel counts the the number of labels in the string s. -// s must be a syntactically valid domain name. -func CountLabel(s string) (labels int) { - if s == "." { - return - } - off := 0 - end := false - for { - off, end = NextLabel(s, off) - labels++ - if end { - return - } - } -} - -// Split splits a name s into its label indexes. -// www.miek.nl. returns []int{0, 4, 9}, www.miek.nl also returns []int{0, 4, 9}. -// The root name (.) returns nil. Also see SplitDomainName. -// s must be a syntactically valid domain name. -func Split(s string) []int { - if s == "." { - return nil - } - idx := make([]int, 1, 3) - off := 0 - end := false - - for { - off, end = NextLabel(s, off) - if end { - return idx - } - idx = append(idx, off) - } -} - -// NextLabel returns the index of the start of the next label in the -// string s starting at offset. -// The bool end is true when the end of the string has been reached. -// Also see PrevLabel. -func NextLabel(s string, offset int) (i int, end bool) { - quote := false - for i = offset; i < len(s)-1; i++ { - switch s[i] { - case '\\': - quote = !quote - default: - quote = false - case '.': - if quote { - quote = !quote - continue - } - return i + 1, false - } - } - return i + 1, true -} - -// PrevLabel returns the index of the label when starting from the right and -// jumping n labels to the left. -// The bool start is true when the start of the string has been overshot. -// Also see NextLabel. -func PrevLabel(s string, n int) (i int, start bool) { - if n == 0 { - return len(s), false - } - lab := Split(s) - if lab == nil { - return 0, true - } - if n > len(lab) { - return 0, true - } - return lab[len(lab)-n], false -} diff --git a/vendor/github.com/miekg/dns/msg.go b/vendor/github.com/miekg/dns/msg.go deleted file mode 100644 index d99c2dd..0000000 --- a/vendor/github.com/miekg/dns/msg.go +++ /dev/null @@ -1,1209 +0,0 @@ -// DNS packet assembly, see RFC 1035. Converting from - Unpack() - -// and to - Pack() - wire format. -// All the packers and unpackers take a (msg []byte, off int) -// and return (off1 int, ok bool). If they return ok==false, they -// also return off1==len(msg), so that the next unpacker will -// also fail. This lets us avoid checks of ok until the end of a -// packing sequence. - -package dns - -//go:generate go run msg_generate.go - -import ( - crand "crypto/rand" - "encoding/binary" - "math/big" - "math/rand" - "strconv" -) - -func init() { - // Initialize default math/rand source using crypto/rand to provide better - // security without the performance trade-off. - buf := make([]byte, 8) - _, err := crand.Read(buf) - if err != nil { - // Failed to read from cryptographic source, fallback to default initial - // seed (1) by returning early - return - } - seed := binary.BigEndian.Uint64(buf) - rand.Seed(int64(seed)) -} - -const maxCompressionOffset = 2 << 13 // We have 14 bits for the compression pointer - -var ( - ErrAlg error = &Error{err: "bad algorithm"} // ErrAlg indicates an error with the (DNSSEC) algorithm. - ErrAuth error = &Error{err: "bad authentication"} // ErrAuth indicates an error in the TSIG authentication. - ErrBuf error = &Error{err: "buffer size too small"} // ErrBuf indicates that the buffer used it too small for the message. - ErrConnEmpty error = &Error{err: "conn has no connection"} // ErrConnEmpty indicates a connection is being uses before it is initialized. - ErrExtendedRcode error = &Error{err: "bad extended rcode"} // ErrExtendedRcode ... - ErrFqdn error = &Error{err: "domain must be fully qualified"} // ErrFqdn indicates that a domain name does not have a closing dot. - ErrId error = &Error{err: "id mismatch"} // ErrId indicates there is a mismatch with the message's ID. - ErrKeyAlg error = &Error{err: "bad key algorithm"} // ErrKeyAlg indicates that the algorithm in the key is not valid. - ErrKey error = &Error{err: "bad key"} - ErrKeySize error = &Error{err: "bad key size"} - ErrNoSig error = &Error{err: "no signature found"} - ErrPrivKey error = &Error{err: "bad private key"} - ErrRcode error = &Error{err: "bad rcode"} - ErrRdata error = &Error{err: "bad rdata"} - ErrRRset error = &Error{err: "bad rrset"} - ErrSecret error = &Error{err: "no secrets defined"} - ErrShortRead error = &Error{err: "short read"} - ErrSig error = &Error{err: "bad signature"} // ErrSig indicates that a signature can not be cryptographically validated. - ErrSoa error = &Error{err: "no SOA"} // ErrSOA indicates that no SOA RR was seen when doing zone transfers. - ErrTime error = &Error{err: "bad time"} // ErrTime indicates a timing error in TSIG authentication. - ErrTruncated error = &Error{err: "failed to unpack truncated message"} // ErrTruncated indicates that we failed to unpack a truncated message. We unpacked as much as we had so Msg can still be used, if desired. -) - -// Id by default, returns a 16 bits random number to be used as a -// message id. The random provided should be good enough. This being a -// variable the function can be reassigned to a custom function. -// For instance, to make it return a static value: -// -// dns.Id = func() uint16 { return 3 } -var Id func() uint16 = id - -// id returns a 16 bits random number to be used as a -// message id. The random provided should be good enough. -func id() uint16 { - id32 := rand.Uint32() - return uint16(id32) -} - -// MsgHdr is a a manually-unpacked version of (id, bits). -type MsgHdr struct { - Id uint16 - Response bool - Opcode int - Authoritative bool - Truncated bool - RecursionDesired bool - RecursionAvailable bool - Zero bool - AuthenticatedData bool - CheckingDisabled bool - Rcode int -} - -// Msg contains the layout of a DNS message. -type Msg struct { - MsgHdr - Compress bool `json:"-"` // If true, the message will be compressed when converted to wire format. - Question []Question // Holds the RR(s) of the question section. - Answer []RR // Holds the RR(s) of the answer section. - Ns []RR // Holds the RR(s) of the authority section. - Extra []RR // Holds the RR(s) of the additional section. -} - -// ClassToString is a maps Classes to strings for each CLASS wire type. -var ClassToString = map[uint16]string{ - ClassINET: "IN", - ClassCSNET: "CS", - ClassCHAOS: "CH", - ClassHESIOD: "HS", - ClassNONE: "NONE", - ClassANY: "ANY", -} - -// OpcodeToString maps Opcodes to strings. -var OpcodeToString = map[int]string{ - OpcodeQuery: "QUERY", - OpcodeIQuery: "IQUERY", - OpcodeStatus: "STATUS", - OpcodeNotify: "NOTIFY", - OpcodeUpdate: "UPDATE", -} - -// RcodeToString maps Rcodes to strings. -var RcodeToString = map[int]string{ - RcodeSuccess: "NOERROR", - RcodeFormatError: "FORMERR", - RcodeServerFailure: "SERVFAIL", - RcodeNameError: "NXDOMAIN", - RcodeNotImplemented: "NOTIMPL", - RcodeRefused: "REFUSED", - RcodeYXDomain: "YXDOMAIN", // See RFC 2136 - RcodeYXRrset: "YXRRSET", - RcodeNXRrset: "NXRRSET", - RcodeNotAuth: "NOTAUTH", - RcodeNotZone: "NOTZONE", - RcodeBadSig: "BADSIG", // Also known as RcodeBadVers, see RFC 6891 - // RcodeBadVers: "BADVERS", - RcodeBadKey: "BADKEY", - RcodeBadTime: "BADTIME", - RcodeBadMode: "BADMODE", - RcodeBadName: "BADNAME", - RcodeBadAlg: "BADALG", - RcodeBadTrunc: "BADTRUNC", - RcodeBadCookie: "BADCOOKIE", -} - -// Domain names are a sequence of counted strings -// split at the dots. They end with a zero-length string. - -// PackDomainName packs a domain name s into msg[off:]. -// If compression is wanted compress must be true and the compression -// map needs to hold a mapping between domain names and offsets -// pointing into msg. -func PackDomainName(s string, msg []byte, off int, compression map[string]int, compress bool) (off1 int, err error) { - off1, _, err = packDomainName(s, msg, off, compression, compress) - return -} - -func packDomainName(s string, msg []byte, off int, compression map[string]int, compress bool) (off1 int, labels int, err error) { - // special case if msg == nil - lenmsg := 256 - if msg != nil { - lenmsg = len(msg) - } - ls := len(s) - if ls == 0 { // Ok, for instance when dealing with update RR without any rdata. - return off, 0, nil - } - // If not fully qualified, error out, but only if msg == nil #ugly - switch { - case msg == nil: - if s[ls-1] != '.' { - s += "." - ls++ - } - case msg != nil: - if s[ls-1] != '.' { - return lenmsg, 0, ErrFqdn - } - } - // Each dot ends a segment of the name. - // We trade each dot byte for a length byte. - // Except for escaped dots (\.), which are normal dots. - // There is also a trailing zero. - - // Compression - nameoffset := -1 - pointer := -1 - // Emit sequence of counted strings, chopping at dots. - begin := 0 - bs := []byte(s) - roBs, bsFresh, escapedDot := s, true, false - for i := 0; i < ls; i++ { - if bs[i] == '\\' { - for j := i; j < ls-1; j++ { - bs[j] = bs[j+1] - } - ls-- - if off+1 > lenmsg { - return lenmsg, labels, ErrBuf - } - // check for \DDD - if i+2 < ls && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { - bs[i] = dddToByte(bs[i:]) - for j := i + 1; j < ls-2; j++ { - bs[j] = bs[j+2] - } - ls -= 2 - } - escapedDot = bs[i] == '.' - bsFresh = false - continue - } - - if bs[i] == '.' { - if i > 0 && bs[i-1] == '.' && !escapedDot { - // two dots back to back is not legal - return lenmsg, labels, ErrRdata - } - if i-begin >= 1<<6 { // top two bits of length must be clear - return lenmsg, labels, ErrRdata - } - // off can already (we're in a loop) be bigger than len(msg) - // this happens when a name isn't fully qualified - if off+1 > lenmsg { - return lenmsg, labels, ErrBuf - } - if msg != nil { - msg[off] = byte(i - begin) - } - offset := off - off++ - for j := begin; j < i; j++ { - if off+1 > lenmsg { - return lenmsg, labels, ErrBuf - } - if msg != nil { - msg[off] = bs[j] - } - off++ - } - if compress && !bsFresh { - roBs = string(bs) - bsFresh = true - } - // Don't try to compress '.' - if compress && roBs[begin:] != "." { - if p, ok := compression[roBs[begin:]]; !ok { - // Only offsets smaller than this can be used. - if offset < maxCompressionOffset { - compression[roBs[begin:]] = offset - } - } else { - // The first hit is the longest matching dname - // keep the pointer offset we get back and store - // the offset of the current name, because that's - // where we need to insert the pointer later - - // If compress is true, we're allowed to compress this dname - if pointer == -1 && compress { - pointer = p // Where to point to - nameoffset = offset // Where to point from - break - } - } - } - labels++ - begin = i + 1 - } - escapedDot = false - } - // Root label is special - if len(bs) == 1 && bs[0] == '.' { - return off, labels, nil - } - // If we did compression and we find something add the pointer here - if pointer != -1 { - // We have two bytes (14 bits) to put the pointer in - // if msg == nil, we will never do compression - binary.BigEndian.PutUint16(msg[nameoffset:], uint16(pointer^0xC000)) - off = nameoffset + 1 - goto End - } - if msg != nil && off < len(msg) { - msg[off] = 0 - } -End: - off++ - return off, labels, nil -} - -// Unpack a domain name. -// In addition to the simple sequences of counted strings above, -// domain names are allowed to refer to strings elsewhere in the -// packet, to avoid repeating common suffixes when returning -// many entries in a single domain. The pointers are marked -// by a length byte with the top two bits set. Ignoring those -// two bits, that byte and the next give a 14 bit offset from msg[0] -// where we should pick up the trail. -// Note that if we jump elsewhere in the packet, -// we return off1 == the offset after the first pointer we found, -// which is where the next record will start. -// In theory, the pointers are only allowed to jump backward. -// We let them jump anywhere and stop jumping after a while. - -// UnpackDomainName unpacks a domain name into a string. -func UnpackDomainName(msg []byte, off int) (string, int, error) { - s := make([]byte, 0, 64) - off1 := 0 - lenmsg := len(msg) - ptr := 0 // number of pointers followed -Loop: - for { - if off >= lenmsg { - return "", lenmsg, ErrBuf - } - c := int(msg[off]) - off++ - switch c & 0xC0 { - case 0x00: - if c == 0x00 { - // end of name - break Loop - } - // literal string - if off+c > lenmsg { - return "", lenmsg, ErrBuf - } - for j := off; j < off+c; j++ { - switch b := msg[j]; b { - case '.', '(', ')', ';', ' ', '@': - fallthrough - case '"', '\\': - s = append(s, '\\', b) - default: - if b < 32 || b >= 127 { // unprintable use \DDD - var buf [3]byte - bufs := strconv.AppendInt(buf[:0], int64(b), 10) - s = append(s, '\\') - for i := 0; i < 3-len(bufs); i++ { - s = append(s, '0') - } - for _, r := range bufs { - s = append(s, r) - } - } else { - s = append(s, b) - } - } - } - s = append(s, '.') - off += c - case 0xC0: - // pointer to somewhere else in msg. - // remember location after first ptr, - // since that's how many bytes we consumed. - // also, don't follow too many pointers -- - // maybe there's a loop. - if off >= lenmsg { - return "", lenmsg, ErrBuf - } - c1 := msg[off] - off++ - if ptr == 0 { - off1 = off - } - if ptr++; ptr > 10 { - return "", lenmsg, &Error{err: "too many compression pointers"} - } - off = (c^0xC0)<<8 | int(c1) - default: - // 0x80 and 0x40 are reserved - return "", lenmsg, ErrRdata - } - } - if ptr == 0 { - off1 = off - } - if len(s) == 0 { - s = []byte(".") - } - return string(s), off1, nil -} - -func packTxt(txt []string, msg []byte, offset int, tmp []byte) (int, error) { - if len(txt) == 0 { - if offset >= len(msg) { - return offset, ErrBuf - } - msg[offset] = 0 - return offset, nil - } - var err error - for i := range txt { - if len(txt[i]) > len(tmp) { - return offset, ErrBuf - } - offset, err = packTxtString(txt[i], msg, offset, tmp) - if err != nil { - return offset, err - } - } - return offset, nil -} - -func packTxtString(s string, msg []byte, offset int, tmp []byte) (int, error) { - lenByteOffset := offset - if offset >= len(msg) || len(s) > len(tmp) { - return offset, ErrBuf - } - offset++ - bs := tmp[:len(s)] - copy(bs, s) - for i := 0; i < len(bs); i++ { - if len(msg) <= offset { - return offset, ErrBuf - } - if bs[i] == '\\' { - i++ - if i == len(bs) { - break - } - // check for \DDD - if i+2 < len(bs) && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { - msg[offset] = dddToByte(bs[i:]) - i += 2 - } else { - msg[offset] = bs[i] - } - } else { - msg[offset] = bs[i] - } - offset++ - } - l := offset - lenByteOffset - 1 - if l > 255 { - return offset, &Error{err: "string exceeded 255 bytes in txt"} - } - msg[lenByteOffset] = byte(l) - return offset, nil -} - -func packOctetString(s string, msg []byte, offset int, tmp []byte) (int, error) { - if offset >= len(msg) || len(s) > len(tmp) { - return offset, ErrBuf - } - bs := tmp[:len(s)] - copy(bs, s) - for i := 0; i < len(bs); i++ { - if len(msg) <= offset { - return offset, ErrBuf - } - if bs[i] == '\\' { - i++ - if i == len(bs) { - break - } - // check for \DDD - if i+2 < len(bs) && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { - msg[offset] = dddToByte(bs[i:]) - i += 2 - } else { - msg[offset] = bs[i] - } - } else { - msg[offset] = bs[i] - } - offset++ - } - return offset, nil -} - -func unpackTxt(msg []byte, off0 int) (ss []string, off int, err error) { - off = off0 - var s string - for off < len(msg) && err == nil { - s, off, err = unpackTxtString(msg, off) - if err == nil { - ss = append(ss, s) - } - } - return -} - -func unpackTxtString(msg []byte, offset int) (string, int, error) { - if offset+1 > len(msg) { - return "", offset, &Error{err: "overflow unpacking txt"} - } - l := int(msg[offset]) - if offset+l+1 > len(msg) { - return "", offset, &Error{err: "overflow unpacking txt"} - } - s := make([]byte, 0, l) - for _, b := range msg[offset+1 : offset+1+l] { - switch b { - case '"', '\\': - s = append(s, '\\', b) - default: - if b < 32 || b > 127 { // unprintable - var buf [3]byte - bufs := strconv.AppendInt(buf[:0], int64(b), 10) - s = append(s, '\\') - for i := 0; i < 3-len(bufs); i++ { - s = append(s, '0') - } - for _, r := range bufs { - s = append(s, r) - } - } else { - s = append(s, b) - } - } - } - offset += 1 + l - return string(s), offset, nil -} - -// Helpers for dealing with escaped bytes -func isDigit(b byte) bool { return b >= '0' && b <= '9' } - -func dddToByte(s []byte) byte { - return byte((s[0]-'0')*100 + (s[1]-'0')*10 + (s[2] - '0')) -} - -// Helper function for packing and unpacking -func intToBytes(i *big.Int, length int) []byte { - buf := i.Bytes() - if len(buf) < length { - b := make([]byte, length) - copy(b[length-len(buf):], buf) - return b - } - return buf -} - -// PackRR packs a resource record rr into msg[off:]. -// See PackDomainName for documentation about the compression. -func PackRR(rr RR, msg []byte, off int, compression map[string]int, compress bool) (off1 int, err error) { - if rr == nil { - return len(msg), &Error{err: "nil rr"} - } - - off1, err = rr.pack(msg, off, compression, compress) - if err != nil { - return len(msg), err - } - // TODO(miek): Not sure if this is needed? If removed we can remove rawmsg.go as well. - if rawSetRdlength(msg, off, off1) { - return off1, nil - } - return off, ErrRdata -} - -// UnpackRR unpacks msg[off:] into an RR. -func UnpackRR(msg []byte, off int) (rr RR, off1 int, err error) { - h, off, msg, err := unpackHeader(msg, off) - if err != nil { - return nil, len(msg), err - } - end := off + int(h.Rdlength) - - if fn, known := typeToUnpack[h.Rrtype]; !known { - rr, off, err = unpackRFC3597(h, msg, off) - } else { - rr, off, err = fn(h, msg, off) - } - if off != end { - return &h, end, &Error{err: "bad rdlength"} - } - return rr, off, err -} - -// unpackRRslice unpacks msg[off:] into an []RR. -// If we cannot unpack the whole array, then it will return nil -func unpackRRslice(l int, msg []byte, off int) (dst1 []RR, off1 int, err error) { - var r RR - // Optimistically make dst be the length that was sent - dst := make([]RR, 0, l) - for i := 0; i < l; i++ { - off1 := off - r, off, err = UnpackRR(msg, off) - if err != nil { - off = len(msg) - break - } - // If offset does not increase anymore, l is a lie - if off1 == off { - l = i - break - } - dst = append(dst, r) - } - if err != nil && off == len(msg) { - dst = nil - } - return dst, off, err -} - -// Convert a MsgHdr to a string, with dig-like headers: -// -//;; opcode: QUERY, status: NOERROR, id: 48404 -// -//;; flags: qr aa rd ra; -func (h *MsgHdr) String() string { - if h == nil { - return " MsgHdr" - } - - s := ";; opcode: " + OpcodeToString[h.Opcode] - s += ", status: " + RcodeToString[h.Rcode] - s += ", id: " + strconv.Itoa(int(h.Id)) + "\n" - - s += ";; flags:" - if h.Response { - s += " qr" - } - if h.Authoritative { - s += " aa" - } - if h.Truncated { - s += " tc" - } - if h.RecursionDesired { - s += " rd" - } - if h.RecursionAvailable { - s += " ra" - } - if h.Zero { // Hmm - s += " z" - } - if h.AuthenticatedData { - s += " ad" - } - if h.CheckingDisabled { - s += " cd" - } - - s += ";" - return s -} - -// Pack packs a Msg: it is converted to to wire format. -// If the dns.Compress is true the message will be in compressed wire format. -func (dns *Msg) Pack() (msg []byte, err error) { - return dns.PackBuffer(nil) -} - -// PackBuffer packs a Msg, using the given buffer buf. If buf is too small -// a new buffer is allocated. -func (dns *Msg) PackBuffer(buf []byte) (msg []byte, err error) { - // We use a similar function in tsig.go's stripTsig. - var ( - dh Header - compression map[string]int - ) - - if dns.Compress { - compression = make(map[string]int) // Compression pointer mappings - } - - if dns.Rcode < 0 || dns.Rcode > 0xFFF { - return nil, ErrRcode - } - if dns.Rcode > 0xF { - // Regular RCODE field is 4 bits - opt := dns.IsEdns0() - if opt == nil { - return nil, ErrExtendedRcode - } - opt.SetExtendedRcode(uint8(dns.Rcode >> 4)) - dns.Rcode &= 0xF - } - - // Convert convenient Msg into wire-like Header. - dh.Id = dns.Id - dh.Bits = uint16(dns.Opcode)<<11 | uint16(dns.Rcode) - if dns.Response { - dh.Bits |= _QR - } - if dns.Authoritative { - dh.Bits |= _AA - } - if dns.Truncated { - dh.Bits |= _TC - } - if dns.RecursionDesired { - dh.Bits |= _RD - } - if dns.RecursionAvailable { - dh.Bits |= _RA - } - if dns.Zero { - dh.Bits |= _Z - } - if dns.AuthenticatedData { - dh.Bits |= _AD - } - if dns.CheckingDisabled { - dh.Bits |= _CD - } - - // Prepare variable sized arrays. - question := dns.Question - answer := dns.Answer - ns := dns.Ns - extra := dns.Extra - - dh.Qdcount = uint16(len(question)) - dh.Ancount = uint16(len(answer)) - dh.Nscount = uint16(len(ns)) - dh.Arcount = uint16(len(extra)) - - // We need the uncompressed length here, because we first pack it and then compress it. - msg = buf - compress := dns.Compress - dns.Compress = false - if packLen := dns.Len() + 1; len(msg) < packLen { - msg = make([]byte, packLen) - } - dns.Compress = compress - - // Pack it in: header and then the pieces. - off := 0 - off, err = dh.pack(msg, off, compression, dns.Compress) - if err != nil { - return nil, err - } - for i := 0; i < len(question); i++ { - off, err = question[i].pack(msg, off, compression, dns.Compress) - if err != nil { - return nil, err - } - } - for i := 0; i < len(answer); i++ { - off, err = PackRR(answer[i], msg, off, compression, dns.Compress) - if err != nil { - return nil, err - } - } - for i := 0; i < len(ns); i++ { - off, err = PackRR(ns[i], msg, off, compression, dns.Compress) - if err != nil { - return nil, err - } - } - for i := 0; i < len(extra); i++ { - off, err = PackRR(extra[i], msg, off, compression, dns.Compress) - if err != nil { - return nil, err - } - } - return msg[:off], nil -} - -// Unpack unpacks a binary message to a Msg structure. -func (dns *Msg) Unpack(msg []byte) (err error) { - var ( - dh Header - off int - ) - if dh, off, err = unpackMsgHdr(msg, off); err != nil { - return err - } - if off == len(msg) { - return ErrTruncated - } - - dns.Id = dh.Id - dns.Response = (dh.Bits & _QR) != 0 - dns.Opcode = int(dh.Bits>>11) & 0xF - dns.Authoritative = (dh.Bits & _AA) != 0 - dns.Truncated = (dh.Bits & _TC) != 0 - dns.RecursionDesired = (dh.Bits & _RD) != 0 - dns.RecursionAvailable = (dh.Bits & _RA) != 0 - dns.Zero = (dh.Bits & _Z) != 0 - dns.AuthenticatedData = (dh.Bits & _AD) != 0 - dns.CheckingDisabled = (dh.Bits & _CD) != 0 - dns.Rcode = int(dh.Bits & 0xF) - - // Optimistically use the count given to us in the header - dns.Question = make([]Question, 0, int(dh.Qdcount)) - - for i := 0; i < int(dh.Qdcount); i++ { - off1 := off - var q Question - q, off, err = unpackQuestion(msg, off) - if err != nil { - // Even if Truncated is set, we only will set ErrTruncated if we - // actually got the questions - return err - } - if off1 == off { // Offset does not increase anymore, dh.Qdcount is a lie! - dh.Qdcount = uint16(i) - break - } - dns.Question = append(dns.Question, q) - } - - dns.Answer, off, err = unpackRRslice(int(dh.Ancount), msg, off) - // The header counts might have been wrong so we need to update it - dh.Ancount = uint16(len(dns.Answer)) - if err == nil { - dns.Ns, off, err = unpackRRslice(int(dh.Nscount), msg, off) - } - // The header counts might have been wrong so we need to update it - dh.Nscount = uint16(len(dns.Ns)) - if err == nil { - dns.Extra, off, err = unpackRRslice(int(dh.Arcount), msg, off) - } - // The header counts might have been wrong so we need to update it - dh.Arcount = uint16(len(dns.Extra)) - - if off != len(msg) { - // TODO(miek) make this an error? - // use PackOpt to let people tell how detailed the error reporting should be? - // println("dns: extra bytes in dns packet", off, "<", len(msg)) - } else if dns.Truncated { - // Whether we ran into a an error or not, we want to return that it - // was truncated - err = ErrTruncated - } - return err -} - -// Convert a complete message to a string with dig-like output. -func (dns *Msg) String() string { - if dns == nil { - return " MsgHdr" - } - s := dns.MsgHdr.String() + " " - s += "QUERY: " + strconv.Itoa(len(dns.Question)) + ", " - s += "ANSWER: " + strconv.Itoa(len(dns.Answer)) + ", " - s += "AUTHORITY: " + strconv.Itoa(len(dns.Ns)) + ", " - s += "ADDITIONAL: " + strconv.Itoa(len(dns.Extra)) + "\n" - if len(dns.Question) > 0 { - s += "\n;; QUESTION SECTION:\n" - for i := 0; i < len(dns.Question); i++ { - s += dns.Question[i].String() + "\n" - } - } - if len(dns.Answer) > 0 { - s += "\n;; ANSWER SECTION:\n" - for i := 0; i < len(dns.Answer); i++ { - if dns.Answer[i] != nil { - s += dns.Answer[i].String() + "\n" - } - } - } - if len(dns.Ns) > 0 { - s += "\n;; AUTHORITY SECTION:\n" - for i := 0; i < len(dns.Ns); i++ { - if dns.Ns[i] != nil { - s += dns.Ns[i].String() + "\n" - } - } - } - if len(dns.Extra) > 0 { - s += "\n;; ADDITIONAL SECTION:\n" - for i := 0; i < len(dns.Extra); i++ { - if dns.Extra[i] != nil { - s += dns.Extra[i].String() + "\n" - } - } - } - return s -} - -// Len returns the message length when in (un)compressed wire format. -// If dns.Compress is true compression it is taken into account. Len() -// is provided to be a faster way to get the size of the resulting packet, -// than packing it, measuring the size and discarding the buffer. -func (dns *Msg) Len() int { - // We always return one more than needed. - l := 12 // Message header is always 12 bytes - var compression map[string]int - if dns.Compress { - compression = make(map[string]int) - } - for i := 0; i < len(dns.Question); i++ { - l += dns.Question[i].len() - if dns.Compress { - compressionLenHelper(compression, dns.Question[i].Name) - } - } - for i := 0; i < len(dns.Answer); i++ { - if dns.Answer[i] == nil { - continue - } - l += dns.Answer[i].len() - if dns.Compress { - k, ok := compressionLenSearch(compression, dns.Answer[i].Header().Name) - if ok { - l += 1 - k - } - compressionLenHelper(compression, dns.Answer[i].Header().Name) - k, ok = compressionLenSearchType(compression, dns.Answer[i]) - if ok { - l += 1 - k - } - compressionLenHelperType(compression, dns.Answer[i]) - } - } - for i := 0; i < len(dns.Ns); i++ { - if dns.Ns[i] == nil { - continue - } - l += dns.Ns[i].len() - if dns.Compress { - k, ok := compressionLenSearch(compression, dns.Ns[i].Header().Name) - if ok { - l += 1 - k - } - compressionLenHelper(compression, dns.Ns[i].Header().Name) - k, ok = compressionLenSearchType(compression, dns.Ns[i]) - if ok { - l += 1 - k - } - compressionLenHelperType(compression, dns.Ns[i]) - } - } - for i := 0; i < len(dns.Extra); i++ { - if dns.Extra[i] == nil { - continue - } - l += dns.Extra[i].len() - if dns.Compress { - k, ok := compressionLenSearch(compression, dns.Extra[i].Header().Name) - if ok { - l += 1 - k - } - compressionLenHelper(compression, dns.Extra[i].Header().Name) - k, ok = compressionLenSearchType(compression, dns.Extra[i]) - if ok { - l += 1 - k - } - compressionLenHelperType(compression, dns.Extra[i]) - } - } - return l -} - -// Put the parts of the name in the compression map. -func compressionLenHelper(c map[string]int, s string) { - pref := "" - lbs := Split(s) - for j := len(lbs) - 1; j >= 0; j-- { - pref = s[lbs[j]:] - if _, ok := c[pref]; !ok { - c[pref] = len(pref) - } - } -} - -// Look for each part in the compression map and returns its length, -// keep on searching so we get the longest match. -func compressionLenSearch(c map[string]int, s string) (int, bool) { - off := 0 - end := false - if s == "" { // don't bork on bogus data - return 0, false - } - for { - if _, ok := c[s[off:]]; ok { - return len(s[off:]), true - } - if end { - break - } - off, end = NextLabel(s, off) - } - return 0, false -} - -// TODO(miek): should add all types, because the all can be *used* for compression. Autogenerate from msg_generate and put in zmsg.go -func compressionLenHelperType(c map[string]int, r RR) { - switch x := r.(type) { - case *NS: - compressionLenHelper(c, x.Ns) - case *MX: - compressionLenHelper(c, x.Mx) - case *CNAME: - compressionLenHelper(c, x.Target) - case *PTR: - compressionLenHelper(c, x.Ptr) - case *SOA: - compressionLenHelper(c, x.Ns) - compressionLenHelper(c, x.Mbox) - case *MB: - compressionLenHelper(c, x.Mb) - case *MG: - compressionLenHelper(c, x.Mg) - case *MR: - compressionLenHelper(c, x.Mr) - case *MF: - compressionLenHelper(c, x.Mf) - case *MD: - compressionLenHelper(c, x.Md) - case *RT: - compressionLenHelper(c, x.Host) - case *RP: - compressionLenHelper(c, x.Mbox) - compressionLenHelper(c, x.Txt) - case *MINFO: - compressionLenHelper(c, x.Rmail) - compressionLenHelper(c, x.Email) - case *AFSDB: - compressionLenHelper(c, x.Hostname) - case *SRV: - compressionLenHelper(c, x.Target) - case *NAPTR: - compressionLenHelper(c, x.Replacement) - case *RRSIG: - compressionLenHelper(c, x.SignerName) - case *NSEC: - compressionLenHelper(c, x.NextDomain) - // HIP? - } -} - -// Only search on compressing these types. -func compressionLenSearchType(c map[string]int, r RR) (int, bool) { - switch x := r.(type) { - case *NS: - return compressionLenSearch(c, x.Ns) - case *MX: - return compressionLenSearch(c, x.Mx) - case *CNAME: - return compressionLenSearch(c, x.Target) - case *DNAME: - return compressionLenSearch(c, x.Target) - case *PTR: - return compressionLenSearch(c, x.Ptr) - case *SOA: - k, ok := compressionLenSearch(c, x.Ns) - k1, ok1 := compressionLenSearch(c, x.Mbox) - if !ok && !ok1 { - return 0, false - } - return k + k1, true - case *MB: - return compressionLenSearch(c, x.Mb) - case *MG: - return compressionLenSearch(c, x.Mg) - case *MR: - return compressionLenSearch(c, x.Mr) - case *MF: - return compressionLenSearch(c, x.Mf) - case *MD: - return compressionLenSearch(c, x.Md) - case *RT: - return compressionLenSearch(c, x.Host) - case *MINFO: - k, ok := compressionLenSearch(c, x.Rmail) - k1, ok1 := compressionLenSearch(c, x.Email) - if !ok && !ok1 { - return 0, false - } - return k + k1, true - case *AFSDB: - return compressionLenSearch(c, x.Hostname) - } - return 0, false -} - -// Copy returns a new RR which is a deep-copy of r. -func Copy(r RR) RR { r1 := r.copy(); return r1 } - -// Len returns the length (in octets) of the uncompressed RR in wire format. -func Len(r RR) int { return r.len() } - -// Copy returns a new *Msg which is a deep-copy of dns. -func (dns *Msg) Copy() *Msg { return dns.CopyTo(new(Msg)) } - -// CopyTo copies the contents to the provided message using a deep-copy and returns the copy. -func (dns *Msg) CopyTo(r1 *Msg) *Msg { - r1.MsgHdr = dns.MsgHdr - r1.Compress = dns.Compress - - if len(dns.Question) > 0 { - r1.Question = make([]Question, len(dns.Question)) - copy(r1.Question, dns.Question) // TODO(miek): Question is an immutable value, ok to do a shallow-copy - } - - rrArr := make([]RR, len(dns.Answer)+len(dns.Ns)+len(dns.Extra)) - var rri int - - if len(dns.Answer) > 0 { - rrbegin := rri - for i := 0; i < len(dns.Answer); i++ { - rrArr[rri] = dns.Answer[i].copy() - rri++ - } - r1.Answer = rrArr[rrbegin:rri:rri] - } - - if len(dns.Ns) > 0 { - rrbegin := rri - for i := 0; i < len(dns.Ns); i++ { - rrArr[rri] = dns.Ns[i].copy() - rri++ - } - r1.Ns = rrArr[rrbegin:rri:rri] - } - - if len(dns.Extra) > 0 { - rrbegin := rri - for i := 0; i < len(dns.Extra); i++ { - rrArr[rri] = dns.Extra[i].copy() - rri++ - } - r1.Extra = rrArr[rrbegin:rri:rri] - } - - return r1 -} - -func (q *Question) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := PackDomainName(q.Name, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packUint16(q.Qtype, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(q.Qclass, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func unpackQuestion(msg []byte, off int) (Question, int, error) { - var ( - q Question - err error - ) - q.Name, off, err = UnpackDomainName(msg, off) - if err != nil { - return q, off, err - } - if off == len(msg) { - return q, off, nil - } - q.Qtype, off, err = unpackUint16(msg, off) - if err != nil { - return q, off, err - } - if off == len(msg) { - return q, off, nil - } - q.Qclass, off, err = unpackUint16(msg, off) - if off == len(msg) { - return q, off, nil - } - return q, off, err -} - -func (dh *Header) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := packUint16(dh.Id, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Bits, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Qdcount, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Ancount, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Nscount, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Arcount, msg, off) - return off, err -} - -func unpackMsgHdr(msg []byte, off int) (Header, int, error) { - var ( - dh Header - err error - ) - dh.Id, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Bits, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Qdcount, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Ancount, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Nscount, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Arcount, off, err = unpackUint16(msg, off) - return dh, off, err -} diff --git a/vendor/github.com/miekg/dns/msg_generate.go b/vendor/github.com/miekg/dns/msg_generate.go deleted file mode 100644 index 35786f2..0000000 --- a/vendor/github.com/miekg/dns/msg_generate.go +++ /dev/null @@ -1,340 +0,0 @@ -//+build ignore - -// msg_generate.go is meant to run with go generate. It will use -// go/{importer,types} to track down all the RR struct types. Then for each type -// it will generate pack/unpack methods based on the struct tags. The generated source is -// written to zmsg.go, and is meant to be checked into git. -package main - -import ( - "bytes" - "fmt" - "go/format" - "go/importer" - "go/types" - "log" - "os" - "strings" -) - -var packageHdr = ` -// *** DO NOT MODIFY *** -// AUTOGENERATED BY go generate from msg_generate.go - -package dns - -` - -// getTypeStruct will take a type and the package scope, and return the -// (innermost) struct if the type is considered a RR type (currently defined as -// those structs beginning with a RR_Header, could be redefined as implementing -// the RR interface). The bool return value indicates if embedded structs were -// resolved. -func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) { - st, ok := t.Underlying().(*types.Struct) - if !ok { - return nil, false - } - if st.Field(0).Type() == scope.Lookup("RR_Header").Type() { - return st, false - } - if st.Field(0).Anonymous() { - st, _ := getTypeStruct(st.Field(0).Type(), scope) - return st, true - } - return nil, false -} - -func main() { - // Import and type-check the package - pkg, err := importer.Default().Import("github.com/miekg/dns") - fatalIfErr(err) - scope := pkg.Scope() - - // Collect actual types (*X) - var namedTypes []string - for _, name := range scope.Names() { - o := scope.Lookup(name) - if o == nil || !o.Exported() { - continue - } - if st, _ := getTypeStruct(o.Type(), scope); st == nil { - continue - } - if name == "PrivateRR" { - continue - } - - // Check if corresponding TypeX exists - if scope.Lookup("Type"+o.Name()) == nil && o.Name() != "RFC3597" { - log.Fatalf("Constant Type%s does not exist.", o.Name()) - } - - namedTypes = append(namedTypes, o.Name()) - } - - b := &bytes.Buffer{} - b.WriteString(packageHdr) - - fmt.Fprint(b, "// pack*() functions\n\n") - for _, name := range namedTypes { - o := scope.Lookup(name) - st, _ := getTypeStruct(o.Type(), scope) - - fmt.Fprintf(b, "func (rr *%s) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) {\n", name) - fmt.Fprint(b, `off, err := rr.Hdr.pack(msg, off, compression, compress) -if err != nil { - return off, err -} -headerEnd := off -`) - for i := 1; i < st.NumFields(); i++ { - o := func(s string) { - fmt.Fprintf(b, s, st.Field(i).Name()) - fmt.Fprint(b, `if err != nil { -return off, err -} -`) - } - - if _, ok := st.Field(i).Type().(*types.Slice); ok { - switch st.Tag(i) { - case `dns:"-"`: // ignored - case `dns:"txt"`: - o("off, err = packStringTxt(rr.%s, msg, off)\n") - case `dns:"opt"`: - o("off, err = packDataOpt(rr.%s, msg, off)\n") - case `dns:"nsec"`: - o("off, err = packDataNsec(rr.%s, msg, off)\n") - case `dns:"domain-name"`: - o("off, err = packDataDomainNames(rr.%s, msg, off, compression, compress)\n") - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - continue - } - - switch { - case st.Tag(i) == `dns:"-"`: // ignored - case st.Tag(i) == `dns:"cdomain-name"`: - fallthrough - case st.Tag(i) == `dns:"domain-name"`: - o("off, err = PackDomainName(rr.%s, msg, off, compression, compress)\n") - case st.Tag(i) == `dns:"a"`: - o("off, err = packDataA(rr.%s, msg, off)\n") - case st.Tag(i) == `dns:"aaaa"`: - o("off, err = packDataAAAA(rr.%s, msg, off)\n") - case st.Tag(i) == `dns:"uint48"`: - o("off, err = packUint48(rr.%s, msg, off)\n") - case st.Tag(i) == `dns:"txt"`: - o("off, err = packString(rr.%s, msg, off)\n") - - case strings.HasPrefix(st.Tag(i), `dns:"size-base32`): // size-base32 can be packed just like base32 - fallthrough - case st.Tag(i) == `dns:"base32"`: - o("off, err = packStringBase32(rr.%s, msg, off)\n") - - case strings.HasPrefix(st.Tag(i), `dns:"size-base64`): // size-base64 can be packed just like base64 - fallthrough - case st.Tag(i) == `dns:"base64"`: - o("off, err = packStringBase64(rr.%s, msg, off)\n") - - case strings.HasPrefix(st.Tag(i), `dns:"size-hex:SaltLength`): // Hack to fix empty salt length for NSEC3 - o("if rr.%s == \"-\" { /* do nothing, empty salt */ }\n") - continue - case strings.HasPrefix(st.Tag(i), `dns:"size-hex`): // size-hex can be packed just like hex - fallthrough - case st.Tag(i) == `dns:"hex"`: - o("off, err = packStringHex(rr.%s, msg, off)\n") - - case st.Tag(i) == `dns:"octet"`: - o("off, err = packStringOctet(rr.%s, msg, off)\n") - case st.Tag(i) == "": - switch st.Field(i).Type().(*types.Basic).Kind() { - case types.Uint8: - o("off, err = packUint8(rr.%s, msg, off)\n") - case types.Uint16: - o("off, err = packUint16(rr.%s, msg, off)\n") - case types.Uint32: - o("off, err = packUint32(rr.%s, msg, off)\n") - case types.Uint64: - o("off, err = packUint64(rr.%s, msg, off)\n") - case types.String: - o("off, err = packString(rr.%s, msg, off)\n") - default: - log.Fatalln(name, st.Field(i).Name()) - } - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - } - // We have packed everything, only now we know the rdlength of this RR - fmt.Fprintln(b, "rr.Header().Rdlength = uint16(off-headerEnd)") - fmt.Fprintln(b, "return off, nil }\n") - } - - fmt.Fprint(b, "// unpack*() functions\n\n") - for _, name := range namedTypes { - o := scope.Lookup(name) - st, _ := getTypeStruct(o.Type(), scope) - - fmt.Fprintf(b, "func unpack%s(h RR_Header, msg []byte, off int) (RR, int, error) {\n", name) - fmt.Fprintf(b, "rr := new(%s)\n", name) - fmt.Fprint(b, "rr.Hdr = h\n") - fmt.Fprint(b, `if noRdata(h) { -return rr, off, nil - } -var err error -rdStart := off -_ = rdStart - -`) - for i := 1; i < st.NumFields(); i++ { - o := func(s string) { - fmt.Fprintf(b, s, st.Field(i).Name()) - fmt.Fprint(b, `if err != nil { -return rr, off, err -} -`) - } - - // size-* are special, because they reference a struct member we should use for the length. - if strings.HasPrefix(st.Tag(i), `dns:"size-`) { - structMember := structMember(st.Tag(i)) - structTag := structTag(st.Tag(i)) - switch structTag { - case "hex": - fmt.Fprintf(b, "rr.%s, off, err = unpackStringHex(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) - case "base32": - fmt.Fprintf(b, "rr.%s, off, err = unpackStringBase32(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) - case "base64": - fmt.Fprintf(b, "rr.%s, off, err = unpackStringBase64(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - fmt.Fprint(b, `if err != nil { -return rr, off, err -} -`) - continue - } - - if _, ok := st.Field(i).Type().(*types.Slice); ok { - switch st.Tag(i) { - case `dns:"-"`: // ignored - case `dns:"txt"`: - o("rr.%s, off, err = unpackStringTxt(msg, off)\n") - case `dns:"opt"`: - o("rr.%s, off, err = unpackDataOpt(msg, off)\n") - case `dns:"nsec"`: - o("rr.%s, off, err = unpackDataNsec(msg, off)\n") - case `dns:"domain-name"`: - o("rr.%s, off, err = unpackDataDomainNames(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - continue - } - - switch st.Tag(i) { - case `dns:"-"`: // ignored - case `dns:"cdomain-name"`: - fallthrough - case `dns:"domain-name"`: - o("rr.%s, off, err = UnpackDomainName(msg, off)\n") - case `dns:"a"`: - o("rr.%s, off, err = unpackDataA(msg, off)\n") - case `dns:"aaaa"`: - o("rr.%s, off, err = unpackDataAAAA(msg, off)\n") - case `dns:"uint48"`: - o("rr.%s, off, err = unpackUint48(msg, off)\n") - case `dns:"txt"`: - o("rr.%s, off, err = unpackString(msg, off)\n") - case `dns:"base32"`: - o("rr.%s, off, err = unpackStringBase32(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") - case `dns:"base64"`: - o("rr.%s, off, err = unpackStringBase64(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") - case `dns:"hex"`: - o("rr.%s, off, err = unpackStringHex(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") - case `dns:"octet"`: - o("rr.%s, off, err = unpackStringOctet(msg, off)\n") - case "": - switch st.Field(i).Type().(*types.Basic).Kind() { - case types.Uint8: - o("rr.%s, off, err = unpackUint8(msg, off)\n") - case types.Uint16: - o("rr.%s, off, err = unpackUint16(msg, off)\n") - case types.Uint32: - o("rr.%s, off, err = unpackUint32(msg, off)\n") - case types.Uint64: - o("rr.%s, off, err = unpackUint64(msg, off)\n") - case types.String: - o("rr.%s, off, err = unpackString(msg, off)\n") - default: - log.Fatalln(name, st.Field(i).Name()) - } - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - // If we've hit len(msg) we return without error. - if i < st.NumFields()-1 { - fmt.Fprintf(b, `if off == len(msg) { -return rr, off, nil - } -`) - } - } - fmt.Fprintf(b, "return rr, off, err }\n\n") - } - // Generate typeToUnpack map - fmt.Fprintln(b, "var typeToUnpack = map[uint16]func(RR_Header, []byte, int) (RR, int, error){") - for _, name := range namedTypes { - if name == "RFC3597" { - continue - } - fmt.Fprintf(b, "Type%s: unpack%s,\n", name, name) - } - fmt.Fprintln(b, "}\n") - - // gofmt - res, err := format.Source(b.Bytes()) - if err != nil { - b.WriteTo(os.Stderr) - log.Fatal(err) - } - - // write result - f, err := os.Create("zmsg.go") - fatalIfErr(err) - defer f.Close() - f.Write(res) -} - -// structMember will take a tag like dns:"size-base32:SaltLength" and return the last part of this string. -func structMember(s string) string { - fields := strings.Split(s, ":") - if len(fields) == 0 { - return "" - } - f := fields[len(fields)-1] - // f should have a closing " - if len(f) > 1 { - return f[:len(f)-1] - } - return f -} - -// structTag will take a tag like dns:"size-base32:SaltLength" and return base32. -func structTag(s string) string { - fields := strings.Split(s, ":") - if len(fields) < 2 { - return "" - } - return fields[1][len("\"size-"):] -} - -func fatalIfErr(err error) { - if err != nil { - log.Fatal(err) - } -} diff --git a/vendor/github.com/miekg/dns/msg_helpers.go b/vendor/github.com/miekg/dns/msg_helpers.go deleted file mode 100644 index 494c053..0000000 --- a/vendor/github.com/miekg/dns/msg_helpers.go +++ /dev/null @@ -1,628 +0,0 @@ -package dns - -import ( - "encoding/base32" - "encoding/base64" - "encoding/binary" - "encoding/hex" - "net" - "strconv" -) - -// helper functions called from the generated zmsg.go - -// These function are named after the tag to help pack/unpack, if there is no tag it is the name -// of the type they pack/unpack (string, int, etc). We prefix all with unpackData or packData, so packDataA or -// packDataDomainName. - -func unpackDataA(msg []byte, off int) (net.IP, int, error) { - if off+net.IPv4len > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking a"} - } - a := append(make(net.IP, 0, net.IPv4len), msg[off:off+net.IPv4len]...) - off += net.IPv4len - return a, off, nil -} - -func packDataA(a net.IP, msg []byte, off int) (int, error) { - // It must be a slice of 4, even if it is 16, we encode only the first 4 - if off+net.IPv4len > len(msg) { - return len(msg), &Error{err: "overflow packing a"} - } - switch len(a) { - case net.IPv4len, net.IPv6len: - copy(msg[off:], a.To4()) - off += net.IPv4len - case 0: - // Allowed, for dynamic updates. - default: - return len(msg), &Error{err: "overflow packing a"} - } - return off, nil -} - -func unpackDataAAAA(msg []byte, off int) (net.IP, int, error) { - if off+net.IPv6len > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking aaaa"} - } - aaaa := append(make(net.IP, 0, net.IPv6len), msg[off:off+net.IPv6len]...) - off += net.IPv6len - return aaaa, off, nil -} - -func packDataAAAA(aaaa net.IP, msg []byte, off int) (int, error) { - if off+net.IPv6len > len(msg) { - return len(msg), &Error{err: "overflow packing aaaa"} - } - - switch len(aaaa) { - case net.IPv6len: - copy(msg[off:], aaaa) - off += net.IPv6len - case 0: - // Allowed, dynamic updates. - default: - return len(msg), &Error{err: "overflow packing aaaa"} - } - return off, nil -} - -// unpackHeader unpacks an RR header, returning the offset to the end of the header and a -// re-sliced msg according to the expected length of the RR. -func unpackHeader(msg []byte, off int) (rr RR_Header, off1 int, truncmsg []byte, err error) { - hdr := RR_Header{} - if off == len(msg) { - return hdr, off, msg, nil - } - - hdr.Name, off, err = UnpackDomainName(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - hdr.Rrtype, off, err = unpackUint16(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - hdr.Class, off, err = unpackUint16(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - hdr.Ttl, off, err = unpackUint32(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - hdr.Rdlength, off, err = unpackUint16(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - msg, err = truncateMsgFromRdlength(msg, off, hdr.Rdlength) - return hdr, off, msg, nil -} - -// pack packs an RR header, returning the offset to the end of the header. -// See PackDomainName for documentation about the compression. -func (hdr RR_Header) pack(msg []byte, off int, compression map[string]int, compress bool) (off1 int, err error) { - if off == len(msg) { - return off, nil - } - - off, err = PackDomainName(hdr.Name, msg, off, compression, compress) - if err != nil { - return len(msg), err - } - off, err = packUint16(hdr.Rrtype, msg, off) - if err != nil { - return len(msg), err - } - off, err = packUint16(hdr.Class, msg, off) - if err != nil { - return len(msg), err - } - off, err = packUint32(hdr.Ttl, msg, off) - if err != nil { - return len(msg), err - } - off, err = packUint16(hdr.Rdlength, msg, off) - if err != nil { - return len(msg), err - } - return off, nil -} - -// helper helper functions. - -// truncateMsgFromRdLength truncates msg to match the expected length of the RR. -// Returns an error if msg is smaller than the expected size. -func truncateMsgFromRdlength(msg []byte, off int, rdlength uint16) (truncmsg []byte, err error) { - lenrd := off + int(rdlength) - if lenrd > len(msg) { - return msg, &Error{err: "overflowing header size"} - } - return msg[:lenrd], nil -} - -func fromBase32(s []byte) (buf []byte, err error) { - buflen := base32.HexEncoding.DecodedLen(len(s)) - buf = make([]byte, buflen) - n, err := base32.HexEncoding.Decode(buf, s) - buf = buf[:n] - return -} - -func toBase32(b []byte) string { return base32.HexEncoding.EncodeToString(b) } - -func fromBase64(s []byte) (buf []byte, err error) { - buflen := base64.StdEncoding.DecodedLen(len(s)) - buf = make([]byte, buflen) - n, err := base64.StdEncoding.Decode(buf, s) - buf = buf[:n] - return -} - -func toBase64(b []byte) string { return base64.StdEncoding.EncodeToString(b) } - -// dynamicUpdate returns true if the Rdlength is zero. -func noRdata(h RR_Header) bool { return h.Rdlength == 0 } - -func unpackUint8(msg []byte, off int) (i uint8, off1 int, err error) { - if off+1 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint8"} - } - return uint8(msg[off]), off + 1, nil -} - -func packUint8(i uint8, msg []byte, off int) (off1 int, err error) { - if off+1 > len(msg) { - return len(msg), &Error{err: "overflow packing uint8"} - } - msg[off] = byte(i) - return off + 1, nil -} - -func unpackUint16(msg []byte, off int) (i uint16, off1 int, err error) { - if off+2 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint16"} - } - return binary.BigEndian.Uint16(msg[off:]), off + 2, nil -} - -func packUint16(i uint16, msg []byte, off int) (off1 int, err error) { - if off+2 > len(msg) { - return len(msg), &Error{err: "overflow packing uint16"} - } - binary.BigEndian.PutUint16(msg[off:], i) - return off + 2, nil -} - -func unpackUint32(msg []byte, off int) (i uint32, off1 int, err error) { - if off+4 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint32"} - } - return binary.BigEndian.Uint32(msg[off:]), off + 4, nil -} - -func packUint32(i uint32, msg []byte, off int) (off1 int, err error) { - if off+4 > len(msg) { - return len(msg), &Error{err: "overflow packing uint32"} - } - binary.BigEndian.PutUint32(msg[off:], i) - return off + 4, nil -} - -func unpackUint48(msg []byte, off int) (i uint64, off1 int, err error) { - if off+6 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint64 as uint48"} - } - // Used in TSIG where the last 48 bits are occupied, so for now, assume a uint48 (6 bytes) - i = (uint64(uint64(msg[off])<<40 | uint64(msg[off+1])<<32 | uint64(msg[off+2])<<24 | uint64(msg[off+3])<<16 | - uint64(msg[off+4])<<8 | uint64(msg[off+5]))) - off += 6 - return i, off, nil -} - -func packUint48(i uint64, msg []byte, off int) (off1 int, err error) { - if off+6 > len(msg) { - return len(msg), &Error{err: "overflow packing uint64 as uint48"} - } - msg[off] = byte(i >> 40) - msg[off+1] = byte(i >> 32) - msg[off+2] = byte(i >> 24) - msg[off+3] = byte(i >> 16) - msg[off+4] = byte(i >> 8) - msg[off+5] = byte(i) - off += 6 - return off, nil -} - -func unpackUint64(msg []byte, off int) (i uint64, off1 int, err error) { - if off+8 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint64"} - } - return binary.BigEndian.Uint64(msg[off:]), off + 8, nil -} - -func packUint64(i uint64, msg []byte, off int) (off1 int, err error) { - if off+8 > len(msg) { - return len(msg), &Error{err: "overflow packing uint64"} - } - binary.BigEndian.PutUint64(msg[off:], i) - off += 8 - return off, nil -} - -func unpackString(msg []byte, off int) (string, int, error) { - if off+1 > len(msg) { - return "", off, &Error{err: "overflow unpacking txt"} - } - l := int(msg[off]) - if off+l+1 > len(msg) { - return "", off, &Error{err: "overflow unpacking txt"} - } - s := make([]byte, 0, l) - for _, b := range msg[off+1 : off+1+l] { - switch b { - case '"', '\\': - s = append(s, '\\', b) - default: - if b < 32 || b > 127 { // unprintable - var buf [3]byte - bufs := strconv.AppendInt(buf[:0], int64(b), 10) - s = append(s, '\\') - for i := 0; i < 3-len(bufs); i++ { - s = append(s, '0') - } - for _, r := range bufs { - s = append(s, r) - } - } else { - s = append(s, b) - } - } - } - off += 1 + l - return string(s), off, nil -} - -func packString(s string, msg []byte, off int) (int, error) { - txtTmp := make([]byte, 256*4+1) - off, err := packTxtString(s, msg, off, txtTmp) - if err != nil { - return len(msg), err - } - return off, nil -} - -func unpackStringBase32(msg []byte, off, end int) (string, int, error) { - if end > len(msg) { - return "", len(msg), &Error{err: "overflow unpacking base32"} - } - s := toBase32(msg[off:end]) - return s, end, nil -} - -func packStringBase32(s string, msg []byte, off int) (int, error) { - b32, err := fromBase32([]byte(s)) - if err != nil { - return len(msg), err - } - if off+len(b32) > len(msg) { - return len(msg), &Error{err: "overflow packing base32"} - } - copy(msg[off:off+len(b32)], b32) - off += len(b32) - return off, nil -} - -func unpackStringBase64(msg []byte, off, end int) (string, int, error) { - // Rest of the RR is base64 encoded value, so we don't need an explicit length - // to be set. Thus far all RR's that have base64 encoded fields have those as their - // last one. What we do need is the end of the RR! - if end > len(msg) { - return "", len(msg), &Error{err: "overflow unpacking base64"} - } - s := toBase64(msg[off:end]) - return s, end, nil -} - -func packStringBase64(s string, msg []byte, off int) (int, error) { - b64, err := fromBase64([]byte(s)) - if err != nil { - return len(msg), err - } - if off+len(b64) > len(msg) { - return len(msg), &Error{err: "overflow packing base64"} - } - copy(msg[off:off+len(b64)], b64) - off += len(b64) - return off, nil -} - -func unpackStringHex(msg []byte, off, end int) (string, int, error) { - // Rest of the RR is hex encoded value, so we don't need an explicit length - // to be set. NSEC and TSIG have hex fields with a length field. - // What we do need is the end of the RR! - if end > len(msg) { - return "", len(msg), &Error{err: "overflow unpacking hex"} - } - - s := hex.EncodeToString(msg[off:end]) - return s, end, nil -} - -func packStringHex(s string, msg []byte, off int) (int, error) { - h, err := hex.DecodeString(s) - if err != nil { - return len(msg), err - } - if off+(len(h)) > len(msg) { - return len(msg), &Error{err: "overflow packing hex"} - } - copy(msg[off:off+len(h)], h) - off += len(h) - return off, nil -} - -func unpackStringTxt(msg []byte, off int) ([]string, int, error) { - txt, off, err := unpackTxt(msg, off) - if err != nil { - return nil, len(msg), err - } - return txt, off, nil -} - -func packStringTxt(s []string, msg []byte, off int) (int, error) { - txtTmp := make([]byte, 256*4+1) // If the whole string consists out of \DDD we need this many. - off, err := packTxt(s, msg, off, txtTmp) - if err != nil { - return len(msg), err - } - return off, nil -} - -func unpackDataOpt(msg []byte, off int) ([]EDNS0, int, error) { - var edns []EDNS0 -Option: - code := uint16(0) - if off+4 > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking opt"} - } - code = binary.BigEndian.Uint16(msg[off:]) - off += 2 - optlen := binary.BigEndian.Uint16(msg[off:]) - off += 2 - if off+int(optlen) > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking opt"} - } - switch code { - case EDNS0NSID: - e := new(EDNS0_NSID) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - case EDNS0SUBNET, EDNS0SUBNETDRAFT: - e := new(EDNS0_SUBNET) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - if code == EDNS0SUBNETDRAFT { - e.DraftOption = true - } - case EDNS0COOKIE: - e := new(EDNS0_COOKIE) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - case EDNS0UL: - e := new(EDNS0_UL) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - case EDNS0LLQ: - e := new(EDNS0_LLQ) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - case EDNS0DAU: - e := new(EDNS0_DAU) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - case EDNS0DHU: - e := new(EDNS0_DHU) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - case EDNS0N3U: - e := new(EDNS0_N3U) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - default: - e := new(EDNS0_LOCAL) - e.Code = code - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - } - - if off < len(msg) { - goto Option - } - - return edns, off, nil -} - -func packDataOpt(options []EDNS0, msg []byte, off int) (int, error) { - for _, el := range options { - b, err := el.pack() - if err != nil || off+3 > len(msg) { - return len(msg), &Error{err: "overflow packing opt"} - } - binary.BigEndian.PutUint16(msg[off:], el.Option()) // Option code - binary.BigEndian.PutUint16(msg[off+2:], uint16(len(b))) // Length - off += 4 - if off+len(b) > len(msg) { - copy(msg[off:], b) - off = len(msg) - continue - } - // Actual data - copy(msg[off:off+len(b)], b) - off += len(b) - } - return off, nil -} - -func unpackStringOctet(msg []byte, off int) (string, int, error) { - s := string(msg[off:]) - return s, len(msg), nil -} - -func packStringOctet(s string, msg []byte, off int) (int, error) { - txtTmp := make([]byte, 256*4+1) - off, err := packOctetString(s, msg, off, txtTmp) - if err != nil { - return len(msg), err - } - return off, nil -} - -func unpackDataNsec(msg []byte, off int) ([]uint16, int, error) { - var nsec []uint16 - length, window, lastwindow := 0, 0, -1 - for off < len(msg) { - if off+2 > len(msg) { - return nsec, len(msg), &Error{err: "overflow unpacking nsecx"} - } - window = int(msg[off]) - length = int(msg[off+1]) - off += 2 - if window <= lastwindow { - // RFC 4034: Blocks are present in the NSEC RR RDATA in - // increasing numerical order. - return nsec, len(msg), &Error{err: "out of order NSEC block"} - } - if length == 0 { - // RFC 4034: Blocks with no types present MUST NOT be included. - return nsec, len(msg), &Error{err: "empty NSEC block"} - } - if length > 32 { - return nsec, len(msg), &Error{err: "NSEC block too long"} - } - if off+length > len(msg) { - return nsec, len(msg), &Error{err: "overflowing NSEC block"} - } - - // Walk the bytes in the window and extract the type bits - for j := 0; j < length; j++ { - b := msg[off+j] - // Check the bits one by one, and set the type - if b&0x80 == 0x80 { - nsec = append(nsec, uint16(window*256+j*8+0)) - } - if b&0x40 == 0x40 { - nsec = append(nsec, uint16(window*256+j*8+1)) - } - if b&0x20 == 0x20 { - nsec = append(nsec, uint16(window*256+j*8+2)) - } - if b&0x10 == 0x10 { - nsec = append(nsec, uint16(window*256+j*8+3)) - } - if b&0x8 == 0x8 { - nsec = append(nsec, uint16(window*256+j*8+4)) - } - if b&0x4 == 0x4 { - nsec = append(nsec, uint16(window*256+j*8+5)) - } - if b&0x2 == 0x2 { - nsec = append(nsec, uint16(window*256+j*8+6)) - } - if b&0x1 == 0x1 { - nsec = append(nsec, uint16(window*256+j*8+7)) - } - } - off += length - lastwindow = window - } - return nsec, off, nil -} - -func packDataNsec(bitmap []uint16, msg []byte, off int) (int, error) { - if len(bitmap) == 0 { - return off, nil - } - var lastwindow, lastlength uint16 - for j := 0; j < len(bitmap); j++ { - t := bitmap[j] - window := t / 256 - length := (t-window*256)/8 + 1 - if window > lastwindow && lastlength != 0 { // New window, jump to the new offset - off += int(lastlength) + 2 - lastlength = 0 - } - if window < lastwindow || length < lastlength { - return len(msg), &Error{err: "nsec bits out of order"} - } - if off+2+int(length) > len(msg) { - return len(msg), &Error{err: "overflow packing nsec"} - } - // Setting the window # - msg[off] = byte(window) - // Setting the octets length - msg[off+1] = byte(length) - // Setting the bit value for the type in the right octet - msg[off+1+int(length)] |= byte(1 << (7 - (t % 8))) - lastwindow, lastlength = window, length - } - off += int(lastlength) + 2 - return off, nil -} - -func unpackDataDomainNames(msg []byte, off, end int) ([]string, int, error) { - var ( - servers []string - s string - err error - ) - if end > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking domain names"} - } - for off < end { - s, off, err = UnpackDomainName(msg, off) - if err != nil { - return servers, len(msg), err - } - servers = append(servers, s) - } - return servers, off, nil -} - -func packDataDomainNames(names []string, msg []byte, off int, compression map[string]int, compress bool) (int, error) { - var err error - for j := 0; j < len(names); j++ { - off, err = PackDomainName(names[j], msg, off, compression, false && compress) - if err != nil { - return len(msg), err - } - } - return off, nil -} diff --git a/vendor/github.com/miekg/dns/nsecx.go b/vendor/github.com/miekg/dns/nsecx.go deleted file mode 100644 index 6f10f3e..0000000 --- a/vendor/github.com/miekg/dns/nsecx.go +++ /dev/null @@ -1,119 +0,0 @@ -package dns - -import ( - "crypto/sha1" - "hash" - "io" - "strings" -) - -type saltWireFmt struct { - Salt string `dns:"size-hex"` -} - -// HashName hashes a string (label) according to RFC 5155. It returns the hashed string in uppercase. -func HashName(label string, ha uint8, iter uint16, salt string) string { - saltwire := new(saltWireFmt) - saltwire.Salt = salt - wire := make([]byte, DefaultMsgSize) - n, err := packSaltWire(saltwire, wire) - if err != nil { - return "" - } - wire = wire[:n] - name := make([]byte, 255) - off, err := PackDomainName(strings.ToLower(label), name, 0, nil, false) - if err != nil { - return "" - } - name = name[:off] - var s hash.Hash - switch ha { - case SHA1: - s = sha1.New() - default: - return "" - } - - // k = 0 - name = append(name, wire...) - io.WriteString(s, string(name)) - nsec3 := s.Sum(nil) - // k > 0 - for k := uint16(0); k < iter; k++ { - s.Reset() - nsec3 = append(nsec3, wire...) - io.WriteString(s, string(nsec3)) - nsec3 = s.Sum(nil) - } - return toBase32(nsec3) -} - -// Denialer is an interface that should be implemented by types that are used to denial -// answers in DNSSEC. -type Denialer interface { - // Cover will check if the (unhashed) name is being covered by this NSEC or NSEC3. - Cover(name string) bool - // Match will check if the ownername matches the (unhashed) name for this NSEC3 or NSEC3. - Match(name string) bool -} - -// Cover implements the Denialer interface. -func (rr *NSEC) Cover(name string) bool { - return true -} - -// Match implements the Denialer interface. -func (rr *NSEC) Match(name string) bool { - return true -} - -// Cover implements the Denialer interface. -func (rr *NSEC3) Cover(name string) bool { - // FIXME(miek): check if the zones match - // FIXME(miek): check if we're not dealing with parent nsec3 - hname := HashName(name, rr.Hash, rr.Iterations, rr.Salt) - labels := Split(rr.Hdr.Name) - if len(labels) < 2 { - return false - } - hash := strings.ToUpper(rr.Hdr.Name[labels[0] : labels[1]-1]) // -1 to remove the dot - if hash == rr.NextDomain { - return false // empty interval - } - if hash > rr.NextDomain { // last name, points to apex - // hname > hash - // hname > rr.NextDomain - // TODO(miek) - } - if hname <= hash { - return false - } - if hname >= rr.NextDomain { - return false - } - return true -} - -// Match implements the Denialer interface. -func (rr *NSEC3) Match(name string) bool { - // FIXME(miek): Check if we are in the same zone - hname := HashName(name, rr.Hash, rr.Iterations, rr.Salt) - labels := Split(rr.Hdr.Name) - if len(labels) < 2 { - return false - } - hash := strings.ToUpper(rr.Hdr.Name[labels[0] : labels[1]-1]) // -1 to remove the . - if hash == hname { - return true - } - return false -} - -func packSaltWire(sw *saltWireFmt, msg []byte) (int, error) { - off, err := packStringHex(sw.Salt, msg, 0) - if err != nil { - return off, err - } - return off, nil -} diff --git a/vendor/github.com/miekg/dns/privaterr.go b/vendor/github.com/miekg/dns/privaterr.go deleted file mode 100644 index 6b08e6e..0000000 --- a/vendor/github.com/miekg/dns/privaterr.go +++ /dev/null @@ -1,149 +0,0 @@ -package dns - -import ( - "fmt" - "strings" -) - -// PrivateRdata is an interface used for implementing "Private Use" RR types, see -// RFC 6895. This allows one to experiment with new RR types, without requesting an -// official type code. Also see dns.PrivateHandle and dns.PrivateHandleRemove. -type PrivateRdata interface { - // String returns the text presentaton of the Rdata of the Private RR. - String() string - // Parse parses the Rdata of the private RR. - Parse([]string) error - // Pack is used when packing a private RR into a buffer. - Pack([]byte) (int, error) - // Unpack is used when unpacking a private RR from a buffer. - // TODO(miek): diff. signature than Pack, see edns0.go for instance. - Unpack([]byte) (int, error) - // Copy copies the Rdata. - Copy(PrivateRdata) error - // Len returns the length in octets of the Rdata. - Len() int -} - -// PrivateRR represents an RR that uses a PrivateRdata user-defined type. -// It mocks normal RRs and implements dns.RR interface. -type PrivateRR struct { - Hdr RR_Header - Data PrivateRdata -} - -func mkPrivateRR(rrtype uint16) *PrivateRR { - // Panics if RR is not an instance of PrivateRR. - rrfunc, ok := TypeToRR[rrtype] - if !ok { - panic(fmt.Sprintf("dns: invalid operation with Private RR type %d", rrtype)) - } - - anyrr := rrfunc() - switch rr := anyrr.(type) { - case *PrivateRR: - return rr - } - panic(fmt.Sprintf("dns: RR is not a PrivateRR, TypeToRR[%d] generator returned %T", rrtype, anyrr)) -} - -// Header return the RR header of r. -func (r *PrivateRR) Header() *RR_Header { return &r.Hdr } - -func (r *PrivateRR) String() string { return r.Hdr.String() + r.Data.String() } - -// Private len and copy parts to satisfy RR interface. -func (r *PrivateRR) len() int { return r.Hdr.len() + r.Data.Len() } -func (r *PrivateRR) copy() RR { - // make new RR like this: - rr := mkPrivateRR(r.Hdr.Rrtype) - newh := r.Hdr.copyHeader() - rr.Hdr = *newh - - err := r.Data.Copy(rr.Data) - if err != nil { - panic("dns: got value that could not be used to copy Private rdata") - } - return rr -} -func (r *PrivateRR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := r.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - n, err := r.Data.Pack(msg[off:]) - if err != nil { - return len(msg), err - } - off += n - r.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -// PrivateHandle registers a private resource record type. It requires -// string and numeric representation of private RR type and generator function as argument. -func PrivateHandle(rtypestr string, rtype uint16, generator func() PrivateRdata) { - rtypestr = strings.ToUpper(rtypestr) - - TypeToRR[rtype] = func() RR { return &PrivateRR{RR_Header{}, generator()} } - TypeToString[rtype] = rtypestr - StringToType[rtypestr] = rtype - - typeToUnpack[rtype] = func(h RR_Header, msg []byte, off int) (RR, int, error) { - if noRdata(h) { - return &h, off, nil - } - var err error - - rr := mkPrivateRR(h.Rrtype) - rr.Hdr = h - - off1, err := rr.Data.Unpack(msg[off:]) - off += off1 - if err != nil { - return rr, off, err - } - return rr, off, err - } - - setPrivateRR := func(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := mkPrivateRR(h.Rrtype) - rr.Hdr = h - - var l lex - text := make([]string, 0, 2) // could be 0..N elements, median is probably 1 - Fetch: - for { - // TODO(miek): we could also be returning _QUOTE, this might or might not - // be an issue (basically parsing TXT becomes hard) - switch l = <-c; l.value { - case zNewline, zEOF: - break Fetch - case zString: - text = append(text, l.token) - } - } - - err := rr.Data.Parse(text) - if err != nil { - return nil, &ParseError{f, err.Error(), l}, "" - } - - return rr, nil, "" - } - - typeToparserFunc[rtype] = parserFunc{setPrivateRR, true} -} - -// PrivateHandleRemove removes defenitions required to support private RR type. -func PrivateHandleRemove(rtype uint16) { - rtypestr, ok := TypeToString[rtype] - if ok { - delete(TypeToRR, rtype) - delete(TypeToString, rtype) - delete(typeToparserFunc, rtype) - delete(StringToType, rtypestr) - delete(typeToUnpack, rtype) - } - return -} diff --git a/vendor/github.com/miekg/dns/rawmsg.go b/vendor/github.com/miekg/dns/rawmsg.go deleted file mode 100644 index 6e21fba..0000000 --- a/vendor/github.com/miekg/dns/rawmsg.go +++ /dev/null @@ -1,49 +0,0 @@ -package dns - -import "encoding/binary" - -// rawSetRdlength sets the rdlength in the header of -// the RR. The offset 'off' must be positioned at the -// start of the header of the RR, 'end' must be the -// end of the RR. -func rawSetRdlength(msg []byte, off, end int) bool { - l := len(msg) -Loop: - for { - if off+1 > l { - return false - } - c := int(msg[off]) - off++ - switch c & 0xC0 { - case 0x00: - if c == 0x00 { - // End of the domainname - break Loop - } - if off+c > l { - return false - } - off += c - - case 0xC0: - // pointer, next byte included, ends domainname - off++ - break Loop - } - } - // The domainname has been seen, we at the start of the fixed part in the header. - // Type is 2 bytes, class is 2 bytes, ttl 4 and then 2 bytes for the length. - off += 2 + 2 + 4 - if off+2 > l { - return false - } - //off+1 is the end of the header, 'end' is the end of the rr - //so 'end' - 'off+2' is the length of the rdata - rdatalen := end - (off + 2) - if rdatalen > 0xFFFF { - return false - } - binary.BigEndian.PutUint16(msg[off:], uint16(rdatalen)) - return true -} diff --git a/vendor/github.com/miekg/dns/reverse.go b/vendor/github.com/miekg/dns/reverse.go deleted file mode 100644 index 099dac9..0000000 --- a/vendor/github.com/miekg/dns/reverse.go +++ /dev/null @@ -1,38 +0,0 @@ -package dns - -// StringToType is the reverse of TypeToString, needed for string parsing. -var StringToType = reverseInt16(TypeToString) - -// StringToClass is the reverse of ClassToString, needed for string parsing. -var StringToClass = reverseInt16(ClassToString) - -// Map of opcodes strings. -var StringToOpcode = reverseInt(OpcodeToString) - -// Map of rcodes strings. -var StringToRcode = reverseInt(RcodeToString) - -// Reverse a map -func reverseInt8(m map[uint8]string) map[string]uint8 { - n := make(map[string]uint8, len(m)) - for u, s := range m { - n[s] = u - } - return n -} - -func reverseInt16(m map[uint16]string) map[string]uint16 { - n := make(map[string]uint16, len(m)) - for u, s := range m { - n[s] = u - } - return n -} - -func reverseInt(m map[int]string) map[string]int { - n := make(map[string]int, len(m)) - for u, s := range m { - n[s] = u - } - return n -} diff --git a/vendor/github.com/miekg/dns/sanitize.go b/vendor/github.com/miekg/dns/sanitize.go deleted file mode 100644 index b489f3f..0000000 --- a/vendor/github.com/miekg/dns/sanitize.go +++ /dev/null @@ -1,84 +0,0 @@ -package dns - -// Dedup removes identical RRs from rrs. It preserves the original ordering. -// The lowest TTL of any duplicates is used in the remaining one. Dedup modifies -// rrs. -// m is used to store the RRs temporay. If it is nil a new map will be allocated. -func Dedup(rrs []RR, m map[string]RR) []RR { - if m == nil { - m = make(map[string]RR) - } - // Save the keys, so we don't have to call normalizedString twice. - keys := make([]*string, 0, len(rrs)) - - for _, r := range rrs { - key := normalizedString(r) - keys = append(keys, &key) - if _, ok := m[key]; ok { - // Shortest TTL wins. - if m[key].Header().Ttl > r.Header().Ttl { - m[key].Header().Ttl = r.Header().Ttl - } - continue - } - - m[key] = r - } - // If the length of the result map equals the amount of RRs we got, - // it means they were all different. We can then just return the original rrset. - if len(m) == len(rrs) { - return rrs - } - - j := 0 - for i, r := range rrs { - // If keys[i] lives in the map, we should copy and remove it. - if _, ok := m[*keys[i]]; ok { - delete(m, *keys[i]) - rrs[j] = r - j++ - } - - if len(m) == 0 { - break - } - } - - return rrs[:j] -} - -// normalizedString returns a normalized string from r. The TTL -// is removed and the domain name is lowercased. We go from this: -// DomainNameTTLCLASSTYPERDATA to: -// lowercasenameCLASSTYPE... -func normalizedString(r RR) string { - // A string Go DNS makes has: domainnameTTL... - b := []byte(r.String()) - - // find the first non-escaped tab, then another, so we capture where the TTL lives. - esc := false - ttlStart, ttlEnd := 0, 0 - for i := 0; i < len(b) && ttlEnd == 0; i++ { - switch { - case b[i] == '\\': - esc = !esc - case b[i] == '\t' && !esc: - if ttlStart == 0 { - ttlStart = i - continue - } - if ttlEnd == 0 { - ttlEnd = i - } - case b[i] >= 'A' && b[i] <= 'Z' && !esc: - b[i] += 32 - default: - esc = false - } - } - - // remove TTL. - copy(b[ttlStart:], b[ttlEnd:]) - cut := ttlEnd - ttlStart - return string(b[:len(b)-cut]) -} diff --git a/vendor/github.com/miekg/dns/scan.go b/vendor/github.com/miekg/dns/scan.go deleted file mode 100644 index d34597b..0000000 --- a/vendor/github.com/miekg/dns/scan.go +++ /dev/null @@ -1,981 +0,0 @@ -package dns - -import ( - "io" - "log" - "os" - "strconv" - "strings" -) - -type debugging bool - -const debug debugging = false - -func (d debugging) Printf(format string, args ...interface{}) { - if d { - log.Printf(format, args...) - } -} - -const maxTok = 2048 // Largest token we can return. -const maxUint16 = 1<<16 - 1 - -// Tokinize a RFC 1035 zone file. The tokenizer will normalize it: -// * Add ownernames if they are left blank; -// * Suppress sequences of spaces; -// * Make each RR fit on one line (_NEWLINE is send as last) -// * Handle comments: ; -// * Handle braces - anywhere. -const ( - // Zonefile - zEOF = iota - zString - zBlank - zQuote - zNewline - zRrtpe - zOwner - zClass - zDirOrigin // $ORIGIN - zDirTtl // $TTL - zDirInclude // $INCLUDE - zDirGenerate // $GENERATE - - // Privatekey file - zValue - zKey - - zExpectOwnerDir // Ownername - zExpectOwnerBl // Whitespace after the ownername - zExpectAny // Expect rrtype, ttl or class - zExpectAnyNoClass // Expect rrtype or ttl - zExpectAnyNoClassBl // The whitespace after _EXPECT_ANY_NOCLASS - zExpectAnyNoTtl // Expect rrtype or class - zExpectAnyNoTtlBl // Whitespace after _EXPECT_ANY_NOTTL - zExpectRrtype // Expect rrtype - zExpectRrtypeBl // Whitespace BEFORE rrtype - zExpectRdata // The first element of the rdata - zExpectDirTtlBl // Space after directive $TTL - zExpectDirTtl // Directive $TTL - zExpectDirOriginBl // Space after directive $ORIGIN - zExpectDirOrigin // Directive $ORIGIN - zExpectDirIncludeBl // Space after directive $INCLUDE - zExpectDirInclude // Directive $INCLUDE - zExpectDirGenerate // Directive $GENERATE - zExpectDirGenerateBl // Space after directive $GENERATE -) - -// ParseError is a parsing error. It contains the parse error and the location in the io.Reader -// where the error occurred. -type ParseError struct { - file string - err string - lex lex -} - -func (e *ParseError) Error() (s string) { - if e.file != "" { - s = e.file + ": " - } - s += "dns: " + e.err + ": " + strconv.QuoteToASCII(e.lex.token) + " at line: " + - strconv.Itoa(e.lex.line) + ":" + strconv.Itoa(e.lex.column) - return -} - -type lex struct { - token string // text of the token - tokenUpper string // uppercase text of the token - length int // length of the token - err bool // when true, token text has lexer error - value uint8 // value: zString, _BLANK, etc. - line int // line in the file - column int // column in the file - torc uint16 // type or class as parsed in the lexer, we only need to look this up in the grammar - comment string // any comment text seen -} - -// Token holds the token that are returned when a zone file is parsed. -type Token struct { - // The scanned resource record when error is not nil. - RR - // When an error occurred, this has the error specifics. - Error *ParseError - // A potential comment positioned after the RR and on the same line. - Comment string -} - -// NewRR reads the RR contained in the string s. Only the first RR is -// returned. If s contains no RR, return nil with no error. The class -// defaults to IN and TTL defaults to 3600. The full zone file syntax -// like $TTL, $ORIGIN, etc. is supported. All fields of the returned -// RR are set, except RR.Header().Rdlength which is set to 0. -func NewRR(s string) (RR, error) { - if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline - return ReadRR(strings.NewReader(s+"\n"), "") - } - return ReadRR(strings.NewReader(s), "") -} - -// ReadRR reads the RR contained in q. -// See NewRR for more documentation. -func ReadRR(q io.Reader, filename string) (RR, error) { - r := <-parseZoneHelper(q, ".", filename, 1) - if r == nil { - return nil, nil - } - - if r.Error != nil { - return nil, r.Error - } - return r.RR, nil -} - -// ParseZone reads a RFC 1035 style zonefile from r. It returns *Tokens on the -// returned channel, which consist out the parsed RR, a potential comment or an error. -// If there is an error the RR is nil. The string file is only used -// in error reporting. The string origin is used as the initial origin, as -// if the file would start with: $ORIGIN origin . -// The directives $INCLUDE, $ORIGIN, $TTL and $GENERATE are supported. -// The channel t is closed by ParseZone when the end of r is reached. -// -// Basic usage pattern when reading from a string (z) containing the -// zone data: -// -// for x := range dns.ParseZone(strings.NewReader(z), "", "") { -// if x.Error != nil { -// // log.Println(x.Error) -// } else { -// // Do something with x.RR -// } -// } -// -// Comments specified after an RR (and on the same line!) are returned too: -// -// foo. IN A 10.0.0.1 ; this is a comment -// -// The text "; this is comment" is returned in Token.Comment. Comments inside the -// RR are discarded. Comments on a line by themselves are discarded too. -func ParseZone(r io.Reader, origin, file string) chan *Token { - return parseZoneHelper(r, origin, file, 10000) -} - -func parseZoneHelper(r io.Reader, origin, file string, chansize int) chan *Token { - t := make(chan *Token, chansize) - go parseZone(r, origin, file, t, 0) - return t -} - -func parseZone(r io.Reader, origin, f string, t chan *Token, include int) { - defer func() { - if include == 0 { - close(t) - } - }() - s := scanInit(r) - c := make(chan lex) - // Start the lexer - go zlexer(s, c) - // 6 possible beginnings of a line, _ is a space - // 0. zRRTYPE -> all omitted until the rrtype - // 1. zOwner _ zRrtype -> class/ttl omitted - // 2. zOwner _ zString _ zRrtype -> class omitted - // 3. zOwner _ zString _ zClass _ zRrtype -> ttl/class - // 4. zOwner _ zClass _ zRrtype -> ttl omitted - // 5. zOwner _ zClass _ zString _ zRrtype -> class/ttl (reversed) - // After detecting these, we know the zRrtype so we can jump to functions - // handling the rdata for each of these types. - - if origin == "" { - origin = "." - } - origin = Fqdn(origin) - if _, ok := IsDomainName(origin); !ok { - t <- &Token{Error: &ParseError{f, "bad initial origin name", lex{}}} - return - } - - st := zExpectOwnerDir // initial state - var h RR_Header - var defttl uint32 = defaultTtl - var prevName string - for l := range c { - // Lexer spotted an error already - if l.err == true { - t <- &Token{Error: &ParseError{f, l.token, l}} - return - - } - switch st { - case zExpectOwnerDir: - // We can also expect a directive, like $TTL or $ORIGIN - h.Ttl = defttl - h.Class = ClassINET - switch l.value { - case zNewline: - st = zExpectOwnerDir - case zOwner: - h.Name = l.token - if l.token[0] == '@' { - h.Name = origin - prevName = h.Name - st = zExpectOwnerBl - break - } - if h.Name[l.length-1] != '.' { - h.Name = appendOrigin(h.Name, origin) - } - _, ok := IsDomainName(l.token) - if !ok { - t <- &Token{Error: &ParseError{f, "bad owner name", l}} - return - } - prevName = h.Name - st = zExpectOwnerBl - case zDirTtl: - st = zExpectDirTtlBl - case zDirOrigin: - st = zExpectDirOriginBl - case zDirInclude: - st = zExpectDirIncludeBl - case zDirGenerate: - st = zExpectDirGenerateBl - case zRrtpe: - h.Name = prevName - h.Rrtype = l.torc - st = zExpectRdata - case zClass: - h.Name = prevName - h.Class = l.torc - st = zExpectAnyNoClassBl - case zBlank: - // Discard, can happen when there is nothing on the - // line except the RR type - case zString: - ttl, ok := stringToTtl(l.token) - if !ok { - t <- &Token{Error: &ParseError{f, "not a TTL", l}} - return - } - h.Ttl = ttl - // Don't about the defttl, we should take the $TTL value - // defttl = ttl - st = zExpectAnyNoTtlBl - - default: - t <- &Token{Error: &ParseError{f, "syntax error at beginning", l}} - return - } - case zExpectDirIncludeBl: - if l.value != zBlank { - t <- &Token{Error: &ParseError{f, "no blank after $INCLUDE-directive", l}} - return - } - st = zExpectDirInclude - case zExpectDirInclude: - if l.value != zString { - t <- &Token{Error: &ParseError{f, "expecting $INCLUDE value, not this...", l}} - return - } - neworigin := origin // There may be optionally a new origin set after the filename, if not use current one - l := <-c - switch l.value { - case zBlank: - l := <-c - if l.value == zString { - if _, ok := IsDomainName(l.token); !ok || l.length == 0 || l.err { - t <- &Token{Error: &ParseError{f, "bad origin name", l}} - return - } - // a new origin is specified. - if l.token[l.length-1] != '.' { - if origin != "." { // Prevent .. endings - neworigin = l.token + "." + origin - } else { - neworigin = l.token + origin - } - } else { - neworigin = l.token - } - } - case zNewline, zEOF: - // Ok - default: - t <- &Token{Error: &ParseError{f, "garbage after $INCLUDE", l}} - return - } - // Start with the new file - r1, e1 := os.Open(l.token) - if e1 != nil { - t <- &Token{Error: &ParseError{f, "failed to open `" + l.token + "'", l}} - return - } - if include+1 > 7 { - t <- &Token{Error: &ParseError{f, "too deeply nested $INCLUDE", l}} - return - } - parseZone(r1, l.token, neworigin, t, include+1) - st = zExpectOwnerDir - case zExpectDirTtlBl: - if l.value != zBlank { - t <- &Token{Error: &ParseError{f, "no blank after $TTL-directive", l}} - return - } - st = zExpectDirTtl - case zExpectDirTtl: - if l.value != zString { - t <- &Token{Error: &ParseError{f, "expecting $TTL value, not this...", l}} - return - } - if e, _ := slurpRemainder(c, f); e != nil { - t <- &Token{Error: e} - return - } - ttl, ok := stringToTtl(l.token) - if !ok { - t <- &Token{Error: &ParseError{f, "expecting $TTL value, not this...", l}} - return - } - defttl = ttl - st = zExpectOwnerDir - case zExpectDirOriginBl: - if l.value != zBlank { - t <- &Token{Error: &ParseError{f, "no blank after $ORIGIN-directive", l}} - return - } - st = zExpectDirOrigin - case zExpectDirOrigin: - if l.value != zString { - t <- &Token{Error: &ParseError{f, "expecting $ORIGIN value, not this...", l}} - return - } - if e, _ := slurpRemainder(c, f); e != nil { - t <- &Token{Error: e} - } - if _, ok := IsDomainName(l.token); !ok { - t <- &Token{Error: &ParseError{f, "bad origin name", l}} - return - } - if l.token[l.length-1] != '.' { - if origin != "." { // Prevent .. endings - origin = l.token + "." + origin - } else { - origin = l.token + origin - } - } else { - origin = l.token - } - st = zExpectOwnerDir - case zExpectDirGenerateBl: - if l.value != zBlank { - t <- &Token{Error: &ParseError{f, "no blank after $GENERATE-directive", l}} - return - } - st = zExpectDirGenerate - case zExpectDirGenerate: - if l.value != zString { - t <- &Token{Error: &ParseError{f, "expecting $GENERATE value, not this...", l}} - return - } - if errMsg := generate(l, c, t, origin); errMsg != "" { - t <- &Token{Error: &ParseError{f, errMsg, l}} - return - } - st = zExpectOwnerDir - case zExpectOwnerBl: - if l.value != zBlank { - t <- &Token{Error: &ParseError{f, "no blank after owner", l}} - return - } - st = zExpectAny - case zExpectAny: - switch l.value { - case zRrtpe: - h.Rrtype = l.torc - st = zExpectRdata - case zClass: - h.Class = l.torc - st = zExpectAnyNoClassBl - case zString: - ttl, ok := stringToTtl(l.token) - if !ok { - t <- &Token{Error: &ParseError{f, "not a TTL", l}} - return - } - h.Ttl = ttl - // defttl = ttl // don't set the defttl here - st = zExpectAnyNoTtlBl - default: - t <- &Token{Error: &ParseError{f, "expecting RR type, TTL or class, not this...", l}} - return - } - case zExpectAnyNoClassBl: - if l.value != zBlank { - t <- &Token{Error: &ParseError{f, "no blank before class", l}} - return - } - st = zExpectAnyNoClass - case zExpectAnyNoTtlBl: - if l.value != zBlank { - t <- &Token{Error: &ParseError{f, "no blank before TTL", l}} - return - } - st = zExpectAnyNoTtl - case zExpectAnyNoTtl: - switch l.value { - case zClass: - h.Class = l.torc - st = zExpectRrtypeBl - case zRrtpe: - h.Rrtype = l.torc - st = zExpectRdata - default: - t <- &Token{Error: &ParseError{f, "expecting RR type or class, not this...", l}} - return - } - case zExpectAnyNoClass: - switch l.value { - case zString: - ttl, ok := stringToTtl(l.token) - if !ok { - t <- &Token{Error: &ParseError{f, "not a TTL", l}} - return - } - h.Ttl = ttl - // defttl = ttl // don't set the def ttl anymore - st = zExpectRrtypeBl - case zRrtpe: - h.Rrtype = l.torc - st = zExpectRdata - default: - t <- &Token{Error: &ParseError{f, "expecting RR type or TTL, not this...", l}} - return - } - case zExpectRrtypeBl: - if l.value != zBlank { - t <- &Token{Error: &ParseError{f, "no blank before RR type", l}} - return - } - st = zExpectRrtype - case zExpectRrtype: - if l.value != zRrtpe { - t <- &Token{Error: &ParseError{f, "unknown RR type", l}} - return - } - h.Rrtype = l.torc - st = zExpectRdata - case zExpectRdata: - r, e, c1 := setRR(h, c, origin, f) - if e != nil { - // If e.lex is nil than we have encounter a unknown RR type - // in that case we substitute our current lex token - if e.lex.token == "" && e.lex.value == 0 { - e.lex = l // Uh, dirty - } - t <- &Token{Error: e} - return - } - t <- &Token{RR: r, Comment: c1} - st = zExpectOwnerDir - } - } - // If we get here, we and the h.Rrtype is still zero, we haven't parsed anything, this - // is not an error, because an empty zone file is still a zone file. -} - -// zlexer scans the sourcefile and returns tokens on the channel c. -func zlexer(s *scan, c chan lex) { - var l lex - str := make([]byte, maxTok) // Should be enough for any token - stri := 0 // Offset in str (0 means empty) - com := make([]byte, maxTok) // Hold comment text - comi := 0 - quote := false - escape := false - space := false - commt := false - rrtype := false - owner := true - brace := 0 - x, err := s.tokenText() - defer close(c) - for err == nil { - l.column = s.position.Column - l.line = s.position.Line - if stri >= maxTok { - l.token = "token length insufficient for parsing" - l.err = true - debug.Printf("[%+v]", l.token) - c <- l - return - } - if comi >= maxTok { - l.token = "comment length insufficient for parsing" - l.err = true - debug.Printf("[%+v]", l.token) - c <- l - return - } - - switch x { - case ' ', '\t': - if escape { - escape = false - str[stri] = x - stri++ - break - } - if quote { - // Inside quotes this is legal - str[stri] = x - stri++ - break - } - if commt { - com[comi] = x - comi++ - break - } - if stri == 0 { - // Space directly in the beginning, handled in the grammar - } else if owner { - // If we have a string and its the first, make it an owner - l.value = zOwner - l.token = string(str[:stri]) - l.tokenUpper = strings.ToUpper(l.token) - l.length = stri - // escape $... start with a \ not a $, so this will work - switch l.tokenUpper { - case "$TTL": - l.value = zDirTtl - case "$ORIGIN": - l.value = zDirOrigin - case "$INCLUDE": - l.value = zDirInclude - case "$GENERATE": - l.value = zDirGenerate - } - debug.Printf("[7 %+v]", l.token) - c <- l - } else { - l.value = zString - l.token = string(str[:stri]) - l.tokenUpper = strings.ToUpper(l.token) - l.length = stri - if !rrtype { - if t, ok := StringToType[l.tokenUpper]; ok { - l.value = zRrtpe - l.torc = t - rrtype = true - } else { - if strings.HasPrefix(l.tokenUpper, "TYPE") { - t, ok := typeToInt(l.token) - if !ok { - l.token = "unknown RR type" - l.err = true - c <- l - return - } - l.value = zRrtpe - l.torc = t - } - } - if t, ok := StringToClass[l.tokenUpper]; ok { - l.value = zClass - l.torc = t - } else { - if strings.HasPrefix(l.tokenUpper, "CLASS") { - t, ok := classToInt(l.token) - if !ok { - l.token = "unknown class" - l.err = true - c <- l - return - } - l.value = zClass - l.torc = t - } - } - } - debug.Printf("[6 %+v]", l.token) - c <- l - } - stri = 0 - // I reverse space stuff here - if !space && !commt { - l.value = zBlank - l.token = " " - l.length = 1 - debug.Printf("[5 %+v]", l.token) - c <- l - } - owner = false - space = true - case ';': - if escape { - escape = false - str[stri] = x - stri++ - break - } - if quote { - // Inside quotes this is legal - str[stri] = x - stri++ - break - } - if stri > 0 { - l.value = zString - l.token = string(str[:stri]) - l.tokenUpper = strings.ToUpper(l.token) - l.length = stri - debug.Printf("[4 %+v]", l.token) - c <- l - stri = 0 - } - commt = true - com[comi] = ';' - comi++ - case '\r': - escape = false - if quote { - str[stri] = x - stri++ - break - } - // discard if outside of quotes - case '\n': - escape = false - // Escaped newline - if quote { - str[stri] = x - stri++ - break - } - // inside quotes this is legal - if commt { - // Reset a comment - commt = false - rrtype = false - stri = 0 - // If not in a brace this ends the comment AND the RR - if brace == 0 { - owner = true - owner = true - l.value = zNewline - l.token = "\n" - l.tokenUpper = l.token - l.length = 1 - l.comment = string(com[:comi]) - debug.Printf("[3 %+v %+v]", l.token, l.comment) - c <- l - l.comment = "" - comi = 0 - break - } - com[comi] = ' ' // convert newline to space - comi++ - break - } - - if brace == 0 { - // If there is previous text, we should output it here - if stri != 0 { - l.value = zString - l.token = string(str[:stri]) - l.tokenUpper = strings.ToUpper(l.token) - - l.length = stri - if !rrtype { - if t, ok := StringToType[l.tokenUpper]; ok { - l.value = zRrtpe - l.torc = t - rrtype = true - } - } - debug.Printf("[2 %+v]", l.token) - c <- l - } - l.value = zNewline - l.token = "\n" - l.tokenUpper = l.token - l.length = 1 - debug.Printf("[1 %+v]", l.token) - c <- l - stri = 0 - commt = false - rrtype = false - owner = true - comi = 0 - } - case '\\': - // comments do not get escaped chars, everything is copied - if commt { - com[comi] = x - comi++ - break - } - // something already escaped must be in string - if escape { - str[stri] = x - stri++ - escape = false - break - } - // something escaped outside of string gets added to string - str[stri] = x - stri++ - escape = true - case '"': - if commt { - com[comi] = x - comi++ - break - } - if escape { - str[stri] = x - stri++ - escape = false - break - } - space = false - // send previous gathered text and the quote - if stri != 0 { - l.value = zString - l.token = string(str[:stri]) - l.tokenUpper = strings.ToUpper(l.token) - l.length = stri - - debug.Printf("[%+v]", l.token) - c <- l - stri = 0 - } - - // send quote itself as separate token - l.value = zQuote - l.token = "\"" - l.tokenUpper = l.token - l.length = 1 - c <- l - quote = !quote - case '(', ')': - if commt { - com[comi] = x - comi++ - break - } - if escape { - str[stri] = x - stri++ - escape = false - break - } - if quote { - str[stri] = x - stri++ - break - } - switch x { - case ')': - brace-- - if brace < 0 { - l.token = "extra closing brace" - l.tokenUpper = l.token - l.err = true - debug.Printf("[%+v]", l.token) - c <- l - return - } - case '(': - brace++ - } - default: - escape = false - if commt { - com[comi] = x - comi++ - break - } - str[stri] = x - stri++ - space = false - } - x, err = s.tokenText() - } - if stri > 0 { - // Send remainder - l.token = string(str[:stri]) - l.tokenUpper = strings.ToUpper(l.token) - l.length = stri - l.value = zString - debug.Printf("[%+v]", l.token) - c <- l - } -} - -// Extract the class number from CLASSxx -func classToInt(token string) (uint16, bool) { - offset := 5 - if len(token) < offset+1 { - return 0, false - } - class, ok := strconv.Atoi(token[offset:]) - if ok != nil || class > maxUint16 { - return 0, false - } - return uint16(class), true -} - -// Extract the rr number from TYPExxx -func typeToInt(token string) (uint16, bool) { - offset := 4 - if len(token) < offset+1 { - return 0, false - } - typ, ok := strconv.Atoi(token[offset:]) - if ok != nil || typ > maxUint16 { - return 0, false - } - return uint16(typ), true -} - -// Parse things like 2w, 2m, etc, Return the time in seconds. -func stringToTtl(token string) (uint32, bool) { - s := uint32(0) - i := uint32(0) - for _, c := range token { - switch c { - case 's', 'S': - s += i - i = 0 - case 'm', 'M': - s += i * 60 - i = 0 - case 'h', 'H': - s += i * 60 * 60 - i = 0 - case 'd', 'D': - s += i * 60 * 60 * 24 - i = 0 - case 'w', 'W': - s += i * 60 * 60 * 24 * 7 - i = 0 - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - i *= 10 - i += uint32(c) - '0' - default: - return 0, false - } - } - return s + i, true -} - -// Parse LOC records' [.][mM] into a -// mantissa exponent format. Token should contain the entire -// string (i.e. no spaces allowed) -func stringToCm(token string) (e, m uint8, ok bool) { - if token[len(token)-1] == 'M' || token[len(token)-1] == 'm' { - token = token[0 : len(token)-1] - } - s := strings.SplitN(token, ".", 2) - var meters, cmeters, val int - var err error - switch len(s) { - case 2: - if cmeters, err = strconv.Atoi(s[1]); err != nil { - return - } - fallthrough - case 1: - if meters, err = strconv.Atoi(s[0]); err != nil { - return - } - case 0: - // huh? - return 0, 0, false - } - ok = true - if meters > 0 { - e = 2 - val = meters - } else { - e = 0 - val = cmeters - } - for val > 10 { - e++ - val /= 10 - } - if e > 9 { - ok = false - } - m = uint8(val) - return -} - -func appendOrigin(name, origin string) string { - if origin == "." { - return name + origin - } - return name + "." + origin -} - -// LOC record helper function -func locCheckNorth(token string, latitude uint32) (uint32, bool) { - switch token { - case "n", "N": - return LOC_EQUATOR + latitude, true - case "s", "S": - return LOC_EQUATOR - latitude, true - } - return latitude, false -} - -// LOC record helper function -func locCheckEast(token string, longitude uint32) (uint32, bool) { - switch token { - case "e", "E": - return LOC_EQUATOR + longitude, true - case "w", "W": - return LOC_EQUATOR - longitude, true - } - return longitude, false -} - -// "Eat" the rest of the "line". Return potential comments -func slurpRemainder(c chan lex, f string) (*ParseError, string) { - l := <-c - com := "" - switch l.value { - case zBlank: - l = <-c - com = l.comment - if l.value != zNewline && l.value != zEOF { - return &ParseError{f, "garbage after rdata", l}, "" - } - case zNewline: - com = l.comment - case zEOF: - default: - return &ParseError{f, "garbage after rdata", l}, "" - } - return nil, com -} - -// Parse a 64 bit-like ipv6 address: "0014:4fff:ff20:ee64" -// Used for NID and L64 record. -func stringToNodeID(l lex) (uint64, *ParseError) { - if len(l.token) < 19 { - return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} - } - // There must be three colons at fixes postitions, if not its a parse error - if l.token[4] != ':' && l.token[9] != ':' && l.token[14] != ':' { - return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} - } - s := l.token[0:4] + l.token[5:9] + l.token[10:14] + l.token[15:19] - u, err := strconv.ParseUint(s, 16, 64) - if err != nil { - return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} - } - return u, nil -} diff --git a/vendor/github.com/miekg/dns/scan_rr.go b/vendor/github.com/miekg/dns/scan_rr.go deleted file mode 100644 index 8d6a1bf..0000000 --- a/vendor/github.com/miekg/dns/scan_rr.go +++ /dev/null @@ -1,2171 +0,0 @@ -package dns - -import ( - "encoding/base64" - "net" - "strconv" - "strings" -) - -type parserFunc struct { - // Func defines the function that parses the tokens and returns the RR - // or an error. The last string contains any comments in the line as - // they returned by the lexer as well. - Func func(h RR_Header, c chan lex, origin string, file string) (RR, *ParseError, string) - // Signals if the RR ending is of variable length, like TXT or records - // that have Hexadecimal or Base64 as their last element in the Rdata. Records - // that have a fixed ending or for instance A, AAAA, SOA and etc. - Variable bool -} - -// Parse the rdata of each rrtype. -// All data from the channel c is either zString or zBlank. -// After the rdata there may come a zBlank and then a zNewline -// or immediately a zNewline. If this is not the case we flag -// an *ParseError: garbage after rdata. -func setRR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - parserfunc, ok := typeToparserFunc[h.Rrtype] - if ok { - r, e, cm := parserfunc.Func(h, c, o, f) - if parserfunc.Variable { - return r, e, cm - } - if e != nil { - return nil, e, "" - } - e, cm = slurpRemainder(c, f) - if e != nil { - return nil, e, "" - } - return r, nil, cm - } - // RFC3957 RR (Unknown RR handling) - return setRFC3597(h, c, o, f) -} - -// A remainder of the rdata with embedded spaces, return the parsed string (sans the spaces) -// or an error -func endingToString(c chan lex, errstr, f string) (string, *ParseError, string) { - s := "" - l := <-c // zString - for l.value != zNewline && l.value != zEOF { - if l.err { - return s, &ParseError{f, errstr, l}, "" - } - switch l.value { - case zString: - s += l.token - case zBlank: // Ok - default: - return "", &ParseError{f, errstr, l}, "" - } - l = <-c - } - return s, nil, l.comment -} - -// A remainder of the rdata with embedded spaces, split on unquoted whitespace -// and return the parsed string slice or an error -func endingToTxtSlice(c chan lex, errstr, f string) ([]string, *ParseError, string) { - // Get the remaining data until we see a zNewline - l := <-c - if l.err { - return nil, &ParseError{f, errstr, l}, "" - } - - // Build the slice - s := make([]string, 0) - quote := false - empty := false - for l.value != zNewline && l.value != zEOF { - if l.err { - return nil, &ParseError{f, errstr, l}, "" - } - switch l.value { - case zString: - empty = false - if len(l.token) > 255 { - // split up tokens that are larger than 255 into 255-chunks - sx := []string{} - p, i := 0, 255 - for { - if i <= len(l.token) { - sx = append(sx, l.token[p:i]) - } else { - sx = append(sx, l.token[p:]) - break - - } - p, i = p+255, i+255 - } - s = append(s, sx...) - break - } - - s = append(s, l.token) - case zBlank: - if quote { - // zBlank can only be seen in between txt parts. - return nil, &ParseError{f, errstr, l}, "" - } - case zQuote: - if empty && quote { - s = append(s, "") - } - quote = !quote - empty = true - default: - return nil, &ParseError{f, errstr, l}, "" - } - l = <-c - } - if quote { - return nil, &ParseError{f, errstr, l}, "" - } - return s, nil, l.comment -} - -func setA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(A) - rr.Hdr = h - - l := <-c - if l.length == 0 { // Dynamic updates. - return rr, nil, "" - } - rr.A = net.ParseIP(l.token) - if rr.A == nil || l.err { - return nil, &ParseError{f, "bad A A", l}, "" - } - return rr, nil, "" -} - -func setAAAA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(AAAA) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - rr.AAAA = net.ParseIP(l.token) - if rr.AAAA == nil || l.err { - return nil, &ParseError{f, "bad AAAA AAAA", l}, "" - } - return rr, nil, "" -} - -func setNS(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NS) - rr.Hdr = h - - l := <-c - rr.Ns = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Ns = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad NS Ns", l}, "" - } - if rr.Ns[l.length-1] != '.' { - rr.Ns = appendOrigin(rr.Ns, o) - } - return rr, nil, "" -} - -func setPTR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(PTR) - rr.Hdr = h - - l := <-c - rr.Ptr = l.token - if l.length == 0 { // dynamic update rr. - return rr, nil, "" - } - if l.token == "@" { - rr.Ptr = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad PTR Ptr", l}, "" - } - if rr.Ptr[l.length-1] != '.' { - rr.Ptr = appendOrigin(rr.Ptr, o) - } - return rr, nil, "" -} - -func setNSAPPTR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NSAPPTR) - rr.Hdr = h - - l := <-c - rr.Ptr = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Ptr = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad NSAP-PTR Ptr", l}, "" - } - if rr.Ptr[l.length-1] != '.' { - rr.Ptr = appendOrigin(rr.Ptr, o) - } - return rr, nil, "" -} - -func setRP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(RP) - rr.Hdr = h - - l := <-c - rr.Mbox = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Mbox = o - } else { - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad RP Mbox", l}, "" - } - if rr.Mbox[l.length-1] != '.' { - rr.Mbox = appendOrigin(rr.Mbox, o) - } - } - <-c // zBlank - l = <-c - rr.Txt = l.token - if l.token == "@" { - rr.Txt = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad RP Txt", l}, "" - } - if rr.Txt[l.length-1] != '.' { - rr.Txt = appendOrigin(rr.Txt, o) - } - return rr, nil, "" -} - -func setMR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(MR) - rr.Hdr = h - - l := <-c - rr.Mr = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Mr = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad MR Mr", l}, "" - } - if rr.Mr[l.length-1] != '.' { - rr.Mr = appendOrigin(rr.Mr, o) - } - return rr, nil, "" -} - -func setMB(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(MB) - rr.Hdr = h - - l := <-c - rr.Mb = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Mb = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad MB Mb", l}, "" - } - if rr.Mb[l.length-1] != '.' { - rr.Mb = appendOrigin(rr.Mb, o) - } - return rr, nil, "" -} - -func setMG(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(MG) - rr.Hdr = h - - l := <-c - rr.Mg = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Mg = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad MG Mg", l}, "" - } - if rr.Mg[l.length-1] != '.' { - rr.Mg = appendOrigin(rr.Mg, o) - } - return rr, nil, "" -} - -func setHINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(HINFO) - rr.Hdr = h - - chunks, e, c1 := endingToTxtSlice(c, "bad HINFO Fields", f) - if e != nil { - return nil, e, c1 - } - - if ln := len(chunks); ln == 0 { - return rr, nil, "" - } else if ln == 1 { - // Can we split it? - if out := strings.Fields(chunks[0]); len(out) > 1 { - chunks = out - } else { - chunks = append(chunks, "") - } - } - - rr.Cpu = chunks[0] - rr.Os = strings.Join(chunks[1:], " ") - - return rr, nil, "" -} - -func setMINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(MINFO) - rr.Hdr = h - - l := <-c - rr.Rmail = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Rmail = o - } else { - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad MINFO Rmail", l}, "" - } - if rr.Rmail[l.length-1] != '.' { - rr.Rmail = appendOrigin(rr.Rmail, o) - } - } - <-c // zBlank - l = <-c - rr.Email = l.token - if l.token == "@" { - rr.Email = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad MINFO Email", l}, "" - } - if rr.Email[l.length-1] != '.' { - rr.Email = appendOrigin(rr.Email, o) - } - return rr, nil, "" -} - -func setMF(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(MF) - rr.Hdr = h - - l := <-c - rr.Mf = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Mf = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad MF Mf", l}, "" - } - if rr.Mf[l.length-1] != '.' { - rr.Mf = appendOrigin(rr.Mf, o) - } - return rr, nil, "" -} - -func setMD(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(MD) - rr.Hdr = h - - l := <-c - rr.Md = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Md = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad MD Md", l}, "" - } - if rr.Md[l.length-1] != '.' { - rr.Md = appendOrigin(rr.Md, o) - } - return rr, nil, "" -} - -func setMX(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(MX) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad MX Pref", l}, "" - } - rr.Preference = uint16(i) - <-c // zBlank - l = <-c // zString - rr.Mx = l.token - if l.token == "@" { - rr.Mx = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad MX Mx", l}, "" - } - if rr.Mx[l.length-1] != '.' { - rr.Mx = appendOrigin(rr.Mx, o) - } - return rr, nil, "" -} - -func setRT(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(RT) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil { - return nil, &ParseError{f, "bad RT Preference", l}, "" - } - rr.Preference = uint16(i) - <-c // zBlank - l = <-c // zString - rr.Host = l.token - if l.token == "@" { - rr.Host = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad RT Host", l}, "" - } - if rr.Host[l.length-1] != '.' { - rr.Host = appendOrigin(rr.Host, o) - } - return rr, nil, "" -} - -func setAFSDB(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(AFSDB) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad AFSDB Subtype", l}, "" - } - rr.Subtype = uint16(i) - <-c // zBlank - l = <-c // zString - rr.Hostname = l.token - if l.token == "@" { - rr.Hostname = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad AFSDB Hostname", l}, "" - } - if rr.Hostname[l.length-1] != '.' { - rr.Hostname = appendOrigin(rr.Hostname, o) - } - return rr, nil, "" -} - -func setX25(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(X25) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - if l.err { - return nil, &ParseError{f, "bad X25 PSDNAddress", l}, "" - } - rr.PSDNAddress = l.token - return rr, nil, "" -} - -func setKX(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(KX) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad KX Pref", l}, "" - } - rr.Preference = uint16(i) - <-c // zBlank - l = <-c // zString - rr.Exchanger = l.token - if l.token == "@" { - rr.Exchanger = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad KX Exchanger", l}, "" - } - if rr.Exchanger[l.length-1] != '.' { - rr.Exchanger = appendOrigin(rr.Exchanger, o) - } - return rr, nil, "" -} - -func setCNAME(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(CNAME) - rr.Hdr = h - - l := <-c - rr.Target = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Target = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad CNAME Target", l}, "" - } - if rr.Target[l.length-1] != '.' { - rr.Target = appendOrigin(rr.Target, o) - } - return rr, nil, "" -} - -func setDNAME(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(DNAME) - rr.Hdr = h - - l := <-c - rr.Target = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Target = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad CNAME Target", l}, "" - } - if rr.Target[l.length-1] != '.' { - rr.Target = appendOrigin(rr.Target, o) - } - return rr, nil, "" -} - -func setSOA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(SOA) - rr.Hdr = h - - l := <-c - rr.Ns = l.token - if l.length == 0 { - return rr, nil, "" - } - <-c // zBlank - if l.token == "@" { - rr.Ns = o - } else { - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad SOA Ns", l}, "" - } - if rr.Ns[l.length-1] != '.' { - rr.Ns = appendOrigin(rr.Ns, o) - } - } - - l = <-c - rr.Mbox = l.token - if l.token == "@" { - rr.Mbox = o - } else { - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad SOA Mbox", l}, "" - } - if rr.Mbox[l.length-1] != '.' { - rr.Mbox = appendOrigin(rr.Mbox, o) - } - } - <-c // zBlank - - var ( - v uint32 - ok bool - ) - for i := 0; i < 5; i++ { - l = <-c - if l.err { - return nil, &ParseError{f, "bad SOA zone parameter", l}, "" - } - if j, e := strconv.Atoi(l.token); e != nil { - if i == 0 { - // Serial should be a number - return nil, &ParseError{f, "bad SOA zone parameter", l}, "" - } - if v, ok = stringToTtl(l.token); !ok { - return nil, &ParseError{f, "bad SOA zone parameter", l}, "" - - } - } else { - v = uint32(j) - } - switch i { - case 0: - rr.Serial = v - <-c // zBlank - case 1: - rr.Refresh = v - <-c // zBlank - case 2: - rr.Retry = v - <-c // zBlank - case 3: - rr.Expire = v - <-c // zBlank - case 4: - rr.Minttl = v - } - } - return rr, nil, "" -} - -func setSRV(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(SRV) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad SRV Priority", l}, "" - } - rr.Priority = uint16(i) - <-c // zBlank - l = <-c // zString - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad SRV Weight", l}, "" - } - rr.Weight = uint16(i) - <-c // zBlank - l = <-c // zString - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad SRV Port", l}, "" - } - rr.Port = uint16(i) - <-c // zBlank - l = <-c // zString - rr.Target = l.token - if l.token == "@" { - rr.Target = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad SRV Target", l}, "" - } - if rr.Target[l.length-1] != '.' { - rr.Target = appendOrigin(rr.Target, o) - } - return rr, nil, "" -} - -func setNAPTR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NAPTR) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NAPTR Order", l}, "" - } - rr.Order = uint16(i) - <-c // zBlank - l = <-c // zString - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NAPTR Preference", l}, "" - } - rr.Preference = uint16(i) - // Flags - <-c // zBlank - l = <-c // _QUOTE - if l.value != zQuote { - return nil, &ParseError{f, "bad NAPTR Flags", l}, "" - } - l = <-c // Either String or Quote - if l.value == zString { - rr.Flags = l.token - l = <-c // _QUOTE - if l.value != zQuote { - return nil, &ParseError{f, "bad NAPTR Flags", l}, "" - } - } else if l.value == zQuote { - rr.Flags = "" - } else { - return nil, &ParseError{f, "bad NAPTR Flags", l}, "" - } - - // Service - <-c // zBlank - l = <-c // _QUOTE - if l.value != zQuote { - return nil, &ParseError{f, "bad NAPTR Service", l}, "" - } - l = <-c // Either String or Quote - if l.value == zString { - rr.Service = l.token - l = <-c // _QUOTE - if l.value != zQuote { - return nil, &ParseError{f, "bad NAPTR Service", l}, "" - } - } else if l.value == zQuote { - rr.Service = "" - } else { - return nil, &ParseError{f, "bad NAPTR Service", l}, "" - } - - // Regexp - <-c // zBlank - l = <-c // _QUOTE - if l.value != zQuote { - return nil, &ParseError{f, "bad NAPTR Regexp", l}, "" - } - l = <-c // Either String or Quote - if l.value == zString { - rr.Regexp = l.token - l = <-c // _QUOTE - if l.value != zQuote { - return nil, &ParseError{f, "bad NAPTR Regexp", l}, "" - } - } else if l.value == zQuote { - rr.Regexp = "" - } else { - return nil, &ParseError{f, "bad NAPTR Regexp", l}, "" - } - // After quote no space?? - <-c // zBlank - l = <-c // zString - rr.Replacement = l.token - if l.token == "@" { - rr.Replacement = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad NAPTR Replacement", l}, "" - } - if rr.Replacement[l.length-1] != '.' { - rr.Replacement = appendOrigin(rr.Replacement, o) - } - return rr, nil, "" -} - -func setTALINK(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(TALINK) - rr.Hdr = h - - l := <-c - rr.PreviousName = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.PreviousName = o - } else { - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad TALINK PreviousName", l}, "" - } - if rr.PreviousName[l.length-1] != '.' { - rr.PreviousName = appendOrigin(rr.PreviousName, o) - } - } - <-c // zBlank - l = <-c - rr.NextName = l.token - if l.token == "@" { - rr.NextName = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad TALINK NextName", l}, "" - } - if rr.NextName[l.length-1] != '.' { - rr.NextName = appendOrigin(rr.NextName, o) - } - return rr, nil, "" -} - -func setLOC(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(LOC) - rr.Hdr = h - // Non zero defaults for LOC record, see RFC 1876, Section 3. - rr.HorizPre = 165 // 10000 - rr.VertPre = 162 // 10 - rr.Size = 18 // 1 - ok := false - // North - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad LOC Latitude", l}, "" - } - rr.Latitude = 1000 * 60 * 60 * uint32(i) - - <-c // zBlank - // Either number, 'N' or 'S' - l = <-c - if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok { - goto East - } - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad LOC Latitude minutes", l}, "" - } - rr.Latitude += 1000 * 60 * uint32(i) - - <-c // zBlank - l = <-c - if i, e := strconv.ParseFloat(l.token, 32); e != nil || l.err { - return nil, &ParseError{f, "bad LOC Latitude seconds", l}, "" - } else { - rr.Latitude += uint32(1000 * i) - } - <-c // zBlank - // Either number, 'N' or 'S' - l = <-c - if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok { - goto East - } - // If still alive, flag an error - return nil, &ParseError{f, "bad LOC Latitude North/South", l}, "" - -East: - // East - <-c // zBlank - l = <-c - if i, e := strconv.Atoi(l.token); e != nil || l.err { - return nil, &ParseError{f, "bad LOC Longitude", l}, "" - } else { - rr.Longitude = 1000 * 60 * 60 * uint32(i) - } - <-c // zBlank - // Either number, 'E' or 'W' - l = <-c - if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok { - goto Altitude - } - if i, e := strconv.Atoi(l.token); e != nil || l.err { - return nil, &ParseError{f, "bad LOC Longitude minutes", l}, "" - } else { - rr.Longitude += 1000 * 60 * uint32(i) - } - <-c // zBlank - l = <-c - if i, e := strconv.ParseFloat(l.token, 32); e != nil || l.err { - return nil, &ParseError{f, "bad LOC Longitude seconds", l}, "" - } else { - rr.Longitude += uint32(1000 * i) - } - <-c // zBlank - // Either number, 'E' or 'W' - l = <-c - if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok { - goto Altitude - } - // If still alive, flag an error - return nil, &ParseError{f, "bad LOC Longitude East/West", l}, "" - -Altitude: - <-c // zBlank - l = <-c - if l.length == 0 || l.err { - return nil, &ParseError{f, "bad LOC Altitude", l}, "" - } - if l.token[len(l.token)-1] == 'M' || l.token[len(l.token)-1] == 'm' { - l.token = l.token[0 : len(l.token)-1] - } - if i, e := strconv.ParseFloat(l.token, 32); e != nil { - return nil, &ParseError{f, "bad LOC Altitude", l}, "" - } else { - rr.Altitude = uint32(i*100.0 + 10000000.0 + 0.5) - } - - // And now optionally the other values - l = <-c - count := 0 - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zString: - switch count { - case 0: // Size - e, m, ok := stringToCm(l.token) - if !ok { - return nil, &ParseError{f, "bad LOC Size", l}, "" - } - rr.Size = (e & 0x0f) | (m << 4 & 0xf0) - case 1: // HorizPre - e, m, ok := stringToCm(l.token) - if !ok { - return nil, &ParseError{f, "bad LOC HorizPre", l}, "" - } - rr.HorizPre = (e & 0x0f) | (m << 4 & 0xf0) - case 2: // VertPre - e, m, ok := stringToCm(l.token) - if !ok { - return nil, &ParseError{f, "bad LOC VertPre", l}, "" - } - rr.VertPre = (e & 0x0f) | (m << 4 & 0xf0) - } - count++ - case zBlank: - // Ok - default: - return nil, &ParseError{f, "bad LOC Size, HorizPre or VertPre", l}, "" - } - l = <-c - } - return rr, nil, "" -} - -func setHIP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(HIP) - rr.Hdr = h - - // HitLength is not represented - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad HIP PublicKeyAlgorithm", l}, "" - } - rr.PublicKeyAlgorithm = uint8(i) - <-c // zBlank - l = <-c // zString - if l.length == 0 || l.err { - return nil, &ParseError{f, "bad HIP Hit", l}, "" - } - rr.Hit = l.token // This can not contain spaces, see RFC 5205 Section 6. - rr.HitLength = uint8(len(rr.Hit)) / 2 - - <-c // zBlank - l = <-c // zString - if l.length == 0 || l.err { - return nil, &ParseError{f, "bad HIP PublicKey", l}, "" - } - rr.PublicKey = l.token // This cannot contain spaces - rr.PublicKeyLength = uint16(base64.StdEncoding.DecodedLen(len(rr.PublicKey))) - - // RendezvousServers (if any) - l = <-c - var xs []string - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zString: - if l.token == "@" { - xs = append(xs, o) - l = <-c - continue - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad HIP RendezvousServers", l}, "" - } - if l.token[l.length-1] != '.' { - l.token = appendOrigin(l.token, o) - } - xs = append(xs, l.token) - case zBlank: - // Ok - default: - return nil, &ParseError{f, "bad HIP RendezvousServers", l}, "" - } - l = <-c - } - rr.RendezvousServers = xs - return rr, nil, l.comment -} - -func setCERT(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(CERT) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - if v, ok := StringToCertType[l.token]; ok { - rr.Type = v - } else if i, e := strconv.Atoi(l.token); e != nil { - return nil, &ParseError{f, "bad CERT Type", l}, "" - } else { - rr.Type = uint16(i) - } - <-c // zBlank - l = <-c // zString - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad CERT KeyTag", l}, "" - } - rr.KeyTag = uint16(i) - <-c // zBlank - l = <-c // zString - if v, ok := StringToAlgorithm[l.token]; ok { - rr.Algorithm = v - } else if i, e := strconv.Atoi(l.token); e != nil { - return nil, &ParseError{f, "bad CERT Algorithm", l}, "" - } else { - rr.Algorithm = uint8(i) - } - s, e1, c1 := endingToString(c, "bad CERT Certificate", f) - if e1 != nil { - return nil, e1, c1 - } - rr.Certificate = s - return rr, nil, c1 -} - -func setOPENPGPKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(OPENPGPKEY) - rr.Hdr = h - - s, e, c1 := endingToString(c, "bad OPENPGPKEY PublicKey", f) - if e != nil { - return nil, e, c1 - } - rr.PublicKey = s - return rr, nil, c1 -} - -func setSIG(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - r, e, s := setRRSIG(h, c, o, f) - if r != nil { - return &SIG{*r.(*RRSIG)}, e, s - } - return nil, e, s -} - -func setRRSIG(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(RRSIG) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - if t, ok := StringToType[l.tokenUpper]; !ok { - if strings.HasPrefix(l.tokenUpper, "TYPE") { - t, ok = typeToInt(l.tokenUpper) - if !ok { - return nil, &ParseError{f, "bad RRSIG Typecovered", l}, "" - } - rr.TypeCovered = t - } else { - return nil, &ParseError{f, "bad RRSIG Typecovered", l}, "" - } - } else { - rr.TypeCovered = t - } - <-c // zBlank - l = <-c - i, err := strconv.Atoi(l.token) - if err != nil || l.err { - return nil, &ParseError{f, "bad RRSIG Algorithm", l}, "" - } - rr.Algorithm = uint8(i) - <-c // zBlank - l = <-c - i, err = strconv.Atoi(l.token) - if err != nil || l.err { - return nil, &ParseError{f, "bad RRSIG Labels", l}, "" - } - rr.Labels = uint8(i) - <-c // zBlank - l = <-c - i, err = strconv.Atoi(l.token) - if err != nil || l.err { - return nil, &ParseError{f, "bad RRSIG OrigTtl", l}, "" - } - rr.OrigTtl = uint32(i) - <-c // zBlank - l = <-c - if i, err := StringToTime(l.token); err != nil { - // Try to see if all numeric and use it as epoch - if i, err := strconv.ParseInt(l.token, 10, 64); err == nil { - // TODO(miek): error out on > MAX_UINT32, same below - rr.Expiration = uint32(i) - } else { - return nil, &ParseError{f, "bad RRSIG Expiration", l}, "" - } - } else { - rr.Expiration = i - } - <-c // zBlank - l = <-c - if i, err := StringToTime(l.token); err != nil { - if i, err := strconv.ParseInt(l.token, 10, 64); err == nil { - rr.Inception = uint32(i) - } else { - return nil, &ParseError{f, "bad RRSIG Inception", l}, "" - } - } else { - rr.Inception = i - } - <-c // zBlank - l = <-c - i, err = strconv.Atoi(l.token) - if err != nil || l.err { - return nil, &ParseError{f, "bad RRSIG KeyTag", l}, "" - } - rr.KeyTag = uint16(i) - <-c // zBlank - l = <-c - rr.SignerName = l.token - if l.token == "@" { - rr.SignerName = o - } else { - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad RRSIG SignerName", l}, "" - } - if rr.SignerName[l.length-1] != '.' { - rr.SignerName = appendOrigin(rr.SignerName, o) - } - } - s, e, c1 := endingToString(c, "bad RRSIG Signature", f) - if e != nil { - return nil, e, c1 - } - rr.Signature = s - return rr, nil, c1 -} - -func setNSEC(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NSEC) - rr.Hdr = h - - l := <-c - rr.NextDomain = l.token - if l.length == 0 { - return rr, nil, l.comment - } - if l.token == "@" { - rr.NextDomain = o - } else { - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad NSEC NextDomain", l}, "" - } - if rr.NextDomain[l.length-1] != '.' { - rr.NextDomain = appendOrigin(rr.NextDomain, o) - } - } - - rr.TypeBitMap = make([]uint16, 0) - var ( - k uint16 - ok bool - ) - l = <-c - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zBlank: - // Ok - case zString: - if k, ok = StringToType[l.tokenUpper]; !ok { - if k, ok = typeToInt(l.tokenUpper); !ok { - return nil, &ParseError{f, "bad NSEC TypeBitMap", l}, "" - } - } - rr.TypeBitMap = append(rr.TypeBitMap, k) - default: - return nil, &ParseError{f, "bad NSEC TypeBitMap", l}, "" - } - l = <-c - } - return rr, nil, l.comment -} - -func setNSEC3(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NSEC3) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NSEC3 Hash", l}, "" - } - rr.Hash = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NSEC3 Flags", l}, "" - } - rr.Flags = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NSEC3 Iterations", l}, "" - } - rr.Iterations = uint16(i) - <-c - l = <-c - if len(l.token) == 0 || l.err { - return nil, &ParseError{f, "bad NSEC3 Salt", l}, "" - } - rr.SaltLength = uint8(len(l.token)) / 2 - rr.Salt = l.token - - <-c - l = <-c - if len(l.token) == 0 || l.err { - return nil, &ParseError{f, "bad NSEC3 NextDomain", l}, "" - } - rr.HashLength = 20 // Fix for NSEC3 (sha1 160 bits) - rr.NextDomain = l.token - - rr.TypeBitMap = make([]uint16, 0) - var ( - k uint16 - ok bool - ) - l = <-c - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zBlank: - // Ok - case zString: - if k, ok = StringToType[l.tokenUpper]; !ok { - if k, ok = typeToInt(l.tokenUpper); !ok { - return nil, &ParseError{f, "bad NSEC3 TypeBitMap", l}, "" - } - } - rr.TypeBitMap = append(rr.TypeBitMap, k) - default: - return nil, &ParseError{f, "bad NSEC3 TypeBitMap", l}, "" - } - l = <-c - } - return rr, nil, l.comment -} - -func setNSEC3PARAM(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NSEC3PARAM) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NSEC3PARAM Hash", l}, "" - } - rr.Hash = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NSEC3PARAM Flags", l}, "" - } - rr.Flags = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NSEC3PARAM Iterations", l}, "" - } - rr.Iterations = uint16(i) - <-c - l = <-c - rr.SaltLength = uint8(len(l.token)) - rr.Salt = l.token - return rr, nil, "" -} - -func setEUI48(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(EUI48) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - if l.length != 17 || l.err { - return nil, &ParseError{f, "bad EUI48 Address", l}, "" - } - addr := make([]byte, 12) - dash := 0 - for i := 0; i < 10; i += 2 { - addr[i] = l.token[i+dash] - addr[i+1] = l.token[i+1+dash] - dash++ - if l.token[i+1+dash] != '-' { - return nil, &ParseError{f, "bad EUI48 Address", l}, "" - } - } - addr[10] = l.token[15] - addr[11] = l.token[16] - - i, e := strconv.ParseUint(string(addr), 16, 48) - if e != nil { - return nil, &ParseError{f, "bad EUI48 Address", l}, "" - } - rr.Address = i - return rr, nil, "" -} - -func setEUI64(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(EUI64) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - if l.length != 23 || l.err { - return nil, &ParseError{f, "bad EUI64 Address", l}, "" - } - addr := make([]byte, 16) - dash := 0 - for i := 0; i < 14; i += 2 { - addr[i] = l.token[i+dash] - addr[i+1] = l.token[i+1+dash] - dash++ - if l.token[i+1+dash] != '-' { - return nil, &ParseError{f, "bad EUI64 Address", l}, "" - } - } - addr[14] = l.token[21] - addr[15] = l.token[22] - - i, e := strconv.ParseUint(string(addr), 16, 64) - if e != nil { - return nil, &ParseError{f, "bad EUI68 Address", l}, "" - } - rr.Address = uint64(i) - return rr, nil, "" -} - -func setSSHFP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(SSHFP) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad SSHFP Algorithm", l}, "" - } - rr.Algorithm = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad SSHFP Type", l}, "" - } - rr.Type = uint8(i) - <-c // zBlank - s, e1, c1 := endingToString(c, "bad SSHFP Fingerprint", f) - if e1 != nil { - return nil, e1, c1 - } - rr.FingerPrint = s - return rr, nil, "" -} - -func setDNSKEYs(h RR_Header, c chan lex, o, f, typ string) (RR, *ParseError, string) { - rr := new(DNSKEY) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad " + typ + " Flags", l}, "" - } - rr.Flags = uint16(i) - <-c // zBlank - l = <-c // zString - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad " + typ + " Protocol", l}, "" - } - rr.Protocol = uint8(i) - <-c // zBlank - l = <-c // zString - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad " + typ + " Algorithm", l}, "" - } - rr.Algorithm = uint8(i) - s, e1, c1 := endingToString(c, "bad "+typ+" PublicKey", f) - if e1 != nil { - return nil, e1, c1 - } - rr.PublicKey = s - return rr, nil, c1 -} - -func setKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - r, e, s := setDNSKEYs(h, c, o, f, "KEY") - if r != nil { - return &KEY{*r.(*DNSKEY)}, e, s - } - return nil, e, s -} - -func setDNSKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - r, e, s := setDNSKEYs(h, c, o, f, "DNSKEY") - return r, e, s -} - -func setCDNSKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - r, e, s := setDNSKEYs(h, c, o, f, "CDNSKEY") - if r != nil { - return &CDNSKEY{*r.(*DNSKEY)}, e, s - } - return nil, e, s -} - -func setRKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(RKEY) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad RKEY Flags", l}, "" - } - rr.Flags = uint16(i) - <-c // zBlank - l = <-c // zString - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad RKEY Protocol", l}, "" - } - rr.Protocol = uint8(i) - <-c // zBlank - l = <-c // zString - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad RKEY Algorithm", l}, "" - } - rr.Algorithm = uint8(i) - s, e1, c1 := endingToString(c, "bad RKEY PublicKey", f) - if e1 != nil { - return nil, e1, c1 - } - rr.PublicKey = s - return rr, nil, c1 -} - -func setEID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(EID) - rr.Hdr = h - s, e, c1 := endingToString(c, "bad EID Endpoint", f) - if e != nil { - return nil, e, c1 - } - rr.Endpoint = s - return rr, nil, c1 -} - -func setNIMLOC(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NIMLOC) - rr.Hdr = h - s, e, c1 := endingToString(c, "bad NIMLOC Locator", f) - if e != nil { - return nil, e, c1 - } - rr.Locator = s - return rr, nil, c1 -} - -func setGPOS(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(GPOS) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, "" - } - _, e := strconv.ParseFloat(l.token, 64) - if e != nil || l.err { - return nil, &ParseError{f, "bad GPOS Longitude", l}, "" - } - rr.Longitude = l.token - <-c // zBlank - l = <-c - _, e = strconv.ParseFloat(l.token, 64) - if e != nil || l.err { - return nil, &ParseError{f, "bad GPOS Latitude", l}, "" - } - rr.Latitude = l.token - <-c // zBlank - l = <-c - _, e = strconv.ParseFloat(l.token, 64) - if e != nil || l.err { - return nil, &ParseError{f, "bad GPOS Altitude", l}, "" - } - rr.Altitude = l.token - return rr, nil, "" -} - -func setDSs(h RR_Header, c chan lex, o, f, typ string) (RR, *ParseError, string) { - rr := new(DS) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad " + typ + " KeyTag", l}, "" - } - rr.KeyTag = uint16(i) - <-c // zBlank - l = <-c - if i, e := strconv.Atoi(l.token); e != nil { - i, ok := StringToAlgorithm[l.tokenUpper] - if !ok || l.err { - return nil, &ParseError{f, "bad " + typ + " Algorithm", l}, "" - } - rr.Algorithm = i - } else { - rr.Algorithm = uint8(i) - } - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad " + typ + " DigestType", l}, "" - } - rr.DigestType = uint8(i) - s, e1, c1 := endingToString(c, "bad "+typ+" Digest", f) - if e1 != nil { - return nil, e1, c1 - } - rr.Digest = s - return rr, nil, c1 -} - -func setDS(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - r, e, s := setDSs(h, c, o, f, "DS") - return r, e, s -} - -func setDLV(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - r, e, s := setDSs(h, c, o, f, "DLV") - if r != nil { - return &DLV{*r.(*DS)}, e, s - } - return nil, e, s -} - -func setCDS(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - r, e, s := setDSs(h, c, o, f, "CDS") - if r != nil { - return &CDS{*r.(*DS)}, e, s - } - return nil, e, s -} - -func setTA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(TA) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad TA KeyTag", l}, "" - } - rr.KeyTag = uint16(i) - <-c // zBlank - l = <-c - if i, e := strconv.Atoi(l.token); e != nil { - i, ok := StringToAlgorithm[l.tokenUpper] - if !ok || l.err { - return nil, &ParseError{f, "bad TA Algorithm", l}, "" - } - rr.Algorithm = i - } else { - rr.Algorithm = uint8(i) - } - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad TA DigestType", l}, "" - } - rr.DigestType = uint8(i) - s, e, c1 := endingToString(c, "bad TA Digest", f) - if e != nil { - return nil, e.(*ParseError), c1 - } - rr.Digest = s - return rr, nil, c1 -} - -func setTLSA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(TLSA) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad TLSA Usage", l}, "" - } - rr.Usage = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad TLSA Selector", l}, "" - } - rr.Selector = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad TLSA MatchingType", l}, "" - } - rr.MatchingType = uint8(i) - // So this needs be e2 (i.e. different than e), because...??t - s, e2, c1 := endingToString(c, "bad TLSA Certificate", f) - if e2 != nil { - return nil, e2, c1 - } - rr.Certificate = s - return rr, nil, c1 -} - -func setSMIMEA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(SMIMEA) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad SMIMEA Usage", l}, "" - } - rr.Usage = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad SMIMEA Selector", l}, "" - } - rr.Selector = uint8(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad SMIMEA MatchingType", l}, "" - } - rr.MatchingType = uint8(i) - // So this needs be e2 (i.e. different than e), because...??t - s, e2, c1 := endingToString(c, "bad SMIMEA Certificate", f) - if e2 != nil { - return nil, e2, c1 - } - rr.Certificate = s - return rr, nil, c1 -} - -func setRFC3597(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(RFC3597) - rr.Hdr = h - l := <-c - if l.token != "\\#" { - return nil, &ParseError{f, "bad RFC3597 Rdata", l}, "" - } - <-c // zBlank - l = <-c - rdlength, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad RFC3597 Rdata ", l}, "" - } - - s, e1, c1 := endingToString(c, "bad RFC3597 Rdata", f) - if e1 != nil { - return nil, e1, c1 - } - if rdlength*2 != len(s) { - return nil, &ParseError{f, "bad RFC3597 Rdata", l}, "" - } - rr.Rdata = s - return rr, nil, c1 -} - -func setSPF(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(SPF) - rr.Hdr = h - - s, e, c1 := endingToTxtSlice(c, "bad SPF Txt", f) - if e != nil { - return nil, e, "" - } - rr.Txt = s - return rr, nil, c1 -} - -func setTXT(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(TXT) - rr.Hdr = h - - // no zBlank reading here, because all this rdata is TXT - s, e, c1 := endingToTxtSlice(c, "bad TXT Txt", f) - if e != nil { - return nil, e, "" - } - rr.Txt = s - return rr, nil, c1 -} - -// identical to setTXT -func setNINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NINFO) - rr.Hdr = h - - s, e, c1 := endingToTxtSlice(c, "bad NINFO ZSData", f) - if e != nil { - return nil, e, "" - } - rr.ZSData = s - return rr, nil, c1 -} - -func setURI(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(URI) - rr.Hdr = h - - l := <-c - if l.length == 0 { // Dynamic updates. - return rr, nil, "" - } - - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad URI Priority", l}, "" - } - rr.Priority = uint16(i) - <-c // zBlank - l = <-c - i, e = strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad URI Weight", l}, "" - } - rr.Weight = uint16(i) - - <-c // zBlank - s, err, c1 := endingToTxtSlice(c, "bad URI Target", f) - if err != nil { - return nil, err, "" - } - if len(s) > 1 { - return nil, &ParseError{f, "bad URI Target", l}, "" - } - rr.Target = s[0] - return rr, nil, c1 -} - -func setDHCID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - // awesome record to parse! - rr := new(DHCID) - rr.Hdr = h - - s, e, c1 := endingToString(c, "bad DHCID Digest", f) - if e != nil { - return nil, e, c1 - } - rr.Digest = s - return rr, nil, c1 -} - -func setNID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(NID) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad NID Preference", l}, "" - } - rr.Preference = uint16(i) - <-c // zBlank - l = <-c // zString - u, err := stringToNodeID(l) - if err != nil || l.err { - return nil, err, "" - } - rr.NodeID = u - return rr, nil, "" -} - -func setL32(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(L32) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad L32 Preference", l}, "" - } - rr.Preference = uint16(i) - <-c // zBlank - l = <-c // zString - rr.Locator32 = net.ParseIP(l.token) - if rr.Locator32 == nil || l.err { - return nil, &ParseError{f, "bad L32 Locator", l}, "" - } - return rr, nil, "" -} - -func setLP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(LP) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad LP Preference", l}, "" - } - rr.Preference = uint16(i) - <-c // zBlank - l = <-c // zString - rr.Fqdn = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Fqdn = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad LP Fqdn", l}, "" - } - if rr.Fqdn[l.length-1] != '.' { - rr.Fqdn = appendOrigin(rr.Fqdn, o) - } - return rr, nil, "" -} - -func setL64(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(L64) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad L64 Preference", l}, "" - } - rr.Preference = uint16(i) - <-c // zBlank - l = <-c // zString - u, err := stringToNodeID(l) - if err != nil || l.err { - return nil, err, "" - } - rr.Locator64 = u - return rr, nil, "" -} - -func setUID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(UID) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad UID Uid", l}, "" - } - rr.Uid = uint32(i) - return rr, nil, "" -} - -func setGID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(GID) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad GID Gid", l}, "" - } - rr.Gid = uint32(i) - return rr, nil, "" -} - -func setUINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(UINFO) - rr.Hdr = h - s, e, c1 := endingToTxtSlice(c, "bad UINFO Uinfo", f) - if e != nil { - return nil, e, c1 - } - if ln := len(s); ln == 0 { - return rr, nil, c1 - } - rr.Uinfo = s[0] // silently discard anything after the first character-string - return rr, nil, c1 -} - -func setPX(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(PX) - rr.Hdr = h - - l := <-c - if l.length == 0 { - return rr, nil, "" - } - i, e := strconv.Atoi(l.token) - if e != nil || l.err { - return nil, &ParseError{f, "bad PX Preference", l}, "" - } - rr.Preference = uint16(i) - <-c // zBlank - l = <-c // zString - rr.Map822 = l.token - if l.length == 0 { - return rr, nil, "" - } - if l.token == "@" { - rr.Map822 = o - return rr, nil, "" - } - _, ok := IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad PX Map822", l}, "" - } - if rr.Map822[l.length-1] != '.' { - rr.Map822 = appendOrigin(rr.Map822, o) - } - <-c // zBlank - l = <-c // zString - rr.Mapx400 = l.token - if l.token == "@" { - rr.Mapx400 = o - return rr, nil, "" - } - _, ok = IsDomainName(l.token) - if !ok || l.length == 0 || l.err { - return nil, &ParseError{f, "bad PX Mapx400", l}, "" - } - if rr.Mapx400[l.length-1] != '.' { - rr.Mapx400 = appendOrigin(rr.Mapx400, o) - } - return rr, nil, "" -} - -func setCAA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { - rr := new(CAA) - rr.Hdr = h - l := <-c - if l.length == 0 { - return rr, nil, l.comment - } - i, err := strconv.Atoi(l.token) - if err != nil || l.err { - return nil, &ParseError{f, "bad CAA Flag", l}, "" - } - rr.Flag = uint8(i) - - <-c // zBlank - l = <-c // zString - if l.value != zString { - return nil, &ParseError{f, "bad CAA Tag", l}, "" - } - rr.Tag = l.token - - <-c // zBlank - s, e, c1 := endingToTxtSlice(c, "bad CAA Value", f) - if e != nil { - return nil, e, "" - } - if len(s) > 1 { - return nil, &ParseError{f, "bad CAA Value", l}, "" - } - rr.Value = s[0] - return rr, nil, c1 -} - -var typeToparserFunc = map[uint16]parserFunc{ - TypeAAAA: {setAAAA, false}, - TypeAFSDB: {setAFSDB, false}, - TypeA: {setA, false}, - TypeCAA: {setCAA, true}, - TypeCDS: {setCDS, true}, - TypeCDNSKEY: {setCDNSKEY, true}, - TypeCERT: {setCERT, true}, - TypeCNAME: {setCNAME, false}, - TypeDHCID: {setDHCID, true}, - TypeDLV: {setDLV, true}, - TypeDNAME: {setDNAME, false}, - TypeKEY: {setKEY, true}, - TypeDNSKEY: {setDNSKEY, true}, - TypeDS: {setDS, true}, - TypeEID: {setEID, true}, - TypeEUI48: {setEUI48, false}, - TypeEUI64: {setEUI64, false}, - TypeGID: {setGID, false}, - TypeGPOS: {setGPOS, false}, - TypeHINFO: {setHINFO, true}, - TypeHIP: {setHIP, true}, - TypeKX: {setKX, false}, - TypeL32: {setL32, false}, - TypeL64: {setL64, false}, - TypeLOC: {setLOC, true}, - TypeLP: {setLP, false}, - TypeMB: {setMB, false}, - TypeMD: {setMD, false}, - TypeMF: {setMF, false}, - TypeMG: {setMG, false}, - TypeMINFO: {setMINFO, false}, - TypeMR: {setMR, false}, - TypeMX: {setMX, false}, - TypeNAPTR: {setNAPTR, false}, - TypeNID: {setNID, false}, - TypeNIMLOC: {setNIMLOC, true}, - TypeNINFO: {setNINFO, true}, - TypeNSAPPTR: {setNSAPPTR, false}, - TypeNSEC3PARAM: {setNSEC3PARAM, false}, - TypeNSEC3: {setNSEC3, true}, - TypeNSEC: {setNSEC, true}, - TypeNS: {setNS, false}, - TypeOPENPGPKEY: {setOPENPGPKEY, true}, - TypePTR: {setPTR, false}, - TypePX: {setPX, false}, - TypeSIG: {setSIG, true}, - TypeRKEY: {setRKEY, true}, - TypeRP: {setRP, false}, - TypeRRSIG: {setRRSIG, true}, - TypeRT: {setRT, false}, - TypeSMIMEA: {setSMIMEA, true}, - TypeSOA: {setSOA, false}, - TypeSPF: {setSPF, true}, - TypeSRV: {setSRV, false}, - TypeSSHFP: {setSSHFP, true}, - TypeTALINK: {setTALINK, false}, - TypeTA: {setTA, true}, - TypeTLSA: {setTLSA, true}, - TypeTXT: {setTXT, true}, - TypeUID: {setUID, false}, - TypeUINFO: {setUINFO, true}, - TypeURI: {setURI, true}, - TypeX25: {setX25, false}, -} diff --git a/vendor/github.com/miekg/dns/scanner.go b/vendor/github.com/miekg/dns/scanner.go deleted file mode 100644 index c29bc2f..0000000 --- a/vendor/github.com/miekg/dns/scanner.go +++ /dev/null @@ -1,43 +0,0 @@ -package dns - -// Implement a simple scanner, return a byte stream from an io reader. - -import ( - "bufio" - "io" - "text/scanner" -) - -type scan struct { - src *bufio.Reader - position scanner.Position - eof bool // Have we just seen a eof -} - -func scanInit(r io.Reader) *scan { - s := new(scan) - s.src = bufio.NewReader(r) - s.position.Line = 1 - return s -} - -// tokenText returns the next byte from the input -func (s *scan) tokenText() (byte, error) { - c, err := s.src.ReadByte() - if err != nil { - return c, err - } - // delay the newline handling until the next token is delivered, - // fixes off-by-one errors when reporting a parse error. - if s.eof == true { - s.position.Line++ - s.position.Column = 0 - s.eof = false - } - if c == '\n' { - s.eof = true - return c, nil - } - s.position.Column++ - return c, nil -} diff --git a/vendor/github.com/miekg/dns/server.go b/vendor/github.com/miekg/dns/server.go deleted file mode 100644 index 0ca6e00..0000000 --- a/vendor/github.com/miekg/dns/server.go +++ /dev/null @@ -1,734 +0,0 @@ -// DNS server implementation. - -package dns - -import ( - "bytes" - "crypto/tls" - "encoding/binary" - "io" - "net" - "sync" - "time" -) - -// Maximum number of TCP queries before we close the socket. -const maxTCPQueries = 128 - -// Handler is implemented by any value that implements ServeDNS. -type Handler interface { - ServeDNS(w ResponseWriter, r *Msg) -} - -// A ResponseWriter interface is used by an DNS handler to -// construct an DNS response. -type ResponseWriter interface { - // LocalAddr returns the net.Addr of the server - LocalAddr() net.Addr - // RemoteAddr returns the net.Addr of the client that sent the current request. - RemoteAddr() net.Addr - // WriteMsg writes a reply back to the client. - WriteMsg(*Msg) error - // Write writes a raw buffer back to the client. - Write([]byte) (int, error) - // Close closes the connection. - Close() error - // TsigStatus returns the status of the Tsig. - TsigStatus() error - // TsigTimersOnly sets the tsig timers only boolean. - TsigTimersOnly(bool) - // Hijack lets the caller take over the connection. - // After a call to Hijack(), the DNS package will not do anything with the connection. - Hijack() -} - -type response struct { - hijacked bool // connection has been hijacked by handler - tsigStatus error - tsigTimersOnly bool - tsigRequestMAC string - tsigSecret map[string]string // the tsig secrets - udp *net.UDPConn // i/o connection if UDP was used - tcp net.Conn // i/o connection if TCP was used - udpSession *SessionUDP // oob data to get egress interface right - remoteAddr net.Addr // address of the client - writer Writer // writer to output the raw DNS bits -} - -// ServeMux is an DNS request multiplexer. It matches the -// zone name of each incoming request against a list of -// registered patterns add calls the handler for the pattern -// that most closely matches the zone name. ServeMux is DNSSEC aware, meaning -// that queries for the DS record are redirected to the parent zone (if that -// is also registered), otherwise the child gets the query. -// ServeMux is also safe for concurrent access from multiple goroutines. -type ServeMux struct { - z map[string]Handler - m *sync.RWMutex -} - -// NewServeMux allocates and returns a new ServeMux. -func NewServeMux() *ServeMux { return &ServeMux{z: make(map[string]Handler), m: new(sync.RWMutex)} } - -// DefaultServeMux is the default ServeMux used by Serve. -var DefaultServeMux = NewServeMux() - -// The HandlerFunc type is an adapter to allow the use of -// ordinary functions as DNS handlers. If f is a function -// with the appropriate signature, HandlerFunc(f) is a -// Handler object that calls f. -type HandlerFunc func(ResponseWriter, *Msg) - -// ServeDNS calls f(w, r). -func (f HandlerFunc) ServeDNS(w ResponseWriter, r *Msg) { - f(w, r) -} - -// HandleFailed returns a HandlerFunc that returns SERVFAIL for every request it gets. -func HandleFailed(w ResponseWriter, r *Msg) { - m := new(Msg) - m.SetRcode(r, RcodeServerFailure) - // does not matter if this write fails - w.WriteMsg(m) -} - -func failedHandler() Handler { return HandlerFunc(HandleFailed) } - -// ListenAndServe Starts a server on address and network specified Invoke handler -// for incoming queries. -func ListenAndServe(addr string, network string, handler Handler) error { - server := &Server{Addr: addr, Net: network, Handler: handler} - return server.ListenAndServe() -} - -// ListenAndServeTLS acts like http.ListenAndServeTLS, more information in -// http://golang.org/pkg/net/http/#ListenAndServeTLS -func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error { - cert, err := tls.LoadX509KeyPair(certFile, keyFile) - if err != nil { - return err - } - - config := tls.Config{ - Certificates: []tls.Certificate{cert}, - } - - server := &Server{ - Addr: addr, - Net: "tcp-tls", - TLSConfig: &config, - Handler: handler, - } - - return server.ListenAndServe() -} - -// ActivateAndServe activates a server with a listener from systemd, -// l and p should not both be non-nil. -// If both l and p are not nil only p will be used. -// Invoke handler for incoming queries. -func ActivateAndServe(l net.Listener, p net.PacketConn, handler Handler) error { - server := &Server{Listener: l, PacketConn: p, Handler: handler} - return server.ActivateAndServe() -} - -func (mux *ServeMux) match(q string, t uint16) Handler { - mux.m.RLock() - defer mux.m.RUnlock() - var handler Handler - b := make([]byte, len(q)) // worst case, one label of length q - off := 0 - end := false - for { - l := len(q[off:]) - for i := 0; i < l; i++ { - b[i] = q[off+i] - if b[i] >= 'A' && b[i] <= 'Z' { - b[i] |= ('a' - 'A') - } - } - if h, ok := mux.z[string(b[:l])]; ok { // causes garbage, might want to change the map key - if t != TypeDS { - return h - } - // Continue for DS to see if we have a parent too, if so delegeate to the parent - handler = h - } - off, end = NextLabel(q, off) - if end { - break - } - } - // Wildcard match, if we have found nothing try the root zone as a last resort. - if h, ok := mux.z["."]; ok { - return h - } - return handler -} - -// Handle adds a handler to the ServeMux for pattern. -func (mux *ServeMux) Handle(pattern string, handler Handler) { - if pattern == "" { - panic("dns: invalid pattern " + pattern) - } - mux.m.Lock() - mux.z[Fqdn(pattern)] = handler - mux.m.Unlock() -} - -// HandleFunc adds a handler function to the ServeMux for pattern. -func (mux *ServeMux) HandleFunc(pattern string, handler func(ResponseWriter, *Msg)) { - mux.Handle(pattern, HandlerFunc(handler)) -} - -// HandleRemove deregistrars the handler specific for pattern from the ServeMux. -func (mux *ServeMux) HandleRemove(pattern string) { - if pattern == "" { - panic("dns: invalid pattern " + pattern) - } - mux.m.Lock() - delete(mux.z, Fqdn(pattern)) - mux.m.Unlock() -} - -// ServeDNS dispatches the request to the handler whose -// pattern most closely matches the request message. If DefaultServeMux -// is used the correct thing for DS queries is done: a possible parent -// is sought. -// If no handler is found a standard SERVFAIL message is returned -// If the request message does not have exactly one question in the -// question section a SERVFAIL is returned, unlesss Unsafe is true. -func (mux *ServeMux) ServeDNS(w ResponseWriter, request *Msg) { - var h Handler - if len(request.Question) < 1 { // allow more than one question - h = failedHandler() - } else { - if h = mux.match(request.Question[0].Name, request.Question[0].Qtype); h == nil { - h = failedHandler() - } - } - h.ServeDNS(w, request) -} - -// Handle registers the handler with the given pattern -// in the DefaultServeMux. The documentation for -// ServeMux explains how patterns are matched. -func Handle(pattern string, handler Handler) { DefaultServeMux.Handle(pattern, handler) } - -// HandleRemove deregisters the handle with the given pattern -// in the DefaultServeMux. -func HandleRemove(pattern string) { DefaultServeMux.HandleRemove(pattern) } - -// HandleFunc registers the handler function with the given pattern -// in the DefaultServeMux. -func HandleFunc(pattern string, handler func(ResponseWriter, *Msg)) { - DefaultServeMux.HandleFunc(pattern, handler) -} - -// Writer writes raw DNS messages; each call to Write should send an entire message. -type Writer interface { - io.Writer -} - -// Reader reads raw DNS messages; each call to ReadTCP or ReadUDP should return an entire message. -type Reader interface { - // ReadTCP reads a raw message from a TCP connection. Implementations may alter - // connection properties, for example the read-deadline. - ReadTCP(conn net.Conn, timeout time.Duration) ([]byte, error) - // ReadUDP reads a raw message from a UDP connection. Implementations may alter - // connection properties, for example the read-deadline. - ReadUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) -} - -// defaultReader is an adapter for the Server struct that implements the Reader interface -// using the readTCP and readUDP func of the embedded Server. -type defaultReader struct { - *Server -} - -func (dr *defaultReader) ReadTCP(conn net.Conn, timeout time.Duration) ([]byte, error) { - return dr.readTCP(conn, timeout) -} - -func (dr *defaultReader) ReadUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) { - return dr.readUDP(conn, timeout) -} - -// DecorateReader is a decorator hook for extending or supplanting the functionality of a Reader. -// Implementations should never return a nil Reader. -type DecorateReader func(Reader) Reader - -// DecorateWriter is a decorator hook for extending or supplanting the functionality of a Writer. -// Implementations should never return a nil Writer. -type DecorateWriter func(Writer) Writer - -// A Server defines parameters for running an DNS server. -type Server struct { - // Address to listen on, ":dns" if empty. - Addr string - // if "tcp" or "tcp-tls" (DNS over TLS) it will invoke a TCP listener, otherwise an UDP one - Net string - // TCP Listener to use, this is to aid in systemd's socket activation. - Listener net.Listener - // TLS connection configuration - TLSConfig *tls.Config - // UDP "Listener" to use, this is to aid in systemd's socket activation. - PacketConn net.PacketConn - // Handler to invoke, dns.DefaultServeMux if nil. - Handler Handler - // Default buffer size to use to read incoming UDP messages. If not set - // it defaults to MinMsgSize (512 B). - UDPSize int - // The net.Conn.SetReadTimeout value for new connections, defaults to 2 * time.Second. - ReadTimeout time.Duration - // The net.Conn.SetWriteTimeout value for new connections, defaults to 2 * time.Second. - WriteTimeout time.Duration - // TCP idle timeout for multiple queries, if nil, defaults to 8 * time.Second (RFC 5966). - IdleTimeout func() time.Duration - // Secret(s) for Tsig map[]. - TsigSecret map[string]string - // Unsafe instructs the server to disregard any sanity checks and directly hand the message to - // the handler. It will specifically not check if the query has the QR bit not set. - Unsafe bool - // If NotifyStartedFunc is set it is called once the server has started listening. - NotifyStartedFunc func() - // DecorateReader is optional, allows customization of the process that reads raw DNS messages. - DecorateReader DecorateReader - // DecorateWriter is optional, allows customization of the process that writes raw DNS messages. - DecorateWriter DecorateWriter - - // Graceful shutdown handling - - inFlight sync.WaitGroup - - lock sync.RWMutex - started bool -} - -// ListenAndServe starts a nameserver on the configured address in *Server. -func (srv *Server) ListenAndServe() error { - srv.lock.Lock() - defer srv.lock.Unlock() - if srv.started { - return &Error{err: "server already started"} - } - addr := srv.Addr - if addr == "" { - addr = ":domain" - } - if srv.UDPSize == 0 { - srv.UDPSize = MinMsgSize - } - switch srv.Net { - case "tcp", "tcp4", "tcp6": - a, err := net.ResolveTCPAddr(srv.Net, addr) - if err != nil { - return err - } - l, err := net.ListenTCP(srv.Net, a) - if err != nil { - return err - } - srv.Listener = l - srv.started = true - srv.lock.Unlock() - err = srv.serveTCP(l) - srv.lock.Lock() // to satisfy the defer at the top - return err - case "tcp-tls", "tcp4-tls", "tcp6-tls": - network := "tcp" - if srv.Net == "tcp4-tls" { - network = "tcp4" - } else if srv.Net == "tcp6-tls" { - network = "tcp6" - } - - l, err := tls.Listen(network, addr, srv.TLSConfig) - if err != nil { - return err - } - srv.Listener = l - srv.started = true - srv.lock.Unlock() - err = srv.serveTCP(l) - srv.lock.Lock() // to satisfy the defer at the top - return err - case "udp", "udp4", "udp6": - a, err := net.ResolveUDPAddr(srv.Net, addr) - if err != nil { - return err - } - l, err := net.ListenUDP(srv.Net, a) - if err != nil { - return err - } - if e := setUDPSocketOptions(l); e != nil { - return e - } - srv.PacketConn = l - srv.started = true - srv.lock.Unlock() - err = srv.serveUDP(l) - srv.lock.Lock() // to satisfy the defer at the top - return err - } - return &Error{err: "bad network"} -} - -// ActivateAndServe starts a nameserver with the PacketConn or Listener -// configured in *Server. Its main use is to start a server from systemd. -func (srv *Server) ActivateAndServe() error { - srv.lock.Lock() - defer srv.lock.Unlock() - if srv.started { - return &Error{err: "server already started"} - } - pConn := srv.PacketConn - l := srv.Listener - if pConn != nil { - if srv.UDPSize == 0 { - srv.UDPSize = MinMsgSize - } - // Check PacketConn interface's type is valid and value - // is not nil - if t, ok := pConn.(*net.UDPConn); ok && t != nil { - if e := setUDPSocketOptions(t); e != nil { - return e - } - srv.started = true - srv.lock.Unlock() - e := srv.serveUDP(t) - srv.lock.Lock() // to satisfy the defer at the top - return e - } - } - if l != nil { - srv.started = true - srv.lock.Unlock() - e := srv.serveTCP(l) - srv.lock.Lock() // to satisfy the defer at the top - return e - } - return &Error{err: "bad listeners"} -} - -// Shutdown gracefully shuts down a server. After a call to Shutdown, ListenAndServe and -// ActivateAndServe will return. All in progress queries are completed before the server -// is taken down. If the Shutdown is taking longer than the reading timeout an error -// is returned. -func (srv *Server) Shutdown() error { - srv.lock.Lock() - if !srv.started { - srv.lock.Unlock() - return &Error{err: "server not started"} - } - srv.started = false - srv.lock.Unlock() - - if srv.PacketConn != nil { - srv.PacketConn.Close() - } - if srv.Listener != nil { - srv.Listener.Close() - } - - fin := make(chan bool) - go func() { - srv.inFlight.Wait() - fin <- true - }() - - select { - case <-time.After(srv.getReadTimeout()): - return &Error{err: "server shutdown is pending"} - case <-fin: - return nil - } -} - -// getReadTimeout is a helper func to use system timeout if server did not intend to change it. -func (srv *Server) getReadTimeout() time.Duration { - rtimeout := dnsTimeout - if srv.ReadTimeout != 0 { - rtimeout = srv.ReadTimeout - } - return rtimeout -} - -// serveTCP starts a TCP listener for the server. -// Each request is handled in a separate goroutine. -func (srv *Server) serveTCP(l net.Listener) error { - defer l.Close() - - if srv.NotifyStartedFunc != nil { - srv.NotifyStartedFunc() - } - - reader := Reader(&defaultReader{srv}) - if srv.DecorateReader != nil { - reader = srv.DecorateReader(reader) - } - - handler := srv.Handler - if handler == nil { - handler = DefaultServeMux - } - rtimeout := srv.getReadTimeout() - // deadline is not used here - for { - rw, err := l.Accept() - if err != nil { - if neterr, ok := err.(net.Error); ok && neterr.Temporary() { - continue - } - return err - } - m, err := reader.ReadTCP(rw, rtimeout) - srv.lock.RLock() - if !srv.started { - srv.lock.RUnlock() - return nil - } - srv.lock.RUnlock() - if err != nil { - continue - } - srv.inFlight.Add(1) - go srv.serve(rw.RemoteAddr(), handler, m, nil, nil, rw) - } -} - -// serveUDP starts a UDP listener for the server. -// Each request is handled in a separate goroutine. -func (srv *Server) serveUDP(l *net.UDPConn) error { - defer l.Close() - - if srv.NotifyStartedFunc != nil { - srv.NotifyStartedFunc() - } - - reader := Reader(&defaultReader{srv}) - if srv.DecorateReader != nil { - reader = srv.DecorateReader(reader) - } - - handler := srv.Handler - if handler == nil { - handler = DefaultServeMux - } - rtimeout := srv.getReadTimeout() - // deadline is not used here - for { - m, s, err := reader.ReadUDP(l, rtimeout) - srv.lock.RLock() - if !srv.started { - srv.lock.RUnlock() - return nil - } - srv.lock.RUnlock() - if err != nil { - continue - } - srv.inFlight.Add(1) - go srv.serve(s.RemoteAddr(), handler, m, l, s, nil) - } -} - -// Serve a new connection. -func (srv *Server) serve(a net.Addr, h Handler, m []byte, u *net.UDPConn, s *SessionUDP, t net.Conn) { - defer srv.inFlight.Done() - - w := &response{tsigSecret: srv.TsigSecret, udp: u, tcp: t, remoteAddr: a, udpSession: s} - if srv.DecorateWriter != nil { - w.writer = srv.DecorateWriter(w) - } else { - w.writer = w - } - - q := 0 // counter for the amount of TCP queries we get - - reader := Reader(&defaultReader{srv}) - if srv.DecorateReader != nil { - reader = srv.DecorateReader(reader) - } -Redo: - req := new(Msg) - err := req.Unpack(m) - if err != nil { // Send a FormatError back - x := new(Msg) - x.SetRcodeFormatError(req) - w.WriteMsg(x) - goto Exit - } - if !srv.Unsafe && req.Response { - goto Exit - } - - w.tsigStatus = nil - if w.tsigSecret != nil { - if t := req.IsTsig(); t != nil { - secret := t.Hdr.Name - if _, ok := w.tsigSecret[secret]; !ok { - w.tsigStatus = ErrKeyAlg - } - w.tsigStatus = TsigVerify(m, w.tsigSecret[secret], "", false) - w.tsigTimersOnly = false - w.tsigRequestMAC = req.Extra[len(req.Extra)-1].(*TSIG).MAC - } - } - h.ServeDNS(w, req) // Writes back to the client - -Exit: - if w.tcp == nil { - return - } - // TODO(miek): make this number configurable? - if q > maxTCPQueries { // close socket after this many queries - w.Close() - return - } - - if w.hijacked { - return // client calls Close() - } - if u != nil { // UDP, "close" and return - w.Close() - return - } - idleTimeout := tcpIdleTimeout - if srv.IdleTimeout != nil { - idleTimeout = srv.IdleTimeout() - } - m, err = reader.ReadTCP(w.tcp, idleTimeout) - if err == nil { - q++ - goto Redo - } - w.Close() - return -} - -func (srv *Server) readTCP(conn net.Conn, timeout time.Duration) ([]byte, error) { - conn.SetReadDeadline(time.Now().Add(timeout)) - l := make([]byte, 2) - n, err := conn.Read(l) - if err != nil || n != 2 { - if err != nil { - return nil, err - } - return nil, ErrShortRead - } - length := binary.BigEndian.Uint16(l) - if length == 0 { - return nil, ErrShortRead - } - m := make([]byte, int(length)) - n, err = conn.Read(m[:int(length)]) - if err != nil || n == 0 { - if err != nil { - return nil, err - } - return nil, ErrShortRead - } - i := n - for i < int(length) { - j, err := conn.Read(m[i:int(length)]) - if err != nil { - return nil, err - } - i += j - } - n = i - m = m[:n] - return m, nil -} - -func (srv *Server) readUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) { - conn.SetReadDeadline(time.Now().Add(timeout)) - m := make([]byte, srv.UDPSize) - n, s, err := ReadFromSessionUDP(conn, m) - if err != nil || n == 0 { - if err != nil { - return nil, nil, err - } - return nil, nil, ErrShortRead - } - m = m[:n] - return m, s, nil -} - -// WriteMsg implements the ResponseWriter.WriteMsg method. -func (w *response) WriteMsg(m *Msg) (err error) { - var data []byte - if w.tsigSecret != nil { // if no secrets, dont check for the tsig (which is a longer check) - if t := m.IsTsig(); t != nil { - data, w.tsigRequestMAC, err = TsigGenerate(m, w.tsigSecret[t.Hdr.Name], w.tsigRequestMAC, w.tsigTimersOnly) - if err != nil { - return err - } - _, err = w.writer.Write(data) - return err - } - } - data, err = m.Pack() - if err != nil { - return err - } - _, err = w.writer.Write(data) - return err -} - -// Write implements the ResponseWriter.Write method. -func (w *response) Write(m []byte) (int, error) { - switch { - case w.udp != nil: - n, err := WriteToSessionUDP(w.udp, m, w.udpSession) - return n, err - case w.tcp != nil: - lm := len(m) - if lm < 2 { - return 0, io.ErrShortBuffer - } - if lm > MaxMsgSize { - return 0, &Error{err: "message too large"} - } - l := make([]byte, 2, 2+lm) - binary.BigEndian.PutUint16(l, uint16(lm)) - m = append(l, m...) - - n, err := io.Copy(w.tcp, bytes.NewReader(m)) - return int(n), err - } - panic("not reached") -} - -// LocalAddr implements the ResponseWriter.LocalAddr method. -func (w *response) LocalAddr() net.Addr { - if w.tcp != nil { - return w.tcp.LocalAddr() - } - return w.udp.LocalAddr() -} - -// RemoteAddr implements the ResponseWriter.RemoteAddr method. -func (w *response) RemoteAddr() net.Addr { return w.remoteAddr } - -// TsigStatus implements the ResponseWriter.TsigStatus method. -func (w *response) TsigStatus() error { return w.tsigStatus } - -// TsigTimersOnly implements the ResponseWriter.TsigTimersOnly method. -func (w *response) TsigTimersOnly(b bool) { w.tsigTimersOnly = b } - -// Hijack implements the ResponseWriter.Hijack method. -func (w *response) Hijack() { w.hijacked = true } - -// Close implements the ResponseWriter.Close method -func (w *response) Close() error { - // Can't close the udp conn, as that is actually the listener. - if w.tcp != nil { - e := w.tcp.Close() - w.tcp = nil - return e - } - return nil -} diff --git a/vendor/github.com/miekg/dns/sig0.go b/vendor/github.com/miekg/dns/sig0.go deleted file mode 100644 index 2dce06a..0000000 --- a/vendor/github.com/miekg/dns/sig0.go +++ /dev/null @@ -1,219 +0,0 @@ -package dns - -import ( - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "crypto/rsa" - "encoding/binary" - "math/big" - "strings" - "time" -) - -// Sign signs a dns.Msg. It fills the signature with the appropriate data. -// The SIG record should have the SignerName, KeyTag, Algorithm, Inception -// and Expiration set. -func (rr *SIG) Sign(k crypto.Signer, m *Msg) ([]byte, error) { - if k == nil { - return nil, ErrPrivKey - } - if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { - return nil, ErrKey - } - rr.Header().Rrtype = TypeSIG - rr.Header().Class = ClassANY - rr.Header().Ttl = 0 - rr.Header().Name = "." - rr.OrigTtl = 0 - rr.TypeCovered = 0 - rr.Labels = 0 - - buf := make([]byte, m.Len()+rr.len()) - mbuf, err := m.PackBuffer(buf) - if err != nil { - return nil, err - } - if &buf[0] != &mbuf[0] { - return nil, ErrBuf - } - off, err := PackRR(rr, buf, len(mbuf), nil, false) - if err != nil { - return nil, err - } - buf = buf[:off:cap(buf)] - - hash, ok := AlgorithmToHash[rr.Algorithm] - if !ok { - return nil, ErrAlg - } - - hasher := hash.New() - // Write SIG rdata - hasher.Write(buf[len(mbuf)+1+2+2+4+2:]) - // Write message - hasher.Write(buf[:len(mbuf)]) - - signature, err := sign(k, hasher.Sum(nil), hash, rr.Algorithm) - if err != nil { - return nil, err - } - - rr.Signature = toBase64(signature) - sig := string(signature) - - buf = append(buf, sig...) - if len(buf) > int(^uint16(0)) { - return nil, ErrBuf - } - // Adjust sig data length - rdoff := len(mbuf) + 1 + 2 + 2 + 4 - rdlen := binary.BigEndian.Uint16(buf[rdoff:]) - rdlen += uint16(len(sig)) - binary.BigEndian.PutUint16(buf[rdoff:], rdlen) - // Adjust additional count - adc := binary.BigEndian.Uint16(buf[10:]) - adc++ - binary.BigEndian.PutUint16(buf[10:], adc) - return buf, nil -} - -// Verify validates the message buf using the key k. -// It's assumed that buf is a valid message from which rr was unpacked. -func (rr *SIG) Verify(k *KEY, buf []byte) error { - if k == nil { - return ErrKey - } - if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { - return ErrKey - } - - var hash crypto.Hash - switch rr.Algorithm { - case DSA, RSASHA1: - hash = crypto.SHA1 - case RSASHA256, ECDSAP256SHA256: - hash = crypto.SHA256 - case ECDSAP384SHA384: - hash = crypto.SHA384 - case RSASHA512: - hash = crypto.SHA512 - default: - return ErrAlg - } - hasher := hash.New() - - buflen := len(buf) - qdc := binary.BigEndian.Uint16(buf[4:]) - anc := binary.BigEndian.Uint16(buf[6:]) - auc := binary.BigEndian.Uint16(buf[8:]) - adc := binary.BigEndian.Uint16(buf[10:]) - offset := 12 - var err error - for i := uint16(0); i < qdc && offset < buflen; i++ { - _, offset, err = UnpackDomainName(buf, offset) - if err != nil { - return err - } - // Skip past Type and Class - offset += 2 + 2 - } - for i := uint16(1); i < anc+auc+adc && offset < buflen; i++ { - _, offset, err = UnpackDomainName(buf, offset) - if err != nil { - return err - } - // Skip past Type, Class and TTL - offset += 2 + 2 + 4 - if offset+1 >= buflen { - continue - } - var rdlen uint16 - rdlen = binary.BigEndian.Uint16(buf[offset:]) - offset += 2 - offset += int(rdlen) - } - if offset >= buflen { - return &Error{err: "overflowing unpacking signed message"} - } - - // offset should be just prior to SIG - bodyend := offset - // owner name SHOULD be root - _, offset, err = UnpackDomainName(buf, offset) - if err != nil { - return err - } - // Skip Type, Class, TTL, RDLen - offset += 2 + 2 + 4 + 2 - sigstart := offset - // Skip Type Covered, Algorithm, Labels, Original TTL - offset += 2 + 1 + 1 + 4 - if offset+4+4 >= buflen { - return &Error{err: "overflow unpacking signed message"} - } - expire := binary.BigEndian.Uint32(buf[offset:]) - offset += 4 - incept := binary.BigEndian.Uint32(buf[offset:]) - offset += 4 - now := uint32(time.Now().Unix()) - if now < incept || now > expire { - return ErrTime - } - // Skip key tag - offset += 2 - var signername string - signername, offset, err = UnpackDomainName(buf, offset) - if err != nil { - return err - } - // If key has come from the DNS name compression might - // have mangled the case of the name - if strings.ToLower(signername) != strings.ToLower(k.Header().Name) { - return &Error{err: "signer name doesn't match key name"} - } - sigend := offset - hasher.Write(buf[sigstart:sigend]) - hasher.Write(buf[:10]) - hasher.Write([]byte{ - byte((adc - 1) << 8), - byte(adc - 1), - }) - hasher.Write(buf[12:bodyend]) - - hashed := hasher.Sum(nil) - sig := buf[sigend:] - switch k.Algorithm { - case DSA: - pk := k.publicKeyDSA() - sig = sig[1:] - r := big.NewInt(0) - r.SetBytes(sig[:len(sig)/2]) - s := big.NewInt(0) - s.SetBytes(sig[len(sig)/2:]) - if pk != nil { - if dsa.Verify(pk, hashed, r, s) { - return nil - } - return ErrSig - } - case RSASHA1, RSASHA256, RSASHA512: - pk := k.publicKeyRSA() - if pk != nil { - return rsa.VerifyPKCS1v15(pk, hash, hashed, sig) - } - case ECDSAP256SHA256, ECDSAP384SHA384: - pk := k.publicKeyECDSA() - r := big.NewInt(0) - r.SetBytes(sig[:len(sig)/2]) - s := big.NewInt(0) - s.SetBytes(sig[len(sig)/2:]) - if pk != nil { - if ecdsa.Verify(pk, hashed, r, s) { - return nil - } - return ErrSig - } - } - return ErrKeyAlg -} diff --git a/vendor/github.com/miekg/dns/singleinflight.go b/vendor/github.com/miekg/dns/singleinflight.go deleted file mode 100644 index 9573c7d..0000000 --- a/vendor/github.com/miekg/dns/singleinflight.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Adapted for dns package usage by Miek Gieben. - -package dns - -import "sync" -import "time" - -// call is an in-flight or completed singleflight.Do call -type call struct { - wg sync.WaitGroup - val *Msg - rtt time.Duration - err error - dups int -} - -// singleflight represents a class of work and forms a namespace in -// which units of work can be executed with duplicate suppression. -type singleflight struct { - sync.Mutex // protects m - m map[string]*call // lazily initialized -} - -// Do executes and returns the results of the given function, making -// sure that only one execution is in-flight for a given key at a -// time. If a duplicate comes in, the duplicate caller waits for the -// original to complete and receives the same results. -// The return value shared indicates whether v was given to multiple callers. -func (g *singleflight) Do(key string, fn func() (*Msg, time.Duration, error)) (v *Msg, rtt time.Duration, err error, shared bool) { - g.Lock() - if g.m == nil { - g.m = make(map[string]*call) - } - if c, ok := g.m[key]; ok { - c.dups++ - g.Unlock() - c.wg.Wait() - return c.val, c.rtt, c.err, true - } - c := new(call) - c.wg.Add(1) - g.m[key] = c - g.Unlock() - - c.val, c.rtt, c.err = fn() - c.wg.Done() - - g.Lock() - delete(g.m, key) - g.Unlock() - - return c.val, c.rtt, c.err, c.dups > 0 -} diff --git a/vendor/github.com/miekg/dns/smimea.go b/vendor/github.com/miekg/dns/smimea.go deleted file mode 100644 index 3a4bb57..0000000 --- a/vendor/github.com/miekg/dns/smimea.go +++ /dev/null @@ -1,47 +0,0 @@ -package dns - -import ( - "crypto/sha256" - "crypto/x509" - "encoding/hex" -) - -// Sign creates a SMIMEA record from an SSL certificate. -func (r *SMIMEA) Sign(usage, selector, matchingType int, cert *x509.Certificate) (err error) { - r.Hdr.Rrtype = TypeSMIMEA - r.Usage = uint8(usage) - r.Selector = uint8(selector) - r.MatchingType = uint8(matchingType) - - r.Certificate, err = CertificateToDANE(r.Selector, r.MatchingType, cert) - if err != nil { - return err - } - return nil -} - -// Verify verifies a SMIMEA record against an SSL certificate. If it is OK -// a nil error is returned. -func (r *SMIMEA) Verify(cert *x509.Certificate) error { - c, err := CertificateToDANE(r.Selector, r.MatchingType, cert) - if err != nil { - return err // Not also ErrSig? - } - if r.Certificate == c { - return nil - } - return ErrSig // ErrSig, really? -} - -// SIMEAName returns the ownername of a SMIMEA resource record as per the -// format specified in RFC 'draft-ietf-dane-smime-12' Section 2 and 3 -func SMIMEAName(email_address string, domain_name string) (string, error) { - hasher := sha256.New() - hasher.Write([]byte(email_address)) - - // RFC Section 3: "The local-part is hashed using the SHA2-256 - // algorithm with the hash truncated to 28 octets and - // represented in its hexadecimal representation to become the - // left-most label in the prepared domain name" - return hex.EncodeToString(hasher.Sum(nil)[:28]) + "." + "_smimecert." + domain_name, nil -} diff --git a/vendor/github.com/miekg/dns/tlsa.go b/vendor/github.com/miekg/dns/tlsa.go deleted file mode 100644 index 431e2fb..0000000 --- a/vendor/github.com/miekg/dns/tlsa.go +++ /dev/null @@ -1,47 +0,0 @@ -package dns - -import ( - "crypto/x509" - "net" - "strconv" -) - -// Sign creates a TLSA record from an SSL certificate. -func (r *TLSA) Sign(usage, selector, matchingType int, cert *x509.Certificate) (err error) { - r.Hdr.Rrtype = TypeTLSA - r.Usage = uint8(usage) - r.Selector = uint8(selector) - r.MatchingType = uint8(matchingType) - - r.Certificate, err = CertificateToDANE(r.Selector, r.MatchingType, cert) - if err != nil { - return err - } - return nil -} - -// Verify verifies a TLSA record against an SSL certificate. If it is OK -// a nil error is returned. -func (r *TLSA) Verify(cert *x509.Certificate) error { - c, err := CertificateToDANE(r.Selector, r.MatchingType, cert) - if err != nil { - return err // Not also ErrSig? - } - if r.Certificate == c { - return nil - } - return ErrSig // ErrSig, really? -} - -// TLSAName returns the ownername of a TLSA resource record as per the -// rules specified in RFC 6698, Section 3. -func TLSAName(name, service, network string) (string, error) { - if !IsFqdn(name) { - return "", ErrFqdn - } - p, err := net.LookupPort(network, service) - if err != nil { - return "", err - } - return "_" + strconv.Itoa(p) + "._" + network + "." + name, nil -} diff --git a/vendor/github.com/miekg/dns/tsig.go b/vendor/github.com/miekg/dns/tsig.go deleted file mode 100644 index 78365e1..0000000 --- a/vendor/github.com/miekg/dns/tsig.go +++ /dev/null @@ -1,384 +0,0 @@ -package dns - -import ( - "crypto/hmac" - "crypto/md5" - "crypto/sha1" - "crypto/sha256" - "crypto/sha512" - "encoding/binary" - "encoding/hex" - "hash" - "io" - "strconv" - "strings" - "time" -) - -// HMAC hashing codes. These are transmitted as domain names. -const ( - HmacMD5 = "hmac-md5.sig-alg.reg.int." - HmacSHA1 = "hmac-sha1." - HmacSHA256 = "hmac-sha256." - HmacSHA512 = "hmac-sha512." -) - -// TSIG is the RR the holds the transaction signature of a message. -// See RFC 2845 and RFC 4635. -type TSIG struct { - Hdr RR_Header - Algorithm string `dns:"domain-name"` - TimeSigned uint64 `dns:"uint48"` - Fudge uint16 - MACSize uint16 - MAC string `dns:"size-hex:MACSize"` - OrigId uint16 - Error uint16 - OtherLen uint16 - OtherData string `dns:"size-hex:OtherLen"` -} - -// TSIG has no official presentation format, but this will suffice. - -func (rr *TSIG) String() string { - s := "\n;; TSIG PSEUDOSECTION:\n" - s += rr.Hdr.String() + - " " + rr.Algorithm + - " " + tsigTimeToString(rr.TimeSigned) + - " " + strconv.Itoa(int(rr.Fudge)) + - " " + strconv.Itoa(int(rr.MACSize)) + - " " + strings.ToUpper(rr.MAC) + - " " + strconv.Itoa(int(rr.OrigId)) + - " " + strconv.Itoa(int(rr.Error)) + // BIND prints NOERROR - " " + strconv.Itoa(int(rr.OtherLen)) + - " " + rr.OtherData - return s -} - -// The following values must be put in wireformat, so that the MAC can be calculated. -// RFC 2845, section 3.4.2. TSIG Variables. -type tsigWireFmt struct { - // From RR_Header - Name string `dns:"domain-name"` - Class uint16 - Ttl uint32 - // Rdata of the TSIG - Algorithm string `dns:"domain-name"` - TimeSigned uint64 `dns:"uint48"` - Fudge uint16 - // MACSize, MAC and OrigId excluded - Error uint16 - OtherLen uint16 - OtherData string `dns:"size-hex:OtherLen"` -} - -// If we have the MAC use this type to convert it to wiredata. Section 3.4.3. Request MAC -type macWireFmt struct { - MACSize uint16 - MAC string `dns:"size-hex:MACSize"` -} - -// 3.3. Time values used in TSIG calculations -type timerWireFmt struct { - TimeSigned uint64 `dns:"uint48"` - Fudge uint16 -} - -// TsigGenerate fills out the TSIG record attached to the message. -// The message should contain -// a "stub" TSIG RR with the algorithm, key name (owner name of the RR), -// time fudge (defaults to 300 seconds) and the current time -// The TSIG MAC is saved in that Tsig RR. -// When TsigGenerate is called for the first time requestMAC is set to the empty string and -// timersOnly is false. -// If something goes wrong an error is returned, otherwise it is nil. -func TsigGenerate(m *Msg, secret, requestMAC string, timersOnly bool) ([]byte, string, error) { - if m.IsTsig() == nil { - panic("dns: TSIG not last RR in additional") - } - // If we barf here, the caller is to blame - rawsecret, err := fromBase64([]byte(secret)) - if err != nil { - return nil, "", err - } - - rr := m.Extra[len(m.Extra)-1].(*TSIG) - m.Extra = m.Extra[0 : len(m.Extra)-1] // kill the TSIG from the msg - mbuf, err := m.Pack() - if err != nil { - return nil, "", err - } - buf := tsigBuffer(mbuf, rr, requestMAC, timersOnly) - - t := new(TSIG) - var h hash.Hash - switch strings.ToLower(rr.Algorithm) { - case HmacMD5: - h = hmac.New(md5.New, []byte(rawsecret)) - case HmacSHA1: - h = hmac.New(sha1.New, []byte(rawsecret)) - case HmacSHA256: - h = hmac.New(sha256.New, []byte(rawsecret)) - case HmacSHA512: - h = hmac.New(sha512.New, []byte(rawsecret)) - default: - return nil, "", ErrKeyAlg - } - io.WriteString(h, string(buf)) - t.MAC = hex.EncodeToString(h.Sum(nil)) - t.MACSize = uint16(len(t.MAC) / 2) // Size is half! - - t.Hdr = RR_Header{Name: rr.Hdr.Name, Rrtype: TypeTSIG, Class: ClassANY, Ttl: 0} - t.Fudge = rr.Fudge - t.TimeSigned = rr.TimeSigned - t.Algorithm = rr.Algorithm - t.OrigId = m.Id - - tbuf := make([]byte, t.len()) - if off, err := PackRR(t, tbuf, 0, nil, false); err == nil { - tbuf = tbuf[:off] // reset to actual size used - } else { - return nil, "", err - } - mbuf = append(mbuf, tbuf...) - // Update the ArCount directly in the buffer. - binary.BigEndian.PutUint16(mbuf[10:], uint16(len(m.Extra)+1)) - - return mbuf, t.MAC, nil -} - -// TsigVerify verifies the TSIG on a message. -// If the signature does not validate err contains the -// error, otherwise it is nil. -func TsigVerify(msg []byte, secret, requestMAC string, timersOnly bool) error { - rawsecret, err := fromBase64([]byte(secret)) - if err != nil { - return err - } - // Strip the TSIG from the incoming msg - stripped, tsig, err := stripTsig(msg) - if err != nil { - return err - } - - msgMAC, err := hex.DecodeString(tsig.MAC) - if err != nil { - return err - } - - buf := tsigBuffer(stripped, tsig, requestMAC, timersOnly) - - // Fudge factor works both ways. A message can arrive before it was signed because - // of clock skew. - now := uint64(time.Now().Unix()) - ti := now - tsig.TimeSigned - if now < tsig.TimeSigned { - ti = tsig.TimeSigned - now - } - if uint64(tsig.Fudge) < ti { - return ErrTime - } - - var h hash.Hash - switch strings.ToLower(tsig.Algorithm) { - case HmacMD5: - h = hmac.New(md5.New, rawsecret) - case HmacSHA1: - h = hmac.New(sha1.New, rawsecret) - case HmacSHA256: - h = hmac.New(sha256.New, rawsecret) - case HmacSHA512: - h = hmac.New(sha512.New, rawsecret) - default: - return ErrKeyAlg - } - h.Write(buf) - if !hmac.Equal(h.Sum(nil), msgMAC) { - return ErrSig - } - return nil -} - -// Create a wiredata buffer for the MAC calculation. -func tsigBuffer(msgbuf []byte, rr *TSIG, requestMAC string, timersOnly bool) []byte { - var buf []byte - if rr.TimeSigned == 0 { - rr.TimeSigned = uint64(time.Now().Unix()) - } - if rr.Fudge == 0 { - rr.Fudge = 300 // Standard (RFC) default. - } - - if requestMAC != "" { - m := new(macWireFmt) - m.MACSize = uint16(len(requestMAC) / 2) - m.MAC = requestMAC - buf = make([]byte, len(requestMAC)) // long enough - n, _ := packMacWire(m, buf) - buf = buf[:n] - } - - tsigvar := make([]byte, DefaultMsgSize) - if timersOnly { - tsig := new(timerWireFmt) - tsig.TimeSigned = rr.TimeSigned - tsig.Fudge = rr.Fudge - n, _ := packTimerWire(tsig, tsigvar) - tsigvar = tsigvar[:n] - } else { - tsig := new(tsigWireFmt) - tsig.Name = strings.ToLower(rr.Hdr.Name) - tsig.Class = ClassANY - tsig.Ttl = rr.Hdr.Ttl - tsig.Algorithm = strings.ToLower(rr.Algorithm) - tsig.TimeSigned = rr.TimeSigned - tsig.Fudge = rr.Fudge - tsig.Error = rr.Error - tsig.OtherLen = rr.OtherLen - tsig.OtherData = rr.OtherData - n, _ := packTsigWire(tsig, tsigvar) - tsigvar = tsigvar[:n] - } - - if requestMAC != "" { - x := append(buf, msgbuf...) - buf = append(x, tsigvar...) - } else { - buf = append(msgbuf, tsigvar...) - } - return buf -} - -// Strip the TSIG from the raw message. -func stripTsig(msg []byte) ([]byte, *TSIG, error) { - // Copied from msg.go's Unpack() Header, but modified. - var ( - dh Header - err error - ) - off, tsigoff := 0, 0 - - if dh, off, err = unpackMsgHdr(msg, off); err != nil { - return nil, nil, err - } - if dh.Arcount == 0 { - return nil, nil, ErrNoSig - } - - // Rcode, see msg.go Unpack() - if int(dh.Bits&0xF) == RcodeNotAuth { - return nil, nil, ErrAuth - } - - for i := 0; i < int(dh.Qdcount); i++ { - _, off, err = unpackQuestion(msg, off) - if err != nil { - return nil, nil, err - } - } - - _, off, err = unpackRRslice(int(dh.Ancount), msg, off) - if err != nil { - return nil, nil, err - } - _, off, err = unpackRRslice(int(dh.Nscount), msg, off) - if err != nil { - return nil, nil, err - } - - rr := new(TSIG) - var extra RR - for i := 0; i < int(dh.Arcount); i++ { - tsigoff = off - extra, off, err = UnpackRR(msg, off) - if err != nil { - return nil, nil, err - } - if extra.Header().Rrtype == TypeTSIG { - rr = extra.(*TSIG) - // Adjust Arcount. - arcount := binary.BigEndian.Uint16(msg[10:]) - binary.BigEndian.PutUint16(msg[10:], arcount-1) - break - } - } - if rr == nil { - return nil, nil, ErrNoSig - } - return msg[:tsigoff], rr, nil -} - -// Translate the TSIG time signed into a date. There is no -// need for RFC1982 calculations as this date is 48 bits. -func tsigTimeToString(t uint64) string { - ti := time.Unix(int64(t), 0).UTC() - return ti.Format("20060102150405") -} - -func packTsigWire(tw *tsigWireFmt, msg []byte) (int, error) { - // copied from zmsg.go TSIG packing - // RR_Header - off, err := PackDomainName(tw.Name, msg, 0, nil, false) - if err != nil { - return off, err - } - off, err = packUint16(tw.Class, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(tw.Ttl, msg, off) - if err != nil { - return off, err - } - - off, err = PackDomainName(tw.Algorithm, msg, off, nil, false) - if err != nil { - return off, err - } - off, err = packUint48(tw.TimeSigned, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(tw.Fudge, msg, off) - if err != nil { - return off, err - } - - off, err = packUint16(tw.Error, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(tw.OtherLen, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(tw.OtherData, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func packMacWire(mw *macWireFmt, msg []byte) (int, error) { - off, err := packUint16(mw.MACSize, msg, 0) - if err != nil { - return off, err - } - off, err = packStringHex(mw.MAC, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func packTimerWire(tw *timerWireFmt, msg []byte) (int, error) { - off, err := packUint48(tw.TimeSigned, msg, 0) - if err != nil { - return off, err - } - off, err = packUint16(tw.Fudge, msg, off) - if err != nil { - return off, err - } - return off, nil -} diff --git a/vendor/github.com/miekg/dns/types.go b/vendor/github.com/miekg/dns/types.go deleted file mode 100644 index c8b3191..0000000 --- a/vendor/github.com/miekg/dns/types.go +++ /dev/null @@ -1,1279 +0,0 @@ -package dns - -import ( - "fmt" - "net" - "strconv" - "strings" - "time" -) - -type ( - // Type is a DNS type. - Type uint16 - // Class is a DNS class. - Class uint16 - // Name is a DNS domain name. - Name string -) - -// Packet formats - -// Wire constants and supported types. -const ( - // valid RR_Header.Rrtype and Question.qtype - - TypeNone uint16 = 0 - TypeA uint16 = 1 - TypeNS uint16 = 2 - TypeMD uint16 = 3 - TypeMF uint16 = 4 - TypeCNAME uint16 = 5 - TypeSOA uint16 = 6 - TypeMB uint16 = 7 - TypeMG uint16 = 8 - TypeMR uint16 = 9 - TypeNULL uint16 = 10 - TypePTR uint16 = 12 - TypeHINFO uint16 = 13 - TypeMINFO uint16 = 14 - TypeMX uint16 = 15 - TypeTXT uint16 = 16 - TypeRP uint16 = 17 - TypeAFSDB uint16 = 18 - TypeX25 uint16 = 19 - TypeISDN uint16 = 20 - TypeRT uint16 = 21 - TypeNSAPPTR uint16 = 23 - TypeSIG uint16 = 24 - TypeKEY uint16 = 25 - TypePX uint16 = 26 - TypeGPOS uint16 = 27 - TypeAAAA uint16 = 28 - TypeLOC uint16 = 29 - TypeNXT uint16 = 30 - TypeEID uint16 = 31 - TypeNIMLOC uint16 = 32 - TypeSRV uint16 = 33 - TypeATMA uint16 = 34 - TypeNAPTR uint16 = 35 - TypeKX uint16 = 36 - TypeCERT uint16 = 37 - TypeDNAME uint16 = 39 - TypeOPT uint16 = 41 // EDNS - TypeDS uint16 = 43 - TypeSSHFP uint16 = 44 - TypeRRSIG uint16 = 46 - TypeNSEC uint16 = 47 - TypeDNSKEY uint16 = 48 - TypeDHCID uint16 = 49 - TypeNSEC3 uint16 = 50 - TypeNSEC3PARAM uint16 = 51 - TypeTLSA uint16 = 52 - TypeSMIMEA uint16 = 53 - TypeHIP uint16 = 55 - TypeNINFO uint16 = 56 - TypeRKEY uint16 = 57 - TypeTALINK uint16 = 58 - TypeCDS uint16 = 59 - TypeCDNSKEY uint16 = 60 - TypeOPENPGPKEY uint16 = 61 - TypeSPF uint16 = 99 - TypeUINFO uint16 = 100 - TypeUID uint16 = 101 - TypeGID uint16 = 102 - TypeUNSPEC uint16 = 103 - TypeNID uint16 = 104 - TypeL32 uint16 = 105 - TypeL64 uint16 = 106 - TypeLP uint16 = 107 - TypeEUI48 uint16 = 108 - TypeEUI64 uint16 = 109 - TypeURI uint16 = 256 - TypeCAA uint16 = 257 - - TypeTKEY uint16 = 249 - TypeTSIG uint16 = 250 - - // valid Question.Qtype only - TypeIXFR uint16 = 251 - TypeAXFR uint16 = 252 - TypeMAILB uint16 = 253 - TypeMAILA uint16 = 254 - TypeANY uint16 = 255 - - TypeTA uint16 = 32768 - TypeDLV uint16 = 32769 - TypeReserved uint16 = 65535 - - // valid Question.Qclass - ClassINET = 1 - ClassCSNET = 2 - ClassCHAOS = 3 - ClassHESIOD = 4 - ClassNONE = 254 - ClassANY = 255 - - // Message Response Codes. - RcodeSuccess = 0 - RcodeFormatError = 1 - RcodeServerFailure = 2 - RcodeNameError = 3 - RcodeNotImplemented = 4 - RcodeRefused = 5 - RcodeYXDomain = 6 - RcodeYXRrset = 7 - RcodeNXRrset = 8 - RcodeNotAuth = 9 - RcodeNotZone = 10 - RcodeBadSig = 16 // TSIG - RcodeBadVers = 16 // EDNS0 - RcodeBadKey = 17 - RcodeBadTime = 18 - RcodeBadMode = 19 // TKEY - RcodeBadName = 20 - RcodeBadAlg = 21 - RcodeBadTrunc = 22 // TSIG - RcodeBadCookie = 23 // DNS Cookies - - // Message Opcodes. There is no 3. - OpcodeQuery = 0 - OpcodeIQuery = 1 - OpcodeStatus = 2 - OpcodeNotify = 4 - OpcodeUpdate = 5 -) - -// Headers is the wire format for the DNS packet header. -type Header struct { - Id uint16 - Bits uint16 - Qdcount, Ancount, Nscount, Arcount uint16 -} - -const ( - headerSize = 12 - - // Header.Bits - _QR = 1 << 15 // query/response (response=1) - _AA = 1 << 10 // authoritative - _TC = 1 << 9 // truncated - _RD = 1 << 8 // recursion desired - _RA = 1 << 7 // recursion available - _Z = 1 << 6 // Z - _AD = 1 << 5 // authticated data - _CD = 1 << 4 // checking disabled - - LOC_EQUATOR = 1 << 31 // RFC 1876, Section 2. - LOC_PRIMEMERIDIAN = 1 << 31 // RFC 1876, Section 2. - - LOC_HOURS = 60 * 1000 - LOC_DEGREES = 60 * LOC_HOURS - - LOC_ALTITUDEBASE = 100000 -) - -// Different Certificate Types, see RFC 4398, Section 2.1 -const ( - CertPKIX = 1 + iota - CertSPKI - CertPGP - CertIPIX - CertISPKI - CertIPGP - CertACPKIX - CertIACPKIX - CertURI = 253 - CertOID = 254 -) - -// CertTypeToString converts the Cert Type to its string representation. -// See RFC 4398 and RFC 6944. -var CertTypeToString = map[uint16]string{ - CertPKIX: "PKIX", - CertSPKI: "SPKI", - CertPGP: "PGP", - CertIPIX: "IPIX", - CertISPKI: "ISPKI", - CertIPGP: "IPGP", - CertACPKIX: "ACPKIX", - CertIACPKIX: "IACPKIX", - CertURI: "URI", - CertOID: "OID", -} - -// StringToCertType is the reverseof CertTypeToString. -var StringToCertType = reverseInt16(CertTypeToString) - -//go:generate go run types_generate.go - -// Question holds a DNS question. There can be multiple questions in the -// question section of a message. Usually there is just one. -type Question struct { - Name string `dns:"cdomain-name"` // "cdomain-name" specifies encoding (and may be compressed) - Qtype uint16 - Qclass uint16 -} - -func (q *Question) len() int { - return len(q.Name) + 1 + 2 + 2 -} - -func (q *Question) String() (s string) { - // prefix with ; (as in dig) - s = ";" + sprintName(q.Name) + "\t" - s += Class(q.Qclass).String() + "\t" - s += " " + Type(q.Qtype).String() - return s -} - -// ANY is a wildcard record. See RFC 1035, Section 3.2.3. ANY -// is named "*" there. -type ANY struct { - Hdr RR_Header - // Does not have any rdata -} - -func (rr *ANY) String() string { return rr.Hdr.String() } - -type CNAME struct { - Hdr RR_Header - Target string `dns:"cdomain-name"` -} - -func (rr *CNAME) String() string { return rr.Hdr.String() + sprintName(rr.Target) } - -type HINFO struct { - Hdr RR_Header - Cpu string - Os string -} - -func (rr *HINFO) String() string { - return rr.Hdr.String() + sprintTxt([]string{rr.Cpu, rr.Os}) -} - -type MB struct { - Hdr RR_Header - Mb string `dns:"cdomain-name"` -} - -func (rr *MB) String() string { return rr.Hdr.String() + sprintName(rr.Mb) } - -type MG struct { - Hdr RR_Header - Mg string `dns:"cdomain-name"` -} - -func (rr *MG) String() string { return rr.Hdr.String() + sprintName(rr.Mg) } - -type MINFO struct { - Hdr RR_Header - Rmail string `dns:"cdomain-name"` - Email string `dns:"cdomain-name"` -} - -func (rr *MINFO) String() string { - return rr.Hdr.String() + sprintName(rr.Rmail) + " " + sprintName(rr.Email) -} - -type MR struct { - Hdr RR_Header - Mr string `dns:"cdomain-name"` -} - -func (rr *MR) String() string { - return rr.Hdr.String() + sprintName(rr.Mr) -} - -type MF struct { - Hdr RR_Header - Mf string `dns:"cdomain-name"` -} - -func (rr *MF) String() string { - return rr.Hdr.String() + sprintName(rr.Mf) -} - -type MD struct { - Hdr RR_Header - Md string `dns:"cdomain-name"` -} - -func (rr *MD) String() string { - return rr.Hdr.String() + sprintName(rr.Md) -} - -type MX struct { - Hdr RR_Header - Preference uint16 - Mx string `dns:"cdomain-name"` -} - -func (rr *MX) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Mx) -} - -type AFSDB struct { - Hdr RR_Header - Subtype uint16 - Hostname string `dns:"cdomain-name"` -} - -func (rr *AFSDB) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Subtype)) + " " + sprintName(rr.Hostname) -} - -type X25 struct { - Hdr RR_Header - PSDNAddress string -} - -func (rr *X25) String() string { - return rr.Hdr.String() + rr.PSDNAddress -} - -type RT struct { - Hdr RR_Header - Preference uint16 - Host string `dns:"cdomain-name"` -} - -func (rr *RT) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Host) -} - -type NS struct { - Hdr RR_Header - Ns string `dns:"cdomain-name"` -} - -func (rr *NS) String() string { - return rr.Hdr.String() + sprintName(rr.Ns) -} - -type PTR struct { - Hdr RR_Header - Ptr string `dns:"cdomain-name"` -} - -func (rr *PTR) String() string { - return rr.Hdr.String() + sprintName(rr.Ptr) -} - -type RP struct { - Hdr RR_Header - Mbox string `dns:"domain-name"` - Txt string `dns:"domain-name"` -} - -func (rr *RP) String() string { - return rr.Hdr.String() + rr.Mbox + " " + sprintTxt([]string{rr.Txt}) -} - -type SOA struct { - Hdr RR_Header - Ns string `dns:"cdomain-name"` - Mbox string `dns:"cdomain-name"` - Serial uint32 - Refresh uint32 - Retry uint32 - Expire uint32 - Minttl uint32 -} - -func (rr *SOA) String() string { - return rr.Hdr.String() + sprintName(rr.Ns) + " " + sprintName(rr.Mbox) + - " " + strconv.FormatInt(int64(rr.Serial), 10) + - " " + strconv.FormatInt(int64(rr.Refresh), 10) + - " " + strconv.FormatInt(int64(rr.Retry), 10) + - " " + strconv.FormatInt(int64(rr.Expire), 10) + - " " + strconv.FormatInt(int64(rr.Minttl), 10) -} - -type TXT struct { - Hdr RR_Header - Txt []string `dns:"txt"` -} - -func (rr *TXT) String() string { return rr.Hdr.String() + sprintTxt(rr.Txt) } - -func sprintName(s string) string { - src := []byte(s) - dst := make([]byte, 0, len(src)) - for i := 0; i < len(src); { - if i+1 < len(src) && src[i] == '\\' && src[i+1] == '.' { - dst = append(dst, src[i:i+2]...) - i += 2 - } else { - b, n := nextByte(src, i) - if n == 0 { - i++ // dangling back slash - } else if b == '.' { - dst = append(dst, b) - } else { - dst = appendDomainNameByte(dst, b) - } - i += n - } - } - return string(dst) -} - -func sprintTxtOctet(s string) string { - src := []byte(s) - dst := make([]byte, 0, len(src)) - dst = append(dst, '"') - for i := 0; i < len(src); { - if i+1 < len(src) && src[i] == '\\' && src[i+1] == '.' { - dst = append(dst, src[i:i+2]...) - i += 2 - } else { - b, n := nextByte(src, i) - if n == 0 { - i++ // dangling back slash - } else if b == '.' { - dst = append(dst, b) - } else { - if b < ' ' || b > '~' { - dst = appendByte(dst, b) - } else { - dst = append(dst, b) - } - } - i += n - } - } - dst = append(dst, '"') - return string(dst) -} - -func sprintTxt(txt []string) string { - var out []byte - for i, s := range txt { - if i > 0 { - out = append(out, ` "`...) - } else { - out = append(out, '"') - } - bs := []byte(s) - for j := 0; j < len(bs); { - b, n := nextByte(bs, j) - if n == 0 { - break - } - out = appendTXTStringByte(out, b) - j += n - } - out = append(out, '"') - } - return string(out) -} - -func appendDomainNameByte(s []byte, b byte) []byte { - switch b { - case '.', ' ', '\'', '@', ';', '(', ')': // additional chars to escape - return append(s, '\\', b) - } - return appendTXTStringByte(s, b) -} - -func appendTXTStringByte(s []byte, b byte) []byte { - switch b { - case '"', '\\': - return append(s, '\\', b) - } - if b < ' ' || b > '~' { - return appendByte(s, b) - } - return append(s, b) -} - -func appendByte(s []byte, b byte) []byte { - var buf [3]byte - bufs := strconv.AppendInt(buf[:0], int64(b), 10) - s = append(s, '\\') - for i := 0; i < 3-len(bufs); i++ { - s = append(s, '0') - } - for _, r := range bufs { - s = append(s, r) - } - return s -} - -func nextByte(b []byte, offset int) (byte, int) { - if offset >= len(b) { - return 0, 0 - } - if b[offset] != '\\' { - // not an escape sequence - return b[offset], 1 - } - switch len(b) - offset { - case 1: // dangling escape - return 0, 0 - case 2, 3: // too short to be \ddd - default: // maybe \ddd - if isDigit(b[offset+1]) && isDigit(b[offset+2]) && isDigit(b[offset+3]) { - return dddToByte(b[offset+1:]), 4 - } - } - // not \ddd, just an RFC 1035 "quoted" character - return b[offset+1], 2 -} - -type SPF struct { - Hdr RR_Header - Txt []string `dns:"txt"` -} - -func (rr *SPF) String() string { return rr.Hdr.String() + sprintTxt(rr.Txt) } - -type SRV struct { - Hdr RR_Header - Priority uint16 - Weight uint16 - Port uint16 - Target string `dns:"domain-name"` -} - -func (rr *SRV) String() string { - return rr.Hdr.String() + - strconv.Itoa(int(rr.Priority)) + " " + - strconv.Itoa(int(rr.Weight)) + " " + - strconv.Itoa(int(rr.Port)) + " " + sprintName(rr.Target) -} - -type NAPTR struct { - Hdr RR_Header - Order uint16 - Preference uint16 - Flags string - Service string - Regexp string - Replacement string `dns:"domain-name"` -} - -func (rr *NAPTR) String() string { - return rr.Hdr.String() + - strconv.Itoa(int(rr.Order)) + " " + - strconv.Itoa(int(rr.Preference)) + " " + - "\"" + rr.Flags + "\" " + - "\"" + rr.Service + "\" " + - "\"" + rr.Regexp + "\" " + - rr.Replacement -} - -// The CERT resource record, see RFC 4398. -type CERT struct { - Hdr RR_Header - Type uint16 - KeyTag uint16 - Algorithm uint8 - Certificate string `dns:"base64"` -} - -func (rr *CERT) String() string { - var ( - ok bool - certtype, algorithm string - ) - if certtype, ok = CertTypeToString[rr.Type]; !ok { - certtype = strconv.Itoa(int(rr.Type)) - } - if algorithm, ok = AlgorithmToString[rr.Algorithm]; !ok { - algorithm = strconv.Itoa(int(rr.Algorithm)) - } - return rr.Hdr.String() + certtype + - " " + strconv.Itoa(int(rr.KeyTag)) + - " " + algorithm + - " " + rr.Certificate -} - -// The DNAME resource record, see RFC 2672. -type DNAME struct { - Hdr RR_Header - Target string `dns:"domain-name"` -} - -func (rr *DNAME) String() string { - return rr.Hdr.String() + sprintName(rr.Target) -} - -type A struct { - Hdr RR_Header - A net.IP `dns:"a"` -} - -func (rr *A) String() string { - if rr.A == nil { - return rr.Hdr.String() - } - return rr.Hdr.String() + rr.A.String() -} - -type AAAA struct { - Hdr RR_Header - AAAA net.IP `dns:"aaaa"` -} - -func (rr *AAAA) String() string { - if rr.AAAA == nil { - return rr.Hdr.String() - } - return rr.Hdr.String() + rr.AAAA.String() -} - -type PX struct { - Hdr RR_Header - Preference uint16 - Map822 string `dns:"domain-name"` - Mapx400 string `dns:"domain-name"` -} - -func (rr *PX) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Map822) + " " + sprintName(rr.Mapx400) -} - -type GPOS struct { - Hdr RR_Header - Longitude string - Latitude string - Altitude string -} - -func (rr *GPOS) String() string { - return rr.Hdr.String() + rr.Longitude + " " + rr.Latitude + " " + rr.Altitude -} - -type LOC struct { - Hdr RR_Header - Version uint8 - Size uint8 - HorizPre uint8 - VertPre uint8 - Latitude uint32 - Longitude uint32 - Altitude uint32 -} - -// cmToM takes a cm value expressed in RFC1876 SIZE mantissa/exponent -// format and returns a string in m (two decimals for the cm) -func cmToM(m, e uint8) string { - if e < 2 { - if e == 1 { - m *= 10 - } - - return fmt.Sprintf("0.%02d", m) - } - - s := fmt.Sprintf("%d", m) - for e > 2 { - s += "0" - e-- - } - return s -} - -func (rr *LOC) String() string { - s := rr.Hdr.String() - - lat := rr.Latitude - ns := "N" - if lat > LOC_EQUATOR { - lat = lat - LOC_EQUATOR - } else { - ns = "S" - lat = LOC_EQUATOR - lat - } - h := lat / LOC_DEGREES - lat = lat % LOC_DEGREES - m := lat / LOC_HOURS - lat = lat % LOC_HOURS - s += fmt.Sprintf("%02d %02d %0.3f %s ", h, m, (float64(lat) / 1000), ns) - - lon := rr.Longitude - ew := "E" - if lon > LOC_PRIMEMERIDIAN { - lon = lon - LOC_PRIMEMERIDIAN - } else { - ew = "W" - lon = LOC_PRIMEMERIDIAN - lon - } - h = lon / LOC_DEGREES - lon = lon % LOC_DEGREES - m = lon / LOC_HOURS - lon = lon % LOC_HOURS - s += fmt.Sprintf("%02d %02d %0.3f %s ", h, m, (float64(lon) / 1000), ew) - - var alt = float64(rr.Altitude) / 100 - alt -= LOC_ALTITUDEBASE - if rr.Altitude%100 != 0 { - s += fmt.Sprintf("%.2fm ", alt) - } else { - s += fmt.Sprintf("%.0fm ", alt) - } - - s += cmToM((rr.Size&0xf0)>>4, rr.Size&0x0f) + "m " - s += cmToM((rr.HorizPre&0xf0)>>4, rr.HorizPre&0x0f) + "m " - s += cmToM((rr.VertPre&0xf0)>>4, rr.VertPre&0x0f) + "m" - - return s -} - -// SIG is identical to RRSIG and nowadays only used for SIG(0), RFC2931. -type SIG struct { - RRSIG -} - -type RRSIG struct { - Hdr RR_Header - TypeCovered uint16 - Algorithm uint8 - Labels uint8 - OrigTtl uint32 - Expiration uint32 - Inception uint32 - KeyTag uint16 - SignerName string `dns:"domain-name"` - Signature string `dns:"base64"` -} - -func (rr *RRSIG) String() string { - s := rr.Hdr.String() - s += Type(rr.TypeCovered).String() - s += " " + strconv.Itoa(int(rr.Algorithm)) + - " " + strconv.Itoa(int(rr.Labels)) + - " " + strconv.FormatInt(int64(rr.OrigTtl), 10) + - " " + TimeToString(rr.Expiration) + - " " + TimeToString(rr.Inception) + - " " + strconv.Itoa(int(rr.KeyTag)) + - " " + sprintName(rr.SignerName) + - " " + rr.Signature - return s -} - -type NSEC struct { - Hdr RR_Header - NextDomain string `dns:"domain-name"` - TypeBitMap []uint16 `dns:"nsec"` -} - -func (rr *NSEC) String() string { - s := rr.Hdr.String() + sprintName(rr.NextDomain) - for i := 0; i < len(rr.TypeBitMap); i++ { - s += " " + Type(rr.TypeBitMap[i]).String() - } - return s -} - -func (rr *NSEC) len() int { - l := rr.Hdr.len() + len(rr.NextDomain) + 1 - lastwindow := uint32(2 ^ 32 + 1) - for _, t := range rr.TypeBitMap { - window := t / 256 - if uint32(window) != lastwindow { - l += 1 + 32 - } - lastwindow = uint32(window) - } - return l -} - -type DLV struct { - DS -} - -type CDS struct { - DS -} - -type DS struct { - Hdr RR_Header - KeyTag uint16 - Algorithm uint8 - DigestType uint8 - Digest string `dns:"hex"` -} - -func (rr *DS) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.KeyTag)) + - " " + strconv.Itoa(int(rr.Algorithm)) + - " " + strconv.Itoa(int(rr.DigestType)) + - " " + strings.ToUpper(rr.Digest) -} - -type KX struct { - Hdr RR_Header - Preference uint16 - Exchanger string `dns:"domain-name"` -} - -func (rr *KX) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + - " " + sprintName(rr.Exchanger) -} - -type TA struct { - Hdr RR_Header - KeyTag uint16 - Algorithm uint8 - DigestType uint8 - Digest string `dns:"hex"` -} - -func (rr *TA) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.KeyTag)) + - " " + strconv.Itoa(int(rr.Algorithm)) + - " " + strconv.Itoa(int(rr.DigestType)) + - " " + strings.ToUpper(rr.Digest) -} - -type TALINK struct { - Hdr RR_Header - PreviousName string `dns:"domain-name"` - NextName string `dns:"domain-name"` -} - -func (rr *TALINK) String() string { - return rr.Hdr.String() + - sprintName(rr.PreviousName) + " " + sprintName(rr.NextName) -} - -type SSHFP struct { - Hdr RR_Header - Algorithm uint8 - Type uint8 - FingerPrint string `dns:"hex"` -} - -func (rr *SSHFP) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Algorithm)) + - " " + strconv.Itoa(int(rr.Type)) + - " " + strings.ToUpper(rr.FingerPrint) -} - -type KEY struct { - DNSKEY -} - -type CDNSKEY struct { - DNSKEY -} - -type DNSKEY struct { - Hdr RR_Header - Flags uint16 - Protocol uint8 - Algorithm uint8 - PublicKey string `dns:"base64"` -} - -func (rr *DNSKEY) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Flags)) + - " " + strconv.Itoa(int(rr.Protocol)) + - " " + strconv.Itoa(int(rr.Algorithm)) + - " " + rr.PublicKey -} - -type RKEY struct { - Hdr RR_Header - Flags uint16 - Protocol uint8 - Algorithm uint8 - PublicKey string `dns:"base64"` -} - -func (rr *RKEY) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Flags)) + - " " + strconv.Itoa(int(rr.Protocol)) + - " " + strconv.Itoa(int(rr.Algorithm)) + - " " + rr.PublicKey -} - -type NSAPPTR struct { - Hdr RR_Header - Ptr string `dns:"domain-name"` -} - -func (rr *NSAPPTR) String() string { return rr.Hdr.String() + sprintName(rr.Ptr) } - -type NSEC3 struct { - Hdr RR_Header - Hash uint8 - Flags uint8 - Iterations uint16 - SaltLength uint8 - Salt string `dns:"size-hex:SaltLength"` - HashLength uint8 - NextDomain string `dns:"size-base32:HashLength"` - TypeBitMap []uint16 `dns:"nsec"` -} - -func (rr *NSEC3) String() string { - s := rr.Hdr.String() - s += strconv.Itoa(int(rr.Hash)) + - " " + strconv.Itoa(int(rr.Flags)) + - " " + strconv.Itoa(int(rr.Iterations)) + - " " + saltToString(rr.Salt) + - " " + rr.NextDomain - for i := 0; i < len(rr.TypeBitMap); i++ { - s += " " + Type(rr.TypeBitMap[i]).String() - } - return s -} - -func (rr *NSEC3) len() int { - l := rr.Hdr.len() + 6 + len(rr.Salt)/2 + 1 + len(rr.NextDomain) + 1 - lastwindow := uint32(2 ^ 32 + 1) - for _, t := range rr.TypeBitMap { - window := t / 256 - if uint32(window) != lastwindow { - l += 1 + 32 - } - lastwindow = uint32(window) - } - return l -} - -type NSEC3PARAM struct { - Hdr RR_Header - Hash uint8 - Flags uint8 - Iterations uint16 - SaltLength uint8 - Salt string `dns:"size-hex:SaltLength"` -} - -func (rr *NSEC3PARAM) String() string { - s := rr.Hdr.String() - s += strconv.Itoa(int(rr.Hash)) + - " " + strconv.Itoa(int(rr.Flags)) + - " " + strconv.Itoa(int(rr.Iterations)) + - " " + saltToString(rr.Salt) - return s -} - -type TKEY struct { - Hdr RR_Header - Algorithm string `dns:"domain-name"` - Inception uint32 - Expiration uint32 - Mode uint16 - Error uint16 - KeySize uint16 - Key string - OtherLen uint16 - OtherData string -} - -func (rr *TKEY) String() string { - // It has no presentation format - return "" -} - -// RFC3597 represents an unknown/generic RR. -type RFC3597 struct { - Hdr RR_Header - Rdata string `dns:"hex"` -} - -func (rr *RFC3597) String() string { - // Let's call it a hack - s := rfc3597Header(rr.Hdr) - - s += "\\# " + strconv.Itoa(len(rr.Rdata)/2) + " " + rr.Rdata - return s -} - -func rfc3597Header(h RR_Header) string { - var s string - - s += sprintName(h.Name) + "\t" - s += strconv.FormatInt(int64(h.Ttl), 10) + "\t" - s += "CLASS" + strconv.Itoa(int(h.Class)) + "\t" - s += "TYPE" + strconv.Itoa(int(h.Rrtype)) + "\t" - return s -} - -type URI struct { - Hdr RR_Header - Priority uint16 - Weight uint16 - Target string `dns:"octet"` -} - -func (rr *URI) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Priority)) + - " " + strconv.Itoa(int(rr.Weight)) + " " + sprintTxtOctet(rr.Target) -} - -type DHCID struct { - Hdr RR_Header - Digest string `dns:"base64"` -} - -func (rr *DHCID) String() string { return rr.Hdr.String() + rr.Digest } - -type TLSA struct { - Hdr RR_Header - Usage uint8 - Selector uint8 - MatchingType uint8 - Certificate string `dns:"hex"` -} - -func (rr *TLSA) String() string { - return rr.Hdr.String() + - strconv.Itoa(int(rr.Usage)) + - " " + strconv.Itoa(int(rr.Selector)) + - " " + strconv.Itoa(int(rr.MatchingType)) + - " " + rr.Certificate -} - -type SMIMEA struct { - Hdr RR_Header - Usage uint8 - Selector uint8 - MatchingType uint8 - Certificate string `dns:"hex"` -} - -func (rr *SMIMEA) String() string { - s := rr.Hdr.String() + - strconv.Itoa(int(rr.Usage)) + - " " + strconv.Itoa(int(rr.Selector)) + - " " + strconv.Itoa(int(rr.MatchingType)) - - // Every Nth char needs a space on this output. If we output - // this as one giant line, we can't read it can in because in some cases - // the cert length overflows scan.maxTok (2048). - sx := splitN(rr.Certificate, 1024) // conservative value here - s += " " + strings.Join(sx, " ") - return s -} - -type HIP struct { - Hdr RR_Header - HitLength uint8 - PublicKeyAlgorithm uint8 - PublicKeyLength uint16 - Hit string `dns:"size-hex:HitLength"` - PublicKey string `dns:"size-base64:PublicKeyLength"` - RendezvousServers []string `dns:"domain-name"` -} - -func (rr *HIP) String() string { - s := rr.Hdr.String() + - strconv.Itoa(int(rr.PublicKeyAlgorithm)) + - " " + rr.Hit + - " " + rr.PublicKey - for _, d := range rr.RendezvousServers { - s += " " + sprintName(d) - } - return s -} - -type NINFO struct { - Hdr RR_Header - ZSData []string `dns:"txt"` -} - -func (rr *NINFO) String() string { return rr.Hdr.String() + sprintTxt(rr.ZSData) } - -type NID struct { - Hdr RR_Header - Preference uint16 - NodeID uint64 -} - -func (rr *NID) String() string { - s := rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) - node := fmt.Sprintf("%0.16x", rr.NodeID) - s += " " + node[0:4] + ":" + node[4:8] + ":" + node[8:12] + ":" + node[12:16] - return s -} - -type L32 struct { - Hdr RR_Header - Preference uint16 - Locator32 net.IP `dns:"a"` -} - -func (rr *L32) String() string { - if rr.Locator32 == nil { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) - } - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + - " " + rr.Locator32.String() -} - -type L64 struct { - Hdr RR_Header - Preference uint16 - Locator64 uint64 -} - -func (rr *L64) String() string { - s := rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) - node := fmt.Sprintf("%0.16X", rr.Locator64) - s += " " + node[0:4] + ":" + node[4:8] + ":" + node[8:12] + ":" + node[12:16] - return s -} - -type LP struct { - Hdr RR_Header - Preference uint16 - Fqdn string `dns:"domain-name"` -} - -func (rr *LP) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Fqdn) -} - -type EUI48 struct { - Hdr RR_Header - Address uint64 `dns:"uint48"` -} - -func (rr *EUI48) String() string { return rr.Hdr.String() + euiToString(rr.Address, 48) } - -type EUI64 struct { - Hdr RR_Header - Address uint64 -} - -func (rr *EUI64) String() string { return rr.Hdr.String() + euiToString(rr.Address, 64) } - -type CAA struct { - Hdr RR_Header - Flag uint8 - Tag string - Value string `dns:"octet"` -} - -func (rr *CAA) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Flag)) + " " + rr.Tag + " " + sprintTxtOctet(rr.Value) -} - -type UID struct { - Hdr RR_Header - Uid uint32 -} - -func (rr *UID) String() string { return rr.Hdr.String() + strconv.FormatInt(int64(rr.Uid), 10) } - -type GID struct { - Hdr RR_Header - Gid uint32 -} - -func (rr *GID) String() string { return rr.Hdr.String() + strconv.FormatInt(int64(rr.Gid), 10) } - -type UINFO struct { - Hdr RR_Header - Uinfo string -} - -func (rr *UINFO) String() string { return rr.Hdr.String() + sprintTxt([]string{rr.Uinfo}) } - -type EID struct { - Hdr RR_Header - Endpoint string `dns:"hex"` -} - -func (rr *EID) String() string { return rr.Hdr.String() + strings.ToUpper(rr.Endpoint) } - -type NIMLOC struct { - Hdr RR_Header - Locator string `dns:"hex"` -} - -func (rr *NIMLOC) String() string { return rr.Hdr.String() + strings.ToUpper(rr.Locator) } - -type OPENPGPKEY struct { - Hdr RR_Header - PublicKey string `dns:"base64"` -} - -func (rr *OPENPGPKEY) String() string { return rr.Hdr.String() + rr.PublicKey } - -// TimeToString translates the RRSIG's incep. and expir. times to the -// string representation used when printing the record. -// It takes serial arithmetic (RFC 1982) into account. -func TimeToString(t uint32) string { - mod := ((int64(t) - time.Now().Unix()) / year68) - 1 - if mod < 0 { - mod = 0 - } - ti := time.Unix(int64(t)-(mod*year68), 0).UTC() - return ti.Format("20060102150405") -} - -// StringToTime translates the RRSIG's incep. and expir. times from -// string values like "20110403154150" to an 32 bit integer. -// It takes serial arithmetic (RFC 1982) into account. -func StringToTime(s string) (uint32, error) { - t, err := time.Parse("20060102150405", s) - if err != nil { - return 0, err - } - mod := (t.Unix() / year68) - 1 - if mod < 0 { - mod = 0 - } - return uint32(t.Unix() - (mod * year68)), nil -} - -// saltToString converts a NSECX salt to uppercase and returns "-" when it is empty. -func saltToString(s string) string { - if len(s) == 0 { - return "-" - } - return strings.ToUpper(s) -} - -func euiToString(eui uint64, bits int) (hex string) { - switch bits { - case 64: - hex = fmt.Sprintf("%16.16x", eui) - hex = hex[0:2] + "-" + hex[2:4] + "-" + hex[4:6] + "-" + hex[6:8] + - "-" + hex[8:10] + "-" + hex[10:12] + "-" + hex[12:14] + "-" + hex[14:16] - case 48: - hex = fmt.Sprintf("%12.12x", eui) - hex = hex[0:2] + "-" + hex[2:4] + "-" + hex[4:6] + "-" + hex[6:8] + - "-" + hex[8:10] + "-" + hex[10:12] - } - return -} - -// copyIP returns a copy of ip. -func copyIP(ip net.IP) net.IP { - p := make(net.IP, len(ip)) - copy(p, ip) - return p -} - -// SplitN splits a string into N sized string chunks. -// This might become an exported function once. -func splitN(s string, n int) []string { - if len(s) < n { - return []string{s} - } - sx := []string{} - p, i := 0, n - for { - if i <= len(s) { - sx = append(sx, s[p:i]) - } else { - sx = append(sx, s[p:]) - break - - } - p, i = p+n, i+n - } - - return sx -} diff --git a/vendor/github.com/miekg/dns/types_generate.go b/vendor/github.com/miekg/dns/types_generate.go deleted file mode 100644 index bf80da3..0000000 --- a/vendor/github.com/miekg/dns/types_generate.go +++ /dev/null @@ -1,271 +0,0 @@ -//+build ignore - -// types_generate.go is meant to run with go generate. It will use -// go/{importer,types} to track down all the RR struct types. Then for each type -// it will generate conversion tables (TypeToRR and TypeToString) and banal -// methods (len, Header, copy) based on the struct tags. The generated source is -// written to ztypes.go, and is meant to be checked into git. -package main - -import ( - "bytes" - "fmt" - "go/format" - "go/importer" - "go/types" - "log" - "os" - "strings" - "text/template" -) - -var skipLen = map[string]struct{}{ - "NSEC": {}, - "NSEC3": {}, - "OPT": {}, -} - -var packageHdr = ` -// *** DO NOT MODIFY *** -// AUTOGENERATED BY go generate from type_generate.go - -package dns - -import ( - "encoding/base64" - "net" -) - -` - -var TypeToRR = template.Must(template.New("TypeToRR").Parse(` -// TypeToRR is a map of constructors for each RR type. -var TypeToRR = map[uint16]func() RR{ -{{range .}}{{if ne . "RFC3597"}} Type{{.}}: func() RR { return new({{.}}) }, -{{end}}{{end}} } - -`)) - -var typeToString = template.Must(template.New("typeToString").Parse(` -// TypeToString is a map of strings for each RR type. -var TypeToString = map[uint16]string{ -{{range .}}{{if ne . "NSAPPTR"}} Type{{.}}: "{{.}}", -{{end}}{{end}} TypeNSAPPTR: "NSAP-PTR", -} - -`)) - -var headerFunc = template.Must(template.New("headerFunc").Parse(` -// Header() functions -{{range .}} func (rr *{{.}}) Header() *RR_Header { return &rr.Hdr } -{{end}} - -`)) - -// getTypeStruct will take a type and the package scope, and return the -// (innermost) struct if the type is considered a RR type (currently defined as -// those structs beginning with a RR_Header, could be redefined as implementing -// the RR interface). The bool return value indicates if embedded structs were -// resolved. -func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) { - st, ok := t.Underlying().(*types.Struct) - if !ok { - return nil, false - } - if st.Field(0).Type() == scope.Lookup("RR_Header").Type() { - return st, false - } - if st.Field(0).Anonymous() { - st, _ := getTypeStruct(st.Field(0).Type(), scope) - return st, true - } - return nil, false -} - -func main() { - // Import and type-check the package - pkg, err := importer.Default().Import("github.com/miekg/dns") - fatalIfErr(err) - scope := pkg.Scope() - - // Collect constants like TypeX - var numberedTypes []string - for _, name := range scope.Names() { - o := scope.Lookup(name) - if o == nil || !o.Exported() { - continue - } - b, ok := o.Type().(*types.Basic) - if !ok || b.Kind() != types.Uint16 { - continue - } - if !strings.HasPrefix(o.Name(), "Type") { - continue - } - name := strings.TrimPrefix(o.Name(), "Type") - if name == "PrivateRR" { - continue - } - numberedTypes = append(numberedTypes, name) - } - - // Collect actual types (*X) - var namedTypes []string - for _, name := range scope.Names() { - o := scope.Lookup(name) - if o == nil || !o.Exported() { - continue - } - if st, _ := getTypeStruct(o.Type(), scope); st == nil { - continue - } - if name == "PrivateRR" { - continue - } - - // Check if corresponding TypeX exists - if scope.Lookup("Type"+o.Name()) == nil && o.Name() != "RFC3597" { - log.Fatalf("Constant Type%s does not exist.", o.Name()) - } - - namedTypes = append(namedTypes, o.Name()) - } - - b := &bytes.Buffer{} - b.WriteString(packageHdr) - - // Generate TypeToRR - fatalIfErr(TypeToRR.Execute(b, namedTypes)) - - // Generate typeToString - fatalIfErr(typeToString.Execute(b, numberedTypes)) - - // Generate headerFunc - fatalIfErr(headerFunc.Execute(b, namedTypes)) - - // Generate len() - fmt.Fprint(b, "// len() functions\n") - for _, name := range namedTypes { - if _, ok := skipLen[name]; ok { - continue - } - o := scope.Lookup(name) - st, isEmbedded := getTypeStruct(o.Type(), scope) - if isEmbedded { - continue - } - fmt.Fprintf(b, "func (rr *%s) len() int {\n", name) - fmt.Fprintf(b, "l := rr.Hdr.len()\n") - for i := 1; i < st.NumFields(); i++ { - o := func(s string) { fmt.Fprintf(b, s, st.Field(i).Name()) } - - if _, ok := st.Field(i).Type().(*types.Slice); ok { - switch st.Tag(i) { - case `dns:"-"`: - // ignored - case `dns:"cdomain-name"`, `dns:"domain-name"`, `dns:"txt"`: - o("for _, x := range rr.%s { l += len(x) + 1 }\n") - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - continue - } - - switch { - case st.Tag(i) == `dns:"-"`: - // ignored - case st.Tag(i) == `dns:"cdomain-name"`, st.Tag(i) == `dns:"domain-name"`: - o("l += len(rr.%s) + 1\n") - case st.Tag(i) == `dns:"octet"`: - o("l += len(rr.%s)\n") - case strings.HasPrefix(st.Tag(i), `dns:"size-base64`): - fallthrough - case st.Tag(i) == `dns:"base64"`: - o("l += base64.StdEncoding.DecodedLen(len(rr.%s))\n") - case strings.HasPrefix(st.Tag(i), `dns:"size-hex`): - fallthrough - case st.Tag(i) == `dns:"hex"`: - o("l += len(rr.%s)/2 + 1\n") - case st.Tag(i) == `dns:"a"`: - o("l += net.IPv4len // %s\n") - case st.Tag(i) == `dns:"aaaa"`: - o("l += net.IPv6len // %s\n") - case st.Tag(i) == `dns:"txt"`: - o("for _, t := range rr.%s { l += len(t) + 1 }\n") - case st.Tag(i) == `dns:"uint48"`: - o("l += 6 // %s\n") - case st.Tag(i) == "": - switch st.Field(i).Type().(*types.Basic).Kind() { - case types.Uint8: - o("l += 1 // %s\n") - case types.Uint16: - o("l += 2 // %s\n") - case types.Uint32: - o("l += 4 // %s\n") - case types.Uint64: - o("l += 8 // %s\n") - case types.String: - o("l += len(rr.%s) + 1\n") - default: - log.Fatalln(name, st.Field(i).Name()) - } - default: - log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) - } - } - fmt.Fprintf(b, "return l }\n") - } - - // Generate copy() - fmt.Fprint(b, "// copy() functions\n") - for _, name := range namedTypes { - o := scope.Lookup(name) - st, isEmbedded := getTypeStruct(o.Type(), scope) - if isEmbedded { - continue - } - fmt.Fprintf(b, "func (rr *%s) copy() RR {\n", name) - fields := []string{"*rr.Hdr.copyHeader()"} - for i := 1; i < st.NumFields(); i++ { - f := st.Field(i).Name() - if sl, ok := st.Field(i).Type().(*types.Slice); ok { - t := sl.Underlying().String() - t = strings.TrimPrefix(t, "[]") - if strings.Contains(t, ".") { - splits := strings.Split(t, ".") - t = splits[len(splits)-1] - } - fmt.Fprintf(b, "%s := make([]%s, len(rr.%s)); copy(%s, rr.%s)\n", - f, t, f, f, f) - fields = append(fields, f) - continue - } - if st.Field(i).Type().String() == "net.IP" { - fields = append(fields, "copyIP(rr."+f+")") - continue - } - fields = append(fields, "rr."+f) - } - fmt.Fprintf(b, "return &%s{%s}\n", name, strings.Join(fields, ",")) - fmt.Fprintf(b, "}\n") - } - - // gofmt - res, err := format.Source(b.Bytes()) - if err != nil { - b.WriteTo(os.Stderr) - log.Fatal(err) - } - - // write result - f, err := os.Create("ztypes.go") - fatalIfErr(err) - defer f.Close() - f.Write(res) -} - -func fatalIfErr(err error) { - if err != nil { - log.Fatal(err) - } -} diff --git a/vendor/github.com/miekg/dns/udp.go b/vendor/github.com/miekg/dns/udp.go deleted file mode 100644 index c79c6c8..0000000 --- a/vendor/github.com/miekg/dns/udp.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build !windows,!plan9 - -package dns - -import ( - "net" - "syscall" -) - -// SessionUDP holds the remote address and the associated -// out-of-band data. -type SessionUDP struct { - raddr *net.UDPAddr - context []byte -} - -// RemoteAddr returns the remote network address. -func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } - -// setUDPSocketOptions sets the UDP socket options. -// This function is implemented on a per platform basis. See udp_*.go for more details -func setUDPSocketOptions(conn *net.UDPConn) error { - sa, err := getUDPSocketName(conn) - if err != nil { - return err - } - switch sa.(type) { - case *syscall.SockaddrInet6: - v6only, err := getUDPSocketOptions6Only(conn) - if err != nil { - return err - } - setUDPSocketOptions6(conn) - if !v6only { - setUDPSocketOptions4(conn) - } - case *syscall.SockaddrInet4: - setUDPSocketOptions4(conn) - } - return nil -} - -// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a -// net.UDPAddr. -func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { - oob := make([]byte, 40) - n, oobn, _, raddr, err := conn.ReadMsgUDP(b, oob) - if err != nil { - return n, nil, err - } - return n, &SessionUDP{raddr, oob[:oobn]}, err -} - -// WriteToSessionUDP acts just like net.UDPConn.WritetTo(), but uses a *SessionUDP instead of a net.Addr. -func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { - n, _, err := conn.WriteMsgUDP(b, session.context, session.raddr) - return n, err -} diff --git a/vendor/github.com/miekg/dns/udp_linux.go b/vendor/github.com/miekg/dns/udp_linux.go deleted file mode 100644 index c62d218..0000000 --- a/vendor/github.com/miekg/dns/udp_linux.go +++ /dev/null @@ -1,73 +0,0 @@ -// +build linux - -package dns - -// See: -// * http://stackoverflow.com/questions/3062205/setting-the-source-ip-for-a-udp-socket and -// * http://blog.powerdns.com/2012/10/08/on-binding-datagram-udp-sockets-to-the-any-addresses/ -// -// Why do we need this: When listening on 0.0.0.0 with UDP so kernel decides what is the outgoing -// interface, this might not always be the correct one. This code will make sure the egress -// packet's interface matched the ingress' one. - -import ( - "net" - "syscall" -) - -// setUDPSocketOptions4 prepares the v4 socket for sessions. -func setUDPSocketOptions4(conn *net.UDPConn) error { - file, err := conn.File() - if err != nil { - return err - } - if err := syscall.SetsockoptInt(int(file.Fd()), syscall.IPPROTO_IP, syscall.IP_PKTINFO, 1); err != nil { - return err - } - // Calling File() above results in the connection becoming blocking, we must fix that. - // See https://github.com/miekg/dns/issues/279 - err = syscall.SetNonblock(int(file.Fd()), true) - if err != nil { - return err - } - return nil -} - -// setUDPSocketOptions6 prepares the v6 socket for sessions. -func setUDPSocketOptions6(conn *net.UDPConn) error { - file, err := conn.File() - if err != nil { - return err - } - if err := syscall.SetsockoptInt(int(file.Fd()), syscall.IPPROTO_IPV6, syscall.IPV6_RECVPKTINFO, 1); err != nil { - return err - } - err = syscall.SetNonblock(int(file.Fd()), true) - if err != nil { - return err - } - return nil -} - -// getUDPSocketOption6Only return true if the socket is v6 only and false when it is v4/v6 combined -// (dualstack). -func getUDPSocketOptions6Only(conn *net.UDPConn) (bool, error) { - file, err := conn.File() - if err != nil { - return false, err - } - // dual stack. See http://stackoverflow.com/questions/1618240/how-to-support-both-ipv4-and-ipv6-connections - v6only, err := syscall.GetsockoptInt(int(file.Fd()), syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY) - if err != nil { - return false, err - } - return v6only == 1, nil -} - -func getUDPSocketName(conn *net.UDPConn) (syscall.Sockaddr, error) { - file, err := conn.File() - if err != nil { - return nil, err - } - return syscall.Getsockname(int(file.Fd())) -} diff --git a/vendor/github.com/miekg/dns/udp_other.go b/vendor/github.com/miekg/dns/udp_other.go deleted file mode 100644 index d407324..0000000 --- a/vendor/github.com/miekg/dns/udp_other.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build !linux,!plan9 - -package dns - -import ( - "net" - "syscall" -) - -// These do nothing. See udp_linux.go for an example of how to implement this. - -// We tried to adhire to some kind of naming scheme. - -func setUDPSocketOptions4(conn *net.UDPConn) error { return nil } -func setUDPSocketOptions6(conn *net.UDPConn) error { return nil } -func getUDPSocketOptions6Only(conn *net.UDPConn) (bool, error) { return false, nil } -func getUDPSocketName(conn *net.UDPConn) (syscall.Sockaddr, error) { return nil, nil } diff --git a/vendor/github.com/miekg/dns/udp_plan9.go b/vendor/github.com/miekg/dns/udp_plan9.go deleted file mode 100644 index b794dee..0000000 --- a/vendor/github.com/miekg/dns/udp_plan9.go +++ /dev/null @@ -1,34 +0,0 @@ -package dns - -import ( - "net" -) - -func setUDPSocketOptions(conn *net.UDPConn) error { return nil } - -// SessionUDP holds the remote address and the associated -// out-of-band data. -type SessionUDP struct { - raddr *net.UDPAddr - context []byte -} - -// RemoteAddr returns the remote network address. -func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } - -// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a -// net.UDPAddr. -func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { - oob := make([]byte, 40) - n, oobn, _, raddr, err := conn.ReadMsgUDP(b, oob) - if err != nil { - return n, nil, err - } - return n, &SessionUDP{raddr, oob[:oobn]}, err -} - -// WriteToSessionUDP acts just like net.UDPConn.WritetTo(), but uses a *SessionUDP instead of a net.Addr. -func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { - n, _, err := conn.WriteMsgUDP(b, session.context, session.raddr) - return n, err -} diff --git a/vendor/github.com/miekg/dns/udp_windows.go b/vendor/github.com/miekg/dns/udp_windows.go deleted file mode 100644 index 2ce4b33..0000000 --- a/vendor/github.com/miekg/dns/udp_windows.go +++ /dev/null @@ -1,34 +0,0 @@ -// +build windows - -package dns - -import "net" - -type SessionUDP struct { - raddr *net.UDPAddr -} - -// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a -// net.UDPAddr. -func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { - n, raddr, err := conn.ReadFrom(b) - if err != nil { - return n, nil, err - } - session := &SessionUDP{raddr.(*net.UDPAddr)} - return n, session, err -} - -// WriteToSessionUDP acts just like net.UDPConn.WritetTo(), but uses a *SessionUDP instead of a net.Addr. -func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { - n, err := conn.WriteTo(b, session.raddr) - return n, err -} - -func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } - -// setUDPSocketOptions sets the UDP socket options. -// This function is implemented on a per platform basis. See udp_*.go for more details -func setUDPSocketOptions(conn *net.UDPConn) error { - return nil -} diff --git a/vendor/github.com/miekg/dns/update.go b/vendor/github.com/miekg/dns/update.go deleted file mode 100644 index e90c5c9..0000000 --- a/vendor/github.com/miekg/dns/update.go +++ /dev/null @@ -1,106 +0,0 @@ -package dns - -// NameUsed sets the RRs in the prereq section to -// "Name is in use" RRs. RFC 2136 section 2.4.4. -func (u *Msg) NameUsed(rr []RR) { - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}}) - } -} - -// NameNotUsed sets the RRs in the prereq section to -// "Name is in not use" RRs. RFC 2136 section 2.4.5. -func (u *Msg) NameNotUsed(rr []RR) { - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassNONE}}) - } -} - -// Used sets the RRs in the prereq section to -// "RRset exists (value dependent -- with rdata)" RRs. RFC 2136 section 2.4.2. -func (u *Msg) Used(rr []RR) { - if len(u.Question) == 0 { - panic("dns: empty question section") - } - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - r.Header().Class = u.Question[0].Qclass - u.Answer = append(u.Answer, r) - } -} - -// RRsetUsed sets the RRs in the prereq section to -// "RRset exists (value independent -- no rdata)" RRs. RFC 2136 section 2.4.1. -func (u *Msg) RRsetUsed(rr []RR) { - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: r.Header().Rrtype, Class: ClassANY}}) - } -} - -// RRsetNotUsed sets the RRs in the prereq section to -// "RRset does not exist" RRs. RFC 2136 section 2.4.3. -func (u *Msg) RRsetNotUsed(rr []RR) { - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: r.Header().Rrtype, Class: ClassNONE}}) - } -} - -// Insert creates a dynamic update packet that adds an complete RRset, see RFC 2136 section 2.5.1. -func (u *Msg) Insert(rr []RR) { - if len(u.Question) == 0 { - panic("dns: empty question section") - } - if u.Ns == nil { - u.Ns = make([]RR, 0, len(rr)) - } - for _, r := range rr { - r.Header().Class = u.Question[0].Qclass - u.Ns = append(u.Ns, r) - } -} - -// RemoveRRset creates a dynamic update packet that deletes an RRset, see RFC 2136 section 2.5.2. -func (u *Msg) RemoveRRset(rr []RR) { - if u.Ns == nil { - u.Ns = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Ns = append(u.Ns, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: r.Header().Rrtype, Class: ClassANY}}) - } -} - -// RemoveName creates a dynamic update packet that deletes all RRsets of a name, see RFC 2136 section 2.5.3 -func (u *Msg) RemoveName(rr []RR) { - if u.Ns == nil { - u.Ns = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Ns = append(u.Ns, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}}) - } -} - -// Remove creates a dynamic update packet deletes RR from a RRSset, see RFC 2136 section 2.5.4 -func (u *Msg) Remove(rr []RR) { - if u.Ns == nil { - u.Ns = make([]RR, 0, len(rr)) - } - for _, r := range rr { - r.Header().Class = ClassNONE - r.Header().Ttl = 0 - u.Ns = append(u.Ns, r) - } -} diff --git a/vendor/github.com/miekg/dns/xfr.go b/vendor/github.com/miekg/dns/xfr.go deleted file mode 100644 index 7346def..0000000 --- a/vendor/github.com/miekg/dns/xfr.go +++ /dev/null @@ -1,244 +0,0 @@ -package dns - -import ( - "time" -) - -// Envelope is used when doing a zone transfer with a remote server. -type Envelope struct { - RR []RR // The set of RRs in the answer section of the xfr reply message. - Error error // If something went wrong, this contains the error. -} - -// A Transfer defines parameters that are used during a zone transfer. -type Transfer struct { - *Conn - DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds - ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds - WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds - TsigSecret map[string]string // Secret(s) for Tsig map[], zonename must be fully qualified - tsigTimersOnly bool -} - -// Think we need to away to stop the transfer - -// In performs an incoming transfer with the server in a. -// If you would like to set the source IP, or some other attribute -// of a Dialer for a Transfer, you can do so by specifying the attributes -// in the Transfer.Conn: -// -// d := net.Dialer{LocalAddr: transfer_source} -// con, err := d.Dial("tcp", master) -// dnscon := &dns.Conn{Conn:con} -// transfer = &dns.Transfer{Conn: dnscon} -// channel, err := transfer.In(message, master) -// -func (t *Transfer) In(q *Msg, a string) (env chan *Envelope, err error) { - timeout := dnsTimeout - if t.DialTimeout != 0 { - timeout = t.DialTimeout - } - if t.Conn == nil { - t.Conn, err = DialTimeout("tcp", a, timeout) - if err != nil { - return nil, err - } - } - if err := t.WriteMsg(q); err != nil { - return nil, err - } - env = make(chan *Envelope) - go func() { - if q.Question[0].Qtype == TypeAXFR { - go t.inAxfr(q.Id, env) - return - } - if q.Question[0].Qtype == TypeIXFR { - go t.inIxfr(q.Id, env) - return - } - }() - return env, nil -} - -func (t *Transfer) inAxfr(id uint16, c chan *Envelope) { - first := true - defer t.Close() - defer close(c) - timeout := dnsTimeout - if t.ReadTimeout != 0 { - timeout = t.ReadTimeout - } - for { - t.Conn.SetReadDeadline(time.Now().Add(timeout)) - in, err := t.ReadMsg() - if err != nil { - c <- &Envelope{nil, err} - return - } - if id != in.Id { - c <- &Envelope{in.Answer, ErrId} - return - } - if first { - if !isSOAFirst(in) { - c <- &Envelope{in.Answer, ErrSoa} - return - } - first = !first - // only one answer that is SOA, receive more - if len(in.Answer) == 1 { - t.tsigTimersOnly = true - c <- &Envelope{in.Answer, nil} - continue - } - } - - if !first { - t.tsigTimersOnly = true // Subsequent envelopes use this. - if isSOALast(in) { - c <- &Envelope{in.Answer, nil} - return - } - c <- &Envelope{in.Answer, nil} - } - } -} - -func (t *Transfer) inIxfr(id uint16, c chan *Envelope) { - serial := uint32(0) // The first serial seen is the current server serial - first := true - defer t.Close() - defer close(c) - timeout := dnsTimeout - if t.ReadTimeout != 0 { - timeout = t.ReadTimeout - } - for { - t.SetReadDeadline(time.Now().Add(timeout)) - in, err := t.ReadMsg() - if err != nil { - c <- &Envelope{nil, err} - return - } - if id != in.Id { - c <- &Envelope{in.Answer, ErrId} - return - } - if first { - // A single SOA RR signals "no changes" - if len(in.Answer) == 1 && isSOAFirst(in) { - c <- &Envelope{in.Answer, nil} - return - } - - // Check if the returned answer is ok - if !isSOAFirst(in) { - c <- &Envelope{in.Answer, ErrSoa} - return - } - // This serial is important - serial = in.Answer[0].(*SOA).Serial - first = !first - } - - // Now we need to check each message for SOA records, to see what we need to do - if !first { - t.tsigTimersOnly = true - // If the last record in the IXFR contains the servers' SOA, we should quit - if v, ok := in.Answer[len(in.Answer)-1].(*SOA); ok { - if v.Serial == serial { - c <- &Envelope{in.Answer, nil} - return - } - } - c <- &Envelope{in.Answer, nil} - } - } -} - -// Out performs an outgoing transfer with the client connecting in w. -// Basic use pattern: -// -// ch := make(chan *dns.Envelope) -// tr := new(dns.Transfer) -// go tr.Out(w, r, ch) -// ch <- &dns.Envelope{RR: []dns.RR{soa, rr1, rr2, rr3, soa}} -// close(ch) -// w.Hijack() -// // w.Close() // Client closes connection -// -// The server is responsible for sending the correct sequence of RRs through the -// channel ch. -func (t *Transfer) Out(w ResponseWriter, q *Msg, ch chan *Envelope) error { - for x := range ch { - r := new(Msg) - // Compress? - r.SetReply(q) - r.Authoritative = true - // assume it fits TODO(miek): fix - r.Answer = append(r.Answer, x.RR...) - if err := w.WriteMsg(r); err != nil { - return err - } - } - w.TsigTimersOnly(true) - return nil -} - -// ReadMsg reads a message from the transfer connection t. -func (t *Transfer) ReadMsg() (*Msg, error) { - m := new(Msg) - p := make([]byte, MaxMsgSize) - n, err := t.Read(p) - if err != nil && n == 0 { - return nil, err - } - p = p[:n] - if err := m.Unpack(p); err != nil { - return nil, err - } - if ts := m.IsTsig(); ts != nil && t.TsigSecret != nil { - if _, ok := t.TsigSecret[ts.Hdr.Name]; !ok { - return m, ErrSecret - } - // Need to work on the original message p, as that was used to calculate the tsig. - err = TsigVerify(p, t.TsigSecret[ts.Hdr.Name], t.tsigRequestMAC, t.tsigTimersOnly) - t.tsigRequestMAC = ts.MAC - } - return m, err -} - -// WriteMsg writes a message through the transfer connection t. -func (t *Transfer) WriteMsg(m *Msg) (err error) { - var out []byte - if ts := m.IsTsig(); ts != nil && t.TsigSecret != nil { - if _, ok := t.TsigSecret[ts.Hdr.Name]; !ok { - return ErrSecret - } - out, t.tsigRequestMAC, err = TsigGenerate(m, t.TsigSecret[ts.Hdr.Name], t.tsigRequestMAC, t.tsigTimersOnly) - } else { - out, err = m.Pack() - } - if err != nil { - return err - } - if _, err = t.Write(out); err != nil { - return err - } - return nil -} - -func isSOAFirst(in *Msg) bool { - if len(in.Answer) > 0 { - return in.Answer[0].Header().Rrtype == TypeSOA - } - return false -} - -func isSOALast(in *Msg) bool { - if len(in.Answer) > 0 { - return in.Answer[len(in.Answer)-1].Header().Rrtype == TypeSOA - } - return false -} diff --git a/vendor/github.com/miekg/dns/zmsg.go b/vendor/github.com/miekg/dns/zmsg.go deleted file mode 100644 index c561370..0000000 --- a/vendor/github.com/miekg/dns/zmsg.go +++ /dev/null @@ -1,3529 +0,0 @@ -// *** DO NOT MODIFY *** -// AUTOGENERATED BY go generate from msg_generate.go - -package dns - -// pack*() functions - -func (rr *A) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packDataA(rr.A, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *AAAA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packDataAAAA(rr.AAAA, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *AFSDB) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Subtype, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Hostname, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *ANY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *CAA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint8(rr.Flag, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Tag, msg, off) - if err != nil { - return off, err - } - off, err = packStringOctet(rr.Value, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *CDNSKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *CDS) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.DigestType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Digest, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *CERT) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Type, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.Certificate, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *CNAME) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Target, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *DHCID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packStringBase64(rr.Digest, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *DLV) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.DigestType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Digest, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *DNAME) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Target, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *DNSKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *DS) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.DigestType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Digest, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *EID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packStringHex(rr.Endpoint, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *EUI48) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint48(rr.Address, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *EUI64) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint64(rr.Address, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *GID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint32(rr.Gid, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *GPOS) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packString(rr.Longitude, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Latitude, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Altitude, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *HINFO) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packString(rr.Cpu, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Os, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *HIP) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint8(rr.HitLength, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.PublicKeyAlgorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.PublicKeyLength, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Hit, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - off, err = packDataDomainNames(rr.RendezvousServers, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *KEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *KX) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Exchanger, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *L32) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packDataA(rr.Locator32, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *L64) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packUint64(rr.Locator64, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *LOC) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint8(rr.Version, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Size, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.HorizPre, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.VertPre, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Latitude, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Longitude, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Altitude, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *LP) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Fqdn, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *MB) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Mb, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *MD) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Md, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *MF) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Mf, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *MG) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Mg, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *MINFO) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Rmail, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Email, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *MR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Mr, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *MX) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Mx, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NAPTR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Order, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Service, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Regexp, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Replacement, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packUint64(rr.NodeID, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NIMLOC) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packStringHex(rr.Locator, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NINFO) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packStringTxt(rr.ZSData, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NS) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Ns, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NSAPPTR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Ptr, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NSEC) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.NextDomain, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packDataNsec(rr.TypeBitMap, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NSEC3) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint8(rr.Hash, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Iterations, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.SaltLength, msg, off) - if err != nil { - return off, err - } - if rr.Salt == "-" { /* do nothing, empty salt */ - } - if err != nil { - return off, err - } - off, err = packUint8(rr.HashLength, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase32(rr.NextDomain, msg, off) - if err != nil { - return off, err - } - off, err = packDataNsec(rr.TypeBitMap, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *NSEC3PARAM) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint8(rr.Hash, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Iterations, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.SaltLength, msg, off) - if err != nil { - return off, err - } - if rr.Salt == "-" { /* do nothing, empty salt */ - } - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *OPENPGPKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *OPT) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packDataOpt(rr.Option, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *PTR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Ptr, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *PX) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Map822, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Mapx400, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *RFC3597) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packStringHex(rr.Rdata, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *RKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *RP) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Mbox, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Txt, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *RRSIG) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.TypeCovered, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Labels, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.OrigTtl, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Expiration, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Inception, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.SignerName, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.Signature, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *RT) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Host, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *SIG) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.TypeCovered, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Labels, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.OrigTtl, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Expiration, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Inception, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.SignerName, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.Signature, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *SMIMEA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint8(rr.Usage, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Selector, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.MatchingType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Certificate, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *SOA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Ns, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Mbox, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packUint32(rr.Serial, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Refresh, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Retry, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Expire, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Minttl, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *SPF) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packStringTxt(rr.Txt, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *SRV) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Priority, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Weight, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Port, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.Target, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *SSHFP) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Type, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.FingerPrint, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *TA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.DigestType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Digest, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *TALINK) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.PreviousName, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = PackDomainName(rr.NextName, msg, off, compression, compress) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *TKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Algorithm, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packUint32(rr.Inception, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Expiration, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Mode, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Error, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.KeySize, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Key, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.OtherLen, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.OtherData, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *TLSA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint8(rr.Usage, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Selector, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.MatchingType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Certificate, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *TSIG) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = PackDomainName(rr.Algorithm, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packUint48(rr.TimeSigned, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Fudge, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.MACSize, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.MAC, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.OrigId, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Error, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.OtherLen, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.OtherData, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *TXT) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packStringTxt(rr.Txt, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *UID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint32(rr.Uid, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *UINFO) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packString(rr.Uinfo, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *URI) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packUint16(rr.Priority, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Weight, msg, off) - if err != nil { - return off, err - } - off, err = packStringOctet(rr.Target, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -func (rr *X25) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { - off, err := rr.Hdr.pack(msg, off, compression, compress) - if err != nil { - return off, err - } - headerEnd := off - off, err = packString(rr.PSDNAddress, msg, off) - if err != nil { - return off, err - } - rr.Header().Rdlength = uint16(off - headerEnd) - return off, nil -} - -// unpack*() functions - -func unpackA(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(A) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.A, off, err = unpackDataA(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackAAAA(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(AAAA) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.AAAA, off, err = unpackDataAAAA(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackAFSDB(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(AFSDB) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Subtype, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Hostname, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackANY(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(ANY) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - return rr, off, err -} - -func unpackCAA(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(CAA) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Flag, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Tag, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Value, off, err = unpackStringOctet(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackCDNSKEY(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(CDNSKEY) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Protocol, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackCDS(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(CDS) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.DigestType, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackCERT(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(CERT) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Type, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Certificate, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackCNAME(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(CNAME) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Target, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackDHCID(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(DHCID) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Digest, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackDLV(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(DLV) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.DigestType, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackDNAME(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(DNAME) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Target, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackDNSKEY(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(DNSKEY) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Protocol, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackDS(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(DS) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.DigestType, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackEID(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(EID) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Endpoint, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackEUI48(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(EUI48) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Address, off, err = unpackUint48(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackEUI64(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(EUI64) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Address, off, err = unpackUint64(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackGID(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(GID) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Gid, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackGPOS(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(GPOS) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Longitude, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Latitude, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Altitude, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackHINFO(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(HINFO) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Cpu, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Os, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackHIP(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(HIP) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.HitLength, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.PublicKeyAlgorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.PublicKeyLength, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Hit, off, err = unpackStringHex(msg, off, off+int(rr.HitLength)) - if err != nil { - return rr, off, err - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, off+int(rr.PublicKeyLength)) - if err != nil { - return rr, off, err - } - rr.RendezvousServers, off, err = unpackDataDomainNames(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackKEY(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(KEY) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Protocol, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackKX(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(KX) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Exchanger, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackL32(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(L32) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Locator32, off, err = unpackDataA(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackL64(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(L64) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Locator64, off, err = unpackUint64(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackLOC(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(LOC) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Version, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Size, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.HorizPre, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.VertPre, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Latitude, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Longitude, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Altitude, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackLP(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(LP) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Fqdn, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackMB(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(MB) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Mb, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackMD(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(MD) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Md, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackMF(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(MF) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Mf, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackMG(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(MG) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Mg, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackMINFO(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(MINFO) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Rmail, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Email, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackMR(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(MR) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Mr, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackMX(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(MX) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Mx, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNAPTR(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NAPTR) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Order, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Flags, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Service, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Regexp, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Replacement, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNID(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NID) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.NodeID, off, err = unpackUint64(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNIMLOC(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NIMLOC) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Locator, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNINFO(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NINFO) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.ZSData, off, err = unpackStringTxt(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNS(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NS) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Ns, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNSAPPTR(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NSAPPTR) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Ptr, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNSEC(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NSEC) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.NextDomain, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.TypeBitMap, off, err = unpackDataNsec(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNSEC3(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NSEC3) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Hash, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Flags, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Iterations, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.SaltLength, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Salt, off, err = unpackStringHex(msg, off, off+int(rr.SaltLength)) - if err != nil { - return rr, off, err - } - rr.HashLength, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.NextDomain, off, err = unpackStringBase32(msg, off, off+int(rr.HashLength)) - if err != nil { - return rr, off, err - } - rr.TypeBitMap, off, err = unpackDataNsec(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackNSEC3PARAM(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(NSEC3PARAM) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Hash, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Flags, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Iterations, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.SaltLength, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Salt, off, err = unpackStringHex(msg, off, off+int(rr.SaltLength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackOPENPGPKEY(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(OPENPGPKEY) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackOPT(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(OPT) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Option, off, err = unpackDataOpt(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackPTR(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(PTR) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Ptr, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackPX(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(PX) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Map822, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Mapx400, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackRFC3597(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(RFC3597) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Rdata, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackRKEY(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(RKEY) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Protocol, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackRP(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(RP) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Mbox, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Txt, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackRRSIG(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(RRSIG) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.TypeCovered, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Labels, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.OrigTtl, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Expiration, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Inception, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.SignerName, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Signature, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackRT(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(RT) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Host, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackSIG(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(SIG) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.TypeCovered, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Labels, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.OrigTtl, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Expiration, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Inception, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.SignerName, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Signature, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackSMIMEA(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(SMIMEA) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Usage, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Selector, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.MatchingType, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Certificate, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackSOA(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(SOA) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Ns, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Mbox, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Serial, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Refresh, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Retry, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Expire, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Minttl, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackSPF(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(SPF) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Txt, off, err = unpackStringTxt(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackSRV(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(SRV) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Priority, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Weight, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Port, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Target, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackSSHFP(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(SSHFP) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Type, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.FingerPrint, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackTA(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(TA) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.DigestType, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackTALINK(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(TALINK) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.PreviousName, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.NextName, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackTKEY(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(TKEY) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Algorithm, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Inception, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Expiration, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Mode, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Error, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.KeySize, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Key, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.OtherLen, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.OtherData, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackTLSA(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(TLSA) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Usage, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Selector, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.MatchingType, off, err = unpackUint8(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Certificate, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackTSIG(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(TSIG) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Algorithm, off, err = UnpackDomainName(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.TimeSigned, off, err = unpackUint48(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Fudge, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.MACSize, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.MAC, off, err = unpackStringHex(msg, off, off+int(rr.MACSize)) - if err != nil { - return rr, off, err - } - rr.OrigId, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Error, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.OtherLen, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.OtherData, off, err = unpackStringHex(msg, off, off+int(rr.OtherLen)) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackTXT(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(TXT) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Txt, off, err = unpackStringTxt(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackUID(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(UID) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Uid, off, err = unpackUint32(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackUINFO(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(UINFO) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Uinfo, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackURI(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(URI) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.Priority, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Weight, off, err = unpackUint16(msg, off) - if err != nil { - return rr, off, err - } - if off == len(msg) { - return rr, off, nil - } - rr.Target, off, err = unpackStringOctet(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -func unpackX25(h RR_Header, msg []byte, off int) (RR, int, error) { - rr := new(X25) - rr.Hdr = h - if noRdata(h) { - return rr, off, nil - } - var err error - rdStart := off - _ = rdStart - - rr.PSDNAddress, off, err = unpackString(msg, off) - if err != nil { - return rr, off, err - } - return rr, off, err -} - -var typeToUnpack = map[uint16]func(RR_Header, []byte, int) (RR, int, error){ - TypeA: unpackA, - TypeAAAA: unpackAAAA, - TypeAFSDB: unpackAFSDB, - TypeANY: unpackANY, - TypeCAA: unpackCAA, - TypeCDNSKEY: unpackCDNSKEY, - TypeCDS: unpackCDS, - TypeCERT: unpackCERT, - TypeCNAME: unpackCNAME, - TypeDHCID: unpackDHCID, - TypeDLV: unpackDLV, - TypeDNAME: unpackDNAME, - TypeDNSKEY: unpackDNSKEY, - TypeDS: unpackDS, - TypeEID: unpackEID, - TypeEUI48: unpackEUI48, - TypeEUI64: unpackEUI64, - TypeGID: unpackGID, - TypeGPOS: unpackGPOS, - TypeHINFO: unpackHINFO, - TypeHIP: unpackHIP, - TypeKEY: unpackKEY, - TypeKX: unpackKX, - TypeL32: unpackL32, - TypeL64: unpackL64, - TypeLOC: unpackLOC, - TypeLP: unpackLP, - TypeMB: unpackMB, - TypeMD: unpackMD, - TypeMF: unpackMF, - TypeMG: unpackMG, - TypeMINFO: unpackMINFO, - TypeMR: unpackMR, - TypeMX: unpackMX, - TypeNAPTR: unpackNAPTR, - TypeNID: unpackNID, - TypeNIMLOC: unpackNIMLOC, - TypeNINFO: unpackNINFO, - TypeNS: unpackNS, - TypeNSAPPTR: unpackNSAPPTR, - TypeNSEC: unpackNSEC, - TypeNSEC3: unpackNSEC3, - TypeNSEC3PARAM: unpackNSEC3PARAM, - TypeOPENPGPKEY: unpackOPENPGPKEY, - TypeOPT: unpackOPT, - TypePTR: unpackPTR, - TypePX: unpackPX, - TypeRKEY: unpackRKEY, - TypeRP: unpackRP, - TypeRRSIG: unpackRRSIG, - TypeRT: unpackRT, - TypeSIG: unpackSIG, - TypeSMIMEA: unpackSMIMEA, - TypeSOA: unpackSOA, - TypeSPF: unpackSPF, - TypeSRV: unpackSRV, - TypeSSHFP: unpackSSHFP, - TypeTA: unpackTA, - TypeTALINK: unpackTALINK, - TypeTKEY: unpackTKEY, - TypeTLSA: unpackTLSA, - TypeTSIG: unpackTSIG, - TypeTXT: unpackTXT, - TypeUID: unpackUID, - TypeUINFO: unpackUINFO, - TypeURI: unpackURI, - TypeX25: unpackX25, -} diff --git a/vendor/github.com/miekg/dns/ztypes.go b/vendor/github.com/miekg/dns/ztypes.go deleted file mode 100644 index 3c05277..0000000 --- a/vendor/github.com/miekg/dns/ztypes.go +++ /dev/null @@ -1,842 +0,0 @@ -// *** DO NOT MODIFY *** -// AUTOGENERATED BY go generate from type_generate.go - -package dns - -import ( - "encoding/base64" - "net" -) - -// TypeToRR is a map of constructors for each RR type. -var TypeToRR = map[uint16]func() RR{ - TypeA: func() RR { return new(A) }, - TypeAAAA: func() RR { return new(AAAA) }, - TypeAFSDB: func() RR { return new(AFSDB) }, - TypeANY: func() RR { return new(ANY) }, - TypeCAA: func() RR { return new(CAA) }, - TypeCDNSKEY: func() RR { return new(CDNSKEY) }, - TypeCDS: func() RR { return new(CDS) }, - TypeCERT: func() RR { return new(CERT) }, - TypeCNAME: func() RR { return new(CNAME) }, - TypeDHCID: func() RR { return new(DHCID) }, - TypeDLV: func() RR { return new(DLV) }, - TypeDNAME: func() RR { return new(DNAME) }, - TypeDNSKEY: func() RR { return new(DNSKEY) }, - TypeDS: func() RR { return new(DS) }, - TypeEID: func() RR { return new(EID) }, - TypeEUI48: func() RR { return new(EUI48) }, - TypeEUI64: func() RR { return new(EUI64) }, - TypeGID: func() RR { return new(GID) }, - TypeGPOS: func() RR { return new(GPOS) }, - TypeHINFO: func() RR { return new(HINFO) }, - TypeHIP: func() RR { return new(HIP) }, - TypeKEY: func() RR { return new(KEY) }, - TypeKX: func() RR { return new(KX) }, - TypeL32: func() RR { return new(L32) }, - TypeL64: func() RR { return new(L64) }, - TypeLOC: func() RR { return new(LOC) }, - TypeLP: func() RR { return new(LP) }, - TypeMB: func() RR { return new(MB) }, - TypeMD: func() RR { return new(MD) }, - TypeMF: func() RR { return new(MF) }, - TypeMG: func() RR { return new(MG) }, - TypeMINFO: func() RR { return new(MINFO) }, - TypeMR: func() RR { return new(MR) }, - TypeMX: func() RR { return new(MX) }, - TypeNAPTR: func() RR { return new(NAPTR) }, - TypeNID: func() RR { return new(NID) }, - TypeNIMLOC: func() RR { return new(NIMLOC) }, - TypeNINFO: func() RR { return new(NINFO) }, - TypeNS: func() RR { return new(NS) }, - TypeNSAPPTR: func() RR { return new(NSAPPTR) }, - TypeNSEC: func() RR { return new(NSEC) }, - TypeNSEC3: func() RR { return new(NSEC3) }, - TypeNSEC3PARAM: func() RR { return new(NSEC3PARAM) }, - TypeOPENPGPKEY: func() RR { return new(OPENPGPKEY) }, - TypeOPT: func() RR { return new(OPT) }, - TypePTR: func() RR { return new(PTR) }, - TypePX: func() RR { return new(PX) }, - TypeRKEY: func() RR { return new(RKEY) }, - TypeRP: func() RR { return new(RP) }, - TypeRRSIG: func() RR { return new(RRSIG) }, - TypeRT: func() RR { return new(RT) }, - TypeSIG: func() RR { return new(SIG) }, - TypeSMIMEA: func() RR { return new(SMIMEA) }, - TypeSOA: func() RR { return new(SOA) }, - TypeSPF: func() RR { return new(SPF) }, - TypeSRV: func() RR { return new(SRV) }, - TypeSSHFP: func() RR { return new(SSHFP) }, - TypeTA: func() RR { return new(TA) }, - TypeTALINK: func() RR { return new(TALINK) }, - TypeTKEY: func() RR { return new(TKEY) }, - TypeTLSA: func() RR { return new(TLSA) }, - TypeTSIG: func() RR { return new(TSIG) }, - TypeTXT: func() RR { return new(TXT) }, - TypeUID: func() RR { return new(UID) }, - TypeUINFO: func() RR { return new(UINFO) }, - TypeURI: func() RR { return new(URI) }, - TypeX25: func() RR { return new(X25) }, -} - -// TypeToString is a map of strings for each RR type. -var TypeToString = map[uint16]string{ - TypeA: "A", - TypeAAAA: "AAAA", - TypeAFSDB: "AFSDB", - TypeANY: "ANY", - TypeATMA: "ATMA", - TypeAXFR: "AXFR", - TypeCAA: "CAA", - TypeCDNSKEY: "CDNSKEY", - TypeCDS: "CDS", - TypeCERT: "CERT", - TypeCNAME: "CNAME", - TypeDHCID: "DHCID", - TypeDLV: "DLV", - TypeDNAME: "DNAME", - TypeDNSKEY: "DNSKEY", - TypeDS: "DS", - TypeEID: "EID", - TypeEUI48: "EUI48", - TypeEUI64: "EUI64", - TypeGID: "GID", - TypeGPOS: "GPOS", - TypeHINFO: "HINFO", - TypeHIP: "HIP", - TypeISDN: "ISDN", - TypeIXFR: "IXFR", - TypeKEY: "KEY", - TypeKX: "KX", - TypeL32: "L32", - TypeL64: "L64", - TypeLOC: "LOC", - TypeLP: "LP", - TypeMAILA: "MAILA", - TypeMAILB: "MAILB", - TypeMB: "MB", - TypeMD: "MD", - TypeMF: "MF", - TypeMG: "MG", - TypeMINFO: "MINFO", - TypeMR: "MR", - TypeMX: "MX", - TypeNAPTR: "NAPTR", - TypeNID: "NID", - TypeNIMLOC: "NIMLOC", - TypeNINFO: "NINFO", - TypeNS: "NS", - TypeNSEC: "NSEC", - TypeNSEC3: "NSEC3", - TypeNSEC3PARAM: "NSEC3PARAM", - TypeNULL: "NULL", - TypeNXT: "NXT", - TypeNone: "None", - TypeOPENPGPKEY: "OPENPGPKEY", - TypeOPT: "OPT", - TypePTR: "PTR", - TypePX: "PX", - TypeRKEY: "RKEY", - TypeRP: "RP", - TypeRRSIG: "RRSIG", - TypeRT: "RT", - TypeReserved: "Reserved", - TypeSIG: "SIG", - TypeSMIMEA: "SMIMEA", - TypeSOA: "SOA", - TypeSPF: "SPF", - TypeSRV: "SRV", - TypeSSHFP: "SSHFP", - TypeTA: "TA", - TypeTALINK: "TALINK", - TypeTKEY: "TKEY", - TypeTLSA: "TLSA", - TypeTSIG: "TSIG", - TypeTXT: "TXT", - TypeUID: "UID", - TypeUINFO: "UINFO", - TypeUNSPEC: "UNSPEC", - TypeURI: "URI", - TypeX25: "X25", - TypeNSAPPTR: "NSAP-PTR", -} - -// Header() functions -func (rr *A) Header() *RR_Header { return &rr.Hdr } -func (rr *AAAA) Header() *RR_Header { return &rr.Hdr } -func (rr *AFSDB) Header() *RR_Header { return &rr.Hdr } -func (rr *ANY) Header() *RR_Header { return &rr.Hdr } -func (rr *CAA) Header() *RR_Header { return &rr.Hdr } -func (rr *CDNSKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *CDS) Header() *RR_Header { return &rr.Hdr } -func (rr *CERT) Header() *RR_Header { return &rr.Hdr } -func (rr *CNAME) Header() *RR_Header { return &rr.Hdr } -func (rr *DHCID) Header() *RR_Header { return &rr.Hdr } -func (rr *DLV) Header() *RR_Header { return &rr.Hdr } -func (rr *DNAME) Header() *RR_Header { return &rr.Hdr } -func (rr *DNSKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *DS) Header() *RR_Header { return &rr.Hdr } -func (rr *EID) Header() *RR_Header { return &rr.Hdr } -func (rr *EUI48) Header() *RR_Header { return &rr.Hdr } -func (rr *EUI64) Header() *RR_Header { return &rr.Hdr } -func (rr *GID) Header() *RR_Header { return &rr.Hdr } -func (rr *GPOS) Header() *RR_Header { return &rr.Hdr } -func (rr *HINFO) Header() *RR_Header { return &rr.Hdr } -func (rr *HIP) Header() *RR_Header { return &rr.Hdr } -func (rr *KEY) Header() *RR_Header { return &rr.Hdr } -func (rr *KX) Header() *RR_Header { return &rr.Hdr } -func (rr *L32) Header() *RR_Header { return &rr.Hdr } -func (rr *L64) Header() *RR_Header { return &rr.Hdr } -func (rr *LOC) Header() *RR_Header { return &rr.Hdr } -func (rr *LP) Header() *RR_Header { return &rr.Hdr } -func (rr *MB) Header() *RR_Header { return &rr.Hdr } -func (rr *MD) Header() *RR_Header { return &rr.Hdr } -func (rr *MF) Header() *RR_Header { return &rr.Hdr } -func (rr *MG) Header() *RR_Header { return &rr.Hdr } -func (rr *MINFO) Header() *RR_Header { return &rr.Hdr } -func (rr *MR) Header() *RR_Header { return &rr.Hdr } -func (rr *MX) Header() *RR_Header { return &rr.Hdr } -func (rr *NAPTR) Header() *RR_Header { return &rr.Hdr } -func (rr *NID) Header() *RR_Header { return &rr.Hdr } -func (rr *NIMLOC) Header() *RR_Header { return &rr.Hdr } -func (rr *NINFO) Header() *RR_Header { return &rr.Hdr } -func (rr *NS) Header() *RR_Header { return &rr.Hdr } -func (rr *NSAPPTR) Header() *RR_Header { return &rr.Hdr } -func (rr *NSEC) Header() *RR_Header { return &rr.Hdr } -func (rr *NSEC3) Header() *RR_Header { return &rr.Hdr } -func (rr *NSEC3PARAM) Header() *RR_Header { return &rr.Hdr } -func (rr *OPENPGPKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *OPT) Header() *RR_Header { return &rr.Hdr } -func (rr *PTR) Header() *RR_Header { return &rr.Hdr } -func (rr *PX) Header() *RR_Header { return &rr.Hdr } -func (rr *RFC3597) Header() *RR_Header { return &rr.Hdr } -func (rr *RKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *RP) Header() *RR_Header { return &rr.Hdr } -func (rr *RRSIG) Header() *RR_Header { return &rr.Hdr } -func (rr *RT) Header() *RR_Header { return &rr.Hdr } -func (rr *SIG) Header() *RR_Header { return &rr.Hdr } -func (rr *SMIMEA) Header() *RR_Header { return &rr.Hdr } -func (rr *SOA) Header() *RR_Header { return &rr.Hdr } -func (rr *SPF) Header() *RR_Header { return &rr.Hdr } -func (rr *SRV) Header() *RR_Header { return &rr.Hdr } -func (rr *SSHFP) Header() *RR_Header { return &rr.Hdr } -func (rr *TA) Header() *RR_Header { return &rr.Hdr } -func (rr *TALINK) Header() *RR_Header { return &rr.Hdr } -func (rr *TKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *TLSA) Header() *RR_Header { return &rr.Hdr } -func (rr *TSIG) Header() *RR_Header { return &rr.Hdr } -func (rr *TXT) Header() *RR_Header { return &rr.Hdr } -func (rr *UID) Header() *RR_Header { return &rr.Hdr } -func (rr *UINFO) Header() *RR_Header { return &rr.Hdr } -func (rr *URI) Header() *RR_Header { return &rr.Hdr } -func (rr *X25) Header() *RR_Header { return &rr.Hdr } - -// len() functions -func (rr *A) len() int { - l := rr.Hdr.len() - l += net.IPv4len // A - return l -} -func (rr *AAAA) len() int { - l := rr.Hdr.len() - l += net.IPv6len // AAAA - return l -} -func (rr *AFSDB) len() int { - l := rr.Hdr.len() - l += 2 // Subtype - l += len(rr.Hostname) + 1 - return l -} -func (rr *ANY) len() int { - l := rr.Hdr.len() - return l -} -func (rr *CAA) len() int { - l := rr.Hdr.len() - l += 1 // Flag - l += len(rr.Tag) + 1 - l += len(rr.Value) - return l -} -func (rr *CERT) len() int { - l := rr.Hdr.len() - l += 2 // Type - l += 2 // KeyTag - l += 1 // Algorithm - l += base64.StdEncoding.DecodedLen(len(rr.Certificate)) - return l -} -func (rr *CNAME) len() int { - l := rr.Hdr.len() - l += len(rr.Target) + 1 - return l -} -func (rr *DHCID) len() int { - l := rr.Hdr.len() - l += base64.StdEncoding.DecodedLen(len(rr.Digest)) - return l -} -func (rr *DNAME) len() int { - l := rr.Hdr.len() - l += len(rr.Target) + 1 - return l -} -func (rr *DNSKEY) len() int { - l := rr.Hdr.len() - l += 2 // Flags - l += 1 // Protocol - l += 1 // Algorithm - l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) - return l -} -func (rr *DS) len() int { - l := rr.Hdr.len() - l += 2 // KeyTag - l += 1 // Algorithm - l += 1 // DigestType - l += len(rr.Digest)/2 + 1 - return l -} -func (rr *EID) len() int { - l := rr.Hdr.len() - l += len(rr.Endpoint)/2 + 1 - return l -} -func (rr *EUI48) len() int { - l := rr.Hdr.len() - l += 6 // Address - return l -} -func (rr *EUI64) len() int { - l := rr.Hdr.len() - l += 8 // Address - return l -} -func (rr *GID) len() int { - l := rr.Hdr.len() - l += 4 // Gid - return l -} -func (rr *GPOS) len() int { - l := rr.Hdr.len() - l += len(rr.Longitude) + 1 - l += len(rr.Latitude) + 1 - l += len(rr.Altitude) + 1 - return l -} -func (rr *HINFO) len() int { - l := rr.Hdr.len() - l += len(rr.Cpu) + 1 - l += len(rr.Os) + 1 - return l -} -func (rr *HIP) len() int { - l := rr.Hdr.len() - l += 1 // HitLength - l += 1 // PublicKeyAlgorithm - l += 2 // PublicKeyLength - l += len(rr.Hit)/2 + 1 - l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) - for _, x := range rr.RendezvousServers { - l += len(x) + 1 - } - return l -} -func (rr *KX) len() int { - l := rr.Hdr.len() - l += 2 // Preference - l += len(rr.Exchanger) + 1 - return l -} -func (rr *L32) len() int { - l := rr.Hdr.len() - l += 2 // Preference - l += net.IPv4len // Locator32 - return l -} -func (rr *L64) len() int { - l := rr.Hdr.len() - l += 2 // Preference - l += 8 // Locator64 - return l -} -func (rr *LOC) len() int { - l := rr.Hdr.len() - l += 1 // Version - l += 1 // Size - l += 1 // HorizPre - l += 1 // VertPre - l += 4 // Latitude - l += 4 // Longitude - l += 4 // Altitude - return l -} -func (rr *LP) len() int { - l := rr.Hdr.len() - l += 2 // Preference - l += len(rr.Fqdn) + 1 - return l -} -func (rr *MB) len() int { - l := rr.Hdr.len() - l += len(rr.Mb) + 1 - return l -} -func (rr *MD) len() int { - l := rr.Hdr.len() - l += len(rr.Md) + 1 - return l -} -func (rr *MF) len() int { - l := rr.Hdr.len() - l += len(rr.Mf) + 1 - return l -} -func (rr *MG) len() int { - l := rr.Hdr.len() - l += len(rr.Mg) + 1 - return l -} -func (rr *MINFO) len() int { - l := rr.Hdr.len() - l += len(rr.Rmail) + 1 - l += len(rr.Email) + 1 - return l -} -func (rr *MR) len() int { - l := rr.Hdr.len() - l += len(rr.Mr) + 1 - return l -} -func (rr *MX) len() int { - l := rr.Hdr.len() - l += 2 // Preference - l += len(rr.Mx) + 1 - return l -} -func (rr *NAPTR) len() int { - l := rr.Hdr.len() - l += 2 // Order - l += 2 // Preference - l += len(rr.Flags) + 1 - l += len(rr.Service) + 1 - l += len(rr.Regexp) + 1 - l += len(rr.Replacement) + 1 - return l -} -func (rr *NID) len() int { - l := rr.Hdr.len() - l += 2 // Preference - l += 8 // NodeID - return l -} -func (rr *NIMLOC) len() int { - l := rr.Hdr.len() - l += len(rr.Locator)/2 + 1 - return l -} -func (rr *NINFO) len() int { - l := rr.Hdr.len() - for _, x := range rr.ZSData { - l += len(x) + 1 - } - return l -} -func (rr *NS) len() int { - l := rr.Hdr.len() - l += len(rr.Ns) + 1 - return l -} -func (rr *NSAPPTR) len() int { - l := rr.Hdr.len() - l += len(rr.Ptr) + 1 - return l -} -func (rr *NSEC3PARAM) len() int { - l := rr.Hdr.len() - l += 1 // Hash - l += 1 // Flags - l += 2 // Iterations - l += 1 // SaltLength - l += len(rr.Salt)/2 + 1 - return l -} -func (rr *OPENPGPKEY) len() int { - l := rr.Hdr.len() - l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) - return l -} -func (rr *PTR) len() int { - l := rr.Hdr.len() - l += len(rr.Ptr) + 1 - return l -} -func (rr *PX) len() int { - l := rr.Hdr.len() - l += 2 // Preference - l += len(rr.Map822) + 1 - l += len(rr.Mapx400) + 1 - return l -} -func (rr *RFC3597) len() int { - l := rr.Hdr.len() - l += len(rr.Rdata)/2 + 1 - return l -} -func (rr *RKEY) len() int { - l := rr.Hdr.len() - l += 2 // Flags - l += 1 // Protocol - l += 1 // Algorithm - l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) - return l -} -func (rr *RP) len() int { - l := rr.Hdr.len() - l += len(rr.Mbox) + 1 - l += len(rr.Txt) + 1 - return l -} -func (rr *RRSIG) len() int { - l := rr.Hdr.len() - l += 2 // TypeCovered - l += 1 // Algorithm - l += 1 // Labels - l += 4 // OrigTtl - l += 4 // Expiration - l += 4 // Inception - l += 2 // KeyTag - l += len(rr.SignerName) + 1 - l += base64.StdEncoding.DecodedLen(len(rr.Signature)) - return l -} -func (rr *RT) len() int { - l := rr.Hdr.len() - l += 2 // Preference - l += len(rr.Host) + 1 - return l -} -func (rr *SMIMEA) len() int { - l := rr.Hdr.len() - l += 1 // Usage - l += 1 // Selector - l += 1 // MatchingType - l += len(rr.Certificate)/2 + 1 - return l -} -func (rr *SOA) len() int { - l := rr.Hdr.len() - l += len(rr.Ns) + 1 - l += len(rr.Mbox) + 1 - l += 4 // Serial - l += 4 // Refresh - l += 4 // Retry - l += 4 // Expire - l += 4 // Minttl - return l -} -func (rr *SPF) len() int { - l := rr.Hdr.len() - for _, x := range rr.Txt { - l += len(x) + 1 - } - return l -} -func (rr *SRV) len() int { - l := rr.Hdr.len() - l += 2 // Priority - l += 2 // Weight - l += 2 // Port - l += len(rr.Target) + 1 - return l -} -func (rr *SSHFP) len() int { - l := rr.Hdr.len() - l += 1 // Algorithm - l += 1 // Type - l += len(rr.FingerPrint)/2 + 1 - return l -} -func (rr *TA) len() int { - l := rr.Hdr.len() - l += 2 // KeyTag - l += 1 // Algorithm - l += 1 // DigestType - l += len(rr.Digest)/2 + 1 - return l -} -func (rr *TALINK) len() int { - l := rr.Hdr.len() - l += len(rr.PreviousName) + 1 - l += len(rr.NextName) + 1 - return l -} -func (rr *TKEY) len() int { - l := rr.Hdr.len() - l += len(rr.Algorithm) + 1 - l += 4 // Inception - l += 4 // Expiration - l += 2 // Mode - l += 2 // Error - l += 2 // KeySize - l += len(rr.Key) + 1 - l += 2 // OtherLen - l += len(rr.OtherData) + 1 - return l -} -func (rr *TLSA) len() int { - l := rr.Hdr.len() - l += 1 // Usage - l += 1 // Selector - l += 1 // MatchingType - l += len(rr.Certificate)/2 + 1 - return l -} -func (rr *TSIG) len() int { - l := rr.Hdr.len() - l += len(rr.Algorithm) + 1 - l += 6 // TimeSigned - l += 2 // Fudge - l += 2 // MACSize - l += len(rr.MAC)/2 + 1 - l += 2 // OrigId - l += 2 // Error - l += 2 // OtherLen - l += len(rr.OtherData)/2 + 1 - return l -} -func (rr *TXT) len() int { - l := rr.Hdr.len() - for _, x := range rr.Txt { - l += len(x) + 1 - } - return l -} -func (rr *UID) len() int { - l := rr.Hdr.len() - l += 4 // Uid - return l -} -func (rr *UINFO) len() int { - l := rr.Hdr.len() - l += len(rr.Uinfo) + 1 - return l -} -func (rr *URI) len() int { - l := rr.Hdr.len() - l += 2 // Priority - l += 2 // Weight - l += len(rr.Target) - return l -} -func (rr *X25) len() int { - l := rr.Hdr.len() - l += len(rr.PSDNAddress) + 1 - return l -} - -// copy() functions -func (rr *A) copy() RR { - return &A{*rr.Hdr.copyHeader(), copyIP(rr.A)} -} -func (rr *AAAA) copy() RR { - return &AAAA{*rr.Hdr.copyHeader(), copyIP(rr.AAAA)} -} -func (rr *AFSDB) copy() RR { - return &AFSDB{*rr.Hdr.copyHeader(), rr.Subtype, rr.Hostname} -} -func (rr *ANY) copy() RR { - return &ANY{*rr.Hdr.copyHeader()} -} -func (rr *CAA) copy() RR { - return &CAA{*rr.Hdr.copyHeader(), rr.Flag, rr.Tag, rr.Value} -} -func (rr *CERT) copy() RR { - return &CERT{*rr.Hdr.copyHeader(), rr.Type, rr.KeyTag, rr.Algorithm, rr.Certificate} -} -func (rr *CNAME) copy() RR { - return &CNAME{*rr.Hdr.copyHeader(), rr.Target} -} -func (rr *DHCID) copy() RR { - return &DHCID{*rr.Hdr.copyHeader(), rr.Digest} -} -func (rr *DNAME) copy() RR { - return &DNAME{*rr.Hdr.copyHeader(), rr.Target} -} -func (rr *DNSKEY) copy() RR { - return &DNSKEY{*rr.Hdr.copyHeader(), rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey} -} -func (rr *DS) copy() RR { - return &DS{*rr.Hdr.copyHeader(), rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest} -} -func (rr *EID) copy() RR { - return &EID{*rr.Hdr.copyHeader(), rr.Endpoint} -} -func (rr *EUI48) copy() RR { - return &EUI48{*rr.Hdr.copyHeader(), rr.Address} -} -func (rr *EUI64) copy() RR { - return &EUI64{*rr.Hdr.copyHeader(), rr.Address} -} -func (rr *GID) copy() RR { - return &GID{*rr.Hdr.copyHeader(), rr.Gid} -} -func (rr *GPOS) copy() RR { - return &GPOS{*rr.Hdr.copyHeader(), rr.Longitude, rr.Latitude, rr.Altitude} -} -func (rr *HINFO) copy() RR { - return &HINFO{*rr.Hdr.copyHeader(), rr.Cpu, rr.Os} -} -func (rr *HIP) copy() RR { - RendezvousServers := make([]string, len(rr.RendezvousServers)) - copy(RendezvousServers, rr.RendezvousServers) - return &HIP{*rr.Hdr.copyHeader(), rr.HitLength, rr.PublicKeyAlgorithm, rr.PublicKeyLength, rr.Hit, rr.PublicKey, RendezvousServers} -} -func (rr *KX) copy() RR { - return &KX{*rr.Hdr.copyHeader(), rr.Preference, rr.Exchanger} -} -func (rr *L32) copy() RR { - return &L32{*rr.Hdr.copyHeader(), rr.Preference, copyIP(rr.Locator32)} -} -func (rr *L64) copy() RR { - return &L64{*rr.Hdr.copyHeader(), rr.Preference, rr.Locator64} -} -func (rr *LOC) copy() RR { - return &LOC{*rr.Hdr.copyHeader(), rr.Version, rr.Size, rr.HorizPre, rr.VertPre, rr.Latitude, rr.Longitude, rr.Altitude} -} -func (rr *LP) copy() RR { - return &LP{*rr.Hdr.copyHeader(), rr.Preference, rr.Fqdn} -} -func (rr *MB) copy() RR { - return &MB{*rr.Hdr.copyHeader(), rr.Mb} -} -func (rr *MD) copy() RR { - return &MD{*rr.Hdr.copyHeader(), rr.Md} -} -func (rr *MF) copy() RR { - return &MF{*rr.Hdr.copyHeader(), rr.Mf} -} -func (rr *MG) copy() RR { - return &MG{*rr.Hdr.copyHeader(), rr.Mg} -} -func (rr *MINFO) copy() RR { - return &MINFO{*rr.Hdr.copyHeader(), rr.Rmail, rr.Email} -} -func (rr *MR) copy() RR { - return &MR{*rr.Hdr.copyHeader(), rr.Mr} -} -func (rr *MX) copy() RR { - return &MX{*rr.Hdr.copyHeader(), rr.Preference, rr.Mx} -} -func (rr *NAPTR) copy() RR { - return &NAPTR{*rr.Hdr.copyHeader(), rr.Order, rr.Preference, rr.Flags, rr.Service, rr.Regexp, rr.Replacement} -} -func (rr *NID) copy() RR { - return &NID{*rr.Hdr.copyHeader(), rr.Preference, rr.NodeID} -} -func (rr *NIMLOC) copy() RR { - return &NIMLOC{*rr.Hdr.copyHeader(), rr.Locator} -} -func (rr *NINFO) copy() RR { - ZSData := make([]string, len(rr.ZSData)) - copy(ZSData, rr.ZSData) - return &NINFO{*rr.Hdr.copyHeader(), ZSData} -} -func (rr *NS) copy() RR { - return &NS{*rr.Hdr.copyHeader(), rr.Ns} -} -func (rr *NSAPPTR) copy() RR { - return &NSAPPTR{*rr.Hdr.copyHeader(), rr.Ptr} -} -func (rr *NSEC) copy() RR { - TypeBitMap := make([]uint16, len(rr.TypeBitMap)) - copy(TypeBitMap, rr.TypeBitMap) - return &NSEC{*rr.Hdr.copyHeader(), rr.NextDomain, TypeBitMap} -} -func (rr *NSEC3) copy() RR { - TypeBitMap := make([]uint16, len(rr.TypeBitMap)) - copy(TypeBitMap, rr.TypeBitMap) - return &NSEC3{*rr.Hdr.copyHeader(), rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt, rr.HashLength, rr.NextDomain, TypeBitMap} -} -func (rr *NSEC3PARAM) copy() RR { - return &NSEC3PARAM{*rr.Hdr.copyHeader(), rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt} -} -func (rr *OPENPGPKEY) copy() RR { - return &OPENPGPKEY{*rr.Hdr.copyHeader(), rr.PublicKey} -} -func (rr *OPT) copy() RR { - Option := make([]EDNS0, len(rr.Option)) - copy(Option, rr.Option) - return &OPT{*rr.Hdr.copyHeader(), Option} -} -func (rr *PTR) copy() RR { - return &PTR{*rr.Hdr.copyHeader(), rr.Ptr} -} -func (rr *PX) copy() RR { - return &PX{*rr.Hdr.copyHeader(), rr.Preference, rr.Map822, rr.Mapx400} -} -func (rr *RFC3597) copy() RR { - return &RFC3597{*rr.Hdr.copyHeader(), rr.Rdata} -} -func (rr *RKEY) copy() RR { - return &RKEY{*rr.Hdr.copyHeader(), rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey} -} -func (rr *RP) copy() RR { - return &RP{*rr.Hdr.copyHeader(), rr.Mbox, rr.Txt} -} -func (rr *RRSIG) copy() RR { - return &RRSIG{*rr.Hdr.copyHeader(), rr.TypeCovered, rr.Algorithm, rr.Labels, rr.OrigTtl, rr.Expiration, rr.Inception, rr.KeyTag, rr.SignerName, rr.Signature} -} -func (rr *RT) copy() RR { - return &RT{*rr.Hdr.copyHeader(), rr.Preference, rr.Host} -} -func (rr *SMIMEA) copy() RR { - return &SMIMEA{*rr.Hdr.copyHeader(), rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate} -} -func (rr *SOA) copy() RR { - return &SOA{*rr.Hdr.copyHeader(), rr.Ns, rr.Mbox, rr.Serial, rr.Refresh, rr.Retry, rr.Expire, rr.Minttl} -} -func (rr *SPF) copy() RR { - Txt := make([]string, len(rr.Txt)) - copy(Txt, rr.Txt) - return &SPF{*rr.Hdr.copyHeader(), Txt} -} -func (rr *SRV) copy() RR { - return &SRV{*rr.Hdr.copyHeader(), rr.Priority, rr.Weight, rr.Port, rr.Target} -} -func (rr *SSHFP) copy() RR { - return &SSHFP{*rr.Hdr.copyHeader(), rr.Algorithm, rr.Type, rr.FingerPrint} -} -func (rr *TA) copy() RR { - return &TA{*rr.Hdr.copyHeader(), rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest} -} -func (rr *TALINK) copy() RR { - return &TALINK{*rr.Hdr.copyHeader(), rr.PreviousName, rr.NextName} -} -func (rr *TKEY) copy() RR { - return &TKEY{*rr.Hdr.copyHeader(), rr.Algorithm, rr.Inception, rr.Expiration, rr.Mode, rr.Error, rr.KeySize, rr.Key, rr.OtherLen, rr.OtherData} -} -func (rr *TLSA) copy() RR { - return &TLSA{*rr.Hdr.copyHeader(), rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate} -} -func (rr *TSIG) copy() RR { - return &TSIG{*rr.Hdr.copyHeader(), rr.Algorithm, rr.TimeSigned, rr.Fudge, rr.MACSize, rr.MAC, rr.OrigId, rr.Error, rr.OtherLen, rr.OtherData} -} -func (rr *TXT) copy() RR { - Txt := make([]string, len(rr.Txt)) - copy(Txt, rr.Txt) - return &TXT{*rr.Hdr.copyHeader(), Txt} -} -func (rr *UID) copy() RR { - return &UID{*rr.Hdr.copyHeader(), rr.Uid} -} -func (rr *UINFO) copy() RR { - return &UINFO{*rr.Hdr.copyHeader(), rr.Uinfo} -} -func (rr *URI) copy() RR { - return &URI{*rr.Hdr.copyHeader(), rr.Priority, rr.Weight, rr.Target} -} -func (rr *X25) copy() RR { - return &X25{*rr.Hdr.copyHeader(), rr.PSDNAddress} -} diff --git a/vendor/github.com/mitchellh/cli/LICENSE b/vendor/github.com/mitchellh/cli/LICENSE new file mode 100644 index 0000000..c33dcc7 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/vendor/github.com/mitchellh/cli/Makefile b/vendor/github.com/mitchellh/cli/Makefile new file mode 100644 index 0000000..4874b00 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/Makefile @@ -0,0 +1,20 @@ +TEST?=./... + +default: test + +# test runs the test suite and vets the code +test: + go list $(TEST) | xargs -n1 go test -timeout=60s -parallel=10 $(TESTARGS) + +# testrace runs the race checker +testrace: + go list $(TEST) | xargs -n1 go test -race $(TESTARGS) + +# updatedeps installs all the dependencies to run and build +updatedeps: + go list ./... \ + | xargs go list -f '{{ join .Deps "\n" }}{{ printf "\n" }}{{ join .TestImports "\n" }}' \ + | grep -v github.com/mitchellh/cli \ + | xargs go get -f -u -v + +.PHONY: test testrace updatedeps diff --git a/vendor/github.com/mitchellh/cli/README.md b/vendor/github.com/mitchellh/cli/README.md new file mode 100644 index 0000000..8f02cdd --- /dev/null +++ b/vendor/github.com/mitchellh/cli/README.md @@ -0,0 +1,67 @@ +# Go CLI Library [![GoDoc](https://godoc.org/github.com/mitchellh/cli?status.png)](https://godoc.org/github.com/mitchellh/cli) + +cli is a library for implementing powerful command-line interfaces in Go. +cli is the library that powers the CLI for +[Packer](https://github.com/mitchellh/packer), +[Serf](https://github.com/hashicorp/serf), +[Consul](https://github.com/hashicorp/consul), +[Vault](https://github.com/hashicorp/vault), +[Terraform](https://github.com/hashicorp/terraform), and +[Nomad](https://github.com/hashicorp/nomad). + +## Features + +* Easy sub-command based CLIs: `cli foo`, `cli bar`, etc. + +* Support for nested subcommands such as `cli foo bar`. + +* Optional support for default subcommands so `cli` does something + other than error. + +* Support for shell autocompletion of subcommands, flags, and arguments + with callbacks in Go. You don't need to write any shell code. + +* Automatic help generation for listing subcommands + +* Automatic help flag recognition of `-h`, `--help`, etc. + +* Automatic version flag recognition of `-v`, `--version`. + +* Helpers for interacting with the terminal, such as outputting information, + asking for input, etc. These are optional, you can always interact with the + terminal however you choose. + +* Use of Go interfaces/types makes augmenting various parts of the library a + piece of cake. + +## Example + +Below is a simple example of creating and running a CLI + +```go +package main + +import ( + "log" + "os" + + "github.com/mitchellh/cli" +) + +func main() { + c := cli.NewCLI("app", "1.0.0") + c.Args = os.Args[1:] + c.Commands = map[string]cli.CommandFactory{ + "foo": fooCommandFactory, + "bar": barCommandFactory, + } + + exitStatus, err := c.Run() + if err != nil { + log.Println(err) + } + + os.Exit(exitStatus) +} +``` + diff --git a/vendor/github.com/mitchellh/cli/autocomplete.go b/vendor/github.com/mitchellh/cli/autocomplete.go new file mode 100644 index 0000000..3bec625 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/autocomplete.go @@ -0,0 +1,43 @@ +package cli + +import ( + "github.com/posener/complete/cmd/install" +) + +// autocompleteInstaller is an interface to be implemented to perform the +// autocomplete installation and uninstallation with a CLI. +// +// This interface is not exported because it only exists for unit tests +// to be able to test that the installation is called properly. +type autocompleteInstaller interface { + Install(string) error + Uninstall(string) error +} + +// realAutocompleteInstaller uses the real install package to do the +// install/uninstall. +type realAutocompleteInstaller struct{} + +func (i *realAutocompleteInstaller) Install(cmd string) error { + return install.Install(cmd) +} + +func (i *realAutocompleteInstaller) Uninstall(cmd string) error { + return install.Uninstall(cmd) +} + +// mockAutocompleteInstaller is used for tests to record the install/uninstall. +type mockAutocompleteInstaller struct { + InstallCalled bool + UninstallCalled bool +} + +func (i *mockAutocompleteInstaller) Install(cmd string) error { + i.InstallCalled = true + return nil +} + +func (i *mockAutocompleteInstaller) Uninstall(cmd string) error { + i.UninstallCalled = true + return nil +} diff --git a/vendor/github.com/mitchellh/cli/cli.go b/vendor/github.com/mitchellh/cli/cli.go new file mode 100644 index 0000000..61206d6 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/cli.go @@ -0,0 +1,695 @@ +package cli + +import ( + "fmt" + "io" + "os" + "regexp" + "sort" + "strings" + "sync" + "text/template" + + "github.com/armon/go-radix" + "github.com/posener/complete" +) + +// CLI contains the state necessary to run subcommands and parse the +// command line arguments. +// +// CLI also supports nested subcommands, such as "cli foo bar". To use +// nested subcommands, the key in the Commands mapping below contains the +// full subcommand. In this example, it would be "foo bar". +// +// If you use a CLI with nested subcommands, some semantics change due to +// ambiguities: +// +// * We use longest prefix matching to find a matching subcommand. This +// means if you register "foo bar" and the user executes "cli foo qux", +// the "foo" command will be executed with the arg "qux". It is up to +// you to handle these args. One option is to just return the special +// help return code `RunResultHelp` to display help and exit. +// +// * The help flag "-h" or "-help" will look at all args to determine +// the help function. For example: "otto apps list -h" will show the +// help for "apps list" but "otto apps -h" will show it for "apps". +// In the normal CLI, only the first subcommand is used. +// +// * The help flag will list any subcommands that a command takes +// as well as the command's help itself. If there are no subcommands, +// it will note this. If the CLI itself has no subcommands, this entire +// section is omitted. +// +// * Any parent commands that don't exist are automatically created as +// no-op commands that just show help for other subcommands. For example, +// if you only register "foo bar", then "foo" is automatically created. +// +type CLI struct { + // Args is the list of command-line arguments received excluding + // the name of the app. For example, if the command "./cli foo bar" + // was invoked, then Args should be []string{"foo", "bar"}. + Args []string + + // Commands is a mapping of subcommand names to a factory function + // for creating that Command implementation. If there is a command + // with a blank string "", then it will be used as the default command + // if no subcommand is specified. + // + // If the key has a space in it, this will create a nested subcommand. + // For example, if the key is "foo bar", then to access it our CLI + // must be accessed with "./cli foo bar". See the docs for CLI for + // notes on how this changes some other behavior of the CLI as well. + // + // The factory should be as cheap as possible, ideally only allocating + // a struct. The factory may be called multiple times in the course + // of a command execution and certain events such as help require the + // instantiation of all commands. Expensive initialization should be + // deferred to function calls within the interface implementation. + Commands map[string]CommandFactory + + // HiddenCommands is a list of commands that are "hidden". Hidden + // commands are not given to the help function callback and do not + // show up in autocomplete. The values in the slice should be equivalent + // to the keys in the command map. + HiddenCommands []string + + // Name defines the name of the CLI. + Name string + + // Version of the CLI. + Version string + + // Autocomplete enables or disables subcommand auto-completion support. + // This is enabled by default when NewCLI is called. Otherwise, this + // must enabled explicitly. + // + // Autocomplete requires the "Name" option to be set on CLI. This name + // should be set exactly to the binary name that is autocompleted. + // + // Autocompletion is supported via the github.com/posener/complete + // library. This library supports both bash and zsh. To add support + // for other shells, please see that library. + // + // AutocompleteInstall and AutocompleteUninstall are the global flag + // names for installing and uninstalling the autocompletion handlers + // for the user's shell. The flag should omit the hyphen(s) in front of + // the value. Both single and double hyphens will automatically be supported + // for the flag name. These default to `autocomplete-install` and + // `autocomplete-uninstall` respectively. + // + // AutocompleteNoDefaultFlags is a boolean which controls if the default auto- + // complete flags like -help and -version are added to the output. + // + // AutocompleteGlobalFlags are a mapping of global flags for + // autocompletion. The help and version flags are automatically added. + Autocomplete bool + AutocompleteInstall string + AutocompleteUninstall string + AutocompleteNoDefaultFlags bool + AutocompleteGlobalFlags complete.Flags + autocompleteInstaller autocompleteInstaller // For tests + + // HelpFunc and HelpWriter are used to output help information, if + // requested. + // + // HelpFunc is the function called to generate the generic help + // text that is shown if help must be shown for the CLI that doesn't + // pertain to a specific command. + // + // HelpWriter is the Writer where the help text is outputted to. If + // not specified, it will default to Stderr. + HelpFunc HelpFunc + HelpWriter io.Writer + + //--------------------------------------------------------------- + // Internal fields set automatically + + once sync.Once + autocomplete *complete.Complete + commandTree *radix.Tree + commandNested bool + commandHidden map[string]struct{} + subcommand string + subcommandArgs []string + topFlags []string + + // These are true when special global flags are set. We can/should + // probably use a bitset for this one day. + isHelp bool + isVersion bool + isAutocompleteInstall bool + isAutocompleteUninstall bool +} + +// NewClI returns a new CLI instance with sensible defaults. +func NewCLI(app, version string) *CLI { + return &CLI{ + Name: app, + Version: version, + HelpFunc: BasicHelpFunc(app), + Autocomplete: true, + } + +} + +// IsHelp returns whether or not the help flag is present within the +// arguments. +func (c *CLI) IsHelp() bool { + c.once.Do(c.init) + return c.isHelp +} + +// IsVersion returns whether or not the version flag is present within the +// arguments. +func (c *CLI) IsVersion() bool { + c.once.Do(c.init) + return c.isVersion +} + +// Run runs the actual CLI based on the arguments given. +func (c *CLI) Run() (int, error) { + c.once.Do(c.init) + + // If this is a autocompletion request, satisfy it. This must be called + // first before anything else since its possible to be autocompleting + // -help or -version or other flags and we want to show completions + // and not actually write the help or version. + if c.Autocomplete && c.autocomplete.Complete() { + return 0, nil + } + + // Just show the version and exit if instructed. + if c.IsVersion() && c.Version != "" { + c.HelpWriter.Write([]byte(c.Version + "\n")) + return 0, nil + } + + // Just print the help when only '-h' or '--help' is passed. + if c.IsHelp() && c.Subcommand() == "" { + c.HelpWriter.Write([]byte(c.HelpFunc(c.helpCommands(c.Subcommand())) + "\n")) + return 0, nil + } + + // If we're attempting to install or uninstall autocomplete then handle + if c.Autocomplete { + // Autocomplete requires the "Name" to be set so that we know what + // command to setup the autocomplete on. + if c.Name == "" { + return 1, fmt.Errorf( + "internal error: CLI.Name must be specified for autocomplete to work") + } + + // If both install and uninstall flags are specified, then error + if c.isAutocompleteInstall && c.isAutocompleteUninstall { + return 1, fmt.Errorf( + "Either the autocomplete install or uninstall flag may " + + "be specified, but not both.") + } + + // If the install flag is specified, perform the install or uninstall + if c.isAutocompleteInstall { + if err := c.autocompleteInstaller.Install(c.Name); err != nil { + return 1, err + } + + return 0, nil + } + + if c.isAutocompleteUninstall { + if err := c.autocompleteInstaller.Uninstall(c.Name); err != nil { + return 1, err + } + + return 0, nil + } + } + + // Attempt to get the factory function for creating the command + // implementation. If the command is invalid or blank, it is an error. + raw, ok := c.commandTree.Get(c.Subcommand()) + if !ok { + c.HelpWriter.Write([]byte(c.HelpFunc(c.helpCommands(c.subcommandParent())) + "\n")) + return 127, nil + } + + command, err := raw.(CommandFactory)() + if err != nil { + return 1, err + } + + // If we've been instructed to just print the help, then print it + if c.IsHelp() { + c.commandHelp(command) + return 0, nil + } + + // If there is an invalid flag, then error + if len(c.topFlags) > 0 { + c.HelpWriter.Write([]byte( + "Invalid flags before the subcommand. If these flags are for\n" + + "the subcommand, please put them after the subcommand.\n\n")) + c.commandHelp(command) + return 1, nil + } + + code := command.Run(c.SubcommandArgs()) + if code == RunResultHelp { + // Requesting help + c.commandHelp(command) + return 1, nil + } + + return code, nil +} + +// Subcommand returns the subcommand that the CLI would execute. For +// example, a CLI from "--version version --help" would return a Subcommand +// of "version" +func (c *CLI) Subcommand() string { + c.once.Do(c.init) + return c.subcommand +} + +// SubcommandArgs returns the arguments that will be passed to the +// subcommand. +func (c *CLI) SubcommandArgs() []string { + c.once.Do(c.init) + return c.subcommandArgs +} + +// subcommandParent returns the parent of this subcommand, if there is one. +// If there isn't on, "" is returned. +func (c *CLI) subcommandParent() string { + // Get the subcommand, if it is "" alread just return + sub := c.Subcommand() + if sub == "" { + return sub + } + + // Clear any trailing spaces and find the last space + sub = strings.TrimRight(sub, " ") + idx := strings.LastIndex(sub, " ") + + if idx == -1 { + // No space means our parent is root + return "" + } + + return sub[:idx] +} + +func (c *CLI) init() { + if c.HelpFunc == nil { + c.HelpFunc = BasicHelpFunc("app") + + if c.Name != "" { + c.HelpFunc = BasicHelpFunc(c.Name) + } + } + + if c.HelpWriter == nil { + c.HelpWriter = os.Stderr + } + + // Build our hidden commands + if len(c.HiddenCommands) > 0 { + c.commandHidden = make(map[string]struct{}) + for _, h := range c.HiddenCommands { + c.commandHidden[h] = struct{}{} + } + } + + // Build our command tree + c.commandTree = radix.New() + c.commandNested = false + for k, v := range c.Commands { + k = strings.TrimSpace(k) + c.commandTree.Insert(k, v) + if strings.ContainsRune(k, ' ') { + c.commandNested = true + } + } + + // Go through the key and fill in any missing parent commands + if c.commandNested { + var walkFn radix.WalkFn + toInsert := make(map[string]struct{}) + walkFn = func(k string, raw interface{}) bool { + idx := strings.LastIndex(k, " ") + if idx == -1 { + // If there is no space, just ignore top level commands + return false + } + + // Trim up to that space so we can get the expected parent + k = k[:idx] + if _, ok := c.commandTree.Get(k); ok { + // Yay we have the parent! + return false + } + + // We're missing the parent, so let's insert this + toInsert[k] = struct{}{} + + // Call the walk function recursively so we check this one too + return walkFn(k, nil) + } + + // Walk! + c.commandTree.Walk(walkFn) + + // Insert any that we're missing + for k := range toInsert { + var f CommandFactory = func() (Command, error) { + return &MockCommand{ + HelpText: "This command is accessed by using one of the subcommands below.", + RunResult: RunResultHelp, + }, nil + } + + c.commandTree.Insert(k, f) + } + } + + // Setup autocomplete if we have it enabled. We have to do this after + // the command tree is setup so we can use the radix tree to easily find + // all subcommands. + if c.Autocomplete { + c.initAutocomplete() + } + + // Process the args + c.processArgs() +} + +func (c *CLI) initAutocomplete() { + if c.AutocompleteInstall == "" { + c.AutocompleteInstall = defaultAutocompleteInstall + } + + if c.AutocompleteUninstall == "" { + c.AutocompleteUninstall = defaultAutocompleteUninstall + } + + if c.autocompleteInstaller == nil { + c.autocompleteInstaller = &realAutocompleteInstaller{} + } + + // Build the root command + cmd := c.initAutocompleteSub("") + + // For the root, we add the global flags to the "Flags". This way + // they don't show up on every command. + if !c.AutocompleteNoDefaultFlags { + cmd.Flags = map[string]complete.Predictor{ + "-" + c.AutocompleteInstall: complete.PredictNothing, + "-" + c.AutocompleteUninstall: complete.PredictNothing, + "-help": complete.PredictNothing, + "-version": complete.PredictNothing, + } + } + cmd.GlobalFlags = c.AutocompleteGlobalFlags + + c.autocomplete = complete.New(c.Name, cmd) +} + +// initAutocompleteSub creates the complete.Command for a subcommand with +// the given prefix. This will continue recursively for all subcommands. +// The prefix "" (empty string) can be used for the root command. +func (c *CLI) initAutocompleteSub(prefix string) complete.Command { + var cmd complete.Command + walkFn := func(k string, raw interface{}) bool { + // Keep track of the full key so that we can nest further if necessary + fullKey := k + + if len(prefix) > 0 { + // If we have a prefix, trim the prefix + 1 (for the space) + // Example: turns "sub one" to "one" with prefix "sub" + k = k[len(prefix)+1:] + } + + if idx := strings.Index(k, " "); idx >= 0 { + // If there is a space, we trim up to the space. This turns + // "sub sub2 sub3" into "sub". The prefix trim above will + // trim our current depth properly. + k = k[:idx] + } + + if _, ok := cmd.Sub[k]; ok { + // If we already tracked this subcommand then ignore + return false + } + + // If the command is hidden, don't record it at all + if _, ok := c.commandHidden[fullKey]; ok { + return false + } + + if cmd.Sub == nil { + cmd.Sub = complete.Commands(make(map[string]complete.Command)) + } + subCmd := c.initAutocompleteSub(fullKey) + + // Instantiate the command so that we can check if the command is + // a CommandAutocomplete implementation. If there is an error + // creating the command, we just ignore it since that will be caught + // later. + impl, err := raw.(CommandFactory)() + if err != nil { + impl = nil + } + + // Check if it implements ComandAutocomplete. If so, setup the autocomplete + if c, ok := impl.(CommandAutocomplete); ok { + subCmd.Args = c.AutocompleteArgs() + subCmd.Flags = c.AutocompleteFlags() + } + + cmd.Sub[k] = subCmd + return false + } + + walkPrefix := prefix + if walkPrefix != "" { + walkPrefix += " " + } + + c.commandTree.WalkPrefix(walkPrefix, walkFn) + return cmd +} + +func (c *CLI) commandHelp(command Command) { + // Get the template to use + tpl := strings.TrimSpace(defaultHelpTemplate) + if t, ok := command.(CommandHelpTemplate); ok { + tpl = t.HelpTemplate() + } + if !strings.HasSuffix(tpl, "\n") { + tpl += "\n" + } + + // Parse it + t, err := template.New("root").Parse(tpl) + if err != nil { + t = template.Must(template.New("root").Parse(fmt.Sprintf( + "Internal error! Failed to parse command help template: %s\n", err))) + } + + // Template data + data := map[string]interface{}{ + "Name": c.Name, + "Help": command.Help(), + } + + // Build subcommand list if we have it + var subcommandsTpl []map[string]interface{} + if c.commandNested { + // Get the matching keys + subcommands := c.helpCommands(c.Subcommand()) + keys := make([]string, 0, len(subcommands)) + for k := range subcommands { + keys = append(keys, k) + } + + // Sort the keys + sort.Strings(keys) + + // Figure out the padding length + var longest int + for _, k := range keys { + if v := len(k); v > longest { + longest = v + } + } + + // Go through and create their structures + subcommandsTpl = make([]map[string]interface{}, 0, len(subcommands)) + for _, k := range keys { + // Get the command + raw, ok := subcommands[k] + if !ok { + c.HelpWriter.Write([]byte(fmt.Sprintf( + "Error getting subcommand %q", k))) + } + sub, err := raw() + if err != nil { + c.HelpWriter.Write([]byte(fmt.Sprintf( + "Error instantiating %q: %s", k, err))) + } + + // Find the last space and make sure we only include that last part + name := k + if idx := strings.LastIndex(k, " "); idx > -1 { + name = name[idx+1:] + } + + subcommandsTpl = append(subcommandsTpl, map[string]interface{}{ + "Name": name, + "NameAligned": name + strings.Repeat(" ", longest-len(k)), + "Help": sub.Help(), + "Synopsis": sub.Synopsis(), + }) + } + } + data["Subcommands"] = subcommandsTpl + + // Write + err = t.Execute(c.HelpWriter, data) + if err == nil { + return + } + + // An error, just output... + c.HelpWriter.Write([]byte(fmt.Sprintf( + "Internal error rendering help: %s", err))) +} + +// helpCommands returns the subcommands for the HelpFunc argument. +// This will only contain immediate subcommands. +func (c *CLI) helpCommands(prefix string) map[string]CommandFactory { + // If our prefix isn't empty, make sure it ends in ' ' + if prefix != "" && prefix[len(prefix)-1] != ' ' { + prefix += " " + } + + // Get all the subkeys of this command + var keys []string + c.commandTree.WalkPrefix(prefix, func(k string, raw interface{}) bool { + // Ignore any sub-sub keys, i.e. "foo bar baz" when we want "foo bar" + if !strings.Contains(k[len(prefix):], " ") { + keys = append(keys, k) + } + + return false + }) + + // For each of the keys return that in the map + result := make(map[string]CommandFactory, len(keys)) + for _, k := range keys { + raw, ok := c.commandTree.Get(k) + if !ok { + // We just got it via WalkPrefix above, so we just panic + panic("not found: " + k) + } + + // If this is a hidden command, don't show it + if _, ok := c.commandHidden[k]; ok { + continue + } + + result[k] = raw.(CommandFactory) + } + + return result +} + +func (c *CLI) processArgs() { + for i, arg := range c.Args { + if arg == "--" { + break + } + + // Check for help flags. + if arg == "-h" || arg == "-help" || arg == "--help" { + c.isHelp = true + continue + } + + // Check for autocomplete flags + if c.Autocomplete { + if arg == "-"+c.AutocompleteInstall || arg == "--"+c.AutocompleteInstall { + c.isAutocompleteInstall = true + continue + } + + if arg == "-"+c.AutocompleteUninstall || arg == "--"+c.AutocompleteUninstall { + c.isAutocompleteUninstall = true + continue + } + } + + if c.subcommand == "" { + // Check for version flags if not in a subcommand. + if arg == "-v" || arg == "-version" || arg == "--version" { + c.isVersion = true + continue + } + + if arg != "" && arg[0] == '-' { + // Record the arg... + c.topFlags = append(c.topFlags, arg) + } + } + + // If we didn't find a subcommand yet and this is the first non-flag + // argument, then this is our subcommand. + if c.subcommand == "" && arg != "" && arg[0] != '-' { + c.subcommand = arg + if c.commandNested { + // Nested CLI, the subcommand is actually the entire + // arg list up to a flag that is still a valid subcommand. + searchKey := strings.Join(c.Args[i:], " ") + k, _, ok := c.commandTree.LongestPrefix(searchKey) + if ok { + // k could be a prefix that doesn't contain the full + // command such as "foo" instead of "foobar", so we + // need to verify that we have an entire key. To do that, + // we look for an ending in a space or an end of string. + reVerify := regexp.MustCompile(regexp.QuoteMeta(k) + `( |$)`) + if reVerify.MatchString(searchKey) { + c.subcommand = k + i += strings.Count(k, " ") + } + } + } + + // The remaining args the subcommand arguments + c.subcommandArgs = c.Args[i+1:] + } + } + + // If we never found a subcommand and support a default command, then + // switch to using that. + if c.subcommand == "" { + if _, ok := c.Commands[""]; ok { + args := c.topFlags + args = append(args, c.subcommandArgs...) + c.topFlags = nil + c.subcommandArgs = args + } + } +} + +// defaultAutocompleteInstall and defaultAutocompleteUninstall are the +// default values for the autocomplete install and uninstall flags. +const defaultAutocompleteInstall = "autocomplete-install" +const defaultAutocompleteUninstall = "autocomplete-uninstall" + +const defaultHelpTemplate = ` +{{.Help}}{{if gt (len .Subcommands) 0}} + +Subcommands: +{{- range $value := .Subcommands }} + {{ $value.NameAligned }} {{ $value.Synopsis }}{{ end }} +{{- end }} +` diff --git a/vendor/github.com/mitchellh/cli/command.go b/vendor/github.com/mitchellh/cli/command.go new file mode 100644 index 0000000..bed11fa --- /dev/null +++ b/vendor/github.com/mitchellh/cli/command.go @@ -0,0 +1,67 @@ +package cli + +import ( + "github.com/posener/complete" +) + +const ( + // RunResultHelp is a value that can be returned from Run to signal + // to the CLI to render the help output. + RunResultHelp = -18511 +) + +// A command is a runnable sub-command of a CLI. +type Command interface { + // Help should return long-form help text that includes the command-line + // usage, a brief few sentences explaining the function of the command, + // and the complete list of flags the command accepts. + Help() string + + // Run should run the actual command with the given CLI instance and + // command-line arguments. It should return the exit status when it is + // finished. + // + // There are a handful of special exit codes this can return documented + // above that change behavior. + Run(args []string) int + + // Synopsis should return a one-line, short synopsis of the command. + // This should be less than 50 characters ideally. + Synopsis() string +} + +// CommandAutocomplete is an extension of Command that enables fine-grained +// autocompletion. Subcommand autocompletion will work even if this interface +// is not implemented. By implementing this interface, more advanced +// autocompletion is enabled. +type CommandAutocomplete interface { + // AutocompleteArgs returns the argument predictor for this command. + // If argument completion is not supported, this should return + // complete.PredictNothing. + AutocompleteArgs() complete.Predictor + + // AutocompleteFlags returns a mapping of supported flags and autocomplete + // options for this command. The map key for the Flags map should be the + // complete flag such as "-foo" or "--foo". + AutocompleteFlags() complete.Flags +} + +// CommandHelpTemplate is an extension of Command that also has a function +// for returning a template for the help rather than the help itself. In +// this scenario, both Help and HelpTemplate should be implemented. +// +// If CommandHelpTemplate isn't implemented, the Help is output as-is. +type CommandHelpTemplate interface { + // HelpTemplate is the template in text/template format to use for + // displaying the Help. The keys available are: + // + // * ".Help" - The help text itself + // * ".Subcommands" + // + HelpTemplate() string +} + +// CommandFactory is a type of function that is a factory for commands. +// We need a factory because we may need to setup some state on the +// struct that implements the command itself. +type CommandFactory func() (Command, error) diff --git a/vendor/github.com/mitchellh/cli/command_mock.go b/vendor/github.com/mitchellh/cli/command_mock.go new file mode 100644 index 0000000..7a584b7 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/command_mock.go @@ -0,0 +1,63 @@ +package cli + +import ( + "github.com/posener/complete" +) + +// MockCommand is an implementation of Command that can be used for tests. +// It is publicly exported from this package in case you want to use it +// externally. +type MockCommand struct { + // Settable + HelpText string + RunResult int + SynopsisText string + + // Set by the command + RunCalled bool + RunArgs []string +} + +func (c *MockCommand) Help() string { + return c.HelpText +} + +func (c *MockCommand) Run(args []string) int { + c.RunCalled = true + c.RunArgs = args + + return c.RunResult +} + +func (c *MockCommand) Synopsis() string { + return c.SynopsisText +} + +// MockCommandAutocomplete is an implementation of CommandAutocomplete. +type MockCommandAutocomplete struct { + MockCommand + + // Settable + AutocompleteArgsValue complete.Predictor + AutocompleteFlagsValue complete.Flags +} + +func (c *MockCommandAutocomplete) AutocompleteArgs() complete.Predictor { + return c.AutocompleteArgsValue +} + +func (c *MockCommandAutocomplete) AutocompleteFlags() complete.Flags { + return c.AutocompleteFlagsValue +} + +// MockCommandHelpTemplate is an implementation of CommandHelpTemplate. +type MockCommandHelpTemplate struct { + MockCommand + + // Settable + HelpTemplateText string +} + +func (c *MockCommandHelpTemplate) HelpTemplate() string { + return c.HelpTemplateText +} diff --git a/vendor/github.com/mitchellh/cli/help.go b/vendor/github.com/mitchellh/cli/help.go new file mode 100644 index 0000000..f5ca58f --- /dev/null +++ b/vendor/github.com/mitchellh/cli/help.go @@ -0,0 +1,79 @@ +package cli + +import ( + "bytes" + "fmt" + "log" + "sort" + "strings" +) + +// HelpFunc is the type of the function that is responsible for generating +// the help output when the CLI must show the general help text. +type HelpFunc func(map[string]CommandFactory) string + +// BasicHelpFunc generates some basic help output that is usually good enough +// for most CLI applications. +func BasicHelpFunc(app string) HelpFunc { + return func(commands map[string]CommandFactory) string { + var buf bytes.Buffer + buf.WriteString(fmt.Sprintf( + "Usage: %s [--version] [--help] []\n\n", + app)) + buf.WriteString("Available commands are:\n") + + // Get the list of keys so we can sort them, and also get the maximum + // key length so they can be aligned properly. + keys := make([]string, 0, len(commands)) + maxKeyLen := 0 + for key := range commands { + if len(key) > maxKeyLen { + maxKeyLen = len(key) + } + + keys = append(keys, key) + } + sort.Strings(keys) + + for _, key := range keys { + commandFunc, ok := commands[key] + if !ok { + // This should never happen since we JUST built the list of + // keys. + panic("command not found: " + key) + } + + command, err := commandFunc() + if err != nil { + log.Printf("[ERR] cli: Command '%s' failed to load: %s", + key, err) + continue + } + + key = fmt.Sprintf("%s%s", key, strings.Repeat(" ", maxKeyLen-len(key))) + buf.WriteString(fmt.Sprintf(" %s %s\n", key, command.Synopsis())) + } + + return buf.String() + } +} + +// FilteredHelpFunc will filter the commands to only include the keys +// in the include parameter. +func FilteredHelpFunc(include []string, f HelpFunc) HelpFunc { + return func(commands map[string]CommandFactory) string { + set := make(map[string]struct{}) + for _, k := range include { + set[k] = struct{}{} + } + + filtered := make(map[string]CommandFactory) + for k, f := range commands { + if _, ok := set[k]; ok { + filtered[k] = f + } + } + + return f(filtered) + } +} diff --git a/vendor/github.com/mitchellh/cli/ui.go b/vendor/github.com/mitchellh/cli/ui.go new file mode 100644 index 0000000..a2d6f94 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/ui.go @@ -0,0 +1,187 @@ +package cli + +import ( + "bufio" + "errors" + "fmt" + "io" + "os" + "os/signal" + "strings" + + "github.com/bgentry/speakeasy" + "github.com/mattn/go-isatty" +) + +// Ui is an interface for interacting with the terminal, or "interface" +// of a CLI. This abstraction doesn't have to be used, but helps provide +// a simple, layerable way to manage user interactions. +type Ui interface { + // Ask asks the user for input using the given query. The response is + // returned as the given string, or an error. + Ask(string) (string, error) + + // AskSecret asks the user for input using the given query, but does not echo + // the keystrokes to the terminal. + AskSecret(string) (string, error) + + // Output is called for normal standard output. + Output(string) + + // Info is called for information related to the previous output. + // In general this may be the exact same as Output, but this gives + // Ui implementors some flexibility with output formats. + Info(string) + + // Error is used for any error messages that might appear on standard + // error. + Error(string) + + // Warn is used for any warning messages that might appear on standard + // error. + Warn(string) +} + +// BasicUi is an implementation of Ui that just outputs to the given +// writer. This UI is not threadsafe by default, but you can wrap it +// in a ConcurrentUi to make it safe. +type BasicUi struct { + Reader io.Reader + Writer io.Writer + ErrorWriter io.Writer +} + +func (u *BasicUi) Ask(query string) (string, error) { + return u.ask(query, false) +} + +func (u *BasicUi) AskSecret(query string) (string, error) { + return u.ask(query, true) +} + +func (u *BasicUi) ask(query string, secret bool) (string, error) { + if _, err := fmt.Fprint(u.Writer, query+" "); err != nil { + return "", err + } + + // Register for interrupts so that we can catch it and immediately + // return... + sigCh := make(chan os.Signal, 1) + signal.Notify(sigCh, os.Interrupt) + defer signal.Stop(sigCh) + + // Ask for input in a go-routine so that we can ignore it. + errCh := make(chan error, 1) + lineCh := make(chan string, 1) + go func() { + var line string + var err error + if secret && isatty.IsTerminal(os.Stdin.Fd()) { + line, err = speakeasy.Ask("") + } else { + r := bufio.NewReader(u.Reader) + line, err = r.ReadString('\n') + } + if err != nil { + errCh <- err + return + } + + lineCh <- strings.TrimRight(line, "\r\n") + }() + + select { + case err := <-errCh: + return "", err + case line := <-lineCh: + return line, nil + case <-sigCh: + // Print a newline so that any further output starts properly + // on a new line. + fmt.Fprintln(u.Writer) + + return "", errors.New("interrupted") + } +} + +func (u *BasicUi) Error(message string) { + w := u.Writer + if u.ErrorWriter != nil { + w = u.ErrorWriter + } + + fmt.Fprint(w, message) + fmt.Fprint(w, "\n") +} + +func (u *BasicUi) Info(message string) { + u.Output(message) +} + +func (u *BasicUi) Output(message string) { + fmt.Fprint(u.Writer, message) + fmt.Fprint(u.Writer, "\n") +} + +func (u *BasicUi) Warn(message string) { + u.Error(message) +} + +// PrefixedUi is an implementation of Ui that prefixes messages. +type PrefixedUi struct { + AskPrefix string + AskSecretPrefix string + OutputPrefix string + InfoPrefix string + ErrorPrefix string + WarnPrefix string + Ui Ui +} + +func (u *PrefixedUi) Ask(query string) (string, error) { + if query != "" { + query = fmt.Sprintf("%s%s", u.AskPrefix, query) + } + + return u.Ui.Ask(query) +} + +func (u *PrefixedUi) AskSecret(query string) (string, error) { + if query != "" { + query = fmt.Sprintf("%s%s", u.AskSecretPrefix, query) + } + + return u.Ui.AskSecret(query) +} + +func (u *PrefixedUi) Error(message string) { + if message != "" { + message = fmt.Sprintf("%s%s", u.ErrorPrefix, message) + } + + u.Ui.Error(message) +} + +func (u *PrefixedUi) Info(message string) { + if message != "" { + message = fmt.Sprintf("%s%s", u.InfoPrefix, message) + } + + u.Ui.Info(message) +} + +func (u *PrefixedUi) Output(message string) { + if message != "" { + message = fmt.Sprintf("%s%s", u.OutputPrefix, message) + } + + u.Ui.Output(message) +} + +func (u *PrefixedUi) Warn(message string) { + if message != "" { + message = fmt.Sprintf("%s%s", u.WarnPrefix, message) + } + + u.Ui.Warn(message) +} diff --git a/vendor/github.com/mitchellh/cli/ui_colored.go b/vendor/github.com/mitchellh/cli/ui_colored.go new file mode 100644 index 0000000..e3d5131 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/ui_colored.go @@ -0,0 +1,69 @@ +package cli + +import ( + "fmt" +) + +// UiColor is a posix shell color code to use. +type UiColor struct { + Code int + Bold bool +} + +// A list of colors that are useful. These are all non-bolded by default. +var ( + UiColorNone UiColor = UiColor{-1, false} + UiColorRed = UiColor{31, false} + UiColorGreen = UiColor{32, false} + UiColorYellow = UiColor{33, false} + UiColorBlue = UiColor{34, false} + UiColorMagenta = UiColor{35, false} + UiColorCyan = UiColor{36, false} +) + +// ColoredUi is a Ui implementation that colors its output according +// to the given color schemes for the given type of output. +type ColoredUi struct { + OutputColor UiColor + InfoColor UiColor + ErrorColor UiColor + WarnColor UiColor + Ui Ui +} + +func (u *ColoredUi) Ask(query string) (string, error) { + return u.Ui.Ask(u.colorize(query, u.OutputColor)) +} + +func (u *ColoredUi) AskSecret(query string) (string, error) { + return u.Ui.AskSecret(u.colorize(query, u.OutputColor)) +} + +func (u *ColoredUi) Output(message string) { + u.Ui.Output(u.colorize(message, u.OutputColor)) +} + +func (u *ColoredUi) Info(message string) { + u.Ui.Info(u.colorize(message, u.InfoColor)) +} + +func (u *ColoredUi) Error(message string) { + u.Ui.Error(u.colorize(message, u.ErrorColor)) +} + +func (u *ColoredUi) Warn(message string) { + u.Ui.Warn(u.colorize(message, u.WarnColor)) +} + +func (u *ColoredUi) colorize(message string, color UiColor) string { + if color.Code == -1 { + return message + } + + attr := 0 + if color.Bold { + attr = 1 + } + + return fmt.Sprintf("\033[%d;%dm%s\033[0m", attr, color.Code, message) +} diff --git a/vendor/github.com/mitchellh/cli/ui_concurrent.go b/vendor/github.com/mitchellh/cli/ui_concurrent.go new file mode 100644 index 0000000..b4f4dbf --- /dev/null +++ b/vendor/github.com/mitchellh/cli/ui_concurrent.go @@ -0,0 +1,54 @@ +package cli + +import ( + "sync" +) + +// ConcurrentUi is a wrapper around a Ui interface (and implements that +// interface) making the underlying Ui concurrency safe. +type ConcurrentUi struct { + Ui Ui + l sync.Mutex +} + +func (u *ConcurrentUi) Ask(query string) (string, error) { + u.l.Lock() + defer u.l.Unlock() + + return u.Ui.Ask(query) +} + +func (u *ConcurrentUi) AskSecret(query string) (string, error) { + u.l.Lock() + defer u.l.Unlock() + + return u.Ui.AskSecret(query) +} + +func (u *ConcurrentUi) Error(message string) { + u.l.Lock() + defer u.l.Unlock() + + u.Ui.Error(message) +} + +func (u *ConcurrentUi) Info(message string) { + u.l.Lock() + defer u.l.Unlock() + + u.Ui.Info(message) +} + +func (u *ConcurrentUi) Output(message string) { + u.l.Lock() + defer u.l.Unlock() + + u.Ui.Output(message) +} + +func (u *ConcurrentUi) Warn(message string) { + u.l.Lock() + defer u.l.Unlock() + + u.Ui.Warn(message) +} diff --git a/vendor/github.com/mitchellh/cli/ui_mock.go b/vendor/github.com/mitchellh/cli/ui_mock.go new file mode 100644 index 0000000..0bfe0a1 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/ui_mock.go @@ -0,0 +1,111 @@ +package cli + +import ( + "bytes" + "fmt" + "io" + "sync" +) + +// NewMockUi returns a fully initialized MockUi instance +// which is safe for concurrent use. +func NewMockUi() *MockUi { + m := new(MockUi) + m.once.Do(m.init) + return m +} + +// MockUi is a mock UI that is used for tests and is exported publicly +// for use in external tests if needed as well. Do not instantite this +// directly since the buffers will be initialized on the first write. If +// there is no write then you will get a nil panic. Please use the +// NewMockUi() constructor function instead. You can fix your code with +// +// sed -i -e 's/new(cli.MockUi)/cli.NewMockUi()/g' *_test.go +type MockUi struct { + InputReader io.Reader + ErrorWriter *syncBuffer + OutputWriter *syncBuffer + + once sync.Once +} + +func (u *MockUi) Ask(query string) (string, error) { + u.once.Do(u.init) + + var result string + fmt.Fprint(u.OutputWriter, query) + if _, err := fmt.Fscanln(u.InputReader, &result); err != nil { + return "", err + } + + return result, nil +} + +func (u *MockUi) AskSecret(query string) (string, error) { + return u.Ask(query) +} + +func (u *MockUi) Error(message string) { + u.once.Do(u.init) + + fmt.Fprint(u.ErrorWriter, message) + fmt.Fprint(u.ErrorWriter, "\n") +} + +func (u *MockUi) Info(message string) { + u.Output(message) +} + +func (u *MockUi) Output(message string) { + u.once.Do(u.init) + + fmt.Fprint(u.OutputWriter, message) + fmt.Fprint(u.OutputWriter, "\n") +} + +func (u *MockUi) Warn(message string) { + u.once.Do(u.init) + + fmt.Fprint(u.ErrorWriter, message) + fmt.Fprint(u.ErrorWriter, "\n") +} + +func (u *MockUi) init() { + u.ErrorWriter = new(syncBuffer) + u.OutputWriter = new(syncBuffer) +} + +type syncBuffer struct { + sync.RWMutex + b bytes.Buffer +} + +func (b *syncBuffer) Write(data []byte) (int, error) { + b.Lock() + defer b.Unlock() + return b.b.Write(data) +} + +func (b *syncBuffer) Read(data []byte) (int, error) { + b.RLock() + defer b.RUnlock() + return b.b.Read(data) +} + +func (b *syncBuffer) Reset() { + b.Lock() + b.b.Reset() + b.Unlock() +} + +func (b *syncBuffer) String() string { + return string(b.Bytes()) +} + +func (b *syncBuffer) Bytes() []byte { + b.RLock() + data := b.b.Bytes() + b.RUnlock() + return data +} diff --git a/vendor/github.com/mitchellh/cli/ui_writer.go b/vendor/github.com/mitchellh/cli/ui_writer.go new file mode 100644 index 0000000..1e1db3c --- /dev/null +++ b/vendor/github.com/mitchellh/cli/ui_writer.go @@ -0,0 +1,18 @@ +package cli + +// UiWriter is an io.Writer implementation that can be used with +// loggers that writes every line of log output data to a Ui at the +// Info level. +type UiWriter struct { + Ui Ui +} + +func (w *UiWriter) Write(p []byte) (n int, err error) { + n = len(p) + if n > 0 && p[n-1] == '\n' { + p = p[:n-1] + } + + w.Ui.Info(string(p)) + return n, nil +} diff --git a/vendor/github.com/mitchellh/go-testing-interface/LICENSE b/vendor/github.com/mitchellh/go-testing-interface/LICENSE new file mode 100644 index 0000000..a3866a2 --- /dev/null +++ b/vendor/github.com/mitchellh/go-testing-interface/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Mitchell Hashimoto + +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/mitchellh/go-testing-interface/README.md b/vendor/github.com/mitchellh/go-testing-interface/README.md new file mode 100644 index 0000000..26781bb --- /dev/null +++ b/vendor/github.com/mitchellh/go-testing-interface/README.md @@ -0,0 +1,52 @@ +# go-testing-interface + +go-testing-interface is a Go library that exports an interface that +`*testing.T` implements as well as a runtime version you can use in its +place. + +The purpose of this library is so that you can export test helpers as a +public API without depending on the "testing" package, since you can't +create a `*testing.T` struct manually. This lets you, for example, use the +public testing APIs to generate mock data at runtime, rather than just at +test time. + +## Usage & Example + +For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/go-testing-interface). + +Given a test helper written using `go-testing-interface` like this: + + import "github.com/mitchellh/go-testing-interface" + + func TestHelper(t testing.T) { + t.Fatal("I failed") + } + +You can call the test helper in a real test easily: + + import "testing" + + func TestThing(t *testing.T) { + TestHelper(t) + } + +You can also call the test helper at runtime if needed: + + import "github.com/mitchellh/go-testing-interface" + + func main() { + TestHelper(&testing.RuntimeT{}) + } + +## Why?! + +**Why would I call a test helper that takes a *testing.T at runtime?** + +You probably shouldn't. The only use case I've seen (and I've had) for this +is to implement a "dev mode" for a service where the test helpers are used +to populate mock data, create a mock DB, perhaps run service dependencies +in-memory, etc. + +Outside of a "dev mode", I've never seen a use case for this and I think +there shouldn't be one since the point of the `testing.T` interface is that +you can fail immediately. diff --git a/vendor/github.com/mitchellh/go-testing-interface/testing.go b/vendor/github.com/mitchellh/go-testing-interface/testing.go new file mode 100644 index 0000000..204afb4 --- /dev/null +++ b/vendor/github.com/mitchellh/go-testing-interface/testing.go @@ -0,0 +1,84 @@ +// +build !go1.9 + +package testing + +import ( + "fmt" + "log" +) + +// T is the interface that mimics the standard library *testing.T. +// +// In unit tests you can just pass a *testing.T struct. At runtime, outside +// of tests, you can pass in a RuntimeT struct from this package. +type T interface { + Error(args ...interface{}) + Errorf(format string, args ...interface{}) + Fail() + FailNow() + Failed() bool + Fatal(args ...interface{}) + Fatalf(format string, args ...interface{}) + Log(args ...interface{}) + Logf(format string, args ...interface{}) + Name() string + Skip(args ...interface{}) + SkipNow() + Skipf(format string, args ...interface{}) + Skipped() bool +} + +// RuntimeT implements T and can be instantiated and run at runtime to +// mimic *testing.T behavior. Unlike *testing.T, this will simply panic +// for calls to Fatal. For calls to Error, you'll have to check the errors +// list to determine whether to exit yourself. Name and Skip methods are +// unimplemented noops. +type RuntimeT struct { + failed bool +} + +func (t *RuntimeT) Error(args ...interface{}) { + log.Println(fmt.Sprintln(args...)) + t.Fail() +} + +func (t *RuntimeT) Errorf(format string, args ...interface{}) { + log.Println(fmt.Sprintf(format, args...)) + t.Fail() +} + +func (t *RuntimeT) Fatal(args ...interface{}) { + log.Println(fmt.Sprintln(args...)) + t.FailNow() +} + +func (t *RuntimeT) Fatalf(format string, args ...interface{}) { + log.Println(fmt.Sprintf(format, args...)) + t.FailNow() +} + +func (t *RuntimeT) Fail() { + t.failed = true +} + +func (t *RuntimeT) FailNow() { + panic("testing.T failed, see logs for output (if any)") +} + +func (t *RuntimeT) Failed() bool { + return t.failed +} + +func (t *RuntimeT) Log(args ...interface{}) { + log.Println(fmt.Sprintln(args...)) +} + +func (t *RuntimeT) Logf(format string, args ...interface{}) { + log.Println(fmt.Sprintf(format, args...)) +} + +func (t *RuntimeT) Name() string { return "" } +func (t *RuntimeT) Skip(args ...interface{}) {} +func (t *RuntimeT) SkipNow() {} +func (t *RuntimeT) Skipf(format string, args ...interface{}) {} +func (t *RuntimeT) Skipped() bool { return false } diff --git a/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go b/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go new file mode 100644 index 0000000..07fbcb5 --- /dev/null +++ b/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go @@ -0,0 +1,80 @@ +// +build go1.9 + +// NOTE: This is a temporary copy of testing.go for Go 1.9 with the addition +// of "Helper" to the T interface. Go 1.9 at the time of typing is in RC +// and is set for release shortly. We'll support this on master as the default +// as soon as 1.9 is released. + +package testing + +import ( + "fmt" + "log" +) + +// T is the interface that mimics the standard library *testing.T. +// +// In unit tests you can just pass a *testing.T struct. At runtime, outside +// of tests, you can pass in a RuntimeT struct from this package. +type T interface { + Error(args ...interface{}) + Errorf(format string, args ...interface{}) + Fatal(args ...interface{}) + Fatalf(format string, args ...interface{}) + Fail() + FailNow() + Failed() bool + Helper() + Log(args ...interface{}) + Logf(format string, args ...interface{}) +} + +// RuntimeT implements T and can be instantiated and run at runtime to +// mimic *testing.T behavior. Unlike *testing.T, this will simply panic +// for calls to Fatal. For calls to Error, you'll have to check the errors +// list to determine whether to exit yourself. +type RuntimeT struct { + failed bool +} + +func (t *RuntimeT) Error(args ...interface{}) { + log.Println(fmt.Sprintln(args...)) + t.Fail() +} + +func (t *RuntimeT) Errorf(format string, args ...interface{}) { + log.Println(fmt.Sprintf(format, args...)) + t.Fail() +} + +func (t *RuntimeT) Fatal(args ...interface{}) { + log.Println(fmt.Sprintln(args...)) + t.FailNow() +} + +func (t *RuntimeT) Fatalf(format string, args ...interface{}) { + log.Println(fmt.Sprintf(format, args...)) + t.FailNow() +} + +func (t *RuntimeT) Fail() { + t.failed = true +} + +func (t *RuntimeT) FailNow() { + panic("testing.T failed, see logs for output (if any)") +} + +func (t *RuntimeT) Failed() bool { + return t.failed +} + +func (t *RuntimeT) Helper() {} + +func (t *RuntimeT) Log(args ...interface{}) { + log.Println(fmt.Sprintln(args...)) +} + +func (t *RuntimeT) Logf(format string, args ...interface{}) { + log.Println(fmt.Sprintf(format, args...)) +} diff --git a/vendor/github.com/mitchellh/hashstructure/README.md b/vendor/github.com/mitchellh/hashstructure/README.md index 619a7fa..7d0de5b 100644 --- a/vendor/github.com/mitchellh/hashstructure/README.md +++ b/vendor/github.com/mitchellh/hashstructure/README.md @@ -1,4 +1,4 @@ -# hashstructure [![GoDoc](https://godoc.org/github.com/mitchellh/hashstructure?status.svg)](https://godoc.org/github.com/mitchellh/hashstructure) +# hashstructure hashstructure is a Go library for creating a unique hash value for arbitrary values in Go. @@ -34,29 +34,28 @@ For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/has A quick code example is shown below: -```go -type ComplexStruct struct { - Name string - Age uint - Metadata map[string]interface{} -} - -v := ComplexStruct{ - Name: "mitchellh", - Age: 64, - Metadata: map[string]interface{}{ - "car": true, - "location": "California", - "siblings": []string{"Bob", "John"}, - }, -} - -hash, err := hashstructure.Hash(v, nil) -if err != nil { - panic(err) -} - -fmt.Printf("%d", hash) -// Output: -// 2307517237273902113 -``` + + type ComplexStruct struct { + Name string + Age uint + Metadata map[string]interface{} + } + + v := ComplexStruct{ + Name: "mitchellh", + Age: 64, + Metadata: map[string]interface{}{ + "car": true, + "location": "California", + "siblings": []string{"Bob", "John"}, + }, + } + + hash, err := hashstructure.Hash(v, nil) + if err != nil { + panic(err) + } + + fmt.Printf("%d", hash) + // Output: + // 2307517237273902113 diff --git a/vendor/github.com/mitchellh/hashstructure/hashstructure.go b/vendor/github.com/mitchellh/hashstructure/hashstructure.go index 1800f43..6f586fa 100644 --- a/vendor/github.com/mitchellh/hashstructure/hashstructure.go +++ b/vendor/github.com/mitchellh/hashstructure/hashstructure.go @@ -17,18 +17,12 @@ type HashOptions struct { // TagName is the struct tag to look at when hashing the structure. // By default this is "hash". TagName string - - // ZeroNil is flag determining if nil pointer should be treated equal - // to a zero value of pointed type. By default this is false. - ZeroNil bool } // Hash returns the hash value of an arbitrary value. // // If opts is nil, then default options will be used. See HashOptions -// for the default values. The same *HashOptions value cannot be used -// concurrently. None of the values within a *HashOptions struct are -// safe to read/write while hashing is being done. +// for the default values. // // Notes on the value: // @@ -47,7 +41,7 @@ type HashOptions struct { // // The available tag values are: // -// * "ignore" or "-" - The field will be ignored and not affect the hash code. +// * "ignore" - The field will be ignored and not affect the hash code. // // * "set" - The field will be treated as a set, where ordering doesn't // affect the hash code. This only works for slices. @@ -69,17 +63,15 @@ func Hash(v interface{}, opts *HashOptions) (uint64, error) { // Create our walker and walk the structure w := &walker{ - h: opts.Hasher, - tag: opts.TagName, - zeronil: opts.ZeroNil, + h: opts.Hasher, + tag: opts.TagName, } return w.visit(reflect.ValueOf(v), nil) } type walker struct { - h hash.Hash64 - tag string - zeronil bool + h hash.Hash64 + tag string } type visitOpts struct { @@ -92,8 +84,6 @@ type visitOpts struct { } func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { - t := reflect.TypeOf(0) - // Loop since these can be wrapped in multiple layers of pointers // and interfaces. for { @@ -106,9 +96,6 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { } if v.Kind() == reflect.Ptr { - if w.zeronil { - t = v.Type().Elem() - } v = reflect.Indirect(v) continue } @@ -118,7 +105,8 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { // If it is nil, treat it like a zero. if !v.IsValid() { - v = reflect.Zero(t) + var tmp int8 + v = reflect.ValueOf(tmp) } // Binary writing can use raw ints, we have to convert to @@ -224,7 +212,7 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { } tag := fieldType.Tag.Get(w.tag) - if tag == "ignore" || tag == "-" { + if tag == "ignore" { // Ignore this field continue } diff --git a/vendor/github.com/mitchellh/mapstructure/decode_hooks.go b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go index aa91f76..115ae67 100644 --- a/vendor/github.com/mitchellh/mapstructure/decode_hooks.go +++ b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go @@ -72,7 +72,10 @@ func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { } // Modify the from kind to be correct with the new data - f = reflect.ValueOf(data).Type() + f = nil + if val := reflect.ValueOf(data); val.IsValid() { + f = val.Type() + } } return data, nil diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go index 40be511..b0ab9a3 100644 --- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -1,5 +1,5 @@ // The mapstructure package exposes functionality to convert an -// abitrary map[string]interface{} into a native Go structure. +// arbitrary map[string]interface{} into a native Go structure. // // The Go structure can be arbitrarily complex, containing slices, // other structs, etc. and the decoder will properly decode nested @@ -8,6 +8,7 @@ package mapstructure import ( + "encoding/json" "errors" "fmt" "reflect" @@ -67,6 +68,7 @@ type DecoderConfig struct { // FALSE, false, False. Anything else is an error) // - empty array = empty map and vice versa // - negative numbers to overflowed uint values (base 10) + // - slice of maps to a merged map // WeaklyTypedInput bool @@ -245,6 +247,10 @@ func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error // value to "data" of that type. func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error { dataVal := reflect.ValueOf(data) + if !dataVal.IsValid() { + dataVal = reflect.Zero(val.Type()) + } + dataValType := dataVal.Type() if !dataValType.AssignableTo(val.Type()) { return fmt.Errorf( @@ -301,6 +307,7 @@ func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error { dataVal := reflect.ValueOf(data) dataKind := getKind(dataVal) + dataType := dataVal.Type() switch { case dataKind == reflect.Int: @@ -322,6 +329,14 @@ func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) er } else { return fmt.Errorf("cannot parse '%s' as int: %s", name, err) } + case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": + jn := data.(json.Number) + i, err := jn.Int64() + if err != nil { + return fmt.Errorf( + "error decoding json.Number into %s: %s", name, err) + } + val.SetInt(i) default: return fmt.Errorf( "'%s' expected type '%s', got unconvertible type '%s'", @@ -408,6 +423,7 @@ func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) e func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error { dataVal := reflect.ValueOf(data) dataKind := getKind(dataVal) + dataType := dataVal.Type() switch { case dataKind == reflect.Int: @@ -429,6 +445,14 @@ func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) } else { return fmt.Errorf("cannot parse '%s' as float: %s", name, err) } + case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": + jn := data.(json.Number) + i, err := jn.Float64() + if err != nil { + return fmt.Errorf( + "error decoding json.Number into %s: %s", name, err) + } + val.SetFloat(i) default: return fmt.Errorf( "'%s' expected type '%s', got unconvertible type '%s'", @@ -456,15 +480,30 @@ func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) er // Check input type dataVal := reflect.Indirect(reflect.ValueOf(data)) if dataVal.Kind() != reflect.Map { - // Accept empty array/slice instead of an empty map in weakly typed mode - if d.config.WeaklyTypedInput && - (dataVal.Kind() == reflect.Slice || dataVal.Kind() == reflect.Array) && - dataVal.Len() == 0 { - val.Set(valMap) - return nil - } else { - return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind()) + // In weak mode, we accept a slice of maps as an input... + if d.config.WeaklyTypedInput { + switch dataVal.Kind() { + case reflect.Array, reflect.Slice: + // Special case for BC reasons (covered by tests) + if dataVal.Len() == 0 { + val.Set(valMap) + return nil + } + + for i := 0; i < dataVal.Len(); i++ { + err := d.decode( + fmt.Sprintf("%s[%d]", name, i), + dataVal.Index(i).Interface(), val) + if err != nil { + return err + } + } + + return nil + } } + + return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind()) } // Accumulate errors @@ -507,7 +546,12 @@ func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) er // into that. Then set the value of the pointer to this type. valType := val.Type() valElemType := valType.Elem() - realVal := reflect.New(valElemType) + + realVal:=val + if realVal.IsNil() || d.config.ZeroFields { + realVal = reflect.New(valElemType) + } + if err := d.decode(name, data, reflect.Indirect(realVal)); err != nil { return err } @@ -523,20 +567,24 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) valElemType := valType.Elem() sliceType := reflect.SliceOf(valElemType) - // Check input type - if dataValKind != reflect.Array && dataValKind != reflect.Slice { - // Accept empty map instead of array/slice in weakly typed mode - if d.config.WeaklyTypedInput && dataVal.Kind() == reflect.Map && dataVal.Len() == 0 { - val.Set(reflect.MakeSlice(sliceType, 0, 0)) - return nil - } else { - return fmt.Errorf( - "'%s': source data must be an array or slice, got %s", name, dataValKind) + valSlice:=val + if valSlice.IsNil() || d.config.ZeroFields { + + // Check input type + if dataValKind != reflect.Array && dataValKind != reflect.Slice { + // Accept empty map instead of array/slice in weakly typed mode + if d.config.WeaklyTypedInput && dataVal.Kind() == reflect.Map && dataVal.Len() == 0 { + val.Set(reflect.MakeSlice(sliceType, 0, 0)) + return nil + } else { + return fmt.Errorf( + "'%s': source data must be an array or slice, got %s", name, dataValKind) + } } - } - // Make a new slice to hold our result, same size as the original data. - valSlice := reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len()) + // Make a new slice to hold our result, same size as the original data. + valSlice = reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len()) + } // Accumulate any errors errors := make([]string, 0) @@ -607,17 +655,10 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) structs = structs[1:] structType := structVal.Type() + for i := 0; i < structType.NumField(); i++ { fieldType := structType.Field(i) - - if fieldType.Anonymous { - fieldKind := fieldType.Type.Kind() - if fieldKind != reflect.Struct { - errors = appendErrors(errors, - fmt.Errorf("%s: unsupported type: %s", fieldType.Name, fieldKind)) - continue - } - } + fieldKind := fieldType.Type.Kind() // If "squash" is specified in the tag, we squash the field down. squash := false @@ -630,7 +671,12 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) } if squash { - structs = append(structs, val.FieldByName(fieldType.Name)) + if fieldKind != reflect.Struct { + errors = appendErrors(errors, + fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldKind)) + } else { + structs = append(structs, val.FieldByName(fieldType.Name)) + } continue } @@ -653,7 +699,7 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) if !rawMapVal.IsValid() { // Do a slower search by iterating over each key and // doing case-insensitive search. - for dataValKey, _ := range dataValKeys { + for dataValKey := range dataValKeys { mK, ok := dataValKey.Interface().(string) if !ok { // Not a string key @@ -701,7 +747,7 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) if d.config.ErrorUnused && len(dataValKeysUnused) > 0 { keys := make([]string, 0, len(dataValKeysUnused)) - for rawKey, _ := range dataValKeysUnused { + for rawKey := range dataValKeysUnused { keys = append(keys, rawKey.(string)) } sort.Strings(keys) @@ -716,7 +762,7 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) // Add the unused keys to the list of unused keys if we're tracking metadata if d.config.Metadata != nil { - for rawKey, _ := range dataValKeysUnused { + for rawKey := range dataValKeysUnused { key := rawKey.(string) if name != "" { key = fmt.Sprintf("%s.%s", name, key) diff --git a/vendor/github.com/ovh/go-ovh/LICENSE b/vendor/github.com/ovh/go-ovh/LICENSE deleted file mode 100644 index d847c8a..0000000 --- a/vendor/github.com/ovh/go-ovh/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2015-2017, OVH SAS. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of OVH SAS nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY OVH SAS AND CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL OVH SAS AND CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/ovh/go-ovh/ovh/configuration.go b/vendor/github.com/ovh/go-ovh/ovh/configuration.go deleted file mode 100644 index e7dbb7c..0000000 --- a/vendor/github.com/ovh/go-ovh/ovh/configuration.go +++ /dev/null @@ -1,123 +0,0 @@ -package ovh - -import ( - "fmt" - "os" - "os/user" - "path/filepath" - "strings" - - "gopkg.in/ini.v1" -) - -// Use variables for easier test overload -var ( - systemConfigPath = "/etc/ovh.conf" - userConfigPath = "/.ovh.conf" // prefixed with homeDir - localConfigPath = "./ovh.conf" -) - -// currentUserHome attempts to get current user's home directory -func currentUserHome() (string, error) { - usr, err := user.Current() - if err != nil { - return "", err - } - return usr.HomeDir, nil -} - -// appendConfigurationFile only if it exists. We need to do this because -// ini package will fail to load configuration at all if a configuration -// file is missing. This is racy, but better than always failing. -func appendConfigurationFile(cfg *ini.File, path string) { - if file, err := os.Open(path); err == nil { - file.Close() - cfg.Append(path) - } -} - -// loadConfig loads client configuration from params, environments or configuration -// files (by order of decreasing precedence). -// -// loadConfig will check OVH_CONSUMER_KEY, OVH_APPLICATION_KEY, OVH_APPLICATION_SECRET -// and OVH_ENDPOINT environment variables. If any is present, it will take precedence -// over any configuration from file. -// -// Configuration files are ini files. They share the same format as python-ovh, -// node-ovh, php-ovh and all other wrappers. If any wrapper is configured, all -// can re-use the same configuration. loadConfig will check for configuration in: -// -// - ./ovh.conf -// - $HOME/.ovh.conf -// - /etc/ovh.conf -// -func (c *Client) loadConfig(endpointName string) error { - // Load configuration files by order of increasing priority. All configuration - // files are optional. Only load file from user home if home could be resolve - cfg := ini.Empty() - appendConfigurationFile(cfg, systemConfigPath) - if home, err := currentUserHome(); err == nil { - userConfigFullPath := filepath.Join(home, userConfigPath) - appendConfigurationFile(cfg, userConfigFullPath) - } - appendConfigurationFile(cfg, localConfigPath) - - // Canonicalize configuration - if endpointName == "" { - endpointName = getConfigValue(cfg, "default", "endpoint", "ovh-eu") - } - - if c.AppKey == "" { - c.AppKey = getConfigValue(cfg, endpointName, "application_key", "") - } - - if c.AppSecret == "" { - c.AppSecret = getConfigValue(cfg, endpointName, "application_secret", "") - } - - if c.ConsumerKey == "" { - c.ConsumerKey = getConfigValue(cfg, endpointName, "consumer_key", "") - } - - // Load real endpoint URL by name. If endpoint contains a '/', consider it as a URL - if strings.Contains(endpointName, "/") { - c.endpoint = endpointName - } else { - c.endpoint = Endpoints[endpointName] - } - - // If we still have no valid endpoint, AppKey or AppSecret, return an error - if c.endpoint == "" { - return fmt.Errorf("Unknown endpoint '%s'. Consider checking 'Endpoints' list of using an URL.", endpointName) - } - if c.AppKey == "" { - return fmt.Errorf("Missing application key. Please check your configuration or consult the documentation to create one.") - } - if c.AppSecret == "" { - return fmt.Errorf("Missing application secret. Please check your configuration or consult the documentation to create one.") - } - - return nil -} - -// getConfigValue returns the value of OVH_ or ``name`` value from ``section``. If -// the value could not be read from either env or any configuration files, return 'def' -func getConfigValue(cfg *ini.File, section, name, def string) string { - // Attempt to load from environment - fromEnv := os.Getenv("OVH_" + strings.ToUpper(name)) - if len(fromEnv) > 0 { - return fromEnv - } - - // Attempt to load from configuration - fromSection := cfg.Section(section) - if fromSection == nil { - return def - } - - fromSectionKey := fromSection.Key(name) - if fromSectionKey == nil { - return def - } - return fromSectionKey.String() -} diff --git a/vendor/github.com/ovh/go-ovh/ovh/consumer_key.go b/vendor/github.com/ovh/go-ovh/ovh/consumer_key.go deleted file mode 100644 index 7163755..0000000 --- a/vendor/github.com/ovh/go-ovh/ovh/consumer_key.go +++ /dev/null @@ -1,113 +0,0 @@ -package ovh - -import ( - "fmt" - "strings" -) - -// Map user friendly access level names to corresponding HTTP verbs -var ( - ReadOnly = []string{"GET"} - ReadWrite = []string{"GET", "POST", "PUT", "DELETE"} - ReadWriteSafe = []string{"GET", "POST", "PUT"} -) - -// AccessRule represents a method allowed for a path -type AccessRule struct { - // Allowed HTTP Method for the requested AccessRule. - // Can be set to GET/POST/PUT/DELETE. - Method string `json:"method"` - // Allowed path. - // Can be an exact string or a string with '*' char. - // Example : - // /me : only /me is authorized - // /* : all calls are authorized - Path string `json:"path"` -} - -// CkValidationState represents the response when asking a new consumerKey. -type CkValidationState struct { - // Consumer key, which need to be validated by customer. - ConsumerKey string `json:"consumerKey"` - // Current status, should be always "pendingValidation". - State string `json:"state"` - // URL to redirect user in order to log in. - ValidationURL string `json:"validationUrl"` -} - -// CkRequest represents the parameters to fill in order to ask a new -// consumerKey. -type CkRequest struct { - client *Client - AccessRules []AccessRule `json:"accessRules"` - Redirection string `json:"redirection,omitempty"` -} - -func (ck *CkValidationState) String() string { - return fmt.Sprintf("CK: %q\nStatus: %q\nValidation URL: %q\n", - ck.ConsumerKey, - ck.State, - ck.ValidationURL, - ) -} - -// NewCkRequest helps create a new ck request -func (c *Client) NewCkRequest() *CkRequest { - return &CkRequest{ - client: c, - AccessRules: []AccessRule{}, - } -} - -// NewCkRequestWithRedirection helps create a new ck request with a redirect URL -func (c *Client) NewCkRequestWithRedirection(redirection string) *CkRequest { - return &CkRequest{ - client: c, - AccessRules: []AccessRule{}, - Redirection: redirection, - } -} - -// AddRule adds a new rule to the ckRequest -func (ck *CkRequest) AddRule(method, path string) { - ck.AccessRules = append(ck.AccessRules, AccessRule{ - Method: method, - Path: path, - }) -} - -// AddRules adds grant requests on "path" for all methods. "ReadOnly", -// "ReadWrite" and "ReadWriteSafe" should be used for "methods" unless -// specific access are required. -func (ck *CkRequest) AddRules(methods []string, path string) { - for _, method := range methods { - ck.AddRule(method, path) - } - -} - -// AddRecursiveRules adds grant requests on "path" and "path/*", for all -// methods "ReadOnly", "ReadWrite" and "ReadWriteSafe" should be used for -// "methods" unless specific access are required. -func (ck *CkRequest) AddRecursiveRules(methods []string, path string) { - path = strings.TrimRight(path, "/") - - // Add rules. Skip base rule when requesting access to "/" - if path != "" { - ck.AddRules(methods, path) - } - ck.AddRules(methods, path+"/*") -} - -// Do executes the request. On success, set the consumer key in the client -// and return the URL the user needs to visit to validate the key -func (ck *CkRequest) Do() (*CkValidationState, error) { - state := CkValidationState{} - err := ck.client.PostUnAuth("/auth/credential", ck, &state) - - if err == nil { - ck.client.ConsumerKey = state.ConsumerKey - } - - return &state, err -} diff --git a/vendor/github.com/ovh/go-ovh/ovh/error.go b/vendor/github.com/ovh/go-ovh/ovh/error.go deleted file mode 100644 index 35e3608..0000000 --- a/vendor/github.com/ovh/go-ovh/ovh/error.go +++ /dev/null @@ -1,17 +0,0 @@ -package ovh - -import "fmt" - -// APIError represents an error that can occurred while calling the API. -type APIError struct { - // Error message. - Message string - // HTTP code. - Code int - // ID of the request - QueryID string -} - -func (err *APIError) Error() string { - return fmt.Sprintf("Error %d: %q", err.Code, err.Message) -} diff --git a/vendor/github.com/ovh/go-ovh/ovh/ovh.go b/vendor/github.com/ovh/go-ovh/ovh/ovh.go deleted file mode 100644 index 737c944..0000000 --- a/vendor/github.com/ovh/go-ovh/ovh/ovh.go +++ /dev/null @@ -1,331 +0,0 @@ -// Package ovh provides a HTTP wrapper for the OVH API. -package ovh - -import ( - "bytes" - "crypto/sha1" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "net/http" - "strconv" - "sync" - "time" -) - -// DefaultTimeout api requests after 180s -const DefaultTimeout = 180 * time.Second - -// Endpoints -const ( - OvhEU = "https://eu.api.ovh.com/1.0" - OvhCA = "https://ca.api.ovh.com/1.0" - KimsufiEU = "https://eu.api.kimsufi.com/1.0" - KimsufiCA = "https://ca.api.kimsufi.com/1.0" - SoyoustartEU = "https://eu.api.soyoustart.com/1.0" - SoyoustartCA = "https://ca.api.soyoustart.com/1.0" - RunaboveCA = "https://api.runabove.com/1.0" -) - -// Endpoints conveniently maps endpoints names to their URI for external configuration -var Endpoints = map[string]string{ - "ovh-eu": OvhEU, - "ovh-ca": OvhCA, - "kimsufi-eu": KimsufiEU, - "kimsufi-ca": KimsufiCA, - "soyoustart-eu": SoyoustartEU, - "soyoustart-ca": SoyoustartCA, - "runabove-ca": RunaboveCA, -} - -// Errors -var ( - ErrAPIDown = errors.New("go-vh: the OVH API is down, it does't respond to /time anymore") -) - -// Client represents a client to call the OVH API -type Client struct { - // Self generated tokens. Create one by visiting - // https://eu.api.ovh.com/createApp/ - // AppKey holds the Application key - AppKey string - - // AppSecret holds the Application secret key - AppSecret string - - // ConsumerKey holds the user/app specific token. It must have been validated before use. - ConsumerKey string - - // API endpoint - endpoint string - - // Client is the underlying HTTP client used to run the requests. It may be overloaded but a default one is instanciated in ``NewClient`` by default. - Client *http.Client - - // Ensures that the timeDelta function is only ran once - // sync.Once would consider init done, even in case of error - // hence a good old flag - timeDeltaMutex *sync.Mutex - timeDeltaDone bool - timeDelta time.Duration - Timeout time.Duration -} - -// NewClient represents a new client to call the API -func NewClient(endpoint, appKey, appSecret, consumerKey string) (*Client, error) { - client := Client{ - AppKey: appKey, - AppSecret: appSecret, - ConsumerKey: consumerKey, - Client: &http.Client{}, - timeDeltaMutex: &sync.Mutex{}, - timeDeltaDone: false, - Timeout: time.Duration(DefaultTimeout), - } - - // Get and check the configuration - if err := client.loadConfig(endpoint); err != nil { - return nil, err - } - return &client, nil -} - -// NewEndpointClient will create an API client for specified -// endpoint and load all credentials from environment or -// configuration files -func NewEndpointClient(endpoint string) (*Client, error) { - return NewClient(endpoint, "", "", "") -} - -// NewDefaultClient will load all it's parameter from environment -// or configuration files -func NewDefaultClient() (*Client, error) { - return NewClient("", "", "", "") -} - -// -// High level helpers -// - -// Ping performs a ping to OVH API. -// In fact, ping is just a /auth/time call, in order to check if API is up. -func (c *Client) Ping() error { - _, err := c.getTime() - return err -} - -// TimeDelta represents the delay between the machine that runs the code and the -// OVH API. The delay shouldn't change, let's do it only once. -func (c *Client) TimeDelta() (time.Duration, error) { - return c.getTimeDelta() -} - -// Time returns time from the OVH API, by asking GET /auth/time. -func (c *Client) Time() (*time.Time, error) { - return c.getTime() -} - -// -// Common request wrappers -// - -// Get is a wrapper for the GET method -func (c *Client) Get(url string, resType interface{}) error { - return c.CallAPI("GET", url, nil, resType, true) -} - -// GetUnAuth is a wrapper for the unauthenticated GET method -func (c *Client) GetUnAuth(url string, resType interface{}) error { - return c.CallAPI("GET", url, nil, resType, false) -} - -// Post is a wrapper for the POST method -func (c *Client) Post(url string, reqBody, resType interface{}) error { - return c.CallAPI("POST", url, reqBody, resType, true) -} - -// PostUnAuth is a wrapper for the unauthenticated POST method -func (c *Client) PostUnAuth(url string, reqBody, resType interface{}) error { - return c.CallAPI("POST", url, reqBody, resType, false) -} - -// Put is a wrapper for the PUT method -func (c *Client) Put(url string, reqBody, resType interface{}) error { - return c.CallAPI("PUT", url, reqBody, resType, true) -} - -// PutUnAuth is a wrapper for the unauthenticated PUT method -func (c *Client) PutUnAuth(url string, reqBody, resType interface{}) error { - return c.CallAPI("PUT", url, reqBody, resType, false) -} - -// Delete is a wrapper for the DELETE method -func (c *Client) Delete(url string, resType interface{}) error { - return c.CallAPI("DELETE", url, nil, resType, true) -} - -// DeleteUnAuth is a wrapper for the unauthenticated DELETE method -func (c *Client) DeleteUnAuth(url string, resType interface{}) error { - return c.CallAPI("DELETE", url, nil, resType, false) -} - -// -// Low level API access -// - -// getResult check the response and unmarshals it into the response type if needed. -// Helper function, called from CallAPI. -func (c *Client) getResponse(response *http.Response, resType interface{}) error { - // Read all the response body - defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) - if err != nil { - return err - } - - // < 200 && >= 300 : API error - if response.StatusCode < http.StatusOK || response.StatusCode >= http.StatusMultipleChoices { - apiError := &APIError{Code: response.StatusCode} - if err = json.Unmarshal(body, apiError); err != nil { - return err - } - apiError.QueryID = response.Header.Get("X-Ovh-QueryID") - return apiError - } - - // Nothing to unmarshal - if len(body) == 0 || resType == nil { - return nil - } - - return json.Unmarshal(body, &resType) -} - -// timeDelta returns the time delta between the host and the remote API -func (c *Client) getTimeDelta() (time.Duration, error) { - - if !c.timeDeltaDone { - // Ensure only one thread is updating - c.timeDeltaMutex.Lock() - - // Did we wait ? Maybe no more needed - if !c.timeDeltaDone { - ovhTime, err := c.getTime() - if err != nil { - return 0, err - } - - c.timeDelta = time.Since(*ovhTime) - c.timeDeltaDone = true - } - c.timeDeltaMutex.Unlock() - } - - return c.timeDelta, nil -} - -// getTime t returns time from for a given api client endpoint -func (c *Client) getTime() (*time.Time, error) { - var timestamp int64 - - err := c.GetUnAuth("/auth/time", ×tamp) - if err != nil { - return nil, err - } - - serverTime := time.Unix(timestamp, 0) - return &serverTime, nil -} - -// getLocalTime is a function to be overwritten during the tests, it return the time -// on the the local machine -var getLocalTime = func() time.Time { - return time.Now() -} - -// getEndpointForSignature is a function to be overwritten during the tests, it returns a -// the endpoint -var getEndpointForSignature = func(c *Client) string { - return c.endpoint -} - -// CallAPI is the lowest level call helper. If needAuth is true, -// inject authentication headers and sign the request. -// -// Request signature is a sha1 hash on following fields, joined by '+': -// - applicationSecret (from Client instance) -// - consumerKey (from Client instance) -// - capitalized method (from arguments) -// - full request url, including any query string argument -// - full serialized request body -// - server current time (takes time delta into account) -// -// Call will automatically assemble the target url from the endpoint -// configured in the client instance and the path argument. If the reqBody -// argument is not nil, it will also serialize it as json and inject -// the required Content-Type header. -// -// If everyrthing went fine, unmarshall response into resType and return nil -// otherwise, return the error -func (c *Client) CallAPI(method, path string, reqBody, resType interface{}, needAuth bool) error { - var body []byte - var err error - - if reqBody != nil { - body, err = json.Marshal(reqBody) - if err != nil { - return err - } - } - - target := fmt.Sprintf("%s%s", c.endpoint, path) - req, err := http.NewRequest(method, target, bytes.NewReader(body)) - if err != nil { - return err - } - - // Inject headers - if body != nil { - req.Header.Add("Content-Type", "application/json;charset=utf-8") - } - req.Header.Add("X-Ovh-Application", c.AppKey) - req.Header.Add("Accept", "application/json") - - // Inject signature. Some methods do not need authentication, especially /time, - // /auth and some /order methods are actually broken if authenticated. - if needAuth { - timeDelta, err := c.TimeDelta() - if err != nil { - return err - } - - timestamp := getLocalTime().Add(-timeDelta).Unix() - - req.Header.Add("X-Ovh-Timestamp", strconv.FormatInt(timestamp, 10)) - req.Header.Add("X-Ovh-Consumer", c.ConsumerKey) - - h := sha1.New() - h.Write([]byte(fmt.Sprintf("%s+%s+%s+%s%s+%s+%d", - c.AppSecret, - c.ConsumerKey, - method, - getEndpointForSignature(c), - path, - body, - timestamp, - ))) - req.Header.Add("X-Ovh-Signature", fmt.Sprintf("$1$%x", h.Sum(nil))) - } - - // Send the request with requested timeout - c.Client.Timeout = c.Timeout - response, err := c.Client.Do(req) - - if err != nil { - return err - } - - // Unmarshal the result into the resType if possible - return c.getResponse(response, resType) -} diff --git a/vendor/github.com/posener/complete/LICENSE.txt b/vendor/github.com/posener/complete/LICENSE.txt new file mode 100644 index 0000000..16249b4 --- /dev/null +++ b/vendor/github.com/posener/complete/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2017 Eyal Posener + +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. \ No newline at end of file diff --git a/vendor/github.com/posener/complete/args.go b/vendor/github.com/posener/complete/args.go new file mode 100644 index 0000000..73c356d --- /dev/null +++ b/vendor/github.com/posener/complete/args.go @@ -0,0 +1,75 @@ +package complete + +import ( + "os" + "path/filepath" +) + +// Args describes command line arguments +type Args struct { + // All lists of all arguments in command line (not including the command itself) + All []string + // Completed lists of all completed arguments in command line, + // If the last one is still being typed - no space after it, + // it won't appear in this list of arguments. + Completed []string + // Last argument in command line, the one being typed, if the last + // character in the command line is a space, this argument will be empty, + // otherwise this would be the last word. + Last string + // LastCompleted is the last argument that was fully typed. + // If the last character in the command line is space, this would be the + // last word, otherwise, it would be the word before that. + LastCompleted string +} + +// Directory gives the directory of the current written +// last argument if it represents a file name being written. +// in case that it is not, we fall back to the current directory. +func (a Args) Directory() string { + if info, err := os.Stat(a.Last); err == nil && info.IsDir() { + return fixPathForm(a.Last, a.Last) + } + dir := filepath.Dir(a.Last) + if info, err := os.Stat(dir); err != nil || !info.IsDir() { + return "./" + } + return fixPathForm(a.Last, dir) +} + +func newArgs(line []string) Args { + completed := removeLast(line[1:]) + return Args{ + All: line[1:], + Completed: completed, + Last: last(line), + LastCompleted: last(completed), + } +} + +func (a Args) from(i int) Args { + if i > len(a.All) { + i = len(a.All) + } + a.All = a.All[i:] + + if i > len(a.Completed) { + i = len(a.Completed) + } + a.Completed = a.Completed[i:] + return a +} + +func removeLast(a []string) []string { + if len(a) > 0 { + return a[:len(a)-1] + } + return a +} + +func last(args []string) (last string) { + if len(args) > 0 { + last = args[len(args)-1] + } + return +} diff --git a/vendor/github.com/posener/complete/cmd/cmd.go b/vendor/github.com/posener/complete/cmd/cmd.go new file mode 100644 index 0000000..7137dee --- /dev/null +++ b/vendor/github.com/posener/complete/cmd/cmd.go @@ -0,0 +1,128 @@ +// Package cmd used for command line options for the complete tool +package cmd + +import ( + "errors" + "flag" + "fmt" + "os" + "strings" + + "github.com/posener/complete/cmd/install" +) + +// CLI for command line +type CLI struct { + Name string + InstallName string + UninstallName string + + install bool + uninstall bool + yes bool +} + +const ( + defaultInstallName = "install" + defaultUninstallName = "uninstall" +) + +// Run is used when running complete in command line mode. +// this is used when the complete is not completing words, but to +// install it or uninstall it. +func (f *CLI) Run() bool { + err := f.validate() + if err != nil { + os.Stderr.WriteString(err.Error() + "\n") + os.Exit(1) + } + + switch { + case f.install: + f.prompt() + err = install.Install(f.Name) + case f.uninstall: + f.prompt() + err = install.Uninstall(f.Name) + default: + // non of the action flags matched, + // returning false should make the real program execute + return false + } + + if err != nil { + fmt.Printf("%s failed! %s\n", f.action(), err) + os.Exit(3) + } + fmt.Println("Done!") + return true +} + +// prompt use for approval +// exit if approval was not given +func (f *CLI) prompt() { + defer fmt.Println(f.action() + "ing...") + if f.yes { + return + } + fmt.Printf("%s completion for %s? ", f.action(), f.Name) + var answer string + fmt.Scanln(&answer) + + switch strings.ToLower(answer) { + case "y", "yes": + return + default: + fmt.Println("Cancelling...") + os.Exit(1) + } +} + +// AddFlags adds the CLI flags to the flag set. +// If flags is nil, the default command line flags will be taken. +// Pass non-empty strings as installName and uninstallName to override the default +// flag names. +func (f *CLI) AddFlags(flags *flag.FlagSet) { + if flags == nil { + flags = flag.CommandLine + } + + if f.InstallName == "" { + f.InstallName = defaultInstallName + } + if f.UninstallName == "" { + f.UninstallName = defaultUninstallName + } + + if flags.Lookup(f.InstallName) == nil { + flags.BoolVar(&f.install, f.InstallName, false, + fmt.Sprintf("Install completion for %s command", f.Name)) + } + if flags.Lookup(f.UninstallName) == nil { + flags.BoolVar(&f.uninstall, f.UninstallName, false, + fmt.Sprintf("Uninstall completion for %s command", f.Name)) + } + if flags.Lookup("y") == nil { + flags.BoolVar(&f.yes, "y", false, "Don't prompt user for typing 'yes'") + } +} + +// validate the CLI +func (f *CLI) validate() error { + if f.install && f.uninstall { + return errors.New("Install and uninstall are mutually exclusive") + } + return nil +} + +// action name according to the CLI values. +func (f *CLI) action() string { + switch { + case f.install: + return "Install" + case f.uninstall: + return "Uninstall" + default: + return "unknown" + } +} diff --git a/vendor/github.com/posener/complete/cmd/install/bash.go b/vendor/github.com/posener/complete/cmd/install/bash.go new file mode 100644 index 0000000..a287f99 --- /dev/null +++ b/vendor/github.com/posener/complete/cmd/install/bash.go @@ -0,0 +1,32 @@ +package install + +import "fmt" + +// (un)install in bash +// basically adds/remove from .bashrc: +// +// complete -C +type bash struct { + rc string +} + +func (b bash) Install(cmd, bin string) error { + completeCmd := b.cmd(cmd, bin) + if lineInFile(b.rc, completeCmd) { + return fmt.Errorf("already installed in %s", b.rc) + } + return appendToFile(b.rc, completeCmd) +} + +func (b bash) Uninstall(cmd, bin string) error { + completeCmd := b.cmd(cmd, bin) + if !lineInFile(b.rc, completeCmd) { + return fmt.Errorf("does not installed in %s", b.rc) + } + + return removeFromFile(b.rc, completeCmd) +} + +func (bash) cmd(cmd, bin string) string { + return fmt.Sprintf("complete -C %s %s", bin, cmd) +} diff --git a/vendor/github.com/posener/complete/cmd/install/install.go b/vendor/github.com/posener/complete/cmd/install/install.go new file mode 100644 index 0000000..644b405 --- /dev/null +++ b/vendor/github.com/posener/complete/cmd/install/install.go @@ -0,0 +1,92 @@ +package install + +import ( + "errors" + "os" + "os/user" + "path/filepath" + + "github.com/hashicorp/go-multierror" +) + +type installer interface { + Install(cmd, bin string) error + Uninstall(cmd, bin string) error +} + +// Install complete command given: +// cmd: is the command name +func Install(cmd string) error { + is := installers() + if len(is) == 0 { + return errors.New("Did not find any shells to install") + } + bin, err := getBinaryPath() + if err != nil { + return err + } + + for _, i := range is { + errI := i.Install(cmd, bin) + if errI != nil { + err = multierror.Append(err, errI) + } + } + + return err +} + +// Uninstall complete command given: +// cmd: is the command name +func Uninstall(cmd string) error { + is := installers() + if len(is) == 0 { + return errors.New("Did not find any shells to uninstall") + } + bin, err := getBinaryPath() + if err != nil { + return err + } + + for _, i := range is { + errI := i.Uninstall(cmd, bin) + if errI != nil { + multierror.Append(err, errI) + } + } + + return err +} + +func installers() (i []installer) { + for _, rc := range [...]string{".bashrc", ".bash_profile"} { + if f := rcFile(rc); f != "" { + i = append(i, bash{f}) + break + } + } + if f := rcFile(".zshrc"); f != "" { + i = append(i, zsh{f}) + } + return +} + +func getBinaryPath() (string, error) { + bin, err := os.Executable() + if err != nil { + return "", err + } + return filepath.Abs(bin) +} + +func rcFile(name string) string { + u, err := user.Current() + if err != nil { + return "" + } + path := filepath.Join(u.HomeDir, name) + if _, err := os.Stat(path); err != nil { + return "" + } + return path +} diff --git a/vendor/github.com/posener/complete/cmd/install/utils.go b/vendor/github.com/posener/complete/cmd/install/utils.go new file mode 100644 index 0000000..2c8b44c --- /dev/null +++ b/vendor/github.com/posener/complete/cmd/install/utils.go @@ -0,0 +1,118 @@ +package install + +import ( + "bufio" + "fmt" + "io" + "io/ioutil" + "os" +) + +func lineInFile(name string, lookFor string) bool { + f, err := os.Open(name) + if err != nil { + return false + } + defer f.Close() + r := bufio.NewReader(f) + prefix := []byte{} + for { + line, isPrefix, err := r.ReadLine() + if err == io.EOF { + return false + } + if err != nil { + return false + } + if isPrefix { + prefix = append(prefix, line...) + continue + } + line = append(prefix, line...) + if string(line) == lookFor { + return true + } + prefix = prefix[:0] + } +} + +func appendToFile(name string, content string) error { + f, err := os.OpenFile(name, os.O_RDWR|os.O_APPEND, 0) + if err != nil { + return err + } + defer f.Close() + _, err = f.WriteString(fmt.Sprintf("\n%s\n", content)) + return err +} + +func removeFromFile(name string, content string) error { + backup := name + ".bck" + err := copyFile(name, backup) + if err != nil { + return err + } + temp, err := removeContentToTempFile(name, content) + if err != nil { + return err + } + + err = copyFile(temp, name) + if err != nil { + return err + } + + return os.Remove(backup) +} + +func removeContentToTempFile(name, content string) (string, error) { + rf, err := os.Open(name) + if err != nil { + return "", err + } + defer rf.Close() + wf, err := ioutil.TempFile("/tmp", "complete-") + if err != nil { + return "", err + } + defer wf.Close() + + r := bufio.NewReader(rf) + prefix := []byte{} + for { + line, isPrefix, err := r.ReadLine() + if err == io.EOF { + break + } + if err != nil { + return "", err + } + if isPrefix { + prefix = append(prefix, line...) + continue + } + line = append(prefix, line...) + str := string(line) + if str == content { + continue + } + wf.WriteString(str + "\n") + prefix = prefix[:0] + } + return wf.Name(), nil +} + +func copyFile(src string, dst string) error { + in, err := os.Open(src) + if err != nil { + return err + } + defer in.Close() + out, err := os.Create(dst) + if err != nil { + return err + } + defer out.Close() + _, err = io.Copy(out, in) + return err +} diff --git a/vendor/github.com/posener/complete/cmd/install/zsh.go b/vendor/github.com/posener/complete/cmd/install/zsh.go new file mode 100644 index 0000000..a625f53 --- /dev/null +++ b/vendor/github.com/posener/complete/cmd/install/zsh.go @@ -0,0 +1,39 @@ +package install + +import "fmt" + +// (un)install in zsh +// basically adds/remove from .zshrc: +// +// autoload -U +X bashcompinit && bashcompinit" +// complete -C +type zsh struct { + rc string +} + +func (z zsh) Install(cmd, bin string) error { + completeCmd := z.cmd(cmd, bin) + if lineInFile(z.rc, completeCmd) { + return fmt.Errorf("already installed in %s", z.rc) + } + + bashCompInit := "autoload -U +X bashcompinit && bashcompinit" + if !lineInFile(z.rc, bashCompInit) { + completeCmd = bashCompInit + "\n" + completeCmd + } + + return appendToFile(z.rc, completeCmd) +} + +func (z zsh) Uninstall(cmd, bin string) error { + completeCmd := z.cmd(cmd, bin) + if !lineInFile(z.rc, completeCmd) { + return fmt.Errorf("does not installed in %s", z.rc) + } + + return removeFromFile(z.rc, completeCmd) +} + +func (zsh) cmd(cmd, bin string) string { + return fmt.Sprintf("complete -o nospace -C %s %s", bin, cmd) +} diff --git a/vendor/github.com/posener/complete/command.go b/vendor/github.com/posener/complete/command.go new file mode 100644 index 0000000..6de48e9 --- /dev/null +++ b/vendor/github.com/posener/complete/command.go @@ -0,0 +1,118 @@ +package complete + +import "github.com/posener/complete/match" + +// Command represents a command line +// It holds the data that enables auto completion of command line +// Command can also be a sub command. +type Command struct { + // Sub is map of sub commands of the current command + // The key refer to the sub command name, and the value is it's + // Command descriptive struct. + Sub Commands + + // Flags is a map of flags that the command accepts. + // The key is the flag name, and the value is it's predictions. + Flags Flags + + // GlobalFlags is a map of flags that the command accepts. + // Global flags that can appear also after a sub command. + GlobalFlags Flags + + // Args are extra arguments that the command accepts, those who are + // given without any flag before. + Args Predictor +} + +// Predict returns all possible predictions for args according to the command struct +func (c *Command) Predict(a Args) (predictions []string) { + predictions, _ = c.predict(a) + return +} + +// Commands is the type of Sub member, it maps a command name to a command struct +type Commands map[string]Command + +// Predict completion of sub command names names according to command line arguments +func (c Commands) Predict(a Args) (prediction []string) { + for sub := range c { + if match.Prefix(sub, a.Last) { + prediction = append(prediction, sub) + } + } + return +} + +// Flags is the type Flags of the Flags member, it maps a flag name to the flag predictions. +type Flags map[string]Predictor + +// Predict completion of flags names according to command line arguments +func (f Flags) Predict(a Args) (prediction []string) { + for flag := range f { + // If the flag starts with a hyphen, we avoid emitting the prediction + // unless the last typed arg contains a hyphen as well. + flagHyphenStart := len(flag) != 0 && flag[0] == '-' + lastHyphenStart := len(a.Last) != 0 && a.Last[0] == '-' + if flagHyphenStart && !lastHyphenStart { + continue + } + + if match.Prefix(flag, a.Last) { + prediction = append(prediction, flag) + } + } + return +} + +// predict options +// only is set to true if no more options are allowed to be returned +// those are in cases of special flag that has specific completion arguments, +// and other flags or sub commands can't come after it. +func (c *Command) predict(a Args) (options []string, only bool) { + + // search sub commands for predictions first + subCommandFound := false + for i, arg := range a.Completed { + if cmd, ok := c.Sub[arg]; ok { + subCommandFound = true + + // recursive call for sub command + options, only = cmd.predict(a.from(i)) + if only { + return + } + + // We matched so stop searching. Continuing to search can accidentally + // match a subcommand with current set of commands, see issue #46. + break + } + } + + // if last completed word is a global flag that we need to complete + if predictor, ok := c.GlobalFlags[a.LastCompleted]; ok && predictor != nil { + Log("Predicting according to global flag %s", a.LastCompleted) + return predictor.Predict(a), true + } + + options = append(options, c.GlobalFlags.Predict(a)...) + + // if a sub command was entered, we won't add the parent command + // completions and we return here. + if subCommandFound { + return + } + + // if last completed word is a command flag that we need to complete + if predictor, ok := c.Flags[a.LastCompleted]; ok && predictor != nil { + Log("Predicting according to flag %s", a.LastCompleted) + return predictor.Predict(a), true + } + + options = append(options, c.Sub.Predict(a)...) + options = append(options, c.Flags.Predict(a)...) + if c.Args != nil { + options = append(options, c.Args.Predict(a)...) + } + + return +} diff --git a/vendor/github.com/posener/complete/complete.go b/vendor/github.com/posener/complete/complete.go new file mode 100644 index 0000000..1df6617 --- /dev/null +++ b/vendor/github.com/posener/complete/complete.go @@ -0,0 +1,86 @@ +// Package complete provides a tool for bash writing bash completion in go. +// +// Writing bash completion scripts is a hard work. This package provides an easy way +// to create bash completion scripts for any command, and also an easy way to install/uninstall +// the completion of the command. +package complete + +import ( + "flag" + "fmt" + "os" + "strings" + + "github.com/posener/complete/cmd" +) + +const ( + envComplete = "COMP_LINE" + envDebug = "COMP_DEBUG" +) + +// Complete structs define completion for a command with CLI options +type Complete struct { + Command Command + cmd.CLI +} + +// New creates a new complete command. +// name is the name of command we want to auto complete. +// IMPORTANT: it must be the same name - if the auto complete +// completes the 'go' command, name must be equal to "go". +// command is the struct of the command completion. +func New(name string, command Command) *Complete { + return &Complete{ + Command: command, + CLI: cmd.CLI{Name: name}, + } +} + +// Run runs the completion and add installation flags beforehand. +// The flags are added to the main flag CommandLine variable. +func (c *Complete) Run() bool { + c.AddFlags(nil) + flag.Parse() + return c.Complete() +} + +// Complete a command from completion line in environment variable, +// and print out the complete options. +// returns success if the completion ran or if the cli matched +// any of the given flags, false otherwise +// For installation: it assumes that flags were added and parsed before +// it was called. +func (c *Complete) Complete() bool { + line, ok := getLine() + if !ok { + // make sure flags parsed, + // in case they were not added in the main program + return c.CLI.Run() + } + Log("Completing line: %s", line) + + a := newArgs(line) + + options := c.Command.Predict(a) + + Log("Completion: %s", options) + output(options) + return true +} + +func getLine() ([]string, bool) { + line := os.Getenv(envComplete) + if line == "" { + return nil, false + } + return strings.Split(line, " "), true +} + +func output(options []string) { + Log("") + // stdout of program defines the complete options + for _, option := range options { + fmt.Println(option) + } +} diff --git a/vendor/github.com/posener/complete/log.go b/vendor/github.com/posener/complete/log.go new file mode 100644 index 0000000..797a80c --- /dev/null +++ b/vendor/github.com/posener/complete/log.go @@ -0,0 +1,23 @@ +package complete + +import ( + "io" + "io/ioutil" + "log" + "os" +) + +// Log is used for debugging purposes +// since complete is running on tab completion, it is nice to +// have logs to the stderr (when writing your own completer) +// to write logs, set the COMP_DEBUG environment variable and +// use complete.Log in the complete program +var Log = getLogger() + +func getLogger() func(format string, args ...interface{}) { + var logfile io.Writer = ioutil.Discard + if os.Getenv(envDebug) != "" { + logfile = os.Stderr + } + return log.New(logfile, "complete ", log.Flags()).Printf +} diff --git a/vendor/github.com/posener/complete/match/file.go b/vendor/github.com/posener/complete/match/file.go new file mode 100644 index 0000000..051171e --- /dev/null +++ b/vendor/github.com/posener/complete/match/file.go @@ -0,0 +1,19 @@ +package match + +import "strings" + +// File returns true if prefix can match the file +func File(file, prefix string) bool { + // special case for current directory completion + if file == "./" && (prefix == "." || prefix == "") { + return true + } + if prefix == "." && strings.HasPrefix(file, ".") { + return true + } + + file = strings.TrimPrefix(file, "./") + prefix = strings.TrimPrefix(prefix, "./") + + return strings.HasPrefix(file, prefix) +} diff --git a/vendor/github.com/posener/complete/match/match.go b/vendor/github.com/posener/complete/match/match.go new file mode 100644 index 0000000..812fcac --- /dev/null +++ b/vendor/github.com/posener/complete/match/match.go @@ -0,0 +1,6 @@ +package match + +// Match matches two strings +// it is used for comparing a term to the last typed +// word, the prefix, and see if it is a possible auto complete option. +type Match func(term, prefix string) bool diff --git a/vendor/github.com/posener/complete/match/prefix.go b/vendor/github.com/posener/complete/match/prefix.go new file mode 100644 index 0000000..9a01ba6 --- /dev/null +++ b/vendor/github.com/posener/complete/match/prefix.go @@ -0,0 +1,9 @@ +package match + +import "strings" + +// Prefix is a simple Matcher, if the word is it's prefix, there is a match +// Match returns true if a has the prefix as prefix +func Prefix(long, prefix string) bool { + return strings.HasPrefix(long, prefix) +} diff --git a/vendor/github.com/posener/complete/metalinter.json b/vendor/github.com/posener/complete/metalinter.json new file mode 100644 index 0000000..799c1d0 --- /dev/null +++ b/vendor/github.com/posener/complete/metalinter.json @@ -0,0 +1,21 @@ +{ + "Vendor": true, + "DisableAll": true, + "Enable": [ + "gofmt", + "goimports", + "interfacer", + "goconst", + "misspell", + "unconvert", + "gosimple", + "golint", + "structcheck", + "deadcode", + "vet" + ], + "Exclude": [ + "initTests is unused" + ], + "Deadline": "2m" +} diff --git a/vendor/github.com/posener/complete/predict.go b/vendor/github.com/posener/complete/predict.go new file mode 100644 index 0000000..8207063 --- /dev/null +++ b/vendor/github.com/posener/complete/predict.go @@ -0,0 +1,41 @@ +package complete + +// Predictor implements a predict method, in which given +// command line arguments returns a list of options it predicts. +type Predictor interface { + Predict(Args) []string +} + +// PredictOr unions two predicate functions, so that the result predicate +// returns the union of their predication +func PredictOr(predictors ...Predictor) Predictor { + return PredictFunc(func(a Args) (prediction []string) { + for _, p := range predictors { + if p == nil { + continue + } + prediction = append(prediction, p.Predict(a)...) + } + return + }) +} + +// PredictFunc determines what terms can follow a command or a flag +// It is used for auto completion, given last - the last word in the already +// in the command line, what words can complete it. +type PredictFunc func(Args) []string + +// Predict invokes the predict function and implements the Predictor interface +func (p PredictFunc) Predict(a Args) []string { + if p == nil { + return nil + } + return p(a) +} + +// PredictNothing does not expect anything after. +var PredictNothing Predictor + +// PredictAnything expects something, but nothing particular, such as a number +// or arbitrary name. +var PredictAnything = PredictFunc(func(Args) []string { return nil }) diff --git a/vendor/github.com/posener/complete/predict_files.go b/vendor/github.com/posener/complete/predict_files.go new file mode 100644 index 0000000..c8adf7e --- /dev/null +++ b/vendor/github.com/posener/complete/predict_files.go @@ -0,0 +1,108 @@ +package complete + +import ( + "io/ioutil" + "os" + "path/filepath" + "strings" + + "github.com/posener/complete/match" +) + +// PredictDirs will search for directories in the given started to be typed +// path, if no path was started to be typed, it will complete to directories +// in the current working directory. +func PredictDirs(pattern string) Predictor { + return files(pattern, false) +} + +// PredictFiles will search for files matching the given pattern in the started to +// be typed path, if no path was started to be typed, it will complete to files that +// match the pattern in the current working directory. +// To match any file, use "*" as pattern. To match go files use "*.go", and so on. +func PredictFiles(pattern string) Predictor { + return files(pattern, true) +} + +func files(pattern string, allowFiles bool) PredictFunc { + + // search for files according to arguments, + // if only one directory has matched the result, search recursively into + // this directory to give more results. + return func(a Args) (prediction []string) { + prediction = predictFiles(a, pattern, allowFiles) + + // if the number of prediction is not 1, we either have many results or + // have no results, so we return it. + if len(prediction) != 1 { + return + } + + // only try deeper, if the one item is a directory + if stat, err := os.Stat(prediction[0]); err != nil || !stat.IsDir() { + return + } + + a.Last = prediction[0] + return predictFiles(a, pattern, allowFiles) + } +} + +func predictFiles(a Args, pattern string, allowFiles bool) []string { + if strings.HasSuffix(a.Last, "/..") { + return nil + } + + dir := a.Directory() + files := listFiles(dir, pattern, allowFiles) + + // add dir if match + files = append(files, dir) + + return PredictFilesSet(files).Predict(a) +} + +// PredictFilesSet predict according to file rules to a given set of file names +func PredictFilesSet(files []string) PredictFunc { + return func(a Args) (prediction []string) { + // add all matching files to prediction + for _, f := range files { + f = fixPathForm(a.Last, f) + + // test matching of file to the argument + if match.File(f, a.Last) { + prediction = append(prediction, f) + } + } + return + } +} + +func listFiles(dir, pattern string, allowFiles bool) []string { + // set of all file names + m := map[string]bool{} + + // list files + if files, err := filepath.Glob(filepath.Join(dir, pattern)); err == nil { + for _, f := range files { + if stat, err := os.Stat(f); err != nil || stat.IsDir() || allowFiles { + m[f] = true + } + } + } + + // list directories + if dirs, err := ioutil.ReadDir(dir); err == nil { + for _, d := range dirs { + if d.IsDir() { + m[filepath.Join(dir, d.Name())] = true + } + } + } + + list := make([]string, 0, len(m)) + for k := range m { + list = append(list, k) + } + return list +} diff --git a/vendor/github.com/posener/complete/predict_set.go b/vendor/github.com/posener/complete/predict_set.go new file mode 100644 index 0000000..8fc59d7 --- /dev/null +++ b/vendor/github.com/posener/complete/predict_set.go @@ -0,0 +1,19 @@ +package complete + +import "github.com/posener/complete/match" + +// PredictSet expects specific set of terms, given in the options argument. +func PredictSet(options ...string) Predictor { + return predictSet(options) +} + +type predictSet []string + +func (p predictSet) Predict(a Args) (prediction []string) { + for _, m := range p { + if match.Prefix(m, a.Last) { + prediction = append(prediction, m) + } + } + return +} diff --git a/vendor/github.com/posener/complete/readme.md b/vendor/github.com/posener/complete/readme.md new file mode 100644 index 0000000..74077e3 --- /dev/null +++ b/vendor/github.com/posener/complete/readme.md @@ -0,0 +1,116 @@ +# complete + +[![Build Status](https://travis-ci.org/posener/complete.svg?branch=master)](https://travis-ci.org/posener/complete) +[![codecov](https://codecov.io/gh/posener/complete/branch/master/graph/badge.svg)](https://codecov.io/gh/posener/complete) +[![GoDoc](https://godoc.org/github.com/posener/complete?status.svg)](http://godoc.org/github.com/posener/complete) +[![Go Report Card](https://goreportcard.com/badge/github.com/posener/complete)](https://goreportcard.com/report/github.com/posener/complete) + +A tool for bash writing bash completion in go. + +Writing bash completion scripts is a hard work. This package provides an easy way +to create bash completion scripts for any command, and also an easy way to install/uninstall +the completion of the command. + +## go command bash completion + +In [gocomplete](./gocomplete) there is an example for bash completion for the `go` command line. + +This is an example that uses the `complete` package on the `go` command - the `complete` package +can also be used to implement any completions, see [Usage](#usage). + +### Install + +1. Type in your shell: +``` +go get -u github.com/posener/complete/gocomplete +gocomplete -install +``` + +2. Restart your shell + +Uninstall by `gocomplete -uninstall` + +### Features + +- Complete `go` command, including sub commands and all flags. +- Complete packages names or `.go` files when necessary. +- Complete test names after `-run` flag. + +## complete package + +Supported shells: + +- [x] bash +- [x] zsh + +### Usage + +Assuming you have program called `run` and you want to have bash completion +for it, meaning, if you type `run` then space, then press the `Tab` key, +the shell will suggest relevant complete options. + +In that case, we will create a program called `runcomplete`, a go program, +with a `func main()` and so, that will make the completion of the `run` +program. Once the `runcomplete` will be in a binary form, we could +`runcomplete -install` and that will add to our shell all the bash completion +options for `run`. + +So here it is: + +```go +import "github.com/posener/complete" + +func main() { + + // create a Command object, that represents the command we want + // to complete. + run := complete.Command{ + + // Sub defines a list of sub commands of the program, + // this is recursive, since every command is of type command also. + Sub: complete.Commands{ + + // add a build sub command + "build": complete.Command { + + // define flags of the build sub command + Flags: complete.Flags{ + // build sub command has a flag '-cpus', which + // expects number of cpus after it. in that case + // anything could complete this flag. + "-cpus": complete.PredictAnything, + }, + }, + }, + + // define flags of the 'run' main command + Flags: complete.Flags{ + // a flag -o, which expects a file ending with .out after + // it, the tab completion will auto complete for files matching + // the given pattern. + "-o": complete.PredictFiles("*.out"), + }, + + // define global flags of the 'run' main command + // those will show up also when a sub command was entered in the + // command line + GlobalFlags: complete.Flags{ + + // a flag '-h' which does not expects anything after it + "-h": complete.PredictNothing, + }, + } + + // run the command completion, as part of the main() function. + // this triggers the autocompletion when needed. + // name must be exactly as the binary that we want to complete. + complete.New("run", run).Run() +} +``` + +### Self completing program + +In case that the program that we want to complete is written in go we +can make it self completing. + +Here is an [example](./example/self/main.go) diff --git a/vendor/github.com/posener/complete/test.sh b/vendor/github.com/posener/complete/test.sh new file mode 100755 index 0000000..56bfcf1 --- /dev/null +++ b/vendor/github.com/posener/complete/test.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e +echo "" > coverage.txt + +for d in $(go list ./... | grep -v vendor); do + go test -v -race -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done \ No newline at end of file diff --git a/vendor/github.com/posener/complete/utils.go b/vendor/github.com/posener/complete/utils.go new file mode 100644 index 0000000..58b8b79 --- /dev/null +++ b/vendor/github.com/posener/complete/utils.go @@ -0,0 +1,46 @@ +package complete + +import ( + "os" + "path/filepath" + "strings" +) + +// fixPathForm changes a file name to a relative name +func fixPathForm(last string, file string) string { + // get wording directory for relative name + workDir, err := os.Getwd() + if err != nil { + return file + } + + abs, err := filepath.Abs(file) + if err != nil { + return file + } + + // if last is absolute, return path as absolute + if filepath.IsAbs(last) { + return fixDirPath(abs) + } + + rel, err := filepath.Rel(workDir, abs) + if err != nil { + return file + } + + // fix ./ prefix of path + if rel != "." && strings.HasPrefix(last, ".") { + rel = "./" + rel + } + + return fixDirPath(rel) +} + +func fixDirPath(path string) string { + info, err := os.Stat(path) + if err == nil && info.IsDir() && !strings.HasSuffix(path, "/") { + path += "/" + } + return path +} diff --git a/vendor/github.com/ulikunitz/xz/LICENSE b/vendor/github.com/ulikunitz/xz/LICENSE new file mode 100644 index 0000000..58ebdc1 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2014-2016 Ulrich Kunitz +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* My name, Ulrich Kunitz, may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/ulikunitz/xz/README.md b/vendor/github.com/ulikunitz/xz/README.md new file mode 100644 index 0000000..969ae7a --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/README.md @@ -0,0 +1,71 @@ +# Package xz + +This Go language package supports the reading and writing of xz +compressed streams. It includes also a gxz command for compressing and +decompressing data. The package is completely written in Go and doesn't +have any dependency on any C code. + +The package is currently under development. There might be bugs and APIs +are not considered stable. At this time the package cannot compete with +the xz tool regarding compression speed and size. The algorithms there +have been developed over a long time and are highly optimized. However +there are a number of improvements planned and I'm very optimistic about +parallel compression and decompression. Stay tuned! + +# Using the API + +The following example program shows how to use the API. + + package main + + import ( + "bytes" + "io" + "log" + "os" + + "github.com/ulikunitz/xz" + ) + + func main() { + const text = "The quick brown fox jumps over the lazy dog.\n" + var buf bytes.Buffer + // compress text + w, err := xz.NewWriter(&buf) + if err != nil { + log.Fatalf("xz.NewWriter error %s", err) + } + if _, err := io.WriteString(w, text); err != nil { + log.Fatalf("WriteString error %s", err) + } + if err := w.Close(); err != nil { + log.Fatalf("w.Close error %s", err) + } + // decompress buffer and write output to stdout + r, err := xz.NewReader(&buf) + if err != nil { + log.Fatalf("NewReader error %s", err) + } + if _, err = io.Copy(os.Stdout, r); err != nil { + log.Fatalf("io.Copy error %s", err) + } + } + +# Using the gxz compression tool + +The package includes a gxz command line utility for compression and +decompression. + +Use following command for installation: + + $ go get github.com/ulikunitz/xz/cmd/gxz + +To test it call the following command. + + $ gxz bigfile + +After some time a much smaller file bigfile.xz will replace bigfile. +To decompress it use the following command. + + $ gxz -d bigfile.xz + diff --git a/vendor/github.com/ulikunitz/xz/TODO.md b/vendor/github.com/ulikunitz/xz/TODO.md new file mode 100644 index 0000000..7b34c0c --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/TODO.md @@ -0,0 +1,315 @@ +# TODO list + +## Release v0.6 + +1. Review encoder and check for lzma improvements under xz. +2. Fix binary tree matcher. +3. Compare compression ratio with xz tool using comparable parameters + and optimize parameters +4. Do some optimizations + - rename operation action and make it a simple type of size 8 + - make maxMatches, wordSize parameters + - stop searching after a certain length is found (parameter sweetLen) + +## Release v0.7 + +1. Optimize code +2. Do statistical analysis to get linear presets. +3. Test sync.Pool compatability for xz and lzma Writer and Reader +3. Fuzz optimized code. + +## Release v0.8 + +1. Support parallel go routines for writing and reading xz files. +2. Support a ReaderAt interface for xz files with small block sizes. +3. Improve compatibility between gxz and xz +4. Provide manual page for gxz + +## Release v0.9 + +1. Improve documentation +2. Fuzz again + +## Release v1.0 + +1. Full functioning gxz +2. Add godoc URL to README.md (godoc.org) +3. Resolve all issues. +4. Define release candidates. +5. Public announcement. + +## Package lzma + +### Release v0.6 + +- Rewrite Encoder into a simple greedy one-op-at-a-time encoder + including + + simple scan at the dictionary head for the same byte + + use the killer byte (requiring matches to get longer, the first + test should be the byte that would make the match longer) + + +## Optimizations + +- There may be a lot of false sharing in lzma.State; check whether this + can be improved by reorganizing the internal structure of it. +- Check whether batching encoding and decoding improves speed. + +### DAG optimizations + +- Use full buffer to create minimal bit-length above range encoder. +- Might be too slow (see v0.4) + +### Different match finders + +- hashes with 2, 3 characters additional to 4 characters +- binary trees with 2-7 characters (uint64 as key, use uint32 as + pointers into a an array) +- rb-trees with 2-7 characters (uint64 as key, use uint32 as pointers + into an array with bit-steeling for the colors) + +## Release Procedure + +- execute goch -l for all packages; probably with lower param like 0.5. +- check orthography with gospell +- Write release notes in doc/relnotes. +- Update README.md +- xb copyright . in xz directory to ensure all new files have Copyright + header +- VERSION= go generate github.com/ulikunitz/xz/... to update + version files +- Execute test for Linux/amd64, Linux/x86 and Windows/amd64. +- Update TODO.md - write short log entry +- git checkout master && git merge dev +- git tag -a +- git push + +## Log + +### 2017-06-05 + +Release v0.5.4 fixes issues #15 of another problem with the padding size +check for the xz block header. I removed the check completely. + +### 2017-02-15 + +Release v0.5.3 fixes issue #12 regarding the decompression of an empty +XZ stream. Many thanks to Tomasz Kłak, who reported the issue. + +### 2016-12-02 + +Release v0.5.2 became necessary to allow the decoding of xz files with +4-byte padding in the block header. Many thanks to Greg, who reported +the issue. + +### 2016-07-23 + +Release v0.5.1 became necessary to fix problems with 32-bit platforms. +Many thanks to Bruno Brigas, who reported the issue. + +### 2016-07-04 + +Release v0.5 provides improvements to the compressor and provides support for +the decompression of xz files with multiple xz streams. + +### 2016-01-31 + +Another compression rate increase by checking the byte at length of the +best match first, before checking the whole prefix. This makes the +compressor even faster. We have now a large time budget to beat the +compression ratio of the xz tool. For enwik8 we have now over 40 seconds +to reduce the compressed file size for another 7 MiB. + +### 2016-01-30 + +I simplified the encoder. Speed and compression rate increased +dramatically. A high compression rate affects also the decompression +speed. The approach with the buffer and optimizing for operation +compression rate has not been successful. Going for the maximum length +appears to be the best approach. + +### 2016-01-28 + +The release v0.4 is ready. It provides a working xz implementation, +which is rather slow, but works and is interoperable with the xz tool. +It is an important milestone. + +### 2016-01-10 + +I have the first working implementation of an xz reader and writer. I'm +happy about reaching this milestone. + +### 2015-12-02 + +I'm now ready to implement xz because, I have a working LZMA2 +implementation. I decided today that v0.4 will use the slow encoder +using the operations buffer to be able to go back, if I intend to do so. + +### 2015-10-21 + +I have restarted the work on the library. While trying to implement +LZMA2, I discovered that I need to resimplify the encoder and decoder +functions. The option approach is too complicated. Using a limited byte +writer and not caring for written bytes at all and not to try to handle +uncompressed data simplifies the LZMA encoder and decoder much. +Processing uncompressed data and handling limits is a feature of the +LZMA2 format not of LZMA. + +I learned an interesting method from the LZO format. If the last copy is +too far away they are moving the head one 2 bytes and not 1 byte to +reduce processing times. + +### 2015-08-26 + +I have now reimplemented the lzma package. The code is reasonably fast, +but can still be optimized. The next step is to implement LZMA2 and then +xz. + +### 2015-07-05 + +Created release v0.3. The version is the foundation for a full xz +implementation that is the target of v0.4. + +### 2015-06-11 + +The gflag package has been developed because I couldn't use flag and +pflag for a fully compatible support of gzip's and lzma's options. It +seems to work now quite nicely. + +### 2015-06-05 + +The overflow issue was interesting to research, however Henry S. Warren +Jr. Hacker's Delight book was very helpful as usual and had the issue +explained perfectly. Fefe's information on his website was based on the +C FAQ and quite bad, because it didn't address the issue of -MININT == +MININT. + +### 2015-06-04 + +It has been a productive day. I improved the interface of lzma.Reader +and lzma.Writer and fixed the error handling. + +### 2015-06-01 + +By computing the bit length of the LZMA operations I was able to +improve the greedy algorithm implementation. By using an 8 MByte buffer +the compression rate was not as good as for xz but already better then +gzip default. + +Compression is currently slow, but this is something we will be able to +improve over time. + +### 2015-05-26 + +Checked the license of ogier/pflag. The binary lzmago binary should +include the license terms for the pflag library. + +I added the endorsement clause as used by Google for the Go sources the +LICENSE file. + +### 2015-05-22 + +The package lzb contains now the basic implementation for creating or +reading LZMA byte streams. It allows the support for the implementation +of the DAG-shortest-path algorithm for the compression function. + +### 2015-04-23 + +Completed yesterday the lzbase classes. I'm a little bit concerned that +using the components may require too much code, but on the other hand +there is a lot of flexibility. + +### 2015-04-22 + +Implemented Reader and Writer during the Bayern game against Porto. The +second half gave me enough time. + +### 2015-04-21 + +While showering today morning I discovered that the design for OpEncoder +and OpDecoder doesn't work, because encoding/decoding might depend on +the current status of the dictionary. This is not exactly the right way +to start the day. + +Therefore we need to keep the Reader and Writer design. This time around +we simplify it by ignoring size limits. These can be added by wrappers +around the Reader and Writer interfaces. The Parameters type isn't +needed anymore. + +However I will implement a ReaderState and WriterState type to use +static typing to ensure the right State object is combined with the +right lzbase.Reader and lzbase.Writer. + +As a start I have implemented ReaderState and WriterState to ensure +that the state for reading is only used by readers and WriterState only +used by Writers. + +### 2015-04-20 + +Today I implemented the OpDecoder and tested OpEncoder and OpDecoder. + +### 2015-04-08 + +Came up with a new simplified design for lzbase. I implemented already +the type State that replaces OpCodec. + +### 2015-04-06 + +The new lzma package is now fully usable and lzmago is using it now. The +old lzma package has been completely removed. + +### 2015-04-05 + +Implemented lzma.Reader and tested it. + +### 2015-04-04 + +Implemented baseReader by adapting code form lzma.Reader. + +### 2015-04-03 + +The opCodec has been copied yesterday to lzma2. opCodec has a high +number of dependencies on other files in lzma2. Therefore I had to copy +almost all files from lzma. + +### 2015-03-31 + +Removed only a TODO item. + +However in Francesco Campoy's presentation "Go for Javaneros +(Javaïstes?)" is the the idea that using an embedded field E, all the +methods of E will be defined on T. If E is an interface T satisfies E. + +https://talks.golang.org/2014/go4java.slide#51 + +I have never used this, but it seems to be a cool idea. + +### 2015-03-30 + +Finished the type writerDict and wrote a simple test. + +### 2015-03-25 + +I started to implement the writerDict. + +### 2015-03-24 + +After thinking long about the LZMA2 code and several false starts, I +have now a plan to create a self-sufficient lzma2 package that supports +the classic LZMA format as well as LZMA2. The core idea is to support a +baseReader and baseWriter type that support the basic LZMA stream +without any headers. Both types must support the reuse of dictionaries +and the opCodec. + +### 2015-01-10 + +1. Implemented simple lzmago tool +2. Tested tool against large 4.4G file + - compression worked correctly; tested decompression with lzma + - decompression hits a full buffer condition +3. Fixed a bug in the compressor and wrote a test for it +4. Executed full cycle for 4.4 GB file; performance can be improved ;-) + +### 2015-01-11 + +- Release v0.2 because of the working LZMA encoder and decoder diff --git a/vendor/github.com/ulikunitz/xz/bits.go b/vendor/github.com/ulikunitz/xz/bits.go new file mode 100644 index 0000000..fadc1a5 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/bits.go @@ -0,0 +1,74 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xz + +import ( + "errors" + "io" +) + +// putUint32LE puts the little-endian representation of x into the first +// four bytes of p. +func putUint32LE(p []byte, x uint32) { + p[0] = byte(x) + p[1] = byte(x >> 8) + p[2] = byte(x >> 16) + p[3] = byte(x >> 24) +} + +// putUint64LE puts the little-endian representation of x into the first +// eight bytes of p. +func putUint64LE(p []byte, x uint64) { + p[0] = byte(x) + p[1] = byte(x >> 8) + p[2] = byte(x >> 16) + p[3] = byte(x >> 24) + p[4] = byte(x >> 32) + p[5] = byte(x >> 40) + p[6] = byte(x >> 48) + p[7] = byte(x >> 56) +} + +// uint32LE converts a little endian representation to an uint32 value. +func uint32LE(p []byte) uint32 { + return uint32(p[0]) | uint32(p[1])<<8 | uint32(p[2])<<16 | + uint32(p[3])<<24 +} + +// putUvarint puts a uvarint representation of x into the byte slice. +func putUvarint(p []byte, x uint64) int { + i := 0 + for x >= 0x80 { + p[i] = byte(x) | 0x80 + x >>= 7 + i++ + } + p[i] = byte(x) + return i + 1 +} + +// errOverflow indicates an overflow of the 64-bit unsigned integer. +var errOverflowU64 = errors.New("xz: uvarint overflows 64-bit unsigned integer") + +// readUvarint reads a uvarint from the given byte reader. +func readUvarint(r io.ByteReader) (x uint64, n int, err error) { + var s uint + i := 0 + for { + b, err := r.ReadByte() + if err != nil { + return x, i, err + } + i++ + if b < 0x80 { + if i > 10 || i == 10 && b > 1 { + return x, i, errOverflowU64 + } + return x | uint64(b)< 0 { + k = 4 - k + } + return k +} + +/*** Header ***/ + +// headerMagic stores the magic bytes for the header +var headerMagic = []byte{0xfd, '7', 'z', 'X', 'Z', 0x00} + +// HeaderLen provides the length of the xz file header. +const HeaderLen = 12 + +// Constants for the checksum methods supported by xz. +const ( + CRC32 byte = 0x1 + CRC64 = 0x4 + SHA256 = 0xa +) + +// errInvalidFlags indicates that flags are invalid. +var errInvalidFlags = errors.New("xz: invalid flags") + +// verifyFlags returns the error errInvalidFlags if the value is +// invalid. +func verifyFlags(flags byte) error { + switch flags { + case CRC32, CRC64, SHA256: + return nil + default: + return errInvalidFlags + } +} + +// flagstrings maps flag values to strings. +var flagstrings = map[byte]string{ + CRC32: "CRC-32", + CRC64: "CRC-64", + SHA256: "SHA-256", +} + +// flagString returns the string representation for the given flags. +func flagString(flags byte) string { + s, ok := flagstrings[flags] + if !ok { + return "invalid" + } + return s +} + +// newHashFunc returns a function that creates hash instances for the +// hash method encoded in flags. +func newHashFunc(flags byte) (newHash func() hash.Hash, err error) { + switch flags { + case CRC32: + newHash = newCRC32 + case CRC64: + newHash = newCRC64 + case SHA256: + newHash = sha256.New + default: + err = errInvalidFlags + } + return +} + +// header provides the actual content of the xz file header: the flags. +type header struct { + flags byte +} + +// Errors returned by readHeader. +var errHeaderMagic = errors.New("xz: invalid header magic bytes") + +// ValidHeader checks whether data is a correct xz file header. The +// length of data must be HeaderLen. +func ValidHeader(data []byte) bool { + var h header + err := h.UnmarshalBinary(data) + return err == nil +} + +// String returns a string representation of the flags. +func (h header) String() string { + return flagString(h.flags) +} + +// UnmarshalBinary reads header from the provided data slice. +func (h *header) UnmarshalBinary(data []byte) error { + // header length + if len(data) != HeaderLen { + return errors.New("xz: wrong file header length") + } + + // magic header + if !bytes.Equal(headerMagic, data[:6]) { + return errHeaderMagic + } + + // checksum + crc := crc32.NewIEEE() + crc.Write(data[6:8]) + if uint32LE(data[8:]) != crc.Sum32() { + return errors.New("xz: invalid checksum for file header") + } + + // stream flags + if data[6] != 0 { + return errInvalidFlags + } + flags := data[7] + if err := verifyFlags(flags); err != nil { + return err + } + + h.flags = flags + return nil +} + +// MarshalBinary generates the xz file header. +func (h *header) MarshalBinary() (data []byte, err error) { + if err = verifyFlags(h.flags); err != nil { + return nil, err + } + + data = make([]byte, 12) + copy(data, headerMagic) + data[7] = h.flags + + crc := crc32.NewIEEE() + crc.Write(data[6:8]) + putUint32LE(data[8:], crc.Sum32()) + + return data, nil +} + +/*** Footer ***/ + +// footerLen defines the length of the footer. +const footerLen = 12 + +// footerMagic contains the footer magic bytes. +var footerMagic = []byte{'Y', 'Z'} + +// footer represents the content of the xz file footer. +type footer struct { + indexSize int64 + flags byte +} + +// String prints a string representation of the footer structure. +func (f footer) String() string { + return fmt.Sprintf("%s index size %d", flagString(f.flags), f.indexSize) +} + +// Minimum and maximum for the size of the index (backward size). +const ( + minIndexSize = 4 + maxIndexSize = (1 << 32) * 4 +) + +// MarshalBinary converts footer values into an xz file footer. Note +// that the footer value is checked for correctness. +func (f *footer) MarshalBinary() (data []byte, err error) { + if err = verifyFlags(f.flags); err != nil { + return nil, err + } + if !(minIndexSize <= f.indexSize && f.indexSize <= maxIndexSize) { + return nil, errors.New("xz: index size out of range") + } + if f.indexSize%4 != 0 { + return nil, errors.New( + "xz: index size not aligned to four bytes") + } + + data = make([]byte, footerLen) + + // backward size (index size) + s := (f.indexSize / 4) - 1 + putUint32LE(data[4:], uint32(s)) + // flags + data[9] = f.flags + // footer magic + copy(data[10:], footerMagic) + + // CRC-32 + crc := crc32.NewIEEE() + crc.Write(data[4:10]) + putUint32LE(data, crc.Sum32()) + + return data, nil +} + +// UnmarshalBinary sets the footer value by unmarshalling an xz file +// footer. +func (f *footer) UnmarshalBinary(data []byte) error { + if len(data) != footerLen { + return errors.New("xz: wrong footer length") + } + + // magic bytes + if !bytes.Equal(data[10:], footerMagic) { + return errors.New("xz: footer magic invalid") + } + + // CRC-32 + crc := crc32.NewIEEE() + crc.Write(data[4:10]) + if uint32LE(data) != crc.Sum32() { + return errors.New("xz: footer checksum error") + } + + var g footer + // backward size (index size) + g.indexSize = (int64(uint32LE(data[4:])) + 1) * 4 + + // flags + if data[8] != 0 { + return errInvalidFlags + } + g.flags = data[9] + if err := verifyFlags(g.flags); err != nil { + return err + } + + *f = g + return nil +} + +/*** Block Header ***/ + +// blockHeader represents the content of an xz block header. +type blockHeader struct { + compressedSize int64 + uncompressedSize int64 + filters []filter +} + +// String converts the block header into a string. +func (h blockHeader) String() string { + var buf bytes.Buffer + first := true + if h.compressedSize >= 0 { + fmt.Fprintf(&buf, "compressed size %d", h.compressedSize) + first = false + } + if h.uncompressedSize >= 0 { + if !first { + buf.WriteString(" ") + } + fmt.Fprintf(&buf, "uncompressed size %d", h.uncompressedSize) + first = false + } + for _, f := range h.filters { + if !first { + buf.WriteString(" ") + } + fmt.Fprintf(&buf, "filter %s", f) + first = false + } + return buf.String() +} + +// Masks for the block flags. +const ( + filterCountMask = 0x03 + compressedSizePresent = 0x40 + uncompressedSizePresent = 0x80 + reservedBlockFlags = 0x3C +) + +// errIndexIndicator signals that an index indicator (0x00) has been found +// instead of an expected block header indicator. +var errIndexIndicator = errors.New("xz: found index indicator") + +// readBlockHeader reads the block header. +func readBlockHeader(r io.Reader) (h *blockHeader, n int, err error) { + var buf bytes.Buffer + buf.Grow(20) + + // block header size + z, err := io.CopyN(&buf, r, 1) + n = int(z) + if err != nil { + return nil, n, err + } + s := buf.Bytes()[0] + if s == 0 { + return nil, n, errIndexIndicator + } + + // read complete header + headerLen := (int(s) + 1) * 4 + buf.Grow(headerLen - 1) + z, err = io.CopyN(&buf, r, int64(headerLen-1)) + n += int(z) + if err != nil { + return nil, n, err + } + + // unmarshal block header + h = new(blockHeader) + if err = h.UnmarshalBinary(buf.Bytes()); err != nil { + return nil, n, err + } + + return h, n, nil +} + +// readSizeInBlockHeader reads the uncompressed or compressed size +// fields in the block header. The present value informs the function +// whether the respective field is actually present in the header. +func readSizeInBlockHeader(r io.ByteReader, present bool) (n int64, err error) { + if !present { + return -1, nil + } + x, _, err := readUvarint(r) + if err != nil { + return 0, err + } + if x >= 1<<63 { + return 0, errors.New("xz: size overflow in block header") + } + return int64(x), nil +} + +// UnmarshalBinary unmarshals the block header. +func (h *blockHeader) UnmarshalBinary(data []byte) error { + // Check header length + s := data[0] + if data[0] == 0 { + return errIndexIndicator + } + headerLen := (int(s) + 1) * 4 + if len(data) != headerLen { + return fmt.Errorf("xz: data length %d; want %d", len(data), + headerLen) + } + n := headerLen - 4 + + // Check CRC-32 + crc := crc32.NewIEEE() + crc.Write(data[:n]) + if crc.Sum32() != uint32LE(data[n:]) { + return errors.New("xz: checksum error for block header") + } + + // Block header flags + flags := data[1] + if flags&reservedBlockFlags != 0 { + return errors.New("xz: reserved block header flags set") + } + + r := bytes.NewReader(data[2:n]) + + // Compressed size + var err error + h.compressedSize, err = readSizeInBlockHeader( + r, flags&compressedSizePresent != 0) + if err != nil { + return err + } + + // Uncompressed size + h.uncompressedSize, err = readSizeInBlockHeader( + r, flags&uncompressedSizePresent != 0) + if err != nil { + return err + } + + h.filters, err = readFilters(r, int(flags&filterCountMask)+1) + if err != nil { + return err + } + + // Check padding + // Since headerLen is a multiple of 4 we don't need to check + // alignment. + k := r.Len() + // The standard spec says that the padding should have not more + // than 3 bytes. However we found paddings of 4 or 5 in the + // wild. See https://github.com/ulikunitz/xz/pull/11 and + // https://github.com/ulikunitz/xz/issues/15 + // + // The only reasonable approach seems to be to ignore the + // padding size. We still check that all padding bytes are zero. + if !allZeros(data[n-k : n]) { + return errPadding + } + return nil +} + +// MarshalBinary marshals the binary header. +func (h *blockHeader) MarshalBinary() (data []byte, err error) { + if !(minFilters <= len(h.filters) && len(h.filters) <= maxFilters) { + return nil, errors.New("xz: filter count wrong") + } + for i, f := range h.filters { + if i < len(h.filters)-1 { + if f.id() == lzmaFilterID { + return nil, errors.New( + "xz: LZMA2 filter is not the last") + } + } else { + // last filter + if f.id() != lzmaFilterID { + return nil, errors.New("xz: " + + "last filter must be the LZMA2 filter") + } + } + } + + var buf bytes.Buffer + // header size must set at the end + buf.WriteByte(0) + + // flags + flags := byte(len(h.filters) - 1) + if h.compressedSize >= 0 { + flags |= compressedSizePresent + } + if h.uncompressedSize >= 0 { + flags |= uncompressedSizePresent + } + buf.WriteByte(flags) + + p := make([]byte, 10) + if h.compressedSize >= 0 { + k := putUvarint(p, uint64(h.compressedSize)) + buf.Write(p[:k]) + } + if h.uncompressedSize >= 0 { + k := putUvarint(p, uint64(h.uncompressedSize)) + buf.Write(p[:k]) + } + + for _, f := range h.filters { + fp, err := f.MarshalBinary() + if err != nil { + return nil, err + } + buf.Write(fp) + } + + // padding + for i := padLen(int64(buf.Len())); i > 0; i-- { + buf.WriteByte(0) + } + + // crc place holder + buf.Write(p[:4]) + + data = buf.Bytes() + if len(data)%4 != 0 { + panic("data length not aligned") + } + s := len(data)/4 - 1 + if !(1 < s && s <= 255) { + panic("wrong block header size") + } + data[0] = byte(s) + + crc := crc32.NewIEEE() + crc.Write(data[:len(data)-4]) + putUint32LE(data[len(data)-4:], crc.Sum32()) + + return data, nil +} + +// Constants used for marshalling and unmarshalling filters in the xz +// block header. +const ( + minFilters = 1 + maxFilters = 4 + minReservedID = 1 << 62 +) + +// filter represents a filter in the block header. +type filter interface { + id() uint64 + UnmarshalBinary(data []byte) error + MarshalBinary() (data []byte, err error) + reader(r io.Reader, c *ReaderConfig) (fr io.Reader, err error) + writeCloser(w io.WriteCloser, c *WriterConfig) (fw io.WriteCloser, err error) + // filter must be last filter + last() bool +} + +// readFilter reads a block filter from the block header. At this point +// in time only the LZMA2 filter is supported. +func readFilter(r io.Reader) (f filter, err error) { + br := lzma.ByteReader(r) + + // index + id, _, err := readUvarint(br) + if err != nil { + return nil, err + } + + var data []byte + switch id { + case lzmaFilterID: + data = make([]byte, lzmaFilterLen) + data[0] = lzmaFilterID + if _, err = io.ReadFull(r, data[1:]); err != nil { + return nil, err + } + f = new(lzmaFilter) + default: + if id >= minReservedID { + return nil, errors.New( + "xz: reserved filter id in block stream header") + } + return nil, errors.New("xz: invalid filter id") + } + if err = f.UnmarshalBinary(data); err != nil { + return nil, err + } + return f, err +} + +// readFilters reads count filters. At this point in time only the count +// 1 is supported. +func readFilters(r io.Reader, count int) (filters []filter, err error) { + if count != 1 { + return nil, errors.New("xz: unsupported filter count") + } + f, err := readFilter(r) + if err != nil { + return nil, err + } + return []filter{f}, err +} + +// writeFilters writes the filters. +func writeFilters(w io.Writer, filters []filter) (n int, err error) { + for _, f := range filters { + p, err := f.MarshalBinary() + if err != nil { + return n, err + } + k, err := w.Write(p) + n += k + if err != nil { + return n, err + } + } + return n, nil +} + +/*** Index ***/ + +// record describes a block in the xz file index. +type record struct { + unpaddedSize int64 + uncompressedSize int64 +} + +// readRecord reads an index record. +func readRecord(r io.ByteReader) (rec record, n int, err error) { + u, k, err := readUvarint(r) + n += k + if err != nil { + return rec, n, err + } + rec.unpaddedSize = int64(u) + if rec.unpaddedSize < 0 { + return rec, n, errors.New("xz: unpadded size negative") + } + + u, k, err = readUvarint(r) + n += k + if err != nil { + return rec, n, err + } + rec.uncompressedSize = int64(u) + if rec.uncompressedSize < 0 { + return rec, n, errors.New("xz: uncompressed size negative") + } + + return rec, n, nil +} + +// MarshalBinary converts an index record in its binary encoding. +func (rec *record) MarshalBinary() (data []byte, err error) { + // maximum length of a uvarint is 10 + p := make([]byte, 20) + n := putUvarint(p, uint64(rec.unpaddedSize)) + n += putUvarint(p[n:], uint64(rec.uncompressedSize)) + return p[:n], nil +} + +// writeIndex writes the index, a sequence of records. +func writeIndex(w io.Writer, index []record) (n int64, err error) { + crc := crc32.NewIEEE() + mw := io.MultiWriter(w, crc) + + // index indicator + k, err := mw.Write([]byte{0}) + n += int64(k) + if err != nil { + return n, err + } + + // number of records + p := make([]byte, 10) + k = putUvarint(p, uint64(len(index))) + k, err = mw.Write(p[:k]) + n += int64(k) + if err != nil { + return n, err + } + + // list of records + for _, rec := range index { + p, err := rec.MarshalBinary() + if err != nil { + return n, err + } + k, err = mw.Write(p) + n += int64(k) + if err != nil { + return n, err + } + } + + // index padding + k, err = mw.Write(make([]byte, padLen(int64(n)))) + n += int64(k) + if err != nil { + return n, err + } + + // crc32 checksum + putUint32LE(p, crc.Sum32()) + k, err = w.Write(p[:4]) + n += int64(k) + + return n, err +} + +// readIndexBody reads the index from the reader. It assumes that the +// index indicator has already been read. +func readIndexBody(r io.Reader) (records []record, n int64, err error) { + crc := crc32.NewIEEE() + // index indicator + crc.Write([]byte{0}) + + br := lzma.ByteReader(io.TeeReader(r, crc)) + + // number of records + u, k, err := readUvarint(br) + n += int64(k) + if err != nil { + return nil, n, err + } + recLen := int(u) + if recLen < 0 || uint64(recLen) != u { + return nil, n, errors.New("xz: record number overflow") + } + + // list of records + records = make([]record, recLen) + for i := range records { + records[i], k, err = readRecord(br) + n += int64(k) + if err != nil { + return nil, n, err + } + } + + p := make([]byte, padLen(int64(n+1)), 4) + k, err = io.ReadFull(br.(io.Reader), p) + n += int64(k) + if err != nil { + return nil, n, err + } + if !allZeros(p) { + return nil, n, errors.New("xz: non-zero byte in index padding") + } + + // crc32 + s := crc.Sum32() + p = p[:4] + k, err = io.ReadFull(br.(io.Reader), p) + n += int64(k) + if err != nil { + return records, n, err + } + if uint32LE(p) != s { + return nil, n, errors.New("xz: wrong checksum for index") + } + + return records, n, nil +} diff --git a/vendor/github.com/ulikunitz/xz/fox.xz b/vendor/github.com/ulikunitz/xz/fox.xz new file mode 100644 index 0000000..4b820bd Binary files /dev/null and b/vendor/github.com/ulikunitz/xz/fox.xz differ diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go b/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go new file mode 100644 index 0000000..a328878 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go @@ -0,0 +1,181 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package hash + +// CyclicPoly provides a cyclic polynomial rolling hash. +type CyclicPoly struct { + h uint64 + p []uint64 + i int +} + +// ror rotates the unsigned 64-bit integer to right. The argument s must be +// less than 64. +func ror(x uint64, s uint) uint64 { + return (x >> s) | (x << (64 - s)) +} + +// NewCyclicPoly creates a new instance of the CyclicPoly structure. The +// argument n gives the number of bytes for which a hash will be executed. +// This number must be positive; the method panics if this isn't the case. +func NewCyclicPoly(n int) *CyclicPoly { + if n < 1 { + panic("argument n must be positive") + } + return &CyclicPoly{p: make([]uint64, 0, n)} +} + +// Len returns the length of the byte sequence for which a hash is generated. +func (r *CyclicPoly) Len() int { + return cap(r.p) +} + +// RollByte hashes the next byte and returns a hash value. The complete becomes +// available after at least Len() bytes have been hashed. +func (r *CyclicPoly) RollByte(x byte) uint64 { + y := hash[x] + if len(r.p) < cap(r.p) { + r.h = ror(r.h, 1) ^ y + r.p = append(r.p, y) + } else { + r.h ^= ror(r.p[r.i], uint(cap(r.p)-1)) + r.h = ror(r.h, 1) ^ y + r.p[r.i] = y + r.i = (r.i + 1) % cap(r.p) + } + return r.h +} + +// Stores the hash for the individual bytes. +var hash = [256]uint64{ + 0x2e4fc3f904065142, 0xc790984cfbc99527, + 0x879f95eb8c62f187, 0x3b61be86b5021ef2, + 0x65a896a04196f0a5, 0xc5b307b80470b59e, + 0xd3bff376a70df14b, 0xc332f04f0b3f1701, + 0x753b5f0e9abf3e0d, 0xb41538fdfe66ef53, + 0x1906a10c2c1c0208, 0xfb0c712a03421c0d, + 0x38be311a65c9552b, 0xfee7ee4ca6445c7e, + 0x71aadeded184f21e, 0xd73426fccda23b2d, + 0x29773fb5fb9600b5, 0xce410261cd32981a, + 0xfe2848b3c62dbc2d, 0x459eaaff6e43e11c, + 0xc13e35fc9c73a887, 0xf30ed5c201e76dbc, + 0xa5f10b3910482cea, 0x2945d59be02dfaad, + 0x06ee334ff70571b5, 0xbabf9d8070f44380, + 0xee3e2e9912ffd27c, 0x2a7118d1ea6b8ea7, + 0x26183cb9f7b1664c, 0xea71dac7da068f21, + 0xea92eca5bd1d0bb7, 0x415595862defcd75, + 0x248a386023c60648, 0x9cf021ab284b3c8a, + 0xfc9372df02870f6c, 0x2b92d693eeb3b3fc, + 0x73e799d139dc6975, 0x7b15ae312486363c, + 0xb70e5454a2239c80, 0x208e3fb31d3b2263, + 0x01f563cabb930f44, 0x2ac4533d2a3240d8, + 0x84231ed1064f6f7c, 0xa9f020977c2a6d19, + 0x213c227271c20122, 0x09fe8a9a0a03d07a, + 0x4236dc75bcaf910c, 0x460a8b2bead8f17e, + 0xd9b27be1aa07055f, 0xd202d5dc4b11c33e, + 0x70adb010543bea12, 0xcdae938f7ea6f579, + 0x3f3d870208672f4d, 0x8e6ccbce9d349536, + 0xe4c0871a389095ae, 0xf5f2a49152bca080, + 0x9a43f9b97269934e, 0xc17b3753cb6f475c, + 0xd56d941e8e206bd4, 0xac0a4f3e525eda00, + 0xa06d5a011912a550, 0x5537ed19537ad1df, + 0xa32fe713d611449d, 0x2a1d05b47c3b579f, + 0x991d02dbd30a2a52, 0x39e91e7e28f93eb0, + 0x40d06adb3e92c9ac, 0x9b9d3afde1c77c97, + 0x9a3f3f41c02c616f, 0x22ecd4ba00f60c44, + 0x0b63d5d801708420, 0x8f227ca8f37ffaec, + 0x0256278670887c24, 0x107e14877dbf540b, + 0x32c19f2786ac1c05, 0x1df5b12bb4bc9c61, + 0xc0cac129d0d4c4e2, 0x9fdb52ee9800b001, + 0x31f601d5d31c48c4, 0x72ff3c0928bcaec7, + 0xd99264421147eb03, 0x535a2d6d38aefcfe, + 0x6ba8b4454a916237, 0xfa39366eaae4719c, + 0x10f00fd7bbb24b6f, 0x5bd23185c76c84d4, + 0xb22c3d7e1b00d33f, 0x3efc20aa6bc830a8, + 0xd61c2503fe639144, 0x30ce625441eb92d3, + 0xe5d34cf359e93100, 0xa8e5aa13f2b9f7a5, + 0x5c2b8d851ca254a6, 0x68fb6c5e8b0d5fdf, + 0xc7ea4872c96b83ae, 0x6dd5d376f4392382, + 0x1be88681aaa9792f, 0xfef465ee1b6c10d9, + 0x1f98b65ed43fcb2e, 0x4d1ca11eb6e9a9c9, + 0x7808e902b3857d0b, 0x171c9c4ea4607972, + 0x58d66274850146df, 0x42b311c10d3981d1, + 0x647fa8c621c41a4c, 0xf472771c66ddfedc, + 0x338d27e3f847b46b, 0x6402ce3da97545ce, + 0x5162db616fc38638, 0x9c83be97bc22a50e, + 0x2d3d7478a78d5e72, 0xe621a9b938fd5397, + 0x9454614eb0f81c45, 0x395fb6e742ed39b6, + 0x77dd9179d06037bf, 0xc478d0fee4d2656d, + 0x35d9d6cb772007af, 0x83a56e92c883f0f6, + 0x27937453250c00a1, 0x27bd6ebc3a46a97d, + 0x9f543bf784342d51, 0xd158f38c48b0ed52, + 0x8dd8537c045f66b4, 0x846a57230226f6d5, + 0x6b13939e0c4e7cdf, 0xfca25425d8176758, + 0x92e5fc6cd52788e6, 0x9992e13d7a739170, + 0x518246f7a199e8ea, 0xf104c2a71b9979c7, + 0x86b3ffaabea4768f, 0x6388061cf3e351ad, + 0x09d9b5295de5bbb5, 0x38bf1638c2599e92, + 0x1d759846499e148d, 0x4c0ff015e5f96ef4, + 0xa41a94cfa270f565, 0x42d76f9cb2326c0b, + 0x0cf385dd3c9c23ba, 0x0508a6c7508d6e7a, + 0x337523aabbe6cf8d, 0x646bb14001d42b12, + 0xc178729d138adc74, 0xf900ef4491f24086, + 0xee1a90d334bb5ac4, 0x9755c92247301a50, + 0xb999bf7c4ff1b610, 0x6aeeb2f3b21e8fc9, + 0x0fa8084cf91ac6ff, 0x10d226cf136e6189, + 0xd302057a07d4fb21, 0x5f03800e20a0fcc3, + 0x80118d4ae46bd210, 0x58ab61a522843733, + 0x51edd575c5432a4b, 0x94ee6ff67f9197f7, + 0x765669e0e5e8157b, 0xa5347830737132f0, + 0x3ba485a69f01510c, 0x0b247d7b957a01c3, + 0x1b3d63449fd807dc, 0x0fdc4721c30ad743, + 0x8b535ed3829b2b14, 0xee41d0cad65d232c, + 0xe6a99ed97a6a982f, 0x65ac6194c202003d, + 0x692accf3a70573eb, 0xcc3c02c3e200d5af, + 0x0d419e8b325914a3, 0x320f160f42c25e40, + 0x00710d647a51fe7a, 0x3c947692330aed60, + 0x9288aa280d355a7a, 0xa1806a9b791d1696, + 0x5d60e38496763da1, 0x6c69e22e613fd0f4, + 0x977fc2a5aadffb17, 0xfb7bd063fc5a94ba, + 0x460c17992cbaece1, 0xf7822c5444d3297f, + 0x344a9790c69b74aa, 0xb80a42e6cae09dce, + 0x1b1361eaf2b1e757, 0xd84c1e758e236f01, + 0x88e0b7be347627cc, 0x45246009b7a99490, + 0x8011c6dd3fe50472, 0xc341d682bffb99d7, + 0x2511be93808e2d15, 0xd5bc13d7fd739840, + 0x2a3cd030679ae1ec, 0x8ad9898a4b9ee157, + 0x3245fef0a8eaf521, 0x3d6d8dbbb427d2b0, + 0x1ed146d8968b3981, 0x0c6a28bf7d45f3fc, + 0x4a1fd3dbcee3c561, 0x4210ff6a476bf67e, + 0xa559cce0d9199aac, 0xde39d47ef3723380, + 0xe5b69d848ce42e35, 0xefa24296f8e79f52, + 0x70190b59db9a5afc, 0x26f166cdb211e7bf, + 0x4deaf2df3c6b8ef5, 0xf171dbdd670f1017, + 0xb9059b05e9420d90, 0x2f0da855c9388754, + 0x611d5e9ab77949cc, 0x2912038ac01163f4, + 0x0231df50402b2fba, 0x45660fc4f3245f58, + 0xb91cc97c7c8dac50, 0xb72d2aafe4953427, + 0xfa6463f87e813d6b, 0x4515f7ee95d5c6a2, + 0x1310e1c1a48d21c3, 0xad48a7810cdd8544, + 0x4d5bdfefd5c9e631, 0xa43ed43f1fdcb7de, + 0xe70cfc8fe1ee9626, 0xef4711b0d8dda442, + 0xb80dd9bd4dab6c93, 0xa23be08d31ba4d93, + 0x9b37db9d0335a39c, 0x494b6f870f5cfebc, + 0x6d1b3c1149dda943, 0x372c943a518c1093, + 0xad27af45e77c09c4, 0x3b6f92b646044604, + 0xac2917909f5fcf4f, 0x2069a60e977e5557, + 0x353a469e71014de5, 0x24be356281f55c15, + 0x2b6d710ba8e9adea, 0x404ad1751c749c29, + 0xed7311bf23d7f185, 0xba4f6976b4acc43e, + 0x32d7198d2bc39000, 0xee667019014d6e01, + 0x494ef3e128d14c83, 0x1f95a152baecd6be, + 0x201648dff1f483a5, 0x68c28550c8384af6, + 0x5fc834a6824a7f48, 0x7cd06cb7365eaf28, + 0xd82bbd95e9b30909, 0x234f0d1694c53f6d, + 0xd2fb7f4a96d83f4a, 0xff0d5da83acac05e, + 0xf8f6b97f5585080a, 0x74236084be57b95b, + 0xa25e40c03bbc36ad, 0x6b6e5c14ce88465b, + 0x4378ffe93e1528c5, 0x94ca92a17118e2d2, +} diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/doc.go b/vendor/github.com/ulikunitz/xz/internal/hash/doc.go new file mode 100644 index 0000000..f99ec22 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/internal/hash/doc.go @@ -0,0 +1,14 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package hash provides rolling hashes. + +Rolling hashes have to be used for maintaining the positions of n-byte +sequences in the dictionary buffer. + +The package provides currently the Rabin-Karp rolling hash and a Cyclic +Polynomial hash. Both support the Hashes method to be used with an interface. +*/ +package hash diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go b/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go new file mode 100644 index 0000000..58635b1 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go @@ -0,0 +1,66 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package hash + +// A is the default constant for Robin-Karp rolling hash. This is a random +// prime. +const A = 0x97b548add41d5da1 + +// RabinKarp supports the computation of a rolling hash. +type RabinKarp struct { + A uint64 + // a^n + aOldest uint64 + h uint64 + p []byte + i int +} + +// NewRabinKarp creates a new RabinKarp value. The argument n defines the +// length of the byte sequence to be hashed. The default constant will will be +// used. +func NewRabinKarp(n int) *RabinKarp { + return NewRabinKarpConst(n, A) +} + +// NewRabinKarpConst creates a new RabinKarp value. The argument n defines the +// length of the byte sequence to be hashed. The argument a provides the +// constant used to compute the hash. +func NewRabinKarpConst(n int, a uint64) *RabinKarp { + if n <= 0 { + panic("number of bytes n must be positive") + } + aOldest := uint64(1) + // There are faster methods. For the small n required by the LZMA + // compressor O(n) is sufficient. + for i := 0; i < n; i++ { + aOldest *= a + } + return &RabinKarp{ + A: a, aOldest: aOldest, + p: make([]byte, 0, n), + } +} + +// Len returns the length of the byte sequence. +func (r *RabinKarp) Len() int { + return cap(r.p) +} + +// RollByte computes the hash after x has been added. +func (r *RabinKarp) RollByte(x byte) uint64 { + if len(r.p) < cap(r.p) { + r.h += uint64(x) + r.h *= r.A + r.p = append(r.p, x) + } else { + r.h -= uint64(r.p[r.i]) * r.aOldest + r.h += uint64(x) + r.h *= r.A + r.p[r.i] = x + r.i = (r.i + 1) % cap(r.p) + } + return r.h +} diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/roller.go b/vendor/github.com/ulikunitz/xz/internal/hash/roller.go new file mode 100644 index 0000000..ab6a19c --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/internal/hash/roller.go @@ -0,0 +1,29 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package hash + +// Roller provides an interface for rolling hashes. The hash value will become +// valid after hash has been called Len times. +type Roller interface { + Len() int + RollByte(x byte) uint64 +} + +// Hashes computes all hash values for the array p. Note that the state of the +// roller is changed. +func Hashes(r Roller, p []byte) []uint64 { + n := r.Len() + if len(p) < n { + return nil + } + h := make([]uint64, len(p)-n+1) + for i := 0; i < n-1; i++ { + r.RollByte(p[i]) + } + for i := range h { + h[i] = r.RollByte(p[i+n-1]) + } + return h +} diff --git a/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go b/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go new file mode 100644 index 0000000..0ba45e8 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go @@ -0,0 +1,457 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package xlog provides a simple logging package that allows to disable +// certain message categories. It defines a type, Logger, with multiple +// methods for formatting output. The package has also a predefined +// 'standard' Logger accessible through helper function Print[f|ln], +// Fatal[f|ln], Panic[f|ln], Warn[f|ln], Print[f|ln] and Debug[f|ln] +// that are easier to use then creating a Logger manually. That logger +// writes to standard error and prints the date and time of each logged +// message, which can be configured using the function SetFlags. +// +// The Fatal functions call os.Exit(1) after the message is output +// unless not suppressed by the flags. The Panic functions call panic +// after the writing the log message unless suppressed. +package xlog + +import ( + "fmt" + "io" + "os" + "runtime" + "sync" + "time" +) + +// The flags define what information is prefixed to each log entry +// generated by the Logger. The Lno* versions allow the suppression of +// specific output. The bits are or'ed together to control what will be +// printed. There is no control over the order of the items printed and +// the format. The full format is: +// +// 2009-01-23 01:23:23.123123 /a/b/c/d.go:23: message +// +const ( + Ldate = 1 << iota // the date: 2009-01-23 + Ltime // the time: 01:23:23 + Lmicroseconds // microsecond resolution: 01:23:23.123123 + Llongfile // full file name and line number: /a/b/c/d.go:23 + Lshortfile // final file name element and line number: d.go:23 + Lnopanic // suppresses output from Panic[f|ln] but not the panic call + Lnofatal // suppresses output from Fatal[f|ln] but not the exit + Lnowarn // suppresses output from Warn[f|ln] + Lnoprint // suppresses output from Print[f|ln] + Lnodebug // suppresses output from Debug[f|ln] + // initial values for the standard logger + Lstdflags = Ldate | Ltime | Lnodebug +) + +// A Logger represents an active logging object that generates lines of +// output to an io.Writer. Each logging operation if not suppressed +// makes a single call to the Writer's Write method. A Logger can be +// used simultaneously from multiple goroutines; it guarantees to +// serialize access to the Writer. +type Logger struct { + mu sync.Mutex // ensures atomic writes; and protects the following + // fields + prefix string // prefix to write at beginning of each line + flag int // properties + out io.Writer // destination for output + buf []byte // for accumulating text to write +} + +// New creates a new Logger. The out argument sets the destination to +// which the log output will be written. The prefix appears at the +// beginning of each log line. The flag argument defines the logging +// properties. +func New(out io.Writer, prefix string, flag int) *Logger { + return &Logger{out: out, prefix: prefix, flag: flag} +} + +// std is the standard logger used by the package scope functions. +var std = New(os.Stderr, "", Lstdflags) + +// itoa converts the integer to ASCII. A negative widths will avoid +// zero-padding. The function supports only non-negative integers. +func itoa(buf *[]byte, i int, wid int) { + var u = uint(i) + if u == 0 && wid <= 1 { + *buf = append(*buf, '0') + return + } + var b [32]byte + bp := len(b) + for ; u > 0 || wid > 0; u /= 10 { + bp-- + wid-- + b[bp] = byte(u%10) + '0' + } + *buf = append(*buf, b[bp:]...) +} + +// formatHeader puts the header into the buf field of the buffer. +func (l *Logger) formatHeader(t time.Time, file string, line int) { + l.buf = append(l.buf, l.prefix...) + if l.flag&(Ldate|Ltime|Lmicroseconds) != 0 { + if l.flag&Ldate != 0 { + year, month, day := t.Date() + itoa(&l.buf, year, 4) + l.buf = append(l.buf, '-') + itoa(&l.buf, int(month), 2) + l.buf = append(l.buf, '-') + itoa(&l.buf, day, 2) + l.buf = append(l.buf, ' ') + } + if l.flag&(Ltime|Lmicroseconds) != 0 { + hour, min, sec := t.Clock() + itoa(&l.buf, hour, 2) + l.buf = append(l.buf, ':') + itoa(&l.buf, min, 2) + l.buf = append(l.buf, ':') + itoa(&l.buf, sec, 2) + if l.flag&Lmicroseconds != 0 { + l.buf = append(l.buf, '.') + itoa(&l.buf, t.Nanosecond()/1e3, 6) + } + l.buf = append(l.buf, ' ') + } + } + if l.flag&(Lshortfile|Llongfile) != 0 { + if l.flag&Lshortfile != 0 { + short := file + for i := len(file) - 1; i > 0; i-- { + if file[i] == '/' { + short = file[i+1:] + break + } + } + file = short + } + l.buf = append(l.buf, file...) + l.buf = append(l.buf, ':') + itoa(&l.buf, line, -1) + l.buf = append(l.buf, ": "...) + } +} + +func (l *Logger) output(calldepth int, now time.Time, s string) error { + var file string + var line int + if l.flag&(Lshortfile|Llongfile) != 0 { + l.mu.Unlock() + var ok bool + _, file, line, ok = runtime.Caller(calldepth) + if !ok { + file = "???" + line = 0 + } + l.mu.Lock() + } + l.buf = l.buf[:0] + l.formatHeader(now, file, line) + l.buf = append(l.buf, s...) + if len(s) == 0 || s[len(s)-1] != '\n' { + l.buf = append(l.buf, '\n') + } + _, err := l.out.Write(l.buf) + return err +} + +// Output writes the string s with the header controlled by the flags to +// the l.out writer. A newline will be appended if s doesn't end in a +// newline. Calldepth is used to recover the PC, although all current +// calls of Output use the call depth 2. Access to the function is serialized. +func (l *Logger) Output(calldepth, noflag int, v ...interface{}) error { + now := time.Now() + l.mu.Lock() + defer l.mu.Unlock() + if l.flag&noflag != 0 { + return nil + } + s := fmt.Sprint(v...) + return l.output(calldepth+1, now, s) +} + +// Outputf works like output but formats the output like Printf. +func (l *Logger) Outputf(calldepth int, noflag int, format string, v ...interface{}) error { + now := time.Now() + l.mu.Lock() + defer l.mu.Unlock() + if l.flag&noflag != 0 { + return nil + } + s := fmt.Sprintf(format, v...) + return l.output(calldepth+1, now, s) +} + +// Outputln works like output but formats the output like Println. +func (l *Logger) Outputln(calldepth int, noflag int, v ...interface{}) error { + now := time.Now() + l.mu.Lock() + defer l.mu.Unlock() + if l.flag&noflag != 0 { + return nil + } + s := fmt.Sprintln(v...) + return l.output(calldepth+1, now, s) +} + +// Panic prints the message like Print and calls panic. The printing +// might be suppressed by the flag Lnopanic. +func (l *Logger) Panic(v ...interface{}) { + l.Output(2, Lnopanic, v...) + s := fmt.Sprint(v...) + panic(s) +} + +// Panic prints the message like Print and calls panic. The printing +// might be suppressed by the flag Lnopanic. +func Panic(v ...interface{}) { + std.Output(2, Lnopanic, v...) + s := fmt.Sprint(v...) + panic(s) +} + +// Panicf prints the message like Printf and calls panic. The printing +// might be suppressed by the flag Lnopanic. +func (l *Logger) Panicf(format string, v ...interface{}) { + l.Outputf(2, Lnopanic, format, v...) + s := fmt.Sprintf(format, v...) + panic(s) +} + +// Panicf prints the message like Printf and calls panic. The printing +// might be suppressed by the flag Lnopanic. +func Panicf(format string, v ...interface{}) { + std.Outputf(2, Lnopanic, format, v...) + s := fmt.Sprintf(format, v...) + panic(s) +} + +// Panicln prints the message like Println and calls panic. The printing +// might be suppressed by the flag Lnopanic. +func (l *Logger) Panicln(v ...interface{}) { + l.Outputln(2, Lnopanic, v...) + s := fmt.Sprintln(v...) + panic(s) +} + +// Panicln prints the message like Println and calls panic. The printing +// might be suppressed by the flag Lnopanic. +func Panicln(v ...interface{}) { + std.Outputln(2, Lnopanic, v...) + s := fmt.Sprintln(v...) + panic(s) +} + +// Fatal prints the message like Print and calls os.Exit(1). The +// printing might be suppressed by the flag Lnofatal. +func (l *Logger) Fatal(v ...interface{}) { + l.Output(2, Lnofatal, v...) + os.Exit(1) +} + +// Fatal prints the message like Print and calls os.Exit(1). The +// printing might be suppressed by the flag Lnofatal. +func Fatal(v ...interface{}) { + std.Output(2, Lnofatal, v...) + os.Exit(1) +} + +// Fatalf prints the message like Printf and calls os.Exit(1). The +// printing might be suppressed by the flag Lnofatal. +func (l *Logger) Fatalf(format string, v ...interface{}) { + l.Outputf(2, Lnofatal, format, v...) + os.Exit(1) +} + +// Fatalf prints the message like Printf and calls os.Exit(1). The +// printing might be suppressed by the flag Lnofatal. +func Fatalf(format string, v ...interface{}) { + std.Outputf(2, Lnofatal, format, v...) + os.Exit(1) +} + +// Fatalln prints the message like Println and calls os.Exit(1). The +// printing might be suppressed by the flag Lnofatal. +func (l *Logger) Fatalln(format string, v ...interface{}) { + l.Outputln(2, Lnofatal, v...) + os.Exit(1) +} + +// Fatalln prints the message like Println and calls os.Exit(1). The +// printing might be suppressed by the flag Lnofatal. +func Fatalln(format string, v ...interface{}) { + std.Outputln(2, Lnofatal, v...) + os.Exit(1) +} + +// Warn prints the message like Print. The printing might be suppressed +// by the flag Lnowarn. +func (l *Logger) Warn(v ...interface{}) { + l.Output(2, Lnowarn, v...) +} + +// Warn prints the message like Print. The printing might be suppressed +// by the flag Lnowarn. +func Warn(v ...interface{}) { + std.Output(2, Lnowarn, v...) +} + +// Warnf prints the message like Printf. The printing might be suppressed +// by the flag Lnowarn. +func (l *Logger) Warnf(format string, v ...interface{}) { + l.Outputf(2, Lnowarn, format, v...) +} + +// Warnf prints the message like Printf. The printing might be suppressed +// by the flag Lnowarn. +func Warnf(format string, v ...interface{}) { + std.Outputf(2, Lnowarn, format, v...) +} + +// Warnln prints the message like Println. The printing might be suppressed +// by the flag Lnowarn. +func (l *Logger) Warnln(v ...interface{}) { + l.Outputln(2, Lnowarn, v...) +} + +// Warnln prints the message like Println. The printing might be suppressed +// by the flag Lnowarn. +func Warnln(v ...interface{}) { + std.Outputln(2, Lnowarn, v...) +} + +// Print prints the message like fmt.Print. The printing might be suppressed +// by the flag Lnoprint. +func (l *Logger) Print(v ...interface{}) { + l.Output(2, Lnoprint, v...) +} + +// Print prints the message like fmt.Print. The printing might be suppressed +// by the flag Lnoprint. +func Print(v ...interface{}) { + std.Output(2, Lnoprint, v...) +} + +// Printf prints the message like fmt.Printf. The printing might be suppressed +// by the flag Lnoprint. +func (l *Logger) Printf(format string, v ...interface{}) { + l.Outputf(2, Lnoprint, format, v...) +} + +// Printf prints the message like fmt.Printf. The printing might be suppressed +// by the flag Lnoprint. +func Printf(format string, v ...interface{}) { + std.Outputf(2, Lnoprint, format, v...) +} + +// Println prints the message like fmt.Println. The printing might be +// suppressed by the flag Lnoprint. +func (l *Logger) Println(v ...interface{}) { + l.Outputln(2, Lnoprint, v...) +} + +// Println prints the message like fmt.Println. The printing might be +// suppressed by the flag Lnoprint. +func Println(v ...interface{}) { + std.Outputln(2, Lnoprint, v...) +} + +// Debug prints the message like Print. The printing might be suppressed +// by the flag Lnodebug. +func (l *Logger) Debug(v ...interface{}) { + l.Output(2, Lnodebug, v...) +} + +// Debug prints the message like Print. The printing might be suppressed +// by the flag Lnodebug. +func Debug(v ...interface{}) { + std.Output(2, Lnodebug, v...) +} + +// Debugf prints the message like Printf. The printing might be suppressed +// by the flag Lnodebug. +func (l *Logger) Debugf(format string, v ...interface{}) { + l.Outputf(2, Lnodebug, format, v...) +} + +// Debugf prints the message like Printf. The printing might be suppressed +// by the flag Lnodebug. +func Debugf(format string, v ...interface{}) { + std.Outputf(2, Lnodebug, format, v...) +} + +// Debugln prints the message like Println. The printing might be suppressed +// by the flag Lnodebug. +func (l *Logger) Debugln(v ...interface{}) { + l.Outputln(2, Lnodebug, v...) +} + +// Debugln prints the message like Println. The printing might be suppressed +// by the flag Lnodebug. +func Debugln(v ...interface{}) { + std.Outputln(2, Lnodebug, v...) +} + +// Flags returns the current flags used by the logger. +func (l *Logger) Flags() int { + l.mu.Lock() + defer l.mu.Unlock() + return l.flag +} + +// Flags returns the current flags used by the standard logger. +func Flags() int { + return std.Flags() +} + +// SetFlags sets the flags of the logger. +func (l *Logger) SetFlags(flag int) { + l.mu.Lock() + defer l.mu.Unlock() + l.flag = flag +} + +// SetFlags sets the flags for the standard logger. +func SetFlags(flag int) { + std.SetFlags(flag) +} + +// Prefix returns the prefix used by the logger. +func (l *Logger) Prefix() string { + l.mu.Lock() + defer l.mu.Unlock() + return l.prefix +} + +// Prefix returns the prefix used by the standard logger of the package. +func Prefix() string { + return std.Prefix() +} + +// SetPrefix sets the prefix for the logger. +func (l *Logger) SetPrefix(prefix string) { + l.mu.Lock() + defer l.mu.Unlock() + l.prefix = prefix +} + +// SetPrefix sets the prefix of the standard logger of the package. +func SetPrefix(prefix string) { + std.SetPrefix(prefix) +} + +// SetOutput sets the output of the logger. +func (l *Logger) SetOutput(w io.Writer) { + l.mu.Lock() + defer l.mu.Unlock() + l.out = w +} + +// SetOutput sets the output for the standard logger of the package. +func SetOutput(w io.Writer) { + std.SetOutput(w) +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/bintree.go b/vendor/github.com/ulikunitz/xz/lzma/bintree.go new file mode 100644 index 0000000..a781bd1 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/bintree.go @@ -0,0 +1,523 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "bufio" + "errors" + "fmt" + "io" + "unicode" +) + +// node represents a node in the binary tree. +type node struct { + // x is the search value + x uint32 + // p parent node + p uint32 + // l left child + l uint32 + // r right child + r uint32 +} + +// wordLen is the number of bytes represented by the v field of a node. +const wordLen = 4 + +// binTree supports the identification of the next operation based on a +// binary tree. +// +// Nodes will be identified by their index into the ring buffer. +type binTree struct { + dict *encoderDict + // ring buffer of nodes + node []node + // absolute offset of the entry for the next node. Position 4 + // byte larger. + hoff int64 + // front position in the node ring buffer + front uint32 + // index of the root node + root uint32 + // current x value + x uint32 + // preallocated array + data []byte +} + +// null represents the nonexistent index. We can't use zero because it +// would always exist or we would need to decrease the index for each +// reference. +const null uint32 = 1<<32 - 1 + +// newBinTree initializes the binTree structure. The capacity defines +// the size of the buffer and defines the maximum distance for which +// matches will be found. +func newBinTree(capacity int) (t *binTree, err error) { + if capacity < 1 { + return nil, errors.New( + "newBinTree: capacity must be larger than zero") + } + if int64(capacity) >= int64(null) { + return nil, errors.New( + "newBinTree: capacity must less 2^{32}-1") + } + t = &binTree{ + node: make([]node, capacity), + hoff: -int64(wordLen), + root: null, + data: make([]byte, maxMatchLen), + } + return t, nil +} + +func (t *binTree) SetDict(d *encoderDict) { t.dict = d } + +// WriteByte writes a single byte into the binary tree. +func (t *binTree) WriteByte(c byte) error { + t.x = (t.x << 8) | uint32(c) + t.hoff++ + if t.hoff < 0 { + return nil + } + v := t.front + if int64(v) < t.hoff { + // We are overwriting old nodes stored in the tree. + t.remove(v) + } + t.node[v].x = t.x + t.add(v) + t.front++ + if int64(t.front) >= int64(len(t.node)) { + t.front = 0 + } + return nil +} + +// Writes writes a sequence of bytes into the binTree structure. +func (t *binTree) Write(p []byte) (n int, err error) { + for _, c := range p { + t.WriteByte(c) + } + return len(p), nil +} + +// add puts the node v into the tree. The node must not be part of the +// tree before. +func (t *binTree) add(v uint32) { + vn := &t.node[v] + // Set left and right to null indices. + vn.l, vn.r = null, null + // If the binary tree is empty make v the root. + if t.root == null { + t.root = v + vn.p = null + return + } + x := vn.x + p := t.root + // Search for the right leave link and add the new node. + for { + pn := &t.node[p] + if x <= pn.x { + if pn.l == null { + pn.l = v + vn.p = p + return + } + p = pn.l + } else { + if pn.r == null { + pn.r = v + vn.p = p + return + } + p = pn.r + } + } +} + +// parent returns the parent node index of v and the pointer to v value +// in the parent. +func (t *binTree) parent(v uint32) (p uint32, ptr *uint32) { + if t.root == v { + return null, &t.root + } + p = t.node[v].p + if t.node[p].l == v { + ptr = &t.node[p].l + } else { + ptr = &t.node[p].r + } + return +} + +// Remove node v. +func (t *binTree) remove(v uint32) { + vn := &t.node[v] + p, ptr := t.parent(v) + l, r := vn.l, vn.r + if l == null { + // Move the right child up. + *ptr = r + if r != null { + t.node[r].p = p + } + return + } + if r == null { + // Move the left child up. + *ptr = l + t.node[l].p = p + return + } + + // Search the in-order predecessor u. + un := &t.node[l] + ur := un.r + if ur == null { + // In order predecessor is l. Move it up. + un.r = r + t.node[r].p = l + un.p = p + *ptr = l + return + } + var u uint32 + for { + // Look for the max value in the tree where l is root. + u = ur + ur = t.node[u].r + if ur == null { + break + } + } + // replace u with ul + un = &t.node[u] + ul := un.l + up := un.p + t.node[up].r = ul + if ul != null { + t.node[ul].p = up + } + + // replace v by u + un.l, un.r = l, r + t.node[l].p = u + t.node[r].p = u + *ptr = u + un.p = p +} + +// search looks for the node that have the value x or for the nodes that +// brace it. The node highest in the tree with the value x will be +// returned. All other nodes with the same value live in left subtree of +// the returned node. +func (t *binTree) search(v uint32, x uint32) (a, b uint32) { + a, b = null, null + if v == null { + return + } + for { + vn := &t.node[v] + if x <= vn.x { + if x == vn.x { + return v, v + } + b = v + if vn.l == null { + return + } + v = vn.l + } else { + a = v + if vn.r == null { + return + } + v = vn.r + } + } +} + +// max returns the node with maximum value in the subtree with v as +// root. +func (t *binTree) max(v uint32) uint32 { + if v == null { + return null + } + for { + r := t.node[v].r + if r == null { + return v + } + v = r + } +} + +// min returns the node with the minimum value in the subtree with v as +// root. +func (t *binTree) min(v uint32) uint32 { + if v == null { + return null + } + for { + l := t.node[v].l + if l == null { + return v + } + v = l + } +} + +// pred returns the in-order predecessor of node v. +func (t *binTree) pred(v uint32) uint32 { + if v == null { + return null + } + u := t.max(t.node[v].l) + if u != null { + return u + } + for { + p := t.node[v].p + if p == null { + return null + } + if t.node[p].r == v { + return p + } + v = p + } +} + +// succ returns the in-order successor of node v. +func (t *binTree) succ(v uint32) uint32 { + if v == null { + return null + } + u := t.min(t.node[v].r) + if u != null { + return u + } + for { + p := t.node[v].p + if p == null { + return null + } + if t.node[p].l == v { + return p + } + v = p + } +} + +// xval converts the first four bytes of a into an 32-bit unsigned +// integer in big-endian order. +func xval(a []byte) uint32 { + var x uint32 + switch len(a) { + default: + x |= uint32(a[3]) + fallthrough + case 3: + x |= uint32(a[2]) << 8 + fallthrough + case 2: + x |= uint32(a[1]) << 16 + fallthrough + case 1: + x |= uint32(a[0]) << 24 + case 0: + } + return x +} + +// dumpX converts value x into a four-letter string. +func dumpX(x uint32) string { + a := make([]byte, 4) + for i := 0; i < 4; i++ { + c := byte(x >> uint((3-i)*8)) + if unicode.IsGraphic(rune(c)) { + a[i] = c + } else { + a[i] = '.' + } + } + return string(a) +} + +// dumpNode writes a representation of the node v into the io.Writer. +func (t *binTree) dumpNode(w io.Writer, v uint32, indent int) { + if v == null { + return + } + + vn := &t.node[v] + + t.dumpNode(w, vn.r, indent+2) + + for i := 0; i < indent; i++ { + fmt.Fprint(w, " ") + } + if vn.p == null { + fmt.Fprintf(w, "node %d %q parent null\n", v, dumpX(vn.x)) + } else { + fmt.Fprintf(w, "node %d %q parent %d\n", v, dumpX(vn.x), vn.p) + } + + t.dumpNode(w, vn.l, indent+2) +} + +// dump prints a representation of the binary tree into the writer. +func (t *binTree) dump(w io.Writer) error { + bw := bufio.NewWriter(w) + t.dumpNode(bw, t.root, 0) + return bw.Flush() +} + +func (t *binTree) distance(v uint32) int { + dist := int(t.front) - int(v) + if dist <= 0 { + dist += len(t.node) + } + return dist +} + +type matchParams struct { + rep [4]uint32 + // length when match will be accepted + nAccept int + // nodes to check + check int + // finish if length get shorter + stopShorter bool +} + +func (t *binTree) match(m match, distIter func() (int, bool), p matchParams, +) (r match, checked int, accepted bool) { + buf := &t.dict.buf + for { + if checked >= p.check { + return m, checked, true + } + dist, ok := distIter() + if !ok { + return m, checked, false + } + checked++ + if m.n > 0 { + i := buf.rear - dist + m.n - 1 + if i < 0 { + i += len(buf.data) + } else if i >= len(buf.data) { + i -= len(buf.data) + } + if buf.data[i] != t.data[m.n-1] { + if p.stopShorter { + return m, checked, false + } + continue + } + } + n := buf.matchLen(dist, t.data) + switch n { + case 0: + if p.stopShorter { + return m, checked, false + } + continue + case 1: + if uint32(dist-minDistance) != p.rep[0] { + continue + } + } + if n < m.n || (n == m.n && int64(dist) >= m.distance) { + continue + } + m = match{int64(dist), n} + if n >= p.nAccept { + return m, checked, true + } + } +} + +func (t *binTree) NextOp(rep [4]uint32) operation { + // retrieve maxMatchLen data + n, _ := t.dict.buf.Peek(t.data[:maxMatchLen]) + if n == 0 { + panic("no data in buffer") + } + t.data = t.data[:n] + + var ( + m match + x, u, v uint32 + iterPred, iterSucc func() (int, bool) + ) + p := matchParams{ + rep: rep, + nAccept: maxMatchLen, + check: 32, + } + i := 4 + iterSmall := func() (dist int, ok bool) { + i-- + if i <= 0 { + return 0, false + } + return i, true + } + m, checked, accepted := t.match(m, iterSmall, p) + if accepted { + goto end + } + p.check -= checked + x = xval(t.data) + u, v = t.search(t.root, x) + if u == v && len(t.data) == 4 { + iter := func() (dist int, ok bool) { + if u == null { + return 0, false + } + dist = t.distance(u) + u, v = t.search(t.node[u].l, x) + if u != v { + u = null + } + return dist, true + } + m, _, _ = t.match(m, iter, p) + goto end + } + p.stopShorter = true + iterSucc = func() (dist int, ok bool) { + if v == null { + return 0, false + } + dist = t.distance(v) + v = t.succ(v) + return dist, true + } + m, checked, accepted = t.match(m, iterSucc, p) + if accepted { + goto end + } + p.check -= checked + iterPred = func() (dist int, ok bool) { + if u == null { + return 0, false + } + dist = t.distance(u) + u = t.pred(u) + return dist, true + } + m, _, _ = t.match(m, iterPred, p) +end: + if m.n == 0 { + return lit{t.data[0]} + } + return m +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/bitops.go b/vendor/github.com/ulikunitz/xz/lzma/bitops.go new file mode 100644 index 0000000..e9bab01 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/bitops.go @@ -0,0 +1,45 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +/* Naming conventions follows the CodeReviewComments in the Go Wiki. */ + +// ntz32Const is used by the functions NTZ and NLZ. +const ntz32Const = 0x04d7651f + +// ntz32Table is a helper table for de Bruijn algorithm by Danny Dubé. +// See Henry S. Warren, Jr. "Hacker's Delight" section 5-1 figure 5-26. +var ntz32Table = [32]int8{ + 0, 1, 2, 24, 3, 19, 6, 25, + 22, 4, 20, 10, 16, 7, 12, 26, + 31, 23, 18, 5, 21, 9, 15, 11, + 30, 17, 8, 14, 29, 13, 28, 27, +} + +// ntz32 computes the number of trailing zeros for an unsigned 32-bit integer. +func ntz32(x uint32) int { + if x == 0 { + return 32 + } + x = (x & -x) * ntz32Const + return int(ntz32Table[x>>27]) +} + +// nlz32 computes the number of leading zeros for an unsigned 32-bit integer. +func nlz32(x uint32) int { + // Smear left most bit to the right + x |= x >> 1 + x |= x >> 2 + x |= x >> 4 + x |= x >> 8 + x |= x >> 16 + // Use ntz mechanism to calculate nlz. + x++ + if x == 0 { + return 0 + } + x *= ntz32Const + return 32 - int(ntz32Table[x>>27]) +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/breader.go b/vendor/github.com/ulikunitz/xz/lzma/breader.go new file mode 100644 index 0000000..5350d81 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/breader.go @@ -0,0 +1,39 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "io" +) + +// breader provides the ReadByte function for a Reader. It doesn't read +// more data from the reader than absolutely necessary. +type breader struct { + io.Reader + // helper slice to save allocations + p []byte +} + +// ByteReader converts an io.Reader into an io.ByteReader. +func ByteReader(r io.Reader) io.ByteReader { + br, ok := r.(io.ByteReader) + if !ok { + return &breader{r, make([]byte, 1)} + } + return br +} + +// ReadByte read byte function. +func (r *breader) ReadByte() (c byte, err error) { + n, err := r.Reader.Read(r.p) + if n < 1 { + if err == nil { + err = errors.New("breader.ReadByte: no data") + } + return 0, err + } + return r.p[0], nil +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/buffer.go b/vendor/github.com/ulikunitz/xz/lzma/buffer.go new file mode 100644 index 0000000..50e0b6d --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/buffer.go @@ -0,0 +1,171 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" +) + +// buffer provides a circular buffer of bytes. If the front index equals +// the rear index the buffer is empty. As a consequence front cannot be +// equal rear for a full buffer. So a full buffer has a length that is +// one byte less the the length of the data slice. +type buffer struct { + data []byte + front int + rear int +} + +// newBuffer creates a buffer with the given size. +func newBuffer(size int) *buffer { + return &buffer{data: make([]byte, size+1)} +} + +// Cap returns the capacity of the buffer. +func (b *buffer) Cap() int { + return len(b.data) - 1 +} + +// Resets the buffer. The front and rear index are set to zero. +func (b *buffer) Reset() { + b.front = 0 + b.rear = 0 +} + +// Buffered returns the number of bytes buffered. +func (b *buffer) Buffered() int { + delta := b.front - b.rear + if delta < 0 { + delta += len(b.data) + } + return delta +} + +// Available returns the number of bytes available for writing. +func (b *buffer) Available() int { + delta := b.rear - 1 - b.front + if delta < 0 { + delta += len(b.data) + } + return delta +} + +// addIndex adds a non-negative integer to the index i and returns the +// resulting index. The function takes care of wrapping the index as +// well as potential overflow situations. +func (b *buffer) addIndex(i int, n int) int { + // subtraction of len(b.data) prevents overflow + i += n - len(b.data) + if i < 0 { + i += len(b.data) + } + return i +} + +// Read reads bytes from the buffer into p and returns the number of +// bytes read. The function never returns an error but might return less +// data than requested. +func (b *buffer) Read(p []byte) (n int, err error) { + n, err = b.Peek(p) + b.rear = b.addIndex(b.rear, n) + return n, err +} + +// Peek reads bytes from the buffer into p without changing the buffer. +// Peek will never return an error but might return less data than +// requested. +func (b *buffer) Peek(p []byte) (n int, err error) { + m := b.Buffered() + n = len(p) + if m < n { + n = m + p = p[:n] + } + k := copy(p, b.data[b.rear:]) + if k < n { + copy(p[k:], b.data) + } + return n, nil +} + +// Discard skips the n next bytes to read from the buffer, returning the +// bytes discarded. +// +// If Discards skips fewer than n bytes, it returns an error. +func (b *buffer) Discard(n int) (discarded int, err error) { + if n < 0 { + return 0, errors.New("buffer.Discard: negative argument") + } + m := b.Buffered() + if m < n { + n = m + err = errors.New( + "buffer.Discard: discarded less bytes then requested") + } + b.rear = b.addIndex(b.rear, n) + return n, err +} + +// ErrNoSpace indicates that there is insufficient space for the Write +// operation. +var ErrNoSpace = errors.New("insufficient space") + +// Write puts data into the buffer. If less bytes are written than +// requested ErrNoSpace is returned. +func (b *buffer) Write(p []byte) (n int, err error) { + m := b.Available() + n = len(p) + if m < n { + n = m + p = p[:m] + err = ErrNoSpace + } + k := copy(b.data[b.front:], p) + if k < n { + copy(b.data, p[k:]) + } + b.front = b.addIndex(b.front, n) + return n, err +} + +// WriteByte writes a single byte into the buffer. The error ErrNoSpace +// is returned if no single byte is available in the buffer for writing. +func (b *buffer) WriteByte(c byte) error { + if b.Available() < 1 { + return ErrNoSpace + } + b.data[b.front] = c + b.front = b.addIndex(b.front, 1) + return nil +} + +// prefixLen returns the length of the common prefix of a and b. +func prefixLen(a, b []byte) int { + if len(a) > len(b) { + a, b = b, a + } + for i, c := range a { + if b[i] != c { + return i + } + } + return len(a) +} + +// matchLen returns the length of the common prefix for the given +// distance from the rear and the byte slice p. +func (b *buffer) matchLen(distance int, p []byte) int { + var n int + i := b.rear - distance + if i < 0 { + if n = prefixLen(p, b.data[len(b.data)+i:]); n < -i { + return n + } + p = p[n:] + i = 0 + } + n += prefixLen(p, b.data[i:]) + return n +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go b/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go new file mode 100644 index 0000000..a3696ba --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go @@ -0,0 +1,37 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "io" +) + +// ErrLimit indicates that the limit of the LimitedByteWriter has been +// reached. +var ErrLimit = errors.New("limit reached") + +// LimitedByteWriter provides a byte writer that can be written until a +// limit is reached. The field N provides the number of remaining +// bytes. +type LimitedByteWriter struct { + BW io.ByteWriter + N int64 +} + +// WriteByte writes a single byte to the limited byte writer. It returns +// ErrLimit if the limit has been reached. If the byte is successfully +// written the field N of the LimitedByteWriter will be decremented by +// one. +func (l *LimitedByteWriter) WriteByte(c byte) error { + if l.N <= 0 { + return ErrLimit + } + if err := l.BW.WriteByte(c); err != nil { + return err + } + l.N-- + return nil +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/decoder.go b/vendor/github.com/ulikunitz/xz/lzma/decoder.go new file mode 100644 index 0000000..16e14db --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/decoder.go @@ -0,0 +1,277 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "fmt" + "io" +) + +// decoder decodes a raw LZMA stream without any header. +type decoder struct { + // dictionary; the rear pointer of the buffer will be used for + // reading the data. + Dict *decoderDict + // decoder state + State *state + // range decoder + rd *rangeDecoder + // start stores the head value of the dictionary for the LZMA + // stream + start int64 + // size of uncompressed data + size int64 + // end-of-stream encountered + eos bool + // EOS marker found + eosMarker bool +} + +// newDecoder creates a new decoder instance. The parameter size provides +// the expected byte size of the decompressed data. If the size is +// unknown use a negative value. In that case the decoder will look for +// a terminating end-of-stream marker. +func newDecoder(br io.ByteReader, state *state, dict *decoderDict, size int64) (d *decoder, err error) { + rd, err := newRangeDecoder(br) + if err != nil { + return nil, err + } + d = &decoder{ + State: state, + Dict: dict, + rd: rd, + size: size, + start: dict.pos(), + } + return d, nil +} + +// Reopen restarts the decoder with a new byte reader and a new size. Reopen +// resets the Decompressed counter to zero. +func (d *decoder) Reopen(br io.ByteReader, size int64) error { + var err error + if d.rd, err = newRangeDecoder(br); err != nil { + return err + } + d.start = d.Dict.pos() + d.size = size + d.eos = false + return nil +} + +// decodeLiteral decodes a single literal from the LZMA stream. +func (d *decoder) decodeLiteral() (op operation, err error) { + litState := d.State.litState(d.Dict.byteAt(1), d.Dict.head) + match := d.Dict.byteAt(int(d.State.rep[0]) + 1) + s, err := d.State.litCodec.Decode(d.rd, d.State.state, match, litState) + if err != nil { + return nil, err + } + return lit{s}, nil +} + +// errEOS indicates that an EOS marker has been found. +var errEOS = errors.New("EOS marker found") + +// readOp decodes the next operation from the compressed stream. It +// returns the operation. If an explicit end of stream marker is +// identified the eos error is returned. +func (d *decoder) readOp() (op operation, err error) { + // Value of the end of stream (EOS) marker + const eosDist = 1<<32 - 1 + + state, state2, posState := d.State.states(d.Dict.head) + + b, err := d.State.isMatch[state2].Decode(d.rd) + if err != nil { + return nil, err + } + if b == 0 { + // literal + op, err := d.decodeLiteral() + if err != nil { + return nil, err + } + d.State.updateStateLiteral() + return op, nil + } + b, err = d.State.isRep[state].Decode(d.rd) + if err != nil { + return nil, err + } + if b == 0 { + // simple match + d.State.rep[3], d.State.rep[2], d.State.rep[1] = + d.State.rep[2], d.State.rep[1], d.State.rep[0] + + d.State.updateStateMatch() + // The length decoder returns the length offset. + n, err := d.State.lenCodec.Decode(d.rd, posState) + if err != nil { + return nil, err + } + // The dist decoder returns the distance offset. The actual + // distance is 1 higher. + d.State.rep[0], err = d.State.distCodec.Decode(d.rd, n) + if err != nil { + return nil, err + } + if d.State.rep[0] == eosDist { + d.eosMarker = true + return nil, errEOS + } + op = match{n: int(n) + minMatchLen, + distance: int64(d.State.rep[0]) + minDistance} + return op, nil + } + b, err = d.State.isRepG0[state].Decode(d.rd) + if err != nil { + return nil, err + } + dist := d.State.rep[0] + if b == 0 { + // rep match 0 + b, err = d.State.isRepG0Long[state2].Decode(d.rd) + if err != nil { + return nil, err + } + if b == 0 { + d.State.updateStateShortRep() + op = match{n: 1, distance: int64(dist) + minDistance} + return op, nil + } + } else { + b, err = d.State.isRepG1[state].Decode(d.rd) + if err != nil { + return nil, err + } + if b == 0 { + dist = d.State.rep[1] + } else { + b, err = d.State.isRepG2[state].Decode(d.rd) + if err != nil { + return nil, err + } + if b == 0 { + dist = d.State.rep[2] + } else { + dist = d.State.rep[3] + d.State.rep[3] = d.State.rep[2] + } + d.State.rep[2] = d.State.rep[1] + } + d.State.rep[1] = d.State.rep[0] + d.State.rep[0] = dist + } + n, err := d.State.repLenCodec.Decode(d.rd, posState) + if err != nil { + return nil, err + } + d.State.updateStateRep() + op = match{n: int(n) + minMatchLen, distance: int64(dist) + minDistance} + return op, nil +} + +// apply takes the operation and transforms the decoder dictionary accordingly. +func (d *decoder) apply(op operation) error { + var err error + switch x := op.(type) { + case match: + err = d.Dict.writeMatch(x.distance, x.n) + case lit: + err = d.Dict.WriteByte(x.b) + default: + panic("op is neither a match nor a literal") + } + return err +} + +// decompress fills the dictionary unless no space for new data is +// available. If the end of the LZMA stream has been reached io.EOF will +// be returned. +func (d *decoder) decompress() error { + if d.eos { + return io.EOF + } + for d.Dict.Available() >= maxMatchLen { + op, err := d.readOp() + switch err { + case nil: + break + case errEOS: + d.eos = true + if !d.rd.possiblyAtEnd() { + return errDataAfterEOS + } + if d.size >= 0 && d.size != d.Decompressed() { + return errSize + } + return io.EOF + case io.EOF: + d.eos = true + return io.ErrUnexpectedEOF + default: + return err + } + if err = d.apply(op); err != nil { + return err + } + if d.size >= 0 && d.Decompressed() >= d.size { + d.eos = true + if d.Decompressed() > d.size { + return errSize + } + if !d.rd.possiblyAtEnd() { + switch _, err = d.readOp(); err { + case nil: + return errSize + case io.EOF: + return io.ErrUnexpectedEOF + case errEOS: + break + default: + return err + } + } + return io.EOF + } + } + return nil +} + +// Errors that may be returned while decoding data. +var ( + errDataAfterEOS = errors.New("lzma: data after end of stream marker") + errSize = errors.New("lzma: wrong uncompressed data size") +) + +// Read reads data from the buffer. If no more data is available io.EOF is +// returned. +func (d *decoder) Read(p []byte) (n int, err error) { + var k int + for { + // Read of decoder dict never returns an error. + k, err = d.Dict.Read(p[n:]) + if err != nil { + panic(fmt.Errorf("dictionary read error %s", err)) + } + if k == 0 && d.eos { + return n, io.EOF + } + n += k + if n >= len(p) { + return n, nil + } + if err = d.decompress(); err != nil && err != io.EOF { + return n, err + } + } +} + +// Decompressed returns the number of bytes decompressed by the decoder. +func (d *decoder) Decompressed() int64 { + return d.Dict.pos() - d.start +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go b/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go new file mode 100644 index 0000000..564a12b --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go @@ -0,0 +1,135 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "fmt" +) + +// decoderDict provides the dictionary for the decoder. The whole +// dictionary is used as reader buffer. +type decoderDict struct { + buf buffer + head int64 +} + +// newDecoderDict creates a new decoder dictionary. The whole dictionary +// will be used as reader buffer. +func newDecoderDict(dictCap int) (d *decoderDict, err error) { + // lower limit supports easy test cases + if !(1 <= dictCap && int64(dictCap) <= MaxDictCap) { + return nil, errors.New("lzma: dictCap out of range") + } + d = &decoderDict{buf: *newBuffer(dictCap)} + return d, nil +} + +// Reset clears the dictionary. The read buffer is not changed, so the +// buffered data can still be read. +func (d *decoderDict) Reset() { + d.head = 0 +} + +// WriteByte writes a single byte into the dictionary. It is used to +// write literals into the dictionary. +func (d *decoderDict) WriteByte(c byte) error { + if err := d.buf.WriteByte(c); err != nil { + return err + } + d.head++ + return nil +} + +// pos returns the position of the dictionary head. +func (d *decoderDict) pos() int64 { return d.head } + +// dictLen returns the actual length of the dictionary. +func (d *decoderDict) dictLen() int { + capacity := d.buf.Cap() + if d.head >= int64(capacity) { + return capacity + } + return int(d.head) +} + +// byteAt returns a byte stored in the dictionary. If the distance is +// non-positive or exceeds the current length of the dictionary the zero +// byte is returned. +func (d *decoderDict) byteAt(dist int) byte { + if !(0 < dist && dist <= d.dictLen()) { + return 0 + } + i := d.buf.front - dist + if i < 0 { + i += len(d.buf.data) + } + return d.buf.data[i] +} + +// writeMatch writes the match at the top of the dictionary. The given +// distance must point in the current dictionary and the length must not +// exceed the maximum length 273 supported in LZMA. +// +// The error value ErrNoSpace indicates that no space is available in +// the dictionary for writing. You need to read from the dictionary +// first. +func (d *decoderDict) writeMatch(dist int64, length int) error { + if !(0 < dist && dist <= int64(d.dictLen())) { + return errors.New("writeMatch: distance out of range") + } + if !(0 < length && length <= maxMatchLen) { + return errors.New("writeMatch: length out of range") + } + if length > d.buf.Available() { + return ErrNoSpace + } + d.head += int64(length) + + i := d.buf.front - int(dist) + if i < 0 { + i += len(d.buf.data) + } + for length > 0 { + var p []byte + if i >= d.buf.front { + p = d.buf.data[i:] + i = 0 + } else { + p = d.buf.data[i:d.buf.front] + i = d.buf.front + } + if len(p) > length { + p = p[:length] + } + if _, err := d.buf.Write(p); err != nil { + panic(fmt.Errorf("d.buf.Write returned error %s", err)) + } + length -= len(p) + } + return nil +} + +// Write writes the given bytes into the dictionary and advances the +// head. +func (d *decoderDict) Write(p []byte) (n int, err error) { + n, err = d.buf.Write(p) + d.head += int64(n) + return n, err +} + +// Available returns the number of available bytes for writing into the +// decoder dictionary. +func (d *decoderDict) Available() int { return d.buf.Available() } + +// Read reads data from the buffer contained in the decoder dictionary. +func (d *decoderDict) Read(p []byte) (n int, err error) { return d.buf.Read(p) } + +// Buffered returns the number of bytes currently buffered in the +// decoder dictionary. +func (d *decoderDict) buffered() int { return d.buf.Buffered() } + +// Peek gets data from the buffer without advancing the rear index. +func (d *decoderDict) peek(p []byte) (n int, err error) { return d.buf.Peek(p) } diff --git a/vendor/github.com/ulikunitz/xz/lzma/directcodec.go b/vendor/github.com/ulikunitz/xz/lzma/directcodec.go new file mode 100644 index 0000000..e08eb98 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/directcodec.go @@ -0,0 +1,49 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import "fmt" + +// directCodec allows the encoding and decoding of values with a fixed number +// of bits. The number of bits must be in the range [1,32]. +type directCodec byte + +// makeDirectCodec creates a directCodec. The function panics if the number of +// bits is not in the range [1,32]. +func makeDirectCodec(bits int) directCodec { + if !(1 <= bits && bits <= 32) { + panic(fmt.Errorf("bits=%d out of range", bits)) + } + return directCodec(bits) +} + +// Bits returns the number of bits supported by this codec. +func (dc directCodec) Bits() int { + return int(dc) +} + +// Encode uses the range encoder to encode a value with the fixed number of +// bits. The most-significant bit is encoded first. +func (dc directCodec) Encode(e *rangeEncoder, v uint32) error { + for i := int(dc) - 1; i >= 0; i-- { + if err := e.DirectEncodeBit(v >> uint(i)); err != nil { + return err + } + } + return nil +} + +// Decode uses the range decoder to decode a value with the given number of +// given bits. The most-significant bit is decoded first. +func (dc directCodec) Decode(d *rangeDecoder) (v uint32, err error) { + for i := int(dc) - 1; i >= 0; i-- { + x, err := d.DirectDecodeBit() + if err != nil { + return 0, err + } + v = (v << 1) | x + } + return v, nil +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/distcodec.go b/vendor/github.com/ulikunitz/xz/lzma/distcodec.go new file mode 100644 index 0000000..b053a2d --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/distcodec.go @@ -0,0 +1,156 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +// Constants used by the distance codec. +const ( + // minimum supported distance + minDistance = 1 + // maximum supported distance, value is used for the eos marker. + maxDistance = 1 << 32 + // number of the supported len states + lenStates = 4 + // start for the position models + startPosModel = 4 + // first index with align bits support + endPosModel = 14 + // bits for the position slots + posSlotBits = 6 + // number of align bits + alignBits = 4 + // maximum position slot + maxPosSlot = 63 +) + +// distCodec provides encoding and decoding of distance values. +type distCodec struct { + posSlotCodecs [lenStates]treeCodec + posModel [endPosModel - startPosModel]treeReverseCodec + alignCodec treeReverseCodec +} + +// deepcopy initializes dc as deep copy of the source. +func (dc *distCodec) deepcopy(src *distCodec) { + if dc == src { + return + } + for i := range dc.posSlotCodecs { + dc.posSlotCodecs[i].deepcopy(&src.posSlotCodecs[i]) + } + for i := range dc.posModel { + dc.posModel[i].deepcopy(&src.posModel[i]) + } + dc.alignCodec.deepcopy(&src.alignCodec) +} + +// distBits returns the number of bits required to encode dist. +func distBits(dist uint32) int { + if dist < startPosModel { + return 6 + } + // slot s > 3, dist d + // s = 2(bits(d)-1) + bit(d, bits(d)-2) + // s>>1 = bits(d)-1 + // bits(d) = 32-nlz32(d) + // s>>1=31-nlz32(d) + // n = 5 + (s>>1) = 36 - nlz32(d) + return 36 - nlz32(dist) +} + +// newDistCodec creates a new distance codec. +func (dc *distCodec) init() { + for i := range dc.posSlotCodecs { + dc.posSlotCodecs[i] = makeTreeCodec(posSlotBits) + } + for i := range dc.posModel { + posSlot := startPosModel + i + bits := (posSlot >> 1) - 1 + dc.posModel[i] = makeTreeReverseCodec(bits) + } + dc.alignCodec = makeTreeReverseCodec(alignBits) +} + +// lenState converts the value l to a supported lenState value. +func lenState(l uint32) uint32 { + if l >= lenStates { + l = lenStates - 1 + } + return l +} + +// Encode encodes the distance using the parameter l. Dist can have values from +// the full range of uint32 values. To get the distance offset the actual match +// distance has to be decreased by 1. A distance offset of 0xffffffff (eos) +// indicates the end of the stream. +func (dc *distCodec) Encode(e *rangeEncoder, dist uint32, l uint32) (err error) { + // Compute the posSlot using nlz32 + var posSlot uint32 + var bits uint32 + if dist < startPosModel { + posSlot = dist + } else { + bits = uint32(30 - nlz32(dist)) + posSlot = startPosModel - 2 + (bits << 1) + posSlot += (dist >> uint(bits)) & 1 + } + + if err = dc.posSlotCodecs[lenState(l)].Encode(e, posSlot); err != nil { + return + } + + switch { + case posSlot < startPosModel: + return nil + case posSlot < endPosModel: + tc := &dc.posModel[posSlot-startPosModel] + return tc.Encode(dist, e) + } + dic := directCodec(bits - alignBits) + if err = dic.Encode(e, dist>>alignBits); err != nil { + return + } + return dc.alignCodec.Encode(dist, e) +} + +// Decode decodes the distance offset using the parameter l. The dist value +// 0xffffffff (eos) indicates the end of the stream. Add one to the distance +// offset to get the actual match distance. +func (dc *distCodec) Decode(d *rangeDecoder, l uint32) (dist uint32, err error) { + posSlot, err := dc.posSlotCodecs[lenState(l)].Decode(d) + if err != nil { + return + } + + // posSlot equals distance + if posSlot < startPosModel { + return posSlot, nil + } + + // posSlot uses the individual models + bits := (posSlot >> 1) - 1 + dist = (2 | (posSlot & 1)) << bits + var u uint32 + if posSlot < endPosModel { + tc := &dc.posModel[posSlot-startPosModel] + if u, err = tc.Decode(d); err != nil { + return 0, err + } + dist += u + return dist, nil + } + + // posSlots use direct encoding and a single model for the four align + // bits. + dic := directCodec(bits - alignBits) + if u, err = dic.Decode(d); err != nil { + return 0, err + } + dist += u << alignBits + if u, err = dc.alignCodec.Decode(d); err != nil { + return 0, err + } + dist += u + return dist, nil +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/encoder.go b/vendor/github.com/ulikunitz/xz/lzma/encoder.go new file mode 100644 index 0000000..18ce009 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/encoder.go @@ -0,0 +1,268 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "fmt" + "io" +) + +// opLenMargin provides the upper limit of the number of bytes required +// to encode a single operation. +const opLenMargin = 10 + +// compressFlags control the compression process. +type compressFlags uint32 + +// Values for compressFlags. +const ( + // all data should be compressed, even if compression is not + // optimal. + all compressFlags = 1 << iota +) + +// encoderFlags provide the flags for an encoder. +type encoderFlags uint32 + +// Flags for the encoder. +const ( + // eosMarker requests an EOS marker to be written. + eosMarker encoderFlags = 1 << iota +) + +// Encoder compresses data buffered in the encoder dictionary and writes +// it into a byte writer. +type encoder struct { + dict *encoderDict + state *state + re *rangeEncoder + start int64 + // generate eos marker + marker bool + limit bool + margin int +} + +// newEncoder creates a new encoder. If the byte writer must be +// limited use LimitedByteWriter provided by this package. The flags +// argument supports the eosMarker flag, controlling whether a +// terminating end-of-stream marker must be written. +func newEncoder(bw io.ByteWriter, state *state, dict *encoderDict, + flags encoderFlags) (e *encoder, err error) { + + re, err := newRangeEncoder(bw) + if err != nil { + return nil, err + } + e = &encoder{ + dict: dict, + state: state, + re: re, + marker: flags&eosMarker != 0, + start: dict.Pos(), + margin: opLenMargin, + } + if e.marker { + e.margin += 5 + } + return e, nil +} + +// Write writes the bytes from p into the dictionary. If not enough +// space is available the data in the dictionary buffer will be +// compressed to make additional space available. If the limit of the +// underlying writer has been reached ErrLimit will be returned. +func (e *encoder) Write(p []byte) (n int, err error) { + for { + k, err := e.dict.Write(p[n:]) + n += k + if err == ErrNoSpace { + if err = e.compress(0); err != nil { + return n, err + } + continue + } + return n, err + } +} + +// Reopen reopens the encoder with a new byte writer. +func (e *encoder) Reopen(bw io.ByteWriter) error { + var err error + if e.re, err = newRangeEncoder(bw); err != nil { + return err + } + e.start = e.dict.Pos() + e.limit = false + return nil +} + +// writeLiteral writes a literal into the LZMA stream +func (e *encoder) writeLiteral(l lit) error { + var err error + state, state2, _ := e.state.states(e.dict.Pos()) + if err = e.state.isMatch[state2].Encode(e.re, 0); err != nil { + return err + } + litState := e.state.litState(e.dict.ByteAt(1), e.dict.Pos()) + match := e.dict.ByteAt(int(e.state.rep[0]) + 1) + err = e.state.litCodec.Encode(e.re, l.b, state, match, litState) + if err != nil { + return err + } + e.state.updateStateLiteral() + return nil +} + +// iverson implements the Iverson operator as proposed by Donald Knuth in his +// book Concrete Mathematics. +func iverson(ok bool) uint32 { + if ok { + return 1 + } + return 0 +} + +// writeMatch writes a repetition operation into the operation stream +func (e *encoder) writeMatch(m match) error { + var err error + if !(minDistance <= m.distance && m.distance <= maxDistance) { + panic(fmt.Errorf("match distance %d out of range", m.distance)) + } + dist := uint32(m.distance - minDistance) + if !(minMatchLen <= m.n && m.n <= maxMatchLen) && + !(dist == e.state.rep[0] && m.n == 1) { + panic(fmt.Errorf( + "match length %d out of range; dist %d rep[0] %d", + m.n, dist, e.state.rep[0])) + } + state, state2, posState := e.state.states(e.dict.Pos()) + if err = e.state.isMatch[state2].Encode(e.re, 1); err != nil { + return err + } + g := 0 + for ; g < 4; g++ { + if e.state.rep[g] == dist { + break + } + } + b := iverson(g < 4) + if err = e.state.isRep[state].Encode(e.re, b); err != nil { + return err + } + n := uint32(m.n - minMatchLen) + if b == 0 { + // simple match + e.state.rep[3], e.state.rep[2], e.state.rep[1], e.state.rep[0] = + e.state.rep[2], e.state.rep[1], e.state.rep[0], dist + e.state.updateStateMatch() + if err = e.state.lenCodec.Encode(e.re, n, posState); err != nil { + return err + } + return e.state.distCodec.Encode(e.re, dist, n) + } + b = iverson(g != 0) + if err = e.state.isRepG0[state].Encode(e.re, b); err != nil { + return err + } + if b == 0 { + // g == 0 + b = iverson(m.n != 1) + if err = e.state.isRepG0Long[state2].Encode(e.re, b); err != nil { + return err + } + if b == 0 { + e.state.updateStateShortRep() + return nil + } + } else { + // g in {1,2,3} + b = iverson(g != 1) + if err = e.state.isRepG1[state].Encode(e.re, b); err != nil { + return err + } + if b == 1 { + // g in {2,3} + b = iverson(g != 2) + err = e.state.isRepG2[state].Encode(e.re, b) + if err != nil { + return err + } + if b == 1 { + e.state.rep[3] = e.state.rep[2] + } + e.state.rep[2] = e.state.rep[1] + } + e.state.rep[1] = e.state.rep[0] + e.state.rep[0] = dist + } + e.state.updateStateRep() + return e.state.repLenCodec.Encode(e.re, n, posState) +} + +// writeOp writes a single operation to the range encoder. The function +// checks whether there is enough space available to close the LZMA +// stream. +func (e *encoder) writeOp(op operation) error { + if e.re.Available() < int64(e.margin) { + return ErrLimit + } + switch x := op.(type) { + case lit: + return e.writeLiteral(x) + case match: + return e.writeMatch(x) + default: + panic("unexpected operation") + } +} + +// compress compressed data from the dictionary buffer. If the flag all +// is set, all data in the dictionary buffer will be compressed. The +// function returns ErrLimit if the underlying writer has reached its +// limit. +func (e *encoder) compress(flags compressFlags) error { + n := 0 + if flags&all == 0 { + n = maxMatchLen - 1 + } + d := e.dict + m := d.m + for d.Buffered() > n { + op := m.NextOp(e.state.rep) + if err := e.writeOp(op); err != nil { + return err + } + d.Discard(op.Len()) + } + return nil +} + +// eosMatch is a pseudo operation that indicates the end of the stream. +var eosMatch = match{distance: maxDistance, n: minMatchLen} + +// Close terminates the LZMA stream. If requested the end-of-stream +// marker will be written. If the byte writer limit has been or will be +// reached during compression of the remaining data in the buffer the +// LZMA stream will be closed and data will remain in the buffer. +func (e *encoder) Close() error { + err := e.compress(all) + if err != nil && err != ErrLimit { + return err + } + if e.marker { + if err := e.writeMatch(eosMatch); err != nil { + return err + } + } + err = e.re.Close() + return err +} + +// Compressed returns the number bytes of the input data that been +// compressed. +func (e *encoder) Compressed() int64 { + return e.dict.Pos() - e.start +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go b/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go new file mode 100644 index 0000000..9d0fbc7 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go @@ -0,0 +1,149 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "fmt" + "io" +) + +// matcher is an interface that supports the identification of the next +// operation. +type matcher interface { + io.Writer + SetDict(d *encoderDict) + NextOp(rep [4]uint32) operation +} + +// encoderDict provides the dictionary of the encoder. It includes an +// addtional buffer atop of the actual dictionary. +type encoderDict struct { + buf buffer + m matcher + head int64 + capacity int + // preallocated array + data [maxMatchLen]byte +} + +// newEncoderDict creates the encoder dictionary. The argument bufSize +// defines the size of the additional buffer. +func newEncoderDict(dictCap, bufSize int, m matcher) (d *encoderDict, err error) { + if !(1 <= dictCap && int64(dictCap) <= MaxDictCap) { + return nil, errors.New( + "lzma: dictionary capacity out of range") + } + if bufSize < 1 { + return nil, errors.New( + "lzma: buffer size must be larger than zero") + } + d = &encoderDict{ + buf: *newBuffer(dictCap + bufSize), + capacity: dictCap, + m: m, + } + m.SetDict(d) + return d, nil +} + +// Discard discards n bytes. Note that n must not be larger than +// MaxMatchLen. +func (d *encoderDict) Discard(n int) { + p := d.data[:n] + k, _ := d.buf.Read(p) + if k < n { + panic(fmt.Errorf("lzma: can't discard %d bytes", n)) + } + d.head += int64(n) + d.m.Write(p) +} + +// Len returns the data available in the encoder dictionary. +func (d *encoderDict) Len() int { + n := d.buf.Available() + if int64(n) > d.head { + return int(d.head) + } + return n +} + +// DictLen returns the actual length of data in the dictionary. +func (d *encoderDict) DictLen() int { + if d.head < int64(d.capacity) { + return int(d.head) + } + return d.capacity +} + +// Available returns the number of bytes that can be written by a +// following Write call. +func (d *encoderDict) Available() int { + return d.buf.Available() - d.DictLen() +} + +// Write writes data into the dictionary buffer. Note that the position +// of the dictionary head will not be moved. If there is not enough +// space in the buffer ErrNoSpace will be returned. +func (d *encoderDict) Write(p []byte) (n int, err error) { + m := d.Available() + if len(p) > m { + p = p[:m] + err = ErrNoSpace + } + var e error + if n, e = d.buf.Write(p); e != nil { + err = e + } + return n, err +} + +// Pos returns the position of the head. +func (d *encoderDict) Pos() int64 { return d.head } + +// ByteAt returns the byte at the given distance. +func (d *encoderDict) ByteAt(distance int) byte { + if !(0 < distance && distance <= d.Len()) { + return 0 + } + i := d.buf.rear - distance + if i < 0 { + i += len(d.buf.data) + } + return d.buf.data[i] +} + +// CopyN copies the last n bytes from the dictionary into the provided +// writer. This is used for copying uncompressed data into an +// uncompressed segment. +func (d *encoderDict) CopyN(w io.Writer, n int) (written int, err error) { + if n <= 0 { + return 0, nil + } + m := d.Len() + if n > m { + n = m + err = ErrNoSpace + } + i := d.buf.rear - n + var e error + if i < 0 { + i += len(d.buf.data) + if written, e = w.Write(d.buf.data[i:]); e != nil { + return written, e + } + i = 0 + } + var k int + k, e = w.Write(d.buf.data[i:d.buf.rear]) + written += k + if e != nil { + err = e + } + return written, err +} + +// Buffered returns the number of bytes in the buffer. +func (d *encoderDict) Buffered() int { return d.buf.Buffered() } diff --git a/vendor/github.com/ulikunitz/xz/lzma/fox.lzma b/vendor/github.com/ulikunitz/xz/lzma/fox.lzma new file mode 100644 index 0000000..5edad63 Binary files /dev/null and b/vendor/github.com/ulikunitz/xz/lzma/fox.lzma differ diff --git a/vendor/github.com/ulikunitz/xz/lzma/hashtable.go b/vendor/github.com/ulikunitz/xz/lzma/hashtable.go new file mode 100644 index 0000000..d786a97 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/hashtable.go @@ -0,0 +1,309 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "fmt" + + "github.com/ulikunitz/xz/internal/hash" +) + +/* For compression we need to find byte sequences that match the byte + * sequence at the dictionary head. A hash table is a simple method to + * provide this capability. + */ + +// maxMatches limits the number of matches requested from the Matches +// function. This controls the speed of the overall encoding. +const maxMatches = 16 + +// shortDists defines the number of short distances supported by the +// implementation. +const shortDists = 8 + +// The minimum is somehow arbitrary but the maximum is limited by the +// memory requirements of the hash table. +const ( + minTableExponent = 9 + maxTableExponent = 20 +) + +// newRoller contains the function used to create an instance of the +// hash.Roller. +var newRoller = func(n int) hash.Roller { return hash.NewCyclicPoly(n) } + +// hashTable stores the hash table including the rolling hash method. +// +// We implement chained hashing into a circular buffer. Each entry in +// the circular buffer stores the delta distance to the next position with a +// word that has the same hash value. +type hashTable struct { + dict *encoderDict + // actual hash table + t []int64 + // circular list data with the offset to the next word + data []uint32 + front int + // mask for computing the index for the hash table + mask uint64 + // hash offset; initial value is -int64(wordLen) + hoff int64 + // length of the hashed word + wordLen int + // hash roller for computing the hash values for the Write + // method + wr hash.Roller + // hash roller for computing arbitrary hashes + hr hash.Roller + // preallocated slices + p [maxMatches]int64 + distances [maxMatches + shortDists]int +} + +// hashTableExponent derives the hash table exponent from the dictionary +// capacity. +func hashTableExponent(n uint32) int { + e := 30 - nlz32(n) + switch { + case e < minTableExponent: + e = minTableExponent + case e > maxTableExponent: + e = maxTableExponent + } + return e +} + +// newHashTable creates a new hash table for words of length wordLen +func newHashTable(capacity int, wordLen int) (t *hashTable, err error) { + if !(0 < capacity) { + return nil, errors.New( + "newHashTable: capacity must not be negative") + } + exp := hashTableExponent(uint32(capacity)) + if !(1 <= wordLen && wordLen <= 4) { + return nil, errors.New("newHashTable: " + + "argument wordLen out of range") + } + n := 1 << uint(exp) + if n <= 0 { + panic("newHashTable: exponent is too large") + } + t = &hashTable{ + t: make([]int64, n), + data: make([]uint32, capacity), + mask: (uint64(1) << uint(exp)) - 1, + hoff: -int64(wordLen), + wordLen: wordLen, + wr: newRoller(wordLen), + hr: newRoller(wordLen), + } + return t, nil +} + +func (t *hashTable) SetDict(d *encoderDict) { t.dict = d } + +// buffered returns the number of bytes that are currently hashed. +func (t *hashTable) buffered() int { + n := t.hoff + 1 + switch { + case n <= 0: + return 0 + case n >= int64(len(t.data)): + return len(t.data) + } + return int(n) +} + +// addIndex adds n to an index ensuring that is stays inside the +// circular buffer for the hash chain. +func (t *hashTable) addIndex(i, n int) int { + i += n - len(t.data) + if i < 0 { + i += len(t.data) + } + return i +} + +// putDelta puts the delta instance at the current front of the circular +// chain buffer. +func (t *hashTable) putDelta(delta uint32) { + t.data[t.front] = delta + t.front = t.addIndex(t.front, 1) +} + +// putEntry puts a new entry into the hash table. If there is already a +// value stored it is moved into the circular chain buffer. +func (t *hashTable) putEntry(h uint64, pos int64) { + if pos < 0 { + return + } + i := h & t.mask + old := t.t[i] - 1 + t.t[i] = pos + 1 + var delta int64 + if old >= 0 { + delta = pos - old + if delta > 1<<32-1 || delta > int64(t.buffered()) { + delta = 0 + } + } + t.putDelta(uint32(delta)) +} + +// WriteByte converts a single byte into a hash and puts them into the hash +// table. +func (t *hashTable) WriteByte(b byte) error { + h := t.wr.RollByte(b) + t.hoff++ + t.putEntry(h, t.hoff) + return nil +} + +// Write converts the bytes provided into hash tables and stores the +// abbreviated offsets into the hash table. The method will never return an +// error. +func (t *hashTable) Write(p []byte) (n int, err error) { + for _, b := range p { + // WriteByte doesn't generate an error. + t.WriteByte(b) + } + return len(p), nil +} + +// getMatches the matches for a specific hash. The functions returns the +// number of positions found. +// +// TODO: Make a getDistances because that we are actually interested in. +func (t *hashTable) getMatches(h uint64, positions []int64) (n int) { + if t.hoff < 0 || len(positions) == 0 { + return 0 + } + buffered := t.buffered() + tailPos := t.hoff + 1 - int64(buffered) + rear := t.front - buffered + if rear >= 0 { + rear -= len(t.data) + } + // get the slot for the hash + pos := t.t[h&t.mask] - 1 + delta := pos - tailPos + for { + if delta < 0 { + return n + } + positions[n] = tailPos + delta + n++ + if n >= len(positions) { + return n + } + i := rear + int(delta) + if i < 0 { + i += len(t.data) + } + u := t.data[i] + if u == 0 { + return n + } + delta -= int64(u) + } +} + +// hash computes the rolling hash for the word stored in p. For correct +// results its length must be equal to t.wordLen. +func (t *hashTable) hash(p []byte) uint64 { + var h uint64 + for _, b := range p { + h = t.hr.RollByte(b) + } + return h +} + +// Matches fills the positions slice with potential matches. The +// functions returns the number of positions filled into positions. The +// byte slice p must have word length of the hash table. +func (t *hashTable) Matches(p []byte, positions []int64) int { + if len(p) != t.wordLen { + panic(fmt.Errorf( + "byte slice must have length %d", t.wordLen)) + } + h := t.hash(p) + return t.getMatches(h, positions) +} + +// NextOp identifies the next operation using the hash table. +// +// TODO: Use all repetitions to find matches. +func (t *hashTable) NextOp(rep [4]uint32) operation { + // get positions + data := t.dict.data[:maxMatchLen] + n, _ := t.dict.buf.Peek(data) + data = data[:n] + var p []int64 + if n < t.wordLen { + p = t.p[:0] + } else { + p = t.p[:maxMatches] + n = t.Matches(data[:t.wordLen], p) + p = p[:n] + } + + // convert positions in potential distances + head := t.dict.head + dists := append(t.distances[:0], 1, 2, 3, 4, 5, 6, 7, 8) + for _, pos := range p { + dis := int(head - pos) + if dis > shortDists { + dists = append(dists, dis) + } + } + + // check distances + var m match + dictLen := t.dict.DictLen() + for _, dist := range dists { + if dist > dictLen { + continue + } + + // Here comes a trick. We are only interested in matches + // that are longer than the matches we have been found + // before. So before we test the whole byte sequence at + // the given distance, we test the first byte that would + // make the match longer. If it doesn't match the byte + // to match, we don't to care any longer. + i := t.dict.buf.rear - dist + m.n + if i < 0 { + i += len(t.dict.buf.data) + } + if t.dict.buf.data[i] != data[m.n] { + // We can't get a longer match. Jump to the next + // distance. + continue + } + + n := t.dict.buf.matchLen(dist, data) + switch n { + case 0: + continue + case 1: + if uint32(dist-minDistance) != rep[0] { + continue + } + } + if n > m.n { + m = match{int64(dist), n} + if n == len(data) { + // No better match will be found. + break + } + } + } + + if m.n == 0 { + return lit{data[0]} + } + return m +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/header.go b/vendor/github.com/ulikunitz/xz/lzma/header.go new file mode 100644 index 0000000..bc70896 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/header.go @@ -0,0 +1,167 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "fmt" +) + +// uint32LE reads an uint32 integer from a byte slice +func uint32LE(b []byte) uint32 { + x := uint32(b[3]) << 24 + x |= uint32(b[2]) << 16 + x |= uint32(b[1]) << 8 + x |= uint32(b[0]) + return x +} + +// uint64LE converts the uint64 value stored as little endian to an uint64 +// value. +func uint64LE(b []byte) uint64 { + x := uint64(b[7]) << 56 + x |= uint64(b[6]) << 48 + x |= uint64(b[5]) << 40 + x |= uint64(b[4]) << 32 + x |= uint64(b[3]) << 24 + x |= uint64(b[2]) << 16 + x |= uint64(b[1]) << 8 + x |= uint64(b[0]) + return x +} + +// putUint32LE puts an uint32 integer into a byte slice that must have at least +// a length of 4 bytes. +func putUint32LE(b []byte, x uint32) { + b[0] = byte(x) + b[1] = byte(x >> 8) + b[2] = byte(x >> 16) + b[3] = byte(x >> 24) +} + +// putUint64LE puts the uint64 value into the byte slice as little endian +// value. The byte slice b must have at least place for 8 bytes. +func putUint64LE(b []byte, x uint64) { + b[0] = byte(x) + b[1] = byte(x >> 8) + b[2] = byte(x >> 16) + b[3] = byte(x >> 24) + b[4] = byte(x >> 32) + b[5] = byte(x >> 40) + b[6] = byte(x >> 48) + b[7] = byte(x >> 56) +} + +// noHeaderSize defines the value of the length field in the LZMA header. +const noHeaderSize uint64 = 1<<64 - 1 + +// HeaderLen provides the length of the LZMA file header. +const HeaderLen = 13 + +// header represents the header of an LZMA file. +type header struct { + properties Properties + dictCap int + // uncompressed size; negative value if no size is given + size int64 +} + +// marshalBinary marshals the header. +func (h *header) marshalBinary() (data []byte, err error) { + if err = h.properties.verify(); err != nil { + return nil, err + } + if !(0 <= h.dictCap && int64(h.dictCap) <= MaxDictCap) { + return nil, fmt.Errorf("lzma: DictCap %d out of range", + h.dictCap) + } + + data = make([]byte, 13) + + // property byte + data[0] = h.properties.Code() + + // dictionary capacity + putUint32LE(data[1:5], uint32(h.dictCap)) + + // uncompressed size + var s uint64 + if h.size > 0 { + s = uint64(h.size) + } else { + s = noHeaderSize + } + putUint64LE(data[5:], s) + + return data, nil +} + +// unmarshalBinary unmarshals the header. +func (h *header) unmarshalBinary(data []byte) error { + if len(data) != HeaderLen { + return errors.New("lzma.unmarshalBinary: data has wrong length") + } + + // properties + var err error + if h.properties, err = PropertiesForCode(data[0]); err != nil { + return err + } + + // dictionary capacity + h.dictCap = int(uint32LE(data[1:])) + if h.dictCap < 0 { + return errors.New( + "LZMA header: dictionary capacity exceeds maximum " + + "integer") + } + + // uncompressed size + s := uint64LE(data[5:]) + if s == noHeaderSize { + h.size = -1 + } else { + h.size = int64(s) + if h.size < 0 { + return errors.New( + "LZMA header: uncompressed size " + + "out of int64 range") + } + } + + return nil +} + +// validDictCap checks whether the dictionary capacity is correct. This +// is used to weed out wrong file headers. +func validDictCap(dictcap int) bool { + if int64(dictcap) == MaxDictCap { + return true + } + for n := uint(10); n < 32; n++ { + if dictcap == 1<= 10 or 2^32-1. If +// there is an explicit size it must not exceed 256 GiB. The length of +// the data argument must be HeaderLen. +func ValidHeader(data []byte) bool { + var h header + if err := h.unmarshalBinary(data); err != nil { + return false + } + if !validDictCap(h.dictCap) { + return false + } + return h.size < 0 || h.size <= 1<<38 +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/header2.go b/vendor/github.com/ulikunitz/xz/lzma/header2.go new file mode 100644 index 0000000..ac6a71a --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/header2.go @@ -0,0 +1,398 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "fmt" + "io" +) + +const ( + // maximum size of compressed data in a chunk + maxCompressed = 1 << 16 + // maximum size of uncompressed data in a chunk + maxUncompressed = 1 << 21 +) + +// chunkType represents the type of an LZMA2 chunk. Note that this +// value is an internal representation and no actual encoding of a LZMA2 +// chunk header. +type chunkType byte + +// Possible values for the chunk type. +const ( + // end of stream + cEOS chunkType = iota + // uncompressed; reset dictionary + cUD + // uncompressed; no reset of dictionary + cU + // LZMA compressed; no reset + cL + // LZMA compressed; reset state + cLR + // LZMA compressed; reset state; new property value + cLRN + // LZMA compressed; reset state; new property value; reset dictionary + cLRND +) + +// chunkTypeStrings provide a string representation for the chunk types. +var chunkTypeStrings = [...]string{ + cEOS: "EOS", + cU: "U", + cUD: "UD", + cL: "L", + cLR: "LR", + cLRN: "LRN", + cLRND: "LRND", +} + +// String returns a string representation of the chunk type. +func (c chunkType) String() string { + if !(cEOS <= c && c <= cLRND) { + return "unknown" + } + return chunkTypeStrings[c] +} + +// Actual encodings for the chunk types in the value. Note that the high +// uncompressed size bits are stored in the header byte additionally. +const ( + hEOS = 0 + hUD = 1 + hU = 2 + hL = 1 << 7 + hLR = 1<<7 | 1<<5 + hLRN = 1<<7 | 1<<6 + hLRND = 1<<7 | 1<<6 | 1<<5 +) + +// errHeaderByte indicates an unsupported value for the chunk header +// byte. These bytes starts the variable-length chunk header. +var errHeaderByte = errors.New("lzma: unsupported chunk header byte") + +// headerChunkType converts the header byte into a chunk type. It +// ignores the uncompressed size bits in the chunk header byte. +func headerChunkType(h byte) (c chunkType, err error) { + if h&hL == 0 { + // no compression + switch h { + case hEOS: + c = cEOS + case hUD: + c = cUD + case hU: + c = cU + default: + return 0, errHeaderByte + } + return + } + switch h & hLRND { + case hL: + c = cL + case hLR: + c = cLR + case hLRN: + c = cLRN + case hLRND: + c = cLRND + default: + return 0, errHeaderByte + } + return +} + +// uncompressedHeaderLen provides the length of an uncompressed header +const uncompressedHeaderLen = 3 + +// headerLen returns the length of the LZMA2 header for a given chunk +// type. +func headerLen(c chunkType) int { + switch c { + case cEOS: + return 1 + case cU, cUD: + return uncompressedHeaderLen + case cL, cLR: + return 5 + case cLRN, cLRND: + return 6 + } + panic(fmt.Errorf("unsupported chunk type %d", c)) +} + +// chunkHeader represents the contents of a chunk header. +type chunkHeader struct { + ctype chunkType + uncompressed uint32 + compressed uint16 + props Properties +} + +// String returns a string representation of the chunk header. +func (h *chunkHeader) String() string { + return fmt.Sprintf("%s %d %d %s", h.ctype, h.uncompressed, + h.compressed, &h.props) +} + +// UnmarshalBinary reads the content of the chunk header from the data +// slice. The slice must have the correct length. +func (h *chunkHeader) UnmarshalBinary(data []byte) error { + if len(data) == 0 { + return errors.New("no data") + } + c, err := headerChunkType(data[0]) + if err != nil { + return err + } + + n := headerLen(c) + if len(data) < n { + return errors.New("incomplete data") + } + if len(data) > n { + return errors.New("invalid data length") + } + + *h = chunkHeader{ctype: c} + if c == cEOS { + return nil + } + + h.uncompressed = uint32(uint16BE(data[1:3])) + if c <= cU { + return nil + } + h.uncompressed |= uint32(data[0]&^hLRND) << 16 + + h.compressed = uint16BE(data[3:5]) + if c <= cLR { + return nil + } + + h.props, err = PropertiesForCode(data[5]) + return err +} + +// MarshalBinary encodes the chunk header value. The function checks +// whether the content of the chunk header is correct. +func (h *chunkHeader) MarshalBinary() (data []byte, err error) { + if h.ctype > cLRND { + return nil, errors.New("invalid chunk type") + } + if err = h.props.verify(); err != nil { + return nil, err + } + + data = make([]byte, headerLen(h.ctype)) + + switch h.ctype { + case cEOS: + return data, nil + case cUD: + data[0] = hUD + case cU: + data[0] = hU + case cL: + data[0] = hL + case cLR: + data[0] = hLR + case cLRN: + data[0] = hLRN + case cLRND: + data[0] = hLRND + } + + putUint16BE(data[1:3], uint16(h.uncompressed)) + if h.ctype <= cU { + return data, nil + } + data[0] |= byte(h.uncompressed>>16) &^ hLRND + + putUint16BE(data[3:5], h.compressed) + if h.ctype <= cLR { + return data, nil + } + + data[5] = h.props.Code() + return data, nil +} + +// readChunkHeader reads the chunk header from the IO reader. +func readChunkHeader(r io.Reader) (h *chunkHeader, err error) { + p := make([]byte, 1, 6) + if _, err = io.ReadFull(r, p); err != nil { + return + } + c, err := headerChunkType(p[0]) + if err != nil { + return + } + p = p[:headerLen(c)] + if _, err = io.ReadFull(r, p[1:]); err != nil { + return + } + h = new(chunkHeader) + if err = h.UnmarshalBinary(p); err != nil { + return nil, err + } + return h, nil +} + +// uint16BE converts a big-endian uint16 representation to an uint16 +// value. +func uint16BE(p []byte) uint16 { + return uint16(p[0])<<8 | uint16(p[1]) +} + +// putUint16BE puts the big-endian uint16 presentation into the given +// slice. +func putUint16BE(p []byte, x uint16) { + p[0] = byte(x >> 8) + p[1] = byte(x) +} + +// chunkState is used to manage the state of the chunks +type chunkState byte + +// start and stop define the initial and terminating state of the chunk +// state +const ( + start chunkState = 'S' + stop = 'T' +) + +// errors for the chunk state handling +var ( + errChunkType = errors.New("lzma: unexpected chunk type") + errState = errors.New("lzma: wrong chunk state") +) + +// next transitions state based on chunk type input +func (c *chunkState) next(ctype chunkType) error { + switch *c { + // start state + case 'S': + switch ctype { + case cEOS: + *c = 'T' + case cUD: + *c = 'R' + case cLRND: + *c = 'L' + default: + return errChunkType + } + // normal LZMA mode + case 'L': + switch ctype { + case cEOS: + *c = 'T' + case cUD: + *c = 'R' + case cU: + *c = 'U' + case cL, cLR, cLRN, cLRND: + break + default: + return errChunkType + } + // reset required + case 'R': + switch ctype { + case cEOS: + *c = 'T' + case cUD, cU: + break + case cLRN, cLRND: + *c = 'L' + default: + return errChunkType + } + // uncompressed + case 'U': + switch ctype { + case cEOS: + *c = 'T' + case cUD: + *c = 'R' + case cU: + break + case cL, cLR, cLRN, cLRND: + *c = 'L' + default: + return errChunkType + } + // terminal state + case 'T': + return errChunkType + default: + return errState + } + return nil +} + +// defaultChunkType returns the default chunk type for each chunk state. +func (c chunkState) defaultChunkType() chunkType { + switch c { + case 'S': + return cLRND + case 'L', 'U': + return cL + case 'R': + return cLRN + default: + // no error + return cEOS + } +} + +// maxDictCap defines the maximum dictionary capacity supported by the +// LZMA2 dictionary capacity encoding. +const maxDictCap = 1<<32 - 1 + +// maxDictCapCode defines the maximum dictionary capacity code. +const maxDictCapCode = 40 + +// The function decodes the dictionary capacity byte, but doesn't change +// for the correct range of the given byte. +func decodeDictCap(c byte) int64 { + return (2 | int64(c)&1) << (11 + (c>>1)&0x1f) +} + +// DecodeDictCap decodes the encoded dictionary capacity. The function +// returns an error if the code is out of range. +func DecodeDictCap(c byte) (n int64, err error) { + if c >= maxDictCapCode { + if c == maxDictCapCode { + return maxDictCap, nil + } + return 0, errors.New("lzma: invalid dictionary size code") + } + return decodeDictCap(c), nil +} + +// EncodeDictCap encodes a dictionary capacity. The function returns the +// code for the capacity that is greater or equal n. If n exceeds the +// maximum support dictionary capacity, the maximum value is returned. +func EncodeDictCap(n int64) byte { + a, b := byte(0), byte(40) + for a < b { + c := a + (b-a)>>1 + m := decodeDictCap(c) + if n <= m { + if n == m { + return c + } + b = c + } else { + a = c + 1 + } + } + return a +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go b/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go new file mode 100644 index 0000000..e517730 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go @@ -0,0 +1,129 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import "errors" + +// maxPosBits defines the number of bits of the position value that are used to +// to compute the posState value. The value is used to select the tree codec +// for length encoding and decoding. +const maxPosBits = 4 + +// minMatchLen and maxMatchLen give the minimum and maximum values for +// encoding and decoding length values. minMatchLen is also used as base +// for the encoded length values. +const ( + minMatchLen = 2 + maxMatchLen = minMatchLen + 16 + 256 - 1 +) + +// lengthCodec support the encoding of the length value. +type lengthCodec struct { + choice [2]prob + low [1 << maxPosBits]treeCodec + mid [1 << maxPosBits]treeCodec + high treeCodec +} + +// deepcopy initializes the lc value as deep copy of the source value. +func (lc *lengthCodec) deepcopy(src *lengthCodec) { + if lc == src { + return + } + lc.choice = src.choice + for i := range lc.low { + lc.low[i].deepcopy(&src.low[i]) + } + for i := range lc.mid { + lc.mid[i].deepcopy(&src.mid[i]) + } + lc.high.deepcopy(&src.high) +} + +// init initializes a new length codec. +func (lc *lengthCodec) init() { + for i := range lc.choice { + lc.choice[i] = probInit + } + for i := range lc.low { + lc.low[i] = makeTreeCodec(3) + } + for i := range lc.mid { + lc.mid[i] = makeTreeCodec(3) + } + lc.high = makeTreeCodec(8) +} + +// lBits gives the number of bits used for the encoding of the l value +// provided to the range encoder. +func lBits(l uint32) int { + switch { + case l < 8: + return 4 + case l < 16: + return 5 + default: + return 10 + } +} + +// Encode encodes the length offset. The length offset l can be compute by +// subtracting minMatchLen (2) from the actual length. +// +// l = length - minMatchLen +// +func (lc *lengthCodec) Encode(e *rangeEncoder, l uint32, posState uint32, +) (err error) { + if l > maxMatchLen-minMatchLen { + return errors.New("lengthCodec.Encode: l out of range") + } + if l < 8 { + if err = lc.choice[0].Encode(e, 0); err != nil { + return + } + return lc.low[posState].Encode(e, l) + } + if err = lc.choice[0].Encode(e, 1); err != nil { + return + } + if l < 16 { + if err = lc.choice[1].Encode(e, 0); err != nil { + return + } + return lc.mid[posState].Encode(e, l-8) + } + if err = lc.choice[1].Encode(e, 1); err != nil { + return + } + if err = lc.high.Encode(e, l-16); err != nil { + return + } + return nil +} + +// Decode reads the length offset. Add minMatchLen to compute the actual length +// to the length offset l. +func (lc *lengthCodec) Decode(d *rangeDecoder, posState uint32, +) (l uint32, err error) { + var b uint32 + if b, err = lc.choice[0].Decode(d); err != nil { + return + } + if b == 0 { + l, err = lc.low[posState].Decode(d) + return + } + if b, err = lc.choice[1].Decode(d); err != nil { + return + } + if b == 0 { + l, err = lc.mid[posState].Decode(d) + l += 8 + return + } + l, err = lc.high.Decode(d) + l += 16 + return +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go b/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go new file mode 100644 index 0000000..c949d6e --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go @@ -0,0 +1,132 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +// literalCodec supports the encoding of literal. It provides 768 probability +// values per literal state. The upper 512 probabilities are used with the +// context of a match bit. +type literalCodec struct { + probs []prob +} + +// deepcopy initializes literal codec c as a deep copy of the source. +func (c *literalCodec) deepcopy(src *literalCodec) { + if c == src { + return + } + c.probs = make([]prob, len(src.probs)) + copy(c.probs, src.probs) +} + +// init initializes the literal codec. +func (c *literalCodec) init(lc, lp int) { + switch { + case !(minLC <= lc && lc <= maxLC): + panic("lc out of range") + case !(minLP <= lp && lp <= maxLP): + panic("lp out of range") + } + c.probs = make([]prob, 0x300<= 7 { + m := uint32(match) + for { + matchBit := (m >> 7) & 1 + m <<= 1 + bit := (r >> 7) & 1 + r <<= 1 + i := ((1 + matchBit) << 8) | symbol + if err = probs[i].Encode(e, bit); err != nil { + return + } + symbol = (symbol << 1) | bit + if matchBit != bit { + break + } + if symbol >= 0x100 { + break + } + } + } + for symbol < 0x100 { + bit := (r >> 7) & 1 + r <<= 1 + if err = probs[symbol].Encode(e, bit); err != nil { + return + } + symbol = (symbol << 1) | bit + } + return nil +} + +// Decode decodes a literal byte using the range decoder as well as the LZMA +// state, a match byte, and the literal state. +func (c *literalCodec) Decode(d *rangeDecoder, + state uint32, match byte, litState uint32, +) (s byte, err error) { + k := litState * 0x300 + probs := c.probs[k : k+0x300] + symbol := uint32(1) + if state >= 7 { + m := uint32(match) + for { + matchBit := (m >> 7) & 1 + m <<= 1 + i := ((1 + matchBit) << 8) | symbol + bit, err := d.DecodeBit(&probs[i]) + if err != nil { + return 0, err + } + symbol = (symbol << 1) | bit + if matchBit != bit { + break + } + if symbol >= 0x100 { + break + } + } + } + for symbol < 0x100 { + bit, err := d.DecodeBit(&probs[symbol]) + if err != nil { + return 0, err + } + symbol = (symbol << 1) | bit + } + s = byte(symbol - 0x100) + return s, nil +} + +// minLC and maxLC define the range for LC values. +const ( + minLC = 0 + maxLC = 8 +) + +// minLC and maxLC define the range for LP values. +const ( + minLP = 0 + maxLP = 4 +) + +// minState and maxState define a range for the state values stored in +// the State values. +const ( + minState = 0 + maxState = 11 +) diff --git a/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go b/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go new file mode 100644 index 0000000..4a244eb --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go @@ -0,0 +1,52 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import "errors" + +// MatchAlgorithm identifies an algorithm to find matches in the +// dictionary. +type MatchAlgorithm byte + +// Supported matcher algorithms. +const ( + HashTable4 MatchAlgorithm = iota + BinaryTree +) + +// maStrings are used by the String method. +var maStrings = map[MatchAlgorithm]string{ + HashTable4: "HashTable4", + BinaryTree: "BinaryTree", +} + +// String returns a string representation of the Matcher. +func (a MatchAlgorithm) String() string { + if s, ok := maStrings[a]; ok { + return s + } + return "unknown" +} + +var errUnsupportedMatchAlgorithm = errors.New( + "lzma: unsupported match algorithm value") + +// verify checks whether the matcher value is supported. +func (a MatchAlgorithm) verify() error { + if _, ok := maStrings[a]; !ok { + return errUnsupportedMatchAlgorithm + } + return nil +} + +func (a MatchAlgorithm) new(dictCap int) (m matcher, err error) { + switch a { + case HashTable4: + return newHashTable(dictCap, 4) + case BinaryTree: + return newBinTree(dictCap) + } + return nil, errUnsupportedMatchAlgorithm +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/operation.go b/vendor/github.com/ulikunitz/xz/lzma/operation.go new file mode 100644 index 0000000..733bb99 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/operation.go @@ -0,0 +1,80 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "fmt" + "unicode" +) + +// operation represents an operation on the dictionary during encoding or +// decoding. +type operation interface { + Len() int +} + +// rep represents a repetition at the given distance and the given length +type match struct { + // supports all possible distance values, including the eos marker + distance int64 + // length + n int +} + +// verify checks whether the match is valid. If that is not the case an +// error is returned. +func (m match) verify() error { + if !(minDistance <= m.distance && m.distance <= maxDistance) { + return errors.New("distance out of range") + } + if !(1 <= m.n && m.n <= maxMatchLen) { + return errors.New("length out of range") + } + return nil +} + +// l return the l-value for the match, which is the difference of length +// n and 2. +func (m match) l() uint32 { + return uint32(m.n - minMatchLen) +} + +// dist returns the dist value for the match, which is one less of the +// distance stored in the match. +func (m match) dist() uint32 { + return uint32(m.distance - minDistance) +} + +// Len returns the number of bytes matched. +func (m match) Len() int { + return m.n +} + +// String returns a string representation for the repetition. +func (m match) String() string { + return fmt.Sprintf("M{%d,%d}", m.distance, m.n) +} + +// lit represents a single byte literal. +type lit struct { + b byte +} + +// Len returns 1 for the single byte literal. +func (l lit) Len() int { + return 1 +} + +// String returns a string representation for the literal. +func (l lit) String() string { + var c byte + if unicode.IsPrint(rune(l.b)) { + c = l.b + } else { + c = '.' + } + return fmt.Sprintf("L{%c/%02x}", c, l.b) +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/prob.go b/vendor/github.com/ulikunitz/xz/lzma/prob.go new file mode 100644 index 0000000..24d50ec --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/prob.go @@ -0,0 +1,53 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +// movebits defines the number of bits used for the updates of probability +// values. +const movebits = 5 + +// probbits defines the number of bits of a probability value. +const probbits = 11 + +// probInit defines 0.5 as initial value for prob values. +const probInit prob = 1 << (probbits - 1) + +// Type prob represents probabilities. The type can also be used to encode and +// decode single bits. +type prob uint16 + +// Dec decreases the probability. The decrease is proportional to the +// probability value. +func (p *prob) dec() { + *p -= *p >> movebits +} + +// Inc increases the probability. The Increase is proportional to the +// difference of 1 and the probability value. +func (p *prob) inc() { + *p += ((1 << probbits) - *p) >> movebits +} + +// Computes the new bound for a given range using the probability value. +func (p prob) bound(r uint32) uint32 { + return (r >> probbits) * uint32(p) +} + +// Bits returns 1. One is the number of bits that can be encoded or decoded +// with a single prob value. +func (p prob) Bits() int { + return 1 +} + +// Encode encodes the least-significant bit of v. Note that the p value will be +// changed. +func (p *prob) Encode(e *rangeEncoder, v uint32) error { + return e.EncodeBit(v, p) +} + +// Decode decodes a single bit. Note that the p value will change. +func (p *prob) Decode(d *rangeDecoder) (v uint32, err error) { + return d.DecodeBit(p) +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/properties.go b/vendor/github.com/ulikunitz/xz/lzma/properties.go new file mode 100644 index 0000000..23418e2 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/properties.go @@ -0,0 +1,69 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "fmt" +) + +// maximum and minimum values for the LZMA properties. +const ( + minPB = 0 + maxPB = 4 +) + +// maxPropertyCode is the possible maximum of a properties code byte. +const maxPropertyCode = (maxPB+1)*(maxLP+1)*(maxLC+1) - 1 + +// Properties contains the parameters LC, LP and PB. The parameter LC +// defines the number of literal context bits; parameter LP the number +// of literal position bits and PB the number of position bits. +type Properties struct { + LC int + LP int + PB int +} + +// String returns the properties in a string representation. +func (p *Properties) String() string { + return fmt.Sprintf("LC %d LP %d PB %d", p.LC, p.LP, p.PB) +} + +// PropertiesForCode converts a properties code byte into a Properties value. +func PropertiesForCode(code byte) (p Properties, err error) { + if code > maxPropertyCode { + return p, errors.New("lzma: invalid properties code") + } + p.LC = int(code % 9) + code /= 9 + p.LP = int(code % 5) + code /= 5 + p.PB = int(code % 5) + return p, err +} + +// verify checks the properties for correctness. +func (p *Properties) verify() error { + if p == nil { + return errors.New("lzma: properties are nil") + } + if !(minLC <= p.LC && p.LC <= maxLC) { + return errors.New("lzma: lc out of range") + } + if !(minLP <= p.LP && p.LP <= maxLP) { + return errors.New("lzma: lp out of range") + } + if !(minPB <= p.PB && p.PB <= maxPB) { + return errors.New("lzma: pb out of range") + } + return nil +} + +// Code converts the properties to a byte. The function assumes that +// the properties components are all in range. +func (p Properties) Code() byte { + return byte((p.PB*5+p.LP)*9 + p.LC) +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go b/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go new file mode 100644 index 0000000..6361c5e --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go @@ -0,0 +1,248 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "io" +) + +// rangeEncoder implements range encoding of single bits. The low value can +// overflow therefore we need uint64. The cache value is used to handle +// overflows. +type rangeEncoder struct { + lbw *LimitedByteWriter + nrange uint32 + low uint64 + cacheLen int64 + cache byte +} + +// maxInt64 provides the maximal value of the int64 type +const maxInt64 = 1<<63 - 1 + +// newRangeEncoder creates a new range encoder. +func newRangeEncoder(bw io.ByteWriter) (re *rangeEncoder, err error) { + lbw, ok := bw.(*LimitedByteWriter) + if !ok { + lbw = &LimitedByteWriter{BW: bw, N: maxInt64} + } + return &rangeEncoder{ + lbw: lbw, + nrange: 0xffffffff, + cacheLen: 1}, nil +} + +// Available returns the number of bytes that still can be written. The +// method takes the bytes that will be currently written by Close into +// account. +func (e *rangeEncoder) Available() int64 { + return e.lbw.N - (e.cacheLen + 4) +} + +// writeByte writes a single byte to the underlying writer. An error is +// returned if the limit is reached. The written byte will be counted if +// the underlying writer doesn't return an error. +func (e *rangeEncoder) writeByte(c byte) error { + if e.Available() < 1 { + return ErrLimit + } + return e.lbw.WriteByte(c) +} + +// DirectEncodeBit encodes the least-significant bit of b with probability 1/2. +func (e *rangeEncoder) DirectEncodeBit(b uint32) error { + e.nrange >>= 1 + e.low += uint64(e.nrange) & (0 - (uint64(b) & 1)) + + // normalize + const top = 1 << 24 + if e.nrange >= top { + return nil + } + e.nrange <<= 8 + return e.shiftLow() +} + +// EncodeBit encodes the least significant bit of b. The p value will be +// updated by the function depending on the bit encoded. +func (e *rangeEncoder) EncodeBit(b uint32, p *prob) error { + bound := p.bound(e.nrange) + if b&1 == 0 { + e.nrange = bound + p.inc() + } else { + e.low += uint64(bound) + e.nrange -= bound + p.dec() + } + + // normalize + const top = 1 << 24 + if e.nrange >= top { + return nil + } + e.nrange <<= 8 + return e.shiftLow() +} + +// Close writes a complete copy of the low value. +func (e *rangeEncoder) Close() error { + for i := 0; i < 5; i++ { + if err := e.shiftLow(); err != nil { + return err + } + } + return nil +} + +// shiftLow shifts the low value for 8 bit. The shifted byte is written into +// the byte writer. The cache value is used to handle overflows. +func (e *rangeEncoder) shiftLow() error { + if uint32(e.low) < 0xff000000 || (e.low>>32) != 0 { + tmp := e.cache + for { + err := e.writeByte(tmp + byte(e.low>>32)) + if err != nil { + return err + } + tmp = 0xff + e.cacheLen-- + if e.cacheLen <= 0 { + if e.cacheLen < 0 { + panic("negative cacheLen") + } + break + } + } + e.cache = byte(uint32(e.low) >> 24) + } + e.cacheLen++ + e.low = uint64(uint32(e.low) << 8) + return nil +} + +// rangeDecoder decodes single bits of the range encoding stream. +type rangeDecoder struct { + br io.ByteReader + nrange uint32 + code uint32 +} + +// init initializes the range decoder, by reading from the byte reader. +func (d *rangeDecoder) init() error { + d.nrange = 0xffffffff + d.code = 0 + + b, err := d.br.ReadByte() + if err != nil { + return err + } + if b != 0 { + return errors.New("newRangeDecoder: first byte not zero") + } + + for i := 0; i < 4; i++ { + if err = d.updateCode(); err != nil { + return err + } + } + + if d.code >= d.nrange { + return errors.New("newRangeDecoder: d.code >= d.nrange") + } + + return nil +} + +// newRangeDecoder initializes a range decoder. It reads five bytes from the +// reader and therefore may return an error. +func newRangeDecoder(br io.ByteReader) (d *rangeDecoder, err error) { + d = &rangeDecoder{br: br, nrange: 0xffffffff} + + b, err := d.br.ReadByte() + if err != nil { + return nil, err + } + if b != 0 { + return nil, errors.New("newRangeDecoder: first byte not zero") + } + + for i := 0; i < 4; i++ { + if err = d.updateCode(); err != nil { + return nil, err + } + } + + if d.code >= d.nrange { + return nil, errors.New("newRangeDecoder: d.code >= d.nrange") + } + + return d, nil +} + +// possiblyAtEnd checks whether the decoder may be at the end of the stream. +func (d *rangeDecoder) possiblyAtEnd() bool { + return d.code == 0 +} + +// DirectDecodeBit decodes a bit with probability 1/2. The return value b will +// contain the bit at the least-significant position. All other bits will be +// zero. +func (d *rangeDecoder) DirectDecodeBit() (b uint32, err error) { + d.nrange >>= 1 + d.code -= d.nrange + t := 0 - (d.code >> 31) + d.code += d.nrange & t + b = (t + 1) & 1 + + // d.code will stay less then d.nrange + + // normalize + // assume d.code < d.nrange + const top = 1 << 24 + if d.nrange >= top { + return b, nil + } + d.nrange <<= 8 + // d.code < d.nrange will be maintained + return b, d.updateCode() +} + +// decodeBit decodes a single bit. The bit will be returned at the +// least-significant position. All other bits will be zero. The probability +// value will be updated. +func (d *rangeDecoder) DecodeBit(p *prob) (b uint32, err error) { + bound := p.bound(d.nrange) + if d.code < bound { + d.nrange = bound + p.inc() + b = 0 + } else { + d.code -= bound + d.nrange -= bound + p.dec() + b = 1 + } + // normalize + // assume d.code < d.nrange + const top = 1 << 24 + if d.nrange >= top { + return b, nil + } + d.nrange <<= 8 + // d.code < d.nrange will be maintained + return b, d.updateCode() +} + +// updateCode reads a new byte into the code. +func (d *rangeDecoder) updateCode() error { + b, err := d.br.ReadByte() + if err != nil { + return err + } + d.code = (d.code << 8) | uint32(b) + return nil +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/reader.go b/vendor/github.com/ulikunitz/xz/lzma/reader.go new file mode 100644 index 0000000..2ef3dca --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/reader.go @@ -0,0 +1,100 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package lzma supports the decoding and encoding of LZMA streams. +// Reader and Writer support the classic LZMA format. Reader2 and +// Writer2 support the decoding and encoding of LZMA2 streams. +// +// The package is written completely in Go and doesn't rely on any external +// library. +package lzma + +import ( + "errors" + "io" +) + +// ReaderConfig stores the parameters for the reader of the classic LZMA +// format. +type ReaderConfig struct { + DictCap int +} + +// fill converts the zero values of the configuration to the default values. +func (c *ReaderConfig) fill() { + if c.DictCap == 0 { + c.DictCap = 8 * 1024 * 1024 + } +} + +// Verify checks the reader configuration for errors. Zero values will +// be replaced by default values. +func (c *ReaderConfig) Verify() error { + c.fill() + if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { + return errors.New("lzma: dictionary capacity is out of range") + } + return nil +} + +// Reader provides a reader for LZMA files or streams. +type Reader struct { + lzma io.Reader + h header + d *decoder +} + +// NewReader creates a new reader for an LZMA stream using the classic +// format. NewReader reads and checks the header of the LZMA stream. +func NewReader(lzma io.Reader) (r *Reader, err error) { + return ReaderConfig{}.NewReader(lzma) +} + +// NewReader creates a new reader for an LZMA stream in the classic +// format. The function reads and verifies the the header of the LZMA +// stream. +func (c ReaderConfig) NewReader(lzma io.Reader) (r *Reader, err error) { + if err = c.Verify(); err != nil { + return nil, err + } + data := make([]byte, HeaderLen) + if _, err := io.ReadFull(lzma, data); err != nil { + if err == io.EOF { + return nil, errors.New("lzma: unexpected EOF") + } + return nil, err + } + r = &Reader{lzma: lzma} + if err = r.h.unmarshalBinary(data); err != nil { + return nil, err + } + if r.h.dictCap < MinDictCap { + return nil, errors.New("lzma: dictionary capacity too small") + } + dictCap := r.h.dictCap + if c.DictCap > dictCap { + dictCap = c.DictCap + } + + state := newState(r.h.properties) + dict, err := newDecoderDict(dictCap) + if err != nil { + return nil, err + } + r.d, err = newDecoder(ByteReader(lzma), state, dict, r.h.size) + if err != nil { + return nil, err + } + return r, nil +} + +// EOSMarker indicates that an EOS marker has been encountered. +func (r *Reader) EOSMarker() bool { + return r.d.eosMarker +} + +// Read returns uncompressed data. +func (r *Reader) Read(p []byte) (n int, err error) { + return r.d.Read(p) +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/reader2.go b/vendor/github.com/ulikunitz/xz/lzma/reader2.go new file mode 100644 index 0000000..a55cfaa --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/reader2.go @@ -0,0 +1,232 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "errors" + "io" + + "github.com/ulikunitz/xz/internal/xlog" +) + +// Reader2Config stores the parameters for the LZMA2 reader. +// format. +type Reader2Config struct { + DictCap int +} + +// fill converts the zero values of the configuration to the default values. +func (c *Reader2Config) fill() { + if c.DictCap == 0 { + c.DictCap = 8 * 1024 * 1024 + } +} + +// Verify checks the reader configuration for errors. Zero configuration values +// will be replaced by default values. +func (c *Reader2Config) Verify() error { + c.fill() + if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { + return errors.New("lzma: dictionary capacity is out of range") + } + return nil +} + +// Reader2 supports the reading of LZMA2 chunk sequences. Note that the +// first chunk should have a dictionary reset and the first compressed +// chunk a properties reset. The chunk sequence may not be terminated by +// an end-of-stream chunk. +type Reader2 struct { + r io.Reader + err error + + dict *decoderDict + ur *uncompressedReader + decoder *decoder + chunkReader io.Reader + + cstate chunkState + ctype chunkType +} + +// NewReader2 creates a reader for an LZMA2 chunk sequence. +func NewReader2(lzma2 io.Reader) (r *Reader2, err error) { + return Reader2Config{}.NewReader2(lzma2) +} + +// NewReader2 creates an LZMA2 reader using the given configuration. +func (c Reader2Config) NewReader2(lzma2 io.Reader) (r *Reader2, err error) { + if err = c.Verify(); err != nil { + return nil, err + } + r = &Reader2{r: lzma2, cstate: start} + r.dict, err = newDecoderDict(c.DictCap) + if err != nil { + return nil, err + } + if err = r.startChunk(); err != nil { + r.err = err + } + return r, nil +} + +// uncompressed tests whether the chunk type specifies an uncompressed +// chunk. +func uncompressed(ctype chunkType) bool { + return ctype == cU || ctype == cUD +} + +// startChunk parses a new chunk. +func (r *Reader2) startChunk() error { + r.chunkReader = nil + header, err := readChunkHeader(r.r) + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return err + } + xlog.Debugf("chunk header %v", header) + if err = r.cstate.next(header.ctype); err != nil { + return err + } + if r.cstate == stop { + return io.EOF + } + if header.ctype == cUD || header.ctype == cLRND { + r.dict.Reset() + } + size := int64(header.uncompressed) + 1 + if uncompressed(header.ctype) { + if r.ur != nil { + r.ur.Reopen(r.r, size) + } else { + r.ur = newUncompressedReader(r.r, r.dict, size) + } + r.chunkReader = r.ur + return nil + } + br := ByteReader(io.LimitReader(r.r, int64(header.compressed)+1)) + if r.decoder == nil { + state := newState(header.props) + r.decoder, err = newDecoder(br, state, r.dict, size) + if err != nil { + return err + } + r.chunkReader = r.decoder + return nil + } + switch header.ctype { + case cLR: + r.decoder.State.Reset() + case cLRN, cLRND: + r.decoder.State = newState(header.props) + } + err = r.decoder.Reopen(br, size) + if err != nil { + return err + } + r.chunkReader = r.decoder + return nil +} + +// Read reads data from the LZMA2 chunk sequence. +func (r *Reader2) Read(p []byte) (n int, err error) { + if r.err != nil { + return 0, r.err + } + for n < len(p) { + var k int + k, err = r.chunkReader.Read(p[n:]) + n += k + if err != nil { + if err == io.EOF { + err = r.startChunk() + if err == nil { + continue + } + } + r.err = err + return n, err + } + if k == 0 { + r.err = errors.New("lzma: Reader2 doesn't get data") + return n, r.err + } + } + return n, nil +} + +// EOS returns whether the LZMA2 stream has been terminated by an +// end-of-stream chunk. +func (r *Reader2) EOS() bool { + return r.cstate == stop +} + +// uncompressedReader is used to read uncompressed chunks. +type uncompressedReader struct { + lr io.LimitedReader + Dict *decoderDict + eof bool + err error +} + +// newUncompressedReader initializes a new uncompressedReader. +func newUncompressedReader(r io.Reader, dict *decoderDict, size int64) *uncompressedReader { + ur := &uncompressedReader{ + lr: io.LimitedReader{R: r, N: size}, + Dict: dict, + } + return ur +} + +// Reopen reinitializes an uncompressed reader. +func (ur *uncompressedReader) Reopen(r io.Reader, size int64) { + ur.err = nil + ur.eof = false + ur.lr = io.LimitedReader{R: r, N: size} +} + +// fill reads uncompressed data into the dictionary. +func (ur *uncompressedReader) fill() error { + if !ur.eof { + n, err := io.CopyN(ur.Dict, &ur.lr, int64(ur.Dict.Available())) + if err != io.EOF { + return err + } + ur.eof = true + if n > 0 { + return nil + } + } + if ur.lr.N != 0 { + return io.ErrUnexpectedEOF + } + return io.EOF +} + +// Read reads uncompressed data from the limited reader. +func (ur *uncompressedReader) Read(p []byte) (n int, err error) { + if ur.err != nil { + return 0, ur.err + } + for { + var k int + k, err = ur.Dict.Read(p[n:]) + n += k + if n >= len(p) { + return n, nil + } + if err != nil { + break + } + err = ur.fill() + if err != nil { + break + } + } + ur.err = err + return n, err +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/state.go b/vendor/github.com/ulikunitz/xz/lzma/state.go new file mode 100644 index 0000000..5023510 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/state.go @@ -0,0 +1,151 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +// states defines the overall state count +const states = 12 + +// State maintains the full state of the operation encoding or decoding +// process. +type state struct { + rep [4]uint32 + isMatch [states << maxPosBits]prob + isRepG0Long [states << maxPosBits]prob + isRep [states]prob + isRepG0 [states]prob + isRepG1 [states]prob + isRepG2 [states]prob + litCodec literalCodec + lenCodec lengthCodec + repLenCodec lengthCodec + distCodec distCodec + state uint32 + posBitMask uint32 + Properties Properties +} + +// initProbSlice initializes a slice of probabilities. +func initProbSlice(p []prob) { + for i := range p { + p[i] = probInit + } +} + +// Reset sets all state information to the original values. +func (s *state) Reset() { + p := s.Properties + *s = state{ + Properties: p, + // dict: s.dict, + posBitMask: (uint32(1) << uint(p.PB)) - 1, + } + initProbSlice(s.isMatch[:]) + initProbSlice(s.isRep[:]) + initProbSlice(s.isRepG0[:]) + initProbSlice(s.isRepG1[:]) + initProbSlice(s.isRepG2[:]) + initProbSlice(s.isRepG0Long[:]) + s.litCodec.init(p.LC, p.LP) + s.lenCodec.init() + s.repLenCodec.init() + s.distCodec.init() +} + +// initState initializes the state. +func initState(s *state, p Properties) { + *s = state{Properties: p} + s.Reset() +} + +// newState creates a new state from the give Properties. +func newState(p Properties) *state { + s := &state{Properties: p} + s.Reset() + return s +} + +// deepcopy initializes s as a deep copy of the source. +func (s *state) deepcopy(src *state) { + if s == src { + return + } + s.rep = src.rep + s.isMatch = src.isMatch + s.isRepG0Long = src.isRepG0Long + s.isRep = src.isRep + s.isRepG0 = src.isRepG0 + s.isRepG1 = src.isRepG1 + s.isRepG2 = src.isRepG2 + s.litCodec.deepcopy(&src.litCodec) + s.lenCodec.deepcopy(&src.lenCodec) + s.repLenCodec.deepcopy(&src.repLenCodec) + s.distCodec.deepcopy(&src.distCodec) + s.state = src.state + s.posBitMask = src.posBitMask + s.Properties = src.Properties +} + +// cloneState creates a new clone of the give state. +func cloneState(src *state) *state { + s := new(state) + s.deepcopy(src) + return s +} + +// updateStateLiteral updates the state for a literal. +func (s *state) updateStateLiteral() { + switch { + case s.state < 4: + s.state = 0 + return + case s.state < 10: + s.state -= 3 + return + } + s.state -= 6 +} + +// updateStateMatch updates the state for a match. +func (s *state) updateStateMatch() { + if s.state < 7 { + s.state = 7 + } else { + s.state = 10 + } +} + +// updateStateRep updates the state for a repetition. +func (s *state) updateStateRep() { + if s.state < 7 { + s.state = 8 + } else { + s.state = 11 + } +} + +// updateStateShortRep updates the state for a short repetition. +func (s *state) updateStateShortRep() { + if s.state < 7 { + s.state = 9 + } else { + s.state = 11 + } +} + +// states computes the states of the operation codec. +func (s *state) states(dictHead int64) (state1, state2, posState uint32) { + state1 = s.state + posState = uint32(dictHead) & s.posBitMask + state2 = (s.state << maxPosBits) | posState + return +} + +// litState computes the literal state. +func (s *state) litState(prev byte, dictHead int64) uint32 { + lp, lc := uint(s.Properties.LP), uint(s.Properties.LC) + litState := ((uint32(dictHead) & ((1 << lp) - 1)) << lc) | + (uint32(prev) >> (8 - lc)) + return litState +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go b/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go new file mode 100644 index 0000000..504b3d7 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go @@ -0,0 +1,133 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +// treeCodec encodes or decodes values with a fixed bit size. It is using a +// tree of probability value. The root of the tree is the most-significant bit. +type treeCodec struct { + probTree +} + +// makeTreeCodec makes a tree codec. The bits value must be inside the range +// [1,32]. +func makeTreeCodec(bits int) treeCodec { + return treeCodec{makeProbTree(bits)} +} + +// deepcopy initializes tc as a deep copy of the source. +func (tc *treeCodec) deepcopy(src *treeCodec) { + tc.probTree.deepcopy(&src.probTree) +} + +// Encode uses the range encoder to encode a fixed-bit-size value. +func (tc *treeCodec) Encode(e *rangeEncoder, v uint32) (err error) { + m := uint32(1) + for i := int(tc.bits) - 1; i >= 0; i-- { + b := (v >> uint(i)) & 1 + if err := e.EncodeBit(b, &tc.probs[m]); err != nil { + return err + } + m = (m << 1) | b + } + return nil +} + +// Decodes uses the range decoder to decode a fixed-bit-size value. Errors may +// be caused by the range decoder. +func (tc *treeCodec) Decode(d *rangeDecoder) (v uint32, err error) { + m := uint32(1) + for j := 0; j < int(tc.bits); j++ { + b, err := d.DecodeBit(&tc.probs[m]) + if err != nil { + return 0, err + } + m = (m << 1) | b + } + return m - (1 << uint(tc.bits)), nil +} + +// treeReverseCodec is another tree codec, where the least-significant bit is +// the start of the probability tree. +type treeReverseCodec struct { + probTree +} + +// deepcopy initializes the treeReverseCodec as a deep copy of the +// source. +func (tc *treeReverseCodec) deepcopy(src *treeReverseCodec) { + tc.probTree.deepcopy(&src.probTree) +} + +// makeTreeReverseCodec creates treeReverseCodec value. The bits argument must +// be in the range [1,32]. +func makeTreeReverseCodec(bits int) treeReverseCodec { + return treeReverseCodec{makeProbTree(bits)} +} + +// Encode uses range encoder to encode a fixed-bit-size value. The range +// encoder may cause errors. +func (tc *treeReverseCodec) Encode(v uint32, e *rangeEncoder) (err error) { + m := uint32(1) + for i := uint(0); i < uint(tc.bits); i++ { + b := (v >> i) & 1 + if err := e.EncodeBit(b, &tc.probs[m]); err != nil { + return err + } + m = (m << 1) | b + } + return nil +} + +// Decodes uses the range decoder to decode a fixed-bit-size value. Errors +// returned by the range decoder will be returned. +func (tc *treeReverseCodec) Decode(d *rangeDecoder) (v uint32, err error) { + m := uint32(1) + for j := uint(0); j < uint(tc.bits); j++ { + b, err := d.DecodeBit(&tc.probs[m]) + if err != nil { + return 0, err + } + m = (m << 1) | b + v |= b << j + } + return v, nil +} + +// probTree stores enough probability values to be used by the treeEncode and +// treeDecode methods of the range coder types. +type probTree struct { + probs []prob + bits byte +} + +// deepcopy initializes the probTree value as a deep copy of the source. +func (t *probTree) deepcopy(src *probTree) { + if t == src { + return + } + t.probs = make([]prob, len(src.probs)) + copy(t.probs, src.probs) + t.bits = src.bits +} + +// makeProbTree initializes a probTree structure. +func makeProbTree(bits int) probTree { + if !(1 <= bits && bits <= 32) { + panic("bits outside of range [1,32]") + } + t := probTree{ + bits: byte(bits), + probs: make([]prob, 1< 0 { + c.SizeInHeader = true + } + if !c.SizeInHeader { + c.EOSMarker = true + } +} + +// Verify checks WriterConfig for errors. Verify will replace zero +// values with default values. +func (c *WriterConfig) Verify() error { + c.fill() + var err error + if c == nil { + return errors.New("lzma: WriterConfig is nil") + } + if c.Properties == nil { + return errors.New("lzma: WriterConfig has no Properties set") + } + if err = c.Properties.verify(); err != nil { + return err + } + if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { + return errors.New("lzma: dictionary capacity is out of range") + } + if !(maxMatchLen <= c.BufSize) { + return errors.New("lzma: lookahead buffer size too small") + } + if c.SizeInHeader { + if c.Size < 0 { + return errors.New("lzma: negative size not supported") + } + } else if !c.EOSMarker { + return errors.New("lzma: EOS marker is required") + } + if err = c.Matcher.verify(); err != nil { + return err + } + + return nil +} + +// header returns the header structure for this configuration. +func (c *WriterConfig) header() header { + h := header{ + properties: *c.Properties, + dictCap: c.DictCap, + size: -1, + } + if c.SizeInHeader { + h.size = c.Size + } + return h +} + +// Writer writes an LZMA stream in the classic format. +type Writer struct { + h header + bw io.ByteWriter + buf *bufio.Writer + e *encoder +} + +// NewWriter creates a new LZMA writer for the classic format. The +// method will write the header to the underlying stream. +func (c WriterConfig) NewWriter(lzma io.Writer) (w *Writer, err error) { + if err = c.Verify(); err != nil { + return nil, err + } + w = &Writer{h: c.header()} + + var ok bool + w.bw, ok = lzma.(io.ByteWriter) + if !ok { + w.buf = bufio.NewWriter(lzma) + w.bw = w.buf + } + state := newState(w.h.properties) + m, err := c.Matcher.new(w.h.dictCap) + if err != nil { + return nil, err + } + dict, err := newEncoderDict(w.h.dictCap, c.BufSize, m) + if err != nil { + return nil, err + } + var flags encoderFlags + if c.EOSMarker { + flags = eosMarker + } + if w.e, err = newEncoder(w.bw, state, dict, flags); err != nil { + return nil, err + } + + if err = w.writeHeader(); err != nil { + return nil, err + } + return w, nil +} + +// NewWriter creates a new LZMA writer using the classic format. The +// function writes the header to the underlying stream. +func NewWriter(lzma io.Writer) (w *Writer, err error) { + return WriterConfig{}.NewWriter(lzma) +} + +// writeHeader writes the LZMA header into the stream. +func (w *Writer) writeHeader() error { + data, err := w.h.marshalBinary() + if err != nil { + return err + } + _, err = w.bw.(io.Writer).Write(data) + return err +} + +// Write puts data into the Writer. +func (w *Writer) Write(p []byte) (n int, err error) { + if w.h.size >= 0 { + m := w.h.size + m -= w.e.Compressed() + int64(w.e.dict.Buffered()) + if m < 0 { + m = 0 + } + if m < int64(len(p)) { + p = p[:m] + err = ErrNoSpace + } + } + var werr error + if n, werr = w.e.Write(p); werr != nil { + err = werr + } + return n, err +} + +// Close closes the writer stream. It ensures that all data from the +// buffer will be compressed and the LZMA stream will be finished. +func (w *Writer) Close() error { + if w.h.size >= 0 { + n := w.e.Compressed() + int64(w.e.dict.Buffered()) + if n != w.h.size { + return errSize + } + } + err := w.e.Close() + if w.buf != nil { + ferr := w.buf.Flush() + if err == nil { + err = ferr + } + } + return err +} diff --git a/vendor/github.com/ulikunitz/xz/lzma/writer2.go b/vendor/github.com/ulikunitz/xz/lzma/writer2.go new file mode 100644 index 0000000..7c1afe1 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzma/writer2.go @@ -0,0 +1,305 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzma + +import ( + "bytes" + "errors" + "io" +) + +// Writer2Config is used to create a Writer2 using parameters. +type Writer2Config struct { + // The properties for the encoding. If the it is nil the value + // {LC: 3, LP: 0, PB: 2} will be chosen. + Properties *Properties + // The capacity of the dictionary. If DictCap is zero, the value + // 8 MiB will be chosen. + DictCap int + // Size of the lookahead buffer; value 0 indicates default size + // 4096 + BufSize int + // Match algorithm + Matcher MatchAlgorithm +} + +// fill replaces zero values with default values. +func (c *Writer2Config) fill() { + if c.Properties == nil { + c.Properties = &Properties{LC: 3, LP: 0, PB: 2} + } + if c.DictCap == 0 { + c.DictCap = 8 * 1024 * 1024 + } + if c.BufSize == 0 { + c.BufSize = 4096 + } +} + +// Verify checks the Writer2Config for correctness. Zero values will be +// replaced by default values. +func (c *Writer2Config) Verify() error { + c.fill() + var err error + if c == nil { + return errors.New("lzma: WriterConfig is nil") + } + if c.Properties == nil { + return errors.New("lzma: WriterConfig has no Properties set") + } + if err = c.Properties.verify(); err != nil { + return err + } + if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { + return errors.New("lzma: dictionary capacity is out of range") + } + if !(maxMatchLen <= c.BufSize) { + return errors.New("lzma: lookahead buffer size too small") + } + if c.Properties.LC+c.Properties.LP > 4 { + return errors.New("lzma: sum of lc and lp exceeds 4") + } + if err = c.Matcher.verify(); err != nil { + return err + } + return nil +} + +// Writer2 supports the creation of an LZMA2 stream. But note that +// written data is buffered, so call Flush or Close to write data to the +// underlying writer. The Close method writes the end-of-stream marker +// to the stream. So you may be able to concatenate the output of two +// writers as long the output of the first writer has only been flushed +// but not closed. +// +// Any change to the fields Properties, DictCap must be done before the +// first call to Write, Flush or Close. +type Writer2 struct { + w io.Writer + + start *state + encoder *encoder + + cstate chunkState + ctype chunkType + + buf bytes.Buffer + lbw LimitedByteWriter +} + +// NewWriter2 creates an LZMA2 chunk sequence writer with the default +// parameters and options. +func NewWriter2(lzma2 io.Writer) (w *Writer2, err error) { + return Writer2Config{}.NewWriter2(lzma2) +} + +// NewWriter2 creates a new LZMA2 writer using the given configuration. +func (c Writer2Config) NewWriter2(lzma2 io.Writer) (w *Writer2, err error) { + if err = c.Verify(); err != nil { + return nil, err + } + w = &Writer2{ + w: lzma2, + start: newState(*c.Properties), + cstate: start, + ctype: start.defaultChunkType(), + } + w.buf.Grow(maxCompressed) + w.lbw = LimitedByteWriter{BW: &w.buf, N: maxCompressed} + m, err := c.Matcher.new(c.DictCap) + if err != nil { + return nil, err + } + d, err := newEncoderDict(c.DictCap, c.BufSize, m) + if err != nil { + return nil, err + } + w.encoder, err = newEncoder(&w.lbw, cloneState(w.start), d, 0) + if err != nil { + return nil, err + } + return w, nil +} + +// written returns the number of bytes written to the current chunk +func (w *Writer2) written() int { + if w.encoder == nil { + return 0 + } + return int(w.encoder.Compressed()) + w.encoder.dict.Buffered() +} + +// errClosed indicates that the writer is closed. +var errClosed = errors.New("lzma: writer closed") + +// Writes data to LZMA2 stream. Note that written data will be buffered. +// Use Flush or Close to ensure that data is written to the underlying +// writer. +func (w *Writer2) Write(p []byte) (n int, err error) { + if w.cstate == stop { + return 0, errClosed + } + for n < len(p) { + m := maxUncompressed - w.written() + if m <= 0 { + panic("lzma: maxUncompressed reached") + } + var q []byte + if n+m < len(p) { + q = p[n : n+m] + } else { + q = p[n:] + } + k, err := w.encoder.Write(q) + n += k + if err != nil && err != ErrLimit { + return n, err + } + if err == ErrLimit || k == m { + if err = w.flushChunk(); err != nil { + return n, err + } + } + } + return n, nil +} + +// writeUncompressedChunk writes an uncompressed chunk to the LZMA2 +// stream. +func (w *Writer2) writeUncompressedChunk() error { + u := w.encoder.Compressed() + if u <= 0 { + return errors.New("lzma: can't write empty uncompressed chunk") + } + if u > maxUncompressed { + panic("overrun of uncompressed data limit") + } + switch w.ctype { + case cLRND: + w.ctype = cUD + default: + w.ctype = cU + } + w.encoder.state = w.start + + header := chunkHeader{ + ctype: w.ctype, + uncompressed: uint32(u - 1), + } + hdata, err := header.MarshalBinary() + if err != nil { + return err + } + if _, err = w.w.Write(hdata); err != nil { + return err + } + _, err = w.encoder.dict.CopyN(w.w, int(u)) + return err +} + +// writeCompressedChunk writes a compressed chunk to the underlying +// writer. +func (w *Writer2) writeCompressedChunk() error { + if w.ctype == cU || w.ctype == cUD { + panic("chunk type uncompressed") + } + + u := w.encoder.Compressed() + if u <= 0 { + return errors.New("writeCompressedChunk: empty chunk") + } + if u > maxUncompressed { + panic("overrun of uncompressed data limit") + } + c := w.buf.Len() + if c <= 0 { + panic("no compressed data") + } + if c > maxCompressed { + panic("overrun of compressed data limit") + } + header := chunkHeader{ + ctype: w.ctype, + uncompressed: uint32(u - 1), + compressed: uint16(c - 1), + props: w.encoder.state.Properties, + } + hdata, err := header.MarshalBinary() + if err != nil { + return err + } + if _, err = w.w.Write(hdata); err != nil { + return err + } + _, err = io.Copy(w.w, &w.buf) + return err +} + +// writes a single chunk to the underlying writer. +func (w *Writer2) writeChunk() error { + u := int(uncompressedHeaderLen + w.encoder.Compressed()) + c := headerLen(w.ctype) + w.buf.Len() + if u < c { + return w.writeUncompressedChunk() + } + return w.writeCompressedChunk() +} + +// flushChunk terminates the current chunk. The encoder will be reset +// to support the next chunk. +func (w *Writer2) flushChunk() error { + if w.written() == 0 { + return nil + } + var err error + if err = w.encoder.Close(); err != nil { + return err + } + if err = w.writeChunk(); err != nil { + return err + } + w.buf.Reset() + w.lbw.N = maxCompressed + if err = w.encoder.Reopen(&w.lbw); err != nil { + return err + } + if err = w.cstate.next(w.ctype); err != nil { + return err + } + w.ctype = w.cstate.defaultChunkType() + w.start = cloneState(w.encoder.state) + return nil +} + +// Flush writes all buffered data out to the underlying stream. This +// could result in multiple chunks to be created. +func (w *Writer2) Flush() error { + if w.cstate == stop { + return errClosed + } + for w.written() > 0 { + if err := w.flushChunk(); err != nil { + return err + } + } + return nil +} + +// Close terminates the LZMA2 stream with an EOS chunk. +func (w *Writer2) Close() error { + if w.cstate == stop { + return errClosed + } + if err := w.Flush(); err != nil { + return nil + } + // write zero byte EOS chunk + _, err := w.w.Write([]byte{0}) + if err != nil { + return err + } + w.cstate = stop + return nil +} diff --git a/vendor/github.com/ulikunitz/xz/lzmafilter.go b/vendor/github.com/ulikunitz/xz/lzmafilter.go new file mode 100644 index 0000000..69cf5f7 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/lzmafilter.go @@ -0,0 +1,117 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xz + +import ( + "errors" + "fmt" + "io" + + "github.com/ulikunitz/xz/lzma" +) + +// LZMA filter constants. +const ( + lzmaFilterID = 0x21 + lzmaFilterLen = 3 +) + +// lzmaFilter declares the LZMA2 filter information stored in an xz +// block header. +type lzmaFilter struct { + dictCap int64 +} + +// String returns a representation of the LZMA filter. +func (f lzmaFilter) String() string { + return fmt.Sprintf("LZMA dict cap %#x", f.dictCap) +} + +// id returns the ID for the LZMA2 filter. +func (f lzmaFilter) id() uint64 { return lzmaFilterID } + +// MarshalBinary converts the lzmaFilter in its encoded representation. +func (f lzmaFilter) MarshalBinary() (data []byte, err error) { + c := lzma.EncodeDictCap(f.dictCap) + return []byte{lzmaFilterID, 1, c}, nil +} + +// UnmarshalBinary unmarshals the given data representation of the LZMA2 +// filter. +func (f *lzmaFilter) UnmarshalBinary(data []byte) error { + if len(data) != lzmaFilterLen { + return errors.New("xz: data for LZMA2 filter has wrong length") + } + if data[0] != lzmaFilterID { + return errors.New("xz: wrong LZMA2 filter id") + } + if data[1] != 1 { + return errors.New("xz: wrong LZMA2 filter size") + } + dc, err := lzma.DecodeDictCap(data[2]) + if err != nil { + return errors.New("xz: wrong LZMA2 dictionary size property") + } + + f.dictCap = dc + return nil +} + +// reader creates a new reader for the LZMA2 filter. +func (f lzmaFilter) reader(r io.Reader, c *ReaderConfig) (fr io.Reader, + err error) { + + config := new(lzma.Reader2Config) + if c != nil { + config.DictCap = c.DictCap + } + dc := int(f.dictCap) + if dc < 1 { + return nil, errors.New("xz: LZMA2 filter parameter " + + "dictionary capacity overflow") + } + if dc > config.DictCap { + config.DictCap = dc + } + + fr, err = config.NewReader2(r) + if err != nil { + return nil, err + } + return fr, nil +} + +// writeCloser creates a io.WriteCloser for the LZMA2 filter. +func (f lzmaFilter) writeCloser(w io.WriteCloser, c *WriterConfig, +) (fw io.WriteCloser, err error) { + config := new(lzma.Writer2Config) + if c != nil { + *config = lzma.Writer2Config{ + Properties: c.Properties, + DictCap: c.DictCap, + BufSize: c.BufSize, + Matcher: c.Matcher, + } + } + + dc := int(f.dictCap) + if dc < 1 { + return nil, errors.New("xz: LZMA2 filter parameter " + + "dictionary capacity overflow") + } + if dc > config.DictCap { + config.DictCap = dc + } + + fw, err = config.NewWriter2(w) + if err != nil { + return nil, err + } + return fw, nil +} + +// last returns true, because an LZMA2 filter must be the last filter in +// the filter list. +func (f lzmaFilter) last() bool { return true } diff --git a/vendor/github.com/ulikunitz/xz/make-docs b/vendor/github.com/ulikunitz/xz/make-docs new file mode 100755 index 0000000..a8c612c --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/make-docs @@ -0,0 +1,5 @@ +#!/bin/sh + +set -x +pandoc -t html5 -f markdown -s --css=doc/md.css -o README.html README.md +pandoc -t html5 -f markdown -s --css=doc/md.css -o TODO.html TODO.md diff --git a/vendor/github.com/ulikunitz/xz/reader.go b/vendor/github.com/ulikunitz/xz/reader.go new file mode 100644 index 0000000..0634c6b --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/reader.go @@ -0,0 +1,373 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package xz supports the compression and decompression of xz files. It +// supports version 1.0.4 of the specification without the non-LZMA2 +// filters. See http://tukaani.org/xz/xz-file-format-1.0.4.txt +package xz + +import ( + "bytes" + "errors" + "fmt" + "hash" + "io" + + "github.com/ulikunitz/xz/internal/xlog" + "github.com/ulikunitz/xz/lzma" +) + +// ReaderConfig defines the parameters for the xz reader. The +// SingleStream parameter requests the reader to assume that the +// underlying stream contains only a single stream. +type ReaderConfig struct { + DictCap int + SingleStream bool +} + +// fill replaces all zero values with their default values. +func (c *ReaderConfig) fill() { + if c.DictCap == 0 { + c.DictCap = 8 * 1024 * 1024 + } +} + +// Verify checks the reader parameters for Validity. Zero values will be +// replaced by default values. +func (c *ReaderConfig) Verify() error { + if c == nil { + return errors.New("xz: reader parameters are nil") + } + lc := lzma.Reader2Config{DictCap: c.DictCap} + if err := lc.Verify(); err != nil { + return err + } + return nil +} + +// Reader supports the reading of one or multiple xz streams. +type Reader struct { + ReaderConfig + + xz io.Reader + sr *streamReader +} + +// streamReader decodes a single xz stream +type streamReader struct { + ReaderConfig + + xz io.Reader + br *blockReader + newHash func() hash.Hash + h header + index []record +} + +// NewReader creates a new xz reader using the default parameters. +// The function reads and checks the header of the first XZ stream. The +// reader will process multiple streams including padding. +func NewReader(xz io.Reader) (r *Reader, err error) { + return ReaderConfig{}.NewReader(xz) +} + +// NewReader creates an xz stream reader. The created reader will be +// able to process multiple streams and padding unless a SingleStream +// has been set in the reader configuration c. +func (c ReaderConfig) NewReader(xz io.Reader) (r *Reader, err error) { + if err = c.Verify(); err != nil { + return nil, err + } + r = &Reader{ + ReaderConfig: c, + xz: xz, + } + if r.sr, err = c.newStreamReader(xz); err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return nil, err + } + return r, nil +} + +var errUnexpectedData = errors.New("xz: unexpected data after stream") + +// Read reads uncompressed data from the stream. +func (r *Reader) Read(p []byte) (n int, err error) { + for n < len(p) { + if r.sr == nil { + if r.SingleStream { + data := make([]byte, 1) + _, err = io.ReadFull(r.xz, data) + if err != io.EOF { + return n, errUnexpectedData + } + return n, io.EOF + } + for { + r.sr, err = r.ReaderConfig.newStreamReader(r.xz) + if err != errPadding { + break + } + } + if err != nil { + return n, err + } + } + k, err := r.sr.Read(p[n:]) + n += k + if err != nil { + if err == io.EOF { + r.sr = nil + continue + } + return n, err + } + } + return n, nil +} + +var errPadding = errors.New("xz: padding (4 zero bytes) encountered") + +// newStreamReader creates a new xz stream reader using the given configuration +// parameters. NewReader reads and checks the header of the xz stream. +func (c ReaderConfig) newStreamReader(xz io.Reader) (r *streamReader, err error) { + if err = c.Verify(); err != nil { + return nil, err + } + data := make([]byte, HeaderLen) + if _, err := io.ReadFull(xz, data[:4]); err != nil { + return nil, err + } + if bytes.Equal(data[:4], []byte{0, 0, 0, 0}) { + return nil, errPadding + } + if _, err = io.ReadFull(xz, data[4:]); err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return nil, err + } + r = &streamReader{ + ReaderConfig: c, + xz: xz, + index: make([]record, 0, 4), + } + if err = r.h.UnmarshalBinary(data); err != nil { + return nil, err + } + xlog.Debugf("xz header %s", r.h) + if r.newHash, err = newHashFunc(r.h.flags); err != nil { + return nil, err + } + return r, nil +} + +// errIndex indicates an error with the xz file index. +var errIndex = errors.New("xz: error in xz file index") + +// readTail reads the index body and the xz footer. +func (r *streamReader) readTail() error { + index, n, err := readIndexBody(r.xz) + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return err + } + if len(index) != len(r.index) { + return fmt.Errorf("xz: index length is %d; want %d", + len(index), len(r.index)) + } + for i, rec := range r.index { + if rec != index[i] { + return fmt.Errorf("xz: record %d is %v; want %v", + i, rec, index[i]) + } + } + + p := make([]byte, footerLen) + if _, err = io.ReadFull(r.xz, p); err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return err + } + var f footer + if err = f.UnmarshalBinary(p); err != nil { + return err + } + xlog.Debugf("xz footer %s", f) + if f.flags != r.h.flags { + return errors.New("xz: footer flags incorrect") + } + if f.indexSize != int64(n)+1 { + return errors.New("xz: index size in footer wrong") + } + return nil +} + +// Read reads actual data from the xz stream. +func (r *streamReader) Read(p []byte) (n int, err error) { + for n < len(p) { + if r.br == nil { + bh, hlen, err := readBlockHeader(r.xz) + if err != nil { + if err == errIndexIndicator { + if err = r.readTail(); err != nil { + return n, err + } + return n, io.EOF + } + return n, err + } + xlog.Debugf("block %v", *bh) + r.br, err = r.ReaderConfig.newBlockReader(r.xz, bh, + hlen, r.newHash()) + if err != nil { + return n, err + } + } + k, err := r.br.Read(p[n:]) + n += k + if err != nil { + if err == io.EOF { + r.index = append(r.index, r.br.record()) + r.br = nil + } else { + return n, err + } + } + } + return n, nil +} + +// countingReader is a reader that counts the bytes read. +type countingReader struct { + r io.Reader + n int64 +} + +// Read reads data from the wrapped reader and adds it to the n field. +func (lr *countingReader) Read(p []byte) (n int, err error) { + n, err = lr.r.Read(p) + lr.n += int64(n) + return n, err +} + +// blockReader supports the reading of a block. +type blockReader struct { + lxz countingReader + header *blockHeader + headerLen int + n int64 + hash hash.Hash + r io.Reader + err error +} + +// newBlockReader creates a new block reader. +func (c *ReaderConfig) newBlockReader(xz io.Reader, h *blockHeader, + hlen int, hash hash.Hash) (br *blockReader, err error) { + + br = &blockReader{ + lxz: countingReader{r: xz}, + header: h, + headerLen: hlen, + hash: hash, + } + + fr, err := c.newFilterReader(&br.lxz, h.filters) + if err != nil { + return nil, err + } + br.r = io.TeeReader(fr, br.hash) + + return br, nil +} + +// uncompressedSize returns the uncompressed size of the block. +func (br *blockReader) uncompressedSize() int64 { + return br.n +} + +// compressedSize returns the compressed size of the block. +func (br *blockReader) compressedSize() int64 { + return br.lxz.n +} + +// unpaddedSize computes the unpadded size for the block. +func (br *blockReader) unpaddedSize() int64 { + n := int64(br.headerLen) + n += br.compressedSize() + n += int64(br.hash.Size()) + return n +} + +// record returns the index record for the current block. +func (br *blockReader) record() record { + return record{br.unpaddedSize(), br.uncompressedSize()} +} + +// errBlockSize indicates that the size of the block in the block header +// is wrong. +var errBlockSize = errors.New("xz: wrong uncompressed size for block") + +// Read reads data from the block. +func (br *blockReader) Read(p []byte) (n int, err error) { + n, err = br.r.Read(p) + br.n += int64(n) + + u := br.header.uncompressedSize + if u >= 0 && br.uncompressedSize() > u { + return n, errors.New("xz: wrong uncompressed size for block") + } + c := br.header.compressedSize + if c >= 0 && br.compressedSize() > c { + return n, errors.New("xz: wrong compressed size for block") + } + if err != io.EOF { + return n, err + } + if br.uncompressedSize() < u || br.compressedSize() < c { + return n, io.ErrUnexpectedEOF + } + + s := br.hash.Size() + k := padLen(br.lxz.n) + q := make([]byte, k+s, k+2*s) + if _, err = io.ReadFull(br.lxz.r, q); err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return n, err + } + if !allZeros(q[:k]) { + return n, errors.New("xz: non-zero block padding") + } + checkSum := q[k:] + computedSum := br.hash.Sum(checkSum[s:]) + if !bytes.Equal(checkSum, computedSum) { + return n, errors.New("xz: checksum error for block") + } + return n, io.EOF +} + +func (c *ReaderConfig) newFilterReader(r io.Reader, f []filter) (fr io.Reader, + err error) { + + if err = verifyFilters(f); err != nil { + return nil, err + } + + fr = r + for i := len(f) - 1; i >= 0; i-- { + fr, err = f[i].reader(fr, c) + if err != nil { + return nil, err + } + } + return fr, nil +} diff --git a/vendor/github.com/ulikunitz/xz/writer.go b/vendor/github.com/ulikunitz/xz/writer.go new file mode 100644 index 0000000..c126f70 --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/writer.go @@ -0,0 +1,386 @@ +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xz + +import ( + "errors" + "hash" + "io" + + "github.com/ulikunitz/xz/lzma" +) + +// WriterConfig describe the parameters for an xz writer. +type WriterConfig struct { + Properties *lzma.Properties + DictCap int + BufSize int + BlockSize int64 + // checksum method: CRC32, CRC64 or SHA256 + CheckSum byte + // match algorithm + Matcher lzma.MatchAlgorithm +} + +// fill replaces zero values with default values. +func (c *WriterConfig) fill() { + if c.Properties == nil { + c.Properties = &lzma.Properties{LC: 3, LP: 0, PB: 2} + } + if c.DictCap == 0 { + c.DictCap = 8 * 1024 * 1024 + } + if c.BufSize == 0 { + c.BufSize = 4096 + } + if c.BlockSize == 0 { + c.BlockSize = maxInt64 + } + if c.CheckSum == 0 { + c.CheckSum = CRC64 + } +} + +// Verify checks the configuration for errors. Zero values will be +// replaced by default values. +func (c *WriterConfig) Verify() error { + if c == nil { + return errors.New("xz: writer configuration is nil") + } + c.fill() + lc := lzma.Writer2Config{ + Properties: c.Properties, + DictCap: c.DictCap, + BufSize: c.BufSize, + Matcher: c.Matcher, + } + if err := lc.Verify(); err != nil { + return err + } + if c.BlockSize <= 0 { + return errors.New("xz: block size out of range") + } + if err := verifyFlags(c.CheckSum); err != nil { + return err + } + return nil +} + +// filters creates the filter list for the given parameters. +func (c *WriterConfig) filters() []filter { + return []filter{&lzmaFilter{int64(c.DictCap)}} +} + +// maxInt64 defines the maximum 64-bit signed integer. +const maxInt64 = 1<<63 - 1 + +// verifyFilters checks the filter list for the length and the right +// sequence of filters. +func verifyFilters(f []filter) error { + if len(f) == 0 { + return errors.New("xz: no filters") + } + if len(f) > 4 { + return errors.New("xz: more than four filters") + } + for _, g := range f[:len(f)-1] { + if g.last() { + return errors.New("xz: last filter is not last") + } + } + if !f[len(f)-1].last() { + return errors.New("xz: wrong last filter") + } + return nil +} + +// newFilterWriteCloser converts a filter list into a WriteCloser that +// can be used by a blockWriter. +func (c *WriterConfig) newFilterWriteCloser(w io.Writer, f []filter) (fw io.WriteCloser, err error) { + if err = verifyFilters(f); err != nil { + return nil, err + } + fw = nopWriteCloser(w) + for i := len(f) - 1; i >= 0; i-- { + fw, err = f[i].writeCloser(fw, c) + if err != nil { + return nil, err + } + } + return fw, nil +} + +// nopWCloser implements a WriteCloser with a Close method not doing +// anything. +type nopWCloser struct { + io.Writer +} + +// Close returns nil and doesn't do anything else. +func (c nopWCloser) Close() error { + return nil +} + +// nopWriteCloser converts the Writer into a WriteCloser with a Close +// function that does nothing beside returning nil. +func nopWriteCloser(w io.Writer) io.WriteCloser { + return nopWCloser{w} +} + +// Writer compresses data written to it. It is an io.WriteCloser. +type Writer struct { + WriterConfig + + xz io.Writer + bw *blockWriter + newHash func() hash.Hash + h header + index []record + closed bool +} + +// newBlockWriter creates a new block writer writes the header out. +func (w *Writer) newBlockWriter() error { + var err error + w.bw, err = w.WriterConfig.newBlockWriter(w.xz, w.newHash()) + if err != nil { + return err + } + if err = w.bw.writeHeader(w.xz); err != nil { + return err + } + return nil +} + +// closeBlockWriter closes a block writer and records the sizes in the +// index. +func (w *Writer) closeBlockWriter() error { + var err error + if err = w.bw.Close(); err != nil { + return err + } + w.index = append(w.index, w.bw.record()) + return nil +} + +// NewWriter creates a new xz writer using default parameters. +func NewWriter(xz io.Writer) (w *Writer, err error) { + return WriterConfig{}.NewWriter(xz) +} + +// NewWriter creates a new Writer using the given configuration parameters. +func (c WriterConfig) NewWriter(xz io.Writer) (w *Writer, err error) { + if err = c.Verify(); err != nil { + return nil, err + } + w = &Writer{ + WriterConfig: c, + xz: xz, + h: header{c.CheckSum}, + index: make([]record, 0, 4), + } + if w.newHash, err = newHashFunc(c.CheckSum); err != nil { + return nil, err + } + data, err := w.h.MarshalBinary() + if _, err = xz.Write(data); err != nil { + return nil, err + } + if err = w.newBlockWriter(); err != nil { + return nil, err + } + return w, nil + +} + +// Write compresses the uncompressed data provided. +func (w *Writer) Write(p []byte) (n int, err error) { + if w.closed { + return 0, errClosed + } + for { + k, err := w.bw.Write(p[n:]) + n += k + if err != errNoSpace { + return n, err + } + if err = w.closeBlockWriter(); err != nil { + return n, err + } + if err = w.newBlockWriter(); err != nil { + return n, err + } + } +} + +// Close closes the writer and adds the footer to the Writer. Close +// doesn't close the underlying writer. +func (w *Writer) Close() error { + if w.closed { + return errClosed + } + w.closed = true + var err error + if err = w.closeBlockWriter(); err != nil { + return err + } + + f := footer{flags: w.h.flags} + if f.indexSize, err = writeIndex(w.xz, w.index); err != nil { + return err + } + data, err := f.MarshalBinary() + if err != nil { + return err + } + if _, err = w.xz.Write(data); err != nil { + return err + } + return nil +} + +// countingWriter is a writer that counts all data written to it. +type countingWriter struct { + w io.Writer + n int64 +} + +// Write writes data to the countingWriter. +func (cw *countingWriter) Write(p []byte) (n int, err error) { + n, err = cw.w.Write(p) + cw.n += int64(n) + if err == nil && cw.n < 0 { + return n, errors.New("xz: counter overflow") + } + return +} + +// blockWriter is writes a single block. +type blockWriter struct { + cxz countingWriter + // mw combines io.WriteCloser w and the hash. + mw io.Writer + w io.WriteCloser + n int64 + blockSize int64 + closed bool + headerLen int + + filters []filter + hash hash.Hash +} + +// newBlockWriter creates a new block writer. +func (c *WriterConfig) newBlockWriter(xz io.Writer, hash hash.Hash) (bw *blockWriter, err error) { + bw = &blockWriter{ + cxz: countingWriter{w: xz}, + blockSize: c.BlockSize, + filters: c.filters(), + hash: hash, + } + bw.w, err = c.newFilterWriteCloser(&bw.cxz, bw.filters) + if err != nil { + return nil, err + } + bw.mw = io.MultiWriter(bw.w, bw.hash) + return bw, nil +} + +// writeHeader writes the header. If the function is called after Close +// the commpressedSize and uncompressedSize fields will be filled. +func (bw *blockWriter) writeHeader(w io.Writer) error { + h := blockHeader{ + compressedSize: -1, + uncompressedSize: -1, + filters: bw.filters, + } + if bw.closed { + h.compressedSize = bw.compressedSize() + h.uncompressedSize = bw.uncompressedSize() + } + data, err := h.MarshalBinary() + if err != nil { + return err + } + if _, err = w.Write(data); err != nil { + return err + } + bw.headerLen = len(data) + return nil +} + +// compressed size returns the amount of data written to the underlying +// stream. +func (bw *blockWriter) compressedSize() int64 { + return bw.cxz.n +} + +// uncompressedSize returns the number of data written to the +// blockWriter +func (bw *blockWriter) uncompressedSize() int64 { + return bw.n +} + +// unpaddedSize returns the sum of the header length, the uncompressed +// size of the block and the hash size. +func (bw *blockWriter) unpaddedSize() int64 { + if bw.headerLen <= 0 { + panic("xz: block header not written") + } + n := int64(bw.headerLen) + n += bw.compressedSize() + n += int64(bw.hash.Size()) + return n +} + +// record returns the record for the current stream. Call Close before +// calling this method. +func (bw *blockWriter) record() record { + return record{bw.unpaddedSize(), bw.uncompressedSize()} +} + +var errClosed = errors.New("xz: writer already closed") + +var errNoSpace = errors.New("xz: no space") + +// Write writes uncompressed data to the block writer. +func (bw *blockWriter) Write(p []byte) (n int, err error) { + if bw.closed { + return 0, errClosed + } + + t := bw.blockSize - bw.n + if int64(len(p)) > t { + err = errNoSpace + p = p[:t] + } + + var werr error + n, werr = bw.mw.Write(p) + bw.n += int64(n) + if werr != nil { + return n, werr + } + return n, err +} + +// Close closes the writer. +func (bw *blockWriter) Close() error { + if bw.closed { + return errClosed + } + bw.closed = true + if err := bw.w.Close(); err != nil { + return err + } + s := bw.hash.Size() + k := padLen(bw.cxz.n) + p := make([]byte, k+s) + bw.hash.Sum(p[k:k]) + if _, err := bw.cxz.w.Write(p); err != nil { + return err + } + return nil +} diff --git a/vendor/github.com/weppos/dnsimple-go/LICENSE b/vendor/github.com/weppos/dnsimple-go/LICENSE deleted file mode 100644 index 5377f6d..0000000 --- a/vendor/github.com/weppos/dnsimple-go/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Scott Barron - -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. \ No newline at end of file diff --git a/vendor/github.com/weppos/dnsimple-go/dnsimple/authentication.go b/vendor/github.com/weppos/dnsimple-go/dnsimple/authentication.go deleted file mode 100644 index cd3a823..0000000 --- a/vendor/github.com/weppos/dnsimple-go/dnsimple/authentication.go +++ /dev/null @@ -1,73 +0,0 @@ -package dnsimple - -import ( - "encoding/base64" - "fmt" -) - -const ( - httpHeaderDomainToken = "X-DNSimple-Domain-Token" - httpHeaderApiToken = "X-DNSimple-Token" - httpHeaderAuthorization = "Authorization" -) - -// Provides credentials that can be used for authenticating with DNSimple -// -// More information on credentials may be found here: -// http://developer.dnsimple.com/v2/#authentication -type Credentials interface { - // Get the HTTP header key and value to use for authentication. - HttpHeader() (string, string) -} - -// Domain token authentication - -type domainTokenCredentials struct { - domainToken string -} - -// Construct Credentials using the DNSimple Domain Token method -func NewDomainTokenCredentials(domainToken string) Credentials { - return &domainTokenCredentials{domainToken: domainToken} -} - -func (c *domainTokenCredentials) HttpHeader() (string, string) { - return httpHeaderDomainToken, c.domainToken -} - -// HTTP basic authentication - -type httpBasicCredentials struct { - email string - password string -} - -// Construct Credentials using HTTP Basic Auth -func NewHttpBasicCredentials(email, password string) Credentials { - return &httpBasicCredentials{email, password} -} - -func (c *httpBasicCredentials) HttpHeader() (string, string) { - return httpHeaderAuthorization, "Basic " + basicAuth(c.email, c.password) -} - -func basicAuth(username, password string) string { - auth := username + ":" + password - return base64.StdEncoding.EncodeToString([]byte(auth)) -} - -// API token authentication - -type apiTokenCredentials struct { - email string - apiToken string -} - -// Construct Credentials using the API Token method. -func NewApiTokenCredentials(email, apiToken string) Credentials { - return &apiTokenCredentials{email: email, apiToken: apiToken} -} - -func (c *apiTokenCredentials) HttpHeader() (string, string) { - return httpHeaderApiToken, fmt.Sprintf("%v:%v", c.email, c.apiToken) -} diff --git a/vendor/github.com/weppos/dnsimple-go/dnsimple/contacts.go b/vendor/github.com/weppos/dnsimple-go/dnsimple/contacts.go deleted file mode 100644 index 6a53be7..0000000 --- a/vendor/github.com/weppos/dnsimple-go/dnsimple/contacts.go +++ /dev/null @@ -1,121 +0,0 @@ -package dnsimple - -import ( - "fmt" - "time" -) - -// ContactsService handles communication with the contact related -// methods of the DNSimple API. -// -// DNSimple API docs: http://developer.dnsimple.com/contacts/ -type ContactsService struct { - client *Client -} - -type Contact struct { - Id int `json:"id,omitempty"` - Label string `json:"label,omitempty"` - FirstName string `json:"first_name,omitempty"` - LastName string `json:"last_name,omitempty"` - JobTitle string `json:"job_title,omitempty"` - Organization string `json:"organization_name,omitempty"` - Email string `json:"email_address,omitempty"` - Phone string `json:"phone,omitempty"` - Fax string `json:"fax,omitempty"` - Address1 string `json:"address1,omitempty"` - Address2 string `json:"address2,omitempty"` - City string `json:"city,omitempty"` - Zip string `json:"postal_code,omitempty"` - Country string `json:"country,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` -} - -type contactWrapper struct { - Contact Contact `json:"contact"` -} - -// contactPath generates the resource path for given contact. -func contactPath(contact interface{}) string { - if contact != nil { - return fmt.Sprintf("contacts/%d", contact) - } - return "contacts" -} - -// List the contacts. -// -// DNSimple API docs: http://developer.dnsimple.com/contacts/#list -func (s *ContactsService) List() ([]Contact, *Response, error) { - path := contactPath(nil) - wrappedContacts := []contactWrapper{} - - res, err := s.client.get(path, &wrappedContacts) - if err != nil { - return []Contact{}, res, err - } - - contacts := []Contact{} - for _, contact := range wrappedContacts { - contacts = append(contacts, contact.Contact) - } - - return contacts, res, nil -} - -// Create a new contact. -// -// DNSimple API docs: http://developer.dnsimple.com/contacts/#create -func (s *ContactsService) Create(contactAttributes Contact) (Contact, *Response, error) { - path := contactPath(nil) - wrappedContact := contactWrapper{Contact: contactAttributes} - returnedContact := contactWrapper{} - - res, err := s.client.post(path, wrappedContact, &returnedContact) - if err != nil { - return Contact{}, res, err - } - - return returnedContact.Contact, res, nil -} - -// Get fetches a contact. -// -// DNSimple API docs: http://developer.dnsimple.com/contacts/#get -func (s *ContactsService) Get(contactID int) (Contact, *Response, error) { - path := contactPath(contactID) - wrappedContact := contactWrapper{} - - res, err := s.client.get(path, &wrappedContact) - if err != nil { - return Contact{}, res, err - } - - return wrappedContact.Contact, res, nil -} - -// Update a contact. -// -// DNSimple API docs: http://developer.dnsimple.com/contacts/#update -func (s *ContactsService) Update(contactID int, contactAttributes Contact) (Contact, *Response, error) { - path := contactPath(contactID) - wrappedContact := contactWrapper{Contact: contactAttributes} - returnedContact := contactWrapper{} - - res, err := s.client.put(path, wrappedContact, &returnedContact) - if err != nil { - return Contact{}, res, err - } - - return returnedContact.Contact, res, nil -} - -// Delete a contact. -// -// DNSimple API docs: http://developer.dnsimple.com/contacts/#delete -func (s *ContactsService) Delete(contactID int) (*Response, error) { - path := contactPath(contactID) - - return s.client.delete(path, nil) -} diff --git a/vendor/github.com/weppos/dnsimple-go/dnsimple/dnsimple.go b/vendor/github.com/weppos/dnsimple-go/dnsimple/dnsimple.go deleted file mode 100644 index d2cfd62..0000000 --- a/vendor/github.com/weppos/dnsimple-go/dnsimple/dnsimple.go +++ /dev/null @@ -1,192 +0,0 @@ -// Package dnsimple implements a client for the DNSimple API. -// -// In order to use this package you will need a DNSimple account and your API Token. -package dnsimple - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" - "time" -) - -const ( - libraryVersion = "0.1" - baseURL = "https://api.dnsimple.com/" - userAgent = "dnsimple-go/" + libraryVersion - - apiVersion = "v1" -) - -type Client struct { - // HTTP client used to communicate with the API. - HttpClient *http.Client - - // Credentials used for accessing the DNSimple API - Credentials Credentials - - // Base URL for API requests. - // Defaults to the public DNSimple API, but can be set to a different endpoint (e.g. the sandbox). - // BaseURL should always be specified with a trailing slash. - BaseURL string - - // User agent used when communicating with the DNSimple API. - UserAgent string - - // Services used for talking to different parts of the DNSimple API. - Contacts *ContactsService - Domains *DomainsService - Registrar *RegistrarService - Users *UsersService -} - -// NewClient returns a new DNSimple API client. -func NewClient(apiToken, email string) *Client { - return NewAuthenticatedClient(NewApiTokenCredentials(email, apiToken)) - -} - -// NewAuthenticatedClient returns a new DNSimple API client using the given -// credentials. -func NewAuthenticatedClient(credentials Credentials) *Client { - c := &Client{Credentials: credentials, HttpClient: &http.Client{}, BaseURL: baseURL, UserAgent: userAgent} - c.Contacts = &ContactsService{client: c} - c.Domains = &DomainsService{client: c} - c.Registrar = &RegistrarService{client: c} - c.Users = &UsersService{client: c} - return c -} - -// NewRequest creates an API request. -// The path is expected to be a relative path and will be resolved -// according to the BaseURL of the Client. Paths should always be specified without a preceding slash. -func (client *Client) NewRequest(method, path string, payload interface{}) (*http.Request, error) { - url := client.BaseURL + fmt.Sprintf("%s/%s", apiVersion, path) - - body := new(bytes.Buffer) - if payload != nil { - err := json.NewEncoder(body).Encode(payload) - if err != nil { - return nil, err - } - } - - req, err := http.NewRequest(method, url, body) - if err != nil { - return nil, err - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("User-Agent", client.UserAgent) - req.Header.Add(client.Credentials.HttpHeader()) - - return req, nil -} - -func (c *Client) get(path string, v interface{}) (*Response, error) { - return c.Do("GET", path, nil, v) -} - -func (c *Client) post(path string, payload, v interface{}) (*Response, error) { - return c.Do("POST", path, payload, v) -} - -func (c *Client) put(path string, payload, v interface{}) (*Response, error) { - return c.Do("PUT", path, payload, v) -} - -func (c *Client) delete(path string, payload interface{}) (*Response, error) { - return c.Do("DELETE", path, payload, nil) -} - -// Do sends an API request and returns the API response. -// The API response is JSON decoded and stored in the value pointed by v, -// or returned as an error if an API error has occurred. -// If v implements the io.Writer interface, the raw response body will be written to v, -// without attempting to decode it. -func (c *Client) Do(method, path string, payload, v interface{}) (*Response, error) { - req, err := c.NewRequest(method, path, payload) - if err != nil { - return nil, err - } - - res, err := c.HttpClient.Do(req) - if err != nil { - return nil, err - } - defer res.Body.Close() - - response := &Response{Response: res} - - err = CheckResponse(res) - if err != nil { - return response, err - } - - if v != nil { - if w, ok := v.(io.Writer); ok { - io.Copy(w, res.Body) - } else { - err = json.NewDecoder(res.Body).Decode(v) - } - } - - return response, err -} - -// A Response represents an API response. -type Response struct { - *http.Response -} - -// An ErrorResponse represents an error caused by an API request. -type ErrorResponse struct { - Response *http.Response // HTTP response that caused this error - Message string `json:"message"` // human-readable message -} - -// Error implements the error interface. -func (r *ErrorResponse) Error() string { - return fmt.Sprintf("%v %v: %d %v", - r.Response.Request.Method, r.Response.Request.URL, - r.Response.StatusCode, r.Message) -} - -// CheckResponse checks the API response for errors, and returns them if present. -// A response is considered an error if the status code is different than 2xx. Specific requests -// may have additional requirements, but this is sufficient in most of the cases. -func CheckResponse(r *http.Response) error { - if code := r.StatusCode; 200 <= code && code <= 299 { - return nil - } - - errorResponse := &ErrorResponse{Response: r} - err := json.NewDecoder(r.Body).Decode(errorResponse) - if err != nil { - return err - } - - return errorResponse -} - -// Date custom type. -type Date struct { - time.Time -} - -// UnmarshalJSON handles the deserialization of the custom Date type. -func (d *Date) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return fmt.Errorf("date should be a string, got %s", data) - } - t, err := time.Parse("2006-01-02", s) - if err != nil { - return fmt.Errorf("invalid date: %v", err) - } - d.Time = t - return nil -} diff --git a/vendor/github.com/weppos/dnsimple-go/dnsimple/domains.go b/vendor/github.com/weppos/dnsimple-go/dnsimple/domains.go deleted file mode 100644 index 317a7a7..0000000 --- a/vendor/github.com/weppos/dnsimple-go/dnsimple/domains.go +++ /dev/null @@ -1,121 +0,0 @@ -package dnsimple - -import ( - "fmt" - "time" -) - -// DomainsService handles communication with the domain related -// methods of the DNSimple API. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/ -type DomainsService struct { - client *Client -} - -type Domain struct { - Id int `json:"id,omitempty"` - UserId int `json:"user_id,omitempty"` - RegistrantId int `json:"registrant_id,omitempty"` - Name string `json:"name,omitempty"` - UnicodeName string `json:"unicode_name,omitempty"` - Token string `json:"token,omitempty"` - State string `json:"state,omitempty"` - Language string `json:"language,omitempty"` - Lockable bool `json:"lockable,omitempty"` - AutoRenew bool `json:"auto_renew,omitempty"` - WhoisProtected bool `json:"whois_protected,omitempty"` - RecordCount int `json:"record_count,omitempty"` - ServiceCount int `json:"service_count,omitempty"` - ExpiresOn *Date `json:"expires_on,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` -} - -type domainWrapper struct { - Domain Domain `json:"domain"` -} - -// domainRequest represents a generic wrapper for a domain request, -// when domainWrapper cannot be used because of type constraint on Domain. -type domainRequest struct { - Domain interface{} `json:"domain"` -} - -func domainIdentifier(value interface{}) string { - switch value := value.(type) { - case string: - return value - case int: - return fmt.Sprintf("%d", value) - } - return "" -} - -// domainPath generates the resource path for given domain. -func domainPath(domain interface{}) string { - if domain != nil { - return fmt.Sprintf("domains/%s", domainIdentifier(domain)) - } - return "domains" -} - -// List the domains. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/#list -func (s *DomainsService) List() ([]Domain, *Response, error) { - path := domainPath(nil) - returnedDomains := []domainWrapper{} - - res, err := s.client.get(path, &returnedDomains) - if err != nil { - return []Domain{}, res, err - } - - domains := []Domain{} - for _, domain := range returnedDomains { - domains = append(domains, domain.Domain) - } - - return domains, res, nil -} - -// Create a new domain. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/#create -func (s *DomainsService) Create(domainAttributes Domain) (Domain, *Response, error) { - path := domainPath(nil) - wrappedDomain := domainWrapper{Domain: domainAttributes} - returnedDomain := domainWrapper{} - - res, err := s.client.post(path, wrappedDomain, &returnedDomain) - if err != nil { - return Domain{}, res, err - } - - return returnedDomain.Domain, res, nil -} - -// Get fetches a domain. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/#get -func (s *DomainsService) Get(domain interface{}) (Domain, *Response, error) { - path := domainPath(domain) - returnedDomain := domainWrapper{} - - res, err := s.client.get(path, &returnedDomain) - if err != nil { - return Domain{}, res, err - } - - return returnedDomain.Domain, res, nil -} - -// Delete a domain. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/#delete -func (s *DomainsService) Delete(domain interface{}) (*Response, error) { - path := domainPath(domain) - - return s.client.delete(path, nil) -} diff --git a/vendor/github.com/weppos/dnsimple-go/dnsimple/domains_records.go b/vendor/github.com/weppos/dnsimple-go/dnsimple/domains_records.go deleted file mode 100644 index 8a6e35b..0000000 --- a/vendor/github.com/weppos/dnsimple-go/dnsimple/domains_records.go +++ /dev/null @@ -1,136 +0,0 @@ -package dnsimple - -import ( - "fmt" - "net/url" - "time" -) - -type Record struct { - Id int `json:"id,omitempty"` - DomainId int `json:"domain_id,omitempty"` - Name string `json:"name,omitempty"` - Content string `json:"content,omitempty"` - TTL int `json:"ttl,omitempty"` - Priority int `json:"prio,omitempty"` - Type string `json:"record_type,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` -} - -type recordWrapper struct { - Record Record `json:"record"` -} - -// recordPath generates the resource path for given record that belongs to a domain. -func recordPath(domain interface{}, record interface{}) string { - path := fmt.Sprintf("domains/%s/records", domainIdentifier(domain)) - - if record != nil { - path += fmt.Sprintf("/%d", record) - } - - return path -} - -// List the domain records. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/records/#list -func (s *DomainsService) ListRecords(domain interface{}, recordName, recordType string) ([]Record, *Response, error) { - reqStr := recordPath(domain, nil) - v := url.Values{} - - if recordName != "" { - v.Add("name", recordName) - } - if recordType != "" { - v.Add("type", recordType) - } - reqStr += "?" + v.Encode() - - wrappedRecords := []recordWrapper{} - - res, err := s.client.get(reqStr, &wrappedRecords) - if err != nil { - return []Record{}, res, err - } - - records := []Record{} - for _, record := range wrappedRecords { - records = append(records, record.Record) - } - - return records, res, nil -} - -// CreateRecord creates a domain record. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/records/#create -func (s *DomainsService) CreateRecord(domain interface{}, recordAttributes Record) (Record, *Response, error) { - path := recordPath(domain, nil) - wrappedRecord := recordWrapper{Record: recordAttributes} - returnedRecord := recordWrapper{} - - res, err := s.client.post(path, wrappedRecord, &returnedRecord) - if err != nil { - return Record{}, res, err - } - - return returnedRecord.Record, res, nil -} - -// GetRecord fetches the domain record. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/records/#get -func (s *DomainsService) GetRecord(domain interface{}, recordID int) (Record, *Response, error) { - path := recordPath(domain, recordID) - wrappedRecord := recordWrapper{} - - res, err := s.client.get(path, &wrappedRecord) - if err != nil { - return Record{}, res, err - } - - return wrappedRecord.Record, res, nil -} - -// UpdateRecord updates a domain record. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/records/#update -func (s *DomainsService) UpdateRecord(domain interface{}, recordID int, recordAttributes Record) (Record, *Response, error) { - path := recordPath(domain, recordID) - // name, content, ttl, priority - wrappedRecord := recordWrapper{ - Record: Record{ - Name: recordAttributes.Name, - Content: recordAttributes.Content, - TTL: recordAttributes.TTL, - Priority: recordAttributes.Priority}} - returnedRecord := recordWrapper{} - - res, err := s.client.put(path, wrappedRecord, &returnedRecord) - if err != nil { - return Record{}, res, err - } - - return returnedRecord.Record, res, nil -} - -// DeleteRecord deletes a domain record. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/records/#delete -func (s *DomainsService) DeleteRecord(domain interface{}, recordID int) (*Response, error) { - path := recordPath(domain, recordID) - - return s.client.delete(path, nil) -} - -// UpdateIP updates the IP of specific A record. -// -// This is not part of the standard API. However, -// this is useful for Dynamic DNS (DDNS or DynDNS). -func (record *Record) UpdateIP(client *Client, IP string) error { - newRecord := Record{Content: IP, Name: record.Name} - _, _, err := client.Domains.UpdateRecord(record.DomainId, record.Id, newRecord) - return err -} diff --git a/vendor/github.com/weppos/dnsimple-go/dnsimple/domains_zones.go b/vendor/github.com/weppos/dnsimple-go/dnsimple/domains_zones.go deleted file mode 100644 index 8765bfd..0000000 --- a/vendor/github.com/weppos/dnsimple-go/dnsimple/domains_zones.go +++ /dev/null @@ -1,24 +0,0 @@ -package dnsimple - -import ( - "fmt" -) - -type zoneResponse struct { - Zone string `json:"zone,omitempty"` -} - -// GetZone downloads the Bind-like zone file. -// -// DNSimple API docs: http://developer.dnsimple.com/domains/zones/#get -func (s *DomainsService) GetZone(domain interface{}) (string, *Response, error) { - path := fmt.Sprintf("%s/zone", domainPath(domain)) - zoneResponse := zoneResponse{} - - res, err := s.client.get(path, &zoneResponse) - if err != nil { - return "", res, err - } - - return zoneResponse.Zone, res, nil -} diff --git a/vendor/github.com/weppos/dnsimple-go/dnsimple/registrar.go b/vendor/github.com/weppos/dnsimple-go/dnsimple/registrar.go deleted file mode 100644 index 38cd85e..0000000 --- a/vendor/github.com/weppos/dnsimple-go/dnsimple/registrar.go +++ /dev/null @@ -1,131 +0,0 @@ -package dnsimple - -import ( - "fmt" -) - -// RegistrarService handles communication with the registrar related -// methods of the DNSimple API. -// -// DNSimple API docs: http://developer.dnsimple.com/registrar/ -type RegistrarService struct { - client *Client -} - -// ExtendedAttributes maps the additional attributes required by some registries. -type ExtendedAttributes map[string]string - -// ExtendedAttributes represents the transfer information. -type TransferOrder struct { - AuthCode string `json:"authinfo,omitempty"` -} - -// registrationRequest represents the body of a register or transfer request. -type registrationRequest struct { - Domain Domain `json:"domain"` - ExtendedAttributes *ExtendedAttributes `json:"extended_attribute,omitempty"` - TransferOrder *TransferOrder `json:"transfer_order,omitempty"` -} - -// IsAvailable checks if the domain is available or registered. -// -// See: http://developer.dnsimple.com/registrar/#check -func (s *RegistrarService) IsAvailable(domain string) (bool, error) { - path := fmt.Sprintf("%s/check", domainPath(domain)) - - res, err := s.client.get(path, nil) - if err != nil && res != nil && res.StatusCode != 404 { - return false, err - } - - return res.StatusCode == 404, nil -} - -// Register a domain. -// -// DNSimple API docs: http://developer.dnsimple.com/registrar/#register -func (s *RegistrarService) Register(domain string, registrantID int, extendedAttributes *ExtendedAttributes) (Domain, *Response, error) { - request := registrationRequest{ - Domain: Domain{Name: domain, RegistrantId: registrantID}, - ExtendedAttributes: extendedAttributes, - } - returnedDomain := domainWrapper{} - - res, err := s.client.post("domain_registrations", request, &returnedDomain) - if err != nil { - return Domain{}, res, err - } - - return returnedDomain.Domain, res, nil -} - -// Transfer a domain. -// -// DNSimple API docs: http://developer.dnsimple.com/registrar/#transfer -func (s *RegistrarService) Transfer(domain string, registrantID int, authCode string, extendedAttributes *ExtendedAttributes) (Domain, *Response, error) { - request := registrationRequest{ - Domain: Domain{Name: domain, RegistrantId: registrantID}, - ExtendedAttributes: extendedAttributes, - TransferOrder: &TransferOrder{AuthCode: authCode}, - } - returnedDomain := domainWrapper{} - - res, err := s.client.post("domain_transfers", request, &returnedDomain) - if err != nil { - return Domain{}, res, err - } - - return returnedDomain.Domain, res, nil -} - -// renewDomain represents the body of a Renew request. -type renewDomain struct { - Name string `json:"name,omitempty"` - RenewWhoisPrivacy bool `json:"renew_whois_privacy,omitempty"` -} - -// Renew the domain, optionally renewing WHOIS privacy service. -// -// DNSimple API docs: http://developer.dnsimple.com/registrar/#renew -func (s *RegistrarService) Renew(domain string, renewWhoisPrivacy bool) (Domain, *Response, error) { - request := domainRequest{Domain: renewDomain{ - Name: domain, - RenewWhoisPrivacy: renewWhoisPrivacy, - }} - returnedDomain := domainWrapper{} - - res, err := s.client.post("domain_renewals", request, &returnedDomain) - if err != nil { - return Domain{}, res, err - } - - return returnedDomain.Domain, res, nil -} - -// EnableAutoRenewal enables the auto-renewal feature for the domain. -// -// DNSimple API docs: http://developer.dnsimple.com/registrar/autorenewal/#enable -func (s *RegistrarService) EnableAutoRenewal(domain interface{}) (*Response, error) { - path := fmt.Sprintf("%s/auto_renewal", domainPath(domain)) - - res, err := s.client.post(path, nil, nil) - if err != nil { - return res, err - } - - return res, nil -} - -// DisableAutoRenewal disables the auto-renewal feature for the domain. -// -// DNSimple API docs: http://developer.dnsimple.com/registrar/autorenewal/#disable -func (s *RegistrarService) DisableAutoRenewal(domain interface{}) (*Response, error) { - path := fmt.Sprintf("%s/auto_renewal", domainPath(domain)) - - res, err := s.client.delete(path, nil) - if err != nil { - return res, err - } - - return res, nil -} diff --git a/vendor/github.com/weppos/dnsimple-go/dnsimple/users.go b/vendor/github.com/weppos/dnsimple-go/dnsimple/users.go deleted file mode 100644 index 601fb09..0000000 --- a/vendor/github.com/weppos/dnsimple-go/dnsimple/users.go +++ /dev/null @@ -1,35 +0,0 @@ -package dnsimple - -import () - -// UsersService handles communication with the uer related -// methods of the DNSimple API. -// -// DNSimple API docs: http://developer.dnsimple.com/users/ -type UsersService struct { - client *Client -} - -// User represents a DNSimple user. -type User struct { - Id int `json:"id,omitempty"` - Email string `json:"email,omitempty"` -} - -type userWrapper struct { - User User `json:"user"` -} - -// User gets the logged in user. -// -// DNSimple API docs: http://developer.dnsimple.com/users/ -func (s *UsersService) User() (User, *Response, error) { - wrappedUser := userWrapper{} - - res, err := s.client.get("user", &wrappedUser) - if err != nil { - return User{}, res, err - } - - return wrappedUser.User, res, nil -} diff --git a/vendor/github.com/xenolf/lego/LICENSE b/vendor/github.com/xenolf/lego/LICENSE deleted file mode 100644 index 17460b7..0000000 --- a/vendor/github.com/xenolf/lego/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Sebastian Erhart - -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/xenolf/lego/acme/challenges.go b/vendor/github.com/xenolf/lego/acme/challenges.go deleted file mode 100644 index 8579005..0000000 --- a/vendor/github.com/xenolf/lego/acme/challenges.go +++ /dev/null @@ -1,16 +0,0 @@ -package acme - -// Challenge is a string that identifies a particular type and version of ACME challenge. -type Challenge string - -const ( - // HTTP01 is the "http-01" ACME challenge https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#http - // Note: HTTP01ChallengePath returns the URL path to fulfill this challenge - HTTP01 = Challenge("http-01") - // TLSSNI01 is the "tls-sni-01" ACME challenge https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#tls-with-server-name-indication-tls-sni - // Note: TLSSNI01ChallengeCert returns a certificate to fulfill this challenge - TLSSNI01 = Challenge("tls-sni-01") - // DNS01 is the "dns-01" ACME challenge https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#dns - // Note: DNS01Record returns a DNS record which will fulfill this challenge - DNS01 = Challenge("dns-01") -) diff --git a/vendor/github.com/xenolf/lego/acme/client.go b/vendor/github.com/xenolf/lego/acme/client.go deleted file mode 100644 index e758d24..0000000 --- a/vendor/github.com/xenolf/lego/acme/client.go +++ /dev/null @@ -1,762 +0,0 @@ -// Package acme implements the ACME protocol for Let's Encrypt and other conforming providers. -package acme - -import ( - "crypto" - "crypto/x509" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "log" - "net" - "regexp" - "strconv" - "strings" - "time" -) - -var ( - // Logger is an optional custom logger. - Logger *log.Logger -) - -// logf writes a log entry. It uses Logger if not -// nil, otherwise it uses the default log.Logger. -func logf(format string, args ...interface{}) { - if Logger != nil { - Logger.Printf(format, args...) - } else { - log.Printf(format, args...) - } -} - -// User interface is to be implemented by users of this library. -// It is used by the client type to get user specific information. -type User interface { - GetEmail() string - GetRegistration() *RegistrationResource - GetPrivateKey() crypto.PrivateKey -} - -// Interface for all challenge solvers to implement. -type solver interface { - Solve(challenge challenge, domain string) error -} - -type validateFunc func(j *jws, domain, uri string, chlng challenge) error - -// Client is the user-friendy way to ACME -type Client struct { - directory directory - user User - jws *jws - keyType KeyType - solvers map[Challenge]solver -} - -// NewClient creates a new ACME client on behalf of the user. The client will depend on -// the ACME directory located at caDirURL for the rest of its actions. A private -// key of type keyType (see KeyType contants) will be generated when requesting a new -// certificate if one isn't provided. -func NewClient(caDirURL string, user User, keyType KeyType) (*Client, error) { - privKey := user.GetPrivateKey() - if privKey == nil { - return nil, errors.New("private key was nil") - } - - var dir directory - if _, err := getJSON(caDirURL, &dir); err != nil { - return nil, fmt.Errorf("get directory at '%s': %v", caDirURL, err) - } - - if dir.NewRegURL == "" { - return nil, errors.New("directory missing new registration URL") - } - if dir.NewAuthzURL == "" { - return nil, errors.New("directory missing new authz URL") - } - if dir.NewCertURL == "" { - return nil, errors.New("directory missing new certificate URL") - } - if dir.RevokeCertURL == "" { - return nil, errors.New("directory missing revoke certificate URL") - } - - jws := &jws{privKey: privKey, directoryURL: caDirURL} - - // REVIEW: best possibility? - // Add all available solvers with the right index as per ACME - // spec to this map. Otherwise they won`t be found. - solvers := make(map[Challenge]solver) - solvers[HTTP01] = &httpChallenge{jws: jws, validate: validate, provider: &HTTPProviderServer{}} - solvers[TLSSNI01] = &tlsSNIChallenge{jws: jws, validate: validate, provider: &TLSProviderServer{}} - - return &Client{directory: dir, user: user, jws: jws, keyType: keyType, solvers: solvers}, nil -} - -// SetChallengeProvider specifies a custom provider p that can solve the given challenge type. -func (c *Client) SetChallengeProvider(challenge Challenge, p ChallengeProvider) error { - switch challenge { - case HTTP01: - c.solvers[challenge] = &httpChallenge{jws: c.jws, validate: validate, provider: p} - case TLSSNI01: - c.solvers[challenge] = &tlsSNIChallenge{jws: c.jws, validate: validate, provider: p} - case DNS01: - c.solvers[challenge] = &dnsChallenge{jws: c.jws, validate: validate, provider: p} - default: - return fmt.Errorf("Unknown challenge %v", challenge) - } - return nil -} - -// SetHTTPAddress specifies a custom interface:port to be used for HTTP based challenges. -// If this option is not used, the default port 80 and all interfaces will be used. -// To only specify a port and no interface use the ":port" notation. -// -// NOTE: This REPLACES any custom HTTP provider previously set by calling -// c.SetChallengeProvider with the default HTTP challenge provider. -func (c *Client) SetHTTPAddress(iface string) error { - host, port, err := net.SplitHostPort(iface) - if err != nil { - return err - } - - if chlng, ok := c.solvers[HTTP01]; ok { - chlng.(*httpChallenge).provider = NewHTTPProviderServer(host, port) - } - - return nil -} - -// SetTLSAddress specifies a custom interface:port to be used for TLS based challenges. -// If this option is not used, the default port 443 and all interfaces will be used. -// To only specify a port and no interface use the ":port" notation. -// -// NOTE: This REPLACES any custom TLS-SNI provider previously set by calling -// c.SetChallengeProvider with the default TLS-SNI challenge provider. -func (c *Client) SetTLSAddress(iface string) error { - host, port, err := net.SplitHostPort(iface) - if err != nil { - return err - } - - if chlng, ok := c.solvers[TLSSNI01]; ok { - chlng.(*tlsSNIChallenge).provider = NewTLSProviderServer(host, port) - } - return nil -} - -// ExcludeChallenges explicitly removes challenges from the pool for solving. -func (c *Client) ExcludeChallenges(challenges []Challenge) { - // Loop through all challenges and delete the requested one if found. - for _, challenge := range challenges { - delete(c.solvers, challenge) - } -} - -// Register the current account to the ACME server. -func (c *Client) Register() (*RegistrationResource, error) { - if c == nil || c.user == nil { - return nil, errors.New("acme: cannot register a nil client or user") - } - logf("[INFO] acme: Registering account for %s", c.user.GetEmail()) - - regMsg := registrationMessage{ - Resource: "new-reg", - } - if c.user.GetEmail() != "" { - regMsg.Contact = []string{"mailto:" + c.user.GetEmail()} - } else { - regMsg.Contact = []string{} - } - - var serverReg Registration - var regURI string - hdr, err := postJSON(c.jws, c.directory.NewRegURL, regMsg, &serverReg) - if err != nil { - remoteErr, ok := err.(RemoteError) - if ok && remoteErr.StatusCode == 409 { - regURI = hdr.Get("Location") - regMsg = registrationMessage{ - Resource: "reg", - } - if hdr, err = postJSON(c.jws, regURI, regMsg, &serverReg); err != nil { - return nil, err - } - } else { - return nil, err - } - } - - reg := &RegistrationResource{Body: serverReg} - - links := parseLinks(hdr["Link"]) - - if regURI == "" { - regURI = hdr.Get("Location") - } - reg.URI = regURI - if links["terms-of-service"] != "" { - reg.TosURL = links["terms-of-service"] - } - - if links["next"] != "" { - reg.NewAuthzURL = links["next"] - } else { - return nil, errors.New("acme: The server did not return 'next' link to proceed") - } - - return reg, nil -} - -// DeleteRegistration deletes the client's user registration from the ACME -// server. -func (c *Client) DeleteRegistration() error { - if c == nil || c.user == nil { - return errors.New("acme: cannot unregister a nil client or user") - } - logf("[INFO] acme: Deleting account for %s", c.user.GetEmail()) - - regMsg := registrationMessage{ - Resource: "reg", - Delete: true, - } - - _, err := postJSON(c.jws, c.user.GetRegistration().URI, regMsg, nil) - if err != nil { - return err - } - - return nil -} - -// QueryRegistration runs a POST request on the client's registration and -// returns the result. -// -// This is similar to the Register function, but acting on an existing -// registration link and resource. -func (c *Client) QueryRegistration() (*RegistrationResource, error) { - if c == nil || c.user == nil { - return nil, errors.New("acme: cannot query the registration of a nil client or user") - } - // Log the URL here instead of the email as the email may not be set - logf("[INFO] acme: Querying account for %s", c.user.GetRegistration().URI) - - regMsg := registrationMessage{ - Resource: "reg", - } - - var serverReg Registration - hdr, err := postJSON(c.jws, c.user.GetRegistration().URI, regMsg, &serverReg) - if err != nil { - return nil, err - } - - reg := &RegistrationResource{Body: serverReg} - - links := parseLinks(hdr["Link"]) - // Location: header is not returned so this needs to be populated off of - // existing URI - reg.URI = c.user.GetRegistration().URI - if links["terms-of-service"] != "" { - reg.TosURL = links["terms-of-service"] - } - - if links["next"] != "" { - reg.NewAuthzURL = links["next"] - } else { - return nil, errors.New("acme: No new-authz link in response to registration query") - } - - return reg, nil -} - -// AgreeToTOS updates the Client registration and sends the agreement to -// the server. -func (c *Client) AgreeToTOS() error { - reg := c.user.GetRegistration() - - reg.Body.Agreement = c.user.GetRegistration().TosURL - reg.Body.Resource = "reg" - _, err := postJSON(c.jws, c.user.GetRegistration().URI, c.user.GetRegistration().Body, nil) - return err -} - -// ObtainCertificateForCSR tries to obtain a certificate matching the CSR passed into it. -// The domains are inferred from the CommonName and SubjectAltNames, if any. The private key -// for this CSR is not required. -// If bundle is true, the []byte contains both the issuer certificate and -// your issued certificate as a bundle. -// This function will never return a partial certificate. If one domain in the list fails, -// the whole certificate will fail. -func (c *Client) ObtainCertificateForCSR(csr x509.CertificateRequest, bundle bool) (CertificateResource, map[string]error) { - // figure out what domains it concerns - // start with the common name - domains := []string{csr.Subject.CommonName} - - // loop over the SubjectAltName DNS names -DNSNames: - for _, sanName := range csr.DNSNames { - for _, existingName := range domains { - if existingName == sanName { - // duplicate; skip this name - continue DNSNames - } - } - - // name is unique - domains = append(domains, sanName) - } - - if bundle { - logf("[INFO][%s] acme: Obtaining bundled SAN certificate given a CSR", strings.Join(domains, ", ")) - } else { - logf("[INFO][%s] acme: Obtaining SAN certificate given a CSR", strings.Join(domains, ", ")) - } - - challenges, failures := c.getChallenges(domains) - // If any challenge fails - return. Do not generate partial SAN certificates. - if len(failures) > 0 { - return CertificateResource{}, failures - } - - errs := c.solveChallenges(challenges) - // If any challenge fails - return. Do not generate partial SAN certificates. - if len(errs) > 0 { - return CertificateResource{}, errs - } - - logf("[INFO][%s] acme: Validations succeeded; requesting certificates", strings.Join(domains, ", ")) - - cert, err := c.requestCertificateForCsr(challenges, bundle, csr.Raw, nil) - if err != nil { - for _, chln := range challenges { - failures[chln.Domain] = err - } - } - - // Add the CSR to the certificate so that it can be used for renewals. - cert.CSR = pemEncode(&csr) - - return cert, failures -} - -// ObtainCertificate tries to obtain a single certificate using all domains passed into it. -// The first domain in domains is used for the CommonName field of the certificate, all other -// domains are added using the Subject Alternate Names extension. A new private key is generated -// for every invocation of this function. If you do not want that you can supply your own private key -// in the privKey parameter. If this parameter is non-nil it will be used instead of generating a new one. -// If bundle is true, the []byte contains both the issuer certificate and -// your issued certificate as a bundle. -// This function will never return a partial certificate. If one domain in the list fails, -// the whole certificate will fail. -func (c *Client) ObtainCertificate(domains []string, bundle bool, privKey crypto.PrivateKey, mustStaple bool) (CertificateResource, map[string]error) { - if bundle { - logf("[INFO][%s] acme: Obtaining bundled SAN certificate", strings.Join(domains, ", ")) - } else { - logf("[INFO][%s] acme: Obtaining SAN certificate", strings.Join(domains, ", ")) - } - - challenges, failures := c.getChallenges(domains) - // If any challenge fails - return. Do not generate partial SAN certificates. - if len(failures) > 0 { - return CertificateResource{}, failures - } - - errs := c.solveChallenges(challenges) - // If any challenge fails - return. Do not generate partial SAN certificates. - if len(errs) > 0 { - return CertificateResource{}, errs - } - - logf("[INFO][%s] acme: Validations succeeded; requesting certificates", strings.Join(domains, ", ")) - - cert, err := c.requestCertificate(challenges, bundle, privKey, mustStaple) - if err != nil { - for _, chln := range challenges { - failures[chln.Domain] = err - } - } - - return cert, failures -} - -// RevokeCertificate takes a PEM encoded certificate or bundle and tries to revoke it at the CA. -func (c *Client) RevokeCertificate(certificate []byte) error { - certificates, err := parsePEMBundle(certificate) - if err != nil { - return err - } - - x509Cert := certificates[0] - if x509Cert.IsCA { - return fmt.Errorf("Certificate bundle starts with a CA certificate") - } - - encodedCert := base64.URLEncoding.EncodeToString(x509Cert.Raw) - - _, err = postJSON(c.jws, c.directory.RevokeCertURL, revokeCertMessage{Resource: "revoke-cert", Certificate: encodedCert}, nil) - return err -} - -// RenewCertificate takes a CertificateResource and tries to renew the certificate. -// If the renewal process succeeds, the new certificate will ge returned in a new CertResource. -// Please be aware that this function will return a new certificate in ANY case that is not an error. -// If the server does not provide us with a new cert on a GET request to the CertURL -// this function will start a new-cert flow where a new certificate gets generated. -// If bundle is true, the []byte contains both the issuer certificate and -// your issued certificate as a bundle. -// For private key reuse the PrivateKey property of the passed in CertificateResource should be non-nil. -func (c *Client) RenewCertificate(cert CertificateResource, bundle, mustStaple bool) (CertificateResource, error) { - // Input certificate is PEM encoded. Decode it here as we may need the decoded - // cert later on in the renewal process. The input may be a bundle or a single certificate. - certificates, err := parsePEMBundle(cert.Certificate) - if err != nil { - return CertificateResource{}, err - } - - x509Cert := certificates[0] - if x509Cert.IsCA { - return CertificateResource{}, fmt.Errorf("[%s] Certificate bundle starts with a CA certificate", cert.Domain) - } - - // This is just meant to be informal for the user. - timeLeft := x509Cert.NotAfter.Sub(time.Now().UTC()) - logf("[INFO][%s] acme: Trying renewal with %d hours remaining", cert.Domain, int(timeLeft.Hours())) - - // We always need to request a new certificate to renew. - // Start by checking to see if the certificate was based off a CSR, and - // use that if it's defined. - if len(cert.CSR) > 0 { - csr, err := pemDecodeTox509CSR(cert.CSR) - if err != nil { - return CertificateResource{}, err - } - newCert, failures := c.ObtainCertificateForCSR(*csr, bundle) - return newCert, failures[cert.Domain] - } - - var privKey crypto.PrivateKey - if cert.PrivateKey != nil { - privKey, err = parsePEMPrivateKey(cert.PrivateKey) - if err != nil { - return CertificateResource{}, err - } - } - - var domains []string - var failures map[string]error - // check for SAN certificate - if len(x509Cert.DNSNames) > 1 { - domains = append(domains, x509Cert.Subject.CommonName) - for _, sanDomain := range x509Cert.DNSNames { - if sanDomain == x509Cert.Subject.CommonName { - continue - } - domains = append(domains, sanDomain) - } - } else { - domains = append(domains, x509Cert.Subject.CommonName) - } - - newCert, failures := c.ObtainCertificate(domains, bundle, privKey, mustStaple) - return newCert, failures[cert.Domain] -} - -// Looks through the challenge combinations to find a solvable match. -// Then solves the challenges in series and returns. -func (c *Client) solveChallenges(challenges []authorizationResource) map[string]error { - // loop through the resources, basically through the domains. - failures := make(map[string]error) - for _, authz := range challenges { - if authz.Body.Status == "valid" { - // Boulder might recycle recent validated authz (see issue #267) - logf("[INFO][%s] acme: Authorization already valid; skipping challenge", authz.Domain) - continue - } - // no solvers - no solving - if solvers := c.chooseSolvers(authz.Body, authz.Domain); solvers != nil { - for i, solver := range solvers { - // TODO: do not immediately fail if one domain fails to validate. - err := solver.Solve(authz.Body.Challenges[i], authz.Domain) - if err != nil { - failures[authz.Domain] = err - } - } - } else { - failures[authz.Domain] = fmt.Errorf("[%s] acme: Could not determine solvers", authz.Domain) - } - } - - return failures -} - -// Checks all combinations from the server and returns an array of -// solvers which should get executed in series. -func (c *Client) chooseSolvers(auth authorization, domain string) map[int]solver { - for _, combination := range auth.Combinations { - solvers := make(map[int]solver) - for _, idx := range combination { - if solver, ok := c.solvers[auth.Challenges[idx].Type]; ok { - solvers[idx] = solver - } else { - logf("[INFO][%s] acme: Could not find solver for: %s", domain, auth.Challenges[idx].Type) - } - } - - // If we can solve the whole combination, return the solvers - if len(solvers) == len(combination) { - return solvers - } - } - return nil -} - -// Get the challenges needed to proof our identifier to the ACME server. -func (c *Client) getChallenges(domains []string) ([]authorizationResource, map[string]error) { - resc, errc := make(chan authorizationResource), make(chan domainError) - - for _, domain := range domains { - go func(domain string) { - authMsg := authorization{Resource: "new-authz", Identifier: identifier{Type: "dns", Value: domain}} - var authz authorization - hdr, err := postJSON(c.jws, c.user.GetRegistration().NewAuthzURL, authMsg, &authz) - if err != nil { - errc <- domainError{Domain: domain, Error: err} - return - } - - links := parseLinks(hdr["Link"]) - if links["next"] == "" { - logf("[ERROR][%s] acme: Server did not provide next link to proceed", domain) - return - } - - resc <- authorizationResource{Body: authz, NewCertURL: links["next"], AuthURL: hdr.Get("Location"), Domain: domain} - }(domain) - } - - responses := make(map[string]authorizationResource) - failures := make(map[string]error) - for i := 0; i < len(domains); i++ { - select { - case res := <-resc: - responses[res.Domain] = res - case err := <-errc: - failures[err.Domain] = err.Error - } - } - - challenges := make([]authorizationResource, 0, len(responses)) - for _, domain := range domains { - if challenge, ok := responses[domain]; ok { - challenges = append(challenges, challenge) - } - } - - close(resc) - close(errc) - - return challenges, failures -} - -func (c *Client) requestCertificate(authz []authorizationResource, bundle bool, privKey crypto.PrivateKey, mustStaple bool) (CertificateResource, error) { - if len(authz) == 0 { - return CertificateResource{}, errors.New("Passed no authorizations to requestCertificate!") - } - - var err error - if privKey == nil { - privKey, err = generatePrivateKey(c.keyType) - if err != nil { - return CertificateResource{}, err - } - } - - // determine certificate name(s) based on the authorization resources - commonName := authz[0] - var san []string - for _, auth := range authz[1:] { - san = append(san, auth.Domain) - } - - // TODO: should the CSR be customizable? - csr, err := generateCsr(privKey, commonName.Domain, san, mustStaple) - if err != nil { - return CertificateResource{}, err - } - - return c.requestCertificateForCsr(authz, bundle, csr, pemEncode(privKey)) -} - -func (c *Client) requestCertificateForCsr(authz []authorizationResource, bundle bool, csr []byte, privateKeyPem []byte) (CertificateResource, error) { - commonName := authz[0] - - var authURLs []string - for _, auth := range authz[1:] { - authURLs = append(authURLs, auth.AuthURL) - } - - csrString := base64.URLEncoding.EncodeToString(csr) - jsonBytes, err := json.Marshal(csrMessage{Resource: "new-cert", Csr: csrString, Authorizations: authURLs}) - if err != nil { - return CertificateResource{}, err - } - - resp, err := c.jws.post(commonName.NewCertURL, jsonBytes) - if err != nil { - return CertificateResource{}, err - } - - cerRes := CertificateResource{ - Domain: commonName.Domain, - CertURL: resp.Header.Get("Location"), - PrivateKey: privateKeyPem} - - for { - switch resp.StatusCode { - case 201, 202: - cert, err := ioutil.ReadAll(limitReader(resp.Body, 1024*1024)) - resp.Body.Close() - if err != nil { - return CertificateResource{}, err - } - - // The server returns a body with a length of zero if the - // certificate was not ready at the time this request completed. - // Otherwise the body is the certificate. - if len(cert) > 0 { - - cerRes.CertStableURL = resp.Header.Get("Content-Location") - cerRes.AccountRef = c.user.GetRegistration().URI - - issuedCert := pemEncode(derCertificateBytes(cert)) - - // The issuer certificate link is always supplied via an "up" link - // in the response headers of a new certificate. - links := parseLinks(resp.Header["Link"]) - issuerCert, err := c.getIssuerCertificate(links["up"]) - if err != nil { - // If we fail to acquire the issuer cert, return the issued certificate - do not fail. - logf("[WARNING][%s] acme: Could not bundle issuer certificate: %v", commonName.Domain, err) - } else { - issuerCert = pemEncode(derCertificateBytes(issuerCert)) - - // If bundle is true, we want to return a certificate bundle. - // To do this, we append the issuer cert to the issued cert. - if bundle { - issuedCert = append(issuedCert, issuerCert...) - } - } - - cerRes.Certificate = issuedCert - cerRes.IssuerCertificate = issuerCert - logf("[INFO][%s] Server responded with a certificate.", commonName.Domain) - return cerRes, nil - } - - // The certificate was granted but is not yet issued. - // Check retry-after and loop. - ra := resp.Header.Get("Retry-After") - retryAfter, err := strconv.Atoi(ra) - if err != nil { - return CertificateResource{}, err - } - - logf("[INFO][%s] acme: Server responded with status 202; retrying after %ds", commonName.Domain, retryAfter) - time.Sleep(time.Duration(retryAfter) * time.Second) - - break - default: - return CertificateResource{}, handleHTTPError(resp) - } - - resp, err = httpGet(cerRes.CertURL) - if err != nil { - return CertificateResource{}, err - } - } -} - -// getIssuerCertificate requests the issuer certificate -func (c *Client) getIssuerCertificate(url string) ([]byte, error) { - logf("[INFO] acme: Requesting issuer cert from %s", url) - resp, err := httpGet(url) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - issuerBytes, err := ioutil.ReadAll(limitReader(resp.Body, 1024*1024)) - if err != nil { - return nil, err - } - - _, err = x509.ParseCertificate(issuerBytes) - if err != nil { - return nil, err - } - - return issuerBytes, err -} - -func parseLinks(links []string) map[string]string { - aBrkt := regexp.MustCompile("[<>]") - slver := regexp.MustCompile("(.+) *= *\"(.+)\"") - linkMap := make(map[string]string) - - for _, link := range links { - - link = aBrkt.ReplaceAllString(link, "") - parts := strings.Split(link, ";") - - matches := slver.FindStringSubmatch(parts[1]) - if len(matches) > 0 { - linkMap[matches[2]] = parts[0] - } - } - - return linkMap -} - -// validate makes the ACME server start validating a -// challenge response, only returning once it is done. -func validate(j *jws, domain, uri string, chlng challenge) error { - var challengeResponse challenge - - hdr, err := postJSON(j, uri, chlng, &challengeResponse) - if err != nil { - return err - } - - // After the path is sent, the ACME server will access our server. - // Repeatedly check the server for an updated status on our request. - for { - switch challengeResponse.Status { - case "valid": - logf("[INFO][%s] The server validated our request", domain) - return nil - case "pending": - break - case "invalid": - return handleChallengeError(challengeResponse) - default: - return errors.New("The server returned an unexpected state.") - } - - ra, err := strconv.Atoi(hdr.Get("Retry-After")) - if err != nil { - // The ACME server MUST return a Retry-After. - // If it doesn't, we'll just poll hard. - ra = 1 - } - time.Sleep(time.Duration(ra) * time.Second) - - hdr, err = getJSON(uri, &challengeResponse) - if err != nil { - return err - } - } -} diff --git a/vendor/github.com/xenolf/lego/acme/crypto.go b/vendor/github.com/xenolf/lego/acme/crypto.go deleted file mode 100644 index fa868a9..0000000 --- a/vendor/github.com/xenolf/lego/acme/crypto.go +++ /dev/null @@ -1,347 +0,0 @@ -package acme - -import ( - "bytes" - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - "crypto/x509" - "crypto/x509/pkix" - "encoding/base64" - "encoding/pem" - "errors" - "fmt" - "io" - "io/ioutil" - "math/big" - "net/http" - "strings" - "time" - - "encoding/asn1" - - "golang.org/x/crypto/ocsp" -) - -// KeyType represents the key algo as well as the key size or curve to use. -type KeyType string -type derCertificateBytes []byte - -// Constants for all key types we support. -const ( - EC256 = KeyType("P256") - EC384 = KeyType("P384") - RSA2048 = KeyType("2048") - RSA4096 = KeyType("4096") - RSA8192 = KeyType("8192") -) - -const ( - // OCSPGood means that the certificate is valid. - OCSPGood = ocsp.Good - // OCSPRevoked means that the certificate has been deliberately revoked. - OCSPRevoked = ocsp.Revoked - // OCSPUnknown means that the OCSP responder doesn't know about the certificate. - OCSPUnknown = ocsp.Unknown - // OCSPServerFailed means that the OCSP responder failed to process the request. - OCSPServerFailed = ocsp.ServerFailed -) - -// Constants for OCSP must staple -var ( - tlsFeatureExtensionOID = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 1, 24} - ocspMustStapleFeature = []byte{0x30, 0x03, 0x02, 0x01, 0x05} -) - -// GetOCSPForCert takes a PEM encoded cert or cert bundle returning the raw OCSP response, -// the parsed response, and an error, if any. The returned []byte can be passed directly -// into the OCSPStaple property of a tls.Certificate. If the bundle only contains the -// issued certificate, this function will try to get the issuer certificate from the -// IssuingCertificateURL in the certificate. If the []byte and/or ocsp.Response return -// values are nil, the OCSP status may be assumed OCSPUnknown. -func GetOCSPForCert(bundle []byte) ([]byte, *ocsp.Response, error) { - certificates, err := parsePEMBundle(bundle) - if err != nil { - return nil, nil, err - } - - // We expect the certificate slice to be ordered downwards the chain. - // SRV CRT -> CA. We need to pull the leaf and issuer certs out of it, - // which should always be the first two certificates. If there's no - // OCSP server listed in the leaf cert, there's nothing to do. And if - // we have only one certificate so far, we need to get the issuer cert. - issuedCert := certificates[0] - if len(issuedCert.OCSPServer) == 0 { - return nil, nil, errors.New("no OCSP server specified in cert") - } - if len(certificates) == 1 { - // TODO: build fallback. If this fails, check the remaining array entries. - if len(issuedCert.IssuingCertificateURL) == 0 { - return nil, nil, errors.New("no issuing certificate URL") - } - - resp, err := httpGet(issuedCert.IssuingCertificateURL[0]) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - issuerBytes, err := ioutil.ReadAll(limitReader(resp.Body, 1024*1024)) - if err != nil { - return nil, nil, err - } - - issuerCert, err := x509.ParseCertificate(issuerBytes) - if err != nil { - return nil, nil, err - } - - // Insert it into the slice on position 0 - // We want it ordered right SRV CRT -> CA - certificates = append(certificates, issuerCert) - } - issuerCert := certificates[1] - - // Finally kick off the OCSP request. - ocspReq, err := ocsp.CreateRequest(issuedCert, issuerCert, nil) - if err != nil { - return nil, nil, err - } - - reader := bytes.NewReader(ocspReq) - req, err := httpPost(issuedCert.OCSPServer[0], "application/ocsp-request", reader) - if err != nil { - return nil, nil, err - } - defer req.Body.Close() - - ocspResBytes, err := ioutil.ReadAll(limitReader(req.Body, 1024*1024)) - ocspRes, err := ocsp.ParseResponse(ocspResBytes, issuerCert) - if err != nil { - return nil, nil, err - } - - return ocspResBytes, ocspRes, nil -} - -func getKeyAuthorization(token string, key interface{}) (string, error) { - var publicKey crypto.PublicKey - switch k := key.(type) { - case *ecdsa.PrivateKey: - publicKey = k.Public() - case *rsa.PrivateKey: - publicKey = k.Public() - } - - // Generate the Key Authorization for the challenge - jwk := keyAsJWK(publicKey) - if jwk == nil { - return "", errors.New("Could not generate JWK from key.") - } - thumbBytes, err := jwk.Thumbprint(crypto.SHA256) - if err != nil { - return "", err - } - - // unpad the base64URL - keyThumb := base64.URLEncoding.EncodeToString(thumbBytes) - index := strings.Index(keyThumb, "=") - if index != -1 { - keyThumb = keyThumb[:index] - } - - return token + "." + keyThumb, nil -} - -// parsePEMBundle parses a certificate bundle from top to bottom and returns -// a slice of x509 certificates. This function will error if no certificates are found. -func parsePEMBundle(bundle []byte) ([]*x509.Certificate, error) { - var certificates []*x509.Certificate - var certDERBlock *pem.Block - - for { - certDERBlock, bundle = pem.Decode(bundle) - if certDERBlock == nil { - break - } - - if certDERBlock.Type == "CERTIFICATE" { - cert, err := x509.ParseCertificate(certDERBlock.Bytes) - if err != nil { - return nil, err - } - certificates = append(certificates, cert) - } - } - - if len(certificates) == 0 { - return nil, errors.New("No certificates were found while parsing the bundle.") - } - - return certificates, nil -} - -func parsePEMPrivateKey(key []byte) (crypto.PrivateKey, error) { - keyBlock, _ := pem.Decode(key) - - switch keyBlock.Type { - case "RSA PRIVATE KEY": - return x509.ParsePKCS1PrivateKey(keyBlock.Bytes) - case "EC PRIVATE KEY": - return x509.ParseECPrivateKey(keyBlock.Bytes) - default: - return nil, errors.New("Unknown PEM header value") - } -} - -func generatePrivateKey(keyType KeyType) (crypto.PrivateKey, error) { - - switch keyType { - case EC256: - return ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - case EC384: - return ecdsa.GenerateKey(elliptic.P384(), rand.Reader) - case RSA2048: - return rsa.GenerateKey(rand.Reader, 2048) - case RSA4096: - return rsa.GenerateKey(rand.Reader, 4096) - case RSA8192: - return rsa.GenerateKey(rand.Reader, 8192) - } - - return nil, fmt.Errorf("Invalid KeyType: %s", keyType) -} - -func generateCsr(privateKey crypto.PrivateKey, domain string, san []string, mustStaple bool) ([]byte, error) { - template := x509.CertificateRequest{ - Subject: pkix.Name{ - CommonName: domain, - }, - } - - if len(san) > 0 { - template.DNSNames = san - } - - if mustStaple { - template.ExtraExtensions = append(template.ExtraExtensions, pkix.Extension{ - Id: tlsFeatureExtensionOID, - Value: ocspMustStapleFeature, - }) - } - - return x509.CreateCertificateRequest(rand.Reader, &template, privateKey) -} - -func pemEncode(data interface{}) []byte { - var pemBlock *pem.Block - switch key := data.(type) { - case *ecdsa.PrivateKey: - keyBytes, _ := x509.MarshalECPrivateKey(key) - pemBlock = &pem.Block{Type: "EC PRIVATE KEY", Bytes: keyBytes} - case *rsa.PrivateKey: - pemBlock = &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(key)} - break - case *x509.CertificateRequest: - pemBlock = &pem.Block{Type: "CERTIFICATE REQUEST", Bytes: key.Raw} - break - case derCertificateBytes: - pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: []byte(data.(derCertificateBytes))} - } - - return pem.EncodeToMemory(pemBlock) -} - -func pemDecode(data []byte) (*pem.Block, error) { - pemBlock, _ := pem.Decode(data) - if pemBlock == nil { - return nil, fmt.Errorf("Pem decode did not yield a valid block. Is the certificate in the right format?") - } - - return pemBlock, nil -} - -func pemDecodeTox509(pem []byte) (*x509.Certificate, error) { - pemBlock, err := pemDecode(pem) - if pemBlock == nil { - return nil, err - } - - return x509.ParseCertificate(pemBlock.Bytes) -} - -func pemDecodeTox509CSR(pem []byte) (*x509.CertificateRequest, error) { - pemBlock, err := pemDecode(pem) - if pemBlock == nil { - return nil, err - } - - if pemBlock.Type != "CERTIFICATE REQUEST" { - return nil, fmt.Errorf("PEM block is not a certificate request") - } - - return x509.ParseCertificateRequest(pemBlock.Bytes) -} - -// GetPEMCertExpiration returns the "NotAfter" date of a PEM encoded certificate. -// The certificate has to be PEM encoded. Any other encodings like DER will fail. -func GetPEMCertExpiration(cert []byte) (time.Time, error) { - pemBlock, err := pemDecode(cert) - if pemBlock == nil { - return time.Time{}, err - } - - return getCertExpiration(pemBlock.Bytes) -} - -// getCertExpiration returns the "NotAfter" date of a DER encoded certificate. -func getCertExpiration(cert []byte) (time.Time, error) { - pCert, err := x509.ParseCertificate(cert) - if err != nil { - return time.Time{}, err - } - - return pCert.NotAfter, nil -} - -func generatePemCert(privKey *rsa.PrivateKey, domain string) ([]byte, error) { - derBytes, err := generateDerCert(privKey, time.Time{}, domain) - if err != nil { - return nil, err - } - - return pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: derBytes}), nil -} - -func generateDerCert(privKey *rsa.PrivateKey, expiration time.Time, domain string) ([]byte, error) { - serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) - serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) - if err != nil { - return nil, err - } - - if expiration.IsZero() { - expiration = time.Now().Add(365) - } - - template := x509.Certificate{ - SerialNumber: serialNumber, - Subject: pkix.Name{ - CommonName: "ACME Challenge TEMP", - }, - NotBefore: time.Now(), - NotAfter: expiration, - - KeyUsage: x509.KeyUsageKeyEncipherment, - BasicConstraintsValid: true, - DNSNames: []string{domain}, - } - - return x509.CreateCertificate(rand.Reader, &template, &template, &privKey.PublicKey, privKey) -} - -func limitReader(rd io.ReadCloser, numBytes int64) io.ReadCloser { - return http.MaxBytesReader(nil, rd, numBytes) -} diff --git a/vendor/github.com/xenolf/lego/acme/dns_challenge.go b/vendor/github.com/xenolf/lego/acme/dns_challenge.go deleted file mode 100644 index 30f2170..0000000 --- a/vendor/github.com/xenolf/lego/acme/dns_challenge.go +++ /dev/null @@ -1,305 +0,0 @@ -package acme - -import ( - "crypto/sha256" - "encoding/base64" - "errors" - "fmt" - "log" - "net" - "strings" - "time" - - "github.com/miekg/dns" - "golang.org/x/net/publicsuffix" -) - -type preCheckDNSFunc func(fqdn, value string) (bool, error) - -var ( - // PreCheckDNS checks DNS propagation before notifying ACME that - // the DNS challenge is ready. - PreCheckDNS preCheckDNSFunc = checkDNSPropagation - fqdnToZone = map[string]string{} -) - -const defaultResolvConf = "/etc/resolv.conf" - -var defaultNameservers = []string{ - "google-public-dns-a.google.com:53", - "google-public-dns-b.google.com:53", -} - -var RecursiveNameservers = getNameservers(defaultResolvConf, defaultNameservers) - -// DNSTimeout is used to override the default DNS timeout of 10 seconds. -var DNSTimeout = 10 * time.Second - -// getNameservers attempts to get systems nameservers before falling back to the defaults -func getNameservers(path string, defaults []string) []string { - config, err := dns.ClientConfigFromFile(path) - if err != nil || len(config.Servers) == 0 { - return defaults - } - - systemNameservers := []string{} - for _, server := range config.Servers { - // ensure all servers have a port number - if _, _, err := net.SplitHostPort(server); err != nil { - systemNameservers = append(systemNameservers, net.JoinHostPort(server, "53")) - } else { - systemNameservers = append(systemNameservers, server) - } - } - return systemNameservers -} - -// DNS01Record returns a DNS record which will fulfill the `dns-01` challenge -func DNS01Record(domain, keyAuth string) (fqdn string, value string, ttl int) { - keyAuthShaBytes := sha256.Sum256([]byte(keyAuth)) - // base64URL encoding without padding - keyAuthSha := base64.URLEncoding.EncodeToString(keyAuthShaBytes[:sha256.Size]) - value = strings.TrimRight(keyAuthSha, "=") - ttl = 120 - fqdn = fmt.Sprintf("_acme-challenge.%s.", domain) - return -} - -// dnsChallenge implements the dns-01 challenge according to ACME 7.5 -type dnsChallenge struct { - jws *jws - validate validateFunc - provider ChallengeProvider -} - -func (s *dnsChallenge) Solve(chlng challenge, domain string) error { - logf("[INFO][%s] acme: Trying to solve DNS-01", domain) - - if s.provider == nil { - return errors.New("No DNS Provider configured") - } - - // Generate the Key Authorization for the challenge - keyAuth, err := getKeyAuthorization(chlng.Token, s.jws.privKey) - if err != nil { - return err - } - - err = s.provider.Present(domain, chlng.Token, keyAuth) - if err != nil { - return fmt.Errorf("Error presenting token: %s", err) - } - defer func() { - err := s.provider.CleanUp(domain, chlng.Token, keyAuth) - if err != nil { - log.Printf("Error cleaning up %s: %v ", domain, err) - } - }() - - fqdn, value, _ := DNS01Record(domain, keyAuth) - - logf("[INFO][%s] Checking DNS record propagation using %+v", domain, RecursiveNameservers) - - var timeout, interval time.Duration - switch provider := s.provider.(type) { - case ChallengeProviderTimeout: - timeout, interval = provider.Timeout() - default: - timeout, interval = 60*time.Second, 2*time.Second - } - - err = WaitFor(timeout, interval, func() (bool, error) { - return PreCheckDNS(fqdn, value) - }) - if err != nil { - return err - } - - return s.validate(s.jws, domain, chlng.URI, challenge{Resource: "challenge", Type: chlng.Type, Token: chlng.Token, KeyAuthorization: keyAuth}) -} - -// checkDNSPropagation checks if the expected TXT record has been propagated to all authoritative nameservers. -func checkDNSPropagation(fqdn, value string) (bool, error) { - // Initial attempt to resolve at the recursive NS - r, err := dnsQuery(fqdn, dns.TypeTXT, RecursiveNameservers, true) - if err != nil { - return false, err - } - if r.Rcode == dns.RcodeSuccess { - // If we see a CNAME here then use the alias - for _, rr := range r.Answer { - if cn, ok := rr.(*dns.CNAME); ok { - if cn.Hdr.Name == fqdn { - fqdn = cn.Target - break - } - } - } - } - - authoritativeNss, err := lookupNameservers(fqdn) - if err != nil { - return false, err - } - - return checkAuthoritativeNss(fqdn, value, authoritativeNss) -} - -// checkAuthoritativeNss queries each of the given nameservers for the expected TXT record. -func checkAuthoritativeNss(fqdn, value string, nameservers []string) (bool, error) { - for _, ns := range nameservers { - r, err := dnsQuery(fqdn, dns.TypeTXT, []string{net.JoinHostPort(ns, "53")}, false) - if err != nil { - return false, err - } - - if r.Rcode != dns.RcodeSuccess { - return false, fmt.Errorf("NS %s returned %s for %s", ns, dns.RcodeToString[r.Rcode], fqdn) - } - - var found bool - for _, rr := range r.Answer { - if txt, ok := rr.(*dns.TXT); ok { - if strings.Join(txt.Txt, "") == value { - found = true - break - } - } - } - - if !found { - return false, fmt.Errorf("NS %s did not return the expected TXT record", ns) - } - } - - return true, nil -} - -// dnsQuery will query a nameserver, iterating through the supplied servers as it retries -// The nameserver should include a port, to facilitate testing where we talk to a mock dns server. -func dnsQuery(fqdn string, rtype uint16, nameservers []string, recursive bool) (in *dns.Msg, err error) { - m := new(dns.Msg) - m.SetQuestion(fqdn, rtype) - m.SetEdns0(4096, false) - - if !recursive { - m.RecursionDesired = false - } - - // Will retry the request based on the number of servers (n+1) - for i := 1; i <= len(nameservers)+1; i++ { - ns := nameservers[i%len(nameservers)] - udp := &dns.Client{Net: "udp", Timeout: DNSTimeout} - in, _, err = udp.Exchange(m, ns) - - if err == dns.ErrTruncated { - tcp := &dns.Client{Net: "tcp", Timeout: DNSTimeout} - // If the TCP request suceeds, the err will reset to nil - in, _, err = tcp.Exchange(m, ns) - } - - if err == nil { - break - } - } - return -} - -// lookupNameservers returns the authoritative nameservers for the given fqdn. -func lookupNameservers(fqdn string) ([]string, error) { - var authoritativeNss []string - - zone, err := FindZoneByFqdn(fqdn, RecursiveNameservers) - if err != nil { - return nil, fmt.Errorf("Could not determine the zone: %v", err) - } - - r, err := dnsQuery(zone, dns.TypeNS, RecursiveNameservers, true) - if err != nil { - return nil, err - } - - for _, rr := range r.Answer { - if ns, ok := rr.(*dns.NS); ok { - authoritativeNss = append(authoritativeNss, strings.ToLower(ns.Ns)) - } - } - - if len(authoritativeNss) > 0 { - return authoritativeNss, nil - } - return nil, fmt.Errorf("Could not determine authoritative nameservers") -} - -// FindZoneByFqdn determines the zone apex for the given fqdn by recursing up the -// domain labels until the nameserver returns a SOA record in the answer section. -func FindZoneByFqdn(fqdn string, nameservers []string) (string, error) { - // Do we have it cached? - if zone, ok := fqdnToZone[fqdn]; ok { - return zone, nil - } - - labelIndexes := dns.Split(fqdn) - for _, index := range labelIndexes { - domain := fqdn[index:] - // Give up if we have reached the TLD - if isTLD(domain) { - break - } - - in, err := dnsQuery(domain, dns.TypeSOA, nameservers, true) - if err != nil { - return "", err - } - - // Any response code other than NOERROR and NXDOMAIN is treated as error - if in.Rcode != dns.RcodeNameError && in.Rcode != dns.RcodeSuccess { - return "", fmt.Errorf("Unexpected response code '%s' for %s", - dns.RcodeToString[in.Rcode], domain) - } - - // Check if we got a SOA RR in the answer section - if in.Rcode == dns.RcodeSuccess { - for _, ans := range in.Answer { - if soa, ok := ans.(*dns.SOA); ok { - zone := soa.Hdr.Name - fqdnToZone[fqdn] = zone - return zone, nil - } - } - } - } - - return "", fmt.Errorf("Could not find the start of authority") -} - -func isTLD(domain string) bool { - publicsuffix, _ := publicsuffix.PublicSuffix(UnFqdn(domain)) - if publicsuffix == UnFqdn(domain) { - return true - } - return false -} - -// ClearFqdnCache clears the cache of fqdn to zone mappings. Primarily used in testing. -func ClearFqdnCache() { - fqdnToZone = map[string]string{} -} - -// ToFqdn converts the name into a fqdn appending a trailing dot. -func ToFqdn(name string) string { - n := len(name) - if n == 0 || name[n-1] == '.' { - return name - } - return name + "." -} - -// UnFqdn converts the fqdn into a name removing the trailing dot. -func UnFqdn(name string) string { - n := len(name) - if n != 0 && name[n-1] == '.' { - return name[:n-1] - } - return name -} diff --git a/vendor/github.com/xenolf/lego/acme/dns_challenge_manual.go b/vendor/github.com/xenolf/lego/acme/dns_challenge_manual.go deleted file mode 100644 index 240384e..0000000 --- a/vendor/github.com/xenolf/lego/acme/dns_challenge_manual.go +++ /dev/null @@ -1,53 +0,0 @@ -package acme - -import ( - "bufio" - "fmt" - "os" -) - -const ( - dnsTemplate = "%s %d IN TXT \"%s\"" -) - -// DNSProviderManual is an implementation of the ChallengeProvider interface -type DNSProviderManual struct{} - -// NewDNSProviderManual returns a DNSProviderManual instance. -func NewDNSProviderManual() (*DNSProviderManual, error) { - return &DNSProviderManual{}, nil -} - -// Present prints instructions for manually creating the TXT record -func (*DNSProviderManual) Present(domain, token, keyAuth string) error { - fqdn, value, ttl := DNS01Record(domain, keyAuth) - dnsRecord := fmt.Sprintf(dnsTemplate, fqdn, ttl, value) - - authZone, err := FindZoneByFqdn(fqdn, RecursiveNameservers) - if err != nil { - return err - } - - logf("[INFO] acme: Please create the following TXT record in your %s zone:", authZone) - logf("[INFO] acme: %s", dnsRecord) - logf("[INFO] acme: Press 'Enter' when you are done") - - reader := bufio.NewReader(os.Stdin) - _, _ = reader.ReadString('\n') - return nil -} - -// CleanUp prints instructions for manually removing the TXT record -func (*DNSProviderManual) CleanUp(domain, token, keyAuth string) error { - fqdn, _, ttl := DNS01Record(domain, keyAuth) - dnsRecord := fmt.Sprintf(dnsTemplate, fqdn, ttl, "...") - - authZone, err := FindZoneByFqdn(fqdn, RecursiveNameservers) - if err != nil { - return err - } - - logf("[INFO] acme: You can now remove this TXT record from your %s zone:", authZone) - logf("[INFO] acme: %s", dnsRecord) - return nil -} diff --git a/vendor/github.com/xenolf/lego/acme/error.go b/vendor/github.com/xenolf/lego/acme/error.go deleted file mode 100644 index 2aa690b..0000000 --- a/vendor/github.com/xenolf/lego/acme/error.go +++ /dev/null @@ -1,86 +0,0 @@ -package acme - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "strings" -) - -const ( - tosAgreementError = "Must agree to subscriber agreement before any further actions" -) - -// RemoteError is the base type for all errors specific to the ACME protocol. -type RemoteError struct { - StatusCode int `json:"status,omitempty"` - Type string `json:"type"` - Detail string `json:"detail"` -} - -func (e RemoteError) Error() string { - return fmt.Sprintf("acme: Error %d - %s - %s", e.StatusCode, e.Type, e.Detail) -} - -// TOSError represents the error which is returned if the user needs to -// accept the TOS. -// TODO: include the new TOS url if we can somehow obtain it. -type TOSError struct { - RemoteError -} - -type domainError struct { - Domain string - Error error -} - -type challengeError struct { - RemoteError - records []validationRecord -} - -func (c challengeError) Error() string { - - var errStr string - for _, validation := range c.records { - errStr = errStr + fmt.Sprintf("\tValidation for %s:%s\n\tResolved to:\n\t\t%s\n\tUsed: %s\n\n", - validation.Hostname, validation.Port, strings.Join(validation.ResolvedAddresses, "\n\t\t"), validation.UsedAddress) - } - - return fmt.Sprintf("%s\nError Detail:\n%s", c.RemoteError.Error(), errStr) -} - -func handleHTTPError(resp *http.Response) error { - var errorDetail RemoteError - - contenType := resp.Header.Get("Content-Type") - // try to decode the content as JSON - if contenType == "application/json" || contenType == "application/problem+json" { - decoder := json.NewDecoder(resp.Body) - err := decoder.Decode(&errorDetail) - if err != nil { - return err - } - } else { - detailBytes, err := ioutil.ReadAll(limitReader(resp.Body, 1024*1024)) - if err != nil { - return err - } - - errorDetail.Detail = string(detailBytes) - } - - errorDetail.StatusCode = resp.StatusCode - - // Check for errors we handle specifically - if errorDetail.StatusCode == http.StatusForbidden && errorDetail.Detail == tosAgreementError { - return TOSError{errorDetail} - } - - return errorDetail -} - -func handleChallengeError(chlng challenge) error { - return challengeError{chlng.Error, chlng.ValidationRecords} -} diff --git a/vendor/github.com/xenolf/lego/acme/http.go b/vendor/github.com/xenolf/lego/acme/http.go deleted file mode 100644 index 180db78..0000000 --- a/vendor/github.com/xenolf/lego/acme/http.go +++ /dev/null @@ -1,117 +0,0 @@ -package acme - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "runtime" - "strings" - "time" -) - -// UserAgent (if non-empty) will be tacked onto the User-Agent string in requests. -var UserAgent string - -// HTTPClient is an HTTP client with a reasonable timeout value. -var HTTPClient = http.Client{Timeout: 10 * time.Second} - -const ( - // defaultGoUserAgent is the Go HTTP package user agent string. Too - // bad it isn't exported. If it changes, we should update it here, too. - defaultGoUserAgent = "Go-http-client/1.1" - - // ourUserAgent is the User-Agent of this underlying library package. - ourUserAgent = "xenolf-acme" -) - -// httpHead performs a HEAD request with a proper User-Agent string. -// The response body (resp.Body) is already closed when this function returns. -func httpHead(url string) (resp *http.Response, err error) { - req, err := http.NewRequest("HEAD", url, nil) - if err != nil { - return nil, err - } - - req.Header.Set("User-Agent", userAgent()) - - resp, err = HTTPClient.Do(req) - if err != nil { - return resp, err - } - resp.Body.Close() - return resp, err -} - -// httpPost performs a POST request with a proper User-Agent string. -// Callers should close resp.Body when done reading from it. -func httpPost(url string, bodyType string, body io.Reader) (resp *http.Response, err error) { - req, err := http.NewRequest("POST", url, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyType) - req.Header.Set("User-Agent", userAgent()) - - return HTTPClient.Do(req) -} - -// httpGet performs a GET request with a proper User-Agent string. -// Callers should close resp.Body when done reading from it. -func httpGet(url string) (resp *http.Response, err error) { - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - req.Header.Set("User-Agent", userAgent()) - - return HTTPClient.Do(req) -} - -// getJSON performs an HTTP GET request and parses the response body -// as JSON, into the provided respBody object. -func getJSON(uri string, respBody interface{}) (http.Header, error) { - resp, err := httpGet(uri) - if err != nil { - return nil, fmt.Errorf("failed to get %q: %v", uri, err) - } - defer resp.Body.Close() - - if resp.StatusCode >= http.StatusBadRequest { - return resp.Header, handleHTTPError(resp) - } - - return resp.Header, json.NewDecoder(resp.Body).Decode(respBody) -} - -// postJSON performs an HTTP POST request and parses the response body -// as JSON, into the provided respBody object. -func postJSON(j *jws, uri string, reqBody, respBody interface{}) (http.Header, error) { - jsonBytes, err := json.Marshal(reqBody) - if err != nil { - return nil, errors.New("Failed to marshal network message...") - } - - resp, err := j.post(uri, jsonBytes) - if err != nil { - return nil, fmt.Errorf("Failed to post JWS message. -> %v", err) - } - defer resp.Body.Close() - - if resp.StatusCode >= http.StatusBadRequest { - return resp.Header, handleHTTPError(resp) - } - - if respBody == nil { - return resp.Header, nil - } - - return resp.Header, json.NewDecoder(resp.Body).Decode(respBody) -} - -// userAgent builds and returns the User-Agent string to use in requests. -func userAgent() string { - ua := fmt.Sprintf("%s (%s; %s) %s %s", defaultGoUserAgent, runtime.GOOS, runtime.GOARCH, ourUserAgent, UserAgent) - return strings.TrimSpace(ua) -} diff --git a/vendor/github.com/xenolf/lego/acme/http_challenge.go b/vendor/github.com/xenolf/lego/acme/http_challenge.go deleted file mode 100644 index 95cb1fd..0000000 --- a/vendor/github.com/xenolf/lego/acme/http_challenge.go +++ /dev/null @@ -1,41 +0,0 @@ -package acme - -import ( - "fmt" - "log" -) - -type httpChallenge struct { - jws *jws - validate validateFunc - provider ChallengeProvider -} - -// HTTP01ChallengePath returns the URL path for the `http-01` challenge -func HTTP01ChallengePath(token string) string { - return "/.well-known/acme-challenge/" + token -} - -func (s *httpChallenge) Solve(chlng challenge, domain string) error { - - logf("[INFO][%s] acme: Trying to solve HTTP-01", domain) - - // Generate the Key Authorization for the challenge - keyAuth, err := getKeyAuthorization(chlng.Token, s.jws.privKey) - if err != nil { - return err - } - - err = s.provider.Present(domain, chlng.Token, keyAuth) - if err != nil { - return fmt.Errorf("[%s] error presenting token: %v", domain, err) - } - defer func() { - err := s.provider.CleanUp(domain, chlng.Token, keyAuth) - if err != nil { - log.Printf("[%s] error cleaning up: %v", domain, err) - } - }() - - return s.validate(s.jws, domain, chlng.URI, challenge{Resource: "challenge", Type: chlng.Type, Token: chlng.Token, KeyAuthorization: keyAuth}) -} diff --git a/vendor/github.com/xenolf/lego/acme/http_challenge_server.go b/vendor/github.com/xenolf/lego/acme/http_challenge_server.go deleted file mode 100644 index 64c6a82..0000000 --- a/vendor/github.com/xenolf/lego/acme/http_challenge_server.go +++ /dev/null @@ -1,79 +0,0 @@ -package acme - -import ( - "fmt" - "net" - "net/http" - "strings" -) - -// HTTPProviderServer implements ChallengeProvider for `http-01` challenge -// It may be instantiated without using the NewHTTPProviderServer function if -// you want only to use the default values. -type HTTPProviderServer struct { - iface string - port string - done chan bool - listener net.Listener -} - -// NewHTTPProviderServer creates a new HTTPProviderServer on the selected interface and port. -// Setting iface and / or port to an empty string will make the server fall back to -// the "any" interface and port 80 respectively. -func NewHTTPProviderServer(iface, port string) *HTTPProviderServer { - return &HTTPProviderServer{iface: iface, port: port} -} - -// Present starts a web server and makes the token available at `HTTP01ChallengePath(token)` for web requests. -func (s *HTTPProviderServer) Present(domain, token, keyAuth string) error { - if s.port == "" { - s.port = "80" - } - - var err error - s.listener, err = net.Listen("tcp", net.JoinHostPort(s.iface, s.port)) - if err != nil { - return fmt.Errorf("Could not start HTTP server for challenge -> %v", err) - } - - s.done = make(chan bool) - go s.serve(domain, token, keyAuth) - return nil -} - -// CleanUp closes the HTTP server and removes the token from `HTTP01ChallengePath(token)` -func (s *HTTPProviderServer) CleanUp(domain, token, keyAuth string) error { - if s.listener == nil { - return nil - } - s.listener.Close() - <-s.done - return nil -} - -func (s *HTTPProviderServer) serve(domain, token, keyAuth string) { - path := HTTP01ChallengePath(token) - - // The handler validates the HOST header and request type. - // For validation it then writes the token the server returned with the challenge - mux := http.NewServeMux() - mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { - if strings.HasPrefix(r.Host, domain) && r.Method == "GET" { - w.Header().Add("Content-Type", "text/plain") - w.Write([]byte(keyAuth)) - logf("[INFO][%s] Served key authentication", domain) - } else { - logf("[WARN] Received request for domain %s with method %s but the domain did not match any challenge. Please ensure your are passing the HOST header properly.", r.Host, r.Method) - w.Write([]byte("TEST")) - } - }) - - httpServer := &http.Server{ - Handler: mux, - } - // Once httpServer is shut down we don't want any lingering - // connections, so disable KeepAlives. - httpServer.SetKeepAlivesEnabled(false) - httpServer.Serve(s.listener) - s.done <- true -} diff --git a/vendor/github.com/xenolf/lego/acme/jws.go b/vendor/github.com/xenolf/lego/acme/jws.go deleted file mode 100644 index 8029608..0000000 --- a/vendor/github.com/xenolf/lego/acme/jws.go +++ /dev/null @@ -1,115 +0,0 @@ -package acme - -import ( - "bytes" - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rsa" - "fmt" - "net/http" - "sync" - - "gopkg.in/square/go-jose.v1" -) - -type jws struct { - directoryURL string - privKey crypto.PrivateKey - nonces []string - sync.Mutex -} - -func keyAsJWK(key interface{}) *jose.JsonWebKey { - switch k := key.(type) { - case *ecdsa.PublicKey: - return &jose.JsonWebKey{Key: k, Algorithm: "EC"} - case *rsa.PublicKey: - return &jose.JsonWebKey{Key: k, Algorithm: "RSA"} - - default: - return nil - } -} - -// Posts a JWS signed message to the specified URL -func (j *jws) post(url string, content []byte) (*http.Response, error) { - signedContent, err := j.signContent(content) - if err != nil { - return nil, err - } - - resp, err := httpPost(url, "application/jose+json", bytes.NewBuffer([]byte(signedContent.FullSerialize()))) - if err != nil { - return nil, err - } - - j.Lock() - defer j.Unlock() - j.getNonceFromResponse(resp) - - return resp, err -} - -func (j *jws) signContent(content []byte) (*jose.JsonWebSignature, error) { - - var alg jose.SignatureAlgorithm - switch k := j.privKey.(type) { - case *rsa.PrivateKey: - alg = jose.RS256 - case *ecdsa.PrivateKey: - if k.Curve == elliptic.P256() { - alg = jose.ES256 - } else if k.Curve == elliptic.P384() { - alg = jose.ES384 - } - } - - signer, err := jose.NewSigner(alg, j.privKey) - if err != nil { - return nil, err - } - signer.SetNonceSource(j) - - signed, err := signer.Sign(content) - if err != nil { - return nil, err - } - return signed, nil -} - -func (j *jws) getNonceFromResponse(resp *http.Response) error { - nonce := resp.Header.Get("Replay-Nonce") - if nonce == "" { - return fmt.Errorf("Server did not respond with a proper nonce header.") - } - - j.nonces = append(j.nonces, nonce) - return nil -} - -func (j *jws) getNonce() error { - resp, err := httpHead(j.directoryURL) - if err != nil { - return err - } - - return j.getNonceFromResponse(resp) -} - -func (j *jws) Nonce() (string, error) { - j.Lock() - defer j.Unlock() - nonce := "" - if len(j.nonces) == 0 { - err := j.getNonce() - if err != nil { - return nonce, err - } - } - if len(j.nonces) == 0 { - return "", fmt.Errorf("Can't get nonce") - } - nonce, j.nonces = j.nonces[len(j.nonces)-1], j.nonces[:len(j.nonces)-1] - return nonce, nil -} diff --git a/vendor/github.com/xenolf/lego/acme/messages.go b/vendor/github.com/xenolf/lego/acme/messages.go deleted file mode 100644 index 36db3b2..0000000 --- a/vendor/github.com/xenolf/lego/acme/messages.go +++ /dev/null @@ -1,110 +0,0 @@ -package acme - -import ( - "time" - - "gopkg.in/square/go-jose.v1" -) - -type directory struct { - NewAuthzURL string `json:"new-authz"` - NewCertURL string `json:"new-cert"` - NewRegURL string `json:"new-reg"` - RevokeCertURL string `json:"revoke-cert"` -} - -type registrationMessage struct { - Resource string `json:"resource"` - Contact []string `json:"contact"` - Delete bool `json:"delete,omitempty"` -} - -// Registration is returned by the ACME server after the registration -// The client implementation should save this registration somewhere. -type Registration struct { - Resource string `json:"resource,omitempty"` - ID int `json:"id"` - Key jose.JsonWebKey `json:"key"` - Contact []string `json:"contact"` - Agreement string `json:"agreement,omitempty"` - Authorizations string `json:"authorizations,omitempty"` - Certificates string `json:"certificates,omitempty"` -} - -// RegistrationResource represents all important informations about a registration -// of which the client needs to keep track itself. -type RegistrationResource struct { - Body Registration `json:"body,omitempty"` - URI string `json:"uri,omitempty"` - NewAuthzURL string `json:"new_authzr_uri,omitempty"` - TosURL string `json:"terms_of_service,omitempty"` -} - -type authorizationResource struct { - Body authorization - Domain string - NewCertURL string - AuthURL string -} - -type authorization struct { - Resource string `json:"resource,omitempty"` - Identifier identifier `json:"identifier"` - Status string `json:"status,omitempty"` - Expires time.Time `json:"expires,omitempty"` - Challenges []challenge `json:"challenges,omitempty"` - Combinations [][]int `json:"combinations,omitempty"` -} - -type identifier struct { - Type string `json:"type"` - Value string `json:"value"` -} - -type validationRecord struct { - URI string `json:"url,omitempty"` - Hostname string `json:"hostname,omitempty"` - Port string `json:"port,omitempty"` - ResolvedAddresses []string `json:"addressesResolved,omitempty"` - UsedAddress string `json:"addressUsed,omitempty"` -} - -type challenge struct { - Resource string `json:"resource,omitempty"` - Type Challenge `json:"type,omitempty"` - Status string `json:"status,omitempty"` - URI string `json:"uri,omitempty"` - Token string `json:"token,omitempty"` - KeyAuthorization string `json:"keyAuthorization,omitempty"` - TLS bool `json:"tls,omitempty"` - Iterations int `json:"n,omitempty"` - Error RemoteError `json:"error,omitempty"` - ValidationRecords []validationRecord `json:"validationRecord,omitempty"` -} - -type csrMessage struct { - Resource string `json:"resource,omitempty"` - Csr string `json:"csr"` - Authorizations []string `json:"authorizations"` -} - -type revokeCertMessage struct { - Resource string `json:"resource"` - Certificate string `json:"certificate"` -} - -// CertificateResource represents a CA issued certificate. -// PrivateKey, Certificate and IssuerCertificate are all -// already PEM encoded and can be directly written to disk. -// Certificate may be a certificate bundle, depending on the -// options supplied to create it. -type CertificateResource struct { - Domain string `json:"domain"` - CertURL string `json:"certUrl"` - CertStableURL string `json:"certStableUrl"` - AccountRef string `json:"accountRef,omitempty"` - PrivateKey []byte `json:"-"` - Certificate []byte `json:"-"` - IssuerCertificate []byte `json:"-"` - CSR []byte `json:"-"` -} diff --git a/vendor/github.com/xenolf/lego/acme/pop_challenge.go b/vendor/github.com/xenolf/lego/acme/pop_challenge.go deleted file mode 100644 index 8d2a213..0000000 --- a/vendor/github.com/xenolf/lego/acme/pop_challenge.go +++ /dev/null @@ -1 +0,0 @@ -package acme diff --git a/vendor/github.com/xenolf/lego/acme/provider.go b/vendor/github.com/xenolf/lego/acme/provider.go deleted file mode 100644 index d177ff0..0000000 --- a/vendor/github.com/xenolf/lego/acme/provider.go +++ /dev/null @@ -1,28 +0,0 @@ -package acme - -import "time" - -// ChallengeProvider enables implementing a custom challenge -// provider. Present presents the solution to a challenge available to -// be solved. CleanUp will be called by the challenge if Present ends -// in a non-error state. -type ChallengeProvider interface { - Present(domain, token, keyAuth string) error - CleanUp(domain, token, keyAuth string) error -} - -// ChallengeProviderTimeout allows for implementing a -// ChallengeProvider where an unusually long timeout is required when -// waiting for an ACME challenge to be satisfied, such as when -// checking for DNS record progagation. If an implementor of a -// ChallengeProvider provides a Timeout method, then the return values -// of the Timeout method will be used when appropriate by the acme -// package. The interval value is the time between checks. -// -// The default values used for timeout and interval are 60 seconds and -// 2 seconds respectively. These are used when no Timeout method is -// defined for the ChallengeProvider. -type ChallengeProviderTimeout interface { - ChallengeProvider - Timeout() (timeout, interval time.Duration) -} diff --git a/vendor/github.com/xenolf/lego/acme/tls_sni_challenge.go b/vendor/github.com/xenolf/lego/acme/tls_sni_challenge.go deleted file mode 100644 index 34383cb..0000000 --- a/vendor/github.com/xenolf/lego/acme/tls_sni_challenge.go +++ /dev/null @@ -1,67 +0,0 @@ -package acme - -import ( - "crypto/rsa" - "crypto/sha256" - "crypto/tls" - "encoding/hex" - "fmt" - "log" -) - -type tlsSNIChallenge struct { - jws *jws - validate validateFunc - provider ChallengeProvider -} - -func (t *tlsSNIChallenge) Solve(chlng challenge, domain string) error { - // FIXME: https://github.com/ietf-wg-acme/acme/pull/22 - // Currently we implement this challenge to track boulder, not the current spec! - - logf("[INFO][%s] acme: Trying to solve TLS-SNI-01", domain) - - // Generate the Key Authorization for the challenge - keyAuth, err := getKeyAuthorization(chlng.Token, t.jws.privKey) - if err != nil { - return err - } - - err = t.provider.Present(domain, chlng.Token, keyAuth) - if err != nil { - return fmt.Errorf("[%s] error presenting token: %v", domain, err) - } - defer func() { - err := t.provider.CleanUp(domain, chlng.Token, keyAuth) - if err != nil { - log.Printf("[%s] error cleaning up: %v", domain, err) - } - }() - return t.validate(t.jws, domain, chlng.URI, challenge{Resource: "challenge", Type: chlng.Type, Token: chlng.Token, KeyAuthorization: keyAuth}) -} - -// TLSSNI01ChallengeCert returns a certificate and target domain for the `tls-sni-01` challenge -func TLSSNI01ChallengeCert(keyAuth string) (tls.Certificate, string, error) { - // generate a new RSA key for the certificates - tempPrivKey, err := generatePrivateKey(RSA2048) - if err != nil { - return tls.Certificate{}, "", err - } - rsaPrivKey := tempPrivKey.(*rsa.PrivateKey) - rsaPrivPEM := pemEncode(rsaPrivKey) - - zBytes := sha256.Sum256([]byte(keyAuth)) - z := hex.EncodeToString(zBytes[:sha256.Size]) - domain := fmt.Sprintf("%s.%s.acme.invalid", z[:32], z[32:]) - tempCertPEM, err := generatePemCert(rsaPrivKey, domain) - if err != nil { - return tls.Certificate{}, "", err - } - - certificate, err := tls.X509KeyPair(tempCertPEM, rsaPrivPEM) - if err != nil { - return tls.Certificate{}, "", err - } - - return certificate, domain, nil -} diff --git a/vendor/github.com/xenolf/lego/acme/tls_sni_challenge_server.go b/vendor/github.com/xenolf/lego/acme/tls_sni_challenge_server.go deleted file mode 100644 index df00fbb..0000000 --- a/vendor/github.com/xenolf/lego/acme/tls_sni_challenge_server.go +++ /dev/null @@ -1,62 +0,0 @@ -package acme - -import ( - "crypto/tls" - "fmt" - "net" - "net/http" -) - -// TLSProviderServer implements ChallengeProvider for `TLS-SNI-01` challenge -// It may be instantiated without using the NewTLSProviderServer function if -// you want only to use the default values. -type TLSProviderServer struct { - iface string - port string - done chan bool - listener net.Listener -} - -// NewTLSProviderServer creates a new TLSProviderServer on the selected interface and port. -// Setting iface and / or port to an empty string will make the server fall back to -// the "any" interface and port 443 respectively. -func NewTLSProviderServer(iface, port string) *TLSProviderServer { - return &TLSProviderServer{iface: iface, port: port} -} - -// Present makes the keyAuth available as a cert -func (s *TLSProviderServer) Present(domain, token, keyAuth string) error { - if s.port == "" { - s.port = "443" - } - - cert, _, err := TLSSNI01ChallengeCert(keyAuth) - if err != nil { - return err - } - - tlsConf := new(tls.Config) - tlsConf.Certificates = []tls.Certificate{cert} - - s.listener, err = tls.Listen("tcp", net.JoinHostPort(s.iface, s.port), tlsConf) - if err != nil { - return fmt.Errorf("Could not start HTTPS server for challenge -> %v", err) - } - - s.done = make(chan bool) - go func() { - http.Serve(s.listener, nil) - s.done <- true - }() - return nil -} - -// CleanUp closes the HTTP server. -func (s *TLSProviderServer) CleanUp(domain, token, keyAuth string) error { - if s.listener == nil { - return nil - } - s.listener.Close() - <-s.done - return nil -} diff --git a/vendor/github.com/xenolf/lego/acme/utils.go b/vendor/github.com/xenolf/lego/acme/utils.go deleted file mode 100644 index 2fa0db3..0000000 --- a/vendor/github.com/xenolf/lego/acme/utils.go +++ /dev/null @@ -1,29 +0,0 @@ -package acme - -import ( - "fmt" - "time" -) - -// WaitFor polls the given function 'f', once every 'interval', up to 'timeout'. -func WaitFor(timeout, interval time.Duration, f func() (bool, error)) error { - var lastErr string - timeup := time.After(timeout) - for { - select { - case <-timeup: - return fmt.Errorf("Time limit exceeded. Last error: %s", lastErr) - default: - } - - stop, err := f() - if stop { - return nil - } - if err != nil { - lastErr = err.Error() - } - - time.Sleep(interval) - } -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/cloudflare/cloudflare.go b/vendor/github.com/xenolf/lego/providers/dns/cloudflare/cloudflare.go deleted file mode 100644 index 8495223..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/cloudflare/cloudflare.go +++ /dev/null @@ -1,223 +0,0 @@ -// Package cloudflare implements a DNS provider for solving the DNS-01 -// challenge using cloudflare DNS. -package cloudflare - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" - "os" - "time" - - "github.com/xenolf/lego/acme" -) - -// CloudFlareAPIURL represents the API endpoint to call. -// TODO: Unexport? -const CloudFlareAPIURL = "https://api.cloudflare.com/client/v4" - -// DNSProvider is an implementation of the acme.ChallengeProvider interface -type DNSProvider struct { - authEmail string - authKey string -} - -// NewDNSProvider returns a DNSProvider instance configured for cloudflare. -// Credentials must be passed in the environment variables: CLOUDFLARE_EMAIL -// and CLOUDFLARE_API_KEY. -func NewDNSProvider() (*DNSProvider, error) { - email := os.Getenv("CLOUDFLARE_EMAIL") - key := os.Getenv("CLOUDFLARE_API_KEY") - return NewDNSProviderCredentials(email, key) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for cloudflare. -func NewDNSProviderCredentials(email, key string) (*DNSProvider, error) { - if email == "" || key == "" { - return nil, fmt.Errorf("CloudFlare credentials missing") - } - - return &DNSProvider{ - authEmail: email, - authKey: key, - }, nil -} - -// Timeout returns the timeout and interval to use when checking for DNS -// propagation. Adjusting here to cope with spikes in propagation times. -func (c *DNSProvider) Timeout() (timeout, interval time.Duration) { - return 120 * time.Second, 2 * time.Second -} - -// Present creates a TXT record to fulfil the dns-01 challenge -func (c *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, _ := acme.DNS01Record(domain, keyAuth) - zoneID, err := c.getHostedZoneID(fqdn) - if err != nil { - return err - } - - rec := cloudFlareRecord{ - Type: "TXT", - Name: acme.UnFqdn(fqdn), - Content: value, - TTL: 120, - } - - body, err := json.Marshal(rec) - if err != nil { - return err - } - - _, err = c.makeRequest("POST", fmt.Sprintf("/zones/%s/dns_records", zoneID), bytes.NewReader(body)) - if err != nil { - return err - } - - return nil -} - -// CleanUp removes the TXT record matching the specified parameters -func (c *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - - record, err := c.findTxtRecord(fqdn) - if err != nil { - return err - } - - _, err = c.makeRequest("DELETE", fmt.Sprintf("/zones/%s/dns_records/%s", record.ZoneID, record.ID), nil) - if err != nil { - return err - } - - return nil -} - -func (c *DNSProvider) getHostedZoneID(fqdn string) (string, error) { - // HostedZone represents a CloudFlare DNS zone - type HostedZone struct { - ID string `json:"id"` - Name string `json:"name"` - } - - authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) - if err != nil { - return "", err - } - - result, err := c.makeRequest("GET", "/zones?name="+acme.UnFqdn(authZone), nil) - if err != nil { - return "", err - } - - var hostedZone []HostedZone - err = json.Unmarshal(result, &hostedZone) - if err != nil { - return "", err - } - - if len(hostedZone) != 1 { - return "", fmt.Errorf("Zone %s not found in CloudFlare for domain %s", authZone, fqdn) - } - - return hostedZone[0].ID, nil -} - -func (c *DNSProvider) findTxtRecord(fqdn string) (*cloudFlareRecord, error) { - zoneID, err := c.getHostedZoneID(fqdn) - if err != nil { - return nil, err - } - - result, err := c.makeRequest( - "GET", - fmt.Sprintf("/zones/%s/dns_records?per_page=1000&type=TXT&name=%s", zoneID, acme.UnFqdn(fqdn)), - nil, - ) - if err != nil { - return nil, err - } - - var records []cloudFlareRecord - err = json.Unmarshal(result, &records) - if err != nil { - return nil, err - } - - for _, rec := range records { - if rec.Name == acme.UnFqdn(fqdn) { - return &rec, nil - } - } - - return nil, fmt.Errorf("No existing record found for %s", fqdn) -} - -func (c *DNSProvider) makeRequest(method, uri string, body io.Reader) (json.RawMessage, error) { - // APIError contains error details for failed requests - type APIError struct { - Code int `json:"code,omitempty"` - Message string `json:"message,omitempty"` - ErrorChain []APIError `json:"error_chain,omitempty"` - } - - // APIResponse represents a response from CloudFlare API - type APIResponse struct { - Success bool `json:"success"` - Errors []*APIError `json:"errors"` - Result json.RawMessage `json:"result"` - } - - req, err := http.NewRequest(method, fmt.Sprintf("%s%s", CloudFlareAPIURL, uri), body) - if err != nil { - return nil, err - } - - req.Header.Set("X-Auth-Email", c.authEmail) - req.Header.Set("X-Auth-Key", c.authKey) - //req.Header.Set("User-Agent", userAgent()) - - client := http.Client{Timeout: 30 * time.Second} - resp, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("Error querying Cloudflare API -> %v", err) - } - - defer resp.Body.Close() - - var r APIResponse - err = json.NewDecoder(resp.Body).Decode(&r) - if err != nil { - return nil, err - } - - if !r.Success { - if len(r.Errors) > 0 { - errStr := "" - for _, apiErr := range r.Errors { - errStr += fmt.Sprintf("\t Error: %d: %s", apiErr.Code, apiErr.Message) - for _, chainErr := range apiErr.ErrorChain { - errStr += fmt.Sprintf("<- %d: %s", chainErr.Code, chainErr.Message) - } - } - return nil, fmt.Errorf("Cloudflare API Error \n%s", errStr) - } - return nil, fmt.Errorf("Cloudflare API error") - } - - return r.Result, nil -} - -// cloudFlareRecord represents a CloudFlare DNS record -type cloudFlareRecord struct { - Name string `json:"name"` - Type string `json:"type"` - Content string `json:"content"` - ID string `json:"id,omitempty"` - TTL int `json:"ttl,omitempty"` - ZoneID string `json:"zone_id,omitempty"` -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/digitalocean/digitalocean.go b/vendor/github.com/xenolf/lego/providers/dns/digitalocean/digitalocean.go deleted file mode 100644 index da261b3..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/digitalocean/digitalocean.go +++ /dev/null @@ -1,166 +0,0 @@ -// Package digitalocean implements a DNS provider for solving the DNS-01 -// challenge using digitalocean DNS. -package digitalocean - -import ( - "bytes" - "encoding/json" - "fmt" - "net/http" - "os" - "sync" - "time" - - "github.com/xenolf/lego/acme" -) - -// DNSProvider is an implementation of the acme.ChallengeProvider interface -// that uses DigitalOcean's REST API to manage TXT records for a domain. -type DNSProvider struct { - apiAuthToken string - recordIDs map[string]int - recordIDsMu sync.Mutex -} - -// NewDNSProvider returns a DNSProvider instance configured for Digital -// Ocean. Credentials must be passed in the environment variable: -// DO_AUTH_TOKEN. -func NewDNSProvider() (*DNSProvider, error) { - apiAuthToken := os.Getenv("DO_AUTH_TOKEN") - return NewDNSProviderCredentials(apiAuthToken) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for Digital Ocean. -func NewDNSProviderCredentials(apiAuthToken string) (*DNSProvider, error) { - if apiAuthToken == "" { - return nil, fmt.Errorf("DigitalOcean credentials missing") - } - return &DNSProvider{ - apiAuthToken: apiAuthToken, - recordIDs: make(map[string]int), - }, nil -} - -// Present creates a TXT record using the specified parameters -func (d *DNSProvider) Present(domain, token, keyAuth string) error { - // txtRecordRequest represents the request body to DO's API to make a TXT record - type txtRecordRequest struct { - RecordType string `json:"type"` - Name string `json:"name"` - Data string `json:"data"` - } - - // txtRecordResponse represents a response from DO's API after making a TXT record - type txtRecordResponse struct { - DomainRecord struct { - ID int `json:"id"` - Type string `json:"type"` - Name string `json:"name"` - Data string `json:"data"` - } `json:"domain_record"` - } - - fqdn, value, _ := acme.DNS01Record(domain, keyAuth) - - authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameservers) - if err != nil { - return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err) - } - - authZone = acme.UnFqdn(authZone) - - reqURL := fmt.Sprintf("%s/v2/domains/%s/records", digitalOceanBaseURL, authZone) - reqData := txtRecordRequest{RecordType: "TXT", Name: fqdn, Data: value} - body, err := json.Marshal(reqData) - if err != nil { - return err - } - - req, err := http.NewRequest("POST", reqURL, bytes.NewReader(body)) - if err != nil { - return err - } - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", d.apiAuthToken)) - - client := http.Client{Timeout: 30 * time.Second} - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - if resp.StatusCode >= 400 { - var errInfo digitalOceanAPIError - json.NewDecoder(resp.Body).Decode(&errInfo) - return fmt.Errorf("HTTP %d: %s: %s", resp.StatusCode, errInfo.ID, errInfo.Message) - } - - // Everything looks good; but we'll need the ID later to delete the record - var respData txtRecordResponse - err = json.NewDecoder(resp.Body).Decode(&respData) - if err != nil { - return err - } - d.recordIDsMu.Lock() - d.recordIDs[fqdn] = respData.DomainRecord.ID - d.recordIDsMu.Unlock() - - return nil -} - -// CleanUp removes the TXT record matching the specified parameters -func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - - // get the record's unique ID from when we created it - d.recordIDsMu.Lock() - recordID, ok := d.recordIDs[fqdn] - d.recordIDsMu.Unlock() - if !ok { - return fmt.Errorf("unknown record ID for '%s'", fqdn) - } - - authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameservers) - if err != nil { - return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err) - } - - authZone = acme.UnFqdn(authZone) - - reqURL := fmt.Sprintf("%s/v2/domains/%s/records/%d", digitalOceanBaseURL, authZone, recordID) - req, err := http.NewRequest("DELETE", reqURL, nil) - if err != nil { - return err - } - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", d.apiAuthToken)) - - client := http.Client{Timeout: 30 * time.Second} - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - if resp.StatusCode >= 400 { - var errInfo digitalOceanAPIError - json.NewDecoder(resp.Body).Decode(&errInfo) - return fmt.Errorf("HTTP %d: %s: %s", resp.StatusCode, errInfo.ID, errInfo.Message) - } - - // Delete record ID from map - d.recordIDsMu.Lock() - delete(d.recordIDs, fqdn) - d.recordIDsMu.Unlock() - - return nil -} - -type digitalOceanAPIError struct { - ID string `json:"id"` - Message string `json:"message"` -} - -var digitalOceanBaseURL = "https://api.digitalocean.com" diff --git a/vendor/github.com/xenolf/lego/providers/dns/dnsimple/dnsimple.go b/vendor/github.com/xenolf/lego/providers/dns/dnsimple/dnsimple.go deleted file mode 100644 index c903a35..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/dnsimple/dnsimple.go +++ /dev/null @@ -1,141 +0,0 @@ -// Package dnsimple implements a DNS provider for solving the DNS-01 challenge -// using dnsimple DNS. -package dnsimple - -import ( - "fmt" - "os" - "strings" - - "github.com/weppos/dnsimple-go/dnsimple" - "github.com/xenolf/lego/acme" -) - -// DNSProvider is an implementation of the acme.ChallengeProvider interface. -type DNSProvider struct { - client *dnsimple.Client -} - -// NewDNSProvider returns a DNSProvider instance configured for dnsimple. -// Credentials must be passed in the environment variables: DNSIMPLE_EMAIL -// and DNSIMPLE_API_KEY. -func NewDNSProvider() (*DNSProvider, error) { - email := os.Getenv("DNSIMPLE_EMAIL") - key := os.Getenv("DNSIMPLE_API_KEY") - return NewDNSProviderCredentials(email, key) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for dnsimple. -func NewDNSProviderCredentials(email, key string) (*DNSProvider, error) { - if email == "" || key == "" { - return nil, fmt.Errorf("DNSimple credentials missing") - } - - return &DNSProvider{ - client: dnsimple.NewClient(key, email), - }, nil -} - -// Present creates a TXT record to fulfil the dns-01 challenge. -func (c *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, ttl := acme.DNS01Record(domain, keyAuth) - - zoneID, zoneName, err := c.getHostedZone(domain) - if err != nil { - return err - } - - recordAttributes := c.newTxtRecord(zoneName, fqdn, value, ttl) - _, _, err = c.client.Domains.CreateRecord(zoneID, *recordAttributes) - if err != nil { - return fmt.Errorf("DNSimple API call failed: %v", err) - } - - return nil -} - -// CleanUp removes the TXT record matching the specified parameters. -func (c *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - - records, err := c.findTxtRecords(domain, fqdn) - if err != nil { - return err - } - - for _, rec := range records { - _, err := c.client.Domains.DeleteRecord(rec.DomainId, rec.Id) - if err != nil { - return err - } - } - return nil -} - -func (c *DNSProvider) getHostedZone(domain string) (string, string, error) { - zones, _, err := c.client.Domains.List() - if err != nil { - return "", "", fmt.Errorf("DNSimple API call failed: %v", err) - } - - authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameservers) - if err != nil { - return "", "", err - } - - var hostedZone dnsimple.Domain - for _, zone := range zones { - if zone.Name == acme.UnFqdn(authZone) { - hostedZone = zone - } - } - - if hostedZone.Id == 0 { - return "", "", fmt.Errorf("Zone %s not found in DNSimple for domain %s", authZone, domain) - - } - - return fmt.Sprintf("%v", hostedZone.Id), hostedZone.Name, nil -} - -func (c *DNSProvider) findTxtRecords(domain, fqdn string) ([]dnsimple.Record, error) { - zoneID, zoneName, err := c.getHostedZone(domain) - if err != nil { - return nil, err - } - - var records []dnsimple.Record - result, _, err := c.client.Domains.ListRecords(zoneID, "", "TXT") - if err != nil { - return records, fmt.Errorf("DNSimple API call has failed: %v", err) - } - - recordName := c.extractRecordName(fqdn, zoneName) - for _, record := range result { - if record.Name == recordName { - records = append(records, record) - } - } - - return records, nil -} - -func (c *DNSProvider) newTxtRecord(zone, fqdn, value string, ttl int) *dnsimple.Record { - name := c.extractRecordName(fqdn, zone) - - return &dnsimple.Record{ - Type: "TXT", - Name: name, - Content: value, - TTL: ttl, - } -} - -func (c *DNSProvider) extractRecordName(fqdn, domain string) string { - name := acme.UnFqdn(fqdn) - if idx := strings.Index(name, "."+domain); idx != -1 { - return name[:idx] - } - return name -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/dnsmadeeasy/dnsmadeeasy.go b/vendor/github.com/xenolf/lego/providers/dns/dnsmadeeasy/dnsmadeeasy.go deleted file mode 100644 index c4363a4..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/dnsmadeeasy/dnsmadeeasy.go +++ /dev/null @@ -1,248 +0,0 @@ -package dnsmadeeasy - -import ( - "bytes" - "crypto/hmac" - "crypto/sha1" - "crypto/tls" - "encoding/hex" - "encoding/json" - "fmt" - "net/http" - "os" - "strconv" - "strings" - "time" - - "github.com/xenolf/lego/acme" -) - -// DNSProvider is an implementation of the acme.ChallengeProvider interface that uses -// DNSMadeEasy's DNS API to manage TXT records for a domain. -type DNSProvider struct { - baseURL string - apiKey string - apiSecret string -} - -// Domain holds the DNSMadeEasy API representation of a Domain -type Domain struct { - ID int `json:"id"` - Name string `json:"name"` -} - -// Record holds the DNSMadeEasy API representation of a Domain Record -type Record struct { - ID int `json:"id"` - Type string `json:"type"` - Name string `json:"name"` - Value string `json:"value"` - TTL int `json:"ttl"` - SourceID int `json:"sourceId"` -} - -// NewDNSProvider returns a DNSProvider instance configured for DNSMadeEasy DNS. -// Credentials must be passed in the environment variables: DNSMADEEASY_API_KEY -// and DNSMADEEASY_API_SECRET. -func NewDNSProvider() (*DNSProvider, error) { - dnsmadeeasyAPIKey := os.Getenv("DNSMADEEASY_API_KEY") - dnsmadeeasyAPISecret := os.Getenv("DNSMADEEASY_API_SECRET") - dnsmadeeasySandbox := os.Getenv("DNSMADEEASY_SANDBOX") - - var baseURL string - - sandbox, _ := strconv.ParseBool(dnsmadeeasySandbox) - if sandbox { - baseURL = "https://api.sandbox.dnsmadeeasy.com/V2.0" - } else { - baseURL = "https://api.dnsmadeeasy.com/V2.0" - } - - return NewDNSProviderCredentials(baseURL, dnsmadeeasyAPIKey, dnsmadeeasyAPISecret) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for DNSMadeEasy. -func NewDNSProviderCredentials(baseURL, apiKey, apiSecret string) (*DNSProvider, error) { - if baseURL == "" || apiKey == "" || apiSecret == "" { - return nil, fmt.Errorf("DNS Made Easy credentials missing") - } - - return &DNSProvider{ - baseURL: baseURL, - apiKey: apiKey, - apiSecret: apiSecret, - }, nil -} - -// Present creates a TXT record using the specified parameters -func (d *DNSProvider) Present(domainName, token, keyAuth string) error { - fqdn, value, ttl := acme.DNS01Record(domainName, keyAuth) - - authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) - if err != nil { - return err - } - - // fetch the domain details - domain, err := d.getDomain(authZone) - if err != nil { - return err - } - - // create the TXT record - name := strings.Replace(fqdn, "."+authZone, "", 1) - record := &Record{Type: "TXT", Name: name, Value: value, TTL: ttl} - - err = d.createRecord(domain, record) - if err != nil { - return err - } - - return nil -} - -// CleanUp removes the TXT records matching the specified parameters -func (d *DNSProvider) CleanUp(domainName, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domainName, keyAuth) - - authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) - if err != nil { - return err - } - - // fetch the domain details - domain, err := d.getDomain(authZone) - if err != nil { - return err - } - - // find matching records - name := strings.Replace(fqdn, "."+authZone, "", 1) - records, err := d.getRecords(domain, name, "TXT") - if err != nil { - return err - } - - // delete records - for _, record := range *records { - err = d.deleteRecord(record) - if err != nil { - return err - } - } - - return nil -} - -func (d *DNSProvider) getDomain(authZone string) (*Domain, error) { - domainName := authZone[0 : len(authZone)-1] - resource := fmt.Sprintf("%s%s", "/dns/managed/name?domainname=", domainName) - - resp, err := d.sendRequest("GET", resource, nil) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - domain := &Domain{} - err = json.NewDecoder(resp.Body).Decode(&domain) - if err != nil { - return nil, err - } - - return domain, nil -} - -func (d *DNSProvider) getRecords(domain *Domain, recordName, recordType string) (*[]Record, error) { - resource := fmt.Sprintf("%s/%d/%s%s%s%s", "/dns/managed", domain.ID, "records?recordName=", recordName, "&type=", recordType) - - resp, err := d.sendRequest("GET", resource, nil) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - type recordsResponse struct { - Records *[]Record `json:"data"` - } - - records := &recordsResponse{} - err = json.NewDecoder(resp.Body).Decode(&records) - if err != nil { - return nil, err - } - - return records.Records, nil -} - -func (d *DNSProvider) createRecord(domain *Domain, record *Record) error { - url := fmt.Sprintf("%s/%d/%s", "/dns/managed", domain.ID, "records") - - resp, err := d.sendRequest("POST", url, record) - if err != nil { - return err - } - defer resp.Body.Close() - - return nil -} - -func (d *DNSProvider) deleteRecord(record Record) error { - resource := fmt.Sprintf("%s/%d/%s/%d", "/dns/managed", record.SourceID, "records", record.ID) - - resp, err := d.sendRequest("DELETE", resource, nil) - if err != nil { - return err - } - defer resp.Body.Close() - - return nil -} - -func (d *DNSProvider) sendRequest(method, resource string, payload interface{}) (*http.Response, error) { - url := fmt.Sprintf("%s%s", d.baseURL, resource) - - body, err := json.Marshal(payload) - if err != nil { - return nil, err - } - - timestamp := time.Now().UTC().Format(time.RFC1123) - signature := computeHMAC(timestamp, d.apiSecret) - - req, err := http.NewRequest(method, url, bytes.NewReader(body)) - if err != nil { - return nil, err - } - req.Header.Set("x-dnsme-apiKey", d.apiKey) - req.Header.Set("x-dnsme-requestDate", timestamp) - req.Header.Set("x-dnsme-hmac", signature) - req.Header.Set("accept", "application/json") - req.Header.Set("content-type", "application/json") - - transport := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - } - client := &http.Client{ - Transport: transport, - Timeout: time.Duration(10 * time.Second), - } - resp, err := client.Do(req) - if err != nil { - return nil, err - } - - if resp.StatusCode > 299 { - return nil, fmt.Errorf("DNSMadeEasy API request failed with HTTP status code %d", resp.StatusCode) - } - - return resp, nil -} - -func computeHMAC(message string, secret string) string { - key := []byte(secret) - h := hmac.New(sha1.New, key) - h.Write([]byte(message)) - return hex.EncodeToString(h.Sum(nil)) -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/dyn/dyn.go b/vendor/github.com/xenolf/lego/providers/dns/dyn/dyn.go deleted file mode 100644 index 384bc85..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/dyn/dyn.go +++ /dev/null @@ -1,274 +0,0 @@ -// Package dyn implements a DNS provider for solving the DNS-01 challenge -// using Dyn Managed DNS. -package dyn - -import ( - "bytes" - "encoding/json" - "fmt" - "net/http" - "os" - "strconv" - "time" - - "github.com/xenolf/lego/acme" -) - -var dynBaseURL = "https://api.dynect.net/REST" - -type dynResponse struct { - // One of 'success', 'failure', or 'incomplete' - Status string `json:"status"` - - // The structure containing the actual results of the request - Data json.RawMessage `json:"data"` - - // The ID of the job that was created in response to a request. - JobID int `json:"job_id"` - - // A list of zero or more messages - Messages json.RawMessage `json:"msgs"` -} - -// DNSProvider is an implementation of the acme.ChallengeProvider interface that uses -// Dyn's Managed DNS API to manage TXT records for a domain. -type DNSProvider struct { - customerName string - userName string - password string - token string -} - -// NewDNSProvider returns a DNSProvider instance configured for Dyn DNS. -// Credentials must be passed in the environment variables: DYN_CUSTOMER_NAME, -// DYN_USER_NAME and DYN_PASSWORD. -func NewDNSProvider() (*DNSProvider, error) { - customerName := os.Getenv("DYN_CUSTOMER_NAME") - userName := os.Getenv("DYN_USER_NAME") - password := os.Getenv("DYN_PASSWORD") - return NewDNSProviderCredentials(customerName, userName, password) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for Dyn DNS. -func NewDNSProviderCredentials(customerName, userName, password string) (*DNSProvider, error) { - if customerName == "" || userName == "" || password == "" { - return nil, fmt.Errorf("DynDNS credentials missing") - } - - return &DNSProvider{ - customerName: customerName, - userName: userName, - password: password, - }, nil -} - -func (d *DNSProvider) sendRequest(method, resource string, payload interface{}) (*dynResponse, error) { - url := fmt.Sprintf("%s/%s", dynBaseURL, resource) - - body, err := json.Marshal(payload) - if err != nil { - return nil, err - } - - req, err := http.NewRequest(method, url, bytes.NewReader(body)) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", "application/json") - if len(d.token) > 0 { - req.Header.Set("Auth-Token", d.token) - } - - client := &http.Client{Timeout: time.Duration(10 * time.Second)} - resp, err := client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode >= 400 { - return nil, fmt.Errorf("Dyn API request failed with HTTP status code %d", resp.StatusCode) - } else if resp.StatusCode == 307 { - // TODO add support for HTTP 307 response and long running jobs - return nil, fmt.Errorf("Dyn API request returned HTTP 307. This is currently unsupported") - } - - var dynRes dynResponse - err = json.NewDecoder(resp.Body).Decode(&dynRes) - if err != nil { - return nil, err - } - - if dynRes.Status == "failure" { - // TODO add better error handling - return nil, fmt.Errorf("Dyn API request failed: %s", dynRes.Messages) - } - - return &dynRes, nil -} - -// Starts a new Dyn API Session. Authenticates using customerName, userName, -// password and receives a token to be used in for subsequent requests. -func (d *DNSProvider) login() error { - type creds struct { - Customer string `json:"customer_name"` - User string `json:"user_name"` - Pass string `json:"password"` - } - - type session struct { - Token string `json:"token"` - Version string `json:"version"` - } - - payload := &creds{Customer: d.customerName, User: d.userName, Pass: d.password} - dynRes, err := d.sendRequest("POST", "Session", payload) - if err != nil { - return err - } - - var s session - err = json.Unmarshal(dynRes.Data, &s) - if err != nil { - return err - } - - d.token = s.Token - - return nil -} - -// Destroys Dyn Session -func (d *DNSProvider) logout() error { - if len(d.token) == 0 { - // nothing to do - return nil - } - - url := fmt.Sprintf("%s/Session", dynBaseURL) - req, err := http.NewRequest("DELETE", url, nil) - if err != nil { - return err - } - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Auth-Token", d.token) - - client := &http.Client{Timeout: time.Duration(10 * time.Second)} - resp, err := client.Do(req) - if err != nil { - return err - } - resp.Body.Close() - - if resp.StatusCode != 200 { - return fmt.Errorf("Dyn API request failed to delete session with HTTP status code %d", resp.StatusCode) - } - - d.token = "" - - return nil -} - -// Present creates a TXT record using the specified parameters -func (d *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, ttl := acme.DNS01Record(domain, keyAuth) - - authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) - if err != nil { - return err - } - - err = d.login() - if err != nil { - return err - } - - data := map[string]interface{}{ - "rdata": map[string]string{ - "txtdata": value, - }, - "ttl": strconv.Itoa(ttl), - } - - resource := fmt.Sprintf("TXTRecord/%s/%s/", authZone, fqdn) - _, err = d.sendRequest("POST", resource, data) - if err != nil { - return err - } - - err = d.publish(authZone, "Added TXT record for ACME dns-01 challenge using lego client") - if err != nil { - return err - } - - err = d.logout() - if err != nil { - return err - } - - return nil -} - -func (d *DNSProvider) publish(zone, notes string) error { - type publish struct { - Publish bool `json:"publish"` - Notes string `json:"notes"` - } - - pub := &publish{Publish: true, Notes: notes} - resource := fmt.Sprintf("Zone/%s/", zone) - _, err := d.sendRequest("PUT", resource, pub) - if err != nil { - return err - } - - return nil -} - -// CleanUp removes the TXT record matching the specified parameters -func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - - authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) - if err != nil { - return err - } - - err = d.login() - if err != nil { - return err - } - - resource := fmt.Sprintf("TXTRecord/%s/%s/", authZone, fqdn) - url := fmt.Sprintf("%s/%s", dynBaseURL, resource) - req, err := http.NewRequest("DELETE", url, nil) - if err != nil { - return err - } - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Auth-Token", d.token) - - client := &http.Client{Timeout: time.Duration(10 * time.Second)} - resp, err := client.Do(req) - if err != nil { - return err - } - resp.Body.Close() - - if resp.StatusCode != 200 { - return fmt.Errorf("Dyn API request failed to delete TXT record HTTP status code %d", resp.StatusCode) - } - - err = d.publish(authZone, "Removed TXT record for ACME dns-01 challenge using lego client") - if err != nil { - return err - } - - err = d.logout() - if err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/gandi/gandi.go b/vendor/github.com/xenolf/lego/providers/dns/gandi/gandi.go deleted file mode 100644 index 422b02a..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/gandi/gandi.go +++ /dev/null @@ -1,472 +0,0 @@ -// Package gandi implements a DNS provider for solving the DNS-01 -// challenge using Gandi DNS. -package gandi - -import ( - "bytes" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "strings" - "sync" - "time" - - "github.com/xenolf/lego/acme" -) - -// Gandi API reference: http://doc.rpc.gandi.net/index.html -// Gandi API domain examples: http://doc.rpc.gandi.net/domain/faq.html - -var ( - // endpoint is the Gandi XML-RPC endpoint used by Present and - // CleanUp. It is overridden during tests. - endpoint = "https://rpc.gandi.net/xmlrpc/" - // findZoneByFqdn determines the DNS zone of an fqdn. It is overridden - // during tests. - findZoneByFqdn = acme.FindZoneByFqdn -) - -// inProgressInfo contains information about an in-progress challenge -type inProgressInfo struct { - zoneID int // zoneID of gandi zone to restore in CleanUp - newZoneID int // zoneID of temporary gandi zone containing TXT record - authZone string // the domain name registered at gandi with trailing "." -} - -// DNSProvider is an implementation of the -// acme.ChallengeProviderTimeout interface that uses Gandi's XML-RPC -// API to manage TXT records for a domain. -type DNSProvider struct { - apiKey string - inProgressFQDNs map[string]inProgressInfo - inProgressAuthZones map[string]struct{} - inProgressMu sync.Mutex -} - -// NewDNSProvider returns a DNSProvider instance configured for Gandi. -// Credentials must be passed in the environment variable: GANDI_API_KEY. -func NewDNSProvider() (*DNSProvider, error) { - apiKey := os.Getenv("GANDI_API_KEY") - return NewDNSProviderCredentials(apiKey) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for Gandi. -func NewDNSProviderCredentials(apiKey string) (*DNSProvider, error) { - if apiKey == "" { - return nil, fmt.Errorf("No Gandi API Key given") - } - return &DNSProvider{ - apiKey: apiKey, - inProgressFQDNs: make(map[string]inProgressInfo), - inProgressAuthZones: make(map[string]struct{}), - }, nil -} - -// Present creates a TXT record using the specified parameters. It -// does this by creating and activating a new temporary Gandi DNS -// zone. This new zone contains the TXT record. -func (d *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, ttl := acme.DNS01Record(domain, keyAuth) - if ttl < 300 { - ttl = 300 // 300 is gandi minimum value for ttl - } - // find authZone and Gandi zone_id for fqdn - authZone, err := findZoneByFqdn(fqdn, acme.RecursiveNameservers) - if err != nil { - return fmt.Errorf("Gandi DNS: findZoneByFqdn failure: %v", err) - } - zoneID, err := d.getZoneID(authZone) - if err != nil { - return err - } - // determine name of TXT record - if !strings.HasSuffix( - strings.ToLower(fqdn), strings.ToLower("."+authZone)) { - return fmt.Errorf( - "Gandi DNS: unexpected authZone %s for fqdn %s", authZone, fqdn) - } - name := fqdn[:len(fqdn)-len("."+authZone)] - // acquire lock and check there is not a challenge already in - // progress for this value of authZone - d.inProgressMu.Lock() - defer d.inProgressMu.Unlock() - if _, ok := d.inProgressAuthZones[authZone]; ok { - return fmt.Errorf( - "Gandi DNS: challenge already in progress for authZone %s", - authZone) - } - // perform API actions to create and activate new gandi zone - // containing the required TXT record - newZoneName := fmt.Sprintf( - "%s [ACME Challenge %s]", - acme.UnFqdn(authZone), time.Now().Format(time.RFC822Z)) - newZoneID, err := d.cloneZone(zoneID, newZoneName) - if err != nil { - return err - } - newZoneVersion, err := d.newZoneVersion(newZoneID) - if err != nil { - return err - } - err = d.addTXTRecord(newZoneID, newZoneVersion, name, value, ttl) - if err != nil { - return err - } - err = d.setZoneVersion(newZoneID, newZoneVersion) - if err != nil { - return err - } - err = d.setZone(authZone, newZoneID) - if err != nil { - return err - } - // save data necessary for CleanUp - d.inProgressFQDNs[fqdn] = inProgressInfo{ - zoneID: zoneID, - newZoneID: newZoneID, - authZone: authZone, - } - d.inProgressAuthZones[authZone] = struct{}{} - return nil -} - -// CleanUp removes the TXT record matching the specified -// parameters. It does this by restoring the old Gandi DNS zone and -// removing the temporary one created by Present. -func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - // acquire lock and retrieve zoneID, newZoneID and authZone - d.inProgressMu.Lock() - defer d.inProgressMu.Unlock() - if _, ok := d.inProgressFQDNs[fqdn]; !ok { - // if there is no cleanup information then just return - return nil - } - zoneID := d.inProgressFQDNs[fqdn].zoneID - newZoneID := d.inProgressFQDNs[fqdn].newZoneID - authZone := d.inProgressFQDNs[fqdn].authZone - delete(d.inProgressFQDNs, fqdn) - delete(d.inProgressAuthZones, authZone) - // perform API actions to restore old gandi zone for authZone - err := d.setZone(authZone, zoneID) - if err != nil { - return err - } - err = d.deleteZone(newZoneID) - if err != nil { - return err - } - return nil -} - -// Timeout returns the values (40*time.Minute, 60*time.Second) which -// are used by the acme package as timeout and check interval values -// when checking for DNS record propagation with Gandi. -func (d *DNSProvider) Timeout() (timeout, interval time.Duration) { - return 40 * time.Minute, 60 * time.Second -} - -// types for XML-RPC method calls and parameters - -type param interface { - param() -} -type paramString struct { - XMLName xml.Name `xml:"param"` - Value string `xml:"value>string"` -} -type paramInt struct { - XMLName xml.Name `xml:"param"` - Value int `xml:"value>int"` -} - -type structMember interface { - structMember() -} -type structMemberString struct { - Name string `xml:"name"` - Value string `xml:"value>string"` -} -type structMemberInt struct { - Name string `xml:"name"` - Value int `xml:"value>int"` -} -type paramStruct struct { - XMLName xml.Name `xml:"param"` - StructMembers []structMember `xml:"value>struct>member"` -} - -func (p paramString) param() {} -func (p paramInt) param() {} -func (m structMemberString) structMember() {} -func (m structMemberInt) structMember() {} -func (p paramStruct) param() {} - -type methodCall struct { - XMLName xml.Name `xml:"methodCall"` - MethodName string `xml:"methodName"` - Params []param `xml:"params"` -} - -// types for XML-RPC responses - -type response interface { - faultCode() int - faultString() string -} - -type responseFault struct { - FaultCode int `xml:"fault>value>struct>member>value>int"` - FaultString string `xml:"fault>value>struct>member>value>string"` -} - -func (r responseFault) faultCode() int { return r.FaultCode } -func (r responseFault) faultString() string { return r.FaultString } - -type responseStruct struct { - responseFault - StructMembers []struct { - Name string `xml:"name"` - ValueInt int `xml:"value>int"` - } `xml:"params>param>value>struct>member"` -} - -type responseInt struct { - responseFault - Value int `xml:"params>param>value>int"` -} - -type responseBool struct { - responseFault - Value bool `xml:"params>param>value>boolean"` -} - -// POSTing/Marshalling/Unmarshalling - -type rpcError struct { - faultCode int - faultString string -} - -func (e rpcError) Error() string { - return fmt.Sprintf( - "Gandi DNS: RPC Error: (%d) %s", e.faultCode, e.faultString) -} - -func httpPost(url string, bodyType string, body io.Reader) ([]byte, error) { - client := http.Client{Timeout: 60 * time.Second} - resp, err := client.Post(url, bodyType, body) - if err != nil { - return nil, fmt.Errorf("Gandi DNS: HTTP Post Error: %v", err) - } - defer resp.Body.Close() - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("Gandi DNS: HTTP Post Error: %v", err) - } - return b, nil -} - -// rpcCall makes an XML-RPC call to Gandi's RPC endpoint by -// marshalling the data given in the call argument to XML and sending -// that via HTTP Post to Gandi. The response is then unmarshalled into -// the resp argument. -func rpcCall(call *methodCall, resp response) error { - // marshal - b, err := xml.MarshalIndent(call, "", " ") - if err != nil { - return fmt.Errorf("Gandi DNS: Marshal Error: %v", err) - } - // post - b = append([]byte(``+"\n"), b...) - respBody, err := httpPost(endpoint, "text/xml", bytes.NewReader(b)) - if err != nil { - return err - } - // unmarshal - err = xml.Unmarshal(respBody, resp) - if err != nil { - return fmt.Errorf("Gandi DNS: Unmarshal Error: %v", err) - } - if resp.faultCode() != 0 { - return rpcError{ - faultCode: resp.faultCode(), faultString: resp.faultString()} - } - return nil -} - -// functions to perform API actions - -func (d *DNSProvider) getZoneID(domain string) (int, error) { - resp := &responseStruct{} - err := rpcCall(&methodCall{ - MethodName: "domain.info", - Params: []param{ - paramString{Value: d.apiKey}, - paramString{Value: domain}, - }, - }, resp) - if err != nil { - return 0, err - } - var zoneID int - for _, member := range resp.StructMembers { - if member.Name == "zone_id" { - zoneID = member.ValueInt - } - } - if zoneID == 0 { - return 0, fmt.Errorf( - "Gandi DNS: Could not determine zone_id for %s", domain) - } - return zoneID, nil -} - -func (d *DNSProvider) cloneZone(zoneID int, name string) (int, error) { - resp := &responseStruct{} - err := rpcCall(&methodCall{ - MethodName: "domain.zone.clone", - Params: []param{ - paramString{Value: d.apiKey}, - paramInt{Value: zoneID}, - paramInt{Value: 0}, - paramStruct{ - StructMembers: []structMember{ - structMemberString{ - Name: "name", - Value: name, - }}, - }, - }, - }, resp) - if err != nil { - return 0, err - } - var newZoneID int - for _, member := range resp.StructMembers { - if member.Name == "id" { - newZoneID = member.ValueInt - } - } - if newZoneID == 0 { - return 0, fmt.Errorf("Gandi DNS: Could not determine cloned zone_id") - } - return newZoneID, nil -} - -func (d *DNSProvider) newZoneVersion(zoneID int) (int, error) { - resp := &responseInt{} - err := rpcCall(&methodCall{ - MethodName: "domain.zone.version.new", - Params: []param{ - paramString{Value: d.apiKey}, - paramInt{Value: zoneID}, - }, - }, resp) - if err != nil { - return 0, err - } - if resp.Value == 0 { - return 0, fmt.Errorf("Gandi DNS: Could not create new zone version") - } - return resp.Value, nil -} - -func (d *DNSProvider) addTXTRecord(zoneID int, version int, name string, value string, ttl int) error { - resp := &responseStruct{} - err := rpcCall(&methodCall{ - MethodName: "domain.zone.record.add", - Params: []param{ - paramString{Value: d.apiKey}, - paramInt{Value: zoneID}, - paramInt{Value: version}, - paramStruct{ - StructMembers: []structMember{ - structMemberString{ - Name: "type", - Value: "TXT", - }, structMemberString{ - Name: "name", - Value: name, - }, structMemberString{ - Name: "value", - Value: value, - }, structMemberInt{ - Name: "ttl", - Value: ttl, - }}, - }, - }, - }, resp) - if err != nil { - return err - } - return nil -} - -func (d *DNSProvider) setZoneVersion(zoneID int, version int) error { - resp := &responseBool{} - err := rpcCall(&methodCall{ - MethodName: "domain.zone.version.set", - Params: []param{ - paramString{Value: d.apiKey}, - paramInt{Value: zoneID}, - paramInt{Value: version}, - }, - }, resp) - if err != nil { - return err - } - if !resp.Value { - return fmt.Errorf("Gandi DNS: could not set zone version") - } - return nil -} - -func (d *DNSProvider) setZone(domain string, zoneID int) error { - resp := &responseStruct{} - err := rpcCall(&methodCall{ - MethodName: "domain.zone.set", - Params: []param{ - paramString{Value: d.apiKey}, - paramString{Value: domain}, - paramInt{Value: zoneID}, - }, - }, resp) - if err != nil { - return err - } - var respZoneID int - for _, member := range resp.StructMembers { - if member.Name == "zone_id" { - respZoneID = member.ValueInt - } - } - if respZoneID != zoneID { - return fmt.Errorf( - "Gandi DNS: Could not set new zone_id for %s", domain) - } - return nil -} - -func (d *DNSProvider) deleteZone(zoneID int) error { - resp := &responseBool{} - err := rpcCall(&methodCall{ - MethodName: "domain.zone.delete", - Params: []param{ - paramString{Value: d.apiKey}, - paramInt{Value: zoneID}, - }, - }, resp) - if err != nil { - return err - } - if !resp.Value { - return fmt.Errorf("Gandi DNS: could not delete zone_id") - } - return nil -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/googlecloud/googlecloud.go b/vendor/github.com/xenolf/lego/providers/dns/googlecloud/googlecloud.go deleted file mode 100644 index ea6c087..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/googlecloud/googlecloud.go +++ /dev/null @@ -1,168 +0,0 @@ -// Package googlecloud implements a DNS provider for solving the DNS-01 -// challenge using Google Cloud DNS. -package googlecloud - -import ( - "fmt" - "os" - "time" - - "github.com/xenolf/lego/acme" - - "golang.org/x/net/context" - "golang.org/x/oauth2/google" - - "google.golang.org/api/dns/v1" -) - -// DNSProvider is an implementation of the DNSProvider interface. -type DNSProvider struct { - project string - client *dns.Service -} - -// NewDNSProvider returns a DNSProvider instance configured for Google Cloud -// DNS. Credentials must be passed in the environment variable: GCE_PROJECT. -func NewDNSProvider() (*DNSProvider, error) { - project := os.Getenv("GCE_PROJECT") - return NewDNSProviderCredentials(project) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for Google Cloud DNS. -func NewDNSProviderCredentials(project string) (*DNSProvider, error) { - if project == "" { - return nil, fmt.Errorf("Google Cloud project name missing") - } - - client, err := google.DefaultClient(context.Background(), dns.NdevClouddnsReadwriteScope) - if err != nil { - return nil, fmt.Errorf("Unable to get Google Cloud client: %v", err) - } - svc, err := dns.New(client) - if err != nil { - return nil, fmt.Errorf("Unable to create Google Cloud DNS service: %v", err) - } - return &DNSProvider{ - project: project, - client: svc, - }, nil -} - -// Present creates a TXT record to fulfil the dns-01 challenge. -func (c *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, ttl := acme.DNS01Record(domain, keyAuth) - - zone, err := c.getHostedZone(domain) - if err != nil { - return err - } - - rec := &dns.ResourceRecordSet{ - Name: fqdn, - Rrdatas: []string{value}, - Ttl: int64(ttl), - Type: "TXT", - } - change := &dns.Change{ - Additions: []*dns.ResourceRecordSet{rec}, - } - - // Look for existing records. - list, err := c.client.ResourceRecordSets.List(c.project, zone).Name(fqdn).Type("TXT").Do() - if err != nil { - return err - } - if len(list.Rrsets) > 0 { - // Attempt to delete the existing records when adding our new one. - change.Deletions = list.Rrsets - } - - chg, err := c.client.Changes.Create(c.project, zone, change).Do() - if err != nil { - return err - } - - // wait for change to be acknowledged - for chg.Status == "pending" { - time.Sleep(time.Second) - - chg, err = c.client.Changes.Get(c.project, zone, chg.Id).Do() - if err != nil { - return err - } - } - - return nil -} - -// CleanUp removes the TXT record matching the specified parameters. -func (c *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - - zone, err := c.getHostedZone(domain) - if err != nil { - return err - } - - records, err := c.findTxtRecords(zone, fqdn) - if err != nil { - return err - } - - for _, rec := range records { - change := &dns.Change{ - Deletions: []*dns.ResourceRecordSet{rec}, - } - _, err = c.client.Changes.Create(c.project, zone, change).Do() - if err != nil { - return err - } - } - return nil -} - -// Timeout customizes the timeout values used by the ACME package for checking -// DNS record validity. -func (c *DNSProvider) Timeout() (timeout, interval time.Duration) { - return 180 * time.Second, 5 * time.Second -} - -// getHostedZone returns the managed-zone -func (c *DNSProvider) getHostedZone(domain string) (string, error) { - authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameservers) - if err != nil { - return "", err - } - - zones, err := c.client.ManagedZones. - List(c.project). - DnsName(authZone). - Do() - if err != nil { - return "", fmt.Errorf("GoogleCloud API call failed: %v", err) - } - - if len(zones.ManagedZones) == 0 { - return "", fmt.Errorf("No matching GoogleCloud domain found for domain %s", authZone) - } - - return zones.ManagedZones[0].Name, nil -} - -func (c *DNSProvider) findTxtRecords(zone, fqdn string) ([]*dns.ResourceRecordSet, error) { - - recs, err := c.client.ResourceRecordSets.List(c.project, zone).Do() - if err != nil { - return nil, err - } - - found := []*dns.ResourceRecordSet{} - for _, r := range recs.Rrsets { - if r.Type == "TXT" && r.Name == fqdn { - found = append(found, r) - } - } - - return found, nil -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/namecheap/namecheap.go b/vendor/github.com/xenolf/lego/providers/dns/namecheap/namecheap.go deleted file mode 100644 index d7eb409..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/namecheap/namecheap.go +++ /dev/null @@ -1,416 +0,0 @@ -// Package namecheap implements a DNS provider for solving the DNS-01 -// challenge using namecheap DNS. -package namecheap - -import ( - "encoding/xml" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "os" - "strings" - "time" - - "github.com/xenolf/lego/acme" -) - -// Notes about namecheap's tool API: -// 1. Using the API requires registration. Once registered, use your account -// name and API key to access the API. -// 2. There is no API to add or modify a single DNS record. Instead you must -// read the entire list of records, make modifications, and then write the -// entire updated list of records. (Yuck.) -// 3. Namecheap's DNS updates can be slow to propagate. I've seen them take -// as long as an hour. -// 4. Namecheap requires you to whitelist the IP address from which you call -// its APIs. It also requires all API calls to include the whitelisted IP -// address as a form or query string value. This code uses a namecheap -// service to query the client's IP address. - -var ( - debug = false - defaultBaseURL = "https://api.namecheap.com/xml.response" - getIPURL = "https://dynamicdns.park-your-domain.com/getip" - httpClient = http.Client{Timeout: 60 * time.Second} -) - -// DNSProvider is an implementation of the ChallengeProviderTimeout interface -// that uses Namecheap's tool API to manage TXT records for a domain. -type DNSProvider struct { - baseURL string - apiUser string - apiKey string - clientIP string -} - -// NewDNSProvider returns a DNSProvider instance configured for namecheap. -// Credentials must be passed in the environment variables: NAMECHEAP_API_USER -// and NAMECHEAP_API_KEY. -func NewDNSProvider() (*DNSProvider, error) { - apiUser := os.Getenv("NAMECHEAP_API_USER") - apiKey := os.Getenv("NAMECHEAP_API_KEY") - return NewDNSProviderCredentials(apiUser, apiKey) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for namecheap. -func NewDNSProviderCredentials(apiUser, apiKey string) (*DNSProvider, error) { - if apiUser == "" || apiKey == "" { - return nil, fmt.Errorf("Namecheap credentials missing") - } - - clientIP, err := getClientIP() - if err != nil { - return nil, err - } - - return &DNSProvider{ - baseURL: defaultBaseURL, - apiUser: apiUser, - apiKey: apiKey, - clientIP: clientIP, - }, nil -} - -// Timeout returns the timeout and interval to use when checking for DNS -// propagation. Namecheap can sometimes take a long time to complete an -// update, so wait up to 60 minutes for the update to propagate. -func (d *DNSProvider) Timeout() (timeout, interval time.Duration) { - return 60 * time.Minute, 15 * time.Second -} - -// host describes a DNS record returned by the Namecheap DNS gethosts API. -// Namecheap uses the term "host" to refer to all DNS records that include -// a host field (A, AAAA, CNAME, NS, TXT, URL). -type host struct { - Type string `xml:",attr"` - Name string `xml:",attr"` - Address string `xml:",attr"` - MXPref string `xml:",attr"` - TTL string `xml:",attr"` -} - -// apierror describes an error record in a namecheap API response. -type apierror struct { - Number int `xml:",attr"` - Description string `xml:",innerxml"` -} - -// getClientIP returns the client's public IP address. It uses namecheap's -// IP discovery service to perform the lookup. -func getClientIP() (addr string, err error) { - resp, err := httpClient.Get(getIPURL) - if err != nil { - return "", err - } - defer resp.Body.Close() - - clientIP, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", err - } - - if debug { - fmt.Println("Client IP:", string(clientIP)) - } - return string(clientIP), nil -} - -// A challenge repesents all the data needed to specify a dns-01 challenge -// to lets-encrypt. -type challenge struct { - domain string - key string - keyFqdn string - keyValue string - tld string - sld string - host string -} - -// newChallenge builds a challenge record from a domain name, a challenge -// authentication key, and a map of available TLDs. -func newChallenge(domain, keyAuth string, tlds map[string]string) (*challenge, error) { - domain = acme.UnFqdn(domain) - parts := strings.Split(domain, ".") - - // Find the longest matching TLD. - longest := -1 - for i := len(parts); i > 0; i-- { - t := strings.Join(parts[i-1:], ".") - if _, found := tlds[t]; found { - longest = i - 1 - } - } - if longest < 1 { - return nil, fmt.Errorf("Invalid domain name '%s'", domain) - } - - tld := strings.Join(parts[longest:], ".") - sld := parts[longest-1] - - var host string - if longest >= 1 { - host = strings.Join(parts[:longest-1], ".") - } - - key, keyValue, _ := acme.DNS01Record(domain, keyAuth) - - return &challenge{ - domain: domain, - key: "_acme-challenge." + host, - keyFqdn: key, - keyValue: keyValue, - tld: tld, - sld: sld, - host: host, - }, nil -} - -// setGlobalParams adds the namecheap global parameters to the provided url -// Values record. -func (d *DNSProvider) setGlobalParams(v *url.Values, cmd string) { - v.Set("ApiUser", d.apiUser) - v.Set("ApiKey", d.apiKey) - v.Set("UserName", d.apiUser) - v.Set("ClientIp", d.clientIP) - v.Set("Command", cmd) -} - -// getTLDs requests the list of available TLDs from namecheap. -func (d *DNSProvider) getTLDs() (tlds map[string]string, err error) { - values := make(url.Values) - d.setGlobalParams(&values, "namecheap.domains.getTldList") - - reqURL, _ := url.Parse(d.baseURL) - reqURL.RawQuery = values.Encode() - - resp, err := httpClient.Get(reqURL.String()) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode >= 400 { - return nil, fmt.Errorf("getHosts HTTP error %d", resp.StatusCode) - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - type GetTldsResponse struct { - XMLName xml.Name `xml:"ApiResponse"` - Errors []apierror `xml:"Errors>Error"` - Result []struct { - Name string `xml:",attr"` - } `xml:"CommandResponse>Tlds>Tld"` - } - - var gtr GetTldsResponse - if err := xml.Unmarshal(body, >r); err != nil { - return nil, err - } - if len(gtr.Errors) > 0 { - return nil, fmt.Errorf("Namecheap error: %s [%d]", - gtr.Errors[0].Description, gtr.Errors[0].Number) - } - - tlds = make(map[string]string) - for _, t := range gtr.Result { - tlds[t.Name] = t.Name - } - return tlds, nil -} - -// getHosts reads the full list of DNS host records using the Namecheap API. -func (d *DNSProvider) getHosts(ch *challenge) (hosts []host, err error) { - values := make(url.Values) - d.setGlobalParams(&values, "namecheap.domains.dns.getHosts") - values.Set("SLD", ch.sld) - values.Set("TLD", ch.tld) - - reqURL, _ := url.Parse(d.baseURL) - reqURL.RawQuery = values.Encode() - - resp, err := httpClient.Get(reqURL.String()) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode >= 400 { - return nil, fmt.Errorf("getHosts HTTP error %d", resp.StatusCode) - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - type GetHostsResponse struct { - XMLName xml.Name `xml:"ApiResponse"` - Status string `xml:"Status,attr"` - Errors []apierror `xml:"Errors>Error"` - Hosts []host `xml:"CommandResponse>DomainDNSGetHostsResult>host"` - } - - var ghr GetHostsResponse - if err = xml.Unmarshal(body, &ghr); err != nil { - return nil, err - } - if len(ghr.Errors) > 0 { - return nil, fmt.Errorf("Namecheap error: %s [%d]", - ghr.Errors[0].Description, ghr.Errors[0].Number) - } - - return ghr.Hosts, nil -} - -// setHosts writes the full list of DNS host records using the Namecheap API. -func (d *DNSProvider) setHosts(ch *challenge, hosts []host) error { - values := make(url.Values) - d.setGlobalParams(&values, "namecheap.domains.dns.setHosts") - values.Set("SLD", ch.sld) - values.Set("TLD", ch.tld) - - for i, h := range hosts { - ind := fmt.Sprintf("%d", i+1) - values.Add("HostName"+ind, h.Name) - values.Add("RecordType"+ind, h.Type) - values.Add("Address"+ind, h.Address) - values.Add("MXPref"+ind, h.MXPref) - values.Add("TTL"+ind, h.TTL) - } - - resp, err := httpClient.PostForm(d.baseURL, values) - if err != nil { - return err - } - defer resp.Body.Close() - - if resp.StatusCode >= 400 { - return fmt.Errorf("setHosts HTTP error %d", resp.StatusCode) - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - type SetHostsResponse struct { - XMLName xml.Name `xml:"ApiResponse"` - Status string `xml:"Status,attr"` - Errors []apierror `xml:"Errors>Error"` - Result struct { - IsSuccess string `xml:",attr"` - } `xml:"CommandResponse>DomainDNSSetHostsResult"` - } - - var shr SetHostsResponse - if err := xml.Unmarshal(body, &shr); err != nil { - return err - } - if len(shr.Errors) > 0 { - return fmt.Errorf("Namecheap error: %s [%d]", - shr.Errors[0].Description, shr.Errors[0].Number) - } - if shr.Result.IsSuccess != "true" { - return fmt.Errorf("Namecheap setHosts failed.") - } - - return nil -} - -// addChallengeRecord adds a DNS challenge TXT record to a list of namecheap -// host records. -func (d *DNSProvider) addChallengeRecord(ch *challenge, hosts *[]host) { - host := host{ - Name: ch.key, - Type: "TXT", - Address: ch.keyValue, - MXPref: "10", - TTL: "120", - } - - // If there's already a TXT record with the same name, replace it. - for i, h := range *hosts { - if h.Name == ch.key && h.Type == "TXT" { - (*hosts)[i] = host - return - } - } - - // No record was replaced, so add a new one. - *hosts = append(*hosts, host) -} - -// removeChallengeRecord removes a DNS challenge TXT record from a list of -// namecheap host records. Return true if a record was removed. -func (d *DNSProvider) removeChallengeRecord(ch *challenge, hosts *[]host) bool { - // Find the challenge TXT record and remove it if found. - for i, h := range *hosts { - if h.Name == ch.key && h.Type == "TXT" { - *hosts = append((*hosts)[:i], (*hosts)[i+1:]...) - return true - } - } - - return false -} - -// Present installs a TXT record for the DNS challenge. -func (d *DNSProvider) Present(domain, token, keyAuth string) error { - tlds, err := d.getTLDs() - if err != nil { - return err - } - - ch, err := newChallenge(domain, keyAuth, tlds) - if err != nil { - return err - } - - hosts, err := d.getHosts(ch) - if err != nil { - return err - } - - d.addChallengeRecord(ch, &hosts) - - if debug { - for _, h := range hosts { - fmt.Printf( - "%-5.5s %-30.30s %-6s %-70.70s\n", - h.Type, h.Name, h.TTL, h.Address) - } - } - - return d.setHosts(ch, hosts) -} - -// CleanUp removes a TXT record used for a previous DNS challenge. -func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { - tlds, err := d.getTLDs() - if err != nil { - return err - } - - ch, err := newChallenge(domain, keyAuth, tlds) - if err != nil { - return err - } - - hosts, err := d.getHosts(ch) - if err != nil { - return err - } - - if removed := d.removeChallengeRecord(ch, &hosts); !removed { - return nil - } - - return d.setHosts(ch, hosts) -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/ovh/ovh.go b/vendor/github.com/xenolf/lego/providers/dns/ovh/ovh.go deleted file mode 100644 index 290a8d7..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/ovh/ovh.go +++ /dev/null @@ -1,159 +0,0 @@ -// Package OVH implements a DNS provider for solving the DNS-01 -// challenge using OVH DNS. -package ovh - -import ( - "fmt" - "os" - "strings" - "sync" - - "github.com/ovh/go-ovh/ovh" - "github.com/xenolf/lego/acme" -) - -// OVH API reference: https://eu.api.ovh.com/ -// Create a Token: https://eu.api.ovh.com/createToken/ - -// DNSProvider is an implementation of the acme.ChallengeProvider interface -// that uses OVH's REST API to manage TXT records for a domain. -type DNSProvider struct { - client *ovh.Client - recordIDs map[string]int - recordIDsMu sync.Mutex -} - -// NewDNSProvider returns a DNSProvider instance configured for OVH -// Credentials must be passed in the environment variable: -// OVH_ENDPOINT : it must be ovh-eu or ovh-ca -// OVH_APPLICATION_KEY -// OVH_APPLICATION_SECRET -// OVH_CONSUMER_KEY -func NewDNSProvider() (*DNSProvider, error) { - apiEndpoint := os.Getenv("OVH_ENDPOINT") - applicationKey := os.Getenv("OVH_APPLICATION_KEY") - applicationSecret := os.Getenv("OVH_APPLICATION_SECRET") - consumerKey := os.Getenv("OVH_CONSUMER_KEY") - return NewDNSProviderCredentials(apiEndpoint, applicationKey, applicationSecret, consumerKey) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for OVH. -func NewDNSProviderCredentials(apiEndpoint, applicationKey, applicationSecret, consumerKey string) (*DNSProvider, error) { - if apiEndpoint == "" || applicationKey == "" || applicationSecret == "" || consumerKey == "" { - return nil, fmt.Errorf("OVH credentials missing") - } - - ovhClient, _ := ovh.NewClient( - apiEndpoint, - applicationKey, - applicationSecret, - consumerKey, - ) - - return &DNSProvider{ - client: ovhClient, - recordIDs: make(map[string]int), - }, nil -} - -// Present creates a TXT record to fulfil the dns-01 challenge. -func (d *DNSProvider) Present(domain, token, keyAuth string) error { - - // txtRecordRequest represents the request body to DO's API to make a TXT record - type txtRecordRequest struct { - FieldType string `json:"fieldType"` - SubDomain string `json:"subDomain"` - Target string `json:"target"` - TTL int `json:"ttl"` - } - - // txtRecordResponse represents a response from DO's API after making a TXT record - type txtRecordResponse struct { - ID int `json:"id"` - FieldType string `json:"fieldType"` - SubDomain string `json:"subDomain"` - Target string `json:"target"` - TTL int `json:"ttl"` - Zone string `json:"zone"` - } - - fqdn, value, ttl := acme.DNS01Record(domain, keyAuth) - - // Parse domain name - authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameservers) - if err != nil { - return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err) - } - - authZone = acme.UnFqdn(authZone) - subDomain := d.extractRecordName(fqdn, authZone) - - reqURL := fmt.Sprintf("/domain/zone/%s/record", authZone) - reqData := txtRecordRequest{FieldType: "TXT", SubDomain: subDomain, Target: value, TTL: ttl} - var respData txtRecordResponse - - // Create TXT record - err = d.client.Post(reqURL, reqData, &respData) - if err != nil { - fmt.Printf("Error when call OVH api to add record : %q \n", err) - return err - } - - // Apply the change - reqURL = fmt.Sprintf("/domain/zone/%s/refresh", authZone) - err = d.client.Post(reqURL, nil, nil) - if err != nil { - fmt.Printf("Error when call OVH api to refresh zone : %q \n", err) - return err - } - - d.recordIDsMu.Lock() - d.recordIDs[fqdn] = respData.ID - d.recordIDsMu.Unlock() - - return nil -} - -// CleanUp removes the TXT record matching the specified parameters -func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - - // get the record's unique ID from when we created it - d.recordIDsMu.Lock() - recordID, ok := d.recordIDs[fqdn] - d.recordIDsMu.Unlock() - if !ok { - return fmt.Errorf("unknown record ID for '%s'", fqdn) - } - - authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameservers) - if err != nil { - return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err) - } - - authZone = acme.UnFqdn(authZone) - - reqURL := fmt.Sprintf("/domain/zone/%s/record/%d", authZone, recordID) - - err = d.client.Delete(reqURL, nil) - if err != nil { - fmt.Printf("Error when call OVH api to delete challenge record : %q \n", err) - return err - } - - // Delete record ID from map - d.recordIDsMu.Lock() - delete(d.recordIDs, fqdn) - d.recordIDsMu.Unlock() - - return nil -} - -func (d *DNSProvider) extractRecordName(fqdn, domain string) string { - name := acme.UnFqdn(fqdn) - if idx := strings.Index(name, "."+domain); idx != -1 { - return name[:idx] - } - return name -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/pdns/README.md b/vendor/github.com/xenolf/lego/providers/dns/pdns/README.md deleted file mode 100644 index 23abb76..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/pdns/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## PowerDNS provider - -Tested and confirmed to work with PowerDNS authoratative server 3.4.8 and 4.0.1. Refer to [PowerDNS documentation](https://doc.powerdns.com/md/httpapi/README/) instructions on how to enable the built-in API interface. - -PowerDNS Notes: -- PowerDNS API does not currently support SSL, therefore you should take care to ensure that traffic between lego and the PowerDNS API is over a trusted network, VPN etc. -- In order to have the SOA serial automatically increment each time the `_acme-challenge` record is added/modified via the API, set `SOA-API-EDIT` to `INCEPTION-INCREMENT` for the zone in the `domainmetadata` table diff --git a/vendor/github.com/xenolf/lego/providers/dns/pdns/pdns.go b/vendor/github.com/xenolf/lego/providers/dns/pdns/pdns.go deleted file mode 100644 index a4fd22b..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/pdns/pdns.go +++ /dev/null @@ -1,343 +0,0 @@ -// Package pdns implements a DNS provider for solving the DNS-01 -// challenge using PowerDNS nameserver. -package pdns - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "os" - "strconv" - "strings" - "time" - - "github.com/xenolf/lego/acme" -) - -// DNSProvider is an implementation of the acme.ChallengeProvider interface -type DNSProvider struct { - apiKey string - host *url.URL - apiVersion int -} - -// NewDNSProvider returns a DNSProvider instance configured for pdns. -// Credentials must be passed in the environment variable: -// PDNS_API_URL and PDNS_API_KEY. -func NewDNSProvider() (*DNSProvider, error) { - key := os.Getenv("PDNS_API_KEY") - hostUrl, err := url.Parse(os.Getenv("PDNS_API_URL")) - if err != nil { - return nil, err - } - - return NewDNSProviderCredentials(hostUrl, key) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for pdns. -func NewDNSProviderCredentials(host *url.URL, key string) (*DNSProvider, error) { - if key == "" { - return nil, fmt.Errorf("PDNS API key missing") - } - - if host == nil || host.Host == "" { - return nil, fmt.Errorf("PDNS API URL missing") - } - - provider := &DNSProvider{ - host: host, - apiKey: key, - } - provider.getAPIVersion() - - return provider, nil -} - -// Timeout returns the timeout and interval to use when checking for DNS -// propagation. Adjusting here to cope with spikes in propagation times. -func (c *DNSProvider) Timeout() (timeout, interval time.Duration) { - return 120 * time.Second, 2 * time.Second -} - -// Present creates a TXT record to fulfil the dns-01 challenge -func (c *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, _ := acme.DNS01Record(domain, keyAuth) - zone, err := c.getHostedZone(fqdn) - if err != nil { - return err - } - - name := fqdn - - // pre-v1 API wants non-fqdn - if c.apiVersion == 0 { - name = acme.UnFqdn(fqdn) - } - - rec := pdnsRecord{ - Content: "\"" + value + "\"", - Disabled: false, - - // pre-v1 API - Type: "TXT", - Name: name, - TTL: 120, - } - - rrsets := rrSets{ - RRSets: []rrSet{ - rrSet{ - Name: name, - ChangeType: "REPLACE", - Type: "TXT", - Kind: "Master", - TTL: 120, - Records: []pdnsRecord{rec}, - }, - }, - } - - body, err := json.Marshal(rrsets) - if err != nil { - return err - } - - _, err = c.makeRequest("PATCH", zone.URL, bytes.NewReader(body)) - if err != nil { - fmt.Println("here") - return err - } - - return nil -} - -// CleanUp removes the TXT record matching the specified parameters -func (c *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - - zone, err := c.getHostedZone(fqdn) - if err != nil { - return err - } - - set, err := c.findTxtRecord(fqdn) - if err != nil { - return err - } - - rrsets := rrSets{ - RRSets: []rrSet{ - rrSet{ - Name: set.Name, - Type: set.Type, - ChangeType: "DELETE", - }, - }, - } - body, err := json.Marshal(rrsets) - if err != nil { - return err - } - - _, err = c.makeRequest("PATCH", zone.URL, bytes.NewReader(body)) - if err != nil { - return err - } - - return nil -} - -func (c *DNSProvider) getHostedZone(fqdn string) (*hostedZone, error) { - var zone hostedZone - authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) - if err != nil { - return nil, err - } - - url := "/servers/localhost/zones" - result, err := c.makeRequest("GET", url, nil) - if err != nil { - return nil, err - } - - zones := []hostedZone{} - err = json.Unmarshal(result, &zones) - if err != nil { - return nil, err - } - - url = "" - for _, zone := range zones { - if acme.UnFqdn(zone.Name) == acme.UnFqdn(authZone) { - url = zone.URL - } - } - - result, err = c.makeRequest("GET", url, nil) - if err != nil { - return nil, err - } - - err = json.Unmarshal(result, &zone) - if err != nil { - return nil, err - } - - // convert pre-v1 API result - if len(zone.Records) > 0 { - zone.RRSets = []rrSet{} - for _, record := range zone.Records { - set := rrSet{ - Name: record.Name, - Type: record.Type, - Records: []pdnsRecord{record}, - } - zone.RRSets = append(zone.RRSets, set) - } - } - - return &zone, nil -} - -func (c *DNSProvider) findTxtRecord(fqdn string) (*rrSet, error) { - zone, err := c.getHostedZone(fqdn) - if err != nil { - return nil, err - } - - _, err = c.makeRequest("GET", zone.URL, nil) - if err != nil { - return nil, err - } - - for _, set := range zone.RRSets { - if (set.Name == acme.UnFqdn(fqdn) || set.Name == fqdn) && set.Type == "TXT" { - return &set, nil - } - } - - return nil, fmt.Errorf("No existing record found for %s", fqdn) -} - -func (c *DNSProvider) getAPIVersion() { - type APIVersion struct { - URL string `json:"url"` - Version int `json:"version"` - } - - result, err := c.makeRequest("GET", "/api", nil) - if err != nil { - return - } - - var versions []APIVersion - err = json.Unmarshal(result, &versions) - if err != nil { - return - } - - latestVersion := 0 - for _, v := range versions { - if v.Version > latestVersion { - latestVersion = v.Version - } - } - c.apiVersion = latestVersion -} - -func (c *DNSProvider) makeRequest(method, uri string, body io.Reader) (json.RawMessage, error) { - type APIError struct { - Error string `json:"error"` - } - var path = "" - if c.host.Path != "/" { - path = c.host.Path - } - if c.apiVersion > 0 { - if !strings.HasPrefix(uri, "api/v") { - uri = "/api/v" + strconv.Itoa(c.apiVersion) + uri - } else { - uri = "/" + uri - } - } - url := c.host.Scheme + "://" + c.host.Host + path + uri - req, err := http.NewRequest(method, url, body) - if err != nil { - return nil, err - } - - req.Header.Set("X-API-Key", c.apiKey) - - client := http.Client{Timeout: 30 * time.Second} - resp, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("Error talking to PDNS API -> %v", err) - } - - defer resp.Body.Close() - - if resp.StatusCode != 422 && (resp.StatusCode < 200 || resp.StatusCode >= 300) { - return nil, fmt.Errorf("Unexpected HTTP status code %d when fetching '%s'", resp.StatusCode, url) - } - - var msg json.RawMessage - err = json.NewDecoder(resp.Body).Decode(&msg) - switch { - case err == io.EOF: - // empty body - return nil, nil - case err != nil: - // other error - return nil, err - } - - // check for PowerDNS error message - if len(msg) > 0 && msg[0] == '{' { - var apiError APIError - err = json.Unmarshal(msg, &apiError) - if err != nil { - return nil, err - } - if apiError.Error != "" { - return nil, fmt.Errorf("Error talking to PDNS API -> %v", apiError.Error) - } - } - return msg, nil -} - -type pdnsRecord struct { - Content string `json:"content"` - Disabled bool `json:"disabled"` - - // pre-v1 API - Name string `json:"name"` - Type string `json:"type"` - TTL int `json:"ttl,omitempty"` -} - -type hostedZone struct { - ID string `json:"id"` - Name string `json:"name"` - URL string `json:"url"` - RRSets []rrSet `json:"rrsets"` - - // pre-v1 API - Records []pdnsRecord `json:"records"` -} - -type rrSet struct { - Name string `json:"name"` - Type string `json:"type"` - Kind string `json:"kind"` - ChangeType string `json:"changetype"` - Records []pdnsRecord `json:"records"` - TTL int `json:"ttl,omitempty"` -} - -type rrSets struct { - RRSets []rrSet `json:"rrsets"` -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/rfc2136/rfc2136.go b/vendor/github.com/xenolf/lego/providers/dns/rfc2136/rfc2136.go deleted file mode 100644 index 43a95f1..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/rfc2136/rfc2136.go +++ /dev/null @@ -1,129 +0,0 @@ -// Package rfc2136 implements a DNS provider for solving the DNS-01 challenge -// using the rfc2136 dynamic update. -package rfc2136 - -import ( - "fmt" - "net" - "os" - "strings" - "time" - - "github.com/miekg/dns" - "github.com/xenolf/lego/acme" -) - -// DNSProvider is an implementation of the acme.ChallengeProvider interface that -// uses dynamic DNS updates (RFC 2136) to create TXT records on a nameserver. -type DNSProvider struct { - nameserver string - tsigAlgorithm string - tsigKey string - tsigSecret string -} - -// NewDNSProvider returns a DNSProvider instance configured for rfc2136 -// dynamic update. Credentials must be passed in the environment variables: -// RFC2136_NAMESERVER, RFC2136_TSIG_ALGORITHM, RFC2136_TSIG_KEY and -// RFC2136_TSIG_SECRET. To disable TSIG authentication, leave the TSIG -// variables unset. RFC2136_NAMESERVER must be a network address in the form -// "host" or "host:port". -func NewDNSProvider() (*DNSProvider, error) { - nameserver := os.Getenv("RFC2136_NAMESERVER") - tsigAlgorithm := os.Getenv("RFC2136_TSIG_ALGORITHM") - tsigKey := os.Getenv("RFC2136_TSIG_KEY") - tsigSecret := os.Getenv("RFC2136_TSIG_SECRET") - return NewDNSProviderCredentials(nameserver, tsigAlgorithm, tsigKey, tsigSecret) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a -// DNSProvider instance configured for rfc2136 dynamic update. To disable TSIG -// authentication, leave the TSIG parameters as empty strings. -// nameserver must be a network address in the form "host" or "host:port". -func NewDNSProviderCredentials(nameserver, tsigAlgorithm, tsigKey, tsigSecret string) (*DNSProvider, error) { - if nameserver == "" { - return nil, fmt.Errorf("RFC2136 nameserver missing") - } - - // Append the default DNS port if none is specified. - if _, _, err := net.SplitHostPort(nameserver); err != nil { - if strings.Contains(err.Error(), "missing port") { - nameserver = net.JoinHostPort(nameserver, "53") - } else { - return nil, err - } - } - d := &DNSProvider{ - nameserver: nameserver, - } - if tsigAlgorithm == "" { - tsigAlgorithm = dns.HmacMD5 - } - d.tsigAlgorithm = tsigAlgorithm - if len(tsigKey) > 0 && len(tsigSecret) > 0 { - d.tsigKey = tsigKey - d.tsigSecret = tsigSecret - } - - return d, nil -} - -// Present creates a TXT record using the specified parameters -func (r *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, ttl := acme.DNS01Record(domain, keyAuth) - return r.changeRecord("INSERT", fqdn, value, ttl) -} - -// CleanUp removes the TXT record matching the specified parameters -func (r *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, value, ttl := acme.DNS01Record(domain, keyAuth) - return r.changeRecord("REMOVE", fqdn, value, ttl) -} - -func (r *DNSProvider) changeRecord(action, fqdn, value string, ttl int) error { - // Find the zone for the given fqdn - zone, err := acme.FindZoneByFqdn(fqdn, []string{r.nameserver}) - if err != nil { - return err - } - - // Create RR - rr := new(dns.TXT) - rr.Hdr = dns.RR_Header{Name: fqdn, Rrtype: dns.TypeTXT, Class: dns.ClassINET, Ttl: uint32(ttl)} - rr.Txt = []string{value} - rrs := []dns.RR{rr} - - // Create dynamic update packet - m := new(dns.Msg) - m.SetUpdate(zone) - switch action { - case "INSERT": - // Always remove old challenge left over from who knows what. - m.RemoveRRset(rrs) - m.Insert(rrs) - case "REMOVE": - m.Remove(rrs) - default: - return fmt.Errorf("Unexpected action: %s", action) - } - - // Setup client - c := new(dns.Client) - c.SingleInflight = true - // TSIG authentication / msg signing - if len(r.tsigKey) > 0 && len(r.tsigSecret) > 0 { - m.SetTsig(dns.Fqdn(r.tsigKey), r.tsigAlgorithm, 300, time.Now().Unix()) - c.TsigSecret = map[string]string{dns.Fqdn(r.tsigKey): r.tsigSecret} - } - - // Send the query - reply, _, err := c.Exchange(m, r.nameserver) - if err != nil { - return fmt.Errorf("DNS update failed: %v", err) - } - if reply != nil && reply.Rcode != dns.RcodeSuccess { - return fmt.Errorf("DNS update failed. Server replied: %s", dns.RcodeToString[reply.Rcode]) - } - - return nil -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/route53/route53.go b/vendor/github.com/xenolf/lego/providers/dns/route53/route53.go deleted file mode 100644 index f3e53a8..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/route53/route53.go +++ /dev/null @@ -1,171 +0,0 @@ -// Package route53 implements a DNS provider for solving the DNS-01 challenge -// using AWS Route 53 DNS. -package route53 - -import ( - "fmt" - "math/rand" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/xenolf/lego/acme" -) - -const ( - maxRetries = 5 - route53TTL = 10 -) - -// DNSProvider implements the acme.ChallengeProvider interface -type DNSProvider struct { - client *route53.Route53 -} - -// customRetryer implements the client.Retryer interface by composing the -// DefaultRetryer. It controls the logic for retrying recoverable request -// errors (e.g. when rate limits are exceeded). -type customRetryer struct { - client.DefaultRetryer -} - -// RetryRules overwrites the DefaultRetryer's method. -// It uses a basic exponential backoff algorithm that returns an initial -// delay of ~400ms with an upper limit of ~30 seconds which should prevent -// causing a high number of consecutive throttling errors. -// For reference: Route 53 enforces an account-wide(!) 5req/s query limit. -func (d customRetryer) RetryRules(r *request.Request) time.Duration { - retryCount := r.RetryCount - if retryCount > 7 { - retryCount = 7 - } - - delay := (1 << uint(retryCount)) * (rand.Intn(50) + 200) - return time.Duration(delay) * time.Millisecond -} - -// NewDNSProvider returns a DNSProvider instance configured for the AWS -// Route 53 service. -// -// AWS Credentials are automatically detected in the following locations -// and prioritized in the following order: -// 1. Environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, -// AWS_REGION, [AWS_SESSION_TOKEN] -// 2. Shared credentials file (defaults to ~/.aws/credentials) -// 3. Amazon EC2 IAM role -// -// See also: https://github.com/aws/aws-sdk-go/wiki/configuring-sdk -func NewDNSProvider() (*DNSProvider, error) { - r := customRetryer{} - r.NumMaxRetries = maxRetries - config := request.WithRetryer(aws.NewConfig(), r) - client := route53.New(session.New(config)) - - return &DNSProvider{client: client}, nil -} - -// Present creates a TXT record using the specified parameters -func (r *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, _ := acme.DNS01Record(domain, keyAuth) - value = `"` + value + `"` - return r.changeRecord("UPSERT", fqdn, value, route53TTL) -} - -// CleanUp removes the TXT record matching the specified parameters -func (r *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, value, _ := acme.DNS01Record(domain, keyAuth) - value = `"` + value + `"` - return r.changeRecord("DELETE", fqdn, value, route53TTL) -} - -func (r *DNSProvider) changeRecord(action, fqdn, value string, ttl int) error { - hostedZoneID, err := getHostedZoneID(fqdn, r.client) - if err != nil { - return fmt.Errorf("Failed to determine Route 53 hosted zone ID: %v", err) - } - - recordSet := newTXTRecordSet(fqdn, value, ttl) - reqParams := &route53.ChangeResourceRecordSetsInput{ - HostedZoneId: aws.String(hostedZoneID), - ChangeBatch: &route53.ChangeBatch{ - Comment: aws.String("Managed by Lego"), - Changes: []*route53.Change{ - { - Action: aws.String(action), - ResourceRecordSet: recordSet, - }, - }, - }, - } - - resp, err := r.client.ChangeResourceRecordSets(reqParams) - if err != nil { - return fmt.Errorf("Failed to change Route 53 record set: %v", err) - } - - statusID := resp.ChangeInfo.Id - - return acme.WaitFor(120*time.Second, 4*time.Second, func() (bool, error) { - reqParams := &route53.GetChangeInput{ - Id: statusID, - } - resp, err := r.client.GetChange(reqParams) - if err != nil { - return false, fmt.Errorf("Failed to query Route 53 change status: %v", err) - } - if *resp.ChangeInfo.Status == route53.ChangeStatusInsync { - return true, nil - } - return false, nil - }) -} - -func getHostedZoneID(fqdn string, client *route53.Route53) (string, error) { - authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) - if err != nil { - return "", err - } - - // .DNSName should not have a trailing dot - reqParams := &route53.ListHostedZonesByNameInput{ - DNSName: aws.String(acme.UnFqdn(authZone)), - } - resp, err := client.ListHostedZonesByName(reqParams) - if err != nil { - return "", err - } - - var hostedZoneID string - for _, hostedZone := range resp.HostedZones { - // .Name has a trailing dot - if !*hostedZone.Config.PrivateZone && *hostedZone.Name == authZone { - hostedZoneID = *hostedZone.Id - break - } - } - - if len(hostedZoneID) == 0 { - return "", fmt.Errorf("Zone %s not found in Route 53 for domain %s", authZone, fqdn) - } - - if strings.HasPrefix(hostedZoneID, "/hostedzone/") { - hostedZoneID = strings.TrimPrefix(hostedZoneID, "/hostedzone/") - } - - return hostedZoneID, nil -} - -func newTXTRecordSet(fqdn, value string, ttl int) *route53.ResourceRecordSet { - return &route53.ResourceRecordSet{ - Name: aws.String(fqdn), - Type: aws.String("TXT"), - TTL: aws.Int64(int64(ttl)), - ResourceRecords: []*route53.ResourceRecord{ - {Value: aws.String(value)}, - }, - } -} diff --git a/vendor/github.com/xenolf/lego/providers/dns/vultr/vultr.go b/vendor/github.com/xenolf/lego/providers/dns/vultr/vultr.go deleted file mode 100644 index bc20675..0000000 --- a/vendor/github.com/xenolf/lego/providers/dns/vultr/vultr.go +++ /dev/null @@ -1,127 +0,0 @@ -// Package vultr implements a DNS provider for solving the DNS-01 challenge using -// the vultr DNS. -// See https://www.vultr.com/api/#dns -package vultr - -import ( - "fmt" - "os" - "strings" - - vultr "github.com/JamesClonk/vultr/lib" - "github.com/xenolf/lego/acme" -) - -// DNSProvider is an implementation of the acme.ChallengeProvider interface. -type DNSProvider struct { - client *vultr.Client -} - -// NewDNSProvider returns a DNSProvider instance with a configured Vultr client. -// Authentication uses the VULTR_API_KEY environment variable. -func NewDNSProvider() (*DNSProvider, error) { - apiKey := os.Getenv("VULTR_API_KEY") - return NewDNSProviderCredentials(apiKey) -} - -// NewDNSProviderCredentials uses the supplied credentials to return a DNSProvider -// instance configured for Vultr. -func NewDNSProviderCredentials(apiKey string) (*DNSProvider, error) { - if apiKey == "" { - return nil, fmt.Errorf("Vultr credentials missing") - } - - c := &DNSProvider{ - client: vultr.NewClient(apiKey, nil), - } - - return c, nil -} - -// Present creates a TXT record to fulfil the DNS-01 challenge. -func (c *DNSProvider) Present(domain, token, keyAuth string) error { - fqdn, value, ttl := acme.DNS01Record(domain, keyAuth) - - zoneDomain, err := c.getHostedZone(domain) - if err != nil { - return err - } - - name := c.extractRecordName(fqdn, zoneDomain) - - err = c.client.CreateDNSRecord(zoneDomain, name, "TXT", `"`+value+`"`, 0, ttl) - if err != nil { - return fmt.Errorf("Vultr API call failed: %v", err) - } - - return nil -} - -// CleanUp removes the TXT record matching the specified parameters. -func (c *DNSProvider) CleanUp(domain, token, keyAuth string) error { - fqdn, _, _ := acme.DNS01Record(domain, keyAuth) - - zoneDomain, records, err := c.findTxtRecords(domain, fqdn) - if err != nil { - return err - } - - for _, rec := range records { - err := c.client.DeleteDNSRecord(zoneDomain, rec.RecordID) - if err != nil { - return err - } - } - return nil -} - -func (c *DNSProvider) getHostedZone(domain string) (string, error) { - domains, err := c.client.GetDNSDomains() - if err != nil { - return "", fmt.Errorf("Vultr API call failed: %v", err) - } - - var hostedDomain vultr.DNSDomain - for _, d := range domains { - if strings.HasSuffix(domain, d.Domain) { - if len(d.Domain) > len(hostedDomain.Domain) { - hostedDomain = d - } - } - } - if hostedDomain.Domain == "" { - return "", fmt.Errorf("No matching Vultr domain found for domain %s", domain) - } - - return hostedDomain.Domain, nil -} - -func (c *DNSProvider) findTxtRecords(domain, fqdn string) (string, []vultr.DNSRecord, error) { - zoneDomain, err := c.getHostedZone(domain) - if err != nil { - return "", nil, err - } - - var records []vultr.DNSRecord - result, err := c.client.GetDNSRecords(zoneDomain) - if err != nil { - return "", records, fmt.Errorf("Vultr API call has failed: %v", err) - } - - recordName := c.extractRecordName(fqdn, zoneDomain) - for _, record := range result { - if record.Type == "TXT" && record.Name == recordName { - records = append(records, record) - } - } - - return zoneDomain, records, nil -} - -func (c *DNSProvider) extractRecordName(fqdn, domain string) string { - name := acme.UnFqdn(fqdn) - if idx := strings.Index(name, "."+domain); idx != -1 { - return name[:idx] - } - return name -} diff --git a/vendor/golang.org/x/crypto/bcrypt/base64.go b/vendor/golang.org/x/crypto/bcrypt/base64.go new file mode 100644 index 0000000..fc31160 --- /dev/null +++ b/vendor/golang.org/x/crypto/bcrypt/base64.go @@ -0,0 +1,35 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bcrypt + +import "encoding/base64" + +const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + +var bcEncoding = base64.NewEncoding(alphabet) + +func base64Encode(src []byte) []byte { + n := bcEncoding.EncodedLen(len(src)) + dst := make([]byte, n) + bcEncoding.Encode(dst, src) + for dst[n-1] == '=' { + n-- + } + return dst[:n] +} + +func base64Decode(src []byte) ([]byte, error) { + numOfEquals := 4 - (len(src) % 4) + for i := 0; i < numOfEquals; i++ { + src = append(src, '=') + } + + dst := make([]byte, bcEncoding.DecodedLen(len(src))) + n, err := bcEncoding.Decode(dst, src) + if err != nil { + return nil, err + } + return dst[:n], nil +} diff --git a/vendor/golang.org/x/crypto/bcrypt/bcrypt.go b/vendor/golang.org/x/crypto/bcrypt/bcrypt.go new file mode 100644 index 0000000..202fa8a --- /dev/null +++ b/vendor/golang.org/x/crypto/bcrypt/bcrypt.go @@ -0,0 +1,295 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing +// algorithm. See http://www.usenix.org/event/usenix99/provos/provos.pdf +package bcrypt // import "golang.org/x/crypto/bcrypt" + +// The code is a port of Provos and Mazières's C implementation. +import ( + "crypto/rand" + "crypto/subtle" + "errors" + "fmt" + "io" + "strconv" + + "golang.org/x/crypto/blowfish" +) + +const ( + MinCost int = 4 // the minimum allowable cost as passed in to GenerateFromPassword + MaxCost int = 31 // the maximum allowable cost as passed in to GenerateFromPassword + DefaultCost int = 10 // the cost that will actually be set if a cost below MinCost is passed into GenerateFromPassword +) + +// The error returned from CompareHashAndPassword when a password and hash do +// not match. +var ErrMismatchedHashAndPassword = errors.New("crypto/bcrypt: hashedPassword is not the hash of the given password") + +// The error returned from CompareHashAndPassword when a hash is too short to +// be a bcrypt hash. +var ErrHashTooShort = errors.New("crypto/bcrypt: hashedSecret too short to be a bcrypted password") + +// The error returned from CompareHashAndPassword when a hash was created with +// a bcrypt algorithm newer than this implementation. +type HashVersionTooNewError byte + +func (hv HashVersionTooNewError) Error() string { + return fmt.Sprintf("crypto/bcrypt: bcrypt algorithm version '%c' requested is newer than current version '%c'", byte(hv), majorVersion) +} + +// The error returned from CompareHashAndPassword when a hash starts with something other than '$' +type InvalidHashPrefixError byte + +func (ih InvalidHashPrefixError) Error() string { + return fmt.Sprintf("crypto/bcrypt: bcrypt hashes must start with '$', but hashedSecret started with '%c'", byte(ih)) +} + +type InvalidCostError int + +func (ic InvalidCostError) Error() string { + return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), int(MinCost), int(MaxCost)) +} + +const ( + majorVersion = '2' + minorVersion = 'a' + maxSaltSize = 16 + maxCryptedHashSize = 23 + encodedSaltSize = 22 + encodedHashSize = 31 + minHashSize = 59 +) + +// magicCipherData is an IV for the 64 Blowfish encryption calls in +// bcrypt(). It's the string "OrpheanBeholderScryDoubt" in big-endian bytes. +var magicCipherData = []byte{ + 0x4f, 0x72, 0x70, 0x68, + 0x65, 0x61, 0x6e, 0x42, + 0x65, 0x68, 0x6f, 0x6c, + 0x64, 0x65, 0x72, 0x53, + 0x63, 0x72, 0x79, 0x44, + 0x6f, 0x75, 0x62, 0x74, +} + +type hashed struct { + hash []byte + salt []byte + cost int // allowed range is MinCost to MaxCost + major byte + minor byte +} + +// GenerateFromPassword returns the bcrypt hash of the password at the given +// cost. If the cost given is less than MinCost, the cost will be set to +// DefaultCost, instead. Use CompareHashAndPassword, as defined in this package, +// to compare the returned hashed password with its cleartext version. +func GenerateFromPassword(password []byte, cost int) ([]byte, error) { + p, err := newFromPassword(password, cost) + if err != nil { + return nil, err + } + return p.Hash(), nil +} + +// CompareHashAndPassword compares a bcrypt hashed password with its possible +// plaintext equivalent. Returns nil on success, or an error on failure. +func CompareHashAndPassword(hashedPassword, password []byte) error { + p, err := newFromHash(hashedPassword) + if err != nil { + return err + } + + otherHash, err := bcrypt(password, p.cost, p.salt) + if err != nil { + return err + } + + otherP := &hashed{otherHash, p.salt, p.cost, p.major, p.minor} + if subtle.ConstantTimeCompare(p.Hash(), otherP.Hash()) == 1 { + return nil + } + + return ErrMismatchedHashAndPassword +} + +// Cost returns the hashing cost used to create the given hashed +// password. When, in the future, the hashing cost of a password system needs +// to be increased in order to adjust for greater computational power, this +// function allows one to establish which passwords need to be updated. +func Cost(hashedPassword []byte) (int, error) { + p, err := newFromHash(hashedPassword) + if err != nil { + return 0, err + } + return p.cost, nil +} + +func newFromPassword(password []byte, cost int) (*hashed, error) { + if cost < MinCost { + cost = DefaultCost + } + p := new(hashed) + p.major = majorVersion + p.minor = minorVersion + + err := checkCost(cost) + if err != nil { + return nil, err + } + p.cost = cost + + unencodedSalt := make([]byte, maxSaltSize) + _, err = io.ReadFull(rand.Reader, unencodedSalt) + if err != nil { + return nil, err + } + + p.salt = base64Encode(unencodedSalt) + hash, err := bcrypt(password, p.cost, p.salt) + if err != nil { + return nil, err + } + p.hash = hash + return p, err +} + +func newFromHash(hashedSecret []byte) (*hashed, error) { + if len(hashedSecret) < minHashSize { + return nil, ErrHashTooShort + } + p := new(hashed) + n, err := p.decodeVersion(hashedSecret) + if err != nil { + return nil, err + } + hashedSecret = hashedSecret[n:] + n, err = p.decodeCost(hashedSecret) + if err != nil { + return nil, err + } + hashedSecret = hashedSecret[n:] + + // The "+2" is here because we'll have to append at most 2 '=' to the salt + // when base64 decoding it in expensiveBlowfishSetup(). + p.salt = make([]byte, encodedSaltSize, encodedSaltSize+2) + copy(p.salt, hashedSecret[:encodedSaltSize]) + + hashedSecret = hashedSecret[encodedSaltSize:] + p.hash = make([]byte, len(hashedSecret)) + copy(p.hash, hashedSecret) + + return p, nil +} + +func bcrypt(password []byte, cost int, salt []byte) ([]byte, error) { + cipherData := make([]byte, len(magicCipherData)) + copy(cipherData, magicCipherData) + + c, err := expensiveBlowfishSetup(password, uint32(cost), salt) + if err != nil { + return nil, err + } + + for i := 0; i < 24; i += 8 { + for j := 0; j < 64; j++ { + c.Encrypt(cipherData[i:i+8], cipherData[i:i+8]) + } + } + + // Bug compatibility with C bcrypt implementations. We only encode 23 of + // the 24 bytes encrypted. + hsh := base64Encode(cipherData[:maxCryptedHashSize]) + return hsh, nil +} + +func expensiveBlowfishSetup(key []byte, cost uint32, salt []byte) (*blowfish.Cipher, error) { + csalt, err := base64Decode(salt) + if err != nil { + return nil, err + } + + // Bug compatibility with C bcrypt implementations. They use the trailing + // NULL in the key string during expansion. + // We copy the key to prevent changing the underlying array. + ckey := append(key[:len(key):len(key)], 0) + + c, err := blowfish.NewSaltedCipher(ckey, csalt) + if err != nil { + return nil, err + } + + var i, rounds uint64 + rounds = 1 << cost + for i = 0; i < rounds; i++ { + blowfish.ExpandKey(ckey, c) + blowfish.ExpandKey(csalt, c) + } + + return c, nil +} + +func (p *hashed) Hash() []byte { + arr := make([]byte, 60) + arr[0] = '$' + arr[1] = p.major + n := 2 + if p.minor != 0 { + arr[2] = p.minor + n = 3 + } + arr[n] = '$' + n += 1 + copy(arr[n:], []byte(fmt.Sprintf("%02d", p.cost))) + n += 2 + arr[n] = '$' + n += 1 + copy(arr[n:], p.salt) + n += encodedSaltSize + copy(arr[n:], p.hash) + n += encodedHashSize + return arr[:n] +} + +func (p *hashed) decodeVersion(sbytes []byte) (int, error) { + if sbytes[0] != '$' { + return -1, InvalidHashPrefixError(sbytes[0]) + } + if sbytes[1] > majorVersion { + return -1, HashVersionTooNewError(sbytes[1]) + } + p.major = sbytes[1] + n := 3 + if sbytes[2] != '$' { + p.minor = sbytes[2] + n++ + } + return n, nil +} + +// sbytes should begin where decodeVersion left off. +func (p *hashed) decodeCost(sbytes []byte) (int, error) { + cost, err := strconv.Atoi(string(sbytes[0:2])) + if err != nil { + return -1, err + } + err = checkCost(cost) + if err != nil { + return -1, err + } + p.cost = cost + return 3, nil +} + +func (p *hashed) String() string { + return fmt.Sprintf("&{hash: %#v, salt: %#v, cost: %d, major: %c, minor: %c}", string(p.hash), p.salt, p.cost, p.major, p.minor) +} + +func checkCost(cost int) error { + if cost < MinCost || cost > MaxCost { + return InvalidCostError(cost) + } + return nil +} diff --git a/vendor/golang.org/x/crypto/blowfish/block.go b/vendor/golang.org/x/crypto/blowfish/block.go new file mode 100644 index 0000000..9d80f19 --- /dev/null +++ b/vendor/golang.org/x/crypto/blowfish/block.go @@ -0,0 +1,159 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package blowfish + +// getNextWord returns the next big-endian uint32 value from the byte slice +// at the given position in a circular manner, updating the position. +func getNextWord(b []byte, pos *int) uint32 { + var w uint32 + j := *pos + for i := 0; i < 4; i++ { + w = w<<8 | uint32(b[j]) + j++ + if j >= len(b) { + j = 0 + } + } + *pos = j + return w +} + +// ExpandKey performs a key expansion on the given *Cipher. Specifically, it +// performs the Blowfish algorithm's key schedule which sets up the *Cipher's +// pi and substitution tables for calls to Encrypt. This is used, primarily, +// by the bcrypt package to reuse the Blowfish key schedule during its +// set up. It's unlikely that you need to use this directly. +func ExpandKey(key []byte, c *Cipher) { + j := 0 + for i := 0; i < 18; i++ { + // Using inlined getNextWord for performance. + var d uint32 + for k := 0; k < 4; k++ { + d = d<<8 | uint32(key[j]) + j++ + if j >= len(key) { + j = 0 + } + } + c.p[i] ^= d + } + + var l, r uint32 + for i := 0; i < 18; i += 2 { + l, r = encryptBlock(l, r, c) + c.p[i], c.p[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l, r = encryptBlock(l, r, c) + c.s0[i], c.s0[i+1] = l, r + } + for i := 0; i < 256; i += 2 { + l, r = encryptBlock(l, r, c) + c.s1[i], c.s1[i+1] = l, r + } + for i := 0; i < 256; i += 2 { + l, r = encryptBlock(l, r, c) + c.s2[i], c.s2[i+1] = l, r + } + for i := 0; i < 256; i += 2 { + l, r = encryptBlock(l, r, c) + c.s3[i], c.s3[i+1] = l, r + } +} + +// This is similar to ExpandKey, but folds the salt during the key +// schedule. While ExpandKey is essentially expandKeyWithSalt with an all-zero +// salt passed in, reusing ExpandKey turns out to be a place of inefficiency +// and specializing it here is useful. +func expandKeyWithSalt(key []byte, salt []byte, c *Cipher) { + j := 0 + for i := 0; i < 18; i++ { + c.p[i] ^= getNextWord(key, &j) + } + + j = 0 + var l, r uint32 + for i := 0; i < 18; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.p[i], c.p[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.s0[i], c.s0[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.s1[i], c.s1[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.s2[i], c.s2[i+1] = l, r + } + + for i := 0; i < 256; i += 2 { + l ^= getNextWord(salt, &j) + r ^= getNextWord(salt, &j) + l, r = encryptBlock(l, r, c) + c.s3[i], c.s3[i+1] = l, r + } +} + +func encryptBlock(l, r uint32, c *Cipher) (uint32, uint32) { + xl, xr := l, r + xl ^= c.p[0] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[1] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[2] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[3] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[4] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[5] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[6] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[7] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[8] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[9] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[10] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[11] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[12] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[13] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[14] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[15] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[16] + xr ^= c.p[17] + return xr, xl +} + +func decryptBlock(l, r uint32, c *Cipher) (uint32, uint32) { + xl, xr := l, r + xl ^= c.p[17] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[16] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[15] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[14] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[13] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[12] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[11] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[10] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[9] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[8] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[7] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[6] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[5] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[4] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[3] + xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[2] + xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[1] + xr ^= c.p[0] + return xr, xl +} diff --git a/vendor/golang.org/x/crypto/blowfish/cipher.go b/vendor/golang.org/x/crypto/blowfish/cipher.go new file mode 100644 index 0000000..2641dad --- /dev/null +++ b/vendor/golang.org/x/crypto/blowfish/cipher.go @@ -0,0 +1,91 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package blowfish implements Bruce Schneier's Blowfish encryption algorithm. +package blowfish // import "golang.org/x/crypto/blowfish" + +// The code is a port of Bruce Schneier's C implementation. +// See https://www.schneier.com/blowfish.html. + +import "strconv" + +// The Blowfish block size in bytes. +const BlockSize = 8 + +// A Cipher is an instance of Blowfish encryption using a particular key. +type Cipher struct { + p [18]uint32 + s0, s1, s2, s3 [256]uint32 +} + +type KeySizeError int + +func (k KeySizeError) Error() string { + return "crypto/blowfish: invalid key size " + strconv.Itoa(int(k)) +} + +// NewCipher creates and returns a Cipher. +// The key argument should be the Blowfish key, from 1 to 56 bytes. +func NewCipher(key []byte) (*Cipher, error) { + var result Cipher + if k := len(key); k < 1 || k > 56 { + return nil, KeySizeError(k) + } + initCipher(&result) + ExpandKey(key, &result) + return &result, nil +} + +// NewSaltedCipher creates a returns a Cipher that folds a salt into its key +// schedule. For most purposes, NewCipher, instead of NewSaltedCipher, is +// sufficient and desirable. For bcrypt compatibility, the key can be over 56 +// bytes. +func NewSaltedCipher(key, salt []byte) (*Cipher, error) { + if len(salt) == 0 { + return NewCipher(key) + } + var result Cipher + if k := len(key); k < 1 { + return nil, KeySizeError(k) + } + initCipher(&result) + expandKeyWithSalt(key, salt, &result) + return &result, nil +} + +// BlockSize returns the Blowfish block size, 8 bytes. +// It is necessary to satisfy the Block interface in the +// package "crypto/cipher". +func (c *Cipher) BlockSize() int { return BlockSize } + +// Encrypt encrypts the 8-byte buffer src using the key k +// and stores the result in dst. +// Note that for amounts of data larger than a block, +// it is not safe to just call Encrypt on successive blocks; +// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go). +func (c *Cipher) Encrypt(dst, src []byte) { + l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) + r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) + l, r = encryptBlock(l, r, c) + dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l) + dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r) +} + +// Decrypt decrypts the 8-byte buffer src using the key k +// and stores the result in dst. +func (c *Cipher) Decrypt(dst, src []byte) { + l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) + r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) + l, r = decryptBlock(l, r, c) + dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l) + dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r) +} + +func initCipher(c *Cipher) { + copy(c.p[0:], p[0:]) + copy(c.s0[0:], s0[0:]) + copy(c.s1[0:], s1[0:]) + copy(c.s2[0:], s2[0:]) + copy(c.s3[0:], s3[0:]) +} diff --git a/vendor/golang.org/x/crypto/blowfish/const.go b/vendor/golang.org/x/crypto/blowfish/const.go new file mode 100644 index 0000000..d040775 --- /dev/null +++ b/vendor/golang.org/x/crypto/blowfish/const.go @@ -0,0 +1,199 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The startup permutation array and substitution boxes. +// They are the hexadecimal digits of PI; see: +// https://www.schneier.com/code/constants.txt. + +package blowfish + +var s0 = [256]uint32{ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, + 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, + 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, + 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, + 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, + 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, + 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, + 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, + 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, + 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, + 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, + 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, + 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, + 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, + 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, + 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, + 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, + 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, + 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, + 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, + 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, + 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, +} + +var s1 = [256]uint32{ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, + 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, + 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, + 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, + 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, + 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, + 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, + 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, + 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, + 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, + 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, + 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, + 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, + 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, + 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, + 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, + 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, + 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, + 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, + 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, + 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, + 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, +} + +var s2 = [256]uint32{ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, + 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, + 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, + 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, + 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, + 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, + 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, + 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, + 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, + 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, + 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, + 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, + 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, + 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, + 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, + 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, + 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, + 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, + 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, + 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, + 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, + 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, +} + +var s3 = [256]uint32{ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, + 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, + 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, + 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, + 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, + 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, + 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, + 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, + 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, + 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, + 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, + 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, + 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, + 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, + 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, + 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, + 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, + 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, + 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, + 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, + 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, + 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, +} + +var p = [18]uint32{ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, + 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b, +} diff --git a/vendor/github.com/keybase/go-crypto/cast5/cast5.go b/vendor/golang.org/x/crypto/cast5/cast5.go similarity index 99% rename from vendor/github.com/keybase/go-crypto/cast5/cast5.go rename to vendor/golang.org/x/crypto/cast5/cast5.go index 8c1b299..0b4af37 100644 --- a/vendor/github.com/keybase/go-crypto/cast5/cast5.go +++ b/vendor/golang.org/x/crypto/cast5/cast5.go @@ -4,7 +4,7 @@ // Package cast5 implements CAST5, as defined in RFC 2144. CAST5 is a common // OpenPGP cipher. -package cast5 +package cast5 // import "golang.org/x/crypto/cast5" import "errors" diff --git a/vendor/golang.org/x/crypto/curve25519/const_amd64.s b/vendor/golang.org/x/crypto/curve25519/const_amd64.s deleted file mode 100644 index 797f9b0..0000000 --- a/vendor/golang.org/x/crypto/curve25519/const_amd64.s +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -DATA ·REDMASK51(SB)/8, $0x0007FFFFFFFFFFFF -GLOBL ·REDMASK51(SB), 8, $8 - -DATA ·_121666_213(SB)/8, $996687872 -GLOBL ·_121666_213(SB), 8, $8 - -DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA -GLOBL ·_2P0(SB), 8, $8 - -DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE -GLOBL ·_2P1234(SB), 8, $8 diff --git a/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s b/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s deleted file mode 100644 index 45484d1..0000000 --- a/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -// func cswap(inout *[5]uint64, v uint64) -TEXT ·cswap(SB),7,$0 - MOVQ inout+0(FP),DI - MOVQ v+8(FP),SI - - CMPQ SI,$1 - MOVQ 0(DI),SI - MOVQ 80(DI),DX - MOVQ 8(DI),CX - MOVQ 88(DI),R8 - MOVQ SI,R9 - CMOVQEQ DX,SI - CMOVQEQ R9,DX - MOVQ CX,R9 - CMOVQEQ R8,CX - CMOVQEQ R9,R8 - MOVQ SI,0(DI) - MOVQ DX,80(DI) - MOVQ CX,8(DI) - MOVQ R8,88(DI) - MOVQ 16(DI),SI - MOVQ 96(DI),DX - MOVQ 24(DI),CX - MOVQ 104(DI),R8 - MOVQ SI,R9 - CMOVQEQ DX,SI - CMOVQEQ R9,DX - MOVQ CX,R9 - CMOVQEQ R8,CX - CMOVQEQ R9,R8 - MOVQ SI,16(DI) - MOVQ DX,96(DI) - MOVQ CX,24(DI) - MOVQ R8,104(DI) - MOVQ 32(DI),SI - MOVQ 112(DI),DX - MOVQ 40(DI),CX - MOVQ 120(DI),R8 - MOVQ SI,R9 - CMOVQEQ DX,SI - CMOVQEQ R9,DX - MOVQ CX,R9 - CMOVQEQ R8,CX - CMOVQEQ R9,R8 - MOVQ SI,32(DI) - MOVQ DX,112(DI) - MOVQ CX,40(DI) - MOVQ R8,120(DI) - MOVQ 48(DI),SI - MOVQ 128(DI),DX - MOVQ 56(DI),CX - MOVQ 136(DI),R8 - MOVQ SI,R9 - CMOVQEQ DX,SI - CMOVQEQ R9,DX - MOVQ CX,R9 - CMOVQEQ R8,CX - CMOVQEQ R9,R8 - MOVQ SI,48(DI) - MOVQ DX,128(DI) - MOVQ CX,56(DI) - MOVQ R8,136(DI) - MOVQ 64(DI),SI - MOVQ 144(DI),DX - MOVQ 72(DI),CX - MOVQ 152(DI),R8 - MOVQ SI,R9 - CMOVQEQ DX,SI - CMOVQEQ R9,DX - MOVQ CX,R9 - CMOVQEQ R8,CX - CMOVQEQ R9,R8 - MOVQ SI,64(DI) - MOVQ DX,144(DI) - MOVQ CX,72(DI) - MOVQ R8,152(DI) - MOVQ DI,AX - MOVQ SI,DX - RET diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519.go b/vendor/golang.org/x/crypto/curve25519/curve25519.go deleted file mode 100644 index 6918c47..0000000 --- a/vendor/golang.org/x/crypto/curve25519/curve25519.go +++ /dev/null @@ -1,841 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// We have a implementation in amd64 assembly so this code is only run on -// non-amd64 platforms. The amd64 assembly does not support gccgo. -// +build !amd64 gccgo appengine - -package curve25519 - -// This code is a port of the public domain, "ref10" implementation of -// curve25519 from SUPERCOP 20130419 by D. J. Bernstein. - -// fieldElement represents an element of the field GF(2^255 - 19). An element -// t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 -// t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on -// context. -type fieldElement [10]int32 - -func feZero(fe *fieldElement) { - for i := range fe { - fe[i] = 0 - } -} - -func feOne(fe *fieldElement) { - feZero(fe) - fe[0] = 1 -} - -func feAdd(dst, a, b *fieldElement) { - for i := range dst { - dst[i] = a[i] + b[i] - } -} - -func feSub(dst, a, b *fieldElement) { - for i := range dst { - dst[i] = a[i] - b[i] - } -} - -func feCopy(dst, src *fieldElement) { - for i := range dst { - dst[i] = src[i] - } -} - -// feCSwap replaces (f,g) with (g,f) if b == 1; replaces (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -func feCSwap(f, g *fieldElement, b int32) { - var x fieldElement - b = -b - for i := range x { - x[i] = b & (f[i] ^ g[i]) - } - - for i := range f { - f[i] ^= x[i] - } - for i := range g { - g[i] ^= x[i] - } -} - -// load3 reads a 24-bit, little-endian value from in. -func load3(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - return r -} - -// load4 reads a 32-bit, little-endian value from in. -func load4(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - r |= int64(in[3]) << 24 - return r -} - -func feFromBytes(dst *fieldElement, src *[32]byte) { - h0 := load4(src[:]) - h1 := load3(src[4:]) << 6 - h2 := load3(src[7:]) << 5 - h3 := load3(src[10:]) << 3 - h4 := load3(src[13:]) << 2 - h5 := load4(src[16:]) - h6 := load3(src[20:]) << 7 - h7 := load3(src[23:]) << 5 - h8 := load3(src[26:]) << 4 - h9 := load3(src[29:]) << 2 - - var carry [10]int64 - carry[9] = (h9 + 1<<24) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 - carry[1] = (h1 + 1<<24) >> 25 - h2 += carry[1] - h1 -= carry[1] << 25 - carry[3] = (h3 + 1<<24) >> 25 - h4 += carry[3] - h3 -= carry[3] << 25 - carry[5] = (h5 + 1<<24) >> 25 - h6 += carry[5] - h5 -= carry[5] << 25 - carry[7] = (h7 + 1<<24) >> 25 - h8 += carry[7] - h7 -= carry[7] << 25 - - carry[0] = (h0 + 1<<25) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - carry[2] = (h2 + 1<<25) >> 26 - h3 += carry[2] - h2 -= carry[2] << 26 - carry[4] = (h4 + 1<<25) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - carry[6] = (h6 + 1<<25) >> 26 - h7 += carry[6] - h6 -= carry[6] << 26 - carry[8] = (h8 + 1<<25) >> 26 - h9 += carry[8] - h8 -= carry[8] << 26 - - dst[0] = int32(h0) - dst[1] = int32(h1) - dst[2] = int32(h2) - dst[3] = int32(h3) - dst[4] = int32(h4) - dst[5] = int32(h5) - dst[6] = int32(h6) - dst[7] = int32(h7) - dst[8] = int32(h8) - dst[9] = int32(h9) -} - -// feToBytes marshals h to s. -// Preconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Write p=2^255-19; q=floor(h/p). -// Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). -// -// Proof: -// Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. -// Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4. -// -// Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). -// Then 0> 25 - q = (h[0] + q) >> 26 - q = (h[1] + q) >> 25 - q = (h[2] + q) >> 26 - q = (h[3] + q) >> 25 - q = (h[4] + q) >> 26 - q = (h[5] + q) >> 25 - q = (h[6] + q) >> 26 - q = (h[7] + q) >> 25 - q = (h[8] + q) >> 26 - q = (h[9] + q) >> 25 - - // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. - h[0] += 19 * q - // Goal: Output h-2^255 q, which is between 0 and 2^255-20. - - carry[0] = h[0] >> 26 - h[1] += carry[0] - h[0] -= carry[0] << 26 - carry[1] = h[1] >> 25 - h[2] += carry[1] - h[1] -= carry[1] << 25 - carry[2] = h[2] >> 26 - h[3] += carry[2] - h[2] -= carry[2] << 26 - carry[3] = h[3] >> 25 - h[4] += carry[3] - h[3] -= carry[3] << 25 - carry[4] = h[4] >> 26 - h[5] += carry[4] - h[4] -= carry[4] << 26 - carry[5] = h[5] >> 25 - h[6] += carry[5] - h[5] -= carry[5] << 25 - carry[6] = h[6] >> 26 - h[7] += carry[6] - h[6] -= carry[6] << 26 - carry[7] = h[7] >> 25 - h[8] += carry[7] - h[7] -= carry[7] << 25 - carry[8] = h[8] >> 26 - h[9] += carry[8] - h[8] -= carry[8] << 26 - carry[9] = h[9] >> 25 - h[9] -= carry[9] << 25 - // h10 = carry9 - - // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. - // Have h[0]+...+2^230 h[9] between 0 and 2^255-1; - // evidently 2^255 h10-2^255 q = 0. - // Goal: Output h[0]+...+2^230 h[9]. - - s[0] = byte(h[0] >> 0) - s[1] = byte(h[0] >> 8) - s[2] = byte(h[0] >> 16) - s[3] = byte((h[0] >> 24) | (h[1] << 2)) - s[4] = byte(h[1] >> 6) - s[5] = byte(h[1] >> 14) - s[6] = byte((h[1] >> 22) | (h[2] << 3)) - s[7] = byte(h[2] >> 5) - s[8] = byte(h[2] >> 13) - s[9] = byte((h[2] >> 21) | (h[3] << 5)) - s[10] = byte(h[3] >> 3) - s[11] = byte(h[3] >> 11) - s[12] = byte((h[3] >> 19) | (h[4] << 6)) - s[13] = byte(h[4] >> 2) - s[14] = byte(h[4] >> 10) - s[15] = byte(h[4] >> 18) - s[16] = byte(h[5] >> 0) - s[17] = byte(h[5] >> 8) - s[18] = byte(h[5] >> 16) - s[19] = byte((h[5] >> 24) | (h[6] << 1)) - s[20] = byte(h[6] >> 7) - s[21] = byte(h[6] >> 15) - s[22] = byte((h[6] >> 23) | (h[7] << 3)) - s[23] = byte(h[7] >> 5) - s[24] = byte(h[7] >> 13) - s[25] = byte((h[7] >> 21) | (h[8] << 4)) - s[26] = byte(h[8] >> 4) - s[27] = byte(h[8] >> 12) - s[28] = byte((h[8] >> 20) | (h[9] << 6)) - s[29] = byte(h[9] >> 2) - s[30] = byte(h[9] >> 10) - s[31] = byte(h[9] >> 18) -} - -// feMul calculates h = f * g -// Can overlap h with f or g. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Notes on implementation strategy: -// -// Using schoolbook multiplication. -// Karatsuba would save a little in some cost models. -// -// Most multiplications by 2 and 19 are 32-bit precomputations; -// cheaper than 64-bit postcomputations. -// -// There is one remaining multiplication by 19 in the carry chain; -// one *19 precomputation can be merged into this, -// but the resulting data flow is considerably less clean. -// -// There are 12 carries below. -// 10 of them are 2-way parallelizable and vectorizable. -// Can get away with 11 carries, but then data flow is much deeper. -// -// With tighter constraints on inputs can squeeze carries into int32. -func feMul(h, f, g *fieldElement) { - f0 := f[0] - f1 := f[1] - f2 := f[2] - f3 := f[3] - f4 := f[4] - f5 := f[5] - f6 := f[6] - f7 := f[7] - f8 := f[8] - f9 := f[9] - g0 := g[0] - g1 := g[1] - g2 := g[2] - g3 := g[3] - g4 := g[4] - g5 := g[5] - g6 := g[6] - g7 := g[7] - g8 := g[8] - g9 := g[9] - g1_19 := 19 * g1 // 1.4*2^29 - g2_19 := 19 * g2 // 1.4*2^30; still ok - g3_19 := 19 * g3 - g4_19 := 19 * g4 - g5_19 := 19 * g5 - g6_19 := 19 * g6 - g7_19 := 19 * g7 - g8_19 := 19 * g8 - g9_19 := 19 * g9 - f1_2 := 2 * f1 - f3_2 := 2 * f3 - f5_2 := 2 * f5 - f7_2 := 2 * f7 - f9_2 := 2 * f9 - f0g0 := int64(f0) * int64(g0) - f0g1 := int64(f0) * int64(g1) - f0g2 := int64(f0) * int64(g2) - f0g3 := int64(f0) * int64(g3) - f0g4 := int64(f0) * int64(g4) - f0g5 := int64(f0) * int64(g5) - f0g6 := int64(f0) * int64(g6) - f0g7 := int64(f0) * int64(g7) - f0g8 := int64(f0) * int64(g8) - f0g9 := int64(f0) * int64(g9) - f1g0 := int64(f1) * int64(g0) - f1g1_2 := int64(f1_2) * int64(g1) - f1g2 := int64(f1) * int64(g2) - f1g3_2 := int64(f1_2) * int64(g3) - f1g4 := int64(f1) * int64(g4) - f1g5_2 := int64(f1_2) * int64(g5) - f1g6 := int64(f1) * int64(g6) - f1g7_2 := int64(f1_2) * int64(g7) - f1g8 := int64(f1) * int64(g8) - f1g9_38 := int64(f1_2) * int64(g9_19) - f2g0 := int64(f2) * int64(g0) - f2g1 := int64(f2) * int64(g1) - f2g2 := int64(f2) * int64(g2) - f2g3 := int64(f2) * int64(g3) - f2g4 := int64(f2) * int64(g4) - f2g5 := int64(f2) * int64(g5) - f2g6 := int64(f2) * int64(g6) - f2g7 := int64(f2) * int64(g7) - f2g8_19 := int64(f2) * int64(g8_19) - f2g9_19 := int64(f2) * int64(g9_19) - f3g0 := int64(f3) * int64(g0) - f3g1_2 := int64(f3_2) * int64(g1) - f3g2 := int64(f3) * int64(g2) - f3g3_2 := int64(f3_2) * int64(g3) - f3g4 := int64(f3) * int64(g4) - f3g5_2 := int64(f3_2) * int64(g5) - f3g6 := int64(f3) * int64(g6) - f3g7_38 := int64(f3_2) * int64(g7_19) - f3g8_19 := int64(f3) * int64(g8_19) - f3g9_38 := int64(f3_2) * int64(g9_19) - f4g0 := int64(f4) * int64(g0) - f4g1 := int64(f4) * int64(g1) - f4g2 := int64(f4) * int64(g2) - f4g3 := int64(f4) * int64(g3) - f4g4 := int64(f4) * int64(g4) - f4g5 := int64(f4) * int64(g5) - f4g6_19 := int64(f4) * int64(g6_19) - f4g7_19 := int64(f4) * int64(g7_19) - f4g8_19 := int64(f4) * int64(g8_19) - f4g9_19 := int64(f4) * int64(g9_19) - f5g0 := int64(f5) * int64(g0) - f5g1_2 := int64(f5_2) * int64(g1) - f5g2 := int64(f5) * int64(g2) - f5g3_2 := int64(f5_2) * int64(g3) - f5g4 := int64(f5) * int64(g4) - f5g5_38 := int64(f5_2) * int64(g5_19) - f5g6_19 := int64(f5) * int64(g6_19) - f5g7_38 := int64(f5_2) * int64(g7_19) - f5g8_19 := int64(f5) * int64(g8_19) - f5g9_38 := int64(f5_2) * int64(g9_19) - f6g0 := int64(f6) * int64(g0) - f6g1 := int64(f6) * int64(g1) - f6g2 := int64(f6) * int64(g2) - f6g3 := int64(f6) * int64(g3) - f6g4_19 := int64(f6) * int64(g4_19) - f6g5_19 := int64(f6) * int64(g5_19) - f6g6_19 := int64(f6) * int64(g6_19) - f6g7_19 := int64(f6) * int64(g7_19) - f6g8_19 := int64(f6) * int64(g8_19) - f6g9_19 := int64(f6) * int64(g9_19) - f7g0 := int64(f7) * int64(g0) - f7g1_2 := int64(f7_2) * int64(g1) - f7g2 := int64(f7) * int64(g2) - f7g3_38 := int64(f7_2) * int64(g3_19) - f7g4_19 := int64(f7) * int64(g4_19) - f7g5_38 := int64(f7_2) * int64(g5_19) - f7g6_19 := int64(f7) * int64(g6_19) - f7g7_38 := int64(f7_2) * int64(g7_19) - f7g8_19 := int64(f7) * int64(g8_19) - f7g9_38 := int64(f7_2) * int64(g9_19) - f8g0 := int64(f8) * int64(g0) - f8g1 := int64(f8) * int64(g1) - f8g2_19 := int64(f8) * int64(g2_19) - f8g3_19 := int64(f8) * int64(g3_19) - f8g4_19 := int64(f8) * int64(g4_19) - f8g5_19 := int64(f8) * int64(g5_19) - f8g6_19 := int64(f8) * int64(g6_19) - f8g7_19 := int64(f8) * int64(g7_19) - f8g8_19 := int64(f8) * int64(g8_19) - f8g9_19 := int64(f8) * int64(g9_19) - f9g0 := int64(f9) * int64(g0) - f9g1_38 := int64(f9_2) * int64(g1_19) - f9g2_19 := int64(f9) * int64(g2_19) - f9g3_38 := int64(f9_2) * int64(g3_19) - f9g4_19 := int64(f9) * int64(g4_19) - f9g5_38 := int64(f9_2) * int64(g5_19) - f9g6_19 := int64(f9) * int64(g6_19) - f9g7_38 := int64(f9_2) * int64(g7_19) - f9g8_19 := int64(f9) * int64(g8_19) - f9g9_38 := int64(f9_2) * int64(g9_19) - h0 := f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38 - h1 := f0g1 + f1g0 + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19 - h2 := f0g2 + f1g1_2 + f2g0 + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38 - h3 := f0g3 + f1g2 + f2g1 + f3g0 + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19 - h4 := f0g4 + f1g3_2 + f2g2 + f3g1_2 + f4g0 + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38 - h5 := f0g5 + f1g4 + f2g3 + f3g2 + f4g1 + f5g0 + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19 - h6 := f0g6 + f1g5_2 + f2g4 + f3g3_2 + f4g2 + f5g1_2 + f6g0 + f7g9_38 + f8g8_19 + f9g7_38 - h7 := f0g7 + f1g6 + f2g5 + f3g4 + f4g3 + f5g2 + f6g1 + f7g0 + f8g9_19 + f9g8_19 - h8 := f0g8 + f1g7_2 + f2g6 + f3g5_2 + f4g4 + f5g3_2 + f6g2 + f7g1_2 + f8g0 + f9g9_38 - h9 := f0g9 + f1g8 + f2g7 + f3g6 + f4g5 + f5g4 + f6g3 + f7g2 + f8g1 + f9g0 - var carry [10]int64 - - // |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38)) - // i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8 - // |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19)) - // i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - // |h0| <= 2^25 - // |h4| <= 2^25 - // |h1| <= 1.51*2^58 - // |h5| <= 1.51*2^58 - - carry[1] = (h1 + (1 << 24)) >> 25 - h2 += carry[1] - h1 -= carry[1] << 25 - carry[5] = (h5 + (1 << 24)) >> 25 - h6 += carry[5] - h5 -= carry[5] << 25 - // |h1| <= 2^24; from now on fits into int32 - // |h5| <= 2^24; from now on fits into int32 - // |h2| <= 1.21*2^59 - // |h6| <= 1.21*2^59 - - carry[2] = (h2 + (1 << 25)) >> 26 - h3 += carry[2] - h2 -= carry[2] << 26 - carry[6] = (h6 + (1 << 25)) >> 26 - h7 += carry[6] - h6 -= carry[6] << 26 - // |h2| <= 2^25; from now on fits into int32 unchanged - // |h6| <= 2^25; from now on fits into int32 unchanged - // |h3| <= 1.51*2^58 - // |h7| <= 1.51*2^58 - - carry[3] = (h3 + (1 << 24)) >> 25 - h4 += carry[3] - h3 -= carry[3] << 25 - carry[7] = (h7 + (1 << 24)) >> 25 - h8 += carry[7] - h7 -= carry[7] << 25 - // |h3| <= 2^24; from now on fits into int32 unchanged - // |h7| <= 2^24; from now on fits into int32 unchanged - // |h4| <= 1.52*2^33 - // |h8| <= 1.52*2^33 - - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - carry[8] = (h8 + (1 << 25)) >> 26 - h9 += carry[8] - h8 -= carry[8] << 26 - // |h4| <= 2^25; from now on fits into int32 unchanged - // |h8| <= 2^25; from now on fits into int32 unchanged - // |h5| <= 1.01*2^24 - // |h9| <= 1.51*2^58 - - carry[9] = (h9 + (1 << 24)) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 - // |h9| <= 2^24; from now on fits into int32 unchanged - // |h0| <= 1.8*2^37 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - // |h0| <= 2^25; from now on fits into int32 unchanged - // |h1| <= 1.01*2^24 - - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) -} - -// feSquare calculates h = f*f. Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func feSquare(h, f *fieldElement) { - f0 := f[0] - f1 := f[1] - f2 := f[2] - f3 := f[3] - f4 := f[4] - f5 := f[5] - f6 := f[6] - f7 := f[7] - f8 := f[8] - f9 := f[9] - f0_2 := 2 * f0 - f1_2 := 2 * f1 - f2_2 := 2 * f2 - f3_2 := 2 * f3 - f4_2 := 2 * f4 - f5_2 := 2 * f5 - f6_2 := 2 * f6 - f7_2 := 2 * f7 - f5_38 := 38 * f5 // 1.31*2^30 - f6_19 := 19 * f6 // 1.31*2^30 - f7_38 := 38 * f7 // 1.31*2^30 - f8_19 := 19 * f8 // 1.31*2^30 - f9_38 := 38 * f9 // 1.31*2^30 - f0f0 := int64(f0) * int64(f0) - f0f1_2 := int64(f0_2) * int64(f1) - f0f2_2 := int64(f0_2) * int64(f2) - f0f3_2 := int64(f0_2) * int64(f3) - f0f4_2 := int64(f0_2) * int64(f4) - f0f5_2 := int64(f0_2) * int64(f5) - f0f6_2 := int64(f0_2) * int64(f6) - f0f7_2 := int64(f0_2) * int64(f7) - f0f8_2 := int64(f0_2) * int64(f8) - f0f9_2 := int64(f0_2) * int64(f9) - f1f1_2 := int64(f1_2) * int64(f1) - f1f2_2 := int64(f1_2) * int64(f2) - f1f3_4 := int64(f1_2) * int64(f3_2) - f1f4_2 := int64(f1_2) * int64(f4) - f1f5_4 := int64(f1_2) * int64(f5_2) - f1f6_2 := int64(f1_2) * int64(f6) - f1f7_4 := int64(f1_2) * int64(f7_2) - f1f8_2 := int64(f1_2) * int64(f8) - f1f9_76 := int64(f1_2) * int64(f9_38) - f2f2 := int64(f2) * int64(f2) - f2f3_2 := int64(f2_2) * int64(f3) - f2f4_2 := int64(f2_2) * int64(f4) - f2f5_2 := int64(f2_2) * int64(f5) - f2f6_2 := int64(f2_2) * int64(f6) - f2f7_2 := int64(f2_2) * int64(f7) - f2f8_38 := int64(f2_2) * int64(f8_19) - f2f9_38 := int64(f2) * int64(f9_38) - f3f3_2 := int64(f3_2) * int64(f3) - f3f4_2 := int64(f3_2) * int64(f4) - f3f5_4 := int64(f3_2) * int64(f5_2) - f3f6_2 := int64(f3_2) * int64(f6) - f3f7_76 := int64(f3_2) * int64(f7_38) - f3f8_38 := int64(f3_2) * int64(f8_19) - f3f9_76 := int64(f3_2) * int64(f9_38) - f4f4 := int64(f4) * int64(f4) - f4f5_2 := int64(f4_2) * int64(f5) - f4f6_38 := int64(f4_2) * int64(f6_19) - f4f7_38 := int64(f4) * int64(f7_38) - f4f8_38 := int64(f4_2) * int64(f8_19) - f4f9_38 := int64(f4) * int64(f9_38) - f5f5_38 := int64(f5) * int64(f5_38) - f5f6_38 := int64(f5_2) * int64(f6_19) - f5f7_76 := int64(f5_2) * int64(f7_38) - f5f8_38 := int64(f5_2) * int64(f8_19) - f5f9_76 := int64(f5_2) * int64(f9_38) - f6f6_19 := int64(f6) * int64(f6_19) - f6f7_38 := int64(f6) * int64(f7_38) - f6f8_38 := int64(f6_2) * int64(f8_19) - f6f9_38 := int64(f6) * int64(f9_38) - f7f7_38 := int64(f7) * int64(f7_38) - f7f8_38 := int64(f7_2) * int64(f8_19) - f7f9_76 := int64(f7_2) * int64(f9_38) - f8f8_19 := int64(f8) * int64(f8_19) - f8f9_38 := int64(f8) * int64(f9_38) - f9f9_38 := int64(f9) * int64(f9_38) - h0 := f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38 - h1 := f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38 - h2 := f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19 - h3 := f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38 - h4 := f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38 - h5 := f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38 - h6 := f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19 - h7 := f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38 - h8 := f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38 - h9 := f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2 - var carry [10]int64 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - - carry[1] = (h1 + (1 << 24)) >> 25 - h2 += carry[1] - h1 -= carry[1] << 25 - carry[5] = (h5 + (1 << 24)) >> 25 - h6 += carry[5] - h5 -= carry[5] << 25 - - carry[2] = (h2 + (1 << 25)) >> 26 - h3 += carry[2] - h2 -= carry[2] << 26 - carry[6] = (h6 + (1 << 25)) >> 26 - h7 += carry[6] - h6 -= carry[6] << 26 - - carry[3] = (h3 + (1 << 24)) >> 25 - h4 += carry[3] - h3 -= carry[3] << 25 - carry[7] = (h7 + (1 << 24)) >> 25 - h8 += carry[7] - h7 -= carry[7] << 25 - - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - carry[8] = (h8 + (1 << 25)) >> 26 - h9 += carry[8] - h8 -= carry[8] << 26 - - carry[9] = (h9 + (1 << 24)) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) -} - -// feMul121666 calculates h = f * 121666. Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func feMul121666(h, f *fieldElement) { - h0 := int64(f[0]) * 121666 - h1 := int64(f[1]) * 121666 - h2 := int64(f[2]) * 121666 - h3 := int64(f[3]) * 121666 - h4 := int64(f[4]) * 121666 - h5 := int64(f[5]) * 121666 - h6 := int64(f[6]) * 121666 - h7 := int64(f[7]) * 121666 - h8 := int64(f[8]) * 121666 - h9 := int64(f[9]) * 121666 - var carry [10]int64 - - carry[9] = (h9 + (1 << 24)) >> 25 - h0 += carry[9] * 19 - h9 -= carry[9] << 25 - carry[1] = (h1 + (1 << 24)) >> 25 - h2 += carry[1] - h1 -= carry[1] << 25 - carry[3] = (h3 + (1 << 24)) >> 25 - h4 += carry[3] - h3 -= carry[3] << 25 - carry[5] = (h5 + (1 << 24)) >> 25 - h6 += carry[5] - h5 -= carry[5] << 25 - carry[7] = (h7 + (1 << 24)) >> 25 - h8 += carry[7] - h7 -= carry[7] << 25 - - carry[0] = (h0 + (1 << 25)) >> 26 - h1 += carry[0] - h0 -= carry[0] << 26 - carry[2] = (h2 + (1 << 25)) >> 26 - h3 += carry[2] - h2 -= carry[2] << 26 - carry[4] = (h4 + (1 << 25)) >> 26 - h5 += carry[4] - h4 -= carry[4] << 26 - carry[6] = (h6 + (1 << 25)) >> 26 - h7 += carry[6] - h6 -= carry[6] << 26 - carry[8] = (h8 + (1 << 25)) >> 26 - h9 += carry[8] - h8 -= carry[8] << 26 - - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) -} - -// feInvert sets out = z^-1. -func feInvert(out, z *fieldElement) { - var t0, t1, t2, t3 fieldElement - var i int - - feSquare(&t0, z) - for i = 1; i < 1; i++ { - feSquare(&t0, &t0) - } - feSquare(&t1, &t0) - for i = 1; i < 2; i++ { - feSquare(&t1, &t1) - } - feMul(&t1, z, &t1) - feMul(&t0, &t0, &t1) - feSquare(&t2, &t0) - for i = 1; i < 1; i++ { - feSquare(&t2, &t2) - } - feMul(&t1, &t1, &t2) - feSquare(&t2, &t1) - for i = 1; i < 5; i++ { - feSquare(&t2, &t2) - } - feMul(&t1, &t2, &t1) - feSquare(&t2, &t1) - for i = 1; i < 10; i++ { - feSquare(&t2, &t2) - } - feMul(&t2, &t2, &t1) - feSquare(&t3, &t2) - for i = 1; i < 20; i++ { - feSquare(&t3, &t3) - } - feMul(&t2, &t3, &t2) - feSquare(&t2, &t2) - for i = 1; i < 10; i++ { - feSquare(&t2, &t2) - } - feMul(&t1, &t2, &t1) - feSquare(&t2, &t1) - for i = 1; i < 50; i++ { - feSquare(&t2, &t2) - } - feMul(&t2, &t2, &t1) - feSquare(&t3, &t2) - for i = 1; i < 100; i++ { - feSquare(&t3, &t3) - } - feMul(&t2, &t3, &t2) - feSquare(&t2, &t2) - for i = 1; i < 50; i++ { - feSquare(&t2, &t2) - } - feMul(&t1, &t2, &t1) - feSquare(&t1, &t1) - for i = 1; i < 5; i++ { - feSquare(&t1, &t1) - } - feMul(out, &t1, &t0) -} - -func scalarMult(out, in, base *[32]byte) { - var e [32]byte - - copy(e[:], in[:]) - e[0] &= 248 - e[31] &= 127 - e[31] |= 64 - - var x1, x2, z2, x3, z3, tmp0, tmp1 fieldElement - feFromBytes(&x1, base) - feOne(&x2) - feCopy(&x3, &x1) - feOne(&z3) - - swap := int32(0) - for pos := 254; pos >= 0; pos-- { - b := e[pos/8] >> uint(pos&7) - b &= 1 - swap ^= int32(b) - feCSwap(&x2, &x3, swap) - feCSwap(&z2, &z3, swap) - swap = int32(b) - - feSub(&tmp0, &x3, &z3) - feSub(&tmp1, &x2, &z2) - feAdd(&x2, &x2, &z2) - feAdd(&z2, &x3, &z3) - feMul(&z3, &tmp0, &x2) - feMul(&z2, &z2, &tmp1) - feSquare(&tmp0, &tmp1) - feSquare(&tmp1, &x2) - feAdd(&x3, &z3, &z2) - feSub(&z2, &z3, &z2) - feMul(&x2, &tmp1, &tmp0) - feSub(&tmp1, &tmp1, &tmp0) - feSquare(&z2, &z2) - feMul121666(&z3, &tmp1) - feSquare(&x3, &x3) - feAdd(&tmp0, &tmp0, &z3) - feMul(&z3, &x1, &z2) - feMul(&z2, &tmp1, &tmp0) - } - - feCSwap(&x2, &x3, swap) - feCSwap(&z2, &z3, swap) - - feInvert(&z2, &z2) - feMul(&x2, &x2, &z2) - feToBytes(out, &x2) -} diff --git a/vendor/golang.org/x/crypto/curve25519/doc.go b/vendor/golang.org/x/crypto/curve25519/doc.go deleted file mode 100644 index ebeea3c..0000000 --- a/vendor/golang.org/x/crypto/curve25519/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package curve25519 provides an implementation of scalar multiplication on -// the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html -package curve25519 // import "golang.org/x/crypto/curve25519" - -// basePoint is the x coordinate of the generator of the curve. -var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - -// ScalarMult sets dst to the product in*base where dst and base are the x -// coordinates of group points and all values are in little-endian form. -func ScalarMult(dst, in, base *[32]byte) { - scalarMult(dst, in, base) -} - -// ScalarBaseMult sets dst to the product in*base where dst and base are the x -// coordinates of group points, base is the standard generator and all values -// are in little-endian form. -func ScalarBaseMult(dst, in *[32]byte) { - ScalarMult(dst, in, &basePoint) -} diff --git a/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s b/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s deleted file mode 100644 index 932800b..0000000 --- a/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -// func freeze(inout *[5]uint64) -TEXT ·freeze(SB),7,$0-8 - MOVQ inout+0(FP), DI - - MOVQ 0(DI),SI - MOVQ 8(DI),DX - MOVQ 16(DI),CX - MOVQ 24(DI),R8 - MOVQ 32(DI),R9 - MOVQ ·REDMASK51(SB),AX - MOVQ AX,R10 - SUBQ $18,R10 - MOVQ $3,R11 -REDUCELOOP: - MOVQ SI,R12 - SHRQ $51,R12 - ANDQ AX,SI - ADDQ R12,DX - MOVQ DX,R12 - SHRQ $51,R12 - ANDQ AX,DX - ADDQ R12,CX - MOVQ CX,R12 - SHRQ $51,R12 - ANDQ AX,CX - ADDQ R12,R8 - MOVQ R8,R12 - SHRQ $51,R12 - ANDQ AX,R8 - ADDQ R12,R9 - MOVQ R9,R12 - SHRQ $51,R12 - ANDQ AX,R9 - IMUL3Q $19,R12,R12 - ADDQ R12,SI - SUBQ $1,R11 - JA REDUCELOOP - MOVQ $1,R12 - CMPQ R10,SI - CMOVQLT R11,R12 - CMPQ AX,DX - CMOVQNE R11,R12 - CMPQ AX,CX - CMOVQNE R11,R12 - CMPQ AX,R8 - CMOVQNE R11,R12 - CMPQ AX,R9 - CMOVQNE R11,R12 - NEGQ R12 - ANDQ R12,AX - ANDQ R12,R10 - SUBQ R10,SI - SUBQ AX,DX - SUBQ AX,CX - SUBQ AX,R8 - SUBQ AX,R9 - MOVQ SI,0(DI) - MOVQ DX,8(DI) - MOVQ CX,16(DI) - MOVQ R8,24(DI) - MOVQ R9,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s b/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s deleted file mode 100644 index ee7b36c..0000000 --- a/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s +++ /dev/null @@ -1,1375 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -// func ladderstep(inout *[5][5]uint64) -TEXT ·ladderstep(SB),0,$296-8 - MOVQ inout+0(FP),DI - - MOVQ 40(DI),SI - MOVQ 48(DI),DX - MOVQ 56(DI),CX - MOVQ 64(DI),R8 - MOVQ 72(DI),R9 - MOVQ SI,AX - MOVQ DX,R10 - MOVQ CX,R11 - MOVQ R8,R12 - MOVQ R9,R13 - ADDQ ·_2P0(SB),AX - ADDQ ·_2P1234(SB),R10 - ADDQ ·_2P1234(SB),R11 - ADDQ ·_2P1234(SB),R12 - ADDQ ·_2P1234(SB),R13 - ADDQ 80(DI),SI - ADDQ 88(DI),DX - ADDQ 96(DI),CX - ADDQ 104(DI),R8 - ADDQ 112(DI),R9 - SUBQ 80(DI),AX - SUBQ 88(DI),R10 - SUBQ 96(DI),R11 - SUBQ 104(DI),R12 - SUBQ 112(DI),R13 - MOVQ SI,0(SP) - MOVQ DX,8(SP) - MOVQ CX,16(SP) - MOVQ R8,24(SP) - MOVQ R9,32(SP) - MOVQ AX,40(SP) - MOVQ R10,48(SP) - MOVQ R11,56(SP) - MOVQ R12,64(SP) - MOVQ R13,72(SP) - MOVQ 40(SP),AX - MULQ 40(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 40(SP),AX - SHLQ $1,AX - MULQ 48(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 40(SP),AX - SHLQ $1,AX - MULQ 56(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 40(SP),AX - SHLQ $1,AX - MULQ 64(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 40(SP),AX - SHLQ $1,AX - MULQ 72(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 48(SP),AX - MULQ 48(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 48(SP),AX - SHLQ $1,AX - MULQ 56(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 48(SP),AX - SHLQ $1,AX - MULQ 64(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 48(SP),DX - IMUL3Q $38,DX,AX - MULQ 72(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 56(SP),AX - MULQ 56(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 56(SP),DX - IMUL3Q $38,DX,AX - MULQ 64(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 56(SP),DX - IMUL3Q $38,DX,AX - MULQ 72(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 64(SP),DX - IMUL3Q $19,DX,AX - MULQ 64(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 64(SP),DX - IMUL3Q $38,DX,AX - MULQ 72(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 72(SP),DX - IMUL3Q $19,DX,AX - MULQ 72(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - ANDQ DX,SI - MOVQ CX,R8 - SHRQ $51,CX - ADDQ R10,CX - ANDQ DX,R8 - MOVQ CX,R9 - SHRQ $51,CX - ADDQ R12,CX - ANDQ DX,R9 - MOVQ CX,AX - SHRQ $51,CX - ADDQ R14,CX - ANDQ DX,AX - MOVQ CX,R10 - SHRQ $51,CX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,80(SP) - MOVQ R8,88(SP) - MOVQ R9,96(SP) - MOVQ AX,104(SP) - MOVQ R10,112(SP) - MOVQ 0(SP),AX - MULQ 0(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 0(SP),AX - SHLQ $1,AX - MULQ 8(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 0(SP),AX - SHLQ $1,AX - MULQ 16(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 0(SP),AX - SHLQ $1,AX - MULQ 24(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 0(SP),AX - SHLQ $1,AX - MULQ 32(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 8(SP),AX - MULQ 8(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - SHLQ $1,AX - MULQ 16(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 8(SP),AX - SHLQ $1,AX - MULQ 24(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SP),DX - IMUL3Q $38,DX,AX - MULQ 32(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 16(SP),AX - MULQ 16(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 16(SP),DX - IMUL3Q $38,DX,AX - MULQ 24(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 16(SP),DX - IMUL3Q $38,DX,AX - MULQ 32(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 24(SP),DX - IMUL3Q $19,DX,AX - MULQ 24(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 24(SP),DX - IMUL3Q $38,DX,AX - MULQ 32(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 32(SP),DX - IMUL3Q $19,DX,AX - MULQ 32(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - ANDQ DX,SI - MOVQ CX,R8 - SHRQ $51,CX - ADDQ R10,CX - ANDQ DX,R8 - MOVQ CX,R9 - SHRQ $51,CX - ADDQ R12,CX - ANDQ DX,R9 - MOVQ CX,AX - SHRQ $51,CX - ADDQ R14,CX - ANDQ DX,AX - MOVQ CX,R10 - SHRQ $51,CX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,120(SP) - MOVQ R8,128(SP) - MOVQ R9,136(SP) - MOVQ AX,144(SP) - MOVQ R10,152(SP) - MOVQ SI,SI - MOVQ R8,DX - MOVQ R9,CX - MOVQ AX,R8 - MOVQ R10,R9 - ADDQ ·_2P0(SB),SI - ADDQ ·_2P1234(SB),DX - ADDQ ·_2P1234(SB),CX - ADDQ ·_2P1234(SB),R8 - ADDQ ·_2P1234(SB),R9 - SUBQ 80(SP),SI - SUBQ 88(SP),DX - SUBQ 96(SP),CX - SUBQ 104(SP),R8 - SUBQ 112(SP),R9 - MOVQ SI,160(SP) - MOVQ DX,168(SP) - MOVQ CX,176(SP) - MOVQ R8,184(SP) - MOVQ R9,192(SP) - MOVQ 120(DI),SI - MOVQ 128(DI),DX - MOVQ 136(DI),CX - MOVQ 144(DI),R8 - MOVQ 152(DI),R9 - MOVQ SI,AX - MOVQ DX,R10 - MOVQ CX,R11 - MOVQ R8,R12 - MOVQ R9,R13 - ADDQ ·_2P0(SB),AX - ADDQ ·_2P1234(SB),R10 - ADDQ ·_2P1234(SB),R11 - ADDQ ·_2P1234(SB),R12 - ADDQ ·_2P1234(SB),R13 - ADDQ 160(DI),SI - ADDQ 168(DI),DX - ADDQ 176(DI),CX - ADDQ 184(DI),R8 - ADDQ 192(DI),R9 - SUBQ 160(DI),AX - SUBQ 168(DI),R10 - SUBQ 176(DI),R11 - SUBQ 184(DI),R12 - SUBQ 192(DI),R13 - MOVQ SI,200(SP) - MOVQ DX,208(SP) - MOVQ CX,216(SP) - MOVQ R8,224(SP) - MOVQ R9,232(SP) - MOVQ AX,240(SP) - MOVQ R10,248(SP) - MOVQ R11,256(SP) - MOVQ R12,264(SP) - MOVQ R13,272(SP) - MOVQ 224(SP),SI - IMUL3Q $19,SI,AX - MOVQ AX,280(SP) - MULQ 56(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 232(SP),DX - IMUL3Q $19,DX,AX - MOVQ AX,288(SP) - MULQ 48(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 200(SP),AX - MULQ 40(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 200(SP),AX - MULQ 48(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 200(SP),AX - MULQ 56(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 200(SP),AX - MULQ 64(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 200(SP),AX - MULQ 72(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 208(SP),AX - MULQ 40(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 208(SP),AX - MULQ 48(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 208(SP),AX - MULQ 56(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 208(SP),AX - MULQ 64(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 208(SP),DX - IMUL3Q $19,DX,AX - MULQ 72(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 216(SP),AX - MULQ 40(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 216(SP),AX - MULQ 48(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 216(SP),AX - MULQ 56(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 216(SP),DX - IMUL3Q $19,DX,AX - MULQ 64(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 216(SP),DX - IMUL3Q $19,DX,AX - MULQ 72(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 224(SP),AX - MULQ 40(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 224(SP),AX - MULQ 48(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 280(SP),AX - MULQ 64(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 280(SP),AX - MULQ 72(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 232(SP),AX - MULQ 40(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 288(SP),AX - MULQ 56(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 288(SP),AX - MULQ 64(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 288(SP),AX - MULQ 72(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,40(SP) - MOVQ R8,48(SP) - MOVQ R9,56(SP) - MOVQ AX,64(SP) - MOVQ R10,72(SP) - MOVQ 264(SP),SI - IMUL3Q $19,SI,AX - MOVQ AX,200(SP) - MULQ 16(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 272(SP),DX - IMUL3Q $19,DX,AX - MOVQ AX,208(SP) - MULQ 8(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 240(SP),AX - MULQ 0(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 240(SP),AX - MULQ 8(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 240(SP),AX - MULQ 16(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 240(SP),AX - MULQ 24(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 240(SP),AX - MULQ 32(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 248(SP),AX - MULQ 0(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 248(SP),AX - MULQ 8(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 248(SP),AX - MULQ 16(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 248(SP),AX - MULQ 24(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 248(SP),DX - IMUL3Q $19,DX,AX - MULQ 32(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 256(SP),AX - MULQ 0(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 256(SP),AX - MULQ 8(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 256(SP),AX - MULQ 16(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 256(SP),DX - IMUL3Q $19,DX,AX - MULQ 24(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 256(SP),DX - IMUL3Q $19,DX,AX - MULQ 32(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 264(SP),AX - MULQ 0(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 264(SP),AX - MULQ 8(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 200(SP),AX - MULQ 24(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 200(SP),AX - MULQ 32(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 272(SP),AX - MULQ 0(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 208(SP),AX - MULQ 16(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 208(SP),AX - MULQ 24(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 208(SP),AX - MULQ 32(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,DX - MOVQ R8,CX - MOVQ R9,R11 - MOVQ AX,R12 - MOVQ R10,R13 - ADDQ ·_2P0(SB),DX - ADDQ ·_2P1234(SB),CX - ADDQ ·_2P1234(SB),R11 - ADDQ ·_2P1234(SB),R12 - ADDQ ·_2P1234(SB),R13 - ADDQ 40(SP),SI - ADDQ 48(SP),R8 - ADDQ 56(SP),R9 - ADDQ 64(SP),AX - ADDQ 72(SP),R10 - SUBQ 40(SP),DX - SUBQ 48(SP),CX - SUBQ 56(SP),R11 - SUBQ 64(SP),R12 - SUBQ 72(SP),R13 - MOVQ SI,120(DI) - MOVQ R8,128(DI) - MOVQ R9,136(DI) - MOVQ AX,144(DI) - MOVQ R10,152(DI) - MOVQ DX,160(DI) - MOVQ CX,168(DI) - MOVQ R11,176(DI) - MOVQ R12,184(DI) - MOVQ R13,192(DI) - MOVQ 120(DI),AX - MULQ 120(DI) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 120(DI),AX - SHLQ $1,AX - MULQ 128(DI) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 120(DI),AX - SHLQ $1,AX - MULQ 136(DI) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 120(DI),AX - SHLQ $1,AX - MULQ 144(DI) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 120(DI),AX - SHLQ $1,AX - MULQ 152(DI) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 128(DI),AX - MULQ 128(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 128(DI),AX - SHLQ $1,AX - MULQ 136(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 128(DI),AX - SHLQ $1,AX - MULQ 144(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 128(DI),DX - IMUL3Q $38,DX,AX - MULQ 152(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 136(DI),AX - MULQ 136(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 136(DI),DX - IMUL3Q $38,DX,AX - MULQ 144(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 136(DI),DX - IMUL3Q $38,DX,AX - MULQ 152(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 144(DI),DX - IMUL3Q $19,DX,AX - MULQ 144(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 144(DI),DX - IMUL3Q $38,DX,AX - MULQ 152(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 152(DI),DX - IMUL3Q $19,DX,AX - MULQ 152(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - ANDQ DX,SI - MOVQ CX,R8 - SHRQ $51,CX - ADDQ R10,CX - ANDQ DX,R8 - MOVQ CX,R9 - SHRQ $51,CX - ADDQ R12,CX - ANDQ DX,R9 - MOVQ CX,AX - SHRQ $51,CX - ADDQ R14,CX - ANDQ DX,AX - MOVQ CX,R10 - SHRQ $51,CX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,120(DI) - MOVQ R8,128(DI) - MOVQ R9,136(DI) - MOVQ AX,144(DI) - MOVQ R10,152(DI) - MOVQ 160(DI),AX - MULQ 160(DI) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 160(DI),AX - SHLQ $1,AX - MULQ 168(DI) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 160(DI),AX - SHLQ $1,AX - MULQ 176(DI) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 160(DI),AX - SHLQ $1,AX - MULQ 184(DI) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 160(DI),AX - SHLQ $1,AX - MULQ 192(DI) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 168(DI),AX - MULQ 168(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 168(DI),AX - SHLQ $1,AX - MULQ 176(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 168(DI),AX - SHLQ $1,AX - MULQ 184(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 168(DI),DX - IMUL3Q $38,DX,AX - MULQ 192(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 176(DI),AX - MULQ 176(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 176(DI),DX - IMUL3Q $38,DX,AX - MULQ 184(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 176(DI),DX - IMUL3Q $38,DX,AX - MULQ 192(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 184(DI),DX - IMUL3Q $19,DX,AX - MULQ 184(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 184(DI),DX - IMUL3Q $38,DX,AX - MULQ 192(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 192(DI),DX - IMUL3Q $19,DX,AX - MULQ 192(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - ANDQ DX,SI - MOVQ CX,R8 - SHRQ $51,CX - ADDQ R10,CX - ANDQ DX,R8 - MOVQ CX,R9 - SHRQ $51,CX - ADDQ R12,CX - ANDQ DX,R9 - MOVQ CX,AX - SHRQ $51,CX - ADDQ R14,CX - ANDQ DX,AX - MOVQ CX,R10 - SHRQ $51,CX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,160(DI) - MOVQ R8,168(DI) - MOVQ R9,176(DI) - MOVQ AX,184(DI) - MOVQ R10,192(DI) - MOVQ 184(DI),SI - IMUL3Q $19,SI,AX - MOVQ AX,0(SP) - MULQ 16(DI) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 192(DI),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 8(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 160(DI),AX - MULQ 0(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 160(DI),AX - MULQ 8(DI) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 160(DI),AX - MULQ 16(DI) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 160(DI),AX - MULQ 24(DI) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 160(DI),AX - MULQ 32(DI) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 168(DI),AX - MULQ 0(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 168(DI),AX - MULQ 8(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 168(DI),AX - MULQ 16(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 168(DI),AX - MULQ 24(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 168(DI),DX - IMUL3Q $19,DX,AX - MULQ 32(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 176(DI),AX - MULQ 0(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 176(DI),AX - MULQ 8(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 176(DI),AX - MULQ 16(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 176(DI),DX - IMUL3Q $19,DX,AX - MULQ 24(DI) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 176(DI),DX - IMUL3Q $19,DX,AX - MULQ 32(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 184(DI),AX - MULQ 0(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 184(DI),AX - MULQ 8(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 0(SP),AX - MULQ 24(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SP),AX - MULQ 32(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 192(DI),AX - MULQ 0(DI) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SP),AX - MULQ 16(DI) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 8(SP),AX - MULQ 24(DI) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 32(DI) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,160(DI) - MOVQ R8,168(DI) - MOVQ R9,176(DI) - MOVQ AX,184(DI) - MOVQ R10,192(DI) - MOVQ 144(SP),SI - IMUL3Q $19,SI,AX - MOVQ AX,0(SP) - MULQ 96(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 152(SP),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 88(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 120(SP),AX - MULQ 80(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 120(SP),AX - MULQ 88(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 120(SP),AX - MULQ 96(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 120(SP),AX - MULQ 104(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 120(SP),AX - MULQ 112(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 128(SP),AX - MULQ 80(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 128(SP),AX - MULQ 88(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 128(SP),AX - MULQ 96(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 128(SP),AX - MULQ 104(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 128(SP),DX - IMUL3Q $19,DX,AX - MULQ 112(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 136(SP),AX - MULQ 80(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 136(SP),AX - MULQ 88(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 136(SP),AX - MULQ 96(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 136(SP),DX - IMUL3Q $19,DX,AX - MULQ 104(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 136(SP),DX - IMUL3Q $19,DX,AX - MULQ 112(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 144(SP),AX - MULQ 80(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 144(SP),AX - MULQ 88(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 0(SP),AX - MULQ 104(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SP),AX - MULQ 112(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 152(SP),AX - MULQ 80(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SP),AX - MULQ 96(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 8(SP),AX - MULQ 104(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 112(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,40(DI) - MOVQ R8,48(DI) - MOVQ R9,56(DI) - MOVQ AX,64(DI) - MOVQ R10,72(DI) - MOVQ 160(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - MOVQ AX,SI - MOVQ DX,CX - MOVQ 168(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - ADDQ AX,CX - MOVQ DX,R8 - MOVQ 176(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - ADDQ AX,R8 - MOVQ DX,R9 - MOVQ 184(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - ADDQ AX,R9 - MOVQ DX,R10 - MOVQ 192(SP),AX - MULQ ·_121666_213(SB) - SHRQ $13,AX - ADDQ AX,R10 - IMUL3Q $19,DX,DX - ADDQ DX,SI - ADDQ 80(SP),SI - ADDQ 88(SP),CX - ADDQ 96(SP),R8 - ADDQ 104(SP),R9 - ADDQ 112(SP),R10 - MOVQ SI,80(DI) - MOVQ CX,88(DI) - MOVQ R8,96(DI) - MOVQ R9,104(DI) - MOVQ R10,112(DI) - MOVQ 104(DI),SI - IMUL3Q $19,SI,AX - MOVQ AX,0(SP) - MULQ 176(SP) - MOVQ AX,SI - MOVQ DX,CX - MOVQ 112(DI),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 168(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 80(DI),AX - MULQ 160(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 80(DI),AX - MULQ 168(SP) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 80(DI),AX - MULQ 176(SP) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 80(DI),AX - MULQ 184(SP) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 80(DI),AX - MULQ 192(SP) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 88(DI),AX - MULQ 160(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 88(DI),AX - MULQ 168(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 88(DI),AX - MULQ 176(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 88(DI),AX - MULQ 184(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 88(DI),DX - IMUL3Q $19,DX,AX - MULQ 192(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 96(DI),AX - MULQ 160(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 96(DI),AX - MULQ 168(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 96(DI),AX - MULQ 176(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 96(DI),DX - IMUL3Q $19,DX,AX - MULQ 184(SP) - ADDQ AX,SI - ADCQ DX,CX - MOVQ 96(DI),DX - IMUL3Q $19,DX,AX - MULQ 192(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 104(DI),AX - MULQ 160(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 104(DI),AX - MULQ 168(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 0(SP),AX - MULQ 184(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SP),AX - MULQ 192(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 112(DI),AX - MULQ 160(SP) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SP),AX - MULQ 176(SP) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 8(SP),AX - MULQ 184(SP) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 192(SP) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ ·REDMASK51(SB),DX - SHLQ $13,CX:SI - ANDQ DX,SI - SHLQ $13,R9:R8 - ANDQ DX,R8 - ADDQ CX,R8 - SHLQ $13,R11:R10 - ANDQ DX,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ DX,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ DX,R14 - ADDQ R13,R14 - IMUL3Q $19,R15,CX - ADDQ CX,SI - MOVQ SI,CX - SHRQ $51,CX - ADDQ R8,CX - MOVQ CX,R8 - SHRQ $51,CX - ANDQ DX,SI - ADDQ R10,CX - MOVQ CX,R9 - SHRQ $51,CX - ANDQ DX,R8 - ADDQ R12,CX - MOVQ CX,AX - SHRQ $51,CX - ANDQ DX,R9 - ADDQ R14,CX - MOVQ CX,R10 - SHRQ $51,CX - ANDQ DX,AX - IMUL3Q $19,CX,CX - ADDQ CX,SI - ANDQ DX,R10 - MOVQ SI,80(DI) - MOVQ R8,88(DI) - MOVQ R9,96(DI) - MOVQ AX,104(DI) - MOVQ R10,112(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go b/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go deleted file mode 100644 index 5822bd5..0000000 --- a/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build amd64,!gccgo,!appengine - -package curve25519 - -// These functions are implemented in the .s files. The names of the functions -// in the rest of the file are also taken from the SUPERCOP sources to help -// people following along. - -//go:noescape - -func cswap(inout *[5]uint64, v uint64) - -//go:noescape - -func ladderstep(inout *[5][5]uint64) - -//go:noescape - -func freeze(inout *[5]uint64) - -//go:noescape - -func mul(dest, a, b *[5]uint64) - -//go:noescape - -func square(out, in *[5]uint64) - -// mladder uses a Montgomery ladder to calculate (xr/zr) *= s. -func mladder(xr, zr *[5]uint64, s *[32]byte) { - var work [5][5]uint64 - - work[0] = *xr - setint(&work[1], 1) - setint(&work[2], 0) - work[3] = *xr - setint(&work[4], 1) - - j := uint(6) - var prevbit byte - - for i := 31; i >= 0; i-- { - for j < 8 { - bit := ((*s)[i] >> j) & 1 - swap := bit ^ prevbit - prevbit = bit - cswap(&work[1], uint64(swap)) - ladderstep(&work) - j-- - } - j = 7 - } - - *xr = work[1] - *zr = work[2] -} - -func scalarMult(out, in, base *[32]byte) { - var e [32]byte - copy(e[:], (*in)[:]) - e[0] &= 248 - e[31] &= 127 - e[31] |= 64 - - var t, z [5]uint64 - unpack(&t, base) - mladder(&t, &z, &e) - invert(&z, &z) - mul(&t, &t, &z) - pack(out, &t) -} - -func setint(r *[5]uint64, v uint64) { - r[0] = v - r[1] = 0 - r[2] = 0 - r[3] = 0 - r[4] = 0 -} - -// unpack sets r = x where r consists of 5, 51-bit limbs in little-endian -// order. -func unpack(r *[5]uint64, x *[32]byte) { - r[0] = uint64(x[0]) | - uint64(x[1])<<8 | - uint64(x[2])<<16 | - uint64(x[3])<<24 | - uint64(x[4])<<32 | - uint64(x[5])<<40 | - uint64(x[6]&7)<<48 - - r[1] = uint64(x[6])>>3 | - uint64(x[7])<<5 | - uint64(x[8])<<13 | - uint64(x[9])<<21 | - uint64(x[10])<<29 | - uint64(x[11])<<37 | - uint64(x[12]&63)<<45 - - r[2] = uint64(x[12])>>6 | - uint64(x[13])<<2 | - uint64(x[14])<<10 | - uint64(x[15])<<18 | - uint64(x[16])<<26 | - uint64(x[17])<<34 | - uint64(x[18])<<42 | - uint64(x[19]&1)<<50 - - r[3] = uint64(x[19])>>1 | - uint64(x[20])<<7 | - uint64(x[21])<<15 | - uint64(x[22])<<23 | - uint64(x[23])<<31 | - uint64(x[24])<<39 | - uint64(x[25]&15)<<47 - - r[4] = uint64(x[25])>>4 | - uint64(x[26])<<4 | - uint64(x[27])<<12 | - uint64(x[28])<<20 | - uint64(x[29])<<28 | - uint64(x[30])<<36 | - uint64(x[31]&127)<<44 -} - -// pack sets out = x where out is the usual, little-endian form of the 5, -// 51-bit limbs in x. -func pack(out *[32]byte, x *[5]uint64) { - t := *x - freeze(&t) - - out[0] = byte(t[0]) - out[1] = byte(t[0] >> 8) - out[2] = byte(t[0] >> 16) - out[3] = byte(t[0] >> 24) - out[4] = byte(t[0] >> 32) - out[5] = byte(t[0] >> 40) - out[6] = byte(t[0] >> 48) - - out[6] ^= byte(t[1]<<3) & 0xf8 - out[7] = byte(t[1] >> 5) - out[8] = byte(t[1] >> 13) - out[9] = byte(t[1] >> 21) - out[10] = byte(t[1] >> 29) - out[11] = byte(t[1] >> 37) - out[12] = byte(t[1] >> 45) - - out[12] ^= byte(t[2]<<6) & 0xc0 - out[13] = byte(t[2] >> 2) - out[14] = byte(t[2] >> 10) - out[15] = byte(t[2] >> 18) - out[16] = byte(t[2] >> 26) - out[17] = byte(t[2] >> 34) - out[18] = byte(t[2] >> 42) - out[19] = byte(t[2] >> 50) - - out[19] ^= byte(t[3]<<1) & 0xfe - out[20] = byte(t[3] >> 7) - out[21] = byte(t[3] >> 15) - out[22] = byte(t[3] >> 23) - out[23] = byte(t[3] >> 31) - out[24] = byte(t[3] >> 39) - out[25] = byte(t[3] >> 47) - - out[25] ^= byte(t[4]<<4) & 0xf0 - out[26] = byte(t[4] >> 4) - out[27] = byte(t[4] >> 12) - out[28] = byte(t[4] >> 20) - out[29] = byte(t[4] >> 28) - out[30] = byte(t[4] >> 36) - out[31] = byte(t[4] >> 44) -} - -// invert calculates r = x^-1 mod p using Fermat's little theorem. -func invert(r *[5]uint64, x *[5]uint64) { - var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t [5]uint64 - - square(&z2, x) /* 2 */ - square(&t, &z2) /* 4 */ - square(&t, &t) /* 8 */ - mul(&z9, &t, x) /* 9 */ - mul(&z11, &z9, &z2) /* 11 */ - square(&t, &z11) /* 22 */ - mul(&z2_5_0, &t, &z9) /* 2^5 - 2^0 = 31 */ - - square(&t, &z2_5_0) /* 2^6 - 2^1 */ - for i := 1; i < 5; i++ { /* 2^20 - 2^10 */ - square(&t, &t) - } - mul(&z2_10_0, &t, &z2_5_0) /* 2^10 - 2^0 */ - - square(&t, &z2_10_0) /* 2^11 - 2^1 */ - for i := 1; i < 10; i++ { /* 2^20 - 2^10 */ - square(&t, &t) - } - mul(&z2_20_0, &t, &z2_10_0) /* 2^20 - 2^0 */ - - square(&t, &z2_20_0) /* 2^21 - 2^1 */ - for i := 1; i < 20; i++ { /* 2^40 - 2^20 */ - square(&t, &t) - } - mul(&t, &t, &z2_20_0) /* 2^40 - 2^0 */ - - square(&t, &t) /* 2^41 - 2^1 */ - for i := 1; i < 10; i++ { /* 2^50 - 2^10 */ - square(&t, &t) - } - mul(&z2_50_0, &t, &z2_10_0) /* 2^50 - 2^0 */ - - square(&t, &z2_50_0) /* 2^51 - 2^1 */ - for i := 1; i < 50; i++ { /* 2^100 - 2^50 */ - square(&t, &t) - } - mul(&z2_100_0, &t, &z2_50_0) /* 2^100 - 2^0 */ - - square(&t, &z2_100_0) /* 2^101 - 2^1 */ - for i := 1; i < 100; i++ { /* 2^200 - 2^100 */ - square(&t, &t) - } - mul(&t, &t, &z2_100_0) /* 2^200 - 2^0 */ - - square(&t, &t) /* 2^201 - 2^1 */ - for i := 1; i < 50; i++ { /* 2^250 - 2^50 */ - square(&t, &t) - } - mul(&t, &t, &z2_50_0) /* 2^250 - 2^0 */ - - square(&t, &t) /* 2^251 - 2^1 */ - square(&t, &t) /* 2^252 - 2^2 */ - square(&t, &t) /* 2^253 - 2^3 */ - - square(&t, &t) /* 2^254 - 2^4 */ - - square(&t, &t) /* 2^255 - 2^5 */ - mul(r, &t, &z11) /* 2^255 - 21 */ -} diff --git a/vendor/golang.org/x/crypto/curve25519/mul_amd64.s b/vendor/golang.org/x/crypto/curve25519/mul_amd64.s deleted file mode 100644 index 33ce57d..0000000 --- a/vendor/golang.org/x/crypto/curve25519/mul_amd64.s +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -// func mul(dest, a, b *[5]uint64) -TEXT ·mul(SB),0,$16-24 - MOVQ dest+0(FP), DI - MOVQ a+8(FP), SI - MOVQ b+16(FP), DX - - MOVQ DX,CX - MOVQ 24(SI),DX - IMUL3Q $19,DX,AX - MOVQ AX,0(SP) - MULQ 16(CX) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 32(SI),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 8(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SI),AX - MULQ 0(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SI),AX - MULQ 8(CX) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 0(SI),AX - MULQ 16(CX) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 0(SI),AX - MULQ 24(CX) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 0(SI),AX - MULQ 32(CX) - MOVQ AX,BX - MOVQ DX,BP - MOVQ 8(SI),AX - MULQ 0(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SI),AX - MULQ 8(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 8(SI),AX - MULQ 16(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SI),AX - MULQ 24(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 8(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 16(SI),AX - MULQ 0(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 16(SI),AX - MULQ 8(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 16(SI),AX - MULQ 16(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 16(SI),DX - IMUL3Q $19,DX,AX - MULQ 24(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 16(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 24(SI),AX - MULQ 0(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 24(SI),AX - MULQ 8(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 0(SP),AX - MULQ 24(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 0(SP),AX - MULQ 32(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 32(SI),AX - MULQ 0(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 8(SP),AX - MULQ 16(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 24(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 8(SP),AX - MULQ 32(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ ·REDMASK51(SB),SI - SHLQ $13,R9:R8 - ANDQ SI,R8 - SHLQ $13,R11:R10 - ANDQ SI,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ SI,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ SI,R14 - ADDQ R13,R14 - SHLQ $13,BP:BX - ANDQ SI,BX - ADDQ R15,BX - IMUL3Q $19,BP,DX - ADDQ DX,R8 - MOVQ R8,DX - SHRQ $51,DX - ADDQ R10,DX - MOVQ DX,CX - SHRQ $51,DX - ANDQ SI,R8 - ADDQ R12,DX - MOVQ DX,R9 - SHRQ $51,DX - ANDQ SI,CX - ADDQ R14,DX - MOVQ DX,AX - SHRQ $51,DX - ANDQ SI,R9 - ADDQ BX,DX - MOVQ DX,R10 - SHRQ $51,DX - ANDQ SI,AX - IMUL3Q $19,DX,DX - ADDQ DX,R8 - ANDQ SI,R10 - MOVQ R8,0(DI) - MOVQ CX,8(DI) - MOVQ R9,16(DI) - MOVQ AX,24(DI) - MOVQ R10,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/square_amd64.s b/vendor/golang.org/x/crypto/curve25519/square_amd64.s deleted file mode 100644 index 3a92804..0000000 --- a/vendor/golang.org/x/crypto/curve25519/square_amd64.s +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -// func square(out, in *[5]uint64) -TEXT ·square(SB),7,$0-16 - MOVQ out+0(FP), DI - MOVQ in+8(FP), SI - - MOVQ 0(SI),AX - MULQ 0(SI) - MOVQ AX,CX - MOVQ DX,R8 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 8(SI) - MOVQ AX,R9 - MOVQ DX,R10 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 16(SI) - MOVQ AX,R11 - MOVQ DX,R12 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 24(SI) - MOVQ AX,R13 - MOVQ DX,R14 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 32(SI) - MOVQ AX,R15 - MOVQ DX,BX - MOVQ 8(SI),AX - MULQ 8(SI) - ADDQ AX,R11 - ADCQ DX,R12 - MOVQ 8(SI),AX - SHLQ $1,AX - MULQ 16(SI) - ADDQ AX,R13 - ADCQ DX,R14 - MOVQ 8(SI),AX - SHLQ $1,AX - MULQ 24(SI) - ADDQ AX,R15 - ADCQ DX,BX - MOVQ 8(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,CX - ADCQ DX,R8 - MOVQ 16(SI),AX - MULQ 16(SI) - ADDQ AX,R15 - ADCQ DX,BX - MOVQ 16(SI),DX - IMUL3Q $38,DX,AX - MULQ 24(SI) - ADDQ AX,CX - ADCQ DX,R8 - MOVQ 16(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,R9 - ADCQ DX,R10 - MOVQ 24(SI),DX - IMUL3Q $19,DX,AX - MULQ 24(SI) - ADDQ AX,R9 - ADCQ DX,R10 - MOVQ 24(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,R11 - ADCQ DX,R12 - MOVQ 32(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(SI) - ADDQ AX,R13 - ADCQ DX,R14 - MOVQ ·REDMASK51(SB),SI - SHLQ $13,R8:CX - ANDQ SI,CX - SHLQ $13,R10:R9 - ANDQ SI,R9 - ADDQ R8,R9 - SHLQ $13,R12:R11 - ANDQ SI,R11 - ADDQ R10,R11 - SHLQ $13,R14:R13 - ANDQ SI,R13 - ADDQ R12,R13 - SHLQ $13,BX:R15 - ANDQ SI,R15 - ADDQ R14,R15 - IMUL3Q $19,BX,DX - ADDQ DX,CX - MOVQ CX,DX - SHRQ $51,DX - ADDQ R9,DX - ANDQ SI,CX - MOVQ DX,R8 - SHRQ $51,DX - ADDQ R11,DX - ANDQ SI,R8 - MOVQ DX,R9 - SHRQ $51,DX - ADDQ R13,DX - ANDQ SI,R9 - MOVQ DX,AX - SHRQ $51,DX - ADDQ R15,DX - ANDQ SI,AX - MOVQ DX,R10 - SHRQ $51,DX - IMUL3Q $19,DX,DX - ADDQ DX,CX - ANDQ SI,R10 - MOVQ CX,0(DI) - MOVQ R8,8(DI) - MOVQ R9,16(DI) - MOVQ AX,24(DI) - MOVQ R10,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/ed25519/ed25519.go b/vendor/golang.org/x/crypto/ed25519/ed25519.go deleted file mode 100644 index f1d9567..0000000 --- a/vendor/golang.org/x/crypto/ed25519/ed25519.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ed25519 implements the Ed25519 signature algorithm. See -// http://ed25519.cr.yp.to/. -// -// These functions are also compatible with the “Ed25519” function defined in -// https://tools.ietf.org/html/draft-irtf-cfrg-eddsa-05. -package ed25519 - -// This code is a port of the public domain, “ref10” implementation of ed25519 -// from SUPERCOP. - -import ( - "crypto" - cryptorand "crypto/rand" - "crypto/sha512" - "crypto/subtle" - "errors" - "io" - "strconv" - - "golang.org/x/crypto/ed25519/internal/edwards25519" -) - -const ( - // PublicKeySize is the size, in bytes, of public keys as used in this package. - PublicKeySize = 32 - // PrivateKeySize is the size, in bytes, of private keys as used in this package. - PrivateKeySize = 64 - // SignatureSize is the size, in bytes, of signatures generated and verified by this package. - SignatureSize = 64 -) - -// PublicKey is the type of Ed25519 public keys. -type PublicKey []byte - -// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer. -type PrivateKey []byte - -// Public returns the PublicKey corresponding to priv. -func (priv PrivateKey) Public() crypto.PublicKey { - publicKey := make([]byte, PublicKeySize) - copy(publicKey, priv[32:]) - return PublicKey(publicKey) -} - -// Sign signs the given message with priv. -// Ed25519 performs two passes over messages to be signed and therefore cannot -// handle pre-hashed messages. Thus opts.HashFunc() must return zero to -// indicate the message hasn't been hashed. This can be achieved by passing -// crypto.Hash(0) as the value for opts. -func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) { - if opts.HashFunc() != crypto.Hash(0) { - return nil, errors.New("ed25519: cannot sign hashed message") - } - - return Sign(priv, message), nil -} - -// GenerateKey generates a public/private key pair using entropy from rand. -// If rand is nil, crypto/rand.Reader will be used. -func GenerateKey(rand io.Reader) (publicKey PublicKey, privateKey PrivateKey, err error) { - if rand == nil { - rand = cryptorand.Reader - } - - privateKey = make([]byte, PrivateKeySize) - publicKey = make([]byte, PublicKeySize) - _, err = io.ReadFull(rand, privateKey[:32]) - if err != nil { - return nil, nil, err - } - - digest := sha512.Sum512(privateKey[:32]) - digest[0] &= 248 - digest[31] &= 127 - digest[31] |= 64 - - var A edwards25519.ExtendedGroupElement - var hBytes [32]byte - copy(hBytes[:], digest[:]) - edwards25519.GeScalarMultBase(&A, &hBytes) - var publicKeyBytes [32]byte - A.ToBytes(&publicKeyBytes) - - copy(privateKey[32:], publicKeyBytes[:]) - copy(publicKey, publicKeyBytes[:]) - - return publicKey, privateKey, nil -} - -// Sign signs the message with privateKey and returns a signature. It will -// panic if len(privateKey) is not PrivateKeySize. -func Sign(privateKey PrivateKey, message []byte) []byte { - if l := len(privateKey); l != PrivateKeySize { - panic("ed25519: bad private key length: " + strconv.Itoa(l)) - } - - h := sha512.New() - h.Write(privateKey[:32]) - - var digest1, messageDigest, hramDigest [64]byte - var expandedSecretKey [32]byte - h.Sum(digest1[:0]) - copy(expandedSecretKey[:], digest1[:]) - expandedSecretKey[0] &= 248 - expandedSecretKey[31] &= 63 - expandedSecretKey[31] |= 64 - - h.Reset() - h.Write(digest1[32:]) - h.Write(message) - h.Sum(messageDigest[:0]) - - var messageDigestReduced [32]byte - edwards25519.ScReduce(&messageDigestReduced, &messageDigest) - var R edwards25519.ExtendedGroupElement - edwards25519.GeScalarMultBase(&R, &messageDigestReduced) - - var encodedR [32]byte - R.ToBytes(&encodedR) - - h.Reset() - h.Write(encodedR[:]) - h.Write(privateKey[32:]) - h.Write(message) - h.Sum(hramDigest[:0]) - var hramDigestReduced [32]byte - edwards25519.ScReduce(&hramDigestReduced, &hramDigest) - - var s [32]byte - edwards25519.ScMulAdd(&s, &hramDigestReduced, &expandedSecretKey, &messageDigestReduced) - - signature := make([]byte, SignatureSize) - copy(signature[:], encodedR[:]) - copy(signature[32:], s[:]) - - return signature -} - -// Verify reports whether sig is a valid signature of message by publicKey. It -// will panic if len(publicKey) is not PublicKeySize. -func Verify(publicKey PublicKey, message, sig []byte) bool { - if l := len(publicKey); l != PublicKeySize { - panic("ed25519: bad public key length: " + strconv.Itoa(l)) - } - - if len(sig) != SignatureSize || sig[63]&224 != 0 { - return false - } - - var A edwards25519.ExtendedGroupElement - var publicKeyBytes [32]byte - copy(publicKeyBytes[:], publicKey) - if !A.FromBytes(&publicKeyBytes) { - return false - } - edwards25519.FeNeg(&A.X, &A.X) - edwards25519.FeNeg(&A.T, &A.T) - - h := sha512.New() - h.Write(sig[:32]) - h.Write(publicKey[:]) - h.Write(message) - var digest [64]byte - h.Sum(digest[:0]) - - var hReduced [32]byte - edwards25519.ScReduce(&hReduced, &digest) - - var R edwards25519.ProjectiveGroupElement - var b [32]byte - copy(b[:], sig[32:]) - edwards25519.GeDoubleScalarMultVartime(&R, &hReduced, &A, &b) - - var checkR [32]byte - R.ToBytes(&checkR) - return subtle.ConstantTimeCompare(sig[:32], checkR[:]) == 1 -} diff --git a/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go b/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go deleted file mode 100644 index e39f086..0000000 --- a/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go +++ /dev/null @@ -1,1422 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package edwards25519 - -// These values are from the public domain, “ref10” implementation of ed25519 -// from SUPERCOP. - -// d is a constant in the Edwards curve equation. -var d = FieldElement{ - -10913610, 13857413, -15372611, 6949391, 114729, -8787816, -6275908, -3247719, -18696448, -12055116, -} - -// d2 is 2*d. -var d2 = FieldElement{ - -21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199, -} - -// SqrtM1 is the square-root of -1 in the field. -var SqrtM1 = FieldElement{ - -32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482, -} - -// A is a constant in the Montgomery-form of curve25519. -var A = FieldElement{ - 486662, 0, 0, 0, 0, 0, 0, 0, 0, 0, -} - -// bi contains precomputed multiples of the base-point. See the Ed25519 paper -// for a discussion about how these values are used. -var bi = [8]PreComputedGroupElement{ - { - FieldElement{25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605}, - FieldElement{-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378}, - FieldElement{-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546}, - }, - { - FieldElement{15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024}, - FieldElement{16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574}, - FieldElement{30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357}, - }, - { - FieldElement{10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380}, - FieldElement{4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306}, - FieldElement{19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942}, - }, - { - FieldElement{5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766}, - FieldElement{-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701}, - FieldElement{28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300}, - }, - { - FieldElement{-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877}, - FieldElement{-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951}, - FieldElement{4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784}, - }, - { - FieldElement{-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436}, - FieldElement{25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918}, - FieldElement{23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877}, - }, - { - FieldElement{-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800}, - FieldElement{-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305}, - FieldElement{-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300}, - }, - { - FieldElement{-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876}, - FieldElement{-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619}, - FieldElement{-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683}, - }, -} - -// base contains precomputed multiples of the base-point. See the Ed25519 paper -// for a discussion about how these values are used. -var base = [32][8]PreComputedGroupElement{ - { - { - FieldElement{25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605}, - FieldElement{-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378}, - FieldElement{-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546}, - }, - { - FieldElement{-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303}, - FieldElement{-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081}, - FieldElement{26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697}, - }, - { - FieldElement{15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024}, - FieldElement{16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574}, - FieldElement{30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357}, - }, - { - FieldElement{-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540}, - FieldElement{23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397}, - FieldElement{7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325}, - }, - { - FieldElement{10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380}, - FieldElement{4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306}, - FieldElement{19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942}, - }, - { - FieldElement{-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777}, - FieldElement{-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737}, - FieldElement{-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652}, - }, - { - FieldElement{5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766}, - FieldElement{-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701}, - FieldElement{28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300}, - }, - { - FieldElement{14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726}, - FieldElement{-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955}, - FieldElement{27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425}, - }, - }, - { - { - FieldElement{-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171}, - FieldElement{27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510}, - FieldElement{17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660}, - }, - { - FieldElement{-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639}, - FieldElement{29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963}, - FieldElement{5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950}, - }, - { - FieldElement{-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568}, - FieldElement{12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335}, - FieldElement{25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628}, - }, - { - FieldElement{-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007}, - FieldElement{-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772}, - FieldElement{-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653}, - }, - { - FieldElement{2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567}, - FieldElement{13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686}, - FieldElement{21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372}, - }, - { - FieldElement{-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887}, - FieldElement{-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954}, - FieldElement{-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953}, - }, - { - FieldElement{24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833}, - FieldElement{-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532}, - FieldElement{-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876}, - }, - { - FieldElement{2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268}, - FieldElement{33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214}, - FieldElement{1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038}, - }, - }, - { - { - FieldElement{6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800}, - FieldElement{4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645}, - FieldElement{-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664}, - }, - { - FieldElement{1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933}, - FieldElement{-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182}, - FieldElement{-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222}, - }, - { - FieldElement{-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991}, - FieldElement{20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880}, - FieldElement{9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092}, - }, - { - FieldElement{-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295}, - FieldElement{19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788}, - FieldElement{8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553}, - }, - { - FieldElement{-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026}, - FieldElement{11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347}, - FieldElement{-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033}, - }, - { - FieldElement{-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395}, - FieldElement{-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278}, - FieldElement{1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890}, - }, - { - FieldElement{32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995}, - FieldElement{-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596}, - FieldElement{-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891}, - }, - { - FieldElement{31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060}, - FieldElement{11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608}, - FieldElement{-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606}, - }, - }, - { - { - FieldElement{7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389}, - FieldElement{-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016}, - FieldElement{-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341}, - }, - { - FieldElement{-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505}, - FieldElement{14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553}, - FieldElement{-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655}, - }, - { - FieldElement{15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220}, - FieldElement{12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631}, - FieldElement{-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099}, - }, - { - FieldElement{26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556}, - FieldElement{14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749}, - FieldElement{236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930}, - }, - { - FieldElement{1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391}, - FieldElement{5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253}, - FieldElement{20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066}, - }, - { - FieldElement{24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958}, - FieldElement{-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082}, - FieldElement{-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383}, - }, - { - FieldElement{-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521}, - FieldElement{-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807}, - FieldElement{23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948}, - }, - { - FieldElement{9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134}, - FieldElement{-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455}, - FieldElement{27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629}, - }, - }, - { - { - FieldElement{-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069}, - FieldElement{-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746}, - FieldElement{24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919}, - }, - { - FieldElement{11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837}, - FieldElement{8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906}, - FieldElement{-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771}, - }, - { - FieldElement{-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817}, - FieldElement{10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098}, - FieldElement{10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409}, - }, - { - FieldElement{-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504}, - FieldElement{-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727}, - FieldElement{28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420}, - }, - { - FieldElement{-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003}, - FieldElement{-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605}, - FieldElement{-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384}, - }, - { - FieldElement{-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701}, - FieldElement{-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683}, - FieldElement{29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708}, - }, - { - FieldElement{-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563}, - FieldElement{-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260}, - FieldElement{-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387}, - }, - { - FieldElement{-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672}, - FieldElement{23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686}, - FieldElement{-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665}, - }, - }, - { - { - FieldElement{11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182}, - FieldElement{-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277}, - FieldElement{14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628}, - }, - { - FieldElement{-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474}, - FieldElement{-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539}, - FieldElement{-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822}, - }, - { - FieldElement{-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970}, - FieldElement{19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756}, - FieldElement{-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508}, - }, - { - FieldElement{-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683}, - FieldElement{-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655}, - FieldElement{-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158}, - }, - { - FieldElement{-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125}, - FieldElement{-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839}, - FieldElement{-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664}, - }, - { - FieldElement{27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294}, - FieldElement{-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899}, - FieldElement{-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070}, - }, - { - FieldElement{3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294}, - FieldElement{-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949}, - FieldElement{-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083}, - }, - { - FieldElement{31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420}, - FieldElement{-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940}, - FieldElement{29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396}, - }, - }, - { - { - FieldElement{-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567}, - FieldElement{20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127}, - FieldElement{-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294}, - }, - { - FieldElement{-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887}, - FieldElement{22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964}, - FieldElement{16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195}, - }, - { - FieldElement{9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244}, - FieldElement{24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999}, - FieldElement{-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762}, - }, - { - FieldElement{-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274}, - FieldElement{-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236}, - FieldElement{-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605}, - }, - { - FieldElement{-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761}, - FieldElement{-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884}, - FieldElement{-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482}, - }, - { - FieldElement{-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638}, - FieldElement{-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490}, - FieldElement{-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170}, - }, - { - FieldElement{5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736}, - FieldElement{10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124}, - FieldElement{-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392}, - }, - { - FieldElement{8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029}, - FieldElement{6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048}, - FieldElement{28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958}, - }, - }, - { - { - FieldElement{24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593}, - FieldElement{26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071}, - FieldElement{-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692}, - }, - { - FieldElement{11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687}, - FieldElement{-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441}, - FieldElement{-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001}, - }, - { - FieldElement{-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460}, - FieldElement{-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007}, - FieldElement{-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762}, - }, - { - FieldElement{15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005}, - FieldElement{-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674}, - FieldElement{4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035}, - }, - { - FieldElement{7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590}, - FieldElement{-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957}, - FieldElement{-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812}, - }, - { - FieldElement{33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740}, - FieldElement{-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122}, - FieldElement{-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158}, - }, - { - FieldElement{8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885}, - FieldElement{26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140}, - FieldElement{19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857}, - }, - { - FieldElement{801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155}, - FieldElement{19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260}, - FieldElement{19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483}, - }, - }, - { - { - FieldElement{-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677}, - FieldElement{32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815}, - FieldElement{22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751}, - }, - { - FieldElement{-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203}, - FieldElement{-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208}, - FieldElement{1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230}, - }, - { - FieldElement{16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850}, - FieldElement{-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389}, - FieldElement{-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968}, - }, - { - FieldElement{-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689}, - FieldElement{14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880}, - FieldElement{5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304}, - }, - { - FieldElement{30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632}, - FieldElement{-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412}, - FieldElement{20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566}, - }, - { - FieldElement{-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038}, - FieldElement{-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232}, - FieldElement{-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943}, - }, - { - FieldElement{17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856}, - FieldElement{23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738}, - FieldElement{15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971}, - }, - { - FieldElement{-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718}, - FieldElement{-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697}, - FieldElement{-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883}, - }, - }, - { - { - FieldElement{5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912}, - FieldElement{-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358}, - FieldElement{3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849}, - }, - { - FieldElement{29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307}, - FieldElement{-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977}, - FieldElement{-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335}, - }, - { - FieldElement{-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644}, - FieldElement{-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616}, - FieldElement{-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735}, - }, - { - FieldElement{-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099}, - FieldElement{29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341}, - FieldElement{-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336}, - }, - { - FieldElement{-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646}, - FieldElement{31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425}, - FieldElement{-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388}, - }, - { - FieldElement{-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743}, - FieldElement{-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822}, - FieldElement{-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462}, - }, - { - FieldElement{18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985}, - FieldElement{9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702}, - FieldElement{-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797}, - }, - { - FieldElement{21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293}, - FieldElement{27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100}, - FieldElement{19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688}, - }, - }, - { - { - FieldElement{12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186}, - FieldElement{2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610}, - FieldElement{-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707}, - }, - { - FieldElement{7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220}, - FieldElement{915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025}, - FieldElement{32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044}, - }, - { - FieldElement{32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992}, - FieldElement{-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027}, - FieldElement{21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197}, - }, - { - FieldElement{8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901}, - FieldElement{31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952}, - FieldElement{19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878}, - }, - { - FieldElement{-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390}, - FieldElement{32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730}, - FieldElement{2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730}, - }, - { - FieldElement{-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180}, - FieldElement{-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272}, - FieldElement{-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715}, - }, - { - FieldElement{-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970}, - FieldElement{-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772}, - FieldElement{-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865}, - }, - { - FieldElement{15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750}, - FieldElement{20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373}, - FieldElement{32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348}, - }, - }, - { - { - FieldElement{9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144}, - FieldElement{-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195}, - FieldElement{5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086}, - }, - { - FieldElement{-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684}, - FieldElement{-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518}, - FieldElement{-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233}, - }, - { - FieldElement{-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793}, - FieldElement{-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794}, - FieldElement{580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435}, - }, - { - FieldElement{23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921}, - FieldElement{13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518}, - FieldElement{2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563}, - }, - { - FieldElement{14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278}, - FieldElement{-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024}, - FieldElement{4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030}, - }, - { - FieldElement{10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783}, - FieldElement{27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717}, - FieldElement{6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844}, - }, - { - FieldElement{14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333}, - FieldElement{16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048}, - FieldElement{22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760}, - }, - { - FieldElement{-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760}, - FieldElement{-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757}, - FieldElement{-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112}, - }, - }, - { - { - FieldElement{-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468}, - FieldElement{3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184}, - FieldElement{10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289}, - }, - { - FieldElement{15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066}, - FieldElement{24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882}, - FieldElement{13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226}, - }, - { - FieldElement{16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101}, - FieldElement{29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279}, - FieldElement{-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811}, - }, - { - FieldElement{27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709}, - FieldElement{20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714}, - FieldElement{-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121}, - }, - { - FieldElement{9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464}, - FieldElement{12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847}, - FieldElement{13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400}, - }, - { - FieldElement{4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414}, - FieldElement{-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158}, - FieldElement{17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045}, - }, - { - FieldElement{-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415}, - FieldElement{-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459}, - FieldElement{-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079}, - }, - { - FieldElement{21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412}, - FieldElement{-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743}, - FieldElement{-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836}, - }, - }, - { - { - FieldElement{12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022}, - FieldElement{18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429}, - FieldElement{-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065}, - }, - { - FieldElement{30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861}, - FieldElement{10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000}, - FieldElement{-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101}, - }, - { - FieldElement{32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815}, - FieldElement{29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642}, - FieldElement{10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966}, - }, - { - FieldElement{25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574}, - FieldElement{-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742}, - FieldElement{-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689}, - }, - { - FieldElement{12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020}, - FieldElement{-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772}, - FieldElement{3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982}, - }, - { - FieldElement{-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953}, - FieldElement{-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218}, - FieldElement{-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265}, - }, - { - FieldElement{29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073}, - FieldElement{-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325}, - FieldElement{-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798}, - }, - { - FieldElement{-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870}, - FieldElement{-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863}, - FieldElement{-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927}, - }, - }, - { - { - FieldElement{-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267}, - FieldElement{-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663}, - FieldElement{22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862}, - }, - { - FieldElement{-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673}, - FieldElement{15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943}, - FieldElement{15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020}, - }, - { - FieldElement{-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238}, - FieldElement{11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064}, - FieldElement{14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795}, - }, - { - FieldElement{15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052}, - FieldElement{-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904}, - FieldElement{29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531}, - }, - { - FieldElement{-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979}, - FieldElement{-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841}, - FieldElement{10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431}, - }, - { - FieldElement{10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324}, - FieldElement{-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940}, - FieldElement{10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320}, - }, - { - FieldElement{-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184}, - FieldElement{14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114}, - FieldElement{30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878}, - }, - { - FieldElement{12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784}, - FieldElement{-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091}, - FieldElement{-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585}, - }, - }, - { - { - FieldElement{-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208}, - FieldElement{10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864}, - FieldElement{17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661}, - }, - { - FieldElement{7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233}, - FieldElement{26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212}, - FieldElement{-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525}, - }, - { - FieldElement{-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068}, - FieldElement{9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397}, - FieldElement{-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988}, - }, - { - FieldElement{5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889}, - FieldElement{32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038}, - FieldElement{14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697}, - }, - { - FieldElement{20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875}, - FieldElement{-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905}, - FieldElement{-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656}, - }, - { - FieldElement{11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818}, - FieldElement{27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714}, - FieldElement{10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203}, - }, - { - FieldElement{20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931}, - FieldElement{-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024}, - FieldElement{-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084}, - }, - { - FieldElement{-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204}, - FieldElement{20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817}, - FieldElement{27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667}, - }, - }, - { - { - FieldElement{11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504}, - FieldElement{-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768}, - FieldElement{-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255}, - }, - { - FieldElement{6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790}, - FieldElement{1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438}, - FieldElement{-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333}, - }, - { - FieldElement{17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971}, - FieldElement{31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905}, - FieldElement{29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409}, - }, - { - FieldElement{12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409}, - FieldElement{6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499}, - FieldElement{-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363}, - }, - { - FieldElement{28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664}, - FieldElement{-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324}, - FieldElement{-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940}, - }, - { - FieldElement{13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990}, - FieldElement{-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914}, - FieldElement{-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290}, - }, - { - FieldElement{24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257}, - FieldElement{-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433}, - FieldElement{-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236}, - }, - { - FieldElement{-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045}, - FieldElement{11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093}, - FieldElement{-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347}, - }, - }, - { - { - FieldElement{-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191}, - FieldElement{-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507}, - FieldElement{-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906}, - }, - { - FieldElement{3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018}, - FieldElement{-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109}, - FieldElement{-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926}, - }, - { - FieldElement{-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528}, - FieldElement{8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625}, - FieldElement{-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286}, - }, - { - FieldElement{2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033}, - FieldElement{27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866}, - FieldElement{21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896}, - }, - { - FieldElement{30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075}, - FieldElement{26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347}, - FieldElement{-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437}, - }, - { - FieldElement{-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165}, - FieldElement{-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588}, - FieldElement{-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193}, - }, - { - FieldElement{-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017}, - FieldElement{-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883}, - FieldElement{21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961}, - }, - { - FieldElement{8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043}, - FieldElement{29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663}, - FieldElement{-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362}, - }, - }, - { - { - FieldElement{-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860}, - FieldElement{2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466}, - FieldElement{-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063}, - }, - { - FieldElement{-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997}, - FieldElement{-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295}, - FieldElement{-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369}, - }, - { - FieldElement{9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385}, - FieldElement{18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109}, - FieldElement{2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906}, - }, - { - FieldElement{4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424}, - FieldElement{-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185}, - FieldElement{7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962}, - }, - { - FieldElement{-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325}, - FieldElement{10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593}, - FieldElement{696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404}, - }, - { - FieldElement{-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644}, - FieldElement{17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801}, - FieldElement{26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804}, - }, - { - FieldElement{-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884}, - FieldElement{-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577}, - FieldElement{-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849}, - }, - { - FieldElement{32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473}, - FieldElement{-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644}, - FieldElement{-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319}, - }, - }, - { - { - FieldElement{-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599}, - FieldElement{-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768}, - FieldElement{-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084}, - }, - { - FieldElement{-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328}, - FieldElement{-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369}, - FieldElement{20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920}, - }, - { - FieldElement{12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815}, - FieldElement{-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025}, - FieldElement{-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397}, - }, - { - FieldElement{-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448}, - FieldElement{6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981}, - FieldElement{30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165}, - }, - { - FieldElement{32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501}, - FieldElement{17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073}, - FieldElement{-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861}, - }, - { - FieldElement{14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845}, - FieldElement{-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211}, - FieldElement{18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870}, - }, - { - FieldElement{10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096}, - FieldElement{33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803}, - FieldElement{-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168}, - }, - { - FieldElement{30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965}, - FieldElement{-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505}, - FieldElement{18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598}, - }, - }, - { - { - FieldElement{5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782}, - FieldElement{5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900}, - FieldElement{-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479}, - }, - { - FieldElement{-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208}, - FieldElement{8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232}, - FieldElement{17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719}, - }, - { - FieldElement{16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271}, - FieldElement{-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326}, - FieldElement{-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132}, - }, - { - FieldElement{14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300}, - FieldElement{8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570}, - FieldElement{15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670}, - }, - { - FieldElement{-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994}, - FieldElement{-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913}, - FieldElement{31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317}, - }, - { - FieldElement{-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730}, - FieldElement{842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096}, - FieldElement{-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078}, - }, - { - FieldElement{-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411}, - FieldElement{-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905}, - FieldElement{-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654}, - }, - { - FieldElement{-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870}, - FieldElement{-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498}, - FieldElement{12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579}, - }, - }, - { - { - FieldElement{14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677}, - FieldElement{10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647}, - FieldElement{-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743}, - }, - { - FieldElement{-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468}, - FieldElement{21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375}, - FieldElement{-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155}, - }, - { - FieldElement{6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725}, - FieldElement{-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612}, - FieldElement{-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943}, - }, - { - FieldElement{-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944}, - FieldElement{30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928}, - FieldElement{9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406}, - }, - { - FieldElement{22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139}, - FieldElement{-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963}, - FieldElement{-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693}, - }, - { - FieldElement{1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734}, - FieldElement{-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680}, - FieldElement{-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410}, - }, - { - FieldElement{-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931}, - FieldElement{-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654}, - FieldElement{22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710}, - }, - { - FieldElement{29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180}, - FieldElement{-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684}, - FieldElement{-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895}, - }, - }, - { - { - FieldElement{22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501}, - FieldElement{-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413}, - FieldElement{6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880}, - }, - { - FieldElement{-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874}, - FieldElement{22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962}, - FieldElement{-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899}, - }, - { - FieldElement{21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152}, - FieldElement{9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063}, - FieldElement{7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080}, - }, - { - FieldElement{-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146}, - FieldElement{-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183}, - FieldElement{-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133}, - }, - { - FieldElement{-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421}, - FieldElement{-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622}, - FieldElement{-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197}, - }, - { - FieldElement{2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663}, - FieldElement{31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753}, - FieldElement{4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755}, - }, - { - FieldElement{-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862}, - FieldElement{-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118}, - FieldElement{26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171}, - }, - { - FieldElement{15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380}, - FieldElement{16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824}, - FieldElement{28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270}, - }, - }, - { - { - FieldElement{-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438}, - FieldElement{-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584}, - FieldElement{-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562}, - }, - { - FieldElement{30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471}, - FieldElement{18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610}, - FieldElement{19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269}, - }, - { - FieldElement{-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650}, - FieldElement{14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369}, - FieldElement{19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461}, - }, - { - FieldElement{30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462}, - FieldElement{-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793}, - FieldElement{-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218}, - }, - { - FieldElement{-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226}, - FieldElement{18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019}, - FieldElement{-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037}, - }, - { - FieldElement{31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171}, - FieldElement{-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132}, - FieldElement{-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841}, - }, - { - FieldElement{21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181}, - FieldElement{-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210}, - FieldElement{-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040}, - }, - { - FieldElement{3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935}, - FieldElement{24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105}, - FieldElement{-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814}, - }, - }, - { - { - FieldElement{793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852}, - FieldElement{5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581}, - FieldElement{-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646}, - }, - { - FieldElement{10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844}, - FieldElement{10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025}, - FieldElement{27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453}, - }, - { - FieldElement{-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068}, - FieldElement{4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192}, - FieldElement{-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921}, - }, - { - FieldElement{-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259}, - FieldElement{-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426}, - FieldElement{-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072}, - }, - { - FieldElement{-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305}, - FieldElement{13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832}, - FieldElement{28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943}, - }, - { - FieldElement{-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011}, - FieldElement{24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447}, - FieldElement{17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494}, - }, - { - FieldElement{-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245}, - FieldElement{-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859}, - FieldElement{28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915}, - }, - { - FieldElement{16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707}, - FieldElement{10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848}, - FieldElement{-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224}, - }, - }, - { - { - FieldElement{-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391}, - FieldElement{15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215}, - FieldElement{-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101}, - }, - { - FieldElement{23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713}, - FieldElement{21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849}, - FieldElement{-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930}, - }, - { - FieldElement{-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940}, - FieldElement{-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031}, - FieldElement{-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404}, - }, - { - FieldElement{-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243}, - FieldElement{-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116}, - FieldElement{-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525}, - }, - { - FieldElement{-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509}, - FieldElement{-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883}, - FieldElement{15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865}, - }, - { - FieldElement{-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660}, - FieldElement{4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273}, - FieldElement{-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138}, - }, - { - FieldElement{-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560}, - FieldElement{-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135}, - FieldElement{2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941}, - }, - { - FieldElement{-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739}, - FieldElement{18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756}, - FieldElement{-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819}, - }, - }, - { - { - FieldElement{-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347}, - FieldElement{-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028}, - FieldElement{21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075}, - }, - { - FieldElement{16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799}, - FieldElement{-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609}, - FieldElement{-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817}, - }, - { - FieldElement{-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989}, - FieldElement{-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523}, - FieldElement{4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278}, - }, - { - FieldElement{31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045}, - FieldElement{19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377}, - FieldElement{24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480}, - }, - { - FieldElement{17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016}, - FieldElement{510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426}, - FieldElement{18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525}, - }, - { - FieldElement{13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396}, - FieldElement{9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080}, - FieldElement{12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892}, - }, - { - FieldElement{15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275}, - FieldElement{11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074}, - FieldElement{20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140}, - }, - { - FieldElement{-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717}, - FieldElement{-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101}, - FieldElement{24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127}, - }, - }, - { - { - FieldElement{-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632}, - FieldElement{-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415}, - FieldElement{-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160}, - }, - { - FieldElement{31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876}, - FieldElement{22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625}, - FieldElement{-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478}, - }, - { - FieldElement{27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164}, - FieldElement{26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595}, - FieldElement{-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248}, - }, - { - FieldElement{-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858}, - FieldElement{15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193}, - FieldElement{8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184}, - }, - { - FieldElement{-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942}, - FieldElement{-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635}, - FieldElement{21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948}, - }, - { - FieldElement{11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935}, - FieldElement{-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415}, - FieldElement{-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416}, - }, - { - FieldElement{-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018}, - FieldElement{4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778}, - FieldElement{366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659}, - }, - { - FieldElement{-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385}, - FieldElement{18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503}, - FieldElement{476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329}, - }, - }, - { - { - FieldElement{20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056}, - FieldElement{-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838}, - FieldElement{24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948}, - }, - { - FieldElement{-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691}, - FieldElement{-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118}, - FieldElement{-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517}, - }, - { - FieldElement{-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269}, - FieldElement{-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904}, - FieldElement{-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589}, - }, - { - FieldElement{-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193}, - FieldElement{-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910}, - FieldElement{-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930}, - }, - { - FieldElement{-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667}, - FieldElement{25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481}, - FieldElement{-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876}, - }, - { - FieldElement{22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640}, - FieldElement{-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278}, - FieldElement{-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112}, - }, - { - FieldElement{26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272}, - FieldElement{17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012}, - FieldElement{-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221}, - }, - { - FieldElement{30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046}, - FieldElement{13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345}, - FieldElement{-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310}, - }, - }, - { - { - FieldElement{19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937}, - FieldElement{31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636}, - FieldElement{-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008}, - }, - { - FieldElement{-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429}, - FieldElement{-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576}, - FieldElement{31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066}, - }, - { - FieldElement{-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490}, - FieldElement{-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104}, - FieldElement{33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053}, - }, - { - FieldElement{31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275}, - FieldElement{-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511}, - FieldElement{22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095}, - }, - { - FieldElement{-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439}, - FieldElement{23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939}, - FieldElement{-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424}, - }, - { - FieldElement{2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310}, - FieldElement{3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608}, - FieldElement{-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079}, - }, - { - FieldElement{-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101}, - FieldElement{21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418}, - FieldElement{18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576}, - }, - { - FieldElement{30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356}, - FieldElement{9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996}, - FieldElement{-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099}, - }, - }, - { - { - FieldElement{-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728}, - FieldElement{-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658}, - FieldElement{-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242}, - }, - { - FieldElement{-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001}, - FieldElement{-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766}, - FieldElement{18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373}, - }, - { - FieldElement{26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458}, - FieldElement{-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628}, - FieldElement{-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657}, - }, - { - FieldElement{-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062}, - FieldElement{25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616}, - FieldElement{31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014}, - }, - { - FieldElement{24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383}, - FieldElement{-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814}, - FieldElement{-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718}, - }, - { - FieldElement{30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417}, - FieldElement{2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222}, - FieldElement{33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444}, - }, - { - FieldElement{-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597}, - FieldElement{23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970}, - FieldElement{1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799}, - }, - { - FieldElement{-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647}, - FieldElement{13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511}, - FieldElement{-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032}, - }, - }, - { - { - FieldElement{9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834}, - FieldElement{-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461}, - FieldElement{29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062}, - }, - { - FieldElement{-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516}, - FieldElement{-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547}, - FieldElement{-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240}, - }, - { - FieldElement{-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038}, - FieldElement{-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741}, - FieldElement{16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103}, - }, - { - FieldElement{-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747}, - FieldElement{-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323}, - FieldElement{31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016}, - }, - { - FieldElement{-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373}, - FieldElement{15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228}, - FieldElement{-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141}, - }, - { - FieldElement{16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399}, - FieldElement{11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831}, - FieldElement{-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376}, - }, - { - FieldElement{-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313}, - FieldElement{-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958}, - FieldElement{-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577}, - }, - { - FieldElement{-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743}, - FieldElement{29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684}, - FieldElement{-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476}, - }, - }, -} diff --git a/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go b/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go deleted file mode 100644 index 5f8b994..0000000 --- a/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go +++ /dev/null @@ -1,1771 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package edwards25519 - -// This code is a port of the public domain, “ref10” implementation of ed25519 -// from SUPERCOP. - -// FieldElement represents an element of the field GF(2^255 - 19). An element -// t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 -// t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on -// context. -type FieldElement [10]int32 - -var zero FieldElement - -func FeZero(fe *FieldElement) { - copy(fe[:], zero[:]) -} - -func FeOne(fe *FieldElement) { - FeZero(fe) - fe[0] = 1 -} - -func FeAdd(dst, a, b *FieldElement) { - dst[0] = a[0] + b[0] - dst[1] = a[1] + b[1] - dst[2] = a[2] + b[2] - dst[3] = a[3] + b[3] - dst[4] = a[4] + b[4] - dst[5] = a[5] + b[5] - dst[6] = a[6] + b[6] - dst[7] = a[7] + b[7] - dst[8] = a[8] + b[8] - dst[9] = a[9] + b[9] -} - -func FeSub(dst, a, b *FieldElement) { - dst[0] = a[0] - b[0] - dst[1] = a[1] - b[1] - dst[2] = a[2] - b[2] - dst[3] = a[3] - b[3] - dst[4] = a[4] - b[4] - dst[5] = a[5] - b[5] - dst[6] = a[6] - b[6] - dst[7] = a[7] - b[7] - dst[8] = a[8] - b[8] - dst[9] = a[9] - b[9] -} - -func FeCopy(dst, src *FieldElement) { - copy(dst[:], src[:]) -} - -// Replace (f,g) with (g,g) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -func FeCMove(f, g *FieldElement, b int32) { - b = -b - f[0] ^= b & (f[0] ^ g[0]) - f[1] ^= b & (f[1] ^ g[1]) - f[2] ^= b & (f[2] ^ g[2]) - f[3] ^= b & (f[3] ^ g[3]) - f[4] ^= b & (f[4] ^ g[4]) - f[5] ^= b & (f[5] ^ g[5]) - f[6] ^= b & (f[6] ^ g[6]) - f[7] ^= b & (f[7] ^ g[7]) - f[8] ^= b & (f[8] ^ g[8]) - f[9] ^= b & (f[9] ^ g[9]) -} - -func load3(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - return r -} - -func load4(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - r |= int64(in[3]) << 24 - return r -} - -func FeFromBytes(dst *FieldElement, src *[32]byte) { - h0 := load4(src[:]) - h1 := load3(src[4:]) << 6 - h2 := load3(src[7:]) << 5 - h3 := load3(src[10:]) << 3 - h4 := load3(src[13:]) << 2 - h5 := load4(src[16:]) - h6 := load3(src[20:]) << 7 - h7 := load3(src[23:]) << 5 - h8 := load3(src[26:]) << 4 - h9 := (load3(src[29:]) & 8388607) << 2 - - FeCombine(dst, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -// FeToBytes marshals h to s. -// Preconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Write p=2^255-19; q=floor(h/p). -// Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). -// -// Proof: -// Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. -// Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4. -// -// Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). -// Then 0> 25 - q = (h[0] + q) >> 26 - q = (h[1] + q) >> 25 - q = (h[2] + q) >> 26 - q = (h[3] + q) >> 25 - q = (h[4] + q) >> 26 - q = (h[5] + q) >> 25 - q = (h[6] + q) >> 26 - q = (h[7] + q) >> 25 - q = (h[8] + q) >> 26 - q = (h[9] + q) >> 25 - - // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. - h[0] += 19 * q - // Goal: Output h-2^255 q, which is between 0 and 2^255-20. - - carry[0] = h[0] >> 26 - h[1] += carry[0] - h[0] -= carry[0] << 26 - carry[1] = h[1] >> 25 - h[2] += carry[1] - h[1] -= carry[1] << 25 - carry[2] = h[2] >> 26 - h[3] += carry[2] - h[2] -= carry[2] << 26 - carry[3] = h[3] >> 25 - h[4] += carry[3] - h[3] -= carry[3] << 25 - carry[4] = h[4] >> 26 - h[5] += carry[4] - h[4] -= carry[4] << 26 - carry[5] = h[5] >> 25 - h[6] += carry[5] - h[5] -= carry[5] << 25 - carry[6] = h[6] >> 26 - h[7] += carry[6] - h[6] -= carry[6] << 26 - carry[7] = h[7] >> 25 - h[8] += carry[7] - h[7] -= carry[7] << 25 - carry[8] = h[8] >> 26 - h[9] += carry[8] - h[8] -= carry[8] << 26 - carry[9] = h[9] >> 25 - h[9] -= carry[9] << 25 - // h10 = carry9 - - // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. - // Have h[0]+...+2^230 h[9] between 0 and 2^255-1; - // evidently 2^255 h10-2^255 q = 0. - // Goal: Output h[0]+...+2^230 h[9]. - - s[0] = byte(h[0] >> 0) - s[1] = byte(h[0] >> 8) - s[2] = byte(h[0] >> 16) - s[3] = byte((h[0] >> 24) | (h[1] << 2)) - s[4] = byte(h[1] >> 6) - s[5] = byte(h[1] >> 14) - s[6] = byte((h[1] >> 22) | (h[2] << 3)) - s[7] = byte(h[2] >> 5) - s[8] = byte(h[2] >> 13) - s[9] = byte((h[2] >> 21) | (h[3] << 5)) - s[10] = byte(h[3] >> 3) - s[11] = byte(h[3] >> 11) - s[12] = byte((h[3] >> 19) | (h[4] << 6)) - s[13] = byte(h[4] >> 2) - s[14] = byte(h[4] >> 10) - s[15] = byte(h[4] >> 18) - s[16] = byte(h[5] >> 0) - s[17] = byte(h[5] >> 8) - s[18] = byte(h[5] >> 16) - s[19] = byte((h[5] >> 24) | (h[6] << 1)) - s[20] = byte(h[6] >> 7) - s[21] = byte(h[6] >> 15) - s[22] = byte((h[6] >> 23) | (h[7] << 3)) - s[23] = byte(h[7] >> 5) - s[24] = byte(h[7] >> 13) - s[25] = byte((h[7] >> 21) | (h[8] << 4)) - s[26] = byte(h[8] >> 4) - s[27] = byte(h[8] >> 12) - s[28] = byte((h[8] >> 20) | (h[9] << 6)) - s[29] = byte(h[9] >> 2) - s[30] = byte(h[9] >> 10) - s[31] = byte(h[9] >> 18) -} - -func FeIsNegative(f *FieldElement) byte { - var s [32]byte - FeToBytes(&s, f) - return s[0] & 1 -} - -func FeIsNonZero(f *FieldElement) int32 { - var s [32]byte - FeToBytes(&s, f) - var x uint8 - for _, b := range s { - x |= b - } - x |= x >> 4 - x |= x >> 2 - x |= x >> 1 - return int32(x & 1) -} - -// FeNeg sets h = -f -// -// Preconditions: -// |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func FeNeg(h, f *FieldElement) { - h[0] = -f[0] - h[1] = -f[1] - h[2] = -f[2] - h[3] = -f[3] - h[4] = -f[4] - h[5] = -f[5] - h[6] = -f[6] - h[7] = -f[7] - h[8] = -f[8] - h[9] = -f[9] -} - -func FeCombine(h *FieldElement, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { - var c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 int64 - - /* - |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38)) - i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8 - |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19)) - i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9 - */ - - c0 = (h0 + (1 << 25)) >> 26 - h1 += c0 - h0 -= c0 << 26 - c4 = (h4 + (1 << 25)) >> 26 - h5 += c4 - h4 -= c4 << 26 - /* |h0| <= 2^25 */ - /* |h4| <= 2^25 */ - /* |h1| <= 1.51*2^58 */ - /* |h5| <= 1.51*2^58 */ - - c1 = (h1 + (1 << 24)) >> 25 - h2 += c1 - h1 -= c1 << 25 - c5 = (h5 + (1 << 24)) >> 25 - h6 += c5 - h5 -= c5 << 25 - /* |h1| <= 2^24; from now on fits into int32 */ - /* |h5| <= 2^24; from now on fits into int32 */ - /* |h2| <= 1.21*2^59 */ - /* |h6| <= 1.21*2^59 */ - - c2 = (h2 + (1 << 25)) >> 26 - h3 += c2 - h2 -= c2 << 26 - c6 = (h6 + (1 << 25)) >> 26 - h7 += c6 - h6 -= c6 << 26 - /* |h2| <= 2^25; from now on fits into int32 unchanged */ - /* |h6| <= 2^25; from now on fits into int32 unchanged */ - /* |h3| <= 1.51*2^58 */ - /* |h7| <= 1.51*2^58 */ - - c3 = (h3 + (1 << 24)) >> 25 - h4 += c3 - h3 -= c3 << 25 - c7 = (h7 + (1 << 24)) >> 25 - h8 += c7 - h7 -= c7 << 25 - /* |h3| <= 2^24; from now on fits into int32 unchanged */ - /* |h7| <= 2^24; from now on fits into int32 unchanged */ - /* |h4| <= 1.52*2^33 */ - /* |h8| <= 1.52*2^33 */ - - c4 = (h4 + (1 << 25)) >> 26 - h5 += c4 - h4 -= c4 << 26 - c8 = (h8 + (1 << 25)) >> 26 - h9 += c8 - h8 -= c8 << 26 - /* |h4| <= 2^25; from now on fits into int32 unchanged */ - /* |h8| <= 2^25; from now on fits into int32 unchanged */ - /* |h5| <= 1.01*2^24 */ - /* |h9| <= 1.51*2^58 */ - - c9 = (h9 + (1 << 24)) >> 25 - h0 += c9 * 19 - h9 -= c9 << 25 - /* |h9| <= 2^24; from now on fits into int32 unchanged */ - /* |h0| <= 1.8*2^37 */ - - c0 = (h0 + (1 << 25)) >> 26 - h1 += c0 - h0 -= c0 << 26 - /* |h0| <= 2^25; from now on fits into int32 unchanged */ - /* |h1| <= 1.01*2^24 */ - - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) -} - -// FeMul calculates h = f * g -// Can overlap h with f or g. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Notes on implementation strategy: -// -// Using schoolbook multiplication. -// Karatsuba would save a little in some cost models. -// -// Most multiplications by 2 and 19 are 32-bit precomputations; -// cheaper than 64-bit postcomputations. -// -// There is one remaining multiplication by 19 in the carry chain; -// one *19 precomputation can be merged into this, -// but the resulting data flow is considerably less clean. -// -// There are 12 carries below. -// 10 of them are 2-way parallelizable and vectorizable. -// Can get away with 11 carries, but then data flow is much deeper. -// -// With tighter constraints on inputs, can squeeze carries into int32. -func FeMul(h, f, g *FieldElement) { - f0 := int64(f[0]) - f1 := int64(f[1]) - f2 := int64(f[2]) - f3 := int64(f[3]) - f4 := int64(f[4]) - f5 := int64(f[5]) - f6 := int64(f[6]) - f7 := int64(f[7]) - f8 := int64(f[8]) - f9 := int64(f[9]) - - f1_2 := int64(2 * f[1]) - f3_2 := int64(2 * f[3]) - f5_2 := int64(2 * f[5]) - f7_2 := int64(2 * f[7]) - f9_2 := int64(2 * f[9]) - - g0 := int64(g[0]) - g1 := int64(g[1]) - g2 := int64(g[2]) - g3 := int64(g[3]) - g4 := int64(g[4]) - g5 := int64(g[5]) - g6 := int64(g[6]) - g7 := int64(g[7]) - g8 := int64(g[8]) - g9 := int64(g[9]) - - g1_19 := int64(19 * g[1]) /* 1.4*2^29 */ - g2_19 := int64(19 * g[2]) /* 1.4*2^30; still ok */ - g3_19 := int64(19 * g[3]) - g4_19 := int64(19 * g[4]) - g5_19 := int64(19 * g[5]) - g6_19 := int64(19 * g[6]) - g7_19 := int64(19 * g[7]) - g8_19 := int64(19 * g[8]) - g9_19 := int64(19 * g[9]) - - h0 := f0*g0 + f1_2*g9_19 + f2*g8_19 + f3_2*g7_19 + f4*g6_19 + f5_2*g5_19 + f6*g4_19 + f7_2*g3_19 + f8*g2_19 + f9_2*g1_19 - h1 := f0*g1 + f1*g0 + f2*g9_19 + f3*g8_19 + f4*g7_19 + f5*g6_19 + f6*g5_19 + f7*g4_19 + f8*g3_19 + f9*g2_19 - h2 := f0*g2 + f1_2*g1 + f2*g0 + f3_2*g9_19 + f4*g8_19 + f5_2*g7_19 + f6*g6_19 + f7_2*g5_19 + f8*g4_19 + f9_2*g3_19 - h3 := f0*g3 + f1*g2 + f2*g1 + f3*g0 + f4*g9_19 + f5*g8_19 + f6*g7_19 + f7*g6_19 + f8*g5_19 + f9*g4_19 - h4 := f0*g4 + f1_2*g3 + f2*g2 + f3_2*g1 + f4*g0 + f5_2*g9_19 + f6*g8_19 + f7_2*g7_19 + f8*g6_19 + f9_2*g5_19 - h5 := f0*g5 + f1*g4 + f2*g3 + f3*g2 + f4*g1 + f5*g0 + f6*g9_19 + f7*g8_19 + f8*g7_19 + f9*g6_19 - h6 := f0*g6 + f1_2*g5 + f2*g4 + f3_2*g3 + f4*g2 + f5_2*g1 + f6*g0 + f7_2*g9_19 + f8*g8_19 + f9_2*g7_19 - h7 := f0*g7 + f1*g6 + f2*g5 + f3*g4 + f4*g3 + f5*g2 + f6*g1 + f7*g0 + f8*g9_19 + f9*g8_19 - h8 := f0*g8 + f1_2*g7 + f2*g6 + f3_2*g5 + f4*g4 + f5_2*g3 + f6*g2 + f7_2*g1 + f8*g0 + f9_2*g9_19 - h9 := f0*g9 + f1*g8 + f2*g7 + f3*g6 + f4*g5 + f5*g4 + f6*g3 + f7*g2 + f8*g1 + f9*g0 - - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -func feSquare(f *FieldElement) (h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { - f0 := int64(f[0]) - f1 := int64(f[1]) - f2 := int64(f[2]) - f3 := int64(f[3]) - f4 := int64(f[4]) - f5 := int64(f[5]) - f6 := int64(f[6]) - f7 := int64(f[7]) - f8 := int64(f[8]) - f9 := int64(f[9]) - f0_2 := int64(2 * f[0]) - f1_2 := int64(2 * f[1]) - f2_2 := int64(2 * f[2]) - f3_2 := int64(2 * f[3]) - f4_2 := int64(2 * f[4]) - f5_2 := int64(2 * f[5]) - f6_2 := int64(2 * f[6]) - f7_2 := int64(2 * f[7]) - f5_38 := 38 * f5 // 1.31*2^30 - f6_19 := 19 * f6 // 1.31*2^30 - f7_38 := 38 * f7 // 1.31*2^30 - f8_19 := 19 * f8 // 1.31*2^30 - f9_38 := 38 * f9 // 1.31*2^30 - - h0 = f0*f0 + f1_2*f9_38 + f2_2*f8_19 + f3_2*f7_38 + f4_2*f6_19 + f5*f5_38 - h1 = f0_2*f1 + f2*f9_38 + f3_2*f8_19 + f4*f7_38 + f5_2*f6_19 - h2 = f0_2*f2 + f1_2*f1 + f3_2*f9_38 + f4_2*f8_19 + f5_2*f7_38 + f6*f6_19 - h3 = f0_2*f3 + f1_2*f2 + f4*f9_38 + f5_2*f8_19 + f6*f7_38 - h4 = f0_2*f4 + f1_2*f3_2 + f2*f2 + f5_2*f9_38 + f6_2*f8_19 + f7*f7_38 - h5 = f0_2*f5 + f1_2*f4 + f2_2*f3 + f6*f9_38 + f7_2*f8_19 - h6 = f0_2*f6 + f1_2*f5_2 + f2_2*f4 + f3_2*f3 + f7_2*f9_38 + f8*f8_19 - h7 = f0_2*f7 + f1_2*f6 + f2_2*f5 + f3_2*f4 + f8*f9_38 - h8 = f0_2*f8 + f1_2*f7_2 + f2_2*f6 + f3_2*f5_2 + f4*f4 + f9*f9_38 - h9 = f0_2*f9 + f1_2*f8 + f2_2*f7 + f3_2*f6 + f4_2*f5 - - return -} - -// FeSquare calculates h = f*f. Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func FeSquare(h, f *FieldElement) { - h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 := feSquare(f) - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -// FeSquare2 sets h = 2 * f * f -// -// Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc. -// See fe_mul.c for discussion of implementation strategy. -func FeSquare2(h, f *FieldElement) { - h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 := feSquare(f) - - h0 += h0 - h1 += h1 - h2 += h2 - h3 += h3 - h4 += h4 - h5 += h5 - h6 += h6 - h7 += h7 - h8 += h8 - h9 += h9 - - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -func FeInvert(out, z *FieldElement) { - var t0, t1, t2, t3 FieldElement - var i int - - FeSquare(&t0, z) // 2^1 - FeSquare(&t1, &t0) // 2^2 - for i = 1; i < 2; i++ { // 2^3 - FeSquare(&t1, &t1) - } - FeMul(&t1, z, &t1) // 2^3 + 2^0 - FeMul(&t0, &t0, &t1) // 2^3 + 2^1 + 2^0 - FeSquare(&t2, &t0) // 2^4 + 2^2 + 2^1 - FeMul(&t1, &t1, &t2) // 2^4 + 2^3 + 2^2 + 2^1 + 2^0 - FeSquare(&t2, &t1) // 5,4,3,2,1 - for i = 1; i < 5; i++ { // 9,8,7,6,5 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 9,8,7,6,5,4,3,2,1,0 - FeSquare(&t2, &t1) // 10..1 - for i = 1; i < 10; i++ { // 19..10 - FeSquare(&t2, &t2) - } - FeMul(&t2, &t2, &t1) // 19..0 - FeSquare(&t3, &t2) // 20..1 - for i = 1; i < 20; i++ { // 39..20 - FeSquare(&t3, &t3) - } - FeMul(&t2, &t3, &t2) // 39..0 - FeSquare(&t2, &t2) // 40..1 - for i = 1; i < 10; i++ { // 49..10 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 49..0 - FeSquare(&t2, &t1) // 50..1 - for i = 1; i < 50; i++ { // 99..50 - FeSquare(&t2, &t2) - } - FeMul(&t2, &t2, &t1) // 99..0 - FeSquare(&t3, &t2) // 100..1 - for i = 1; i < 100; i++ { // 199..100 - FeSquare(&t3, &t3) - } - FeMul(&t2, &t3, &t2) // 199..0 - FeSquare(&t2, &t2) // 200..1 - for i = 1; i < 50; i++ { // 249..50 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 249..0 - FeSquare(&t1, &t1) // 250..1 - for i = 1; i < 5; i++ { // 254..5 - FeSquare(&t1, &t1) - } - FeMul(out, &t1, &t0) // 254..5,3,1,0 -} - -func fePow22523(out, z *FieldElement) { - var t0, t1, t2 FieldElement - var i int - - FeSquare(&t0, z) - for i = 1; i < 1; i++ { - FeSquare(&t0, &t0) - } - FeSquare(&t1, &t0) - for i = 1; i < 2; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, z, &t1) - FeMul(&t0, &t0, &t1) - FeSquare(&t0, &t0) - for i = 1; i < 1; i++ { - FeSquare(&t0, &t0) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 5; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 10; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, &t1, &t0) - FeSquare(&t2, &t1) - for i = 1; i < 20; i++ { - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) - FeSquare(&t1, &t1) - for i = 1; i < 10; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 50; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, &t1, &t0) - FeSquare(&t2, &t1) - for i = 1; i < 100; i++ { - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) - FeSquare(&t1, &t1) - for i = 1; i < 50; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t0, &t0) - for i = 1; i < 2; i++ { - FeSquare(&t0, &t0) - } - FeMul(out, &t0, z) -} - -// Group elements are members of the elliptic curve -x^2 + y^2 = 1 + d * x^2 * -// y^2 where d = -121665/121666. -// -// Several representations are used: -// ProjectiveGroupElement: (X:Y:Z) satisfying x=X/Z, y=Y/Z -// ExtendedGroupElement: (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT -// CompletedGroupElement: ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T -// PreComputedGroupElement: (y+x,y-x,2dxy) - -type ProjectiveGroupElement struct { - X, Y, Z FieldElement -} - -type ExtendedGroupElement struct { - X, Y, Z, T FieldElement -} - -type CompletedGroupElement struct { - X, Y, Z, T FieldElement -} - -type PreComputedGroupElement struct { - yPlusX, yMinusX, xy2d FieldElement -} - -type CachedGroupElement struct { - yPlusX, yMinusX, Z, T2d FieldElement -} - -func (p *ProjectiveGroupElement) Zero() { - FeZero(&p.X) - FeOne(&p.Y) - FeOne(&p.Z) -} - -func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) { - var t0 FieldElement - - FeSquare(&r.X, &p.X) - FeSquare(&r.Z, &p.Y) - FeSquare2(&r.T, &p.Z) - FeAdd(&r.Y, &p.X, &p.Y) - FeSquare(&t0, &r.Y) - FeAdd(&r.Y, &r.Z, &r.X) - FeSub(&r.Z, &r.Z, &r.X) - FeSub(&r.X, &t0, &r.Y) - FeSub(&r.T, &r.T, &r.Z) -} - -func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) { - var recip, x, y FieldElement - - FeInvert(&recip, &p.Z) - FeMul(&x, &p.X, &recip) - FeMul(&y, &p.Y, &recip) - FeToBytes(s, &y) - s[31] ^= FeIsNegative(&x) << 7 -} - -func (p *ExtendedGroupElement) Zero() { - FeZero(&p.X) - FeOne(&p.Y) - FeOne(&p.Z) - FeZero(&p.T) -} - -func (p *ExtendedGroupElement) Double(r *CompletedGroupElement) { - var q ProjectiveGroupElement - p.ToProjective(&q) - q.Double(r) -} - -func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) { - FeAdd(&r.yPlusX, &p.Y, &p.X) - FeSub(&r.yMinusX, &p.Y, &p.X) - FeCopy(&r.Z, &p.Z) - FeMul(&r.T2d, &p.T, &d2) -} - -func (p *ExtendedGroupElement) ToProjective(r *ProjectiveGroupElement) { - FeCopy(&r.X, &p.X) - FeCopy(&r.Y, &p.Y) - FeCopy(&r.Z, &p.Z) -} - -func (p *ExtendedGroupElement) ToBytes(s *[32]byte) { - var recip, x, y FieldElement - - FeInvert(&recip, &p.Z) - FeMul(&x, &p.X, &recip) - FeMul(&y, &p.Y, &recip) - FeToBytes(s, &y) - s[31] ^= FeIsNegative(&x) << 7 -} - -func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool { - var u, v, v3, vxx, check FieldElement - - FeFromBytes(&p.Y, s) - FeOne(&p.Z) - FeSquare(&u, &p.Y) - FeMul(&v, &u, &d) - FeSub(&u, &u, &p.Z) // y = y^2-1 - FeAdd(&v, &v, &p.Z) // v = dy^2+1 - - FeSquare(&v3, &v) - FeMul(&v3, &v3, &v) // v3 = v^3 - FeSquare(&p.X, &v3) - FeMul(&p.X, &p.X, &v) - FeMul(&p.X, &p.X, &u) // x = uv^7 - - fePow22523(&p.X, &p.X) // x = (uv^7)^((q-5)/8) - FeMul(&p.X, &p.X, &v3) - FeMul(&p.X, &p.X, &u) // x = uv^3(uv^7)^((q-5)/8) - - var tmpX, tmp2 [32]byte - - FeSquare(&vxx, &p.X) - FeMul(&vxx, &vxx, &v) - FeSub(&check, &vxx, &u) // vx^2-u - if FeIsNonZero(&check) == 1 { - FeAdd(&check, &vxx, &u) // vx^2+u - if FeIsNonZero(&check) == 1 { - return false - } - FeMul(&p.X, &p.X, &SqrtM1) - - FeToBytes(&tmpX, &p.X) - for i, v := range tmpX { - tmp2[31-i] = v - } - } - - if FeIsNegative(&p.X) != (s[31] >> 7) { - FeNeg(&p.X, &p.X) - } - - FeMul(&p.T, &p.X, &p.Y) - return true -} - -func (p *CompletedGroupElement) ToProjective(r *ProjectiveGroupElement) { - FeMul(&r.X, &p.X, &p.T) - FeMul(&r.Y, &p.Y, &p.Z) - FeMul(&r.Z, &p.Z, &p.T) -} - -func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) { - FeMul(&r.X, &p.X, &p.T) - FeMul(&r.Y, &p.Y, &p.Z) - FeMul(&r.Z, &p.Z, &p.T) - FeMul(&r.T, &p.X, &p.Y) -} - -func (p *PreComputedGroupElement) Zero() { - FeOne(&p.yPlusX) - FeOne(&p.yMinusX) - FeZero(&p.xy2d) -} - -func geAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yPlusX) - FeMul(&r.Y, &r.Y, &q.yMinusX) - FeMul(&r.T, &q.T2d, &p.T) - FeMul(&r.X, &p.Z, &q.Z) - FeAdd(&t0, &r.X, &r.X) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeAdd(&r.Z, &t0, &r.T) - FeSub(&r.T, &t0, &r.T) -} - -func geSub(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yMinusX) - FeMul(&r.Y, &r.Y, &q.yPlusX) - FeMul(&r.T, &q.T2d, &p.T) - FeMul(&r.X, &p.Z, &q.Z) - FeAdd(&t0, &r.X, &r.X) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeSub(&r.Z, &t0, &r.T) - FeAdd(&r.T, &t0, &r.T) -} - -func geMixedAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *PreComputedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yPlusX) - FeMul(&r.Y, &r.Y, &q.yMinusX) - FeMul(&r.T, &q.xy2d, &p.T) - FeAdd(&t0, &p.Z, &p.Z) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeAdd(&r.Z, &t0, &r.T) - FeSub(&r.T, &t0, &r.T) -} - -func geMixedSub(r *CompletedGroupElement, p *ExtendedGroupElement, q *PreComputedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yMinusX) - FeMul(&r.Y, &r.Y, &q.yPlusX) - FeMul(&r.T, &q.xy2d, &p.T) - FeAdd(&t0, &p.Z, &p.Z) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeSub(&r.Z, &t0, &r.T) - FeAdd(&r.T, &t0, &r.T) -} - -func slide(r *[256]int8, a *[32]byte) { - for i := range r { - r[i] = int8(1 & (a[i>>3] >> uint(i&7))) - } - - for i := range r { - if r[i] != 0 { - for b := 1; b <= 6 && i+b < 256; b++ { - if r[i+b] != 0 { - if r[i]+(r[i+b]<= -15 { - r[i] -= r[i+b] << uint(b) - for k := i + b; k < 256; k++ { - if r[k] == 0 { - r[k] = 1 - break - } - r[k] = 0 - } - } else { - break - } - } - } - } - } -} - -// GeDoubleScalarMultVartime sets r = a*A + b*B -// where a = a[0]+256*a[1]+...+256^31 a[31]. -// and b = b[0]+256*b[1]+...+256^31 b[31]. -// B is the Ed25519 base point (x,4/5) with x positive. -func GeDoubleScalarMultVartime(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement, b *[32]byte) { - var aSlide, bSlide [256]int8 - var Ai [8]CachedGroupElement // A,3A,5A,7A,9A,11A,13A,15A - var t CompletedGroupElement - var u, A2 ExtendedGroupElement - var i int - - slide(&aSlide, a) - slide(&bSlide, b) - - A.ToCached(&Ai[0]) - A.Double(&t) - t.ToExtended(&A2) - - for i := 0; i < 7; i++ { - geAdd(&t, &A2, &Ai[i]) - t.ToExtended(&u) - u.ToCached(&Ai[i+1]) - } - - r.Zero() - - for i = 255; i >= 0; i-- { - if aSlide[i] != 0 || bSlide[i] != 0 { - break - } - } - - for ; i >= 0; i-- { - r.Double(&t) - - if aSlide[i] > 0 { - t.ToExtended(&u) - geAdd(&t, &u, &Ai[aSlide[i]/2]) - } else if aSlide[i] < 0 { - t.ToExtended(&u) - geSub(&t, &u, &Ai[(-aSlide[i])/2]) - } - - if bSlide[i] > 0 { - t.ToExtended(&u) - geMixedAdd(&t, &u, &bi[bSlide[i]/2]) - } else if bSlide[i] < 0 { - t.ToExtended(&u) - geMixedSub(&t, &u, &bi[(-bSlide[i])/2]) - } - - t.ToProjective(r) - } -} - -// equal returns 1 if b == c and 0 otherwise, assuming that b and c are -// non-negative. -func equal(b, c int32) int32 { - x := uint32(b ^ c) - x-- - return int32(x >> 31) -} - -// negative returns 1 if b < 0 and 0 otherwise. -func negative(b int32) int32 { - return (b >> 31) & 1 -} - -func PreComputedGroupElementCMove(t, u *PreComputedGroupElement, b int32) { - FeCMove(&t.yPlusX, &u.yPlusX, b) - FeCMove(&t.yMinusX, &u.yMinusX, b) - FeCMove(&t.xy2d, &u.xy2d, b) -} - -func selectPoint(t *PreComputedGroupElement, pos int32, b int32) { - var minusT PreComputedGroupElement - bNegative := negative(b) - bAbs := b - (((-bNegative) & b) << 1) - - t.Zero() - for i := int32(0); i < 8; i++ { - PreComputedGroupElementCMove(t, &base[pos][i], equal(bAbs, i+1)) - } - FeCopy(&minusT.yPlusX, &t.yMinusX) - FeCopy(&minusT.yMinusX, &t.yPlusX) - FeNeg(&minusT.xy2d, &t.xy2d) - PreComputedGroupElementCMove(t, &minusT, bNegative) -} - -// GeScalarMultBase computes h = a*B, where -// a = a[0]+256*a[1]+...+256^31 a[31] -// B is the Ed25519 base point (x,4/5) with x positive. -// -// Preconditions: -// a[31] <= 127 -func GeScalarMultBase(h *ExtendedGroupElement, a *[32]byte) { - var e [64]int8 - - for i, v := range a { - e[2*i] = int8(v & 15) - e[2*i+1] = int8((v >> 4) & 15) - } - - // each e[i] is between 0 and 15 and e[63] is between 0 and 7. - - carry := int8(0) - for i := 0; i < 63; i++ { - e[i] += carry - carry = (e[i] + 8) >> 4 - e[i] -= carry << 4 - } - e[63] += carry - // each e[i] is between -8 and 8. - - h.Zero() - var t PreComputedGroupElement - var r CompletedGroupElement - for i := int32(1); i < 64; i += 2 { - selectPoint(&t, i/2, int32(e[i])) - geMixedAdd(&r, h, &t) - r.ToExtended(h) - } - - var s ProjectiveGroupElement - - h.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToExtended(h) - - for i := int32(0); i < 64; i += 2 { - selectPoint(&t, i/2, int32(e[i])) - geMixedAdd(&r, h, &t) - r.ToExtended(h) - } -} - -// The scalars are GF(2^252 + 27742317777372353535851937790883648493). - -// Input: -// a[0]+256*a[1]+...+256^31*a[31] = a -// b[0]+256*b[1]+...+256^31*b[31] = b -// c[0]+256*c[1]+...+256^31*c[31] = c -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -func ScMulAdd(s, a, b, c *[32]byte) { - a0 := 2097151 & load3(a[:]) - a1 := 2097151 & (load4(a[2:]) >> 5) - a2 := 2097151 & (load3(a[5:]) >> 2) - a3 := 2097151 & (load4(a[7:]) >> 7) - a4 := 2097151 & (load4(a[10:]) >> 4) - a5 := 2097151 & (load3(a[13:]) >> 1) - a6 := 2097151 & (load4(a[15:]) >> 6) - a7 := 2097151 & (load3(a[18:]) >> 3) - a8 := 2097151 & load3(a[21:]) - a9 := 2097151 & (load4(a[23:]) >> 5) - a10 := 2097151 & (load3(a[26:]) >> 2) - a11 := (load4(a[28:]) >> 7) - b0 := 2097151 & load3(b[:]) - b1 := 2097151 & (load4(b[2:]) >> 5) - b2 := 2097151 & (load3(b[5:]) >> 2) - b3 := 2097151 & (load4(b[7:]) >> 7) - b4 := 2097151 & (load4(b[10:]) >> 4) - b5 := 2097151 & (load3(b[13:]) >> 1) - b6 := 2097151 & (load4(b[15:]) >> 6) - b7 := 2097151 & (load3(b[18:]) >> 3) - b8 := 2097151 & load3(b[21:]) - b9 := 2097151 & (load4(b[23:]) >> 5) - b10 := 2097151 & (load3(b[26:]) >> 2) - b11 := (load4(b[28:]) >> 7) - c0 := 2097151 & load3(c[:]) - c1 := 2097151 & (load4(c[2:]) >> 5) - c2 := 2097151 & (load3(c[5:]) >> 2) - c3 := 2097151 & (load4(c[7:]) >> 7) - c4 := 2097151 & (load4(c[10:]) >> 4) - c5 := 2097151 & (load3(c[13:]) >> 1) - c6 := 2097151 & (load4(c[15:]) >> 6) - c7 := 2097151 & (load3(c[18:]) >> 3) - c8 := 2097151 & load3(c[21:]) - c9 := 2097151 & (load4(c[23:]) >> 5) - c10 := 2097151 & (load3(c[26:]) >> 2) - c11 := (load4(c[28:]) >> 7) - var carry [23]int64 - - s0 := c0 + a0*b0 - s1 := c1 + a0*b1 + a1*b0 - s2 := c2 + a0*b2 + a1*b1 + a2*b0 - s3 := c3 + a0*b3 + a1*b2 + a2*b1 + a3*b0 - s4 := c4 + a0*b4 + a1*b3 + a2*b2 + a3*b1 + a4*b0 - s5 := c5 + a0*b5 + a1*b4 + a2*b3 + a3*b2 + a4*b1 + a5*b0 - s6 := c6 + a0*b6 + a1*b5 + a2*b4 + a3*b3 + a4*b2 + a5*b1 + a6*b0 - s7 := c7 + a0*b7 + a1*b6 + a2*b5 + a3*b4 + a4*b3 + a5*b2 + a6*b1 + a7*b0 - s8 := c8 + a0*b8 + a1*b7 + a2*b6 + a3*b5 + a4*b4 + a5*b3 + a6*b2 + a7*b1 + a8*b0 - s9 := c9 + a0*b9 + a1*b8 + a2*b7 + a3*b6 + a4*b5 + a5*b4 + a6*b3 + a7*b2 + a8*b1 + a9*b0 - s10 := c10 + a0*b10 + a1*b9 + a2*b8 + a3*b7 + a4*b6 + a5*b5 + a6*b4 + a7*b3 + a8*b2 + a9*b1 + a10*b0 - s11 := c11 + a0*b11 + a1*b10 + a2*b9 + a3*b8 + a4*b7 + a5*b6 + a6*b5 + a7*b4 + a8*b3 + a9*b2 + a10*b1 + a11*b0 - s12 := a1*b11 + a2*b10 + a3*b9 + a4*b8 + a5*b7 + a6*b6 + a7*b5 + a8*b4 + a9*b3 + a10*b2 + a11*b1 - s13 := a2*b11 + a3*b10 + a4*b9 + a5*b8 + a6*b7 + a7*b6 + a8*b5 + a9*b4 + a10*b3 + a11*b2 - s14 := a3*b11 + a4*b10 + a5*b9 + a6*b8 + a7*b7 + a8*b6 + a9*b5 + a10*b4 + a11*b3 - s15 := a4*b11 + a5*b10 + a6*b9 + a7*b8 + a8*b7 + a9*b6 + a10*b5 + a11*b4 - s16 := a5*b11 + a6*b10 + a7*b9 + a8*b8 + a9*b7 + a10*b6 + a11*b5 - s17 := a6*b11 + a7*b10 + a8*b9 + a9*b8 + a10*b7 + a11*b6 - s18 := a7*b11 + a8*b10 + a9*b9 + a10*b8 + a11*b7 - s19 := a8*b11 + a9*b10 + a10*b9 + a11*b8 - s20 := a9*b11 + a10*b10 + a11*b9 - s21 := a10*b11 + a11*b10 - s22 := a11 * b11 - s23 := int64(0) - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - carry[18] = (s18 + (1 << 20)) >> 21 - s19 += carry[18] - s18 -= carry[18] << 21 - carry[20] = (s20 + (1 << 20)) >> 21 - s21 += carry[20] - s20 -= carry[20] << 21 - carry[22] = (s22 + (1 << 20)) >> 21 - s23 += carry[22] - s22 -= carry[22] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - carry[17] = (s17 + (1 << 20)) >> 21 - s18 += carry[17] - s17 -= carry[17] << 21 - carry[19] = (s19 + (1 << 20)) >> 21 - s20 += carry[19] - s19 -= carry[19] << 21 - carry[21] = (s21 + (1 << 20)) >> 21 - s22 += carry[21] - s21 -= carry[21] << 21 - - s11 += s23 * 666643 - s12 += s23 * 470296 - s13 += s23 * 654183 - s14 -= s23 * 997805 - s15 += s23 * 136657 - s16 -= s23 * 683901 - s23 = 0 - - s10 += s22 * 666643 - s11 += s22 * 470296 - s12 += s22 * 654183 - s13 -= s22 * 997805 - s14 += s22 * 136657 - s15 -= s22 * 683901 - s22 = 0 - - s9 += s21 * 666643 - s10 += s21 * 470296 - s11 += s21 * 654183 - s12 -= s21 * 997805 - s13 += s21 * 136657 - s14 -= s21 * 683901 - s21 = 0 - - s8 += s20 * 666643 - s9 += s20 * 470296 - s10 += s20 * 654183 - s11 -= s20 * 997805 - s12 += s20 * 136657 - s13 -= s20 * 683901 - s20 = 0 - - s7 += s19 * 666643 - s8 += s19 * 470296 - s9 += s19 * 654183 - s10 -= s19 * 997805 - s11 += s19 * 136657 - s12 -= s19 * 683901 - s19 = 0 - - s6 += s18 * 666643 - s7 += s18 * 470296 - s8 += s18 * 654183 - s9 -= s18 * 997805 - s10 += s18 * 136657 - s11 -= s18 * 683901 - s18 = 0 - - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - - s5 += s17 * 666643 - s6 += s17 * 470296 - s7 += s17 * 654183 - s8 -= s17 * 997805 - s9 += s17 * 136657 - s10 -= s17 * 683901 - s17 = 0 - - s4 += s16 * 666643 - s5 += s16 * 470296 - s6 += s16 * 654183 - s7 -= s16 * 997805 - s8 += s16 * 136657 - s9 -= s16 * 683901 - s16 = 0 - - s3 += s15 * 666643 - s4 += s15 * 470296 - s5 += s15 * 654183 - s6 -= s15 * 997805 - s7 += s15 * 136657 - s8 -= s15 * 683901 - s15 = 0 - - s2 += s14 * 666643 - s3 += s14 * 470296 - s4 += s14 * 654183 - s5 -= s14 * 997805 - s6 += s14 * 136657 - s7 -= s14 * 683901 - s14 = 0 - - s1 += s13 * 666643 - s2 += s13 * 470296 - s3 += s13 * 654183 - s4 -= s13 * 997805 - s5 += s13 * 136657 - s6 -= s13 * 683901 - s13 = 0 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[11] = s11 >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - s[0] = byte(s0 >> 0) - s[1] = byte(s0 >> 8) - s[2] = byte((s0 >> 16) | (s1 << 5)) - s[3] = byte(s1 >> 3) - s[4] = byte(s1 >> 11) - s[5] = byte((s1 >> 19) | (s2 << 2)) - s[6] = byte(s2 >> 6) - s[7] = byte((s2 >> 14) | (s3 << 7)) - s[8] = byte(s3 >> 1) - s[9] = byte(s3 >> 9) - s[10] = byte((s3 >> 17) | (s4 << 4)) - s[11] = byte(s4 >> 4) - s[12] = byte(s4 >> 12) - s[13] = byte((s4 >> 20) | (s5 << 1)) - s[14] = byte(s5 >> 7) - s[15] = byte((s5 >> 15) | (s6 << 6)) - s[16] = byte(s6 >> 2) - s[17] = byte(s6 >> 10) - s[18] = byte((s6 >> 18) | (s7 << 3)) - s[19] = byte(s7 >> 5) - s[20] = byte(s7 >> 13) - s[21] = byte(s8 >> 0) - s[22] = byte(s8 >> 8) - s[23] = byte((s8 >> 16) | (s9 << 5)) - s[24] = byte(s9 >> 3) - s[25] = byte(s9 >> 11) - s[26] = byte((s9 >> 19) | (s10 << 2)) - s[27] = byte(s10 >> 6) - s[28] = byte((s10 >> 14) | (s11 << 7)) - s[29] = byte(s11 >> 1) - s[30] = byte(s11 >> 9) - s[31] = byte(s11 >> 17) -} - -// Input: -// s[0]+256*s[1]+...+256^63*s[63] = s -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = s mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -func ScReduce(out *[32]byte, s *[64]byte) { - s0 := 2097151 & load3(s[:]) - s1 := 2097151 & (load4(s[2:]) >> 5) - s2 := 2097151 & (load3(s[5:]) >> 2) - s3 := 2097151 & (load4(s[7:]) >> 7) - s4 := 2097151 & (load4(s[10:]) >> 4) - s5 := 2097151 & (load3(s[13:]) >> 1) - s6 := 2097151 & (load4(s[15:]) >> 6) - s7 := 2097151 & (load3(s[18:]) >> 3) - s8 := 2097151 & load3(s[21:]) - s9 := 2097151 & (load4(s[23:]) >> 5) - s10 := 2097151 & (load3(s[26:]) >> 2) - s11 := 2097151 & (load4(s[28:]) >> 7) - s12 := 2097151 & (load4(s[31:]) >> 4) - s13 := 2097151 & (load3(s[34:]) >> 1) - s14 := 2097151 & (load4(s[36:]) >> 6) - s15 := 2097151 & (load3(s[39:]) >> 3) - s16 := 2097151 & load3(s[42:]) - s17 := 2097151 & (load4(s[44:]) >> 5) - s18 := 2097151 & (load3(s[47:]) >> 2) - s19 := 2097151 & (load4(s[49:]) >> 7) - s20 := 2097151 & (load4(s[52:]) >> 4) - s21 := 2097151 & (load3(s[55:]) >> 1) - s22 := 2097151 & (load4(s[57:]) >> 6) - s23 := (load4(s[60:]) >> 3) - - s11 += s23 * 666643 - s12 += s23 * 470296 - s13 += s23 * 654183 - s14 -= s23 * 997805 - s15 += s23 * 136657 - s16 -= s23 * 683901 - s23 = 0 - - s10 += s22 * 666643 - s11 += s22 * 470296 - s12 += s22 * 654183 - s13 -= s22 * 997805 - s14 += s22 * 136657 - s15 -= s22 * 683901 - s22 = 0 - - s9 += s21 * 666643 - s10 += s21 * 470296 - s11 += s21 * 654183 - s12 -= s21 * 997805 - s13 += s21 * 136657 - s14 -= s21 * 683901 - s21 = 0 - - s8 += s20 * 666643 - s9 += s20 * 470296 - s10 += s20 * 654183 - s11 -= s20 * 997805 - s12 += s20 * 136657 - s13 -= s20 * 683901 - s20 = 0 - - s7 += s19 * 666643 - s8 += s19 * 470296 - s9 += s19 * 654183 - s10 -= s19 * 997805 - s11 += s19 * 136657 - s12 -= s19 * 683901 - s19 = 0 - - s6 += s18 * 666643 - s7 += s18 * 470296 - s8 += s18 * 654183 - s9 -= s18 * 997805 - s10 += s18 * 136657 - s11 -= s18 * 683901 - s18 = 0 - - var carry [17]int64 - - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - - s5 += s17 * 666643 - s6 += s17 * 470296 - s7 += s17 * 654183 - s8 -= s17 * 997805 - s9 += s17 * 136657 - s10 -= s17 * 683901 - s17 = 0 - - s4 += s16 * 666643 - s5 += s16 * 470296 - s6 += s16 * 654183 - s7 -= s16 * 997805 - s8 += s16 * 136657 - s9 -= s16 * 683901 - s16 = 0 - - s3 += s15 * 666643 - s4 += s15 * 470296 - s5 += s15 * 654183 - s6 -= s15 * 997805 - s7 += s15 * 136657 - s8 -= s15 * 683901 - s15 = 0 - - s2 += s14 * 666643 - s3 += s14 * 470296 - s4 += s14 * 654183 - s5 -= s14 * 997805 - s6 += s14 * 136657 - s7 -= s14 * 683901 - s14 = 0 - - s1 += s13 * 666643 - s2 += s13 * 470296 - s3 += s13 * 654183 - s4 -= s13 * 997805 - s5 += s13 * 136657 - s6 -= s13 * 683901 - s13 = 0 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[11] = s11 >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - out[0] = byte(s0 >> 0) - out[1] = byte(s0 >> 8) - out[2] = byte((s0 >> 16) | (s1 << 5)) - out[3] = byte(s1 >> 3) - out[4] = byte(s1 >> 11) - out[5] = byte((s1 >> 19) | (s2 << 2)) - out[6] = byte(s2 >> 6) - out[7] = byte((s2 >> 14) | (s3 << 7)) - out[8] = byte(s3 >> 1) - out[9] = byte(s3 >> 9) - out[10] = byte((s3 >> 17) | (s4 << 4)) - out[11] = byte(s4 >> 4) - out[12] = byte(s4 >> 12) - out[13] = byte((s4 >> 20) | (s5 << 1)) - out[14] = byte(s5 >> 7) - out[15] = byte((s5 >> 15) | (s6 << 6)) - out[16] = byte(s6 >> 2) - out[17] = byte(s6 >> 10) - out[18] = byte((s6 >> 18) | (s7 << 3)) - out[19] = byte(s7 >> 5) - out[20] = byte(s7 >> 13) - out[21] = byte(s8 >> 0) - out[22] = byte(s8 >> 8) - out[23] = byte((s8 >> 16) | (s9 << 5)) - out[24] = byte(s9 >> 3) - out[25] = byte(s9 >> 11) - out[26] = byte((s9 >> 19) | (s10 << 2)) - out[27] = byte(s10 >> 6) - out[28] = byte((s10 >> 14) | (s11 << 7)) - out[29] = byte(s11 >> 1) - out[30] = byte(s11 >> 9) - out[31] = byte(s11 >> 17) -} diff --git a/vendor/golang.org/x/crypto/ocsp/ocsp.go b/vendor/golang.org/x/crypto/ocsp/ocsp.go deleted file mode 100644 index 6b1ffc3..0000000 --- a/vendor/golang.org/x/crypto/ocsp/ocsp.go +++ /dev/null @@ -1,744 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ocsp parses OCSP responses as specified in RFC 2560. OCSP responses -// are signed messages attesting to the validity of a certificate for a small -// period of time. This is used to manage revocation for X.509 certificates. -package ocsp // import "golang.org/x/crypto/ocsp" - -import ( - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - _ "crypto/sha1" - _ "crypto/sha256" - _ "crypto/sha512" - "crypto/x509" - "crypto/x509/pkix" - "encoding/asn1" - "errors" - "fmt" - "math/big" - "strconv" - "time" -) - -var idPKIXOCSPBasic = asn1.ObjectIdentifier([]int{1, 3, 6, 1, 5, 5, 7, 48, 1, 1}) - -// ResponseStatus contains the result of an OCSP request. See -// https://tools.ietf.org/html/rfc6960#section-2.3 -type ResponseStatus int - -const ( - Success ResponseStatus = 0 - Malformed ResponseStatus = 1 - InternalError ResponseStatus = 2 - TryLater ResponseStatus = 3 - // Status code four is unused in OCSP. See - // https://tools.ietf.org/html/rfc6960#section-4.2.1 - SignatureRequired ResponseStatus = 5 - Unauthorized ResponseStatus = 6 -) - -func (r ResponseStatus) String() string { - switch r { - case Success: - return "success" - case Malformed: - return "malformed" - case InternalError: - return "internal error" - case TryLater: - return "try later" - case SignatureRequired: - return "signature required" - case Unauthorized: - return "unauthorized" - default: - return "unknown OCSP status: " + strconv.Itoa(int(r)) - } -} - -// ResponseError is an error that may be returned by ParseResponse to indicate -// that the response itself is an error, not just that its indicating that a -// certificate is revoked, unknown, etc. -type ResponseError struct { - Status ResponseStatus -} - -func (r ResponseError) Error() string { - return "ocsp: error from server: " + r.Status.String() -} - -// These are internal structures that reflect the ASN.1 structure of an OCSP -// response. See RFC 2560, section 4.2. - -type certID struct { - HashAlgorithm pkix.AlgorithmIdentifier - NameHash []byte - IssuerKeyHash []byte - SerialNumber *big.Int -} - -// https://tools.ietf.org/html/rfc2560#section-4.1.1 -type ocspRequest struct { - TBSRequest tbsRequest -} - -type tbsRequest struct { - Version int `asn1:"explicit,tag:0,default:0,optional"` - RequestorName pkix.RDNSequence `asn1:"explicit,tag:1,optional"` - RequestList []request -} - -type request struct { - Cert certID -} - -type responseASN1 struct { - Status asn1.Enumerated - Response responseBytes `asn1:"explicit,tag:0,optional"` -} - -type responseBytes struct { - ResponseType asn1.ObjectIdentifier - Response []byte -} - -type basicResponse struct { - TBSResponseData responseData - SignatureAlgorithm pkix.AlgorithmIdentifier - Signature asn1.BitString - Certificates []asn1.RawValue `asn1:"explicit,tag:0,optional"` -} - -type responseData struct { - Raw asn1.RawContent - Version int `asn1:"optional,default:0,explicit,tag:0"` - RawResponderName asn1.RawValue `asn1:"optional,explicit,tag:1"` - KeyHash []byte `asn1:"optional,explicit,tag:2"` - ProducedAt time.Time `asn1:"generalized"` - Responses []singleResponse -} - -type singleResponse struct { - CertID certID - Good asn1.Flag `asn1:"tag:0,optional"` - Revoked revokedInfo `asn1:"tag:1,optional"` - Unknown asn1.Flag `asn1:"tag:2,optional"` - ThisUpdate time.Time `asn1:"generalized"` - NextUpdate time.Time `asn1:"generalized,explicit,tag:0,optional"` - SingleExtensions []pkix.Extension `asn1:"explicit,tag:1,optional"` -} - -type revokedInfo struct { - RevocationTime time.Time `asn1:"generalized"` - Reason asn1.Enumerated `asn1:"explicit,tag:0,optional"` -} - -var ( - oidSignatureMD2WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 2} - oidSignatureMD5WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 4} - oidSignatureSHA1WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5} - oidSignatureSHA256WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 11} - oidSignatureSHA384WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 12} - oidSignatureSHA512WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 13} - oidSignatureDSAWithSHA1 = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 3} - oidSignatureDSAWithSHA256 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 3, 2} - oidSignatureECDSAWithSHA1 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 1} - oidSignatureECDSAWithSHA256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 2} - oidSignatureECDSAWithSHA384 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 3} - oidSignatureECDSAWithSHA512 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 4} -) - -var hashOIDs = map[crypto.Hash]asn1.ObjectIdentifier{ - crypto.SHA1: asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}), - crypto.SHA256: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 1}), - crypto.SHA384: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 2}), - crypto.SHA512: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 3}), -} - -// TODO(rlb): This is also from crypto/x509, so same comment as AGL's below -var signatureAlgorithmDetails = []struct { - algo x509.SignatureAlgorithm - oid asn1.ObjectIdentifier - pubKeyAlgo x509.PublicKeyAlgorithm - hash crypto.Hash -}{ - {x509.MD2WithRSA, oidSignatureMD2WithRSA, x509.RSA, crypto.Hash(0) /* no value for MD2 */}, - {x509.MD5WithRSA, oidSignatureMD5WithRSA, x509.RSA, crypto.MD5}, - {x509.SHA1WithRSA, oidSignatureSHA1WithRSA, x509.RSA, crypto.SHA1}, - {x509.SHA256WithRSA, oidSignatureSHA256WithRSA, x509.RSA, crypto.SHA256}, - {x509.SHA384WithRSA, oidSignatureSHA384WithRSA, x509.RSA, crypto.SHA384}, - {x509.SHA512WithRSA, oidSignatureSHA512WithRSA, x509.RSA, crypto.SHA512}, - {x509.DSAWithSHA1, oidSignatureDSAWithSHA1, x509.DSA, crypto.SHA1}, - {x509.DSAWithSHA256, oidSignatureDSAWithSHA256, x509.DSA, crypto.SHA256}, - {x509.ECDSAWithSHA1, oidSignatureECDSAWithSHA1, x509.ECDSA, crypto.SHA1}, - {x509.ECDSAWithSHA256, oidSignatureECDSAWithSHA256, x509.ECDSA, crypto.SHA256}, - {x509.ECDSAWithSHA384, oidSignatureECDSAWithSHA384, x509.ECDSA, crypto.SHA384}, - {x509.ECDSAWithSHA512, oidSignatureECDSAWithSHA512, x509.ECDSA, crypto.SHA512}, -} - -// TODO(rlb): This is also from crypto/x509, so same comment as AGL's below -func signingParamsForPublicKey(pub interface{}, requestedSigAlgo x509.SignatureAlgorithm) (hashFunc crypto.Hash, sigAlgo pkix.AlgorithmIdentifier, err error) { - var pubType x509.PublicKeyAlgorithm - - switch pub := pub.(type) { - case *rsa.PublicKey: - pubType = x509.RSA - hashFunc = crypto.SHA256 - sigAlgo.Algorithm = oidSignatureSHA256WithRSA - sigAlgo.Parameters = asn1.RawValue{ - Tag: 5, - } - - case *ecdsa.PublicKey: - pubType = x509.ECDSA - - switch pub.Curve { - case elliptic.P224(), elliptic.P256(): - hashFunc = crypto.SHA256 - sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 - case elliptic.P384(): - hashFunc = crypto.SHA384 - sigAlgo.Algorithm = oidSignatureECDSAWithSHA384 - case elliptic.P521(): - hashFunc = crypto.SHA512 - sigAlgo.Algorithm = oidSignatureECDSAWithSHA512 - default: - err = errors.New("x509: unknown elliptic curve") - } - - default: - err = errors.New("x509: only RSA and ECDSA keys supported") - } - - if err != nil { - return - } - - if requestedSigAlgo == 0 { - return - } - - found := false - for _, details := range signatureAlgorithmDetails { - if details.algo == requestedSigAlgo { - if details.pubKeyAlgo != pubType { - err = errors.New("x509: requested SignatureAlgorithm does not match private key type") - return - } - sigAlgo.Algorithm, hashFunc = details.oid, details.hash - if hashFunc == 0 { - err = errors.New("x509: cannot sign with hash function requested") - return - } - found = true - break - } - } - - if !found { - err = errors.New("x509: unknown SignatureAlgorithm") - } - - return -} - -// TODO(agl): this is taken from crypto/x509 and so should probably be exported -// from crypto/x509 or crypto/x509/pkix. -func getSignatureAlgorithmFromOID(oid asn1.ObjectIdentifier) x509.SignatureAlgorithm { - for _, details := range signatureAlgorithmDetails { - if oid.Equal(details.oid) { - return details.algo - } - } - return x509.UnknownSignatureAlgorithm -} - -// TODO(rlb): This is not taken from crypto/x509, but it's of the same general form. -func getHashAlgorithmFromOID(target asn1.ObjectIdentifier) crypto.Hash { - for hash, oid := range hashOIDs { - if oid.Equal(target) { - return hash - } - } - return crypto.Hash(0) -} - -func getOIDFromHashAlgorithm(target crypto.Hash) asn1.ObjectIdentifier { - for hash, oid := range hashOIDs { - if hash == target { - return oid - } - } - return nil -} - -// This is the exposed reflection of the internal OCSP structures. - -// The status values that can be expressed in OCSP. See RFC 6960. -const ( - // Good means that the certificate is valid. - Good = iota - // Revoked means that the certificate has been deliberately revoked. - Revoked - // Unknown means that the OCSP responder doesn't know about the certificate. - Unknown - // ServerFailed is unused and was never used (see - // https://go-review.googlesource.com/#/c/18944). ParseResponse will - // return a ResponseError when an error response is parsed. - ServerFailed -) - -// The enumerated reasons for revoking a certificate. See RFC 5280. -const ( - Unspecified = iota - KeyCompromise = iota - CACompromise = iota - AffiliationChanged = iota - Superseded = iota - CessationOfOperation = iota - CertificateHold = iota - _ = iota - RemoveFromCRL = iota - PrivilegeWithdrawn = iota - AACompromise = iota -) - -// Request represents an OCSP request. See RFC 6960. -type Request struct { - HashAlgorithm crypto.Hash - IssuerNameHash []byte - IssuerKeyHash []byte - SerialNumber *big.Int -} - -// Marshal marshals the OCSP request to ASN.1 DER encoded form. -func (req *Request) Marshal() ([]byte, error) { - hashAlg := getOIDFromHashAlgorithm(req.HashAlgorithm) - if hashAlg == nil { - return nil, errors.New("Unknown hash algorithm") - } - return asn1.Marshal(ocspRequest{ - tbsRequest{ - Version: 0, - RequestList: []request{ - { - Cert: certID{ - pkix.AlgorithmIdentifier{ - Algorithm: hashAlg, - Parameters: asn1.RawValue{Tag: 5 /* ASN.1 NULL */}, - }, - req.IssuerNameHash, - req.IssuerKeyHash, - req.SerialNumber, - }, - }, - }, - }, - }) -} - -// Response represents an OCSP response containing a single SingleResponse. See -// RFC 6960. -type Response struct { - // Status is one of {Good, Revoked, Unknown} - Status int - SerialNumber *big.Int - ProducedAt, ThisUpdate, NextUpdate, RevokedAt time.Time - RevocationReason int - Certificate *x509.Certificate - // TBSResponseData contains the raw bytes of the signed response. If - // Certificate is nil then this can be used to verify Signature. - TBSResponseData []byte - Signature []byte - SignatureAlgorithm x509.SignatureAlgorithm - - // IssuerHash is the hash used to compute the IssuerNameHash and IssuerKeyHash. - // Valid values are crypto.SHA1, crypto.SHA256, crypto.SHA384, and crypto.SHA512. - // If zero, the default is crypto.SHA1. - IssuerHash crypto.Hash - - // Extensions contains raw X.509 extensions from the singleExtensions field - // of the OCSP response. When parsing certificates, this can be used to - // extract non-critical extensions that are not parsed by this package. When - // marshaling OCSP responses, the Extensions field is ignored, see - // ExtraExtensions. - Extensions []pkix.Extension - - // ExtraExtensions contains extensions to be copied, raw, into any marshaled - // OCSP response (in the singleExtensions field). Values override any - // extensions that would otherwise be produced based on the other fields. The - // ExtraExtensions field is not populated when parsing certificates, see - // Extensions. - ExtraExtensions []pkix.Extension -} - -// These are pre-serialized error responses for the various non-success codes -// defined by OCSP. The Unauthorized code in particular can be used by an OCSP -// responder that supports only pre-signed responses as a response to requests -// for certificates with unknown status. See RFC 5019. -var ( - MalformedRequestErrorResponse = []byte{0x30, 0x03, 0x0A, 0x01, 0x01} - InternalErrorErrorResponse = []byte{0x30, 0x03, 0x0A, 0x01, 0x02} - TryLaterErrorResponse = []byte{0x30, 0x03, 0x0A, 0x01, 0x03} - SigRequredErrorResponse = []byte{0x30, 0x03, 0x0A, 0x01, 0x05} - UnauthorizedErrorResponse = []byte{0x30, 0x03, 0x0A, 0x01, 0x06} -) - -// CheckSignatureFrom checks that the signature in resp is a valid signature -// from issuer. This should only be used if resp.Certificate is nil. Otherwise, -// the OCSP response contained an intermediate certificate that created the -// signature. That signature is checked by ParseResponse and only -// resp.Certificate remains to be validated. -func (resp *Response) CheckSignatureFrom(issuer *x509.Certificate) error { - return issuer.CheckSignature(resp.SignatureAlgorithm, resp.TBSResponseData, resp.Signature) -} - -// ParseError results from an invalid OCSP response. -type ParseError string - -func (p ParseError) Error() string { - return string(p) -} - -// ParseRequest parses an OCSP request in DER form. It only supports -// requests for a single certificate. Signed requests are not supported. -// If a request includes a signature, it will result in a ParseError. -func ParseRequest(bytes []byte) (*Request, error) { - var req ocspRequest - rest, err := asn1.Unmarshal(bytes, &req) - if err != nil { - return nil, err - } - if len(rest) > 0 { - return nil, ParseError("trailing data in OCSP request") - } - - if len(req.TBSRequest.RequestList) == 0 { - return nil, ParseError("OCSP request contains no request body") - } - innerRequest := req.TBSRequest.RequestList[0] - - hashFunc := getHashAlgorithmFromOID(innerRequest.Cert.HashAlgorithm.Algorithm) - if hashFunc == crypto.Hash(0) { - return nil, ParseError("OCSP request uses unknown hash function") - } - - return &Request{ - HashAlgorithm: hashFunc, - IssuerNameHash: innerRequest.Cert.NameHash, - IssuerKeyHash: innerRequest.Cert.IssuerKeyHash, - SerialNumber: innerRequest.Cert.SerialNumber, - }, nil -} - -// ParseResponse parses an OCSP response in DER form. It only supports -// responses for a single certificate. If the response contains a certificate -// then the signature over the response is checked. If issuer is not nil then -// it will be used to validate the signature or embedded certificate. -// -// Invalid signatures or parse failures will result in a ParseError. Error -// responses will result in a ResponseError. -func ParseResponse(bytes []byte, issuer *x509.Certificate) (*Response, error) { - return ParseResponseForCert(bytes, nil, issuer) -} - -// ParseResponseForCert parses an OCSP response in DER form and searches for a -// Response relating to cert. If such a Response is found and the OCSP response -// contains a certificate then the signature over the response is checked. If -// issuer is not nil then it will be used to validate the signature or embedded -// certificate. -// -// Invalid signatures or parse failures will result in a ParseError. Error -// responses will result in a ResponseError. -func ParseResponseForCert(bytes []byte, cert, issuer *x509.Certificate) (*Response, error) { - var resp responseASN1 - rest, err := asn1.Unmarshal(bytes, &resp) - if err != nil { - return nil, err - } - if len(rest) > 0 { - return nil, ParseError("trailing data in OCSP response") - } - - if status := ResponseStatus(resp.Status); status != Success { - return nil, ResponseError{status} - } - - if !resp.Response.ResponseType.Equal(idPKIXOCSPBasic) { - return nil, ParseError("bad OCSP response type") - } - - var basicResp basicResponse - rest, err = asn1.Unmarshal(resp.Response.Response, &basicResp) - if err != nil { - return nil, err - } - - if len(basicResp.Certificates) > 1 { - return nil, ParseError("OCSP response contains bad number of certificates") - } - - if n := len(basicResp.TBSResponseData.Responses); n == 0 || cert == nil && n > 1 { - return nil, ParseError("OCSP response contains bad number of responses") - } - - ret := &Response{ - TBSResponseData: basicResp.TBSResponseData.Raw, - Signature: basicResp.Signature.RightAlign(), - SignatureAlgorithm: getSignatureAlgorithmFromOID(basicResp.SignatureAlgorithm.Algorithm), - } - - if len(basicResp.Certificates) > 0 { - ret.Certificate, err = x509.ParseCertificate(basicResp.Certificates[0].FullBytes) - if err != nil { - return nil, err - } - - if err := ret.CheckSignatureFrom(ret.Certificate); err != nil { - return nil, ParseError("bad OCSP signature") - } - - if issuer != nil { - if err := issuer.CheckSignature(ret.Certificate.SignatureAlgorithm, ret.Certificate.RawTBSCertificate, ret.Certificate.Signature); err != nil { - return nil, ParseError("bad signature on embedded certificate") - } - } - } else if issuer != nil { - if err := ret.CheckSignatureFrom(issuer); err != nil { - return nil, ParseError("bad OCSP signature") - } - } - - var r singleResponse - for _, resp := range basicResp.TBSResponseData.Responses { - if cert == nil || cert.SerialNumber.Cmp(resp.CertID.SerialNumber) == 0 { - r = resp - break - } - } - - for _, ext := range r.SingleExtensions { - if ext.Critical { - return nil, ParseError("unsupported critical extension") - } - } - ret.Extensions = r.SingleExtensions - - ret.SerialNumber = r.CertID.SerialNumber - - for h, oid := range hashOIDs { - if r.CertID.HashAlgorithm.Algorithm.Equal(oid) { - ret.IssuerHash = h - break - } - } - if ret.IssuerHash == 0 { - return nil, ParseError("unsupported issuer hash algorithm") - } - - switch { - case bool(r.Good): - ret.Status = Good - case bool(r.Unknown): - ret.Status = Unknown - default: - ret.Status = Revoked - ret.RevokedAt = r.Revoked.RevocationTime - ret.RevocationReason = int(r.Revoked.Reason) - } - - ret.ProducedAt = basicResp.TBSResponseData.ProducedAt - ret.ThisUpdate = r.ThisUpdate - ret.NextUpdate = r.NextUpdate - - return ret, nil -} - -// RequestOptions contains options for constructing OCSP requests. -type RequestOptions struct { - // Hash contains the hash function that should be used when - // constructing the OCSP request. If zero, SHA-1 will be used. - Hash crypto.Hash -} - -func (opts *RequestOptions) hash() crypto.Hash { - if opts == nil || opts.Hash == 0 { - // SHA-1 is nearly universally used in OCSP. - return crypto.SHA1 - } - return opts.Hash -} - -// CreateRequest returns a DER-encoded, OCSP request for the status of cert. If -// opts is nil then sensible defaults are used. -func CreateRequest(cert, issuer *x509.Certificate, opts *RequestOptions) ([]byte, error) { - hashFunc := opts.hash() - - // OCSP seems to be the only place where these raw hash identifiers are - // used. I took the following from - // http://msdn.microsoft.com/en-us/library/ff635603.aspx - _, ok := hashOIDs[hashFunc] - if !ok { - return nil, x509.ErrUnsupportedAlgorithm - } - - if !hashFunc.Available() { - return nil, x509.ErrUnsupportedAlgorithm - } - h := opts.hash().New() - - var publicKeyInfo struct { - Algorithm pkix.AlgorithmIdentifier - PublicKey asn1.BitString - } - if _, err := asn1.Unmarshal(issuer.RawSubjectPublicKeyInfo, &publicKeyInfo); err != nil { - return nil, err - } - - h.Write(publicKeyInfo.PublicKey.RightAlign()) - issuerKeyHash := h.Sum(nil) - - h.Reset() - h.Write(issuer.RawSubject) - issuerNameHash := h.Sum(nil) - - req := &Request{ - HashAlgorithm: hashFunc, - IssuerNameHash: issuerNameHash, - IssuerKeyHash: issuerKeyHash, - SerialNumber: cert.SerialNumber, - } - return req.Marshal() -} - -// CreateResponse returns a DER-encoded OCSP response with the specified contents. -// The fields in the response are populated as follows: -// -// The responder cert is used to populate the ResponderName field, and the certificate -// itself is provided alongside the OCSP response signature. -// -// The issuer cert is used to puplate the IssuerNameHash and IssuerKeyHash fields. -// -// The template is used to populate the SerialNumber, RevocationStatus, RevokedAt, -// RevocationReason, ThisUpdate, and NextUpdate fields. -// -// If template.IssuerHash is not set, SHA1 will be used. -// -// The ProducedAt date is automatically set to the current date, to the nearest minute. -func CreateResponse(issuer, responderCert *x509.Certificate, template Response, priv crypto.Signer) ([]byte, error) { - var publicKeyInfo struct { - Algorithm pkix.AlgorithmIdentifier - PublicKey asn1.BitString - } - if _, err := asn1.Unmarshal(issuer.RawSubjectPublicKeyInfo, &publicKeyInfo); err != nil { - return nil, err - } - - if template.IssuerHash == 0 { - template.IssuerHash = crypto.SHA1 - } - hashOID := getOIDFromHashAlgorithm(template.IssuerHash) - if hashOID == nil { - return nil, errors.New("unsupported issuer hash algorithm") - } - - if !template.IssuerHash.Available() { - return nil, fmt.Errorf("issuer hash algorithm %v not linked into binarya", template.IssuerHash) - } - h := template.IssuerHash.New() - h.Write(publicKeyInfo.PublicKey.RightAlign()) - issuerKeyHash := h.Sum(nil) - - h.Reset() - h.Write(issuer.RawSubject) - issuerNameHash := h.Sum(nil) - - innerResponse := singleResponse{ - CertID: certID{ - HashAlgorithm: pkix.AlgorithmIdentifier{ - Algorithm: hashOID, - Parameters: asn1.RawValue{Tag: 5 /* ASN.1 NULL */}, - }, - NameHash: issuerNameHash, - IssuerKeyHash: issuerKeyHash, - SerialNumber: template.SerialNumber, - }, - ThisUpdate: template.ThisUpdate.UTC(), - NextUpdate: template.NextUpdate.UTC(), - SingleExtensions: template.ExtraExtensions, - } - - switch template.Status { - case Good: - innerResponse.Good = true - case Unknown: - innerResponse.Unknown = true - case Revoked: - innerResponse.Revoked = revokedInfo{ - RevocationTime: template.RevokedAt.UTC(), - Reason: asn1.Enumerated(template.RevocationReason), - } - } - - responderName := asn1.RawValue{ - Class: 2, // context-specific - Tag: 1, // explicit tag - IsCompound: true, - Bytes: responderCert.RawSubject, - } - tbsResponseData := responseData{ - Version: 0, - RawResponderName: responderName, - ProducedAt: time.Now().Truncate(time.Minute).UTC(), - Responses: []singleResponse{innerResponse}, - } - - tbsResponseDataDER, err := asn1.Marshal(tbsResponseData) - if err != nil { - return nil, err - } - - hashFunc, signatureAlgorithm, err := signingParamsForPublicKey(priv.Public(), template.SignatureAlgorithm) - if err != nil { - return nil, err - } - - responseHash := hashFunc.New() - responseHash.Write(tbsResponseDataDER) - signature, err := priv.Sign(rand.Reader, responseHash.Sum(nil), hashFunc) - if err != nil { - return nil, err - } - - response := basicResponse{ - TBSResponseData: tbsResponseData, - SignatureAlgorithm: signatureAlgorithm, - Signature: asn1.BitString{ - Bytes: signature, - BitLength: 8 * len(signature), - }, - } - if template.Certificate != nil { - response.Certificates = []asn1.RawValue{ - asn1.RawValue{FullBytes: template.Certificate.Raw}, - } - } - responseDER, err := asn1.Marshal(response) - if err != nil { - return nil, err - } - - return asn1.Marshal(responseASN1{ - Status: asn1.Enumerated(Success), - Response: responseBytes{ - ResponseType: idPKIXOCSPBasic, - Response: responseDER, - }, - }) -} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go similarity index 94% rename from vendor/github.com/keybase/go-crypto/openpgp/armor/armor.go rename to vendor/golang.org/x/crypto/openpgp/armor/armor.go index d7d81ba..592d186 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/armor/armor.go +++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go @@ -4,16 +4,14 @@ // Package armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is // very similar to PEM except that it has an additional CRC checksum. -package armor // import "github.com/keybase/go-crypto/openpgp/armor" +package armor // import "golang.org/x/crypto/openpgp/armor" import ( "bufio" "bytes" "encoding/base64" + "golang.org/x/crypto/openpgp/errors" "io" - "strings" - - "github.com/keybase/go-crypto/openpgp/errors" ) // A Block represents an OpenPGP armored structure. @@ -101,14 +99,9 @@ func (l *lineReader) Read(p []byte) (n int, err error) { uint32(expectedBytes[1])<<8 | uint32(expectedBytes[2]) - for { - line, _, err = l.in.ReadLine() - if err != nil && err != io.EOF { - return - } - if len(strings.TrimSpace(string(line))) > 0 { - break - } + line, _, err = l.in.ReadLine() + if err != nil && err != io.EOF { + return } if !bytes.HasPrefix(line, armorEnd) { return 0, ArmorCorrupt diff --git a/vendor/golang.org/x/crypto/openpgp/armor/encode.go b/vendor/golang.org/x/crypto/openpgp/armor/encode.go new file mode 100644 index 0000000..6f07582 --- /dev/null +++ b/vendor/golang.org/x/crypto/openpgp/armor/encode.go @@ -0,0 +1,160 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package armor + +import ( + "encoding/base64" + "io" +) + +var armorHeaderSep = []byte(": ") +var blockEnd = []byte("\n=") +var newline = []byte("\n") +var armorEndOfLineOut = []byte("-----\n") + +// writeSlices writes its arguments to the given Writer. +func writeSlices(out io.Writer, slices ...[]byte) (err error) { + for _, s := range slices { + _, err = out.Write(s) + if err != nil { + return err + } + } + return +} + +// lineBreaker breaks data across several lines, all of the same byte length +// (except possibly the last). Lines are broken with a single '\n'. +type lineBreaker struct { + lineLength int + line []byte + used int + out io.Writer + haveWritten bool +} + +func newLineBreaker(out io.Writer, lineLength int) *lineBreaker { + return &lineBreaker{ + lineLength: lineLength, + line: make([]byte, lineLength), + used: 0, + out: out, + } +} + +func (l *lineBreaker) Write(b []byte) (n int, err error) { + n = len(b) + + if n == 0 { + return + } + + if l.used == 0 && l.haveWritten { + _, err = l.out.Write([]byte{'\n'}) + if err != nil { + return + } + } + + if l.used+len(b) < l.lineLength { + l.used += copy(l.line[l.used:], b) + return + } + + l.haveWritten = true + _, err = l.out.Write(l.line[0:l.used]) + if err != nil { + return + } + excess := l.lineLength - l.used + l.used = 0 + + _, err = l.out.Write(b[0:excess]) + if err != nil { + return + } + + _, err = l.Write(b[excess:]) + return +} + +func (l *lineBreaker) Close() (err error) { + if l.used > 0 { + _, err = l.out.Write(l.line[0:l.used]) + if err != nil { + return + } + } + + return +} + +// encoding keeps track of a running CRC24 over the data which has been written +// to it and outputs a OpenPGP checksum when closed, followed by an armor +// trailer. +// +// It's built into a stack of io.Writers: +// encoding -> base64 encoder -> lineBreaker -> out +type encoding struct { + out io.Writer + breaker *lineBreaker + b64 io.WriteCloser + crc uint32 + blockType []byte +} + +func (e *encoding) Write(data []byte) (n int, err error) { + e.crc = crc24(e.crc, data) + return e.b64.Write(data) +} + +func (e *encoding) Close() (err error) { + err = e.b64.Close() + if err != nil { + return + } + e.breaker.Close() + + var checksumBytes [3]byte + checksumBytes[0] = byte(e.crc >> 16) + checksumBytes[1] = byte(e.crc >> 8) + checksumBytes[2] = byte(e.crc) + + var b64ChecksumBytes [4]byte + base64.StdEncoding.Encode(b64ChecksumBytes[:], checksumBytes[:]) + + return writeSlices(e.out, blockEnd, b64ChecksumBytes[:], newline, armorEnd, e.blockType, armorEndOfLine) +} + +// Encode returns a WriteCloser which will encode the data written to it in +// OpenPGP armor. +func Encode(out io.Writer, blockType string, headers map[string]string) (w io.WriteCloser, err error) { + bType := []byte(blockType) + err = writeSlices(out, armorStart, bType, armorEndOfLineOut) + if err != nil { + return + } + + for k, v := range headers { + err = writeSlices(out, []byte(k), armorHeaderSep, []byte(v), newline) + if err != nil { + return + } + } + + _, err = out.Write(newline) + if err != nil { + return + } + + e := &encoding{ + out: out, + breaker: newLineBreaker(out, 64), + crc: crc24Init, + blockType: bType, + } + e.b64 = base64.NewEncoder(base64.StdEncoding, e.breaker) + return e, nil +} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/canonical_text.go b/vendor/golang.org/x/crypto/openpgp/canonical_text.go similarity index 100% rename from vendor/github.com/keybase/go-crypto/openpgp/canonical_text.go rename to vendor/golang.org/x/crypto/openpgp/canonical_text.go diff --git a/vendor/github.com/keybase/go-crypto/openpgp/elgamal/elgamal.go b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go similarity index 97% rename from vendor/github.com/keybase/go-crypto/openpgp/elgamal/elgamal.go rename to vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go index 15dafc5..73f4fe3 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/elgamal/elgamal.go +++ b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go @@ -10,7 +10,7 @@ // This form of ElGamal embeds PKCS#1 v1.5 padding, which may make it // unsuitable for other protocols. RSA should be used in preference in any // case. -package elgamal // import "github.com/keybase/go-crypto/openpgp/elgamal" +package elgamal // import "golang.org/x/crypto/openpgp/elgamal" import ( "crypto/rand" diff --git a/vendor/golang.org/x/crypto/openpgp/errors/errors.go b/vendor/golang.org/x/crypto/openpgp/errors/errors.go new file mode 100644 index 0000000..eb0550b --- /dev/null +++ b/vendor/golang.org/x/crypto/openpgp/errors/errors.go @@ -0,0 +1,72 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package errors contains common error types for the OpenPGP packages. +package errors // import "golang.org/x/crypto/openpgp/errors" + +import ( + "strconv" +) + +// A StructuralError is returned when OpenPGP data is found to be syntactically +// invalid. +type StructuralError string + +func (s StructuralError) Error() string { + return "openpgp: invalid data: " + string(s) +} + +// UnsupportedError indicates that, although the OpenPGP data is valid, it +// makes use of currently unimplemented features. +type UnsupportedError string + +func (s UnsupportedError) Error() string { + return "openpgp: unsupported feature: " + string(s) +} + +// InvalidArgumentError indicates that the caller is in error and passed an +// incorrect value. +type InvalidArgumentError string + +func (i InvalidArgumentError) Error() string { + return "openpgp: invalid argument: " + string(i) +} + +// SignatureError indicates that a syntactically valid signature failed to +// validate. +type SignatureError string + +func (b SignatureError) Error() string { + return "openpgp: invalid signature: " + string(b) +} + +type keyIncorrectError int + +func (ki keyIncorrectError) Error() string { + return "openpgp: incorrect key" +} + +var ErrKeyIncorrect error = keyIncorrectError(0) + +type unknownIssuerError int + +func (unknownIssuerError) Error() string { + return "openpgp: signature made by unknown entity" +} + +var ErrUnknownIssuer error = unknownIssuerError(0) + +type keyRevokedError int + +func (keyRevokedError) Error() string { + return "openpgp: signature made by revoked key" +} + +var ErrKeyRevoked error = keyRevokedError(0) + +type UnknownPacketTypeError uint8 + +func (upte UnknownPacketTypeError) Error() string { + return "openpgp: unknown packet type: " + strconv.Itoa(int(upte)) +} diff --git a/vendor/golang.org/x/crypto/openpgp/keys.go b/vendor/golang.org/x/crypto/openpgp/keys.go new file mode 100644 index 0000000..68b14c6 --- /dev/null +++ b/vendor/golang.org/x/crypto/openpgp/keys.go @@ -0,0 +1,637 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package openpgp + +import ( + "crypto/rsa" + "io" + "time" + + "golang.org/x/crypto/openpgp/armor" + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/packet" +) + +// PublicKeyType is the armor type for a PGP public key. +var PublicKeyType = "PGP PUBLIC KEY BLOCK" + +// PrivateKeyType is the armor type for a PGP private key. +var PrivateKeyType = "PGP PRIVATE KEY BLOCK" + +// An Entity represents the components of an OpenPGP key: a primary public key +// (which must be a signing key), one or more identities claimed by that key, +// and zero or more subkeys, which may be encryption keys. +type Entity struct { + PrimaryKey *packet.PublicKey + PrivateKey *packet.PrivateKey + Identities map[string]*Identity // indexed by Identity.Name + Revocations []*packet.Signature + Subkeys []Subkey +} + +// An Identity represents an identity claimed by an Entity and zero or more +// assertions by other entities about that claim. +type Identity struct { + Name string // by convention, has the form "Full Name (comment) " + UserId *packet.UserId + SelfSignature *packet.Signature + Signatures []*packet.Signature +} + +// A Subkey is an additional public key in an Entity. Subkeys can be used for +// encryption. +type Subkey struct { + PublicKey *packet.PublicKey + PrivateKey *packet.PrivateKey + Sig *packet.Signature +} + +// A Key identifies a specific public key in an Entity. This is either the +// Entity's primary key or a subkey. +type Key struct { + Entity *Entity + PublicKey *packet.PublicKey + PrivateKey *packet.PrivateKey + SelfSignature *packet.Signature +} + +// A KeyRing provides access to public and private keys. +type KeyRing interface { + // KeysById returns the set of keys that have the given key id. + KeysById(id uint64) []Key + // KeysByIdAndUsage returns the set of keys with the given id + // that also meet the key usage given by requiredUsage. + // The requiredUsage is expressed as the bitwise-OR of + // packet.KeyFlag* values. + KeysByIdUsage(id uint64, requiredUsage byte) []Key + // DecryptionKeys returns all private keys that are valid for + // decryption. + DecryptionKeys() []Key +} + +// primaryIdentity returns the Identity marked as primary or the first identity +// if none are so marked. +func (e *Entity) primaryIdentity() *Identity { + var firstIdentity *Identity + for _, ident := range e.Identities { + if firstIdentity == nil { + firstIdentity = ident + } + if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId { + return ident + } + } + return firstIdentity +} + +// encryptionKey returns the best candidate Key for encrypting a message to the +// given Entity. +func (e *Entity) encryptionKey(now time.Time) (Key, bool) { + candidateSubkey := -1 + + // Iterate the keys to find the newest key + var maxTime time.Time + for i, subkey := range e.Subkeys { + if subkey.Sig.FlagsValid && + subkey.Sig.FlagEncryptCommunications && + subkey.PublicKey.PubKeyAlgo.CanEncrypt() && + !subkey.Sig.KeyExpired(now) && + (maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) { + candidateSubkey = i + maxTime = subkey.Sig.CreationTime + } + } + + if candidateSubkey != -1 { + subkey := e.Subkeys[candidateSubkey] + return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true + } + + // If we don't have any candidate subkeys for encryption and + // the primary key doesn't have any usage metadata then we + // assume that the primary key is ok. Or, if the primary key is + // marked as ok to encrypt to, then we can obviously use it. + i := e.primaryIdentity() + if !i.SelfSignature.FlagsValid || i.SelfSignature.FlagEncryptCommunications && + e.PrimaryKey.PubKeyAlgo.CanEncrypt() && + !i.SelfSignature.KeyExpired(now) { + return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true + } + + // This Entity appears to be signing only. + return Key{}, false +} + +// signingKey return the best candidate Key for signing a message with this +// Entity. +func (e *Entity) signingKey(now time.Time) (Key, bool) { + candidateSubkey := -1 + + for i, subkey := range e.Subkeys { + if subkey.Sig.FlagsValid && + subkey.Sig.FlagSign && + subkey.PublicKey.PubKeyAlgo.CanSign() && + !subkey.Sig.KeyExpired(now) { + candidateSubkey = i + break + } + } + + if candidateSubkey != -1 { + subkey := e.Subkeys[candidateSubkey] + return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true + } + + // If we have no candidate subkey then we assume that it's ok to sign + // with the primary key. + i := e.primaryIdentity() + if !i.SelfSignature.FlagsValid || i.SelfSignature.FlagSign && + !i.SelfSignature.KeyExpired(now) { + return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true + } + + return Key{}, false +} + +// An EntityList contains one or more Entities. +type EntityList []*Entity + +// KeysById returns the set of keys that have the given key id. +func (el EntityList) KeysById(id uint64) (keys []Key) { + for _, e := range el { + if e.PrimaryKey.KeyId == id { + var selfSig *packet.Signature + for _, ident := range e.Identities { + if selfSig == nil { + selfSig = ident.SelfSignature + } else if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId { + selfSig = ident.SelfSignature + break + } + } + keys = append(keys, Key{e, e.PrimaryKey, e.PrivateKey, selfSig}) + } + + for _, subKey := range e.Subkeys { + if subKey.PublicKey.KeyId == id { + keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig}) + } + } + } + return +} + +// KeysByIdAndUsage returns the set of keys with the given id that also meet +// the key usage given by requiredUsage. The requiredUsage is expressed as +// the bitwise-OR of packet.KeyFlag* values. +func (el EntityList) KeysByIdUsage(id uint64, requiredUsage byte) (keys []Key) { + for _, key := range el.KeysById(id) { + if len(key.Entity.Revocations) > 0 { + continue + } + + if key.SelfSignature.RevocationReason != nil { + continue + } + + if key.SelfSignature.FlagsValid && requiredUsage != 0 { + var usage byte + if key.SelfSignature.FlagCertify { + usage |= packet.KeyFlagCertify + } + if key.SelfSignature.FlagSign { + usage |= packet.KeyFlagSign + } + if key.SelfSignature.FlagEncryptCommunications { + usage |= packet.KeyFlagEncryptCommunications + } + if key.SelfSignature.FlagEncryptStorage { + usage |= packet.KeyFlagEncryptStorage + } + if usage&requiredUsage != requiredUsage { + continue + } + } + + keys = append(keys, key) + } + return +} + +// DecryptionKeys returns all private keys that are valid for decryption. +func (el EntityList) DecryptionKeys() (keys []Key) { + for _, e := range el { + for _, subKey := range e.Subkeys { + if subKey.PrivateKey != nil && (!subKey.Sig.FlagsValid || subKey.Sig.FlagEncryptStorage || subKey.Sig.FlagEncryptCommunications) { + keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig}) + } + } + } + return +} + +// ReadArmoredKeyRing reads one or more public/private keys from an armor keyring file. +func ReadArmoredKeyRing(r io.Reader) (EntityList, error) { + block, err := armor.Decode(r) + if err == io.EOF { + return nil, errors.InvalidArgumentError("no armored data found") + } + if err != nil { + return nil, err + } + if block.Type != PublicKeyType && block.Type != PrivateKeyType { + return nil, errors.InvalidArgumentError("expected public or private key block, got: " + block.Type) + } + + return ReadKeyRing(block.Body) +} + +// ReadKeyRing reads one or more public/private keys. Unsupported keys are +// ignored as long as at least a single valid key is found. +func ReadKeyRing(r io.Reader) (el EntityList, err error) { + packets := packet.NewReader(r) + var lastUnsupportedError error + + for { + var e *Entity + e, err = ReadEntity(packets) + if err != nil { + // TODO: warn about skipped unsupported/unreadable keys + if _, ok := err.(errors.UnsupportedError); ok { + lastUnsupportedError = err + err = readToNextPublicKey(packets) + } else if _, ok := err.(errors.StructuralError); ok { + // Skip unreadable, badly-formatted keys + lastUnsupportedError = err + err = readToNextPublicKey(packets) + } + if err == io.EOF { + err = nil + break + } + if err != nil { + el = nil + break + } + } else { + el = append(el, e) + } + } + + if len(el) == 0 && err == nil { + err = lastUnsupportedError + } + return +} + +// readToNextPublicKey reads packets until the start of the entity and leaves +// the first packet of the new entity in the Reader. +func readToNextPublicKey(packets *packet.Reader) (err error) { + var p packet.Packet + for { + p, err = packets.Next() + if err == io.EOF { + return + } else if err != nil { + if _, ok := err.(errors.UnsupportedError); ok { + err = nil + continue + } + return + } + + if pk, ok := p.(*packet.PublicKey); ok && !pk.IsSubkey { + packets.Unread(p) + return + } + } +} + +// ReadEntity reads an entity (public key, identities, subkeys etc) from the +// given Reader. +func ReadEntity(packets *packet.Reader) (*Entity, error) { + e := new(Entity) + e.Identities = make(map[string]*Identity) + + p, err := packets.Next() + if err != nil { + return nil, err + } + + var ok bool + if e.PrimaryKey, ok = p.(*packet.PublicKey); !ok { + if e.PrivateKey, ok = p.(*packet.PrivateKey); !ok { + packets.Unread(p) + return nil, errors.StructuralError("first packet was not a public/private key") + } else { + e.PrimaryKey = &e.PrivateKey.PublicKey + } + } + + if !e.PrimaryKey.PubKeyAlgo.CanSign() { + return nil, errors.StructuralError("primary key cannot be used for signatures") + } + + var current *Identity + var revocations []*packet.Signature +EachPacket: + for { + p, err := packets.Next() + if err == io.EOF { + break + } else if err != nil { + return nil, err + } + + switch pkt := p.(type) { + case *packet.UserId: + current = new(Identity) + current.Name = pkt.Id + current.UserId = pkt + e.Identities[pkt.Id] = current + + for { + p, err = packets.Next() + if err == io.EOF { + return nil, io.ErrUnexpectedEOF + } else if err != nil { + return nil, err + } + + sig, ok := p.(*packet.Signature) + if !ok { + return nil, errors.StructuralError("user ID packet not followed by self-signature") + } + + if (sig.SigType == packet.SigTypePositiveCert || sig.SigType == packet.SigTypeGenericCert) && sig.IssuerKeyId != nil && *sig.IssuerKeyId == e.PrimaryKey.KeyId { + if err = e.PrimaryKey.VerifyUserIdSignature(pkt.Id, e.PrimaryKey, sig); err != nil { + return nil, errors.StructuralError("user ID self-signature invalid: " + err.Error()) + } + current.SelfSignature = sig + break + } + current.Signatures = append(current.Signatures, sig) + } + case *packet.Signature: + if pkt.SigType == packet.SigTypeKeyRevocation { + revocations = append(revocations, pkt) + } else if pkt.SigType == packet.SigTypeDirectSignature { + // TODO: RFC4880 5.2.1 permits signatures + // directly on keys (eg. to bind additional + // revocation keys). + } else if current == nil { + return nil, errors.StructuralError("signature packet found before user id packet") + } else { + current.Signatures = append(current.Signatures, pkt) + } + case *packet.PrivateKey: + if pkt.IsSubkey == false { + packets.Unread(p) + break EachPacket + } + err = addSubkey(e, packets, &pkt.PublicKey, pkt) + if err != nil { + return nil, err + } + case *packet.PublicKey: + if pkt.IsSubkey == false { + packets.Unread(p) + break EachPacket + } + err = addSubkey(e, packets, pkt, nil) + if err != nil { + return nil, err + } + default: + // we ignore unknown packets + } + } + + if len(e.Identities) == 0 { + return nil, errors.StructuralError("entity without any identities") + } + + for _, revocation := range revocations { + err = e.PrimaryKey.VerifyRevocationSignature(revocation) + if err == nil { + e.Revocations = append(e.Revocations, revocation) + } else { + // TODO: RFC 4880 5.2.3.15 defines revocation keys. + return nil, errors.StructuralError("revocation signature signed by alternate key") + } + } + + return e, nil +} + +func addSubkey(e *Entity, packets *packet.Reader, pub *packet.PublicKey, priv *packet.PrivateKey) error { + var subKey Subkey + subKey.PublicKey = pub + subKey.PrivateKey = priv + p, err := packets.Next() + if err == io.EOF { + return io.ErrUnexpectedEOF + } + if err != nil { + return errors.StructuralError("subkey signature invalid: " + err.Error()) + } + var ok bool + subKey.Sig, ok = p.(*packet.Signature) + if !ok { + return errors.StructuralError("subkey packet not followed by signature") + } + if subKey.Sig.SigType != packet.SigTypeSubkeyBinding && subKey.Sig.SigType != packet.SigTypeSubkeyRevocation { + return errors.StructuralError("subkey signature with wrong type") + } + err = e.PrimaryKey.VerifyKeySignature(subKey.PublicKey, subKey.Sig) + if err != nil { + return errors.StructuralError("subkey signature invalid: " + err.Error()) + } + e.Subkeys = append(e.Subkeys, subKey) + return nil +} + +const defaultRSAKeyBits = 2048 + +// NewEntity returns an Entity that contains a fresh RSA/RSA keypair with a +// single identity composed of the given full name, comment and email, any of +// which may be empty but must not contain any of "()<>\x00". +// If config is nil, sensible defaults will be used. +func NewEntity(name, comment, email string, config *packet.Config) (*Entity, error) { + currentTime := config.Now() + + bits := defaultRSAKeyBits + if config != nil && config.RSABits != 0 { + bits = config.RSABits + } + + uid := packet.NewUserId(name, comment, email) + if uid == nil { + return nil, errors.InvalidArgumentError("user id field contained invalid characters") + } + signingPriv, err := rsa.GenerateKey(config.Random(), bits) + if err != nil { + return nil, err + } + encryptingPriv, err := rsa.GenerateKey(config.Random(), bits) + if err != nil { + return nil, err + } + + e := &Entity{ + PrimaryKey: packet.NewRSAPublicKey(currentTime, &signingPriv.PublicKey), + PrivateKey: packet.NewRSAPrivateKey(currentTime, signingPriv), + Identities: make(map[string]*Identity), + } + isPrimaryId := true + e.Identities[uid.Id] = &Identity{ + Name: uid.Name, + UserId: uid, + SelfSignature: &packet.Signature{ + CreationTime: currentTime, + SigType: packet.SigTypePositiveCert, + PubKeyAlgo: packet.PubKeyAlgoRSA, + Hash: config.Hash(), + IsPrimaryId: &isPrimaryId, + FlagsValid: true, + FlagSign: true, + FlagCertify: true, + IssuerKeyId: &e.PrimaryKey.KeyId, + }, + } + + // If the user passes in a DefaultHash via packet.Config, + // set the PreferredHash for the SelfSignature. + if config != nil && config.DefaultHash != 0 { + e.Identities[uid.Id].SelfSignature.PreferredHash = []uint8{hashToHashId(config.DefaultHash)} + } + + e.Subkeys = make([]Subkey, 1) + e.Subkeys[0] = Subkey{ + PublicKey: packet.NewRSAPublicKey(currentTime, &encryptingPriv.PublicKey), + PrivateKey: packet.NewRSAPrivateKey(currentTime, encryptingPriv), + Sig: &packet.Signature{ + CreationTime: currentTime, + SigType: packet.SigTypeSubkeyBinding, + PubKeyAlgo: packet.PubKeyAlgoRSA, + Hash: config.Hash(), + FlagsValid: true, + FlagEncryptStorage: true, + FlagEncryptCommunications: true, + IssuerKeyId: &e.PrimaryKey.KeyId, + }, + } + e.Subkeys[0].PublicKey.IsSubkey = true + e.Subkeys[0].PrivateKey.IsSubkey = true + + return e, nil +} + +// SerializePrivate serializes an Entity, including private key material, to +// the given Writer. For now, it must only be used on an Entity returned from +// NewEntity. +// If config is nil, sensible defaults will be used. +func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) { + err = e.PrivateKey.Serialize(w) + if err != nil { + return + } + for _, ident := range e.Identities { + err = ident.UserId.Serialize(w) + if err != nil { + return + } + err = ident.SelfSignature.SignUserId(ident.UserId.Id, e.PrimaryKey, e.PrivateKey, config) + if err != nil { + return + } + err = ident.SelfSignature.Serialize(w) + if err != nil { + return + } + } + for _, subkey := range e.Subkeys { + err = subkey.PrivateKey.Serialize(w) + if err != nil { + return + } + err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config) + if err != nil { + return + } + err = subkey.Sig.Serialize(w) + if err != nil { + return + } + } + return nil +} + +// Serialize writes the public part of the given Entity to w. (No private +// key material will be output). +func (e *Entity) Serialize(w io.Writer) error { + err := e.PrimaryKey.Serialize(w) + if err != nil { + return err + } + for _, ident := range e.Identities { + err = ident.UserId.Serialize(w) + if err != nil { + return err + } + err = ident.SelfSignature.Serialize(w) + if err != nil { + return err + } + for _, sig := range ident.Signatures { + err = sig.Serialize(w) + if err != nil { + return err + } + } + } + for _, subkey := range e.Subkeys { + err = subkey.PublicKey.Serialize(w) + if err != nil { + return err + } + err = subkey.Sig.Serialize(w) + if err != nil { + return err + } + } + return nil +} + +// SignIdentity adds a signature to e, from signer, attesting that identity is +// associated with e. The provided identity must already be an element of +// e.Identities and the private key of signer must have been decrypted if +// necessary. +// If config is nil, sensible defaults will be used. +func (e *Entity) SignIdentity(identity string, signer *Entity, config *packet.Config) error { + if signer.PrivateKey == nil { + return errors.InvalidArgumentError("signing Entity must have a private key") + } + if signer.PrivateKey.Encrypted { + return errors.InvalidArgumentError("signing Entity's private key must be decrypted") + } + ident, ok := e.Identities[identity] + if !ok { + return errors.InvalidArgumentError("given identity string not found in Entity") + } + + sig := &packet.Signature{ + SigType: packet.SigTypeGenericCert, + PubKeyAlgo: signer.PrivateKey.PubKeyAlgo, + Hash: config.Hash(), + CreationTime: config.Now(), + IssuerKeyId: &signer.PrivateKey.KeyId, + } + if err := sig.SignUserId(identity, e.PrimaryKey, signer.PrivateKey, config); err != nil { + return err + } + ident.Signatures = append(ident.Signatures, sig) + return nil +} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/compressed.go b/vendor/golang.org/x/crypto/openpgp/packet/compressed.go similarity index 98% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/compressed.go rename to vendor/golang.org/x/crypto/openpgp/packet/compressed.go index f023fe5..e8f0b5c 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/compressed.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/compressed.go @@ -8,10 +8,9 @@ import ( "compress/bzip2" "compress/flate" "compress/zlib" + "golang.org/x/crypto/openpgp/errors" "io" "strconv" - - "github.com/keybase/go-crypto/openpgp/errors" ) // Compressed represents a compressed OpenPGP packet. The decompressed contents diff --git a/vendor/golang.org/x/crypto/openpgp/packet/config.go b/vendor/golang.org/x/crypto/openpgp/packet/config.go new file mode 100644 index 0000000..c76eecc --- /dev/null +++ b/vendor/golang.org/x/crypto/openpgp/packet/config.go @@ -0,0 +1,91 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packet + +import ( + "crypto" + "crypto/rand" + "io" + "time" +) + +// Config collects a number of parameters along with sensible defaults. +// A nil *Config is valid and results in all default values. +type Config struct { + // Rand provides the source of entropy. + // If nil, the crypto/rand Reader is used. + Rand io.Reader + // DefaultHash is the default hash function to be used. + // If zero, SHA-256 is used. + DefaultHash crypto.Hash + // DefaultCipher is the cipher to be used. + // If zero, AES-128 is used. + DefaultCipher CipherFunction + // Time returns the current time as the number of seconds since the + // epoch. If Time is nil, time.Now is used. + Time func() time.Time + // DefaultCompressionAlgo is the compression algorithm to be + // applied to the plaintext before encryption. If zero, no + // compression is done. + DefaultCompressionAlgo CompressionAlgo + // CompressionConfig configures the compression settings. + CompressionConfig *CompressionConfig + // S2KCount is only used for symmetric encryption. It + // determines the strength of the passphrase stretching when + // the said passphrase is hashed to produce a key. S2KCount + // should be between 1024 and 65011712, inclusive. If Config + // is nil or S2KCount is 0, the value 65536 used. Not all + // values in the above range can be represented. S2KCount will + // be rounded up to the next representable value if it cannot + // be encoded exactly. When set, it is strongly encrouraged to + // use a value that is at least 65536. See RFC 4880 Section + // 3.7.1.3. + S2KCount int + // RSABits is the number of bits in new RSA keys made with NewEntity. + // If zero, then 2048 bit keys are created. + RSABits int +} + +func (c *Config) Random() io.Reader { + if c == nil || c.Rand == nil { + return rand.Reader + } + return c.Rand +} + +func (c *Config) Hash() crypto.Hash { + if c == nil || uint(c.DefaultHash) == 0 { + return crypto.SHA256 + } + return c.DefaultHash +} + +func (c *Config) Cipher() CipherFunction { + if c == nil || uint8(c.DefaultCipher) == 0 { + return CipherAES128 + } + return c.DefaultCipher +} + +func (c *Config) Now() time.Time { + if c == nil || c.Time == nil { + return time.Now() + } + return c.Time() +} + +func (c *Config) Compression() CompressionAlgo { + if c == nil { + return CompressionNone + } + return c.DefaultCompressionAlgo +} + +func (c *Config) PasswordHashIterations() int { + if c == nil || c.S2KCount == 0 { + return 0 + } + return c.S2KCount +} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/encrypted_key.go b/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go similarity index 94% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/encrypted_key.go rename to vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go index e064485..266840d 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/encrypted_key.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go @@ -5,14 +5,14 @@ package packet import ( + "crypto/rsa" "encoding/binary" "io" "math/big" "strconv" - "github.com/keybase/go-crypto/openpgp/elgamal" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/rsa" + "golang.org/x/crypto/openpgp/elgamal" + "golang.org/x/crypto/openpgp/errors" ) const encryptedKeyVersion = 3 @@ -77,12 +77,6 @@ func (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) error { c1 := new(big.Int).SetBytes(e.encryptedMPI1.bytes) c2 := new(big.Int).SetBytes(e.encryptedMPI2.bytes) b, err = elgamal.Decrypt(priv.PrivateKey.(*elgamal.PrivateKey), c1, c2) - case PubKeyAlgoECDH: - ecdh, ok := priv.PrivateKey.(*ecdhPrivateKey) - if !ok { - return errors.InvalidArgumentError("bad internal ECDH key") - } - b, err = ecdh.Decrypt(e.encryptedMPI1.bytes) default: err = errors.InvalidArgumentError("cannot decrypted encrypted session key with private key of type " + strconv.Itoa(int(priv.PubKeyAlgo))) } diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/literal.go b/vendor/golang.org/x/crypto/openpgp/packet/literal.go similarity index 100% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/literal.go rename to vendor/golang.org/x/crypto/openpgp/packet/literal.go diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/ocfb.go b/vendor/golang.org/x/crypto/openpgp/packet/ocfb.go similarity index 100% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/ocfb.go rename to vendor/golang.org/x/crypto/openpgp/packet/ocfb.go diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/one_pass_signature.go b/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go similarity index 94% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/one_pass_signature.go rename to vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go index af404bb..1713503 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/one_pass_signature.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go @@ -7,11 +7,10 @@ package packet import ( "crypto" "encoding/binary" + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/s2k" "io" "strconv" - - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/openpgp/s2k" ) // OnePassSignature represents a one-pass signature packet. See RFC 4880, diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/opaque.go b/vendor/golang.org/x/crypto/openpgp/packet/opaque.go similarity index 98% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/opaque.go rename to vendor/golang.org/x/crypto/openpgp/packet/opaque.go index cdeea01..456d807 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/opaque.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/opaque.go @@ -9,7 +9,7 @@ import ( "io" "io/ioutil" - "github.com/keybase/go-crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/errors" ) // OpaquePacket represents an OpenPGP packet as raw, unparsed data. This is diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go similarity index 98% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/packet.go rename to vendor/golang.org/x/crypto/openpgp/packet/packet.go index feba7bc..3eded93 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/packet.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/packet.go @@ -4,18 +4,17 @@ // Package packet implements parsing and serialization of OpenPGP packets, as // specified in RFC 4880. -package packet // import "github.com/keybase/go-crypto/openpgp/packet" +package packet // import "golang.org/x/crypto/openpgp/packet" import ( "bufio" "crypto/aes" "crypto/cipher" "crypto/des" + "golang.org/x/crypto/cast5" + "golang.org/x/crypto/openpgp/errors" "io" "math/big" - - "github.com/keybase/go-crypto/cast5" - "github.com/keybase/go-crypto/openpgp/errors" ) // readFull is the same as io.ReadFull except that reading zero bytes returns @@ -274,8 +273,6 @@ func consumeAll(r io.Reader) (n int64, err error) { return } } - - panic("unreachable") } // packetType represents the numeric ids of the different OpenPGP packet types. See @@ -413,8 +410,6 @@ const ( // RFC 6637, Section 5. PubKeyAlgoECDH PublicKeyAlgorithm = 18 PubKeyAlgoECDSA PublicKeyAlgorithm = 19 - // RFC -1 - PubKeyAlgoEdDSA PublicKeyAlgorithm = 22 ) // CanEncrypt returns true if it's possible to encrypt a message to a public @@ -431,7 +426,7 @@ func (pka PublicKeyAlgorithm) CanEncrypt() bool { // sign a message. func (pka PublicKeyAlgorithm) CanSign() bool { switch pka { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA, PubKeyAlgoEdDSA: + case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA: return true } return false diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/private_key.go b/vendor/golang.org/x/crypto/openpgp/packet/private_key.go similarity index 75% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/private_key.go rename to vendor/golang.org/x/crypto/openpgp/packet/private_key.go index 78d233c..34734cc 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/private_key.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/private_key.go @@ -6,9 +6,11 @@ package packet import ( "bytes" + "crypto" "crypto/cipher" "crypto/dsa" "crypto/ecdsa" + "crypto/rsa" "crypto/sha1" "io" "io/ioutil" @@ -16,10 +18,9 @@ import ( "strconv" "time" - "github.com/keybase/go-crypto/openpgp/elgamal" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/openpgp/s2k" - "github.com/keybase/go-crypto/rsa" + "golang.org/x/crypto/openpgp/elgamal" + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/s2k" ) // PrivateKey represents a possibly encrypted private key. See RFC 4880, @@ -30,7 +31,7 @@ type PrivateKey struct { encryptedData []byte cipher CipherFunction s2k func(out, in []byte) - PrivateKey interface{} // An *rsa.PrivateKey or *dsa.PrivateKey. + PrivateKey interface{} // An *{rsa|dsa|ecdsa}.PrivateKey or a crypto.Signer. sha1Checksum bool iv []byte } @@ -63,6 +64,23 @@ func NewECDSAPrivateKey(currentTime time.Time, priv *ecdsa.PrivateKey) *PrivateK return pk } +// NewSignerPrivateKey creates a sign-only PrivateKey from a crypto.Signer that +// implements RSA or ECDSA. +func NewSignerPrivateKey(currentTime time.Time, signer crypto.Signer) *PrivateKey { + pk := new(PrivateKey) + switch pubkey := signer.Public().(type) { + case rsa.PublicKey: + pk.PublicKey = *NewRSAPublicKey(currentTime, &pubkey) + pk.PubKeyAlgo = PubKeyAlgoRSASignOnly + case ecdsa.PublicKey: + pk.PublicKey = *NewECDSAPublicKey(currentTime, &pubkey) + default: + panic("openpgp: unknown crypto.Signer type in NewSignerPrivateKey") + } + pk.PrivateKey = signer + return pk +} + func (pk *PrivateKey) parse(r io.Reader) (err error) { err = (&pk.PublicKey).parse(r) if err != nil { @@ -94,16 +112,10 @@ func (pk *PrivateKey) parse(r io.Reader) (err error) { if s2kType == 254 { pk.sha1Checksum = true } - // S2K == nil implies that we got a "GNU Dummy" S2K. For instance, - // because our master secret key is on a USB key in a vault somewhere. - // In that case, there is no further data to consume here. - if pk.s2k == nil { - pk.Encrypted = false - return - } default: return errors.UnsupportedError("deprecated s2k function in private key") } + if pk.Encrypted { blockSize := pk.cipher.blockSize() if blockSize == 0 { @@ -143,38 +155,24 @@ func (pk *PrivateKey) Serialize(w io.Writer) (err error) { if err != nil { return } + buf.WriteByte(0 /* no encryption */) privateKeyBuf := bytes.NewBuffer(nil) - if pk.PrivateKey == nil { - _, err = buf.Write([]byte{ - 254, // SHA-1 Convention - 9, // Encryption scheme (AES256) - 101, // GNU Extensions - 2, // Hash value (SHA1) - 'G', 'N', 'U', // "GNU" as a string - 1, // Extension type 1001 (minus 1000) - }) - } else { - buf.WriteByte(0 /* no encryption */) - - switch priv := pk.PrivateKey.(type) { - case *rsa.PrivateKey: - err = serializeRSAPrivateKey(privateKeyBuf, priv) - case *dsa.PrivateKey: - err = serializeDSAPrivateKey(privateKeyBuf, priv) - case *elgamal.PrivateKey: - err = serializeElGamalPrivateKey(privateKeyBuf, priv) - case *ecdsa.PrivateKey: - err = serializeECDSAPrivateKey(privateKeyBuf, priv) - case *ecdhPrivateKey: - err = serializeECDHPrivateKey(privateKeyBuf, priv) - default: - err = errors.InvalidArgumentError("unknown private key type") - } - if err != nil { - return - } + switch priv := pk.PrivateKey.(type) { + case *rsa.PrivateKey: + err = serializeRSAPrivateKey(privateKeyBuf, priv) + case *dsa.PrivateKey: + err = serializeDSAPrivateKey(privateKeyBuf, priv) + case *elgamal.PrivateKey: + err = serializeElGamalPrivateKey(privateKeyBuf, priv) + case *ecdsa.PrivateKey: + err = serializeECDSAPrivateKey(privateKeyBuf, priv) + default: + err = errors.InvalidArgumentError("unknown private key type") + } + if err != nil { + return } ptype := packetTypePrivateKey @@ -196,13 +194,11 @@ func (pk *PrivateKey) Serialize(w io.Writer) (err error) { return } - if len(privateKeyBytes) > 0 { - checksum := mod64kHash(privateKeyBytes) - var checksumBytes [2]byte - checksumBytes[0] = byte(checksum >> 8) - checksumBytes[1] = byte(checksum) - _, err = w.Write(checksumBytes[:]) - } + checksum := mod64kHash(privateKeyBytes) + var checksumBytes [2]byte + checksumBytes[0] = byte(checksum >> 8) + checksumBytes[1] = byte(checksum) + _, err = w.Write(checksumBytes[:]) return } @@ -235,19 +231,11 @@ func serializeECDSAPrivateKey(w io.Writer, priv *ecdsa.PrivateKey) error { return writeBig(w, priv.D) } -func serializeECDHPrivateKey(w io.Writer, priv *ecdhPrivateKey) error { - return writeBig(w, priv.x) -} - // Decrypt decrypts an encrypted private key using a passphrase. func (pk *PrivateKey) Decrypt(passphrase []byte) error { if !pk.Encrypted { return nil } - // For GNU Dummy S2K, there's no key here, so don't do anything. - if pk.s2k == nil { - return nil - } key := make([]byte, pk.cipher.KeySize()) pk.s2k(key, passphrase) @@ -296,8 +284,6 @@ func (pk *PrivateKey) parsePrivateKey(data []byte) (err error) { return pk.parseElGamalPrivateKey(data) case PubKeyAlgoECDSA: return pk.parseECDSAPrivateKey(data) - case PubKeyAlgoECDH: - return pk.parseECDHPrivateKey(data) } panic("impossible") } @@ -374,28 +360,8 @@ func (pk *PrivateKey) parseElGamalPrivateKey(data []byte) (err error) { return nil } -func (pk *PrivateKey) parseECDHPrivateKey(data []byte) (err error) { - pub := pk.PublicKey.PublicKey.(*ecdsa.PublicKey) - priv := new(ecdhPrivateKey) - priv.PublicKey = *pub - - buf := bytes.NewBuffer(data) - d, _, err := readMPI(buf) - if err != nil { - return - } - - priv.x = new(big.Int).SetBytes(d) - pk.PrivateKey = priv - pk.Encrypted = false - pk.encryptedData = nil - return nil -} - func (pk *PrivateKey) parseECDSAPrivateKey(data []byte) (err error) { ecdsaPub := pk.PublicKey.PublicKey.(*ecdsa.PublicKey) - ecdsaPriv := new(ecdsa.PrivateKey) - ecdsaPriv.PublicKey = *ecdsaPub buf := bytes.NewBuffer(data) d, _, err := readMPI(buf) @@ -403,8 +369,10 @@ func (pk *PrivateKey) parseECDSAPrivateKey(data []byte) (err error) { return } - ecdsaPriv.D = new(big.Int).SetBytes(d) - pk.PrivateKey = ecdsaPriv + pk.PrivateKey = &ecdsa.PrivateKey{ + PublicKey: *ecdsaPub, + D: new(big.Int).SetBytes(d), + } pk.Encrypted = false pk.encryptedData = nil diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/public_key.go b/vendor/golang.org/x/crypto/openpgp/packet/public_key.go similarity index 82% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/public_key.go rename to vendor/golang.org/x/crypto/openpgp/packet/public_key.go index ff82a5b..ead2623 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/public_key.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/public_key.go @@ -10,6 +10,7 @@ import ( "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" + "crypto/rsa" "crypto/sha1" _ "crypto/sha256" _ "crypto/sha512" @@ -21,11 +22,8 @@ import ( "strconv" "time" - "github.com/agl/ed25519" - "github.com/keybase/go-crypto/brainpool" - "github.com/keybase/go-crypto/openpgp/elgamal" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/rsa" + "golang.org/x/crypto/openpgp/elgamal" + "golang.org/x/crypto/openpgp/errors" ) var ( @@ -35,17 +33,9 @@ var ( oidCurveP384 []byte = []byte{0x2B, 0x81, 0x04, 0x00, 0x22} // NIST curve P-521 oidCurveP521 []byte = []byte{0x2B, 0x81, 0x04, 0x00, 0x23} - // Brainpool curve P-256r1 - oidCurveP256r1 []byte = []byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x07} - // Brainpool curve P-384r1 - oidCurveP384r1 []byte = []byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0B} - // Brainpool curve P-512r1 - oidCurveP512r1 []byte = []byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0D} - // EdDSA - oidEdDSA []byte = []byte{0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0F, 0x01} ) -const maxOIDLength = 10 +const maxOIDLength = 8 // ecdsaKey stores the algorithm-specific fields for ECDSA keys. // as defined in RFC 6637, Section 9. @@ -56,22 +46,6 @@ type ecdsaKey struct { p parsedMPI } -type edDSAkey struct { - ecdsaKey -} - -func (e *edDSAkey) Verify(payload []byte, r parsedMPI, s parsedMPI) bool { - var key [ed25519.PublicKeySize]byte - var sig [ed25519.SignatureSize]byte - - // NOTE(maxtaco): I'm not entirely sure why we need to ignore the first byte. - copy(key[:], e.p.bytes[1:]) - n := copy(sig[:], r.bytes) - copy(sig[n:], s.bytes) - - return ed25519.Verify(&key, payload, &sig) -} - // parseOID reads the OID for the curve as defined in RFC 6637, Section 9. func parseOID(r io.Reader) (oid []byte, err error) { buf := make([]byte, maxOIDLength) @@ -114,12 +88,6 @@ func (f *ecdsaKey) newECDSA() (*ecdsa.PublicKey, error) { c = elliptic.P384() } else if bytes.Equal(f.oid, oidCurveP521) { c = elliptic.P521() - } else if bytes.Equal(f.oid, oidCurveP256r1) { - c = brainpool.P256r1() - } else if bytes.Equal(f.oid, oidCurveP384r1) { - c = brainpool.P384r1() - } else if bytes.Equal(f.oid, oidCurveP512r1) { - c = brainpool.P512r1() } else { return nil, errors.UnsupportedError(fmt.Sprintf("unsupported oid: %x", f.oid)) } @@ -195,9 +163,6 @@ type PublicKey struct { // RFC 6637 fields ec *ecdsaKey ecdh *ecdhKdf - - // EdDSA fields (no RFC available), uses ecdsa scaffolding - edk *edDSAkey } // signingKey provides a convenient abstraction over signature verification @@ -207,28 +172,21 @@ type signingKey interface { serializeWithoutHeaders(io.Writer) error } -func FromBig(n *big.Int) parsedMPI { +func fromBig(n *big.Int) parsedMPI { return parsedMPI{ bytes: n.Bytes(), bitLength: uint16(n.BitLen()), } } -func FromBytes(bytes []byte) parsedMPI { - return parsedMPI{ - bytes: bytes, - bitLength: uint16(8 * len(bytes)), - } -} - // NewRSAPublicKey returns a PublicKey that wraps the given rsa.PublicKey. func NewRSAPublicKey(creationTime time.Time, pub *rsa.PublicKey) *PublicKey { pk := &PublicKey{ CreationTime: creationTime, PubKeyAlgo: PubKeyAlgoRSA, PublicKey: pub, - n: FromBig(pub.N), - e: FromBig(big.NewInt(int64(pub.E))), + n: fromBig(pub.N), + e: fromBig(big.NewInt(int64(pub.E))), } pk.setFingerPrintAndKeyId() @@ -241,35 +199,25 @@ func NewDSAPublicKey(creationTime time.Time, pub *dsa.PublicKey) *PublicKey { CreationTime: creationTime, PubKeyAlgo: PubKeyAlgoDSA, PublicKey: pub, - p: FromBig(pub.P), - q: FromBig(pub.Q), - g: FromBig(pub.G), - y: FromBig(pub.Y), + p: fromBig(pub.P), + q: fromBig(pub.Q), + g: fromBig(pub.G), + y: fromBig(pub.Y), } pk.setFingerPrintAndKeyId() return pk } -// check EdDSA public key material. -// There is currently no RFC for it, but it doesn't mean it's not -// implemented or in use. -func (e *edDSAkey) check() error { - if !bytes.Equal(e.oid, oidEdDSA) { - return errors.UnsupportedError(fmt.Sprintf("Bad OID for EdDSA key: %v", e.oid)) - } - return nil -} - // NewElGamalPublicKey returns a PublicKey that wraps the given elgamal.PublicKey. func NewElGamalPublicKey(creationTime time.Time, pub *elgamal.PublicKey) *PublicKey { pk := &PublicKey{ CreationTime: creationTime, PubKeyAlgo: PubKeyAlgoElGamal, PublicKey: pub, - p: FromBig(pub.P), - g: FromBig(pub.G), - y: FromBig(pub.Y), + p: fromBig(pub.P), + g: fromBig(pub.G), + y: fromBig(pub.Y), } pk.setFingerPrintAndKeyId() @@ -283,6 +231,7 @@ func NewECDSAPublicKey(creationTime time.Time, pub *ecdsa.PublicKey) *PublicKey PublicKey: pub, ec: new(ecdsaKey), } + switch pub.Curve { case elliptic.P256(): pk.ec.oid = oidCurveP256 @@ -290,13 +239,10 @@ func NewECDSAPublicKey(creationTime time.Time, pub *ecdsa.PublicKey) *PublicKey pk.ec.oid = oidCurveP384 case elliptic.P521(): pk.ec.oid = oidCurveP521 - case brainpool.P256r1(): - pk.ec.oid = oidCurveP256r1 - case brainpool.P384r1(): - pk.ec.oid = oidCurveP384r1 - case brainpool.P512r1(): - pk.ec.oid = oidCurveP512r1 + default: + panic("unknown elliptic curve") } + pk.ec.p.bytes = elliptic.Marshal(pub.Curve, pub.X, pub.Y) pk.ec.p.bitLength = uint16(8 * len(pk.ec.p.bytes)) @@ -323,12 +269,6 @@ func (pk *PublicKey) parse(r io.Reader) (err error) { err = pk.parseDSA(r) case PubKeyAlgoElGamal: err = pk.parseElGamal(r) - case PubKeyAlgoEdDSA: - pk.edk = &edDSAkey{} - if err = pk.edk.parse(r); err != nil { - return err - } - err = pk.edk.check() case PubKeyAlgoECDSA: pk.ec = new(ecdsaKey) if err = pk.ec.parse(r); err != nil { @@ -378,7 +318,7 @@ func (pk *PublicKey) parseRSA(r io.Reader) (err error) { return } - if len(pk.e.bytes) > 7 { + if len(pk.e.bytes) > 3 { err = errors.UnsupportedError("large public exponent") return } @@ -388,7 +328,7 @@ func (pk *PublicKey) parseRSA(r io.Reader) (err error) { } for i := 0; i < len(pk.e.bytes); i++ { rsa.E <<= 8 - rsa.E |= int64(pk.e.bytes[i]) + rsa.E |= int(pk.e.bytes[i]) } pk.PublicKey = rsa return @@ -470,8 +410,6 @@ func (pk *PublicKey) SerializeSignaturePrefix(h io.Writer) { case PubKeyAlgoECDH: pLength += uint16(pk.ec.byteLen()) pLength += uint16(pk.ecdh.byteLen()) - case PubKeyAlgoEdDSA: - pLength += uint16(pk.edk.byteLen()) default: panic("unknown public key algorithm") } @@ -501,8 +439,6 @@ func (pk *PublicKey) Serialize(w io.Writer) (err error) { case PubKeyAlgoECDH: length += pk.ec.byteLen() length += pk.ecdh.byteLen() - case PubKeyAlgoEdDSA: - length += pk.edk.byteLen() default: panic("unknown public key algorithm") } @@ -544,8 +480,6 @@ func (pk *PublicKey) serializeWithoutHeaders(w io.Writer) (err error) { return writeMPIs(w, pk.p, pk.g, pk.y) case PubKeyAlgoECDSA: return pk.ec.serialize(w) - case PubKeyAlgoEdDSA: - return pk.edk.serialize(w) case PubKeyAlgoECDH: if err = pk.ec.serialize(w); err != nil { return @@ -570,18 +504,9 @@ func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err erro signed.Write(sig.HashSuffix) hashBytes := signed.Sum(nil) - // NOTE(maxtaco) 2016-08-22 - // - // We used to do this: - // - // if hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] { - // return errors.SignatureError("hash tag doesn't match") - // } - // - // But don't do anything in this case. Some GPGs generate bad - // 2-byte hash prefixes, but GPG also doesn't seem to care on - // import. See BrentMaxwell's key. I think it's safe to disable - // this check! + if hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] { + return errors.SignatureError("hash tag doesn't match") + } if pk.PubKeyAlgo != sig.PubKeyAlgo { return errors.InvalidArgumentError("public key and signature use different algorithms") @@ -612,15 +537,9 @@ func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err erro return errors.SignatureError("ECDSA verification failure") } return nil - case PubKeyAlgoEdDSA: - if !pk.edk.Verify(hashBytes, sig.EdDSASigR, sig.EdDSASigS) { - return errors.SignatureError("EdDSA verification failure") - } - return nil default: return errors.SignatureError("Unsupported public key algorithm used in signature") } - panic("unreachable") } // VerifySignatureV3 returns nil iff sig is a valid signature, made by this @@ -665,7 +584,6 @@ func (pk *PublicKey) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (err default: panic("shouldn't happen") } - panic("unreachable") } // keySignatureHash returns a Hash of the message that needs to be signed for @@ -676,18 +594,12 @@ func keySignatureHash(pk, signed signingKey, hashFunc crypto.Hash) (h hash.Hash, } h = hashFunc.New() - updateKeySignatureHash(pk, signed, h) - - return -} - -// updateKeySignatureHash does the actual hash updates for keySignatureHash. -func updateKeySignatureHash(pk, signed signingKey, h hash.Hash) { // RFC 4880, section 5.2.4 pk.SerializeSignaturePrefix(h) pk.serializeWithoutHeaders(h) signed.SerializeSignaturePrefix(h) signed.serializeWithoutHeaders(h) + return } // VerifyKeySignature returns nil iff sig is a valid signature, made by this @@ -702,19 +614,6 @@ func (pk *PublicKey) VerifyKeySignature(signed *PublicKey, sig *Signature) error } if sig.FlagSign { - - // BUG(maxtaco) - // - // We should check for more than FlagsSign here, because if - // you read keys.go, we can sometimes use signing subkeys even if they're - // not explicitly flagged as such. However, so doing fails lots of currently - // working tests, so I'm not going to do much here. - // - // In other words, we should have this disjunction in the condition above: - // - // || (!sig.FlagsValid && pk.PubKeyAlgo.CanSign()) { - // - // Signing subkeys must be cross-signed. See // https://www.gnupg.org/faq/subkey-cross-certify.html. if sig.EmbeddedSignature == nil { @@ -757,19 +656,6 @@ func (pk *PublicKey) VerifyRevocationSignature(sig *Signature) (err error) { return pk.VerifySignature(h, sig) } -type teeHash struct { - h hash.Hash -} - -func (t teeHash) Write(b []byte) (n int, err error) { - fmt.Printf("hash -> %s %+v\n", string(b), b) - return t.h.Write(b) -} -func (t teeHash) Sum(b []byte) []byte { return t.h.Sum(b) } -func (t teeHash) Reset() { t.h.Reset() } -func (t teeHash) Size() int { return t.h.Size() } -func (t teeHash) BlockSize() int { return t.h.BlockSize() } - // userIdSignatureHash returns a Hash of the message that needs to be signed // to assert that pk is a valid key for id. func userIdSignatureHash(id string, pk *PublicKey, hashFunc crypto.Hash) (h hash.Hash, err error) { @@ -778,14 +664,6 @@ func userIdSignatureHash(id string, pk *PublicKey, hashFunc crypto.Hash) (h hash } h = hashFunc.New() - updateUserIdSignatureHash(id, pk, h) - - return -} - -// updateUserIdSignatureHash does the actual hash updates for -// userIdSignatureHash. -func updateUserIdSignatureHash(id string, pk *PublicKey, h hash.Hash) { // RFC 4880, section 5.2.4 pk.SerializeSignaturePrefix(h) pk.serializeWithoutHeaders(h) diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/public_key_v3.go b/vendor/golang.org/x/crypto/openpgp/packet/public_key_v3.go similarity index 97% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/public_key_v3.go rename to vendor/golang.org/x/crypto/openpgp/packet/public_key_v3.go index 5247467..5daf7b6 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/public_key_v3.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/public_key_v3.go @@ -7,6 +7,7 @@ package packet import ( "crypto" "crypto/md5" + "crypto/rsa" "encoding/binary" "fmt" "hash" @@ -15,8 +16,7 @@ import ( "strconv" "time" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/rsa" + "golang.org/x/crypto/openpgp/errors" ) // PublicKeyV3 represents older, version 3 public keys. These keys are less secure and @@ -42,8 +42,8 @@ func newRSAPublicKeyV3(creationTime time.Time, pub *rsa.PublicKey) *PublicKeyV3 pk := &PublicKeyV3{ CreationTime: creationTime, PublicKey: pub, - n: FromBig(pub.N), - e: FromBig(big.NewInt(int64(pub.E))), + n: fromBig(pub.N), + e: fromBig(big.NewInt(int64(pub.E))), } pk.setFingerPrintAndKeyId() @@ -100,14 +100,14 @@ func (pk *PublicKeyV3) parseRSA(r io.Reader) (err error) { if len(pk.n.bytes) < 8 { return errors.StructuralError("v3 public key modulus is too short") } - if len(pk.e.bytes) > 7 { + if len(pk.e.bytes) > 3 { err = errors.UnsupportedError("large public exponent") return } rsa := &rsa.PublicKey{N: new(big.Int).SetBytes(pk.n.bytes)} for i := 0; i < len(pk.e.bytes); i++ { rsa.E <<= 8 - rsa.E |= int64(pk.e.bytes[i]) + rsa.E |= int(pk.e.bytes[i]) } pk.PublicKey = rsa return @@ -216,7 +216,6 @@ func (pk *PublicKeyV3) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (er // V3 public keys only support RSA. panic("shouldn't happen") } - panic("unreachable") } // VerifyUserIdSignatureV3 returns nil iff sig is a valid signature, made by this diff --git a/vendor/golang.org/x/crypto/openpgp/packet/reader.go b/vendor/golang.org/x/crypto/openpgp/packet/reader.go new file mode 100644 index 0000000..34bc7c6 --- /dev/null +++ b/vendor/golang.org/x/crypto/openpgp/packet/reader.go @@ -0,0 +1,76 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packet + +import ( + "golang.org/x/crypto/openpgp/errors" + "io" +) + +// Reader reads packets from an io.Reader and allows packets to be 'unread' so +// that they result from the next call to Next. +type Reader struct { + q []Packet + readers []io.Reader +} + +// New io.Readers are pushed when a compressed or encrypted packet is processed +// and recursively treated as a new source of packets. However, a carefully +// crafted packet can trigger an infinite recursive sequence of packets. See +// http://mumble.net/~campbell/misc/pgp-quine +// https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4402 +// This constant limits the number of recursive packets that may be pushed. +const maxReaders = 32 + +// Next returns the most recently unread Packet, or reads another packet from +// the top-most io.Reader. Unknown packet types are skipped. +func (r *Reader) Next() (p Packet, err error) { + if len(r.q) > 0 { + p = r.q[len(r.q)-1] + r.q = r.q[:len(r.q)-1] + return + } + + for len(r.readers) > 0 { + p, err = Read(r.readers[len(r.readers)-1]) + if err == nil { + return + } + if err == io.EOF { + r.readers = r.readers[:len(r.readers)-1] + continue + } + if _, ok := err.(errors.UnknownPacketTypeError); !ok { + return nil, err + } + } + + return nil, io.EOF +} + +// Push causes the Reader to start reading from a new io.Reader. When an EOF +// error is seen from the new io.Reader, it is popped and the Reader continues +// to read from the next most recent io.Reader. Push returns a StructuralError +// if pushing the reader would exceed the maximum recursion level, otherwise it +// returns nil. +func (r *Reader) Push(reader io.Reader) (err error) { + if len(r.readers) >= maxReaders { + return errors.StructuralError("too many layers of packets") + } + r.readers = append(r.readers, reader) + return nil +} + +// Unread causes the given Packet to be returned from the next call to Next. +func (r *Reader) Unread(p Packet) { + r.q = append(r.q, p) +} + +func NewReader(r io.Reader) *Reader { + return &Reader{ + q: nil, + readers: []io.Reader{r}, + } +} diff --git a/vendor/golang.org/x/crypto/openpgp/packet/signature.go b/vendor/golang.org/x/crypto/openpgp/packet/signature.go new file mode 100644 index 0000000..6ce0cbe --- /dev/null +++ b/vendor/golang.org/x/crypto/openpgp/packet/signature.go @@ -0,0 +1,731 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packet + +import ( + "bytes" + "crypto" + "crypto/dsa" + "crypto/ecdsa" + "encoding/asn1" + "encoding/binary" + "hash" + "io" + "math/big" + "strconv" + "time" + + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/s2k" +) + +const ( + // See RFC 4880, section 5.2.3.21 for details. + KeyFlagCertify = 1 << iota + KeyFlagSign + KeyFlagEncryptCommunications + KeyFlagEncryptStorage +) + +// Signature represents a signature. See RFC 4880, section 5.2. +type Signature struct { + SigType SignatureType + PubKeyAlgo PublicKeyAlgorithm + Hash crypto.Hash + + // HashSuffix is extra data that is hashed in after the signed data. + HashSuffix []byte + // HashTag contains the first two bytes of the hash for fast rejection + // of bad signed data. + HashTag [2]byte + CreationTime time.Time + + RSASignature parsedMPI + DSASigR, DSASigS parsedMPI + ECDSASigR, ECDSASigS parsedMPI + + // rawSubpackets contains the unparsed subpackets, in order. + rawSubpackets []outputSubpacket + + // The following are optional so are nil when not included in the + // signature. + + SigLifetimeSecs, KeyLifetimeSecs *uint32 + PreferredSymmetric, PreferredHash, PreferredCompression []uint8 + IssuerKeyId *uint64 + IsPrimaryId *bool + + // FlagsValid is set if any flags were given. See RFC 4880, section + // 5.2.3.21 for details. + FlagsValid bool + FlagCertify, FlagSign, FlagEncryptCommunications, FlagEncryptStorage bool + + // RevocationReason is set if this signature has been revoked. + // See RFC 4880, section 5.2.3.23 for details. + RevocationReason *uint8 + RevocationReasonText string + + // MDC is set if this signature has a feature packet that indicates + // support for MDC subpackets. + MDC bool + + // EmbeddedSignature, if non-nil, is a signature of the parent key, by + // this key. This prevents an attacker from claiming another's signing + // subkey as their own. + EmbeddedSignature *Signature + + outSubpackets []outputSubpacket +} + +func (sig *Signature) parse(r io.Reader) (err error) { + // RFC 4880, section 5.2.3 + var buf [5]byte + _, err = readFull(r, buf[:1]) + if err != nil { + return + } + if buf[0] != 4 { + err = errors.UnsupportedError("signature packet version " + strconv.Itoa(int(buf[0]))) + return + } + + _, err = readFull(r, buf[:5]) + if err != nil { + return + } + sig.SigType = SignatureType(buf[0]) + sig.PubKeyAlgo = PublicKeyAlgorithm(buf[1]) + switch sig.PubKeyAlgo { + case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA: + default: + err = errors.UnsupportedError("public key algorithm " + strconv.Itoa(int(sig.PubKeyAlgo))) + return + } + + var ok bool + sig.Hash, ok = s2k.HashIdToHash(buf[2]) + if !ok { + return errors.UnsupportedError("hash function " + strconv.Itoa(int(buf[2]))) + } + + hashedSubpacketsLength := int(buf[3])<<8 | int(buf[4]) + l := 6 + hashedSubpacketsLength + sig.HashSuffix = make([]byte, l+6) + sig.HashSuffix[0] = 4 + copy(sig.HashSuffix[1:], buf[:5]) + hashedSubpackets := sig.HashSuffix[6:l] + _, err = readFull(r, hashedSubpackets) + if err != nil { + return + } + // See RFC 4880, section 5.2.4 + trailer := sig.HashSuffix[l:] + trailer[0] = 4 + trailer[1] = 0xff + trailer[2] = uint8(l >> 24) + trailer[3] = uint8(l >> 16) + trailer[4] = uint8(l >> 8) + trailer[5] = uint8(l) + + err = parseSignatureSubpackets(sig, hashedSubpackets, true) + if err != nil { + return + } + + _, err = readFull(r, buf[:2]) + if err != nil { + return + } + unhashedSubpacketsLength := int(buf[0])<<8 | int(buf[1]) + unhashedSubpackets := make([]byte, unhashedSubpacketsLength) + _, err = readFull(r, unhashedSubpackets) + if err != nil { + return + } + err = parseSignatureSubpackets(sig, unhashedSubpackets, false) + if err != nil { + return + } + + _, err = readFull(r, sig.HashTag[:2]) + if err != nil { + return + } + + switch sig.PubKeyAlgo { + case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: + sig.RSASignature.bytes, sig.RSASignature.bitLength, err = readMPI(r) + case PubKeyAlgoDSA: + sig.DSASigR.bytes, sig.DSASigR.bitLength, err = readMPI(r) + if err == nil { + sig.DSASigS.bytes, sig.DSASigS.bitLength, err = readMPI(r) + } + case PubKeyAlgoECDSA: + sig.ECDSASigR.bytes, sig.ECDSASigR.bitLength, err = readMPI(r) + if err == nil { + sig.ECDSASigS.bytes, sig.ECDSASigS.bitLength, err = readMPI(r) + } + default: + panic("unreachable") + } + return +} + +// parseSignatureSubpackets parses subpackets of the main signature packet. See +// RFC 4880, section 5.2.3.1. +func parseSignatureSubpackets(sig *Signature, subpackets []byte, isHashed bool) (err error) { + for len(subpackets) > 0 { + subpackets, err = parseSignatureSubpacket(sig, subpackets, isHashed) + if err != nil { + return + } + } + + if sig.CreationTime.IsZero() { + err = errors.StructuralError("no creation time in signature") + } + + return +} + +type signatureSubpacketType uint8 + +const ( + creationTimeSubpacket signatureSubpacketType = 2 + signatureExpirationSubpacket signatureSubpacketType = 3 + keyExpirationSubpacket signatureSubpacketType = 9 + prefSymmetricAlgosSubpacket signatureSubpacketType = 11 + issuerSubpacket signatureSubpacketType = 16 + prefHashAlgosSubpacket signatureSubpacketType = 21 + prefCompressionSubpacket signatureSubpacketType = 22 + primaryUserIdSubpacket signatureSubpacketType = 25 + keyFlagsSubpacket signatureSubpacketType = 27 + reasonForRevocationSubpacket signatureSubpacketType = 29 + featuresSubpacket signatureSubpacketType = 30 + embeddedSignatureSubpacket signatureSubpacketType = 32 +) + +// parseSignatureSubpacket parses a single subpacket. len(subpacket) is >= 1. +func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (rest []byte, err error) { + // RFC 4880, section 5.2.3.1 + var ( + length uint32 + packetType signatureSubpacketType + isCritical bool + ) + switch { + case subpacket[0] < 192: + length = uint32(subpacket[0]) + subpacket = subpacket[1:] + case subpacket[0] < 255: + if len(subpacket) < 2 { + goto Truncated + } + length = uint32(subpacket[0]-192)<<8 + uint32(subpacket[1]) + 192 + subpacket = subpacket[2:] + default: + if len(subpacket) < 5 { + goto Truncated + } + length = uint32(subpacket[1])<<24 | + uint32(subpacket[2])<<16 | + uint32(subpacket[3])<<8 | + uint32(subpacket[4]) + subpacket = subpacket[5:] + } + if length > uint32(len(subpacket)) { + goto Truncated + } + rest = subpacket[length:] + subpacket = subpacket[:length] + if len(subpacket) == 0 { + err = errors.StructuralError("zero length signature subpacket") + return + } + packetType = signatureSubpacketType(subpacket[0] & 0x7f) + isCritical = subpacket[0]&0x80 == 0x80 + subpacket = subpacket[1:] + sig.rawSubpackets = append(sig.rawSubpackets, outputSubpacket{isHashed, packetType, isCritical, subpacket}) + switch packetType { + case creationTimeSubpacket: + if !isHashed { + err = errors.StructuralError("signature creation time in non-hashed area") + return + } + if len(subpacket) != 4 { + err = errors.StructuralError("signature creation time not four bytes") + return + } + t := binary.BigEndian.Uint32(subpacket) + sig.CreationTime = time.Unix(int64(t), 0) + case signatureExpirationSubpacket: + // Signature expiration time, section 5.2.3.10 + if !isHashed { + return + } + if len(subpacket) != 4 { + err = errors.StructuralError("expiration subpacket with bad length") + return + } + sig.SigLifetimeSecs = new(uint32) + *sig.SigLifetimeSecs = binary.BigEndian.Uint32(subpacket) + case keyExpirationSubpacket: + // Key expiration time, section 5.2.3.6 + if !isHashed { + return + } + if len(subpacket) != 4 { + err = errors.StructuralError("key expiration subpacket with bad length") + return + } + sig.KeyLifetimeSecs = new(uint32) + *sig.KeyLifetimeSecs = binary.BigEndian.Uint32(subpacket) + case prefSymmetricAlgosSubpacket: + // Preferred symmetric algorithms, section 5.2.3.7 + if !isHashed { + return + } + sig.PreferredSymmetric = make([]byte, len(subpacket)) + copy(sig.PreferredSymmetric, subpacket) + case issuerSubpacket: + // Issuer, section 5.2.3.5 + if len(subpacket) != 8 { + err = errors.StructuralError("issuer subpacket with bad length") + return + } + sig.IssuerKeyId = new(uint64) + *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket) + case prefHashAlgosSubpacket: + // Preferred hash algorithms, section 5.2.3.8 + if !isHashed { + return + } + sig.PreferredHash = make([]byte, len(subpacket)) + copy(sig.PreferredHash, subpacket) + case prefCompressionSubpacket: + // Preferred compression algorithms, section 5.2.3.9 + if !isHashed { + return + } + sig.PreferredCompression = make([]byte, len(subpacket)) + copy(sig.PreferredCompression, subpacket) + case primaryUserIdSubpacket: + // Primary User ID, section 5.2.3.19 + if !isHashed { + return + } + if len(subpacket) != 1 { + err = errors.StructuralError("primary user id subpacket with bad length") + return + } + sig.IsPrimaryId = new(bool) + if subpacket[0] > 0 { + *sig.IsPrimaryId = true + } + case keyFlagsSubpacket: + // Key flags, section 5.2.3.21 + if !isHashed { + return + } + if len(subpacket) == 0 { + err = errors.StructuralError("empty key flags subpacket") + return + } + sig.FlagsValid = true + if subpacket[0]&KeyFlagCertify != 0 { + sig.FlagCertify = true + } + if subpacket[0]&KeyFlagSign != 0 { + sig.FlagSign = true + } + if subpacket[0]&KeyFlagEncryptCommunications != 0 { + sig.FlagEncryptCommunications = true + } + if subpacket[0]&KeyFlagEncryptStorage != 0 { + sig.FlagEncryptStorage = true + } + case reasonForRevocationSubpacket: + // Reason For Revocation, section 5.2.3.23 + if !isHashed { + return + } + if len(subpacket) == 0 { + err = errors.StructuralError("empty revocation reason subpacket") + return + } + sig.RevocationReason = new(uint8) + *sig.RevocationReason = subpacket[0] + sig.RevocationReasonText = string(subpacket[1:]) + case featuresSubpacket: + // Features subpacket, section 5.2.3.24 specifies a very general + // mechanism for OpenPGP implementations to signal support for new + // features. In practice, the subpacket is used exclusively to + // indicate support for MDC-protected encryption. + sig.MDC = len(subpacket) >= 1 && subpacket[0]&1 == 1 + case embeddedSignatureSubpacket: + // Only usage is in signatures that cross-certify + // signing subkeys. section 5.2.3.26 describes the + // format, with its usage described in section 11.1 + if sig.EmbeddedSignature != nil { + err = errors.StructuralError("Cannot have multiple embedded signatures") + return + } + sig.EmbeddedSignature = new(Signature) + // Embedded signatures are required to be v4 signatures see + // section 12.1. However, we only parse v4 signatures in this + // file anyway. + if err := sig.EmbeddedSignature.parse(bytes.NewBuffer(subpacket)); err != nil { + return nil, err + } + if sigType := sig.EmbeddedSignature.SigType; sigType != SigTypePrimaryKeyBinding { + return nil, errors.StructuralError("cross-signature has unexpected type " + strconv.Itoa(int(sigType))) + } + default: + if isCritical { + err = errors.UnsupportedError("unknown critical signature subpacket type " + strconv.Itoa(int(packetType))) + return + } + } + return + +Truncated: + err = errors.StructuralError("signature subpacket truncated") + return +} + +// subpacketLengthLength returns the length, in bytes, of an encoded length value. +func subpacketLengthLength(length int) int { + if length < 192 { + return 1 + } + if length < 16320 { + return 2 + } + return 5 +} + +// serializeSubpacketLength marshals the given length into to. +func serializeSubpacketLength(to []byte, length int) int { + // RFC 4880, Section 4.2.2. + if length < 192 { + to[0] = byte(length) + return 1 + } + if length < 16320 { + length -= 192 + to[0] = byte((length >> 8) + 192) + to[1] = byte(length) + return 2 + } + to[0] = 255 + to[1] = byte(length >> 24) + to[2] = byte(length >> 16) + to[3] = byte(length >> 8) + to[4] = byte(length) + return 5 +} + +// subpacketsLength returns the serialized length, in bytes, of the given +// subpackets. +func subpacketsLength(subpackets []outputSubpacket, hashed bool) (length int) { + for _, subpacket := range subpackets { + if subpacket.hashed == hashed { + length += subpacketLengthLength(len(subpacket.contents) + 1) + length += 1 // type byte + length += len(subpacket.contents) + } + } + return +} + +// serializeSubpackets marshals the given subpackets into to. +func serializeSubpackets(to []byte, subpackets []outputSubpacket, hashed bool) { + for _, subpacket := range subpackets { + if subpacket.hashed == hashed { + n := serializeSubpacketLength(to, len(subpacket.contents)+1) + to[n] = byte(subpacket.subpacketType) + to = to[1+n:] + n = copy(to, subpacket.contents) + to = to[n:] + } + } + return +} + +// KeyExpired returns whether sig is a self-signature of a key that has +// expired. +func (sig *Signature) KeyExpired(currentTime time.Time) bool { + if sig.KeyLifetimeSecs == nil { + return false + } + expiry := sig.CreationTime.Add(time.Duration(*sig.KeyLifetimeSecs) * time.Second) + return currentTime.After(expiry) +} + +// buildHashSuffix constructs the HashSuffix member of sig in preparation for signing. +func (sig *Signature) buildHashSuffix() (err error) { + hashedSubpacketsLen := subpacketsLength(sig.outSubpackets, true) + + var ok bool + l := 6 + hashedSubpacketsLen + sig.HashSuffix = make([]byte, l+6) + sig.HashSuffix[0] = 4 + sig.HashSuffix[1] = uint8(sig.SigType) + sig.HashSuffix[2] = uint8(sig.PubKeyAlgo) + sig.HashSuffix[3], ok = s2k.HashToHashId(sig.Hash) + if !ok { + sig.HashSuffix = nil + return errors.InvalidArgumentError("hash cannot be represented in OpenPGP: " + strconv.Itoa(int(sig.Hash))) + } + sig.HashSuffix[4] = byte(hashedSubpacketsLen >> 8) + sig.HashSuffix[5] = byte(hashedSubpacketsLen) + serializeSubpackets(sig.HashSuffix[6:l], sig.outSubpackets, true) + trailer := sig.HashSuffix[l:] + trailer[0] = 4 + trailer[1] = 0xff + trailer[2] = byte(l >> 24) + trailer[3] = byte(l >> 16) + trailer[4] = byte(l >> 8) + trailer[5] = byte(l) + return +} + +func (sig *Signature) signPrepareHash(h hash.Hash) (digest []byte, err error) { + err = sig.buildHashSuffix() + if err != nil { + return + } + + h.Write(sig.HashSuffix) + digest = h.Sum(nil) + copy(sig.HashTag[:], digest) + return +} + +// Sign signs a message with a private key. The hash, h, must contain +// the hash of the message to be signed and will be mutated by this function. +// On success, the signature is stored in sig. Call Serialize to write it out. +// If config is nil, sensible defaults will be used. +func (sig *Signature) Sign(h hash.Hash, priv *PrivateKey, config *Config) (err error) { + sig.outSubpackets = sig.buildSubpackets() + digest, err := sig.signPrepareHash(h) + if err != nil { + return + } + + switch priv.PubKeyAlgo { + case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: + // supports both *rsa.PrivateKey and crypto.Signer + sig.RSASignature.bytes, err = priv.PrivateKey.(crypto.Signer).Sign(config.Random(), digest, sig.Hash) + sig.RSASignature.bitLength = uint16(8 * len(sig.RSASignature.bytes)) + case PubKeyAlgoDSA: + dsaPriv := priv.PrivateKey.(*dsa.PrivateKey) + + // Need to truncate hashBytes to match FIPS 186-3 section 4.6. + subgroupSize := (dsaPriv.Q.BitLen() + 7) / 8 + if len(digest) > subgroupSize { + digest = digest[:subgroupSize] + } + r, s, err := dsa.Sign(config.Random(), dsaPriv, digest) + if err == nil { + sig.DSASigR.bytes = r.Bytes() + sig.DSASigR.bitLength = uint16(8 * len(sig.DSASigR.bytes)) + sig.DSASigS.bytes = s.Bytes() + sig.DSASigS.bitLength = uint16(8 * len(sig.DSASigS.bytes)) + } + case PubKeyAlgoECDSA: + var r, s *big.Int + if pk, ok := priv.PrivateKey.(*ecdsa.PrivateKey); ok { + // direct support, avoid asn1 wrapping/unwrapping + r, s, err = ecdsa.Sign(config.Random(), pk, digest) + } else { + var b []byte + b, err = priv.PrivateKey.(crypto.Signer).Sign(config.Random(), digest, nil) + if err == nil { + r, s, err = unwrapECDSASig(b) + } + } + if err == nil { + sig.ECDSASigR = fromBig(r) + sig.ECDSASigS = fromBig(s) + } + default: + err = errors.UnsupportedError("public key algorithm: " + strconv.Itoa(int(sig.PubKeyAlgo))) + } + + return +} + +// unwrapECDSASig parses the two integer components of an ASN.1-encoded ECDSA +// signature. +func unwrapECDSASig(b []byte) (r, s *big.Int, err error) { + var ecsdaSig struct { + R, S *big.Int + } + _, err = asn1.Unmarshal(b, &ecsdaSig) + if err != nil { + return + } + return ecsdaSig.R, ecsdaSig.S, nil +} + +// SignUserId computes a signature from priv, asserting that pub is a valid +// key for the identity id. On success, the signature is stored in sig. Call +// Serialize to write it out. +// If config is nil, sensible defaults will be used. +func (sig *Signature) SignUserId(id string, pub *PublicKey, priv *PrivateKey, config *Config) error { + h, err := userIdSignatureHash(id, pub, sig.Hash) + if err != nil { + return err + } + return sig.Sign(h, priv, config) +} + +// SignKey computes a signature from priv, asserting that pub is a subkey. On +// success, the signature is stored in sig. Call Serialize to write it out. +// If config is nil, sensible defaults will be used. +func (sig *Signature) SignKey(pub *PublicKey, priv *PrivateKey, config *Config) error { + h, err := keySignatureHash(&priv.PublicKey, pub, sig.Hash) + if err != nil { + return err + } + return sig.Sign(h, priv, config) +} + +// Serialize marshals sig to w. Sign, SignUserId or SignKey must have been +// called first. +func (sig *Signature) Serialize(w io.Writer) (err error) { + if len(sig.outSubpackets) == 0 { + sig.outSubpackets = sig.rawSubpackets + } + if sig.RSASignature.bytes == nil && sig.DSASigR.bytes == nil && sig.ECDSASigR.bytes == nil { + return errors.InvalidArgumentError("Signature: need to call Sign, SignUserId or SignKey before Serialize") + } + + sigLength := 0 + switch sig.PubKeyAlgo { + case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: + sigLength = 2 + len(sig.RSASignature.bytes) + case PubKeyAlgoDSA: + sigLength = 2 + len(sig.DSASigR.bytes) + sigLength += 2 + len(sig.DSASigS.bytes) + case PubKeyAlgoECDSA: + sigLength = 2 + len(sig.ECDSASigR.bytes) + sigLength += 2 + len(sig.ECDSASigS.bytes) + default: + panic("impossible") + } + + unhashedSubpacketsLen := subpacketsLength(sig.outSubpackets, false) + length := len(sig.HashSuffix) - 6 /* trailer not included */ + + 2 /* length of unhashed subpackets */ + unhashedSubpacketsLen + + 2 /* hash tag */ + sigLength + err = serializeHeader(w, packetTypeSignature, length) + if err != nil { + return + } + + _, err = w.Write(sig.HashSuffix[:len(sig.HashSuffix)-6]) + if err != nil { + return + } + + unhashedSubpackets := make([]byte, 2+unhashedSubpacketsLen) + unhashedSubpackets[0] = byte(unhashedSubpacketsLen >> 8) + unhashedSubpackets[1] = byte(unhashedSubpacketsLen) + serializeSubpackets(unhashedSubpackets[2:], sig.outSubpackets, false) + + _, err = w.Write(unhashedSubpackets) + if err != nil { + return + } + _, err = w.Write(sig.HashTag[:]) + if err != nil { + return + } + + switch sig.PubKeyAlgo { + case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: + err = writeMPIs(w, sig.RSASignature) + case PubKeyAlgoDSA: + err = writeMPIs(w, sig.DSASigR, sig.DSASigS) + case PubKeyAlgoECDSA: + err = writeMPIs(w, sig.ECDSASigR, sig.ECDSASigS) + default: + panic("impossible") + } + return +} + +// outputSubpacket represents a subpacket to be marshaled. +type outputSubpacket struct { + hashed bool // true if this subpacket is in the hashed area. + subpacketType signatureSubpacketType + isCritical bool + contents []byte +} + +func (sig *Signature) buildSubpackets() (subpackets []outputSubpacket) { + creationTime := make([]byte, 4) + binary.BigEndian.PutUint32(creationTime, uint32(sig.CreationTime.Unix())) + subpackets = append(subpackets, outputSubpacket{true, creationTimeSubpacket, false, creationTime}) + + if sig.IssuerKeyId != nil { + keyId := make([]byte, 8) + binary.BigEndian.PutUint64(keyId, *sig.IssuerKeyId) + subpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, false, keyId}) + } + + if sig.SigLifetimeSecs != nil && *sig.SigLifetimeSecs != 0 { + sigLifetime := make([]byte, 4) + binary.BigEndian.PutUint32(sigLifetime, *sig.SigLifetimeSecs) + subpackets = append(subpackets, outputSubpacket{true, signatureExpirationSubpacket, true, sigLifetime}) + } + + // Key flags may only appear in self-signatures or certification signatures. + + if sig.FlagsValid { + var flags byte + if sig.FlagCertify { + flags |= KeyFlagCertify + } + if sig.FlagSign { + flags |= KeyFlagSign + } + if sig.FlagEncryptCommunications { + flags |= KeyFlagEncryptCommunications + } + if sig.FlagEncryptStorage { + flags |= KeyFlagEncryptStorage + } + subpackets = append(subpackets, outputSubpacket{true, keyFlagsSubpacket, false, []byte{flags}}) + } + + // The following subpackets may only appear in self-signatures + + if sig.KeyLifetimeSecs != nil && *sig.KeyLifetimeSecs != 0 { + keyLifetime := make([]byte, 4) + binary.BigEndian.PutUint32(keyLifetime, *sig.KeyLifetimeSecs) + subpackets = append(subpackets, outputSubpacket{true, keyExpirationSubpacket, true, keyLifetime}) + } + + if sig.IsPrimaryId != nil && *sig.IsPrimaryId { + subpackets = append(subpackets, outputSubpacket{true, primaryUserIdSubpacket, false, []byte{1}}) + } + + if len(sig.PreferredSymmetric) > 0 { + subpackets = append(subpackets, outputSubpacket{true, prefSymmetricAlgosSubpacket, false, sig.PreferredSymmetric}) + } + + if len(sig.PreferredHash) > 0 { + subpackets = append(subpackets, outputSubpacket{true, prefHashAlgosSubpacket, false, sig.PreferredHash}) + } + + if len(sig.PreferredCompression) > 0 { + subpackets = append(subpackets, outputSubpacket{true, prefCompressionSubpacket, false, sig.PreferredCompression}) + } + + return +} diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/signature_v3.go b/vendor/golang.org/x/crypto/openpgp/packet/signature_v3.go similarity index 97% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/signature_v3.go rename to vendor/golang.org/x/crypto/openpgp/packet/signature_v3.go index dfca651..6edff88 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/signature_v3.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/signature_v3.go @@ -12,8 +12,8 @@ import ( "strconv" "time" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/openpgp/s2k" + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/s2k" ) // SignatureV3 represents older version 3 signatures. These signatures are less secure diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/symmetric_key_encrypted.go b/vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go similarity index 93% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/symmetric_key_encrypted.go rename to vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go index d2bef0c..744c2d2 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/symmetric_key_encrypted.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go @@ -10,8 +10,8 @@ import ( "io" "strconv" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/openpgp/s2k" + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/s2k" ) // This is the largest session key that we'll support. Since no 512-bit cipher @@ -48,9 +48,6 @@ func (ske *SymmetricKeyEncrypted) parse(r io.Reader) error { if err != nil { return err } - if ske.s2k == nil { - return errors.UnsupportedError("can't use dummy S2K for symmetric key encryption") - } encryptedKey := make([]byte, maxSessionKeySizeInBytes) // The session key may follow. We just have to try and read to find @@ -91,10 +88,10 @@ func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) ([]byte, CipherFunc return nil, ske.CipherFunc, errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(cipherFunc))) } plaintextKey = plaintextKey[1:] - if l := len(plaintextKey); l == 0 || l%cipherFunc.blockSize() != 0 { - return nil, cipherFunc, errors.StructuralError("length of decrypted key not a multiple of block size") + if l, cipherKeySize := len(plaintextKey), cipherFunc.KeySize(); l != cipherFunc.KeySize() { + return nil, cipherFunc, errors.StructuralError("length of decrypted key (" + strconv.Itoa(l) + ") " + + "not equal to cipher keysize (" + strconv.Itoa(cipherKeySize) + ")") } - return plaintextKey, cipherFunc, nil } diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/symmetrically_encrypted.go b/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go similarity index 99% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/symmetrically_encrypted.go rename to vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go index fd4f8f0..6126030 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/packet/symmetrically_encrypted.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go @@ -8,11 +8,10 @@ import ( "crypto/cipher" "crypto/sha1" "crypto/subtle" + "golang.org/x/crypto/openpgp/errors" "hash" "io" "strconv" - - "github.com/keybase/go-crypto/openpgp/errors" ) // SymmetricallyEncrypted represents a symmetrically encrypted byte string. The diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/userattribute.go b/vendor/golang.org/x/crypto/openpgp/packet/userattribute.go similarity index 100% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/userattribute.go rename to vendor/golang.org/x/crypto/openpgp/packet/userattribute.go diff --git a/vendor/github.com/keybase/go-crypto/openpgp/packet/userid.go b/vendor/golang.org/x/crypto/openpgp/packet/userid.go similarity index 100% rename from vendor/github.com/keybase/go-crypto/openpgp/packet/userid.go rename to vendor/golang.org/x/crypto/openpgp/packet/userid.go diff --git a/vendor/github.com/keybase/go-crypto/openpgp/read.go b/vendor/golang.org/x/crypto/openpgp/read.go similarity index 91% rename from vendor/github.com/keybase/go-crypto/openpgp/read.go rename to vendor/golang.org/x/crypto/openpgp/read.go index 766d9f5..6ec664f 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/read.go +++ b/vendor/golang.org/x/crypto/openpgp/read.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package openpgp implements high level operations on OpenPGP messages. -package openpgp // import "github.com/keybase/go-crypto/openpgp" +package openpgp // import "golang.org/x/crypto/openpgp" import ( "crypto" @@ -12,9 +12,9 @@ import ( "io" "strconv" - "github.com/keybase/go-crypto/openpgp/armor" - "github.com/keybase/go-crypto/openpgp/errors" - "github.com/keybase/go-crypto/openpgp/packet" + "golang.org/x/crypto/openpgp/armor" + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/packet" ) // SignatureType is the armor type for a PGP signature. @@ -50,7 +50,7 @@ type MessageDetails struct { // If IsSigned is true and SignedBy is non-zero then the signature will // be verified as UnverifiedBody is read. The signature cannot be // checked until the whole of UnverifiedBody is read so UnverifiedBody - // must be consumed until EOF before the data can trusted. Even if a + // must be consumed until EOF before the data can be trusted. Even if a // message isn't signed (or the signer is unknown) the data may contain // an authentication code that is only checked once UnverifiedBody has // been consumed. Once EOF has been seen, the following fields are @@ -113,7 +113,7 @@ ParsePackets: // This packet contains the decryption key encrypted to a public key. md.EncryptedToKeyIds = append(md.EncryptedToKeyIds, p.KeyId) switch p.Algo { - case packet.PubKeyAlgoRSA, packet.PubKeyAlgoRSAEncryptOnly, packet.PubKeyAlgoElGamal, packet.PubKeyAlgoECDH: + case packet.PubKeyAlgoRSA, packet.PubKeyAlgoRSAEncryptOnly, packet.PubKeyAlgoElGamal: break default: continue @@ -361,11 +361,6 @@ func (scr *signatureCheckReader) Read(buf []byte) (n int, err error) { // returns the signer if the signature is valid. If the signer isn't known, // ErrUnknownIssuer is returned. func CheckDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, err error) { - signer, _, err = checkDetachedSignature(keyring, signed, signature) - return signer, err -} - -func checkDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, issuer *uint64, err error) { var issuerKeyId uint64 var hashFunc crypto.Hash var sigType packet.SignatureType @@ -376,16 +371,16 @@ func checkDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signe for { p, err = packets.Next() if err == io.EOF { - return nil, nil, errors.ErrUnknownIssuer + return nil, errors.ErrUnknownIssuer } if err != nil { - return nil, nil, err + return nil, err } switch sig := p.(type) { case *packet.Signature: if sig.IssuerKeyId == nil { - return nil, nil, errors.StructuralError("signature doesn't have an issuer") + return nil, errors.StructuralError("signature doesn't have an issuer") } issuerKeyId = *sig.IssuerKeyId hashFunc = sig.Hash @@ -395,7 +390,7 @@ func checkDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signe hashFunc = sig.Hash sigType = sig.SigType default: - return nil, nil, errors.StructuralError("non signature packet found") + return nil, errors.StructuralError("non signature packet found") } keys = keyring.KeysByIdUsage(issuerKeyId, packet.KeyFlagSign) @@ -410,11 +405,11 @@ func checkDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signe h, wrappedHash, err := hashForSignature(hashFunc, sigType) if err != nil { - return nil, nil, err + return nil, err } if _, err := io.Copy(wrappedHash, signed); err != nil && err != io.EOF { - return nil, nil, err + return nil, err } for _, key := range keys { @@ -428,24 +423,20 @@ func checkDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signe } if err == nil { - return key.Entity, &issuerKeyId, nil + return key.Entity, nil } } - return nil, nil, err + return nil, err } // CheckArmoredDetachedSignature performs the same actions as // CheckDetachedSignature but expects the signature to be armored. func CheckArmoredDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, err error) { - signer, _, err = checkArmoredDetachedSignature(keyring, signed, signature) - return signer, err -} - -func checkArmoredDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, issuer *uint64, err error) { body, err := readArmored(signature, SignatureType) if err != nil { return } - return checkDetachedSignature(keyring, signed, body) + + return CheckDetachedSignature(keyring, signed, body) } diff --git a/vendor/github.com/keybase/go-crypto/openpgp/s2k/s2k.go b/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go similarity index 83% rename from vendor/github.com/keybase/go-crypto/openpgp/s2k/s2k.go rename to vendor/golang.org/x/crypto/openpgp/s2k/s2k.go index 01bb678..4b9a44c 100644 --- a/vendor/github.com/keybase/go-crypto/openpgp/s2k/s2k.go +++ b/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go @@ -4,7 +4,7 @@ // Package s2k implements the various OpenPGP string-to-key transforms as // specified in RFC 4800 section 3.7.1. -package s2k // import "github.com/keybase/go-crypto/openpgp/s2k" +package s2k // import "golang.org/x/crypto/openpgp/s2k" import ( "crypto" @@ -12,7 +12,7 @@ import ( "io" "strconv" - "github.com/keybase/go-crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/errors" ) // Config collects configuration parameters for s2k key-stretching @@ -151,53 +151,6 @@ func Iterated(out []byte, h hash.Hash, in []byte, salt []byte, count int) { } } -func parseGNUExtensions(r io.Reader) (f func(out, in []byte), err error) { - var buf [9]byte - - // A three-byte string identifier - _, err = io.ReadFull(r, buf[:3]) - if err != nil { - return - } - gnuExt := string(buf[:3]) - - if gnuExt != "GNU" { - return nil, errors.UnsupportedError("Malformed GNU extension: " + gnuExt) - } - _, err = io.ReadFull(r, buf[:1]) - if err != nil { - return - } - gnuExtType := int(buf[0]) - switch gnuExtType { - case 1: - return nil, nil - case 2: - // Read a serial number, which is prefixed by a 1-byte length. - // The maximum length is 16. - var lenBuf [1]byte - _, err = io.ReadFull(r, lenBuf[:]) - if err != nil { - return - } - - maxLen := 16 - ivLen := int(lenBuf[0]) - if ivLen > maxLen { - ivLen = maxLen - } - ivBuf := make([]byte, ivLen) - // For now we simply discard the IV - _, err = io.ReadFull(r, ivBuf) - if err != nil { - return - } - return nil, nil - default: - return nil, errors.UnsupportedError("unknown S2K GNU protection mode: " + strconv.Itoa(int(gnuExtType))) - } -} - // Parse reads a binary specification for a string-to-key transformation from r // and returns a function which performs that transform. func Parse(r io.Reader) (f func(out, in []byte), err error) { @@ -208,12 +161,6 @@ func Parse(r io.Reader) (f func(out, in []byte), err error) { return } - // GNU Extensions; handle them before we try to look for a hash, which won't - // be needed in most cases anyway. - if buf[0] == 101 { - return parseGNUExtensions(r) - } - hash, ok := HashIdToHash(buf[1]) if !ok { return nil, errors.UnsupportedError("hash for S2K function: " + strconv.Itoa(int(buf[1]))) @@ -304,7 +251,7 @@ func HashIdToHash(id byte) (h crypto.Hash, ok bool) { } // HashIdToString returns the name of the hash function corresponding to the -// given OpenPGP hash id, or panics if id is unknown. +// given OpenPGP hash id. func HashIdToString(id byte) (name string, ok bool) { for _, m := range hashToHashIdMapping { if m.id == id { diff --git a/vendor/golang.org/x/crypto/openpgp/write.go b/vendor/golang.org/x/crypto/openpgp/write.go new file mode 100644 index 0000000..65a304c --- /dev/null +++ b/vendor/golang.org/x/crypto/openpgp/write.go @@ -0,0 +1,378 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package openpgp + +import ( + "crypto" + "hash" + "io" + "strconv" + "time" + + "golang.org/x/crypto/openpgp/armor" + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/packet" + "golang.org/x/crypto/openpgp/s2k" +) + +// DetachSign signs message with the private key from signer (which must +// already have been decrypted) and writes the signature to w. +// If config is nil, sensible defaults will be used. +func DetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { + return detachSign(w, signer, message, packet.SigTypeBinary, config) +} + +// ArmoredDetachSign signs message with the private key from signer (which +// must already have been decrypted) and writes an armored signature to w. +// If config is nil, sensible defaults will be used. +func ArmoredDetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) (err error) { + return armoredDetachSign(w, signer, message, packet.SigTypeBinary, config) +} + +// DetachSignText signs message (after canonicalising the line endings) with +// the private key from signer (which must already have been decrypted) and +// writes the signature to w. +// If config is nil, sensible defaults will be used. +func DetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { + return detachSign(w, signer, message, packet.SigTypeText, config) +} + +// ArmoredDetachSignText signs message (after canonicalising the line endings) +// with the private key from signer (which must already have been decrypted) +// and writes an armored signature to w. +// If config is nil, sensible defaults will be used. +func ArmoredDetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { + return armoredDetachSign(w, signer, message, packet.SigTypeText, config) +} + +func armoredDetachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { + out, err := armor.Encode(w, SignatureType, nil) + if err != nil { + return + } + err = detachSign(out, signer, message, sigType, config) + if err != nil { + return + } + return out.Close() +} + +func detachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { + if signer.PrivateKey == nil { + return errors.InvalidArgumentError("signing key doesn't have a private key") + } + if signer.PrivateKey.Encrypted { + return errors.InvalidArgumentError("signing key is encrypted") + } + + sig := new(packet.Signature) + sig.SigType = sigType + sig.PubKeyAlgo = signer.PrivateKey.PubKeyAlgo + sig.Hash = config.Hash() + sig.CreationTime = config.Now() + sig.IssuerKeyId = &signer.PrivateKey.KeyId + + h, wrappedHash, err := hashForSignature(sig.Hash, sig.SigType) + if err != nil { + return + } + io.Copy(wrappedHash, message) + + err = sig.Sign(h, signer.PrivateKey, config) + if err != nil { + return + } + + return sig.Serialize(w) +} + +// FileHints contains metadata about encrypted files. This metadata is, itself, +// encrypted. +type FileHints struct { + // IsBinary can be set to hint that the contents are binary data. + IsBinary bool + // FileName hints at the name of the file that should be written. It's + // truncated to 255 bytes if longer. It may be empty to suggest that the + // file should not be written to disk. It may be equal to "_CONSOLE" to + // suggest the data should not be written to disk. + FileName string + // ModTime contains the modification time of the file, or the zero time if not applicable. + ModTime time.Time +} + +// SymmetricallyEncrypt acts like gpg -c: it encrypts a file with a passphrase. +// The resulting WriteCloser must be closed after the contents of the file have +// been written. +// If config is nil, sensible defaults will be used. +func SymmetricallyEncrypt(ciphertext io.Writer, passphrase []byte, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { + if hints == nil { + hints = &FileHints{} + } + + key, err := packet.SerializeSymmetricKeyEncrypted(ciphertext, passphrase, config) + if err != nil { + return + } + w, err := packet.SerializeSymmetricallyEncrypted(ciphertext, config.Cipher(), key, config) + if err != nil { + return + } + + literaldata := w + if algo := config.Compression(); algo != packet.CompressionNone { + var compConfig *packet.CompressionConfig + if config != nil { + compConfig = config.CompressionConfig + } + literaldata, err = packet.SerializeCompressed(w, algo, compConfig) + if err != nil { + return + } + } + + var epochSeconds uint32 + if !hints.ModTime.IsZero() { + epochSeconds = uint32(hints.ModTime.Unix()) + } + return packet.SerializeLiteral(literaldata, hints.IsBinary, hints.FileName, epochSeconds) +} + +// intersectPreferences mutates and returns a prefix of a that contains only +// the values in the intersection of a and b. The order of a is preserved. +func intersectPreferences(a []uint8, b []uint8) (intersection []uint8) { + var j int + for _, v := range a { + for _, v2 := range b { + if v == v2 { + a[j] = v + j++ + break + } + } + } + + return a[:j] +} + +func hashToHashId(h crypto.Hash) uint8 { + v, ok := s2k.HashToHashId(h) + if !ok { + panic("tried to convert unknown hash") + } + return v +} + +// Encrypt encrypts a message to a number of recipients and, optionally, signs +// it. hints contains optional information, that is also encrypted, that aids +// the recipients in processing the message. The resulting WriteCloser must +// be closed after the contents of the file have been written. +// If config is nil, sensible defaults will be used. +func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { + var signer *packet.PrivateKey + if signed != nil { + signKey, ok := signed.signingKey(config.Now()) + if !ok { + return nil, errors.InvalidArgumentError("no valid signing keys") + } + signer = signKey.PrivateKey + if signer == nil { + return nil, errors.InvalidArgumentError("no private key in signing key") + } + if signer.Encrypted { + return nil, errors.InvalidArgumentError("signing key must be decrypted") + } + } + + // These are the possible ciphers that we'll use for the message. + candidateCiphers := []uint8{ + uint8(packet.CipherAES128), + uint8(packet.CipherAES256), + uint8(packet.CipherCAST5), + } + // These are the possible hash functions that we'll use for the signature. + candidateHashes := []uint8{ + hashToHashId(crypto.SHA256), + hashToHashId(crypto.SHA512), + hashToHashId(crypto.SHA1), + hashToHashId(crypto.RIPEMD160), + } + // In the event that a recipient doesn't specify any supported ciphers + // or hash functions, these are the ones that we assume that every + // implementation supports. + defaultCiphers := candidateCiphers[len(candidateCiphers)-1:] + defaultHashes := candidateHashes[len(candidateHashes)-1:] + + encryptKeys := make([]Key, len(to)) + for i := range to { + var ok bool + encryptKeys[i], ok = to[i].encryptionKey(config.Now()) + if !ok { + return nil, errors.InvalidArgumentError("cannot encrypt a message to key id " + strconv.FormatUint(to[i].PrimaryKey.KeyId, 16) + " because it has no encryption keys") + } + + sig := to[i].primaryIdentity().SelfSignature + + preferredSymmetric := sig.PreferredSymmetric + if len(preferredSymmetric) == 0 { + preferredSymmetric = defaultCiphers + } + preferredHashes := sig.PreferredHash + if len(preferredHashes) == 0 { + preferredHashes = defaultHashes + } + candidateCiphers = intersectPreferences(candidateCiphers, preferredSymmetric) + candidateHashes = intersectPreferences(candidateHashes, preferredHashes) + } + + if len(candidateCiphers) == 0 || len(candidateHashes) == 0 { + return nil, errors.InvalidArgumentError("cannot encrypt because recipient set shares no common algorithms") + } + + cipher := packet.CipherFunction(candidateCiphers[0]) + // If the cipher specified by config is a candidate, we'll use that. + configuredCipher := config.Cipher() + for _, c := range candidateCiphers { + cipherFunc := packet.CipherFunction(c) + if cipherFunc == configuredCipher { + cipher = cipherFunc + break + } + } + + var hash crypto.Hash + for _, hashId := range candidateHashes { + if h, ok := s2k.HashIdToHash(hashId); ok && h.Available() { + hash = h + break + } + } + + // If the hash specified by config is a candidate, we'll use that. + if configuredHash := config.Hash(); configuredHash.Available() { + for _, hashId := range candidateHashes { + if h, ok := s2k.HashIdToHash(hashId); ok && h == configuredHash { + hash = h + break + } + } + } + + if hash == 0 { + hashId := candidateHashes[0] + name, ok := s2k.HashIdToString(hashId) + if !ok { + name = "#" + strconv.Itoa(int(hashId)) + } + return nil, errors.InvalidArgumentError("cannot encrypt because no candidate hash functions are compiled in. (Wanted " + name + " in this case.)") + } + + symKey := make([]byte, cipher.KeySize()) + if _, err := io.ReadFull(config.Random(), symKey); err != nil { + return nil, err + } + + for _, key := range encryptKeys { + if err := packet.SerializeEncryptedKey(ciphertext, key.PublicKey, cipher, symKey, config); err != nil { + return nil, err + } + } + + encryptedData, err := packet.SerializeSymmetricallyEncrypted(ciphertext, cipher, symKey, config) + if err != nil { + return + } + + if signer != nil { + ops := &packet.OnePassSignature{ + SigType: packet.SigTypeBinary, + Hash: hash, + PubKeyAlgo: signer.PubKeyAlgo, + KeyId: signer.KeyId, + IsLast: true, + } + if err := ops.Serialize(encryptedData); err != nil { + return nil, err + } + } + + if hints == nil { + hints = &FileHints{} + } + + w := encryptedData + if signer != nil { + // If we need to write a signature packet after the literal + // data then we need to stop literalData from closing + // encryptedData. + w = noOpCloser{encryptedData} + + } + var epochSeconds uint32 + if !hints.ModTime.IsZero() { + epochSeconds = uint32(hints.ModTime.Unix()) + } + literalData, err := packet.SerializeLiteral(w, hints.IsBinary, hints.FileName, epochSeconds) + if err != nil { + return nil, err + } + + if signer != nil { + return signatureWriter{encryptedData, literalData, hash, hash.New(), signer, config}, nil + } + return literalData, nil +} + +// signatureWriter hashes the contents of a message while passing it along to +// literalData. When closed, it closes literalData, writes a signature packet +// to encryptedData and then also closes encryptedData. +type signatureWriter struct { + encryptedData io.WriteCloser + literalData io.WriteCloser + hashType crypto.Hash + h hash.Hash + signer *packet.PrivateKey + config *packet.Config +} + +func (s signatureWriter) Write(data []byte) (int, error) { + s.h.Write(data) + return s.literalData.Write(data) +} + +func (s signatureWriter) Close() error { + sig := &packet.Signature{ + SigType: packet.SigTypeBinary, + PubKeyAlgo: s.signer.PubKeyAlgo, + Hash: s.hashType, + CreationTime: s.config.Now(), + IssuerKeyId: &s.signer.KeyId, + } + + if err := sig.Sign(s.h, s.signer, s.config); err != nil { + return err + } + if err := s.literalData.Close(); err != nil { + return err + } + if err := sig.Serialize(s.encryptedData); err != nil { + return err + } + return s.encryptedData.Close() +} + +// noOpCloser is like an ioutil.NopCloser, but for an io.Writer. +// TODO: we have two of these in OpenPGP packages alone. This probably needs +// to be promoted somewhere more common. +type noOpCloser struct { + w io.Writer +} + +func (c noOpCloser) Write(data []byte) (n int, err error) { + return c.w.Write(data) +} + +func (c noOpCloser) Close() error { + return nil +} diff --git a/vendor/golang.org/x/crypto/ssh/buffer.go b/vendor/golang.org/x/crypto/ssh/buffer.go deleted file mode 100644 index 6931b51..0000000 --- a/vendor/golang.org/x/crypto/ssh/buffer.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "io" - "sync" -) - -// buffer provides a linked list buffer for data exchange -// between producer and consumer. Theoretically the buffer is -// of unlimited capacity as it does no allocation of its own. -type buffer struct { - // protects concurrent access to head, tail and closed - *sync.Cond - - head *element // the buffer that will be read first - tail *element // the buffer that will be read last - - closed bool -} - -// An element represents a single link in a linked list. -type element struct { - buf []byte - next *element -} - -// newBuffer returns an empty buffer that is not closed. -func newBuffer() *buffer { - e := new(element) - b := &buffer{ - Cond: newCond(), - head: e, - tail: e, - } - return b -} - -// write makes buf available for Read to receive. -// buf must not be modified after the call to write. -func (b *buffer) write(buf []byte) { - b.Cond.L.Lock() - e := &element{buf: buf} - b.tail.next = e - b.tail = e - b.Cond.Signal() - b.Cond.L.Unlock() -} - -// eof closes the buffer. Reads from the buffer once all -// the data has been consumed will receive os.EOF. -func (b *buffer) eof() error { - b.Cond.L.Lock() - b.closed = true - b.Cond.Signal() - b.Cond.L.Unlock() - return nil -} - -// Read reads data from the internal buffer in buf. Reads will block -// if no data is available, or until the buffer is closed. -func (b *buffer) Read(buf []byte) (n int, err error) { - b.Cond.L.Lock() - defer b.Cond.L.Unlock() - - for len(buf) > 0 { - // if there is data in b.head, copy it - if len(b.head.buf) > 0 { - r := copy(buf, b.head.buf) - buf, b.head.buf = buf[r:], b.head.buf[r:] - n += r - continue - } - // if there is a next buffer, make it the head - if len(b.head.buf) == 0 && b.head != b.tail { - b.head = b.head.next - continue - } - - // if at least one byte has been copied, return - if n > 0 { - break - } - - // if nothing was read, and there is nothing outstanding - // check to see if the buffer is closed. - if b.closed { - err = io.EOF - break - } - // out of buffers, wait for producer - b.Cond.Wait() - } - return -} diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go deleted file mode 100644 index 6331c94..0000000 --- a/vendor/golang.org/x/crypto/ssh/certs.go +++ /dev/null @@ -1,503 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "bytes" - "errors" - "fmt" - "io" - "net" - "sort" - "time" -) - -// These constants from [PROTOCOL.certkeys] represent the algorithm names -// for certificate types supported by this package. -const ( - CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com" - CertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com" - CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com" - CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com" - CertAlgoECDSA521v01 = "ecdsa-sha2-nistp521-cert-v01@openssh.com" - CertAlgoED25519v01 = "ssh-ed25519-cert-v01@openssh.com" -) - -// Certificate types distinguish between host and user -// certificates. The values can be set in the CertType field of -// Certificate. -const ( - UserCert = 1 - HostCert = 2 -) - -// Signature represents a cryptographic signature. -type Signature struct { - Format string - Blob []byte -} - -// CertTimeInfinity can be used for OpenSSHCertV01.ValidBefore to indicate that -// a certificate does not expire. -const CertTimeInfinity = 1<<64 - 1 - -// An Certificate represents an OpenSSH certificate as defined in -// [PROTOCOL.certkeys]?rev=1.8. -type Certificate struct { - Nonce []byte - Key PublicKey - Serial uint64 - CertType uint32 - KeyId string - ValidPrincipals []string - ValidAfter uint64 - ValidBefore uint64 - Permissions - Reserved []byte - SignatureKey PublicKey - Signature *Signature -} - -// genericCertData holds the key-independent part of the certificate data. -// Overall, certificates contain an nonce, public key fields and -// key-independent fields. -type genericCertData struct { - Serial uint64 - CertType uint32 - KeyId string - ValidPrincipals []byte - ValidAfter uint64 - ValidBefore uint64 - CriticalOptions []byte - Extensions []byte - Reserved []byte - SignatureKey []byte - Signature []byte -} - -func marshalStringList(namelist []string) []byte { - var to []byte - for _, name := range namelist { - s := struct{ N string }{name} - to = append(to, Marshal(&s)...) - } - return to -} - -type optionsTuple struct { - Key string - Value []byte -} - -type optionsTupleValue struct { - Value string -} - -// serialize a map of critical options or extensions -// issue #10569 - per [PROTOCOL.certkeys] and SSH implementation, -// we need two length prefixes for a non-empty string value -func marshalTuples(tups map[string]string) []byte { - keys := make([]string, 0, len(tups)) - for key := range tups { - keys = append(keys, key) - } - sort.Strings(keys) - - var ret []byte - for _, key := range keys { - s := optionsTuple{Key: key} - if value := tups[key]; len(value) > 0 { - s.Value = Marshal(&optionsTupleValue{value}) - } - ret = append(ret, Marshal(&s)...) - } - return ret -} - -// issue #10569 - per [PROTOCOL.certkeys] and SSH implementation, -// we need two length prefixes for a non-empty option value -func parseTuples(in []byte) (map[string]string, error) { - tups := map[string]string{} - var lastKey string - var haveLastKey bool - - for len(in) > 0 { - var key, val, extra []byte - var ok bool - - if key, in, ok = parseString(in); !ok { - return nil, errShortRead - } - keyStr := string(key) - // according to [PROTOCOL.certkeys], the names must be in - // lexical order. - if haveLastKey && keyStr <= lastKey { - return nil, fmt.Errorf("ssh: certificate options are not in lexical order") - } - lastKey, haveLastKey = keyStr, true - // the next field is a data field, which if non-empty has a string embedded - if val, in, ok = parseString(in); !ok { - return nil, errShortRead - } - if len(val) > 0 { - val, extra, ok = parseString(val) - if !ok { - return nil, errShortRead - } - if len(extra) > 0 { - return nil, fmt.Errorf("ssh: unexpected trailing data after certificate option value") - } - tups[keyStr] = string(val) - } else { - tups[keyStr] = "" - } - } - return tups, nil -} - -func parseCert(in []byte, privAlgo string) (*Certificate, error) { - nonce, rest, ok := parseString(in) - if !ok { - return nil, errShortRead - } - - key, rest, err := parsePubKey(rest, privAlgo) - if err != nil { - return nil, err - } - - var g genericCertData - if err := Unmarshal(rest, &g); err != nil { - return nil, err - } - - c := &Certificate{ - Nonce: nonce, - Key: key, - Serial: g.Serial, - CertType: g.CertType, - KeyId: g.KeyId, - ValidAfter: g.ValidAfter, - ValidBefore: g.ValidBefore, - } - - for principals := g.ValidPrincipals; len(principals) > 0; { - principal, rest, ok := parseString(principals) - if !ok { - return nil, errShortRead - } - c.ValidPrincipals = append(c.ValidPrincipals, string(principal)) - principals = rest - } - - c.CriticalOptions, err = parseTuples(g.CriticalOptions) - if err != nil { - return nil, err - } - c.Extensions, err = parseTuples(g.Extensions) - if err != nil { - return nil, err - } - c.Reserved = g.Reserved - k, err := ParsePublicKey(g.SignatureKey) - if err != nil { - return nil, err - } - - c.SignatureKey = k - c.Signature, rest, ok = parseSignatureBody(g.Signature) - if !ok || len(rest) > 0 { - return nil, errors.New("ssh: signature parse error") - } - - return c, nil -} - -type openSSHCertSigner struct { - pub *Certificate - signer Signer -} - -// NewCertSigner returns a Signer that signs with the given Certificate, whose -// private key is held by signer. It returns an error if the public key in cert -// doesn't match the key used by signer. -func NewCertSigner(cert *Certificate, signer Signer) (Signer, error) { - if bytes.Compare(cert.Key.Marshal(), signer.PublicKey().Marshal()) != 0 { - return nil, errors.New("ssh: signer and cert have different public key") - } - - return &openSSHCertSigner{cert, signer}, nil -} - -func (s *openSSHCertSigner) Sign(rand io.Reader, data []byte) (*Signature, error) { - return s.signer.Sign(rand, data) -} - -func (s *openSSHCertSigner) PublicKey() PublicKey { - return s.pub -} - -const sourceAddressCriticalOption = "source-address" - -// CertChecker does the work of verifying a certificate. Its methods -// can be plugged into ClientConfig.HostKeyCallback and -// ServerConfig.PublicKeyCallback. For the CertChecker to work, -// minimally, the IsAuthority callback should be set. -type CertChecker struct { - // SupportedCriticalOptions lists the CriticalOptions that the - // server application layer understands. These are only used - // for user certificates. - SupportedCriticalOptions []string - - // IsAuthority should return true if the key is recognized as - // an authority. This allows for certificates to be signed by other - // certificates. - IsAuthority func(auth PublicKey) bool - - // Clock is used for verifying time stamps. If nil, time.Now - // is used. - Clock func() time.Time - - // UserKeyFallback is called when CertChecker.Authenticate encounters a - // public key that is not a certificate. It must implement validation - // of user keys or else, if nil, all such keys are rejected. - UserKeyFallback func(conn ConnMetadata, key PublicKey) (*Permissions, error) - - // HostKeyFallback is called when CertChecker.CheckHostKey encounters a - // public key that is not a certificate. It must implement host key - // validation or else, if nil, all such keys are rejected. - HostKeyFallback func(addr string, remote net.Addr, key PublicKey) error - - // IsRevoked is called for each certificate so that revocation checking - // can be implemented. It should return true if the given certificate - // is revoked and false otherwise. If nil, no certificates are - // considered to have been revoked. - IsRevoked func(cert *Certificate) bool -} - -// CheckHostKey checks a host key certificate. This method can be -// plugged into ClientConfig.HostKeyCallback. -func (c *CertChecker) CheckHostKey(addr string, remote net.Addr, key PublicKey) error { - cert, ok := key.(*Certificate) - if !ok { - if c.HostKeyFallback != nil { - return c.HostKeyFallback(addr, remote, key) - } - return errors.New("ssh: non-certificate host key") - } - if cert.CertType != HostCert { - return fmt.Errorf("ssh: certificate presented as a host key has type %d", cert.CertType) - } - - return c.CheckCert(addr, cert) -} - -// Authenticate checks a user certificate. Authenticate can be used as -// a value for ServerConfig.PublicKeyCallback. -func (c *CertChecker) Authenticate(conn ConnMetadata, pubKey PublicKey) (*Permissions, error) { - cert, ok := pubKey.(*Certificate) - if !ok { - if c.UserKeyFallback != nil { - return c.UserKeyFallback(conn, pubKey) - } - return nil, errors.New("ssh: normal key pairs not accepted") - } - - if cert.CertType != UserCert { - return nil, fmt.Errorf("ssh: cert has type %d", cert.CertType) - } - - if err := c.CheckCert(conn.User(), cert); err != nil { - return nil, err - } - - return &cert.Permissions, nil -} - -// CheckCert checks CriticalOptions, ValidPrincipals, revocation, timestamp and -// the signature of the certificate. -func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { - if c.IsRevoked != nil && c.IsRevoked(cert) { - return fmt.Errorf("ssh: certicate serial %d revoked", cert.Serial) - } - - for opt, _ := range cert.CriticalOptions { - // sourceAddressCriticalOption will be enforced by - // serverAuthenticate - if opt == sourceAddressCriticalOption { - continue - } - - found := false - for _, supp := range c.SupportedCriticalOptions { - if supp == opt { - found = true - break - } - } - if !found { - return fmt.Errorf("ssh: unsupported critical option %q in certificate", opt) - } - } - - if len(cert.ValidPrincipals) > 0 { - // By default, certs are valid for all users/hosts. - found := false - for _, p := range cert.ValidPrincipals { - if p == principal { - found = true - break - } - } - if !found { - return fmt.Errorf("ssh: principal %q not in the set of valid principals for given certificate: %q", principal, cert.ValidPrincipals) - } - } - - if !c.IsAuthority(cert.SignatureKey) { - return fmt.Errorf("ssh: certificate signed by unrecognized authority") - } - - clock := c.Clock - if clock == nil { - clock = time.Now - } - - unixNow := clock().Unix() - if after := int64(cert.ValidAfter); after < 0 || unixNow < int64(cert.ValidAfter) { - return fmt.Errorf("ssh: cert is not yet valid") - } - if before := int64(cert.ValidBefore); cert.ValidBefore != uint64(CertTimeInfinity) && (unixNow >= before || before < 0) { - return fmt.Errorf("ssh: cert has expired") - } - if err := cert.SignatureKey.Verify(cert.bytesForSigning(), cert.Signature); err != nil { - return fmt.Errorf("ssh: certificate signature does not verify") - } - - return nil -} - -// SignCert sets c.SignatureKey to the authority's public key and stores a -// Signature, by authority, in the certificate. -func (c *Certificate) SignCert(rand io.Reader, authority Signer) error { - c.Nonce = make([]byte, 32) - if _, err := io.ReadFull(rand, c.Nonce); err != nil { - return err - } - c.SignatureKey = authority.PublicKey() - - sig, err := authority.Sign(rand, c.bytesForSigning()) - if err != nil { - return err - } - c.Signature = sig - return nil -} - -var certAlgoNames = map[string]string{ - KeyAlgoRSA: CertAlgoRSAv01, - KeyAlgoDSA: CertAlgoDSAv01, - KeyAlgoECDSA256: CertAlgoECDSA256v01, - KeyAlgoECDSA384: CertAlgoECDSA384v01, - KeyAlgoECDSA521: CertAlgoECDSA521v01, - KeyAlgoED25519: CertAlgoED25519v01, -} - -// certToPrivAlgo returns the underlying algorithm for a certificate algorithm. -// Panics if a non-certificate algorithm is passed. -func certToPrivAlgo(algo string) string { - for privAlgo, pubAlgo := range certAlgoNames { - if pubAlgo == algo { - return privAlgo - } - } - panic("unknown cert algorithm") -} - -func (cert *Certificate) bytesForSigning() []byte { - c2 := *cert - c2.Signature = nil - out := c2.Marshal() - // Drop trailing signature length. - return out[:len(out)-4] -} - -// Marshal serializes c into OpenSSH's wire format. It is part of the -// PublicKey interface. -func (c *Certificate) Marshal() []byte { - generic := genericCertData{ - Serial: c.Serial, - CertType: c.CertType, - KeyId: c.KeyId, - ValidPrincipals: marshalStringList(c.ValidPrincipals), - ValidAfter: uint64(c.ValidAfter), - ValidBefore: uint64(c.ValidBefore), - CriticalOptions: marshalTuples(c.CriticalOptions), - Extensions: marshalTuples(c.Extensions), - Reserved: c.Reserved, - SignatureKey: c.SignatureKey.Marshal(), - } - if c.Signature != nil { - generic.Signature = Marshal(c.Signature) - } - genericBytes := Marshal(&generic) - keyBytes := c.Key.Marshal() - _, keyBytes, _ = parseString(keyBytes) - prefix := Marshal(&struct { - Name string - Nonce []byte - Key []byte `ssh:"rest"` - }{c.Type(), c.Nonce, keyBytes}) - - result := make([]byte, 0, len(prefix)+len(genericBytes)) - result = append(result, prefix...) - result = append(result, genericBytes...) - return result -} - -// Type returns the key name. It is part of the PublicKey interface. -func (c *Certificate) Type() string { - algo, ok := certAlgoNames[c.Key.Type()] - if !ok { - panic("unknown cert key type " + c.Key.Type()) - } - return algo -} - -// Verify verifies a signature against the certificate's public -// key. It is part of the PublicKey interface. -func (c *Certificate) Verify(data []byte, sig *Signature) error { - return c.Key.Verify(data, sig) -} - -func parseSignatureBody(in []byte) (out *Signature, rest []byte, ok bool) { - format, in, ok := parseString(in) - if !ok { - return - } - - out = &Signature{ - Format: string(format), - } - - if out.Blob, in, ok = parseString(in); !ok { - return - } - - return out, in, ok -} - -func parseSignature(in []byte) (out *Signature, rest []byte, ok bool) { - sigBytes, rest, ok := parseString(in) - if !ok { - return - } - - out, trailing, ok := parseSignatureBody(sigBytes) - if !ok || len(trailing) > 0 { - return nil, nil, false - } - return -} diff --git a/vendor/golang.org/x/crypto/ssh/channel.go b/vendor/golang.org/x/crypto/ssh/channel.go deleted file mode 100644 index 6d709b5..0000000 --- a/vendor/golang.org/x/crypto/ssh/channel.go +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "encoding/binary" - "errors" - "fmt" - "io" - "log" - "sync" -) - -const ( - minPacketLength = 9 - // channelMaxPacket contains the maximum number of bytes that will be - // sent in a single packet. As per RFC 4253, section 6.1, 32k is also - // the minimum. - channelMaxPacket = 1 << 15 - // We follow OpenSSH here. - channelWindowSize = 64 * channelMaxPacket -) - -// NewChannel represents an incoming request to a channel. It must either be -// accepted for use by calling Accept, or rejected by calling Reject. -type NewChannel interface { - // Accept accepts the channel creation request. It returns the Channel - // and a Go channel containing SSH requests. The Go channel must be - // serviced otherwise the Channel will hang. - Accept() (Channel, <-chan *Request, error) - - // Reject rejects the channel creation request. After calling - // this, no other methods on the Channel may be called. - Reject(reason RejectionReason, message string) error - - // ChannelType returns the type of the channel, as supplied by the - // client. - ChannelType() string - - // ExtraData returns the arbitrary payload for this channel, as supplied - // by the client. This data is specific to the channel type. - ExtraData() []byte -} - -// A Channel is an ordered, reliable, flow-controlled, duplex stream -// that is multiplexed over an SSH connection. -type Channel interface { - // Read reads up to len(data) bytes from the channel. - Read(data []byte) (int, error) - - // Write writes len(data) bytes to the channel. - Write(data []byte) (int, error) - - // Close signals end of channel use. No data may be sent after this - // call. - Close() error - - // CloseWrite signals the end of sending in-band - // data. Requests may still be sent, and the other side may - // still send data - CloseWrite() error - - // SendRequest sends a channel request. If wantReply is true, - // it will wait for a reply and return the result as a - // boolean, otherwise the return value will be false. Channel - // requests are out-of-band messages so they may be sent even - // if the data stream is closed or blocked by flow control. - // If the channel is closed before a reply is returned, io.EOF - // is returned. - SendRequest(name string, wantReply bool, payload []byte) (bool, error) - - // Stderr returns an io.ReadWriter that writes to this channel - // with the extended data type set to stderr. Stderr may - // safely be read and written from a different goroutine than - // Read and Write respectively. - Stderr() io.ReadWriter -} - -// Request is a request sent outside of the normal stream of -// data. Requests can either be specific to an SSH channel, or they -// can be global. -type Request struct { - Type string - WantReply bool - Payload []byte - - ch *channel - mux *mux -} - -// Reply sends a response to a request. It must be called for all requests -// where WantReply is true and is a no-op otherwise. The payload argument is -// ignored for replies to channel-specific requests. -func (r *Request) Reply(ok bool, payload []byte) error { - if !r.WantReply { - return nil - } - - if r.ch == nil { - return r.mux.ackRequest(ok, payload) - } - - return r.ch.ackRequest(ok) -} - -// RejectionReason is an enumeration used when rejecting channel creation -// requests. See RFC 4254, section 5.1. -type RejectionReason uint32 - -const ( - Prohibited RejectionReason = iota + 1 - ConnectionFailed - UnknownChannelType - ResourceShortage -) - -// String converts the rejection reason to human readable form. -func (r RejectionReason) String() string { - switch r { - case Prohibited: - return "administratively prohibited" - case ConnectionFailed: - return "connect failed" - case UnknownChannelType: - return "unknown channel type" - case ResourceShortage: - return "resource shortage" - } - return fmt.Sprintf("unknown reason %d", int(r)) -} - -func min(a uint32, b int) uint32 { - if a < uint32(b) { - return a - } - return uint32(b) -} - -type channelDirection uint8 - -const ( - channelInbound channelDirection = iota - channelOutbound -) - -// channel is an implementation of the Channel interface that works -// with the mux class. -type channel struct { - // R/O after creation - chanType string - extraData []byte - localId, remoteId uint32 - - // maxIncomingPayload and maxRemotePayload are the maximum - // payload sizes of normal and extended data packets for - // receiving and sending, respectively. The wire packet will - // be 9 or 13 bytes larger (excluding encryption overhead). - maxIncomingPayload uint32 - maxRemotePayload uint32 - - mux *mux - - // decided is set to true if an accept or reject message has been sent - // (for outbound channels) or received (for inbound channels). - decided bool - - // direction contains either channelOutbound, for channels created - // locally, or channelInbound, for channels created by the peer. - direction channelDirection - - // Pending internal channel messages. - msg chan interface{} - - // Since requests have no ID, there can be only one request - // with WantReply=true outstanding. This lock is held by a - // goroutine that has such an outgoing request pending. - sentRequestMu sync.Mutex - - incomingRequests chan *Request - - sentEOF bool - - // thread-safe data - remoteWin window - pending *buffer - extPending *buffer - - // windowMu protects myWindow, the flow-control window. - windowMu sync.Mutex - myWindow uint32 - - // writeMu serializes calls to mux.conn.writePacket() and - // protects sentClose and packetPool. This mutex must be - // different from windowMu, as writePacket can block if there - // is a key exchange pending. - writeMu sync.Mutex - sentClose bool - - // packetPool has a buffer for each extended channel ID to - // save allocations during writes. - packetPool map[uint32][]byte -} - -// writePacket sends a packet. If the packet is a channel close, it updates -// sentClose. This method takes the lock c.writeMu. -func (c *channel) writePacket(packet []byte) error { - c.writeMu.Lock() - if c.sentClose { - c.writeMu.Unlock() - return io.EOF - } - c.sentClose = (packet[0] == msgChannelClose) - err := c.mux.conn.writePacket(packet) - c.writeMu.Unlock() - return err -} - -func (c *channel) sendMessage(msg interface{}) error { - if debugMux { - log.Printf("send(%d): %#v", c.mux.chanList.offset, msg) - } - - p := Marshal(msg) - binary.BigEndian.PutUint32(p[1:], c.remoteId) - return c.writePacket(p) -} - -// WriteExtended writes data to a specific extended stream. These streams are -// used, for example, for stderr. -func (c *channel) WriteExtended(data []byte, extendedCode uint32) (n int, err error) { - if c.sentEOF { - return 0, io.EOF - } - // 1 byte message type, 4 bytes remoteId, 4 bytes data length - opCode := byte(msgChannelData) - headerLength := uint32(9) - if extendedCode > 0 { - headerLength += 4 - opCode = msgChannelExtendedData - } - - c.writeMu.Lock() - packet := c.packetPool[extendedCode] - // We don't remove the buffer from packetPool, so - // WriteExtended calls from different goroutines will be - // flagged as errors by the race detector. - c.writeMu.Unlock() - - for len(data) > 0 { - space := min(c.maxRemotePayload, len(data)) - if space, err = c.remoteWin.reserve(space); err != nil { - return n, err - } - if want := headerLength + space; uint32(cap(packet)) < want { - packet = make([]byte, want) - } else { - packet = packet[:want] - } - - todo := data[:space] - - packet[0] = opCode - binary.BigEndian.PutUint32(packet[1:], c.remoteId) - if extendedCode > 0 { - binary.BigEndian.PutUint32(packet[5:], uint32(extendedCode)) - } - binary.BigEndian.PutUint32(packet[headerLength-4:], uint32(len(todo))) - copy(packet[headerLength:], todo) - if err = c.writePacket(packet); err != nil { - return n, err - } - - n += len(todo) - data = data[len(todo):] - } - - c.writeMu.Lock() - c.packetPool[extendedCode] = packet - c.writeMu.Unlock() - - return n, err -} - -func (c *channel) handleData(packet []byte) error { - headerLen := 9 - isExtendedData := packet[0] == msgChannelExtendedData - if isExtendedData { - headerLen = 13 - } - if len(packet) < headerLen { - // malformed data packet - return parseError(packet[0]) - } - - var extended uint32 - if isExtendedData { - extended = binary.BigEndian.Uint32(packet[5:]) - } - - length := binary.BigEndian.Uint32(packet[headerLen-4 : headerLen]) - if length == 0 { - return nil - } - if length > c.maxIncomingPayload { - // TODO(hanwen): should send Disconnect? - return errors.New("ssh: incoming packet exceeds maximum payload size") - } - - data := packet[headerLen:] - if length != uint32(len(data)) { - return errors.New("ssh: wrong packet length") - } - - c.windowMu.Lock() - if c.myWindow < length { - c.windowMu.Unlock() - // TODO(hanwen): should send Disconnect with reason? - return errors.New("ssh: remote side wrote too much") - } - c.myWindow -= length - c.windowMu.Unlock() - - if extended == 1 { - c.extPending.write(data) - } else if extended > 0 { - // discard other extended data. - } else { - c.pending.write(data) - } - return nil -} - -func (c *channel) adjustWindow(n uint32) error { - c.windowMu.Lock() - // Since myWindow is managed on our side, and can never exceed - // the initial window setting, we don't worry about overflow. - c.myWindow += uint32(n) - c.windowMu.Unlock() - return c.sendMessage(windowAdjustMsg{ - AdditionalBytes: uint32(n), - }) -} - -func (c *channel) ReadExtended(data []byte, extended uint32) (n int, err error) { - switch extended { - case 1: - n, err = c.extPending.Read(data) - case 0: - n, err = c.pending.Read(data) - default: - return 0, fmt.Errorf("ssh: extended code %d unimplemented", extended) - } - - if n > 0 { - err = c.adjustWindow(uint32(n)) - // sendWindowAdjust can return io.EOF if the remote - // peer has closed the connection, however we want to - // defer forwarding io.EOF to the caller of Read until - // the buffer has been drained. - if n > 0 && err == io.EOF { - err = nil - } - } - - return n, err -} - -func (c *channel) close() { - c.pending.eof() - c.extPending.eof() - close(c.msg) - close(c.incomingRequests) - c.writeMu.Lock() - // This is not necessary for a normal channel teardown, but if - // there was another error, it is. - c.sentClose = true - c.writeMu.Unlock() - // Unblock writers. - c.remoteWin.close() -} - -// responseMessageReceived is called when a success or failure message is -// received on a channel to check that such a message is reasonable for the -// given channel. -func (c *channel) responseMessageReceived() error { - if c.direction == channelInbound { - return errors.New("ssh: channel response message received on inbound channel") - } - if c.decided { - return errors.New("ssh: duplicate response received for channel") - } - c.decided = true - return nil -} - -func (c *channel) handlePacket(packet []byte) error { - switch packet[0] { - case msgChannelData, msgChannelExtendedData: - return c.handleData(packet) - case msgChannelClose: - c.sendMessage(channelCloseMsg{PeersId: c.remoteId}) - c.mux.chanList.remove(c.localId) - c.close() - return nil - case msgChannelEOF: - // RFC 4254 is mute on how EOF affects dataExt messages but - // it is logical to signal EOF at the same time. - c.extPending.eof() - c.pending.eof() - return nil - } - - decoded, err := decode(packet) - if err != nil { - return err - } - - switch msg := decoded.(type) { - case *channelOpenFailureMsg: - if err := c.responseMessageReceived(); err != nil { - return err - } - c.mux.chanList.remove(msg.PeersId) - c.msg <- msg - case *channelOpenConfirmMsg: - if err := c.responseMessageReceived(); err != nil { - return err - } - if msg.MaxPacketSize < minPacketLength || msg.MaxPacketSize > 1<<31 { - return fmt.Errorf("ssh: invalid MaxPacketSize %d from peer", msg.MaxPacketSize) - } - c.remoteId = msg.MyId - c.maxRemotePayload = msg.MaxPacketSize - c.remoteWin.add(msg.MyWindow) - c.msg <- msg - case *windowAdjustMsg: - if !c.remoteWin.add(msg.AdditionalBytes) { - return fmt.Errorf("ssh: invalid window update for %d bytes", msg.AdditionalBytes) - } - case *channelRequestMsg: - req := Request{ - Type: msg.Request, - WantReply: msg.WantReply, - Payload: msg.RequestSpecificData, - ch: c, - } - - c.incomingRequests <- &req - default: - c.msg <- msg - } - return nil -} - -func (m *mux) newChannel(chanType string, direction channelDirection, extraData []byte) *channel { - ch := &channel{ - remoteWin: window{Cond: newCond()}, - myWindow: channelWindowSize, - pending: newBuffer(), - extPending: newBuffer(), - direction: direction, - incomingRequests: make(chan *Request, 16), - msg: make(chan interface{}, 16), - chanType: chanType, - extraData: extraData, - mux: m, - packetPool: make(map[uint32][]byte), - } - ch.localId = m.chanList.add(ch) - return ch -} - -var errUndecided = errors.New("ssh: must Accept or Reject channel") -var errDecidedAlready = errors.New("ssh: can call Accept or Reject only once") - -type extChannel struct { - code uint32 - ch *channel -} - -func (e *extChannel) Write(data []byte) (n int, err error) { - return e.ch.WriteExtended(data, e.code) -} - -func (e *extChannel) Read(data []byte) (n int, err error) { - return e.ch.ReadExtended(data, e.code) -} - -func (c *channel) Accept() (Channel, <-chan *Request, error) { - if c.decided { - return nil, nil, errDecidedAlready - } - c.maxIncomingPayload = channelMaxPacket - confirm := channelOpenConfirmMsg{ - PeersId: c.remoteId, - MyId: c.localId, - MyWindow: c.myWindow, - MaxPacketSize: c.maxIncomingPayload, - } - c.decided = true - if err := c.sendMessage(confirm); err != nil { - return nil, nil, err - } - - return c, c.incomingRequests, nil -} - -func (ch *channel) Reject(reason RejectionReason, message string) error { - if ch.decided { - return errDecidedAlready - } - reject := channelOpenFailureMsg{ - PeersId: ch.remoteId, - Reason: reason, - Message: message, - Language: "en", - } - ch.decided = true - return ch.sendMessage(reject) -} - -func (ch *channel) Read(data []byte) (int, error) { - if !ch.decided { - return 0, errUndecided - } - return ch.ReadExtended(data, 0) -} - -func (ch *channel) Write(data []byte) (int, error) { - if !ch.decided { - return 0, errUndecided - } - return ch.WriteExtended(data, 0) -} - -func (ch *channel) CloseWrite() error { - if !ch.decided { - return errUndecided - } - ch.sentEOF = true - return ch.sendMessage(channelEOFMsg{ - PeersId: ch.remoteId}) -} - -func (ch *channel) Close() error { - if !ch.decided { - return errUndecided - } - - return ch.sendMessage(channelCloseMsg{ - PeersId: ch.remoteId}) -} - -// Extended returns an io.ReadWriter that sends and receives data on the given, -// SSH extended stream. Such streams are used, for example, for stderr. -func (ch *channel) Extended(code uint32) io.ReadWriter { - if !ch.decided { - return nil - } - return &extChannel{code, ch} -} - -func (ch *channel) Stderr() io.ReadWriter { - return ch.Extended(1) -} - -func (ch *channel) SendRequest(name string, wantReply bool, payload []byte) (bool, error) { - if !ch.decided { - return false, errUndecided - } - - if wantReply { - ch.sentRequestMu.Lock() - defer ch.sentRequestMu.Unlock() - } - - msg := channelRequestMsg{ - PeersId: ch.remoteId, - Request: name, - WantReply: wantReply, - RequestSpecificData: payload, - } - - if err := ch.sendMessage(msg); err != nil { - return false, err - } - - if wantReply { - m, ok := (<-ch.msg) - if !ok { - return false, io.EOF - } - switch m.(type) { - case *channelRequestFailureMsg: - return false, nil - case *channelRequestSuccessMsg: - return true, nil - default: - return false, fmt.Errorf("ssh: unexpected response to channel request: %#v", m) - } - } - - return false, nil -} - -// ackRequest either sends an ack or nack to the channel request. -func (ch *channel) ackRequest(ok bool) error { - if !ch.decided { - return errUndecided - } - - var msg interface{} - if !ok { - msg = channelRequestFailureMsg{ - PeersId: ch.remoteId, - } - } else { - msg = channelRequestSuccessMsg{ - PeersId: ch.remoteId, - } - } - return ch.sendMessage(msg) -} - -func (ch *channel) ChannelType() string { - return ch.chanType -} - -func (ch *channel) ExtraData() []byte { - return ch.extraData -} diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go deleted file mode 100644 index 34d3917..0000000 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "crypto/aes" - "crypto/cipher" - "crypto/des" - "crypto/rc4" - "crypto/subtle" - "encoding/binary" - "errors" - "fmt" - "hash" - "io" - "io/ioutil" -) - -const ( - packetSizeMultiple = 16 // TODO(huin) this should be determined by the cipher. - - // RFC 4253 section 6.1 defines a minimum packet size of 32768 that implementations - // MUST be able to process (plus a few more kilobytes for padding and mac). The RFC - // indicates implementations SHOULD be able to handle larger packet sizes, but then - // waffles on about reasonable limits. - // - // OpenSSH caps their maxPacket at 256kB so we choose to do - // the same. maxPacket is also used to ensure that uint32 - // length fields do not overflow, so it should remain well - // below 4G. - maxPacket = 256 * 1024 -) - -// noneCipher implements cipher.Stream and provides no encryption. It is used -// by the transport before the first key-exchange. -type noneCipher struct{} - -func (c noneCipher) XORKeyStream(dst, src []byte) { - copy(dst, src) -} - -func newAESCTR(key, iv []byte) (cipher.Stream, error) { - c, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - return cipher.NewCTR(c, iv), nil -} - -func newRC4(key, iv []byte) (cipher.Stream, error) { - return rc4.NewCipher(key) -} - -type streamCipherMode struct { - keySize int - ivSize int - skip int - createFunc func(key, iv []byte) (cipher.Stream, error) -} - -func (c *streamCipherMode) createStream(key, iv []byte) (cipher.Stream, error) { - if len(key) < c.keySize { - panic("ssh: key length too small for cipher") - } - if len(iv) < c.ivSize { - panic("ssh: iv too small for cipher") - } - - stream, err := c.createFunc(key[:c.keySize], iv[:c.ivSize]) - if err != nil { - return nil, err - } - - var streamDump []byte - if c.skip > 0 { - streamDump = make([]byte, 512) - } - - for remainingToDump := c.skip; remainingToDump > 0; { - dumpThisTime := remainingToDump - if dumpThisTime > len(streamDump) { - dumpThisTime = len(streamDump) - } - stream.XORKeyStream(streamDump[:dumpThisTime], streamDump[:dumpThisTime]) - remainingToDump -= dumpThisTime - } - - return stream, nil -} - -// cipherModes documents properties of supported ciphers. Ciphers not included -// are not supported and will not be negotiated, even if explicitly requested in -// ClientConfig.Crypto.Ciphers. -var cipherModes = map[string]*streamCipherMode{ - // Ciphers from RFC4344, which introduced many CTR-based ciphers. Algorithms - // are defined in the order specified in the RFC. - "aes128-ctr": {16, aes.BlockSize, 0, newAESCTR}, - "aes192-ctr": {24, aes.BlockSize, 0, newAESCTR}, - "aes256-ctr": {32, aes.BlockSize, 0, newAESCTR}, - - // Ciphers from RFC4345, which introduces security-improved arcfour ciphers. - // They are defined in the order specified in the RFC. - "arcfour128": {16, 0, 1536, newRC4}, - "arcfour256": {32, 0, 1536, newRC4}, - - // Cipher defined in RFC 4253, which describes SSH Transport Layer Protocol. - // Note that this cipher is not safe, as stated in RFC 4253: "Arcfour (and - // RC4) has problems with weak keys, and should be used with caution." - // RFC4345 introduces improved versions of Arcfour. - "arcfour": {16, 0, 0, newRC4}, - - // AES-GCM is not a stream cipher, so it is constructed with a - // special case. If we add any more non-stream ciphers, we - // should invest a cleaner way to do this. - gcmCipherID: {16, 12, 0, nil}, - - // CBC mode is insecure and so is not included in the default config. - // (See http://www.isg.rhul.ac.uk/~kp/SandPfinal.pdf). If absolutely - // needed, it's possible to specify a custom Config to enable it. - // You should expect that an active attacker can recover plaintext if - // you do. - aes128cbcID: {16, aes.BlockSize, 0, nil}, - - // 3des-cbc is insecure and is disabled by default. - tripledescbcID: {24, des.BlockSize, 0, nil}, -} - -// prefixLen is the length of the packet prefix that contains the packet length -// and number of padding bytes. -const prefixLen = 5 - -// streamPacketCipher is a packetCipher using a stream cipher. -type streamPacketCipher struct { - mac hash.Hash - cipher cipher.Stream - - // The following members are to avoid per-packet allocations. - prefix [prefixLen]byte - seqNumBytes [4]byte - padding [2 * packetSizeMultiple]byte - packetData []byte - macResult []byte -} - -// readPacket reads and decrypt a single packet from the reader argument. -func (s *streamPacketCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { - if _, err := io.ReadFull(r, s.prefix[:]); err != nil { - return nil, err - } - - s.cipher.XORKeyStream(s.prefix[:], s.prefix[:]) - length := binary.BigEndian.Uint32(s.prefix[0:4]) - paddingLength := uint32(s.prefix[4]) - - var macSize uint32 - if s.mac != nil { - s.mac.Reset() - binary.BigEndian.PutUint32(s.seqNumBytes[:], seqNum) - s.mac.Write(s.seqNumBytes[:]) - s.mac.Write(s.prefix[:]) - macSize = uint32(s.mac.Size()) - } - - if length <= paddingLength+1 { - return nil, errors.New("ssh: invalid packet length, packet too small") - } - - if length > maxPacket { - return nil, errors.New("ssh: invalid packet length, packet too large") - } - - // the maxPacket check above ensures that length-1+macSize - // does not overflow. - if uint32(cap(s.packetData)) < length-1+macSize { - s.packetData = make([]byte, length-1+macSize) - } else { - s.packetData = s.packetData[:length-1+macSize] - } - - if _, err := io.ReadFull(r, s.packetData); err != nil { - return nil, err - } - mac := s.packetData[length-1:] - data := s.packetData[:length-1] - s.cipher.XORKeyStream(data, data) - - if s.mac != nil { - s.mac.Write(data) - s.macResult = s.mac.Sum(s.macResult[:0]) - if subtle.ConstantTimeCompare(s.macResult, mac) != 1 { - return nil, errors.New("ssh: MAC failure") - } - } - - return s.packetData[:length-paddingLength-1], nil -} - -// writePacket encrypts and sends a packet of data to the writer argument -func (s *streamPacketCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error { - if len(packet) > maxPacket { - return errors.New("ssh: packet too large") - } - - paddingLength := packetSizeMultiple - (prefixLen+len(packet))%packetSizeMultiple - if paddingLength < 4 { - paddingLength += packetSizeMultiple - } - - length := len(packet) + 1 + paddingLength - binary.BigEndian.PutUint32(s.prefix[:], uint32(length)) - s.prefix[4] = byte(paddingLength) - padding := s.padding[:paddingLength] - if _, err := io.ReadFull(rand, padding); err != nil { - return err - } - - if s.mac != nil { - s.mac.Reset() - binary.BigEndian.PutUint32(s.seqNumBytes[:], seqNum) - s.mac.Write(s.seqNumBytes[:]) - s.mac.Write(s.prefix[:]) - s.mac.Write(packet) - s.mac.Write(padding) - } - - s.cipher.XORKeyStream(s.prefix[:], s.prefix[:]) - s.cipher.XORKeyStream(packet, packet) - s.cipher.XORKeyStream(padding, padding) - - if _, err := w.Write(s.prefix[:]); err != nil { - return err - } - if _, err := w.Write(packet); err != nil { - return err - } - if _, err := w.Write(padding); err != nil { - return err - } - - if s.mac != nil { - s.macResult = s.mac.Sum(s.macResult[:0]) - if _, err := w.Write(s.macResult); err != nil { - return err - } - } - - return nil -} - -type gcmCipher struct { - aead cipher.AEAD - prefix [4]byte - iv []byte - buf []byte -} - -func newGCMCipher(iv, key, macKey []byte) (packetCipher, error) { - c, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - - aead, err := cipher.NewGCM(c) - if err != nil { - return nil, err - } - - return &gcmCipher{ - aead: aead, - iv: iv, - }, nil -} - -const gcmTagSize = 16 - -func (c *gcmCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error { - // Pad out to multiple of 16 bytes. This is different from the - // stream cipher because that encrypts the length too. - padding := byte(packetSizeMultiple - (1+len(packet))%packetSizeMultiple) - if padding < 4 { - padding += packetSizeMultiple - } - - length := uint32(len(packet) + int(padding) + 1) - binary.BigEndian.PutUint32(c.prefix[:], length) - if _, err := w.Write(c.prefix[:]); err != nil { - return err - } - - if cap(c.buf) < int(length) { - c.buf = make([]byte, length) - } else { - c.buf = c.buf[:length] - } - - c.buf[0] = padding - copy(c.buf[1:], packet) - if _, err := io.ReadFull(rand, c.buf[1+len(packet):]); err != nil { - return err - } - c.buf = c.aead.Seal(c.buf[:0], c.iv, c.buf, c.prefix[:]) - if _, err := w.Write(c.buf); err != nil { - return err - } - c.incIV() - - return nil -} - -func (c *gcmCipher) incIV() { - for i := 4 + 7; i >= 4; i-- { - c.iv[i]++ - if c.iv[i] != 0 { - break - } - } -} - -func (c *gcmCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { - if _, err := io.ReadFull(r, c.prefix[:]); err != nil { - return nil, err - } - length := binary.BigEndian.Uint32(c.prefix[:]) - if length > maxPacket { - return nil, errors.New("ssh: max packet length exceeded.") - } - - if cap(c.buf) < int(length+gcmTagSize) { - c.buf = make([]byte, length+gcmTagSize) - } else { - c.buf = c.buf[:length+gcmTagSize] - } - - if _, err := io.ReadFull(r, c.buf); err != nil { - return nil, err - } - - plain, err := c.aead.Open(c.buf[:0], c.iv, c.buf, c.prefix[:]) - if err != nil { - return nil, err - } - c.incIV() - - padding := plain[0] - if padding < 4 || padding >= 20 { - return nil, fmt.Errorf("ssh: illegal padding %d", padding) - } - - if int(padding+1) >= len(plain) { - return nil, fmt.Errorf("ssh: padding %d too large", padding) - } - plain = plain[1 : length-uint32(padding)] - return plain, nil -} - -// cbcCipher implements aes128-cbc cipher defined in RFC 4253 section 6.1 -type cbcCipher struct { - mac hash.Hash - macSize uint32 - decrypter cipher.BlockMode - encrypter cipher.BlockMode - - // The following members are to avoid per-packet allocations. - seqNumBytes [4]byte - packetData []byte - macResult []byte - - // Amount of data we should still read to hide which - // verification error triggered. - oracleCamouflage uint32 -} - -func newCBCCipher(c cipher.Block, iv, key, macKey []byte, algs directionAlgorithms) (packetCipher, error) { - cbc := &cbcCipher{ - mac: macModes[algs.MAC].new(macKey), - decrypter: cipher.NewCBCDecrypter(c, iv), - encrypter: cipher.NewCBCEncrypter(c, iv), - packetData: make([]byte, 1024), - } - if cbc.mac != nil { - cbc.macSize = uint32(cbc.mac.Size()) - } - - return cbc, nil -} - -func newAESCBCCipher(iv, key, macKey []byte, algs directionAlgorithms) (packetCipher, error) { - c, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - - cbc, err := newCBCCipher(c, iv, key, macKey, algs) - if err != nil { - return nil, err - } - - return cbc, nil -} - -func newTripleDESCBCCipher(iv, key, macKey []byte, algs directionAlgorithms) (packetCipher, error) { - c, err := des.NewTripleDESCipher(key) - if err != nil { - return nil, err - } - - cbc, err := newCBCCipher(c, iv, key, macKey, algs) - if err != nil { - return nil, err - } - - return cbc, nil -} - -func maxUInt32(a, b int) uint32 { - if a > b { - return uint32(a) - } - return uint32(b) -} - -const ( - cbcMinPacketSizeMultiple = 8 - cbcMinPacketSize = 16 - cbcMinPaddingSize = 4 -) - -// cbcError represents a verification error that may leak information. -type cbcError string - -func (e cbcError) Error() string { return string(e) } - -func (c *cbcCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { - p, err := c.readPacketLeaky(seqNum, r) - if err != nil { - if _, ok := err.(cbcError); ok { - // Verification error: read a fixed amount of - // data, to make distinguishing between - // failing MAC and failing length check more - // difficult. - io.CopyN(ioutil.Discard, r, int64(c.oracleCamouflage)) - } - } - return p, err -} - -func (c *cbcCipher) readPacketLeaky(seqNum uint32, r io.Reader) ([]byte, error) { - blockSize := c.decrypter.BlockSize() - - // Read the header, which will include some of the subsequent data in the - // case of block ciphers - this is copied back to the payload later. - // How many bytes of payload/padding will be read with this first read. - firstBlockLength := uint32((prefixLen + blockSize - 1) / blockSize * blockSize) - firstBlock := c.packetData[:firstBlockLength] - if _, err := io.ReadFull(r, firstBlock); err != nil { - return nil, err - } - - c.oracleCamouflage = maxPacket + 4 + c.macSize - firstBlockLength - - c.decrypter.CryptBlocks(firstBlock, firstBlock) - length := binary.BigEndian.Uint32(firstBlock[:4]) - if length > maxPacket { - return nil, cbcError("ssh: packet too large") - } - if length+4 < maxUInt32(cbcMinPacketSize, blockSize) { - // The minimum size of a packet is 16 (or the cipher block size, whichever - // is larger) bytes. - return nil, cbcError("ssh: packet too small") - } - // The length of the packet (including the length field but not the MAC) must - // be a multiple of the block size or 8, whichever is larger. - if (length+4)%maxUInt32(cbcMinPacketSizeMultiple, blockSize) != 0 { - return nil, cbcError("ssh: invalid packet length multiple") - } - - paddingLength := uint32(firstBlock[4]) - if paddingLength < cbcMinPaddingSize || length <= paddingLength+1 { - return nil, cbcError("ssh: invalid packet length") - } - - // Positions within the c.packetData buffer: - macStart := 4 + length - paddingStart := macStart - paddingLength - - // Entire packet size, starting before length, ending at end of mac. - entirePacketSize := macStart + c.macSize - - // Ensure c.packetData is large enough for the entire packet data. - if uint32(cap(c.packetData)) < entirePacketSize { - // Still need to upsize and copy, but this should be rare at runtime, only - // on upsizing the packetData buffer. - c.packetData = make([]byte, entirePacketSize) - copy(c.packetData, firstBlock) - } else { - c.packetData = c.packetData[:entirePacketSize] - } - - if n, err := io.ReadFull(r, c.packetData[firstBlockLength:]); err != nil { - return nil, err - } else { - c.oracleCamouflage -= uint32(n) - } - - remainingCrypted := c.packetData[firstBlockLength:macStart] - c.decrypter.CryptBlocks(remainingCrypted, remainingCrypted) - - mac := c.packetData[macStart:] - if c.mac != nil { - c.mac.Reset() - binary.BigEndian.PutUint32(c.seqNumBytes[:], seqNum) - c.mac.Write(c.seqNumBytes[:]) - c.mac.Write(c.packetData[:macStart]) - c.macResult = c.mac.Sum(c.macResult[:0]) - if subtle.ConstantTimeCompare(c.macResult, mac) != 1 { - return nil, cbcError("ssh: MAC failure") - } - } - - return c.packetData[prefixLen:paddingStart], nil -} - -func (c *cbcCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error { - effectiveBlockSize := maxUInt32(cbcMinPacketSizeMultiple, c.encrypter.BlockSize()) - - // Length of encrypted portion of the packet (header, payload, padding). - // Enforce minimum padding and packet size. - encLength := maxUInt32(prefixLen+len(packet)+cbcMinPaddingSize, cbcMinPaddingSize) - // Enforce block size. - encLength = (encLength + effectiveBlockSize - 1) / effectiveBlockSize * effectiveBlockSize - - length := encLength - 4 - paddingLength := int(length) - (1 + len(packet)) - - // Overall buffer contains: header, payload, padding, mac. - // Space for the MAC is reserved in the capacity but not the slice length. - bufferSize := encLength + c.macSize - if uint32(cap(c.packetData)) < bufferSize { - c.packetData = make([]byte, encLength, bufferSize) - } else { - c.packetData = c.packetData[:encLength] - } - - p := c.packetData - - // Packet header. - binary.BigEndian.PutUint32(p, length) - p = p[4:] - p[0] = byte(paddingLength) - - // Payload. - p = p[1:] - copy(p, packet) - - // Padding. - p = p[len(packet):] - if _, err := io.ReadFull(rand, p); err != nil { - return err - } - - if c.mac != nil { - c.mac.Reset() - binary.BigEndian.PutUint32(c.seqNumBytes[:], seqNum) - c.mac.Write(c.seqNumBytes[:]) - c.mac.Write(c.packetData) - // The MAC is now appended into the capacity reserved for it earlier. - c.packetData = c.mac.Sum(c.packetData) - } - - c.encrypter.CryptBlocks(c.packetData[:encLength], c.packetData[:encLength]) - - if _, err := w.Write(c.packetData); err != nil { - return err - } - - return nil -} diff --git a/vendor/golang.org/x/crypto/ssh/client.go b/vendor/golang.org/x/crypto/ssh/client.go deleted file mode 100644 index c841e8d..0000000 --- a/vendor/golang.org/x/crypto/ssh/client.go +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "errors" - "fmt" - "net" - "sync" - "time" -) - -// Client implements a traditional SSH client that supports shells, -// subprocesses, port forwarding and tunneled dialing. -type Client struct { - Conn - - forwards forwardList // forwarded tcpip connections from the remote side - mu sync.Mutex - channelHandlers map[string]chan NewChannel -} - -// HandleChannelOpen returns a channel on which NewChannel requests -// for the given type are sent. If the type already is being handled, -// nil is returned. The channel is closed when the connection is closed. -func (c *Client) HandleChannelOpen(channelType string) <-chan NewChannel { - c.mu.Lock() - defer c.mu.Unlock() - if c.channelHandlers == nil { - // The SSH channel has been closed. - c := make(chan NewChannel) - close(c) - return c - } - - ch := c.channelHandlers[channelType] - if ch != nil { - return nil - } - - ch = make(chan NewChannel, 16) - c.channelHandlers[channelType] = ch - return ch -} - -// NewClient creates a Client on top of the given connection. -func NewClient(c Conn, chans <-chan NewChannel, reqs <-chan *Request) *Client { - conn := &Client{ - Conn: c, - channelHandlers: make(map[string]chan NewChannel, 1), - } - - go conn.handleGlobalRequests(reqs) - go conn.handleChannelOpens(chans) - go func() { - conn.Wait() - conn.forwards.closeAll() - }() - go conn.forwards.handleChannels(conn.HandleChannelOpen("forwarded-tcpip")) - return conn -} - -// NewClientConn establishes an authenticated SSH connection using c -// as the underlying transport. The Request and NewChannel channels -// must be serviced or the connection will hang. -func NewClientConn(c net.Conn, addr string, config *ClientConfig) (Conn, <-chan NewChannel, <-chan *Request, error) { - fullConf := *config - fullConf.SetDefaults() - conn := &connection{ - sshConn: sshConn{conn: c}, - } - - if err := conn.clientHandshake(addr, &fullConf); err != nil { - c.Close() - return nil, nil, nil, fmt.Errorf("ssh: handshake failed: %v", err) - } - conn.mux = newMux(conn.transport) - return conn, conn.mux.incomingChannels, conn.mux.incomingRequests, nil -} - -// clientHandshake performs the client side key exchange. See RFC 4253 Section -// 7. -func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) error { - if config.ClientVersion != "" { - c.clientVersion = []byte(config.ClientVersion) - } else { - c.clientVersion = []byte(packageVersion) - } - var err error - c.serverVersion, err = exchangeVersions(c.sshConn.conn, c.clientVersion) - if err != nil { - return err - } - - c.transport = newClientTransport( - newTransport(c.sshConn.conn, config.Rand, true /* is client */), - c.clientVersion, c.serverVersion, config, dialAddress, c.sshConn.RemoteAddr()) - if err := c.transport.waitSession(); err != nil { - return err - } - - c.sessionID = c.transport.getSessionID() - return c.clientAuthenticate(config) -} - -// verifyHostKeySignature verifies the host key obtained in the key -// exchange. -func verifyHostKeySignature(hostKey PublicKey, result *kexResult) error { - sig, rest, ok := parseSignatureBody(result.Signature) - if len(rest) > 0 || !ok { - return errors.New("ssh: signature parse error") - } - - return hostKey.Verify(result.H, sig) -} - -// NewSession opens a new Session for this client. (A session is a remote -// execution of a program.) -func (c *Client) NewSession() (*Session, error) { - ch, in, err := c.OpenChannel("session", nil) - if err != nil { - return nil, err - } - return newSession(ch, in) -} - -func (c *Client) handleGlobalRequests(incoming <-chan *Request) { - for r := range incoming { - // This handles keepalive messages and matches - // the behaviour of OpenSSH. - r.Reply(false, nil) - } -} - -// handleChannelOpens channel open messages from the remote side. -func (c *Client) handleChannelOpens(in <-chan NewChannel) { - for ch := range in { - c.mu.Lock() - handler := c.channelHandlers[ch.ChannelType()] - c.mu.Unlock() - - if handler != nil { - handler <- ch - } else { - ch.Reject(UnknownChannelType, fmt.Sprintf("unknown channel type: %v", ch.ChannelType())) - } - } - - c.mu.Lock() - for _, ch := range c.channelHandlers { - close(ch) - } - c.channelHandlers = nil - c.mu.Unlock() -} - -// Dial starts a client connection to the given SSH server. It is a -// convenience function that connects to the given network address, -// initiates the SSH handshake, and then sets up a Client. For access -// to incoming channels and requests, use net.Dial with NewClientConn -// instead. -func Dial(network, addr string, config *ClientConfig) (*Client, error) { - conn, err := net.DialTimeout(network, addr, config.Timeout) - if err != nil { - return nil, err - } - c, chans, reqs, err := NewClientConn(conn, addr, config) - if err != nil { - return nil, err - } - return NewClient(c, chans, reqs), nil -} - -// A ClientConfig structure is used to configure a Client. It must not be -// modified after having been passed to an SSH function. -type ClientConfig struct { - // Config contains configuration that is shared between clients and - // servers. - Config - - // User contains the username to authenticate as. - User string - - // Auth contains possible authentication methods to use with the - // server. Only the first instance of a particular RFC 4252 method will - // be used during authentication. - Auth []AuthMethod - - // HostKeyCallback, if not nil, is called during the cryptographic - // handshake to validate the server's host key. A nil HostKeyCallback - // implies that all host keys are accepted. - HostKeyCallback func(hostname string, remote net.Addr, key PublicKey) error - - // ClientVersion contains the version identification string that will - // be used for the connection. If empty, a reasonable default is used. - ClientVersion string - - // HostKeyAlgorithms lists the key types that the client will - // accept from the server as host key, in order of - // preference. If empty, a reasonable default is used. Any - // string returned from PublicKey.Type method may be used, or - // any of the CertAlgoXxxx and KeyAlgoXxxx constants. - HostKeyAlgorithms []string - - // Timeout is the maximum amount of time for the TCP connection to establish. - // - // A Timeout of zero means no timeout. - Timeout time.Duration -} diff --git a/vendor/golang.org/x/crypto/ssh/client_auth.go b/vendor/golang.org/x/crypto/ssh/client_auth.go deleted file mode 100644 index fd1ec5d..0000000 --- a/vendor/golang.org/x/crypto/ssh/client_auth.go +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "bytes" - "errors" - "fmt" - "io" -) - -// clientAuthenticate authenticates with the remote server. See RFC 4252. -func (c *connection) clientAuthenticate(config *ClientConfig) error { - // initiate user auth session - if err := c.transport.writePacket(Marshal(&serviceRequestMsg{serviceUserAuth})); err != nil { - return err - } - packet, err := c.transport.readPacket() - if err != nil { - return err - } - var serviceAccept serviceAcceptMsg - if err := Unmarshal(packet, &serviceAccept); err != nil { - return err - } - - // during the authentication phase the client first attempts the "none" method - // then any untried methods suggested by the server. - tried := make(map[string]bool) - var lastMethods []string - - sessionID := c.transport.getSessionID() - for auth := AuthMethod(new(noneAuth)); auth != nil; { - ok, methods, err := auth.auth(sessionID, config.User, c.transport, config.Rand) - if err != nil { - return err - } - if ok { - // success - return nil - } - tried[auth.method()] = true - if methods == nil { - methods = lastMethods - } - lastMethods = methods - - auth = nil - - findNext: - for _, a := range config.Auth { - candidateMethod := a.method() - if tried[candidateMethod] { - continue - } - for _, meth := range methods { - if meth == candidateMethod { - auth = a - break findNext - } - } - } - } - return fmt.Errorf("ssh: unable to authenticate, attempted methods %v, no supported methods remain", keys(tried)) -} - -func keys(m map[string]bool) []string { - s := make([]string, 0, len(m)) - - for key := range m { - s = append(s, key) - } - return s -} - -// An AuthMethod represents an instance of an RFC 4252 authentication method. -type AuthMethod interface { - // auth authenticates user over transport t. - // Returns true if authentication is successful. - // If authentication is not successful, a []string of alternative - // method names is returned. If the slice is nil, it will be ignored - // and the previous set of possible methods will be reused. - auth(session []byte, user string, p packetConn, rand io.Reader) (bool, []string, error) - - // method returns the RFC 4252 method name. - method() string -} - -// "none" authentication, RFC 4252 section 5.2. -type noneAuth int - -func (n *noneAuth) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) { - if err := c.writePacket(Marshal(&userAuthRequestMsg{ - User: user, - Service: serviceSSH, - Method: "none", - })); err != nil { - return false, nil, err - } - - return handleAuthResponse(c) -} - -func (n *noneAuth) method() string { - return "none" -} - -// passwordCallback is an AuthMethod that fetches the password through -// a function call, e.g. by prompting the user. -type passwordCallback func() (password string, err error) - -func (cb passwordCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) { - type passwordAuthMsg struct { - User string `sshtype:"50"` - Service string - Method string - Reply bool - Password string - } - - pw, err := cb() - // REVIEW NOTE: is there a need to support skipping a password attempt? - // The program may only find out that the user doesn't have a password - // when prompting. - if err != nil { - return false, nil, err - } - - if err := c.writePacket(Marshal(&passwordAuthMsg{ - User: user, - Service: serviceSSH, - Method: cb.method(), - Reply: false, - Password: pw, - })); err != nil { - return false, nil, err - } - - return handleAuthResponse(c) -} - -func (cb passwordCallback) method() string { - return "password" -} - -// Password returns an AuthMethod using the given password. -func Password(secret string) AuthMethod { - return passwordCallback(func() (string, error) { return secret, nil }) -} - -// PasswordCallback returns an AuthMethod that uses a callback for -// fetching a password. -func PasswordCallback(prompt func() (secret string, err error)) AuthMethod { - return passwordCallback(prompt) -} - -type publickeyAuthMsg struct { - User string `sshtype:"50"` - Service string - Method string - // HasSig indicates to the receiver packet that the auth request is signed and - // should be used for authentication of the request. - HasSig bool - Algoname string - PubKey []byte - // Sig is tagged with "rest" so Marshal will exclude it during - // validateKey - Sig []byte `ssh:"rest"` -} - -// publicKeyCallback is an AuthMethod that uses a set of key -// pairs for authentication. -type publicKeyCallback func() ([]Signer, error) - -func (cb publicKeyCallback) method() string { - return "publickey" -} - -func (cb publicKeyCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) { - // Authentication is performed in two stages. The first stage sends an - // enquiry to test if each key is acceptable to the remote. The second - // stage attempts to authenticate with the valid keys obtained in the - // first stage. - - signers, err := cb() - if err != nil { - return false, nil, err - } - var validKeys []Signer - for _, signer := range signers { - if ok, err := validateKey(signer.PublicKey(), user, c); ok { - validKeys = append(validKeys, signer) - } else { - if err != nil { - return false, nil, err - } - } - } - - // methods that may continue if this auth is not successful. - var methods []string - for _, signer := range validKeys { - pub := signer.PublicKey() - - pubKey := pub.Marshal() - sign, err := signer.Sign(rand, buildDataSignedForAuth(session, userAuthRequestMsg{ - User: user, - Service: serviceSSH, - Method: cb.method(), - }, []byte(pub.Type()), pubKey)) - if err != nil { - return false, nil, err - } - - // manually wrap the serialized signature in a string - s := Marshal(sign) - sig := make([]byte, stringLength(len(s))) - marshalString(sig, s) - msg := publickeyAuthMsg{ - User: user, - Service: serviceSSH, - Method: cb.method(), - HasSig: true, - Algoname: pub.Type(), - PubKey: pubKey, - Sig: sig, - } - p := Marshal(&msg) - if err := c.writePacket(p); err != nil { - return false, nil, err - } - var success bool - success, methods, err = handleAuthResponse(c) - if err != nil { - return false, nil, err - } - if success { - return success, methods, err - } - } - return false, methods, nil -} - -// validateKey validates the key provided is acceptable to the server. -func validateKey(key PublicKey, user string, c packetConn) (bool, error) { - pubKey := key.Marshal() - msg := publickeyAuthMsg{ - User: user, - Service: serviceSSH, - Method: "publickey", - HasSig: false, - Algoname: key.Type(), - PubKey: pubKey, - } - if err := c.writePacket(Marshal(&msg)); err != nil { - return false, err - } - - return confirmKeyAck(key, c) -} - -func confirmKeyAck(key PublicKey, c packetConn) (bool, error) { - pubKey := key.Marshal() - algoname := key.Type() - - for { - packet, err := c.readPacket() - if err != nil { - return false, err - } - switch packet[0] { - case msgUserAuthBanner: - // TODO(gpaul): add callback to present the banner to the user - case msgUserAuthPubKeyOk: - var msg userAuthPubKeyOkMsg - if err := Unmarshal(packet, &msg); err != nil { - return false, err - } - if msg.Algo != algoname || !bytes.Equal(msg.PubKey, pubKey) { - return false, nil - } - return true, nil - case msgUserAuthFailure: - return false, nil - default: - return false, unexpectedMessageError(msgUserAuthSuccess, packet[0]) - } - } -} - -// PublicKeys returns an AuthMethod that uses the given key -// pairs. -func PublicKeys(signers ...Signer) AuthMethod { - return publicKeyCallback(func() ([]Signer, error) { return signers, nil }) -} - -// PublicKeysCallback returns an AuthMethod that runs the given -// function to obtain a list of key pairs. -func PublicKeysCallback(getSigners func() (signers []Signer, err error)) AuthMethod { - return publicKeyCallback(getSigners) -} - -// handleAuthResponse returns whether the preceding authentication request succeeded -// along with a list of remaining authentication methods to try next and -// an error if an unexpected response was received. -func handleAuthResponse(c packetConn) (bool, []string, error) { - for { - packet, err := c.readPacket() - if err != nil { - return false, nil, err - } - - switch packet[0] { - case msgUserAuthBanner: - // TODO: add callback to present the banner to the user - case msgUserAuthFailure: - var msg userAuthFailureMsg - if err := Unmarshal(packet, &msg); err != nil { - return false, nil, err - } - return false, msg.Methods, nil - case msgUserAuthSuccess: - return true, nil, nil - default: - return false, nil, unexpectedMessageError(msgUserAuthSuccess, packet[0]) - } - } -} - -// KeyboardInteractiveChallenge should print questions, optionally -// disabling echoing (e.g. for passwords), and return all the answers. -// Challenge may be called multiple times in a single session. After -// successful authentication, the server may send a challenge with no -// questions, for which the user and instruction messages should be -// printed. RFC 4256 section 3.3 details how the UI should behave for -// both CLI and GUI environments. -type KeyboardInteractiveChallenge func(user, instruction string, questions []string, echos []bool) (answers []string, err error) - -// KeyboardInteractive returns a AuthMethod using a prompt/response -// sequence controlled by the server. -func KeyboardInteractive(challenge KeyboardInteractiveChallenge) AuthMethod { - return challenge -} - -func (cb KeyboardInteractiveChallenge) method() string { - return "keyboard-interactive" -} - -func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) { - type initiateMsg struct { - User string `sshtype:"50"` - Service string - Method string - Language string - Submethods string - } - - if err := c.writePacket(Marshal(&initiateMsg{ - User: user, - Service: serviceSSH, - Method: "keyboard-interactive", - })); err != nil { - return false, nil, err - } - - for { - packet, err := c.readPacket() - if err != nil { - return false, nil, err - } - - // like handleAuthResponse, but with less options. - switch packet[0] { - case msgUserAuthBanner: - // TODO: Print banners during userauth. - continue - case msgUserAuthInfoRequest: - // OK - case msgUserAuthFailure: - var msg userAuthFailureMsg - if err := Unmarshal(packet, &msg); err != nil { - return false, nil, err - } - return false, msg.Methods, nil - case msgUserAuthSuccess: - return true, nil, nil - default: - return false, nil, unexpectedMessageError(msgUserAuthInfoRequest, packet[0]) - } - - var msg userAuthInfoRequestMsg - if err := Unmarshal(packet, &msg); err != nil { - return false, nil, err - } - - // Manually unpack the prompt/echo pairs. - rest := msg.Prompts - var prompts []string - var echos []bool - for i := 0; i < int(msg.NumPrompts); i++ { - prompt, r, ok := parseString(rest) - if !ok || len(r) == 0 { - return false, nil, errors.New("ssh: prompt format error") - } - prompts = append(prompts, string(prompt)) - echos = append(echos, r[0] != 0) - rest = r[1:] - } - - if len(rest) != 0 { - return false, nil, errors.New("ssh: extra data following keyboard-interactive pairs") - } - - answers, err := cb(msg.User, msg.Instruction, prompts, echos) - if err != nil { - return false, nil, err - } - - if len(answers) != len(prompts) { - return false, nil, errors.New("ssh: not enough answers from keyboard-interactive callback") - } - responseLength := 1 + 4 - for _, a := range answers { - responseLength += stringLength(len(a)) - } - serialized := make([]byte, responseLength) - p := serialized - p[0] = msgUserAuthInfoResponse - p = p[1:] - p = marshalUint32(p, uint32(len(answers))) - for _, a := range answers { - p = marshalString(p, []byte(a)) - } - - if err := c.writePacket(serialized); err != nil { - return false, nil, err - } - } -} - -type retryableAuthMethod struct { - authMethod AuthMethod - maxTries int -} - -func (r *retryableAuthMethod) auth(session []byte, user string, c packetConn, rand io.Reader) (ok bool, methods []string, err error) { - for i := 0; r.maxTries <= 0 || i < r.maxTries; i++ { - ok, methods, err = r.authMethod.auth(session, user, c, rand) - if ok || err != nil { // either success or error terminate - return ok, methods, err - } - } - return ok, methods, err -} - -func (r *retryableAuthMethod) method() string { - return r.authMethod.method() -} - -// RetryableAuthMethod is a decorator for other auth methods enabling them to -// be retried up to maxTries before considering that AuthMethod itself failed. -// If maxTries is <= 0, will retry indefinitely -// -// This is useful for interactive clients using challenge/response type -// authentication (e.g. Keyboard-Interactive, Password, etc) where the user -// could mistype their response resulting in the server issuing a -// SSH_MSG_USERAUTH_FAILURE (rfc4252 #8 [password] and rfc4256 #3.4 -// [keyboard-interactive]); Without this decorator, the non-retryable -// AuthMethod would be removed from future consideration, and never tried again -// (and so the user would never be able to retry their entry). -func RetryableAuthMethod(auth AuthMethod, maxTries int) AuthMethod { - return &retryableAuthMethod{authMethod: auth, maxTries: maxTries} -} diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go deleted file mode 100644 index 2c72ab5..0000000 --- a/vendor/golang.org/x/crypto/ssh/common.go +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "crypto" - "crypto/rand" - "fmt" - "io" - "sync" - - _ "crypto/sha1" - _ "crypto/sha256" - _ "crypto/sha512" -) - -// These are string constants in the SSH protocol. -const ( - compressionNone = "none" - serviceUserAuth = "ssh-userauth" - serviceSSH = "ssh-connection" -) - -// supportedCiphers specifies the supported ciphers in preference order. -var supportedCiphers = []string{ - "aes128-ctr", "aes192-ctr", "aes256-ctr", - "aes128-gcm@openssh.com", - "arcfour256", "arcfour128", -} - -// supportedKexAlgos specifies the supported key-exchange algorithms in -// preference order. -var supportedKexAlgos = []string{ - kexAlgoCurve25519SHA256, - // P384 and P521 are not constant-time yet, but since we don't - // reuse ephemeral keys, using them for ECDH should be OK. - kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, - kexAlgoDH14SHA1, kexAlgoDH1SHA1, -} - -// supportedKexAlgos specifies the supported host-key algorithms (i.e. methods -// of authenticating servers) in preference order. -var supportedHostKeyAlgos = []string{ - CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, - CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01, - - KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, - KeyAlgoRSA, KeyAlgoDSA, - - KeyAlgoED25519, -} - -// supportedMACs specifies a default set of MAC algorithms in preference order. -// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed -// because they have reached the end of their useful life. -var supportedMACs = []string{ - "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96", -} - -var supportedCompressions = []string{compressionNone} - -// hashFuncs keeps the mapping of supported algorithms to their respective -// hashes needed for signature verification. -var hashFuncs = map[string]crypto.Hash{ - KeyAlgoRSA: crypto.SHA1, - KeyAlgoDSA: crypto.SHA1, - KeyAlgoECDSA256: crypto.SHA256, - KeyAlgoECDSA384: crypto.SHA384, - KeyAlgoECDSA521: crypto.SHA512, - CertAlgoRSAv01: crypto.SHA1, - CertAlgoDSAv01: crypto.SHA1, - CertAlgoECDSA256v01: crypto.SHA256, - CertAlgoECDSA384v01: crypto.SHA384, - CertAlgoECDSA521v01: crypto.SHA512, -} - -// unexpectedMessageError results when the SSH message that we received didn't -// match what we wanted. -func unexpectedMessageError(expected, got uint8) error { - return fmt.Errorf("ssh: unexpected message type %d (expected %d)", got, expected) -} - -// parseError results from a malformed SSH message. -func parseError(tag uint8) error { - return fmt.Errorf("ssh: parse error in message type %d", tag) -} - -func findCommon(what string, client []string, server []string) (common string, err error) { - for _, c := range client { - for _, s := range server { - if c == s { - return c, nil - } - } - } - return "", fmt.Errorf("ssh: no common algorithm for %s; client offered: %v, server offered: %v", what, client, server) -} - -type directionAlgorithms struct { - Cipher string - MAC string - Compression string -} - -type algorithms struct { - kex string - hostKey string - w directionAlgorithms - r directionAlgorithms -} - -func findAgreedAlgorithms(clientKexInit, serverKexInit *kexInitMsg) (algs *algorithms, err error) { - result := &algorithms{} - - result.kex, err = findCommon("key exchange", clientKexInit.KexAlgos, serverKexInit.KexAlgos) - if err != nil { - return - } - - result.hostKey, err = findCommon("host key", clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos) - if err != nil { - return - } - - result.w.Cipher, err = findCommon("client to server cipher", clientKexInit.CiphersClientServer, serverKexInit.CiphersClientServer) - if err != nil { - return - } - - result.r.Cipher, err = findCommon("server to client cipher", clientKexInit.CiphersServerClient, serverKexInit.CiphersServerClient) - if err != nil { - return - } - - result.w.MAC, err = findCommon("client to server MAC", clientKexInit.MACsClientServer, serverKexInit.MACsClientServer) - if err != nil { - return - } - - result.r.MAC, err = findCommon("server to client MAC", clientKexInit.MACsServerClient, serverKexInit.MACsServerClient) - if err != nil { - return - } - - result.w.Compression, err = findCommon("client to server compression", clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer) - if err != nil { - return - } - - result.r.Compression, err = findCommon("server to client compression", clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient) - if err != nil { - return - } - - return result, nil -} - -// If rekeythreshold is too small, we can't make any progress sending -// stuff. -const minRekeyThreshold uint64 = 256 - -// Config contains configuration data common to both ServerConfig and -// ClientConfig. -type Config struct { - // Rand provides the source of entropy for cryptographic - // primitives. If Rand is nil, the cryptographic random reader - // in package crypto/rand will be used. - Rand io.Reader - - // The maximum number of bytes sent or received after which a - // new key is negotiated. It must be at least 256. If - // unspecified, 1 gigabyte is used. - RekeyThreshold uint64 - - // The allowed key exchanges algorithms. If unspecified then a - // default set of algorithms is used. - KeyExchanges []string - - // The allowed cipher algorithms. If unspecified then a sensible - // default is used. - Ciphers []string - - // The allowed MAC algorithms. If unspecified then a sensible default - // is used. - MACs []string -} - -// SetDefaults sets sensible values for unset fields in config. This is -// exported for testing: Configs passed to SSH functions are copied and have -// default values set automatically. -func (c *Config) SetDefaults() { - if c.Rand == nil { - c.Rand = rand.Reader - } - if c.Ciphers == nil { - c.Ciphers = supportedCiphers - } - var ciphers []string - for _, c := range c.Ciphers { - if cipherModes[c] != nil { - // reject the cipher if we have no cipherModes definition - ciphers = append(ciphers, c) - } - } - c.Ciphers = ciphers - - if c.KeyExchanges == nil { - c.KeyExchanges = supportedKexAlgos - } - - if c.MACs == nil { - c.MACs = supportedMACs - } - - if c.RekeyThreshold == 0 { - // RFC 4253, section 9 suggests rekeying after 1G. - c.RekeyThreshold = 1 << 30 - } - if c.RekeyThreshold < minRekeyThreshold { - c.RekeyThreshold = minRekeyThreshold - } -} - -// buildDataSignedForAuth returns the data that is signed in order to prove -// possession of a private key. See RFC 4252, section 7. -func buildDataSignedForAuth(sessionId []byte, req userAuthRequestMsg, algo, pubKey []byte) []byte { - data := struct { - Session []byte - Type byte - User string - Service string - Method string - Sign bool - Algo []byte - PubKey []byte - }{ - sessionId, - msgUserAuthRequest, - req.User, - req.Service, - req.Method, - true, - algo, - pubKey, - } - return Marshal(data) -} - -func appendU16(buf []byte, n uint16) []byte { - return append(buf, byte(n>>8), byte(n)) -} - -func appendU32(buf []byte, n uint32) []byte { - return append(buf, byte(n>>24), byte(n>>16), byte(n>>8), byte(n)) -} - -func appendU64(buf []byte, n uint64) []byte { - return append(buf, - byte(n>>56), byte(n>>48), byte(n>>40), byte(n>>32), - byte(n>>24), byte(n>>16), byte(n>>8), byte(n)) -} - -func appendInt(buf []byte, n int) []byte { - return appendU32(buf, uint32(n)) -} - -func appendString(buf []byte, s string) []byte { - buf = appendU32(buf, uint32(len(s))) - buf = append(buf, s...) - return buf -} - -func appendBool(buf []byte, b bool) []byte { - if b { - return append(buf, 1) - } - return append(buf, 0) -} - -// newCond is a helper to hide the fact that there is no usable zero -// value for sync.Cond. -func newCond() *sync.Cond { return sync.NewCond(new(sync.Mutex)) } - -// window represents the buffer available to clients -// wishing to write to a channel. -type window struct { - *sync.Cond - win uint32 // RFC 4254 5.2 says the window size can grow to 2^32-1 - writeWaiters int - closed bool -} - -// add adds win to the amount of window available -// for consumers. -func (w *window) add(win uint32) bool { - // a zero sized window adjust is a noop. - if win == 0 { - return true - } - w.L.Lock() - if w.win+win < win { - w.L.Unlock() - return false - } - w.win += win - // It is unusual that multiple goroutines would be attempting to reserve - // window space, but not guaranteed. Use broadcast to notify all waiters - // that additional window is available. - w.Broadcast() - w.L.Unlock() - return true -} - -// close sets the window to closed, so all reservations fail -// immediately. -func (w *window) close() { - w.L.Lock() - w.closed = true - w.Broadcast() - w.L.Unlock() -} - -// reserve reserves win from the available window capacity. -// If no capacity remains, reserve will block. reserve may -// return less than requested. -func (w *window) reserve(win uint32) (uint32, error) { - var err error - w.L.Lock() - w.writeWaiters++ - w.Broadcast() - for w.win == 0 && !w.closed { - w.Wait() - } - w.writeWaiters-- - if w.win < win { - win = w.win - } - w.win -= win - if w.closed { - err = io.EOF - } - w.L.Unlock() - return win, err -} - -// waitWriterBlocked waits until some goroutine is blocked for further -// writes. It is used in tests only. -func (w *window) waitWriterBlocked() { - w.Cond.L.Lock() - for w.writeWaiters == 0 { - w.Cond.Wait() - } - w.Cond.L.Unlock() -} diff --git a/vendor/golang.org/x/crypto/ssh/connection.go b/vendor/golang.org/x/crypto/ssh/connection.go deleted file mode 100644 index e786f2f..0000000 --- a/vendor/golang.org/x/crypto/ssh/connection.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "fmt" - "net" -) - -// OpenChannelError is returned if the other side rejects an -// OpenChannel request. -type OpenChannelError struct { - Reason RejectionReason - Message string -} - -func (e *OpenChannelError) Error() string { - return fmt.Sprintf("ssh: rejected: %s (%s)", e.Reason, e.Message) -} - -// ConnMetadata holds metadata for the connection. -type ConnMetadata interface { - // User returns the user ID for this connection. - User() string - - // SessionID returns the sesson hash, also denoted by H. - SessionID() []byte - - // ClientVersion returns the client's version string as hashed - // into the session ID. - ClientVersion() []byte - - // ServerVersion returns the server's version string as hashed - // into the session ID. - ServerVersion() []byte - - // RemoteAddr returns the remote address for this connection. - RemoteAddr() net.Addr - - // LocalAddr returns the local address for this connection. - LocalAddr() net.Addr -} - -// Conn represents an SSH connection for both server and client roles. -// Conn is the basis for implementing an application layer, such -// as ClientConn, which implements the traditional shell access for -// clients. -type Conn interface { - ConnMetadata - - // SendRequest sends a global request, and returns the - // reply. If wantReply is true, it returns the response status - // and payload. See also RFC4254, section 4. - SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error) - - // OpenChannel tries to open an channel. If the request is - // rejected, it returns *OpenChannelError. On success it returns - // the SSH Channel and a Go channel for incoming, out-of-band - // requests. The Go channel must be serviced, or the - // connection will hang. - OpenChannel(name string, data []byte) (Channel, <-chan *Request, error) - - // Close closes the underlying network connection - Close() error - - // Wait blocks until the connection has shut down, and returns the - // error causing the shutdown. - Wait() error - - // TODO(hanwen): consider exposing: - // RequestKeyChange - // Disconnect -} - -// DiscardRequests consumes and rejects all requests from the -// passed-in channel. -func DiscardRequests(in <-chan *Request) { - for req := range in { - if req.WantReply { - req.Reply(false, nil) - } - } -} - -// A connection represents an incoming connection. -type connection struct { - transport *handshakeTransport - sshConn - - // The connection protocol. - *mux -} - -func (c *connection) Close() error { - return c.sshConn.conn.Close() -} - -// sshconn provides net.Conn metadata, but disallows direct reads and -// writes. -type sshConn struct { - conn net.Conn - - user string - sessionID []byte - clientVersion []byte - serverVersion []byte -} - -func dup(src []byte) []byte { - dst := make([]byte, len(src)) - copy(dst, src) - return dst -} - -func (c *sshConn) User() string { - return c.user -} - -func (c *sshConn) RemoteAddr() net.Addr { - return c.conn.RemoteAddr() -} - -func (c *sshConn) Close() error { - return c.conn.Close() -} - -func (c *sshConn) LocalAddr() net.Addr { - return c.conn.LocalAddr() -} - -func (c *sshConn) SessionID() []byte { - return dup(c.sessionID) -} - -func (c *sshConn) ClientVersion() []byte { - return dup(c.clientVersion) -} - -func (c *sshConn) ServerVersion() []byte { - return dup(c.serverVersion) -} diff --git a/vendor/golang.org/x/crypto/ssh/doc.go b/vendor/golang.org/x/crypto/ssh/doc.go deleted file mode 100644 index d6be894..0000000 --- a/vendor/golang.org/x/crypto/ssh/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package ssh implements an SSH client and server. - -SSH is a transport security protocol, an authentication protocol and a -family of application protocols. The most typical application level -protocol is a remote shell and this is specifically implemented. However, -the multiplexed nature of SSH is exposed to users that wish to support -others. - -References: - [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD - [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 -*/ -package ssh // import "golang.org/x/crypto/ssh" diff --git a/vendor/golang.org/x/crypto/ssh/handshake.go b/vendor/golang.org/x/crypto/ssh/handshake.go deleted file mode 100644 index 03c950d..0000000 --- a/vendor/golang.org/x/crypto/ssh/handshake.go +++ /dev/null @@ -1,564 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "crypto/rand" - "errors" - "fmt" - "io" - "log" - "net" - "sync" -) - -// debugHandshake, if set, prints messages sent and received. Key -// exchange messages are printed as if DH were used, so the debug -// messages are wrong when using ECDH. -const debugHandshake = false - -// keyingTransport is a packet based transport that supports key -// changes. It need not be thread-safe. It should pass through -// msgNewKeys in both directions. -type keyingTransport interface { - packetConn - - // prepareKeyChange sets up a key change. The key change for a - // direction will be effected if a msgNewKeys message is sent - // or received. - prepareKeyChange(*algorithms, *kexResult) error -} - -// handshakeTransport implements rekeying on top of a keyingTransport -// and offers a thread-safe writePacket() interface. -type handshakeTransport struct { - conn keyingTransport - config *Config - - serverVersion []byte - clientVersion []byte - - // hostKeys is non-empty if we are the server. In that case, - // it contains all host keys that can be used to sign the - // connection. - hostKeys []Signer - - // hostKeyAlgorithms is non-empty if we are the client. In that case, - // we accept these key types from the server as host key. - hostKeyAlgorithms []string - - // On read error, incoming is closed, and readError is set. - incoming chan []byte - readError error - - mu sync.Mutex - writeError error - sentInitPacket []byte - sentInitMsg *kexInitMsg - pendingPackets [][]byte // Used when a key exchange is in progress. - - // If the read loop wants to schedule a kex, it pings this - // channel, and the write loop will send out a kex message. - requestKex chan struct{} - - // If the other side requests or confirms a kex, its kexInit - // packet is sent here for the write loop to find it. - startKex chan *pendingKex - - // data for host key checking - hostKeyCallback func(hostname string, remote net.Addr, key PublicKey) error - dialAddress string - remoteAddr net.Addr - - readSinceKex uint64 - - writtenSinceKex uint64 - - // The session ID or nil if first kex did not complete yet. - sessionID []byte -} - -type pendingKex struct { - otherInit []byte - done chan error -} - -func newHandshakeTransport(conn keyingTransport, config *Config, clientVersion, serverVersion []byte) *handshakeTransport { - t := &handshakeTransport{ - conn: conn, - serverVersion: serverVersion, - clientVersion: clientVersion, - incoming: make(chan []byte, 16), - requestKex: make(chan struct{}, 1), - startKex: make(chan *pendingKex, 1), - - config: config, - } - return t -} - -func newClientTransport(conn keyingTransport, clientVersion, serverVersion []byte, config *ClientConfig, dialAddr string, addr net.Addr) *handshakeTransport { - t := newHandshakeTransport(conn, &config.Config, clientVersion, serverVersion) - t.dialAddress = dialAddr - t.remoteAddr = addr - t.hostKeyCallback = config.HostKeyCallback - if config.HostKeyAlgorithms != nil { - t.hostKeyAlgorithms = config.HostKeyAlgorithms - } else { - t.hostKeyAlgorithms = supportedHostKeyAlgos - } - go t.readLoop() - go t.kexLoop() - return t -} - -func newServerTransport(conn keyingTransport, clientVersion, serverVersion []byte, config *ServerConfig) *handshakeTransport { - t := newHandshakeTransport(conn, &config.Config, clientVersion, serverVersion) - t.hostKeys = config.hostKeys - go t.readLoop() - go t.kexLoop() - return t -} - -func (t *handshakeTransport) getSessionID() []byte { - return t.sessionID -} - -// waitSession waits for the session to be established. This should be -// the first thing to call after instantiating handshakeTransport. -func (t *handshakeTransport) waitSession() error { - p, err := t.readPacket() - if err != nil { - return err - } - if p[0] != msgNewKeys { - return fmt.Errorf("ssh: first packet should be msgNewKeys") - } - - return nil -} - -func (t *handshakeTransport) id() string { - if len(t.hostKeys) > 0 { - return "server" - } - return "client" -} - -func (t *handshakeTransport) printPacket(p []byte, write bool) { - action := "got" - if write { - action = "sent" - } - if p[0] == msgChannelData || p[0] == msgChannelExtendedData { - log.Printf("%s %s data (packet %d bytes)", t.id(), action, len(p)) - } else { - msg, err := decode(p) - log.Printf("%s %s %T %v (%v)", t.id(), action, msg, msg, err) - } -} - -func (t *handshakeTransport) readPacket() ([]byte, error) { - p, ok := <-t.incoming - if !ok { - return nil, t.readError - } - return p, nil -} - -func (t *handshakeTransport) readLoop() { - // We always start with the mandatory key exchange. We use - // the channel for simplicity, and this works if we can rely - // on the SSH package itself not doing anything else before - // waitSession has completed. - t.requestKeyExchange() - - first := true - for { - p, err := t.readOnePacket(first) - first = false - if err != nil { - t.readError = err - close(t.incoming) - break - } - if p[0] == msgIgnore || p[0] == msgDebug { - continue - } - t.incoming <- p - } - - // Stop writers too. - t.recordWriteError(t.readError) - - // Unblock the writer should it wait for this. - close(t.startKex) - - // Don't close t.requestKex; it's also written to from writePacket. -} - -func (t *handshakeTransport) pushPacket(p []byte) error { - if debugHandshake { - t.printPacket(p, true) - } - return t.conn.writePacket(p) -} - -func (t *handshakeTransport) getWriteError() error { - t.mu.Lock() - defer t.mu.Unlock() - return t.writeError -} - -func (t *handshakeTransport) recordWriteError(err error) { - t.mu.Lock() - defer t.mu.Unlock() - if t.writeError == nil && err != nil { - t.writeError = err - } -} - -func (t *handshakeTransport) requestKeyExchange() { - select { - case t.requestKex <- struct{}{}: - default: - // something already requested a kex, so do nothing. - } - -} - -func (t *handshakeTransport) kexLoop() { -write: - for t.getWriteError() == nil { - var request *pendingKex - var sent bool - - for request == nil || !sent { - var ok bool - select { - case request, ok = <-t.startKex: - if !ok { - break write - } - case <-t.requestKex: - } - - if !sent { - if err := t.sendKexInit(); err != nil { - t.recordWriteError(err) - break - } - sent = true - } - } - - if err := t.getWriteError(); err != nil { - if request != nil { - request.done <- err - } - break - } - - // We're not servicing t.requestKex, but that is OK: - // we never block on sending to t.requestKex. - - // We're not servicing t.startKex, but the remote end - // has just sent us a kexInitMsg, so it can't send - // another key change request. - - err := t.enterKeyExchange(request.otherInit) - - t.mu.Lock() - t.writeError = err - t.sentInitPacket = nil - t.sentInitMsg = nil - t.writtenSinceKex = 0 - request.done <- t.writeError - - // kex finished. Push packets that we received while - // the kex was in progress. Don't look at t.startKex - // and don't increment writtenSinceKex: if we trigger - // another kex while we are still busy with the last - // one, things will become very confusing. - for _, p := range t.pendingPackets { - t.writeError = t.pushPacket(p) - if t.writeError != nil { - break - } - } - t.pendingPackets = t.pendingPackets[0:] - t.mu.Unlock() - } - - // drain startKex channel. We don't service t.requestKex - // because nobody does blocking sends there. - go func() { - for init := range t.startKex { - init.done <- t.writeError - } - }() - - // Unblock reader. - t.conn.Close() -} - -func (t *handshakeTransport) readOnePacket(first bool) ([]byte, error) { - if t.readSinceKex > t.config.RekeyThreshold { - t.requestKeyExchange() - } - - p, err := t.conn.readPacket() - if err != nil { - return nil, err - } - - t.readSinceKex += uint64(len(p)) - if debugHandshake { - t.printPacket(p, false) - } - - if first && p[0] != msgKexInit { - return nil, fmt.Errorf("ssh: first packet should be msgKexInit") - } - - if p[0] != msgKexInit { - return p, nil - } - - firstKex := t.sessionID == nil - - kex := pendingKex{ - done: make(chan error, 1), - otherInit: p, - } - t.startKex <- &kex - err = <-kex.done - - if debugHandshake { - log.Printf("%s exited key exchange (first %v), err %v", t.id(), firstKex, err) - } - - if err != nil { - return nil, err - } - - t.readSinceKex = 0 - - // By default, a key exchange is hidden from higher layers by - // translating it into msgIgnore. - successPacket := []byte{msgIgnore} - if firstKex { - // sendKexInit() for the first kex waits for - // msgNewKeys so the authentication process is - // guaranteed to happen over an encrypted transport. - successPacket = []byte{msgNewKeys} - } - - return successPacket, nil -} - -// sendKexInit sends a key change message. -func (t *handshakeTransport) sendKexInit() error { - t.mu.Lock() - defer t.mu.Unlock() - if t.sentInitMsg != nil { - // kexInits may be sent either in response to the other side, - // or because our side wants to initiate a key change, so we - // may have already sent a kexInit. In that case, don't send a - // second kexInit. - return nil - } - - msg := &kexInitMsg{ - KexAlgos: t.config.KeyExchanges, - CiphersClientServer: t.config.Ciphers, - CiphersServerClient: t.config.Ciphers, - MACsClientServer: t.config.MACs, - MACsServerClient: t.config.MACs, - CompressionClientServer: supportedCompressions, - CompressionServerClient: supportedCompressions, - } - io.ReadFull(rand.Reader, msg.Cookie[:]) - - if len(t.hostKeys) > 0 { - for _, k := range t.hostKeys { - msg.ServerHostKeyAlgos = append( - msg.ServerHostKeyAlgos, k.PublicKey().Type()) - } - } else { - msg.ServerHostKeyAlgos = t.hostKeyAlgorithms - } - packet := Marshal(msg) - - // writePacket destroys the contents, so save a copy. - packetCopy := make([]byte, len(packet)) - copy(packetCopy, packet) - - if err := t.pushPacket(packetCopy); err != nil { - return err - } - - t.sentInitMsg = msg - t.sentInitPacket = packet - - return nil -} - -func (t *handshakeTransport) writePacket(p []byte) error { - switch p[0] { - case msgKexInit: - return errors.New("ssh: only handshakeTransport can send kexInit") - case msgNewKeys: - return errors.New("ssh: only handshakeTransport can send newKeys") - } - - t.mu.Lock() - defer t.mu.Unlock() - if t.writeError != nil { - return t.writeError - } - - if t.sentInitMsg != nil { - // Copy the packet so the writer can reuse the buffer. - cp := make([]byte, len(p)) - copy(cp, p) - t.pendingPackets = append(t.pendingPackets, cp) - return nil - } - t.writtenSinceKex += uint64(len(p)) - if t.writtenSinceKex > t.config.RekeyThreshold { - t.requestKeyExchange() - } - - if err := t.pushPacket(p); err != nil { - t.writeError = err - } - - return nil -} - -func (t *handshakeTransport) Close() error { - return t.conn.Close() -} - -func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { - if debugHandshake { - log.Printf("%s entered key exchange", t.id()) - } - - otherInit := &kexInitMsg{} - if err := Unmarshal(otherInitPacket, otherInit); err != nil { - return err - } - - magics := handshakeMagics{ - clientVersion: t.clientVersion, - serverVersion: t.serverVersion, - clientKexInit: otherInitPacket, - serverKexInit: t.sentInitPacket, - } - - clientInit := otherInit - serverInit := t.sentInitMsg - if len(t.hostKeys) == 0 { - clientInit, serverInit = serverInit, clientInit - - magics.clientKexInit = t.sentInitPacket - magics.serverKexInit = otherInitPacket - } - - algs, err := findAgreedAlgorithms(clientInit, serverInit) - if err != nil { - return err - } - - // We don't send FirstKexFollows, but we handle receiving it. - // - // RFC 4253 section 7 defines the kex and the agreement method for - // first_kex_packet_follows. It states that the guessed packet - // should be ignored if the "kex algorithm and/or the host - // key algorithm is guessed wrong (server and client have - // different preferred algorithm), or if any of the other - // algorithms cannot be agreed upon". The other algorithms have - // already been checked above so the kex algorithm and host key - // algorithm are checked here. - if otherInit.FirstKexFollows && (clientInit.KexAlgos[0] != serverInit.KexAlgos[0] || clientInit.ServerHostKeyAlgos[0] != serverInit.ServerHostKeyAlgos[0]) { - // other side sent a kex message for the wrong algorithm, - // which we have to ignore. - if _, err := t.conn.readPacket(); err != nil { - return err - } - } - - kex, ok := kexAlgoMap[algs.kex] - if !ok { - return fmt.Errorf("ssh: unexpected key exchange algorithm %v", algs.kex) - } - - var result *kexResult - if len(t.hostKeys) > 0 { - result, err = t.server(kex, algs, &magics) - } else { - result, err = t.client(kex, algs, &magics) - } - - if err != nil { - return err - } - - if t.sessionID == nil { - t.sessionID = result.H - } - result.SessionID = t.sessionID - - t.conn.prepareKeyChange(algs, result) - if err = t.conn.writePacket([]byte{msgNewKeys}); err != nil { - return err - } - if packet, err := t.conn.readPacket(); err != nil { - return err - } else if packet[0] != msgNewKeys { - return unexpectedMessageError(msgNewKeys, packet[0]) - } - - return nil -} - -func (t *handshakeTransport) server(kex kexAlgorithm, algs *algorithms, magics *handshakeMagics) (*kexResult, error) { - var hostKey Signer - for _, k := range t.hostKeys { - if algs.hostKey == k.PublicKey().Type() { - hostKey = k - } - } - - r, err := kex.Server(t.conn, t.config.Rand, magics, hostKey) - return r, err -} - -func (t *handshakeTransport) client(kex kexAlgorithm, algs *algorithms, magics *handshakeMagics) (*kexResult, error) { - result, err := kex.Client(t.conn, t.config.Rand, magics) - if err != nil { - return nil, err - } - - hostKey, err := ParsePublicKey(result.HostKey) - if err != nil { - return nil, err - } - - if err := verifyHostKeySignature(hostKey, result); err != nil { - return nil, err - } - - if t.hostKeyCallback != nil { - err = t.hostKeyCallback(t.dialAddress, t.remoteAddr, hostKey) - if err != nil { - return nil, err - } - } - - return result, nil -} diff --git a/vendor/golang.org/x/crypto/ssh/kex.go b/vendor/golang.org/x/crypto/ssh/kex.go deleted file mode 100644 index c87fbeb..0000000 --- a/vendor/golang.org/x/crypto/ssh/kex.go +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/subtle" - "errors" - "io" - "math/big" - - "golang.org/x/crypto/curve25519" -) - -const ( - kexAlgoDH1SHA1 = "diffie-hellman-group1-sha1" - kexAlgoDH14SHA1 = "diffie-hellman-group14-sha1" - kexAlgoECDH256 = "ecdh-sha2-nistp256" - kexAlgoECDH384 = "ecdh-sha2-nistp384" - kexAlgoECDH521 = "ecdh-sha2-nistp521" - kexAlgoCurve25519SHA256 = "curve25519-sha256@libssh.org" -) - -// kexResult captures the outcome of a key exchange. -type kexResult struct { - // Session hash. See also RFC 4253, section 8. - H []byte - - // Shared secret. See also RFC 4253, section 8. - K []byte - - // Host key as hashed into H. - HostKey []byte - - // Signature of H. - Signature []byte - - // A cryptographic hash function that matches the security - // level of the key exchange algorithm. It is used for - // calculating H, and for deriving keys from H and K. - Hash crypto.Hash - - // The session ID, which is the first H computed. This is used - // to derive key material inside the transport. - SessionID []byte -} - -// handshakeMagics contains data that is always included in the -// session hash. -type handshakeMagics struct { - clientVersion, serverVersion []byte - clientKexInit, serverKexInit []byte -} - -func (m *handshakeMagics) write(w io.Writer) { - writeString(w, m.clientVersion) - writeString(w, m.serverVersion) - writeString(w, m.clientKexInit) - writeString(w, m.serverKexInit) -} - -// kexAlgorithm abstracts different key exchange algorithms. -type kexAlgorithm interface { - // Server runs server-side key agreement, signing the result - // with a hostkey. - Server(p packetConn, rand io.Reader, magics *handshakeMagics, s Signer) (*kexResult, error) - - // Client runs the client-side key agreement. Caller is - // responsible for verifying the host key signature. - Client(p packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) -} - -// dhGroup is a multiplicative group suitable for implementing Diffie-Hellman key agreement. -type dhGroup struct { - g, p, pMinus1 *big.Int -} - -func (group *dhGroup) diffieHellman(theirPublic, myPrivate *big.Int) (*big.Int, error) { - if theirPublic.Cmp(bigOne) <= 0 || theirPublic.Cmp(group.pMinus1) >= 0 { - return nil, errors.New("ssh: DH parameter out of bounds") - } - return new(big.Int).Exp(theirPublic, myPrivate, group.p), nil -} - -func (group *dhGroup) Client(c packetConn, randSource io.Reader, magics *handshakeMagics) (*kexResult, error) { - hashFunc := crypto.SHA1 - - var x *big.Int - for { - var err error - if x, err = rand.Int(randSource, group.pMinus1); err != nil { - return nil, err - } - if x.Sign() > 0 { - break - } - } - - X := new(big.Int).Exp(group.g, x, group.p) - kexDHInit := kexDHInitMsg{ - X: X, - } - if err := c.writePacket(Marshal(&kexDHInit)); err != nil { - return nil, err - } - - packet, err := c.readPacket() - if err != nil { - return nil, err - } - - var kexDHReply kexDHReplyMsg - if err = Unmarshal(packet, &kexDHReply); err != nil { - return nil, err - } - - kInt, err := group.diffieHellman(kexDHReply.Y, x) - if err != nil { - return nil, err - } - - h := hashFunc.New() - magics.write(h) - writeString(h, kexDHReply.HostKey) - writeInt(h, X) - writeInt(h, kexDHReply.Y) - K := make([]byte, intLength(kInt)) - marshalInt(K, kInt) - h.Write(K) - - return &kexResult{ - H: h.Sum(nil), - K: K, - HostKey: kexDHReply.HostKey, - Signature: kexDHReply.Signature, - Hash: crypto.SHA1, - }, nil -} - -func (group *dhGroup) Server(c packetConn, randSource io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) { - hashFunc := crypto.SHA1 - packet, err := c.readPacket() - if err != nil { - return - } - var kexDHInit kexDHInitMsg - if err = Unmarshal(packet, &kexDHInit); err != nil { - return - } - - var y *big.Int - for { - if y, err = rand.Int(randSource, group.pMinus1); err != nil { - return - } - if y.Sign() > 0 { - break - } - } - - Y := new(big.Int).Exp(group.g, y, group.p) - kInt, err := group.diffieHellman(kexDHInit.X, y) - if err != nil { - return nil, err - } - - hostKeyBytes := priv.PublicKey().Marshal() - - h := hashFunc.New() - magics.write(h) - writeString(h, hostKeyBytes) - writeInt(h, kexDHInit.X) - writeInt(h, Y) - - K := make([]byte, intLength(kInt)) - marshalInt(K, kInt) - h.Write(K) - - H := h.Sum(nil) - - // H is already a hash, but the hostkey signing will apply its - // own key-specific hash algorithm. - sig, err := signAndMarshal(priv, randSource, H) - if err != nil { - return nil, err - } - - kexDHReply := kexDHReplyMsg{ - HostKey: hostKeyBytes, - Y: Y, - Signature: sig, - } - packet = Marshal(&kexDHReply) - - err = c.writePacket(packet) - return &kexResult{ - H: H, - K: K, - HostKey: hostKeyBytes, - Signature: sig, - Hash: crypto.SHA1, - }, nil -} - -// ecdh performs Elliptic Curve Diffie-Hellman key exchange as -// described in RFC 5656, section 4. -type ecdh struct { - curve elliptic.Curve -} - -func (kex *ecdh) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) { - ephKey, err := ecdsa.GenerateKey(kex.curve, rand) - if err != nil { - return nil, err - } - - kexInit := kexECDHInitMsg{ - ClientPubKey: elliptic.Marshal(kex.curve, ephKey.PublicKey.X, ephKey.PublicKey.Y), - } - - serialized := Marshal(&kexInit) - if err := c.writePacket(serialized); err != nil { - return nil, err - } - - packet, err := c.readPacket() - if err != nil { - return nil, err - } - - var reply kexECDHReplyMsg - if err = Unmarshal(packet, &reply); err != nil { - return nil, err - } - - x, y, err := unmarshalECKey(kex.curve, reply.EphemeralPubKey) - if err != nil { - return nil, err - } - - // generate shared secret - secret, _ := kex.curve.ScalarMult(x, y, ephKey.D.Bytes()) - - h := ecHash(kex.curve).New() - magics.write(h) - writeString(h, reply.HostKey) - writeString(h, kexInit.ClientPubKey) - writeString(h, reply.EphemeralPubKey) - K := make([]byte, intLength(secret)) - marshalInt(K, secret) - h.Write(K) - - return &kexResult{ - H: h.Sum(nil), - K: K, - HostKey: reply.HostKey, - Signature: reply.Signature, - Hash: ecHash(kex.curve), - }, nil -} - -// unmarshalECKey parses and checks an EC key. -func unmarshalECKey(curve elliptic.Curve, pubkey []byte) (x, y *big.Int, err error) { - x, y = elliptic.Unmarshal(curve, pubkey) - if x == nil { - return nil, nil, errors.New("ssh: elliptic.Unmarshal failure") - } - if !validateECPublicKey(curve, x, y) { - return nil, nil, errors.New("ssh: public key not on curve") - } - return x, y, nil -} - -// validateECPublicKey checks that the point is a valid public key for -// the given curve. See [SEC1], 3.2.2 -func validateECPublicKey(curve elliptic.Curve, x, y *big.Int) bool { - if x.Sign() == 0 && y.Sign() == 0 { - return false - } - - if x.Cmp(curve.Params().P) >= 0 { - return false - } - - if y.Cmp(curve.Params().P) >= 0 { - return false - } - - if !curve.IsOnCurve(x, y) { - return false - } - - // We don't check if N * PubKey == 0, since - // - // - the NIST curves have cofactor = 1, so this is implicit. - // (We don't foresee an implementation that supports non NIST - // curves) - // - // - for ephemeral keys, we don't need to worry about small - // subgroup attacks. - return true -} - -func (kex *ecdh) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) { - packet, err := c.readPacket() - if err != nil { - return nil, err - } - - var kexECDHInit kexECDHInitMsg - if err = Unmarshal(packet, &kexECDHInit); err != nil { - return nil, err - } - - clientX, clientY, err := unmarshalECKey(kex.curve, kexECDHInit.ClientPubKey) - if err != nil { - return nil, err - } - - // We could cache this key across multiple users/multiple - // connection attempts, but the benefit is small. OpenSSH - // generates a new key for each incoming connection. - ephKey, err := ecdsa.GenerateKey(kex.curve, rand) - if err != nil { - return nil, err - } - - hostKeyBytes := priv.PublicKey().Marshal() - - serializedEphKey := elliptic.Marshal(kex.curve, ephKey.PublicKey.X, ephKey.PublicKey.Y) - - // generate shared secret - secret, _ := kex.curve.ScalarMult(clientX, clientY, ephKey.D.Bytes()) - - h := ecHash(kex.curve).New() - magics.write(h) - writeString(h, hostKeyBytes) - writeString(h, kexECDHInit.ClientPubKey) - writeString(h, serializedEphKey) - - K := make([]byte, intLength(secret)) - marshalInt(K, secret) - h.Write(K) - - H := h.Sum(nil) - - // H is already a hash, but the hostkey signing will apply its - // own key-specific hash algorithm. - sig, err := signAndMarshal(priv, rand, H) - if err != nil { - return nil, err - } - - reply := kexECDHReplyMsg{ - EphemeralPubKey: serializedEphKey, - HostKey: hostKeyBytes, - Signature: sig, - } - - serialized := Marshal(&reply) - if err := c.writePacket(serialized); err != nil { - return nil, err - } - - return &kexResult{ - H: H, - K: K, - HostKey: reply.HostKey, - Signature: sig, - Hash: ecHash(kex.curve), - }, nil -} - -var kexAlgoMap = map[string]kexAlgorithm{} - -func init() { - // This is the group called diffie-hellman-group1-sha1 in RFC - // 4253 and Oakley Group 2 in RFC 2409. - p, _ := new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF", 16) - kexAlgoMap[kexAlgoDH1SHA1] = &dhGroup{ - g: new(big.Int).SetInt64(2), - p: p, - pMinus1: new(big.Int).Sub(p, bigOne), - } - - // This is the group called diffie-hellman-group14-sha1 in RFC - // 4253 and Oakley Group 14 in RFC 3526. - p, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF", 16) - - kexAlgoMap[kexAlgoDH14SHA1] = &dhGroup{ - g: new(big.Int).SetInt64(2), - p: p, - pMinus1: new(big.Int).Sub(p, bigOne), - } - - kexAlgoMap[kexAlgoECDH521] = &ecdh{elliptic.P521()} - kexAlgoMap[kexAlgoECDH384] = &ecdh{elliptic.P384()} - kexAlgoMap[kexAlgoECDH256] = &ecdh{elliptic.P256()} - kexAlgoMap[kexAlgoCurve25519SHA256] = &curve25519sha256{} -} - -// curve25519sha256 implements the curve25519-sha256@libssh.org key -// agreement protocol, as described in -// https://git.libssh.org/projects/libssh.git/tree/doc/curve25519-sha256@libssh.org.txt -type curve25519sha256 struct{} - -type curve25519KeyPair struct { - priv [32]byte - pub [32]byte -} - -func (kp *curve25519KeyPair) generate(rand io.Reader) error { - if _, err := io.ReadFull(rand, kp.priv[:]); err != nil { - return err - } - curve25519.ScalarBaseMult(&kp.pub, &kp.priv) - return nil -} - -// curve25519Zeros is just an array of 32 zero bytes so that we have something -// convenient to compare against in order to reject curve25519 points with the -// wrong order. -var curve25519Zeros [32]byte - -func (kex *curve25519sha256) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) { - var kp curve25519KeyPair - if err := kp.generate(rand); err != nil { - return nil, err - } - if err := c.writePacket(Marshal(&kexECDHInitMsg{kp.pub[:]})); err != nil { - return nil, err - } - - packet, err := c.readPacket() - if err != nil { - return nil, err - } - - var reply kexECDHReplyMsg - if err = Unmarshal(packet, &reply); err != nil { - return nil, err - } - if len(reply.EphemeralPubKey) != 32 { - return nil, errors.New("ssh: peer's curve25519 public value has wrong length") - } - - var servPub, secret [32]byte - copy(servPub[:], reply.EphemeralPubKey) - curve25519.ScalarMult(&secret, &kp.priv, &servPub) - if subtle.ConstantTimeCompare(secret[:], curve25519Zeros[:]) == 1 { - return nil, errors.New("ssh: peer's curve25519 public value has wrong order") - } - - h := crypto.SHA256.New() - magics.write(h) - writeString(h, reply.HostKey) - writeString(h, kp.pub[:]) - writeString(h, reply.EphemeralPubKey) - - kInt := new(big.Int).SetBytes(secret[:]) - K := make([]byte, intLength(kInt)) - marshalInt(K, kInt) - h.Write(K) - - return &kexResult{ - H: h.Sum(nil), - K: K, - HostKey: reply.HostKey, - Signature: reply.Signature, - Hash: crypto.SHA256, - }, nil -} - -func (kex *curve25519sha256) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) { - packet, err := c.readPacket() - if err != nil { - return - } - var kexInit kexECDHInitMsg - if err = Unmarshal(packet, &kexInit); err != nil { - return - } - - if len(kexInit.ClientPubKey) != 32 { - return nil, errors.New("ssh: peer's curve25519 public value has wrong length") - } - - var kp curve25519KeyPair - if err := kp.generate(rand); err != nil { - return nil, err - } - - var clientPub, secret [32]byte - copy(clientPub[:], kexInit.ClientPubKey) - curve25519.ScalarMult(&secret, &kp.priv, &clientPub) - if subtle.ConstantTimeCompare(secret[:], curve25519Zeros[:]) == 1 { - return nil, errors.New("ssh: peer's curve25519 public value has wrong order") - } - - hostKeyBytes := priv.PublicKey().Marshal() - - h := crypto.SHA256.New() - magics.write(h) - writeString(h, hostKeyBytes) - writeString(h, kexInit.ClientPubKey) - writeString(h, kp.pub[:]) - - kInt := new(big.Int).SetBytes(secret[:]) - K := make([]byte, intLength(kInt)) - marshalInt(K, kInt) - h.Write(K) - - H := h.Sum(nil) - - sig, err := signAndMarshal(priv, rand, H) - if err != nil { - return nil, err - } - - reply := kexECDHReplyMsg{ - EphemeralPubKey: kp.pub[:], - HostKey: hostKeyBytes, - Signature: sig, - } - if err := c.writePacket(Marshal(&reply)); err != nil { - return nil, err - } - return &kexResult{ - H: H, - K: K, - HostKey: hostKeyBytes, - Signature: sig, - Hash: crypto.SHA256, - }, nil -} diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go deleted file mode 100644 index f38de98..0000000 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ /dev/null @@ -1,905 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "bytes" - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/md5" - "crypto/rsa" - "crypto/sha256" - "crypto/x509" - "encoding/asn1" - "encoding/base64" - "encoding/hex" - "encoding/pem" - "errors" - "fmt" - "io" - "math/big" - "strings" - - "golang.org/x/crypto/ed25519" -) - -// These constants represent the algorithm names for key types supported by this -// package. -const ( - KeyAlgoRSA = "ssh-rsa" - KeyAlgoDSA = "ssh-dss" - KeyAlgoECDSA256 = "ecdsa-sha2-nistp256" - KeyAlgoECDSA384 = "ecdsa-sha2-nistp384" - KeyAlgoECDSA521 = "ecdsa-sha2-nistp521" - KeyAlgoED25519 = "ssh-ed25519" -) - -// parsePubKey parses a public key of the given algorithm. -// Use ParsePublicKey for keys with prepended algorithm. -func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err error) { - switch algo { - case KeyAlgoRSA: - return parseRSA(in) - case KeyAlgoDSA: - return parseDSA(in) - case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521: - return parseECDSA(in) - case KeyAlgoED25519: - return parseED25519(in) - case CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01: - cert, err := parseCert(in, certToPrivAlgo(algo)) - if err != nil { - return nil, nil, err - } - return cert, nil, nil - } - return nil, nil, fmt.Errorf("ssh: unknown key algorithm: %v", algo) -} - -// parseAuthorizedKey parses a public key in OpenSSH authorized_keys format -// (see sshd(8) manual page) once the options and key type fields have been -// removed. -func parseAuthorizedKey(in []byte) (out PublicKey, comment string, err error) { - in = bytes.TrimSpace(in) - - i := bytes.IndexAny(in, " \t") - if i == -1 { - i = len(in) - } - base64Key := in[:i] - - key := make([]byte, base64.StdEncoding.DecodedLen(len(base64Key))) - n, err := base64.StdEncoding.Decode(key, base64Key) - if err != nil { - return nil, "", err - } - key = key[:n] - out, err = ParsePublicKey(key) - if err != nil { - return nil, "", err - } - comment = string(bytes.TrimSpace(in[i:])) - return out, comment, nil -} - -// ParseKnownHosts parses an entry in the format of the known_hosts file. -// -// The known_hosts format is documented in the sshd(8) manual page. This -// function will parse a single entry from in. On successful return, marker -// will contain the optional marker value (i.e. "cert-authority" or "revoked") -// or else be empty, hosts will contain the hosts that this entry matches, -// pubKey will contain the public key and comment will contain any trailing -// comment at the end of the line. See the sshd(8) manual page for the various -// forms that a host string can take. -// -// The unparsed remainder of the input will be returned in rest. This function -// can be called repeatedly to parse multiple entries. -// -// If no entries were found in the input then err will be io.EOF. Otherwise a -// non-nil err value indicates a parse error. -func ParseKnownHosts(in []byte) (marker string, hosts []string, pubKey PublicKey, comment string, rest []byte, err error) { - for len(in) > 0 { - end := bytes.IndexByte(in, '\n') - if end != -1 { - rest = in[end+1:] - in = in[:end] - } else { - rest = nil - } - - end = bytes.IndexByte(in, '\r') - if end != -1 { - in = in[:end] - } - - in = bytes.TrimSpace(in) - if len(in) == 0 || in[0] == '#' { - in = rest - continue - } - - i := bytes.IndexAny(in, " \t") - if i == -1 { - in = rest - continue - } - - // Strip out the beginning of the known_host key. - // This is either an optional marker or a (set of) hostname(s). - keyFields := bytes.Fields(in) - if len(keyFields) < 3 || len(keyFields) > 5 { - return "", nil, nil, "", nil, errors.New("ssh: invalid entry in known_hosts data") - } - - // keyFields[0] is either "@cert-authority", "@revoked" or a comma separated - // list of hosts - marker := "" - if keyFields[0][0] == '@' { - marker = string(keyFields[0][1:]) - keyFields = keyFields[1:] - } - - hosts := string(keyFields[0]) - // keyFields[1] contains the key type (e.g. “ssh-rsa”). - // However, that information is duplicated inside the - // base64-encoded key and so is ignored here. - - key := bytes.Join(keyFields[2:], []byte(" ")) - if pubKey, comment, err = parseAuthorizedKey(key); err != nil { - return "", nil, nil, "", nil, err - } - - return marker, strings.Split(hosts, ","), pubKey, comment, rest, nil - } - - return "", nil, nil, "", nil, io.EOF -} - -// ParseAuthorizedKeys parses a public key from an authorized_keys -// file used in OpenSSH according to the sshd(8) manual page. -func ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []string, rest []byte, err error) { - for len(in) > 0 { - end := bytes.IndexByte(in, '\n') - if end != -1 { - rest = in[end+1:] - in = in[:end] - } else { - rest = nil - } - - end = bytes.IndexByte(in, '\r') - if end != -1 { - in = in[:end] - } - - in = bytes.TrimSpace(in) - if len(in) == 0 || in[0] == '#' { - in = rest - continue - } - - i := bytes.IndexAny(in, " \t") - if i == -1 { - in = rest - continue - } - - if out, comment, err = parseAuthorizedKey(in[i:]); err == nil { - return out, comment, options, rest, nil - } - - // No key type recognised. Maybe there's an options field at - // the beginning. - var b byte - inQuote := false - var candidateOptions []string - optionStart := 0 - for i, b = range in { - isEnd := !inQuote && (b == ' ' || b == '\t') - if (b == ',' && !inQuote) || isEnd { - if i-optionStart > 0 { - candidateOptions = append(candidateOptions, string(in[optionStart:i])) - } - optionStart = i + 1 - } - if isEnd { - break - } - if b == '"' && (i == 0 || (i > 0 && in[i-1] != '\\')) { - inQuote = !inQuote - } - } - for i < len(in) && (in[i] == ' ' || in[i] == '\t') { - i++ - } - if i == len(in) { - // Invalid line: unmatched quote - in = rest - continue - } - - in = in[i:] - i = bytes.IndexAny(in, " \t") - if i == -1 { - in = rest - continue - } - - if out, comment, err = parseAuthorizedKey(in[i:]); err == nil { - options = candidateOptions - return out, comment, options, rest, nil - } - - in = rest - continue - } - - return nil, "", nil, nil, errors.New("ssh: no key found") -} - -// ParsePublicKey parses an SSH public key formatted for use in -// the SSH wire protocol according to RFC 4253, section 6.6. -func ParsePublicKey(in []byte) (out PublicKey, err error) { - algo, in, ok := parseString(in) - if !ok { - return nil, errShortRead - } - var rest []byte - out, rest, err = parsePubKey(in, string(algo)) - if len(rest) > 0 { - return nil, errors.New("ssh: trailing junk in public key") - } - - return out, err -} - -// MarshalAuthorizedKey serializes key for inclusion in an OpenSSH -// authorized_keys file. The return value ends with newline. -func MarshalAuthorizedKey(key PublicKey) []byte { - b := &bytes.Buffer{} - b.WriteString(key.Type()) - b.WriteByte(' ') - e := base64.NewEncoder(base64.StdEncoding, b) - e.Write(key.Marshal()) - e.Close() - b.WriteByte('\n') - return b.Bytes() -} - -// PublicKey is an abstraction of different types of public keys. -type PublicKey interface { - // Type returns the key's type, e.g. "ssh-rsa". - Type() string - - // Marshal returns the serialized key data in SSH wire format, - // with the name prefix. - Marshal() []byte - - // Verify that sig is a signature on the given data using this - // key. This function will hash the data appropriately first. - Verify(data []byte, sig *Signature) error -} - -// CryptoPublicKey, if implemented by a PublicKey, -// returns the underlying crypto.PublicKey form of the key. -type CryptoPublicKey interface { - CryptoPublicKey() crypto.PublicKey -} - -// A Signer can create signatures that verify against a public key. -type Signer interface { - // PublicKey returns an associated PublicKey instance. - PublicKey() PublicKey - - // Sign returns raw signature for the given data. This method - // will apply the hash specified for the keytype to the data. - Sign(rand io.Reader, data []byte) (*Signature, error) -} - -type rsaPublicKey rsa.PublicKey - -func (r *rsaPublicKey) Type() string { - return "ssh-rsa" -} - -// parseRSA parses an RSA key according to RFC 4253, section 6.6. -func parseRSA(in []byte) (out PublicKey, rest []byte, err error) { - var w struct { - E *big.Int - N *big.Int - Rest []byte `ssh:"rest"` - } - if err := Unmarshal(in, &w); err != nil { - return nil, nil, err - } - - if w.E.BitLen() > 24 { - return nil, nil, errors.New("ssh: exponent too large") - } - e := w.E.Int64() - if e < 3 || e&1 == 0 { - return nil, nil, errors.New("ssh: incorrect exponent") - } - - var key rsa.PublicKey - key.E = int(e) - key.N = w.N - return (*rsaPublicKey)(&key), w.Rest, nil -} - -func (r *rsaPublicKey) Marshal() []byte { - e := new(big.Int).SetInt64(int64(r.E)) - // RSA publickey struct layout should match the struct used by - // parseRSACert in the x/crypto/ssh/agent package. - wirekey := struct { - Name string - E *big.Int - N *big.Int - }{ - KeyAlgoRSA, - e, - r.N, - } - return Marshal(&wirekey) -} - -func (r *rsaPublicKey) Verify(data []byte, sig *Signature) error { - if sig.Format != r.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, r.Type()) - } - h := crypto.SHA1.New() - h.Write(data) - digest := h.Sum(nil) - return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), crypto.SHA1, digest, sig.Blob) -} - -func (r *rsaPublicKey) CryptoPublicKey() crypto.PublicKey { - return (*rsa.PublicKey)(r) -} - -type dsaPublicKey dsa.PublicKey - -func (r *dsaPublicKey) Type() string { - return "ssh-dss" -} - -// parseDSA parses an DSA key according to RFC 4253, section 6.6. -func parseDSA(in []byte) (out PublicKey, rest []byte, err error) { - var w struct { - P, Q, G, Y *big.Int - Rest []byte `ssh:"rest"` - } - if err := Unmarshal(in, &w); err != nil { - return nil, nil, err - } - - key := &dsaPublicKey{ - Parameters: dsa.Parameters{ - P: w.P, - Q: w.Q, - G: w.G, - }, - Y: w.Y, - } - return key, w.Rest, nil -} - -func (k *dsaPublicKey) Marshal() []byte { - // DSA publickey struct layout should match the struct used by - // parseDSACert in the x/crypto/ssh/agent package. - w := struct { - Name string - P, Q, G, Y *big.Int - }{ - k.Type(), - k.P, - k.Q, - k.G, - k.Y, - } - - return Marshal(&w) -} - -func (k *dsaPublicKey) Verify(data []byte, sig *Signature) error { - if sig.Format != k.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) - } - h := crypto.SHA1.New() - h.Write(data) - digest := h.Sum(nil) - - // Per RFC 4253, section 6.6, - // The value for 'dss_signature_blob' is encoded as a string containing - // r, followed by s (which are 160-bit integers, without lengths or - // padding, unsigned, and in network byte order). - // For DSS purposes, sig.Blob should be exactly 40 bytes in length. - if len(sig.Blob) != 40 { - return errors.New("ssh: DSA signature parse error") - } - r := new(big.Int).SetBytes(sig.Blob[:20]) - s := new(big.Int).SetBytes(sig.Blob[20:]) - if dsa.Verify((*dsa.PublicKey)(k), digest, r, s) { - return nil - } - return errors.New("ssh: signature did not verify") -} - -func (k *dsaPublicKey) CryptoPublicKey() crypto.PublicKey { - return (*dsa.PublicKey)(k) -} - -type dsaPrivateKey struct { - *dsa.PrivateKey -} - -func (k *dsaPrivateKey) PublicKey() PublicKey { - return (*dsaPublicKey)(&k.PrivateKey.PublicKey) -} - -func (k *dsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) { - h := crypto.SHA1.New() - h.Write(data) - digest := h.Sum(nil) - r, s, err := dsa.Sign(rand, k.PrivateKey, digest) - if err != nil { - return nil, err - } - - sig := make([]byte, 40) - rb := r.Bytes() - sb := s.Bytes() - - copy(sig[20-len(rb):20], rb) - copy(sig[40-len(sb):], sb) - - return &Signature{ - Format: k.PublicKey().Type(), - Blob: sig, - }, nil -} - -type ecdsaPublicKey ecdsa.PublicKey - -func (key *ecdsaPublicKey) Type() string { - return "ecdsa-sha2-" + key.nistID() -} - -func (key *ecdsaPublicKey) nistID() string { - switch key.Params().BitSize { - case 256: - return "nistp256" - case 384: - return "nistp384" - case 521: - return "nistp521" - } - panic("ssh: unsupported ecdsa key size") -} - -type ed25519PublicKey ed25519.PublicKey - -func (key ed25519PublicKey) Type() string { - return KeyAlgoED25519 -} - -func parseED25519(in []byte) (out PublicKey, rest []byte, err error) { - var w struct { - KeyBytes []byte - Rest []byte `ssh:"rest"` - } - - if err := Unmarshal(in, &w); err != nil { - return nil, nil, err - } - - key := ed25519.PublicKey(w.KeyBytes) - - return (ed25519PublicKey)(key), w.Rest, nil -} - -func (key ed25519PublicKey) Marshal() []byte { - w := struct { - Name string - KeyBytes []byte - }{ - KeyAlgoED25519, - []byte(key), - } - return Marshal(&w) -} - -func (key ed25519PublicKey) Verify(b []byte, sig *Signature) error { - if sig.Format != key.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, key.Type()) - } - - edKey := (ed25519.PublicKey)(key) - if ok := ed25519.Verify(edKey, b, sig.Blob); !ok { - return errors.New("ssh: signature did not verify") - } - - return nil -} - -func (k ed25519PublicKey) CryptoPublicKey() crypto.PublicKey { - return ed25519.PublicKey(k) -} - -func supportedEllipticCurve(curve elliptic.Curve) bool { - return curve == elliptic.P256() || curve == elliptic.P384() || curve == elliptic.P521() -} - -// ecHash returns the hash to match the given elliptic curve, see RFC -// 5656, section 6.2.1 -func ecHash(curve elliptic.Curve) crypto.Hash { - bitSize := curve.Params().BitSize - switch { - case bitSize <= 256: - return crypto.SHA256 - case bitSize <= 384: - return crypto.SHA384 - } - return crypto.SHA512 -} - -// parseECDSA parses an ECDSA key according to RFC 5656, section 3.1. -func parseECDSA(in []byte) (out PublicKey, rest []byte, err error) { - var w struct { - Curve string - KeyBytes []byte - Rest []byte `ssh:"rest"` - } - - if err := Unmarshal(in, &w); err != nil { - return nil, nil, err - } - - key := new(ecdsa.PublicKey) - - switch w.Curve { - case "nistp256": - key.Curve = elliptic.P256() - case "nistp384": - key.Curve = elliptic.P384() - case "nistp521": - key.Curve = elliptic.P521() - default: - return nil, nil, errors.New("ssh: unsupported curve") - } - - key.X, key.Y = elliptic.Unmarshal(key.Curve, w.KeyBytes) - if key.X == nil || key.Y == nil { - return nil, nil, errors.New("ssh: invalid curve point") - } - return (*ecdsaPublicKey)(key), w.Rest, nil -} - -func (key *ecdsaPublicKey) Marshal() []byte { - // See RFC 5656, section 3.1. - keyBytes := elliptic.Marshal(key.Curve, key.X, key.Y) - // ECDSA publickey struct layout should match the struct used by - // parseECDSACert in the x/crypto/ssh/agent package. - w := struct { - Name string - ID string - Key []byte - }{ - key.Type(), - key.nistID(), - keyBytes, - } - - return Marshal(&w) -} - -func (key *ecdsaPublicKey) Verify(data []byte, sig *Signature) error { - if sig.Format != key.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, key.Type()) - } - - h := ecHash(key.Curve).New() - h.Write(data) - digest := h.Sum(nil) - - // Per RFC 5656, section 3.1.2, - // The ecdsa_signature_blob value has the following specific encoding: - // mpint r - // mpint s - var ecSig struct { - R *big.Int - S *big.Int - } - - if err := Unmarshal(sig.Blob, &ecSig); err != nil { - return err - } - - if ecdsa.Verify((*ecdsa.PublicKey)(key), digest, ecSig.R, ecSig.S) { - return nil - } - return errors.New("ssh: signature did not verify") -} - -func (k *ecdsaPublicKey) CryptoPublicKey() crypto.PublicKey { - return (*ecdsa.PublicKey)(k) -} - -// NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey, -// *ecdsa.PrivateKey or any other crypto.Signer and returns a corresponding -// Signer instance. ECDSA keys must use P-256, P-384 or P-521. -func NewSignerFromKey(key interface{}) (Signer, error) { - switch key := key.(type) { - case crypto.Signer: - return NewSignerFromSigner(key) - case *dsa.PrivateKey: - return &dsaPrivateKey{key}, nil - default: - return nil, fmt.Errorf("ssh: unsupported key type %T", key) - } -} - -type wrappedSigner struct { - signer crypto.Signer - pubKey PublicKey -} - -// NewSignerFromSigner takes any crypto.Signer implementation and -// returns a corresponding Signer interface. This can be used, for -// example, with keys kept in hardware modules. -func NewSignerFromSigner(signer crypto.Signer) (Signer, error) { - pubKey, err := NewPublicKey(signer.Public()) - if err != nil { - return nil, err - } - - return &wrappedSigner{signer, pubKey}, nil -} - -func (s *wrappedSigner) PublicKey() PublicKey { - return s.pubKey -} - -func (s *wrappedSigner) Sign(rand io.Reader, data []byte) (*Signature, error) { - var hashFunc crypto.Hash - - switch key := s.pubKey.(type) { - case *rsaPublicKey, *dsaPublicKey: - hashFunc = crypto.SHA1 - case *ecdsaPublicKey: - hashFunc = ecHash(key.Curve) - case ed25519PublicKey: - default: - return nil, fmt.Errorf("ssh: unsupported key type %T", key) - } - - var digest []byte - if hashFunc != 0 { - h := hashFunc.New() - h.Write(data) - digest = h.Sum(nil) - } else { - digest = data - } - - signature, err := s.signer.Sign(rand, digest, hashFunc) - if err != nil { - return nil, err - } - - // crypto.Signer.Sign is expected to return an ASN.1-encoded signature - // for ECDSA and DSA, but that's not the encoding expected by SSH, so - // re-encode. - switch s.pubKey.(type) { - case *ecdsaPublicKey, *dsaPublicKey: - type asn1Signature struct { - R, S *big.Int - } - asn1Sig := new(asn1Signature) - _, err := asn1.Unmarshal(signature, asn1Sig) - if err != nil { - return nil, err - } - - switch s.pubKey.(type) { - case *ecdsaPublicKey: - signature = Marshal(asn1Sig) - - case *dsaPublicKey: - signature = make([]byte, 40) - r := asn1Sig.R.Bytes() - s := asn1Sig.S.Bytes() - copy(signature[20-len(r):20], r) - copy(signature[40-len(s):40], s) - } - } - - return &Signature{ - Format: s.pubKey.Type(), - Blob: signature, - }, nil -} - -// NewPublicKey takes an *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey, -// or ed25519.PublicKey returns a corresponding PublicKey instance. -// ECDSA keys must use P-256, P-384 or P-521. -func NewPublicKey(key interface{}) (PublicKey, error) { - switch key := key.(type) { - case *rsa.PublicKey: - return (*rsaPublicKey)(key), nil - case *ecdsa.PublicKey: - if !supportedEllipticCurve(key.Curve) { - return nil, errors.New("ssh: only P-256, P-384 and P-521 EC keys are supported.") - } - return (*ecdsaPublicKey)(key), nil - case *dsa.PublicKey: - return (*dsaPublicKey)(key), nil - case ed25519.PublicKey: - return (ed25519PublicKey)(key), nil - default: - return nil, fmt.Errorf("ssh: unsupported key type %T", key) - } -} - -// ParsePrivateKey returns a Signer from a PEM encoded private key. It supports -// the same keys as ParseRawPrivateKey. -func ParsePrivateKey(pemBytes []byte) (Signer, error) { - key, err := ParseRawPrivateKey(pemBytes) - if err != nil { - return nil, err - } - - return NewSignerFromKey(key) -} - -// encryptedBlock tells whether a private key is -// encrypted by examining its Proc-Type header -// for a mention of ENCRYPTED -// according to RFC 1421 Section 4.6.1.1. -func encryptedBlock(block *pem.Block) bool { - return strings.Contains(block.Headers["Proc-Type"], "ENCRYPTED") -} - -// ParseRawPrivateKey returns a private key from a PEM encoded private key. It -// supports RSA (PKCS#1), DSA (OpenSSL), and ECDSA private keys. -func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { - block, _ := pem.Decode(pemBytes) - if block == nil { - return nil, errors.New("ssh: no key found") - } - - if encryptedBlock(block) { - return nil, errors.New("ssh: cannot decode encrypted private keys") - } - - switch block.Type { - case "RSA PRIVATE KEY": - return x509.ParsePKCS1PrivateKey(block.Bytes) - case "EC PRIVATE KEY": - return x509.ParseECPrivateKey(block.Bytes) - case "DSA PRIVATE KEY": - return ParseDSAPrivateKey(block.Bytes) - case "OPENSSH PRIVATE KEY": - return parseOpenSSHPrivateKey(block.Bytes) - default: - return nil, fmt.Errorf("ssh: unsupported key type %q", block.Type) - } -} - -// ParseDSAPrivateKey returns a DSA private key from its ASN.1 DER encoding, as -// specified by the OpenSSL DSA man page. -func ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) { - var k struct { - Version int - P *big.Int - Q *big.Int - G *big.Int - Pub *big.Int - Priv *big.Int - } - rest, err := asn1.Unmarshal(der, &k) - if err != nil { - return nil, errors.New("ssh: failed to parse DSA key: " + err.Error()) - } - if len(rest) > 0 { - return nil, errors.New("ssh: garbage after DSA key") - } - - return &dsa.PrivateKey{ - PublicKey: dsa.PublicKey{ - Parameters: dsa.Parameters{ - P: k.P, - Q: k.Q, - G: k.G, - }, - Y: k.Pub, - }, - X: k.Priv, - }, nil -} - -// Implemented based on the documentation at -// https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key -func parseOpenSSHPrivateKey(key []byte) (*ed25519.PrivateKey, error) { - magic := append([]byte("openssh-key-v1"), 0) - if !bytes.Equal(magic, key[0:len(magic)]) { - return nil, errors.New("ssh: invalid openssh private key format") - } - remaining := key[len(magic):] - - var w struct { - CipherName string - KdfName string - KdfOpts string - NumKeys uint32 - PubKey []byte - PrivKeyBlock []byte - } - - if err := Unmarshal(remaining, &w); err != nil { - return nil, err - } - - pk1 := struct { - Check1 uint32 - Check2 uint32 - Keytype string - Pub []byte - Priv []byte - Comment string - Pad []byte `ssh:"rest"` - }{} - - if err := Unmarshal(w.PrivKeyBlock, &pk1); err != nil { - return nil, err - } - - if pk1.Check1 != pk1.Check2 { - return nil, errors.New("ssh: checkint mismatch") - } - - // we only handle ed25519 keys currently - if pk1.Keytype != KeyAlgoED25519 { - return nil, errors.New("ssh: unhandled key type") - } - - for i, b := range pk1.Pad { - if int(b) != i+1 { - return nil, errors.New("ssh: padding not as expected") - } - } - - if len(pk1.Priv) != ed25519.PrivateKeySize { - return nil, errors.New("ssh: private key unexpected length") - } - - pk := ed25519.PrivateKey(make([]byte, ed25519.PrivateKeySize)) - copy(pk, pk1.Priv) - return &pk, nil -} - -// FingerprintLegacyMD5 returns the user presentation of the key's -// fingerprint as described by RFC 4716 section 4. -func FingerprintLegacyMD5(pubKey PublicKey) string { - md5sum := md5.Sum(pubKey.Marshal()) - hexarray := make([]string, len(md5sum)) - for i, c := range md5sum { - hexarray[i] = hex.EncodeToString([]byte{c}) - } - return strings.Join(hexarray, ":") -} - -// FingerprintSHA256 returns the user presentation of the key's -// fingerprint as unpadded base64 encoded sha256 hash. -// This format was introduced from OpenSSH 6.8. -// https://www.openssh.com/txt/release-6.8 -// https://tools.ietf.org/html/rfc4648#section-3.2 (unpadded base64 encoding) -func FingerprintSHA256(pubKey PublicKey) string { - sha256sum := sha256.Sum256(pubKey.Marshal()) - hash := base64.RawStdEncoding.EncodeToString(sha256sum[:]) - return "SHA256:" + hash -} diff --git a/vendor/golang.org/x/crypto/ssh/mac.go b/vendor/golang.org/x/crypto/ssh/mac.go deleted file mode 100644 index 07744ad..0000000 --- a/vendor/golang.org/x/crypto/ssh/mac.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -// Message authentication support - -import ( - "crypto/hmac" - "crypto/sha1" - "crypto/sha256" - "hash" -) - -type macMode struct { - keySize int - new func(key []byte) hash.Hash -} - -// truncatingMAC wraps around a hash.Hash and truncates the output digest to -// a given size. -type truncatingMAC struct { - length int - hmac hash.Hash -} - -func (t truncatingMAC) Write(data []byte) (int, error) { - return t.hmac.Write(data) -} - -func (t truncatingMAC) Sum(in []byte) []byte { - out := t.hmac.Sum(in) - return out[:len(in)+t.length] -} - -func (t truncatingMAC) Reset() { - t.hmac.Reset() -} - -func (t truncatingMAC) Size() int { - return t.length -} - -func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } - -var macModes = map[string]*macMode{ - "hmac-sha2-256": {32, func(key []byte) hash.Hash { - return hmac.New(sha256.New, key) - }}, - "hmac-sha1": {20, func(key []byte) hash.Hash { - return hmac.New(sha1.New, key) - }}, - "hmac-sha1-96": {20, func(key []byte) hash.Hash { - return truncatingMAC{12, hmac.New(sha1.New, key)} - }}, -} diff --git a/vendor/golang.org/x/crypto/ssh/messages.go b/vendor/golang.org/x/crypto/ssh/messages.go deleted file mode 100644 index e6ecd3a..0000000 --- a/vendor/golang.org/x/crypto/ssh/messages.go +++ /dev/null @@ -1,758 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "io" - "math/big" - "reflect" - "strconv" - "strings" -) - -// These are SSH message type numbers. They are scattered around several -// documents but many were taken from [SSH-PARAMETERS]. -const ( - msgIgnore = 2 - msgUnimplemented = 3 - msgDebug = 4 - msgNewKeys = 21 - - // Standard authentication messages - msgUserAuthSuccess = 52 - msgUserAuthBanner = 53 -) - -// SSH messages: -// -// These structures mirror the wire format of the corresponding SSH messages. -// They are marshaled using reflection with the marshal and unmarshal functions -// in this file. The only wrinkle is that a final member of type []byte with a -// ssh tag of "rest" receives the remainder of a packet when unmarshaling. - -// See RFC 4253, section 11.1. -const msgDisconnect = 1 - -// disconnectMsg is the message that signals a disconnect. It is also -// the error type returned from mux.Wait() -type disconnectMsg struct { - Reason uint32 `sshtype:"1"` - Message string - Language string -} - -func (d *disconnectMsg) Error() string { - return fmt.Sprintf("ssh: disconnect, reason %d: %s", d.Reason, d.Message) -} - -// See RFC 4253, section 7.1. -const msgKexInit = 20 - -type kexInitMsg struct { - Cookie [16]byte `sshtype:"20"` - KexAlgos []string - ServerHostKeyAlgos []string - CiphersClientServer []string - CiphersServerClient []string - MACsClientServer []string - MACsServerClient []string - CompressionClientServer []string - CompressionServerClient []string - LanguagesClientServer []string - LanguagesServerClient []string - FirstKexFollows bool - Reserved uint32 -} - -// See RFC 4253, section 8. - -// Diffie-Helman -const msgKexDHInit = 30 - -type kexDHInitMsg struct { - X *big.Int `sshtype:"30"` -} - -const msgKexECDHInit = 30 - -type kexECDHInitMsg struct { - ClientPubKey []byte `sshtype:"30"` -} - -const msgKexECDHReply = 31 - -type kexECDHReplyMsg struct { - HostKey []byte `sshtype:"31"` - EphemeralPubKey []byte - Signature []byte -} - -const msgKexDHReply = 31 - -type kexDHReplyMsg struct { - HostKey []byte `sshtype:"31"` - Y *big.Int - Signature []byte -} - -// See RFC 4253, section 10. -const msgServiceRequest = 5 - -type serviceRequestMsg struct { - Service string `sshtype:"5"` -} - -// See RFC 4253, section 10. -const msgServiceAccept = 6 - -type serviceAcceptMsg struct { - Service string `sshtype:"6"` -} - -// See RFC 4252, section 5. -const msgUserAuthRequest = 50 - -type userAuthRequestMsg struct { - User string `sshtype:"50"` - Service string - Method string - Payload []byte `ssh:"rest"` -} - -// Used for debug printouts of packets. -type userAuthSuccessMsg struct { -} - -// See RFC 4252, section 5.1 -const msgUserAuthFailure = 51 - -type userAuthFailureMsg struct { - Methods []string `sshtype:"51"` - PartialSuccess bool -} - -// See RFC 4256, section 3.2 -const msgUserAuthInfoRequest = 60 -const msgUserAuthInfoResponse = 61 - -type userAuthInfoRequestMsg struct { - User string `sshtype:"60"` - Instruction string - DeprecatedLanguage string - NumPrompts uint32 - Prompts []byte `ssh:"rest"` -} - -// See RFC 4254, section 5.1. -const msgChannelOpen = 90 - -type channelOpenMsg struct { - ChanType string `sshtype:"90"` - PeersId uint32 - PeersWindow uint32 - MaxPacketSize uint32 - TypeSpecificData []byte `ssh:"rest"` -} - -const msgChannelExtendedData = 95 -const msgChannelData = 94 - -// Used for debug print outs of packets. -type channelDataMsg struct { - PeersId uint32 `sshtype:"94"` - Length uint32 - Rest []byte `ssh:"rest"` -} - -// See RFC 4254, section 5.1. -const msgChannelOpenConfirm = 91 - -type channelOpenConfirmMsg struct { - PeersId uint32 `sshtype:"91"` - MyId uint32 - MyWindow uint32 - MaxPacketSize uint32 - TypeSpecificData []byte `ssh:"rest"` -} - -// See RFC 4254, section 5.1. -const msgChannelOpenFailure = 92 - -type channelOpenFailureMsg struct { - PeersId uint32 `sshtype:"92"` - Reason RejectionReason - Message string - Language string -} - -const msgChannelRequest = 98 - -type channelRequestMsg struct { - PeersId uint32 `sshtype:"98"` - Request string - WantReply bool - RequestSpecificData []byte `ssh:"rest"` -} - -// See RFC 4254, section 5.4. -const msgChannelSuccess = 99 - -type channelRequestSuccessMsg struct { - PeersId uint32 `sshtype:"99"` -} - -// See RFC 4254, section 5.4. -const msgChannelFailure = 100 - -type channelRequestFailureMsg struct { - PeersId uint32 `sshtype:"100"` -} - -// See RFC 4254, section 5.3 -const msgChannelClose = 97 - -type channelCloseMsg struct { - PeersId uint32 `sshtype:"97"` -} - -// See RFC 4254, section 5.3 -const msgChannelEOF = 96 - -type channelEOFMsg struct { - PeersId uint32 `sshtype:"96"` -} - -// See RFC 4254, section 4 -const msgGlobalRequest = 80 - -type globalRequestMsg struct { - Type string `sshtype:"80"` - WantReply bool - Data []byte `ssh:"rest"` -} - -// See RFC 4254, section 4 -const msgRequestSuccess = 81 - -type globalRequestSuccessMsg struct { - Data []byte `ssh:"rest" sshtype:"81"` -} - -// See RFC 4254, section 4 -const msgRequestFailure = 82 - -type globalRequestFailureMsg struct { - Data []byte `ssh:"rest" sshtype:"82"` -} - -// See RFC 4254, section 5.2 -const msgChannelWindowAdjust = 93 - -type windowAdjustMsg struct { - PeersId uint32 `sshtype:"93"` - AdditionalBytes uint32 -} - -// See RFC 4252, section 7 -const msgUserAuthPubKeyOk = 60 - -type userAuthPubKeyOkMsg struct { - Algo string `sshtype:"60"` - PubKey []byte -} - -// typeTags returns the possible type bytes for the given reflect.Type, which -// should be a struct. The possible values are separated by a '|' character. -func typeTags(structType reflect.Type) (tags []byte) { - tagStr := structType.Field(0).Tag.Get("sshtype") - - for _, tag := range strings.Split(tagStr, "|") { - i, err := strconv.Atoi(tag) - if err == nil { - tags = append(tags, byte(i)) - } - } - - return tags -} - -func fieldError(t reflect.Type, field int, problem string) error { - if problem != "" { - problem = ": " + problem - } - return fmt.Errorf("ssh: unmarshal error for field %s of type %s%s", t.Field(field).Name, t.Name(), problem) -} - -var errShortRead = errors.New("ssh: short read") - -// Unmarshal parses data in SSH wire format into a structure. The out -// argument should be a pointer to struct. If the first member of the -// struct has the "sshtype" tag set to a '|'-separated set of numbers -// in decimal, the packet must start with one of those numbers. In -// case of error, Unmarshal returns a ParseError or -// UnexpectedMessageError. -func Unmarshal(data []byte, out interface{}) error { - v := reflect.ValueOf(out).Elem() - structType := v.Type() - expectedTypes := typeTags(structType) - - var expectedType byte - if len(expectedTypes) > 0 { - expectedType = expectedTypes[0] - } - - if len(data) == 0 { - return parseError(expectedType) - } - - if len(expectedTypes) > 0 { - goodType := false - for _, e := range expectedTypes { - if e > 0 && data[0] == e { - goodType = true - break - } - } - if !goodType { - return fmt.Errorf("ssh: unexpected message type %d (expected one of %v)", data[0], expectedTypes) - } - data = data[1:] - } - - var ok bool - for i := 0; i < v.NumField(); i++ { - field := v.Field(i) - t := field.Type() - switch t.Kind() { - case reflect.Bool: - if len(data) < 1 { - return errShortRead - } - field.SetBool(data[0] != 0) - data = data[1:] - case reflect.Array: - if t.Elem().Kind() != reflect.Uint8 { - return fieldError(structType, i, "array of unsupported type") - } - if len(data) < t.Len() { - return errShortRead - } - for j, n := 0, t.Len(); j < n; j++ { - field.Index(j).Set(reflect.ValueOf(data[j])) - } - data = data[t.Len():] - case reflect.Uint64: - var u64 uint64 - if u64, data, ok = parseUint64(data); !ok { - return errShortRead - } - field.SetUint(u64) - case reflect.Uint32: - var u32 uint32 - if u32, data, ok = parseUint32(data); !ok { - return errShortRead - } - field.SetUint(uint64(u32)) - case reflect.Uint8: - if len(data) < 1 { - return errShortRead - } - field.SetUint(uint64(data[0])) - data = data[1:] - case reflect.String: - var s []byte - if s, data, ok = parseString(data); !ok { - return fieldError(structType, i, "") - } - field.SetString(string(s)) - case reflect.Slice: - switch t.Elem().Kind() { - case reflect.Uint8: - if structType.Field(i).Tag.Get("ssh") == "rest" { - field.Set(reflect.ValueOf(data)) - data = nil - } else { - var s []byte - if s, data, ok = parseString(data); !ok { - return errShortRead - } - field.Set(reflect.ValueOf(s)) - } - case reflect.String: - var nl []string - if nl, data, ok = parseNameList(data); !ok { - return errShortRead - } - field.Set(reflect.ValueOf(nl)) - default: - return fieldError(structType, i, "slice of unsupported type") - } - case reflect.Ptr: - if t == bigIntType { - var n *big.Int - if n, data, ok = parseInt(data); !ok { - return errShortRead - } - field.Set(reflect.ValueOf(n)) - } else { - return fieldError(structType, i, "pointer to unsupported type") - } - default: - return fieldError(structType, i, fmt.Sprintf("unsupported type: %v", t)) - } - } - - if len(data) != 0 { - return parseError(expectedType) - } - - return nil -} - -// Marshal serializes the message in msg to SSH wire format. The msg -// argument should be a struct or pointer to struct. If the first -// member has the "sshtype" tag set to a number in decimal, that -// number is prepended to the result. If the last of member has the -// "ssh" tag set to "rest", its contents are appended to the output. -func Marshal(msg interface{}) []byte { - out := make([]byte, 0, 64) - return marshalStruct(out, msg) -} - -func marshalStruct(out []byte, msg interface{}) []byte { - v := reflect.Indirect(reflect.ValueOf(msg)) - msgTypes := typeTags(v.Type()) - if len(msgTypes) > 0 { - out = append(out, msgTypes[0]) - } - - for i, n := 0, v.NumField(); i < n; i++ { - field := v.Field(i) - switch t := field.Type(); t.Kind() { - case reflect.Bool: - var v uint8 - if field.Bool() { - v = 1 - } - out = append(out, v) - case reflect.Array: - if t.Elem().Kind() != reflect.Uint8 { - panic(fmt.Sprintf("array of non-uint8 in field %d: %T", i, field.Interface())) - } - for j, l := 0, t.Len(); j < l; j++ { - out = append(out, uint8(field.Index(j).Uint())) - } - case reflect.Uint32: - out = appendU32(out, uint32(field.Uint())) - case reflect.Uint64: - out = appendU64(out, uint64(field.Uint())) - case reflect.Uint8: - out = append(out, uint8(field.Uint())) - case reflect.String: - s := field.String() - out = appendInt(out, len(s)) - out = append(out, s...) - case reflect.Slice: - switch t.Elem().Kind() { - case reflect.Uint8: - if v.Type().Field(i).Tag.Get("ssh") != "rest" { - out = appendInt(out, field.Len()) - } - out = append(out, field.Bytes()...) - case reflect.String: - offset := len(out) - out = appendU32(out, 0) - if n := field.Len(); n > 0 { - for j := 0; j < n; j++ { - f := field.Index(j) - if j != 0 { - out = append(out, ',') - } - out = append(out, f.String()...) - } - // overwrite length value - binary.BigEndian.PutUint32(out[offset:], uint32(len(out)-offset-4)) - } - default: - panic(fmt.Sprintf("slice of unknown type in field %d: %T", i, field.Interface())) - } - case reflect.Ptr: - if t == bigIntType { - var n *big.Int - nValue := reflect.ValueOf(&n) - nValue.Elem().Set(field) - needed := intLength(n) - oldLength := len(out) - - if cap(out)-len(out) < needed { - newOut := make([]byte, len(out), 2*(len(out)+needed)) - copy(newOut, out) - out = newOut - } - out = out[:oldLength+needed] - marshalInt(out[oldLength:], n) - } else { - panic(fmt.Sprintf("pointer to unknown type in field %d: %T", i, field.Interface())) - } - } - } - - return out -} - -var bigOne = big.NewInt(1) - -func parseString(in []byte) (out, rest []byte, ok bool) { - if len(in) < 4 { - return - } - length := binary.BigEndian.Uint32(in) - in = in[4:] - if uint32(len(in)) < length { - return - } - out = in[:length] - rest = in[length:] - ok = true - return -} - -var ( - comma = []byte{','} - emptyNameList = []string{} -) - -func parseNameList(in []byte) (out []string, rest []byte, ok bool) { - contents, rest, ok := parseString(in) - if !ok { - return - } - if len(contents) == 0 { - out = emptyNameList - return - } - parts := bytes.Split(contents, comma) - out = make([]string, len(parts)) - for i, part := range parts { - out[i] = string(part) - } - return -} - -func parseInt(in []byte) (out *big.Int, rest []byte, ok bool) { - contents, rest, ok := parseString(in) - if !ok { - return - } - out = new(big.Int) - - if len(contents) > 0 && contents[0]&0x80 == 0x80 { - // This is a negative number - notBytes := make([]byte, len(contents)) - for i := range notBytes { - notBytes[i] = ^contents[i] - } - out.SetBytes(notBytes) - out.Add(out, bigOne) - out.Neg(out) - } else { - // Positive number - out.SetBytes(contents) - } - ok = true - return -} - -func parseUint32(in []byte) (uint32, []byte, bool) { - if len(in) < 4 { - return 0, nil, false - } - return binary.BigEndian.Uint32(in), in[4:], true -} - -func parseUint64(in []byte) (uint64, []byte, bool) { - if len(in) < 8 { - return 0, nil, false - } - return binary.BigEndian.Uint64(in), in[8:], true -} - -func intLength(n *big.Int) int { - length := 4 /* length bytes */ - if n.Sign() < 0 { - nMinus1 := new(big.Int).Neg(n) - nMinus1.Sub(nMinus1, bigOne) - bitLen := nMinus1.BitLen() - if bitLen%8 == 0 { - // The number will need 0xff padding - length++ - } - length += (bitLen + 7) / 8 - } else if n.Sign() == 0 { - // A zero is the zero length string - } else { - bitLen := n.BitLen() - if bitLen%8 == 0 { - // The number will need 0x00 padding - length++ - } - length += (bitLen + 7) / 8 - } - - return length -} - -func marshalUint32(to []byte, n uint32) []byte { - binary.BigEndian.PutUint32(to, n) - return to[4:] -} - -func marshalUint64(to []byte, n uint64) []byte { - binary.BigEndian.PutUint64(to, n) - return to[8:] -} - -func marshalInt(to []byte, n *big.Int) []byte { - lengthBytes := to - to = to[4:] - length := 0 - - if n.Sign() < 0 { - // A negative number has to be converted to two's-complement - // form. So we'll subtract 1 and invert. If the - // most-significant-bit isn't set then we'll need to pad the - // beginning with 0xff in order to keep the number negative. - nMinus1 := new(big.Int).Neg(n) - nMinus1.Sub(nMinus1, bigOne) - bytes := nMinus1.Bytes() - for i := range bytes { - bytes[i] ^= 0xff - } - if len(bytes) == 0 || bytes[0]&0x80 == 0 { - to[0] = 0xff - to = to[1:] - length++ - } - nBytes := copy(to, bytes) - to = to[nBytes:] - length += nBytes - } else if n.Sign() == 0 { - // A zero is the zero length string - } else { - bytes := n.Bytes() - if len(bytes) > 0 && bytes[0]&0x80 != 0 { - // We'll have to pad this with a 0x00 in order to - // stop it looking like a negative number. - to[0] = 0 - to = to[1:] - length++ - } - nBytes := copy(to, bytes) - to = to[nBytes:] - length += nBytes - } - - lengthBytes[0] = byte(length >> 24) - lengthBytes[1] = byte(length >> 16) - lengthBytes[2] = byte(length >> 8) - lengthBytes[3] = byte(length) - return to -} - -func writeInt(w io.Writer, n *big.Int) { - length := intLength(n) - buf := make([]byte, length) - marshalInt(buf, n) - w.Write(buf) -} - -func writeString(w io.Writer, s []byte) { - var lengthBytes [4]byte - lengthBytes[0] = byte(len(s) >> 24) - lengthBytes[1] = byte(len(s) >> 16) - lengthBytes[2] = byte(len(s) >> 8) - lengthBytes[3] = byte(len(s)) - w.Write(lengthBytes[:]) - w.Write(s) -} - -func stringLength(n int) int { - return 4 + n -} - -func marshalString(to []byte, s []byte) []byte { - to[0] = byte(len(s) >> 24) - to[1] = byte(len(s) >> 16) - to[2] = byte(len(s) >> 8) - to[3] = byte(len(s)) - to = to[4:] - copy(to, s) - return to[len(s):] -} - -var bigIntType = reflect.TypeOf((*big.Int)(nil)) - -// Decode a packet into its corresponding message. -func decode(packet []byte) (interface{}, error) { - var msg interface{} - switch packet[0] { - case msgDisconnect: - msg = new(disconnectMsg) - case msgServiceRequest: - msg = new(serviceRequestMsg) - case msgServiceAccept: - msg = new(serviceAcceptMsg) - case msgKexInit: - msg = new(kexInitMsg) - case msgKexDHInit: - msg = new(kexDHInitMsg) - case msgKexDHReply: - msg = new(kexDHReplyMsg) - case msgUserAuthRequest: - msg = new(userAuthRequestMsg) - case msgUserAuthSuccess: - return new(userAuthSuccessMsg), nil - case msgUserAuthFailure: - msg = new(userAuthFailureMsg) - case msgUserAuthPubKeyOk: - msg = new(userAuthPubKeyOkMsg) - case msgGlobalRequest: - msg = new(globalRequestMsg) - case msgRequestSuccess: - msg = new(globalRequestSuccessMsg) - case msgRequestFailure: - msg = new(globalRequestFailureMsg) - case msgChannelOpen: - msg = new(channelOpenMsg) - case msgChannelData: - msg = new(channelDataMsg) - case msgChannelOpenConfirm: - msg = new(channelOpenConfirmMsg) - case msgChannelOpenFailure: - msg = new(channelOpenFailureMsg) - case msgChannelWindowAdjust: - msg = new(windowAdjustMsg) - case msgChannelEOF: - msg = new(channelEOFMsg) - case msgChannelClose: - msg = new(channelCloseMsg) - case msgChannelRequest: - msg = new(channelRequestMsg) - case msgChannelSuccess: - msg = new(channelRequestSuccessMsg) - case msgChannelFailure: - msg = new(channelRequestFailureMsg) - default: - return nil, unexpectedMessageError(0, packet[0]) - } - if err := Unmarshal(packet, msg); err != nil { - return nil, err - } - return msg, nil -} diff --git a/vendor/golang.org/x/crypto/ssh/mux.go b/vendor/golang.org/x/crypto/ssh/mux.go deleted file mode 100644 index f3a3ddd..0000000 --- a/vendor/golang.org/x/crypto/ssh/mux.go +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "encoding/binary" - "fmt" - "io" - "log" - "sync" - "sync/atomic" -) - -// debugMux, if set, causes messages in the connection protocol to be -// logged. -const debugMux = false - -// chanList is a thread safe channel list. -type chanList struct { - // protects concurrent access to chans - sync.Mutex - - // chans are indexed by the local id of the channel, which the - // other side should send in the PeersId field. - chans []*channel - - // This is a debugging aid: it offsets all IDs by this - // amount. This helps distinguish otherwise identical - // server/client muxes - offset uint32 -} - -// Assigns a channel ID to the given channel. -func (c *chanList) add(ch *channel) uint32 { - c.Lock() - defer c.Unlock() - for i := range c.chans { - if c.chans[i] == nil { - c.chans[i] = ch - return uint32(i) + c.offset - } - } - c.chans = append(c.chans, ch) - return uint32(len(c.chans)-1) + c.offset -} - -// getChan returns the channel for the given ID. -func (c *chanList) getChan(id uint32) *channel { - id -= c.offset - - c.Lock() - defer c.Unlock() - if id < uint32(len(c.chans)) { - return c.chans[id] - } - return nil -} - -func (c *chanList) remove(id uint32) { - id -= c.offset - c.Lock() - if id < uint32(len(c.chans)) { - c.chans[id] = nil - } - c.Unlock() -} - -// dropAll forgets all channels it knows, returning them in a slice. -func (c *chanList) dropAll() []*channel { - c.Lock() - defer c.Unlock() - var r []*channel - - for _, ch := range c.chans { - if ch == nil { - continue - } - r = append(r, ch) - } - c.chans = nil - return r -} - -// mux represents the state for the SSH connection protocol, which -// multiplexes many channels onto a single packet transport. -type mux struct { - conn packetConn - chanList chanList - - incomingChannels chan NewChannel - - globalSentMu sync.Mutex - globalResponses chan interface{} - incomingRequests chan *Request - - errCond *sync.Cond - err error -} - -// When debugging, each new chanList instantiation has a different -// offset. -var globalOff uint32 - -func (m *mux) Wait() error { - m.errCond.L.Lock() - defer m.errCond.L.Unlock() - for m.err == nil { - m.errCond.Wait() - } - return m.err -} - -// newMux returns a mux that runs over the given connection. -func newMux(p packetConn) *mux { - m := &mux{ - conn: p, - incomingChannels: make(chan NewChannel, 16), - globalResponses: make(chan interface{}, 1), - incomingRequests: make(chan *Request, 16), - errCond: newCond(), - } - if debugMux { - m.chanList.offset = atomic.AddUint32(&globalOff, 1) - } - - go m.loop() - return m -} - -func (m *mux) sendMessage(msg interface{}) error { - p := Marshal(msg) - if debugMux { - log.Printf("send global(%d): %#v", m.chanList.offset, msg) - } - return m.conn.writePacket(p) -} - -func (m *mux) SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error) { - if wantReply { - m.globalSentMu.Lock() - defer m.globalSentMu.Unlock() - } - - if err := m.sendMessage(globalRequestMsg{ - Type: name, - WantReply: wantReply, - Data: payload, - }); err != nil { - return false, nil, err - } - - if !wantReply { - return false, nil, nil - } - - msg, ok := <-m.globalResponses - if !ok { - return false, nil, io.EOF - } - switch msg := msg.(type) { - case *globalRequestFailureMsg: - return false, msg.Data, nil - case *globalRequestSuccessMsg: - return true, msg.Data, nil - default: - return false, nil, fmt.Errorf("ssh: unexpected response to request: %#v", msg) - } -} - -// ackRequest must be called after processing a global request that -// has WantReply set. -func (m *mux) ackRequest(ok bool, data []byte) error { - if ok { - return m.sendMessage(globalRequestSuccessMsg{Data: data}) - } - return m.sendMessage(globalRequestFailureMsg{Data: data}) -} - -func (m *mux) Close() error { - return m.conn.Close() -} - -// loop runs the connection machine. It will process packets until an -// error is encountered. To synchronize on loop exit, use mux.Wait. -func (m *mux) loop() { - var err error - for err == nil { - err = m.onePacket() - } - - for _, ch := range m.chanList.dropAll() { - ch.close() - } - - close(m.incomingChannels) - close(m.incomingRequests) - close(m.globalResponses) - - m.conn.Close() - - m.errCond.L.Lock() - m.err = err - m.errCond.Broadcast() - m.errCond.L.Unlock() - - if debugMux { - log.Println("loop exit", err) - } -} - -// onePacket reads and processes one packet. -func (m *mux) onePacket() error { - packet, err := m.conn.readPacket() - if err != nil { - return err - } - - if debugMux { - if packet[0] == msgChannelData || packet[0] == msgChannelExtendedData { - log.Printf("decoding(%d): data packet - %d bytes", m.chanList.offset, len(packet)) - } else { - p, _ := decode(packet) - log.Printf("decoding(%d): %d %#v - %d bytes", m.chanList.offset, packet[0], p, len(packet)) - } - } - - switch packet[0] { - case msgChannelOpen: - return m.handleChannelOpen(packet) - case msgGlobalRequest, msgRequestSuccess, msgRequestFailure: - return m.handleGlobalPacket(packet) - } - - // assume a channel packet. - if len(packet) < 5 { - return parseError(packet[0]) - } - id := binary.BigEndian.Uint32(packet[1:]) - ch := m.chanList.getChan(id) - if ch == nil { - return fmt.Errorf("ssh: invalid channel %d", id) - } - - return ch.handlePacket(packet) -} - -func (m *mux) handleGlobalPacket(packet []byte) error { - msg, err := decode(packet) - if err != nil { - return err - } - - switch msg := msg.(type) { - case *globalRequestMsg: - m.incomingRequests <- &Request{ - Type: msg.Type, - WantReply: msg.WantReply, - Payload: msg.Data, - mux: m, - } - case *globalRequestSuccessMsg, *globalRequestFailureMsg: - m.globalResponses <- msg - default: - panic(fmt.Sprintf("not a global message %#v", msg)) - } - - return nil -} - -// handleChannelOpen schedules a channel to be Accept()ed. -func (m *mux) handleChannelOpen(packet []byte) error { - var msg channelOpenMsg - if err := Unmarshal(packet, &msg); err != nil { - return err - } - - if msg.MaxPacketSize < minPacketLength || msg.MaxPacketSize > 1<<31 { - failMsg := channelOpenFailureMsg{ - PeersId: msg.PeersId, - Reason: ConnectionFailed, - Message: "invalid request", - Language: "en_US.UTF-8", - } - return m.sendMessage(failMsg) - } - - c := m.newChannel(msg.ChanType, channelInbound, msg.TypeSpecificData) - c.remoteId = msg.PeersId - c.maxRemotePayload = msg.MaxPacketSize - c.remoteWin.add(msg.PeersWindow) - m.incomingChannels <- c - return nil -} - -func (m *mux) OpenChannel(chanType string, extra []byte) (Channel, <-chan *Request, error) { - ch, err := m.openChannel(chanType, extra) - if err != nil { - return nil, nil, err - } - - return ch, ch.incomingRequests, nil -} - -func (m *mux) openChannel(chanType string, extra []byte) (*channel, error) { - ch := m.newChannel(chanType, channelOutbound, extra) - - ch.maxIncomingPayload = channelMaxPacket - - open := channelOpenMsg{ - ChanType: chanType, - PeersWindow: ch.myWindow, - MaxPacketSize: ch.maxIncomingPayload, - TypeSpecificData: extra, - PeersId: ch.localId, - } - if err := m.sendMessage(open); err != nil { - return nil, err - } - - switch msg := (<-ch.msg).(type) { - case *channelOpenConfirmMsg: - return ch, nil - case *channelOpenFailureMsg: - return nil, &OpenChannelError{msg.Reason, msg.Message} - default: - return nil, fmt.Errorf("ssh: unexpected packet in response to channel open: %T", msg) - } -} diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go deleted file mode 100644 index 28b109a..0000000 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "bytes" - "errors" - "fmt" - "io" - "net" -) - -// The Permissions type holds fine-grained permissions that are -// specific to a user or a specific authentication method for a -// user. Permissions, except for "source-address", must be enforced in -// the server application layer, after successful authentication. The -// Permissions are passed on in ServerConn so a server implementation -// can honor them. -type Permissions struct { - // Critical options restrict default permissions. Common - // restrictions are "source-address" and "force-command". If - // the server cannot enforce the restriction, or does not - // recognize it, the user should not authenticate. - CriticalOptions map[string]string - - // Extensions are extra functionality that the server may - // offer on authenticated connections. Common extensions are - // "permit-agent-forwarding", "permit-X11-forwarding". Lack of - // support for an extension does not preclude authenticating a - // user. - Extensions map[string]string -} - -// ServerConfig holds server specific configuration data. -type ServerConfig struct { - // Config contains configuration shared between client and server. - Config - - hostKeys []Signer - - // NoClientAuth is true if clients are allowed to connect without - // authenticating. - NoClientAuth bool - - // PasswordCallback, if non-nil, is called when a user - // attempts to authenticate using a password. - PasswordCallback func(conn ConnMetadata, password []byte) (*Permissions, error) - - // PublicKeyCallback, if non-nil, is called when a client attempts public - // key authentication. It must return true if the given public key is - // valid for the given user. For example, see CertChecker.Authenticate. - PublicKeyCallback func(conn ConnMetadata, key PublicKey) (*Permissions, error) - - // KeyboardInteractiveCallback, if non-nil, is called when - // keyboard-interactive authentication is selected (RFC - // 4256). The client object's Challenge function should be - // used to query the user. The callback may offer multiple - // Challenge rounds. To avoid information leaks, the client - // should be presented a challenge even if the user is - // unknown. - KeyboardInteractiveCallback func(conn ConnMetadata, client KeyboardInteractiveChallenge) (*Permissions, error) - - // AuthLogCallback, if non-nil, is called to log all authentication - // attempts. - AuthLogCallback func(conn ConnMetadata, method string, err error) - - // ServerVersion is the version identification string to announce in - // the public handshake. - // If empty, a reasonable default is used. - // Note that RFC 4253 section 4.2 requires that this string start with - // "SSH-2.0-". - ServerVersion string -} - -// AddHostKey adds a private key as a host key. If an existing host -// key exists with the same algorithm, it is overwritten. Each server -// config must have at least one host key. -func (s *ServerConfig) AddHostKey(key Signer) { - for i, k := range s.hostKeys { - if k.PublicKey().Type() == key.PublicKey().Type() { - s.hostKeys[i] = key - return - } - } - - s.hostKeys = append(s.hostKeys, key) -} - -// cachedPubKey contains the results of querying whether a public key is -// acceptable for a user. -type cachedPubKey struct { - user string - pubKeyData []byte - result error - perms *Permissions -} - -const maxCachedPubKeys = 16 - -// pubKeyCache caches tests for public keys. Since SSH clients -// will query whether a public key is acceptable before attempting to -// authenticate with it, we end up with duplicate queries for public -// key validity. The cache only applies to a single ServerConn. -type pubKeyCache struct { - keys []cachedPubKey -} - -// get returns the result for a given user/algo/key tuple. -func (c *pubKeyCache) get(user string, pubKeyData []byte) (cachedPubKey, bool) { - for _, k := range c.keys { - if k.user == user && bytes.Equal(k.pubKeyData, pubKeyData) { - return k, true - } - } - return cachedPubKey{}, false -} - -// add adds the given tuple to the cache. -func (c *pubKeyCache) add(candidate cachedPubKey) { - if len(c.keys) < maxCachedPubKeys { - c.keys = append(c.keys, candidate) - } -} - -// ServerConn is an authenticated SSH connection, as seen from the -// server -type ServerConn struct { - Conn - - // If the succeeding authentication callback returned a - // non-nil Permissions pointer, it is stored here. - Permissions *Permissions -} - -// NewServerConn starts a new SSH server with c as the underlying -// transport. It starts with a handshake and, if the handshake is -// unsuccessful, it closes the connection and returns an error. The -// Request and NewChannel channels must be serviced, or the connection -// will hang. -func NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewChannel, <-chan *Request, error) { - fullConf := *config - fullConf.SetDefaults() - s := &connection{ - sshConn: sshConn{conn: c}, - } - perms, err := s.serverHandshake(&fullConf) - if err != nil { - c.Close() - return nil, nil, nil, err - } - return &ServerConn{s, perms}, s.mux.incomingChannels, s.mux.incomingRequests, nil -} - -// signAndMarshal signs the data with the appropriate algorithm, -// and serializes the result in SSH wire format. -func signAndMarshal(k Signer, rand io.Reader, data []byte) ([]byte, error) { - sig, err := k.Sign(rand, data) - if err != nil { - return nil, err - } - - return Marshal(sig), nil -} - -// handshake performs key exchange and user authentication. -func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) { - if len(config.hostKeys) == 0 { - return nil, errors.New("ssh: server has no host keys") - } - - if !config.NoClientAuth && config.PasswordCallback == nil && config.PublicKeyCallback == nil && config.KeyboardInteractiveCallback == nil { - return nil, errors.New("ssh: no authentication methods configured but NoClientAuth is also false") - } - - if config.ServerVersion != "" { - s.serverVersion = []byte(config.ServerVersion) - } else { - s.serverVersion = []byte(packageVersion) - } - var err error - s.clientVersion, err = exchangeVersions(s.sshConn.conn, s.serverVersion) - if err != nil { - return nil, err - } - - tr := newTransport(s.sshConn.conn, config.Rand, false /* not client */) - s.transport = newServerTransport(tr, s.clientVersion, s.serverVersion, config) - - if err := s.transport.waitSession(); err != nil { - return nil, err - } - - // We just did the key change, so the session ID is established. - s.sessionID = s.transport.getSessionID() - - var packet []byte - if packet, err = s.transport.readPacket(); err != nil { - return nil, err - } - - var serviceRequest serviceRequestMsg - if err = Unmarshal(packet, &serviceRequest); err != nil { - return nil, err - } - if serviceRequest.Service != serviceUserAuth { - return nil, errors.New("ssh: requested service '" + serviceRequest.Service + "' before authenticating") - } - serviceAccept := serviceAcceptMsg{ - Service: serviceUserAuth, - } - if err := s.transport.writePacket(Marshal(&serviceAccept)); err != nil { - return nil, err - } - - perms, err := s.serverAuthenticate(config) - if err != nil { - return nil, err - } - s.mux = newMux(s.transport) - return perms, err -} - -func isAcceptableAlgo(algo string) bool { - switch algo { - case KeyAlgoRSA, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoED25519, - CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01: - return true - } - return false -} - -func checkSourceAddress(addr net.Addr, sourceAddr string) error { - if addr == nil { - return errors.New("ssh: no address known for client, but source-address match required") - } - - tcpAddr, ok := addr.(*net.TCPAddr) - if !ok { - return fmt.Errorf("ssh: remote address %v is not an TCP address when checking source-address match", addr) - } - - if allowedIP := net.ParseIP(sourceAddr); allowedIP != nil { - if allowedIP.Equal(tcpAddr.IP) { - return nil - } - } else { - _, ipNet, err := net.ParseCIDR(sourceAddr) - if err != nil { - return fmt.Errorf("ssh: error parsing source-address restriction %q: %v", sourceAddr, err) - } - - if ipNet.Contains(tcpAddr.IP) { - return nil - } - } - - return fmt.Errorf("ssh: remote address %v is not allowed because of source-address restriction", addr) -} - -func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) { - sessionID := s.transport.getSessionID() - var cache pubKeyCache - var perms *Permissions - -userAuthLoop: - for { - var userAuthReq userAuthRequestMsg - if packet, err := s.transport.readPacket(); err != nil { - return nil, err - } else if err = Unmarshal(packet, &userAuthReq); err != nil { - return nil, err - } - - if userAuthReq.Service != serviceSSH { - return nil, errors.New("ssh: client attempted to negotiate for unknown service: " + userAuthReq.Service) - } - - s.user = userAuthReq.User - perms = nil - authErr := errors.New("no auth passed yet") - - switch userAuthReq.Method { - case "none": - if config.NoClientAuth { - authErr = nil - } - case "password": - if config.PasswordCallback == nil { - authErr = errors.New("ssh: password auth not configured") - break - } - payload := userAuthReq.Payload - if len(payload) < 1 || payload[0] != 0 { - return nil, parseError(msgUserAuthRequest) - } - payload = payload[1:] - password, payload, ok := parseString(payload) - if !ok || len(payload) > 0 { - return nil, parseError(msgUserAuthRequest) - } - - perms, authErr = config.PasswordCallback(s, password) - case "keyboard-interactive": - if config.KeyboardInteractiveCallback == nil { - authErr = errors.New("ssh: keyboard-interactive auth not configubred") - break - } - - prompter := &sshClientKeyboardInteractive{s} - perms, authErr = config.KeyboardInteractiveCallback(s, prompter.Challenge) - case "publickey": - if config.PublicKeyCallback == nil { - authErr = errors.New("ssh: publickey auth not configured") - break - } - payload := userAuthReq.Payload - if len(payload) < 1 { - return nil, parseError(msgUserAuthRequest) - } - isQuery := payload[0] == 0 - payload = payload[1:] - algoBytes, payload, ok := parseString(payload) - if !ok { - return nil, parseError(msgUserAuthRequest) - } - algo := string(algoBytes) - if !isAcceptableAlgo(algo) { - authErr = fmt.Errorf("ssh: algorithm %q not accepted", algo) - break - } - - pubKeyData, payload, ok := parseString(payload) - if !ok { - return nil, parseError(msgUserAuthRequest) - } - - pubKey, err := ParsePublicKey(pubKeyData) - if err != nil { - return nil, err - } - - candidate, ok := cache.get(s.user, pubKeyData) - if !ok { - candidate.user = s.user - candidate.pubKeyData = pubKeyData - candidate.perms, candidate.result = config.PublicKeyCallback(s, pubKey) - if candidate.result == nil && candidate.perms != nil && candidate.perms.CriticalOptions != nil && candidate.perms.CriticalOptions[sourceAddressCriticalOption] != "" { - candidate.result = checkSourceAddress( - s.RemoteAddr(), - candidate.perms.CriticalOptions[sourceAddressCriticalOption]) - } - cache.add(candidate) - } - - if isQuery { - // The client can query if the given public key - // would be okay. - if len(payload) > 0 { - return nil, parseError(msgUserAuthRequest) - } - - if candidate.result == nil { - okMsg := userAuthPubKeyOkMsg{ - Algo: algo, - PubKey: pubKeyData, - } - if err = s.transport.writePacket(Marshal(&okMsg)); err != nil { - return nil, err - } - continue userAuthLoop - } - authErr = candidate.result - } else { - sig, payload, ok := parseSignature(payload) - if !ok || len(payload) > 0 { - return nil, parseError(msgUserAuthRequest) - } - // Ensure the public key algo and signature algo - // are supported. Compare the private key - // algorithm name that corresponds to algo with - // sig.Format. This is usually the same, but - // for certs, the names differ. - if !isAcceptableAlgo(sig.Format) { - break - } - signedData := buildDataSignedForAuth(sessionID, userAuthReq, algoBytes, pubKeyData) - - if err := pubKey.Verify(signedData, sig); err != nil { - return nil, err - } - - authErr = candidate.result - perms = candidate.perms - } - default: - authErr = fmt.Errorf("ssh: unknown method %q", userAuthReq.Method) - } - - if config.AuthLogCallback != nil { - config.AuthLogCallback(s, userAuthReq.Method, authErr) - } - - if authErr == nil { - break userAuthLoop - } - - var failureMsg userAuthFailureMsg - if config.PasswordCallback != nil { - failureMsg.Methods = append(failureMsg.Methods, "password") - } - if config.PublicKeyCallback != nil { - failureMsg.Methods = append(failureMsg.Methods, "publickey") - } - if config.KeyboardInteractiveCallback != nil { - failureMsg.Methods = append(failureMsg.Methods, "keyboard-interactive") - } - - if len(failureMsg.Methods) == 0 { - return nil, errors.New("ssh: no authentication methods configured but NoClientAuth is also false") - } - - if err := s.transport.writePacket(Marshal(&failureMsg)); err != nil { - return nil, err - } - } - - if err := s.transport.writePacket([]byte{msgUserAuthSuccess}); err != nil { - return nil, err - } - return perms, nil -} - -// sshClientKeyboardInteractive implements a ClientKeyboardInteractive by -// asking the client on the other side of a ServerConn. -type sshClientKeyboardInteractive struct { - *connection -} - -func (c *sshClientKeyboardInteractive) Challenge(user, instruction string, questions []string, echos []bool) (answers []string, err error) { - if len(questions) != len(echos) { - return nil, errors.New("ssh: echos and questions must have equal length") - } - - var prompts []byte - for i := range questions { - prompts = appendString(prompts, questions[i]) - prompts = appendBool(prompts, echos[i]) - } - - if err := c.transport.writePacket(Marshal(&userAuthInfoRequestMsg{ - Instruction: instruction, - NumPrompts: uint32(len(questions)), - Prompts: prompts, - })); err != nil { - return nil, err - } - - packet, err := c.transport.readPacket() - if err != nil { - return nil, err - } - if packet[0] != msgUserAuthInfoResponse { - return nil, unexpectedMessageError(msgUserAuthInfoResponse, packet[0]) - } - packet = packet[1:] - - n, packet, ok := parseUint32(packet) - if !ok || int(n) != len(questions) { - return nil, parseError(msgUserAuthInfoResponse) - } - - for i := uint32(0); i < n; i++ { - ans, rest, ok := parseString(packet) - if !ok { - return nil, parseError(msgUserAuthInfoResponse) - } - - answers = append(answers, string(ans)) - packet = rest - } - if len(packet) != 0 { - return nil, errors.New("ssh: junk at end of message") - } - - return answers, nil -} diff --git a/vendor/golang.org/x/crypto/ssh/session.go b/vendor/golang.org/x/crypto/ssh/session.go deleted file mode 100644 index 17e2aa8..0000000 --- a/vendor/golang.org/x/crypto/ssh/session.go +++ /dev/null @@ -1,627 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -// Session implements an interactive session described in -// "RFC 4254, section 6". - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "io" - "io/ioutil" - "sync" -) - -type Signal string - -// POSIX signals as listed in RFC 4254 Section 6.10. -const ( - SIGABRT Signal = "ABRT" - SIGALRM Signal = "ALRM" - SIGFPE Signal = "FPE" - SIGHUP Signal = "HUP" - SIGILL Signal = "ILL" - SIGINT Signal = "INT" - SIGKILL Signal = "KILL" - SIGPIPE Signal = "PIPE" - SIGQUIT Signal = "QUIT" - SIGSEGV Signal = "SEGV" - SIGTERM Signal = "TERM" - SIGUSR1 Signal = "USR1" - SIGUSR2 Signal = "USR2" -) - -var signals = map[Signal]int{ - SIGABRT: 6, - SIGALRM: 14, - SIGFPE: 8, - SIGHUP: 1, - SIGILL: 4, - SIGINT: 2, - SIGKILL: 9, - SIGPIPE: 13, - SIGQUIT: 3, - SIGSEGV: 11, - SIGTERM: 15, -} - -type TerminalModes map[uint8]uint32 - -// POSIX terminal mode flags as listed in RFC 4254 Section 8. -const ( - tty_OP_END = 0 - VINTR = 1 - VQUIT = 2 - VERASE = 3 - VKILL = 4 - VEOF = 5 - VEOL = 6 - VEOL2 = 7 - VSTART = 8 - VSTOP = 9 - VSUSP = 10 - VDSUSP = 11 - VREPRINT = 12 - VWERASE = 13 - VLNEXT = 14 - VFLUSH = 15 - VSWTCH = 16 - VSTATUS = 17 - VDISCARD = 18 - IGNPAR = 30 - PARMRK = 31 - INPCK = 32 - ISTRIP = 33 - INLCR = 34 - IGNCR = 35 - ICRNL = 36 - IUCLC = 37 - IXON = 38 - IXANY = 39 - IXOFF = 40 - IMAXBEL = 41 - ISIG = 50 - ICANON = 51 - XCASE = 52 - ECHO = 53 - ECHOE = 54 - ECHOK = 55 - ECHONL = 56 - NOFLSH = 57 - TOSTOP = 58 - IEXTEN = 59 - ECHOCTL = 60 - ECHOKE = 61 - PENDIN = 62 - OPOST = 70 - OLCUC = 71 - ONLCR = 72 - OCRNL = 73 - ONOCR = 74 - ONLRET = 75 - CS7 = 90 - CS8 = 91 - PARENB = 92 - PARODD = 93 - TTY_OP_ISPEED = 128 - TTY_OP_OSPEED = 129 -) - -// A Session represents a connection to a remote command or shell. -type Session struct { - // Stdin specifies the remote process's standard input. - // If Stdin is nil, the remote process reads from an empty - // bytes.Buffer. - Stdin io.Reader - - // Stdout and Stderr specify the remote process's standard - // output and error. - // - // If either is nil, Run connects the corresponding file - // descriptor to an instance of ioutil.Discard. There is a - // fixed amount of buffering that is shared for the two streams. - // If either blocks it may eventually cause the remote - // command to block. - Stdout io.Writer - Stderr io.Writer - - ch Channel // the channel backing this session - started bool // true once Start, Run or Shell is invoked. - copyFuncs []func() error - errors chan error // one send per copyFunc - - // true if pipe method is active - stdinpipe, stdoutpipe, stderrpipe bool - - // stdinPipeWriter is non-nil if StdinPipe has not been called - // and Stdin was specified by the user; it is the write end of - // a pipe connecting Session.Stdin to the stdin channel. - stdinPipeWriter io.WriteCloser - - exitStatus chan error -} - -// SendRequest sends an out-of-band channel request on the SSH channel -// underlying the session. -func (s *Session) SendRequest(name string, wantReply bool, payload []byte) (bool, error) { - return s.ch.SendRequest(name, wantReply, payload) -} - -func (s *Session) Close() error { - return s.ch.Close() -} - -// RFC 4254 Section 6.4. -type setenvRequest struct { - Name string - Value string -} - -// Setenv sets an environment variable that will be applied to any -// command executed by Shell or Run. -func (s *Session) Setenv(name, value string) error { - msg := setenvRequest{ - Name: name, - Value: value, - } - ok, err := s.ch.SendRequest("env", true, Marshal(&msg)) - if err == nil && !ok { - err = errors.New("ssh: setenv failed") - } - return err -} - -// RFC 4254 Section 6.2. -type ptyRequestMsg struct { - Term string - Columns uint32 - Rows uint32 - Width uint32 - Height uint32 - Modelist string -} - -// RequestPty requests the association of a pty with the session on the remote host. -func (s *Session) RequestPty(term string, h, w int, termmodes TerminalModes) error { - var tm []byte - for k, v := range termmodes { - kv := struct { - Key byte - Val uint32 - }{k, v} - - tm = append(tm, Marshal(&kv)...) - } - tm = append(tm, tty_OP_END) - req := ptyRequestMsg{ - Term: term, - Columns: uint32(w), - Rows: uint32(h), - Width: uint32(w * 8), - Height: uint32(h * 8), - Modelist: string(tm), - } - ok, err := s.ch.SendRequest("pty-req", true, Marshal(&req)) - if err == nil && !ok { - err = errors.New("ssh: pty-req failed") - } - return err -} - -// RFC 4254 Section 6.5. -type subsystemRequestMsg struct { - Subsystem string -} - -// RequestSubsystem requests the association of a subsystem with the session on the remote host. -// A subsystem is a predefined command that runs in the background when the ssh session is initiated -func (s *Session) RequestSubsystem(subsystem string) error { - msg := subsystemRequestMsg{ - Subsystem: subsystem, - } - ok, err := s.ch.SendRequest("subsystem", true, Marshal(&msg)) - if err == nil && !ok { - err = errors.New("ssh: subsystem request failed") - } - return err -} - -// RFC 4254 Section 6.9. -type signalMsg struct { - Signal string -} - -// Signal sends the given signal to the remote process. -// sig is one of the SIG* constants. -func (s *Session) Signal(sig Signal) error { - msg := signalMsg{ - Signal: string(sig), - } - - _, err := s.ch.SendRequest("signal", false, Marshal(&msg)) - return err -} - -// RFC 4254 Section 6.5. -type execMsg struct { - Command string -} - -// Start runs cmd on the remote host. Typically, the remote -// server passes cmd to the shell for interpretation. -// A Session only accepts one call to Run, Start or Shell. -func (s *Session) Start(cmd string) error { - if s.started { - return errors.New("ssh: session already started") - } - req := execMsg{ - Command: cmd, - } - - ok, err := s.ch.SendRequest("exec", true, Marshal(&req)) - if err == nil && !ok { - err = fmt.Errorf("ssh: command %v failed", cmd) - } - if err != nil { - return err - } - return s.start() -} - -// Run runs cmd on the remote host. Typically, the remote -// server passes cmd to the shell for interpretation. -// A Session only accepts one call to Run, Start, Shell, Output, -// or CombinedOutput. -// -// The returned error is nil if the command runs, has no problems -// copying stdin, stdout, and stderr, and exits with a zero exit -// status. -// -// If the remote server does not send an exit status, an error of type -// *ExitMissingError is returned. If the command completes -// unsuccessfully or is interrupted by a signal, the error is of type -// *ExitError. Other error types may be returned for I/O problems. -func (s *Session) Run(cmd string) error { - err := s.Start(cmd) - if err != nil { - return err - } - return s.Wait() -} - -// Output runs cmd on the remote host and returns its standard output. -func (s *Session) Output(cmd string) ([]byte, error) { - if s.Stdout != nil { - return nil, errors.New("ssh: Stdout already set") - } - var b bytes.Buffer - s.Stdout = &b - err := s.Run(cmd) - return b.Bytes(), err -} - -type singleWriter struct { - b bytes.Buffer - mu sync.Mutex -} - -func (w *singleWriter) Write(p []byte) (int, error) { - w.mu.Lock() - defer w.mu.Unlock() - return w.b.Write(p) -} - -// CombinedOutput runs cmd on the remote host and returns its combined -// standard output and standard error. -func (s *Session) CombinedOutput(cmd string) ([]byte, error) { - if s.Stdout != nil { - return nil, errors.New("ssh: Stdout already set") - } - if s.Stderr != nil { - return nil, errors.New("ssh: Stderr already set") - } - var b singleWriter - s.Stdout = &b - s.Stderr = &b - err := s.Run(cmd) - return b.b.Bytes(), err -} - -// Shell starts a login shell on the remote host. A Session only -// accepts one call to Run, Start, Shell, Output, or CombinedOutput. -func (s *Session) Shell() error { - if s.started { - return errors.New("ssh: session already started") - } - - ok, err := s.ch.SendRequest("shell", true, nil) - if err == nil && !ok { - return errors.New("ssh: could not start shell") - } - if err != nil { - return err - } - return s.start() -} - -func (s *Session) start() error { - s.started = true - - type F func(*Session) - for _, setupFd := range []F{(*Session).stdin, (*Session).stdout, (*Session).stderr} { - setupFd(s) - } - - s.errors = make(chan error, len(s.copyFuncs)) - for _, fn := range s.copyFuncs { - go func(fn func() error) { - s.errors <- fn() - }(fn) - } - return nil -} - -// Wait waits for the remote command to exit. -// -// The returned error is nil if the command runs, has no problems -// copying stdin, stdout, and stderr, and exits with a zero exit -// status. -// -// If the remote server does not send an exit status, an error of type -// *ExitMissingError is returned. If the command completes -// unsuccessfully or is interrupted by a signal, the error is of type -// *ExitError. Other error types may be returned for I/O problems. -func (s *Session) Wait() error { - if !s.started { - return errors.New("ssh: session not started") - } - waitErr := <-s.exitStatus - - if s.stdinPipeWriter != nil { - s.stdinPipeWriter.Close() - } - var copyError error - for _ = range s.copyFuncs { - if err := <-s.errors; err != nil && copyError == nil { - copyError = err - } - } - if waitErr != nil { - return waitErr - } - return copyError -} - -func (s *Session) wait(reqs <-chan *Request) error { - wm := Waitmsg{status: -1} - // Wait for msg channel to be closed before returning. - for msg := range reqs { - switch msg.Type { - case "exit-status": - wm.status = int(binary.BigEndian.Uint32(msg.Payload)) - case "exit-signal": - var sigval struct { - Signal string - CoreDumped bool - Error string - Lang string - } - if err := Unmarshal(msg.Payload, &sigval); err != nil { - return err - } - - // Must sanitize strings? - wm.signal = sigval.Signal - wm.msg = sigval.Error - wm.lang = sigval.Lang - default: - // This handles keepalives and matches - // OpenSSH's behaviour. - if msg.WantReply { - msg.Reply(false, nil) - } - } - } - if wm.status == 0 { - return nil - } - if wm.status == -1 { - // exit-status was never sent from server - if wm.signal == "" { - // signal was not sent either. RFC 4254 - // section 6.10 recommends against this - // behavior, but it is allowed, so we let - // clients handle it. - return &ExitMissingError{} - } - wm.status = 128 - if _, ok := signals[Signal(wm.signal)]; ok { - wm.status += signals[Signal(wm.signal)] - } - } - - return &ExitError{wm} -} - -// ExitMissingError is returned if a session is torn down cleanly, but -// the server sends no confirmation of the exit status. -type ExitMissingError struct{} - -func (e *ExitMissingError) Error() string { - return "wait: remote command exited without exit status or exit signal" -} - -func (s *Session) stdin() { - if s.stdinpipe { - return - } - var stdin io.Reader - if s.Stdin == nil { - stdin = new(bytes.Buffer) - } else { - r, w := io.Pipe() - go func() { - _, err := io.Copy(w, s.Stdin) - w.CloseWithError(err) - }() - stdin, s.stdinPipeWriter = r, w - } - s.copyFuncs = append(s.copyFuncs, func() error { - _, err := io.Copy(s.ch, stdin) - if err1 := s.ch.CloseWrite(); err == nil && err1 != io.EOF { - err = err1 - } - return err - }) -} - -func (s *Session) stdout() { - if s.stdoutpipe { - return - } - if s.Stdout == nil { - s.Stdout = ioutil.Discard - } - s.copyFuncs = append(s.copyFuncs, func() error { - _, err := io.Copy(s.Stdout, s.ch) - return err - }) -} - -func (s *Session) stderr() { - if s.stderrpipe { - return - } - if s.Stderr == nil { - s.Stderr = ioutil.Discard - } - s.copyFuncs = append(s.copyFuncs, func() error { - _, err := io.Copy(s.Stderr, s.ch.Stderr()) - return err - }) -} - -// sessionStdin reroutes Close to CloseWrite. -type sessionStdin struct { - io.Writer - ch Channel -} - -func (s *sessionStdin) Close() error { - return s.ch.CloseWrite() -} - -// StdinPipe returns a pipe that will be connected to the -// remote command's standard input when the command starts. -func (s *Session) StdinPipe() (io.WriteCloser, error) { - if s.Stdin != nil { - return nil, errors.New("ssh: Stdin already set") - } - if s.started { - return nil, errors.New("ssh: StdinPipe after process started") - } - s.stdinpipe = true - return &sessionStdin{s.ch, s.ch}, nil -} - -// StdoutPipe returns a pipe that will be connected to the -// remote command's standard output when the command starts. -// There is a fixed amount of buffering that is shared between -// stdout and stderr streams. If the StdoutPipe reader is -// not serviced fast enough it may eventually cause the -// remote command to block. -func (s *Session) StdoutPipe() (io.Reader, error) { - if s.Stdout != nil { - return nil, errors.New("ssh: Stdout already set") - } - if s.started { - return nil, errors.New("ssh: StdoutPipe after process started") - } - s.stdoutpipe = true - return s.ch, nil -} - -// StderrPipe returns a pipe that will be connected to the -// remote command's standard error when the command starts. -// There is a fixed amount of buffering that is shared between -// stdout and stderr streams. If the StderrPipe reader is -// not serviced fast enough it may eventually cause the -// remote command to block. -func (s *Session) StderrPipe() (io.Reader, error) { - if s.Stderr != nil { - return nil, errors.New("ssh: Stderr already set") - } - if s.started { - return nil, errors.New("ssh: StderrPipe after process started") - } - s.stderrpipe = true - return s.ch.Stderr(), nil -} - -// newSession returns a new interactive session on the remote host. -func newSession(ch Channel, reqs <-chan *Request) (*Session, error) { - s := &Session{ - ch: ch, - } - s.exitStatus = make(chan error, 1) - go func() { - s.exitStatus <- s.wait(reqs) - }() - - return s, nil -} - -// An ExitError reports unsuccessful completion of a remote command. -type ExitError struct { - Waitmsg -} - -func (e *ExitError) Error() string { - return e.Waitmsg.String() -} - -// Waitmsg stores the information about an exited remote command -// as reported by Wait. -type Waitmsg struct { - status int - signal string - msg string - lang string -} - -// ExitStatus returns the exit status of the remote command. -func (w Waitmsg) ExitStatus() int { - return w.status -} - -// Signal returns the exit signal of the remote command if -// it was terminated violently. -func (w Waitmsg) Signal() string { - return w.signal -} - -// Msg returns the exit message given by the remote command -func (w Waitmsg) Msg() string { - return w.msg -} - -// Lang returns the language tag. See RFC 3066 -func (w Waitmsg) Lang() string { - return w.lang -} - -func (w Waitmsg) String() string { - str := fmt.Sprintf("Process exited with status %v", w.status) - if w.signal != "" { - str += fmt.Sprintf(" from signal %v", w.signal) - } - if w.msg != "" { - str += fmt.Sprintf(". Reason was: %v", w.msg) - } - return str -} diff --git a/vendor/golang.org/x/crypto/ssh/tcpip.go b/vendor/golang.org/x/crypto/ssh/tcpip.go deleted file mode 100644 index 6151241..0000000 --- a/vendor/golang.org/x/crypto/ssh/tcpip.go +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "errors" - "fmt" - "io" - "math/rand" - "net" - "strconv" - "strings" - "sync" - "time" -) - -// Listen requests the remote peer open a listening socket on -// addr. Incoming connections will be available by calling Accept on -// the returned net.Listener. The listener must be serviced, or the -// SSH connection may hang. -func (c *Client) Listen(n, addr string) (net.Listener, error) { - laddr, err := net.ResolveTCPAddr(n, addr) - if err != nil { - return nil, err - } - return c.ListenTCP(laddr) -} - -// Automatic port allocation is broken with OpenSSH before 6.0. See -// also https://bugzilla.mindrot.org/show_bug.cgi?id=2017. In -// particular, OpenSSH 5.9 sends a channelOpenMsg with port number 0, -// rather than the actual port number. This means you can never open -// two different listeners with auto allocated ports. We work around -// this by trying explicit ports until we succeed. - -const openSSHPrefix = "OpenSSH_" - -var portRandomizer = rand.New(rand.NewSource(time.Now().UnixNano())) - -// isBrokenOpenSSHVersion returns true if the given version string -// specifies a version of OpenSSH that is known to have a bug in port -// forwarding. -func isBrokenOpenSSHVersion(versionStr string) bool { - i := strings.Index(versionStr, openSSHPrefix) - if i < 0 { - return false - } - i += len(openSSHPrefix) - j := i - for ; j < len(versionStr); j++ { - if versionStr[j] < '0' || versionStr[j] > '9' { - break - } - } - version, _ := strconv.Atoi(versionStr[i:j]) - return version < 6 -} - -// autoPortListenWorkaround simulates automatic port allocation by -// trying random ports repeatedly. -func (c *Client) autoPortListenWorkaround(laddr *net.TCPAddr) (net.Listener, error) { - var sshListener net.Listener - var err error - const tries = 10 - for i := 0; i < tries; i++ { - addr := *laddr - addr.Port = 1024 + portRandomizer.Intn(60000) - sshListener, err = c.ListenTCP(&addr) - if err == nil { - laddr.Port = addr.Port - return sshListener, err - } - } - return nil, fmt.Errorf("ssh: listen on random port failed after %d tries: %v", tries, err) -} - -// RFC 4254 7.1 -type channelForwardMsg struct { - addr string - rport uint32 -} - -// ListenTCP requests the remote peer open a listening socket -// on laddr. Incoming connections will be available by calling -// Accept on the returned net.Listener. -func (c *Client) ListenTCP(laddr *net.TCPAddr) (net.Listener, error) { - if laddr.Port == 0 && isBrokenOpenSSHVersion(string(c.ServerVersion())) { - return c.autoPortListenWorkaround(laddr) - } - - m := channelForwardMsg{ - laddr.IP.String(), - uint32(laddr.Port), - } - // send message - ok, resp, err := c.SendRequest("tcpip-forward", true, Marshal(&m)) - if err != nil { - return nil, err - } - if !ok { - return nil, errors.New("ssh: tcpip-forward request denied by peer") - } - - // If the original port was 0, then the remote side will - // supply a real port number in the response. - if laddr.Port == 0 { - var p struct { - Port uint32 - } - if err := Unmarshal(resp, &p); err != nil { - return nil, err - } - laddr.Port = int(p.Port) - } - - // Register this forward, using the port number we obtained. - ch := c.forwards.add(*laddr) - - return &tcpListener{laddr, c, ch}, nil -} - -// forwardList stores a mapping between remote -// forward requests and the tcpListeners. -type forwardList struct { - sync.Mutex - entries []forwardEntry -} - -// forwardEntry represents an established mapping of a laddr on a -// remote ssh server to a channel connected to a tcpListener. -type forwardEntry struct { - laddr net.TCPAddr - c chan forward -} - -// forward represents an incoming forwarded tcpip connection. The -// arguments to add/remove/lookup should be address as specified in -// the original forward-request. -type forward struct { - newCh NewChannel // the ssh client channel underlying this forward - raddr *net.TCPAddr // the raddr of the incoming connection -} - -func (l *forwardList) add(addr net.TCPAddr) chan forward { - l.Lock() - defer l.Unlock() - f := forwardEntry{ - addr, - make(chan forward, 1), - } - l.entries = append(l.entries, f) - return f.c -} - -// See RFC 4254, section 7.2 -type forwardedTCPPayload struct { - Addr string - Port uint32 - OriginAddr string - OriginPort uint32 -} - -// parseTCPAddr parses the originating address from the remote into a *net.TCPAddr. -func parseTCPAddr(addr string, port uint32) (*net.TCPAddr, error) { - if port == 0 || port > 65535 { - return nil, fmt.Errorf("ssh: port number out of range: %d", port) - } - ip := net.ParseIP(string(addr)) - if ip == nil { - return nil, fmt.Errorf("ssh: cannot parse IP address %q", addr) - } - return &net.TCPAddr{IP: ip, Port: int(port)}, nil -} - -func (l *forwardList) handleChannels(in <-chan NewChannel) { - for ch := range in { - var payload forwardedTCPPayload - if err := Unmarshal(ch.ExtraData(), &payload); err != nil { - ch.Reject(ConnectionFailed, "could not parse forwarded-tcpip payload: "+err.Error()) - continue - } - - // RFC 4254 section 7.2 specifies that incoming - // addresses should list the address, in string - // format. It is implied that this should be an IP - // address, as it would be impossible to connect to it - // otherwise. - laddr, err := parseTCPAddr(payload.Addr, payload.Port) - if err != nil { - ch.Reject(ConnectionFailed, err.Error()) - continue - } - raddr, err := parseTCPAddr(payload.OriginAddr, payload.OriginPort) - if err != nil { - ch.Reject(ConnectionFailed, err.Error()) - continue - } - - if ok := l.forward(*laddr, *raddr, ch); !ok { - // Section 7.2, implementations MUST reject spurious incoming - // connections. - ch.Reject(Prohibited, "no forward for address") - continue - } - } -} - -// remove removes the forward entry, and the channel feeding its -// listener. -func (l *forwardList) remove(addr net.TCPAddr) { - l.Lock() - defer l.Unlock() - for i, f := range l.entries { - if addr.IP.Equal(f.laddr.IP) && addr.Port == f.laddr.Port { - l.entries = append(l.entries[:i], l.entries[i+1:]...) - close(f.c) - return - } - } -} - -// closeAll closes and clears all forwards. -func (l *forwardList) closeAll() { - l.Lock() - defer l.Unlock() - for _, f := range l.entries { - close(f.c) - } - l.entries = nil -} - -func (l *forwardList) forward(laddr, raddr net.TCPAddr, ch NewChannel) bool { - l.Lock() - defer l.Unlock() - for _, f := range l.entries { - if laddr.IP.Equal(f.laddr.IP) && laddr.Port == f.laddr.Port { - f.c <- forward{ch, &raddr} - return true - } - } - return false -} - -type tcpListener struct { - laddr *net.TCPAddr - - conn *Client - in <-chan forward -} - -// Accept waits for and returns the next connection to the listener. -func (l *tcpListener) Accept() (net.Conn, error) { - s, ok := <-l.in - if !ok { - return nil, io.EOF - } - ch, incoming, err := s.newCh.Accept() - if err != nil { - return nil, err - } - go DiscardRequests(incoming) - - return &tcpChanConn{ - Channel: ch, - laddr: l.laddr, - raddr: s.raddr, - }, nil -} - -// Close closes the listener. -func (l *tcpListener) Close() error { - m := channelForwardMsg{ - l.laddr.IP.String(), - uint32(l.laddr.Port), - } - - // this also closes the listener. - l.conn.forwards.remove(*l.laddr) - ok, _, err := l.conn.SendRequest("cancel-tcpip-forward", true, Marshal(&m)) - if err == nil && !ok { - err = errors.New("ssh: cancel-tcpip-forward failed") - } - return err -} - -// Addr returns the listener's network address. -func (l *tcpListener) Addr() net.Addr { - return l.laddr -} - -// Dial initiates a connection to the addr from the remote host. -// The resulting connection has a zero LocalAddr() and RemoteAddr(). -func (c *Client) Dial(n, addr string) (net.Conn, error) { - // Parse the address into host and numeric port. - host, portString, err := net.SplitHostPort(addr) - if err != nil { - return nil, err - } - port, err := strconv.ParseUint(portString, 10, 16) - if err != nil { - return nil, err - } - // Use a zero address for local and remote address. - zeroAddr := &net.TCPAddr{ - IP: net.IPv4zero, - Port: 0, - } - ch, err := c.dial(net.IPv4zero.String(), 0, host, int(port)) - if err != nil { - return nil, err - } - return &tcpChanConn{ - Channel: ch, - laddr: zeroAddr, - raddr: zeroAddr, - }, nil -} - -// DialTCP connects to the remote address raddr on the network net, -// which must be "tcp", "tcp4", or "tcp6". If laddr is not nil, it is used -// as the local address for the connection. -func (c *Client) DialTCP(n string, laddr, raddr *net.TCPAddr) (net.Conn, error) { - if laddr == nil { - laddr = &net.TCPAddr{ - IP: net.IPv4zero, - Port: 0, - } - } - ch, err := c.dial(laddr.IP.String(), laddr.Port, raddr.IP.String(), raddr.Port) - if err != nil { - return nil, err - } - return &tcpChanConn{ - Channel: ch, - laddr: laddr, - raddr: raddr, - }, nil -} - -// RFC 4254 7.2 -type channelOpenDirectMsg struct { - raddr string - rport uint32 - laddr string - lport uint32 -} - -func (c *Client) dial(laddr string, lport int, raddr string, rport int) (Channel, error) { - msg := channelOpenDirectMsg{ - raddr: raddr, - rport: uint32(rport), - laddr: laddr, - lport: uint32(lport), - } - ch, in, err := c.OpenChannel("direct-tcpip", Marshal(&msg)) - if err != nil { - return nil, err - } - go DiscardRequests(in) - return ch, err -} - -type tcpChan struct { - Channel // the backing channel -} - -// tcpChanConn fulfills the net.Conn interface without -// the tcpChan having to hold laddr or raddr directly. -type tcpChanConn struct { - Channel - laddr, raddr net.Addr -} - -// LocalAddr returns the local network address. -func (t *tcpChanConn) LocalAddr() net.Addr { - return t.laddr -} - -// RemoteAddr returns the remote network address. -func (t *tcpChanConn) RemoteAddr() net.Addr { - return t.raddr -} - -// SetDeadline sets the read and write deadlines associated -// with the connection. -func (t *tcpChanConn) SetDeadline(deadline time.Time) error { - if err := t.SetReadDeadline(deadline); err != nil { - return err - } - return t.SetWriteDeadline(deadline) -} - -// SetReadDeadline sets the read deadline. -// A zero value for t means Read will not time out. -// After the deadline, the error from Read will implement net.Error -// with Timeout() == true. -func (t *tcpChanConn) SetReadDeadline(deadline time.Time) error { - return errors.New("ssh: tcpChan: deadline not supported") -} - -// SetWriteDeadline exists to satisfy the net.Conn interface -// but is not implemented by this type. It always returns an error. -func (t *tcpChanConn) SetWriteDeadline(deadline time.Time) error { - return errors.New("ssh: tcpChan: deadline not supported") -} diff --git a/vendor/golang.org/x/crypto/ssh/transport.go b/vendor/golang.org/x/crypto/ssh/transport.go deleted file mode 100644 index fd19932..0000000 --- a/vendor/golang.org/x/crypto/ssh/transport.go +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ssh - -import ( - "bufio" - "errors" - "io" -) - -const ( - gcmCipherID = "aes128-gcm@openssh.com" - aes128cbcID = "aes128-cbc" - tripledescbcID = "3des-cbc" -) - -// packetConn represents a transport that implements packet based -// operations. -type packetConn interface { - // Encrypt and send a packet of data to the remote peer. - writePacket(packet []byte) error - - // Read a packet from the connection. The read is blocking, - // i.e. if error is nil, then the returned byte slice is - // always non-empty. - readPacket() ([]byte, error) - - // Close closes the write-side of the connection. - Close() error -} - -// transport is the keyingTransport that implements the SSH packet -// protocol. -type transport struct { - reader connectionState - writer connectionState - - bufReader *bufio.Reader - bufWriter *bufio.Writer - rand io.Reader - - io.Closer -} - -// packetCipher represents a combination of SSH encryption/MAC -// protocol. A single instance should be used for one direction only. -type packetCipher interface { - // writePacket encrypts the packet and writes it to w. The - // contents of the packet are generally scrambled. - writePacket(seqnum uint32, w io.Writer, rand io.Reader, packet []byte) error - - // readPacket reads and decrypts a packet of data. The - // returned packet may be overwritten by future calls of - // readPacket. - readPacket(seqnum uint32, r io.Reader) ([]byte, error) -} - -// connectionState represents one side (read or write) of the -// connection. This is necessary because each direction has its own -// keys, and can even have its own algorithms -type connectionState struct { - packetCipher - seqNum uint32 - dir direction - pendingKeyChange chan packetCipher -} - -// prepareKeyChange sets up key material for a keychange. The key changes in -// both directions are triggered by reading and writing a msgNewKey packet -// respectively. -func (t *transport) prepareKeyChange(algs *algorithms, kexResult *kexResult) error { - if ciph, err := newPacketCipher(t.reader.dir, algs.r, kexResult); err != nil { - return err - } else { - t.reader.pendingKeyChange <- ciph - } - - if ciph, err := newPacketCipher(t.writer.dir, algs.w, kexResult); err != nil { - return err - } else { - t.writer.pendingKeyChange <- ciph - } - - return nil -} - -// Read and decrypt next packet. -func (t *transport) readPacket() (p []byte, err error) { - for { - p, err = t.reader.readPacket(t.bufReader) - if err != nil { - break - } - if len(p) == 0 || (p[0] != msgIgnore && p[0] != msgDebug) { - break - } - } - - return p, err -} - -func (s *connectionState) readPacket(r *bufio.Reader) ([]byte, error) { - packet, err := s.packetCipher.readPacket(s.seqNum, r) - s.seqNum++ - if err == nil && len(packet) == 0 { - err = errors.New("ssh: zero length packet") - } - - if len(packet) > 0 { - switch packet[0] { - case msgNewKeys: - select { - case cipher := <-s.pendingKeyChange: - s.packetCipher = cipher - default: - return nil, errors.New("ssh: got bogus newkeys message.") - } - - case msgDisconnect: - // Transform a disconnect message into an - // error. Since this is lowest level at which - // we interpret message types, doing it here - // ensures that we don't have to handle it - // elsewhere. - var msg disconnectMsg - if err := Unmarshal(packet, &msg); err != nil { - return nil, err - } - return nil, &msg - } - } - - // The packet may point to an internal buffer, so copy the - // packet out here. - fresh := make([]byte, len(packet)) - copy(fresh, packet) - - return fresh, err -} - -func (t *transport) writePacket(packet []byte) error { - return t.writer.writePacket(t.bufWriter, t.rand, packet) -} - -func (s *connectionState) writePacket(w *bufio.Writer, rand io.Reader, packet []byte) error { - changeKeys := len(packet) > 0 && packet[0] == msgNewKeys - - err := s.packetCipher.writePacket(s.seqNum, w, rand, packet) - if err != nil { - return err - } - if err = w.Flush(); err != nil { - return err - } - s.seqNum++ - if changeKeys { - select { - case cipher := <-s.pendingKeyChange: - s.packetCipher = cipher - default: - panic("ssh: no key material for msgNewKeys") - } - } - return err -} - -func newTransport(rwc io.ReadWriteCloser, rand io.Reader, isClient bool) *transport { - t := &transport{ - bufReader: bufio.NewReader(rwc), - bufWriter: bufio.NewWriter(rwc), - rand: rand, - reader: connectionState{ - packetCipher: &streamPacketCipher{cipher: noneCipher{}}, - pendingKeyChange: make(chan packetCipher, 1), - }, - writer: connectionState{ - packetCipher: &streamPacketCipher{cipher: noneCipher{}}, - pendingKeyChange: make(chan packetCipher, 1), - }, - Closer: rwc, - } - if isClient { - t.reader.dir = serverKeys - t.writer.dir = clientKeys - } else { - t.reader.dir = clientKeys - t.writer.dir = serverKeys - } - - return t -} - -type direction struct { - ivTag []byte - keyTag []byte - macKeyTag []byte -} - -var ( - serverKeys = direction{[]byte{'B'}, []byte{'D'}, []byte{'F'}} - clientKeys = direction{[]byte{'A'}, []byte{'C'}, []byte{'E'}} -) - -// generateKeys generates key material for IV, MAC and encryption. -func generateKeys(d direction, algs directionAlgorithms, kex *kexResult) (iv, key, macKey []byte) { - cipherMode := cipherModes[algs.Cipher] - macMode := macModes[algs.MAC] - - iv = make([]byte, cipherMode.ivSize) - key = make([]byte, cipherMode.keySize) - macKey = make([]byte, macMode.keySize) - - generateKeyMaterial(iv, d.ivTag, kex) - generateKeyMaterial(key, d.keyTag, kex) - generateKeyMaterial(macKey, d.macKeyTag, kex) - return -} - -// setupKeys sets the cipher and MAC keys from kex.K, kex.H and sessionId, as -// described in RFC 4253, section 6.4. direction should either be serverKeys -// (to setup server->client keys) or clientKeys (for client->server keys). -func newPacketCipher(d direction, algs directionAlgorithms, kex *kexResult) (packetCipher, error) { - iv, key, macKey := generateKeys(d, algs, kex) - - if algs.Cipher == gcmCipherID { - return newGCMCipher(iv, key, macKey) - } - - if algs.Cipher == aes128cbcID { - return newAESCBCCipher(iv, key, macKey, algs) - } - - if algs.Cipher == tripledescbcID { - return newTripleDESCBCCipher(iv, key, macKey, algs) - } - - c := &streamPacketCipher{ - mac: macModes[algs.MAC].new(macKey), - } - c.macResult = make([]byte, c.mac.Size()) - - var err error - c.cipher, err = cipherModes[algs.Cipher].createStream(key, iv) - if err != nil { - return nil, err - } - - return c, nil -} - -// generateKeyMaterial fills out with key material generated from tag, K, H -// and sessionId, as specified in RFC 4253, section 7.2. -func generateKeyMaterial(out, tag []byte, r *kexResult) { - var digestsSoFar []byte - - h := r.Hash.New() - for len(out) > 0 { - h.Reset() - h.Write(r.K) - h.Write(r.H) - - if len(digestsSoFar) == 0 { - h.Write(tag) - h.Write(r.SessionID) - } else { - h.Write(digestsSoFar) - } - - digest := h.Sum(nil) - n := copy(out, digest) - out = out[n:] - if len(out) > 0 { - digestsSoFar = append(digestsSoFar, digest...) - } - } -} - -const packageVersion = "SSH-2.0-Go" - -// Sends and receives a version line. The versionLine string should -// be US ASCII, start with "SSH-2.0-", and should not include a -// newline. exchangeVersions returns the other side's version line. -func exchangeVersions(rw io.ReadWriter, versionLine []byte) (them []byte, err error) { - // Contrary to the RFC, we do not ignore lines that don't - // start with "SSH-2.0-" to make the library usable with - // nonconforming servers. - for _, c := range versionLine { - // The spec disallows non US-ASCII chars, and - // specifically forbids null chars. - if c < 32 { - return nil, errors.New("ssh: junk character in version line") - } - } - if _, err = rw.Write(append(versionLine, '\r', '\n')); err != nil { - return - } - - them, err = readVersion(rw) - return them, err -} - -// maxVersionStringBytes is the maximum number of bytes that we'll -// accept as a version string. RFC 4253 section 4.2 limits this at 255 -// chars -const maxVersionStringBytes = 255 - -// Read version string as specified by RFC 4253, section 4.2. -func readVersion(r io.Reader) ([]byte, error) { - versionString := make([]byte, 0, 64) - var ok bool - var buf [1]byte - - for len(versionString) < maxVersionStringBytes { - _, err := io.ReadFull(r, buf[:]) - if err != nil { - return nil, err - } - // The RFC says that the version should be terminated with \r\n - // but several SSH servers actually only send a \n. - if buf[0] == '\n' { - ok = true - break - } - - // non ASCII chars are disallowed, but we are lenient, - // since Go doesn't use null-terminated strings. - - // The RFC allows a comment after a space, however, - // all of it (version and comments) goes into the - // session hash. - versionString = append(versionString, buf[0]) - } - - if !ok { - return nil, errors.New("ssh: overflow reading version string") - } - - // There might be a '\r' on the end which we should remove. - if len(versionString) > 0 && versionString[len(versionString)-1] == '\r' { - versionString = versionString[:len(versionString)-1] - } - return versionString, nil -} diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go index f143ed6..d3681ab 100644 --- a/vendor/golang.org/x/net/context/context.go +++ b/vendor/golang.org/x/net/context/context.go @@ -36,103 +36,6 @@ // Contexts. package context // import "golang.org/x/net/context" -import "time" - -// A Context carries a deadline, a cancelation signal, and other values across -// API boundaries. -// -// Context's methods may be called by multiple goroutines simultaneously. -type Context interface { - // Deadline returns the time when work done on behalf of this context - // should be canceled. Deadline returns ok==false when no deadline is - // set. Successive calls to Deadline return the same results. - Deadline() (deadline time.Time, ok bool) - - // Done returns a channel that's closed when work done on behalf of this - // context should be canceled. Done may return nil if this context can - // never be canceled. Successive calls to Done return the same value. - // - // WithCancel arranges for Done to be closed when cancel is called; - // WithDeadline arranges for Done to be closed when the deadline - // expires; WithTimeout arranges for Done to be closed when the timeout - // elapses. - // - // Done is provided for use in select statements: - // - // // Stream generates values with DoSomething and sends them to out - // // until DoSomething returns an error or ctx.Done is closed. - // func Stream(ctx context.Context, out chan<- Value) error { - // for { - // v, err := DoSomething(ctx) - // if err != nil { - // return err - // } - // select { - // case <-ctx.Done(): - // return ctx.Err() - // case out <- v: - // } - // } - // } - // - // See http://blog.golang.org/pipelines for more examples of how to use - // a Done channel for cancelation. - Done() <-chan struct{} - - // Err returns a non-nil error value after Done is closed. Err returns - // Canceled if the context was canceled or DeadlineExceeded if the - // context's deadline passed. No other values for Err are defined. - // After Done is closed, successive calls to Err return the same value. - Err() error - - // Value returns the value associated with this context for key, or nil - // if no value is associated with key. Successive calls to Value with - // the same key returns the same result. - // - // Use context values only for request-scoped data that transits - // processes and API boundaries, not for passing optional parameters to - // functions. - // - // A key identifies a specific value in a Context. Functions that wish - // to store values in Context typically allocate a key in a global - // variable then use that key as the argument to context.WithValue and - // Context.Value. A key can be any type that supports equality; - // packages should define keys as an unexported type to avoid - // collisions. - // - // Packages that define a Context key should provide type-safe accessors - // for the values stores using that key: - // - // // Package user defines a User type that's stored in Contexts. - // package user - // - // import "golang.org/x/net/context" - // - // // User is the type of value stored in the Contexts. - // type User struct {...} - // - // // key is an unexported type for keys defined in this package. - // // This prevents collisions with keys defined in other packages. - // type key int - // - // // userKey is the key for user.User values in Contexts. It is - // // unexported; clients use user.NewContext and user.FromContext - // // instead of using this key directly. - // var userKey key = 0 - // - // // NewContext returns a new Context that carries value u. - // func NewContext(ctx context.Context, u *User) context.Context { - // return context.WithValue(ctx, userKey, u) - // } - // - // // FromContext returns the User value stored in ctx, if any. - // func FromContext(ctx context.Context) (*User, bool) { - // u, ok := ctx.Value(userKey).(*User) - // return u, ok - // } - Value(key interface{}) interface{} -} - // Background returns a non-nil, empty Context. It is never canceled, has no // values, and has no deadline. It is typically used by the main function, // initialization, and tests, and as the top-level Context for incoming @@ -149,8 +52,3 @@ func Background() Context { func TODO() Context { return todo } - -// A CancelFunc tells an operation to abandon its work. -// A CancelFunc does not wait for the work to stop. -// After the first call, subsequent calls to a CancelFunc do nothing. -type CancelFunc func() diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go deleted file mode 100644 index 606cf1f..0000000 --- a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.7 - -// Package ctxhttp provides helper functions for performing context-aware HTTP requests. -package ctxhttp // import "golang.org/x/net/context/ctxhttp" - -import ( - "io" - "net/http" - "net/url" - "strings" - - "golang.org/x/net/context" -) - -// Do sends an HTTP request with the provided http.Client and returns -// an HTTP response. -// -// If the client is nil, http.DefaultClient is used. -// -// The provided ctx must be non-nil. If it is canceled or times out, -// ctx.Err() will be returned. -func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - resp, err := client.Do(req.WithContext(ctx)) - // If we got an error, and the context has been canceled, - // the context's error is probably more useful. - if err != nil { - select { - case <-ctx.Done(): - err = ctx.Err() - default: - } - } - return resp, err -} - -// Get issues a GET request via the Do function. -func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Head issues a HEAD request via the Do function. -func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("HEAD", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Post issues a POST request via the Do function. -func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { - req, err := http.NewRequest("POST", url, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyType) - return Do(ctx, client, req) -} - -// PostForm issues a POST request via the Do function. -func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { - return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) -} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go deleted file mode 100644 index 926870c..0000000 --- a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.7 - -package ctxhttp // import "golang.org/x/net/context/ctxhttp" - -import ( - "io" - "net/http" - "net/url" - "strings" - - "golang.org/x/net/context" -) - -func nop() {} - -var ( - testHookContextDoneBeforeHeaders = nop - testHookDoReturned = nop - testHookDidBodyClose = nop -) - -// Do sends an HTTP request with the provided http.Client and returns an HTTP response. -// If the client is nil, http.DefaultClient is used. -// If the context is canceled or times out, ctx.Err() will be returned. -func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - - // TODO(djd): Respect any existing value of req.Cancel. - cancel := make(chan struct{}) - req.Cancel = cancel - - type responseAndError struct { - resp *http.Response - err error - } - result := make(chan responseAndError, 1) - - // Make local copies of test hooks closed over by goroutines below. - // Prevents data races in tests. - testHookDoReturned := testHookDoReturned - testHookDidBodyClose := testHookDidBodyClose - - go func() { - resp, err := client.Do(req) - testHookDoReturned() - result <- responseAndError{resp, err} - }() - - var resp *http.Response - - select { - case <-ctx.Done(): - testHookContextDoneBeforeHeaders() - close(cancel) - // Clean up after the goroutine calling client.Do: - go func() { - if r := <-result; r.resp != nil { - testHookDidBodyClose() - r.resp.Body.Close() - } - }() - return nil, ctx.Err() - case r := <-result: - var err error - resp, err = r.resp, r.err - if err != nil { - return resp, err - } - } - - c := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - close(cancel) - case <-c: - // The response's Body is closed. - } - }() - resp.Body = ¬ifyingReader{resp.Body, c} - - return resp, nil -} - -// Get issues a GET request via the Do function. -func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Head issues a HEAD request via the Do function. -func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("HEAD", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Post issues a POST request via the Do function. -func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { - req, err := http.NewRequest("POST", url, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyType) - return Do(ctx, client, req) -} - -// PostForm issues a POST request via the Do function. -func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { - return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) -} - -// notifyingReader is an io.ReadCloser that closes the notify channel after -// Close is called or a Read fails on the underlying ReadCloser. -type notifyingReader struct { - io.ReadCloser - notify chan<- struct{} -} - -func (r *notifyingReader) Read(p []byte) (int, error) { - n, err := r.ReadCloser.Read(p) - if err != nil && r.notify != nil { - close(r.notify) - r.notify = nil - } - return n, err -} - -func (r *notifyingReader) Close() error { - err := r.ReadCloser.Close() - if r.notify != nil { - close(r.notify) - r.notify = nil - } - return err -} diff --git a/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go new file mode 100644 index 0000000..d88bd1d --- /dev/null +++ b/vendor/golang.org/x/net/context/go19.go @@ -0,0 +1,20 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.9 + +package context + +import "context" // standard library's context, as of Go 1.7 + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context = context.Context + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc = context.CancelFunc diff --git a/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go new file mode 100644 index 0000000..b105f80 --- /dev/null +++ b/vendor/golang.org/x/net/context/pre_go19.go @@ -0,0 +1,109 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.9 + +package context + +import "time" + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context interface { + // Deadline returns the time when work done on behalf of this context + // should be canceled. Deadline returns ok==false when no deadline is + // set. Successive calls to Deadline return the same results. + Deadline() (deadline time.Time, ok bool) + + // Done returns a channel that's closed when work done on behalf of this + // context should be canceled. Done may return nil if this context can + // never be canceled. Successive calls to Done return the same value. + // + // WithCancel arranges for Done to be closed when cancel is called; + // WithDeadline arranges for Done to be closed when the deadline + // expires; WithTimeout arranges for Done to be closed when the timeout + // elapses. + // + // Done is provided for use in select statements: + // + // // Stream generates values with DoSomething and sends them to out + // // until DoSomething returns an error or ctx.Done is closed. + // func Stream(ctx context.Context, out chan<- Value) error { + // for { + // v, err := DoSomething(ctx) + // if err != nil { + // return err + // } + // select { + // case <-ctx.Done(): + // return ctx.Err() + // case out <- v: + // } + // } + // } + // + // See http://blog.golang.org/pipelines for more examples of how to use + // a Done channel for cancelation. + Done() <-chan struct{} + + // Err returns a non-nil error value after Done is closed. Err returns + // Canceled if the context was canceled or DeadlineExceeded if the + // context's deadline passed. No other values for Err are defined. + // After Done is closed, successive calls to Err return the same value. + Err() error + + // Value returns the value associated with this context for key, or nil + // if no value is associated with key. Successive calls to Value with + // the same key returns the same result. + // + // Use context values only for request-scoped data that transits + // processes and API boundaries, not for passing optional parameters to + // functions. + // + // A key identifies a specific value in a Context. Functions that wish + // to store values in Context typically allocate a key in a global + // variable then use that key as the argument to context.WithValue and + // Context.Value. A key can be any type that supports equality; + // packages should define keys as an unexported type to avoid + // collisions. + // + // Packages that define a Context key should provide type-safe accessors + // for the values stores using that key: + // + // // Package user defines a User type that's stored in Contexts. + // package user + // + // import "golang.org/x/net/context" + // + // // User is the type of value stored in the Contexts. + // type User struct {...} + // + // // key is an unexported type for keys defined in this package. + // // This prevents collisions with keys defined in other packages. + // type key int + // + // // userKey is the key for user.User values in Contexts. It is + // // unexported; clients use user.NewContext and user.FromContext + // // instead of using this key directly. + // var userKey key = 0 + // + // // NewContext returns a new Context that carries value u. + // func NewContext(ctx context.Context, u *User) context.Context { + // return context.WithValue(ctx, userKey, u) + // } + // + // // FromContext returns the User value stored in ctx, if any. + // func FromContext(ctx context.Context) (*User, bool) { + // u, ok := ctx.Value(userKey).(*User) + // return u, ok + // } + Value(key interface{}) interface{} +} + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc func() diff --git a/vendor/golang.org/x/net/html/atom/atom.go b/vendor/golang.org/x/net/html/atom/atom.go new file mode 100644 index 0000000..cd0a8ac --- /dev/null +++ b/vendor/golang.org/x/net/html/atom/atom.go @@ -0,0 +1,78 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package atom provides integer codes (also known as atoms) for a fixed set of +// frequently occurring HTML strings: tag names and attribute keys such as "p" +// and "id". +// +// Sharing an atom's name between all elements with the same tag can result in +// fewer string allocations when tokenizing and parsing HTML. Integer +// comparisons are also generally faster than string comparisons. +// +// The value of an atom's particular code is not guaranteed to stay the same +// between versions of this package. Neither is any ordering guaranteed: +// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to +// be dense. The only guarantees are that e.g. looking up "div" will yield +// atom.Div, calling atom.Div.String will return "div", and atom.Div != 0. +package atom // import "golang.org/x/net/html/atom" + +// Atom is an integer code for a string. The zero value maps to "". +type Atom uint32 + +// String returns the atom's name. +func (a Atom) String() string { + start := uint32(a >> 8) + n := uint32(a & 0xff) + if start+n > uint32(len(atomText)) { + return "" + } + return atomText[start : start+n] +} + +func (a Atom) string() string { + return atomText[a>>8 : a>>8+a&0xff] +} + +// fnv computes the FNV hash with an arbitrary starting value h. +func fnv(h uint32, s []byte) uint32 { + for i := range s { + h ^= uint32(s[i]) + h *= 16777619 + } + return h +} + +func match(s string, t []byte) bool { + for i, c := range t { + if s[i] != c { + return false + } + } + return true +} + +// Lookup returns the atom whose name is s. It returns zero if there is no +// such atom. The lookup is case sensitive. +func Lookup(s []byte) Atom { + if len(s) == 0 || len(s) > maxAtomLen { + return 0 + } + h := fnv(hash0, s) + if a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { + return a + } + if a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { + return a + } + return 0 +} + +// String returns a string whose contents are equal to s. In that sense, it is +// equivalent to string(s) but may be more efficient. +func String(s []byte) string { + if a := Lookup(s); a != 0 { + return a.String() + } + return string(s) +} diff --git a/vendor/golang.org/x/net/html/atom/table.go b/vendor/golang.org/x/net/html/atom/table.go new file mode 100644 index 0000000..f74018e --- /dev/null +++ b/vendor/golang.org/x/net/html/atom/table.go @@ -0,0 +1,777 @@ +// Code generated by go generate gen.go; DO NOT EDIT. + +//go:generate go run gen.go + +package atom + +const ( + A Atom = 0x1 + Abbr Atom = 0x4 + Accept Atom = 0x1a06 + AcceptCharset Atom = 0x1a0e + Accesskey Atom = 0x2c09 + Action Atom = 0x25a06 + Address Atom = 0x6ed07 + Align Atom = 0x6d405 + Allowfullscreen Atom = 0x1f00f + Allowpaymentrequest Atom = 0x6913 + Allowusermedia Atom = 0x850e + Alt Atom = 0xb003 + Annotation Atom = 0x1b90a + AnnotationXml Atom = 0x1b90e + Applet Atom = 0x30106 + Area Atom = 0x34a04 + Article Atom = 0x3f007 + As Atom = 0xb902 + Aside Atom = 0xc105 + Async Atom = 0xb905 + Audio Atom = 0xcf05 + Autocomplete Atom = 0x2600c + Autofocus Atom = 0xeb09 + Autoplay Atom = 0x10608 + B Atom = 0x101 + Base Atom = 0x11504 + Basefont Atom = 0x11508 + Bdi Atom = 0x16103 + Bdo Atom = 0x13403 + Bgsound Atom = 0x14707 + Big Atom = 0x15903 + Blink Atom = 0x15c05 + Blockquote Atom = 0x1680a + Body Atom = 0x2804 + Br Atom = 0x202 + Button Atom = 0x17206 + Canvas Atom = 0xbd06 + Caption Atom = 0x21907 + Center Atom = 0x20806 + Challenge Atom = 0x28309 + Charset Atom = 0x2107 + Checked Atom = 0x46d07 + Cite Atom = 0x55804 + Class Atom = 0x5b905 + Code Atom = 0x19004 + Col Atom = 0x19703 + Colgroup Atom = 0x19708 + Color Atom = 0x1af05 + Cols Atom = 0x1b404 + Colspan Atom = 0x1b407 + Command Atom = 0x1c707 + Content Atom = 0x57f07 + Contenteditable Atom = 0x57f0f + Contextmenu Atom = 0x3740b + Controls Atom = 0x1ce08 + Coords Atom = 0x1da06 + Crossorigin Atom = 0x1e30b + Data Atom = 0x49904 + Datalist Atom = 0x49908 + Datetime Atom = 0x2a008 + Dd Atom = 0x2bf02 + Default Atom = 0xc407 + Defer Atom = 0x19205 + Del Atom = 0x44603 + Desc Atom = 0x55504 + Details Atom = 0x4607 + Dfn Atom = 0x5f03 + Dialog Atom = 0x16206 + Dir Atom = 0xa303 + Dirname Atom = 0xa307 + Disabled Atom = 0x14d08 + Div Atom = 0x15403 + Dl Atom = 0x5e202 + Download Atom = 0x45708 + Draggable Atom = 0x18309 + Dropzone Atom = 0x3f908 + Dt Atom = 0x64702 + Em Atom = 0x4202 + Embed Atom = 0x4205 + Enctype Atom = 0x27507 + Face Atom = 0x20604 + Fieldset Atom = 0x20e08 + Figcaption Atom = 0x2160a + Figure Atom = 0x23006 + Font Atom = 0x11904 + Footer Atom = 0xb306 + For Atom = 0x23c03 + ForeignObject Atom = 0x23c0d + Foreignobject Atom = 0x2490d + Form Atom = 0x25604 + Formaction Atom = 0x2560a + Formenctype Atom = 0x2710b + Formmethod Atom = 0x28c0a + Formnovalidate Atom = 0x2960e + Formtarget Atom = 0x2a80a + Frame Atom = 0x5705 + Frameset Atom = 0x5708 + H1 Atom = 0x14502 + H2 Atom = 0x2c602 + H3 Atom = 0x2f502 + H4 Atom = 0x33902 + H5 Atom = 0x34302 + H6 Atom = 0x64902 + Head Atom = 0x32504 + Header Atom = 0x32506 + Headers Atom = 0x32507 + Height Atom = 0x12c06 + Hgroup Atom = 0x2b206 + Hidden Atom = 0x2bd06 + High Atom = 0x2c304 + Hr Atom = 0x14002 + Href Atom = 0x2c804 + Hreflang Atom = 0x2c808 + Html Atom = 0x13004 + HttpEquiv Atom = 0x2d00a + I Atom = 0x601 + Icon Atom = 0x57e04 + Id Atom = 0xc302 + Iframe Atom = 0x2e406 + Image Atom = 0x2ea05 + Img Atom = 0x2ef03 + Input Atom = 0x43f05 + Inputmode Atom = 0x43f09 + Ins Atom = 0x1ec03 + Integrity Atom = 0x22709 + Is Atom = 0x14e02 + Isindex Atom = 0x2f707 + Ismap Atom = 0x2fe05 + Itemid Atom = 0x37f06 + Itemprop Atom = 0x55908 + Itemref Atom = 0x3c107 + Itemscope Atom = 0x66d09 + Itemtype Atom = 0x30708 + Kbd Atom = 0x16003 + Keygen Atom = 0x3206 + Keytype Atom = 0x7e07 + Kind Atom = 0x18004 + Label Atom = 0xda05 + Lang Atom = 0x2cc04 + Legend Atom = 0x18a06 + Li Atom = 0x11102 + Link Atom = 0x15d04 + List Atom = 0x49d04 + Listing Atom = 0x49d07 + Loop Atom = 0xde04 + Low Atom = 0x6b03 + Main Atom = 0x1004 + Malignmark Atom = 0x6d30a + Manifest Atom = 0x30f08 + Map Atom = 0x30003 + Mark Atom = 0x6d904 + Marquee Atom = 0x31b07 + Math Atom = 0x32204 + Max Atom = 0x33103 + Maxlength Atom = 0x33109 + Media Atom = 0x8e05 + Mediagroup Atom = 0x8e0a + Menu Atom = 0x37b04 + Menuitem Atom = 0x37b08 + Meta Atom = 0x4ac04 + Meter Atom = 0xa805 + Method Atom = 0x29006 + Mglyph Atom = 0x2f006 + Mi Atom = 0x33b02 + Min Atom = 0x33b03 + Minlength Atom = 0x33b09 + Mn Atom = 0x29902 + Mo Atom = 0x6302 + Ms Atom = 0x67002 + Mtext Atom = 0x34505 + Multiple Atom = 0x35308 + Muted Atom = 0x35b05 + Name Atom = 0xa604 + Nav Atom = 0x1303 + Nobr Atom = 0x3704 + Noembed Atom = 0x4007 + Noframes Atom = 0x5508 + Nomodule Atom = 0x6108 + Nonce Atom = 0x56205 + Noscript Atom = 0x1fe08 + Novalidate Atom = 0x29a0a + Object Atom = 0x25006 + Ol Atom = 0x10102 + Onabort Atom = 0x17607 + Onafterprint Atom = 0x21e0c + Onautocomplete Atom = 0x25e0e + Onautocompleteerror Atom = 0x25e13 + Onauxclick Atom = 0x61b0a + Onbeforeprint Atom = 0x69a0d + Onbeforeunload Atom = 0x6e10e + Onblur Atom = 0x5c206 + Oncancel Atom = 0xd308 + Oncanplay Atom = 0x13609 + Oncanplaythrough Atom = 0x13610 + Onchange Atom = 0x40f08 + Onclick Atom = 0x2dd07 + Onclose Atom = 0x36007 + Oncontextmenu Atom = 0x3720d + Oncopy Atom = 0x38506 + Oncuechange Atom = 0x38b0b + Oncut Atom = 0x39605 + Ondblclick Atom = 0x39b0a + Ondrag Atom = 0x3a506 + Ondragend Atom = 0x3a509 + Ondragenter Atom = 0x3ae0b + Ondragexit Atom = 0x3b90a + Ondragleave Atom = 0x3d30b + Ondragover Atom = 0x3de0a + Ondragstart Atom = 0x3e80b + Ondrop Atom = 0x3f706 + Ondurationchange Atom = 0x40710 + Onemptied Atom = 0x3fe09 + Onended Atom = 0x41707 + Onerror Atom = 0x41e07 + Onfocus Atom = 0x42507 + Onhashchange Atom = 0x4310c + Oninput Atom = 0x43d07 + Oninvalid Atom = 0x44909 + Onkeydown Atom = 0x45209 + Onkeypress Atom = 0x45f0a + Onkeyup Atom = 0x47407 + Onlanguagechange Atom = 0x48110 + Onload Atom = 0x49106 + Onloadeddata Atom = 0x4910c + Onloadedmetadata Atom = 0x4a410 + Onloadend Atom = 0x4ba09 + Onloadstart Atom = 0x4c30b + Onmessage Atom = 0x4ce09 + Onmessageerror Atom = 0x4ce0e + Onmousedown Atom = 0x4dc0b + Onmouseenter Atom = 0x4e70c + Onmouseleave Atom = 0x4f30c + Onmousemove Atom = 0x4ff0b + Onmouseout Atom = 0x50a0a + Onmouseover Atom = 0x5170b + Onmouseup Atom = 0x52209 + Onmousewheel Atom = 0x5300c + Onoffline Atom = 0x53c09 + Ononline Atom = 0x54508 + Onpagehide Atom = 0x54d0a + Onpageshow Atom = 0x5670a + Onpaste Atom = 0x57307 + Onpause Atom = 0x58e07 + Onplay Atom = 0x59806 + Onplaying Atom = 0x59809 + Onpopstate Atom = 0x5a10a + Onprogress Atom = 0x5ab0a + Onratechange Atom = 0x5c80c + Onrejectionhandled Atom = 0x5d412 + Onreset Atom = 0x5e607 + Onresize Atom = 0x5ed08 + Onscroll Atom = 0x5fc08 + Onsecuritypolicyviolation Atom = 0x60419 + Onseeked Atom = 0x62508 + Onseeking Atom = 0x62d09 + Onselect Atom = 0x63608 + Onshow Atom = 0x64006 + Onsort Atom = 0x64b06 + Onstalled Atom = 0x65509 + Onstorage Atom = 0x65e09 + Onsubmit Atom = 0x66708 + Onsuspend Atom = 0x67709 + Ontimeupdate Atom = 0x11a0c + Ontoggle Atom = 0x68008 + Onunhandledrejection Atom = 0x68814 + Onunload Atom = 0x6a708 + Onvolumechange Atom = 0x6af0e + Onwaiting Atom = 0x6bd09 + Onwheel Atom = 0x6c607 + Open Atom = 0x55f04 + Optgroup Atom = 0xe008 + Optimum Atom = 0x6cd07 + Option Atom = 0x6dd06 + Output Atom = 0x51106 + P Atom = 0xc01 + Param Atom = 0xc05 + Pattern Atom = 0x4f07 + Picture Atom = 0x9707 + Ping Atom = 0xe704 + Placeholder Atom = 0xfb0b + Plaintext Atom = 0x19e09 + Playsinline Atom = 0x10a0b + Poster Atom = 0x2b706 + Pre Atom = 0x46403 + Preload Atom = 0x47a07 + Progress Atom = 0x5ad08 + Prompt Atom = 0x52a06 + Public Atom = 0x57a06 + Q Atom = 0x7701 + Radiogroup Atom = 0x30a + Readonly Atom = 0x34b08 + Referrerpolicy Atom = 0x3c50e + Rel Atom = 0x47b03 + Required Atom = 0x23408 + Reversed Atom = 0x9c08 + Rows Atom = 0x3a04 + Rowspan Atom = 0x3a07 + Rp Atom = 0x22402 + Rt Atom = 0x17b02 + Ruby Atom = 0xac04 + S Atom = 0x2501 + Samp Atom = 0x4c04 + Sandbox Atom = 0xf307 + Scope Atom = 0x67105 + Scoped Atom = 0x67106 + Script Atom = 0x20006 + Seamless Atom = 0x36508 + Section Atom = 0x5bd07 + Select Atom = 0x63806 + Selected Atom = 0x63808 + Shape Atom = 0x1d505 + Size Atom = 0x5f104 + Sizes Atom = 0x5f105 + Slot Atom = 0x1df04 + Small Atom = 0x1ee05 + Sortable Atom = 0x64d08 + Sorted Atom = 0x32b06 + Source Atom = 0x36c06 + Spacer Atom = 0x42b06 + Span Atom = 0x3d04 + Spellcheck Atom = 0x4680a + Src Atom = 0x5b403 + Srcdoc Atom = 0x5b406 + Srclang Atom = 0x5f507 + Srcset Atom = 0x6f306 + Start Atom = 0x3ee05 + Step Atom = 0x57704 + Strike Atom = 0x7a06 + Strong Atom = 0x31506 + Style Atom = 0x6f905 + Sub Atom = 0x66903 + Summary Atom = 0x6fe07 + Sup Atom = 0x70503 + Svg Atom = 0x70803 + System Atom = 0x70b06 + Tabindex Atom = 0x4b208 + Table Atom = 0x58905 + Target Atom = 0x2ac06 + Tbody Atom = 0x2705 + Td Atom = 0x5e02 + Template Atom = 0x70e08 + Textarea Atom = 0x34608 + Tfoot Atom = 0xb205 + Th Atom = 0x13f02 + Thead Atom = 0x32405 + Time Atom = 0x11c04 + Title Atom = 0xca05 + Tr Atom = 0x7402 + Track Atom = 0x17c05 + Translate Atom = 0x1a609 + Tt Atom = 0x5102 + Type Atom = 0x8104 + Typemustmatch Atom = 0x2780d + U Atom = 0xb01 + Ul Atom = 0x6602 + Updateviacache Atom = 0x1200e + Usemap Atom = 0x59206 + Value Atom = 0x1505 + Var Atom = 0x15603 + Video Atom = 0x2d905 + Wbr Atom = 0x57003 + Width Atom = 0x64505 + Workertype Atom = 0x7160a + Wrap Atom = 0x72004 + Xmp Atom = 0xf903 +) + +const hash0 = 0x81cdf10e + +const maxAtomLen = 25 + +var table = [1 << 9]Atom{ + 0x1: 0x8e0a, // mediagroup + 0x2: 0x2cc04, // lang + 0x4: 0x2c09, // accesskey + 0x5: 0x5708, // frameset + 0x7: 0x63608, // onselect + 0x8: 0x70b06, // system + 0xa: 0x64505, // width + 0xc: 0x2710b, // formenctype + 0xd: 0x10102, // ol + 0xe: 0x38b0b, // oncuechange + 0x10: 0x13403, // bdo + 0x11: 0xcf05, // audio + 0x12: 0x18309, // draggable + 0x14: 0x2d905, // video + 0x15: 0x29902, // mn + 0x16: 0x37b04, // menu + 0x17: 0x2b706, // poster + 0x19: 0xb306, // footer + 0x1a: 0x29006, // method + 0x1b: 0x2a008, // datetime + 0x1c: 0x17607, // onabort + 0x1d: 0x1200e, // updateviacache + 0x1e: 0xb905, // async + 0x1f: 0x49106, // onload + 0x21: 0xd308, // oncancel + 0x22: 0x62508, // onseeked + 0x23: 0x2ea05, // image + 0x24: 0x5d412, // onrejectionhandled + 0x26: 0x15d04, // link + 0x27: 0x51106, // output + 0x28: 0x32504, // head + 0x29: 0x4f30c, // onmouseleave + 0x2a: 0x57307, // onpaste + 0x2b: 0x59809, // onplaying + 0x2c: 0x1b407, // colspan + 0x2f: 0x1af05, // color + 0x30: 0x5f104, // size + 0x31: 0x2d00a, // http-equiv + 0x33: 0x601, // i + 0x34: 0x54d0a, // onpagehide + 0x35: 0x68814, // onunhandledrejection + 0x37: 0x41e07, // onerror + 0x3a: 0x11508, // basefont + 0x3f: 0x1303, // nav + 0x40: 0x18004, // kind + 0x41: 0x34b08, // readonly + 0x42: 0x2f006, // mglyph + 0x44: 0x11102, // li + 0x46: 0x2bd06, // hidden + 0x47: 0x70803, // svg + 0x48: 0x57704, // step + 0x49: 0x22709, // integrity + 0x4a: 0x57a06, // public + 0x4c: 0x19703, // col + 0x4d: 0x1680a, // blockquote + 0x4e: 0x34302, // h5 + 0x50: 0x5ad08, // progress + 0x51: 0x5f105, // sizes + 0x52: 0x33902, // h4 + 0x56: 0x32405, // thead + 0x57: 0x7e07, // keytype + 0x58: 0x5ab0a, // onprogress + 0x59: 0x43f09, // inputmode + 0x5a: 0x3a509, // ondragend + 0x5d: 0x39605, // oncut + 0x5e: 0x42b06, // spacer + 0x5f: 0x19708, // colgroup + 0x62: 0x14e02, // is + 0x65: 0xb902, // as + 0x66: 0x53c09, // onoffline + 0x67: 0x32b06, // sorted + 0x69: 0x48110, // onlanguagechange + 0x6c: 0x4310c, // onhashchange + 0x6d: 0xa604, // name + 0x6e: 0xb205, // tfoot + 0x6f: 0x55504, // desc + 0x70: 0x33103, // max + 0x72: 0x1da06, // coords + 0x73: 0x2f502, // h3 + 0x74: 0x6e10e, // onbeforeunload + 0x75: 0x3a04, // rows + 0x76: 0x63806, // select + 0x77: 0xa805, // meter + 0x78: 0x37f06, // itemid + 0x79: 0x5300c, // onmousewheel + 0x7a: 0x5b406, // srcdoc + 0x7d: 0x17c05, // track + 0x7f: 0x30708, // itemtype + 0x82: 0x6302, // mo + 0x83: 0x40f08, // onchange + 0x84: 0x32507, // headers + 0x85: 0x5c80c, // onratechange + 0x86: 0x60419, // onsecuritypolicyviolation + 0x88: 0x49908, // datalist + 0x89: 0x4dc0b, // onmousedown + 0x8a: 0x1df04, // slot + 0x8b: 0x4a410, // onloadedmetadata + 0x8c: 0x1a06, // accept + 0x8d: 0x25006, // object + 0x91: 0x6af0e, // onvolumechange + 0x92: 0x2107, // charset + 0x93: 0x25e13, // onautocompleteerror + 0x94: 0x6913, // allowpaymentrequest + 0x95: 0x2804, // body + 0x96: 0xc407, // default + 0x97: 0x63808, // selected + 0x98: 0x20604, // face + 0x99: 0x1d505, // shape + 0x9b: 0x68008, // ontoggle + 0x9e: 0x64702, // dt + 0x9f: 0x6d904, // mark + 0xa1: 0xb01, // u + 0xa4: 0x6a708, // onunload + 0xa5: 0xde04, // loop + 0xa6: 0x14d08, // disabled + 0xaa: 0x41707, // onended + 0xab: 0x6d30a, // malignmark + 0xad: 0x67709, // onsuspend + 0xae: 0x34505, // mtext + 0xaf: 0x64b06, // onsort + 0xb0: 0x55908, // itemprop + 0xb3: 0x66d09, // itemscope + 0xb4: 0x15c05, // blink + 0xb6: 0x3a506, // ondrag + 0xb7: 0x6602, // ul + 0xb8: 0x25604, // form + 0xb9: 0xf307, // sandbox + 0xba: 0x5705, // frame + 0xbb: 0x1505, // value + 0xbc: 0x65e09, // onstorage + 0xc0: 0x17b02, // rt + 0xc2: 0x202, // br + 0xc3: 0x20e08, // fieldset + 0xc4: 0x2780d, // typemustmatch + 0xc5: 0x6108, // nomodule + 0xc6: 0x4007, // noembed + 0xc7: 0x69a0d, // onbeforeprint + 0xc8: 0x17206, // button + 0xc9: 0x2dd07, // onclick + 0xca: 0x6fe07, // summary + 0xcd: 0xac04, // ruby + 0xce: 0x5b905, // class + 0xcf: 0x3e80b, // ondragstart + 0xd0: 0x21907, // caption + 0xd4: 0x850e, // allowusermedia + 0xd5: 0x4c30b, // onloadstart + 0xd9: 0x15403, // div + 0xda: 0x49d04, // list + 0xdb: 0x32204, // math + 0xdc: 0x43f05, // input + 0xdf: 0x3de0a, // ondragover + 0xe0: 0x2c602, // h2 + 0xe2: 0x19e09, // plaintext + 0xe4: 0x4e70c, // onmouseenter + 0xe7: 0x46d07, // checked + 0xe8: 0x46403, // pre + 0xea: 0x35308, // multiple + 0xeb: 0x16103, // bdi + 0xec: 0x33109, // maxlength + 0xed: 0x7701, // q + 0xee: 0x61b0a, // onauxclick + 0xf0: 0x57003, // wbr + 0xf2: 0x11504, // base + 0xf3: 0x6dd06, // option + 0xf5: 0x40710, // ondurationchange + 0xf7: 0x5508, // noframes + 0xf9: 0x3f908, // dropzone + 0xfb: 0x67105, // scope + 0xfc: 0x9c08, // reversed + 0xfd: 0x3ae0b, // ondragenter + 0xfe: 0x3ee05, // start + 0xff: 0xf903, // xmp + 0x100: 0x5f507, // srclang + 0x101: 0x2ef03, // img + 0x104: 0x101, // b + 0x105: 0x23c03, // for + 0x106: 0xc105, // aside + 0x107: 0x43d07, // oninput + 0x108: 0x34a04, // area + 0x109: 0x28c0a, // formmethod + 0x10a: 0x72004, // wrap + 0x10c: 0x22402, // rp + 0x10d: 0x45f0a, // onkeypress + 0x10e: 0x5102, // tt + 0x110: 0x33b02, // mi + 0x111: 0x35b05, // muted + 0x112: 0xb003, // alt + 0x113: 0x19004, // code + 0x114: 0x4202, // em + 0x115: 0x3b90a, // ondragexit + 0x117: 0x3d04, // span + 0x119: 0x30f08, // manifest + 0x11a: 0x37b08, // menuitem + 0x11b: 0x57f07, // content + 0x11d: 0x6bd09, // onwaiting + 0x11f: 0x4ba09, // onloadend + 0x121: 0x3720d, // oncontextmenu + 0x123: 0x5c206, // onblur + 0x124: 0x3f007, // article + 0x125: 0xa303, // dir + 0x126: 0xe704, // ping + 0x127: 0x23408, // required + 0x128: 0x44909, // oninvalid + 0x129: 0x6d405, // align + 0x12b: 0x57e04, // icon + 0x12c: 0x64902, // h6 + 0x12d: 0x1b404, // cols + 0x12e: 0x2160a, // figcaption + 0x12f: 0x45209, // onkeydown + 0x130: 0x66708, // onsubmit + 0x131: 0x13609, // oncanplay + 0x132: 0x70503, // sup + 0x133: 0xc01, // p + 0x135: 0x3fe09, // onemptied + 0x136: 0x38506, // oncopy + 0x137: 0x55804, // cite + 0x138: 0x39b0a, // ondblclick + 0x13a: 0x4ff0b, // onmousemove + 0x13c: 0x66903, // sub + 0x13d: 0x47b03, // rel + 0x13e: 0xe008, // optgroup + 0x142: 0x3a07, // rowspan + 0x143: 0x36c06, // source + 0x144: 0x1fe08, // noscript + 0x145: 0x55f04, // open + 0x146: 0x1ec03, // ins + 0x147: 0x23c0d, // foreignObject + 0x148: 0x5a10a, // onpopstate + 0x14a: 0x27507, // enctype + 0x14b: 0x25e0e, // onautocomplete + 0x14c: 0x34608, // textarea + 0x14e: 0x2600c, // autocomplete + 0x14f: 0x14002, // hr + 0x150: 0x1ce08, // controls + 0x151: 0xc302, // id + 0x153: 0x21e0c, // onafterprint + 0x155: 0x2490d, // foreignobject + 0x156: 0x31b07, // marquee + 0x157: 0x58e07, // onpause + 0x158: 0x5e202, // dl + 0x159: 0x12c06, // height + 0x15a: 0x33b03, // min + 0x15b: 0xa307, // dirname + 0x15c: 0x1a609, // translate + 0x15d: 0x13004, // html + 0x15e: 0x33b09, // minlength + 0x15f: 0x47a07, // preload + 0x160: 0x70e08, // template + 0x161: 0x3d30b, // ondragleave + 0x164: 0x5b403, // src + 0x165: 0x31506, // strong + 0x167: 0x4c04, // samp + 0x168: 0x6ed07, // address + 0x169: 0x54508, // ononline + 0x16b: 0xfb0b, // placeholder + 0x16c: 0x2ac06, // target + 0x16d: 0x1ee05, // small + 0x16e: 0x6c607, // onwheel + 0x16f: 0x1b90a, // annotation + 0x170: 0x4680a, // spellcheck + 0x171: 0x4607, // details + 0x172: 0xbd06, // canvas + 0x173: 0xeb09, // autofocus + 0x174: 0xc05, // param + 0x176: 0x45708, // download + 0x177: 0x44603, // del + 0x178: 0x36007, // onclose + 0x179: 0x16003, // kbd + 0x17a: 0x30106, // applet + 0x17b: 0x2c804, // href + 0x17c: 0x5ed08, // onresize + 0x17e: 0x4910c, // onloadeddata + 0x180: 0x7402, // tr + 0x181: 0x2a80a, // formtarget + 0x182: 0xca05, // title + 0x183: 0x6f905, // style + 0x184: 0x7a06, // strike + 0x185: 0x59206, // usemap + 0x186: 0x2e406, // iframe + 0x187: 0x1004, // main + 0x189: 0x9707, // picture + 0x18c: 0x2fe05, // ismap + 0x18e: 0x49904, // data + 0x18f: 0xda05, // label + 0x191: 0x3c50e, // referrerpolicy + 0x192: 0x13f02, // th + 0x194: 0x52a06, // prompt + 0x195: 0x5bd07, // section + 0x197: 0x6cd07, // optimum + 0x198: 0x2c304, // high + 0x199: 0x14502, // h1 + 0x19a: 0x65509, // onstalled + 0x19b: 0x15603, // var + 0x19c: 0x11c04, // time + 0x19e: 0x67002, // ms + 0x19f: 0x32506, // header + 0x1a0: 0x4ce09, // onmessage + 0x1a1: 0x56205, // nonce + 0x1a2: 0x2560a, // formaction + 0x1a3: 0x20806, // center + 0x1a4: 0x3704, // nobr + 0x1a5: 0x58905, // table + 0x1a6: 0x49d07, // listing + 0x1a7: 0x18a06, // legend + 0x1a9: 0x28309, // challenge + 0x1aa: 0x23006, // figure + 0x1ab: 0x8e05, // media + 0x1ae: 0x8104, // type + 0x1af: 0x11904, // font + 0x1b0: 0x4ce0e, // onmessageerror + 0x1b1: 0x36508, // seamless + 0x1b2: 0x5f03, // dfn + 0x1b3: 0x19205, // defer + 0x1b4: 0x6b03, // low + 0x1b5: 0x62d09, // onseeking + 0x1b6: 0x5170b, // onmouseover + 0x1b7: 0x29a0a, // novalidate + 0x1b8: 0x7160a, // workertype + 0x1ba: 0x3c107, // itemref + 0x1bd: 0x1, // a + 0x1be: 0x30003, // map + 0x1bf: 0x11a0c, // ontimeupdate + 0x1c0: 0x14707, // bgsound + 0x1c1: 0x3206, // keygen + 0x1c2: 0x2705, // tbody + 0x1c5: 0x64006, // onshow + 0x1c7: 0x2501, // s + 0x1c8: 0x4f07, // pattern + 0x1cc: 0x13610, // oncanplaythrough + 0x1ce: 0x2bf02, // dd + 0x1cf: 0x6f306, // srcset + 0x1d0: 0x15903, // big + 0x1d2: 0x64d08, // sortable + 0x1d3: 0x47407, // onkeyup + 0x1d5: 0x59806, // onplay + 0x1d7: 0x4ac04, // meta + 0x1d8: 0x3f706, // ondrop + 0x1da: 0x5fc08, // onscroll + 0x1db: 0x1e30b, // crossorigin + 0x1dc: 0x5670a, // onpageshow + 0x1dd: 0x4, // abbr + 0x1de: 0x5e02, // td + 0x1df: 0x57f0f, // contenteditable + 0x1e0: 0x25a06, // action + 0x1e1: 0x10a0b, // playsinline + 0x1e2: 0x42507, // onfocus + 0x1e3: 0x2c808, // hreflang + 0x1e5: 0x50a0a, // onmouseout + 0x1e6: 0x5e607, // onreset + 0x1e7: 0x10608, // autoplay + 0x1ea: 0x67106, // scoped + 0x1ec: 0x30a, // radiogroup + 0x1ee: 0x3740b, // contextmenu + 0x1ef: 0x52209, // onmouseup + 0x1f1: 0x2b206, // hgroup + 0x1f2: 0x1f00f, // allowfullscreen + 0x1f3: 0x4b208, // tabindex + 0x1f6: 0x2f707, // isindex + 0x1f7: 0x1a0e, // accept-charset + 0x1f8: 0x2960e, // formnovalidate + 0x1fb: 0x1b90e, // annotation-xml + 0x1fc: 0x4205, // embed + 0x1fd: 0x20006, // script + 0x1fe: 0x16206, // dialog + 0x1ff: 0x1c707, // command +} + +const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobro" + + "wspanoembedetailsampatternoframesetdfnomoduleallowpaymentreq" + + "uestrikeytypeallowusermediagroupictureversedirnameterubyaltf" + + "ooterasyncanvasidefaultitleaudioncancelabelooptgroupingautof" + + "ocusandboxmplaceholderautoplaysinlinebasefontimeupdateviacac" + + "heightmlbdoncanplaythrough1bgsoundisabledivarbigblinkbdialog" + + "blockquotebuttonabortrackindraggablegendcodefercolgrouplaint" + + "extranslatecolorcolspannotation-xmlcommandcontrolshapecoords" + + "lotcrossoriginsmallowfullscreenoscriptfacenterfieldsetfigcap" + + "tionafterprintegrityfigurequiredforeignObjectforeignobjectfo" + + "rmactionautocompleteerrorformenctypemustmatchallengeformmeth" + + "odformnovalidatetimeformtargethgrouposterhiddenhigh2hreflang" + + "http-equivideonclickiframeimageimglyph3isindexismappletitemt" + + "ypemanifestrongmarqueematheadersortedmaxlength4minlength5mte" + + "xtareadonlymultiplemutedoncloseamlessourceoncontextmenuitemi" + + "doncopyoncuechangeoncutondblclickondragendondragenterondrage" + + "xitemreferrerpolicyondragleaveondragoverondragstarticleondro" + + "pzonemptiedondurationchangeonendedonerroronfocuspaceronhashc" + + "hangeoninputmodeloninvalidonkeydownloadonkeypresspellchecked" + + "onkeyupreloadonlanguagechangeonloadeddatalistingonloadedmeta" + + "databindexonloadendonloadstartonmessageerroronmousedownonmou" + + "seenteronmouseleaveonmousemoveonmouseoutputonmouseoveronmous" + + "eupromptonmousewheelonofflineononlineonpagehidescitempropeno" + + "nceonpageshowbronpastepublicontenteditableonpausemaponplayin" + + "gonpopstateonprogressrcdoclassectionbluronratechangeonreject" + + "ionhandledonresetonresizesrclangonscrollonsecuritypolicyviol" + + "ationauxclickonseekedonseekingonselectedonshowidth6onsortabl" + + "eonstalledonstorageonsubmitemscopedonsuspendontoggleonunhand" + + "ledrejectionbeforeprintonunloadonvolumechangeonwaitingonwhee" + + "loptimumalignmarkoptionbeforeunloaddressrcsetstylesummarysup" + + "svgsystemplateworkertypewrap" diff --git a/vendor/golang.org/x/net/html/const.go b/vendor/golang.org/x/net/html/const.go new file mode 100644 index 0000000..b37e621 --- /dev/null +++ b/vendor/golang.org/x/net/html/const.go @@ -0,0 +1,104 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package html + +// Section 12.2.3.2 of the HTML5 specification says "The following elements +// have varying levels of special parsing rules". +// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements +var isSpecialElementMap = map[string]bool{ + "address": true, + "applet": true, + "area": true, + "article": true, + "aside": true, + "base": true, + "basefont": true, + "bgsound": true, + "blockquote": true, + "body": true, + "br": true, + "button": true, + "caption": true, + "center": true, + "col": true, + "colgroup": true, + "dd": true, + "details": true, + "dir": true, + "div": true, + "dl": true, + "dt": true, + "embed": true, + "fieldset": true, + "figcaption": true, + "figure": true, + "footer": true, + "form": true, + "frame": true, + "frameset": true, + "h1": true, + "h2": true, + "h3": true, + "h4": true, + "h5": true, + "h6": true, + "head": true, + "header": true, + "hgroup": true, + "hr": true, + "html": true, + "iframe": true, + "img": true, + "input": true, + "isindex": true, // The 'isindex' element has been removed, but keep it for backwards compatibility. + "keygen": true, + "li": true, + "link": true, + "listing": true, + "main": true, + "marquee": true, + "menu": true, + "meta": true, + "nav": true, + "noembed": true, + "noframes": true, + "noscript": true, + "object": true, + "ol": true, + "p": true, + "param": true, + "plaintext": true, + "pre": true, + "script": true, + "section": true, + "select": true, + "source": true, + "style": true, + "summary": true, + "table": true, + "tbody": true, + "td": true, + "template": true, + "textarea": true, + "tfoot": true, + "th": true, + "thead": true, + "title": true, + "tr": true, + "track": true, + "ul": true, + "wbr": true, + "xmp": true, +} + +func isSpecialElement(element *Node) bool { + switch element.Namespace { + case "", "html": + return isSpecialElementMap[element.Data] + case "svg": + return element.Data == "foreignObject" + } + return false +} diff --git a/vendor/golang.org/x/net/html/doc.go b/vendor/golang.org/x/net/html/doc.go new file mode 100644 index 0000000..94f4968 --- /dev/null +++ b/vendor/golang.org/x/net/html/doc.go @@ -0,0 +1,106 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package html implements an HTML5-compliant tokenizer and parser. + +Tokenization is done by creating a Tokenizer for an io.Reader r. It is the +caller's responsibility to ensure that r provides UTF-8 encoded HTML. + + z := html.NewTokenizer(r) + +Given a Tokenizer z, the HTML is tokenized by repeatedly calling z.Next(), +which parses the next token and returns its type, or an error: + + for { + tt := z.Next() + if tt == html.ErrorToken { + // ... + return ... + } + // Process the current token. + } + +There are two APIs for retrieving the current token. The high-level API is to +call Token; the low-level API is to call Text or TagName / TagAttr. Both APIs +allow optionally calling Raw after Next but before Token, Text, TagName, or +TagAttr. In EBNF notation, the valid call sequence per token is: + + Next {Raw} [ Token | Text | TagName {TagAttr} ] + +Token returns an independent data structure that completely describes a token. +Entities (such as "<") are unescaped, tag names and attribute keys are +lower-cased, and attributes are collected into a []Attribute. For example: + + for { + if z.Next() == html.ErrorToken { + // Returning io.EOF indicates success. + return z.Err() + } + emitToken(z.Token()) + } + +The low-level API performs fewer allocations and copies, but the contents of +the []byte values returned by Text, TagName and TagAttr may change on the next +call to Next. For example, to extract an HTML page's anchor text: + + depth := 0 + for { + tt := z.Next() + switch tt { + case ErrorToken: + return z.Err() + case TextToken: + if depth > 0 { + // emitBytes should copy the []byte it receives, + // if it doesn't process it immediately. + emitBytes(z.Text()) + } + case StartTagToken, EndTagToken: + tn, _ := z.TagName() + if len(tn) == 1 && tn[0] == 'a' { + if tt == StartTagToken { + depth++ + } else { + depth-- + } + } + } + } + +Parsing is done by calling Parse with an io.Reader, which returns the root of +the parse tree (the document element) as a *Node. It is the caller's +responsibility to ensure that the Reader provides UTF-8 encoded HTML. For +example, to process each anchor node in depth-first order: + + doc, err := html.Parse(r) + if err != nil { + // ... + } + var f func(*html.Node) + f = func(n *html.Node) { + if n.Type == html.ElementNode && n.Data == "a" { + // Do something with n... + } + for c := n.FirstChild; c != nil; c = c.NextSibling { + f(c) + } + } + f(doc) + +The relevant specifications include: +https://html.spec.whatwg.org/multipage/syntax.html and +https://html.spec.whatwg.org/multipage/syntax.html#tokenization +*/ +package html // import "golang.org/x/net/html" + +// The tokenization algorithm implemented by this package is not a line-by-line +// transliteration of the relatively verbose state-machine in the WHATWG +// specification. A more direct approach is used instead, where the program +// counter implies the state, such as whether it is tokenizing a tag or a text +// node. Specification compliance is verified by checking expected and actual +// outputs over a test suite rather than aiming for algorithmic fidelity. + +// TODO(nigeltao): Does a DOM API belong in this package or a separate one? +// TODO(nigeltao): How does parsing interact with a JavaScript engine? diff --git a/vendor/golang.org/x/net/html/doctype.go b/vendor/golang.org/x/net/html/doctype.go new file mode 100644 index 0000000..c484e5a --- /dev/null +++ b/vendor/golang.org/x/net/html/doctype.go @@ -0,0 +1,156 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package html + +import ( + "strings" +) + +// parseDoctype parses the data from a DoctypeToken into a name, +// public identifier, and system identifier. It returns a Node whose Type +// is DoctypeNode, whose Data is the name, and which has attributes +// named "system" and "public" for the two identifiers if they were present. +// quirks is whether the document should be parsed in "quirks mode". +func parseDoctype(s string) (n *Node, quirks bool) { + n = &Node{Type: DoctypeNode} + + // Find the name. + space := strings.IndexAny(s, whitespace) + if space == -1 { + space = len(s) + } + n.Data = s[:space] + // The comparison to "html" is case-sensitive. + if n.Data != "html" { + quirks = true + } + n.Data = strings.ToLower(n.Data) + s = strings.TrimLeft(s[space:], whitespace) + + if len(s) < 6 { + // It can't start with "PUBLIC" or "SYSTEM". + // Ignore the rest of the string. + return n, quirks || s != "" + } + + key := strings.ToLower(s[:6]) + s = s[6:] + for key == "public" || key == "system" { + s = strings.TrimLeft(s, whitespace) + if s == "" { + break + } + quote := s[0] + if quote != '"' && quote != '\'' { + break + } + s = s[1:] + q := strings.IndexRune(s, rune(quote)) + var id string + if q == -1 { + id = s + s = "" + } else { + id = s[:q] + s = s[q+1:] + } + n.Attr = append(n.Attr, Attribute{Key: key, Val: id}) + if key == "public" { + key = "system" + } else { + key = "" + } + } + + if key != "" || s != "" { + quirks = true + } else if len(n.Attr) > 0 { + if n.Attr[0].Key == "public" { + public := strings.ToLower(n.Attr[0].Val) + switch public { + case "-//w3o//dtd w3 html strict 3.0//en//", "-/w3d/dtd html 4.0 transitional/en", "html": + quirks = true + default: + for _, q := range quirkyIDs { + if strings.HasPrefix(public, q) { + quirks = true + break + } + } + } + // The following two public IDs only cause quirks mode if there is no system ID. + if len(n.Attr) == 1 && (strings.HasPrefix(public, "-//w3c//dtd html 4.01 frameset//") || + strings.HasPrefix(public, "-//w3c//dtd html 4.01 transitional//")) { + quirks = true + } + } + if lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == "system" && + strings.ToLower(lastAttr.Val) == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" { + quirks = true + } + } + + return n, quirks +} + +// quirkyIDs is a list of public doctype identifiers that cause a document +// to be interpreted in quirks mode. The identifiers should be in lower case. +var quirkyIDs = []string{ + "+//silmaril//dtd html pro v0r11 19970101//", + "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", + "-//as//dtd html 3.0 aswedit + extensions//", + "-//ietf//dtd html 2.0 level 1//", + "-//ietf//dtd html 2.0 level 2//", + "-//ietf//dtd html 2.0 strict level 1//", + "-//ietf//dtd html 2.0 strict level 2//", + "-//ietf//dtd html 2.0 strict//", + "-//ietf//dtd html 2.0//", + "-//ietf//dtd html 2.1e//", + "-//ietf//dtd html 3.0//", + "-//ietf//dtd html 3.2 final//", + "-//ietf//dtd html 3.2//", + "-//ietf//dtd html 3//", + "-//ietf//dtd html level 0//", + "-//ietf//dtd html level 1//", + "-//ietf//dtd html level 2//", + "-//ietf//dtd html level 3//", + "-//ietf//dtd html strict level 0//", + "-//ietf//dtd html strict level 1//", + "-//ietf//dtd html strict level 2//", + "-//ietf//dtd html strict level 3//", + "-//ietf//dtd html strict//", + "-//ietf//dtd html//", + "-//metrius//dtd metrius presentational//", + "-//microsoft//dtd internet explorer 2.0 html strict//", + "-//microsoft//dtd internet explorer 2.0 html//", + "-//microsoft//dtd internet explorer 2.0 tables//", + "-//microsoft//dtd internet explorer 3.0 html strict//", + "-//microsoft//dtd internet explorer 3.0 html//", + "-//microsoft//dtd internet explorer 3.0 tables//", + "-//netscape comm. corp.//dtd html//", + "-//netscape comm. corp.//dtd strict html//", + "-//o'reilly and associates//dtd html 2.0//", + "-//o'reilly and associates//dtd html extended 1.0//", + "-//o'reilly and associates//dtd html extended relaxed 1.0//", + "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", + "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", + "-//spyglass//dtd html 2.0 extended//", + "-//sq//dtd html 2.0 hotmetal + extensions//", + "-//sun microsystems corp.//dtd hotjava html//", + "-//sun microsystems corp.//dtd hotjava strict html//", + "-//w3c//dtd html 3 1995-03-24//", + "-//w3c//dtd html 3.2 draft//", + "-//w3c//dtd html 3.2 final//", + "-//w3c//dtd html 3.2//", + "-//w3c//dtd html 3.2s draft//", + "-//w3c//dtd html 4.0 frameset//", + "-//w3c//dtd html 4.0 transitional//", + "-//w3c//dtd html experimental 19960712//", + "-//w3c//dtd html experimental 970421//", + "-//w3c//dtd w3 html//", + "-//w3o//dtd w3 html 3.0//", + "-//webtechs//dtd mozilla html 2.0//", + "-//webtechs//dtd mozilla html//", +} diff --git a/vendor/golang.org/x/net/html/entity.go b/vendor/golang.org/x/net/html/entity.go new file mode 100644 index 0000000..a50c04c --- /dev/null +++ b/vendor/golang.org/x/net/html/entity.go @@ -0,0 +1,2253 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package html + +// All entities that do not end with ';' are 6 or fewer bytes long. +const longestEntityWithoutSemicolon = 6 + +// entity is a map from HTML entity names to their values. The semicolon matters: +// https://html.spec.whatwg.org/multipage/syntax.html#named-character-references +// lists both "amp" and "amp;" as two separate entries. +// +// Note that the HTML5 list is larger than the HTML4 list at +// http://www.w3.org/TR/html4/sgml/entities.html +var entity = map[string]rune{ + "AElig;": '\U000000C6', + "AMP;": '\U00000026', + "Aacute;": '\U000000C1', + "Abreve;": '\U00000102', + "Acirc;": '\U000000C2', + "Acy;": '\U00000410', + "Afr;": '\U0001D504', + "Agrave;": '\U000000C0', + "Alpha;": '\U00000391', + "Amacr;": '\U00000100', + "And;": '\U00002A53', + "Aogon;": '\U00000104', + "Aopf;": '\U0001D538', + "ApplyFunction;": '\U00002061', + "Aring;": '\U000000C5', + "Ascr;": '\U0001D49C', + "Assign;": '\U00002254', + "Atilde;": '\U000000C3', + "Auml;": '\U000000C4', + "Backslash;": '\U00002216', + "Barv;": '\U00002AE7', + "Barwed;": '\U00002306', + "Bcy;": '\U00000411', + "Because;": '\U00002235', + "Bernoullis;": '\U0000212C', + "Beta;": '\U00000392', + "Bfr;": '\U0001D505', + "Bopf;": '\U0001D539', + "Breve;": '\U000002D8', + "Bscr;": '\U0000212C', + "Bumpeq;": '\U0000224E', + "CHcy;": '\U00000427', + "COPY;": '\U000000A9', + "Cacute;": '\U00000106', + "Cap;": '\U000022D2', + "CapitalDifferentialD;": '\U00002145', + "Cayleys;": '\U0000212D', + "Ccaron;": '\U0000010C', + "Ccedil;": '\U000000C7', + "Ccirc;": '\U00000108', + "Cconint;": '\U00002230', + "Cdot;": '\U0000010A', + "Cedilla;": '\U000000B8', + "CenterDot;": '\U000000B7', + "Cfr;": '\U0000212D', + "Chi;": '\U000003A7', + "CircleDot;": '\U00002299', + "CircleMinus;": '\U00002296', + "CirclePlus;": '\U00002295', + "CircleTimes;": '\U00002297', + "ClockwiseContourIntegral;": '\U00002232', + "CloseCurlyDoubleQuote;": '\U0000201D', + "CloseCurlyQuote;": '\U00002019', + "Colon;": '\U00002237', + "Colone;": '\U00002A74', + "Congruent;": '\U00002261', + "Conint;": '\U0000222F', + "ContourIntegral;": '\U0000222E', + "Copf;": '\U00002102', + "Coproduct;": '\U00002210', + "CounterClockwiseContourIntegral;": '\U00002233', + "Cross;": '\U00002A2F', + "Cscr;": '\U0001D49E', + "Cup;": '\U000022D3', + "CupCap;": '\U0000224D', + "DD;": '\U00002145', + "DDotrahd;": '\U00002911', + "DJcy;": '\U00000402', + "DScy;": '\U00000405', + "DZcy;": '\U0000040F', + "Dagger;": '\U00002021', + "Darr;": '\U000021A1', + "Dashv;": '\U00002AE4', + "Dcaron;": '\U0000010E', + "Dcy;": '\U00000414', + "Del;": '\U00002207', + "Delta;": '\U00000394', + "Dfr;": '\U0001D507', + "DiacriticalAcute;": '\U000000B4', + "DiacriticalDot;": '\U000002D9', + "DiacriticalDoubleAcute;": '\U000002DD', + "DiacriticalGrave;": '\U00000060', + "DiacriticalTilde;": '\U000002DC', + "Diamond;": '\U000022C4', + "DifferentialD;": '\U00002146', + "Dopf;": '\U0001D53B', + "Dot;": '\U000000A8', + "DotDot;": '\U000020DC', + "DotEqual;": '\U00002250', + "DoubleContourIntegral;": '\U0000222F', + "DoubleDot;": '\U000000A8', + "DoubleDownArrow;": '\U000021D3', + "DoubleLeftArrow;": '\U000021D0', + "DoubleLeftRightArrow;": '\U000021D4', + "DoubleLeftTee;": '\U00002AE4', + "DoubleLongLeftArrow;": '\U000027F8', + "DoubleLongLeftRightArrow;": '\U000027FA', + "DoubleLongRightArrow;": '\U000027F9', + "DoubleRightArrow;": '\U000021D2', + "DoubleRightTee;": '\U000022A8', + "DoubleUpArrow;": '\U000021D1', + "DoubleUpDownArrow;": '\U000021D5', + "DoubleVerticalBar;": '\U00002225', + "DownArrow;": '\U00002193', + "DownArrowBar;": '\U00002913', + "DownArrowUpArrow;": '\U000021F5', + "DownBreve;": '\U00000311', + "DownLeftRightVector;": '\U00002950', + "DownLeftTeeVector;": '\U0000295E', + "DownLeftVector;": '\U000021BD', + "DownLeftVectorBar;": '\U00002956', + "DownRightTeeVector;": '\U0000295F', + "DownRightVector;": '\U000021C1', + "DownRightVectorBar;": '\U00002957', + "DownTee;": '\U000022A4', + "DownTeeArrow;": '\U000021A7', + "Downarrow;": '\U000021D3', + "Dscr;": '\U0001D49F', + "Dstrok;": '\U00000110', + "ENG;": '\U0000014A', + "ETH;": '\U000000D0', + "Eacute;": '\U000000C9', + "Ecaron;": '\U0000011A', + "Ecirc;": '\U000000CA', + "Ecy;": '\U0000042D', + "Edot;": '\U00000116', + "Efr;": '\U0001D508', + "Egrave;": '\U000000C8', + "Element;": '\U00002208', + "Emacr;": '\U00000112', + "EmptySmallSquare;": '\U000025FB', + "EmptyVerySmallSquare;": '\U000025AB', + "Eogon;": '\U00000118', + "Eopf;": '\U0001D53C', + "Epsilon;": '\U00000395', + "Equal;": '\U00002A75', + "EqualTilde;": '\U00002242', + "Equilibrium;": '\U000021CC', + "Escr;": '\U00002130', + "Esim;": '\U00002A73', + "Eta;": '\U00000397', + "Euml;": '\U000000CB', + "Exists;": '\U00002203', + "ExponentialE;": '\U00002147', + "Fcy;": '\U00000424', + "Ffr;": '\U0001D509', + "FilledSmallSquare;": '\U000025FC', + "FilledVerySmallSquare;": '\U000025AA', + "Fopf;": '\U0001D53D', + "ForAll;": '\U00002200', + "Fouriertrf;": '\U00002131', + "Fscr;": '\U00002131', + "GJcy;": '\U00000403', + "GT;": '\U0000003E', + "Gamma;": '\U00000393', + "Gammad;": '\U000003DC', + "Gbreve;": '\U0000011E', + "Gcedil;": '\U00000122', + "Gcirc;": '\U0000011C', + "Gcy;": '\U00000413', + "Gdot;": '\U00000120', + "Gfr;": '\U0001D50A', + "Gg;": '\U000022D9', + "Gopf;": '\U0001D53E', + "GreaterEqual;": '\U00002265', + "GreaterEqualLess;": '\U000022DB', + "GreaterFullEqual;": '\U00002267', + "GreaterGreater;": '\U00002AA2', + "GreaterLess;": '\U00002277', + "GreaterSlantEqual;": '\U00002A7E', + "GreaterTilde;": '\U00002273', + "Gscr;": '\U0001D4A2', + "Gt;": '\U0000226B', + "HARDcy;": '\U0000042A', + "Hacek;": '\U000002C7', + "Hat;": '\U0000005E', + "Hcirc;": '\U00000124', + "Hfr;": '\U0000210C', + "HilbertSpace;": '\U0000210B', + "Hopf;": '\U0000210D', + "HorizontalLine;": '\U00002500', + "Hscr;": '\U0000210B', + "Hstrok;": '\U00000126', + "HumpDownHump;": '\U0000224E', + "HumpEqual;": '\U0000224F', + "IEcy;": '\U00000415', + "IJlig;": '\U00000132', + "IOcy;": '\U00000401', + "Iacute;": '\U000000CD', + "Icirc;": '\U000000CE', + "Icy;": '\U00000418', + "Idot;": '\U00000130', + "Ifr;": '\U00002111', + "Igrave;": '\U000000CC', + "Im;": '\U00002111', + "Imacr;": '\U0000012A', + "ImaginaryI;": '\U00002148', + "Implies;": '\U000021D2', + "Int;": '\U0000222C', + "Integral;": '\U0000222B', + "Intersection;": '\U000022C2', + "InvisibleComma;": '\U00002063', + "InvisibleTimes;": '\U00002062', + "Iogon;": '\U0000012E', + "Iopf;": '\U0001D540', + "Iota;": '\U00000399', + "Iscr;": '\U00002110', + "Itilde;": '\U00000128', + "Iukcy;": '\U00000406', + "Iuml;": '\U000000CF', + "Jcirc;": '\U00000134', + "Jcy;": '\U00000419', + "Jfr;": '\U0001D50D', + "Jopf;": '\U0001D541', + "Jscr;": '\U0001D4A5', + "Jsercy;": '\U00000408', + "Jukcy;": '\U00000404', + "KHcy;": '\U00000425', + "KJcy;": '\U0000040C', + "Kappa;": '\U0000039A', + "Kcedil;": '\U00000136', + "Kcy;": '\U0000041A', + "Kfr;": '\U0001D50E', + "Kopf;": '\U0001D542', + "Kscr;": '\U0001D4A6', + "LJcy;": '\U00000409', + "LT;": '\U0000003C', + "Lacute;": '\U00000139', + "Lambda;": '\U0000039B', + "Lang;": '\U000027EA', + "Laplacetrf;": '\U00002112', + "Larr;": '\U0000219E', + "Lcaron;": '\U0000013D', + "Lcedil;": '\U0000013B', + "Lcy;": '\U0000041B', + "LeftAngleBracket;": '\U000027E8', + "LeftArrow;": '\U00002190', + "LeftArrowBar;": '\U000021E4', + "LeftArrowRightArrow;": '\U000021C6', + "LeftCeiling;": '\U00002308', + "LeftDoubleBracket;": '\U000027E6', + "LeftDownTeeVector;": '\U00002961', + "LeftDownVector;": '\U000021C3', + "LeftDownVectorBar;": '\U00002959', + "LeftFloor;": '\U0000230A', + "LeftRightArrow;": '\U00002194', + "LeftRightVector;": '\U0000294E', + "LeftTee;": '\U000022A3', + "LeftTeeArrow;": '\U000021A4', + "LeftTeeVector;": '\U0000295A', + "LeftTriangle;": '\U000022B2', + "LeftTriangleBar;": '\U000029CF', + "LeftTriangleEqual;": '\U000022B4', + "LeftUpDownVector;": '\U00002951', + "LeftUpTeeVector;": '\U00002960', + "LeftUpVector;": '\U000021BF', + "LeftUpVectorBar;": '\U00002958', + "LeftVector;": '\U000021BC', + "LeftVectorBar;": '\U00002952', + "Leftarrow;": '\U000021D0', + "Leftrightarrow;": '\U000021D4', + "LessEqualGreater;": '\U000022DA', + "LessFullEqual;": '\U00002266', + "LessGreater;": '\U00002276', + "LessLess;": '\U00002AA1', + "LessSlantEqual;": '\U00002A7D', + "LessTilde;": '\U00002272', + "Lfr;": '\U0001D50F', + "Ll;": '\U000022D8', + "Lleftarrow;": '\U000021DA', + "Lmidot;": '\U0000013F', + "LongLeftArrow;": '\U000027F5', + "LongLeftRightArrow;": '\U000027F7', + "LongRightArrow;": '\U000027F6', + "Longleftarrow;": '\U000027F8', + "Longleftrightarrow;": '\U000027FA', + "Longrightarrow;": '\U000027F9', + "Lopf;": '\U0001D543', + "LowerLeftArrow;": '\U00002199', + "LowerRightArrow;": '\U00002198', + "Lscr;": '\U00002112', + "Lsh;": '\U000021B0', + "Lstrok;": '\U00000141', + "Lt;": '\U0000226A', + "Map;": '\U00002905', + "Mcy;": '\U0000041C', + "MediumSpace;": '\U0000205F', + "Mellintrf;": '\U00002133', + "Mfr;": '\U0001D510', + "MinusPlus;": '\U00002213', + "Mopf;": '\U0001D544', + "Mscr;": '\U00002133', + "Mu;": '\U0000039C', + "NJcy;": '\U0000040A', + "Nacute;": '\U00000143', + "Ncaron;": '\U00000147', + "Ncedil;": '\U00000145', + "Ncy;": '\U0000041D', + "NegativeMediumSpace;": '\U0000200B', + "NegativeThickSpace;": '\U0000200B', + "NegativeThinSpace;": '\U0000200B', + "NegativeVeryThinSpace;": '\U0000200B', + "NestedGreaterGreater;": '\U0000226B', + "NestedLessLess;": '\U0000226A', + "NewLine;": '\U0000000A', + "Nfr;": '\U0001D511', + "NoBreak;": '\U00002060', + "NonBreakingSpace;": '\U000000A0', + "Nopf;": '\U00002115', + "Not;": '\U00002AEC', + "NotCongruent;": '\U00002262', + "NotCupCap;": '\U0000226D', + "NotDoubleVerticalBar;": '\U00002226', + "NotElement;": '\U00002209', + "NotEqual;": '\U00002260', + "NotExists;": '\U00002204', + "NotGreater;": '\U0000226F', + "NotGreaterEqual;": '\U00002271', + "NotGreaterLess;": '\U00002279', + "NotGreaterTilde;": '\U00002275', + "NotLeftTriangle;": '\U000022EA', + "NotLeftTriangleEqual;": '\U000022EC', + "NotLess;": '\U0000226E', + "NotLessEqual;": '\U00002270', + "NotLessGreater;": '\U00002278', + "NotLessTilde;": '\U00002274', + "NotPrecedes;": '\U00002280', + "NotPrecedesSlantEqual;": '\U000022E0', + "NotReverseElement;": '\U0000220C', + "NotRightTriangle;": '\U000022EB', + "NotRightTriangleEqual;": '\U000022ED', + "NotSquareSubsetEqual;": '\U000022E2', + "NotSquareSupersetEqual;": '\U000022E3', + "NotSubsetEqual;": '\U00002288', + "NotSucceeds;": '\U00002281', + "NotSucceedsSlantEqual;": '\U000022E1', + "NotSupersetEqual;": '\U00002289', + "NotTilde;": '\U00002241', + "NotTildeEqual;": '\U00002244', + "NotTildeFullEqual;": '\U00002247', + "NotTildeTilde;": '\U00002249', + "NotVerticalBar;": '\U00002224', + "Nscr;": '\U0001D4A9', + "Ntilde;": '\U000000D1', + "Nu;": '\U0000039D', + "OElig;": '\U00000152', + "Oacute;": '\U000000D3', + "Ocirc;": '\U000000D4', + "Ocy;": '\U0000041E', + "Odblac;": '\U00000150', + "Ofr;": '\U0001D512', + "Ograve;": '\U000000D2', + "Omacr;": '\U0000014C', + "Omega;": '\U000003A9', + "Omicron;": '\U0000039F', + "Oopf;": '\U0001D546', + "OpenCurlyDoubleQuote;": '\U0000201C', + "OpenCurlyQuote;": '\U00002018', + "Or;": '\U00002A54', + "Oscr;": '\U0001D4AA', + "Oslash;": '\U000000D8', + "Otilde;": '\U000000D5', + "Otimes;": '\U00002A37', + "Ouml;": '\U000000D6', + "OverBar;": '\U0000203E', + "OverBrace;": '\U000023DE', + "OverBracket;": '\U000023B4', + "OverParenthesis;": '\U000023DC', + "PartialD;": '\U00002202', + "Pcy;": '\U0000041F', + "Pfr;": '\U0001D513', + "Phi;": '\U000003A6', + "Pi;": '\U000003A0', + "PlusMinus;": '\U000000B1', + "Poincareplane;": '\U0000210C', + "Popf;": '\U00002119', + "Pr;": '\U00002ABB', + "Precedes;": '\U0000227A', + "PrecedesEqual;": '\U00002AAF', + "PrecedesSlantEqual;": '\U0000227C', + "PrecedesTilde;": '\U0000227E', + "Prime;": '\U00002033', + "Product;": '\U0000220F', + "Proportion;": '\U00002237', + "Proportional;": '\U0000221D', + "Pscr;": '\U0001D4AB', + "Psi;": '\U000003A8', + "QUOT;": '\U00000022', + "Qfr;": '\U0001D514', + "Qopf;": '\U0000211A', + "Qscr;": '\U0001D4AC', + "RBarr;": '\U00002910', + "REG;": '\U000000AE', + "Racute;": '\U00000154', + "Rang;": '\U000027EB', + "Rarr;": '\U000021A0', + "Rarrtl;": '\U00002916', + "Rcaron;": '\U00000158', + "Rcedil;": '\U00000156', + "Rcy;": '\U00000420', + "Re;": '\U0000211C', + "ReverseElement;": '\U0000220B', + "ReverseEquilibrium;": '\U000021CB', + "ReverseUpEquilibrium;": '\U0000296F', + "Rfr;": '\U0000211C', + "Rho;": '\U000003A1', + "RightAngleBracket;": '\U000027E9', + "RightArrow;": '\U00002192', + "RightArrowBar;": '\U000021E5', + "RightArrowLeftArrow;": '\U000021C4', + "RightCeiling;": '\U00002309', + "RightDoubleBracket;": '\U000027E7', + "RightDownTeeVector;": '\U0000295D', + "RightDownVector;": '\U000021C2', + "RightDownVectorBar;": '\U00002955', + "RightFloor;": '\U0000230B', + "RightTee;": '\U000022A2', + "RightTeeArrow;": '\U000021A6', + "RightTeeVector;": '\U0000295B', + "RightTriangle;": '\U000022B3', + "RightTriangleBar;": '\U000029D0', + "RightTriangleEqual;": '\U000022B5', + "RightUpDownVector;": '\U0000294F', + "RightUpTeeVector;": '\U0000295C', + "RightUpVector;": '\U000021BE', + "RightUpVectorBar;": '\U00002954', + "RightVector;": '\U000021C0', + "RightVectorBar;": '\U00002953', + "Rightarrow;": '\U000021D2', + "Ropf;": '\U0000211D', + "RoundImplies;": '\U00002970', + "Rrightarrow;": '\U000021DB', + "Rscr;": '\U0000211B', + "Rsh;": '\U000021B1', + "RuleDelayed;": '\U000029F4', + "SHCHcy;": '\U00000429', + "SHcy;": '\U00000428', + "SOFTcy;": '\U0000042C', + "Sacute;": '\U0000015A', + "Sc;": '\U00002ABC', + "Scaron;": '\U00000160', + "Scedil;": '\U0000015E', + "Scirc;": '\U0000015C', + "Scy;": '\U00000421', + "Sfr;": '\U0001D516', + "ShortDownArrow;": '\U00002193', + "ShortLeftArrow;": '\U00002190', + "ShortRightArrow;": '\U00002192', + "ShortUpArrow;": '\U00002191', + "Sigma;": '\U000003A3', + "SmallCircle;": '\U00002218', + "Sopf;": '\U0001D54A', + "Sqrt;": '\U0000221A', + "Square;": '\U000025A1', + "SquareIntersection;": '\U00002293', + "SquareSubset;": '\U0000228F', + "SquareSubsetEqual;": '\U00002291', + "SquareSuperset;": '\U00002290', + "SquareSupersetEqual;": '\U00002292', + "SquareUnion;": '\U00002294', + "Sscr;": '\U0001D4AE', + "Star;": '\U000022C6', + "Sub;": '\U000022D0', + "Subset;": '\U000022D0', + "SubsetEqual;": '\U00002286', + "Succeeds;": '\U0000227B', + "SucceedsEqual;": '\U00002AB0', + "SucceedsSlantEqual;": '\U0000227D', + "SucceedsTilde;": '\U0000227F', + "SuchThat;": '\U0000220B', + "Sum;": '\U00002211', + "Sup;": '\U000022D1', + "Superset;": '\U00002283', + "SupersetEqual;": '\U00002287', + "Supset;": '\U000022D1', + "THORN;": '\U000000DE', + "TRADE;": '\U00002122', + "TSHcy;": '\U0000040B', + "TScy;": '\U00000426', + "Tab;": '\U00000009', + "Tau;": '\U000003A4', + "Tcaron;": '\U00000164', + "Tcedil;": '\U00000162', + "Tcy;": '\U00000422', + "Tfr;": '\U0001D517', + "Therefore;": '\U00002234', + "Theta;": '\U00000398', + "ThinSpace;": '\U00002009', + "Tilde;": '\U0000223C', + "TildeEqual;": '\U00002243', + "TildeFullEqual;": '\U00002245', + "TildeTilde;": '\U00002248', + "Topf;": '\U0001D54B', + "TripleDot;": '\U000020DB', + "Tscr;": '\U0001D4AF', + "Tstrok;": '\U00000166', + "Uacute;": '\U000000DA', + "Uarr;": '\U0000219F', + "Uarrocir;": '\U00002949', + "Ubrcy;": '\U0000040E', + "Ubreve;": '\U0000016C', + "Ucirc;": '\U000000DB', + "Ucy;": '\U00000423', + "Udblac;": '\U00000170', + "Ufr;": '\U0001D518', + "Ugrave;": '\U000000D9', + "Umacr;": '\U0000016A', + "UnderBar;": '\U0000005F', + "UnderBrace;": '\U000023DF', + "UnderBracket;": '\U000023B5', + "UnderParenthesis;": '\U000023DD', + "Union;": '\U000022C3', + "UnionPlus;": '\U0000228E', + "Uogon;": '\U00000172', + "Uopf;": '\U0001D54C', + "UpArrow;": '\U00002191', + "UpArrowBar;": '\U00002912', + "UpArrowDownArrow;": '\U000021C5', + "UpDownArrow;": '\U00002195', + "UpEquilibrium;": '\U0000296E', + "UpTee;": '\U000022A5', + "UpTeeArrow;": '\U000021A5', + "Uparrow;": '\U000021D1', + "Updownarrow;": '\U000021D5', + "UpperLeftArrow;": '\U00002196', + "UpperRightArrow;": '\U00002197', + "Upsi;": '\U000003D2', + "Upsilon;": '\U000003A5', + "Uring;": '\U0000016E', + "Uscr;": '\U0001D4B0', + "Utilde;": '\U00000168', + "Uuml;": '\U000000DC', + "VDash;": '\U000022AB', + "Vbar;": '\U00002AEB', + "Vcy;": '\U00000412', + "Vdash;": '\U000022A9', + "Vdashl;": '\U00002AE6', + "Vee;": '\U000022C1', + "Verbar;": '\U00002016', + "Vert;": '\U00002016', + "VerticalBar;": '\U00002223', + "VerticalLine;": '\U0000007C', + "VerticalSeparator;": '\U00002758', + "VerticalTilde;": '\U00002240', + "VeryThinSpace;": '\U0000200A', + "Vfr;": '\U0001D519', + "Vopf;": '\U0001D54D', + "Vscr;": '\U0001D4B1', + "Vvdash;": '\U000022AA', + "Wcirc;": '\U00000174', + "Wedge;": '\U000022C0', + "Wfr;": '\U0001D51A', + "Wopf;": '\U0001D54E', + "Wscr;": '\U0001D4B2', + "Xfr;": '\U0001D51B', + "Xi;": '\U0000039E', + "Xopf;": '\U0001D54F', + "Xscr;": '\U0001D4B3', + "YAcy;": '\U0000042F', + "YIcy;": '\U00000407', + "YUcy;": '\U0000042E', + "Yacute;": '\U000000DD', + "Ycirc;": '\U00000176', + "Ycy;": '\U0000042B', + "Yfr;": '\U0001D51C', + "Yopf;": '\U0001D550', + "Yscr;": '\U0001D4B4', + "Yuml;": '\U00000178', + "ZHcy;": '\U00000416', + "Zacute;": '\U00000179', + "Zcaron;": '\U0000017D', + "Zcy;": '\U00000417', + "Zdot;": '\U0000017B', + "ZeroWidthSpace;": '\U0000200B', + "Zeta;": '\U00000396', + "Zfr;": '\U00002128', + "Zopf;": '\U00002124', + "Zscr;": '\U0001D4B5', + "aacute;": '\U000000E1', + "abreve;": '\U00000103', + "ac;": '\U0000223E', + "acd;": '\U0000223F', + "acirc;": '\U000000E2', + "acute;": '\U000000B4', + "acy;": '\U00000430', + "aelig;": '\U000000E6', + "af;": '\U00002061', + "afr;": '\U0001D51E', + "agrave;": '\U000000E0', + "alefsym;": '\U00002135', + "aleph;": '\U00002135', + "alpha;": '\U000003B1', + "amacr;": '\U00000101', + "amalg;": '\U00002A3F', + "amp;": '\U00000026', + "and;": '\U00002227', + "andand;": '\U00002A55', + "andd;": '\U00002A5C', + "andslope;": '\U00002A58', + "andv;": '\U00002A5A', + "ang;": '\U00002220', + "ange;": '\U000029A4', + "angle;": '\U00002220', + "angmsd;": '\U00002221', + "angmsdaa;": '\U000029A8', + "angmsdab;": '\U000029A9', + "angmsdac;": '\U000029AA', + "angmsdad;": '\U000029AB', + "angmsdae;": '\U000029AC', + "angmsdaf;": '\U000029AD', + "angmsdag;": '\U000029AE', + "angmsdah;": '\U000029AF', + "angrt;": '\U0000221F', + "angrtvb;": '\U000022BE', + "angrtvbd;": '\U0000299D', + "angsph;": '\U00002222', + "angst;": '\U000000C5', + "angzarr;": '\U0000237C', + "aogon;": '\U00000105', + "aopf;": '\U0001D552', + "ap;": '\U00002248', + "apE;": '\U00002A70', + "apacir;": '\U00002A6F', + "ape;": '\U0000224A', + "apid;": '\U0000224B', + "apos;": '\U00000027', + "approx;": '\U00002248', + "approxeq;": '\U0000224A', + "aring;": '\U000000E5', + "ascr;": '\U0001D4B6', + "ast;": '\U0000002A', + "asymp;": '\U00002248', + "asympeq;": '\U0000224D', + "atilde;": '\U000000E3', + "auml;": '\U000000E4', + "awconint;": '\U00002233', + "awint;": '\U00002A11', + "bNot;": '\U00002AED', + "backcong;": '\U0000224C', + "backepsilon;": '\U000003F6', + "backprime;": '\U00002035', + "backsim;": '\U0000223D', + "backsimeq;": '\U000022CD', + "barvee;": '\U000022BD', + "barwed;": '\U00002305', + "barwedge;": '\U00002305', + "bbrk;": '\U000023B5', + "bbrktbrk;": '\U000023B6', + "bcong;": '\U0000224C', + "bcy;": '\U00000431', + "bdquo;": '\U0000201E', + "becaus;": '\U00002235', + "because;": '\U00002235', + "bemptyv;": '\U000029B0', + "bepsi;": '\U000003F6', + "bernou;": '\U0000212C', + "beta;": '\U000003B2', + "beth;": '\U00002136', + "between;": '\U0000226C', + "bfr;": '\U0001D51F', + "bigcap;": '\U000022C2', + "bigcirc;": '\U000025EF', + "bigcup;": '\U000022C3', + "bigodot;": '\U00002A00', + "bigoplus;": '\U00002A01', + "bigotimes;": '\U00002A02', + "bigsqcup;": '\U00002A06', + "bigstar;": '\U00002605', + "bigtriangledown;": '\U000025BD', + "bigtriangleup;": '\U000025B3', + "biguplus;": '\U00002A04', + "bigvee;": '\U000022C1', + "bigwedge;": '\U000022C0', + "bkarow;": '\U0000290D', + "blacklozenge;": '\U000029EB', + "blacksquare;": '\U000025AA', + "blacktriangle;": '\U000025B4', + "blacktriangledown;": '\U000025BE', + "blacktriangleleft;": '\U000025C2', + "blacktriangleright;": '\U000025B8', + "blank;": '\U00002423', + "blk12;": '\U00002592', + "blk14;": '\U00002591', + "blk34;": '\U00002593', + "block;": '\U00002588', + "bnot;": '\U00002310', + "bopf;": '\U0001D553', + "bot;": '\U000022A5', + "bottom;": '\U000022A5', + "bowtie;": '\U000022C8', + "boxDL;": '\U00002557', + "boxDR;": '\U00002554', + "boxDl;": '\U00002556', + "boxDr;": '\U00002553', + "boxH;": '\U00002550', + "boxHD;": '\U00002566', + "boxHU;": '\U00002569', + "boxHd;": '\U00002564', + "boxHu;": '\U00002567', + "boxUL;": '\U0000255D', + "boxUR;": '\U0000255A', + "boxUl;": '\U0000255C', + "boxUr;": '\U00002559', + "boxV;": '\U00002551', + "boxVH;": '\U0000256C', + "boxVL;": '\U00002563', + "boxVR;": '\U00002560', + "boxVh;": '\U0000256B', + "boxVl;": '\U00002562', + "boxVr;": '\U0000255F', + "boxbox;": '\U000029C9', + "boxdL;": '\U00002555', + "boxdR;": '\U00002552', + "boxdl;": '\U00002510', + "boxdr;": '\U0000250C', + "boxh;": '\U00002500', + "boxhD;": '\U00002565', + "boxhU;": '\U00002568', + "boxhd;": '\U0000252C', + "boxhu;": '\U00002534', + "boxminus;": '\U0000229F', + "boxplus;": '\U0000229E', + "boxtimes;": '\U000022A0', + "boxuL;": '\U0000255B', + "boxuR;": '\U00002558', + "boxul;": '\U00002518', + "boxur;": '\U00002514', + "boxv;": '\U00002502', + "boxvH;": '\U0000256A', + "boxvL;": '\U00002561', + "boxvR;": '\U0000255E', + "boxvh;": '\U0000253C', + "boxvl;": '\U00002524', + "boxvr;": '\U0000251C', + "bprime;": '\U00002035', + "breve;": '\U000002D8', + "brvbar;": '\U000000A6', + "bscr;": '\U0001D4B7', + "bsemi;": '\U0000204F', + "bsim;": '\U0000223D', + "bsime;": '\U000022CD', + "bsol;": '\U0000005C', + "bsolb;": '\U000029C5', + "bsolhsub;": '\U000027C8', + "bull;": '\U00002022', + "bullet;": '\U00002022', + "bump;": '\U0000224E', + "bumpE;": '\U00002AAE', + "bumpe;": '\U0000224F', + "bumpeq;": '\U0000224F', + "cacute;": '\U00000107', + "cap;": '\U00002229', + "capand;": '\U00002A44', + "capbrcup;": '\U00002A49', + "capcap;": '\U00002A4B', + "capcup;": '\U00002A47', + "capdot;": '\U00002A40', + "caret;": '\U00002041', + "caron;": '\U000002C7', + "ccaps;": '\U00002A4D', + "ccaron;": '\U0000010D', + "ccedil;": '\U000000E7', + "ccirc;": '\U00000109', + "ccups;": '\U00002A4C', + "ccupssm;": '\U00002A50', + "cdot;": '\U0000010B', + "cedil;": '\U000000B8', + "cemptyv;": '\U000029B2', + "cent;": '\U000000A2', + "centerdot;": '\U000000B7', + "cfr;": '\U0001D520', + "chcy;": '\U00000447', + "check;": '\U00002713', + "checkmark;": '\U00002713', + "chi;": '\U000003C7', + "cir;": '\U000025CB', + "cirE;": '\U000029C3', + "circ;": '\U000002C6', + "circeq;": '\U00002257', + "circlearrowleft;": '\U000021BA', + "circlearrowright;": '\U000021BB', + "circledR;": '\U000000AE', + "circledS;": '\U000024C8', + "circledast;": '\U0000229B', + "circledcirc;": '\U0000229A', + "circleddash;": '\U0000229D', + "cire;": '\U00002257', + "cirfnint;": '\U00002A10', + "cirmid;": '\U00002AEF', + "cirscir;": '\U000029C2', + "clubs;": '\U00002663', + "clubsuit;": '\U00002663', + "colon;": '\U0000003A', + "colone;": '\U00002254', + "coloneq;": '\U00002254', + "comma;": '\U0000002C', + "commat;": '\U00000040', + "comp;": '\U00002201', + "compfn;": '\U00002218', + "complement;": '\U00002201', + "complexes;": '\U00002102', + "cong;": '\U00002245', + "congdot;": '\U00002A6D', + "conint;": '\U0000222E', + "copf;": '\U0001D554', + "coprod;": '\U00002210', + "copy;": '\U000000A9', + "copysr;": '\U00002117', + "crarr;": '\U000021B5', + "cross;": '\U00002717', + "cscr;": '\U0001D4B8', + "csub;": '\U00002ACF', + "csube;": '\U00002AD1', + "csup;": '\U00002AD0', + "csupe;": '\U00002AD2', + "ctdot;": '\U000022EF', + "cudarrl;": '\U00002938', + "cudarrr;": '\U00002935', + "cuepr;": '\U000022DE', + "cuesc;": '\U000022DF', + "cularr;": '\U000021B6', + "cularrp;": '\U0000293D', + "cup;": '\U0000222A', + "cupbrcap;": '\U00002A48', + "cupcap;": '\U00002A46', + "cupcup;": '\U00002A4A', + "cupdot;": '\U0000228D', + "cupor;": '\U00002A45', + "curarr;": '\U000021B7', + "curarrm;": '\U0000293C', + "curlyeqprec;": '\U000022DE', + "curlyeqsucc;": '\U000022DF', + "curlyvee;": '\U000022CE', + "curlywedge;": '\U000022CF', + "curren;": '\U000000A4', + "curvearrowleft;": '\U000021B6', + "curvearrowright;": '\U000021B7', + "cuvee;": '\U000022CE', + "cuwed;": '\U000022CF', + "cwconint;": '\U00002232', + "cwint;": '\U00002231', + "cylcty;": '\U0000232D', + "dArr;": '\U000021D3', + "dHar;": '\U00002965', + "dagger;": '\U00002020', + "daleth;": '\U00002138', + "darr;": '\U00002193', + "dash;": '\U00002010', + "dashv;": '\U000022A3', + "dbkarow;": '\U0000290F', + "dblac;": '\U000002DD', + "dcaron;": '\U0000010F', + "dcy;": '\U00000434', + "dd;": '\U00002146', + "ddagger;": '\U00002021', + "ddarr;": '\U000021CA', + "ddotseq;": '\U00002A77', + "deg;": '\U000000B0', + "delta;": '\U000003B4', + "demptyv;": '\U000029B1', + "dfisht;": '\U0000297F', + "dfr;": '\U0001D521', + "dharl;": '\U000021C3', + "dharr;": '\U000021C2', + "diam;": '\U000022C4', + "diamond;": '\U000022C4', + "diamondsuit;": '\U00002666', + "diams;": '\U00002666', + "die;": '\U000000A8', + "digamma;": '\U000003DD', + "disin;": '\U000022F2', + "div;": '\U000000F7', + "divide;": '\U000000F7', + "divideontimes;": '\U000022C7', + "divonx;": '\U000022C7', + "djcy;": '\U00000452', + "dlcorn;": '\U0000231E', + "dlcrop;": '\U0000230D', + "dollar;": '\U00000024', + "dopf;": '\U0001D555', + "dot;": '\U000002D9', + "doteq;": '\U00002250', + "doteqdot;": '\U00002251', + "dotminus;": '\U00002238', + "dotplus;": '\U00002214', + "dotsquare;": '\U000022A1', + "doublebarwedge;": '\U00002306', + "downarrow;": '\U00002193', + "downdownarrows;": '\U000021CA', + "downharpoonleft;": '\U000021C3', + "downharpoonright;": '\U000021C2', + "drbkarow;": '\U00002910', + "drcorn;": '\U0000231F', + "drcrop;": '\U0000230C', + "dscr;": '\U0001D4B9', + "dscy;": '\U00000455', + "dsol;": '\U000029F6', + "dstrok;": '\U00000111', + "dtdot;": '\U000022F1', + "dtri;": '\U000025BF', + "dtrif;": '\U000025BE', + "duarr;": '\U000021F5', + "duhar;": '\U0000296F', + "dwangle;": '\U000029A6', + "dzcy;": '\U0000045F', + "dzigrarr;": '\U000027FF', + "eDDot;": '\U00002A77', + "eDot;": '\U00002251', + "eacute;": '\U000000E9', + "easter;": '\U00002A6E', + "ecaron;": '\U0000011B', + "ecir;": '\U00002256', + "ecirc;": '\U000000EA', + "ecolon;": '\U00002255', + "ecy;": '\U0000044D', + "edot;": '\U00000117', + "ee;": '\U00002147', + "efDot;": '\U00002252', + "efr;": '\U0001D522', + "eg;": '\U00002A9A', + "egrave;": '\U000000E8', + "egs;": '\U00002A96', + "egsdot;": '\U00002A98', + "el;": '\U00002A99', + "elinters;": '\U000023E7', + "ell;": '\U00002113', + "els;": '\U00002A95', + "elsdot;": '\U00002A97', + "emacr;": '\U00000113', + "empty;": '\U00002205', + "emptyset;": '\U00002205', + "emptyv;": '\U00002205', + "emsp;": '\U00002003', + "emsp13;": '\U00002004', + "emsp14;": '\U00002005', + "eng;": '\U0000014B', + "ensp;": '\U00002002', + "eogon;": '\U00000119', + "eopf;": '\U0001D556', + "epar;": '\U000022D5', + "eparsl;": '\U000029E3', + "eplus;": '\U00002A71', + "epsi;": '\U000003B5', + "epsilon;": '\U000003B5', + "epsiv;": '\U000003F5', + "eqcirc;": '\U00002256', + "eqcolon;": '\U00002255', + "eqsim;": '\U00002242', + "eqslantgtr;": '\U00002A96', + "eqslantless;": '\U00002A95', + "equals;": '\U0000003D', + "equest;": '\U0000225F', + "equiv;": '\U00002261', + "equivDD;": '\U00002A78', + "eqvparsl;": '\U000029E5', + "erDot;": '\U00002253', + "erarr;": '\U00002971', + "escr;": '\U0000212F', + "esdot;": '\U00002250', + "esim;": '\U00002242', + "eta;": '\U000003B7', + "eth;": '\U000000F0', + "euml;": '\U000000EB', + "euro;": '\U000020AC', + "excl;": '\U00000021', + "exist;": '\U00002203', + "expectation;": '\U00002130', + "exponentiale;": '\U00002147', + "fallingdotseq;": '\U00002252', + "fcy;": '\U00000444', + "female;": '\U00002640', + "ffilig;": '\U0000FB03', + "fflig;": '\U0000FB00', + "ffllig;": '\U0000FB04', + "ffr;": '\U0001D523', + "filig;": '\U0000FB01', + "flat;": '\U0000266D', + "fllig;": '\U0000FB02', + "fltns;": '\U000025B1', + "fnof;": '\U00000192', + "fopf;": '\U0001D557', + "forall;": '\U00002200', + "fork;": '\U000022D4', + "forkv;": '\U00002AD9', + "fpartint;": '\U00002A0D', + "frac12;": '\U000000BD', + "frac13;": '\U00002153', + "frac14;": '\U000000BC', + "frac15;": '\U00002155', + "frac16;": '\U00002159', + "frac18;": '\U0000215B', + "frac23;": '\U00002154', + "frac25;": '\U00002156', + "frac34;": '\U000000BE', + "frac35;": '\U00002157', + "frac38;": '\U0000215C', + "frac45;": '\U00002158', + "frac56;": '\U0000215A', + "frac58;": '\U0000215D', + "frac78;": '\U0000215E', + "frasl;": '\U00002044', + "frown;": '\U00002322', + "fscr;": '\U0001D4BB', + "gE;": '\U00002267', + "gEl;": '\U00002A8C', + "gacute;": '\U000001F5', + "gamma;": '\U000003B3', + "gammad;": '\U000003DD', + "gap;": '\U00002A86', + "gbreve;": '\U0000011F', + "gcirc;": '\U0000011D', + "gcy;": '\U00000433', + "gdot;": '\U00000121', + "ge;": '\U00002265', + "gel;": '\U000022DB', + "geq;": '\U00002265', + "geqq;": '\U00002267', + "geqslant;": '\U00002A7E', + "ges;": '\U00002A7E', + "gescc;": '\U00002AA9', + "gesdot;": '\U00002A80', + "gesdoto;": '\U00002A82', + "gesdotol;": '\U00002A84', + "gesles;": '\U00002A94', + "gfr;": '\U0001D524', + "gg;": '\U0000226B', + "ggg;": '\U000022D9', + "gimel;": '\U00002137', + "gjcy;": '\U00000453', + "gl;": '\U00002277', + "glE;": '\U00002A92', + "gla;": '\U00002AA5', + "glj;": '\U00002AA4', + "gnE;": '\U00002269', + "gnap;": '\U00002A8A', + "gnapprox;": '\U00002A8A', + "gne;": '\U00002A88', + "gneq;": '\U00002A88', + "gneqq;": '\U00002269', + "gnsim;": '\U000022E7', + "gopf;": '\U0001D558', + "grave;": '\U00000060', + "gscr;": '\U0000210A', + "gsim;": '\U00002273', + "gsime;": '\U00002A8E', + "gsiml;": '\U00002A90', + "gt;": '\U0000003E', + "gtcc;": '\U00002AA7', + "gtcir;": '\U00002A7A', + "gtdot;": '\U000022D7', + "gtlPar;": '\U00002995', + "gtquest;": '\U00002A7C', + "gtrapprox;": '\U00002A86', + "gtrarr;": '\U00002978', + "gtrdot;": '\U000022D7', + "gtreqless;": '\U000022DB', + "gtreqqless;": '\U00002A8C', + "gtrless;": '\U00002277', + "gtrsim;": '\U00002273', + "hArr;": '\U000021D4', + "hairsp;": '\U0000200A', + "half;": '\U000000BD', + "hamilt;": '\U0000210B', + "hardcy;": '\U0000044A', + "harr;": '\U00002194', + "harrcir;": '\U00002948', + "harrw;": '\U000021AD', + "hbar;": '\U0000210F', + "hcirc;": '\U00000125', + "hearts;": '\U00002665', + "heartsuit;": '\U00002665', + "hellip;": '\U00002026', + "hercon;": '\U000022B9', + "hfr;": '\U0001D525', + "hksearow;": '\U00002925', + "hkswarow;": '\U00002926', + "hoarr;": '\U000021FF', + "homtht;": '\U0000223B', + "hookleftarrow;": '\U000021A9', + "hookrightarrow;": '\U000021AA', + "hopf;": '\U0001D559', + "horbar;": '\U00002015', + "hscr;": '\U0001D4BD', + "hslash;": '\U0000210F', + "hstrok;": '\U00000127', + "hybull;": '\U00002043', + "hyphen;": '\U00002010', + "iacute;": '\U000000ED', + "ic;": '\U00002063', + "icirc;": '\U000000EE', + "icy;": '\U00000438', + "iecy;": '\U00000435', + "iexcl;": '\U000000A1', + "iff;": '\U000021D4', + "ifr;": '\U0001D526', + "igrave;": '\U000000EC', + "ii;": '\U00002148', + "iiiint;": '\U00002A0C', + "iiint;": '\U0000222D', + "iinfin;": '\U000029DC', + "iiota;": '\U00002129', + "ijlig;": '\U00000133', + "imacr;": '\U0000012B', + "image;": '\U00002111', + "imagline;": '\U00002110', + "imagpart;": '\U00002111', + "imath;": '\U00000131', + "imof;": '\U000022B7', + "imped;": '\U000001B5', + "in;": '\U00002208', + "incare;": '\U00002105', + "infin;": '\U0000221E', + "infintie;": '\U000029DD', + "inodot;": '\U00000131', + "int;": '\U0000222B', + "intcal;": '\U000022BA', + "integers;": '\U00002124', + "intercal;": '\U000022BA', + "intlarhk;": '\U00002A17', + "intprod;": '\U00002A3C', + "iocy;": '\U00000451', + "iogon;": '\U0000012F', + "iopf;": '\U0001D55A', + "iota;": '\U000003B9', + "iprod;": '\U00002A3C', + "iquest;": '\U000000BF', + "iscr;": '\U0001D4BE', + "isin;": '\U00002208', + "isinE;": '\U000022F9', + "isindot;": '\U000022F5', + "isins;": '\U000022F4', + "isinsv;": '\U000022F3', + "isinv;": '\U00002208', + "it;": '\U00002062', + "itilde;": '\U00000129', + "iukcy;": '\U00000456', + "iuml;": '\U000000EF', + "jcirc;": '\U00000135', + "jcy;": '\U00000439', + "jfr;": '\U0001D527', + "jmath;": '\U00000237', + "jopf;": '\U0001D55B', + "jscr;": '\U0001D4BF', + "jsercy;": '\U00000458', + "jukcy;": '\U00000454', + "kappa;": '\U000003BA', + "kappav;": '\U000003F0', + "kcedil;": '\U00000137', + "kcy;": '\U0000043A', + "kfr;": '\U0001D528', + "kgreen;": '\U00000138', + "khcy;": '\U00000445', + "kjcy;": '\U0000045C', + "kopf;": '\U0001D55C', + "kscr;": '\U0001D4C0', + "lAarr;": '\U000021DA', + "lArr;": '\U000021D0', + "lAtail;": '\U0000291B', + "lBarr;": '\U0000290E', + "lE;": '\U00002266', + "lEg;": '\U00002A8B', + "lHar;": '\U00002962', + "lacute;": '\U0000013A', + "laemptyv;": '\U000029B4', + "lagran;": '\U00002112', + "lambda;": '\U000003BB', + "lang;": '\U000027E8', + "langd;": '\U00002991', + "langle;": '\U000027E8', + "lap;": '\U00002A85', + "laquo;": '\U000000AB', + "larr;": '\U00002190', + "larrb;": '\U000021E4', + "larrbfs;": '\U0000291F', + "larrfs;": '\U0000291D', + "larrhk;": '\U000021A9', + "larrlp;": '\U000021AB', + "larrpl;": '\U00002939', + "larrsim;": '\U00002973', + "larrtl;": '\U000021A2', + "lat;": '\U00002AAB', + "latail;": '\U00002919', + "late;": '\U00002AAD', + "lbarr;": '\U0000290C', + "lbbrk;": '\U00002772', + "lbrace;": '\U0000007B', + "lbrack;": '\U0000005B', + "lbrke;": '\U0000298B', + "lbrksld;": '\U0000298F', + "lbrkslu;": '\U0000298D', + "lcaron;": '\U0000013E', + "lcedil;": '\U0000013C', + "lceil;": '\U00002308', + "lcub;": '\U0000007B', + "lcy;": '\U0000043B', + "ldca;": '\U00002936', + "ldquo;": '\U0000201C', + "ldquor;": '\U0000201E', + "ldrdhar;": '\U00002967', + "ldrushar;": '\U0000294B', + "ldsh;": '\U000021B2', + "le;": '\U00002264', + "leftarrow;": '\U00002190', + "leftarrowtail;": '\U000021A2', + "leftharpoondown;": '\U000021BD', + "leftharpoonup;": '\U000021BC', + "leftleftarrows;": '\U000021C7', + "leftrightarrow;": '\U00002194', + "leftrightarrows;": '\U000021C6', + "leftrightharpoons;": '\U000021CB', + "leftrightsquigarrow;": '\U000021AD', + "leftthreetimes;": '\U000022CB', + "leg;": '\U000022DA', + "leq;": '\U00002264', + "leqq;": '\U00002266', + "leqslant;": '\U00002A7D', + "les;": '\U00002A7D', + "lescc;": '\U00002AA8', + "lesdot;": '\U00002A7F', + "lesdoto;": '\U00002A81', + "lesdotor;": '\U00002A83', + "lesges;": '\U00002A93', + "lessapprox;": '\U00002A85', + "lessdot;": '\U000022D6', + "lesseqgtr;": '\U000022DA', + "lesseqqgtr;": '\U00002A8B', + "lessgtr;": '\U00002276', + "lesssim;": '\U00002272', + "lfisht;": '\U0000297C', + "lfloor;": '\U0000230A', + "lfr;": '\U0001D529', + "lg;": '\U00002276', + "lgE;": '\U00002A91', + "lhard;": '\U000021BD', + "lharu;": '\U000021BC', + "lharul;": '\U0000296A', + "lhblk;": '\U00002584', + "ljcy;": '\U00000459', + "ll;": '\U0000226A', + "llarr;": '\U000021C7', + "llcorner;": '\U0000231E', + "llhard;": '\U0000296B', + "lltri;": '\U000025FA', + "lmidot;": '\U00000140', + "lmoust;": '\U000023B0', + "lmoustache;": '\U000023B0', + "lnE;": '\U00002268', + "lnap;": '\U00002A89', + "lnapprox;": '\U00002A89', + "lne;": '\U00002A87', + "lneq;": '\U00002A87', + "lneqq;": '\U00002268', + "lnsim;": '\U000022E6', + "loang;": '\U000027EC', + "loarr;": '\U000021FD', + "lobrk;": '\U000027E6', + "longleftarrow;": '\U000027F5', + "longleftrightarrow;": '\U000027F7', + "longmapsto;": '\U000027FC', + "longrightarrow;": '\U000027F6', + "looparrowleft;": '\U000021AB', + "looparrowright;": '\U000021AC', + "lopar;": '\U00002985', + "lopf;": '\U0001D55D', + "loplus;": '\U00002A2D', + "lotimes;": '\U00002A34', + "lowast;": '\U00002217', + "lowbar;": '\U0000005F', + "loz;": '\U000025CA', + "lozenge;": '\U000025CA', + "lozf;": '\U000029EB', + "lpar;": '\U00000028', + "lparlt;": '\U00002993', + "lrarr;": '\U000021C6', + "lrcorner;": '\U0000231F', + "lrhar;": '\U000021CB', + "lrhard;": '\U0000296D', + "lrm;": '\U0000200E', + "lrtri;": '\U000022BF', + "lsaquo;": '\U00002039', + "lscr;": '\U0001D4C1', + "lsh;": '\U000021B0', + "lsim;": '\U00002272', + "lsime;": '\U00002A8D', + "lsimg;": '\U00002A8F', + "lsqb;": '\U0000005B', + "lsquo;": '\U00002018', + "lsquor;": '\U0000201A', + "lstrok;": '\U00000142', + "lt;": '\U0000003C', + "ltcc;": '\U00002AA6', + "ltcir;": '\U00002A79', + "ltdot;": '\U000022D6', + "lthree;": '\U000022CB', + "ltimes;": '\U000022C9', + "ltlarr;": '\U00002976', + "ltquest;": '\U00002A7B', + "ltrPar;": '\U00002996', + "ltri;": '\U000025C3', + "ltrie;": '\U000022B4', + "ltrif;": '\U000025C2', + "lurdshar;": '\U0000294A', + "luruhar;": '\U00002966', + "mDDot;": '\U0000223A', + "macr;": '\U000000AF', + "male;": '\U00002642', + "malt;": '\U00002720', + "maltese;": '\U00002720', + "map;": '\U000021A6', + "mapsto;": '\U000021A6', + "mapstodown;": '\U000021A7', + "mapstoleft;": '\U000021A4', + "mapstoup;": '\U000021A5', + "marker;": '\U000025AE', + "mcomma;": '\U00002A29', + "mcy;": '\U0000043C', + "mdash;": '\U00002014', + "measuredangle;": '\U00002221', + "mfr;": '\U0001D52A', + "mho;": '\U00002127', + "micro;": '\U000000B5', + "mid;": '\U00002223', + "midast;": '\U0000002A', + "midcir;": '\U00002AF0', + "middot;": '\U000000B7', + "minus;": '\U00002212', + "minusb;": '\U0000229F', + "minusd;": '\U00002238', + "minusdu;": '\U00002A2A', + "mlcp;": '\U00002ADB', + "mldr;": '\U00002026', + "mnplus;": '\U00002213', + "models;": '\U000022A7', + "mopf;": '\U0001D55E', + "mp;": '\U00002213', + "mscr;": '\U0001D4C2', + "mstpos;": '\U0000223E', + "mu;": '\U000003BC', + "multimap;": '\U000022B8', + "mumap;": '\U000022B8', + "nLeftarrow;": '\U000021CD', + "nLeftrightarrow;": '\U000021CE', + "nRightarrow;": '\U000021CF', + "nVDash;": '\U000022AF', + "nVdash;": '\U000022AE', + "nabla;": '\U00002207', + "nacute;": '\U00000144', + "nap;": '\U00002249', + "napos;": '\U00000149', + "napprox;": '\U00002249', + "natur;": '\U0000266E', + "natural;": '\U0000266E', + "naturals;": '\U00002115', + "nbsp;": '\U000000A0', + "ncap;": '\U00002A43', + "ncaron;": '\U00000148', + "ncedil;": '\U00000146', + "ncong;": '\U00002247', + "ncup;": '\U00002A42', + "ncy;": '\U0000043D', + "ndash;": '\U00002013', + "ne;": '\U00002260', + "neArr;": '\U000021D7', + "nearhk;": '\U00002924', + "nearr;": '\U00002197', + "nearrow;": '\U00002197', + "nequiv;": '\U00002262', + "nesear;": '\U00002928', + "nexist;": '\U00002204', + "nexists;": '\U00002204', + "nfr;": '\U0001D52B', + "nge;": '\U00002271', + "ngeq;": '\U00002271', + "ngsim;": '\U00002275', + "ngt;": '\U0000226F', + "ngtr;": '\U0000226F', + "nhArr;": '\U000021CE', + "nharr;": '\U000021AE', + "nhpar;": '\U00002AF2', + "ni;": '\U0000220B', + "nis;": '\U000022FC', + "nisd;": '\U000022FA', + "niv;": '\U0000220B', + "njcy;": '\U0000045A', + "nlArr;": '\U000021CD', + "nlarr;": '\U0000219A', + "nldr;": '\U00002025', + "nle;": '\U00002270', + "nleftarrow;": '\U0000219A', + "nleftrightarrow;": '\U000021AE', + "nleq;": '\U00002270', + "nless;": '\U0000226E', + "nlsim;": '\U00002274', + "nlt;": '\U0000226E', + "nltri;": '\U000022EA', + "nltrie;": '\U000022EC', + "nmid;": '\U00002224', + "nopf;": '\U0001D55F', + "not;": '\U000000AC', + "notin;": '\U00002209', + "notinva;": '\U00002209', + "notinvb;": '\U000022F7', + "notinvc;": '\U000022F6', + "notni;": '\U0000220C', + "notniva;": '\U0000220C', + "notnivb;": '\U000022FE', + "notnivc;": '\U000022FD', + "npar;": '\U00002226', + "nparallel;": '\U00002226', + "npolint;": '\U00002A14', + "npr;": '\U00002280', + "nprcue;": '\U000022E0', + "nprec;": '\U00002280', + "nrArr;": '\U000021CF', + "nrarr;": '\U0000219B', + "nrightarrow;": '\U0000219B', + "nrtri;": '\U000022EB', + "nrtrie;": '\U000022ED', + "nsc;": '\U00002281', + "nsccue;": '\U000022E1', + "nscr;": '\U0001D4C3', + "nshortmid;": '\U00002224', + "nshortparallel;": '\U00002226', + "nsim;": '\U00002241', + "nsime;": '\U00002244', + "nsimeq;": '\U00002244', + "nsmid;": '\U00002224', + "nspar;": '\U00002226', + "nsqsube;": '\U000022E2', + "nsqsupe;": '\U000022E3', + "nsub;": '\U00002284', + "nsube;": '\U00002288', + "nsubseteq;": '\U00002288', + "nsucc;": '\U00002281', + "nsup;": '\U00002285', + "nsupe;": '\U00002289', + "nsupseteq;": '\U00002289', + "ntgl;": '\U00002279', + "ntilde;": '\U000000F1', + "ntlg;": '\U00002278', + "ntriangleleft;": '\U000022EA', + "ntrianglelefteq;": '\U000022EC', + "ntriangleright;": '\U000022EB', + "ntrianglerighteq;": '\U000022ED', + "nu;": '\U000003BD', + "num;": '\U00000023', + "numero;": '\U00002116', + "numsp;": '\U00002007', + "nvDash;": '\U000022AD', + "nvHarr;": '\U00002904', + "nvdash;": '\U000022AC', + "nvinfin;": '\U000029DE', + "nvlArr;": '\U00002902', + "nvrArr;": '\U00002903', + "nwArr;": '\U000021D6', + "nwarhk;": '\U00002923', + "nwarr;": '\U00002196', + "nwarrow;": '\U00002196', + "nwnear;": '\U00002927', + "oS;": '\U000024C8', + "oacute;": '\U000000F3', + "oast;": '\U0000229B', + "ocir;": '\U0000229A', + "ocirc;": '\U000000F4', + "ocy;": '\U0000043E', + "odash;": '\U0000229D', + "odblac;": '\U00000151', + "odiv;": '\U00002A38', + "odot;": '\U00002299', + "odsold;": '\U000029BC', + "oelig;": '\U00000153', + "ofcir;": '\U000029BF', + "ofr;": '\U0001D52C', + "ogon;": '\U000002DB', + "ograve;": '\U000000F2', + "ogt;": '\U000029C1', + "ohbar;": '\U000029B5', + "ohm;": '\U000003A9', + "oint;": '\U0000222E', + "olarr;": '\U000021BA', + "olcir;": '\U000029BE', + "olcross;": '\U000029BB', + "oline;": '\U0000203E', + "olt;": '\U000029C0', + "omacr;": '\U0000014D', + "omega;": '\U000003C9', + "omicron;": '\U000003BF', + "omid;": '\U000029B6', + "ominus;": '\U00002296', + "oopf;": '\U0001D560', + "opar;": '\U000029B7', + "operp;": '\U000029B9', + "oplus;": '\U00002295', + "or;": '\U00002228', + "orarr;": '\U000021BB', + "ord;": '\U00002A5D', + "order;": '\U00002134', + "orderof;": '\U00002134', + "ordf;": '\U000000AA', + "ordm;": '\U000000BA', + "origof;": '\U000022B6', + "oror;": '\U00002A56', + "orslope;": '\U00002A57', + "orv;": '\U00002A5B', + "oscr;": '\U00002134', + "oslash;": '\U000000F8', + "osol;": '\U00002298', + "otilde;": '\U000000F5', + "otimes;": '\U00002297', + "otimesas;": '\U00002A36', + "ouml;": '\U000000F6', + "ovbar;": '\U0000233D', + "par;": '\U00002225', + "para;": '\U000000B6', + "parallel;": '\U00002225', + "parsim;": '\U00002AF3', + "parsl;": '\U00002AFD', + "part;": '\U00002202', + "pcy;": '\U0000043F', + "percnt;": '\U00000025', + "period;": '\U0000002E', + "permil;": '\U00002030', + "perp;": '\U000022A5', + "pertenk;": '\U00002031', + "pfr;": '\U0001D52D', + "phi;": '\U000003C6', + "phiv;": '\U000003D5', + "phmmat;": '\U00002133', + "phone;": '\U0000260E', + "pi;": '\U000003C0', + "pitchfork;": '\U000022D4', + "piv;": '\U000003D6', + "planck;": '\U0000210F', + "planckh;": '\U0000210E', + "plankv;": '\U0000210F', + "plus;": '\U0000002B', + "plusacir;": '\U00002A23', + "plusb;": '\U0000229E', + "pluscir;": '\U00002A22', + "plusdo;": '\U00002214', + "plusdu;": '\U00002A25', + "pluse;": '\U00002A72', + "plusmn;": '\U000000B1', + "plussim;": '\U00002A26', + "plustwo;": '\U00002A27', + "pm;": '\U000000B1', + "pointint;": '\U00002A15', + "popf;": '\U0001D561', + "pound;": '\U000000A3', + "pr;": '\U0000227A', + "prE;": '\U00002AB3', + "prap;": '\U00002AB7', + "prcue;": '\U0000227C', + "pre;": '\U00002AAF', + "prec;": '\U0000227A', + "precapprox;": '\U00002AB7', + "preccurlyeq;": '\U0000227C', + "preceq;": '\U00002AAF', + "precnapprox;": '\U00002AB9', + "precneqq;": '\U00002AB5', + "precnsim;": '\U000022E8', + "precsim;": '\U0000227E', + "prime;": '\U00002032', + "primes;": '\U00002119', + "prnE;": '\U00002AB5', + "prnap;": '\U00002AB9', + "prnsim;": '\U000022E8', + "prod;": '\U0000220F', + "profalar;": '\U0000232E', + "profline;": '\U00002312', + "profsurf;": '\U00002313', + "prop;": '\U0000221D', + "propto;": '\U0000221D', + "prsim;": '\U0000227E', + "prurel;": '\U000022B0', + "pscr;": '\U0001D4C5', + "psi;": '\U000003C8', + "puncsp;": '\U00002008', + "qfr;": '\U0001D52E', + "qint;": '\U00002A0C', + "qopf;": '\U0001D562', + "qprime;": '\U00002057', + "qscr;": '\U0001D4C6', + "quaternions;": '\U0000210D', + "quatint;": '\U00002A16', + "quest;": '\U0000003F', + "questeq;": '\U0000225F', + "quot;": '\U00000022', + "rAarr;": '\U000021DB', + "rArr;": '\U000021D2', + "rAtail;": '\U0000291C', + "rBarr;": '\U0000290F', + "rHar;": '\U00002964', + "racute;": '\U00000155', + "radic;": '\U0000221A', + "raemptyv;": '\U000029B3', + "rang;": '\U000027E9', + "rangd;": '\U00002992', + "range;": '\U000029A5', + "rangle;": '\U000027E9', + "raquo;": '\U000000BB', + "rarr;": '\U00002192', + "rarrap;": '\U00002975', + "rarrb;": '\U000021E5', + "rarrbfs;": '\U00002920', + "rarrc;": '\U00002933', + "rarrfs;": '\U0000291E', + "rarrhk;": '\U000021AA', + "rarrlp;": '\U000021AC', + "rarrpl;": '\U00002945', + "rarrsim;": '\U00002974', + "rarrtl;": '\U000021A3', + "rarrw;": '\U0000219D', + "ratail;": '\U0000291A', + "ratio;": '\U00002236', + "rationals;": '\U0000211A', + "rbarr;": '\U0000290D', + "rbbrk;": '\U00002773', + "rbrace;": '\U0000007D', + "rbrack;": '\U0000005D', + "rbrke;": '\U0000298C', + "rbrksld;": '\U0000298E', + "rbrkslu;": '\U00002990', + "rcaron;": '\U00000159', + "rcedil;": '\U00000157', + "rceil;": '\U00002309', + "rcub;": '\U0000007D', + "rcy;": '\U00000440', + "rdca;": '\U00002937', + "rdldhar;": '\U00002969', + "rdquo;": '\U0000201D', + "rdquor;": '\U0000201D', + "rdsh;": '\U000021B3', + "real;": '\U0000211C', + "realine;": '\U0000211B', + "realpart;": '\U0000211C', + "reals;": '\U0000211D', + "rect;": '\U000025AD', + "reg;": '\U000000AE', + "rfisht;": '\U0000297D', + "rfloor;": '\U0000230B', + "rfr;": '\U0001D52F', + "rhard;": '\U000021C1', + "rharu;": '\U000021C0', + "rharul;": '\U0000296C', + "rho;": '\U000003C1', + "rhov;": '\U000003F1', + "rightarrow;": '\U00002192', + "rightarrowtail;": '\U000021A3', + "rightharpoondown;": '\U000021C1', + "rightharpoonup;": '\U000021C0', + "rightleftarrows;": '\U000021C4', + "rightleftharpoons;": '\U000021CC', + "rightrightarrows;": '\U000021C9', + "rightsquigarrow;": '\U0000219D', + "rightthreetimes;": '\U000022CC', + "ring;": '\U000002DA', + "risingdotseq;": '\U00002253', + "rlarr;": '\U000021C4', + "rlhar;": '\U000021CC', + "rlm;": '\U0000200F', + "rmoust;": '\U000023B1', + "rmoustache;": '\U000023B1', + "rnmid;": '\U00002AEE', + "roang;": '\U000027ED', + "roarr;": '\U000021FE', + "robrk;": '\U000027E7', + "ropar;": '\U00002986', + "ropf;": '\U0001D563', + "roplus;": '\U00002A2E', + "rotimes;": '\U00002A35', + "rpar;": '\U00000029', + "rpargt;": '\U00002994', + "rppolint;": '\U00002A12', + "rrarr;": '\U000021C9', + "rsaquo;": '\U0000203A', + "rscr;": '\U0001D4C7', + "rsh;": '\U000021B1', + "rsqb;": '\U0000005D', + "rsquo;": '\U00002019', + "rsquor;": '\U00002019', + "rthree;": '\U000022CC', + "rtimes;": '\U000022CA', + "rtri;": '\U000025B9', + "rtrie;": '\U000022B5', + "rtrif;": '\U000025B8', + "rtriltri;": '\U000029CE', + "ruluhar;": '\U00002968', + "rx;": '\U0000211E', + "sacute;": '\U0000015B', + "sbquo;": '\U0000201A', + "sc;": '\U0000227B', + "scE;": '\U00002AB4', + "scap;": '\U00002AB8', + "scaron;": '\U00000161', + "sccue;": '\U0000227D', + "sce;": '\U00002AB0', + "scedil;": '\U0000015F', + "scirc;": '\U0000015D', + "scnE;": '\U00002AB6', + "scnap;": '\U00002ABA', + "scnsim;": '\U000022E9', + "scpolint;": '\U00002A13', + "scsim;": '\U0000227F', + "scy;": '\U00000441', + "sdot;": '\U000022C5', + "sdotb;": '\U000022A1', + "sdote;": '\U00002A66', + "seArr;": '\U000021D8', + "searhk;": '\U00002925', + "searr;": '\U00002198', + "searrow;": '\U00002198', + "sect;": '\U000000A7', + "semi;": '\U0000003B', + "seswar;": '\U00002929', + "setminus;": '\U00002216', + "setmn;": '\U00002216', + "sext;": '\U00002736', + "sfr;": '\U0001D530', + "sfrown;": '\U00002322', + "sharp;": '\U0000266F', + "shchcy;": '\U00000449', + "shcy;": '\U00000448', + "shortmid;": '\U00002223', + "shortparallel;": '\U00002225', + "shy;": '\U000000AD', + "sigma;": '\U000003C3', + "sigmaf;": '\U000003C2', + "sigmav;": '\U000003C2', + "sim;": '\U0000223C', + "simdot;": '\U00002A6A', + "sime;": '\U00002243', + "simeq;": '\U00002243', + "simg;": '\U00002A9E', + "simgE;": '\U00002AA0', + "siml;": '\U00002A9D', + "simlE;": '\U00002A9F', + "simne;": '\U00002246', + "simplus;": '\U00002A24', + "simrarr;": '\U00002972', + "slarr;": '\U00002190', + "smallsetminus;": '\U00002216', + "smashp;": '\U00002A33', + "smeparsl;": '\U000029E4', + "smid;": '\U00002223', + "smile;": '\U00002323', + "smt;": '\U00002AAA', + "smte;": '\U00002AAC', + "softcy;": '\U0000044C', + "sol;": '\U0000002F', + "solb;": '\U000029C4', + "solbar;": '\U0000233F', + "sopf;": '\U0001D564', + "spades;": '\U00002660', + "spadesuit;": '\U00002660', + "spar;": '\U00002225', + "sqcap;": '\U00002293', + "sqcup;": '\U00002294', + "sqsub;": '\U0000228F', + "sqsube;": '\U00002291', + "sqsubset;": '\U0000228F', + "sqsubseteq;": '\U00002291', + "sqsup;": '\U00002290', + "sqsupe;": '\U00002292', + "sqsupset;": '\U00002290', + "sqsupseteq;": '\U00002292', + "squ;": '\U000025A1', + "square;": '\U000025A1', + "squarf;": '\U000025AA', + "squf;": '\U000025AA', + "srarr;": '\U00002192', + "sscr;": '\U0001D4C8', + "ssetmn;": '\U00002216', + "ssmile;": '\U00002323', + "sstarf;": '\U000022C6', + "star;": '\U00002606', + "starf;": '\U00002605', + "straightepsilon;": '\U000003F5', + "straightphi;": '\U000003D5', + "strns;": '\U000000AF', + "sub;": '\U00002282', + "subE;": '\U00002AC5', + "subdot;": '\U00002ABD', + "sube;": '\U00002286', + "subedot;": '\U00002AC3', + "submult;": '\U00002AC1', + "subnE;": '\U00002ACB', + "subne;": '\U0000228A', + "subplus;": '\U00002ABF', + "subrarr;": '\U00002979', + "subset;": '\U00002282', + "subseteq;": '\U00002286', + "subseteqq;": '\U00002AC5', + "subsetneq;": '\U0000228A', + "subsetneqq;": '\U00002ACB', + "subsim;": '\U00002AC7', + "subsub;": '\U00002AD5', + "subsup;": '\U00002AD3', + "succ;": '\U0000227B', + "succapprox;": '\U00002AB8', + "succcurlyeq;": '\U0000227D', + "succeq;": '\U00002AB0', + "succnapprox;": '\U00002ABA', + "succneqq;": '\U00002AB6', + "succnsim;": '\U000022E9', + "succsim;": '\U0000227F', + "sum;": '\U00002211', + "sung;": '\U0000266A', + "sup;": '\U00002283', + "sup1;": '\U000000B9', + "sup2;": '\U000000B2', + "sup3;": '\U000000B3', + "supE;": '\U00002AC6', + "supdot;": '\U00002ABE', + "supdsub;": '\U00002AD8', + "supe;": '\U00002287', + "supedot;": '\U00002AC4', + "suphsol;": '\U000027C9', + "suphsub;": '\U00002AD7', + "suplarr;": '\U0000297B', + "supmult;": '\U00002AC2', + "supnE;": '\U00002ACC', + "supne;": '\U0000228B', + "supplus;": '\U00002AC0', + "supset;": '\U00002283', + "supseteq;": '\U00002287', + "supseteqq;": '\U00002AC6', + "supsetneq;": '\U0000228B', + "supsetneqq;": '\U00002ACC', + "supsim;": '\U00002AC8', + "supsub;": '\U00002AD4', + "supsup;": '\U00002AD6', + "swArr;": '\U000021D9', + "swarhk;": '\U00002926', + "swarr;": '\U00002199', + "swarrow;": '\U00002199', + "swnwar;": '\U0000292A', + "szlig;": '\U000000DF', + "target;": '\U00002316', + "tau;": '\U000003C4', + "tbrk;": '\U000023B4', + "tcaron;": '\U00000165', + "tcedil;": '\U00000163', + "tcy;": '\U00000442', + "tdot;": '\U000020DB', + "telrec;": '\U00002315', + "tfr;": '\U0001D531', + "there4;": '\U00002234', + "therefore;": '\U00002234', + "theta;": '\U000003B8', + "thetasym;": '\U000003D1', + "thetav;": '\U000003D1', + "thickapprox;": '\U00002248', + "thicksim;": '\U0000223C', + "thinsp;": '\U00002009', + "thkap;": '\U00002248', + "thksim;": '\U0000223C', + "thorn;": '\U000000FE', + "tilde;": '\U000002DC', + "times;": '\U000000D7', + "timesb;": '\U000022A0', + "timesbar;": '\U00002A31', + "timesd;": '\U00002A30', + "tint;": '\U0000222D', + "toea;": '\U00002928', + "top;": '\U000022A4', + "topbot;": '\U00002336', + "topcir;": '\U00002AF1', + "topf;": '\U0001D565', + "topfork;": '\U00002ADA', + "tosa;": '\U00002929', + "tprime;": '\U00002034', + "trade;": '\U00002122', + "triangle;": '\U000025B5', + "triangledown;": '\U000025BF', + "triangleleft;": '\U000025C3', + "trianglelefteq;": '\U000022B4', + "triangleq;": '\U0000225C', + "triangleright;": '\U000025B9', + "trianglerighteq;": '\U000022B5', + "tridot;": '\U000025EC', + "trie;": '\U0000225C', + "triminus;": '\U00002A3A', + "triplus;": '\U00002A39', + "trisb;": '\U000029CD', + "tritime;": '\U00002A3B', + "trpezium;": '\U000023E2', + "tscr;": '\U0001D4C9', + "tscy;": '\U00000446', + "tshcy;": '\U0000045B', + "tstrok;": '\U00000167', + "twixt;": '\U0000226C', + "twoheadleftarrow;": '\U0000219E', + "twoheadrightarrow;": '\U000021A0', + "uArr;": '\U000021D1', + "uHar;": '\U00002963', + "uacute;": '\U000000FA', + "uarr;": '\U00002191', + "ubrcy;": '\U0000045E', + "ubreve;": '\U0000016D', + "ucirc;": '\U000000FB', + "ucy;": '\U00000443', + "udarr;": '\U000021C5', + "udblac;": '\U00000171', + "udhar;": '\U0000296E', + "ufisht;": '\U0000297E', + "ufr;": '\U0001D532', + "ugrave;": '\U000000F9', + "uharl;": '\U000021BF', + "uharr;": '\U000021BE', + "uhblk;": '\U00002580', + "ulcorn;": '\U0000231C', + "ulcorner;": '\U0000231C', + "ulcrop;": '\U0000230F', + "ultri;": '\U000025F8', + "umacr;": '\U0000016B', + "uml;": '\U000000A8', + "uogon;": '\U00000173', + "uopf;": '\U0001D566', + "uparrow;": '\U00002191', + "updownarrow;": '\U00002195', + "upharpoonleft;": '\U000021BF', + "upharpoonright;": '\U000021BE', + "uplus;": '\U0000228E', + "upsi;": '\U000003C5', + "upsih;": '\U000003D2', + "upsilon;": '\U000003C5', + "upuparrows;": '\U000021C8', + "urcorn;": '\U0000231D', + "urcorner;": '\U0000231D', + "urcrop;": '\U0000230E', + "uring;": '\U0000016F', + "urtri;": '\U000025F9', + "uscr;": '\U0001D4CA', + "utdot;": '\U000022F0', + "utilde;": '\U00000169', + "utri;": '\U000025B5', + "utrif;": '\U000025B4', + "uuarr;": '\U000021C8', + "uuml;": '\U000000FC', + "uwangle;": '\U000029A7', + "vArr;": '\U000021D5', + "vBar;": '\U00002AE8', + "vBarv;": '\U00002AE9', + "vDash;": '\U000022A8', + "vangrt;": '\U0000299C', + "varepsilon;": '\U000003F5', + "varkappa;": '\U000003F0', + "varnothing;": '\U00002205', + "varphi;": '\U000003D5', + "varpi;": '\U000003D6', + "varpropto;": '\U0000221D', + "varr;": '\U00002195', + "varrho;": '\U000003F1', + "varsigma;": '\U000003C2', + "vartheta;": '\U000003D1', + "vartriangleleft;": '\U000022B2', + "vartriangleright;": '\U000022B3', + "vcy;": '\U00000432', + "vdash;": '\U000022A2', + "vee;": '\U00002228', + "veebar;": '\U000022BB', + "veeeq;": '\U0000225A', + "vellip;": '\U000022EE', + "verbar;": '\U0000007C', + "vert;": '\U0000007C', + "vfr;": '\U0001D533', + "vltri;": '\U000022B2', + "vopf;": '\U0001D567', + "vprop;": '\U0000221D', + "vrtri;": '\U000022B3', + "vscr;": '\U0001D4CB', + "vzigzag;": '\U0000299A', + "wcirc;": '\U00000175', + "wedbar;": '\U00002A5F', + "wedge;": '\U00002227', + "wedgeq;": '\U00002259', + "weierp;": '\U00002118', + "wfr;": '\U0001D534', + "wopf;": '\U0001D568', + "wp;": '\U00002118', + "wr;": '\U00002240', + "wreath;": '\U00002240', + "wscr;": '\U0001D4CC', + "xcap;": '\U000022C2', + "xcirc;": '\U000025EF', + "xcup;": '\U000022C3', + "xdtri;": '\U000025BD', + "xfr;": '\U0001D535', + "xhArr;": '\U000027FA', + "xharr;": '\U000027F7', + "xi;": '\U000003BE', + "xlArr;": '\U000027F8', + "xlarr;": '\U000027F5', + "xmap;": '\U000027FC', + "xnis;": '\U000022FB', + "xodot;": '\U00002A00', + "xopf;": '\U0001D569', + "xoplus;": '\U00002A01', + "xotime;": '\U00002A02', + "xrArr;": '\U000027F9', + "xrarr;": '\U000027F6', + "xscr;": '\U0001D4CD', + "xsqcup;": '\U00002A06', + "xuplus;": '\U00002A04', + "xutri;": '\U000025B3', + "xvee;": '\U000022C1', + "xwedge;": '\U000022C0', + "yacute;": '\U000000FD', + "yacy;": '\U0000044F', + "ycirc;": '\U00000177', + "ycy;": '\U0000044B', + "yen;": '\U000000A5', + "yfr;": '\U0001D536', + "yicy;": '\U00000457', + "yopf;": '\U0001D56A', + "yscr;": '\U0001D4CE', + "yucy;": '\U0000044E', + "yuml;": '\U000000FF', + "zacute;": '\U0000017A', + "zcaron;": '\U0000017E', + "zcy;": '\U00000437', + "zdot;": '\U0000017C', + "zeetrf;": '\U00002128', + "zeta;": '\U000003B6', + "zfr;": '\U0001D537', + "zhcy;": '\U00000436', + "zigrarr;": '\U000021DD', + "zopf;": '\U0001D56B', + "zscr;": '\U0001D4CF', + "zwj;": '\U0000200D', + "zwnj;": '\U0000200C', + "AElig": '\U000000C6', + "AMP": '\U00000026', + "Aacute": '\U000000C1', + "Acirc": '\U000000C2', + "Agrave": '\U000000C0', + "Aring": '\U000000C5', + "Atilde": '\U000000C3', + "Auml": '\U000000C4', + "COPY": '\U000000A9', + "Ccedil": '\U000000C7', + "ETH": '\U000000D0', + "Eacute": '\U000000C9', + "Ecirc": '\U000000CA', + "Egrave": '\U000000C8', + "Euml": '\U000000CB', + "GT": '\U0000003E', + "Iacute": '\U000000CD', + "Icirc": '\U000000CE', + "Igrave": '\U000000CC', + "Iuml": '\U000000CF', + "LT": '\U0000003C', + "Ntilde": '\U000000D1', + "Oacute": '\U000000D3', + "Ocirc": '\U000000D4', + "Ograve": '\U000000D2', + "Oslash": '\U000000D8', + "Otilde": '\U000000D5', + "Ouml": '\U000000D6', + "QUOT": '\U00000022', + "REG": '\U000000AE', + "THORN": '\U000000DE', + "Uacute": '\U000000DA', + "Ucirc": '\U000000DB', + "Ugrave": '\U000000D9', + "Uuml": '\U000000DC', + "Yacute": '\U000000DD', + "aacute": '\U000000E1', + "acirc": '\U000000E2', + "acute": '\U000000B4', + "aelig": '\U000000E6', + "agrave": '\U000000E0', + "amp": '\U00000026', + "aring": '\U000000E5', + "atilde": '\U000000E3', + "auml": '\U000000E4', + "brvbar": '\U000000A6', + "ccedil": '\U000000E7', + "cedil": '\U000000B8', + "cent": '\U000000A2', + "copy": '\U000000A9', + "curren": '\U000000A4', + "deg": '\U000000B0', + "divide": '\U000000F7', + "eacute": '\U000000E9', + "ecirc": '\U000000EA', + "egrave": '\U000000E8', + "eth": '\U000000F0', + "euml": '\U000000EB', + "frac12": '\U000000BD', + "frac14": '\U000000BC', + "frac34": '\U000000BE', + "gt": '\U0000003E', + "iacute": '\U000000ED', + "icirc": '\U000000EE', + "iexcl": '\U000000A1', + "igrave": '\U000000EC', + "iquest": '\U000000BF', + "iuml": '\U000000EF', + "laquo": '\U000000AB', + "lt": '\U0000003C', + "macr": '\U000000AF', + "micro": '\U000000B5', + "middot": '\U000000B7', + "nbsp": '\U000000A0', + "not": '\U000000AC', + "ntilde": '\U000000F1', + "oacute": '\U000000F3', + "ocirc": '\U000000F4', + "ograve": '\U000000F2', + "ordf": '\U000000AA', + "ordm": '\U000000BA', + "oslash": '\U000000F8', + "otilde": '\U000000F5', + "ouml": '\U000000F6', + "para": '\U000000B6', + "plusmn": '\U000000B1', + "pound": '\U000000A3', + "quot": '\U00000022', + "raquo": '\U000000BB', + "reg": '\U000000AE', + "sect": '\U000000A7', + "shy": '\U000000AD', + "sup1": '\U000000B9', + "sup2": '\U000000B2', + "sup3": '\U000000B3', + "szlig": '\U000000DF', + "thorn": '\U000000FE', + "times": '\U000000D7', + "uacute": '\U000000FA', + "ucirc": '\U000000FB', + "ugrave": '\U000000F9', + "uml": '\U000000A8', + "uuml": '\U000000FC', + "yacute": '\U000000FD', + "yen": '\U000000A5', + "yuml": '\U000000FF', +} + +// HTML entities that are two unicode codepoints. +var entity2 = map[string][2]rune{ + // TODO(nigeltao): Handle replacements that are wider than their names. + // "nLt;": {'\u226A', '\u20D2'}, + // "nGt;": {'\u226B', '\u20D2'}, + "NotEqualTilde;": {'\u2242', '\u0338'}, + "NotGreaterFullEqual;": {'\u2267', '\u0338'}, + "NotGreaterGreater;": {'\u226B', '\u0338'}, + "NotGreaterSlantEqual;": {'\u2A7E', '\u0338'}, + "NotHumpDownHump;": {'\u224E', '\u0338'}, + "NotHumpEqual;": {'\u224F', '\u0338'}, + "NotLeftTriangleBar;": {'\u29CF', '\u0338'}, + "NotLessLess;": {'\u226A', '\u0338'}, + "NotLessSlantEqual;": {'\u2A7D', '\u0338'}, + "NotNestedGreaterGreater;": {'\u2AA2', '\u0338'}, + "NotNestedLessLess;": {'\u2AA1', '\u0338'}, + "NotPrecedesEqual;": {'\u2AAF', '\u0338'}, + "NotRightTriangleBar;": {'\u29D0', '\u0338'}, + "NotSquareSubset;": {'\u228F', '\u0338'}, + "NotSquareSuperset;": {'\u2290', '\u0338'}, + "NotSubset;": {'\u2282', '\u20D2'}, + "NotSucceedsEqual;": {'\u2AB0', '\u0338'}, + "NotSucceedsTilde;": {'\u227F', '\u0338'}, + "NotSuperset;": {'\u2283', '\u20D2'}, + "ThickSpace;": {'\u205F', '\u200A'}, + "acE;": {'\u223E', '\u0333'}, + "bne;": {'\u003D', '\u20E5'}, + "bnequiv;": {'\u2261', '\u20E5'}, + "caps;": {'\u2229', '\uFE00'}, + "cups;": {'\u222A', '\uFE00'}, + "fjlig;": {'\u0066', '\u006A'}, + "gesl;": {'\u22DB', '\uFE00'}, + "gvertneqq;": {'\u2269', '\uFE00'}, + "gvnE;": {'\u2269', '\uFE00'}, + "lates;": {'\u2AAD', '\uFE00'}, + "lesg;": {'\u22DA', '\uFE00'}, + "lvertneqq;": {'\u2268', '\uFE00'}, + "lvnE;": {'\u2268', '\uFE00'}, + "nGg;": {'\u22D9', '\u0338'}, + "nGtv;": {'\u226B', '\u0338'}, + "nLl;": {'\u22D8', '\u0338'}, + "nLtv;": {'\u226A', '\u0338'}, + "nang;": {'\u2220', '\u20D2'}, + "napE;": {'\u2A70', '\u0338'}, + "napid;": {'\u224B', '\u0338'}, + "nbump;": {'\u224E', '\u0338'}, + "nbumpe;": {'\u224F', '\u0338'}, + "ncongdot;": {'\u2A6D', '\u0338'}, + "nedot;": {'\u2250', '\u0338'}, + "nesim;": {'\u2242', '\u0338'}, + "ngE;": {'\u2267', '\u0338'}, + "ngeqq;": {'\u2267', '\u0338'}, + "ngeqslant;": {'\u2A7E', '\u0338'}, + "nges;": {'\u2A7E', '\u0338'}, + "nlE;": {'\u2266', '\u0338'}, + "nleqq;": {'\u2266', '\u0338'}, + "nleqslant;": {'\u2A7D', '\u0338'}, + "nles;": {'\u2A7D', '\u0338'}, + "notinE;": {'\u22F9', '\u0338'}, + "notindot;": {'\u22F5', '\u0338'}, + "nparsl;": {'\u2AFD', '\u20E5'}, + "npart;": {'\u2202', '\u0338'}, + "npre;": {'\u2AAF', '\u0338'}, + "npreceq;": {'\u2AAF', '\u0338'}, + "nrarrc;": {'\u2933', '\u0338'}, + "nrarrw;": {'\u219D', '\u0338'}, + "nsce;": {'\u2AB0', '\u0338'}, + "nsubE;": {'\u2AC5', '\u0338'}, + "nsubset;": {'\u2282', '\u20D2'}, + "nsubseteqq;": {'\u2AC5', '\u0338'}, + "nsucceq;": {'\u2AB0', '\u0338'}, + "nsupE;": {'\u2AC6', '\u0338'}, + "nsupset;": {'\u2283', '\u20D2'}, + "nsupseteqq;": {'\u2AC6', '\u0338'}, + "nvap;": {'\u224D', '\u20D2'}, + "nvge;": {'\u2265', '\u20D2'}, + "nvgt;": {'\u003E', '\u20D2'}, + "nvle;": {'\u2264', '\u20D2'}, + "nvlt;": {'\u003C', '\u20D2'}, + "nvltrie;": {'\u22B4', '\u20D2'}, + "nvrtrie;": {'\u22B5', '\u20D2'}, + "nvsim;": {'\u223C', '\u20D2'}, + "race;": {'\u223D', '\u0331'}, + "smtes;": {'\u2AAC', '\uFE00'}, + "sqcaps;": {'\u2293', '\uFE00'}, + "sqcups;": {'\u2294', '\uFE00'}, + "varsubsetneq;": {'\u228A', '\uFE00'}, + "varsubsetneqq;": {'\u2ACB', '\uFE00'}, + "varsupsetneq;": {'\u228B', '\uFE00'}, + "varsupsetneqq;": {'\u2ACC', '\uFE00'}, + "vnsub;": {'\u2282', '\u20D2'}, + "vnsup;": {'\u2283', '\u20D2'}, + "vsubnE;": {'\u2ACB', '\uFE00'}, + "vsubne;": {'\u228A', '\uFE00'}, + "vsupnE;": {'\u2ACC', '\uFE00'}, + "vsupne;": {'\u228B', '\uFE00'}, +} diff --git a/vendor/golang.org/x/net/html/escape.go b/vendor/golang.org/x/net/html/escape.go new file mode 100644 index 0000000..d856139 --- /dev/null +++ b/vendor/golang.org/x/net/html/escape.go @@ -0,0 +1,258 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package html + +import ( + "bytes" + "strings" + "unicode/utf8" +) + +// These replacements permit compatibility with old numeric entities that +// assumed Windows-1252 encoding. +// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference +var replacementTable = [...]rune{ + '\u20AC', // First entry is what 0x80 should be replaced with. + '\u0081', + '\u201A', + '\u0192', + '\u201E', + '\u2026', + '\u2020', + '\u2021', + '\u02C6', + '\u2030', + '\u0160', + '\u2039', + '\u0152', + '\u008D', + '\u017D', + '\u008F', + '\u0090', + '\u2018', + '\u2019', + '\u201C', + '\u201D', + '\u2022', + '\u2013', + '\u2014', + '\u02DC', + '\u2122', + '\u0161', + '\u203A', + '\u0153', + '\u009D', + '\u017E', + '\u0178', // Last entry is 0x9F. + // 0x00->'\uFFFD' is handled programmatically. + // 0x0D->'\u000D' is a no-op. +} + +// unescapeEntity reads an entity like "<" from b[src:] and writes the +// corresponding "<" to b[dst:], returning the incremented dst and src cursors. +// Precondition: b[src] == '&' && dst <= src. +// attribute should be true if parsing an attribute value. +func unescapeEntity(b []byte, dst, src int, attribute bool) (dst1, src1 int) { + // https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference + + // i starts at 1 because we already know that s[0] == '&'. + i, s := 1, b[src:] + + if len(s) <= 1 { + b[dst] = b[src] + return dst + 1, src + 1 + } + + if s[i] == '#' { + if len(s) <= 3 { // We need to have at least "&#.". + b[dst] = b[src] + return dst + 1, src + 1 + } + i++ + c := s[i] + hex := false + if c == 'x' || c == 'X' { + hex = true + i++ + } + + x := '\x00' + for i < len(s) { + c = s[i] + i++ + if hex { + if '0' <= c && c <= '9' { + x = 16*x + rune(c) - '0' + continue + } else if 'a' <= c && c <= 'f' { + x = 16*x + rune(c) - 'a' + 10 + continue + } else if 'A' <= c && c <= 'F' { + x = 16*x + rune(c) - 'A' + 10 + continue + } + } else if '0' <= c && c <= '9' { + x = 10*x + rune(c) - '0' + continue + } + if c != ';' { + i-- + } + break + } + + if i <= 3 { // No characters matched. + b[dst] = b[src] + return dst + 1, src + 1 + } + + if 0x80 <= x && x <= 0x9F { + // Replace characters from Windows-1252 with UTF-8 equivalents. + x = replacementTable[x-0x80] + } else if x == 0 || (0xD800 <= x && x <= 0xDFFF) || x > 0x10FFFF { + // Replace invalid characters with the replacement character. + x = '\uFFFD' + } + + return dst + utf8.EncodeRune(b[dst:], x), src + i + } + + // Consume the maximum number of characters possible, with the + // consumed characters matching one of the named references. + + for i < len(s) { + c := s[i] + i++ + // Lower-cased characters are more common in entities, so we check for them first. + if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { + continue + } + if c != ';' { + i-- + } + break + } + + entityName := string(s[1:i]) + if entityName == "" { + // No-op. + } else if attribute && entityName[len(entityName)-1] != ';' && len(s) > i && s[i] == '=' { + // No-op. + } else if x := entity[entityName]; x != 0 { + return dst + utf8.EncodeRune(b[dst:], x), src + i + } else if x := entity2[entityName]; x[0] != 0 { + dst1 := dst + utf8.EncodeRune(b[dst:], x[0]) + return dst1 + utf8.EncodeRune(b[dst1:], x[1]), src + i + } else if !attribute { + maxLen := len(entityName) - 1 + if maxLen > longestEntityWithoutSemicolon { + maxLen = longestEntityWithoutSemicolon + } + for j := maxLen; j > 1; j-- { + if x := entity[entityName[:j]]; x != 0 { + return dst + utf8.EncodeRune(b[dst:], x), src + j + 1 + } + } + } + + dst1, src1 = dst+i, src+i + copy(b[dst:dst1], b[src:src1]) + return dst1, src1 +} + +// unescape unescapes b's entities in-place, so that "a<b" becomes "a': + esc = ">" + case '"': + // """ is shorter than """. + esc = """ + case '\r': + esc = " " + default: + panic("unrecognized escape character") + } + s = s[i+1:] + if _, err := w.WriteString(esc); err != nil { + return err + } + i = strings.IndexAny(s, escapedChars) + } + _, err := w.WriteString(s) + return err +} + +// EscapeString escapes special characters like "<" to become "<". It +// escapes only five such characters: <, >, &, ' and ". +// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't +// always true. +func EscapeString(s string) string { + if strings.IndexAny(s, escapedChars) == -1 { + return s + } + var buf bytes.Buffer + escape(&buf, s) + return buf.String() +} + +// UnescapeString unescapes entities like "<" to become "<". It unescapes a +// larger range of entities than EscapeString escapes. For example, "á" +// unescapes to "á", as does "á" and "&xE1;". +// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't +// always true. +func UnescapeString(s string) string { + for _, c := range s { + if c == '&' { + return string(unescape([]byte(s), false)) + } + } + return s +} diff --git a/vendor/golang.org/x/net/html/foreign.go b/vendor/golang.org/x/net/html/foreign.go new file mode 100644 index 0000000..d3b3844 --- /dev/null +++ b/vendor/golang.org/x/net/html/foreign.go @@ -0,0 +1,226 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package html + +import ( + "strings" +) + +func adjustAttributeNames(aa []Attribute, nameMap map[string]string) { + for i := range aa { + if newName, ok := nameMap[aa[i].Key]; ok { + aa[i].Key = newName + } + } +} + +func adjustForeignAttributes(aa []Attribute) { + for i, a := range aa { + if a.Key == "" || a.Key[0] != 'x' { + continue + } + switch a.Key { + case "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show", + "xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns:xlink": + j := strings.Index(a.Key, ":") + aa[i].Namespace = a.Key[:j] + aa[i].Key = a.Key[j+1:] + } + } +} + +func htmlIntegrationPoint(n *Node) bool { + if n.Type != ElementNode { + return false + } + switch n.Namespace { + case "math": + if n.Data == "annotation-xml" { + for _, a := range n.Attr { + if a.Key == "encoding" { + val := strings.ToLower(a.Val) + if val == "text/html" || val == "application/xhtml+xml" { + return true + } + } + } + } + case "svg": + switch n.Data { + case "desc", "foreignObject", "title": + return true + } + } + return false +} + +func mathMLTextIntegrationPoint(n *Node) bool { + if n.Namespace != "math" { + return false + } + switch n.Data { + case "mi", "mo", "mn", "ms", "mtext": + return true + } + return false +} + +// Section 12.2.5.5. +var breakout = map[string]bool{ + "b": true, + "big": true, + "blockquote": true, + "body": true, + "br": true, + "center": true, + "code": true, + "dd": true, + "div": true, + "dl": true, + "dt": true, + "em": true, + "embed": true, + "h1": true, + "h2": true, + "h3": true, + "h4": true, + "h5": true, + "h6": true, + "head": true, + "hr": true, + "i": true, + "img": true, + "li": true, + "listing": true, + "menu": true, + "meta": true, + "nobr": true, + "ol": true, + "p": true, + "pre": true, + "ruby": true, + "s": true, + "small": true, + "span": true, + "strong": true, + "strike": true, + "sub": true, + "sup": true, + "table": true, + "tt": true, + "u": true, + "ul": true, + "var": true, +} + +// Section 12.2.5.5. +var svgTagNameAdjustments = map[string]string{ + "altglyph": "altGlyph", + "altglyphdef": "altGlyphDef", + "altglyphitem": "altGlyphItem", + "animatecolor": "animateColor", + "animatemotion": "animateMotion", + "animatetransform": "animateTransform", + "clippath": "clipPath", + "feblend": "feBlend", + "fecolormatrix": "feColorMatrix", + "fecomponenttransfer": "feComponentTransfer", + "fecomposite": "feComposite", + "feconvolvematrix": "feConvolveMatrix", + "fediffuselighting": "feDiffuseLighting", + "fedisplacementmap": "feDisplacementMap", + "fedistantlight": "feDistantLight", + "feflood": "feFlood", + "fefunca": "feFuncA", + "fefuncb": "feFuncB", + "fefuncg": "feFuncG", + "fefuncr": "feFuncR", + "fegaussianblur": "feGaussianBlur", + "feimage": "feImage", + "femerge": "feMerge", + "femergenode": "feMergeNode", + "femorphology": "feMorphology", + "feoffset": "feOffset", + "fepointlight": "fePointLight", + "fespecularlighting": "feSpecularLighting", + "fespotlight": "feSpotLight", + "fetile": "feTile", + "feturbulence": "feTurbulence", + "foreignobject": "foreignObject", + "glyphref": "glyphRef", + "lineargradient": "linearGradient", + "radialgradient": "radialGradient", + "textpath": "textPath", +} + +// Section 12.2.5.1 +var mathMLAttributeAdjustments = map[string]string{ + "definitionurl": "definitionURL", +} + +var svgAttributeAdjustments = map[string]string{ + "attributename": "attributeName", + "attributetype": "attributeType", + "basefrequency": "baseFrequency", + "baseprofile": "baseProfile", + "calcmode": "calcMode", + "clippathunits": "clipPathUnits", + "contentscripttype": "contentScriptType", + "contentstyletype": "contentStyleType", + "diffuseconstant": "diffuseConstant", + "edgemode": "edgeMode", + "externalresourcesrequired": "externalResourcesRequired", + "filterres": "filterRes", + "filterunits": "filterUnits", + "glyphref": "glyphRef", + "gradienttransform": "gradientTransform", + "gradientunits": "gradientUnits", + "kernelmatrix": "kernelMatrix", + "kernelunitlength": "kernelUnitLength", + "keypoints": "keyPoints", + "keysplines": "keySplines", + "keytimes": "keyTimes", + "lengthadjust": "lengthAdjust", + "limitingconeangle": "limitingConeAngle", + "markerheight": "markerHeight", + "markerunits": "markerUnits", + "markerwidth": "markerWidth", + "maskcontentunits": "maskContentUnits", + "maskunits": "maskUnits", + "numoctaves": "numOctaves", + "pathlength": "pathLength", + "patterncontentunits": "patternContentUnits", + "patterntransform": "patternTransform", + "patternunits": "patternUnits", + "pointsatx": "pointsAtX", + "pointsaty": "pointsAtY", + "pointsatz": "pointsAtZ", + "preservealpha": "preserveAlpha", + "preserveaspectratio": "preserveAspectRatio", + "primitiveunits": "primitiveUnits", + "refx": "refX", + "refy": "refY", + "repeatcount": "repeatCount", + "repeatdur": "repeatDur", + "requiredextensions": "requiredExtensions", + "requiredfeatures": "requiredFeatures", + "specularconstant": "specularConstant", + "specularexponent": "specularExponent", + "spreadmethod": "spreadMethod", + "startoffset": "startOffset", + "stddeviation": "stdDeviation", + "stitchtiles": "stitchTiles", + "surfacescale": "surfaceScale", + "systemlanguage": "systemLanguage", + "tablevalues": "tableValues", + "targetx": "targetX", + "targety": "targetY", + "textlength": "textLength", + "viewbox": "viewBox", + "viewtarget": "viewTarget", + "xchannelselector": "xChannelSelector", + "ychannelselector": "yChannelSelector", + "zoomandpan": "zoomAndPan", +} diff --git a/vendor/golang.org/x/net/html/node.go b/vendor/golang.org/x/net/html/node.go new file mode 100644 index 0000000..26b657a --- /dev/null +++ b/vendor/golang.org/x/net/html/node.go @@ -0,0 +1,193 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package html + +import ( + "golang.org/x/net/html/atom" +) + +// A NodeType is the type of a Node. +type NodeType uint32 + +const ( + ErrorNode NodeType = iota + TextNode + DocumentNode + ElementNode + CommentNode + DoctypeNode + scopeMarkerNode +) + +// Section 12.2.3.3 says "scope markers are inserted when entering applet +// elements, buttons, object elements, marquees, table cells, and table +// captions, and are used to prevent formatting from 'leaking'". +var scopeMarker = Node{Type: scopeMarkerNode} + +// A Node consists of a NodeType and some Data (tag name for element nodes, +// content for text) and are part of a tree of Nodes. Element nodes may also +// have a Namespace and contain a slice of Attributes. Data is unescaped, so +// that it looks like "a 0 { + return (*s)[i-1] + } + return nil +} + +// index returns the index of the top-most occurrence of n in the stack, or -1 +// if n is not present. +func (s *nodeStack) index(n *Node) int { + for i := len(*s) - 1; i >= 0; i-- { + if (*s)[i] == n { + return i + } + } + return -1 +} + +// insert inserts a node at the given index. +func (s *nodeStack) insert(i int, n *Node) { + (*s) = append(*s, nil) + copy((*s)[i+1:], (*s)[i:]) + (*s)[i] = n +} + +// remove removes a node from the stack. It is a no-op if n is not present. +func (s *nodeStack) remove(n *Node) { + i := s.index(n) + if i == -1 { + return + } + copy((*s)[i:], (*s)[i+1:]) + j := len(*s) - 1 + (*s)[j] = nil + *s = (*s)[:j] +} diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go new file mode 100644 index 0000000..be4b2bf --- /dev/null +++ b/vendor/golang.org/x/net/html/parse.go @@ -0,0 +1,2094 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package html + +import ( + "errors" + "fmt" + "io" + "strings" + + a "golang.org/x/net/html/atom" +) + +// A parser implements the HTML5 parsing algorithm: +// https://html.spec.whatwg.org/multipage/syntax.html#tree-construction +type parser struct { + // tokenizer provides the tokens for the parser. + tokenizer *Tokenizer + // tok is the most recently read token. + tok Token + // Self-closing tags like
are treated as start tags, except that + // hasSelfClosingToken is set while they are being processed. + hasSelfClosingToken bool + // doc is the document root element. + doc *Node + // The stack of open elements (section 12.2.3.2) and active formatting + // elements (section 12.2.3.3). + oe, afe nodeStack + // Element pointers (section 12.2.3.4). + head, form *Node + // Other parsing state flags (section 12.2.3.5). + scripting, framesetOK bool + // im is the current insertion mode. + im insertionMode + // originalIM is the insertion mode to go back to after completing a text + // or inTableText insertion mode. + originalIM insertionMode + // fosterParenting is whether new elements should be inserted according to + // the foster parenting rules (section 12.2.5.3). + fosterParenting bool + // quirks is whether the parser is operating in "quirks mode." + quirks bool + // fragment is whether the parser is parsing an HTML fragment. + fragment bool + // context is the context element when parsing an HTML fragment + // (section 12.4). + context *Node +} + +func (p *parser) top() *Node { + if n := p.oe.top(); n != nil { + return n + } + return p.doc +} + +// Stop tags for use in popUntil. These come from section 12.2.3.2. +var ( + defaultScopeStopTags = map[string][]a.Atom{ + "": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template}, + "math": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext}, + "svg": {a.Desc, a.ForeignObject, a.Title}, + } +) + +type scope int + +const ( + defaultScope scope = iota + listItemScope + buttonScope + tableScope + tableRowScope + tableBodyScope + selectScope +) + +// popUntil pops the stack of open elements at the highest element whose tag +// is in matchTags, provided there is no higher element in the scope's stop +// tags (as defined in section 12.2.3.2). It returns whether or not there was +// such an element. If there was not, popUntil leaves the stack unchanged. +// +// For example, the set of stop tags for table scope is: "html", "table". If +// the stack was: +// ["html", "body", "font", "table", "b", "i", "u"] +// then popUntil(tableScope, "font") would return false, but +// popUntil(tableScope, "i") would return true and the stack would become: +// ["html", "body", "font", "table", "b"] +// +// If an element's tag is in both the stop tags and matchTags, then the stack +// will be popped and the function returns true (provided, of course, there was +// no higher element in the stack that was also in the stop tags). For example, +// popUntil(tableScope, "table") returns true and leaves: +// ["html", "body", "font"] +func (p *parser) popUntil(s scope, matchTags ...a.Atom) bool { + if i := p.indexOfElementInScope(s, matchTags...); i != -1 { + p.oe = p.oe[:i] + return true + } + return false +} + +// indexOfElementInScope returns the index in p.oe of the highest element whose +// tag is in matchTags that is in scope. If no matching element is in scope, it +// returns -1. +func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { + for i := len(p.oe) - 1; i >= 0; i-- { + tagAtom := p.oe[i].DataAtom + if p.oe[i].Namespace == "" { + for _, t := range matchTags { + if t == tagAtom { + return i + } + } + switch s { + case defaultScope: + // No-op. + case listItemScope: + if tagAtom == a.Ol || tagAtom == a.Ul { + return -1 + } + case buttonScope: + if tagAtom == a.Button { + return -1 + } + case tableScope: + if tagAtom == a.Html || tagAtom == a.Table { + return -1 + } + case selectScope: + if tagAtom != a.Optgroup && tagAtom != a.Option { + return -1 + } + default: + panic("unreachable") + } + } + switch s { + case defaultScope, listItemScope, buttonScope: + for _, t := range defaultScopeStopTags[p.oe[i].Namespace] { + if t == tagAtom { + return -1 + } + } + } + } + return -1 +} + +// elementInScope is like popUntil, except that it doesn't modify the stack of +// open elements. +func (p *parser) elementInScope(s scope, matchTags ...a.Atom) bool { + return p.indexOfElementInScope(s, matchTags...) != -1 +} + +// clearStackToContext pops elements off the stack of open elements until a +// scope-defined element is found. +func (p *parser) clearStackToContext(s scope) { + for i := len(p.oe) - 1; i >= 0; i-- { + tagAtom := p.oe[i].DataAtom + switch s { + case tableScope: + if tagAtom == a.Html || tagAtom == a.Table { + p.oe = p.oe[:i+1] + return + } + case tableRowScope: + if tagAtom == a.Html || tagAtom == a.Tr { + p.oe = p.oe[:i+1] + return + } + case tableBodyScope: + if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead { + p.oe = p.oe[:i+1] + return + } + default: + panic("unreachable") + } + } +} + +// generateImpliedEndTags pops nodes off the stack of open elements as long as +// the top node has a tag name of dd, dt, li, option, optgroup, p, rp, or rt. +// If exceptions are specified, nodes with that name will not be popped off. +func (p *parser) generateImpliedEndTags(exceptions ...string) { + var i int +loop: + for i = len(p.oe) - 1; i >= 0; i-- { + n := p.oe[i] + if n.Type == ElementNode { + switch n.DataAtom { + case a.Dd, a.Dt, a.Li, a.Option, a.Optgroup, a.P, a.Rp, a.Rt: + for _, except := range exceptions { + if n.Data == except { + break loop + } + } + continue + } + } + break + } + + p.oe = p.oe[:i+1] +} + +// addChild adds a child node n to the top element, and pushes n onto the stack +// of open elements if it is an element node. +func (p *parser) addChild(n *Node) { + if p.shouldFosterParent() { + p.fosterParent(n) + } else { + p.top().AppendChild(n) + } + + if n.Type == ElementNode { + p.oe = append(p.oe, n) + } +} + +// shouldFosterParent returns whether the next node to be added should be +// foster parented. +func (p *parser) shouldFosterParent() bool { + if p.fosterParenting { + switch p.top().DataAtom { + case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: + return true + } + } + return false +} + +// fosterParent adds a child node according to the foster parenting rules. +// Section 12.2.5.3, "foster parenting". +func (p *parser) fosterParent(n *Node) { + var table, parent, prev *Node + var i int + for i = len(p.oe) - 1; i >= 0; i-- { + if p.oe[i].DataAtom == a.Table { + table = p.oe[i] + break + } + } + + if table == nil { + // The foster parent is the html element. + parent = p.oe[0] + } else { + parent = table.Parent + } + if parent == nil { + parent = p.oe[i-1] + } + + if table != nil { + prev = table.PrevSibling + } else { + prev = parent.LastChild + } + if prev != nil && prev.Type == TextNode && n.Type == TextNode { + prev.Data += n.Data + return + } + + parent.InsertBefore(n, table) +} + +// addText adds text to the preceding node if it is a text node, or else it +// calls addChild with a new text node. +func (p *parser) addText(text string) { + if text == "" { + return + } + + if p.shouldFosterParent() { + p.fosterParent(&Node{ + Type: TextNode, + Data: text, + }) + return + } + + t := p.top() + if n := t.LastChild; n != nil && n.Type == TextNode { + n.Data += text + return + } + p.addChild(&Node{ + Type: TextNode, + Data: text, + }) +} + +// addElement adds a child element based on the current token. +func (p *parser) addElement() { + p.addChild(&Node{ + Type: ElementNode, + DataAtom: p.tok.DataAtom, + Data: p.tok.Data, + Attr: p.tok.Attr, + }) +} + +// Section 12.2.3.3. +func (p *parser) addFormattingElement() { + tagAtom, attr := p.tok.DataAtom, p.tok.Attr + p.addElement() + + // Implement the Noah's Ark clause, but with three per family instead of two. + identicalElements := 0 +findIdenticalElements: + for i := len(p.afe) - 1; i >= 0; i-- { + n := p.afe[i] + if n.Type == scopeMarkerNode { + break + } + if n.Type != ElementNode { + continue + } + if n.Namespace != "" { + continue + } + if n.DataAtom != tagAtom { + continue + } + if len(n.Attr) != len(attr) { + continue + } + compareAttributes: + for _, t0 := range n.Attr { + for _, t1 := range attr { + if t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val { + // Found a match for this attribute, continue with the next attribute. + continue compareAttributes + } + } + // If we get here, there is no attribute that matches a. + // Therefore the element is not identical to the new one. + continue findIdenticalElements + } + + identicalElements++ + if identicalElements >= 3 { + p.afe.remove(n) + } + } + + p.afe = append(p.afe, p.top()) +} + +// Section 12.2.3.3. +func (p *parser) clearActiveFormattingElements() { + for { + n := p.afe.pop() + if len(p.afe) == 0 || n.Type == scopeMarkerNode { + return + } + } +} + +// Section 12.2.3.3. +func (p *parser) reconstructActiveFormattingElements() { + n := p.afe.top() + if n == nil { + return + } + if n.Type == scopeMarkerNode || p.oe.index(n) != -1 { + return + } + i := len(p.afe) - 1 + for n.Type != scopeMarkerNode && p.oe.index(n) == -1 { + if i == 0 { + i = -1 + break + } + i-- + n = p.afe[i] + } + for { + i++ + clone := p.afe[i].clone() + p.addChild(clone) + p.afe[i] = clone + if i == len(p.afe)-1 { + break + } + } +} + +// Section 12.2.4. +func (p *parser) acknowledgeSelfClosingTag() { + p.hasSelfClosingToken = false +} + +// An insertion mode (section 12.2.3.1) is the state transition function from +// a particular state in the HTML5 parser's state machine. It updates the +// parser's fields depending on parser.tok (where ErrorToken means EOF). +// It returns whether the token was consumed. +type insertionMode func(*parser) bool + +// setOriginalIM sets the insertion mode to return to after completing a text or +// inTableText insertion mode. +// Section 12.2.3.1, "using the rules for". +func (p *parser) setOriginalIM() { + if p.originalIM != nil { + panic("html: bad parser state: originalIM was set twice") + } + p.originalIM = p.im +} + +// Section 12.2.3.1, "reset the insertion mode". +func (p *parser) resetInsertionMode() { + for i := len(p.oe) - 1; i >= 0; i-- { + n := p.oe[i] + if i == 0 && p.context != nil { + n = p.context + } + + switch n.DataAtom { + case a.Select: + p.im = inSelectIM + case a.Td, a.Th: + p.im = inCellIM + case a.Tr: + p.im = inRowIM + case a.Tbody, a.Thead, a.Tfoot: + p.im = inTableBodyIM + case a.Caption: + p.im = inCaptionIM + case a.Colgroup: + p.im = inColumnGroupIM + case a.Table: + p.im = inTableIM + case a.Head: + p.im = inBodyIM + case a.Body: + p.im = inBodyIM + case a.Frameset: + p.im = inFramesetIM + case a.Html: + p.im = beforeHeadIM + default: + continue + } + return + } + p.im = inBodyIM +} + +const whitespace = " \t\r\n\f" + +// Section 12.2.5.4.1. +func initialIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case CommentToken: + p.doc.AppendChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + n, quirks := parseDoctype(p.tok.Data) + p.doc.AppendChild(n) + p.quirks = quirks + p.im = beforeHTMLIM + return true + } + p.quirks = true + p.im = beforeHTMLIM + return false +} + +// Section 12.2.5.4.2. +func beforeHTMLIM(p *parser) bool { + switch p.tok.Type { + case DoctypeToken: + // Ignore the token. + return true + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case StartTagToken: + if p.tok.DataAtom == a.Html { + p.addElement() + p.im = beforeHeadIM + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head, a.Body, a.Html, a.Br: + p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.doc.AppendChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + } + p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) + return false +} + +// Section 12.2.5.4.3. +func beforeHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Head: + p.addElement() + p.head = p.top() + p.im = inHeadIM + return true + case a.Html: + return inBodyIM(p) + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head, a.Body, a.Html, a.Br: + p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) + return false +} + +// Section 12.2.5.4.4. +func inHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + s := strings.TrimLeft(p.tok.Data, whitespace) + if len(s) < len(p.tok.Data) { + // Add the initial whitespace to the current node. + p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) + if s == "" { + return true + } + p.tok.Data = s + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Html: + return inBodyIM(p) + case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta: + p.addElement() + p.oe.pop() + p.acknowledgeSelfClosingTag() + return true + case a.Script, a.Title, a.Noscript, a.Noframes, a.Style: + p.addElement() + p.setOriginalIM() + p.im = textIM + return true + case a.Head: + // Ignore the token. + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head: + n := p.oe.pop() + if n.DataAtom != a.Head { + panic("html: bad parser state: element not found, in the in-head insertion mode") + } + p.im = afterHeadIM + return true + case a.Body, a.Html, a.Br: + p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) + return false +} + +// Section 12.2.5.4.6. +func afterHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + s := strings.TrimLeft(p.tok.Data, whitespace) + if len(s) < len(p.tok.Data) { + // Add the initial whitespace to the current node. + p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) + if s == "" { + return true + } + p.tok.Data = s + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Html: + return inBodyIM(p) + case a.Body: + p.addElement() + p.framesetOK = false + p.im = inBodyIM + return true + case a.Frameset: + p.addElement() + p.im = inFramesetIM + return true + case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: + p.oe = append(p.oe, p.head) + defer p.oe.remove(p.head) + return inHeadIM(p) + case a.Head: + // Ignore the token. + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Body, a.Html, a.Br: + // Drop down to creating an implied tag. + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(StartTagToken, a.Body, a.Body.String()) + p.framesetOK = true + return false +} + +// copyAttributes copies attributes of src not found on dst to dst. +func copyAttributes(dst *Node, src Token) { + if len(src.Attr) == 0 { + return + } + attr := map[string]string{} + for _, t := range dst.Attr { + attr[t.Key] = t.Val + } + for _, t := range src.Attr { + if _, ok := attr[t.Key]; !ok { + dst.Attr = append(dst.Attr, t) + attr[t.Key] = t.Val + } + } +} + +// Section 12.2.5.4.7. +func inBodyIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + d := p.tok.Data + switch n := p.oe.top(); n.DataAtom { + case a.Pre, a.Listing: + if n.FirstChild == nil { + // Ignore a newline at the start of a
 block.
+				if d != "" && d[0] == '\r' {
+					d = d[1:]
+				}
+				if d != "" && d[0] == '\n' {
+					d = d[1:]
+				}
+			}
+		}
+		d = strings.Replace(d, "\x00", "", -1)
+		if d == "" {
+			return true
+		}
+		p.reconstructActiveFormattingElements()
+		p.addText(d)
+		if p.framesetOK && strings.TrimLeft(d, whitespace) != "" {
+			// There were non-whitespace characters inserted.
+			p.framesetOK = false
+		}
+	case StartTagToken:
+		switch p.tok.DataAtom {
+		case a.Html:
+			copyAttributes(p.oe[0], p.tok)
+		case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title:
+			return inHeadIM(p)
+		case a.Body:
+			if len(p.oe) >= 2 {
+				body := p.oe[1]
+				if body.Type == ElementNode && body.DataAtom == a.Body {
+					p.framesetOK = false
+					copyAttributes(body, p.tok)
+				}
+			}
+		case a.Frameset:
+			if !p.framesetOK || len(p.oe) < 2 || p.oe[1].DataAtom != a.Body {
+				// Ignore the token.
+				return true
+			}
+			body := p.oe[1]
+			if body.Parent != nil {
+				body.Parent.RemoveChild(body)
+			}
+			p.oe = p.oe[:1]
+			p.addElement()
+			p.im = inFramesetIM
+			return true
+		case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+			p.popUntil(buttonScope, a.P)
+			switch n := p.top(); n.DataAtom {
+			case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+				p.oe.pop()
+			}
+			p.addElement()
+		case a.Pre, a.Listing:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+			// The newline, if any, will be dealt with by the TextToken case.
+			p.framesetOK = false
+		case a.Form:
+			if p.form == nil {
+				p.popUntil(buttonScope, a.P)
+				p.addElement()
+				p.form = p.top()
+			}
+		case a.Li:
+			p.framesetOK = false
+			for i := len(p.oe) - 1; i >= 0; i-- {
+				node := p.oe[i]
+				switch node.DataAtom {
+				case a.Li:
+					p.oe = p.oe[:i]
+				case a.Address, a.Div, a.P:
+					continue
+				default:
+					if !isSpecialElement(node) {
+						continue
+					}
+				}
+				break
+			}
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Dd, a.Dt:
+			p.framesetOK = false
+			for i := len(p.oe) - 1; i >= 0; i-- {
+				node := p.oe[i]
+				switch node.DataAtom {
+				case a.Dd, a.Dt:
+					p.oe = p.oe[:i]
+				case a.Address, a.Div, a.P:
+					continue
+				default:
+					if !isSpecialElement(node) {
+						continue
+					}
+				}
+				break
+			}
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Plaintext:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Button:
+			p.popUntil(defaultScope, a.Button)
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.framesetOK = false
+		case a.A:
+			for i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scopeMarkerNode; i-- {
+				if n := p.afe[i]; n.Type == ElementNode && n.DataAtom == a.A {
+					p.inBodyEndTagFormatting(a.A)
+					p.oe.remove(n)
+					p.afe.remove(n)
+					break
+				}
+			}
+			p.reconstructActiveFormattingElements()
+			p.addFormattingElement()
+		case a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
+			p.reconstructActiveFormattingElements()
+			p.addFormattingElement()
+		case a.Nobr:
+			p.reconstructActiveFormattingElements()
+			if p.elementInScope(defaultScope, a.Nobr) {
+				p.inBodyEndTagFormatting(a.Nobr)
+				p.reconstructActiveFormattingElements()
+			}
+			p.addFormattingElement()
+		case a.Applet, a.Marquee, a.Object:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.afe = append(p.afe, &scopeMarker)
+			p.framesetOK = false
+		case a.Table:
+			if !p.quirks {
+				p.popUntil(buttonScope, a.P)
+			}
+			p.addElement()
+			p.framesetOK = false
+			p.im = inTableIM
+			return true
+		case a.Area, a.Br, a.Embed, a.Img, a.Input, a.Keygen, a.Wbr:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+			if p.tok.DataAtom == a.Input {
+				for _, t := range p.tok.Attr {
+					if t.Key == "type" {
+						if strings.ToLower(t.Val) == "hidden" {
+							// Skip setting framesetOK = false
+							return true
+						}
+					}
+				}
+			}
+			p.framesetOK = false
+		case a.Param, a.Source, a.Track:
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+		case a.Hr:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+			p.framesetOK = false
+		case a.Image:
+			p.tok.DataAtom = a.Img
+			p.tok.Data = a.Img.String()
+			return false
+		case a.Isindex:
+			if p.form != nil {
+				// Ignore the token.
+				return true
+			}
+			action := ""
+			prompt := "This is a searchable index. Enter search keywords: "
+			attr := []Attribute{{Key: "name", Val: "isindex"}}
+			for _, t := range p.tok.Attr {
+				switch t.Key {
+				case "action":
+					action = t.Val
+				case "name":
+					// Ignore the attribute.
+				case "prompt":
+					prompt = t.Val
+				default:
+					attr = append(attr, t)
+				}
+			}
+			p.acknowledgeSelfClosingTag()
+			p.popUntil(buttonScope, a.P)
+			p.parseImpliedToken(StartTagToken, a.Form, a.Form.String())
+			if action != "" {
+				p.form.Attr = []Attribute{{Key: "action", Val: action}}
+			}
+			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
+			p.parseImpliedToken(StartTagToken, a.Label, a.Label.String())
+			p.addText(prompt)
+			p.addChild(&Node{
+				Type:     ElementNode,
+				DataAtom: a.Input,
+				Data:     a.Input.String(),
+				Attr:     attr,
+			})
+			p.oe.pop()
+			p.parseImpliedToken(EndTagToken, a.Label, a.Label.String())
+			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
+			p.parseImpliedToken(EndTagToken, a.Form, a.Form.String())
+		case a.Textarea:
+			p.addElement()
+			p.setOriginalIM()
+			p.framesetOK = false
+			p.im = textIM
+		case a.Xmp:
+			p.popUntil(buttonScope, a.P)
+			p.reconstructActiveFormattingElements()
+			p.framesetOK = false
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Iframe:
+			p.framesetOK = false
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Noembed, a.Noscript:
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Select:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.framesetOK = false
+			p.im = inSelectIM
+			return true
+		case a.Optgroup, a.Option:
+			if p.top().DataAtom == a.Option {
+				p.oe.pop()
+			}
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+		case a.Rp, a.Rt:
+			if p.elementInScope(defaultScope, a.Ruby) {
+				p.generateImpliedEndTags()
+			}
+			p.addElement()
+		case a.Math, a.Svg:
+			p.reconstructActiveFormattingElements()
+			if p.tok.DataAtom == a.Math {
+				adjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)
+			} else {
+				adjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)
+			}
+			adjustForeignAttributes(p.tok.Attr)
+			p.addElement()
+			p.top().Namespace = p.tok.Data
+			if p.hasSelfClosingToken {
+				p.oe.pop()
+				p.acknowledgeSelfClosingTag()
+			}
+			return true
+		case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:
+			// Ignore the token.
+		default:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+		}
+	case EndTagToken:
+		switch p.tok.DataAtom {
+		case a.Body:
+			if p.elementInScope(defaultScope, a.Body) {
+				p.im = afterBodyIM
+			}
+		case a.Html:
+			if p.elementInScope(defaultScope, a.Body) {
+				p.parseImpliedToken(EndTagToken, a.Body, a.Body.String())
+				return false
+			}
+			return true
+		case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
+			p.popUntil(defaultScope, p.tok.DataAtom)
+		case a.Form:
+			node := p.form
+			p.form = nil
+			i := p.indexOfElementInScope(defaultScope, a.Form)
+			if node == nil || i == -1 || p.oe[i] != node {
+				// Ignore the token.
+				return true
+			}
+			p.generateImpliedEndTags()
+			p.oe.remove(node)
+		case a.P:
+			if !p.elementInScope(buttonScope, a.P) {
+				p.parseImpliedToken(StartTagToken, a.P, a.P.String())
+			}
+			p.popUntil(buttonScope, a.P)
+		case a.Li:
+			p.popUntil(listItemScope, a.Li)
+		case a.Dd, a.Dt:
+			p.popUntil(defaultScope, p.tok.DataAtom)
+		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+			p.popUntil(defaultScope, a.H1, a.H2, a.H3, a.H4, a.H5, a.H6)
+		case a.A, a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.Nobr, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
+			p.inBodyEndTagFormatting(p.tok.DataAtom)
+		case a.Applet, a.Marquee, a.Object:
+			if p.popUntil(defaultScope, p.tok.DataAtom) {
+				p.clearActiveFormattingElements()
+			}
+		case a.Br:
+			p.tok.Type = StartTagToken
+			return false
+		default:
+			p.inBodyEndTagOther(p.tok.DataAtom)
+		}
+	case CommentToken:
+		p.addChild(&Node{
+			Type: CommentNode,
+			Data: p.tok.Data,
+		})
+	}
+
+	return true
+}
+
+func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) {
+	// This is the "adoption agency" algorithm, described at
+	// https://html.spec.whatwg.org/multipage/syntax.html#adoptionAgency
+
+	// TODO: this is a fairly literal line-by-line translation of that algorithm.
+	// Once the code successfully parses the comprehensive test suite, we should
+	// refactor this code to be more idiomatic.
+
+	// Steps 1-4. The outer loop.
+	for i := 0; i < 8; i++ {
+		// Step 5. Find the formatting element.
+		var formattingElement *Node
+		for j := len(p.afe) - 1; j >= 0; j-- {
+			if p.afe[j].Type == scopeMarkerNode {
+				break
+			}
+			if p.afe[j].DataAtom == tagAtom {
+				formattingElement = p.afe[j]
+				break
+			}
+		}
+		if formattingElement == nil {
+			p.inBodyEndTagOther(tagAtom)
+			return
+		}
+		feIndex := p.oe.index(formattingElement)
+		if feIndex == -1 {
+			p.afe.remove(formattingElement)
+			return
+		}
+		if !p.elementInScope(defaultScope, tagAtom) {
+			// Ignore the tag.
+			return
+		}
+
+		// Steps 9-10. Find the furthest block.
+		var furthestBlock *Node
+		for _, e := range p.oe[feIndex:] {
+			if isSpecialElement(e) {
+				furthestBlock = e
+				break
+			}
+		}
+		if furthestBlock == nil {
+			e := p.oe.pop()
+			for e != formattingElement {
+				e = p.oe.pop()
+			}
+			p.afe.remove(e)
+			return
+		}
+
+		// Steps 11-12. Find the common ancestor and bookmark node.
+		commonAncestor := p.oe[feIndex-1]
+		bookmark := p.afe.index(formattingElement)
+
+		// Step 13. The inner loop. Find the lastNode to reparent.
+		lastNode := furthestBlock
+		node := furthestBlock
+		x := p.oe.index(node)
+		// Steps 13.1-13.2
+		for j := 0; j < 3; j++ {
+			// Step 13.3.
+			x--
+			node = p.oe[x]
+			// Step 13.4 - 13.5.
+			if p.afe.index(node) == -1 {
+				p.oe.remove(node)
+				continue
+			}
+			// Step 13.6.
+			if node == formattingElement {
+				break
+			}
+			// Step 13.7.
+			clone := node.clone()
+			p.afe[p.afe.index(node)] = clone
+			p.oe[p.oe.index(node)] = clone
+			node = clone
+			// Step 13.8.
+			if lastNode == furthestBlock {
+				bookmark = p.afe.index(node) + 1
+			}
+			// Step 13.9.
+			if lastNode.Parent != nil {
+				lastNode.Parent.RemoveChild(lastNode)
+			}
+			node.AppendChild(lastNode)
+			// Step 13.10.
+			lastNode = node
+		}
+
+		// Step 14. Reparent lastNode to the common ancestor,
+		// or for misnested table nodes, to the foster parent.
+		if lastNode.Parent != nil {
+			lastNode.Parent.RemoveChild(lastNode)
+		}
+		switch commonAncestor.DataAtom {
+		case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:
+			p.fosterParent(lastNode)
+		default:
+			commonAncestor.AppendChild(lastNode)
+		}
+
+		// Steps 15-17. Reparent nodes from the furthest block's children
+		// to a clone of the formatting element.
+		clone := formattingElement.clone()
+		reparentChildren(clone, furthestBlock)
+		furthestBlock.AppendChild(clone)
+
+		// Step 18. Fix up the list of active formatting elements.
+		if oldLoc := p.afe.index(formattingElement); oldLoc != -1 && oldLoc < bookmark {
+			// Move the bookmark with the rest of the list.
+			bookmark--
+		}
+		p.afe.remove(formattingElement)
+		p.afe.insert(bookmark, clone)
+
+		// Step 19. Fix up the stack of open elements.
+		p.oe.remove(formattingElement)
+		p.oe.insert(p.oe.index(furthestBlock)+1, clone)
+	}
+}
+
+// inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM.
+// "Any other end tag" handling from 12.2.5.5 The rules for parsing tokens in foreign content
+// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign
+func (p *parser) inBodyEndTagOther(tagAtom a.Atom) {
+	for i := len(p.oe) - 1; i >= 0; i-- {
+		if p.oe[i].DataAtom == tagAtom {
+			p.oe = p.oe[:i]
+			break
+		}
+		if isSpecialElement(p.oe[i]) {
+			break
+		}
+	}
+}
+
+// Section 12.2.5.4.8.
+func textIM(p *parser) bool {
+	switch p.tok.Type {
+	case ErrorToken:
+		p.oe.pop()
+	case TextToken:
+		d := p.tok.Data
+		if n := p.oe.top(); n.DataAtom == a.Textarea && n.FirstChild == nil {
+			// Ignore a newline at the start of a